happstack-yui 7372.5.1 → 7373.5.2
raw patch · 1571 files changed
+30952/−30122 lines, 1571 files
Files
- bundle/align-plugin/align-plugin-coverage.js +3/−3
- bundle/align-plugin/align-plugin-debug.js +2/−2
- bundle/align-plugin/align-plugin-min.js +2/−2
- bundle/align-plugin/align-plugin.js +2/−2
- bundle/anim-base/anim-base-coverage.js +3/−3
- bundle/anim-base/anim-base-debug.js +2/−2
- bundle/anim-base/anim-base-min.js +2/−2
- bundle/anim-base/anim-base.js +2/−2
- bundle/anim-color/anim-color-coverage.js +3/−3
- bundle/anim-color/anim-color-debug.js +2/−2
- bundle/anim-color/anim-color-min.js +2/−2
- bundle/anim-color/anim-color.js +2/−2
- bundle/anim-curve/anim-curve-coverage.js +3/−3
- bundle/anim-curve/anim-curve-debug.js +2/−2
- bundle/anim-curve/anim-curve-min.js +2/−2
- bundle/anim-curve/anim-curve.js +2/−2
- bundle/anim-easing/anim-easing-coverage.js +3/−3
- bundle/anim-easing/anim-easing-debug.js +2/−2
- bundle/anim-easing/anim-easing-min.js +2/−2
- bundle/anim-easing/anim-easing.js +2/−2
- bundle/anim-node-plugin/anim-node-plugin-coverage.js +3/−3
- bundle/anim-node-plugin/anim-node-plugin-debug.js +2/−2
- bundle/anim-node-plugin/anim-node-plugin-min.js +2/−2
- bundle/anim-node-plugin/anim-node-plugin.js +2/−2
- bundle/anim-scroll/anim-scroll-coverage.js +3/−3
- bundle/anim-scroll/anim-scroll-debug.js +2/−2
- bundle/anim-scroll/anim-scroll-min.js +2/−2
- bundle/anim-scroll/anim-scroll.js +2/−2
- bundle/anim-shape-transform/anim-shape-transform-coverage.js +3/−3
- bundle/anim-shape/anim-shape-coverage.js +3/−3
- bundle/anim-shape/anim-shape-debug.js +2/−2
- bundle/anim-shape/anim-shape-min.js +2/−2
- bundle/anim-shape/anim-shape.js +2/−2
- bundle/anim-xy/anim-xy-coverage.js +3/−3
- bundle/anim-xy/anim-xy-debug.js +2/−2
- bundle/anim-xy/anim-xy-min.js +2/−2
- bundle/anim-xy/anim-xy.js +2/−2
- bundle/app-base/app-base-coverage.js +3/−3
- bundle/app-base/app-base-debug.js +2/−2
- bundle/app-base/app-base-min.js +2/−2
- bundle/app-base/app-base.js +2/−2
- bundle/app-content/app-content-coverage.js +3/−3
- bundle/app-content/app-content-debug.js +2/−2
- bundle/app-content/app-content-min.js +2/−2
- bundle/app-content/app-content.js +2/−2
- bundle/app-transitions-css/app-transitions-css-min.css +1/−1
- bundle/app-transitions-css/app-transitions-css.css +1/−1
- bundle/app-transitions-native/app-transitions-native-coverage.js +3/−3
- bundle/app-transitions-native/app-transitions-native-debug.js +2/−2
- bundle/app-transitions-native/app-transitions-native-min.js +2/−2
- bundle/app-transitions-native/app-transitions-native.js +2/−2
- bundle/app-transitions/app-transitions-coverage.js +3/−3
- bundle/app-transitions/app-transitions-debug.js +2/−2
- bundle/app-transitions/app-transitions-min.js +2/−2
- bundle/app-transitions/app-transitions.js +2/−2
- bundle/array-extras/array-extras-coverage.js +3/−3
- bundle/array-extras/array-extras-debug.js +2/−2
- bundle/array-extras/array-extras-min.js +2/−2
- bundle/array-extras/array-extras.js +2/−2
- bundle/array-invoke/array-invoke-coverage.js +3/−3
- bundle/array-invoke/array-invoke-debug.js +2/−2
- bundle/array-invoke/array-invoke-min.js +2/−2
- bundle/array-invoke/array-invoke.js +2/−2
- bundle/arraylist-add/arraylist-add-coverage.js +3/−3
- bundle/arraylist-add/arraylist-add-debug.js +2/−2
- bundle/arraylist-add/arraylist-add-min.js +2/−2
- bundle/arraylist-add/arraylist-add.js +2/−2
- bundle/arraylist-filter/arraylist-filter-coverage.js +3/−3
- bundle/arraylist-filter/arraylist-filter-debug.js +2/−2
- bundle/arraylist-filter/arraylist-filter-min.js +2/−2
- bundle/arraylist-filter/arraylist-filter.js +2/−2
- bundle/arraylist/arraylist-coverage.js +3/−3
- bundle/arraylist/arraylist-debug.js +2/−2
- bundle/arraylist/arraylist-min.js +2/−2
- bundle/arraylist/arraylist.js +2/−2
- bundle/arraysort/arraysort-coverage.js +3/−3
- bundle/arraysort/arraysort-debug.js +2/−2
- bundle/arraysort/arraysort-min.js +2/−2
- bundle/arraysort/arraysort.js +2/−2
- bundle/assets/skins/sam/autocomplete-list.css +1/−1
- bundle/assets/skins/sam/calendar-base.css +1/−1
- bundle/assets/skins/sam/calendar.css +1/−1
- bundle/assets/skins/sam/calendarnavigator.css +1/−1
- bundle/assets/skins/sam/console-filters.css +1/−1
- bundle/assets/skins/sam/console.css +1/−1
- bundle/assets/skins/sam/datatable-base-deprecated.css +1/−1
- bundle/assets/skins/sam/datatable-base.css +1/−1
- bundle/assets/skins/sam/datatable-message.css +1/−1
- bundle/assets/skins/sam/datatable-scroll.css +1/−1
- bundle/assets/skins/sam/datatable-sort.css +1/−1
- bundle/assets/skins/sam/dial.css +1/−1
- bundle/assets/skins/sam/node-flick.css +1/−1
- bundle/assets/skins/sam/node-menunav.css +1/−1
- bundle/assets/skins/sam/overlay.css +1/−1
- bundle/assets/skins/sam/panel.css +1/−1
- bundle/assets/skins/sam/resize-base.css +1/−1
- bundle/assets/skins/sam/scrollview-base.css +1/−1
- bundle/assets/skins/sam/scrollview-list.css +1/−1
- bundle/assets/skins/sam/scrollview-scrollbars.css +1/−1
- bundle/assets/skins/sam/skin.css +1/−1
- bundle/assets/skins/sam/slider-base.css +1/−1
- bundle/assets/skins/sam/tabview.css +1/−1
- bundle/assets/skins/sam/test-console.css +1/−1
- bundle/assets/skins/sam/widget-base.css +1/−1
- bundle/assets/skins/sam/widget-buttons.css +1/−1
- bundle/assets/skins/sam/widget-modality.css +1/−1
- bundle/assets/skins/sam/widget-stack.css +1/−1
- bundle/async-queue/async-queue-coverage.js +3/−3
- bundle/async-queue/async-queue-debug.js +2/−2
- bundle/async-queue/async-queue-min.js +2/−2
- bundle/async-queue/async-queue.js +2/−2
- bundle/attribute-base/attribute-base-coverage.js +3/−3
- bundle/attribute-base/attribute-base-debug.js +2/−2
- bundle/attribute-base/attribute-base-min.js +2/−2
- bundle/attribute-base/attribute-base.js +2/−2
- bundle/attribute-complex/attribute-complex-coverage.js +3/−3
- bundle/attribute-complex/attribute-complex-debug.js +2/−2
- bundle/attribute-complex/attribute-complex-min.js +2/−2
- bundle/attribute-complex/attribute-complex.js +2/−2
- bundle/attribute-core/attribute-core-coverage.js +3/−3
- bundle/attribute-core/attribute-core-debug.js +2/−2
- bundle/attribute-core/attribute-core-min.js +2/−2
- bundle/attribute-core/attribute-core.js +2/−2
- bundle/attribute-events/attribute-events-coverage.js +3/−3
- bundle/attribute-events/attribute-events-debug.js +2/−2
- bundle/attribute-events/attribute-events-min.js +2/−2
- bundle/attribute-events/attribute-events.js +2/−2
- bundle/attribute-extras/attribute-extras-coverage.js +3/−3
- bundle/attribute-extras/attribute-extras-debug.js +2/−2
- bundle/attribute-extras/attribute-extras-min.js +2/−2
- bundle/attribute-extras/attribute-extras.js +2/−2
- bundle/autocomplete-base/autocomplete-base-coverage.js +3/−3
- bundle/autocomplete-base/autocomplete-base-debug.js +2/−2
- bundle/autocomplete-base/autocomplete-base-min.js +2/−2
- bundle/autocomplete-base/autocomplete-base.js +2/−2
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-coverage.js +3/−3
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-debug.js +2/−2
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-min.js +2/−2
- bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js +2/−2
- bundle/autocomplete-filters/autocomplete-filters-coverage.js +3/−3
- bundle/autocomplete-filters/autocomplete-filters-debug.js +2/−2
- bundle/autocomplete-filters/autocomplete-filters-min.js +2/−2
- bundle/autocomplete-filters/autocomplete-filters.js +2/−2
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-coverage.js +3/−3
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-debug.js +2/−2
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-min.js +2/−2
- bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js +2/−2
- bundle/autocomplete-highlighters/autocomplete-highlighters-coverage.js +3/−3
- bundle/autocomplete-highlighters/autocomplete-highlighters-debug.js +2/−2
- bundle/autocomplete-highlighters/autocomplete-highlighters-min.js +2/−2
- bundle/autocomplete-highlighters/autocomplete-highlighters.js +2/−2
- bundle/autocomplete-list-keys/autocomplete-list-keys-coverage.js +3/−3
- bundle/autocomplete-list-keys/autocomplete-list-keys-debug.js +2/−2
- bundle/autocomplete-list-keys/autocomplete-list-keys-min.js +2/−2
- bundle/autocomplete-list-keys/autocomplete-list-keys.js +2/−2
- bundle/autocomplete-list/assets/autocomplete-list-core.css +1/−1
- bundle/autocomplete-list/assets/skins/night/autocomplete-list-skin.css +1/−1
- bundle/autocomplete-list/assets/skins/night/autocomplete-list.css +1/−1
- bundle/autocomplete-list/assets/skins/sam/autocomplete-list-skin.css +1/−1
- bundle/autocomplete-list/assets/skins/sam/autocomplete-list.css +1/−1
- bundle/autocomplete-list/autocomplete-list-coverage.js +3/−3
- bundle/autocomplete-list/autocomplete-list-debug.js +2/−2
- bundle/autocomplete-list/autocomplete-list-min.js +2/−2
- bundle/autocomplete-list/autocomplete-list.js +2/−2
- bundle/autocomplete-list/lang/autocomplete-list.js +2/−2
- bundle/autocomplete-list/lang/autocomplete-list_en.js +2/−2
- bundle/autocomplete-plugin/autocomplete-plugin-coverage.js +3/−3
- bundle/autocomplete-plugin/autocomplete-plugin-debug.js +2/−2
- bundle/autocomplete-plugin/autocomplete-plugin-min.js +2/−2
- bundle/autocomplete-plugin/autocomplete-plugin.js +2/−2
- bundle/autocomplete-sources/autocomplete-sources-coverage.js +3/−3
- bundle/autocomplete-sources/autocomplete-sources-debug.js +2/−2
- bundle/autocomplete-sources/autocomplete-sources-min.js +2/−2
- bundle/autocomplete-sources/autocomplete-sources.js +2/−2
- bundle/base-base/base-base-coverage.js +3/−3
- bundle/base-base/base-base-debug.js +2/−2
- bundle/base-base/base-base-min.js +2/−2
- bundle/base-base/base-base.js +2/−2
- bundle/base-build/base-build-coverage.js +3/−3
- bundle/base-build/base-build-debug.js +2/−2
- bundle/base-build/base-build-min.js +2/−2
- bundle/base-build/base-build.js +2/−2
- bundle/base-core/base-core-coverage.js +3/−3
- bundle/base-core/base-core-debug.js +2/−2
- bundle/base-core/base-core-min.js +2/−2
- bundle/base-core/base-core.js +2/−2
- bundle/base-pluginhost/base-pluginhost-coverage.js +3/−3
- bundle/base-pluginhost/base-pluginhost-debug.js +2/−2
- bundle/base-pluginhost/base-pluginhost-min.js +2/−2
- bundle/base-pluginhost/base-pluginhost.js +2/−2
- bundle/button-core/button-core-coverage.js +3/−3
- bundle/button-core/button-core-debug.js +2/−2
- bundle/button-core/button-core-min.js +2/−2
- bundle/button-core/button-core.js +2/−2
- bundle/button-group/button-group-coverage.js +3/−3
- bundle/button-group/button-group-debug.js +2/−2
- bundle/button-group/button-group-min.js +2/−2
- bundle/button-group/button-group.js +2/−2
- bundle/button-plugin/button-plugin-coverage.js +3/−3
- bundle/button-plugin/button-plugin-debug.js +2/−2
- bundle/button-plugin/button-plugin-min.js +2/−2
- bundle/button-plugin/button-plugin.js +2/−2
- bundle/button/button-coverage.js +3/−3
- bundle/button/button-debug.js +2/−2
- bundle/button/button-min.js +2/−2
- bundle/button/button.js +2/−2
- bundle/cache-base/cache-base-coverage.js +3/−3
- bundle/cache-base/cache-base-debug.js +2/−2
- bundle/cache-base/cache-base-min.js +2/−2
- bundle/cache-base/cache-base.js +2/−2
- bundle/cache-offline/cache-offline-coverage.js +3/−3
- bundle/cache-offline/cache-offline-debug.js +2/−2
- bundle/cache-offline/cache-offline-min.js +2/−2
- bundle/cache-offline/cache-offline.js +2/−2
- bundle/cache-plugin/cache-plugin-coverage.js +3/−3
- bundle/cache-plugin/cache-plugin-debug.js +2/−2
- bundle/cache-plugin/cache-plugin-min.js +2/−2
- bundle/cache-plugin/cache-plugin.js +2/−2
- bundle/calendar-base/assets/calendar-base-core.css +1/−1
- bundle/calendar-base/assets/skins/night/calendar-base-skin.css +1/−1
- bundle/calendar-base/assets/skins/night/calendar-base.css +1/−1
- bundle/calendar-base/assets/skins/sam/calendar-base-skin.css +1/−1
- bundle/calendar-base/assets/skins/sam/calendar-base.css +1/−1
- bundle/calendar-base/calendar-base-coverage.js +3/−3
- bundle/calendar-base/calendar-base-debug.js +2/−2
- bundle/calendar-base/calendar-base-min.js +2/−2
- bundle/calendar-base/calendar-base.js +2/−2
- bundle/calendar-base/lang/calendar-base.js +2/−2
- bundle/calendar-base/lang/calendar-base_de.js +2/−2
- bundle/calendar-base/lang/calendar-base_en.js +2/−2
- bundle/calendar-base/lang/calendar-base_fr.js +2/−2
- bundle/calendar-base/lang/calendar-base_ja.js +2/−2
- bundle/calendar-base/lang/calendar-base_nb-NO.js +2/−2
- bundle/calendar-base/lang/calendar-base_pt-BR.js +2/−2
- bundle/calendar-base/lang/calendar-base_ru.js +2/−2
- bundle/calendar-base/lang/calendar-base_zh-HANT-TW.js +2/−2
- bundle/calendar/assets/calendar-core.css +1/−1
- bundle/calendar/assets/skins/night/calendar-skin.css +1/−1
- bundle/calendar/assets/skins/night/calendar.css +1/−1
- bundle/calendar/assets/skins/sam/calendar-skin.css +1/−1
- bundle/calendar/assets/skins/sam/calendar.css +1/−1
- bundle/calendar/calendar-coverage.js +3/−3
- bundle/calendar/calendar-debug.js +2/−2
- bundle/calendar/calendar-min.js +2/−2
- bundle/calendar/calendar.js +2/−2
- bundle/calendar/lang/calendar.js +2/−2
- bundle/calendar/lang/calendar_de.js +2/−2
- bundle/calendar/lang/calendar_en.js +2/−2
- bundle/calendar/lang/calendar_fr.js +2/−2
- bundle/calendar/lang/calendar_ja.js +2/−2
- bundle/calendar/lang/calendar_nb-NO.js +2/−2
- bundle/calendar/lang/calendar_pt-BR.js +2/−2
- bundle/calendar/lang/calendar_ru.js +2/−2
- bundle/calendar/lang/calendar_zh-HANT-TW.js +2/−2
- bundle/calendarnavigator/assets/calendarnavigator-core.css +1/−1
- bundle/calendarnavigator/assets/skins/night/calendarnavigator-skin.css +1/−1
- bundle/calendarnavigator/assets/skins/night/calendarnavigator.css +1/−1
- bundle/calendarnavigator/assets/skins/sam/calendarnavigator-skin.css +1/−1
- bundle/calendarnavigator/assets/skins/sam/calendarnavigator.css +1/−1
- bundle/calendarnavigator/calendarnavigator-coverage.js +3/−3
- bundle/calendarnavigator/calendarnavigator-debug.js +2/−2
- bundle/calendarnavigator/calendarnavigator-min.js +2/−2
- bundle/calendarnavigator/calendarnavigator.js +2/−2
- bundle/charts-base/charts-base-coverage.js +3/−3
- bundle/charts-base/charts-base-debug.js +2/−2
- bundle/charts-base/charts-base-min.js +2/−2
- bundle/charts-base/charts-base.js +2/−2
- bundle/charts-legend/charts-legend-coverage.js +3/−3
- bundle/charts-legend/charts-legend-debug.js +2/−2
- bundle/charts-legend/charts-legend-min.js +2/−2
- bundle/charts-legend/charts-legend.js +2/−2
- bundle/charts/charts-coverage.js +3/−3
- bundle/charts/charts-debug.js +2/−2
- bundle/charts/charts-min.js +2/−2
- bundle/charts/charts.js +2/−2
- bundle/classnamemanager/classnamemanager-coverage.js +3/−3
- bundle/classnamemanager/classnamemanager-debug.js +2/−2
- bundle/classnamemanager/classnamemanager-min.js +2/−2
- bundle/classnamemanager/classnamemanager.js +2/−2
- bundle/clickable-rail/assets/slider-base-core.css +1/−1
- bundle/clickable-rail/assets/slider-core.css +1/−1
- bundle/clickable-rail/clickable-rail-coverage.js +3/−3
- bundle/clickable-rail/clickable-rail-debug.js +2/−2
- bundle/clickable-rail/clickable-rail-min.js +2/−2
- bundle/clickable-rail/clickable-rail.js +2/−2
- bundle/console-filters/assets/console-filters-core.css +1/−1
- bundle/console-filters/assets/skins/sam/console-filters-skin.css +1/−1
- bundle/console-filters/assets/skins/sam/console-filters.css +1/−1
- bundle/console-filters/console-filters-coverage.js +3/−3
- bundle/console-filters/console-filters-debug.js +2/−2
- bundle/console-filters/console-filters-min.js +2/−2
- bundle/console-filters/console-filters.js +2/−2
- bundle/console/assets/console-core.css +1/−1
- bundle/console/assets/console-filters-core.css +1/−1
- bundle/console/assets/skins/sam/console-filters-skin.css +1/−1
- bundle/console/assets/skins/sam/console-filters.css +1/−1
- bundle/console/assets/skins/sam/console-skin.css +1/−1
- bundle/console/assets/skins/sam/console.css +1/−1
- bundle/console/console-coverage.js +18/−21
- bundle/console/console-debug.js +3/−6
- bundle/console/console-min.js +2/−2
- bundle/console/console.js +3/−6
- bundle/console/lang/console.js +2/−2
- bundle/console/lang/console_en.js +2/−2
- bundle/console/lang/console_es.js +2/−2
- bundle/console/lang/console_ja.js +2/−2
- bundle/cookie/cookie-coverage.js +3/−3
- bundle/cookie/cookie-debug.js +2/−2
- bundle/cookie/cookie-min.js +2/−2
- bundle/cookie/cookie.js +2/−2
- bundle/createlink-base/createlink-base-coverage.js +34/−33
- bundle/createlink-base/createlink-base-debug.js +5/−4
- bundle/createlink-base/createlink-base-min.js +2/−2
- bundle/createlink-base/createlink-base.js +5/−4
- bundle/cssbase-context/base-context-min.css +1/−1
- bundle/cssbase-context/base-context.css +1/−1
- bundle/cssbase-context/cssbase-context-min.css +1/−1
- bundle/cssbase-context/cssbase-context.css +1/−1
- bundle/cssbase/base-min.css +1/−1
- bundle/cssbase/base.css +1/−1
- bundle/cssbase/cssbase-min.css +1/−1
- bundle/cssbase/cssbase.css +1/−1
- bundle/cssbutton/cssbutton-min.css +1/−1
- bundle/cssbutton/cssbutton.css +1/−1
- bundle/cssfonts-context/cssfonts-context-min.css +1/−1
- bundle/cssfonts-context/cssfonts-context.css +1/−1
- bundle/cssfonts-context/fonts-context-min.css +1/−1
- bundle/cssfonts-context/fonts-context.css +1/−1
- bundle/cssfonts/cssfonts-min.css +1/−1
- bundle/cssfonts/cssfonts.css +1/−1
- bundle/cssfonts/fonts-min.css +1/−1
- bundle/cssfonts/fonts.css +1/−1
- bundle/cssgrids-base/cssgrids-base-min.css +1/−1
- bundle/cssgrids-base/cssgrids-base.css +1/−1
- bundle/cssgrids-context-deprecated/grids-context-min.css +1/−1
- bundle/cssgrids-context-deprecated/grids-context.css +1/−1
- bundle/cssgrids-units/cssgrids-units-min.css +1/−1
- bundle/cssgrids-units/cssgrids-units.css +1/−1
- bundle/cssgrids/cssgrids-min.css +1/−1
- bundle/cssgrids/cssgrids.css +1/−1
- bundle/cssgrids/grids-min.css +1/−1
- bundle/cssgrids/grids.css +1/−1
- bundle/cssreset-context/cssreset-context-min.css +1/−1
- bundle/cssreset-context/cssreset-context.css +1/−1
- bundle/cssreset-context/reset-context-min.css +1/−1
- bundle/cssreset-context/reset-context.css +1/−1
- bundle/cssreset/cssreset-min.css +1/−1
- bundle/cssreset/cssreset.css +1/−1
- bundle/cssreset/reset-min.css +1/−1
- bundle/cssreset/reset.css +1/−1
- bundle/dataschema-array/dataschema-array-coverage.js +3/−3
- bundle/dataschema-array/dataschema-array-debug.js +2/−2
- bundle/dataschema-array/dataschema-array-min.js +2/−2
- bundle/dataschema-array/dataschema-array.js +2/−2
- bundle/dataschema-base/dataschema-base-coverage.js +3/−3
- bundle/dataschema-base/dataschema-base-debug.js +2/−2
- bundle/dataschema-base/dataschema-base-min.js +2/−2
- bundle/dataschema-base/dataschema-base.js +2/−2
- bundle/dataschema-json/dataschema-json-coverage.js +3/−3
- bundle/dataschema-json/dataschema-json-debug.js +2/−2
- bundle/dataschema-json/dataschema-json-min.js +2/−2
- bundle/dataschema-json/dataschema-json.js +2/−2
- bundle/dataschema-text/dataschema-text-coverage.js +3/−3
- bundle/dataschema-text/dataschema-text-debug.js +2/−2
- bundle/dataschema-text/dataschema-text-min.js +2/−2
- bundle/dataschema-text/dataschema-text.js +2/−2
- bundle/dataschema-xml/dataschema-xml-coverage.js +81/−76
- bundle/dataschema-xml/dataschema-xml-debug.js +8/−4
- bundle/dataschema-xml/dataschema-xml-min.js +2/−2
- bundle/dataschema-xml/dataschema-xml.js +8/−4
- bundle/datasource-arrayschema/datasource-arrayschema-coverage.js +3/−3
- bundle/datasource-arrayschema/datasource-arrayschema-debug.js +2/−2
- bundle/datasource-arrayschema/datasource-arrayschema-min.js +2/−2
- bundle/datasource-arrayschema/datasource-arrayschema.js +2/−2
- bundle/datasource-cache/datasource-cache-coverage.js +3/−3
- bundle/datasource-cache/datasource-cache-debug.js +2/−2
- bundle/datasource-cache/datasource-cache-min.js +2/−2
- bundle/datasource-cache/datasource-cache.js +2/−2
- bundle/datasource-function/datasource-function-coverage.js +3/−3
- bundle/datasource-function/datasource-function-debug.js +2/−2
- bundle/datasource-function/datasource-function-min.js +2/−2
- bundle/datasource-function/datasource-function.js +2/−2
- bundle/datasource-get/datasource-get-coverage.js +3/−3
- bundle/datasource-get/datasource-get-debug.js +2/−2
- bundle/datasource-get/datasource-get-min.js +2/−2
- bundle/datasource-get/datasource-get.js +2/−2
- bundle/datasource-io/datasource-io-coverage.js +3/−3
- bundle/datasource-io/datasource-io-debug.js +2/−2
- bundle/datasource-io/datasource-io-min.js +2/−2
- bundle/datasource-io/datasource-io.js +2/−2
- bundle/datasource-jsonschema/datasource-jsonschema-coverage.js +3/−3
- bundle/datasource-jsonschema/datasource-jsonschema-debug.js +2/−2
- bundle/datasource-jsonschema/datasource-jsonschema-min.js +2/−2
- bundle/datasource-jsonschema/datasource-jsonschema.js +2/−2
- bundle/datasource-local/datasource-local-coverage.js +3/−3
- bundle/datasource-local/datasource-local-debug.js +2/−2
- bundle/datasource-local/datasource-local-min.js +2/−2
- bundle/datasource-local/datasource-local.js +2/−2
- bundle/datasource-polling/datasource-polling-coverage.js +3/−3
- bundle/datasource-polling/datasource-polling-debug.js +2/−2
- bundle/datasource-polling/datasource-polling-min.js +2/−2
- bundle/datasource-polling/datasource-polling.js +2/−2
- bundle/datasource-textschema/datasource-textschema-coverage.js +3/−3
- bundle/datasource-textschema/datasource-textschema-debug.js +2/−2
- bundle/datasource-textschema/datasource-textschema-min.js +2/−2
- bundle/datasource-textschema/datasource-textschema.js +2/−2
- bundle/datasource-xmlschema/datasource-xmlschema-coverage.js +4/−4
- bundle/datasource-xmlschema/datasource-xmlschema-debug.js +3/−3
- bundle/datasource-xmlschema/datasource-xmlschema-min.js +2/−2
- bundle/datasource-xmlschema/datasource-xmlschema.js +3/−3
- bundle/datatable-base-deprecated/assets/datatable-base-deprecated-core.css +1/−1
- bundle/datatable-base-deprecated/assets/skins/night/datatable-base-deprecated-skin.css +1/−1
- bundle/datatable-base-deprecated/assets/skins/night/datatable-base-deprecated.css +1/−1
- bundle/datatable-base-deprecated/assets/skins/sam/datatable-base-deprecated-skin.css +1/−1
- bundle/datatable-base-deprecated/assets/skins/sam/datatable-base-deprecated.css +1/−1
- bundle/datatable-base-deprecated/datatable-base-deprecated-coverage.js +3/−3
- bundle/datatable-base-deprecated/datatable-base-deprecated-debug.js +2/−2
- bundle/datatable-base-deprecated/datatable-base-deprecated-min.js +2/−2
- bundle/datatable-base-deprecated/datatable-base-deprecated.js +2/−2
- bundle/datatable-base/assets/datatable-base-core.css +1/−1
- bundle/datatable-base/assets/skins/night/datatable-base-skin.css +1/−1
- bundle/datatable-base/assets/skins/night/datatable-base.css +1/−1
- bundle/datatable-base/assets/skins/sam/datatable-base-skin.css +1/−1
- bundle/datatable-base/assets/skins/sam/datatable-base.css +1/−1
- bundle/datatable-base/datatable-base-coverage.js +3/−3
- bundle/datatable-base/datatable-base-debug.js +2/−2
- bundle/datatable-base/datatable-base-min.js +2/−2
- bundle/datatable-base/datatable-base.js +2/−2
- bundle/datatable-body/datatable-body-coverage.js +3/−3
- bundle/datatable-body/datatable-body-debug.js +2/−2
- bundle/datatable-body/datatable-body-min.js +2/−2
- bundle/datatable-body/datatable-body.js +2/−2
- bundle/datatable-column-widths/datatable-column-widths-coverage.js +3/−3
- bundle/datatable-column-widths/datatable-column-widths-debug.js +2/−2
- bundle/datatable-column-widths/datatable-column-widths-min.js +2/−2
- bundle/datatable-column-widths/datatable-column-widths.js +2/−2
- bundle/datatable-core/datatable-core-coverage.js +3/−3
- bundle/datatable-core/datatable-core-debug.js +2/−2
- bundle/datatable-core/datatable-core-min.js +2/−2
- bundle/datatable-core/datatable-core.js +2/−2
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-coverage.js +3/−3
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-debug.js +2/−2
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-min.js +2/−2
- bundle/datatable-datasource-deprecated/datatable-datasource-deprecated.js +2/−2
- bundle/datatable-datasource/datatable-datasource-coverage.js +3/−3
- bundle/datatable-datasource/datatable-datasource-debug.js +2/−2
- bundle/datatable-datasource/datatable-datasource-min.js +2/−2
- bundle/datatable-datasource/datatable-datasource.js +2/−2
- bundle/datatable-head/datatable-head-coverage.js +3/−3
- bundle/datatable-head/datatable-head-debug.js +2/−2
- bundle/datatable-head/datatable-head-min.js +2/−2
- bundle/datatable-head/datatable-head.js +2/−2
- bundle/datatable-message/assets/datatable-message-core.css +1/−1
- bundle/datatable-message/assets/skins/night/datatable-message-skin.css +1/−1
- bundle/datatable-message/assets/skins/night/datatable-message.css +1/−1
- bundle/datatable-message/assets/skins/sam/datatable-message-skin.css +1/−1
- bundle/datatable-message/assets/skins/sam/datatable-message.css +1/−1
- bundle/datatable-message/datatable-message-coverage.js +3/−3
- bundle/datatable-message/datatable-message-debug.js +2/−2
- bundle/datatable-message/datatable-message-min.js +2/−2
- bundle/datatable-message/datatable-message.js +2/−2
- bundle/datatable-message/lang/datatable-message.js +2/−2
- bundle/datatable-message/lang/datatable-message_en.js +2/−2
- bundle/datatable-mutable/datatable-mutable-coverage.js +3/−3
- bundle/datatable-mutable/datatable-mutable-debug.js +2/−2
- bundle/datatable-mutable/datatable-mutable-min.js +2/−2
- bundle/datatable-mutable/datatable-mutable.js +2/−2
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-coverage.js +3/−3
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-debug.js +2/−2
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-min.js +2/−2
- bundle/datatable-scroll-deprecated/datatable-scroll-deprecated.js +2/−2
- bundle/datatable-scroll/assets/datatable-scroll-core.css +1/−1
- bundle/datatable-scroll/assets/skins/night/datatable-scroll-skin.css +1/−1
- bundle/datatable-scroll/assets/skins/night/datatable-scroll.css +1/−1
- bundle/datatable-scroll/assets/skins/sam/datatable-scroll-skin.css +1/−1
- bundle/datatable-scroll/assets/skins/sam/datatable-scroll.css +1/−1
- bundle/datatable-scroll/datatable-scroll-coverage.js +3/−3
- bundle/datatable-scroll/datatable-scroll-debug.js +2/−2
- bundle/datatable-scroll/datatable-scroll-min.js +2/−2
- bundle/datatable-scroll/datatable-scroll.js +2/−2
- bundle/datatable-sort-deprecated/datatable-sort-deprecated-coverage.js +3/−3
- bundle/datatable-sort-deprecated/datatable-sort-deprecated-debug.js +2/−2
- bundle/datatable-sort-deprecated/datatable-sort-deprecated-min.js +2/−2
- bundle/datatable-sort-deprecated/datatable-sort-deprecated.js +2/−2
- bundle/datatable-sort-deprecated/lang/datatable-sort-deprecated.js +2/−2
- bundle/datatable-sort-deprecated/lang/datatable-sort-deprecated_en.js +2/−2
- bundle/datatable-sort/assets/datatable-sort-core.css +1/−1
- bundle/datatable-sort/assets/skins/night/datatable-sort-skin.css +1/−1
- bundle/datatable-sort/assets/skins/night/datatable-sort.css +1/−1
- bundle/datatable-sort/assets/skins/sam/datatable-sort-skin.css +1/−1
- bundle/datatable-sort/assets/skins/sam/datatable-sort.css +1/−1
- bundle/datatable-sort/datatable-sort-coverage.js +3/−3
- bundle/datatable-sort/datatable-sort-debug.js +2/−2
- bundle/datatable-sort/datatable-sort-min.js +2/−2
- bundle/datatable-sort/datatable-sort.js +2/−2
- bundle/datatable-sort/lang/datatable-sort.js +2/−2
- bundle/datatable-sort/lang/datatable-sort_en.js +2/−2
- bundle/datatable-table/datatable-table-coverage.js +3/−3
- bundle/datatable-table/datatable-table-debug.js +2/−2
- bundle/datatable-table/datatable-table-min.js +2/−2
- bundle/datatable-table/datatable-table.js +2/−2
- bundle/datatype-date-format/datatype-date-format-coverage.js +3/−3
- bundle/datatype-date-format/datatype-date-format-debug.js +2/−2
- bundle/datatype-date-format/datatype-date-format-min.js +2/−2
- bundle/datatype-date-format/datatype-date-format.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ar-JO.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ar.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ca-ES.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ca.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_da-DK.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_da.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_de-AT.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_de-DE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_de.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_el-GR.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_el.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-AU.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-CA.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-GB.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-IE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-IN.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-JO.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-MY.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-NZ.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-PH.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-SG.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en-US.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_en.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-AR.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-BO.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-CL.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-CO.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-EC.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-ES.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-MX.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-PE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-PY.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-US.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-UY.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es-VE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_es.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_fi-FI.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_fi.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_fr-BE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_fr-CA.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_fr-FR.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_fr.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_hi-IN.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_hi.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_id-ID.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_id.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_it-IT.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_it.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ja-JP.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ja.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ko-KR.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ko.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ms-MY.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ms.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_nb-NO.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_nb.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_nl-BE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_nl-NL.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_nl.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_pl-PL.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_pl.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_pt-BR.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_pt.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ro-RO.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ro.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ru-RU.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_ru.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_sv-SE.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_sv.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_th-TH.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_th.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_tr-TR.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_tr.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_vi-VN.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_vi.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hans-CN.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hans.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hant-HK.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hant-TW.js +2/−2
- bundle/datatype-date-format/lang/datatype-date-format_zh-Hant.js +2/−2
- bundle/datatype-date-math/datatype-date-math-coverage.js +3/−3
- bundle/datatype-date-math/datatype-date-math-debug.js +2/−2
- bundle/datatype-date-math/datatype-date-math-min.js +2/−2
- bundle/datatype-date-math/datatype-date-math.js +2/−2
- bundle/datatype-date-parse/datatype-date-parse-coverage.js +3/−3
- bundle/datatype-date-parse/datatype-date-parse-debug.js +2/−2
- bundle/datatype-date-parse/datatype-date-parse-min.js +2/−2
- bundle/datatype-date-parse/datatype-date-parse.js +2/−2
- bundle/datatype-number-format/datatype-number-format-coverage.js +3/−3
- bundle/datatype-number-format/datatype-number-format-debug.js +2/−2
- bundle/datatype-number-format/datatype-number-format-min.js +2/−2
- bundle/datatype-number-format/datatype-number-format.js +2/−2
- bundle/datatype-number-parse/datatype-number-parse-coverage.js +3/−3
- bundle/datatype-number-parse/datatype-number-parse-debug.js +2/−2
- bundle/datatype-number-parse/datatype-number-parse-min.js +2/−2
- bundle/datatype-number-parse/datatype-number-parse.js +2/−2
- bundle/datatype-xml-format/datatype-xml-format-coverage.js +17/−11
- bundle/datatype-xml-format/datatype-xml-format-debug.js +6/−2
- bundle/datatype-xml-format/datatype-xml-format-min.js +2/−2
- bundle/datatype-xml-format/datatype-xml-format.js +6/−2
- bundle/datatype-xml-parse/datatype-xml-parse-coverage.js +18/−11
- bundle/datatype-xml-parse/datatype-xml-parse-debug.js +8/−4
- bundle/datatype-xml-parse/datatype-xml-parse-min.js +2/−2
- bundle/datatype-xml-parse/datatype-xml-parse.js +7/−3
- bundle/dd-constrain/dd-constrain-coverage.js +180/−173
- bundle/dd-constrain/dd-constrain-debug.js +19/−12
- bundle/dd-constrain/dd-constrain-min.js +2/−2
- bundle/dd-constrain/dd-constrain.js +19/−12
- bundle/dd-ddm-base/dd-ddm-base-coverage.js +68/−67
- bundle/dd-ddm-base/dd-ddm-base-debug.js +21/−20
- bundle/dd-ddm-base/dd-ddm-base-min.js +2/−2
- bundle/dd-ddm-base/dd-ddm-base.js +21/−20
- bundle/dd-ddm-drop/dd-ddm-drop-coverage.js +177/−176
- bundle/dd-ddm-drop/dd-ddm-drop-debug.js +33/−32
- bundle/dd-ddm-drop/dd-ddm-drop-min.js +2/−2
- bundle/dd-ddm-drop/dd-ddm-drop.js +33/−32
- bundle/dd-ddm/dd-ddm-coverage.js +48/−47
- bundle/dd-ddm/dd-ddm-debug.js +8/−7
- bundle/dd-ddm/dd-ddm-min.js +2/−2
- bundle/dd-ddm/dd-ddm.js +8/−7
- bundle/dd-delegate/dd-delegate-coverage.js +26/−26
- bundle/dd-delegate/dd-delegate-debug.js +25/−25
- bundle/dd-delegate/dd-delegate-min.js +2/−2
- bundle/dd-delegate/dd-delegate.js +25/−25
- bundle/dd-drag/dd-drag-coverage.js +366/−352
- bundle/dd-drag/dd-drag-debug.js +70/−59
- bundle/dd-drag/dd-drag-min.js +2/−2
- bundle/dd-drag/dd-drag.js +68/−57
- bundle/dd-drop-plugin/dd-drop-plugin-coverage.js +4/−4
- bundle/dd-drop-plugin/dd-drop-plugin-debug.js +3/−3
- bundle/dd-drop-plugin/dd-drop-plugin-min.js +2/−2
- bundle/dd-drop-plugin/dd-drop-plugin.js +3/−3
- bundle/dd-drop/dd-drop-coverage.js +174/−172
- bundle/dd-drop/dd-drop-debug.js +27/−25
- bundle/dd-drop/dd-drop-min.js +2/−2
- bundle/dd-drop/dd-drop.js +27/−25
- bundle/dd-gestures/dd-gestures-coverage.js +29/−15
- bundle/dd-gestures/dd-gestures-debug.js +13/−5
- bundle/dd-gestures/dd-gestures-min.js +2/−2
- bundle/dd-gestures/dd-gestures.js +13/−5
- bundle/dd-plugin/dd-plugin-coverage.js +12/−12
- bundle/dd-plugin/dd-plugin-debug.js +11/−11
- bundle/dd-plugin/dd-plugin-min.js +2/−2
- bundle/dd-plugin/dd-plugin.js +11/−11
- bundle/dd-proxy/dd-proxy-coverage.js +9/−9
- bundle/dd-proxy/dd-proxy-debug.js +8/−8
- bundle/dd-proxy/dd-proxy-min.js +2/−2
- bundle/dd-proxy/dd-proxy.js +8/−8
- bundle/dd-scroll/dd-scroll-coverage.js +14/−14
- bundle/dd-scroll/dd-scroll-debug.js +13/−13
- bundle/dd-scroll/dd-scroll-min.js +2/−2
- bundle/dd-scroll/dd-scroll.js +13/−13
- bundle/dial/assets/dial-core.css +1/−1
- bundle/dial/assets/skins/night/dial-skin.css +1/−1
- bundle/dial/assets/skins/night/dial.css +1/−1
- bundle/dial/assets/skins/sam/dial-skin.css +1/−1
- bundle/dial/assets/skins/sam/dial.css +1/−1
- bundle/dial/dial-coverage.js +457/−451
- bundle/dial/dial-debug.js +204/−197
- bundle/dial/dial-min.js +2/−2
- bundle/dial/dial.js +204/−197
- bundle/dial/lang/dial.js +2/−2
- bundle/dial/lang/dial_en.js +2/−2
- bundle/dial/lang/dial_es.js +2/−2
- bundle/dom-attrs/dom-attrs-debug.js +2/−2
- bundle/dom-attrs/dom-attrs-min.js +2/−2
- bundle/dom-attrs/dom-attrs.js +2/−2
- bundle/dom-base/dom-base-coverage.js +3/−3
- bundle/dom-base/dom-base-debug.js +2/−2
- bundle/dom-base/dom-base-min.js +2/−2
- bundle/dom-base/dom-base.js +2/−2
- bundle/dom-class/dom-class-debug.js +2/−2
- bundle/dom-class/dom-class-min.js +2/−2
- bundle/dom-class/dom-class.js +2/−2
- bundle/dom-core/dom-core-coverage.js +4/−4
- bundle/dom-core/dom-core-debug.js +3/−3
- bundle/dom-core/dom-core-min.js +2/−2
- bundle/dom-core/dom-core.js +3/−3
- bundle/dom-create/dom-create-debug.js +2/−2
- bundle/dom-create/dom-create-min.js +2/−2
- bundle/dom-create/dom-create.js +2/−2
- bundle/dom-deprecated/dom-deprecated-coverage.js +3/−3
- bundle/dom-deprecated/dom-deprecated-debug.js +2/−2
- bundle/dom-deprecated/dom-deprecated-min.js +2/−2
- bundle/dom-deprecated/dom-deprecated.js +2/−2
- bundle/dom-screen/dom-screen-coverage.js +3/−3
- bundle/dom-screen/dom-screen-debug.js +2/−2
- bundle/dom-screen/dom-screen-min.js +2/−2
- bundle/dom-screen/dom-screen.js +2/−2
- bundle/dom-size/dom-size-debug.js +2/−2
- bundle/dom-size/dom-size-min.js +2/−2
- bundle/dom-size/dom-size.js +2/−2
- bundle/dom-style-ie/dom-style-ie-coverage.js +3/−3
- bundle/dom-style-ie/dom-style-ie-debug.js +2/−2
- bundle/dom-style-ie/dom-style-ie-min.js +2/−2
- bundle/dom-style-ie/dom-style-ie.js +2/−2
- bundle/dom-style/dom-style-coverage.js +3/−3
- bundle/dom-style/dom-style-debug.js +2/−2
- bundle/dom-style/dom-style-min.js +2/−2
- bundle/dom-style/dom-style.js +2/−2
- bundle/dump/dump-coverage.js +3/−3
- bundle/dump/dump-debug.js +2/−2
- bundle/dump/dump-min.js +2/−2
- bundle/dump/dump.js +2/−2
- bundle/editor-base/editor-base-coverage.js +349/−344
- bundle/editor-base/editor-base-debug.js +84/−74
- bundle/editor-base/editor-base-min.js +2/−2
- bundle/editor-base/editor-base.js +84/−73
- bundle/editor-bidi/editor-bidi-coverage.js +97/−95
- bundle/editor-bidi/editor-bidi-debug.js +26/−25
- bundle/editor-bidi/editor-bidi-min.js +2/−2
- bundle/editor-bidi/editor-bidi.js +26/−25
- bundle/editor-br/editor-br-coverage.js +43/−48
- bundle/editor-br/editor-br-debug.js +9/−11
- bundle/editor-br/editor-br-min.js +2/−2
- bundle/editor-br/editor-br.js +9/−11
- bundle/editor-lists/editor-lists-coverage.js +51/−49
- bundle/editor-lists/editor-lists-debug.js +9/−7
- bundle/editor-lists/editor-lists-min.js +2/−2
- bundle/editor-lists/editor-lists.js +9/−7
- bundle/editor-para-base/editor-para-base-coverage.js +25/−26
- bundle/editor-para-base/editor-para-base-debug.js +8/−9
- bundle/editor-para-base/editor-para-base-min.js +2/−2
- bundle/editor-para-base/editor-para-base.js +8/−9
- bundle/editor-para-ie/editor-para-ie-coverage.js +18/−17
- bundle/editor-para-ie/editor-para-ie-debug.js +14/−14
- bundle/editor-para-ie/editor-para-ie-min.js +2/−2
- bundle/editor-para-ie/editor-para-ie.js +14/−14
- bundle/editor-para/editor-para-coverage.js +172/−169
- bundle/editor-para/editor-para-debug.js +17/−15
- bundle/editor-para/editor-para-min.js +2/−2
- bundle/editor-para/editor-para.js +17/−15
- bundle/editor-selection/editor-selection-coverage.js +445/−491
- bundle/editor-selection/editor-selection-debug.js +80/−126
- bundle/editor-selection/editor-selection-min.js +2/−2
- bundle/editor-selection/editor-selection.js +80/−121
- bundle/editor-tab/editor-tab-coverage.js +4/−4
- bundle/editor-tab/editor-tab-debug.js +3/−3
- bundle/editor-tab/editor-tab-min.js +2/−2
- bundle/editor-tab/editor-tab.js +3/−3
- bundle/escape/escape-coverage.js +3/−3
- bundle/escape/escape-debug.js +2/−2
- bundle/escape/escape-min.js +2/−2
- bundle/escape/escape.js +2/−2
- bundle/event-base-ie/event-base-ie-coverage.js +3/−3
- bundle/event-base-ie/event-base-ie-debug.js +2/−2
- bundle/event-base-ie/event-base-ie-min.js +2/−2
- bundle/event-base-ie/event-base-ie.js +2/−2
- bundle/event-base/event-base-coverage.js +88/−90
- bundle/event-base/event-base-debug.js +13/−14
- bundle/event-base/event-base-min.js +2/−2
- bundle/event-base/event-base.js +13/−14
- bundle/event-contextmenu/event-contextmenu-coverage.js +3/−3
- bundle/event-contextmenu/event-contextmenu-debug.js +2/−2
- bundle/event-contextmenu/event-contextmenu-min.js +2/−2
- bundle/event-contextmenu/event-contextmenu.js +2/−2
- bundle/event-custom-base/event-custom-base-coverage.js +3/−3
- bundle/event-custom-base/event-custom-base-debug.js +2/−2
- bundle/event-custom-base/event-custom-base-min.js +2/−2
- bundle/event-custom-base/event-custom-base.js +2/−2
- bundle/event-custom-complex/event-custom-complex-coverage.js +3/−3
- bundle/event-custom-complex/event-custom-complex-debug.js +2/−2
- bundle/event-custom-complex/event-custom-complex-min.js +2/−2
- bundle/event-custom-complex/event-custom-complex.js +2/−2
- bundle/event-delegate/event-delegate-coverage.js +3/−3
- bundle/event-delegate/event-delegate-debug.js +2/−2
- bundle/event-delegate/event-delegate-min.js +2/−2
- bundle/event-delegate/event-delegate.js +2/−2
- bundle/event-flick/event-flick-coverage.js +99/−87
- bundle/event-flick/event-flick-debug.js +24/−11
- bundle/event-flick/event-flick-min.js +2/−2
- bundle/event-flick/event-flick.js +23/−11
- bundle/event-focus/event-focus-coverage.js +132/−102
- bundle/event-focus/event-focus-debug.js +29/−4
- bundle/event-focus/event-focus-min.js +2/−2
- bundle/event-focus/event-focus.js +29/−4
- bundle/event-hover/event-hover-coverage.js +3/−3
- bundle/event-hover/event-hover-debug.js +2/−2
- bundle/event-hover/event-hover-min.js +2/−2
- bundle/event-hover/event-hover.js +2/−2
- bundle/event-key/event-key-coverage.js +3/−3
- bundle/event-key/event-key-debug.js +2/−2
- bundle/event-key/event-key-min.js +2/−2
- bundle/event-key/event-key.js +2/−2
- bundle/event-mouseenter/event-mouseenter-coverage.js +3/−3
- bundle/event-mouseenter/event-mouseenter-debug.js +2/−2
- bundle/event-mouseenter/event-mouseenter-min.js +2/−2
- bundle/event-mouseenter/event-mouseenter.js +2/−2
- bundle/event-mousewheel/event-mousewheel-coverage.js +3/−3
- bundle/event-mousewheel/event-mousewheel-debug.js +2/−2
- bundle/event-mousewheel/event-mousewheel-min.js +2/−2
- bundle/event-mousewheel/event-mousewheel.js +2/−2
- bundle/event-move/event-move-coverage.js +305/−188
- bundle/event-move/event-move-debug.js +115/−26
- bundle/event-move/event-move-min.js +2/−2
- bundle/event-move/event-move.js +112/−26
- bundle/event-outside/event-outside-coverage.js +3/−3
- bundle/event-outside/event-outside-debug.js +2/−2
- bundle/event-outside/event-outside-min.js +2/−2
- bundle/event-outside/event-outside.js +2/−2
- bundle/event-resize/event-resize-coverage.js +3/−3
- bundle/event-resize/event-resize-debug.js +2/−2
- bundle/event-resize/event-resize-min.js +2/−2
- bundle/event-resize/event-resize.js +2/−2
- bundle/event-simulate/event-simulate-coverage.js +3/−3
- bundle/event-simulate/event-simulate-debug.js +2/−2
- bundle/event-simulate/event-simulate-min.js +2/−2
- bundle/event-simulate/event-simulate.js +2/−2
- bundle/event-synthetic/event-synthetic-coverage.js +3/−3
- bundle/event-synthetic/event-synthetic-debug.js +2/−2
- bundle/event-synthetic/event-synthetic-min.js +2/−2
- bundle/event-synthetic/event-synthetic.js +2/−2
- bundle/event-tap/event-tap-coverage.js +3/−3
- bundle/event-tap/event-tap-debug.js +2/−2
- bundle/event-tap/event-tap-min.js +2/−2
- bundle/event-tap/event-tap.js +2/−2
- bundle/event-touch/event-touch-coverage.js +3/−3
- bundle/event-touch/event-touch-debug.js +2/−2
- bundle/event-touch/event-touch-min.js +2/−2
- bundle/event-touch/event-touch.js +2/−2
- bundle/event-valuechange/event-valuechange-coverage.js +3/−3
- bundle/event-valuechange/event-valuechange-debug.js +2/−2
- bundle/event-valuechange/event-valuechange-min.js +2/−2
- bundle/event-valuechange/event-valuechange.js +2/−2
- bundle/exec-command/exec-command-coverage.js +401/−403
- bundle/exec-command/exec-command-debug.js +89/−88
- bundle/exec-command/exec-command-min.js +2/−2
- bundle/exec-command/exec-command.js +89/−88
- bundle/features/features-coverage.js +85/−73
- bundle/features/features-debug.js +21/−9
- bundle/features/features-min.js +2/−2
- bundle/features/features.js +21/−9
- bundle/file-flash/file-flash-coverage.js +3/−3
- bundle/file-flash/file-flash-debug.js +2/−2
- bundle/file-flash/file-flash-min.js +2/−2
- bundle/file-flash/file-flash.js +2/−2
- bundle/file-html5/file-html5-coverage.js +3/−3
- bundle/file-html5/file-html5-debug.js +2/−2
- bundle/file-html5/file-html5-min.js +2/−2
- bundle/file-html5/file-html5.js +2/−2
- bundle/file/file-coverage.js +3/−3
- bundle/file/file-debug.js +2/−2
- bundle/file/file-min.js +2/−2
- bundle/file/file.js +2/−2
- bundle/frame/frame-coverage.js +305/−292
- bundle/frame/frame-debug.js +64/−50
- bundle/frame/frame-min.js +2/−2
- bundle/frame/frame.js +64/−50
- bundle/gesture-simulate/gesture-simulate-coverage.js +3/−3
- bundle/gesture-simulate/gesture-simulate-debug.js +2/−2
- bundle/gesture-simulate/gesture-simulate-min.js +2/−2
- bundle/gesture-simulate/gesture-simulate.js +2/−2
- bundle/get-nodejs/get-coverage.js +3/−3
- bundle/get-nodejs/get-debug.js +2/−2
- bundle/get-nodejs/get-min.js +2/−2
- bundle/get-nodejs/get-nodejs-coverage.js +3/−3
- bundle/get-nodejs/get-nodejs-debug.js +2/−2
- bundle/get-nodejs/get-nodejs-min.js +2/−2
- bundle/get-nodejs/get-nodejs.js +2/−2
- bundle/get-nodejs/get.js +2/−2
- bundle/get/get-coverage.js +306/−277
- bundle/get/get-debug.js +44/−22
- bundle/get/get-min.js +2/−2
- bundle/get/get.js +44/−22
- bundle/graphics-canvas-default/graphics-canvas-default-coverage.js +3/−3
- bundle/graphics-canvas-default/graphics-canvas-default-debug.js +2/−2
- bundle/graphics-canvas-default/graphics-canvas-default-min.js +2/−2
- bundle/graphics-canvas-default/graphics-canvas-default.js +2/−2
- bundle/graphics-canvas/graphics-canvas-coverage.js +3/−3
- bundle/graphics-canvas/graphics-canvas-debug.js +2/−2
- bundle/graphics-canvas/graphics-canvas-min.js +2/−2
- bundle/graphics-canvas/graphics-canvas.js +2/−2
- bundle/graphics-svg-default/graphics-svg-default-coverage.js +3/−3
- bundle/graphics-svg-default/graphics-svg-default-debug.js +2/−2
- bundle/graphics-svg-default/graphics-svg-default-min.js +2/−2
- bundle/graphics-svg-default/graphics-svg-default.js +2/−2
- bundle/graphics-svg/graphics-svg-coverage.js +3/−3
- bundle/graphics-svg/graphics-svg-debug.js +2/−2
- bundle/graphics-svg/graphics-svg-min.js +2/−2
- bundle/graphics-svg/graphics-svg.js +2/−2
- bundle/graphics-vml-default/graphics-vml-default-coverage.js +3/−3
- bundle/graphics-vml-default/graphics-vml-default-debug.js +2/−2
- bundle/graphics-vml-default/graphics-vml-default-min.js +2/−2
- bundle/graphics-vml-default/graphics-vml-default.js +2/−2
- bundle/graphics-vml/graphics-vml-coverage.js +3/−3
- bundle/graphics-vml/graphics-vml-debug.js +2/−2
- bundle/graphics-vml/graphics-vml-min.js +2/−2
- bundle/graphics-vml/graphics-vml.js +2/−2
- bundle/graphics/graphics-coverage.js +3/−3
- bundle/graphics/graphics-debug.js +2/−2
- bundle/graphics/graphics-min.js +2/−2
- bundle/graphics/graphics.js +2/−2
- bundle/handlebars-base/handlebars-base-coverage.js +3/−3
- bundle/handlebars-base/handlebars-base-debug.js +2/−2
- bundle/handlebars-base/handlebars-base-min.js +2/−2
- bundle/handlebars-base/handlebars-base.js +2/−2
- bundle/handlebars-compiler/handlebars-compiler-coverage.js +3/−3
- bundle/handlebars-compiler/handlebars-compiler-debug.js +2/−2
- bundle/handlebars-compiler/handlebars-compiler-min.js +2/−2
- bundle/handlebars-compiler/handlebars-compiler.js +2/−2
- bundle/highlight-accentfold/highlight-accentfold-coverage.js +3/−3
- bundle/highlight-accentfold/highlight-accentfold-debug.js +2/−2
- bundle/highlight-accentfold/highlight-accentfold-min.js +2/−2
- bundle/highlight-accentfold/highlight-accentfold.js +2/−2
- bundle/highlight-base/highlight-base-coverage.js +3/−3
- bundle/highlight-base/highlight-base-debug.js +2/−2
- bundle/highlight-base/highlight-base-min.js +2/−2
- bundle/highlight-base/highlight-base.js +2/−2
- bundle/history-base/history-base-coverage.js +3/−3
- bundle/history-base/history-base-debug.js +2/−2
- bundle/history-base/history-base-min.js +2/−2
- bundle/history-base/history-base.js +2/−2
- bundle/history-hash-ie/history-hash-ie-coverage.js +3/−3
- bundle/history-hash-ie/history-hash-ie-debug.js +2/−2
- bundle/history-hash-ie/history-hash-ie-min.js +2/−2
- bundle/history-hash-ie/history-hash-ie.js +2/−2
- bundle/history-hash/history-hash-coverage.js +3/−3
- bundle/history-hash/history-hash-debug.js +2/−2
- bundle/history-hash/history-hash-min.js +2/−2
- bundle/history-hash/history-hash.js +2/−2
- bundle/history-html5/history-html5-coverage.js +3/−3
- bundle/history-html5/history-html5-debug.js +2/−2
- bundle/history-html5/history-html5-min.js +2/−2
- bundle/history-html5/history-html5.js +2/−2
- bundle/imageloader/imageloader-coverage.js +3/−3
- bundle/imageloader/imageloader-debug.js +2/−2
- bundle/imageloader/imageloader-min.js +2/−2
- bundle/imageloader/imageloader.js +2/−2
- bundle/intl-base/intl-base-coverage.js +3/−3
- bundle/intl-base/intl-base-debug.js +2/−2
- bundle/intl-base/intl-base-min.js +2/−2
- bundle/intl-base/intl-base.js +2/−2
- bundle/intl/intl-coverage.js +3/−3
- bundle/intl/intl-debug.js +2/−2
- bundle/intl/intl-min.js +2/−2
- bundle/intl/intl.js +2/−2
- bundle/io-base/io-base-coverage.js +72/−71
- bundle/io-base/io-base-debug.js +11/−9
- bundle/io-base/io-base-min.js +2/−2
- bundle/io-base/io-base.js +11/−9
- bundle/io-form/io-form-coverage.js +3/−3
- bundle/io-form/io-form-debug.js +2/−2
- bundle/io-form/io-form-min.js +2/−2
- bundle/io-form/io-form.js +2/−2
- bundle/io-nodejs/io-nodejs-coverage.js +4/−4
- bundle/io-nodejs/io-nodejs-debug.js +3/−3
- bundle/io-nodejs/io-nodejs-min.js +2/−2
- bundle/io-nodejs/io-nodejs.js +3/−3
- bundle/io-queue/io-queue-coverage.js +72/−54
- bundle/io-queue/io-queue-debug.js +16/−2
- bundle/io-queue/io-queue-min.js +2/−2
- bundle/io-queue/io-queue.js +16/−2
- bundle/io-upload-iframe/io-upload-iframe-coverage.js +118/−105
- bundle/io-upload-iframe/io-upload-iframe-debug.js +17/−8
- bundle/io-upload-iframe/io-upload-iframe-min.js +2/−2
- bundle/io-upload-iframe/io-upload-iframe.js +17/−8
- bundle/io-xdr/io-xdr-coverage.js +3/−3
- bundle/io-xdr/io-xdr-debug.js +2/−2
- bundle/io-xdr/io-xdr-min.js +2/−2
- bundle/io-xdr/io-xdr.js +2/−2
- bundle/json-parse/json-parse-coverage.js +47/−45
- bundle/json-parse/json-parse-debug.js +8/−7
- bundle/json-parse/json-parse-min.js +2/−2
- bundle/json-parse/json-parse.js +8/−7
- bundle/json-stringify/json-stringify-coverage.js +106/−97
- bundle/json-stringify/json-stringify-debug.js +8/−3
- bundle/json-stringify/json-stringify-min.js +2/−2
- bundle/json-stringify/json-stringify.js +8/−3
- bundle/jsonp-url/jsonp-url-coverage.js +3/−3
- bundle/jsonp-url/jsonp-url-debug.js +2/−2
- bundle/jsonp-url/jsonp-url-min.js +2/−2
- bundle/jsonp-url/jsonp-url.js +2/−2
- bundle/jsonp/jsonp-coverage.js +3/−3
- bundle/jsonp/jsonp-debug.js +2/−2
- bundle/jsonp/jsonp-min.js +2/−2
- bundle/jsonp/jsonp.js +2/−2
- bundle/lazy-model-list/lazy-model-list-coverage.js +3/−3
- bundle/lazy-model-list/lazy-model-list-debug.js +2/−2
- bundle/lazy-model-list/lazy-model-list-min.js +2/−2
- bundle/lazy-model-list/lazy-model-list.js +2/−2
- bundle/loader-base/loader-base-coverage.js +3786/−3795
- bundle/loader-base/loader-base-debug.js +103/−112
- bundle/loader-base/loader-base-min.js +2/−2
- bundle/loader-base/loader-base.js +103/−112
- bundle/loader-rollup/loader-rollup-coverage.js +4/−4
- bundle/loader-rollup/loader-rollup-debug.js +3/−3
- bundle/loader-rollup/loader-rollup-min.js +2/−2
- bundle/loader-rollup/loader-rollup.js +3/−3
- bundle/loader-yui3/loader-yui3-coverage.js +70/−56
- bundle/loader-yui3/loader-yui3-debug.js +27/−11
- bundle/loader-yui3/loader-yui3-min.js +2/−2
- bundle/loader-yui3/loader-yui3.js +27/−11
- bundle/loader/loader-coverage.js +6/−6
- bundle/loader/loader-debug.js +132/−125
- bundle/loader/loader-min.js +2/−2
- bundle/loader/loader.js +132/−125
- bundle/matrix/matrix-coverage.js +257/−250
- bundle/matrix/matrix-debug.js +9/−2
- bundle/matrix/matrix-min.js +2/−2
- bundle/matrix/matrix.js +9/−2
- bundle/model-list/model-list-coverage.js +3/−3
- bundle/model-list/model-list-debug.js +2/−2
- bundle/model-list/model-list-min.js +2/−2
- bundle/model-list/model-list.js +2/−2
- bundle/model-sync-rest/model-sync-rest-coverage.js +3/−3
- bundle/model-sync-rest/model-sync-rest-debug.js +2/−2
- bundle/model-sync-rest/model-sync-rest-min.js +2/−2
- bundle/model-sync-rest/model-sync-rest.js +2/−2
- bundle/model/model-coverage.js +3/−3
- bundle/model/model-debug.js +2/−2
- bundle/model/model-min.js +2/−2
- bundle/model/model.js +2/−2
- bundle/node-base/node-base-coverage.js +3/−3
- bundle/node-base/node-base-debug.js +2/−2
- bundle/node-base/node-base-min.js +2/−2
- bundle/node-base/node-base.js +2/−2
- bundle/node-core/node-core-coverage.js +246/−244
- bundle/node-core/node-core-debug.js +5/−3
- bundle/node-core/node-core-min.js +2/−2
- bundle/node-core/node-core.js +5/−3
- bundle/node-deprecated/node-deprecated-coverage.js +3/−3
- bundle/node-deprecated/node-deprecated-debug.js +2/−2
- bundle/node-deprecated/node-deprecated-min.js +2/−2
- bundle/node-deprecated/node-deprecated.js +2/−2
- bundle/node-event-delegate/node-event-delegate-coverage.js +3/−3
- bundle/node-event-delegate/node-event-delegate-debug.js +2/−2
- bundle/node-event-delegate/node-event-delegate-min.js +2/−2
- bundle/node-event-delegate/node-event-delegate.js +2/−2
- bundle/node-event-html5/node-event-html5-coverage.js +3/−3
- bundle/node-event-html5/node-event-html5-debug.js +2/−2
- bundle/node-event-html5/node-event-html5-min.js +2/−2
- bundle/node-event-html5/node-event-html5.js +2/−2
- bundle/node-event-simulate/node-event-simulate-coverage.js +3/−3
- bundle/node-event-simulate/node-event-simulate-debug.js +2/−2
- bundle/node-event-simulate/node-event-simulate-min.js +2/−2
- bundle/node-event-simulate/node-event-simulate.js +2/−2
- bundle/node-flick/assets/node-flick-core.css +1/−1
- bundle/node-flick/assets/skins/sam/node-flick-skin.css +1/−1
- bundle/node-flick/assets/skins/sam/node-flick.css +1/−1
- bundle/node-flick/node-flick-coverage.js +7/−7
- bundle/node-flick/node-flick-debug.js +6/−6
- bundle/node-flick/node-flick-min.js +2/−2
- bundle/node-flick/node-flick.js +6/−6
- bundle/node-focusmanager/node-focusmanager-coverage.js +3/−3
- bundle/node-focusmanager/node-focusmanager-debug.js +2/−2
- bundle/node-focusmanager/node-focusmanager-min.js +2/−2
- bundle/node-focusmanager/node-focusmanager.js +2/−2
- bundle/node-load/node-load-coverage.js +3/−3
- bundle/node-load/node-load-debug.js +2/−2
- bundle/node-load/node-load-min.js +2/−2
- bundle/node-load/node-load.js +2/−2
- bundle/node-menunav/assets/node-menunav-core.css +1/−1
- bundle/node-menunav/assets/skins/night/node-menunav-skin.css +1/−1
- bundle/node-menunav/assets/skins/night/node-menunav.css +1/−1
- bundle/node-menunav/assets/skins/sam/node-menunav-skin.css +1/−1
- bundle/node-menunav/assets/skins/sam/node-menunav.css +1/−1
- bundle/node-menunav/node-menunav-coverage.js +3/−3
- bundle/node-menunav/node-menunav-debug.js +2/−2
- bundle/node-menunav/node-menunav-min.js +2/−2
- bundle/node-menunav/node-menunav.js +2/−2
- bundle/node-pluginhost/node-pluginhost-coverage.js +3/−3
- bundle/node-pluginhost/node-pluginhost-debug.js +2/−2
- bundle/node-pluginhost/node-pluginhost-min.js +2/−2
- bundle/node-pluginhost/node-pluginhost.js +2/−2
- bundle/node-screen/node-screen-coverage.js +3/−3
- bundle/node-screen/node-screen-debug.js +2/−2
- bundle/node-screen/node-screen-min.js +2/−2
- bundle/node-screen/node-screen.js +2/−2
- bundle/node-scroll-info/node-scroll-info-coverage.js +3/−3
- bundle/node-scroll-info/node-scroll-info-debug.js +2/−2
- bundle/node-scroll-info/node-scroll-info-min.js +2/−2
- bundle/node-scroll-info/node-scroll-info.js +2/−2
- bundle/node-style/node-style-coverage.js +3/−3
- bundle/node-style/node-style-debug.js +2/−2
- bundle/node-style/node-style-min.js +2/−2
- bundle/node-style/node-style.js +2/−2
- bundle/oop/oop-coverage.js +3/−3
- bundle/oop/oop-debug.js +2/−2
- bundle/oop/oop-min.js +2/−2
- bundle/oop/oop.js +2/−2
- bundle/overlay/assets/overlay-core.css +1/−1
- bundle/overlay/assets/skins/night/overlay-skin.css +1/−1
- bundle/overlay/assets/skins/night/overlay.css +1/−1
- bundle/overlay/assets/skins/sam/overlay-skin.css +1/−1
- bundle/overlay/assets/skins/sam/overlay.css +1/−1
- bundle/overlay/overlay-coverage.js +3/−3
- bundle/overlay/overlay-debug.js +2/−2
- bundle/overlay/overlay-min.js +2/−2
- bundle/overlay/overlay.js +2/−2
- bundle/panel/assets/panel-core.css +1/−1
- bundle/panel/assets/skins/night/panel-skin.css +1/−1
- bundle/panel/assets/skins/night/panel.css +1/−1
- bundle/panel/assets/skins/sam/panel-skin.css +1/−1
- bundle/panel/assets/skins/sam/panel.css +1/−1
- bundle/panel/panel-coverage.js +3/−3
- bundle/panel/panel-debug.js +2/−2
- bundle/panel/panel-min.js +2/−2
- bundle/panel/panel.js +2/−2
- bundle/parallel/parallel-coverage.js +3/−3
- bundle/parallel/parallel-debug.js +2/−2
- bundle/parallel/parallel-min.js +2/−2
- bundle/parallel/parallel.js +2/−2
- bundle/pjax-base/pjax-base-coverage.js +3/−3
- bundle/pjax-base/pjax-base-debug.js +2/−2
- bundle/pjax-base/pjax-base-min.js +2/−2
- bundle/pjax-base/pjax-base.js +2/−2
- bundle/pjax-content/pjax-content-coverage.js +3/−3
- bundle/pjax-content/pjax-content-debug.js +2/−2
- bundle/pjax-content/pjax-content-min.js +2/−2
- bundle/pjax-content/pjax-content.js +2/−2
- bundle/pjax-plugin/pjax-plugin-coverage.js +3/−3
- bundle/pjax-plugin/pjax-plugin-debug.js +2/−2
- bundle/pjax-plugin/pjax-plugin-min.js +2/−2
- bundle/pjax-plugin/pjax-plugin.js +2/−2
- bundle/pjax/pjax-coverage.js +3/−3
- bundle/pjax/pjax-debug.js +2/−2
- bundle/pjax/pjax-min.js +2/−2
- bundle/pjax/pjax.js +2/−2
- bundle/plugin/plugin-coverage.js +3/−3
- bundle/plugin/plugin-debug.js +2/−2
- bundle/plugin/plugin-min.js +2/−2
- bundle/plugin/plugin.js +2/−2
- bundle/pluginhost-base/pluginhost-base-coverage.js +3/−3
- bundle/pluginhost-base/pluginhost-base-debug.js +2/−2
- bundle/pluginhost-base/pluginhost-base-min.js +2/−2
- bundle/pluginhost-base/pluginhost-base.js +2/−2
- bundle/pluginhost-config/pluginhost-config-coverage.js +3/−3
- bundle/pluginhost-config/pluginhost-config-debug.js +2/−2
- bundle/pluginhost-config/pluginhost-config-min.js +2/−2
- bundle/pluginhost-config/pluginhost-config.js +2/−2
- bundle/profiler/profiler-coverage.js +3/−3
- bundle/profiler/profiler-debug.js +2/−2
- bundle/profiler/profiler-min.js +2/−2
- bundle/profiler/profiler.js +2/−2
- bundle/querystring-parse-simple/querystring-parse-simple-coverage.js +3/−3
- bundle/querystring-parse-simple/querystring-parse-simple-debug.js +2/−2
- bundle/querystring-parse-simple/querystring-parse-simple-min.js +2/−2
- bundle/querystring-parse-simple/querystring-parse-simple.js +2/−2
- bundle/querystring-parse/querystring-parse-coverage.js +3/−3
- bundle/querystring-parse/querystring-parse-debug.js +2/−2
- bundle/querystring-parse/querystring-parse-min.js +2/−2
- bundle/querystring-parse/querystring-parse.js +2/−2
- bundle/querystring-stringify-simple/querystring-stringify-simple-coverage.js +3/−3
- bundle/querystring-stringify-simple/querystring-stringify-simple-debug.js +2/−2
- bundle/querystring-stringify-simple/querystring-stringify-simple-min.js +2/−2
- bundle/querystring-stringify-simple/querystring-stringify-simple.js +2/−2
- bundle/querystring-stringify/querystring-stringify-coverage.js +3/−3
- bundle/querystring-stringify/querystring-stringify-debug.js +2/−2
- bundle/querystring-stringify/querystring-stringify-min.js +2/−2
- bundle/querystring-stringify/querystring-stringify.js +2/−2
- bundle/queue-promote/queue-promote-coverage.js +3/−3
- bundle/queue-promote/queue-promote-debug.js +2/−2
- bundle/queue-promote/queue-promote-min.js +2/−2
- bundle/queue-promote/queue-promote.js +2/−2
- bundle/range-slider/assets/slider-base-core.css +1/−1
- bundle/range-slider/assets/slider-core.css +1/−1
- bundle/range-slider/range-slider-coverage.js +3/−3
- bundle/range-slider/range-slider-debug.js +2/−2
- bundle/range-slider/range-slider-min.js +2/−2
- bundle/range-slider/range-slider.js +2/−2
- bundle/recordset-base/recordset-base-coverage.js +3/−3
- bundle/recordset-base/recordset-base-debug.js +2/−2
- bundle/recordset-base/recordset-base-min.js +2/−2
- bundle/recordset-base/recordset-base.js +2/−2
- bundle/recordset-filter/recordset-filter-coverage.js +3/−3
- bundle/recordset-filter/recordset-filter-debug.js +2/−2
- bundle/recordset-filter/recordset-filter-min.js +2/−2
- bundle/recordset-filter/recordset-filter.js +2/−2
- bundle/recordset-indexer/recordset-indexer-coverage.js +3/−3
- bundle/recordset-indexer/recordset-indexer-debug.js +2/−2
- bundle/recordset-indexer/recordset-indexer-min.js +2/−2
- bundle/recordset-indexer/recordset-indexer.js +2/−2
- bundle/recordset-sort/recordset-sort-coverage.js +3/−3
- bundle/recordset-sort/recordset-sort-debug.js +2/−2
- bundle/recordset-sort/recordset-sort-min.js +2/−2
- bundle/recordset-sort/recordset-sort.js +2/−2
- bundle/resize-base/assets/resize-base-core.css +1/−1
- bundle/resize-base/assets/skins/night/resize-base-skin.css +1/−1
- bundle/resize-base/assets/skins/night/resize-base.css +1/−1
- bundle/resize-base/assets/skins/sam/resize-base-skin.css +1/−1
- bundle/resize-base/assets/skins/sam/resize-base.css +1/−1
- bundle/resize-base/resize-base-coverage.js +2007/−2006
- bundle/resize-base/resize-base-debug.js +1654/−1653
- bundle/resize-base/resize-base-min.js +2/−2
- bundle/resize-base/resize-base.js +1653/−1652
- bundle/resize-constrain/assets/resize-base-core.css +1/−1
- bundle/resize-constrain/assets/skins/night/resize-base-skin.css +1/−1
- bundle/resize-constrain/assets/skins/sam/resize-base-skin.css +1/−1
- bundle/resize-constrain/resize-constrain-coverage.js +301/−301
- bundle/resize-constrain/resize-constrain-debug.js +299/−299
- bundle/resize-constrain/resize-constrain-min.js +2/−2
- bundle/resize-constrain/resize-constrain.js +299/−299
- bundle/resize-plugin/assets/resize-base-core.css +1/−1
- bundle/resize-plugin/assets/skins/night/resize-base-skin.css +1/−1
- bundle/resize-plugin/assets/skins/sam/resize-base-skin.css +1/−1
- bundle/resize-plugin/resize-plugin-coverage.js +53/−52
- bundle/resize-plugin/resize-plugin-debug.js +15/−14
- bundle/resize-plugin/resize-plugin-min.js +2/−2
- bundle/resize-plugin/resize-plugin.js +15/−14
- bundle/resize-proxy/assets/resize-base-core.css +1/−1
- bundle/resize-proxy/assets/skins/night/resize-base-skin.css +1/−1
- bundle/resize-proxy/assets/skins/sam/resize-base-skin.css +1/−1
- bundle/resize-proxy/resize-proxy-coverage.js +83/−83
- bundle/resize-proxy/resize-proxy-debug.js +82/−82
- bundle/resize-proxy/resize-proxy-min.js +2/−2
- bundle/resize-proxy/resize-proxy.js +82/−82
- bundle/router/router-coverage.js +3/−3
- bundle/router/router-debug.js +2/−2
- bundle/router/router-min.js +2/−2
- bundle/router/router.js +2/−2
- bundle/scrollview-base-ie/scrollview-base-ie-coverage.js +3/−3
- bundle/scrollview-base-ie/scrollview-base-ie-debug.js +2/−2
- bundle/scrollview-base-ie/scrollview-base-ie-min.js +2/−2
- bundle/scrollview-base-ie/scrollview-base-ie.js +2/−2
- bundle/scrollview-base/assets/scrollview-base-core.css +1/−1
- bundle/scrollview-base/assets/skins/night/scrollview-base-skin.css +1/−1
- bundle/scrollview-base/assets/skins/night/scrollview-base.css +1/−1
- bundle/scrollview-base/assets/skins/sam/scrollview-base-skin.css +1/−1
- bundle/scrollview-base/assets/skins/sam/scrollview-base.css +1/−1
- bundle/scrollview-base/scrollview-base-coverage.js +258/−257
- bundle/scrollview-base/scrollview-base-debug.js +5/−4
- bundle/scrollview-base/scrollview-base-min.js +2/−2
- bundle/scrollview-base/scrollview-base.js +5/−4
- bundle/scrollview-list/assets/scrollview-list-core.css +1/−1
- bundle/scrollview-list/assets/skins/night/scrollview-list-skin.css +1/−1
- bundle/scrollview-list/assets/skins/night/scrollview-list.css +1/−1
- bundle/scrollview-list/assets/skins/sam/scrollview-list-skin.css +1/−1
- bundle/scrollview-list/assets/skins/sam/scrollview-list.css +1/−1
- bundle/scrollview-list/scrollview-list-coverage.js +3/−3
- bundle/scrollview-list/scrollview-list-debug.js +2/−2
- bundle/scrollview-list/scrollview-list-min.js +2/−2
- bundle/scrollview-list/scrollview-list.js +2/−2
- bundle/scrollview-paginator/scrollview-paginator-coverage.js +3/−3
- bundle/scrollview-paginator/scrollview-paginator-debug.js +2/−2
- bundle/scrollview-paginator/scrollview-paginator-min.js +2/−2
- bundle/scrollview-paginator/scrollview-paginator.js +2/−2
- bundle/scrollview-scrollbars/assets/scrollview-scrollbars-core.css +1/−1
- bundle/scrollview-scrollbars/assets/skins/night/scrollview-scrollbars-skin.css +1/−1
- bundle/scrollview-scrollbars/assets/skins/night/scrollview-scrollbars.css +1/−1
- bundle/scrollview-scrollbars/assets/skins/sam/scrollview-scrollbars-skin.css +1/−1
- bundle/scrollview-scrollbars/assets/skins/sam/scrollview-scrollbars.css +1/−1
- bundle/scrollview-scrollbars/scrollview-scrollbars-coverage.js +5/−5
- bundle/scrollview-scrollbars/scrollview-scrollbars-debug.js +4/−4
- bundle/scrollview-scrollbars/scrollview-scrollbars-min.js +2/−2
- bundle/scrollview-scrollbars/scrollview-scrollbars.js +4/−4
- bundle/scrollview/scrollview-coverage.js +3/−3
- bundle/scrollview/scrollview-debug.js +2/−2
- bundle/scrollview/scrollview-min.js +2/−2
- bundle/scrollview/scrollview.js +2/−2
- bundle/selector-css2/selector-css2-coverage.js +3/−3
- bundle/selector-css2/selector-css2-debug.js +2/−2
- bundle/selector-css2/selector-css2-min.js +2/−2
- bundle/selector-css2/selector-css2.js +2/−2
- bundle/selector-css3/selector-css3-coverage.js +3/−3
- bundle/selector-css3/selector-css3-debug.js +2/−2
- bundle/selector-css3/selector-css3-min.js +2/−2
- bundle/selector-css3/selector-css3.js +2/−2
- bundle/selector-native/selector-native-coverage.js +3/−3
- bundle/selector-native/selector-native-debug.js +2/−2
- bundle/selector-native/selector-native-min.js +2/−2
- bundle/selector-native/selector-native.js +2/−2
- bundle/selector/selector-coverage.js +3/−3
- bundle/selector/selector-debug.js +2/−2
- bundle/selector/selector-min.js +2/−2
- bundle/selector/selector.js +2/−2
- bundle/shim-plugin/shim-plugin-coverage.js +3/−3
- bundle/shim-plugin/shim-plugin-debug.js +2/−2
- bundle/shim-plugin/shim-plugin-min.js +2/−2
- bundle/shim-plugin/shim-plugin.js +2/−2
- bundle/simpleyui/simpleyui-debug.js +235/−164
- bundle/simpleyui/simpleyui-min.js +2/−2
- bundle/simpleyui/simpleyui.js +235/−164
- bundle/slider-base/assets/skins/audio-light/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/audio-light/slider-base.css +1/−1
- bundle/slider-base/assets/skins/audio-light/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/audio/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/audio/slider-base.css +1/−1
- bundle/slider-base/assets/skins/audio/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/capsule-dark/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/capsule-dark/slider-base.css +1/−1
- bundle/slider-base/assets/skins/capsule-dark/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/capsule/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/capsule/slider-base.css +1/−1
- bundle/slider-base/assets/skins/capsule/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/night/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/night/slider-base.css +1/−1
- bundle/slider-base/assets/skins/night/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/round-dark/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/round-dark/slider-base.css +1/−1
- bundle/slider-base/assets/skins/round-dark/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/round/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/round/slider-base.css +1/−1
- bundle/slider-base/assets/skins/round/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/sam-dark/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/sam-dark/slider-base.css +1/−1
- bundle/slider-base/assets/skins/sam-dark/slider-skin.css +1/−1
- bundle/slider-base/assets/skins/sam/slider-base-skin.css +1/−1
- bundle/slider-base/assets/skins/sam/slider-base.css +1/−1
- bundle/slider-base/assets/skins/sam/slider-skin.css +1/−1
- bundle/slider-base/assets/slider-base-core.css +1/−1
- bundle/slider-base/assets/slider-core.css +1/−1
- bundle/slider-base/slider-base-coverage.js +3/−3
- bundle/slider-base/slider-base-debug.js +2/−2
- bundle/slider-base/slider-base-min.js +2/−2
- bundle/slider-base/slider-base.js +2/−2
- bundle/slider-value-range/assets/slider-base-core.css +1/−1
- bundle/slider-value-range/assets/slider-core.css +1/−1
- bundle/slider-value-range/slider-value-range-coverage.js +3/−3
- bundle/slider-value-range/slider-value-range-debug.js +2/−2
- bundle/slider-value-range/slider-value-range-min.js +2/−2
- bundle/slider-value-range/slider-value-range.js +2/−2
- bundle/sortable-scroll/sortable-scroll-coverage.js +4/−4
- bundle/sortable-scroll/sortable-scroll-debug.js +3/−3
- bundle/sortable-scroll/sortable-scroll-min.js +2/−2
- bundle/sortable-scroll/sortable-scroll.js +3/−3
- bundle/sortable/sortable-coverage.js +69/−68
- bundle/sortable/sortable-debug.js +24/−23
- bundle/sortable/sortable-min.js +2/−2
- bundle/sortable/sortable.js +24/−23
- bundle/stylesheet/stylesheet-coverage.js +3/−3
- bundle/stylesheet/stylesheet-debug.js +2/−2
- bundle/stylesheet/stylesheet-min.js +2/−2
- bundle/stylesheet/stylesheet.js +2/−2
- bundle/substitute/substitute-coverage.js +3/−3
- bundle/substitute/substitute-debug.js +2/−2
- bundle/substitute/substitute-min.js +2/−2
- bundle/substitute/substitute.js +2/−2
- bundle/swf/swf-coverage.js +3/−3
- bundle/swf/swf-debug.js +2/−2
- bundle/swf/swf-min.js +2/−2
- bundle/swf/swf.js +2/−2
- bundle/swfdetect/swfdetect-coverage.js +3/−3
- bundle/swfdetect/swfdetect-debug.js +2/−2
- bundle/swfdetect/swfdetect-min.js +2/−2
- bundle/swfdetect/swfdetect.js +2/−2
- bundle/tabview-base/assets/tabview-core.css +1/−1
- bundle/tabview-base/assets/tabview.css +1/−1
- bundle/tabview-base/tabview-base-coverage.js +3/−3
- bundle/tabview-base/tabview-base-debug.js +2/−2
- bundle/tabview-base/tabview-base-min.js +2/−2
- bundle/tabview-base/tabview-base.js +2/−2
- bundle/tabview-plugin/assets/tabview-core.css +1/−1
- bundle/tabview-plugin/assets/tabview.css +1/−1
- bundle/tabview-plugin/tabview-plugin-coverage.js +3/−3
- bundle/tabview-plugin/tabview-plugin-debug.js +2/−2
- bundle/tabview-plugin/tabview-plugin-min.js +2/−2
- bundle/tabview-plugin/tabview-plugin.js +2/−2
- bundle/tabview/assets/skins/night/tabview-skin.css +1/−1
- bundle/tabview/assets/skins/night/tabview.css +1/−1
- bundle/tabview/assets/skins/sam/tabview-skin.css +1/−1
- bundle/tabview/assets/skins/sam/tabview.css +1/−1
- bundle/tabview/assets/tabview-core.css +1/−1
- bundle/tabview/assets/tabview.css +1/−1
- bundle/tabview/tabview-coverage.js +3/−3
- bundle/tabview/tabview-debug.js +2/−2
- bundle/tabview/tabview-min.js +2/−2
- bundle/tabview/tabview.js +2/−2
- bundle/test-console/assets/skins/sam/test-console-skin.css +1/−1
- bundle/test-console/assets/skins/sam/test-console.css +1/−1
- bundle/test-console/assets/test-console-core.css +1/−1
- bundle/test-console/test-console-coverage.js +264/−41
- bundle/test-console/test-console-debug.js +173/−12
- bundle/test-console/test-console-min.js +2/−2
- bundle/test-console/test-console.js +173/−12
- bundle/test/test-coverage.js +4850/−4838
- bundle/test/test-debug.js +16/−9
- bundle/test/test-min.js +2/−2
- bundle/test/test.js +16/−9
- bundle/text-accentfold/text-accentfold-coverage.js +3/−3
- bundle/text-accentfold/text-accentfold-debug.js +2/−2
- bundle/text-accentfold/text-accentfold-min.js +2/−2
- bundle/text-accentfold/text-accentfold.js +2/−2
- bundle/text-data-accentfold/text-data-accentfold-coverage.js +3/−3
- bundle/text-data-accentfold/text-data-accentfold-debug.js +2/−2
- bundle/text-data-accentfold/text-data-accentfold-min.js +2/−2
- bundle/text-data-accentfold/text-data-accentfold.js +2/−2
- bundle/text-data-wordbreak/text-data-wordbreak-coverage.js +3/−3
- bundle/text-data-wordbreak/text-data-wordbreak-debug.js +2/−2
- bundle/text-data-wordbreak/text-data-wordbreak-min.js +2/−2
- bundle/text-data-wordbreak/text-data-wordbreak.js +2/−2
- bundle/text-wordbreak/text-wordbreak-coverage.js +3/−3
- bundle/text-wordbreak/text-wordbreak-debug.js +2/−2
- bundle/text-wordbreak/text-wordbreak-min.js +2/−2
- bundle/text-wordbreak/text-wordbreak.js +2/−2
- bundle/transition-native/transition-native-debug.js +0/−718
- bundle/transition-native/transition-native-min.js +0/−8
- bundle/transition-native/transition-native.js +0/−716
- bundle/transition-timer/transition-timer-coverage.js +3/−3
- bundle/transition-timer/transition-timer-debug.js +2/−2
- bundle/transition-timer/transition-timer-min.js +2/−2
- bundle/transition-timer/transition-timer.js +2/−2
- bundle/transition/transition-coverage.js +323/−312
- bundle/transition/transition-debug.js +59/−52
- bundle/transition/transition-min.js +2/−2
- bundle/transition/transition.js +59/−52
- bundle/uploader-deprecated/uploader-deprecated-coverage.js +3/−3
- bundle/uploader-deprecated/uploader-deprecated-debug.js +2/−2
- bundle/uploader-deprecated/uploader-deprecated-min.js +2/−2
- bundle/uploader-deprecated/uploader-deprecated.js +2/−2
- bundle/uploader-flash/assets/uploader-flash-core.css +1/−1
- bundle/uploader-flash/uploader-flash-coverage.js +3/−3
- bundle/uploader-flash/uploader-flash-debug.js +2/−2
- bundle/uploader-flash/uploader-flash-min.js +2/−2
- bundle/uploader-flash/uploader-flash.js +2/−2
- bundle/uploader-html5/assets/uploader-flash-core.css +1/−1
- bundle/uploader-html5/uploader-html5-coverage.js +3/−3
- bundle/uploader-html5/uploader-html5-debug.js +2/−2
- bundle/uploader-html5/uploader-html5-min.js +2/−2
- bundle/uploader-html5/uploader-html5.js +2/−2
- bundle/uploader-queue/assets/uploader-flash-core.css +1/−1
- bundle/uploader-queue/uploader-queue-coverage.js +3/−3
- bundle/uploader-queue/uploader-queue-debug.js +2/−2
- bundle/uploader-queue/uploader-queue-min.js +2/−2
- bundle/uploader-queue/uploader-queue.js +2/−2
- bundle/uploader/assets/uploader-flash-core.css +1/−1
- bundle/uploader/uploader-coverage.js +3/−3
- bundle/uploader/uploader-debug.js +2/−2
- bundle/uploader/uploader-min.js +2/−2
- bundle/uploader/uploader.js +2/−2
- bundle/view-node-map/view-node-map-coverage.js +3/−3
- bundle/view-node-map/view-node-map-debug.js +2/−2
- bundle/view-node-map/view-node-map-min.js +2/−2
- bundle/view-node-map/view-node-map.js +2/−2
- bundle/view/view-coverage.js +3/−3
- bundle/view/view-debug.js +2/−2
- bundle/view/view-min.js +2/−2
- bundle/view/view.js +2/−2
- bundle/widget-anim/widget-anim-coverage.js +3/−3
- bundle/widget-anim/widget-anim-debug.js +2/−2
- bundle/widget-anim/widget-anim-min.js +2/−2
- bundle/widget-anim/widget-anim.js +2/−2
- bundle/widget-autohide/widget-autohide-coverage.js +3/−3
- bundle/widget-autohide/widget-autohide-debug.js +2/−2
- bundle/widget-autohide/widget-autohide-min.js +2/−2
- bundle/widget-autohide/widget-autohide.js +2/−2
- bundle/widget-base-ie/assets/widget-base-core.css +1/−1
- bundle/widget-base-ie/widget-base-ie-coverage.js +3/−3
- bundle/widget-base-ie/widget-base-ie-debug.js +2/−2
- bundle/widget-base-ie/widget-base-ie-min.js +2/−2
- bundle/widget-base-ie/widget-base-ie.js +2/−2
- bundle/widget-base/assets/skins/night/widget-base-skin.css +1/−1
- bundle/widget-base/assets/skins/night/widget-base.css +1/−1
- bundle/widget-base/assets/skins/sam/widget-base-skin.css +1/−1
- bundle/widget-base/assets/skins/sam/widget-base.css +1/−1
- bundle/widget-base/assets/widget-base-core.css +1/−1
- bundle/widget-base/widget-base-coverage.js +3/−3
- bundle/widget-base/widget-base-debug.js +2/−2
- bundle/widget-base/widget-base-min.js +2/−2
- bundle/widget-base/widget-base.js +2/−2
- bundle/widget-buttons/assets/skins/night/widget-buttons-skin.css +1/−1
- bundle/widget-buttons/assets/skins/night/widget-buttons.css +1/−1
- bundle/widget-buttons/assets/skins/sam/widget-buttons-skin.css +1/−1
- bundle/widget-buttons/assets/skins/sam/widget-buttons.css +1/−1
- bundle/widget-buttons/assets/widget-buttons-core.css +1/−1
- bundle/widget-buttons/widget-buttons-coverage.js +273/−268
- bundle/widget-buttons/widget-buttons-debug.js +13/−9
- bundle/widget-buttons/widget-buttons-min.js +2/−2
- bundle/widget-buttons/widget-buttons.js +13/−9
- bundle/widget-child/widget-child-coverage.js +3/−3
- bundle/widget-child/widget-child-debug.js +2/−2
- bundle/widget-child/widget-child-min.js +2/−2
- bundle/widget-child/widget-child.js +2/−2
- bundle/widget-htmlparser/assets/widget-base-core.css +1/−1
- bundle/widget-htmlparser/widget-htmlparser-coverage.js +3/−3
- bundle/widget-htmlparser/widget-htmlparser-debug.js +2/−2
- bundle/widget-htmlparser/widget-htmlparser-min.js +2/−2
- bundle/widget-htmlparser/widget-htmlparser.js +2/−2
- bundle/widget-locale/assets/widget-base-core.css +1/−1
- bundle/widget-locale/widget-locale-coverage.js +3/−3
- bundle/widget-locale/widget-locale-debug.js +2/−2
- bundle/widget-locale/widget-locale-min.js +2/−2
- bundle/widget-locale/widget-locale.js +2/−2
- bundle/widget-modality/assets/skins/night/widget-modality-skin.css +1/−1
- bundle/widget-modality/assets/skins/night/widget-modality.css +1/−1
- bundle/widget-modality/assets/skins/sam/widget-modality-skin.css +1/−1
- bundle/widget-modality/assets/skins/sam/widget-modality.css +1/−1
- bundle/widget-modality/assets/widget-modality-core.css +1/−1
- bundle/widget-modality/widget-modality-coverage.js +3/−3
- bundle/widget-modality/widget-modality-debug.js +2/−2
- bundle/widget-modality/widget-modality-min.js +2/−2
- bundle/widget-modality/widget-modality.js +2/−2
- bundle/widget-parent/widget-parent-coverage.js +3/−3
- bundle/widget-parent/widget-parent-debug.js +2/−2
- bundle/widget-parent/widget-parent-min.js +2/−2
- bundle/widget-parent/widget-parent.js +2/−2
- bundle/widget-position-align/widget-position-align-coverage.js +3/−3
- bundle/widget-position-align/widget-position-align-debug.js +2/−2
- bundle/widget-position-align/widget-position-align-min.js +2/−2
- bundle/widget-position-align/widget-position-align.js +2/−2
- bundle/widget-position-constrain/widget-position-constrain-coverage.js +3/−3
- bundle/widget-position-constrain/widget-position-constrain-debug.js +2/−2
- bundle/widget-position-constrain/widget-position-constrain-min.js +2/−2
- bundle/widget-position-constrain/widget-position-constrain.js +2/−2
- bundle/widget-position/widget-position-coverage.js +3/−3
- bundle/widget-position/widget-position-debug.js +2/−2
- bundle/widget-position/widget-position-min.js +2/−2
- bundle/widget-position/widget-position.js +2/−2
- bundle/widget-skin/assets/widget-base-core.css +1/−1
- bundle/widget-skin/widget-skin-coverage.js +3/−3
- bundle/widget-skin/widget-skin-debug.js +2/−2
- bundle/widget-skin/widget-skin-min.js +2/−2
- bundle/widget-skin/widget-skin.js +2/−2
- bundle/widget-stack/assets/skins/night/widget-stack-skin.css +1/−1
- bundle/widget-stack/assets/skins/night/widget-stack.css +1/−1
- bundle/widget-stack/assets/skins/sam/widget-stack-skin.css +1/−1
- bundle/widget-stack/assets/skins/sam/widget-stack.css +1/−1
- bundle/widget-stack/assets/widget-stack-core.css +1/−1
- bundle/widget-stack/widget-stack-coverage.js +3/−3
- bundle/widget-stack/widget-stack-debug.js +2/−2
- bundle/widget-stack/widget-stack-min.js +2/−2
- bundle/widget-stack/widget-stack.js +2/−2
- bundle/widget-stdmod/widget-stdmod-coverage.js +3/−3
- bundle/widget-stdmod/widget-stdmod-debug.js +2/−2
- bundle/widget-stdmod/widget-stdmod-min.js +2/−2
- bundle/widget-stdmod/widget-stdmod.js +2/−2
- bundle/widget-uievents/assets/widget-base-core.css +1/−1
- bundle/widget-uievents/widget-uievents-coverage.js +3/−3
- bundle/widget-uievents/widget-uievents-debug.js +2/−2
- bundle/widget-uievents/widget-uievents-min.js +2/−2
- bundle/widget-uievents/widget-uievents.js +2/−2
- bundle/yql-nodejs/yql-nodejs-coverage.js +79/−0
- bundle/yql-nodejs/yql-nodejs-debug.js +36/−0
- bundle/yql-nodejs/yql-nodejs-min.js +7/−0
- bundle/yql-nodejs/yql-nodejs.js +36/−0
- bundle/yql-winjs/yql-winjs-coverage.js +89/−0
- bundle/yql-winjs/yql-winjs-debug.js +40/−0
- bundle/yql-winjs/yql-winjs-min.js +7/−0
- bundle/yql-winjs/yql-winjs.js +40/−0
- bundle/yql/yql-coverage.js +36/−25
- bundle/yql/yql-debug.js +14/−5
- bundle/yql/yql-min.js +2/−2
- bundle/yql/yql.js +13/−4
- bundle/yui-base/yui-base-coverage.js +162/−146
- bundle/yui-base/yui-base-debug.js +100/−52
- bundle/yui-base/yui-base-min.js +2/−2
- bundle/yui-base/yui-base.js +100/−52
- bundle/yui-core/yui-core-coverage.js +162/−146
- bundle/yui-core/yui-core-debug.js +33/−19
- bundle/yui-core/yui-core-min.js +2/−2
- bundle/yui-core/yui-core.js +33/−19
- bundle/yui-later/yui-later-coverage.js +3/−3
- bundle/yui-later/yui-later-debug.js +2/−2
- bundle/yui-later/yui-later-min.js +2/−2
- bundle/yui-later/yui-later.js +2/−2
- bundle/yui-log-nodejs/yui-log-nodejs-coverage.js +3/−3
- bundle/yui-log-nodejs/yui-log-nodejs-debug.js +2/−2
- bundle/yui-log-nodejs/yui-log-nodejs-min.js +2/−2
- bundle/yui-log-nodejs/yui-log-nodejs.js +2/−2
- bundle/yui-log/yui-log-coverage.js +3/−3
- bundle/yui-log/yui-log-debug.js +2/−2
- bundle/yui-log/yui-log-min.js +2/−2
- bundle/yui-log/yui-log.js +2/−2
- bundle/yui-nodejs/yui-nodejs-coverage.js +162/−146
- bundle/yui-nodejs/yui-nodejs-debug.js +189/−156
- bundle/yui-nodejs/yui-nodejs-min.js +2/−2
- bundle/yui-nodejs/yui-nodejs.js +189/−156
- bundle/yui-throttle/yui-throttle-coverage.js +7/−7
- bundle/yui-throttle/yui-throttle-debug.js +6/−6
- bundle/yui-throttle/yui-throttle-min.js +2/−2
- bundle/yui-throttle/yui-throttle.js +6/−6
- bundle/yui/yui-coverage.js +162/−146
- bundle/yui/yui-debug.js +230/−175
- bundle/yui/yui-min.js +2/−2
- bundle/yui/yui.js +230/−175
- happstack-yui.cabal +17/−12
bundle/align-plugin/align-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/align-plugin/align-plugin.js", code: [] };-_yuitest_coverage["build/align-plugin/align-plugin.js"].code=["YUI.add('align-plugin', function (Y, NAME) {",""," /**"," * Provides advanced positioning support for Node via a Plugin"," * for centering and alignment. "," * @module align-plugin"," */",""," var OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight',"," undefined = undefined;",""," /**"," * Node plugin which can be used to align a node with another node,"," * region, or the viewport."," *"," * @class Plugin.Align"," * @param {Object} User configuration object"," */"," function Align(config) {"," if (config.host) {"," this._host = config.host;"," }"," }"," "," Align.prototype = {"," /**"," * Aligns node with a point on another node or region."," * Possible alignment points are:"," * <dl>"," * <dt>tl</dt>"," * <dd>top left</dd>"," * <dt>tr</dt>"," * <dd>top right</dd>"," * <dt>bl</dt>"," * <dd>bottom left</dd>"," * <dt>br</dt>"," * <dd>bottom right</dd>"," * <dt>tc</dt>"," * <dd>top center</dd>"," * <dt>bc</dt>"," * <dd>bottom center</dd>"," * <dt>rc</dt>"," * <dd>right center</dd>"," * <dt>lc</dt>"," * <dd>left center</dd>"," * <dt>cc</dt>"," * <dd>center center</dd>"," * </dl>"," * @method to "," * @param region {String || Node || HTMLElement || Object} The node or"," * region to align with. Defaults to the viewport region."," * @param regionPoint {String} The point of the region to align with."," * @param point {String} The point of the node aligned to the region. "," * @param resize {Boolean} Whether or not the node should re-align when"," * the window is resized. Defaults to false."," */"," to: function(region, regionPoint, point, syncOnResize) {"," // cache original args for syncing"," this._syncArgs = Y.Array(arguments);",""," if (region.top === undefined) {"," region = Y.one(region).get('region');"," }",""," if (region) {"," var xy = [region.left, region.top],"," offxy = [region.width, region.height],"," points = Align.points,"," node = this._host,"," NULL = null,"," size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),"," nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets"," regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,"," regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,"," nodeFn0 = point ? points[point.charAt(0)] : NULL,"," nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;",""," if (regionFn0) {"," xy = regionFn0(xy, offxy, regionPoint);"," }"," if (regionFn1) {"," xy = regionFn1(xy, offxy, regionPoint);"," }",""," if (nodeFn0) {"," xy = nodeFn0(xy, nodeoff, point);"," }"," if (nodeFn1) {"," xy = nodeFn1(xy, nodeoff, point);"," }",""," if (xy && node) {"," node.setXY(xy);"," }"," "," this._resize(syncOnResize);",""," }"," return this;"," },",""," sync: function() {"," this.to.apply(this, this._syncArgs);"," return this;"," },",""," _resize: function(add) {"," var handle = this._handle;"," if (add && !handle) {"," this._handle = Y.on('resize', this._onresize, window, this);"," } else if (!add && handle) {"," handle.detach();"," }",""," },",""," _onresize: function() {"," var self = this;"," setTimeout(function() { // for performance"," self.sync();"," });"," },"," "," /**"," * Aligns the center of a node to the center of another node or region."," * @method center "," * @param region {Node || HTMLElement || Object} optional The node or"," * region to align with. Defaults to the viewport region."," * the window is resized. If centering to viewport, this defaults"," * to true, otherwise default is false."," */"," center: function(region, resize) {"," this.to(region, 'cc', 'cc', resize); "," return this;"," },",""," /**"," * Removes the resize handler, if any. This is called automatically"," * when unplugged from the host node."," * @method destroy "," */"," destroy: function() {"," var handle = this._handle;"," if (handle) {"," handle.detach();"," }"," }"," };",""," Align.points = {"," 't': function(xy, off) {"," return xy;"," },",""," 'r': function(xy, off) {"," return [xy[0] + off[0], xy[1]];"," },",""," 'b': function(xy, off) {"," return [xy[0], xy[1] + off[1]];"," },",""," 'l': function(xy, off) {"," return xy;"," },",""," 'c': function(xy, off, point) {"," var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,"," ret, val;",""," if (point === 'cc') {"," ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];"," } else {"," val = xy[axis] + off[axis] / 2;"," ret = (axis) ? [xy[0], val] : [val, xy[1]];"," }",""," return ret;"," }"," };",""," Align.NAME = 'Align';"," Align.NS = 'align';",""," Align.prototype.constructor = Align;",""," Y.namespace('Plugin');"," Y.Plugin.Align = Align;","","","","}, '3.7.2', {\"requires\": [\"node-screen\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/align-plugin/align-plugin.js"].code=["YUI.add('align-plugin', function (Y, NAME) {",""," /**"," * Provides advanced positioning support for Node via a Plugin"," * for centering and alignment. "," * @module align-plugin"," */",""," var OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight',"," undefined = undefined;",""," /**"," * Node plugin which can be used to align a node with another node,"," * region, or the viewport."," *"," * @class Plugin.Align"," * @param {Object} User configuration object"," */"," function Align(config) {"," if (config.host) {"," this._host = config.host;"," }"," }"," "," Align.prototype = {"," /**"," * Aligns node with a point on another node or region."," * Possible alignment points are:"," * <dl>"," * <dt>tl</dt>"," * <dd>top left</dd>"," * <dt>tr</dt>"," * <dd>top right</dd>"," * <dt>bl</dt>"," * <dd>bottom left</dd>"," * <dt>br</dt>"," * <dd>bottom right</dd>"," * <dt>tc</dt>"," * <dd>top center</dd>"," * <dt>bc</dt>"," * <dd>bottom center</dd>"," * <dt>rc</dt>"," * <dd>right center</dd>"," * <dt>lc</dt>"," * <dd>left center</dd>"," * <dt>cc</dt>"," * <dd>center center</dd>"," * </dl>"," * @method to "," * @param region {String || Node || HTMLElement || Object} The node or"," * region to align with. Defaults to the viewport region."," * @param regionPoint {String} The point of the region to align with."," * @param point {String} The point of the node aligned to the region. "," * @param resize {Boolean} Whether or not the node should re-align when"," * the window is resized. Defaults to false."," */"," to: function(region, regionPoint, point, syncOnResize) {"," // cache original args for syncing"," this._syncArgs = Y.Array(arguments);",""," if (region.top === undefined) {"," region = Y.one(region).get('region');"," }",""," if (region) {"," var xy = [region.left, region.top],"," offxy = [region.width, region.height],"," points = Align.points,"," node = this._host,"," NULL = null,"," size = node.getAttrs([OFFSET_HEIGHT, OFFSET_WIDTH]),"," nodeoff = [0 - size[OFFSET_WIDTH], 0 - size[OFFSET_HEIGHT]], // reverse offsets"," regionFn0 = regionPoint ? points[regionPoint.charAt(0)]: NULL,"," regionFn1 = (regionPoint && regionPoint !== 'cc') ? points[regionPoint.charAt(1)] : NULL,"," nodeFn0 = point ? points[point.charAt(0)] : NULL,"," nodeFn1 = (point && point !== 'cc') ? points[point.charAt(1)] : NULL;",""," if (regionFn0) {"," xy = regionFn0(xy, offxy, regionPoint);"," }"," if (regionFn1) {"," xy = regionFn1(xy, offxy, regionPoint);"," }",""," if (nodeFn0) {"," xy = nodeFn0(xy, nodeoff, point);"," }"," if (nodeFn1) {"," xy = nodeFn1(xy, nodeoff, point);"," }",""," if (xy && node) {"," node.setXY(xy);"," }"," "," this._resize(syncOnResize);",""," }"," return this;"," },",""," sync: function() {"," this.to.apply(this, this._syncArgs);"," return this;"," },",""," _resize: function(add) {"," var handle = this._handle;"," if (add && !handle) {"," this._handle = Y.on('resize', this._onresize, window, this);"," } else if (!add && handle) {"," handle.detach();"," }",""," },",""," _onresize: function() {"," var self = this;"," setTimeout(function() { // for performance"," self.sync();"," });"," },"," "," /**"," * Aligns the center of a node to the center of another node or region."," * @method center "," * @param region {Node || HTMLElement || Object} optional The node or"," * region to align with. Defaults to the viewport region."," * the window is resized. If centering to viewport, this defaults"," * to true, otherwise default is false."," */"," center: function(region, resize) {"," this.to(region, 'cc', 'cc', resize); "," return this;"," },",""," /**"," * Removes the resize handler, if any. This is called automatically"," * when unplugged from the host node."," * @method destroy "," */"," destroy: function() {"," var handle = this._handle;"," if (handle) {"," handle.detach();"," }"," }"," };",""," Align.points = {"," 't': function(xy, off) {"," return xy;"," },",""," 'r': function(xy, off) {"," return [xy[0] + off[0], xy[1]];"," },",""," 'b': function(xy, off) {"," return [xy[0], xy[1] + off[1]];"," },",""," 'l': function(xy, off) {"," return xy;"," },",""," 'c': function(xy, off, point) {"," var axis = (point[0] === 't' || point[0] === 'b') ? 0 : 1,"," ret, val;",""," if (point === 'cc') {"," ret = [xy[0] + off[0] / 2, xy[1] + off[1] / 2];"," } else {"," val = xy[axis] + off[axis] / 2;"," ret = (axis) ? [xy[0], val] : [val, xy[1]];"," }",""," return ret;"," }"," };",""," Align.NAME = 'Align';"," Align.NS = 'align';",""," Align.prototype.constructor = Align;",""," Y.namespace('Plugin');"," Y.Plugin.Align = Align;","","","","}, '3.7.3', {\"requires\": [\"node-screen\", \"node-pluginhost\"]});"]; _yuitest_coverage["build/align-plugin/align-plugin.js"].lines = {"1":0,"9":0,"20":0,"21":0,"22":0,"26":0,"60":0,"62":0,"63":0,"66":0,"67":0,"79":0,"80":0,"82":0,"83":0,"86":0,"87":0,"89":0,"90":0,"93":0,"94":0,"97":0,"100":0,"104":0,"105":0,"109":0,"110":0,"111":0,"112":0,"113":0,"119":0,"120":0,"121":0,"134":0,"135":0,"144":0,"145":0,"146":0,"151":0,"153":0,"157":0,"161":0,"165":0,"169":0,"172":0,"173":0,"175":0,"176":0,"179":0,"183":0,"184":0,"186":0,"188":0,"189":0}; _yuitest_coverage["build/align-plugin/align-plugin.js"].functions = {"Align:20":0,"to:58":0,"sync:103":0,"_resize:108":0,"(anonymous 2):120":0,"_onresize:118":0,"center:133":0,"destroy:143":0,"\'t\':152":0,"\'r\':156":0,"\'b\':160":0,"\'l\':164":0,"\'c\':168":0,"(anonymous 1):1":0}; _yuitest_coverage["build/align-plugin/align-plugin.js"].coveredLines = 54;@@ -297,4 +297,4 @@ -}, '3.7.2', {"requires": ["node-screen", "node-pluginhost"]});+}, '3.7.3', {"requires": ["node-screen", "node-pluginhost"]});
bundle/align-plugin/align-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -196,4 +196,4 @@ -}, '3.7.2', {"requires": ["node-screen", "node-pluginhost"]});+}, '3.7.3', {"requires": ["node-screen", "node-pluginhost"]});
bundle/align-plugin/align-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"3.7.2",{requires:["node-screen","node-pluginhost"]});+YUI.add("align-plugin",function(e,t){function s(e){e.host&&(this._host=e.host)}var n="offsetWidth",r="offsetHeight",i=i;s.prototype={to:function(t,o,u,a){this._syncArgs=e.Array(arguments),t.top===i&&(t=e.one(t).get("region"));if(t){var f=[t.left,t.top],l=[t.width,t.height],c=s.points,h=this._host,p=null,d=h.getAttrs([r,n]),v=[0-d[n],0-d[r]],m=o?c[o.charAt(0)]:p,g=o&&o!=="cc"?c[o.charAt(1)]:p,y=u?c[u.charAt(0)]:p,b=u&&u!=="cc"?c[u.charAt(1)]:p;m&&(f=m(f,l,o)),g&&(f=g(f,l,o)),y&&(f=y(f,v,u)),b&&(f=b(f,v,u)),f&&h&&h.setXY(f),this._resize(a)}return this},sync:function(){return this.to.apply(this,this._syncArgs),this},_resize:function(t){var n=this._handle;t&&!n?this._handle=e.on("resize",this._onresize,window,this):!t&&n&&n.detach()},_onresize:function(){var e=this;setTimeout(function(){e.sync()})},center:function(e,t){return this.to(e,"cc","cc",t),this},destroy:function(){var e=this._handle;e&&e.detach()}},s.points={t:function(e,t){return e},r:function(e,t){return[e[0]+t[0],e[1]]},b:function(e,t){return[e[0],e[1]+t[1]]},l:function(e,t){return e},c:function(e,t,n){var r=n[0]==="t"||n[0]==="b"?0:1,i,s;return n==="cc"?i=[e[0]+t[0]/2,e[1]+t[1]/2]:(s=e[r]+t[r]/2,i=r?[e[0],s]:[s,e[1]]),i}},s.NAME="Align",s.NS="align",s.prototype.constructor=s,e.namespace("Plugin"),e.Plugin.Align=s},"3.7.3",{requires:["node-screen","node-pluginhost"]});
bundle/align-plugin/align-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -196,4 +196,4 @@ -}, '3.7.2', {"requires": ["node-screen", "node-pluginhost"]});+}, '3.7.3', {"requires": ["node-screen", "node-pluginhost"]});
bundle/anim-base/anim-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-base/anim-base.js", code: [] };-_yuitest_coverage["build/anim-base/anim-base.js"].code=["YUI.add('anim-base', function (Y, NAME) {","","/**","* The Animation Utility provides an API for creating advanced transitions.","* @module anim","*/","","/**","* Provides the base Anim class, for animating numeric properties.","*","* @module anim","* @submodule anim-base","*/",""," /**"," * A class for constructing animation instances."," * @class Anim"," * @for Anim"," * @constructor"," * @extends Base"," */",""," var RUNNING = 'running',"," START_TIME = 'startTime',"," ELAPSED_TIME = 'elapsedTime',"," /**"," * @for Anim"," * @event start"," * @description fires when an animation begins."," * @param {Event} ev The start event."," * @type Event.Custom"," */"," START = 'start',",""," /**"," * @event tween"," * @description fires every frame of the animation."," * @param {Event} ev The tween event."," * @type Event.Custom"," */"," TWEEN = 'tween',",""," /**"," * @event end"," * @description fires after the animation completes."," * @param {Event} ev The end event."," * @type Event.Custom"," */"," END = 'end',"," NODE = 'node',"," PAUSED = 'paused',"," REVERSE = 'reverse', // TODO: cleanup"," ITERATION_COUNT = 'iterationCount',",""," NUM = Number;",""," var _running = {},"," _timer;",""," Y.Anim = function() {"," Y.Anim.superclass.constructor.apply(this, arguments);"," Y.Anim._instances[Y.stamp(this)] = this;"," };",""," Y.Anim.NAME = 'anim';",""," Y.Anim._instances = {};",""," /**"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;",""," /**"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," Y.Anim.DEFAULT_UNIT = 'px';",""," Y.Anim.DEFAULT_EASING = function (t, b, c, d) {"," return c * t / d + b; // linear easing"," };",""," /**"," * Time in milliseconds passed to setInterval for frame processing "," *"," * @property intervalTime"," * @default 20"," * @static"," */"," Y.Anim._intervalTime = 20;",""," /**"," * Bucket for custom getters and setters"," *"," * @property behaviors"," * @static"," */"," Y.Anim.behaviors = {"," left: {"," get: function(anim, attr) {"," return anim._getOffset(attr);"," }"," }"," };",""," Y.Anim.behaviors.top = Y.Anim.behaviors.left;",""," /**"," * The default setter to use when setting object properties."," *"," * @property DEFAULT_SETTER"," * @static"," */"," Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {"," var node = anim._node,"," domNode = node._node,"," val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," unit = unit || '';"," node.setStyle(att, val + unit);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," node.setAttribute(att, val);"," } else if (att in domNode) {"," domNode[att] = val;"," }"," } else if (node.set) {"," node.set(att, val);"," } else if (att in node) {"," node[att] = val;"," }"," };",""," /**"," * The default getter to use when getting object properties."," *"," * @property DEFAULT_GETTER"," * @static"," */"," Y.Anim.DEFAULT_GETTER = function(anim, att) {"," var node = anim._node,"," domNode = node._node,"," val = '';",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," val = node.getComputedStyle(att);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," val = node.getAttribute(att);"," } else if (att in domNode) {"," val = domNode[att];"," }"," } else if (node.get) {"," val = node.get(att);"," } else if (att in node) {"," val = node[att];"," }",""," return val;"," };",""," Y.Anim.ATTRS = {"," /**"," * The object to be animated."," * @attribute node"," * @type Node"," */"," node: {"," setter: function(node) {"," if (node) {"," if (typeof node == 'string' || node.nodeType) {"," node = Y.one(node);"," }"," }",""," this._node = node;"," if (!node) {"," }"," return node;"," }"," },",""," /**"," * The length of the animation. Defaults to \"1\" (second)."," * @attribute duration"," * @type NUM"," */"," duration: {"," value: 1"," },",""," /**"," * The method that will provide values to the attribute(s) during the animation. "," * Defaults to \"Easing.easeNone\"."," * @attribute easing"," * @type Function"," */"," easing: {"," value: Y.Anim.DEFAULT_EASING,",""," setter: function(val) {"," if (typeof val === 'string' && Y.Easing) {"," return Y.Easing[val];"," }"," }"," },",""," /**"," * The starting values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * If a function is used, the return value becomes the from value."," * If no from value is specified, the DEFAULT_GETTER will be used."," * Supports any unit, provided it matches the \"to\" (or default)"," * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute from"," * @type Object"," */"," from: {},",""," /**"," * The ending values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * Supports any unit, provided it matches the \"from\" (or default)"," * unit (e.g. `{width: '50%', color: 'red', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute to"," * @type Object"," */"," to: {},",""," /**"," * Date stamp for the first frame of the animation."," * @attribute startTime"," * @type Int"," * @default 0 "," * @readOnly"," */"," startTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Current time the animation has been running."," * @attribute elapsedTime"," * @type Int"," * @default 0 "," * @readOnly"," */"," elapsedTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Whether or not the animation is currently running."," * @attribute running "," * @type Boolean"," * @default false "," * @readOnly"," */"," running: {"," getter: function() {"," return !!_running[Y.stamp(this)];"," },"," value: false,"," readOnly: true"," },",""," /**"," * The number of times the animation should run "," * @attribute iterations"," * @type Int"," * @default 1 "," */"," iterations: {"," value: 1"," },",""," /**"," * The number of iterations that have occurred."," * Resets when an animation ends (reaches iteration count or stop() called). "," * @attribute iterationCount"," * @type Int"," * @default 0"," * @readOnly"," */"," iterationCount: {"," value: 0,"," readOnly: true"," },",""," /**"," * How iterations of the animation should behave. "," * Possible values are \"normal\" and \"alternate\"."," * Normal will repeat the animation, alternate will reverse on every other pass."," *"," * @attribute direction"," * @type String"," * @default \"normal\""," */"," direction: {"," value: 'normal' // | alternate (fwd on odd, rev on even per spec)"," },",""," /**"," * Whether or not the animation is currently paused."," * @attribute paused "," * @type Boolean"," * @default false "," * @readOnly"," */"," paused: {"," readOnly: true,"," value: false"," },",""," /**"," * If true, animation begins from last frame"," * @attribute reverse"," * @type Boolean"," * @default false "," */"," reverse: {"," value: false"," }","",""," };",""," /**"," * Runs all animation instances."," * @method run"," * @static"," */ "," Y.Anim.run = function() {"," var instances = Y.Anim._instances;"," for (var i in instances) {"," if (instances[i].run) {"," instances[i].run();"," }"," }"," };",""," /**"," * Pauses all animation instances."," * @method pause"," * @static"," */ "," Y.Anim.pause = function() {"," for (var i in _running) { // stop timer if nothing running"," if (_running[i].pause) {"," _running[i].pause();"," }"," }",""," Y.Anim._stopTimer();"," };",""," /**"," * Stops all animation instances."," * @method stop"," * @static"," */ "," Y.Anim.stop = function() {"," for (var i in _running) { // stop timer if nothing running"," if (_running[i].stop) {"," _running[i].stop();"," }"," }"," Y.Anim._stopTimer();"," };"," "," Y.Anim._startTimer = function() {"," if (!_timer) {"," _timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);"," }"," };",""," Y.Anim._stopTimer = function() {"," clearInterval(_timer);"," _timer = 0;"," };",""," /**"," * Called per Interval to handle each animation frame."," * @method _runFrame"," * @private"," * @static"," */ "," Y.Anim._runFrame = function() {"," var done = true;"," for (var anim in _running) {"," if (_running[anim]._runFrame) {"," done = false;"," _running[anim]._runFrame();"," }"," }",""," if (done) {"," Y.Anim._stopTimer();"," }"," };",""," Y.Anim.RE_UNITS = /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;",""," var proto = {"," /**"," * Starts or resumes an animation."," * @method run"," * @chainable"," */ "," run: function() {"," if (this.get(PAUSED)) {"," this._resume();"," } else if (!this.get(RUNNING)) {"," this._start();"," }"," return this;"," },",""," /**"," * Pauses the animation and"," * freezes it in its current state and time."," * Calling run() will continue where it left off."," * @method pause"," * @chainable"," */ "," pause: function() {"," if (this.get(RUNNING)) {"," this._pause();"," }"," return this;"," },",""," /**"," * Stops the animation and resets its time."," * @method stop"," * @param {Boolean} finish If true, the animation will move to the last frame"," * @chainable"," */ "," stop: function(finish) {"," if (this.get(RUNNING) || this.get(PAUSED)) {"," this._end(finish);"," }"," return this;"," },",""," _added: false,",""," _start: function() {"," this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));"," this._actualFrames = 0;"," if (!this.get(PAUSED)) {"," this._initAnimAttr();"," }"," _running[Y.stamp(this)] = this;"," Y.Anim._startTimer();",""," this.fire(START);"," },",""," _pause: function() {"," this._set(START_TIME, null);"," this._set(PAUSED, true);"," delete _running[Y.stamp(this)];",""," /**"," * @event pause"," * @description fires when an animation is paused."," * @param {Event} ev The pause event."," * @type Event.Custom"," */"," this.fire('pause');"," },",""," _resume: function() {"," this._set(PAUSED, false);"," _running[Y.stamp(this)] = this;"," this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));"," Y.Anim._startTimer();",""," /**"," * @event resume"," * @description fires when an animation is resumed (run from pause)."," * @param {Event} ev The pause event."," * @type Event.Custom"," */"," this.fire('resume');"," },",""," _end: function(finish) {"," var duration = this.get('duration') * 1000;"," if (finish) { // jump to last frame"," this._runAttrs(duration, duration, this.get(REVERSE));"," }",""," this._set(START_TIME, null);"," this._set(ELAPSED_TIME, 0);"," this._set(PAUSED, false);",""," delete _running[Y.stamp(this)];"," this.fire(END, {elapsed: this.get(ELAPSED_TIME)});"," },",""," _runFrame: function() {"," var d = this._runtimeAttr.duration,"," t = new Date() - this.get(START_TIME),"," reverse = this.get(REVERSE),"," done = (t >= d),"," attribute,"," setter;"," "," this._runAttrs(t, d, reverse);"," this._actualFrames += 1;"," this._set(ELAPSED_TIME, t);",""," this.fire(TWEEN);"," if (done) {"," this._lastFrame();"," }"," },",""," _runAttrs: function(t, d, reverse) {"," var attr = this._runtimeAttr,"," customAttr = Y.Anim.behaviors,"," easing = attr.easing,"," lastFrame = d,"," done = false,"," attribute,"," setter,"," i;",""," if (t >= d) {"," done = true;"," }",""," if (reverse) {"," t = d - t;"," lastFrame = 0;"," }",""," for (i in attr) {"," if (attr[i].to) {"," attribute = attr[i];"," setter = (i in customAttr && 'set' in customAttr[i]) ?"," customAttr[i].set : Y.Anim.DEFAULT_SETTER;",""," if (!done) {"," setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); "," } else {"," setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); "," }"," }"," }","",""," },",""," _lastFrame: function() {"," var iter = this.get('iterations'),"," iterCount = this.get(ITERATION_COUNT);",""," iterCount += 1;"," if (iter === 'infinite' || iterCount < iter) {"," if (this.get('direction') === 'alternate') {"," this.set(REVERSE, !this.get(REVERSE)); // flip it"," }"," /**"," * @event iteration"," * @description fires when an animation begins an iteration."," * @param {Event} ev The iteration event."," * @type Event.Custom"," */"," this.fire('iteration');"," } else {"," iterCount = 0;"," this._end();"," }",""," this._set(START_TIME, new Date());"," this._set(ITERATION_COUNT, iterCount);"," },",""," _initAnimAttr: function() {"," var from = this.get('from') || {},"," to = this.get('to') || {},"," attr = {"," duration: this.get('duration') * 1000,"," easing: this.get('easing')"," },"," customAttr = Y.Anim.behaviors,"," node = this.get(NODE), // implicit attr init"," unit, begin, end;",""," Y.each(to, function(val, name) {"," if (typeof val === 'function') {"," val = val.call(this, node);"," }",""," begin = from[name];"," if (begin === undefined) {"," begin = (name in customAttr && 'get' in customAttr[name]) ?"," customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);"," } else if (typeof begin === 'function') {"," begin = begin.call(this, node);"," }",""," var mFrom = Y.Anim.RE_UNITS.exec(begin);"," var mTo = Y.Anim.RE_UNITS.exec(val);",""," begin = mFrom ? mFrom[1] : begin;"," end = mTo ? mTo[1] : val;"," unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units",""," if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {"," unit = Y.Anim.DEFAULT_UNIT;"," }",""," if (!begin || !end) {"," Y.error('invalid \"from\" or \"to\" for \"' + name + '\"', 'Anim');"," return;"," }",""," attr[name] = {"," from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,"," to: end,"," unit: unit"," };",""," }, this);",""," this._runtimeAttr = attr;"," },","",""," // TODO: move to computedStyle? (browsers dont agree on default computed offsets)"," _getOffset: function(attr) {"," var node = this._node,"," val = node.getComputedStyle(attr),"," get = (attr === 'left') ? 'getX': 'getY',"," set = (attr === 'left') ? 'setX': 'setY';",""," if (val === 'auto') {"," var position = node.getStyle('position');"," if (position === 'absolute' || position === 'fixed') {"," val = node[get]();"," node[set](val);"," } else {"," val = 0;"," }"," }",""," return val;"," },",""," destructor: function() {"," delete Y.Anim._instances[Y.stamp(this)];"," }"," };",""," Y.extend(Y.Anim, Y.Base, proto);","","","}, '3.7.2', {\"requires\": [\"base-base\", \"node-style\"]});"];+_yuitest_coverage["build/anim-base/anim-base.js"].code=["YUI.add('anim-base', function (Y, NAME) {","","/**","* The Animation Utility provides an API for creating advanced transitions.","* @module anim","*/","","/**","* Provides the base Anim class, for animating numeric properties.","*","* @module anim","* @submodule anim-base","*/",""," /**"," * A class for constructing animation instances."," * @class Anim"," * @for Anim"," * @constructor"," * @extends Base"," */",""," var RUNNING = 'running',"," START_TIME = 'startTime',"," ELAPSED_TIME = 'elapsedTime',"," /**"," * @for Anim"," * @event start"," * @description fires when an animation begins."," * @param {Event} ev The start event."," * @type Event.Custom"," */"," START = 'start',",""," /**"," * @event tween"," * @description fires every frame of the animation."," * @param {Event} ev The tween event."," * @type Event.Custom"," */"," TWEEN = 'tween',",""," /**"," * @event end"," * @description fires after the animation completes."," * @param {Event} ev The end event."," * @type Event.Custom"," */"," END = 'end',"," NODE = 'node',"," PAUSED = 'paused',"," REVERSE = 'reverse', // TODO: cleanup"," ITERATION_COUNT = 'iterationCount',",""," NUM = Number;",""," var _running = {},"," _timer;",""," Y.Anim = function() {"," Y.Anim.superclass.constructor.apply(this, arguments);"," Y.Anim._instances[Y.stamp(this)] = this;"," };",""," Y.Anim.NAME = 'anim';",""," Y.Anim._instances = {};",""," /**"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," Y.Anim.RE_DEFAULT_UNIT = /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i;",""," /**"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," Y.Anim.DEFAULT_UNIT = 'px';",""," Y.Anim.DEFAULT_EASING = function (t, b, c, d) {"," return c * t / d + b; // linear easing"," };",""," /**"," * Time in milliseconds passed to setInterval for frame processing "," *"," * @property intervalTime"," * @default 20"," * @static"," */"," Y.Anim._intervalTime = 20;",""," /**"," * Bucket for custom getters and setters"," *"," * @property behaviors"," * @static"," */"," Y.Anim.behaviors = {"," left: {"," get: function(anim, attr) {"," return anim._getOffset(attr);"," }"," }"," };",""," Y.Anim.behaviors.top = Y.Anim.behaviors.left;",""," /**"," * The default setter to use when setting object properties."," *"," * @property DEFAULT_SETTER"," * @static"," */"," Y.Anim.DEFAULT_SETTER = function(anim, att, from, to, elapsed, duration, fn, unit) {"," var node = anim._node,"," domNode = node._node,"," val = fn(elapsed, NUM(from), NUM(to) - NUM(from), duration);",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," unit = unit || '';"," node.setStyle(att, val + unit);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," node.setAttribute(att, val);"," } else if (att in domNode) {"," domNode[att] = val;"," }"," } else if (node.set) {"," node.set(att, val);"," } else if (att in node) {"," node[att] = val;"," }"," };",""," /**"," * The default getter to use when getting object properties."," *"," * @property DEFAULT_GETTER"," * @static"," */"," Y.Anim.DEFAULT_GETTER = function(anim, att) {"," var node = anim._node,"," domNode = node._node,"," val = '';",""," if (domNode) {"," if ('style' in domNode && (att in domNode.style || att in Y.DOM.CUSTOM_STYLES)) {"," val = node.getComputedStyle(att);"," } else if ('attributes' in domNode && att in domNode.attributes) {"," val = node.getAttribute(att);"," } else if (att in domNode) {"," val = domNode[att];"," }"," } else if (node.get) {"," val = node.get(att);"," } else if (att in node) {"," val = node[att];"," }",""," return val;"," };",""," Y.Anim.ATTRS = {"," /**"," * The object to be animated."," * @attribute node"," * @type Node"," */"," node: {"," setter: function(node) {"," if (node) {"," if (typeof node == 'string' || node.nodeType) {"," node = Y.one(node);"," }"," }",""," this._node = node;"," if (!node) {"," }"," return node;"," }"," },",""," /**"," * The length of the animation. Defaults to \"1\" (second)."," * @attribute duration"," * @type NUM"," */"," duration: {"," value: 1"," },",""," /**"," * The method that will provide values to the attribute(s) during the animation. "," * Defaults to \"Easing.easeNone\"."," * @attribute easing"," * @type Function"," */"," easing: {"," value: Y.Anim.DEFAULT_EASING,",""," setter: function(val) {"," if (typeof val === 'string' && Y.Easing) {"," return Y.Easing[val];"," }"," }"," },",""," /**"," * The starting values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * If a function is used, the return value becomes the from value."," * If no from value is specified, the DEFAULT_GETTER will be used."," * Supports any unit, provided it matches the \"to\" (or default)"," * unit (e.g. `{width: '10em', color: 'rgb(0, 0, 0)', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100}, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute from"," * @type Object"," */"," from: {},",""," /**"," * The ending values for the animated properties."," *"," * Fields may be strings, numbers, or functions."," * Supports any unit, provided it matches the \"from\" (or default)"," * unit (e.g. `{width: '50%', color: 'red', borderColor: '#ccc'}`)."," *"," * If using the default ('px' for length-based units), the unit may be omitted"," * (e.g. `{width: 100, borderColor: 'ccc'}`, which defaults to pixels"," * and hex, respectively)."," *"," * @attribute to"," * @type Object"," */"," to: {},",""," /**"," * Date stamp for the first frame of the animation."," * @attribute startTime"," * @type Int"," * @default 0 "," * @readOnly"," */"," startTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Current time the animation has been running."," * @attribute elapsedTime"," * @type Int"," * @default 0 "," * @readOnly"," */"," elapsedTime: {"," value: 0,"," readOnly: true"," },",""," /**"," * Whether or not the animation is currently running."," * @attribute running "," * @type Boolean"," * @default false "," * @readOnly"," */"," running: {"," getter: function() {"," return !!_running[Y.stamp(this)];"," },"," value: false,"," readOnly: true"," },",""," /**"," * The number of times the animation should run "," * @attribute iterations"," * @type Int"," * @default 1 "," */"," iterations: {"," value: 1"," },",""," /**"," * The number of iterations that have occurred."," * Resets when an animation ends (reaches iteration count or stop() called). "," * @attribute iterationCount"," * @type Int"," * @default 0"," * @readOnly"," */"," iterationCount: {"," value: 0,"," readOnly: true"," },",""," /**"," * How iterations of the animation should behave. "," * Possible values are \"normal\" and \"alternate\"."," * Normal will repeat the animation, alternate will reverse on every other pass."," *"," * @attribute direction"," * @type String"," * @default \"normal\""," */"," direction: {"," value: 'normal' // | alternate (fwd on odd, rev on even per spec)"," },",""," /**"," * Whether or not the animation is currently paused."," * @attribute paused "," * @type Boolean"," * @default false "," * @readOnly"," */"," paused: {"," readOnly: true,"," value: false"," },",""," /**"," * If true, animation begins from last frame"," * @attribute reverse"," * @type Boolean"," * @default false "," */"," reverse: {"," value: false"," }","",""," };",""," /**"," * Runs all animation instances."," * @method run"," * @static"," */ "," Y.Anim.run = function() {"," var instances = Y.Anim._instances;"," for (var i in instances) {"," if (instances[i].run) {"," instances[i].run();"," }"," }"," };",""," /**"," * Pauses all animation instances."," * @method pause"," * @static"," */ "," Y.Anim.pause = function() {"," for (var i in _running) { // stop timer if nothing running"," if (_running[i].pause) {"," _running[i].pause();"," }"," }",""," Y.Anim._stopTimer();"," };",""," /**"," * Stops all animation instances."," * @method stop"," * @static"," */ "," Y.Anim.stop = function() {"," for (var i in _running) { // stop timer if nothing running"," if (_running[i].stop) {"," _running[i].stop();"," }"," }"," Y.Anim._stopTimer();"," };"," "," Y.Anim._startTimer = function() {"," if (!_timer) {"," _timer = setInterval(Y.Anim._runFrame, Y.Anim._intervalTime);"," }"," };",""," Y.Anim._stopTimer = function() {"," clearInterval(_timer);"," _timer = 0;"," };",""," /**"," * Called per Interval to handle each animation frame."," * @method _runFrame"," * @private"," * @static"," */ "," Y.Anim._runFrame = function() {"," var done = true;"," for (var anim in _running) {"," if (_running[anim]._runFrame) {"," done = false;"," _running[anim]._runFrame();"," }"," }",""," if (done) {"," Y.Anim._stopTimer();"," }"," };",""," Y.Anim.RE_UNITS = /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;",""," var proto = {"," /**"," * Starts or resumes an animation."," * @method run"," * @chainable"," */ "," run: function() {"," if (this.get(PAUSED)) {"," this._resume();"," } else if (!this.get(RUNNING)) {"," this._start();"," }"," return this;"," },",""," /**"," * Pauses the animation and"," * freezes it in its current state and time."," * Calling run() will continue where it left off."," * @method pause"," * @chainable"," */ "," pause: function() {"," if (this.get(RUNNING)) {"," this._pause();"," }"," return this;"," },",""," /**"," * Stops the animation and resets its time."," * @method stop"," * @param {Boolean} finish If true, the animation will move to the last frame"," * @chainable"," */ "," stop: function(finish) {"," if (this.get(RUNNING) || this.get(PAUSED)) {"," this._end(finish);"," }"," return this;"," },",""," _added: false,",""," _start: function() {"," this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));"," this._actualFrames = 0;"," if (!this.get(PAUSED)) {"," this._initAnimAttr();"," }"," _running[Y.stamp(this)] = this;"," Y.Anim._startTimer();",""," this.fire(START);"," },",""," _pause: function() {"," this._set(START_TIME, null);"," this._set(PAUSED, true);"," delete _running[Y.stamp(this)];",""," /**"," * @event pause"," * @description fires when an animation is paused."," * @param {Event} ev The pause event."," * @type Event.Custom"," */"," this.fire('pause');"," },",""," _resume: function() {"," this._set(PAUSED, false);"," _running[Y.stamp(this)] = this;"," this._set(START_TIME, new Date() - this.get(ELAPSED_TIME));"," Y.Anim._startTimer();",""," /**"," * @event resume"," * @description fires when an animation is resumed (run from pause)."," * @param {Event} ev The pause event."," * @type Event.Custom"," */"," this.fire('resume');"," },",""," _end: function(finish) {"," var duration = this.get('duration') * 1000;"," if (finish) { // jump to last frame"," this._runAttrs(duration, duration, this.get(REVERSE));"," }",""," this._set(START_TIME, null);"," this._set(ELAPSED_TIME, 0);"," this._set(PAUSED, false);",""," delete _running[Y.stamp(this)];"," this.fire(END, {elapsed: this.get(ELAPSED_TIME)});"," },",""," _runFrame: function() {"," var d = this._runtimeAttr.duration,"," t = new Date() - this.get(START_TIME),"," reverse = this.get(REVERSE),"," done = (t >= d),"," attribute,"," setter;"," "," this._runAttrs(t, d, reverse);"," this._actualFrames += 1;"," this._set(ELAPSED_TIME, t);",""," this.fire(TWEEN);"," if (done) {"," this._lastFrame();"," }"," },",""," _runAttrs: function(t, d, reverse) {"," var attr = this._runtimeAttr,"," customAttr = Y.Anim.behaviors,"," easing = attr.easing,"," lastFrame = d,"," done = false,"," attribute,"," setter,"," i;",""," if (t >= d) {"," done = true;"," }",""," if (reverse) {"," t = d - t;"," lastFrame = 0;"," }",""," for (i in attr) {"," if (attr[i].to) {"," attribute = attr[i];"," setter = (i in customAttr && 'set' in customAttr[i]) ?"," customAttr[i].set : Y.Anim.DEFAULT_SETTER;",""," if (!done) {"," setter(this, i, attribute.from, attribute.to, t, d, easing, attribute.unit); "," } else {"," setter(this, i, attribute.from, attribute.to, lastFrame, d, easing, attribute.unit); "," }"," }"," }","",""," },",""," _lastFrame: function() {"," var iter = this.get('iterations'),"," iterCount = this.get(ITERATION_COUNT);",""," iterCount += 1;"," if (iter === 'infinite' || iterCount < iter) {"," if (this.get('direction') === 'alternate') {"," this.set(REVERSE, !this.get(REVERSE)); // flip it"," }"," /**"," * @event iteration"," * @description fires when an animation begins an iteration."," * @param {Event} ev The iteration event."," * @type Event.Custom"," */"," this.fire('iteration');"," } else {"," iterCount = 0;"," this._end();"," }",""," this._set(START_TIME, new Date());"," this._set(ITERATION_COUNT, iterCount);"," },",""," _initAnimAttr: function() {"," var from = this.get('from') || {},"," to = this.get('to') || {},"," attr = {"," duration: this.get('duration') * 1000,"," easing: this.get('easing')"," },"," customAttr = Y.Anim.behaviors,"," node = this.get(NODE), // implicit attr init"," unit, begin, end;",""," Y.each(to, function(val, name) {"," if (typeof val === 'function') {"," val = val.call(this, node);"," }",""," begin = from[name];"," if (begin === undefined) {"," begin = (name in customAttr && 'get' in customAttr[name]) ?"," customAttr[name].get(this, name) : Y.Anim.DEFAULT_GETTER(this, name);"," } else if (typeof begin === 'function') {"," begin = begin.call(this, node);"," }",""," var mFrom = Y.Anim.RE_UNITS.exec(begin);"," var mTo = Y.Anim.RE_UNITS.exec(val);",""," begin = mFrom ? mFrom[1] : begin;"," end = mTo ? mTo[1] : val;"," unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units",""," if (!unit && Y.Anim.RE_DEFAULT_UNIT.test(name)) {"," unit = Y.Anim.DEFAULT_UNIT;"," }",""," if (!begin || !end) {"," Y.error('invalid \"from\" or \"to\" for \"' + name + '\"', 'Anim');"," return;"," }",""," attr[name] = {"," from: Y.Lang.isObject(begin) ? Y.clone(begin) : begin,"," to: end,"," unit: unit"," };",""," }, this);",""," this._runtimeAttr = attr;"," },","",""," // TODO: move to computedStyle? (browsers dont agree on default computed offsets)"," _getOffset: function(attr) {"," var node = this._node,"," val = node.getComputedStyle(attr),"," get = (attr === 'left') ? 'getX': 'getY',"," set = (attr === 'left') ? 'setX': 'setY';",""," if (val === 'auto') {"," var position = node.getStyle('position');"," if (position === 'absolute' || position === 'fixed') {"," val = node[get]();"," node[set](val);"," } else {"," val = 0;"," }"," }",""," return val;"," },",""," destructor: function() {"," delete Y.Anim._instances[Y.stamp(this)];"," }"," };",""," Y.extend(Y.Anim, Y.Base, proto);","","","}, '3.7.3', {\"requires\": [\"base-base\", \"node-style\"]});"]; _yuitest_coverage["build/anim-base/anim-base.js"].lines = {"1":0,"23":0,"57":0,"60":0,"61":0,"62":0,"65":0,"67":0,"75":0,"83":0,"85":0,"86":0,"96":0,"104":0,"107":0,"112":0,"120":0,"121":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"134":0,"135":0,"136":0,"137":0,"147":0,"148":0,"152":0,"153":0,"154":0,"155":0,"156":0,"157":0,"158":0,"160":0,"161":0,"162":0,"163":0,"166":0,"169":0,"177":0,"178":0,"179":0,"183":0,"184":0,"186":0,"209":0,"210":0,"282":0,"354":0,"355":0,"356":0,"357":0,"358":0,"368":0,"369":0,"370":0,"371":0,"375":0,"383":0,"384":0,"385":0,"386":0,"389":0,"392":0,"393":0,"394":0,"398":0,"399":0,"400":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"418":0,"419":0,"423":0,"425":0,"432":0,"433":0,"434":0,"435":0,"437":0,"448":0,"449":0,"451":0,"461":0,"462":0,"464":0,"470":0,"471":0,"472":0,"473":0,"475":0,"476":0,"478":0,"482":0,"483":0,"484":0,"492":0,"496":0,"497":0,"498":0,"499":0,"507":0,"511":0,"512":0,"513":0,"516":0,"517":0,"518":0,"520":0,"521":0,"525":0,"532":0,"533":0,"534":0,"536":0,"537":0,"538":0,"543":0,"552":0,"553":0,"556":0,"557":0,"558":0,"561":0,"562":0,"563":0,"564":0,"567":0,"568":0,"570":0,"579":0,"582":0,"583":0,"584":0,"585":0,"593":0,"595":0,"596":0,"599":0,"600":0,"604":0,"614":0,"615":0,"616":0,"619":0,"620":0,"621":0,"623":0,"624":0,"627":0,"628":0,"630":0,"631":0,"632":0,"634":0,"635":0,"638":0,"639":0,"640":0,"643":0,"651":0,"657":0,"662":0,"663":0,"664":0,"665":0,"666":0,"668":0,"672":0,"676":0,"680":0}; _yuitest_coverage["build/anim-base/anim-base.js"].functions = {"Anim:60":0,"DEFAULT_EASING:85":0,"get:106":0,"DEFAULT_SETTER:120":0,"DEFAULT_GETTER:147":0,"setter:176":0,"setter:208":0,"getter:281":0,"run:354":0,"pause:368":0,"stop:383":0,"_startTimer:392":0,"_stopTimer:398":0,"_runFrame:409":0,"run:431":0,"pause:447":0,"stop:460":0,"_start:469":0,"_pause:481":0,"_resume:495":0,"_end:510":0,"_runFrame:524":0,"_runAttrs:542":0,"_lastFrame:578":0,"(anonymous 2):614":0,"_initAnimAttr:603":0,"_getOffset:656":0,"destructor:675":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-base/anim-base.js"].coveredLines = 181;@@ -929,4 +929,4 @@ Y.extend(Y.Anim, Y.Base, proto); -}, '3.7.2', {"requires": ["base-base", "node-style"]});+}, '3.7.3', {"requires": ["base-base", "node-style"]});
bundle/anim-base/anim-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -687,4 +687,4 @@ Y.extend(Y.Anim, Y.Base, proto); -}, '3.7.2', {"requires": ["base-base", "node-style"]});+}, '3.7.3', {"requires": ["base-base", "node-style"]});
bundle/anim-base/anim-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances;for(var n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0;for(var n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e,u,a;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY";if(n==="auto"){var s=t.getStyle("position");s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0}return n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"3.7.2",{requires:["base-base","node-style"]});+YUI.add("anim-base",function(e,t){var n="running",r="startTime",i="elapsedTime",s="start",o="tween",u="end",a="node",f="paused",l="reverse",c="iterationCount",h=Number,p={},d;e.Anim=function(){e.Anim.superclass.constructor.apply(this,arguments),e.Anim._instances[e.stamp(this)]=this},e.Anim.NAME="anim",e.Anim._instances={},e.Anim.RE_DEFAULT_UNIT=/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,e.Anim.DEFAULT_UNIT="px",e.Anim.DEFAULT_EASING=function(e,t,n,r){return n*e/r+t},e.Anim._intervalTime=20,e.Anim.behaviors={left:{get:function(e,t){return e._getOffset(t)}}},e.Anim.behaviors.top=e.Anim.behaviors.left,e.Anim.DEFAULT_SETTER=function(t,n,r,i,s,o,u,a){var f=t._node,l=f._node,c=u(s,h(r),h(i)-h(r),o);l?"style"in l&&(n in l.style||n in e.DOM.CUSTOM_STYLES)?(a=a||"",f.setStyle(n,c+a)):"attributes"in l&&n in l.attributes?f.setAttribute(n,c):n in l&&(l[n]=c):f.set?f.set(n,c):n in f&&(f[n]=c)},e.Anim.DEFAULT_GETTER=function(t,n){var r=t._node,i=r._node,s="";return i?"style"in i&&(n in i.style||n in e.DOM.CUSTOM_STYLES)?s=r.getComputedStyle(n):"attributes"in i&&n in i.attributes?s=r.getAttribute(n):n in i&&(s=i[n]):r.get?s=r.get(n):n in r&&(s=r[n]),s},e.Anim.ATTRS={node:{setter:function(t){return t&&(typeof t=="string"||t.nodeType)&&(t=e.one(t)),this._node=t,!t,t}},duration:{value:1},easing:{value:e.Anim.DEFAULT_EASING,setter:function(t){if(typeof t=="string"&&e.Easing)return e.Easing[t]}},from:{},to:{},startTime:{value:0,readOnly:!0},elapsedTime:{value:0,readOnly:!0},running:{getter:function(){return!!p[e.stamp(this)]},value:!1,readOnly:!0},iterations:{value:1},iterationCount:{value:0,readOnly:!0},direction:{value:"normal"},paused:{readOnly:!0,value:!1},reverse:{value:!1}},e.Anim.run=function(){var t=e.Anim._instances;for(var n in t)t[n].run&&t[n].run()},e.Anim.pause=function(){for(var t in p)p[t].pause&&p[t].pause();e.Anim._stopTimer()},e.Anim.stop=function(){for(var t in p)p[t].stop&&p[t].stop();e.Anim._stopTimer()},e.Anim._startTimer=function(){d||(d=setInterval(e.Anim._runFrame,e.Anim._intervalTime))},e.Anim._stopTimer=function(){clearInterval(d),d=0},e.Anim._runFrame=function(){var t=!0;for(var n in p)p[n]._runFrame&&(t=!1,p[n]._runFrame());t&&e.Anim._stopTimer()},e.Anim.RE_UNITS=/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/;var v={run:function(){return this.get(f)?this._resume():this.get(n)||this._start(),this},pause:function(){return this.get(n)&&this._pause(),this},stop:function(e){return(this.get(n)||this.get(f))&&this._end(e),this},_added:!1,_start:function(){this._set(r,new Date-this.get(i)),this._actualFrames=0,this.get(f)||this._initAnimAttr(),p[e.stamp(this)]=this,e.Anim._startTimer(),this.fire(s)},_pause:function(){this._set(r,null),this._set(f,!0),delete p[e.stamp(this)],this.fire("pause")},_resume:function(){this._set(f,!1),p[e.stamp(this)]=this,this._set(r,new Date-this.get(i)),e.Anim._startTimer(),this.fire("resume")},_end:function(t){var n=this.get("duration")*1e3;t&&this._runAttrs(n,n,this.get(l)),this._set(r,null),this._set(i,0),this._set(f,!1),delete p[e.stamp(this)],this.fire(u,{elapsed:this.get(i)})},_runFrame:function(){var e=this._runtimeAttr.duration,t=new Date-this.get(r),n=this.get(l),s=t>=e,u,a;this._runAttrs(t,e,n),this._actualFrames+=1,this._set(i,t),this.fire(o),s&&this._lastFrame()},_runAttrs:function(t,n,r){var i=this._runtimeAttr,s=e.Anim.behaviors,o=i.easing,u=n,a=!1,f,l,c;t>=n&&(a=!0),r&&(t=n-t,u=0);for(c in i)i[c].to&&(f=i[c],l=c in s&&"set"in s[c]?s[c].set:e.Anim.DEFAULT_SETTER,a?l(this,c,f.from,f.to,u,n,o,f.unit):l(this,c,f.from,f.to,t,n,o,f.unit))},_lastFrame:function(){var e=this.get("iterations"),t=this.get(c);t+=1,e==="infinite"||t<e?(this.get("direction")==="alternate"&&this.set(l,!this.get(l)),this.fire("iteration")):(t=0,this._end()),this._set(r,new Date),this._set(c,t)},_initAnimAttr:function(){var t=this.get("from")||{},n=this.get("to")||{},r={duration:this.get("duration")*1e3,easing:this.get("easing")},i=e.Anim.behaviors,s=this.get(a),o,u,f;e.each(n,function(n,a){typeof n=="function"&&(n=n.call(this,s)),u=t[a],u===undefined?u=a in i&&"get"in i[a]?i[a].get(this,a):e.Anim.DEFAULT_GETTER(this,a):typeof u=="function"&&(u=u.call(this,s));var l=e.Anim.RE_UNITS.exec(u),c=e.Anim.RE_UNITS.exec(n);u=l?l[1]:u,f=c?c[1]:n,o=c?c[2]:l?l[2]:"",!o&&e.Anim.RE_DEFAULT_UNIT.test(a)&&(o=e.Anim.DEFAULT_UNIT);if(!u||!f){e.error('invalid "from" or "to" for "'+a+'"',"Anim");return}r[a]={from:e.Lang.isObject(u)?e.clone(u):u,to:f,unit:o}},this),this._runtimeAttr=r},_getOffset:function(e){var t=this._node,n=t.getComputedStyle(e),r=e==="left"?"getX":"getY",i=e==="left"?"setX":"setY";if(n==="auto"){var s=t.getStyle("position");s==="absolute"||s==="fixed"?(n=t[r](),t[i](n)):n=0}return n},destructor:function(){delete e.Anim._instances[e.stamp(this)]}};e.extend(e.Anim,e.Base,v)},"3.7.3",{requires:["base-base","node-style"]});
bundle/anim-base/anim-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -686,4 +686,4 @@ Y.extend(Y.Anim, Y.Base, proto); -}, '3.7.2', {"requires": ["base-base", "node-style"]});+}, '3.7.3', {"requires": ["base-base", "node-style"]});
bundle/anim-color/anim-color-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-color/anim-color.js", code: [] };-_yuitest_coverage["build/anim-color/anim-color.js"].code=["YUI.add('anim-color', function (Y, NAME) {","","/**"," * Adds support for color properties in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-color"," */","","var NUM = Number;","","Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)","{"," fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));"," toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));",""," if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {"," Y.error('invalid from or to passed to color behavior');"," }",""," return 'rgb(' + ["," Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))"," ].join(', ') + ')';","};","","Y.Anim.behaviors.color = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); "," },"," "," // TODO: default bgcolor const"," get: function(anim, att) {"," var val = anim._node.getComputedStyle(att);"," val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;"," return val;"," }","};","","Y.each(['backgroundColor',"," 'borderColor',"," 'borderTopColor',"," 'borderRightColor', "," 'borderBottomColor', "," 'borderLeftColor'],"," function(v, i) {"," Y.Anim.behaviors[v] = Y.Anim.behaviors.color;"," }",");","","","}, '3.7.2', {\"requires\": [\"anim-base\"]});"];+_yuitest_coverage["build/anim-color/anim-color.js"].code=["YUI.add('anim-color', function (Y, NAME) {","","/**"," * Adds support for color properties in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-color"," */","","var NUM = Number;","","Y.Anim.getUpdatedColorValue = function(fromColor, toColor, elapsed, duration, fn)","{"," fromColor = Y.Color.re_RGB.exec(Y.Color.toRGB(fromColor));"," toColor = Y.Color.re_RGB.exec(Y.Color.toRGB(toColor));",""," if (!fromColor || fromColor.length < 3 || !toColor || toColor.length < 3) {"," Y.error('invalid from or to passed to color behavior');"," }",""," return 'rgb(' + ["," Math.floor(fn(elapsed, NUM(fromColor[1]), NUM(toColor[1]) - NUM(fromColor[1]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[2]), NUM(toColor[2]) - NUM(fromColor[2]), duration)),"," Math.floor(fn(elapsed, NUM(fromColor[3]), NUM(toColor[3]) - NUM(fromColor[3]), duration))"," ].join(', ') + ')';","};","","Y.Anim.behaviors.color = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setStyle(att, Y.Anim.getUpdatedColorValue(from, to, elapsed, duration, fn)); "," },"," "," // TODO: default bgcolor const"," get: function(anim, att) {"," var val = anim._node.getComputedStyle(att);"," val = (val === 'transparent') ? 'rgb(255, 255, 255)' : val;"," return val;"," }","};","","Y.each(['backgroundColor',"," 'borderColor',"," 'borderTopColor',"," 'borderRightColor', "," 'borderBottomColor', "," 'borderLeftColor'],"," function(v, i) {"," Y.Anim.behaviors[v] = Y.Anim.behaviors.color;"," }",");","","","}, '3.7.3', {\"requires\": [\"anim-base\"]});"]; _yuitest_coverage["build/anim-color/anim-color.js"].lines = {"1":0,"10":0,"12":0,"14":0,"15":0,"17":0,"18":0,"21":0,"28":0,"30":0,"35":0,"36":0,"37":0,"41":0,"48":0}; _yuitest_coverage["build/anim-color/anim-color.js"].functions = {"getUpdatedColorValue:12":0,"set:29":0,"get:34":0,"(anonymous 2):47":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-color/anim-color.js"].coveredLines = 15;@@ -109,4 +109,4 @@ ); -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-color/anim-color-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ ); -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-color/anim-color-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-color",function(e,t){var n=Number;e.Anim.getUpdatedColorValue=function(t,r,i,s,o){return t=e.Color.re_RGB.exec(e.Color.toRGB(t)),r=e.Color.re_RGB.exec(e.Color.toRGB(r)),(!t||t.length<3||!r||r.length<3)&&e.error("invalid from or to passed to color behavior"),"rgb("+[Math.floor(o(i,n(t[1]),n(r[1])-n(t[1]),s)),Math.floor(o(i,n(t[2]),n(r[2])-n(t[2]),s)),Math.floor(o(i,n(t[3]),n(r[3])-n(t[3]),s))].join(", ")+")"},e.Anim.behaviors.color={set:function(t,n,r,i,s,o,u){t._node.setStyle(n,e.Anim.getUpdatedColorValue(r,i,s,o,u))},get:function(e,t){var n=e._node.getComputedStyle(t);return n=n==="transparent"?"rgb(255, 255, 255)":n,n}},e.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(t,n){e.Anim.behaviors[t]=e.Anim.behaviors.color})},"3.7.2",{requires:["anim-base"]});+YUI.add("anim-color",function(e,t){var n=Number;e.Anim.getUpdatedColorValue=function(t,r,i,s,o){return t=e.Color.re_RGB.exec(e.Color.toRGB(t)),r=e.Color.re_RGB.exec(e.Color.toRGB(r)),(!t||t.length<3||!r||r.length<3)&&e.error("invalid from or to passed to color behavior"),"rgb("+[Math.floor(o(i,n(t[1]),n(r[1])-n(t[1]),s)),Math.floor(o(i,n(t[2]),n(r[2])-n(t[2]),s)),Math.floor(o(i,n(t[3]),n(r[3])-n(t[3]),s))].join(", ")+")"},e.Anim.behaviors.color={set:function(t,n,r,i,s,o,u){t._node.setStyle(n,e.Anim.getUpdatedColorValue(r,i,s,o,u))},get:function(e,t){var n=e._node.getComputedStyle(t);return n=n==="transparent"?"rgb(255, 255, 255)":n,n}},e.each(["backgroundColor","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"],function(t,n){e.Anim.behaviors[t]=e.Anim.behaviors.color})},"3.7.3",{requires:["anim-base"]});
bundle/anim-color/anim-color.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ ); -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-curve/anim-curve-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-curve/anim-curve.js", code: [] };-_yuitest_coverage["build/anim-curve/anim-curve.js"].code=["YUI.add('anim-curve', function (Y, NAME) {","","/**"," * Adds support for the <code>curve</code> property for the <code>to</code> "," * attribute. A curve is zero or more control points and an end point."," * @module anim"," * @submodule anim-curve"," */","","Y.Anim.behaviors.curve = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," from = from.slice.call(from);"," to = to.slice.call(to);"," var t = fn(elapsed, 0, 100, duration) / 100;"," to.unshift(from);"," anim._node.setXY(Y.Anim.getBezier(to, t));"," },",""," get: function(anim, att) {"," return anim._node.getXY();"," }","};","","/**"," * Get the current position of the animated element based on t."," * Each point is an array of \"x\" and \"y\" values (0 = x, 1 = y)"," * At least 2 points are required (start and end)."," * First point is start. Last point is end."," * Additional control points are optional. "," * @for Anim"," * @method getBezier"," * @static"," * @param {Array} points An array containing Bezier points"," * @param {Number} t A number between 0 and 1 which is the basis for determining current position"," * @return {Array} An array containing int x and y member data"," */","Y.Anim.getBezier = function(points, t) { "," var n = points.length;"," var tmp = [];",""," for (var i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (var j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }",""," return [ tmp[0][0], tmp[0][1] ]; ","","};","","","}, '3.7.2', {\"requires\": [\"anim-xy\"]});"];+_yuitest_coverage["build/anim-curve/anim-curve.js"].code=["YUI.add('anim-curve', function (Y, NAME) {","","/**"," * Adds support for the <code>curve</code> property for the <code>to</code> "," * attribute. A curve is zero or more control points and an end point."," * @module anim"," * @submodule anim-curve"," */","","Y.Anim.behaviors.curve = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," from = from.slice.call(from);"," to = to.slice.call(to);"," var t = fn(elapsed, 0, 100, duration) / 100;"," to.unshift(from);"," anim._node.setXY(Y.Anim.getBezier(to, t));"," },",""," get: function(anim, att) {"," return anim._node.getXY();"," }","};","","/**"," * Get the current position of the animated element based on t."," * Each point is an array of \"x\" and \"y\" values (0 = x, 1 = y)"," * At least 2 points are required (start and end)."," * First point is start. Last point is end."," * Additional control points are optional. "," * @for Anim"," * @method getBezier"," * @static"," * @param {Array} points An array containing Bezier points"," * @param {Number} t A number between 0 and 1 which is the basis for determining current position"," * @return {Array} An array containing int x and y member data"," */","Y.Anim.getBezier = function(points, t) { "," var n = points.length;"," var tmp = [];",""," for (var i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (var j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }",""," return [ tmp[0][0], tmp[0][1] ]; ","","};","","","}, '3.7.3', {\"requires\": [\"anim-xy\"]});"]; _yuitest_coverage["build/anim-curve/anim-curve.js"].lines = {"1":0,"10":0,"12":0,"13":0,"14":0,"15":0,"16":0,"20":0,"37":0,"38":0,"39":0,"41":0,"42":0,"45":0,"46":0,"47":0,"48":0,"52":0}; _yuitest_coverage["build/anim-curve/anim-curve.js"].functions = {"set:11":0,"get:19":0,"getBezier:37":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-curve/anim-curve.js"].coveredLines = 18;@@ -115,4 +115,4 @@ }; -}, '3.7.2', {"requires": ["anim-xy"]});+}, '3.7.3', {"requires": ["anim-xy"]});
bundle/anim-curve/anim-curve-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -60,4 +60,4 @@ }; -}, '3.7.2', {"requires": ["anim-xy"]});+}, '3.7.3', {"requires": ["anim-xy"]});
bundle/anim-curve/anim-curve-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-curve",function(e,t){e.Anim.behaviors.curve={set:function(t,n,r,i,s,o,u){r=r.slice.call(r),i=i.slice.call(i);var a=u(s,0,100,o)/100;i.unshift(r),t._node.setXY(e.Anim.getBezier(i,a))},get:function(e,t){return e._node.getXY()}},e.Anim.getBezier=function(e,t){var n=e.length,r=[];for(var i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(var s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]}},"3.7.2",{requires:["anim-xy"]});+YUI.add("anim-curve",function(e,t){e.Anim.behaviors.curve={set:function(t,n,r,i,s,o,u){r=r.slice.call(r),i=i.slice.call(i);var a=u(s,0,100,o)/100;i.unshift(r),t._node.setXY(e.Anim.getBezier(i,a))},get:function(e,t){return e._node.getXY()}},e.Anim.getBezier=function(e,t){var n=e.length,r=[];for(var i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(var s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]}},"3.7.3",{requires:["anim-xy"]});
bundle/anim-curve/anim-curve.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -60,4 +60,4 @@ }; -}, '3.7.2', {"requires": ["anim-xy"]});+}, '3.7.3', {"requires": ["anim-xy"]});
bundle/anim-easing/anim-easing-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-easing/anim-easing.js", code: [] };-_yuitest_coverage["build/anim-easing/anim-easing.js"].code=["YUI.add('anim-easing', function (Y, NAME) {","","/*","TERMS OF USE - EASING EQUATIONS","Open source under the BSD License.","Copyright 2001 Robert Penner All rights reserved.","","Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:",""," * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."," * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."," * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.","","THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","*/","","/**"," * The easing module provides methods for customizing"," * how an animation behaves during each run."," * @class Easing"," * @module anim"," * @submodule anim-easing"," */","","var Easing = {",""," /**"," * Uniform speed between points."," * @for Easing"," * @method easeNone"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeNone: function (t, b, c, d) {"," return c*t/d + b;"," },"," "," /**"," * Begins slowly and accelerates towards end. (quadratic)"," * @method easeIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeIn: function (t, b, c, d) {"," return c*(t/=d)*t + b;"," },",""," /**"," * Begins quickly and decelerates towards end. (quadratic)"," * @method easeOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOut: function (t, b, c, d) {"," return -c *(t/=d)*(t-2) + b;"," },"," "," /**"," * Begins slowly and decelerates towards end. (quadratic)"," * @method easeBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBoth: function (t, b, c, d) {"," if ((t/=d/2) < 1) {"," return c/2*t*t + b;"," }"," "," return -c/2 * ((--t)*(t-2) - 1) + b;"," },"," "," /**"," * Begins slowly and accelerates towards end. (quartic)"," * @method easeInStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeInStrong: function (t, b, c, d) {"," return c*(t/=d)*t*t*t + b;"," },"," "," /**"," * Begins quickly and decelerates towards end. (quartic)"," * @method easeOutStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOutStrong: function (t, b, c, d) {"," return -c * ((t=t/d-1)*t*t*t - 1) + b;"," },"," "," /**"," * Begins slowly and decelerates towards end. (quartic)"," * @method easeBothStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBothStrong: function (t, b, c, d) {"," if ((t/=d/2) < 1) {"," return c/2*t*t*t*t + b;"," }"," "," return -c/2 * ((t-=2)*t*t*t - 2) + b;"," },",""," /**"," * Snap in elastic effect."," * @method elasticIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */",""," elasticIn: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p = d* 0.3;"," }"," "," if (!a || a < Math.abs(c)) {"," a = c; "," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," },",""," /**"," * Snap out elastic effect."," * @method elasticOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticOut: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p=d * 0.3;"," }"," "," if (!a || a < Math.abs(c)) {"," a = c;"," s = p / 4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;"," },"," "," /**"," * Snap both elastic effect."," * @method elasticBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticBoth: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," "," if ( (t /= d/2) === 2 ) {"," return b+c;"," }"," "," if (!p) {"," p = d*(0.3*1.5);"," }"," "," if ( !a || a < Math.abs(c) ) {"," a = c; "," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," if (t < 1) {"," return -0.5*(a*Math.pow(2,10*(t-=1)) * "," Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," }"," return a*Math.pow(2,-10*(t-=1)) * "," Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;"," },","",""," /**"," * Backtracks slightly, then reverses direction and moves to end."," * @method backIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backIn: function (t, b, c, d, s) {"," if (s === undefined) {"," s = 1.70158;"," }"," if (t === d) {"," t -= 0.001;"," }"," return c*(t/=d)*t*((s+1)*t - s) + b;"," },",""," /**"," * Overshoots end, then reverses and comes back to end."," * @method backOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backOut: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158;"," }"," return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;"," },"," "," /**"," * Backtracks slightly, then reverses direction, overshoots end, "," * then reverses and comes back to end."," * @method backBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backBoth: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158; "," }"," "," if ((t /= d/2 ) < 1) {"," return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;"," }"," return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;"," },",""," /**"," * Bounce off of start."," * @method bounceIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceIn: function (t, b, c, d) {"," return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;"," },"," "," /**"," * Bounces off end."," * @method bounceOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceOut: function (t, b, c, d) {"," if ((t/=d) < (1/2.75)) {"," return c*(7.5625*t*t) + b;"," } else if (t < (2/2.75)) {"," return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;"," } else if (t < (2.5/2.75)) {"," return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;"," }"," return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;"," },"," "," /**"," * Bounces off start and end."," * @method bounceBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceBoth: function (t, b, c, d) {"," if (t < d/2) {"," return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;"," }"," return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;"," }","};","","Y.Easing = Easing;","","","}, '3.7.2', {\"requires\": [\"anim-base\"]});"];+_yuitest_coverage["build/anim-easing/anim-easing.js"].code=["YUI.add('anim-easing', function (Y, NAME) {","","/*","TERMS OF USE - EASING EQUATIONS","Open source under the BSD License.","Copyright 2001 Robert Penner All rights reserved.","","Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:",""," * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer."," * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution."," * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.","","THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.","*/","","/**"," * The easing module provides methods for customizing"," * how an animation behaves during each run."," * @class Easing"," * @module anim"," * @submodule anim-easing"," */","","var Easing = {",""," /**"," * Uniform speed between points."," * @for Easing"," * @method easeNone"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeNone: function (t, b, c, d) {"," return c*t/d + b;"," },"," "," /**"," * Begins slowly and accelerates towards end. (quadratic)"," * @method easeIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeIn: function (t, b, c, d) {"," return c*(t/=d)*t + b;"," },",""," /**"," * Begins quickly and decelerates towards end. (quadratic)"," * @method easeOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOut: function (t, b, c, d) {"," return -c *(t/=d)*(t-2) + b;"," },"," "," /**"," * Begins slowly and decelerates towards end. (quadratic)"," * @method easeBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBoth: function (t, b, c, d) {"," if ((t/=d/2) < 1) {"," return c/2*t*t + b;"," }"," "," return -c/2 * ((--t)*(t-2) - 1) + b;"," },"," "," /**"," * Begins slowly and accelerates towards end. (quartic)"," * @method easeInStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeInStrong: function (t, b, c, d) {"," return c*(t/=d)*t*t*t + b;"," },"," "," /**"," * Begins quickly and decelerates towards end. (quartic)"," * @method easeOutStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeOutStrong: function (t, b, c, d) {"," return -c * ((t=t/d-1)*t*t*t - 1) + b;"," },"," "," /**"," * Begins slowly and decelerates towards end. (quartic)"," * @method easeBothStrong"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," easeBothStrong: function (t, b, c, d) {"," if ((t/=d/2) < 1) {"," return c/2*t*t*t*t + b;"," }"," "," return -c/2 * ((t-=2)*t*t*t - 2) + b;"," },",""," /**"," * Snap in elastic effect."," * @method elasticIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */",""," elasticIn: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p = d* 0.3;"," }"," "," if (!a || a < Math.abs(c)) {"," a = c; "," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," },",""," /**"," * Snap out elastic effect."," * @method elasticOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticOut: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," if ( (t /= d) === 1 ) {"," return b+c;"," }"," if (!p) {"," p=d * 0.3;"," }"," "," if (!a || a < Math.abs(c)) {"," a = c;"," s = p / 4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;"," },"," "," /**"," * Snap both elastic effect."," * @method elasticBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} a Amplitude (optional)"," * @param {Number} p Period (optional)"," * @return {Number} The computed value for the current animation frame"," */"," elasticBoth: function (t, b, c, d, a, p) {"," var s;"," if (t === 0) {"," return b;"," }"," "," if ( (t /= d/2) === 2 ) {"," return b+c;"," }"," "," if (!p) {"," p = d*(0.3*1.5);"," }"," "," if ( !a || a < Math.abs(c) ) {"," a = c; "," s = p/4;"," }"," else {"," s = p/(2*Math.PI) * Math.asin (c/a);"," }"," "," if (t < 1) {"," return -0.5*(a*Math.pow(2,10*(t-=1)) * "," Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;"," }"," return a*Math.pow(2,-10*(t-=1)) * "," Math.sin( (t*d-s)*(2*Math.PI)/p )*0.5 + c + b;"," },","",""," /**"," * Backtracks slightly, then reverses direction and moves to end."," * @method backIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backIn: function (t, b, c, d, s) {"," if (s === undefined) {"," s = 1.70158;"," }"," if (t === d) {"," t -= 0.001;"," }"," return c*(t/=d)*t*((s+1)*t - s) + b;"," },",""," /**"," * Overshoots end, then reverses and comes back to end."," * @method backOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backOut: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158;"," }"," return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;"," },"," "," /**"," * Backtracks slightly, then reverses direction, overshoots end, "," * then reverses and comes back to end."," * @method backBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @param {Number} s Overshoot (optional)"," * @return {Number} The computed value for the current animation frame"," */"," backBoth: function (t, b, c, d, s) {"," if (typeof s === 'undefined') {"," s = 1.70158; "," }"," "," if ((t /= d/2 ) < 1) {"," return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;"," }"," return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;"," },",""," /**"," * Bounce off of start."," * @method bounceIn"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceIn: function (t, b, c, d) {"," return c - Y.Easing.bounceOut(d-t, 0, c, d) + b;"," },"," "," /**"," * Bounces off end."," * @method bounceOut"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceOut: function (t, b, c, d) {"," if ((t/=d) < (1/2.75)) {"," return c*(7.5625*t*t) + b;"," } else if (t < (2/2.75)) {"," return c*(7.5625*(t-=(1.5/2.75))*t + 0.75) + b;"," } else if (t < (2.5/2.75)) {"," return c*(7.5625*(t-=(2.25/2.75))*t + 0.9375) + b;"," }"," return c*(7.5625*(t-=(2.625/2.75))*t + 0.984375) + b;"," },"," "," /**"," * Bounces off start and end."," * @method bounceBoth"," * @param {Number} t Time value used to compute current value"," * @param {Number} b Starting value"," * @param {Number} c Delta between start and end values"," * @param {Number} d Total length of animation"," * @return {Number} The computed value for the current animation frame"," */"," bounceBoth: function (t, b, c, d) {"," if (t < d/2) {"," return Y.Easing.bounceIn(t * 2, 0, c, d) * 0.5 + b;"," }"," return Y.Easing.bounceOut(t * 2 - d, 0, c, d) * 0.5 + c * 0.5 + b;"," }","};","","Y.Easing = Easing;","","","}, '3.7.3', {\"requires\": [\"anim-base\"]});"]; _yuitest_coverage["build/anim-easing/anim-easing.js"].lines = {"1":0,"25":0,"38":0,"51":0,"64":0,"77":0,"78":0,"81":0,"94":0,"107":0,"120":0,"121":0,"124":0,"140":0,"141":0,"142":0,"144":0,"145":0,"147":0,"148":0,"151":0,"152":0,"153":0,"156":0,"159":0,"174":0,"175":0,"176":0,"178":0,"179":0,"181":0,"182":0,"185":0,"186":0,"187":0,"190":0,"193":0,"208":0,"209":0,"210":0,"213":0,"214":0,"217":0,"218":0,"221":0,"222":0,"223":0,"226":0,"229":0,"230":0,"233":0,"249":0,"250":0,"252":0,"253":0,"255":0,"269":0,"270":0,"272":0,"287":0,"288":0,"291":0,"292":0,"294":0,"307":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"327":0,"340":0,"341":0,"343":0,"347":0}; _yuitest_coverage["build/anim-easing/anim-easing.js"].functions = {"easeNone:37":0,"easeIn:50":0,"easeOut:63":0,"easeBoth:76":0,"easeInStrong:93":0,"easeOutStrong:106":0,"easeBothStrong:119":0,"elasticIn:139":0,"elasticOut:173":0,"elasticBoth:207":0,"backIn:248":0,"backOut:268":0,"backBoth:286":0,"bounceIn:306":0,"bounceOut:319":0,"bounceBoth:339":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-easing/anim-easing.js"].coveredLines = 76;@@ -479,4 +479,4 @@ Y.Easing = Easing; -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-easing/anim-easing-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -353,4 +353,4 @@ Y.Easing = Easing; -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-easing/anim-easing-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-easing",function(e,t){var n={easeNone:function(e,t,n,r){return n*e/r+t},easeIn:function(e,t,n,r){return n*(e/=r)*e+t},easeOut:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeBoth:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInStrong:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutStrong:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeBothStrong:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},elasticIn:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r)===1?t+n:(s||(s=r*.3),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s))+t)},elasticOut:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r)===1?t+n:(s||(s=r*.3),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*e)*Math.sin((e*r-o)*2*Math.PI/s)+n+t)},elasticBoth:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r/2)===2?t+n:(s||(s=r*.3*1.5),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),e<1?-0.5*i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s)+t:i*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s)*.5+n+t)},backIn:function(e,t,n,r,i){return i===undefined&&(i=1.70158),e===r&&(e-=.001),n*(e/=r)*e*((i+1)*e-i)+t},backOut:function(e,t,n,r,i){return typeof i=="undefined"&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},backBoth:function(e,t,n,r,i){return typeof i=="undefined"&&(i=1.70158),(e/=r/2)<1?n/2*e*e*(((i*=1.525)+1)*e-i)+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},bounceIn:function(t,n,r,i){return r-e.Easing.bounceOut(i-t,0,r,i)+n},bounceOut:function(e,t,n,r){return(e/=r)<1/2.75?n*7.5625*e*e+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},bounceBoth:function(t,n,r,i){return t<i/2?e.Easing.bounceIn(t*2,0,r,i)*.5+n:e.Easing.bounceOut(t*2-i,0,r,i)*.5+r*.5+n}};e.Easing=n},"3.7.2",{requires:["anim-base"]});+YUI.add("anim-easing",function(e,t){var n={easeNone:function(e,t,n,r){return n*e/r+t},easeIn:function(e,t,n,r){return n*(e/=r)*e+t},easeOut:function(e,t,n,r){return-n*(e/=r)*(e-2)+t},easeBoth:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e+t:-n/2*(--e*(e-2)-1)+t},easeInStrong:function(e,t,n,r){return n*(e/=r)*e*e*e+t},easeOutStrong:function(e,t,n,r){return-n*((e=e/r-1)*e*e*e-1)+t},easeBothStrong:function(e,t,n,r){return(e/=r/2)<1?n/2*e*e*e*e+t:-n/2*((e-=2)*e*e*e-2)+t},elasticIn:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r)===1?t+n:(s||(s=r*.3),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s))+t)},elasticOut:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r)===1?t+n:(s||(s=r*.3),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*e)*Math.sin((e*r-o)*2*Math.PI/s)+n+t)},elasticBoth:function(e,t,n,r,i,s){var o;return e===0?t:(e/=r/2)===2?t+n:(s||(s=r*.3*1.5),!i||i<Math.abs(n)?(i=n,o=s/4):o=s/(2*Math.PI)*Math.asin(n/i),e<1?-0.5*i*Math.pow(2,10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s)+t:i*Math.pow(2,-10*(e-=1))*Math.sin((e*r-o)*2*Math.PI/s)*.5+n+t)},backIn:function(e,t,n,r,i){return i===undefined&&(i=1.70158),e===r&&(e-=.001),n*(e/=r)*e*((i+1)*e-i)+t},backOut:function(e,t,n,r,i){return typeof i=="undefined"&&(i=1.70158),n*((e=e/r-1)*e*((i+1)*e+i)+1)+t},backBoth:function(e,t,n,r,i){return typeof i=="undefined"&&(i=1.70158),(e/=r/2)<1?n/2*e*e*(((i*=1.525)+1)*e-i)+t:n/2*((e-=2)*e*(((i*=1.525)+1)*e+i)+2)+t},bounceIn:function(t,n,r,i){return r-e.Easing.bounceOut(i-t,0,r,i)+n},bounceOut:function(e,t,n,r){return(e/=r)<1/2.75?n*7.5625*e*e+t:e<2/2.75?n*(7.5625*(e-=1.5/2.75)*e+.75)+t:e<2.5/2.75?n*(7.5625*(e-=2.25/2.75)*e+.9375)+t:n*(7.5625*(e-=2.625/2.75)*e+.984375)+t},bounceBoth:function(t,n,r,i){return t<i/2?e.Easing.bounceIn(t*2,0,r,i)*.5+n:e.Easing.bounceOut(t*2-i,0,r,i)*.5+r*.5+n}};e.Easing=n},"3.7.3",{requires:["anim-base"]});
bundle/anim-easing/anim-easing.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -353,4 +353,4 @@ Y.Easing = Easing; -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-node-plugin/anim-node-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-node-plugin/anim-node-plugin.js", code: [] };-_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].code=["YUI.add('anim-node-plugin', function (Y, NAME) {","","/**"," * Binds an Anim instance to a Node instance"," * @module anim"," * @class Plugin.NodeFX"," * @extends Anim"," * @submodule anim-node-plugin"," */","","var NodeFX = function(config) {"," config = (config) ? Y.merge(config) : {};"," config.node = config.host;"," NodeFX.superclass.constructor.apply(this, arguments);","};","","NodeFX.NAME = \"nodefx\";","NodeFX.NS = \"fx\";","","Y.extend(NodeFX, Y.Anim);","","Y.namespace('Plugin');","Y.Plugin.NodeFX = NodeFX;","","","}, '3.7.2', {\"requires\": [\"node-pluginhost\", \"anim-base\"]});"];+_yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].code=["YUI.add('anim-node-plugin', function (Y, NAME) {","","/**"," * Binds an Anim instance to a Node instance"," * @module anim"," * @class Plugin.NodeFX"," * @extends Anim"," * @submodule anim-node-plugin"," */","","var NodeFX = function(config) {"," config = (config) ? Y.merge(config) : {};"," config.node = config.host;"," NodeFX.superclass.constructor.apply(this, arguments);","};","","NodeFX.NAME = \"nodefx\";","NodeFX.NS = \"fx\";","","Y.extend(NodeFX, Y.Anim);","","Y.namespace('Plugin');","Y.Plugin.NodeFX = NodeFX;","","","}, '3.7.3', {\"requires\": [\"node-pluginhost\", \"anim-base\"]});"]; _yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].lines = {"1":0,"11":0,"12":0,"13":0,"14":0,"17":0,"18":0,"20":0,"22":0,"23":0}; _yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].functions = {"NodeFX:11":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-node-plugin/anim-node-plugin.js"].coveredLines = 10;@@ -74,4 +74,4 @@ Y.Plugin.NodeFX = NodeFX; -}, '3.7.2', {"requires": ["node-pluginhost", "anim-base"]});+}, '3.7.3', {"requires": ["node-pluginhost", "anim-base"]});
bundle/anim-node-plugin/anim-node-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -29,4 +29,4 @@ Y.Plugin.NodeFX = NodeFX; -}, '3.7.2', {"requires": ["node-pluginhost", "anim-base"]});+}, '3.7.3', {"requires": ["node-pluginhost", "anim-base"]});
bundle/anim-node-plugin/anim-node-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-node-plugin",function(e,t){var n=function(t){t=t?e.merge(t):{},t.node=t.host,n.superclass.constructor.apply(this,arguments)};n.NAME="nodefx",n.NS="fx",e.extend(n,e.Anim),e.namespace("Plugin"),e.Plugin.NodeFX=n},"3.7.2",{requires:["node-pluginhost","anim-base"]});+YUI.add("anim-node-plugin",function(e,t){var n=function(t){t=t?e.merge(t):{},t.node=t.host,n.superclass.constructor.apply(this,arguments)};n.NAME="nodefx",n.NS="fx",e.extend(n,e.Anim),e.namespace("Plugin"),e.Plugin.NodeFX=n},"3.7.3",{requires:["node-pluginhost","anim-base"]});
bundle/anim-node-plugin/anim-node-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -29,4 +29,4 @@ Y.Plugin.NodeFX = NodeFX; -}, '3.7.2', {"requires": ["node-pluginhost", "anim-base"]});+}, '3.7.3', {"requires": ["node-pluginhost", "anim-base"]});
bundle/anim-scroll/anim-scroll-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-scroll/anim-scroll.js", code: [] };-_yuitest_coverage["build/anim-scroll/anim-scroll.js"].code=["YUI.add('anim-scroll', function (Y, NAME) {","","/**"," * Adds support for the <code>scroll</code> property in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-scroll"," */","","var NUM = Number;","","//TODO: deprecate for scrollTop/Left properties?","Y.Anim.behaviors.scroll = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var"," node = anim._node, "," val = (["," fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),"," fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)"," ]);",""," if (val[0]) {"," node.set('scrollLeft', val[0]);"," }",""," if (val[1]) {"," node.set('scrollTop', val[1]);"," }"," },"," get: function(anim) {"," var node = anim._node;"," return [node.get('scrollLeft'), node.get('scrollTop')];"," }","};","","","","}, '3.7.2', {\"requires\": [\"anim-base\"]});"];+_yuitest_coverage["build/anim-scroll/anim-scroll.js"].code=["YUI.add('anim-scroll', function (Y, NAME) {","","/**"," * Adds support for the <code>scroll</code> property in <code>to</code>"," * and <code>from</code> attributes."," * @module anim"," * @submodule anim-scroll"," */","","var NUM = Number;","","//TODO: deprecate for scrollTop/Left properties?","Y.Anim.behaviors.scroll = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var"," node = anim._node, "," val = (["," fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),"," fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)"," ]);",""," if (val[0]) {"," node.set('scrollLeft', val[0]);"," }",""," if (val[1]) {"," node.set('scrollTop', val[1]);"," }"," },"," get: function(anim) {"," var node = anim._node;"," return [node.get('scrollLeft'), node.get('scrollTop')];"," }","};","","","","}, '3.7.3', {\"requires\": [\"anim-base\"]});"]; _yuitest_coverage["build/anim-scroll/anim-scroll.js"].lines = {"1":0,"10":0,"13":0,"15":0,"22":0,"23":0,"26":0,"27":0,"31":0,"32":0}; _yuitest_coverage["build/anim-scroll/anim-scroll.js"].functions = {"set:14":0,"get:30":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-scroll/anim-scroll.js"].coveredLines = 10;@@ -87,4 +87,4 @@ -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-scroll/anim-scroll-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -41,4 +41,4 @@ -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-scroll/anim-scroll-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-scroll",function(e,t){var n=Number;e.Anim.behaviors.scroll={set:function(e,t,r,i,s,o,u){var a=e._node,f=[u(s,n(r[0]),n(i[0])-n(r[0]),o),u(s,n(r[1]),n(i[1])-n(r[1]),o)];f[0]&&a.set("scrollLeft",f[0]),f[1]&&a.set("scrollTop",f[1])},get:function(e){var t=e._node;return[t.get("scrollLeft"),t.get("scrollTop")]}}},"3.7.2",{requires:["anim-base"]});+YUI.add("anim-scroll",function(e,t){var n=Number;e.Anim.behaviors.scroll={set:function(e,t,r,i,s,o,u){var a=e._node,f=[u(s,n(r[0]),n(i[0])-n(r[0]),o),u(s,n(r[1]),n(i[1])-n(r[1]),o)];f[0]&&a.set("scrollLeft",f[0]),f[1]&&a.set("scrollTop",f[1])},get:function(e){var t=e._node;return[t.get("scrollLeft"),t.get("scrollTop")]}}},"3.7.3",{requires:["anim-base"]});
bundle/anim-scroll/anim-scroll.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -41,4 +41,4 @@ -}, '3.7.2', {"requires": ["anim-base"]});+}, '3.7.3', {"requires": ["anim-base"]});
bundle/anim-shape-transform/anim-shape-transform-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-shape-transform/anim-shape-transform.js", code: [] };-_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].code=["YUI.add('anim-shape-transform', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," */"," var NUM = Number,"," TO,"," TOSTRING;",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '3.7.2', {\"requires\": [\"anim-base\", \"anim-easing\", \"matrix\"]});"];+_yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].code=["YUI.add('anim-shape-transform', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," */"," var NUM = Number,"," TO,"," TOSTRING;",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '3.7.3', {\"requires\": [\"anim-base\", \"anim-easing\", \"matrix\"]});"]; _yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].lines = {"1":0,"9":0,"13":0,"15":0,"25":0,"26":0,"27":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"37":0,"38":0,"40":0,"43":0,"45":0,"47":0,"49":0,"53":0,"65":0,"67":0,"69":0,"70":0,"71":0,"73":0,"74":0,"76":0,"77":0,"79":0,"81":0,"82":0,"86":0,"87":0,"88":0,"90":0,"91":0,"92":0,"95":0,"96":0,"99":0,"100":0}; _yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].functions = {"set:14":0,"get:52":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-shape-transform/anim-shape-transform.js"].coveredLines = 44;@@ -189,4 +189,4 @@ -}, '3.7.2', {"requires": ["anim-base", "anim-easing", "matrix"]});+}, '3.7.3', {"requires": ["anim-base", "anim-easing", "matrix"]});
bundle/anim-shape/anim-shape-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-shape/anim-shape.js", code: [] };-_yuitest_coverage["build/anim-shape/anim-shape.js"].code=["YUI.add('anim-shape', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," * @deprecated Use anim-shape instead."," */","/**"," * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>"," * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving"," * <code>Graphic</code> <code>Shape</code> attributes. "," * "," * @module anim"," * @submodule anim-shape"," */"," var NUM = Number,"," TO,"," TOSTRING,"," COLOR = \"color\","," STOPS = \"stops\","," TYPE = \"type\","," GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)"," {"," var i = 0,"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," toStop,"," fromStop,"," prop,"," len = to.length,"," color,"," opacity,"," offset,"," rotation,"," r,"," fx,"," fy,"," cx,"," cy,"," stops = [],"," stop;"," for(; i < len; i = i + 1)"," {"," toStop = to[i];"," fromStop = from[i];"," stop = {};"," for(prop in toStop)"," {"," if(toStop.hasOwnProperty(prop))"," {"," if(prop == COLOR)"," {"," stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));"," }"," else"," {"," stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);"," }"," }"," }"," stops.push(stop);"," }"," return stops;"," },"," FILLANDSTROKEBEHAVIOR = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var i,"," updated = {},"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," getUpdatedStops = GETUPDATEDSTOPS;"," for(i in to)"," {"," if(to.hasOwnProperty(i) && i != TYPE)"," {"," switch(i)"," {"," case COLOR :"," updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);"," break;"," case STOPS :"," updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);"," break;"," default :"," updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);"," break;"," }"," }"," }"," anim._node.set(att, updated);"," }"," };"," Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;"," Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '3.7.2', {\"requires\": [\"anim-base\", \"anim-easing\", \"anim-color\", \"matrix\"]});"];+_yuitest_coverage["build/anim-shape/anim-shape.js"].code=["YUI.add('anim-shape', function (Y, NAME) {","","/**"," * Adds support for the <code>transform</code> attribute of <code>Graphic</code>"," * <code>Shape</code> instances."," * @module anim"," * @submodule anim-shape-transform"," * @deprecated Use anim-shape instead."," */","/**"," * Adds support for the <code>transform</code>, <code>fill</code>, and <code> attributes of <code>Graphic</code>"," * <code>Shape</code> instances. The <code>anim-shape</code> submodule can be used for all animations involving"," * <code>Graphic</code> <code>Shape</code> attributes. "," * "," * @module anim"," * @submodule anim-shape"," */"," var NUM = Number,"," TO,"," TOSTRING,"," COLOR = \"color\","," STOPS = \"stops\","," TYPE = \"type\","," GETUPDATEDSTOPS = function(anim, from, to, elapsed, duration, fn)"," {"," var i = 0,"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," toStop,"," fromStop,"," prop,"," len = to.length,"," color,"," opacity,"," offset,"," rotation,"," r,"," fx,"," fy,"," cx,"," cy,"," stops = [],"," stop;"," for(; i < len; i = i + 1)"," {"," toStop = to[i];"," fromStop = from[i];"," stop = {};"," for(prop in toStop)"," {"," if(toStop.hasOwnProperty(prop))"," {"," if(prop == COLOR)"," {"," stop[prop] = Y.Color.toHex(getUpdatedColorValue(Y.Color.toHex(fromStop[prop]), Y.Color.toHex(toStop[prop]), elapsed, duration, fn));"," }"," else"," {"," stop[prop] = fn(elapsed, NUM(fromStop[prop]), NUM(toStop[prop]) - NUM(fromStop[prop]), duration);"," }"," }"," }"," stops.push(stop);"," }"," return stops;"," },"," FILLANDSTROKEBEHAVIOR = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var i,"," updated = {},"," getUpdatedColorValue = Y.Anim.getUpdatedColorValue,"," getUpdatedStops = GETUPDATEDSTOPS;"," for(i in to)"," {"," if(to.hasOwnProperty(i) && i != TYPE)"," {"," switch(i)"," {"," case COLOR :"," updated[i] = getUpdatedColorValue(from[i], to[i], elapsed, duration, fn);"," break;"," case STOPS :"," updated[i] = getUpdatedStops(anim, from[i], to[i], elapsed, duration, fn);"," break;"," default :"," updated[i] = fn(elapsed, NUM(from[i]), NUM(to[i]) - NUM(from[i]), duration);"," break;"," }"," }"," }"," anim._node.set(att, updated);"," }"," };"," Y.Anim.behaviors.fill = FILLANDSTROKEBEHAVIOR;"," Y.Anim.behaviors.stroke = FILLANDSTROKEBEHAVIOR; ",""," Y.Anim.behaviors.transform = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," var node = anim._node,"," transform = \"\","," transformTo,"," transformFrom,"," toArgs,"," fromArgs,"," i = 0,"," j,"," argLen,"," len;"," to = TO;"," len = TO.length;"," for(; i < len; ++i)"," {"," toArgs = to[i].concat();"," fromArgs = from[i].concat();"," transformTo = toArgs.shift();"," transformFrom = fromArgs.shift();"," argLen = toArgs.length;"," transform += transformTo + \"(\";"," for(j = 0; j < argLen; ++j)"," {"," transform += fn(elapsed, NUM(fromArgs[j]), NUM(toArgs[j]) - NUM(fromArgs[j]), duration);"," if(j < argLen - 1)"," {"," transform += \", \";"," }"," }"," transform += \");\";"," }"," if(transform)"," {"," node.set('transform', transform);"," }"," node._transform = TOSTRING;"," },"," "," get: function(anim) {"," var node = anim._node,"," fromMatrix = node.matrix,"," toAttr = anim.get(\"to\") || {},"," toString = anim.get(\"to\").transform,"," fromString = node.get(\"transform\"),"," toArray = Y.MatrixUtil.getTransformArray(toString),"," fromArray = fromString ? Y.MatrixUtil.getTransformArray(fromString) : null,"," toMatrix,"," i,"," len,"," transformFunction,"," from;"," if(toArray)"," {"," if(!fromArray || fromArray.length < 1)"," {"," fromArray = [];"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i][0];"," fromArray[i] = Y.MatrixUtil.getTransformFunctionArray(transformFunction);"," }"," TO = toArray;"," from = fromArray;"," }"," else if(Y.MatrixUtil.compareTransformSequence(toArray, fromArray))"," {"," TO = toArray;"," from = fromArray;"," }"," else"," {"," toMatrix = new Y.Matrix();"," len = toArray.length;"," for(i = 0; i < len; ++i)"," {"," transformFunction = toArray[i].shift();"," transformFunction = transformFunction == \"matrix\" ? \"multiply\" : transformFunction;"," toMatrix[transformFunction].apply(toMatrix, toArray[i]); "," }",""," TO = toMatrix.decompose();"," from = fromMatrix.decompose();"," }"," }"," TOSTRING = toString;"," return from;"," }"," }; ","","","","}, '3.7.3', {\"requires\": [\"anim-base\", \"anim-easing\", \"anim-color\", \"matrix\"]});"]; _yuitest_coverage["build/anim-shape/anim-shape.js"].lines = {"1":0,"18":0,"26":0,"43":0,"45":0,"46":0,"47":0,"48":0,"50":0,"52":0,"54":0,"58":0,"62":0,"64":0,"68":0,"72":0,"74":0,"76":0,"79":0,"80":0,"82":0,"83":0,"85":0,"86":0,"90":0,"93":0,"94":0,"96":0,"98":0,"108":0,"109":0,"110":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"120":0,"121":0,"123":0,"126":0,"128":0,"130":0,"132":0,"136":0,"148":0,"150":0,"152":0,"153":0,"154":0,"156":0,"157":0,"159":0,"160":0,"162":0,"164":0,"165":0,"169":0,"170":0,"171":0,"173":0,"174":0,"175":0,"178":0,"179":0,"182":0,"183":0}; _yuitest_coverage["build/anim-shape/anim-shape.js"].functions = {"GETUPDATEDSTOPS:24":0,"set:67":0,"set:97":0,"get:135":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-shape/anim-shape.js"].coveredLines = 69;@@ -299,4 +299,4 @@ -}, '3.7.2', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});+}, '3.7.3', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});
bundle/anim-shape/anim-shape-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -192,4 +192,4 @@ -}, '3.7.2', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});+}, '3.7.3', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});
bundle/anim-shape/anim-shape-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-shape",function(e,t){var n=Number,r,i,s="color",o="stops",u="type",a=function(t,r,i,o,u,a){var f=0,l=e.Anim.getUpdatedColorValue,c,h,p,d=i.length,v,m,g,y,b,w,E,S,x,T=[],N;for(;f<d;f+=1){c=i[f],h=r[f],N={};for(p in c)c.hasOwnProperty(p)&&(p==s?N[p]=e.Color.toHex(l(e.Color.toHex(h[p]),e.Color.toHex(c[p]),o,u,a)):N[p]=a(o,n(h[p]),n(c[p])-n(h[p]),u));T.push(N)}return T},f={set:function(t,r,i,f,l,c,h){var p,d={},v=e.Anim.getUpdatedColorValue,m=a;for(p in f)if(f.hasOwnProperty(p)&&p!=u)switch(p){case s:d[p]=v(i[p],f[p],l,c,h);break;case o:d[p]=m(t,i[p],f[p],l,c,h);break;default:d[p]=h(l,n(i[p]),n(f[p])-n(i[p]),c)}t._node.set(r,d)}};e.Anim.behaviors.fill=f,e.Anim.behaviors.stroke=f,e.Anim.behaviors.transform={set:function(e,t,s,o,u,a,f){var l=e._node,c="",h,p,d,v,m=0,g,y,b;o=r,b=r.length;for(;m<b;++m){d=o[m].concat(),v=s[m].concat(),h=d.shift(),p=v.shift(),y=d.length,c+=h+"(";for(g=0;g<y;++g)c+=f(u,n(v[g]),n(d[g])-n(v[g]),a),g<y-1&&(c+=", ");c+=");"}c&&l.set("transform",c),l._transform=i},get:function(t){var n=t._node,s=n.matrix,o=t.get("to")||{},u=t.get("to").transform,a=n.get("transform"),f=e.MatrixUtil.getTransformArray(u),l=a?e.MatrixUtil.getTransformArray(a):null,c,h,p,d,v;if(f)if(!l||l.length<1){l=[],p=f.length;for(h=0;h<p;++h)d=f[h][0],l[h]=e.MatrixUtil.getTransformFunctionArray(d);r=f,v=l}else if(e.MatrixUtil.compareTransformSequence(f,l))r=f,v=l;else{c=new e.Matrix,p=f.length;for(h=0;h<p;++h)d=f[h].shift(),d=d=="matrix"?"multiply":d,c[d].apply(c,f[h]);r=c.decompose(),v=s.decompose()}return i=u,v}}},"3.7.2",{requires:["anim-base","anim-easing","anim-color","matrix"]});+YUI.add("anim-shape",function(e,t){var n=Number,r,i,s="color",o="stops",u="type",a=function(t,r,i,o,u,a){var f=0,l=e.Anim.getUpdatedColorValue,c,h,p,d=i.length,v,m,g,y,b,w,E,S,x,T=[],N;for(;f<d;f+=1){c=i[f],h=r[f],N={};for(p in c)c.hasOwnProperty(p)&&(p==s?N[p]=e.Color.toHex(l(e.Color.toHex(h[p]),e.Color.toHex(c[p]),o,u,a)):N[p]=a(o,n(h[p]),n(c[p])-n(h[p]),u));T.push(N)}return T},f={set:function(t,r,i,f,l,c,h){var p,d={},v=e.Anim.getUpdatedColorValue,m=a;for(p in f)if(f.hasOwnProperty(p)&&p!=u)switch(p){case s:d[p]=v(i[p],f[p],l,c,h);break;case o:d[p]=m(t,i[p],f[p],l,c,h);break;default:d[p]=h(l,n(i[p]),n(f[p])-n(i[p]),c)}t._node.set(r,d)}};e.Anim.behaviors.fill=f,e.Anim.behaviors.stroke=f,e.Anim.behaviors.transform={set:function(e,t,s,o,u,a,f){var l=e._node,c="",h,p,d,v,m=0,g,y,b;o=r,b=r.length;for(;m<b;++m){d=o[m].concat(),v=s[m].concat(),h=d.shift(),p=v.shift(),y=d.length,c+=h+"(";for(g=0;g<y;++g)c+=f(u,n(v[g]),n(d[g])-n(v[g]),a),g<y-1&&(c+=", ");c+=");"}c&&l.set("transform",c),l._transform=i},get:function(t){var n=t._node,s=n.matrix,o=t.get("to")||{},u=t.get("to").transform,a=n.get("transform"),f=e.MatrixUtil.getTransformArray(u),l=a?e.MatrixUtil.getTransformArray(a):null,c,h,p,d,v;if(f)if(!l||l.length<1){l=[],p=f.length;for(h=0;h<p;++h)d=f[h][0],l[h]=e.MatrixUtil.getTransformFunctionArray(d);r=f,v=l}else if(e.MatrixUtil.compareTransformSequence(f,l))r=f,v=l;else{c=new e.Matrix,p=f.length;for(h=0;h<p;++h)d=f[h].shift(),d=d=="matrix"?"multiply":d,c[d].apply(c,f[h]);r=c.decompose(),v=s.decompose()}return i=u,v}}},"3.7.3",{requires:["anim-base","anim-easing","anim-color","matrix"]});
bundle/anim-shape/anim-shape.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -192,4 +192,4 @@ -}, '3.7.2', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});+}, '3.7.3', {"requires": ["anim-base", "anim-easing", "anim-color", "matrix"]});
bundle/anim-xy/anim-xy-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/anim-xy/anim-xy.js", code: [] };-_yuitest_coverage["build/anim-xy/anim-xy.js"].code=["YUI.add('anim-xy', function (Y, NAME) {","","/**"," * Adds support for the <code>xy</code> property in <code>from</code> and "," * <code>to</code> attributes."," * @module anim"," * @submodule anim-xy"," */","","var NUM = Number;","","Y.Anim.behaviors.xy = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setXY(["," fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),"," fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)"," ]);"," },"," get: function(anim) {"," return anim._node.getXY();"," }","};","","","","}, '3.7.2', {\"requires\": [\"anim-base\", \"node-screen\"]});"];+_yuitest_coverage["build/anim-xy/anim-xy.js"].code=["YUI.add('anim-xy', function (Y, NAME) {","","/**"," * Adds support for the <code>xy</code> property in <code>from</code> and "," * <code>to</code> attributes."," * @module anim"," * @submodule anim-xy"," */","","var NUM = Number;","","Y.Anim.behaviors.xy = {"," set: function(anim, att, from, to, elapsed, duration, fn) {"," anim._node.setXY(["," fn(elapsed, NUM(from[0]), NUM(to[0]) - NUM(from[0]), duration),"," fn(elapsed, NUM(from[1]), NUM(to[1]) - NUM(from[1]), duration)"," ]);"," },"," get: function(anim) {"," return anim._node.getXY();"," }","};","","","","}, '3.7.3', {\"requires\": [\"anim-base\", \"node-screen\"]});"]; _yuitest_coverage["build/anim-xy/anim-xy.js"].lines = {"1":0,"10":0,"12":0,"14":0,"20":0}; _yuitest_coverage["build/anim-xy/anim-xy.js"].functions = {"set:13":0,"get:19":0,"(anonymous 1):1":0}; _yuitest_coverage["build/anim-xy/anim-xy.js"].coveredLines = 5;@@ -70,4 +70,4 @@ -}, '3.7.2', {"requires": ["anim-base", "node-screen"]});+}, '3.7.3', {"requires": ["anim-base", "node-screen"]});
bundle/anim-xy/anim-xy-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -29,4 +29,4 @@ -}, '3.7.2', {"requires": ["anim-base", "node-screen"]});+}, '3.7.3', {"requires": ["anim-base", "node-screen"]});
bundle/anim-xy/anim-xy-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("anim-xy",function(e,t){var n=Number;e.Anim.behaviors.xy={set:function(e,t,r,i,s,o,u){e._node.setXY([u(s,n(r[0]),n(i[0])-n(r[0]),o),u(s,n(r[1]),n(i[1])-n(r[1]),o)])},get:function(e){return e._node.getXY()}}},"3.7.2",{requires:["anim-base","node-screen"]});+YUI.add("anim-xy",function(e,t){var n=Number;e.Anim.behaviors.xy={set:function(e,t,r,i,s,o,u){e._node.setXY([u(s,n(r[0]),n(i[0])-n(r[0]),o),u(s,n(r[1]),n(i[1])-n(r[1]),o)])},get:function(e){return e._node.getXY()}}},"3.7.3",{requires:["anim-base","node-screen"]});
bundle/anim-xy/anim-xy.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -29,4 +29,4 @@ -}, '3.7.2', {"requires": ["anim-base", "node-screen"]});+}, '3.7.3', {"requires": ["anim-base", "node-screen"]});
bundle/app-base/app-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/app-base/app-base.js", code: [] };-_yuitest_coverage["build/app-base/app-base.js"].code=["YUI.add('app-base', function (Y, NAME) {","","/**","The App Framework provides simple MVC-like building blocks (models, model lists,","views, and URL-based routing) for writing single-page JavaScript applications.","","@main app","@module app","@since 3.4.0","**/","","/**","Provides a top-level application component which manages navigation and views.","","@module app","@submodule app-base","@since 3.5.0","**/","","// TODO: Better handling of lifecycle for registered views:","//","// * [!] Just redo basically everything with view management so there are no","// pre-`activeViewChange` side effects and handle the rest of these things:","//","// * Seems like any view created via `createView` should listen for the view's","// `destroy` event and use that to remove it from the `_viewsInfoMap`. I","// should look at what ModelList does for Models as a reference.","//","// * Should we have a companion `destroyView()` method? Maybe this wouldn't be","// needed if we have a `getView(name, create)` method, and already doing the","// above? We could do `app.getView('foo').destroy()` and it would be removed","// from the `_viewsInfoMap` as well.","//","// * Should we wait to call a view's `render()` method inside of the","// `_attachView()` method?","//","// * Should named views support a collection of instances instead of just one?","//","","var Lang = Y.Lang,"," YObject = Y.Object,",""," PjaxBase = Y.PjaxBase,"," Router = Y.Router,"," View = Y.View,",""," getClassName = Y.ClassNameManager.getClassName,",""," win = Y.config.win,",""," AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","@class App.Base","@param {Object} [config] The following are configuration properties that can be"," specified _in addition_ to default attribute values and the non-attribute"," properties provided by `Y.Base`:"," @param {Object} [config.views] Hash of view-name to metadata used to"," declaratively describe an application's views and their relationship with"," the app and other views. The views specified here will override any defaults"," provided by the `views` object on the `prototype`.","@constructor","@extends Base","@uses View","@uses Router","@uses PjaxBase","@since 3.5.0","**/","AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {"," // -- Public Properties ----------------------------------------------------",""," /**"," Hash of view-name to metadata used to declaratively describe an"," application's views and their relationship with the app and its other views.",""," The view metadata is composed of Objects keyed to a view-name that can have"," any or all of the following properties:",""," * `type`: Function or a string representing the view constructor to use to"," create view instances. If a string is used, the constructor function is"," assumed to be on the `Y` object; e.g. `\"SomeView\"` -> `Y.SomeView`.",""," * `preserve`: Boolean for whether the view instance should be retained. By"," default, the view instance will be destroyed when it is no longer the"," `activeView`. If `true` the view instance will simply be `removed()`"," from the DOM when it is no longer active. This is useful when the view"," is frequently used and may be expensive to re-create.",""," * `parent`: String to another named view in this hash that represents the"," parent view within the application's view hierarchy; e.g. a `\"photo\"`"," view could have `\"album\"` has its `parent` view. This parent/child"," relationship is a useful cue for things like transitions.",""," * `instance`: Used internally to manage the current instance of this named"," view. This can be used if your view instance is created up-front, or if"," you would rather manage the View lifecycle, but you probably should just"," let this be handled for you.",""," If `views` are specified at instantiation time, the metadata in the `views`"," Object here will be used as defaults when creating the instance's `views`.",""," Every `Y.App` instance gets its own copy of a `views` object so this Object"," on the prototype will not be polluted.",""," @example"," // Imagine that `Y.UsersView` and `Y.UserView` have been defined."," var app = new Y.App({"," views: {"," users: {"," type : Y.UsersView,"," preserve: true"," },",""," user: {"," type : Y.UserView,"," parent: 'users'"," }"," }"," });",""," @property views"," @type Object"," @default {}"," @since 3.5.0"," **/"," views: {},",""," // -- Protected Properties -------------------------------------------------",""," /**"," Map of view instance id (via `Y.stamp()`) to view-info object in `views`.",""," This mapping is used to tie a specific view instance back to its metadata by"," adding a reference to the the related view info on the `views` object.",""," @property _viewInfoMap"," @type Object"," @default {}"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," var views = {};",""," // Merges-in specified view metadata into local `views` object."," function mergeViewConfig(view, name) {"," views[name] = Y.merge(views[name], view);"," }",""," // First, each view in the `views` prototype object gets its metadata"," // merged-in, providing the defaults."," YObject.each(this.views, mergeViewConfig);",""," // Then, each view in the specified `config.views` object gets its"," // metadata merged-in."," YObject.each(config.views, mergeViewConfig);",""," // The resulting hodgepodge of metadata is then stored as the instance's"," // `views` object, and no one's objects were harmed in the making."," this.views = views;"," this._viewInfoMap = {};",""," // Using `bind()` to aid extensibility."," this.after('activeViewChange', Y.bind('_afterActiveViewChange', this));",""," // PjaxBase will bind click events when `html5` is `true`, so this just"," // forces the binding when `serverRouting` and `html5` are both falsy."," if (!this.get('serverRouting')) {"," this._pjaxBindUI();"," }"," },",""," // TODO: `destructor` to destroy the `activeView`?",""," // -- Public Methods -------------------------------------------------------",""," /**"," Creates and returns a new view instance using the provided `name` to look up"," the view info metadata defined in the `views` object. The passed-in `config`"," object is passed to the view constructor function.",""," This function also maps a view instance back to its view info metadata.",""," @method createView"," @param {String} name The name of a view defined on the `views` object."," @param {Object} [config] The configuration object passed to the view"," constructor function when creating the new view instance."," @return {View} The new view instance."," @since 3.5.0"," **/"," createView: function (name, config) {"," var viewInfo = this.getViewInfo(name),"," type = (viewInfo && viewInfo.type) || View,"," ViewConstructor, view;",""," // Looks for a namespaced constructor function on `Y`."," ViewConstructor = Lang.isString(type) ?"," YObject.getValue(Y, type.split('.')) : type;",""," // Create the view instance and map it with its metadata."," view = new ViewConstructor(config);"," this._viewInfoMap[Y.stamp(view, true)] = viewInfo;",""," return view;"," },",""," /**"," Returns the metadata associated with a view instance or view name defined on"," the `views` object.",""," @method getViewInfo"," @param {View|String} view View instance, or name of a view defined on the"," `views` object."," @return {Object} The metadata for the view, or `undefined` if the view is"," not registered."," @since 3.5.0"," **/"," getViewInfo: function (view) {"," if (Lang.isString(view)) {"," return this.views[view];"," }",""," return view && this._viewInfoMap[Y.stamp(view, true)];"," },",""," /**"," Navigates to the specified URL if there is a route handler that matches. In"," browsers capable of using HTML5 history or when `serverRouting` is falsy,"," the navigation will be enhanced by firing the `navigate` event and having"," the app handle the \"request\". When `serverRouting` is `true`, non-HTML5"," browsers will navigate to the new URL via a full page reload.",""," When there is a route handler for the specified URL and it is being"," navigated to, this method will return `true`, otherwise it will return"," `false`.",""," **Note:** The specified URL _must_ be of the same origin as the current URL,"," otherwise an error will be logged and navigation will not occur. This is"," intended as both a security constraint and a purposely imposed limitation as"," it does not make sense to tell the app to navigate to a URL on a"," different scheme, host, or port.",""," @method navigate"," @param {String} url The URL to navigate to. This must be of the same origin"," as the current URL."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force] Whether the enhanced navigation"," should occur even in browsers without HTML5 history. Will default to"," `true` when `serverRouting` is falsy."," @see PjaxBase.navigate()"," **/"," // Does not override `navigate()` but does use extra `options`.",""," /**"," Renders this application by appending the `viewContainer` node to the"," `container` node if it isn't already a child of the container, and the"," `activeView` will be appended the view container, if it isn't already.",""," You should call this method at least once, usually after the initialization"," of your app instance so the proper DOM structure is setup and optionally"," append the container to the DOM if it's not there already.",""," You may override this method to customize the app's rendering, but you"," should expect that the `viewContainer`'s contents will be modified by the"," app for the purpose of rendering the `activeView` when it changes.",""," @method render"," @chainable"," @see View.render()"," **/"," render: function () {"," var CLASS_NAMES = Y.App.CLASS_NAMES,"," container = this.get('container'),"," viewContainer = this.get('viewContainer'),"," activeView = this.get('activeView'),"," activeViewContainer = activeView && activeView.get('container'),"," areSame = container.compareTo(viewContainer);",""," container.addClass(CLASS_NAMES.app);"," viewContainer.addClass(CLASS_NAMES.views);",""," // Prevents needless shuffling around of nodes and maintains DOM order."," if (activeView && !viewContainer.contains(activeViewContainer)) {"," viewContainer.appendChild(activeViewContainer);"," }",""," // Prevents needless shuffling around of nodes and maintains DOM order."," if (!container.contains(viewContainer) && !areSame) {"," container.appendChild(viewContainer);"," }",""," return this;"," },",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," users: new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/'); // => Creates a new `Y.UsersView` and shows it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," showView: function (view, config, options, callback) {"," var viewInfo, created;",""," options || (options = {});",""," // Support the callback function being either the third or fourth arg."," if (callback) {"," options = Y.merge(options, {callback: callback});"," } else if (Lang.isFunction(options)) {"," options = {callback: options};"," }",""," if (Lang.isString(view)) {"," viewInfo = this.getViewInfo(view);",""," // Use the preserved view instance, or create a new view."," // TODO: Maybe we can remove the strict check for `preserve` and"," // assume we'll use a View instance if it is there, and just check"," // `preserve` when detaching?"," if (viewInfo && viewInfo.preserve && viewInfo.instance) {"," view = viewInfo.instance;",""," // Make sure there's a mapping back to the view metadata."," this._viewInfoMap[Y.stamp(view, true)] = viewInfo;"," } else {"," // TODO: Add the app as a bubble target during construction, but"," // make sure to check that it isn't already in `bubbleTargets`!"," // This will allow the app to be notified for about _all_ of the"," // view's events. **Note:** This should _only_ happen if the"," // view is created _after_ `activeViewChange`.",""," view = this.createView(view, config);"," created = true;"," }"," }",""," // Update the specified or preserved `view` when signaled to do so."," // There's no need to updated a view if it was _just_ created."," if (options.update && !created) {"," view.setAttrs(config);"," }",""," // TODO: Hold off on rendering the view until after it has been"," // \"attached\", and move the call to render into `_attachView()`.",""," // When a value is specified for `options.render`, prefer it because it"," // represents the developer's intent. When no value is specified, the"," // `view` will only be rendered if it was just created."," if ('render' in options) {"," if (options.render) {"," view.render();"," }"," } else if (created) {"," view.render();"," }",""," return this._set('activeView', view, {options: options});"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Helper method to attach the view instance to the application by making the"," app a bubble target of the view, append the view to the `viewContainer`, and"," assign it to the `instance` property of the associated view info metadata.",""," @method _attachView"," @param {View} view View to attach."," @param {Boolean} prepend=false Whether the view should be prepended instead"," of appended to the `viewContainer`."," @protected"," @since 3.5.0"," **/"," _attachView: function (view, prepend) {"," if (!view) {"," return;"," }",""," var viewInfo = this.getViewInfo(view),"," viewContainer = this.get('viewContainer');",""," // Bubble the view's events to this app."," view.addTarget(this);",""," // Save the view instance in the `views` registry."," if (viewInfo) {"," viewInfo.instance = view;"," }",""," // TODO: Attach events here for persevered Views?"," // See related TODO in `_detachView`.",""," // TODO: Actually render the view here so that it gets \"attached\" before"," // it gets rendered?",""," // Insert view into the DOM."," viewContainer[prepend ? 'prepend' : 'append'](view.get('container'));"," },",""," /**"," Overrides View's container destruction to deal with the `viewContainer` and"," checks to make sure not to remove and purge the `<body>`.",""," @method _destroyContainer"," @protected"," @see View._destroyContainer()"," **/"," _destroyContainer: function () {"," var CLASS_NAMES = Y.App.CLASS_NAMES,"," container = this.get('container'),"," viewContainer = this.get('viewContainer'),"," areSame = container.compareTo(viewContainer);",""," // We do not want to remove or destroy the `<body>`."," if (Y.one('body').compareTo(container)) {"," // Just clean-up our events listeners."," this.detachEvents();",""," // Clean-up `yui3-app` CSS class on the `container`."," container.removeClass(CLASS_NAMES.app);",""," if (areSame) {"," // Clean-up `yui3-app-views` CSS class on the `container`."," container.removeClass(CLASS_NAMES.views);"," } else {"," // Destroy and purge the `viewContainer`."," viewContainer.remove(true);"," }",""," return;"," }",""," // Remove and purge events from both containers.",""," viewContainer.remove(true);",""," if (!areSame) {"," container.remove(true);"," }"," },",""," /**"," Helper method to detach the view instance from the application by removing"," the application as a bubble target of the view, and either just removing the"," view if it is intended to be preserved, or destroying the instance"," completely.",""," @method _detachView"," @param {View} view View to detach."," @protected"," @since 3.5.0"," **/"," _detachView: function (view) {"," if (!view) {"," return;"," }",""," var viewInfo = this.getViewInfo(view) || {};",""," if (viewInfo.preserve) {"," view.remove();"," // TODO: Detach events here for preserved Views? It is possible that"," // some event subscriptions are made on elements other than the"," // View's `container`."," } else {"," view.destroy({remove: true});",""," // TODO: The following should probably happen automagically from"," // `destroy()` being called! Possibly `removeTarget()` as well.",""," // Remove from view to view-info map."," delete this._viewInfoMap[Y.stamp(view, true)];",""," // Remove from view-info instance property."," if (view === viewInfo.instance) {"," delete viewInfo.instance;"," }"," }",""," view.removeTarget(this);"," },",""," /**"," Getter for the `viewContainer` attribute.",""," @method _getViewContainer"," @param {Node|null} value Current attribute value."," @return {Node} View container node."," @protected"," @since 3.5.0"," **/"," _getViewContainer: function (value) {"," // This wackiness is necessary to enable fully lazy creation of the"," // container node both when no container is specified and when one is"," // specified via a valueFn.",""," if (!value && !this._viewContainer) {"," // Create a default container and set that as the new attribute"," // value. The `this._viewContainer` property prevents infinite"," // recursion."," value = this._viewContainer = this.create();"," this._set('viewContainer', value);"," }",""," return value;"," },",""," /**"," Provides the default value for the `html5` attribute.",""," The value returned is dependent on the value of the `serverRouting`"," attribute. When `serverRouting` is explicit set to `false` (not just falsy),"," the default value for `html5` will be set to `false` for *all* browsers.",""," When `serverRouting` is `true` or `undefined` the returned value will be"," dependent on the browser's capability of using HTML5 history.",""," @method _initHtml5"," @return {Boolean} Whether or not HTML5 history should be used."," @protected"," @since 3.5.0"," **/"," _initHtml5: function () {"," // When `serverRouting` is explicitly set to `false` (not just falsy),"," // forcing hash-based URLs in all browsers."," if (this.get('serverRouting') === false) {"," return false;"," }",""," // Defaults to whether or not the browser supports HTML5 history."," return Router.html5;"," },",""," /**"," Determines if the specified `view` is configured as a child of the specified"," `parent` view. This requires both views to be either named-views, or view"," instances created using configuration data that exists in the `views`"," object, e.g. created by the `createView()` or `showView()` method.",""," @method _isChildView"," @param {View|String} view The name of a view defined in the `views` object,"," or a view instance."," @param {View|String} parent The name of a view defined in the `views`"," object, or a view instance."," @return {Boolean} Whether the view is configured as a child of the parent."," @protected"," @since 3.5.0"," **/"," _isChildView: function (view, parent) {"," var viewInfo = this.getViewInfo(view),"," parentInfo = this.getViewInfo(parent);",""," if (viewInfo && parentInfo) {"," return this.getViewInfo(viewInfo.parent) === parentInfo;"," }",""," return false;"," },",""," /**"," Determines if the specified `view` is configured as the parent of the"," specified `child` view. This requires both views to be either named-views,"," or view instances created using configuration data that exists in the"," `views` object, e.g. created by the `createView()` or `showView()` method.",""," @method _isParentView"," @param {View|String} view The name of a view defined in the `views` object,"," or a view instance."," @param {View|String} parent The name of a view defined in the `views`"," object, or a view instance."," @return {Boolean} Whether the view is configured as the parent of the child."," @protected"," @since 3.5.0"," **/"," _isParentView: function (view, child) {"," var viewInfo = this.getViewInfo(view),"," childInfo = this.getViewInfo(child);",""," if (viewInfo && childInfo) {"," return this.getViewInfo(childInfo.parent) === viewInfo;"," }",""," return false;"," },",""," /**"," Underlying implementation for `navigate()`.",""," @method _navigate"," @param {String} url The fully-resolved URL that the app should dispatch to"," its route handlers to fulfill the enhanced navigation \"request\", or use to"," update `window.location` in non-HTML5 history capable browsers when"," `serverRouting` is `true`."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force] Whether the enhanced navigation"," should occur even in browsers without HTML5 history. Will default to"," `true` when `serverRouting` is falsy."," @protected"," @see PjaxBase._navigate()"," **/"," _navigate: function (url, options) {"," if (!this.get('serverRouting')) {"," // Force navigation to be enhanced and handled by the app when"," // `serverRouting` is falsy because the server might not be able to"," // properly handle the request."," options = Y.merge({force: true}, options);"," }",""," return PjaxBase.prototype._navigate.call(this, url, options);"," },",""," /**"," Will either save a history entry using `pushState()` or the location hash,"," or gracefully-degrade to sending a request to the server causing a full-page"," reload.",""," Overrides Router's `_save()` method to preform graceful-degradation when the"," app's `serverRouting` is `true` and `html5` is `false` by updating the full"," URL via standard assignment to `window.location` or by calling"," `window.location.replace()`; both of which will cause a request to the"," server resulting in a full-page reload.",""," Otherwise this will just delegate off to Router's `_save()` method allowing"," the client-side enhanced routing to occur.",""," @method _save"," @param {String} [url] URL for the history entry."," @param {Boolean} [replace=false] If `true`, the current history entry will"," be replaced instead of a new one being added."," @chainable"," @protected"," @see Router._save()"," **/"," _save: function (url, replace) {"," var path;",""," // Forces full-path URLs to always be used by modifying"," // `window.location` in non-HTML5 history capable browsers."," if (this.get('serverRouting') && !this.get('html5')) {"," // Perform same-origin check on the specified URL."," if (!this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," return this;"," }",""," // Either replace the current history entry or create a new one"," // while navigating to the `url`."," if (win) {"," // Results in the URL's full path starting with '/'."," path = this._joinURL(url || '');",""," if (replace) {"," win.location.replace(path);"," } else {"," win.location = path;"," }"," }",""," return this;"," }",""," return Router.prototype._save.apply(this, arguments);"," },",""," /**"," Performs the actual change of this app's `activeView` by attaching the"," `newView` to this app, and detaching the `oldView` from this app using any"," specified `options`.",""," The `newView` is attached to the app by rendering it to the `viewContainer`,"," and making this app a bubble target of its events.",""," The `oldView` is detached from the app by removing it from the"," `viewContainer`, and removing this app as a bubble target for its events."," The `oldView` will either be preserved or properly destroyed.",""," **Note:** The `activeView` attribute is read-only and can be changed by"," calling the `showView()` method.",""," @method _uiSetActiveView"," @param {View} newView The View which is now this app's `activeView`."," @param {View} [oldView] The View which was this app's `activeView`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @protected"," @since 3.5.0"," **/"," _uiSetActiveView: function (newView, oldView, options) {"," options || (options = {});",""," var callback = options.callback,"," isChild = this._isChildView(newView, oldView),"," isParent = !isChild && this._isParentView(newView, oldView),"," prepend = !!options.prepend || isParent;",""," // Prevent detaching (thus removing) the view we want to show. Also hard"," // to animate out and in, the same view."," if (newView === oldView) {"," return callback && callback.call(this, newView);"," }",""," this._attachView(newView, prepend);"," this._detachView(oldView);",""," if (callback) {"," callback.call(this, newView);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles the application's `activeViewChange` event (which is fired when the"," `activeView` attribute changes) by detaching the old view, attaching the new"," view.",""," The `activeView` attribute is read-only, so the public API to change its"," value is through the `showView()` method.",""," @method _afterActiveViewChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterActiveViewChange: function (e) {"," this._uiSetActiveView(e.newVal, e.prevVal, e.options);"," }","}, {"," ATTRS: {"," /**"," The application's active/visible view.",""," This attribute is read-only, to set the `activeView` use the"," `showView()` method.",""," @attribute activeView"," @type View"," @default null"," @readOnly"," @see App.Base.showView()"," @since 3.5.0"," **/"," activeView: {"," value : null,"," readOnly: true"," },",""," /**"," Container node which represents the application's bounding-box, into"," which this app's content will be rendered.",""," The container node serves as the host for all DOM events attached by the"," app. Delegation is used to handle events on children of the container,"," allowing the container's contents to be re-rendered at any time without"," losing event subscriptions.",""," The default container is the `<body>` Node, but you can override this in"," a subclass, or by passing in a custom `container` config value at"," instantiation time.",""," When `container` is overridden by a subclass or passed as a config"," option at instantiation time, it may be provided as a selector string, a"," DOM element, or a `Y.Node` instance. During initialization, this app's"," `create()` method will be called to convert the container into a"," `Y.Node` instance if it isn't one already and stamp it with the CSS"," class: `\"yui3-app\"`.",""," The container is not added to the page automatically. This allows you to"," have full control over how and when your app is actually rendered to"," the page.",""," @attribute container"," @type HTMLElement|Node|String"," @default Y.one('body')"," @initOnly"," **/"," container: {"," valueFn: function () {"," return Y.one('body');"," }"," },",""," /**"," Whether or not this browser is capable of using HTML5 history.",""," This value is dependent on the value of `serverRouting` and will default"," accordingly.",""," Setting this to `false` will force the use of hash-based history even on"," HTML5 browsers, but please don't do this unless you understand the"," consequences.",""," @attribute html5"," @type Boolean"," @initOnly"," @see serverRouting"," **/"," html5: {"," valueFn: '_initHtml5'"," },",""," /**"," CSS selector string used to filter link click events so that only the"," links which match it will have the enhanced-navigation behavior of pjax"," applied.",""," When a link is clicked and that link matches this selector, navigating"," to the link's `href` URL using the enhanced, pjax, behavior will be"," attempted; and the browser's default way to navigate to new pages will"," be the fallback.",""," By default this selector will match _all_ links on the page.",""," @attribute linkSelector"," @type String|Function"," @default \"a\""," **/"," linkSelector: {"," value: 'a'"," },",""," /**"," Whether or not this application's server is capable of properly routing"," all requests and rendering the initial state in the HTML responses.",""," This can have three different values, each having particular"," implications on how the app will handle routing and navigation:",""," * `undefined`: The best form of URLs will be chosen based on the"," capabilities of the browser. Given no information about the server"," environmentm a balanced approach to routing and navigation is"," chosen.",""," The server should be capable of handling full-path requests, since"," full-URLs will be generated by browsers using HTML5 history. If this"," is a client-side-only app the server could handle full-URL requests"," by sending a redirect back to the root with a hash-based URL, e.g:",""," Request: http://example.com/users/1"," Redirect to: http://example.com/#/users/1",""," * `true`: The server is *fully* capable of properly handling requests"," to all full-path URLs the app can produce.",""," This is the best option for progressive-enhancement because it will"," cause **all URLs to always have full-paths**, which means the server"," will be able to accurately handle all URLs this app produces. e.g.",""," http://example.com/users/1",""," To meet this strict full-URL requirement, browsers which are not"," capable of using HTML5 history will make requests to the server"," resulting in full-page reloads.",""," * `false`: The server is *not* capable of properly handling requests"," to all full-path URLs the app can produce, therefore all routing"," will be handled by this App instance.",""," Be aware that this will cause **all URLs to always be hash-based**,"," even in browsers that are capable of using HTML5 history. e.g.",""," http://example.com/#/users/1",""," A single-page or client-side-only app where the server sends a"," \"shell\" page with JavaScript to the client might have this"," restriction. If you're setting this to `false`, read the following:",""," **Note:** When this is set to `false`, the server will *never* receive"," the full URL because browsers do not send the fragment-part to the"," server, that is everything after and including the \"#\".",""," Consider the following example:",""," URL shown in browser: http://example.com/#/users/1"," URL sent to server: http://example.com/",""," You should feel bad about hurting our precious web if you forcefully set"," either `serverRouting` or `html5` to `false`, because you're basically"," punching the web in the face here with your lossy URLs! Please make sure"," you know what you're doing and that you understand the implications.",""," Ideally you should always prefer full-path URLs (not /#/foo/), and want"," full-page reloads when the client's browser is not capable of enhancing"," the experience using the HTML5 history APIs. Setting this to `true` is"," the best option for progressive-enhancement (and graceful-degradation).",""," @attribute serverRouting"," @type Boolean"," @default undefined"," @initOnly"," @since 3.5.0"," **/"," serverRouting: {"," valueFn : function () { return Y.App.serverRouting; },"," writeOnce: 'initOnly'"," },",""," /**"," The node into which this app's `views` will be rendered when they become"," the `activeView`.",""," The view container node serves as the container to hold the app's"," `activeView`. Each time the `activeView` is set via `showView()`, the"," previous view will be removed from this node, and the new active view's"," `container` node will be appended.",""," The default view container is a `<div>` Node, but you can override this"," in a subclass, or by passing in a custom `viewContainer` config value at"," instantiation time. The `viewContainer` may be provided as a selector"," string, DOM element, or a `Y.Node` instance (having the `viewContainer`"," and the `container` be the same node is also supported).",""," The app's `render()` method will stamp the view container with the CSS"," class `\"yui3-app-views\"` and append it to the app's `container` node if"," it isn't already, and any `activeView` will be appended to this node if"," it isn't already.",""," @attribute viewContainer"," @type HTMLElement|Node|String"," @default Y.Node.create(this.containerTemplate)"," @initOnly"," @since 3.5.0"," **/"," viewContainer: {"," getter : '_getViewContainer',"," setter : Y.one,"," writeOnce: true"," }"," },",""," /**"," Properties that shouldn't be turned into ad-hoc attributes when passed to"," App's constructor.",""," @property _NON_ATTRS_CFG"," @type Array"," @static"," @protected"," @since 3.5.0"," **/"," _NON_ATTRS_CFG: ['views']","});","","// -- Namespace ----------------------------------------------------------------","Y.namespace('App').Base = AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","`Y.App` is both a namespace and constructor function. The `Y.App` class is","special in that any `Y.App` class extensions that are included in the YUI","instance will be **auto-mixed** on to the `Y.App` class. Consider this example:",""," YUI().use('app-base', 'app-transitions', function (Y) {"," // This will create two YUI Apps, `basicApp` will not have transitions,"," // but `fancyApp` will have transitions support included and turn it on."," var basicApp = new Y.App.Base(),"," fancyApp = new Y.App({transitions: true});"," });","","@class App","@param {Object} [config] The following are configuration properties that can be"," specified _in addition_ to default attribute values and the non-attribute"," properties provided by `Y.Base`:"," @param {Object} [config.views] Hash of view-name to metadata used to"," declaratively describe an application's views and their relationship with"," the app and other views. The views specified here will override any defaults"," provided by the `views` object on the `prototype`.","@constructor","@extends App.Base","@uses App.Content","@uses App.Transitions","@uses PjaxContent","@since 3.5.0","**/","Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true);","","/**","CSS classes used by `Y.App`.","","@property CLASS_NAMES","@type Object","@default {}","@static","@since 3.6.0","**/","Y.App.CLASS_NAMES = {"," app : getClassName('app'),"," views: getClassName('app', 'views')","};","","/**","Default `serverRouting` attribute value for all apps.","","@property serverRouting","@type Boolean","@default undefined","@static","@since 3.6.0","**/","","","}, '3.7.2', {\"requires\": [\"classnamemanager\", \"pjax-base\", \"router\", \"view\"]});"];+_yuitest_coverage["build/app-base/app-base.js"].code=["YUI.add('app-base', function (Y, NAME) {","","/**","The App Framework provides simple MVC-like building blocks (models, model lists,","views, and URL-based routing) for writing single-page JavaScript applications.","","@main app","@module app","@since 3.4.0","**/","","/**","Provides a top-level application component which manages navigation and views.","","@module app","@submodule app-base","@since 3.5.0","**/","","// TODO: Better handling of lifecycle for registered views:","//","// * [!] Just redo basically everything with view management so there are no","// pre-`activeViewChange` side effects and handle the rest of these things:","//","// * Seems like any view created via `createView` should listen for the view's","// `destroy` event and use that to remove it from the `_viewsInfoMap`. I","// should look at what ModelList does for Models as a reference.","//","// * Should we have a companion `destroyView()` method? Maybe this wouldn't be","// needed if we have a `getView(name, create)` method, and already doing the","// above? We could do `app.getView('foo').destroy()` and it would be removed","// from the `_viewsInfoMap` as well.","//","// * Should we wait to call a view's `render()` method inside of the","// `_attachView()` method?","//","// * Should named views support a collection of instances instead of just one?","//","","var Lang = Y.Lang,"," YObject = Y.Object,",""," PjaxBase = Y.PjaxBase,"," Router = Y.Router,"," View = Y.View,",""," getClassName = Y.ClassNameManager.getClassName,",""," win = Y.config.win,",""," AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","@class App.Base","@param {Object} [config] The following are configuration properties that can be"," specified _in addition_ to default attribute values and the non-attribute"," properties provided by `Y.Base`:"," @param {Object} [config.views] Hash of view-name to metadata used to"," declaratively describe an application's views and their relationship with"," the app and other views. The views specified here will override any defaults"," provided by the `views` object on the `prototype`.","@constructor","@extends Base","@uses View","@uses Router","@uses PjaxBase","@since 3.5.0","**/","AppBase = Y.Base.create('app', Y.Base, [View, Router, PjaxBase], {"," // -- Public Properties ----------------------------------------------------",""," /**"," Hash of view-name to metadata used to declaratively describe an"," application's views and their relationship with the app and its other views.",""," The view metadata is composed of Objects keyed to a view-name that can have"," any or all of the following properties:",""," * `type`: Function or a string representing the view constructor to use to"," create view instances. If a string is used, the constructor function is"," assumed to be on the `Y` object; e.g. `\"SomeView\"` -> `Y.SomeView`.",""," * `preserve`: Boolean for whether the view instance should be retained. By"," default, the view instance will be destroyed when it is no longer the"," `activeView`. If `true` the view instance will simply be `removed()`"," from the DOM when it is no longer active. This is useful when the view"," is frequently used and may be expensive to re-create.",""," * `parent`: String to another named view in this hash that represents the"," parent view within the application's view hierarchy; e.g. a `\"photo\"`"," view could have `\"album\"` has its `parent` view. This parent/child"," relationship is a useful cue for things like transitions.",""," * `instance`: Used internally to manage the current instance of this named"," view. This can be used if your view instance is created up-front, or if"," you would rather manage the View lifecycle, but you probably should just"," let this be handled for you.",""," If `views` are specified at instantiation time, the metadata in the `views`"," Object here will be used as defaults when creating the instance's `views`.",""," Every `Y.App` instance gets its own copy of a `views` object so this Object"," on the prototype will not be polluted.",""," @example"," // Imagine that `Y.UsersView` and `Y.UserView` have been defined."," var app = new Y.App({"," views: {"," users: {"," type : Y.UsersView,"," preserve: true"," },",""," user: {"," type : Y.UserView,"," parent: 'users'"," }"," }"," });",""," @property views"," @type Object"," @default {}"," @since 3.5.0"," **/"," views: {},",""," // -- Protected Properties -------------------------------------------------",""," /**"," Map of view instance id (via `Y.stamp()`) to view-info object in `views`.",""," This mapping is used to tie a specific view instance back to its metadata by"," adding a reference to the the related view info on the `views` object.",""," @property _viewInfoMap"," @type Object"," @default {}"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," var views = {};",""," // Merges-in specified view metadata into local `views` object."," function mergeViewConfig(view, name) {"," views[name] = Y.merge(views[name], view);"," }",""," // First, each view in the `views` prototype object gets its metadata"," // merged-in, providing the defaults."," YObject.each(this.views, mergeViewConfig);",""," // Then, each view in the specified `config.views` object gets its"," // metadata merged-in."," YObject.each(config.views, mergeViewConfig);",""," // The resulting hodgepodge of metadata is then stored as the instance's"," // `views` object, and no one's objects were harmed in the making."," this.views = views;"," this._viewInfoMap = {};",""," // Using `bind()` to aid extensibility."," this.after('activeViewChange', Y.bind('_afterActiveViewChange', this));",""," // PjaxBase will bind click events when `html5` is `true`, so this just"," // forces the binding when `serverRouting` and `html5` are both falsy."," if (!this.get('serverRouting')) {"," this._pjaxBindUI();"," }"," },",""," // TODO: `destructor` to destroy the `activeView`?",""," // -- Public Methods -------------------------------------------------------",""," /**"," Creates and returns a new view instance using the provided `name` to look up"," the view info metadata defined in the `views` object. The passed-in `config`"," object is passed to the view constructor function.",""," This function also maps a view instance back to its view info metadata.",""," @method createView"," @param {String} name The name of a view defined on the `views` object."," @param {Object} [config] The configuration object passed to the view"," constructor function when creating the new view instance."," @return {View} The new view instance."," @since 3.5.0"," **/"," createView: function (name, config) {"," var viewInfo = this.getViewInfo(name),"," type = (viewInfo && viewInfo.type) || View,"," ViewConstructor, view;",""," // Looks for a namespaced constructor function on `Y`."," ViewConstructor = Lang.isString(type) ?"," YObject.getValue(Y, type.split('.')) : type;",""," // Create the view instance and map it with its metadata."," view = new ViewConstructor(config);"," this._viewInfoMap[Y.stamp(view, true)] = viewInfo;",""," return view;"," },",""," /**"," Returns the metadata associated with a view instance or view name defined on"," the `views` object.",""," @method getViewInfo"," @param {View|String} view View instance, or name of a view defined on the"," `views` object."," @return {Object} The metadata for the view, or `undefined` if the view is"," not registered."," @since 3.5.0"," **/"," getViewInfo: function (view) {"," if (Lang.isString(view)) {"," return this.views[view];"," }",""," return view && this._viewInfoMap[Y.stamp(view, true)];"," },",""," /**"," Navigates to the specified URL if there is a route handler that matches. In"," browsers capable of using HTML5 history or when `serverRouting` is falsy,"," the navigation will be enhanced by firing the `navigate` event and having"," the app handle the \"request\". When `serverRouting` is `true`, non-HTML5"," browsers will navigate to the new URL via a full page reload.",""," When there is a route handler for the specified URL and it is being"," navigated to, this method will return `true`, otherwise it will return"," `false`.",""," **Note:** The specified URL _must_ be of the same origin as the current URL,"," otherwise an error will be logged and navigation will not occur. This is"," intended as both a security constraint and a purposely imposed limitation as"," it does not make sense to tell the app to navigate to a URL on a"," different scheme, host, or port.",""," @method navigate"," @param {String} url The URL to navigate to. This must be of the same origin"," as the current URL."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force] Whether the enhanced navigation"," should occur even in browsers without HTML5 history. Will default to"," `true` when `serverRouting` is falsy."," @see PjaxBase.navigate()"," **/"," // Does not override `navigate()` but does use extra `options`.",""," /**"," Renders this application by appending the `viewContainer` node to the"," `container` node if it isn't already a child of the container, and the"," `activeView` will be appended the view container, if it isn't already.",""," You should call this method at least once, usually after the initialization"," of your app instance so the proper DOM structure is setup and optionally"," append the container to the DOM if it's not there already.",""," You may override this method to customize the app's rendering, but you"," should expect that the `viewContainer`'s contents will be modified by the"," app for the purpose of rendering the `activeView` when it changes.",""," @method render"," @chainable"," @see View.render()"," **/"," render: function () {"," var CLASS_NAMES = Y.App.CLASS_NAMES,"," container = this.get('container'),"," viewContainer = this.get('viewContainer'),"," activeView = this.get('activeView'),"," activeViewContainer = activeView && activeView.get('container'),"," areSame = container.compareTo(viewContainer);",""," container.addClass(CLASS_NAMES.app);"," viewContainer.addClass(CLASS_NAMES.views);",""," // Prevents needless shuffling around of nodes and maintains DOM order."," if (activeView && !viewContainer.contains(activeViewContainer)) {"," viewContainer.appendChild(activeViewContainer);"," }",""," // Prevents needless shuffling around of nodes and maintains DOM order."," if (!container.contains(viewContainer) && !areSame) {"," container.appendChild(viewContainer);"," }",""," return this;"," },",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," users: new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/'); // => Creates a new `Y.UsersView` and shows it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," showView: function (view, config, options, callback) {"," var viewInfo, created;",""," options || (options = {});",""," // Support the callback function being either the third or fourth arg."," if (callback) {"," options = Y.merge(options, {callback: callback});"," } else if (Lang.isFunction(options)) {"," options = {callback: options};"," }",""," if (Lang.isString(view)) {"," viewInfo = this.getViewInfo(view);",""," // Use the preserved view instance, or create a new view."," // TODO: Maybe we can remove the strict check for `preserve` and"," // assume we'll use a View instance if it is there, and just check"," // `preserve` when detaching?"," if (viewInfo && viewInfo.preserve && viewInfo.instance) {"," view = viewInfo.instance;",""," // Make sure there's a mapping back to the view metadata."," this._viewInfoMap[Y.stamp(view, true)] = viewInfo;"," } else {"," // TODO: Add the app as a bubble target during construction, but"," // make sure to check that it isn't already in `bubbleTargets`!"," // This will allow the app to be notified for about _all_ of the"," // view's events. **Note:** This should _only_ happen if the"," // view is created _after_ `activeViewChange`.",""," view = this.createView(view, config);"," created = true;"," }"," }",""," // Update the specified or preserved `view` when signaled to do so."," // There's no need to updated a view if it was _just_ created."," if (options.update && !created) {"," view.setAttrs(config);"," }",""," // TODO: Hold off on rendering the view until after it has been"," // \"attached\", and move the call to render into `_attachView()`.",""," // When a value is specified for `options.render`, prefer it because it"," // represents the developer's intent. When no value is specified, the"," // `view` will only be rendered if it was just created."," if ('render' in options) {"," if (options.render) {"," view.render();"," }"," } else if (created) {"," view.render();"," }",""," return this._set('activeView', view, {options: options});"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Helper method to attach the view instance to the application by making the"," app a bubble target of the view, append the view to the `viewContainer`, and"," assign it to the `instance` property of the associated view info metadata.",""," @method _attachView"," @param {View} view View to attach."," @param {Boolean} prepend=false Whether the view should be prepended instead"," of appended to the `viewContainer`."," @protected"," @since 3.5.0"," **/"," _attachView: function (view, prepend) {"," if (!view) {"," return;"," }",""," var viewInfo = this.getViewInfo(view),"," viewContainer = this.get('viewContainer');",""," // Bubble the view's events to this app."," view.addTarget(this);",""," // Save the view instance in the `views` registry."," if (viewInfo) {"," viewInfo.instance = view;"," }",""," // TODO: Attach events here for persevered Views?"," // See related TODO in `_detachView`.",""," // TODO: Actually render the view here so that it gets \"attached\" before"," // it gets rendered?",""," // Insert view into the DOM."," viewContainer[prepend ? 'prepend' : 'append'](view.get('container'));"," },",""," /**"," Overrides View's container destruction to deal with the `viewContainer` and"," checks to make sure not to remove and purge the `<body>`.",""," @method _destroyContainer"," @protected"," @see View._destroyContainer()"," **/"," _destroyContainer: function () {"," var CLASS_NAMES = Y.App.CLASS_NAMES,"," container = this.get('container'),"," viewContainer = this.get('viewContainer'),"," areSame = container.compareTo(viewContainer);",""," // We do not want to remove or destroy the `<body>`."," if (Y.one('body').compareTo(container)) {"," // Just clean-up our events listeners."," this.detachEvents();",""," // Clean-up `yui3-app` CSS class on the `container`."," container.removeClass(CLASS_NAMES.app);",""," if (areSame) {"," // Clean-up `yui3-app-views` CSS class on the `container`."," container.removeClass(CLASS_NAMES.views);"," } else {"," // Destroy and purge the `viewContainer`."," viewContainer.remove(true);"," }",""," return;"," }",""," // Remove and purge events from both containers.",""," viewContainer.remove(true);",""," if (!areSame) {"," container.remove(true);"," }"," },",""," /**"," Helper method to detach the view instance from the application by removing"," the application as a bubble target of the view, and either just removing the"," view if it is intended to be preserved, or destroying the instance"," completely.",""," @method _detachView"," @param {View} view View to detach."," @protected"," @since 3.5.0"," **/"," _detachView: function (view) {"," if (!view) {"," return;"," }",""," var viewInfo = this.getViewInfo(view) || {};",""," if (viewInfo.preserve) {"," view.remove();"," // TODO: Detach events here for preserved Views? It is possible that"," // some event subscriptions are made on elements other than the"," // View's `container`."," } else {"," view.destroy({remove: true});",""," // TODO: The following should probably happen automagically from"," // `destroy()` being called! Possibly `removeTarget()` as well.",""," // Remove from view to view-info map."," delete this._viewInfoMap[Y.stamp(view, true)];",""," // Remove from view-info instance property."," if (view === viewInfo.instance) {"," delete viewInfo.instance;"," }"," }",""," view.removeTarget(this);"," },",""," /**"," Getter for the `viewContainer` attribute.",""," @method _getViewContainer"," @param {Node|null} value Current attribute value."," @return {Node} View container node."," @protected"," @since 3.5.0"," **/"," _getViewContainer: function (value) {"," // This wackiness is necessary to enable fully lazy creation of the"," // container node both when no container is specified and when one is"," // specified via a valueFn.",""," if (!value && !this._viewContainer) {"," // Create a default container and set that as the new attribute"," // value. The `this._viewContainer` property prevents infinite"," // recursion."," value = this._viewContainer = this.create();"," this._set('viewContainer', value);"," }",""," return value;"," },",""," /**"," Provides the default value for the `html5` attribute.",""," The value returned is dependent on the value of the `serverRouting`"," attribute. When `serverRouting` is explicit set to `false` (not just falsy),"," the default value for `html5` will be set to `false` for *all* browsers.",""," When `serverRouting` is `true` or `undefined` the returned value will be"," dependent on the browser's capability of using HTML5 history.",""," @method _initHtml5"," @return {Boolean} Whether or not HTML5 history should be used."," @protected"," @since 3.5.0"," **/"," _initHtml5: function () {"," // When `serverRouting` is explicitly set to `false` (not just falsy),"," // forcing hash-based URLs in all browsers."," if (this.get('serverRouting') === false) {"," return false;"," }",""," // Defaults to whether or not the browser supports HTML5 history."," return Router.html5;"," },",""," /**"," Determines if the specified `view` is configured as a child of the specified"," `parent` view. This requires both views to be either named-views, or view"," instances created using configuration data that exists in the `views`"," object, e.g. created by the `createView()` or `showView()` method.",""," @method _isChildView"," @param {View|String} view The name of a view defined in the `views` object,"," or a view instance."," @param {View|String} parent The name of a view defined in the `views`"," object, or a view instance."," @return {Boolean} Whether the view is configured as a child of the parent."," @protected"," @since 3.5.0"," **/"," _isChildView: function (view, parent) {"," var viewInfo = this.getViewInfo(view),"," parentInfo = this.getViewInfo(parent);",""," if (viewInfo && parentInfo) {"," return this.getViewInfo(viewInfo.parent) === parentInfo;"," }",""," return false;"," },",""," /**"," Determines if the specified `view` is configured as the parent of the"," specified `child` view. This requires both views to be either named-views,"," or view instances created using configuration data that exists in the"," `views` object, e.g. created by the `createView()` or `showView()` method.",""," @method _isParentView"," @param {View|String} view The name of a view defined in the `views` object,"," or a view instance."," @param {View|String} parent The name of a view defined in the `views`"," object, or a view instance."," @return {Boolean} Whether the view is configured as the parent of the child."," @protected"," @since 3.5.0"," **/"," _isParentView: function (view, child) {"," var viewInfo = this.getViewInfo(view),"," childInfo = this.getViewInfo(child);",""," if (viewInfo && childInfo) {"," return this.getViewInfo(childInfo.parent) === viewInfo;"," }",""," return false;"," },",""," /**"," Underlying implementation for `navigate()`.",""," @method _navigate"," @param {String} url The fully-resolved URL that the app should dispatch to"," its route handlers to fulfill the enhanced navigation \"request\", or use to"," update `window.location` in non-HTML5 history capable browsers when"," `serverRouting` is `true`."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force] Whether the enhanced navigation"," should occur even in browsers without HTML5 history. Will default to"," `true` when `serverRouting` is falsy."," @protected"," @see PjaxBase._navigate()"," **/"," _navigate: function (url, options) {"," if (!this.get('serverRouting')) {"," // Force navigation to be enhanced and handled by the app when"," // `serverRouting` is falsy because the server might not be able to"," // properly handle the request."," options = Y.merge({force: true}, options);"," }",""," return PjaxBase.prototype._navigate.call(this, url, options);"," },",""," /**"," Will either save a history entry using `pushState()` or the location hash,"," or gracefully-degrade to sending a request to the server causing a full-page"," reload.",""," Overrides Router's `_save()` method to preform graceful-degradation when the"," app's `serverRouting` is `true` and `html5` is `false` by updating the full"," URL via standard assignment to `window.location` or by calling"," `window.location.replace()`; both of which will cause a request to the"," server resulting in a full-page reload.",""," Otherwise this will just delegate off to Router's `_save()` method allowing"," the client-side enhanced routing to occur.",""," @method _save"," @param {String} [url] URL for the history entry."," @param {Boolean} [replace=false] If `true`, the current history entry will"," be replaced instead of a new one being added."," @chainable"," @protected"," @see Router._save()"," **/"," _save: function (url, replace) {"," var path;",""," // Forces full-path URLs to always be used by modifying"," // `window.location` in non-HTML5 history capable browsers."," if (this.get('serverRouting') && !this.get('html5')) {"," // Perform same-origin check on the specified URL."," if (!this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," return this;"," }",""," // Either replace the current history entry or create a new one"," // while navigating to the `url`."," if (win) {"," // Results in the URL's full path starting with '/'."," path = this._joinURL(url || '');",""," if (replace) {"," win.location.replace(path);"," } else {"," win.location = path;"," }"," }",""," return this;"," }",""," return Router.prototype._save.apply(this, arguments);"," },",""," /**"," Performs the actual change of this app's `activeView` by attaching the"," `newView` to this app, and detaching the `oldView` from this app using any"," specified `options`.",""," The `newView` is attached to the app by rendering it to the `viewContainer`,"," and making this app a bubble target of its events.",""," The `oldView` is detached from the app by removing it from the"," `viewContainer`, and removing this app as a bubble target for its events."," The `oldView` will either be preserved or properly destroyed.",""," **Note:** The `activeView` attribute is read-only and can be changed by"," calling the `showView()` method.",""," @method _uiSetActiveView"," @param {View} newView The View which is now this app's `activeView`."," @param {View} [oldView] The View which was this app's `activeView`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @protected"," @since 3.5.0"," **/"," _uiSetActiveView: function (newView, oldView, options) {"," options || (options = {});",""," var callback = options.callback,"," isChild = this._isChildView(newView, oldView),"," isParent = !isChild && this._isParentView(newView, oldView),"," prepend = !!options.prepend || isParent;",""," // Prevent detaching (thus removing) the view we want to show. Also hard"," // to animate out and in, the same view."," if (newView === oldView) {"," return callback && callback.call(this, newView);"," }",""," this._attachView(newView, prepend);"," this._detachView(oldView);",""," if (callback) {"," callback.call(this, newView);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles the application's `activeViewChange` event (which is fired when the"," `activeView` attribute changes) by detaching the old view, attaching the new"," view.",""," The `activeView` attribute is read-only, so the public API to change its"," value is through the `showView()` method.",""," @method _afterActiveViewChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterActiveViewChange: function (e) {"," this._uiSetActiveView(e.newVal, e.prevVal, e.options);"," }","}, {"," ATTRS: {"," /**"," The application's active/visible view.",""," This attribute is read-only, to set the `activeView` use the"," `showView()` method.",""," @attribute activeView"," @type View"," @default null"," @readOnly"," @see App.Base.showView()"," @since 3.5.0"," **/"," activeView: {"," value : null,"," readOnly: true"," },",""," /**"," Container node which represents the application's bounding-box, into"," which this app's content will be rendered.",""," The container node serves as the host for all DOM events attached by the"," app. Delegation is used to handle events on children of the container,"," allowing the container's contents to be re-rendered at any time without"," losing event subscriptions.",""," The default container is the `<body>` Node, but you can override this in"," a subclass, or by passing in a custom `container` config value at"," instantiation time.",""," When `container` is overridden by a subclass or passed as a config"," option at instantiation time, it may be provided as a selector string, a"," DOM element, or a `Y.Node` instance. During initialization, this app's"," `create()` method will be called to convert the container into a"," `Y.Node` instance if it isn't one already and stamp it with the CSS"," class: `\"yui3-app\"`.",""," The container is not added to the page automatically. This allows you to"," have full control over how and when your app is actually rendered to"," the page.",""," @attribute container"," @type HTMLElement|Node|String"," @default Y.one('body')"," @initOnly"," **/"," container: {"," valueFn: function () {"," return Y.one('body');"," }"," },",""," /**"," Whether or not this browser is capable of using HTML5 history.",""," This value is dependent on the value of `serverRouting` and will default"," accordingly.",""," Setting this to `false` will force the use of hash-based history even on"," HTML5 browsers, but please don't do this unless you understand the"," consequences.",""," @attribute html5"," @type Boolean"," @initOnly"," @see serverRouting"," **/"," html5: {"," valueFn: '_initHtml5'"," },",""," /**"," CSS selector string used to filter link click events so that only the"," links which match it will have the enhanced-navigation behavior of pjax"," applied.",""," When a link is clicked and that link matches this selector, navigating"," to the link's `href` URL using the enhanced, pjax, behavior will be"," attempted; and the browser's default way to navigate to new pages will"," be the fallback.",""," By default this selector will match _all_ links on the page.",""," @attribute linkSelector"," @type String|Function"," @default \"a\""," **/"," linkSelector: {"," value: 'a'"," },",""," /**"," Whether or not this application's server is capable of properly routing"," all requests and rendering the initial state in the HTML responses.",""," This can have three different values, each having particular"," implications on how the app will handle routing and navigation:",""," * `undefined`: The best form of URLs will be chosen based on the"," capabilities of the browser. Given no information about the server"," environmentm a balanced approach to routing and navigation is"," chosen.",""," The server should be capable of handling full-path requests, since"," full-URLs will be generated by browsers using HTML5 history. If this"," is a client-side-only app the server could handle full-URL requests"," by sending a redirect back to the root with a hash-based URL, e.g:",""," Request: http://example.com/users/1"," Redirect to: http://example.com/#/users/1",""," * `true`: The server is *fully* capable of properly handling requests"," to all full-path URLs the app can produce.",""," This is the best option for progressive-enhancement because it will"," cause **all URLs to always have full-paths**, which means the server"," will be able to accurately handle all URLs this app produces. e.g.",""," http://example.com/users/1",""," To meet this strict full-URL requirement, browsers which are not"," capable of using HTML5 history will make requests to the server"," resulting in full-page reloads.",""," * `false`: The server is *not* capable of properly handling requests"," to all full-path URLs the app can produce, therefore all routing"," will be handled by this App instance.",""," Be aware that this will cause **all URLs to always be hash-based**,"," even in browsers that are capable of using HTML5 history. e.g.",""," http://example.com/#/users/1",""," A single-page or client-side-only app where the server sends a"," \"shell\" page with JavaScript to the client might have this"," restriction. If you're setting this to `false`, read the following:",""," **Note:** When this is set to `false`, the server will *never* receive"," the full URL because browsers do not send the fragment-part to the"," server, that is everything after and including the \"#\".",""," Consider the following example:",""," URL shown in browser: http://example.com/#/users/1"," URL sent to server: http://example.com/",""," You should feel bad about hurting our precious web if you forcefully set"," either `serverRouting` or `html5` to `false`, because you're basically"," punching the web in the face here with your lossy URLs! Please make sure"," you know what you're doing and that you understand the implications.",""," Ideally you should always prefer full-path URLs (not /#/foo/), and want"," full-page reloads when the client's browser is not capable of enhancing"," the experience using the HTML5 history APIs. Setting this to `true` is"," the best option for progressive-enhancement (and graceful-degradation).",""," @attribute serverRouting"," @type Boolean"," @default undefined"," @initOnly"," @since 3.5.0"," **/"," serverRouting: {"," valueFn : function () { return Y.App.serverRouting; },"," writeOnce: 'initOnly'"," },",""," /**"," The node into which this app's `views` will be rendered when they become"," the `activeView`.",""," The view container node serves as the container to hold the app's"," `activeView`. Each time the `activeView` is set via `showView()`, the"," previous view will be removed from this node, and the new active view's"," `container` node will be appended.",""," The default view container is a `<div>` Node, but you can override this"," in a subclass, or by passing in a custom `viewContainer` config value at"," instantiation time. The `viewContainer` may be provided as a selector"," string, DOM element, or a `Y.Node` instance (having the `viewContainer`"," and the `container` be the same node is also supported).",""," The app's `render()` method will stamp the view container with the CSS"," class `\"yui3-app-views\"` and append it to the app's `container` node if"," it isn't already, and any `activeView` will be appended to this node if"," it isn't already.",""," @attribute viewContainer"," @type HTMLElement|Node|String"," @default Y.Node.create(this.containerTemplate)"," @initOnly"," @since 3.5.0"," **/"," viewContainer: {"," getter : '_getViewContainer',"," setter : Y.one,"," writeOnce: true"," }"," },",""," /**"," Properties that shouldn't be turned into ad-hoc attributes when passed to"," App's constructor.",""," @property _NON_ATTRS_CFG"," @type Array"," @static"," @protected"," @since 3.5.0"," **/"," _NON_ATTRS_CFG: ['views']","});","","// -- Namespace ----------------------------------------------------------------","Y.namespace('App').Base = AppBase;","","/**","Provides a top-level application component which manages navigation and views.","","This gives you a foundation and structure on which to build your application; it","combines robust URL navigation with powerful routing and flexible view","management.","","`Y.App` is both a namespace and constructor function. The `Y.App` class is","special in that any `Y.App` class extensions that are included in the YUI","instance will be **auto-mixed** on to the `Y.App` class. Consider this example:",""," YUI().use('app-base', 'app-transitions', function (Y) {"," // This will create two YUI Apps, `basicApp` will not have transitions,"," // but `fancyApp` will have transitions support included and turn it on."," var basicApp = new Y.App.Base(),"," fancyApp = new Y.App({transitions: true});"," });","","@class App","@param {Object} [config] The following are configuration properties that can be"," specified _in addition_ to default attribute values and the non-attribute"," properties provided by `Y.Base`:"," @param {Object} [config.views] Hash of view-name to metadata used to"," declaratively describe an application's views and their relationship with"," the app and other views. The views specified here will override any defaults"," provided by the `views` object on the `prototype`.","@constructor","@extends App.Base","@uses App.Content","@uses App.Transitions","@uses PjaxContent","@since 3.5.0","**/","Y.App = Y.mix(Y.Base.create('app', AppBase, []), Y.App, true);","","/**","CSS classes used by `Y.App`.","","@property CLASS_NAMES","@type Object","@default {}","@static","@since 3.6.0","**/","Y.App.CLASS_NAMES = {"," app : getClassName('app'),"," views: getClassName('app', 'views')","};","","/**","Default `serverRouting` attribute value for all apps.","","@property serverRouting","@type Boolean","@default undefined","@static","@since 3.6.0","**/","","","}, '3.7.3', {\"requires\": [\"classnamemanager\", \"pjax-base\", \"router\", \"view\"]});"]; _yuitest_coverage["build/app-base/app-base.js"].lines = {"1":0,"40":0,"75":0,"151":0,"153":0,"156":0,"157":0,"162":0,"166":0,"170":0,"171":0,"174":0,"178":0,"179":0,"202":0,"207":0,"211":0,"212":0,"214":0,"229":0,"230":0,"233":0,"286":0,"293":0,"294":0,"297":0,"298":0,"302":0,"303":0,"306":0,"376":0,"378":0,"381":0,"382":0,"383":0,"384":0,"387":0,"388":0,"394":0,"395":0,"398":0,"406":0,"407":0,"413":0,"414":0,"423":0,"424":0,"425":0,"427":0,"428":0,"431":0,"449":0,"450":0,"453":0,"457":0,"460":0,"461":0,"471":0,"483":0,"489":0,"491":0,"494":0,"496":0,"498":0,"501":0,"504":0,"509":0,"511":0,"512":0,"528":0,"529":0,"532":0,"534":0,"535":0,"540":0,"546":0,"549":0,"550":0,"554":0,"571":0,"575":0,"576":0,"579":0,"600":0,"601":0,"605":0,"624":0,"627":0,"628":0,"631":0,"650":0,"653":0,"654":0,"657":0,"680":0,"684":0,"687":0,"713":0,"717":0,"719":0,"720":0,"721":0,"726":0,"728":0,"730":0,"731":0,"733":0,"737":0,"740":0,"780":0,"782":0,"789":0,"790":0,"793":0,"794":0,"796":0,"797":0,"817":0,"870":0,"985":0,"1036":0,"1071":0,"1082":0}; _yuitest_coverage["build/app-base/app-base.js"].functions = {"mergeViewConfig:156":0,"initializer:150":0,"createView:201":0,"getViewInfo:228":0,"render:285":0,"showView:375":0,"_attachView:448":0,"_destroyContainer:482":0,"_detachView:527":0,"_getViewContainer:566":0,"_initHtml5:597":0,"_isChildView:623":0,"_isParentView:649":0,"_navigate:679":0,"_save:712":0,"_uiSetActiveView:779":0,"_afterActiveViewChange:816":0,"valueFn:869":0,"valueFn:985":0,"(anonymous 1):1":0}; _yuitest_coverage["build/app-base/app-base.js"].coveredLines = 123;@@ -1277,4 +1277,4 @@ **/ -}, '3.7.2', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});+}, '3.7.3', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});
bundle/app-base/app-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1101,4 +1101,4 @@ **/ -}, '3.7.2', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});+}, '3.7.3', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});
bundle/app-base/app-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-base",function(e,t){var n=e.Lang,r=e.Object,i=e.PjaxBase,s=e.Router,o=e.View,u=e.ClassNameManager.getClassName,a=e.config.win,f;f=e.Base.create("app",e.Base,[o,s,i],{views:{},initializer:function(t){function i(t,r){n[r]=e.merge(n[r],t)}t||(t={});var n={};r.each(this.views,i),r.each(t.views,i),this.views=n,this._viewInfoMap={},this.after("activeViewChange",e.bind("_afterActiveViewChange",this)),this.get("serverRouting")||this._pjaxBindUI()},createView:function(t,i){var s=this.getViewInfo(t),u=s&&s.type||o,a,f;return a=n.isString(u)?r.getValue(e,u.split(".")):u,f=new a(i),this._viewInfoMap[e.stamp(f,!0)]=s,f},getViewInfo:function(t){return n.isString(t)?this.views[t]:t&&this._viewInfoMap[e.stamp(t,!0)]},render:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=this.get("activeView"),s=i&&i.get("container"),o=n.compareTo(r);return n.addClass(t.app),r.addClass(t.views),i&&!r.contains(s)&&r.appendChild(s),!n.contains(r)&&!o&&n.appendChild(r),this},showView:function(t,r,i,s){var o,u;return i||(i={}),s?i=e.merge(i,{callback:s}):n.isFunction(i)&&(i={callback:i}),n.isString(t)&&(o=this.getViewInfo(t),o&&o.preserve&&o.instance?(t=o.instance,this._viewInfoMap[e.stamp(t,!0)]=o):(t=this.createView(t,r),u=!0)),i.update&&!u&&t.setAttrs(r),"render"in i?i.render&&t.render():u&&t.render(),this._set("activeView",t,{options:i})},_attachView:function(e,t){if(!e)return;var n=this.getViewInfo(e),r=this.get("viewContainer");e.addTarget(this),n&&(n.instance=e),r[t?"prepend":"append"](e.get("container"))},_destroyContainer:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=n.compareTo(r);if(e.one("body").compareTo(n)){this.detachEvents(),n.removeClass(t.app),i?n.removeClass(t.views):r.remove(!0);return}r.remove(!0),i||n.remove(!0)},_detachView:function(t){if(!t)return;var n=this.getViewInfo(t)||{};n.preserve?t.remove():(t.destroy({remove:!0}),delete this._viewInfoMap[e.stamp(t,!0)],t===n.instance&&delete n.instance),t.removeTarget(this)},_getViewContainer:function(e){return!e&&!this._viewContainer&&(e=this._viewContainer=this.create(),this._set("viewContainer",e)),e},_initHtml5:function(){return this.get("serverRouting")===!1?!1:s.html5},_isChildView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(n.parent)===r:!1},_isParentView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(r.parent)===n:!1},_navigate:function(t,n){return this.get("serverRouting")||(n=e.merge({force:!0},n)),i.prototype._navigate.call(this,t,n)},_save:function(t,n){var r;return this.get("serverRouting")&&!this.get("html5")?this._hasSameOrigin(t)?(a&&(r=this._joinURL(t||""),n?a.location.replace(r):a.location=r),this):(e.error("Security error: The new URL must be of the same origin as the current URL."),this):s.prototype._save.apply(this,arguments)},_uiSetActiveView:function(e,t,n){n||(n={});var r=n.callback,i=this._isChildView(e,t),s=!i&&this._isParentView(e,t),o=!!n.prepend||s;if(e===t)return r&&r.call(this,e);this._attachView(e,o),this._detachView(t),r&&r.call(this,e)},_afterActiveViewChange:function(e){this._uiSetActiveView(e.newVal,e.prevVal,e.options)}},{ATTRS:{activeView:{value:null,readOnly:!0},container:{valueFn:function(){return e.one("body")}},html5:{valueFn:"_initHtml5"},linkSelector:{value:"a"},serverRouting:{valueFn:function(){return e.App.serverRouting},writeOnce:"initOnly"},viewContainer:{getter:"_getViewContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["views"]}),e.namespace("App").Base=f,e.App=e.mix(e.Base.create("app",f,[]),e.App,!0),e.App.CLASS_NAMES={app:u("app"),views:u("app","views")}},"3.7.2",{requires:["classnamemanager","pjax-base","router","view"]});+YUI.add("app-base",function(e,t){var n=e.Lang,r=e.Object,i=e.PjaxBase,s=e.Router,o=e.View,u=e.ClassNameManager.getClassName,a=e.config.win,f;f=e.Base.create("app",e.Base,[o,s,i],{views:{},initializer:function(t){function i(t,r){n[r]=e.merge(n[r],t)}t||(t={});var n={};r.each(this.views,i),r.each(t.views,i),this.views=n,this._viewInfoMap={},this.after("activeViewChange",e.bind("_afterActiveViewChange",this)),this.get("serverRouting")||this._pjaxBindUI()},createView:function(t,i){var s=this.getViewInfo(t),u=s&&s.type||o,a,f;return a=n.isString(u)?r.getValue(e,u.split(".")):u,f=new a(i),this._viewInfoMap[e.stamp(f,!0)]=s,f},getViewInfo:function(t){return n.isString(t)?this.views[t]:t&&this._viewInfoMap[e.stamp(t,!0)]},render:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=this.get("activeView"),s=i&&i.get("container"),o=n.compareTo(r);return n.addClass(t.app),r.addClass(t.views),i&&!r.contains(s)&&r.appendChild(s),!n.contains(r)&&!o&&n.appendChild(r),this},showView:function(t,r,i,s){var o,u;return i||(i={}),s?i=e.merge(i,{callback:s}):n.isFunction(i)&&(i={callback:i}),n.isString(t)&&(o=this.getViewInfo(t),o&&o.preserve&&o.instance?(t=o.instance,this._viewInfoMap[e.stamp(t,!0)]=o):(t=this.createView(t,r),u=!0)),i.update&&!u&&t.setAttrs(r),"render"in i?i.render&&t.render():u&&t.render(),this._set("activeView",t,{options:i})},_attachView:function(e,t){if(!e)return;var n=this.getViewInfo(e),r=this.get("viewContainer");e.addTarget(this),n&&(n.instance=e),r[t?"prepend":"append"](e.get("container"))},_destroyContainer:function(){var t=e.App.CLASS_NAMES,n=this.get("container"),r=this.get("viewContainer"),i=n.compareTo(r);if(e.one("body").compareTo(n)){this.detachEvents(),n.removeClass(t.app),i?n.removeClass(t.views):r.remove(!0);return}r.remove(!0),i||n.remove(!0)},_detachView:function(t){if(!t)return;var n=this.getViewInfo(t)||{};n.preserve?t.remove():(t.destroy({remove:!0}),delete this._viewInfoMap[e.stamp(t,!0)],t===n.instance&&delete n.instance),t.removeTarget(this)},_getViewContainer:function(e){return!e&&!this._viewContainer&&(e=this._viewContainer=this.create(),this._set("viewContainer",e)),e},_initHtml5:function(){return this.get("serverRouting")===!1?!1:s.html5},_isChildView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(n.parent)===r:!1},_isParentView:function(e,t){var n=this.getViewInfo(e),r=this.getViewInfo(t);return n&&r?this.getViewInfo(r.parent)===n:!1},_navigate:function(t,n){return this.get("serverRouting")||(n=e.merge({force:!0},n)),i.prototype._navigate.call(this,t,n)},_save:function(t,n){var r;return this.get("serverRouting")&&!this.get("html5")?this._hasSameOrigin(t)?(a&&(r=this._joinURL(t||""),n?a.location.replace(r):a.location=r),this):(e.error("Security error: The new URL must be of the same origin as the current URL."),this):s.prototype._save.apply(this,arguments)},_uiSetActiveView:function(e,t,n){n||(n={});var r=n.callback,i=this._isChildView(e,t),s=!i&&this._isParentView(e,t),o=!!n.prepend||s;if(e===t)return r&&r.call(this,e);this._attachView(e,o),this._detachView(t),r&&r.call(this,e)},_afterActiveViewChange:function(e){this._uiSetActiveView(e.newVal,e.prevVal,e.options)}},{ATTRS:{activeView:{value:null,readOnly:!0},container:{valueFn:function(){return e.one("body")}},html5:{valueFn:"_initHtml5"},linkSelector:{value:"a"},serverRouting:{valueFn:function(){return e.App.serverRouting},writeOnce:"initOnly"},viewContainer:{getter:"_getViewContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["views"]}),e.namespace("App").Base=f,e.App=e.mix(e.Base.create("app",f,[]),e.App,!0),e.App.CLASS_NAMES={app:u("app"),views:u("app","views")}},"3.7.3",{requires:["classnamemanager","pjax-base","router","view"]});
bundle/app-base/app-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1101,4 +1101,4 @@ **/ -}, '3.7.2', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});+}, '3.7.3', {"requires": ["classnamemanager", "pjax-base", "router", "view"]});
bundle/app-content/app-content-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/app-content/app-content.js", code: [] };-_yuitest_coverage["build/app-content/app-content.js"].code=["YUI.add('app-content', function (Y, NAME) {","","/**","`Y.App` extension that provides pjax-style content fetching and handling.","","@module app","@submodule app-content","@since 3.7.0","**/","","var PjaxContent = Y.PjaxContent;","","/**","`Y.App` extension that provides pjax-style content fetching and handling.","","This makes it easy to fetch server rendered content for URLs using Ajax. The","HTML content returned from the server will be view-ified and set as the app's","main content, making it seamless to use a mixture of server and client rendered","views.","","When the `\"app-content\"` module is used, it will automatically mix itself into","`Y.App`, and it provides three main features:",""," - **`Y.App.Content.route`**: A stack of middleware which forms a pjax-style"," content route.",""," - **`loadContent()`**: Route middleware which load content from a server. This"," makes an Ajax request for the requested URL, parses the returned content and"," puts it on the route's response object.",""," - **`showContent()`**: Method which provides an easy way to view-ify HTML"," content which should be shown as an app's active/visible view.","","The following is an example of how these features can be used:",""," // Creates a new app and registers the `\"post\"` view."," var app = new Y.App({"," views: {"," post: {type: Y.PostView}"," }"," });",""," // Uses a simple server rendered content route for the About page."," app.route('/about/', Y.App.Content.route);",""," // Uses the `loadContent()` middleware to fetch the contents of the post"," // from the server and shows that content in a `\"post\"` view."," app.route('/posts/:id/', 'loadContent', function (req, res, next) {"," this.showContent(res.content.node, {view: 'post'});"," });","","@class App.Content","@uses PjaxContent","@extensionfor App","@since 3.7.0","**/","function AppContent() {"," PjaxContent.apply(this, arguments);","}","","/**","A stack of middleware which forms a pjax-style content route.","","This route will load the rendered HTML content from the server, then create and","show a new view using those contents.","","@property route","@type Array","@static","@since 3.7.0","**/","AppContent.route = ['loadContent', '_contentRoute'];","","AppContent.prototype = {"," // -- Public Methods -------------------------------------------------------",""," /**"," Sets this app's `activeView` attribute using the specified `content`.",""," This provides an easy way to view-ify HTML content which should be shown as"," this app's active/visible view. This method will determine the appropriate"," view `container` node based on the specified `content`. By default, a new"," `Y.View` instance will be created unless `options.view` is specified.",""," Under the hood, this method calls the `showView()` method, so refer to its"," docs for more information.",""," @method showContent"," @param {HTMLElement|Node|String} content The content to show, it may be"," provided as a selector string, a DOM element, or a `Y.Node` instance."," @param {Object} [options] Optional objects containing any of the following"," properties in addition to any `showView()` options:",""," @param {Object|String} [options.view] The name of a view defined in this"," app's `views`, or an object with the following properties:",""," @param {String} options.view.name The name of a view defined in this"," app's `views`."," @param {Object} [options.view.config] Optional configuration to use when"," creating the new view instance. This config object can also be used"," to update an existing or preserved view's attributes when"," `options.update` is `true`. **Note:** If a `container` is specified,"," it will be overridden by the `content` specified in the first"," argument.",""," @param {Function} [callback] Optional callback function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the second or third"," argument. The function will be passed the following:",""," @param {View} callback.view A reference to the new `activeView`.",""," @since 3.7.0"," @see App.showView()"," **/"," showContent: function (content, options, callback) {"," // Makes sure we have a node instance, and will query selector strings."," content = Y.one(content);",""," // Support the callback function being either the second or third arg."," if (typeof options === 'function') {"," options = {callback: options};"," callback = null;"," }",""," // Mix in default option to *not* render the view because presumably we"," // have pre-rendered content here. This also creates a copy so we can"," // modify the object."," options = Y.merge({render: false}, options);",""," var view = options.view || '',"," viewName = typeof view === 'string' ? view : view.name,"," viewConfig = typeof view !== 'string' ? view.config : {},"," viewInfo = this.getViewInfo(viewName),"," container, template, type, ViewConstructor;",""," // Remove `view` from the `options` which will be passed along to the"," // `showView()` method."," delete options.view;",""," // When the specified `content` is a document fragment, we want to see"," // if it only contains a single node, and use that as the content. This"," // checks `childNodes` which will include text nodes."," if (content && content.isFragment() &&"," content.get('childNodes').size() === 1) {",""," content = content.get('firstChild');"," }",""," // When the `content` is an element node (`nodeType` 1), we can use it"," // as-is for the `container`. Otherwise, we'll construct a new container"," // based on the `options.view`'s `containerTemplate`."," if (content && content.get('nodeType') === 1) {"," container = content;"," } else {"," type = (viewInfo && viewInfo.type) || Y.View;",""," // Looks for a namespaced constructor function on `Y`."," ViewConstructor = typeof type === 'string' ?"," Y.Object.getValue(Y, type.split('.')) : type;",""," // Find the correct node template for the view."," template = ViewConstructor.prototype.containerTemplate;"," container = Y.Node.create(template);",""," // Append the document fragment to the newly created `container`"," // node. This is the worst case where we have to create a wrapper"," // node around the `content`."," container.append(content);"," }",""," // Makes sure the view is created using _our_ `container` node."," viewConfig = Y.merge(viewConfig, {container: container});",""," // Finally switch to the new `activeView`. We want to make sure `view`"," // is a string if it's falsy, that way a new view will be created."," return this.showView(viewName, viewConfig, options, callback);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Provides a default content route which will show a server rendered view.",""," **Note:** This route callback assumes that it's called after the"," `loadContent()` middleware.",""," @method _contentRoute"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @protected"," @since 3.7.0"," @see Y.App.Content.route"," **/"," _contentRoute: function (req, res, next) {"," var content = res.content,"," doc = Y.config.doc,"," activeViewHandle;",""," // We must have some content to work with."," if (!(content && content.node)) { return next(); }",""," if (content.title && doc) {"," // Make sure the `activeView` does actually change before we go"," // messing with the page title."," activeViewHandle = this.onceAfter('activeViewChange', function () {"," doc.title = content.title;"," });"," }",""," this.showContent(content.node);",""," // Detach the handle just in case."," if (activeViewHandle) {"," activeViewHandle.detach();"," }",""," next();"," }","};","","// Mix statics.","Y.mix(AppContent, PjaxContent);","// Mix prototype.","Y.mix(AppContent, PjaxContent, false, null, 1);","","// -- Namespace ----------------------------------------------------------------","Y.App.Content = AppContent;","Y.Base.mix(Y.App, [AppContent]);","","","}, '3.7.2', {\"requires\": [\"app-base\", \"pjax-content\"]});"];+_yuitest_coverage["build/app-content/app-content.js"].code=["YUI.add('app-content', function (Y, NAME) {","","/**","`Y.App` extension that provides pjax-style content fetching and handling.","","@module app","@submodule app-content","@since 3.7.0","**/","","var PjaxContent = Y.PjaxContent;","","/**","`Y.App` extension that provides pjax-style content fetching and handling.","","This makes it easy to fetch server rendered content for URLs using Ajax. The","HTML content returned from the server will be view-ified and set as the app's","main content, making it seamless to use a mixture of server and client rendered","views.","","When the `\"app-content\"` module is used, it will automatically mix itself into","`Y.App`, and it provides three main features:",""," - **`Y.App.Content.route`**: A stack of middleware which forms a pjax-style"," content route.",""," - **`loadContent()`**: Route middleware which load content from a server. This"," makes an Ajax request for the requested URL, parses the returned content and"," puts it on the route's response object.",""," - **`showContent()`**: Method which provides an easy way to view-ify HTML"," content which should be shown as an app's active/visible view.","","The following is an example of how these features can be used:",""," // Creates a new app and registers the `\"post\"` view."," var app = new Y.App({"," views: {"," post: {type: Y.PostView}"," }"," });",""," // Uses a simple server rendered content route for the About page."," app.route('/about/', Y.App.Content.route);",""," // Uses the `loadContent()` middleware to fetch the contents of the post"," // from the server and shows that content in a `\"post\"` view."," app.route('/posts/:id/', 'loadContent', function (req, res, next) {"," this.showContent(res.content.node, {view: 'post'});"," });","","@class App.Content","@uses PjaxContent","@extensionfor App","@since 3.7.0","**/","function AppContent() {"," PjaxContent.apply(this, arguments);","}","","/**","A stack of middleware which forms a pjax-style content route.","","This route will load the rendered HTML content from the server, then create and","show a new view using those contents.","","@property route","@type Array","@static","@since 3.7.0","**/","AppContent.route = ['loadContent', '_contentRoute'];","","AppContent.prototype = {"," // -- Public Methods -------------------------------------------------------",""," /**"," Sets this app's `activeView` attribute using the specified `content`.",""," This provides an easy way to view-ify HTML content which should be shown as"," this app's active/visible view. This method will determine the appropriate"," view `container` node based on the specified `content`. By default, a new"," `Y.View` instance will be created unless `options.view` is specified.",""," Under the hood, this method calls the `showView()` method, so refer to its"," docs for more information.",""," @method showContent"," @param {HTMLElement|Node|String} content The content to show, it may be"," provided as a selector string, a DOM element, or a `Y.Node` instance."," @param {Object} [options] Optional objects containing any of the following"," properties in addition to any `showView()` options:",""," @param {Object|String} [options.view] The name of a view defined in this"," app's `views`, or an object with the following properties:",""," @param {String} options.view.name The name of a view defined in this"," app's `views`."," @param {Object} [options.view.config] Optional configuration to use when"," creating the new view instance. This config object can also be used"," to update an existing or preserved view's attributes when"," `options.update` is `true`. **Note:** If a `container` is specified,"," it will be overridden by the `content` specified in the first"," argument.",""," @param {Function} [callback] Optional callback function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the second or third"," argument. The function will be passed the following:",""," @param {View} callback.view A reference to the new `activeView`.",""," @since 3.7.0"," @see App.showView()"," **/"," showContent: function (content, options, callback) {"," // Makes sure we have a node instance, and will query selector strings."," content = Y.one(content);",""," // Support the callback function being either the second or third arg."," if (typeof options === 'function') {"," options = {callback: options};"," callback = null;"," }",""," // Mix in default option to *not* render the view because presumably we"," // have pre-rendered content here. This also creates a copy so we can"," // modify the object."," options = Y.merge({render: false}, options);",""," var view = options.view || '',"," viewName = typeof view === 'string' ? view : view.name,"," viewConfig = typeof view !== 'string' ? view.config : {},"," viewInfo = this.getViewInfo(viewName),"," container, template, type, ViewConstructor;",""," // Remove `view` from the `options` which will be passed along to the"," // `showView()` method."," delete options.view;",""," // When the specified `content` is a document fragment, we want to see"," // if it only contains a single node, and use that as the content. This"," // checks `childNodes` which will include text nodes."," if (content && content.isFragment() &&"," content.get('childNodes').size() === 1) {",""," content = content.get('firstChild');"," }",""," // When the `content` is an element node (`nodeType` 1), we can use it"," // as-is for the `container`. Otherwise, we'll construct a new container"," // based on the `options.view`'s `containerTemplate`."," if (content && content.get('nodeType') === 1) {"," container = content;"," } else {"," type = (viewInfo && viewInfo.type) || Y.View;",""," // Looks for a namespaced constructor function on `Y`."," ViewConstructor = typeof type === 'string' ?"," Y.Object.getValue(Y, type.split('.')) : type;",""," // Find the correct node template for the view."," template = ViewConstructor.prototype.containerTemplate;"," container = Y.Node.create(template);",""," // Append the document fragment to the newly created `container`"," // node. This is the worst case where we have to create a wrapper"," // node around the `content`."," container.append(content);"," }",""," // Makes sure the view is created using _our_ `container` node."," viewConfig = Y.merge(viewConfig, {container: container});",""," // Finally switch to the new `activeView`. We want to make sure `view`"," // is a string if it's falsy, that way a new view will be created."," return this.showView(viewName, viewConfig, options, callback);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Provides a default content route which will show a server rendered view.",""," **Note:** This route callback assumes that it's called after the"," `loadContent()` middleware.",""," @method _contentRoute"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @protected"," @since 3.7.0"," @see Y.App.Content.route"," **/"," _contentRoute: function (req, res, next) {"," var content = res.content,"," doc = Y.config.doc,"," activeViewHandle;",""," // We must have some content to work with."," if (!(content && content.node)) { return next(); }",""," if (content.title && doc) {"," // Make sure the `activeView` does actually change before we go"," // messing with the page title."," activeViewHandle = this.onceAfter('activeViewChange', function () {"," doc.title = content.title;"," });"," }",""," this.showContent(content.node);",""," // Detach the handle just in case."," if (activeViewHandle) {"," activeViewHandle.detach();"," }",""," next();"," }","};","","// Mix statics.","Y.mix(AppContent, PjaxContent);","// Mix prototype.","Y.mix(AppContent, PjaxContent, false, null, 1);","","// -- Namespace ----------------------------------------------------------------","Y.App.Content = AppContent;","Y.Base.mix(Y.App, [AppContent]);","","","}, '3.7.3', {\"requires\": [\"app-base\", \"pjax-content\"]});"]; _yuitest_coverage["build/app-content/app-content.js"].lines = {"1":0,"11":0,"57":0,"58":0,"72":0,"74":0,"118":0,"121":0,"122":0,"123":0,"129":0,"131":0,"139":0,"144":0,"147":0,"153":0,"154":0,"156":0,"159":0,"163":0,"164":0,"169":0,"173":0,"177":0,"197":0,"202":0,"204":0,"207":0,"208":0,"212":0,"215":0,"216":0,"219":0,"224":0,"226":0,"229":0,"230":0}; _yuitest_coverage["build/app-content/app-content.js"].functions = {"AppContent:57":0,"showContent:116":0,"(anonymous 2):207":0,"_contentRoute:196":0,"(anonymous 1):1":0}; _yuitest_coverage["build/app-content/app-content.js"].coveredLines = 37;@@ -311,4 +311,4 @@ Y.Base.mix(Y.App, [AppContent]); -}, '3.7.2', {"requires": ["app-base", "pjax-content"]});+}, '3.7.3', {"requires": ["app-base", "pjax-content"]});
bundle/app-content/app-content-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -236,4 +236,4 @@ Y.Base.mix(Y.App, [AppContent]); -}, '3.7.2', {"requires": ["app-base", "pjax-content"]});+}, '3.7.3', {"requires": ["app-base", "pjax-content"]});
bundle/app-content/app-content-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-content",function(e,t){function r(){n.apply(this,arguments)}var n=e.PjaxContent;r.route=["loadContent","_contentRoute"],r.prototype={showContent:function(t,n,r){t=e.one(t),typeof n=="function"&&(n={callback:n},r=null),n=e.merge({render:!1},n);var i=n.view||"",s=typeof i=="string"?i:i.name,o=typeof i!="string"?i.config:{},u=this.getViewInfo(s),a,f,l,c;return delete n.view,t&&t.isFragment()&&t.get("childNodes").size()===1&&(t=t.get("firstChild")),t&&t.get("nodeType")===1?a=t:(l=u&&u.type||e.View,c=typeof l=="string"?e.Object.getValue(e,l.split(".")):l,f=c.prototype.containerTemplate,a=e.Node.create(f),a.append(t)),o=e.merge(o,{container:a}),this.showView(s,o,n,r)},_contentRoute:function(t,n,r){var i=n.content,s=e.config.doc,o;if(!i||!i.node)return r();i.title&&s&&(o=this.onceAfter("activeViewChange",function(){s.title=i.title})),this.showContent(i.node),o&&o.detach(),r()}},e.mix(r,n),e.mix(r,n,!1,null,1),e.App.Content=r,e.Base.mix(e.App,[r])},"3.7.2",{requires:["app-base","pjax-content"]});+YUI.add("app-content",function(e,t){function r(){n.apply(this,arguments)}var n=e.PjaxContent;r.route=["loadContent","_contentRoute"],r.prototype={showContent:function(t,n,r){t=e.one(t),typeof n=="function"&&(n={callback:n},r=null),n=e.merge({render:!1},n);var i=n.view||"",s=typeof i=="string"?i:i.name,o=typeof i!="string"?i.config:{},u=this.getViewInfo(s),a,f,l,c;return delete n.view,t&&t.isFragment()&&t.get("childNodes").size()===1&&(t=t.get("firstChild")),t&&t.get("nodeType")===1?a=t:(l=u&&u.type||e.View,c=typeof l=="string"?e.Object.getValue(e,l.split(".")):l,f=c.prototype.containerTemplate,a=e.Node.create(f),a.append(t)),o=e.merge(o,{container:a}),this.showView(s,o,n,r)},_contentRoute:function(t,n,r){var i=n.content,s=e.config.doc,o;if(!i||!i.node)return r();i.title&&s&&(o=this.onceAfter("activeViewChange",function(){s.title=i.title})),this.showContent(i.node),o&&o.detach(),r()}},e.mix(r,n),e.mix(r,n,!1,null,1),e.App.Content=r,e.Base.mix(e.App,[r])},"3.7.3",{requires:["app-base","pjax-content"]});
bundle/app-content/app-content.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -236,4 +236,4 @@ Y.Base.mix(Y.App, [AppContent]); -}, '3.7.2', {"requires": ["app-base", "pjax-content"]});+}, '3.7.3', {"requires": ["app-base", "pjax-content"]});
bundle/app-transitions-css/app-transitions-css-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/app-transitions-css/app-transitions-css.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/app-transitions-native/app-transitions-native-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/app-transitions-native/app-transitions-native.js", code: [] };-_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].code=["YUI.add('app-transitions-native', function (Y, NAME) {","","/**","Provides the implementation of view transitions for `Y.App.Transitions` in","browsers which support native CSS3 transitions.","","@module app","@submodule app-transitions-native","@since 3.5.0","**/","","var AppTransitions = Y.App.Transitions;","","/**","Provides the implementation of view transitions for `Y.App.Transitions` in","browsers which support native CSS3 transitions.","","When this module is used, `Y.App.TransitionsNative` will automatically mix","itself in to `Y.App`.","","@class App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitionsNative() {}","","AppTransitionsNative.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Whether this app is currently transitioning its `activeView`.",""," @property _transitioning"," @type Boolean"," @default false"," @protected"," @since 3.5.0"," **/",""," /**"," A queue that holds pending calls to this app's `_uiTransitionActiveView()`"," method.",""," @property _viewTransitionQueue"," @type Array"," @default []"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," this._transitioning = false;"," this._viewTransitionQueue = [];",""," // TODO: Consider the AOP approach that `Plugin.WidgetAnim` uses."," Y.Do.before(this._queueActiveView, this, '_uiSetActiveView');"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Dequeues any pending calls to `_uiTransitionActiveView()`.",""," **Note:** When there is more than one queued transition, only the most"," recent `activeView` change will be visually transitioned, while the others"," will have their `transition` option overridden to `false`.",""," @method _dequeueActiveView"," @protected"," @since 3.5.0"," **/"," _dequeueActiveView: function () {"," var queue = this._viewTransitionQueue,"," transition = queue.shift(),"," options;",""," if (transition) {"," // When items are still left in the queue, override the transition"," // so it does not run."," if (queue.length) {"," // Overrides `transition` option and splices in the new options."," options = Y.merge(transition[2], {transition: false});"," transition.splice(2, 1, options);"," }",""," this._uiTransitionActiveView.apply(this, transition);"," }"," },",""," /**"," Returns an object containing a named fx for both `viewIn` and `viewOut`"," based on the relationship between the specified `newView` and `oldView`.",""," @method _getFx"," @param {View} newView The view being transitioned-in."," @param {View} oldView The view being transitioned-out."," @param {String} [transition] The preferred transition to use."," @return {Object} An object containing a named fx for both `viewIn` and"," `viewOut`."," @protected"," @since 3.5.0"," **/"," _getFx: function (newView, oldView, transition) {"," var fx = AppTransitions.FX,"," transitions = this.get('transitions');",""," if (transition === false || !transitions) {"," return null;"," }",""," if (transition) {"," return fx[transition];"," }",""," if (this._isChildView(newView, oldView)) {"," return fx[transitions.toChild];"," }",""," if (this._isParentView(newView, oldView)) {"," return fx[transitions.toParent];"," }",""," return fx[transitions.navigate];"," },",""," /**"," Queues calls to `_uiTransitionActiveView()` to make sure a currently running"," transition isn't interrupted.",""," **Note:** This method prevents the default `_uiSetActiveView()` method from"," running.",""," @method _queueActiveView"," @protected"," @since 3.5.0"," **/"," _queueActiveView: function () {"," var args = Y.Array(arguments, 0, true);",""," this._viewTransitionQueue.push(args);",""," if (!this._transitioning) {"," this._dequeueActiveView();"," }",""," return new Y.Do.Prevent();"," },",""," /**"," Performs the actual change of this app's `activeView` by visually"," transitioning between the `newView` and `oldView` using any specified"," `options`.",""," The `newView` is attached to the app by rendering it to the `viewContainer`,"," and making this app a bubble target of its events.",""," The `oldView` is detached from the app by removing it from the"," `viewContainer`, and removing this app as a bubble target for its events."," The `oldView` will either be preserved or properly destroyed.",""," **Note:** This method overrides `_uiSetActiveView()` and provides all of its"," functionality plus supports visual transitions. Also, the `activeView`"," attribute is read-only and can be changed by calling the `showView()`"," method.",""," @method _uiTransitionActiveView"," @param {View} newView The View which is now this app's `activeView`."," @param {View} [oldView] The View which was this app's `activeView`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @protected"," @since 3.5.0"," **/"," _uiTransitionActiveView: function (newView, oldView, options) {"," options || (options = {});",""," var callback = options.callback,"," container, transitioning, isChild, isParent, prepend,"," fx, fxConfig, transitions;",""," // Quits early when to new and old views are the same."," if (newView === oldView) {"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," fx = this._getFx(newView, oldView, options.transition);"," isChild = this._isChildView(newView, oldView);"," isParent = !isChild && this._isParentView(newView, oldView);"," prepend = !!options.prepend || isParent;",""," // Preforms simply attach/detach of the new and old view respectively"," // when there's no transition to perform."," if (!fx) {"," this._attachView(newView, prepend);"," this._detachView(oldView);"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," this._transitioning = true;",""," container = this.get('container');"," transitioning = Y.App.CLASS_NAMES.transitioning;",""," container.addClass(transitioning);",""," this._attachView(newView, prepend);",""," // Called when view transitions completed, if none were added this will"," // run right away."," function complete() {"," this._detachView(oldView);"," container.removeClass(transitioning);"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," // Setup a new stack to run the view transitions in parallel."," transitions = new Y.Parallel({context: this});"," fxConfig = {"," crossView: !!oldView && !!newView,"," prepended: prepend"," };",""," // Transition the new view first to prevent a gap when sliding."," if (newView && fx.viewIn) {"," newView.get('container')"," .transition(fx.viewIn, fxConfig, transitions.add());"," }",""," if (oldView && fx.viewOut) {"," oldView.get('container')"," .transition(fx.viewOut, fxConfig, transitions.add());"," }",""," transitions.done(complete);"," }","};","","// -- Transition fx ------------------------------------------------------------","Y.mix(Y.Transition.fx, {"," 'app:fadeIn': {"," opacity : 1,"," duration: 0.3,",""," on: {"," start: function (data) {"," var styles = {opacity: 0},"," config = data.config;",""," if (config.crossView && !config.prepended) {"," styles.transform = 'translateX(-100%)';"," }",""," this.setStyles(styles);"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:fadeOut': {"," opacity : 0,"," duration: 0.3,",""," on: {"," start: function (data) {"," var styles = {opacity: 1},"," config = data.config;",""," if (config.crossView && config.prepended) {"," styles.transform = 'translateX(-100%)';"," }",""," this.setStyles(styles);"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:slideLeft': {"," duration : 0.3,"," transform: 'translateX(-100%)',",""," on: {"," start: function () {"," this.setStyles({"," opacity : 1,"," transform: 'translateX(0%)'"," });"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:slideRight': {"," duration : 0.3,"," transform: 'translateX(0)',",""," on: {"," start: function () {"," this.setStyles({"," opacity : 1,"," transform: 'translateX(-100%)'"," });"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," }","});","","// -- Namespacae ---------------------------------------------------------------","Y.App.TransitionsNative = AppTransitionsNative;","Y.Base.mix(Y.App, [AppTransitionsNative]);","","","}, '3.7.2', {\"requires\": [\"app-transitions\", \"app-transitions-css\", \"parallel\", \"transition\"]});"];+_yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].code=["YUI.add('app-transitions-native', function (Y, NAME) {","","/**","Provides the implementation of view transitions for `Y.App.Transitions` in","browsers which support native CSS3 transitions.","","@module app","@submodule app-transitions-native","@since 3.5.0","**/","","var AppTransitions = Y.App.Transitions;","","/**","Provides the implementation of view transitions for `Y.App.Transitions` in","browsers which support native CSS3 transitions.","","When this module is used, `Y.App.TransitionsNative` will automatically mix","itself in to `Y.App`.","","@class App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitionsNative() {}","","AppTransitionsNative.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Whether this app is currently transitioning its `activeView`.",""," @property _transitioning"," @type Boolean"," @default false"," @protected"," @since 3.5.0"," **/",""," /**"," A queue that holds pending calls to this app's `_uiTransitionActiveView()`"," method.",""," @property _viewTransitionQueue"," @type Array"," @default []"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," this._transitioning = false;"," this._viewTransitionQueue = [];",""," // TODO: Consider the AOP approach that `Plugin.WidgetAnim` uses."," Y.Do.before(this._queueActiveView, this, '_uiSetActiveView');"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Dequeues any pending calls to `_uiTransitionActiveView()`.",""," **Note:** When there is more than one queued transition, only the most"," recent `activeView` change will be visually transitioned, while the others"," will have their `transition` option overridden to `false`.",""," @method _dequeueActiveView"," @protected"," @since 3.5.0"," **/"," _dequeueActiveView: function () {"," var queue = this._viewTransitionQueue,"," transition = queue.shift(),"," options;",""," if (transition) {"," // When items are still left in the queue, override the transition"," // so it does not run."," if (queue.length) {"," // Overrides `transition` option and splices in the new options."," options = Y.merge(transition[2], {transition: false});"," transition.splice(2, 1, options);"," }",""," this._uiTransitionActiveView.apply(this, transition);"," }"," },",""," /**"," Returns an object containing a named fx for both `viewIn` and `viewOut`"," based on the relationship between the specified `newView` and `oldView`.",""," @method _getFx"," @param {View} newView The view being transitioned-in."," @param {View} oldView The view being transitioned-out."," @param {String} [transition] The preferred transition to use."," @return {Object} An object containing a named fx for both `viewIn` and"," `viewOut`."," @protected"," @since 3.5.0"," **/"," _getFx: function (newView, oldView, transition) {"," var fx = AppTransitions.FX,"," transitions = this.get('transitions');",""," if (transition === false || !transitions) {"," return null;"," }",""," if (transition) {"," return fx[transition];"," }",""," if (this._isChildView(newView, oldView)) {"," return fx[transitions.toChild];"," }",""," if (this._isParentView(newView, oldView)) {"," return fx[transitions.toParent];"," }",""," return fx[transitions.navigate];"," },",""," /**"," Queues calls to `_uiTransitionActiveView()` to make sure a currently running"," transition isn't interrupted.",""," **Note:** This method prevents the default `_uiSetActiveView()` method from"," running.",""," @method _queueActiveView"," @protected"," @since 3.5.0"," **/"," _queueActiveView: function () {"," var args = Y.Array(arguments, 0, true);",""," this._viewTransitionQueue.push(args);",""," if (!this._transitioning) {"," this._dequeueActiveView();"," }",""," return new Y.Do.Prevent();"," },",""," /**"," Performs the actual change of this app's `activeView` by visually"," transitioning between the `newView` and `oldView` using any specified"," `options`.",""," The `newView` is attached to the app by rendering it to the `viewContainer`,"," and making this app a bubble target of its events.",""," The `oldView` is detached from the app by removing it from the"," `viewContainer`, and removing this app as a bubble target for its events."," The `oldView` will either be preserved or properly destroyed.",""," **Note:** This method overrides `_uiSetActiveView()` and provides all of its"," functionality plus supports visual transitions. Also, the `activeView`"," attribute is read-only and can be changed by calling the `showView()`"," method.",""," @method _uiTransitionActiveView"," @param {View} newView The View which is now this app's `activeView`."," @param {View} [oldView] The View which was this app's `activeView`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @protected"," @since 3.5.0"," **/"," _uiTransitionActiveView: function (newView, oldView, options) {"," options || (options = {});",""," var callback = options.callback,"," container, transitioning, isChild, isParent, prepend,"," fx, fxConfig, transitions;",""," // Quits early when to new and old views are the same."," if (newView === oldView) {"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," fx = this._getFx(newView, oldView, options.transition);"," isChild = this._isChildView(newView, oldView);"," isParent = !isChild && this._isParentView(newView, oldView);"," prepend = !!options.prepend || isParent;",""," // Preforms simply attach/detach of the new and old view respectively"," // when there's no transition to perform."," if (!fx) {"," this._attachView(newView, prepend);"," this._detachView(oldView);"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," this._transitioning = true;",""," container = this.get('container');"," transitioning = Y.App.CLASS_NAMES.transitioning;",""," container.addClass(transitioning);",""," this._attachView(newView, prepend);",""," // Called when view transitions completed, if none were added this will"," // run right away."," function complete() {"," this._detachView(oldView);"," container.removeClass(transitioning);"," callback && callback.call(this, newView);",""," this._transitioning = false;"," return this._dequeueActiveView();"," }",""," // Setup a new stack to run the view transitions in parallel."," transitions = new Y.Parallel({context: this});"," fxConfig = {"," crossView: !!oldView && !!newView,"," prepended: prepend"," };",""," // Transition the new view first to prevent a gap when sliding."," if (newView && fx.viewIn) {"," newView.get('container')"," .transition(fx.viewIn, fxConfig, transitions.add());"," }",""," if (oldView && fx.viewOut) {"," oldView.get('container')"," .transition(fx.viewOut, fxConfig, transitions.add());"," }",""," transitions.done(complete);"," }","};","","// -- Transition fx ------------------------------------------------------------","Y.mix(Y.Transition.fx, {"," 'app:fadeIn': {"," opacity : 1,"," duration: 0.3,",""," on: {"," start: function (data) {"," var styles = {opacity: 0},"," config = data.config;",""," if (config.crossView && !config.prepended) {"," styles.transform = 'translateX(-100%)';"," }",""," this.setStyles(styles);"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:fadeOut': {"," opacity : 0,"," duration: 0.3,",""," on: {"," start: function (data) {"," var styles = {opacity: 1},"," config = data.config;",""," if (config.crossView && config.prepended) {"," styles.transform = 'translateX(-100%)';"," }",""," this.setStyles(styles);"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:slideLeft': {"," duration : 0.3,"," transform: 'translateX(-100%)',",""," on: {"," start: function () {"," this.setStyles({"," opacity : 1,"," transform: 'translateX(0%)'"," });"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," },",""," 'app:slideRight': {"," duration : 0.3,"," transform: 'translateX(0)',",""," on: {"," start: function () {"," this.setStyles({"," opacity : 1,"," transform: 'translateX(-100%)'"," });"," },",""," end: function () {"," this.setStyle('transform', 'translateX(0)');"," }"," }"," }","});","","// -- Namespacae ---------------------------------------------------------------","Y.App.TransitionsNative = AppTransitionsNative;","Y.Base.mix(Y.App, [AppTransitionsNative]);","","","}, '3.7.3', {\"requires\": [\"app-transitions\", \"app-transitions-css\", \"parallel\", \"transition\"]});"]; _yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].lines = {"1":0,"12":0,"25":0,"27":0,"54":0,"55":0,"58":0,"75":0,"79":0,"82":0,"84":0,"85":0,"88":0,"106":0,"109":0,"110":0,"113":0,"114":0,"117":0,"118":0,"121":0,"122":0,"125":0,"140":0,"142":0,"144":0,"145":0,"148":0,"193":0,"195":0,"200":0,"201":0,"203":0,"204":0,"207":0,"208":0,"209":0,"210":0,"214":0,"215":0,"216":0,"217":0,"219":0,"220":0,"223":0,"225":0,"226":0,"228":0,"230":0,"234":0,"235":0,"236":0,"237":0,"239":0,"240":0,"244":0,"245":0,"251":0,"252":0,"256":0,"257":0,"261":0,"266":0,"273":0,"276":0,"277":0,"280":0,"284":0,"295":0,"298":0,"299":0,"302":0,"306":0,"317":0,"324":0,"335":0,"342":0,"349":0,"350":0}; _yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].functions = {"AppTransitionsNative:25":0,"initializer:53":0,"_dequeueActiveView:74":0,"_getFx:105":0,"_queueActiveView:139":0,"complete:234":0,"_uiTransitionActiveView:192":0,"start:272":0,"end:283":0,"start:294":0,"end:305":0,"start:316":0,"end:323":0,"start:334":0,"end:341":0,"(anonymous 1):1":0}; _yuitest_coverage["build/app-transitions-native/app-transitions-native.js"].coveredLines = 79;@@ -483,4 +483,4 @@ Y.Base.mix(Y.App, [AppTransitionsNative]); -}, '3.7.2', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});+}, '3.7.3', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
bundle/app-transitions-native/app-transitions-native-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -356,4 +356,4 @@ Y.Base.mix(Y.App, [AppTransitionsNative]); -}, '3.7.2', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});+}, '3.7.3', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
bundle/app-transitions-native/app-transitions-native-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-transitions-native",function(e,t){function r(){}var n=e.App.Transitions;r.prototype={initializer:function(){this._transitioning=!1,this._viewTransitionQueue=[],e.Do.before(this._queueActiveView,this,"_uiSetActiveView")},_dequeueActiveView:function(){var t=this._viewTransitionQueue,n=t.shift(),r;n&&(t.length&&(r=e.merge(n[2],{transition:!1}),n.splice(2,1,r)),this._uiTransitionActiveView.apply(this,n))},_getFx:function(e,t,r){var i=n.FX,s=this.get("transitions");return r===!1||!s?null:r?i[r]:this._isChildView(e,t)?i[s.toChild]:this._isParentView(e,t)?i[s.toParent]:i[s.navigate]},_queueActiveView:function(){var t=e.Array(arguments,0,!0);return this._viewTransitionQueue.push(t),this._transitioning||this._dequeueActiveView(),new e.Do.Prevent},_uiTransitionActiveView:function(t,n,r){function p(){return this._detachView(n),s.removeClass(o),i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView()}r||(r={});var i=r.callback,s,o,u,a,f,l,c,h;if(t===n)return i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView();l=this._getFx(t,n,r.transition),u=this._isChildView(t,n),a=!u&&this._isParentView(t,n),f=!!r.prepend||a;if(!l)return this._attachView(t,f),this._detachView(n),i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView();this._transitioning=!0,s=this.get("container"),o=e.App.CLASS_NAMES.transitioning,s.addClass(o),this._attachView(t,f),h=new e.Parallel({context:this}),c={crossView:!!n&&!!t,prepended:f},t&&l.viewIn&&t.get("container").transition(l.viewIn,c,h.add()),n&&l.viewOut&&n.get("container").transition(l.viewOut,c,h.add()),h.done(p)}},e.mix(e.Transition.fx,{"app:fadeIn":{opacity:1,duration:.3,on:{start:function(e){var t={opacity:0},n=e.config;n.crossView&&!n.prepended&&(t.transform="translateX(-100%)"),this.setStyles(t)},end:function(){this.setStyle("transform","translateX(0)")}}},"app:fadeOut":{opacity:0,duration:.3,on:{start:function(e){var t={opacity:1},n=e.config;n.crossView&&n.prepended&&(t.transform="translateX(-100%)"),this.setStyles(t)},end:function(){this.setStyle("transform","translateX(0)")}}},"app:slideLeft":{duration:.3,transform:"translateX(-100%)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(0%)"})},end:function(){this.setStyle("transform","translateX(0)")}}},"app:slideRight":{duration:.3,transform:"translateX(0)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(-100%)"})},end:function(){this.setStyle("transform","translateX(0)")}}}}),e.App.TransitionsNative=r,e.Base.mix(e.App,[r])},"3.7.2",{requires:["app-transitions","app-transitions-css","parallel","transition"]});+YUI.add("app-transitions-native",function(e,t){function r(){}var n=e.App.Transitions;r.prototype={initializer:function(){this._transitioning=!1,this._viewTransitionQueue=[],e.Do.before(this._queueActiveView,this,"_uiSetActiveView")},_dequeueActiveView:function(){var t=this._viewTransitionQueue,n=t.shift(),r;n&&(t.length&&(r=e.merge(n[2],{transition:!1}),n.splice(2,1,r)),this._uiTransitionActiveView.apply(this,n))},_getFx:function(e,t,r){var i=n.FX,s=this.get("transitions");return r===!1||!s?null:r?i[r]:this._isChildView(e,t)?i[s.toChild]:this._isParentView(e,t)?i[s.toParent]:i[s.navigate]},_queueActiveView:function(){var t=e.Array(arguments,0,!0);return this._viewTransitionQueue.push(t),this._transitioning||this._dequeueActiveView(),new e.Do.Prevent},_uiTransitionActiveView:function(t,n,r){function p(){return this._detachView(n),s.removeClass(o),i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView()}r||(r={});var i=r.callback,s,o,u,a,f,l,c,h;if(t===n)return i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView();l=this._getFx(t,n,r.transition),u=this._isChildView(t,n),a=!u&&this._isParentView(t,n),f=!!r.prepend||a;if(!l)return this._attachView(t,f),this._detachView(n),i&&i.call(this,t),this._transitioning=!1,this._dequeueActiveView();this._transitioning=!0,s=this.get("container"),o=e.App.CLASS_NAMES.transitioning,s.addClass(o),this._attachView(t,f),h=new e.Parallel({context:this}),c={crossView:!!n&&!!t,prepended:f},t&&l.viewIn&&t.get("container").transition(l.viewIn,c,h.add()),n&&l.viewOut&&n.get("container").transition(l.viewOut,c,h.add()),h.done(p)}},e.mix(e.Transition.fx,{"app:fadeIn":{opacity:1,duration:.3,on:{start:function(e){var t={opacity:0},n=e.config;n.crossView&&!n.prepended&&(t.transform="translateX(-100%)"),this.setStyles(t)},end:function(){this.setStyle("transform","translateX(0)")}}},"app:fadeOut":{opacity:0,duration:.3,on:{start:function(e){var t={opacity:1},n=e.config;n.crossView&&n.prepended&&(t.transform="translateX(-100%)"),this.setStyles(t)},end:function(){this.setStyle("transform","translateX(0)")}}},"app:slideLeft":{duration:.3,transform:"translateX(-100%)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(0%)"})},end:function(){this.setStyle("transform","translateX(0)")}}},"app:slideRight":{duration:.3,transform:"translateX(0)",on:{start:function(){this.setStyles({opacity:1,transform:"translateX(-100%)"})},end:function(){this.setStyle("transform","translateX(0)")}}}}),e.App.TransitionsNative=r,e.Base.mix(e.App,[r])},"3.7.3",{requires:["app-transitions","app-transitions-css","parallel","transition"]});
bundle/app-transitions-native/app-transitions-native.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -356,4 +356,4 @@ Y.Base.mix(Y.App, [AppTransitionsNative]); -}, '3.7.2', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});+}, '3.7.3', {"requires": ["app-transitions", "app-transitions-css", "parallel", "transition"]});
bundle/app-transitions/app-transitions-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/app-transitions/app-transitions.js", code: [] };-_yuitest_coverage["build/app-transitions/app-transitions.js"].code=["YUI.add('app-transitions', function (Y, NAME) {","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","@module app","@submodule app-transitions","@since 3.5.0","**/","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","View transitions provide an nice way to move from one \"page\" to the next that is","both pleasant to the user and helps to communicate a hierarchy between sections","of an application.","","When the `\"app-transitions\"` module is used, it will automatically mix itself","into `Y.App` and transition between `activeView` changes using the following","effects:",""," - **`fade`**: Cross-fades between the old an new active views.",""," - **`slideLeft`**: The old and new active views are positioned next to each"," other and both slide to the left.",""," - **`slideRight`**: The old and new active views are positioned next to each"," other and both slide to the right.","","**Note:** Transitions are an opt-in feature and are enabled via an app's","`transitions` attribute.","","@class App.Transitions","@uses App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitions() {}","","AppTransitions.ATTRS = {"," /**"," Whether or not this application should use view transitions, and if so then"," which ones or `true` for the defaults which are specified by the"," `transitions` prototype property.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @attribute transitions"," @type Boolean|Object"," @default false"," @since 3.5.0"," **/"," transitions: {"," setter: '_setTransitions',"," value : false"," }","};","","/**","Collect of transitions -> fx.","","A transition (e.g. \"fade\") is a simple name given to a configuration of fx to","apply, consisting of `viewIn` and `viewOut` properties who's values are names of","fx registered on `Y.Transition.fx`.","","By default transitions: `fade`, `slideLeft`, and `slideRight` have fx defined.","","@property FX","@type Object","@static","@since 3.5.0","**/","AppTransitions.FX = {"," fade: {"," viewIn : 'app:fadeIn',"," viewOut: 'app:fadeOut'"," },",""," slideLeft: {"," viewIn : 'app:slideLeft',"," viewOut: 'app:slideLeft'"," },",""," slideRight: {"," viewIn : 'app:slideRight',"," viewOut: 'app:slideRight'"," }","};","","AppTransitions.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Default transitions to use when the `activeView` changes.",""," The following are types of changes for which transitions can be defined that"," correspond to the relationship between the new and previous `activeView`:",""," * `navigate`: The default transition to use when changing the `activeView`"," of the application.",""," * `toChild`: The transition to use when the new `activeView` is configured"," as a child of the previously active view via its `parent` property as"," defined in this app's `views`.",""," * `toParent`: The transition to use when the new `activeView` is"," configured as the `parent` of the previously active view as defined in"," this app's `views`.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @property transitions"," @type Object"," @default"," {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," }"," @since 3.5.0"," **/"," transitions: {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," transitions: true,"," users : new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/');"," // => Creates a new `Y.UsersView` and transitions to it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," // Does not override `showView()` but does use `options.transitions`.",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Setter for `transitions` attribute.",""," When specified as `true`, the defaults will be use as specified by the"," `transitions` prototype property.",""," @method _setTransitions"," @param {Boolean|Object} transitions The new `transitions` attribute value."," @return {Mixed} The processed value which represents the new state."," @protected"," @see App.Base.showView()"," @since 3.5.0"," **/"," _setTransitions: function (transitions) {"," var defTransitions = this.transitions;",""," if (transitions && transitions === true) {"," return Y.merge(defTransitions);"," }",""," return transitions;"," }","};","","// -- Namespace ----------------------------------------------------------------","Y.App.Transitions = AppTransitions;","Y.Base.mix(Y.App, [AppTransitions]);","","Y.mix(Y.App.CLASS_NAMES, {"," transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')","});","","","}, '3.7.2', {\"requires\": [\"app-base\"]});"];+_yuitest_coverage["build/app-transitions/app-transitions.js"].code=["YUI.add('app-transitions', function (Y, NAME) {","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","@module app","@submodule app-transitions","@since 3.5.0","**/","","/**","`Y.App` extension that provides view transitions in browsers which support","native CSS3 transitions.","","View transitions provide an nice way to move from one \"page\" to the next that is","both pleasant to the user and helps to communicate a hierarchy between sections","of an application.","","When the `\"app-transitions\"` module is used, it will automatically mix itself","into `Y.App` and transition between `activeView` changes using the following","effects:",""," - **`fade`**: Cross-fades between the old an new active views.",""," - **`slideLeft`**: The old and new active views are positioned next to each"," other and both slide to the left.",""," - **`slideRight`**: The old and new active views are positioned next to each"," other and both slide to the right.","","**Note:** Transitions are an opt-in feature and are enabled via an app's","`transitions` attribute.","","@class App.Transitions","@uses App.TransitionsNative","@extensionfor App","@since 3.5.0","**/","function AppTransitions() {}","","AppTransitions.ATTRS = {"," /**"," Whether or not this application should use view transitions, and if so then"," which ones or `true` for the defaults which are specified by the"," `transitions` prototype property.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @attribute transitions"," @type Boolean|Object"," @default false"," @since 3.5.0"," **/"," transitions: {"," setter: '_setTransitions',"," value : false"," }","};","","/**","Collect of transitions -> fx.","","A transition (e.g. \"fade\") is a simple name given to a configuration of fx to","apply, consisting of `viewIn` and `viewOut` properties who's values are names of","fx registered on `Y.Transition.fx`.","","By default transitions: `fade`, `slideLeft`, and `slideRight` have fx defined.","","@property FX","@type Object","@static","@since 3.5.0","**/","AppTransitions.FX = {"," fade: {"," viewIn : 'app:fadeIn',"," viewOut: 'app:fadeOut'"," },",""," slideLeft: {"," viewIn : 'app:slideLeft',"," viewOut: 'app:slideLeft'"," },",""," slideRight: {"," viewIn : 'app:slideRight',"," viewOut: 'app:slideRight'"," }","};","","AppTransitions.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Default transitions to use when the `activeView` changes.",""," The following are types of changes for which transitions can be defined that"," correspond to the relationship between the new and previous `activeView`:",""," * `navigate`: The default transition to use when changing the `activeView`"," of the application.",""," * `toChild`: The transition to use when the new `activeView` is configured"," as a child of the previously active view via its `parent` property as"," defined in this app's `views`.",""," * `toParent`: The transition to use when the new `activeView` is"," configured as the `parent` of the previously active view as defined in"," this app's `views`.",""," **Note:** Transitions are an opt-in feature and will only be used in"," browsers which support native CSS3 transitions.",""," @property transitions"," @type Object"," @default"," {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," }"," @since 3.5.0"," **/"," transitions: {"," navigate: 'fade',"," toChild : 'slideLeft',"," toParent: 'slideRight'"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Sets which view is active/visible for the application. This will set the"," app's `activeView` attribute to the specified `view`.",""," The `view` will be \"attached\" to this app, meaning it will be both rendered"," into this app's `viewContainer` node and all of its events will bubble to"," the app. The previous `activeView` will be \"detached\" from this app.",""," When a string-name is provided for a view which has been registered on this"," app's `views` object, the referenced metadata will be used and the"," `activeView` will be set to either a preserved view instance, or a new"," instance of the registered view will be created using the specified `config`"," object passed-into this method.",""," A callback function can be specified as either the third or fourth argument,"," and this function will be called after the new `view` becomes the"," `activeView`, is rendered to the `viewContainer`, and is ready to use.",""," @example"," var app = new Y.App({"," views: {"," usersView: {"," // Imagine that `Y.UsersView` has been defined."," type: Y.UsersView"," }"," },",""," transitions: true,"," users : new Y.ModelList()"," });",""," app.route('/users/', function () {"," this.showView('usersView', {users: this.get('users')});"," });",""," app.render();"," app.navigate('/uses/');"," // => Creates a new `Y.UsersView` and transitions to it.",""," @method showView"," @param {String|View} view The name of a view defined in the `views` object,"," or a view instance which should become this app's `activeView`."," @param {Object} [config] Optional configuration to use when creating a new"," view instance. This config object can also be used to update an existing"," or preserved view's attributes when `options.update` is `true`."," @param {Object} [options] Optional object containing any of the following"," properties:"," @param {Function} [options.callback] Optional callback function to call"," after new `activeView` is ready to use, the function will be passed:"," @param {View} options.callback.view A reference to the new"," `activeView`."," @param {Boolean} [options.prepend=false] Whether the `view` should be"," prepended instead of appended to the `viewContainer`."," @param {Boolean} [options.render] Whether the `view` should be rendered."," **Note:** If no value is specified, a view instance will only be"," rendered if it's newly created by this method."," @param {Boolean|String} [options.transition] Optional transition override."," A transition can be specified which will override the default, or"," `false` for no transition."," @param {Boolean} [options.update=false] Whether an existing view should"," have its attributes updated by passing the `config` object to its"," `setAttrs()` method. **Note:** This option does not have an effect if"," the `view` instance is created as a result of calling this method."," @param {Function} [callback] Optional callback Function to call after the"," new `activeView` is ready to use. **Note:** this will override"," `options.callback` and it can be specified as either the third or fourth"," argument. The function will be passed the following:"," @param {View} callback.view A reference to the new `activeView`."," @chainable"," @since 3.5.0"," **/"," // Does not override `showView()` but does use `options.transitions`.",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Setter for `transitions` attribute.",""," When specified as `true`, the defaults will be use as specified by the"," `transitions` prototype property.",""," @method _setTransitions"," @param {Boolean|Object} transitions The new `transitions` attribute value."," @return {Mixed} The processed value which represents the new state."," @protected"," @see App.Base.showView()"," @since 3.5.0"," **/"," _setTransitions: function (transitions) {"," var defTransitions = this.transitions;",""," if (transitions && transitions === true) {"," return Y.merge(defTransitions);"," }",""," return transitions;"," }","};","","// -- Namespace ----------------------------------------------------------------","Y.App.Transitions = AppTransitions;","Y.Base.mix(Y.App, [AppTransitions]);","","Y.mix(Y.App.CLASS_NAMES, {"," transitioning: Y.ClassNameManager.getClassName('app', 'transitioning')","});","","","}, '3.7.3', {\"requires\": [\"app-base\"]});"]; _yuitest_coverage["build/app-transitions/app-transitions.js"].lines = {"1":0,"40":0,"42":0,"76":0,"93":0,"223":0,"225":0,"226":0,"229":0,"234":0,"235":0,"237":0}; _yuitest_coverage["build/app-transitions/app-transitions.js"].functions = {"AppTransitions:40":0,"_setTransitions:222":0,"(anonymous 1):1":0}; _yuitest_coverage["build/app-transitions/app-transitions.js"].coveredLines = 12;@@ -292,4 +292,4 @@ }); -}, '3.7.2', {"requires": ["app-base"]});+}, '3.7.3', {"requires": ["app-base"]});
bundle/app-transitions/app-transitions-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -245,4 +245,4 @@ }); -}, '3.7.2', {"requires": ["app-base"]});+}, '3.7.3', {"requires": ["app-base"]});
bundle/app-transitions/app-transitions-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("app-transitions",function(e,t){function n(){}n.ATTRS={transitions:{setter:"_setTransitions",value:!1}},n.FX={fade:{viewIn:"app:fadeIn",viewOut:"app:fadeOut"},slideLeft:{viewIn:"app:slideLeft",viewOut:"app:slideLeft"},slideRight:{viewIn:"app:slideRight",viewOut:"app:slideRight"}},n.prototype={transitions:{navigate:"fade",toChild:"slideLeft",toParent:"slideRight"},_setTransitions:function(t){var n=this.transitions;return t&&t===!0?e.merge(n):t}},e.App.Transitions=n,e.Base.mix(e.App,[n]),e.mix(e.App.CLASS_NAMES,{transitioning:e.ClassNameManager.getClassName("app","transitioning")})},"3.7.2",{requires:["app-base"]});+YUI.add("app-transitions",function(e,t){function n(){}n.ATTRS={transitions:{setter:"_setTransitions",value:!1}},n.FX={fade:{viewIn:"app:fadeIn",viewOut:"app:fadeOut"},slideLeft:{viewIn:"app:slideLeft",viewOut:"app:slideLeft"},slideRight:{viewIn:"app:slideRight",viewOut:"app:slideRight"}},n.prototype={transitions:{navigate:"fade",toChild:"slideLeft",toParent:"slideRight"},_setTransitions:function(t){var n=this.transitions;return t&&t===!0?e.merge(n):t}},e.App.Transitions=n,e.Base.mix(e.App,[n]),e.mix(e.App.CLASS_NAMES,{transitioning:e.ClassNameManager.getClassName("app","transitioning")})},"3.7.3",{requires:["app-base"]});
bundle/app-transitions/app-transitions.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -245,4 +245,4 @@ }); -}, '3.7.2', {"requires": ["app-base"]});+}, '3.7.3', {"requires": ["app-base"]});
bundle/array-extras/array-extras-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/array-extras/array-extras.js", code: [] };-_yuitest_coverage["build/array-extras/array-extras.js"].code=["YUI.add('array-extras', function (Y, NAME) {","","/**","Adds additional utility methods to the `Y.Array` class.","","@module collection","@submodule array-extras","**/","","var A = Y.Array,"," L = Y.Lang,"," ArrayProto = Array.prototype;","","/**","Returns the index of the last item in the array that contains the specified","value, or `-1` if the value isn't found.","","@method lastIndexOf","@param {Array} a Array to search in.","@param {Any} val Value to search for.","@param {Number} [fromIndex] Index at which to start searching backwards."," Defaults to the array's length - 1. If negative, it will be taken as an offset"," from the end of the array. If the calculated index is less than 0, the array"," will not be searched and `-1` will be returned.","@return {Number} Index of the item that contains the value, or `-1` if not"," found.","@static","@for Array","**/","A.lastIndexOf = L._isNative(ArrayProto.lastIndexOf) ?"," function(a, val, fromIndex) {"," // An undefined fromIndex is still considered a value by some (all?)"," // native implementations, so we can't pass it unless it's actually"," // specified."," return fromIndex || fromIndex === 0 ? a.lastIndexOf(val, fromIndex) :"," a.lastIndexOf(val);"," } :"," function(a, val, fromIndex) {"," var len = a.length,"," i = len - 1;",""," if (fromIndex || fromIndex === 0) {"," i = Math.min(fromIndex < 0 ? len + fromIndex : fromIndex, len);"," }",""," if (i > -1 && len > 0) {"," for (; i > -1; --i) {"," if (i in a && a[i] === val) {"," return i;"," }"," }"," }",""," return -1;"," };","","/**","Returns a copy of the input array with duplicate items removed.","","Note: If the input array only contains strings, the `Y.Array.dedupe()` method is","a much faster alternative.","","@method unique","@param {Array} array Array to dedupe.","@param {Function} [testFn] Custom function to use to test the equality of two"," values. A truthy return value indicates that the values are equal. A falsy"," return value indicates that the values are not equal.",""," @param {Any} testFn.a First value to compare."," @param {Any} testFn.b Second value to compare."," @param {Number} testFn.index Index of the current item in the original"," array."," @param {Array} testFn.array The original array."," @return {Boolean} _true_ if the items are equal, _false_ otherwise.","","@return {Array} Copy of the input array with duplicate items removed.","@static","**/","A.unique = function (array, testFn) {"," var i = 0,"," len = array.length,"," results = [],"," j, result, resultLen, value;",""," // Note the label here. It's used to jump out of the inner loop when a value"," // is not unique."," outerLoop: for (; i < len; i++) {"," value = array[i];",""," // For each value in the input array, iterate through the result array"," // and check for uniqueness against each result value."," for (j = 0, resultLen = results.length; j < resultLen; j++) {"," result = results[j];",""," // If the test function returns true or there's no test function and"," // the value equals the current result item, stop iterating over the"," // results and continue to the next value in the input array."," if (testFn) {"," if (testFn.call(array, value, result, i, array)) {"," continue outerLoop;"," }"," } else if (value === result) {"," continue outerLoop;"," }"," }",""," // If we get this far, that means the current value is not already in"," // the result array, so add it."," results.push(value);"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. Returns a new array","containing the items for which the supplied function returned a truthy value.","","@method filter","@param {Array} a Array to filter.","@param {Function} f Function to execute on each item.","@param {Object} [o] Optional context object.","@return {Array} Array of items for which the supplied function returned a"," truthy value (empty if it never returned a truthy value).","@static","*/","A.filter = L._isNative(ArrayProto.filter) ?"," function(a, f, o) {"," return ArrayProto.filter.call(a, f, o);"," } :"," function(a, f, o) {"," var i = 0,"," len = a.length,"," results = [],"," item;",""," for (; i < len; ++i) {"," if (i in a) {"," item = a[i];",""," if (f.call(o, item, i, a)) {"," results.push(item);"," }"," }"," }",""," return results;"," };","","/**","The inverse of `Array.filter()`. Executes the supplied function on each item.","Returns a new array containing the items for which the supplied function","returned `false`.","","@method reject","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {object} [o] Optional context object.","@return {Array} The items for which the supplied function returned `false`.","@static","*/","A.reject = function(a, f, o) {"," return A.filter(a, function(item, i, a) {"," return !f.call(o, item, i, a);"," });","};","","/**","Executes the supplied function on each item in the array. Iteration stops if the","supplied function does not return a truthy value.","","@method every","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {Object} [o] Optional context object.","@return {Boolean} `true` if every item in the array returns `true` from the"," supplied function, `false` otherwise.","@static","*/","A.every = L._isNative(ArrayProto.every) ?"," function(a, f, o) {"," return ArrayProto.every.call(a, f, o);"," } :"," function(a, f, o) {"," for (var i = 0, l = a.length; i < l; ++i) {"," if (i in a && !f.call(o, a[i], i, a)) {"," return false;"," }"," }",""," return true;"," };","","/**","Executes the supplied function on each item in the array and returns a new array","containing all the values returned by the supplied function.","","@example",""," // Convert an array of numbers into an array of strings."," Y.Array.map([1, 2, 3, 4], function (item) {"," return '' + item;"," });"," // => ['1', '2', '3', '4']","","@method map","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {object} [o] Optional context object.","@return {Array} A new array containing the return value of the supplied function"," for each item in the original array.","@static","*/","A.map = L._isNative(ArrayProto.map) ?"," function(a, f, o) {"," return ArrayProto.map.call(a, f, o);"," } :"," function(a, f, o) {"," var i = 0,"," len = a.length,"," results = ArrayProto.concat.call(a);",""," for (; i < len; ++i) {"," if (i in a) {"," results[i] = f.call(o, a[i], i, a);"," }"," }",""," return results;"," };","","","/**","Executes the supplied function on each item in the array, \"folding\" the array","into a single value.","","@method reduce","@param {Array} a Array to iterate.","@param {Any} init Initial value to start with.","@param {Function} f Function to execute on each item. This function should"," update and return the value of the computation. It will receive the following"," arguments:"," @param {Any} f.previousValue Value returned from the previous iteration,"," or the initial value if this is the first iteration."," @param {Any} f.currentValue Value of the current item being iterated."," @param {Number} f.index Index of the current item."," @param {Array} f.array Array being iterated.","@param {Object} [o] Optional context object.","@return {Any} Final result from iteratively applying the given function to each"," element in the array.","@static","*/","A.reduce = L._isNative(ArrayProto.reduce) ?"," function(a, init, f, o) {"," // ES5 Array.reduce doesn't support a thisObject, so we need to"," // implement it manually."," return ArrayProto.reduce.call(a, function(init, item, i, a) {"," return f.call(o, init, item, i, a);"," }, init);"," } :"," function(a, init, f, o) {"," var i = 0,"," len = a.length,"," result = init;",""," for (; i < len; ++i) {"," if (i in a) {"," result = f.call(o, result, a[i], i, a);"," }"," }",""," return result;"," };","","/**","Executes the supplied function on each item in the array, searching for the","first item that matches the supplied function.","","@method find","@param {Array} a the array to search.","@param {Function} f the function to execute on each item. Iteration is stopped"," as soon as this function returns `true`.","@param {Object} [o] Optional context object.","@return {Object} the first item that the supplied function returns `true` for,"," or `null` if it never returns `true`.","@static","*/","A.find = function(a, f, o) {"," for (var i = 0, l = a.length; i < l; i++) {"," if (i in a && f.call(o, a[i], i, a)) {"," return a[i];"," }"," }"," return null;","};","","/**","Iterates over an array, returning a new array of all the elements that match the","supplied regular expression.","","@method grep","@param {Array} a Array to iterate over.","@param {RegExp} pattern Regular expression to test against each item.","@return {Array} All the items in the array that produce a match against the"," supplied regular expression. If no items match, an empty array is returned.","@static","*/","A.grep = function(a, pattern) {"," return A.filter(a, function(item, index) {"," return pattern.test(item);"," });","};","","/**","Partitions an array into two new arrays, one with the items for which the","supplied function returns `true`, and one with the items for which the function","returns `false`.","","@method partition","@param {Array} a Array to iterate over.","@param {Function} f Function to execute for each item in the array. It will"," receive the following arguments:"," @param {Any} f.item Current item."," @param {Number} f.index Index of the current item."," @param {Array} f.array The array being iterated.","@param {Object} [o] Optional execution context.","@return {Object} An object with two properties: `matches` and `rejects`. Each is"," an array containing the items that were selected or rejected by the test"," function (or an empty array if none).","@static","*/","A.partition = function(a, f, o) {"," var results = {"," matches: [],"," rejects: []"," };",""," A.each(a, function(item, index) {"," var set = f.call(o, item, index, a) ? results.matches : results.rejects;"," set.push(item);"," });",""," return results;","};","","/**","Creates an array of arrays by pairing the corresponding elements of two arrays","together into a new array.","","@method zip","@param {Array} a Array to iterate over.","@param {Array} a2 Another array whose values will be paired with values of the"," first array.","@return {Array} An array of arrays formed by pairing each element of the first"," array with an item in the second array having the corresponding index.","@static","*/","A.zip = function(a, a2) {"," var results = [];"," A.each(a, function(item, index) {"," results.push([item, a2[index]]);"," });"," return results;","};","","/**","Flattens an array of nested arrays at any abitrary depth into a single, flat","array.","","@method flatten","@param {Array} a Array with nested arrays to flatten.","@return {Array} An array whose nested arrays have been flattened.","@static","@since 3.7.0","**/","A.flatten = function(a) {"," var result = [],"," i, len, val;",""," // Always return an array."," if (!a) {"," return result;"," }",""," for (i = 0, len = a.length; i < len; ++i) {"," val = a[i];",""," if (L.isArray(val)) {"," // Recusively flattens any nested arrays."," result.push.apply(result, A.flatten(val));"," } else {"," result.push(val);"," }"," }",""," return result;","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/array-extras/array-extras.js"].code=["YUI.add('array-extras', function (Y, NAME) {","","/**","Adds additional utility methods to the `Y.Array` class.","","@module collection","@submodule array-extras","**/","","var A = Y.Array,"," L = Y.Lang,"," ArrayProto = Array.prototype;","","/**","Returns the index of the last item in the array that contains the specified","value, or `-1` if the value isn't found.","","@method lastIndexOf","@param {Array} a Array to search in.","@param {Any} val Value to search for.","@param {Number} [fromIndex] Index at which to start searching backwards."," Defaults to the array's length - 1. If negative, it will be taken as an offset"," from the end of the array. If the calculated index is less than 0, the array"," will not be searched and `-1` will be returned.","@return {Number} Index of the item that contains the value, or `-1` if not"," found.","@static","@for Array","**/","A.lastIndexOf = L._isNative(ArrayProto.lastIndexOf) ?"," function(a, val, fromIndex) {"," // An undefined fromIndex is still considered a value by some (all?)"," // native implementations, so we can't pass it unless it's actually"," // specified."," return fromIndex || fromIndex === 0 ? a.lastIndexOf(val, fromIndex) :"," a.lastIndexOf(val);"," } :"," function(a, val, fromIndex) {"," var len = a.length,"," i = len - 1;",""," if (fromIndex || fromIndex === 0) {"," i = Math.min(fromIndex < 0 ? len + fromIndex : fromIndex, len);"," }",""," if (i > -1 && len > 0) {"," for (; i > -1; --i) {"," if (i in a && a[i] === val) {"," return i;"," }"," }"," }",""," return -1;"," };","","/**","Returns a copy of the input array with duplicate items removed.","","Note: If the input array only contains strings, the `Y.Array.dedupe()` method is","a much faster alternative.","","@method unique","@param {Array} array Array to dedupe.","@param {Function} [testFn] Custom function to use to test the equality of two"," values. A truthy return value indicates that the values are equal. A falsy"," return value indicates that the values are not equal.",""," @param {Any} testFn.a First value to compare."," @param {Any} testFn.b Second value to compare."," @param {Number} testFn.index Index of the current item in the original"," array."," @param {Array} testFn.array The original array."," @return {Boolean} _true_ if the items are equal, _false_ otherwise.","","@return {Array} Copy of the input array with duplicate items removed.","@static","**/","A.unique = function (array, testFn) {"," var i = 0,"," len = array.length,"," results = [],"," j, result, resultLen, value;",""," // Note the label here. It's used to jump out of the inner loop when a value"," // is not unique."," outerLoop: for (; i < len; i++) {"," value = array[i];",""," // For each value in the input array, iterate through the result array"," // and check for uniqueness against each result value."," for (j = 0, resultLen = results.length; j < resultLen; j++) {"," result = results[j];",""," // If the test function returns true or there's no test function and"," // the value equals the current result item, stop iterating over the"," // results and continue to the next value in the input array."," if (testFn) {"," if (testFn.call(array, value, result, i, array)) {"," continue outerLoop;"," }"," } else if (value === result) {"," continue outerLoop;"," }"," }",""," // If we get this far, that means the current value is not already in"," // the result array, so add it."," results.push(value);"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. Returns a new array","containing the items for which the supplied function returned a truthy value.","","@method filter","@param {Array} a Array to filter.","@param {Function} f Function to execute on each item.","@param {Object} [o] Optional context object.","@return {Array} Array of items for which the supplied function returned a"," truthy value (empty if it never returned a truthy value).","@static","*/","A.filter = L._isNative(ArrayProto.filter) ?"," function(a, f, o) {"," return ArrayProto.filter.call(a, f, o);"," } :"," function(a, f, o) {"," var i = 0,"," len = a.length,"," results = [],"," item;",""," for (; i < len; ++i) {"," if (i in a) {"," item = a[i];",""," if (f.call(o, item, i, a)) {"," results.push(item);"," }"," }"," }",""," return results;"," };","","/**","The inverse of `Array.filter()`. Executes the supplied function on each item.","Returns a new array containing the items for which the supplied function","returned `false`.","","@method reject","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {object} [o] Optional context object.","@return {Array} The items for which the supplied function returned `false`.","@static","*/","A.reject = function(a, f, o) {"," return A.filter(a, function(item, i, a) {"," return !f.call(o, item, i, a);"," });","};","","/**","Executes the supplied function on each item in the array. Iteration stops if the","supplied function does not return a truthy value.","","@method every","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {Object} [o] Optional context object.","@return {Boolean} `true` if every item in the array returns `true` from the"," supplied function, `false` otherwise.","@static","*/","A.every = L._isNative(ArrayProto.every) ?"," function(a, f, o) {"," return ArrayProto.every.call(a, f, o);"," } :"," function(a, f, o) {"," for (var i = 0, l = a.length; i < l; ++i) {"," if (i in a && !f.call(o, a[i], i, a)) {"," return false;"," }"," }",""," return true;"," };","","/**","Executes the supplied function on each item in the array and returns a new array","containing all the values returned by the supplied function.","","@example",""," // Convert an array of numbers into an array of strings."," Y.Array.map([1, 2, 3, 4], function (item) {"," return '' + item;"," });"," // => ['1', '2', '3', '4']","","@method map","@param {Array} a the array to iterate.","@param {Function} f the function to execute on each item.","@param {object} [o] Optional context object.","@return {Array} A new array containing the return value of the supplied function"," for each item in the original array.","@static","*/","A.map = L._isNative(ArrayProto.map) ?"," function(a, f, o) {"," return ArrayProto.map.call(a, f, o);"," } :"," function(a, f, o) {"," var i = 0,"," len = a.length,"," results = ArrayProto.concat.call(a);",""," for (; i < len; ++i) {"," if (i in a) {"," results[i] = f.call(o, a[i], i, a);"," }"," }",""," return results;"," };","","","/**","Executes the supplied function on each item in the array, \"folding\" the array","into a single value.","","@method reduce","@param {Array} a Array to iterate.","@param {Any} init Initial value to start with.","@param {Function} f Function to execute on each item. This function should"," update and return the value of the computation. It will receive the following"," arguments:"," @param {Any} f.previousValue Value returned from the previous iteration,"," or the initial value if this is the first iteration."," @param {Any} f.currentValue Value of the current item being iterated."," @param {Number} f.index Index of the current item."," @param {Array} f.array Array being iterated.","@param {Object} [o] Optional context object.","@return {Any} Final result from iteratively applying the given function to each"," element in the array.","@static","*/","A.reduce = L._isNative(ArrayProto.reduce) ?"," function(a, init, f, o) {"," // ES5 Array.reduce doesn't support a thisObject, so we need to"," // implement it manually."," return ArrayProto.reduce.call(a, function(init, item, i, a) {"," return f.call(o, init, item, i, a);"," }, init);"," } :"," function(a, init, f, o) {"," var i = 0,"," len = a.length,"," result = init;",""," for (; i < len; ++i) {"," if (i in a) {"," result = f.call(o, result, a[i], i, a);"," }"," }",""," return result;"," };","","/**","Executes the supplied function on each item in the array, searching for the","first item that matches the supplied function.","","@method find","@param {Array} a the array to search.","@param {Function} f the function to execute on each item. Iteration is stopped"," as soon as this function returns `true`.","@param {Object} [o] Optional context object.","@return {Object} the first item that the supplied function returns `true` for,"," or `null` if it never returns `true`.","@static","*/","A.find = function(a, f, o) {"," for (var i = 0, l = a.length; i < l; i++) {"," if (i in a && f.call(o, a[i], i, a)) {"," return a[i];"," }"," }"," return null;","};","","/**","Iterates over an array, returning a new array of all the elements that match the","supplied regular expression.","","@method grep","@param {Array} a Array to iterate over.","@param {RegExp} pattern Regular expression to test against each item.","@return {Array} All the items in the array that produce a match against the"," supplied regular expression. If no items match, an empty array is returned.","@static","*/","A.grep = function(a, pattern) {"," return A.filter(a, function(item, index) {"," return pattern.test(item);"," });","};","","/**","Partitions an array into two new arrays, one with the items for which the","supplied function returns `true`, and one with the items for which the function","returns `false`.","","@method partition","@param {Array} a Array to iterate over.","@param {Function} f Function to execute for each item in the array. It will"," receive the following arguments:"," @param {Any} f.item Current item."," @param {Number} f.index Index of the current item."," @param {Array} f.array The array being iterated.","@param {Object} [o] Optional execution context.","@return {Object} An object with two properties: `matches` and `rejects`. Each is"," an array containing the items that were selected or rejected by the test"," function (or an empty array if none).","@static","*/","A.partition = function(a, f, o) {"," var results = {"," matches: [],"," rejects: []"," };",""," A.each(a, function(item, index) {"," var set = f.call(o, item, index, a) ? results.matches : results.rejects;"," set.push(item);"," });",""," return results;","};","","/**","Creates an array of arrays by pairing the corresponding elements of two arrays","together into a new array.","","@method zip","@param {Array} a Array to iterate over.","@param {Array} a2 Another array whose values will be paired with values of the"," first array.","@return {Array} An array of arrays formed by pairing each element of the first"," array with an item in the second array having the corresponding index.","@static","*/","A.zip = function(a, a2) {"," var results = [];"," A.each(a, function(item, index) {"," results.push([item, a2[index]]);"," });"," return results;","};","","/**","Flattens an array of nested arrays at any abitrary depth into a single, flat","array.","","@method flatten","@param {Array} a Array with nested arrays to flatten.","@return {Array} An array whose nested arrays have been flattened.","@static","@since 3.7.0","**/","A.flatten = function(a) {"," var result = [],"," i, len, val;",""," // Always return an array."," if (!a) {"," return result;"," }",""," for (i = 0, len = a.length; i < len; ++i) {"," val = a[i];",""," if (L.isArray(val)) {"," // Recusively flattens any nested arrays."," result.push.apply(result, A.flatten(val));"," } else {"," result.push(val);"," }"," }",""," return result;","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/array-extras/array-extras.js"].lines = {"1":0,"10":0,"30":0,"35":0,"39":0,"42":0,"43":0,"46":0,"47":0,"48":0,"49":0,"54":0,"79":0,"80":0,"87":0,"88":0,"92":0,"93":0,"98":0,"99":0,"100":0,"102":0,"103":0,"109":0,"112":0,"127":0,"129":0,"132":0,"137":0,"138":0,"139":0,"141":0,"142":0,"147":0,"162":0,"163":0,"164":0,"180":0,"182":0,"185":0,"186":0,"187":0,"191":0,"214":0,"216":0,"219":0,"223":0,"224":0,"225":0,"229":0,"253":0,"257":0,"258":0,"262":0,"266":0,"267":0,"268":0,"272":0,"288":0,"289":0,"290":0,"291":0,"294":0,"308":0,"309":0,"310":0,"332":0,"333":0,"338":0,"339":0,"340":0,"343":0,"358":0,"359":0,"360":0,"361":0,"363":0,"376":0,"377":0,"381":0,"382":0,"385":0,"386":0,"388":0,"390":0,"392":0,"396":0}; _yuitest_coverage["build/array-extras/array-extras.js"].functions = {"(anonymous 2):31":0,"}:38":0,"unique:79":0,"(anonymous 3):128":0,"}:131":0,"(anonymous 4):163":0,"reject:162":0,"(anonymous 5):181":0,"}:184":0,"(anonymous 6):215":0,"}:218":0,"(anonymous 8):257":0,"(anonymous 7):254":0,"}:261":0,"find:288":0,"(anonymous 9):309":0,"grep:308":0,"(anonymous 10):338":0,"partition:332":0,"(anonymous 11):360":0,"zip:358":0,"flatten:376":0,"(anonymous 1):1":0}; _yuitest_coverage["build/array-extras/array-extras.js"].coveredLines = 87;@@ -546,4 +546,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/array-extras/array-extras-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -403,4 +403,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/array-extras/array-extras-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("array-extras",function(e,t){var n=e.Array,r=e.Lang,i=Array.prototype;n.lastIndexOf=r._isNative(i.lastIndexOf)?function(e,t,n){return n||n===0?e.lastIndexOf(t,n):e.lastIndexOf(t)}:function(e,t,n){var r=e.length,i=r-1;if(n||n===0)i=Math.min(n<0?r+n:n,r);if(i>-1&&r>0)for(;i>-1;--i)if(i in e&&e[i]===t)return i;return-1},n.unique=function(e,t){var n=0,r=e.length,i=[],s,o,u,a;e:for(;n<r;n++){a=e[n];for(s=0,u=i.length;s<u;s++){o=i[s];if(t){if(t.call(e,a,o,n,e))continue e}else if(a===o)continue e}i.push(a)}return i},n.filter=r._isNative(i.filter)?function(e,t,n){return i.filter.call(e,t,n)}:function(e,t,n){var r=0,i=e.length,s=[],o;for(;r<i;++r)r in e&&(o=e[r],t.call(n,o,r,e)&&s.push(o));return s},n.reject=function(e,t,r){return n.filter(e,function(e,n,i){return!t.call(r,e,n,i)})},n.every=r._isNative(i.every)?function(e,t,n){return i.every.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&!t.call(n,e[r],r,e))return!1;return!0},n.map=r._isNative(i.map)?function(e,t,n){return i.map.call(e,t,n)}:function(e,t,n){var r=0,s=e.length,o=i.concat.call(e);for(;r<s;++r)r in e&&(o[r]=t.call(n,e[r],r,e));return o},n.reduce=r._isNative(i.reduce)?function(e,t,n,r){return i.reduce.call(e,function(e,t,i,s){return n.call(r,e,t,i,s)},t)}:function(e,t,n,r){var i=0,s=e.length,o=t;for(;i<s;++i)i in e&&(o=n.call(r,o,e[i],i,e));return o},n.find=function(e,t,n){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e))return e[r];return null},n.grep=function(e,t){return n.filter(e,function(e,n){return t.test(e)})},n.partition=function(e,t,r){var i={matches:[],rejects:[]};return n.each(e,function(n,s){var u=t.call(r,n,s,e)?i.matches:i.rejects;u.push(n)}),i},n.zip=function(e,t){var r=[];return n.each(e,function(e,n){r.push([e,t[n]])}),r},n.flatten=function(e){var t=[],i,s,o;if(!e)return t;for(i=0,s=e.length;i<s;++i)o=e[i],r.isArray(o)?t.push.apply(t,n.flatten(o)):t.push(o);return t}},"3.7.2",{requires:["yui-base"]});+YUI.add("array-extras",function(e,t){var n=e.Array,r=e.Lang,i=Array.prototype;n.lastIndexOf=r._isNative(i.lastIndexOf)?function(e,t,n){return n||n===0?e.lastIndexOf(t,n):e.lastIndexOf(t)}:function(e,t,n){var r=e.length,i=r-1;if(n||n===0)i=Math.min(n<0?r+n:n,r);if(i>-1&&r>0)for(;i>-1;--i)if(i in e&&e[i]===t)return i;return-1},n.unique=function(e,t){var n=0,r=e.length,i=[],s,o,u,a;e:for(;n<r;n++){a=e[n];for(s=0,u=i.length;s<u;s++){o=i[s];if(t){if(t.call(e,a,o,n,e))continue e}else if(a===o)continue e}i.push(a)}return i},n.filter=r._isNative(i.filter)?function(e,t,n){return i.filter.call(e,t,n)}:function(e,t,n){var r=0,i=e.length,s=[],o;for(;r<i;++r)r in e&&(o=e[r],t.call(n,o,r,e)&&s.push(o));return s},n.reject=function(e,t,r){return n.filter(e,function(e,n,i){return!t.call(r,e,n,i)})},n.every=r._isNative(i.every)?function(e,t,n){return i.every.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&!t.call(n,e[r],r,e))return!1;return!0},n.map=r._isNative(i.map)?function(e,t,n){return i.map.call(e,t,n)}:function(e,t,n){var r=0,s=e.length,o=i.concat.call(e);for(;r<s;++r)r in e&&(o[r]=t.call(n,e[r],r,e));return o},n.reduce=r._isNative(i.reduce)?function(e,t,n,r){return i.reduce.call(e,function(e,t,i,s){return n.call(r,e,t,i,s)},t)}:function(e,t,n,r){var i=0,s=e.length,o=t;for(;i<s;++i)i in e&&(o=n.call(r,o,e[i],i,e));return o},n.find=function(e,t,n){for(var r=0,i=e.length;r<i;r++)if(r in e&&t.call(n,e[r],r,e))return e[r];return null},n.grep=function(e,t){return n.filter(e,function(e,n){return t.test(e)})},n.partition=function(e,t,r){var i={matches:[],rejects:[]};return n.each(e,function(n,s){var u=t.call(r,n,s,e)?i.matches:i.rejects;u.push(n)}),i},n.zip=function(e,t){var r=[];return n.each(e,function(e,n){r.push([e,t[n]])}),r},n.flatten=function(e){var t=[],i,s,o;if(!e)return t;for(i=0,s=e.length;i<s;++i)o=e[i],r.isArray(o)?t.push.apply(t,n.flatten(o)):t.push(o);return t}},"3.7.3",{requires:["yui-base"]});
bundle/array-extras/array-extras.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -403,4 +403,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/array-invoke/array-invoke-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/array-invoke/array-invoke.js", code: [] };-_yuitest_coverage["build/array-invoke/array-invoke.js"].code=["YUI.add('array-invoke', function (Y, NAME) {","","/**","@module collection","@submodule array-invoke","*/","","/**","Executes a named method on each item in an array of objects. Items in the array","that do not have a function by that name will be skipped.","","@example",""," Y.Array.invoke(arrayOfDrags, 'plug', Y.Plugin.DDProxy);","","@method invoke","@param {Array} items Array of objects supporting the named method.","@param {String} name the name of the method to execute on each item.","@param {Any} [args*] Any number of additional args are passed as parameters to"," the execution of the named method.","@return {Array} All return values, indexed according to the item index.","@static","@for Array","**/","Y.Array.invoke = function(items, name) {"," var args = Y.Array(arguments, 2, true),"," isFunction = Y.Lang.isFunction,"," ret = [];",""," Y.Array.each(Y.Array(items), function(item, i) {"," if (item && isFunction(item[name])) {"," ret[i] = item[name].apply(item, args);"," }"," });",""," return ret;","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/array-invoke/array-invoke.js"].code=["YUI.add('array-invoke', function (Y, NAME) {","","/**","@module collection","@submodule array-invoke","*/","","/**","Executes a named method on each item in an array of objects. Items in the array","that do not have a function by that name will be skipped.","","@example",""," Y.Array.invoke(arrayOfDrags, 'plug', Y.Plugin.DDProxy);","","@method invoke","@param {Array} items Array of objects supporting the named method.","@param {String} name the name of the method to execute on each item.","@param {Any} [args*] Any number of additional args are passed as parameters to"," the execution of the named method.","@return {Array} All return values, indexed according to the item index.","@static","@for Array","**/","Y.Array.invoke = function(items, name) {"," var args = Y.Array(arguments, 2, true),"," isFunction = Y.Lang.isFunction,"," ret = [];",""," Y.Array.each(Y.Array(items), function(item, i) {"," if (item && isFunction(item[name])) {"," ret[i] = item[name].apply(item, args);"," }"," });",""," return ret;","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/array-invoke/array-invoke.js"].lines = {"1":0,"25":0,"26":0,"30":0,"31":0,"32":0,"36":0}; _yuitest_coverage["build/array-invoke/array-invoke.js"].functions = {"(anonymous 2):30":0,"invoke:25":0,"(anonymous 1):1":0}; _yuitest_coverage["build/array-invoke/array-invoke.js"].coveredLines = 7;@@ -86,4 +86,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/array-invoke/array-invoke-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -43,4 +43,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/array-invoke/array-invoke-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("array-invoke",function(e,t){e.Array.invoke=function(t,n){var r=e.Array(arguments,2,!0),i=e.Lang.isFunction,s=[];return e.Array.each(e.Array(t),function(e,t){e&&i(e[n])&&(s[t]=e[n].apply(e,r))}),s}},"3.7.2",{requires:["yui-base"]});+YUI.add("array-invoke",function(e,t){e.Array.invoke=function(t,n){var r=e.Array(arguments,2,!0),i=e.Lang.isFunction,s=[];return e.Array.each(e.Array(t),function(e,t){e&&i(e[n])&&(s[t]=e[n].apply(e,r))}),s}},"3.7.3",{requires:["yui-base"]});
bundle/array-invoke/array-invoke.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -43,4 +43,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/arraylist-add/arraylist-add-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/arraylist-add/arraylist-add.js", code: [] };-_yuitest_coverage["build/arraylist-add/arraylist-add.js"].code=["YUI.add('arraylist-add', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist-add"," * @deprecated Use ModelList or a custom ArrayList subclass"," */","","/*"," * Adds methods add and remove to Y.ArrayList"," */","Y.mix(Y.ArrayList.prototype, {",""," /**"," * Add a single item to the ArrayList. Does not prevent duplicates."," *"," * @method add"," * @param { mixed } item Item presumably of the same type as others in the"," * ArrayList."," * @param {Number} index (Optional.) Number representing the position at"," * which the item should be inserted."," * @return {ArrayList} the instance."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," * @chainable"," */"," add: function(item, index) {"," var items = this._items;",""," if (Y.Lang.isNumber(index)) {"," items.splice(index, 0, item);"," }"," else {"," items.push(item);"," }",""," return this;"," },",""," /**"," * Removes first or all occurrences of an item to the ArrayList. If a"," * comparator is not provided, uses itemsAreEqual method to determine"," * matches."," *"," * @method remove"," * @param { mixed } needle Item to find and remove from the list."," * @param { Boolean } all If true, remove all occurrences."," * @param { Function } comparator optional a/b function to test equivalence."," * @return {ArrayList} the instance."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," * @chainable"," */"," remove: function(needle, all, comparator) {"," comparator = comparator || this.itemsAreEqual;",""," for (var i = this._items.length - 1; i >= 0; --i) {"," if (comparator.call(this, needle, this.item(i))) {"," this._items.splice(i, 1);"," if (!all) {"," break;"," }"," }"," }",""," return this;"," },",""," /**"," * Default comparator for items stored in this list. Used by remove()."," *"," * @method itemsAreEqual"," * @param { mixed } a item to test equivalence with."," * @param { mixed } b other item to test equivalance."," * @return { Boolean } true if items are deemed equivalent."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," */"," itemsAreEqual: function(a, b) {"," return a === b;"," }","","});","","","}, '3.7.2', {\"requires\": [\"arraylist\"]});"];+_yuitest_coverage["build/arraylist-add/arraylist-add.js"].code=["YUI.add('arraylist-add', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist-add"," * @deprecated Use ModelList or a custom ArrayList subclass"," */","","/*"," * Adds methods add and remove to Y.ArrayList"," */","Y.mix(Y.ArrayList.prototype, {",""," /**"," * Add a single item to the ArrayList. Does not prevent duplicates."," *"," * @method add"," * @param { mixed } item Item presumably of the same type as others in the"," * ArrayList."," * @param {Number} index (Optional.) Number representing the position at"," * which the item should be inserted."," * @return {ArrayList} the instance."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," * @chainable"," */"," add: function(item, index) {"," var items = this._items;",""," if (Y.Lang.isNumber(index)) {"," items.splice(index, 0, item);"," }"," else {"," items.push(item);"," }",""," return this;"," },",""," /**"," * Removes first or all occurrences of an item to the ArrayList. If a"," * comparator is not provided, uses itemsAreEqual method to determine"," * matches."," *"," * @method remove"," * @param { mixed } needle Item to find and remove from the list."," * @param { Boolean } all If true, remove all occurrences."," * @param { Function } comparator optional a/b function to test equivalence."," * @return {ArrayList} the instance."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," * @chainable"," */"," remove: function(needle, all, comparator) {"," comparator = comparator || this.itemsAreEqual;",""," for (var i = this._items.length - 1; i >= 0; --i) {"," if (comparator.call(this, needle, this.item(i))) {"," this._items.splice(i, 1);"," if (!all) {"," break;"," }"," }"," }",""," return this;"," },",""," /**"," * Default comparator for items stored in this list. Used by remove()."," *"," * @method itemsAreEqual"," * @param { mixed } a item to test equivalence with."," * @param { mixed } b other item to test equivalance."," * @return { Boolean } true if items are deemed equivalent."," * @for ArrayList"," * @deprecated Use ModelList or a custom ArrayList subclass"," */"," itemsAreEqual: function(a, b) {"," return a === b;"," }","","});","","","}, '3.7.3', {\"requires\": [\"arraylist\"]});"]; _yuitest_coverage["build/arraylist-add/arraylist-add.js"].lines = {"1":0,"13":0,"29":0,"31":0,"32":0,"35":0,"38":0,"56":0,"58":0,"59":0,"60":0,"61":0,"62":0,"67":0,"81":0}; _yuitest_coverage["build/arraylist-add/arraylist-add.js"].functions = {"add:28":0,"remove:55":0,"itemsAreEqual:80":0,"(anonymous 1):1":0}; _yuitest_coverage["build/arraylist-add/arraylist-add.js"].coveredLines = 15;@@ -142,4 +142,4 @@ }); -}, '3.7.2', {"requires": ["arraylist"]});+}, '3.7.3', {"requires": ["arraylist"]});
bundle/arraylist-add/arraylist-add-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -90,4 +90,4 @@ }); -}, '3.7.2', {"requires": ["arraylist"]});+}, '3.7.3', {"requires": ["arraylist"]});
bundle/arraylist-add/arraylist-add-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraylist-add",function(e,t){e.mix(e.ArrayList.prototype,{add:function(t,n){var r=this._items;return e.Lang.isNumber(n)?r.splice(n,0,t):r.push(t),this},remove:function(e,t,n){n=n||this.itemsAreEqual;for(var r=this._items.length-1;r>=0;--r)if(n.call(this,e,this.item(r))){this._items.splice(r,1);if(!t)break}return this},itemsAreEqual:function(e,t){return e===t}})},"3.7.2",{requires:["arraylist"]});+YUI.add("arraylist-add",function(e,t){e.mix(e.ArrayList.prototype,{add:function(t,n){var r=this._items;return e.Lang.isNumber(n)?r.splice(n,0,t):r.push(t),this},remove:function(e,t,n){n=n||this.itemsAreEqual;for(var r=this._items.length-1;r>=0;--r)if(n.call(this,e,this.item(r))){this._items.splice(r,1);if(!t)break}return this},itemsAreEqual:function(e,t){return e===t}})},"3.7.3",{requires:["arraylist"]});
bundle/arraylist-add/arraylist-add.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -90,4 +90,4 @@ }); -}, '3.7.2', {"requires": ["arraylist"]});+}, '3.7.3', {"requires": ["arraylist"]});
bundle/arraylist-filter/arraylist-filter-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/arraylist-filter/arraylist-filter.js", code: [] };-_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].code=["YUI.add('arraylist-filter', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist-filter"," * @deprecated Use ModelList or a custom subclass implementation"," */","","/*"," * Adds filter method to ArrayList prototype"," */","Y.mix(Y.ArrayList.prototype, {",""," /**"," * <p>Create a new ArrayList (or augmenting class instance) from a subset"," * of items as determined by the boolean function passed as the"," * argument. The original ArrayList is unchanged.</p>"," *"," * <p>The validator signature is <code>validator( item )</code>.</p>"," *"," * @method filter"," * @param { Function } validator Boolean function to determine in or out."," * @return { ArrayList } New instance based on who passed the validator."," * @for ArrayList"," * @deprecated Use ModelList or a custom subclass implementation"," */"," filter: function(validator) {"," var items = [];",""," Y.Array.each(this._items, function(item, i) {"," item = this.item(i);",""," if (validator(item)) {"," items.push(item);"," }"," }, this);",""," return new this.constructor(items);"," }","","});","","","}, '3.7.2', {\"requires\": [\"arraylist\"]});"];+_yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].code=["YUI.add('arraylist-filter', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist-filter"," * @deprecated Use ModelList or a custom subclass implementation"," */","","/*"," * Adds filter method to ArrayList prototype"," */","Y.mix(Y.ArrayList.prototype, {",""," /**"," * <p>Create a new ArrayList (or augmenting class instance) from a subset"," * of items as determined by the boolean function passed as the"," * argument. The original ArrayList is unchanged.</p>"," *"," * <p>The validator signature is <code>validator( item )</code>.</p>"," *"," * @method filter"," * @param { Function } validator Boolean function to determine in or out."," * @return { ArrayList } New instance based on who passed the validator."," * @for ArrayList"," * @deprecated Use ModelList or a custom subclass implementation"," */"," filter: function(validator) {"," var items = [];",""," Y.Array.each(this._items, function(item, i) {"," item = this.item(i);",""," if (validator(item)) {"," items.push(item);"," }"," }, this);",""," return new this.constructor(items);"," }","","});","","","}, '3.7.3', {\"requires\": [\"arraylist\"]});"]; _yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].lines = {"1":0,"13":0,"29":0,"31":0,"32":0,"34":0,"35":0,"39":0}; _yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].functions = {"(anonymous 2):31":0,"filter:28":0,"(anonymous 1):1":0}; _yuitest_coverage["build/arraylist-filter/arraylist-filter.js"].coveredLines = 8;@@ -92,4 +92,4 @@ }); -}, '3.7.2', {"requires": ["arraylist"]});+}, '3.7.3', {"requires": ["arraylist"]});
bundle/arraylist-filter/arraylist-filter-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -48,4 +48,4 @@ }); -}, '3.7.2', {"requires": ["arraylist"]});+}, '3.7.3', {"requires": ["arraylist"]});
bundle/arraylist-filter/arraylist-filter-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraylist-filter",function(e,t){e.mix(e.ArrayList.prototype,{filter:function(t){var n=[];return e.Array.each(this._items,function(e,r){e=this.item(r),t(e)&&n.push(e)},this),new this.constructor(n)}})},"3.7.2",{requires:["arraylist"]});+YUI.add("arraylist-filter",function(e,t){e.mix(e.ArrayList.prototype,{filter:function(t){var n=[];return e.Array.each(this._items,function(e,r){e=this.item(r),t(e)&&n.push(e)},this),new this.constructor(n)}})},"3.7.3",{requires:["arraylist"]});
bundle/arraylist-filter/arraylist-filter.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -48,4 +48,4 @@ }); -}, '3.7.2', {"requires": ["arraylist"]});+}, '3.7.3', {"requires": ["arraylist"]});
bundle/arraylist/arraylist-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/arraylist/arraylist.js", code: [] };-_yuitest_coverage["build/arraylist/arraylist.js"].code=["YUI.add('arraylist', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist"," */","","var YArray = Y.Array,"," YArray_each = YArray.each,"," ArrayListProto;","","/**"," * Generic ArrayList class for managing lists of items and iterating operations"," * over them. The targeted use for this class is for augmentation onto a"," * class that is responsible for managing multiple instances of another class"," * (e.g. NodeList for Nodes). The recommended use is to augment your class with"," * ArrayList, then use ArrayList.addMethod to mirror the API of the constituent"," * items on the list's API."," *"," * The default implementation creates immutable lists, but mutability can be"," * provided via the arraylist-add submodule or by implementing mutation methods"," * directly on the augmented class's prototype."," *"," * @class ArrayList"," * @constructor"," * @param items { Array } array of items this list will be responsible for"," */","function ArrayList( items ) {"," if ( items !== undefined ) {"," this._items = Y.Lang.isArray( items ) ? items : YArray( items );"," } else {"," // ||= to support lazy initialization from augment"," this._items = this._items || [];"," }","}","","ArrayListProto = {"," /**"," * Get an item by index from the list. Override this method if managing a"," * list of objects that have a different public representation (e.g. Node"," * instances vs DOM nodes). The iteration methods that accept a user"," * function will use this method for access list items for operation."," *"," * @method item"," * @param i { Integer } index to fetch"," * @return { mixed } the item at the requested index"," */"," item: function ( i ) {"," return this._items[i];"," },",""," /**"," * <p>Execute a function on each item of the list, optionally providing a"," * custom execution context. Default context is the item.</p>"," *"," * <p>The callback signature is <code>callback( item, index )</code>.</p>"," *"," * @method each"," * @param fn { Function } the function to execute"," * @param context { mixed } optional override 'this' in the function"," * @return { ArrayList } this instance"," * @chainable"," */"," each: function ( fn, context ) {"," YArray_each( this._items, function ( item, i ) {"," item = this.item( i );",""," fn.call( context || item, item, i, this );"," }, this);",""," return this;"," },",""," /**"," * <p>Execute a function on each item of the list, optionally providing a"," * custom execution context. Default context is the item.</p>"," *"," * <p>The callback signature is <code>callback( item, index )</code>.</p>"," *"," * <p>Unlike <code>each</code>, if the callback returns true, the"," * iteratation will stop.</p>"," *"," * @method some"," * @param fn { Function } the function to execute"," * @param context { mixed } optional override 'this' in the function"," * @return { Boolean } True if the function returned true on an item"," */"," some: function ( fn, context ) {"," return YArray.some( this._items, function ( item, i ) {"," item = this.item( i );",""," return fn.call( context || item, item, i, this );"," }, this);"," },",""," /**"," * Finds the first index of the needle in the managed array of items."," *"," * @method indexOf"," * @param needle { mixed } The item to search for"," * @return { Integer } Array index if found. Otherwise -1"," */"," indexOf: function ( needle ) {"," return YArray.indexOf( this._items, needle );"," },",""," /**"," * How many items are in this list?"," *"," * @method size"," * @return { Integer } Number of items in the list"," */"," size: function () {"," return this._items.length;"," },",""," /**"," * Is this instance managing any items?"," *"," * @method isEmpty"," * @return { Boolean } true if 1 or more items are being managed"," */"," isEmpty: function () {"," return !this.size();"," },",""," /**"," * Provides an array-like representation for JSON.stringify."," *"," * @method toJSON"," * @return { Array } an array representation of the ArrayList"," */"," toJSON: function () {"," return this._items;"," }","};","// Default implementation does not distinguish between public and private","// item getter","/**"," * Protected method for optimizations that may be appropriate for API"," * mirroring. Similar in functionality to <code>item</code>, but is used by"," * methods added with <code>ArrayList.addMethod()</code>."," *"," * @method _item"," * @protected"," * @param i { Integer } Index of item to fetch"," * @return { mixed } The item appropriate for pass through API methods"," */","ArrayListProto._item = ArrayListProto.item;","","// Mixed onto existing proto to preserve constructor NOT being an own property.","// This has bitten me when composing classes by enumerating, copying prototypes.","Y.mix(ArrayList.prototype, ArrayListProto);","","Y.mix( ArrayList, {",""," /**"," * <p>Adds a pass through method to dest (typically the prototype of a list"," * class) that calls the named method on each item in the list with"," * whatever parameters are passed in. Allows for API indirection via list"," * instances.</p>"," *"," * <p>Accepts a single string name or an array of string names.</p>"," *"," * <pre><code>list.each( function ( item ) {"," * item.methodName( 1, 2, 3 );"," * } );"," * // becomes"," * list.methodName( 1, 2, 3 );</code></pre>"," *"," * <p>Additionally, the pass through methods use the item retrieved by the"," * <code>_item</code> method in case there is any special behavior that is"," * appropriate for API mirroring.</p>"," *"," * <p>If the iterated method returns a value, the return value from the"," * added method will be an array of values with each value being at the"," * corresponding index for that item. If the iterated method does not"," * return a value, the added method will be chainable."," *"," * @method addMethod"," * @static"," * @param dest {Object} Object or prototype to receive the iterator method"," * @param name {String|String[]} Name of method of methods to create"," */"," addMethod: function ( dest, names ) {",""," names = YArray( names );",""," YArray_each( names, function ( name ) {"," dest[ name ] = function () {"," var args = YArray( arguments, 0, true ),"," ret = [];",""," YArray_each( this._items, function ( item, i ) {"," item = this._item( i );",""," var result = item[ name ].apply( item, args );",""," if ( result !== undefined && result !== item ) {"," ret[i] = result;"," }"," }, this);",""," return ret.length ? ret : this;"," };"," } );"," }","} );","","Y.ArrayList = ArrayList;","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/arraylist/arraylist.js"].code=["YUI.add('arraylist', function (Y, NAME) {","","/**"," * Collection utilities beyond what is provided in the YUI core"," * @module collection"," * @submodule arraylist"," */","","var YArray = Y.Array,"," YArray_each = YArray.each,"," ArrayListProto;","","/**"," * Generic ArrayList class for managing lists of items and iterating operations"," * over them. The targeted use for this class is for augmentation onto a"," * class that is responsible for managing multiple instances of another class"," * (e.g. NodeList for Nodes). The recommended use is to augment your class with"," * ArrayList, then use ArrayList.addMethod to mirror the API of the constituent"," * items on the list's API."," *"," * The default implementation creates immutable lists, but mutability can be"," * provided via the arraylist-add submodule or by implementing mutation methods"," * directly on the augmented class's prototype."," *"," * @class ArrayList"," * @constructor"," * @param items { Array } array of items this list will be responsible for"," */","function ArrayList( items ) {"," if ( items !== undefined ) {"," this._items = Y.Lang.isArray( items ) ? items : YArray( items );"," } else {"," // ||= to support lazy initialization from augment"," this._items = this._items || [];"," }","}","","ArrayListProto = {"," /**"," * Get an item by index from the list. Override this method if managing a"," * list of objects that have a different public representation (e.g. Node"," * instances vs DOM nodes). The iteration methods that accept a user"," * function will use this method for access list items for operation."," *"," * @method item"," * @param i { Integer } index to fetch"," * @return { mixed } the item at the requested index"," */"," item: function ( i ) {"," return this._items[i];"," },",""," /**"," * <p>Execute a function on each item of the list, optionally providing a"," * custom execution context. Default context is the item.</p>"," *"," * <p>The callback signature is <code>callback( item, index )</code>.</p>"," *"," * @method each"," * @param fn { Function } the function to execute"," * @param context { mixed } optional override 'this' in the function"," * @return { ArrayList } this instance"," * @chainable"," */"," each: function ( fn, context ) {"," YArray_each( this._items, function ( item, i ) {"," item = this.item( i );",""," fn.call( context || item, item, i, this );"," }, this);",""," return this;"," },",""," /**"," * <p>Execute a function on each item of the list, optionally providing a"," * custom execution context. Default context is the item.</p>"," *"," * <p>The callback signature is <code>callback( item, index )</code>.</p>"," *"," * <p>Unlike <code>each</code>, if the callback returns true, the"," * iteratation will stop.</p>"," *"," * @method some"," * @param fn { Function } the function to execute"," * @param context { mixed } optional override 'this' in the function"," * @return { Boolean } True if the function returned true on an item"," */"," some: function ( fn, context ) {"," return YArray.some( this._items, function ( item, i ) {"," item = this.item( i );",""," return fn.call( context || item, item, i, this );"," }, this);"," },",""," /**"," * Finds the first index of the needle in the managed array of items."," *"," * @method indexOf"," * @param needle { mixed } The item to search for"," * @return { Integer } Array index if found. Otherwise -1"," */"," indexOf: function ( needle ) {"," return YArray.indexOf( this._items, needle );"," },",""," /**"," * How many items are in this list?"," *"," * @method size"," * @return { Integer } Number of items in the list"," */"," size: function () {"," return this._items.length;"," },",""," /**"," * Is this instance managing any items?"," *"," * @method isEmpty"," * @return { Boolean } true if 1 or more items are being managed"," */"," isEmpty: function () {"," return !this.size();"," },",""," /**"," * Provides an array-like representation for JSON.stringify."," *"," * @method toJSON"," * @return { Array } an array representation of the ArrayList"," */"," toJSON: function () {"," return this._items;"," }","};","// Default implementation does not distinguish between public and private","// item getter","/**"," * Protected method for optimizations that may be appropriate for API"," * mirroring. Similar in functionality to <code>item</code>, but is used by"," * methods added with <code>ArrayList.addMethod()</code>."," *"," * @method _item"," * @protected"," * @param i { Integer } Index of item to fetch"," * @return { mixed } The item appropriate for pass through API methods"," */","ArrayListProto._item = ArrayListProto.item;","","// Mixed onto existing proto to preserve constructor NOT being an own property.","// This has bitten me when composing classes by enumerating, copying prototypes.","Y.mix(ArrayList.prototype, ArrayListProto);","","Y.mix( ArrayList, {",""," /**"," * <p>Adds a pass through method to dest (typically the prototype of a list"," * class) that calls the named method on each item in the list with"," * whatever parameters are passed in. Allows for API indirection via list"," * instances.</p>"," *"," * <p>Accepts a single string name or an array of string names.</p>"," *"," * <pre><code>list.each( function ( item ) {"," * item.methodName( 1, 2, 3 );"," * } );"," * // becomes"," * list.methodName( 1, 2, 3 );</code></pre>"," *"," * <p>Additionally, the pass through methods use the item retrieved by the"," * <code>_item</code> method in case there is any special behavior that is"," * appropriate for API mirroring.</p>"," *"," * <p>If the iterated method returns a value, the return value from the"," * added method will be an array of values with each value being at the"," * corresponding index for that item. If the iterated method does not"," * return a value, the added method will be chainable."," *"," * @method addMethod"," * @static"," * @param dest {Object} Object or prototype to receive the iterator method"," * @param name {String|String[]} Name of method of methods to create"," */"," addMethod: function ( dest, names ) {",""," names = YArray( names );",""," YArray_each( names, function ( name ) {"," dest[ name ] = function () {"," var args = YArray( arguments, 0, true ),"," ret = [];",""," YArray_each( this._items, function ( item, i ) {"," item = this._item( i );",""," var result = item[ name ].apply( item, args );",""," if ( result !== undefined && result !== item ) {"," ret[i] = result;"," }"," }, this);",""," return ret.length ? ret : this;"," };"," } );"," }","} );","","Y.ArrayList = ArrayList;","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/arraylist/arraylist.js"].lines = {"1":0,"9":0,"29":0,"30":0,"31":0,"34":0,"38":0,"50":0,"66":0,"67":0,"69":0,"72":0,"90":0,"91":0,"93":0,"105":0,"115":0,"125":0,"135":0,"150":0,"154":0,"156":0,"188":0,"190":0,"191":0,"192":0,"195":0,"196":0,"198":0,"200":0,"201":0,"205":0,"211":0}; _yuitest_coverage["build/arraylist/arraylist.js"].functions = {"ArrayList:29":0,"item:49":0,"(anonymous 2):66":0,"each:65":0,"(anonymous 3):90":0,"some:89":0,"indexOf:104":0,"size:114":0,"isEmpty:124":0,"toJSON:134":0,"(anonymous 5):195":0,"]:191":0,"(anonymous 4):190":0,"addMethod:186":0,"(anonymous 1):1":0}; _yuitest_coverage["build/arraylist/arraylist.js"].coveredLines = 33;@@ -298,4 +298,4 @@ Y.ArrayList = ArrayList; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/arraylist/arraylist-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -217,4 +217,4 @@ Y.ArrayList = ArrayList; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/arraylist/arraylist-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraylist",function(e,t){function s(t){t!==undefined?this._items=e.Lang.isArray(t)?t:n(t):this._items=this._items||[]}var n=e.Array,r=n.each,i;i={item:function(e){return this._items[e]},each:function(e,t){return r(this._items,function(n,r){n=this.item(r),e.call(t||n,n,r,this)},this),this},some:function(e,t){return n.some(this._items,function(n,r){return n=this.item(r),e.call(t||n,n,r,this)},this)},indexOf:function(e){return n.indexOf(this._items,e)},size:function(){return this._items.length},isEmpty:function(){return!this.size()},toJSON:function(){return this._items}},i._item=i.item,e.mix(s.prototype,i),e.mix(s,{addMethod:function(e,t){t=n(t),r(t,function(t){e[t]=function(){var e=n(arguments,0,!0),i=[];return r(this._items,function(n,r){n=this._item(r);var s=n[t].apply(n,e);s!==undefined&&s!==n&&(i[r]=s)},this),i.length?i:this}})}}),e.ArrayList=s},"3.7.2",{requires:["yui-base"]});+YUI.add("arraylist",function(e,t){function s(t){t!==undefined?this._items=e.Lang.isArray(t)?t:n(t):this._items=this._items||[]}var n=e.Array,r=n.each,i;i={item:function(e){return this._items[e]},each:function(e,t){return r(this._items,function(n,r){n=this.item(r),e.call(t||n,n,r,this)},this),this},some:function(e,t){return n.some(this._items,function(n,r){return n=this.item(r),e.call(t||n,n,r,this)},this)},indexOf:function(e){return n.indexOf(this._items,e)},size:function(){return this._items.length},isEmpty:function(){return!this.size()},toJSON:function(){return this._items}},i._item=i.item,e.mix(s.prototype,i),e.mix(s,{addMethod:function(e,t){t=n(t),r(t,function(t){e[t]=function(){var e=n(arguments,0,!0),i=[];return r(this._items,function(n,r){n=this._item(r);var s=n[t].apply(n,e);s!==undefined&&s!==n&&(i[r]=s)},this),i.length?i:this}})}}),e.ArrayList=s},"3.7.3",{requires:["yui-base"]});
bundle/arraylist/arraylist.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -217,4 +217,4 @@ Y.ArrayList = ArrayList; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/arraysort/arraysort-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/arraysort/arraysort.js", code: [] };-_yuitest_coverage["build/arraysort/arraysort.js"].code=["YUI.add('arraysort', function (Y, NAME) {","","/**","Provides a case-insenstive comparator which can be used for array sorting.","","@module arraysort","*/","","var LANG = Y.Lang,"," ISVALUE = LANG.isValue,"," ISSTRING = LANG.isString;","","/**","Provides a case-insenstive comparator which can be used for array sorting.","","@class ArraySort","*/","","Y.ArraySort = {",""," /**"," Comparator function for simple case-insensitive sorting of an array of"," strings.",""," @method compare"," @param a {Object} First sort argument."," @param b {Object} Second sort argument."," @param desc {Boolean} `true` if sort direction is descending, `false` if"," sort direction is ascending."," @return {Boolean} -1 when a < b. 0 when a == b. 1 when a > b."," */"," compare: function(a, b, desc) {"," if(!ISVALUE(a)) {"," if(!ISVALUE(b)) {"," return 0;"," }"," else {"," return 1;"," }"," }"," else if(!ISVALUE(b)) {"," return -1;"," }",""," if(ISSTRING(a)) {"," a = a.toLowerCase();"," }"," if(ISSTRING(b)) {"," b = b.toLowerCase();"," }"," if(a < b) {"," return (desc) ? 1 : -1;"," }"," else if (a > b) {"," return (desc) ? -1 : 1;"," }"," else {"," return 0;"," }"," }","","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/arraysort/arraysort.js"].code=["YUI.add('arraysort', function (Y, NAME) {","","/**","Provides a case-insenstive comparator which can be used for array sorting.","","@module arraysort","*/","","var LANG = Y.Lang,"," ISVALUE = LANG.isValue,"," ISSTRING = LANG.isString;","","/**","Provides a case-insenstive comparator which can be used for array sorting.","","@class ArraySort","*/","","Y.ArraySort = {",""," /**"," Comparator function for simple case-insensitive sorting of an array of"," strings.",""," @method compare"," @param a {Object} First sort argument."," @param b {Object} Second sort argument."," @param desc {Boolean} `true` if sort direction is descending, `false` if"," sort direction is ascending."," @return {Boolean} -1 when a < b. 0 when a == b. 1 when a > b."," */"," compare: function(a, b, desc) {"," if(!ISVALUE(a)) {"," if(!ISVALUE(b)) {"," return 0;"," }"," else {"," return 1;"," }"," }"," else if(!ISVALUE(b)) {"," return -1;"," }",""," if(ISSTRING(a)) {"," a = a.toLowerCase();"," }"," if(ISSTRING(b)) {"," b = b.toLowerCase();"," }"," if(a < b) {"," return (desc) ? 1 : -1;"," }"," else if (a > b) {"," return (desc) ? -1 : 1;"," }"," else {"," return 0;"," }"," }","","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/arraysort/arraysort.js"].lines = {"1":0,"9":0,"19":0,"33":0,"34":0,"35":0,"38":0,"41":0,"42":0,"45":0,"46":0,"48":0,"49":0,"51":0,"52":0,"54":0,"55":0,"58":0}; _yuitest_coverage["build/arraysort/arraysort.js"].functions = {"compare:32":0,"(anonymous 1):1":0}; _yuitest_coverage["build/arraysort/arraysort.js"].coveredLines = 18;@@ -121,4 +121,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/arraysort/arraysort-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -68,4 +68,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/arraysort/arraysort-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("arraysort",function(e,t){var n=e.Lang,r=n.isValue,i=n.isString;e.ArraySort={compare:function(e,t,n){return r(e)?r(t)?(i(e)&&(e=e.toLowerCase()),i(t)&&(t=t.toLowerCase()),e<t?n?1:-1:e>t?n?-1:1:0):-1:r(t)?1:0}}},"3.7.2",{requires:["yui-base"]});+YUI.add("arraysort",function(e,t){var n=e.Lang,r=n.isValue,i=n.isString;e.ArraySort={compare:function(e,t,n){return r(e)?r(t)?(i(e)&&(e=e.toLowerCase()),i(t)&&(t=t.toLowerCase()),e<t?n?1:-1:e>t?n?-1:1:0):-1:r(t)?1:0}}},"3.7.3",{requires:["yui-base"]});
bundle/arraysort/arraysort.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -68,4 +68,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/assets/skins/sam/autocomplete-list.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/calendar-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/calendar.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/console-filters.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/console.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/datatable-base-deprecated.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/datatable-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/datatable-message.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/datatable-scroll.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/datatable-sort.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/dial.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/node-flick.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/overlay.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/panel.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/resize-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/scrollview-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/scrollview-list.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/scrollview-scrollbars.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/tabview.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/test-console.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/widget-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/widget-buttons.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/widget-modality.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/assets/skins/sam/widget-stack.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/async-queue/async-queue-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/async-queue/async-queue.js", code: [] };-_yuitest_coverage["build/async-queue/async-queue.js"].code=["YUI.add('async-queue', function (Y, NAME) {","","/**"," * <p>AsyncQueue allows you create a chain of function callbacks executed"," * via setTimeout (or synchronously) that are guaranteed to run in order."," * Items in the queue can be promoted or removed. Start or resume the"," * execution chain with run(). pause() to temporarily delay execution, or"," * stop() to halt and clear the queue.</p>"," *"," * @module async-queue"," */","","/**"," * <p>A specialized queue class that supports scheduling callbacks to execute"," * sequentially, iteratively, even asynchronously.</p>"," *"," * <p>Callbacks can be function refs or objects with the following keys. Only"," * the <code>fn</code> key is required.</p>"," *"," * <ul>"," * <li><code>fn</code> -- The callback function</li>"," * <li><code>context</code> -- The execution context for the callbackFn.</li>"," * <li><code>args</code> -- Arguments to pass to callbackFn.</li>"," * <li><code>timeout</code> -- Millisecond delay before executing callbackFn."," * (Applies to each iterative execution of callback)</li>"," * <li><code>iterations</code> -- Number of times to repeat the callback."," * <li><code>until</code> -- Repeat the callback until this function returns"," * true. This setting trumps iterations.</li>"," * <li><code>autoContinue</code> -- Set to false to prevent the AsyncQueue from"," * executing the next callback in the Queue after"," * the callback completes.</li>"," * <li><code>id</code> -- Name that can be used to get, promote, get the"," * indexOf, or delete this callback.</li>"," * </ul>"," *"," * @class AsyncQueue"," * @extends EventTarget"," * @constructor"," * @param callback* {Function|Object} 0..n callbacks to seed the queue"," */","Y.AsyncQueue = function() {"," this._init();"," this.add.apply(this, arguments);","};","","var Queue = Y.AsyncQueue,"," EXECUTE = 'execute',"," SHIFT = 'shift',"," PROMOTE = 'promote',"," REMOVE = 'remove',",""," isObject = Y.Lang.isObject,"," isFunction = Y.Lang.isFunction;","","/**"," * <p>Static default values used to populate callback configuration properties."," * Preconfigured defaults include:</p>"," *"," * <ul>"," * <li><code>autoContinue</code>: <code>true</code></li>"," * <li><code>iterations</code>: 1</li>"," * <li><code>timeout</code>: 10 (10ms between callbacks)</li>"," * <li><code>until</code>: (function to run until iterations <= 0)</li>"," * </ul>"," *"," * @property defaults"," * @type {Object}"," * @static"," */","Queue.defaults = Y.mix({"," autoContinue : true,"," iterations : 1,"," timeout : 10,"," until : function () {"," this.iterations |= 0;"," return this.iterations <= 0;"," }","}, Y.config.queueDefaults || {});","","Y.extend(Queue, Y.EventTarget, {"," /**"," * Used to indicate the queue is currently executing a callback."," *"," * @property _running"," * @type {Boolean|Object} true for synchronous callback execution, the"," * return handle from Y.later for async callbacks."," * Otherwise false."," * @protected"," */"," _running : false,",""," /**"," * Initializes the AsyncQueue instance properties and events."," *"," * @method _init"," * @protected"," */"," _init : function () {"," Y.EventTarget.call(this, { prefix: 'queue', emitFacade: true });",""," this._q = [];",""," /** "," * Callback defaults for this instance. Static defaults that are not"," * overridden are also included."," *"," * @property defaults"," * @type {Object}"," */"," this.defaults = {};",""," this._initEvents();"," },",""," /**"," * Initializes the instance events."," *"," * @method _initEvents"," * @protected"," */"," _initEvents : function () {"," this.publish({"," 'execute' : { defaultFn : this._defExecFn, emitFacade: true },"," 'shift' : { defaultFn : this._defShiftFn, emitFacade: true },"," 'add' : { defaultFn : this._defAddFn, emitFacade: true },"," 'promote' : { defaultFn : this._defPromoteFn, emitFacade: true },"," 'remove' : { defaultFn : this._defRemoveFn, emitFacade: true }"," });"," },",""," /**"," * Returns the next callback needing execution. If a callback is"," * configured to repeat via iterations or until, it will be returned until"," * the completion criteria is met."," *"," * When the queue is empty, null is returned."," *"," * @method next"," * @return {Function} the callback to execute"," */"," next : function () {"," var callback;",""," while (this._q.length) {"," callback = this._q[0] = this._prepare(this._q[0]);"," if (callback && callback.until()) {"," this.fire(SHIFT, { callback: callback });"," callback = null;"," } else {"," break;"," }"," }",""," return callback || null;"," },",""," /**"," * Default functionality for the "shift" event. Shifts the"," * callback stored in the event object's <em>callback</em> property from"," * the queue if it is the first item."," *"," * @method _defShiftFn"," * @param e {Event} The event object"," * @protected"," */"," _defShiftFn : function (e) {"," if (this.indexOf(e.callback) === 0) {"," this._q.shift();"," }"," },",""," /**"," * Creates a wrapper function to execute the callback using the aggregated "," * configuration generated by combining the static AsyncQueue.defaults, the"," * instance defaults, and the specified callback settings."," *"," * The wrapper function is decorated with the callback configuration as"," * properties for runtime modification."," *"," * @method _prepare"," * @param callback {Object|Function} the raw callback"," * @return {Function} a decorated function wrapper to execute the callback"," * @protected"," */"," _prepare: function (callback) {"," if (isFunction(callback) && callback._prepared) {"," return callback;"," }",""," var config = Y.merge("," Queue.defaults,"," { context : this, args: [], _prepared: true },"," this.defaults,"," (isFunction(callback) ? { fn: callback } : callback)),"," "," wrapper = Y.bind(function () {"," if (!wrapper._running) {"," wrapper.iterations--;"," }"," if (isFunction(wrapper.fn)) {"," wrapper.fn.apply(wrapper.context || Y,"," Y.Array(wrapper.args));"," }"," }, this);"," "," return Y.mix(wrapper, config);"," },",""," /**"," * Sets the queue in motion. All queued callbacks will be executed in"," * order unless pause() or stop() is called or if one of the callbacks is"," * configured with autoContinue: false."," *"," * @method run"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," run : function () {"," var callback,"," cont = true;",""," for (callback = this.next();"," cont && callback && !this.isRunning();"," callback = this.next())"," {"," cont = (callback.timeout < 0) ?"," this._execute(callback) :"," this._schedule(callback);"," }",""," if (!callback) {"," /**"," * Event fired after the last queued callback is executed."," * @event complete"," */"," this.fire('complete');"," }",""," return this;"," },",""," /**"," * Handles the execution of callbacks. Returns a boolean indicating"," * whether it is appropriate to continue running."," *"," * @method _execute"," * @param callback {Object} the callback object to execute"," * @return {Boolean} whether the run loop should continue"," * @protected"," */"," _execute : function (callback) {"," this._running = callback._running = true;",""," callback.iterations--;"," this.fire(EXECUTE, { callback: callback });",""," var cont = this._running && callback.autoContinue;",""," this._running = callback._running = false;",""," return cont;"," },",""," /**"," * Schedules the execution of asynchronous callbacks."," *"," * @method _schedule"," * @param callback {Object} the callback object to execute"," * @return {Boolean} whether the run loop should continue"," * @protected"," */"," _schedule : function (callback) {"," this._running = Y.later(callback.timeout, this, function () {"," if (this._execute(callback)) {"," this.run();"," }"," });",""," return false;"," },",""," /**"," * Determines if the queue is waiting for a callback to complete execution."," *"," * @method isRunning"," * @return {Boolean} true if queue is waiting for a "," * from any initiated transactions"," */"," isRunning : function () {"," return !!this._running;"," },",""," /**"," * Default functionality for the "execute" event. Executes the"," * callback function"," *"," * @method _defExecFn"," * @param e {Event} the event object"," * @protected"," */"," _defExecFn : function (e) {"," e.callback();"," },",""," /**"," * Add any number of callbacks to the end of the queue. Callbacks may be"," * provided as functions or objects."," *"," * @method add"," * @param callback* {Function|Object} 0..n callbacks"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," add : function () {"," this.fire('add', { callbacks: Y.Array(arguments,0,true) });",""," return this;"," },",""," /**"," * Default functionality for the "add" event. Adds the callbacks"," * in the event facade to the queue. Callbacks successfully added to the"," * queue are present in the event's <code>added</code> property in the"," * after phase."," *"," * @method _defAddFn"," * @param e {Event} the event object"," * @protected"," */"," _defAddFn : function(e) {"," var _q = this._q,"," added = [];",""," Y.Array.each(e.callbacks, function (c) {"," if (isObject(c)) {"," _q.push(c);"," added.push(c);"," }"," });",""," e.added = added;"," },",""," /**"," * Pause the execution of the queue after the execution of the current"," * callback completes. If called from code outside of a queued callback,"," * clears the timeout for the pending callback. Paused queue can be"," * restarted with q.run()"," *"," * @method pause"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," pause: function () {"," if (isObject(this._running)) {"," this._running.cancel();"," }",""," this._running = false;",""," return this;"," },",""," /**"," * Stop and clear the queue after the current execution of the"," * current callback completes."," *"," * @method stop"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," stop : function () { "," this._q = [];",""," return this.pause();"," },",""," /** "," * Returns the current index of a callback. Pass in either the id or"," * callback function from getCallback."," *"," * @method indexOf"," * @param callback {String|Function} the callback or its specified id"," * @return {Number} index of the callback or -1 if not found"," */"," indexOf : function (callback) {"," var i = 0, len = this._q.length, c;",""," for (; i < len; ++i) {"," c = this._q[i];"," if (c === callback || c.id === callback) {"," return i;"," }"," }",""," return -1;"," },",""," /**"," * Retrieve a callback by its id. Useful to modify the configuration"," * while the queue is running."," *"," * @method getCallback"," * @param id {String} the id assigned to the callback"," * @return {Object} the callback object"," */"," getCallback : function (id) {"," var i = this.indexOf(id);",""," return (i > -1) ? this._q[i] : null;"," },",""," /**"," * Promotes the named callback to the top of the queue. If a callback is"," * currently executing or looping (via until or iterations), the promotion"," * is scheduled to occur after the current callback has completed."," *"," * @method promote"," * @param callback {String|Object} the callback object or a callback's id"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," promote : function (callback) {"," var payload = { callback : callback },e;",""," if (this.isRunning()) {"," e = this.after(SHIFT, function () {"," this.fire(PROMOTE, payload);"," e.detach();"," }, this);"," } else {"," this.fire(PROMOTE, payload);"," }",""," return this;"," },",""," /**"," * <p>Default functionality for the "promote" event. Promotes the"," * named callback to the head of the queue.</p>"," *"," * <p>The event object will contain a property "callback", which"," * holds the id of a callback or the callback object itself.</p>"," *"," * @method _defPromoteFn"," * @param e {Event} the custom event"," * @protected"," */"," _defPromoteFn : function (e) {"," var i = this.indexOf(e.callback),"," promoted = (i > -1) ? this._q.splice(i,1)[0] : null;",""," e.promoted = promoted;",""," if (promoted) {"," this._q.unshift(promoted);"," }"," },",""," /**"," * Removes the callback from the queue. If the queue is active, the"," * removal is scheduled to occur after the current callback has completed."," *"," * @method remove"," * @param callback {String|Object} the callback object or a callback's id"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," remove : function (callback) {"," var payload = { callback : callback },e;",""," // Can't return the removed callback because of the deferral until"," // current callback is complete"," if (this.isRunning()) {"," e = this.after(SHIFT, function () {"," this.fire(REMOVE, payload);"," e.detach();"," },this);"," } else {"," this.fire(REMOVE, payload);"," }",""," return this;"," },",""," /**"," * <p>Default functionality for the "remove" event. Removes the"," * callback from the queue.</p>"," *"," * <p>The event object will contain a property "callback", which"," * holds the id of a callback or the callback object itself.</p>"," *"," * @method _defRemoveFn"," * @param e {Event} the custom event"," * @protected"," */"," _defRemoveFn : function (e) {"," var i = this.indexOf(e.callback);",""," e.removed = (i > -1) ? this._q.splice(i,1)[0] : null;"," },",""," /**"," * Returns the number of callbacks in the queue."," *"," * @method size"," * @return {Number}"," */"," size : function () {"," // next() flushes callbacks that have met their until() criteria and"," // therefore shouldn't count since they wouldn't execute anyway."," if (!this.isRunning()) {"," this.next();"," }",""," return this._q.length;"," }","});","","","","}, '3.7.2', {\"requires\": [\"event-custom\"]});"];+_yuitest_coverage["build/async-queue/async-queue.js"].code=["YUI.add('async-queue', function (Y, NAME) {","","/**"," * <p>AsyncQueue allows you create a chain of function callbacks executed"," * via setTimeout (or synchronously) that are guaranteed to run in order."," * Items in the queue can be promoted or removed. Start or resume the"," * execution chain with run(). pause() to temporarily delay execution, or"," * stop() to halt and clear the queue.</p>"," *"," * @module async-queue"," */","","/**"," * <p>A specialized queue class that supports scheduling callbacks to execute"," * sequentially, iteratively, even asynchronously.</p>"," *"," * <p>Callbacks can be function refs or objects with the following keys. Only"," * the <code>fn</code> key is required.</p>"," *"," * <ul>"," * <li><code>fn</code> -- The callback function</li>"," * <li><code>context</code> -- The execution context for the callbackFn.</li>"," * <li><code>args</code> -- Arguments to pass to callbackFn.</li>"," * <li><code>timeout</code> -- Millisecond delay before executing callbackFn."," * (Applies to each iterative execution of callback)</li>"," * <li><code>iterations</code> -- Number of times to repeat the callback."," * <li><code>until</code> -- Repeat the callback until this function returns"," * true. This setting trumps iterations.</li>"," * <li><code>autoContinue</code> -- Set to false to prevent the AsyncQueue from"," * executing the next callback in the Queue after"," * the callback completes.</li>"," * <li><code>id</code> -- Name that can be used to get, promote, get the"," * indexOf, or delete this callback.</li>"," * </ul>"," *"," * @class AsyncQueue"," * @extends EventTarget"," * @constructor"," * @param callback* {Function|Object} 0..n callbacks to seed the queue"," */","Y.AsyncQueue = function() {"," this._init();"," this.add.apply(this, arguments);","};","","var Queue = Y.AsyncQueue,"," EXECUTE = 'execute',"," SHIFT = 'shift',"," PROMOTE = 'promote',"," REMOVE = 'remove',",""," isObject = Y.Lang.isObject,"," isFunction = Y.Lang.isFunction;","","/**"," * <p>Static default values used to populate callback configuration properties."," * Preconfigured defaults include:</p>"," *"," * <ul>"," * <li><code>autoContinue</code>: <code>true</code></li>"," * <li><code>iterations</code>: 1</li>"," * <li><code>timeout</code>: 10 (10ms between callbacks)</li>"," * <li><code>until</code>: (function to run until iterations <= 0)</li>"," * </ul>"," *"," * @property defaults"," * @type {Object}"," * @static"," */","Queue.defaults = Y.mix({"," autoContinue : true,"," iterations : 1,"," timeout : 10,"," until : function () {"," this.iterations |= 0;"," return this.iterations <= 0;"," }","}, Y.config.queueDefaults || {});","","Y.extend(Queue, Y.EventTarget, {"," /**"," * Used to indicate the queue is currently executing a callback."," *"," * @property _running"," * @type {Boolean|Object} true for synchronous callback execution, the"," * return handle from Y.later for async callbacks."," * Otherwise false."," * @protected"," */"," _running : false,",""," /**"," * Initializes the AsyncQueue instance properties and events."," *"," * @method _init"," * @protected"," */"," _init : function () {"," Y.EventTarget.call(this, { prefix: 'queue', emitFacade: true });",""," this._q = [];",""," /** "," * Callback defaults for this instance. Static defaults that are not"," * overridden are also included."," *"," * @property defaults"," * @type {Object}"," */"," this.defaults = {};",""," this._initEvents();"," },",""," /**"," * Initializes the instance events."," *"," * @method _initEvents"," * @protected"," */"," _initEvents : function () {"," this.publish({"," 'execute' : { defaultFn : this._defExecFn, emitFacade: true },"," 'shift' : { defaultFn : this._defShiftFn, emitFacade: true },"," 'add' : { defaultFn : this._defAddFn, emitFacade: true },"," 'promote' : { defaultFn : this._defPromoteFn, emitFacade: true },"," 'remove' : { defaultFn : this._defRemoveFn, emitFacade: true }"," });"," },",""," /**"," * Returns the next callback needing execution. If a callback is"," * configured to repeat via iterations or until, it will be returned until"," * the completion criteria is met."," *"," * When the queue is empty, null is returned."," *"," * @method next"," * @return {Function} the callback to execute"," */"," next : function () {"," var callback;",""," while (this._q.length) {"," callback = this._q[0] = this._prepare(this._q[0]);"," if (callback && callback.until()) {"," this.fire(SHIFT, { callback: callback });"," callback = null;"," } else {"," break;"," }"," }",""," return callback || null;"," },",""," /**"," * Default functionality for the "shift" event. Shifts the"," * callback stored in the event object's <em>callback</em> property from"," * the queue if it is the first item."," *"," * @method _defShiftFn"," * @param e {Event} The event object"," * @protected"," */"," _defShiftFn : function (e) {"," if (this.indexOf(e.callback) === 0) {"," this._q.shift();"," }"," },",""," /**"," * Creates a wrapper function to execute the callback using the aggregated "," * configuration generated by combining the static AsyncQueue.defaults, the"," * instance defaults, and the specified callback settings."," *"," * The wrapper function is decorated with the callback configuration as"," * properties for runtime modification."," *"," * @method _prepare"," * @param callback {Object|Function} the raw callback"," * @return {Function} a decorated function wrapper to execute the callback"," * @protected"," */"," _prepare: function (callback) {"," if (isFunction(callback) && callback._prepared) {"," return callback;"," }",""," var config = Y.merge("," Queue.defaults,"," { context : this, args: [], _prepared: true },"," this.defaults,"," (isFunction(callback) ? { fn: callback } : callback)),"," "," wrapper = Y.bind(function () {"," if (!wrapper._running) {"," wrapper.iterations--;"," }"," if (isFunction(wrapper.fn)) {"," wrapper.fn.apply(wrapper.context || Y,"," Y.Array(wrapper.args));"," }"," }, this);"," "," return Y.mix(wrapper, config);"," },",""," /**"," * Sets the queue in motion. All queued callbacks will be executed in"," * order unless pause() or stop() is called or if one of the callbacks is"," * configured with autoContinue: false."," *"," * @method run"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," run : function () {"," var callback,"," cont = true;",""," for (callback = this.next();"," cont && callback && !this.isRunning();"," callback = this.next())"," {"," cont = (callback.timeout < 0) ?"," this._execute(callback) :"," this._schedule(callback);"," }",""," if (!callback) {"," /**"," * Event fired after the last queued callback is executed."," * @event complete"," */"," this.fire('complete');"," }",""," return this;"," },",""," /**"," * Handles the execution of callbacks. Returns a boolean indicating"," * whether it is appropriate to continue running."," *"," * @method _execute"," * @param callback {Object} the callback object to execute"," * @return {Boolean} whether the run loop should continue"," * @protected"," */"," _execute : function (callback) {"," this._running = callback._running = true;",""," callback.iterations--;"," this.fire(EXECUTE, { callback: callback });",""," var cont = this._running && callback.autoContinue;",""," this._running = callback._running = false;",""," return cont;"," },",""," /**"," * Schedules the execution of asynchronous callbacks."," *"," * @method _schedule"," * @param callback {Object} the callback object to execute"," * @return {Boolean} whether the run loop should continue"," * @protected"," */"," _schedule : function (callback) {"," this._running = Y.later(callback.timeout, this, function () {"," if (this._execute(callback)) {"," this.run();"," }"," });",""," return false;"," },",""," /**"," * Determines if the queue is waiting for a callback to complete execution."," *"," * @method isRunning"," * @return {Boolean} true if queue is waiting for a "," * from any initiated transactions"," */"," isRunning : function () {"," return !!this._running;"," },",""," /**"," * Default functionality for the "execute" event. Executes the"," * callback function"," *"," * @method _defExecFn"," * @param e {Event} the event object"," * @protected"," */"," _defExecFn : function (e) {"," e.callback();"," },",""," /**"," * Add any number of callbacks to the end of the queue. Callbacks may be"," * provided as functions or objects."," *"," * @method add"," * @param callback* {Function|Object} 0..n callbacks"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," add : function () {"," this.fire('add', { callbacks: Y.Array(arguments,0,true) });",""," return this;"," },",""," /**"," * Default functionality for the "add" event. Adds the callbacks"," * in the event facade to the queue. Callbacks successfully added to the"," * queue are present in the event's <code>added</code> property in the"," * after phase."," *"," * @method _defAddFn"," * @param e {Event} the event object"," * @protected"," */"," _defAddFn : function(e) {"," var _q = this._q,"," added = [];",""," Y.Array.each(e.callbacks, function (c) {"," if (isObject(c)) {"," _q.push(c);"," added.push(c);"," }"," });",""," e.added = added;"," },",""," /**"," * Pause the execution of the queue after the execution of the current"," * callback completes. If called from code outside of a queued callback,"," * clears the timeout for the pending callback. Paused queue can be"," * restarted with q.run()"," *"," * @method pause"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," pause: function () {"," if (isObject(this._running)) {"," this._running.cancel();"," }",""," this._running = false;",""," return this;"," },",""," /**"," * Stop and clear the queue after the current execution of the"," * current callback completes."," *"," * @method stop"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," stop : function () { "," this._q = [];",""," return this.pause();"," },",""," /** "," * Returns the current index of a callback. Pass in either the id or"," * callback function from getCallback."," *"," * @method indexOf"," * @param callback {String|Function} the callback or its specified id"," * @return {Number} index of the callback or -1 if not found"," */"," indexOf : function (callback) {"," var i = 0, len = this._q.length, c;",""," for (; i < len; ++i) {"," c = this._q[i];"," if (c === callback || c.id === callback) {"," return i;"," }"," }",""," return -1;"," },",""," /**"," * Retrieve a callback by its id. Useful to modify the configuration"," * while the queue is running."," *"," * @method getCallback"," * @param id {String} the id assigned to the callback"," * @return {Object} the callback object"," */"," getCallback : function (id) {"," var i = this.indexOf(id);",""," return (i > -1) ? this._q[i] : null;"," },",""," /**"," * Promotes the named callback to the top of the queue. If a callback is"," * currently executing or looping (via until or iterations), the promotion"," * is scheduled to occur after the current callback has completed."," *"," * @method promote"," * @param callback {String|Object} the callback object or a callback's id"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," promote : function (callback) {"," var payload = { callback : callback },e;",""," if (this.isRunning()) {"," e = this.after(SHIFT, function () {"," this.fire(PROMOTE, payload);"," e.detach();"," }, this);"," } else {"," this.fire(PROMOTE, payload);"," }",""," return this;"," },",""," /**"," * <p>Default functionality for the "promote" event. Promotes the"," * named callback to the head of the queue.</p>"," *"," * <p>The event object will contain a property "callback", which"," * holds the id of a callback or the callback object itself.</p>"," *"," * @method _defPromoteFn"," * @param e {Event} the custom event"," * @protected"," */"," _defPromoteFn : function (e) {"," var i = this.indexOf(e.callback),"," promoted = (i > -1) ? this._q.splice(i,1)[0] : null;",""," e.promoted = promoted;",""," if (promoted) {"," this._q.unshift(promoted);"," }"," },",""," /**"," * Removes the callback from the queue. If the queue is active, the"," * removal is scheduled to occur after the current callback has completed."," *"," * @method remove"," * @param callback {String|Object} the callback object or a callback's id"," * @return {AsyncQueue} the AsyncQueue instance"," * @chainable"," */"," remove : function (callback) {"," var payload = { callback : callback },e;",""," // Can't return the removed callback because of the deferral until"," // current callback is complete"," if (this.isRunning()) {"," e = this.after(SHIFT, function () {"," this.fire(REMOVE, payload);"," e.detach();"," },this);"," } else {"," this.fire(REMOVE, payload);"," }",""," return this;"," },",""," /**"," * <p>Default functionality for the "remove" event. Removes the"," * callback from the queue.</p>"," *"," * <p>The event object will contain a property "callback", which"," * holds the id of a callback or the callback object itself.</p>"," *"," * @method _defRemoveFn"," * @param e {Event} the custom event"," * @protected"," */"," _defRemoveFn : function (e) {"," var i = this.indexOf(e.callback);",""," e.removed = (i > -1) ? this._q.splice(i,1)[0] : null;"," },",""," /**"," * Returns the number of callbacks in the queue."," *"," * @method size"," * @return {Number}"," */"," size : function () {"," // next() flushes callbacks that have met their until() criteria and"," // therefore shouldn't count since they wouldn't execute anyway."," if (!this.isRunning()) {"," this.next();"," }",""," return this._q.length;"," }","});","","","","}, '3.7.3', {\"requires\": [\"event-custom\"]});"]; _yuitest_coverage["build/async-queue/async-queue.js"].lines = {"1":0,"41":0,"42":0,"43":0,"46":0,"70":0,"75":0,"76":0,"80":0,"99":0,"101":0,"110":0,"112":0,"122":0,"142":0,"144":0,"145":0,"146":0,"147":0,"148":0,"150":0,"154":0,"167":0,"168":0,"186":0,"187":0,"190":0,"197":0,"198":0,"200":0,"201":0,"206":0,"219":0,"222":0,"226":0,"231":0,"236":0,"239":0,"252":0,"254":0,"255":0,"257":0,"259":0,"261":0,"273":0,"274":0,"275":0,"279":0,"290":0,"302":0,"315":0,"317":0,"331":0,"334":0,"335":0,"336":0,"337":0,"341":0,"355":0,"356":0,"359":0,"361":0,"373":0,"375":0,"387":0,"389":0,"390":0,"391":0,"392":0,"396":0,"408":0,"410":0,"424":0,"426":0,"427":0,"428":0,"429":0,"432":0,"435":0,"450":0,"453":0,"455":0,"456":0,"470":0,"474":0,"475":0,"476":0,"477":0,"480":0,"483":0,"498":0,"500":0,"512":0,"513":0,"516":0}; _yuitest_coverage["build/async-queue/async-queue.js"].functions = {"AsyncQueue:41":0,"until:74":0,"_init:98":0,"_initEvents:121":0,"next:141":0,"_defShiftFn:166":0,"(anonymous 2):196":0,"_prepare:185":0,"run:218":0,"_execute:251":0,"(anonymous 3):273":0,"_schedule:272":0,"isRunning:289":0,"_defExecFn:301":0,"add:314":0,"(anonymous 4):334":0,"_defAddFn:330":0,"pause:354":0,"stop:372":0,"indexOf:386":0,"getCallback:407":0,"(anonymous 5):427":0,"promote:423":0,"_defPromoteFn:449":0,"(anonymous 6):475":0,"remove:469":0,"_defRemoveFn:497":0,"size:509":0,"(anonymous 1):1":0}; _yuitest_coverage["build/async-queue/async-queue.js"].coveredLines = 95;@@ -682,4 +682,4 @@ -}, '3.7.2', {"requires": ["event-custom"]});+}, '3.7.3', {"requires": ["event-custom"]});
bundle/async-queue/async-queue-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -525,4 +525,4 @@ -}, '3.7.2', {"requires": ["event-custom"]});+}, '3.7.3', {"requires": ["event-custom"]});
bundle/async-queue/async-queue-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("async-queue",function(e,t){e.AsyncQueue=function(){this._init(),this.add.apply(this,arguments)};var n=e.AsyncQueue,r="execute",i="shift",s="promote",o="remove",u=e.Lang.isObject,a=e.Lang.isFunction;n.defaults=e.mix({autoContinue:!0,iterations:1,timeout:10,until:function(){return this.iterations|=0,this.iterations<=0}},e.config.queueDefaults||{}),e.extend(n,e.EventTarget,{_running:!1,_init:function(){e.EventTarget.call(this,{prefix:"queue",emitFacade:!0}),this._q=[],this.defaults={},this._initEvents()},_initEvents:function(){this.publish({execute:{defaultFn:this._defExecFn,emitFacade:!0},shift:{defaultFn:this._defShiftFn,emitFacade:!0},add:{defaultFn:this._defAddFn,emitFacade:!0},promote:{defaultFn:this._defPromoteFn,emitFacade:!0},remove:{defaultFn:this._defRemoveFn,emitFacade:!0}})},next:function(){var e;while(this._q.length){e=this._q[0]=this._prepare(this._q[0]);if(!e||!e.until())break;this.fire(i,{callback:e}),e=null}return e||null},_defShiftFn:function(e){this.indexOf(e.callback)===0&&this._q.shift()},_prepare:function(t){if(a(t)&&t._prepared)return t;var r=e.merge(n.defaults,{context:this,args:[],_prepared:!0},this.defaults,a(t)?{fn:t}:t),i=e.bind(function(){i._running||i.iterations--,a(i.fn)&&i.fn.apply(i.context||e,e.Array(i.args))},this);return e.mix(i,r)},run:function(){var e,t=!0;for(e=this.next();t&&e&&!this.isRunning();e=this.next())t=e.timeout<0?this._execute(e):this._schedule(e);return e||this.fire("complete"),this},_execute:function(e){this._running=e._running=!0,e.iterations--,this.fire(r,{callback:e});var t=this._running&&e.autoContinue;return this._running=e._running=!1,t},_schedule:function(t){return this._running=e.later(t.timeout,this,function(){this._execute(t)&&this.run()}),!1},isRunning:function(){return!!this._running},_defExecFn:function(e){e.callback()},add:function(){return this.fire("add",{callbacks:e.Array(arguments,0,!0)}),this},_defAddFn:function(t){var n=this._q,r=[];e.Array.each(t.callbacks,function(e){u(e)&&(n.push(e),r.push(e))}),t.added=r},pause:function(){return u(this._running)&&this._running.cancel(),this._running=!1,this},stop:function(){return this._q=[],this.pause()},indexOf:function(e){var t=0,n=this._q.length,r;for(;t<n;++t){r=this._q[t];if(r===e||r.id===e)return t}return-1},getCallback:function(e){var t=this.indexOf(e);return t>-1?this._q[t]:null},promote:function(e){var t={callback:e},n;return this.isRunning()?n=this.after(i,function(){this.fire(s,t),n.detach()},this):this.fire(s,t),this},_defPromoteFn:function(e){var t=this.indexOf(e.callback),n=t>-1?this._q.splice(t,1)[0]:null;e.promoted=n,n&&this._q.unshift(n)},remove:function(e){var t={callback:e},n;return this.isRunning()?n=this.after(i,function(){this.fire(o,t),n.detach()},this):this.fire(o,t),this},_defRemoveFn:function(e){var t=this.indexOf(e.callback);e.removed=t>-1?this._q.splice(t,1)[0]:null},size:function(){return this.isRunning()||this.next(),this._q.length}})},"3.7.2",{requires:["event-custom"]});+YUI.add("async-queue",function(e,t){e.AsyncQueue=function(){this._init(),this.add.apply(this,arguments)};var n=e.AsyncQueue,r="execute",i="shift",s="promote",o="remove",u=e.Lang.isObject,a=e.Lang.isFunction;n.defaults=e.mix({autoContinue:!0,iterations:1,timeout:10,until:function(){return this.iterations|=0,this.iterations<=0}},e.config.queueDefaults||{}),e.extend(n,e.EventTarget,{_running:!1,_init:function(){e.EventTarget.call(this,{prefix:"queue",emitFacade:!0}),this._q=[],this.defaults={},this._initEvents()},_initEvents:function(){this.publish({execute:{defaultFn:this._defExecFn,emitFacade:!0},shift:{defaultFn:this._defShiftFn,emitFacade:!0},add:{defaultFn:this._defAddFn,emitFacade:!0},promote:{defaultFn:this._defPromoteFn,emitFacade:!0},remove:{defaultFn:this._defRemoveFn,emitFacade:!0}})},next:function(){var e;while(this._q.length){e=this._q[0]=this._prepare(this._q[0]);if(!e||!e.until())break;this.fire(i,{callback:e}),e=null}return e||null},_defShiftFn:function(e){this.indexOf(e.callback)===0&&this._q.shift()},_prepare:function(t){if(a(t)&&t._prepared)return t;var r=e.merge(n.defaults,{context:this,args:[],_prepared:!0},this.defaults,a(t)?{fn:t}:t),i=e.bind(function(){i._running||i.iterations--,a(i.fn)&&i.fn.apply(i.context||e,e.Array(i.args))},this);return e.mix(i,r)},run:function(){var e,t=!0;for(e=this.next();t&&e&&!this.isRunning();e=this.next())t=e.timeout<0?this._execute(e):this._schedule(e);return e||this.fire("complete"),this},_execute:function(e){this._running=e._running=!0,e.iterations--,this.fire(r,{callback:e});var t=this._running&&e.autoContinue;return this._running=e._running=!1,t},_schedule:function(t){return this._running=e.later(t.timeout,this,function(){this._execute(t)&&this.run()}),!1},isRunning:function(){return!!this._running},_defExecFn:function(e){e.callback()},add:function(){return this.fire("add",{callbacks:e.Array(arguments,0,!0)}),this},_defAddFn:function(t){var n=this._q,r=[];e.Array.each(t.callbacks,function(e){u(e)&&(n.push(e),r.push(e))}),t.added=r},pause:function(){return u(this._running)&&this._running.cancel(),this._running=!1,this},stop:function(){return this._q=[],this.pause()},indexOf:function(e){var t=0,n=this._q.length,r;for(;t<n;++t){r=this._q[t];if(r===e||r.id===e)return t}return-1},getCallback:function(e){var t=this.indexOf(e);return t>-1?this._q[t]:null},promote:function(e){var t={callback:e},n;return this.isRunning()?n=this.after(i,function(){this.fire(s,t),n.detach()},this):this.fire(s,t),this},_defPromoteFn:function(e){var t=this.indexOf(e.callback),n=t>-1?this._q.splice(t,1)[0]:null;e.promoted=n,n&&this._q.unshift(n)},remove:function(e){var t={callback:e},n;return this.isRunning()?n=this.after(i,function(){this.fire(o,t),n.detach()},this):this.fire(o,t),this},_defRemoveFn:function(e){var t=this.indexOf(e.callback);e.removed=t>-1?this._q.splice(t,1)[0]:null},size:function(){return this.isRunning()||this.next(),this._q.length}})},"3.7.3",{requires:["event-custom"]});
bundle/async-queue/async-queue.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -525,4 +525,4 @@ -}, '3.7.2', {"requires": ["event-custom"]});+}, '3.7.3', {"requires": ["event-custom"]});
bundle/attribute-base/attribute-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/attribute-base/attribute-base.js", code: [] };-_yuitest_coverage["build/attribute-base/attribute-base.js"].code=["YUI.add('attribute-base', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-base submodule provides core attribute handling support, with everything"," * aside from complex attribute handling in the provider's constructor."," *"," * @module attribute"," * @submodule attribute-base"," */"," "," /**"," * <p>"," * Attribute provides configurable attribute support along with attribute change events. It is designed to be "," * augmented on to a host class, and provides the host with the ability to configure attributes to store and retrieve state, "," * along with attribute change events."," * </p>"," * <p>For example, attributes added to the host can be configured:</p>"," * <ul>"," * <li>As read only.</li>"," * <li>As write once.</li>"," * <li>With a setter function, which can be used to manipulate"," * values passed to Attribute's <a href=\"#method_set\">set</a> method, before they are stored.</li>"," * <li>With a getter function, which can be used to manipulate stored values,"," * before they are returned by Attribute's <a href=\"#method_get\">get</a> method.</li>"," * <li>With a validator function, to validate values before they are stored.</li>"," * </ul>"," *"," * <p>See the <a href=\"#method_addAttr\">addAttr</a> method, for the complete set of configuration"," * options available for attributes.</p>"," *"," * <p><strong>NOTE:</strong> Most implementations will be better off extending the <a href=\"Base.html\">Base</a> class, "," * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration "," * of attributes for derived classes, accounting for values passed into the constructor.</p>"," *"," * @class Attribute"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," * @uses AttributeCore"," * @uses AttributeEvents"," * @uses EventTarget"," * @uses AttributeExtras"," */"," var Attribute = function() {",""," // Fix #2531929 "," // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior."," // Too late in the release cycle to do anything about the core problem."," // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0)."," this._ATTR_E_FACADE = null;"," this._yuievt = null;",""," Y.AttributeCore.apply(this, arguments);"," Y.AttributeEvents.apply(this, arguments);"," Y.AttributeExtras.apply(this, arguments);"," };",""," Y.mix(Attribute, Y.AttributeCore, false, null, 1);"," Y.mix(Attribute, Y.AttributeExtras, false, null, 1);",""," // Needs to be \"true\", to overwrite methods from AttributeCore"," Y.mix(Attribute, Y.AttributeEvents, true, null, 1);",""," /**"," * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>"," *"," * <p>You can return this value from your setter if you wish to combine validator and setter "," * functionality into a single setter function, which either returns the massaged value to be stored or "," * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>"," *"," * @property INVALID_VALUE"," * @type Object"," * @static"," * @final"," */"," Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce etc.)."," *"," * This property is used internally as a whitelist for faster"," * Y.mix operations."," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @protected"," */"," Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeEvents._ATTR_CFG);",""," Y.Attribute = Attribute;","","}, '3.7.2', {\"requires\": [\"attribute-core\", \"attribute-events\", \"attribute-extras\"]});"];+_yuitest_coverage["build/attribute-base/attribute-base.js"].code=["YUI.add('attribute-base', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-base submodule provides core attribute handling support, with everything"," * aside from complex attribute handling in the provider's constructor."," *"," * @module attribute"," * @submodule attribute-base"," */"," "," /**"," * <p>"," * Attribute provides configurable attribute support along with attribute change events. It is designed to be "," * augmented on to a host class, and provides the host with the ability to configure attributes to store and retrieve state, "," * along with attribute change events."," * </p>"," * <p>For example, attributes added to the host can be configured:</p>"," * <ul>"," * <li>As read only.</li>"," * <li>As write once.</li>"," * <li>With a setter function, which can be used to manipulate"," * values passed to Attribute's <a href=\"#method_set\">set</a> method, before they are stored.</li>"," * <li>With a getter function, which can be used to manipulate stored values,"," * before they are returned by Attribute's <a href=\"#method_get\">get</a> method.</li>"," * <li>With a validator function, to validate values before they are stored.</li>"," * </ul>"," *"," * <p>See the <a href=\"#method_addAttr\">addAttr</a> method, for the complete set of configuration"," * options available for attributes.</p>"," *"," * <p><strong>NOTE:</strong> Most implementations will be better off extending the <a href=\"Base.html\">Base</a> class, "," * instead of augmenting Attribute directly. Base augments Attribute and will handle the initial configuration "," * of attributes for derived classes, accounting for values passed into the constructor.</p>"," *"," * @class Attribute"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," * @uses AttributeCore"," * @uses AttributeEvents"," * @uses EventTarget"," * @uses AttributeExtras"," */"," var Attribute = function() {",""," // Fix #2531929 "," // Complete hack, to make sure the first clone of a node value in IE doesn't doesn't hurt state - maintains 3.4.1 behavior."," // Too late in the release cycle to do anything about the core problem."," // The root issue is that cloning a Y.Node instance results in an object which barfs in IE, when you access it's properties (since 3.3.0)."," this._ATTR_E_FACADE = null;"," this._yuievt = null;",""," Y.AttributeCore.apply(this, arguments);"," Y.AttributeEvents.apply(this, arguments);"," Y.AttributeExtras.apply(this, arguments);"," };",""," Y.mix(Attribute, Y.AttributeCore, false, null, 1);"," Y.mix(Attribute, Y.AttributeExtras, false, null, 1);",""," // Needs to be \"true\", to overwrite methods from AttributeCore"," Y.mix(Attribute, Y.AttributeEvents, true, null, 1);",""," /**"," * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>"," *"," * <p>You can return this value from your setter if you wish to combine validator and setter "," * functionality into a single setter function, which either returns the massaged value to be stored or "," * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>"," *"," * @property INVALID_VALUE"," * @type Object"," * @static"," * @final"," */"," Attribute.INVALID_VALUE = Y.AttributeCore.INVALID_VALUE;",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce etc.)."," *"," * This property is used internally as a whitelist for faster"," * Y.mix operations."," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @protected"," */"," Attribute._ATTR_CFG = Y.AttributeCore._ATTR_CFG.concat(Y.AttributeEvents._ATTR_CFG);",""," Y.Attribute = Attribute;","","}, '3.7.3', {\"requires\": [\"attribute-core\", \"attribute-events\", \"attribute-extras\"]});"]; _yuitest_coverage["build/attribute-base/attribute-base.js"].lines = {"1":0,"54":0,"60":0,"61":0,"63":0,"64":0,"65":0,"68":0,"69":0,"72":0,"86":0,"100":0,"102":0}; _yuitest_coverage["build/attribute-base/attribute-base.js"].functions = {"Attribute:54":0,"(anonymous 1):1":0}; _yuitest_coverage["build/attribute-base/attribute-base.js"].coveredLines = 13;@@ -155,4 +155,4 @@ _yuitest_coverline("build/attribute-base/attribute-base.js", 102); Y.Attribute = Attribute; -}, '3.7.2', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});+}, '3.7.3', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});
bundle/attribute-base/attribute-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -107,4 +107,4 @@ Y.Attribute = Attribute; -}, '3.7.2', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});+}, '3.7.3', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});
bundle/attribute-base/attribute-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-base",function(e,t){var n=function(){this._ATTR_E_FACADE=null,this._yuievt=null,e.AttributeCore.apply(this,arguments),e.AttributeEvents.apply(this,arguments),e.AttributeExtras.apply(this,arguments)};e.mix(n,e.AttributeCore,!1,null,1),e.mix(n,e.AttributeExtras,!1,null,1),e.mix(n,e.AttributeEvents,!0,null,1),n.INVALID_VALUE=e.AttributeCore.INVALID_VALUE,n._ATTR_CFG=e.AttributeCore._ATTR_CFG.concat(e.AttributeEvents._ATTR_CFG),e.Attribute=n},"3.7.2",{requires:["attribute-core","attribute-events","attribute-extras"]});+YUI.add("attribute-base",function(e,t){var n=function(){this._ATTR_E_FACADE=null,this._yuievt=null,e.AttributeCore.apply(this,arguments),e.AttributeEvents.apply(this,arguments),e.AttributeExtras.apply(this,arguments)};e.mix(n,e.AttributeCore,!1,null,1),e.mix(n,e.AttributeExtras,!1,null,1),e.mix(n,e.AttributeEvents,!0,null,1),n.INVALID_VALUE=e.AttributeCore.INVALID_VALUE,n._ATTR_CFG=e.AttributeCore._ATTR_CFG.concat(e.AttributeEvents._ATTR_CFG),e.Attribute=n},"3.7.3",{requires:["attribute-core","attribute-events","attribute-extras"]});
bundle/attribute-base/attribute-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -107,4 +107,4 @@ Y.Attribute = Attribute; -}, '3.7.2', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});+}, '3.7.3', {"requires": ["attribute-core", "attribute-events", "attribute-extras"]});
bundle/attribute-complex/attribute-complex-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/attribute-complex/attribute-complex.js", code: [] };-_yuitest_coverage["build/attribute-complex/attribute-complex.js"].code=["YUI.add('attribute-complex', function (Y, NAME) {",""," /**"," * Adds support for attribute providers to handle complex attributes in the constructor"," *"," * @module attribute"," * @submodule attribute-complex"," * @for Attribute"," */",""," var O = Y.Object,"," DOT = \".\";",""," Y.Attribute.Complex = function() {};"," Y.Attribute.Complex.prototype = {",""," /**"," * Utility method to split out simple attribute name/value pairs (\"x\") "," * from complex attribute name/value pairs (\"x.y.z\"), so that complex"," * attributes can be keyed by the top level attribute name."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object} An object literal with 2 properties - \"simple\" and \"complex\","," * containing simple and complex attribute values respectively keyed "," * by the top level attribute name, or null, if valueHash is falsey."," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," var vals = {},"," subvals = {},"," path,"," attr,"," v, k;",""," if (valueHash) {"," for (k in valueHash) {"," if (valueHash.hasOwnProperty(k)) {"," if (k.indexOf(DOT) !== -1) {"," path = k.split(DOT);"," attr = path.shift();"," v = subvals[attr] = subvals[attr] || [];"," v[v.length] = {"," path : path,"," value: valueHash[k]"," };"," } else {"," vals[k] = valueHash[k];"," }"," }"," }"," return { simple:vals, complex:subvals };"," } else {"," return null;"," }"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {",""," var val = cfg.value,"," valFn = cfg.valueFn,"," tmpVal,"," initValSet = false,"," simple,"," complex,"," i,"," l,"," path,"," subval,"," subvals;",""," if (!cfg.readOnly && initValues) {"," // Simple Attributes"," simple = initValues.simple;"," if (simple && simple.hasOwnProperty(attr)) {"," val = simple[attr];"," initValSet = true;"," }"," }",""," if (valFn && !initValSet) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," tmpVal = valFn.call(this, attr);"," val = tmpVal;"," }"," }",""," if (!cfg.readOnly && initValues) {",""," // Complex Attributes (complex values applied, after simple, in case both are set)"," complex = initValues.complex;",""," if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {"," subvals = complex[attr];"," for (i = 0, l = subvals.length; i < l; ++i) {"," path = subvals[i].path;"," subval = subvals[i].value;"," O.setValue(val, path, subval);"," }"," }"," }",""," return val;"," }"," };",""," Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);",""," // Consistency with the rest of the Attribute addons for now. "," Y.AttributeComplex = Y.Attribute.Complex;","","","}, '3.7.2', {\"requires\": [\"attribute-base\"]});"];+_yuitest_coverage["build/attribute-complex/attribute-complex.js"].code=["YUI.add('attribute-complex', function (Y, NAME) {",""," /**"," * Adds support for attribute providers to handle complex attributes in the constructor"," *"," * @module attribute"," * @submodule attribute-complex"," * @for Attribute"," */",""," var O = Y.Object,"," DOT = \".\";",""," Y.Attribute.Complex = function() {};"," Y.Attribute.Complex.prototype = {",""," /**"," * Utility method to split out simple attribute name/value pairs (\"x\") "," * from complex attribute name/value pairs (\"x.y.z\"), so that complex"," * attributes can be keyed by the top level attribute name."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object} An object literal with 2 properties - \"simple\" and \"complex\","," * containing simple and complex attribute values respectively keyed "," * by the top level attribute name, or null, if valueHash is falsey."," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," var vals = {},"," subvals = {},"," path,"," attr,"," v, k;",""," if (valueHash) {"," for (k in valueHash) {"," if (valueHash.hasOwnProperty(k)) {"," if (k.indexOf(DOT) !== -1) {"," path = k.split(DOT);"," attr = path.shift();"," v = subvals[attr] = subvals[attr] || [];"," v[v.length] = {"," path : path,"," value: valueHash[k]"," };"," } else {"," vals[k] = valueHash[k];"," }"," }"," }"," return { simple:vals, complex:subvals };"," } else {"," return null;"," }"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {",""," var val = cfg.value,"," valFn = cfg.valueFn,"," tmpVal,"," initValSet = false,"," simple,"," complex,"," i,"," l,"," path,"," subval,"," subvals;",""," if (!cfg.readOnly && initValues) {"," // Simple Attributes"," simple = initValues.simple;"," if (simple && simple.hasOwnProperty(attr)) {"," val = simple[attr];"," initValSet = true;"," }"," }",""," if (valFn && !initValSet) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," tmpVal = valFn.call(this, attr);"," val = tmpVal;"," }"," }",""," if (!cfg.readOnly && initValues) {",""," // Complex Attributes (complex values applied, after simple, in case both are set)"," complex = initValues.complex;",""," if (complex && complex.hasOwnProperty(attr) && (val !== undefined) && (val !== null)) {"," subvals = complex[attr];"," for (i = 0, l = subvals.length; i < l; ++i) {"," path = subvals[i].path;"," subval = subvals[i].value;"," O.setValue(val, path, subval);"," }"," }"," }",""," return val;"," }"," };",""," Y.mix(Y.Attribute, Y.Attribute.Complex, true, null, 1);",""," // Consistency with the rest of the Attribute addons for now. "," Y.AttributeComplex = Y.Attribute.Complex;","","","}, '3.7.3', {\"requires\": [\"attribute-base\"]});"]; _yuitest_coverage["build/attribute-complex/attribute-complex.js"].lines = {"1":0,"11":0,"14":0,"15":0,"32":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"50":0,"54":0,"56":0,"77":0,"89":0,"91":0,"92":0,"93":0,"94":0,"98":0,"99":0,"100":0,"102":0,"103":0,"104":0,"108":0,"111":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"123":0,"127":0,"130":0}; _yuitest_coverage["build/attribute-complex/attribute-complex.js"].functions = {"_normAttrVals:31":0,"_getAttrInitVal:75":0,"(anonymous 1):1":0}; _yuitest_coverage["build/attribute-complex/attribute-complex.js"].coveredLines = 39;@@ -211,4 +211,4 @@ Y.AttributeComplex = Y.Attribute.Complex; -}, '3.7.2', {"requires": ["attribute-base"]});+}, '3.7.3', {"requires": ["attribute-base"]});
bundle/attribute-complex/attribute-complex-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -136,4 +136,4 @@ Y.AttributeComplex = Y.Attribute.Complex; -}, '3.7.2', {"requires": ["attribute-base"]});+}, '3.7.3', {"requires": ["attribute-base"]});
bundle/attribute-complex/attribute-complex-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-complex",function(e,t){var n=e.Object,r=".";e.Attribute.Complex=function(){},e.Attribute.Complex.prototype={_normAttrVals:function(e){var t={},n={},i,s,o,u;if(e){for(u in e)e.hasOwnProperty(u)&&(u.indexOf(r)!==-1?(i=u.split(r),s=i.shift(),o=n[s]=n[s]||[],o[o.length]={path:i,value:e[u]}):t[u]=e[u]);return{simple:t,complex:n}}return null},_getAttrInitVal:function(e,t,r){var i=t.value,s=t.valueFn,o,u=!1,a,f,l,c,h,p,d;!t.readOnly&&r&&(a=r.simple,a&&a.hasOwnProperty(e)&&(i=a[e],u=!0)),s&&!u&&(s.call||(s=this[s]),s&&(o=s.call(this,e),i=o));if(!t.readOnly&&r){f=r.complex;if(f&&f.hasOwnProperty(e)&&i!==undefined&&i!==null){d=f[e];for(l=0,c=d.length;l<c;++l)h=d[l].path,p=d[l].value,n.setValue(i,h,p)}}return i}},e.mix(e.Attribute,e.Attribute.Complex,!0,null,1),e.AttributeComplex=e.Attribute.Complex},"3.7.2",{requires:["attribute-base"]});+YUI.add("attribute-complex",function(e,t){var n=e.Object,r=".";e.Attribute.Complex=function(){},e.Attribute.Complex.prototype={_normAttrVals:function(e){var t={},n={},i,s,o,u;if(e){for(u in e)e.hasOwnProperty(u)&&(u.indexOf(r)!==-1?(i=u.split(r),s=i.shift(),o=n[s]=n[s]||[],o[o.length]={path:i,value:e[u]}):t[u]=e[u]);return{simple:t,complex:n}}return null},_getAttrInitVal:function(e,t,r){var i=t.value,s=t.valueFn,o,u=!1,a,f,l,c,h,p,d;!t.readOnly&&r&&(a=r.simple,a&&a.hasOwnProperty(e)&&(i=a[e],u=!0)),s&&!u&&(s.call||(s=this[s]),s&&(o=s.call(this,e),i=o));if(!t.readOnly&&r){f=r.complex;if(f&&f.hasOwnProperty(e)&&i!==undefined&&i!==null){d=f[e];for(l=0,c=d.length;l<c;++l)h=d[l].path,p=d[l].value,n.setValue(i,h,p)}}return i}},e.mix(e.Attribute,e.Attribute.Complex,!0,null,1),e.AttributeComplex=e.Attribute.Complex},"3.7.3",{requires:["attribute-base"]});
bundle/attribute-complex/attribute-complex.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -136,4 +136,4 @@ Y.AttributeComplex = Y.Attribute.Complex; -}, '3.7.2', {"requires": ["attribute-base"]});+}, '3.7.3', {"requires": ["attribute-base"]});
bundle/attribute-core/attribute-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/attribute-core/attribute-core.js", code: [] };-_yuitest_coverage["build/attribute-core/attribute-core.js"].code=["YUI.add('attribute-core', function (Y, NAME) {",""," /**"," * The State class maintains state for a collection of named items, with"," * a varying number of properties defined."," *"," * It avoids the need to create a separate class for the item, and separate instances"," * of these classes for each item, by storing the state in a 2 level hash table,"," * improving performance when the number of items is likely to be large."," *"," * @constructor"," * @class State"," */"," Y.State = function() {"," /**"," * Hash of attributes"," * @property data"," */"," this.data = {};"," };",""," Y.State.prototype = {",""," /**"," * Adds a property to an item."," *"," * @method add"," * @param name {String} The name of the item."," * @param key {String} The name of the property."," * @param val {Any} The value of the property."," */"," add: function(name, key, val) {"," var item = this.data[name];",""," if (!item) {"," item = this.data[name] = {};"," }",""," item[key] = val;"," },",""," /**"," * Adds multiple properties to an item."," *"," * @method addAll"," * @param name {String} The name of the item."," * @param obj {Object} A hash of property/value pairs."," */"," addAll: function(name, obj) {"," var item = this.data[name],"," key;",""," if (!item) {"," item = this.data[name] = {};"," }",""," for (key in obj) {"," if (obj.hasOwnProperty(key)) {"," item[key] = obj[key];"," }"," }"," },",""," /**"," * Removes a property from an item."," *"," * @method remove"," * @param name {String} The name of the item."," * @param key {String} The property to remove."," */"," remove: function(name, key) {"," var item = this.data[name];",""," if (item) {"," delete item[key];"," }"," },",""," /**"," * Removes multiple properties from an item, or removes the item completely."," *"," * @method removeAll"," * @param name {String} The name of the item."," * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed."," */"," removeAll: function(name, obj) {"," var data;",""," if (!obj) {"," data = this.data;",""," if (name in data) {"," delete data[name];"," }"," } else {"," Y.each(obj, function(value, key) {"," this.remove(name, typeof key === 'string' ? key : value);"," }, this);"," }"," },",""," /**"," * For a given item, returns the value of the property requested, or undefined if not found."," *"," * @method get"," * @param name {String} The name of the item"," * @param key {String} Optional. The property value to retrieve."," * @return {Any} The value of the supplied property."," */"," get: function(name, key) {"," var item = this.data[name];",""," if (item) {"," return item[key];"," }"," },",""," /**"," * For the given item, returns an object with all of the"," * item's property/value pairs. By default the object returned"," * is a shallow copy of the stored data, but passing in true"," * as the second parameter will return a reference to the stored"," * data."," *"," * @method getAll"," * @param name {String} The name of the item"," * @param reference {boolean} true, if you want a reference to the stored"," * object"," * @return {Object} An object with property/value pairs for the item."," */"," getAll : function(name, reference) {"," var item = this.data[name],"," key, obj;",""," if (reference) {"," obj = item;"," } else if (item) {"," obj = {};",""," for (key in item) {"," if (item.hasOwnProperty(key)) {"," obj[key] = item[key];"," }"," }"," }",""," return obj;"," }"," };"," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-core submodule provides the lightest level of attribute handling support "," * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),"," * and removeAttr()."," *"," * @module attribute"," * @submodule attribute-core"," */"," var O = Y.Object,"," Lang = Y.Lang,",""," DOT = \".\",",""," // Externally configurable props"," GETTER = \"getter\","," SETTER = \"setter\","," READ_ONLY = \"readOnly\","," WRITE_ONCE = \"writeOnce\","," INIT_ONLY = \"initOnly\","," VALIDATOR = \"validator\","," VALUE = \"value\","," VALUE_FN = \"valueFn\","," LAZY_ADD = \"lazyAdd\",",""," // Used for internal state management"," ADDED = \"added\","," BYPASS_PROXY = \"_bypassProxy\","," INITIALIZING = \"initializing\","," INIT_VALUE = \"initValue\","," LAZY = \"lazy\","," IS_LAZY_ADD = \"isLazyAdd\",",""," INVALID_VALUE;",""," /**"," * <p>"," * AttributeCore provides the lightest level of configurable attribute support. It is designed to be "," * augmented on to a host class, and provides the host with the ability to configure "," * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>."," * </p>"," * <p>For example, attributes added to the host can be configured:</p>"," * <ul>"," * <li>As read only.</li>"," * <li>As write once.</li>"," * <li>With a setter function, which can be used to manipulate"," * values passed to Attribute's <a href=\"#method_set\">set</a> method, before they are stored.</li>"," * <li>With a getter function, which can be used to manipulate stored values,"," * before they are returned by Attribute's <a href=\"#method_get\">get</a> method.</li>"," * <li>With a validator function, to validate values before they are stored.</li>"," * </ul>"," *"," * <p>See the <a href=\"#method_addAttr\">addAttr</a> method, for the complete set of configuration"," * options available for attributes.</p>"," * "," * <p>Object/Classes based on AttributeCore can augment <a href=\"AttributeEvents.html\">AttributeEvents</a> "," * (with true for overwrite) and <a href=\"AttributeExtras.html\">AttributeExtras</a> to add attribute event and "," * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p> "," *"," * @class AttributeCore"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," */"," function AttributeCore(attrs, values, lazy) {"," this._initAttrHost(attrs, values, lazy); "," }",""," /**"," * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>"," *"," * <p>You can return this value from your setter if you wish to combine validator and setter "," * functionality into a single setter function, which either returns the massaged value to be stored or "," * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>"," *"," * @property INVALID_VALUE"," * @type Object"," * @static"," * @final"," */"," AttributeCore.INVALID_VALUE = {};"," INVALID_VALUE = AttributeCore.INVALID_VALUE;",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce etc.)."," *"," * This property is used internally as a whitelist for faster"," * Y.mix operations."," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @protected"," */"," AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];",""," AttributeCore.prototype = {",""," /**"," * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the "," * constructor."," *"," * @method _initAttrHost"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," * @private"," */"," _initAttrHost : function(attrs, values, lazy) {"," this._state = new Y.State();"," this._initAttrs(attrs, values, lazy);"," },",""," /**"," * <p>"," * Adds an attribute with the provided configuration to the host object."," * </p>"," * <p>"," * The config argument object supports the following properties:"," * </p>"," * "," * <dl>"," * <dt>value <Any></dt>"," * <dd>The initial value to set on the attribute</dd>"," *"," * <dt>valueFn <Function | String></dt>"," * <dd>"," * <p>A function, which will return the initial value to set on the attribute. This is useful"," * for cases where the attribute configuration is defined statically, but needs to "," * reference the host instance (\"this\") to obtain an initial value. If both the value and valueFn properties are defined, "," * the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which "," * case the value property is used.</p>"," *"," * <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>"," * </dd>"," *"," * <dt>readOnly <boolean></dt>"," * <dd>Whether or not the attribute is read only. Attributes having readOnly set to true"," * cannot be modified by invoking the set method.</dd>"," *"," * <dt>writeOnce <boolean> or <string></dt>"," * <dd>"," * Whether or not the attribute is \"write once\". Attributes having writeOnce set to true, "," * can only have their values set once, be it through the default configuration, "," * constructor configuration arguments, or by invoking set."," * <p>The writeOnce attribute can also be set to the string \"initOnly\", in which case the attribute can only be set during initialization"," * (when used with Base, this means it can only be set during construction)</p>"," * </dd>"," *"," * <dt>setter <Function | String></dt>"," * <dd>"," * <p>The setter function used to massage or normalize the value passed to the set method for the attribute. "," * The value returned by the setter will be the final stored value. Returning"," * <a href=\"#property_Attribute.INVALID_VALUE\">Attribute.INVALID_VALUE</a>, from the setter will prevent"," * the value from being stored."," * </p>"," * "," * <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>"," * </dd>"," * "," * <dt>getter <Function | String></dt>"," * <dd>"," * <p>"," * The getter function used to massage or normalize the value returned by the get method for the attribute."," * The value returned by the getter function is the value which will be returned to the user when they "," * invoke get."," * </p>"," *"," * <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>"," * </dd>"," *"," * <dt>validator <Function | String></dt>"," * <dd>"," * <p>"," * The validator function invoked prior to setting the stored value. Returning"," * false from the validator function will prevent the value from being stored."," * </p>"," * "," * <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>"," * </dd>"," *"," * <dt>lazyAdd <boolean></dt>"," * <dd>Whether or not to delay initialization of the attribute until the first call to get/set it. "," * This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through "," * the <a href=\"#method_addAttrs\">addAttrs</a> method.</dd>"," *"," * </dl>"," *"," * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with"," * the context (\"this\") set to the host object.</p>"," *"," * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute, "," * and are not intended for public use.</p>"," * "," * @method addAttr"," *"," * @param {String} name The name of the attribute."," * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute."," *"," * <p>"," * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need "," * to protect the original values, you will need to merge the object."," * </p>"," *"," * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set). "," *"," * @return {Object} A reference to the host object."," *"," * @chainable"," */"," addAttr: function(name, config, lazy) {","",""," var host = this, // help compression"," state = host._state,"," value,"," hasValue;",""," config = config || {};",""," lazy = (LAZY_ADD in config) ? config[LAZY_ADD] : lazy;",""," if (lazy && !host.attrAdded(name)) {"," state.addAll(name, {"," lazy : config,"," added : true"," });"," } else {","",""," if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {",""," hasValue = (VALUE in config);","",""," if (hasValue) {"," // We'll go through set, don't want to set value in config directly"," value = config.value;"," delete config.value;"," }",""," config.added = true;"," config.initializing = true;",""," state.addAll(name, config);",""," if (hasValue) {"," // Go through set, so that raw values get normalized/validated"," host.set(name, value);"," }",""," state.remove(name, INITIALIZING);"," }"," }",""," return host;"," },",""," /**"," * Checks if the given attribute has been added to the host"," *"," * @method attrAdded"," * @param {String} name The name of the attribute to check."," * @return {boolean} true if an attribute with the given name has been added, false if it hasn't. This method will return true for lazily added attributes."," */"," attrAdded: function(name) {"," return !!this._state.get(name, ADDED);"," },",""," /**"," * Returns the current value of the attribute. If the attribute"," * has been configured with a 'getter' function, this method will delegate"," * to the 'getter' to obtain the value of the attribute."," *"," * @method get"," *"," * @param {String} name The name of the attribute. If the value of the attribute is an Object, "," * dot notation can be used to obtain the value of a property of the object (e.g. <code>get(\"x.y.z\")</code>)"," *"," * @return {Any} The value of the attribute"," */"," get : function(name) {"," return this._getAttr(name);"," },",""," /**"," * Checks whether or not the attribute is one which has been"," * added lazily and still requires initialization."," *"," * @method _isLazyAttr"," * @private"," * @param {String} name The name of the attribute"," * @return {boolean} true if it's a lazily added attribute, false otherwise."," */"," _isLazyAttr: function(name) {"," return this._state.get(name, LAZY);"," },",""," /**"," * Finishes initializing an attribute which has been lazily added."," *"," * @method _addLazyAttr"," * @private"," * @param {Object} name The name of the attribute"," */"," _addLazyAttr: function(name, cfg) {"," var state = this._state,"," lazyCfg = state.get(name, LAZY);",""," state.add(name, IS_LAZY_ADD, true);"," state.remove(name, LAZY);"," this.addAttr(name, lazyCfg);"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @chainable"," *"," * @param {String} name The name of the attribute. If the "," * current value of the attribute is an Object, dot notation can be used"," * to set the value of a property within the object (e.g. <code>set(\"x.y.z\", 5)</code>)."," *"," * @param {Any} value The value to set the attribute to."," *"," * @return {Object} A reference to the host object."," */"," set : function(name, val) {"," return this._setAttr(name, val);"," },",""," /**"," * Allows setting of readOnly/writeOnce attributes. See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _set"," * @protected"," * @chainable"," * "," * @param {String} name The name of the attribute."," * @param {Any} val The value to set the attribute to."," * @return {Object} A reference to the host object."," */"," _set : function(name, val) {"," return this._setAttr(name, val, null, true);"," },",""," /**"," * Provides the common implementation for the public set and protected _set methods."," *"," * See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _setAttr"," * @protected"," * @chainable"," *"," * @param {String} name The name of the attribute."," * @param {Any} value The value to set the attribute to."," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event."," * This is currently a hack. There's no real need for the AttributeCore implementation"," * to support this parameter, but breaking it out into AttributeEvents, results in"," * additional function hops for the critical path."," * @param {boolean} force If true, allows the caller to set values for "," * readOnly or writeOnce attributes which have already been set."," *"," * @return {Object} A reference to the host object."," */"," _setAttr : function(name, val, opts, force) {"," "," // HACK - no real reason core needs to know about opts, but "," // it adds fn hops if we want to break it out. "," // Not sure it's worth it for this critical path"," "," var allowSet = true,"," state = this._state,"," stateProxy = this._stateProxy,"," cfg,"," initialSet,"," strPath,"," path,"," currVal,"," writeOnce,"," initializing;",""," if (name.indexOf(DOT) !== -1) {"," strPath = name;"," path = name.split(DOT);"," name = path.shift();"," }",""," if (this._isLazyAttr(name)) {"," this._addLazyAttr(name);"," }",""," cfg = state.getAll(name, true) || {}; ",""," initialSet = (!(VALUE in cfg));",""," if (stateProxy && name in stateProxy && !cfg._bypassProxy) {"," // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set? "," initialSet = false;"," }",""," writeOnce = cfg.writeOnce;"," initializing = cfg.initializing;",""," if (!initialSet && !force) {",""," if (writeOnce) {"," allowSet = false;"," }",""," if (cfg.readOnly) {"," allowSet = false;"," }"," }",""," if (!initializing && !force && writeOnce === INIT_ONLY) {"," allowSet = false;"," }",""," if (allowSet) {"," // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)"," if (!initialSet) {"," currVal = this.get(name);"," }",""," if (path) {"," val = O.setValue(Y.clone(currVal), path, val);",""," if (val === undefined) {"," allowSet = false;"," }"," }",""," if (allowSet) {"," if (!this._fireAttrChange || initializing) {"," this._setAttrVal(name, strPath, currVal, val);"," } else {"," // HACK - no real reason core needs to know about _fireAttrChange, but "," // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path"," this._fireAttrChange(name, strPath, currVal, val, opts);"," }"," }"," }",""," return this;"," },",""," /**"," * Provides the common implementation for the public get method,"," * allowing Attribute hosts to over-ride either method."," *"," * See <a href=\"#method_get\">get</a> for argument details."," *"," * @method _getAttr"," * @protected"," * @chainable"," *"," * @param {String} name The name of the attribute."," * @return {Any} The value of the attribute."," */"," _getAttr : function(name) {"," var host = this, // help compression"," fullName = name,"," state = host._state,"," path,"," getter,"," val,"," cfg;",""," if (name.indexOf(DOT) !== -1) {"," path = name.split(DOT);"," name = path.shift();"," }",""," // On Demand - Should be rare - handles out of order valueFn references"," if (host._tCfgs && host._tCfgs[name]) {"," cfg = {};"," cfg[name] = host._tCfgs[name];"," delete host._tCfgs[name];"," host._addAttrs(cfg, host._tVals);"," }"," "," // Lazy Init"," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }",""," val = host._getStateVal(name);"," "," getter = state.get(name, GETTER);",""," if (getter && !getter.call) {"," getter = this[getter];"," }",""," val = (getter) ? getter.call(host, val, fullName) : val;"," val = (path) ? O.getValue(val, path) : val;",""," return val;"," },",""," /**"," * Gets the stored value for the attribute, from either the "," * internal state object, or the state proxy if it exits"," * "," * @method _getStateVal"," * @private"," * @param {String} name The name of the attribute"," * @return {Any} The stored value of the attribute"," */"," _getStateVal : function(name) {"," var stateProxy = this._stateProxy;"," return stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY) ? stateProxy[name] : this._state.get(name, VALUE);"," },",""," /**"," * Sets the stored value for the attribute, in either the "," * internal state object, or the state proxy if it exits"," *"," * @method _setStateVal"," * @private"," * @param {String} name The name of the attribute"," * @param {Any} value The value of the attribute"," */"," _setStateVal : function(name, value) {"," var stateProxy = this._stateProxy;"," if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {"," stateProxy[name] = value;"," } else {"," this._state.add(name, VALUE, value);"," }"," },",""," /**"," * Updates the stored value of the attribute in the privately held State object,"," * if validation and setter passes."," *"," * @method _setAttrVal"," * @private"," * @param {String} attrName The attribute name."," * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property (\"x.y.z\")."," * @param {Any} prevVal The currently stored value of the attribute."," * @param {Any} newVal The value which is going to be stored."," * "," * @return {booolean} true if the new attribute value was stored, false if not."," */"," _setAttrVal : function(attrName, subAttrName, prevVal, newVal) {",""," var host = this,"," allowSet = true,"," cfg = this._state.getAll(attrName, true) || {},"," validator = cfg.validator,"," setter = cfg.setter,"," initializing = cfg.initializing,"," prevRawVal = this._getStateVal(attrName),"," name = subAttrName || attrName,"," retVal,"," valid;",""," if (validator) {"," if (!validator.call) { "," // Assume string - trying to keep critical path tight, so avoiding Lang check"," validator = this[validator];"," }"," if (validator) {"," valid = validator.call(host, newVal, name);",""," if (!valid && initializing) {"," newVal = cfg.defaultValue;"," valid = true; // Assume it's valid, for perf."," }"," }"," }",""," if (!validator || valid) {"," if (setter) {"," if (!setter.call) {"," // Assume string - trying to keep critical path tight, so avoiding Lang check"," setter = this[setter];"," }"," if (setter) {"," retVal = setter.call(host, newVal, name);",""," if (retVal === INVALID_VALUE) {"," allowSet = false;"," } else if (retVal !== undefined){"," newVal = retVal;"," }"," }"," }",""," if (allowSet) {"," if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {"," allowSet = false;"," } else {"," // Store value"," if (!(INIT_VALUE in cfg)) {"," cfg.initValue = newVal;"," }"," host._setStateVal(attrName, newVal);"," }"," }",""," } else {"," allowSet = false;"," }",""," return allowSet;"," },",""," /**"," * Sets multiple attribute values."," *"," * @method setAttrs"," * @param {Object} attrs An object with attributes name/value pairs."," * @return {Object} A reference to the host object."," * @chainable"," */"," setAttrs : function(attrs) {"," return this._setAttrs(attrs);"," },",""," /**"," * Implementation behind the public setAttrs method, to set multiple attribute values."," *"," * @method _setAttrs"," * @protected"," * @param {Object} attrs An object with attributes name/value pairs."," * @return {Object} A reference to the host object."," * @chainable"," */"," _setAttrs : function(attrs) {"," var attr;"," for (attr in attrs) {"," if ( attrs.hasOwnProperty(attr) ) {"," this.set(attr, attrs[attr]);"," }"," }"," return this;"," },",""," /**"," * Gets multiple attribute values."," *"," * @method getAttrs"," * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are"," * returned. If set to true, all attributes modified from their initial values are returned."," * @return {Object} An object with attribute name/value pairs."," */"," getAttrs : function(attrs) {"," return this._getAttrs(attrs);"," },",""," /**"," * Implementation behind the public getAttrs method, to get multiple attribute values."," *"," * @method _getAttrs"," * @protected"," * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are"," * returned. If set to true, all attributes modified from their initial values are returned."," * @return {Object} An object with attribute name/value pairs."," */"," _getAttrs : function(attrs) {"," var obj = {},"," attr, i, len,"," modifiedOnly = (attrs === true);",""," // TODO - figure out how to get all \"added\""," if (!attrs || modifiedOnly) {"," attrs = O.keys(this._state.data);"," }",""," for (i = 0, len = attrs.length; i < len; i++) {"," attr = attrs[i];",""," if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {"," // Go through get, to honor cloning/normalization"," obj[attr] = this.get(attr);"," }"," }",""," return obj;"," },",""," /**"," * Configures a group of attributes, and sets initial values."," *"," * <p>"," * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning. "," * The caller is responsible for merging/cloning the configuration object if required."," * </p>"," *"," * @method addAttrs"," * @chainable"," *"," * @param {Object} cfgs An object with attribute name/configuration pairs."," * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply."," * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only."," * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set."," * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration."," * See <a href=\"#method_addAttr\">addAttr</a>."," * "," * @return {Object} A reference to the host object."," */"," addAttrs : function(cfgs, values, lazy) {"," var host = this; // help compression"," if (cfgs) {"," host._tCfgs = cfgs;"," host._tVals = host._normAttrVals(values);"," host._addAttrs(cfgs, host._tVals, lazy);"," host._tCfgs = host._tVals = null;"," }",""," return host;"," },",""," /**"," * Implementation behind the public addAttrs method. "," * "," * This method is invoked directly by get if it encounters a scenario "," * in which an attribute's valueFn attempts to obtain the "," * value an attribute in the same group of attributes, which has not yet "," * been added (on demand initialization)."," *"," * @method _addAttrs"," * @private"," * @param {Object} cfgs An object with attribute name/configuration pairs."," * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply."," * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only."," * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set."," * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration."," * See <a href=\"#method_addAttr\">addAttr</a>."," */"," _addAttrs : function(cfgs, values, lazy) {"," var host = this, // help compression"," attr,"," attrCfg,"," value;",""," for (attr in cfgs) {"," if (cfgs.hasOwnProperty(attr)) {",""," // Not Merging. Caller is responsible for isolating configs"," attrCfg = cfgs[attr];"," attrCfg.defaultValue = attrCfg.value;",""," // Handle simple, complex and user values, accounting for read-only"," value = host._getAttrInitVal(attr, attrCfg, host._tVals);",""," if (value !== undefined) {"," attrCfg.value = value;"," }",""," if (host._tCfgs[attr]) {"," delete host._tCfgs[attr];"," }",""," host.addAttr(attr, attrCfg, lazy);"," }"," }"," },",""," /**"," * Utility method to protect an attribute configuration"," * hash, by merging the entire object and the individual "," * attr config objects. "," *"," * @method _protectAttrs"," * @protected"," * @param {Object} attrs A hash of attribute to configuration object pairs."," * @return {Object} A protected version of the attrs argument."," */"," _protectAttrs : function(attrs) {"," if (attrs) {"," attrs = Y.merge(attrs);"," for (var attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {"," attrs[attr] = Y.merge(attrs[attr]);"," }"," }"," }"," return attrs;"," },",""," /**"," * Utility method to normalize attribute values. The base implementation "," * simply merges the hash to protect the original."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object}"," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," return (valueHash) ? Y.merge(valueHash) : null;"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {"," var val, valFn;"," // init value is provided by the user if it exists, else, provided by the config"," if (!cfg.readOnly && initValues && initValues.hasOwnProperty(attr)) {"," val = initValues[attr];"," } else {"," val = cfg.value;"," valFn = cfg.valueFn;"," "," if (valFn) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," val = valFn.call(this, attr);"," }"," }"," }","",""," return val;"," },",""," /**"," * Utility method to set up initial attributes defined during construction, either through the constructor.ATTRS property, or explicitly passed in."," * "," * @method _initAttrs"," * @protected"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," */"," _initAttrs : function(attrs, values, lazy) {"," // ATTRS support for Node, which is not Base based"," attrs = attrs || this.constructor.ATTRS;"," "," var Base = Y.Base,"," BaseCore = Y.BaseCore,"," baseInst = (Base && Y.instanceOf(this, Base)),"," baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));",""," if ( attrs && !baseInst && !baseCoreInst) {"," this.addAttrs(this._protectAttrs(attrs), values, lazy);"," }"," }"," };",""," Y.AttributeCore = AttributeCore;","","","}, '3.7.2', {\"requires\": [\"oop\"]});"];+_yuitest_coverage["build/attribute-core/attribute-core.js"].code=["YUI.add('attribute-core', function (Y, NAME) {",""," /**"," * The State class maintains state for a collection of named items, with"," * a varying number of properties defined."," *"," * It avoids the need to create a separate class for the item, and separate instances"," * of these classes for each item, by storing the state in a 2 level hash table,"," * improving performance when the number of items is likely to be large."," *"," * @constructor"," * @class State"," */"," Y.State = function() {"," /**"," * Hash of attributes"," * @property data"," */"," this.data = {};"," };",""," Y.State.prototype = {",""," /**"," * Adds a property to an item."," *"," * @method add"," * @param name {String} The name of the item."," * @param key {String} The name of the property."," * @param val {Any} The value of the property."," */"," add: function(name, key, val) {"," var item = this.data[name];",""," if (!item) {"," item = this.data[name] = {};"," }",""," item[key] = val;"," },",""," /**"," * Adds multiple properties to an item."," *"," * @method addAll"," * @param name {String} The name of the item."," * @param obj {Object} A hash of property/value pairs."," */"," addAll: function(name, obj) {"," var item = this.data[name],"," key;",""," if (!item) {"," item = this.data[name] = {};"," }",""," for (key in obj) {"," if (obj.hasOwnProperty(key)) {"," item[key] = obj[key];"," }"," }"," },",""," /**"," * Removes a property from an item."," *"," * @method remove"," * @param name {String} The name of the item."," * @param key {String} The property to remove."," */"," remove: function(name, key) {"," var item = this.data[name];",""," if (item) {"," delete item[key];"," }"," },",""," /**"," * Removes multiple properties from an item, or removes the item completely."," *"," * @method removeAll"," * @param name {String} The name of the item."," * @param obj {Object|Array} Collection of properties to delete. If not provided, the entire item is removed."," */"," removeAll: function(name, obj) {"," var data;",""," if (!obj) {"," data = this.data;",""," if (name in data) {"," delete data[name];"," }"," } else {"," Y.each(obj, function(value, key) {"," this.remove(name, typeof key === 'string' ? key : value);"," }, this);"," }"," },",""," /**"," * For a given item, returns the value of the property requested, or undefined if not found."," *"," * @method get"," * @param name {String} The name of the item"," * @param key {String} Optional. The property value to retrieve."," * @return {Any} The value of the supplied property."," */"," get: function(name, key) {"," var item = this.data[name];",""," if (item) {"," return item[key];"," }"," },",""," /**"," * For the given item, returns an object with all of the"," * item's property/value pairs. By default the object returned"," * is a shallow copy of the stored data, but passing in true"," * as the second parameter will return a reference to the stored"," * data."," *"," * @method getAll"," * @param name {String} The name of the item"," * @param reference {boolean} true, if you want a reference to the stored"," * object"," * @return {Object} An object with property/value pairs for the item."," */"," getAll : function(name, reference) {"," var item = this.data[name],"," key, obj;",""," if (reference) {"," obj = item;"," } else if (item) {"," obj = {};",""," for (key in item) {"," if (item.hasOwnProperty(key)) {"," obj[key] = item[key];"," }"," }"," }",""," return obj;"," }"," };"," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-core submodule provides the lightest level of attribute handling support "," * without Attribute change events, or lesser used methods such as reset(), modifyAttrs(),"," * and removeAttr()."," *"," * @module attribute"," * @submodule attribute-core"," */"," var O = Y.Object,"," Lang = Y.Lang,",""," DOT = \".\",",""," // Externally configurable props"," GETTER = \"getter\","," SETTER = \"setter\","," READ_ONLY = \"readOnly\","," WRITE_ONCE = \"writeOnce\","," INIT_ONLY = \"initOnly\","," VALIDATOR = \"validator\","," VALUE = \"value\","," VALUE_FN = \"valueFn\","," LAZY_ADD = \"lazyAdd\",",""," // Used for internal state management"," ADDED = \"added\","," BYPASS_PROXY = \"_bypassProxy\","," INITIALIZING = \"initializing\","," INIT_VALUE = \"initValue\","," LAZY = \"lazy\","," IS_LAZY_ADD = \"isLazyAdd\",",""," INVALID_VALUE;",""," /**"," * <p>"," * AttributeCore provides the lightest level of configurable attribute support. It is designed to be "," * augmented on to a host class, and provides the host with the ability to configure "," * attributes to store and retrieve state, <strong>but without support for attribute change events</strong>."," * </p>"," * <p>For example, attributes added to the host can be configured:</p>"," * <ul>"," * <li>As read only.</li>"," * <li>As write once.</li>"," * <li>With a setter function, which can be used to manipulate"," * values passed to Attribute's <a href=\"#method_set\">set</a> method, before they are stored.</li>"," * <li>With a getter function, which can be used to manipulate stored values,"," * before they are returned by Attribute's <a href=\"#method_get\">get</a> method.</li>"," * <li>With a validator function, to validate values before they are stored.</li>"," * </ul>"," *"," * <p>See the <a href=\"#method_addAttr\">addAttr</a> method, for the complete set of configuration"," * options available for attributes.</p>"," * "," * <p>Object/Classes based on AttributeCore can augment <a href=\"AttributeEvents.html\">AttributeEvents</a> "," * (with true for overwrite) and <a href=\"AttributeExtras.html\">AttributeExtras</a> to add attribute event and "," * additional, less commonly used attribute methods, such as `modifyAttr`, `removeAttr` and `reset`.</p> "," *"," * @class AttributeCore"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," */"," function AttributeCore(attrs, values, lazy) {"," this._initAttrHost(attrs, values, lazy); "," }",""," /**"," * <p>The value to return from an attribute setter in order to prevent the set from going through.</p>"," *"," * <p>You can return this value from your setter if you wish to combine validator and setter "," * functionality into a single setter function, which either returns the massaged value to be stored or "," * AttributeCore.INVALID_VALUE to prevent invalid values from being stored.</p>"," *"," * @property INVALID_VALUE"," * @type Object"," * @static"," * @final"," */"," AttributeCore.INVALID_VALUE = {};"," INVALID_VALUE = AttributeCore.INVALID_VALUE;",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce etc.)."," *"," * This property is used internally as a whitelist for faster"," * Y.mix operations."," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @protected"," */"," AttributeCore._ATTR_CFG = [SETTER, GETTER, VALIDATOR, VALUE, VALUE_FN, WRITE_ONCE, READ_ONLY, LAZY_ADD, BYPASS_PROXY];",""," AttributeCore.prototype = {",""," /**"," * Constructor logic for attributes. Initializes the host state, and sets up the inital attributes passed to the "," * constructor."," *"," * @method _initAttrHost"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," * @private"," */"," _initAttrHost : function(attrs, values, lazy) {"," this._state = new Y.State();"," this._initAttrs(attrs, values, lazy);"," },",""," /**"," * <p>"," * Adds an attribute with the provided configuration to the host object."," * </p>"," * <p>"," * The config argument object supports the following properties:"," * </p>"," * "," * <dl>"," * <dt>value <Any></dt>"," * <dd>The initial value to set on the attribute</dd>"," *"," * <dt>valueFn <Function | String></dt>"," * <dd>"," * <p>A function, which will return the initial value to set on the attribute. This is useful"," * for cases where the attribute configuration is defined statically, but needs to "," * reference the host instance (\"this\") to obtain an initial value. If both the value and valueFn properties are defined, "," * the value returned by the valueFn has precedence over the value property, unless it returns undefined, in which "," * case the value property is used.</p>"," *"," * <p>valueFn can also be set to a string, representing the name of the instance method to be used to retrieve the value.</p>"," * </dd>"," *"," * <dt>readOnly <boolean></dt>"," * <dd>Whether or not the attribute is read only. Attributes having readOnly set to true"," * cannot be modified by invoking the set method.</dd>"," *"," * <dt>writeOnce <boolean> or <string></dt>"," * <dd>"," * Whether or not the attribute is \"write once\". Attributes having writeOnce set to true, "," * can only have their values set once, be it through the default configuration, "," * constructor configuration arguments, or by invoking set."," * <p>The writeOnce attribute can also be set to the string \"initOnly\", in which case the attribute can only be set during initialization"," * (when used with Base, this means it can only be set during construction)</p>"," * </dd>"," *"," * <dt>setter <Function | String></dt>"," * <dd>"," * <p>The setter function used to massage or normalize the value passed to the set method for the attribute. "," * The value returned by the setter will be the final stored value. Returning"," * <a href=\"#property_Attribute.INVALID_VALUE\">Attribute.INVALID_VALUE</a>, from the setter will prevent"," * the value from being stored."," * </p>"," * "," * <p>setter can also be set to a string, representing the name of the instance method to be used as the setter function.</p>"," * </dd>"," * "," * <dt>getter <Function | String></dt>"," * <dd>"," * <p>"," * The getter function used to massage or normalize the value returned by the get method for the attribute."," * The value returned by the getter function is the value which will be returned to the user when they "," * invoke get."," * </p>"," *"," * <p>getter can also be set to a string, representing the name of the instance method to be used as the getter function.</p>"," * </dd>"," *"," * <dt>validator <Function | String></dt>"," * <dd>"," * <p>"," * The validator function invoked prior to setting the stored value. Returning"," * false from the validator function will prevent the value from being stored."," * </p>"," * "," * <p>validator can also be set to a string, representing the name of the instance method to be used as the validator function.</p>"," * </dd>"," *"," * <dt>lazyAdd <boolean></dt>"," * <dd>Whether or not to delay initialization of the attribute until the first call to get/set it. "," * This flag can be used to over-ride lazy initialization on a per attribute basis, when adding multiple attributes through "," * the <a href=\"#method_addAttrs\">addAttrs</a> method.</dd>"," *"," * </dl>"," *"," * <p>The setter, getter and validator are invoked with the value and name passed in as the first and second arguments, and with"," * the context (\"this\") set to the host object.</p>"," *"," * <p>Configuration properties outside of the list mentioned above are considered private properties used internally by attribute, "," * and are not intended for public use.</p>"," * "," * @method addAttr"," *"," * @param {String} name The name of the attribute."," * @param {Object} config An object with attribute configuration property/value pairs, specifying the configuration for the attribute."," *"," * <p>"," * <strong>NOTE:</strong> The configuration object is modified when adding an attribute, so if you need "," * to protect the original values, you will need to merge the object."," * </p>"," *"," * @param {boolean} lazy (optional) Whether or not to add this attribute lazily (on the first call to get/set). "," *"," * @return {Object} A reference to the host object."," *"," * @chainable"," */"," addAttr: function(name, config, lazy) {","",""," var host = this, // help compression"," state = host._state,"," value,"," hasValue;",""," config = config || {};",""," lazy = (LAZY_ADD in config) ? config[LAZY_ADD] : lazy;",""," if (lazy && !host.attrAdded(name)) {"," state.addAll(name, {"," lazy : config,"," added : true"," });"," } else {","",""," if (!host.attrAdded(name) || state.get(name, IS_LAZY_ADD)) {",""," hasValue = (VALUE in config);","",""," if (hasValue) {"," // We'll go through set, don't want to set value in config directly"," value = config.value;"," delete config.value;"," }",""," config.added = true;"," config.initializing = true;",""," state.addAll(name, config);",""," if (hasValue) {"," // Go through set, so that raw values get normalized/validated"," host.set(name, value);"," }",""," state.remove(name, INITIALIZING);"," }"," }",""," return host;"," },",""," /**"," * Checks if the given attribute has been added to the host"," *"," * @method attrAdded"," * @param {String} name The name of the attribute to check."," * @return {boolean} true if an attribute with the given name has been added, false if it hasn't. This method will return true for lazily added attributes."," */"," attrAdded: function(name) {"," return !!this._state.get(name, ADDED);"," },",""," /**"," * Returns the current value of the attribute. If the attribute"," * has been configured with a 'getter' function, this method will delegate"," * to the 'getter' to obtain the value of the attribute."," *"," * @method get"," *"," * @param {String} name The name of the attribute. If the value of the attribute is an Object, "," * dot notation can be used to obtain the value of a property of the object (e.g. <code>get(\"x.y.z\")</code>)"," *"," * @return {Any} The value of the attribute"," */"," get : function(name) {"," return this._getAttr(name);"," },",""," /**"," * Checks whether or not the attribute is one which has been"," * added lazily and still requires initialization."," *"," * @method _isLazyAttr"," * @private"," * @param {String} name The name of the attribute"," * @return {boolean} true if it's a lazily added attribute, false otherwise."," */"," _isLazyAttr: function(name) {"," return this._state.get(name, LAZY);"," },",""," /**"," * Finishes initializing an attribute which has been lazily added."," *"," * @method _addLazyAttr"," * @private"," * @param {Object} name The name of the attribute"," */"," _addLazyAttr: function(name, cfg) {"," var state = this._state,"," lazyCfg = state.get(name, LAZY);",""," state.add(name, IS_LAZY_ADD, true);"," state.remove(name, LAZY);"," this.addAttr(name, lazyCfg);"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @chainable"," *"," * @param {String} name The name of the attribute. If the "," * current value of the attribute is an Object, dot notation can be used"," * to set the value of a property within the object (e.g. <code>set(\"x.y.z\", 5)</code>)."," *"," * @param {Any} value The value to set the attribute to."," *"," * @return {Object} A reference to the host object."," */"," set : function(name, val) {"," return this._setAttr(name, val);"," },",""," /**"," * Allows setting of readOnly/writeOnce attributes. See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _set"," * @protected"," * @chainable"," * "," * @param {String} name The name of the attribute."," * @param {Any} val The value to set the attribute to."," * @return {Object} A reference to the host object."," */"," _set : function(name, val) {"," return this._setAttr(name, val, null, true);"," },",""," /**"," * Provides the common implementation for the public set and protected _set methods."," *"," * See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _setAttr"," * @protected"," * @chainable"," *"," * @param {String} name The name of the attribute."," * @param {Any} value The value to set the attribute to."," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event."," * This is currently a hack. There's no real need for the AttributeCore implementation"," * to support this parameter, but breaking it out into AttributeEvents, results in"," * additional function hops for the critical path."," * @param {boolean} force If true, allows the caller to set values for "," * readOnly or writeOnce attributes which have already been set."," *"," * @return {Object} A reference to the host object."," */"," _setAttr : function(name, val, opts, force) {"," "," // HACK - no real reason core needs to know about opts, but "," // it adds fn hops if we want to break it out. "," // Not sure it's worth it for this critical path"," "," var allowSet = true,"," state = this._state,"," stateProxy = this._stateProxy,"," cfg,"," initialSet,"," strPath,"," path,"," currVal,"," writeOnce,"," initializing;",""," if (name.indexOf(DOT) !== -1) {"," strPath = name;"," path = name.split(DOT);"," name = path.shift();"," }",""," if (this._isLazyAttr(name)) {"," this._addLazyAttr(name);"," }",""," cfg = state.getAll(name, true) || {}; ",""," initialSet = (!(VALUE in cfg));",""," if (stateProxy && name in stateProxy && !cfg._bypassProxy) {"," // TODO: Value is always set for proxy. Can we do any better? Maybe take a snapshot as the initial value for the first call to set? "," initialSet = false;"," }",""," writeOnce = cfg.writeOnce;"," initializing = cfg.initializing;",""," if (!initialSet && !force) {",""," if (writeOnce) {"," allowSet = false;"," }",""," if (cfg.readOnly) {"," allowSet = false;"," }"," }",""," if (!initializing && !force && writeOnce === INIT_ONLY) {"," allowSet = false;"," }",""," if (allowSet) {"," // Don't need currVal if initialSet (might fail in custom getter if it always expects a non-undefined/non-null value)"," if (!initialSet) {"," currVal = this.get(name);"," }",""," if (path) {"," val = O.setValue(Y.clone(currVal), path, val);",""," if (val === undefined) {"," allowSet = false;"," }"," }",""," if (allowSet) {"," if (!this._fireAttrChange || initializing) {"," this._setAttrVal(name, strPath, currVal, val);"," } else {"," // HACK - no real reason core needs to know about _fireAttrChange, but "," // it adds fn hops if we want to break it out. Not sure it's worth it for this critical path"," this._fireAttrChange(name, strPath, currVal, val, opts);"," }"," }"," }",""," return this;"," },",""," /**"," * Provides the common implementation for the public get method,"," * allowing Attribute hosts to over-ride either method."," *"," * See <a href=\"#method_get\">get</a> for argument details."," *"," * @method _getAttr"," * @protected"," * @chainable"," *"," * @param {String} name The name of the attribute."," * @return {Any} The value of the attribute."," */"," _getAttr : function(name) {"," var host = this, // help compression"," fullName = name,"," state = host._state,"," path,"," getter,"," val,"," cfg;",""," if (name.indexOf(DOT) !== -1) {"," path = name.split(DOT);"," name = path.shift();"," }",""," // On Demand - Should be rare - handles out of order valueFn references"," if (host._tCfgs && host._tCfgs[name]) {"," cfg = {};"," cfg[name] = host._tCfgs[name];"," delete host._tCfgs[name];"," host._addAttrs(cfg, host._tVals);"," }"," "," // Lazy Init"," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }",""," val = host._getStateVal(name);"," "," getter = state.get(name, GETTER);",""," if (getter && !getter.call) {"," getter = this[getter];"," }",""," val = (getter) ? getter.call(host, val, fullName) : val;"," val = (path) ? O.getValue(val, path) : val;",""," return val;"," },",""," /**"," * Gets the stored value for the attribute, from either the "," * internal state object, or the state proxy if it exits"," * "," * @method _getStateVal"," * @private"," * @param {String} name The name of the attribute"," * @return {Any} The stored value of the attribute"," */"," _getStateVal : function(name) {"," var stateProxy = this._stateProxy;"," return stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY) ? stateProxy[name] : this._state.get(name, VALUE);"," },",""," /**"," * Sets the stored value for the attribute, in either the "," * internal state object, or the state proxy if it exits"," *"," * @method _setStateVal"," * @private"," * @param {String} name The name of the attribute"," * @param {Any} value The value of the attribute"," */"," _setStateVal : function(name, value) {"," var stateProxy = this._stateProxy;"," if (stateProxy && (name in stateProxy) && !this._state.get(name, BYPASS_PROXY)) {"," stateProxy[name] = value;"," } else {"," this._state.add(name, VALUE, value);"," }"," },",""," /**"," * Updates the stored value of the attribute in the privately held State object,"," * if validation and setter passes."," *"," * @method _setAttrVal"," * @private"," * @param {String} attrName The attribute name."," * @param {String} subAttrName The sub-attribute name, if setting a sub-attribute property (\"x.y.z\")."," * @param {Any} prevVal The currently stored value of the attribute."," * @param {Any} newVal The value which is going to be stored."," * "," * @return {booolean} true if the new attribute value was stored, false if not."," */"," _setAttrVal : function(attrName, subAttrName, prevVal, newVal) {",""," var host = this,"," allowSet = true,"," cfg = this._state.getAll(attrName, true) || {},"," validator = cfg.validator,"," setter = cfg.setter,"," initializing = cfg.initializing,"," prevRawVal = this._getStateVal(attrName),"," name = subAttrName || attrName,"," retVal,"," valid;",""," if (validator) {"," if (!validator.call) { "," // Assume string - trying to keep critical path tight, so avoiding Lang check"," validator = this[validator];"," }"," if (validator) {"," valid = validator.call(host, newVal, name);",""," if (!valid && initializing) {"," newVal = cfg.defaultValue;"," valid = true; // Assume it's valid, for perf."," }"," }"," }",""," if (!validator || valid) {"," if (setter) {"," if (!setter.call) {"," // Assume string - trying to keep critical path tight, so avoiding Lang check"," setter = this[setter];"," }"," if (setter) {"," retVal = setter.call(host, newVal, name);",""," if (retVal === INVALID_VALUE) {"," allowSet = false;"," } else if (retVal !== undefined){"," newVal = retVal;"," }"," }"," }",""," if (allowSet) {"," if(!subAttrName && (newVal === prevRawVal) && !Lang.isObject(newVal)) {"," allowSet = false;"," } else {"," // Store value"," if (!(INIT_VALUE in cfg)) {"," cfg.initValue = newVal;"," }"," host._setStateVal(attrName, newVal);"," }"," }",""," } else {"," allowSet = false;"," }",""," return allowSet;"," },",""," /**"," * Sets multiple attribute values."," *"," * @method setAttrs"," * @param {Object} attrs An object with attributes name/value pairs."," * @return {Object} A reference to the host object."," * @chainable"," */"," setAttrs : function(attrs) {"," return this._setAttrs(attrs);"," },",""," /**"," * Implementation behind the public setAttrs method, to set multiple attribute values."," *"," * @method _setAttrs"," * @protected"," * @param {Object} attrs An object with attributes name/value pairs."," * @return {Object} A reference to the host object."," * @chainable"," */"," _setAttrs : function(attrs) {"," var attr;"," for (attr in attrs) {"," if ( attrs.hasOwnProperty(attr) ) {"," this.set(attr, attrs[attr]);"," }"," }"," return this;"," },",""," /**"," * Gets multiple attribute values."," *"," * @method getAttrs"," * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are"," * returned. If set to true, all attributes modified from their initial values are returned."," * @return {Object} An object with attribute name/value pairs."," */"," getAttrs : function(attrs) {"," return this._getAttrs(attrs);"," },",""," /**"," * Implementation behind the public getAttrs method, to get multiple attribute values."," *"," * @method _getAttrs"," * @protected"," * @param {Array | boolean} attrs Optional. An array of attribute names. If omitted, all attribute values are"," * returned. If set to true, all attributes modified from their initial values are returned."," * @return {Object} An object with attribute name/value pairs."," */"," _getAttrs : function(attrs) {"," var obj = {},"," attr, i, len,"," modifiedOnly = (attrs === true);",""," // TODO - figure out how to get all \"added\""," if (!attrs || modifiedOnly) {"," attrs = O.keys(this._state.data);"," }",""," for (i = 0, len = attrs.length; i < len; i++) {"," attr = attrs[i];",""," if (!modifiedOnly || this._getStateVal(attr) != this._state.get(attr, INIT_VALUE)) {"," // Go through get, to honor cloning/normalization"," obj[attr] = this.get(attr);"," }"," }",""," return obj;"," },",""," /**"," * Configures a group of attributes, and sets initial values."," *"," * <p>"," * <strong>NOTE:</strong> This method does not isolate the configuration object by merging/cloning. "," * The caller is responsible for merging/cloning the configuration object if required."," * </p>"," *"," * @method addAttrs"," * @chainable"," *"," * @param {Object} cfgs An object with attribute name/configuration pairs."," * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply."," * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only."," * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set."," * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration."," * See <a href=\"#method_addAttr\">addAttr</a>."," * "," * @return {Object} A reference to the host object."," */"," addAttrs : function(cfgs, values, lazy) {"," var host = this; // help compression"," if (cfgs) {"," host._tCfgs = cfgs;"," host._tVals = host._normAttrVals(values);"," host._addAttrs(cfgs, host._tVals, lazy);"," host._tCfgs = host._tVals = null;"," }",""," return host;"," },",""," /**"," * Implementation behind the public addAttrs method. "," * "," * This method is invoked directly by get if it encounters a scenario "," * in which an attribute's valueFn attempts to obtain the "," * value an attribute in the same group of attributes, which has not yet "," * been added (on demand initialization)."," *"," * @method _addAttrs"," * @private"," * @param {Object} cfgs An object with attribute name/configuration pairs."," * @param {Object} values An object with attribute name/value pairs, defining the initial values to apply."," * Values defined in the cfgs argument will be over-written by values in this argument unless defined as read only."," * @param {boolean} lazy Whether or not to delay the intialization of these attributes until the first call to get/set."," * Individual attributes can over-ride this behavior by defining a lazyAdd configuration property in their configuration."," * See <a href=\"#method_addAttr\">addAttr</a>."," */"," _addAttrs : function(cfgs, values, lazy) {"," var host = this, // help compression"," attr,"," attrCfg,"," value;",""," for (attr in cfgs) {"," if (cfgs.hasOwnProperty(attr)) {",""," // Not Merging. Caller is responsible for isolating configs"," attrCfg = cfgs[attr];"," attrCfg.defaultValue = attrCfg.value;",""," // Handle simple, complex and user values, accounting for read-only"," value = host._getAttrInitVal(attr, attrCfg, host._tVals);",""," if (value !== undefined) {"," attrCfg.value = value;"," }",""," if (host._tCfgs[attr]) {"," delete host._tCfgs[attr];"," }",""," host.addAttr(attr, attrCfg, lazy);"," }"," }"," },",""," /**"," * Utility method to protect an attribute configuration"," * hash, by merging the entire object and the individual "," * attr config objects. "," *"," * @method _protectAttrs"," * @protected"," * @param {Object} attrs A hash of attribute to configuration object pairs."," * @return {Object} A protected version of the attrs argument."," */"," _protectAttrs : function(attrs) {"," if (attrs) {"," attrs = Y.merge(attrs);"," for (var attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {"," attrs[attr] = Y.merge(attrs[attr]);"," }"," }"," }"," return attrs;"," },",""," /**"," * Utility method to normalize attribute values. The base implementation "," * simply merges the hash to protect the original."," *"," * @method _normAttrVals"," * @param {Object} valueHash An object with attribute name/value pairs"," *"," * @return {Object}"," *"," * @private"," */"," _normAttrVals : function(valueHash) {"," return (valueHash) ? Y.merge(valueHash) : null;"," },",""," /**"," * Returns the initial value of the given attribute from"," * either the default configuration provided, or the "," * over-ridden value if it exists in the set of initValues "," * provided and the attribute is not read-only."," *"," * @param {String} attr The name of the attribute"," * @param {Object} cfg The attribute configuration object"," * @param {Object} initValues The object with simple and complex attribute name/value pairs returned from _normAttrVals"," *"," * @return {Any} The initial value of the attribute."," *"," * @method _getAttrInitVal"," * @private"," */"," _getAttrInitVal : function(attr, cfg, initValues) {"," var val, valFn;"," // init value is provided by the user if it exists, else, provided by the config"," if (!cfg.readOnly && initValues && initValues.hasOwnProperty(attr)) {"," val = initValues[attr];"," } else {"," val = cfg.value;"," valFn = cfg.valueFn;"," "," if (valFn) {"," if (!valFn.call) {"," valFn = this[valFn];"," }"," if (valFn) {"," val = valFn.call(this, attr);"," }"," }"," }","",""," return val;"," },",""," /**"," * Utility method to set up initial attributes defined during construction, either through the constructor.ATTRS property, or explicitly passed in."," * "," * @method _initAttrs"," * @protected"," * @param attrs {Object} The attributes to add during construction (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These can also be defined on the constructor being augmented with Attribute by defining the ATTRS property on the constructor."," * @param values {Object} The initial attribute values to apply (passed through to <a href=\"#method_addAttrs\">addAttrs</a>). These are not merged/cloned. The caller is responsible for isolating user provided values if required."," * @param lazy {boolean} Whether or not to add attributes lazily (passed through to <a href=\"#method_addAttrs\">addAttrs</a>)."," */"," _initAttrs : function(attrs, values, lazy) {"," // ATTRS support for Node, which is not Base based"," attrs = attrs || this.constructor.ATTRS;"," "," var Base = Y.Base,"," BaseCore = Y.BaseCore,"," baseInst = (Base && Y.instanceOf(this, Base)),"," baseCoreInst = (!baseInst && BaseCore && Y.instanceOf(this, BaseCore));",""," if ( attrs && !baseInst && !baseCoreInst) {"," this.addAttrs(this._protectAttrs(attrs), values, lazy);"," }"," }"," };",""," Y.AttributeCore = AttributeCore;","","","}, '3.7.3', {\"requires\": [\"oop\"]});"]; _yuitest_coverage["build/attribute-core/attribute-core.js"].lines = {"1":0,"14":0,"19":0,"22":0,"33":0,"35":0,"36":0,"39":0,"50":0,"53":0,"54":0,"57":0,"58":0,"59":0,"72":0,"74":0,"75":0,"87":0,"89":0,"90":0,"92":0,"93":0,"96":0,"97":0,"111":0,"113":0,"114":0,"132":0,"135":0,"136":0,"137":0,"138":0,"140":0,"141":0,"142":0,"147":0,"168":0,"223":0,"224":0,"239":0,"240":0,"254":0,"256":0,"269":0,"270":0,"373":0,"378":0,"380":0,"382":0,"383":0,"390":0,"392":0,"395":0,"397":0,"398":0,"401":0,"402":0,"404":0,"406":0,"408":0,"411":0,"415":0,"426":0,"442":0,"455":0,"466":0,"469":0,"470":0,"471":0,"489":0,"504":0,"534":0,"545":0,"546":0,"547":0,"548":0,"551":0,"552":0,"555":0,"557":0,"559":0,"561":0,"564":0,"565":0,"567":0,"569":0,"570":0,"573":0,"574":0,"578":0,"579":0,"582":0,"584":0,"585":0,"588":0,"589":0,"591":0,"592":0,"596":0,"597":0,"598":0,"602":0,"607":0,"624":0,"632":0,"633":0,"634":0,"638":0,"639":0,"640":0,"641":0,"642":0,"646":0,"647":0,"650":0,"652":0,"654":0,"655":0,"658":0,"659":0,"661":0,"674":0,"675":0,"688":0,"689":0,"690":0,"692":0,"711":0,"722":0,"723":0,"725":0,"727":0,"728":0,"730":0,"731":0,"732":0,"737":0,"738":0,"739":0,"741":0,"743":0,"744":0,"746":0,"747":0,"748":0,"749":0,"754":0,"755":0,"756":0,"759":0,"760":0,"762":0,"767":0,"770":0,"782":0,"795":0,"796":0,"797":0,"798":0,"801":0,"813":0,"826":0,"831":0,"832":0,"835":0,"836":0,"838":0,"840":0,"844":0,"868":0,"869":0,"870":0,"871":0,"872":0,"873":0,"876":0,"897":0,"902":0,"903":0,"906":0,"907":0,"910":0,"912":0,"913":0,"916":0,"917":0,"920":0,"936":0,"937":0,"938":0,"939":0,"940":0,"944":0,"959":0,"978":0,"980":0,"981":0,"983":0,"984":0,"986":0,"987":0,"988":0,"990":0,"991":0,"997":0,"1011":0,"1013":0,"1018":0,"1019":0,"1024":0}; _yuitest_coverage["build/attribute-core/attribute-core.js"].functions = {"State:14":0,"add:32":0,"addAll:49":0,"remove:71":0,"(anonymous 2):96":0,"removeAll:86":0,"get:110":0,"getAll:131":0,"AttributeCore:223":0,"_initAttrHost:268":0,"addAttr:370":0,"attrAdded:425":0,"get:441":0,"_isLazyAttr:454":0,"_addLazyAttr:465":0,"set:488":0,"_set:503":0,"_setAttr:528":0,"_getAttr:623":0,"_getStateVal:673":0,"_setStateVal:687":0,"_setAttrVal:709":0,"setAttrs:781":0,"_setAttrs:794":0,"getAttrs:812":0,"_getAttrs:825":0,"addAttrs:867":0,"_addAttrs:896":0,"_protectAttrs:935":0,"_normAttrVals:958":0,"_getAttrInitVal:977":0,"_initAttrs:1009":0,"(anonymous 1):1":0}; _yuitest_coverage["build/attribute-core/attribute-core.js"].coveredLines = 210;@@ -1306,4 +1306,4 @@ Y.AttributeCore = AttributeCore; -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/attribute-core/attribute-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1042,4 +1042,4 @@ Y.AttributeCore = AttributeCore; -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/attribute-core/attribute-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-core",function(e,t){function E(e,t,n){this._initAttrHost(e,t,n)}e.State=function(){this.data={}},e.State.prototype={add:function(e,t,n){var r=this.data[e];r||(r=this.data[e]={}),r[t]=n},addAll:function(e,t){var n=this.data[e],r;n||(n=this.data[e]={});for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r])},remove:function(e,t){var n=this.data[e];n&&delete n[t]},removeAll:function(t,n){var r;n?e.each(n,function(e,n){this.remove(t,typeof n=="string"?n:e)},this):(r=this.data,t in r&&delete r[t])},get:function(e,t){var n=this.data[e];if(n)return n[t]},getAll:function(e,t){var n=this.data[e],r,i;if(t)i=n;else if(n){i={};for(r in n)n.hasOwnProperty(r)&&(i[r]=n[r])}return i}};var n=e.Object,r=e.Lang,i=".",s="getter",o="setter",u="readOnly",a="writeOnce",f="initOnly",l="validator",c="value",h="valueFn",p="lazyAdd",d="added",v="_bypassProxy",m="initializing",g="initValue",y="lazy",b="isLazyAdd",w;E.INVALID_VALUE={},w=E.INVALID_VALUE,E._ATTR_CFG=[o,s,l,c,h,a,u,p,v],E.prototype={_initAttrHost:function(t,n,r){this._state=new e.State,this._initAttrs(t,n,r)},addAttr:function(e,t,n){var r=this,i=r._state,s,o;t=t||{},n=p in t?t[p]:n;if(n&&!r.attrAdded(e))i.addAll(e,{lazy:t,added:!0});else if(!r.attrAdded(e)||i.get(e,b))o=c in t,o&&(s=t.value,delete t.value),t.added=!0,t.initializing=!0,i.addAll(e,t),o&&r.set(e,s),i.remove(e,m);return r},attrAdded:function(e){return!!this._state.get(e,d)},get:function(e){return this._getAttr(e)},_isLazyAttr:function(e){return this._state.get(e,y)},_addLazyAttr:function(e,t){var n=this._state,r=n.get(e,y);n.add(e,b,!0),n.remove(e,y),this.addAttr(e,r)},set:function(e,t){return this._setAttr(e,t)},_set:function(e,t){return this._setAttr(e,t,null,!0)},_setAttr:function(t,r,s,o){var u=!0,a=this._state,l=this._stateProxy,h,p,d,v,m,g,y;return t.indexOf(i)!==-1&&(d=t,v=t.split(i),t=v.shift()),this._isLazyAttr(t)&&this._addLazyAttr(t),h=a.getAll(t,!0)||{},p=!(c in h),l&&t in l&&!h._bypassProxy&&(p=!1),g=h.writeOnce,y=h.initializing,!p&&!o&&(g&&(u=!1),h.readOnly&&(u=!1)),!y&&!o&&g===f&&(u=!1),u&&(p||(m=this.get(t)),v&&(r=n.setValue(e.clone(m),v,r),r===undefined&&(u=!1)),u&&(!this._fireAttrChange||y?this._setAttrVal(t,d,m,r):this._fireAttrChange(t,d,m,r,s))),this},_getAttr:function(e){var t=this,r=e,o=t._state,u,a,f,l;return e.indexOf(i)!==-1&&(u=e.split(i),e=u.shift()),t._tCfgs&&t._tCfgs[e]&&(l={},l[e]=t._tCfgs[e],delete t._tCfgs[e],t._addAttrs(l,t._tVals)),t._isLazyAttr(e)&&t._addLazyAttr(e),f=t._getStateVal(e),a=o.get(e,s),a&&!a.call&&(a=this[a]),f=a?a.call(t,f,r):f,f=u?n.getValue(f,u):f,f},_getStateVal:function(e){var t=this._stateProxy;return t&&e in t&&!this._state.get(e,v)?t[e]:this._state.get(e,c)},_setStateVal:function(e,t){var n=this._stateProxy;n&&e in n&&!this._state.get(e,v)?n[e]=t:this._state.add(e,c,t)},_setAttrVal:function(e,t,n,i){var s=this,o=!0,u=this._state.getAll(e,!0)||{},a=u.validator,f=u.setter,l=u.initializing,c=this._getStateVal(e),h=t||e,p,d;return a&&(a.call||(a=this[a]),a&&(d=a.call(s,i,h),!d&&l&&(i=u.defaultValue,d=!0))),!a||d?(f&&(f.call||(f=this[f]),f&&(p=f.call(s,i,h),p===w?o=!1:p!==undefined&&(i=p))),o&&(!t&&i===c&&!r.isObject(i)?o=!1:(g in u||(u.initValue=i),s._setStateVal(e,i)))):o=!1,o},setAttrs:function(e){return this._setAttrs(e)},_setAttrs:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.set(t,e[t]);return this},getAttrs:function(e){return this._getAttrs(e)},_getAttrs:function(e){var t={},r,i,s,o=e===!0;if(!e||o)e=n.keys(this._state.data);for(i=0,s=e.length;i<s;i++){r=e[i];if(!o||this._getStateVal(r)!=this._state.get(r,g))t[r]=this.get(r)}return t},addAttrs:function(e,t,n){var r=this;return e&&(r._tCfgs=e,r._tVals=r._normAttrVals(t),r._addAttrs(e,r._tVals,n),r._tCfgs=r._tVals=null),r},_addAttrs:function(e,t,n){var r=this,i,s,o;for(i in e)e.hasOwnProperty(i)&&(s=e[i],s.defaultValue=s.value,o=r._getAttrInitVal(i,s,r._tVals),o!==undefined&&(s.value=o),r._tCfgs[i]&&delete r._tCfgs[i],r.addAttr(i,s,n))},_protectAttrs:function(t){if(t){t=e.merge(t);for(var n in t)t.hasOwnProperty(n)&&(t[n]=e.merge(t[n]))}return t},_normAttrVals:function(t){return t?e.merge(t):null},_getAttrInitVal:function(e,t,n){var r,i;return!t.readOnly&&n&&n.hasOwnProperty(e)?r=n[e]:(r=t.value,i=t.valueFn,i&&(i.call||(i=this[i]),i&&(r=i.call(this,e)))),r},_initAttrs:function(t,n,r){t=t||this.constructor.ATTRS;var i=e.Base,s=e.BaseCore,o=i&&e.instanceOf(this,i),u=!o&&s&&e.instanceOf(this,s);t&&!o&&!u&&this.addAttrs(this._protectAttrs(t),n,r)}},e.AttributeCore=E},"3.7.2",{requires:["oop"]});+YUI.add("attribute-core",function(e,t){function E(e,t,n){this._initAttrHost(e,t,n)}e.State=function(){this.data={}},e.State.prototype={add:function(e,t,n){var r=this.data[e];r||(r=this.data[e]={}),r[t]=n},addAll:function(e,t){var n=this.data[e],r;n||(n=this.data[e]={});for(r in t)t.hasOwnProperty(r)&&(n[r]=t[r])},remove:function(e,t){var n=this.data[e];n&&delete n[t]},removeAll:function(t,n){var r;n?e.each(n,function(e,n){this.remove(t,typeof n=="string"?n:e)},this):(r=this.data,t in r&&delete r[t])},get:function(e,t){var n=this.data[e];if(n)return n[t]},getAll:function(e,t){var n=this.data[e],r,i;if(t)i=n;else if(n){i={};for(r in n)n.hasOwnProperty(r)&&(i[r]=n[r])}return i}};var n=e.Object,r=e.Lang,i=".",s="getter",o="setter",u="readOnly",a="writeOnce",f="initOnly",l="validator",c="value",h="valueFn",p="lazyAdd",d="added",v="_bypassProxy",m="initializing",g="initValue",y="lazy",b="isLazyAdd",w;E.INVALID_VALUE={},w=E.INVALID_VALUE,E._ATTR_CFG=[o,s,l,c,h,a,u,p,v],E.prototype={_initAttrHost:function(t,n,r){this._state=new e.State,this._initAttrs(t,n,r)},addAttr:function(e,t,n){var r=this,i=r._state,s,o;t=t||{},n=p in t?t[p]:n;if(n&&!r.attrAdded(e))i.addAll(e,{lazy:t,added:!0});else if(!r.attrAdded(e)||i.get(e,b))o=c in t,o&&(s=t.value,delete t.value),t.added=!0,t.initializing=!0,i.addAll(e,t),o&&r.set(e,s),i.remove(e,m);return r},attrAdded:function(e){return!!this._state.get(e,d)},get:function(e){return this._getAttr(e)},_isLazyAttr:function(e){return this._state.get(e,y)},_addLazyAttr:function(e,t){var n=this._state,r=n.get(e,y);n.add(e,b,!0),n.remove(e,y),this.addAttr(e,r)},set:function(e,t){return this._setAttr(e,t)},_set:function(e,t){return this._setAttr(e,t,null,!0)},_setAttr:function(t,r,s,o){var u=!0,a=this._state,l=this._stateProxy,h,p,d,v,m,g,y;return t.indexOf(i)!==-1&&(d=t,v=t.split(i),t=v.shift()),this._isLazyAttr(t)&&this._addLazyAttr(t),h=a.getAll(t,!0)||{},p=!(c in h),l&&t in l&&!h._bypassProxy&&(p=!1),g=h.writeOnce,y=h.initializing,!p&&!o&&(g&&(u=!1),h.readOnly&&(u=!1)),!y&&!o&&g===f&&(u=!1),u&&(p||(m=this.get(t)),v&&(r=n.setValue(e.clone(m),v,r),r===undefined&&(u=!1)),u&&(!this._fireAttrChange||y?this._setAttrVal(t,d,m,r):this._fireAttrChange(t,d,m,r,s))),this},_getAttr:function(e){var t=this,r=e,o=t._state,u,a,f,l;return e.indexOf(i)!==-1&&(u=e.split(i),e=u.shift()),t._tCfgs&&t._tCfgs[e]&&(l={},l[e]=t._tCfgs[e],delete t._tCfgs[e],t._addAttrs(l,t._tVals)),t._isLazyAttr(e)&&t._addLazyAttr(e),f=t._getStateVal(e),a=o.get(e,s),a&&!a.call&&(a=this[a]),f=a?a.call(t,f,r):f,f=u?n.getValue(f,u):f,f},_getStateVal:function(e){var t=this._stateProxy;return t&&e in t&&!this._state.get(e,v)?t[e]:this._state.get(e,c)},_setStateVal:function(e,t){var n=this._stateProxy;n&&e in n&&!this._state.get(e,v)?n[e]=t:this._state.add(e,c,t)},_setAttrVal:function(e,t,n,i){var s=this,o=!0,u=this._state.getAll(e,!0)||{},a=u.validator,f=u.setter,l=u.initializing,c=this._getStateVal(e),h=t||e,p,d;return a&&(a.call||(a=this[a]),a&&(d=a.call(s,i,h),!d&&l&&(i=u.defaultValue,d=!0))),!a||d?(f&&(f.call||(f=this[f]),f&&(p=f.call(s,i,h),p===w?o=!1:p!==undefined&&(i=p))),o&&(!t&&i===c&&!r.isObject(i)?o=!1:(g in u||(u.initValue=i),s._setStateVal(e,i)))):o=!1,o},setAttrs:function(e){return this._setAttrs(e)},_setAttrs:function(e){var t;for(t in e)e.hasOwnProperty(t)&&this.set(t,e[t]);return this},getAttrs:function(e){return this._getAttrs(e)},_getAttrs:function(e){var t={},r,i,s,o=e===!0;if(!e||o)e=n.keys(this._state.data);for(i=0,s=e.length;i<s;i++){r=e[i];if(!o||this._getStateVal(r)!=this._state.get(r,g))t[r]=this.get(r)}return t},addAttrs:function(e,t,n){var r=this;return e&&(r._tCfgs=e,r._tVals=r._normAttrVals(t),r._addAttrs(e,r._tVals,n),r._tCfgs=r._tVals=null),r},_addAttrs:function(e,t,n){var r=this,i,s,o;for(i in e)e.hasOwnProperty(i)&&(s=e[i],s.defaultValue=s.value,o=r._getAttrInitVal(i,s,r._tVals),o!==undefined&&(s.value=o),r._tCfgs[i]&&delete r._tCfgs[i],r.addAttr(i,s,n))},_protectAttrs:function(t){if(t){t=e.merge(t);for(var n in t)t.hasOwnProperty(n)&&(t[n]=e.merge(t[n]))}return t},_normAttrVals:function(t){return t?e.merge(t):null},_getAttrInitVal:function(e,t,n){var r,i;return!t.readOnly&&n&&n.hasOwnProperty(e)?r=n[e]:(r=t.value,i=t.valueFn,i&&(i.call||(i=this[i]),i&&(r=i.call(this,e)))),r},_initAttrs:function(t,n,r){t=t||this.constructor.ATTRS;var i=e.Base,s=e.BaseCore,o=i&&e.instanceOf(this,i),u=!o&&s&&e.instanceOf(this,s);t&&!o&&!u&&this.addAttrs(this._protectAttrs(t),n,r)}},e.AttributeCore=E},"3.7.3",{requires:["oop"]});
bundle/attribute-core/attribute-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1030,4 +1030,4 @@ Y.AttributeCore = AttributeCore; -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/attribute-events/attribute-events-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/attribute-events/attribute-events.js", code: [] };-_yuitest_coverage["build/attribute-events/attribute-events.js"].code=["YUI.add('attribute-events', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-events submodule provides augmentable attribute change event support "," * for AttributeCore based implementations."," *"," * @module attribute"," * @submodule attribute-events"," */"," var EventTarget = Y.EventTarget,",""," CHANGE = \"Change\","," BROADCAST = \"broadcast\","," PUBLISHED = \"published\";",""," /**"," * Provides an augmentable implementation of attribute change events for "," * AttributeCore. "," *"," * @class AttributeEvents"," * @uses EventTarget"," */"," function AttributeEvents() {"," // Perf tweak - avoid creating event literals if not required."," this._ATTR_E_FACADE = {};"," EventTarget.call(this, {emitFacade:true});"," }",""," AttributeEvents._ATTR_CFG = [BROADCAST];",""," AttributeEvents.prototype = {",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @chainable"," *"," * @param {String} name The name of the attribute. If the "," * current value of the attribute is an Object, dot notation can be used"," * to set the value of a property within the object (e.g. <code>set(\"x.y.z\", 5)</code>)."," *"," * @param {Any} value The value to set the attribute to."," *"," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event. This "," * can be used as a flexible way to identify the source of a call to set, allowing "," * the developer to distinguish between set called internally by the host, vs. "," * set called externally by the application developer."," *"," * @return {Object} A reference to the host object."," */"," set : function(name, val, opts) {"," return this._setAttr(name, val, opts);"," },",""," /**"," * Allows setting of readOnly/writeOnce attributes. See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _set"," * @protected"," * @chainable"," * "," * @param {String} name The name of the attribute."," * @param {Any} val The value to set the attribute to."," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event."," * @return {Object} A reference to the host object."," */"," _set : function(name, val, opts) {"," return this._setAttr(name, val, opts, true);"," },",""," /**"," * Sets multiple attribute values."," *"," * @method setAttrs"," * @param {Object} attrs An object with attributes name/value pairs."," * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set "," * @return {Object} A reference to the host object."," * @chainable"," */"," setAttrs : function(attrs, opts) {"," return this._setAttrs(attrs, opts);"," },",""," /**"," * Implementation behind the public setAttrs method, to set multiple attribute values."," *"," * @method _setAttrs"," * @protected"," * @param {Object} attrs An object with attributes name/value pairs."," * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set "," * @return {Object} A reference to the host object."," * @chainable"," */"," _setAttrs : function(attrs, opts) {"," var attr;"," for (attr in attrs) {"," if ( attrs.hasOwnProperty(attr) ) {"," this.set(attr, attrs[attr], opts);"," }"," }"," return this;"," },",""," /**"," * Utility method to help setup the event payload and fire the attribute change event."," * "," * @method _fireAttrChange"," * @private"," * @param {String} attrName The name of the attribute"," * @param {String} subAttrName The full path of the property being changed, "," * if this is a sub-attribute value being change. Otherwise null."," * @param {Any} currVal The current value of the attribute"," * @param {Any} newVal The new value of the attribute"," * @param {Object} opts Any additional event data to mix into the attribute change event's event facade."," */"," _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts) {"," var host = this,"," eventName = attrName + CHANGE,"," state = host._state,"," facade,"," broadcast,"," evtCfg;",""," if (!state.get(attrName, PUBLISHED)) {"," "," evtCfg = {"," queuable:false,"," defaultTargetOnly: true, "," defaultFn:host._defAttrChangeFn, "," silent:true"," };",""," broadcast = state.get(attrName, BROADCAST);"," if (broadcast !== undefined) {"," evtCfg.broadcast = broadcast;"," }",""," host.publish(eventName, evtCfg);"," "," state.add(attrName, PUBLISHED, true);"," }",""," facade = (opts) ? Y.merge(opts) : host._ATTR_E_FACADE;",""," // Not using the single object signature for fire({type:..., newVal:...}), since "," // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.",""," // facade.type = eventName;"," facade.attrName = attrName;"," facade.subAttrName = subAttrName;"," facade.prevVal = currVal;"," facade.newVal = newVal;",""," // host.fire(facade);"," host.fire(eventName, facade);"," },",""," /**"," * Default function for attribute change events."," *"," * @private"," * @method _defAttrChangeFn"," * @param {EventFacade} e The event object for attribute change events."," */"," _defAttrChangeFn : function(e) {"," if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," e.newVal = this.get(e.attrName);"," }"," }"," };",""," // Basic prototype augment - no lazy constructor invocation."," Y.mix(AttributeEvents, EventTarget, false, null, 1);",""," Y.AttributeEvents = AttributeEvents;","","","}, '3.7.2', {\"requires\": [\"event-custom\"]});"];+_yuitest_coverage["build/attribute-events/attribute-events.js"].code=["YUI.add('attribute-events', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-events submodule provides augmentable attribute change event support "," * for AttributeCore based implementations."," *"," * @module attribute"," * @submodule attribute-events"," */"," var EventTarget = Y.EventTarget,",""," CHANGE = \"Change\","," BROADCAST = \"broadcast\","," PUBLISHED = \"published\";",""," /**"," * Provides an augmentable implementation of attribute change events for "," * AttributeCore. "," *"," * @class AttributeEvents"," * @uses EventTarget"," */"," function AttributeEvents() {"," // Perf tweak - avoid creating event literals if not required."," this._ATTR_E_FACADE = {};"," EventTarget.call(this, {emitFacade:true});"," }",""," AttributeEvents._ATTR_CFG = [BROADCAST];",""," AttributeEvents.prototype = {",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @chainable"," *"," * @param {String} name The name of the attribute. If the "," * current value of the attribute is an Object, dot notation can be used"," * to set the value of a property within the object (e.g. <code>set(\"x.y.z\", 5)</code>)."," *"," * @param {Any} value The value to set the attribute to."," *"," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event. This "," * can be used as a flexible way to identify the source of a call to set, allowing "," * the developer to distinguish between set called internally by the host, vs. "," * set called externally by the application developer."," *"," * @return {Object} A reference to the host object."," */"," set : function(name, val, opts) {"," return this._setAttr(name, val, opts);"," },",""," /**"," * Allows setting of readOnly/writeOnce attributes. See <a href=\"#method_set\">set</a> for argument details."," *"," * @method _set"," * @protected"," * @chainable"," * "," * @param {String} name The name of the attribute."," * @param {Any} val The value to set the attribute to."," * @param {Object} opts (Optional) Optional event data to be mixed into"," * the event facade passed to subscribers of the attribute's change event."," * @return {Object} A reference to the host object."," */"," _set : function(name, val, opts) {"," return this._setAttr(name, val, opts, true);"," },",""," /**"," * Sets multiple attribute values."," *"," * @method setAttrs"," * @param {Object} attrs An object with attributes name/value pairs."," * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set "," * @return {Object} A reference to the host object."," * @chainable"," */"," setAttrs : function(attrs, opts) {"," return this._setAttrs(attrs, opts);"," },",""," /**"," * Implementation behind the public setAttrs method, to set multiple attribute values."," *"," * @method _setAttrs"," * @protected"," * @param {Object} attrs An object with attributes name/value pairs."," * @param {Object} opts Properties to mix into the event payload. These are shared and mixed into each set "," * @return {Object} A reference to the host object."," * @chainable"," */"," _setAttrs : function(attrs, opts) {"," var attr;"," for (attr in attrs) {"," if ( attrs.hasOwnProperty(attr) ) {"," this.set(attr, attrs[attr], opts);"," }"," }"," return this;"," },",""," /**"," * Utility method to help setup the event payload and fire the attribute change event."," * "," * @method _fireAttrChange"," * @private"," * @param {String} attrName The name of the attribute"," * @param {String} subAttrName The full path of the property being changed, "," * if this is a sub-attribute value being change. Otherwise null."," * @param {Any} currVal The current value of the attribute"," * @param {Any} newVal The new value of the attribute"," * @param {Object} opts Any additional event data to mix into the attribute change event's event facade."," */"," _fireAttrChange : function(attrName, subAttrName, currVal, newVal, opts) {"," var host = this,"," eventName = attrName + CHANGE,"," state = host._state,"," facade,"," broadcast,"," evtCfg;",""," if (!state.get(attrName, PUBLISHED)) {"," "," evtCfg = {"," queuable:false,"," defaultTargetOnly: true, "," defaultFn:host._defAttrChangeFn, "," silent:true"," };",""," broadcast = state.get(attrName, BROADCAST);"," if (broadcast !== undefined) {"," evtCfg.broadcast = broadcast;"," }",""," host.publish(eventName, evtCfg);"," "," state.add(attrName, PUBLISHED, true);"," }",""," facade = (opts) ? Y.merge(opts) : host._ATTR_E_FACADE;",""," // Not using the single object signature for fire({type:..., newVal:...}), since "," // we don't want to override type. Changed to the fire(type, {newVal:...}) signature.",""," // facade.type = eventName;"," facade.attrName = attrName;"," facade.subAttrName = subAttrName;"," facade.prevVal = currVal;"," facade.newVal = newVal;",""," // host.fire(facade);"," host.fire(eventName, facade);"," },",""," /**"," * Default function for attribute change events."," *"," * @private"," * @method _defAttrChangeFn"," * @param {EventFacade} e The event object for attribute change events."," */"," _defAttrChangeFn : function(e) {"," if (!this._setAttrVal(e.attrName, e.subAttrName, e.prevVal, e.newVal)) {"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," e.newVal = this.get(e.attrName);"," }"," }"," };",""," // Basic prototype augment - no lazy constructor invocation."," Y.mix(AttributeEvents, EventTarget, false, null, 1);",""," Y.AttributeEvents = AttributeEvents;","","","}, '3.7.3', {\"requires\": [\"event-custom\"]});"]; _yuitest_coverage["build/attribute-events/attribute-events.js"].lines = {"1":0,"20":0,"33":0,"35":0,"36":0,"39":0,"41":0,"64":0,"81":0,"94":0,"108":0,"109":0,"110":0,"111":0,"114":0,"130":0,"137":0,"139":0,"146":0,"147":0,"148":0,"151":0,"153":0,"156":0,"162":0,"163":0,"164":0,"165":0,"168":0,"179":0,"181":0,"183":0,"189":0,"191":0}; _yuitest_coverage["build/attribute-events/attribute-events.js"].functions = {"AttributeEvents:33":0,"set:63":0,"_set:80":0,"setAttrs:93":0,"_setAttrs:107":0,"_fireAttrChange:129":0,"_defAttrChangeFn:178":0,"(anonymous 1):1":0}; _yuitest_coverage["build/attribute-events/attribute-events.js"].coveredLines = 34;@@ -272,4 +272,4 @@ Y.AttributeEvents = AttributeEvents; -}, '3.7.2', {"requires": ["event-custom"]});+}, '3.7.3', {"requires": ["event-custom"]});
bundle/attribute-events/attribute-events-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -198,4 +198,4 @@ Y.AttributeEvents = AttributeEvents; -}, '3.7.2', {"requires": ["event-custom"]});+}, '3.7.3', {"requires": ["event-custom"]});
bundle/attribute-events/attribute-events-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-events",function(e,t){function o(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast",s="published";o._ATTR_CFG=[i],o.prototype={set:function(e,t,n){return this._setAttr(e,t,n)},_set:function(e,t,n){return this._setAttr(e,t,n,!0)},setAttrs:function(e,t){return this._setAttrs(e,t)},_setAttrs:function(e,t){var n;for(n in e)e.hasOwnProperty(n)&&this.set(n,e[n],t);return this},_fireAttrChange:function(t,n,o,u,a){var f=this,l=t+r,c=f._state,h,p,d;c.get(t,s)||(d={queuable:!1,defaultTargetOnly:!0,defaultFn:f._defAttrChangeFn,silent:!0},p=c.get(t,i),p!==undefined&&(d.broadcast=p),f.publish(l,d),c.add(t,s,!0)),h=a?e.merge(a):f._ATTR_E_FACADE,h.attrName=t,h.subAttrName=n,h.prevVal=o,h.newVal=u,f.fire(l,h)},_defAttrChangeFn:function(e){this._setAttrVal(e.attrName,e.subAttrName,e.prevVal,e.newVal)?e.newVal=this.get(e.attrName):e.stopImmediatePropagation()}},e.mix(o,n,!1,null,1),e.AttributeEvents=o},"3.7.2",{requires:["event-custom"]});+YUI.add("attribute-events",function(e,t){function o(){this._ATTR_E_FACADE={},n.call(this,{emitFacade:!0})}var n=e.EventTarget,r="Change",i="broadcast",s="published";o._ATTR_CFG=[i],o.prototype={set:function(e,t,n){return this._setAttr(e,t,n)},_set:function(e,t,n){return this._setAttr(e,t,n,!0)},setAttrs:function(e,t){return this._setAttrs(e,t)},_setAttrs:function(e,t){var n;for(n in e)e.hasOwnProperty(n)&&this.set(n,e[n],t);return this},_fireAttrChange:function(t,n,o,u,a){var f=this,l=t+r,c=f._state,h,p,d;c.get(t,s)||(d={queuable:!1,defaultTargetOnly:!0,defaultFn:f._defAttrChangeFn,silent:!0},p=c.get(t,i),p!==undefined&&(d.broadcast=p),f.publish(l,d),c.add(t,s,!0)),h=a?e.merge(a):f._ATTR_E_FACADE,h.attrName=t,h.subAttrName=n,h.prevVal=o,h.newVal=u,f.fire(l,h)},_defAttrChangeFn:function(e){this._setAttrVal(e.attrName,e.subAttrName,e.prevVal,e.newVal)?e.newVal=this.get(e.attrName):e.stopImmediatePropagation()}},e.mix(o,n,!1,null,1),e.AttributeEvents=o},"3.7.3",{requires:["event-custom"]});
bundle/attribute-events/attribute-events.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -197,4 +197,4 @@ Y.AttributeEvents = AttributeEvents; -}, '3.7.2', {"requires": ["event-custom"]});+}, '3.7.3', {"requires": ["event-custom"]});
bundle/attribute-extras/attribute-extras-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/attribute-extras/attribute-extras.js", code: [] };-_yuitest_coverage["build/attribute-extras/attribute-extras.js"].code=["YUI.add('attribute-extras', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-extras submodule provides less commonly used attribute methods, and can "," * be augmented/mixed into an implemention which used attribute-core."," *"," * @module attribute"," * @submodule attribute-extras"," */"," var BROADCAST = \"broadcast\","," PUBLISHED = \"published\","," INIT_VALUE = \"initValue\",",""," MODIFIABLE = {"," readOnly:1,"," writeOnce:1,"," getter:1,"," broadcast:1"," };",""," /**"," * A augmentable implementation for AttributeCore, providing less frequently used "," * methods for Attribute management such as modifyAttrs(), removeAttr and reset() "," *"," * @class AttributeExtras"," */"," function AttributeExtras() {}",""," AttributeExtras.prototype = {",""," /**"," * Updates the configuration of an attribute which has already been added."," * <p>"," * The properties which can be modified through this interface are limited"," * to the following subset of attributes, which can be safely modified"," * after a value has already been set on the attribute: readOnly, writeOnce, "," * broadcast and getter."," * </p>"," * @method modifyAttr"," * @param {String} name The name of the attribute whose configuration is to be updated."," * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify."," */"," modifyAttr: function(name, config) {"," var host = this, // help compression"," prop, state;",""," if (host.attrAdded(name)) {",""," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }",""," state = host._state;"," for (prop in config) {"," if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {"," state.add(name, prop, config[prop]);",""," // If we reconfigured broadcast, need to republish"," if (prop === BROADCAST) {"," state.remove(name, PUBLISHED);"," }"," }"," }"," }",""," },",""," /**"," * Removes an attribute from the host object"," *"," * @method removeAttr"," * @param {String} name The name of the attribute to be removed."," */"," removeAttr: function(name) {"," this._state.removeAll(name);"," },",""," /**"," * Resets the attribute (or all attributes) to its initial value, as long as"," * the attribute is not readOnly, or writeOnce."," *"," * @method reset"," * @param {String} name Optional. The name of the attribute to reset. If omitted, all attributes are reset."," * @return {Object} A reference to the host object."," * @chainable"," */"," reset : function(name) {"," var host = this; // help compression",""," if (name) {"," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }"," host.set(name, host._state.get(name, INIT_VALUE));"," } else {"," Y.each(host._state.data, function(v, n) {"," host.reset(n);"," });"," }"," return host;"," },",""," /**"," * Returns an object with the configuration properties (and value)"," * for the given attribute. If attrName is not provided, returns the"," * configuration properties for all attributes."," *"," * @method _getAttrCfg"," * @protected"," * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes."," * @return {Object} The configuration properties for the given attribute, or all attributes."," */"," _getAttrCfg : function(name) {"," var o,"," state = this._state;",""," if (name) {"," o = state.getAll(name) || {};"," } else {"," o = {};"," Y.each(state.data, function(v, n) {"," o[n] = state.getAll(n);"," }); "," }",""," return o;"," }"," };",""," Y.AttributeExtras = AttributeExtras;","","","}, '3.7.2', {\"requires\": [\"oop\"]});"];+_yuitest_coverage["build/attribute-extras/attribute-extras.js"].code=["YUI.add('attribute-extras', function (Y, NAME) {",""," /**"," * The attribute module provides an augmentable Attribute implementation, which "," * adds configurable attributes and attribute change events to the class being "," * augmented. It also provides a State class, which is used internally by Attribute,"," * but can also be used independently to provide a name/property/value data structure to"," * store state."," *"," * @module attribute"," */",""," /**"," * The attribute-extras submodule provides less commonly used attribute methods, and can "," * be augmented/mixed into an implemention which used attribute-core."," *"," * @module attribute"," * @submodule attribute-extras"," */"," var BROADCAST = \"broadcast\","," PUBLISHED = \"published\","," INIT_VALUE = \"initValue\",",""," MODIFIABLE = {"," readOnly:1,"," writeOnce:1,"," getter:1,"," broadcast:1"," };",""," /**"," * A augmentable implementation for AttributeCore, providing less frequently used "," * methods for Attribute management such as modifyAttrs(), removeAttr and reset() "," *"," * @class AttributeExtras"," */"," function AttributeExtras() {}",""," AttributeExtras.prototype = {",""," /**"," * Updates the configuration of an attribute which has already been added."," * <p>"," * The properties which can be modified through this interface are limited"," * to the following subset of attributes, which can be safely modified"," * after a value has already been set on the attribute: readOnly, writeOnce, "," * broadcast and getter."," * </p>"," * @method modifyAttr"," * @param {String} name The name of the attribute whose configuration is to be updated."," * @param {Object} config An object with configuration property/value pairs, specifying the configuration properties to modify."," */"," modifyAttr: function(name, config) {"," var host = this, // help compression"," prop, state;",""," if (host.attrAdded(name)) {",""," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }",""," state = host._state;"," for (prop in config) {"," if (MODIFIABLE[prop] && config.hasOwnProperty(prop)) {"," state.add(name, prop, config[prop]);",""," // If we reconfigured broadcast, need to republish"," if (prop === BROADCAST) {"," state.remove(name, PUBLISHED);"," }"," }"," }"," }",""," },",""," /**"," * Removes an attribute from the host object"," *"," * @method removeAttr"," * @param {String} name The name of the attribute to be removed."," */"," removeAttr: function(name) {"," this._state.removeAll(name);"," },",""," /**"," * Resets the attribute (or all attributes) to its initial value, as long as"," * the attribute is not readOnly, or writeOnce."," *"," * @method reset"," * @param {String} name Optional. The name of the attribute to reset. If omitted, all attributes are reset."," * @return {Object} A reference to the host object."," * @chainable"," */"," reset : function(name) {"," var host = this; // help compression",""," if (name) {"," if (host._isLazyAttr(name)) {"," host._addLazyAttr(name);"," }"," host.set(name, host._state.get(name, INIT_VALUE));"," } else {"," Y.each(host._state.data, function(v, n) {"," host.reset(n);"," });"," }"," return host;"," },",""," /**"," * Returns an object with the configuration properties (and value)"," * for the given attribute. If attrName is not provided, returns the"," * configuration properties for all attributes."," *"," * @method _getAttrCfg"," * @protected"," * @param {String} name Optional. The attribute name. If not provided, the method will return the configuration for all attributes."," * @return {Object} The configuration properties for the given attribute, or all attributes."," */"," _getAttrCfg : function(name) {"," var o,"," state = this._state;",""," if (name) {"," o = state.getAll(name) || {};"," } else {"," o = {};"," Y.each(state.data, function(v, n) {"," o[n] = state.getAll(n);"," }); "," }",""," return o;"," }"," };",""," Y.AttributeExtras = AttributeExtras;","","","}, '3.7.3', {\"requires\": [\"oop\"]});"]; _yuitest_coverage["build/attribute-extras/attribute-extras.js"].lines = {"1":0,"20":0,"37":0,"39":0,"54":0,"57":0,"59":0,"60":0,"63":0,"64":0,"65":0,"66":0,"69":0,"70":0,"85":0,"98":0,"100":0,"101":0,"102":0,"104":0,"106":0,"107":0,"110":0,"124":0,"127":0,"128":0,"130":0,"131":0,"132":0,"136":0,"140":0}; _yuitest_coverage["build/attribute-extras/attribute-extras.js"].functions = {"AttributeExtras:37":0,"modifyAttr:53":0,"removeAttr:84":0,"(anonymous 2):106":0,"reset:97":0,"(anonymous 3):131":0,"_getAttrCfg:123":0,"(anonymous 1):1":0}; _yuitest_coverage["build/attribute-extras/attribute-extras.js"].coveredLines = 31;@@ -217,4 +217,4 @@ Y.AttributeExtras = AttributeExtras; -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/attribute-extras/attribute-extras-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -147,4 +147,4 @@ Y.AttributeExtras = AttributeExtras; -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/attribute-extras/attribute-extras-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("attribute-extras",function(e,t){function o(){}var n="broadcast",r="published",i="initValue",s={readOnly:1,writeOnce:1,getter:1,broadcast:1};o.prototype={modifyAttr:function(e,t){var i=this,o,u;if(i.attrAdded(e)){i._isLazyAttr(e)&&i._addLazyAttr(e),u=i._state;for(o in t)s[o]&&t.hasOwnProperty(o)&&(u.add(e,o,t[o]),o===n&&u.remove(e,r))}},removeAttr:function(e){this._state.removeAll(e)},reset:function(t){var n=this;return t?(n._isLazyAttr(t)&&n._addLazyAttr(t),n.set(t,n._state.get(t,i))):e.each(n._state.data,function(e,t){n.reset(t)}),n},_getAttrCfg:function(t){var n,r=this._state;return t?n=r.getAll(t)||{}:(n={},e.each(r.data,function(e,t){n[t]=r.getAll(t)})),n}},e.AttributeExtras=o},"3.7.2",{requires:["oop"]});+YUI.add("attribute-extras",function(e,t){function o(){}var n="broadcast",r="published",i="initValue",s={readOnly:1,writeOnce:1,getter:1,broadcast:1};o.prototype={modifyAttr:function(e,t){var i=this,o,u;if(i.attrAdded(e)){i._isLazyAttr(e)&&i._addLazyAttr(e),u=i._state;for(o in t)s[o]&&t.hasOwnProperty(o)&&(u.add(e,o,t[o]),o===n&&u.remove(e,r))}},removeAttr:function(e){this._state.removeAll(e)},reset:function(t){var n=this;return t?(n._isLazyAttr(t)&&n._addLazyAttr(t),n.set(t,n._state.get(t,i))):e.each(n._state.data,function(e,t){n.reset(t)}),n},_getAttrCfg:function(t){var n,r=this._state;return t?n=r.getAll(t)||{}:(n={},e.each(r.data,function(e,t){n[t]=r.getAll(t)})),n}},e.AttributeExtras=o},"3.7.3",{requires:["oop"]});
bundle/attribute-extras/attribute-extras.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -146,4 +146,4 @@ Y.AttributeExtras = AttributeExtras; -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/autocomplete-base/autocomplete-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-base/autocomplete-base.js", code: [] };-_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].code=["YUI.add('autocomplete-base', function (Y, NAME) {","","/**","Provides automatic input completion or suggestions for text input fields and","textareas.","","@module autocomplete","@main autocomplete","@since 3.3.0","**/","","/**","`Y.Base` extension that provides core autocomplete logic (but no UI","implementation) for a text input field or textarea. Must be mixed into a","`Y.Base`-derived class to be useful.","","@module autocomplete","@submodule autocomplete-base","**/","","/**","Extension that provides core autocomplete logic (but no UI implementation) for a","text input field or textarea.","","The `AutoCompleteBase` class provides events and attributes that abstract away","core autocomplete logic and configuration, but does not provide a widget","implementation or suggestion UI. For a prepackaged autocomplete widget, see","`AutoCompleteList`.","","This extension cannot be instantiated directly, since it doesn't provide an","actual implementation. It's intended to be mixed into a `Y.Base`-based class or","widget.","","`Y.Widget`-based example:",""," YUI().use('autocomplete-base', 'widget', function (Y) {"," var MyAC = Y.Base.create('myAC', Y.Widget, [Y.AutoCompleteBase], {"," // Custom prototype methods and properties."," }, {"," // Custom static methods and properties."," });",""," // Custom implementation code."," });","","`Y.Base`-based example:",""," YUI().use('autocomplete-base', function (Y) {"," var MyAC = Y.Base.create('myAC', Y.Base, [Y.AutoCompleteBase], {"," initializer: function () {"," this._bindUIACBase();"," this._syncUIACBase();"," },",""," // Custom prototype methods and properties."," }, {"," // Custom static methods and properties."," });",""," // Custom implementation code."," });","","@class AutoCompleteBase","**/","","var Escape = Y.Escape,"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,",""," isFunction = Lang.isFunction,"," isString = Lang.isString,"," trim = Lang.trim,",""," INVALID_VALUE = Y.Attribute.INVALID_VALUE,",""," _FUNCTION_VALIDATOR = '_functionValidator',"," _SOURCE_SUCCESS = '_sourceSuccess',",""," ALLOW_BROWSER_AC = 'allowBrowserAutocomplete',"," INPUT_NODE = 'inputNode',"," QUERY = 'query',"," QUERY_DELIMITER = 'queryDelimiter',"," REQUEST_TEMPLATE = 'requestTemplate',"," RESULTS = 'results',"," RESULT_LIST_LOCATOR = 'resultListLocator',"," VALUE = 'value',"," VALUE_CHANGE = 'valueChange',",""," EVT_CLEAR = 'clear',"," EVT_QUERY = QUERY,"," EVT_RESULTS = RESULTS;","","function AutoCompleteBase() {}","","AutoCompleteBase.prototype = {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," // AOP bindings."," Y.before(this._bindUIACBase, this, 'bindUI');"," Y.before(this._syncUIACBase, this, 'syncUI');",""," // -- Public Events ----------------------------------------------------",""," /**"," Fires after the query has been completely cleared or no longer meets the"," minimum query length requirement.",""," @event clear"," @param {String} prevVal Value of the query before it was cleared."," @param {String} src Source of the event."," @preventable _defClearFn"," **/"," this.publish(EVT_CLEAR, {"," defaultFn: this._defClearFn"," });",""," /**"," Fires when the contents of the input field have changed and the input"," value meets the criteria necessary to generate an autocomplete query.",""," @event query"," @param {String} inputValue Full contents of the text input field or"," textarea that generated the query."," @param {String} query AutoComplete query. This is the string that will"," be used to request completion results. It may or may not be the same"," as `inputValue`."," @param {String} src Source of the event."," @preventable _defQueryFn"," **/"," this.publish(EVT_QUERY, {"," defaultFn: this._defQueryFn"," });",""," /**"," Fires after query results are received from the source. If no source has"," been set, this event will not fire.",""," @event results"," @param {Array|Object} data Raw, unfiltered result data (if available)."," @param {String} query Query that generated these results."," @param {Object[]} results Array of filtered, formatted, and highlighted"," results. Each item in the array is an object with the following"," properties:",""," @param {Node|HTMLElement|String} results.display Formatted result"," HTML suitable for display to the user. If no custom formatter is"," set, this will be an HTML-escaped version of the string in the"," `text` property."," @param {String} [results.highlighted] Highlighted (but not"," formatted) result text. This property will only be set if a"," highlighter is in use."," @param {Any} results.raw Raw, unformatted result in whatever form it"," was provided by the source."," @param {String} results.text Plain text version of the result,"," suitable for being inserted into the value of a text input field"," or textarea when the result is selected by a user. This value is"," not HTML-escaped and should not be inserted into the page using"," `innerHTML` or `Node#setContent()`.",""," @preventable _defResultsFn"," **/"," this.publish(EVT_RESULTS, {"," defaultFn: this._defResultsFn"," });"," },",""," destructor: function () {"," this._acBaseEvents && this._acBaseEvents.detach();",""," delete this._acBaseEvents;"," delete this._cache;"," delete this._inputNode;"," delete this._rawSource;"," },",""," // -- Public Prototype Methods ---------------------------------------------",""," /**"," Clears the result cache.",""," @method clearCache"," @chainable"," @since 3.5.0"," **/"," clearCache: function () {"," this._cache && (this._cache = {});"," return this;"," },",""," /**"," Sends a request to the configured source. If no source is configured, this"," method won't do anything.",""," Usually there's no reason to call this method manually; it will be called"," automatically when user input causes a `query` event to be fired. The only"," time you'll need to call this method manually is if you want to force a"," request to be sent when no user input has occurred.",""," @method sendRequest"," @param {String} [query] Query to send. If specified, the `query` attribute"," will be set to this query. If not specified, the current value of the"," `query` attribute will be used."," @param {Function} [requestTemplate] Request template function. If not"," specified, the current value of the `requestTemplate` attribute will be"," used."," @chainable"," **/"," sendRequest: function (query, requestTemplate) {"," var request,"," source = this.get('source');",""," if (query || query === '') {"," this._set(QUERY, query);"," } else {"," query = this.get(QUERY) || '';"," }",""," if (source) {"," if (!requestTemplate) {"," requestTemplate = this.get(REQUEST_TEMPLATE);"," }",""," request = requestTemplate ?"," requestTemplate.call(this, query) : query;","",""," source.sendRequest({"," query : query,"," request: request,",""," callback: {"," success: Y.bind(this._onResponse, this, query)"," }"," });"," }",""," return this;"," },",""," // -- Protected Lifecycle Methods ------------------------------------------",""," /**"," Attaches event listeners and behaviors.",""," @method _bindUIACBase"," @protected"," **/"," _bindUIACBase: function () {"," var inputNode = this.get(INPUT_NODE),"," tokenInput = inputNode && inputNode.tokenInput;",""," // If the inputNode has a node-tokeninput plugin attached, bind to the"," // plugin's inputNode instead."," if (tokenInput) {"," inputNode = tokenInput.get(INPUT_NODE);"," this._set('tokenInput', tokenInput);"," }",""," if (!inputNode) {"," Y.error('No inputNode specified.');"," return;"," }",""," this._inputNode = inputNode;",""," this._acBaseEvents = new Y.EventHandle(["," // This is the valueChange event on the inputNode, provided by the"," // event-valuechange module, not our own valueChange."," inputNode.on(VALUE_CHANGE, this._onInputValueChange, this),"," inputNode.on('blur', this._onInputBlur, this),",""," this.after(ALLOW_BROWSER_AC + 'Change', this._syncBrowserAutocomplete),"," this.after('sourceTypeChange', this._afterSourceTypeChange),"," this.after(VALUE_CHANGE, this._afterValueChange)"," ]);"," },",""," /**"," Synchronizes the UI state of the `inputNode`.",""," @method _syncUIACBase"," @protected"," **/"," _syncUIACBase: function () {"," this._syncBrowserAutocomplete();"," this.set(VALUE, this.get(INPUT_NODE).get(VALUE));"," },",""," // -- Protected Prototype Methods ------------------------------------------",""," /**"," Creates a DataSource-like object that simply returns the specified array as"," a response. See the `source` attribute for more details.",""," @method _createArraySource"," @param {Array} source"," @return {Object} DataSource-like object."," @protected"," **/"," _createArraySource: function (source) {"," var that = this;",""," return {"," type: 'array',"," sendRequest: function (request) {"," that[_SOURCE_SUCCESS](source.concat(), request);"," }"," };"," },",""," /**"," Creates a DataSource-like object that passes the query to a custom-defined"," function, which is expected to call the provided callback with an array of"," results. See the `source` attribute for more details.",""," @method _createFunctionSource"," @param {Function} source Function that accepts a query and a callback as"," parameters, and calls the callback with an array of results."," @return {Object} DataSource-like object."," @protected"," **/"," _createFunctionSource: function (source) {"," var that = this;",""," return {"," type: 'function',"," sendRequest: function (request) {"," var value;",""," function afterResults(results) {"," that[_SOURCE_SUCCESS](results || [], request);"," }",""," // Allow both synchronous and asynchronous functions. If we get"," // a truthy return value, assume the function is synchronous."," if ((value = source(request.query, afterResults))) {"," afterResults(value);"," }"," }"," };"," },",""," /**"," Creates a DataSource-like object that looks up queries as properties on the"," specified object, and returns the found value (if any) as a response. See"," the `source` attribute for more details.",""," @method _createObjectSource"," @param {Object} source"," @return {Object} DataSource-like object."," @protected"," **/"," _createObjectSource: function (source) {"," var that = this;",""," return {"," type: 'object',"," sendRequest: function (request) {"," var query = request.query;",""," that[_SOURCE_SUCCESS]("," YObject.owns(source, query) ? source[query] : [],"," request"," );"," }"," };"," },",""," /**"," Returns `true` if _value_ is either a function or `null`.",""," @method _functionValidator"," @param {Function|null} value Value to validate."," @protected"," **/"," _functionValidator: function (value) {"," return value === null || isFunction(value);"," },",""," /**"," Faster and safer alternative to `Y.Object.getValue()`. Doesn't bother"," casting the path to an array (since we already know it's an array) and"," doesn't throw an error if a value in the middle of the object hierarchy is"," neither `undefined` nor an object.",""," @method _getObjectValue"," @param {Object} obj"," @param {Array} path"," @return {Any} Located value, or `undefined` if the value was"," not found at the specified path."," @protected"," **/"," _getObjectValue: function (obj, path) {"," if (!obj) {"," return;"," }",""," for (var i = 0, len = path.length; obj && i < len; i++) {"," obj = obj[path[i]];"," }",""," return obj;"," },",""," /**"," Parses result responses, performs filtering and highlighting, and fires the"," `results` event.",""," @method _parseResponse"," @param {String} query Query that generated these results."," @param {Object} response Response containing results."," @param {Object} data Raw response data."," @protected"," **/"," _parseResponse: function (query, response, data) {"," var facade = {"," data : data,"," query : query,"," results: []"," },",""," listLocator = this.get(RESULT_LIST_LOCATOR),"," results = [],"," unfiltered = response && response.results,",""," filters,"," formatted,"," formatter,"," highlighted,"," highlighter,"," i,"," len,"," maxResults,"," result,"," text,"," textLocator;",""," if (unfiltered && listLocator) {"," unfiltered = listLocator.call(this, unfiltered);"," }",""," if (unfiltered && unfiltered.length) {"," filters = this.get('resultFilters');"," textLocator = this.get('resultTextLocator');",""," // Create a lightweight result object for each result to make them"," // easier to work with. The various properties on the object"," // represent different formats of the result, and will be populated"," // as we go."," for (i = 0, len = unfiltered.length; i < len; ++i) {"," result = unfiltered[i];",""," text = textLocator ?"," textLocator.call(this, result) :"," result.toString();",""," results.push({"," display: Escape.html(text),"," raw : result,"," text : text"," });"," }",""," // Run the results through all configured result filters. Each"," // filter returns an array of (potentially fewer) result objects,"," // which is then passed to the next filter, and so on."," for (i = 0, len = filters.length; i < len; ++i) {"," results = filters[i].call(this, query, results.concat());",""," if (!results) {"," return;"," }",""," if (!results.length) {"," break;"," }"," }",""," if (results.length) {"," formatter = this.get('resultFormatter');"," highlighter = this.get('resultHighlighter');"," maxResults = this.get('maxResults');",""," // If maxResults is set and greater than 0, limit the number of"," // results."," if (maxResults && maxResults > 0 &&"," results.length > maxResults) {"," results.length = maxResults;"," }",""," // Run the results through the configured highlighter (if any)."," // The highlighter returns an array of highlighted strings (not"," // an array of result objects), and these strings are then added"," // to each result object."," if (highlighter) {"," highlighted = highlighter.call(this, query,"," results.concat());",""," if (!highlighted) {"," return;"," }",""," for (i = 0, len = highlighted.length; i < len; ++i) {"," result = results[i];"," result.highlighted = highlighted[i];"," result.display = result.highlighted;"," }"," }",""," // Run the results through the configured formatter (if any) to"," // produce the final formatted results. The formatter returns an"," // array of strings or Node instances (not an array of result"," // objects), and these strings/Nodes are then added to each"," // result object."," if (formatter) {"," formatted = formatter.call(this, query, results.concat());",""," if (!formatted) {"," return;"," }",""," for (i = 0, len = formatted.length; i < len; ++i) {"," results[i].display = formatted[i];"," }"," }"," }"," }",""," facade.results = results;"," this.fire(EVT_RESULTS, facade);"," },",""," /**"," Returns the query portion of the specified input value, or `null` if there"," is no suitable query within the input value.",""," If a query delimiter is defined, the query will be the last delimited part"," of of the string.",""," @method _parseValue"," @param {String} value Input value from which to extract the query."," @return {String|null} query"," @protected"," **/"," _parseValue: function (value) {"," var delim = this.get(QUERY_DELIMITER);",""," if (delim) {"," value = value.split(delim);"," value = value[value.length - 1];"," }",""," return Lang.trimLeft(value);"," },",""," /**"," Setter for the `enableCache` attribute.",""," @method _setEnableCache"," @param {Boolean} value"," @protected"," @since 3.5.0"," **/"," _setEnableCache: function (value) {"," // When `this._cache` is an object, result sources will store cached"," // results in it. When it's falsy, they won't. This way result sources"," // don't need to get the value of the `enableCache` attribute on every"," // request, which would be sloooow."," this._cache = value ? {} : null;"," },",""," /**"," Setter for locator attributes.",""," @method _setLocator"," @param {Function|String|null} locator"," @return {Function|null}"," @protected"," **/"," _setLocator: function (locator) {"," if (this[_FUNCTION_VALIDATOR](locator)) {"," return locator;"," }",""," var that = this;",""," locator = locator.toString().split('.');",""," return function (result) {"," return result && that._getObjectValue(result, locator);"," };"," },",""," /**"," Setter for the `requestTemplate` attribute.",""," @method _setRequestTemplate"," @param {Function|String|null} template"," @return {Function|null}"," @protected"," **/"," _setRequestTemplate: function (template) {"," if (this[_FUNCTION_VALIDATOR](template)) {"," return template;"," }",""," template = template.toString();",""," return function (query) {"," return Lang.sub(template, {query: encodeURIComponent(query)});"," };"," },",""," /**"," Setter for the `resultFilters` attribute.",""," @method _setResultFilters"," @param {Array|Function|String|null} filters `null`, a filter"," function, an array of filter functions, or a string or array of strings"," representing the names of methods on `Y.AutoCompleteFilters`."," @return {Function[]} Array of filter functions (empty if <i>filters</i> is"," `null`)."," @protected"," **/"," _setResultFilters: function (filters) {"," var acFilters, getFilterFunction;",""," if (filters === null) {"," return [];"," }",""," acFilters = Y.AutoCompleteFilters;",""," getFilterFunction = function (filter) {"," if (isFunction(filter)) {"," return filter;"," }",""," if (isString(filter) && acFilters &&"," isFunction(acFilters[filter])) {"," return acFilters[filter];"," }",""," return false;"," };",""," if (Lang.isArray(filters)) {"," filters = YArray.map(filters, getFilterFunction);"," return YArray.every(filters, function (f) { return !!f; }) ?"," filters : INVALID_VALUE;"," } else {"," filters = getFilterFunction(filters);"," return filters ? [filters] : INVALID_VALUE;"," }"," },",""," /**"," Setter for the `resultHighlighter` attribute.",""," @method _setResultHighlighter"," @param {Function|String|null} highlighter `null`, a highlighter function, or"," a string representing the name of a method on"," `Y.AutoCompleteHighlighters`."," @return {Function|null}"," @protected"," **/"," _setResultHighlighter: function (highlighter) {"," var acHighlighters;",""," if (this[_FUNCTION_VALIDATOR](highlighter)) {"," return highlighter;"," }",""," acHighlighters = Y.AutoCompleteHighlighters;",""," if (isString(highlighter) && acHighlighters &&"," isFunction(acHighlighters[highlighter])) {"," return acHighlighters[highlighter];"," }",""," return INVALID_VALUE;"," },",""," /**"," Setter for the `source` attribute. Returns a DataSource or a DataSource-like"," object depending on the type of _source_ and/or the value of the"," `sourceType` attribute.",""," @method _setSource"," @param {Any} source AutoComplete source. See the `source` attribute for"," details."," @return {DataSource|Object}"," @protected"," **/"," _setSource: function (source) {"," var sourceType = this.get('sourceType') || Lang.type(source),"," sourceSetter;",""," if ((source && isFunction(source.sendRequest))"," || source === null"," || sourceType === 'datasource') {",""," // Quacks like a DataSource instance (or null). Make it so!"," this._rawSource = source;"," return source;"," }",""," // See if there's a registered setter for this source type."," if ((sourceSetter = AutoCompleteBase.SOURCE_TYPES[sourceType])) {"," this._rawSource = source;"," return Lang.isString(sourceSetter) ?"," this[sourceSetter](source) : sourceSetter(source);"," }",""," Y.error(\"Unsupported source type '\" + sourceType + \"'. Maybe autocomplete-sources isn't loaded?\");"," return INVALID_VALUE;"," },",""," /**"," Shared success callback for non-DataSource sources.",""," @method _sourceSuccess"," @param {Any} data Response data."," @param {Object} request Request object."," @protected"," **/"," _sourceSuccess: function (data, request) {"," request.callback.success({"," data: data,"," response: {results: data}"," });"," },",""," /**"," Synchronizes the UI state of the `allowBrowserAutocomplete` attribute.",""," @method _syncBrowserAutocomplete"," @protected"," **/"," _syncBrowserAutocomplete: function () {"," var inputNode = this.get(INPUT_NODE);",""," if (inputNode.get('nodeName').toLowerCase() === 'input') {"," inputNode.setAttribute('autocomplete',"," this.get(ALLOW_BROWSER_AC) ? 'on' : 'off');"," }"," },",""," /**"," Updates the query portion of the `value` attribute.",""," If a query delimiter is defined, the last delimited portion of the input"," value will be replaced with the specified _value_.",""," @method _updateValue"," @param {String} newVal New value."," @protected"," **/"," _updateValue: function (newVal) {"," var delim = this.get(QUERY_DELIMITER),"," insertDelim,"," len,"," prevVal;",""," newVal = Lang.trimLeft(newVal);",""," if (delim) {"," insertDelim = trim(delim); // so we don't double up on spaces"," prevVal = YArray.map(trim(this.get(VALUE)).split(delim), trim);"," len = prevVal.length;",""," if (len > 1) {"," prevVal[len - 1] = newVal;"," newVal = prevVal.join(insertDelim + ' ');"," }",""," newVal = newVal + insertDelim + ' ';"," }",""," this.set(VALUE, newVal);"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Updates the current `source` based on the new `sourceType` to ensure that"," the two attributes don't get out of sync when they're changed separately.",""," @method _afterSourceTypeChange"," @param {EventFacade} e"," @protected"," **/"," _afterSourceTypeChange: function (e) {"," if (this._rawSource) {"," this.set('source', this._rawSource);"," }"," },",""," /**"," Handles change events for the `value` attribute.",""," @method _afterValueChange"," @param {EventFacade} e"," @protected"," **/"," _afterValueChange: function (e) {"," var newVal = e.newVal,"," self = this,"," uiChange = e.src === AutoCompleteBase.UI_SRC,"," delay, fire, minQueryLength, query;",""," // Update the UI if the value was changed programmatically."," if (!uiChange) {"," self._inputNode.set(VALUE, newVal);"," }","",""," minQueryLength = self.get('minQueryLength');"," query = self._parseValue(newVal) || '';",""," if (minQueryLength >= 0 && query.length >= minQueryLength) {"," // Only query on changes that originate from the UI."," if (uiChange) {"," delay = self.get('queryDelay');",""," fire = function () {"," self.fire(EVT_QUERY, {"," inputValue: newVal,"," query : query,"," src : e.src"," });"," };",""," if (delay) {"," clearTimeout(self._delay);"," self._delay = setTimeout(fire, delay);"," } else {"," fire();"," }"," } else {"," // For programmatic value changes, just update the query"," // attribute without sending a query."," self._set(QUERY, query);"," }"," } else {"," clearTimeout(self._delay);",""," self.fire(EVT_CLEAR, {"," prevVal: e.prevVal ? self._parseValue(e.prevVal) : null,"," src : e.src"," });"," }"," },",""," /**"," Handles `blur` events on the input node.",""," @method _onInputBlur"," @param {EventFacade} e"," @protected"," **/"," _onInputBlur: function (e) {"," var delim = this.get(QUERY_DELIMITER),"," delimPos,"," newVal,"," value;",""," // If a query delimiter is set and the input's value contains one or"," // more trailing delimiters, strip them."," if (delim && !this.get('allowTrailingDelimiter')) {"," delim = Lang.trimRight(delim);"," value = newVal = this._inputNode.get(VALUE);",""," if (delim) {"," while ((newVal = Lang.trimRight(newVal)) &&"," (delimPos = newVal.length - delim.length) &&"," newVal.lastIndexOf(delim) === delimPos) {",""," newVal = newVal.substring(0, delimPos);"," }"," } else {"," // Delimiter is one or more space characters, so just trim the"," // value."," newVal = Lang.trimRight(newVal);"," }",""," if (newVal !== value) {"," this.set(VALUE, newVal);"," }"," }"," },",""," /**"," Handles `valueChange` events on the input node and fires a `query` event"," when the input value meets the configured criteria.",""," @method _onInputValueChange"," @param {EventFacade} e"," @protected"," **/"," _onInputValueChange: function (e) {"," var newVal = e.newVal;",""," // Don't query if the internal value is the same as the new value"," // reported by valueChange."," if (newVal !== this.get(VALUE)) {"," this.set(VALUE, newVal, {src: AutoCompleteBase.UI_SRC});"," }"," },",""," /**"," Handles source responses and fires the `results` event.",""," @method _onResponse"," @param {EventFacade} e"," @protected"," **/"," _onResponse: function (query, e) {"," // Ignore stale responses that aren't for the current query."," if (query === (this.get(QUERY) || '')) {"," this._parseResponse(query || '', e.response, e.data);"," }"," },",""," // -- Protected Default Event Handlers -------------------------------------",""," /**"," Default `clear` event handler. Sets the `results` attribute to an empty"," array and `query` to null.",""," @method _defClearFn"," @protected"," **/"," _defClearFn: function () {"," this._set(QUERY, null);"," this._set(RESULTS, []);"," },",""," /**"," Default `query` event handler. Sets the `query` attribute and sends a"," request to the source if one is configured.",""," @method _defQueryFn"," @param {EventFacade} e"," @protected"," **/"," _defQueryFn: function (e) {"," this.sendRequest(e.query); // sendRequest will set the 'query' attribute"," },",""," /**"," Default `results` event handler. Sets the `results` attribute to the latest"," results.",""," @method _defResultsFn"," @param {EventFacade} e"," @protected"," **/"," _defResultsFn: function (e) {"," this._set(RESULTS, e[RESULTS]);"," }","};","","AutoCompleteBase.ATTRS = {"," /**"," Whether or not to enable the browser's built-in autocomplete functionality"," for input fields.",""," @attribute allowBrowserAutocomplete"," @type Boolean"," @default false"," **/"," allowBrowserAutocomplete: {"," value: false"," },",""," /**"," When a `queryDelimiter` is set, trailing delimiters will automatically be"," stripped from the input value by default when the input node loses focus."," Set this to `true` to allow trailing delimiters.",""," @attribute allowTrailingDelimiter"," @type Boolean"," @default false"," **/"," allowTrailingDelimiter: {"," value: false"," },",""," /**"," Whether or not to enable in-memory caching in result sources that support"," it.",""," @attribute enableCache"," @type Boolean"," @default true"," @since 3.5.0"," **/"," enableCache: {"," lazyAdd: false, // we need the setter to run on init"," setter: '_setEnableCache',"," value: true"," },",""," /**"," Node to monitor for changes, which will generate `query` events when"," appropriate. May be either an `<input>` or a `<textarea>`.",""," @attribute inputNode"," @type Node|HTMLElement|String"," @initOnly"," **/"," inputNode: {"," setter: Y.one,"," writeOnce: 'initOnly'"," },",""," /**"," Maximum number of results to return. A value of `0` or less will allow an"," unlimited number of results.",""," @attribute maxResults"," @type Number"," @default 0"," **/"," maxResults: {"," value: 0"," },",""," /**"," Minimum number of characters that must be entered before a `query` event"," will be fired. A value of `0` allows empty queries; a negative value will"," effectively disable all `query` events.",""," @attribute minQueryLength"," @type Number"," @default 1"," **/"," minQueryLength: {"," value: 1"," },",""," /**"," Current query, or `null` if there is no current query.",""," The query might not be the same as the current value of the input node, both"," for timing reasons (due to `queryDelay`) and because when one or more"," `queryDelimiter` separators are in use, only the last portion of the"," delimited input string will be used as the query value.",""," @attribute query"," @type String|null"," @default null"," @readonly"," **/"," query: {"," readOnly: true,"," value: null"," },",""," /**"," Number of milliseconds to delay after input before triggering a `query`"," event. If new input occurs before this delay is over, the previous input"," event will be ignored and a new delay will begin.",""," This can be useful both to throttle queries to a remote data source and to"," avoid distracting the user by showing them less relevant results before"," they've paused their typing.",""," @attribute queryDelay"," @type Number"," @default 100"," **/"," queryDelay: {"," value: 100"," },",""," /**"," Query delimiter string. When a delimiter is configured, the input value"," will be split on the delimiter, and only the last portion will be used in"," autocomplete queries and updated when the `query` attribute is"," modified.",""," @attribute queryDelimiter"," @type String|null"," @default null"," **/"," queryDelimiter: {"," value: null"," },",""," /**"," Source request template. This can be a function that accepts a query as a"," parameter and returns a request string, or it can be a string containing the"," placeholder \"{query}\", which will be replaced with the actual URI-encoded"," query. In either case, the resulting string will be appended to the request"," URL when the `source` attribute is set to a remote DataSource, JSONP URL, or"," XHR URL (it will not be appended to YQL URLs).",""," While `requestTemplate` may be set to either a function or a string, it will"," always be returned as a function that accepts a query argument and returns a"," string.",""," @attribute requestTemplate"," @type Function|String|null"," @default null"," **/"," requestTemplate: {"," setter: '_setRequestTemplate',"," value: null"," },",""," /**"," Array of local result filter functions. If provided, each filter will be"," called with two arguments when results are received: the query and an array"," of result objects. See the documentation for the `results` event for a list"," of the properties available on each result object.",""," Each filter is expected to return a filtered or modified version of the"," results array, which will then be passed on to subsequent filters, then the"," `resultHighlighter` function (if set), then the `resultFormatter` function"," (if set), and finally to subscribers to the `results` event.",""," If no `source` is set, result filters will not be called.",""," Prepackaged result filters provided by the autocomplete-filters and"," autocomplete-filters-accentfold modules can be used by specifying the filter"," name as a string, such as `'phraseMatch'` (assuming the necessary filters"," module is loaded).",""," @attribute resultFilters"," @type Array"," @default []"," **/"," resultFilters: {"," setter: '_setResultFilters',"," value: []"," },",""," /**"," Function which will be used to format results. If provided, this function"," will be called with two arguments after results have been received and"," filtered: the query and an array of result objects. The formatter is"," expected to return an array of HTML strings or Node instances containing the"," desired HTML for each result.",""," See the documentation for the `results` event for a list of the properties"," available on each result object.",""," If no `source` is set, the formatter will not be called.",""," @attribute resultFormatter"," @type Function|null"," **/"," resultFormatter: {"," validator: _FUNCTION_VALIDATOR,"," value: null"," },",""," /**"," Function which will be used to highlight results. If provided, this function"," will be called with two arguments after results have been received and"," filtered: the query and an array of filtered result objects. The highlighter"," is expected to return an array of highlighted result text in the form of"," HTML strings.",""," See the documentation for the `results` event for a list of the properties"," available on each result object.",""," If no `source` is set, the highlighter will not be called.",""," @attribute resultHighlighter"," @type Function|null"," **/"," resultHighlighter: {"," setter: '_setResultHighlighter',"," value: null"," },",""," /**"," Locator that should be used to extract an array of results from a non-array"," response.",""," By default, no locator is applied, and all responses are assumed to be"," arrays by default. If all responses are already arrays, you don't need to"," define a locator.",""," The locator may be either a function (which will receive the raw response as"," an argument and must return an array) or a string representing an object"," path, such as \"foo.bar.baz\" (which would return the value of"," `result.foo.bar.baz` if the response is an object).",""," While `resultListLocator` may be set to either a function or a string, it"," will always be returned as a function that accepts a response argument and"," returns an array.",""," @attribute resultListLocator"," @type Function|String|null"," **/"," resultListLocator: {"," setter: '_setLocator',"," value: null"," },",""," /**"," Current results, or an empty array if there are no results.",""," @attribute results"," @type Array"," @default []"," @readonly"," **/"," results: {"," readOnly: true,"," value: []"," },",""," /**"," Locator that should be used to extract a plain text string from a non-string"," result item. The resulting text value will typically be the value that ends"," up being inserted into an input field or textarea when the user of an"," autocomplete implementation selects a result.",""," By default, no locator is applied, and all results are assumed to be plain"," text strings. If all results are already plain text strings, you don't need"," to define a locator.",""," The locator may be either a function (which will receive the raw result as"," an argument and must return a string) or a string representing an object"," path, such as \"foo.bar.baz\" (which would return the value of"," `result.foo.bar.baz` if the result is an object).",""," While `resultTextLocator` may be set to either a function or a string, it"," will always be returned as a function that accepts a result argument and"," returns a string.",""," @attribute resultTextLocator"," @type Function|String|null"," **/"," resultTextLocator: {"," setter: '_setLocator',"," value: null"," },",""," /**"," Source for autocomplete results. The following source types are supported:",""," <dl>"," <dt>Array</dt>"," <dd>"," <p>"," The full array will be provided to any configured filters for each"," query. This is an easy way to create a fully client-side autocomplete"," implementation."," </p>",""," <p>"," Example: `['first result', 'second result', 'etc']`"," </p>"," </dd>",""," <dt>DataSource</dt>"," <dd>"," A `DataSource` instance or other object that provides a DataSource-like"," `sendRequest` method. See the `DataSource` documentation for details."," </dd>",""," <dt>Function</dt>"," <dd>"," <p>"," A function source will be called with the current query and a"," callback function as parameters, and should either return an array of"," results (for synchronous operation) or return nothing and pass an"," array of results to the provided callback (for asynchronous"," operation)."," </p>",""," <p>"," Example (synchronous):"," </p>",""," <pre>"," function (query) {"," return ['foo', 'bar'];"," }"," </pre>",""," <p>"," Example (async):"," </p>",""," <pre>"," function (query, callback) {"," callback(['foo', 'bar']);"," }"," </pre>"," </dd>",""," <dt>Object</dt>"," <dd>"," <p>"," An object will be treated as a query hashmap. If a property on the"," object matches the current query, the value of that property will be"," used as the response."," </p>",""," <p>"," The response is assumed to be an array of results by default. If the"," response is not an array, provide a `resultListLocator` to"," process the response and return an array."," </p>",""," <p>"," Example: `{foo: ['foo result 1', 'foo result 2'], bar: ['bar result']}`"," </p>"," </dd>"," </dl>",""," If the optional `autocomplete-sources` module is loaded, then"," the following additional source types will be supported as well:",""," <dl>"," <dt><select> Node</dt>"," <dd>"," You may provide a YUI Node instance wrapping a <select>"," element, and the options in the list will be used as results. You"," will also need to specify a `resultTextLocator` of 'text'"," or 'value', depending on what you want to use as the text of the"," result.",""," Each result will be an object with the following properties:",""," <dl>"," <dt>html (String)</dt>"," <dd>"," <p>HTML content of the <option> element.</p>"," </dd>",""," <dt>index (Number)</dt>"," <dd>"," <p>Index of the <option> element in the list.</p>"," </dd>",""," <dt>node (Y.Node)</dt>"," <dd>"," <p>Node instance referring to the original <option> element.</p>"," </dd>",""," <dt>selected (Boolean)</dt>"," <dd>"," <p>Whether or not this item is currently selected in the"," <select> list.</p>"," </dd>",""," <dt>text (String)</dt>"," <dd>"," <p>Text content of the <option> element.</p>"," </dd>",""," <dt>value (String)</dt>"," <dd>"," <p>Value of the <option> element.</p>"," </dd>"," </dl>"," </dd>",""," <dt>String (JSONP URL)</dt>"," <dd>"," <p>"," If a URL with a `{callback}` placeholder is provided, it will be used to"," make a JSONP request. The `{query}` placeholder will be replaced with"," the current query, and the `{callback}` placeholder will be replaced"," with an internally-generated JSONP callback name. Both placeholders must"," appear in the URL, or the request will fail. An optional `{maxResults}`"," placeholder may also be provided, and will be replaced with the value of"," the maxResults attribute (or 1000 if the maxResults attribute is 0 or"," less)."," </p>",""," <p>"," The response is assumed to be an array of results by default. If the"," response is not an array, provide a `resultListLocator` to process the"," response and return an array."," </p>",""," <p>"," <strong>The `jsonp` module must be loaded in order for"," JSONP URL sources to work.</strong> If the `jsonp` module"," is not already loaded, it will be loaded on demand if possible."," </p>",""," <p>"," Example: `'http://example.com/search?q={query}&callback={callback}'`"," </p>"," </dd>",""," <dt>String (XHR URL)</dt>"," <dd>"," <p>"," If a URL without a `{callback}` placeholder is provided, it will be used"," to make a same-origin XHR request. The `{query}` placeholder will be"," replaced with the current query. An optional `{maxResults}` placeholder"," may also be provided, and will be replaced with the value of the"," maxResults attribute (or 1000 if the maxResults attribute is 0 or less)."," </p>",""," <p>"," The response is assumed to be a JSON array of results by default. If the"," response is a JSON object and not an array, provide a"," `resultListLocator` to process the response and return an array. If the"," response is in some form other than JSON, you will need to use a custom"," DataSource instance as the source."," </p>",""," <p>"," <strong>The `io-base` and `json-parse` modules"," must be loaded in order for XHR URL sources to work.</strong> If"," these modules are not already loaded, they will be loaded on demand"," if possible."," </p>",""," <p>"," Example: `'http://example.com/search?q={query}'`"," </p>"," </dd>",""," <dt>String (YQL query)</dt>"," <dd>"," <p>"," If a YQL query is provided, it will be used to make a YQL request. The"," `{query}` placeholder will be replaced with the current autocomplete"," query. This placeholder must appear in the YQL query, or the request"," will fail. An optional `{maxResults}` placeholder may also be provided,"," and will be replaced with the value of the maxResults attribute (or 1000"," if the maxResults attribute is 0 or less)."," </p>",""," <p>"," <strong>The `yql` module must be loaded in order for YQL"," sources to work.</strong> If the `yql` module is not"," already loaded, it will be loaded on demand if possible."," </p>",""," <p>"," Example: `'select * from search.suggest where query=\"{query}\"'`"," </p>"," </dd>"," </dl>",""," As an alternative to providing a source, you could simply listen for `query`"," events and handle them any way you see fit. Providing a source is optional,"," but will usually be simpler.",""," @attribute source"," @type Array|DataSource|Function|Node|Object|String|null"," **/"," source: {"," setter: '_setSource',"," value: null"," },",""," /**"," May be used to force a specific source type, overriding the automatic source"," type detection. It should almost never be necessary to do this, but as they"," taught us in the Boy Scouts, one should always be prepared, so it's here if"," you need it. Be warned that if you set this attribute and something breaks,"," it's your own fault.",""," Supported `sourceType` values are: 'array', 'datasource', 'function', and"," 'object'.",""," If the `autocomplete-sources` module is loaded, the following additional"," source types are supported: 'io', 'jsonp', 'select', 'string', 'yql'",""," @attribute sourceType"," @type String"," **/"," sourceType: {"," value: null"," },",""," /**"," If the `inputNode` specified at instantiation time has a `node-tokeninput`"," plugin attached to it, this attribute will be a reference to the"," `Y.Plugin.TokenInput` instance.",""," @attribute tokenInput"," @type Plugin.TokenInput"," @readonly"," **/"," tokenInput: {"," readOnly: true"," },",""," /**"," Current value of the input node.",""," @attribute value"," @type String"," @default ''"," **/"," value: {"," // Why duplicate this._inputNode.get('value')? Because we need a"," // reliable way to track the source of value changes. We want to perform"," // completion when the user changes the value, but not when we change"," // the value."," value: ''"," }","};","","// This tells Y.Base.create() to copy these static properties to any class","// AutoCompleteBase is mixed into.","AutoCompleteBase._buildCfg = {"," aggregates: ['SOURCE_TYPES'],"," statics : ['UI_SRC']","};","","/**","Mapping of built-in source types to their setter functions. DataSource instances","and DataSource-like objects are handled natively, so are not mapped here.","","@property SOURCE_TYPES","@type {Object}","@static","**/","AutoCompleteBase.SOURCE_TYPES = {"," array : '_createArraySource',"," 'function': '_createFunctionSource',"," object : '_createObjectSource'","};","","AutoCompleteBase.UI_SRC = (Y.Widget && Y.Widget.UI_SRC) || 'ui';","","Y.AutoCompleteBase = AutoCompleteBase;","","","}, '3.7.2', {\"optional\": [\"autocomplete-sources\"], \"requires\": [\"array-extras\", \"base-build\", \"escape\", \"event-valuechange\", \"node-base\"]});"];+_yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].code=["YUI.add('autocomplete-base', function (Y, NAME) {","","/**","Provides automatic input completion or suggestions for text input fields and","textareas.","","@module autocomplete","@main autocomplete","@since 3.3.0","**/","","/**","`Y.Base` extension that provides core autocomplete logic (but no UI","implementation) for a text input field or textarea. Must be mixed into a","`Y.Base`-derived class to be useful.","","@module autocomplete","@submodule autocomplete-base","**/","","/**","Extension that provides core autocomplete logic (but no UI implementation) for a","text input field or textarea.","","The `AutoCompleteBase` class provides events and attributes that abstract away","core autocomplete logic and configuration, but does not provide a widget","implementation or suggestion UI. For a prepackaged autocomplete widget, see","`AutoCompleteList`.","","This extension cannot be instantiated directly, since it doesn't provide an","actual implementation. It's intended to be mixed into a `Y.Base`-based class or","widget.","","`Y.Widget`-based example:",""," YUI().use('autocomplete-base', 'widget', function (Y) {"," var MyAC = Y.Base.create('myAC', Y.Widget, [Y.AutoCompleteBase], {"," // Custom prototype methods and properties."," }, {"," // Custom static methods and properties."," });",""," // Custom implementation code."," });","","`Y.Base`-based example:",""," YUI().use('autocomplete-base', function (Y) {"," var MyAC = Y.Base.create('myAC', Y.Base, [Y.AutoCompleteBase], {"," initializer: function () {"," this._bindUIACBase();"," this._syncUIACBase();"," },",""," // Custom prototype methods and properties."," }, {"," // Custom static methods and properties."," });",""," // Custom implementation code."," });","","@class AutoCompleteBase","**/","","var Escape = Y.Escape,"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,",""," isFunction = Lang.isFunction,"," isString = Lang.isString,"," trim = Lang.trim,",""," INVALID_VALUE = Y.Attribute.INVALID_VALUE,",""," _FUNCTION_VALIDATOR = '_functionValidator',"," _SOURCE_SUCCESS = '_sourceSuccess',",""," ALLOW_BROWSER_AC = 'allowBrowserAutocomplete',"," INPUT_NODE = 'inputNode',"," QUERY = 'query',"," QUERY_DELIMITER = 'queryDelimiter',"," REQUEST_TEMPLATE = 'requestTemplate',"," RESULTS = 'results',"," RESULT_LIST_LOCATOR = 'resultListLocator',"," VALUE = 'value',"," VALUE_CHANGE = 'valueChange',",""," EVT_CLEAR = 'clear',"," EVT_QUERY = QUERY,"," EVT_RESULTS = RESULTS;","","function AutoCompleteBase() {}","","AutoCompleteBase.prototype = {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," // AOP bindings."," Y.before(this._bindUIACBase, this, 'bindUI');"," Y.before(this._syncUIACBase, this, 'syncUI');",""," // -- Public Events ----------------------------------------------------",""," /**"," Fires after the query has been completely cleared or no longer meets the"," minimum query length requirement.",""," @event clear"," @param {String} prevVal Value of the query before it was cleared."," @param {String} src Source of the event."," @preventable _defClearFn"," **/"," this.publish(EVT_CLEAR, {"," defaultFn: this._defClearFn"," });",""," /**"," Fires when the contents of the input field have changed and the input"," value meets the criteria necessary to generate an autocomplete query.",""," @event query"," @param {String} inputValue Full contents of the text input field or"," textarea that generated the query."," @param {String} query AutoComplete query. This is the string that will"," be used to request completion results. It may or may not be the same"," as `inputValue`."," @param {String} src Source of the event."," @preventable _defQueryFn"," **/"," this.publish(EVT_QUERY, {"," defaultFn: this._defQueryFn"," });",""," /**"," Fires after query results are received from the source. If no source has"," been set, this event will not fire.",""," @event results"," @param {Array|Object} data Raw, unfiltered result data (if available)."," @param {String} query Query that generated these results."," @param {Object[]} results Array of filtered, formatted, and highlighted"," results. Each item in the array is an object with the following"," properties:",""," @param {Node|HTMLElement|String} results.display Formatted result"," HTML suitable for display to the user. If no custom formatter is"," set, this will be an HTML-escaped version of the string in the"," `text` property."," @param {String} [results.highlighted] Highlighted (but not"," formatted) result text. This property will only be set if a"," highlighter is in use."," @param {Any} results.raw Raw, unformatted result in whatever form it"," was provided by the source."," @param {String} results.text Plain text version of the result,"," suitable for being inserted into the value of a text input field"," or textarea when the result is selected by a user. This value is"," not HTML-escaped and should not be inserted into the page using"," `innerHTML` or `Node#setContent()`.",""," @preventable _defResultsFn"," **/"," this.publish(EVT_RESULTS, {"," defaultFn: this._defResultsFn"," });"," },",""," destructor: function () {"," this._acBaseEvents && this._acBaseEvents.detach();",""," delete this._acBaseEvents;"," delete this._cache;"," delete this._inputNode;"," delete this._rawSource;"," },",""," // -- Public Prototype Methods ---------------------------------------------",""," /**"," Clears the result cache.",""," @method clearCache"," @chainable"," @since 3.5.0"," **/"," clearCache: function () {"," this._cache && (this._cache = {});"," return this;"," },",""," /**"," Sends a request to the configured source. If no source is configured, this"," method won't do anything.",""," Usually there's no reason to call this method manually; it will be called"," automatically when user input causes a `query` event to be fired. The only"," time you'll need to call this method manually is if you want to force a"," request to be sent when no user input has occurred.",""," @method sendRequest"," @param {String} [query] Query to send. If specified, the `query` attribute"," will be set to this query. If not specified, the current value of the"," `query` attribute will be used."," @param {Function} [requestTemplate] Request template function. If not"," specified, the current value of the `requestTemplate` attribute will be"," used."," @chainable"," **/"," sendRequest: function (query, requestTemplate) {"," var request,"," source = this.get('source');",""," if (query || query === '') {"," this._set(QUERY, query);"," } else {"," query = this.get(QUERY) || '';"," }",""," if (source) {"," if (!requestTemplate) {"," requestTemplate = this.get(REQUEST_TEMPLATE);"," }",""," request = requestTemplate ?"," requestTemplate.call(this, query) : query;","",""," source.sendRequest({"," query : query,"," request: request,",""," callback: {"," success: Y.bind(this._onResponse, this, query)"," }"," });"," }",""," return this;"," },",""," // -- Protected Lifecycle Methods ------------------------------------------",""," /**"," Attaches event listeners and behaviors.",""," @method _bindUIACBase"," @protected"," **/"," _bindUIACBase: function () {"," var inputNode = this.get(INPUT_NODE),"," tokenInput = inputNode && inputNode.tokenInput;",""," // If the inputNode has a node-tokeninput plugin attached, bind to the"," // plugin's inputNode instead."," if (tokenInput) {"," inputNode = tokenInput.get(INPUT_NODE);"," this._set('tokenInput', tokenInput);"," }",""," if (!inputNode) {"," Y.error('No inputNode specified.');"," return;"," }",""," this._inputNode = inputNode;",""," this._acBaseEvents = new Y.EventHandle(["," // This is the valueChange event on the inputNode, provided by the"," // event-valuechange module, not our own valueChange."," inputNode.on(VALUE_CHANGE, this._onInputValueChange, this),"," inputNode.on('blur', this._onInputBlur, this),",""," this.after(ALLOW_BROWSER_AC + 'Change', this._syncBrowserAutocomplete),"," this.after('sourceTypeChange', this._afterSourceTypeChange),"," this.after(VALUE_CHANGE, this._afterValueChange)"," ]);"," },",""," /**"," Synchronizes the UI state of the `inputNode`.",""," @method _syncUIACBase"," @protected"," **/"," _syncUIACBase: function () {"," this._syncBrowserAutocomplete();"," this.set(VALUE, this.get(INPUT_NODE).get(VALUE));"," },",""," // -- Protected Prototype Methods ------------------------------------------",""," /**"," Creates a DataSource-like object that simply returns the specified array as"," a response. See the `source` attribute for more details.",""," @method _createArraySource"," @param {Array} source"," @return {Object} DataSource-like object."," @protected"," **/"," _createArraySource: function (source) {"," var that = this;",""," return {"," type: 'array',"," sendRequest: function (request) {"," that[_SOURCE_SUCCESS](source.concat(), request);"," }"," };"," },",""," /**"," Creates a DataSource-like object that passes the query to a custom-defined"," function, which is expected to call the provided callback with an array of"," results. See the `source` attribute for more details.",""," @method _createFunctionSource"," @param {Function} source Function that accepts a query and a callback as"," parameters, and calls the callback with an array of results."," @return {Object} DataSource-like object."," @protected"," **/"," _createFunctionSource: function (source) {"," var that = this;",""," return {"," type: 'function',"," sendRequest: function (request) {"," var value;",""," function afterResults(results) {"," that[_SOURCE_SUCCESS](results || [], request);"," }",""," // Allow both synchronous and asynchronous functions. If we get"," // a truthy return value, assume the function is synchronous."," if ((value = source(request.query, afterResults))) {"," afterResults(value);"," }"," }"," };"," },",""," /**"," Creates a DataSource-like object that looks up queries as properties on the"," specified object, and returns the found value (if any) as a response. See"," the `source` attribute for more details.",""," @method _createObjectSource"," @param {Object} source"," @return {Object} DataSource-like object."," @protected"," **/"," _createObjectSource: function (source) {"," var that = this;",""," return {"," type: 'object',"," sendRequest: function (request) {"," var query = request.query;",""," that[_SOURCE_SUCCESS]("," YObject.owns(source, query) ? source[query] : [],"," request"," );"," }"," };"," },",""," /**"," Returns `true` if _value_ is either a function or `null`.",""," @method _functionValidator"," @param {Function|null} value Value to validate."," @protected"," **/"," _functionValidator: function (value) {"," return value === null || isFunction(value);"," },",""," /**"," Faster and safer alternative to `Y.Object.getValue()`. Doesn't bother"," casting the path to an array (since we already know it's an array) and"," doesn't throw an error if a value in the middle of the object hierarchy is"," neither `undefined` nor an object.",""," @method _getObjectValue"," @param {Object} obj"," @param {Array} path"," @return {Any} Located value, or `undefined` if the value was"," not found at the specified path."," @protected"," **/"," _getObjectValue: function (obj, path) {"," if (!obj) {"," return;"," }",""," for (var i = 0, len = path.length; obj && i < len; i++) {"," obj = obj[path[i]];"," }",""," return obj;"," },",""," /**"," Parses result responses, performs filtering and highlighting, and fires the"," `results` event.",""," @method _parseResponse"," @param {String} query Query that generated these results."," @param {Object} response Response containing results."," @param {Object} data Raw response data."," @protected"," **/"," _parseResponse: function (query, response, data) {"," var facade = {"," data : data,"," query : query,"," results: []"," },",""," listLocator = this.get(RESULT_LIST_LOCATOR),"," results = [],"," unfiltered = response && response.results,",""," filters,"," formatted,"," formatter,"," highlighted,"," highlighter,"," i,"," len,"," maxResults,"," result,"," text,"," textLocator;",""," if (unfiltered && listLocator) {"," unfiltered = listLocator.call(this, unfiltered);"," }",""," if (unfiltered && unfiltered.length) {"," filters = this.get('resultFilters');"," textLocator = this.get('resultTextLocator');",""," // Create a lightweight result object for each result to make them"," // easier to work with. The various properties on the object"," // represent different formats of the result, and will be populated"," // as we go."," for (i = 0, len = unfiltered.length; i < len; ++i) {"," result = unfiltered[i];",""," text = textLocator ?"," textLocator.call(this, result) :"," result.toString();",""," results.push({"," display: Escape.html(text),"," raw : result,"," text : text"," });"," }",""," // Run the results through all configured result filters. Each"," // filter returns an array of (potentially fewer) result objects,"," // which is then passed to the next filter, and so on."," for (i = 0, len = filters.length; i < len; ++i) {"," results = filters[i].call(this, query, results.concat());",""," if (!results) {"," return;"," }",""," if (!results.length) {"," break;"," }"," }",""," if (results.length) {"," formatter = this.get('resultFormatter');"," highlighter = this.get('resultHighlighter');"," maxResults = this.get('maxResults');",""," // If maxResults is set and greater than 0, limit the number of"," // results."," if (maxResults && maxResults > 0 &&"," results.length > maxResults) {"," results.length = maxResults;"," }",""," // Run the results through the configured highlighter (if any)."," // The highlighter returns an array of highlighted strings (not"," // an array of result objects), and these strings are then added"," // to each result object."," if (highlighter) {"," highlighted = highlighter.call(this, query,"," results.concat());",""," if (!highlighted) {"," return;"," }",""," for (i = 0, len = highlighted.length; i < len; ++i) {"," result = results[i];"," result.highlighted = highlighted[i];"," result.display = result.highlighted;"," }"," }",""," // Run the results through the configured formatter (if any) to"," // produce the final formatted results. The formatter returns an"," // array of strings or Node instances (not an array of result"," // objects), and these strings/Nodes are then added to each"," // result object."," if (formatter) {"," formatted = formatter.call(this, query, results.concat());",""," if (!formatted) {"," return;"," }",""," for (i = 0, len = formatted.length; i < len; ++i) {"," results[i].display = formatted[i];"," }"," }"," }"," }",""," facade.results = results;"," this.fire(EVT_RESULTS, facade);"," },",""," /**"," Returns the query portion of the specified input value, or `null` if there"," is no suitable query within the input value.",""," If a query delimiter is defined, the query will be the last delimited part"," of of the string.",""," @method _parseValue"," @param {String} value Input value from which to extract the query."," @return {String|null} query"," @protected"," **/"," _parseValue: function (value) {"," var delim = this.get(QUERY_DELIMITER);",""," if (delim) {"," value = value.split(delim);"," value = value[value.length - 1];"," }",""," return Lang.trimLeft(value);"," },",""," /**"," Setter for the `enableCache` attribute.",""," @method _setEnableCache"," @param {Boolean} value"," @protected"," @since 3.5.0"," **/"," _setEnableCache: function (value) {"," // When `this._cache` is an object, result sources will store cached"," // results in it. When it's falsy, they won't. This way result sources"," // don't need to get the value of the `enableCache` attribute on every"," // request, which would be sloooow."," this._cache = value ? {} : null;"," },",""," /**"," Setter for locator attributes.",""," @method _setLocator"," @param {Function|String|null} locator"," @return {Function|null}"," @protected"," **/"," _setLocator: function (locator) {"," if (this[_FUNCTION_VALIDATOR](locator)) {"," return locator;"," }",""," var that = this;",""," locator = locator.toString().split('.');",""," return function (result) {"," return result && that._getObjectValue(result, locator);"," };"," },",""," /**"," Setter for the `requestTemplate` attribute.",""," @method _setRequestTemplate"," @param {Function|String|null} template"," @return {Function|null}"," @protected"," **/"," _setRequestTemplate: function (template) {"," if (this[_FUNCTION_VALIDATOR](template)) {"," return template;"," }",""," template = template.toString();",""," return function (query) {"," return Lang.sub(template, {query: encodeURIComponent(query)});"," };"," },",""," /**"," Setter for the `resultFilters` attribute.",""," @method _setResultFilters"," @param {Array|Function|String|null} filters `null`, a filter"," function, an array of filter functions, or a string or array of strings"," representing the names of methods on `Y.AutoCompleteFilters`."," @return {Function[]} Array of filter functions (empty if <i>filters</i> is"," `null`)."," @protected"," **/"," _setResultFilters: function (filters) {"," var acFilters, getFilterFunction;",""," if (filters === null) {"," return [];"," }",""," acFilters = Y.AutoCompleteFilters;",""," getFilterFunction = function (filter) {"," if (isFunction(filter)) {"," return filter;"," }",""," if (isString(filter) && acFilters &&"," isFunction(acFilters[filter])) {"," return acFilters[filter];"," }",""," return false;"," };",""," if (Lang.isArray(filters)) {"," filters = YArray.map(filters, getFilterFunction);"," return YArray.every(filters, function (f) { return !!f; }) ?"," filters : INVALID_VALUE;"," } else {"," filters = getFilterFunction(filters);"," return filters ? [filters] : INVALID_VALUE;"," }"," },",""," /**"," Setter for the `resultHighlighter` attribute.",""," @method _setResultHighlighter"," @param {Function|String|null} highlighter `null`, a highlighter function, or"," a string representing the name of a method on"," `Y.AutoCompleteHighlighters`."," @return {Function|null}"," @protected"," **/"," _setResultHighlighter: function (highlighter) {"," var acHighlighters;",""," if (this[_FUNCTION_VALIDATOR](highlighter)) {"," return highlighter;"," }",""," acHighlighters = Y.AutoCompleteHighlighters;",""," if (isString(highlighter) && acHighlighters &&"," isFunction(acHighlighters[highlighter])) {"," return acHighlighters[highlighter];"," }",""," return INVALID_VALUE;"," },",""," /**"," Setter for the `source` attribute. Returns a DataSource or a DataSource-like"," object depending on the type of _source_ and/or the value of the"," `sourceType` attribute.",""," @method _setSource"," @param {Any} source AutoComplete source. See the `source` attribute for"," details."," @return {DataSource|Object}"," @protected"," **/"," _setSource: function (source) {"," var sourceType = this.get('sourceType') || Lang.type(source),"," sourceSetter;",""," if ((source && isFunction(source.sendRequest))"," || source === null"," || sourceType === 'datasource') {",""," // Quacks like a DataSource instance (or null). Make it so!"," this._rawSource = source;"," return source;"," }",""," // See if there's a registered setter for this source type."," if ((sourceSetter = AutoCompleteBase.SOURCE_TYPES[sourceType])) {"," this._rawSource = source;"," return Lang.isString(sourceSetter) ?"," this[sourceSetter](source) : sourceSetter(source);"," }",""," Y.error(\"Unsupported source type '\" + sourceType + \"'. Maybe autocomplete-sources isn't loaded?\");"," return INVALID_VALUE;"," },",""," /**"," Shared success callback for non-DataSource sources.",""," @method _sourceSuccess"," @param {Any} data Response data."," @param {Object} request Request object."," @protected"," **/"," _sourceSuccess: function (data, request) {"," request.callback.success({"," data: data,"," response: {results: data}"," });"," },",""," /**"," Synchronizes the UI state of the `allowBrowserAutocomplete` attribute.",""," @method _syncBrowserAutocomplete"," @protected"," **/"," _syncBrowserAutocomplete: function () {"," var inputNode = this.get(INPUT_NODE);",""," if (inputNode.get('nodeName').toLowerCase() === 'input') {"," inputNode.setAttribute('autocomplete',"," this.get(ALLOW_BROWSER_AC) ? 'on' : 'off');"," }"," },",""," /**"," Updates the query portion of the `value` attribute.",""," If a query delimiter is defined, the last delimited portion of the input"," value will be replaced with the specified _value_.",""," @method _updateValue"," @param {String} newVal New value."," @protected"," **/"," _updateValue: function (newVal) {"," var delim = this.get(QUERY_DELIMITER),"," insertDelim,"," len,"," prevVal;",""," newVal = Lang.trimLeft(newVal);",""," if (delim) {"," insertDelim = trim(delim); // so we don't double up on spaces"," prevVal = YArray.map(trim(this.get(VALUE)).split(delim), trim);"," len = prevVal.length;",""," if (len > 1) {"," prevVal[len - 1] = newVal;"," newVal = prevVal.join(insertDelim + ' ');"," }",""," newVal = newVal + insertDelim + ' ';"," }",""," this.set(VALUE, newVal);"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Updates the current `source` based on the new `sourceType` to ensure that"," the two attributes don't get out of sync when they're changed separately.",""," @method _afterSourceTypeChange"," @param {EventFacade} e"," @protected"," **/"," _afterSourceTypeChange: function (e) {"," if (this._rawSource) {"," this.set('source', this._rawSource);"," }"," },",""," /**"," Handles change events for the `value` attribute.",""," @method _afterValueChange"," @param {EventFacade} e"," @protected"," **/"," _afterValueChange: function (e) {"," var newVal = e.newVal,"," self = this,"," uiChange = e.src === AutoCompleteBase.UI_SRC,"," delay, fire, minQueryLength, query;",""," // Update the UI if the value was changed programmatically."," if (!uiChange) {"," self._inputNode.set(VALUE, newVal);"," }","",""," minQueryLength = self.get('minQueryLength');"," query = self._parseValue(newVal) || '';",""," if (minQueryLength >= 0 && query.length >= minQueryLength) {"," // Only query on changes that originate from the UI."," if (uiChange) {"," delay = self.get('queryDelay');",""," fire = function () {"," self.fire(EVT_QUERY, {"," inputValue: newVal,"," query : query,"," src : e.src"," });"," };",""," if (delay) {"," clearTimeout(self._delay);"," self._delay = setTimeout(fire, delay);"," } else {"," fire();"," }"," } else {"," // For programmatic value changes, just update the query"," // attribute without sending a query."," self._set(QUERY, query);"," }"," } else {"," clearTimeout(self._delay);",""," self.fire(EVT_CLEAR, {"," prevVal: e.prevVal ? self._parseValue(e.prevVal) : null,"," src : e.src"," });"," }"," },",""," /**"," Handles `blur` events on the input node.",""," @method _onInputBlur"," @param {EventFacade} e"," @protected"," **/"," _onInputBlur: function (e) {"," var delim = this.get(QUERY_DELIMITER),"," delimPos,"," newVal,"," value;",""," // If a query delimiter is set and the input's value contains one or"," // more trailing delimiters, strip them."," if (delim && !this.get('allowTrailingDelimiter')) {"," delim = Lang.trimRight(delim);"," value = newVal = this._inputNode.get(VALUE);",""," if (delim) {"," while ((newVal = Lang.trimRight(newVal)) &&"," (delimPos = newVal.length - delim.length) &&"," newVal.lastIndexOf(delim) === delimPos) {",""," newVal = newVal.substring(0, delimPos);"," }"," } else {"," // Delimiter is one or more space characters, so just trim the"," // value."," newVal = Lang.trimRight(newVal);"," }",""," if (newVal !== value) {"," this.set(VALUE, newVal);"," }"," }"," },",""," /**"," Handles `valueChange` events on the input node and fires a `query` event"," when the input value meets the configured criteria.",""," @method _onInputValueChange"," @param {EventFacade} e"," @protected"," **/"," _onInputValueChange: function (e) {"," var newVal = e.newVal;",""," // Don't query if the internal value is the same as the new value"," // reported by valueChange."," if (newVal !== this.get(VALUE)) {"," this.set(VALUE, newVal, {src: AutoCompleteBase.UI_SRC});"," }"," },",""," /**"," Handles source responses and fires the `results` event.",""," @method _onResponse"," @param {EventFacade} e"," @protected"," **/"," _onResponse: function (query, e) {"," // Ignore stale responses that aren't for the current query."," if (query === (this.get(QUERY) || '')) {"," this._parseResponse(query || '', e.response, e.data);"," }"," },",""," // -- Protected Default Event Handlers -------------------------------------",""," /**"," Default `clear` event handler. Sets the `results` attribute to an empty"," array and `query` to null.",""," @method _defClearFn"," @protected"," **/"," _defClearFn: function () {"," this._set(QUERY, null);"," this._set(RESULTS, []);"," },",""," /**"," Default `query` event handler. Sets the `query` attribute and sends a"," request to the source if one is configured.",""," @method _defQueryFn"," @param {EventFacade} e"," @protected"," **/"," _defQueryFn: function (e) {"," this.sendRequest(e.query); // sendRequest will set the 'query' attribute"," },",""," /**"," Default `results` event handler. Sets the `results` attribute to the latest"," results.",""," @method _defResultsFn"," @param {EventFacade} e"," @protected"," **/"," _defResultsFn: function (e) {"," this._set(RESULTS, e[RESULTS]);"," }","};","","AutoCompleteBase.ATTRS = {"," /**"," Whether or not to enable the browser's built-in autocomplete functionality"," for input fields.",""," @attribute allowBrowserAutocomplete"," @type Boolean"," @default false"," **/"," allowBrowserAutocomplete: {"," value: false"," },",""," /**"," When a `queryDelimiter` is set, trailing delimiters will automatically be"," stripped from the input value by default when the input node loses focus."," Set this to `true` to allow trailing delimiters.",""," @attribute allowTrailingDelimiter"," @type Boolean"," @default false"," **/"," allowTrailingDelimiter: {"," value: false"," },",""," /**"," Whether or not to enable in-memory caching in result sources that support"," it.",""," @attribute enableCache"," @type Boolean"," @default true"," @since 3.5.0"," **/"," enableCache: {"," lazyAdd: false, // we need the setter to run on init"," setter: '_setEnableCache',"," value: true"," },",""," /**"," Node to monitor for changes, which will generate `query` events when"," appropriate. May be either an `<input>` or a `<textarea>`.",""," @attribute inputNode"," @type Node|HTMLElement|String"," @initOnly"," **/"," inputNode: {"," setter: Y.one,"," writeOnce: 'initOnly'"," },",""," /**"," Maximum number of results to return. A value of `0` or less will allow an"," unlimited number of results.",""," @attribute maxResults"," @type Number"," @default 0"," **/"," maxResults: {"," value: 0"," },",""," /**"," Minimum number of characters that must be entered before a `query` event"," will be fired. A value of `0` allows empty queries; a negative value will"," effectively disable all `query` events.",""," @attribute minQueryLength"," @type Number"," @default 1"," **/"," minQueryLength: {"," value: 1"," },",""," /**"," Current query, or `null` if there is no current query.",""," The query might not be the same as the current value of the input node, both"," for timing reasons (due to `queryDelay`) and because when one or more"," `queryDelimiter` separators are in use, only the last portion of the"," delimited input string will be used as the query value.",""," @attribute query"," @type String|null"," @default null"," @readonly"," **/"," query: {"," readOnly: true,"," value: null"," },",""," /**"," Number of milliseconds to delay after input before triggering a `query`"," event. If new input occurs before this delay is over, the previous input"," event will be ignored and a new delay will begin.",""," This can be useful both to throttle queries to a remote data source and to"," avoid distracting the user by showing them less relevant results before"," they've paused their typing.",""," @attribute queryDelay"," @type Number"," @default 100"," **/"," queryDelay: {"," value: 100"," },",""," /**"," Query delimiter string. When a delimiter is configured, the input value"," will be split on the delimiter, and only the last portion will be used in"," autocomplete queries and updated when the `query` attribute is"," modified.",""," @attribute queryDelimiter"," @type String|null"," @default null"," **/"," queryDelimiter: {"," value: null"," },",""," /**"," Source request template. This can be a function that accepts a query as a"," parameter and returns a request string, or it can be a string containing the"," placeholder \"{query}\", which will be replaced with the actual URI-encoded"," query. In either case, the resulting string will be appended to the request"," URL when the `source` attribute is set to a remote DataSource, JSONP URL, or"," XHR URL (it will not be appended to YQL URLs).",""," While `requestTemplate` may be set to either a function or a string, it will"," always be returned as a function that accepts a query argument and returns a"," string.",""," @attribute requestTemplate"," @type Function|String|null"," @default null"," **/"," requestTemplate: {"," setter: '_setRequestTemplate',"," value: null"," },",""," /**"," Array of local result filter functions. If provided, each filter will be"," called with two arguments when results are received: the query and an array"," of result objects. See the documentation for the `results` event for a list"," of the properties available on each result object.",""," Each filter is expected to return a filtered or modified version of the"," results array, which will then be passed on to subsequent filters, then the"," `resultHighlighter` function (if set), then the `resultFormatter` function"," (if set), and finally to subscribers to the `results` event.",""," If no `source` is set, result filters will not be called.",""," Prepackaged result filters provided by the autocomplete-filters and"," autocomplete-filters-accentfold modules can be used by specifying the filter"," name as a string, such as `'phraseMatch'` (assuming the necessary filters"," module is loaded).",""," @attribute resultFilters"," @type Array"," @default []"," **/"," resultFilters: {"," setter: '_setResultFilters',"," value: []"," },",""," /**"," Function which will be used to format results. If provided, this function"," will be called with two arguments after results have been received and"," filtered: the query and an array of result objects. The formatter is"," expected to return an array of HTML strings or Node instances containing the"," desired HTML for each result.",""," See the documentation for the `results` event for a list of the properties"," available on each result object.",""," If no `source` is set, the formatter will not be called.",""," @attribute resultFormatter"," @type Function|null"," **/"," resultFormatter: {"," validator: _FUNCTION_VALIDATOR,"," value: null"," },",""," /**"," Function which will be used to highlight results. If provided, this function"," will be called with two arguments after results have been received and"," filtered: the query and an array of filtered result objects. The highlighter"," is expected to return an array of highlighted result text in the form of"," HTML strings.",""," See the documentation for the `results` event for a list of the properties"," available on each result object.",""," If no `source` is set, the highlighter will not be called.",""," @attribute resultHighlighter"," @type Function|null"," **/"," resultHighlighter: {"," setter: '_setResultHighlighter',"," value: null"," },",""," /**"," Locator that should be used to extract an array of results from a non-array"," response.",""," By default, no locator is applied, and all responses are assumed to be"," arrays by default. If all responses are already arrays, you don't need to"," define a locator.",""," The locator may be either a function (which will receive the raw response as"," an argument and must return an array) or a string representing an object"," path, such as \"foo.bar.baz\" (which would return the value of"," `result.foo.bar.baz` if the response is an object).",""," While `resultListLocator` may be set to either a function or a string, it"," will always be returned as a function that accepts a response argument and"," returns an array.",""," @attribute resultListLocator"," @type Function|String|null"," **/"," resultListLocator: {"," setter: '_setLocator',"," value: null"," },",""," /**"," Current results, or an empty array if there are no results.",""," @attribute results"," @type Array"," @default []"," @readonly"," **/"," results: {"," readOnly: true,"," value: []"," },",""," /**"," Locator that should be used to extract a plain text string from a non-string"," result item. The resulting text value will typically be the value that ends"," up being inserted into an input field or textarea when the user of an"," autocomplete implementation selects a result.",""," By default, no locator is applied, and all results are assumed to be plain"," text strings. If all results are already plain text strings, you don't need"," to define a locator.",""," The locator may be either a function (which will receive the raw result as"," an argument and must return a string) or a string representing an object"," path, such as \"foo.bar.baz\" (which would return the value of"," `result.foo.bar.baz` if the result is an object).",""," While `resultTextLocator` may be set to either a function or a string, it"," will always be returned as a function that accepts a result argument and"," returns a string.",""," @attribute resultTextLocator"," @type Function|String|null"," **/"," resultTextLocator: {"," setter: '_setLocator',"," value: null"," },",""," /**"," Source for autocomplete results. The following source types are supported:",""," <dl>"," <dt>Array</dt>"," <dd>"," <p>"," The full array will be provided to any configured filters for each"," query. This is an easy way to create a fully client-side autocomplete"," implementation."," </p>",""," <p>"," Example: `['first result', 'second result', 'etc']`"," </p>"," </dd>",""," <dt>DataSource</dt>"," <dd>"," A `DataSource` instance or other object that provides a DataSource-like"," `sendRequest` method. See the `DataSource` documentation for details."," </dd>",""," <dt>Function</dt>"," <dd>"," <p>"," A function source will be called with the current query and a"," callback function as parameters, and should either return an array of"," results (for synchronous operation) or return nothing and pass an"," array of results to the provided callback (for asynchronous"," operation)."," </p>",""," <p>"," Example (synchronous):"," </p>",""," <pre>"," function (query) {"," return ['foo', 'bar'];"," }"," </pre>",""," <p>"," Example (async):"," </p>",""," <pre>"," function (query, callback) {"," callback(['foo', 'bar']);"," }"," </pre>"," </dd>",""," <dt>Object</dt>"," <dd>"," <p>"," An object will be treated as a query hashmap. If a property on the"," object matches the current query, the value of that property will be"," used as the response."," </p>",""," <p>"," The response is assumed to be an array of results by default. If the"," response is not an array, provide a `resultListLocator` to"," process the response and return an array."," </p>",""," <p>"," Example: `{foo: ['foo result 1', 'foo result 2'], bar: ['bar result']}`"," </p>"," </dd>"," </dl>",""," If the optional `autocomplete-sources` module is loaded, then"," the following additional source types will be supported as well:",""," <dl>"," <dt><select> Node</dt>"," <dd>"," You may provide a YUI Node instance wrapping a <select>"," element, and the options in the list will be used as results. You"," will also need to specify a `resultTextLocator` of 'text'"," or 'value', depending on what you want to use as the text of the"," result.",""," Each result will be an object with the following properties:",""," <dl>"," <dt>html (String)</dt>"," <dd>"," <p>HTML content of the <option> element.</p>"," </dd>",""," <dt>index (Number)</dt>"," <dd>"," <p>Index of the <option> element in the list.</p>"," </dd>",""," <dt>node (Y.Node)</dt>"," <dd>"," <p>Node instance referring to the original <option> element.</p>"," </dd>",""," <dt>selected (Boolean)</dt>"," <dd>"," <p>Whether or not this item is currently selected in the"," <select> list.</p>"," </dd>",""," <dt>text (String)</dt>"," <dd>"," <p>Text content of the <option> element.</p>"," </dd>",""," <dt>value (String)</dt>"," <dd>"," <p>Value of the <option> element.</p>"," </dd>"," </dl>"," </dd>",""," <dt>String (JSONP URL)</dt>"," <dd>"," <p>"," If a URL with a `{callback}` placeholder is provided, it will be used to"," make a JSONP request. The `{query}` placeholder will be replaced with"," the current query, and the `{callback}` placeholder will be replaced"," with an internally-generated JSONP callback name. Both placeholders must"," appear in the URL, or the request will fail. An optional `{maxResults}`"," placeholder may also be provided, and will be replaced with the value of"," the maxResults attribute (or 1000 if the maxResults attribute is 0 or"," less)."," </p>",""," <p>"," The response is assumed to be an array of results by default. If the"," response is not an array, provide a `resultListLocator` to process the"," response and return an array."," </p>",""," <p>"," <strong>The `jsonp` module must be loaded in order for"," JSONP URL sources to work.</strong> If the `jsonp` module"," is not already loaded, it will be loaded on demand if possible."," </p>",""," <p>"," Example: `'http://example.com/search?q={query}&callback={callback}'`"," </p>"," </dd>",""," <dt>String (XHR URL)</dt>"," <dd>"," <p>"," If a URL without a `{callback}` placeholder is provided, it will be used"," to make a same-origin XHR request. The `{query}` placeholder will be"," replaced with the current query. An optional `{maxResults}` placeholder"," may also be provided, and will be replaced with the value of the"," maxResults attribute (or 1000 if the maxResults attribute is 0 or less)."," </p>",""," <p>"," The response is assumed to be a JSON array of results by default. If the"," response is a JSON object and not an array, provide a"," `resultListLocator` to process the response and return an array. If the"," response is in some form other than JSON, you will need to use a custom"," DataSource instance as the source."," </p>",""," <p>"," <strong>The `io-base` and `json-parse` modules"," must be loaded in order for XHR URL sources to work.</strong> If"," these modules are not already loaded, they will be loaded on demand"," if possible."," </p>",""," <p>"," Example: `'http://example.com/search?q={query}'`"," </p>"," </dd>",""," <dt>String (YQL query)</dt>"," <dd>"," <p>"," If a YQL query is provided, it will be used to make a YQL request. The"," `{query}` placeholder will be replaced with the current autocomplete"," query. This placeholder must appear in the YQL query, or the request"," will fail. An optional `{maxResults}` placeholder may also be provided,"," and will be replaced with the value of the maxResults attribute (or 1000"," if the maxResults attribute is 0 or less)."," </p>",""," <p>"," <strong>The `yql` module must be loaded in order for YQL"," sources to work.</strong> If the `yql` module is not"," already loaded, it will be loaded on demand if possible."," </p>",""," <p>"," Example: `'select * from search.suggest where query=\"{query}\"'`"," </p>"," </dd>"," </dl>",""," As an alternative to providing a source, you could simply listen for `query`"," events and handle them any way you see fit. Providing a source is optional,"," but will usually be simpler.",""," @attribute source"," @type Array|DataSource|Function|Node|Object|String|null"," **/"," source: {"," setter: '_setSource',"," value: null"," },",""," /**"," May be used to force a specific source type, overriding the automatic source"," type detection. It should almost never be necessary to do this, but as they"," taught us in the Boy Scouts, one should always be prepared, so it's here if"," you need it. Be warned that if you set this attribute and something breaks,"," it's your own fault.",""," Supported `sourceType` values are: 'array', 'datasource', 'function', and"," 'object'.",""," If the `autocomplete-sources` module is loaded, the following additional"," source types are supported: 'io', 'jsonp', 'select', 'string', 'yql'",""," @attribute sourceType"," @type String"," **/"," sourceType: {"," value: null"," },",""," /**"," If the `inputNode` specified at instantiation time has a `node-tokeninput`"," plugin attached to it, this attribute will be a reference to the"," `Y.Plugin.TokenInput` instance.",""," @attribute tokenInput"," @type Plugin.TokenInput"," @readonly"," **/"," tokenInput: {"," readOnly: true"," },",""," /**"," Current value of the input node.",""," @attribute value"," @type String"," @default ''"," **/"," value: {"," // Why duplicate this._inputNode.get('value')? Because we need a"," // reliable way to track the source of value changes. We want to perform"," // completion when the user changes the value, but not when we change"," // the value."," value: ''"," }","};","","// This tells Y.Base.create() to copy these static properties to any class","// AutoCompleteBase is mixed into.","AutoCompleteBase._buildCfg = {"," aggregates: ['SOURCE_TYPES'],"," statics : ['UI_SRC']","};","","/**","Mapping of built-in source types to their setter functions. DataSource instances","and DataSource-like objects are handled natively, so are not mapped here.","","@property SOURCE_TYPES","@type {Object}","@static","**/","AutoCompleteBase.SOURCE_TYPES = {"," array : '_createArraySource',"," 'function': '_createFunctionSource',"," object : '_createObjectSource'","};","","AutoCompleteBase.UI_SRC = (Y.Widget && Y.Widget.UI_SRC) || 'ui';","","Y.AutoCompleteBase = AutoCompleteBase;","","","}, '3.7.3', {\"optional\": [\"autocomplete-sources\"], \"requires\": [\"array-extras\", \"base-build\", \"escape\", \"event-valuechange\", \"node-base\"]});"]; _yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].lines = {"1":0,"66":0,"94":0,"96":0,"100":0,"101":0,"114":0,"131":0,"163":0,"169":0,"171":0,"172":0,"173":0,"174":0,"187":0,"188":0,"210":0,"213":0,"214":0,"216":0,"219":0,"220":0,"221":0,"224":0,"228":0,"238":0,"250":0,"255":0,"256":0,"257":0,"260":0,"261":0,"262":0,"265":0,"267":0,"286":0,"287":0,"302":0,"304":0,"307":0,"324":0,"326":0,"329":0,"331":0,"332":0,"337":0,"338":0,"355":0,"357":0,"360":0,"362":0,"378":0,"395":0,"396":0,"399":0,"400":0,"403":0,"417":0,"439":0,"440":0,"443":0,"444":0,"445":0,"451":0,"452":0,"454":0,"458":0,"468":0,"469":0,"471":0,"472":0,"475":0,"476":0,"480":0,"481":0,"482":0,"483":0,"487":0,"489":0,"496":0,"497":0,"500":0,"501":0,"504":0,"505":0,"506":0,"507":0,"516":0,"517":0,"519":0,"520":0,"523":0,"524":0,"530":0,"531":0,"547":0,"549":0,"550":0,"551":0,"554":0,"570":0,"582":0,"583":0,"586":0,"588":0,"590":0,"591":0,"604":0,"605":0,"608":0,"610":0,"611":0,"627":0,"629":0,"630":0,"633":0,"635":0,"636":0,"637":0,"640":0,"642":0,"645":0,"648":0,"649":0,"650":0,"653":0,"654":0,"669":0,"671":0,"672":0,"675":0,"677":0,"679":0,"682":0,"697":0,"700":0,"705":0,"706":0,"710":0,"711":0,"712":0,"716":0,"717":0,"729":0,"742":0,"744":0,"745":0,"761":0,"766":0,"768":0,"769":0,"770":0,"771":0,"773":0,"774":0,"775":0,"778":0,"781":0,"795":0,"796":0,"808":0,"814":0,"815":0,"819":0,"820":0,"822":0,"824":0,"825":0,"827":0,"828":0,"835":0,"836":0,"837":0,"839":0,"844":0,"847":0,"849":0,"864":0,"871":0,"872":0,"873":0,"875":0,"876":0,"880":0,"885":0,"888":0,"889":0,"903":0,"907":0,"908":0,"921":0,"922":0,"936":0,"937":0,"949":0,"961":0,"965":0,"1514":0,"1527":0,"1533":0,"1535":0}; _yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].functions = {"AutoCompleteBase:94":0,"initializer:98":0,"destructor:168":0,"clearCache:186":0,"sendRequest:209":0,"_bindUIACBase:249":0,"_syncUIACBase:285":0,"sendRequest:306":0,"_createArraySource:301":0,"afterResults:331":0,"sendRequest:328":0,"_createFunctionSource:323":0,"sendRequest:359":0,"_createObjectSource:354":0,"_functionValidator:377":0,"_getObjectValue:394":0,"_parseResponse:416":0,"_parseValue:546":0,"_setEnableCache:565":0,"(anonymous 2):590":0,"_setLocator:581":0,"(anonymous 3):610":0,"_setRequestTemplate:603":0,"getFilterFunction:635":0,"(anonymous 4):650":0,"_setResultFilters:626":0,"_setResultHighlighter:668":0,"_setSource:696":0,"_sourceSuccess:728":0,"_syncBrowserAutocomplete:741":0,"_updateValue:760":0,"_afterSourceTypeChange:794":0,"fire:827":0,"_afterValueChange:807":0,"_onInputBlur:863":0,"_onInputValueChange:902":0,"_onResponse:919":0,"_defClearFn:935":0,"_defQueryFn:948":0,"_defResultsFn:960":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-base/autocomplete-base.js"].coveredLines = 201;@@ -1815,4 +1815,4 @@ Y.AutoCompleteBase = AutoCompleteBase; -}, '3.7.2', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});+}, '3.7.3', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});
bundle/autocomplete-base/autocomplete-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1549,4 +1549,4 @@ Y.AutoCompleteBase = AutoCompleteBase; -}, '3.7.2', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});+}, '3.7.3', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});
bundle/autocomplete-base/autocomplete-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-base",function(e,t){function T(){}var n=e.Escape,r=e.Lang,i=e.Array,s=e.Object,o=r.isFunction,u=r.isString,a=r.trim,f=e.Attribute.INVALID_VALUE,l="_functionValidator",c="_sourceSuccess",h="allowBrowserAutocomplete",p="inputNode",d="query",v="queryDelimiter",m="requestTemplate",g="results",y="resultListLocator",b="value",w="valueChange",E="clear",S=d,x=g;T.prototype={initializer:function(){e.before(this._bindUIACBase,this,"bindUI"),e.before(this._syncUIACBase,this,"syncUI"),this.publish(E,{defaultFn:this._defClearFn}),this.publish(S,{defaultFn:this._defQueryFn}),this.publish(x,{defaultFn:this._defResultsFn})},destructor:function(){this._acBaseEvents&&this._acBaseEvents.detach(),delete this._acBaseEvents,delete this._cache,delete this._inputNode,delete this._rawSource},clearCache:function(){return this._cache&&(this._cache={}),this},sendRequest:function(t,n){var r,i=this.get("source");return t||t===""?this._set(d,t):t=this.get(d)||"",i&&(n||(n=this.get(m)),r=n?n.call(this,t):t,i.sendRequest({query:t,request:r,callback:{success:e.bind(this._onResponse,this,t)}})),this},_bindUIACBase:function(){var t=this.get(p),n=t&&t.tokenInput;n&&(t=n.get(p),this._set("tokenInput",n));if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._acBaseEvents=new e.EventHandle([t.on(w,this._onInputValueChange,this),t.on("blur",this._onInputBlur,this),this.after(h+"Change",this._syncBrowserAutocomplete),this.after("sourceTypeChange",this._afterSourceTypeChange),this.after(w,this._afterValueChange)])},_syncUIACBase:function(){this._syncBrowserAutocomplete(),this.set(b,this.get(p).get(b))},_createArraySource:function(e){var t=this;return{type:"array",sendRequest:function(n){t[c](e.concat(),n)}}},_createFunctionSource:function(e){var t=this;return{type:"function",sendRequest:function(n){function i(e){t[c](e||[],n)}var r;(r=e(n.query,i))&&i(r)}}},_createObjectSource:function(e){var t=this;return{type:"object",sendRequest:function(n){var r=n.query;t[c](s.owns(e,r)?e[r]:[],n)}}},_functionValidator:function(e){return e===null||o(e)},_getObjectValue:function(e,t){if(!e)return;for(var n=0,r=t.length;e&&n<r;n++)e=e[t[n]];return e},_parseResponse:function(e,t,r){var i={data:r,query:e,results:[]},s=this.get(y),o=[],u=t&&t.results,a,f,l,c,h,p,d,v,m,g,b;u&&s&&(u=s.call(this,u));if(u&&u.length){a=this.get("resultFilters"),b=this.get("resultTextLocator");for(p=0,d=u.length;p<d;++p)m=u[p],g=b?b.call(this,m):m.toString(),o.push({display:n.html(g),raw:m,text:g});for(p=0,d=a.length;p<d;++p){o=a[p].call(this,e,o.concat());if(!o)return;if(!o.length)break}if(o.length){l=this.get("resultFormatter"),h=this.get("resultHighlighter"),v=this.get("maxResults"),v&&v>0&&o.length>v&&(o.length=v);if(h){c=h.call(this,e,o.concat());if(!c)return;for(p=0,d=c.length;p<d;++p)m=o[p],m.highlighted=c[p],m.display=m.highlighted}if(l){f=l.call(this,e,o.concat());if(!f)return;for(p=0,d=f.length;p<d;++p)o[p].display=f[p]}}}i.results=o,this.fire(x,i)},_parseValue:function(e){var t=this.get(v);return t&&(e=e.split(t),e=e[e.length-1]),r.trimLeft(e)},_setEnableCache:function(e){this._cache=e?{}:null},_setLocator:function(e){if(this[l](e))return e;var t=this;return e=e.toString().split("."),function(n){return n&&t._getObjectValue(n,e)}},_setRequestTemplate:function(e){return this[l](e)?e:(e=e.toString(),function(t){return r.sub(e,{query:encodeURIComponent(t)})})},_setResultFilters:function(t){var n,s;return t===null?[]:(n=e.AutoCompleteFilters,s=function(e){return o(e)?e:u(e)&&n&&o(n[e])?n[e]:!1},r.isArray(t)?(t=i.map(t,s),i.every(t,function(e){return!!e})?t:f):(t=s(t),t?[t]:f))},_setResultHighlighter:function(t){var n;return this[l](t)?t:(n=e.AutoCompleteHighlighters,u(t)&&n&&o(n[t])?n[t]:f)},_setSource:function(t){var n=this.get("sourceType")||r.type(t),i;return t&&o(t.sendRequest)||t===null||n==="datasource"?(this._rawSource=t,t):(i=T.SOURCE_TYPES[n])?(this._rawSource=t,r.isString(i)?this[i](t):i(t)):(e.error("Unsupported source type '"+n+"'. Maybe autocomplete-sources isn't loaded?"),f)},_sourceSuccess:function(e,t){t.callback.success({data:e,response:{results:e}})},_syncBrowserAutocomplete:function(){var e=this.get(p);e.get("nodeName").toLowerCase()==="input"&&e.setAttribute("autocomplete",this.get(h)?"on":"off")},_updateValue:function(e){var t=this.get(v),n,s,o;e=r.trimLeft(e),t&&(n=a(t),o=i.map(a(this.get(b)).split(t),a),s=o.length,s>1&&(o[s-1]=e,e=o.join(n+" ")),e=e+n+" "),this.set(b,e)},_afterSourceTypeChange:function(e){this._rawSource&&this.set("source",this._rawSource)},_afterValueChange:function(e){var t=e.newVal,n=this,r=e.src===T.UI_SRC,i,s,o,u;r||n._inputNode.set(b,t),o=n.get("minQueryLength"),u=n._parseValue(t)||"",o>=0&&u.length>=o?r?(i=n.get("queryDelay"),s=function(){n.fire(S,{inputValue:t,query:u,src:e.src})},i?(clearTimeout(n._delay),n._delay=setTimeout(s,i)):s()):n._set(d,u):(clearTimeout(n._delay),n.fire(E,{prevVal:e.prevVal?n._parseValue(e.prevVal):null,src:e.src}))},_onInputBlur:function(e){var t=this.get(v),n,i,s;if(t&&!this.get("allowTrailingDelimiter")){t=r.trimRight(t),s=i=this._inputNode.get(b);if(t)while((i=r.trimRight(i))&&(n=i.length-t.length)&&i.lastIndexOf(t)===n)i=i.substring(0,n);else i=r.trimRight(i);i!==s&&this.set(b,i)}},_onInputValueChange:function(e){var t=e.newVal;t!==this.get(b)&&this.set(b,t,{src:T.UI_SRC})},_onResponse:function(e,t){e===(this.get(d)||"")&&this._parseResponse(e||"",t.response,t.data)},_defClearFn:function(){this._set(d,null),this._set(g,[])},_defQueryFn:function(e){this.sendRequest(e.query)},_defResultsFn:function(e){this._set(g,e[g])}},T.ATTRS={allowBrowserAutocomplete:{value:!1},allowTrailingDelimiter:{value:!1},enableCache:{lazyAdd:!1,setter:"_setEnableCache",value:!0},inputNode:{setter:e.one,writeOnce:"initOnly"},maxResults:{value:0},minQueryLength:{value:1},query:{readOnly:!0,value:null},queryDelay:{value:100},queryDelimiter:{value:null},requestTemplate:{setter:"_setRequestTemplate",value:null},resultFilters:{setter:"_setResultFilters",value:[]},resultFormatter:{validator:l,value:null},resultHighlighter:{setter:"_setResultHighlighter",value:null},resultListLocator:{setter:"_setLocator",value:null},results:{readOnly:!0,value:[]},resultTextLocator:{setter:"_setLocator",value:null},source:{setter:"_setSource",value:null},sourceType:{value:null},tokenInput:{readOnly:!0},value:{value:""}},T._buildCfg={aggregates:["SOURCE_TYPES"],statics:["UI_SRC"]},T.SOURCE_TYPES={array:"_createArraySource","function":"_createFunctionSource",object:"_createObjectSource"},T.UI_SRC=e.Widget&&e.Widget.UI_SRC||"ui",e.AutoCompleteBase=T},"3.7.2",{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]});+YUI.add("autocomplete-base",function(e,t){function T(){}var n=e.Escape,r=e.Lang,i=e.Array,s=e.Object,o=r.isFunction,u=r.isString,a=r.trim,f=e.Attribute.INVALID_VALUE,l="_functionValidator",c="_sourceSuccess",h="allowBrowserAutocomplete",p="inputNode",d="query",v="queryDelimiter",m="requestTemplate",g="results",y="resultListLocator",b="value",w="valueChange",E="clear",S=d,x=g;T.prototype={initializer:function(){e.before(this._bindUIACBase,this,"bindUI"),e.before(this._syncUIACBase,this,"syncUI"),this.publish(E,{defaultFn:this._defClearFn}),this.publish(S,{defaultFn:this._defQueryFn}),this.publish(x,{defaultFn:this._defResultsFn})},destructor:function(){this._acBaseEvents&&this._acBaseEvents.detach(),delete this._acBaseEvents,delete this._cache,delete this._inputNode,delete this._rawSource},clearCache:function(){return this._cache&&(this._cache={}),this},sendRequest:function(t,n){var r,i=this.get("source");return t||t===""?this._set(d,t):t=this.get(d)||"",i&&(n||(n=this.get(m)),r=n?n.call(this,t):t,i.sendRequest({query:t,request:r,callback:{success:e.bind(this._onResponse,this,t)}})),this},_bindUIACBase:function(){var t=this.get(p),n=t&&t.tokenInput;n&&(t=n.get(p),this._set("tokenInput",n));if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._acBaseEvents=new e.EventHandle([t.on(w,this._onInputValueChange,this),t.on("blur",this._onInputBlur,this),this.after(h+"Change",this._syncBrowserAutocomplete),this.after("sourceTypeChange",this._afterSourceTypeChange),this.after(w,this._afterValueChange)])},_syncUIACBase:function(){this._syncBrowserAutocomplete(),this.set(b,this.get(p).get(b))},_createArraySource:function(e){var t=this;return{type:"array",sendRequest:function(n){t[c](e.concat(),n)}}},_createFunctionSource:function(e){var t=this;return{type:"function",sendRequest:function(n){function i(e){t[c](e||[],n)}var r;(r=e(n.query,i))&&i(r)}}},_createObjectSource:function(e){var t=this;return{type:"object",sendRequest:function(n){var r=n.query;t[c](s.owns(e,r)?e[r]:[],n)}}},_functionValidator:function(e){return e===null||o(e)},_getObjectValue:function(e,t){if(!e)return;for(var n=0,r=t.length;e&&n<r;n++)e=e[t[n]];return e},_parseResponse:function(e,t,r){var i={data:r,query:e,results:[]},s=this.get(y),o=[],u=t&&t.results,a,f,l,c,h,p,d,v,m,g,b;u&&s&&(u=s.call(this,u));if(u&&u.length){a=this.get("resultFilters"),b=this.get("resultTextLocator");for(p=0,d=u.length;p<d;++p)m=u[p],g=b?b.call(this,m):m.toString(),o.push({display:n.html(g),raw:m,text:g});for(p=0,d=a.length;p<d;++p){o=a[p].call(this,e,o.concat());if(!o)return;if(!o.length)break}if(o.length){l=this.get("resultFormatter"),h=this.get("resultHighlighter"),v=this.get("maxResults"),v&&v>0&&o.length>v&&(o.length=v);if(h){c=h.call(this,e,o.concat());if(!c)return;for(p=0,d=c.length;p<d;++p)m=o[p],m.highlighted=c[p],m.display=m.highlighted}if(l){f=l.call(this,e,o.concat());if(!f)return;for(p=0,d=f.length;p<d;++p)o[p].display=f[p]}}}i.results=o,this.fire(x,i)},_parseValue:function(e){var t=this.get(v);return t&&(e=e.split(t),e=e[e.length-1]),r.trimLeft(e)},_setEnableCache:function(e){this._cache=e?{}:null},_setLocator:function(e){if(this[l](e))return e;var t=this;return e=e.toString().split("."),function(n){return n&&t._getObjectValue(n,e)}},_setRequestTemplate:function(e){return this[l](e)?e:(e=e.toString(),function(t){return r.sub(e,{query:encodeURIComponent(t)})})},_setResultFilters:function(t){var n,s;return t===null?[]:(n=e.AutoCompleteFilters,s=function(e){return o(e)?e:u(e)&&n&&o(n[e])?n[e]:!1},r.isArray(t)?(t=i.map(t,s),i.every(t,function(e){return!!e})?t:f):(t=s(t),t?[t]:f))},_setResultHighlighter:function(t){var n;return this[l](t)?t:(n=e.AutoCompleteHighlighters,u(t)&&n&&o(n[t])?n[t]:f)},_setSource:function(t){var n=this.get("sourceType")||r.type(t),i;return t&&o(t.sendRequest)||t===null||n==="datasource"?(this._rawSource=t,t):(i=T.SOURCE_TYPES[n])?(this._rawSource=t,r.isString(i)?this[i](t):i(t)):(e.error("Unsupported source type '"+n+"'. Maybe autocomplete-sources isn't loaded?"),f)},_sourceSuccess:function(e,t){t.callback.success({data:e,response:{results:e}})},_syncBrowserAutocomplete:function(){var e=this.get(p);e.get("nodeName").toLowerCase()==="input"&&e.setAttribute("autocomplete",this.get(h)?"on":"off")},_updateValue:function(e){var t=this.get(v),n,s,o;e=r.trimLeft(e),t&&(n=a(t),o=i.map(a(this.get(b)).split(t),a),s=o.length,s>1&&(o[s-1]=e,e=o.join(n+" ")),e=e+n+" "),this.set(b,e)},_afterSourceTypeChange:function(e){this._rawSource&&this.set("source",this._rawSource)},_afterValueChange:function(e){var t=e.newVal,n=this,r=e.src===T.UI_SRC,i,s,o,u;r||n._inputNode.set(b,t),o=n.get("minQueryLength"),u=n._parseValue(t)||"",o>=0&&u.length>=o?r?(i=n.get("queryDelay"),s=function(){n.fire(S,{inputValue:t,query:u,src:e.src})},i?(clearTimeout(n._delay),n._delay=setTimeout(s,i)):s()):n._set(d,u):(clearTimeout(n._delay),n.fire(E,{prevVal:e.prevVal?n._parseValue(e.prevVal):null,src:e.src}))},_onInputBlur:function(e){var t=this.get(v),n,i,s;if(t&&!this.get("allowTrailingDelimiter")){t=r.trimRight(t),s=i=this._inputNode.get(b);if(t)while((i=r.trimRight(i))&&(n=i.length-t.length)&&i.lastIndexOf(t)===n)i=i.substring(0,n);else i=r.trimRight(i);i!==s&&this.set(b,i)}},_onInputValueChange:function(e){var t=e.newVal;t!==this.get(b)&&this.set(b,t,{src:T.UI_SRC})},_onResponse:function(e,t){e===(this.get(d)||"")&&this._parseResponse(e||"",t.response,t.data)},_defClearFn:function(){this._set(d,null),this._set(g,[])},_defQueryFn:function(e){this.sendRequest(e.query)},_defResultsFn:function(e){this._set(g,e[g])}},T.ATTRS={allowBrowserAutocomplete:{value:!1},allowTrailingDelimiter:{value:!1},enableCache:{lazyAdd:!1,setter:"_setEnableCache",value:!0},inputNode:{setter:e.one,writeOnce:"initOnly"},maxResults:{value:0},minQueryLength:{value:1},query:{readOnly:!0,value:null},queryDelay:{value:100},queryDelimiter:{value:null},requestTemplate:{setter:"_setRequestTemplate",value:null},resultFilters:{setter:"_setResultFilters",value:[]},resultFormatter:{validator:l,value:null},resultHighlighter:{setter:"_setResultHighlighter",value:null},resultListLocator:{setter:"_setLocator",value:null},results:{readOnly:!0,value:[]},resultTextLocator:{setter:"_setLocator",value:null},source:{setter:"_setSource",value:null},sourceType:{value:null},tokenInput:{readOnly:!0},value:{value:""}},T._buildCfg={aggregates:["SOURCE_TYPES"],statics:["UI_SRC"]},T.SOURCE_TYPES={array:"_createArraySource","function":"_createFunctionSource",object:"_createObjectSource"},T.UI_SRC=e.Widget&&e.Widget.UI_SRC||"ui",e.AutoCompleteBase=T},"3.7.3",{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]});
bundle/autocomplete-base/autocomplete-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1541,4 +1541,4 @@ Y.AutoCompleteBase = AutoCompleteBase; -}, '3.7.2', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});+}, '3.7.3', {"optional": ["autocomplete-sources"], "requires": ["array-extras", "base-build", "escape", "event-valuechange", "node-base"]});
bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js", code: [] };-_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].code=["YUI.add('autocomplete-filters-accentfold', function (Y, NAME) {","","/**","Provides pre-built accent-folding result matching filters for AutoComplete.","","These filters are similar to the ones provided by the `autocomplete-filters`","module, but use accent-aware comparisons. For example, \"resume\" and \"résumé\"","will be considered equal when using the accent-folding filters.","","@module autocomplete","@submodule autocomplete-filters-accentfold","**/","","/**","@class AutoCompleteFilters","@static","**/","","var AccentFold = Y.Text.AccentFold,"," WordBreak = Y.Text.WordBreak,"," YArray = Y.Array,"," YObject = Y.Object;","","Y.mix(Y.namespace('AutoCompleteFilters'), {"," /**"," Accent folding version of `charMatch()`.",""," @method charMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryChars = YArray.unique(AccentFold.fold(query).split(''));",""," return YArray.filter(results, function (result) {"," var text = AccentFold.fold(result.text);",""," return YArray.every(queryChars, function (chr) {"," return text.indexOf(chr) !== -1;"," });"," });"," },",""," /**"," Accent folding version of `phraseMatch()`.",""," @method phraseMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatchFold: function (query, results) {"," if (!query) { return results; }",""," query = AccentFold.fold(query);",""," return YArray.filter(results, function (result) {"," return AccentFold.fold(result.text).indexOf(query) !== -1;"," });"," },",""," /**"," Accent folding version of `startsWith()`.",""," @method startsWithFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWithFold: function (query, results) {"," if (!query) { return results; }",""," query = AccentFold.fold(query);",""," return YArray.filter(results, function (result) {"," return AccentFold.fold(result.text).indexOf(query) === 0;"," });"," },",""," /**"," Accent folding version of `subWordMatch()`.",""," @method subWordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));",""," return YArray.filter(results, function (result) {"," var resultText = AccentFold.fold(result.text);",""," return YArray.every(queryWords, function (queryWord) {"," return resultText.indexOf(queryWord) !== -1;"," });"," });"," },",""," /**"," Accent folding version of `wordMatch()`.",""," @method wordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));",""," return YArray.filter(results, function (result) {"," // Convert resultWords array to a hash for fast lookup."," var resultWords = YArray.hash(WordBreak.getUniqueWords("," AccentFold.fold(result.text)));",""," return YArray.every(queryWords, function (word) {"," return YObject.owns(resultWords, word);"," });"," });"," }","});","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"text-accentfold\", \"text-wordbreak\"]});"];+_yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].code=["YUI.add('autocomplete-filters-accentfold', function (Y, NAME) {","","/**","Provides pre-built accent-folding result matching filters for AutoComplete.","","These filters are similar to the ones provided by the `autocomplete-filters`","module, but use accent-aware comparisons. For example, \"resume\" and \"résumé\"","will be considered equal when using the accent-folding filters.","","@module autocomplete","@submodule autocomplete-filters-accentfold","**/","","/**","@class AutoCompleteFilters","@static","**/","","var AccentFold = Y.Text.AccentFold,"," WordBreak = Y.Text.WordBreak,"," YArray = Y.Array,"," YObject = Y.Object;","","Y.mix(Y.namespace('AutoCompleteFilters'), {"," /**"," Accent folding version of `charMatch()`.",""," @method charMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryChars = YArray.unique(AccentFold.fold(query).split(''));",""," return YArray.filter(results, function (result) {"," var text = AccentFold.fold(result.text);",""," return YArray.every(queryChars, function (chr) {"," return text.indexOf(chr) !== -1;"," });"," });"," },",""," /**"," Accent folding version of `phraseMatch()`.",""," @method phraseMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatchFold: function (query, results) {"," if (!query) { return results; }",""," query = AccentFold.fold(query);",""," return YArray.filter(results, function (result) {"," return AccentFold.fold(result.text).indexOf(query) !== -1;"," });"," },",""," /**"," Accent folding version of `startsWith()`.",""," @method startsWithFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWithFold: function (query, results) {"," if (!query) { return results; }",""," query = AccentFold.fold(query);",""," return YArray.filter(results, function (result) {"," return AccentFold.fold(result.text).indexOf(query) === 0;"," });"," },",""," /**"," Accent folding version of `subWordMatch()`.",""," @method subWordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));",""," return YArray.filter(results, function (result) {"," var resultText = AccentFold.fold(result.text);",""," return YArray.every(queryWords, function (queryWord) {"," return resultText.indexOf(queryWord) !== -1;"," });"," });"," },",""," /**"," Accent folding version of `wordMatch()`.",""," @method wordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatchFold: function (query, results) {"," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(AccentFold.fold(query));",""," return YArray.filter(results, function (result) {"," // Convert resultWords array to a hash for fast lookup."," var resultWords = YArray.hash(WordBreak.getUniqueWords("," AccentFold.fold(result.text)));",""," return YArray.every(queryWords, function (word) {"," return YObject.owns(resultWords, word);"," });"," });"," }","});","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"text-accentfold\", \"text-wordbreak\"]});"]; _yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].lines = {"1":0,"19":0,"24":0,"35":0,"37":0,"39":0,"40":0,"42":0,"43":0,"58":0,"60":0,"62":0,"63":0,"77":0,"79":0,"81":0,"82":0,"96":0,"98":0,"100":0,"101":0,"103":0,"104":0,"119":0,"121":0,"123":0,"125":0,"128":0,"129":0}; _yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].functions = {"(anonymous 3):42":0,"(anonymous 2):39":0,"charMatchFold:34":0,"(anonymous 4):62":0,"phraseMatchFold:57":0,"(anonymous 5):81":0,"startsWithFold:76":0,"(anonymous 7):103":0,"(anonymous 6):100":0,"subWordMatchFold:95":0,"(anonymous 9):128":0,"(anonymous 8):123":0,"wordMatchFold:118":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js"].coveredLines = 29;@@ -215,4 +215,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});
bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -139,4 +139,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});
bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-filters-accentfold",function(e,t){var n=e.Text.AccentFold,r=e.Text.WordBreak,i=e.Array,s=e.Object;e.mix(e.namespace("AutoCompleteFilters"),{charMatchFold:function(e,t){if(!e)return t;var r=i.unique(n.fold(e).split(""));return i.filter(t,function(e){var t=n.fold(e.text);return i.every(r,function(e){return t.indexOf(e)!==-1})})},phraseMatchFold:function(e,t){return e?(e=n.fold(e),i.filter(t,function(t){return n.fold(t.text).indexOf(e)!==-1})):t},startsWithFold:function(e,t){return e?(e=n.fold(e),i.filter(t,function(t){return n.fold(t.text).indexOf(e)===0})):t},subWordMatchFold:function(e,t){if(!e)return t;var s=r.getUniqueWords(n.fold(e));return i.filter(t,function(e){var t=n.fold(e.text);return i.every(s,function(e){return t.indexOf(e)!==-1})})},wordMatchFold:function(e,t){if(!e)return t;var o=r.getUniqueWords(n.fold(e));return i.filter(t,function(e){var t=i.hash(r.getUniqueWords(n.fold(e.text)));return i.every(o,function(e){return s.owns(t,e)})})}})},"3.7.2",{requires:["array-extras","text-accentfold","text-wordbreak"]});+YUI.add("autocomplete-filters-accentfold",function(e,t){var n=e.Text.AccentFold,r=e.Text.WordBreak,i=e.Array,s=e.Object;e.mix(e.namespace("AutoCompleteFilters"),{charMatchFold:function(e,t){if(!e)return t;var r=i.unique(n.fold(e).split(""));return i.filter(t,function(e){var t=n.fold(e.text);return i.every(r,function(e){return t.indexOf(e)!==-1})})},phraseMatchFold:function(e,t){return e?(e=n.fold(e),i.filter(t,function(t){return n.fold(t.text).indexOf(e)!==-1})):t},startsWithFold:function(e,t){return e?(e=n.fold(e),i.filter(t,function(t){return n.fold(t.text).indexOf(e)===0})):t},subWordMatchFold:function(e,t){if(!e)return t;var s=r.getUniqueWords(n.fold(e));return i.filter(t,function(e){var t=n.fold(e.text);return i.every(s,function(e){return t.indexOf(e)!==-1})})},wordMatchFold:function(e,t){if(!e)return t;var o=r.getUniqueWords(n.fold(e));return i.filter(t,function(e){var t=i.hash(r.getUniqueWords(n.fold(e.text)));return i.every(o,function(e){return s.owns(t,e)})})}})},"3.7.3",{requires:["array-extras","text-accentfold","text-wordbreak"]});
bundle/autocomplete-filters-accentfold/autocomplete-filters-accentfold.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -139,4 +139,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-accentfold", "text-wordbreak"]});
bundle/autocomplete-filters/autocomplete-filters-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-filters/autocomplete-filters.js", code: [] };-_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].code=["YUI.add('autocomplete-filters', function (Y, NAME) {","","/**","Provides pre-built result matching filters for AutoComplete.","","@module autocomplete","@submodule autocomplete-filters","@class AutoCompleteFilters","@static","**/","","var YArray = Y.Array,"," YObject = Y.Object,"," WordBreak = Y.Text.WordBreak,","","Filters = Y.mix(Y.namespace('AutoCompleteFilters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Returns an array of results that contain all of the characters in the query,"," in any order (not necessarily consecutive). Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.filter(results, function (result) {"," result = result.text;",""," if (!caseSensitive) {"," result = result.toLowerCase();"," }",""," return YArray.every(queryChars, function (chr) {"," return result.indexOf(chr) !== -1;"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatchCase: function (query, results) {"," return Filters.charMatch(query, results, true);"," },",""," /**"," Returns an array of results that contain the complete query as a phrase."," Case-insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," if (!caseSensitive) {"," query = query.toLowerCase();"," }",""," return YArray.filter(results, function (result) {"," return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) !== -1;"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Filters.phraseMatch(query, results, true);"," },",""," /**"," Returns an array of results that start with the complete query as a phrase."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," if (!caseSensitive) {"," query = query.toLowerCase();"," }",""," return YArray.filter(results, function (result) {"," return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) === 0;"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWithCase: function (query, results) {"," return Filters.startsWith(query, results, true);"," },",""," /**"," Returns an array of results in which all the words of the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," This is basically a combination of `wordMatch()` (by ignoring whitespace and"," word order) and `phraseMatch()` (by allowing partial matching instead of"," requiring the entire word to match).",""," Example use case: Trying to find personal names independently of name order"," (Western or Eastern order) and supporting immediate feedback by allowing"," partial occurences. So queries like \"J. Doe\", \"Doe, John\", and \"J. D.\" would"," all match \"John Doe\".",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.filter(results, function (result) {"," var resultText = caseSensitive ? result.text :"," result.text.toLowerCase();",""," return YArray.every(queryWords, function (queryWord) {"," return resultText.indexOf(queryWord) !== -1;"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Filters.subWordMatch(query, results, true);"," },",""," /**"," Returns an array of results that contain all of the words in the query, in"," any order. Non-word characters like whitespace and certain punctuation are"," ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var options = {ignoreCase: !caseSensitive},"," queryWords = WordBreak.getUniqueWords(query, options);",""," return YArray.filter(results, function (result) {"," // Convert resultWords array to a hash for fast lookup."," var resultWords = YArray.hash(WordBreak.getUniqueWords(result.text,"," options));",""," return YArray.every(queryWords, function (word) {"," return YObject.owns(resultWords, word);"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Filters.wordMatch(query, results, true);"," }","});","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"text-wordbreak\"]});"];+_yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].code=["YUI.add('autocomplete-filters', function (Y, NAME) {","","/**","Provides pre-built result matching filters for AutoComplete.","","@module autocomplete","@submodule autocomplete-filters","@class AutoCompleteFilters","@static","**/","","var YArray = Y.Array,"," YObject = Y.Object,"," WordBreak = Y.Text.WordBreak,","","Filters = Y.mix(Y.namespace('AutoCompleteFilters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Returns an array of results that contain all of the characters in the query,"," in any order (not necessarily consecutive). Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.filter(results, function (result) {"," result = result.text;",""," if (!caseSensitive) {"," result = result.toLowerCase();"," }",""," return YArray.every(queryChars, function (chr) {"," return result.indexOf(chr) !== -1;"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," charMatchCase: function (query, results) {"," return Filters.charMatch(query, results, true);"," },",""," /**"," Returns an array of results that contain the complete query as a phrase."," Case-insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," if (!caseSensitive) {"," query = query.toLowerCase();"," }",""," return YArray.filter(results, function (result) {"," return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) !== -1;"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Filters.phraseMatch(query, results, true);"," },",""," /**"," Returns an array of results that start with the complete query as a phrase."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," if (!caseSensitive) {"," query = query.toLowerCase();"," }",""," return YArray.filter(results, function (result) {"," return (caseSensitive ? result.text : result.text.toLowerCase()).indexOf(query) === 0;"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," startsWithCase: function (query, results) {"," return Filters.startsWith(query, results, true);"," },",""," /**"," Returns an array of results in which all the words of the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," This is basically a combination of `wordMatch()` (by ignoring whitespace and"," word order) and `phraseMatch()` (by allowing partial matching instead of"," requiring the entire word to match).",""," Example use case: Trying to find personal names independently of name order"," (Western or Eastern order) and supporting immediate feedback by allowing"," partial occurences. So queries like \"J. Doe\", \"Doe, John\", and \"J. D.\" would"," all match \"John Doe\".",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var queryWords = WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.filter(results, function (result) {"," var resultText = caseSensitive ? result.text :"," result.text.toLowerCase();",""," return YArray.every(queryWords, function (queryWord) {"," return resultText.indexOf(queryWord) !== -1;"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Filters.subWordMatch(query, results, true);"," },",""," /**"," Returns an array of results that contain all of the words in the query, in"," any order. Non-word characters like whitespace and certain punctuation are"," ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," if (!query) { return results; }",""," var options = {ignoreCase: !caseSensitive},"," queryWords = WordBreak.getUniqueWords(query, options);",""," return YArray.filter(results, function (result) {"," // Convert resultWords array to a hash for fast lookup."," var resultWords = YArray.hash(WordBreak.getUniqueWords(result.text,"," options));",""," return YArray.every(queryWords, function (word) {"," return YObject.owns(resultWords, word);"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to filter"," @return {Array} Filtered results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Filters.wordMatch(query, results, true);"," }","});","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"text-wordbreak\"]});"]; _yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].lines = {"1":0,"12":0,"33":0,"35":0,"38":0,"39":0,"41":0,"42":0,"45":0,"46":0,"61":0,"78":0,"80":0,"81":0,"84":0,"85":0,"99":0,"116":0,"118":0,"119":0,"122":0,"123":0,"137":0,"164":0,"166":0,"170":0,"171":0,"174":0,"175":0,"190":0,"208":0,"210":0,"213":0,"215":0,"218":0,"219":0,"234":0}; _yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].functions = {"(anonymous 3):45":0,"(anonymous 2):38":0,"charMatch:29":0,"charMatchCase:60":0,"(anonymous 4):84":0,"phraseMatch:74":0,"phraseMatchCase:98":0,"(anonymous 5):122":0,"startsWith:112":0,"startsWithCase:136":0,"(anonymous 7):174":0,"(anonymous 6):170":0,"subWordMatch:160":0,"subWordMatchCase:189":0,"(anonymous 9):218":0,"(anonymous 8):213":0,"wordMatch:204":0,"wordMatchCase:233":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-filters/autocomplete-filters.js"].coveredLines = 37;@@ -331,4 +331,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-wordbreak"]});
bundle/autocomplete-filters/autocomplete-filters-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -242,4 +242,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-wordbreak"]});
bundle/autocomplete-filters/autocomplete-filters-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-filters",function(e,t){var n=e.Array,r=e.Object,i=e.Text.WordBreak,s=e.mix(e.namespace("AutoCompleteFilters"),{charMatch:function(e,t,r){if(!e)return t;var i=n.unique((r?e:e.toLowerCase()).split(""));return n.filter(t,function(e){return e=e.text,r||(e=e.toLowerCase()),n.every(i,function(t){return e.indexOf(t)!==-1})})},charMatchCase:function(e,t){return s.charMatch(e,t,!0)},phraseMatch:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)!==-1})):t},phraseMatchCase:function(e,t){return s.phraseMatch(e,t,!0)},startsWith:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)===0})):t},startsWithCase:function(e,t){return s.startsWith(e,t,!0)},subWordMatch:function(e,t,r){if(!e)return t;var s=i.getUniqueWords(e,{ignoreCase:!r});return n.filter(t,function(e){var t=r?e.text:e.text.toLowerCase();return n.every(s,function(e){return t.indexOf(e)!==-1})})},subWordMatchCase:function(e,t){return s.subWordMatch(e,t,!0)},wordMatch:function(e,t,s){if(!e)return t;var o={ignoreCase:!s},u=i.getUniqueWords(e,o);return n.filter(t,function(e){var t=n.hash(i.getUniqueWords(e.text,o));return n.every(u,function(e){return r.owns(t,e)})})},wordMatchCase:function(e,t){return s.wordMatch(e,t,!0)}})},"3.7.2",{requires:["array-extras","text-wordbreak"]});+YUI.add("autocomplete-filters",function(e,t){var n=e.Array,r=e.Object,i=e.Text.WordBreak,s=e.mix(e.namespace("AutoCompleteFilters"),{charMatch:function(e,t,r){if(!e)return t;var i=n.unique((r?e:e.toLowerCase()).split(""));return n.filter(t,function(e){return e=e.text,r||(e=e.toLowerCase()),n.every(i,function(t){return e.indexOf(t)!==-1})})},charMatchCase:function(e,t){return s.charMatch(e,t,!0)},phraseMatch:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)!==-1})):t},phraseMatchCase:function(e,t){return s.phraseMatch(e,t,!0)},startsWith:function(e,t,r){return e?(r||(e=e.toLowerCase()),n.filter(t,function(t){return(r?t.text:t.text.toLowerCase()).indexOf(e)===0})):t},startsWithCase:function(e,t){return s.startsWith(e,t,!0)},subWordMatch:function(e,t,r){if(!e)return t;var s=i.getUniqueWords(e,{ignoreCase:!r});return n.filter(t,function(e){var t=r?e.text:e.text.toLowerCase();return n.every(s,function(e){return t.indexOf(e)!==-1})})},subWordMatchCase:function(e,t){return s.subWordMatch(e,t,!0)},wordMatch:function(e,t,s){if(!e)return t;var o={ignoreCase:!s},u=i.getUniqueWords(e,o);return n.filter(t,function(e){var t=n.hash(i.getUniqueWords(e.text,o));return n.every(u,function(e){return r.owns(t,e)})})},wordMatchCase:function(e,t){return s.wordMatch(e,t,!0)}})},"3.7.3",{requires:["array-extras","text-wordbreak"]});
bundle/autocomplete-filters/autocomplete-filters.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -242,4 +242,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-wordbreak"]});
bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js", code: [] };-_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].code=["YUI.add('autocomplete-highlighters-accentfold', function (Y, NAME) {","","/**","Provides pre-built accent-folding result highlighters for AutoComplete.","","These highlighters are similar to the ones provided by the `autocomplete-","highlighters` module, but use accent-aware comparisons. For example, \"resume\"","and \"résumé\" will be considered equal when using the accent-folding","highlighters.","","@module autocomplete","@submodule autocomplete-highlighters-accentfold","**/","","/**","@class AutoCompleteHighlighters","@static","**/","","var Highlight = Y.Highlight,"," YArray = Y.Array;","","Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," /**"," Accent-folding version of `charMatch()`.",""," @method charMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchFold: function (query, results) {"," var queryChars = YArray.unique(query.split(''));",""," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, queryChars);"," });"," },",""," /**"," Accent-folding version of `phraseMatch()`.",""," @method phraseMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, [query]);"," });"," },",""," /**"," Accent-folding version of `startsWith()`.",""," @method startsWithFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, [query], {"," startsWith: true"," });"," });"," },",""," /**"," Accent-folding version of `subWordMatch()`.",""," @method subWordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchFold: function (query, results) {"," var queryWords = Y.Text.WordBreak.getUniqueWords(query);",""," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, queryWords);"," });"," },",""," /**"," Accent-folding version of `wordMatch()`.",""," @method wordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.wordsFold(result.text, query);"," });"," }","});","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"highlight-accentfold\"]});"];+_yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].code=["YUI.add('autocomplete-highlighters-accentfold', function (Y, NAME) {","","/**","Provides pre-built accent-folding result highlighters for AutoComplete.","","These highlighters are similar to the ones provided by the `autocomplete-","highlighters` module, but use accent-aware comparisons. For example, \"resume\"","and \"résumé\" will be considered equal when using the accent-folding","highlighters.","","@module autocomplete","@submodule autocomplete-highlighters-accentfold","**/","","/**","@class AutoCompleteHighlighters","@static","**/","","var Highlight = Y.Highlight,"," YArray = Y.Array;","","Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," /**"," Accent-folding version of `charMatch()`.",""," @method charMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchFold: function (query, results) {"," var queryChars = YArray.unique(query.split(''));",""," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, queryChars);"," });"," },",""," /**"," Accent-folding version of `phraseMatch()`.",""," @method phraseMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, [query]);"," });"," },",""," /**"," Accent-folding version of `startsWith()`.",""," @method startsWithFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, [query], {"," startsWith: true"," });"," });"," },",""," /**"," Accent-folding version of `subWordMatch()`.",""," @method subWordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchFold: function (query, results) {"," var queryWords = Y.Text.WordBreak.getUniqueWords(query);",""," return YArray.map(results, function (result) {"," return Highlight.allFold(result.text, queryWords);"," });"," },",""," /**"," Accent-folding version of `wordMatch()`.",""," @method wordMatchFold"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchFold: function (query, results) {"," return YArray.map(results, function (result) {"," return Highlight.wordsFold(result.text, query);"," });"," }","});","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"highlight-accentfold\"]});"]; _yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].lines = {"1":0,"20":0,"23":0,"34":0,"36":0,"37":0,"51":0,"52":0,"66":0,"67":0,"83":0,"85":0,"86":0,"100":0,"101":0}; _yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].functions = {"(anonymous 2):36":0,"charMatchFold:33":0,"(anonymous 3):51":0,"phraseMatchFold:50":0,"(anonymous 4):66":0,"startsWithFold:65":0,"(anonymous 5):85":0,"subWordMatchFold:82":0,"(anonymous 6):100":0,"wordMatchFold:99":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js"].coveredLines = 15;@@ -169,4 +169,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "highlight-accentfold"]});+}, '3.7.3', {"requires": ["array-extras", "highlight-accentfold"]});
bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -110,4 +110,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "highlight-accentfold"]});+}, '3.7.3', {"requires": ["array-extras", "highlight-accentfold"]});
bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-highlighters-accentfold",function(e,t){var n=e.Highlight,r=e.Array;e.mix(e.namespace("AutoCompleteHighlighters"),{charMatchFold:function(e,t){var i=r.unique(e.split(""));return r.map(t,function(e){return n.allFold(e.text,i)})},phraseMatchFold:function(e,t){return r.map(t,function(t){return n.allFold(t.text,[e])})},startsWithFold:function(e,t){return r.map(t,function(t){return n.allFold(t.text,[e],{startsWith:!0})})},subWordMatchFold:function(t,i){var s=e.Text.WordBreak.getUniqueWords(t);return r.map(i,function(e){return n.allFold(e.text,s)})},wordMatchFold:function(e,t){return r.map(t,function(t){return n.wordsFold(t.text,e)})}})},"3.7.2",{requires:["array-extras","highlight-accentfold"]});+YUI.add("autocomplete-highlighters-accentfold",function(e,t){var n=e.Highlight,r=e.Array;e.mix(e.namespace("AutoCompleteHighlighters"),{charMatchFold:function(e,t){var i=r.unique(e.split(""));return r.map(t,function(e){return n.allFold(e.text,i)})},phraseMatchFold:function(e,t){return r.map(t,function(t){return n.allFold(t.text,[e])})},startsWithFold:function(e,t){return r.map(t,function(t){return n.allFold(t.text,[e],{startsWith:!0})})},subWordMatchFold:function(t,i){var s=e.Text.WordBreak.getUniqueWords(t);return r.map(i,function(e){return n.allFold(e.text,s)})},wordMatchFold:function(e,t){return r.map(t,function(t){return n.wordsFold(t.text,e)})}})},"3.7.3",{requires:["array-extras","highlight-accentfold"]});
bundle/autocomplete-highlighters-accentfold/autocomplete-highlighters-accentfold.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -110,4 +110,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "highlight-accentfold"]});+}, '3.7.3', {"requires": ["array-extras", "highlight-accentfold"]});
bundle/autocomplete-highlighters/autocomplete-highlighters-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-highlighters/autocomplete-highlighters.js", code: [] };-_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].code=["YUI.add('autocomplete-highlighters', function (Y, NAME) {","","/**","Provides pre-built result highlighters for AutoComplete.","","@module autocomplete","@submodule autocomplete-highlighters","@class AutoCompleteHighlighters","@static","**/","","var YArray = Y.Array,"," Highlight = Y.Highlight,","","Highlighters = Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Highlights any individual query character that occurs anywhere in a result."," Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryChars, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchCase: function (query, results) {"," return Highlighters.charMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase anywhere within a result. Case-"," insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Highlighters.phraseMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase at the beginning of a result."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive,"," startsWith : true"," });"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithCase: function (query, results) {"," return Highlighters.startsWith(query, results, true);"," },",""," /**"," Highlights portions of results in which words from the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," var queryWords = Y.Text.WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryWords, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Highlighters.subWordMatch(query, results, true);"," },",""," /**"," Highlights individual words in results that are also in the query. Non-word"," characters like punctuation are ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.words(result.text, query, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Highlighters.wordMatch(query, results, true);"," }","});","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"highlight-base\"]});"];+_yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].code=["YUI.add('autocomplete-highlighters', function (Y, NAME) {","","/**","Provides pre-built result highlighters for AutoComplete.","","@module autocomplete","@submodule autocomplete-highlighters","@class AutoCompleteHighlighters","@static","**/","","var YArray = Y.Array,"," Highlight = Y.Highlight,","","Highlighters = Y.mix(Y.namespace('AutoCompleteHighlighters'), {"," // -- Public Methods -------------------------------------------------------",""," /**"," Highlights any individual query character that occurs anywhere in a result."," Case-insensitive.",""," @method charMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // charMatchCase(). It's intentionally undocumented.",""," var queryChars = YArray.unique((caseSensitive ? query :"," query.toLowerCase()).split(''));",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryChars, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `charMatch()`.",""," @method charMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," charMatchCase: function (query, results) {"," return Highlighters.charMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase anywhere within a result. Case-"," insensitive.",""," @method phraseMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // phraseMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `phraseMatch()`.",""," @method phraseMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," phraseMatchCase: function (query, results) {"," return Highlighters.phraseMatch(query, results, true);"," },",""," /**"," Highlights the complete query as a phrase at the beginning of a result."," Case-insensitive.",""," @method startsWith"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWith: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // startsWithCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, [query], {"," caseSensitive: caseSensitive,"," startsWith : true"," });"," });"," },",""," /**"," Case-sensitive version of `startsWith()`.",""," @method startsWithCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," startsWithCase: function (query, results) {"," return Highlighters.startsWith(query, results, true);"," },",""," /**"," Highlights portions of results in which words from the query match either"," whole words or parts of words in the result. Non-word characters like"," whitespace and certain punctuation are ignored. Case-insensitive.",""," @method subWordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // subWordMatchCase(). It's intentionally undocumented.",""," var queryWords = Y.Text.WordBreak.getUniqueWords(query, {"," ignoreCase: !caseSensitive"," });",""," return YArray.map(results, function (result) {"," return Highlight.all(result.text, queryWords, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `subWordMatch()`.",""," @method subWordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," subWordMatchCase: function (query, results) {"," return Highlighters.subWordMatch(query, results, true);"," },",""," /**"," Highlights individual words in results that are also in the query. Non-word"," characters like punctuation are ignored. Case-insensitive.",""," @method wordMatch"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatch: function (query, results, caseSensitive) {"," // The caseSensitive parameter is only intended for use by"," // wordMatchCase(). It's intentionally undocumented.",""," return YArray.map(results, function (result) {"," return Highlight.words(result.text, query, {"," caseSensitive: caseSensitive"," });"," });"," },",""," /**"," Case-sensitive version of `wordMatch()`.",""," @method wordMatchCase"," @param {String} query Query to match"," @param {Array} results Results to highlight"," @return {Array} Highlighted results"," @static"," **/"," wordMatchCase: function (query, results) {"," return Highlighters.wordMatch(query, results, true);"," }","});","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"highlight-base\"]});"]; _yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].lines = {"1":0,"12":0,"32":0,"35":0,"36":0,"52":0,"69":0,"70":0,"86":0,"103":0,"104":0,"121":0,"139":0,"143":0,"144":0,"160":0,"177":0,"178":0,"194":0}; _yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].functions = {"(anonymous 2):35":0,"charMatch:28":0,"charMatchCase:51":0,"(anonymous 3):69":0,"phraseMatch:65":0,"phraseMatchCase:85":0,"(anonymous 4):103":0,"startsWith:99":0,"startsWithCase:120":0,"(anonymous 5):143":0,"subWordMatch:135":0,"subWordMatchCase:159":0,"(anonymous 6):177":0,"wordMatch:173":0,"wordMatchCase:193":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-highlighters/autocomplete-highlighters.js"].coveredLines = 19;@@ -270,4 +270,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "highlight-base"]});+}, '3.7.3', {"requires": ["array-extras", "highlight-base"]});
bundle/autocomplete-highlighters/autocomplete-highlighters-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -202,4 +202,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "highlight-base"]});+}, '3.7.3', {"requires": ["array-extras", "highlight-base"]});
bundle/autocomplete-highlighters/autocomplete-highlighters-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-highlighters",function(e,t){var n=e.Array,r=e.Highlight,i=e.mix(e.namespace("AutoCompleteHighlighters"),{charMatch:function(e,t,i){var s=n.unique((i?e:e.toLowerCase()).split(""));return n.map(t,function(e){return r.all(e.text,s,{caseSensitive:i})})},charMatchCase:function(e,t){return i.charMatch(e,t,!0)},phraseMatch:function(e,t,i){return n.map(t,function(t){return r.all(t.text,[e],{caseSensitive:i})})},phraseMatchCase:function(e,t){return i.phraseMatch(e,t,!0)},startsWith:function(e,t,i){return n.map(t,function(t){return r.all(t.text,[e],{caseSensitive:i,startsWith:!0})})},startsWithCase:function(e,t){return i.startsWith(e,t,!0)},subWordMatch:function(t,i,s){var o=e.Text.WordBreak.getUniqueWords(t,{ignoreCase:!s});return n.map(i,function(e){return r.all(e.text,o,{caseSensitive:s})})},subWordMatchCase:function(e,t){return i.subWordMatch(e,t,!0)},wordMatch:function(e,t,i){return n.map(t,function(t){return r.words(t.text,e,{caseSensitive:i})})},wordMatchCase:function(e,t){return i.wordMatch(e,t,!0)}})},"3.7.2",{requires:["array-extras","highlight-base"]});+YUI.add("autocomplete-highlighters",function(e,t){var n=e.Array,r=e.Highlight,i=e.mix(e.namespace("AutoCompleteHighlighters"),{charMatch:function(e,t,i){var s=n.unique((i?e:e.toLowerCase()).split(""));return n.map(t,function(e){return r.all(e.text,s,{caseSensitive:i})})},charMatchCase:function(e,t){return i.charMatch(e,t,!0)},phraseMatch:function(e,t,i){return n.map(t,function(t){return r.all(t.text,[e],{caseSensitive:i})})},phraseMatchCase:function(e,t){return i.phraseMatch(e,t,!0)},startsWith:function(e,t,i){return n.map(t,function(t){return r.all(t.text,[e],{caseSensitive:i,startsWith:!0})})},startsWithCase:function(e,t){return i.startsWith(e,t,!0)},subWordMatch:function(t,i,s){var o=e.Text.WordBreak.getUniqueWords(t,{ignoreCase:!s});return n.map(i,function(e){return r.all(e.text,o,{caseSensitive:s})})},subWordMatchCase:function(e,t){return i.subWordMatch(e,t,!0)},wordMatch:function(e,t,i){return n.map(t,function(t){return r.words(t.text,e,{caseSensitive:i})})},wordMatchCase:function(e,t){return i.wordMatch(e,t,!0)}})},"3.7.3",{requires:["array-extras","highlight-base"]});
bundle/autocomplete-highlighters/autocomplete-highlighters.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -202,4 +202,4 @@ }); -}, '3.7.2', {"requires": ["array-extras", "highlight-base"]});+}, '3.7.3', {"requires": ["array-extras", "highlight-base"]});
bundle/autocomplete-list-keys/autocomplete-list-keys-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-list-keys/autocomplete-list-keys.js", code: [] };-_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].code=["YUI.add('autocomplete-list-keys', function (Y, NAME) {","","/**","Mixes keyboard support into AutoCompleteList. By default, this module is not","loaded for iOS and Android devices.","","@module autocomplete","@submodule autocomplete-list-keys","**/",""," // keyCode constants.","var KEY_DOWN = 40,"," KEY_ENTER = 13,"," KEY_ESC = 27,"," KEY_TAB = 9,"," KEY_UP = 38;","","function ListKeys() {"," Y.before(this._bindKeys, this, 'bindUI');"," this._initKeys();","}","","ListKeys.prototype = {"," // -- Lifecycle Methods ----------------------------------------------------",""," /**"," Initializes keyboard command mappings.",""," @method _initKeys"," @protected"," @for AutoCompleteList"," **/"," _initKeys: function () {"," var keys = {},"," keysVisible = {};",""," // Register keyboard command handlers. _keys contains handlers that will"," // always be called; _keysVisible contains handlers that will only be"," // called when the list is visible."," keys[KEY_DOWN] = this._keyDown;",""," keysVisible[KEY_ENTER] = this._keyEnter;"," keysVisible[KEY_ESC] = this._keyEsc;"," keysVisible[KEY_TAB] = this._keyTab;"," keysVisible[KEY_UP] = this._keyUp;",""," this._keys = keys;"," this._keysVisible = keysVisible;"," },",""," destructor: function () {"," this._unbindKeys();"," },",""," /**"," Binds keyboard events.",""," @method _bindKeys"," @protected"," **/"," _bindKeys: function () {"," this._keyEvents = this._inputNode.on('keydown', this._onInputKey, this);"," },",""," /**"," Unbinds keyboard events.",""," @method _unbindKeys"," @protected"," **/"," _unbindKeys: function () {"," this._keyEvents && this._keyEvents.detach();"," this._keyEvents = null;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Called when the down arrow key is pressed.",""," @method _keyDown"," @protected"," **/"," _keyDown: function () {"," if (this.get('visible')) {"," this._activateNextItem();"," } else {"," this.show();"," }"," },",""," /**"," Called when the enter key is pressed.",""," @method _keyEnter"," @protected"," **/"," _keyEnter: function (e) {"," var item = this.get('activeItem');",""," if (item) {"," this.selectItem(item, e);"," } else {"," // Don't prevent form submission when there's no active item."," return false;"," }"," },",""," /**"," Called when the escape key is pressed.",""," @method _keyEsc"," @protected"," **/"," _keyEsc: function () {"," this.hide();"," },",""," /**"," Called when the tab key is pressed.",""," @method _keyTab"," @protected"," **/"," _keyTab: function (e) {"," var item;",""," if (this.get('tabSelect')) {"," item = this.get('activeItem');",""," if (item) {"," this.selectItem(item, e);"," return true;"," }"," }",""," return false;"," },",""," /**"," Called when the up arrow key is pressed.",""," @method _keyUp"," @protected"," **/"," _keyUp: function () {"," this._activatePrevItem();"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `inputNode` key events.",""," @method _onInputKey"," @param {EventTarget} e"," @protected"," **/"," _onInputKey: function (e) {"," var handler,"," keyCode = e.keyCode;",""," this._lastInputKey = keyCode;",""," if (this.get('results').length) {"," handler = this._keys[keyCode];",""," if (!handler && this.get('visible')) {"," handler = this._keysVisible[keyCode];"," }",""," if (handler) {"," // A handler may return false to indicate that it doesn't wish"," // to prevent the default key behavior."," if (handler.call(this, e) !== false) {"," e.preventDefault();"," }"," }"," }"," }","};","","Y.Base.mix(Y.AutoCompleteList, [ListKeys]);","","","}, '3.7.2', {\"requires\": [\"autocomplete-list\", \"base-build\"]});"];+_yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].code=["YUI.add('autocomplete-list-keys', function (Y, NAME) {","","/**","Mixes keyboard support into AutoCompleteList. By default, this module is not","loaded for iOS and Android devices.","","@module autocomplete","@submodule autocomplete-list-keys","**/",""," // keyCode constants.","var KEY_DOWN = 40,"," KEY_ENTER = 13,"," KEY_ESC = 27,"," KEY_TAB = 9,"," KEY_UP = 38;","","function ListKeys() {"," Y.before(this._bindKeys, this, 'bindUI');"," this._initKeys();","}","","ListKeys.prototype = {"," // -- Lifecycle Methods ----------------------------------------------------",""," /**"," Initializes keyboard command mappings.",""," @method _initKeys"," @protected"," @for AutoCompleteList"," **/"," _initKeys: function () {"," var keys = {},"," keysVisible = {};",""," // Register keyboard command handlers. _keys contains handlers that will"," // always be called; _keysVisible contains handlers that will only be"," // called when the list is visible."," keys[KEY_DOWN] = this._keyDown;",""," keysVisible[KEY_ENTER] = this._keyEnter;"," keysVisible[KEY_ESC] = this._keyEsc;"," keysVisible[KEY_TAB] = this._keyTab;"," keysVisible[KEY_UP] = this._keyUp;",""," this._keys = keys;"," this._keysVisible = keysVisible;"," },",""," destructor: function () {"," this._unbindKeys();"," },",""," /**"," Binds keyboard events.",""," @method _bindKeys"," @protected"," **/"," _bindKeys: function () {"," this._keyEvents = this._inputNode.on('keydown', this._onInputKey, this);"," },",""," /**"," Unbinds keyboard events.",""," @method _unbindKeys"," @protected"," **/"," _unbindKeys: function () {"," this._keyEvents && this._keyEvents.detach();"," this._keyEvents = null;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Called when the down arrow key is pressed.",""," @method _keyDown"," @protected"," **/"," _keyDown: function () {"," if (this.get('visible')) {"," this._activateNextItem();"," } else {"," this.show();"," }"," },",""," /**"," Called when the enter key is pressed.",""," @method _keyEnter"," @protected"," **/"," _keyEnter: function (e) {"," var item = this.get('activeItem');",""," if (item) {"," this.selectItem(item, e);"," } else {"," // Don't prevent form submission when there's no active item."," return false;"," }"," },",""," /**"," Called when the escape key is pressed.",""," @method _keyEsc"," @protected"," **/"," _keyEsc: function () {"," this.hide();"," },",""," /**"," Called when the tab key is pressed.",""," @method _keyTab"," @protected"," **/"," _keyTab: function (e) {"," var item;",""," if (this.get('tabSelect')) {"," item = this.get('activeItem');",""," if (item) {"," this.selectItem(item, e);"," return true;"," }"," }",""," return false;"," },",""," /**"," Called when the up arrow key is pressed.",""," @method _keyUp"," @protected"," **/"," _keyUp: function () {"," this._activatePrevItem();"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `inputNode` key events.",""," @method _onInputKey"," @param {EventTarget} e"," @protected"," **/"," _onInputKey: function (e) {"," var handler,"," keyCode = e.keyCode;",""," this._lastInputKey = keyCode;",""," if (this.get('results').length) {"," handler = this._keys[keyCode];",""," if (!handler && this.get('visible')) {"," handler = this._keysVisible[keyCode];"," }",""," if (handler) {"," // A handler may return false to indicate that it doesn't wish"," // to prevent the default key behavior."," if (handler.call(this, e) !== false) {"," e.preventDefault();"," }"," }"," }"," }","};","","Y.Base.mix(Y.AutoCompleteList, [ListKeys]);","","","}, '3.7.3', {\"requires\": [\"autocomplete-list\", \"base-build\"]});"]; _yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].lines = {"1":0,"12":0,"18":0,"19":0,"20":0,"23":0,"34":0,"40":0,"42":0,"43":0,"44":0,"45":0,"47":0,"48":0,"52":0,"62":0,"72":0,"73":0,"85":0,"86":0,"88":0,"99":0,"101":0,"102":0,"105":0,"116":0,"126":0,"128":0,"129":0,"131":0,"132":0,"133":0,"137":0,"147":0,"160":0,"163":0,"165":0,"166":0,"168":0,"169":0,"172":0,"175":0,"176":0,"183":0}; _yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].functions = {"ListKeys:18":0,"_initKeys:33":0,"destructor:51":0,"_bindKeys:61":0,"_unbindKeys:71":0,"_keyDown:84":0,"_keyEnter:98":0,"_keyEsc:115":0,"_keyTab:125":0,"_keyUp:146":0,"_onInputKey:159":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-list-keys/autocomplete-list-keys.js"].coveredLines = 44;@@ -278,4 +278,4 @@ Y.Base.mix(Y.AutoCompleteList, [ListKeys]); -}, '3.7.2', {"requires": ["autocomplete-list", "base-build"]});+}, '3.7.3', {"requires": ["autocomplete-list", "base-build"]});
bundle/autocomplete-list-keys/autocomplete-list-keys-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -189,4 +189,4 @@ Y.Base.mix(Y.AutoCompleteList, [ListKeys]); -}, '3.7.2', {"requires": ["autocomplete-list", "base-build"]});+}, '3.7.3', {"requires": ["autocomplete-list", "base-build"]});
bundle/autocomplete-list-keys/autocomplete-list-keys-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-list-keys",function(e,t){function u(){e.before(this._bindKeys,this,"bindUI"),this._initKeys()}var n=40,r=13,i=27,s=9,o=38;u.prototype={_initKeys:function(){var e={},t={};e[n]=this._keyDown,t[r]=this._keyEnter,t[i]=this._keyEsc,t[s]=this._keyTab,t[o]=this._keyUp,this._keys=e,this._keysVisible=t},destructor:function(){this._unbindKeys()},_bindKeys:function(){this._keyEvents=this._inputNode.on("keydown",this._onInputKey,this)},_unbindKeys:function(){this._keyEvents&&this._keyEvents.detach(),this._keyEvents=null},_keyDown:function(){this.get("visible")?this._activateNextItem():this.show()},_keyEnter:function(e){var t=this.get("activeItem");if(!t)return!1;this.selectItem(t,e)},_keyEsc:function(){this.hide()},_keyTab:function(e){var t;if(this.get("tabSelect")){t=this.get("activeItem");if(t)return this.selectItem(t,e),!0}return!1},_keyUp:function(){this._activatePrevItem()},_onInputKey:function(e){var t,n=e.keyCode;this._lastInputKey=n,this.get("results").length&&(t=this._keys[n],!t&&this.get("visible")&&(t=this._keysVisible[n]),t&&t.call(this,e)!==!1&&e.preventDefault())}},e.Base.mix(e.AutoCompleteList,[u])},"3.7.2",{requires:["autocomplete-list","base-build"]});+YUI.add("autocomplete-list-keys",function(e,t){function u(){e.before(this._bindKeys,this,"bindUI"),this._initKeys()}var n=40,r=13,i=27,s=9,o=38;u.prototype={_initKeys:function(){var e={},t={};e[n]=this._keyDown,t[r]=this._keyEnter,t[i]=this._keyEsc,t[s]=this._keyTab,t[o]=this._keyUp,this._keys=e,this._keysVisible=t},destructor:function(){this._unbindKeys()},_bindKeys:function(){this._keyEvents=this._inputNode.on("keydown",this._onInputKey,this)},_unbindKeys:function(){this._keyEvents&&this._keyEvents.detach(),this._keyEvents=null},_keyDown:function(){this.get("visible")?this._activateNextItem():this.show()},_keyEnter:function(e){var t=this.get("activeItem");if(!t)return!1;this.selectItem(t,e)},_keyEsc:function(){this.hide()},_keyTab:function(e){var t;if(this.get("tabSelect")){t=this.get("activeItem");if(t)return this.selectItem(t,e),!0}return!1},_keyUp:function(){this._activatePrevItem()},_onInputKey:function(e){var t,n=e.keyCode;this._lastInputKey=n,this.get("results").length&&(t=this._keys[n],!t&&this.get("visible")&&(t=this._keysVisible[n]),t&&t.call(this,e)!==!1&&e.preventDefault())}},e.Base.mix(e.AutoCompleteList,[u])},"3.7.3",{requires:["autocomplete-list","base-build"]});
bundle/autocomplete-list-keys/autocomplete-list-keys.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -189,4 +189,4 @@ Y.Base.mix(Y.AutoCompleteList, [ListKeys]); -}, '3.7.2', {"requires": ["autocomplete-list", "base-build"]});+}, '3.7.3', {"requires": ["autocomplete-list", "base-build"]});
bundle/autocomplete-list/assets/autocomplete-list-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/autocomplete-list/assets/skins/night/autocomplete-list-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/autocomplete-list/assets/skins/night/autocomplete-list.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/autocomplete-list/assets/skins/sam/autocomplete-list-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/autocomplete-list/assets/skins/sam/autocomplete-list.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/autocomplete-list/autocomplete-list-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-list/autocomplete-list.js", code: [] };-_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].code=["YUI.add('autocomplete-list', function (Y, NAME) {","","/**","Traditional autocomplete dropdown list widget, just like Mom used to make.","","@module autocomplete","@submodule autocomplete-list","**/","","/**","Traditional autocomplete dropdown list widget, just like Mom used to make.","","@class AutoCompleteList","@extends Widget","@uses AutoCompleteBase","@uses WidgetPosition","@uses WidgetPositionAlign","@constructor","@param {Object} config Configuration object.","**/","","var Lang = Y.Lang,"," Node = Y.Node,"," YArray = Y.Array,",""," // Whether or not we need an iframe shim."," useShim = Y.UA.ie && Y.UA.ie < 7,",""," // keyCode constants."," KEY_TAB = 9,",""," // String shorthand."," _CLASS_ITEM = '_CLASS_ITEM',"," _CLASS_ITEM_ACTIVE = '_CLASS_ITEM_ACTIVE',"," _CLASS_ITEM_HOVER = '_CLASS_ITEM_HOVER',"," _SELECTOR_ITEM = '_SELECTOR_ITEM',",""," ACTIVE_ITEM = 'activeItem',"," ALWAYS_SHOW_LIST = 'alwaysShowList',"," CIRCULAR = 'circular',"," HOVERED_ITEM = 'hoveredItem',"," ID = 'id',"," ITEM = 'item',"," LIST = 'list',"," RESULT = 'result',"," RESULTS = 'results',"," VISIBLE = 'visible',"," WIDTH = 'width',",""," // Event names."," EVT_SELECT = 'select',","","List = Y.Base.create('autocompleteList', Y.Widget, ["," Y.AutoCompleteBase,"," Y.WidgetPosition,"," Y.WidgetPositionAlign","], {"," // -- Prototype Properties -------------------------------------------------"," ARIA_TEMPLATE: '<div/>',"," ITEM_TEMPLATE: '<li/>',"," LIST_TEMPLATE: '<ul/>',",""," // Widget automatically attaches delegated event handlers to everything in"," // Y.Node.DOM_EVENTS, including synthetic events. Since Widget's event"," // delegation won't work for the synthetic valuechange event, and since"," // it creates a name collision between the backcompat \"valueChange\" synth"," // event alias and AutoCompleteList's \"valueChange\" event for the \"value\""," // attr, this hack is necessary in order to prevent Widget from attaching"," // valuechange handlers."," UI_EVENTS: (function () {"," var uiEvents = Y.merge(Y.Node.DOM_EVENTS);",""," delete uiEvents.valuechange;"," delete uiEvents.valueChange;",""," return uiEvents;"," }()),",""," // -- Lifecycle Prototype Methods ------------------------------------------"," initializer: function () {"," var inputNode = this.get('inputNode');",""," if (!inputNode) {"," Y.error('No inputNode specified.');"," return;"," }",""," this._inputNode = inputNode;"," this._listEvents = [];",""," // This ensures that the list is rendered inside the same parent as the"," // input node by default, which is necessary for proper ARIA support."," this.DEF_PARENT_NODE = inputNode.get('parentNode');",""," // Cache commonly used classnames and selectors for performance."," this[_CLASS_ITEM] = this.getClassName(ITEM);"," this[_CLASS_ITEM_ACTIVE] = this.getClassName(ITEM, 'active');"," this[_CLASS_ITEM_HOVER] = this.getClassName(ITEM, 'hover');"," this[_SELECTOR_ITEM] = '.' + this[_CLASS_ITEM];",""," /**"," Fires when an autocomplete suggestion is selected from the list,"," typically via a keyboard action or mouse click.",""," @event select"," @param {Node} itemNode List item node that was selected."," @param {Object} result AutoComplete result object."," @preventable _defSelectFn"," **/"," this.publish(EVT_SELECT, {"," defaultFn: this._defSelectFn"," });"," },",""," destructor: function () {"," while (this._listEvents.length) {"," this._listEvents.pop().detach();"," }",""," if (this._ariaNode) {"," this._ariaNode.remove().destroy(true);"," }"," },",""," bindUI: function () {"," this._bindInput();"," this._bindList();"," },",""," renderUI: function () {"," var ariaNode = this._createAriaNode(),"," boundingBox = this.get('boundingBox'),"," contentBox = this.get('contentBox'),"," inputNode = this._inputNode,"," listNode = this._createListNode(),"," parentNode = inputNode.get('parentNode');",""," inputNode.addClass(this.getClassName('input')).setAttrs({"," 'aria-autocomplete': LIST,"," 'aria-expanded' : false,"," 'aria-owns' : listNode.get('id')"," });",""," // ARIA node must be outside the widget or announcements won't be made"," // when the widget is hidden."," parentNode.append(ariaNode);",""," // Add an iframe shim for IE6."," if (useShim) {"," boundingBox.plug(Y.Plugin.Shim);"," }",""," // Force position: absolute on the boundingBox. This works around a"," // potential CSS loading race condition in Gecko that can cause the"," // boundingBox to become relatively positioned, which is all kinds of"," // no good."," boundingBox.setStyle('position', 'absolute');",""," this._ariaNode = ariaNode;"," this._boundingBox = boundingBox;"," this._contentBox = contentBox;"," this._listNode = listNode;"," this._parentNode = parentNode;"," },",""," syncUI: function () {"," // No need to call _syncPosition() here; the other _sync methods will"," // call it when necessary."," this._syncResults();"," this._syncVisibility();"," },",""," // -- Public Prototype Methods ---------------------------------------------",""," /**"," Hides the list, unless the `alwaysShowList` attribute is `true`.",""," @method hide"," @see show"," @chainable"," **/"," hide: function () {"," return this.get(ALWAYS_SHOW_LIST) ? this : this.set(VISIBLE, false);"," },",""," /**"," Selects the specified _itemNode_, or the current `activeItem` if _itemNode_"," is not specified.",""," @method selectItem"," @param {Node} [itemNode] Item node to select."," @param {EventFacade} [originEvent] Event that triggered the selection, if"," any."," @chainable"," **/"," selectItem: function (itemNode, originEvent) {"," if (itemNode) {"," if (!itemNode.hasClass(this[_CLASS_ITEM])) {"," return this;"," }"," } else {"," itemNode = this.get(ACTIVE_ITEM);",""," if (!itemNode) {"," return this;"," }"," }",""," this.fire(EVT_SELECT, {"," itemNode : itemNode,"," originEvent: originEvent || null,"," result : itemNode.getData(RESULT)"," });",""," return this;"," },",""," // -- Protected Prototype Methods ------------------------------------------",""," /**"," Activates the next item after the currently active item. If there is no next"," item and the `circular` attribute is `true`, focus will wrap back to the"," input node.",""," @method _activateNextItem"," @chainable"," @protected"," **/"," _activateNextItem: function () {"," var item = this.get(ACTIVE_ITEM),"," nextItem;",""," if (item) {"," nextItem = item.next(this[_SELECTOR_ITEM]) ||"," (this.get(CIRCULAR) ? null : item);"," } else {"," nextItem = this._getFirstItemNode();"," }",""," this.set(ACTIVE_ITEM, nextItem);",""," return this;"," },",""," /**"," Activates the item previous to the currently active item. If there is no"," previous item and the `circular` attribute is `true`, focus will wrap back"," to the input node.",""," @method _activatePrevItem"," @chainable"," @protected"," **/"," _activatePrevItem: function () {"," var item = this.get(ACTIVE_ITEM),"," prevItem = item ? item.previous(this[_SELECTOR_ITEM]) :"," this.get(CIRCULAR) && this._getLastItemNode();",""," this.set(ACTIVE_ITEM, prevItem || null);",""," return this;"," },",""," /**"," Appends the specified result _items_ to the list inside a new item node.",""," @method _add"," @param {Array|Node|HTMLElement|String} items Result item or array of"," result items."," @return {NodeList} Added nodes."," @protected"," **/"," _add: function (items) {"," var itemNodes = [];",""," YArray.each(Lang.isArray(items) ? items : [items], function (item) {"," itemNodes.push(this._createItemNode(item).setData(RESULT, item));"," }, this);",""," itemNodes = Y.all(itemNodes);"," this._listNode.append(itemNodes.toFrag());",""," return itemNodes;"," },",""," /**"," Updates the ARIA live region with the specified message.",""," @method _ariaSay"," @param {String} stringId String id (from the `strings` attribute) of the"," message to speak."," @param {Object} [subs] Substitutions for placeholders in the string."," @protected"," **/"," _ariaSay: function (stringId, subs) {"," var message = this.get('strings.' + stringId);"," this._ariaNode.set('text', subs ? Lang.sub(message, subs) : message);"," },",""," /**"," Binds `inputNode` events and behavior.",""," @method _bindInput"," @protected"," **/"," _bindInput: function () {"," var inputNode = this._inputNode,"," alignNode, alignWidth, tokenInput;",""," // Null align means we can auto-align. Set align to false to prevent"," // auto-alignment, or a valid alignment config to customize the"," // alignment."," if (this.get('align') === null) {"," // If this is a tokenInput, align with its bounding box."," // Otherwise, align with the inputNode. Bit of a cheat."," tokenInput = this.get('tokenInput');"," alignNode = (tokenInput && tokenInput.get('boundingBox')) || inputNode;",""," this.set('align', {"," node : alignNode,"," points: ['tl', 'bl']"," });",""," // If no width config is set, attempt to set the list's width to the"," // width of the alignment node. If the alignment node's width is"," // falsy, do nothing."," if (!this.get(WIDTH) && (alignWidth = alignNode.get('offsetWidth'))) {"," this.set(WIDTH, alignWidth);"," }"," }",""," // Attach inputNode events."," this._listEvents = this._listEvents.concat(["," inputNode.after('blur', this._afterListInputBlur, this),"," inputNode.after('focus', this._afterListInputFocus, this)"," ]);"," },",""," /**"," Binds list events.",""," @method _bindList"," @protected"," **/"," _bindList: function () {"," this._listEvents = this._listEvents.concat(["," Y.one('doc').after('click', this._afterDocClick, this),"," Y.one('win').after('windowresize', this._syncPosition, this),",""," this.after({"," mouseover: this._afterMouseOver,"," mouseout : this._afterMouseOut,",""," activeItemChange : this._afterActiveItemChange,"," alwaysShowListChange: this._afterAlwaysShowListChange,"," hoveredItemChange : this._afterHoveredItemChange,"," resultsChange : this._afterResultsChange,"," visibleChange : this._afterVisibleChange"," }),",""," this._listNode.delegate('click', this._onItemClick,"," this[_SELECTOR_ITEM], this)"," ]);"," },",""," /**"," Clears the contents of the tray.",""," @method _clear"," @protected"," **/"," _clear: function () {"," this.set(ACTIVE_ITEM, null);"," this._set(HOVERED_ITEM, null);",""," this._listNode.get('children').remove(true);"," },",""," /**"," Creates and returns an ARIA live region node.",""," @method _createAriaNode"," @return {Node} ARIA node."," @protected"," **/"," _createAriaNode: function () {"," var ariaNode = Node.create(this.ARIA_TEMPLATE);",""," return ariaNode.addClass(this.getClassName('aria')).setAttrs({"," 'aria-live': 'polite',"," role : 'status'"," });"," },",""," /**"," Creates and returns an item node with the specified _content_.",""," @method _createItemNode"," @param {Object} result Result object."," @return {Node} Item node."," @protected"," **/"," _createItemNode: function (result) {"," var itemNode = Node.create(this.ITEM_TEMPLATE);",""," return itemNode.addClass(this[_CLASS_ITEM]).setAttrs({"," id : Y.stamp(itemNode),"," role: 'option'"," }).setAttribute('data-text', result.text).append(result.display);"," },",""," /**"," Creates and returns a list node. If the `listNode` attribute is already set"," to an existing node, that node will be used.",""," @method _createListNode"," @return {Node} List node."," @protected"," **/"," _createListNode: function () {"," var listNode = this.get('listNode') || Node.create(this.LIST_TEMPLATE);",""," listNode.addClass(this.getClassName(LIST)).setAttrs({"," id : Y.stamp(listNode),"," role: 'listbox'"," });",""," this._set('listNode', listNode);"," this.get('contentBox').append(listNode);",""," return listNode;"," },",""," /**"," Gets the first item node in the list, or `null` if the list is empty.",""," @method _getFirstItemNode"," @return {Node|null}"," @protected"," **/"," _getFirstItemNode: function () {"," return this._listNode.one(this[_SELECTOR_ITEM]);"," },",""," /**"," Gets the last item node in the list, or `null` if the list is empty.",""," @method _getLastItemNode"," @return {Node|null}"," @protected"," **/"," _getLastItemNode: function () {"," return this._listNode.one(this[_SELECTOR_ITEM] + ':last-child');"," },",""," /**"," Synchronizes the result list's position and alignment.",""," @method _syncPosition"," @protected"," **/"," _syncPosition: function () {"," // Force WidgetPositionAlign to refresh its alignment."," this._syncUIPosAlign();",""," // Resize the IE6 iframe shim to match the list's dimensions."," this._syncShim();"," },",""," /**"," Synchronizes the results displayed in the list with those in the _results_"," argument, or with the `results` attribute if an argument is not provided.",""," @method _syncResults"," @param {Array} [results] Results."," @protected"," **/"," _syncResults: function (results) {"," if (!results) {"," results = this.get(RESULTS);"," }",""," this._clear();",""," if (results.length) {"," this._add(results);"," this._ariaSay('items_available');"," }",""," this._syncPosition();",""," if (this.get('activateFirstItem') && !this.get(ACTIVE_ITEM)) {"," this.set(ACTIVE_ITEM, this._getFirstItemNode());"," }"," },",""," /**"," Synchronizes the size of the iframe shim used for IE6 and lower. In other"," browsers, this method is a noop.",""," @method _syncShim"," @protected"," **/"," _syncShim: useShim ? function () {"," var shim = this._boundingBox.shim;",""," if (shim) {"," shim.sync();"," }"," } : function () {},",""," /**"," Synchronizes the visibility of the tray with the _visible_ argument, or with"," the `visible` attribute if an argument is not provided.",""," @method _syncVisibility"," @param {Boolean} [visible] Visibility."," @protected"," **/"," _syncVisibility: function (visible) {"," if (this.get(ALWAYS_SHOW_LIST)) {"," visible = true;"," this.set(VISIBLE, visible);"," }",""," if (typeof visible === 'undefined') {"," visible = this.get(VISIBLE);"," }",""," this._inputNode.set('aria-expanded', visible);"," this._boundingBox.set('aria-hidden', !visible);",""," if (visible) {"," this._syncPosition();"," } else {"," this.set(ACTIVE_ITEM, null);"," this._set(HOVERED_ITEM, null);",""," // Force a reflow to work around a glitch in IE6 and 7 where some of"," // the contents of the list will sometimes remain visible after the"," // container is hidden."," this._boundingBox.get('offsetWidth');"," }",""," // In some pages, IE7 fails to repaint the contents of the list after it"," // becomes visible. Toggling a bogus class on the body forces a repaint"," // that fixes the issue."," if (Y.UA.ie === 7) {"," // Note: We don't actually need to use ClassNameManager here. This"," // class isn't applying any actual styles; it's just frobbing the"," // body element to force a repaint. The actual class name doesn't"," // really matter."," Y.one('body')"," .addClass('yui3-ie7-sucks')"," .removeClass('yui3-ie7-sucks');"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `activeItemChange` events.",""," @method _afterActiveItemChange"," @param {EventFacade} e"," @protected"," **/"," _afterActiveItemChange: function (e) {"," var inputNode = this._inputNode,"," newVal = e.newVal,"," prevVal = e.prevVal,"," node;",""," // The previous item may have disappeared by the time this handler runs,"," // so we need to be careful."," if (prevVal && prevVal._node) {"," prevVal.removeClass(this[_CLASS_ITEM_ACTIVE]);"," }",""," if (newVal) {"," newVal.addClass(this[_CLASS_ITEM_ACTIVE]);"," inputNode.set('aria-activedescendant', newVal.get(ID));"," } else {"," inputNode.removeAttribute('aria-activedescendant');"," }",""," if (this.get('scrollIntoView')) {"," node = newVal || inputNode;",""," if (!node.inRegion(Y.DOM.viewportRegion(), true)"," || !node.inRegion(this._contentBox, true)) {",""," node.scrollIntoView();"," }"," }"," },",""," /**"," Handles `alwaysShowListChange` events.",""," @method _afterAlwaysShowListChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlwaysShowListChange: function (e) {"," this.set(VISIBLE, e.newVal || this.get(RESULTS).length > 0);"," },",""," /**"," Handles click events on the document. If the click is outside both the"," input node and the bounding box, the list will be hidden.",""," @method _afterDocClick"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDocClick: function (e) {"," var boundingBox = this._boundingBox,"," target = e.target;",""," if(target !== this._inputNode && target !== boundingBox &&"," target.ancestor('#' + boundingBox.get('id'), true)){"," this.hide();"," }"," },",""," /**"," Handles `hoveredItemChange` events.",""," @method _afterHoveredItemChange"," @param {EventFacade} e"," @protected"," **/"," _afterHoveredItemChange: function (e) {"," var newVal = e.newVal,"," prevVal = e.prevVal;",""," if (prevVal) {"," prevVal.removeClass(this[_CLASS_ITEM_HOVER]);"," }",""," if (newVal) {"," newVal.addClass(this[_CLASS_ITEM_HOVER]);"," }"," },",""," /**"," Handles `inputNode` blur events.",""," @method _afterListInputBlur"," @protected"," **/"," _afterListInputBlur: function () {"," this._listInputFocused = false;",""," if (this.get(VISIBLE) &&"," !this._mouseOverList &&"," (this._lastInputKey !== KEY_TAB ||"," !this.get('tabSelect') ||"," !this.get(ACTIVE_ITEM))) {"," this.hide();"," }"," },",""," /**"," Handles `inputNode` focus events.",""," @method _afterListInputFocus"," @protected"," **/"," _afterListInputFocus: function () {"," this._listInputFocused = true;"," },",""," /**"," Handles `mouseover` events.",""," @method _afterMouseOver"," @param {EventFacade} e"," @protected"," **/"," _afterMouseOver: function (e) {"," var itemNode = e.domEvent.target.ancestor(this[_SELECTOR_ITEM], true);",""," this._mouseOverList = true;",""," if (itemNode) {"," this._set(HOVERED_ITEM, itemNode);"," }"," },",""," /**"," Handles `mouseout` events.",""," @method _afterMouseOut"," @param {EventFacade} e"," @protected"," **/"," _afterMouseOut: function () {"," this._mouseOverList = false;"," this._set(HOVERED_ITEM, null);"," },",""," /**"," Handles `resultsChange` events.",""," @method _afterResultsChange"," @param {EventFacade} e"," @protected"," **/"," _afterResultsChange: function (e) {"," this._syncResults(e.newVal);",""," if (!this.get(ALWAYS_SHOW_LIST)) {"," this.set(VISIBLE, !!e.newVal.length);"," }"," },",""," /**"," Handles `visibleChange` events.",""," @method _afterVisibleChange"," @param {EventFacade} e"," @protected"," **/"," _afterVisibleChange: function (e) {"," this._syncVisibility(!!e.newVal);"," },",""," /**"," Delegated event handler for item `click` events.",""," @method _onItemClick"," @param {EventFacade} e"," @protected"," **/"," _onItemClick: function (e) {"," var itemNode = e.currentTarget;",""," this.set(ACTIVE_ITEM, itemNode);"," this.selectItem(itemNode, e);"," },",""," // -- Protected Default Event Handlers -------------------------------------",""," /**"," Default `select` event handler.",""," @method _defSelectFn"," @param {EventFacade} e"," @protected"," **/"," _defSelectFn: function (e) {"," var text = e.result.text;",""," // TODO: support typeahead completion, etc."," this._inputNode.focus();"," this._updateValue(text);"," this._ariaSay('item_selected', {item: text});"," this.hide();"," }","}, {"," ATTRS: {"," /**"," If `true`, the first item in the list will be activated by default when"," the list is initially displayed and when results change.",""," @attribute activateFirstItem"," @type Boolean"," @default false"," **/"," activateFirstItem: {"," value: false"," },",""," /**"," Item that's currently active, if any. When the user presses enter, this"," is the item that will be selected.",""," @attribute activeItem"," @type Node"," **/"," activeItem: {"," setter: Y.one,"," value: null"," },",""," /**"," If `true`, the list will remain visible even when there are no results"," to display.",""," @attribute alwaysShowList"," @type Boolean"," @default false"," **/"," alwaysShowList: {"," value: false"," },",""," /**"," If `true`, keyboard navigation will wrap around to the opposite end of"," the list when navigating past the first or last item.",""," @attribute circular"," @type Boolean"," @default true"," **/"," circular: {"," value: true"," },",""," /**"," Item currently being hovered over by the mouse, if any.",""," @attribute hoveredItem"," @type Node|null"," @readOnly"," **/"," hoveredItem: {"," readOnly: true,"," value: null"," },",""," /**"," Node that will contain result items.",""," @attribute listNode"," @type Node|null"," @initOnly"," **/"," listNode: {"," writeOnce: 'initOnly',"," value: null"," },",""," /**"," If `true`, the viewport will be scrolled to ensure that the active list"," item is visible when necessary.",""," @attribute scrollIntoView"," @type Boolean"," @default false"," **/"," scrollIntoView: {"," value: false"," },",""," /**"," Translatable strings used by the AutoCompleteList widget.",""," @attribute strings"," @type Object"," **/"," strings: {"," valueFn: function () {"," return Y.Intl.get('autocomplete-list');"," }"," },",""," /**"," If `true`, pressing the tab key while the list is visible will select"," the active item, if any.",""," @attribute tabSelect"," @type Boolean"," @default true"," **/"," tabSelect: {"," value: true"," },",""," // The \"visible\" attribute is documented in Widget."," visible: {"," value: false"," }"," },",""," CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')","});","","Y.AutoCompleteList = List;","","/**","Alias for <a href=\"AutoCompleteList.html\">`AutoCompleteList`</a>. See that class","for API docs.","","@class AutoComplete","**/","","Y.AutoComplete = List;","","","}, '3.7.2', {\"lang\": [\"en\"], \"requires\": [\"autocomplete-base\", \"event-resize\", \"node-screen\", \"selector-css3\", \"shim-plugin\", \"widget\", \"widget-position\", \"widget-position-align\"], \"skinnable\": true});"];+_yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].code=["YUI.add('autocomplete-list', function (Y, NAME) {","","/**","Traditional autocomplete dropdown list widget, just like Mom used to make.","","@module autocomplete","@submodule autocomplete-list","**/","","/**","Traditional autocomplete dropdown list widget, just like Mom used to make.","","@class AutoCompleteList","@extends Widget","@uses AutoCompleteBase","@uses WidgetPosition","@uses WidgetPositionAlign","@constructor","@param {Object} config Configuration object.","**/","","var Lang = Y.Lang,"," Node = Y.Node,"," YArray = Y.Array,",""," // Whether or not we need an iframe shim."," useShim = Y.UA.ie && Y.UA.ie < 7,",""," // keyCode constants."," KEY_TAB = 9,",""," // String shorthand."," _CLASS_ITEM = '_CLASS_ITEM',"," _CLASS_ITEM_ACTIVE = '_CLASS_ITEM_ACTIVE',"," _CLASS_ITEM_HOVER = '_CLASS_ITEM_HOVER',"," _SELECTOR_ITEM = '_SELECTOR_ITEM',",""," ACTIVE_ITEM = 'activeItem',"," ALWAYS_SHOW_LIST = 'alwaysShowList',"," CIRCULAR = 'circular',"," HOVERED_ITEM = 'hoveredItem',"," ID = 'id',"," ITEM = 'item',"," LIST = 'list',"," RESULT = 'result',"," RESULTS = 'results',"," VISIBLE = 'visible',"," WIDTH = 'width',",""," // Event names."," EVT_SELECT = 'select',","","List = Y.Base.create('autocompleteList', Y.Widget, ["," Y.AutoCompleteBase,"," Y.WidgetPosition,"," Y.WidgetPositionAlign","], {"," // -- Prototype Properties -------------------------------------------------"," ARIA_TEMPLATE: '<div/>',"," ITEM_TEMPLATE: '<li/>',"," LIST_TEMPLATE: '<ul/>',",""," // Widget automatically attaches delegated event handlers to everything in"," // Y.Node.DOM_EVENTS, including synthetic events. Since Widget's event"," // delegation won't work for the synthetic valuechange event, and since"," // it creates a name collision between the backcompat \"valueChange\" synth"," // event alias and AutoCompleteList's \"valueChange\" event for the \"value\""," // attr, this hack is necessary in order to prevent Widget from attaching"," // valuechange handlers."," UI_EVENTS: (function () {"," var uiEvents = Y.merge(Y.Node.DOM_EVENTS);",""," delete uiEvents.valuechange;"," delete uiEvents.valueChange;",""," return uiEvents;"," }()),",""," // -- Lifecycle Prototype Methods ------------------------------------------"," initializer: function () {"," var inputNode = this.get('inputNode');",""," if (!inputNode) {"," Y.error('No inputNode specified.');"," return;"," }",""," this._inputNode = inputNode;"," this._listEvents = [];",""," // This ensures that the list is rendered inside the same parent as the"," // input node by default, which is necessary for proper ARIA support."," this.DEF_PARENT_NODE = inputNode.get('parentNode');",""," // Cache commonly used classnames and selectors for performance."," this[_CLASS_ITEM] = this.getClassName(ITEM);"," this[_CLASS_ITEM_ACTIVE] = this.getClassName(ITEM, 'active');"," this[_CLASS_ITEM_HOVER] = this.getClassName(ITEM, 'hover');"," this[_SELECTOR_ITEM] = '.' + this[_CLASS_ITEM];",""," /**"," Fires when an autocomplete suggestion is selected from the list,"," typically via a keyboard action or mouse click.",""," @event select"," @param {Node} itemNode List item node that was selected."," @param {Object} result AutoComplete result object."," @preventable _defSelectFn"," **/"," this.publish(EVT_SELECT, {"," defaultFn: this._defSelectFn"," });"," },",""," destructor: function () {"," while (this._listEvents.length) {"," this._listEvents.pop().detach();"," }",""," if (this._ariaNode) {"," this._ariaNode.remove().destroy(true);"," }"," },",""," bindUI: function () {"," this._bindInput();"," this._bindList();"," },",""," renderUI: function () {"," var ariaNode = this._createAriaNode(),"," boundingBox = this.get('boundingBox'),"," contentBox = this.get('contentBox'),"," inputNode = this._inputNode,"," listNode = this._createListNode(),"," parentNode = inputNode.get('parentNode');",""," inputNode.addClass(this.getClassName('input')).setAttrs({"," 'aria-autocomplete': LIST,"," 'aria-expanded' : false,"," 'aria-owns' : listNode.get('id')"," });",""," // ARIA node must be outside the widget or announcements won't be made"," // when the widget is hidden."," parentNode.append(ariaNode);",""," // Add an iframe shim for IE6."," if (useShim) {"," boundingBox.plug(Y.Plugin.Shim);"," }",""," // Force position: absolute on the boundingBox. This works around a"," // potential CSS loading race condition in Gecko that can cause the"," // boundingBox to become relatively positioned, which is all kinds of"," // no good."," boundingBox.setStyle('position', 'absolute');",""," this._ariaNode = ariaNode;"," this._boundingBox = boundingBox;"," this._contentBox = contentBox;"," this._listNode = listNode;"," this._parentNode = parentNode;"," },",""," syncUI: function () {"," // No need to call _syncPosition() here; the other _sync methods will"," // call it when necessary."," this._syncResults();"," this._syncVisibility();"," },",""," // -- Public Prototype Methods ---------------------------------------------",""," /**"," Hides the list, unless the `alwaysShowList` attribute is `true`.",""," @method hide"," @see show"," @chainable"," **/"," hide: function () {"," return this.get(ALWAYS_SHOW_LIST) ? this : this.set(VISIBLE, false);"," },",""," /**"," Selects the specified _itemNode_, or the current `activeItem` if _itemNode_"," is not specified.",""," @method selectItem"," @param {Node} [itemNode] Item node to select."," @param {EventFacade} [originEvent] Event that triggered the selection, if"," any."," @chainable"," **/"," selectItem: function (itemNode, originEvent) {"," if (itemNode) {"," if (!itemNode.hasClass(this[_CLASS_ITEM])) {"," return this;"," }"," } else {"," itemNode = this.get(ACTIVE_ITEM);",""," if (!itemNode) {"," return this;"," }"," }",""," this.fire(EVT_SELECT, {"," itemNode : itemNode,"," originEvent: originEvent || null,"," result : itemNode.getData(RESULT)"," });",""," return this;"," },",""," // -- Protected Prototype Methods ------------------------------------------",""," /**"," Activates the next item after the currently active item. If there is no next"," item and the `circular` attribute is `true`, focus will wrap back to the"," input node.",""," @method _activateNextItem"," @chainable"," @protected"," **/"," _activateNextItem: function () {"," var item = this.get(ACTIVE_ITEM),"," nextItem;",""," if (item) {"," nextItem = item.next(this[_SELECTOR_ITEM]) ||"," (this.get(CIRCULAR) ? null : item);"," } else {"," nextItem = this._getFirstItemNode();"," }",""," this.set(ACTIVE_ITEM, nextItem);",""," return this;"," },",""," /**"," Activates the item previous to the currently active item. If there is no"," previous item and the `circular` attribute is `true`, focus will wrap back"," to the input node.",""," @method _activatePrevItem"," @chainable"," @protected"," **/"," _activatePrevItem: function () {"," var item = this.get(ACTIVE_ITEM),"," prevItem = item ? item.previous(this[_SELECTOR_ITEM]) :"," this.get(CIRCULAR) && this._getLastItemNode();",""," this.set(ACTIVE_ITEM, prevItem || null);",""," return this;"," },",""," /**"," Appends the specified result _items_ to the list inside a new item node.",""," @method _add"," @param {Array|Node|HTMLElement|String} items Result item or array of"," result items."," @return {NodeList} Added nodes."," @protected"," **/"," _add: function (items) {"," var itemNodes = [];",""," YArray.each(Lang.isArray(items) ? items : [items], function (item) {"," itemNodes.push(this._createItemNode(item).setData(RESULT, item));"," }, this);",""," itemNodes = Y.all(itemNodes);"," this._listNode.append(itemNodes.toFrag());",""," return itemNodes;"," },",""," /**"," Updates the ARIA live region with the specified message.",""," @method _ariaSay"," @param {String} stringId String id (from the `strings` attribute) of the"," message to speak."," @param {Object} [subs] Substitutions for placeholders in the string."," @protected"," **/"," _ariaSay: function (stringId, subs) {"," var message = this.get('strings.' + stringId);"," this._ariaNode.set('text', subs ? Lang.sub(message, subs) : message);"," },",""," /**"," Binds `inputNode` events and behavior.",""," @method _bindInput"," @protected"," **/"," _bindInput: function () {"," var inputNode = this._inputNode,"," alignNode, alignWidth, tokenInput;",""," // Null align means we can auto-align. Set align to false to prevent"," // auto-alignment, or a valid alignment config to customize the"," // alignment."," if (this.get('align') === null) {"," // If this is a tokenInput, align with its bounding box."," // Otherwise, align with the inputNode. Bit of a cheat."," tokenInput = this.get('tokenInput');"," alignNode = (tokenInput && tokenInput.get('boundingBox')) || inputNode;",""," this.set('align', {"," node : alignNode,"," points: ['tl', 'bl']"," });",""," // If no width config is set, attempt to set the list's width to the"," // width of the alignment node. If the alignment node's width is"," // falsy, do nothing."," if (!this.get(WIDTH) && (alignWidth = alignNode.get('offsetWidth'))) {"," this.set(WIDTH, alignWidth);"," }"," }",""," // Attach inputNode events."," this._listEvents = this._listEvents.concat(["," inputNode.after('blur', this._afterListInputBlur, this),"," inputNode.after('focus', this._afterListInputFocus, this)"," ]);"," },",""," /**"," Binds list events.",""," @method _bindList"," @protected"," **/"," _bindList: function () {"," this._listEvents = this._listEvents.concat(["," Y.one('doc').after('click', this._afterDocClick, this),"," Y.one('win').after('windowresize', this._syncPosition, this),",""," this.after({"," mouseover: this._afterMouseOver,"," mouseout : this._afterMouseOut,",""," activeItemChange : this._afterActiveItemChange,"," alwaysShowListChange: this._afterAlwaysShowListChange,"," hoveredItemChange : this._afterHoveredItemChange,"," resultsChange : this._afterResultsChange,"," visibleChange : this._afterVisibleChange"," }),",""," this._listNode.delegate('click', this._onItemClick,"," this[_SELECTOR_ITEM], this)"," ]);"," },",""," /**"," Clears the contents of the tray.",""," @method _clear"," @protected"," **/"," _clear: function () {"," this.set(ACTIVE_ITEM, null);"," this._set(HOVERED_ITEM, null);",""," this._listNode.get('children').remove(true);"," },",""," /**"," Creates and returns an ARIA live region node.",""," @method _createAriaNode"," @return {Node} ARIA node."," @protected"," **/"," _createAriaNode: function () {"," var ariaNode = Node.create(this.ARIA_TEMPLATE);",""," return ariaNode.addClass(this.getClassName('aria')).setAttrs({"," 'aria-live': 'polite',"," role : 'status'"," });"," },",""," /**"," Creates and returns an item node with the specified _content_.",""," @method _createItemNode"," @param {Object} result Result object."," @return {Node} Item node."," @protected"," **/"," _createItemNode: function (result) {"," var itemNode = Node.create(this.ITEM_TEMPLATE);",""," return itemNode.addClass(this[_CLASS_ITEM]).setAttrs({"," id : Y.stamp(itemNode),"," role: 'option'"," }).setAttribute('data-text', result.text).append(result.display);"," },",""," /**"," Creates and returns a list node. If the `listNode` attribute is already set"," to an existing node, that node will be used.",""," @method _createListNode"," @return {Node} List node."," @protected"," **/"," _createListNode: function () {"," var listNode = this.get('listNode') || Node.create(this.LIST_TEMPLATE);",""," listNode.addClass(this.getClassName(LIST)).setAttrs({"," id : Y.stamp(listNode),"," role: 'listbox'"," });",""," this._set('listNode', listNode);"," this.get('contentBox').append(listNode);",""," return listNode;"," },",""," /**"," Gets the first item node in the list, or `null` if the list is empty.",""," @method _getFirstItemNode"," @return {Node|null}"," @protected"," **/"," _getFirstItemNode: function () {"," return this._listNode.one(this[_SELECTOR_ITEM]);"," },",""," /**"," Gets the last item node in the list, or `null` if the list is empty.",""," @method _getLastItemNode"," @return {Node|null}"," @protected"," **/"," _getLastItemNode: function () {"," return this._listNode.one(this[_SELECTOR_ITEM] + ':last-child');"," },",""," /**"," Synchronizes the result list's position and alignment.",""," @method _syncPosition"," @protected"," **/"," _syncPosition: function () {"," // Force WidgetPositionAlign to refresh its alignment."," this._syncUIPosAlign();",""," // Resize the IE6 iframe shim to match the list's dimensions."," this._syncShim();"," },",""," /**"," Synchronizes the results displayed in the list with those in the _results_"," argument, or with the `results` attribute if an argument is not provided.",""," @method _syncResults"," @param {Array} [results] Results."," @protected"," **/"," _syncResults: function (results) {"," if (!results) {"," results = this.get(RESULTS);"," }",""," this._clear();",""," if (results.length) {"," this._add(results);"," this._ariaSay('items_available');"," }",""," this._syncPosition();",""," if (this.get('activateFirstItem') && !this.get(ACTIVE_ITEM)) {"," this.set(ACTIVE_ITEM, this._getFirstItemNode());"," }"," },",""," /**"," Synchronizes the size of the iframe shim used for IE6 and lower. In other"," browsers, this method is a noop.",""," @method _syncShim"," @protected"," **/"," _syncShim: useShim ? function () {"," var shim = this._boundingBox.shim;",""," if (shim) {"," shim.sync();"," }"," } : function () {},",""," /**"," Synchronizes the visibility of the tray with the _visible_ argument, or with"," the `visible` attribute if an argument is not provided.",""," @method _syncVisibility"," @param {Boolean} [visible] Visibility."," @protected"," **/"," _syncVisibility: function (visible) {"," if (this.get(ALWAYS_SHOW_LIST)) {"," visible = true;"," this.set(VISIBLE, visible);"," }",""," if (typeof visible === 'undefined') {"," visible = this.get(VISIBLE);"," }",""," this._inputNode.set('aria-expanded', visible);"," this._boundingBox.set('aria-hidden', !visible);",""," if (visible) {"," this._syncPosition();"," } else {"," this.set(ACTIVE_ITEM, null);"," this._set(HOVERED_ITEM, null);",""," // Force a reflow to work around a glitch in IE6 and 7 where some of"," // the contents of the list will sometimes remain visible after the"," // container is hidden."," this._boundingBox.get('offsetWidth');"," }",""," // In some pages, IE7 fails to repaint the contents of the list after it"," // becomes visible. Toggling a bogus class on the body forces a repaint"," // that fixes the issue."," if (Y.UA.ie === 7) {"," // Note: We don't actually need to use ClassNameManager here. This"," // class isn't applying any actual styles; it's just frobbing the"," // body element to force a repaint. The actual class name doesn't"," // really matter."," Y.one('body')"," .addClass('yui3-ie7-sucks')"," .removeClass('yui3-ie7-sucks');"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `activeItemChange` events.",""," @method _afterActiveItemChange"," @param {EventFacade} e"," @protected"," **/"," _afterActiveItemChange: function (e) {"," var inputNode = this._inputNode,"," newVal = e.newVal,"," prevVal = e.prevVal,"," node;",""," // The previous item may have disappeared by the time this handler runs,"," // so we need to be careful."," if (prevVal && prevVal._node) {"," prevVal.removeClass(this[_CLASS_ITEM_ACTIVE]);"," }",""," if (newVal) {"," newVal.addClass(this[_CLASS_ITEM_ACTIVE]);"," inputNode.set('aria-activedescendant', newVal.get(ID));"," } else {"," inputNode.removeAttribute('aria-activedescendant');"," }",""," if (this.get('scrollIntoView')) {"," node = newVal || inputNode;",""," if (!node.inRegion(Y.DOM.viewportRegion(), true)"," || !node.inRegion(this._contentBox, true)) {",""," node.scrollIntoView();"," }"," }"," },",""," /**"," Handles `alwaysShowListChange` events.",""," @method _afterAlwaysShowListChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlwaysShowListChange: function (e) {"," this.set(VISIBLE, e.newVal || this.get(RESULTS).length > 0);"," },",""," /**"," Handles click events on the document. If the click is outside both the"," input node and the bounding box, the list will be hidden.",""," @method _afterDocClick"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDocClick: function (e) {"," var boundingBox = this._boundingBox,"," target = e.target;",""," if(target !== this._inputNode && target !== boundingBox &&"," target.ancestor('#' + boundingBox.get('id'), true)){"," this.hide();"," }"," },",""," /**"," Handles `hoveredItemChange` events.",""," @method _afterHoveredItemChange"," @param {EventFacade} e"," @protected"," **/"," _afterHoveredItemChange: function (e) {"," var newVal = e.newVal,"," prevVal = e.prevVal;",""," if (prevVal) {"," prevVal.removeClass(this[_CLASS_ITEM_HOVER]);"," }",""," if (newVal) {"," newVal.addClass(this[_CLASS_ITEM_HOVER]);"," }"," },",""," /**"," Handles `inputNode` blur events.",""," @method _afterListInputBlur"," @protected"," **/"," _afterListInputBlur: function () {"," this._listInputFocused = false;",""," if (this.get(VISIBLE) &&"," !this._mouseOverList &&"," (this._lastInputKey !== KEY_TAB ||"," !this.get('tabSelect') ||"," !this.get(ACTIVE_ITEM))) {"," this.hide();"," }"," },",""," /**"," Handles `inputNode` focus events.",""," @method _afterListInputFocus"," @protected"," **/"," _afterListInputFocus: function () {"," this._listInputFocused = true;"," },",""," /**"," Handles `mouseover` events.",""," @method _afterMouseOver"," @param {EventFacade} e"," @protected"," **/"," _afterMouseOver: function (e) {"," var itemNode = e.domEvent.target.ancestor(this[_SELECTOR_ITEM], true);",""," this._mouseOverList = true;",""," if (itemNode) {"," this._set(HOVERED_ITEM, itemNode);"," }"," },",""," /**"," Handles `mouseout` events.",""," @method _afterMouseOut"," @param {EventFacade} e"," @protected"," **/"," _afterMouseOut: function () {"," this._mouseOverList = false;"," this._set(HOVERED_ITEM, null);"," },",""," /**"," Handles `resultsChange` events.",""," @method _afterResultsChange"," @param {EventFacade} e"," @protected"," **/"," _afterResultsChange: function (e) {"," this._syncResults(e.newVal);",""," if (!this.get(ALWAYS_SHOW_LIST)) {"," this.set(VISIBLE, !!e.newVal.length);"," }"," },",""," /**"," Handles `visibleChange` events.",""," @method _afterVisibleChange"," @param {EventFacade} e"," @protected"," **/"," _afterVisibleChange: function (e) {"," this._syncVisibility(!!e.newVal);"," },",""," /**"," Delegated event handler for item `click` events.",""," @method _onItemClick"," @param {EventFacade} e"," @protected"," **/"," _onItemClick: function (e) {"," var itemNode = e.currentTarget;",""," this.set(ACTIVE_ITEM, itemNode);"," this.selectItem(itemNode, e);"," },",""," // -- Protected Default Event Handlers -------------------------------------",""," /**"," Default `select` event handler.",""," @method _defSelectFn"," @param {EventFacade} e"," @protected"," **/"," _defSelectFn: function (e) {"," var text = e.result.text;",""," // TODO: support typeahead completion, etc."," this._inputNode.focus();"," this._updateValue(text);"," this._ariaSay('item_selected', {item: text});"," this.hide();"," }","}, {"," ATTRS: {"," /**"," If `true`, the first item in the list will be activated by default when"," the list is initially displayed and when results change.",""," @attribute activateFirstItem"," @type Boolean"," @default false"," **/"," activateFirstItem: {"," value: false"," },",""," /**"," Item that's currently active, if any. When the user presses enter, this"," is the item that will be selected.",""," @attribute activeItem"," @type Node"," **/"," activeItem: {"," setter: Y.one,"," value: null"," },",""," /**"," If `true`, the list will remain visible even when there are no results"," to display.",""," @attribute alwaysShowList"," @type Boolean"," @default false"," **/"," alwaysShowList: {"," value: false"," },",""," /**"," If `true`, keyboard navigation will wrap around to the opposite end of"," the list when navigating past the first or last item.",""," @attribute circular"," @type Boolean"," @default true"," **/"," circular: {"," value: true"," },",""," /**"," Item currently being hovered over by the mouse, if any.",""," @attribute hoveredItem"," @type Node|null"," @readOnly"," **/"," hoveredItem: {"," readOnly: true,"," value: null"," },",""," /**"," Node that will contain result items.",""," @attribute listNode"," @type Node|null"," @initOnly"," **/"," listNode: {"," writeOnce: 'initOnly',"," value: null"," },",""," /**"," If `true`, the viewport will be scrolled to ensure that the active list"," item is visible when necessary.",""," @attribute scrollIntoView"," @type Boolean"," @default false"," **/"," scrollIntoView: {"," value: false"," },",""," /**"," Translatable strings used by the AutoCompleteList widget.",""," @attribute strings"," @type Object"," **/"," strings: {"," valueFn: function () {"," return Y.Intl.get('autocomplete-list');"," }"," },",""," /**"," If `true`, pressing the tab key while the list is visible will select"," the active item, if any.",""," @attribute tabSelect"," @type Boolean"," @default true"," **/"," tabSelect: {"," value: true"," },",""," // The \"visible\" attribute is documented in Widget."," visible: {"," value: false"," }"," },",""," CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')","});","","Y.AutoCompleteList = List;","","/**","Alias for <a href=\"AutoCompleteList.html\">`AutoCompleteList`</a>. See that class","for API docs.","","@class AutoComplete","**/","","Y.AutoComplete = List;","","","}, '3.7.3', {\"lang\": [\"en\"], \"requires\": [\"autocomplete-base\", \"event-resize\", \"node-screen\", \"selector-css3\", \"shim-plugin\", \"widget\", \"widget-position\", \"widget-position-align\"], \"skinnable\": true});"]; _yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].lines = {"1":0,"22":0,"71":0,"73":0,"74":0,"76":0,"81":0,"83":0,"84":0,"85":0,"88":0,"89":0,"93":0,"96":0,"97":0,"98":0,"99":0,"110":0,"116":0,"117":0,"120":0,"121":0,"126":0,"127":0,"131":0,"138":0,"146":0,"149":0,"150":0,"157":0,"159":0,"160":0,"161":0,"162":0,"163":0,"169":0,"170":0,"183":0,"197":0,"198":0,"199":0,"202":0,"204":0,"205":0,"209":0,"215":0,"230":0,"233":0,"234":0,"237":0,"240":0,"242":0,"255":0,"259":0,"261":0,"274":0,"276":0,"277":0,"280":0,"281":0,"283":0,"296":0,"297":0,"307":0,"313":0,"316":0,"317":0,"319":0,"327":0,"328":0,"333":0,"346":0,"373":0,"374":0,"376":0,"387":0,"389":0,"404":0,"406":0,"421":0,"423":0,"428":0,"429":0,"431":0,"442":0,"453":0,"464":0,"467":0,"479":0,"480":0,"483":0,"485":0,"486":0,"487":0,"490":0,"492":0,"493":0,"505":0,"507":0,"508":0,"521":0,"522":0,"523":0,"526":0,"527":0,"530":0,"531":0,"533":0,"534":0,"536":0,"537":0,"542":0,"548":0,"553":0,"569":0,"576":0,"577":0,"580":0,"581":0,"582":0,"584":0,"587":0,"588":0,"590":0,"593":0,"606":0,"619":0,"622":0,"624":0,"636":0,"639":0,"640":0,"643":0,"644":0,"655":0,"657":0,"662":0,"673":0,"684":0,"686":0,"688":0,"689":0,"701":0,"702":0,"713":0,"715":0,"716":0,"728":0,"739":0,"741":0,"742":0,"755":0,"758":0,"759":0,"760":0,"761":0,"857":0,"882":0,"891":0}; _yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].functions = {"(anonymous 2):70":0,"initializer:80":0,"destructor:115":0,"bindUI:125":0,"renderUI:130":0,"syncUI:166":0,"hide:182":0,"selectItem:196":0,"_activateNextItem:229":0,"_activatePrevItem:254":0,"(anonymous 3):276":0,"_add:273":0,"_ariaSay:295":0,"_bindInput:306":0,"_bindList:345":0,"_clear:372":0,"_createAriaNode:386":0,"_createItemNode:403":0,"_createListNode:420":0,"_getFirstItemNode:441":0,"_getLastItemNode:452":0,"_syncPosition:462":0,"_syncResults:478":0,"(anonymous 4):504":0,"_syncVisibility:520":0,"_afterActiveItemChange:568":0,"_afterAlwaysShowListChange:605":0,"_afterDocClick:618":0,"_afterHoveredItemChange:635":0,"_afterListInputBlur:654":0,"_afterListInputFocus:672":0,"_afterMouseOver:683":0,"_afterMouseOut:700":0,"_afterResultsChange:712":0,"_afterVisibleChange:727":0,"_onItemClick:738":0,"_defSelectFn:754":0,"valueFn:856":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-list/autocomplete-list.js"].coveredLines = 159;@@ -1128,4 +1128,4 @@ Y.AutoComplete = List; -}, '3.7.2', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});+}, '3.7.3', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});
bundle/autocomplete-list/autocomplete-list-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -897,4 +897,4 @@ Y.AutoComplete = List; -}, '3.7.2', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});+}, '3.7.3', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});
bundle/autocomplete-list/autocomplete-list-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-list",function(e,t){var n=e.Lang,r=e.Node,i=e.Array,s=e.UA.ie&&e.UA.ie<7,o=9,u="_CLASS_ITEM",a="_CLASS_ITEM_ACTIVE",f="_CLASS_ITEM_HOVER",l="_SELECTOR_ITEM",c="activeItem",h="alwaysShowList",p="circular",d="hoveredItem",v="id",m="item",g="list",y="result",b="results",w="visible",E="width",S="select",x=e.Base.create("autocompleteList",e.Widget,[e.AutoCompleteBase,e.WidgetPosition,e.WidgetPositionAlign],{ARIA_TEMPLATE:"<div/>",ITEM_TEMPLATE:"<li/>",LIST_TEMPLATE:"<ul/>",UI_EVENTS:function(){var t=e.merge(e.Node.DOM_EVENTS);return delete t.valuechange,delete t.valueChange,t}(),initializer:function(){var t=this.get("inputNode");if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._listEvents=[],this.DEF_PARENT_NODE=t.get("parentNode"),this[u]=this.getClassName(m),this[a]=this.getClassName(m,"active"),this[f]=this.getClassName(m,"hover"),this[l]="."+this[u],this.publish(S,{defaultFn:this._defSelectFn})},destructor:function(){while(this._listEvents.length)this._listEvents.pop().detach();this._ariaNode&&this._ariaNode.remove().destroy(!0)},bindUI:function(){this._bindInput(),this._bindList()},renderUI:function(){var t=this._createAriaNode(),n=this.get("boundingBox"),r=this.get("contentBox"),i=this._inputNode,o=this._createListNode(),u=i.get("parentNode");i.addClass(this.getClassName("input")).setAttrs({"aria-autocomplete":g,"aria-expanded":!1,"aria-owns":o.get("id")}),u.append(t),s&&n.plug(e.Plugin.Shim),n.setStyle("position","absolute"),this._ariaNode=t,this._boundingBox=n,this._contentBox=r,this._listNode=o,this._parentNode=u},syncUI:function(){this._syncResults(),this._syncVisibility()},hide:function(){return this.get(h)?this:this.set(w,!1)},selectItem:function(e,t){if(e){if(!e.hasClass(this[u]))return this}else{e=this.get(c);if(!e)return this}return this.fire(S,{itemNode:e,originEvent:t||null,result:e.getData(y)}),this},_activateNextItem:function(){var e=this.get(c),t;return e?t=e.next(this[l])||(this.get(p)?null:e):t=this._getFirstItemNode(),this.set(c,t),this},_activatePrevItem:function(){var e=this.get(c),t=e?e.previous(this[l]):this.get(p)&&this._getLastItemNode();return this.set(c,t||null),this},_add:function(t){var r=[];return i.each(n.isArray(t)?t:[t],function(e){r.push(this._createItemNode(e).setData(y,e))},this),r=e.all(r),this._listNode.append(r.toFrag()),r},_ariaSay:function(e,t){var r=this.get("strings."+e);this._ariaNode.set("text",t?n.sub(r,t):r)},_bindInput:function(){var e=this._inputNode,t,n,r;this.get("align")===null&&(r=this.get("tokenInput"),t=r&&r.get("boundingBox")||e,this.set("align",{node:t,points:["tl","bl"]}),!this.get(E)&&(n=t.get("offsetWidth"))&&this.set(E,n)),this._listEvents=this._listEvents.concat([e.after("blur",this._afterListInputBlur,this),e.after("focus",this._afterListInputFocus,this)])},_bindList:function(){this._listEvents=this._listEvents.concat([e.one("doc").after("click",this._afterDocClick,this),e.one("win").after("windowresize",this._syncPosition,this),this.after({mouseover:this._afterMouseOver,mouseout:this._afterMouseOut,activeItemChange:this._afterActiveItemChange,alwaysShowListChange:this._afterAlwaysShowListChange,hoveredItemChange:this._afterHoveredItemChange,resultsChange:this._afterResultsChange,visibleChange:this._afterVisibleChange}),this._listNode.delegate("click",this._onItemClick,this[l],this)])},_clear:function(){this.set(c,null),this._set(d,null),this._listNode.get("children").remove(!0)},_createAriaNode:function(){var e=r.create(this.ARIA_TEMPLATE);return e.addClass(this.getClassName("aria")).setAttrs({"aria-live":"polite",role:"status"})},_createItemNode:function(t){var n=r.create(this.ITEM_TEMPLATE);return n.addClass(this[u]).setAttrs({id:e.stamp(n),role:"option"}).setAttribute("data-text",t.text).append(t.display)},_createListNode:function(){var t=this.get("listNode")||r.create(this.LIST_TEMPLATE);return t.addClass(this.getClassName(g)).setAttrs({id:e.stamp(t),role:"listbox"}),this._set("listNode",t),this.get("contentBox").append(t),t},_getFirstItemNode:function(){return this._listNode.one(this[l])},_getLastItemNode:function(){return this._listNode.one(this[l]+":last-child")},_syncPosition:function(){this._syncUIPosAlign(),this._syncShim()},_syncResults:function(e){e||(e=this.get(b)),this._clear(),e.length&&(this._add(e),this._ariaSay("items_available")),this._syncPosition(),this.get("activateFirstItem")&&!this.get(c)&&this.set(c,this._getFirstItemNode())},_syncShim:s?function(){var e=this._boundingBox.shim;e&&e.sync()}:function(){},_syncVisibility:function(t){this.get(h)&&(t=!0,this.set(w,t)),typeof t=="undefined"&&(t=this.get(w)),this._inputNode.set("aria-expanded",t),this._boundingBox.set("aria-hidden",!t),t?this._syncPosition():(this.set(c,null),this._set(d,null),this._boundingBox.get("offsetWidth")),e.UA.ie===7&&e.one("body").addClass("yui3-ie7-sucks").removeClass("yui3-ie7-sucks")},_afterActiveItemChange:function(t){var n=this._inputNode,r=t.newVal,i=t.prevVal,s;i&&i._node&&i.removeClass(this[a]),r?(r.addClass(this[a]),n.set("aria-activedescendant",r.get(v))):n.removeAttribute("aria-activedescendant"),this.get("scrollIntoView")&&(s=r||n,(!s.inRegion(e.DOM.viewportRegion(),!0)||!s.inRegion(this._contentBox,!0))&&s.scrollIntoView())},_afterAlwaysShowListChange:function(e){this.set(w,e.newVal||this.get(b).length>0)},_afterDocClick:function(e){var t=this._boundingBox,n=e.target;n!==this._inputNode&&n!==t&&n.ancestor("#"+t.get("id"),!0)&&this.hide()},_afterHoveredItemChange:function(e){var t=e.newVal,n=e.prevVal;n&&n.removeClass(this[f]),t&&t.addClass(this[f])},_afterListInputBlur:function(){this._listInputFocused=!1,this.get(w)&&!this._mouseOverList&&(this._lastInputKey!==o||!this.get("tabSelect")||!this.get(c))&&this.hide()},_afterListInputFocus:function(){this._listInputFocused=!0},_afterMouseOver:function(e){var t=e.domEvent.target.ancestor(this[l],!0);this._mouseOverList=!0,t&&this._set(d,t)},_afterMouseOut:function(){this._mouseOverList=!1,this._set(d,null)},_afterResultsChange:function(e){this._syncResults(e.newVal),this.get(h)||this.set(w,!!e.newVal.length)},_afterVisibleChange:function(e){this._syncVisibility(!!e.newVal)},_onItemClick:function(e){var t=e.currentTarget;this.set(c,t),this.selectItem(t,e)},_defSelectFn:function(e){var t=e.result.text;this._inputNode.focus(),this._updateValue(t),this._ariaSay("item_selected",{item:t}),this.hide()}},{ATTRS:{activateFirstItem:{value:!1},activeItem:{setter:e.one,value:null},alwaysShowList:{value:!1},circular:{value:!0},hoveredItem:{readOnly:!0,value:null},listNode:{writeOnce:"initOnly",value:null},scrollIntoView:{value:!1},strings:{valueFn:function(){return e.Intl.get("autocomplete-list")}},tabSelect:{value:!0},visible:{value:!1}},CSS_PREFIX:e.ClassNameManager.getClassName("aclist")});e.AutoCompleteList=x,e.AutoComplete=x},"3.7.2",{lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0});+YUI.add("autocomplete-list",function(e,t){var n=e.Lang,r=e.Node,i=e.Array,s=e.UA.ie&&e.UA.ie<7,o=9,u="_CLASS_ITEM",a="_CLASS_ITEM_ACTIVE",f="_CLASS_ITEM_HOVER",l="_SELECTOR_ITEM",c="activeItem",h="alwaysShowList",p="circular",d="hoveredItem",v="id",m="item",g="list",y="result",b="results",w="visible",E="width",S="select",x=e.Base.create("autocompleteList",e.Widget,[e.AutoCompleteBase,e.WidgetPosition,e.WidgetPositionAlign],{ARIA_TEMPLATE:"<div/>",ITEM_TEMPLATE:"<li/>",LIST_TEMPLATE:"<ul/>",UI_EVENTS:function(){var t=e.merge(e.Node.DOM_EVENTS);return delete t.valuechange,delete t.valueChange,t}(),initializer:function(){var t=this.get("inputNode");if(!t){e.error("No inputNode specified.");return}this._inputNode=t,this._listEvents=[],this.DEF_PARENT_NODE=t.get("parentNode"),this[u]=this.getClassName(m),this[a]=this.getClassName(m,"active"),this[f]=this.getClassName(m,"hover"),this[l]="."+this[u],this.publish(S,{defaultFn:this._defSelectFn})},destructor:function(){while(this._listEvents.length)this._listEvents.pop().detach();this._ariaNode&&this._ariaNode.remove().destroy(!0)},bindUI:function(){this._bindInput(),this._bindList()},renderUI:function(){var t=this._createAriaNode(),n=this.get("boundingBox"),r=this.get("contentBox"),i=this._inputNode,o=this._createListNode(),u=i.get("parentNode");i.addClass(this.getClassName("input")).setAttrs({"aria-autocomplete":g,"aria-expanded":!1,"aria-owns":o.get("id")}),u.append(t),s&&n.plug(e.Plugin.Shim),n.setStyle("position","absolute"),this._ariaNode=t,this._boundingBox=n,this._contentBox=r,this._listNode=o,this._parentNode=u},syncUI:function(){this._syncResults(),this._syncVisibility()},hide:function(){return this.get(h)?this:this.set(w,!1)},selectItem:function(e,t){if(e){if(!e.hasClass(this[u]))return this}else{e=this.get(c);if(!e)return this}return this.fire(S,{itemNode:e,originEvent:t||null,result:e.getData(y)}),this},_activateNextItem:function(){var e=this.get(c),t;return e?t=e.next(this[l])||(this.get(p)?null:e):t=this._getFirstItemNode(),this.set(c,t),this},_activatePrevItem:function(){var e=this.get(c),t=e?e.previous(this[l]):this.get(p)&&this._getLastItemNode();return this.set(c,t||null),this},_add:function(t){var r=[];return i.each(n.isArray(t)?t:[t],function(e){r.push(this._createItemNode(e).setData(y,e))},this),r=e.all(r),this._listNode.append(r.toFrag()),r},_ariaSay:function(e,t){var r=this.get("strings."+e);this._ariaNode.set("text",t?n.sub(r,t):r)},_bindInput:function(){var e=this._inputNode,t,n,r;this.get("align")===null&&(r=this.get("tokenInput"),t=r&&r.get("boundingBox")||e,this.set("align",{node:t,points:["tl","bl"]}),!this.get(E)&&(n=t.get("offsetWidth"))&&this.set(E,n)),this._listEvents=this._listEvents.concat([e.after("blur",this._afterListInputBlur,this),e.after("focus",this._afterListInputFocus,this)])},_bindList:function(){this._listEvents=this._listEvents.concat([e.one("doc").after("click",this._afterDocClick,this),e.one("win").after("windowresize",this._syncPosition,this),this.after({mouseover:this._afterMouseOver,mouseout:this._afterMouseOut,activeItemChange:this._afterActiveItemChange,alwaysShowListChange:this._afterAlwaysShowListChange,hoveredItemChange:this._afterHoveredItemChange,resultsChange:this._afterResultsChange,visibleChange:this._afterVisibleChange}),this._listNode.delegate("click",this._onItemClick,this[l],this)])},_clear:function(){this.set(c,null),this._set(d,null),this._listNode.get("children").remove(!0)},_createAriaNode:function(){var e=r.create(this.ARIA_TEMPLATE);return e.addClass(this.getClassName("aria")).setAttrs({"aria-live":"polite",role:"status"})},_createItemNode:function(t){var n=r.create(this.ITEM_TEMPLATE);return n.addClass(this[u]).setAttrs({id:e.stamp(n),role:"option"}).setAttribute("data-text",t.text).append(t.display)},_createListNode:function(){var t=this.get("listNode")||r.create(this.LIST_TEMPLATE);return t.addClass(this.getClassName(g)).setAttrs({id:e.stamp(t),role:"listbox"}),this._set("listNode",t),this.get("contentBox").append(t),t},_getFirstItemNode:function(){return this._listNode.one(this[l])},_getLastItemNode:function(){return this._listNode.one(this[l]+":last-child")},_syncPosition:function(){this._syncUIPosAlign(),this._syncShim()},_syncResults:function(e){e||(e=this.get(b)),this._clear(),e.length&&(this._add(e),this._ariaSay("items_available")),this._syncPosition(),this.get("activateFirstItem")&&!this.get(c)&&this.set(c,this._getFirstItemNode())},_syncShim:s?function(){var e=this._boundingBox.shim;e&&e.sync()}:function(){},_syncVisibility:function(t){this.get(h)&&(t=!0,this.set(w,t)),typeof t=="undefined"&&(t=this.get(w)),this._inputNode.set("aria-expanded",t),this._boundingBox.set("aria-hidden",!t),t?this._syncPosition():(this.set(c,null),this._set(d,null),this._boundingBox.get("offsetWidth")),e.UA.ie===7&&e.one("body").addClass("yui3-ie7-sucks").removeClass("yui3-ie7-sucks")},_afterActiveItemChange:function(t){var n=this._inputNode,r=t.newVal,i=t.prevVal,s;i&&i._node&&i.removeClass(this[a]),r?(r.addClass(this[a]),n.set("aria-activedescendant",r.get(v))):n.removeAttribute("aria-activedescendant"),this.get("scrollIntoView")&&(s=r||n,(!s.inRegion(e.DOM.viewportRegion(),!0)||!s.inRegion(this._contentBox,!0))&&s.scrollIntoView())},_afterAlwaysShowListChange:function(e){this.set(w,e.newVal||this.get(b).length>0)},_afterDocClick:function(e){var t=this._boundingBox,n=e.target;n!==this._inputNode&&n!==t&&n.ancestor("#"+t.get("id"),!0)&&this.hide()},_afterHoveredItemChange:function(e){var t=e.newVal,n=e.prevVal;n&&n.removeClass(this[f]),t&&t.addClass(this[f])},_afterListInputBlur:function(){this._listInputFocused=!1,this.get(w)&&!this._mouseOverList&&(this._lastInputKey!==o||!this.get("tabSelect")||!this.get(c))&&this.hide()},_afterListInputFocus:function(){this._listInputFocused=!0},_afterMouseOver:function(e){var t=e.domEvent.target.ancestor(this[l],!0);this._mouseOverList=!0,t&&this._set(d,t)},_afterMouseOut:function(){this._mouseOverList=!1,this._set(d,null)},_afterResultsChange:function(e){this._syncResults(e.newVal),this.get(h)||this.set(w,!!e.newVal.length)},_afterVisibleChange:function(e){this._syncVisibility(!!e.newVal)},_onItemClick:function(e){var t=e.currentTarget;this.set(c,t),this.selectItem(t,e)},_defSelectFn:function(e){var t=e.result.text;this._inputNode.focus(),this._updateValue(t),this._ariaSay("item_selected",{item:t}),this.hide()}},{ATTRS:{activateFirstItem:{value:!1},activeItem:{setter:e.one,value:null},alwaysShowList:{value:!1},circular:{value:!0},hoveredItem:{readOnly:!0,value:null},listNode:{writeOnce:"initOnly",value:null},scrollIntoView:{value:!1},strings:{valueFn:function(){return e.Intl.get("autocomplete-list")}},tabSelect:{value:!0},visible:{value:!1}},CSS_PREFIX:e.ClassNameManager.getClassName("aclist")});e.AutoCompleteList=x,e.AutoComplete=x},"3.7.3",{lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0});
bundle/autocomplete-list/autocomplete-list.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -897,4 +897,4 @@ Y.AutoComplete = List; -}, '3.7.2', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});+}, '3.7.3', {"lang": ["en"], "requires": ["autocomplete-base", "event-resize", "node-screen", "selector-css3", "shim-plugin", "widget", "widget-position", "widget-position-align"], "skinnable": true});
bundle/autocomplete-list/lang/autocomplete-list.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/autocomplete-list",function(e){e.Intl.add("autocomplete-list","",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use the up and down arrow keys to select suggestions."})},"3.7.2");+YUI.add("lang/autocomplete-list",function(e){e.Intl.add("autocomplete-list","",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use the up and down arrow keys to select suggestions."})},"3.7.3");
bundle/autocomplete-list/lang/autocomplete-list_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/autocomplete-list_en",function(e){e.Intl.add("autocomplete-list","en",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use up and down arrows to select."})},"3.7.2");+YUI.add("lang/autocomplete-list_en",function(e){e.Intl.add("autocomplete-list","en",{item_selected:"{item} selected.",items_available:"Suggestions are available. Use up and down arrows to select."})},"3.7.3");
bundle/autocomplete-plugin/autocomplete-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-plugin/autocomplete-plugin.js", code: [] };-_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].code=["YUI.add('autocomplete-plugin', function (Y, NAME) {","","/**","Binds an AutoCompleteList instance to a Node instance.","","@module autocomplete","@submodule autocomplete-plugin","**/","","/**","Binds an AutoCompleteList instance to a Node instance.","","@example",""," Y.one('#my-input').plug(Y.Plugin.AutoComplete, {"," source: 'select * from search.suggest where query=\"{query}\"'"," });",""," // You can now access the AutoCompleteList instance at Y.one('#my-input').ac","","@class Plugin.AutoComplete","@extends AutoCompleteList","**/","","var Plugin = Y.Plugin;","","function ACListPlugin(config) {"," config.inputNode = config.host;",""," // Render by default."," if (!config.render && config.render !== false) {"," config.render = true;"," }",""," ACListPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {"," NAME : 'autocompleteListPlugin',"," NS : 'ac',"," CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')","});","","Plugin.AutoComplete = ACListPlugin;","Plugin.AutoCompleteList = ACListPlugin;","","","}, '3.7.2', {\"requires\": [\"autocomplete-list\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].code=["YUI.add('autocomplete-plugin', function (Y, NAME) {","","/**","Binds an AutoCompleteList instance to a Node instance.","","@module autocomplete","@submodule autocomplete-plugin","**/","","/**","Binds an AutoCompleteList instance to a Node instance.","","@example",""," Y.one('#my-input').plug(Y.Plugin.AutoComplete, {"," source: 'select * from search.suggest where query=\"{query}\"'"," });",""," // You can now access the AutoCompleteList instance at Y.one('#my-input').ac","","@class Plugin.AutoComplete","@extends AutoCompleteList","**/","","var Plugin = Y.Plugin;","","function ACListPlugin(config) {"," config.inputNode = config.host;",""," // Render by default."," if (!config.render && config.render !== false) {"," config.render = true;"," }",""," ACListPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(ACListPlugin, Y.AutoCompleteList, {}, {"," NAME : 'autocompleteListPlugin',"," NS : 'ac',"," CSS_PREFIX: Y.ClassNameManager.getClassName('aclist')","});","","Plugin.AutoComplete = ACListPlugin;","Plugin.AutoCompleteList = ACListPlugin;","","","}, '3.7.3', {\"requires\": [\"autocomplete-list\", \"node-pluginhost\"]});"]; _yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].lines = {"1":0,"25":0,"27":0,"28":0,"31":0,"32":0,"35":0,"38":0,"44":0,"45":0}; _yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].functions = {"ACListPlugin:27":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-plugin/autocomplete-plugin.js"].coveredLines = 10;@@ -96,4 +96,4 @@ Plugin.AutoCompleteList = ACListPlugin; -}, '3.7.2', {"requires": ["autocomplete-list", "node-pluginhost"]});+}, '3.7.3', {"requires": ["autocomplete-list", "node-pluginhost"]});
bundle/autocomplete-plugin/autocomplete-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -51,4 +51,4 @@ Plugin.AutoCompleteList = ACListPlugin; -}, '3.7.2', {"requires": ["autocomplete-list", "node-pluginhost"]});+}, '3.7.3', {"requires": ["autocomplete-list", "node-pluginhost"]});
bundle/autocomplete-plugin/autocomplete-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-plugin",function(e,t){function r(e){e.inputNode=e.host,!e.render&&e.render!==!1&&(e.render=!0),r.superclass.constructor.apply(this,arguments)}var n=e.Plugin;e.extend(r,e.AutoCompleteList,{},{NAME:"autocompleteListPlugin",NS:"ac",CSS_PREFIX:e.ClassNameManager.getClassName("aclist")}),n.AutoComplete=r,n.AutoCompleteList=r},"3.7.2",{requires:["autocomplete-list","node-pluginhost"]});+YUI.add("autocomplete-plugin",function(e,t){function r(e){e.inputNode=e.host,!e.render&&e.render!==!1&&(e.render=!0),r.superclass.constructor.apply(this,arguments)}var n=e.Plugin;e.extend(r,e.AutoCompleteList,{},{NAME:"autocompleteListPlugin",NS:"ac",CSS_PREFIX:e.ClassNameManager.getClassName("aclist")}),n.AutoComplete=r,n.AutoCompleteList=r},"3.7.3",{requires:["autocomplete-list","node-pluginhost"]});
bundle/autocomplete-plugin/autocomplete-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -51,4 +51,4 @@ Plugin.AutoCompleteList = ACListPlugin; -}, '3.7.2', {"requires": ["autocomplete-list", "node-pluginhost"]});+}, '3.7.3', {"requires": ["autocomplete-list", "node-pluginhost"]});
bundle/autocomplete-sources/autocomplete-sources-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/autocomplete-sources/autocomplete-sources.js", code: [] };-_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].code=["YUI.add('autocomplete-sources', function (Y, NAME) {","","/**","Mixes support for JSONP and YQL result sources into AutoCompleteBase.","","@module autocomplete","@submodule autocomplete-sources","**/","","var ACBase = Y.AutoCompleteBase,"," Lang = Y.Lang,",""," _SOURCE_SUCCESS = '_sourceSuccess',",""," MAX_RESULTS = 'maxResults',"," REQUEST_TEMPLATE = 'requestTemplate',"," RESULT_LIST_LOCATOR = 'resultListLocator';","","// Add prototype properties and methods to AutoCompleteBase.","Y.mix(ACBase.prototype, {"," /**"," Regular expression used to determine whether a String source is a YQL query.",""," @property _YQL_SOURCE_REGEX"," @type RegExp"," @protected"," @for AutoCompleteBase"," **/"," _YQL_SOURCE_REGEX: /^(?:select|set|use)\\s+/i,",""," /**"," Runs before AutoCompleteBase's `_createObjectSource()` method and augments"," it to support additional object-based source types.",""," @method _beforeCreateObjectSource"," @param {String} source"," @protected"," @for AutoCompleteBase"," **/"," _beforeCreateObjectSource: function (source) {"," // If the object is a <select> node, use the options as the result"," // source."," if (source instanceof Y.Node &&"," source.get('nodeName').toLowerCase() === 'select') {",""," return this._createSelectSource(source);"," }",""," // If the object is a JSONPRequest instance, try to use it as a JSONP"," // source."," if (Y.JSONPRequest && source instanceof Y.JSONPRequest) {"," return this._createJSONPSource(source);"," }",""," // Fall back to a basic object source."," return this._createObjectSource(source);"," },",""," /**"," Creates a DataSource-like object that uses `Y.io` as a source. See the"," `source` attribute for more details.",""," @method _createIOSource"," @param {String} source URL."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createIOSource: function (source) {"," var ioSource = {type: 'io'},"," that = this,"," ioRequest, lastRequest, loading;",""," // Private internal _sendRequest method that will be assigned to"," // ioSource.sendRequest once io-base and json-parse are available."," function _sendRequest(request) {"," var cacheKey = request.request;",""," // Return immediately on a cached response."," if (that._cache && cacheKey in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[cacheKey], request);"," return;"," }",""," // Cancel any outstanding requests."," if (ioRequest && ioRequest.isInProgress()) {"," ioRequest.abort();"," }",""," ioRequest = Y.io(that._getXHRUrl(source, request), {"," on: {"," success: function (tid, response) {"," var data;",""," try {"," data = Y.JSON.parse(response.responseText);"," } catch (ex) {"," Y.error('JSON parse error', ex);"," }",""," if (data) {"," that._cache && (that._cache[cacheKey] = data);"," that[_SOURCE_SUCCESS](data, request);"," }"," }"," }"," });"," }",""," ioSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the IO module to load. Only the"," // most recent request will be sent."," lastRequest = request;",""," if (loading) { return; }",""," loading = true;",""," // Lazy-load the io-base and json-parse modules if necessary,"," // then overwrite the sendRequest method to bypass this check in"," // the future."," Y.use('io-base', 'json-parse', function () {"," ioSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," };",""," return ioSource;"," },",""," /**"," Creates a DataSource-like object that uses the specified JSONPRequest"," instance as a source. See the `source` attribute for more details.",""," @method _createJSONPSource"," @param {JSONPRequest|String} source URL string or JSONPRequest instance."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createJSONPSource: function (source) {"," var jsonpSource = {type: 'jsonp'},"," that = this,"," lastRequest, loading;",""," function _sendRequest(request) {"," var cacheKey = request.request,"," query = request.query;",""," if (that._cache && cacheKey in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[cacheKey], request);"," return;"," }",""," // Hack alert: JSONPRequest currently doesn't support"," // per-request callbacks, so we're reaching into the protected"," // _config object to make it happen."," //"," // This limitation is mentioned in the following JSONP"," // enhancement ticket:"," //"," // http://yuilibrary.com/projects/yui3/ticket/2529371"," source._config.on.success = function (data) {"," that._cache && (that._cache[cacheKey] = data);"," that[_SOURCE_SUCCESS](data, request);"," };",""," source.send(query);"," }",""," jsonpSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the JSONP module to load. Only"," // the most recent request will be sent."," lastRequest = request;",""," if (loading) { return; }",""," loading = true;",""," // Lazy-load the JSONP module if necessary, then overwrite the"," // sendRequest method to bypass this check in the future."," Y.use('jsonp', function () {"," // Turn the source into a JSONPRequest instance if it isn't"," // one already."," if (!(source instanceof Y.JSONPRequest)) {"," source = new Y.JSONPRequest(source, {"," format: Y.bind(that._jsonpFormatter, that)"," });"," }",""," jsonpSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," };",""," return jsonpSource;"," },",""," /**"," Creates a DataSource-like object that uses the specified `<select>` node as"," a source.",""," @method _createSelectSource"," @param {Node} source YUI Node instance wrapping a `<select>` node."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createSelectSource: function (source) {"," var that = this;",""," return {"," type: 'select',"," sendRequest: function (request) {"," var options = [];",""," source.get('options').each(function (option) {"," options.push({"," html : option.get('innerHTML'),"," index : option.get('index'),"," node : option,"," selected: option.get('selected'),"," text : option.get('text'),"," value : option.get('value')"," });"," });",""," that[_SOURCE_SUCCESS](options, request);"," }"," };"," },",""," /**"," Creates a DataSource-like object that calls the specified URL or executes"," the specified YQL query for results. If the string starts with \"select \","," \"use \", or \"set \" (case-insensitive), it's assumed to be a YQL query;"," otherwise, it's assumed to be a URL (which may be absolute or relative)."," URLs containing a \"{callback}\" placeholder are assumed to be JSONP URLs; all"," others will use XHR. See the `source` attribute for more details.",""," @method _createStringSource"," @param {String} source URL or YQL query."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createStringSource: function (source) {"," if (this._YQL_SOURCE_REGEX.test(source)) {"," // Looks like a YQL query."," return this._createYQLSource(source);"," } else if (source.indexOf('{callback}') !== -1) {"," // Contains a {callback} param and isn't a YQL query, so it must be"," // JSONP."," return this._createJSONPSource(source);"," } else {"," // Not a YQL query or JSONP, so we'll assume it's an XHR URL."," return this._createIOSource(source);"," }"," },",""," /**"," Creates a DataSource-like object that uses the specified YQL query string to"," create a YQL-based source. See the `source` attribute for details. If no"," `resultListLocator` is defined, this method will set a best-guess locator"," that might work for many typical YQL queries.",""," @method _createYQLSource"," @param {String} source YQL query."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createYQLSource: function (source) {"," var that = this,"," yqlSource = {type: 'yql'},"," lastRequest, loading, yqlRequest;",""," if (!that.get(RESULT_LIST_LOCATOR)) {"," that.set(RESULT_LIST_LOCATOR, that._defaultYQLLocator);"," }",""," function _sendRequest(request) {"," var query = request.query,"," env = that.get('yqlEnv'),"," maxResults = that.get(MAX_RESULTS),"," callback, opts, yqlQuery;",""," yqlQuery = Lang.sub(source, {"," maxResults: maxResults > 0 ? maxResults : 1000,"," request : request.request,"," query : query"," });",""," if (that._cache && yqlQuery in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[yqlQuery], request);"," return;"," }",""," callback = function (data) {"," that._cache && (that._cache[yqlQuery] = data);"," that[_SOURCE_SUCCESS](data, request);"," };",""," opts = {proto: that.get('yqlProtocol')};",""," // Only create a new YQLRequest instance if this is the"," // first request. For subsequent requests, we'll reuse the"," // original instance."," if (yqlRequest) {"," yqlRequest._callback = callback;"," yqlRequest._opts = opts;"," yqlRequest._params.q = yqlQuery;",""," if (env) {"," yqlRequest._params.env = env;"," }"," } else {"," yqlRequest = new Y.YQLRequest(yqlQuery, {"," on: {success: callback},"," allowCache: false // temp workaround until JSONP has per-URL callback proxies"," }, env ? {env: env} : null, opts);"," }",""," yqlRequest.send();"," }",""," yqlSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the YQL module to load. Only the"," // most recent request will be sent."," lastRequest = request;",""," if (!loading) {"," // Lazy-load the YQL module if necessary, then overwrite the"," // sendRequest method to bypass this check in the future."," loading = true;",""," Y.use('yql', function () {"," yqlSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," }"," };",""," return yqlSource;"," },",""," /**"," Default resultListLocator used when a string-based YQL source is set and the"," implementer hasn't already specified one.",""," @method _defaultYQLLocator"," @param {Object} response YQL response object."," @return {Array}"," @protected"," @for AutoCompleteBase"," **/"," _defaultYQLLocator: function (response) {"," var results = response && response.query && response.query.results,"," values;",""," if (results && Lang.isObject(results)) {"," // If there's only a single value on YQL's results object, that"," // value almost certainly contains the array of results we want. If"," // there are 0 or 2+ values, then the values themselves are most"," // likely the results we want."," values = Y.Object.values(results) || [];"," results = values.length === 1 ? values[0] : values;",""," if (!Lang.isArray(results)) {"," results = [results];"," }"," } else {"," results = [];"," }",""," return results;"," },",""," /**"," Returns a formatted XHR URL based on the specified base _url_, _query_, and"," the current _requestTemplate_ if any.",""," @method _getXHRUrl"," @param {String} url Base URL."," @param {Object} request Request object containing `query` and `request`"," properties."," @return {String} Formatted URL."," @protected"," @for AutoCompleteBase"," **/"," _getXHRUrl: function (url, request) {"," var maxResults = this.get(MAX_RESULTS);",""," if (request.query !== request.request) {"," // Append the request template to the URL."," url += request.request;"," }",""," return Lang.sub(url, {"," maxResults: maxResults > 0 ? maxResults : 1000,"," query : encodeURIComponent(request.query)"," });"," },",""," /**"," URL formatter passed to `JSONPRequest` instances.",""," @method _jsonpFormatter"," @param {String} url"," @param {String} proxy"," @param {String} query"," @return {String} Formatted URL"," @protected"," @for AutoCompleteBase"," **/"," _jsonpFormatter: function (url, proxy, query) {"," var maxResults = this.get(MAX_RESULTS),"," requestTemplate = this.get(REQUEST_TEMPLATE);",""," if (requestTemplate) {"," url += requestTemplate(query);"," }",""," return Lang.sub(url, {"," callback : proxy,"," maxResults: maxResults > 0 ? maxResults : 1000,"," query : encodeURIComponent(query)"," });"," }","});","","// Add attributes to AutoCompleteBase.","Y.mix(ACBase.ATTRS, {"," /**"," YQL environment file URL to load when the `source` is set to a YQL query."," Set this to `null` to use the default Open Data Tables environment file"," (http://datatables.org/alltables.env).",""," @attribute yqlEnv"," @type String"," @default null"," @for AutoCompleteBase"," **/"," yqlEnv: {"," value: null"," },",""," /**"," URL protocol to use when the `source` is set to a YQL query.",""," @attribute yqlProtocol"," @type String"," @default 'http'"," @for AutoCompleteBase"," **/"," yqlProtocol: {"," value: 'http'"," }","});","","// Tell AutoCompleteBase about the new source types it can now support.","Y.mix(ACBase.SOURCE_TYPES, {"," io : '_createIOSource',"," jsonp : '_createJSONPSource',"," object: '_beforeCreateObjectSource', // Run our version before the base version."," select: '_createSelectSource',"," string: '_createStringSource',"," yql : '_createYQLSource'","}, true);","","","}, '3.7.2', {\"optional\": [\"io-base\", \"json-parse\", \"jsonp\", \"yql\"], \"requires\": [\"autocomplete-base\"]});"];+_yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].code=["YUI.add('autocomplete-sources', function (Y, NAME) {","","/**","Mixes support for JSONP and YQL result sources into AutoCompleteBase.","","@module autocomplete","@submodule autocomplete-sources","**/","","var ACBase = Y.AutoCompleteBase,"," Lang = Y.Lang,",""," _SOURCE_SUCCESS = '_sourceSuccess',",""," MAX_RESULTS = 'maxResults',"," REQUEST_TEMPLATE = 'requestTemplate',"," RESULT_LIST_LOCATOR = 'resultListLocator';","","// Add prototype properties and methods to AutoCompleteBase.","Y.mix(ACBase.prototype, {"," /**"," Regular expression used to determine whether a String source is a YQL query.",""," @property _YQL_SOURCE_REGEX"," @type RegExp"," @protected"," @for AutoCompleteBase"," **/"," _YQL_SOURCE_REGEX: /^(?:select|set|use)\\s+/i,",""," /**"," Runs before AutoCompleteBase's `_createObjectSource()` method and augments"," it to support additional object-based source types.",""," @method _beforeCreateObjectSource"," @param {String} source"," @protected"," @for AutoCompleteBase"," **/"," _beforeCreateObjectSource: function (source) {"," // If the object is a <select> node, use the options as the result"," // source."," if (source instanceof Y.Node &&"," source.get('nodeName').toLowerCase() === 'select') {",""," return this._createSelectSource(source);"," }",""," // If the object is a JSONPRequest instance, try to use it as a JSONP"," // source."," if (Y.JSONPRequest && source instanceof Y.JSONPRequest) {"," return this._createJSONPSource(source);"," }",""," // Fall back to a basic object source."," return this._createObjectSource(source);"," },",""," /**"," Creates a DataSource-like object that uses `Y.io` as a source. See the"," `source` attribute for more details.",""," @method _createIOSource"," @param {String} source URL."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createIOSource: function (source) {"," var ioSource = {type: 'io'},"," that = this,"," ioRequest, lastRequest, loading;",""," // Private internal _sendRequest method that will be assigned to"," // ioSource.sendRequest once io-base and json-parse are available."," function _sendRequest(request) {"," var cacheKey = request.request;",""," // Return immediately on a cached response."," if (that._cache && cacheKey in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[cacheKey], request);"," return;"," }",""," // Cancel any outstanding requests."," if (ioRequest && ioRequest.isInProgress()) {"," ioRequest.abort();"," }",""," ioRequest = Y.io(that._getXHRUrl(source, request), {"," on: {"," success: function (tid, response) {"," var data;",""," try {"," data = Y.JSON.parse(response.responseText);"," } catch (ex) {"," Y.error('JSON parse error', ex);"," }",""," if (data) {"," that._cache && (that._cache[cacheKey] = data);"," that[_SOURCE_SUCCESS](data, request);"," }"," }"," }"," });"," }",""," ioSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the IO module to load. Only the"," // most recent request will be sent."," lastRequest = request;",""," if (loading) { return; }",""," loading = true;",""," // Lazy-load the io-base and json-parse modules if necessary,"," // then overwrite the sendRequest method to bypass this check in"," // the future."," Y.use('io-base', 'json-parse', function () {"," ioSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," };",""," return ioSource;"," },",""," /**"," Creates a DataSource-like object that uses the specified JSONPRequest"," instance as a source. See the `source` attribute for more details.",""," @method _createJSONPSource"," @param {JSONPRequest|String} source URL string or JSONPRequest instance."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createJSONPSource: function (source) {"," var jsonpSource = {type: 'jsonp'},"," that = this,"," lastRequest, loading;",""," function _sendRequest(request) {"," var cacheKey = request.request,"," query = request.query;",""," if (that._cache && cacheKey in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[cacheKey], request);"," return;"," }",""," // Hack alert: JSONPRequest currently doesn't support"," // per-request callbacks, so we're reaching into the protected"," // _config object to make it happen."," //"," // This limitation is mentioned in the following JSONP"," // enhancement ticket:"," //"," // http://yuilibrary.com/projects/yui3/ticket/2529371"," source._config.on.success = function (data) {"," that._cache && (that._cache[cacheKey] = data);"," that[_SOURCE_SUCCESS](data, request);"," };",""," source.send(query);"," }",""," jsonpSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the JSONP module to load. Only"," // the most recent request will be sent."," lastRequest = request;",""," if (loading) { return; }",""," loading = true;",""," // Lazy-load the JSONP module if necessary, then overwrite the"," // sendRequest method to bypass this check in the future."," Y.use('jsonp', function () {"," // Turn the source into a JSONPRequest instance if it isn't"," // one already."," if (!(source instanceof Y.JSONPRequest)) {"," source = new Y.JSONPRequest(source, {"," format: Y.bind(that._jsonpFormatter, that)"," });"," }",""," jsonpSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," };",""," return jsonpSource;"," },",""," /**"," Creates a DataSource-like object that uses the specified `<select>` node as"," a source.",""," @method _createSelectSource"," @param {Node} source YUI Node instance wrapping a `<select>` node."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createSelectSource: function (source) {"," var that = this;",""," return {"," type: 'select',"," sendRequest: function (request) {"," var options = [];",""," source.get('options').each(function (option) {"," options.push({"," html : option.get('innerHTML'),"," index : option.get('index'),"," node : option,"," selected: option.get('selected'),"," text : option.get('text'),"," value : option.get('value')"," });"," });",""," that[_SOURCE_SUCCESS](options, request);"," }"," };"," },",""," /**"," Creates a DataSource-like object that calls the specified URL or executes"," the specified YQL query for results. If the string starts with \"select \","," \"use \", or \"set \" (case-insensitive), it's assumed to be a YQL query;"," otherwise, it's assumed to be a URL (which may be absolute or relative)."," URLs containing a \"{callback}\" placeholder are assumed to be JSONP URLs; all"," others will use XHR. See the `source` attribute for more details.",""," @method _createStringSource"," @param {String} source URL or YQL query."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createStringSource: function (source) {"," if (this._YQL_SOURCE_REGEX.test(source)) {"," // Looks like a YQL query."," return this._createYQLSource(source);"," } else if (source.indexOf('{callback}') !== -1) {"," // Contains a {callback} param and isn't a YQL query, so it must be"," // JSONP."," return this._createJSONPSource(source);"," } else {"," // Not a YQL query or JSONP, so we'll assume it's an XHR URL."," return this._createIOSource(source);"," }"," },",""," /**"," Creates a DataSource-like object that uses the specified YQL query string to"," create a YQL-based source. See the `source` attribute for details. If no"," `resultListLocator` is defined, this method will set a best-guess locator"," that might work for many typical YQL queries.",""," @method _createYQLSource"," @param {String} source YQL query."," @return {Object} DataSource-like object."," @protected"," @for AutoCompleteBase"," **/"," _createYQLSource: function (source) {"," var that = this,"," yqlSource = {type: 'yql'},"," lastRequest, loading, yqlRequest;",""," if (!that.get(RESULT_LIST_LOCATOR)) {"," that.set(RESULT_LIST_LOCATOR, that._defaultYQLLocator);"," }",""," function _sendRequest(request) {"," var query = request.query,"," env = that.get('yqlEnv'),"," maxResults = that.get(MAX_RESULTS),"," callback, opts, yqlQuery;",""," yqlQuery = Lang.sub(source, {"," maxResults: maxResults > 0 ? maxResults : 1000,"," request : request.request,"," query : query"," });",""," if (that._cache && yqlQuery in that._cache) {"," that[_SOURCE_SUCCESS](that._cache[yqlQuery], request);"," return;"," }",""," callback = function (data) {"," that._cache && (that._cache[yqlQuery] = data);"," that[_SOURCE_SUCCESS](data, request);"," };",""," opts = {proto: that.get('yqlProtocol')};",""," // Only create a new YQLRequest instance if this is the"," // first request. For subsequent requests, we'll reuse the"," // original instance."," if (yqlRequest) {"," yqlRequest._callback = callback;"," yqlRequest._opts = opts;"," yqlRequest._params.q = yqlQuery;",""," if (env) {"," yqlRequest._params.env = env;"," }"," } else {"," yqlRequest = new Y.YQLRequest(yqlQuery, {"," on: {success: callback},"," allowCache: false // temp workaround until JSONP has per-URL callback proxies"," }, env ? {env: env} : null, opts);"," }",""," yqlRequest.send();"," }",""," yqlSource.sendRequest = function (request) {"," // Keep track of the most recent request in case there are multiple"," // requests while we're waiting for the YQL module to load. Only the"," // most recent request will be sent."," lastRequest = request;",""," if (!loading) {"," // Lazy-load the YQL module if necessary, then overwrite the"," // sendRequest method to bypass this check in the future."," loading = true;",""," Y.use('yql', function () {"," yqlSource.sendRequest = _sendRequest;"," _sendRequest(lastRequest);"," });"," }"," };",""," return yqlSource;"," },",""," /**"," Default resultListLocator used when a string-based YQL source is set and the"," implementer hasn't already specified one.",""," @method _defaultYQLLocator"," @param {Object} response YQL response object."," @return {Array}"," @protected"," @for AutoCompleteBase"," **/"," _defaultYQLLocator: function (response) {"," var results = response && response.query && response.query.results,"," values;",""," if (results && Lang.isObject(results)) {"," // If there's only a single value on YQL's results object, that"," // value almost certainly contains the array of results we want. If"," // there are 0 or 2+ values, then the values themselves are most"," // likely the results we want."," values = Y.Object.values(results) || [];"," results = values.length === 1 ? values[0] : values;",""," if (!Lang.isArray(results)) {"," results = [results];"," }"," } else {"," results = [];"," }",""," return results;"," },",""," /**"," Returns a formatted XHR URL based on the specified base _url_, _query_, and"," the current _requestTemplate_ if any.",""," @method _getXHRUrl"," @param {String} url Base URL."," @param {Object} request Request object containing `query` and `request`"," properties."," @return {String} Formatted URL."," @protected"," @for AutoCompleteBase"," **/"," _getXHRUrl: function (url, request) {"," var maxResults = this.get(MAX_RESULTS);",""," if (request.query !== request.request) {"," // Append the request template to the URL."," url += request.request;"," }",""," return Lang.sub(url, {"," maxResults: maxResults > 0 ? maxResults : 1000,"," query : encodeURIComponent(request.query)"," });"," },",""," /**"," URL formatter passed to `JSONPRequest` instances.",""," @method _jsonpFormatter"," @param {String} url"," @param {String} proxy"," @param {String} query"," @return {String} Formatted URL"," @protected"," @for AutoCompleteBase"," **/"," _jsonpFormatter: function (url, proxy, query) {"," var maxResults = this.get(MAX_RESULTS),"," requestTemplate = this.get(REQUEST_TEMPLATE);",""," if (requestTemplate) {"," url += requestTemplate(query);"," }",""," return Lang.sub(url, {"," callback : proxy,"," maxResults: maxResults > 0 ? maxResults : 1000,"," query : encodeURIComponent(query)"," });"," }","});","","// Add attributes to AutoCompleteBase.","Y.mix(ACBase.ATTRS, {"," /**"," YQL environment file URL to load when the `source` is set to a YQL query."," Set this to `null` to use the default Open Data Tables environment file"," (http://datatables.org/alltables.env).",""," @attribute yqlEnv"," @type String"," @default null"," @for AutoCompleteBase"," **/"," yqlEnv: {"," value: null"," },",""," /**"," URL protocol to use when the `source` is set to a YQL query.",""," @attribute yqlProtocol"," @type String"," @default 'http'"," @for AutoCompleteBase"," **/"," yqlProtocol: {"," value: 'http'"," }","});","","// Tell AutoCompleteBase about the new source types it can now support.","Y.mix(ACBase.SOURCE_TYPES, {"," io : '_createIOSource',"," jsonp : '_createJSONPSource',"," object: '_beforeCreateObjectSource', // Run our version before the base version."," select: '_createSelectSource',"," string: '_createStringSource',"," yql : '_createYQLSource'","}, true);","","","}, '3.7.3', {\"optional\": [\"io-base\", \"json-parse\", \"jsonp\", \"yql\"], \"requires\": [\"autocomplete-base\"]});"]; _yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].lines = {"1":0,"10":0,"20":0,"43":0,"46":0,"51":0,"52":0,"56":0,"70":0,"76":0,"77":0,"80":0,"81":0,"82":0,"86":0,"87":0,"90":0,"93":0,"95":0,"96":0,"98":0,"101":0,"102":0,"103":0,"110":0,"114":0,"116":0,"118":0,"123":0,"124":0,"125":0,"129":0,"143":0,"147":0,"148":0,"151":0,"152":0,"153":0,"164":0,"165":0,"166":0,"169":0,"172":0,"176":0,"178":0,"180":0,"184":0,"187":0,"188":0,"193":0,"194":0,"198":0,"212":0,"214":0,"217":0,"219":0,"220":0,"230":0,"250":0,"252":0,"253":0,"256":0,"259":0,"276":0,"280":0,"281":0,"284":0,"285":0,"290":0,"296":0,"297":0,"298":0,"301":0,"302":0,"303":0,"306":0,"311":0,"312":0,"313":0,"314":0,"316":0,"317":0,"320":0,"326":0,"329":0,"333":0,"335":0,"338":0,"340":0,"341":0,"342":0,"347":0,"361":0,"364":0,"369":0,"370":0,"372":0,"373":0,"376":0,"379":0,"395":0,"397":0,"399":0,"402":0,"420":0,"423":0,"424":0,"427":0,"436":0,"465":0}; _yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].functions = {"_beforeCreateObjectSource:40":0,"success:92":0,"_sendRequest:76":0,"(anonymous 2):123":0,"sendRequest:110":0,"_createIOSource:69":0,"success:164":0,"_sendRequest:147":0,"(anonymous 3):184":0,"sendRequest:172":0,"_createJSONPSource:142":0,"(anonymous 4):219":0,"sendRequest:216":0,"_createSelectSource:211":0,"_createStringSource:249":0,"callback:301":0,"_sendRequest:284":0,"(anonymous 5):340":0,"sendRequest:329":0,"_createYQLSource:275":0,"_defaultYQLLocator:360":0,"_getXHRUrl:394":0,"_jsonpFormatter:419":0,"(anonymous 1):1":0}; _yuitest_coverage["build/autocomplete-sources/autocomplete-sources.js"].coveredLines = 110;@@ -645,4 +645,4 @@ }, true); -}, '3.7.2', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});+}, '3.7.3', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});
bundle/autocomplete-sources/autocomplete-sources-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -478,4 +478,4 @@ }, true); -}, '3.7.2', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});+}, '3.7.3', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});
bundle/autocomplete-sources/autocomplete-sources-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("autocomplete-sources",function(e,t){var n=e.AutoCompleteBase,r=e.Lang,i="_sourceSuccess",s="maxResults",o="requestTemplate",u="resultListLocator";e.mix(n.prototype,{_YQL_SOURCE_REGEX:/^(?:select|set|use)\s+/i,_beforeCreateObjectSource:function(t){return t instanceof e.Node&&t.get("nodeName").toLowerCase()==="select"?this._createSelectSource(t):e.JSONPRequest&&t instanceof e.JSONPRequest?this._createJSONPSource(t):this._createObjectSource(t)},_createIOSource:function(t){function a(n){var o=n.request;if(r._cache&&o in r._cache){r[i](r._cache[o],n);return}s&&s.isInProgress()&&s.abort(),s=e.io(r._getXHRUrl(t,n),{on:{success:function(t,s){var u;try{u=e.JSON.parse(s.responseText)}catch(a){e.error("JSON parse error",a)}u&&(r._cache&&(r._cache[o]=u),r[i](u,n))}}})}var n={type:"io"},r=this,s,o,u;return n.sendRequest=function(t){o=t;if(u)return;u=!0,e.use("io-base","json-parse",function(){n.sendRequest=a,a(o)})},n},_createJSONPSource:function(t){function u(e){var n=e.request,s=e.query;if(r._cache&&n in r._cache){r[i](r._cache[n],e);return}t._config.on.success=function(t){r._cache&&(r._cache[n]=t),r[i](t,e)},t.send(s)}var n={type:"jsonp"},r=this,s,o;return n.sendRequest=function(i){s=i;if(o)return;o=!0,e.use("jsonp",function(){t instanceof e.JSONPRequest||(t=new e.JSONPRequest(t,{format:e.bind(r._jsonpFormatter,r)})),n.sendRequest=u,u(s)})},n},_createSelectSource:function(e){var t=this;return{type:"select",sendRequest:function(n){var r=[];e.get("options").each(function(e){r.push({html:e.get("innerHTML"),index:e.get("index"),node:e,selected:e.get("selected"),text:e.get("text"),value:e.get("value")})}),t[i](r,n)}}},_createStringSource:function(e){return this._YQL_SOURCE_REGEX.test(e)?this._createYQLSource(e):e.indexOf("{callback}")!==-1?this._createJSONPSource(e):this._createIOSource(e)},_createYQLSource:function(t){function c(o){var u=o.query,a=n.get("yqlEnv"),f=n.get(s),c,h,p;p=r.sub(t,{maxResults:f>0?f:1e3,request:o.request,query:u});if(n._cache&&p in n._cache){n[i](n._cache[p],o);return}c=function(e){n._cache&&(n._cache[p]=e),n[i](e,o)},h={proto:n.get("yqlProtocol")},l?(l._callback=c,l._opts=h,l._params.q=p,a&&(l._params.env=a)):l=new e.YQLRequest(p,{on:{success:c},allowCache:!1},a?{env:a}:null,h),l.send()}var n=this,o={type:"yql"},a,f,l;return n.get(u)||n.set(u,n._defaultYQLLocator),o.sendRequest=function(t){a=t,f||(f=!0,e.use("yql",function(){o.sendRequest=c,c(a)}))},o},_defaultYQLLocator:function(t){var n=t&&t.query&&t.query.results,i;return n&&r.isObject(n)?(i=e.Object.values(n)||[],n=i.length===1?i[0]:i,r.isArray(n)||(n=[n])):n=[],n},_getXHRUrl:function(e,t){var n=this.get(s);return t.query!==t.request&&(e+=t.request),r.sub(e,{maxResults:n>0?n:1e3,query:encodeURIComponent(t.query)})},_jsonpFormatter:function(e,t,n){var i=this.get(s),u=this.get(o);return u&&(e+=u(n)),r.sub(e,{callback:t,maxResults:i>0?i:1e3,query:encodeURIComponent(n)})}}),e.mix(n.ATTRS,{yqlEnv:{value:null},yqlProtocol:{value:"http"}}),e.mix(n.SOURCE_TYPES,{io:"_createIOSource",jsonp:"_createJSONPSource",object:"_beforeCreateObjectSource",select:"_createSelectSource",string:"_createStringSource",yql:"_createYQLSource"},!0)},"3.7.2",{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]});+YUI.add("autocomplete-sources",function(e,t){var n=e.AutoCompleteBase,r=e.Lang,i="_sourceSuccess",s="maxResults",o="requestTemplate",u="resultListLocator";e.mix(n.prototype,{_YQL_SOURCE_REGEX:/^(?:select|set|use)\s+/i,_beforeCreateObjectSource:function(t){return t instanceof e.Node&&t.get("nodeName").toLowerCase()==="select"?this._createSelectSource(t):e.JSONPRequest&&t instanceof e.JSONPRequest?this._createJSONPSource(t):this._createObjectSource(t)},_createIOSource:function(t){function a(n){var o=n.request;if(r._cache&&o in r._cache){r[i](r._cache[o],n);return}s&&s.isInProgress()&&s.abort(),s=e.io(r._getXHRUrl(t,n),{on:{success:function(t,s){var u;try{u=e.JSON.parse(s.responseText)}catch(a){e.error("JSON parse error",a)}u&&(r._cache&&(r._cache[o]=u),r[i](u,n))}}})}var n={type:"io"},r=this,s,o,u;return n.sendRequest=function(t){o=t;if(u)return;u=!0,e.use("io-base","json-parse",function(){n.sendRequest=a,a(o)})},n},_createJSONPSource:function(t){function u(e){var n=e.request,s=e.query;if(r._cache&&n in r._cache){r[i](r._cache[n],e);return}t._config.on.success=function(t){r._cache&&(r._cache[n]=t),r[i](t,e)},t.send(s)}var n={type:"jsonp"},r=this,s,o;return n.sendRequest=function(i){s=i;if(o)return;o=!0,e.use("jsonp",function(){t instanceof e.JSONPRequest||(t=new e.JSONPRequest(t,{format:e.bind(r._jsonpFormatter,r)})),n.sendRequest=u,u(s)})},n},_createSelectSource:function(e){var t=this;return{type:"select",sendRequest:function(n){var r=[];e.get("options").each(function(e){r.push({html:e.get("innerHTML"),index:e.get("index"),node:e,selected:e.get("selected"),text:e.get("text"),value:e.get("value")})}),t[i](r,n)}}},_createStringSource:function(e){return this._YQL_SOURCE_REGEX.test(e)?this._createYQLSource(e):e.indexOf("{callback}")!==-1?this._createJSONPSource(e):this._createIOSource(e)},_createYQLSource:function(t){function c(o){var u=o.query,a=n.get("yqlEnv"),f=n.get(s),c,h,p;p=r.sub(t,{maxResults:f>0?f:1e3,request:o.request,query:u});if(n._cache&&p in n._cache){n[i](n._cache[p],o);return}c=function(e){n._cache&&(n._cache[p]=e),n[i](e,o)},h={proto:n.get("yqlProtocol")},l?(l._callback=c,l._opts=h,l._params.q=p,a&&(l._params.env=a)):l=new e.YQLRequest(p,{on:{success:c},allowCache:!1},a?{env:a}:null,h),l.send()}var n=this,o={type:"yql"},a,f,l;return n.get(u)||n.set(u,n._defaultYQLLocator),o.sendRequest=function(t){a=t,f||(f=!0,e.use("yql",function(){o.sendRequest=c,c(a)}))},o},_defaultYQLLocator:function(t){var n=t&&t.query&&t.query.results,i;return n&&r.isObject(n)?(i=e.Object.values(n)||[],n=i.length===1?i[0]:i,r.isArray(n)||(n=[n])):n=[],n},_getXHRUrl:function(e,t){var n=this.get(s);return t.query!==t.request&&(e+=t.request),r.sub(e,{maxResults:n>0?n:1e3,query:encodeURIComponent(t.query)})},_jsonpFormatter:function(e,t,n){var i=this.get(s),u=this.get(o);return u&&(e+=u(n)),r.sub(e,{callback:t,maxResults:i>0?i:1e3,query:encodeURIComponent(n)})}}),e.mix(n.ATTRS,{yqlEnv:{value:null},yqlProtocol:{value:"http"}}),e.mix(n.SOURCE_TYPES,{io:"_createIOSource",jsonp:"_createJSONPSource",object:"_beforeCreateObjectSource",select:"_createSelectSource",string:"_createStringSource",yql:"_createYQLSource"},!0)},"3.7.3",{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]});
bundle/autocomplete-sources/autocomplete-sources.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -478,4 +478,4 @@ }, true); -}, '3.7.2', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});+}, '3.7.3', {"optional": ["io-base", "json-parse", "jsonp", "yql"], "requires": ["autocomplete-base"]});
bundle/base-base/base-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/base-base/base-base.js", code: [] };-_yuitest_coverage["build/base-base/base-base.js"].code=["YUI.add('base-base', function (Y, NAME) {",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, "," * and without the extension support provided by BaseCore.build."," *"," * @module base"," * @submodule base-base"," */",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the Base.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, "," * and without the extension support provided by Base.build."," *"," * @module base"," * @submodule base-base"," */"," var L = Y.Lang,",""," DESTROY = \"destroy\","," INIT = \"init\",",""," BUBBLETARGETS = \"bubbleTargets\","," _BUBBLETARGETS = \"_bubbleTargets\",",""," BaseCore = Y.BaseCore,"," AttributeCore = Y.AttributeCore,"," Attribute = Y.Attribute;",""," /**"," * <p>"," * A base class which objects requiring attributes and custom event support can "," * extend. Base also handles the chaining of initializer and destructor methods across "," * the hierarchy as part of object construction and destruction. Additionally, attributes configured "," * through the static <a href=\"#property_ATTRS\">ATTRS</a> property for each class "," * in the hierarchy will be initialized by Base."," * </p>"," *"," * <p>"," * The static <a href=\"#property_NAME\">NAME</a> property of each class extending "," * from Base will be used as the identifier for the class, and is used by Base to prefix "," * all events fired by instances of that class."," * </p>"," *"," * @class Base"," * @constructor"," * @uses BaseCore"," * @uses Attribute"," * @uses AttributeCore"," * @uses AttributeEvents"," * @uses AttributeExtras"," * @uses EventTarget"," *"," * @param {Object} config Object with configuration property name/value pairs. The object can be "," * used to provide default values for the objects published attributes."," *"," * <p>"," * The config object can also contain the following non-attribute properties, providing a convenient "," * way to configure events listeners and plugins for the instance, as part of the constructor call:"," * </p>"," *"," * <dl>"," * <dt>on</dt>"," * <dd>An event name to listener function map, to register event listeners for the \"on\" moment of the event. A constructor convenience property for the <a href=\"Base.html#method_on\">on</a> method.</dd>"," * <dt>after</dt>"," * <dd>An event name to listener function map, to register event listeners for the \"after\" moment of the event. A constructor convenience property for the <a href=\"Base.html#method_after\">after</a> method.</dd>"," * <dt>bubbleTargets</dt>"," * <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href=\"EventTarget.html#method_addTarget\">addTarget</a> method.</dd>"," * <dt>plugins</dt>"," * <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href=\"Plugin.Host.html#method_plug\">plug</a> method.</dd>"," * </dl>"," */"," function Base() {"," BaseCore.apply(this, arguments);"," }",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce, readOnly etc.)"," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @private"," */"," Base._ATTR_CFG = Attribute._ATTR_CFG.concat(\"cloneDefaultValue\");"," Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);",""," /**"," * The array of non-attribute configuration properties supported by this class. "," * "," * `Base` supports \"on\", \"after\", \"plugins\" and \"bubbleTargets\" properties, "," * which are not set up as attributes. "," *"," * This property is primarily required so that when "," * <a href=\"#property__allowAdHocAttrs\">`_allowAdHocAttrs`</a> is enabled by"," * a class, non-attribute configurations don't get added as ad-hoc attributes. "," *"," * @property _NON_ATTRS_CFG"," * @type Array"," * @static"," * @private"," */"," Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat([\"on\", \"after\", \"bubbleTargets\"]);",""," /**"," * <p>"," * The string to be used to identify instances of "," * this class, for example in prefixing events."," * </p>"," * <p>"," * Classes extending Base, should define their own"," * static NAME property, which should be camelCase by"," * convention (e.g. MyClass.NAME = \"myClass\";)."," * </p>"," * @property NAME"," * @type String"," * @static"," */"," Base.NAME = \"base\";",""," /**"," * The default set of attributes which will be available for instances of this class, and "," * their configuration. In addition to the configuration properties listed by "," * Attribute's <a href=\"Attribute.html#method_addAttr\">addAttr</a> method, the attribute "," * can also be configured with a \"cloneDefaultValue\" property, which defines how the statically"," * defined value field should be protected (\"shallow\", \"deep\" and false are supported values). "," *"," * By default if the value is an object literal or an array it will be \"shallow\" cloned, to "," * protect the default value."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," Base.ATTRS = AttributeCore.prototype._protectAttrs(BaseCore.ATTRS);",""," Base.prototype = {",""," /**"," * Internal construction logic for Base."," *"," * @method _initBase"," * @param {Object} config The constructor configuration object"," * @private"," */"," _initBase: function(cfg) {",""," this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;",""," Y.BaseCore.prototype._initBase.call(this, cfg);"," },",""," /**"," * Initializes Attribute "," * "," * @method _initAttribute"," * @private"," */"," _initAttribute: function(cfg) {"," Attribute.call(this);"," this._yuievt.config.prefix = this._eventPrefix;"," },",""," /**"," * Utility method to define the attribute hash used to filter/whitelist property mixes for "," * this class. "," * "," * @method _attrCfgHash"," * @private"," */"," _attrCfgHash: function() {"," return Base._ATTR_CFG_HASH;"," },",""," /**"," * Init lifecycle method, invoked during construction."," * Fires the init event prior to setting up attributes and "," * invoking initializers for the class hierarchy."," *"," * @method init"," * @chainable"," * @param {Object} config Object with configuration property name/value pairs"," * @return {Base} A reference to this object"," */"," init: function(config) {"," /**"," * <p>"," * Lifecycle event for the init phase, fired prior to initialization. "," * Invoking the preventDefault() method on the event object provided "," * to subscribers will prevent initialization from occuring."," * </p>"," * <p>"," * Subscribers to the \"after\" momemt of this event, will be notified"," * after initialization of the object is complete (and therefore"," * cannot prevent initialization)."," * </p>"," *"," * @event init"," * @preventable _defInitFn"," * @param {EventFacade} e Event object, with a cfg property which "," * refers to the configuration object passed to the constructor."," */"," this.publish(INIT, {"," queuable:false,"," fireOnce:true,"," defaultTargetOnly:true,"," defaultFn:this._defInitFn"," });",""," this._preInitEventCfg(config);",""," this.fire(INIT, {cfg: config});",""," return this;"," },",""," /**"," * Handles the special on, after and target properties which allow the user to"," * easily configure on and after listeners as well as bubble targets during "," * construction, prior to init."," *"," * @private"," * @method _preInitEventCfg"," * @param {Object} config The user configuration object"," */"," _preInitEventCfg : function(config) {"," if (config) {"," if (config.on) {"," this.on(config.on);"," }"," if (config.after) {"," this.after(config.after);"," }"," }",""," var i, l, target,"," userTargets = (config && BUBBLETARGETS in config);",""," if (userTargets || _BUBBLETARGETS in this) {"," target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;"," if (L.isArray(target)) {"," for (i = 0, l = target.length; i < l; i++) { "," this.addTarget(target[i]);"," }"," } else if (target) {"," this.addTarget(target);"," }"," }"," },",""," /**"," * <p>"," * Destroy lifecycle method. Fires the destroy"," * event, prior to invoking destructors for the"," * class hierarchy."," * </p>"," * <p>"," * Subscribers to the destroy"," * event can invoke preventDefault on the event object, to prevent destruction"," * from proceeding."," * </p>"," * @method destroy"," * @return {Base} A reference to this object"," * @chainable"," */"," destroy: function() {",""," /**"," * <p>"," * Lifecycle event for the destroy phase, "," * fired prior to destruction. Invoking the preventDefault "," * method on the event object provided to subscribers will "," * prevent destruction from proceeding."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after destruction is complete (and as a result cannot prevent"," * destruction)."," * </p>"," * @event destroy"," * @preventable _defDestroyFn"," * @param {EventFacade} e Event object"," */"," this.publish(DESTROY, {"," queuable:false,"," fireOnce:true,"," defaultTargetOnly:true,"," defaultFn: this._defDestroyFn"," });"," this.fire(DESTROY);",""," this.detachAll();"," return this;"," },",""," /**"," * Default init event handler"," *"," * @method _defInitFn"," * @param {EventFacade} e Event object, with a cfg property which "," * refers to the configuration object passed to the constructor."," * @protected"," */"," _defInitFn : function(e) {"," this._baseInit(e.cfg);"," },",""," /**"," * Default destroy event handler"," *"," * @method _defDestroyFn"," * @param {EventFacade} e Event object"," * @protected"," */"," _defDestroyFn : function(e) {"," this._baseDestroy(e.cfg);"," }"," };",""," Y.mix(Base, Attribute, false, null, 1);"," Y.mix(Base, BaseCore, false, null, 1);",""," // Fix constructor"," Base.prototype.constructor = Base;",""," Y.Base = Base;","","","}, '3.7.2', {\"requires\": [\"base-core\", \"attribute-base\"]});"];+_yuitest_coverage["build/base-base/base-base.js"].code=["YUI.add('base-base', function (Y, NAME) {",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, "," * and without the extension support provided by BaseCore.build."," *"," * @module base"," * @submodule base-base"," */",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the Base.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * The base-base submodule provides the Base class without the Plugin support, provided by Plugin.Host, "," * and without the extension support provided by Base.build."," *"," * @module base"," * @submodule base-base"," */"," var L = Y.Lang,",""," DESTROY = \"destroy\","," INIT = \"init\",",""," BUBBLETARGETS = \"bubbleTargets\","," _BUBBLETARGETS = \"_bubbleTargets\",",""," BaseCore = Y.BaseCore,"," AttributeCore = Y.AttributeCore,"," Attribute = Y.Attribute;",""," /**"," * <p>"," * A base class which objects requiring attributes and custom event support can "," * extend. Base also handles the chaining of initializer and destructor methods across "," * the hierarchy as part of object construction and destruction. Additionally, attributes configured "," * through the static <a href=\"#property_ATTRS\">ATTRS</a> property for each class "," * in the hierarchy will be initialized by Base."," * </p>"," *"," * <p>"," * The static <a href=\"#property_NAME\">NAME</a> property of each class extending "," * from Base will be used as the identifier for the class, and is used by Base to prefix "," * all events fired by instances of that class."," * </p>"," *"," * @class Base"," * @constructor"," * @uses BaseCore"," * @uses Attribute"," * @uses AttributeCore"," * @uses AttributeEvents"," * @uses AttributeExtras"," * @uses EventTarget"," *"," * @param {Object} config Object with configuration property name/value pairs. The object can be "," * used to provide default values for the objects published attributes."," *"," * <p>"," * The config object can also contain the following non-attribute properties, providing a convenient "," * way to configure events listeners and plugins for the instance, as part of the constructor call:"," * </p>"," *"," * <dl>"," * <dt>on</dt>"," * <dd>An event name to listener function map, to register event listeners for the \"on\" moment of the event. A constructor convenience property for the <a href=\"Base.html#method_on\">on</a> method.</dd>"," * <dt>after</dt>"," * <dd>An event name to listener function map, to register event listeners for the \"after\" moment of the event. A constructor convenience property for the <a href=\"Base.html#method_after\">after</a> method.</dd>"," * <dt>bubbleTargets</dt>"," * <dd>An object, or array of objects, to register as bubble targets for bubbled events fired by this instance. A constructor convenience property for the <a href=\"EventTarget.html#method_addTarget\">addTarget</a> method.</dd>"," * <dt>plugins</dt>"," * <dd>A plugin, or array of plugins to be plugged into the instance (see PluginHost's plug method for signature details). A constructor convenience property for the <a href=\"Plugin.Host.html#method_plug\">plug</a> method.</dd>"," * </dl>"," */"," function Base() {"," BaseCore.apply(this, arguments);"," }",""," /**"," * The list of properties which can be configured for "," * each attribute (e.g. setter, getter, writeOnce, readOnly etc.)"," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @private"," */"," Base._ATTR_CFG = Attribute._ATTR_CFG.concat(\"cloneDefaultValue\");"," Base._ATTR_CFG_HASH = Y.Array.hash(Base._ATTR_CFG);",""," /**"," * The array of non-attribute configuration properties supported by this class. "," * "," * `Base` supports \"on\", \"after\", \"plugins\" and \"bubbleTargets\" properties, "," * which are not set up as attributes. "," *"," * This property is primarily required so that when "," * <a href=\"#property__allowAdHocAttrs\">`_allowAdHocAttrs`</a> is enabled by"," * a class, non-attribute configurations don't get added as ad-hoc attributes. "," *"," * @property _NON_ATTRS_CFG"," * @type Array"," * @static"," * @private"," */"," Base._NON_ATTRS_CFG = BaseCore._NON_ATTRS_CFG.concat([\"on\", \"after\", \"bubbleTargets\"]);",""," /**"," * <p>"," * The string to be used to identify instances of "," * this class, for example in prefixing events."," * </p>"," * <p>"," * Classes extending Base, should define their own"," * static NAME property, which should be camelCase by"," * convention (e.g. MyClass.NAME = \"myClass\";)."," * </p>"," * @property NAME"," * @type String"," * @static"," */"," Base.NAME = \"base\";",""," /**"," * The default set of attributes which will be available for instances of this class, and "," * their configuration. In addition to the configuration properties listed by "," * Attribute's <a href=\"Attribute.html#method_addAttr\">addAttr</a> method, the attribute "," * can also be configured with a \"cloneDefaultValue\" property, which defines how the statically"," * defined value field should be protected (\"shallow\", \"deep\" and false are supported values). "," *"," * By default if the value is an object literal or an array it will be \"shallow\" cloned, to "," * protect the default value."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," Base.ATTRS = AttributeCore.prototype._protectAttrs(BaseCore.ATTRS);",""," Base.prototype = {",""," /**"," * Internal construction logic for Base."," *"," * @method _initBase"," * @param {Object} config The constructor configuration object"," * @private"," */"," _initBase: function(cfg) {",""," this._eventPrefix = this.constructor.EVENT_PREFIX || this.constructor.NAME;",""," Y.BaseCore.prototype._initBase.call(this, cfg);"," },",""," /**"," * Initializes Attribute "," * "," * @method _initAttribute"," * @private"," */"," _initAttribute: function(cfg) {"," Attribute.call(this);"," this._yuievt.config.prefix = this._eventPrefix;"," },",""," /**"," * Utility method to define the attribute hash used to filter/whitelist property mixes for "," * this class. "," * "," * @method _attrCfgHash"," * @private"," */"," _attrCfgHash: function() {"," return Base._ATTR_CFG_HASH;"," },",""," /**"," * Init lifecycle method, invoked during construction."," * Fires the init event prior to setting up attributes and "," * invoking initializers for the class hierarchy."," *"," * @method init"," * @chainable"," * @param {Object} config Object with configuration property name/value pairs"," * @return {Base} A reference to this object"," */"," init: function(config) {"," /**"," * <p>"," * Lifecycle event for the init phase, fired prior to initialization. "," * Invoking the preventDefault() method on the event object provided "," * to subscribers will prevent initialization from occuring."," * </p>"," * <p>"," * Subscribers to the \"after\" momemt of this event, will be notified"," * after initialization of the object is complete (and therefore"," * cannot prevent initialization)."," * </p>"," *"," * @event init"," * @preventable _defInitFn"," * @param {EventFacade} e Event object, with a cfg property which "," * refers to the configuration object passed to the constructor."," */"," this.publish(INIT, {"," queuable:false,"," fireOnce:true,"," defaultTargetOnly:true,"," defaultFn:this._defInitFn"," });",""," this._preInitEventCfg(config);",""," this.fire(INIT, {cfg: config});",""," return this;"," },",""," /**"," * Handles the special on, after and target properties which allow the user to"," * easily configure on and after listeners as well as bubble targets during "," * construction, prior to init."," *"," * @private"," * @method _preInitEventCfg"," * @param {Object} config The user configuration object"," */"," _preInitEventCfg : function(config) {"," if (config) {"," if (config.on) {"," this.on(config.on);"," }"," if (config.after) {"," this.after(config.after);"," }"," }",""," var i, l, target,"," userTargets = (config && BUBBLETARGETS in config);",""," if (userTargets || _BUBBLETARGETS in this) {"," target = userTargets ? (config && config.bubbleTargets) : this._bubbleTargets;"," if (L.isArray(target)) {"," for (i = 0, l = target.length; i < l; i++) { "," this.addTarget(target[i]);"," }"," } else if (target) {"," this.addTarget(target);"," }"," }"," },",""," /**"," * <p>"," * Destroy lifecycle method. Fires the destroy"," * event, prior to invoking destructors for the"," * class hierarchy."," * </p>"," * <p>"," * Subscribers to the destroy"," * event can invoke preventDefault on the event object, to prevent destruction"," * from proceeding."," * </p>"," * @method destroy"," * @return {Base} A reference to this object"," * @chainable"," */"," destroy: function() {",""," /**"," * <p>"," * Lifecycle event for the destroy phase, "," * fired prior to destruction. Invoking the preventDefault "," * method on the event object provided to subscribers will "," * prevent destruction from proceeding."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after destruction is complete (and as a result cannot prevent"," * destruction)."," * </p>"," * @event destroy"," * @preventable _defDestroyFn"," * @param {EventFacade} e Event object"," */"," this.publish(DESTROY, {"," queuable:false,"," fireOnce:true,"," defaultTargetOnly:true,"," defaultFn: this._defDestroyFn"," });"," this.fire(DESTROY);",""," this.detachAll();"," return this;"," },",""," /**"," * Default init event handler"," *"," * @method _defInitFn"," * @param {EventFacade} e Event object, with a cfg property which "," * refers to the configuration object passed to the constructor."," * @protected"," */"," _defInitFn : function(e) {"," this._baseInit(e.cfg);"," },",""," /**"," * Default destroy event handler"," *"," * @method _defDestroyFn"," * @param {EventFacade} e Event object"," * @protected"," */"," _defDestroyFn : function(e) {"," this._baseDestroy(e.cfg);"," }"," };",""," Y.mix(Base, Attribute, false, null, 1);"," Y.mix(Base, BaseCore, false, null, 1);",""," // Fix constructor"," Base.prototype.constructor = Base;",""," Y.Base = Base;","","","}, '3.7.3', {\"requires\": [\"base-core\", \"attribute-base\"]});"]; _yuitest_coverage["build/base-base/base-base.js"].lines = {"1":0,"34":0,"89":0,"90":0,"102":0,"103":0,"120":0,"136":0,"152":0,"154":0,"165":0,"167":0,"177":0,"178":0,"189":0,"220":0,"227":0,"229":0,"231":0,"244":0,"245":0,"246":0,"248":0,"249":0,"253":0,"256":0,"257":0,"258":0,"259":0,"260":0,"262":0,"263":0,"301":0,"307":0,"309":0,"310":0,"322":0,"333":0,"337":0,"338":0,"341":0,"343":0}; _yuitest_coverage["build/base-base/base-base.js"].functions = {"Base:89":0,"_initBase:163":0,"_initAttribute:176":0,"_attrCfgHash:188":0,"init:202":0,"_preInitEventCfg:243":0,"destroy:283":0,"_defInitFn:321":0,"_defDestroyFn:332":0,"(anonymous 1):1":0}; _yuitest_coverage["build/base-base/base-base.js"].coveredLines = 42;@@ -434,4 +434,4 @@ Y.Base = Base; -}, '3.7.2', {"requires": ["base-core", "attribute-base"]});+}, '3.7.3', {"requires": ["base-core", "attribute-base"]});
bundle/base-base/base-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -351,4 +351,4 @@ Y.Base = Base; -}, '3.7.2', {"requires": ["base-core", "attribute-base"]});+}, '3.7.3', {"requires": ["base-core", "attribute-base"]});
bundle/base-base/base-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-base",function(e,t){function l(){u.apply(this,arguments)}var n=e.Lang,r="destroy",i="init",s="bubbleTargets",o="_bubbleTargets",u=e.BaseCore,a=e.AttributeCore,f=e.Attribute;l._ATTR_CFG=f._ATTR_CFG.concat("cloneDefaultValue"),l._ATTR_CFG_HASH=e.Array.hash(l._ATTR_CFG),l._NON_ATTRS_CFG=u._NON_ATTRS_CFG.concat(["on","after","bubbleTargets"]),l.NAME="base",l.ATTRS=a.prototype._protectAttrs(u.ATTRS),l.prototype={_initBase:function(t){this._eventPrefix=this.constructor.EVENT_PREFIX||this.constructor.NAME,e.BaseCore.prototype._initBase.call(this,t)},_initAttribute:function(e){f.call(this),this._yuievt.config.prefix=this._eventPrefix},_attrCfgHash:function(){return l._ATTR_CFG_HASH},init:function(e){return this.publish(i,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defInitFn}),this._preInitEventCfg(e),this.fire(i,{cfg:e}),this},_preInitEventCfg:function(e){e&&(e.on&&this.on(e.on),e.after&&this.after(e.after));var t,r,i,u=e&&s in e;if(u||o in this){i=u?e&&e.bubbleTargets:this._bubbleTargets;if(n.isArray(i))for(t=0,r=i.length;t<r;t++)this.addTarget(i[t]);else i&&this.addTarget(i)}},destroy:function(){return this.publish(r,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defDestroyFn}),this.fire(r),this.detachAll(),this},_defInitFn:function(e){this._baseInit(e.cfg)},_defDestroyFn:function(e){this._baseDestroy(e.cfg)}},e.mix(l,f,!1,null,1),e.mix(l,u,!1,null,1),l.prototype.constructor=l,e.Base=l},"3.7.2",{requires:["base-core","attribute-base"]});+YUI.add("base-base",function(e,t){function l(){u.apply(this,arguments)}var n=e.Lang,r="destroy",i="init",s="bubbleTargets",o="_bubbleTargets",u=e.BaseCore,a=e.AttributeCore,f=e.Attribute;l._ATTR_CFG=f._ATTR_CFG.concat("cloneDefaultValue"),l._ATTR_CFG_HASH=e.Array.hash(l._ATTR_CFG),l._NON_ATTRS_CFG=u._NON_ATTRS_CFG.concat(["on","after","bubbleTargets"]),l.NAME="base",l.ATTRS=a.prototype._protectAttrs(u.ATTRS),l.prototype={_initBase:function(t){this._eventPrefix=this.constructor.EVENT_PREFIX||this.constructor.NAME,e.BaseCore.prototype._initBase.call(this,t)},_initAttribute:function(e){f.call(this),this._yuievt.config.prefix=this._eventPrefix},_attrCfgHash:function(){return l._ATTR_CFG_HASH},init:function(e){return this.publish(i,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defInitFn}),this._preInitEventCfg(e),this.fire(i,{cfg:e}),this},_preInitEventCfg:function(e){e&&(e.on&&this.on(e.on),e.after&&this.after(e.after));var t,r,i,u=e&&s in e;if(u||o in this){i=u?e&&e.bubbleTargets:this._bubbleTargets;if(n.isArray(i))for(t=0,r=i.length;t<r;t++)this.addTarget(i[t]);else i&&this.addTarget(i)}},destroy:function(){return this.publish(r,{queuable:!1,fireOnce:!0,defaultTargetOnly:!0,defaultFn:this._defDestroyFn}),this.fire(r),this.detachAll(),this},_defInitFn:function(e){this._baseInit(e.cfg)},_defDestroyFn:function(e){this._baseDestroy(e.cfg)}},e.mix(l,f,!1,null,1),e.mix(l,u,!1,null,1),l.prototype.constructor=l,e.Base=l},"3.7.3",{requires:["base-core","attribute-base"]});
bundle/base-base/base-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -349,4 +349,4 @@ Y.Base = Base; -}, '3.7.2', {"requires": ["base-core", "attribute-base"]});+}, '3.7.3', {"requires": ["base-core", "attribute-base"]});
bundle/base-build/base-build-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/base-build/base-build.js", code: [] };-_yuitest_coverage["build/base-build/base-build.js"].code=["YUI.add('base-build', function (Y, NAME) {",""," /**"," * The base-build submodule provides Base.build functionality, which"," * can be used to create custom classes, by aggregating extensions onto "," * a main class."," *"," * @module base"," * @submodule base-build"," * @for Base"," */"," var Base = Y.Base,"," L = Y.Lang,"," INITIALIZER = \"initializer\","," DESTRUCTOR = \"destructor\","," build,"," arrayAggregator = function (prop, r, s) {"," if (s[prop]) {"," r[prop] = (r[prop] || []).concat(s[prop]);"," } "," };",""," Base._build = function(name, main, extensions, px, sx, cfg) {",""," var build = Base._build,",""," builtClass = build._ctor(main, cfg),"," buildCfg = build._cfg(main, cfg, extensions),",""," _mixCust = build._mixCust,",""," dynamic = builtClass._yuibuild.dynamic,",""," i, l, extClass, extProto,"," initializer,"," destructor;",""," // Augment/Aggregate"," for (i = 0, l = extensions.length; i < l; i++) {"," extClass = extensions[i];",""," extProto = extClass.prototype;"," "," initializer = extProto[INITIALIZER];"," destructor = extProto[DESTRUCTOR];"," delete extProto[INITIALIZER];"," delete extProto[DESTRUCTOR];",""," // Prototype, old non-displacing augment"," Y.mix(builtClass, extClass, true, null, 1);",""," // Custom Statics"," _mixCust(builtClass, extClass, buildCfg);",""," if (initializer) { "," extProto[INITIALIZER] = initializer;"," }",""," if (destructor) {"," extProto[DESTRUCTOR] = destructor;"," }",""," builtClass._yuibuild.exts.push(extClass);"," }",""," if (px) {"," Y.mix(builtClass.prototype, px, true);"," }",""," if (sx) {"," Y.mix(builtClass, build._clean(sx, buildCfg), true);"," _mixCust(builtClass, sx, buildCfg);"," }",""," builtClass.prototype.hasImpl = build._impl;",""," if (dynamic) {"," builtClass.NAME = name;"," builtClass.prototype.constructor = builtClass;"," }",""," return builtClass;"," };",""," build = Base._build;",""," Y.mix(build, {",""," _mixCust: function(r, s, cfg) {"," "," var aggregates, "," custom, "," statics,"," aggr,"," l,"," i;"," "," if (cfg) {"," aggregates = cfg.aggregates;"," custom = cfg.custom;"," statics = cfg.statics;"," }",""," if (statics) {"," Y.mix(r, s, true, statics);"," }",""," if (aggregates) {"," for (i = 0, l = aggregates.length; i < l; i++) {"," aggr = aggregates[i];"," if (!r.hasOwnProperty(aggr) && s.hasOwnProperty(aggr)) {"," r[aggr] = L.isArray(s[aggr]) ? [] : {};"," }"," Y.aggregate(r, s, true, [aggr]);"," }"," }",""," if (custom) {"," for (i in custom) {"," if (custom.hasOwnProperty(i)) {"," custom[i](i, r, s);"," }"," }"," }"," "," },",""," _tmpl: function(main) {",""," function BuiltClass() {"," BuiltClass.superclass.constructor.apply(this, arguments);"," }"," Y.extend(BuiltClass, main);",""," return BuiltClass;"," },",""," _impl : function(extClass) {"," var classes = this._getClasses(), i, l, cls, exts, ll, j;"," for (i = 0, l = classes.length; i < l; i++) {"," cls = classes[i];"," if (cls._yuibuild) {"," exts = cls._yuibuild.exts;"," ll = exts.length;"," "," for (j = 0; j < ll; j++) {"," if (exts[j] === extClass) {"," return true;"," }"," }"," }"," }"," return false;"," },",""," _ctor : function(main, cfg) {",""," var dynamic = (cfg && false === cfg.dynamic) ? false : true,"," builtClass = (dynamic) ? build._tmpl(main) : main,"," buildCfg = builtClass._yuibuild;",""," if (!buildCfg) {"," buildCfg = builtClass._yuibuild = {};"," }",""," buildCfg.id = buildCfg.id || null;"," buildCfg.exts = buildCfg.exts || [];"," buildCfg.dynamic = dynamic;",""," return builtClass;"," },",""," _cfg : function(main, cfg, exts) {"," var aggr = [], "," cust = {},"," statics = [],"," buildCfg,"," cfgAggr = (cfg && cfg.aggregates),"," cfgCustBuild = (cfg && cfg.custom),"," cfgStatics = (cfg && cfg.statics),"," c = main,"," i, "," l;",""," // Prototype Chain"," while (c && c.prototype) {"," buildCfg = c._buildCfg;"," if (buildCfg) {"," if (buildCfg.aggregates) {"," aggr = aggr.concat(buildCfg.aggregates);"," }"," if (buildCfg.custom) {"," Y.mix(cust, buildCfg.custom, true);"," }"," if (buildCfg.statics) {"," statics = statics.concat(buildCfg.statics);"," }"," }"," c = c.superclass ? c.superclass.constructor : null;"," }",""," // Exts"," if (exts) {"," for (i = 0, l = exts.length; i < l; i++) {"," c = exts[i];"," buildCfg = c._buildCfg;"," if (buildCfg) {"," if (buildCfg.aggregates) {"," aggr = aggr.concat(buildCfg.aggregates);"," }"," if (buildCfg.custom) {"," Y.mix(cust, buildCfg.custom, true);"," }"," if (buildCfg.statics) {"," statics = statics.concat(buildCfg.statics);"," }"," } "," }"," }",""," if (cfgAggr) {"," aggr = aggr.concat(cfgAggr);"," }",""," if (cfgCustBuild) {"," Y.mix(cust, cfg.cfgBuild, true);"," }",""," if (cfgStatics) {"," statics = statics.concat(cfgStatics);"," }",""," return {"," aggregates: aggr,"," custom: cust,"," statics: statics"," };"," },",""," _clean : function(sx, cfg) {"," var prop, i, l, sxclone = Y.merge(sx),"," aggregates = cfg.aggregates,"," custom = cfg.custom;",""," for (prop in custom) {"," if (sxclone.hasOwnProperty(prop)) {"," delete sxclone[prop];"," }"," }",""," for (i = 0, l = aggregates.length; i < l; i++) {"," prop = aggregates[i];"," if (sxclone.hasOwnProperty(prop)) {"," delete sxclone[prop];"," }"," }",""," return sxclone;"," }"," });",""," /**"," * <p>"," * Builds a custom constructor function (class) from the"," * main function, and array of extension functions (classes)"," * provided. The NAME field for the constructor function is "," * defined by the first argument passed in."," * </p>"," * <p>"," * The cfg object supports the following properties"," * </p>"," * <dl>"," * <dt>dynamic <boolean></dt>"," * <dd>"," * <p>If true (default), a completely new class"," * is created which extends the main class, and acts as the "," * host on which the extension classes are augmented.</p>"," * <p>If false, the extensions classes are augmented directly to"," * the main class, modifying the main class' prototype.</p>"," * </dd>"," * <dt>aggregates <String[]></dt>"," * <dd>An array of static property names, which will get aggregated"," * on to the built class, in addition to the default properties build "," * will always aggregate as defined by the main class' static _buildCfg"," * property."," * </dd>"," * </dl>"," *"," * @method build"," * @deprecated Use the more convenient Base.create and Base.mix methods instead"," * @static"," * @param {Function} name The name of the new class. Used to define the NAME property for the new class."," * @param {Function} main The main class on which to base the built class"," * @param {Function[]} extensions The set of extension classes which will be"," * augmented/aggregated to the built class."," * @param {Object} cfg Optional. Build configuration for the class (see description)."," * @return {Function} A custom class, created from the provided main and extension classes"," */"," Base.build = function(name, main, extensions, cfg) {"," return build(name, main, extensions, null, null, cfg);"," };",""," /**"," * Creates a new class (constructor function) which extends the base class passed in as the second argument, "," * and mixes in the array of extensions provided."," * "," * Prototype properties or methods can be added to the new class, using the px argument (similar to Y.extend)."," * "," * Static properties or methods can be added to the new class, using the sx argument (similar to Y.extend)."," * "," * **NOTE FOR COMPONENT DEVELOPERS**: Both the `base` class, and `extensions` can define static a `_buildCfg` "," * property, which acts as class creation meta-data, and drives how special static properties from the base "," * class, or extensions should be copied, aggregated or (custom) mixed into the newly created class."," * "," * The `_buildCfg` property is a hash with 3 supported properties: `statics`, `aggregates` and `custom`, e.g:"," * "," * // If the Base/Main class is the thing introducing the property:"," * "," * MyBaseClass._buildCfg = {"," * "," * // Static properties/methods to copy (Alias) to the built class."," * statics: [\"CopyThisMethod\", \"CopyThisProperty\"],"," * "," * // Static props to aggregate onto the built class."," * aggregates: [\"AggregateThisProperty\"],"," * "," * // Static properties which need custom handling (e.g. deep merge etc.)"," * custom: {"," * \"CustomProperty\" : function(property, Receiver, Supplier) {"," * ..."," * var triggers = Receiver.CustomProperty.triggers; "," Receiver.CustomProperty.triggers = triggers.concat(Supplier.CustomProperty.triggers);"," * ..."," * }"," * }"," * };"," * "," * MyBaseClass.CopyThisMethod = function() {...}; "," * MyBaseClass.CopyThisProperty = \"foo\";"," * MyBaseClass.AggregateThisProperty = {...};"," * MyBaseClass.CustomProperty = {"," * triggers: [...]"," * }"," *"," * // Or, if the Extension is the thing introducing the property:"," * "," * MyExtension._buildCfg = {"," * statics : ..."," * aggregates : ..."," * custom : ... "," * } "," * "," * This way, when users pass your base or extension class to `Y.Base.create` or `Y.Base.mix`, they don't need to"," * know which properties need special handling. `Y.Base` has a buildCfg which defines `ATTRS` for custom mix handling"," * (to protect the static config objects), and `Y.Widget` has a buildCfg which specifies `HTML_PARSER` for "," * straight up aggregation."," *"," * @method create"," * @static"," * @param {Function} name The name of the newly created class. Used to define the NAME property for the new class."," * @param {Function} main The base class which the new class should extend. This class needs to be Base or a class derived from base (e.g. Widget)."," * @param {Function[]} extensions The list of extensions which will be mixed into the built class."," * @param {Object} px The set of prototype properties/methods to add to the built class."," * @param {Object} sx The set of static properties/methods to add to the built class."," * @return {Function} The newly created class."," */"," Base.create = function(name, base, extensions, px, sx) {"," return build(name, base, extensions, px, sx);"," };",""," /**"," * <p>Mixes in a list of extensions to an existing class.</p>"," * @method mix"," * @static"," * @param {Function} main The existing class into which the extensions should be mixed. The class needs to be Base or a class derived from Base (e.g. Widget)"," * @param {Function[]} extensions The set of extension classes which will mixed into the existing main class."," * @return {Function} The modified main class, with extensions mixed in."," */"," Base.mix = function(main, extensions) {"," return build(null, main, extensions, null, null, {dynamic:false});"," };",""," /**"," * The build configuration for the Base class."," *"," * Defines the static fields which need to be aggregated"," * when the Base class is used as the main class passed to"," * the <a href=\"#method_Base.build\">Base.build</a> method."," *"," * @property _buildCfg"," * @type Object"," * @static"," * @final"," * @private"," */"," Base._buildCfg = {"," custom : {"," ATTRS : function(prop, r, s) {",""," r.ATTRS = r.ATTRS || {};",""," if (s.ATTRS) {",""," var sAttrs = s.ATTRS,"," rAttrs = r.ATTRS,"," a;",""," for (a in sAttrs) {"," if (sAttrs.hasOwnProperty(a)) {"," rAttrs[a] = rAttrs[a] || {};"," Y.mix(rAttrs[a], sAttrs[a], true);"," }"," }"," }"," },"," _NON_ATTRS_CFG : arrayAggregator"," },"," aggregates : [\"_PLUG\", \"_UNPLUG\"]"," };","","","}, '3.7.2', {\"requires\": [\"base-base\"]});"];+_yuitest_coverage["build/base-build/base-build.js"].code=["YUI.add('base-build', function (Y, NAME) {",""," /**"," * The base-build submodule provides Base.build functionality, which"," * can be used to create custom classes, by aggregating extensions onto "," * a main class."," *"," * @module base"," * @submodule base-build"," * @for Base"," */"," var Base = Y.Base,"," L = Y.Lang,"," INITIALIZER = \"initializer\","," DESTRUCTOR = \"destructor\","," build,"," arrayAggregator = function (prop, r, s) {"," if (s[prop]) {"," r[prop] = (r[prop] || []).concat(s[prop]);"," } "," };",""," Base._build = function(name, main, extensions, px, sx, cfg) {",""," var build = Base._build,",""," builtClass = build._ctor(main, cfg),"," buildCfg = build._cfg(main, cfg, extensions),",""," _mixCust = build._mixCust,",""," dynamic = builtClass._yuibuild.dynamic,",""," i, l, extClass, extProto,"," initializer,"," destructor;",""," // Augment/Aggregate"," for (i = 0, l = extensions.length; i < l; i++) {"," extClass = extensions[i];",""," extProto = extClass.prototype;"," "," initializer = extProto[INITIALIZER];"," destructor = extProto[DESTRUCTOR];"," delete extProto[INITIALIZER];"," delete extProto[DESTRUCTOR];",""," // Prototype, old non-displacing augment"," Y.mix(builtClass, extClass, true, null, 1);",""," // Custom Statics"," _mixCust(builtClass, extClass, buildCfg);",""," if (initializer) { "," extProto[INITIALIZER] = initializer;"," }",""," if (destructor) {"," extProto[DESTRUCTOR] = destructor;"," }",""," builtClass._yuibuild.exts.push(extClass);"," }",""," if (px) {"," Y.mix(builtClass.prototype, px, true);"," }",""," if (sx) {"," Y.mix(builtClass, build._clean(sx, buildCfg), true);"," _mixCust(builtClass, sx, buildCfg);"," }",""," builtClass.prototype.hasImpl = build._impl;",""," if (dynamic) {"," builtClass.NAME = name;"," builtClass.prototype.constructor = builtClass;"," }",""," return builtClass;"," };",""," build = Base._build;",""," Y.mix(build, {",""," _mixCust: function(r, s, cfg) {"," "," var aggregates, "," custom, "," statics,"," aggr,"," l,"," i;"," "," if (cfg) {"," aggregates = cfg.aggregates;"," custom = cfg.custom;"," statics = cfg.statics;"," }",""," if (statics) {"," Y.mix(r, s, true, statics);"," }",""," if (aggregates) {"," for (i = 0, l = aggregates.length; i < l; i++) {"," aggr = aggregates[i];"," if (!r.hasOwnProperty(aggr) && s.hasOwnProperty(aggr)) {"," r[aggr] = L.isArray(s[aggr]) ? [] : {};"," }"," Y.aggregate(r, s, true, [aggr]);"," }"," }",""," if (custom) {"," for (i in custom) {"," if (custom.hasOwnProperty(i)) {"," custom[i](i, r, s);"," }"," }"," }"," "," },",""," _tmpl: function(main) {",""," function BuiltClass() {"," BuiltClass.superclass.constructor.apply(this, arguments);"," }"," Y.extend(BuiltClass, main);",""," return BuiltClass;"," },",""," _impl : function(extClass) {"," var classes = this._getClasses(), i, l, cls, exts, ll, j;"," for (i = 0, l = classes.length; i < l; i++) {"," cls = classes[i];"," if (cls._yuibuild) {"," exts = cls._yuibuild.exts;"," ll = exts.length;"," "," for (j = 0; j < ll; j++) {"," if (exts[j] === extClass) {"," return true;"," }"," }"," }"," }"," return false;"," },",""," _ctor : function(main, cfg) {",""," var dynamic = (cfg && false === cfg.dynamic) ? false : true,"," builtClass = (dynamic) ? build._tmpl(main) : main,"," buildCfg = builtClass._yuibuild;",""," if (!buildCfg) {"," buildCfg = builtClass._yuibuild = {};"," }",""," buildCfg.id = buildCfg.id || null;"," buildCfg.exts = buildCfg.exts || [];"," buildCfg.dynamic = dynamic;",""," return builtClass;"," },",""," _cfg : function(main, cfg, exts) {"," var aggr = [], "," cust = {},"," statics = [],"," buildCfg,"," cfgAggr = (cfg && cfg.aggregates),"," cfgCustBuild = (cfg && cfg.custom),"," cfgStatics = (cfg && cfg.statics),"," c = main,"," i, "," l;",""," // Prototype Chain"," while (c && c.prototype) {"," buildCfg = c._buildCfg;"," if (buildCfg) {"," if (buildCfg.aggregates) {"," aggr = aggr.concat(buildCfg.aggregates);"," }"," if (buildCfg.custom) {"," Y.mix(cust, buildCfg.custom, true);"," }"," if (buildCfg.statics) {"," statics = statics.concat(buildCfg.statics);"," }"," }"," c = c.superclass ? c.superclass.constructor : null;"," }",""," // Exts"," if (exts) {"," for (i = 0, l = exts.length; i < l; i++) {"," c = exts[i];"," buildCfg = c._buildCfg;"," if (buildCfg) {"," if (buildCfg.aggregates) {"," aggr = aggr.concat(buildCfg.aggregates);"," }"," if (buildCfg.custom) {"," Y.mix(cust, buildCfg.custom, true);"," }"," if (buildCfg.statics) {"," statics = statics.concat(buildCfg.statics);"," }"," } "," }"," }",""," if (cfgAggr) {"," aggr = aggr.concat(cfgAggr);"," }",""," if (cfgCustBuild) {"," Y.mix(cust, cfg.cfgBuild, true);"," }",""," if (cfgStatics) {"," statics = statics.concat(cfgStatics);"," }",""," return {"," aggregates: aggr,"," custom: cust,"," statics: statics"," };"," },",""," _clean : function(sx, cfg) {"," var prop, i, l, sxclone = Y.merge(sx),"," aggregates = cfg.aggregates,"," custom = cfg.custom;",""," for (prop in custom) {"," if (sxclone.hasOwnProperty(prop)) {"," delete sxclone[prop];"," }"," }",""," for (i = 0, l = aggregates.length; i < l; i++) {"," prop = aggregates[i];"," if (sxclone.hasOwnProperty(prop)) {"," delete sxclone[prop];"," }"," }",""," return sxclone;"," }"," });",""," /**"," * <p>"," * Builds a custom constructor function (class) from the"," * main function, and array of extension functions (classes)"," * provided. The NAME field for the constructor function is "," * defined by the first argument passed in."," * </p>"," * <p>"," * The cfg object supports the following properties"," * </p>"," * <dl>"," * <dt>dynamic <boolean></dt>"," * <dd>"," * <p>If true (default), a completely new class"," * is created which extends the main class, and acts as the "," * host on which the extension classes are augmented.</p>"," * <p>If false, the extensions classes are augmented directly to"," * the main class, modifying the main class' prototype.</p>"," * </dd>"," * <dt>aggregates <String[]></dt>"," * <dd>An array of static property names, which will get aggregated"," * on to the built class, in addition to the default properties build "," * will always aggregate as defined by the main class' static _buildCfg"," * property."," * </dd>"," * </dl>"," *"," * @method build"," * @deprecated Use the more convenient Base.create and Base.mix methods instead"," * @static"," * @param {Function} name The name of the new class. Used to define the NAME property for the new class."," * @param {Function} main The main class on which to base the built class"," * @param {Function[]} extensions The set of extension classes which will be"," * augmented/aggregated to the built class."," * @param {Object} cfg Optional. Build configuration for the class (see description)."," * @return {Function} A custom class, created from the provided main and extension classes"," */"," Base.build = function(name, main, extensions, cfg) {"," return build(name, main, extensions, null, null, cfg);"," };",""," /**"," * Creates a new class (constructor function) which extends the base class passed in as the second argument, "," * and mixes in the array of extensions provided."," * "," * Prototype properties or methods can be added to the new class, using the px argument (similar to Y.extend)."," * "," * Static properties or methods can be added to the new class, using the sx argument (similar to Y.extend)."," * "," * **NOTE FOR COMPONENT DEVELOPERS**: Both the `base` class, and `extensions` can define static a `_buildCfg` "," * property, which acts as class creation meta-data, and drives how special static properties from the base "," * class, or extensions should be copied, aggregated or (custom) mixed into the newly created class."," * "," * The `_buildCfg` property is a hash with 3 supported properties: `statics`, `aggregates` and `custom`, e.g:"," * "," * // If the Base/Main class is the thing introducing the property:"," * "," * MyBaseClass._buildCfg = {"," * "," * // Static properties/methods to copy (Alias) to the built class."," * statics: [\"CopyThisMethod\", \"CopyThisProperty\"],"," * "," * // Static props to aggregate onto the built class."," * aggregates: [\"AggregateThisProperty\"],"," * "," * // Static properties which need custom handling (e.g. deep merge etc.)"," * custom: {"," * \"CustomProperty\" : function(property, Receiver, Supplier) {"," * ..."," * var triggers = Receiver.CustomProperty.triggers; "," Receiver.CustomProperty.triggers = triggers.concat(Supplier.CustomProperty.triggers);"," * ..."," * }"," * }"," * };"," * "," * MyBaseClass.CopyThisMethod = function() {...}; "," * MyBaseClass.CopyThisProperty = \"foo\";"," * MyBaseClass.AggregateThisProperty = {...};"," * MyBaseClass.CustomProperty = {"," * triggers: [...]"," * }"," *"," * // Or, if the Extension is the thing introducing the property:"," * "," * MyExtension._buildCfg = {"," * statics : ..."," * aggregates : ..."," * custom : ... "," * } "," * "," * This way, when users pass your base or extension class to `Y.Base.create` or `Y.Base.mix`, they don't need to"," * know which properties need special handling. `Y.Base` has a buildCfg which defines `ATTRS` for custom mix handling"," * (to protect the static config objects), and `Y.Widget` has a buildCfg which specifies `HTML_PARSER` for "," * straight up aggregation."," *"," * @method create"," * @static"," * @param {Function} name The name of the newly created class. Used to define the NAME property for the new class."," * @param {Function} main The base class which the new class should extend. This class needs to be Base or a class derived from base (e.g. Widget)."," * @param {Function[]} extensions The list of extensions which will be mixed into the built class."," * @param {Object} px The set of prototype properties/methods to add to the built class."," * @param {Object} sx The set of static properties/methods to add to the built class."," * @return {Function} The newly created class."," */"," Base.create = function(name, base, extensions, px, sx) {"," return build(name, base, extensions, px, sx);"," };",""," /**"," * <p>Mixes in a list of extensions to an existing class.</p>"," * @method mix"," * @static"," * @param {Function} main The existing class into which the extensions should be mixed. The class needs to be Base or a class derived from Base (e.g. Widget)"," * @param {Function[]} extensions The set of extension classes which will mixed into the existing main class."," * @return {Function} The modified main class, with extensions mixed in."," */"," Base.mix = function(main, extensions) {"," return build(null, main, extensions, null, null, {dynamic:false});"," };",""," /**"," * The build configuration for the Base class."," *"," * Defines the static fields which need to be aggregated"," * when the Base class is used as the main class passed to"," * the <a href=\"#method_Base.build\">Base.build</a> method."," *"," * @property _buildCfg"," * @type Object"," * @static"," * @final"," * @private"," */"," Base._buildCfg = {"," custom : {"," ATTRS : function(prop, r, s) {",""," r.ATTRS = r.ATTRS || {};",""," if (s.ATTRS) {",""," var sAttrs = s.ATTRS,"," rAttrs = r.ATTRS,"," a;",""," for (a in sAttrs) {"," if (sAttrs.hasOwnProperty(a)) {"," rAttrs[a] = rAttrs[a] || {};"," Y.mix(rAttrs[a], sAttrs[a], true);"," }"," }"," }"," },"," _NON_ATTRS_CFG : arrayAggregator"," },"," aggregates : [\"_PLUG\", \"_UNPLUG\"]"," };","","","}, '3.7.3', {\"requires\": [\"base-base\"]});"]; _yuitest_coverage["build/base-build/base-build.js"].lines = {"1":0,"12":0,"18":0,"19":0,"23":0,"25":0,"39":0,"40":0,"42":0,"44":0,"45":0,"46":0,"47":0,"50":0,"53":0,"55":0,"56":0,"59":0,"60":0,"63":0,"66":0,"67":0,"70":0,"71":0,"72":0,"75":0,"77":0,"78":0,"79":0,"82":0,"85":0,"87":0,"91":0,"98":0,"99":0,"100":0,"101":0,"104":0,"105":0,"108":0,"109":0,"110":0,"111":0,"112":0,"114":0,"118":0,"119":0,"120":0,"121":0,"130":0,"131":0,"133":0,"135":0,"139":0,"140":0,"141":0,"142":0,"143":0,"144":0,"146":0,"147":0,"148":0,"153":0,"158":0,"162":0,"163":0,"166":0,"167":0,"168":0,"170":0,"174":0,"186":0,"187":0,"188":0,"189":0,"190":0,"192":0,"193":0,"195":0,"196":0,"199":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"211":0,"212":0,"214":0,"215":0,"221":0,"222":0,"225":0,"226":0,"229":0,"230":0,"233":0,"241":0,"245":0,"246":0,"247":0,"251":0,"252":0,"253":0,"254":0,"258":0,"299":0,"300":0,"367":0,"368":0,"379":0,"380":0,"396":0,"400":0,"402":0,"404":0,"408":0,"409":0,"410":0,"411":0}; _yuitest_coverage["build/base-build/base-build.js"].functions = {"arrayAggregator:17":0,"_build:23":0,"_mixCust:89":0,"BuiltClass:130":0,"_tmpl:128":0,"_impl:138":0,"_ctor:156":0,"_cfg:173":0,"_clean:240":0,"build:299":0,"create:367":0,"mix:379":0,"ATTRS:398":0,"(anonymous 1):1":0}; _yuitest_coverage["build/base-build/base-build.js"].coveredLines = 122;@@ -594,4 +594,4 @@ }; -}, '3.7.2', {"requires": ["base-base"]});+}, '3.7.3', {"requires": ["base-base"]});
bundle/base-build/base-build-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -425,4 +425,4 @@ }; -}, '3.7.2', {"requires": ["base-base"]});+}, '3.7.3', {"requires": ["base-base"]});
bundle/base-build/base-build-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-build",function(e,t){var n=e.Base,r=e.Lang,i="initializer",s="destructor",o,u=function(e,t,n){n[e]&&(t[e]=(t[e]||[]).concat(n[e]))};n._build=function(t,r,o,u,a,f){var l=n._build,c=l._ctor(r,f),h=l._cfg(r,f,o),p=l._mixCust,d=c._yuibuild.dynamic,v,m,g,y,b,w;for(v=0,m=o.length;v<m;v++)g=o[v],y=g.prototype,b=y[i],w=y[s],delete y[i],delete y[s],e.mix(c,g,!0,null,1),p(c,g,h),b&&(y[i]=b),w&&(y[s]=w),c._yuibuild.exts.push(g);return u&&e.mix(c.prototype,u,!0),a&&(e.mix(c,l._clean(a,h),!0),p(c,a,h)),c.prototype.hasImpl=l._impl,d&&(c.NAME=t,c.prototype.constructor=c),c},o=n._build,e.mix(o,{_mixCust:function(t,n,i){var s,o,u,a,f,l;i&&(s=i.aggregates,o=i.custom,u=i.statics),u&&e.mix(t,n,!0,u);if(s)for(l=0,f=s.length;l<f;l++)a=s[l],!t.hasOwnProperty(a)&&n.hasOwnProperty(a)&&(t[a]=r.isArray(n[a])?[]:{}),e.aggregate(t,n,!0,[a]);if(o)for(l in o)o.hasOwnProperty(l)&&o[l](l,t,n)},_tmpl:function(t){function n(){n.superclass.constructor.apply(this,arguments)}return e.extend(n,t),n},_impl:function(e){var t=this._getClasses(),n,r,i,s,o,u;for(n=0,r=t.length;n<r;n++){i=t[n];if(i._yuibuild){s=i._yuibuild.exts,o=s.length;for(u=0;u<o;u++)if(s[u]===e)return!0}}return!1},_ctor:function(e,t){var n=t&&!1===t.dynamic?!1:!0,r=n?o._tmpl(e):e,i=r._yuibuild;return i||(i=r._yuibuild={}),i.id=i.id||null,i.exts=i.exts||[],i.dynamic=n,r},_cfg:function(t,n,r){var i=[],s={},o=[],u,a=n&&n.aggregates,f=n&&n.custom,l=n&&n.statics,c=t,h,p;while(c&&c.prototype)u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics))),c=c.superclass?c.superclass.constructor:null;if(r)for(h=0,p=r.length;h<p;h++)c=r[h],u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics)));return a&&(i=i.concat(a)),f&&e.mix(s,n.cfgBuild,!0),l&&(o=o.concat(l)),{aggregates:i,custom:s,statics:o}},_clean:function(t,n){var r,i,s,o=e.merge(t),u=n.aggregates,a=n.custom;for(r in a)o.hasOwnProperty(r)&&delete o[r];for(i=0,s=u.length;i<s;i++)r=u[i],o.hasOwnProperty(r)&&delete o[r];return o}}),n.build=function(e,t,n,r){return o(e,t,n,null,null,r)},n.create=function(e,t,n,r,i){return o(e,t,n,r,i)},n.mix=function(e,t){return o(null,e,t,null,null,{dynamic:!1})},n._buildCfg={custom:{ATTRS:function(t,n,r){n.ATTRS=n.ATTRS||{};if(r.ATTRS){var i=r.ATTRS,s=n.ATTRS,o;for(o in i)i.hasOwnProperty(o)&&(s[o]=s[o]||{},e.mix(s[o],i[o],!0))}},_NON_ATTRS_CFG:u},aggregates:["_PLUG","_UNPLUG"]}},"3.7.2",{requires:["base-base"]});+YUI.add("base-build",function(e,t){var n=e.Base,r=e.Lang,i="initializer",s="destructor",o,u=function(e,t,n){n[e]&&(t[e]=(t[e]||[]).concat(n[e]))};n._build=function(t,r,o,u,a,f){var l=n._build,c=l._ctor(r,f),h=l._cfg(r,f,o),p=l._mixCust,d=c._yuibuild.dynamic,v,m,g,y,b,w;for(v=0,m=o.length;v<m;v++)g=o[v],y=g.prototype,b=y[i],w=y[s],delete y[i],delete y[s],e.mix(c,g,!0,null,1),p(c,g,h),b&&(y[i]=b),w&&(y[s]=w),c._yuibuild.exts.push(g);return u&&e.mix(c.prototype,u,!0),a&&(e.mix(c,l._clean(a,h),!0),p(c,a,h)),c.prototype.hasImpl=l._impl,d&&(c.NAME=t,c.prototype.constructor=c),c},o=n._build,e.mix(o,{_mixCust:function(t,n,i){var s,o,u,a,f,l;i&&(s=i.aggregates,o=i.custom,u=i.statics),u&&e.mix(t,n,!0,u);if(s)for(l=0,f=s.length;l<f;l++)a=s[l],!t.hasOwnProperty(a)&&n.hasOwnProperty(a)&&(t[a]=r.isArray(n[a])?[]:{}),e.aggregate(t,n,!0,[a]);if(o)for(l in o)o.hasOwnProperty(l)&&o[l](l,t,n)},_tmpl:function(t){function n(){n.superclass.constructor.apply(this,arguments)}return e.extend(n,t),n},_impl:function(e){var t=this._getClasses(),n,r,i,s,o,u;for(n=0,r=t.length;n<r;n++){i=t[n];if(i._yuibuild){s=i._yuibuild.exts,o=s.length;for(u=0;u<o;u++)if(s[u]===e)return!0}}return!1},_ctor:function(e,t){var n=t&&!1===t.dynamic?!1:!0,r=n?o._tmpl(e):e,i=r._yuibuild;return i||(i=r._yuibuild={}),i.id=i.id||null,i.exts=i.exts||[],i.dynamic=n,r},_cfg:function(t,n,r){var i=[],s={},o=[],u,a=n&&n.aggregates,f=n&&n.custom,l=n&&n.statics,c=t,h,p;while(c&&c.prototype)u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics))),c=c.superclass?c.superclass.constructor:null;if(r)for(h=0,p=r.length;h<p;h++)c=r[h],u=c._buildCfg,u&&(u.aggregates&&(i=i.concat(u.aggregates)),u.custom&&e.mix(s,u.custom,!0),u.statics&&(o=o.concat(u.statics)));return a&&(i=i.concat(a)),f&&e.mix(s,n.cfgBuild,!0),l&&(o=o.concat(l)),{aggregates:i,custom:s,statics:o}},_clean:function(t,n){var r,i,s,o=e.merge(t),u=n.aggregates,a=n.custom;for(r in a)o.hasOwnProperty(r)&&delete o[r];for(i=0,s=u.length;i<s;i++)r=u[i],o.hasOwnProperty(r)&&delete o[r];return o}}),n.build=function(e,t,n,r){return o(e,t,n,null,null,r)},n.create=function(e,t,n,r,i){return o(e,t,n,r,i)},n.mix=function(e,t){return o(null,e,t,null,null,{dynamic:!1})},n._buildCfg={custom:{ATTRS:function(t,n,r){n.ATTRS=n.ATTRS||{};if(r.ATTRS){var i=r.ATTRS,s=n.ATTRS,o;for(o in i)i.hasOwnProperty(o)&&(s[o]=s[o]||{},e.mix(s[o],i[o],!0))}},_NON_ATTRS_CFG:u},aggregates:["_PLUG","_UNPLUG"]}},"3.7.3",{requires:["base-base"]});
bundle/base-build/base-build.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -425,4 +425,4 @@ }; -}, '3.7.2', {"requires": ["base-base"]});+}, '3.7.3', {"requires": ["base-base"]});
bundle/base-core/base-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/base-core/base-core.js", code: [] };-_yuitest_coverage["build/base-core/base-core.js"].code=["YUI.add('base-core', function (Y, NAME) {",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * <p>The base-core module provides the BaseCore class, the lightest version of Base, "," * which provides Base's basic lifecycle management and ATTRS construction support, "," * but doesn't fire init/destroy or attribute change events.</p> "," * "," * <p>It mixes in AttributeCore, which is the lightest version of Attribute</p>"," *"," * @module base"," * @submodule base-core"," */"," var O = Y.Object,"," L = Y.Lang,"," DOT = \".\","," INITIALIZED = \"initialized\","," DESTROYED = \"destroyed\","," INITIALIZER = \"initializer\","," VALUE = \"value\","," OBJECT_CONSTRUCTOR = Object.prototype.constructor,"," DEEP = \"deep\","," SHALLOW = \"shallow\","," DESTRUCTOR = \"destructor\",",""," AttributeCore = Y.AttributeCore,",""," _wlmix = function(r, s, wlhash) {"," var p;"," for (p in s) {"," if(wlhash[p]) { "," r[p] = s[p];"," }"," }"," return r;"," };",""," /**"," * The BaseCore class, is the lightest version of Base, and provides Base's "," * basic lifecycle management and ATTRS construction support, but doesn't "," * fire init/destroy or attribute change events."," *"," * BaseCore also handles the chaining of initializer and destructor methods across "," * the hierarchy as part of object construction and destruction. Additionally, attributes "," * configured through the static <a href=\"#property_BaseCore.ATTRS\">ATTRS</a> "," * property for each class in the hierarchy will be initialized by BaseCore."," *"," * Classes which require attribute support, but don't intend to use/expose attribute "," * change events can extend BaseCore instead of Base for optimal kweight and "," * runtime performance."," * "," * @class BaseCore"," * @constructor"," * @uses AttributeCore"," * @param {Object} cfg Object with configuration property name/value pairs. "," * The object can be used to provide initial values for the objects published "," * attributes."," */"," function BaseCore(cfg) {"," if (!this._BaseInvoked) {"," this._BaseInvoked = true;",""," this._initBase(cfg);"," }"," }",""," /**"," * The list of properties which can be configured for each attribute "," * (e.g. setter, getter, writeOnce, readOnly etc.)"," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @private"," */"," BaseCore._ATTR_CFG = AttributeCore._ATTR_CFG.concat(\"cloneDefaultValue\");"," BaseCore._ATTR_CFG_HASH = Y.Array.hash(BaseCore._ATTR_CFG);",""," /**"," * The array of non-attribute configuration properties supported by this class. "," * "," * For example `BaseCore` defines a \"plugins\" configuration property which "," * should not be set up as an attribute. This property is primarily required so "," * that when <a href=\"#property__allowAdHocAttrs\">`_allowAdHocAttrs`</a> is enabled by a class, "," * non-attribute configuration properties don't get added as ad-hoc attributes. "," *"," * @property _NON_ATTRS_CFG"," * @type Array"," * @static"," * @private"," */"," BaseCore._NON_ATTRS_CFG = [\"plugins\"];",""," /**"," * This property controls whether or not instances of this class should"," * allow users to add ad-hoc attributes through the constructor configuration "," * hash."," *"," * AdHoc attributes are attributes which are not defined by the class, and are "," * not handled by the MyClass._NON_ATTRS_CFG "," * "," * @property _allowAdHocAttrs"," * @type boolean"," * @default undefined (false)"," * @protected"," */",""," /**"," * The string to be used to identify instances of this class."," * "," * Classes extending BaseCore, should define their own"," * static NAME property, which should be camelCase by"," * convention (e.g. MyClass.NAME = \"myClass\";)."," *"," * @property NAME"," * @type String"," * @static"," */"," BaseCore.NAME = \"baseCore\";",""," /**"," * The default set of attributes which will be available for instances of this class, and "," * their configuration. In addition to the configuration properties listed by "," * AttributeCore's <a href=\"AttributeCore.html#method_addAttr\">addAttr</a> method, "," * the attribute can also be configured with a \"cloneDefaultValue\" property, which "," * defines how the statically defined value field should be protected "," * (\"shallow\", \"deep\" and false are supported values). "," *"," * By default if the value is an object literal or an array it will be \"shallow\" "," * cloned, to protect the default value."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," BaseCore.ATTRS = {"," /**"," * Flag indicating whether or not this object"," * has been through the init lifecycle phase."," *"," * @attribute initialized"," * @readonly"," * @default false"," * @type boolean"," */"," initialized: {"," readOnly:true,"," value:false"," },",""," /**"," * Flag indicating whether or not this object"," * has been through the destroy lifecycle phase."," *"," * @attribute destroyed"," * @readonly"," * @default false"," * @type boolean"," */"," destroyed: {"," readOnly:true,"," value:false"," }"," };",""," BaseCore.prototype = {",""," /**"," * Internal construction logic for BaseCore."," *"," * @method _initBase"," * @param {Object} config The constructor configuration object"," * @private"," */"," _initBase : function(config) {",""," Y.stamp(this);",""," this._initAttribute(config);",""," // If Plugin.Host has been augmented [ through base-pluginhost ], setup it's"," // initial state, but don't initialize Plugins yet. That's done after initialization."," var PluginHost = Y.Plugin && Y.Plugin.Host;"," if (this._initPlugins && PluginHost) {"," PluginHost.call(this);"," }",""," if (this._lazyAddAttrs !== false) { this._lazyAddAttrs = true; }",""," /**"," * The string used to identify the class of this object."," *"," * @deprecated Use this.constructor.NAME"," * @property name"," * @type String"," */"," this.name = this.constructor.NAME;"," "," this.init.apply(this, arguments);"," },",""," /**"," * Initializes AttributeCore "," * "," * @method _initAttribute"," * @private"," */"," _initAttribute: function() {"," AttributeCore.apply(this);"," },",""," /**"," * Init lifecycle method, invoked during construction. Sets up attributes "," * and invokes initializers for the class hierarchy."," *"," * @method init"," * @chainable"," * @param {Object} cfg Object with configuration property name/value pairs"," * @return {BaseCore} A reference to this object"," */"," init: function(cfg) {",""," this._baseInit(cfg);",""," return this;"," },",""," /**"," * Internal initialization implementation for BaseCore"," *"," * @method _baseInit"," * @private"," */"," _baseInit: function(cfg) {"," this._initHierarchy(cfg);",""," if (this._initPlugins) {"," // Need to initPlugins manually, to handle constructor parsing, static Plug parsing"," this._initPlugins(cfg);"," }"," this._set(INITIALIZED, true);"," },",""," /**"," * Destroy lifecycle method. Invokes destructors for the class hierarchy."," *"," * @method destroy"," * @return {BaseCore} A reference to this object"," * @chainable"," */"," destroy: function() {"," this._baseDestroy();"," return this;"," },",""," /**"," * Internal destroy implementation for BaseCore"," *"," * @method _baseDestroy"," * @private"," */"," _baseDestroy : function() {"," if (this._destroyPlugins) {"," this._destroyPlugins();"," }"," this._destroyHierarchy();"," this._set(DESTROYED, true);"," },",""," /**"," * Returns the class hierarchy for this object, with BaseCore being the last class in the array."," *"," * @method _getClasses"," * @protected"," * @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object."," * This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the "," * cached value."," */"," _getClasses : function() {"," if (!this._classes) {"," this._initHierarchyData();"," }"," return this._classes;"," },",""," /**"," * Returns an aggregated set of attribute configurations, by traversing "," * the class hierarchy."," *"," * @method _getAttrCfgs"," * @protected"," * @return {Object} The hash of attribute configurations, aggregated across classes in the hierarchy"," * This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return"," * the cached value."," */"," _getAttrCfgs : function() {"," if (!this._attrs) {"," this._initHierarchyData();"," }"," return this._attrs;"," },",""," /**"," * A helper method used when processing ATTRS across the class hierarchy during "," * initialization. Returns a disposable object with the attributes defined for "," * the provided class, extracted from the set of all attributes passed in."," *"," * @method _filterAttrCfs"," * @private"," *"," * @param {Function} clazz The class for which the desired attributes are required."," * @param {Object} allCfgs The set of all attribute configurations for this instance. "," * Attributes will be removed from this set, if they belong to the filtered class, so"," * that by the time all classes are processed, allCfgs will be empty."," * "," * @return {Object} The set of attributes belonging to the class passed in, in the form"," * of an object with attribute name/configuration pairs."," */"," _filterAttrCfgs : function(clazz, allCfgs) {"," var cfgs = null, attr, attrs = clazz.ATTRS;",""," if (attrs) {"," for (attr in attrs) {"," if (allCfgs[attr]) {"," cfgs = cfgs || {};"," cfgs[attr] = allCfgs[attr];"," allCfgs[attr] = null;"," }"," }"," }",""," return cfgs;"," },",""," /**"," * @method _filterAdHocAttrs"," * @private"," *"," * @param {Object} allAttrs The set of all attribute configurations for this instance. "," * Attributes will be removed from this set, if they belong to the filtered class, so"," * that by the time all classes are processed, allCfgs will be empty."," * @param {Object} userVals The config object passed in by the user, from which adhoc attrs are to be filtered."," * @return {Object} The set of adhoc attributes passed in, in the form"," * of an object with attribute name/configuration pairs."," */"," _filterAdHocAttrs : function(allAttrs, userVals) {"," var adHocs,"," nonAttrs = this._nonAttrs,"," attr;",""," if (userVals) {"," adHocs = {};"," for (attr in userVals) {"," if (!allAttrs[attr] && !nonAttrs[attr] && userVals.hasOwnProperty(attr)) {"," adHocs[attr] = {"," value:userVals[attr]"," };"," }"," }"," }",""," return adHocs;"," },",""," /**"," * A helper method used by _getClasses and _getAttrCfgs, which determines both"," * the array of classes and aggregate set of attribute configurations"," * across the class hierarchy for the instance."," *"," * @method _initHierarchyData"," * @private"," */"," _initHierarchyData : function() {"," var c = this.constructor,"," i,"," l,"," nonAttrsCfg,"," nonAttrs = (this._allowAdHocAttrs) ? {} : null,"," classes = [],"," attrs = [];",""," while (c) {"," // Add to classes"," classes[classes.length] = c;",""," // Add to attributes"," if (c.ATTRS) {"," attrs[attrs.length] = c.ATTRS;"," }",""," if (this._allowAdHocAttrs) {"," nonAttrsCfg = c._NON_ATTRS_CFG; "," if (nonAttrsCfg) {"," for (i = 0, l = nonAttrsCfg.length; i < l; i++) {"," nonAttrs[nonAttrsCfg[i]] = true;"," }"," }"," }",""," c = c.superclass ? c.superclass.constructor : null;"," }",""," this._classes = classes;"," this._nonAttrs = nonAttrs;"," this._attrs = this._aggregateAttrs(attrs);"," },",""," /**"," * Utility method to define the attribute hash used to filter/whitelist property mixes for "," * this class. "," * "," * @method _attrCfgHash"," * @private"," */"," _attrCfgHash: function() {"," return BaseCore._ATTR_CFG_HASH;"," },",""," /**"," * A helper method, used by _initHierarchyData to aggregate "," * attribute configuration across the instances class hierarchy."," *"," * The method will protect the attribute configuration value to protect the statically defined "," * default value in ATTRS if required (if the value is an object literal, array or the "," * attribute configuration has cloneDefaultValue set to shallow or deep)."," *"," * @method _aggregateAttrs"," * @private"," * @param {Array} allAttrs An array of ATTRS definitions across classes in the hierarchy "," * (subclass first, Base last)"," * @return {Object} The aggregate set of ATTRS definitions for the instance"," */"," _aggregateAttrs : function(allAttrs) {"," var attr,"," attrs,"," cfg,"," val,"," path,"," i,"," clone,"," cfgPropsHash = this._attrCfgHash(),"," aggAttr,"," aggAttrs = {};",""," if (allAttrs) {"," for (i = allAttrs.length-1; i >= 0; --i) {"," attrs = allAttrs[i];",""," for (attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {",""," // Protect config passed in"," cfg = _wlmix({}, attrs[attr], cfgPropsHash);",""," val = cfg.value;"," clone = cfg.cloneDefaultValue;",""," if (val) {"," if ( (clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val))) || clone === DEEP || clone === true) {"," cfg.value = Y.clone(val);"," } else if (clone === SHALLOW) {"," cfg.value = Y.merge(val);"," }"," // else if (clone === false), don't clone the static default value. "," // It's intended to be used by reference."," }",""," path = null;"," if (attr.indexOf(DOT) !== -1) {"," path = attr.split(DOT);"," attr = path.shift();"," }",""," aggAttr = aggAttrs[attr];"," if (path && aggAttr && aggAttr.value) {"," O.setValue(aggAttr.value, path, val);"," } else if (!path) {"," if (!aggAttr) {"," aggAttrs[attr] = cfg;"," } else {"," if (aggAttr.valueFn && VALUE in cfg) {"," aggAttr.valueFn = null; "," }"," _wlmix(aggAttr, cfg, cfgPropsHash);"," }"," }"," }"," }"," }"," }",""," return aggAttrs;"," },",""," /**"," * Initializes the class hierarchy for the instance, which includes "," * initializing attributes for each class defined in the class's "," * static <a href=\"#property_BaseCore.ATTRS\">ATTRS</a> property and "," * invoking the initializer method on the prototype of each class in the hierarchy."," *"," * @method _initHierarchy"," * @param {Object} userVals Object with configuration property name/value pairs"," * @private"," */"," _initHierarchy : function(userVals) {"," var lazy = this._lazyAddAttrs,"," constr,"," constrProto,"," ci,"," ei,"," el,"," extProto,"," exts,"," classes = this._getClasses(),"," attrCfgs = this._getAttrCfgs(),"," cl = classes.length - 1;",""," for (ci = cl; ci >= 0; ci--) {",""," constr = classes[ci];"," constrProto = constr.prototype;"," exts = constr._yuibuild && constr._yuibuild.exts; ",""," if (exts) {"," for (ei = 0, el = exts.length; ei < el; ei++) {"," exts[ei].apply(this, arguments);"," }"," }",""," this.addAttrs(this._filterAttrCfgs(constr, attrCfgs), userVals, lazy);",""," if (this._allowAdHocAttrs && ci === cl) { "," this.addAttrs(this._filterAdHocAttrs(attrCfgs, userVals), userVals, lazy);"," }",""," // Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when"," // referencing string literals). Not using it in apply, again, for performance \".\" is faster. "," if (constrProto.hasOwnProperty(INITIALIZER)) {"," constrProto.initializer.apply(this, arguments);"," }",""," if (exts) {"," for (ei = 0; ei < el; ei++) {"," extProto = exts[ei].prototype;"," if (extProto.hasOwnProperty(INITIALIZER)) {"," extProto.initializer.apply(this, arguments);"," }"," }"," }"," }"," },",""," /**"," * Destroys the class hierarchy for this instance by invoking"," * the destructor method on the prototype of each class in the hierarchy."," *"," * @method _destroyHierarchy"," * @private"," */"," _destroyHierarchy : function() {"," var constr,"," constrProto,"," ci, cl, ei, el, exts, extProto,"," classes = this._getClasses();",""," for (ci = 0, cl = classes.length; ci < cl; ci++) {"," constr = classes[ci];"," constrProto = constr.prototype;"," exts = constr._yuibuild && constr._yuibuild.exts; ",""," if (exts) {"," for (ei = 0, el = exts.length; ei < el; ei++) {"," extProto = exts[ei].prototype;"," if (extProto.hasOwnProperty(DESTRUCTOR)) {"," extProto.destructor.apply(this, arguments);"," }"," }"," }",""," if (constrProto.hasOwnProperty(DESTRUCTOR)) {"," constrProto.destructor.apply(this, arguments);"," }"," }"," },",""," /**"," * Default toString implementation. Provides the constructor NAME"," * and the instance guid, if set."," *"," * @method toString"," * @return {String} String representation for this object"," */"," toString: function() {"," return this.name + \"[\" + Y.stamp(this, true) + \"]\";"," }"," };",""," // Straightup augment, no wrapper functions"," Y.mix(BaseCore, AttributeCore, false, null, 1);",""," // Fix constructor"," BaseCore.prototype.constructor = BaseCore;",""," Y.BaseCore = BaseCore;","","","}, '3.7.2', {\"requires\": [\"attribute-core\"]});"];+_yuitest_coverage["build/base-core/base-core.js"].code=["YUI.add('base-core', function (Y, NAME) {",""," /**"," * The base module provides the Base class, which objects requiring attribute and custom event support can extend. "," * The module also provides two ways to reuse code - It augments Base with the Plugin.Host interface which provides "," * plugin support and also provides the BaseCore.build method which provides a way to build custom classes using extensions."," *"," * @module base"," */",""," /**"," * <p>The base-core module provides the BaseCore class, the lightest version of Base, "," * which provides Base's basic lifecycle management and ATTRS construction support, "," * but doesn't fire init/destroy or attribute change events.</p> "," * "," * <p>It mixes in AttributeCore, which is the lightest version of Attribute</p>"," *"," * @module base"," * @submodule base-core"," */"," var O = Y.Object,"," L = Y.Lang,"," DOT = \".\","," INITIALIZED = \"initialized\","," DESTROYED = \"destroyed\","," INITIALIZER = \"initializer\","," VALUE = \"value\","," OBJECT_CONSTRUCTOR = Object.prototype.constructor,"," DEEP = \"deep\","," SHALLOW = \"shallow\","," DESTRUCTOR = \"destructor\",",""," AttributeCore = Y.AttributeCore,",""," _wlmix = function(r, s, wlhash) {"," var p;"," for (p in s) {"," if(wlhash[p]) { "," r[p] = s[p];"," }"," }"," return r;"," };",""," /**"," * The BaseCore class, is the lightest version of Base, and provides Base's "," * basic lifecycle management and ATTRS construction support, but doesn't "," * fire init/destroy or attribute change events."," *"," * BaseCore also handles the chaining of initializer and destructor methods across "," * the hierarchy as part of object construction and destruction. Additionally, attributes "," * configured through the static <a href=\"#property_BaseCore.ATTRS\">ATTRS</a> "," * property for each class in the hierarchy will be initialized by BaseCore."," *"," * Classes which require attribute support, but don't intend to use/expose attribute "," * change events can extend BaseCore instead of Base for optimal kweight and "," * runtime performance."," * "," * @class BaseCore"," * @constructor"," * @uses AttributeCore"," * @param {Object} cfg Object with configuration property name/value pairs. "," * The object can be used to provide initial values for the objects published "," * attributes."," */"," function BaseCore(cfg) {"," if (!this._BaseInvoked) {"," this._BaseInvoked = true;",""," this._initBase(cfg);"," }"," }",""," /**"," * The list of properties which can be configured for each attribute "," * (e.g. setter, getter, writeOnce, readOnly etc.)"," *"," * @property _ATTR_CFG"," * @type Array"," * @static"," * @private"," */"," BaseCore._ATTR_CFG = AttributeCore._ATTR_CFG.concat(\"cloneDefaultValue\");"," BaseCore._ATTR_CFG_HASH = Y.Array.hash(BaseCore._ATTR_CFG);",""," /**"," * The array of non-attribute configuration properties supported by this class. "," * "," * For example `BaseCore` defines a \"plugins\" configuration property which "," * should not be set up as an attribute. This property is primarily required so "," * that when <a href=\"#property__allowAdHocAttrs\">`_allowAdHocAttrs`</a> is enabled by a class, "," * non-attribute configuration properties don't get added as ad-hoc attributes. "," *"," * @property _NON_ATTRS_CFG"," * @type Array"," * @static"," * @private"," */"," BaseCore._NON_ATTRS_CFG = [\"plugins\"];",""," /**"," * This property controls whether or not instances of this class should"," * allow users to add ad-hoc attributes through the constructor configuration "," * hash."," *"," * AdHoc attributes are attributes which are not defined by the class, and are "," * not handled by the MyClass._NON_ATTRS_CFG "," * "," * @property _allowAdHocAttrs"," * @type boolean"," * @default undefined (false)"," * @protected"," */",""," /**"," * The string to be used to identify instances of this class."," * "," * Classes extending BaseCore, should define their own"," * static NAME property, which should be camelCase by"," * convention (e.g. MyClass.NAME = \"myClass\";)."," *"," * @property NAME"," * @type String"," * @static"," */"," BaseCore.NAME = \"baseCore\";",""," /**"," * The default set of attributes which will be available for instances of this class, and "," * their configuration. In addition to the configuration properties listed by "," * AttributeCore's <a href=\"AttributeCore.html#method_addAttr\">addAttr</a> method, "," * the attribute can also be configured with a \"cloneDefaultValue\" property, which "," * defines how the statically defined value field should be protected "," * (\"shallow\", \"deep\" and false are supported values). "," *"," * By default if the value is an object literal or an array it will be \"shallow\" "," * cloned, to protect the default value."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," BaseCore.ATTRS = {"," /**"," * Flag indicating whether or not this object"," * has been through the init lifecycle phase."," *"," * @attribute initialized"," * @readonly"," * @default false"," * @type boolean"," */"," initialized: {"," readOnly:true,"," value:false"," },",""," /**"," * Flag indicating whether or not this object"," * has been through the destroy lifecycle phase."," *"," * @attribute destroyed"," * @readonly"," * @default false"," * @type boolean"," */"," destroyed: {"," readOnly:true,"," value:false"," }"," };",""," BaseCore.prototype = {",""," /**"," * Internal construction logic for BaseCore."," *"," * @method _initBase"," * @param {Object} config The constructor configuration object"," * @private"," */"," _initBase : function(config) {",""," Y.stamp(this);",""," this._initAttribute(config);",""," // If Plugin.Host has been augmented [ through base-pluginhost ], setup it's"," // initial state, but don't initialize Plugins yet. That's done after initialization."," var PluginHost = Y.Plugin && Y.Plugin.Host;"," if (this._initPlugins && PluginHost) {"," PluginHost.call(this);"," }",""," if (this._lazyAddAttrs !== false) { this._lazyAddAttrs = true; }",""," /**"," * The string used to identify the class of this object."," *"," * @deprecated Use this.constructor.NAME"," * @property name"," * @type String"," */"," this.name = this.constructor.NAME;"," "," this.init.apply(this, arguments);"," },",""," /**"," * Initializes AttributeCore "," * "," * @method _initAttribute"," * @private"," */"," _initAttribute: function() {"," AttributeCore.apply(this);"," },",""," /**"," * Init lifecycle method, invoked during construction. Sets up attributes "," * and invokes initializers for the class hierarchy."," *"," * @method init"," * @chainable"," * @param {Object} cfg Object with configuration property name/value pairs"," * @return {BaseCore} A reference to this object"," */"," init: function(cfg) {",""," this._baseInit(cfg);",""," return this;"," },",""," /**"," * Internal initialization implementation for BaseCore"," *"," * @method _baseInit"," * @private"," */"," _baseInit: function(cfg) {"," this._initHierarchy(cfg);",""," if (this._initPlugins) {"," // Need to initPlugins manually, to handle constructor parsing, static Plug parsing"," this._initPlugins(cfg);"," }"," this._set(INITIALIZED, true);"," },",""," /**"," * Destroy lifecycle method. Invokes destructors for the class hierarchy."," *"," * @method destroy"," * @return {BaseCore} A reference to this object"," * @chainable"," */"," destroy: function() {"," this._baseDestroy();"," return this;"," },",""," /**"," * Internal destroy implementation for BaseCore"," *"," * @method _baseDestroy"," * @private"," */"," _baseDestroy : function() {"," if (this._destroyPlugins) {"," this._destroyPlugins();"," }"," this._destroyHierarchy();"," this._set(DESTROYED, true);"," },",""," /**"," * Returns the class hierarchy for this object, with BaseCore being the last class in the array."," *"," * @method _getClasses"," * @protected"," * @return {Function[]} An array of classes (constructor functions), making up the class hierarchy for this object."," * This value is cached the first time the method, or _getAttrCfgs, is invoked. Subsequent invocations return the "," * cached value."," */"," _getClasses : function() {"," if (!this._classes) {"," this._initHierarchyData();"," }"," return this._classes;"," },",""," /**"," * Returns an aggregated set of attribute configurations, by traversing "," * the class hierarchy."," *"," * @method _getAttrCfgs"," * @protected"," * @return {Object} The hash of attribute configurations, aggregated across classes in the hierarchy"," * This value is cached the first time the method, or _getClasses, is invoked. Subsequent invocations return"," * the cached value."," */"," _getAttrCfgs : function() {"," if (!this._attrs) {"," this._initHierarchyData();"," }"," return this._attrs;"," },",""," /**"," * A helper method used when processing ATTRS across the class hierarchy during "," * initialization. Returns a disposable object with the attributes defined for "," * the provided class, extracted from the set of all attributes passed in."," *"," * @method _filterAttrCfs"," * @private"," *"," * @param {Function} clazz The class for which the desired attributes are required."," * @param {Object} allCfgs The set of all attribute configurations for this instance. "," * Attributes will be removed from this set, if they belong to the filtered class, so"," * that by the time all classes are processed, allCfgs will be empty."," * "," * @return {Object} The set of attributes belonging to the class passed in, in the form"," * of an object with attribute name/configuration pairs."," */"," _filterAttrCfgs : function(clazz, allCfgs) {"," var cfgs = null, attr, attrs = clazz.ATTRS;",""," if (attrs) {"," for (attr in attrs) {"," if (allCfgs[attr]) {"," cfgs = cfgs || {};"," cfgs[attr] = allCfgs[attr];"," allCfgs[attr] = null;"," }"," }"," }",""," return cfgs;"," },",""," /**"," * @method _filterAdHocAttrs"," * @private"," *"," * @param {Object} allAttrs The set of all attribute configurations for this instance. "," * Attributes will be removed from this set, if they belong to the filtered class, so"," * that by the time all classes are processed, allCfgs will be empty."," * @param {Object} userVals The config object passed in by the user, from which adhoc attrs are to be filtered."," * @return {Object} The set of adhoc attributes passed in, in the form"," * of an object with attribute name/configuration pairs."," */"," _filterAdHocAttrs : function(allAttrs, userVals) {"," var adHocs,"," nonAttrs = this._nonAttrs,"," attr;",""," if (userVals) {"," adHocs = {};"," for (attr in userVals) {"," if (!allAttrs[attr] && !nonAttrs[attr] && userVals.hasOwnProperty(attr)) {"," adHocs[attr] = {"," value:userVals[attr]"," };"," }"," }"," }",""," return adHocs;"," },",""," /**"," * A helper method used by _getClasses and _getAttrCfgs, which determines both"," * the array of classes and aggregate set of attribute configurations"," * across the class hierarchy for the instance."," *"," * @method _initHierarchyData"," * @private"," */"," _initHierarchyData : function() {"," var c = this.constructor,"," i,"," l,"," nonAttrsCfg,"," nonAttrs = (this._allowAdHocAttrs) ? {} : null,"," classes = [],"," attrs = [];",""," while (c) {"," // Add to classes"," classes[classes.length] = c;",""," // Add to attributes"," if (c.ATTRS) {"," attrs[attrs.length] = c.ATTRS;"," }",""," if (this._allowAdHocAttrs) {"," nonAttrsCfg = c._NON_ATTRS_CFG; "," if (nonAttrsCfg) {"," for (i = 0, l = nonAttrsCfg.length; i < l; i++) {"," nonAttrs[nonAttrsCfg[i]] = true;"," }"," }"," }",""," c = c.superclass ? c.superclass.constructor : null;"," }",""," this._classes = classes;"," this._nonAttrs = nonAttrs;"," this._attrs = this._aggregateAttrs(attrs);"," },",""," /**"," * Utility method to define the attribute hash used to filter/whitelist property mixes for "," * this class. "," * "," * @method _attrCfgHash"," * @private"," */"," _attrCfgHash: function() {"," return BaseCore._ATTR_CFG_HASH;"," },",""," /**"," * A helper method, used by _initHierarchyData to aggregate "," * attribute configuration across the instances class hierarchy."," *"," * The method will protect the attribute configuration value to protect the statically defined "," * default value in ATTRS if required (if the value is an object literal, array or the "," * attribute configuration has cloneDefaultValue set to shallow or deep)."," *"," * @method _aggregateAttrs"," * @private"," * @param {Array} allAttrs An array of ATTRS definitions across classes in the hierarchy "," * (subclass first, Base last)"," * @return {Object} The aggregate set of ATTRS definitions for the instance"," */"," _aggregateAttrs : function(allAttrs) {"," var attr,"," attrs,"," cfg,"," val,"," path,"," i,"," clone,"," cfgPropsHash = this._attrCfgHash(),"," aggAttr,"," aggAttrs = {};",""," if (allAttrs) {"," for (i = allAttrs.length-1; i >= 0; --i) {"," attrs = allAttrs[i];",""," for (attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {",""," // Protect config passed in"," cfg = _wlmix({}, attrs[attr], cfgPropsHash);",""," val = cfg.value;"," clone = cfg.cloneDefaultValue;",""," if (val) {"," if ( (clone === undefined && (OBJECT_CONSTRUCTOR === val.constructor || L.isArray(val))) || clone === DEEP || clone === true) {"," cfg.value = Y.clone(val);"," } else if (clone === SHALLOW) {"," cfg.value = Y.merge(val);"," }"," // else if (clone === false), don't clone the static default value. "," // It's intended to be used by reference."," }",""," path = null;"," if (attr.indexOf(DOT) !== -1) {"," path = attr.split(DOT);"," attr = path.shift();"," }",""," aggAttr = aggAttrs[attr];"," if (path && aggAttr && aggAttr.value) {"," O.setValue(aggAttr.value, path, val);"," } else if (!path) {"," if (!aggAttr) {"," aggAttrs[attr] = cfg;"," } else {"," if (aggAttr.valueFn && VALUE in cfg) {"," aggAttr.valueFn = null; "," }"," _wlmix(aggAttr, cfg, cfgPropsHash);"," }"," }"," }"," }"," }"," }",""," return aggAttrs;"," },",""," /**"," * Initializes the class hierarchy for the instance, which includes "," * initializing attributes for each class defined in the class's "," * static <a href=\"#property_BaseCore.ATTRS\">ATTRS</a> property and "," * invoking the initializer method on the prototype of each class in the hierarchy."," *"," * @method _initHierarchy"," * @param {Object} userVals Object with configuration property name/value pairs"," * @private"," */"," _initHierarchy : function(userVals) {"," var lazy = this._lazyAddAttrs,"," constr,"," constrProto,"," ci,"," ei,"," el,"," extProto,"," exts,"," classes = this._getClasses(),"," attrCfgs = this._getAttrCfgs(),"," cl = classes.length - 1;",""," for (ci = cl; ci >= 0; ci--) {",""," constr = classes[ci];"," constrProto = constr.prototype;"," exts = constr._yuibuild && constr._yuibuild.exts; ",""," if (exts) {"," for (ei = 0, el = exts.length; ei < el; ei++) {"," exts[ei].apply(this, arguments);"," }"," }",""," this.addAttrs(this._filterAttrCfgs(constr, attrCfgs), userVals, lazy);",""," if (this._allowAdHocAttrs && ci === cl) { "," this.addAttrs(this._filterAdHocAttrs(attrCfgs, userVals), userVals, lazy);"," }",""," // Using INITIALIZER in hasOwnProperty check, for performance reasons (helps IE6 avoid GC thresholds when"," // referencing string literals). Not using it in apply, again, for performance \".\" is faster. "," if (constrProto.hasOwnProperty(INITIALIZER)) {"," constrProto.initializer.apply(this, arguments);"," }",""," if (exts) {"," for (ei = 0; ei < el; ei++) {"," extProto = exts[ei].prototype;"," if (extProto.hasOwnProperty(INITIALIZER)) {"," extProto.initializer.apply(this, arguments);"," }"," }"," }"," }"," },",""," /**"," * Destroys the class hierarchy for this instance by invoking"," * the destructor method on the prototype of each class in the hierarchy."," *"," * @method _destroyHierarchy"," * @private"," */"," _destroyHierarchy : function() {"," var constr,"," constrProto,"," ci, cl, ei, el, exts, extProto,"," classes = this._getClasses();",""," for (ci = 0, cl = classes.length; ci < cl; ci++) {"," constr = classes[ci];"," constrProto = constr.prototype;"," exts = constr._yuibuild && constr._yuibuild.exts; ",""," if (exts) {"," for (ei = 0, el = exts.length; ei < el; ei++) {"," extProto = exts[ei].prototype;"," if (extProto.hasOwnProperty(DESTRUCTOR)) {"," extProto.destructor.apply(this, arguments);"," }"," }"," }",""," if (constrProto.hasOwnProperty(DESTRUCTOR)) {"," constrProto.destructor.apply(this, arguments);"," }"," }"," },",""," /**"," * Default toString implementation. Provides the constructor NAME"," * and the instance guid, if set."," *"," * @method toString"," * @return {String} String representation for this object"," */"," toString: function() {"," return this.name + \"[\" + Y.stamp(this, true) + \"]\";"," }"," };",""," // Straightup augment, no wrapper functions"," Y.mix(BaseCore, AttributeCore, false, null, 1);",""," // Fix constructor"," BaseCore.prototype.constructor = BaseCore;",""," Y.BaseCore = BaseCore;","","","}, '3.7.3', {\"requires\": [\"attribute-core\"]});"]; _yuitest_coverage["build/base-core/base-core.js"].lines = {"1":0,"21":0,"36":0,"37":0,"38":0,"39":0,"42":0,"66":0,"67":0,"68":0,"70":0,"83":0,"84":0,"99":0,"126":0,"143":0,"173":0,"184":0,"186":0,"190":0,"191":0,"192":0,"195":0,"204":0,"206":0,"216":0,"230":0,"232":0,"242":0,"244":0,"246":0,"248":0,"259":0,"260":0,"270":0,"271":0,"273":0,"274":0,"287":0,"288":0,"290":0,"304":0,"305":0,"307":0,"327":0,"329":0,"330":0,"331":0,"332":0,"333":0,"334":0,"339":0,"354":0,"358":0,"359":0,"360":0,"361":0,"362":0,"369":0,"381":0,"389":0,"391":0,"394":0,"395":0,"398":0,"399":0,"400":0,"401":0,"402":0,"407":0,"410":0,"411":0,"412":0,"423":0,"441":0,"452":0,"453":0,"454":0,"456":0,"457":0,"460":0,"462":0,"463":0,"465":0,"466":0,"467":0,"468":0,"469":0,"475":0,"476":0,"477":0,"478":0,"481":0,"482":0,"483":0,"484":0,"485":0,"486":0,"488":0,"489":0,"491":0,"499":0,"513":0,"525":0,"527":0,"528":0,"529":0,"531":0,"532":0,"533":0,"537":0,"539":0,"540":0,"545":0,"546":0,"549":0,"550":0,"551":0,"552":0,"553":0,"568":0,"573":0,"574":0,"575":0,"576":0,"578":0,"579":0,"580":0,"581":0,"582":0,"587":0,"588":0,"601":0,"606":0,"609":0,"611":0}; _yuitest_coverage["build/base-core/base-core.js"].functions = {"_wlmix:35":0,"BaseCore:66":0,"_initBase:182":0,"_initAttribute:215":0,"init:228":0,"_baseInit:241":0,"destroy:258":0,"_baseDestroy:269":0,"_getClasses:286":0,"_getAttrCfgs:303":0,"_filterAttrCfgs:326":0,"_filterAdHocAttrs:353":0,"_initHierarchyData:380":0,"_attrCfgHash:422":0,"_aggregateAttrs:440":0,"_initHierarchy:512":0,"_destroyHierarchy:567":0,"toString:600":0,"(anonymous 1):1":0}; _yuitest_coverage["build/base-core/base-core.js"].coveredLines = 136;@@ -805,4 +805,4 @@ Y.BaseCore = BaseCore; -}, '3.7.2', {"requires": ["attribute-core"]});+}, '3.7.3', {"requires": ["attribute-core"]});
bundle/base-core/base-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -622,4 +622,4 @@ Y.BaseCore = BaseCore; -}, '3.7.2', {"requires": ["attribute-core"]});+}, '3.7.3', {"requires": ["attribute-core"]});
bundle/base-core/base-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-core",function(e,t){function v(e){this._BaseInvoked||(this._BaseInvoked=!0,this._initBase(e))}var n=e.Object,r=e.Lang,i=".",s="initialized",o="destroyed",u="initializer",a="value",f=Object.prototype.constructor,l="deep",c="shallow",h="destructor",p=e.AttributeCore,d=function(e,t,n){var r;for(r in t)n[r]&&(e[r]=t[r]);return e};v._ATTR_CFG=p._ATTR_CFG.concat("cloneDefaultValue"),v._ATTR_CFG_HASH=e.Array.hash(v._ATTR_CFG),v._NON_ATTRS_CFG=["plugins"],v.NAME="baseCore",v.ATTRS={initialized:{readOnly:!0,value:!1},destroyed:{readOnly:!0,value:!1}},v.prototype={_initBase:function(t){e.stamp(this),this._initAttribute(t);var n=e.Plugin&&e.Plugin.Host;this._initPlugins&&n&&n.call(this),this._lazyAddAttrs!==!1&&(this._lazyAddAttrs=!0),this.name=this.constructor.NAME,this.init.apply(this,arguments)},_initAttribute:function(){p.apply(this)},init:function(e){return this._baseInit(e),this},_baseInit:function(e){this._initHierarchy(e),this._initPlugins&&this._initPlugins(e),this._set(s,!0)},destroy:function(){return this._baseDestroy(),this},_baseDestroy:function(){this._destroyPlugins&&this._destroyPlugins(),this._destroyHierarchy(),this._set(o,!0)},_getClasses:function(){return this._classes||this._initHierarchyData(),this._classes},_getAttrCfgs:function(){return this._attrs||this._initHierarchyData(),this._attrs},_filterAttrCfgs:function(e,t){var n=null,r,i=e.ATTRS;if(i)for(r in i)t[r]&&(n=n||{},n[r]=t[r],t[r]=null);return n},_filterAdHocAttrs:function(e,t){var n,r=this._nonAttrs,i;if(t){n={};for(i in t)!e[i]&&!r[i]&&t.hasOwnProperty(i)&&(n[i]={value:t[i]})}return n},_initHierarchyData:function(){var e=this.constructor,t,n,r,i=this._allowAdHocAttrs?{}:null,s=[],o=[];while(e){s[s.length]=e,e.ATTRS&&(o[o.length]=e.ATTRS);if(this._allowAdHocAttrs){r=e._NON_ATTRS_CFG;if(r)for(t=0,n=r.length;t<n;t++)i[r[t]]=!0}e=e.superclass?e.superclass.constructor:null}this._classes=s,this._nonAttrs=i,this._attrs=this._aggregateAttrs(o)},_attrCfgHash:function(){return v._ATTR_CFG_HASH},_aggregateAttrs:function(t){var s,o,u,h,p,v,m,g=this._attrCfgHash(),y,b={};if(t)for(v=t.length-1;v>=0;--v){o=t[v];for(s in o)o.hasOwnProperty(s)&&(u=d({},o[s],g),h=u.value,m=u.cloneDefaultValue,h&&(m===undefined&&(f===h.constructor||r.isArray(h))||m===l||m===!0?u.value=e.clone(h):m===c&&(u.value=e.merge(h))),p=null,s.indexOf(i)!==-1&&(p=s.split(i),s=p.shift()),y=b[s],p&&y&&y.value?n.setValue(y.value,p,h):p||(y?(y.valueFn&&a in u&&(y.valueFn=null),d(y,u,g)):b[s]=u))}return b},_initHierarchy:function(e){var t=this._lazyAddAttrs,n,r,i,s,o,a,f,l=this._getClasses(),c=this._getAttrCfgs(),h=l.length-1;for(i=h;i>=0;i--){n=l[i],r=n.prototype,f=n._yuibuild&&n._yuibuild.exts;if(f)for(s=0,o=f.length;s<o;s++)f[s].apply(this,arguments);this.addAttrs(this._filterAttrCfgs(n,c),e,t),this._allowAdHocAttrs&&i===h&&this.addAttrs(this._filterAdHocAttrs(c,e),e,t),r.hasOwnProperty(u)&&r.initializer.apply(this,arguments);if(f)for(s=0;s<o;s++)a=f[s].prototype,a.hasOwnProperty(u)&&a.initializer.apply(this,arguments)}},_destroyHierarchy:function(){var e,t,n,r,i,s,o,u,a=this._getClasses();for(n=0,r=a.length;n<r;n++){e=a[n],t=e.prototype,o=e._yuibuild&&e._yuibuild.exts;if(o)for(i=0,s=o.length;i<s;i++)u=o[i].prototype,u.hasOwnProperty(h)&&u.destructor.apply(this,arguments);t.hasOwnProperty(h)&&t.destructor.apply(this,arguments)}},toString:function(){return this.name+"["+e.stamp(this,!0)+"]"}},e.mix(v,p,!1,null,1),v.prototype.constructor=v,e.BaseCore=v},"3.7.2",{requires:["attribute-core"]});+YUI.add("base-core",function(e,t){function v(e){this._BaseInvoked||(this._BaseInvoked=!0,this._initBase(e))}var n=e.Object,r=e.Lang,i=".",s="initialized",o="destroyed",u="initializer",a="value",f=Object.prototype.constructor,l="deep",c="shallow",h="destructor",p=e.AttributeCore,d=function(e,t,n){var r;for(r in t)n[r]&&(e[r]=t[r]);return e};v._ATTR_CFG=p._ATTR_CFG.concat("cloneDefaultValue"),v._ATTR_CFG_HASH=e.Array.hash(v._ATTR_CFG),v._NON_ATTRS_CFG=["plugins"],v.NAME="baseCore",v.ATTRS={initialized:{readOnly:!0,value:!1},destroyed:{readOnly:!0,value:!1}},v.prototype={_initBase:function(t){e.stamp(this),this._initAttribute(t);var n=e.Plugin&&e.Plugin.Host;this._initPlugins&&n&&n.call(this),this._lazyAddAttrs!==!1&&(this._lazyAddAttrs=!0),this.name=this.constructor.NAME,this.init.apply(this,arguments)},_initAttribute:function(){p.apply(this)},init:function(e){return this._baseInit(e),this},_baseInit:function(e){this._initHierarchy(e),this._initPlugins&&this._initPlugins(e),this._set(s,!0)},destroy:function(){return this._baseDestroy(),this},_baseDestroy:function(){this._destroyPlugins&&this._destroyPlugins(),this._destroyHierarchy(),this._set(o,!0)},_getClasses:function(){return this._classes||this._initHierarchyData(),this._classes},_getAttrCfgs:function(){return this._attrs||this._initHierarchyData(),this._attrs},_filterAttrCfgs:function(e,t){var n=null,r,i=e.ATTRS;if(i)for(r in i)t[r]&&(n=n||{},n[r]=t[r],t[r]=null);return n},_filterAdHocAttrs:function(e,t){var n,r=this._nonAttrs,i;if(t){n={};for(i in t)!e[i]&&!r[i]&&t.hasOwnProperty(i)&&(n[i]={value:t[i]})}return n},_initHierarchyData:function(){var e=this.constructor,t,n,r,i=this._allowAdHocAttrs?{}:null,s=[],o=[];while(e){s[s.length]=e,e.ATTRS&&(o[o.length]=e.ATTRS);if(this._allowAdHocAttrs){r=e._NON_ATTRS_CFG;if(r)for(t=0,n=r.length;t<n;t++)i[r[t]]=!0}e=e.superclass?e.superclass.constructor:null}this._classes=s,this._nonAttrs=i,this._attrs=this._aggregateAttrs(o)},_attrCfgHash:function(){return v._ATTR_CFG_HASH},_aggregateAttrs:function(t){var s,o,u,h,p,v,m,g=this._attrCfgHash(),y,b={};if(t)for(v=t.length-1;v>=0;--v){o=t[v];for(s in o)o.hasOwnProperty(s)&&(u=d({},o[s],g),h=u.value,m=u.cloneDefaultValue,h&&(m===undefined&&(f===h.constructor||r.isArray(h))||m===l||m===!0?u.value=e.clone(h):m===c&&(u.value=e.merge(h))),p=null,s.indexOf(i)!==-1&&(p=s.split(i),s=p.shift()),y=b[s],p&&y&&y.value?n.setValue(y.value,p,h):p||(y?(y.valueFn&&a in u&&(y.valueFn=null),d(y,u,g)):b[s]=u))}return b},_initHierarchy:function(e){var t=this._lazyAddAttrs,n,r,i,s,o,a,f,l=this._getClasses(),c=this._getAttrCfgs(),h=l.length-1;for(i=h;i>=0;i--){n=l[i],r=n.prototype,f=n._yuibuild&&n._yuibuild.exts;if(f)for(s=0,o=f.length;s<o;s++)f[s].apply(this,arguments);this.addAttrs(this._filterAttrCfgs(n,c),e,t),this._allowAdHocAttrs&&i===h&&this.addAttrs(this._filterAdHocAttrs(c,e),e,t),r.hasOwnProperty(u)&&r.initializer.apply(this,arguments);if(f)for(s=0;s<o;s++)a=f[s].prototype,a.hasOwnProperty(u)&&a.initializer.apply(this,arguments)}},_destroyHierarchy:function(){var e,t,n,r,i,s,o,u,a=this._getClasses();for(n=0,r=a.length;n<r;n++){e=a[n],t=e.prototype,o=e._yuibuild&&e._yuibuild.exts;if(o)for(i=0,s=o.length;i<s;i++)u=o[i].prototype,u.hasOwnProperty(h)&&u.destructor.apply(this,arguments);t.hasOwnProperty(h)&&t.destructor.apply(this,arguments)}},toString:function(){return this.name+"["+e.stamp(this,!0)+"]"}},e.mix(v,p,!1,null,1),v.prototype.constructor=v,e.BaseCore=v},"3.7.3",{requires:["attribute-core"]});
bundle/base-core/base-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -617,4 +617,4 @@ Y.BaseCore = BaseCore; -}, '3.7.2', {"requires": ["attribute-core"]});+}, '3.7.3', {"requires": ["attribute-core"]});
bundle/base-pluginhost/base-pluginhost-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/base-pluginhost/base-pluginhost.js", code: [] };-_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].code=["YUI.add('base-pluginhost', function (Y, NAME) {",""," /**"," * The base-pluginhost submodule adds Plugin support to Base, by augmenting Base with "," * Plugin.Host and setting up static (class level) Base.plug and Base.unplug methods."," *"," * @module base"," * @submodule base-pluginhost"," * @for Base"," */",""," var Base = Y.Base,"," PluginHost = Y.Plugin.Host;",""," Y.mix(Base, PluginHost, false, null, 1);",""," /**"," * Alias for <a href=\"Plugin.Host.html#method_Plugin.Host.plug\">Plugin.Host.plug</a>. See aliased "," * method for argument and return value details."," *"," * @method plug"," * @static"," */"," Base.plug = PluginHost.plug;",""," /**"," * Alias for <a href=\"Plugin.Host.html#method_Plugin.Host.unplug\">Plugin.Host.unplug</a>. See the "," * aliased method for argument and return value details."," *"," * @method unplug"," * @static"," */"," Base.unplug = PluginHost.unplug;","","","}, '3.7.2', {\"requires\": [\"base-base\", \"pluginhost\"]});"];+_yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].code=["YUI.add('base-pluginhost', function (Y, NAME) {",""," /**"," * The base-pluginhost submodule adds Plugin support to Base, by augmenting Base with "," * Plugin.Host and setting up static (class level) Base.plug and Base.unplug methods."," *"," * @module base"," * @submodule base-pluginhost"," * @for Base"," */",""," var Base = Y.Base,"," PluginHost = Y.Plugin.Host;",""," Y.mix(Base, PluginHost, false, null, 1);",""," /**"," * Alias for <a href=\"Plugin.Host.html#method_Plugin.Host.plug\">Plugin.Host.plug</a>. See aliased "," * method for argument and return value details."," *"," * @method plug"," * @static"," */"," Base.plug = PluginHost.plug;",""," /**"," * Alias for <a href=\"Plugin.Host.html#method_Plugin.Host.unplug\">Plugin.Host.unplug</a>. See the "," * aliased method for argument and return value details."," *"," * @method unplug"," * @static"," */"," Base.unplug = PluginHost.unplug;","","","}, '3.7.3', {\"requires\": [\"base-base\", \"pluginhost\"]});"]; _yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].lines = {"1":0,"12":0,"15":0,"24":0,"33":0}; _yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/base-pluginhost/base-pluginhost.js"].coveredLines = 5;@@ -78,4 +78,4 @@ Base.unplug = PluginHost.unplug; -}, '3.7.2', {"requires": ["base-base", "pluginhost"]});+}, '3.7.3', {"requires": ["base-base", "pluginhost"]});
bundle/base-pluginhost/base-pluginhost-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -39,4 +39,4 @@ Base.unplug = PluginHost.unplug; -}, '3.7.2', {"requires": ["base-base", "pluginhost"]});+}, '3.7.3', {"requires": ["base-base", "pluginhost"]});
bundle/base-pluginhost/base-pluginhost-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("base-pluginhost",function(e,t){var n=e.Base,r=e.Plugin.Host;e.mix(n,r,!1,null,1),n.plug=r.plug,n.unplug=r.unplug},"3.7.2",{requires:["base-base","pluginhost"]});+YUI.add("base-pluginhost",function(e,t){var n=e.Base,r=e.Plugin.Host;e.mix(n,r,!1,null,1),n.plug=r.plug,n.unplug=r.unplug},"3.7.3",{requires:["base-base","pluginhost"]});
bundle/base-pluginhost/base-pluginhost.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -39,4 +39,4 @@ Base.unplug = PluginHost.unplug; -}, '3.7.2', {"requires": ["base-base", "pluginhost"]});+}, '3.7.3', {"requires": ["base-base", "pluginhost"]});
bundle/button-core/button-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/button-core/button-core.js", code: [] };-_yuitest_coverage["build/button-core/button-core.js"].code=["YUI.add('button-core', function (Y, NAME) {","","/**","* Provides an interface for working with button-like DOM nodes","*","* @module button-core","* @since 3.5.0","*/","","var getClassName = Y.ClassNameManager.getClassName;","","/**","* Creates a button","*","* @class ButtonCore","* @param config {Object} Configuration object","* @constructor","*/","function Button(config) {"," this.initializer(config);","}","","Button.prototype = {"," TEMPLATE: '<button/>',",""," constructor: Button,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._initNode(config);"," this._initAttributes(config);"," this._renderUI(config);"," },",""," /**"," * @method _initNode"," * @description Node initializer"," * @param config {Object} Config object."," * @private"," */"," _initNode: function(config) {"," if (config.host) {"," this._host = Y.one(config.host);"," } else {"," this._host = Y.Node.create(this.TEMPLATE);"," }"," },",""," /**"," * @method _initAttributes"," * @description Attribute initializer"," * @param config {Object} Config object."," * @private"," */"," _initAttributes: function(config) {"," var host = this._host,"," node = host.one('.' + Button.CLASS_NAMES.LABEL) || host;"," "," config.label = config.label || this._getLabel(node);"," Y.AttributeCore.call(this, Button.ATTRS, config);"," },",""," /**"," * @method renderUI"," * @description Renders any UI/DOM elements for Button instances"," * @param config {Object} Config object."," * @private"," */"," _renderUI: function(config) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," // Set some default node attributes"," node.addClass(Button.CLASS_NAMES.BUTTON);"," "," if (tagName !== 'button' && tagName !== 'input') {"," node.set('role', 'button'); "," }"," },",""," /**"," * @method enable "," * @description Sets the button's `disabled` DOM attribute to false"," * @public"," */"," enable: function() {"," this.set('disabled', false);"," },",""," /**"," * @method disable"," * @description Sets the button's `disabled` DOM attribute to true"," * @public"," */"," disable: function() {"," this.set('disabled', true);"," },",""," /**"," * @method getNode"," * @description Gets the host node for this button instance"," * @public"," */"," getNode: function() {"," return this._host;"," },"," "," /**"," * @method _getLabel"," * @description Getter for a button's 'label' ATTR"," * @private"," */"," _getLabel: function () {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase(),"," label;",""," if (tagName === 'input') {"," label = node.get('value');"," }"," else {"," label = (node.one('.' + Button.CLASS_NAMES.LABEL) || node).get('text');"," }"," "," return label;"," },"," "," /**"," * @method _uiSetLabel"," * @description Setter for a button's 'label' ATTR"," * @param label {string}"," * @private"," */"," _uiSetLabel: function (label) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," if (tagName === 'input') {"," node.set('value', label);"," } else {"," (node.one('.' + Button.CLASS_NAMES.LABEL) || node).set('text', label);"," }",""," return label;"," },",""," /**"," * @method _uiSetDisabled"," * @description Setter for the 'disabled' ATTR"," * @param value {boolean}"," * @private"," */"," _uiSetDisabled: function(value) {"," var node = this.getNode();"," "," node.getDOMNode().disabled = value; // avoid rerunning setter when this === node"," node.toggleClass(Button.CLASS_NAMES.DISABLED, value);"," "," return value;"," }","};","","/**","* Attribute configuration.","*","* @property ATTRS","* @type {Object}","* @private","* @static","*/","Button.ATTRS = {"," label: {"," setter: '_uiSetLabel',"," getter: '_getLabel',"," lazyAdd: false"," },",""," disabled: {"," value: false,"," setter: '_uiSetDisabled',"," lazyAdd: false"," }","};","","/**","* Name of this component.","*","* @property NAME","* @type String","* @static","*/","Button.NAME = \"button\";","","/**","* Array of static constants used to identify the classnames applied to DOM nodes","*","* @property CLASS_NAMES","* @type {Object}","* @public","* @static","*/","Button.CLASS_NAMES = {"," BUTTON : getClassName('button'),"," DISABLED: getClassName('button', 'disabled'),"," SELECTED: getClassName('button', 'selected'),"," LABEL : getClassName('button', 'label')","};","","/**","* Array of static constants used to for applying ARIA states","*","* @property CLASS_NAMES","* @type {Object}","* @private","* @static","*/","Button.ARIA_STATES = {"," PRESSED : 'aria-pressed',"," CHECKED : 'aria-checked'","};","","/**","* Array of static constants used to for applying ARIA roles","*","* @property CLASS_NAMES","* @type {Object}","* @private","* @static","*/","Button.ARIA_ROLES = {"," BUTTON : 'button',"," CHECKBOX: 'checkbox',"," TOGGLE : 'toggle'","};","","Y.mix(Button.prototype, Y.AttributeCore.prototype);","","// Export Button","Y.ButtonCore = Button;","","","}, '3.7.2', {\"requires\": [\"attribute-core\", \"classnamemanager\", \"node-base\"]});"];+_yuitest_coverage["build/button-core/button-core.js"].code=["YUI.add('button-core', function (Y, NAME) {","","/**","* Provides an interface for working with button-like DOM nodes","*","* @module button-core","* @since 3.5.0","*/","","var getClassName = Y.ClassNameManager.getClassName;","","/**","* Creates a button","*","* @class ButtonCore","* @param config {Object} Configuration object","* @constructor","*/","function Button(config) {"," this.initializer(config);","}","","Button.prototype = {"," TEMPLATE: '<button/>',",""," constructor: Button,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._initNode(config);"," this._initAttributes(config);"," this._renderUI(config);"," },",""," /**"," * @method _initNode"," * @description Node initializer"," * @param config {Object} Config object."," * @private"," */"," _initNode: function(config) {"," if (config.host) {"," this._host = Y.one(config.host);"," } else {"," this._host = Y.Node.create(this.TEMPLATE);"," }"," },",""," /**"," * @method _initAttributes"," * @description Attribute initializer"," * @param config {Object} Config object."," * @private"," */"," _initAttributes: function(config) {"," var host = this._host,"," node = host.one('.' + Button.CLASS_NAMES.LABEL) || host;"," "," config.label = config.label || this._getLabel(node);"," Y.AttributeCore.call(this, Button.ATTRS, config);"," },",""," /**"," * @method renderUI"," * @description Renders any UI/DOM elements for Button instances"," * @param config {Object} Config object."," * @private"," */"," _renderUI: function(config) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," // Set some default node attributes"," node.addClass(Button.CLASS_NAMES.BUTTON);"," "," if (tagName !== 'button' && tagName !== 'input') {"," node.set('role', 'button'); "," }"," },",""," /**"," * @method enable "," * @description Sets the button's `disabled` DOM attribute to false"," * @public"," */"," enable: function() {"," this.set('disabled', false);"," },",""," /**"," * @method disable"," * @description Sets the button's `disabled` DOM attribute to true"," * @public"," */"," disable: function() {"," this.set('disabled', true);"," },",""," /**"," * @method getNode"," * @description Gets the host node for this button instance"," * @public"," */"," getNode: function() {"," return this._host;"," },"," "," /**"," * @method _getLabel"," * @description Getter for a button's 'label' ATTR"," * @private"," */"," _getLabel: function () {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase(),"," label;",""," if (tagName === 'input') {"," label = node.get('value');"," }"," else {"," label = (node.one('.' + Button.CLASS_NAMES.LABEL) || node).get('text');"," }"," "," return label;"," },"," "," /**"," * @method _uiSetLabel"," * @description Setter for a button's 'label' ATTR"," * @param label {string}"," * @private"," */"," _uiSetLabel: function (label) {"," var node = this.getNode(),"," tagName = node.get('tagName').toLowerCase();",""," if (tagName === 'input') {"," node.set('value', label);"," } else {"," (node.one('.' + Button.CLASS_NAMES.LABEL) || node).set('text', label);"," }",""," return label;"," },",""," /**"," * @method _uiSetDisabled"," * @description Setter for the 'disabled' ATTR"," * @param value {boolean}"," * @private"," */"," _uiSetDisabled: function(value) {"," var node = this.getNode();"," "," node.getDOMNode().disabled = value; // avoid rerunning setter when this === node"," node.toggleClass(Button.CLASS_NAMES.DISABLED, value);"," "," return value;"," }","};","","/**","* Attribute configuration.","*","* @property ATTRS","* @type {Object}","* @private","* @static","*/","Button.ATTRS = {"," label: {"," setter: '_uiSetLabel',"," getter: '_getLabel',"," lazyAdd: false"," },",""," disabled: {"," value: false,"," setter: '_uiSetDisabled',"," lazyAdd: false"," }","};","","/**","* Name of this component.","*","* @property NAME","* @type String","* @static","*/","Button.NAME = \"button\";","","/**","* Array of static constants used to identify the classnames applied to DOM nodes","*","* @property CLASS_NAMES","* @type {Object}","* @public","* @static","*/","Button.CLASS_NAMES = {"," BUTTON : getClassName('button'),"," DISABLED: getClassName('button', 'disabled'),"," SELECTED: getClassName('button', 'selected'),"," LABEL : getClassName('button', 'label')","};","","/**","* Array of static constants used to for applying ARIA states","*","* @property CLASS_NAMES","* @type {Object}","* @private","* @static","*/","Button.ARIA_STATES = {"," PRESSED : 'aria-pressed',"," CHECKED : 'aria-checked'","};","","/**","* Array of static constants used to for applying ARIA roles","*","* @property CLASS_NAMES","* @type {Object}","* @private","* @static","*/","Button.ARIA_ROLES = {"," BUTTON : 'button',"," CHECKBOX: 'checkbox',"," TOGGLE : 'toggle'","};","","Y.mix(Button.prototype, Y.AttributeCore.prototype);","","// Export Button","Y.ButtonCore = Button;","","","}, '3.7.3', {\"requires\": [\"attribute-core\", \"classnamemanager\", \"node-base\"]});"]; _yuitest_coverage["build/button-core/button-core.js"].lines = {"1":0,"10":0,"19":0,"20":0,"23":0,"35":0,"36":0,"37":0,"47":0,"48":0,"50":0,"61":0,"64":0,"65":0,"75":0,"79":0,"81":0,"82":0,"92":0,"101":0,"110":0,"119":0,"123":0,"124":0,"127":0,"130":0,"140":0,"143":0,"144":0,"146":0,"149":0,"159":0,"161":0,"162":0,"164":0,"176":0,"197":0,"207":0,"222":0,"235":0,"241":0,"244":0}; _yuitest_coverage["build/button-core/button-core.js"].functions = {"Button:19":0,"initializer:34":0,"_initNode:46":0,"_initAttributes:60":0,"_renderUI:74":0,"enable:91":0,"disable:100":0,"getNode:109":0,"_getLabel:118":0,"_uiSetLabel:139":0,"_uiSetDisabled:158":0,"(anonymous 1):1":0}; _yuitest_coverage["build/button-core/button-core.js"].coveredLines = 42;@@ -337,4 +337,4 @@ Y.ButtonCore = Button; -}, '3.7.2', {"requires": ["attribute-core", "classnamemanager", "node-base"]});+}, '3.7.3', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
bundle/button-core/button-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -250,4 +250,4 @@ Y.ButtonCore = Button; -}, '3.7.2', {"requires": ["attribute-core", "classnamemanager", "node-base"]});+}, '3.7.3', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
bundle/button-core/button-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button-core",function(e,t){function r(e){this.initializer(e)}var n=e.ClassNameManager.getClassName;r.prototype={TEMPLATE:"<button/>",constructor:r,initializer:function(e){this._initNode(e),this._initAttributes(e),this._renderUI(e)},_initNode:function(t){t.host?this._host=e.one(t.host):this._host=e.Node.create(this.TEMPLATE)},_initAttributes:function(t){var n=this._host,i=n.one("."+r.CLASS_NAMES.LABEL)||n;t.label=t.label||this._getLabel(i),e.AttributeCore.call(this,r.ATTRS,t)},_renderUI:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();t.addClass(r.CLASS_NAMES.BUTTON),n!=="button"&&n!=="input"&&t.set("role","button")},enable:function(){this.set("disabled",!1)},disable:function(){this.set("disabled",!0)},getNode:function(){return this._host},_getLabel:function(){var e=this.getNode(),t=e.get("tagName").toLowerCase(),n;return t==="input"?n=e.get("value"):n=(e.one("."+r.CLASS_NAMES.LABEL)||e).get("text"),n},_uiSetLabel:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();return n==="input"?t.set("value",e):(t.one("."+r.CLASS_NAMES.LABEL)||t).set("text",e),e},_uiSetDisabled:function(e){var t=this.getNode();return t.getDOMNode().disabled=e,t.toggleClass(r.CLASS_NAMES.DISABLED,e),e}},r.ATTRS={label:{setter:"_uiSetLabel",getter:"_getLabel",lazyAdd:!1},disabled:{value:!1,setter:"_uiSetDisabled",lazyAdd:!1}},r.NAME="button",r.CLASS_NAMES={BUTTON:n("button"),DISABLED:n("button","disabled"),SELECTED:n("button","selected"),LABEL:n("button","label")},r.ARIA_STATES={PRESSED:"aria-pressed",CHECKED:"aria-checked"},r.ARIA_ROLES={BUTTON:"button",CHECKBOX:"checkbox",TOGGLE:"toggle"},e.mix(r.prototype,e.AttributeCore.prototype),e.ButtonCore=r},"3.7.2",{requires:["attribute-core","classnamemanager","node-base"]});+YUI.add("button-core",function(e,t){function r(e){this.initializer(e)}var n=e.ClassNameManager.getClassName;r.prototype={TEMPLATE:"<button/>",constructor:r,initializer:function(e){this._initNode(e),this._initAttributes(e),this._renderUI(e)},_initNode:function(t){t.host?this._host=e.one(t.host):this._host=e.Node.create(this.TEMPLATE)},_initAttributes:function(t){var n=this._host,i=n.one("."+r.CLASS_NAMES.LABEL)||n;t.label=t.label||this._getLabel(i),e.AttributeCore.call(this,r.ATTRS,t)},_renderUI:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();t.addClass(r.CLASS_NAMES.BUTTON),n!=="button"&&n!=="input"&&t.set("role","button")},enable:function(){this.set("disabled",!1)},disable:function(){this.set("disabled",!0)},getNode:function(){return this._host},_getLabel:function(){var e=this.getNode(),t=e.get("tagName").toLowerCase(),n;return t==="input"?n=e.get("value"):n=(e.one("."+r.CLASS_NAMES.LABEL)||e).get("text"),n},_uiSetLabel:function(e){var t=this.getNode(),n=t.get("tagName").toLowerCase();return n==="input"?t.set("value",e):(t.one("."+r.CLASS_NAMES.LABEL)||t).set("text",e),e},_uiSetDisabled:function(e){var t=this.getNode();return t.getDOMNode().disabled=e,t.toggleClass(r.CLASS_NAMES.DISABLED,e),e}},r.ATTRS={label:{setter:"_uiSetLabel",getter:"_getLabel",lazyAdd:!1},disabled:{value:!1,setter:"_uiSetDisabled",lazyAdd:!1}},r.NAME="button",r.CLASS_NAMES={BUTTON:n("button"),DISABLED:n("button","disabled"),SELECTED:n("button","selected"),LABEL:n("button","label")},r.ARIA_STATES={PRESSED:"aria-pressed",CHECKED:"aria-checked"},r.ARIA_ROLES={BUTTON:"button",CHECKBOX:"checkbox",TOGGLE:"toggle"},e.mix(r.prototype,e.AttributeCore.prototype),e.ButtonCore=r},"3.7.3",{requires:["attribute-core","classnamemanager","node-base"]});
bundle/button-core/button-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -250,4 +250,4 @@ Y.ButtonCore = Button; -}, '3.7.2', {"requires": ["attribute-core", "classnamemanager", "node-base"]});+}, '3.7.3', {"requires": ["attribute-core", "classnamemanager", "node-base"]});
bundle/button-group/button-group-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/button-group/button-group.js", code: [] };-_yuitest_coverage["build/button-group/button-group.js"].code=["YUI.add('button-group', function (Y, NAME) {","","/**","* A Widget to create groups of buttons","*","* @module button-group","* @since 3.5.0","*/","","var CONTENT_BOX = \"contentBox\","," CLICK_EVENT = \"click\","," CLASS_NAMES = Y.ButtonCore.CLASS_NAMES;","","/**","* Creates a ButtonGroup","*","* @class ButtonGroup","* @extends Widget","* @param config {Object} Configuration object","* @constructor","*/","function ButtonGroup() {"," ButtonGroup.superclass.constructor.apply(this, arguments);","}","","/* ButtonGroup extends Widget */","Y.ButtonGroup = Y.extend(ButtonGroup, Y.Widget, {",""," /**"," * @method renderUI"," * @description Creates a visual representation of the widget based on existing parameters."," * @public"," */"," renderUI: function() {"," this.getButtons().plug(Y.Plugin.Button);"," },",""," /**"," * @method bindUI"," * @description Hooks up events for the widget"," * @public"," */"," bindUI: function() {"," var group = this,"," cb = group.get(CONTENT_BOX);",""," cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group);"," },",""," /**"," * @method getButtons"," * @description Returns all buttons inside this this button group"," * @public"," */"," getButtons: function() {"," var cb = this.get(CONTENT_BOX);",""," return cb.all(Y.ButtonGroup.BUTTON_SELECTOR);"," },",""," /**"," * @method getSelectedButtons"," * @description Returns all Y.Buttons instances that are selected"," * @public"," */"," getSelectedButtons: function() {"," var group = this,"," selected = [],"," buttons = group.getButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," buttons.each(function(node){"," if (node.hasClass(selectedClass)){"," selected.push(node);"," }"," });",""," return selected;"," },",""," /**"," * @method getSelectedValues"," * @description Returns the values of all Y.Button instances that are selected"," * @public"," */"," getSelectedValues: function() {"," var group = this,"," value,"," values = [],"," selected = group.getSelectedButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," Y.Array.each(selected, function(node){"," if (node.hasClass(selectedClass)){"," value = node.getContent();"," values.push(value);"," }"," });",""," return values;"," },",""," /**"," * @method _handleClick"," * @description A delegated click handler for when any button is clicked in the content box"," * @param e {Object} An event object"," * @private"," */"," _handleClick: function(e){"," var group = this,"," clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true),"," type = group.get('type'),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,"," isSelected = clickedNode.hasClass(selectedClass),"," buttons;",""," // TODO: Anything for 'push' groups?",""," if (type === 'checkbox') {"," clickedNode.toggleClass(selectedClass, !isSelected);"," /**"," * @event selectionChange"," * @description fires when any button in the group changes its checked status"," * @param {Event} the event object. It contains an \"originEvent\" property"," * linking to the original DOM event that triggered the selection change"," */"," group.fire('selectionChange', {originEvent: e});"," }"," else if (type === 'radio') {"," if (!isSelected) {"," buttons = group.getButtons(); // Todo: getSelectedButtons()? Need it to return an arraylist then."," buttons.removeClass(selectedClass);"," clickedNode.addClass(selectedClass);"," group.fire('selectionChange', {originEvent: e});"," }"," }"," }","","}, {"," // Y.ButtonGroup static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'buttongroup',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," type: {"," writeOnce: 'initOnly',"," value: 'radio'"," }"," },",""," /**"," * List of class names to use for ButtonGroups"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @static"," */"," CLASS_NAMES: CLASS_NAMES,"," "," /**"," * Selector used to find buttons inside a ButtonGroup"," * @type {String}"," */"," BUTTON_SELECTOR: \"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]\"","});","","","}, '3.7.2', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget\"]});"];+_yuitest_coverage["build/button-group/button-group.js"].code=["YUI.add('button-group', function (Y, NAME) {","","/**","* A Widget to create groups of buttons","*","* @module button-group","* @since 3.5.0","*/","","var CONTENT_BOX = \"contentBox\","," CLICK_EVENT = \"click\","," CLASS_NAMES = Y.ButtonCore.CLASS_NAMES;","","/**","* Creates a ButtonGroup","*","* @class ButtonGroup","* @extends Widget","* @param config {Object} Configuration object","* @constructor","*/","function ButtonGroup() {"," ButtonGroup.superclass.constructor.apply(this, arguments);","}","","/* ButtonGroup extends Widget */","Y.ButtonGroup = Y.extend(ButtonGroup, Y.Widget, {",""," /**"," * @method renderUI"," * @description Creates a visual representation of the widget based on existing parameters."," * @public"," */"," renderUI: function() {"," this.getButtons().plug(Y.Plugin.Button);"," },",""," /**"," * @method bindUI"," * @description Hooks up events for the widget"," * @public"," */"," bindUI: function() {"," var group = this,"," cb = group.get(CONTENT_BOX);",""," cb.delegate(CLICK_EVENT, group._handleClick, Y.ButtonGroup.BUTTON_SELECTOR, group);"," },",""," /**"," * @method getButtons"," * @description Returns all buttons inside this this button group"," * @public"," */"," getButtons: function() {"," var cb = this.get(CONTENT_BOX);",""," return cb.all(Y.ButtonGroup.BUTTON_SELECTOR);"," },",""," /**"," * @method getSelectedButtons"," * @description Returns all Y.Buttons instances that are selected"," * @public"," */"," getSelectedButtons: function() {"," var group = this,"," selected = [],"," buttons = group.getButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," buttons.each(function(node){"," if (node.hasClass(selectedClass)){"," selected.push(node);"," }"," });",""," return selected;"," },",""," /**"," * @method getSelectedValues"," * @description Returns the values of all Y.Button instances that are selected"," * @public"," */"," getSelectedValues: function() {"," var group = this,"," value,"," values = [],"," selected = group.getSelectedButtons(),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED;",""," Y.Array.each(selected, function(node){"," if (node.hasClass(selectedClass)){"," value = node.getContent();"," values.push(value);"," }"," });",""," return values;"," },",""," /**"," * @method _handleClick"," * @description A delegated click handler for when any button is clicked in the content box"," * @param e {Object} An event object"," * @private"," */"," _handleClick: function(e){"," var group = this,"," clickedNode = e.target.ancestor('.' + ButtonGroup.CLASS_NAMES.BUTTON, true),"," type = group.get('type'),"," selectedClass = ButtonGroup.CLASS_NAMES.SELECTED,"," isSelected = clickedNode.hasClass(selectedClass),"," buttons;",""," // TODO: Anything for 'push' groups?",""," if (type === 'checkbox') {"," clickedNode.toggleClass(selectedClass, !isSelected);"," /**"," * @event selectionChange"," * @description fires when any button in the group changes its checked status"," * @param {Event} the event object. It contains an \"originEvent\" property"," * linking to the original DOM event that triggered the selection change"," */"," group.fire('selectionChange', {originEvent: e});"," }"," else if (type === 'radio') {"," if (!isSelected) {"," buttons = group.getButtons(); // Todo: getSelectedButtons()? Need it to return an arraylist then."," buttons.removeClass(selectedClass);"," clickedNode.addClass(selectedClass);"," group.fire('selectionChange', {originEvent: e});"," }"," }"," }","","}, {"," // Y.ButtonGroup static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'buttongroup',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," type: {"," writeOnce: 'initOnly',"," value: 'radio'"," }"," },",""," /**"," * List of class names to use for ButtonGroups"," *"," * @property CLASS_NAMES"," * @type {Object}"," * @static"," */"," CLASS_NAMES: CLASS_NAMES,"," "," /**"," * Selector used to find buttons inside a ButtonGroup"," * @type {String}"," */"," BUTTON_SELECTOR: \"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]\"","});","","","}, '3.7.3', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget\"]});"]; _yuitest_coverage["build/button-group/button-group.js"].lines = {"1":0,"10":0,"22":0,"23":0,"27":0,"35":0,"44":0,"47":0,"56":0,"58":0,"67":0,"72":0,"73":0,"74":0,"78":0,"87":0,"93":0,"94":0,"95":0,"96":0,"100":0,"110":0,"119":0,"120":0,"127":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0}; _yuitest_coverage["build/button-group/button-group.js"].functions = {"ButtonGroup:22":0,"renderUI:34":0,"bindUI:43":0,"getButtons:55":0,"(anonymous 2):72":0,"getSelectedButtons:66":0,"(anonymous 3):93":0,"getSelectedValues:86":0,"_handleClick:109":0,"(anonymous 1):1":0}; _yuitest_coverage["build/button-group/button-group.js"].coveredLines = 31;@@ -264,4 +264,4 @@ }); -}, '3.7.2', {"requires": ["button-plugin", "cssbutton", "widget"]});+}, '3.7.3', {"requires": ["button-plugin", "cssbutton", "widget"]});
bundle/button-group/button-group-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -190,4 +190,4 @@ }); -}, '3.7.2', {"requires": ["button-plugin", "cssbutton", "widget"]});+}, '3.7.3', {"requires": ["button-plugin", "cssbutton", "widget"]});
bundle/button-group/button-group-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button-group",function(e,t){function s(){s.superclass.constructor.apply(this,arguments)}var n="contentBox",r="click",i=e.ButtonCore.CLASS_NAMES;e.ButtonGroup=e.extend(s,e.Widget,{renderUI:function(){this.getButtons().plug(e.Plugin.Button)},bindUI:function(){var t=this,i=t.get(n);i.delegate(r,t._handleClick,e.ButtonGroup.BUTTON_SELECTOR,t)},getButtons:function(){var t=this.get(n);return t.all(e.ButtonGroup.BUTTON_SELECTOR)},getSelectedButtons:function(){var e=this,t=[],n=e.getButtons(),r=s.CLASS_NAMES.SELECTED;return n.each(function(e){e.hasClass(r)&&t.push(e)}),t},getSelectedValues:function(){var t=this,n,r=[],i=t.getSelectedButtons(),o=s.CLASS_NAMES.SELECTED;return e.Array.each(i,function(e){e.hasClass(o)&&(n=e.getContent(),r.push(n))}),r},_handleClick:function(e){var t=this,n=e.target.ancestor("."+s.CLASS_NAMES.BUTTON,!0),r=t.get("type"),i=s.CLASS_NAMES.SELECTED,o=n.hasClass(i),u;r==="checkbox"?(n.toggleClass(i,!o),t.fire("selectionChange",{originEvent:e})):r==="radio"&&(o||(u=t.getButtons(),u.removeClass(i),n.addClass(i),t.fire("selectionChange",{originEvent:e})))}},{NAME:"buttongroup",ATTRS:{type:{writeOnce:"initOnly",value:"radio"}},CLASS_NAMES:i,BUTTON_SELECTOR:"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]"})},"3.7.2",{requires:["button-plugin","cssbutton","widget"]});+YUI.add("button-group",function(e,t){function s(){s.superclass.constructor.apply(this,arguments)}var n="contentBox",r="click",i=e.ButtonCore.CLASS_NAMES;e.ButtonGroup=e.extend(s,e.Widget,{renderUI:function(){this.getButtons().plug(e.Plugin.Button)},bindUI:function(){var t=this,i=t.get(n);i.delegate(r,t._handleClick,e.ButtonGroup.BUTTON_SELECTOR,t)},getButtons:function(){var t=this.get(n);return t.all(e.ButtonGroup.BUTTON_SELECTOR)},getSelectedButtons:function(){var e=this,t=[],n=e.getButtons(),r=s.CLASS_NAMES.SELECTED;return n.each(function(e){e.hasClass(r)&&t.push(e)}),t},getSelectedValues:function(){var t=this,n,r=[],i=t.getSelectedButtons(),o=s.CLASS_NAMES.SELECTED;return e.Array.each(i,function(e){e.hasClass(o)&&(n=e.getContent(),r.push(n))}),r},_handleClick:function(e){var t=this,n=e.target.ancestor("."+s.CLASS_NAMES.BUTTON,!0),r=t.get("type"),i=s.CLASS_NAMES.SELECTED,o=n.hasClass(i),u;r==="checkbox"?(n.toggleClass(i,!o),t.fire("selectionChange",{originEvent:e})):r==="radio"&&(o||(u=t.getButtons(),u.removeClass(i),n.addClass(i),t.fire("selectionChange",{originEvent:e})))}},{NAME:"buttongroup",ATTRS:{type:{writeOnce:"initOnly",value:"radio"}},CLASS_NAMES:i,BUTTON_SELECTOR:"button, input[type=button], input[type=reset], input[type=submit], input[type=radio], input[type=checkbox]"})},"3.7.3",{requires:["button-plugin","cssbutton","widget"]});
bundle/button-group/button-group.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -190,4 +190,4 @@ }); -}, '3.7.2', {"requires": ["button-plugin", "cssbutton", "widget"]});+}, '3.7.3', {"requires": ["button-plugin", "cssbutton", "widget"]});
bundle/button-plugin/button-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/button-plugin/button-plugin.js", code: [] };-_yuitest_coverage["build/button-plugin/button-plugin.js"].code=["YUI.add('button-plugin', function (Y, NAME) {","","/**","* A Button Plugin","*","* @module button-plugin","* @since 3.5.0","*/","","/**","* @class ButtonPlugin","* @param config {Object} Configuration object","* @constructor","*/","function ButtonPlugin(config) {"," ButtonPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(ButtonPlugin, Y.ButtonCore, {"," "," /**"," * @method _afterNodeGet"," * @param name {string}"," * @private"," */"," _afterNodeGet: function (name) {"," // TODO: point to method (_uiSetLabel, etc) instead of getter/setter"," var ATTRS = this.constructor.ATTRS,"," fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];"," "," if (fn) {"," return new Y.Do.AlterReturn('get ' + name, fn.call(this));"," }"," },",""," /**"," * @method _afterNodeSet"," * @param name {String}"," * @param val {String}"," * @private"," */"," _afterNodeSet: function (name, val) {"," var ATTRS = this.constructor.ATTRS,"," fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];"," "," if (fn) {"," fn.call(this, val);"," }"," },",""," /**"," * @method _initNode"," * @param config {Object}"," * @private"," */"," _initNode: function(config) {"," var node = config.host;"," this._host = node;"," "," Y.Do.after(this._afterNodeGet, node, 'get', this);"," Y.Do.after(this._afterNodeSet, node, 'set', this);"," },",""," /**"," * @method destroy"," * @private"," */"," destroy: function(){"," // Nothing to do, but things are happier with it here"," }"," ","}, {"," "," /**"," * Attribute configuration."," *"," * @property ATTRS"," * @type {Object}"," * @private"," * @static"," */"," ATTRS: Y.merge(Y.ButtonCore.ATTRS),"," "," /**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME: 'buttonPlugin',"," "," /**"," * Namespace of this component."," *"," * @property NS"," * @type String"," * @static"," */"," NS: 'button'"," ","});","","/**","* @method createNode","* @description A factory that plugs a Y.Node instance with Y.Plugin.Button","* @param node {Object}","* @param config {Object}","* @returns {Object} A plugged Y.Node instance","* @public","*/","ButtonPlugin.createNode = function(node, config) {"," var template;",""," if (node && !config) {"," if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {"," config = node;"," node = config.srcNode;"," }"," }",""," config = config || {};"," template = config.template || Y.Plugin.Button.prototype.TEMPLATE;"," node = node || config.srcNode || Y.DOM.create(template);",""," return Y.one(node).plug(Y.Plugin.Button, config);","};","","Y.namespace('Plugin').Button = ButtonPlugin;","","","}, '3.7.2', {\"requires\": [\"button-core\", \"cssbutton\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/button-plugin/button-plugin.js"].code=["YUI.add('button-plugin', function (Y, NAME) {","","/**","* A Button Plugin","*","* @module button-plugin","* @since 3.5.0","*/","","/**","* @class ButtonPlugin","* @param config {Object} Configuration object","* @constructor","*/","function ButtonPlugin(config) {"," ButtonPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(ButtonPlugin, Y.ButtonCore, {"," "," /**"," * @method _afterNodeGet"," * @param name {string}"," * @private"," */"," _afterNodeGet: function (name) {"," // TODO: point to method (_uiSetLabel, etc) instead of getter/setter"," var ATTRS = this.constructor.ATTRS,"," fn = ATTRS[name] && ATTRS[name].getter && this[ATTRS[name].getter];"," "," if (fn) {"," return new Y.Do.AlterReturn('get ' + name, fn.call(this));"," }"," },",""," /**"," * @method _afterNodeSet"," * @param name {String}"," * @param val {String}"," * @private"," */"," _afterNodeSet: function (name, val) {"," var ATTRS = this.constructor.ATTRS,"," fn = ATTRS[name] && ATTRS[name].setter && this[ATTRS[name].setter];"," "," if (fn) {"," fn.call(this, val);"," }"," },",""," /**"," * @method _initNode"," * @param config {Object}"," * @private"," */"," _initNode: function(config) {"," var node = config.host;"," this._host = node;"," "," Y.Do.after(this._afterNodeGet, node, 'get', this);"," Y.Do.after(this._afterNodeSet, node, 'set', this);"," },",""," /**"," * @method destroy"," * @private"," */"," destroy: function(){"," // Nothing to do, but things are happier with it here"," }"," ","}, {"," "," /**"," * Attribute configuration."," *"," * @property ATTRS"," * @type {Object}"," * @private"," * @static"," */"," ATTRS: Y.merge(Y.ButtonCore.ATTRS),"," "," /**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME: 'buttonPlugin',"," "," /**"," * Namespace of this component."," *"," * @property NS"," * @type String"," * @static"," */"," NS: 'button'"," ","});","","/**","* @method createNode","* @description A factory that plugs a Y.Node instance with Y.Plugin.Button","* @param node {Object}","* @param config {Object}","* @returns {Object} A plugged Y.Node instance","* @public","*/","ButtonPlugin.createNode = function(node, config) {"," var template;",""," if (node && !config) {"," if (! (node.nodeType || node.getDOMNode || typeof node == 'string')) {"," config = node;"," node = config.srcNode;"," }"," }",""," config = config || {};"," template = config.template || Y.Plugin.Button.prototype.TEMPLATE;"," node = node || config.srcNode || Y.DOM.create(template);",""," return Y.one(node).plug(Y.Plugin.Button, config);","};","","Y.namespace('Plugin').Button = ButtonPlugin;","","","}, '3.7.3', {\"requires\": [\"button-core\", \"cssbutton\", \"node-pluginhost\"]});"]; _yuitest_coverage["build/button-plugin/button-plugin.js"].lines = {"1":0,"15":0,"16":0,"19":0,"28":0,"31":0,"32":0,"43":0,"46":0,"47":0,"57":0,"58":0,"60":0,"61":0,"112":0,"113":0,"115":0,"116":0,"117":0,"118":0,"122":0,"123":0,"124":0,"126":0,"129":0}; _yuitest_coverage["build/button-plugin/button-plugin.js"].functions = {"ButtonPlugin:15":0,"_afterNodeGet:26":0,"_afterNodeSet:42":0,"_initNode:56":0,"createNode:112":0,"(anonymous 1):1":0}; _yuitest_coverage["build/button-plugin/button-plugin.js"].coveredLines = 25;@@ -199,4 +199,4 @@ Y.namespace('Plugin').Button = ButtonPlugin; -}, '3.7.2', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});+}, '3.7.3', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});
bundle/button-plugin/button-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -135,4 +135,4 @@ Y.namespace('Plugin').Button = ButtonPlugin; -}, '3.7.2', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});+}, '3.7.3', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});
bundle/button-plugin/button-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button-plugin",function(e,t){function n(e){n.superclass.constructor.apply(this,arguments)}e.extend(n,e.ButtonCore,{_afterNodeGet:function(t){var n=this.constructor.ATTRS,r=n[t]&&n[t].getter&&this[n[t].getter];if(r)return new e.Do.AlterReturn("get "+t,r.call(this))},_afterNodeSet:function(e,t){var n=this.constructor.ATTRS,r=n[e]&&n[e].setter&&this[n[e].setter];r&&r.call(this,t)},_initNode:function(t){var n=t.host;this._host=n,e.Do.after(this._afterNodeGet,n,"get",this),e.Do.after(this._afterNodeSet,n,"set",this)},destroy:function(){}},{ATTRS:e.merge(e.ButtonCore.ATTRS),NAME:"buttonPlugin",NS:"button"}),n.createNode=function(t,n){var r;return t&&!n&&!t.nodeType&&!t.getDOMNode&&typeof t!="string"&&(n=t,t=n.srcNode),n=n||{},r=n.template||e.Plugin.Button.prototype.TEMPLATE,t=t||n.srcNode||e.DOM.create(r),e.one(t).plug(e.Plugin.Button,n)},e.namespace("Plugin").Button=n},"3.7.2",{requires:["button-core","cssbutton","node-pluginhost"]});+YUI.add("button-plugin",function(e,t){function n(e){n.superclass.constructor.apply(this,arguments)}e.extend(n,e.ButtonCore,{_afterNodeGet:function(t){var n=this.constructor.ATTRS,r=n[t]&&n[t].getter&&this[n[t].getter];if(r)return new e.Do.AlterReturn("get "+t,r.call(this))},_afterNodeSet:function(e,t){var n=this.constructor.ATTRS,r=n[e]&&n[e].setter&&this[n[e].setter];r&&r.call(this,t)},_initNode:function(t){var n=t.host;this._host=n,e.Do.after(this._afterNodeGet,n,"get",this),e.Do.after(this._afterNodeSet,n,"set",this)},destroy:function(){}},{ATTRS:e.merge(e.ButtonCore.ATTRS),NAME:"buttonPlugin",NS:"button"}),n.createNode=function(t,n){var r;return t&&!n&&!t.nodeType&&!t.getDOMNode&&typeof t!="string"&&(n=t,t=n.srcNode),n=n||{},r=n.template||e.Plugin.Button.prototype.TEMPLATE,t=t||n.srcNode||e.DOM.create(r),e.one(t).plug(e.Plugin.Button,n)},e.namespace("Plugin").Button=n},"3.7.3",{requires:["button-core","cssbutton","node-pluginhost"]});
bundle/button-plugin/button-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -135,4 +135,4 @@ Y.namespace('Plugin').Button = ButtonPlugin; -}, '3.7.2', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});+}, '3.7.3', {"requires": ["button-core", "cssbutton", "node-pluginhost"]});
bundle/button/button-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/button/button.js", code: [] };-_yuitest_coverage["build/button/button.js"].code=["YUI.add('button', function (Y, NAME) {","","/**","* A Button Widget","*","* @module button","* @since 3.5.0","*/","","var CLASS_NAMES = Y.ButtonCore.CLASS_NAMES,"," ARIA_STATES = Y.ButtonCore.ARIA_STATES,"," ARIA_ROLES = Y.ButtonCore.ARIA_ROLES;","","/**","* Creates a Button","*","* @class Button","* @extends Widget","* @param config {Object} Configuration object","* @constructor","*/","function Button(config) {"," Button.superclass.constructor.apply(this, arguments);","}","","/* Button extends Widget */","Y.extend(Button, Y.Widget, {",""," BOUNDING_TEMPLATE: Y.ButtonCore.prototype.TEMPLATE,",""," CONTENT_TEMPLATE: null,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._host = this.get('boundingBox');"," },",""," /**"," * bindUI implementation"," *"," * @description Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function() {"," var button = this;"," button.after('labelChange', button._afterLabelChange);"," button.after('disabledChange', button._afterDisabledChange);"," },",""," /**"," * @method syncUI"," * @description Updates button attributes"," */"," syncUI: function() {"," var button = this;"," button._uiSetLabel(button.get('label'));"," button._uiSetDisabled(button.get('disabled'));"," },",""," /**"," * @method _afterLabelChange"," * @private"," */"," _afterLabelChange: function(e) {"," this._uiSetLabel(e.newVal);"," },",""," /**"," * @method _afterDisabledChange"," * @private"," */"," _afterDisabledChange: function(e) {"," this._uiSetDisabled(e.newVal);"," }","","}, {"," // Y.Button static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'button'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'button',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," label: {"," value: Y.ButtonCore.ATTRS.label.value"," },",""," disabled: {"," value: false"," }"," },",""," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," label: function(node) {"," this._host = node; // TODO: remove"," return this._getLabel();"," },",""," disabled: function(node) {"," return node.getDOMNode().disabled;"," }"," },",""," /**"," * List of class names used in the ButtonGroup's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES","});","","Y.mix(Button.prototype, Y.ButtonCore.prototype);","","/**","* Creates a ToggleButton","*","* @class ToggleButton","* @extends Button","* @param config {Object} Configuration object","* @constructor","*/","function ToggleButton(config) {"," Button.superclass.constructor.apply(this, arguments);","}","","// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.","/* ToggleButton extends Button */","Y.extend(ToggleButton, Button, {"," "," trigger: 'click',"," selectedAttrName: '',"," "," initializer: function (config) {"," var button = this,"," type = button.get('type'),"," selectedAttrName = (type === \"checkbox\" ? 'checked' : 'pressed'),"," selectedState = config[selectedAttrName] || false;"," "," // Create the checked/pressed attribute"," button.addAttr(selectedAttrName, {"," value: selectedState"," });"," "," button.selectedAttrName = selectedAttrName;"," },"," "," destructor: function () {"," delete this.selectedAttrName;"," },"," "," /**"," * @method bindUI"," * @description Hooks up events for the widget"," */"," bindUI: function() {"," var button = this,"," cb = button.get('contentBox');"," "," ToggleButton.superclass.bindUI.call(button);"," "," cb.on(button.trigger, button.toggle, button);"," button.after(button.selectedAttrName + 'Change', button._afterSelectedChange);"," },",""," /**"," * @method syncUI"," * @description Syncs the UI for the widget"," */"," syncUI: function() {"," var button = this,"," cb = button.get('contentBox'),"," type = button.get('type'),"," ROLES = ToggleButton.ARIA_ROLES,"," role = (type === 'checkbox' ? ROLES.CHECKBOX : ROLES.TOGGLE),"," selectedAttrName = button.selectedAttrName;",""," ToggleButton.superclass.syncUI.call(button);"," "," cb.set('role', role);"," button._uiSetSelected(button.get(selectedAttrName));"," },"," "," _afterSelectedChange: function(e){"," this._uiSetSelected(e.newVal);"," },"," "," /**"," * @method _uiSetSelected"," * @private"," */"," _uiSetSelected: function(value) {"," var button = this,"," cb = button.get('contentBox'),"," STATES = ToggleButton.ARIA_STATES,"," type = button.get('type'),"," ariaState = (type === 'checkbox' ? STATES.CHECKED : STATES.PRESSED);"," "," cb.toggleClass(Button.CLASS_NAMES.SELECTED, value);"," cb.set(ariaState, value);"," },"," "," /**"," * @method toggle"," * @description Toggles the selected/pressed/checked state of a ToggleButton"," * @public"," */"," toggle: function() {"," var button = this;"," button._set(button.selectedAttrName, !button.get(button.selectedAttrName));"," }","","}, {"," "," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'toggleButton',"," "," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," type: {"," value: 'toggle',"," writeOnce: 'initOnly'"," }"," },"," "," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," checked: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," },"," pressed: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," }"," },"," "," /**"," * @property ARIA_STATES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_STATES: ARIA_STATES,",""," /**"," * @property ARIA_ROLES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_ROLES: ARIA_ROLES,",""," /**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES"," ","});","","// Export","Y.Button = Button;","Y.ToggleButton = ToggleButton;","","","}, '3.7.2', {\"requires\": [\"button-core\", \"cssbutton\", \"widget\"]});"];+_yuitest_coverage["build/button/button.js"].code=["YUI.add('button', function (Y, NAME) {","","/**","* A Button Widget","*","* @module button","* @since 3.5.0","*/","","var CLASS_NAMES = Y.ButtonCore.CLASS_NAMES,"," ARIA_STATES = Y.ButtonCore.ARIA_STATES,"," ARIA_ROLES = Y.ButtonCore.ARIA_ROLES;","","/**","* Creates a Button","*","* @class Button","* @extends Widget","* @param config {Object} Configuration object","* @constructor","*/","function Button(config) {"," Button.superclass.constructor.apply(this, arguments);","}","","/* Button extends Widget */","Y.extend(Button, Y.Widget, {",""," BOUNDING_TEMPLATE: Y.ButtonCore.prototype.TEMPLATE,",""," CONTENT_TEMPLATE: null,",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._host = this.get('boundingBox');"," },",""," /**"," * bindUI implementation"," *"," * @description Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function() {"," var button = this;"," button.after('labelChange', button._afterLabelChange);"," button.after('disabledChange', button._afterDisabledChange);"," },",""," /**"," * @method syncUI"," * @description Updates button attributes"," */"," syncUI: function() {"," var button = this;"," button._uiSetLabel(button.get('label'));"," button._uiSetDisabled(button.get('disabled'));"," },",""," /**"," * @method _afterLabelChange"," * @private"," */"," _afterLabelChange: function(e) {"," this._uiSetLabel(e.newVal);"," },",""," /**"," * @method _afterDisabledChange"," * @private"," */"," _afterDisabledChange: function(e) {"," this._uiSetDisabled(e.newVal);"," }","","}, {"," // Y.Button static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'button'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'button',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," label: {"," value: Y.ButtonCore.ATTRS.label.value"," },",""," disabled: {"," value: false"," }"," },",""," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," label: function(node) {"," this._host = node; // TODO: remove"," return this._getLabel();"," },",""," disabled: function(node) {"," return node.getDOMNode().disabled;"," }"," },",""," /**"," * List of class names used in the ButtonGroup's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES","});","","Y.mix(Button.prototype, Y.ButtonCore.prototype);","","/**","* Creates a ToggleButton","*","* @class ToggleButton","* @extends Button","* @param config {Object} Configuration object","* @constructor","*/","function ToggleButton(config) {"," Button.superclass.constructor.apply(this, arguments);","}","","// TODO: move to ButtonCore subclass to enable toggle plugin, widget, etc.","/* ToggleButton extends Button */","Y.extend(ToggleButton, Button, {"," "," trigger: 'click',"," selectedAttrName: '',"," "," initializer: function (config) {"," var button = this,"," type = button.get('type'),"," selectedAttrName = (type === \"checkbox\" ? 'checked' : 'pressed'),"," selectedState = config[selectedAttrName] || false;"," "," // Create the checked/pressed attribute"," button.addAttr(selectedAttrName, {"," value: selectedState"," });"," "," button.selectedAttrName = selectedAttrName;"," },"," "," destructor: function () {"," delete this.selectedAttrName;"," },"," "," /**"," * @method bindUI"," * @description Hooks up events for the widget"," */"," bindUI: function() {"," var button = this,"," cb = button.get('contentBox');"," "," ToggleButton.superclass.bindUI.call(button);"," "," cb.on(button.trigger, button.toggle, button);"," button.after(button.selectedAttrName + 'Change', button._afterSelectedChange);"," },",""," /**"," * @method syncUI"," * @description Syncs the UI for the widget"," */"," syncUI: function() {"," var button = this,"," cb = button.get('contentBox'),"," type = button.get('type'),"," ROLES = ToggleButton.ARIA_ROLES,"," role = (type === 'checkbox' ? ROLES.CHECKBOX : ROLES.TOGGLE),"," selectedAttrName = button.selectedAttrName;",""," ToggleButton.superclass.syncUI.call(button);"," "," cb.set('role', role);"," button._uiSetSelected(button.get(selectedAttrName));"," },"," "," _afterSelectedChange: function(e){"," this._uiSetSelected(e.newVal);"," },"," "," /**"," * @method _uiSetSelected"," * @private"," */"," _uiSetSelected: function(value) {"," var button = this,"," cb = button.get('contentBox'),"," STATES = ToggleButton.ARIA_STATES,"," type = button.get('type'),"," ariaState = (type === 'checkbox' ? STATES.CHECKED : STATES.PRESSED);"," "," cb.toggleClass(Button.CLASS_NAMES.SELECTED, value);"," cb.set(ariaState, value);"," },"," "," /**"," * @method toggle"," * @description Toggles the selected/pressed/checked state of a ToggleButton"," * @public"," */"," toggle: function() {"," var button = this;"," button._set(button.selectedAttrName, !button.get(button.selectedAttrName));"," }","","}, {"," "," /**"," * The identity of the widget."," *"," * @property NAME"," * @type {String}"," * @default 'buttongroup'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'toggleButton',"," "," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," type: {"," value: 'toggle',"," writeOnce: 'initOnly'"," }"," },"," "," /**"," * @property HTML_PARSER"," * @type {Object}"," * @protected"," * @static"," */"," HTML_PARSER: {"," checked: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," },"," pressed: function(node) {"," return node.hasClass(CLASS_NAMES.SELECTED);"," }"," },"," "," /**"," * @property ARIA_STATES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_STATES: ARIA_STATES,",""," /**"," * @property ARIA_ROLES"," * @type {Object}"," * @protected"," * @static"," */"," ARIA_ROLES: ARIA_ROLES,",""," /**"," * Array of static constants used to identify the classnames applied to DOM nodes"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES"," ","});","","// Export","Y.Button = Button;","Y.ToggleButton = ToggleButton;","","","}, '3.7.3', {\"requires\": [\"button-core\", \"cssbutton\", \"widget\"]});"]; _yuitest_coverage["build/button/button.js"].lines = {"1":0,"10":0,"22":0,"23":0,"27":0,"40":0,"50":0,"51":0,"52":0,"60":0,"61":0,"62":0,"70":0,"78":0,"123":0,"124":0,"128":0,"142":0,"152":0,"153":0,"158":0,"164":0,"170":0,"174":0,"178":0,"186":0,"189":0,"191":0,"192":0,"200":0,"207":0,"209":0,"210":0,"214":0,"222":0,"228":0,"229":0,"238":0,"239":0,"280":0,"283":0,"315":0,"316":0}; _yuitest_coverage["build/button/button.js"].functions = {"Button:22":0,"initializer:39":0,"bindUI:49":0,"syncUI:59":0,"_afterLabelChange:69":0,"_afterDisabledChange:77":0,"label:122":0,"disabled:127":0,"ToggleButton:152":0,"initializer:163":0,"destructor:177":0,"bindUI:185":0,"syncUI:199":0,"_afterSelectedChange:213":0,"_uiSetSelected:221":0,"toggle:237":0,"checked:279":0,"pressed:282":0,"(anonymous 1):1":0}; _yuitest_coverage["build/button/button.js"].coveredLines = 43;@@ -417,4 +417,4 @@ Y.ToggleButton = ToggleButton; -}, '3.7.2', {"requires": ["button-core", "cssbutton", "widget"]});+}, '3.7.3', {"requires": ["button-core", "cssbutton", "widget"]});
bundle/button/button-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -322,4 +322,4 @@ Y.ToggleButton = ToggleButton; -}, '3.7.2', {"requires": ["button-core", "cssbutton", "widget"]});+}, '3.7.3', {"requires": ["button-core", "cssbutton", "widget"]});
bundle/button/button-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("button",function(e,t){function s(e){s.superclass.constructor.apply(this,arguments)}function o(e){s.superclass.constructor.apply(this,arguments)}var n=e.ButtonCore.CLASS_NAMES,r=e.ButtonCore.ARIA_STATES,i=e.ButtonCore.ARIA_ROLES;e.extend(s,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(e){this._host=this.get("boundingBox")},bindUI:function(){var e=this;e.after("labelChange",e._afterLabelChange),e.after("disabledChange",e._afterDisabledChange)},syncUI:function(){var e=this;e._uiSetLabel(e.get("label")),e._uiSetDisabled(e.get("disabled"))},_afterLabelChange:function(e){this._uiSetLabel(e.newVal)},_afterDisabledChange:function(e){this._uiSetDisabled(e.newVal)}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value},disabled:{value:!1}},HTML_PARSER:{label:function(e){return this._host=e,this._getLabel()},disabled:function(e){return e.getDOMNode().disabled}},CLASS_NAMES:n}),e.mix(s.prototype,e.ButtonCore.prototype),e.extend(o,s,{trigger:"click",selectedAttrName:"",initializer:function(e){var t=this,n=t.get("type"),r=n==="checkbox"?"checked":"pressed",i=e[r]||!1;t.addAttr(r,{value:i}),t.selectedAttrName=r},destructor:function(){delete this.selectedAttrName},bindUI:function(){var e=this,t=e.get("contentBox");o.superclass.bindUI.call(e),t.on(e.trigger,e.toggle,e),e.after(e.selectedAttrName+"Change",e._afterSelectedChange)},syncUI:function(){var e=this,t=e.get("contentBox"),n=e.get("type"),r=o.ARIA_ROLES,i=n==="checkbox"?r.CHECKBOX:r.TOGGLE,s=e.selectedAttrName;o.superclass.syncUI.call(e),t.set("role",i),e._uiSetSelected(e.get(s))},_afterSelectedChange:function(e){this._uiSetSelected(e.newVal)},_uiSetSelected:function(e){var t=this,n=t.get("contentBox"),r=o.ARIA_STATES,i=t.get("type"),u=i==="checkbox"?r.CHECKED:r.PRESSED;n.toggleClass(s.CLASS_NAMES.SELECTED,e),n.set(u,e)},toggle:function(){var e=this;e._set(e.selectedAttrName,!e.get(e.selectedAttrName))}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"}},HTML_PARSER:{checked:function(e){return e.hasClass(n.SELECTED)},pressed:function(e){return e.hasClass(n.SELECTED)}},ARIA_STATES:r,ARIA_ROLES:i,CLASS_NAMES:n}),e.Button=s,e.ToggleButton=o},"3.7.2",{requires:["button-core","cssbutton","widget"]});+YUI.add("button",function(e,t){function s(e){s.superclass.constructor.apply(this,arguments)}function o(e){s.superclass.constructor.apply(this,arguments)}var n=e.ButtonCore.CLASS_NAMES,r=e.ButtonCore.ARIA_STATES,i=e.ButtonCore.ARIA_ROLES;e.extend(s,e.Widget,{BOUNDING_TEMPLATE:e.ButtonCore.prototype.TEMPLATE,CONTENT_TEMPLATE:null,initializer:function(e){this._host=this.get("boundingBox")},bindUI:function(){var e=this;e.after("labelChange",e._afterLabelChange),e.after("disabledChange",e._afterDisabledChange)},syncUI:function(){var e=this;e._uiSetLabel(e.get("label")),e._uiSetDisabled(e.get("disabled"))},_afterLabelChange:function(e){this._uiSetLabel(e.newVal)},_afterDisabledChange:function(e){this._uiSetDisabled(e.newVal)}},{NAME:"button",ATTRS:{label:{value:e.ButtonCore.ATTRS.label.value},disabled:{value:!1}},HTML_PARSER:{label:function(e){return this._host=e,this._getLabel()},disabled:function(e){return e.getDOMNode().disabled}},CLASS_NAMES:n}),e.mix(s.prototype,e.ButtonCore.prototype),e.extend(o,s,{trigger:"click",selectedAttrName:"",initializer:function(e){var t=this,n=t.get("type"),r=n==="checkbox"?"checked":"pressed",i=e[r]||!1;t.addAttr(r,{value:i}),t.selectedAttrName=r},destructor:function(){delete this.selectedAttrName},bindUI:function(){var e=this,t=e.get("contentBox");o.superclass.bindUI.call(e),t.on(e.trigger,e.toggle,e),e.after(e.selectedAttrName+"Change",e._afterSelectedChange)},syncUI:function(){var e=this,t=e.get("contentBox"),n=e.get("type"),r=o.ARIA_ROLES,i=n==="checkbox"?r.CHECKBOX:r.TOGGLE,s=e.selectedAttrName;o.superclass.syncUI.call(e),t.set("role",i),e._uiSetSelected(e.get(s))},_afterSelectedChange:function(e){this._uiSetSelected(e.newVal)},_uiSetSelected:function(e){var t=this,n=t.get("contentBox"),r=o.ARIA_STATES,i=t.get("type"),u=i==="checkbox"?r.CHECKED:r.PRESSED;n.toggleClass(s.CLASS_NAMES.SELECTED,e),n.set(u,e)},toggle:function(){var e=this;e._set(e.selectedAttrName,!e.get(e.selectedAttrName))}},{NAME:"toggleButton",ATTRS:{type:{value:"toggle",writeOnce:"initOnly"}},HTML_PARSER:{checked:function(e){return e.hasClass(n.SELECTED)},pressed:function(e){return e.hasClass(n.SELECTED)}},ARIA_STATES:r,ARIA_ROLES:i,CLASS_NAMES:n}),e.Button=s,e.ToggleButton=o},"3.7.3",{requires:["button-core","cssbutton","widget"]});
bundle/button/button.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -322,4 +322,4 @@ Y.ToggleButton = ToggleButton; -}, '3.7.2', {"requires": ["button-core", "cssbutton", "widget"]});+}, '3.7.3', {"requires": ["button-core", "cssbutton", "widget"]});
bundle/cache-base/cache-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/cache-base/cache-base.js", code: [] };-_yuitest_coverage["build/cache-base/cache-base.js"].code=["YUI.add('cache-base', function (Y, NAME) {","","/**"," * The Cache utility provides a common configurable interface for components to"," * cache and retrieve data from a local JavaScript struct."," *"," * @module cache"," * @main"," */","","/**"," * Provides the base class for the YUI Cache utility."," *"," * @submodule cache-base"," */","var LANG = Y.Lang,"," isDate = Y.Lang.isDate,","","/**"," * Base class for the YUI Cache utility."," * @class Cache"," * @extends Base"," * @constructor"," */","Cache = function() {"," Cache.superclass.constructor.apply(this, arguments);","};",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(Cache, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NAME: \"cache\",","",""," ATTRS: {"," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @attribute max"," * @description Maximum number of entries the Cache can hold."," * Set to 0 to turn off caching."," * @type Number"," * @default 0"," */"," max: {"," value: 0,"," setter: \"_setMax\""," },",""," /**"," * @attribute size"," * @description Number of entries currently cached."," * @type Number"," */"," size: {"," readOnly: true,"," getter: \"_getSize\""," },",""," /**"," * @attribute uniqueKeys"," * @description Validate uniqueness of stored keys. Default is false and"," * is more performant."," * @type Boolean"," */"," uniqueKeys: {"," value: false"," },",""," /**"," * @attribute expires"," * @description Absolute Date when data expires or"," * relative number of milliseconds. Zero disables expiration."," * @type Date | Number"," * @default 0"," */"," expires: {"," value: 0,"," validator: function(v) {"," return Y.Lang.isDate(v) || (Y.Lang.isNumber(v) && v >= 0);"," }"," },",""," /**"," * @attribute entries"," * @description Cached entries."," * @type Array"," */"," entries: {"," readOnly: true,"," getter: \"_getEntries\""," }"," }","});","","Y.extend(Cache, Y.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache private properties"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Array of request/response objects indexed chronologically."," *"," * @property _entries"," * @type Object[]"," * @private"," */"," _entries: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache private methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {",""," /**"," * @event add"," * @description Fired when an entry is added."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @preventable _defAddFn"," */"," this.publish(\"add\", {defaultFn: this._defAddFn});",""," /**"," * @event flush"," * @description Fired when the cache is flushed."," * @param e {Event.Facade} Event Facade object."," * @preventable _defFlushFn"," */"," this.publish(\"flush\", {defaultFn: this._defFlushFn});",""," /**"," * @event request"," * @description Fired when an entry is requested from the cache."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>request (Object)</dt> <dd>The request object.</dd>"," * </dl>"," */",""," /**"," * @event retrieve"," * @description Fired when an entry is retrieved from the cache."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The retrieved entry.</dd>"," * </dl>"," */",""," // Initialize internal values"," this._entries = [];"," },",""," /**"," * @method destructor"," * @description Internal destroy() handler."," * @private"," */"," destructor: function() {"," this._entries = [];"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache protected methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Sets max."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," // If the cache is full, make room by removing stalest element (index=0)"," var entries = this._entries;"," if(value > 0) {"," if(entries) {"," while(entries.length > value) {"," entries.shift();"," }"," }"," }"," else {"," value = 0;"," this._entries = [];"," }"," return value;"," },",""," /**"," * Gets size."," *"," * @method _getSize"," * @protected"," */"," _getSize: function() {"," return this._entries.length;"," },",""," /**"," * Gets all entries."," *"," * @method _getEntries"," * @protected"," */"," _getEntries: function() {"," return this._entries;"," },","",""," /**"," * Adds entry to cache."," *"," * @method _defAddFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @protected"," */"," _defAddFn: function(e) {"," var entries = this._entries,"," entry = e.entry,"," max = this.get(\"max\"),"," pos;",""," // If uniqueKeys is true and item exists with this key, then remove it."," if (this.get(\"uniqueKeys\")) {"," pos = this._position(e.entry.request);"," if (LANG.isValue(pos)) {"," entries.splice(pos, 1);"," }"," }",""," // If the cache at or over capacity, make room by removing stalest"," // element(s) starting at index-0."," while (max && entries.length >= max) {"," entries.shift();"," }",""," // Add entry to cache in the newest position, at the end of the array"," entries[entries.length] = entry;"," },",""," /**"," * Flushes cache."," *"," * @method _defFlushFn"," * @param e {Event.Facade} Event Facade object."," * @protected"," */"," _defFlushFn: function(e) {"," var entries = this._entries,"," details = e.details[0],"," pos;",""," //passed an item, flush only that"," if(details && LANG.isValue(details.request)) {"," pos = this._position(details.request);",""," if(LANG.isValue(pos)) {"," entries.splice(pos,1);",""," }"," }"," //no item, flush everything"," else {"," this._entries = [];"," }"," },",""," /**"," * Default overridable method compares current request with given cache entry."," * Returns true if current request matches the cached request, otherwise"," * false. Implementers should override this method to customize the"," * cache-matching algorithm."," *"," * @method _isMatch"," * @param request {Object} Request object."," * @param entry {Object} Cached entry."," * @return {Boolean} True if current request matches given cached request, false otherwise."," * @protected"," */"," _isMatch: function(request, entry) {"," if(!entry.expires || new Date() < entry.expires) {"," return (request === entry.request);"," }"," return false;"," },",""," /**"," * Returns position of a request in the entries array, otherwise null."," *"," * @method _position"," * @param request {Object} Request object."," * @return {Number} Array position if found, null otherwise."," * @protected"," */"," _position: function(request) {"," // If cache is enabled..."," var entries = this._entries,"," length = entries.length,"," i = length-1;",""," if((this.get(\"max\") === null) || this.get(\"max\") > 0) {"," // Loop through each cached entry starting from the newest"," for(; i >= 0; i--) {"," // Execute matching function"," if(this._isMatch(request, entries[i])) {"," return i;"," }"," }"," }",""," return null;"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache public methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Adds a new entry to the cache of the format"," * {request:request, response:response, cached:cached, expires:expires}."," * If cache is full, evicts the stalest entry before adding the new one."," *"," * @method add"," * @param request {Object} Request value."," * @param response {Object} Response value."," */"," add: function(request, response) {"," var expires = this.get(\"expires\");"," if(this.get(\"initialized\") && ((this.get(\"max\") === null) || this.get(\"max\") > 0) &&"," (LANG.isValue(request) || LANG.isNull(request) || LANG.isUndefined(request))) {"," this.fire(\"add\", {entry: {"," request:request,"," response:response,"," cached: new Date(),"," expires: isDate(expires) ? expires :"," (expires ? new Date(new Date().getTime() + this.get(\"expires\")) : null)"," }});"," }"," else {"," }"," },",""," /**"," * Flushes cache."," *"," * @method flush"," */"," flush: function(request) {"," this.fire(\"flush\", { request: (LANG.isValue(request) ? request : null) });"," },",""," /**"," * Retrieves cached object for given request, if available, and refreshes"," * entry in the cache. Returns null if there is no cache match."," *"," * @method retrieve"," * @param request {Object} Request object."," * @return {Object} Cached object with the properties request and response, or null."," */"," retrieve: function(request) {"," // If cache is enabled..."," var entries = this._entries,"," length = entries.length,"," entry = null,"," pos;",""," if((length > 0) && ((this.get(\"max\") === null) || (this.get(\"max\") > 0))) {"," this.fire(\"request\", {request: request});",""," pos = this._position(request);",""," if(LANG.isValue(pos)) {"," entry = entries[pos];",""," this.fire(\"retrieve\", {entry: entry});",""," // Refresh the position of the cache hit"," if(pos < length-1) {"," // Remove element from its original location"," entries.splice(pos,1);"," // Add as newest"," entries[entries.length] = entry;"," }",""," return entry;"," }"," }"," return null;"," }","});","","Y.Cache = Cache;","","","}, '3.7.2', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/cache-base/cache-base.js"].code=["YUI.add('cache-base', function (Y, NAME) {","","/**"," * The Cache utility provides a common configurable interface for components to"," * cache and retrieve data from a local JavaScript struct."," *"," * @module cache"," * @main"," */","","/**"," * Provides the base class for the YUI Cache utility."," *"," * @submodule cache-base"," */","var LANG = Y.Lang,"," isDate = Y.Lang.isDate,","","/**"," * Base class for the YUI Cache utility."," * @class Cache"," * @extends Base"," * @constructor"," */","Cache = function() {"," Cache.superclass.constructor.apply(this, arguments);","};",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(Cache, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NAME: \"cache\",","",""," ATTRS: {"," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @attribute max"," * @description Maximum number of entries the Cache can hold."," * Set to 0 to turn off caching."," * @type Number"," * @default 0"," */"," max: {"," value: 0,"," setter: \"_setMax\""," },",""," /**"," * @attribute size"," * @description Number of entries currently cached."," * @type Number"," */"," size: {"," readOnly: true,"," getter: \"_getSize\""," },",""," /**"," * @attribute uniqueKeys"," * @description Validate uniqueness of stored keys. Default is false and"," * is more performant."," * @type Boolean"," */"," uniqueKeys: {"," value: false"," },",""," /**"," * @attribute expires"," * @description Absolute Date when data expires or"," * relative number of milliseconds. Zero disables expiration."," * @type Date | Number"," * @default 0"," */"," expires: {"," value: 0,"," validator: function(v) {"," return Y.Lang.isDate(v) || (Y.Lang.isNumber(v) && v >= 0);"," }"," },",""," /**"," * @attribute entries"," * @description Cached entries."," * @type Array"," */"," entries: {"," readOnly: true,"," getter: \"_getEntries\""," }"," }","});","","Y.extend(Cache, Y.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache private properties"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Array of request/response objects indexed chronologically."," *"," * @property _entries"," * @type Object[]"," * @private"," */"," _entries: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache private methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @method initializer"," * @description Internal init() handler."," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {",""," /**"," * @event add"," * @description Fired when an entry is added."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @preventable _defAddFn"," */"," this.publish(\"add\", {defaultFn: this._defAddFn});",""," /**"," * @event flush"," * @description Fired when the cache is flushed."," * @param e {Event.Facade} Event Facade object."," * @preventable _defFlushFn"," */"," this.publish(\"flush\", {defaultFn: this._defFlushFn});",""," /**"," * @event request"," * @description Fired when an entry is requested from the cache."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>request (Object)</dt> <dd>The request object.</dd>"," * </dl>"," */",""," /**"," * @event retrieve"," * @description Fired when an entry is retrieved from the cache."," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The retrieved entry.</dd>"," * </dl>"," */",""," // Initialize internal values"," this._entries = [];"," },",""," /**"," * @method destructor"," * @description Internal destroy() handler."," * @private"," */"," destructor: function() {"," this._entries = [];"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache protected methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Sets max."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," // If the cache is full, make room by removing stalest element (index=0)"," var entries = this._entries;"," if(value > 0) {"," if(entries) {"," while(entries.length > value) {"," entries.shift();"," }"," }"," }"," else {"," value = 0;"," this._entries = [];"," }"," return value;"," },",""," /**"," * Gets size."," *"," * @method _getSize"," * @protected"," */"," _getSize: function() {"," return this._entries.length;"," },",""," /**"," * Gets all entries."," *"," * @method _getEntries"," * @protected"," */"," _getEntries: function() {"," return this._entries;"," },","",""," /**"," * Adds entry to cache."," *"," * @method _defAddFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @protected"," */"," _defAddFn: function(e) {"," var entries = this._entries,"," entry = e.entry,"," max = this.get(\"max\"),"," pos;",""," // If uniqueKeys is true and item exists with this key, then remove it."," if (this.get(\"uniqueKeys\")) {"," pos = this._position(e.entry.request);"," if (LANG.isValue(pos)) {"," entries.splice(pos, 1);"," }"," }",""," // If the cache at or over capacity, make room by removing stalest"," // element(s) starting at index-0."," while (max && entries.length >= max) {"," entries.shift();"," }",""," // Add entry to cache in the newest position, at the end of the array"," entries[entries.length] = entry;"," },",""," /**"," * Flushes cache."," *"," * @method _defFlushFn"," * @param e {Event.Facade} Event Facade object."," * @protected"," */"," _defFlushFn: function(e) {"," var entries = this._entries,"," details = e.details[0],"," pos;",""," //passed an item, flush only that"," if(details && LANG.isValue(details.request)) {"," pos = this._position(details.request);",""," if(LANG.isValue(pos)) {"," entries.splice(pos,1);",""," }"," }"," //no item, flush everything"," else {"," this._entries = [];"," }"," },",""," /**"," * Default overridable method compares current request with given cache entry."," * Returns true if current request matches the cached request, otherwise"," * false. Implementers should override this method to customize the"," * cache-matching algorithm."," *"," * @method _isMatch"," * @param request {Object} Request object."," * @param entry {Object} Cached entry."," * @return {Boolean} True if current request matches given cached request, false otherwise."," * @protected"," */"," _isMatch: function(request, entry) {"," if(!entry.expires || new Date() < entry.expires) {"," return (request === entry.request);"," }"," return false;"," },",""," /**"," * Returns position of a request in the entries array, otherwise null."," *"," * @method _position"," * @param request {Object} Request object."," * @return {Number} Array position if found, null otherwise."," * @protected"," */"," _position: function(request) {"," // If cache is enabled..."," var entries = this._entries,"," length = entries.length,"," i = length-1;",""," if((this.get(\"max\") === null) || this.get(\"max\") > 0) {"," // Loop through each cached entry starting from the newest"," for(; i >= 0; i--) {"," // Execute matching function"," if(this._isMatch(request, entries[i])) {"," return i;"," }"," }"," }",""," return null;"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // Cache public methods"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * Adds a new entry to the cache of the format"," * {request:request, response:response, cached:cached, expires:expires}."," * If cache is full, evicts the stalest entry before adding the new one."," *"," * @method add"," * @param request {Object} Request value."," * @param response {Object} Response value."," */"," add: function(request, response) {"," var expires = this.get(\"expires\");"," if(this.get(\"initialized\") && ((this.get(\"max\") === null) || this.get(\"max\") > 0) &&"," (LANG.isValue(request) || LANG.isNull(request) || LANG.isUndefined(request))) {"," this.fire(\"add\", {entry: {"," request:request,"," response:response,"," cached: new Date(),"," expires: isDate(expires) ? expires :"," (expires ? new Date(new Date().getTime() + this.get(\"expires\")) : null)"," }});"," }"," else {"," }"," },",""," /**"," * Flushes cache."," *"," * @method flush"," */"," flush: function(request) {"," this.fire(\"flush\", { request: (LANG.isValue(request) ? request : null) });"," },",""," /**"," * Retrieves cached object for given request, if available, and refreshes"," * entry in the cache. Returns null if there is no cache match."," *"," * @method retrieve"," * @param request {Object} Request object."," * @return {Object} Cached object with the properties request and response, or null."," */"," retrieve: function(request) {"," // If cache is enabled..."," var entries = this._entries,"," length = entries.length,"," entry = null,"," pos;",""," if((length > 0) && ((this.get(\"max\") === null) || (this.get(\"max\") > 0))) {"," this.fire(\"request\", {request: request});",""," pos = this._position(request);",""," if(LANG.isValue(pos)) {"," entry = entries[pos];",""," this.fire(\"retrieve\", {entry: entry});",""," // Refresh the position of the cache hit"," if(pos < length-1) {"," // Remove element from its original location"," entries.splice(pos,1);"," // Add as newest"," entries[entries.length] = entry;"," }",""," return entry;"," }"," }"," return null;"," }","});","","Y.Cache = Cache;","","","}, '3.7.3', {\"requires\": [\"base\"]});"]; _yuitest_coverage["build/cache-base/cache-base.js"].lines = {"1":0,"16":0,"26":0,"34":0,"96":0,"112":0,"151":0,"159":0,"180":0,"189":0,"206":0,"207":0,"208":0,"209":0,"210":0,"215":0,"216":0,"218":0,"228":0,"238":0,"253":0,"259":0,"260":0,"261":0,"262":0,"268":0,"269":0,"273":0,"284":0,"289":0,"290":0,"292":0,"293":0,"299":0,"316":0,"317":0,"319":0,"332":0,"336":0,"338":0,"340":0,"341":0,"346":0,"365":0,"366":0,"368":0,"386":0,"399":0,"404":0,"405":0,"407":0,"409":0,"410":0,"412":0,"415":0,"417":0,"419":0,"422":0,"425":0,"429":0}; _yuitest_coverage["build/cache-base/cache-base.js"].functions = {"Cache:25":0,"validator:95":0,"initializer:140":0,"destructor:188":0,"_setMax:204":0,"_getSize:227":0,"_getEntries:237":0,"_defAddFn:252":0,"_defFlushFn:283":0,"_isMatch:315":0,"_position:330":0,"add:364":0,"flush:385":0,"retrieve:397":0,"(anonymous 1):1":0}; _yuitest_coverage["build/cache-base/cache-base.js"].coveredLines = 60;@@ -543,4 +543,4 @@ Y.Cache = Cache; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/cache-base/cache-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -445,4 +445,4 @@ Y.Cache = Cache; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/cache-base/cache-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cache-base",function(e,t){var n=e.Lang,r=e.Lang.isDate,i=function(){i.superclass.constructor.apply(this,arguments)};e.mix(i,{NAME:"cache",ATTRS:{max:{value:0,setter:"_setMax"},size:{readOnly:!0,getter:"_getSize"},uniqueKeys:{value:!1},expires:{value:0,validator:function(t){return e.Lang.isDate(t)||e.Lang.isNumber(t)&&t>=0}},entries:{readOnly:!0,getter:"_getEntries"}}}),e.extend(i,e.Base,{_entries:null,initializer:function(e){this.publish("add",{defaultFn:this._defAddFn}),this.publish("flush",{defaultFn:this._defFlushFn}),this._entries=[]},destructor:function(){this._entries=[]},_setMax:function(e){var t=this._entries;if(e>0){if(t)while(t.length>e)t.shift()}else e=0,this._entries=[];return e},_getSize:function(){return this._entries.length},_getEntries:function(){return this._entries},_defAddFn:function(e){var t=this._entries,r=e.entry,i=this.get("max"),s;this.get("uniqueKeys")&&(s=this._position(e.entry.request),n.isValue(s)&&t.splice(s,1));while(i&&t.length>=i)t.shift();t[t.length]=r},_defFlushFn:function(e){var t=this._entries,r=e.details[0],i;r&&n.isValue(r.request)?(i=this._position(r.request),n.isValue(i)&&t.splice(i,1)):this._entries=[]},_isMatch:function(e,t){return!t.expires||new Date<t.expires?e===t.request:!1},_position:function(e){var t=this._entries,n=t.length,r=n-1;if(this.get("max")===null||this.get("max")>0)for(;r>=0;r--)if(this._isMatch(e,t[r]))return r;return null},add:function(e,t){var i=this.get("expires");this.get("initialized")&&(this.get("max")===null||this.get("max")>0)&&(n.isValue(e)||n.isNull(e)||n.isUndefined(e))&&this.fire("add",{entry:{request:e,response:t,cached:new Date,expires:r(i)?i:i?new Date((new Date).getTime()+this.get("expires")):null}})},flush:function(e){this.fire("flush",{request:n.isValue(e)?e:null})},retrieve:function(e){var t=this._entries,r=t.length,i=null,s;if(r>0&&(this.get("max")===null||this.get("max")>0)){this.fire("request",{request:e}),s=this._position(e);if(n.isValue(s))return i=t[s],this.fire("retrieve",{entry:i}),s<r-1&&(t.splice(s,1),t[t.length]=i),i}return null}}),e.Cache=i},"3.7.2",{requires:["base"]});+YUI.add("cache-base",function(e,t){var n=e.Lang,r=e.Lang.isDate,i=function(){i.superclass.constructor.apply(this,arguments)};e.mix(i,{NAME:"cache",ATTRS:{max:{value:0,setter:"_setMax"},size:{readOnly:!0,getter:"_getSize"},uniqueKeys:{value:!1},expires:{value:0,validator:function(t){return e.Lang.isDate(t)||e.Lang.isNumber(t)&&t>=0}},entries:{readOnly:!0,getter:"_getEntries"}}}),e.extend(i,e.Base,{_entries:null,initializer:function(e){this.publish("add",{defaultFn:this._defAddFn}),this.publish("flush",{defaultFn:this._defFlushFn}),this._entries=[]},destructor:function(){this._entries=[]},_setMax:function(e){var t=this._entries;if(e>0){if(t)while(t.length>e)t.shift()}else e=0,this._entries=[];return e},_getSize:function(){return this._entries.length},_getEntries:function(){return this._entries},_defAddFn:function(e){var t=this._entries,r=e.entry,i=this.get("max"),s;this.get("uniqueKeys")&&(s=this._position(e.entry.request),n.isValue(s)&&t.splice(s,1));while(i&&t.length>=i)t.shift();t[t.length]=r},_defFlushFn:function(e){var t=this._entries,r=e.details[0],i;r&&n.isValue(r.request)?(i=this._position(r.request),n.isValue(i)&&t.splice(i,1)):this._entries=[]},_isMatch:function(e,t){return!t.expires||new Date<t.expires?e===t.request:!1},_position:function(e){var t=this._entries,n=t.length,r=n-1;if(this.get("max")===null||this.get("max")>0)for(;r>=0;r--)if(this._isMatch(e,t[r]))return r;return null},add:function(e,t){var i=this.get("expires");this.get("initialized")&&(this.get("max")===null||this.get("max")>0)&&(n.isValue(e)||n.isNull(e)||n.isUndefined(e))&&this.fire("add",{entry:{request:e,response:t,cached:new Date,expires:r(i)?i:i?new Date((new Date).getTime()+this.get("expires")):null}})},flush:function(e){this.fire("flush",{request:n.isValue(e)?e:null})},retrieve:function(e){var t=this._entries,r=t.length,i=null,s;if(r>0&&(this.get("max")===null||this.get("max")>0)){this.fire("request",{request:e}),s=this._position(e);if(n.isValue(s))return i=t[s],this.fire("retrieve",{entry:i}),s<r-1&&(t.splice(s,1),t[t.length]=i),i}return null}}),e.Cache=i},"3.7.3",{requires:["base"]});
bundle/cache-base/cache-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -435,4 +435,4 @@ Y.Cache = Cache; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/cache-offline/cache-offline-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/cache-offline/cache-offline.js", code: [] };-_yuitest_coverage["build/cache-offline/cache-offline.js"].code=["YUI.add('cache-offline', function (Y, NAME) {","","/**"," * Provides a Cache subclass which uses HTML5 `localStorage` for persistence."," * "," * @module cache"," * @submodule cache-offline"," */","","/**"," * Extends Cache utility with offline functionality."," * @class CacheOffline"," * @extends Cache"," * @constructor"," */","function CacheOffline() {"," CacheOffline.superclass.constructor.apply(this, arguments);","}","","var localStorage = null,"," JSON = Y.JSON;","","// Bug 2529572","try {"," localStorage = Y.config.win.localStorage;","}","catch(e) {","}","","/////////////////////////////////////////////////////////////////////////////","//","// CacheOffline events","//","/////////////////////////////////////////////////////////////////////////////","","/**","* @event error","* @description Fired when an entry could not be added, most likely due to","* exceeded browser quota.","* <dl>","* <dt>error (Object)</dt> <dd>The error object.</dd>","* </dl>","*/","","/////////////////////////////////////////////////////////////////////////////","//","// CacheOffline static","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(CacheOffline, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"cacheOffline\""," */"," NAME: \"cacheOffline\",",""," ATTRS: {"," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @attribute sandbox"," * @description A string that must be passed in via the constructor."," * This identifier is used to sandbox one cache instance's entries"," * from another. Calling the cache instance's flush and length methods"," * or get(\"entries\") will apply to only these sandboxed entries."," * @type String"," * @default \"default\""," * @initOnly"," */"," sandbox: {"," value: \"default\","," writeOnce: \"initOnly\""," },",""," /**"," * @attribute expires"," * @description Absolute Date when data expires or"," * relative number of milliseconds. Zero disables expiration."," * @type Date | Number"," * @default 86400000 (one day)"," */"," expires: {"," value: 86400000"," },",""," /**"," * @attribute max"," * @description Disabled."," * @readOnly"," * @default null"," */"," max: {"," value: null,"," readOnly: true"," },",""," /**"," * @attribute uniqueKeys"," * @description Always true for CacheOffline."," * @readOnly"," * @default true"," */"," uniqueKeys: {"," value: true,"," readOnly: true,"," setter: function() {"," return true;"," }"," }"," },",""," /**"," * Removes all items from all sandboxes. Useful if localStorage has"," * exceeded quota. Only supported on browsers that implement HTML 5"," * localStorage."," *"," * @method flushAll"," * @static"," */"," flushAll: function() {"," var store = localStorage, key;"," if(store) {"," if(store.clear) {"," store.clear();"," }"," // FF2.x and FF3.0.x"," else {"," for (key in store) {"," if (store.hasOwnProperty(key)) {"," store.removeItem(key);"," delete store[key];"," }"," }"," }"," }"," else {"," }"," }","});","","Y.extend(CacheOffline, Y.Cache, localStorage ? {","/////////////////////////////////////////////////////////////////////////////","//","// Offline is supported","//","/////////////////////////////////////////////////////////////////////////////",""," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline protected methods"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Always return null."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," return null;"," },",""," /**"," * Gets size."," *"," * @method _getSize"," * @protected"," */"," _getSize: function() {"," var count = 0,"," i=0,"," l=localStorage.length;"," for(; i<l; ++i) {"," // Match sandbox id"," if(localStorage.key(i).indexOf(this.get(\"sandbox\")) === 0) {"," count++;"," }"," }"," return count;"," },",""," /**"," * Gets all entries."," *"," * @method _getEntries"," * @protected"," */"," _getEntries: function() {"," var entries = [],"," i=0,"," l=localStorage.length,"," sandbox = this.get(\"sandbox\");"," for(; i<l; ++i) {"," // Match sandbox id"," if(localStorage.key(i).indexOf(sandbox) === 0) {"," entries[i] = JSON.parse(localStorage.key(i).substring(sandbox.length));"," }"," }"," return entries;"," },",""," /**"," * Adds entry to cache."," *"," * @method _defAddFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @protected"," */"," _defAddFn: function(e) {"," var entry = e.entry,"," request = entry.request,"," cached = entry.cached,"," expires = entry.expires;",""," // Convert Dates to msecs on the way into localStorage"," entry.cached = cached.getTime();"," entry.expires = expires ? expires.getTime() : expires;",""," try {"," localStorage.setItem(this.get(\"sandbox\")+JSON.stringify({\"request\":request}), JSON.stringify(entry));"," }"," catch(error) {"," this.fire(\"error\", {error:error});"," }"," },",""," /**"," * Flushes cache."," *"," * @method _defFlushFn"," * @param e {Event.Facade} Event Facade object."," * @protected"," */"," _defFlushFn: function(e) {"," var key,"," i=localStorage.length-1;"," for(; i>-1; --i) {"," // Match sandbox id"," key = localStorage.key(i);"," if(key.indexOf(this.get(\"sandbox\")) === 0) {"," localStorage.removeItem(key);"," }"," }"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline public methods"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Adds a new entry to the cache of the format"," * {request:request, response:response, cached:cached, expires: expires}."," *"," * @method add"," * @param request {Object} Request value must be a String or JSON."," * @param response {Object} Response value must be a String or JSON."," */",""," /**"," * Retrieves cached object for given request, if available."," * Returns null if there is no cache match."," *"," * @method retrieve"," * @param request {Object} Request object."," * @return {Object} Cached object with the properties request, response,"," * and expires, or null."," */"," retrieve: function(request) {"," this.fire(\"request\", {request: request});",""," var entry, expires, sandboxedrequest;",""," try {"," sandboxedrequest = this.get(\"sandbox\")+JSON.stringify({\"request\":request});"," try {"," entry = JSON.parse(localStorage.getItem(sandboxedrequest));"," }"," catch(e) {"," }"," }"," catch(e2) {"," }",""," if(entry) {"," // Convert msecs to Dates on the way out of localStorage"," entry.cached = new Date(entry.cached);"," expires = entry.expires;"," expires = !expires ? null : new Date(expires);"," entry.expires = expires;",""," if(this._isMatch(request, entry)) {"," this.fire(\"retrieve\", {entry: entry});"," return entry;"," }"," }"," return null;"," }","} :","/////////////////////////////////////////////////////////////////////////////","//","// Offline is not supported","//","/////////////////////////////////////////////////////////////////////////////","{"," /**"," * Always return null."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," return null;"," }","});","","","Y.CacheOffline = CacheOffline;","","","}, '3.7.2', {\"requires\": [\"cache-base\", \"json\"]});"];+_yuitest_coverage["build/cache-offline/cache-offline.js"].code=["YUI.add('cache-offline', function (Y, NAME) {","","/**"," * Provides a Cache subclass which uses HTML5 `localStorage` for persistence."," * "," * @module cache"," * @submodule cache-offline"," */","","/**"," * Extends Cache utility with offline functionality."," * @class CacheOffline"," * @extends Cache"," * @constructor"," */","function CacheOffline() {"," CacheOffline.superclass.constructor.apply(this, arguments);","}","","var localStorage = null,"," JSON = Y.JSON;","","// Bug 2529572","try {"," localStorage = Y.config.win.localStorage;","}","catch(e) {","}","","/////////////////////////////////////////////////////////////////////////////","//","// CacheOffline events","//","/////////////////////////////////////////////////////////////////////////////","","/**","* @event error","* @description Fired when an entry could not be added, most likely due to","* exceeded browser quota.","* <dl>","* <dt>error (Object)</dt> <dd>The error object.</dd>","* </dl>","*/","","/////////////////////////////////////////////////////////////////////////////","//","// CacheOffline static","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(CacheOffline, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"cacheOffline\""," */"," NAME: \"cacheOffline\",",""," ATTRS: {"," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," /**"," * @attribute sandbox"," * @description A string that must be passed in via the constructor."," * This identifier is used to sandbox one cache instance's entries"," * from another. Calling the cache instance's flush and length methods"," * or get(\"entries\") will apply to only these sandboxed entries."," * @type String"," * @default \"default\""," * @initOnly"," */"," sandbox: {"," value: \"default\","," writeOnce: \"initOnly\""," },",""," /**"," * @attribute expires"," * @description Absolute Date when data expires or"," * relative number of milliseconds. Zero disables expiration."," * @type Date | Number"," * @default 86400000 (one day)"," */"," expires: {"," value: 86400000"," },",""," /**"," * @attribute max"," * @description Disabled."," * @readOnly"," * @default null"," */"," max: {"," value: null,"," readOnly: true"," },",""," /**"," * @attribute uniqueKeys"," * @description Always true for CacheOffline."," * @readOnly"," * @default true"," */"," uniqueKeys: {"," value: true,"," readOnly: true,"," setter: function() {"," return true;"," }"," }"," },",""," /**"," * Removes all items from all sandboxes. Useful if localStorage has"," * exceeded quota. Only supported on browsers that implement HTML 5"," * localStorage."," *"," * @method flushAll"," * @static"," */"," flushAll: function() {"," var store = localStorage, key;"," if(store) {"," if(store.clear) {"," store.clear();"," }"," // FF2.x and FF3.0.x"," else {"," for (key in store) {"," if (store.hasOwnProperty(key)) {"," store.removeItem(key);"," delete store[key];"," }"," }"," }"," }"," else {"," }"," }","});","","Y.extend(CacheOffline, Y.Cache, localStorage ? {","/////////////////////////////////////////////////////////////////////////////","//","// Offline is supported","//","/////////////////////////////////////////////////////////////////////////////",""," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline protected methods"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Always return null."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," return null;"," },",""," /**"," * Gets size."," *"," * @method _getSize"," * @protected"," */"," _getSize: function() {"," var count = 0,"," i=0,"," l=localStorage.length;"," for(; i<l; ++i) {"," // Match sandbox id"," if(localStorage.key(i).indexOf(this.get(\"sandbox\")) === 0) {"," count++;"," }"," }"," return count;"," },",""," /**"," * Gets all entries."," *"," * @method _getEntries"," * @protected"," */"," _getEntries: function() {"," var entries = [],"," i=0,"," l=localStorage.length,"," sandbox = this.get(\"sandbox\");"," for(; i<l; ++i) {"," // Match sandbox id"," if(localStorage.key(i).indexOf(sandbox) === 0) {"," entries[i] = JSON.parse(localStorage.key(i).substring(sandbox.length));"," }"," }"," return entries;"," },",""," /**"," * Adds entry to cache."," *"," * @method _defAddFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>entry (Object)</dt> <dd>The cached entry.</dd>"," * </dl>"," * @protected"," */"," _defAddFn: function(e) {"," var entry = e.entry,"," request = entry.request,"," cached = entry.cached,"," expires = entry.expires;",""," // Convert Dates to msecs on the way into localStorage"," entry.cached = cached.getTime();"," entry.expires = expires ? expires.getTime() : expires;",""," try {"," localStorage.setItem(this.get(\"sandbox\")+JSON.stringify({\"request\":request}), JSON.stringify(entry));"," }"," catch(error) {"," this.fire(\"error\", {error:error});"," }"," },",""," /**"," * Flushes cache."," *"," * @method _defFlushFn"," * @param e {Event.Facade} Event Facade object."," * @protected"," */"," _defFlushFn: function(e) {"," var key,"," i=localStorage.length-1;"," for(; i>-1; --i) {"," // Match sandbox id"," key = localStorage.key(i);"," if(key.indexOf(this.get(\"sandbox\")) === 0) {"," localStorage.removeItem(key);"," }"," }"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // CacheOffline public methods"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Adds a new entry to the cache of the format"," * {request:request, response:response, cached:cached, expires: expires}."," *"," * @method add"," * @param request {Object} Request value must be a String or JSON."," * @param response {Object} Response value must be a String or JSON."," */",""," /**"," * Retrieves cached object for given request, if available."," * Returns null if there is no cache match."," *"," * @method retrieve"," * @param request {Object} Request object."," * @return {Object} Cached object with the properties request, response,"," * and expires, or null."," */"," retrieve: function(request) {"," this.fire(\"request\", {request: request});",""," var entry, expires, sandboxedrequest;",""," try {"," sandboxedrequest = this.get(\"sandbox\")+JSON.stringify({\"request\":request});"," try {"," entry = JSON.parse(localStorage.getItem(sandboxedrequest));"," }"," catch(e) {"," }"," }"," catch(e2) {"," }",""," if(entry) {"," // Convert msecs to Dates on the way out of localStorage"," entry.cached = new Date(entry.cached);"," expires = entry.expires;"," expires = !expires ? null : new Date(expires);"," entry.expires = expires;",""," if(this._isMatch(request, entry)) {"," this.fire(\"retrieve\", {entry: entry});"," return entry;"," }"," }"," return null;"," }","} :","/////////////////////////////////////////////////////////////////////////////","//","// Offline is not supported","//","/////////////////////////////////////////////////////////////////////////////","{"," /**"," * Always return null."," *"," * @method _setMax"," * @protected"," */"," _setMax: function(value) {"," return null;"," }","});","","","Y.CacheOffline = CacheOffline;","","","}, '3.7.3', {\"requires\": [\"cache-base\", \"json\"]});"]; _yuitest_coverage["build/cache-offline/cache-offline.js"].lines = {"1":0,"16":0,"17":0,"20":0,"24":0,"25":0,"50":0,"116":0,"130":0,"131":0,"132":0,"133":0,"137":0,"138":0,"139":0,"140":0,"150":0,"169":0,"179":0,"182":0,"184":0,"185":0,"188":0,"198":0,"202":0,"204":0,"205":0,"208":0,"222":0,"228":0,"229":0,"231":0,"232":0,"235":0,"247":0,"249":0,"251":0,"252":0,"253":0,"282":0,"284":0,"286":0,"287":0,"288":0,"289":0,"297":0,"299":0,"300":0,"301":0,"302":0,"304":0,"305":0,"306":0,"309":0,"325":0,"330":0}; _yuitest_coverage["build/cache-offline/cache-offline.js"].functions = {"CacheOffline:16":0,"setter:115":0,"flushAll:129":0,"_setMax:168":0,"_getSize:178":0,"_getEntries:197":0,"_defAddFn:221":0,"_defFlushFn:246":0,"retrieve:281":0,"_setMax:324":0,"(anonymous 1):1":0}; _yuitest_coverage["build/cache-offline/cache-offline.js"].coveredLines = 56;@@ -436,4 +436,4 @@ Y.CacheOffline = CacheOffline; -}, '3.7.2', {"requires": ["cache-base", "json"]});+}, '3.7.3', {"requires": ["cache-base", "json"]});
bundle/cache-offline/cache-offline-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -344,4 +344,4 @@ Y.CacheOffline = CacheOffline; -}, '3.7.2', {"requires": ["cache-base", "json"]});+}, '3.7.3', {"requires": ["cache-base", "json"]});
bundle/cache-offline/cache-offline-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cache-offline",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}var r=null,i=e.JSON;try{r=e.config.win.localStorage}catch(s){}e.mix(n,{NAME:"cacheOffline",ATTRS:{sandbox:{value:"default",writeOnce:"initOnly"},expires:{value:864e5},max:{value:null,readOnly:!0},uniqueKeys:{value:!0,readOnly:!0,setter:function(){return!0}}},flushAll:function(){var e=r,t;if(e)if(e.clear)e.clear();else for(t in e)e.hasOwnProperty(t)&&(e.removeItem(t),delete e[t])}}),e.extend(n,e.Cache,r?{_setMax:function(e){return null},_getSize:function(){var e=0,t=0,n=r.length;for(;t<n;++t)r.key(t).indexOf(this.get("sandbox"))===0&&e++;return e},_getEntries:function(){var e=[],t=0,n=r.length,s=this.get("sandbox");for(;t<n;++t)r.key(t).indexOf(s)===0&&(e[t]=i.parse(r.key(t).substring(s.length)));return e},_defAddFn:function(e){var t=e.entry,n=t.request,s=t.cached,o=t.expires;t.cached=s.getTime(),t.expires=o?o.getTime():o;try{r.setItem(this.get("sandbox")+i.stringify({request:n}),i.stringify(t))}catch(u){this.fire("error",{error:u})}},_defFlushFn:function(e){var t,n=r.length-1;for(;n>-1;--n)t=r.key(n),t.indexOf(this.get("sandbox"))===0&&r.removeItem(t)},retrieve:function(e){this.fire("request",{request:e});var t,n,s;try{s=this.get("sandbox")+i.stringify({request:e});try{t=i.parse(r.getItem(s))}catch(o){}}catch(u){}if(t){t.cached=new Date(t.cached),n=t.expires,n=n?new Date(n):null,t.expires=n;if(this._isMatch(e,t))return this.fire("retrieve",{entry:t}),t}return null}}:{_setMax:function(e){return null}}),e.CacheOffline=n},"3.7.2",{requires:["cache-base","json"]});+YUI.add("cache-offline",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}var r=null,i=e.JSON;try{r=e.config.win.localStorage}catch(s){}e.mix(n,{NAME:"cacheOffline",ATTRS:{sandbox:{value:"default",writeOnce:"initOnly"},expires:{value:864e5},max:{value:null,readOnly:!0},uniqueKeys:{value:!0,readOnly:!0,setter:function(){return!0}}},flushAll:function(){var e=r,t;if(e)if(e.clear)e.clear();else for(t in e)e.hasOwnProperty(t)&&(e.removeItem(t),delete e[t])}}),e.extend(n,e.Cache,r?{_setMax:function(e){return null},_getSize:function(){var e=0,t=0,n=r.length;for(;t<n;++t)r.key(t).indexOf(this.get("sandbox"))===0&&e++;return e},_getEntries:function(){var e=[],t=0,n=r.length,s=this.get("sandbox");for(;t<n;++t)r.key(t).indexOf(s)===0&&(e[t]=i.parse(r.key(t).substring(s.length)));return e},_defAddFn:function(e){var t=e.entry,n=t.request,s=t.cached,o=t.expires;t.cached=s.getTime(),t.expires=o?o.getTime():o;try{r.setItem(this.get("sandbox")+i.stringify({request:n}),i.stringify(t))}catch(u){this.fire("error",{error:u})}},_defFlushFn:function(e){var t,n=r.length-1;for(;n>-1;--n)t=r.key(n),t.indexOf(this.get("sandbox"))===0&&r.removeItem(t)},retrieve:function(e){this.fire("request",{request:e});var t,n,s;try{s=this.get("sandbox")+i.stringify({request:e});try{t=i.parse(r.getItem(s))}catch(o){}}catch(u){}if(t){t.cached=new Date(t.cached),n=t.expires,n=n?new Date(n):null,t.expires=n;if(this._isMatch(e,t))return this.fire("retrieve",{entry:t}),t}return null}}:{_setMax:function(e){return null}}),e.CacheOffline=n},"3.7.3",{requires:["cache-base","json"]});
bundle/cache-offline/cache-offline.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -336,4 +336,4 @@ Y.CacheOffline = CacheOffline; -}, '3.7.2', {"requires": ["cache-base", "json"]});+}, '3.7.3', {"requires": ["cache-base", "json"]});
bundle/cache-plugin/cache-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/cache-plugin/cache-plugin.js", code: [] };-_yuitest_coverage["build/cache-plugin/cache-plugin.js"].code=["YUI.add('cache-plugin', function (Y, NAME) {","","/**"," * Provides support to use Cache as a Plugin to a Base-based class."," *"," * @module cache"," * @submodule cache-plugin"," */","","/**"," * Plugin.Cache adds pluginizability to Cache."," * @class Plugin.Cache"," * @extends Cache"," * @uses Plugin.Base"," */","function CachePlugin(config) {"," var cache = config && config.cache ? config.cache : Y.Cache,"," tmpclass = Y.Base.create(\"dataSourceCache\", cache, [Y.Plugin.Base]),"," tmpinstance = new tmpclass(config);"," tmpclass.NS = \"tmpClass\";"," return tmpinstance;","}","","Y.mix(CachePlugin, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCache\""," */"," NAME: \"cachePlugin\"","});","","","Y.namespace(\"Plugin\").Cache = CachePlugin;","","","}, '3.7.2', {\"requires\": [\"plugin\", \"cache-base\"]});"];+_yuitest_coverage["build/cache-plugin/cache-plugin.js"].code=["YUI.add('cache-plugin', function (Y, NAME) {","","/**"," * Provides support to use Cache as a Plugin to a Base-based class."," *"," * @module cache"," * @submodule cache-plugin"," */","","/**"," * Plugin.Cache adds pluginizability to Cache."," * @class Plugin.Cache"," * @extends Cache"," * @uses Plugin.Base"," */","function CachePlugin(config) {"," var cache = config && config.cache ? config.cache : Y.Cache,"," tmpclass = Y.Base.create(\"dataSourceCache\", cache, [Y.Plugin.Base]),"," tmpinstance = new tmpclass(config);"," tmpclass.NS = \"tmpClass\";"," return tmpinstance;","}","","Y.mix(CachePlugin, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCache\""," */"," NAME: \"cachePlugin\"","});","","","Y.namespace(\"Plugin\").Cache = CachePlugin;","","","}, '3.7.3', {\"requires\": [\"plugin\", \"cache-base\"]});"]; _yuitest_coverage["build/cache-plugin/cache-plugin.js"].lines = {"1":0,"16":0,"17":0,"20":0,"21":0,"24":0,"50":0}; _yuitest_coverage["build/cache-plugin/cache-plugin.js"].functions = {"CachePlugin:16":0,"(anonymous 1):1":0}; _yuitest_coverage["build/cache-plugin/cache-plugin.js"].coveredLines = 7;@@ -98,4 +98,4 @@ Y.namespace("Plugin").Cache = CachePlugin; -}, '3.7.2', {"requires": ["plugin", "cache-base"]});+}, '3.7.3', {"requires": ["plugin", "cache-base"]});
bundle/cache-plugin/cache-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ Y.namespace("Plugin").Cache = CachePlugin; -}, '3.7.2', {"requires": ["plugin", "cache-base"]});+}, '3.7.3', {"requires": ["plugin", "cache-base"]});
bundle/cache-plugin/cache-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cache-plugin",function(e,t){function n(t){var n=t&&t.cache?t.cache:e.Cache,r=e.Base.create("dataSourceCache",n,[e.Plugin.Base]),i=new r(t);return r.NS="tmpClass",i}e.mix(n,{NS:"cache",NAME:"cachePlugin"}),e.namespace("Plugin").Cache=n},"3.7.2",{requires:["plugin","cache-base"]});+YUI.add("cache-plugin",function(e,t){function n(t){var n=t&&t.cache?t.cache:e.Cache,r=e.Base.create("dataSourceCache",n,[e.Plugin.Base]),i=new r(t);return r.NS="tmpClass",i}e.mix(n,{NS:"cache",NAME:"cachePlugin"}),e.namespace("Plugin").Cache=n},"3.7.3",{requires:["plugin","cache-base"]});
bundle/cache-plugin/cache-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ Y.namespace("Plugin").Cache = CachePlugin; -}, '3.7.2', {"requires": ["plugin", "cache-base"]});+}, '3.7.3', {"requires": ["plugin", "cache-base"]});
bundle/calendar-base/assets/calendar-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar-base/assets/skins/night/calendar-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar-base/assets/skins/night/calendar-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar-base/assets/skins/sam/calendar-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar-base/assets/skins/sam/calendar-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar-base/calendar-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/calendar-base/calendar-base.js", code: [] };-_yuitest_coverage["build/calendar-base/calendar-base.js"].code=["YUI.add('calendar-base', function (Y, NAME) {","","/**"," * The CalendarBase submodule is a basic UI calendar view that displays"," * a range of dates in a two-dimensional month grid, with one or more"," * months visible at a single time. CalendarBase supports custom date"," * rendering, multiple calendar panes, and selection. "," * @module calendar"," * @submodule calendar-base"," */"," ","var getCN = Y.ClassNameManager.getClassName,"," CALENDAR = 'calendar',"," CAL_GRID = getCN(CALENDAR, 'grid'),"," CAL_LEFT_GRID = getCN(CALENDAR, 'left-grid'),"," CAL_RIGHT_GRID = getCN(CALENDAR, 'right-grid'),"," CAL_BODY = getCN(CALENDAR, 'body'),"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_HD_LABEL = getCN(CALENDAR, 'header-label'),"," CAL_WDAYROW = getCN(CALENDAR, 'weekdayrow'),"," CAL_WDAY = getCN(CALENDAR, 'weekday'),"," CAL_COL_HIDDEN = getCN(CALENDAR, 'column-hidden'),"," CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),"," SELECTION_DISABLED = getCN(CALENDAR, 'selection-disabled'),"," CAL_ROW = getCN(CALENDAR, 'row'),"," CAL_DAY = getCN(CALENDAR, 'day'),"," CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),"," CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),"," CAL_ANCHOR = getCN(CALENDAR, 'anchor'),"," CAL_PANE = getCN(CALENDAR, 'pane'),"," CAL_STATUS = getCN(CALENDAR, 'status'),"," L = Y.Lang,"," node = Y.Node,"," create = node.create,"," substitute = Y.substitute,"," each = Y.each,"," hasVal = Y.Array.hasValue,"," iOf = Y.Array.indexOf,"," hasKey = Y.Object.hasKey,"," setVal = Y.Object.setValue,"," owns = Y.Object.owns,"," isEmpty = Y.Object.isEmpty,"," ydate = Y.DataType.Date;","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class CalendarBase"," * @extends Widget"," * @param config {Object} Configuration object (see Configuration "," * attributes)"," * @constructor"," */","function CalendarBase(config) {"," CalendarBase.superclass.constructor.apply ( this, arguments );","}","","","","Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {",""," /**"," * A storage for various properties of individual month"," * panes."," *"," * @property _paneProperties"," * @type Object"," * @private"," */"," _paneProperties : {},",""," /**"," * The number of month panes in the calendar, deduced"," * from the CONTENT_TEMPLATE's number of {calendar_grid}"," * tokens."," *"," * @property _paneNumber"," * @type Number"," * @private"," */"," _paneNumber : 1,",""," /**"," * The unique id used to prefix various elements of this"," * calendar instance."," *"," * @property _calendarId"," * @type String"," * @private"," */"," _calendarId : null,",""," /**"," * The hash map of selected dates, populated with"," * selectDates() and deselectDates() methods "," *"," * @property _selectedDates"," * @type Object"," * @private"," */"," _selectedDates : {},",""," /**"," * A private copy of the rules object, populated"," * by setting the customRenderer attribute."," *"," * @property _rules"," * @type Object"," * @private"," */"," _rules : {},",""," /**"," * A private copy of the filterFunction, populated"," * by setting the customRenderer attribute."," *"," * @property _filterFunction"," * @type Function"," * @private"," */"," _filterFunction : null,",""," /**"," * Storage for calendar cells modified by any custom"," * formatting. The storage is cleared, used to restore"," * cells to the original state, and repopulated accordingly"," * when the calendar is rerendered. "," *"," * @property _storedDateCells"," * @type Object"," * @private"," */"," _storedDateCells : {},",""," /**"," * Designated initializer"," * Initializes instance-level properties of"," * calendar."," *"," * @method initializer"," */ "," initializer : function () {"," this._paneProperties = {};"," this._calendarId = Y.guid('calendar');"," this._selectedDates = {};"," if (isEmpty(this._rules)) {"," this._rules = {}; "," }"," this._storedDateCells = {};"," },",""," /**"," * renderUI implementation"," *"," * Creates a visual representation of the calendar based on existing parameters. "," * @method renderUI"," */ "," renderUI : function () {",""," var contentBox = this.get('contentBox');"," contentBox.appendChild(this._initCalendarHTML(this.get('date')));"," if (this.get('showPrevMonth')) {"," this._afterShowPrevMonthChange();"," }"," if (this.get('showNextMonth')) {"," this._afterShowNextMonthChange();"," }"," this._renderCustomRules();"," this._renderSelectedDates();",""," this.get(\"boundingBox\").setAttribute(\"aria-labelledby\", this._calendarId + \"_header\");",""," },"," /**"," * bindUI implementation"," *"," * Assigns listeners to relevant events that change the state"," * of the calendar."," * @method bindUI"," */ "," bindUI : function () {"," this.after('dateChange', this._afterDateChange);"," this.after('showPrevMonthChange', this._afterShowPrevMonthChange);"," this.after('showNextMonthChange', this._afterShowNextMonthChange);"," this.after('headerRendererChange', this._afterHeaderRendererChange);"," this.after('customRendererChange', this._afterCustomRendererChange);"," this.after('enabledDatesRuleChange', this._afterCustomRendererChange);"," this.after('disabledDatesRuleChange', this._afterCustomRendererChange);"," this.after('focusedChange', this._afterFocusedChange);"," this.after('selectionChange', this._renderSelectedDates);"," this._bindCalendarEvents();"," },","",""," /**"," * An internal utility method that generates a list of selected dates "," * from the hash storage."," *"," * @method _getSelectedDatesList"," * @protected"," * @return {Array} The array of `Date`s that are currently selected."," */"," _getSelectedDatesList : function () {"," var output = [];"," each (this._selectedDates, function (year) {"," each (year, function (month) {"," each (month, function (day) {"," output.push (day);"," }, this);"," }, this);"," }, this);"," return output;"," },",""," /**"," * A utility method that returns all dates selected in a specific month."," *"," * @method _getSelectedDatesInMonth"," * @param {Date} oDate corresponding to the month for which selected dates"," * are requested."," * @protected"," * @return {Array} The array of `Date`s in a given month that are currently selected."," */"," _getSelectedDatesInMonth : function (oDate) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth();"," "," if (hasKey(this._selectedDates, year) && hasKey(this._selectedDates[year], month)) {"," return Y.Object.values(this._selectedDates[year][month]); "," }"," else {"," return [];"," }"," },","",""," /**"," * An internal parsing method that receives a String list of numbers"," * and number ranges (of the form \"1,2,3,4-6,7-9,10,11\" etc.) and checks"," * whether a specific number is included in this list. Used for looking"," * up dates in the customRenderer rule set."," *"," * @method _isNumInList"," * @param {Number} num The number to look for in a list."," * @param {String} strList The list of numbers of the form \"1,2,3,4-6,7-8,9\", etc."," * @private"," * @return {boolean} Returns true if the given number is in the given list."," */"," _isNumInList : function (num, strList) {"," if (strList == \"all\") {"," return true;"," }"," else {"," var elements = strList.split(\",\"),"," i = elements.length;",""," while (i--) {"," var range = elements[i].split(\"-\");"," if (range.length == 2 && num >= parseInt(range[0], 10) && num <= parseInt(range[1], 10)) {"," return true;"," }"," else if (range.length == 1 && (parseInt(elements[i], 10) == num)) {"," return true;"," }"," }"," return false; "," }"," },",""," /**"," * Given a specific date, returns an array of rules (from the customRenderer rule set)"," * that the given date matches."," *"," * @method _getRulesForDate"," * @param {Date} oDate The date for which an array of rules is needed"," * @private"," * @return {Array} Returns an array of `String`s, each containg the name of"," * a rule that the given date matches."," */"," _getRulesForDate : function (oDate) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," date = oDate.getDate(),"," wday = oDate.getDay(),"," rules = this._rules, "," outputRules = [],"," years, months, dates, days;",""," for (years in rules) {"," if (this._isNumInList(year, years)) {"," if (L.isString(rules[years])) {"," outputRules.push(rules[years]);"," }"," else {"," for (months in rules[years]) {"," if (this._isNumInList(month, months)) {"," if (L.isString(rules[years][months])) {"," outputRules.push(rules[years][months]);"," }"," else {"," for (dates in rules[years][months]) {"," if (this._isNumInList(date, dates)) {"," if (L.isString(rules[years][months][dates])) {"," outputRules.push(rules[years][months][dates]);"," }"," else {"," for (days in rules[years][months][dates]) {"," if (this._isNumInList(wday, days)) {"," if (L.isString(rules[years][months][dates][days])) {"," outputRules.push(rules[years][months][dates][days]);"," }"," }"," }"," }"," }"," }"," }"," }"," } "," }"," }"," }"," return outputRules;"," },",""," /**"," * A utility method which, given a specific date and a name of the rule,"," * checks whether the date matches the given rule."," *"," * @method _matchesRule"," * @param {Date} oDate The date to check"," * @param {String} rule The name of the rule that the date should match."," * @private"," * @return {boolean} Returns true if the date matches the given rule."," *"," */"," _matchesRule : function (oDate, rule) {"," return (iOf(this._getRulesForDate(oDate), rule) >= 0);"," },",""," /**"," * A utility method which checks whether a given date matches the `enabledDatesRule`"," * or does not match the `disabledDatesRule` and therefore whether it can be selected."," * @method _canBeSelected"," * @param {Date} oDate The date to check"," * @private"," * @return {boolean} Returns true if the date can be selected; false otherwise."," */"," _canBeSelected : function (oDate) {"," "," var enabledDatesRule = this.get(\"enabledDatesRule\"),"," disabledDatesRule = this.get(\"disabledDatesRule\");",""," if (enabledDatesRule) {"," return this._matchesRule(oDate, enabledDatesRule);"," }"," else if (disabledDatesRule) {"," return !this._matchesRule(oDate, disabledDatesRule);"," }"," else {"," return true;"," }"," },",""," /**"," * Selects a given date or array of dates."," * @method selectDates"," * @param {Date|Array} dates A `Date` or `Array` of `Date`s."," */"," selectDates : function (dates) {"," if (ydate.isValidDate(dates)) {"," this._addDateToSelection(dates);"," }"," else if (L.isArray(dates)) {"," this._addDatesToSelection(dates);"," }"," },",""," /**"," * Deselects a given date or array of dates, or deselects"," * all dates if no argument is specified."," * @method deselectDates"," * @param {Date|Array} [dates] A `Date` or `Array` of `Date`s, or no"," * argument if all dates should be deselected."," */"," deselectDates : function (dates) {"," if (!dates) {"," this._clearSelection();"," }"," else if (ydate.isValidDate(dates)) {"," this._removeDateFromSelection(dates);"," }"," else if (L.isArray(dates)) {"," this._removeDatesFromSelection(dates);"," }"," },",""," /**"," * A utility method that adds a given date to selection.."," * @method _addDateToSelection"," * @param {Date} oDate The date to add to selection."," * @param {Number} [index] An optional parameter that is used"," * to differentiate between individual date selections and multiple"," * date selections."," * @private"," */"," _addDateToSelection : function (oDate, index) {",""," if (this._canBeSelected(oDate)) {",""," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," day = oDate.getDate();"," "," if (hasKey(this._selectedDates, year)) {"," if (hasKey(this._selectedDates[year], month)) {"," this._selectedDates[year][month][day] = oDate;"," }"," else {"," this._selectedDates[year][month] = {};"," this._selectedDates[year][month][day] = oDate;"," }"," }"," else {"," this._selectedDates[year] = {};"," this._selectedDates[year][month] = {};"," this._selectedDates[year][month][day] = oDate;"," }",""," this._selectedDates = setVal(this._selectedDates, [year, month, day], oDate);",""," if (!index) {"," this._fireSelectionChange();"," }"," }"," },",""," /**"," * A utility method that adds a given list of dates to selection."," * @method _addDatesToSelection"," * @param {Array} datesArray The list of dates to add to selection."," * @private"," */"," _addDatesToSelection : function (datesArray) {"," each(datesArray, this._addDateToSelection, this);"," this._fireSelectionChange();"," },",""," /**"," * A utility method that adds a given range of dates to selection."," * @method _addDateRangeToSelection"," * @param {Date} startDate The first date of the given range."," * @param {Date} endDate The last date of the given range."," * @private"," */"," _addDateRangeToSelection : function (startDate, endDate) {",""," var timezoneDifference = (endDate.getTimezoneOffset() - startDate.getTimezoneOffset())*60000,"," startTime = startDate.getTime(),"," endTime = endDate.getTime();"," "," if (startTime > endTime) {"," var tempTime = startTime;"," startTime = endTime;"," endTime = tempTime + timezoneDifference;"," }"," else {"," endTime = endTime - timezoneDifference;"," }","",""," for (var time = startTime; time <= endTime; time += 86400000) {"," var addedDate = new Date(time);"," addedDate.setHours(12);"," this._addDateToSelection(addedDate, time);"," }"," this._fireSelectionChange();"," },",""," /**"," * A utility method that removes a given date from selection.."," * @method _removeDateFromSelection"," * @param {Date} oDate The date to remove from selection."," * @param {Number} [index] An optional parameter that is used"," * to differentiate between individual date selections and multiple"," * date selections."," * @private"," */"," _removeDateFromSelection : function (oDate, index) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," day = oDate.getDate();"," if (hasKey(this._selectedDates, year) && "," hasKey(this._selectedDates[year], month) && "," hasKey(this._selectedDates[year][month], day)) {"," delete this._selectedDates[year][month][day];"," if (!index) {"," this._fireSelectionChange();"," }"," }"," },",""," /**"," * A utility method that removes a given list of dates from selection."," * @method _removeDatesFromSelection"," * @param {Array} datesArray The list of dates to remove from selection."," * @private"," */"," _removeDatesFromSelection : function (datesArray) {"," each(datesArray, this._removeDateFromSelection, this);"," this._fireSelectionChange();"," },",""," /**"," * A utility method that removes a given range of dates from selection."," * @method _removeDateRangeFromSelection"," * @param {Date} startDate The first date of the given range."," * @param {Date} endDate The last date of the given range."," * @private"," */"," _removeDateRangeFromSelection : function (startDate, endDate) {"," var startTime = startDate.getTime(),"," endTime = endDate.getTime();"," "," for (var time = startTime; time <= endTime; time += 86400000) {"," this._removeDateFromSelection(new Date(time), time);"," }",""," this._fireSelectionChange(); "," },",""," /**"," * A utility method that removes all dates from selection."," * @method _clearSelection"," * @param {boolean} noevent A Boolean specifying whether a selectionChange"," * event should be fired. If true, the event is not fired."," * @private"," */"," _clearSelection : function (noevent) {"," this._selectedDates = {};"," this.get(\"contentBox\").all(\".\" + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", false);"," if (!noevent) {"," this._fireSelectionChange();"," }"," },",""," /**"," * A utility method that fires a selectionChange event."," * @method _fireSelectionChange"," * @private"," */"," _fireSelectionChange : function () {",""," /**"," * Fired when the set of selected dates changes. Contains a payload with"," * a `newSelection` property with an array of selected dates."," *"," * @event selectionChange"," */"," this.fire(\"selectionChange\", {newSelection: this._getSelectedDatesList()});"," },",""," /**"," * A utility method that restores cells modified by custom formatting."," * @method _restoreModifiedCells"," * @private"," */"," _restoreModifiedCells : function () {"," var contentbox = this.get(\"contentBox\"),"," id;"," for (id in this._storedDateCells) {"," contentbox.one(\"#\" + id).replace(this._storedDateCells[id]);"," delete this._storedDateCells[id];"," }"," },",""," /**"," * A rendering assist method that renders all cells modified by the customRenderer"," * rules, as well as the enabledDatesRule and disabledDatesRule."," * @method _renderCustomRules"," * @private"," */"," _renderCustomRules : function () {",""," this.get(\"contentBox\").all(\".\" + CAL_DAY + \",.\" + CAL_NEXTMONTH_DAY).removeClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", false);",""," if (!isEmpty(this._rules)) {"," var enRule = this.get(\"enabledDatesRule\"),"," disRule = this.get(\"disabledDatesRule\");",""," for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {"," var paneDate = ydate.addMonths(this.get(\"date\"), paneNum);"," var dateArray = ydate.listOfDatesInMonth(paneDate);"," each(dateArray, function (date) {"," var matchingRules = this._getRulesForDate(date);"," if (matchingRules.length > 0) {"," var dateNode = this._dateToNode(date);"," if ((enRule && iOf(matchingRules, enRule) < 0) || (!enRule && disRule && iOf(matchingRules, disRule) >= 0)) {"," dateNode.addClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", true);"," }"," "," if (L.isFunction(this._filterFunction)) {"," this._storedDateCells[dateNode.get(\"id\")] = dateNode.cloneNode(true);"," this._filterFunction (date, dateNode, matchingRules);"," }"," }"," else if (enRule) {"," var dateNode = this._dateToNode(date);"," dateNode.addClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", true);"," }"," },"," this);"," }"," } "," },",""," /**"," * A rendering assist method that renders all cells that are currently selected."," * @method _renderSelectedDates"," * @private"," */"," _renderSelectedDates : function () {"," this.get(\"contentBox\").all(\".\" + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", false);"," "," for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {"," var paneDate = ydate.addMonths(this.get(\"date\"), paneNum);"," var dateArray = this._getSelectedDatesInMonth(paneDate);"," each(dateArray, function (date) {"," this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", true);"," },"," this);"," }"," },",""," /**"," * A utility method that converts a date to the node wrapping the calendar cell"," * the date corresponds to.."," * @method _dateToNode"," * @param {Date} oDate The date to convert to Node"," * @protected"," * @return {Node} The node wrapping the DOM element of the cell the date "," * corresponds to."," */"," _dateToNode : function (oDate) {"," var day = oDate.getDate(),"," col = 0,"," daymod = day%7,"," paneNum = (12 + oDate.getMonth() - this.get(\"date\").getMonth()) % 12,"," paneId = this._calendarId + \"_pane_\" + paneNum,"," cutoffCol = this._paneProperties[paneId].cutoffCol;",""," switch (daymod) {"," case (0):"," if (cutoffCol >= 6) {"," col = 12;"," }"," else {"," col = 5;"," }"," break;"," case (1):"," col = 6;"," break;"," case (2):"," if (cutoffCol > 0) {"," col = 7;"," }"," else {"," col = 0;"," }"," break;"," case (3):"," if (cutoffCol > 1) {"," col = 8;"," }"," else {"," col = 1;"," }"," break;"," case (4):"," if (cutoffCol > 2) {"," col = 9;"," }"," else {"," col = 2;"," }"," break;"," case (5):"," if (cutoffCol > 3) {"," col = 10;"," }"," else {"," col = 3;"," }"," break;"," case (6):"," if (cutoffCol > 4) {"," col = 11;"," }"," else {"," col = 4;"," }"," break;"," }"," return(this.get(\"contentBox\").one(\"#\" + this._calendarId + \"_pane_\" + paneNum + \"_\" + col + \"_\" + day)); ",""," },",""," /**"," * A utility method that converts a node corresponding to the DOM element of"," * the cell for a particular date to that date."," * @method _nodeToDate"," * @param {Node} oNode The Node wrapping the DOM element of a particular date cell."," * @protected"," * @return {Date} The date corresponding to the DOM element that the given node wraps."," */"," _nodeToDate : function (oNode) {"," "," var idParts = oNode.get(\"id\").split(\"_\").reverse(),"," paneNum = parseInt(idParts[2], 10),"," day = parseInt(idParts[0], 10);",""," var shiftedDate = ydate.addMonths(this.get(\"date\"), paneNum),"," year = shiftedDate.getFullYear(),"," month = shiftedDate.getMonth();",""," return new Date(year, month, day, 12, 0, 0, 0);"," },",""," /**"," * A placeholder method, called from bindUI, to bind the Calendar events."," * @method _bindCalendarEvents"," * @protected"," */"," _bindCalendarEvents : function () {"," "," },",""," /**"," * A utility method that normalizes a given date by converting it to the 1st"," * day of the month the date is in, with the time set to noon."," * @method _normalizeDate"," * @param {Date} oDate The date to normalize"," * @protected"," * @return {Date} The normalized date, set to the first of the month, with time"," * set to noon."," */"," _normalizeDate : function (date) {"," if (date) {"," return new Date(date.getFullYear(), date.getMonth(), 1, 12, 0, 0, 0);"," }"," else {"," return null;"," } "," },","",""," /**"," * A render assist utility method that computes the cutoff column for the calendar "," * rendering mask."," * @method _getCutoffColumn"," * @param {Date} date The date of the month grid to compute the cutoff column for."," * @param {Number} firstday The first day of the week (modified by internationalized calendars)"," * @private"," * @return {Number} The number of the cutoff column."," */"," _getCutoffColumn : function (date, firstday) {",""," var distance = this._normalizeDate(date).getDay() - firstday;"," var cutOffColumn = 6 - (distance + 7)%7;"," return cutOffColumn;",""," },",""," /**"," * A render assist method that turns on the view of the previous month's dates "," * in a given calendar pane."," * @method _turnPrevMonthOn"," * @param {Node} pane The calendar pane that needs its previous month's dates view"," * modified."," * @protected"," */"," _turnPrevMonthOn : function (pane) {"," "," var pane_id = pane.get(\"id\"),"," pane_date = this._paneProperties[pane_id].paneDate,"," daysInPrevMonth = ydate.daysInMonth(ydate.addMonths(pane_date, -1));",""," if (!this._paneProperties[pane_id].hasOwnProperty(\"daysInPrevMonth\")) {"," this._paneProperties[pane_id].daysInPrevMonth = 0;"," }",""," if (daysInPrevMonth != this._paneProperties[pane_id].daysInPrevMonth) {"," "," this._paneProperties[pane_id].daysInPrevMonth = daysInPrevMonth;",""," for (var cell = 5; cell >= 0; cell--) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell-5)).set('text', daysInPrevMonth--);"," }",""," }","",""," },",""," /**"," * A render assist method that turns off the view of the previous month's dates "," * in a given calendar pane."," * @method _turnPrevMonthOff"," * @param {Node} pane The calendar pane that needs its previous month's dates view"," * modified."," * @protected"," */"," _turnPrevMonthOff : function (pane) {"," var pane_id = pane.get(\"id\");"," this._paneProperties[pane_id].daysInPrevMonth = 0;",""," for (var cell = 5; cell >= 0; cell--) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell-5)).setContent(\" \");"," } "," },",""," /**"," * A render assist method that cleans up the last few cells in the month grid"," * when the number of days in the month changes."," * @method _cleanUpNextMonthCells"," * @param {Node} pane The calendar pane that needs the last date cells cleaned up."," * @private"," */"," _cleanUpNextMonthCells : function (pane) {"," var pane_id = pane.get(\"id\");"," pane.one(\"#\" + pane_id + \"_6_29\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_7_30\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_8_31\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_0_30\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_1_31\").removeClass(CAL_NEXTMONTH_DAY); "," },",""," /**"," * A render assist method that turns on the view of the next month's dates "," * in a given calendar pane."," * @method _turnNextMonthOn"," * @param {Node} pane The calendar pane that needs its next month's dates view"," * modified."," * @protected"," */"," _turnNextMonthOn : function (pane) { "," var dayCounter = 1,"," pane_id = pane.get(\"id\"),"," daysInMonth = this._paneProperties[pane_id].daysInMonth,"," cutoffCol = this._paneProperties[pane_id].cutoffCol;",""," for (var cell = daysInMonth - 22; cell < cutoffCol + 7; cell++) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+23)).set(\"text\", dayCounter++).addClass(CAL_NEXTMONTH_DAY);"," }",""," var startingCell = cutoffCol;"," if (daysInMonth == 31 && (cutoffCol <= 1)) {"," startingCell = 2;"," }"," else if (daysInMonth == 30 && cutoffCol === 0) {"," startingCell = 1;"," }"," "," for (var cell = startingCell ; cell < cutoffCol + 7; cell++) {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+30)).set(\"text\", dayCounter++).addClass(CAL_NEXTMONTH_DAY); "," }"," },",""," /**"," * A render assist method that turns off the view of the next month's dates "," * in a given calendar pane."," * @method _turnNextMonthOff"," * @param {Node} pane The calendar pane that needs its next month's dates view"," * modified."," * @protected"," */"," _turnNextMonthOff : function (pane) {"," var pane_id = pane.get(\"id\"),"," daysInMonth = this._paneProperties[pane_id].daysInMonth,"," cutoffCol = this._paneProperties[pane_id].cutoffCol;",""," for (var cell = daysInMonth - 22; cell <= 12; cell++) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+23)).setContent(\" \").addClass(CAL_NEXTMONTH_DAY);"," }",""," var startingCell = 0;"," if (daysInMonth == 31 && (cutoffCol <= 1)) {"," startingCell = 2;"," }"," else if (daysInMonth == 30 && cutoffCol === 0) {"," startingCell = 1;"," }"," "," for (var cell = startingCell ; cell <= 12; cell++) {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+30)).setContent(\" \").addClass(CAL_NEXTMONTH_DAY); "," } "," },",""," /**"," * The handler for the change in the showNextMonth attribute."," * @method _afterShowNextMonthChange"," * @private"," */"," _afterShowNextMonthChange : function () {"," "," var contentBox = this.get('contentBox'),"," lastPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + (this._paneNumber - 1));"," this._cleanUpNextMonthCells(lastPane); ","",""," if (this.get('showNextMonth')) {"," this._turnNextMonthOn(lastPane);"," }",""," else {"," this._turnNextMonthOff(lastPane);"," }",""," },",""," /**"," * The handler for the change in the showPrevMonth attribute."," * @method _afterShowPrevMonthChange"," * @private"," */"," _afterShowPrevMonthChange : function () {"," var contentBox = this.get('contentBox'),"," firstPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + 0);",""," if (this.get('showPrevMonth')) {"," this._turnPrevMonthOn(firstPane);"," }",""," else {"," this._turnPrevMonthOff(firstPane);"," }"," "," },"," "," /**"," * The handler for the change in the headerRenderer attribute."," * @method _afterHeaderRendererChange"," * @private"," */ "," _afterHeaderRendererChange : function () {"," var headerCell = this.get(\"contentBox\").one(\".\" + CAL_HD_LABEL);"," headerCell.setContent(this._updateCalendarHeader(this.get('date')));"," },",""," /**"," * The handler for the change in the customRenderer attribute."," * @method _afterCustomRendererChange"," * @private"," */ "," _afterCustomRendererChange : function () {"," this._restoreModifiedCells();"," this._renderCustomRules();"," },",""," /**"," * The handler for the change in the date attribute. Modifies the calendar"," * view by shifting the calendar grid mask and running custom rendering and"," * selection rendering as necessary."," * @method _afterDateChange"," * @private"," */ "," _afterDateChange : function () {"," "," var contentBox = this.get('contentBox'),"," headerCell = contentBox.one(\".\" + CAL_HD).one(\".\" + CAL_HD_LABEL),"," calendarPanes = contentBox.all(\".\" + CAL_GRID),"," currentDate = this.get(\"date\"),"," counter = 0;",""," contentBox.setStyle(\"visibility\", \"hidden\");"," headerCell.setContent(this._updateCalendarHeader(currentDate));"," "," this._restoreModifiedCells();",""," calendarPanes.each(function (curNode) {"," this._rerenderCalendarPane(ydate.addMonths(currentDate, counter++), "," curNode);"," }, this);",""," this._afterShowPrevMonthChange();"," this._afterShowNextMonthChange();",""," this._renderCustomRules();"," this._renderSelectedDates();"," "," contentBox.setStyle(\"visibility\", \"visible\");"," },","",""," /**"," * A rendering assist method that initializes the HTML for a single"," * calendar pane."," * @method _initCalendarPane"," * @param {Date} baseDate The date corresponding to the month of the given"," * calendar pane."," * @param {String} pane_id The id of the pane, to be used as a prefix for"," * element ids in the given pane."," * @private"," */ "," _initCalendarPane : function (baseDate, pane_id) {"," // Initialize final output HTML string"," var calString = '',"," // Get a list of short weekdays from the internationalization package, or else use default English ones."," weekdays = this.get('strings.very_short_weekdays') || [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],"," fullweekdays = this.get('strings.weekdays') || [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],"," // Get the first day of the week from the internationalization package, or else use Sunday as default."," firstday = this.get('strings.first_weekday') || 0,"," // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week."," cutoffCol = this._getCutoffColumn(baseDate, firstday),"," // Compute the number of days in the month based on starting date"," daysInMonth = ydate.daysInMonth(baseDate),"," // Initialize the array of individual row HTML strings"," row_array = ['','','','','',''],"," // Initialize the partial templates object"," partials = {};"," "," // Initialize the partial template for the weekday row cells."," partials[\"weekday_row\"] = '';"," "," // Populate the partial template for the weekday row cells with weekday names"," for (var day = firstday; day <= firstday + 6; day++) {"," partials[\"weekday_row\"] += "," substitute(CalendarBase.WEEKDAY_TEMPLATE,"," {weekdayname: weekdays[day%7],"," full_weekdayname: fullweekdays[day%7]});"," }"," "," // Populate the partial template for the weekday row container with the weekday row cells"," partials[\"weekday_row_template\"] = substitute(CalendarBase.WEEKDAY_ROW_TEMPLATE, partials);",""," // Populate the array of individual row HTML strings"," for (var row = 0; row <= 5; row++) {"," "," for (var column = 0; column <= 12; column++) { "," "," // Compute the value of the date that needs to populate the cell"," var date = 7*row - 5 + column;",""," // Compose the value of the unique id of the current calendar cell"," var id_date = pane_id + \"_\" + column + \"_\" + date;",""," // Set the calendar day class to one of three possible values"," var calendar_day_class = CAL_DAY;",""," if (date < 1) {"," calendar_day_class = CAL_PREVMONTH_DAY;"," }"," else if (date > daysInMonth) {"," calendar_day_class = CAL_NEXTMONTH_DAY;"," }",""," // Cut off dates that fall before the first and after the last date of the month"," if (date < 1 || date > daysInMonth) {"," date = \" \";"," }"," "," // Decide on whether a column in the masked table is visible or not based on the value of the cutoff column."," var column_visibility = (column >= cutoffCol && column < (cutoffCol + 7)) ? '' : CAL_COL_HIDDEN;",""," // Substitute the values into the partial calendar day template and add it to the current row HTML string"," row_array[row] += substitute (CalendarBase.CALDAY_TEMPLATE, "," {day_content: date,"," calendar_col_class: \"calendar_col\" + column,"," calendar_col_visibility_class: column_visibility,"," calendar_day_class: calendar_day_class,"," calendar_day_id: id_date});"," }"," }"," "," // Instantiate the partial calendar pane body template"," partials[\"body_template\"] = '';"," "," // Populate the body template with the rows templates"," each (row_array, function (v) {"," partials[\"body_template\"] += substitute(CalendarBase.CALDAY_ROW_TEMPLATE, "," {calday_row: v});"," });",""," // Populate the calendar grid id"," partials[\"calendar_pane_id\"] = pane_id;",""," // Populate the calendar pane tabindex"," partials[\"calendar_pane_tabindex\"] = this.get(\"tabIndex\");"," partials[\"pane_arialabel\"] = ydate.format(baseDate, {format:\"%B %Y\"});","",""," // Generate final output by substituting class names."," var output = substitute(substitute (CalendarBase.CALENDAR_GRID_TEMPLATE, partials),"," CalendarBase.CALENDAR_STRINGS);",""," // Store the initialized pane information",""," this._paneProperties[pane_id] = {cutoffCol: cutoffCol, daysInMonth: daysInMonth, paneDate: baseDate};",""," return output;"," },",""," /**"," * A rendering assist method that rerenders a specified calendar pane, based"," * on a new Date. "," * @method _rerenderCalendarPane"," * @param {Date} newDate The date corresponding to the month of the given"," * calendar pane."," * @param {Node} pane The node corresponding to the calendar pane to be rerenders."," * @private"," */ "," _rerenderCalendarPane : function (newDate, pane) {",""," // Get the first day of the week from the internationalization package, or else use Sunday as default."," var firstday = this.get('strings.first_weekday') || 0,"," // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week."," cutoffCol = this._getCutoffColumn(newDate, firstday),"," // Compute the number of days in the month based on starting date"," daysInMonth = ydate.daysInMonth(newDate),"," // Get pane id for easier reference"," paneId = pane.get(\"id\");"," "," // Hide the pane before making DOM changes to speed them up"," pane.setStyle(\"visibility\", \"hidden\");"," pane.setAttribute(\"aria-label\", ydate.format(newDate, {format:\"%B %Y\"}));"," "," // Go through all columns, and flip their visibility setting based on whether they are within the unmasked range."," for (var column = 0; column <= 12; column++) {"," var currentColumn = pane.all(\".\" + \"calendar_col\" + column);"," currentColumn.removeClass(CAL_COL_HIDDEN);"," "," if (column < cutoffCol || column >= (cutoffCol + 7)) {"," currentColumn.addClass(CAL_COL_HIDDEN);"," }"," else {"," // Clean up dates in visible columns to account for the correct number of days in a month"," switch(column)"," {"," case 0:"," var curCell = pane.one(\"#\" + paneId + \"_0_30\");"," if (daysInMonth >= 30) {"," curCell.set(\"text\", \"30\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.addClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," break;"," case 1:"," var curCell = pane.one(\"#\" + paneId + \"_1_31\");"," if (daysInMonth >= 31) {"," curCell.set(\"text\", \"31\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 6:"," var curCell = pane.one(\"#\" + paneId + \"_6_29\");"," if (daysInMonth >= 29) {"," curCell.set(\"text\", \"29\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 7:"," var curCell = pane.one(\"#\" + paneId + \"_7_30\");"," if (daysInMonth >= 30) {"," curCell.set(\"text\", \"30\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 8:"," var curCell = pane.one(\"#\" + paneId + \"_8_31\");"," if (daysInMonth >= 31) {"," curCell.set(\"text\", \"31\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," } "," }"," }"," // Update stored pane properties"," this._paneProperties[paneId].cutoffCol = cutoffCol;"," this._paneProperties[paneId].daysInMonth = daysInMonth;"," this._paneProperties[paneId].paneDate = newDate;"," "," // Bring the pane visibility back after all DOM changes are done "," pane.setStyle(\"visibility\", \"visible\");",""," },",""," /**"," * A rendering assist method that updates the calendar header based"," * on a given date and potentially the provided headerRenderer."," * @method _updateCalendarHeader"," * @param {Date} baseDate The date with which to update the calendar header."," * @private"," */ "," _updateCalendarHeader : function (baseDate) {"," var headerString = \"\","," headerRenderer = this.get(\"headerRenderer\");"," "," if (Y.Lang.isString(headerRenderer)) {"," headerString = ydate.format(baseDate, {format:headerRenderer});"," }"," else if (headerRenderer instanceof Function) {"," headerString = headerRenderer.call(this, baseDate);"," }"," "," return headerString; "," },",""," /**"," * A rendering assist method that initializes the calendar header HTML "," * based on a given date and potentially the provided headerRenderer."," * @method _updateCalendarHeader"," * @param {Date} baseDate The date with which to initialize the calendar header."," * @private"," */ "," _initCalendarHeader : function (baseDate) {"," return substitute(substitute(CalendarBase.HEADER_TEMPLATE, "," {calheader: this._updateCalendarHeader(baseDate),"," calendar_id: this._calendarId}), "," CalendarBase.CALENDAR_STRINGS);"," },",""," /**"," * A rendering assist method that initializes the calendar HTML "," * based on a given date."," * @method _initCalendarHTML"," * @param {Date} baseDate The date with which to initialize the calendar."," * @private"," */ "," _initCalendarHTML : function (baseDate) {"," // Instantiate the partials holder"," var partials = {},"," // Counter for iterative template replacement."," counter = 0;"," "," // Generate the template for the header "," partials[\"header_template\"] = this._initCalendarHeader(baseDate);"," partials[\"calendar_id\"] = this._calendarId;",""," partials[\"body_template\"] = substitute(substitute (CalendarBase.CONTENT_TEMPLATE, partials),"," CalendarBase.CALENDAR_STRINGS);"," "," // Instantiate the iterative template replacer function "," function paneReplacer () {"," var singlePane = this._initCalendarPane(ydate.addMonths(baseDate, counter), partials[\"calendar_id\"]+\"_pane_\"+counter);"," counter++;"," return singlePane;"," }"," // Go through all occurrences of the calendar_grid_template token and replace it with an appropriate calendar grid."," var output = partials[\"body_template\"].replace(/\\{calendar_grid_template\\}/g, Y.bind(paneReplacer, this));",""," // Update the paneNumber count"," this._paneNumber = counter;",""," return output;"," }","}, {"," "," /**"," * The CSS classnames for the calendar templates."," * @property CALENDAR_STRINGS"," * @type Object"," * @readOnly"," * @protected"," * @static"," */ "," CALENDAR_STRINGS: {"," calendar_grid_class : CAL_GRID,"," calendar_body_class : CAL_BODY,"," calendar_hd_class : CAL_HD,"," calendar_hd_label_class : CAL_HD_LABEL,"," calendar_weekdayrow_class : CAL_WDAYROW,"," calendar_weekday_class : CAL_WDAY,"," calendar_row_class : CAL_ROW,"," calendar_day_class : CAL_DAY,"," calendar_dayanchor_class : CAL_ANCHOR,"," calendar_pane_class : CAL_PANE,"," calendar_right_grid_class : CAL_RIGHT_GRID,"," calendar_left_grid_class : CAL_LEFT_GRID,"," calendar_status_class : CAL_STATUS"," },",""," /*",""," ARIA_STATUS_TEMPLATE: '<div role=\"status\" aria-atomic=\"true\" class=\"{calendar_status_class}\"></div>',",""," AriaStatus : null,",""," updateStatus : function (statusString) {",""," if (!CalendarBase.AriaStatus) {"," CalendarBase.AriaStatus = create("," substitute (CalendarBase.ARIA_STATUS_TEMPLATE, "," CalendarBase.CALENDAR_STRINGS));"," Y.one(\"body\").append(CalendarBase.AriaStatus);"," }",""," CalendarBase.AriaStatus.set(\"text\", statusString);"," },",""," */",""," /**"," * The main content template for calendar."," * @property CONTENT_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CONTENT_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>',",""," /**"," * A single pane template for calendar (same as default CONTENT_TEMPLATE)"," * @property ONE_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," ONE_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>',",""," /**"," * A two pane template for calendar."," * @property TWO_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," TWO_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1-2\">'+"," '<div class = \"{calendar_left_grid_class}\">' + "," '{calendar_grid_template}' +"," '</div>' +"," '</div>' +"," '<div class=\"yui3-u-1-2\">' +"," '<div class = \"{calendar_right_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>' + "," '</div>',"," /**"," * A three pane template for calendar."," * @property THREE_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," THREE_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1-3\">' +"," '<div class = \"{calendar_left_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '</div>' +"," '<div class=\"yui3-u-1-3\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '<div class=\"yui3-u-1-3\">' +"," '<div class = \"{calendar_right_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '</div>' + "," '</div>',"," /**"," * A template for the calendar grid."," * @property CALENDAR_GRID_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALENDAR_GRID_TEMPLATE: '<table class=\"{calendar_grid_class}\" id=\"{calendar_pane_id}\" role=\"grid\" aria-readonly=\"true\" aria-label=\"{pane_arialabel}\" tabindex=\"{calendar_pane_tabindex}\">' + "," '<thead>' +"," '{weekday_row_template}' +"," '</thead>' +"," '<tbody>' + "," '{body_template}' +"," '</tbody>' +"," '</table>',",""," /**"," * A template for the calendar header."," * @property HEADER_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," HEADER_TEMPLATE: '<div class=\"yui3-g {calendar_hd_class}\">' + "," '<div class=\"yui3-u {calendar_hd_label_class}\" id=\"{calendar_id}_header\" aria-role=\"heading\">' + "," '{calheader}' +"," '</div>' +"," '</div>',",""," /**"," * A template for the row of weekday names."," * @property WEEKDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," WEEKDAY_ROW_TEMPLATE: '<tr class=\"{calendar_weekdayrow_class}\" role=\"row\">' + "," '{weekday_row}' +"," '</tr>',",""," /**"," * A template for a single row of calendar days."," * @property CALDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALDAY_ROW_TEMPLATE: '<tr class=\"{calendar_row_class}\" role=\"row\">' + "," '{calday_row}' + "," '</tr>',",""," /**"," * A template for a single cell with a weekday name."," * @property CALDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," WEEKDAY_TEMPLATE: '<th class=\"{calendar_weekday_class}\" role=\"columnheader\" aria-label=\"{full_weekdayname}\">{weekdayname}</th>',",""," /**"," * A template for a single cell with a calendar day."," * @property CALDAY_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALDAY_TEMPLATE: '<td class=\"{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}\" id=\"{calendar_day_id}\" role=\"gridcell\" tabindex=\"-1\">' +"," '{day_content}' + "," '</td>',",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'calendarBase'"," * @readOnly"," * @protected"," * @static"," */ "," NAME: 'calendarBase',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */ "," ATTRS: {"," tabIndex: {"," value: 1"," },"," /**"," * The date corresponding to the current calendar view. Always"," * normalized to the first of the month that contains the date"," * at assignment time. Used as the first date visible in the"," * calendar."," *"," * @attribute date"," * @type Date"," * @default The first of the month containing today's date, as"," * set on the end user's system."," */"," date: {"," value: new Date(),"," setter: function (val) {"," var newDate = this._normalizeDate(val);"," if (ydate.areEqual(newDate, this.get('date'))) {"," return this.get('date');"," }"," else {"," return newDate;"," }"," }"," },",""," /**"," * A setting specifying whether to shows days from the previous"," * month in the visible month's grid, if there are empty preceding"," * cells available."," *"," * @attribute showPrevMonth"," * @type boolean"," * @default false"," */"," showPrevMonth: {"," value: false"," },",""," /**"," * A setting specifying whether to shows days from the next"," * month in the visible month's grid, if there are empty"," * cells available at the end."," *"," * @attribute showNextMonth"," * @type boolean"," * @default false"," */"," showNextMonth: {"," value: false"," },",""," /**"," * Strings and properties derived from the internationalization packages"," * for the calendar."," *"," * @attribute strings"," * @type Object"," * @protected"," */"," strings : {"," valueFn: function() { return Y.Intl.get(\"calendar-base\"); }"," },",""," /**"," * Custom header renderer for the calendar."," *"," * @attribute headerRenderer"," * @type String | Function"," */"," headerRenderer: {"," value: \"%B %Y\""," },",""," /**"," * The name of the rule which all enabled dates should match."," * Either disabledDatesRule or enabledDatesRule should be specified,"," * or neither, but not both."," *"," * @attribute enabledDatesRule"," * @type String"," * @default null"," */"," enabledDatesRule: {"," value: null"," },",""," /**"," * The name of the rule which all disabled dates should match."," * Either disabledDatesRule or enabledDatesRule should be specified,"," * or neither, but not both."," *"," * @attribute disabledDatesRule"," * @type String"," * @default null"," */"," disabledDatesRule: {"," value: null"," },",""," /**"," * A read-only attribute providing a list of currently selected dates."," *"," * @attribute selectedDates"," * @readOnly"," * @type Array"," */"," selectedDates : {"," readOnly: true,"," getter: function (val) {"," return (this._getSelectedDatesList());"," }"," },",""," /**"," * An object of the form {rules:Object, filterFunction:Function},"," * providing set of rules and a custom rendering function for "," * customizing specific calendar cells."," *"," * @attribute customRenderer"," * @readOnly"," * @type Object"," * @default {}"," */"," customRenderer : {"," lazyAdd: false,"," value: {},"," setter: function (val) {"," this._rules = val.rules;"," this._filterFunction = val.filterFunction;"," }"," }"," }"," ","});","","","}, '3.7.2', {\"requires\": [\"widget\", \"substitute\", \"datatype-date\", \"datatype-date-math\", \"cssgrids\"], \"lang\": [\"de\", \"en\", \"fr\", \"ja\", \"nb-NO\", \"pt-BR\", \"ru\", \"zh-HANT-TW\"], \"skinnable\": true});"];+_yuitest_coverage["build/calendar-base/calendar-base.js"].code=["YUI.add('calendar-base', function (Y, NAME) {","","/**"," * The CalendarBase submodule is a basic UI calendar view that displays"," * a range of dates in a two-dimensional month grid, with one or more"," * months visible at a single time. CalendarBase supports custom date"," * rendering, multiple calendar panes, and selection. "," * @module calendar"," * @submodule calendar-base"," */"," ","var getCN = Y.ClassNameManager.getClassName,"," CALENDAR = 'calendar',"," CAL_GRID = getCN(CALENDAR, 'grid'),"," CAL_LEFT_GRID = getCN(CALENDAR, 'left-grid'),"," CAL_RIGHT_GRID = getCN(CALENDAR, 'right-grid'),"," CAL_BODY = getCN(CALENDAR, 'body'),"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_HD_LABEL = getCN(CALENDAR, 'header-label'),"," CAL_WDAYROW = getCN(CALENDAR, 'weekdayrow'),"," CAL_WDAY = getCN(CALENDAR, 'weekday'),"," CAL_COL_HIDDEN = getCN(CALENDAR, 'column-hidden'),"," CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),"," SELECTION_DISABLED = getCN(CALENDAR, 'selection-disabled'),"," CAL_ROW = getCN(CALENDAR, 'row'),"," CAL_DAY = getCN(CALENDAR, 'day'),"," CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),"," CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),"," CAL_ANCHOR = getCN(CALENDAR, 'anchor'),"," CAL_PANE = getCN(CALENDAR, 'pane'),"," CAL_STATUS = getCN(CALENDAR, 'status'),"," L = Y.Lang,"," node = Y.Node,"," create = node.create,"," substitute = Y.substitute,"," each = Y.each,"," hasVal = Y.Array.hasValue,"," iOf = Y.Array.indexOf,"," hasKey = Y.Object.hasKey,"," setVal = Y.Object.setValue,"," owns = Y.Object.owns,"," isEmpty = Y.Object.isEmpty,"," ydate = Y.DataType.Date;","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class CalendarBase"," * @extends Widget"," * @param config {Object} Configuration object (see Configuration "," * attributes)"," * @constructor"," */","function CalendarBase(config) {"," CalendarBase.superclass.constructor.apply ( this, arguments );","}","","","","Y.CalendarBase = Y.extend( CalendarBase, Y.Widget, {",""," /**"," * A storage for various properties of individual month"," * panes."," *"," * @property _paneProperties"," * @type Object"," * @private"," */"," _paneProperties : {},",""," /**"," * The number of month panes in the calendar, deduced"," * from the CONTENT_TEMPLATE's number of {calendar_grid}"," * tokens."," *"," * @property _paneNumber"," * @type Number"," * @private"," */"," _paneNumber : 1,",""," /**"," * The unique id used to prefix various elements of this"," * calendar instance."," *"," * @property _calendarId"," * @type String"," * @private"," */"," _calendarId : null,",""," /**"," * The hash map of selected dates, populated with"," * selectDates() and deselectDates() methods "," *"," * @property _selectedDates"," * @type Object"," * @private"," */"," _selectedDates : {},",""," /**"," * A private copy of the rules object, populated"," * by setting the customRenderer attribute."," *"," * @property _rules"," * @type Object"," * @private"," */"," _rules : {},",""," /**"," * A private copy of the filterFunction, populated"," * by setting the customRenderer attribute."," *"," * @property _filterFunction"," * @type Function"," * @private"," */"," _filterFunction : null,",""," /**"," * Storage for calendar cells modified by any custom"," * formatting. The storage is cleared, used to restore"," * cells to the original state, and repopulated accordingly"," * when the calendar is rerendered. "," *"," * @property _storedDateCells"," * @type Object"," * @private"," */"," _storedDateCells : {},",""," /**"," * Designated initializer"," * Initializes instance-level properties of"," * calendar."," *"," * @method initializer"," */ "," initializer : function () {"," this._paneProperties = {};"," this._calendarId = Y.guid('calendar');"," this._selectedDates = {};"," if (isEmpty(this._rules)) {"," this._rules = {}; "," }"," this._storedDateCells = {};"," },",""," /**"," * renderUI implementation"," *"," * Creates a visual representation of the calendar based on existing parameters. "," * @method renderUI"," */ "," renderUI : function () {",""," var contentBox = this.get('contentBox');"," contentBox.appendChild(this._initCalendarHTML(this.get('date')));"," if (this.get('showPrevMonth')) {"," this._afterShowPrevMonthChange();"," }"," if (this.get('showNextMonth')) {"," this._afterShowNextMonthChange();"," }"," this._renderCustomRules();"," this._renderSelectedDates();",""," this.get(\"boundingBox\").setAttribute(\"aria-labelledby\", this._calendarId + \"_header\");",""," },"," /**"," * bindUI implementation"," *"," * Assigns listeners to relevant events that change the state"," * of the calendar."," * @method bindUI"," */ "," bindUI : function () {"," this.after('dateChange', this._afterDateChange);"," this.after('showPrevMonthChange', this._afterShowPrevMonthChange);"," this.after('showNextMonthChange', this._afterShowNextMonthChange);"," this.after('headerRendererChange', this._afterHeaderRendererChange);"," this.after('customRendererChange', this._afterCustomRendererChange);"," this.after('enabledDatesRuleChange', this._afterCustomRendererChange);"," this.after('disabledDatesRuleChange', this._afterCustomRendererChange);"," this.after('focusedChange', this._afterFocusedChange);"," this.after('selectionChange', this._renderSelectedDates);"," this._bindCalendarEvents();"," },","",""," /**"," * An internal utility method that generates a list of selected dates "," * from the hash storage."," *"," * @method _getSelectedDatesList"," * @protected"," * @return {Array} The array of `Date`s that are currently selected."," */"," _getSelectedDatesList : function () {"," var output = [];"," each (this._selectedDates, function (year) {"," each (year, function (month) {"," each (month, function (day) {"," output.push (day);"," }, this);"," }, this);"," }, this);"," return output;"," },",""," /**"," * A utility method that returns all dates selected in a specific month."," *"," * @method _getSelectedDatesInMonth"," * @param {Date} oDate corresponding to the month for which selected dates"," * are requested."," * @protected"," * @return {Array} The array of `Date`s in a given month that are currently selected."," */"," _getSelectedDatesInMonth : function (oDate) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth();"," "," if (hasKey(this._selectedDates, year) && hasKey(this._selectedDates[year], month)) {"," return Y.Object.values(this._selectedDates[year][month]); "," }"," else {"," return [];"," }"," },","",""," /**"," * An internal parsing method that receives a String list of numbers"," * and number ranges (of the form \"1,2,3,4-6,7-9,10,11\" etc.) and checks"," * whether a specific number is included in this list. Used for looking"," * up dates in the customRenderer rule set."," *"," * @method _isNumInList"," * @param {Number} num The number to look for in a list."," * @param {String} strList The list of numbers of the form \"1,2,3,4-6,7-8,9\", etc."," * @private"," * @return {boolean} Returns true if the given number is in the given list."," */"," _isNumInList : function (num, strList) {"," if (strList == \"all\") {"," return true;"," }"," else {"," var elements = strList.split(\",\"),"," i = elements.length;",""," while (i--) {"," var range = elements[i].split(\"-\");"," if (range.length == 2 && num >= parseInt(range[0], 10) && num <= parseInt(range[1], 10)) {"," return true;"," }"," else if (range.length == 1 && (parseInt(elements[i], 10) == num)) {"," return true;"," }"," }"," return false; "," }"," },",""," /**"," * Given a specific date, returns an array of rules (from the customRenderer rule set)"," * that the given date matches."," *"," * @method _getRulesForDate"," * @param {Date} oDate The date for which an array of rules is needed"," * @private"," * @return {Array} Returns an array of `String`s, each containg the name of"," * a rule that the given date matches."," */"," _getRulesForDate : function (oDate) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," date = oDate.getDate(),"," wday = oDate.getDay(),"," rules = this._rules, "," outputRules = [],"," years, months, dates, days;",""," for (years in rules) {"," if (this._isNumInList(year, years)) {"," if (L.isString(rules[years])) {"," outputRules.push(rules[years]);"," }"," else {"," for (months in rules[years]) {"," if (this._isNumInList(month, months)) {"," if (L.isString(rules[years][months])) {"," outputRules.push(rules[years][months]);"," }"," else {"," for (dates in rules[years][months]) {"," if (this._isNumInList(date, dates)) {"," if (L.isString(rules[years][months][dates])) {"," outputRules.push(rules[years][months][dates]);"," }"," else {"," for (days in rules[years][months][dates]) {"," if (this._isNumInList(wday, days)) {"," if (L.isString(rules[years][months][dates][days])) {"," outputRules.push(rules[years][months][dates][days]);"," }"," }"," }"," }"," }"," }"," }"," }"," } "," }"," }"," }"," return outputRules;"," },",""," /**"," * A utility method which, given a specific date and a name of the rule,"," * checks whether the date matches the given rule."," *"," * @method _matchesRule"," * @param {Date} oDate The date to check"," * @param {String} rule The name of the rule that the date should match."," * @private"," * @return {boolean} Returns true if the date matches the given rule."," *"," */"," _matchesRule : function (oDate, rule) {"," return (iOf(this._getRulesForDate(oDate), rule) >= 0);"," },",""," /**"," * A utility method which checks whether a given date matches the `enabledDatesRule`"," * or does not match the `disabledDatesRule` and therefore whether it can be selected."," * @method _canBeSelected"," * @param {Date} oDate The date to check"," * @private"," * @return {boolean} Returns true if the date can be selected; false otherwise."," */"," _canBeSelected : function (oDate) {"," "," var enabledDatesRule = this.get(\"enabledDatesRule\"),"," disabledDatesRule = this.get(\"disabledDatesRule\");",""," if (enabledDatesRule) {"," return this._matchesRule(oDate, enabledDatesRule);"," }"," else if (disabledDatesRule) {"," return !this._matchesRule(oDate, disabledDatesRule);"," }"," else {"," return true;"," }"," },",""," /**"," * Selects a given date or array of dates."," * @method selectDates"," * @param {Date|Array} dates A `Date` or `Array` of `Date`s."," */"," selectDates : function (dates) {"," if (ydate.isValidDate(dates)) {"," this._addDateToSelection(dates);"," }"," else if (L.isArray(dates)) {"," this._addDatesToSelection(dates);"," }"," },",""," /**"," * Deselects a given date or array of dates, or deselects"," * all dates if no argument is specified."," * @method deselectDates"," * @param {Date|Array} [dates] A `Date` or `Array` of `Date`s, or no"," * argument if all dates should be deselected."," */"," deselectDates : function (dates) {"," if (!dates) {"," this._clearSelection();"," }"," else if (ydate.isValidDate(dates)) {"," this._removeDateFromSelection(dates);"," }"," else if (L.isArray(dates)) {"," this._removeDatesFromSelection(dates);"," }"," },",""," /**"," * A utility method that adds a given date to selection.."," * @method _addDateToSelection"," * @param {Date} oDate The date to add to selection."," * @param {Number} [index] An optional parameter that is used"," * to differentiate between individual date selections and multiple"," * date selections."," * @private"," */"," _addDateToSelection : function (oDate, index) {",""," if (this._canBeSelected(oDate)) {",""," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," day = oDate.getDate();"," "," if (hasKey(this._selectedDates, year)) {"," if (hasKey(this._selectedDates[year], month)) {"," this._selectedDates[year][month][day] = oDate;"," }"," else {"," this._selectedDates[year][month] = {};"," this._selectedDates[year][month][day] = oDate;"," }"," }"," else {"," this._selectedDates[year] = {};"," this._selectedDates[year][month] = {};"," this._selectedDates[year][month][day] = oDate;"," }",""," this._selectedDates = setVal(this._selectedDates, [year, month, day], oDate);",""," if (!index) {"," this._fireSelectionChange();"," }"," }"," },",""," /**"," * A utility method that adds a given list of dates to selection."," * @method _addDatesToSelection"," * @param {Array} datesArray The list of dates to add to selection."," * @private"," */"," _addDatesToSelection : function (datesArray) {"," each(datesArray, this._addDateToSelection, this);"," this._fireSelectionChange();"," },",""," /**"," * A utility method that adds a given range of dates to selection."," * @method _addDateRangeToSelection"," * @param {Date} startDate The first date of the given range."," * @param {Date} endDate The last date of the given range."," * @private"," */"," _addDateRangeToSelection : function (startDate, endDate) {",""," var timezoneDifference = (endDate.getTimezoneOffset() - startDate.getTimezoneOffset())*60000,"," startTime = startDate.getTime(),"," endTime = endDate.getTime();"," "," if (startTime > endTime) {"," var tempTime = startTime;"," startTime = endTime;"," endTime = tempTime + timezoneDifference;"," }"," else {"," endTime = endTime - timezoneDifference;"," }","",""," for (var time = startTime; time <= endTime; time += 86400000) {"," var addedDate = new Date(time);"," addedDate.setHours(12);"," this._addDateToSelection(addedDate, time);"," }"," this._fireSelectionChange();"," },",""," /**"," * A utility method that removes a given date from selection.."," * @method _removeDateFromSelection"," * @param {Date} oDate The date to remove from selection."," * @param {Number} [index] An optional parameter that is used"," * to differentiate between individual date selections and multiple"," * date selections."," * @private"," */"," _removeDateFromSelection : function (oDate, index) {"," var year = oDate.getFullYear(),"," month = oDate.getMonth(),"," day = oDate.getDate();"," if (hasKey(this._selectedDates, year) && "," hasKey(this._selectedDates[year], month) && "," hasKey(this._selectedDates[year][month], day)) {"," delete this._selectedDates[year][month][day];"," if (!index) {"," this._fireSelectionChange();"," }"," }"," },",""," /**"," * A utility method that removes a given list of dates from selection."," * @method _removeDatesFromSelection"," * @param {Array} datesArray The list of dates to remove from selection."," * @private"," */"," _removeDatesFromSelection : function (datesArray) {"," each(datesArray, this._removeDateFromSelection, this);"," this._fireSelectionChange();"," },",""," /**"," * A utility method that removes a given range of dates from selection."," * @method _removeDateRangeFromSelection"," * @param {Date} startDate The first date of the given range."," * @param {Date} endDate The last date of the given range."," * @private"," */"," _removeDateRangeFromSelection : function (startDate, endDate) {"," var startTime = startDate.getTime(),"," endTime = endDate.getTime();"," "," for (var time = startTime; time <= endTime; time += 86400000) {"," this._removeDateFromSelection(new Date(time), time);"," }",""," this._fireSelectionChange(); "," },",""," /**"," * A utility method that removes all dates from selection."," * @method _clearSelection"," * @param {boolean} noevent A Boolean specifying whether a selectionChange"," * event should be fired. If true, the event is not fired."," * @private"," */"," _clearSelection : function (noevent) {"," this._selectedDates = {};"," this.get(\"contentBox\").all(\".\" + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", false);"," if (!noevent) {"," this._fireSelectionChange();"," }"," },",""," /**"," * A utility method that fires a selectionChange event."," * @method _fireSelectionChange"," * @private"," */"," _fireSelectionChange : function () {",""," /**"," * Fired when the set of selected dates changes. Contains a payload with"," * a `newSelection` property with an array of selected dates."," *"," * @event selectionChange"," */"," this.fire(\"selectionChange\", {newSelection: this._getSelectedDatesList()});"," },",""," /**"," * A utility method that restores cells modified by custom formatting."," * @method _restoreModifiedCells"," * @private"," */"," _restoreModifiedCells : function () {"," var contentbox = this.get(\"contentBox\"),"," id;"," for (id in this._storedDateCells) {"," contentbox.one(\"#\" + id).replace(this._storedDateCells[id]);"," delete this._storedDateCells[id];"," }"," },",""," /**"," * A rendering assist method that renders all cells modified by the customRenderer"," * rules, as well as the enabledDatesRule and disabledDatesRule."," * @method _renderCustomRules"," * @private"," */"," _renderCustomRules : function () {",""," this.get(\"contentBox\").all(\".\" + CAL_DAY + \",.\" + CAL_NEXTMONTH_DAY).removeClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", false);",""," if (!isEmpty(this._rules)) {"," var enRule = this.get(\"enabledDatesRule\"),"," disRule = this.get(\"disabledDatesRule\");",""," for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {"," var paneDate = ydate.addMonths(this.get(\"date\"), paneNum);"," var dateArray = ydate.listOfDatesInMonth(paneDate);"," each(dateArray, function (date) {"," var matchingRules = this._getRulesForDate(date);"," if (matchingRules.length > 0) {"," var dateNode = this._dateToNode(date);"," if ((enRule && iOf(matchingRules, enRule) < 0) || (!enRule && disRule && iOf(matchingRules, disRule) >= 0)) {"," dateNode.addClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", true);"," }"," "," if (L.isFunction(this._filterFunction)) {"," this._storedDateCells[dateNode.get(\"id\")] = dateNode.cloneNode(true);"," this._filterFunction (date, dateNode, matchingRules);"," }"," }"," else if (enRule) {"," var dateNode = this._dateToNode(date);"," dateNode.addClass(SELECTION_DISABLED).setAttribute(\"aria-disabled\", true);"," }"," },"," this);"," }"," } "," },",""," /**"," * A rendering assist method that renders all cells that are currently selected."," * @method _renderSelectedDates"," * @private"," */"," _renderSelectedDates : function () {"," this.get(\"contentBox\").all(\".\" + CAL_DAY_SELECTED).removeClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", false);"," "," for (var paneNum = 0; paneNum < this._paneNumber; paneNum++) {"," var paneDate = ydate.addMonths(this.get(\"date\"), paneNum);"," var dateArray = this._getSelectedDatesInMonth(paneDate);"," each(dateArray, function (date) {"," this._dateToNode(date).addClass(CAL_DAY_SELECTED).setAttribute(\"aria-selected\", true);"," },"," this);"," }"," },",""," /**"," * A utility method that converts a date to the node wrapping the calendar cell"," * the date corresponds to.."," * @method _dateToNode"," * @param {Date} oDate The date to convert to Node"," * @protected"," * @return {Node} The node wrapping the DOM element of the cell the date "," * corresponds to."," */"," _dateToNode : function (oDate) {"," var day = oDate.getDate(),"," col = 0,"," daymod = day%7,"," paneNum = (12 + oDate.getMonth() - this.get(\"date\").getMonth()) % 12,"," paneId = this._calendarId + \"_pane_\" + paneNum,"," cutoffCol = this._paneProperties[paneId].cutoffCol;",""," switch (daymod) {"," case (0):"," if (cutoffCol >= 6) {"," col = 12;"," }"," else {"," col = 5;"," }"," break;"," case (1):"," col = 6;"," break;"," case (2):"," if (cutoffCol > 0) {"," col = 7;"," }"," else {"," col = 0;"," }"," break;"," case (3):"," if (cutoffCol > 1) {"," col = 8;"," }"," else {"," col = 1;"," }"," break;"," case (4):"," if (cutoffCol > 2) {"," col = 9;"," }"," else {"," col = 2;"," }"," break;"," case (5):"," if (cutoffCol > 3) {"," col = 10;"," }"," else {"," col = 3;"," }"," break;"," case (6):"," if (cutoffCol > 4) {"," col = 11;"," }"," else {"," col = 4;"," }"," break;"," }"," return(this.get(\"contentBox\").one(\"#\" + this._calendarId + \"_pane_\" + paneNum + \"_\" + col + \"_\" + day)); ",""," },",""," /**"," * A utility method that converts a node corresponding to the DOM element of"," * the cell for a particular date to that date."," * @method _nodeToDate"," * @param {Node} oNode The Node wrapping the DOM element of a particular date cell."," * @protected"," * @return {Date} The date corresponding to the DOM element that the given node wraps."," */"," _nodeToDate : function (oNode) {"," "," var idParts = oNode.get(\"id\").split(\"_\").reverse(),"," paneNum = parseInt(idParts[2], 10),"," day = parseInt(idParts[0], 10);",""," var shiftedDate = ydate.addMonths(this.get(\"date\"), paneNum),"," year = shiftedDate.getFullYear(),"," month = shiftedDate.getMonth();",""," return new Date(year, month, day, 12, 0, 0, 0);"," },",""," /**"," * A placeholder method, called from bindUI, to bind the Calendar events."," * @method _bindCalendarEvents"," * @protected"," */"," _bindCalendarEvents : function () {"," "," },",""," /**"," * A utility method that normalizes a given date by converting it to the 1st"," * day of the month the date is in, with the time set to noon."," * @method _normalizeDate"," * @param {Date} oDate The date to normalize"," * @protected"," * @return {Date} The normalized date, set to the first of the month, with time"," * set to noon."," */"," _normalizeDate : function (date) {"," if (date) {"," return new Date(date.getFullYear(), date.getMonth(), 1, 12, 0, 0, 0);"," }"," else {"," return null;"," } "," },","",""," /**"," * A render assist utility method that computes the cutoff column for the calendar "," * rendering mask."," * @method _getCutoffColumn"," * @param {Date} date The date of the month grid to compute the cutoff column for."," * @param {Number} firstday The first day of the week (modified by internationalized calendars)"," * @private"," * @return {Number} The number of the cutoff column."," */"," _getCutoffColumn : function (date, firstday) {",""," var distance = this._normalizeDate(date).getDay() - firstday;"," var cutOffColumn = 6 - (distance + 7)%7;"," return cutOffColumn;",""," },",""," /**"," * A render assist method that turns on the view of the previous month's dates "," * in a given calendar pane."," * @method _turnPrevMonthOn"," * @param {Node} pane The calendar pane that needs its previous month's dates view"," * modified."," * @protected"," */"," _turnPrevMonthOn : function (pane) {"," "," var pane_id = pane.get(\"id\"),"," pane_date = this._paneProperties[pane_id].paneDate,"," daysInPrevMonth = ydate.daysInMonth(ydate.addMonths(pane_date, -1));",""," if (!this._paneProperties[pane_id].hasOwnProperty(\"daysInPrevMonth\")) {"," this._paneProperties[pane_id].daysInPrevMonth = 0;"," }",""," if (daysInPrevMonth != this._paneProperties[pane_id].daysInPrevMonth) {"," "," this._paneProperties[pane_id].daysInPrevMonth = daysInPrevMonth;",""," for (var cell = 5; cell >= 0; cell--) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell-5)).set('text', daysInPrevMonth--);"," }",""," }","",""," },",""," /**"," * A render assist method that turns off the view of the previous month's dates "," * in a given calendar pane."," * @method _turnPrevMonthOff"," * @param {Node} pane The calendar pane that needs its previous month's dates view"," * modified."," * @protected"," */"," _turnPrevMonthOff : function (pane) {"," var pane_id = pane.get(\"id\");"," this._paneProperties[pane_id].daysInPrevMonth = 0;",""," for (var cell = 5; cell >= 0; cell--) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell-5)).setContent(\" \");"," } "," },",""," /**"," * A render assist method that cleans up the last few cells in the month grid"," * when the number of days in the month changes."," * @method _cleanUpNextMonthCells"," * @param {Node} pane The calendar pane that needs the last date cells cleaned up."," * @private"," */"," _cleanUpNextMonthCells : function (pane) {"," var pane_id = pane.get(\"id\");"," pane.one(\"#\" + pane_id + \"_6_29\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_7_30\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_8_31\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_0_30\").removeClass(CAL_NEXTMONTH_DAY);"," pane.one(\"#\" + pane_id + \"_1_31\").removeClass(CAL_NEXTMONTH_DAY); "," },",""," /**"," * A render assist method that turns on the view of the next month's dates "," * in a given calendar pane."," * @method _turnNextMonthOn"," * @param {Node} pane The calendar pane that needs its next month's dates view"," * modified."," * @protected"," */"," _turnNextMonthOn : function (pane) { "," var dayCounter = 1,"," pane_id = pane.get(\"id\"),"," daysInMonth = this._paneProperties[pane_id].daysInMonth,"," cutoffCol = this._paneProperties[pane_id].cutoffCol;",""," for (var cell = daysInMonth - 22; cell < cutoffCol + 7; cell++) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+23)).set(\"text\", dayCounter++).addClass(CAL_NEXTMONTH_DAY);"," }",""," var startingCell = cutoffCol;"," if (daysInMonth == 31 && (cutoffCol <= 1)) {"," startingCell = 2;"," }"," else if (daysInMonth == 30 && cutoffCol === 0) {"," startingCell = 1;"," }"," "," for (var cell = startingCell ; cell < cutoffCol + 7; cell++) {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+30)).set(\"text\", dayCounter++).addClass(CAL_NEXTMONTH_DAY); "," }"," },",""," /**"," * A render assist method that turns off the view of the next month's dates "," * in a given calendar pane."," * @method _turnNextMonthOff"," * @param {Node} pane The calendar pane that needs its next month's dates view"," * modified."," * @protected"," */"," _turnNextMonthOff : function (pane) {"," var pane_id = pane.get(\"id\"),"," daysInMonth = this._paneProperties[pane_id].daysInMonth,"," cutoffCol = this._paneProperties[pane_id].cutoffCol;",""," for (var cell = daysInMonth - 22; cell <= 12; cell++) "," {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+23)).setContent(\" \").addClass(CAL_NEXTMONTH_DAY);"," }",""," var startingCell = 0;"," if (daysInMonth == 31 && (cutoffCol <= 1)) {"," startingCell = 2;"," }"," else if (daysInMonth == 30 && cutoffCol === 0) {"," startingCell = 1;"," }"," "," for (var cell = startingCell ; cell <= 12; cell++) {"," pane.one(\"#\" + pane_id + \"_\" + cell + \"_\" + (cell+30)).setContent(\" \").addClass(CAL_NEXTMONTH_DAY); "," } "," },",""," /**"," * The handler for the change in the showNextMonth attribute."," * @method _afterShowNextMonthChange"," * @private"," */"," _afterShowNextMonthChange : function () {"," "," var contentBox = this.get('contentBox'),"," lastPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + (this._paneNumber - 1));"," this._cleanUpNextMonthCells(lastPane); ","",""," if (this.get('showNextMonth')) {"," this._turnNextMonthOn(lastPane);"," }",""," else {"," this._turnNextMonthOff(lastPane);"," }",""," },",""," /**"," * The handler for the change in the showPrevMonth attribute."," * @method _afterShowPrevMonthChange"," * @private"," */"," _afterShowPrevMonthChange : function () {"," var contentBox = this.get('contentBox'),"," firstPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + 0);",""," if (this.get('showPrevMonth')) {"," this._turnPrevMonthOn(firstPane);"," }",""," else {"," this._turnPrevMonthOff(firstPane);"," }"," "," },"," "," /**"," * The handler for the change in the headerRenderer attribute."," * @method _afterHeaderRendererChange"," * @private"," */ "," _afterHeaderRendererChange : function () {"," var headerCell = this.get(\"contentBox\").one(\".\" + CAL_HD_LABEL);"," headerCell.setContent(this._updateCalendarHeader(this.get('date')));"," },",""," /**"," * The handler for the change in the customRenderer attribute."," * @method _afterCustomRendererChange"," * @private"," */ "," _afterCustomRendererChange : function () {"," this._restoreModifiedCells();"," this._renderCustomRules();"," },",""," /**"," * The handler for the change in the date attribute. Modifies the calendar"," * view by shifting the calendar grid mask and running custom rendering and"," * selection rendering as necessary."," * @method _afterDateChange"," * @private"," */ "," _afterDateChange : function () {"," "," var contentBox = this.get('contentBox'),"," headerCell = contentBox.one(\".\" + CAL_HD).one(\".\" + CAL_HD_LABEL),"," calendarPanes = contentBox.all(\".\" + CAL_GRID),"," currentDate = this.get(\"date\"),"," counter = 0;",""," contentBox.setStyle(\"visibility\", \"hidden\");"," headerCell.setContent(this._updateCalendarHeader(currentDate));"," "," this._restoreModifiedCells();",""," calendarPanes.each(function (curNode) {"," this._rerenderCalendarPane(ydate.addMonths(currentDate, counter++), "," curNode);"," }, this);",""," this._afterShowPrevMonthChange();"," this._afterShowNextMonthChange();",""," this._renderCustomRules();"," this._renderSelectedDates();"," "," contentBox.setStyle(\"visibility\", \"visible\");"," },","",""," /**"," * A rendering assist method that initializes the HTML for a single"," * calendar pane."," * @method _initCalendarPane"," * @param {Date} baseDate The date corresponding to the month of the given"," * calendar pane."," * @param {String} pane_id The id of the pane, to be used as a prefix for"," * element ids in the given pane."," * @private"," */ "," _initCalendarPane : function (baseDate, pane_id) {"," // Initialize final output HTML string"," var calString = '',"," // Get a list of short weekdays from the internationalization package, or else use default English ones."," weekdays = this.get('strings.very_short_weekdays') || [\"Su\", \"Mo\", \"Tu\", \"We\", \"Th\", \"Fr\", \"Sa\"],"," fullweekdays = this.get('strings.weekdays') || [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],"," // Get the first day of the week from the internationalization package, or else use Sunday as default."," firstday = this.get('strings.first_weekday') || 0,"," // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week."," cutoffCol = this._getCutoffColumn(baseDate, firstday),"," // Compute the number of days in the month based on starting date"," daysInMonth = ydate.daysInMonth(baseDate),"," // Initialize the array of individual row HTML strings"," row_array = ['','','','','',''],"," // Initialize the partial templates object"," partials = {};"," "," // Initialize the partial template for the weekday row cells."," partials[\"weekday_row\"] = '';"," "," // Populate the partial template for the weekday row cells with weekday names"," for (var day = firstday; day <= firstday + 6; day++) {"," partials[\"weekday_row\"] += "," substitute(CalendarBase.WEEKDAY_TEMPLATE,"," {weekdayname: weekdays[day%7],"," full_weekdayname: fullweekdays[day%7]});"," }"," "," // Populate the partial template for the weekday row container with the weekday row cells"," partials[\"weekday_row_template\"] = substitute(CalendarBase.WEEKDAY_ROW_TEMPLATE, partials);",""," // Populate the array of individual row HTML strings"," for (var row = 0; row <= 5; row++) {"," "," for (var column = 0; column <= 12; column++) { "," "," // Compute the value of the date that needs to populate the cell"," var date = 7*row - 5 + column;",""," // Compose the value of the unique id of the current calendar cell"," var id_date = pane_id + \"_\" + column + \"_\" + date;",""," // Set the calendar day class to one of three possible values"," var calendar_day_class = CAL_DAY;",""," if (date < 1) {"," calendar_day_class = CAL_PREVMONTH_DAY;"," }"," else if (date > daysInMonth) {"," calendar_day_class = CAL_NEXTMONTH_DAY;"," }",""," // Cut off dates that fall before the first and after the last date of the month"," if (date < 1 || date > daysInMonth) {"," date = \" \";"," }"," "," // Decide on whether a column in the masked table is visible or not based on the value of the cutoff column."," var column_visibility = (column >= cutoffCol && column < (cutoffCol + 7)) ? '' : CAL_COL_HIDDEN;",""," // Substitute the values into the partial calendar day template and add it to the current row HTML string"," row_array[row] += substitute (CalendarBase.CALDAY_TEMPLATE, "," {day_content: date,"," calendar_col_class: \"calendar_col\" + column,"," calendar_col_visibility_class: column_visibility,"," calendar_day_class: calendar_day_class,"," calendar_day_id: id_date});"," }"," }"," "," // Instantiate the partial calendar pane body template"," partials[\"body_template\"] = '';"," "," // Populate the body template with the rows templates"," each (row_array, function (v) {"," partials[\"body_template\"] += substitute(CalendarBase.CALDAY_ROW_TEMPLATE, "," {calday_row: v});"," });",""," // Populate the calendar grid id"," partials[\"calendar_pane_id\"] = pane_id;",""," // Populate the calendar pane tabindex"," partials[\"calendar_pane_tabindex\"] = this.get(\"tabIndex\");"," partials[\"pane_arialabel\"] = ydate.format(baseDate, {format:\"%B %Y\"});","",""," // Generate final output by substituting class names."," var output = substitute(substitute (CalendarBase.CALENDAR_GRID_TEMPLATE, partials),"," CalendarBase.CALENDAR_STRINGS);",""," // Store the initialized pane information",""," this._paneProperties[pane_id] = {cutoffCol: cutoffCol, daysInMonth: daysInMonth, paneDate: baseDate};",""," return output;"," },",""," /**"," * A rendering assist method that rerenders a specified calendar pane, based"," * on a new Date. "," * @method _rerenderCalendarPane"," * @param {Date} newDate The date corresponding to the month of the given"," * calendar pane."," * @param {Node} pane The node corresponding to the calendar pane to be rerenders."," * @private"," */ "," _rerenderCalendarPane : function (newDate, pane) {",""," // Get the first day of the week from the internationalization package, or else use Sunday as default."," var firstday = this.get('strings.first_weekday') || 0,"," // Compute the cutoff column of the masked calendar table, based on the start date and the first day of week."," cutoffCol = this._getCutoffColumn(newDate, firstday),"," // Compute the number of days in the month based on starting date"," daysInMonth = ydate.daysInMonth(newDate),"," // Get pane id for easier reference"," paneId = pane.get(\"id\");"," "," // Hide the pane before making DOM changes to speed them up"," pane.setStyle(\"visibility\", \"hidden\");"," pane.setAttribute(\"aria-label\", ydate.format(newDate, {format:\"%B %Y\"}));"," "," // Go through all columns, and flip their visibility setting based on whether they are within the unmasked range."," for (var column = 0; column <= 12; column++) {"," var currentColumn = pane.all(\".\" + \"calendar_col\" + column);"," currentColumn.removeClass(CAL_COL_HIDDEN);"," "," if (column < cutoffCol || column >= (cutoffCol + 7)) {"," currentColumn.addClass(CAL_COL_HIDDEN);"," }"," else {"," // Clean up dates in visible columns to account for the correct number of days in a month"," switch(column)"," {"," case 0:"," var curCell = pane.one(\"#\" + paneId + \"_0_30\");"," if (daysInMonth >= 30) {"," curCell.set(\"text\", \"30\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.addClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," break;"," case 1:"," var curCell = pane.one(\"#\" + paneId + \"_1_31\");"," if (daysInMonth >= 31) {"," curCell.set(\"text\", \"31\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 6:"," var curCell = pane.one(\"#\" + paneId + \"_6_29\");"," if (daysInMonth >= 29) {"," curCell.set(\"text\", \"29\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 7:"," var curCell = pane.one(\"#\" + paneId + \"_7_30\");"," if (daysInMonth >= 30) {"," curCell.set(\"text\", \"30\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," case 8:"," var curCell = pane.one(\"#\" + paneId + \"_8_31\");"," if (daysInMonth >= 31) {"," curCell.set(\"text\", \"31\");"," curCell.removeClass(CAL_NEXTMONTH_DAY).addClass(CAL_DAY);"," }"," else {"," curCell.setContent(\" \");"," curCell.removeClass(CAL_DAY).addClass(CAL_NEXTMONTH_DAY);"," }"," break;"," } "," }"," }"," // Update stored pane properties"," this._paneProperties[paneId].cutoffCol = cutoffCol;"," this._paneProperties[paneId].daysInMonth = daysInMonth;"," this._paneProperties[paneId].paneDate = newDate;"," "," // Bring the pane visibility back after all DOM changes are done "," pane.setStyle(\"visibility\", \"visible\");",""," },",""," /**"," * A rendering assist method that updates the calendar header based"," * on a given date and potentially the provided headerRenderer."," * @method _updateCalendarHeader"," * @param {Date} baseDate The date with which to update the calendar header."," * @private"," */ "," _updateCalendarHeader : function (baseDate) {"," var headerString = \"\","," headerRenderer = this.get(\"headerRenderer\");"," "," if (Y.Lang.isString(headerRenderer)) {"," headerString = ydate.format(baseDate, {format:headerRenderer});"," }"," else if (headerRenderer instanceof Function) {"," headerString = headerRenderer.call(this, baseDate);"," }"," "," return headerString; "," },",""," /**"," * A rendering assist method that initializes the calendar header HTML "," * based on a given date and potentially the provided headerRenderer."," * @method _updateCalendarHeader"," * @param {Date} baseDate The date with which to initialize the calendar header."," * @private"," */ "," _initCalendarHeader : function (baseDate) {"," return substitute(substitute(CalendarBase.HEADER_TEMPLATE, "," {calheader: this._updateCalendarHeader(baseDate),"," calendar_id: this._calendarId}), "," CalendarBase.CALENDAR_STRINGS);"," },",""," /**"," * A rendering assist method that initializes the calendar HTML "," * based on a given date."," * @method _initCalendarHTML"," * @param {Date} baseDate The date with which to initialize the calendar."," * @private"," */ "," _initCalendarHTML : function (baseDate) {"," // Instantiate the partials holder"," var partials = {},"," // Counter for iterative template replacement."," counter = 0;"," "," // Generate the template for the header "," partials[\"header_template\"] = this._initCalendarHeader(baseDate);"," partials[\"calendar_id\"] = this._calendarId;",""," partials[\"body_template\"] = substitute(substitute (CalendarBase.CONTENT_TEMPLATE, partials),"," CalendarBase.CALENDAR_STRINGS);"," "," // Instantiate the iterative template replacer function "," function paneReplacer () {"," var singlePane = this._initCalendarPane(ydate.addMonths(baseDate, counter), partials[\"calendar_id\"]+\"_pane_\"+counter);"," counter++;"," return singlePane;"," }"," // Go through all occurrences of the calendar_grid_template token and replace it with an appropriate calendar grid."," var output = partials[\"body_template\"].replace(/\\{calendar_grid_template\\}/g, Y.bind(paneReplacer, this));",""," // Update the paneNumber count"," this._paneNumber = counter;",""," return output;"," }","}, {"," "," /**"," * The CSS classnames for the calendar templates."," * @property CALENDAR_STRINGS"," * @type Object"," * @readOnly"," * @protected"," * @static"," */ "," CALENDAR_STRINGS: {"," calendar_grid_class : CAL_GRID,"," calendar_body_class : CAL_BODY,"," calendar_hd_class : CAL_HD,"," calendar_hd_label_class : CAL_HD_LABEL,"," calendar_weekdayrow_class : CAL_WDAYROW,"," calendar_weekday_class : CAL_WDAY,"," calendar_row_class : CAL_ROW,"," calendar_day_class : CAL_DAY,"," calendar_dayanchor_class : CAL_ANCHOR,"," calendar_pane_class : CAL_PANE,"," calendar_right_grid_class : CAL_RIGHT_GRID,"," calendar_left_grid_class : CAL_LEFT_GRID,"," calendar_status_class : CAL_STATUS"," },",""," /*",""," ARIA_STATUS_TEMPLATE: '<div role=\"status\" aria-atomic=\"true\" class=\"{calendar_status_class}\"></div>',",""," AriaStatus : null,",""," updateStatus : function (statusString) {",""," if (!CalendarBase.AriaStatus) {"," CalendarBase.AriaStatus = create("," substitute (CalendarBase.ARIA_STATUS_TEMPLATE, "," CalendarBase.CALENDAR_STRINGS));"," Y.one(\"body\").append(CalendarBase.AriaStatus);"," }",""," CalendarBase.AriaStatus.set(\"text\", statusString);"," },",""," */",""," /**"," * The main content template for calendar."," * @property CONTENT_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CONTENT_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>',",""," /**"," * A single pane template for calendar (same as default CONTENT_TEMPLATE)"," * @property ONE_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," ONE_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>',",""," /**"," * A two pane template for calendar."," * @property TWO_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," TWO_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1-2\">'+"," '<div class = \"{calendar_left_grid_class}\">' + "," '{calendar_grid_template}' +"," '</div>' +"," '</div>' +"," '<div class=\"yui3-u-1-2\">' +"," '<div class = \"{calendar_right_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' +"," '</div>' + "," '</div>',"," /**"," * A three pane template for calendar."," * @property THREE_PANE_TEMPLATE"," * @type String"," * @protected"," * @readOnly"," * @static"," */ "," THREE_PANE_TEMPLATE: '<div class=\"yui3-g {calendar_pane_class}\" id=\"{calendar_id}\">' + "," '{header_template}' +"," '<div class=\"yui3-u-1-3\">' +"," '<div class = \"{calendar_left_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '</div>' +"," '<div class=\"yui3-u-1-3\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '<div class=\"yui3-u-1-3\">' +"," '<div class = \"{calendar_right_grid_class}\">' +"," '{calendar_grid_template}' +"," '</div>' + "," '</div>' + "," '</div>',"," /**"," * A template for the calendar grid."," * @property CALENDAR_GRID_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALENDAR_GRID_TEMPLATE: '<table class=\"{calendar_grid_class}\" id=\"{calendar_pane_id}\" role=\"grid\" aria-readonly=\"true\" aria-label=\"{pane_arialabel}\" tabindex=\"{calendar_pane_tabindex}\">' + "," '<thead>' +"," '{weekday_row_template}' +"," '</thead>' +"," '<tbody>' + "," '{body_template}' +"," '</tbody>' +"," '</table>',",""," /**"," * A template for the calendar header."," * @property HEADER_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," HEADER_TEMPLATE: '<div class=\"yui3-g {calendar_hd_class}\">' + "," '<div class=\"yui3-u {calendar_hd_label_class}\" id=\"{calendar_id}_header\" aria-role=\"heading\">' + "," '{calheader}' +"," '</div>' +"," '</div>',",""," /**"," * A template for the row of weekday names."," * @property WEEKDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," WEEKDAY_ROW_TEMPLATE: '<tr class=\"{calendar_weekdayrow_class}\" role=\"row\">' + "," '{weekday_row}' +"," '</tr>',",""," /**"," * A template for a single row of calendar days."," * @property CALDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALDAY_ROW_TEMPLATE: '<tr class=\"{calendar_row_class}\" role=\"row\">' + "," '{calday_row}' + "," '</tr>',",""," /**"," * A template for a single cell with a weekday name."," * @property CALDAY_ROW_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," WEEKDAY_TEMPLATE: '<th class=\"{calendar_weekday_class}\" role=\"columnheader\" aria-label=\"{full_weekdayname}\">{weekdayname}</th>',",""," /**"," * A template for a single cell with a calendar day."," * @property CALDAY_TEMPLATE"," * @type String"," * @protected"," * @static"," */ "," CALDAY_TEMPLATE: '<td class=\"{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}\" id=\"{calendar_day_id}\" role=\"gridcell\" tabindex=\"-1\">' +"," '{day_content}' + "," '</td>',",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'calendarBase'"," * @readOnly"," * @protected"," * @static"," */ "," NAME: 'calendarBase',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */ "," ATTRS: {"," tabIndex: {"," value: 1"," },"," /**"," * The date corresponding to the current calendar view. Always"," * normalized to the first of the month that contains the date"," * at assignment time. Used as the first date visible in the"," * calendar."," *"," * @attribute date"," * @type Date"," * @default The first of the month containing today's date, as"," * set on the end user's system."," */"," date: {"," value: new Date(),"," setter: function (val) {"," var newDate = this._normalizeDate(val);"," if (ydate.areEqual(newDate, this.get('date'))) {"," return this.get('date');"," }"," else {"," return newDate;"," }"," }"," },",""," /**"," * A setting specifying whether to shows days from the previous"," * month in the visible month's grid, if there are empty preceding"," * cells available."," *"," * @attribute showPrevMonth"," * @type boolean"," * @default false"," */"," showPrevMonth: {"," value: false"," },",""," /**"," * A setting specifying whether to shows days from the next"," * month in the visible month's grid, if there are empty"," * cells available at the end."," *"," * @attribute showNextMonth"," * @type boolean"," * @default false"," */"," showNextMonth: {"," value: false"," },",""," /**"," * Strings and properties derived from the internationalization packages"," * for the calendar."," *"," * @attribute strings"," * @type Object"," * @protected"," */"," strings : {"," valueFn: function() { return Y.Intl.get(\"calendar-base\"); }"," },",""," /**"," * Custom header renderer for the calendar."," *"," * @attribute headerRenderer"," * @type String | Function"," */"," headerRenderer: {"," value: \"%B %Y\""," },",""," /**"," * The name of the rule which all enabled dates should match."," * Either disabledDatesRule or enabledDatesRule should be specified,"," * or neither, but not both."," *"," * @attribute enabledDatesRule"," * @type String"," * @default null"," */"," enabledDatesRule: {"," value: null"," },",""," /**"," * The name of the rule which all disabled dates should match."," * Either disabledDatesRule or enabledDatesRule should be specified,"," * or neither, but not both."," *"," * @attribute disabledDatesRule"," * @type String"," * @default null"," */"," disabledDatesRule: {"," value: null"," },",""," /**"," * A read-only attribute providing a list of currently selected dates."," *"," * @attribute selectedDates"," * @readOnly"," * @type Array"," */"," selectedDates : {"," readOnly: true,"," getter: function (val) {"," return (this._getSelectedDatesList());"," }"," },",""," /**"," * An object of the form {rules:Object, filterFunction:Function},"," * providing set of rules and a custom rendering function for "," * customizing specific calendar cells."," *"," * @attribute customRenderer"," * @readOnly"," * @type Object"," * @default {}"," */"," customRenderer : {"," lazyAdd: false,"," value: {},"," setter: function (val) {"," this._rules = val.rules;"," this._filterFunction = val.filterFunction;"," }"," }"," }"," ","});","","","}, '3.7.3', {\"requires\": [\"widget\", \"substitute\", \"datatype-date\", \"datatype-date-math\", \"cssgrids\"], \"lang\": [\"de\", \"en\", \"fr\", \"ja\", \"nb-NO\", \"pt-BR\", \"ru\", \"zh-HANT-TW\"], \"skinnable\": true});"]; _yuitest_coverage["build/calendar-base/calendar-base.js"].lines = {"1":0,"12":0,"55":0,"56":0,"61":0,"144":0,"145":0,"146":0,"147":0,"148":0,"150":0,"161":0,"162":0,"163":0,"164":0,"166":0,"167":0,"169":0,"170":0,"172":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"205":0,"206":0,"207":0,"208":0,"209":0,"213":0,"226":0,"229":0,"230":0,"233":0,"251":0,"252":0,"255":0,"258":0,"259":0,"260":0,"261":0,"263":0,"264":0,"267":0,"282":0,"290":0,"291":0,"292":0,"293":0,"296":0,"297":0,"298":0,"299":0,"302":0,"303":0,"304":0,"305":0,"308":0,"309":0,"310":0,"311":0,"324":0,"339":0,"352":0,"355":0,"356":0,"358":0,"359":0,"362":0,"372":0,"373":0,"375":0,"376":0,"388":0,"389":0,"391":0,"392":0,"394":0,"395":0,"410":0,"412":0,"416":0,"417":0,"418":0,"421":0,"422":0,"426":0,"427":0,"428":0,"431":0,"433":0,"434":0,"446":0,"447":0,"459":0,"463":0,"464":0,"465":0,"466":0,"469":0,"473":0,"474":0,"475":0,"476":0,"478":0,"491":0,"494":0,"497":0,"498":0,"499":0,"511":0,"512":0,"523":0,"526":0,"527":0,"530":0,"541":0,"542":0,"543":0,"544":0,"561":0,"570":0,"572":0,"573":0,"574":0,"586":0,"588":0,"589":0,"592":0,"593":0,"594":0,"595":0,"596":0,"597":0,"598":0,"599":0,"600":0,"603":0,"604":0,"605":0,"608":0,"609":0,"610":0,"624":0,"626":0,"627":0,"628":0,"629":0,"630":0,"646":0,"653":0,"655":0,"656":0,"659":0,"661":0,"663":0,"664":0,"666":0,"667":0,"670":0,"672":0,"674":0,"675":0,"678":0,"680":0,"682":0,"683":0,"686":0,"688":0,"690":0,"691":0,"694":0,"696":0,"698":0,"699":0,"702":0,"704":0,"706":0,"720":0,"724":0,"728":0,"750":0,"751":0,"754":0,"770":0,"771":0,"772":0,"786":0,"790":0,"791":0,"794":0,"796":0,"798":0,"800":0,"817":0,"818":0,"820":0,"822":0,"834":0,"835":0,"836":0,"837":0,"838":0,"839":0,"851":0,"856":0,"858":0,"861":0,"862":0,"863":0,"865":0,"866":0,"869":0,"870":0,"883":0,"887":0,"889":0,"892":0,"893":0,"894":0,"896":0,"897":0,"900":0,"901":0,"912":0,"914":0,"917":0,"918":0,"922":0,"933":0,"936":0,"937":0,"941":0,"952":0,"953":0,"962":0,"963":0,"975":0,"981":0,"982":0,"984":0,"986":0,"987":0,"991":0,"992":0,"994":0,"995":0,"997":0,"1013":0,"1029":0,"1032":0,"1033":0,"1040":0,"1043":0,"1045":0,"1048":0,"1051":0,"1054":0,"1056":0,"1057":0,"1059":0,"1060":0,"1064":0,"1065":0,"1069":0,"1072":0,"1082":0,"1085":0,"1086":0,"1091":0,"1094":0,"1095":0,"1099":0,"1104":0,"1106":0,"1121":0,"1130":0,"1131":0,"1134":0,"1135":0,"1136":0,"1138":0,"1139":0,"1143":0,"1146":0,"1147":0,"1148":0,"1149":0,"1152":0,"1153":0,"1155":0,"1157":0,"1158":0,"1159":0,"1160":0,"1163":0,"1164":0,"1166":0,"1168":0,"1169":0,"1170":0,"1171":0,"1174":0,"1175":0,"1177":0,"1179":0,"1180":0,"1181":0,"1182":0,"1185":0,"1186":0,"1188":0,"1190":0,"1191":0,"1192":0,"1193":0,"1196":0,"1197":0,"1199":0,"1204":0,"1205":0,"1206":0,"1209":0,"1221":0,"1224":0,"1225":0,"1227":0,"1228":0,"1231":0,"1242":0,"1257":0,"1262":0,"1263":0,"1265":0,"1269":0,"1270":0,"1271":0,"1272":0,"1275":0,"1278":0,"1280":0,"1512":0,"1513":0,"1514":0,"1517":0,"1557":0,"1606":0,"1624":0,"1625":0}; _yuitest_coverage["build/calendar-base/calendar-base.js"].functions = {"CalendarBase:55":0,"initializer:143":0,"renderUI:159":0,"bindUI:182":0,"(anonymous 4):208":0,"(anonymous 3):207":0,"(anonymous 2):206":0,"_getSelectedDatesList:204":0,"_getSelectedDatesInMonth:225":0,"_isNumInList:250":0,"_getRulesForDate:281":0,"_matchesRule:338":0,"_canBeSelected:350":0,"selectDates:371":0,"deselectDates:387":0,"_addDateToSelection:408":0,"_addDatesToSelection:445":0,"_addDateRangeToSelection:457":0,"_removeDateFromSelection:490":0,"_removeDatesFromSelection:510":0,"_removeDateRangeFromSelection:522":0,"_clearSelection:540":0,"_fireSelectionChange:553":0,"_restoreModifiedCells:569":0,"(anonymous 5):595":0,"_renderCustomRules:584":0,"(anonymous 6):629":0,"_renderSelectedDates:623":0,"_dateToNode:645":0,"_nodeToDate:718":0,"_normalizeDate:749":0,"_getCutoffColumn:768":0,"_turnPrevMonthOn:784":0,"_turnPrevMonthOff:816":0,"_cleanUpNextMonthCells:833":0,"_turnNextMonthOn:850":0,"_turnNextMonthOff:882":0,"_afterShowNextMonthChange:910":0,"_afterShowPrevMonthChange:932":0,"_afterHeaderRendererChange:951":0,"_afterCustomRendererChange:961":0,"(anonymous 7):986":0,"_afterDateChange:973":0,"(anonymous 8):1085":0,"_initCalendarPane:1011":0,"_rerenderCalendarPane:1118":0,"_updateCalendarHeader:1220":0,"_initCalendarHeader:1241":0,"paneReplacer:1269":0,"_initCalendarHTML:1255":0,"setter:1511":0,"valueFn:1557":0,"getter:1605":0,"setter:1623":0,"(anonymous 1):1":0}; _yuitest_coverage["build/calendar-base/calendar-base.js"].coveredLines = 355;@@ -2079,4 +2079,4 @@ }); -}, '3.7.2', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
bundle/calendar-base/calendar-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1636,4 +1636,4 @@ }); -}, '3.7.2', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
bundle/calendar-base/calendar-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("calendar-base",function(e,t){function P(e){P.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=n(r,"grid"),s=n(r,"left-grid"),o=n(r,"right-grid"),u=n(r,"body"),a=n(r,"header"),f=n(r,"header-label"),l=n(r,"weekdayrow"),c=n(r,"weekday"),h=n(r,"column-hidden"),p=n(r,"day-selected"),d=n(r,"selection-disabled"),v=n(r,"row"),m=n(r,"day"),g=n(r,"prevmonth-day"),y=n(r,"nextmonth-day"),b=n(r,"anchor"),w=n(r,"pane"),E=n(r,"status"),S=e.Lang,x=e.Node,T=x.create,N=e.substitute,C=e.each,k=e.Array.hasValue,L=e.Array.indexOf,A=e.Object.hasKey,O=e.Object.setValue,M=e.Object.owns,_=e.Object.isEmpty,D=e.DataType.Date;e.CalendarBase=e.extend(P,e.Widget,{_paneProperties:{},_paneNumber:1,_calendarId:null,_selectedDates:{},_rules:{},_filterFunction:null,_storedDateCells:{},initializer:function(){this._paneProperties={},this._calendarId=e.guid("calendar"),this._selectedDates={},_(this._rules)&&(this._rules={}),this._storedDateCells={}},renderUI:function(){var e=this.get("contentBox");e.appendChild(this._initCalendarHTML(this.get("date"))),this.get("showPrevMonth")&&this._afterShowPrevMonthChange(),this.get("showNextMonth")&&this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),this.get("boundingBox").setAttribute("aria-labelledby",this._calendarId+"_header")},bindUI:function(){this.after("dateChange",this._afterDateChange),this.after("showPrevMonthChange",this._afterShowPrevMonthChange),this.after("showNextMonthChange",this._afterShowNextMonthChange),this.after("headerRendererChange",this._afterHeaderRendererChange),this.after("customRendererChange",this._afterCustomRendererChange),this.after("enabledDatesRuleChange",this._afterCustomRendererChange),this.after("disabledDatesRuleChange",this._afterCustomRendererChange),this.after("focusedChange",this._afterFocusedChange),this.after("selectionChange",this._renderSelectedDates),this._bindCalendarEvents()},_getSelectedDatesList:function(){var e=[];return C(this._selectedDates,function(t){C(t,function(t){C(t,function(t){e.push(t)},this)},this)},this),e},_getSelectedDatesInMonth:function(t){var n=t.getFullYear(),r=t.getMonth();return A(this._selectedDates,n)&&A(this._selectedDates[n],r)?e.Object.values(this._selectedDates[n][r]):[]},_isNumInList:function(e,t){if(t=="all")return!0;var n=t.split(","),r=n.length;while(r--){var i=n[r].split("-");if(i.length==2&&e>=parseInt(i[0],10)&&e<=parseInt(i[1],10))return!0;if(i.length==1&&parseInt(n[r],10)==e)return!0}return!1},_getRulesForDate:function(e){var t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=e.getDay(),s=this._rules,o=[],u,a,f,l;for(u in s)if(this._isNumInList(t,u))if(S.isString(s[u]))o.push(s[u]);else for(a in s[u])if(this._isNumInList(n,a))if(S.isString(s[u][a]))o.push(s[u][a]);else for(f in s[u][a])if(this._isNumInList(r,f))if(S.isString(s[u][a][f]))o.push(s[u][a][f]);else for(l in s[u][a][f])this._isNumInList(i,l)&&S.isString(s[u][a][f][l])&&o.push(s[u][a][f][l]);return o},_matchesRule:function(e,t){return L(this._getRulesForDate(e),t)>=0},_canBeSelected:function(e){var t=this.get("enabledDatesRule"),n=this.get("disabledDatesRule");return t?this._matchesRule(e,t):n?!this._matchesRule(e,n):!0},selectDates:function(e){D.isValidDate(e)?this._addDateToSelection(e):S.isArray(e)&&this._addDatesToSelection(e)},deselectDates:function(e){e?D.isValidDate(e)?this._removeDateFromSelection(e):S.isArray(e)&&this._removeDatesFromSelection(e):this._clearSelection()},_addDateToSelection:function(e,t){if(this._canBeSelected(e)){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();A(this._selectedDates,n)?A(this._selectedDates[n],r)?this._selectedDates[n][r][i]=e:(this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e):(this._selectedDates[n]={},this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e),this._selectedDates=O(this._selectedDates,[n,r,i],e),t||this._fireSelectionChange()}},_addDatesToSelection:function(e){C(e,this._addDateToSelection,this),this._fireSelectionChange()},_addDateRangeToSelection:function(e,t){var n=(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4,r=e.getTime(),i=t.getTime();if(r>i){var s=r;r=i,i=s+n}else i-=n;for(var o=r;o<=i;o+=864e5){var u=new Date(o);u.setHours(12),this._addDateToSelection(u,o)}this._fireSelectionChange()},_removeDateFromSelection:function(e,t){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();A(this._selectedDates,n)&&A(this._selectedDates[n],r)&&A(this._selectedDates[n][r],i)&&(delete this._selectedDates[n][r][i],t||this._fireSelectionChange())},_removeDatesFromSelection:function(e){C(e,this._removeDateFromSelection,this),this._fireSelectionChange()},_removeDateRangeFromSelection:function(e,t){var n=e.getTime(),r=t.getTime();for(var i=n;i<=r;i+=864e5)this._removeDateFromSelection(new Date(i),i);this._fireSelectionChange()},_clearSelection:function(e){this._selectedDates={},this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1),e||this._fireSelectionChange()},_fireSelectionChange:function(){this.fire("selectionChange",{newSelection:this._getSelectedDatesList()})},_restoreModifiedCells:function(){var e=this.get("contentBox"),t;for(t in this._storedDateCells)e.one("#"+t).replace(this._storedDateCells[t]),delete this._storedDateCells[t]},_renderCustomRules:function(){this.get("contentBox").all("."+m+",."+y).removeClass(d).setAttribute("aria-disabled",!1);if(!_(this._rules)){var e=this.get("enabledDatesRule"),t=this.get("disabledDatesRule");for(var n=0;n<this._paneNumber;n++){var r=D.addMonths(this.get("date"),n),i=D.listOfDatesInMonth(r);C(i,function(n){var r=this._getRulesForDate(n);if(r.length>0){var i=this._dateToNode(n);(e&&L(r,e)<0||!e&&t&&L(r,t)>=0)&&i.addClass(d).setAttribute("aria-disabled",!0),S.isFunction(this._filterFunction)&&(this._storedDateCells[i.get("id")]=i.cloneNode(!0),this._filterFunction(n,i,r))}else if(e){var i=this._dateToNode(n);i.addClass(d).setAttribute("aria-disabled",!0)}},this)}}},_renderSelectedDates:function(){this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1);for(var e=0;e<this._paneNumber;e++){var t=D.addMonths(this.get("date"),e),n=this._getSelectedDatesInMonth(t);C(n,function(e){this._dateToNode(e).addClass(p).setAttribute("aria-selected",!0)},this)}},_dateToNode:function(e){var t=e.getDate(),n=0,r=t%7,i=(12+e.getMonth()-this.get("date").getMonth())%12,s=this._calendarId+"_pane_"+i,o=this._paneProperties[s].cutoffCol;switch(r){case 0:o>=6?n=12:n=5;break;case 1:n=6;break;case 2:o>0?n=7:n=0;break;case 3:o>1?n=8:n=1;break;case 4:o>2?n=9:n=2;break;case 5:o>3?n=10:n=3;break;case 6:o>4?n=11:n=4}return this.get("contentBox").one("#"+this._calendarId+"_pane_"+i+"_"+n+"_"+t)},_nodeToDate:function(e){var t=e.get("id").split("_").reverse(),n=parseInt(t[2],10),r=parseInt(t[0],10),i=D.addMonths(this.get("date"),n),s=i.getFullYear(),o=i.getMonth();return new Date(s,o,r,12,0,0,0)},_bindCalendarEvents:function(){},_normalizeDate:function(e){return e?new Date(e.getFullYear(),e.getMonth(),1,12,0,0,0):null},_getCutoffColumn:function(e,t){var n=this._normalizeDate(e).getDay()-t,r=6-(n+7)%7;return r},_turnPrevMonthOn:function(e){var t=e.get("id"),n=this._paneProperties[t].paneDate,r=D.daysInMonth(D.addMonths(n,-1));this._paneProperties[t].hasOwnProperty("daysInPrevMonth")||(this._paneProperties[t].daysInPrevMonth=0);if(r!=this._paneProperties[t].daysInPrevMonth){this._paneProperties[t].daysInPrevMonth=r;for(var i=5;i>=0;i--)e.one("#"+t+"_"+i+"_"+(i-5)).set("text",r--)}},_turnPrevMonthOff:function(e){var t=e.get("id");this._paneProperties[t].daysInPrevMonth=0;for(var n=5;n>=0;n--)e.one("#"+t+"_"+n+"_"+(n-5)).setContent(" ")},_cleanUpNextMonthCells:function(e){var t=e.get("id");e.one("#"+t+"_6_29").removeClass(y),e.one("#"+t+"_7_30").removeClass(y),e.one("#"+t+"_8_31").removeClass(y),e.one("#"+t+"_0_30").removeClass(y),e.one("#"+t+"_1_31").removeClass(y)},_turnNextMonthOn:function(e){var t=1,n=e.get("id"),r=this._paneProperties[n].daysInMonth,i=this._paneProperties[n].cutoffCol;for(var s=r-22;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+23)).set("text",t++).addClass(y);var o=i;r==31&&i<=1?o=2:r==30&&i===0&&(o=1);for(var s=o;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+30)).set("text",t++).addClass(y)},_turnNextMonthOff:function(e){var t=e.get("id"),n=this._paneProperties[t].daysInMonth,r=this._paneProperties[t].cutoffCol;for(var i=n-22;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+23)).setContent(" ").addClass(y);var s=0;n==31&&r<=1?s=2:n==30&&r===0&&(s=1);for(var i=s;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+30)).setContent(" ").addClass(y)},_afterShowNextMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+(this._paneNumber-1));this._cleanUpNextMonthCells(t),this.get("showNextMonth")?this._turnNextMonthOn(t):this._turnNextMonthOff(t)},_afterShowPrevMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+0);this.get("showPrevMonth")?this._turnPrevMonthOn(t):this._turnPrevMonthOff(t)},_afterHeaderRendererChange:function(){var e=this.get("contentBox").one("."+f);e.setContent(this._updateCalendarHeader(this.get("date")))},_afterCustomRendererChange:function(){this._restoreModifiedCells(),this._renderCustomRules()},_afterDateChange:function(){var e=this.get("contentBox"),t=e.one("."+a).one("."+f),n=e.all("."+i),r=this.get("date"),s=0;e.setStyle("visibility","hidden"),t.setContent(this._updateCalendarHeader(r)),this._restoreModifiedCells(),n.each(function(e){this._rerenderCalendarPane(D.addMonths(r,s++),e)},this),this._afterShowPrevMonthChange(),this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),e.setStyle("visibility","visible")},_initCalendarPane:function(e,t){var n="",r=this.get("strings.very_short_weekdays")||["Su","Mo","Tu","We","Th","Fr","Sa"],i=this.get("strings.weekdays")||["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s=this.get("strings.first_weekday")||0,o=this._getCutoffColumn(e,s),u=D.daysInMonth(e),a=["","","","","",""],f={};f.weekday_row="";for(var l=s;l<=s+6;l++)f.weekday_row+=N(P.WEEKDAY_TEMPLATE,{weekdayname:r[l%7],full_weekdayname:i[l%7]});f.weekday_row_template=N(P.WEEKDAY_ROW_TEMPLATE,f);for(var c=0;c<=5;c++)for(var p=0;p<=12;p++){var d=7*c-5+p,v=t+"_"+p+"_"+d,b=m;d<1?b=g:d>u&&(b=y);if(d<1||d>u)d=" ";var w=p>=o&&p<o+7?"":h;a[c]+=N(P.CALDAY_TEMPLATE,{day_content:d,calendar_col_class:"calendar_col"+p,calendar_col_visibility_class:w,calendar_day_class:b,calendar_day_id:v})}f.body_template="",C(a,function(e){f.body_template+=N(P.CALDAY_ROW_TEMPLATE,{calday_row:e})}),f.calendar_pane_id=t,f.calendar_pane_tabindex=this.get("tabIndex"),f.pane_arialabel=D.format(e,{format:"%B %Y"});var E=N(N(P.CALENDAR_GRID_TEMPLATE,f),P.CALENDAR_STRINGS);return this._paneProperties[t]={cutoffCol:o,daysInMonth:u,paneDate:e},E},_rerenderCalendarPane:function(e,t){var n=this.get("strings.first_weekday")||0,r=this._getCutoffColumn(e,n),i=D.daysInMonth(e),s=t.get("id");t.setStyle("visibility","hidden"),t.setAttribute("aria-label",D.format(e,{format:"%B %Y"}));for(var o=0;o<=12;o++){var u=t.all(".calendar_col"+o);u.removeClass(h);if(o<r||o>=r+7)u.addClass(h);else switch(o){case 0:var a=t.one("#"+s+"_0_30");i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.addClass(y).addClass(m));break;case 1:var a=t.one("#"+s+"_1_31");i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 6:var a=t.one("#"+s+"_6_29");i>=29?(a.set("text","29"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 7:var a=t.one("#"+s+"_7_30");i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 8:var a=t.one("#"+s+"_8_31");i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y))}}this._paneProperties[s].cutoffCol=r,this._paneProperties[s].daysInMonth=i,this._paneProperties[s].paneDate=e,t.setStyle("visibility","visible")},_updateCalendarHeader:function(t){var n="",r=this.get("headerRenderer");return e.Lang.isString(r)?n=D.format(t,{format:r}):r instanceof Function&&(n=r.call(this,t)),n},_initCalendarHeader:function(e){return N(N(P.HEADER_TEMPLATE,{calheader:this._updateCalendarHeader(e),calendar_id:this._calendarId}),P.CALENDAR_STRINGS)},_initCalendarHTML:function(t){function i(){var e=this._initCalendarPane(D.addMonths(t,r),n.calendar_id+"_pane_"+r);return r++,e}var n={},r=0;n.header_template=this._initCalendarHeader(t),n.calendar_id=this._calendarId,n.body_template=N(N(P.CONTENT_TEMPLATE,n),P.CALENDAR_STRINGS);var s=n.body_template.replace(/\{calendar_grid_template\}/g,e.bind(i,this));return this._paneNumber=r,s}},{CALENDAR_STRINGS:{calendar_grid_class:i,calendar_body_class:u,calendar_hd_class:a,calendar_hd_label_class:f,calendar_weekdayrow_class:l,calendar_weekday_class:c,calendar_row_class:v,calendar_day_class:m,calendar_dayanchor_class:b,calendar_pane_class:w,calendar_right_grid_class:o,calendar_left_grid_class:s,calendar_status_class:E},CONTENT_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',ONE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',TWO_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-2"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-2"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',THREE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-3"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-3">{calendar_grid_template}</div><div class="yui3-u-1-3"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',CALENDAR_GRID_TEMPLATE:'<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}"><thead>{weekday_row_template}</thead><tbody>{body_template}</tbody></table>',HEADER_TEMPLATE:'<div class="yui3-g {calendar_hd_class}"><div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">{calheader}</div></div>',WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}" role="row">{weekday_row}</tr>',CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}" role="row">{calday_row}</tr>',WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}" role="columnheader" aria-label="{full_weekdayname}">{weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">{day_content}</td>',NAME:"calendarBase",ATTRS:{tabIndex:{value:1},date:{value:new Date,setter:function(e){var t=this._normalizeDate(e);return D.areEqual(t,this.get("date"))?this.get("date"):t}},showPrevMonth:{value:!1},showNextMonth:{value:!1},strings:{valueFn:function(){return e.Intl.get("calendar-base")}},headerRenderer:{value:"%B %Y"},enabledDatesRule:{value:null},disabledDatesRule:{value:null},selectedDates:{readOnly:!0,getter:function(e){return this._getSelectedDatesList()}},customRenderer:{lazyAdd:!1,value:{},setter:function(e){this._rules=e.rules,this._filterFunction=e.filterFunction}}}})},"3.7.2",{requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],skinnable:!0});+YUI.add("calendar-base",function(e,t){function P(e){P.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=n(r,"grid"),s=n(r,"left-grid"),o=n(r,"right-grid"),u=n(r,"body"),a=n(r,"header"),f=n(r,"header-label"),l=n(r,"weekdayrow"),c=n(r,"weekday"),h=n(r,"column-hidden"),p=n(r,"day-selected"),d=n(r,"selection-disabled"),v=n(r,"row"),m=n(r,"day"),g=n(r,"prevmonth-day"),y=n(r,"nextmonth-day"),b=n(r,"anchor"),w=n(r,"pane"),E=n(r,"status"),S=e.Lang,x=e.Node,T=x.create,N=e.substitute,C=e.each,k=e.Array.hasValue,L=e.Array.indexOf,A=e.Object.hasKey,O=e.Object.setValue,M=e.Object.owns,_=e.Object.isEmpty,D=e.DataType.Date;e.CalendarBase=e.extend(P,e.Widget,{_paneProperties:{},_paneNumber:1,_calendarId:null,_selectedDates:{},_rules:{},_filterFunction:null,_storedDateCells:{},initializer:function(){this._paneProperties={},this._calendarId=e.guid("calendar"),this._selectedDates={},_(this._rules)&&(this._rules={}),this._storedDateCells={}},renderUI:function(){var e=this.get("contentBox");e.appendChild(this._initCalendarHTML(this.get("date"))),this.get("showPrevMonth")&&this._afterShowPrevMonthChange(),this.get("showNextMonth")&&this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),this.get("boundingBox").setAttribute("aria-labelledby",this._calendarId+"_header")},bindUI:function(){this.after("dateChange",this._afterDateChange),this.after("showPrevMonthChange",this._afterShowPrevMonthChange),this.after("showNextMonthChange",this._afterShowNextMonthChange),this.after("headerRendererChange",this._afterHeaderRendererChange),this.after("customRendererChange",this._afterCustomRendererChange),this.after("enabledDatesRuleChange",this._afterCustomRendererChange),this.after("disabledDatesRuleChange",this._afterCustomRendererChange),this.after("focusedChange",this._afterFocusedChange),this.after("selectionChange",this._renderSelectedDates),this._bindCalendarEvents()},_getSelectedDatesList:function(){var e=[];return C(this._selectedDates,function(t){C(t,function(t){C(t,function(t){e.push(t)},this)},this)},this),e},_getSelectedDatesInMonth:function(t){var n=t.getFullYear(),r=t.getMonth();return A(this._selectedDates,n)&&A(this._selectedDates[n],r)?e.Object.values(this._selectedDates[n][r]):[]},_isNumInList:function(e,t){if(t=="all")return!0;var n=t.split(","),r=n.length;while(r--){var i=n[r].split("-");if(i.length==2&&e>=parseInt(i[0],10)&&e<=parseInt(i[1],10))return!0;if(i.length==1&&parseInt(n[r],10)==e)return!0}return!1},_getRulesForDate:function(e){var t=e.getFullYear(),n=e.getMonth(),r=e.getDate(),i=e.getDay(),s=this._rules,o=[],u,a,f,l;for(u in s)if(this._isNumInList(t,u))if(S.isString(s[u]))o.push(s[u]);else for(a in s[u])if(this._isNumInList(n,a))if(S.isString(s[u][a]))o.push(s[u][a]);else for(f in s[u][a])if(this._isNumInList(r,f))if(S.isString(s[u][a][f]))o.push(s[u][a][f]);else for(l in s[u][a][f])this._isNumInList(i,l)&&S.isString(s[u][a][f][l])&&o.push(s[u][a][f][l]);return o},_matchesRule:function(e,t){return L(this._getRulesForDate(e),t)>=0},_canBeSelected:function(e){var t=this.get("enabledDatesRule"),n=this.get("disabledDatesRule");return t?this._matchesRule(e,t):n?!this._matchesRule(e,n):!0},selectDates:function(e){D.isValidDate(e)?this._addDateToSelection(e):S.isArray(e)&&this._addDatesToSelection(e)},deselectDates:function(e){e?D.isValidDate(e)?this._removeDateFromSelection(e):S.isArray(e)&&this._removeDatesFromSelection(e):this._clearSelection()},_addDateToSelection:function(e,t){if(this._canBeSelected(e)){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();A(this._selectedDates,n)?A(this._selectedDates[n],r)?this._selectedDates[n][r][i]=e:(this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e):(this._selectedDates[n]={},this._selectedDates[n][r]={},this._selectedDates[n][r][i]=e),this._selectedDates=O(this._selectedDates,[n,r,i],e),t||this._fireSelectionChange()}},_addDatesToSelection:function(e){C(e,this._addDateToSelection,this),this._fireSelectionChange()},_addDateRangeToSelection:function(e,t){var n=(t.getTimezoneOffset()-e.getTimezoneOffset())*6e4,r=e.getTime(),i=t.getTime();if(r>i){var s=r;r=i,i=s+n}else i-=n;for(var o=r;o<=i;o+=864e5){var u=new Date(o);u.setHours(12),this._addDateToSelection(u,o)}this._fireSelectionChange()},_removeDateFromSelection:function(e,t){var n=e.getFullYear(),r=e.getMonth(),i=e.getDate();A(this._selectedDates,n)&&A(this._selectedDates[n],r)&&A(this._selectedDates[n][r],i)&&(delete this._selectedDates[n][r][i],t||this._fireSelectionChange())},_removeDatesFromSelection:function(e){C(e,this._removeDateFromSelection,this),this._fireSelectionChange()},_removeDateRangeFromSelection:function(e,t){var n=e.getTime(),r=t.getTime();for(var i=n;i<=r;i+=864e5)this._removeDateFromSelection(new Date(i),i);this._fireSelectionChange()},_clearSelection:function(e){this._selectedDates={},this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1),e||this._fireSelectionChange()},_fireSelectionChange:function(){this.fire("selectionChange",{newSelection:this._getSelectedDatesList()})},_restoreModifiedCells:function(){var e=this.get("contentBox"),t;for(t in this._storedDateCells)e.one("#"+t).replace(this._storedDateCells[t]),delete this._storedDateCells[t]},_renderCustomRules:function(){this.get("contentBox").all("."+m+",."+y).removeClass(d).setAttribute("aria-disabled",!1);if(!_(this._rules)){var e=this.get("enabledDatesRule"),t=this.get("disabledDatesRule");for(var n=0;n<this._paneNumber;n++){var r=D.addMonths(this.get("date"),n),i=D.listOfDatesInMonth(r);C(i,function(n){var r=this._getRulesForDate(n);if(r.length>0){var i=this._dateToNode(n);(e&&L(r,e)<0||!e&&t&&L(r,t)>=0)&&i.addClass(d).setAttribute("aria-disabled",!0),S.isFunction(this._filterFunction)&&(this._storedDateCells[i.get("id")]=i.cloneNode(!0),this._filterFunction(n,i,r))}else if(e){var i=this._dateToNode(n);i.addClass(d).setAttribute("aria-disabled",!0)}},this)}}},_renderSelectedDates:function(){this.get("contentBox").all("."+p).removeClass(p).setAttribute("aria-selected",!1);for(var e=0;e<this._paneNumber;e++){var t=D.addMonths(this.get("date"),e),n=this._getSelectedDatesInMonth(t);C(n,function(e){this._dateToNode(e).addClass(p).setAttribute("aria-selected",!0)},this)}},_dateToNode:function(e){var t=e.getDate(),n=0,r=t%7,i=(12+e.getMonth()-this.get("date").getMonth())%12,s=this._calendarId+"_pane_"+i,o=this._paneProperties[s].cutoffCol;switch(r){case 0:o>=6?n=12:n=5;break;case 1:n=6;break;case 2:o>0?n=7:n=0;break;case 3:o>1?n=8:n=1;break;case 4:o>2?n=9:n=2;break;case 5:o>3?n=10:n=3;break;case 6:o>4?n=11:n=4}return this.get("contentBox").one("#"+this._calendarId+"_pane_"+i+"_"+n+"_"+t)},_nodeToDate:function(e){var t=e.get("id").split("_").reverse(),n=parseInt(t[2],10),r=parseInt(t[0],10),i=D.addMonths(this.get("date"),n),s=i.getFullYear(),o=i.getMonth();return new Date(s,o,r,12,0,0,0)},_bindCalendarEvents:function(){},_normalizeDate:function(e){return e?new Date(e.getFullYear(),e.getMonth(),1,12,0,0,0):null},_getCutoffColumn:function(e,t){var n=this._normalizeDate(e).getDay()-t,r=6-(n+7)%7;return r},_turnPrevMonthOn:function(e){var t=e.get("id"),n=this._paneProperties[t].paneDate,r=D.daysInMonth(D.addMonths(n,-1));this._paneProperties[t].hasOwnProperty("daysInPrevMonth")||(this._paneProperties[t].daysInPrevMonth=0);if(r!=this._paneProperties[t].daysInPrevMonth){this._paneProperties[t].daysInPrevMonth=r;for(var i=5;i>=0;i--)e.one("#"+t+"_"+i+"_"+(i-5)).set("text",r--)}},_turnPrevMonthOff:function(e){var t=e.get("id");this._paneProperties[t].daysInPrevMonth=0;for(var n=5;n>=0;n--)e.one("#"+t+"_"+n+"_"+(n-5)).setContent(" ")},_cleanUpNextMonthCells:function(e){var t=e.get("id");e.one("#"+t+"_6_29").removeClass(y),e.one("#"+t+"_7_30").removeClass(y),e.one("#"+t+"_8_31").removeClass(y),e.one("#"+t+"_0_30").removeClass(y),e.one("#"+t+"_1_31").removeClass(y)},_turnNextMonthOn:function(e){var t=1,n=e.get("id"),r=this._paneProperties[n].daysInMonth,i=this._paneProperties[n].cutoffCol;for(var s=r-22;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+23)).set("text",t++).addClass(y);var o=i;r==31&&i<=1?o=2:r==30&&i===0&&(o=1);for(var s=o;s<i+7;s++)e.one("#"+n+"_"+s+"_"+(s+30)).set("text",t++).addClass(y)},_turnNextMonthOff:function(e){var t=e.get("id"),n=this._paneProperties[t].daysInMonth,r=this._paneProperties[t].cutoffCol;for(var i=n-22;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+23)).setContent(" ").addClass(y);var s=0;n==31&&r<=1?s=2:n==30&&r===0&&(s=1);for(var i=s;i<=12;i++)e.one("#"+t+"_"+i+"_"+(i+30)).setContent(" ").addClass(y)},_afterShowNextMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+(this._paneNumber-1));this._cleanUpNextMonthCells(t),this.get("showNextMonth")?this._turnNextMonthOn(t):this._turnNextMonthOff(t)},_afterShowPrevMonthChange:function(){var e=this.get("contentBox"),t=e.one("#"+this._calendarId+"_pane_"+0);this.get("showPrevMonth")?this._turnPrevMonthOn(t):this._turnPrevMonthOff(t)},_afterHeaderRendererChange:function(){var e=this.get("contentBox").one("."+f);e.setContent(this._updateCalendarHeader(this.get("date")))},_afterCustomRendererChange:function(){this._restoreModifiedCells(),this._renderCustomRules()},_afterDateChange:function(){var e=this.get("contentBox"),t=e.one("."+a).one("."+f),n=e.all("."+i),r=this.get("date"),s=0;e.setStyle("visibility","hidden"),t.setContent(this._updateCalendarHeader(r)),this._restoreModifiedCells(),n.each(function(e){this._rerenderCalendarPane(D.addMonths(r,s++),e)},this),this._afterShowPrevMonthChange(),this._afterShowNextMonthChange(),this._renderCustomRules(),this._renderSelectedDates(),e.setStyle("visibility","visible")},_initCalendarPane:function(e,t){var n="",r=this.get("strings.very_short_weekdays")||["Su","Mo","Tu","We","Th","Fr","Sa"],i=this.get("strings.weekdays")||["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],s=this.get("strings.first_weekday")||0,o=this._getCutoffColumn(e,s),u=D.daysInMonth(e),a=["","","","","",""],f={};f.weekday_row="";for(var l=s;l<=s+6;l++)f.weekday_row+=N(P.WEEKDAY_TEMPLATE,{weekdayname:r[l%7],full_weekdayname:i[l%7]});f.weekday_row_template=N(P.WEEKDAY_ROW_TEMPLATE,f);for(var c=0;c<=5;c++)for(var p=0;p<=12;p++){var d=7*c-5+p,v=t+"_"+p+"_"+d,b=m;d<1?b=g:d>u&&(b=y);if(d<1||d>u)d=" ";var w=p>=o&&p<o+7?"":h;a[c]+=N(P.CALDAY_TEMPLATE,{day_content:d,calendar_col_class:"calendar_col"+p,calendar_col_visibility_class:w,calendar_day_class:b,calendar_day_id:v})}f.body_template="",C(a,function(e){f.body_template+=N(P.CALDAY_ROW_TEMPLATE,{calday_row:e})}),f.calendar_pane_id=t,f.calendar_pane_tabindex=this.get("tabIndex"),f.pane_arialabel=D.format(e,{format:"%B %Y"});var E=N(N(P.CALENDAR_GRID_TEMPLATE,f),P.CALENDAR_STRINGS);return this._paneProperties[t]={cutoffCol:o,daysInMonth:u,paneDate:e},E},_rerenderCalendarPane:function(e,t){var n=this.get("strings.first_weekday")||0,r=this._getCutoffColumn(e,n),i=D.daysInMonth(e),s=t.get("id");t.setStyle("visibility","hidden"),t.setAttribute("aria-label",D.format(e,{format:"%B %Y"}));for(var o=0;o<=12;o++){var u=t.all(".calendar_col"+o);u.removeClass(h);if(o<r||o>=r+7)u.addClass(h);else switch(o){case 0:var a=t.one("#"+s+"_0_30");i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.addClass(y).addClass(m));break;case 1:var a=t.one("#"+s+"_1_31");i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 6:var a=t.one("#"+s+"_6_29");i>=29?(a.set("text","29"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 7:var a=t.one("#"+s+"_7_30");i>=30?(a.set("text","30"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y));break;case 8:var a=t.one("#"+s+"_8_31");i>=31?(a.set("text","31"),a.removeClass(y).addClass(m)):(a.setContent(" "),a.removeClass(m).addClass(y))}}this._paneProperties[s].cutoffCol=r,this._paneProperties[s].daysInMonth=i,this._paneProperties[s].paneDate=e,t.setStyle("visibility","visible")},_updateCalendarHeader:function(t){var n="",r=this.get("headerRenderer");return e.Lang.isString(r)?n=D.format(t,{format:r}):r instanceof Function&&(n=r.call(this,t)),n},_initCalendarHeader:function(e){return N(N(P.HEADER_TEMPLATE,{calheader:this._updateCalendarHeader(e),calendar_id:this._calendarId}),P.CALENDAR_STRINGS)},_initCalendarHTML:function(t){function i(){var e=this._initCalendarPane(D.addMonths(t,r),n.calendar_id+"_pane_"+r);return r++,e}var n={},r=0;n.header_template=this._initCalendarHeader(t),n.calendar_id=this._calendarId,n.body_template=N(N(P.CONTENT_TEMPLATE,n),P.CALENDAR_STRINGS);var s=n.body_template.replace(/\{calendar_grid_template\}/g,e.bind(i,this));return this._paneNumber=r,s}},{CALENDAR_STRINGS:{calendar_grid_class:i,calendar_body_class:u,calendar_hd_class:a,calendar_hd_label_class:f,calendar_weekdayrow_class:l,calendar_weekday_class:c,calendar_row_class:v,calendar_day_class:m,calendar_dayanchor_class:b,calendar_pane_class:w,calendar_right_grid_class:o,calendar_left_grid_class:s,calendar_status_class:E},CONTENT_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',ONE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1">{calendar_grid_template}</div></div>',TWO_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-2"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-2"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',THREE_PANE_TEMPLATE:'<div class="yui3-g {calendar_pane_class}" id="{calendar_id}">{header_template}<div class="yui3-u-1-3"><div class = "{calendar_left_grid_class}">{calendar_grid_template}</div></div><div class="yui3-u-1-3">{calendar_grid_template}</div><div class="yui3-u-1-3"><div class = "{calendar_right_grid_class}">{calendar_grid_template}</div></div></div>',CALENDAR_GRID_TEMPLATE:'<table class="{calendar_grid_class}" id="{calendar_pane_id}" role="grid" aria-readonly="true" aria-label="{pane_arialabel}" tabindex="{calendar_pane_tabindex}"><thead>{weekday_row_template}</thead><tbody>{body_template}</tbody></table>',HEADER_TEMPLATE:'<div class="yui3-g {calendar_hd_class}"><div class="yui3-u {calendar_hd_label_class}" id="{calendar_id}_header" aria-role="heading">{calheader}</div></div>',WEEKDAY_ROW_TEMPLATE:'<tr class="{calendar_weekdayrow_class}" role="row">{weekday_row}</tr>',CALDAY_ROW_TEMPLATE:'<tr class="{calendar_row_class}" role="row">{calday_row}</tr>',WEEKDAY_TEMPLATE:'<th class="{calendar_weekday_class}" role="columnheader" aria-label="{full_weekdayname}">{weekdayname}</th>',CALDAY_TEMPLATE:'<td class="{calendar_col_class} {calendar_day_class} {calendar_col_visibility_class}" id="{calendar_day_id}" role="gridcell" tabindex="-1">{day_content}</td>',NAME:"calendarBase",ATTRS:{tabIndex:{value:1},date:{value:new Date,setter:function(e){var t=this._normalizeDate(e);return D.areEqual(t,this.get("date"))?this.get("date"):t}},showPrevMonth:{value:!1},showNextMonth:{value:!1},strings:{valueFn:function(){return e.Intl.get("calendar-base")}},headerRenderer:{value:"%B %Y"},enabledDatesRule:{value:null},disabledDatesRule:{value:null},selectedDates:{readOnly:!0,getter:function(e){return this._getSelectedDatesList()}},customRenderer:{lazyAdd:!1,value:{},setter:function(e){this._rules=e.rules,this._filterFunction=e.filterFunction}}}})},"3.7.3",{requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],skinnable:!0});
bundle/calendar-base/calendar-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1636,4 +1636,4 @@ }); -}, '3.7.2', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "substitute", "datatype-date", "datatype-date-math", "cssgrids"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
bundle/calendar-base/lang/calendar-base.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base",function(e){e.Intl.add("calendar-base","",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base",function(e){e.Intl.add("calendar-base","",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_de.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_de",function(e){e.Intl.add("calendar-base","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_de",function(e){e.Intl.add("calendar-base","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_en",function(e){e.Intl.add("calendar-base","en",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_en",function(e){e.Intl.add("calendar-base","en",{weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short_weekdays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],very_short_weekdays:["Su","Mo","Tu","We","Th","Fr","Sa"],first_weekday:0,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_fr.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_fr",function(e){e.Intl.add("calendar-base","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_fr",function(e){e.Intl.add("calendar-base","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_ja.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_ja",function(e){e.Intl.add("calendar-base","ja",{weekdays:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],short_weekdays:["\u65e5\u66dc","\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc"],very_short_weekdays:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],first_weekday:0,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_ja",function(e){e.Intl.add("calendar-base","ja",{weekdays:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],short_weekdays:["\u65e5\u66dc","\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc"],very_short_weekdays:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],first_weekday:0,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_nb-NO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_nb-NO",function(e){e.Intl.add("calendar-base","nb-NO",{weekdays:["S\u00f8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\u00f8rdag"],very_short_weekdays:["S\u00f8","Ma","Ti","On","To","Fr","L\u00f8"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_nb-NO",function(e){e.Intl.add("calendar-base","nb-NO",{weekdays:["S\u00f8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\u00f8rdag"],very_short_weekdays:["S\u00f8","Ma","Ti","On","To","Fr","L\u00f8"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_pt-BR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_pt-BR",function(e){e.Intl.add("calendar-base","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00e7a","Quarta","Quinta","Sexta","S\u00e1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],first_weekday:0,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_pt-BR",function(e){e.Intl.add("calendar-base","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00e7a","Quarta","Quinta","Sexta","S\u00e1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],first_weekday:0,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_ru.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_ru",function(e){e.Intl.add("calendar-base","ru",{weekdays:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],very_short_weekdays:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_ru",function(e){e.Intl.add("calendar-base","ru",{weekdays:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],very_short_weekdays:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar-base/lang/calendar-base_zh-HANT-TW.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar-base_zh-HANT-TW",function(e){e.Intl.add("calendar-base","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar-base_zh-HANT-TW",function(e){e.Intl.add("calendar-base","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]})},"3.7.3");
bundle/calendar/assets/calendar-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar/assets/skins/night/calendar-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar/assets/skins/night/calendar.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar/assets/skins/sam/calendar-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar/assets/skins/sam/calendar.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/calendar/calendar-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/calendar/calendar.js", code: [] };-_yuitest_coverage["build/calendar/calendar.js"].code=["YUI.add('calendar', function (Y, NAME) {","","/**"," * The Calendar component is a UI widget that allows users"," * to view dates in a two-dimensional month grid, as well as"," * to select one or more dates, or ranges of dates. Calendar"," * is generated dynamically and relies on the developer to"," * provide for a progressive enhancement alternative."," *"," *"," * @module calendar"," */","","var getCN = Y.ClassNameManager.getClassName,"," CALENDAR = 'calendar',"," KEY_DOWN = 40,"," KEY_UP = 38,"," KEY_LEFT = 37,"," KEY_RIGHT = 39,"," KEY_ENTER = 13,"," KEY_SPACE = 32,"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),"," CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),"," CAL_DAY = getCN(CALENDAR, 'day'),"," CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),"," CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),"," CAL_GRID = getCN(CALENDAR, 'grid'),"," ydate = Y.DataType.Date,"," delegate = Y.delegate,"," CAL_PANE = getCN(CALENDAR, 'pane'),"," os = Y.UA.os;","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class Calendar"," * @extends CalendarBase"," * @param config {Object} Configuration object (see Configuration attributes)"," * @constructor"," */","function Calendar(config) {"," Calendar.superclass.constructor.apply ( this, arguments );","}","","Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {",""," _keyEvents: [],",""," _highlightedDateNode: null,",""," /**"," * A property tracking the last selected date on the calendar, for the"," * purposes of multiple selection."," *"," * @property _lastSelectedDate"," * @type Date"," * @default null"," * @private"," */ "," _lastSelectedDate: null,",""," /**"," * Designated initializer. Activates the navigation plugin for the calendar."," *"," * @method initializer"," */ "," initializer : function () {"," this.plug(Y.Plugin.CalendarNavigator);","",""," this._keyEvents = [];"," this._highlightedDateNode = null;"," this._lastSelectedDate = null;"," },",""," /**"," * Overrides the _bindCalendarEvents placeholder in CalendarBase"," * and binds calendar events during bindUI stage."," * @method _bindCalendarEvents"," * @protected"," */ "," _bindCalendarEvents : function () {"," var contentBox = this.get('contentBox'),"," pane = contentBox.one(\".\" + CAL_PANE);"," pane.on(\"selectstart\", this._preventSelectionStart);"," pane.delegate(\"click\", this._clickCalendar, \".\" + CAL_DAY + \", .\" + CAL_PREVMONTH_DAY + \", .\" + CAL_NEXTMONTH_DAY, this);"," pane.delegate(\"keydown\", this._keydownCalendar, \".\" + CAL_GRID, this);"," pane.delegate(\"focus\", this._focusCalendarGrid, \".\" + CAL_GRID, this);"," pane.delegate(\"focus\", this._focusCalendarCell, \".\" + CAL_DAY, this);"," pane.delegate(\"blur\", this._blurCalendarGrid, \".\" + CAL_GRID + \",.\" + CAL_DAY, this);"," },",""," /**"," * Prevents text selection if it is started within the calendar pane"," * @method _preventSelectionStart"," * @param event {Event} The selectstart event"," * @protected"," */ "," _preventSelectionStart : function (event) {"," event.preventDefault();"," },",""," /**"," * Highlights a specific date node with keyboard highlight class"," * @method _highlightDateNode"," * @param oDate {Date} Date corresponding the node to be highlighted"," * @protected"," */ "," _highlightDateNode : function (oDate) {"," this._unhighlightCurrentDateNode();"," var newNode = this._dateToNode(oDate);"," newNode.focus();"," newNode.addClass(CAL_DAY_HILITED);"," },",""," /**"," * Unhighlights a specific date node currently highlighted with keyboard highlight class"," * @method _unhighlightCurrentDateNode"," * @protected"," */ "," _unhighlightCurrentDateNode : function () {"," var allHilitedNodes = this.get(\"contentBox\").all(\".\" + CAL_DAY_HILITED);"," if (allHilitedNodes) {"," allHilitedNodes.removeClass(CAL_DAY_HILITED);"," }"," },",""," /**"," * Returns the grid number for a specific calendar grid (for multi-grid templates)"," * @method _getGridNumber"," * @param gridNode {Node} Node corresponding to a specific grid"," * @protected"," */ "," _getGridNumber : function (gridNode) {"," var idParts = gridNode.get(\"id\").split(\"_\").reverse();"," return parseInt(idParts[0], 10);"," },",""," /**"," * Handler for loss of focus of calendar grid"," * @method _blurCalendarGrid"," * @protected"," */ "," _blurCalendarGrid : function (ev) {"," this._unhighlightCurrentDateNode();"," },","",""," /**"," * Handler for gain of focus of calendar cell"," * @method _focusCalendarCell"," * @protected"," */ "," _focusCalendarCell : function (ev) {"," this._highlightedDateNode = ev.target;"," ev.stopPropagation();"," },",""," /**"," * Handler for gain of focus of calendar grid"," * @method _focusCalendarGrid"," * @protected"," */ "," _focusCalendarGrid : function (ev) { "," this._unhighlightCurrentDateNode();"," this._highlightedDateNode = null;"," },",""," /**"," * Handler for keyboard press on a calendar grid"," * @method _keydownCalendar"," * @protected"," */ "," _keydownCalendar : function (ev) {"," var gridNum = this._getGridNumber(ev.target),"," curDate = !this._highlightedDateNode ? null : this._nodeToDate(this._highlightedDateNode),"," keyCode = ev.keyCode,"," dayNum = 0,"," dir = '';",""," switch(keyCode) {"," case KEY_DOWN: "," dayNum = 7;"," dir = 's';"," break;"," case KEY_UP: "," dayNum = -7;"," dir = 'n';"," break;"," case KEY_LEFT: "," dayNum = -1;"," dir = 'w';"," break;"," case KEY_RIGHT:"," dayNum = 1;"," dir = 'e';"," break;"," case KEY_SPACE: case KEY_ENTER:"," ev.preventDefault();"," if (this._highlightedDateNode) {"," var selMode = this.get(\"selectionMode\");"," if (selMode === \"single\" && !this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {"," this._clearSelection(true);"," this._addDateToSelection(curDate);"," }"," else if (selMode === \"multiple\" || selMode === \"multiple-sticky\") {"," if (this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {"," this._removeDateFromSelection(curDate);"," }"," else {"," this._addDateToSelection(curDate);"," }"," }"," }"," break;"," }"," ",""," if (keyCode == KEY_DOWN || keyCode == KEY_UP || keyCode == KEY_LEFT || keyCode == KEY_RIGHT) {",""," if (!curDate) {"," curDate = ydate.addMonths(this.get(\"date\"), gridNum);"," dayNum = 0;"," }"," ev.preventDefault();"," var newDate = ydate.addDays(curDate, dayNum),"," startDate = this.get(\"date\"),"," endDate = ydate.addMonths(this.get(\"date\"), this._paneNumber - 1),"," lastPaneDate = new Date(endDate);"," endDate.setDate(ydate.daysInMonth(endDate));"," "," if (ydate.isInRange(newDate, startDate, endDate)) {","/*"," var paneShift = (newDate.getMonth() - curDate.getMonth()) % 10;","",""," if (paneShift != 0) {"," var newGridNum = gridNum + paneShift,"," contentBox = this.get('contentBox'),"," newPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + newGridNum);"," newPane.focus();"," }","*/"," this._highlightDateNode(newDate);"," }"," else if (ydate.isGreater(startDate, newDate)) {"," if (!ydate.isGreaterOrEqual(this.get(\"minimumDate\"), startDate)) {"," this.set(\"date\", ydate.addMonths(startDate, -1));"," this._highlightDateNode(newDate);"," }"," }"," else if (ydate.isGreater(newDate, endDate)) {"," if (!ydate.isGreaterOrEqual(lastPaneDate, this.get(\"maximumDate\"))) {"," this.set(\"date\", ydate.addMonths(startDate, 1));"," this._highlightDateNode(newDate);"," }"," }",""," }"," },",""," /**"," * Handles the calendar clicks based on selection mode."," * @method _clickCalendar"," * @param {Event} ev A click event"," * @private"," */ "," _clickCalendar : function (ev) {"," var clickedCell = ev.currentTarget,"," clickedCellIsDay = clickedCell.hasClass(CAL_DAY) && "," !clickedCell.hasClass(CAL_PREVMONTH_DAY) && "," !clickedCell.hasClass(CAL_NEXTMONTH_DAY),"," clickedCellIsSelected = clickedCell.hasClass(CAL_DAY_SELECTED);"," switch (this.get(\"selectionMode\")) {"," case(\"single\"):"," if (clickedCellIsDay) {"," if (!clickedCellIsSelected) {"," this._clearSelection(true); "," this._addDateToSelection(this._nodeToDate(clickedCell));"," }"," }"," break;"," case(\"multiple-sticky\"):"," if (clickedCellIsDay) {"," if (clickedCellIsSelected) {"," this._removeDateFromSelection(this._nodeToDate(clickedCell));"," }"," else {"," this._addDateToSelection(this._nodeToDate(clickedCell));"," }"," }"," break;"," case(\"multiple\"):"," if (clickedCellIsDay) {"," if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {"," this._clearSelection(true);"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {"," if (clickedCellIsSelected) {"," this._removeDateFromSelection(this._nodeToDate(clickedCell));"," this._lastSelectedDate = null;"," }"," else {"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," }"," else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {"," if (this._lastSelectedDate) {"," var selectedDate = this._nodeToDate(clickedCell);"," this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);"," this._lastSelectedDate = selectedDate;"," }"," else {"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," "," }"," else if (ev.shiftKey) {"," if (this._lastSelectedDate) {"," var selectedDate = this._nodeToDate(clickedCell);"," this._clearSelection(true);"," this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);"," this._lastSelectedDate = selectedDate;"," }"," else {"," this._clearSelection(true);"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," }"," }"," break;"," }",""," if (clickedCellIsDay) {"," /**"," * Fired when a specific date cell in the calendar is clicked. The event carries a "," * payload which includes a `cell` property corresponding to the node of the actual"," * date cell, and a `date` property, with the `Date` that was clicked."," *"," * @event dateClick"," */"," this.fire(\"dateClick\", {cell: clickedCell, date: this._nodeToDate(clickedCell)});"," }"," else if (clickedCell.hasClass(CAL_PREVMONTH_DAY)) {"," /**"," * Fired when any of the previous month's days displayed before the calendar grid"," * are clicked."," *"," * @event prevMonthClick"," */"," this.fire(\"prevMonthClick\");"," }"," else if (clickedCell.hasClass(CAL_NEXTMONTH_DAY)) {"," /**"," * Fired when any of the next month's days displayed after the calendar grid"," * are clicked."," *"," * @event nextMonthClick"," */"," this.fire(\"nextMonthClick\");"," }"," },",""," /**"," * Subtracts one month from the current calendar view."," * @method subtractMonth"," */ "," subtractMonth : function (e) {"," this.set(\"date\", ydate.addMonths(this.get(\"date\"), -1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Subtracts one year from the current calendar view."," * @method subtractYear"," */ "," subtractYear : function (e) {"," this.set(\"date\", ydate.addYears(this.get(\"date\"), -1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Adds one month to the current calendar view."," * @method addMonth"," */ "," addMonth : function (e) { "," this.set(\"date\", ydate.addMonths(this.get(\"date\"), 1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Adds one year to the current calendar view."," * @method addYear"," */ "," addYear : function (e) {"," this.set(\"date\", ydate.addYears(this.get(\"date\"), 1));"," if (e) {"," e.halt();"," }"," }","},","","{"," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'calendar'"," * @readOnly"," * @protected"," * @static"," */ "," NAME: \"calendar\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */ "," ATTRS: {",""," /**"," * A setting specifying the type of selection the calendar allows."," * Possible values include:"," * <ul>"," * <li>`single` - One date at a time</li>"," * <li>`multiple-sticky` - Multiple dates, selected one at a time (the dates \"stick\"). This option"," * is appropriate for mobile devices, where function keys from the keyboard are not available.</li>"," * <li>`multiple` - Multiple dates, selected with Ctrl/Meta keys for additional single"," * dates, and Shift key for date ranges.</li>"," *"," * @attribute selectionMode"," * @type String"," * @default single"," */"," selectionMode: {"," value: \"single\""," },",""," /**"," * The date corresponding to the current calendar view. Always"," * normalized to the first of the month that contains the date"," * at assignment time. Used as the first date visible in the"," * calendar."," *"," * @attribute date"," * @type Date"," * @default Today's date as set on the user's computer."," */"," date: {"," value: new Date(),"," lazyAdd: false,"," setter: function (val) {",""," var newDate = this._normalizeDate(val),"," newTopDate = ydate.addMonths(newDate, this._paneNumber - 1);"," var minDate = this.get(\"minimumDate\");"," var maxDate = this.get(\"maximumDate\");"," if ((!minDate || ydate.isGreaterOrEqual(newDate, minDate)) && "," (!maxDate || ydate.isGreaterOrEqual(maxDate, newTopDate))) {"," return newDate;"," }",""," else if (minDate && ydate.isGreater(minDate, newDate)) {"," return minDate;"," }",""," else if (maxDate && ydate.isGreater(newTopDate, maxDate)) {"," var actualMaxDate = ydate.addMonths(maxDate, -1*(this._paneNumber - 1));"," return actualMaxDate;"," }"," }"," },",""," /**"," * The minimum date that can be displayed by the calendar. The calendar will not"," * allow dates earlier than this one to be set, and will reset any earlier date to"," * this date. Should be `null` if no minimum date is needed."," *"," * @attribute minimumDate"," * @type Date"," * @default null"," */"," minimumDate: {"," value: null,"," setter: function (val) {"," if (val) {"," var curDate = this.get('date'),"," newMinDate = this._normalizeDate(val);"," if (curDate && !ydate.isGreaterOrEqual(curDate, newMinDate)) {"," this.set('date', newMinDate);"," }"," return newMinDate;"," }"," else {"," return this._normalizeDate(val);"," }"," }"," },",""," /**"," * The maximum date that can be displayed by the calendar. The calendar will not"," * allow dates later than this one to be set, and will reset any later date to"," * this date. Should be `null` if no maximum date is needed."," *"," * @attribute maximumDate"," * @type Date"," * @default null"," */"," maximumDate: {"," value: null,"," setter: function (val) {"," if (val) {"," var curDate = this.get('date'),"," newMaxDate = this._normalizeDate(val);"," if (curDate && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {"," this.set('date', ydate.addMonths(newMaxDate, -1*(this._paneNumber -1)));"," }"," return newMaxDate;"," }"," else {"," return val;"," }"," }"," }"," }","});","","}, '3.7.2', {\"requires\": [\"calendar-base\", \"calendarnavigator\"], \"lang\": [\"de\", \"en\", \"fr\", \"ja\", \"nb-NO\", \"pt-BR\", \"ru\", \"zh-HANT-TW\"], \"skinnable\": true});"];+_yuitest_coverage["build/calendar/calendar.js"].code=["YUI.add('calendar', function (Y, NAME) {","","/**"," * The Calendar component is a UI widget that allows users"," * to view dates in a two-dimensional month grid, as well as"," * to select one or more dates, or ranges of dates. Calendar"," * is generated dynamically and relies on the developer to"," * provide for a progressive enhancement alternative."," *"," *"," * @module calendar"," */","","var getCN = Y.ClassNameManager.getClassName,"," CALENDAR = 'calendar',"," KEY_DOWN = 40,"," KEY_UP = 38,"," KEY_LEFT = 37,"," KEY_RIGHT = 39,"," KEY_ENTER = 13,"," KEY_SPACE = 32,"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_DAY_SELECTED = getCN(CALENDAR, 'day-selected'),"," CAL_DAY_HILITED = getCN(CALENDAR, 'day-highlighted'),"," CAL_DAY = getCN(CALENDAR, 'day'),"," CAL_PREVMONTH_DAY = getCN(CALENDAR, 'prevmonth-day'),"," CAL_NEXTMONTH_DAY = getCN(CALENDAR, 'nextmonth-day'),"," CAL_GRID = getCN(CALENDAR, 'grid'),"," ydate = Y.DataType.Date,"," delegate = Y.delegate,"," CAL_PANE = getCN(CALENDAR, 'pane'),"," os = Y.UA.os;","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class Calendar"," * @extends CalendarBase"," * @param config {Object} Configuration object (see Configuration attributes)"," * @constructor"," */","function Calendar(config) {"," Calendar.superclass.constructor.apply ( this, arguments );","}","","Y.Calendar = Y.extend(Calendar, Y.CalendarBase, {",""," _keyEvents: [],",""," _highlightedDateNode: null,",""," /**"," * A property tracking the last selected date on the calendar, for the"," * purposes of multiple selection."," *"," * @property _lastSelectedDate"," * @type Date"," * @default null"," * @private"," */ "," _lastSelectedDate: null,",""," /**"," * Designated initializer. Activates the navigation plugin for the calendar."," *"," * @method initializer"," */ "," initializer : function () {"," this.plug(Y.Plugin.CalendarNavigator);","",""," this._keyEvents = [];"," this._highlightedDateNode = null;"," this._lastSelectedDate = null;"," },",""," /**"," * Overrides the _bindCalendarEvents placeholder in CalendarBase"," * and binds calendar events during bindUI stage."," * @method _bindCalendarEvents"," * @protected"," */ "," _bindCalendarEvents : function () {"," var contentBox = this.get('contentBox'),"," pane = contentBox.one(\".\" + CAL_PANE);"," pane.on(\"selectstart\", this._preventSelectionStart);"," pane.delegate(\"click\", this._clickCalendar, \".\" + CAL_DAY + \", .\" + CAL_PREVMONTH_DAY + \", .\" + CAL_NEXTMONTH_DAY, this);"," pane.delegate(\"keydown\", this._keydownCalendar, \".\" + CAL_GRID, this);"," pane.delegate(\"focus\", this._focusCalendarGrid, \".\" + CAL_GRID, this);"," pane.delegate(\"focus\", this._focusCalendarCell, \".\" + CAL_DAY, this);"," pane.delegate(\"blur\", this._blurCalendarGrid, \".\" + CAL_GRID + \",.\" + CAL_DAY, this);"," },",""," /**"," * Prevents text selection if it is started within the calendar pane"," * @method _preventSelectionStart"," * @param event {Event} The selectstart event"," * @protected"," */ "," _preventSelectionStart : function (event) {"," event.preventDefault();"," },",""," /**"," * Highlights a specific date node with keyboard highlight class"," * @method _highlightDateNode"," * @param oDate {Date} Date corresponding the node to be highlighted"," * @protected"," */ "," _highlightDateNode : function (oDate) {"," this._unhighlightCurrentDateNode();"," var newNode = this._dateToNode(oDate);"," newNode.focus();"," newNode.addClass(CAL_DAY_HILITED);"," },",""," /**"," * Unhighlights a specific date node currently highlighted with keyboard highlight class"," * @method _unhighlightCurrentDateNode"," * @protected"," */ "," _unhighlightCurrentDateNode : function () {"," var allHilitedNodes = this.get(\"contentBox\").all(\".\" + CAL_DAY_HILITED);"," if (allHilitedNodes) {"," allHilitedNodes.removeClass(CAL_DAY_HILITED);"," }"," },",""," /**"," * Returns the grid number for a specific calendar grid (for multi-grid templates)"," * @method _getGridNumber"," * @param gridNode {Node} Node corresponding to a specific grid"," * @protected"," */ "," _getGridNumber : function (gridNode) {"," var idParts = gridNode.get(\"id\").split(\"_\").reverse();"," return parseInt(idParts[0], 10);"," },",""," /**"," * Handler for loss of focus of calendar grid"," * @method _blurCalendarGrid"," * @protected"," */ "," _blurCalendarGrid : function (ev) {"," this._unhighlightCurrentDateNode();"," },","",""," /**"," * Handler for gain of focus of calendar cell"," * @method _focusCalendarCell"," * @protected"," */ "," _focusCalendarCell : function (ev) {"," this._highlightedDateNode = ev.target;"," ev.stopPropagation();"," },",""," /**"," * Handler for gain of focus of calendar grid"," * @method _focusCalendarGrid"," * @protected"," */ "," _focusCalendarGrid : function (ev) { "," this._unhighlightCurrentDateNode();"," this._highlightedDateNode = null;"," },",""," /**"," * Handler for keyboard press on a calendar grid"," * @method _keydownCalendar"," * @protected"," */ "," _keydownCalendar : function (ev) {"," var gridNum = this._getGridNumber(ev.target),"," curDate = !this._highlightedDateNode ? null : this._nodeToDate(this._highlightedDateNode),"," keyCode = ev.keyCode,"," dayNum = 0,"," dir = '';",""," switch(keyCode) {"," case KEY_DOWN: "," dayNum = 7;"," dir = 's';"," break;"," case KEY_UP: "," dayNum = -7;"," dir = 'n';"," break;"," case KEY_LEFT: "," dayNum = -1;"," dir = 'w';"," break;"," case KEY_RIGHT:"," dayNum = 1;"," dir = 'e';"," break;"," case KEY_SPACE: case KEY_ENTER:"," ev.preventDefault();"," if (this._highlightedDateNode) {"," var selMode = this.get(\"selectionMode\");"," if (selMode === \"single\" && !this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {"," this._clearSelection(true);"," this._addDateToSelection(curDate);"," }"," else if (selMode === \"multiple\" || selMode === \"multiple-sticky\") {"," if (this._highlightedDateNode.hasClass(CAL_DAY_SELECTED)) {"," this._removeDateFromSelection(curDate);"," }"," else {"," this._addDateToSelection(curDate);"," }"," }"," }"," break;"," }"," ",""," if (keyCode == KEY_DOWN || keyCode == KEY_UP || keyCode == KEY_LEFT || keyCode == KEY_RIGHT) {",""," if (!curDate) {"," curDate = ydate.addMonths(this.get(\"date\"), gridNum);"," dayNum = 0;"," }"," ev.preventDefault();"," var newDate = ydate.addDays(curDate, dayNum),"," startDate = this.get(\"date\"),"," endDate = ydate.addMonths(this.get(\"date\"), this._paneNumber - 1),"," lastPaneDate = new Date(endDate);"," endDate.setDate(ydate.daysInMonth(endDate));"," "," if (ydate.isInRange(newDate, startDate, endDate)) {","/*"," var paneShift = (newDate.getMonth() - curDate.getMonth()) % 10;","",""," if (paneShift != 0) {"," var newGridNum = gridNum + paneShift,"," contentBox = this.get('contentBox'),"," newPane = contentBox.one(\"#\" + this._calendarId + \"_pane_\" + newGridNum);"," newPane.focus();"," }","*/"," this._highlightDateNode(newDate);"," }"," else if (ydate.isGreater(startDate, newDate)) {"," if (!ydate.isGreaterOrEqual(this.get(\"minimumDate\"), startDate)) {"," this.set(\"date\", ydate.addMonths(startDate, -1));"," this._highlightDateNode(newDate);"," }"," }"," else if (ydate.isGreater(newDate, endDate)) {"," if (!ydate.isGreaterOrEqual(lastPaneDate, this.get(\"maximumDate\"))) {"," this.set(\"date\", ydate.addMonths(startDate, 1));"," this._highlightDateNode(newDate);"," }"," }",""," }"," },",""," /**"," * Handles the calendar clicks based on selection mode."," * @method _clickCalendar"," * @param {Event} ev A click event"," * @private"," */ "," _clickCalendar : function (ev) {"," var clickedCell = ev.currentTarget,"," clickedCellIsDay = clickedCell.hasClass(CAL_DAY) && "," !clickedCell.hasClass(CAL_PREVMONTH_DAY) && "," !clickedCell.hasClass(CAL_NEXTMONTH_DAY),"," clickedCellIsSelected = clickedCell.hasClass(CAL_DAY_SELECTED);"," switch (this.get(\"selectionMode\")) {"," case(\"single\"):"," if (clickedCellIsDay) {"," if (!clickedCellIsSelected) {"," this._clearSelection(true); "," this._addDateToSelection(this._nodeToDate(clickedCell));"," }"," }"," break;"," case(\"multiple-sticky\"):"," if (clickedCellIsDay) {"," if (clickedCellIsSelected) {"," this._removeDateFromSelection(this._nodeToDate(clickedCell));"," }"," else {"," this._addDateToSelection(this._nodeToDate(clickedCell));"," }"," }"," break;"," case(\"multiple\"):"," if (clickedCellIsDay) {"," if (!ev.metaKey && !ev.ctrlKey && !ev.shiftKey) {"," this._clearSelection(true);"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && !ev.shiftKey) {"," if (clickedCellIsSelected) {"," this._removeDateFromSelection(this._nodeToDate(clickedCell));"," this._lastSelectedDate = null;"," }"," else {"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," }"," else if (((os == 'macintosh' && ev.metaKey) || (os != 'macintosh' && ev.ctrlKey)) && ev.shiftKey) {"," if (this._lastSelectedDate) {"," var selectedDate = this._nodeToDate(clickedCell);"," this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);"," this._lastSelectedDate = selectedDate;"," }"," else {"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," "," }"," else if (ev.shiftKey) {"," if (this._lastSelectedDate) {"," var selectedDate = this._nodeToDate(clickedCell);"," this._clearSelection(true);"," this._addDateRangeToSelection(selectedDate, this._lastSelectedDate);"," this._lastSelectedDate = selectedDate;"," }"," else {"," this._clearSelection(true);"," this._lastSelectedDate = this._nodeToDate(clickedCell);"," this._addDateToSelection(this._lastSelectedDate);"," }"," }"," }"," break;"," }",""," if (clickedCellIsDay) {"," /**"," * Fired when a specific date cell in the calendar is clicked. The event carries a "," * payload which includes a `cell` property corresponding to the node of the actual"," * date cell, and a `date` property, with the `Date` that was clicked."," *"," * @event dateClick"," */"," this.fire(\"dateClick\", {cell: clickedCell, date: this._nodeToDate(clickedCell)});"," }"," else if (clickedCell.hasClass(CAL_PREVMONTH_DAY)) {"," /**"," * Fired when any of the previous month's days displayed before the calendar grid"," * are clicked."," *"," * @event prevMonthClick"," */"," this.fire(\"prevMonthClick\");"," }"," else if (clickedCell.hasClass(CAL_NEXTMONTH_DAY)) {"," /**"," * Fired when any of the next month's days displayed after the calendar grid"," * are clicked."," *"," * @event nextMonthClick"," */"," this.fire(\"nextMonthClick\");"," }"," },",""," /**"," * Subtracts one month from the current calendar view."," * @method subtractMonth"," */ "," subtractMonth : function (e) {"," this.set(\"date\", ydate.addMonths(this.get(\"date\"), -1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Subtracts one year from the current calendar view."," * @method subtractYear"," */ "," subtractYear : function (e) {"," this.set(\"date\", ydate.addYears(this.get(\"date\"), -1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Adds one month to the current calendar view."," * @method addMonth"," */ "," addMonth : function (e) { "," this.set(\"date\", ydate.addMonths(this.get(\"date\"), 1));"," if (e) {"," e.halt();"," }"," },",""," /**"," * Adds one year to the current calendar view."," * @method addYear"," */ "," addYear : function (e) {"," this.set(\"date\", ydate.addYears(this.get(\"date\"), 1));"," if (e) {"," e.halt();"," }"," }","},","","{"," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'calendar'"," * @readOnly"," * @protected"," * @static"," */ "," NAME: \"calendar\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */ "," ATTRS: {",""," /**"," * A setting specifying the type of selection the calendar allows."," * Possible values include:"," * <ul>"," * <li>`single` - One date at a time</li>"," * <li>`multiple-sticky` - Multiple dates, selected one at a time (the dates \"stick\"). This option"," * is appropriate for mobile devices, where function keys from the keyboard are not available.</li>"," * <li>`multiple` - Multiple dates, selected with Ctrl/Meta keys for additional single"," * dates, and Shift key for date ranges.</li>"," *"," * @attribute selectionMode"," * @type String"," * @default single"," */"," selectionMode: {"," value: \"single\""," },",""," /**"," * The date corresponding to the current calendar view. Always"," * normalized to the first of the month that contains the date"," * at assignment time. Used as the first date visible in the"," * calendar."," *"," * @attribute date"," * @type Date"," * @default Today's date as set on the user's computer."," */"," date: {"," value: new Date(),"," lazyAdd: false,"," setter: function (val) {",""," var newDate = this._normalizeDate(val),"," newTopDate = ydate.addMonths(newDate, this._paneNumber - 1);"," var minDate = this.get(\"minimumDate\");"," var maxDate = this.get(\"maximumDate\");"," if ((!minDate || ydate.isGreaterOrEqual(newDate, minDate)) && "," (!maxDate || ydate.isGreaterOrEqual(maxDate, newTopDate))) {"," return newDate;"," }",""," else if (minDate && ydate.isGreater(minDate, newDate)) {"," return minDate;"," }",""," else if (maxDate && ydate.isGreater(newTopDate, maxDate)) {"," var actualMaxDate = ydate.addMonths(maxDate, -1*(this._paneNumber - 1));"," return actualMaxDate;"," }"," }"," },",""," /**"," * The minimum date that can be displayed by the calendar. The calendar will not"," * allow dates earlier than this one to be set, and will reset any earlier date to"," * this date. Should be `null` if no minimum date is needed."," *"," * @attribute minimumDate"," * @type Date"," * @default null"," */"," minimumDate: {"," value: null,"," setter: function (val) {"," if (val) {"," var curDate = this.get('date'),"," newMinDate = this._normalizeDate(val);"," if (curDate && !ydate.isGreaterOrEqual(curDate, newMinDate)) {"," this.set('date', newMinDate);"," }"," return newMinDate;"," }"," else {"," return this._normalizeDate(val);"," }"," }"," },",""," /**"," * The maximum date that can be displayed by the calendar. The calendar will not"," * allow dates later than this one to be set, and will reset any later date to"," * this date. Should be `null` if no maximum date is needed."," *"," * @attribute maximumDate"," * @type Date"," * @default null"," */"," maximumDate: {"," value: null,"," setter: function (val) {"," if (val) {"," var curDate = this.get('date'),"," newMaxDate = this._normalizeDate(val);"," if (curDate && !ydate.isGreaterOrEqual(val, ydate.addMonths(curDate, this._paneNumber - 1))) {"," this.set('date', ydate.addMonths(newMaxDate, -1*(this._paneNumber -1)));"," }"," return newMaxDate;"," }"," else {"," return val;"," }"," }"," }"," }","});","","}, '3.7.3', {\"requires\": [\"calendar-base\", \"calendarnavigator\"], \"lang\": [\"de\", \"en\", \"fr\", \"ja\", \"nb-NO\", \"pt-BR\", \"ru\", \"zh-HANT-TW\"], \"skinnable\": true});"]; _yuitest_coverage["build/calendar/calendar.js"].lines = {"1":0,"14":0,"43":0,"44":0,"47":0,"70":0,"73":0,"74":0,"75":0,"85":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"102":0,"112":0,"113":0,"114":0,"115":0,"124":0,"125":0,"126":0,"137":0,"138":0,"147":0,"157":0,"158":0,"167":0,"168":0,"177":0,"183":0,"185":0,"186":0,"187":0,"189":0,"190":0,"191":0,"193":0,"194":0,"195":0,"197":0,"198":0,"199":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"208":0,"209":0,"210":0,"213":0,"217":0,"221":0,"223":0,"224":0,"225":0,"227":0,"228":0,"232":0,"234":0,"246":0,"248":0,"249":0,"250":0,"251":0,"254":0,"255":0,"256":0,"257":0,"271":0,"276":0,"278":0,"279":0,"280":0,"281":0,"284":0,"286":0,"287":0,"288":0,"291":0,"294":0,"296":0,"297":0,"298":0,"299":0,"300":0,"302":0,"303":0,"304":0,"305":0,"308":0,"309":0,"312":0,"313":0,"314":0,"315":0,"316":0,"319":0,"320":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"332":0,"333":0,"334":0,"338":0,"341":0,"349":0,"351":0,"358":0,"360":0,"367":0,"376":0,"377":0,"378":0,"387":0,"388":0,"389":0,"398":0,"399":0,"400":0,"409":0,"410":0,"411":0,"473":0,"475":0,"476":0,"477":0,"479":0,"482":0,"483":0,"486":0,"487":0,"488":0,"505":0,"506":0,"508":0,"509":0,"511":0,"514":0,"531":0,"532":0,"534":0,"535":0,"537":0,"540":0}; _yuitest_coverage["build/calendar/calendar.js"].functions = {"Calendar:43":0,"initializer:69":0,"_bindCalendarEvents:84":0,"_preventSelectionStart:101":0,"_highlightDateNode:111":0,"_unhighlightCurrentDateNode:123":0,"_getGridNumber:136":0,"_blurCalendarGrid:146":0,"_focusCalendarCell:156":0,"_focusCalendarGrid:166":0,"_keydownCalendar:176":0,"_clickCalendar:270":0,"subtractMonth:375":0,"subtractYear:386":0,"addMonth:397":0,"addYear:408":0,"setter:471":0,"setter:504":0,"setter:530":0,"(anonymous 1):1":0}; _yuitest_coverage["build/calendar/calendar.js"].coveredLines = 153;@@ -756,4 +756,4 @@ } }); -}, '3.7.2', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});+}, '3.7.3', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
bundle/calendar/calendar-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -550,4 +550,4 @@ } }); -}, '3.7.2', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});+}, '3.7.3', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
bundle/calendar/calendar-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("calendar",function(e,t){function E(e){E.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=40,s=38,o=37,u=39,a=13,f=32,l=n(r,"header"),c=n(r,"day-selected"),h=n(r,"day-highlighted"),p=n(r,"day"),d=n(r,"prevmonth-day"),v=n(r,"nextmonth-day"),m=n(r,"grid"),g=e.DataType.Date,y=e.delegate,b=n(r,"pane"),w=e.UA.os;e.Calendar=e.extend(E,e.CalendarBase,{_keyEvents:[],_highlightedDateNode:null,_lastSelectedDate:null,initializer:function(){this.plug(e.Plugin.CalendarNavigator),this._keyEvents=[],this._highlightedDateNode=null,this._lastSelectedDate=null},_bindCalendarEvents:function(){var e=this.get("contentBox"),t=e.one("."+b);t.on("selectstart",this._preventSelectionStart),t.delegate("click",this._clickCalendar,"."+p+", ."+d+", ."+v,this),t.delegate("keydown",this._keydownCalendar,"."+m,this),t.delegate("focus",this._focusCalendarGrid,"."+m,this),t.delegate("focus",this._focusCalendarCell,"."+p,this),t.delegate("blur",this._blurCalendarGrid,"."+m+",."+p,this)},_preventSelectionStart:function(e){e.preventDefault()},_highlightDateNode:function(e){this._unhighlightCurrentDateNode();var t=this._dateToNode(e);t.focus(),t.addClass(h)},_unhighlightCurrentDateNode:function(){var e=this.get("contentBox").all("."+h);e&&e.removeClass(h)},_getGridNumber:function(e){var t=e.get("id").split("_").reverse();return parseInt(t[0],10)},_blurCalendarGrid:function(e){this._unhighlightCurrentDateNode()},_focusCalendarCell:function(e){this._highlightedDateNode=e.target,e.stopPropagation()},_focusCalendarGrid:function(e){this._unhighlightCurrentDateNode(),this._highlightedDateNode=null},_keydownCalendar:function(e){var t=this._getGridNumber(e.target),n=this._highlightedDateNode?this._nodeToDate(this._highlightedDateNode):null,r=e.keyCode,l=0,h="";switch(r){case i:l=7,h="s";break;case s:l=-7,h="n";break;case o:l=-1,h="w";break;case u:l=1,h="e";break;case f:case a:e.preventDefault();if(this._highlightedDateNode){var p=this.get("selectionMode");if(p==="single"&&!this._highlightedDateNode.hasClass(c))this._clearSelection(!0),this._addDateToSelection(n);else if(p==="multiple"||p==="multiple-sticky")this._highlightedDateNode.hasClass(c)?this._removeDateFromSelection(n):this._addDateToSelection(n)}}if(r==i||r==s||r==o||r==u){n||(n=g.addMonths(this.get("date"),t),l=0),e.preventDefault();var d=g.addDays(n,l),v=this.get("date"),m=g.addMonths(this.get("date"),this._paneNumber-1),y=new Date(m);m.setDate(g.daysInMonth(m)),g.isInRange(d,v,m)?this._highlightDateNode(d):g.isGreater(v,d)?g.isGreaterOrEqual(this.get("minimumDate"),v)||(this.set("date",g.addMonths(v,-1)),this._highlightDateNode(d)):g.isGreater(d,m)&&(g.isGreaterOrEqual(y,this.get("maximumDate"))||(this.set("date",g.addMonths(v,1)),this._highlightDateNode(d)))}},_clickCalendar:function(e){var t=e.currentTarget,n=t.hasClass(p)&&!t.hasClass(d)&&!t.hasClass(v),r=t.hasClass(c);switch(this.get("selectionMode")){case"single":n&&(r||(this._clearSelection(!0),this._addDateToSelection(this._nodeToDate(t))));break;case"multiple-sticky":n&&(r?this._removeDateFromSelection(this._nodeToDate(t)):this._addDateToSelection(this._nodeToDate(t)));break;case"multiple":if(n)if(!e.metaKey&&!e.ctrlKey&&!e.shiftKey)this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate);else if((w=="macintosh"&&e.metaKey||w!="macintosh"&&e.ctrlKey)&&!e.shiftKey)r?(this._removeDateFromSelection(this._nodeToDate(t)),this._lastSelectedDate=null):(this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate));else if((w=="macintosh"&&e.metaKey||w!="macintosh"&&e.ctrlKey)&&e.shiftKey)if(this._lastSelectedDate){var i=this._nodeToDate(t);this._addDateRangeToSelection(i,this._lastSelectedDate),this._lastSelectedDate=i}else this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate);else if(e.shiftKey)if(this._lastSelectedDate){var i=this._nodeToDate(t);this._clearSelection(!0),this._addDateRangeToSelection(i,this._lastSelectedDate),this._lastSelectedDate=i}else this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate)}n?this.fire("dateClick",{cell:t,date:this._nodeToDate(t)}):t.hasClass(d)?this.fire("prevMonthClick"):t.hasClass(v)&&this.fire("nextMonthClick")},subtractMonth:function(e){this.set("date",g.addMonths(this.get("date"),-1)),e&&e.halt()},subtractYear:function(e){this.set("date",g.addYears(this.get("date"),-1)),e&&e.halt()},addMonth:function(e){this.set("date",g.addMonths(this.get("date"),1)),e&&e.halt()},addYear:function(e){this.set("date",g.addYears(this.get("date"),1)),e&&e.halt()}},{NAME:"calendar",ATTRS:{selectionMode:{value:"single"},date:{value:new Date,lazyAdd:!1,setter:function(e){var t=this._normalizeDate(e),n=g.addMonths(t,this._paneNumber-1),r=this.get("minimumDate"),i=this.get("maximumDate");if((!r||g.isGreaterOrEqual(t,r))&&(!i||g.isGreaterOrEqual(i,n)))return t;if(r&&g.isGreater(r,t))return r;if(i&&g.isGreater(n,i)){var s=g.addMonths(i,-1*(this._paneNumber-1));return s}}},minimumDate:{value:null,setter:function(e){if(e){var t=this.get("date"),n=this._normalizeDate(e);return t&&!g.isGreaterOrEqual(t,n)&&this.set("date",n),n}return this._normalizeDate(e)}},maximumDate:{value:null,setter:function(e){if(e){var t=this.get("date"),n=this._normalizeDate(e);return t&&!g.isGreaterOrEqual(e,g.addMonths(t,this._paneNumber-1))&&this.set("date",g.addMonths(n,-1*(this._paneNumber-1))),n}return e}}}})},"3.7.2",{requires:["calendar-base","calendarnavigator"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],skinnable:!0});+YUI.add("calendar",function(e,t){function E(e){E.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="calendar",i=40,s=38,o=37,u=39,a=13,f=32,l=n(r,"header"),c=n(r,"day-selected"),h=n(r,"day-highlighted"),p=n(r,"day"),d=n(r,"prevmonth-day"),v=n(r,"nextmonth-day"),m=n(r,"grid"),g=e.DataType.Date,y=e.delegate,b=n(r,"pane"),w=e.UA.os;e.Calendar=e.extend(E,e.CalendarBase,{_keyEvents:[],_highlightedDateNode:null,_lastSelectedDate:null,initializer:function(){this.plug(e.Plugin.CalendarNavigator),this._keyEvents=[],this._highlightedDateNode=null,this._lastSelectedDate=null},_bindCalendarEvents:function(){var e=this.get("contentBox"),t=e.one("."+b);t.on("selectstart",this._preventSelectionStart),t.delegate("click",this._clickCalendar,"."+p+", ."+d+", ."+v,this),t.delegate("keydown",this._keydownCalendar,"."+m,this),t.delegate("focus",this._focusCalendarGrid,"."+m,this),t.delegate("focus",this._focusCalendarCell,"."+p,this),t.delegate("blur",this._blurCalendarGrid,"."+m+",."+p,this)},_preventSelectionStart:function(e){e.preventDefault()},_highlightDateNode:function(e){this._unhighlightCurrentDateNode();var t=this._dateToNode(e);t.focus(),t.addClass(h)},_unhighlightCurrentDateNode:function(){var e=this.get("contentBox").all("."+h);e&&e.removeClass(h)},_getGridNumber:function(e){var t=e.get("id").split("_").reverse();return parseInt(t[0],10)},_blurCalendarGrid:function(e){this._unhighlightCurrentDateNode()},_focusCalendarCell:function(e){this._highlightedDateNode=e.target,e.stopPropagation()},_focusCalendarGrid:function(e){this._unhighlightCurrentDateNode(),this._highlightedDateNode=null},_keydownCalendar:function(e){var t=this._getGridNumber(e.target),n=this._highlightedDateNode?this._nodeToDate(this._highlightedDateNode):null,r=e.keyCode,l=0,h="";switch(r){case i:l=7,h="s";break;case s:l=-7,h="n";break;case o:l=-1,h="w";break;case u:l=1,h="e";break;case f:case a:e.preventDefault();if(this._highlightedDateNode){var p=this.get("selectionMode");if(p==="single"&&!this._highlightedDateNode.hasClass(c))this._clearSelection(!0),this._addDateToSelection(n);else if(p==="multiple"||p==="multiple-sticky")this._highlightedDateNode.hasClass(c)?this._removeDateFromSelection(n):this._addDateToSelection(n)}}if(r==i||r==s||r==o||r==u){n||(n=g.addMonths(this.get("date"),t),l=0),e.preventDefault();var d=g.addDays(n,l),v=this.get("date"),m=g.addMonths(this.get("date"),this._paneNumber-1),y=new Date(m);m.setDate(g.daysInMonth(m)),g.isInRange(d,v,m)?this._highlightDateNode(d):g.isGreater(v,d)?g.isGreaterOrEqual(this.get("minimumDate"),v)||(this.set("date",g.addMonths(v,-1)),this._highlightDateNode(d)):g.isGreater(d,m)&&(g.isGreaterOrEqual(y,this.get("maximumDate"))||(this.set("date",g.addMonths(v,1)),this._highlightDateNode(d)))}},_clickCalendar:function(e){var t=e.currentTarget,n=t.hasClass(p)&&!t.hasClass(d)&&!t.hasClass(v),r=t.hasClass(c);switch(this.get("selectionMode")){case"single":n&&(r||(this._clearSelection(!0),this._addDateToSelection(this._nodeToDate(t))));break;case"multiple-sticky":n&&(r?this._removeDateFromSelection(this._nodeToDate(t)):this._addDateToSelection(this._nodeToDate(t)));break;case"multiple":if(n)if(!e.metaKey&&!e.ctrlKey&&!e.shiftKey)this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate);else if((w=="macintosh"&&e.metaKey||w!="macintosh"&&e.ctrlKey)&&!e.shiftKey)r?(this._removeDateFromSelection(this._nodeToDate(t)),this._lastSelectedDate=null):(this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate));else if((w=="macintosh"&&e.metaKey||w!="macintosh"&&e.ctrlKey)&&e.shiftKey)if(this._lastSelectedDate){var i=this._nodeToDate(t);this._addDateRangeToSelection(i,this._lastSelectedDate),this._lastSelectedDate=i}else this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate);else if(e.shiftKey)if(this._lastSelectedDate){var i=this._nodeToDate(t);this._clearSelection(!0),this._addDateRangeToSelection(i,this._lastSelectedDate),this._lastSelectedDate=i}else this._clearSelection(!0),this._lastSelectedDate=this._nodeToDate(t),this._addDateToSelection(this._lastSelectedDate)}n?this.fire("dateClick",{cell:t,date:this._nodeToDate(t)}):t.hasClass(d)?this.fire("prevMonthClick"):t.hasClass(v)&&this.fire("nextMonthClick")},subtractMonth:function(e){this.set("date",g.addMonths(this.get("date"),-1)),e&&e.halt()},subtractYear:function(e){this.set("date",g.addYears(this.get("date"),-1)),e&&e.halt()},addMonth:function(e){this.set("date",g.addMonths(this.get("date"),1)),e&&e.halt()},addYear:function(e){this.set("date",g.addYears(this.get("date"),1)),e&&e.halt()}},{NAME:"calendar",ATTRS:{selectionMode:{value:"single"},date:{value:new Date,lazyAdd:!1,setter:function(e){var t=this._normalizeDate(e),n=g.addMonths(t,this._paneNumber-1),r=this.get("minimumDate"),i=this.get("maximumDate");if((!r||g.isGreaterOrEqual(t,r))&&(!i||g.isGreaterOrEqual(i,n)))return t;if(r&&g.isGreater(r,t))return r;if(i&&g.isGreater(n,i)){var s=g.addMonths(i,-1*(this._paneNumber-1));return s}}},minimumDate:{value:null,setter:function(e){if(e){var t=this.get("date"),n=this._normalizeDate(e);return t&&!g.isGreaterOrEqual(t,n)&&this.set("date",n),n}return this._normalizeDate(e)}},maximumDate:{value:null,setter:function(e){if(e){var t=this.get("date"),n=this._normalizeDate(e);return t&&!g.isGreaterOrEqual(e,g.addMonths(t,this._paneNumber-1))&&this.set("date",g.addMonths(n,-1*(this._paneNumber-1))),n}return e}}}})},"3.7.3",{requires:["calendar-base","calendarnavigator"],lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],skinnable:!0});
bundle/calendar/calendar.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -550,4 +550,4 @@ } }); -}, '3.7.2', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});+}, '3.7.3', {"requires": ["calendar-base", "calendarnavigator"], "lang": ["de", "en", "fr", "ja", "nb-NO", "pt-BR", "ru", "zh-HANT-TW"], "skinnable": true});
bundle/calendar/lang/calendar.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar",function(e){e.Intl.add("calendar","",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]})},"3.7.2");+YUI.add("lang/calendar",function(e){e.Intl.add("calendar","",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]})},"3.7.3");
bundle/calendar/lang/calendar_de.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_de",function(e){e.Intl.add("calendar","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar_de",function(e){e.Intl.add("calendar","de",{weekdays:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],very_short_weekdays:["So","Mo","Di","Mi","Do","Fr","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar/lang/calendar_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_en",function(e){e.Intl.add("calendar","en",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]})},"3.7.2");+YUI.add("lang/calendar_en",function(e){e.Intl.add("calendar","en",{weekdays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],short_weekdays:["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],very_short_weekdays:["Mo","Tu","We","Th","Fr","Sa","Su"]})},"3.7.3");
bundle/calendar/lang/calendar_fr.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_fr",function(e){e.Intl.add("calendar","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar_fr",function(e){e.Intl.add("calendar","fr",{weekdays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],short_weekdays:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],very_short_weekdays:["Di","Lu","Ma","Me","Je","Ve","Sa"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar/lang/calendar_ja.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_ja",function(e){e.Intl.add("calendar","ja",{weekdays:["\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5","\u65e5\u66dc\u65e5"],short_weekdays:["\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc","\u65e5\u66dc"],very_short_weekdays:["\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f","\u65e5"]})},"3.7.2");+YUI.add("lang/calendar_ja",function(e){e.Intl.add("calendar","ja",{weekdays:["\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5","\u65e5\u66dc\u65e5"],short_weekdays:["\u6708\u66dc","\u706b\u66dc","\u6c34\u66dc","\u6728\u66dc","\u91d1\u66dc","\u571f\u66dc","\u65e5\u66dc"],very_short_weekdays:["\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f","\u65e5"]})},"3.7.3");
bundle/calendar/lang/calendar_nb-NO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_nb-NO",function(e){e.Intl.add("calendar","nb-NO",{weekdays:["S\u00f8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\u00f8rdag"],very_short_weekdays:["S\u00f8","Ma","Ti","On","To","Fr","L\u00f8"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar_nb-NO",function(e){e.Intl.add("calendar","nb-NO",{weekdays:["S\u00f8ndag","Mandag","Tirsdag","Onsdag","Torsdag","Fredag","L\u00f8rdag"],very_short_weekdays:["S\u00f8","Ma","Ti","On","To","Fr","L\u00f8"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar/lang/calendar_pt-BR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_pt-BR",function(e){e.Intl.add("calendar","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00e7a","Quarta","Quinta","Sexta","S\u00e1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]})},"3.7.2");+YUI.add("lang/calendar_pt-BR",function(e){e.Intl.add("calendar","pt-BR",{weekdays:["Domingo","Segunda","Ter\u00e7a","Quarta","Quinta","Sexta","S\u00e1bado"],short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"],very_short_weekdays:["Dom","Seg","Ter","Qua","Qui","Sex","Sab"]})},"3.7.3");
bundle/calendar/lang/calendar_ru.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_ru",function(e){e.Intl.add("calendar","ru",{weekdays:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],very_short_weekdays:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],first_weekday:1,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar_ru",function(e){e.Intl.add("calendar","ru",{weekdays:["\u0412\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u041f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0412\u0442\u043e\u0440\u043d\u0438\u043a","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041f\u044f\u0442\u043d\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043e\u0442\u0430"],very_short_weekdays:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],first_weekday:1,weekends:[0,6]})},"3.7.3");
bundle/calendar/lang/calendar_zh-HANT-TW.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/calendar_zh-HANT-TW",function(e){e.Intl.add("calendar","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]})},"3.7.2");+YUI.add("lang/calendar_zh-HANT-TW",function(e){e.Intl.add("calendar","zh-HANT-TW",{weekdays:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],short_weekdays:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],very_short_weekdays:["\u65e5","\u4e00","\u4e8c","\u4e09","\u56db","\u4e94","\u516d"],first_weekday:0,weekends:[0,6]})},"3.7.3");
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/calendarnavigator/calendarnavigator.js", code: [] };-_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].code=["YUI.add('calendarnavigator', function (Y, NAME) {","","/**"," * Provides a plugin which adds navigation controls to Calendar."," *"," * @module calendarnavigator"," */","var CONTENT_BOX = \"contentBox\","," HOST = \"host\","," RENDERED = \"rendered\","," getCN = Y.ClassNameManager.getClassName,"," substitute = Y.substitute,"," node = Y.Node,"," create = node.create,"," CALENDAR = 'calendar',"," CALENDARNAV = 'calendarnav',"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_PREV_M = getCN(CALENDARNAV, 'prevmonth'),"," CAL_NEXT_M = getCN(CALENDARNAV, 'nextmonth'),"," CAL_DIS_M = getCN(CALENDARNAV, 'month-disabled'),"," ydate = Y.DataType.Date;","/**"," * A plugin class which adds navigation controls to Calendar."," *"," * @class CalendarNavigator"," * @extends Plugin.Base"," * @namespace Plugin"," */","function CalendarNavigator(config) {"," CalendarNavigator.superclass.constructor.apply(this, arguments);","}","","/**"," * The namespace for the plugin. This will be the property on the widget, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"navigator\""," */","CalendarNavigator.NS = \"navigator\";","","/**"," * The NAME of the CalendarNavigator class. Used to prefix events generated"," * by the plugin class."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginCalendarNavigator\""," */","CalendarNavigator.NAME = \"pluginCalendarNavigator\";","","","/**"," * Static property used to define the default attribute "," * configuration for the plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */","CalendarNavigator.ATTRS = {",""," /**"," * The number of months to shift by when the control arrows are clicked."," *"," * @attribute shiftByMonths"," * @type Number"," * @default 1 (months)"," */"," shiftByMonths : {"," value: 1"," }","};",""," /**"," * The CSS classnames for the calendar navigator controls."," * @property CALENDARNAV_STRINGS"," * @type Object"," * @readOnly"," * @protected"," * @static"," */ ","CalendarNavigator.CALENDARNAV_STRINGS = {"," prev_month_class: CAL_PREV_M,"," next_month_class: CAL_NEXT_M","};",""," /**"," * The template for the calendar navigator previous month control."," * @property PREV_MONTH_CONTROL_TEMPLATE"," * @type String"," * @protected"," * @static"," */ ","CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE = '<a class=\"yui3-u {prev_month_class}\" role=\"button\" aria-label=\"{prev_month_arialabel}\" tabindex=\"{control_tabindex}\">' + "," \"<span><</span>\" +"," '</a>';"," /**"," * The template for the calendar navigator next month control."," * @property NEXT_MONTH_CONTROL_TEMPLATE"," * @type String"," * @readOnly"," * @protected"," * @static"," */ ","CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE = '<a class=\"yui3-u {next_month_class}\" role=\"button\" aria-label=\"{next_month_arialabel}\" tabindex=\"{control_tabindex}\">' + "," \"<span>></span>\" +"," '</a>';","","","Y.extend(CalendarNavigator, Y.Plugin.Base, {",""," _eventAttachments : {},"," _controls: {},",""," /**"," * The initializer lifecycle implementation. Modifies the host widget's "," * render to add navigation controls."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {",""," // After the host has rendered its UI, place the navigation cotnrols"," this._controls = {};"," this._eventAttachments = {};",""," this.afterHostMethod(\"renderUI\", this._initNavigationControls);"," },",""," /**"," * The initializer destructor implementation. Responsible for destroying the initialized"," * control mechanisms."," * "," * @method destructor"," */"," destructor : function() {"," "," },",""," /**"," * Private utility method that focuses on a navigation button when it is clicked"," * or pressed with a keyboard."," * "," * @method _focusNavigation"," * @param {Event} ev Click or keydown event from the controls"," * @protected"," */"," _focusNavigation : function (ev) {"," ev.currentTarget.focus();"," },",""," /**"," * Private utility method that subtracts months from the host calendar date"," * based on the control click and the shiftByMonths property."," * "," * @method _subtractMonths"," * @param {Event} ev Click event from the controls"," * @protected"," */"," _subtractMonths : function (ev) {"," if ( (ev.type === \"click\") || (ev.type === \"keydown\" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {"," var host = this.get(HOST);"," var oldDate = host.get(\"date\");"," host.set(\"date\", ydate.addMonths(oldDate, -1*this.get(\"shiftByMonths\")));"," ev.preventDefault();"," }"," },",""," /**"," * Private utility method that adds months to the host calendar date"," * based on the control click and the shiftByMonths property."," * "," * @method _addMonths"," * @param {Event} ev Click event from the controls"," * @protected"," */"," _addMonths : function (ev) {"," if ( (ev.type === \"click\") || (ev.type === \"keydown\" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {"," var host = this.get(HOST);"," var oldDate = host.get(\"date\");"," host.set(\"date\", ydate.addMonths(oldDate, this.get(\"shiftByMonths\")));"," ev.preventDefault();"," }"," },","",""," _updateControlState : function () {",""," var host = this.get(HOST);"," if (ydate.areEqual(host.get(\"minimumDate\"), host.get(\"date\"))) {"," if (this._eventAttachments.prevMonth) {"," this._eventAttachments.prevMonth.detach();"," this._eventAttachments.prevMonth = false;"," }",""," if (!this._controls.prevMonth.hasClass(CAL_DIS_M)) {"," this._controls.prevMonth.addClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"true\");"," }"," }"," else {"," if (!this._eventAttachments.prevMonth) {"," this._eventAttachments.prevMonth = this._controls.prevMonth.on([\"click\", \"keydown\"], this._subtractMonths, this);"," }"," if (this._controls.prevMonth.hasClass(CAL_DIS_M)) {"," this._controls.prevMonth.removeClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"false\");"," }"," }",""," if (ydate.areEqual(host.get(\"maximumDate\"), ydate.addMonths(host.get(\"date\"), host._paneNumber - 1))) {"," if (this._eventAttachments.nextMonth) {"," this._eventAttachments.nextMonth.detach();"," this._eventAttachments.nextMonth = false;"," }",""," if (!this._controls.nextMonth.hasClass(CAL_DIS_M)) {"," this._controls.nextMonth.addClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"true\");"," }"," }"," else {"," if (!this._eventAttachments.nextMonth) {"," this._eventAttachments.nextMonth = this._controls.nextMonth.on([\"click\", \"keydown\"], this._addMonths, this);"," }"," if (this._controls.nextMonth.hasClass(CAL_DIS_M)) {"," this._controls.nextMonth.removeClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"false\");"," }"," }",""," this._controls.prevMonth.on([\"click\", \"keydown\"], this._focusNavigation, this);"," this._controls.nextMonth.on([\"click\", \"keydown\"], this._focusNavigation, this);"," },","","","",""," /**"," * Private render assist method that renders the previous month control"," * "," * @method _renderPrevControls"," * @private"," */"," _renderPrevControls : function () {"," var prevControlNode = create(substitute (CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE,"," CalendarNavigator.CALENDARNAV_STRINGS));"," prevControlNode.on(\"selectstart\", this.get(HOST)._preventSelectionStart);",""," return prevControlNode; "," },",""," /**"," * Private render assist method that renders the next month control"," * "," * @method _renderNextControls"," * @private"," */"," _renderNextControls : function () {"," var nextControlNode = create(substitute (CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE,"," CalendarNavigator.CALENDARNAV_STRINGS));"," nextControlNode.on(\"selectstart\", this.get(HOST)._preventSelectionStart);"," "," return nextControlNode; "," },",""," /**"," * Protected render assist method that initialized and renders the navigation controls."," * @method _initNavigationControls"," * @protected"," */"," _initNavigationControls : function() {"," var host = this.get(HOST);"," CalendarNavigator.CALENDARNAV_STRINGS[\"control_tabindex\"] = host.get(\"tabIndex\");"," CalendarNavigator.CALENDARNAV_STRINGS[\"prev_month_arialabel\"] = \"Go to previous month\";"," CalendarNavigator.CALENDARNAV_STRINGS[\"next_month_arialabel\"] = \"Go to next month\";",""," var headerCell = host.get(CONTENT_BOX).one(\".\" + CAL_HD);",""," this._controls.prevMonth = this._renderPrevControls();"," this._controls.nextMonth = this._renderNextControls();",""," this._updateControlState();",""," host.after(\"dateChange\", this._updateControlState, this);",""," headerCell.prepend(this._controls.prevMonth);"," headerCell.append(this._controls.nextMonth);"," }","});","","Y.namespace(\"Plugin\").CalendarNavigator = CalendarNavigator;","","}, '3.7.2', {\"requires\": [\"plugin\", \"classnamemanager\", \"datatype-date\", \"node\", \"substitute\"], \"skinnable\": true});"];+_yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].code=["YUI.add('calendarnavigator', function (Y, NAME) {","","/**"," * Provides a plugin which adds navigation controls to Calendar."," *"," * @module calendarnavigator"," */","var CONTENT_BOX = \"contentBox\","," HOST = \"host\","," RENDERED = \"rendered\","," getCN = Y.ClassNameManager.getClassName,"," substitute = Y.substitute,"," node = Y.Node,"," create = node.create,"," CALENDAR = 'calendar',"," CALENDARNAV = 'calendarnav',"," CAL_HD = getCN(CALENDAR, 'header'),"," CAL_PREV_M = getCN(CALENDARNAV, 'prevmonth'),"," CAL_NEXT_M = getCN(CALENDARNAV, 'nextmonth'),"," CAL_DIS_M = getCN(CALENDARNAV, 'month-disabled'),"," ydate = Y.DataType.Date;","/**"," * A plugin class which adds navigation controls to Calendar."," *"," * @class CalendarNavigator"," * @extends Plugin.Base"," * @namespace Plugin"," */","function CalendarNavigator(config) {"," CalendarNavigator.superclass.constructor.apply(this, arguments);","}","","/**"," * The namespace for the plugin. This will be the property on the widget, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"navigator\""," */","CalendarNavigator.NS = \"navigator\";","","/**"," * The NAME of the CalendarNavigator class. Used to prefix events generated"," * by the plugin class."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginCalendarNavigator\""," */","CalendarNavigator.NAME = \"pluginCalendarNavigator\";","","","/**"," * Static property used to define the default attribute "," * configuration for the plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */","CalendarNavigator.ATTRS = {",""," /**"," * The number of months to shift by when the control arrows are clicked."," *"," * @attribute shiftByMonths"," * @type Number"," * @default 1 (months)"," */"," shiftByMonths : {"," value: 1"," }","};",""," /**"," * The CSS classnames for the calendar navigator controls."," * @property CALENDARNAV_STRINGS"," * @type Object"," * @readOnly"," * @protected"," * @static"," */ ","CalendarNavigator.CALENDARNAV_STRINGS = {"," prev_month_class: CAL_PREV_M,"," next_month_class: CAL_NEXT_M","};",""," /**"," * The template for the calendar navigator previous month control."," * @property PREV_MONTH_CONTROL_TEMPLATE"," * @type String"," * @protected"," * @static"," */ ","CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE = '<a class=\"yui3-u {prev_month_class}\" role=\"button\" aria-label=\"{prev_month_arialabel}\" tabindex=\"{control_tabindex}\">' + "," \"<span><</span>\" +"," '</a>';"," /**"," * The template for the calendar navigator next month control."," * @property NEXT_MONTH_CONTROL_TEMPLATE"," * @type String"," * @readOnly"," * @protected"," * @static"," */ ","CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE = '<a class=\"yui3-u {next_month_class}\" role=\"button\" aria-label=\"{next_month_arialabel}\" tabindex=\"{control_tabindex}\">' + "," \"<span>></span>\" +"," '</a>';","","","Y.extend(CalendarNavigator, Y.Plugin.Base, {",""," _eventAttachments : {},"," _controls: {},",""," /**"," * The initializer lifecycle implementation. Modifies the host widget's "," * render to add navigation controls."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {",""," // After the host has rendered its UI, place the navigation cotnrols"," this._controls = {};"," this._eventAttachments = {};",""," this.afterHostMethod(\"renderUI\", this._initNavigationControls);"," },",""," /**"," * The initializer destructor implementation. Responsible for destroying the initialized"," * control mechanisms."," * "," * @method destructor"," */"," destructor : function() {"," "," },",""," /**"," * Private utility method that focuses on a navigation button when it is clicked"," * or pressed with a keyboard."," * "," * @method _focusNavigation"," * @param {Event} ev Click or keydown event from the controls"," * @protected"," */"," _focusNavigation : function (ev) {"," ev.currentTarget.focus();"," },",""," /**"," * Private utility method that subtracts months from the host calendar date"," * based on the control click and the shiftByMonths property."," * "," * @method _subtractMonths"," * @param {Event} ev Click event from the controls"," * @protected"," */"," _subtractMonths : function (ev) {"," if ( (ev.type === \"click\") || (ev.type === \"keydown\" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {"," var host = this.get(HOST);"," var oldDate = host.get(\"date\");"," host.set(\"date\", ydate.addMonths(oldDate, -1*this.get(\"shiftByMonths\")));"," ev.preventDefault();"," }"," },",""," /**"," * Private utility method that adds months to the host calendar date"," * based on the control click and the shiftByMonths property."," * "," * @method _addMonths"," * @param {Event} ev Click event from the controls"," * @protected"," */"," _addMonths : function (ev) {"," if ( (ev.type === \"click\") || (ev.type === \"keydown\" && (ev.keyCode == 13 || ev.keyCode == 32)) ) {"," var host = this.get(HOST);"," var oldDate = host.get(\"date\");"," host.set(\"date\", ydate.addMonths(oldDate, this.get(\"shiftByMonths\")));"," ev.preventDefault();"," }"," },","",""," _updateControlState : function () {",""," var host = this.get(HOST);"," if (ydate.areEqual(host.get(\"minimumDate\"), host.get(\"date\"))) {"," if (this._eventAttachments.prevMonth) {"," this._eventAttachments.prevMonth.detach();"," this._eventAttachments.prevMonth = false;"," }",""," if (!this._controls.prevMonth.hasClass(CAL_DIS_M)) {"," this._controls.prevMonth.addClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"true\");"," }"," }"," else {"," if (!this._eventAttachments.prevMonth) {"," this._eventAttachments.prevMonth = this._controls.prevMonth.on([\"click\", \"keydown\"], this._subtractMonths, this);"," }"," if (this._controls.prevMonth.hasClass(CAL_DIS_M)) {"," this._controls.prevMonth.removeClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"false\");"," }"," }",""," if (ydate.areEqual(host.get(\"maximumDate\"), ydate.addMonths(host.get(\"date\"), host._paneNumber - 1))) {"," if (this._eventAttachments.nextMonth) {"," this._eventAttachments.nextMonth.detach();"," this._eventAttachments.nextMonth = false;"," }",""," if (!this._controls.nextMonth.hasClass(CAL_DIS_M)) {"," this._controls.nextMonth.addClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"true\");"," }"," }"," else {"," if (!this._eventAttachments.nextMonth) {"," this._eventAttachments.nextMonth = this._controls.nextMonth.on([\"click\", \"keydown\"], this._addMonths, this);"," }"," if (this._controls.nextMonth.hasClass(CAL_DIS_M)) {"," this._controls.nextMonth.removeClass(CAL_DIS_M).setAttribute(\"aria-disabled\", \"false\");"," }"," }",""," this._controls.prevMonth.on([\"click\", \"keydown\"], this._focusNavigation, this);"," this._controls.nextMonth.on([\"click\", \"keydown\"], this._focusNavigation, this);"," },","","","",""," /**"," * Private render assist method that renders the previous month control"," * "," * @method _renderPrevControls"," * @private"," */"," _renderPrevControls : function () {"," var prevControlNode = create(substitute (CalendarNavigator.PREV_MONTH_CONTROL_TEMPLATE,"," CalendarNavigator.CALENDARNAV_STRINGS));"," prevControlNode.on(\"selectstart\", this.get(HOST)._preventSelectionStart);",""," return prevControlNode; "," },",""," /**"," * Private render assist method that renders the next month control"," * "," * @method _renderNextControls"," * @private"," */"," _renderNextControls : function () {"," var nextControlNode = create(substitute (CalendarNavigator.NEXT_MONTH_CONTROL_TEMPLATE,"," CalendarNavigator.CALENDARNAV_STRINGS));"," nextControlNode.on(\"selectstart\", this.get(HOST)._preventSelectionStart);"," "," return nextControlNode; "," },",""," /**"," * Protected render assist method that initialized and renders the navigation controls."," * @method _initNavigationControls"," * @protected"," */"," _initNavigationControls : function() {"," var host = this.get(HOST);"," CalendarNavigator.CALENDARNAV_STRINGS[\"control_tabindex\"] = host.get(\"tabIndex\");"," CalendarNavigator.CALENDARNAV_STRINGS[\"prev_month_arialabel\"] = \"Go to previous month\";"," CalendarNavigator.CALENDARNAV_STRINGS[\"next_month_arialabel\"] = \"Go to next month\";",""," var headerCell = host.get(CONTENT_BOX).one(\".\" + CAL_HD);",""," this._controls.prevMonth = this._renderPrevControls();"," this._controls.nextMonth = this._renderNextControls();",""," this._updateControlState();",""," host.after(\"dateChange\", this._updateControlState, this);",""," headerCell.prepend(this._controls.prevMonth);"," headerCell.append(this._controls.nextMonth);"," }","});","","Y.namespace(\"Plugin\").CalendarNavigator = CalendarNavigator;","","}, '3.7.3', {\"requires\": [\"plugin\", \"classnamemanager\", \"datatype-date\", \"node\", \"substitute\"], \"skinnable\": true});"]; _yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].lines = {"1":0,"8":0,"29":0,"30":0,"42":0,"53":0,"64":0,"86":0,"98":0,"109":0,"114":0,"129":0,"130":0,"132":0,"154":0,"166":0,"167":0,"168":0,"169":0,"170":0,"183":0,"184":0,"185":0,"186":0,"187":0,"194":0,"195":0,"196":0,"197":0,"198":0,"201":0,"202":0,"206":0,"207":0,"209":0,"210":0,"214":0,"215":0,"216":0,"217":0,"220":0,"221":0,"225":0,"226":0,"228":0,"229":0,"233":0,"234":0,"247":0,"249":0,"251":0,"261":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"279":0,"281":0,"282":0,"284":0,"286":0,"288":0,"289":0,"293":0}; _yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].functions = {"CalendarNavigator:29":0,"initializer:126":0,"_focusNavigation:153":0,"_subtractMonths:165":0,"_addMonths:182":0,"_updateControlState:192":0,"_renderPrevControls:246":0,"_renderNextControls:260":0,"_initNavigationControls:273":0,"(anonymous 1):1":0}; _yuitest_coverage["build/calendarnavigator/calendarnavigator.js"].coveredLines = 66;@@ -407,4 +407,4 @@ _yuitest_coverline("build/calendarnavigator/calendarnavigator.js", 293); Y.namespace("Plugin").CalendarNavigator = CalendarNavigator; -}, '3.7.2', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -298,4 +298,4 @@ Y.namespace("Plugin").CalendarNavigator = CalendarNavigator; -}, '3.7.2', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("calendarnavigator",function(e,t){function m(e){m.superclass.constructor.apply(this,arguments)}var n="contentBox",r="host",i="rendered",s=e.ClassNameManager.getClassName,o=e.substitute,u=e.Node,a=u.create,f="calendar",l="calendarnav",c=s(f,"header"),h=s(l,"prevmonth"),p=s(l,"nextmonth"),d=s(l,"month-disabled"),v=e.DataType.Date;m.NS="navigator",m.NAME="pluginCalendarNavigator",m.ATTRS={shiftByMonths:{value:1}},m.CALENDARNAV_STRINGS={prev_month_class:h,next_month_class:p},m.PREV_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}"><span><</span></a>',m.NEXT_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}"><span>></span></a>',e.extend(m,e.Plugin.Base,{_eventAttachments:{},_controls:{},initializer:function(e){this._controls={},this._eventAttachments={},this.afterHostMethod("renderUI",this._initNavigationControls)},destructor:function(){},_focusNavigation:function(e){e.currentTarget.focus()},_subtractMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,-1*this.get("shiftByMonths"))),e.preventDefault()}},_addMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,this.get("shiftByMonths"))),e.preventDefault()}},_updateControlState:function(){var e=this.get(r);v.areEqual(e.get("minimumDate"),e.get("date"))?(this._eventAttachments.prevMonth&&(this._eventAttachments.prevMonth.detach(),this._eventAttachments.prevMonth=!1),this._controls.prevMonth.hasClass(d)||this._controls.prevMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.prevMonth||(this._eventAttachments.prevMonth=this._controls.prevMonth.on(["click","keydown"],this._subtractMonths,this)),this._controls.prevMonth.hasClass(d)&&this._controls.prevMonth.removeClass(d).setAttribute("aria-disabled","false")),v.areEqual(e.get("maximumDate"),v.addMonths(e.get("date"),e._paneNumber-1))?(this._eventAttachments.nextMonth&&(this._eventAttachments.nextMonth.detach(),this._eventAttachments.nextMonth=!1),this._controls.nextMonth.hasClass(d)||this._controls.nextMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.nextMonth||(this._eventAttachments.nextMonth=this._controls.nextMonth.on(["click","keydown"],this._addMonths,this)),this._controls.nextMonth.hasClass(d)&&this._controls.nextMonth.removeClass(d).setAttribute("aria-disabled","false")),this._controls.prevMonth.on(["click","keydown"],this._focusNavigation,this),this._controls.nextMonth.on(["click","keydown"],this._focusNavigation,this)},_renderPrevControls:function(){var e=a(o(m.PREV_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_renderNextControls:function(){var e=a(o(m.NEXT_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_initNavigationControls:function(){var e=this.get(r);m.CALENDARNAV_STRINGS.control_tabindex=e.get("tabIndex"),m.CALENDARNAV_STRINGS.prev_month_arialabel="Go to previous month",m.CALENDARNAV_STRINGS.next_month_arialabel="Go to next month";var t=e.get(n).one("."+c);this._controls.prevMonth=this._renderPrevControls(),this._controls.nextMonth=this._renderNextControls(),this._updateControlState(),e.after("dateChange",this._updateControlState,this),t.prepend(this._controls.prevMonth),t.append(this._controls.nextMonth)}}),e.namespace("Plugin").CalendarNavigator=m},"3.7.2",{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0});+YUI.add("calendarnavigator",function(e,t){function m(e){m.superclass.constructor.apply(this,arguments)}var n="contentBox",r="host",i="rendered",s=e.ClassNameManager.getClassName,o=e.substitute,u=e.Node,a=u.create,f="calendar",l="calendarnav",c=s(f,"header"),h=s(l,"prevmonth"),p=s(l,"nextmonth"),d=s(l,"month-disabled"),v=e.DataType.Date;m.NS="navigator",m.NAME="pluginCalendarNavigator",m.ATTRS={shiftByMonths:{value:1}},m.CALENDARNAV_STRINGS={prev_month_class:h,next_month_class:p},m.PREV_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {prev_month_class}" role="button" aria-label="{prev_month_arialabel}" tabindex="{control_tabindex}"><span><</span></a>',m.NEXT_MONTH_CONTROL_TEMPLATE='<a class="yui3-u {next_month_class}" role="button" aria-label="{next_month_arialabel}" tabindex="{control_tabindex}"><span>></span></a>',e.extend(m,e.Plugin.Base,{_eventAttachments:{},_controls:{},initializer:function(e){this._controls={},this._eventAttachments={},this.afterHostMethod("renderUI",this._initNavigationControls)},destructor:function(){},_focusNavigation:function(e){e.currentTarget.focus()},_subtractMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,-1*this.get("shiftByMonths"))),e.preventDefault()}},_addMonths:function(e){if(e.type==="click"||e.type==="keydown"&&(e.keyCode==13||e.keyCode==32)){var t=this.get(r),n=t.get("date");t.set("date",v.addMonths(n,this.get("shiftByMonths"))),e.preventDefault()}},_updateControlState:function(){var e=this.get(r);v.areEqual(e.get("minimumDate"),e.get("date"))?(this._eventAttachments.prevMonth&&(this._eventAttachments.prevMonth.detach(),this._eventAttachments.prevMonth=!1),this._controls.prevMonth.hasClass(d)||this._controls.prevMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.prevMonth||(this._eventAttachments.prevMonth=this._controls.prevMonth.on(["click","keydown"],this._subtractMonths,this)),this._controls.prevMonth.hasClass(d)&&this._controls.prevMonth.removeClass(d).setAttribute("aria-disabled","false")),v.areEqual(e.get("maximumDate"),v.addMonths(e.get("date"),e._paneNumber-1))?(this._eventAttachments.nextMonth&&(this._eventAttachments.nextMonth.detach(),this._eventAttachments.nextMonth=!1),this._controls.nextMonth.hasClass(d)||this._controls.nextMonth.addClass(d).setAttribute("aria-disabled","true")):(this._eventAttachments.nextMonth||(this._eventAttachments.nextMonth=this._controls.nextMonth.on(["click","keydown"],this._addMonths,this)),this._controls.nextMonth.hasClass(d)&&this._controls.nextMonth.removeClass(d).setAttribute("aria-disabled","false")),this._controls.prevMonth.on(["click","keydown"],this._focusNavigation,this),this._controls.nextMonth.on(["click","keydown"],this._focusNavigation,this)},_renderPrevControls:function(){var e=a(o(m.PREV_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_renderNextControls:function(){var e=a(o(m.NEXT_MONTH_CONTROL_TEMPLATE,m.CALENDARNAV_STRINGS));return e.on("selectstart",this.get(r)._preventSelectionStart),e},_initNavigationControls:function(){var e=this.get(r);m.CALENDARNAV_STRINGS.control_tabindex=e.get("tabIndex"),m.CALENDARNAV_STRINGS.prev_month_arialabel="Go to previous month",m.CALENDARNAV_STRINGS.next_month_arialabel="Go to next month";var t=e.get(n).one("."+c);this._controls.prevMonth=this._renderPrevControls(),this._controls.nextMonth=this._renderNextControls(),this._updateControlState(),e.after("dateChange",this._updateControlState,this),t.prepend(this._controls.prevMonth),t.append(this._controls.nextMonth)}}),e.namespace("Plugin").CalendarNavigator=m},"3.7.3",{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -298,4 +298,4 @@ Y.namespace("Plugin").CalendarNavigator = CalendarNavigator; -}, '3.7.2', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "classnamemanager", "datatype-date", "node", "substitute"], "skinnable": true});
bundle/charts-base/charts-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/charts-base/charts-base.js", code: [] };-_yuitest_coverage["build/charts-base/charts-base.js"].code=["YUI.add('charts-base', function (Y, NAME) {","","/**"," * The Charts widget provides an api for displaying data"," * graphically."," *"," * @module charts"," * @main charts"," */","","/**"," * The charts-base submodule contains the core functionality for the charts module."," *"," * @module charts"," * @submodule charts-base"," */","var CONFIG = Y.config,"," WINDOW = CONFIG.win,"," DOCUMENT = CONFIG.doc,"," Y_Lang = Y.Lang,"," IS_STRING = Y_Lang.isString,"," Y_DOM = Y.DOM,"," LeftAxisLayout,"," RightAxisLayout,"," BottomAxisLayout,"," TopAxisLayout,"," _getClassName = Y.ClassNameManager.getClassName,"," SERIES_MARKER = _getClassName(\"seriesmarker\"),"," ShapeGroup,"," CircleGroup,"," RectGroup,"," EllipseGroup,"," DiamondGroup;","","/**"," * Abstract class for creating groups of shapes with the same styles and dimensions."," *"," * @class ShapeGroup"," * @constructor"," */"," ShapeGroup = function(cfg)"," {"," ShapeGroup.superclass.constructor.apply(this, arguments);"," };"," "," ShapeGroup.NAME = \"shapeGroup\";",""," Y.extend(ShapeGroup, Y.Path, { "," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var xvalues = this.get(\"xvalues\"),"," yvalues = this.get(\"yvalues\"),"," x,"," y,"," xRad,"," yRad,"," i = 0,"," len,"," attrs = [],"," dimensions = this.get(\"dimensions\"),"," width = dimensions.width,"," height = dimensions.height,"," radius = dimensions.radius,"," yRadius = dimensions.yRadius,"," id = this.get(\"id\"),"," className = this.node.className,"," widthIsArray = Y_Lang.isArray(width),"," heightIsArray = Y_Lang.isArray(height),"," radiusIsArray = Y_Lang.isArray(radius),"," yRadiusIsArray = Y_Lang.isArray(yRadius);"," if(xvalues && yvalues && xvalues.length > 0)"," {"," this.clear();",""," len = xvalues.length;"," for(; i < len; ++i)"," {"," x = xvalues[i];"," y = yvalues[i];"," xRad = radiusIsArray ? radius[i] : radius;"," yRad = yRadiusIsArray ? yRadius[i] : yRadius;"," if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))"," {"," this.drawShape({"," x: x,"," y: y,"," width: widthIsArray ? width[i] : width,"," height: heightIsArray ? height[i] : height,"," radius: xRad,"," yRadius: yRad "," });"," this.closePath();"," attrs[i] = {"," id: id + \"_\" + i,"," className: className,"," coords: (x - this._left) + \", \" + (y - this._top) + \", \" + radius,"," shape: \"circle\""," };"," }"," }"," this._closePath();"," }"," },",""," /**"," * Parses and array of lengths into radii"," *"," * @method _getRadiusCollection"," * @param {Array} val Array of lengths"," * @return Array"," * @private"," */"," _getRadiusCollection: function(val)"," {"," var i = 0,"," len = val.length,"," radii = [];"," for(; i < len; ++i)"," { "," radii[i] = val[i] * 0.5;"," }"," return radii;"," }"," });"," ","ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {"," dimensions: {"," getter: function()"," {"," var dimensions = this._dimensions,"," radius,"," yRadius,"," width,"," height;"," if(dimensions.hasOwnProperty(\"radius\"))"," {"," return dimensions;"," }"," else"," {"," width = dimensions.width;"," height = dimensions.height;"," radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);"," yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);"," return {"," width: width,"," height: height,"," radius: radius,"," yRadius: yRadius"," };"," }"," },",""," setter: function(val)"," {"," this._dimensions = val;"," return val;"," }"," },"," xvalues: {"," getter: function()"," {"," return this._xvalues;"," },"," setter: function(val)"," {"," this._xvalues = val;"," }"," },"," yvalues: {"," getter: function()"," {"," return this._yvalues;"," },"," setter: function(val)"," {"," this._yvalues = val;"," }"," }","});","Y.ShapeGroup = ShapeGroup;","/**"," * Abstract class for creating groups of circles with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class CircleGroup"," * @constructor"," */"," CircleGroup = function(cfg)"," {"," CircleGroup.superclass.constructor.apply(this, arguments);"," };"," "," CircleGroup.NAME = \"circleGroup\";",""," Y.extend(CircleGroup, Y.ShapeGroup, { "," /**"," * Algorithm for drawing shape."," *"," * @method drawShape"," * @param {Object} cfg Parameters used to draw the shape."," */"," drawShape: function(cfg)"," {"," this.drawCircle(cfg.x, cfg.y, cfg.radius);"," }"," });","","CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {"," dimensions: {"," getter: function()"," {"," var dimensions = this._dimensions,"," radius,"," yRadius,"," width,"," height;"," if(dimensions.hasOwnProperty(\"radius\"))"," {"," return dimensions;"," }"," else"," {"," width = dimensions.width;"," height = dimensions.height;"," radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);"," yRadius = radius;"," return {"," width: width,"," height: height,"," radius: radius,"," yRadius: yRadius"," };"," }"," }"," }","});"," ","CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.CircleGroup = CircleGroup;","/**"," * Abstract class for creating groups of rects with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class GroupRect"," * @constructor"," */"," RectGroup = function(cfg)"," {"," RectGroup.superclass.constructor.apply(this, arguments);"," };"," "," RectGroup.NAME = \"rectGroup\";",""," Y.extend(RectGroup, Y.ShapeGroup, { "," /**"," * Updates the rect."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","RectGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.RectGroup = RectGroup;","/**"," * Abstract class for creating groups of diamonds with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class GroupDiamond"," * @constructor"," */"," DiamondGroup = function(cfg)"," {"," DiamondGroup.superclass.constructor.apply(this, arguments);"," };"," "," DiamondGroup.NAME = \"diamondGroup\";",""," Y.extend(DiamondGroup, Y.ShapeGroup, { "," /**"," * Updates the diamond."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.DiamondGroup = DiamondGroup;","/**"," * Abstract class for creating groups of diamonds with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class EllipseGroup"," * @constructor"," */"," EllipseGroup = function(cfg)"," {"," EllipseGroup.superclass.constructor.apply(this, arguments);"," };"," "," EllipseGroup.NAME = \"diamondGroup\";",""," Y.extend(EllipseGroup, Y.ShapeGroup, { "," /**"," * Updates the diamond."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.EllipseGroup = EllipseGroup;","/**"," * The Renderer class is a base class for chart components that use the `styles`"," * attribute."," *"," * @module charts"," * @submodule charts-base"," * @class Renderer"," * @constructor"," */","function Renderer(){}","","Renderer.ATTRS = {"," /**"," * Style properties for class"," * "," * @attribute styles"," * @type Object"," */"," styles:"," {"," getter: function()"," {"," this._styles = this._styles || this._getDefaultStyles();"," return this._styles;"," },",""," setter: function(val)"," {"," this._styles = this._setStyles(val);"," }"," },"," "," /**"," * The graphic in which drawings will be rendered."," *"," * @attribute graphic"," * @type Graphic"," */"," graphic: {}","};","Renderer.NAME = \"renderer\";","","Renderer.prototype = {"," /**"," * Storage for `styles` attribute."," *"," * @property _styles"," * @type Object"," * @private"," */"," _styles: null,"," "," /**"," * Method used by `styles` setter."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," * @protected"," */"," _setStyles: function(newstyles)"," {"," var styles = this.get(\"styles\");"," return this._mergeStyles(newstyles, styles);"," },"," "," /**"," * Merges to object literals so that only specified properties are "," * overwritten."," *"," * @method _mergeStyles"," * @param {Object} a Hash of new styles"," * @param {Object} b Hash of original styles"," * @return Object"," * @protected"," */"," _mergeStyles: function(a, b)"," {"," if(!b)"," {"," b = {};"," }"," var newstyles = Y.merge(b, {});"," Y.Object.each(a, function(value, key, a)"," {"," if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))"," {"," newstyles[key] = this._mergeStyles(value, b[key]);"," }"," else"," {"," newstyles[key] = value;"," }"," }, this);"," return newstyles;"," },",""," /**"," * Gets the default value for the `styles` attribute. "," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," return {padding:{"," top:0,"," right: 0,"," bottom: 0,"," left: 0"," }};"," }","};","","Y.augment(Renderer, Y.Attribute);","Y.Renderer = Renderer;","","/**"," * Algorithmic strategy for rendering a left axis."," *"," * @module charts"," * @submodule charts-base"," * @class LeftAxisLayout"," * @constructor"," */","LeftAxisLayout = function() {};","","LeftAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 0,"," right: 4,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffset"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," "," switch(display)"," {"," case \"inside\" :"," host.set(\"rightTickOffset\", tickLength);"," host.set(\"leftTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"rightTickOffset\", 0);"," host.set(\"leftTickOffset\", tickLength);"," break;"," case \"cross\":"," host.set(\"rightTickOffset\", halfTick); "," host.set(\"leftTickOffset\", halfTick);"," break;"," default:"," host.set(\"rightTickOffset\", 0);"," host.set(\"leftTickOffset\", 0);"," break;"," }"," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt Point on the axis in which the tick will intersect."," * @param {Object} tickStyle Hash of properties to apply to the tick."," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:padding.left, y:pt.y},"," end = {x:tickLength + padding.left, y:pt.y};"," host.drawLine(path, start, end);"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @return {Object}"," * @protected"," */"," getLineStart: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:padding.left, y:0};"," if(display === \"outside\")"," {"," pt.x += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.x += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} point Point on the axis in which the tick will intersect."," * @return {Object} "," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x - this.get(\"leftTickOffset\"), y:point.y};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelWidth;"," }"," else if(absRot === 90)"," {"," max = labelHeight;"," }"," else"," {"," max = (cosRadians * labelWidth) + (sinRadians * labelHeight);"," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label width when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitWidth)"," {"," var host = this,"," w = host._explicitWidth,"," totalTitleSize = host._totalTitleSize,"," leftTickOffset = host.get(\"leftTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," w = bounds.right - bounds.left,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," x = (labelWidth * -0.5) + (w * 0.5),"," y = (host.get(\"height\") * 0.5) - (labelHeight * 0.5);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.left)"," {"," x += margin.left;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"leftTickOffset\"),"," totalTitleSize = this._totalTitleSize,"," leftOffset = pt.x + totalTitleSize - tickOffset,"," topOffset = pt.y,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," maxLabelSize = host._maxLabelSize,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(rot === 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset -= labelWidth * 0.5;"," }"," else if(rot === -90)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else"," {"," leftOffset -= labelWidth + (labelHeight * absRot/360);"," topOffset -= labelHeight * 0.5;"," }"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = Math.round(maxLabelSize + leftOffset);"," props.y = Math.round(topOffset);"," this._rotate(label, props);"," },",""," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," leftOffset,"," topOffset,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight;"," if(rot === 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," topOffset = 0;"," leftOffset = labelWidth * 0.5;"," }"," else if(rot === -90)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else"," {"," leftOffset = labelWidth + (labelHeight * absRot/360);"," topOffset = labelHeight * 0.5;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else if(rot === 90)"," {"," transformOrigin = [0.5, 0];"," }"," else if(rot === -90)"," {"," transformOrigin = [0.5, 1];"," }"," else"," {"," transformOrigin = [1, 0.5];"," }"," return transformOrigin;"," },",""," /**"," * Adjust the position of the Axis widget's content box for internal axes."," *"," * @method offsetNodeForTick"," * @param {Node} cb Content box of the Axis."," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," },",""," /**"," * Sets the width of the axis based on its contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," graphic = this.get(\"graphic\"),"," style = host.get(\"styles\"),"," label = style.label,"," tickOffset = host.get(\"leftTickOffset\"),"," max = host._maxLabelSize,"," totalTitleSize = this._totalTitleSize,"," ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);"," if(this._explicitWidth)"," {"," ttl = this._explicitWidth;"," }"," this.set(\"calculatedWidth\", ttl);"," graphic.set(\"x\", ttl - tickOffset);"," }","};","","Y.LeftAxisLayout = LeftAxisLayout;","/**"," * RightAxisLayout contains algorithms for rendering a right axis."," *"," * @module charts"," * @submodule charts-base"," * @class RightAxisLayout"," * @constructor"," */","RightAxisLayout = function(){};","","RightAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 4,"," right: 0,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffset"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," "," switch(display)"," {"," case \"inside\" :"," host.set(\"leftTickOffset\", tickLength);"," host.set(\"rightTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", tickLength);"," break;"," case \"cross\" :"," host.set(\"rightTickOffset\", halfTick);"," host.set(\"leftTickOffset\", halfTick);"," break;"," default:"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);"," break;"," }"," },",""," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt Point on the axis in which the tick will intersect."," * @param {Object) tickStyle Hash of properties to apply to the tick."," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:padding.left, y:pt.y},"," end = {x:padding.left + tickLength, y:pt.y};"," host.drawLine(path, start, end);"," },"," "," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @return {Object}"," * @protected"," */"," getLineStart: function()"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:padding.left, y:padding.top};"," if(display === \"inside\")"," {"," pt.x += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.x += tickLength/2;"," }"," return pt;"," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} point Point on the axis in which the tick will intersect."," * @return {Object} "," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x + this.get(\"rightTickOffset\"), y:point.y};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelWidth;"," }"," else if(absRot === 90)"," {"," max = labelHeight;"," }"," else"," {"," max = (cosRadians * labelWidth) + (sinRadians * labelHeight);"," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label width when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitWidth)"," {"," var host = this,"," w = host._explicitWidth,"," totalTitleSize = this._totalTitleSize,"," rightTickOffset = host.get(\"rightTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," w = bounds.right - bounds.left,"," x = this.get(\"width\") - (labelWidth * 0.5) - (w * 0.5),"," y = (host.get(\"height\") * 0.5) - (labelHeight * 0.5);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.right)"," {"," x -= margin.left;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"rightTickOffset\"),"," labelStyles = styles.label,"," margin = 0,"," leftOffset = pt.x,"," topOffset = pt.y,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(labelStyles.margin && labelStyles.margin.left)"," {"," margin = labelStyles.margin.left;"," }"," if(rot === 0)"," {"," topOffset -= labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else if(rot === -90)"," {"," leftOffset -= labelWidth * 0.5;"," }"," else"," {"," topOffset -= labelHeight * 0.5;"," leftOffset += labelHeight/2 * absRot/90;"," }"," leftOffset += margin;"," leftOffset += tickOffset;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = Math.round(leftOffset);"," props.y = Math.round(topOffset);"," this._rotate(label, props);"," },"," "," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," leftOffset = 0,"," topOffset = 0,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight;"," if(rot === 0)"," {"," topOffset = labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else if(rot === -90)"," {"," leftOffset = labelWidth * 0.5;"," }"," else"," {"," topOffset = labelHeight * 0.5;"," leftOffset = labelHeight/2 * absRot/90;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },"," "," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else if(rot === 90)"," {"," transformOrigin = [0.5, 1];"," }"," else if(rot === -90)"," {"," transformOrigin = [0.5, 0];"," }"," else"," {"," transformOrigin = [0, 0.5];"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," var host = this,"," tickOffset = host.get(\"leftTickOffset\"),"," offset = 0 - tickOffset;"," cb.setStyle(\"left\", offset);"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," styles = host.get(\"styles\"),"," labelStyle = styles.label,"," totalTitleSize = this._totalTitleSize,"," ttl = Math.round(host.get(\"rightTickOffset\") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);"," if(this._explicitWidth)"," {"," ttl = this._explicitWidth;"," }"," host.set(\"calculatedWidth\", ttl);"," host.get(\"contentBox\").setStyle(\"width\", ttl);"," }","};","","Y.RightAxisLayout = RightAxisLayout;","/**"," * Contains algorithms for rendering a bottom axis."," *"," * @module charts"," * @submodule charts-base"," * @class BottomAxisLayout"," * @Constructor"," */","BottomAxisLayout = function(){};","","BottomAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 4,"," left: 0,"," right: 0,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffsets"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);",""," switch(display)"," {"," case \"inside\" :"," host.set(\"topTickOffset\", tickLength);"," host.set(\"bottomTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", tickLength);"," break;"," case \"cross\":"," host.set(\"topTickOffset\", halfTick);"," host.set(\"bottomTickOffset\", halfTick);"," break;"," default:"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," break;"," }"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @protected"," */"," getLineStart: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:0, y:padding.top};"," if(display === \"inside\")"," {"," pt.y += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.y += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt hash containing x and y coordinates"," * @param {Object} tickStyles hash of properties used to draw the tick"," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:pt.x, y:padding.top},"," end = {x:pt.x, y:tickLength + padding.top};"," host.drawLine(path, start, end);"," },",""," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} pt Object containing x and y coordinates"," * @return Object"," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x, y:point.y + this.get(\"bottomTickOffset\")};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelHeight;"," }"," else if(absRot === 90)"," {"," max = labelWidth;"," }"," else"," {"," max = (sinRadians * labelWidth) + (cosRadians * labelHeight); "," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label height when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitHeight)"," {"," var host = this,"," h = host._explicitHeight,"," totalTitleSize = host._totalTitleSize,"," bottomTickOffset = host.get(\"bottomTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," h = bounds.bottom - bounds.top,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," x = (host.get(\"width\") * 0.5) - (labelWidth * 0.5),"," y = host.get(\"height\") - labelHeight/2 - h/2;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.bottom)"," {"," y -= margin.bottom;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },"," "," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"bottomTickOffset\"),"," labelStyles = styles.label,"," margin = 0,"," props = host._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," leftOffset = Math.round(pt.x),"," topOffset = Math.round(pt.y),"," labelWidth = host._labelWidths[i],"," labelHeight = host._labelHeights[i];"," if(labelStyles.margin && labelStyles.margin.top)"," {"," margin = labelStyles.margin.top;"," }"," if(rot > 0)"," {"," topOffset -= labelHeight/2 * rot/90;"," }"," else if(rot < 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight/2 * absRot/90;"," }"," else"," {"," leftOffset -= labelWidth * 0.5;"," }"," topOffset += margin;"," topOffset += tickOffset;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = leftOffset;"," props.y = topOffset;"," host._rotate(label, props);"," },"," "," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight,"," leftOffset,"," topOffset;",""," if(rot > 0)"," {"," leftOffset = 0;"," topOffset = labelHeight/2 * rot/90;"," }"," else if(rot < 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight/2 * absRot/90;"," }"," else"," {"," leftOffset = labelWidth * 0.5;"," topOffset = 0;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot > 0)"," {"," transformOrigin = [0, 0.5];"," }"," else if(rot < 0)"," {"," transformOrigin = [1, 0.5];"," }"," else"," {"," transformOrigin = [0, 0];"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," var host = this;"," host.get(\"contentBox\").setStyle(\"top\", 0 - host.get(\"topTickOffset\"));"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," styles = host.get(\"styles\"),"," labelStyle = styles.label,"," totalTitleSize = host._totalTitleSize,"," ttl = Math.round(host.get(\"bottomTickOffset\") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);"," if(host._explicitHeight)"," {"," ttl = host._explicitHeight;"," }"," host.set(\"calculatedHeight\", ttl);"," }","};","Y.BottomAxisLayout = BottomAxisLayout;","/**"," * Contains algorithms for rendering a top axis."," *"," * @module charts"," * @submodule charts-base"," * @class TopAxisLayout"," * @constructor"," */","TopAxisLayout = function(){};","","TopAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 0,"," right: 0,"," bottom: 4"," };"," },"," "," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffsets"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);"," switch(display)"," {"," case \"inside\" :"," host.set(\"bottomTickOffset\", tickLength);"," host.set(\"topTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"bottomTickOffset\", 0);"," host.set(\"topTickOffset\", tickLength);"," break;"," case \"cross\" :"," host.set(\"topTickOffset\", halfTick);"," host.set(\"bottomTickOffset\", halfTick);"," break;"," default:"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," break;"," }"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @protected"," */"," getLineStart: function()"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:0, y:padding.top};"," if(display === \"outside\")"," {"," pt.y += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.y += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt hash containing x and y coordinates"," * @param {Object} tickStyles hash of properties used to draw the tick"," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:pt.x, y:padding.top},"," end = {x:pt.x, y:tickLength + padding.top};"," host.drawLine(path, start, end);"," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} pt hash containing x and y coordinates"," * @return Object"," * @protected"," */"," getLabelPoint: function(pt)"," {"," return {x:pt.x, y:pt.y - this.get(\"topTickOffset\")};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelHeight;"," }"," else if(absRot === 90)"," {"," max = labelWidth;"," }"," else"," {"," max = (sinRadians * labelWidth) + (cosRadians * labelHeight); "," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },",""," /**"," * Determines the available label height when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitHeight)"," {"," var host = this,"," h = host._explicitHeight,"," totalTitleSize = host._totalTitleSize,"," topTickOffset = host.get(\"topTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," h = bounds.bottom - bounds.top,"," x = (host.get(\"width\") * 0.5) - (labelWidth * 0.5),"," y = h/2 - labelHeight/2;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.top)"," {"," y += margin.top;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," totalTitleSize = this._totalTitleSize,"," maxLabelSize = host._maxLabelSize,"," leftOffset = pt.x,"," topOffset = pt.y + totalTitleSize + maxLabelSize,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(rot === 0)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else"," {"," if(rot === 90)"," {"," leftOffset -= labelWidth;"," topOffset -= (labelHeight * 0.5);"," }"," else if (rot === -90)"," {"," topOffset -= (labelHeight * 0.5);"," } "," else if(rot > 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight - (labelHeight * rot/180);"," }"," else"," {"," topOffset -= labelHeight - (labelHeight * absRot/180);"," }"," }"," props.x = Math.round(leftOffset);"," props.y = Math.round(topOffset);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," this._rotate(label, props);"," },",""," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight,"," leftOffset,"," topOffset;"," if(rot === 0)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else"," {"," if(rot === 90)"," {"," leftOffset = labelWidth;"," topOffset = (labelHeight * 0.5);"," }"," else if (rot === -90)"," {"," topOffset = (labelHeight * 0.5);"," } "," else if(rot > 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight - (labelHeight * rot/180);"," }"," else"," {"," topOffset = labelHeight - (labelHeight * absRot/180);"," }"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else"," {"," if(rot === 90)"," {"," transformOrigin = [1, 0.5];"," }"," else if (rot === -90)"," {"," transformOrigin = [0, 0.5];"," } "," else if(rot > 0)"," {"," transformOrigin = [1, 0.5];"," }"," else"," {"," transformOrigin = [0, 0.5];"," }"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," graphic = host.get(\"graphic\"),"," styles = host.get(\"styles\"),"," labelMargin = styles.label.margin,"," totalLabelSize = labelMargin.bottom + host._maxLabelSize,"," totalTitleSize = host._totalTitleSize,"," topTickOffset = this.get(\"topTickOffset\"),"," ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);"," if(this._explicitHeight)"," {"," ttl = this._explicitWidth; "," }"," host.set(\"calculatedHeight\", ttl);"," graphic.set(\"y\", ttl - topTickOffset);"," }","};","Y.TopAxisLayout = TopAxisLayout;","","/**"," * The Axis class. Generates axes for a chart."," *"," * @module charts"," * @submodule charts-base"," * @class Axis"," * @extends Widget"," * @uses Renderer"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," */","Y.Axis = Y.Base.create(\"axis\", Y.Widget, [Y.Renderer], {"," /**"," * Storage for calculatedWidth value."," *"," * @property _calculatedWidth"," * @type Number"," * @private"," */"," _calculatedWidth: 0,",""," /**"," * Storage for calculatedHeight value."," *"," * @property _calculatedHeight"," * @type Number"," * @private"," */"," _calculatedHeight: 0,",""," /**"," * Handles change to the dataProvider"," * "," * @method _dataChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _dataChangeHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawAxis();"," }"," },",""," /**"," * Handles change to the position attribute"," *"," * @method _positionChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _positionChangeHandler: function(e)"," {"," this._updateGraphic(e.newVal);"," this._updateHandler();"," },",""," /**"," * Updates the the Graphic instance"," *"," * @method _updateGraphic"," * @param {String} position Position of axis "," * @private"," */"," _updateGraphic: function(position)"," {"," var graphic = this.get(\"graphic\");"," if(position == \"none\")"," {"," if(graphic)"," {"," graphic.destroy();"," }"," }"," else"," {"," if(!graphic)"," {"," this._setCanvas();"," }"," }"," },",""," /**"," * Handles changes to axis."," *"," * @method _updateHandler"," * @param {Object} e Event object"," * @private"," */"," _updateHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawAxis();"," }"," },"," "," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," this._updateGraphic(this.get(\"position\"));"," },",""," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var layout = this._layout,"," defaultMargins,"," styles,"," label,"," title,"," i;"," if(layout)"," {"," defaultMargins = layout._getDefaultMargins();"," styles = this.get(\"styles\");"," label = styles.label.margin;"," title =styles.title.margin;"," //need to defaultMargins method to the layout classes."," for(i in defaultMargins)"," {"," if(defaultMargins.hasOwnProperty(i))"," {"," label[i] = label[i] === undefined ? defaultMargins[i] : label[i];"," title[i] = title[i] === undefined ? defaultMargins[i] : title[i];"," }"," }"," }"," this._drawAxis();"," },",""," /**"," * Creates a graphic instance to be used for the axis line and ticks."," *"," * @method _setCanvas"," * @private"," */"," _setCanvas: function()"," {"," var cb = this.get(\"contentBox\"),"," bb = this.get(\"boundingBox\"),"," p = this.get(\"position\"),"," pn = this._parentNode,"," w = this.get(\"width\"),"," h = this.get(\"height\");"," bb.setStyle(\"position\", \"absolute\");"," bb.setStyle(\"zIndex\", 2);"," w = w ? w + \"px\" : pn.getStyle(\"width\");"," h = h ? h + \"px\" : pn.getStyle(\"height\");"," if(p === \"top\" || p === \"bottom\")"," {"," cb.setStyle(\"width\", w);"," }"," else"," {"," cb.setStyle(\"height\", h);"," }"," cb.setStyle(\"position\", \"relative\");"," cb.setStyle(\"left\", \"0px\");"," cb.setStyle(\"top\", \"0px\");"," this.set(\"graphic\", new Y.Graphic());"," this.get(\"graphic\").render(cb);"," },"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var axisstyles = {"," majorTicks: {"," display:\"inside\","," length:4,"," color:\"#dad8c9\","," weight:1,"," alpha:1"," },"," minorTicks: {"," display:\"none\","," length:2,"," color:\"#dad8c9\","," weight:1"," },"," line: {"," weight:1,"," color:\"#dad8c9\","," alpha:1"," },"," majorUnit: {"," determinant:\"count\","," count:11,"," distance:75"," },"," top: \"0px\","," left: \"0px\","," width: \"100px\","," height: \"100px\","," label: {"," color:\"#808080\","," alpha: 1,"," fontSize:\"85%\","," rotation: 0,"," margin: {"," top: undefined,"," right: undefined,"," bottom: undefined,"," left: undefined"," }"," },"," title: {"," color:\"#808080\","," alpha: 1,"," fontSize:\"85%\","," rotation: undefined,"," margin: {"," top: undefined,"," right: undefined,"," bottom: undefined,"," left: undefined"," }"," },"," hideOverlappingLabelTicks: false"," };"," "," return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); "," },",""," /**"," * Updates the axis when the size changes."," *"," * @method _handleSizeChange"," * @param {Object} e Event object."," * @private"," */"," _handleSizeChange: function(e)"," {"," var attrName = e.attrName,"," pos = this.get(\"position\"),"," vert = pos == \"left\" || pos == \"right\","," cb = this.get(\"contentBox\"),"," hor = pos == \"bottom\" || pos == \"top\";"," cb.setStyle(\"width\", this.get(\"width\"));"," cb.setStyle(\"height\", this.get(\"height\"));"," if((hor && attrName == \"width\") || (vert && attrName == \"height\"))"," {"," this._drawAxis();"," }"," },"," "," /**"," * Maps key values to classes containing layout algorithms"," *"," * @property _layoutClasses"," * @type Object"," * @private"," */"," _layoutClasses: "," {"," top : TopAxisLayout,"," bottom: BottomAxisLayout,"," left: LeftAxisLayout,"," right : RightAxisLayout"," },"," "," /**"," * Draws a line segment between 2 points"," *"," * @method drawLine"," * @param {Object} startPoint x and y coordinates for the start point of the line segment"," * @param {Object} endPoint x and y coordinates for the for the end point of the line segment"," * @param {Object} line styles (weight, color and alpha to be applied to the line segment)"," * @private"," */"," drawLine: function(path, startPoint, endPoint)"," {"," path.moveTo(startPoint.x, startPoint.y);"," path.lineTo(endPoint.x, endPoint.y);"," },",""," /**"," * Generates the properties necessary for rotating and positioning a text field."," *"," * @method _getTextRotationProps"," * @param {Object} styles properties for the text field"," * @return Object"," * @private"," */"," _getTextRotationProps: function(styles)"," {"," if(styles.rotation === undefined)"," {"," switch(this.get(\"position\"))"," {"," case \"left\" :"," styles.rotation = -90;"," break; "," case \"right\" : "," styles.rotation = 90;"," break;"," default :"," styles.rotation = 0;"," break;"," }"," }"," var rot = Math.min(90, Math.max(-90, styles.rotation)),"," absRot = Math.abs(rot),"," radCon = Math.PI/180,"," sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),"," cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));"," return {"," rot: rot,"," absRot: absRot,"," radCon: radCon,"," sinRadians: sinRadians,"," cosRadians: cosRadians,"," textAlpha: styles.alpha"," };"," },",""," /**"," * Draws an axis. "," *"," * @method _drawAxis"," * @private"," */"," _drawAxis: function ()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," if(this._layout)"," {"," var styles = this.get(\"styles\"),"," line = styles.line,"," labelStyles = styles.label,"," majorTickStyles = styles.majorTicks,"," drawTicks = majorTickStyles.display != \"none\","," tickPoint,"," majorUnit = styles.majorUnit,"," len,"," majorUnitDistance,"," i = 0,"," layout = this._layout,"," layoutLength,"," position,"," lineStart,"," label,"," labelWidth,"," labelHeight,"," labelFunction = this.get(\"labelFunction\"),"," labelFunctionScope = this.get(\"labelFunctionScope\"),"," labelFormat = this.get(\"labelFormat\"),"," graphic = this.get(\"graphic\"),"," path = this.get(\"path\"),"," tickPath,"," explicitlySized;"," this._labelWidths = [];"," this._labelHeights = [];"," graphic.set(\"autoDraw\", false);"," path.clear();"," path.set(\"stroke\", {"," weight: line.weight, "," color: line.color, "," opacity: line.alpha"," });"," this._labelRotationProps = this._getTextRotationProps(labelStyles);"," this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);"," layout.setTickOffsets.apply(this);"," layoutLength = this.getLength();"," lineStart = layout.getLineStart.apply(this);"," len = this.getTotalMajorUnits(majorUnit);"," majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);"," this.set(\"edgeOffset\", this.getEdgeOffset(len, layoutLength) * 0.5);"," if(len < 1)"," {"," this._clearLabelCache();"," }"," else"," {"," tickPoint = this.getFirstPoint(lineStart);"," this.drawLine(path, lineStart, this.getLineEnd(tickPoint));"," if(drawTicks) "," {"," tickPath = this.get(\"tickPath\");"," tickPath.clear();"," tickPath.set(\"stroke\", {"," weight: majorTickStyles.weight,"," color: majorTickStyles.color,"," opacity: majorTickStyles.alpha"," });"," layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);"," }"," this._createLabelCache();"," this._tickPoints = [];"," this._maxLabelSize = 0; "," this._totalTitleSize = 0;"," this._titleSize = 0;"," this._setTitle();"," explicitlySized = layout.getExplicitlySized.apply(this, [styles]);"," for(; i < len; ++i)"," {"," if(drawTicks) "," {"," layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);"," }"," position = this.getPosition(tickPoint);"," label = this.getLabel(tickPoint, labelStyles);"," this._labels.push(label);"," this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});"," this.get(\"appendLabelFunction\")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));"," labelWidth = Math.round(label.offsetWidth);"," labelHeight = Math.round(label.offsetHeight);"," if(!explicitlySized)"," {"," this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);"," }"," this._labelWidths.push(labelWidth);"," this._labelHeights.push(labelHeight);"," tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);"," }"," this._clearLabelCache();"," if(this.get(\"overlapGraph\"))"," {"," layout.offsetNodeForTick.apply(this, [this.get(\"contentBox\")]);"," }"," layout.setCalculatedSize.apply(this);"," if(this._titleTextField)"," {"," this._layout.positionTitle.apply(this, [this._titleTextField]);"," }"," for(i = 0; i < len; ++i)"," {"," layout.positionLabel.apply(this, [this.get(\"labels\")[i], this._tickPoints[i], styles, i]);"," }"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawAxis();"," }"," else"," {"," this._updatePathElement();"," this.fire(\"axisRendered\");"," }"," },"," "," /**"," * Calculates and sets the total size of a title."," *"," * @method _setTotalTitleSize"," * @param {Object} styles Properties for the title field."," * @private"," */"," _setTotalTitleSize: function(styles)"," {"," var title = this._titleTextField,"," w = title.offsetWidth,"," h = title.offsetHeight,"," rot = this._titleRotationProps.rot,"," bounds,"," size,"," margin = styles.margin,"," position = this.get(\"position\"),"," matrix = new Y.Matrix();"," matrix.rotate(rot);"," bounds = matrix.getContentRect(w, h);"," if(position == \"left\" || position == \"right\")"," {"," size = bounds.right - bounds.left;"," if(margin)"," {"," size += margin.left + margin.right;"," }"," }"," else"," {"," size = bounds.bottom - bounds.top;"," if(margin)"," {"," size += margin.top + margin.bottom;"," }"," }"," this._titleBounds = bounds;"," this._totalTitleSize = size;"," },",""," /**"," * Updates path."," *"," * @method _updatePathElement"," * @private"," */"," _updatePathElement: function()"," {"," var path = this._path,"," tickPath = this._tickPath,"," redrawGraphic = false,"," graphic = this.get(\"graphic\");"," if(path)"," {"," redrawGraphic = true;"," path.end();"," }"," if(tickPath)"," {"," redrawGraphic = true;"," tickPath.end();"," }"," if(redrawGraphic)"," {"," graphic._redraw();"," }"," },",""," /**"," * Updates the content and style properties for a title field."," *"," * @method _updateTitle"," * @private"," */"," _setTitle: function()"," {"," var i,"," styles,"," customStyles,"," title = this.get(\"title\"),"," titleTextField = this._titleTextField,"," parentNode;"," if(title !== null && title !== undefined)"," {"," customStyles = {"," rotation: \"rotation\","," margin: \"margin\","," alpha: \"alpha\""," };"," styles = this.get(\"styles\").title;"," if(!titleTextField)"," {"," titleTextField = DOCUMENT.createElement('span');"," titleTextField.style.display = \"block\";"," titleTextField.style.whiteSpace = \"nowrap\";"," titleTextField.setAttribute(\"class\", \"axisTitle\");"," this.get(\"contentBox\").append(titleTextField);"," }"," else if(!DOCUMENT.createElementNS)"," {"," if(titleTextField.style.filter)"," {"," titleTextField.style.filter = null;"," }"," }"," titleTextField.style.position = \"absolute\";"," for(i in styles)"," {"," if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))"," {"," titleTextField.style[i] = styles[i];"," }"," }"," this.get(\"appendTitleFunction\")(titleTextField, title);"," this._titleTextField = titleTextField;"," this._titleRotationProps = this._getTextRotationProps(styles);"," this._setTotalTitleSize(styles);"," }"," else if(titleTextField)"," {"," parentNode = titleTextField.parentNode;"," if(parentNode)"," {"," parentNode.removeChild(titleTextField);"," }"," this._titleTextField = null;"," this._totalTitleSize = 0;"," }"," },",""," /**"," * Creates or updates an axis label."," *"," * @method getLabel"," * @param {Object} pt x and y coordinates for the label"," * @param {Object} styles styles applied to label"," * @return HTMLElement "," * @private"," */"," getLabel: function(pt, styles)"," {"," var i,"," label,"," labelCache = this._labelCache,"," customStyles = {"," rotation: \"rotation\","," margin: \"margin\","," alpha: \"alpha\""," };"," if(labelCache && labelCache.length > 0)"," {"," label = labelCache.shift();"," }"," else"," {"," label = DOCUMENT.createElement(\"span\");"," label.className = Y.Lang.trim([label.className, \"axisLabel\"].join(' '));"," this.get(\"contentBox\").append(label);"," }"," if(!DOCUMENT.createElementNS)"," {"," if(label.style.filter)"," {"," label.style.filter = null;"," }"," }"," label.style.display = \"block\";"," label.style.whiteSpace = \"nowrap\";"," label.style.position = \"absolute\";"," for(i in styles)"," {"," if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))"," {"," label.style[i] = styles[i];"," }"," }"," return label;"," },",""," /**"," * Creates a cache of labels that can be re-used when the axis redraws."," *"," * @method _createLabelCache"," * @private"," */"," _createLabelCache: function()"," {"," if(this._labels)"," {"," while(this._labels.length > 0)"," {"," this._labelCache.push(this._labels.shift());"," }"," }"," else"," {"," this._clearLabelCache();"," }"," this._labels = [];"," },"," "," /**"," * Removes axis labels from the dom and clears the label cache."," *"," * @method _clearLabelCache"," * @private"," */"," _clearLabelCache: function()"," {"," if(this._labelCache)"," {"," var len = this._labelCache.length,"," i = 0,"," label;"," for(; i < len; ++i)"," {"," label = this._labelCache[i];"," this._removeChildren(label);"," Y.Event.purgeElement(label, true);"," label.parentNode.removeChild(label);"," }"," }"," this._labelCache = [];"," },",""," /**"," * Gets the end point of an axis."," *"," * @method getLineEnd"," * @return Object"," * @private "," */"," getLineEnd: function(pt)"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," return {x:w, y:pt.y};"," }"," else"," {"," return {x:pt.x, y:h};"," }"," },",""," /**"," * Calcuates the width or height of an axis depending on its direction."," *"," * @method getLength"," * @return Number"," * @private"," */"," getLength: function()"," {"," var l,"," style = this.get(\"styles\"),"," padding = style.padding,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," l = w - (padding.left + padding.right);"," }"," else"," {"," l = h - (padding.top + padding.bottom);"," }"," return l;"," },",""," /**"," * Gets the position of the first point on an axis."," *"," * @method getFirstPoint"," * @param {Object} pt Object containing x and y coordinates."," * @return Object"," * @private"," */"," getFirstPoint:function(pt)"," {"," var style = this.get(\"styles\"),"," pos = this.get(\"position\"),"," padding = style.padding,"," np = {x:pt.x, y:pt.y};"," if(pos === \"top\" || pos === \"bottom\")"," {"," np.x += padding.left + this.get(\"edgeOffset\");"," }"," else"," {"," np.y += this.get(\"height\") - (padding.top + this.get(\"edgeOffset\"));"," }"," return np;"," },",""," /**"," * Gets the position of the next point on an axis."," *"," * @method getNextPoint"," * @param {Object} point Object containing x and y coordinates."," * @param {Number} majorUnitDistance Distance in pixels between ticks."," * @return Object"," * @private"," */"," getNextPoint: function(point, majorUnitDistance)"," {"," var pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," point.x = point.x + majorUnitDistance; "," }"," else"," {"," point.y = point.y - majorUnitDistance;"," }"," return point;"," },",""," /**"," * Calculates the placement of last tick on an axis."," *"," * @method getLastPoint"," * @return Object"," * @private "," */"," getLastPoint: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," w = this.get(\"width\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," return {x:w - padding.right, y:padding.top};"," }"," else"," {"," return {x:padding.left, y:padding.top};"," }"," },",""," /**"," * Calculates position on the axis."," *"," * @method getPosition"," * @param {Object} point contains x and y values"," * @private "," */"," getPosition: function(point)"," {"," var p,"," h = this.get(\"height\"),"," style = this.get(\"styles\"),"," padding = style.padding,"," pos = this.get(\"position\"),"," dataType = this.get(\"dataType\");"," if(pos === \"left\" || pos === \"right\") "," {"," //Numeric data on a vertical axis is displayed from bottom to top."," //Categorical and Timeline data is displayed from top to bottom."," if(dataType === \"numeric\")"," {"," p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);"," }"," else"," {"," p = point.y - padding.top;"," }"," }"," else"," {"," p = point.x - padding.left;"," }"," return p;"," },",""," /**"," * Rotates and positions a text field."," *"," * @method _rotate"," * @param {HTMLElement} label text field to rotate and position"," * @param {Object} props properties to be applied to the text field. "," * @private"," */"," _rotate: function(label, props)"," {"," var rot = props.rot,"," x = props.x,"," y = props.y,"," filterString,"," textAlpha,"," matrix = new Y.Matrix(),"," transformOrigin = props.transformOrigin || [0, 0],"," offsetRect;"," if(DOCUMENT.createElementNS)"," {"," matrix.translate(x, y);"," matrix.rotate(rot);"," Y_DOM.setStyle(label, \"transformOrigin\", (transformOrigin[0] * 100) + \"% \" + (transformOrigin[1] * 100) + \"%\");"," Y_DOM.setStyle(label, \"transform\", matrix.toCSSText());"," }"," else"," {"," textAlpha = props.textAlpha;"," if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))"," {"," filterString = \"progid:DXImageTransform.Microsoft.Alpha(Opacity=\" + Math.round(textAlpha * 100) + \")\";"," }"," if(rot !== 0)"," {"," //ms filters kind of, sort of uses a transformOrigin of 0, 0. "," //we'll translate the difference to create a true 0, 0 origin."," matrix.rotate(rot);"," offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);"," matrix.init();"," matrix.translate(offsetRect.left, offsetRect.top);"," matrix.translate(x, y);"," this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);"," if(filterString)"," {"," filterString += \" \";"," }"," else"," {"," filterString = \"\"; "," }"," filterString += matrix.toFilterText();"," label.style.left = matrix.dx + \"px\";"," label.style.top = matrix.dy + \"px\";"," }"," else"," {"," label.style.left = x + \"px\";"," label.style.top = y + \"px\";"," }"," if(filterString)"," {"," label.style.filter = filterString;"," }"," }"," },"," "," /**"," * Simulates a rotation with a specified transformOrigin. "," *"," * @method _simulateTransformOrigin"," * @param {Matrix} matrix Reference to a `Matrix` instance."," * @param {Number} rot The rotation (in degrees) that will be performed on a matrix."," * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first "," * index represents the x origin and the second index represents the y origin."," * @param {Number} w The width of the object that will be transformed."," * @param {Number} h The height of the object that will be transformed."," * @private"," */"," _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)"," {"," var transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h;"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," matrix.rotate(rot);"," matrix.translate(-transformX, -transformY);"," },",""," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. "," *"," * @method getMaxLabelBounds"," * @return Object"," */"," getMaxLabelBounds: function()"," {"," return this._getLabelBounds(this.getMaximumValue());"," },",""," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. "," *"," * @method getMinLabelBounds"," * @return Object"," */"," getMinLabelBounds: function()"," {"," return this._getLabelBounds(this.getMinimumValue());"," },"," "," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. "," *"," * @method _getLabelBounds"," * @param {String} Value of the label"," * @return Object"," * @private"," */"," _getLabelBounds: function(val)"," {"," var layout = this._layout,"," labelStyles = this.get(\"styles\").label,"," matrix = new Y.Matrix(),"," label,"," props = this._getTextRotationProps(labelStyles);"," props.transformOrigin = layout._getTransformOrigin(props.rot);"," label = this.getLabel({x: 0, y: 0}, labelStyles);"," this.get(\"appendLabelFunction\")(label, this.get(\"labelFunction\").apply(this, [val, this.get(\"labelFormat\")]));"," props.labelWidth = label.offsetWidth;"," props.labelHeight = label.offsetHeight;"," this._removeChildren(label);"," Y.Event.purgeElement(label, true);"," label.parentNode.removeChild(label);"," props.x = 0;"," props.y = 0;"," layout._setRotationCoords(props);"," matrix.translate(props.x, props.y);"," this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);"," return matrix.getContentRect(props.labelWidth, props.labelHeight);"," },",""," /**"," * Removes all DOM elements from an HTML element. Used to clear out labels during detruction"," * phase."," *"," * @method _removeChildren"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },"," "," /**"," * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var cb = this.get(\"contentBox\").getDOMNode(),"," labels = this.get(\"labels\"),"," graphic = this.get(\"graphic\"),"," label,"," len = labels ? labels.length : 0;"," if(len > 0)"," {"," while(labels.length > 0)"," {"," label = labels.shift();"," this._removeChildren(label);"," cb.removeChild(label);"," label = null;"," }"," }"," if(graphic)"," {"," graphic.destroy();"," }"," },",""," /**"," * Length in pixels of largest text bounding box. Used to calculate the height of the axis."," *"," * @property maxLabelSize"," * @type Number"," * @protected"," */"," _maxLabelSize: 0,"," "," /**"," * Updates the content of text field. This method writes a value into a text field using "," * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. "," *"," * @method _setText"," * @param label {HTMLElement} label to be updated"," * @param val {String} value with which to update the label"," * @private"," */"," _setText: function(textField, val)"," { "," textField.innerHTML = \"\";"," if(Y_Lang.isNumber(val))"," {"," val = val + \"\";"," }"," else if(!val)"," {"," val = \"\";"," }"," if(IS_STRING(val))"," {"," val = DOCUMENT.createTextNode(val);"," }"," textField.appendChild(val);"," }","}, {"," ATTRS: "," {"," /**"," * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the"," * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the "," * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of "," * the axis' contents, excess content will overflow."," *"," * @attribute width"," * @type Number"," */"," width: {"," lazyAdd: false,",""," getter: function() "," {"," if(this._explicitWidth)"," {"," return this._explicitWidth; "," }"," return this._calculatedWidth;"," },",""," setter: function(val)"," {"," this._explicitWidth = val;"," return val;"," }"," },",""," /**"," * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the"," * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the "," * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of "," * the axis' contents, excess content will overflow."," *"," * @attribute height"," * @type Number"," */"," height: {"," lazyAdd: false,",""," getter: function() "," {"," if(this._explicitHeight)"," {"," return this._explicitHeight; "," }"," return this._calculatedHeight;"," },",""," setter: function(val)"," {"," this._explicitHeight = val;"," return val;"," }"," },",""," /**"," * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored."," *"," * @attribute calculatedWidth"," * @type Number"," * @private"," */"," calculatedWidth: {"," getter: function()"," {"," return this._calculatedWidth;"," },",""," setter: function(val)"," {"," this._calculatedWidth = val;"," return val;"," }"," },",""," /**"," * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored."," *"," * @attribute calculatedHeight"," * @type Number"," * @private"," */"," calculatedHeight: {"," getter: function()"," {"," return this._calculatedHeight;"," },",""," setter: function(val)"," {"," this._calculatedHeight = val;"," return val;"," }"," },",""," /**"," * Difference betweend the first/last tick and edge of axis."," *"," * @attribute edgeOffset"," * @type Number"," * @protected"," */"," edgeOffset: "," {"," value: 0"," },",""," /**"," * The graphic in which the axis line and ticks will be rendered."," *"," * @attribute graphic"," * @type Graphic"," */"," graphic: {},"," "," /**"," * @attribute path"," * @type Shape"," * @readOnly"," * @private"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," if(!this._path)"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," this._path = graphic.addShape({type:\"path\"});"," }"," }"," return this._path;"," }"," },",""," /**"," * @attribute tickPath"," * @type Shape"," * @readOnly"," * @private"," */"," tickPath: {"," readOnly: true,",""," getter: function()"," {"," if(!this._tickPath)"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," this._tickPath = graphic.addShape({type:\"path\"});"," }"," }"," return this._tickPath;"," }"," },"," "," /**"," * Contains the contents of the axis. "," *"," * @attribute node"," * @type HTMLElement"," */"," node: {},",""," /**"," * Direction of the axis."," *"," * @attribute position"," * @type String"," */"," position: {"," setter: function(val)"," {"," var layoutClass = this._layoutClasses[val];"," if(val && val != \"none\")"," {"," this._layout = new layoutClass();"," }"," return val;"," }"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the top of the axis."," *"," * @attribute topTickOffset"," * @type Number"," */"," topTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the bottom of the axis."," *"," * @attribute bottomTickOffset"," * @type Number"," */"," bottomTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the left of the axis."," *"," * @attribute leftTickOffset"," * @type Number"," */"," leftTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the right side of the axis."," *"," * @attribute rightTickOffset"," * @type Number"," */"," rightTickOffset: {"," value: 0"," },"," "," /**"," * Collection of labels used to render the axis."," *"," * @attribute labels"," * @type Array"," */"," labels: {"," readOnly: true,"," getter: function()"," {"," return this._labels;"," }"," },",""," /**"," * Collection of points used for placement of labels and ticks along the axis."," *"," * @attribute tickPoints"," * @type Array"," */"," tickPoints: {"," readOnly: true,",""," getter: function()"," {"," if(this.get(\"position\") == \"none\")"," {"," return this.get(\"styles\").majorUnit.count;"," }"," return this._tickPoints;"," }"," },",""," /**"," * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given"," * position and the tick position is inside or cross, the axis will need to overlap the graph."," *"," * @attribute overlapGraph"," * @type Boolean"," */"," overlapGraph: {"," value:true,",""," validator: function(val)"," {"," return Y_Lang.isBoolean(val);"," }"," },",""," /**"," * Object which should have by the labelFunction"," *"," * @attribute labelFunctionScope"," * @type Object"," */"," labelFunctionScope: {},"," "," /**"," * Length in pixels of largest text bounding box. Used to calculate the height of the axis."," *"," * @attribute maxLabelSize"," * @type Number"," * @protected"," */"," maxLabelSize: {"," getter: function()"," {"," return this._maxLabelSize;"," },",""," setter: function(val)"," {"," this._maxLabelSize = val;"," return val; "," }"," },"," "," /**"," * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. "," * <dl>"," * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>"," * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>"," * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>"," * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>"," * </dl>"," *"," * @attribute title"," * @type String"," */"," title: {"," value: null"," },"," "," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or `HTMLElement`. "," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Template for formatting label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: {"," value: function(val, format)"," {"," return val;"," }"," },"," "," /**"," * Function used to append an axis value to an axis label. This function has the following signature:"," * <dl>"," * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>"," * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`"," * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>"," * </dl>"," * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given "," * value is a `String`, the method will convert the the value to a `textNode` before appending to the "," * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. "," *"," * @attribute appendLabelFunction"," * @type Function"," */"," appendLabelFunction: {"," valueFn: function()"," {"," return this._setText;"," }"," },"," "," /**"," * Function used to append a title value to the title object. This function has the following signature:"," * <dl>"," * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>"," * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`"," * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>"," * </dl>"," * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given "," * value is a `String`, the method will convert the the value to a `textNode` before appending to the "," * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. "," *"," * @attribute appendTitleFunction"," * @type Function"," */"," appendTitleFunction: {"," valueFn: function()"," {"," return this._setText;"," }"," }"," "," /**"," * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>majorTicks</dt><dd>Properties used for drawing ticks."," * <dl>"," * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The"," * default value is `inside`.</dd>"," * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>"," * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>"," * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>line</dt><dd>Properties used for drawing the axis line. "," * <dl>"," * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>"," * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. "," * <dl>"," * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If"," * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`"," * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>"," * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>"," * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>"," * </dl>"," * </dd>"," * <dt>label</dt><dd>Properties and styles applied to the axis labels."," * <dl>"," * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>"," * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>"," * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>"," * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used."," * <dl>"," * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>"," * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>"," * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>"," * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * AxisType is an abstract class that manages the data for an axis."," *"," * @module charts"," * @submodule charts-base"," * @class AxisType"," * @constructor"," * @extends Axis"," */","Y.AxisType = Y.Base.create(\"baseAxis\", Y.Axis, [], {"," /**"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this.after(\"dataReady\", Y.bind(this._dataChangeHandler, this));"," this.after(\"dataUpdate\", Y.bind(this._dataChangeHandler, this));"," this.after(\"minimumChange\", Y.bind(this._keyChangeHandler, this));"," this.after(\"maximumChange\", Y.bind(this._keyChangeHandler, this));"," this.after(\"keysChange\", this._keyChangeHandler);"," this.after(\"dataProviderChange\", this._dataProviderChangeHandler);"," this.after(\"alwaysShowZeroChange\", this._keyChangeHandler);"," this.after(\"roundingMethodChange\", this._keyChangeHandler);"," },",""," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.after(\"stylesChange\", this._updateHandler);"," this.after(\"overlapGraphChange\", this._updateHandler);"," this.after(\"positionChange\", this._positionChangeHandler);"," this.after(\"widthChange\", this._handleSizeChange);"," this.after(\"heightChange\", this._handleSizeChange);"," this.after(\"calculatedWidthChange\", this._handleSizeChange);"," this.after(\"calculatedHeightChange\", this._handleSizeChange);"," },",""," /**"," * Handles changes to `dataProvider`."," *"," * @method _dataProviderChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _dataProviderChangeHandler: function(e)"," {"," var keyCollection = this.get(\"keyCollection\").concat(),"," keys = this.get(\"keys\"),"," i;"," if(keys)"," {"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," delete keys[i];"," }"," }"," }"," if(keyCollection && keyCollection.length)"," {"," this.set(\"keys\", keyCollection);"," }"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuibaseaxis\","," "," /**"," * Type of data used in `Axis`."," *"," * @property _type"," * @type String "," * @readOnly"," * @private"," */"," _type: null,"," "," /**"," * Storage for `setMaximum` attribute."," *"," * @property _setMaximum"," * @type Object"," * @private"," */"," _setMaximum: null,"," "," /**"," * Storage for `dataMaximum` attribute."," *"," * @property _dataMaximum"," * @type Object"," * @private"," */"," _dataMaximum: null,"," "," /**"," * Storage for `setMinimum` attribute."," *"," * @property _setMinimum"," * @type Object"," * @private"," */"," _setMinimum: null,"," "," /**"," * Reference to data array."," *"," * @property _data"," * @type Array"," * @private"," */"," _data: null,",""," /**"," * Indicates whether the all data is up to date."," *"," * @property _updateTotalDataFlag"," * @type Boolean"," * @private"," */"," _updateTotalDataFlag: true,",""," /**"," * Storage for `dataReady` attribute."," *"," * @property _dataReady"," * @type Boolean"," * @readOnly"," * @private"," */"," _dataReady: false,"," "," /**"," * Adds an array to the key hash."," *"," * @method addKey"," * @param value Indicates what key to use in retrieving"," * the array."," */"," addKey: function (value)"," {"," this.set(\"keys\", value);"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var i = 0,"," obj,"," keyArray = [],"," len = data.length;"," for(; i < len; ++i)"," {"," obj = data[i];"," keyArray[i] = obj[key];"," }"," return keyArray;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key, data)"," {"," var i,"," obj, "," arr = [], "," dv = this._dataClone.concat(), "," len = dv.length;"," for(i = 0; i < len; ++i)"," {"," obj = dv[i];"," arr[i] = obj[key];"," }"," this.get(\"keys\")[key] = arr;"," this._updateTotalDataFlag = true;"," },",""," /**"," * Updates the total data array."," *"," * @method _updateTotalData"," * @private"," */"," _updateTotalData: function()"," {"," var keys = this.get(\"keys\"),"," i;"," this._data = [];"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," this._data = this._data.concat(keys[i]);"," }"," }"," this._updateTotalDataFlag = false;"," },",""," /**"," * Removes an array from the key hash."," * "," * @method removeKey"," * @param {String} value Indicates what key to use in removing from "," * the hash."," */"," removeKey: function(value)"," {"," var keys = this.get(\"keys\");"," if(keys.hasOwnProperty(value)) "," {"," delete keys[value];"," this._keyChangeHandler();"," }"," },",""," /**"," * Returns a value based of a key value and an index."," *"," * @method getKeyValueAt"," * @param {String} key value used to look up the correct array"," * @param {Number} index within the array"," * @return Number "," */"," getKeyValueAt: function(key, index)"," {"," var value = NaN,"," keys = this.get(\"keys\");"," if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))"," {"," value = keys[key][index];"," }"," return parseFloat(value);"," },",""," /**"," * Returns an array of values based on an identifier key."," *"," * @method getDataByKey"," * @param {String} value value used to identify the array"," * @return Object"," */"," getDataByKey: function (value)"," {"," var keys = this.get(\"keys\");"," if(keys[value])"," {"," return keys[value];"," }"," return null;"," },",""," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function() "," {"," var data = this.get(\"data\"),"," max = 0,"," min = 0,"," len,"," num,"," i;"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," max = min = data[0];"," if(len > 1)"," {"," for(i = 1; i < len; i++)"," { "," num = data[i];"," if(isNaN(num))"," {"," continue;"," }"," max = Math.max(num, max);"," min = Math.min(num, min);"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Returns the total number of majorUnits that will appear on an axis."," *"," * @method getTotalMajorUnits"," * @return Number"," */"," getTotalMajorUnits: function()"," {"," var units,"," majorUnit = this.get(\"styles\").majorUnit,"," len = this.get(\"length\");"," if(majorUnit.determinant === \"count\") "," {"," units = majorUnit.count;"," }"," else if(majorUnit.determinant === \"distance\") "," {"," units = (len/majorUnit.distance) + 1;"," }"," return units; "," },",""," /**"," * Returns the distance between major units on an axis."," *"," * @method getMajorUnitDistance"," * @param {Number} len Number of ticks"," * @param {Number} uiLen Size of the axis."," * @param {Object} majorUnit Hash of properties used to determine the majorUnit"," * @return Number"," */"," getMajorUnitDistance: function(len, uiLen, majorUnit)"," {"," var dist;"," if(majorUnit.determinant === \"count\")"," {"," dist = uiLen/(len - 1);"," }"," else if(majorUnit.determinant === \"distance\")"," {"," dist = majorUnit.distance;"," }"," return dist;"," },"," "," /**"," * Gets the distance that the first and last ticks are offset from there respective"," * edges."," *"," * @method getEdgeOffset"," * @param {Number} ct Number of ticks on the axis."," * @param {Number} l Length (in pixels) of the axis."," * @return Number"," */"," getEdgeOffset: function(ct, l)"," {"," return 0;"," },",""," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," increm = (max - min)/(l-1),"," label;"," l -= 1;"," label = min + (i * increm);"," return label;"," },",""," /**"," * Updates the `Axis` after a change in keys."," *"," * @method _keyChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _keyChangeHandler: function(e)"," {"," this._updateMinAndMax();"," this.fire(\"dataUpdate\");"," },",""," /**"," * Checks to see if data extends beyond the range of the axis. If so,"," * that data will need to be hidden. This method is internal, temporary and subject"," * to removal in the future."," *"," * @method _hasDataOverflow"," * @protected"," * @return Boolean"," */"," _hasDataOverflow: function()"," {"," if(this.get(\"setMin\") || this.get(\"setMax\"))"," {"," return true;"," }"," return false;"," },",""," /**"," * Returns a string corresponding to the first label on an "," * axis."," *"," * @method getMinimumValue"," * @return String"," */"," getMinimumValue: function()"," {"," return this.get(\"minimum\");"," },",""," /**"," * Returns a string corresponding to the last label on an "," * axis."," *"," * @method getMaximumValue"," * @return String"," */"," getMaximumValue: function()"," {"," return this.get(\"maximum\");"," }","}, {"," ATTRS: {"," /**"," * Hash of array identifed by a string value."," *"," * @attribute keys"," * @type Object"," */"," keys: {"," value: {},",""," setter: function(val)"," {"," var keys = {},"," i, "," len,"," data = this.get(\"dataProvider\");"," if(Y_Lang.isArray(val))"," {"," len = val.length;"," for(i = 0; i < len; ++i)"," {"," keys[val[i]] = this._getKeyArray(val[i], data); "," }"," "," }"," else if(Y_Lang.isString(val))"," {"," keys = this.get(\"keys\");"," keys[val] = this._getKeyArray(val, data);"," }"," else"," {"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," {"," keys[i] = this._getKeyArray(i, data);"," }"," }"," }"," this._updateTotalDataFlag = true;"," return keys;"," }"," },",""," /**"," *Indicates how to round unit values."," * <dl>"," * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>"," * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>"," * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>"," * <dt>null</dt><dd>No rounding will occur.</dd>"," * </dl>"," *"," * @attribute roundingMethod"," * @type String"," * @default niceNumber"," */"," roundingMethod: {"," value: \"niceNumber\""," },",""," /**"," *Returns the type of axis data"," * <dl>"," * <dt>time</dt><dd>Manages time data</dd>"," * <dt>stacked</dt><dd>Manages stacked numeric data</dd> "," * <dt>numeric</dt><dd>Manages numeric data</dd>"," * <dt>category</dt><dd>Manages categorical data</dd>"," * </dl>"," *"," * @attribute type"," * @type String"," */"," type:"," {"," readOnly: true,",""," getter: function ()"," {"," return this._type;"," }"," },",""," /**"," * Instance of `ChartDataProvider` that the class uses"," * to build its own data."," *"," * @attribute dataProvider"," * @type Array"," */"," dataProvider:{"," setter: function (value)"," {"," return value;"," }"," },",""," /**"," * The maximum value contained in the `data` array. Used for"," * `maximum` when `autoMax` is true."," *"," * @attribute dataMaximum"," * @type Number"," */"," dataMaximum: {"," getter: function ()"," {"," if(!this._dataMaximum)"," { "," this._updateMinAndMax();"," }"," return this._dataMaximum;"," }"," },",""," /**"," * The maximum value that will appear on an axis."," *"," * @attribute maximum"," * @type Number"," */"," maximum: {"," lazyAdd: false,",""," getter: function ()"," {"," var max = this.get(\"dataMaximum\"),"," min = this.get(\"minimum\");"," //If all values are zero, force a range so that the Axis and related series"," //will still render."," if(min === 0 && max === 0)"," {"," max = 10;"," }"," if(Y_Lang.isNumber(this._setMaximum))"," {"," max = this._setMaximum;"," }"," return parseFloat(max);"," },"," setter: function (value)"," {"," this._setMaximum = parseFloat(value);"," return value;"," }"," },",""," /**"," * The minimum value contained in the `data` array. Used for"," * `minimum` when `autoMin` is true."," *"," * @attribute dataMinimum"," * @type Number"," */"," dataMinimum: {"," getter: function ()"," {"," if(!this._dataMinimum)"," {"," this._updateMinAndMax();"," }"," return this._dataMinimum;"," }"," },",""," /**"," * The minimum value that will appear on an axis."," *"," * @attribute minimum"," * @type Number"," */"," minimum: {"," lazyAdd: false,",""," getter: function ()"," {"," var min = this.get(\"dataMinimum\");"," if(Y_Lang.isNumber(this._setMinimum))"," {"," min = this._setMinimum;"," }"," return parseFloat(min);"," },"," setter: function(val)"," {"," this._setMinimum = parseFloat(val);"," return val;"," }"," },",""," /**"," * Determines whether the maximum is calculated or explicitly "," * set by the user."," *"," * @attribute setMax"," * @type Boolean"," */"," setMax: {"," readOnly: true,",""," getter: function()"," {"," return Y_Lang.isNumber(this._setMaximum);"," }"," },",""," /**"," * Determines whether the minimum is calculated or explicitly"," * set by the user."," *"," * @attribute setMin"," * @type Boolean"," */"," setMin: {"," readOnly: true,",""," getter: function()"," {"," return Y_Lang.isNumber(this._setMinimum);"," }"," },",""," /**"," * Array of axis data"," *"," * @attribute data"," * @type Array"," */"," data: {"," getter: function ()"," {"," if(!this._data || this._updateTotalDataFlag)"," {"," this._updateTotalData();"," }"," return this._data;"," }"," },",""," /**"," * Array containing all the keys in the axis."," "," * @attribute keyCollection"," * @type Array"," */"," keyCollection: {"," getter: function()"," {"," var keys = this.get(\"keys\"),"," i, "," col = [];"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," col.push(i);"," }"," }"," return col;"," },"," readOnly: true"," }"," }","});","/**"," * NumericAxis manages numeric data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class NumericAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function NumericAxis(config)","{"," NumericAxis.superclass.constructor.apply(this, arguments);","}","","NumericAxis.NAME = \"numericAxis\";","","NumericAxis.ATTRS = {"," /**"," * Indicates whether 0 should always be displayed."," *"," * @attribute alwaysShowZero"," * @type Boolean"," */"," alwaysShowZero: {"," value: true "," },"," "," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method"," * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' "," * `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: { "," value: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," }"," },",""," /**"," * Object containing properties used by the `labelFunction` to format a"," * label."," *"," * @attribute labelFormat"," * @type Object"," */"," labelFormat: {"," value: {"," prefix: \"\","," thousandsSeparator: \"\","," decimalSeparator: \"\","," decimalPlaces: \"0\","," suffix: \"\""," }"," }","};","","Y.extend(NumericAxis, Y.AxisType,","{"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," },",""," /**"," * Returns the sum of all values per key."," *"," * @method getTotalByKey"," * @param {String} key The identifier for the array whose values will be calculated."," * @return Number"," */"," getTotalByKey: function(key)"," {"," var total = 0,"," values = this.getDataByKey(key),"," i = 0,"," val,"," len = values ? values.length : 0;"," for(; i < len; ++i)"," {"," val = parseFloat(values[i]);"," if(!isNaN(val))"," {"," total += val;"," }"," }"," return total;"," },",""," /**"," * Type of data used in `Axis`."," *"," * @property _type"," * @readOnly"," * @private"," */"," _type: \"numeric\",",""," /**"," * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values."," *"," * @method _getMinimumUnit"," * @param {Number} max Maximum number"," * @param {Number} min Minimum number"," * @param {Number} units Number of units on the axis"," * @return Number"," * @private"," */"," _getMinimumUnit:function(max, min, units)"," {"," return this._getNiceNumber(Math.ceil((max - min)/units));"," },",""," /**"," * Calculates a nice rounding unit based on the range."," *"," * @method _getNiceNumber"," * @param {Number} roundingUnit The calculated rounding unit."," * @return Number"," * @private"," */"," _getNiceNumber: function(roundingUnit)"," {"," var tempMajorUnit = roundingUnit,"," order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),"," roundedMajorUnit = Math.pow(10, order),"," roundedDiff;",""," if (roundedMajorUnit / 2 >= tempMajorUnit) "," {"," roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));"," tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;"," }"," else "," {"," tempMajorUnit = roundedMajorUnit;"," }"," if(!isNaN(tempMajorUnit))"," {"," return tempMajorUnit;"," }"," return roundingUnit;",""," },",""," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," var data = this.get(\"data\"),"," max, "," min,"," len,"," num,"," i = 0,"," key,"," setMax = this.get(\"setMax\"),"," setMin = this.get(\"setMin\");"," if(!setMax || !setMin)"," {"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," for(; i < len; i++)"," { "," num = data[i];"," if(isNaN(num))"," {"," if(Y_Lang.isObject(num))"," {"," min = max = 0;"," //hloc values"," for(key in num)"," {"," if(num.hasOwnProperty(key))"," {"," max = Math.max(num[key], max);"," min = Math.min(num[key], min);"," }"," }"," }"," max = setMax ? this._setMaximum : max;"," min = setMin ? this._setMinimum : min;"," continue;"," }"," "," if(setMin)"," {"," min = this._setMinimum;"," }"," else if(min === undefined)"," {"," min = num;"," }"," else"," {"," min = Math.min(num, min); "," }"," if(setMax)"," {"," max = this._setMaximum;"," }"," else if(max === undefined)"," {"," max = num;"," }"," else"," {"," max = Math.max(num, max);"," }"," "," this._actualMaximum = max;"," this._actualMinimum = min;"," }"," }"," this._roundMinAndMax(min, max, setMin, setMax);"," }"," },",""," /**"," * Rounds the mimimum and maximum values based on the `roundingUnit` attribute."," *"," * @method _roundMinAndMax"," * @param {Number} min Minimum value"," * @param {Number} max Maximum value"," * @private"," */"," _roundMinAndMax: function(min, max, setMin, setMax)"," {"," var roundingUnit,"," minimumRange,"," minGreaterThanZero = min >= 0,"," maxGreaterThanZero = max > 0,"," dataRangeGreater,"," maxRound,"," minRound,"," topTicks,"," botTicks,"," tempMax,"," tempMin,"," units = this.getTotalMajorUnits() - 1,"," alwaysShowZero = this.get(\"alwaysShowZero\"),"," roundingMethod = this.get(\"roundingMethod\"),"," useIntegers = (max - min)/units >= 1;"," if(roundingMethod)"," {"," if(roundingMethod == \"niceNumber\")"," {"," roundingUnit = this._getMinimumUnit(max, min, units);"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < roundingUnit) && !setMin)"," {"," min = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," }"," if(setMax)"," {"," if(!alwaysShowZero)"," {"," min = max - (roundingUnit * units);"," }"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round(units/((-1 * min)/max + 1));"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," "," if(setMin)"," {"," while(tempMin < tempMax && botTicks >= 0)"," {"," botTicks--;"," topTicks++;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(botTicks > 0)"," {"," max = tempMin * topTicks;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(setMax)"," {"," while(tempMax < tempMin && topTicks >= 0)"," {"," botTicks++;"," topTicks--;"," tempMin = Math.floor( min/botTicks ) * -1;"," tempMax = Math.ceil( max/topTicks );"," }"," //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(topTicks > 0)"," {"," min = tempMax * botTicks * -1;"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," else"," {"," roundingUnit = Math.max(tempMax, tempMin);"," roundingUnit = this._getNiceNumber(roundingUnit); "," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," }"," else "," {"," if(setMax)"," {"," min = max - (roundingUnit * units);"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," }"," else"," {"," if(setMin)"," {"," if(alwaysShowZero)"," {"," max = 0;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(!setMax)"," {"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," }"," else if(roundingMethod == \"auto\") "," {"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < (max-min)/units) && !setMin)"," {"," min = 0;"," }"," "," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," max = min + (roundingUnit * units);"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round( units / ( (-1 * min) /max + 1) );"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;",""," if(useIntegers)"," {"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," else"," {"," tempMax = max/topTicks;"," tempMin = min/botTicks * -1;"," }"," roundingUnit = Math.max(tempMax, tempMin);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," { "," roundingUnit = Math.ceil(roundingUnit);"," }"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," Math.ceil(roundingUnit);"," }"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }",""," }"," }"," else if(!isNaN(roundingMethod) && isFinite(roundingMethod))"," {"," roundingUnit = roundingMethod;"," minimumRange = roundingUnit * units;"," dataRangeGreater = (max - min) > minimumRange;"," minRound = this._roundDownToNearest(min, roundingUnit);"," maxRound = this._roundUpToNearest(max, roundingUnit);"," if(setMax)"," {"," min = max - minimumRange;"," }"," else if(setMin)"," {"," max = min + minimumRange;"," }"," else if(minGreaterThanZero && maxGreaterThanZero)"," {"," if(alwaysShowZero || minRound <= 0)"," {"," min = 0;"," }"," else"," {"," min = minRound;"," }"," max = min + minimumRange;"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," min = minRound;"," max = maxRound;"," }"," else"," {"," if(alwaysShowZero || maxRound >= 0)"," {"," max = 0;"," }"," else"," {"," max = maxRound;"," }"," min = max - minimumRange;"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," increm = (max - min)/(l-1),"," label,"," roundingMethod = this.get(\"roundingMethod\");"," l -= 1;"," //respect the min and max. calculate all other labels."," if(i === 0)"," {"," label = min;"," }"," else if(i === l)"," {"," label = max;"," }"," else"," {"," label = (i * increm);"," if(roundingMethod == \"niceNumber\")"," {"," label = this._roundToNearest(label, increm);"," }"," label += min;"," }"," return parseFloat(label);"," },",""," /**"," * Rounds a Number to the nearest multiple of an input. For example, by rounding"," * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round()."," *"," * @method _roundToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;"," return this._roundToPrecision(roundedNumber, 10);"," },"," "," /**"," * Rounds a Number up to the nearest multiple of an input. For example, by rounding"," * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil()."," *"," * @method _roundUpToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundUpToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;"," },"," "," /**"," * Rounds a Number down to the nearest multiple of an input. For example, by rounding"," * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor()."," *"," * @method _roundDownToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundDownToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Rounds a number to a certain level of precision. Useful for limiting the number of"," * decimal places on a fractional number."," *"," * @method _roundToPrecision"," * @param {Number} number Number to round"," * @param {Number} precision Multiple to round towards."," * @return Number"," * @private"," */"," _roundToPrecision: function(number, precision)"," {"," precision = precision || 0;"," var decimalPlaces = Math.pow(10, precision);"," return Math.round(decimalPlaces * number) / decimalPlaces;"," },"," "," /**"," * Checks to see if data extends beyond the range of the axis. If so,"," * that data will need to be hidden. This method is internal, temporary and subject"," * to removal in the future."," *"," * @method _hasDataOverflow"," * @protected"," * @return Boolean"," */"," _hasDataOverflow: function()"," {"," var roundingMethod,"," min,"," max;"," if(this.get(\"setMin\") || this.get(\"setMax\"))"," {"," return true;"," }"," roundingMethod = this.get(\"roundingMethod\");"," min = this._actualMinimum;"," max = this._actualMaximum;"," if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))"," {"," return true;"," }"," return false;"," }","});","","Y.NumericAxis = NumericAxis;"," ","/**"," * StackedAxis manages stacked numeric data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends NumericAxis"," */","function StackedAxis(config)","{"," StackedAxis.superclass.constructor.apply(this, arguments);","}","","StackedAxis.NAME = \"stackedAxis\";","","","Y.extend(StackedAxis, Y.NumericAxis,","{"," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," var max = 0,"," min = 0,"," pos = 0,"," neg = 0,"," len = 0,"," i = 0,"," key,"," num,"," keys = this.get(\"keys\"),"," setMin = this.get(\"setMin\"),"," setMax = this.get(\"setMax\");",""," for(key in keys)"," {"," if(keys.hasOwnProperty(key))"," {"," len = Math.max(len, keys[key].length);"," }"," }"," for(; i < len; ++i)"," {"," pos = 0;"," neg = 0;"," for(key in keys)"," {"," if(keys.hasOwnProperty(key))"," {"," num = keys[key][i];"," if(isNaN(num))"," {"," continue;"," }"," if(num >= 0)"," {"," pos += num;"," }"," else"," {"," neg += num;"," }"," }"," }"," if(pos > 0)"," {"," max = Math.max(max, pos);"," }"," else "," {"," max = Math.max(max, neg);"," }"," if(neg < 0)"," {"," min = Math.min(min, neg);"," }"," else"," {"," min = Math.min(min, pos);"," }"," }"," this._actualMaximum = max;"," this._actualMinimum = min;"," if(setMax)"," {"," max = this._setMaximum;"," }"," if(setMin)"," {"," min = this._setMinimum;"," }"," this._roundMinAndMax(min, max, setMin, setMax);"," }","});","","Y.StackedAxis = StackedAxis;"," ","/**"," * TimeAxis manages time data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class TimeAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function TimeAxis(config)","{"," TimeAxis.superclass.constructor.apply(this, arguments);","}","","TimeAxis.NAME = \"timeAxis\";","","TimeAxis.ATTRS = ","{"," /**"," * Indicates whether the maximum is calculated or explicitly set. "," *"," * @attribute setMax"," * @readOnly"," * @type Boolean"," * @private"," */"," setMax: {"," readOnly: true,",""," getter: function()"," {"," var max = this._getNumber(this._setMaximum);"," return (Y_Lang.isNumber(max));"," }"," },",""," /**"," * Indicates whether the minimum is calculated or explicitly set. "," *"," * @attribute setMin"," * @readOnly"," * @type Boolean"," * @private"," */"," setMin: {"," readOnly: true,",""," getter: function()"," {"," var min = this._getNumber(this._setMinimum);"," return (Y_Lang.isNumber(min));"," }"," },",""," /**"," * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`."," *"," * @attribute maximum"," * @type Number"," */"," maximum: {"," getter: function ()"," {"," var max = this._getNumber(this._setMaximum);"," if(!Y_Lang.isNumber(max))"," {"," max = this._getNumber(this.get(\"dataMaximum\"));"," }"," return parseFloat(max);"," },"," setter: function (value)"," {"," this._setMaximum = this._getNumber(value);"," return value;"," }"," },",""," /**"," * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`."," *"," * @attribute minimum"," * @type Number"," */"," minimum: {"," getter: function ()"," {"," var min = this._getNumber(this._setMinimum);"," if(!Y_Lang.isNumber(min)) "," {"," min = this._getNumber(this.get(\"dataMinimum\"));"," }"," return parseFloat(min);"," },"," setter: function (value)"," {"," this._setMinimum = this._getNumber(value);"," return value;"," }"," },",""," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method"," * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' "," * `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: {"," value: function(val, format)"," {"," val = Y.DataType.Date.parse(val);"," if(format)"," {"," return Y.DataType.Date.format(val, {format:format});"," }"," return val;"," }"," },",""," /**"," * Pattern used by the `labelFunction` to format a label."," *"," * @attribute labelFormat"," * @type String"," */"," labelFormat: {"," value: \"%b %d, %y\""," }","};","","Y.extend(TimeAxis, Y.AxisType, {"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," val = Y.DataType.Date.parse(val);"," if(format)"," {"," return Y.DataType.Date.format(val, {format:format});"," }"," return val;"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuitimeaxis\","," "," /**"," * Type of data used in `Axis`."," *"," * @property _dataType"," * @readOnly"," * @private"," */"," _dataType: \"time\","," "," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," position = this.get(\"position\"),"," increm,"," label;"," l -= 1;"," increm = ((max - min)/l) * i;"," if(position == \"bottom\" || position == \"top\")"," {"," label = min + increm;"," }"," else"," {"," label = max - increm;"," }"," return label;"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var obj,"," keyArray = [],"," i = 0,"," val,"," len = data.length;"," for(; i < len; ++i)"," {"," obj = data[i][key];"," if(Y_Lang.isDate(obj))"," { "," val = obj.valueOf();"," }"," else"," {"," val = new Date(obj);"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(obj))"," {"," if(Y_Lang.isNumber(parseFloat(obj)))"," {"," val = parseFloat(obj);"," }"," else"," {"," if(typeof obj != \"string\")"," {"," obj = obj;"," }"," val = new Date(obj).valueOf();"," }"," }"," else"," {"," val = obj;"," }"," }"," keyArray[i] = val;"," }"," return keyArray;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key, data)"," {"," var obj, "," arr = [], "," dv = this._dataClone.concat(), "," i, "," val,"," len = dv.length;"," for(i = 0; i < len; ++i)"," {"," obj = dv[i][key];"," if(Y_Lang.isDate(obj))"," { "," val = obj.valueOf();"," }"," else"," {"," val = new Date(obj);"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(obj))"," {"," if(Y_Lang.isNumber(parseFloat(obj)))"," {"," val = parseFloat(obj);"," }"," else"," {"," if(typeof obj != \"string\")"," {"," obj = obj.toString();"," }"," val = new Date(obj).valueOf();"," }"," }"," else"," {"," val = obj;"," }"," }"," arr[i] = val;"," }"," this.get(\"keys\")[key] = arr;"," this._updateTotalDataFlag = true;"," },",""," /**"," * Parses value into a number."," *"," * @method _getNumber"," * @param val {Object} Value to parse into a number"," * @return Number"," * @private"," */"," _getNumber: function(val)"," {"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(val) && val)"," {"," val = new Date(val).valueOf();"," }",""," return val;"," }","});","","Y.TimeAxis = TimeAxis;"," ","/**"," * CategoryAxis manages category data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class CategoryAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function CategoryAxis(config)","{"," CategoryAxis.superclass.constructor.apply(this, arguments);","}","","CategoryAxis.NAME = \"categoryAxis\";","","Y.extend(CategoryAxis, Y.AxisType,","{"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," return val;"," },",""," /**"," * Object storing key data."," *"," * @property _indices"," * @private"," */"," _indices: null,",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuicategoryaxis\",",""," /**"," * Type of data used in `Axis`."," *"," * @property _dataType"," * @readOnly"," * @private"," */"," _type: \"category\","," "," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," this._dataMaximum = Math.max(this.get(\"data\").length - 1, 0);"," this._dataMinimum = 0;"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var i = 0,"," obj,"," keyArr = [],"," labels = [],"," len = data.length;"," if(!this._indices)"," {"," this._indices = {};"," }"," for(; i < len; ++i)"," {"," obj = data[i];"," keyArr[i] = i;"," labels[i] = obj[key];"," }"," this._indices[key] = keyArr;"," return labels;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key)"," {"," var i,"," obj, "," arr = [], "," labels = [], "," dv = this._dataClone.concat(), "," len = dv.length;"," if(!this._indices)"," {"," this._indices = {};"," }"," for(i = 0; i < len; ++i)"," {"," obj = dv[i];"," arr[i] = i;"," labels[i] = obj[key];"," }"," this._indices[key] = arr;"," this.get(\"keys\")[key] = labels.concat();"," this._updateTotalDataFlag = true;"," },",""," /**"," * Returns an array of values based on an identifier key."," *"," * @method getDataByKey"," * @param {String} value value used to identify the array"," * @return Array"," */"," getDataByKey: function (value)"," {"," if(!this._indices)"," {"," this.get(\"keys\");"," }"," var keys = this._indices;"," if(keys[value])"," {"," return keys[value];"," }"," return null;"," },",""," /**"," * Returns the total number of majorUnits that will appear on an axis."," *"," * @method getTotalMajorUnits"," * @param {Object} majorUnit Object containing properties related to the majorUnit."," * @param {Number} len Length of the axis."," * @return Number"," */"," getTotalMajorUnits: function(majorUnit, len)"," {"," return this.get(\"data\").length;"," },"," "," /**"," * Returns the distance between major units on an axis."," *"," * @method getMajorUnitDistance"," * @param {Number} len Number of ticks"," * @param {Number} uiLen Size of the axis."," * @param {Object} majorUnit Hash of properties used to determine the majorUnit"," * @return Number"," */"," getMajorUnitDistance: function(len, uiLen, majorUnit)"," {"," var dist;"," if(majorUnit.determinant === \"count\")"," {"," dist = uiLen/len;"," }"," else if(majorUnit.determinant === \"distance\")"," {"," dist = majorUnit.distance;"," }"," return dist;"," },"," "," /**"," * Gets the distance that the first and last ticks are offset from there respective"," * edges."," *"," * @method getEdgeOffset"," * @param {Number} ct Number of ticks on the axis."," * @param {Number} l Length (in pixels) of the axis."," * @return Number"," */"," getEdgeOffset: function(ct, l)"," {"," return l/ct;"," },",""," /**"," * Returns a value based of a key value and an index."," *"," * @method getKeyValueAt"," * @param {String} key value used to look up the correct array"," * @param {Number} index within the array"," * @return String "," */"," getKeyValueAt: function(key, index)"," {"," var value = NaN,"," keys = this.get(\"keys\");"," if(keys[key] && keys[key][index]) "," {"," value = keys[key][index];"," }"," return value;"," },"," "," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var label,"," data = this.get(\"data\"),"," position = this.get(\"position\");"," if(position == \"bottom\" || position == \"top\")"," {"," label = data[i];"," }"," else"," {"," label = data[l - (i + 1)];"," } "," return label;"," },",""," /**"," * Returns a string corresponding to the first label on an "," * axis."," *"," * @method getMinimumValue"," * @return String"," */"," getMinimumValue: function()"," {"," var data = this.get(\"data\"),"," label = data[0];"," return label;"," },",""," /**"," * Returns a string corresponding to the last label on an "," * axis."," *"," * @method getMaximumValue"," * @return String"," */"," getMaximumValue: function()"," {"," var data = this.get(\"data\"),"," len = data.length - 1,"," label = data[len];"," return label;"," }","});","","Y.CategoryAxis = CategoryAxis;"," ","/**"," * Utility class used for calculating curve points."," *"," * @module charts"," * @submodule charts-base"," * @class CurveUtil"," * @constructor"," */","function CurveUtil()","{","}","","CurveUtil.prototype = {"," /**"," * Creates an array of start, end and control points for splines."," *"," * @method getCurveControlPoints"," * @param {Array} xcoords Collection of x-coordinates used for calculate the curves"," * @param {Array} ycoords Collection of y-coordinates used for calculate the curves"," * @return Object"," * @protected"," */"," getCurveControlPoints: function(xcoords, ycoords) "," {"," var outpoints = [],"," i = 1,"," l = xcoords.length - 1,"," xvals = [],"," yvals = [];"," "," "," // Too few points, need at least two"," if (l < 1) "," {"," return null;"," } "," "," outpoints[0] = {"," startx: xcoords[0], "," starty: ycoords[0],"," endx: xcoords[1],"," endy: ycoords[1]"," };"," "," // Special case, the Bezier should be a straight line"," if (l === 1) "," {"," outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; "," outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;"," outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];"," outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];"," return outpoints;"," }",""," for (; i < l; ++i) "," {"," outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});"," xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];"," yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];"," }"," "," xvals[0] = xcoords[0] + (2.0 * xcoords[1]);"," xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;"," xvals = this.getControlPoints(xvals.concat());"," yvals[0] = ycoords[0] + (2.0 * ycoords[1]);"," yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; "," yvals = this.getControlPoints(yvals.concat());"," "," for (i = 0; i < l; ++i) "," {"," outpoints[i].ctrlx1 = Math.round(xvals[i]);"," outpoints[i].ctrly1 = Math.round(yvals[i]);"," "," if (i < l-1) "," {"," outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);"," outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);"," }"," else "," {"," outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);"," outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);"," }"," }"," "," return outpoints; "," },",""," /**"," * Gets the control points for the curve."," *"," * @method getControlPoints"," * @param {Array} vals Collection of values coords used to generate control points."," * @return Array"," * @private"," */"," getControlPoints: function(vals) "," {"," var l = vals.length,"," x = [],"," tmp = [],"," b = 2.0,"," i = 1;"," x[0] = vals[0] / b;"," for (; i < l; ++i) "," {"," tmp[i] = 1/b;"," b = (i < l-1 ? 4.0 : 3.5) - tmp[i];"," x[i] = (vals[i] - x[i-1]) / b;"," }"," "," for (i = 1; i < l; ++i) "," {"," x[l-i-1] -= tmp[l-i] * x[l-i];"," }"," "," return x;"," }","};","Y.CurveUtil = CurveUtil;","/**"," * Utility class used for creating stacked series."," *"," * @module charts"," * @submodule charts-base"," * @class StackingUtil"," * @constructor"," */","function StackingUtil(){}","","StackingUtil.prototype = {"," /**"," * Indicates whether the series is stacked."," *"," * @property _stacked"," * @private"," */"," _stacked: true,",""," /**"," * @protected"," *"," * Adjusts coordinate values for stacked series."," *"," * @method _stackCoordinates"," */"," _stackCoordinates: function() "," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._stackXCoords();"," }"," else"," {"," this._stackYCoords();"," }"," },",""," /**"," * Stacks coordinates for a stacked vertical series."," *"," * @method _stackXCoords"," * @protected"," */"," _stackXCoords: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," i = 0,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," len,"," coord,"," prevCoord,"," prevOrder,"," stackedXCoords = xcoords.concat(),"," prevXCoords,"," prevYCoords,"," nullIndices = [],"," nullIndex;"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"stackedXCoords\");"," prevYCoords = seriesCollection[order - 1].get(\"stackedYCoords\");"," len = prevXCoords.length;"," }"," else"," {"," len = xcoords.length;"," }"," for(; i < len; i = i + 1)"," {"," if(Y_Lang.isNumber(xcoords[i]))"," {"," if(order > 0)"," {"," prevCoord = prevXCoords[i];"," if(!Y_Lang.isNumber(prevCoord))"," {"," prevOrder = order;"," while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))"," {"," prevOrder = prevOrder - 1;"," if(prevOrder > -1)"," {"," prevCoord = seriesCollection[prevOrder].get(\"stackedXCoords\")[i];"," }"," else"," {"," prevCoord = this._leftOrigin;"," }"," }"," }"," xcoords[i] = xcoords[i] + prevCoord;"," }"," stackedXCoords[i] = xcoords[i];"," }"," else"," {"," nullIndices.push(i);"," }"," }"," this._cleanXNaN(stackedXCoords, ycoords);"," len = nullIndices.length;"," if(len > 0)"," {"," for(i = 0; i < len; i = i + 1)"," {"," nullIndex = nullIndices[i];"," coord = order > 0 ? prevXCoords[nullIndex] : this._leftOrigin;"," stackedXCoords[nullIndex] = Math.max(stackedXCoords[nullIndex], coord);"," }"," }"," this.set(\"stackedXCoords\", stackedXCoords);"," this.set(\"stackedYCoords\", ycoords);"," },",""," /**"," * Stacks coordinates for a stacked horizontal series."," *"," * @method _stackYCoords"," * @protected"," */"," _stackYCoords: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," h = graph.get(\"height\"), "," seriesCollection = graph.seriesTypes[type],"," i = 0,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," len,"," coord,"," prevCoord,"," prevOrder,"," stackedYCoords = ycoords.concat(),"," prevXCoords,"," prevYCoords,"," nullIndices = [],"," nullIndex;"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"stackedXCoords\");"," prevYCoords = seriesCollection[order - 1].get(\"stackedYCoords\");"," len = prevYCoords.length;"," }"," else"," {"," len = ycoords.length;"," }"," for(; i < len; i = i + 1)"," {"," if(Y_Lang.isNumber(ycoords[i]))"," {"," if(order > 0)"," {"," prevCoord = prevYCoords[i];"," if(!Y_Lang.isNumber(prevCoord))"," {"," prevOrder = order;"," while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))"," {"," prevOrder = prevOrder - 1;"," if(prevOrder > -1)"," {"," prevCoord = seriesCollection[prevOrder].get(\"stackedYCoords\")[i];"," }"," else"," {"," prevCoord = this._bottomOrigin;"," }"," }"," }"," ycoords[i] = prevCoord - (h - ycoords[i]);"," }"," stackedYCoords[i] = ycoords[i];"," }"," else"," {"," nullIndices.push(i);"," }"," }"," this._cleanYNaN(xcoords, stackedYCoords);"," len = nullIndices.length;"," if(len > 0)"," {"," for(i = 0; i < len; i = i + 1)"," {"," nullIndex = nullIndices[i];"," coord = order > 0 ? prevYCoords[nullIndex] : h;"," stackedYCoords[nullIndex] = Math.min(stackedYCoords[nullIndex], coord);"," }"," }"," this.set(\"stackedXCoords\", xcoords);"," this.set(\"stackedYCoords\", stackedYCoords);"," },",""," /**"," * Cleans invalid x-coordinates by calculating their value based on the corresponding y-coordinate, the previous valid x-coordinate with its "," * corresponding y-coordinate and the next valid x-coordinate with its corresponding y-coordinate. If there is no previous or next valid x-coordinate,"," * the value will not be altered."," *"," * @method _cleanXNaN"," * @param {Array} xcoords An array of x-coordinate values"," * @param {Array} ycoords An arry of y-coordinate values"," * @private"," */"," _cleanXNaN: function(xcoords, ycoords)"," {"," var previousValidIndex,"," nextValidIndex,"," previousValidX,"," previousValidY,"," x,"," y,"," nextValidX,"," nextValidY,"," isNumber = Y_Lang.isNumber,"," m,"," i = 0,"," len = ycoords.length;"," for(; i < len; ++i)"," {"," x = xcoords[i];"," y = ycoords[i];"," //if x is invalid, calculate where it should be"," if(!isNumber(x) && i > 0 && i < len - 1)"," {"," previousValidY = ycoords[i - 1];"," //check to see if the previous value is valid"," previousValidX = this._getPreviousValidCoordValue(xcoords, i);"," nextValidY = ycoords[i + 1];"," nextValidX = this._getNextValidCoordValue(xcoords, i);"," //check to see if the next value is valid"," if(isNumber(previousValidX) && isNumber(nextValidX))"," {"," //calculate slope and solve for x"," m = (nextValidY - previousValidY) / (nextValidX - previousValidX);"," xcoords[i] = (y + (m * previousValidX) - previousValidY)/m;"," }"," previousValidIndex = NaN;"," nextValidIndex = NaN;"," }"," }"," },",""," /**"," * Returns the previous valid (numeric) value in an array if available."," *"," * @method _getPreviousValidCoordValue"," * @param {Array} coords Array of values"," * @param {Number} index The index in the array in which to begin searching."," * @return Number"," * @private"," */"," _getPreviousValidCoordValue: function(coords, index)"," {"," var coord,"," isNumber = Y_Lang.isNumber,"," limit = -1;"," while(!isNumber(coord) && index > limit)"," {"," index = index - 1;"," coord = coords[index];"," }"," return coord;"," },",""," /**"," * Returns the next valid (numeric) value in an array if available."," *"," * @method _getNextValidCoordValue"," * @param {Array} coords Array of values"," * @param {Number} index The index in the array in which to begin searching."," * @return Number"," * @private"," */"," _getNextValidCoordValue: function(coords, index)"," {"," var coord,"," isNumber = Y_Lang.isNumber,"," limit = coords.length;"," while(!isNumber(coord) && index < limit)"," {"," index = index + 1;"," coord = coords[index];"," }"," return coord;"," },",""," /**"," * Cleans invalid y-coordinates by calculating their value based on the corresponding x-coordinate, the previous valid y-coordinate with its "," * corresponding x-coordinate and the next valid y-coordinate with its corresponding x-coordinate. If there is no previous or next valid y-coordinate,"," * the value will not be altered."," *"," * @method _cleanYNaN"," * @param {Array} xcoords An array of x-coordinate values"," * @param {Array} ycoords An arry of y-coordinate values"," * @private"," */"," _cleanYNaN: function(xcoords, ycoords)"," {"," var previousValidIndex,"," nextValidIndex,"," previousValidX,"," previousValidY,"," x,"," y,"," nextValidX,"," nextValidY,"," isNumber = Y_Lang.isNumber,"," m,"," i = 0,"," len = xcoords.length;"," for(; i < len; ++i)"," {"," x = xcoords[i];"," y = ycoords[i];"," //if y is invalid, calculate where it should be"," if(!isNumber(y) && i > 0 && i < len - 1)"," {"," //check to see if the previous value is valid"," previousValidX = xcoords[i - 1];"," previousValidY = this._getPreviousValidCoordValue(ycoords, i);"," //check to see if the next value is valid"," nextValidX = xcoords[i + 1];"," nextValidY = this._getNextValidCoordValue(ycoords, i);"," if(isNumber(previousValidY) && isNumber(nextValidY))"," {"," //calculate slope and solve for y"," m = (nextValidY - previousValidY) / (nextValidX - previousValidX);"," ycoords[i] = previousValidY + ((m * x) - (m * previousValidX));"," }"," previousValidIndex = NaN;"," nextValidIndex = NaN;"," }"," }"," }","};","Y.StackingUtil = StackingUtil;","/**"," * Utility class used for drawing lines."," *"," * @module charts"," * @submodule charts-base"," * @class Lines"," * @constructor"," */","function Lines(){}","","Lines.prototype = {"," /**"," * @property _lineDefaults"," * @type Object"," * @private"," */"," _lineDefaults: null,"," "," /**"," * Creates a graphic in which to draw a series."," *"," * @method _getGraphic"," * @return Graphic"," * @private"," */"," _getGraphic: function()"," {"," var graphic = this.get(\"graphic\") || this.get(\"graph\").get(\"graphic\");"," if(!this._lineGraphic)"," {"," this._lineGraphic = graphic.addShape({type: \"path\"});"," }"," this._lineGraphic.clear();"," return this._lineGraphic;"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," if(this._lineGraphic)"," {"," this._lineGraphic.set(\"visible\", visible);"," }"," },",""," /**"," * Draws lines for the series."," *"," * @method drawLines"," * @protected"," */"," drawLines: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," xcoords,"," ycoords,"," direction = this.get(\"direction\"),"," len,"," lastPointValid,"," pointValid,"," noPointsRendered = true,"," lastValidX,"," lastValidY,"," nextX,"," nextY,"," i,"," styles = this.get(\"styles\").line,"," lineType = styles.lineType,"," lc = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"line\"),"," lineAlpha = styles.alpha,"," dashLength = styles.dashLength,"," gapSpace = styles.gapSpace,"," connectDiscontinuousPoints = styles.connectDiscontinuousPoints,"," discontinuousType = styles.discontinuousType,"," discontinuousDashLength = styles.discontinuousDashLength,"," discontinuousGapSpace = styles.discontinuousGapSpace,"," path = this._getGraphic();"," if(this._stacked)"," {"," xcoords = this.get(\"stackedXCoords\");"," ycoords = this.get(\"stackedYCoords\");"," }"," else"," {"," xcoords = this.get(\"xcoords\");"," ycoords = this.get(\"ycoords\");"," }"," len = direction === \"vertical\" ? ycoords.length : xcoords.length;"," path.set(\"stroke\", {"," weight: styles.weight, "," color: lc, "," opacity: lineAlpha"," });"," for(i = 0; i < len; i = ++i)"," {"," nextX = xcoords[i];"," nextY = ycoords[i];"," pointValid = isNumber(nextX) && isNumber(nextY); "," if(!pointValid)"," {"," lastPointValid = pointValid;"," continue;"," }"," if(noPointsRendered)"," {"," noPointsRendered = false;"," path.moveTo(nextX, nextY);"," }"," else if(lastPointValid)"," {"," if(lineType != \"dashed\")"," {"," path.lineTo(nextX, nextY);"," }"," else"," {"," this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, "," dashLength, "," gapSpace);"," }"," }"," else if(!connectDiscontinuousPoints)"," {"," path.moveTo(nextX, nextY);"," }"," else"," {"," if(discontinuousType != \"solid\")"," {"," this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, "," discontinuousDashLength, "," discontinuousGapSpace);"," }"," else"," {"," path.lineTo(nextX, nextY);"," }"," }"," lastValidX = nextX;"," lastValidY = nextY;"," lastPointValid = true;"," }"," path.end();"," },"," "," /**"," * Connects data points with a consistent curve for a series."," * "," * @method drawSpline"," * @protected"," */"," drawSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords = this.getCurveControlPoints(xcoords, ycoords),"," len = curvecoords.length,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," styles = this.get(\"styles\").line,"," path = this._getGraphic(),"," lineAlpha = styles.alpha,"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"line\");"," path.set(\"stroke\", { "," weight: styles.weight, "," color: color, "," opacity: lineAlpha"," });"," path.moveTo(xcoords[0], ycoords[0]);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," path.end();"," },",""," /**"," * Draws a dashed line between two points."," * "," * @method drawDashedLine"," * @param {Number} xStart The x position of the start of the line"," * @param {Number} yStart The y position of the start of the line"," * @param {Number} xEnd The x position of the end of the line"," * @param {Number} yEnd The y position of the end of the line"," * @param {Number} dashSize the size of dashes, in pixels"," * @param {Number} gapSize the size of gaps between dashes, in pixels"," * @private"," */"," drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)"," {"," dashSize = dashSize || 10;"," gapSize = gapSize || 10;"," var segmentLength = dashSize + gapSize,"," xDelta = xEnd - xStart,"," yDelta = yEnd - yStart,"," delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),"," segmentCount = Math.floor(Math.abs(delta / segmentLength)),"," radians = Math.atan2(yDelta, xDelta),"," xCurrent = xStart,"," yCurrent = yStart,"," i;"," xDelta = Math.cos(radians) * segmentLength;"," yDelta = Math.sin(radians) * segmentLength;"," "," for(i = 0; i < segmentCount; ++i)"," {"," path.moveTo(xCurrent, yCurrent);"," path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);"," xCurrent += xDelta;"," yCurrent += yDelta;"," }"," "," path.moveTo(xCurrent, yCurrent);"," delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));"," "," if(delta > dashSize)"," {"," path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);"," }"," else if(delta > 0)"," {"," path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);"," }"," "," path.moveTo(xEnd, yEnd);"," },",""," /**"," * Default values for `styles` attribute."," *"," * @method _getLineDefaults"," * @return Object"," * @protected"," */"," _getLineDefaults: function()"," {"," return {"," alpha: 1,"," weight: 6,"," lineType:\"solid\", "," dashLength:10, "," gapSpace:10, "," connectDiscontinuousPoints:true, "," discontinuousType:\"solid\", "," discontinuousDashLength:10, "," discontinuousGapSpace:10"," };"," }","};","Y.augment(Lines, Y.Attribute);","Y.Lines = Lines;","/**"," * Utility class used for drawing area fills."," *"," * @module charts"," * @class Fills"," * @constructor"," */","function Fills(cfg)","{"," var attrs = {"," area: {"," getter: function()"," {"," return this._defaults || this._getAreaDefaults();"," },",""," setter: function(val)"," {"," var defaults = this._defaults || this._getAreaDefaults();"," this._defaults = Y.merge(defaults, val);"," }"," }"," };"," this.addAttrs(attrs, cfg);"," this.get(\"styles\");","}","","Fills.prototype = {"," /**"," * Returns a path shape used for drawing fills."," *"," * @method _getPath"," * @return Path"," * @private"," */"," _getPath: function()"," {"," var path = this._path;"," if(!path)"," {"," path = this.get(\"graph\").get(\"graphic\").addShape({type:\"path\"});"," this._path = path;"," }"," return path;"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," { "," if(this._path)"," {"," this._path.set(\"visible\", visible);"," }"," },",""," /**"," * Draws fill"," *"," * @method drawFill"," * @param {Array} xcoords The x-coordinates for the series."," * @param {Array} ycoords The y-coordinates for the series."," * @protected"," */"," drawFill: function(xcoords, ycoords)"," {"," if(xcoords.length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," len = xcoords.length,"," firstX = xcoords[0],"," firstY = ycoords[0],"," lastValidX = firstX,"," lastValidY = firstY,"," nextX,"," nextY,"," pointValid,"," noPointsRendered = true,"," i = 0,"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," path.clear();"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," for(; i < len; i = ++i)"," {"," nextX = xcoords[i];"," nextY = ycoords[i];"," pointValid = isNumber(nextX) && isNumber(nextY); "," if(!pointValid)"," {"," continue;"," }"," if(noPointsRendered)"," {"," this._firstValidX = nextX;"," this._firstValidY = nextY;"," noPointsRendered = false;"," path.moveTo(nextX, nextY);"," }"," else"," {"," path.lineTo(nextX, nextY);"," }"," lastValidX = nextX;"," lastValidY = nextY;"," }"," this._lastValidX = lastValidX;"," this._lastValidY = lastValidY;"," path.end();"," },"," "," /**"," * Draws a fill for a spline"," *"," * @method drawAreaSpline"," * @protected"," */"," drawAreaSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords = this.getCurveControlPoints(xcoords, ycoords),"," len = curvecoords.length,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," firstX = xcoords[0],"," firstY = ycoords[0],"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," path.moveTo(firstX, firstY);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," if(this.get(\"direction\") === \"vertical\")"," {"," path.lineTo(this._leftOrigin, y);"," path.lineTo(this._leftOrigin, firstY);"," }"," else"," {"," path.lineTo(x, this._bottomOrigin);"," path.lineTo(firstX, this._bottomOrigin);"," }"," path.lineTo(firstX, firstY);"," path.end();"," },"," "," /**"," * Draws a a stacked area spline"," *"," * @method drawStackedAreaSpline"," * @protected"," */"," drawStackedAreaSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords,"," order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," prevXCoords,"," prevYCoords,"," len,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," firstX,"," firstY,"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," firstX = xcoords[0];"," firstY = ycoords[0];"," curvecoords = this.getCurveControlPoints(xcoords, ycoords);"," len = curvecoords.length;"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," path.moveTo(firstX, firstY);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"xcoords\").concat().reverse();"," prevYCoords = seriesCollection[order - 1].get(\"ycoords\").concat().reverse();"," curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);"," i = 0;"," len = curvecoords.length;"," path.lineTo(prevXCoords[0], prevYCoords[0]);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," }"," else"," {"," if(this.get(\"direction\") === \"vertical\")"," {"," path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);"," path.lineTo(this._leftOrigin, firstY);"," }"," else"," {"," path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);"," path.lineTo(firstX, this._bottomOrigin);"," }",""," }"," path.lineTo(firstX, firstY);"," path.end();"," },"," "," /**"," * Storage for default area styles."," *"," * @property _defaults"," * @type Object"," * @private"," */"," _defaults: null,",""," /**"," * Concatenates coordinate array with correct coordinates for closing an area fill."," *"," * @method _getClosingPoints"," * @return Array"," * @protected"," */"," _getClosingPoints: function()"," {"," var xcoords = this.get(\"xcoords\").concat(),"," ycoords = this.get(\"ycoords\").concat(),"," firstValidIndex,"," lastValidIndex;"," if(this.get(\"direction\") === \"vertical\")"," {"," lastValidIndex = this._getLastValidIndex(xcoords);"," firstValidIndex = this._getFirstValidIndex(xcoords);"," ycoords.push(ycoords[lastValidIndex]);"," ycoords.push(ycoords[firstValidIndex]);"," xcoords.push(this._leftOrigin);"," xcoords.push(this._leftOrigin);"," }"," else"," {"," lastValidIndex = this._getLastValidIndex(ycoords);"," firstValidIndex = this._getFirstValidIndex(ycoords);"," xcoords.push(xcoords[lastValidIndex]);"," xcoords.push(xcoords[firstValidIndex]);"," ycoords.push(this._bottomOrigin);"," ycoords.push(this._bottomOrigin);"," }"," xcoords.push(xcoords[0]);"," ycoords.push(ycoords[0]);"," return [xcoords, ycoords];"," },",""," /**"," * Returns the order of the series closest to the current series that has a valid value for the current index."," *"," * @method _getHighestValidOrder"," * @param {Array} seriesCollection Array of series of a given type."," * @param {Number} index Index of the series item."," * @param {Number} order Index of the the series in the seriesCollection"," * @param {String} direction Indicates the direction of the series"," * @return Number"," * @private"," */"," _getHighestValidOrder: function(seriesCollection, index, order, direction)"," {"," var coords = direction == \"vertical\" ? \"stackedXCoords\" : \"stackedYCoords\","," coord;"," while(isNaN(coord) && order > -1)"," {"," order = order - 1;"," if(order > -1)"," {"," coord = seriesCollection[order].get(coords)[index];"," }"," }"," return order;"," },"," "," /**"," * Returns an array containing the x and y coordinates for a given series and index."," *"," * @method _getCoordsByOrderAndIndex"," * @param {Array} seriesCollection Array of series of a given type."," * @param {Number} index Index of the series item."," * @param {Number} order Index of the the series in the seriesCollection"," * @param {String} direction Indicates the direction of the series"," * @return Array"," * @private"," */"," _getCoordsByOrderAndIndex: function(seriesCollection, index, order, direction)"," {"," var xcoord,"," ycoord;"," if(direction == \"vertical\")"," {"," xcoord = order < 0 ? this._leftOrigin : seriesCollection[order].get(\"stackedXCoords\")[index];"," ycoord = this.get(\"stackedYCoords\")[index];"," }"," else"," {"," xcoord = this.get(\"stackedXCoords\")[index];"," ycoord = order < 0 ? this._bottomOrigin : seriesCollection[order].get(\"stackedYCoords\")[index];"," }"," return [xcoord, ycoord];"," },"," "," /**"," * Concatenates coordinate array with the correct coordinates for closing an area stack."," *"," * @method _getStackedClosingPoints"," * @return Array"," * @protected"," */"," _getStackedClosingPoints: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," direction = this.get(\"direction\"),"," seriesCollection = graph.seriesTypes[type],"," firstValidIndex,"," lastValidIndex,"," xcoords = this.get(\"stackedXCoords\"),"," ycoords = this.get(\"stackedYCoords\"),"," limit,"," previousSeries,"," previousSeriesFirstValidIndex,"," previousSeriesLastValidIndex,"," previousXCoords,"," previousYCoords,"," coords,"," closingXCoords,"," closingYCoords,"," currentIndex,"," highestValidOrder,"," oldOrder;"," if(order < 1)"," { "," return this._getClosingPoints();"," }"," "," previousSeries = seriesCollection[order - 1];"," previousXCoords = previousSeries.get(\"stackedXCoords\").concat();"," previousYCoords = previousSeries.get(\"stackedYCoords\").concat();"," if(direction == \"vertical\")"," {"," firstValidIndex = this._getFirstValidIndex(xcoords);"," lastValidIndex = this._getLastValidIndex(xcoords);"," previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousXCoords);"," previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousXCoords);"," }"," else"," {"," firstValidIndex = this._getFirstValidIndex(ycoords);"," lastValidIndex = this._getLastValidIndex(ycoords);"," previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousYCoords);"," previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousYCoords);"," }"," if(previousSeriesLastValidIndex >= firstValidIndex && previousSeriesFirstValidIndex <= lastValidIndex)"," {"," previousSeriesFirstValidIndex = Math.max(firstValidIndex, previousSeriesFirstValidIndex);"," previousSeriesLastValidIndex = Math.min(lastValidIndex, previousSeriesLastValidIndex);"," previousXCoords = previousXCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);"," previousYCoords = previousYCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);"," limit = previousSeriesFirstValidIndex;"," }"," else"," {"," limit = lastValidIndex;"," }",""," closingXCoords = [xcoords[firstValidIndex]];"," closingYCoords = [ycoords[firstValidIndex]];"," currentIndex = firstValidIndex;"," while((isNaN(highestValidOrder) || highestValidOrder < order - 1) && currentIndex <= limit)"," {"," oldOrder = highestValidOrder;"," highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);"," if(!isNaN(oldOrder) && highestValidOrder > oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," currentIndex = currentIndex + 1;"," }"," if(previousXCoords && previousXCoords.length > 0 && previousSeriesLastValidIndex > firstValidIndex && previousSeriesFirstValidIndex < lastValidIndex)"," {"," closingXCoords = closingXCoords.concat(previousXCoords);"," closingYCoords = closingYCoords.concat(previousYCoords);"," highestValidOrder = order -1; "," }"," currentIndex = Math.max(firstValidIndex, previousSeriesLastValidIndex);"," order = order - 1;"," highestValidOrder = NaN;"," while(currentIndex <= lastValidIndex)"," {"," oldOrder = highestValidOrder;"," highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);"," if(!isNaN(oldOrder))"," {"," if(highestValidOrder > oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," else if(highestValidOrder < oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex - 1, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," }"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," currentIndex = currentIndex + 1;"," }",""," closingXCoords.reverse();"," closingYCoords.reverse();"," return [xcoords.concat(closingXCoords), ycoords.concat(closingYCoords)];"," },",""," /**"," * Returns default values for area styles."," *"," * @method _getAreaDefaults"," * @return Object"," * @private"," */"," _getAreaDefaults: function()"," {"," return {"," };"," }","};","Y.augment(Fills, Y.Attribute);","Y.Fills = Fills;","/**"," * Utility class used for drawing markers."," *"," * @module charts"," * @submodule charts-base"," * @class Plots"," * @constructor"," */","function Plots(cfg)","{"," var attrs = { "," markers: {"," getter: function()"," {"," return this._markers;"," }"," }"," };"," this.addAttrs(attrs, cfg);","}","","Plots.prototype = {"," /**"," * Storage for default marker styles."," *"," * @property _plotDefaults"," * @type Object"," * @private"," */"," _plotDefaults: null,",""," /**"," * Draws the markers"," *"," * @method drawPlots"," * @protected"," */"," drawPlots: function()"," {"," if(!this.get(\"xcoords\") || this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker),"," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," left,"," marker,"," offsetWidth = w/2,"," offsetHeight = h/2,"," xvalues,"," yvalues,"," fillColors = null,"," borderColors = null,"," graphOrder = this.get(\"graphOrder\"),"," groupMarkers = this.get(\"groupMarkers\");"," if(groupMarkers)"," {"," xvalues = [];"," yvalues = [];"," for(; i < len; ++i)"," {"," xvalues.push(parseFloat(xcoords[i] - offsetWidth));"," yvalues.push(parseFloat(ycoords[i] - offsetHeight));"," }"," this._createGroupMarker({"," xvalues: xvalues,"," yvalues: yvalues,"," fill: style.fill,"," border: style.border,"," dimensions: {"," width: w,"," height: h"," },"," graphOrder: graphOrder,"," shape: style.shape"," });"," return;"," }"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," for(; i < len; ++i)"," {"," top = parseFloat(ycoords[i] - offsetHeight);"," left = parseFloat(xcoords[i] - offsetWidth); "," if(!isNumber(left) || !isNumber(top))"," {"," this._markers.push(null);"," continue;"," }"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }",""," style.x = left;"," style.y = top;"," marker = this.getMarker(style, graphOrder, i);"," }"," this._clearMarkerCache();"," },",""," /**"," * Pre-defined group shapes."," *"," * @property _groupShapes"," * @private"," */"," _groupShapes: {"," circle: Y.CircleGroup,"," rect: Y.RectGroup,"," ellipse: Y.EllipseGroup,"," diamond: Y.DiamondGroup"," },",""," /**"," * Returns the correct group shape class."," *"," * @method _getGroupShape"," * @param {Shape | String} shape Indicates which shape class. "," * @return Function"," * @protected"," */"," _getGroupShape: function(shape)"," {"," if(Y_Lang.isString(shape))"," {"," shape = this._groupShapes[shape];"," }"," return shape;"," },",""," /**"," * Gets the default values for series that use the utility. This method is used by"," * the class' `styles` attribute's getter to get build default values."," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 1,"," alpha: 1"," },"," width: 10,"," height: 10,"," shape: \"circle\""," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," },",""," /**"," * Collection of markers to be used in the series."," *"," * @property _markers"," * @type Array"," * @private"," */"," _markers: null,",""," /**"," * Collection of markers to be re-used on a series redraw."," *"," * @property _markerCache"," * @type Array"," * @private"," */"," _markerCache: null,"," "," /**"," * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise"," * it will create one."," *"," * @method getMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @protected"," */"," getMarker: function(styles, order, index)"," {"," var marker,"," border = styles.border;"," styles.id = this.get(\"chart\").get(\"id\") + \"_\" + order + \"_\" + index;"," //fix name differences between graphic layer"," border.opacity = border.alpha;"," styles.stroke = border;"," styles.fill.opacity = styles.fill.alpha;"," if(this._markerCache.length > 0)"," {"," while(!marker)"," {"," if(this._markerCache.length < 1)"," {"," marker = this._createMarker(styles, order, index);"," break;"," }"," marker = this._markerCache.shift();",""," }"," marker.set(styles);"," }"," else"," {"," marker = this._createMarker(styles, order, index);"," }"," this._markers.push(marker);"," return marker;"," },"," "," /**"," * Creates a shape to be used as a marker."," *"," * @method _createMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @private"," */"," _createMarker: function(styles, order, index)"," {"," var graphic = this.get(\"graphic\"),"," marker,"," cfg = Y.clone(styles);"," graphic.set(\"autoDraw\", false);"," cfg.type = cfg.shape;"," marker = graphic.addShape(cfg); "," marker.addClass(SERIES_MARKER);"," return marker;"," },"," "," /**"," * Creates a cache of markers for reuse."," *"," * @method _createMarkerCache"," * @private"," */"," _createMarkerCache: function()"," {"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," this._groupMarker = null;"," }"," if(this._markers && this._markers.length > 0)"," {"," this._markerCache = this._markers.concat();"," }"," else"," {"," this._markerCache = [];"," }"," this._markers = [];"," },"," "," /**"," * Draws a series of markers in a single shape instance."," *"," * @method _createGroupMarkers"," * @param {Object} styles Set of configuration properties used to create the markers."," * @protected"," */"," _createGroupMarker: function(styles)"," {"," var marker,"," markers = this.get(\"markers\"),"," border = styles.border,"," graphic,"," cfg,"," shape;"," if(markers && markers.length > 0)"," {"," while(markers.length > 0)"," {"," marker = markers.shift();"," marker.destroy();"," }"," this.set(\"markers\", []);"," }"," //fix name differences between graphic layer"," border.opacity = border.alpha;"," cfg = {"," id: this.get(\"chart\").get(\"id\") + \"_\" + styles.graphOrder,"," stroke: border,"," fill: styles.fill,"," dimensions: styles.dimensions,"," xvalues: styles.xvalues,"," yvalues: styles.yvalues"," };"," cfg.fill.opacity = styles.fill.alpha;"," shape = this._getGroupShape(styles.shape);"," if(shape)"," {"," cfg.type = shape;"," }"," if(styles.hasOwnProperty(\"radius\") && !isNaN(styles.radius))"," {"," cfg.dimensions.radius = styles.radius;"," }"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," }"," graphic = this.get(\"graphic\");"," this._groupMarker = graphic.addShape(cfg);"," graphic._redraw();"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," var marker,"," markers = this.get(\"markers\"),"," i = 0,"," len;"," if(markers)"," {"," len = markers.length;"," for(; i < len; ++i)"," {"," marker = markers[i];"," if(marker)"," {"," marker.set(\"visible\", visible);"," }"," }"," }"," },",""," /**"," * Removes unused markers from the marker cache"," *"," * @method _clearMarkerCache"," * @private"," */"," _clearMarkerCache: function()"," {"," var marker;"," while(this._markerCache.length > 0)"," {"," marker = this._markerCache.shift();"," if(marker)"," {"," marker.destroy();"," }"," }"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var w,"," h,"," styles = Y.clone(this.get(\"styles\").marker),"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," markerStyles.stroke = markerStyles.border;"," marker.set(markerStyles);"," w = markerStyles.width;"," h = markerStyles.height;"," marker.set(\"x\", (xcoords[i] - w/2));"," marker.set(\"y\", (ycoords[i] - h/2));"," marker.set(\"visible\", this.get(\"visible\"));"," }"," },",""," /**"," * Parses a color from an array."," *"," * @method _getItemColor"," * @param {Array} val collection of colors"," * @param {Number} i index of the item"," * @return String"," * @protected"," */"," _getItemColor: function(val, i)"," {"," if(Y_Lang.isArray(val))"," {"," return val[i % val.length];"," }"," return val;"," },",""," /**"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," * @protected"," */"," _setStyles: function(val)"," {"," val = this._parseMarkerStyles(val);"," return Y.Renderer.prototype._setStyles.apply(this, [val]);"," },",""," /**"," * Combines new styles with existing styles."," *"," * @method _parseMarkerStyles"," * @param {Object} Object containing style properties for the marker."," * @return Object"," * @private"," */"," _parseMarkerStyles: function(val)"," {"," if(val.marker)"," {"," var defs = this._getPlotDefaults();"," val.marker = this._mergeStyles(val.marker, defs);"," if(val.marker.over)"," {"," val.marker.over = this._mergeStyles(val.marker.over, val.marker);"," }"," if(val.marker.down)"," {"," val.marker.down = this._mergeStyles(val.marker.down, val.marker);"," }"," }"," return val;"," },",""," /**"," * Returns marker state based on event type"," *"," * @method _getState"," * @param {String} type event type"," * @return String"," * @protected"," */"," _getState: function(type)"," {"," var state;"," switch(type)"," {"," case \"mouseout\" :"," state = \"off\";"," break;"," case \"mouseover\" :"," state = \"over\";"," break;"," case \"mouseup\" :"," state = \"over\";"," break;"," case \"mousedown\" :"," state = \"down\";"," break;"," }"," return state;"," },"," "," /**"," * @property _statSyles"," * @type Object"," * @private"," */"," _stateSyles: null","};","","Y.augment(Plots, Y.Attribute);","Y.Plots = Plots;","/**"," * Histogram is the base class for Column and Bar series."," *"," * @module charts"," * @submodule charts-base"," * @class Histogram"," * @constructor"," */","function Histogram(){}","","Histogram.prototype = {"," /**"," * Draws the series."," *"," * @method drawSeries"," * @protected"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var style = Y.clone(this.get(\"styles\").marker),"," setSize,"," calculatedSize,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," seriesLen = seriesCollection.length,"," seriesSize = 0,"," totalSize = 0,"," offset = 0,"," ratio,"," renderer,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," setSizeKey,"," calculatedSizeKey,"," config,"," fillColors = null,"," borderColors = null,"," xMarkerPlane = [],"," yMarkerPlane = [],"," xMarkerPlaneLeft,"," xMarkerPlaneRight,"," yMarkerPlaneTop,"," yMarkerPlaneBottom,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," if(this.get(\"direction\") == \"vertical\")"," {"," setSizeKey = \"height\";"," calculatedSizeKey = \"width\";"," }"," else"," {"," setSizeKey = \"width\";"," calculatedSizeKey = \"height\";"," }"," setSize = style[setSizeKey];"," calculatedSize = style[calculatedSizeKey];"," this._createMarkerCache();"," for(; i < seriesLen; ++i)"," {"," renderer = seriesCollection[i];"," seriesSize += renderer.get(\"styles\").marker[setSizeKey];"," if(order > i) "," {"," offset = seriesSize;"," }"," }"," totalSize = len * seriesSize;"," this._maxSize = graph.get(setSizeKey);"," if(totalSize > this._maxSize)"," {"," ratio = graph.get(setSizeKey)/totalSize;"," seriesSize *= ratio;"," offset *= ratio;"," setSize *= ratio;"," setSize = Math.max(setSize, 1);"," this._maxSize = setSize;"," }"," offset -= seriesSize/2;"," for(i = 0; i < len; ++i)"," {"," xMarkerPlaneLeft = xcoords[i] - seriesSize/2;"," xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;"," yMarkerPlaneTop = ycoords[i] - seriesSize/2;"," yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;"," xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});"," yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});"," if(isNaN(xcoords[i]) || isNaN(ycoords[i]))"," {"," this._markers.push(null);"," continue;"," }"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);"," if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)"," {"," top = config.top;"," left = config.left;",""," if(groupMarkers)"," {"," dimensions[setSizeKey][i] = setSize;"," dimensions[calculatedSizeKey][i] = config.calculatedSize;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style[setSizeKey] = setSize;"," style[calculatedSizeKey] = config.calculatedSize;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }",""," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," this.set(\"xMarkerPlane\", xMarkerPlane);"," this.set(\"yMarkerPlane\", yMarkerPlane);"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },"," "," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],"," "," /**"," * Gets the default style values for the markers."," *"," * @method _getPlotDefaults"," * @return Object"," * @private"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 12,"," height: 12,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","};","","Y.Histogram = Histogram;","/**"," * The CartesianSeries class creates a chart with horizontal and vertical axes."," *"," * @module charts"," * @submodule charts-base"," * @class CartesianSeries"," * @extends Base"," * @uses Renderer"," * @constructor"," */","Y.CartesianSeries = Y.Base.create(\"cartesianSeries\", Y.Base, [Y.Renderer], {"," /**"," * Storage for `xDisplayName` attribute."," *"," * @property _xDisplayName"," * @type String"," * @private"," */"," _xDisplayName: null,",""," /**"," * Storage for `yDisplayName` attribute."," *"," * @property _yDisplayName"," * @type String"," * @private"," */"," _yDisplayName: null,"," "," /**"," * Th x-coordinate for the left edge of the series."," *"," * @property _leftOrigin"," * @type String"," * @private"," */"," _leftOrigin: null,",""," /**"," * The y-coordinate for the bottom edge of the series."," * "," * @property _bottomOrigin"," * @type String"," * @private"," */"," _bottomOrigin: null,",""," /**"," * @method render"," * @private"," */"," render: function()"," {"," this._setCanvas();"," this.addListeners();"," this.set(\"rendered\", true);"," this.validate();"," },",""," /**"," * Adds event listeners."," *"," * @method addListeners"," * @private"," */"," addListeners: function()"," {"," var xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\");"," if(xAxis)"," {"," this._xDataReadyHandle = xAxis.after(\"dataReady\", Y.bind(this._xDataChangeHandler, this));"," this._xDataUpdateHandle = xAxis.after(\"dataUpdate\", Y.bind(this._xDataChangeHandler, this));"," }"," if(yAxis)"," {"," this._yDataReadyHandle = yAxis.after(\"dataReady\", Y.bind(this._yDataChangeHandler, this));"," this._yDataUpdateHandle = yAxis.after(\"dataUpdate\", Y.bind(this._yDataChangeHandler, this));"," }"," this._xAxisChangeHandle = this.after(\"xAxisChange\", this._xAxisChangeHandler);"," this._yAxisChangeHandle = this.after(\"yAxisChange\", this._yAxisChangeHandler);"," this._stylesChangeHandle = this.after(\"stylesChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._widthChangeHandle = this.after(\"widthChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._heightChangeHandle = this.after(\"heightChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._visibleChangeHandle = this.after(\"visibleChange\", this._handleVisibleChange);"," },"," "," /**"," * Event handler for the xAxisChange event."," *"," * @method _xAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _xAxisChangeHandler: function(e)"," {"," var xAxis = this.get(\"xAxis\");"," xAxis.after(\"dataReady\", Y.bind(this._xDataChangeHandler, this));"," xAxis.after(\"dataUpdate\", Y.bind(this._xDataChangeHandler, this));"," },"," "," /**"," * Event handler the yAxisChange event."," *"," * @method _yAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _yAxisChangeHandler: function(e)"," {"," var yAxis = this.get(\"yAxis\");"," yAxis.after(\"dataReady\", Y.bind(this._yDataChangeHandler, this));"," yAxis.after(\"dataUpdate\", Y.bind(this._yDataChangeHandler, this));"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuicartesianseries\",",""," /**"," * Event handler for xDataChange event."," *"," * @method _xDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _xDataChangeHandler: function(event)"," {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," },",""," /**"," * Event handler for yDataChange event."," *"," * @method _yDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _yDataChangeHandler: function(event)"," {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," },",""," /**"," * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`."," *"," * @method _updateAxisData"," * @return Boolean"," * @private "," */"," _updateAxisData: function()"," {"," var xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\"),"," xKey = this.get(\"xKey\"),"," yKey = this.get(\"yKey\"),"," yData,"," xData;"," if(!xAxis || !yAxis || !xKey || !yKey)"," {"," return false;"," }"," xData = xAxis.getDataByKey(xKey);"," yData = yAxis.getDataByKey(yKey);"," if(!xData || !yData)"," {"," return false;"," }"," this.set(\"xData\", xData.concat());"," this.set(\"yData\", yData.concat());"," return true;"," },",""," /**"," * Draws the series is the xAxis and yAxis data are both available."," *"," * @method validate"," * @private"," */"," validate: function()"," {"," if((this.get(\"xData\") && this.get(\"yData\")) || this._updateAxisData())"," {"," this.draw();"," }"," else"," {"," this.fire(\"drawingComplete\");"," }"," },",""," /**"," * Creates a `Graphic` instance."," *"," * @method _setCanvas"," * @protected"," */"," _setCanvas: function()"," {"," var graph = this.get(\"graph\"),"," graphic = graph.get(\"graphic\");"," this.set(\"graphic\", graphic);"," },",""," /**"," * Calculates the coordinates for the series."," *"," * @method setAreaData"," * @protected"," */"," setAreaData: function()"," {"," var isNumber = Y_Lang.isNumber,"," nextX, nextY,"," graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\"),"," xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\"),"," xData = this.get(\"xData\").concat(),"," yData = this.get(\"yData\").concat(),"," xValue,"," yValue,"," xOffset = xAxis.getEdgeOffset(xData.length, w),"," yOffset = yAxis.getEdgeOffset(yData.length, h),"," padding = this.get(\"styles\").padding,"," leftPadding = padding.left,"," topPadding = padding.top,"," dataWidth = w - (leftPadding + padding.right + xOffset),"," dataHeight = h - (topPadding + padding.bottom + yOffset),"," xcoords = [],"," ycoords = [],"," xMax = xAxis.get(\"maximum\"),"," xMin = xAxis.get(\"minimum\"),"," yMax = yAxis.get(\"maximum\"),"," yMin = yAxis.get(\"minimum\"),"," xScaleFactor = dataWidth / (xMax - xMin),"," yScaleFactor = dataHeight / (yMax - yMin),"," dataLength,"," direction = this.get(\"direction\"),"," i = 0,"," xMarkerPlane = [],"," yMarkerPlane = [],"," xMarkerPlaneOffset = this.get(\"xMarkerPlaneOffset\"),"," yMarkerPlaneOffset = this.get(\"yMarkerPlaneOffset\"),"," graphic = this.get(\"graphic\");"," graphic.set(\"width\", w);"," graphic.set(\"height\", h);"," dataLength = xData.length;"," xOffset *= 0.5;"," yOffset *= 0.5;"," //Assuming a vertical graph has a range/category for its vertical axis. "," if(direction === \"vertical\")"," {"," yData = yData.reverse();"," }"," this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);"," this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); "," if(yMin < 0)"," {"," this._bottomOrigin = this._bottomOrigin - ((0 - yMin) * yScaleFactor);"," }"," for (; i < dataLength; ++i) "," {"," xValue = parseFloat(xData[i]);"," yValue = parseFloat(yData[i]);"," if(isNumber(xValue))"," {"," nextX = (((xValue - xMin) * xScaleFactor) + leftPadding + xOffset);"," }"," else"," {"," nextX = NaN;"," }"," if(isNumber(yValue))"," {"," nextY = ((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor);"," }"," else"," {"," nextY = NaN;"," }"," xcoords.push(nextX);"," ycoords.push(nextY);"," xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});"," yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});"," }"," this.set(\"xcoords\", xcoords);"," this.set(\"ycoords\", ycoords);"," this.set(\"xMarkerPlane\", xMarkerPlane);"," this.set(\"yMarkerPlane\", yMarkerPlane);"," this._dataLength = dataLength;"," },",""," /**"," * Finds the first valid index of an array coordinates."," *"," * @method _getFirstValidIndex"," * @param {Array} coords An array of x or y coordinates."," * @return Number"," * @private"," */"," _getFirstValidIndex: function(coords)"," {"," var coord,"," i = -1,"," limit = coords.length;"," while(!Y_Lang.isNumber(coord) && i < limit)"," {"," i += 1;"," coord = coords[i];"," }"," return i;"," },",""," /**"," * Finds the last valid index of an array coordinates."," *"," * @method _getLastValidIndex"," * @param {Array} coords An array of x or y coordinates."," * @return Number"," * @private"," */"," _getLastValidIndex: function(coords)"," {"," var coord,"," i = coords.length,"," limit = -1;"," while(!Y_Lang.isNumber(coord) && i > limit)"," {"," i -= 1;"," coord = coords[i];"," }"," return i;"," },",""," /**"," * Draws the series."," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," var graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\");"," if(this.get(\"rendered\"))"," {"," if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get(\"xData\") && this.get(\"yData\")) || this._updateAxisData()))"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," this.setAreaData();"," if(this.get(\"xcoords\") && this.get(\"ycoords\"))"," {"," this.drawSeries();"," }"," this._drawing = false;"," if(this._callLater)"," {"," this.draw();"," }"," else"," {"," this._toggleVisible(this.get(\"visible\"));"," this.fire(\"drawingComplete\");"," }"," }"," }"," },"," "," /**"," * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. "," *"," * @property _defaultPlaneOffset"," * @type Number"," * @private"," */"," _defaultPlaneOffset: 4,"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," return {padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }};"," },",""," /**"," * Collection of default colors used for lines in a series when not specified by user."," *"," * @property _defaultLineColors"," * @type Array"," * @protected"," */"," _defaultLineColors:[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"],",""," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors:[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"],"," "," /**"," * Collection of default colors used for marker borders in a series when not specified by user."," *"," * @property _defaultBorderColors"," * @type Array"," * @protected"," */"," _defaultBorderColors:[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"],"," "," /**"," * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user."," *"," * @property _defaultSliceColors"," * @type Array"," * @protected"," */"," _defaultSliceColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],",""," /**"," * Parses a color based on a series order and type."," *"," * @method _getDefaultColor"," * @param {Number} index Index indicating the series order."," * @param {String} type Indicates which type of object needs the color."," * @return String"," * @protected"," */"," _getDefaultColor: function(index, type)"," {"," var colors = {"," line: this._defaultLineColors,"," fill: this._defaultFillColors,"," border: this._defaultBorderColors,"," slice: this._defaultSliceColors"," },"," col = colors[type],"," l = col.length;"," index = index || 0;"," if(index >= l)"," {"," index = index % l;"," }"," type = type || \"fill\";"," return colors[type][index];"," },"," "," /**"," * Shows/hides contents of the series."," *"," * @method _handleVisibleChange"," * @param {Object} e Event object."," * @protected"," */"," _handleVisibleChange: function(e) "," {"," this._toggleVisible(this.get(\"visible\"));"," },",""," /**"," * Returns the sum of all values for the series."," *"," * @method getTotalValues"," * @return Number"," */"," getTotalValues: function()"," {"," var total = this.get(\"valueAxis\").getTotalByKey(this.get(\"valueKey\"));"," return total;"," },",""," /**"," * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var marker,"," markers = this.get(\"markers\");"," if(this.get(\"rendered\"))"," {"," if(this._xDataReadyHandle)"," {"," this._xDataReadyHandle.detach();"," }"," if(this._xDataUpdateHandle)"," {"," this._xDataUpdateHandle.detach();"," }"," if(this._yDataReadyHandle)"," {"," this._yDataReadyHandle.detach();"," }"," if(this._yDataUpdateHandle)"," {"," this._yDataUpdateHandle.detach();"," }"," this._xAxisChangeHandle.detach();"," this._yAxisChangeHandle.detach();"," this._stylesChangeHandle.detach();"," this._widthChangeHandle.detach();"," this._heightChangeHandle.detach();"," this._visibleChangeHandle.detach();"," }"," while(markers && markers.length > 0)"," {"," marker = markers.shift();"," if(marker && marker instanceof Y.Shape)"," {"," marker.destroy();"," }"," }"," if(this._path)"," {"," this._path.destroy();"," this._path = null;"," }"," if(this._lineGraphic)"," {"," this._lineGraphic.destroy();"," this._lineGraphic = null;"," }"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," this._groupMarker = null;"," }"," }"," /**"," * Event handle for the x-axis' dataReady event."," * "," * @property _xDataReadyHandle"," * @type {EventHandle}"," * @private"," */"," "," /**"," * Event handle for the x-axis dataUpdate event."," *"," * @property _xDataUpdateHandle"," * @type {EventHandle}"," * @private"," */"," "," /**"," * Event handle for the y-axis dataReady event."," *"," * @property _yDataReadyHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the y-axis dataUpdate event."," * @property _yDataUpdateHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the xAxisChange event."," * @property _xAxisChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the yAxisChange event."," * @property _yAxisChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the stylesChange event."," * @property _stylesChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the widthChange event."," * @property _widthChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the heightChange event."," * @property _heightChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the visibleChange event."," * @property _visibleChangeHandle"," * @type {EventHandle}"," * @private"," */","}, {"," ATTRS: {"," /**"," * Name used for for displaying data related to the x-coordinate."," *"," * @attribute xDisplayName"," * @type String"," */"," xDisplayName: {"," getter: function()"," {"," return this._xDisplayName || this.get(\"xKey\");"," },",""," setter: function(val)"," {"," this._xDisplayName = val.toString();"," return val;"," }"," },",""," /**"," * Name used for for displaying data related to the y-coordinate."," *"," * @attribute yDisplayName"," * @type String"," */"," yDisplayName: {"," getter: function()"," {"," return this._yDisplayName || this.get(\"yKey\");"," },",""," setter: function(val)"," {"," this._yDisplayName = val.toString();"," return val;"," }"," },"," "," /**"," * Name used for for displaying category data"," *"," * @attribute categoryDisplayName"," * @type String"," * @readOnly"," */"," categoryDisplayName: {"," lazyAdd: false,",""," getter: function()"," {"," return this.get(\"direction\") == \"vertical\" ? this.get(\"yDisplayName\") : this.get(\"xDisplayName\");"," },",""," setter: function(val)"," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._yDisplayName = val;"," }"," else"," {"," this._xDisplayName = val;"," }"," return val;"," }"," },",""," /**"," * Name used for for displaying value data"," *"," * @attribute valueDisplayName"," * @type String"," * @readOnly"," */"," valueDisplayName: {"," lazyAdd: false,",""," getter: function()"," {"," return this.get(\"direction\") == \"vertical\" ? this.get(\"xDisplayName\") : this.get(\"yDisplayName\");"," },",""," setter: function(val)"," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._xDisplayName = val;"," }"," else"," {"," this._yDisplayName = val;"," }"," return val;"," }"," },"," "," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default cartesian"," */"," type: { "," value: \"cartesian\""," },",""," /**"," * Order of this instance of this `type`."," *"," * @attribute order"," * @type Number"," */"," order: {},",""," /**"," * Order of the instance"," *"," * @attribute graphOrder"," * @type Number"," */"," graphOrder: {},",""," /**"," * x coordinates for the series."," *"," * @attribute xcoords"," * @type Array"," */"," xcoords: {},"," "," /**"," * y coordinates for the series"," *"," * @attribute ycoords"," * @type Array"," */"," ycoords: {},",""," /**"," * Reference to the `Chart` application."," *"," * @attribute chart"," * @type ChartBase"," * @readOnly"," */"," chart: {"," readOnly: true,",""," getter: function()"," {"," return this.get(\"graph\").get(\"chart\");"," }"," },"," "," /**"," * Reference to the `Graph` in which the series is drawn into."," *"," * @attribute graph"," * @type Graph"," */"," graph: {},",""," /**"," * Reference to the `Axis` instance used for assigning "," * x-values to the graph."," *"," * @attribute xAxis"," * @type Axis"," */"," xAxis: {},"," "," /**"," * Reference to the `Axis` instance used for assigning "," * y-values to the graph."," *"," * @attribute yAxis"," * @type Axis"," */"," yAxis: {},"," "," /**"," * Indicates which array to from the hash of value arrays in "," * the x-axis `Axis` instance."," *"," * @attribute xKey"," * @type String"," */"," xKey: {"," setter: function(val)"," {"," return val.toString();"," }"," },",""," /**"," * Indicates which array to from the hash of value arrays in "," * the y-axis `Axis` instance."," *"," * @attribute yKey"," * @type String"," */"," yKey: {"," setter: function(val)"," {"," return val.toString();"," }"," },",""," /**"," * Array of x values for the series."," *"," * @attribute xData"," * @type Array"," */"," xData: {},",""," /**"," * Array of y values for the series."," *"," * @attribute yData"," * @type Array"," */"," yData: {},"," "," /**"," * Indicates whether the Series has been through its initial set up."," *"," * @attribute rendered"," * @type Boolean"," */"," rendered: {"," value: false"," },",""," /*"," * Returns the width of the parent graph"," *"," * @attribute width"," * @type Number"," */"," width: {"," readOnly: true,"," "," getter: function()"," {"," this.get(\"graph\").get(\"width\");"," }"," },",""," /**"," * Returns the height of the parent graph"," *"," * @attribute height"," * @type Number"," */"," height: {"," readOnly: true,"," "," getter: function()"," {"," this.get(\"graph\").get(\"height\");"," }"," },",""," /**"," * Indicates whether to show the series"," *"," * @attribute visible"," * @type Boolean"," * @default true"," */"," visible: {"," value: true"," },",""," /**"," * Collection of area maps along the xAxis. Used to determine mouseover for multiple"," * series."," *"," * @attribute xMarkerPlane"," * @type Array"," */"," xMarkerPlane: {},"," "," /**"," * Collection of area maps along the yAxis. Used to determine mouseover for multiple"," * series."," *"," * @attribute yMarkerPlane"," * @type Array"," */"," yMarkerPlane: {},",""," /**"," * Distance from a data coordinate to the left/right for setting a hotspot."," *"," * @attribute xMarkerPlaneOffset"," * @type Number"," */"," xMarkerPlaneOffset: {"," getter: function() {"," var marker = this.get(\"styles\").marker;"," if(marker && marker.width && isFinite(marker.width))"," {"," return marker.width * 0.5;"," }"," return this._defaultPlaneOffset;"," }"," },",""," /**"," * Distance from a data coordinate to the top/bottom for setting a hotspot."," *"," * @attribute yMarkerPlaneOffset"," * @type Number"," */"," yMarkerPlaneOffset: {"," getter: function() {"," var marker = this.get(\"styles\").marker;"," if(marker && marker.height && isFinite(marker.height))"," {"," return marker.height * 0.5;"," }"," return this._defaultPlaneOffset;"," }"," },",""," /**"," * Direction of the series"," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"horizontal\""," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," getter: function()"," {"," if(this._groupMarkers === undefined)"," {"," return this.get(\"graph\").get(\"groupMarkers\");"," }"," else"," {"," return this._groupMarkers;"," }"," },",""," setter: function(val)"," {"," this._groupMarkers = val;"," return val;"," }"," }"," }","});","/**"," * The MarkerSeries class renders quantitative data by plotting relevant data points "," * on a graph."," *"," * @module charts"," * @submodule charts-base"," * @class MarkerSeries"," * @extends CartesianSeries"," * @uses Plots"," * @constructor"," */","Y.MarkerSeries = Y.Base.create(\"markerSeries\", Y.CartesianSeries, [Y.Plots], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawPlots();"," },"," "," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.marker)"," {"," val = {marker:val};"," }"," val = this._parseMarkerStyles(val);"," return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);"," },"," "," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());"," return styles;"," }","},{"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default marker"," */"," type: {"," value:\"marker\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>"," * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * The LineSeries class renders quantitative data on a graph by connecting relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class LineSeries"," * @extends CartesianSeries"," * @uses Lines"," * @constructor"," */","Y.LineSeries = Y.Base.create(\"lineSeries\", Y.CartesianSeries, [Y.Lines], {"," /**"," * @protected"," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawLines();"," },",""," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.line)"," {"," val = {line:val};"," }"," return Y.LineSeries.superclass._setStyles.apply(this, [val]);"," },",""," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default line"," */"," type: {"," value:\"line\""," }",""," /**"," * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * SplineSeries renders a graph with data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class SplineSeries"," * @constructor"," * @extends CartesianSeries"," * @uses CurveUtil"," * @uses Lines"," */","Y.SplineSeries = Y.Base.create(\"splineSeries\", Y.LineSeries, [Y.CurveUtil, Y.Lines], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default spline"," */"," type : {"," value:\"spline\""," }",""," /**"," * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis"," * to indicate their contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedSplineSeries"," * @constructor"," * @extends SplineSeries"," * @extends StackingUtil"," */","Y.StackedSplineSeries = Y.Base.create(\"stackedSplineSeries\", Y.SplineSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedSplineSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedSpline"," */"," type: {"," value:\"stackedSpline\""," }"," }","});","","/**"," * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each"," * series' contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedMarkerSeries"," * @constructor"," * @extends MarkerSeries"," * @extends StackingUtil"," */","Y.StackedMarkerSeries = Y.Base.create(\"stackedMarkerSeries\", Y.MarkerSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedMarkerSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedMarker"," */"," type: {"," value:\"stackedMarker\""," }"," }","});","","/**"," * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'"," * lengths are proportional to the values they represent along a vertical axis."," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class ColumnSeries"," * @extends MarkerSeries"," * @uses Histogram"," * @constructor"," */","Y.ColumnSeries = Y.Base.create(\"columnSeries\", Y.MarkerSeries, [Y.Histogram], {"," /**"," * Helper method for calculating the size of markers. "," *"," * @method _getMarkerDimensions"," * @param {Number} xcoord The x-coordinate representing the data point for the marker."," * @param {Number} ycoord The y-coordinate representing the data point for the marker."," * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height."," * @param {Number} offset Distance of position offset dictated by other marker series in the same graph."," * @return Object"," * @private"," */"," _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)"," {"," var config = {"," left: xcoord + offset"," };"," if(this._bottomOrigin >= ycoord)"," {"," config.top = ycoord;"," config.calculatedSize = this._bottomOrigin - config.top;"," }"," else"," {"," config.top = this._bottomOrigin;"," config.calculatedSize = ycoord - this._bottomOrigin;"," }"," return config;"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles = Y.clone(this.get(\"styles\").marker),"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markers,"," graph = this.get(\"graph\"),"," seriesStyles,"," seriesCollection = graph.seriesTypes[this.get(\"type\")],"," seriesLen = seriesCollection.length,"," seriesSize = 0,"," offset = 0,"," renderer,"," n = 0,"," xs = [],"," order = this.get(\"order\"),"," config;"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);"," markerStyles.height = config.calculatedSize;"," markerStyles.width = Math.min(this._maxSize, markerStyles.width);"," marker.set(markerStyles);"," for(; n < seriesLen; ++n)"," {"," xs[n] = xcoords[i] + seriesSize;"," seriesStyles = seriesCollection[n].get(\"styles\").marker;"," seriesSize += Math.min(this._maxSize, seriesStyles.width);"," if(order > n)"," {"," offset = seriesSize;"," }"," offset -= seriesSize/2;"," }"," for(n = 0; n < seriesLen; ++n)"," {"," markers = seriesCollection[n].get(\"markers\");"," if(markers)"," {"," renderer = markers[i];"," if(renderer && renderer !== undefined)"," {"," renderer.set(\"x\", (xs[n] - seriesSize/2));"," }"," }"," }"," }"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @readOnly"," * @default column"," */"," type: {"," value: \"column\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'"," * lengths are proportional to the values they represent along a horizontal axis."," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class BarSeries"," * @extends MarkerSeries"," * @uses Histogram"," * @constructor"," */","Y.BarSeries = Y.Base.create(\"barSeries\", Y.MarkerSeries, [Y.Histogram], {"," /**"," * Helper method for calculating the size of markers. "," *"," * @method _getMarkerDimensions"," * @param {Number} xcoord The x-coordinate representing the data point for the marker."," * @param {Number} ycoord The y-coordinate representing the data point for the marker."," * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height."," * @param {Number} offset Distance of position offset dictated by other marker series in the same graph."," * @return Object"," * @private"," */"," _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)"," {"," var config = {"," top: ycoord + offset"," };"," if(xcoord >= this._leftOrigin)"," {"," config.left = this._leftOrigin;"," config.calculatedSize = xcoord - config.left;"," }"," else"," {"," config.left = xcoord;"," config.calculatedSize = this._leftOrigin - xcoord;"," }"," return config;"," },"," "," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles = Y.clone(this.get(\"styles\").marker),"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markers,"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[this.get(\"type\")],"," seriesLen = seriesCollection.length,"," seriesStyles,"," seriesSize = 0,"," offset = 0,"," renderer,"," n = 0,"," ys = [],"," order = this.get(\"order\"),"," config;"," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);"," markerStyles.width = config.calculatedSize;"," markerStyles.height = Math.min(this._maxSize, markerStyles.height);"," marker.set(markerStyles);"," for(; n < seriesLen; ++n)"," {"," ys[n] = ycoords[i] + seriesSize;"," seriesStyles = seriesCollection[n].get(\"styles\").marker;"," seriesSize += Math.min(this._maxSize, seriesStyles.height); "," if(order > n)"," {"," offset = seriesSize;"," }"," offset -= seriesSize/2;"," }"," for(n = 0; n < seriesLen; ++n)"," {"," markers = seriesCollection[n].get(\"markers\");"," if(markers)"," {"," renderer = markers[i];"," if(renderer && renderer !== undefined)"," {"," renderer.set(\"y\", (ys[n] - seriesSize/2));"," }"," }"," }"," }"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default bar"," */"," type: {"," value: \"bar\""," },",""," /**"," * Indicates the direction of the category axis that the bars are plotted against."," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"vertical\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The AreaSeries class renders quantitative data on a graph by creating a fill between 0"," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class AreaSeries"," * @extends CartesianSeries"," * @uses Fills"," * @constructor"," */","Y.AreaSeries = Y.Base.create(\"areaSeries\", Y.CartesianSeries, [Y.Fills], {"," /**"," * @protected"," *"," * Renders the series. "," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawFill.apply(this, this._getClosingPoints());"," },"," "," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.area)"," {"," val = {area:val};"," }"," return Y.AreaSeries.superclass._setStyles.apply(this, [val]);"," },",""," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default area"," */"," type: {"," value:\"area\""," }"," "," /**"," * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * AreaSplineSeries renders an area graph with data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class AreaSplineSeries"," * @constructor"," * @extends CartesianSeries"," * @uses Fills"," * @uses CurveUtil"," */","Y.AreaSplineSeries = Y.Base.create(\"areaSplineSeries\", Y.AreaSeries, [Y.CurveUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawAreaSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default areaSpline"," */"," type: {"," value:\"areaSpline\""," }"," "," /**"," * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAreaSplineSeries"," * @constructor"," * @extends AreaSeries"," * @uses CurveUtil"," * @uses StackingUtil"," */","Y.StackedAreaSplineSeries = Y.Base.create(\"stackedAreaSplineSeries\", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this._stackCoordinates();"," this.drawStackedAreaSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedAreaSpline"," */"," type: {"," value:\"stackedAreaSpline\""," }"," }","});","","/**"," * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots "," * are rendered and area is not. "," *"," * @module charts"," * @submodule charts-base"," * @class ComboSeries"," * @extends CartesianSeries "," * @uses Fills"," * @uses Lines"," * @uses Plots"," * @constructor"," */","Y.ComboSeries = Y.Base.create(\"comboSeries\", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {"," /**"," * @protected"," * "," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawFill.apply(this, this._getClosingPoints());"," }"," if(this.get(\"showLines\")) "," {"," this.drawLines();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," var markers,"," marker,"," len,"," i;"," if(this.get(\"showAreaFill\") && this._path)"," {"," this._path.set(\"visible\", visible);"," }"," if(this.get(\"showLines\") && this._lineGraphic)"," {"," this._lineGraphic.set(\"visible\", visible);"," }"," if(this.get(\"showMarkers\"))"," {"," markers = this.get(\"markers\");"," if(markers)"," {"," i = 0;"," len = markers.length;"," for(; i < len; ++i)"," {"," marker = markers[i];"," if(marker)"," {"," marker.set(\"visible\", visible);"," }"," }"," }"," }"," },",""," /**"," * @protected"," *"," * Returns the default hash for the `styles` attribute."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = Y.ComboSeries.superclass._getDefaultStyles();"," styles.line = this._getLineDefaults();"," styles.marker = this._getPlotDefaults();"," styles.area = this._getAreaDefaults();"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default combo"," */"," type: {"," value:\"combo\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default false"," */"," showAreaFill: {"," value: false"," },",""," /**"," * Indicates whether lines are displayed."," *"," * @attribute showLines"," * @type Boolean"," * @default true"," */"," showLines: {"," value: true"," },",""," /**"," * Indicates whether markers are displayed."," *"," * @attribute showMarkers"," * @type Boolean"," * @default true"," */"," showMarkers: {"," value: true"," },",""," /**"," * Reference to the styles of the markers. These styles can also"," * be accessed through the `styles` attribute. Below are default"," * values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>"," * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute marker"," * @type Object"," */"," marker: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").marker;"," },"," setter: function(val)"," {"," this.set(\"styles\", {marker:val});"," }"," },"," "," /**"," * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute."," * Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute line"," * @type Object"," */"," line: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").line;"," },"," setter: function(val)"," {"," this.set(\"styles\", {line:val});"," }"," },"," "," /**"," * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute."," * Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute area"," * @type Object"," */"," area: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").area;"," },"," setter: function(val)"," {"," this.set(\"styles\", {area:val});"," }"," }",""," /**"," * Style properties for the series. Contains a key indexed hash of the following:"," * <dl>"," * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed"," * <a href=\"#attr_marker\">here</a>.</dd>"," * <dt>line</dt><dd>Style properties for the lines in the series. Specific"," * style attributes are listed <a href=\"#attr_line\">here</a>.</dd>"," * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed"," * <a href=\"#attr_area\">here</a>.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series"," * are stacked along the value axis to indicate each series contribution to a cumulative total. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are"," * rendered. "," *"," * @module charts"," * @submodule charts-base"," * @class StackedComboSeries"," * @extends ComboSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedComboSeries = Y.Base.create(\"stackedComboSeries\", Y.ComboSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedComboSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," },"," "," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawFill.apply(this, this._getStackedClosingPoints());"," }"," if(this.get(\"showLines\")) "," {"," this.drawLines();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }"," ","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedCombo"," */"," type: {"," value: \"stackedCombo\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default true"," */"," showAreaFill: {"," value: true"," }"," }","});","/**"," * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots "," * are rendered and areaspline is not. "," *"," * @module charts"," * @submodule charts-base"," * @class ComboSplineSeries"," * @extends ComboSeries"," * @extends CurveUtil"," * @constructor"," */","Y.ComboSplineSeries = Y.Base.create(\"comboSplineSeries\", Y.ComboSeries, [Y.CurveUtil], {"," /**"," * @protected"," * "," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawAreaSpline();"," }"," if(this.get(\"showLines\")) "," {"," this.drawSpline();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default comboSpline"," */"," type: {"," value : \"comboSpline\""," }"," }","});","/**"," * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series"," * are stacked along the value axis to indicate each series contribution to a cumulative total. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are"," * rendered. "," *"," * @module charts"," * @submodule charts-base"," * @class StackedComboSplineSeries"," * @extends StackedComboSeries"," * @uses CurveUtil"," * @constructor"," */","Y.StackedComboSplineSeries = Y.Base.create(\"stackedComboSplineSeries\", Y.StackedComboSeries, [Y.CurveUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawStackedAreaSpline();"," }"," if(this.get(\"showLines\")) "," {"," this.drawSpline();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedComboSpline"," */"," type : {"," value : \"stackedComboSpline\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default true"," */"," showAreaFill: {"," value: true"," }"," }","});","/**"," * StackedLineSeries creates line graphs in which the different series are stacked along a value axis"," * to indicate their contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedLineSeries"," * @constructor"," * @extends LineSeries"," * @uses StackingUtil"," */","Y.StackedLineSeries = Y.Base.create(\"stackedLineSeries\", Y.LineSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedLineSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedLine"," */"," type: {"," value:\"stackedLine\""," }"," }","});","/**"," * StackedAreaSeries area fills to display data showing its contribution to a whole."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAreaSeries"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AreaSeries"," * @uses StackingUtil"," */","Y.StackedAreaSeries = Y.Base.create(\"stackedAreaSeries\", Y.AreaSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedAreaSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," },",""," /**"," * @protected"," *"," * Draws the series"," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawFill.apply(this, this._getStackedClosingPoints());"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedArea"," */"," type: {"," value:\"stackedArea\""," }"," }","});","/**"," * The StackedColumnSeries renders column chart in which series are stacked vertically to show"," * their contribution to the cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedColumnSeries"," * @extends ColumnSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedColumnSeries = Y.Base.create(\"stackedColumnSeries\", Y.ColumnSeries, [Y.StackingUtil], {"," /**"," * Draws the series."," *"," * @method drawSeries"," * @protected"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker), "," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," ratio,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," fillColors,"," borderColors,"," lastCollection,"," negativeBaseValues,"," positiveBaseValues,"," useOrigin = order === 0,"," totalWidth = len * w,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," if(totalWidth > this.get(\"width\"))"," {"," ratio = this.width/totalWidth;"," w *= ratio;"," w = Math.max(w, 1);"," }"," if(!useOrigin)"," {"," lastCollection = seriesCollection[order - 1];"," negativeBaseValues = lastCollection.get(\"negativeBaseValues\");"," positiveBaseValues = lastCollection.get(\"positiveBaseValues\");"," if(!negativeBaseValues || !positiveBaseValues)"," {"," useOrigin = true;"," positiveBaseValues = [];"," negativeBaseValues = [];"," }"," }"," else"," {"," negativeBaseValues = [];"," positiveBaseValues = [];"," }"," this.set(\"negativeBaseValues\", negativeBaseValues);"," this.set(\"positiveBaseValues\", positiveBaseValues);"," for(i = 0; i < len; ++i)"," {"," left = xcoords[i];"," top = ycoords[i];"," "," if(!isNumber(top) || !isNumber(left))"," {"," if(useOrigin)"," {"," negativeBaseValues[i] = this._bottomOrigin;"," positiveBaseValues[i] = this._bottomOrigin;"," }"," this._markers.push(null); "," continue;"," }"," if(useOrigin)"," {"," h = Math.abs(this._bottomOrigin - top);"," if(top < this._bottomOrigin)"," {"," positiveBaseValues[i] = top;"," negativeBaseValues[i] = this._bottomOrigin;"," }"," else if(top > this._bottomOrigin)"," {"," positiveBaseValues[i] = this._bottomOrigin;"," negativeBaseValues[i] = top;"," top -= h;"," }"," else"," {"," positiveBaseValues[i] = top;"," negativeBaseValues[i] = top;"," }"," }"," else "," {"," if(top > this._bottomOrigin)"," {"," top += (negativeBaseValues[i] - this._bottomOrigin);"," h = top - negativeBaseValues[i];"," negativeBaseValues[i] = top;"," top -= h;"," }"," else if(top <= this._bottomOrigin)"," {"," top = positiveBaseValues[i] - (this._bottomOrigin - top);"," h = positiveBaseValues[i] - top;"," positiveBaseValues[i] = top;"," }"," }"," if(!isNaN(h) && h > 0)"," {"," left -= w/2;"," if(groupMarkers)"," {"," dimensions.width[i] = w;"," dimensions.height[i] = h;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style.width = w;"," style.height = h;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }"," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles,"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," marker = this._markers[i],"," offset = 0,"," fillColor,"," borderColor; "," styles = this.get(\"styles\").marker;"," offset = styles.width * 0.5;"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); "," markerStyles.height = marker.get(\"height\");"," markerStyles.x = (xcoords[i] - offset);"," markerStyles.y = marker.get(\"y\");"," markerStyles.id = marker.get(\"id\");"," fillColor = markerStyles.fill.color; "," borderColor = markerStyles.border.color;"," if(Y_Lang.isArray(fillColor))"," {"," markerStyles.fill.color = fillColor[i % fillColor.length];"," }"," else"," {"," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," }"," if(Y_Lang.isArray(borderColor))"," {"," markerStyles.border.color = borderColor[i % borderColor.length];"," }"," else"," {"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," }"," marker.set(markerStyles);"," }"," },"," "," /**"," * Gets the default values for the markers. "," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 24,"," height: 24,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedColumn"," */"," type: {"," value: \"stackedColumn\""," },",""," /**"," * @attribute negativeBaseValues"," * @type Array"," * @default null"," * @private"," */"," negativeBaseValues: {"," value: null"," },",""," /**"," * @attribute positiveBaseValues"," * @type Array"," * @default null"," * @private"," */"," positiveBaseValues: {"," value: null"," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * The StackedBarSeries renders bar chart in which series are stacked horizontally to show"," * their contribution to the cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedBarSeries"," * @extends BarSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedBarSeries = Y.Base.create(\"stackedBarSeries\", Y.BarSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }",""," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker),"," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," ratio,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," lastCollection,"," negativeBaseValues,"," positiveBaseValues,"," fillColors,"," borderColors,"," useOrigin = order === 0,"," totalHeight = len * h,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," if(totalHeight > this.get(\"height\"))"," {"," ratio = this.height/totalHeight;"," h *= ratio;"," h = Math.max(h, 1);"," }"," if(!useOrigin)"," {"," lastCollection = seriesCollection[order - 1];"," negativeBaseValues = lastCollection.get(\"negativeBaseValues\");"," positiveBaseValues = lastCollection.get(\"positiveBaseValues\");"," if(!negativeBaseValues || !positiveBaseValues)"," {"," useOrigin = true;"," positiveBaseValues = [];"," negativeBaseValues = [];"," }"," }"," else"," {"," negativeBaseValues = [];"," positiveBaseValues = [];"," }"," this.set(\"negativeBaseValues\", negativeBaseValues);"," this.set(\"positiveBaseValues\", positiveBaseValues);"," for(i = 0; i < len; ++i)"," {"," top = ycoords[i];"," left = xcoords[i];"," if(!isNumber(top) || !isNumber(left))"," {"," if(useOrigin)"," {"," positiveBaseValues[i] = this._leftOrigin;"," negativeBaseValues[i] = this._leftOrigin;"," }"," this._markers.push(null);"," continue;"," }"," if(useOrigin)"," {"," w = Math.abs(left - this._leftOrigin);"," if(left > this._leftOrigin)"," {"," positiveBaseValues[i] = left;"," negativeBaseValues[i] = this._leftOrigin;"," left -= w;"," }"," else if(left < this._leftOrigin)"," { "," positiveBaseValues[i] = this._leftOrigin;"," negativeBaseValues[i] = left;"," }"," else"," {"," positiveBaseValues[i] = left;"," negativeBaseValues[i] = this._leftOrigin;"," }"," }"," else"," {"," if(left < this._leftOrigin)"," {"," left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);"," w = negativeBaseValues[i] - left;"," negativeBaseValues[i] = left;"," }"," else if(left >= this._leftOrigin)"," {"," left += (positiveBaseValues[i] - this._leftOrigin);"," w = left - positiveBaseValues[i];"," positiveBaseValues[i] = left;"," left -= w;"," }"," }"," if(!isNaN(w) && w > 0)"," {"," top -= h/2;"," if(groupMarkers)"," {"," dimensions.width[i] = w;"," dimensions.height[i] = h;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style.width = w;"," style.height = h;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }"," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },",""," /**"," * @protected"," *"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers[i])"," {"," var state = this._getState(type),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," styles = this.get(\"styles\").marker,"," h = styles.height,"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), "," fillColor,"," borderColor; "," markerStyles.y = (ycoords[i] - h/2);"," markerStyles.x = marker.get(\"x\");"," markerStyles.width = marker.get(\"width\");"," markerStyles.id = marker.get(\"id\");"," fillColor = markerStyles.fill.color; "," borderColor = markerStyles.border.color;"," if(Y_Lang.isArray(fillColor))"," {"," markerStyles.fill.color = fillColor[i % fillColor.length];"," }"," else"," {"," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," }"," if(Y_Lang.isArray(borderColor))"," {"," markerStyles.border.color = borderColor[i % borderColor.length];"," }"," else"," {"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," }"," marker.set(markerStyles);"," }"," },"," "," /**"," * @protected"," *"," * Returns default values for the `styles` attribute."," * "," * @method _getPlotDefaults"," * @return Object"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 24,"," height: 24,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedBar"," */"," type: {"," value: \"stackedBar\""," },",""," /**"," * Direction of the series"," *"," * @attribute direction"," * @type String"," * @default vertical"," */"," direction: {"," value: \"vertical\""," },",""," /**"," * @private"," *"," * @attribute negativeBaseValues"," * @type Array"," * @default null"," */"," negativeBaseValues: {"," value: null"," },",""," /**"," * @private"," *"," * @attribute positiveBaseValues"," * @type Array"," * @default null"," */"," positiveBaseValues: {"," value: null"," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * PieSeries visualizes data as a circular chart divided into wedges which represent data as a "," * percentage of a whole."," *"," * @module charts"," * @submodule charts-base"," * @class PieSeries"," * @constructor"," * @extends MarkerSeries"," */","Y.PieSeries = Y.Base.create(\"pieSeries\", Y.MarkerSeries, [], { "," /**"," * Image map used for interactivity when rendered with canvas."," *"," * @property _map"," * @type HTMLElement"," * @private"," */"," _map: null,",""," /**"," * Image used for image map when rendered with canvas."," *"," * @property _image"," * @type HTMLElement"," * @private"," */"," _image: null,",""," /**"," * Creates or updates the image map when rendered with canvas."," *"," * @method _setMap"," * @private"," */"," _setMap: function()"," {"," var id = \"pieHotSpotMapi_\" + Math.round(100000 * Math.random()),"," cb = this.get(\"graph\").get(\"contentBox\"),"," areaNode;"," if(this._image)"," {"," cb.removeChild(this._image);"," while(this._areaNodes && this._areaNodes.length > 0)"," {"," areaNode = this._areaNodes.shift();"," this._map.removeChild(areaNode);"," }"," cb.removeChild(this._map);"," }"," this._image = DOCUMENT.createElement(\"img\"); "," this._image.src = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==\";"," cb.appendChild(this._image);"," this._image.setAttribute(\"usemap\", \"#\" + id);"," this._image.style.zIndex = 3;"," this._image.style.opacity = 0;"," this._image.setAttribute(\"alt\", \"imagemap\");"," this._map = DOCUMENT.createElement(\"map\");"," this._map.style.zIndex = 5;"," cb.appendChild(this._map);"," this._map.setAttribute(\"name\", id);"," this._map.setAttribute(\"id\", id);"," this._areaNodes = [];"," },",""," /**"," * Storage for `categoryDisplayName` attribute."," *"," * @property _categoryDisplayName"," * @private"," */"," _categoryDisplayName: null,"," "," /**"," * Storage for `valueDisplayName` attribute."," *"," * @property _valueDisplayName"," * @private"," */"," _valueDisplayName: null,",""," /**"," * Adds event listeners."," *"," * @method addListeners"," * @private"," */"," addListeners: function()"," {"," var categoryAxis = this.get(\"categoryAxis\"),"," valueAxis = this.get(\"valueAxis\");"," if(categoryAxis)"," {"," categoryAxis.after(\"dataReady\", Y.bind(this._categoryDataChangeHandler, this));"," categoryAxis.after(\"dataUpdate\", Y.bind(this._categoryDataChangeHandler, this));"," }"," if(valueAxis)"," {"," valueAxis.after(\"dataReady\", Y.bind(this._valueDataChangeHandler, this));"," valueAxis.after(\"dataUpdate\", Y.bind(this._valueDataChangeHandler, this));"," }"," this.after(\"categoryAxisChange\", this.categoryAxisChangeHandler);"," this.after(\"valueAxisChange\", this.valueAxisChangeHandler);"," this.after(\"stylesChange\", this._updateHandler);"," },"," "," /**"," * Draws the series."," *"," * @method validate"," * @private"," */"," validate: function()"," {"," this.draw();"," this._renderered = true;"," },",""," /**"," * Event handler for the categoryAxisChange event."," *"," * @method _categoryAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _categoryAxisChangeHandler: function(e)"," {"," var categoryAxis = this.get(\"categoryAxis\");"," categoryAxis.after(\"dataReady\", Y.bind(this._categoryDataChangeHandler, this));"," categoryAxis.after(\"dataUpdate\", Y.bind(this._categoryDataChangeHandler, this));"," },"," "," /**"," * Event handler for the valueAxisChange event."," *"," * @method _valueAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _valueAxisChangeHandler: function(e)"," {"," var valueAxis = this.get(\"valueAxis\");"," valueAxis.after(\"dataReady\", Y.bind(this._valueDataChangeHandler, this));"," valueAxis.after(\"dataUpdate\", Y.bind(this._valueDataChangeHandler, this));"," },"," "," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"pieseries\","," "," /**"," * Event handler for categoryDataChange event."," *"," * @method _categoryDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _categoryDataChangeHandler: function(event)"," {"," if(this._rendered && this.get(\"categoryKey\") && this.get(\"valueKey\"))"," {"," this.draw();"," }"," },",""," /**"," * Event handler for valueDataChange event."," *"," * @method _valueDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _valueDataChangeHandler: function(event)"," {"," if(this._rendered && this.get(\"categoryKey\") && this.get(\"valueKey\"))"," {"," this.draw();"," }"," },"," "," /**"," * Draws the series. Overrides the base implementation."," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," var graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\");"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," { "," this._rendered = true;"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," this.drawSeries();"," this._drawing = false;"," if(this._callLater)"," {"," this.draw();"," }"," else"," {"," this.fire(\"drawingComplete\");"," }"," }"," },",""," /**"," * Draws the markers"," *"," * @method drawPlots"," * @protected"," */"," drawPlots: function()"," {"," var values = this.get(\"valueAxis\").getDataByKey(this.get(\"valueKey\")).concat(),"," catValues = this.get(\"categoryAxis\").getDataByKey(this.get(\"categoryKey\")).concat(),"," totalValue = 0,"," itemCount = values.length,"," styles = this.get(\"styles\").marker,"," fillColors = styles.fill.colors,"," fillAlphas = styles.fill.alphas || [\"1\"],"," borderColors = styles.border.colors,"," borderWeights = [styles.border.weight],"," borderAlphas = [styles.border.alpha],"," tbw = borderWeights.concat(),"," tbc = borderColors.concat(),"," tba = borderAlphas.concat(),"," tfc,"," tfa,"," padding = styles.padding,"," graph = this.get(\"graph\"),"," minDimension = Math.min(graph.get(\"width\"), graph.get(\"height\")),"," w = minDimension - (padding.left + padding.right),"," h = minDimension - (padding.top + padding.bottom),"," startAngle = -90,"," halfWidth = w / 2,"," halfHeight = h / 2,"," radius = Math.min(halfWidth, halfHeight),"," i = 0,"," value,"," angle = 0,"," lc,"," la,"," lw,"," wedgeStyle,"," marker,"," graphOrder = this.get(\"graphOrder\"),"," isCanvas = Y.Graphic.NAME == \"canvasGraphic\";"," for(; i < itemCount; ++i)"," {"," value = parseFloat(values[i]);"," "," values.push(value);"," if(!isNaN(value))"," {"," totalValue += value;"," }"," }"," "," tfc = fillColors ? fillColors.concat() : null;"," tfa = fillAlphas ? fillAlphas.concat() : null;"," this._createMarkerCache();"," if(isCanvas)"," {"," this._setMap();"," this._image.width = w;"," this._image.height = h;"," }"," for(i = 0; i < itemCount; i++)"," {"," value = values[i];"," if(totalValue === 0)"," {"," angle = 360 / values.length;"," }"," else"," {"," angle = 360 * (value / totalValue);"," }"," if(tfc && tfc.length < 1)"," {"," tfc = fillColors.concat();"," }"," if(tfa && tfa.length < 1)"," {"," tfa = fillAlphas.concat();"," }"," if(tbw && tbw.length < 1)"," {"," tbw = borderWeights.concat();"," }"," if(tbw && tbc.length < 1)"," {"," tbc = borderColors.concat();"," }"," if(tba && tba.length < 1)"," {"," tba = borderAlphas.concat();"," }"," lw = tbw ? tbw.shift() : null;"," lc = tbc ? tbc.shift() : null;"," la = tba ? tba.shift() : null;"," startAngle += angle;"," wedgeStyle = {"," border: {"," color:lc,"," weight:lw,"," alpha:la"," },"," fill: {"," color:tfc ? tfc.shift() : this._getDefaultColor(i, \"slice\"),"," alpha:tfa ? tfa.shift() : null"," },"," type: \"pieslice\","," arc: angle,"," radius: radius,"," startAngle: startAngle,"," cx: halfWidth,"," cy: halfHeight,"," width: w,"," height: h"," };"," marker = this.getMarker(wedgeStyle, graphOrder, i);"," if(isCanvas)"," {"," this._addHotspot(wedgeStyle, graphOrder, i);"," }"," }"," this._clearMarkerCache();"," },",""," /**"," * Adds an interactive map when rendering in canvas."," *"," * @method _addHotspot"," * @param {Object} cfg Object containing data used to draw the hotspot"," * @param {Number} seriesIndex Index of series in the `seriesCollection`."," * @param {Number} index Index of the marker using the hotspot."," * @private"," */"," _addHotspot: function(cfg, seriesIndex, index)"," {"," var areaNode = DOCUMENT.createElement(\"area\"),"," i = 1,"," x = cfg.cx,"," y = cfg.cy, "," arc = cfg.arc,"," startAngle = cfg.startAngle - arc, "," endAngle = cfg.startAngle,"," radius = cfg.radius, "," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,"," ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,"," bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,"," by = y + Math.sin(endAngle / 180 * Math.PI) * radius,"," numPoints = Math.floor(arc/10) - 1,"," divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,"," angleCoord = Math.atan((ay - y)/(ax - x)),"," pts = x + \", \" + y + \", \" + ax + \", \" + ay,"," cosAng,"," sinAng,"," multDivAng;"," for(i = 1; i <= numPoints; ++i)"," {"," multDivAng = divAngle * i;"," cosAng = Math.cos(angleCoord + multDivAng);"," sinAng = Math.sin(angleCoord + multDivAng);"," if(startAngle <= 90)"," {"," pts += \", \" + (x + (radius * Math.cos(angleCoord + (divAngle * i))));"," pts += \", \" + (y + (radius * Math.sin(angleCoord + (divAngle * i))));"," }"," else"," {"," pts += \", \" + (x - (radius * Math.cos(angleCoord + (divAngle * i))));"," pts += \", \" + (y - (radius * Math.sin(angleCoord + (divAngle * i))));"," }"," }"," pts += \", \" + bx + \", \" + by;"," pts += \", \" + x + \", \" + y;"," this._map.appendChild(areaNode);"," areaNode.setAttribute(\"class\", SERIES_MARKER);"," areaNode.setAttribute(\"id\", \"hotSpot_\" + seriesIndex + \"_\" + index);"," areaNode.setAttribute(\"shape\", \"polygon\");"," areaNode.setAttribute(\"coords\", pts);"," this._areaNodes.push(areaNode);",""," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers[i])"," {"," var state = this._getState(type),"," markerStyles,"," indexStyles,"," marker = this._markers[i],"," styles = this.get(\"styles\").marker; "," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," indexStyles = this._mergeStyles(markerStyles, {});"," indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];"," indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];"," marker.set(indexStyles);"," }"," },"," "," /**"," * Creates a shape to be used as a marker."," *"," * @method _createMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @private"," */"," _createMarker: function(styles, order, index)"," {"," var graphic = this.get(\"graphic\"),"," marker,"," cfg = Y.clone(styles);"," graphic.set(\"autoDraw\", false);"," marker = graphic.addShape(cfg); "," marker.addClass(SERIES_MARKER);"," return marker;"," },"," "," /**"," * Creates a cache of markers for reuse."," *"," * @method _createMarkerCache"," * @private"," */"," _clearMarkerCache: function()"," {"," var len = this._markerCache.length,"," i = 0,"," marker;"," for(; i < len; ++i)"," {"," marker = this._markerCache[i];"," if(marker)"," {"," marker.destroy();"," }"," }"," this._markerCache = [];"," },",""," /**"," * Gets the default style values for the markers."," *"," * @method _getPlotDefaults"," * @return Object"," * @private"," */"," _getPlotDefaults: function()"," {"," var defs = {"," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," },"," fill:{"," alphas:[\"1\"]"," },"," border: {"," weight: 0,"," alpha: 1"," }"," };"," defs.fill.colors = this._defaultSliceColors;"," defs.border.colors = this._defaultBorderColors;"," return defs;"," },",""," /**"," * Collection of default colors used for lines in a series when not specified by user."," *"," * @property _defaultLineColors"," * @type Array"," * @protected"," */"," _defaultLineColors:[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"],",""," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors:[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"],"," "," /**"," * Collection of default colors used for marker borders in a series when not specified by user."," *"," * @property _defaultBorderColors"," * @type Array"," * @protected"," */"," _defaultBorderColors:[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"],"," "," /**"," * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user."," *"," * @property _defaultSliceColors"," * @type Array"," * @protected"," */"," _defaultSliceColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],",""," /**"," * Colors used if style colors are not specified"," *"," * @method _getDefaultColor"," * @param {Number} index Index indicating the series order."," * @param {String} type Indicates which type of object needs the color."," * @return String"," * @protected"," */"," _getDefaultColor: function(index, type)"," {"," var colors = {"," line: this._defaultLineColors,"," fill: this._defaultFillColors,"," border: this._defaultBorderColors,"," slice: this._defaultSliceColors"," },"," col = colors[type],"," l = col.length;"," index = index || 0;"," if(index >= l)"," {"," index = index % l;"," }"," type = type || \"fill\";"," return colors[type][index];"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default pie"," */"," type: { "," value: \"pie\""," },"," "," /**"," * Order of this instance of this `type`."," *"," * @attribute order"," * @type Number"," */"," order: {},",""," /**"," * Reference to the `Graph` in which the series is drawn into."," *"," * @attribute graph"," * @type Graph"," */"," graph: {},"," "," /**"," * Reference to the `Axis` instance used for assigning "," * category values to the graph."," *"," * @attribute categoryAxis"," * @type Axis"," */"," categoryAxis: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"categoryAxis\");"," }"," },"," "," /**"," * Reference to the `Axis` instance used for assigning "," * series values to the graph."," *"," * @attribute categoryAxis"," * @type Axis"," */"," valueAxis: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"valueAxis\");"," }"," },",""," /**"," * Indicates which array to from the hash of value arrays in "," * the category `Axis` instance."," *"," * @attribute categoryKey"," * @type String"," */"," categoryKey: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"categoryKey\");"," }"," },"," /**"," * Indicates which array to from the hash of value arrays in "," * the value `Axis` instance."," *"," * @attribute valueKey"," * @type String"," */"," valueKey: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"valueKey\");"," }"," },",""," /**"," * Name used for for displaying category data"," *"," * @attribute categoryDisplayName"," * @type String"," */"," categoryDisplayName: {"," setter: function(val)"," {"," this._categoryDisplayName = val;"," return val;"," },",""," getter: function()"," {"," return this._categoryDisplayName || this.get(\"categoryKey\");"," }"," },",""," /**"," * Name used for for displaying value data"," *"," * @attribute valueDisplayName"," * @type String"," */"," valueDisplayName: {"," setter: function(val)"," {"," this._valueDisplayName = val;"," return val;"," },",""," getter: function()"," {"," return this._valueDisplayName || this.get(\"valueKey\");"," }"," },"," "," /**"," * @attribute slices"," * @type Array"," * @private"," */"," slices: null"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the "," * array below:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the"," * array below:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * Gridlines draws gridlines on a Graph."," *"," * @module charts"," * @submodule charts-base"," * @class Gridlines"," * @constructor"," * @extends Base"," * @uses Renderer"," */","Y.Gridlines = Y.Base.create(\"gridlines\", Y.Base, [Y.Renderer], {"," /**"," * Reference to the `Path` element used for drawing Gridlines."," *"," * @property _path"," * @type Path"," * @private"," */"," _path: null,",""," /**"," * Removes the Gridlines."," *"," * @method remove"," * @private"," */"," remove: function()"," {"," var path = this._path;"," if(path)"," {"," path.destroy();"," }"," },",""," /**"," * Draws the gridlines"," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," if(this.get(\"axis\") && this.get(\"graph\"))"," {"," this._drawGridlines();"," }"," },",""," /**"," * Algorithm for drawing gridlines"," *"," * @method _drawGridlines"," * @private"," */"," _drawGridlines: function()"," {"," var path,"," axis = this.get(\"axis\"),"," axisPosition = axis.get(\"position\"),"," points,"," i = 0,"," l,"," direction = this.get(\"direction\"),"," graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\"),"," line = this.get(\"styles\").line,"," color = line.color,"," weight = line.weight,"," alpha = line.alpha,"," lineFunction = direction == \"vertical\" ? this._verticalLine : this._horizontalLine;"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," {"," if(axisPosition != \"none\" && axis && axis.get(\"tickPoints\"))"," {"," points = axis.get(\"tickPoints\");"," l = points.length;"," }"," else"," {"," points = [];"," l = axis.get(\"styles\").majorUnit.count;"," for(; i < l; ++i)"," {"," points[i] = {"," x: w * (i/(l-1)),"," y: h * (i/(l-1))"," };"," }"," i = 0;"," }"," path = graph.get(\"gridlines\");"," path.set(\"width\", w);"," path.set(\"height\", h);"," path.set(\"stroke\", {"," weight: weight,"," color: color,"," opacity: alpha"," });"," for(; i < l; ++i)"," {"," lineFunction(path, points[i], w, h);"," }"," path.end();"," }"," },",""," /**"," * Algorithm for horizontal lines."," *"," * @method _horizontalLine"," * @param {Path} path Reference to path element"," * @param {Object} pt Coordinates corresponding to a major unit of an axis."," * @param {Number} w Width of the Graph"," * @param {Number} h Height of the Graph"," * @private"," */"," _horizontalLine: function(path, pt, w, h)"," {"," path.moveTo(0, pt.y);"," path.lineTo(w, pt.y);"," },",""," /**"," * Algorithm for vertical lines."," *"," * @method _verticalLine"," * @param {Path} path Reference to path element"," * @param {Object} pt Coordinates corresponding to a major unit of an axis."," * @param {Number} w Width of the Graph"," * @param {Number} h Height of the Graph"," * @private"," */"," _verticalLine: function(path, pt, w, h)"," {"," path.moveTo(pt.x, 0);"," path.lineTo(pt.x, h);"," },"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var defs = {"," line: {"," color:\"#f0efe9\","," weight: 1,"," alpha: 1"," }"," };"," return defs;"," }","","},","{"," ATTRS: {"," /**"," * Indicates the direction of the gridline."," *"," * @attribute direction"," * @type String"," */"," direction: {},"," "," /**"," * Indicate the `Axis` in which to bind"," * the gridlines."," *"," * @attribute axis"," * @type Axis"," */"," axis: {},"," "," /**"," * Indicates the `Graph` in which the gridlines "," * are drawn."," *"," * @attribute graph"," * @type Graph"," */"," graph: {}"," }","});","/**"," * Graph manages and contains series instances for a `CartesianChart`"," * instance."," *"," * @module charts"," * @submodule charts-base"," * @class Graph"," * @constructor"," * @extends Widget"," * @uses Renderer"," */","Y.Graph = Y.Base.create(\"graph\", Y.Widget, [Y.Renderer], {"," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," var bb = this.get(\"boundingBox\");"," bb.setStyle(\"position\", \"absolute\");"," this.after(\"widthChange\", this._sizeChangeHandler);"," this.after(\"heightChange\", this._sizeChangeHandler);"," this.after(\"stylesChange\", this._updateStyles);"," this.after(\"groupMarkersChange\", this._drawSeries);"," },",""," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var background,"," cb,"," bg,"," sc = this.get(\"seriesCollection\"),"," series,"," i = 0,"," len = sc ? sc.length : 0,"," hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\");"," if(this.get(\"showBackground\"))"," {"," background = this.get(\"background\");"," cb = this.get(\"contentBox\");"," bg = this.get(\"styles\").background;"," bg.stroke = bg.border;"," bg.stroke.opacity = bg.stroke.alpha;"," bg.fill.opacity = bg.fill.alpha;"," bg.width = this.get(\"width\");"," bg.height = this.get(\"height\");"," bg.type = bg.shape;"," background.set(bg);"," }"," for(; i < len; ++i)"," {"," series = sc[i];"," if(series instanceof Y.CartesianSeries)"," {"," series.render();"," }"," }"," if(hgl && hgl instanceof Y.Gridlines)"," {"," hgl.draw();"," }"," if(vgl && vgl instanceof Y.Gridlines)"," {"," vgl.draw();"," }"," },"," "," /**"," * Object of arrays containing series mapped to a series type."," *"," * @property seriesTypes"," * @type Object"," * @private"," */"," seriesTypes: null,",""," /**"," * Returns a series instance based on an index."," * "," * @method getSeriesByIndex"," * @param {Number} val index of the series"," * @return CartesianSeries"," */"," getSeriesByIndex: function(val)"," {"," var col = this.get(\"seriesCollection\"),"," series;"," if(col && col.length > val)"," {"," series = col[val];"," }"," return series;"," },",""," /**"," * Returns a series instance based on a key value."," * "," * @method getSeriesByKey"," * @param {String} val key value of the series"," * @return CartesianSeries"," */"," getSeriesByKey: function(val)"," {"," var obj = this._seriesDictionary,"," series;"," if(obj && obj.hasOwnProperty(val))"," {"," series = obj[val];"," }"," return series;"," },",""," /**"," * Adds dispatcher to a `_dispatcher` used to"," * to ensure all series have redrawn before for firing event."," *"," * @method addDispatcher"," * @param {CartesianSeries} val series instance to add"," * @protected"," */"," addDispatcher: function(val)"," {"," if(!this._dispatchers)"," {"," this._dispatchers = [];"," }"," this._dispatchers.push(val);"," },",""," /**"," * Collection of series to be displayed in the graph."," *"," * @property _seriesCollection"," * @type Array"," * @private "," */"," _seriesCollection: null,"," "," /**"," * Object containing key value pairs of `CartesianSeries` instances."," *"," * @property _seriesDictionary"," * @type Object"," * @private"," */"," _seriesDictionary: null,",""," /**"," * Parses series instances to be displayed in the graph."," *"," * @method _parseSeriesCollection"," * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values."," * @private"," */"," _parseSeriesCollection: function(val)"," {"," if(!val)"," {"," return;"," } "," var len = val.length,"," i = 0,"," series,"," seriesKey;"," this._seriesCollection = [];"," this._seriesDictionary = {};"," this.seriesTypes = [];"," for(; i < len; ++i)"," { "," series = val[i];"," if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))"," {"," this._createSeries(series);"," continue;"," }"," this._addSeries(series);"," }"," len = this._seriesCollection.length;"," for(i = 0; i < len; ++i)"," {"," series = this.get(\"seriesCollection\")[i];"," seriesKey = series.get(\"direction\") == \"horizontal\" ? \"yKey\" : \"xKey\";"," this._seriesDictionary[series.get(seriesKey)] = series;"," }"," },",""," /**"," * Adds a series to the graph."," *"," * @method _addSeries"," * @param {CartesianSeries} series Series to add to the graph."," * @private"," */"," _addSeries: function(series)"," {"," var type = series.get(\"type\"),"," seriesCollection = this.get(\"seriesCollection\"),"," graphSeriesLength = seriesCollection.length,"," seriesTypes = this.seriesTypes,"," typeSeriesCollection; "," if(!series.get(\"graph\")) "," {"," series.set(\"graph\", this);"," }"," seriesCollection.push(series);"," if(!seriesTypes.hasOwnProperty(type))"," {"," this.seriesTypes[type] = [];"," }"," typeSeriesCollection = this.seriesTypes[type];"," series.set(\"graphOrder\", graphSeriesLength);"," series.set(\"order\", typeSeriesCollection.length);"," typeSeriesCollection.push(series);"," this.addDispatcher(series);"," series.after(\"drawingComplete\", Y.bind(this._drawingCompleteHandler, this));"," this.fire(\"seriesAdded\", series);"," },",""," /**"," * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of"," * series to be used. "," *"," * @method createSeries"," * @param {Object} seriesData Series attribute key value pairs."," * @private"," */"," _createSeries: function(seriesData)"," {"," var type = seriesData.type,"," seriesCollection = this.get(\"seriesCollection\"),"," seriesTypes = this.seriesTypes,"," typeSeriesCollection,"," seriesType,"," series;"," seriesData.graph = this;"," if(!seriesTypes.hasOwnProperty(type))"," {"," seriesTypes[type] = [];"," }"," typeSeriesCollection = seriesTypes[type];"," seriesData.graph = this;"," seriesData.order = typeSeriesCollection.length;"," seriesData.graphOrder = seriesCollection.length;"," seriesType = this._getSeries(seriesData.type);"," series = new seriesType(seriesData);"," this.addDispatcher(series);"," series.after(\"drawingComplete\", Y.bind(this._drawingCompleteHandler, this));"," typeSeriesCollection.push(series);"," seriesCollection.push(series);"," if(this.get(\"rendered\"))"," {"," series.render();"," }"," },"," "," /**"," * String reference for pre-defined `Series` classes."," *"," * @property _seriesMap"," * @type Object"," * @private"," */"," _seriesMap: {"," line : Y.LineSeries,"," column : Y.ColumnSeries,"," bar : Y.BarSeries,"," area : Y.AreaSeries,"," candlestick : Y.CandlestickSeries,"," ohlc : Y.OHLCSeries,"," stackedarea : Y.StackedAreaSeries,"," stackedline : Y.StackedLineSeries,"," stackedcolumn : Y.StackedColumnSeries,"," stackedbar : Y.StackedBarSeries,"," markerseries : Y.MarkerSeries,"," spline : Y.SplineSeries,"," areaspline : Y.AreaSplineSeries,"," stackedspline : Y.StackedSplineSeries,"," stackedareaspline : Y.StackedAreaSplineSeries,"," stackedmarkerseries : Y.StackedMarkerSeries,"," pie : Y.PieSeries,"," combo : Y.ComboSeries,"," stackedcombo : Y.StackedComboSeries,"," combospline : Y.ComboSplineSeries,"," stackedcombospline : Y.StackedComboSplineSeries"," },",""," /**"," * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options"," * are available:"," *"," * <table>"," * <tr><th>Key Value</th><th>Class</th></tr>"," * <tr><td>line</td><td>Y.LineSeries</td></tr> "," * <tr><td>column</td><td>Y.ColumnSeries</td></tr> "," * <tr><td>bar</td><td>Y.BarSeries</td></tr> "," * <tr><td>area</td><td>Y.AreaSeries</td></tr> "," * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> "," * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> "," * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> "," * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> "," * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> "," * <tr><td>spline</td><td>Y.SplineSeries</td></tr> "," * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> "," * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>"," * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>"," * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>"," * <tr><td>pie</td><td>Y.PieSeries</td></tr>"," * <tr><td>combo</td><td>Y.ComboSeries</td></tr>"," * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>"," * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>"," * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>"," * </table>"," * "," * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`."," *"," * @method _getSeries"," * @param {String | Object} type Series type."," * @return CartesianSeries"," * @private"," */"," _getSeries: function(type)"," {"," var seriesClass;"," if(Y_Lang.isString(type))"," {"," seriesClass = this._seriesMap[type];"," }"," else "," {"," seriesClass = type;"," }"," return seriesClass;"," },",""," /**"," * Event handler for marker events."," *"," * @method _markerEventHandler"," * @param {Object} e Event object."," * @private"," */"," _markerEventHandler: function(e)"," {"," var type = e.type,"," markerNode = e.currentTarget,"," strArr = markerNode.getAttribute(\"id\").split(\"_\"),"," series = this.getSeriesByIndex(strArr[1]),"," index = strArr[2];"," series.updateMarkerState(type, index);"," },",""," /**"," * Collection of `CartesianSeries` instances to be redrawn."," *"," * @property _dispatchers"," * @type Array"," * @private"," */"," _dispatchers: null,",""," /**"," * Updates the `Graph` styles."," *"," * @method _updateStyles"," * @private"," */"," _updateStyles: function()"," {"," var styles = this.get(\"styles\").background,"," border = styles.border;"," border.opacity = border.alpha;"," styles.stroke = border;"," styles.fill.opacity = styles.fill.alpha;"," this.get(\"background\").set(styles);"," this._sizeChangeHandler();"," },",""," /**"," * Event handler for size changes."," *"," * @method _sizeChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _sizeChangeHandler: function(e)"," {"," var hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," bg = this.get(\"styles\").background,"," weight,"," background;"," if(bg && bg.border)"," {"," weight = bg.border.weight || 0;"," }"," if(this.get(\"showBackground\"))"," {"," background = this.get(\"background\");"," if(w && h)"," {"," background.set(\"width\", w);"," background.set(\"height\", h);"," }"," }"," if(this._gridlines)"," {"," this._gridlines.clear();"," }"," if(hgl && hgl instanceof Y.Gridlines)"," {"," hgl.draw();"," }"," if(vgl && vgl instanceof Y.Gridlines)"," {"," vgl.draw();"," }"," this._drawSeries();"," },",""," /**"," * Draws each series."," *"," * @method _drawSeries"," * @private"," */"," _drawSeries: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," var sc,"," i,"," len,"," graphic = this.get(\"graphic\");"," graphic.set(\"autoDraw\", false);"," this._callLater = false;"," this._drawing = true;"," sc = this.get(\"seriesCollection\");"," i = 0;"," len = sc ? sc.length : 0;"," for(; i < len; ++i)"," {"," sc[i].draw();"," if((!sc[i].get(\"xcoords\") || !sc[i].get(\"ycoords\")) && !sc[i] instanceof Y.PieSeries)"," {"," this._callLater = true;"," break;"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawSeries();"," }"," }, ",""," /**"," * Event handler for series drawingComplete event."," *"," * @method _drawingCompleteHandler"," * @param {Object} e Event object."," * @private"," */"," _drawingCompleteHandler: function(e)"," {"," var series = e.currentTarget,"," graphic,"," index = Y.Array.indexOf(this._dispatchers, series);"," if(index > -1)"," {"," this._dispatchers.splice(index, 1);"," }"," if(this._dispatchers.length < 1)"," {"," graphic = this.get(\"graphic\");"," if(!graphic.get(\"autoDraw\"))"," {"," graphic._redraw();"," }"," this.fire(\"chartRendered\");"," }"," },",""," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var defs = {"," background: {"," shape: \"rect\","," fill:{"," color:\"#faf9f2\""," },"," border: {"," color:\"#dad8c9\","," weight: 1"," }"," }"," };"," return defs;"," },",""," /**"," * Destructor implementation Graph class. Removes all Graphic instances from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," if(this._graphic)"," {"," this._graphic.destroy();"," this._graphic = null;"," }"," if(this._background)"," {"," this._background.get(\"graphic\").destroy();"," this._background = null;"," }"," if(this._gridlines)"," {"," this._gridlines.get(\"graphic\").destroy();"," this._gridlines = null;"," }"," }","}, {"," ATTRS: {"," /**"," * The x-coordinate for the graph."," *"," * @attribute x"," * @type Number"," * @protected"," */"," x: {"," setter: function(val)"," {"," this.get(\"boundingBox\").setStyle(\"left\", val + \"px\");"," return val;"," }"," },",""," /**"," * The y-coordinate for the graph."," *"," * @attribute y"," * @type Number"," * @protected"," */"," y: {"," setter: function(val)"," {"," this.get(\"boundingBox\").setStyle(\"top\", val + \"px\");"," return val;"," }"," },",""," /**"," * Reference to the chart instance using the graph."," *"," * @attribute chart"," * @type ChartBase"," * @readOnly"," */"," chart: {},",""," /**"," * Collection of series. When setting the `seriesCollection` the array can contain a combination of either"," * `CartesianSeries` instances or object literals with properties that will define a series."," *"," * @attribute seriesCollection"," * @type CartesianSeries"," */"," seriesCollection: {"," getter: function()"," {"," return this._seriesCollection;"," },",""," setter: function(val)"," {"," this._parseSeriesCollection(val);"," return this._seriesCollection;"," }"," },"," "," /**"," * Indicates whether the `Graph` has a background."," *"," * @attribute showBackground"," * @type Boolean"," * @default true"," */"," showBackground: {"," value: true"," },",""," /**"," * Read-only hash lookup for all series on in the `Graph`."," *"," * @attribute seriesDictionary"," * @type Object"," * @readOnly"," */"," seriesDictionary: {"," readOnly: true,",""," getter: function()"," {"," return this._seriesDictionary;"," }"," },",""," /**"," * Reference to the horizontal `Gridlines` instance."," *"," * @attribute horizontalGridlines"," * @type Gridlines"," * @default null"," */"," horizontalGridlines: {"," value: null,",""," setter: function(val)"," {"," var gl = this.get(\"horizontalGridlines\");"," if(gl && gl instanceof Y.Gridlines)"," {"," gl.remove();"," }"," if(val instanceof Y.Gridlines)"," {"," gl = val;"," val.set(\"graph\", this);"," return val;"," }"," else if(val && val.axis)"," {"," gl = new Y.Gridlines({direction:\"horizontal\", axis:val.axis, graph:this, styles:val.styles});"," return gl;"," }"," }"," },"," "," /**"," * Reference to the vertical `Gridlines` instance."," *"," * @attribute verticalGridlines"," * @type Gridlines"," * @default null"," */"," verticalGridlines: {"," value: null,",""," setter: function(val)"," {"," var gl = this.get(\"verticalGridlines\");"," if(gl && gl instanceof Y.Gridlines)"," {"," gl.remove();"," }"," if(val instanceof Y.Gridlines)"," {"," gl = val;"," val.set(\"graph\", this);"," return val;"," }"," else if(val && val.axis)"," {"," gl = new Y.Gridlines({direction:\"vertical\", axis:val.axis, graph:this, styles:val.styles});"," return gl;"," }"," }"," },",""," /**"," * Reference to graphic instance used for the background."," *"," * @attribute background"," * @type Graphic"," * @readOnly"," */"," background: {"," getter: function()"," {"," if(!this._background)"," {"," this._backgroundGraphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._backgroundGraphic.get(\"node\").style.zIndex = 0; "," this._background = this._backgroundGraphic.addShape({type: \"rect\"});"," }"," return this._background;"," }"," },",""," /**"," * Reference to graphic instance used for gridlines."," *"," * @attribute gridlines"," * @type Graphic"," * @readOnly"," */"," gridlines: {"," readOnly: true,",""," getter: function()"," {"," if(!this._gridlines)"," {"," this._gridlinesGraphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._gridlinesGraphic.get(\"node\").style.zIndex = 1; "," this._gridlines = this._gridlinesGraphic.addShape({type: \"path\"});"," }"," return this._gridlines;"," }"," },"," "," /**"," * Reference to graphic instance used for series."," *"," * @attribute graphic"," * @type Graphic"," * @readOnly"," */"," graphic: {"," readOnly: true,",""," getter: function() "," {"," if(!this._graphic)"," {"," this._graphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._graphic.get(\"node\").style.zIndex = 2; "," this._graphic.set(\"autoDraw\", false);"," }"," return this._graphic;"," }"," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," value: false"," }",""," /**"," * Style properties used for drawing a background. Below are the default values:"," * <dl>"," * <dt>background</dt><dd>An object containing the following values:"," * <dl>"," * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The ChartBase class is an abstract class used to create charts."," *"," * @module charts"," * @submodule charts-base"," * @class ChartBase"," * @constructor"," */","function ChartBase() {}","","ChartBase.ATTRS = {"," /**"," * Data used to generate the chart."," * "," * @attribute dataProvider"," * @type Array"," */"," dataProvider: {"," lazyAdd: false,",""," valueFn: function()"," {"," var defDataProvider = [];"," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = this._buildSeriesKeys(defDataProvider);"," }"," return defDataProvider;"," },",""," setter: function(val)"," {"," var dataProvider = this._setDataValues(val);"," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = this._buildSeriesKeys(dataProvider);"," }"," return dataProvider;"," }"," },",""," /**"," * A collection of keys that map to the series axes. If no keys are set,"," * they will be generated automatically depending on the data structure passed into "," * the chart."," *"," * @attribute seriesKeys"," * @type Array"," */"," seriesKeys: {"," getter: function()"," {"," return this._seriesKeys;"," },",""," setter: function(val)"," {"," this._seriesKeysExplicitlySet = true;"," this._seriesKeys = val;"," return val;"," }"," },",""," /**"," * Sets the `aria-label` for the chart."," *"," * @attribute ariaLabel"," * @type String"," */"," ariaLabel: {"," value: \"Chart Application\",",""," setter: function(val)"," {"," var cb = this.get(\"contentBox\");"," if(cb)"," {"," cb.setAttribute(\"aria-label\", val);"," }"," return val;"," }"," },"," "," /**"," * Sets the aria description for the chart."," *"," * @attribute ariaDescription"," * @type String"," */"," ariaDescription: {"," value: \"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.\",",""," setter: function(val)"," {"," if(this._description)"," {"," this._description.setContent(\"\");"," this._description.appendChild(DOCUMENT.createTextNode(val));"," }"," return val;"," }"," },"," "," /**"," * Reference to the default tooltip available for the chart."," * <p>Contains the following properties:</p>"," * <dl>"," * <dt>node</dt><dd>Reference to the actual dom node</dd>"," * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>"," * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>"," * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>"," * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>"," * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>"," * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>"," * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains "," * the following arguments:"," * <dl>"," * <dt>categoryItem</dt><dd>An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category.</dd>"," * </dl>"," * </dd>"," * <dt>valueItem</dt><dd>An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * </dd>"," * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>"," * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>"," * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>"," * </dl>"," * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you"," * will also need to override the tooltip's `setTextFunction` method to accept an html string."," * </dd>"," * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text"," * <dl>"," * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart."," * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:"," * <dl>"," * <dt>axis</dt><dd>The value axis of the series.</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * </dl> "," * </dd>"," * <dt>index</dt><dd>The index of the item within its series.</dd>"," * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>"," * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>"," * </dl>"," * </dd>"," * </dl>"," * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you"," * will also need to override the tooltip's `setTextFunction` method to accept an html string."," * </dd>"," * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node."," * has the following signature:"," * <dl>"," * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>"," * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a"," * string.</dd>"," * </dl>"," * </dd>"," * </dl>"," * @attribute tooltip"," * @type Object"," */ "," tooltip: {"," valueFn: \"_getTooltip\",",""," setter: function(val)"," {"," return this._updateTooltip(val);"," }"," },",""," /** "," * The key value used for the chart's category axis. "," *"," * @attribute categoryKey"," * @type String"," * @default category"," */"," categoryKey: {"," value: \"category\""," },"," "," /**"," * Indicates the type of axis to use for the category axis."," *"," * <dl>"," * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>"," * <dt>time</dt><dd>Specifies a `TimeAxis</dd>"," * </dl>"," *"," * @attribute categoryType"," * @type String"," * @default category"," */"," categoryType:{"," value:\"category\""," },",""," /**"," * Indicates the the type of interactions that will fire events."," *"," * <dl>"," * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>"," * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>"," * <dt>none</dt><dd>No events will be broadcasted.</dd>"," * </dl>"," *"," * @attribute interactionType"," * @type String"," * @default marker"," */"," interactionType: {"," value: \"marker\""," },",""," /**"," * Reference to all the axes in the chart."," *"," * @attribute axesCollection"," * @type Array"," */"," axesCollection: {},",""," /**"," * Reference to graph instance."," * "," * @attribute graph"," * @type Graph "," */"," graph: {"," valueFn: \"_getGraph\""," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," value: false"," }","};","","ChartBase.prototype = {"," /**"," * Handles groupMarkers change event."," *"," * @method _groupMarkersChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _groupMarkersChangeHandler: function(e)"," {"," var graph = this.get(\"graph\"),"," useGroupMarkers = e.newVal;"," if(graph)"," {"," graph.set(\"groupMarkers\", useGroupMarkers);"," }"," },",""," /**"," * Handler for itemRendered event."," *"," * @method _itemRendered"," * @param {Object} e Event object."," * @private"," */"," _itemRendered: function(e)"," {"," this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);"," if(this._itemRenderQueue.length < 1)"," {"," this._redraw();"," }"," },",""," /**"," * Default value function for the `Graph` attribute."," *"," * @method _getGraph"," * @return Graph"," * @private"," */"," _getGraph: function()"," {"," var graph = new Y.Graph({"," chart:this,"," groupMarkers: this.get(\"groupMarkers\") "," });"," graph.after(\"chartRendered\", Y.bind(function(e) {"," this.fire(\"chartRendered\");"," }, this));"," return graph; "," },",""," /**"," * Returns a series instance by index or key value."," *"," * @method getSeries"," * @param val"," * @return CartesianSeries"," */"," getSeries: function(val)"," {"," var series = null, "," graph = this.get(\"graph\");"," if(graph)"," {"," if(Y_Lang.isNumber(val))"," {"," series = graph.getSeriesByIndex(val);"," }"," else"," {"," series = graph.getSeriesByKey(val);"," }"," }"," return series;"," },",""," /**"," * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,"," * the key will be the same as the key used in the `axes` object. For default axes, the key for"," * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default "," * key is `values`."," *"," * @method getAxisByKey"," * @param {String} val Key reference used to look up the axis."," * @return Axis"," */"," getAxisByKey: function(val)"," {"," var axis,"," axes = this.get(\"axes\");"," if(axes && axes.hasOwnProperty(val))"," {"," axis = axes[val];"," }"," return axis;"," },",""," /**"," * Returns the category axis for the chart."," *"," * @method getCategoryAxis"," * @return Axis"," */"," getCategoryAxis: function()"," {"," var axis,"," key = this.get(\"categoryKey\"),"," axes = this.get(\"axes\");"," if(axes.hasOwnProperty(key))"," {"," axis = axes[key];"," }"," return axis;"," },",""," /**"," * Default direction of the chart."," *"," * @property _direction"," * @type String"," * @default horizontal"," * @private"," */"," _direction: \"horizontal\","," "," /**"," * Storage for the `dataProvider` attribute."," *"," * @property _dataProvider"," * @type Array"," * @private"," */"," _dataProvider: null,",""," /**"," * Setter method for `dataProvider` attribute."," *"," * @method _setDataValues"," * @param {Array} val Array to be set as `dataProvider`."," * @return Array"," * @private"," */"," _setDataValues: function(val)"," {"," if(Y_Lang.isArray(val[0]))"," {"," var hash, "," dp = [], "," cats = val[0], "," i = 0, "," l = cats.length, "," n, "," sl = val.length;"," for(; i < l; ++i)"," {"," hash = {category:cats[i]};"," for(n = 1; n < sl; ++n)"," {"," hash[\"series\" + n] = val[n][i];"," }"," dp[i] = hash; "," }"," return dp;"," }"," return val;"," },",""," /**"," * Storage for `seriesCollection` attribute."," *"," * @property _seriesCollection"," * @type Array"," * @private "," */"," _seriesCollection: null,",""," /**"," * Setter method for `seriesCollection` attribute."," *"," * @property _setSeriesCollection"," * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs."," * @private"," */"," _setSeriesCollection: function(val)"," {"," this._seriesCollection = val;"," },"," /**"," * Helper method that returns the axis class that a key references."," *"," * @method _getAxisClass"," * @param {String} t The type of axis."," * @return Axis"," * @private"," */"," _getAxisClass: function(t)"," {"," return this._axisClass[t];"," },"," "," /**"," * Key value pairs of axis types. "," *"," * @property _axisClass"," * @type Object"," * @private"," */"," _axisClass: {"," stacked: Y.StackedAxis,"," numeric: Y.NumericAxis,"," category: Y.CategoryAxis,"," time: Y.TimeAxis"," },",""," /**"," * Collection of axes."," *"," * @property _axes"," * @type Array"," * @private"," */"," _axes: null,",""," /**"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this._itemRenderQueue = [];"," this._seriesIndex = -1;"," this._itemIndex = -1;"," this.after(\"dataProviderChange\", this._dataProviderChangeHandler);"," },",""," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var tt = this.get(\"tooltip\"),"," bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\");"," //move the position = absolute logic to a class file"," bb.setStyle(\"position\", \"absolute\");"," cb.setStyle(\"position\", \"absolute\");"," this._addAxes();"," this._addSeries();"," if(tt && tt.show)"," {"," this._addTooltip();"," }"," this._setAriaElements(bb, cb);"," },"," "," /**"," * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart."," *"," * @method _setAriaElements"," * @param {Node} cb Reference to the Chart's `contentBox` attribute."," * @private"," */"," _setAriaElements: function(bb, cb)"," {"," var description = this._getAriaOffscreenNode(),"," id = this.get(\"id\") + \"_description\","," liveRegion = this._getAriaOffscreenNode();"," cb.set(\"tabIndex\", 0);"," cb.set(\"role\", \"img\");"," cb.setAttribute(\"aria-label\", this.get(\"ariaLabel\"));"," cb.setAttribute(\"aria-describedby\", id);"," description.set(\"id\", id);"," description.set(\"tabIndex\", -1);"," description.appendChild(DOCUMENT.createTextNode(this.get(\"ariaDescription\")));"," liveRegion.set(\"id\", \"live-region\");"," liveRegion.set(\"aria-live\", \"polite\");"," liveRegion.set(\"aria-atomic\", \"true\");"," liveRegion.set(\"role\", \"status\");"," bb.setAttribute(\"role\", \"application\");"," bb.appendChild(description);"," bb.appendChild(liveRegion);"," this._description = description;"," this._liveRegion = liveRegion;"," },",""," /**"," * Sets a node offscreen for use as aria-description or aria-live-regin."," *"," * @method _setOffscreen"," * @return Node "," * @private"," */"," _getAriaOffscreenNode: function() "," {"," var node = Y.Node.create(\"<div></div>\"),"," ie = Y.UA.ie,"," clipRect = (ie && ie < 8) ? \"rect(1px 1px 1px 1px)\" : \"rect(1px, 1px, 1px, 1px)\";"," node.setStyle(\"position\", \"absolute\");"," node.setStyle(\"height\", \"1px\"); "," node.setStyle(\"width\", \"1px\"); "," node.setStyle(\"overflow\", \"hidden\");"," node.setStyle(\"clip\", clipRect); "," return node;"," },"," "," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," this._redraw();"," },",""," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.after(\"tooltipChange\", Y.bind(this._tooltipChangeHandler, this));"," this.after(\"widthChange\", this._sizeChanged);"," this.after(\"heightChange\", this._sizeChanged);"," this.after(\"groupMarkersChange\", this._groupMarkersChangeHandler);"," var tt = this.get(\"tooltip\"),"," hideEvent = \"mouseout\","," showEvent = \"mouseover\","," cb = this.get(\"contentBox\"),"," interactionType = this.get(\"interactionType\"),"," i = 0,"," len,"," markerClassName = \".\" + SERIES_MARKER,"," isTouch = ((WINDOW && (\"ontouchstart\" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));"," Y.on(\"keydown\", Y.bind(function(e) {"," var key = e.keyCode,"," numKey = parseFloat(key),"," msg;"," if(numKey > 36 && numKey < 41)"," {"," e.halt();"," msg = this._getAriaMessage(numKey);"," this._liveRegion.setContent(\"\");"," this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));"," }"," }, this), this.get(\"contentBox\"));"," if(interactionType == \"marker\")"," {"," //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types."," hideEvent = tt.hideEvent;"," showEvent = tt.showEvent;"," if(isTouch)"," {"," Y.delegate(\"touchend\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," //hide active tooltip if the chart is touched"," Y.on(\"touchend\", Y.bind(function(e) {"," e.halt(true);"," if(this._activeMarker)"," {"," this._activeMarker = null;"," this.hideTooltip(e);"," }"," }, this));"," }"," else"," {"," Y.delegate(\"mouseenter\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mousedown\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mouseup\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mouseleave\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"click\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mousemove\", Y.bind(this._positionTooltip, this), cb, markerClassName);"," }"," }"," else if(interactionType == \"planar\")"," {"," if(isTouch)"," {"," this._overlay.on(\"touchend\", Y.bind(this._planarEventDispatcher, this));"," }"," else"," {"," this._overlay.on(\"mousemove\", Y.bind(this._planarEventDispatcher, this));"," this.on(\"mouseout\", this.hideTooltip);"," }"," }"," if(tt)"," {"," this.on(\"markerEvent:touchend\", Y.bind(function(e) {"," var marker = e.series.get(\"markers\")[e.index];"," if(this._activeMarker && marker === this._activeMarker)"," {"," this._activeMarker = null;"," this.hideTooltip(e);"," }"," else"," {",""," this._activeMarker = marker;"," tt.markerEventHandler.apply(this, [e]);"," }"," }, this));"," if(hideEvent && showEvent && hideEvent == showEvent)"," {"," this.on(interactionType + \"Event:\" + hideEvent, this.toggleTooltip);"," }"," else"," {"," if(showEvent)"," {"," this.on(interactionType + \"Event:\" + showEvent, tt[interactionType + \"EventHandler\"]);"," }"," if(hideEvent)"," {"," if(Y_Lang.isArray(hideEvent))"," {"," len = hideEvent.length;"," for(; i < len; ++i)"," {"," this.on(interactionType + \"Event:\" + hideEvent[i], this.hideTooltip);"," }"," }"," this.on(interactionType + \"Event:\" + hideEvent, this.hideTooltip);"," }"," }"," }"," },"," "," /**"," * Event handler for marker events."," *"," * @method _markerEventDispatcher"," * @param {Object} e Event object."," * @private"," */"," _markerEventDispatcher: function(e)"," {"," var type = e.type,"," cb = this.get(\"contentBox\"),"," markerNode = e.currentTarget,"," strArr = markerNode.getAttribute(\"id\").split(\"_\"),"," index = strArr.pop(),"," seriesIndex = strArr.pop(),"," series = this.getSeries(parseInt(seriesIndex, 10)),"," items = this.getSeriesItems(series, index),"," isTouch = e && e.hasOwnProperty(\"changedTouches\"),"," pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,"," pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,"," x = pageX - cb.getX(),"," y = pageY - cb.getY();"," if(type == \"mouseenter\")"," {"," type = \"mouseover\";"," }"," else if(type == \"mouseleave\")"," {"," type = \"mouseout\";"," }"," series.updateMarkerState(type, index);"," e.halt();"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event."," * "," *"," * @event markerEvent:mouseover"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event."," *"," * @event markerEvent:mouseout"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event."," *"," * @event markerEvent:mousedown"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event."," *"," * @event markerEvent:mouseup"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event."," *"," * @event markerEvent:click"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>"," * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * <dt>originEvent</dt><dd>Underlying dom event.</dd>"," * </dl>"," */"," this.fire(\"markerEvent:\" + type, {"," originEvent: e,"," pageX:pageX, "," pageY:pageY, "," categoryItem:items.category, "," valueItem:items.value, "," node:markerNode, "," x:x, "," y:y, "," series:series, "," index:index, "," seriesIndex:seriesIndex"," });"," },",""," /**"," * Event handler for dataProviderChange."," *"," * @method _dataProviderChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _dataProviderChangeHandler: function(e)"," {"," var dataProvider = e.newVal,"," axes,"," i,"," axis;"," this._seriesIndex = -1;"," this._itemIndex = -1;"," if(this instanceof Y.CartesianChart)"," {"," this.set(\"axes\", this.get(\"axes\"));"," this.set(\"seriesCollection\", this.get(\"seriesCollection\"));"," }"," axes = this.get(\"axes\");"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," if(axis instanceof Y.Axis)"," {"," if(axis.get(\"position\") != \"none\")"," {"," this._addToAxesRenderQueue(axis);"," }"," axis.set(\"dataProvider\", dataProvider);"," }"," }"," }"," }"," },"," "," /**"," * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it "," * will create and show a tooltip based on the event object."," * "," * @method toggleTooltip"," * @param {Object} e Event object."," */"," toggleTooltip: function(e)"," {"," var tt = this.get(\"tooltip\");"," if(tt.visible)"," {"," this.hideTooltip();"," }"," else"," {"," tt.markerEventHandler.apply(this, [e]);"," }"," },",""," /**"," * Shows a tooltip"," *"," * @method _showTooltip"," * @param {String} msg Message to dispaly in the tooltip."," * @param {Number} x x-coordinate "," * @param {Number} y y-coordinate"," * @private"," */"," _showTooltip: function(msg, x, y)"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node;"," if(msg)"," {"," tt.visible = true;"," tt.setTextFunction(node, msg);"," node.setStyle(\"top\", y + \"px\");"," node.setStyle(\"left\", x + \"px\");"," node.setStyle(\"visibility\", \"visible\");"," }"," },",""," /**"," * Positions the tooltip"," *"," * @method _positionTooltip"," * @param {Object} e Event object."," * @private"," */"," _positionTooltip: function(e)"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node,"," cb = this.get(\"contentBox\"),"," x = (e.pageX + 10) - cb.getX(),"," y = (e.pageY + 10) - cb.getY();"," if(node)"," {"," node.setStyle(\"left\", x + \"px\");"," node.setStyle(\"top\", y + \"px\");"," }"," },",""," /**"," * Hides the default tooltip"," *"," * @method hideTooltip"," */"," hideTooltip: function()"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node;"," tt.visible = false;"," node.set(\"innerHTML\", \"\");"," node.setStyle(\"left\", -10000);"," node.setStyle(\"top\", -10000);"," node.setStyle(\"visibility\", \"hidden\");"," },",""," /**"," * Adds a tooltip to the dom."," *"," * @method _addTooltip"," * @private"," */"," _addTooltip: function()"," {"," var tt = this.get(\"tooltip\"),"," id = this.get(\"id\") + \"_tooltip\","," cb = this.get(\"contentBox\"),"," oldNode = DOCUMENT.getElementById(id);"," if(oldNode)"," {"," cb.removeChild(oldNode);"," }"," tt.node.set(\"id\", id);"," tt.node.setStyle(\"visibility\", \"hidden\");"," cb.appendChild(tt.node);"," },",""," /**"," * Updates the tooltip attribute."," *"," * @method _updateTooltip"," * @param {Object} val Object containing properties for the tooltip."," * @return Object"," * @private"," */"," _updateTooltip: function(val)"," {"," var tt = this.get(\"tooltip\") || this._getTooltip(),"," i,"," styles,"," node,"," props = {"," markerLabelFunction:\"markerLabelFunction\","," planarLabelFunction:\"planarLabelFunction\","," setTextFunction:\"setTextFunction\","," showEvent:\"showEvent\","," hideEvent:\"hideEvent\","," markerEventHandler:\"markerEventHandler\","," planarEventHandler:\"planarEventHandler\","," show:\"show\""," };"," if(Y_Lang.isObject(val))"," {"," styles = val.styles;"," node = Y.one(val.node) || tt.node;"," if(styles)"," {"," for(i in styles)"," {"," if(styles.hasOwnProperty(i))"," {"," node.setStyle(i, styles[i]);"," }"," }"," }"," for(i in props)"," {"," if(val.hasOwnProperty(i))"," {"," tt[i] = val[i];"," }"," }"," tt.node = node;"," }"," return tt;"," },",""," /**"," * Default getter for `tooltip` attribute."," *"," * @method _getTooltip"," * @return Object"," * @private"," */"," _getTooltip: function()"," {"," var node = DOCUMENT.createElement(\"div\"),"," tooltipClass = _getClassName(\"chart-tooltip\"),"," tt = {"," setTextFunction: this._setText,"," markerLabelFunction: this._tooltipLabelFunction,"," planarLabelFunction: this._planarLabelFunction,"," show: true,"," hideEvent: \"mouseout\","," showEvent: \"mouseover\","," markerEventHandler: function(e)"," {"," var tt = this.get(\"tooltip\"),"," msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);"," this._showTooltip(msg, e.x + 10, e.y + 10);"," },"," planarEventHandler: function(e)"," {"," var tt = this.get(\"tooltip\"),"," msg ,"," categoryAxis = this.get(\"categoryAxis\");"," msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);"," this._showTooltip(msg, e.x + 10, e.y + 10);"," }"," };"," node = Y.one(node);"," node.set(\"id\", this.get(\"id\") + \"_tooltip\");"," node.setStyle(\"fontSize\", \"85%\");"," node.setStyle(\"opacity\", \"0.83\");"," node.setStyle(\"position\", \"absolute\");"," node.setStyle(\"paddingTop\", \"2px\");"," node.setStyle(\"paddingRight\", \"5px\");"," node.setStyle(\"paddingBottom\", \"4px\");"," node.setStyle(\"paddingLeft\", \"2px\");"," node.setStyle(\"backgroundColor\", \"#fff\");"," node.setStyle(\"border\", \"1px solid #dbdccc\");"," node.setStyle(\"pointerEvents\", \"none\");"," node.setStyle(\"zIndex\", 3);"," node.setStyle(\"whiteSpace\", \"noWrap\");"," node.setStyle(\"visibility\", \"hidden\");"," node.addClass(tooltipClass);"," tt.node = Y.one(node);"," return tt;"," },",""," /**"," * Formats tooltip text when `interactionType` is `planar`."," *"," * @method _planarLabelFunction"," * @param {Axis} categoryAxis Reference to the categoryAxis of the chart."," * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:"," * <dl>"," * <dt>axis</dt><dd>The value axis of the series.</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * </dl> "," * @param {Number} index The index of the item within its series."," * @param {Array} seriesArray Array of series instances for each value item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {String | HTML} "," * @private"," */"," _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," valueItem,"," i = 0,"," len = seriesArray.length,"," axis,"," categoryValue,"," seriesValue,"," series;"," if(categoryAxis)"," {"," categoryValue = categoryAxis.get(\"labelFunction\").apply(this, [categoryAxis.getKeyValueAt(this.get(\"categoryKey\"), index), categoryAxis.get(\"labelFormat\")]);"," if(!Y_Lang.isObject(categoryValue))"," {"," categoryValue = DOCUMENT.createTextNode(categoryValue);"," }"," msg.appendChild(categoryValue);"," }",""," for(; i < len; ++i)"," {"," series = seriesArray[i];"," if(series.get(\"visible\"))"," {"," valueItem = valueItems[i];"," axis = valueItem.axis;"," seriesValue = axis.get(\"labelFunction\").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get(\"labelFormat\")]);"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));"," msg.appendChild(DOCUMENT.createTextNode(\": \"));"," if(!Y_Lang.isObject(seriesValue))"," {"," seriesValue = DOCUMENT.createTextNode(seriesValue);"," }"," msg.appendChild(seriesValue);"," }"," }"," return msg;"," },",""," /**"," * Formats tooltip text when `interactionType` is `marker`."," *"," * @method _tooltipLabelFunction"," * @param {Object} categoryItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category</dd>"," * </dl>"," * @param {Object} valueItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * @param {Number} itemIndex The index of the item within the series."," * @param {CartesianSeries} series The `CartesianSeries` instance of the item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {String | HTML}"," * @private"," */"," _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," categoryValue = categoryItem.axis.get(\"labelFunction\").apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]),"," seriesValue = valueItem.axis.get(\"labelFunction\").apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]);"," msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); "," msg.appendChild(DOCUMENT.createTextNode(\": \")); "," if(!Y_Lang.isObject(categoryValue))"," {"," categoryValue = DOCUMENT.createTextNode(categoryValue);"," }"," msg.appendChild(categoryValue);"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); "," msg.appendChild(DOCUMENT.createTextNode(\": \")); "," if(!Y_Lang.isObject(seriesValue))"," {"," seriesValue = DOCUMENT.createTextNode(seriesValue);"," }"," msg.appendChild(seriesValue);"," return msg; "," },",""," /**"," * Event handler for the tooltipChange."," *"," * @method _tooltipChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _tooltipChangeHandler: function(e)"," {"," if(this.get(\"tooltip\"))"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node,"," show = tt.show,"," cb = this.get(\"contentBox\");"," if(node && show)"," {"," if(!cb.contains(node))"," {"," this._addTooltip();"," }"," }"," }"," },"," "," /**"," * Updates the content of text field. This method writes a value into a text field using "," * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. "," *"," * @method _setText"," * @param label {HTMLElement} label to be updated"," * @param val {String} value with which to update the label"," * @private"," */"," _setText: function(textField, val)"," { "," textField.setContent(\"\");"," if(Y_Lang.isNumber(val))"," {"," val = val + \"\";"," }"," else if(!val)"," {"," val = \"\";"," }"," if(IS_STRING(val))"," {"," val = DOCUMENT.createTextNode(val);"," }"," textField.appendChild(val);"," },",""," /**"," * Returns all the keys contained in a `dataProvider`."," *"," * @method _getAllKeys"," * @param {Array} dp Collection of objects to be parsed."," * @return Object"," */"," _getAllKeys: function(dp)"," {"," var i = 0,"," len = dp.length,"," item,"," key,"," keys = {};"," for(; i < len; ++i)"," {"," item = dp[i];"," for(key in item)"," {"," if(item.hasOwnProperty(key))"," {"," keys[key] = true;"," }"," }"," }"," return keys;"," },"," "," /**"," * Constructs seriesKeys if not explicitly specified."," *"," * @method _buildSeriesKeys"," * @param {Array} dataProvider The dataProvider for the chart."," * @return Array"," * @private"," */"," _buildSeriesKeys: function(dataProvider)"," {"," var allKeys,"," catKey = this.get(\"categoryKey\"),"," keys = [],"," i;"," if(this._seriesKeysExplicitlySet)"," {"," return this._seriesKeys;"," }"," allKeys = this._getAllKeys(dataProvider);"," for(i in allKeys)"," {"," if(allKeys.hasOwnProperty(i) && i != catKey)"," {"," keys.push(i);"," }"," }"," return keys;"," }","};","Y.ChartBase = ChartBase;","/**"," * The CartesianChart class creates a chart with horizontal and vertical axes."," *"," * @module charts"," * @submodule charts-base"," * @class CartesianChart"," * @extends ChartBase"," * @constructor"," */","Y.CartesianChart = Y.Base.create(\"cartesianChart\", Y.Widget, [Y.ChartBase], {"," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\"),"," tt = this.get(\"tooltip\"),"," overlay,"," overlayClass = _getClassName(\"overlay\");"," //move the position = absolute logic to a class file"," bb.setStyle(\"position\", \"absolute\");"," cb.setStyle(\"position\", \"absolute\");"," this._addAxes();"," this._addGridlines();"," this._addSeries();"," if(tt && tt.show)"," {"," this._addTooltip();"," }"," //If there is a style definition. Force them to set."," this.get(\"styles\");"," if(this.get(\"interactionType\") == \"planar\")"," {"," overlay = DOCUMENT.createElement(\"div\");"," this.get(\"contentBox\").appendChild(overlay);"," this._overlay = Y.one(overlay); "," this._overlay.set(\"id\", this.get(\"id\") + \"_overlay\");"," this._overlay.setStyle(\"position\", \"absolute\");"," this._overlay.setStyle(\"background\", \"#fff\");"," this._overlay.setStyle(\"opacity\", 0);"," this._overlay.addClass(overlayClass);"," this._overlay.setStyle(\"zIndex\", 4);"," }"," this._setAriaElements(bb, cb);"," this._redraw();"," },",""," /**"," * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to "," * data points on the `Chart`."," *"," * @method _planarEventDispatcher"," * @param {Object} e Event object."," * @private"," */"," _planarEventDispatcher: function(e)"," {"," var graph = this.get(\"graph\"),"," bb = this.get(\"boundingBox\"),"," cb = graph.get(\"contentBox\"),"," isTouch = e && e.hasOwnProperty(\"changedTouches\"),"," pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,"," pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,"," posX = pageX - bb.getX(),"," posY = pageY - bb.getY(),"," offset = {"," x: pageX - cb.getX(),"," y: pageY - cb.getY()"," },"," sc = graph.get(\"seriesCollection\"),"," series,"," i = 0,"," index,"," oldIndex = this._selectedIndex,"," item,"," items = [],"," categoryItems = [],"," valueItems = [],"," direction = this.get(\"direction\"),"," hasMarkers,"," catAxis,"," valAxis,"," coord,"," //data columns and area data could be created on a graph level"," markerPlane,"," len,"," coords;"," e.halt(true);"," if(direction == \"horizontal\")"," {"," catAxis = \"x\";"," valAxis = \"y\";"," }"," else"," {"," valAxis = \"x\";"," catAxis = \"y\";"," }"," coord = offset[catAxis];"," if(sc)"," {"," len = sc.length;"," while(i < len && !markerPlane)"," {"," if(sc[i])"," {"," markerPlane = sc[i].get(catAxis + \"MarkerPlane\");"," }"," i++;"," }"," }"," if(markerPlane)"," {"," len = markerPlane.length;"," for(i = 0; i < len; ++i)"," {"," if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)"," {"," index = i;"," break;"," }"," }"," len = sc.length;"," for(i = 0; i < len; ++i)"," {"," series = sc[i];"," coords = series.get(valAxis + \"coords\");"," hasMarkers = series.get(\"markers\");"," if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)"," {"," series.updateMarkerState(\"mouseout\", oldIndex);"," }"," if(coords && coords[index] > -1)"," {"," if(hasMarkers && !isNaN(index) && index > -1)"," {"," series.updateMarkerState(\"mouseover\", index);"," }"," item = this.getSeriesItems(series, index);"," categoryItems.push(item.category);"," valueItems.push(item.value);"," items.push(series);"," }"," "," }"," this._selectedIndex = index;",""," /**"," * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event."," * "," *"," * @event planarEvent:mouseover"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>"," * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>"," * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>"," * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>"," * <dt>index</dt><dd>Index of the markers in their respective series.</dd>"," * <dt>originEvent</dt><dd>Underlying dom event.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event."," *"," * @event planarEvent:mouseout"," * @preventable false"," * @param {EventFacade} e "," */"," if(index > -1)"," {"," this.fire(\"planarEvent:mouseover\", {"," categoryItem:categoryItems, "," valueItem:valueItems, "," x:posX, "," y:posY, "," pageX:pageX,"," pageY:pageY,"," items:items, "," index:index,"," originEvent:e"," });"," }"," else"," {"," this.fire(\"planarEvent:mouseout\");"," }"," }"," },",""," /**"," * Indicates the default series type for the chart."," *"," * @property _type"," * @type {String}"," * @private"," */"," _type: \"combo\",",""," /**"," * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated."," *"," * @property _itemRenderQueue"," * @type Array"," * @private"," */"," _itemRenderQueue: null,",""," /**"," * Adds an `Axis` instance to the `_itemRenderQueue`."," *"," * @method _addToAxesRenderQueue"," * @param {Axis} axis An `Axis` instance."," * @private "," */"," _addToAxesRenderQueue: function(axis)"," {"," if(!this._itemRenderQueue)"," {"," this._itemRenderQueue = [];"," }"," if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)"," {"," this._itemRenderQueue.push(axis);"," }"," },",""," /**"," * Adds axis instance to the appropriate array based on position"," *"," * @method _addToAxesCollection"," * @param {String} position The position of the axis"," * @param {Axis} axis The `Axis` instance"," */"," _addToAxesCollection: function(position, axis)"," {"," var axesCollection = this.get(position + \"AxesCollection\");"," if(!axesCollection)"," {"," axesCollection = [];"," this.set(position + \"AxesCollection\", axesCollection);"," }"," axesCollection.push(axis);"," },",""," /**"," * Returns the default value for the `seriesCollection` attribute."," *"," * @method _getDefaultSeriesCollection"," * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances."," * @return Array"," * @private"," */"," _getDefaultSeriesCollection: function()"," {"," var seriesCollection,"," dataProvider = this.get(\"dataProvider\");"," if(dataProvider)"," {"," seriesCollection = this._parseSeriesCollection();"," }"," return seriesCollection;"," },",""," /**"," * Parses and returns a series collection from an object and default properties."," *"," * @method _parseSeriesCollection"," * @param {Object} val Object contain properties for series being set."," * @return Object"," * @private"," */"," _parseSeriesCollection: function(val)"," {"," var dir = this.get(\"direction\"), "," sc = [], "," catAxis,"," valAxis,"," tempKeys = [],"," series,"," seriesKeys = this.get(\"seriesKeys\").concat(),"," i,"," index,"," l,"," type = this.get(\"type\"),"," key,"," catKey,"," seriesKey,"," graph,"," orphans = [],"," categoryKey = this.get(\"categoryKey\"),"," showMarkers = this.get(\"showMarkers\"),"," showAreaFill = this.get(\"showAreaFill\"),"," showLines = this.get(\"showLines\");"," val = val || []; "," if(dir == \"vertical\")"," {"," catAxis = \"yAxis\";"," catKey = \"yKey\";"," valAxis = \"xAxis\";"," seriesKey = \"xKey\";"," }"," else"," {"," catAxis = \"xAxis\";"," catKey = \"xKey\";"," valAxis = \"yAxis\";"," seriesKey = \"yKey\";"," }"," l = val.length;"," while(val && val.length > 0)"," {"," series = val.shift();"," key = this._getBaseAttribute(series, seriesKey);"," if(key)"," {"," index = Y.Array.indexOf(seriesKeys, key);"," if(index > -1)"," {"," seriesKeys.splice(index, 1);"," tempKeys.push(key);"," sc.push(series);"," }"," else"," {"," orphans.push(series);"," }"," }"," else"," {"," orphans.push(series);"," }"," }"," while(orphans.length > 0)"," {"," series = orphans.shift();"," if(seriesKeys.length > 0)"," {"," key = seriesKeys.shift();"," this._setBaseAttribute(series, seriesKey, key);"," tempKeys.push(key);"," sc.push(series);"," }"," else if(series instanceof Y.CartesianSeries)"," {"," series.destroy(true);"," }"," }"," if(seriesKeys.length > 0)"," {"," tempKeys = tempKeys.concat(seriesKeys);"," }"," l = tempKeys.length;"," for(i = 0; i < l; ++i)"," {"," series = sc[i] || {type:type};"," if(series instanceof Y.CartesianSeries)"," {"," this._parseSeriesAxes(series);"," continue;"," }",""," series[catKey] = series[catKey] || categoryKey;"," series[seriesKey] = series[seriesKey] || seriesKeys.shift();"," series[catAxis] = this._getCategoryAxis();"," series[valAxis] = this._getSeriesAxis(series[seriesKey]);"," "," series.type = series.type || type;"," series.direction = series.direction || dir;"," "," if((series.type == \"combo\" || series.type == \"stackedcombo\" || series.type == \"combospline\" || series.type == \"stackedcombospline\"))"," {"," if(showAreaFill !== null)"," {"," series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;"," }"," if(showMarkers !== null)"," {"," series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;"," }"," if(showLines !== null)"," {"," series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;"," }"," }"," sc[i] = series;"," }"," if(sc)"," {"," graph = this.get(\"graph\");"," graph.set(\"seriesCollection\", sc);"," sc = graph.get(\"seriesCollection\");"," }"," return sc;"," },",""," /**"," * Parse and sets the axes for a series instance."," *"," * @method _parseSeriesAxes"," * @param {CartesianSeries} series A `CartesianSeries` instance."," * @private"," */"," _parseSeriesAxes: function(series)"," {"," var axes = this.get(\"axes\"),"," xAxis = series.get(\"xAxis\"),"," yAxis = series.get(\"yAxis\"),"," YAxis = Y.Axis,"," axis;"," if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))"," {"," axis = axes[xAxis];"," if(axis instanceof YAxis)"," {"," series.set(\"xAxis\", axis);"," }"," }"," if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))"," { "," axis = axes[yAxis];"," if(axis instanceof YAxis)"," {"," series.set(\"yAxis\", axis);"," }"," }",""," },",""," /**"," * Returns the category axis instance for the chart."," *"," * @method _getCategoryAxis"," * @return Axis"," * @private"," */"," _getCategoryAxis: function()"," {"," var axis,"," axes = this.get(\"axes\"),"," categoryAxisName = this.get(\"categoryAxisName\") || this.get(\"categoryKey\");"," axis = axes[categoryAxisName];"," return axis;"," },",""," /**"," * Returns the value axis for a series."," *"," * @method _getSeriesAxis"," * @param {String} key The key value used to determine the axis instance."," * @return Axis"," * @private"," */"," _getSeriesAxis:function(key, axisName)"," {"," var axes = this.get(\"axes\"),"," i,"," keys,"," axis;"," if(axes)"," {"," if(axisName && axes.hasOwnProperty(axisName))"," {"," axis = axes[axisName];"," }"," else"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," keys = axes[i].get(\"keys\");"," if(keys && keys.hasOwnProperty(key))"," {"," axis = axes[i];"," break;"," }"," }"," }"," }"," }"," return axis;"," },",""," /**"," * Gets an attribute from an object, using a getter for Base objects and a property for object"," * literals. Used for determining attributes from series/axis references which can be an actual class instance"," * or a hash of properties that will be used to create a class instance."," *"," * @method _getBaseAttribute"," * @param {Object} item Object or instance in which the attribute resides."," * @param {String} key Attribute whose value will be returned."," * @return Object"," * @private"," */"," _getBaseAttribute: function(item, key)"," {"," if(item instanceof Y.Base)"," {"," return item.get(key);"," }"," if(item.hasOwnProperty(key))"," {"," return item[key];"," }"," return null;"," },",""," /**"," * Sets an attribute on an object, using a setter of Base objects and a property for object"," * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal"," * for use at instantiation."," *"," * @method _setBaseAttribute"," * @param {Object} item Object or instance in which the attribute resides."," * @param {String} key Attribute whose value will be assigned."," * @param {Object} value Value to be assigned to the attribute."," * @private"," */"," _setBaseAttribute: function(item, key, value)"," {"," if(item instanceof Y.Base)"," {"," item.set(key, value);"," }"," else"," {"," item[key] = value;"," }"," },",""," /**"," * Creates `Axis` instances."," *"," * @method _setAxes"," * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances."," * @return Object"," * @private"," */"," _setAxes: function(val)"," {"," var hash = this._parseAxes(val),"," axes = {},"," axesAttrs = {"," edgeOffset: \"edgeOffset\", "," position: \"position\","," overlapGraph:\"overlapGraph\","," labelFunction:\"labelFunction\","," labelFunctionScope:\"labelFunctionScope\","," labelFormat:\"labelFormat\","," appendLabelFunction: \"appendLabelFunction\","," appendTitleFunction: \"appendTitleFunction\","," maximum:\"maximum\","," minimum:\"minimum\", "," roundingMethod:\"roundingMethod\","," alwaysShowZero:\"alwaysShowZero\","," title:\"title\","," width:\"width\","," height:\"height\""," },"," dp = this.get(\"dataProvider\"),"," ai,"," i, "," pos, "," axis,"," axisPosition,"," dh, "," axisClass, "," config,"," axesCollection;"," for(i in hash)"," {"," if(hash.hasOwnProperty(i))"," {"," dh = hash[i];"," if(dh instanceof Y.Axis)"," {"," axis = dh;"," }"," else"," {"," axis = null;"," config = {};"," config.dataProvider = dh.dataProvider || dp;"," config.keys = dh.keys;"," "," if(dh.hasOwnProperty(\"roundingUnit\"))"," {"," config.roundingUnit = dh.roundingUnit;"," }"," pos = dh.position;"," if(dh.styles)"," {"," config.styles = dh.styles;"," }"," config.position = dh.position;"," for(ai in axesAttrs)"," {"," if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))"," {"," config[ai] = dh[ai];"," }"," }"," "," //only check for existing axis if we constructed the default axes already"," if(val)"," {"," axis = this.getAxisByKey(i);"," }"," "," if(axis && axis instanceof Y.Axis)"," {"," axisPosition = axis.get(\"position\");"," if(pos != axisPosition)"," {"," if(axisPosition != \"none\")"," {"," axesCollection = this.get(axisPosition + \"AxesCollection\");"," axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);"," }"," if(pos != \"none\")"," {"," this._addToAxesCollection(pos, axis);"," }"," }"," axis.setAttrs(config);"," }"," else"," {"," axisClass = this._getAxisClass(dh.type);"," axis = new axisClass(config);"," axis.after(\"axisRendered\", Y.bind(this._itemRendered, this));"," }"," }",""," if(axis)"," {"," axesCollection = this.get(pos + \"AxesCollection\");"," if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)"," {"," axis.set(\"overlapGraph\", false);"," }"," axes[i] = axis;"," }"," }"," }"," return axes;"," },"," "," /**"," * Adds axes to the chart."," *"," * @method _addAxes"," * @private"," */"," _addAxes: function()"," {"," var axes = this.get(\"axes\"),"," i, "," axis, "," pos,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," node = Y.Node.one(this._parentNode);"," if(!this._axesCollection)"," { "," this._axesCollection = [];"," }"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," if(axis instanceof Y.Axis)"," {"," if(!w)"," {"," this.set(\"width\", node.get(\"offsetWidth\"));"," w = this.get(\"width\");"," }"," if(!h)"," {"," this.set(\"height\", node.get(\"offsetHeight\"));"," h = this.get(\"height\");"," }"," this._addToAxesRenderQueue(axis);"," pos = axis.get(\"position\");"," if(!this.get(pos + \"AxesCollection\"))"," {"," this.set(pos + \"AxesCollection\", [axis]);"," }"," else"," {"," this.get(pos + \"AxesCollection\").push(axis);"," }"," this._axesCollection.push(axis);"," if(axis.get(\"keys\").hasOwnProperty(this.get(\"categoryKey\")))"," {"," this.set(\"categoryAxis\", axis);"," }"," axis.render(this.get(\"contentBox\"));"," }"," }"," }"," },",""," /**"," * Renders the Graph."," *"," * @method _addSeries"," * @private"," */"," _addSeries: function()"," {"," var graph = this.get(\"graph\"),"," sc = this.get(\"seriesCollection\");"," graph.render(this.get(\"contentBox\"));",""," },",""," /**"," * Adds gridlines to the chart."," *"," * @method _addGridlines"," * @private"," */"," _addGridlines: function()"," {"," var graph = this.get(\"graph\"),"," hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\"),"," direction = this.get(\"direction\"),"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," seriesAxesCollection,"," catAxis = this.get(\"categoryAxis\"),"," hAxis,"," vAxis;"," if(this._axesCollection)"," {"," seriesAxesCollection = this._axesCollection.concat();"," seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);"," }"," if(hgl)"," {"," if(leftAxesCollection && leftAxesCollection[0])"," {"," hAxis = leftAxesCollection[0];"," }"," else if(rightAxesCollection && rightAxesCollection[0])"," {"," hAxis = rightAxesCollection[0];"," }"," else "," {"," hAxis = direction == \"horizontal\" ? catAxis : seriesAxesCollection[0];"," }"," if(!this._getBaseAttribute(hgl, \"axis\") && hAxis)"," {"," this._setBaseAttribute(hgl, \"axis\", hAxis);"," }"," if(this._getBaseAttribute(hgl, \"axis\"))"," {"," graph.set(\"horizontalGridlines\", hgl);"," }"," }"," if(vgl)"," {"," if(bottomAxesCollection && bottomAxesCollection[0])"," {"," vAxis = bottomAxesCollection[0];"," }"," else if (topAxesCollection && topAxesCollection[0])"," {"," vAxis = topAxesCollection[0];"," }"," else "," {"," vAxis = direction == \"vertical\" ? catAxis : seriesAxesCollection[0];"," }"," if(!this._getBaseAttribute(vgl, \"axis\") && vAxis)"," {"," this._setBaseAttribute(vgl, \"axis\", vAxis);"," }"," if(this._getBaseAttribute(vgl, \"axis\"))"," {"," graph.set(\"verticalGridlines\", vgl);"," }"," }"," },"," "," /**"," * Default Function for the axes attribute."," *"," * @method _getDefaultAxes"," * @return Object"," * @private"," */"," _getDefaultAxes: function()"," {"," var axes;"," if(this.get(\"dataProvider\"))"," {"," axes = this._parseAxes();"," }"," return axes;"," },",""," /**"," * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances."," *"," * @method _parseAxes"," * @param {Object} axes Object containing `Axis` instances or `Axis` attributes."," * @return Object"," * @private"," */"," _parseAxes: function(axes)"," {"," var catKey = this.get(\"categoryKey\"),"," axis,"," attr,"," keys,"," newAxes = {},"," claimedKeys = [],"," categoryAxisName = this.get(\"categoryAxisName\") || this.get(\"categoryKey\"),"," valueAxisName = this.get(\"valueAxisName\"),"," seriesKeys = this.get(\"seriesKeys\").concat(),"," i, "," l,"," ii,"," ll,"," cIndex,"," direction = this.get(\"direction\"),"," seriesPosition,"," categoryPosition,"," valueAxes = [],"," seriesAxis = this.get(\"stacked\") ? \"stacked\" : \"numeric\";"," if(direction == \"vertical\")"," {"," seriesPosition = \"bottom\";"," categoryPosition = \"left\";"," }"," else"," {"," seriesPosition = \"left\";"," categoryPosition = \"bottom\";"," }"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," keys = this._getBaseAttribute(axis, \"keys\");"," attr = this._getBaseAttribute(axis, \"type\");"," if(attr == \"time\" || attr == \"category\")"," {"," categoryAxisName = i;"," this.set(\"categoryAxisName\", i);"," if(Y_Lang.isArray(keys) && keys.length > 0)"," {"," catKey = keys[0];"," this.set(\"categoryKey\", catKey);"," }"," newAxes[i] = axis;"," }"," else if(i == categoryAxisName)"," {"," newAxes[i] = axis;"," }"," else "," {"," newAxes[i] = axis;"," if(i != valueAxisName && keys && Y_Lang.isArray(keys))"," {"," ll = keys.length;"," for(ii = 0; ii < ll; ++ii)"," {"," claimedKeys.push(keys[ii]);"," }"," valueAxes.push(newAxes[i]);"," }"," if(!(this._getBaseAttribute(newAxes[i], \"type\")))"," {"," this._setBaseAttribute(newAxes[i], \"type\", seriesAxis);"," }"," if(!(this._getBaseAttribute(newAxes[i], \"position\")))"," {"," this._setBaseAttribute(newAxes[i], \"position\", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));"," }"," }"," }"," }"," }"," cIndex = Y.Array.indexOf(seriesKeys, catKey);"," if(cIndex > -1)"," {"," seriesKeys.splice(cIndex, 1);"," }"," l = claimedKeys.length;"," for(i = 0; i < l; ++i)"," {"," cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); "," if(cIndex > -1)"," {"," seriesKeys.splice(cIndex, 1);"," }"," }"," if(!newAxes.hasOwnProperty(categoryAxisName))"," {"," newAxes[categoryAxisName] = {};"," }"," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"keys\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"keys\", [catKey]);"," }"," "," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"position\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"position\", categoryPosition);"," }"," "," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"type\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"type\", this.get(\"categoryType\"));"," }"," if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)"," {"," newAxes[valueAxisName] = {keys:seriesKeys};"," valueAxes.push(newAxes[valueAxisName]);"," }"," if(claimedKeys.length > 0)"," {"," if(seriesKeys.length > 0)"," {"," seriesKeys = claimedKeys.concat(seriesKeys);"," }"," else"," {"," seriesKeys = claimedKeys;"," }"," }"," if(newAxes.hasOwnProperty(valueAxisName))"," {"," if(!(this._getBaseAttribute(newAxes[valueAxisName], \"position\")))"," {"," this._setBaseAttribute(newAxes[valueAxisName], \"position\", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));"," }"," this._setBaseAttribute(newAxes[valueAxisName], \"type\", seriesAxis);"," this._setBaseAttribute(newAxes[valueAxisName], \"keys\", seriesKeys);"," } "," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = seriesKeys;"," }"," return newAxes;"," },",""," /**"," * Determines the position of an axis when one is not specified."," *"," * @method _getDefaultAxisPosition"," * @param {Axis} axis `Axis` instance."," * @param {Array} valueAxes Array of `Axis` instances."," * @param {String} position Default position depending on the direction of the chart and type of axis."," * @return String"," * @private"," */"," _getDefaultAxisPosition: function(axis, valueAxes, position)"," {"," var direction = this.get(\"direction\"),"," i = Y.Array.indexOf(valueAxes, axis);"," "," if(valueAxes[i - 1] && valueAxes[i - 1].position)"," {"," if(direction == \"horizontal\")"," {"," if(valueAxes[i - 1].position == \"left\")"," {"," position = \"right\";"," }"," else if(valueAxes[i - 1].position == \"right\")"," {"," position = \"left\";"," }"," }"," else"," {"," if (valueAxes[i -1].position == \"bottom\")"," {"," position = \"top\";"," } "," else"," {"," position = \"bottom\";"," }"," }"," }"," return position;"," },",""," "," /**"," * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:"," * "," * @method getSeriesItems"," * @param {CartesianSeries} series Reference to a series."," * @param {Number} index Index of the specified item within a series."," * @return Object An object literal containing the following:"," *"," * <dl>"," * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series."," * <dl>"," * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>"," * <dt>key</dt><dd>Category key for the series.</dd>"," * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>"," * </dl>"," * </dd>"," * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series."," * <dl>"," * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>"," * <dt>key</dt><dd>Value key for the series.</dd>"," * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>"," * </dl>"," * </dd>"," * </dl>"," */"," getSeriesItems: function(series, index)"," {"," var xAxis = series.get(\"xAxis\"),"," yAxis = series.get(\"yAxis\"),"," xKey = series.get(\"xKey\"),"," yKey = series.get(\"yKey\"),"," categoryItem,"," valueItem;"," if(this.get(\"direction\") == \"vertical\")"," {"," categoryItem = {"," axis:yAxis,"," key:yKey,"," value:yAxis.getKeyValueAt(yKey, index)"," };"," valueItem = {"," axis:xAxis,"," key:xKey,"," value: xAxis.getKeyValueAt(xKey, index)"," };"," }"," else"," {"," valueItem = {"," axis:yAxis,"," key:yKey,"," value:yAxis.getKeyValueAt(yKey, index)"," };"," categoryItem = {"," axis:xAxis,"," key:xKey,"," value: xAxis.getKeyValueAt(xKey, index)"," };"," }"," categoryItem.displayName = series.get(\"categoryDisplayName\");"," valueItem.displayName = series.get(\"valueDisplayName\");"," categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);"," valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);"," return {category:categoryItem, value:valueItem};"," },",""," /**"," * Handler for sizeChanged event."," *"," * @method _sizeChanged"," * @param {Object} e Event object."," * @private"," */"," _sizeChanged: function(e)"," {"," if(this._axesCollection)"," {"," var ac = this._axesCollection,"," i = 0,"," l = ac.length;"," for(; i < l; ++i)"," {"," this._addToAxesRenderQueue(ac[i]);"," }"," this._redraw();"," }"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes."," *"," * @method _getTopOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getTopOverflow: function(set1, set2, height)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes."," *"," * @method _getRightOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getRightOverflow: function(set1, set2, width)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes."," *"," * @method _getLeftOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getLeftOverflow: function(set1, set2, width)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes."," *"," * @method _getBottomOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} height Height of the axes"," * @return Number"," * @private"," */"," _getBottomOverflow: function(set1, set2, height)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," return overflow;"," },",""," /**"," * Redraws and position all the components of the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," leftPaneWidth = 0,"," rightPaneWidth = 0,"," topPaneHeight = 0,"," bottomPaneHeight = 0,"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," i = 0,"," l,"," axis,"," graphOverflow = \"visible\","," graph = this.get(\"graph\"),"," topOverflow,"," bottomOverflow,"," leftOverflow,"," rightOverflow,"," graphWidth,"," graphHeight,"," graphX,"," graphY,"," allowContentOverflow = this.get(\"allowContentOverflow\"),"," diff,"," rightAxesXCoords,"," leftAxesXCoords,"," topAxesYCoords,"," bottomAxesYCoords,"," graphRect = {};"," if(leftAxesCollection)"," {"," leftAxesXCoords = [];"," l = leftAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," leftAxesXCoords.unshift(leftPaneWidth);"," leftPaneWidth += leftAxesCollection[i].get(\"width\");"," }"," }"," if(rightAxesCollection)"," {"," rightAxesXCoords = [];"," l = rightAxesCollection.length;"," i = 0;"," for(i = l - 1; i > -1; --i)"," {"," rightPaneWidth += rightAxesCollection[i].get(\"width\");"," rightAxesXCoords.unshift(w - rightPaneWidth);"," }"," }"," if(topAxesCollection)"," {"," topAxesYCoords = [];"," l = topAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," topAxesYCoords.unshift(topPaneHeight);"," topPaneHeight += topAxesCollection[i].get(\"height\");"," }"," }"," if(bottomAxesCollection)"," {"," bottomAxesYCoords = [];"," l = bottomAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," bottomPaneHeight += bottomAxesCollection[i].get(\"height\");"," bottomAxesYCoords.unshift(h - bottomPaneHeight);"," }"," }"," "," graphWidth = w - (leftPaneWidth + rightPaneWidth);"," graphHeight = h - (bottomPaneHeight + topPaneHeight);"," graphRect.left = leftPaneWidth;"," graphRect.top = topPaneHeight;"," graphRect.bottom = h - bottomPaneHeight;"," graphRect.right = w - rightPaneWidth;"," if(!allowContentOverflow)"," {"," topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);"," bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);"," leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);"," rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);"," "," diff = topOverflow - topPaneHeight;"," if(diff > 0)"," {"," graphRect.top = topOverflow;"," if(topAxesYCoords)"," {"," i = 0;"," l = topAxesYCoords.length;"," for(; i < l; ++i)"," {"," topAxesYCoords[i] += diff;"," }"," }"," }",""," diff = bottomOverflow - bottomPaneHeight;"," if(diff > 0)"," {"," graphRect.bottom = h - bottomOverflow;"," if(bottomAxesYCoords)"," {"," i = 0;"," l = bottomAxesYCoords.length;"," for(; i < l; ++i)"," {"," bottomAxesYCoords[i] -= diff;"," }"," }"," }",""," diff = leftOverflow - leftPaneWidth;"," if(diff > 0)"," {"," graphRect.left = leftOverflow;"," if(leftAxesXCoords)"," {"," i = 0;"," l = leftAxesXCoords.length;"," for(; i < l; ++i)"," {"," leftAxesXCoords[i] += diff;"," }"," }"," }",""," diff = rightOverflow - rightPaneWidth;"," if(diff > 0)"," {"," graphRect.right = w - rightOverflow;"," if(rightAxesXCoords)"," {"," i = 0;"," l = rightAxesXCoords.length;"," for(; i < l; ++i)"," {"," rightAxesXCoords[i] -= diff;"," }"," }"," }"," }"," graphWidth = graphRect.right - graphRect.left;"," graphHeight = graphRect.bottom - graphRect.top;"," graphX = graphRect.left;"," graphY = graphRect.top;"," if(topAxesCollection)"," {"," l = topAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = topAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," axis.get(\"boundingBox\").setStyle(\"top\", topAxesYCoords[i] + \"px\");"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(bottomAxesCollection)"," {"," l = bottomAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = bottomAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," axis.get(\"boundingBox\").setStyle(\"top\", bottomAxesYCoords[i] + \"px\");"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(leftAxesCollection)"," {"," l = leftAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = leftAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," axis.get(\"boundingBox\").setStyle(\"left\", leftAxesXCoords[i] + \"px\");"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(rightAxesCollection)"," {"," l = rightAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = rightAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," axis.get(\"boundingBox\").setStyle(\"left\", rightAxesXCoords[i] + \"px\");"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," graph.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," graph.set(\"width\", graphWidth);"," graph.set(\"height\", graphHeight);"," graph.get(\"boundingBox\").setStyle(\"overflow\", graphOverflow);"," }",""," if(this._overlay)"," {"," this._overlay.setStyle(\"left\", graphX + \"px\");"," this._overlay.setStyle(\"top\", graphY + \"px\");"," this._overlay.setStyle(\"width\", graphWidth + \"px\");"," this._overlay.setStyle(\"height\", graphHeight + \"px\");"," }"," },",""," /**"," * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance."," * Removes the tooltip and overlay HTML elements."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var graph = this.get(\"graph\"),"," i = 0,"," len,"," seriesCollection = this.get(\"seriesCollection\"),"," axesCollection = this._axesCollection,"," tooltip = this.get(\"tooltip\").node;"," if(this._description)"," {"," this._description.empty();"," this._description.remove(true);"," }"," if(this._liveRegion)"," {"," this._liveRegion.empty();"," this._liveRegion.remove(true);"," }"," len = seriesCollection ? seriesCollection.length : 0;"," for(; i < len; ++i)"," {"," if(seriesCollection[i] instanceof Y.CartesianSeries)"," {"," seriesCollection[i].destroy(true);"," }"," }"," len = axesCollection ? axesCollection.length : 0;"," for(i = 0; i < len; ++i)"," {"," if(axesCollection[i] instanceof Y.Axis)"," {"," axesCollection[i].destroy(true);"," }"," }"," if(graph)"," {"," graph.destroy(true);"," }"," if(tooltip)"," {"," tooltip.empty();"," tooltip.remove(true);"," }"," if(this._overlay)"," {"," this._overlay.empty();"," this._overlay.remove(true);"," }"," },",""," /**"," * Returns the appropriate message based on the key press."," *"," * @method _getAriaMessage"," * @param {Number} key The keycode that was pressed."," * @return String"," */"," _getAriaMessage: function(key)"," {"," var msg = \"\","," series,"," items,"," categoryItem,"," valueItem,"," seriesIndex = this._seriesIndex,"," itemIndex = this._itemIndex,"," seriesCollection = this.get(\"seriesCollection\"),"," len = seriesCollection.length,"," dataLength;"," if(key % 2 === 0)"," {"," if(len > 1)"," {"," if(key === 38)"," {"," seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;"," }"," else if(key === 40)"," {"," seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;"," }"," this._itemIndex = -1;"," }"," else"," {"," seriesIndex = 0;"," }"," this._seriesIndex = seriesIndex;"," series = this.getSeries(parseInt(seriesIndex, 10));"," msg = series.get(\"valueDisplayName\") + \" series.\";"," }"," else"," {"," if(seriesIndex > -1)"," {"," msg = \"\";"," series = this.getSeries(parseInt(seriesIndex, 10));"," }"," else"," {"," seriesIndex = 0;"," this._seriesIndex = seriesIndex;"," series = this.getSeries(parseInt(seriesIndex, 10));"," msg = series.get(\"valueDisplayName\") + \" series.\";"," }"," dataLength = series._dataLength ? series._dataLength : 0;"," if(key === 37)"," {"," itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;"," }"," else if(key === 39)"," {"," itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;"," }"," this._itemIndex = itemIndex;"," items = this.getSeriesItems(series, itemIndex);"," categoryItem = items.category;"," valueItem = items.value;"," if(categoryItem && valueItem && categoryItem.value && valueItem.value)"," {"," msg += categoryItem.displayName + \": \" + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]) + \", \";"," msg += valueItem.displayName + \": \" + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]) + \", \"; "," }"," else"," {"," msg += \"No data available.\";"," }"," msg += (itemIndex + 1) + \" of \" + dataLength + \". \";"," }"," return msg;"," }","}, {"," ATTRS: {"," /**"," * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box."," *"," * @attribute allowContentOverflow"," * @type Boolean"," */"," allowContentOverflow: {"," value: false"," },",""," /**"," * Style object for the axes."," *"," * @attribute axesStyles"," * @type Object"," * @private"," */"," axesStyles: {"," getter: function()"," {"," var axes = this.get(\"axes\"),"," i,"," styles = this._axesStyles;"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)"," {"," if(!styles)"," {"," styles = {};"," }"," styles[i] = axes[i].get(\"styles\");"," }"," }"," }"," return styles;"," },"," "," setter: function(val)"," {"," var axes = this.get(\"axes\"),"," i;"," for(i in val)"," {"," if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))"," {"," this._setBaseAttribute(axes[i], \"styles\", val[i]);"," }"," }"," }"," },",""," /**"," * Style object for the series"," *"," * @attribute seriesStyles"," * @type Object"," * @private"," */"," seriesStyles: {"," getter: function()"," {"," var styles = this._seriesStyles,"," graph = this.get(\"graph\"),"," dict,"," i;"," if(graph)"," {"," dict = graph.get(\"seriesDictionary\");"," if(dict)"," {"," styles = {};"," for(i in dict)"," {"," if(dict.hasOwnProperty(i))"," {"," styles[i] = dict[i].get(\"styles\");"," }"," }"," }"," }"," return styles;"," },"," "," setter: function(val)"," {"," var i,"," l,"," s;"," "," if(Y_Lang.isArray(val))"," {"," s = this.get(\"seriesCollection\");"," i = 0;"," l = val.length;",""," for(; i < l; ++i)"," {"," this._setBaseAttribute(s[i], \"styles\", val[i]);"," }"," }"," else"," {"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," {"," s = this.getSeries(i);"," this._setBaseAttribute(s, \"styles\", val[i]);"," }"," }"," }"," }"," },",""," /**"," * Styles for the graph."," *"," * @attribute graphStyles"," * @type Object"," * @private"," */"," graphStyles: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return(graph.get(\"styles\"));"," }"," return this._graphStyles;"," },",""," setter: function(val)"," {"," var graph = this.get(\"graph\");"," this._setBaseAttribute(graph, \"styles\", val);"," }",""," },",""," /**"," * Style properties for the chart. Contains a key indexed hash of the following:"," * <dl>"," * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart."," * Specific style attributes vary depending on the series:"," * <ul>"," * <li><a href=\"AreaSeries.html#attr_styles\">AreaSeries</a></li>"," * <li><a href=\"BarSeries.html#attr_styles\">BarSeries</a></li>"," * <li><a href=\"ColumnSeries.html#attr_styles\">ColumnSeries</a></li>"," * <li><a href=\"ComboSeries.html#attr_styles\">ComboSeries</a></li>"," * <li><a href=\"LineSeries.html#attr_styles\">LineSeries</a></li>"," * <li><a href=\"MarkerSeries.html#attr_styles\">MarkerSeries</a></li>"," * <li><a href=\"SplineSeries.html#attr_styles\">SplineSeries</a></li>"," * </ul>"," * </dd>"," * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific"," * style attributes can be found in the <a href=\"Axis.html#attr_styles\">Axis</a> class.</dd>"," * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the"," * <a href=\"Graph.html#attr_styles\">Graph</a> class.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," styles: {"," getter: function()"," {"," var styles = { "," axes: this.get(\"axesStyles\"),"," series: this.get(\"seriesStyles\"),"," graph: this.get(\"graphStyles\")"," };"," return styles;"," },"," setter: function(val)"," {"," if(val.hasOwnProperty(\"axes\"))"," {"," if(this.get(\"axesStyles\"))"," {"," this.set(\"axesStyles\", val.axes);"," }"," else"," {"," this._axesStyles = val.axes;"," }"," }"," if(val.hasOwnProperty(\"series\"))"," {"," if(this.get(\"seriesStyles\"))"," {"," this.set(\"seriesStyles\", val.series);"," }"," else"," {"," this._seriesStyles = val.series;"," }"," }"," if(val.hasOwnProperty(\"graph\"))"," {"," this.set(\"graphStyles\", val.graph);"," }"," }"," },",""," /**"," * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals"," * used to construct the appropriate axes."," *"," * @attribute axes"," * @type Object"," */"," axes: {"," valueFn: \"_getDefaultAxes\",",""," setter: function(val)"," {"," if(this.get(\"dataProvider\"))"," {"," val = this._setAxes(val);"," }"," return val;"," }"," },",""," /**"," * Collection of series to appear on the chart. This can be an array of Series instances or object literals"," * used to construct the appropriate series."," *"," * @attribute seriesCollection"," * @type Array"," */"," seriesCollection: {"," valueFn: \"_getDefaultSeriesCollection\","," "," setter: function(val)"," {"," if(this.get(\"dataProvider\"))"," {"," val = this._parseSeriesCollection(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the left-aligned axes for the chart."," *"," * @attribute leftAxesCollection"," * @type Array"," * @private"," */"," leftAxesCollection: {},",""," /**"," * Reference to the bottom-aligned axes for the chart."," *"," * @attribute bottomAxesCollection"," * @type Array"," * @private"," */"," bottomAxesCollection: {},",""," /**"," * Reference to the right-aligned axes for the chart."," *"," * @attribute rightAxesCollection"," * @type Array"," * @private"," */"," rightAxesCollection: {},",""," /**"," * Reference to the top-aligned axes for the chart."," *"," * @attribute topAxesCollection"," * @type Array"," * @private"," */"," topAxesCollection: {},"," "," /**"," * Indicates whether or not the chart is stacked."," *"," * @attribute stacked"," * @type Boolean"," */"," stacked: {"," value: false"," },",""," /**"," * Direction of chart's category axis when there is no series collection specified. Charts can"," * be horizontal or vertical. When the chart type is column, the chart is horizontal."," * When the chart type is bar, the chart is vertical. "," *"," * @attribute direction"," * @type String"," */"," direction: {"," getter: function()"," {"," var type = this.get(\"type\");"," if(type == \"bar\")"," { "," return \"vertical\";"," }"," else if(type == \"column\")"," {"," return \"horizontal\";"," }"," return this._direction;"," },",""," setter: function(val)"," {"," this._direction = val;"," return this._direction;"," }"," },",""," /**"," * Indicates whether or not an area is filled in a combo chart."," * "," * @attribute showAreaFill"," * @type Boolean"," */"," showAreaFill: {},",""," /**"," * Indicates whether to display markers in a combo chart."," *"," * @attribute showMarkers"," * @type Boolean"," */"," showMarkers:{},",""," /**"," * Indicates whether to display lines in a combo chart."," *"," * @attribute showLines"," * @type Boolean"," */"," showLines:{},",""," /**"," * Indicates the key value used to identify a category axis in the `axes` hash. If"," * not specified, the categoryKey attribute value will be used."," * "," * @attribute categoryAxisName"," * @type String"," */"," categoryAxisName: {"," },",""," /**"," * Indicates the key value used to identify a the series axis when an axis not generated."," *"," * @attribute valueAxisName"," * @type String"," */"," valueAxisName: {"," value: \"values\""," },",""," /**"," * Reference to the horizontalGridlines for the chart."," *"," * @attribute horizontalGridlines"," * @type Gridlines"," */"," horizontalGridlines: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return graph.get(\"horizontalGridlines\");"," }"," return this._horizontalGridlines;"," },"," setter: function(val)"," {"," var graph = this.get(\"graph\");"," if(val && !Y_Lang.isObject(val))"," {"," val = {};"," }"," if(graph)"," {"," graph.set(\"horizontalGridlines\", val);"," }"," else"," {"," this._horizontalGridlines = val;"," }"," }"," },",""," /**"," * Reference to the verticalGridlines for the chart."," *"," * @attribute verticalGridlines"," * @type Gridlines"," */"," verticalGridlines: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return graph.get(\"verticalGridlines\");"," }"," return this._verticalGridlines;"," },"," setter: function(val)"," {"," var graph = this.get(\"graph\");"," if(val && !Y_Lang.isObject(val))"," {"," val = {};"," }"," if(graph)"," {"," graph.set(\"verticalGridlines\", val);"," }"," else"," {"," this._verticalGridlines = val;"," }"," }"," },"," "," /**"," * Type of chart when there is no series collection specified."," *"," * @attribute type"," * @type String "," */"," type: {"," getter: function()"," {"," if(this.get(\"stacked\"))"," {"," return \"stacked\" + this._type;"," }"," return this._type;"," },",""," setter: function(val)"," {"," if(this._type == \"bar\")"," {"," if(val != \"bar\")"," {"," this.set(\"direction\", \"horizontal\");"," }"," }"," else"," {"," if(val == \"bar\")"," {"," this.set(\"direction\", \"vertical\");"," }"," }"," this._type = val;"," return this._type;"," }"," },"," "," /**"," * Reference to the category axis used by the chart."," *"," * @attribute categoryAxis"," * @type Axis"," */"," categoryAxis:{}"," }","});","/**"," * The PieChart class creates a pie chart"," *"," * @module charts"," * @submodule charts-base"," * @class PieChart"," * @extends ChartBase"," * @constructor"," */","Y.PieChart = Y.Base.create(\"pieChart\", Y.Widget, [Y.ChartBase], {"," /**"," * Calculates and returns a `seriesCollection`."," *"," * @method _getSeriesCollection"," * @return Array"," * @private"," */"," _getSeriesCollection: function()"," {"," if(this._seriesCollection)"," {"," return this._seriesCollection;"," }"," var axes = this.get(\"axes\"),"," sc = [], "," seriesKeys,"," i = 0,"," l,"," type = this.get(\"type\"),"," key,"," catAxis = \"categoryAxis\","," catKey = \"categoryKey\","," valAxis = \"valueAxis\","," seriesKey = \"valueKey\";"," if(axes)"," {"," seriesKeys = axes.values.get(\"keyCollection\");"," key = axes.category.get(\"keyCollection\")[0];"," l = seriesKeys.length;"," for(; i < l; ++i)"," {"," sc[i] = {type:type};"," sc[i][catAxis] = \"category\";"," sc[i][valAxis] = \"values\";"," sc[i][catKey] = key;"," sc[i][seriesKey] = seriesKeys[i];"," }"," }"," this._seriesCollection = sc;"," return sc;"," },",""," /**"," * Creates `Axis` instances."," *"," * @method _parseAxes"," * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances."," * @return Object"," * @private"," */"," _parseAxes: function(hash)"," {"," if(!this._axes)"," {"," this._axes = {};"," }"," var i, pos, axis, dh, config, axisClass,"," type = this.get(\"type\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," node = Y.Node.one(this._parentNode);"," if(!w)"," {"," this.set(\"width\", node.get(\"offsetWidth\"));"," w = this.get(\"width\");"," }"," if(!h)"," {"," this.set(\"height\", node.get(\"offsetHeight\"));"," h = this.get(\"height\");"," }"," for(i in hash)"," {"," if(hash.hasOwnProperty(i))"," {"," dh = hash[i];"," pos = type == \"pie\" ? \"none\" : dh.position;"," axisClass = this._getAxisClass(dh.type);"," config = {dataProvider:this.get(\"dataProvider\")};"," if(dh.hasOwnProperty(\"roundingUnit\"))"," {"," config.roundingUnit = dh.roundingUnit;"," }"," config.keys = dh.keys;"," config.width = w;"," config.height = h;"," config.position = pos;"," config.styles = dh.styles;"," axis = new axisClass(config);"," axis.on(\"axisRendered\", Y.bind(this._itemRendered, this));"," this._axes[i] = axis;"," }"," }"," },",""," /**"," * Adds axes to the chart."," *"," * @method _addAxes"," * @private"," */"," _addAxes: function()"," {"," var axes = this.get(\"axes\"),"," i, "," axis, "," p;"," if(!axes)"," {"," this.set(\"axes\", this._getDefaultAxes());"," axes = this.get(\"axes\");"," }"," if(!this._axesCollection)"," { "," this._axesCollection = [];"," }"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," p = axis.get(\"position\");"," if(!this.get(p + \"AxesCollection\"))"," {"," this.set(p + \"AxesCollection\", [axis]);"," }"," else"," {"," this.get(p + \"AxesCollection\").push(axis);"," }"," this._axesCollection.push(axis);"," }"," }"," },",""," /**"," * Renders the Graph."," *"," * @method _addSeries"," * @private"," */"," _addSeries: function()"," {"," var graph = this.get(\"graph\"),"," seriesCollection = this.get(\"seriesCollection\");"," this._parseSeriesAxes(seriesCollection);"," graph.set(\"showBackground\", false);"," graph.set(\"width\", this.get(\"width\"));"," graph.set(\"height\", this.get(\"height\"));"," graph.set(\"seriesCollection\", seriesCollection);"," this._seriesCollection = graph.get(\"seriesCollection\");"," graph.render(this.get(\"contentBox\"));"," },",""," /**"," * Parse and sets the axes for the chart."," *"," * @method _parseSeriesAxes"," * @param {Array} c A collection `PieSeries` instance."," * @private"," */"," _parseSeriesAxes: function(c)"," {"," var i = 0, "," len = c.length, "," s,"," axes = this.get(\"axes\"),"," axis;"," for(; i < len; ++i)"," {"," s = c[i];"," if(s)"," {"," //If series is an actual series instance, "," //replace axes attribute string ids with axes"," if(s instanceof Y.PieSeries)"," {"," axis = s.get(\"categoryAxis\");"," if(axis && !(axis instanceof Y.Axis))"," {"," s.set(\"categoryAxis\", axes[axis]);"," }"," axis = s.get(\"valueAxis\");"," if(axis && !(axis instanceof Y.Axis))"," {"," s.set(\"valueAxis\", axes[axis]);"," }"," continue;"," }"," s.categoryAxis = axes.category;"," s.valueAxis = axes.values;"," if(!s.type)"," {"," s.type = this.get(\"type\");"," }"," }"," }"," },",""," /**"," * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances."," *"," * @method _getDefaultAxes"," * @return Object"," * @private"," */"," _getDefaultAxes: function()"," {"," var catKey = this.get(\"categoryKey\"),"," seriesKeys = this.get(\"seriesKeys\").concat(), "," seriesAxis = \"numeric\";"," return {"," values:{"," keys:seriesKeys,"," type:seriesAxis"," },"," category:{"," keys:[catKey],"," type:this.get(\"categoryType\")"," }"," };"," },"," "," /**"," * Returns an object literal containing a categoryItem and a valueItem for a given series index."," *"," * @method getSeriesItem"," * @param series Reference to a series."," * @param index Index of the specified item within a series."," * @return Object"," */"," getSeriesItems: function(series, index)"," {"," var categoryItem = {"," axis: series.get(\"categoryAxis\"),"," key: series.get(\"categoryKey\"),"," displayName: series.get(\"categoryDisplayName\")"," },"," valueItem = {"," axis: series.get(\"valueAxis\"),"," key: series.get(\"valueKey\"),"," displayName: series.get(\"valueDisplayName\")"," };"," categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);"," valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);"," return {category:categoryItem, value:valueItem};"," },",""," /**"," * Handler for sizeChanged event."," *"," * @method _sizeChanged"," * @param {Object} e Event object."," * @private"," */"," _sizeChanged: function(e)"," {"," this._redraw();"," },",""," /**"," * Redraws the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var graph = this.get(\"graph\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," dimension;"," if(graph)"," {"," dimension = Math.min(w, h);"," graph.set(\"width\", dimension);"," graph.set(\"height\", dimension);"," }"," },"," "," /**"," * Formats tooltip text for a pie chart."," *"," * @method _tooltipLabelFunction"," * @param {Object} categoryItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category</dd>"," * </dl>"," * @param {Object} valueItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * @param {Number} itemIndex The index of the item within the series."," * @param {CartesianSeries} series The `PieSeries` instance of the item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {HTML}"," * @private"," */"," _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," total = series.getTotalValues(),"," pct = Math.round((valueItem.value / total) * 10000)/100;"," msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName +"," \": \" + categoryItem.axis.get(\"labelFunction\").apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]))); "," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + "," \": \" + valueItem.axis.get(\"labelFunction\").apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")])));"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(pct + \"%\")); "," return msg; "," },",""," /**"," * Returns the appropriate message based on the key press."," *"," * @method _getAriaMessage"," * @param {Number} key The keycode that was pressed."," * @return String"," */"," _getAriaMessage: function(key)"," {"," var msg = \"\","," categoryItem,"," items,"," series,"," valueItem,"," seriesIndex = 0,"," itemIndex = this._itemIndex,"," seriesCollection = this.get(\"seriesCollection\"),"," len,"," total,"," pct,"," markers;"," series = this.getSeries(parseInt(seriesIndex, 10));"," markers = series.get(\"markers\");"," len = markers && markers.length ? markers.length : 0;"," if(key === 37)"," {"," itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;"," }"," else if(key === 39)"," {"," itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;"," }"," this._itemIndex = itemIndex;"," items = this.getSeriesItems(series, itemIndex);"," categoryItem = items.category;"," valueItem = items.value;"," total = series.getTotalValues();"," pct = Math.round((valueItem.value / total) * 10000)/100;"," if(categoryItem && valueItem)"," {"," msg += categoryItem.displayName + \": \" + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]) + \", \";"," msg += valueItem.displayName + \": \" + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]) + \", \"; "," msg += \"Percent of total \" + valueItem.displayName + \": \" + pct + \"%,\"; "," }"," else"," {"," msg += \"No data available,\";"," }"," msg += (itemIndex + 1) + \" of \" + len + \". \";"," return msg;"," }","}, {"," ATTRS: {"," /**"," * Sets the aria description for the chart."," *"," * @attribute ariaDescription"," * @type String"," */"," ariaDescription: {"," value: \"Use the left and right keys to navigate through items.\",",""," setter: function(val)"," {"," if(this._description)"," {"," this._description.setContent(\"\");"," this._description.appendChild(DOCUMENT.createTextNode(val));"," }"," return val;"," }"," },"," "," /**"," * Axes to appear in the chart. "," *"," * @attribute axes"," * @type Object"," */"," axes: {"," getter: function()"," {"," return this._axes;"," },",""," setter: function(val)"," {"," this._parseAxes(val);"," }"," },",""," /**"," * Collection of series to appear on the chart. This can be an array of Series instances or object literals"," * used to describe a Series instance."," *"," * @attribute seriesCollection"," * @type Array"," */"," seriesCollection: {"," getter: function()"," {"," return this._getSeriesCollection();"," },"," "," setter: function(val)"," {"," return this._setSeriesCollection(val);"," }"," },"," "," /**"," * Type of chart when there is no series collection specified."," *"," * @attribute type"," * @type String "," */"," type: {"," value: \"pie\""," }"," }","});","","","}, '3.7.2', {\"requires\": [\"dom\", \"datatype-number\", \"datatype-date\", \"event-custom\", \"event-mouseenter\", \"event-touch\", \"widget\", \"widget-position\", \"widget-stack\", \"graphics\"]});"];+_yuitest_coverage["build/charts-base/charts-base.js"].code=["YUI.add('charts-base', function (Y, NAME) {","","/**"," * The Charts widget provides an api for displaying data"," * graphically."," *"," * @module charts"," * @main charts"," */","","/**"," * The charts-base submodule contains the core functionality for the charts module."," *"," * @module charts"," * @submodule charts-base"," */","var CONFIG = Y.config,"," WINDOW = CONFIG.win,"," DOCUMENT = CONFIG.doc,"," Y_Lang = Y.Lang,"," IS_STRING = Y_Lang.isString,"," Y_DOM = Y.DOM,"," LeftAxisLayout,"," RightAxisLayout,"," BottomAxisLayout,"," TopAxisLayout,"," _getClassName = Y.ClassNameManager.getClassName,"," SERIES_MARKER = _getClassName(\"seriesmarker\"),"," ShapeGroup,"," CircleGroup,"," RectGroup,"," EllipseGroup,"," DiamondGroup;","","/**"," * Abstract class for creating groups of shapes with the same styles and dimensions."," *"," * @class ShapeGroup"," * @constructor"," */"," ShapeGroup = function(cfg)"," {"," ShapeGroup.superclass.constructor.apply(this, arguments);"," };"," "," ShapeGroup.NAME = \"shapeGroup\";",""," Y.extend(ShapeGroup, Y.Path, { "," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var xvalues = this.get(\"xvalues\"),"," yvalues = this.get(\"yvalues\"),"," x,"," y,"," xRad,"," yRad,"," i = 0,"," len,"," attrs = [],"," dimensions = this.get(\"dimensions\"),"," width = dimensions.width,"," height = dimensions.height,"," radius = dimensions.radius,"," yRadius = dimensions.yRadius,"," id = this.get(\"id\"),"," className = this.node.className,"," widthIsArray = Y_Lang.isArray(width),"," heightIsArray = Y_Lang.isArray(height),"," radiusIsArray = Y_Lang.isArray(radius),"," yRadiusIsArray = Y_Lang.isArray(yRadius);"," if(xvalues && yvalues && xvalues.length > 0)"," {"," this.clear();",""," len = xvalues.length;"," for(; i < len; ++i)"," {"," x = xvalues[i];"," y = yvalues[i];"," xRad = radiusIsArray ? radius[i] : radius;"," yRad = yRadiusIsArray ? yRadius[i] : yRadius;"," if(!isNaN(x) && !isNaN(y) && !isNaN(xRad))"," {"," this.drawShape({"," x: x,"," y: y,"," width: widthIsArray ? width[i] : width,"," height: heightIsArray ? height[i] : height,"," radius: xRad,"," yRadius: yRad "," });"," this.closePath();"," attrs[i] = {"," id: id + \"_\" + i,"," className: className,"," coords: (x - this._left) + \", \" + (y - this._top) + \", \" + radius,"," shape: \"circle\""," };"," }"," }"," this._closePath();"," }"," },",""," /**"," * Parses and array of lengths into radii"," *"," * @method _getRadiusCollection"," * @param {Array} val Array of lengths"," * @return Array"," * @private"," */"," _getRadiusCollection: function(val)"," {"," var i = 0,"," len = val.length,"," radii = [];"," for(; i < len; ++i)"," { "," radii[i] = val[i] * 0.5;"," }"," return radii;"," }"," });"," ","ShapeGroup.ATTRS = Y.merge(Y.Path.ATTRS, {"," dimensions: {"," getter: function()"," {"," var dimensions = this._dimensions,"," radius,"," yRadius,"," width,"," height;"," if(dimensions.hasOwnProperty(\"radius\"))"," {"," return dimensions;"," }"," else"," {"," width = dimensions.width;"," height = dimensions.height;"," radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);"," yRadius = Y_Lang.isArray(height) ? this._getRadiusCollection(height) : (height * 0.5);"," return {"," width: width,"," height: height,"," radius: radius,"," yRadius: yRadius"," };"," }"," },",""," setter: function(val)"," {"," this._dimensions = val;"," return val;"," }"," },"," xvalues: {"," getter: function()"," {"," return this._xvalues;"," },"," setter: function(val)"," {"," this._xvalues = val;"," }"," },"," yvalues: {"," getter: function()"," {"," return this._yvalues;"," },"," setter: function(val)"," {"," this._yvalues = val;"," }"," }","});","Y.ShapeGroup = ShapeGroup;","/**"," * Abstract class for creating groups of circles with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class CircleGroup"," * @constructor"," */"," CircleGroup = function(cfg)"," {"," CircleGroup.superclass.constructor.apply(this, arguments);"," };"," "," CircleGroup.NAME = \"circleGroup\";",""," Y.extend(CircleGroup, Y.ShapeGroup, { "," /**"," * Algorithm for drawing shape."," *"," * @method drawShape"," * @param {Object} cfg Parameters used to draw the shape."," */"," drawShape: function(cfg)"," {"," this.drawCircle(cfg.x, cfg.y, cfg.radius);"," }"," });","","CircleGroup.ATTRS = Y.merge(Y.ShapeGroup.ATTRS, {"," dimensions: {"," getter: function()"," {"," var dimensions = this._dimensions,"," radius,"," yRadius,"," width,"," height;"," if(dimensions.hasOwnProperty(\"radius\"))"," {"," return dimensions;"," }"," else"," {"," width = dimensions.width;"," height = dimensions.height;"," radius = Y_Lang.isArray(width) ? this._getRadiusCollection(width) : (width * 0.5);"," yRadius = radius;"," return {"," width: width,"," height: height,"," radius: radius,"," yRadius: yRadius"," };"," }"," }"," }","});"," ","CircleGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.CircleGroup = CircleGroup;","/**"," * Abstract class for creating groups of rects with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class GroupRect"," * @constructor"," */"," RectGroup = function(cfg)"," {"," RectGroup.superclass.constructor.apply(this, arguments);"," };"," "," RectGroup.NAME = \"rectGroup\";",""," Y.extend(RectGroup, Y.ShapeGroup, { "," /**"," * Updates the rect."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawRect(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","RectGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.RectGroup = RectGroup;","/**"," * Abstract class for creating groups of diamonds with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class GroupDiamond"," * @constructor"," */"," DiamondGroup = function(cfg)"," {"," DiamondGroup.superclass.constructor.apply(this, arguments);"," };"," "," DiamondGroup.NAME = \"diamondGroup\";",""," Y.extend(DiamondGroup, Y.ShapeGroup, { "," /**"," * Updates the diamond."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawDiamond(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","DiamondGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.DiamondGroup = DiamondGroup;","/**"," * Abstract class for creating groups of diamonds with the same styles and dimensions."," *"," * @module charts"," * @submodule charts-base"," * @class EllipseGroup"," * @constructor"," */"," EllipseGroup = function(cfg)"," {"," EllipseGroup.superclass.constructor.apply(this, arguments);"," };"," "," EllipseGroup.NAME = \"diamondGroup\";",""," Y.extend(EllipseGroup, Y.ShapeGroup, { "," /**"," * Updates the diamond."," *"," * @method _draw"," * @private"," */"," drawShape: function(cfg)"," {"," this.drawEllipse(cfg.x, cfg.y, cfg.width, cfg.height);"," }"," });"," ","EllipseGroup.ATTRS = Y.ShapeGroup.ATTRS;","Y.EllipseGroup = EllipseGroup;","/**"," * The Renderer class is a base class for chart components that use the `styles`"," * attribute."," *"," * @module charts"," * @submodule charts-base"," * @class Renderer"," * @constructor"," */","function Renderer(){}","","Renderer.ATTRS = {"," /**"," * Style properties for class"," * "," * @attribute styles"," * @type Object"," */"," styles:"," {"," getter: function()"," {"," this._styles = this._styles || this._getDefaultStyles();"," return this._styles;"," },",""," setter: function(val)"," {"," this._styles = this._setStyles(val);"," }"," },"," "," /**"," * The graphic in which drawings will be rendered."," *"," * @attribute graphic"," * @type Graphic"," */"," graphic: {}","};","Renderer.NAME = \"renderer\";","","Renderer.prototype = {"," /**"," * Storage for `styles` attribute."," *"," * @property _styles"," * @type Object"," * @private"," */"," _styles: null,"," "," /**"," * Method used by `styles` setter."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," * @protected"," */"," _setStyles: function(newstyles)"," {"," var styles = this.get(\"styles\");"," return this._mergeStyles(newstyles, styles);"," },"," "," /**"," * Merges to object literals so that only specified properties are "," * overwritten."," *"," * @method _mergeStyles"," * @param {Object} a Hash of new styles"," * @param {Object} b Hash of original styles"," * @return Object"," * @protected"," */"," _mergeStyles: function(a, b)"," {"," if(!b)"," {"," b = {};"," }"," var newstyles = Y.merge(b, {});"," Y.Object.each(a, function(value, key, a)"," {"," if(b.hasOwnProperty(key) && Y_Lang.isObject(value) && !Y_Lang.isFunction(value) && !Y_Lang.isArray(value))"," {"," newstyles[key] = this._mergeStyles(value, b[key]);"," }"," else"," {"," newstyles[key] = value;"," }"," }, this);"," return newstyles;"," },",""," /**"," * Gets the default value for the `styles` attribute. "," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," return {padding:{"," top:0,"," right: 0,"," bottom: 0,"," left: 0"," }};"," }","};","","Y.augment(Renderer, Y.Attribute);","Y.Renderer = Renderer;","","/**"," * Algorithmic strategy for rendering a left axis."," *"," * @module charts"," * @submodule charts-base"," * @class LeftAxisLayout"," * @constructor"," */","LeftAxisLayout = function() {};","","LeftAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 0,"," right: 4,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffset"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," "," switch(display)"," {"," case \"inside\" :"," host.set(\"rightTickOffset\", tickLength);"," host.set(\"leftTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"rightTickOffset\", 0);"," host.set(\"leftTickOffset\", tickLength);"," break;"," case \"cross\":"," host.set(\"rightTickOffset\", halfTick); "," host.set(\"leftTickOffset\", halfTick);"," break;"," default:"," host.set(\"rightTickOffset\", 0);"," host.set(\"leftTickOffset\", 0);"," break;"," }"," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt Point on the axis in which the tick will intersect."," * @param {Object} tickStyle Hash of properties to apply to the tick."," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:padding.left, y:pt.y},"," end = {x:tickLength + padding.left, y:pt.y};"," host.drawLine(path, start, end);"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @return {Object}"," * @protected"," */"," getLineStart: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:padding.left, y:0};"," if(display === \"outside\")"," {"," pt.x += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.x += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} point Point on the axis in which the tick will intersect."," * @return {Object} "," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x - this.get(\"leftTickOffset\"), y:point.y};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelWidth;"," }"," else if(absRot === 90)"," {"," max = labelHeight;"," }"," else"," {"," max = (cosRadians * labelWidth) + (sinRadians * labelHeight);"," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label width when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitWidth)"," {"," var host = this,"," w = host._explicitWidth,"," totalTitleSize = host._totalTitleSize,"," leftTickOffset = host.get(\"leftTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = w - (leftTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," w = bounds.right - bounds.left,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," x = (labelWidth * -0.5) + (w * 0.5),"," y = (host.get(\"height\") * 0.5) - (labelHeight * 0.5);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.left)"," {"," x += margin.left;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"leftTickOffset\"),"," totalTitleSize = this._totalTitleSize,"," leftOffset = pt.x + totalTitleSize - tickOffset,"," topOffset = pt.y,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," maxLabelSize = host._maxLabelSize,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(rot === 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset -= labelWidth * 0.5;"," }"," else if(rot === -90)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else"," {"," leftOffset -= labelWidth + (labelHeight * absRot/360);"," topOffset -= labelHeight * 0.5;"," }"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = Math.round(maxLabelSize + leftOffset);"," props.y = Math.round(topOffset);"," this._rotate(label, props);"," },",""," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," leftOffset,"," topOffset,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight;"," if(rot === 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," topOffset = 0;"," leftOffset = labelWidth * 0.5;"," }"," else if(rot === -90)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else"," {"," leftOffset = labelWidth + (labelHeight * absRot/360);"," topOffset = labelHeight * 0.5;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else if(rot === 90)"," {"," transformOrigin = [0.5, 0];"," }"," else if(rot === -90)"," {"," transformOrigin = [0.5, 1];"," }"," else"," {"," transformOrigin = [1, 0.5];"," }"," return transformOrigin;"," },",""," /**"," * Adjust the position of the Axis widget's content box for internal axes."," *"," * @method offsetNodeForTick"," * @param {Node} cb Content box of the Axis."," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," },",""," /**"," * Sets the width of the axis based on its contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," graphic = this.get(\"graphic\"),"," style = host.get(\"styles\"),"," label = style.label,"," tickOffset = host.get(\"leftTickOffset\"),"," max = host._maxLabelSize,"," totalTitleSize = this._totalTitleSize,"," ttl = Math.round(totalTitleSize + tickOffset + max + label.margin.right);"," if(this._explicitWidth)"," {"," ttl = this._explicitWidth;"," }"," this.set(\"calculatedWidth\", ttl);"," graphic.set(\"x\", ttl - tickOffset);"," }","};","","Y.LeftAxisLayout = LeftAxisLayout;","/**"," * RightAxisLayout contains algorithms for rendering a right axis."," *"," * @module charts"," * @submodule charts-base"," * @class RightAxisLayout"," * @constructor"," */","RightAxisLayout = function(){};","","RightAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 4,"," right: 0,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffset"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," "," switch(display)"," {"," case \"inside\" :"," host.set(\"leftTickOffset\", tickLength);"," host.set(\"rightTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", tickLength);"," break;"," case \"cross\" :"," host.set(\"rightTickOffset\", halfTick);"," host.set(\"leftTickOffset\", halfTick);"," break;"," default:"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);"," break;"," }"," },",""," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt Point on the axis in which the tick will intersect."," * @param {Object) tickStyle Hash of properties to apply to the tick."," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:padding.left, y:pt.y},"," end = {x:padding.left + tickLength, y:pt.y};"," host.drawLine(path, start, end);"," },"," "," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @return {Object}"," * @protected"," */"," getLineStart: function()"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:padding.left, y:padding.top};"," if(display === \"inside\")"," {"," pt.x += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.x += tickLength/2;"," }"," return pt;"," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} point Point on the axis in which the tick will intersect."," * @return {Object} "," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x + this.get(\"rightTickOffset\"), y:point.y};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelWidth;"," }"," else if(absRot === 90)"," {"," max = labelHeight;"," }"," else"," {"," max = (cosRadians * labelWidth) + (sinRadians * labelHeight);"," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label width when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitWidth)"," {"," var host = this,"," w = host._explicitWidth,"," totalTitleSize = this._totalTitleSize,"," rightTickOffset = host.get(\"rightTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = w - (rightTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," w = bounds.right - bounds.left,"," x = this.get(\"width\") - (labelWidth * 0.5) - (w * 0.5),"," y = (host.get(\"height\") * 0.5) - (labelHeight * 0.5);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.right)"," {"," x -= margin.left;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"rightTickOffset\"),"," labelStyles = styles.label,"," margin = 0,"," leftOffset = pt.x,"," topOffset = pt.y,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(labelStyles.margin && labelStyles.margin.left)"," {"," margin = labelStyles.margin.left;"," }"," if(rot === 0)"," {"," topOffset -= labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else if(rot === -90)"," {"," leftOffset -= labelWidth * 0.5;"," }"," else"," {"," topOffset -= labelHeight * 0.5;"," leftOffset += labelHeight/2 * absRot/90;"," }"," leftOffset += margin;"," leftOffset += tickOffset;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = Math.round(leftOffset);"," props.y = Math.round(topOffset);"," this._rotate(label, props);"," },"," "," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," leftOffset = 0,"," topOffset = 0,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight;"," if(rot === 0)"," {"," topOffset = labelHeight * 0.5;"," }"," else if(rot === 90)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else if(rot === -90)"," {"," leftOffset = labelWidth * 0.5;"," }"," else"," {"," topOffset = labelHeight * 0.5;"," leftOffset = labelHeight/2 * absRot/90;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },"," "," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else if(rot === 90)"," {"," transformOrigin = [0.5, 1];"," }"," else if(rot === -90)"," {"," transformOrigin = [0.5, 0];"," }"," else"," {"," transformOrigin = [0, 0.5];"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," var host = this,"," tickOffset = host.get(\"leftTickOffset\"),"," offset = 0 - tickOffset;"," cb.setStyle(\"left\", offset);"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," styles = host.get(\"styles\"),"," labelStyle = styles.label,"," totalTitleSize = this._totalTitleSize,"," ttl = Math.round(host.get(\"rightTickOffset\") + host._maxLabelSize + totalTitleSize + labelStyle.margin.left);"," if(this._explicitWidth)"," {"," ttl = this._explicitWidth;"," }"," host.set(\"calculatedWidth\", ttl);"," host.get(\"contentBox\").setStyle(\"width\", ttl);"," }","};","","Y.RightAxisLayout = RightAxisLayout;","/**"," * Contains algorithms for rendering a bottom axis."," *"," * @module charts"," * @submodule charts-base"," * @class BottomAxisLayout"," * @Constructor"," */","BottomAxisLayout = function(){};","","BottomAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 4,"," left: 0,"," right: 0,"," bottom: 0"," };"," },",""," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffsets"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);",""," switch(display)"," {"," case \"inside\" :"," host.set(\"topTickOffset\", tickLength);"," host.set(\"bottomTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", tickLength);"," break;"," case \"cross\":"," host.set(\"topTickOffset\", halfTick);"," host.set(\"bottomTickOffset\", halfTick);"," break;"," default:"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," break;"," }"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @protected"," */"," getLineStart: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:0, y:padding.top};"," if(display === \"inside\")"," {"," pt.y += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.y += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt hash containing x and y coordinates"," * @param {Object} tickStyles hash of properties used to draw the tick"," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:pt.x, y:padding.top},"," end = {x:pt.x, y:tickLength + padding.top};"," host.drawLine(path, start, end);"," },",""," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} pt Object containing x and y coordinates"," * @return Object"," * @protected"," */"," getLabelPoint: function(point)"," {"," return {x:point.x, y:point.y + this.get(\"bottomTickOffset\")};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelHeight;"," }"," else if(absRot === 90)"," {"," max = labelWidth;"," }"," else"," {"," max = (sinRadians * labelWidth) + (cosRadians * labelHeight); "," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },"," "," /**"," * Determines the available label height when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitHeight)"," {"," var host = this,"," h = host._explicitHeight,"," totalTitleSize = host._totalTitleSize,"," bottomTickOffset = host.get(\"bottomTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = h - (bottomTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," h = bounds.bottom - bounds.top,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," x = (host.get(\"width\") * 0.5) - (labelWidth * 0.5),"," y = host.get(\"height\") - labelHeight/2 - h/2;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.bottom)"," {"," y -= margin.bottom;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },"," "," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," tickOffset = host.get(\"bottomTickOffset\"),"," labelStyles = styles.label,"," margin = 0,"," props = host._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," leftOffset = Math.round(pt.x),"," topOffset = Math.round(pt.y),"," labelWidth = host._labelWidths[i],"," labelHeight = host._labelHeights[i];"," if(labelStyles.margin && labelStyles.margin.top)"," {"," margin = labelStyles.margin.top;"," }"," if(rot > 0)"," {"," topOffset -= labelHeight/2 * rot/90;"," }"," else if(rot < 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight/2 * absRot/90;"," }"," else"," {"," leftOffset -= labelWidth * 0.5;"," }"," topOffset += margin;"," topOffset += tickOffset;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," props.x = leftOffset;"," props.y = topOffset;"," host._rotate(label, props);"," },"," "," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight,"," leftOffset,"," topOffset;",""," if(rot > 0)"," {"," leftOffset = 0;"," topOffset = labelHeight/2 * rot/90;"," }"," else if(rot < 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight/2 * absRot/90;"," }"," else"," {"," leftOffset = labelWidth * 0.5;"," topOffset = 0;"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot > 0)"," {"," transformOrigin = [0, 0.5];"," }"," else if(rot < 0)"," {"," transformOrigin = [1, 0.5];"," }"," else"," {"," transformOrigin = [0, 0];"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," var host = this;"," host.get(\"contentBox\").setStyle(\"top\", 0 - host.get(\"topTickOffset\"));"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," styles = host.get(\"styles\"),"," labelStyle = styles.label,"," totalTitleSize = host._totalTitleSize,"," ttl = Math.round(host.get(\"bottomTickOffset\") + host._maxLabelSize + labelStyle.margin.top + totalTitleSize);"," if(host._explicitHeight)"," {"," ttl = host._explicitHeight;"," }"," host.set(\"calculatedHeight\", ttl);"," }","};","Y.BottomAxisLayout = BottomAxisLayout;","/**"," * Contains algorithms for rendering a top axis."," *"," * @module charts"," * @submodule charts-base"," * @class TopAxisLayout"," * @constructor"," */","TopAxisLayout = function(){};","","TopAxisLayout.prototype = {"," /**"," * Default margins for text fields."," *"," * @private"," * @method _getDefaultMargins"," * @return Object"," */"," _getDefaultMargins: function() "," {"," return {"," top: 0,"," left: 0,"," right: 0,"," bottom: 4"," };"," },"," "," /**"," * Sets the length of the tick on either side of the axis line."," *"," * @method setTickOffsets"," * @protected"," */"," setTickOffsets: function()"," {"," var host = this,"," majorTicks = host.get(\"styles\").majorTicks,"," tickLength = majorTicks.length,"," halfTick = tickLength * 0.5,"," display = majorTicks.display;"," host.set(\"leftTickOffset\", 0);"," host.set(\"rightTickOffset\", 0);"," switch(display)"," {"," case \"inside\" :"," host.set(\"bottomTickOffset\", tickLength);"," host.set(\"topTickOffset\", 0);"," break;"," case \"outside\" : "," host.set(\"bottomTickOffset\", 0);"," host.set(\"topTickOffset\", tickLength);"," break;"," case \"cross\" :"," host.set(\"topTickOffset\", halfTick);"," host.set(\"bottomTickOffset\", halfTick);"," break;"," default:"," host.set(\"topTickOffset\", 0);"," host.set(\"bottomTickOffset\", 0);"," break;"," }"," },",""," /**"," * Calculates the coordinates for the first point on an axis."," *"," * @method getLineStart"," * @protected"," */"," getLineStart: function()"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," majorTicks = style.majorTicks,"," tickLength = majorTicks.length,"," display = majorTicks.display,"," pt = {x:0, y:padding.top};"," if(display === \"outside\")"," {"," pt.y += tickLength;"," }"," else if(display === \"cross\")"," {"," pt.y += tickLength/2;"," }"," return pt; "," },"," "," /**"," * Draws a tick"," *"," * @method drawTick"," * @param {Path} path reference to the path `Path` element in which to draw the tick."," * @param {Object} pt hash containing x and y coordinates"," * @param {Object} tickStyles hash of properties used to draw the tick"," * @protected"," */"," drawTick: function(path, pt, tickStyles)"," {"," var host = this,"," style = host.get(\"styles\"),"," padding = style.padding,"," tickLength = tickStyles.length,"," start = {x:pt.x, y:padding.top},"," end = {x:pt.x, y:tickLength + padding.top};"," host.drawLine(path, start, end);"," },"," "," /**"," * Calculates the point for a label."," *"," * @method getLabelPoint"," * @param {Object} pt hash containing x and y coordinates"," * @return Object"," * @protected"," */"," getLabelPoint: function(pt)"," {"," return {x:pt.x, y:pt.y - this.get(\"topTickOffset\")};"," },"," "," /**"," * Updates the value for the `maxLabelSize` for use in calculating total size."," *"," * @method updateMaxLabelSize"," * @param {HTMLElement} label to measure"," * @protected"," */"," updateMaxLabelSize: function(labelWidth, labelHeight)"," {"," var host = this,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," sinRadians = props.sinRadians,"," cosRadians = props.cosRadians,"," max;"," if(rot === 0)"," {"," max = labelHeight;"," }"," else if(absRot === 90)"," {"," max = labelWidth;"," }"," else"," {"," max = (sinRadians * labelWidth) + (cosRadians * labelHeight); "," }"," host._maxLabelSize = Math.max(host._maxLabelSize, max);"," },",""," /**"," * Determines the available label height when the axis width has been explicitly set."," *"," * @method getExplicitlySized"," * @return Boolean"," * @protected"," */"," getExplicitlySized: function(styles)"," {"," if(this._explicitHeight)"," {"," var host = this,"," h = host._explicitHeight,"," totalTitleSize = host._totalTitleSize,"," topTickOffset = host.get(\"topTickOffset\"),"," margin = styles.label.margin.right;"," host._maxLabelSize = h - (topTickOffset + margin + totalTitleSize);"," return true;"," }"," return false;"," },",""," /**"," * Rotate and position title."," *"," * @method positionTitle"," * @param {HTMLElement} label to rotate position"," * @protected"," */"," positionTitle: function(label)"," {"," var host = this,"," bounds = host._titleBounds,"," margin = host.get(\"styles\").title.margin,"," props = host._titleRotationProps,"," labelWidth = label.offsetWidth,"," labelHeight = label.offsetHeight,"," h = bounds.bottom - bounds.top,"," x = (host.get(\"width\") * 0.5) - (labelWidth * 0.5),"," y = h/2 - labelHeight/2;"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," if(margin && margin.top)"," {"," y += margin.top;"," }"," props.x = x;"," props.y = y;"," props.transformOrigin = [0.5, 0.5];"," host._rotate(label, props);"," },",""," /**"," * Rotate and position labels."," *"," * @method positionLabel"," * @param {HTMLElement} label to rotate position"," * @param {Object} pt hash containing the x and y coordinates in which the label will be positioned"," * against."," * @protected"," */"," positionLabel: function(label, pt, styles, i)"," {"," var host = this,"," totalTitleSize = this._totalTitleSize,"," maxLabelSize = host._maxLabelSize,"," leftOffset = pt.x,"," topOffset = pt.y + totalTitleSize + maxLabelSize,"," props = this._labelRotationProps,"," rot = props.rot,"," absRot = props.absRot,"," labelWidth = this._labelWidths[i],"," labelHeight = this._labelHeights[i];"," if(rot === 0)"," {"," leftOffset -= labelWidth * 0.5;"," topOffset -= labelHeight;"," }"," else"," {"," if(rot === 90)"," {"," leftOffset -= labelWidth;"," topOffset -= (labelHeight * 0.5);"," }"," else if (rot === -90)"," {"," topOffset -= (labelHeight * 0.5);"," } "," else if(rot > 0)"," {"," leftOffset -= labelWidth;"," topOffset -= labelHeight - (labelHeight * rot/180);"," }"," else"," {"," topOffset -= labelHeight - (labelHeight * absRot/180);"," }"," }"," props.x = Math.round(leftOffset);"," props.y = Math.round(topOffset);"," props.labelWidth = labelWidth;"," props.labelHeight = labelHeight;"," this._rotate(label, props);"," },",""," /**"," * Adjusts the coordinates of an axis label based on the rotation."," *"," * @method _setRotationCoords"," * @param {Object} props Coordinates, dimension and rotation properties of the label."," * @protected"," */"," _setRotationCoords: function(props)"," {"," var rot = props.rot,"," absRot = props.absRot,"," labelWidth = props.labelWidth,"," labelHeight = props.labelHeight,"," leftOffset,"," topOffset;"," if(rot === 0)"," {"," leftOffset = labelWidth * 0.5;"," topOffset = labelHeight;"," }"," else"," {"," if(rot === 90)"," {"," leftOffset = labelWidth;"," topOffset = (labelHeight * 0.5);"," }"," else if (rot === -90)"," {"," topOffset = (labelHeight * 0.5);"," } "," else if(rot > 0)"," {"," leftOffset = labelWidth;"," topOffset = labelHeight - (labelHeight * rot/180);"," }"," else"," {"," topOffset = labelHeight - (labelHeight * absRot/180);"," }"," }"," props.x -= leftOffset;"," props.y -= topOffset;"," },",""," /**"," * Returns the transformOrigin to use for an axis label based on the position of the axis "," * and the rotation of the label."," *"," * @method _getTransformOrigin"," * @param {Number} rot The rotation (in degrees) of the label."," * @return Array"," * @protected"," */"," _getTransformOrigin: function(rot)"," {"," var transformOrigin;"," if(rot === 0)"," {"," transformOrigin = [0, 0];"," }"," else"," {"," if(rot === 90)"," {"," transformOrigin = [1, 0.5];"," }"," else if (rot === -90)"," {"," transformOrigin = [0, 0.5];"," } "," else if(rot > 0)"," {"," transformOrigin = [1, 0.5];"," }"," else"," {"," transformOrigin = [0, 0.5];"," }"," }"," return transformOrigin;"," },",""," /**"," * Adjusts position for inner ticks."," *"," * @method offsetNodeForTick"," * @param {Node} cb contentBox of the axis"," * @protected"," */"," offsetNodeForTick: function(cb)"," {"," },",""," /**"," * Assigns a height based on the size of the contents."," *"," * @method setCalculatedSize"," * @protected"," */"," setCalculatedSize: function()"," {"," var host = this,"," graphic = host.get(\"graphic\"),"," styles = host.get(\"styles\"),"," labelMargin = styles.label.margin,"," totalLabelSize = labelMargin.bottom + host._maxLabelSize,"," totalTitleSize = host._totalTitleSize,"," topTickOffset = this.get(\"topTickOffset\"),"," ttl = Math.round(topTickOffset + totalLabelSize + totalTitleSize);"," if(this._explicitHeight)"," {"," ttl = this._explicitWidth; "," }"," host.set(\"calculatedHeight\", ttl);"," graphic.set(\"y\", ttl - topTickOffset);"," }","};","Y.TopAxisLayout = TopAxisLayout;","","/**"," * The Axis class. Generates axes for a chart."," *"," * @module charts"," * @submodule charts-base"," * @class Axis"," * @extends Widget"," * @uses Renderer"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," */","Y.Axis = Y.Base.create(\"axis\", Y.Widget, [Y.Renderer], {"," /**"," * Storage for calculatedWidth value."," *"," * @property _calculatedWidth"," * @type Number"," * @private"," */"," _calculatedWidth: 0,",""," /**"," * Storage for calculatedHeight value."," *"," * @property _calculatedHeight"," * @type Number"," * @private"," */"," _calculatedHeight: 0,",""," /**"," * Handles change to the dataProvider"," * "," * @method _dataChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _dataChangeHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawAxis();"," }"," },",""," /**"," * Handles change to the position attribute"," *"," * @method _positionChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _positionChangeHandler: function(e)"," {"," this._updateGraphic(e.newVal);"," this._updateHandler();"," },",""," /**"," * Updates the the Graphic instance"," *"," * @method _updateGraphic"," * @param {String} position Position of axis "," * @private"," */"," _updateGraphic: function(position)"," {"," var graphic = this.get(\"graphic\");"," if(position == \"none\")"," {"," if(graphic)"," {"," graphic.destroy();"," }"," }"," else"," {"," if(!graphic)"," {"," this._setCanvas();"," }"," }"," },",""," /**"," * Handles changes to axis."," *"," * @method _updateHandler"," * @param {Object} e Event object"," * @private"," */"," _updateHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawAxis();"," }"," },"," "," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," this._updateGraphic(this.get(\"position\"));"," },",""," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var layout = this._layout,"," defaultMargins,"," styles,"," label,"," title,"," i;"," if(layout)"," {"," defaultMargins = layout._getDefaultMargins();"," styles = this.get(\"styles\");"," label = styles.label.margin;"," title =styles.title.margin;"," //need to defaultMargins method to the layout classes."," for(i in defaultMargins)"," {"," if(defaultMargins.hasOwnProperty(i))"," {"," label[i] = label[i] === undefined ? defaultMargins[i] : label[i];"," title[i] = title[i] === undefined ? defaultMargins[i] : title[i];"," }"," }"," }"," this._drawAxis();"," },",""," /**"," * Creates a graphic instance to be used for the axis line and ticks."," *"," * @method _setCanvas"," * @private"," */"," _setCanvas: function()"," {"," var cb = this.get(\"contentBox\"),"," bb = this.get(\"boundingBox\"),"," p = this.get(\"position\"),"," pn = this._parentNode,"," w = this.get(\"width\"),"," h = this.get(\"height\");"," bb.setStyle(\"position\", \"absolute\");"," bb.setStyle(\"zIndex\", 2);"," w = w ? w + \"px\" : pn.getStyle(\"width\");"," h = h ? h + \"px\" : pn.getStyle(\"height\");"," if(p === \"top\" || p === \"bottom\")"," {"," cb.setStyle(\"width\", w);"," }"," else"," {"," cb.setStyle(\"height\", h);"," }"," cb.setStyle(\"position\", \"relative\");"," cb.setStyle(\"left\", \"0px\");"," cb.setStyle(\"top\", \"0px\");"," this.set(\"graphic\", new Y.Graphic());"," this.get(\"graphic\").render(cb);"," },"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var axisstyles = {"," majorTicks: {"," display:\"inside\","," length:4,"," color:\"#dad8c9\","," weight:1,"," alpha:1"," },"," minorTicks: {"," display:\"none\","," length:2,"," color:\"#dad8c9\","," weight:1"," },"," line: {"," weight:1,"," color:\"#dad8c9\","," alpha:1"," },"," majorUnit: {"," determinant:\"count\","," count:11,"," distance:75"," },"," top: \"0px\","," left: \"0px\","," width: \"100px\","," height: \"100px\","," label: {"," color:\"#808080\","," alpha: 1,"," fontSize:\"85%\","," rotation: 0,"," margin: {"," top: undefined,"," right: undefined,"," bottom: undefined,"," left: undefined"," }"," },"," title: {"," color:\"#808080\","," alpha: 1,"," fontSize:\"85%\","," rotation: undefined,"," margin: {"," top: undefined,"," right: undefined,"," bottom: undefined,"," left: undefined"," }"," },"," hideOverlappingLabelTicks: false"," };"," "," return Y.merge(Y.Renderer.prototype._getDefaultStyles(), axisstyles); "," },",""," /**"," * Updates the axis when the size changes."," *"," * @method _handleSizeChange"," * @param {Object} e Event object."," * @private"," */"," _handleSizeChange: function(e)"," {"," var attrName = e.attrName,"," pos = this.get(\"position\"),"," vert = pos == \"left\" || pos == \"right\","," cb = this.get(\"contentBox\"),"," hor = pos == \"bottom\" || pos == \"top\";"," cb.setStyle(\"width\", this.get(\"width\"));"," cb.setStyle(\"height\", this.get(\"height\"));"," if((hor && attrName == \"width\") || (vert && attrName == \"height\"))"," {"," this._drawAxis();"," }"," },"," "," /**"," * Maps key values to classes containing layout algorithms"," *"," * @property _layoutClasses"," * @type Object"," * @private"," */"," _layoutClasses: "," {"," top : TopAxisLayout,"," bottom: BottomAxisLayout,"," left: LeftAxisLayout,"," right : RightAxisLayout"," },"," "," /**"," * Draws a line segment between 2 points"," *"," * @method drawLine"," * @param {Object} startPoint x and y coordinates for the start point of the line segment"," * @param {Object} endPoint x and y coordinates for the for the end point of the line segment"," * @param {Object} line styles (weight, color and alpha to be applied to the line segment)"," * @private"," */"," drawLine: function(path, startPoint, endPoint)"," {"," path.moveTo(startPoint.x, startPoint.y);"," path.lineTo(endPoint.x, endPoint.y);"," },",""," /**"," * Generates the properties necessary for rotating and positioning a text field."," *"," * @method _getTextRotationProps"," * @param {Object} styles properties for the text field"," * @return Object"," * @private"," */"," _getTextRotationProps: function(styles)"," {"," if(styles.rotation === undefined)"," {"," switch(this.get(\"position\"))"," {"," case \"left\" :"," styles.rotation = -90;"," break; "," case \"right\" : "," styles.rotation = 90;"," break;"," default :"," styles.rotation = 0;"," break;"," }"," }"," var rot = Math.min(90, Math.max(-90, styles.rotation)),"," absRot = Math.abs(rot),"," radCon = Math.PI/180,"," sinRadians = parseFloat(parseFloat(Math.sin(absRot * radCon)).toFixed(8)),"," cosRadians = parseFloat(parseFloat(Math.cos(absRot * radCon)).toFixed(8));"," return {"," rot: rot,"," absRot: absRot,"," radCon: radCon,"," sinRadians: sinRadians,"," cosRadians: cosRadians,"," textAlpha: styles.alpha"," };"," },",""," /**"," * Draws an axis. "," *"," * @method _drawAxis"," * @private"," */"," _drawAxis: function ()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," if(this._layout)"," {"," var styles = this.get(\"styles\"),"," line = styles.line,"," labelStyles = styles.label,"," majorTickStyles = styles.majorTicks,"," drawTicks = majorTickStyles.display != \"none\","," tickPoint,"," majorUnit = styles.majorUnit,"," len,"," majorUnitDistance,"," i = 0,"," layout = this._layout,"," layoutLength,"," position,"," lineStart,"," label,"," labelWidth,"," labelHeight,"," labelFunction = this.get(\"labelFunction\"),"," labelFunctionScope = this.get(\"labelFunctionScope\"),"," labelFormat = this.get(\"labelFormat\"),"," graphic = this.get(\"graphic\"),"," path = this.get(\"path\"),"," tickPath,"," explicitlySized;"," this._labelWidths = [];"," this._labelHeights = [];"," graphic.set(\"autoDraw\", false);"," path.clear();"," path.set(\"stroke\", {"," weight: line.weight, "," color: line.color, "," opacity: line.alpha"," });"," this._labelRotationProps = this._getTextRotationProps(labelStyles);"," this._labelRotationProps.transformOrigin = layout._getTransformOrigin(this._labelRotationProps.rot);"," layout.setTickOffsets.apply(this);"," layoutLength = this.getLength();"," lineStart = layout.getLineStart.apply(this);"," len = this.getTotalMajorUnits(majorUnit);"," majorUnitDistance = this.getMajorUnitDistance(len, layoutLength, majorUnit);"," this.set(\"edgeOffset\", this.getEdgeOffset(len, layoutLength) * 0.5);"," if(len < 1)"," {"," this._clearLabelCache();"," }"," else"," {"," tickPoint = this.getFirstPoint(lineStart);"," this.drawLine(path, lineStart, this.getLineEnd(tickPoint));"," if(drawTicks) "," {"," tickPath = this.get(\"tickPath\");"," tickPath.clear();"," tickPath.set(\"stroke\", {"," weight: majorTickStyles.weight,"," color: majorTickStyles.color,"," opacity: majorTickStyles.alpha"," });"," layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);"," }"," this._createLabelCache();"," this._tickPoints = [];"," this._maxLabelSize = 0; "," this._totalTitleSize = 0;"," this._titleSize = 0;"," this._setTitle();"," explicitlySized = layout.getExplicitlySized.apply(this, [styles]);"," for(; i < len; ++i)"," {"," if(drawTicks) "," {"," layout.drawTick.apply(this, [tickPath, tickPoint, majorTickStyles]);"," }"," position = this.getPosition(tickPoint);"," label = this.getLabel(tickPoint, labelStyles);"," this._labels.push(label);"," this._tickPoints.push({x:tickPoint.x, y:tickPoint.y});"," this.get(\"appendLabelFunction\")(label, labelFunction.apply(labelFunctionScope, [this.getLabelByIndex(i, len), labelFormat]));"," labelWidth = Math.round(label.offsetWidth);"," labelHeight = Math.round(label.offsetHeight);"," if(!explicitlySized)"," {"," this._layout.updateMaxLabelSize.apply(this, [labelWidth, labelHeight]);"," }"," this._labelWidths.push(labelWidth);"," this._labelHeights.push(labelHeight);"," tickPoint = this.getNextPoint(tickPoint, majorUnitDistance);"," }"," this._clearLabelCache();"," if(this.get(\"overlapGraph\"))"," {"," layout.offsetNodeForTick.apply(this, [this.get(\"contentBox\")]);"," }"," layout.setCalculatedSize.apply(this);"," if(this._titleTextField)"," {"," this._layout.positionTitle.apply(this, [this._titleTextField]);"," }"," for(i = 0; i < len; ++i)"," {"," layout.positionLabel.apply(this, [this.get(\"labels\")[i], this._tickPoints[i], styles, i]);"," }"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawAxis();"," }"," else"," {"," this._updatePathElement();"," this.fire(\"axisRendered\");"," }"," },"," "," /**"," * Calculates and sets the total size of a title."," *"," * @method _setTotalTitleSize"," * @param {Object} styles Properties for the title field."," * @private"," */"," _setTotalTitleSize: function(styles)"," {"," var title = this._titleTextField,"," w = title.offsetWidth,"," h = title.offsetHeight,"," rot = this._titleRotationProps.rot,"," bounds,"," size,"," margin = styles.margin,"," position = this.get(\"position\"),"," matrix = new Y.Matrix();"," matrix.rotate(rot);"," bounds = matrix.getContentRect(w, h);"," if(position == \"left\" || position == \"right\")"," {"," size = bounds.right - bounds.left;"," if(margin)"," {"," size += margin.left + margin.right;"," }"," }"," else"," {"," size = bounds.bottom - bounds.top;"," if(margin)"," {"," size += margin.top + margin.bottom;"," }"," }"," this._titleBounds = bounds;"," this._totalTitleSize = size;"," },",""," /**"," * Updates path."," *"," * @method _updatePathElement"," * @private"," */"," _updatePathElement: function()"," {"," var path = this._path,"," tickPath = this._tickPath,"," redrawGraphic = false,"," graphic = this.get(\"graphic\");"," if(path)"," {"," redrawGraphic = true;"," path.end();"," }"," if(tickPath)"," {"," redrawGraphic = true;"," tickPath.end();"," }"," if(redrawGraphic)"," {"," graphic._redraw();"," }"," },",""," /**"," * Updates the content and style properties for a title field."," *"," * @method _updateTitle"," * @private"," */"," _setTitle: function()"," {"," var i,"," styles,"," customStyles,"," title = this.get(\"title\"),"," titleTextField = this._titleTextField,"," parentNode;"," if(title !== null && title !== undefined)"," {"," customStyles = {"," rotation: \"rotation\","," margin: \"margin\","," alpha: \"alpha\""," };"," styles = this.get(\"styles\").title;"," if(!titleTextField)"," {"," titleTextField = DOCUMENT.createElement('span');"," titleTextField.style.display = \"block\";"," titleTextField.style.whiteSpace = \"nowrap\";"," titleTextField.setAttribute(\"class\", \"axisTitle\");"," this.get(\"contentBox\").append(titleTextField);"," }"," else if(!DOCUMENT.createElementNS)"," {"," if(titleTextField.style.filter)"," {"," titleTextField.style.filter = null;"," }"," }"," titleTextField.style.position = \"absolute\";"," for(i in styles)"," {"," if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))"," {"," titleTextField.style[i] = styles[i];"," }"," }"," this.get(\"appendTitleFunction\")(titleTextField, title);"," this._titleTextField = titleTextField;"," this._titleRotationProps = this._getTextRotationProps(styles);"," this._setTotalTitleSize(styles);"," }"," else if(titleTextField)"," {"," parentNode = titleTextField.parentNode;"," if(parentNode)"," {"," parentNode.removeChild(titleTextField);"," }"," this._titleTextField = null;"," this._totalTitleSize = 0;"," }"," },",""," /**"," * Creates or updates an axis label."," *"," * @method getLabel"," * @param {Object} pt x and y coordinates for the label"," * @param {Object} styles styles applied to label"," * @return HTMLElement "," * @private"," */"," getLabel: function(pt, styles)"," {"," var i,"," label,"," labelCache = this._labelCache,"," customStyles = {"," rotation: \"rotation\","," margin: \"margin\","," alpha: \"alpha\""," };"," if(labelCache && labelCache.length > 0)"," {"," label = labelCache.shift();"," }"," else"," {"," label = DOCUMENT.createElement(\"span\");"," label.className = Y.Lang.trim([label.className, \"axisLabel\"].join(' '));"," this.get(\"contentBox\").append(label);"," }"," if(!DOCUMENT.createElementNS)"," {"," if(label.style.filter)"," {"," label.style.filter = null;"," }"," }"," label.style.display = \"block\";"," label.style.whiteSpace = \"nowrap\";"," label.style.position = \"absolute\";"," for(i in styles)"," {"," if(styles.hasOwnProperty(i) && !customStyles.hasOwnProperty(i))"," {"," label.style[i] = styles[i];"," }"," }"," return label;"," },",""," /**"," * Creates a cache of labels that can be re-used when the axis redraws."," *"," * @method _createLabelCache"," * @private"," */"," _createLabelCache: function()"," {"," if(this._labels)"," {"," while(this._labels.length > 0)"," {"," this._labelCache.push(this._labels.shift());"," }"," }"," else"," {"," this._clearLabelCache();"," }"," this._labels = [];"," },"," "," /**"," * Removes axis labels from the dom and clears the label cache."," *"," * @method _clearLabelCache"," * @private"," */"," _clearLabelCache: function()"," {"," if(this._labelCache)"," {"," var len = this._labelCache.length,"," i = 0,"," label;"," for(; i < len; ++i)"," {"," label = this._labelCache[i];"," this._removeChildren(label);"," Y.Event.purgeElement(label, true);"," label.parentNode.removeChild(label);"," }"," }"," this._labelCache = [];"," },",""," /**"," * Gets the end point of an axis."," *"," * @method getLineEnd"," * @return Object"," * @private "," */"," getLineEnd: function(pt)"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," return {x:w, y:pt.y};"," }"," else"," {"," return {x:pt.x, y:h};"," }"," },",""," /**"," * Calcuates the width or height of an axis depending on its direction."," *"," * @method getLength"," * @return Number"," * @private"," */"," getLength: function()"," {"," var l,"," style = this.get(\"styles\"),"," padding = style.padding,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," l = w - (padding.left + padding.right);"," }"," else"," {"," l = h - (padding.top + padding.bottom);"," }"," return l;"," },",""," /**"," * Gets the position of the first point on an axis."," *"," * @method getFirstPoint"," * @param {Object} pt Object containing x and y coordinates."," * @return Object"," * @private"," */"," getFirstPoint:function(pt)"," {"," var style = this.get(\"styles\"),"," pos = this.get(\"position\"),"," padding = style.padding,"," np = {x:pt.x, y:pt.y};"," if(pos === \"top\" || pos === \"bottom\")"," {"," np.x += padding.left + this.get(\"edgeOffset\");"," }"," else"," {"," np.y += this.get(\"height\") - (padding.top + this.get(\"edgeOffset\"));"," }"," return np;"," },",""," /**"," * Gets the position of the next point on an axis."," *"," * @method getNextPoint"," * @param {Object} point Object containing x and y coordinates."," * @param {Number} majorUnitDistance Distance in pixels between ticks."," * @return Object"," * @private"," */"," getNextPoint: function(point, majorUnitDistance)"," {"," var pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," point.x = point.x + majorUnitDistance; "," }"," else"," {"," point.y = point.y - majorUnitDistance;"," }"," return point;"," },",""," /**"," * Calculates the placement of last tick on an axis."," *"," * @method getLastPoint"," * @return Object"," * @private "," */"," getLastPoint: function()"," {"," var style = this.get(\"styles\"),"," padding = style.padding,"," w = this.get(\"width\"),"," pos = this.get(\"position\");"," if(pos === \"top\" || pos === \"bottom\")"," {"," return {x:w - padding.right, y:padding.top};"," }"," else"," {"," return {x:padding.left, y:padding.top};"," }"," },",""," /**"," * Calculates position on the axis."," *"," * @method getPosition"," * @param {Object} point contains x and y values"," * @private "," */"," getPosition: function(point)"," {"," var p,"," h = this.get(\"height\"),"," style = this.get(\"styles\"),"," padding = style.padding,"," pos = this.get(\"position\"),"," dataType = this.get(\"dataType\");"," if(pos === \"left\" || pos === \"right\") "," {"," //Numeric data on a vertical axis is displayed from bottom to top."," //Categorical and Timeline data is displayed from top to bottom."," if(dataType === \"numeric\")"," {"," p = (h - (padding.top + padding.bottom)) - (point.y - padding.top);"," }"," else"," {"," p = point.y - padding.top;"," }"," }"," else"," {"," p = point.x - padding.left;"," }"," return p;"," },",""," /**"," * Rotates and positions a text field."," *"," * @method _rotate"," * @param {HTMLElement} label text field to rotate and position"," * @param {Object} props properties to be applied to the text field. "," * @private"," */"," _rotate: function(label, props)"," {"," var rot = props.rot,"," x = props.x,"," y = props.y,"," filterString,"," textAlpha,"," matrix = new Y.Matrix(),"," transformOrigin = props.transformOrigin || [0, 0],"," offsetRect;"," if(DOCUMENT.createElementNS)"," {"," matrix.translate(x, y);"," matrix.rotate(rot);"," Y_DOM.setStyle(label, \"transformOrigin\", (transformOrigin[0] * 100) + \"% \" + (transformOrigin[1] * 100) + \"%\");"," Y_DOM.setStyle(label, \"transform\", matrix.toCSSText());"," }"," else"," {"," textAlpha = props.textAlpha;"," if(Y_Lang.isNumber(textAlpha) && textAlpha < 1 && textAlpha > -1 && !isNaN(textAlpha))"," {"," filterString = \"progid:DXImageTransform.Microsoft.Alpha(Opacity=\" + Math.round(textAlpha * 100) + \")\";"," }"," if(rot !== 0)"," {"," //ms filters kind of, sort of uses a transformOrigin of 0, 0. "," //we'll translate the difference to create a true 0, 0 origin."," matrix.rotate(rot);"," offsetRect = matrix.getContentRect(props.labelWidth, props.labelHeight);"," matrix.init();"," matrix.translate(offsetRect.left, offsetRect.top);"," matrix.translate(x, y);"," this._simulateRotateWithTransformOrigin(matrix, rot, transformOrigin, props.labelWidth, props.labelHeight);"," if(filterString)"," {"," filterString += \" \";"," }"," else"," {"," filterString = \"\"; "," }"," filterString += matrix.toFilterText();"," label.style.left = matrix.dx + \"px\";"," label.style.top = matrix.dy + \"px\";"," }"," else"," {"," label.style.left = x + \"px\";"," label.style.top = y + \"px\";"," }"," if(filterString)"," {"," label.style.filter = filterString;"," }"," }"," },"," "," /**"," * Simulates a rotation with a specified transformOrigin. "," *"," * @method _simulateTransformOrigin"," * @param {Matrix} matrix Reference to a `Matrix` instance."," * @param {Number} rot The rotation (in degrees) that will be performed on a matrix."," * @param {Array} transformOrigin An array represeniting the origin in which to perform the transform. The first "," * index represents the x origin and the second index represents the y origin."," * @param {Number} w The width of the object that will be transformed."," * @param {Number} h The height of the object that will be transformed."," * @private"," */"," _simulateRotateWithTransformOrigin: function(matrix, rot, transformOrigin, w, h)"," {"," var transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h;"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," matrix.rotate(rot);"," matrix.translate(-transformX, -transformY);"," },",""," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of the last label. "," *"," * @method getMaxLabelBounds"," * @return Object"," */"," getMaxLabelBounds: function()"," {"," return this._getLabelBounds(this.getMaximumValue());"," },",""," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of the first label. "," *"," * @method getMinLabelBounds"," * @return Object"," */"," getMinLabelBounds: function()"," {"," return this._getLabelBounds(this.getMinimumValue());"," },"," "," /**"," * Returns the coordinates (top, right, bottom, left) for the bounding box of a label. "," *"," * @method _getLabelBounds"," * @param {String} Value of the label"," * @return Object"," * @private"," */"," _getLabelBounds: function(val)"," {"," var layout = this._layout,"," labelStyles = this.get(\"styles\").label,"," matrix = new Y.Matrix(),"," label,"," props = this._getTextRotationProps(labelStyles);"," props.transformOrigin = layout._getTransformOrigin(props.rot);"," label = this.getLabel({x: 0, y: 0}, labelStyles);"," this.get(\"appendLabelFunction\")(label, this.get(\"labelFunction\").apply(this, [val, this.get(\"labelFormat\")]));"," props.labelWidth = label.offsetWidth;"," props.labelHeight = label.offsetHeight;"," this._removeChildren(label);"," Y.Event.purgeElement(label, true);"," label.parentNode.removeChild(label);"," props.x = 0;"," props.y = 0;"," layout._setRotationCoords(props);"," matrix.translate(props.x, props.y);"," this._simulateRotateWithTransformOrigin(matrix, props.rot, props.transformOrigin, props.labelWidth, props.labelHeight);"," return matrix.getContentRect(props.labelWidth, props.labelHeight);"," },",""," /**"," * Removes all DOM elements from an HTML element. Used to clear out labels during detruction"," * phase."," *"," * @method _removeChildren"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },"," "," /**"," * Destructor implementation Axis class. Removes all labels and the Graphic instance from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var cb = this.get(\"contentBox\").getDOMNode(),"," labels = this.get(\"labels\"),"," graphic = this.get(\"graphic\"),"," label,"," len = labels ? labels.length : 0;"," if(len > 0)"," {"," while(labels.length > 0)"," {"," label = labels.shift();"," this._removeChildren(label);"," cb.removeChild(label);"," label = null;"," }"," }"," if(graphic)"," {"," graphic.destroy();"," }"," },",""," /**"," * Length in pixels of largest text bounding box. Used to calculate the height of the axis."," *"," * @property maxLabelSize"," * @type Number"," * @protected"," */"," _maxLabelSize: 0,"," "," /**"," * Updates the content of text field. This method writes a value into a text field using "," * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. "," *"," * @method _setText"," * @param label {HTMLElement} label to be updated"," * @param val {String} value with which to update the label"," * @private"," */"," _setText: function(textField, val)"," { "," textField.innerHTML = \"\";"," if(Y_Lang.isNumber(val))"," {"," val = val + \"\";"," }"," else if(!val)"," {"," val = \"\";"," }"," if(IS_STRING(val))"," {"," val = DOCUMENT.createTextNode(val);"," }"," textField.appendChild(val);"," }","}, {"," ATTRS: "," {"," /**"," * When set, defines the width of a vertical axis instance. By default, vertical axes automatically size based on their contents. When the"," * width attribute is set, the axis will not calculate its width. When the width attribute is explicitly set, axis labels will postion themselves off of the "," * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified width is less than the sum of "," * the axis' contents, excess content will overflow."," *"," * @attribute width"," * @type Number"," */"," width: {"," lazyAdd: false,",""," getter: function() "," {"," if(this._explicitWidth)"," {"," return this._explicitWidth; "," }"," return this._calculatedWidth;"," },",""," setter: function(val)"," {"," this._explicitWidth = val;"," return val;"," }"," },",""," /**"," * When set, defines the height of a horizontal axis instance. By default, horizontal axes automatically size based on their contents. When the"," * height attribute is set, the axis will not calculate its height. When the height attribute is explicitly set, axis labels will postion themselves off of the "," * the inner edge of the axis and the title, if present, will position itself off of the outer edge. If a specified height is less than the sum of "," * the axis' contents, excess content will overflow."," *"," * @attribute height"," * @type Number"," */"," height: {"," lazyAdd: false,",""," getter: function() "," {"," if(this._explicitHeight)"," {"," return this._explicitHeight; "," }"," return this._calculatedHeight;"," },",""," setter: function(val)"," {"," this._explicitHeight = val;"," return val;"," }"," },",""," /**"," * Calculated value of an axis' width. By default, the value is used internally for vertical axes. If the `width` attribute is explicitly set, this value will be ignored."," *"," * @attribute calculatedWidth"," * @type Number"," * @private"," */"," calculatedWidth: {"," getter: function()"," {"," return this._calculatedWidth;"," },",""," setter: function(val)"," {"," this._calculatedWidth = val;"," return val;"," }"," },",""," /**"," * Calculated value of an axis' height. By default, the value is used internally for horizontal axes. If the `height` attribute is explicitly set, this value will be ignored."," *"," * @attribute calculatedHeight"," * @type Number"," * @private"," */"," calculatedHeight: {"," getter: function()"," {"," return this._calculatedHeight;"," },",""," setter: function(val)"," {"," this._calculatedHeight = val;"," return val;"," }"," },",""," /**"," * Difference betweend the first/last tick and edge of axis."," *"," * @attribute edgeOffset"," * @type Number"," * @protected"," */"," edgeOffset: "," {"," value: 0"," },",""," /**"," * The graphic in which the axis line and ticks will be rendered."," *"," * @attribute graphic"," * @type Graphic"," */"," graphic: {},"," "," /**"," * @attribute path"," * @type Shape"," * @readOnly"," * @private"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," if(!this._path)"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," this._path = graphic.addShape({type:\"path\"});"," }"," }"," return this._path;"," }"," },",""," /**"," * @attribute tickPath"," * @type Shape"," * @readOnly"," * @private"," */"," tickPath: {"," readOnly: true,",""," getter: function()"," {"," if(!this._tickPath)"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," this._tickPath = graphic.addShape({type:\"path\"});"," }"," }"," return this._tickPath;"," }"," },"," "," /**"," * Contains the contents of the axis. "," *"," * @attribute node"," * @type HTMLElement"," */"," node: {},",""," /**"," * Direction of the axis."," *"," * @attribute position"," * @type String"," */"," position: {"," setter: function(val)"," {"," var layoutClass = this._layoutClasses[val];"," if(val && val != \"none\")"," {"," this._layout = new layoutClass();"," }"," return val;"," }"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the top of the axis."," *"," * @attribute topTickOffset"," * @type Number"," */"," topTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the bottom of the axis."," *"," * @attribute bottomTickOffset"," * @type Number"," */"," bottomTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the left of the axis."," *"," * @attribute leftTickOffset"," * @type Number"," */"," leftTickOffset: {"," value: 0"," },",""," /**"," * Distance determined by the tick styles used to calculate the distance between the axis"," * line in relation to the right side of the axis."," *"," * @attribute rightTickOffset"," * @type Number"," */"," rightTickOffset: {"," value: 0"," },"," "," /**"," * Collection of labels used to render the axis."," *"," * @attribute labels"," * @type Array"," */"," labels: {"," readOnly: true,"," getter: function()"," {"," return this._labels;"," }"," },",""," /**"," * Collection of points used for placement of labels and ticks along the axis."," *"," * @attribute tickPoints"," * @type Array"," */"," tickPoints: {"," readOnly: true,",""," getter: function()"," {"," if(this.get(\"position\") == \"none\")"," {"," return this.get(\"styles\").majorUnit.count;"," }"," return this._tickPoints;"," }"," },",""," /**"," * Indicates whether the axis overlaps the graph. If an axis is the inner most axis on a given"," * position and the tick position is inside or cross, the axis will need to overlap the graph."," *"," * @attribute overlapGraph"," * @type Boolean"," */"," overlapGraph: {"," value:true,",""," validator: function(val)"," {"," return Y_Lang.isBoolean(val);"," }"," },",""," /**"," * Object which should have by the labelFunction"," *"," * @attribute labelFunctionScope"," * @type Object"," */"," labelFunctionScope: {},"," "," /**"," * Length in pixels of largest text bounding box. Used to calculate the height of the axis."," *"," * @attribute maxLabelSize"," * @type Number"," * @protected"," */"," maxLabelSize: {"," getter: function()"," {"," return this._maxLabelSize;"," },",""," setter: function(val)"," {"," this._maxLabelSize = val;"," return val; "," }"," },"," "," /**"," * Title for the axis. When specified, the title will display. The position of the title is determined by the axis position. "," * <dl>"," * <dt>top</dt><dd>Appears above the axis and it labels. The default rotation is 0.</dd>"," * <dt>right</dt><dd>Appears to the right of the axis and its labels. The default rotation is 90.</dd>"," * <dt>bottom</dt><dd>Appears below the axis and its labels. The default rotation is 0.</dd>"," * <dt>left</dt><dd>Appears to the left of the axis and its labels. The default rotation is -90.</dd>"," * </dl>"," *"," * @attribute title"," * @type String"," */"," title: {"," value: null"," },"," "," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or `HTMLElement`. "," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Template for formatting label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: {"," value: function(val, format)"," {"," return val;"," }"," },"," "," /**"," * Function used to append an axis value to an axis label. This function has the following signature:"," * <dl>"," * <dt>textField</dt><dd>The axis label to be appended. (`HTMLElement`)</dd>"," * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`"," * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>"," * </dl>"," * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given "," * value is a `String`, the method will convert the the value to a `textNode` before appending to the "," * `HTMLElement`. This method will not convert an `HTMLString` to an `HTMLElement`. "," *"," * @attribute appendLabelFunction"," * @type Function"," */"," appendLabelFunction: {"," valueFn: function()"," {"," return this._setText;"," }"," },"," "," /**"," * Function used to append a title value to the title object. This function has the following signature:"," * <dl>"," * <dt>textField</dt><dd>The title text field to be appended. (`HTMLElement`)</dd>"," * <dt>val</dt><dd>The value to attach to the text field. This method will accept an `HTMLELement`"," * or a `String`. This method does not use (`HTMLElement` | `String`)</dd>"," * </dl>"," * The default method appends a value to the `HTMLElement` using the `appendChild` method. If the given "," * value is a `String`, the method will convert the the value to a `textNode` before appending to the "," * `HTMLElement` element. This method will not convert an `HTMLString` to an `HTMLElement`. "," *"," * @attribute appendTitleFunction"," * @type Function"," */"," appendTitleFunction: {"," valueFn: function()"," {"," return this._setText;"," }"," }"," "," /**"," * Style properties used for drawing an axis. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>majorTicks</dt><dd>Properties used for drawing ticks."," * <dl>"," * <dt>display</dt><dd>Position of the tick. Possible values are `inside`, `outside`, `cross` and `none`. The"," * default value is `inside`.</dd>"," * <dt>length</dt><dd>The length (in pixels) of the tick. The default value is 4.</dd>"," * <dt>color</dt><dd>The color of the tick. The default value is `#dad8c9`</dd>"," * <dt>weight</dt><dd>Number indicating the width of the tick. The default value is 1.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>line</dt><dd>Properties used for drawing the axis line. "," * <dl>"," * <dt>weight</dt><dd>Number indicating the width of the axis line. The default value is 1.</dd>"," * <dt>color</dt><dd>The color of the axis line. The default value is `#dad8c9`.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the tick. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>majorUnit</dt><dd>Properties used to calculate the `majorUnit` for the axis. "," * <dl>"," * <dt>determinant</dt><dd>The algorithm used for calculating distance between ticks. The possible options are `count` and `distance`. If"," * the `determinant` is `count`, the axis ticks will spaced so that a specified number of ticks appear on the axis. If the `determinant`"," * is `distance`, the axis ticks will spaced out according to the specified distance. The default value is `count`.</dd>"," * <dt>count</dt><dd>Number of ticks to appear on the axis when the `determinant` is `count`. The default value is 11.</dd>"," * <dt>distance</dt><dd>The distance (in pixels) between ticks when the `determinant` is `distance`. The default value is 75.</dd>"," * </dl>"," * </dd>"," * <dt>label</dt><dd>Properties and styles applied to the axis labels."," * <dl>"," * <dt>color</dt><dd>The color of the labels. The default value is `#808080`.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 indicating the opacity of the labels. The default value is 1.</dd>"," * <dt>fontSize</dt><dd>The font-size of the labels. The default value is 85%</dd>"," * <dt>rotation</dt><dd>The rotation, in degrees (between -90 and 90) of the labels. The default value is 0.</dd>"," * <dt>margin</dt><dd>The distance between the label and the axis/tick. Depending on the position of the `Axis`, only one of the properties used."," * <dl>"," * <dt>top</dt><dd>Pixel value used for an axis with a `position` of `bottom`. The default value is 4.</dd>"," * <dt>right</dt><dd>Pixel value used for an axis with a `position` of `left`. The default value is 4.</dd>"," * <dt>bottom</dt><dd>Pixel value used for an axis with a `position` of `top`. The default value is 4.</dd>"," * <dt>left</dt><dd>Pixel value used for an axis with a `position` of `right`. The default value is 4.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * AxisType is an abstract class that manages the data for an axis."," *"," * @module charts"," * @submodule charts-base"," * @class AxisType"," * @constructor"," * @extends Axis"," */","Y.AxisType = Y.Base.create(\"baseAxis\", Y.Axis, [], {"," /**"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this.after(\"dataReady\", Y.bind(this._dataChangeHandler, this));"," this.after(\"dataUpdate\", Y.bind(this._dataChangeHandler, this));"," this.after(\"minimumChange\", Y.bind(this._keyChangeHandler, this));"," this.after(\"maximumChange\", Y.bind(this._keyChangeHandler, this));"," this.after(\"keysChange\", this._keyChangeHandler);"," this.after(\"dataProviderChange\", this._dataProviderChangeHandler);"," this.after(\"alwaysShowZeroChange\", this._keyChangeHandler);"," this.after(\"roundingMethodChange\", this._keyChangeHandler);"," },",""," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.after(\"stylesChange\", this._updateHandler);"," this.after(\"overlapGraphChange\", this._updateHandler);"," this.after(\"positionChange\", this._positionChangeHandler);"," this.after(\"widthChange\", this._handleSizeChange);"," this.after(\"heightChange\", this._handleSizeChange);"," this.after(\"calculatedWidthChange\", this._handleSizeChange);"," this.after(\"calculatedHeightChange\", this._handleSizeChange);"," },",""," /**"," * Handles changes to `dataProvider`."," *"," * @method _dataProviderChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _dataProviderChangeHandler: function(e)"," {"," var keyCollection = this.get(\"keyCollection\").concat(),"," keys = this.get(\"keys\"),"," i;"," if(keys)"," {"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," delete keys[i];"," }"," }"," }"," if(keyCollection && keyCollection.length)"," {"," this.set(\"keys\", keyCollection);"," }"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuibaseaxis\","," "," /**"," * Type of data used in `Axis`."," *"," * @property _type"," * @type String "," * @readOnly"," * @private"," */"," _type: null,"," "," /**"," * Storage for `setMaximum` attribute."," *"," * @property _setMaximum"," * @type Object"," * @private"," */"," _setMaximum: null,"," "," /**"," * Storage for `dataMaximum` attribute."," *"," * @property _dataMaximum"," * @type Object"," * @private"," */"," _dataMaximum: null,"," "," /**"," * Storage for `setMinimum` attribute."," *"," * @property _setMinimum"," * @type Object"," * @private"," */"," _setMinimum: null,"," "," /**"," * Reference to data array."," *"," * @property _data"," * @type Array"," * @private"," */"," _data: null,",""," /**"," * Indicates whether the all data is up to date."," *"," * @property _updateTotalDataFlag"," * @type Boolean"," * @private"," */"," _updateTotalDataFlag: true,",""," /**"," * Storage for `dataReady` attribute."," *"," * @property _dataReady"," * @type Boolean"," * @readOnly"," * @private"," */"," _dataReady: false,"," "," /**"," * Adds an array to the key hash."," *"," * @method addKey"," * @param value Indicates what key to use in retrieving"," * the array."," */"," addKey: function (value)"," {"," this.set(\"keys\", value);"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var i = 0,"," obj,"," keyArray = [],"," len = data.length;"," for(; i < len; ++i)"," {"," obj = data[i];"," keyArray[i] = obj[key];"," }"," return keyArray;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key, data)"," {"," var i,"," obj, "," arr = [], "," dv = this._dataClone.concat(), "," len = dv.length;"," for(i = 0; i < len; ++i)"," {"," obj = dv[i];"," arr[i] = obj[key];"," }"," this.get(\"keys\")[key] = arr;"," this._updateTotalDataFlag = true;"," },",""," /**"," * Updates the total data array."," *"," * @method _updateTotalData"," * @private"," */"," _updateTotalData: function()"," {"," var keys = this.get(\"keys\"),"," i;"," this._data = [];"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," this._data = this._data.concat(keys[i]);"," }"," }"," this._updateTotalDataFlag = false;"," },",""," /**"," * Removes an array from the key hash."," * "," * @method removeKey"," * @param {String} value Indicates what key to use in removing from "," * the hash."," */"," removeKey: function(value)"," {"," var keys = this.get(\"keys\");"," if(keys.hasOwnProperty(value)) "," {"," delete keys[value];"," this._keyChangeHandler();"," }"," },",""," /**"," * Returns a value based of a key value and an index."," *"," * @method getKeyValueAt"," * @param {String} key value used to look up the correct array"," * @param {Number} index within the array"," * @return Number "," */"," getKeyValueAt: function(key, index)"," {"," var value = NaN,"," keys = this.get(\"keys\");"," if(keys[key] && Y_Lang.isNumber(parseFloat(keys[key][index])))"," {"," value = keys[key][index];"," }"," return parseFloat(value);"," },",""," /**"," * Returns an array of values based on an identifier key."," *"," * @method getDataByKey"," * @param {String} value value used to identify the array"," * @return Object"," */"," getDataByKey: function (value)"," {"," var keys = this.get(\"keys\");"," if(keys[value])"," {"," return keys[value];"," }"," return null;"," },",""," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function() "," {"," var data = this.get(\"data\"),"," max = 0,"," min = 0,"," len,"," num,"," i;"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," max = min = data[0];"," if(len > 1)"," {"," for(i = 1; i < len; i++)"," { "," num = data[i];"," if(isNaN(num))"," {"," continue;"," }"," max = Math.max(num, max);"," min = Math.min(num, min);"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Returns the total number of majorUnits that will appear on an axis."," *"," * @method getTotalMajorUnits"," * @return Number"," */"," getTotalMajorUnits: function()"," {"," var units,"," majorUnit = this.get(\"styles\").majorUnit,"," len = this.get(\"length\");"," if(majorUnit.determinant === \"count\") "," {"," units = majorUnit.count;"," }"," else if(majorUnit.determinant === \"distance\") "," {"," units = (len/majorUnit.distance) + 1;"," }"," return units; "," },",""," /**"," * Returns the distance between major units on an axis."," *"," * @method getMajorUnitDistance"," * @param {Number} len Number of ticks"," * @param {Number} uiLen Size of the axis."," * @param {Object} majorUnit Hash of properties used to determine the majorUnit"," * @return Number"," */"," getMajorUnitDistance: function(len, uiLen, majorUnit)"," {"," var dist;"," if(majorUnit.determinant === \"count\")"," {"," dist = uiLen/(len - 1);"," }"," else if(majorUnit.determinant === \"distance\")"," {"," dist = majorUnit.distance;"," }"," return dist;"," },"," "," /**"," * Gets the distance that the first and last ticks are offset from there respective"," * edges."," *"," * @method getEdgeOffset"," * @param {Number} ct Number of ticks on the axis."," * @param {Number} l Length (in pixels) of the axis."," * @return Number"," */"," getEdgeOffset: function(ct, l)"," {"," return 0;"," },",""," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," increm = (max - min)/(l-1),"," label;"," l -= 1;"," label = min + (i * increm);"," return label;"," },",""," /**"," * Updates the `Axis` after a change in keys."," *"," * @method _keyChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _keyChangeHandler: function(e)"," {"," this._updateMinAndMax();"," this.fire(\"dataUpdate\");"," },",""," /**"," * Checks to see if data extends beyond the range of the axis. If so,"," * that data will need to be hidden. This method is internal, temporary and subject"," * to removal in the future."," *"," * @method _hasDataOverflow"," * @protected"," * @return Boolean"," */"," _hasDataOverflow: function()"," {"," if(this.get(\"setMin\") || this.get(\"setMax\"))"," {"," return true;"," }"," return false;"," },",""," /**"," * Returns a string corresponding to the first label on an "," * axis."," *"," * @method getMinimumValue"," * @return String"," */"," getMinimumValue: function()"," {"," return this.get(\"minimum\");"," },",""," /**"," * Returns a string corresponding to the last label on an "," * axis."," *"," * @method getMaximumValue"," * @return String"," */"," getMaximumValue: function()"," {"," return this.get(\"maximum\");"," }","}, {"," ATTRS: {"," /**"," * Hash of array identifed by a string value."," *"," * @attribute keys"," * @type Object"," */"," keys: {"," value: {},",""," setter: function(val)"," {"," var keys = {},"," i, "," len,"," data = this.get(\"dataProvider\");"," if(Y_Lang.isArray(val))"," {"," len = val.length;"," for(i = 0; i < len; ++i)"," {"," keys[val[i]] = this._getKeyArray(val[i], data); "," }"," "," }"," else if(Y_Lang.isString(val))"," {"," keys = this.get(\"keys\");"," keys[val] = this._getKeyArray(val, data);"," }"," else"," {"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," {"," keys[i] = this._getKeyArray(i, data);"," }"," }"," }"," this._updateTotalDataFlag = true;"," return keys;"," }"," },",""," /**"," *Indicates how to round unit values."," * <dl>"," * <dt>niceNumber</dt><dd>Units will be smoothed based on the number of ticks and data range.</dd>"," * <dt>auto</dt><dd>If the range is greater than 1, the units will be rounded.</dd>"," * <dt>numeric value</dt><dd>Units will be equal to the numeric value.</dd>"," * <dt>null</dt><dd>No rounding will occur.</dd>"," * </dl>"," *"," * @attribute roundingMethod"," * @type String"," * @default niceNumber"," */"," roundingMethod: {"," value: \"niceNumber\""," },",""," /**"," *Returns the type of axis data"," * <dl>"," * <dt>time</dt><dd>Manages time data</dd>"," * <dt>stacked</dt><dd>Manages stacked numeric data</dd> "," * <dt>numeric</dt><dd>Manages numeric data</dd>"," * <dt>category</dt><dd>Manages categorical data</dd>"," * </dl>"," *"," * @attribute type"," * @type String"," */"," type:"," {"," readOnly: true,",""," getter: function ()"," {"," return this._type;"," }"," },",""," /**"," * Instance of `ChartDataProvider` that the class uses"," * to build its own data."," *"," * @attribute dataProvider"," * @type Array"," */"," dataProvider:{"," setter: function (value)"," {"," return value;"," }"," },",""," /**"," * The maximum value contained in the `data` array. Used for"," * `maximum` when `autoMax` is true."," *"," * @attribute dataMaximum"," * @type Number"," */"," dataMaximum: {"," getter: function ()"," {"," if(!this._dataMaximum)"," { "," this._updateMinAndMax();"," }"," return this._dataMaximum;"," }"," },",""," /**"," * The maximum value that will appear on an axis."," *"," * @attribute maximum"," * @type Number"," */"," maximum: {"," lazyAdd: false,",""," getter: function ()"," {"," var max = this.get(\"dataMaximum\"),"," min = this.get(\"minimum\");"," //If all values are zero, force a range so that the Axis and related series"," //will still render."," if(min === 0 && max === 0)"," {"," max = 10;"," }"," if(Y_Lang.isNumber(this._setMaximum))"," {"," max = this._setMaximum;"," }"," return parseFloat(max);"," },"," setter: function (value)"," {"," this._setMaximum = parseFloat(value);"," return value;"," }"," },",""," /**"," * The minimum value contained in the `data` array. Used for"," * `minimum` when `autoMin` is true."," *"," * @attribute dataMinimum"," * @type Number"," */"," dataMinimum: {"," getter: function ()"," {"," if(!this._dataMinimum)"," {"," this._updateMinAndMax();"," }"," return this._dataMinimum;"," }"," },",""," /**"," * The minimum value that will appear on an axis."," *"," * @attribute minimum"," * @type Number"," */"," minimum: {"," lazyAdd: false,",""," getter: function ()"," {"," var min = this.get(\"dataMinimum\");"," if(Y_Lang.isNumber(this._setMinimum))"," {"," min = this._setMinimum;"," }"," return parseFloat(min);"," },"," setter: function(val)"," {"," this._setMinimum = parseFloat(val);"," return val;"," }"," },",""," /**"," * Determines whether the maximum is calculated or explicitly "," * set by the user."," *"," * @attribute setMax"," * @type Boolean"," */"," setMax: {"," readOnly: true,",""," getter: function()"," {"," return Y_Lang.isNumber(this._setMaximum);"," }"," },",""," /**"," * Determines whether the minimum is calculated or explicitly"," * set by the user."," *"," * @attribute setMin"," * @type Boolean"," */"," setMin: {"," readOnly: true,",""," getter: function()"," {"," return Y_Lang.isNumber(this._setMinimum);"," }"," },",""," /**"," * Array of axis data"," *"," * @attribute data"," * @type Array"," */"," data: {"," getter: function ()"," {"," if(!this._data || this._updateTotalDataFlag)"," {"," this._updateTotalData();"," }"," return this._data;"," }"," },",""," /**"," * Array containing all the keys in the axis."," "," * @attribute keyCollection"," * @type Array"," */"," keyCollection: {"," getter: function()"," {"," var keys = this.get(\"keys\"),"," i, "," col = [];"," for(i in keys)"," {"," if(keys.hasOwnProperty(i))"," {"," col.push(i);"," }"," }"," return col;"," },"," readOnly: true"," }"," }","});","/**"," * NumericAxis manages numeric data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class NumericAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function NumericAxis(config)","{"," NumericAxis.superclass.constructor.apply(this, arguments);","}","","NumericAxis.NAME = \"numericAxis\";","","NumericAxis.ATTRS = {"," /**"," * Indicates whether 0 should always be displayed."," *"," * @attribute alwaysShowZero"," * @type Boolean"," */"," alwaysShowZero: {"," value: true "," },"," "," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method"," * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' "," * `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>Object containing properties used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: { "," value: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," }"," },",""," /**"," * Object containing properties used by the `labelFunction` to format a"," * label."," *"," * @attribute labelFormat"," * @type Object"," */"," labelFormat: {"," value: {"," prefix: \"\","," thousandsSeparator: \"\","," decimalSeparator: \"\","," decimalPlaces: \"0\","," suffix: \"\""," }"," }","};","","Y.extend(NumericAxis, Y.AxisType,","{"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," if(format)"," {"," return Y.DataType.Number.format(val, format);"," }"," return val;"," },",""," /**"," * Returns the sum of all values per key."," *"," * @method getTotalByKey"," * @param {String} key The identifier for the array whose values will be calculated."," * @return Number"," */"," getTotalByKey: function(key)"," {"," var total = 0,"," values = this.getDataByKey(key),"," i = 0,"," val,"," len = values ? values.length : 0;"," for(; i < len; ++i)"," {"," val = parseFloat(values[i]);"," if(!isNaN(val))"," {"," total += val;"," }"," }"," return total;"," },",""," /**"," * Type of data used in `Axis`."," *"," * @property _type"," * @readOnly"," * @private"," */"," _type: \"numeric\",",""," /**"," * Helper method for getting a `roundingUnit` when calculating the minimum and maximum values."," *"," * @method _getMinimumUnit"," * @param {Number} max Maximum number"," * @param {Number} min Minimum number"," * @param {Number} units Number of units on the axis"," * @return Number"," * @private"," */"," _getMinimumUnit:function(max, min, units)"," {"," return this._getNiceNumber(Math.ceil((max - min)/units));"," },",""," /**"," * Calculates a nice rounding unit based on the range."," *"," * @method _getNiceNumber"," * @param {Number} roundingUnit The calculated rounding unit."," * @return Number"," * @private"," */"," _getNiceNumber: function(roundingUnit)"," {"," var tempMajorUnit = roundingUnit,"," order = Math.ceil(Math.log(tempMajorUnit) * 0.4342944819032518),"," roundedMajorUnit = Math.pow(10, order),"," roundedDiff;",""," if (roundedMajorUnit / 2 >= tempMajorUnit) "," {"," roundedDiff = Math.floor((roundedMajorUnit / 2 - tempMajorUnit) / (Math.pow(10,order-1)/2));"," tempMajorUnit = roundedMajorUnit/2 - roundedDiff*Math.pow(10,order-1)/2;"," }"," else "," {"," tempMajorUnit = roundedMajorUnit;"," }"," if(!isNaN(tempMajorUnit))"," {"," return tempMajorUnit;"," }"," return roundingUnit;",""," },",""," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," var data = this.get(\"data\"),"," max, "," min,"," len,"," num,"," i = 0,"," key,"," setMax = this.get(\"setMax\"),"," setMin = this.get(\"setMin\");"," if(!setMax || !setMin)"," {"," if(data && data.length && data.length > 0)"," {"," len = data.length;"," for(; i < len; i++)"," { "," num = data[i];"," if(isNaN(num))"," {"," if(Y_Lang.isObject(num))"," {"," min = max = 0;"," //hloc values"," for(key in num)"," {"," if(num.hasOwnProperty(key))"," {"," max = Math.max(num[key], max);"," min = Math.min(num[key], min);"," }"," }"," }"," max = setMax ? this._setMaximum : max;"," min = setMin ? this._setMinimum : min;"," continue;"," }"," "," if(setMin)"," {"," min = this._setMinimum;"," }"," else if(min === undefined)"," {"," min = num;"," }"," else"," {"," min = Math.min(num, min); "," }"," if(setMax)"," {"," max = this._setMaximum;"," }"," else if(max === undefined)"," {"," max = num;"," }"," else"," {"," max = Math.max(num, max);"," }"," "," this._actualMaximum = max;"," this._actualMinimum = min;"," }"," }"," this._roundMinAndMax(min, max, setMin, setMax);"," }"," },",""," /**"," * Rounds the mimimum and maximum values based on the `roundingUnit` attribute."," *"," * @method _roundMinAndMax"," * @param {Number} min Minimum value"," * @param {Number} max Maximum value"," * @private"," */"," _roundMinAndMax: function(min, max, setMin, setMax)"," {"," var roundingUnit,"," minimumRange,"," minGreaterThanZero = min >= 0,"," maxGreaterThanZero = max > 0,"," dataRangeGreater,"," maxRound,"," minRound,"," topTicks,"," botTicks,"," tempMax,"," tempMin,"," units = this.getTotalMajorUnits() - 1,"," alwaysShowZero = this.get(\"alwaysShowZero\"),"," roundingMethod = this.get(\"roundingMethod\"),"," useIntegers = (max - min)/units >= 1;"," if(roundingMethod)"," {"," if(roundingMethod == \"niceNumber\")"," {"," roundingUnit = this._getMinimumUnit(max, min, units);"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < roundingUnit) && !setMin)"," {"," min = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," }"," if(setMax)"," {"," if(!alwaysShowZero)"," {"," min = max - (roundingUnit * units);"," }"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round(units/((-1 * min)/max + 1));"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," "," if(setMin)"," {"," while(tempMin < tempMax && botTicks >= 0)"," {"," botTicks--;"," topTicks++;"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," //if there are any bottom ticks left calcualate the maximum by multiplying by the tempMin value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(botTicks > 0)"," {"," max = tempMin * topTicks;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(setMax)"," {"," while(tempMax < tempMin && topTicks >= 0)"," {"," botTicks++;"," topTicks--;"," tempMin = Math.floor( min/botTicks ) * -1;"," tempMax = Math.ceil( max/topTicks );"," }"," //if there are any top ticks left calcualate the minimum by multiplying by the tempMax value"," //if not, it's impossible to ensure that a zero is shown. skip it"," if(topTicks > 0)"," {"," min = tempMax * botTicks * -1;"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," else"," {"," roundingUnit = Math.max(tempMax, tempMin);"," roundingUnit = this._getNiceNumber(roundingUnit); "," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," }"," else "," {"," if(setMax)"," {"," min = max - (roundingUnit * units);"," }"," else if(setMin)"," {"," max = min + (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," }"," else"," {"," if(setMin)"," {"," if(alwaysShowZero)"," {"," max = 0;"," }"," else"," {"," max = min + (roundingUnit * units);"," }"," }"," else if(!setMax)"," {"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = this._getMinimumUnit(max, min, units);"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," min = max - (roundingUnit * units);"," }"," }"," }"," else if(roundingMethod == \"auto\") "," {"," if(minGreaterThanZero && maxGreaterThanZero)"," {"," if((alwaysShowZero || min < (max-min)/units) && !setMin)"," {"," min = 0;"," }"," "," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," max = min + (roundingUnit * units);"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," if(alwaysShowZero)"," {"," topTicks = Math.round( units / ( (-1 * min) /max + 1) );"," topTicks = Math.max(Math.min(topTicks, units - 1), 1);"," botTicks = units - topTicks;",""," if(useIntegers)"," {"," tempMax = Math.ceil( max/topTicks );"," tempMin = Math.floor( min/botTicks ) * -1;"," }"," else"," {"," tempMax = max/topTicks;"," tempMin = min/botTicks * -1;"," }"," roundingUnit = Math.max(tempMax, tempMin);"," max = roundingUnit * topTicks;"," min = roundingUnit * botTicks * -1;"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," roundingUnit = Math.ceil(roundingUnit);"," }"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }"," }"," else"," {"," roundingUnit = (max - min)/units;"," if(useIntegers)"," { "," roundingUnit = Math.ceil(roundingUnit);"," }"," if(alwaysShowZero || max === 0 || max + roundingUnit > 0)"," {"," max = 0;"," roundingUnit = (max - min)/units;"," if(useIntegers)"," {"," Math.ceil(roundingUnit);"," }"," min = max - (roundingUnit * units);"," }"," else"," {"," min = this._roundDownToNearest(min, roundingUnit);"," max = this._roundUpToNearest(max, roundingUnit);"," }",""," }"," }"," else if(!isNaN(roundingMethod) && isFinite(roundingMethod))"," {"," roundingUnit = roundingMethod;"," minimumRange = roundingUnit * units;"," dataRangeGreater = (max - min) > minimumRange;"," minRound = this._roundDownToNearest(min, roundingUnit);"," maxRound = this._roundUpToNearest(max, roundingUnit);"," if(setMax)"," {"," min = max - minimumRange;"," }"," else if(setMin)"," {"," max = min + minimumRange;"," }"," else if(minGreaterThanZero && maxGreaterThanZero)"," {"," if(alwaysShowZero || minRound <= 0)"," {"," min = 0;"," }"," else"," {"," min = minRound;"," }"," max = min + minimumRange;"," }"," else if(maxGreaterThanZero && !minGreaterThanZero)"," {"," min = minRound;"," max = maxRound;"," }"," else"," {"," if(alwaysShowZero || maxRound >= 0)"," {"," max = 0;"," }"," else"," {"," max = maxRound;"," }"," min = max - minimumRange;"," }"," }"," }"," this._dataMaximum = max;"," this._dataMinimum = min;"," },",""," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," increm = (max - min)/(l-1),"," label,"," roundingMethod = this.get(\"roundingMethod\");"," l -= 1;"," //respect the min and max. calculate all other labels."," if(i === 0)"," {"," label = min;"," }"," else if(i === l)"," {"," label = max;"," }"," else"," {"," label = (i * increm);"," if(roundingMethod == \"niceNumber\")"," {"," label = this._roundToNearest(label, increm);"," }"," label += min;"," }"," return parseFloat(label);"," },",""," /**"," * Rounds a Number to the nearest multiple of an input. For example, by rounding"," * 16 to the nearest 10, you will receive 20. Similar to the built-in function Math.round()."," *"," * @method _roundToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," var roundedNumber = Math.round(this._roundToPrecision(number / nearest, 10)) * nearest;"," return this._roundToPrecision(roundedNumber, 10);"," },"," "," /**"," * Rounds a Number up to the nearest multiple of an input. For example, by rounding"," * 16 up to the nearest 10, you will receive 20. Similar to the built-in function Math.ceil()."," *"," * @method _roundUpToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundUpToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," return Math.ceil(this._roundToPrecision(number / nearest, 10)) * nearest;"," },"," "," /**"," * Rounds a Number down to the nearest multiple of an input. For example, by rounding"," * 16 down to the nearest 10, you will receive 10. Similar to the built-in function Math.floor()."," *"," * @method _roundDownToNearest"," * @param {Number} number Number to round"," * @param {Number} nearest Multiple to round towards."," * @return Number"," * @private"," */"," _roundDownToNearest: function(number, nearest)"," {"," nearest = nearest || 1;"," if(nearest === 0)"," {"," return number;"," }"," return Math.floor(this._roundToPrecision(number / nearest, 10)) * nearest;"," },",""," /**"," * Rounds a number to a certain level of precision. Useful for limiting the number of"," * decimal places on a fractional number."," *"," * @method _roundToPrecision"," * @param {Number} number Number to round"," * @param {Number} precision Multiple to round towards."," * @return Number"," * @private"," */"," _roundToPrecision: function(number, precision)"," {"," precision = precision || 0;"," var decimalPlaces = Math.pow(10, precision);"," return Math.round(decimalPlaces * number) / decimalPlaces;"," },"," "," /**"," * Checks to see if data extends beyond the range of the axis. If so,"," * that data will need to be hidden. This method is internal, temporary and subject"," * to removal in the future."," *"," * @method _hasDataOverflow"," * @protected"," * @return Boolean"," */"," _hasDataOverflow: function()"," {"," var roundingMethod,"," min,"," max;"," if(this.get(\"setMin\") || this.get(\"setMax\"))"," {"," return true;"," }"," roundingMethod = this.get(\"roundingMethod\");"," min = this._actualMinimum;"," max = this._actualMaximum;"," if(Y_Lang.isNumber(roundingMethod) && ((Y_Lang.isNumber(max) && max > this._dataMaximum) || (Y_Lang.isNumber(min) && min < this._dataMinimum)))"," {"," return true;"," }"," return false;"," }","});","","Y.NumericAxis = NumericAxis;"," ","/**"," * StackedAxis manages stacked numeric data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends NumericAxis"," */","function StackedAxis(config)","{"," StackedAxis.superclass.constructor.apply(this, arguments);","}","","StackedAxis.NAME = \"stackedAxis\";","","","Y.extend(StackedAxis, Y.NumericAxis,","{"," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," var max = 0,"," min = 0,"," pos = 0,"," neg = 0,"," len = 0,"," i = 0,"," key,"," num,"," keys = this.get(\"keys\"),"," setMin = this.get(\"setMin\"),"," setMax = this.get(\"setMax\");",""," for(key in keys)"," {"," if(keys.hasOwnProperty(key))"," {"," len = Math.max(len, keys[key].length);"," }"," }"," for(; i < len; ++i)"," {"," pos = 0;"," neg = 0;"," for(key in keys)"," {"," if(keys.hasOwnProperty(key))"," {"," num = keys[key][i];"," if(isNaN(num))"," {"," continue;"," }"," if(num >= 0)"," {"," pos += num;"," }"," else"," {"," neg += num;"," }"," }"," }"," if(pos > 0)"," {"," max = Math.max(max, pos);"," }"," else "," {"," max = Math.max(max, neg);"," }"," if(neg < 0)"," {"," min = Math.min(min, neg);"," }"," else"," {"," min = Math.min(min, pos);"," }"," }"," this._actualMaximum = max;"," this._actualMinimum = min;"," if(setMax)"," {"," max = this._setMaximum;"," }"," if(setMin)"," {"," min = this._setMinimum;"," }"," this._roundMinAndMax(min, max, setMin, setMax);"," }","});","","Y.StackedAxis = StackedAxis;"," ","/**"," * TimeAxis manages time data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class TimeAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function TimeAxis(config)","{"," TimeAxis.superclass.constructor.apply(this, arguments);","}","","TimeAxis.NAME = \"timeAxis\";","","TimeAxis.ATTRS = ","{"," /**"," * Indicates whether the maximum is calculated or explicitly set. "," *"," * @attribute setMax"," * @readOnly"," * @type Boolean"," * @private"," */"," setMax: {"," readOnly: true,",""," getter: function()"," {"," var max = this._getNumber(this._setMaximum);"," return (Y_Lang.isNumber(max));"," }"," },",""," /**"," * Indicates whether the minimum is calculated or explicitly set. "," *"," * @attribute setMin"," * @readOnly"," * @type Boolean"," * @private"," */"," setMin: {"," readOnly: true,",""," getter: function()"," {"," var min = this._getNumber(this._setMinimum);"," return (Y_Lang.isNumber(min));"," }"," },",""," /**"," * The maximum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`."," *"," * @attribute maximum"," * @type Number"," */"," maximum: {"," getter: function ()"," {"," var max = this._getNumber(this._setMaximum);"," if(!Y_Lang.isNumber(max))"," {"," max = this._getNumber(this.get(\"dataMaximum\"));"," }"," return parseFloat(max);"," },"," setter: function (value)"," {"," this._setMaximum = this._getNumber(value);"," return value;"," }"," },",""," /**"," * The minimum value that will appear on an axis. Unless explicitly set, this value is calculated by the `Axis`."," *"," * @attribute minimum"," * @type Number"," */"," minimum: {"," getter: function ()"," {"," var min = this._getNumber(this._setMinimum);"," if(!Y_Lang.isNumber(min)) "," {"," min = this._getNumber(this.get(\"dataMinimum\"));"," }"," return parseFloat(min);"," },"," setter: function (value)"," {"," this._setMinimum = this._getNumber(value);"," return value;"," }"," },",""," /**"," * Method used for formatting a label. This attribute allows for the default label formatting method to overridden. The method use would need"," * to implement the arguments below and return a `String` or an `HTMLElement`. The default implementation of the method returns a `String`. The output of this method"," * will be rendered to the DOM using `appendChild`. If you override the `labelFunction` method and return an html string, you will also need to override the Axis' "," * `appendLabelFunction` to accept html as a `String`."," * <dl>"," * <dt>val</dt><dd>Label to be formatted. (`String`)</dd>"," * <dt>format</dt><dd>STRFTime string used to format the label. (optional)</dd>"," * </dl>"," *"," * @attribute labelFunction"," * @type Function"," */"," labelFunction: {"," value: function(val, format)"," {"," val = Y.DataType.Date.parse(val);"," if(format)"," {"," return Y.DataType.Date.format(val, {format:format});"," }"," return val;"," }"," },",""," /**"," * Pattern used by the `labelFunction` to format a label."," *"," * @attribute labelFormat"," * @type String"," */"," labelFormat: {"," value: \"%b %d, %y\""," }","};","","Y.extend(TimeAxis, Y.AxisType, {"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," val = Y.DataType.Date.parse(val);"," if(format)"," {"," return Y.DataType.Date.format(val, {format:format});"," }"," return val;"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuitimeaxis\","," "," /**"," * Type of data used in `Axis`."," *"," * @property _dataType"," * @readOnly"," * @private"," */"," _dataType: \"time\","," "," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var min = this.get(\"minimum\"),"," max = this.get(\"maximum\"),"," position = this.get(\"position\"),"," increm,"," label;"," l -= 1;"," increm = ((max - min)/l) * i;"," if(position == \"bottom\" || position == \"top\")"," {"," label = min + increm;"," }"," else"," {"," label = max - increm;"," }"," return label;"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var obj,"," keyArray = [],"," i = 0,"," val,"," len = data.length;"," for(; i < len; ++i)"," {"," obj = data[i][key];"," if(Y_Lang.isDate(obj))"," { "," val = obj.valueOf();"," }"," else"," {"," val = new Date(obj);"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(obj))"," {"," if(Y_Lang.isNumber(parseFloat(obj)))"," {"," val = parseFloat(obj);"," }"," else"," {"," if(typeof obj != \"string\")"," {"," obj = obj;"," }"," val = new Date(obj).valueOf();"," }"," }"," else"," {"," val = obj;"," }"," }"," keyArray[i] = val;"," }"," return keyArray;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key, data)"," {"," var obj, "," arr = [], "," dv = this._dataClone.concat(), "," i, "," val,"," len = dv.length;"," for(i = 0; i < len; ++i)"," {"," obj = dv[i][key];"," if(Y_Lang.isDate(obj))"," { "," val = obj.valueOf();"," }"," else"," {"," val = new Date(obj);"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(obj))"," {"," if(Y_Lang.isNumber(parseFloat(obj)))"," {"," val = parseFloat(obj);"," }"," else"," {"," if(typeof obj != \"string\")"," {"," obj = obj.toString();"," }"," val = new Date(obj).valueOf();"," }"," }"," else"," {"," val = obj;"," }"," }"," arr[i] = val;"," }"," this.get(\"keys\")[key] = arr;"," this._updateTotalDataFlag = true;"," },",""," /**"," * Parses value into a number."," *"," * @method _getNumber"," * @param val {Object} Value to parse into a number"," * @return Number"," * @private"," */"," _getNumber: function(val)"," {"," if(Y_Lang.isDate(val))"," {"," val = val.valueOf();"," }"," else if(!Y_Lang.isNumber(val) && val)"," {"," val = new Date(val).valueOf();"," }",""," return val;"," }","});","","Y.TimeAxis = TimeAxis;"," ","/**"," * CategoryAxis manages category data on an axis."," *"," * @module charts"," * @submodule charts-base"," * @class CategoryAxis"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AxisType"," */","function CategoryAxis(config)","{"," CategoryAxis.superclass.constructor.apply(this, arguments);","}","","CategoryAxis.NAME = \"categoryAxis\";","","Y.extend(CategoryAxis, Y.AxisType,","{"," /**"," * Formats a label based on the axis type and optionally specified format."," *"," * @method formatLabel"," * @param {Object} value"," * @param {Object} format Pattern used to format the value."," * @return String"," */"," formatLabel: function(val, format)"," {"," return val;"," },",""," /**"," * Object storing key data."," *"," * @property _indices"," * @private"," */"," _indices: null,",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuicategoryaxis\",",""," /**"," * Type of data used in `Axis`."," *"," * @property _dataType"," * @readOnly"," * @private"," */"," _type: \"category\","," "," /**"," * Calculates the maximum and minimum values for the `Axis`."," *"," * @method _updateMinAndMax"," * @private "," */"," _updateMinAndMax: function()"," {"," this._dataMaximum = Math.max(this.get(\"data\").length - 1, 0);"," this._dataMinimum = 0;"," },",""," /**"," * Gets an array of values based on a key."," *"," * @method _getKeyArray"," * @param {String} key Value key associated with the data array."," * @param {Array} data Array in which the data resides."," * @return Array"," * @private"," */"," _getKeyArray: function(key, data)"," {"," var i = 0,"," obj,"," keyArr = [],"," labels = [],"," len = data.length;"," if(!this._indices)"," {"," this._indices = {};"," }"," for(; i < len; ++i)"," {"," obj = data[i];"," keyArr[i] = i;"," labels[i] = obj[key];"," }"," this._indices[key] = keyArr;"," return labels;"," },",""," /**"," * Sets data by key"," *"," * @method _setDataByKey"," * @param {String} key Key value to use."," * @param {Array} data Array to use."," * @private "," */"," _setDataByKey: function(key)"," {"," var i,"," obj, "," arr = [], "," labels = [], "," dv = this._dataClone.concat(), "," len = dv.length;"," if(!this._indices)"," {"," this._indices = {};"," }"," for(i = 0; i < len; ++i)"," {"," obj = dv[i];"," arr[i] = i;"," labels[i] = obj[key];"," }"," this._indices[key] = arr;"," this.get(\"keys\")[key] = labels.concat();"," this._updateTotalDataFlag = true;"," },",""," /**"," * Returns an array of values based on an identifier key."," *"," * @method getDataByKey"," * @param {String} value value used to identify the array"," * @return Array"," */"," getDataByKey: function (value)"," {"," if(!this._indices)"," {"," this.get(\"keys\");"," }"," var keys = this._indices;"," if(keys[value])"," {"," return keys[value];"," }"," return null;"," },",""," /**"," * Returns the total number of majorUnits that will appear on an axis."," *"," * @method getTotalMajorUnits"," * @param {Object} majorUnit Object containing properties related to the majorUnit."," * @param {Number} len Length of the axis."," * @return Number"," */"," getTotalMajorUnits: function(majorUnit, len)"," {"," return this.get(\"data\").length;"," },"," "," /**"," * Returns the distance between major units on an axis."," *"," * @method getMajorUnitDistance"," * @param {Number} len Number of ticks"," * @param {Number} uiLen Size of the axis."," * @param {Object} majorUnit Hash of properties used to determine the majorUnit"," * @return Number"," */"," getMajorUnitDistance: function(len, uiLen, majorUnit)"," {"," var dist;"," if(majorUnit.determinant === \"count\")"," {"," dist = uiLen/len;"," }"," else if(majorUnit.determinant === \"distance\")"," {"," dist = majorUnit.distance;"," }"," return dist;"," },"," "," /**"," * Gets the distance that the first and last ticks are offset from there respective"," * edges."," *"," * @method getEdgeOffset"," * @param {Number} ct Number of ticks on the axis."," * @param {Number} l Length (in pixels) of the axis."," * @return Number"," */"," getEdgeOffset: function(ct, l)"," {"," return l/ct;"," },",""," /**"," * Returns a value based of a key value and an index."," *"," * @method getKeyValueAt"," * @param {String} key value used to look up the correct array"," * @param {Number} index within the array"," * @return String "," */"," getKeyValueAt: function(key, index)"," {"," var value = NaN,"," keys = this.get(\"keys\");"," if(keys[key] && keys[key][index]) "," {"," value = keys[key][index];"," }"," return value;"," },"," "," /**"," * Calculates and returns a value based on the number of labels and the index of"," * the current label."," *"," * @method getLabelByIndex"," * @param {Number} i Index of the label."," * @param {Number} l Total number of labels."," * @return String"," */"," getLabelByIndex: function(i, l)"," {"," var label,"," data = this.get(\"data\"),"," position = this.get(\"position\");"," if(position == \"bottom\" || position == \"top\")"," {"," label = data[i];"," }"," else"," {"," label = data[l - (i + 1)];"," } "," return label;"," },",""," /**"," * Returns a string corresponding to the first label on an "," * axis."," *"," * @method getMinimumValue"," * @return String"," */"," getMinimumValue: function()"," {"," var data = this.get(\"data\"),"," label = data[0];"," return label;"," },",""," /**"," * Returns a string corresponding to the last label on an "," * axis."," *"," * @method getMaximumValue"," * @return String"," */"," getMaximumValue: function()"," {"," var data = this.get(\"data\"),"," len = data.length - 1,"," label = data[len];"," return label;"," }","});","","Y.CategoryAxis = CategoryAxis;"," ","/**"," * Utility class used for calculating curve points."," *"," * @module charts"," * @submodule charts-base"," * @class CurveUtil"," * @constructor"," */","function CurveUtil()","{","}","","CurveUtil.prototype = {"," /**"," * Creates an array of start, end and control points for splines."," *"," * @method getCurveControlPoints"," * @param {Array} xcoords Collection of x-coordinates used for calculate the curves"," * @param {Array} ycoords Collection of y-coordinates used for calculate the curves"," * @return Object"," * @protected"," */"," getCurveControlPoints: function(xcoords, ycoords) "," {"," var outpoints = [],"," i = 1,"," l = xcoords.length - 1,"," xvals = [],"," yvals = [];"," "," "," // Too few points, need at least two"," if (l < 1) "," {"," return null;"," } "," "," outpoints[0] = {"," startx: xcoords[0], "," starty: ycoords[0],"," endx: xcoords[1],"," endy: ycoords[1]"," };"," "," // Special case, the Bezier should be a straight line"," if (l === 1) "," {"," outpoints[0].ctrlx1 = (2.0*xcoords[0] + xcoords[1])/3.0; "," outpoints[0].ctrly2 = (2.0*ycoords[0] + ycoords[1])/3.0;"," outpoints[0].ctrlx2 = 2.0*outpoints[0].ctrlx1 - xcoords[0];"," outpoints[0].ctrly2 = 2.0*outpoints[0].ctrly1 - ycoords[0];"," return outpoints;"," }",""," for (; i < l; ++i) "," {"," outpoints.push({startx: Math.round(xcoords[i]), starty: Math.round(ycoords[i]), endx: Math.round(xcoords[i+1]), endy: Math.round(ycoords[i+1])});"," xvals[i] = 4.0 * xcoords[i] + 2*xcoords[i+1];"," yvals[i] = 4.0*ycoords[i] + 2*ycoords[i+1];"," }"," "," xvals[0] = xcoords[0] + (2.0 * xcoords[1]);"," xvals[l-1] = (8.0 * xcoords[l-1] + xcoords[l]) / 2.0;"," xvals = this.getControlPoints(xvals.concat());"," yvals[0] = ycoords[0] + (2.0 * ycoords[1]);"," yvals[l-1] = (8.0 * ycoords[l-1] + ycoords[l]) / 2.0; "," yvals = this.getControlPoints(yvals.concat());"," "," for (i = 0; i < l; ++i) "," {"," outpoints[i].ctrlx1 = Math.round(xvals[i]);"," outpoints[i].ctrly1 = Math.round(yvals[i]);"," "," if (i < l-1) "," {"," outpoints[i].ctrlx2 = Math.round(2*xcoords[i+1] - xvals[i+1]);"," outpoints[i].ctrly2 = Math.round(2*ycoords[i+1] - yvals[i+1]);"," }"," else "," {"," outpoints[i].ctrlx2 = Math.round((xcoords[l] + xvals[l-1])/2);"," outpoints[i].ctrly2 = Math.round((ycoords[l] + yvals[l-1])/2);"," }"," }"," "," return outpoints; "," },",""," /**"," * Gets the control points for the curve."," *"," * @method getControlPoints"," * @param {Array} vals Collection of values coords used to generate control points."," * @return Array"," * @private"," */"," getControlPoints: function(vals) "," {"," var l = vals.length,"," x = [],"," tmp = [],"," b = 2.0,"," i = 1;"," x[0] = vals[0] / b;"," for (; i < l; ++i) "," {"," tmp[i] = 1/b;"," b = (i < l-1 ? 4.0 : 3.5) - tmp[i];"," x[i] = (vals[i] - x[i-1]) / b;"," }"," "," for (i = 1; i < l; ++i) "," {"," x[l-i-1] -= tmp[l-i] * x[l-i];"," }"," "," return x;"," }","};","Y.CurveUtil = CurveUtil;","/**"," * Utility class used for creating stacked series."," *"," * @module charts"," * @submodule charts-base"," * @class StackingUtil"," * @constructor"," */","function StackingUtil(){}","","StackingUtil.prototype = {"," /**"," * Indicates whether the series is stacked."," *"," * @property _stacked"," * @private"," */"," _stacked: true,",""," /**"," * @protected"," *"," * Adjusts coordinate values for stacked series."," *"," * @method _stackCoordinates"," */"," _stackCoordinates: function() "," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._stackXCoords();"," }"," else"," {"," this._stackYCoords();"," }"," },",""," /**"," * Stacks coordinates for a stacked vertical series."," *"," * @method _stackXCoords"," * @protected"," */"," _stackXCoords: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," i = 0,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," len,"," coord,"," prevCoord,"," prevOrder,"," stackedXCoords = xcoords.concat(),"," prevXCoords,"," prevYCoords,"," nullIndices = [],"," nullIndex;"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"stackedXCoords\");"," prevYCoords = seriesCollection[order - 1].get(\"stackedYCoords\");"," len = prevXCoords.length;"," }"," else"," {"," len = xcoords.length;"," }"," for(; i < len; i = i + 1)"," {"," if(Y_Lang.isNumber(xcoords[i]))"," {"," if(order > 0)"," {"," prevCoord = prevXCoords[i];"," if(!Y_Lang.isNumber(prevCoord))"," {"," prevOrder = order;"," while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))"," {"," prevOrder = prevOrder - 1;"," if(prevOrder > -1)"," {"," prevCoord = seriesCollection[prevOrder].get(\"stackedXCoords\")[i];"," }"," else"," {"," prevCoord = this._leftOrigin;"," }"," }"," }"," xcoords[i] = xcoords[i] + prevCoord;"," }"," stackedXCoords[i] = xcoords[i];"," }"," else"," {"," nullIndices.push(i);"," }"," }"," this._cleanXNaN(stackedXCoords, ycoords);"," len = nullIndices.length;"," if(len > 0)"," {"," for(i = 0; i < len; i = i + 1)"," {"," nullIndex = nullIndices[i];"," coord = order > 0 ? prevXCoords[nullIndex] : this._leftOrigin;"," stackedXCoords[nullIndex] = Math.max(stackedXCoords[nullIndex], coord);"," }"," }"," this.set(\"stackedXCoords\", stackedXCoords);"," this.set(\"stackedYCoords\", ycoords);"," },",""," /**"," * Stacks coordinates for a stacked horizontal series."," *"," * @method _stackYCoords"," * @protected"," */"," _stackYCoords: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," h = graph.get(\"height\"), "," seriesCollection = graph.seriesTypes[type],"," i = 0,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," len,"," coord,"," prevCoord,"," prevOrder,"," stackedYCoords = ycoords.concat(),"," prevXCoords,"," prevYCoords,"," nullIndices = [],"," nullIndex;"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"stackedXCoords\");"," prevYCoords = seriesCollection[order - 1].get(\"stackedYCoords\");"," len = prevYCoords.length;"," }"," else"," {"," len = ycoords.length;"," }"," for(; i < len; i = i + 1)"," {"," if(Y_Lang.isNumber(ycoords[i]))"," {"," if(order > 0)"," {"," prevCoord = prevYCoords[i];"," if(!Y_Lang.isNumber(prevCoord))"," {"," prevOrder = order;"," while(prevOrder > - 1 && !Y_Lang.isNumber(prevCoord))"," {"," prevOrder = prevOrder - 1;"," if(prevOrder > -1)"," {"," prevCoord = seriesCollection[prevOrder].get(\"stackedYCoords\")[i];"," }"," else"," {"," prevCoord = this._bottomOrigin;"," }"," }"," }"," ycoords[i] = prevCoord - (h - ycoords[i]);"," }"," stackedYCoords[i] = ycoords[i];"," }"," else"," {"," nullIndices.push(i);"," }"," }"," this._cleanYNaN(xcoords, stackedYCoords);"," len = nullIndices.length;"," if(len > 0)"," {"," for(i = 0; i < len; i = i + 1)"," {"," nullIndex = nullIndices[i];"," coord = order > 0 ? prevYCoords[nullIndex] : h;"," stackedYCoords[nullIndex] = Math.min(stackedYCoords[nullIndex], coord);"," }"," }"," this.set(\"stackedXCoords\", xcoords);"," this.set(\"stackedYCoords\", stackedYCoords);"," },",""," /**"," * Cleans invalid x-coordinates by calculating their value based on the corresponding y-coordinate, the previous valid x-coordinate with its "," * corresponding y-coordinate and the next valid x-coordinate with its corresponding y-coordinate. If there is no previous or next valid x-coordinate,"," * the value will not be altered."," *"," * @method _cleanXNaN"," * @param {Array} xcoords An array of x-coordinate values"," * @param {Array} ycoords An arry of y-coordinate values"," * @private"," */"," _cleanXNaN: function(xcoords, ycoords)"," {"," var previousValidIndex,"," nextValidIndex,"," previousValidX,"," previousValidY,"," x,"," y,"," nextValidX,"," nextValidY,"," isNumber = Y_Lang.isNumber,"," m,"," i = 0,"," len = ycoords.length;"," for(; i < len; ++i)"," {"," x = xcoords[i];"," y = ycoords[i];"," //if x is invalid, calculate where it should be"," if(!isNumber(x) && i > 0 && i < len - 1)"," {"," previousValidY = ycoords[i - 1];"," //check to see if the previous value is valid"," previousValidX = this._getPreviousValidCoordValue(xcoords, i);"," nextValidY = ycoords[i + 1];"," nextValidX = this._getNextValidCoordValue(xcoords, i);"," //check to see if the next value is valid"," if(isNumber(previousValidX) && isNumber(nextValidX))"," {"," //calculate slope and solve for x"," m = (nextValidY - previousValidY) / (nextValidX - previousValidX);"," xcoords[i] = (y + (m * previousValidX) - previousValidY)/m;"," }"," previousValidIndex = NaN;"," nextValidIndex = NaN;"," }"," }"," },",""," /**"," * Returns the previous valid (numeric) value in an array if available."," *"," * @method _getPreviousValidCoordValue"," * @param {Array} coords Array of values"," * @param {Number} index The index in the array in which to begin searching."," * @return Number"," * @private"," */"," _getPreviousValidCoordValue: function(coords, index)"," {"," var coord,"," isNumber = Y_Lang.isNumber,"," limit = -1;"," while(!isNumber(coord) && index > limit)"," {"," index = index - 1;"," coord = coords[index];"," }"," return coord;"," },",""," /**"," * Returns the next valid (numeric) value in an array if available."," *"," * @method _getNextValidCoordValue"," * @param {Array} coords Array of values"," * @param {Number} index The index in the array in which to begin searching."," * @return Number"," * @private"," */"," _getNextValidCoordValue: function(coords, index)"," {"," var coord,"," isNumber = Y_Lang.isNumber,"," limit = coords.length;"," while(!isNumber(coord) && index < limit)"," {"," index = index + 1;"," coord = coords[index];"," }"," return coord;"," },",""," /**"," * Cleans invalid y-coordinates by calculating their value based on the corresponding x-coordinate, the previous valid y-coordinate with its "," * corresponding x-coordinate and the next valid y-coordinate with its corresponding x-coordinate. If there is no previous or next valid y-coordinate,"," * the value will not be altered."," *"," * @method _cleanYNaN"," * @param {Array} xcoords An array of x-coordinate values"," * @param {Array} ycoords An arry of y-coordinate values"," * @private"," */"," _cleanYNaN: function(xcoords, ycoords)"," {"," var previousValidIndex,"," nextValidIndex,"," previousValidX,"," previousValidY,"," x,"," y,"," nextValidX,"," nextValidY,"," isNumber = Y_Lang.isNumber,"," m,"," i = 0,"," len = xcoords.length;"," for(; i < len; ++i)"," {"," x = xcoords[i];"," y = ycoords[i];"," //if y is invalid, calculate where it should be"," if(!isNumber(y) && i > 0 && i < len - 1)"," {"," //check to see if the previous value is valid"," previousValidX = xcoords[i - 1];"," previousValidY = this._getPreviousValidCoordValue(ycoords, i);"," //check to see if the next value is valid"," nextValidX = xcoords[i + 1];"," nextValidY = this._getNextValidCoordValue(ycoords, i);"," if(isNumber(previousValidY) && isNumber(nextValidY))"," {"," //calculate slope and solve for y"," m = (nextValidY - previousValidY) / (nextValidX - previousValidX);"," ycoords[i] = previousValidY + ((m * x) - (m * previousValidX));"," }"," previousValidIndex = NaN;"," nextValidIndex = NaN;"," }"," }"," }","};","Y.StackingUtil = StackingUtil;","/**"," * Utility class used for drawing lines."," *"," * @module charts"," * @submodule charts-base"," * @class Lines"," * @constructor"," */","function Lines(){}","","Lines.prototype = {"," /**"," * @property _lineDefaults"," * @type Object"," * @private"," */"," _lineDefaults: null,"," "," /**"," * Creates a graphic in which to draw a series."," *"," * @method _getGraphic"," * @return Graphic"," * @private"," */"," _getGraphic: function()"," {"," var graphic = this.get(\"graphic\") || this.get(\"graph\").get(\"graphic\");"," if(!this._lineGraphic)"," {"," this._lineGraphic = graphic.addShape({type: \"path\"});"," }"," this._lineGraphic.clear();"," return this._lineGraphic;"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," if(this._lineGraphic)"," {"," this._lineGraphic.set(\"visible\", visible);"," }"," },",""," /**"," * Draws lines for the series."," *"," * @method drawLines"," * @protected"," */"," drawLines: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," xcoords,"," ycoords,"," direction = this.get(\"direction\"),"," len,"," lastPointValid,"," pointValid,"," noPointsRendered = true,"," lastValidX,"," lastValidY,"," nextX,"," nextY,"," i,"," styles = this.get(\"styles\").line,"," lineType = styles.lineType,"," lc = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"line\"),"," lineAlpha = styles.alpha,"," dashLength = styles.dashLength,"," gapSpace = styles.gapSpace,"," connectDiscontinuousPoints = styles.connectDiscontinuousPoints,"," discontinuousType = styles.discontinuousType,"," discontinuousDashLength = styles.discontinuousDashLength,"," discontinuousGapSpace = styles.discontinuousGapSpace,"," path = this._getGraphic();"," if(this._stacked)"," {"," xcoords = this.get(\"stackedXCoords\");"," ycoords = this.get(\"stackedYCoords\");"," }"," else"," {"," xcoords = this.get(\"xcoords\");"," ycoords = this.get(\"ycoords\");"," }"," len = direction === \"vertical\" ? ycoords.length : xcoords.length;"," path.set(\"stroke\", {"," weight: styles.weight, "," color: lc, "," opacity: lineAlpha"," });"," for(i = 0; i < len; i = ++i)"," {"," nextX = xcoords[i];"," nextY = ycoords[i];"," pointValid = isNumber(nextX) && isNumber(nextY); "," if(!pointValid)"," {"," lastPointValid = pointValid;"," continue;"," }"," if(noPointsRendered)"," {"," noPointsRendered = false;"," path.moveTo(nextX, nextY);"," }"," else if(lastPointValid)"," {"," if(lineType != \"dashed\")"," {"," path.lineTo(nextX, nextY);"," }"," else"," {"," this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, "," dashLength, "," gapSpace);"," }"," }"," else if(!connectDiscontinuousPoints)"," {"," path.moveTo(nextX, nextY);"," }"," else"," {"," if(discontinuousType != \"solid\")"," {"," this.drawDashedLine(path, lastValidX, lastValidY, nextX, nextY, "," discontinuousDashLength, "," discontinuousGapSpace);"," }"," else"," {"," path.lineTo(nextX, nextY);"," }"," }"," lastValidX = nextX;"," lastValidY = nextY;"," lastPointValid = true;"," }"," path.end();"," },"," "," /**"," * Connects data points with a consistent curve for a series."," * "," * @method drawSpline"," * @protected"," */"," drawSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords = this.getCurveControlPoints(xcoords, ycoords),"," len = curvecoords.length,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," styles = this.get(\"styles\").line,"," path = this._getGraphic(),"," lineAlpha = styles.alpha,"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"line\");"," path.set(\"stroke\", { "," weight: styles.weight, "," color: color, "," opacity: lineAlpha"," });"," path.moveTo(xcoords[0], ycoords[0]);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," path.end();"," },",""," /**"," * Draws a dashed line between two points."," * "," * @method drawDashedLine"," * @param {Number} xStart The x position of the start of the line"," * @param {Number} yStart The y position of the start of the line"," * @param {Number} xEnd The x position of the end of the line"," * @param {Number} yEnd The y position of the end of the line"," * @param {Number} dashSize the size of dashes, in pixels"," * @param {Number} gapSize the size of gaps between dashes, in pixels"," * @private"," */"," drawDashedLine: function(path, xStart, yStart, xEnd, yEnd, dashSize, gapSize)"," {"," dashSize = dashSize || 10;"," gapSize = gapSize || 10;"," var segmentLength = dashSize + gapSize,"," xDelta = xEnd - xStart,"," yDelta = yEnd - yStart,"," delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),"," segmentCount = Math.floor(Math.abs(delta / segmentLength)),"," radians = Math.atan2(yDelta, xDelta),"," xCurrent = xStart,"," yCurrent = yStart,"," i;"," xDelta = Math.cos(radians) * segmentLength;"," yDelta = Math.sin(radians) * segmentLength;"," "," for(i = 0; i < segmentCount; ++i)"," {"," path.moveTo(xCurrent, yCurrent);"," path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);"," xCurrent += xDelta;"," yCurrent += yDelta;"," }"," "," path.moveTo(xCurrent, yCurrent);"," delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));"," "," if(delta > dashSize)"," {"," path.lineTo(xCurrent + Math.cos(radians) * dashSize, yCurrent + Math.sin(radians) * dashSize);"," }"," else if(delta > 0)"," {"," path.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);"," }"," "," path.moveTo(xEnd, yEnd);"," },",""," /**"," * Default values for `styles` attribute."," *"," * @method _getLineDefaults"," * @return Object"," * @protected"," */"," _getLineDefaults: function()"," {"," return {"," alpha: 1,"," weight: 6,"," lineType:\"solid\", "," dashLength:10, "," gapSpace:10, "," connectDiscontinuousPoints:true, "," discontinuousType:\"solid\", "," discontinuousDashLength:10, "," discontinuousGapSpace:10"," };"," }","};","Y.augment(Lines, Y.Attribute);","Y.Lines = Lines;","/**"," * Utility class used for drawing area fills."," *"," * @module charts"," * @class Fills"," * @constructor"," */","function Fills(cfg)","{"," var attrs = {"," area: {"," getter: function()"," {"," return this._defaults || this._getAreaDefaults();"," },",""," setter: function(val)"," {"," var defaults = this._defaults || this._getAreaDefaults();"," this._defaults = Y.merge(defaults, val);"," }"," }"," };"," this.addAttrs(attrs, cfg);"," this.get(\"styles\");","}","","Fills.prototype = {"," /**"," * Returns a path shape used for drawing fills."," *"," * @method _getPath"," * @return Path"," * @private"," */"," _getPath: function()"," {"," var path = this._path;"," if(!path)"," {"," path = this.get(\"graph\").get(\"graphic\").addShape({type:\"path\"});"," this._path = path;"," }"," return path;"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," { "," if(this._path)"," {"," this._path.set(\"visible\", visible);"," }"," },",""," /**"," * Draws fill"," *"," * @method drawFill"," * @param {Array} xcoords The x-coordinates for the series."," * @param {Array} ycoords The y-coordinates for the series."," * @protected"," */"," drawFill: function(xcoords, ycoords)"," {"," if(xcoords.length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," len = xcoords.length,"," firstX = xcoords[0],"," firstY = ycoords[0],"," lastValidX = firstX,"," lastValidY = firstY,"," nextX,"," nextY,"," pointValid,"," noPointsRendered = true,"," i = 0,"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," path.clear();"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," for(; i < len; i = ++i)"," {"," nextX = xcoords[i];"," nextY = ycoords[i];"," pointValid = isNumber(nextX) && isNumber(nextY); "," if(!pointValid)"," {"," continue;"," }"," if(noPointsRendered)"," {"," this._firstValidX = nextX;"," this._firstValidY = nextY;"," noPointsRendered = false;"," path.moveTo(nextX, nextY);"," }"," else"," {"," path.lineTo(nextX, nextY);"," }"," lastValidX = nextX;"," lastValidY = nextY;"," }"," this._lastValidX = lastValidX;"," this._lastValidY = lastValidY;"," path.end();"," },"," "," /**"," * Draws a fill for a spline"," *"," * @method drawAreaSpline"," * @protected"," */"," drawAreaSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords = this.getCurveControlPoints(xcoords, ycoords),"," len = curvecoords.length,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," firstX = xcoords[0],"," firstY = ycoords[0],"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," path.moveTo(firstX, firstY);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," if(this.get(\"direction\") === \"vertical\")"," {"," path.lineTo(this._leftOrigin, y);"," path.lineTo(this._leftOrigin, firstY);"," }"," else"," {"," path.lineTo(x, this._bottomOrigin);"," path.lineTo(firstX, this._bottomOrigin);"," }"," path.lineTo(firstX, firstY);"," path.end();"," },"," "," /**"," * Draws a a stacked area spline"," *"," * @method drawStackedAreaSpline"," * @protected"," */"," drawStackedAreaSpline: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," curvecoords,"," order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," prevXCoords,"," prevYCoords,"," len,"," cx1,"," cx2,"," cy1,"," cy2,"," x,"," y,"," i = 0,"," firstX,"," firstY,"," styles = this.get(\"styles\").area,"," path = this._getPath(),"," color = styles.color || this._getDefaultColor(this.get(\"graphOrder\"), \"slice\");"," firstX = xcoords[0];"," firstY = ycoords[0];"," curvecoords = this.getCurveControlPoints(xcoords, ycoords);"," len = curvecoords.length;"," path.set(\"fill\", {"," color: color, "," opacity: styles.alpha"," });"," path.set(\"stroke\", {weight: 0});"," path.moveTo(firstX, firstY);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," if(order > 0)"," {"," prevXCoords = seriesCollection[order - 1].get(\"xcoords\").concat().reverse();"," prevYCoords = seriesCollection[order - 1].get(\"ycoords\").concat().reverse();"," curvecoords = this.getCurveControlPoints(prevXCoords, prevYCoords);"," i = 0;"," len = curvecoords.length;"," path.lineTo(prevXCoords[0], prevYCoords[0]);"," for(; i < len; i = ++i)"," {"," x = curvecoords[i].endx;"," y = curvecoords[i].endy;"," cx1 = curvecoords[i].ctrlx1;"," cx2 = curvecoords[i].ctrlx2;"," cy1 = curvecoords[i].ctrly1;"," cy2 = curvecoords[i].ctrly2;"," path.curveTo(cx1, cy1, cx2, cy2, x, y);"," }"," }"," else"," {"," if(this.get(\"direction\") === \"vertical\")"," {"," path.lineTo(this._leftOrigin, ycoords[ycoords.length-1]);"," path.lineTo(this._leftOrigin, firstY);"," }"," else"," {"," path.lineTo(xcoords[xcoords.length-1], this._bottomOrigin);"," path.lineTo(firstX, this._bottomOrigin);"," }",""," }"," path.lineTo(firstX, firstY);"," path.end();"," },"," "," /**"," * Storage for default area styles."," *"," * @property _defaults"," * @type Object"," * @private"," */"," _defaults: null,",""," /**"," * Concatenates coordinate array with correct coordinates for closing an area fill."," *"," * @method _getClosingPoints"," * @return Array"," * @protected"," */"," _getClosingPoints: function()"," {"," var xcoords = this.get(\"xcoords\").concat(),"," ycoords = this.get(\"ycoords\").concat(),"," firstValidIndex,"," lastValidIndex;"," if(this.get(\"direction\") === \"vertical\")"," {"," lastValidIndex = this._getLastValidIndex(xcoords);"," firstValidIndex = this._getFirstValidIndex(xcoords);"," ycoords.push(ycoords[lastValidIndex]);"," ycoords.push(ycoords[firstValidIndex]);"," xcoords.push(this._leftOrigin);"," xcoords.push(this._leftOrigin);"," }"," else"," {"," lastValidIndex = this._getLastValidIndex(ycoords);"," firstValidIndex = this._getFirstValidIndex(ycoords);"," xcoords.push(xcoords[lastValidIndex]);"," xcoords.push(xcoords[firstValidIndex]);"," ycoords.push(this._bottomOrigin);"," ycoords.push(this._bottomOrigin);"," }"," xcoords.push(xcoords[0]);"," ycoords.push(ycoords[0]);"," return [xcoords, ycoords];"," },",""," /**"," * Returns the order of the series closest to the current series that has a valid value for the current index."," *"," * @method _getHighestValidOrder"," * @param {Array} seriesCollection Array of series of a given type."," * @param {Number} index Index of the series item."," * @param {Number} order Index of the the series in the seriesCollection"," * @param {String} direction Indicates the direction of the series"," * @return Number"," * @private"," */"," _getHighestValidOrder: function(seriesCollection, index, order, direction)"," {"," var coords = direction == \"vertical\" ? \"stackedXCoords\" : \"stackedYCoords\","," coord;"," while(isNaN(coord) && order > -1)"," {"," order = order - 1;"," if(order > -1)"," {"," coord = seriesCollection[order].get(coords)[index];"," }"," }"," return order;"," },"," "," /**"," * Returns an array containing the x and y coordinates for a given series and index."," *"," * @method _getCoordsByOrderAndIndex"," * @param {Array} seriesCollection Array of series of a given type."," * @param {Number} index Index of the series item."," * @param {Number} order Index of the the series in the seriesCollection"," * @param {String} direction Indicates the direction of the series"," * @return Array"," * @private"," */"," _getCoordsByOrderAndIndex: function(seriesCollection, index, order, direction)"," {"," var xcoord,"," ycoord;"," if(direction == \"vertical\")"," {"," xcoord = order < 0 ? this._leftOrigin : seriesCollection[order].get(\"stackedXCoords\")[index];"," ycoord = this.get(\"stackedYCoords\")[index];"," }"," else"," {"," xcoord = this.get(\"stackedXCoords\")[index];"," ycoord = order < 0 ? this._bottomOrigin : seriesCollection[order].get(\"stackedYCoords\")[index];"," }"," return [xcoord, ycoord];"," },"," "," /**"," * Concatenates coordinate array with the correct coordinates for closing an area stack."," *"," * @method _getStackedClosingPoints"," * @return Array"," * @protected"," */"," _getStackedClosingPoints: function()"," {"," var order = this.get(\"order\"),"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," direction = this.get(\"direction\"),"," seriesCollection = graph.seriesTypes[type],"," firstValidIndex,"," lastValidIndex,"," xcoords = this.get(\"stackedXCoords\"),"," ycoords = this.get(\"stackedYCoords\"),"," limit,"," previousSeries,"," previousSeriesFirstValidIndex,"," previousSeriesLastValidIndex,"," previousXCoords,"," previousYCoords,"," coords,"," closingXCoords,"," closingYCoords,"," currentIndex,"," highestValidOrder,"," oldOrder;"," if(order < 1)"," { "," return this._getClosingPoints();"," }"," "," previousSeries = seriesCollection[order - 1];"," previousXCoords = previousSeries.get(\"stackedXCoords\").concat();"," previousYCoords = previousSeries.get(\"stackedYCoords\").concat();"," if(direction == \"vertical\")"," {"," firstValidIndex = this._getFirstValidIndex(xcoords);"," lastValidIndex = this._getLastValidIndex(xcoords);"," previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousXCoords);"," previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousXCoords);"," }"," else"," {"," firstValidIndex = this._getFirstValidIndex(ycoords);"," lastValidIndex = this._getLastValidIndex(ycoords);"," previousSeriesFirstValidIndex = previousSeries._getFirstValidIndex(previousYCoords);"," previousSeriesLastValidIndex = previousSeries._getLastValidIndex(previousYCoords);"," }"," if(previousSeriesLastValidIndex >= firstValidIndex && previousSeriesFirstValidIndex <= lastValidIndex)"," {"," previousSeriesFirstValidIndex = Math.max(firstValidIndex, previousSeriesFirstValidIndex);"," previousSeriesLastValidIndex = Math.min(lastValidIndex, previousSeriesLastValidIndex);"," previousXCoords = previousXCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);"," previousYCoords = previousYCoords.slice(previousSeriesFirstValidIndex, previousSeriesLastValidIndex + 1);"," limit = previousSeriesFirstValidIndex;"," }"," else"," {"," limit = lastValidIndex;"," }",""," closingXCoords = [xcoords[firstValidIndex]];"," closingYCoords = [ycoords[firstValidIndex]];"," currentIndex = firstValidIndex;"," while((isNaN(highestValidOrder) || highestValidOrder < order - 1) && currentIndex <= limit)"," {"," oldOrder = highestValidOrder;"," highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);"," if(!isNaN(oldOrder) && highestValidOrder > oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," currentIndex = currentIndex + 1;"," }"," if(previousXCoords && previousXCoords.length > 0 && previousSeriesLastValidIndex > firstValidIndex && previousSeriesFirstValidIndex < lastValidIndex)"," {"," closingXCoords = closingXCoords.concat(previousXCoords);"," closingYCoords = closingYCoords.concat(previousYCoords);"," highestValidOrder = order -1; "," }"," currentIndex = Math.max(firstValidIndex, previousSeriesLastValidIndex);"," order = order - 1;"," highestValidOrder = NaN;"," while(currentIndex <= lastValidIndex)"," {"," oldOrder = highestValidOrder;"," highestValidOrder = this._getHighestValidOrder(seriesCollection, currentIndex, order, direction);"," if(!isNaN(oldOrder))"," {"," if(highestValidOrder > oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, oldOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," else if(highestValidOrder < oldOrder)"," {"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex - 1, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," }"," }"," coords = this._getCoordsByOrderAndIndex(seriesCollection, currentIndex, highestValidOrder, direction);"," closingXCoords.push(coords[0]);"," closingYCoords.push(coords[1]);"," currentIndex = currentIndex + 1;"," }",""," closingXCoords.reverse();"," closingYCoords.reverse();"," return [xcoords.concat(closingXCoords), ycoords.concat(closingYCoords)];"," },",""," /**"," * Returns default values for area styles."," *"," * @method _getAreaDefaults"," * @return Object"," * @private"," */"," _getAreaDefaults: function()"," {"," return {"," };"," }","};","Y.augment(Fills, Y.Attribute);","Y.Fills = Fills;","/**"," * Utility class used for drawing markers."," *"," * @module charts"," * @submodule charts-base"," * @class Plots"," * @constructor"," */","function Plots(cfg)","{"," var attrs = { "," markers: {"," getter: function()"," {"," return this._markers;"," }"," }"," };"," this.addAttrs(attrs, cfg);","}","","Plots.prototype = {"," /**"," * Storage for default marker styles."," *"," * @property _plotDefaults"," * @type Object"," * @private"," */"," _plotDefaults: null,",""," /**"," * Draws the markers"," *"," * @method drawPlots"," * @protected"," */"," drawPlots: function()"," {"," if(!this.get(\"xcoords\") || this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker),"," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," left,"," marker,"," offsetWidth = w/2,"," offsetHeight = h/2,"," xvalues,"," yvalues,"," fillColors = null,"," borderColors = null,"," graphOrder = this.get(\"graphOrder\"),"," groupMarkers = this.get(\"groupMarkers\");"," if(groupMarkers)"," {"," xvalues = [];"," yvalues = [];"," for(; i < len; ++i)"," {"," xvalues.push(parseFloat(xcoords[i] - offsetWidth));"," yvalues.push(parseFloat(ycoords[i] - offsetHeight));"," }"," this._createGroupMarker({"," xvalues: xvalues,"," yvalues: yvalues,"," fill: style.fill,"," border: style.border,"," dimensions: {"," width: w,"," height: h"," },"," graphOrder: graphOrder,"," shape: style.shape"," });"," return;"," }"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," for(; i < len; ++i)"," {"," top = parseFloat(ycoords[i] - offsetHeight);"," left = parseFloat(xcoords[i] - offsetWidth); "," if(!isNumber(left) || !isNumber(top))"," {"," this._markers.push(null);"," continue;"," }"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }",""," style.x = left;"," style.y = top;"," marker = this.getMarker(style, graphOrder, i);"," }"," this._clearMarkerCache();"," },",""," /**"," * Pre-defined group shapes."," *"," * @property _groupShapes"," * @private"," */"," _groupShapes: {"," circle: Y.CircleGroup,"," rect: Y.RectGroup,"," ellipse: Y.EllipseGroup,"," diamond: Y.DiamondGroup"," },",""," /**"," * Returns the correct group shape class."," *"," * @method _getGroupShape"," * @param {Shape | String} shape Indicates which shape class. "," * @return Function"," * @protected"," */"," _getGroupShape: function(shape)"," {"," if(Y_Lang.isString(shape))"," {"," shape = this._groupShapes[shape];"," }"," return shape;"," },",""," /**"," * Gets the default values for series that use the utility. This method is used by"," * the class' `styles` attribute's getter to get build default values."," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 1,"," alpha: 1"," },"," width: 10,"," height: 10,"," shape: \"circle\""," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," },",""," /**"," * Collection of markers to be used in the series."," *"," * @property _markers"," * @type Array"," * @private"," */"," _markers: null,",""," /**"," * Collection of markers to be re-used on a series redraw."," *"," * @property _markerCache"," * @type Array"," * @private"," */"," _markerCache: null,"," "," /**"," * Gets and styles a marker. If there is a marker in cache, it will use it. Otherwise"," * it will create one."," *"," * @method getMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @protected"," */"," getMarker: function(styles, order, index)"," {"," var marker,"," border = styles.border;"," styles.id = this.get(\"chart\").get(\"id\") + \"_\" + order + \"_\" + index;"," //fix name differences between graphic layer"," border.opacity = border.alpha;"," styles.stroke = border;"," styles.fill.opacity = styles.fill.alpha;"," if(this._markerCache.length > 0)"," {"," while(!marker)"," {"," if(this._markerCache.length < 1)"," {"," marker = this._createMarker(styles, order, index);"," break;"," }"," marker = this._markerCache.shift();",""," }"," marker.set(styles);"," }"," else"," {"," marker = this._createMarker(styles, order, index);"," }"," this._markers.push(marker);"," return marker;"," },"," "," /**"," * Creates a shape to be used as a marker."," *"," * @method _createMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @private"," */"," _createMarker: function(styles, order, index)"," {"," var graphic = this.get(\"graphic\"),"," marker,"," cfg = Y.clone(styles);"," graphic.set(\"autoDraw\", false);"," cfg.type = cfg.shape;"," marker = graphic.addShape(cfg); "," marker.addClass(SERIES_MARKER);"," return marker;"," },"," "," /**"," * Creates a cache of markers for reuse."," *"," * @method _createMarkerCache"," * @private"," */"," _createMarkerCache: function()"," {"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," this._groupMarker = null;"," }"," if(this._markers && this._markers.length > 0)"," {"," this._markerCache = this._markers.concat();"," }"," else"," {"," this._markerCache = [];"," }"," this._markers = [];"," },"," "," /**"," * Draws a series of markers in a single shape instance."," *"," * @method _createGroupMarkers"," * @param {Object} styles Set of configuration properties used to create the markers."," * @protected"," */"," _createGroupMarker: function(styles)"," {"," var marker,"," markers = this.get(\"markers\"),"," border = styles.border,"," graphic,"," cfg,"," shape;"," if(markers && markers.length > 0)"," {"," while(markers.length > 0)"," {"," marker = markers.shift();"," marker.destroy();"," }"," this.set(\"markers\", []);"," }"," //fix name differences between graphic layer"," border.opacity = border.alpha;"," cfg = {"," id: this.get(\"chart\").get(\"id\") + \"_\" + styles.graphOrder,"," stroke: border,"," fill: styles.fill,"," dimensions: styles.dimensions,"," xvalues: styles.xvalues,"," yvalues: styles.yvalues"," };"," cfg.fill.opacity = styles.fill.alpha;"," shape = this._getGroupShape(styles.shape);"," if(shape)"," {"," cfg.type = shape;"," }"," if(styles.hasOwnProperty(\"radius\") && !isNaN(styles.radius))"," {"," cfg.dimensions.radius = styles.radius;"," }"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," }"," graphic = this.get(\"graphic\");"," this._groupMarker = graphic.addShape(cfg);"," graphic._redraw();"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," var marker,"," markers = this.get(\"markers\"),"," i = 0,"," len;"," if(markers)"," {"," len = markers.length;"," for(; i < len; ++i)"," {"," marker = markers[i];"," if(marker)"," {"," marker.set(\"visible\", visible);"," }"," }"," }"," },",""," /**"," * Removes unused markers from the marker cache"," *"," * @method _clearMarkerCache"," * @private"," */"," _clearMarkerCache: function()"," {"," var marker;"," while(this._markerCache.length > 0)"," {"," marker = this._markerCache.shift();"," if(marker)"," {"," marker.destroy();"," }"," }"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var w,"," h,"," styles = Y.clone(this.get(\"styles\").marker),"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," markerStyles.stroke = markerStyles.border;"," marker.set(markerStyles);"," w = markerStyles.width;"," h = markerStyles.height;"," marker.set(\"x\", (xcoords[i] - w/2));"," marker.set(\"y\", (ycoords[i] - h/2));"," marker.set(\"visible\", this.get(\"visible\"));"," }"," },",""," /**"," * Parses a color from an array."," *"," * @method _getItemColor"," * @param {Array} val collection of colors"," * @param {Number} i index of the item"," * @return String"," * @protected"," */"," _getItemColor: function(val, i)"," {"," if(Y_Lang.isArray(val))"," {"," return val[i % val.length];"," }"," return val;"," },",""," /**"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," * @protected"," */"," _setStyles: function(val)"," {"," val = this._parseMarkerStyles(val);"," return Y.Renderer.prototype._setStyles.apply(this, [val]);"," },",""," /**"," * Combines new styles with existing styles."," *"," * @method _parseMarkerStyles"," * @param {Object} Object containing style properties for the marker."," * @return Object"," * @private"," */"," _parseMarkerStyles: function(val)"," {"," if(val.marker)"," {"," var defs = this._getPlotDefaults();"," val.marker = this._mergeStyles(val.marker, defs);"," if(val.marker.over)"," {"," val.marker.over = this._mergeStyles(val.marker.over, val.marker);"," }"," if(val.marker.down)"," {"," val.marker.down = this._mergeStyles(val.marker.down, val.marker);"," }"," }"," return val;"," },",""," /**"," * Returns marker state based on event type"," *"," * @method _getState"," * @param {String} type event type"," * @return String"," * @protected"," */"," _getState: function(type)"," {"," var state;"," switch(type)"," {"," case \"mouseout\" :"," state = \"off\";"," break;"," case \"mouseover\" :"," state = \"over\";"," break;"," case \"mouseup\" :"," state = \"over\";"," break;"," case \"mousedown\" :"," state = \"down\";"," break;"," }"," return state;"," },"," "," /**"," * @property _statSyles"," * @type Object"," * @private"," */"," _stateSyles: null","};","","Y.augment(Plots, Y.Attribute);","Y.Plots = Plots;","/**"," * Histogram is the base class for Column and Bar series."," *"," * @module charts"," * @submodule charts-base"," * @class Histogram"," * @constructor"," */","function Histogram(){}","","Histogram.prototype = {"," /**"," * Draws the series."," *"," * @method drawSeries"," * @protected"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var style = Y.clone(this.get(\"styles\").marker),"," setSize,"," calculatedSize,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," seriesLen = seriesCollection.length,"," seriesSize = 0,"," totalSize = 0,"," offset = 0,"," ratio,"," renderer,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," setSizeKey,"," calculatedSizeKey,"," config,"," fillColors = null,"," borderColors = null,"," xMarkerPlane = [],"," yMarkerPlane = [],"," xMarkerPlaneLeft,"," xMarkerPlaneRight,"," yMarkerPlaneTop,"," yMarkerPlaneBottom,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," if(this.get(\"direction\") == \"vertical\")"," {"," setSizeKey = \"height\";"," calculatedSizeKey = \"width\";"," }"," else"," {"," setSizeKey = \"width\";"," calculatedSizeKey = \"height\";"," }"," setSize = style[setSizeKey];"," calculatedSize = style[calculatedSizeKey];"," this._createMarkerCache();"," for(; i < seriesLen; ++i)"," {"," renderer = seriesCollection[i];"," seriesSize += renderer.get(\"styles\").marker[setSizeKey];"," if(order > i) "," {"," offset = seriesSize;"," }"," }"," totalSize = len * seriesSize;"," this._maxSize = graph.get(setSizeKey);"," if(totalSize > this._maxSize)"," {"," ratio = graph.get(setSizeKey)/totalSize;"," seriesSize *= ratio;"," offset *= ratio;"," setSize *= ratio;"," setSize = Math.max(setSize, 1);"," this._maxSize = setSize;"," }"," offset -= seriesSize/2;"," for(i = 0; i < len; ++i)"," {"," xMarkerPlaneLeft = xcoords[i] - seriesSize/2;"," xMarkerPlaneRight = xMarkerPlaneLeft + seriesSize;"," yMarkerPlaneTop = ycoords[i] - seriesSize/2;"," yMarkerPlaneBottom = yMarkerPlaneTop + seriesSize;"," xMarkerPlane.push({start: xMarkerPlaneLeft, end: xMarkerPlaneRight});"," yMarkerPlane.push({start: yMarkerPlaneTop, end: yMarkerPlaneBottom});"," if(isNaN(xcoords[i]) || isNaN(ycoords[i]))"," {"," this._markers.push(null);"," continue;"," }"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], calculatedSize, offset);"," if(!isNaN(config.calculatedSize) && config.calculatedSize > 0)"," {"," top = config.top;"," left = config.left;",""," if(groupMarkers)"," {"," dimensions[setSizeKey][i] = setSize;"," dimensions[calculatedSizeKey][i] = config.calculatedSize;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style[setSizeKey] = setSize;"," style[calculatedSizeKey] = config.calculatedSize;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }",""," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," this.set(\"xMarkerPlane\", xMarkerPlane);"," this.set(\"yMarkerPlane\", yMarkerPlane);"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },"," "," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],"," "," /**"," * Gets the default style values for the markers."," *"," * @method _getPlotDefaults"," * @return Object"," * @private"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 12,"," height: 12,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","};","","Y.Histogram = Histogram;","/**"," * The CartesianSeries class creates a chart with horizontal and vertical axes."," *"," * @module charts"," * @submodule charts-base"," * @class CartesianSeries"," * @extends Base"," * @uses Renderer"," * @constructor"," */","Y.CartesianSeries = Y.Base.create(\"cartesianSeries\", Y.Base, [Y.Renderer], {"," /**"," * Storage for `xDisplayName` attribute."," *"," * @property _xDisplayName"," * @type String"," * @private"," */"," _xDisplayName: null,",""," /**"," * Storage for `yDisplayName` attribute."," *"," * @property _yDisplayName"," * @type String"," * @private"," */"," _yDisplayName: null,"," "," /**"," * Th x-coordinate for the left edge of the series."," *"," * @property _leftOrigin"," * @type String"," * @private"," */"," _leftOrigin: null,",""," /**"," * The y-coordinate for the bottom edge of the series."," * "," * @property _bottomOrigin"," * @type String"," * @private"," */"," _bottomOrigin: null,",""," /**"," * @method render"," * @private"," */"," render: function()"," {"," this._setCanvas();"," this.addListeners();"," this.set(\"rendered\", true);"," this.validate();"," },",""," /**"," * Adds event listeners."," *"," * @method addListeners"," * @private"," */"," addListeners: function()"," {"," var xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\");"," if(xAxis)"," {"," this._xDataReadyHandle = xAxis.after(\"dataReady\", Y.bind(this._xDataChangeHandler, this));"," this._xDataUpdateHandle = xAxis.after(\"dataUpdate\", Y.bind(this._xDataChangeHandler, this));"," }"," if(yAxis)"," {"," this._yDataReadyHandle = yAxis.after(\"dataReady\", Y.bind(this._yDataChangeHandler, this));"," this._yDataUpdateHandle = yAxis.after(\"dataUpdate\", Y.bind(this._yDataChangeHandler, this));"," }"," this._xAxisChangeHandle = this.after(\"xAxisChange\", this._xAxisChangeHandler);"," this._yAxisChangeHandle = this.after(\"yAxisChange\", this._yAxisChangeHandler);"," this._stylesChangeHandle = this.after(\"stylesChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._widthChangeHandle = this.after(\"widthChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._heightChangeHandle = this.after(\"heightChange\", function(e) {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," });"," this._visibleChangeHandle = this.after(\"visibleChange\", this._handleVisibleChange);"," },"," "," /**"," * Event handler for the xAxisChange event."," *"," * @method _xAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _xAxisChangeHandler: function(e)"," {"," var xAxis = this.get(\"xAxis\");"," xAxis.after(\"dataReady\", Y.bind(this._xDataChangeHandler, this));"," xAxis.after(\"dataUpdate\", Y.bind(this._xDataChangeHandler, this));"," },"," "," /**"," * Event handler the yAxisChange event."," *"," * @method _yAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _yAxisChangeHandler: function(e)"," {"," var yAxis = this.get(\"yAxis\");"," yAxis.after(\"dataReady\", Y.bind(this._yDataChangeHandler, this));"," yAxis.after(\"dataUpdate\", Y.bind(this._yDataChangeHandler, this));"," },",""," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"yuicartesianseries\",",""," /**"," * Event handler for xDataChange event."," *"," * @method _xDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _xDataChangeHandler: function(event)"," {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," },",""," /**"," * Event handler for yDataChange event."," *"," * @method _yDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _yDataChangeHandler: function(event)"," {"," var axesReady = this._updateAxisData();"," if(axesReady)"," {"," this.draw();"," }"," },",""," /**"," * Checks to ensure that both xAxis and yAxis data are available. If so, set the `xData` and `yData` attributes and return `true`. Otherwise, return `false`."," *"," * @method _updateAxisData"," * @return Boolean"," * @private "," */"," _updateAxisData: function()"," {"," var xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\"),"," xKey = this.get(\"xKey\"),"," yKey = this.get(\"yKey\"),"," yData,"," xData;"," if(!xAxis || !yAxis || !xKey || !yKey)"," {"," return false;"," }"," xData = xAxis.getDataByKey(xKey);"," yData = yAxis.getDataByKey(yKey);"," if(!xData || !yData)"," {"," return false;"," }"," this.set(\"xData\", xData.concat());"," this.set(\"yData\", yData.concat());"," return true;"," },",""," /**"," * Draws the series is the xAxis and yAxis data are both available."," *"," * @method validate"," * @private"," */"," validate: function()"," {"," if((this.get(\"xData\") && this.get(\"yData\")) || this._updateAxisData())"," {"," this.draw();"," }"," else"," {"," this.fire(\"drawingComplete\");"," }"," },",""," /**"," * Creates a `Graphic` instance."," *"," * @method _setCanvas"," * @protected"," */"," _setCanvas: function()"," {"," var graph = this.get(\"graph\"),"," graphic = graph.get(\"graphic\");"," this.set(\"graphic\", graphic);"," },",""," /**"," * Calculates the coordinates for the series."," *"," * @method setAreaData"," * @protected"," */"," setAreaData: function()"," {"," var isNumber = Y_Lang.isNumber,"," nextX, nextY,"," graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\"),"," xAxis = this.get(\"xAxis\"),"," yAxis = this.get(\"yAxis\"),"," xData = this.get(\"xData\").concat(),"," yData = this.get(\"yData\").concat(),"," xValue,"," yValue,"," xOffset = xAxis.getEdgeOffset(xData.length, w),"," yOffset = yAxis.getEdgeOffset(yData.length, h),"," padding = this.get(\"styles\").padding,"," leftPadding = padding.left,"," topPadding = padding.top,"," dataWidth = w - (leftPadding + padding.right + xOffset),"," dataHeight = h - (topPadding + padding.bottom + yOffset),"," xcoords = [],"," ycoords = [],"," xMax = xAxis.get(\"maximum\"),"," xMin = xAxis.get(\"minimum\"),"," yMax = yAxis.get(\"maximum\"),"," yMin = yAxis.get(\"minimum\"),"," xScaleFactor = dataWidth / (xMax - xMin),"," yScaleFactor = dataHeight / (yMax - yMin),"," dataLength,"," direction = this.get(\"direction\"),"," i = 0,"," xMarkerPlane = [],"," yMarkerPlane = [],"," xMarkerPlaneOffset = this.get(\"xMarkerPlaneOffset\"),"," yMarkerPlaneOffset = this.get(\"yMarkerPlaneOffset\"),"," graphic = this.get(\"graphic\");"," graphic.set(\"width\", w);"," graphic.set(\"height\", h);"," dataLength = xData.length;"," xOffset *= 0.5;"," yOffset *= 0.5;"," //Assuming a vertical graph has a range/category for its vertical axis. "," if(direction === \"vertical\")"," {"," yData = yData.reverse();"," }"," this._leftOrigin = Math.round(((0 - xMin) * xScaleFactor) + leftPadding + xOffset);"," this._bottomOrigin = Math.round((dataHeight + topPadding + yOffset)); "," if(yMin < 0)"," {"," this._bottomOrigin = this._bottomOrigin - ((0 - yMin) * yScaleFactor);"," }"," for (; i < dataLength; ++i) "," {"," xValue = parseFloat(xData[i]);"," yValue = parseFloat(yData[i]);"," if(isNumber(xValue))"," {"," nextX = (((xValue - xMin) * xScaleFactor) + leftPadding + xOffset);"," }"," else"," {"," nextX = NaN;"," }"," if(isNumber(yValue))"," {"," nextY = ((dataHeight + topPadding + yOffset) - (yValue - yMin) * yScaleFactor);"," }"," else"," {"," nextY = NaN;"," }"," xcoords.push(nextX);"," ycoords.push(nextY);"," xMarkerPlane.push({start:nextX - xMarkerPlaneOffset, end: nextX + xMarkerPlaneOffset});"," yMarkerPlane.push({start:nextY - yMarkerPlaneOffset, end: nextY + yMarkerPlaneOffset});"," }"," this.set(\"xcoords\", xcoords);"," this.set(\"ycoords\", ycoords);"," this.set(\"xMarkerPlane\", xMarkerPlane);"," this.set(\"yMarkerPlane\", yMarkerPlane);"," this._dataLength = dataLength;"," },",""," /**"," * Finds the first valid index of an array coordinates."," *"," * @method _getFirstValidIndex"," * @param {Array} coords An array of x or y coordinates."," * @return Number"," * @private"," */"," _getFirstValidIndex: function(coords)"," {"," var coord,"," i = -1,"," limit = coords.length;"," while(!Y_Lang.isNumber(coord) && i < limit)"," {"," i += 1;"," coord = coords[i];"," }"," return i;"," },",""," /**"," * Finds the last valid index of an array coordinates."," *"," * @method _getLastValidIndex"," * @param {Array} coords An array of x or y coordinates."," * @return Number"," * @private"," */"," _getLastValidIndex: function(coords)"," {"," var coord,"," i = coords.length,"," limit = -1;"," while(!Y_Lang.isNumber(coord) && i > limit)"," {"," i -= 1;"," coord = coords[i];"," }"," return i;"," },",""," /**"," * Draws the series."," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," var graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\");"," if(this.get(\"rendered\"))"," {"," if((isFinite(w) && isFinite(h) && w > 0 && h > 0) && ((this.get(\"xData\") && this.get(\"yData\")) || this._updateAxisData()))"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," this.setAreaData();"," if(this.get(\"xcoords\") && this.get(\"ycoords\"))"," {"," this.drawSeries();"," }"," this._drawing = false;"," if(this._callLater)"," {"," this.draw();"," }"," else"," {"," this._toggleVisible(this.get(\"visible\"));"," this.fire(\"drawingComplete\");"," }"," }"," }"," },"," "," /**"," * Default value for plane offsets when the parent chart's `interactiveType` is `planar`. "," *"," * @property _defaultPlaneOffset"," * @type Number"," * @private"," */"," _defaultPlaneOffset: 4,"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," return {padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }};"," },",""," /**"," * Collection of default colors used for lines in a series when not specified by user."," *"," * @property _defaultLineColors"," * @type Array"," * @protected"," */"," _defaultLineColors:[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"],",""," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors:[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"],"," "," /**"," * Collection of default colors used for marker borders in a series when not specified by user."," *"," * @property _defaultBorderColors"," * @type Array"," * @protected"," */"," _defaultBorderColors:[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"],"," "," /**"," * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user."," *"," * @property _defaultSliceColors"," * @type Array"," * @protected"," */"," _defaultSliceColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],",""," /**"," * Parses a color based on a series order and type."," *"," * @method _getDefaultColor"," * @param {Number} index Index indicating the series order."," * @param {String} type Indicates which type of object needs the color."," * @return String"," * @protected"," */"," _getDefaultColor: function(index, type)"," {"," var colors = {"," line: this._defaultLineColors,"," fill: this._defaultFillColors,"," border: this._defaultBorderColors,"," slice: this._defaultSliceColors"," },"," col = colors[type],"," l = col.length;"," index = index || 0;"," if(index >= l)"," {"," index = index % l;"," }"," type = type || \"fill\";"," return colors[type][index];"," },"," "," /**"," * Shows/hides contents of the series."," *"," * @method _handleVisibleChange"," * @param {Object} e Event object."," * @protected"," */"," _handleVisibleChange: function(e) "," {"," this._toggleVisible(this.get(\"visible\"));"," },",""," /**"," * Returns the sum of all values for the series."," *"," * @method getTotalValues"," * @return Number"," */"," getTotalValues: function()"," {"," var total = this.get(\"valueAxis\").getTotalByKey(this.get(\"valueKey\"));"," return total;"," },",""," /**"," * Destructor implementation for the CartesianSeries class. Calls destroy on all Graphic instances."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var marker,"," markers = this.get(\"markers\");"," if(this.get(\"rendered\"))"," {"," if(this._xDataReadyHandle)"," {"," this._xDataReadyHandle.detach();"," }"," if(this._xDataUpdateHandle)"," {"," this._xDataUpdateHandle.detach();"," }"," if(this._yDataReadyHandle)"," {"," this._yDataReadyHandle.detach();"," }"," if(this._yDataUpdateHandle)"," {"," this._yDataUpdateHandle.detach();"," }"," this._xAxisChangeHandle.detach();"," this._yAxisChangeHandle.detach();"," this._stylesChangeHandle.detach();"," this._widthChangeHandle.detach();"," this._heightChangeHandle.detach();"," this._visibleChangeHandle.detach();"," }"," while(markers && markers.length > 0)"," {"," marker = markers.shift();"," if(marker && marker instanceof Y.Shape)"," {"," marker.destroy();"," }"," }"," if(this._path)"," {"," this._path.destroy();"," this._path = null;"," }"," if(this._lineGraphic)"," {"," this._lineGraphic.destroy();"," this._lineGraphic = null;"," }"," if(this._groupMarker)"," {"," this._groupMarker.destroy();"," this._groupMarker = null;"," }"," }"," /**"," * Event handle for the x-axis' dataReady event."," * "," * @property _xDataReadyHandle"," * @type {EventHandle}"," * @private"," */"," "," /**"," * Event handle for the x-axis dataUpdate event."," *"," * @property _xDataUpdateHandle"," * @type {EventHandle}"," * @private"," */"," "," /**"," * Event handle for the y-axis dataReady event."," *"," * @property _yDataReadyHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the y-axis dataUpdate event."," * @property _yDataUpdateHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the xAxisChange event."," * @property _xAxisChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the yAxisChange event."," * @property _yAxisChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the stylesChange event."," * @property _stylesChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the widthChange event."," * @property _widthChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the heightChange event."," * @property _heightChangeHandle"," * @type {EventHandle}"," * @private"," */",""," /**"," * Event handle for the visibleChange event."," * @property _visibleChangeHandle"," * @type {EventHandle}"," * @private"," */","}, {"," ATTRS: {"," /**"," * Name used for for displaying data related to the x-coordinate."," *"," * @attribute xDisplayName"," * @type String"," */"," xDisplayName: {"," getter: function()"," {"," return this._xDisplayName || this.get(\"xKey\");"," },",""," setter: function(val)"," {"," this._xDisplayName = val.toString();"," return val;"," }"," },",""," /**"," * Name used for for displaying data related to the y-coordinate."," *"," * @attribute yDisplayName"," * @type String"," */"," yDisplayName: {"," getter: function()"," {"," return this._yDisplayName || this.get(\"yKey\");"," },",""," setter: function(val)"," {"," this._yDisplayName = val.toString();"," return val;"," }"," },"," "," /**"," * Name used for for displaying category data"," *"," * @attribute categoryDisplayName"," * @type String"," * @readOnly"," */"," categoryDisplayName: {"," lazyAdd: false,",""," getter: function()"," {"," return this.get(\"direction\") == \"vertical\" ? this.get(\"yDisplayName\") : this.get(\"xDisplayName\");"," },",""," setter: function(val)"," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._yDisplayName = val;"," }"," else"," {"," this._xDisplayName = val;"," }"," return val;"," }"," },",""," /**"," * Name used for for displaying value data"," *"," * @attribute valueDisplayName"," * @type String"," * @readOnly"," */"," valueDisplayName: {"," lazyAdd: false,",""," getter: function()"," {"," return this.get(\"direction\") == \"vertical\" ? this.get(\"xDisplayName\") : this.get(\"yDisplayName\");"," },",""," setter: function(val)"," {"," if(this.get(\"direction\") == \"vertical\")"," {"," this._xDisplayName = val;"," }"," else"," {"," this._yDisplayName = val;"," }"," return val;"," }"," },"," "," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default cartesian"," */"," type: { "," value: \"cartesian\""," },",""," /**"," * Order of this instance of this `type`."," *"," * @attribute order"," * @type Number"," */"," order: {},",""," /**"," * Order of the instance"," *"," * @attribute graphOrder"," * @type Number"," */"," graphOrder: {},",""," /**"," * x coordinates for the series."," *"," * @attribute xcoords"," * @type Array"," */"," xcoords: {},"," "," /**"," * y coordinates for the series"," *"," * @attribute ycoords"," * @type Array"," */"," ycoords: {},",""," /**"," * Reference to the `Chart` application."," *"," * @attribute chart"," * @type ChartBase"," * @readOnly"," */"," chart: {"," readOnly: true,",""," getter: function()"," {"," return this.get(\"graph\").get(\"chart\");"," }"," },"," "," /**"," * Reference to the `Graph` in which the series is drawn into."," *"," * @attribute graph"," * @type Graph"," */"," graph: {},",""," /**"," * Reference to the `Axis` instance used for assigning "," * x-values to the graph."," *"," * @attribute xAxis"," * @type Axis"," */"," xAxis: {},"," "," /**"," * Reference to the `Axis` instance used for assigning "," * y-values to the graph."," *"," * @attribute yAxis"," * @type Axis"," */"," yAxis: {},"," "," /**"," * Indicates which array to from the hash of value arrays in "," * the x-axis `Axis` instance."," *"," * @attribute xKey"," * @type String"," */"," xKey: {"," setter: function(val)"," {"," return val.toString();"," }"," },",""," /**"," * Indicates which array to from the hash of value arrays in "," * the y-axis `Axis` instance."," *"," * @attribute yKey"," * @type String"," */"," yKey: {"," setter: function(val)"," {"," return val.toString();"," }"," },",""," /**"," * Array of x values for the series."," *"," * @attribute xData"," * @type Array"," */"," xData: {},",""," /**"," * Array of y values for the series."," *"," * @attribute yData"," * @type Array"," */"," yData: {},"," "," /**"," * Indicates whether the Series has been through its initial set up."," *"," * @attribute rendered"," * @type Boolean"," */"," rendered: {"," value: false"," },",""," /*"," * Returns the width of the parent graph"," *"," * @attribute width"," * @type Number"," */"," width: {"," readOnly: true,"," "," getter: function()"," {"," this.get(\"graph\").get(\"width\");"," }"," },",""," /**"," * Returns the height of the parent graph"," *"," * @attribute height"," * @type Number"," */"," height: {"," readOnly: true,"," "," getter: function()"," {"," this.get(\"graph\").get(\"height\");"," }"," },",""," /**"," * Indicates whether to show the series"," *"," * @attribute visible"," * @type Boolean"," * @default true"," */"," visible: {"," value: true"," },",""," /**"," * Collection of area maps along the xAxis. Used to determine mouseover for multiple"," * series."," *"," * @attribute xMarkerPlane"," * @type Array"," */"," xMarkerPlane: {},"," "," /**"," * Collection of area maps along the yAxis. Used to determine mouseover for multiple"," * series."," *"," * @attribute yMarkerPlane"," * @type Array"," */"," yMarkerPlane: {},",""," /**"," * Distance from a data coordinate to the left/right for setting a hotspot."," *"," * @attribute xMarkerPlaneOffset"," * @type Number"," */"," xMarkerPlaneOffset: {"," getter: function() {"," var marker = this.get(\"styles\").marker;"," if(marker && marker.width && isFinite(marker.width))"," {"," return marker.width * 0.5;"," }"," return this._defaultPlaneOffset;"," }"," },",""," /**"," * Distance from a data coordinate to the top/bottom for setting a hotspot."," *"," * @attribute yMarkerPlaneOffset"," * @type Number"," */"," yMarkerPlaneOffset: {"," getter: function() {"," var marker = this.get(\"styles\").marker;"," if(marker && marker.height && isFinite(marker.height))"," {"," return marker.height * 0.5;"," }"," return this._defaultPlaneOffset;"," }"," },",""," /**"," * Direction of the series"," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"horizontal\""," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," getter: function()"," {"," if(this._groupMarkers === undefined)"," {"," return this.get(\"graph\").get(\"groupMarkers\");"," }"," else"," {"," return this._groupMarkers;"," }"," },",""," setter: function(val)"," {"," this._groupMarkers = val;"," return val;"," }"," }"," }","});","/**"," * The MarkerSeries class renders quantitative data by plotting relevant data points "," * on a graph."," *"," * @module charts"," * @submodule charts-base"," * @class MarkerSeries"," * @extends CartesianSeries"," * @uses Plots"," * @constructor"," */","Y.MarkerSeries = Y.Base.create(\"markerSeries\", Y.CartesianSeries, [Y.Plots], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawPlots();"," },"," "," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.marker)"," {"," val = {marker:val};"," }"," val = this._parseMarkerStyles(val);"," return Y.MarkerSeries.superclass._mergeStyles.apply(this, [val, this._getDefaultStyles()]);"," },"," "," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({marker:this._getPlotDefaults()}, Y.MarkerSeries.superclass._getDefaultStyles());"," return styles;"," }","},{"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default marker"," */"," type: {"," value:\"marker\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>"," * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * The LineSeries class renders quantitative data on a graph by connecting relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class LineSeries"," * @extends CartesianSeries"," * @uses Lines"," * @constructor"," */","Y.LineSeries = Y.Base.create(\"lineSeries\", Y.CartesianSeries, [Y.Lines], {"," /**"," * @protected"," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawLines();"," },",""," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.line)"," {"," val = {line:val};"," }"," return Y.LineSeries.superclass._setStyles.apply(this, [val]);"," },",""," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({line:this._getLineDefaults()}, Y.LineSeries.superclass._getDefaultStyles());"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default line"," */"," type: {"," value:\"line\""," }",""," /**"," * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * SplineSeries renders a graph with data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class SplineSeries"," * @constructor"," * @extends CartesianSeries"," * @uses CurveUtil"," * @uses Lines"," */","Y.SplineSeries = Y.Base.create(\"splineSeries\", Y.LineSeries, [Y.CurveUtil, Y.Lines], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default spline"," */"," type : {"," value:\"spline\""," }",""," /**"," * Style properties used for drawing lines. This attribute is inherited from `Renderer`. Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * StackedSplineSeries creates spline graphs in which the different series are stacked along a value axis"," * to indicate their contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedSplineSeries"," * @constructor"," * @extends SplineSeries"," * @extends StackingUtil"," */","Y.StackedSplineSeries = Y.Base.create(\"stackedSplineSeries\", Y.SplineSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedSplineSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedSpline"," */"," type: {"," value:\"stackedSpline\""," }"," }","});","","/**"," * StackedMarkerSeries plots markers with different series stacked along the value axis to indicate each"," * series' contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedMarkerSeries"," * @constructor"," * @extends MarkerSeries"," * @extends StackingUtil"," */","Y.StackedMarkerSeries = Y.Base.create(\"stackedMarkerSeries\", Y.MarkerSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedMarkerSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedMarker"," */"," type: {"," value:\"stackedMarker\""," }"," }","});","","/**"," * The ColumnSeries class renders columns positioned horizontally along a category or time axis. The columns'"," * lengths are proportional to the values they represent along a vertical axis."," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class ColumnSeries"," * @extends MarkerSeries"," * @uses Histogram"," * @constructor"," */","Y.ColumnSeries = Y.Base.create(\"columnSeries\", Y.MarkerSeries, [Y.Histogram], {"," /**"," * Helper method for calculating the size of markers. "," *"," * @method _getMarkerDimensions"," * @param {Number} xcoord The x-coordinate representing the data point for the marker."," * @param {Number} ycoord The y-coordinate representing the data point for the marker."," * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height."," * @param {Number} offset Distance of position offset dictated by other marker series in the same graph."," * @return Object"," * @private"," */"," _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)"," {"," var config = {"," left: xcoord + offset"," };"," if(this._bottomOrigin >= ycoord)"," {"," config.top = ycoord;"," config.calculatedSize = this._bottomOrigin - config.top;"," }"," else"," {"," config.top = this._bottomOrigin;"," config.calculatedSize = ycoord - this._bottomOrigin;"," }"," return config;"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles = Y.clone(this.get(\"styles\").marker),"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markers,"," graph = this.get(\"graph\"),"," seriesStyles,"," seriesCollection = graph.seriesTypes[this.get(\"type\")],"," seriesLen = seriesCollection.length,"," seriesSize = 0,"," offset = 0,"," renderer,"," n = 0,"," xs = [],"," order = this.get(\"order\"),"," config;"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.width, offset);"," markerStyles.height = config.calculatedSize;"," markerStyles.width = Math.min(this._maxSize, markerStyles.width);"," marker.set(markerStyles);"," for(; n < seriesLen; ++n)"," {"," xs[n] = xcoords[i] + seriesSize;"," seriesStyles = seriesCollection[n].get(\"styles\").marker;"," seriesSize += Math.min(this._maxSize, seriesStyles.width);"," if(order > n)"," {"," offset = seriesSize;"," }"," offset -= seriesSize/2;"," }"," for(n = 0; n < seriesLen; ++n)"," {"," markers = seriesCollection[n].get(\"markers\");"," if(markers)"," {"," renderer = markers[i];"," if(renderer && renderer !== undefined)"," {"," renderer.set(\"x\", (xs[n] - seriesSize/2));"," }"," }"," }"," }"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @readOnly"," * @default column"," */"," type: {"," value: \"column\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 12.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The BarSeries class renders bars positioned vertically along a category or time axis. The bars'"," * lengths are proportional to the values they represent along a horizontal axis."," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class BarSeries"," * @extends MarkerSeries"," * @uses Histogram"," * @constructor"," */","Y.BarSeries = Y.Base.create(\"barSeries\", Y.MarkerSeries, [Y.Histogram], {"," /**"," * Helper method for calculating the size of markers. "," *"," * @method _getMarkerDimensions"," * @param {Number} xcoord The x-coordinate representing the data point for the marker."," * @param {Number} ycoord The y-coordinate representing the data point for the marker."," * @param {Number} calculatedSize The calculated size for the marker. For a `BarSeries` is it the width. For a `ColumnSeries` it is the height."," * @param {Number} offset Distance of position offset dictated by other marker series in the same graph."," * @return Object"," * @private"," */"," _getMarkerDimensions: function(xcoord, ycoord, calculatedSize, offset)"," {"," var config = {"," top: ycoord + offset"," };"," if(xcoord >= this._leftOrigin)"," {"," config.left = this._leftOrigin;"," config.calculatedSize = xcoord - config.left;"," }"," else"," {"," config.left = xcoord;"," config.calculatedSize = this._leftOrigin - xcoord;"," }"," return config;"," },"," "," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles = Y.clone(this.get(\"styles\").marker),"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," markers,"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[this.get(\"type\")],"," seriesLen = seriesCollection.length,"," seriesStyles,"," seriesSize = 0,"," offset = 0,"," renderer,"," n = 0,"," ys = [],"," order = this.get(\"order\"),"," config;"," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," config = this._getMarkerDimensions(xcoords[i], ycoords[i], styles.height, offset);"," markerStyles.width = config.calculatedSize;"," markerStyles.height = Math.min(this._maxSize, markerStyles.height);"," marker.set(markerStyles);"," for(; n < seriesLen; ++n)"," {"," ys[n] = ycoords[i] + seriesSize;"," seriesStyles = seriesCollection[n].get(\"styles\").marker;"," seriesSize += Math.min(this._maxSize, seriesStyles.height); "," if(order > n)"," {"," offset = seriesSize;"," }"," offset -= seriesSize/2;"," }"," for(n = 0; n < seriesLen; ++n)"," {"," markers = seriesCollection[n].get(\"markers\");"," if(markers)"," {"," renderer = markers[i];"," if(renderer && renderer !== undefined)"," {"," renderer.set(\"y\", (ys[n] - seriesSize/2));"," }"," }"," }"," }"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default bar"," */"," type: {"," value: \"bar\""," },",""," /**"," * Indicates the direction of the category axis that the bars are plotted against."," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"vertical\""," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>height</dt><dd>indicates the width of the marker. The default value is 12.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The AreaSeries class renders quantitative data on a graph by creating a fill between 0"," * and the relevant data points."," *"," * @module charts"," * @submodule charts-base"," * @class AreaSeries"," * @extends CartesianSeries"," * @uses Fills"," * @constructor"," */","Y.AreaSeries = Y.Base.create(\"areaSeries\", Y.CartesianSeries, [Y.Fills], {"," /**"," * @protected"," *"," * Renders the series. "," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawFill.apply(this, this._getClosingPoints());"," },"," "," /**"," * @protected"," *"," * Method used by `styles` setter. Overrides base implementation."," *"," * @method _setStyles"," * @param {Object} newStyles Hash of properties to update."," * @return Object"," */"," _setStyles: function(val)"," {"," if(!val.area)"," {"," val = {area:val};"," }"," return Y.AreaSeries.superclass._setStyles.apply(this, [val]);"," },",""," /**"," * @protected"," *"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = this._mergeStyles({area:this._getAreaDefaults()}, Y.AreaSeries.superclass._getDefaultStyles());"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default area"," */"," type: {"," value:\"area\""," }"," "," /**"," * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * AreaSplineSeries renders an area graph with data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class AreaSplineSeries"," * @constructor"," * @extends CartesianSeries"," * @uses Fills"," * @uses CurveUtil"," */","Y.AreaSplineSeries = Y.Base.create(\"areaSplineSeries\", Y.AreaSeries, [Y.CurveUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawAreaSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default areaSpline"," */"," type: {"," value:\"areaSpline\""," }"," "," /**"," * Style properties used for drawing area fills. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * StackedAreaSplineSeries creates a stacked area chart with points data points connected by a curve."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAreaSplineSeries"," * @constructor"," * @extends AreaSeries"," * @uses CurveUtil"," * @uses StackingUtil"," */","Y.StackedAreaSplineSeries = Y.Base.create(\"stackedAreaSplineSeries\", Y.AreaSeries, [Y.CurveUtil, Y.StackingUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this._stackCoordinates();"," this.drawStackedAreaSpline();"," }","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedAreaSpline"," */"," type: {"," value:\"stackedAreaSpline\""," }"," }","});","","/**"," * The ComboSeries class renders a combination of lines, plots and area fills in a single series. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, lines and plots "," * are rendered and area is not. "," *"," * @module charts"," * @submodule charts-base"," * @class ComboSeries"," * @extends CartesianSeries "," * @uses Fills"," * @uses Lines"," * @uses Plots"," * @constructor"," */","Y.ComboSeries = Y.Base.create(\"comboSeries\", Y.CartesianSeries, [Y.Fills, Y.Lines, Y.Plots], {"," /**"," * @protected"," * "," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawFill.apply(this, this._getClosingPoints());"," }"," if(this.get(\"showLines\")) "," {"," this.drawLines();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} visible indicates visibilitye"," * @private"," */"," _toggleVisible: function(visible)"," {"," var markers,"," marker,"," len,"," i;"," if(this.get(\"showAreaFill\") && this._path)"," {"," this._path.set(\"visible\", visible);"," }"," if(this.get(\"showLines\") && this._lineGraphic)"," {"," this._lineGraphic.set(\"visible\", visible);"," }"," if(this.get(\"showMarkers\"))"," {"," markers = this.get(\"markers\");"," if(markers)"," {"," i = 0;"," len = markers.length;"," for(; i < len; ++i)"," {"," marker = markers[i];"," if(marker)"," {"," marker.set(\"visible\", visible);"," }"," }"," }"," }"," },",""," /**"," * @protected"," *"," * Returns the default hash for the `styles` attribute."," *"," * @method _getDefaultStyles"," * @return Object"," */"," _getDefaultStyles: function()"," {"," var styles = Y.ComboSeries.superclass._getDefaultStyles();"," styles.line = this._getLineDefaults();"," styles.marker = this._getPlotDefaults();"," styles.area = this._getAreaDefaults();"," return styles;"," }","},","{"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default combo"," */"," type: {"," value:\"combo\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default false"," */"," showAreaFill: {"," value: false"," },",""," /**"," * Indicates whether lines are displayed."," *"," * @attribute showLines"," * @type Boolean"," * @default true"," */"," showLines: {"," value: true"," },",""," /**"," * Indicates whether markers are displayed."," *"," * @attribute showMarkers"," * @type Boolean"," * @default true"," */"," showMarkers: {"," value: true"," },",""," /**"," * Reference to the styles of the markers. These styles can also"," * be accessed through the `styles` attribute. Below are default"," * values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 10.</dd>"," * <dt>height</dt><dd>indicates the height of the marker The default value is 10.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute marker"," * @type Object"," */"," marker: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").marker;"," },"," setter: function(val)"," {"," this.set(\"styles\", {marker:val});"," }"," },"," "," /**"," * Reference to the styles of the lines. These styles can also be accessed through the `styles` attribute."," * Below are the default values:"," * <dl>"," * <dt>color</dt><dd>The color of the line. The default value is determined by the order of the series on the graph. The color will be"," * retrieved from the following array: "," * `[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"]`"," * <dt>weight</dt><dd>Number that indicates the width of the line. The default value is 6.</dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the line. The default value is 1.</dd>"," * <dt>lineType</dt><dd>Indicates whether the line is solid or dashed. The default value is solid.</dd> "," * <dt>dashLength</dt><dd>When the `lineType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>gapSpace</dt><dd>When the `lineType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * <dt>connectDiscontinuousPoints</dt><dd>Indicates whether or not to connect lines when there is a missing or null value between points. The default value is true.</dd> "," * <dt>discontinuousType</dt><dd>Indicates whether the line between discontinuous points is solid or dashed. The default value is solid.</dd>"," * <dt>discontinuousDashLength</dt><dd>When the `discontinuousType` is dashed, indicates the length of the dash. The default value is 10.</dd>"," * <dt>discontinuousGapSpace</dt><dd>When the `discontinuousType` is dashed, indicates the distance between dashes. The default value is 10.</dd>"," * </dl>"," *"," * @attribute line"," * @type Object"," */"," line: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").line;"," },"," setter: function(val)"," {"," this.set(\"styles\", {line:val});"," }"," },"," "," /**"," * Reference to the styles of the area fills. These styles can also be accessed through the `styles` attribute."," * Below are the default values:"," *"," * <dl>"," * <dt>color</dt><dd>The color of the fill. The default value is determined by the order of the series on the graph. The color will be "," * retrieved from the following array:"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1</dd>"," * </dl>"," *"," * @attribute area"," * @type Object"," */"," area: {"," lazyAdd: false,"," getter: function()"," {"," return this.get(\"styles\").area;"," },"," setter: function(val)"," {"," this.set(\"styles\", {area:val});"," }"," }",""," /**"," * Style properties for the series. Contains a key indexed hash of the following:"," * <dl>"," * <dt>marker</dt><dd>Style properties for the markers in the series. Specific style attributes are listed"," * <a href=\"#attr_marker\">here</a>.</dd>"," * <dt>line</dt><dd>Style properties for the lines in the series. Specific"," * style attributes are listed <a href=\"#attr_line\">here</a>.</dd>"," * <dt>area</dt><dd>Style properties for the area fills in the series. Specific style attributes are listed"," * <a href=\"#attr_area\">here</a>.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","",""," ",""," ","/**"," * The StackedComboSeries class renders a combination of lines, plots and area fills in a single series. Series"," * are stacked along the value axis to indicate each series contribution to a cumulative total. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are"," * rendered. "," *"," * @module charts"," * @submodule charts-base"," * @class StackedComboSeries"," * @extends ComboSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedComboSeries = Y.Base.create(\"stackedComboSeries\", Y.ComboSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedComboSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," },"," "," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawFill.apply(this, this._getStackedClosingPoints());"," }"," if(this.get(\"showLines\")) "," {"," this.drawLines();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }"," ","}, {"," ATTRS : {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedCombo"," */"," type: {"," value: \"stackedCombo\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default true"," */"," showAreaFill: {"," value: true"," }"," }","});","/**"," * The ComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, splines and plots "," * are rendered and areaspline is not. "," *"," * @module charts"," * @submodule charts-base"," * @class ComboSplineSeries"," * @extends ComboSeries"," * @extends CurveUtil"," * @constructor"," */","Y.ComboSplineSeries = Y.Base.create(\"comboSplineSeries\", Y.ComboSeries, [Y.CurveUtil], {"," /**"," * @protected"," * "," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawAreaSpline();"," }"," if(this.get(\"showLines\")) "," {"," this.drawSpline();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default comboSpline"," */"," type: {"," value : \"comboSpline\""," }"," }","});","/**"," * The StackedComboSplineSeries class renders a combination of splines, plots and areaspline fills in a single series. Series"," * are stacked along the value axis to indicate each series contribution to a cumulative total. Each"," * series type has a corresponding boolean attribute indicating if it is rendered. By default, all three types are"," * rendered. "," *"," * @module charts"," * @submodule charts-base"," * @class StackedComboSplineSeries"," * @extends StackedComboSeries"," * @uses CurveUtil"," * @constructor"," */","Y.StackedComboSplineSeries = Y.Base.create(\"stackedComboSplineSeries\", Y.StackedComboSeries, [Y.CurveUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"showAreaFill\"))"," {"," this.drawStackedAreaSpline();"," }"," if(this.get(\"showLines\")) "," {"," this.drawSpline();"," }"," if(this.get(\"showMarkers\"))"," {"," this.drawPlots();"," } "," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedComboSpline"," */"," type : {"," value : \"stackedComboSpline\""," },",""," /**"," * Indicates whether a fill is displayed."," *"," * @attribute showAreaFill"," * @type Boolean"," * @default true"," */"," showAreaFill: {"," value: true"," }"," }","});","/**"," * StackedLineSeries creates line graphs in which the different series are stacked along a value axis"," * to indicate their contribution to a cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedLineSeries"," * @constructor"," * @extends LineSeries"," * @uses StackingUtil"," */","Y.StackedLineSeries = Y.Base.create(\"stackedLineSeries\", Y.LineSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedLineSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedLine"," */"," type: {"," value:\"stackedLine\""," }"," }","});","/**"," * StackedAreaSeries area fills to display data showing its contribution to a whole."," *"," * @module charts"," * @submodule charts-base"," * @class StackedAreaSeries"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Chart."," * @extends AreaSeries"," * @uses StackingUtil"," */","Y.StackedAreaSeries = Y.Base.create(\"stackedAreaSeries\", Y.AreaSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Calculates the coordinates for the series. Overrides base implementation."," *"," * @method setAreaData"," */"," setAreaData: function()"," { "," Y.StackedAreaSeries.superclass.setAreaData.apply(this);"," this._stackCoordinates.apply(this);"," },",""," /**"," * @protected"," *"," * Draws the series"," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," this.drawFill.apply(this, this._getStackedClosingPoints());"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedArea"," */"," type: {"," value:\"stackedArea\""," }"," }","});","/**"," * The StackedColumnSeries renders column chart in which series are stacked vertically to show"," * their contribution to the cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedColumnSeries"," * @extends ColumnSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedColumnSeries = Y.Base.create(\"stackedColumnSeries\", Y.ColumnSeries, [Y.StackingUtil], {"," /**"," * Draws the series."," *"," * @method drawSeries"," * @protected"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }"," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker), "," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," ratio,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," fillColors,"," borderColors,"," lastCollection,"," negativeBaseValues,"," positiveBaseValues,"," useOrigin = order === 0,"," totalWidth = len * w,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," if(totalWidth > this.get(\"width\"))"," {"," ratio = this.width/totalWidth;"," w *= ratio;"," w = Math.max(w, 1);"," }"," if(!useOrigin)"," {"," lastCollection = seriesCollection[order - 1];"," negativeBaseValues = lastCollection.get(\"negativeBaseValues\");"," positiveBaseValues = lastCollection.get(\"positiveBaseValues\");"," if(!negativeBaseValues || !positiveBaseValues)"," {"," useOrigin = true;"," positiveBaseValues = [];"," negativeBaseValues = [];"," }"," }"," else"," {"," negativeBaseValues = [];"," positiveBaseValues = [];"," }"," this.set(\"negativeBaseValues\", negativeBaseValues);"," this.set(\"positiveBaseValues\", positiveBaseValues);"," for(i = 0; i < len; ++i)"," {"," left = xcoords[i];"," top = ycoords[i];"," "," if(!isNumber(top) || !isNumber(left))"," {"," if(useOrigin)"," {"," negativeBaseValues[i] = this._bottomOrigin;"," positiveBaseValues[i] = this._bottomOrigin;"," }"," this._markers.push(null); "," continue;"," }"," if(useOrigin)"," {"," h = Math.abs(this._bottomOrigin - top);"," if(top < this._bottomOrigin)"," {"," positiveBaseValues[i] = top;"," negativeBaseValues[i] = this._bottomOrigin;"," }"," else if(top > this._bottomOrigin)"," {"," positiveBaseValues[i] = this._bottomOrigin;"," negativeBaseValues[i] = top;"," top -= h;"," }"," else"," {"," positiveBaseValues[i] = top;"," negativeBaseValues[i] = top;"," }"," }"," else "," {"," if(top > this._bottomOrigin)"," {"," top += (negativeBaseValues[i] - this._bottomOrigin);"," h = top - negativeBaseValues[i];"," negativeBaseValues[i] = top;"," top -= h;"," }"," else if(top <= this._bottomOrigin)"," {"," top = positiveBaseValues[i] - (this._bottomOrigin - top);"," h = positiveBaseValues[i] - top;"," positiveBaseValues[i] = top;"," }"," }"," if(!isNaN(h) && h > 0)"," {"," left -= w/2;"," if(groupMarkers)"," {"," dimensions.width[i] = w;"," dimensions.height[i] = h;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style.width = w;"," style.height = h;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }"," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers && this._markers[i])"," {"," var styles,"," markerStyles,"," state = this._getState(type),"," xcoords = this.get(\"xcoords\"),"," marker = this._markers[i],"," offset = 0,"," fillColor,"," borderColor; "," styles = this.get(\"styles\").marker;"," offset = styles.width * 0.5;"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]); "," markerStyles.height = marker.get(\"height\");"," markerStyles.x = (xcoords[i] - offset);"," markerStyles.y = marker.get(\"y\");"," markerStyles.id = marker.get(\"id\");"," fillColor = markerStyles.fill.color; "," borderColor = markerStyles.border.color;"," if(Y_Lang.isArray(fillColor))"," {"," markerStyles.fill.color = fillColor[i % fillColor.length];"," }"," else"," {"," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," }"," if(Y_Lang.isArray(borderColor))"," {"," markerStyles.border.color = borderColor[i % borderColor.length];"," }"," else"," {"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," }"," marker.set(markerStyles);"," }"," },"," "," /**"," * Gets the default values for the markers. "," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 24,"," height: 24,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedColumn"," */"," type: {"," value: \"stackedColumn\""," },",""," /**"," * @attribute negativeBaseValues"," * @type Array"," * @default null"," * @private"," */"," negativeBaseValues: {"," value: null"," },",""," /**"," * @attribute positiveBaseValues"," * @type Array"," * @default null"," * @private"," */"," positiveBaseValues: {"," value: null"," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `ColumnSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>width</dt><dd>indicates the width of the marker. The default value is 24.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * The StackedBarSeries renders bar chart in which series are stacked horizontally to show"," * their contribution to the cumulative total."," *"," * @module charts"," * @submodule charts-base"," * @class StackedBarSeries"," * @extends BarSeries"," * @uses StackingUtil"," * @constructor"," */","Y.StackedBarSeries = Y.Base.create(\"stackedBarSeries\", Y.BarSeries, [Y.StackingUtil], {"," /**"," * @protected"," *"," * Draws the series."," *"," * @method drawSeries"," */"," drawSeries: function()"," {"," if(this.get(\"xcoords\").length < 1) "," {"," return;"," }",""," var isNumber = Y_Lang.isNumber,"," style = Y.clone(this.get(\"styles\").marker),"," w = style.width,"," h = style.height,"," xcoords = this.get(\"xcoords\"),"," ycoords = this.get(\"ycoords\"),"," i = 0,"," len = xcoords.length,"," top = ycoords[0],"," type = this.get(\"type\"),"," graph = this.get(\"graph\"),"," seriesCollection = graph.seriesTypes[type],"," ratio,"," order = this.get(\"order\"),"," graphOrder = this.get(\"graphOrder\"),"," left,"," marker,"," lastCollection,"," negativeBaseValues,"," positiveBaseValues,"," fillColors,"," borderColors,"," useOrigin = order === 0,"," totalHeight = len * h,"," dimensions = {"," width: [],"," height: []"," },"," xvalues = [],"," yvalues = [],"," groupMarkers = this.get(\"groupMarkers\");"," if(Y_Lang.isArray(style.fill.color))"," {"," fillColors = style.fill.color.concat(); "," }"," if(Y_Lang.isArray(style.border.color))"," {"," borderColors = style.border.color.concat();"," }"," this._createMarkerCache();"," if(totalHeight > this.get(\"height\"))"," {"," ratio = this.height/totalHeight;"," h *= ratio;"," h = Math.max(h, 1);"," }"," if(!useOrigin)"," {"," lastCollection = seriesCollection[order - 1];"," negativeBaseValues = lastCollection.get(\"negativeBaseValues\");"," positiveBaseValues = lastCollection.get(\"positiveBaseValues\");"," if(!negativeBaseValues || !positiveBaseValues)"," {"," useOrigin = true;"," positiveBaseValues = [];"," negativeBaseValues = [];"," }"," }"," else"," {"," negativeBaseValues = [];"," positiveBaseValues = [];"," }"," this.set(\"negativeBaseValues\", negativeBaseValues);"," this.set(\"positiveBaseValues\", positiveBaseValues);"," for(i = 0; i < len; ++i)"," {"," top = ycoords[i];"," left = xcoords[i];"," if(!isNumber(top) || !isNumber(left))"," {"," if(useOrigin)"," {"," positiveBaseValues[i] = this._leftOrigin;"," negativeBaseValues[i] = this._leftOrigin;"," }"," this._markers.push(null);"," continue;"," }"," if(useOrigin)"," {"," w = Math.abs(left - this._leftOrigin);"," if(left > this._leftOrigin)"," {"," positiveBaseValues[i] = left;"," negativeBaseValues[i] = this._leftOrigin;"," left -= w;"," }"," else if(left < this._leftOrigin)"," { "," positiveBaseValues[i] = this._leftOrigin;"," negativeBaseValues[i] = left;"," }"," else"," {"," positiveBaseValues[i] = left;"," negativeBaseValues[i] = this._leftOrigin;"," }"," }"," else"," {"," if(left < this._leftOrigin)"," {"," left = negativeBaseValues[i] - (this._leftOrigin - xcoords[i]);"," w = negativeBaseValues[i] - left;"," negativeBaseValues[i] = left;"," }"," else if(left >= this._leftOrigin)"," {"," left += (positiveBaseValues[i] - this._leftOrigin);"," w = left - positiveBaseValues[i];"," positiveBaseValues[i] = left;"," left -= w;"," }"," }"," if(!isNaN(w) && w > 0)"," {"," top -= h/2;"," if(groupMarkers)"," {"," dimensions.width[i] = w;"," dimensions.height[i] = h;"," xvalues.push(left);"," yvalues.push(top);"," }"," else"," {"," style.width = w;"," style.height = h;"," style.x = left;"," style.y = top;"," if(fillColors)"," {"," style.fill.color = fillColors[i % fillColors.length];"," }"," if(borderColors)"," {"," style.border.color = borderColors[i % borderColors.length];"," }"," marker = this.getMarker(style, graphOrder, i);"," }"," }"," else if(!groupMarkers)"," {"," this._markers.push(null);"," }"," }"," if(groupMarkers)"," {"," this._createGroupMarker({"," fill: style.fill,"," border: style.border,"," dimensions: dimensions,"," xvalues: xvalues,"," yvalues: yvalues,"," shape: style.shape"," });"," }"," else"," {"," this._clearMarkerCache();"," }"," },",""," /**"," * @protected"," *"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers[i])"," {"," var state = this._getState(type),"," ycoords = this.get(\"ycoords\"),"," marker = this._markers[i],"," styles = this.get(\"styles\").marker,"," h = styles.height,"," markerStyles = state == \"off\" || !styles[state] ? Y.clone(styles) : Y.clone(styles[state]), "," fillColor,"," borderColor; "," markerStyles.y = (ycoords[i] - h/2);"," markerStyles.x = marker.get(\"x\");"," markerStyles.width = marker.get(\"width\");"," markerStyles.id = marker.get(\"id\");"," fillColor = markerStyles.fill.color; "," borderColor = markerStyles.border.color;"," if(Y_Lang.isArray(fillColor))"," {"," markerStyles.fill.color = fillColor[i % fillColor.length];"," }"," else"," {"," markerStyles.fill.color = this._getItemColor(markerStyles.fill.color, i);"," }"," if(Y_Lang.isArray(borderColor))"," {"," markerStyles.border.color = borderColor[i % borderColor.length];"," }"," else"," {"," markerStyles.border.color = this._getItemColor(markerStyles.border.color, i);"," }"," marker.set(markerStyles);"," }"," },"," "," /**"," * @protected"," *"," * Returns default values for the `styles` attribute."," * "," * @method _getPlotDefaults"," * @return Object"," */"," _getPlotDefaults: function()"," {"," var defs = {"," fill:{"," type: \"solid\","," alpha: 1,"," colors:null,"," alphas: null,"," ratios: null"," },"," border:{"," weight: 0,"," alpha: 1"," },"," width: 24,"," height: 24,"," shape: \"rect\",",""," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," }"," };"," defs.fill.color = this._getDefaultColor(this.get(\"graphOrder\"), \"fill\");"," defs.border.color = this._getDefaultColor(this.get(\"graphOrder\"), \"border\");"," return defs;"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default stackedBar"," */"," type: {"," value: \"stackedBar\""," },",""," /**"," * Direction of the series"," *"," * @attribute direction"," * @type String"," * @default vertical"," */"," direction: {"," value: \"vertical\""," },",""," /**"," * @private"," *"," * @attribute negativeBaseValues"," * @type Array"," * @default null"," */"," negativeBaseValues: {"," value: null"," },",""," /**"," * @private"," *"," * @attribute positiveBaseValues"," * @type Array"," * @default null"," */"," positiveBaseValues: {"," value: null"," }"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `BarSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is determined by the order of the series on the graph. The color"," * will be retrieved from the below array:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>height</dt><dd>indicates the width of the marker. The default value is 24.</dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","","/**"," * PieSeries visualizes data as a circular chart divided into wedges which represent data as a "," * percentage of a whole."," *"," * @module charts"," * @submodule charts-base"," * @class PieSeries"," * @constructor"," * @extends MarkerSeries"," */","Y.PieSeries = Y.Base.create(\"pieSeries\", Y.MarkerSeries, [], { "," /**"," * Image map used for interactivity when rendered with canvas."," *"," * @property _map"," * @type HTMLElement"," * @private"," */"," _map: null,",""," /**"," * Image used for image map when rendered with canvas."," *"," * @property _image"," * @type HTMLElement"," * @private"," */"," _image: null,",""," /**"," * Creates or updates the image map when rendered with canvas."," *"," * @method _setMap"," * @private"," */"," _setMap: function()"," {"," var id = \"pieHotSpotMapi_\" + Math.round(100000 * Math.random()),"," cb = this.get(\"graph\").get(\"contentBox\"),"," areaNode;"," if(this._image)"," {"," cb.removeChild(this._image);"," while(this._areaNodes && this._areaNodes.length > 0)"," {"," areaNode = this._areaNodes.shift();"," this._map.removeChild(areaNode);"," }"," cb.removeChild(this._map);"," }"," this._image = DOCUMENT.createElement(\"img\"); "," this._image.src = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==\";"," cb.appendChild(this._image);"," this._image.setAttribute(\"usemap\", \"#\" + id);"," this._image.style.zIndex = 3;"," this._image.style.opacity = 0;"," this._image.setAttribute(\"alt\", \"imagemap\");"," this._map = DOCUMENT.createElement(\"map\");"," this._map.style.zIndex = 5;"," cb.appendChild(this._map);"," this._map.setAttribute(\"name\", id);"," this._map.setAttribute(\"id\", id);"," this._areaNodes = [];"," },",""," /**"," * Storage for `categoryDisplayName` attribute."," *"," * @property _categoryDisplayName"," * @private"," */"," _categoryDisplayName: null,"," "," /**"," * Storage for `valueDisplayName` attribute."," *"," * @property _valueDisplayName"," * @private"," */"," _valueDisplayName: null,",""," /**"," * Adds event listeners."," *"," * @method addListeners"," * @private"," */"," addListeners: function()"," {"," var categoryAxis = this.get(\"categoryAxis\"),"," valueAxis = this.get(\"valueAxis\");"," if(categoryAxis)"," {"," categoryAxis.after(\"dataReady\", Y.bind(this._categoryDataChangeHandler, this));"," categoryAxis.after(\"dataUpdate\", Y.bind(this._categoryDataChangeHandler, this));"," }"," if(valueAxis)"," {"," valueAxis.after(\"dataReady\", Y.bind(this._valueDataChangeHandler, this));"," valueAxis.after(\"dataUpdate\", Y.bind(this._valueDataChangeHandler, this));"," }"," this.after(\"categoryAxisChange\", this.categoryAxisChangeHandler);"," this.after(\"valueAxisChange\", this.valueAxisChangeHandler);"," this.after(\"stylesChange\", this._updateHandler);"," },"," "," /**"," * Draws the series."," *"," * @method validate"," * @private"," */"," validate: function()"," {"," this.draw();"," this._renderered = true;"," },",""," /**"," * Event handler for the categoryAxisChange event."," *"," * @method _categoryAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _categoryAxisChangeHandler: function(e)"," {"," var categoryAxis = this.get(\"categoryAxis\");"," categoryAxis.after(\"dataReady\", Y.bind(this._categoryDataChangeHandler, this));"," categoryAxis.after(\"dataUpdate\", Y.bind(this._categoryDataChangeHandler, this));"," },"," "," /**"," * Event handler for the valueAxisChange event."," *"," * @method _valueAxisChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _valueAxisChangeHandler: function(e)"," {"," var valueAxis = this.get(\"valueAxis\");"," valueAxis.after(\"dataReady\", Y.bind(this._valueDataChangeHandler, this));"," valueAxis.after(\"dataUpdate\", Y.bind(this._valueDataChangeHandler, this));"," },"," "," /**"," * Constant used to generate unique id."," *"," * @property GUID"," * @type String"," * @private"," */"," GUID: \"pieseries\","," "," /**"," * Event handler for categoryDataChange event."," *"," * @method _categoryDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _categoryDataChangeHandler: function(event)"," {"," if(this._rendered && this.get(\"categoryKey\") && this.get(\"valueKey\"))"," {"," this.draw();"," }"," },",""," /**"," * Event handler for valueDataChange event."," *"," * @method _valueDataChangeHandler"," * @param {Object} event Event object."," * @private "," */"," _valueDataChangeHandler: function(event)"," {"," if(this._rendered && this.get(\"categoryKey\") && this.get(\"valueKey\"))"," {"," this.draw();"," }"," },"," "," /**"," * Draws the series. Overrides the base implementation."," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," var graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\");"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," { "," this._rendered = true;"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," this.drawSeries();"," this._drawing = false;"," if(this._callLater)"," {"," this.draw();"," }"," else"," {"," this.fire(\"drawingComplete\");"," }"," }"," },",""," /**"," * Draws the markers"," *"," * @method drawPlots"," * @protected"," */"," drawPlots: function()"," {"," var values = this.get(\"valueAxis\").getDataByKey(this.get(\"valueKey\")).concat(),"," catValues = this.get(\"categoryAxis\").getDataByKey(this.get(\"categoryKey\")).concat(),"," totalValue = 0,"," itemCount = values.length,"," styles = this.get(\"styles\").marker,"," fillColors = styles.fill.colors,"," fillAlphas = styles.fill.alphas || [\"1\"],"," borderColors = styles.border.colors,"," borderWeights = [styles.border.weight],"," borderAlphas = [styles.border.alpha],"," tbw = borderWeights.concat(),"," tbc = borderColors.concat(),"," tba = borderAlphas.concat(),"," tfc,"," tfa,"," padding = styles.padding,"," graph = this.get(\"graph\"),"," minDimension = Math.min(graph.get(\"width\"), graph.get(\"height\")),"," w = minDimension - (padding.left + padding.right),"," h = minDimension - (padding.top + padding.bottom),"," startAngle = -90,"," halfWidth = w / 2,"," halfHeight = h / 2,"," radius = Math.min(halfWidth, halfHeight),"," i = 0,"," value,"," angle = 0,"," lc,"," la,"," lw,"," wedgeStyle,"," marker,"," graphOrder = this.get(\"graphOrder\"),"," isCanvas = Y.Graphic.NAME == \"canvasGraphic\";"," for(; i < itemCount; ++i)"," {"," value = parseFloat(values[i]);"," "," values.push(value);"," if(!isNaN(value))"," {"," totalValue += value;"," }"," }"," "," tfc = fillColors ? fillColors.concat() : null;"," tfa = fillAlphas ? fillAlphas.concat() : null;"," this._createMarkerCache();"," if(isCanvas)"," {"," this._setMap();"," this._image.width = w;"," this._image.height = h;"," }"," for(i = 0; i < itemCount; i++)"," {"," value = values[i];"," if(totalValue === 0)"," {"," angle = 360 / values.length;"," }"," else"," {"," angle = 360 * (value / totalValue);"," }"," if(tfc && tfc.length < 1)"," {"," tfc = fillColors.concat();"," }"," if(tfa && tfa.length < 1)"," {"," tfa = fillAlphas.concat();"," }"," if(tbw && tbw.length < 1)"," {"," tbw = borderWeights.concat();"," }"," if(tbw && tbc.length < 1)"," {"," tbc = borderColors.concat();"," }"," if(tba && tba.length < 1)"," {"," tba = borderAlphas.concat();"," }"," lw = tbw ? tbw.shift() : null;"," lc = tbc ? tbc.shift() : null;"," la = tba ? tba.shift() : null;"," startAngle += angle;"," wedgeStyle = {"," border: {"," color:lc,"," weight:lw,"," alpha:la"," },"," fill: {"," color:tfc ? tfc.shift() : this._getDefaultColor(i, \"slice\"),"," alpha:tfa ? tfa.shift() : null"," },"," type: \"pieslice\","," arc: angle,"," radius: radius,"," startAngle: startAngle,"," cx: halfWidth,"," cy: halfHeight,"," width: w,"," height: h"," };"," marker = this.getMarker(wedgeStyle, graphOrder, i);"," if(isCanvas)"," {"," this._addHotspot(wedgeStyle, graphOrder, i);"," }"," }"," this._clearMarkerCache();"," },",""," /**"," * Adds an interactive map when rendering in canvas."," *"," * @method _addHotspot"," * @param {Object} cfg Object containing data used to draw the hotspot"," * @param {Number} seriesIndex Index of series in the `seriesCollection`."," * @param {Number} index Index of the marker using the hotspot."," * @private"," */"," _addHotspot: function(cfg, seriesIndex, index)"," {"," var areaNode = DOCUMENT.createElement(\"area\"),"," i = 1,"," x = cfg.cx,"," y = cfg.cy, "," arc = cfg.arc,"," startAngle = cfg.startAngle - arc, "," endAngle = cfg.startAngle,"," radius = cfg.radius, "," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius,"," ay = y + Math.sin(startAngle / 180 * Math.PI) * radius,"," bx = x + Math.cos(endAngle / 180 * Math.PI) * radius,"," by = y + Math.sin(endAngle / 180 * Math.PI) * radius,"," numPoints = Math.floor(arc/10) - 1,"," divAngle = (arc/(Math.floor(arc/10)) / 180) * Math.PI,"," angleCoord = Math.atan((ay - y)/(ax - x)),"," pts = x + \", \" + y + \", \" + ax + \", \" + ay,"," cosAng,"," sinAng,"," multDivAng;"," for(i = 1; i <= numPoints; ++i)"," {"," multDivAng = divAngle * i;"," cosAng = Math.cos(angleCoord + multDivAng);"," sinAng = Math.sin(angleCoord + multDivAng);"," if(startAngle <= 90)"," {"," pts += \", \" + (x + (radius * Math.cos(angleCoord + (divAngle * i))));"," pts += \", \" + (y + (radius * Math.sin(angleCoord + (divAngle * i))));"," }"," else"," {"," pts += \", \" + (x - (radius * Math.cos(angleCoord + (divAngle * i))));"," pts += \", \" + (y - (radius * Math.sin(angleCoord + (divAngle * i))));"," }"," }"," pts += \", \" + bx + \", \" + by;"," pts += \", \" + x + \", \" + y;"," this._map.appendChild(areaNode);"," areaNode.setAttribute(\"class\", SERIES_MARKER);"," areaNode.setAttribute(\"id\", \"hotSpot_\" + seriesIndex + \"_\" + index);"," areaNode.setAttribute(\"shape\", \"polygon\");"," areaNode.setAttribute(\"coords\", pts);"," this._areaNodes.push(areaNode);",""," },",""," /**"," * Resizes and positions markers based on a mouse interaction."," *"," * @method updateMarkerState"," * @param {String} type state of the marker"," * @param {Number} i index of the marker"," * @protected"," */"," updateMarkerState: function(type, i)"," {"," if(this._markers[i])"," {"," var state = this._getState(type),"," markerStyles,"," indexStyles,"," marker = this._markers[i],"," styles = this.get(\"styles\").marker; "," markerStyles = state == \"off\" || !styles[state] ? styles : styles[state]; "," indexStyles = this._mergeStyles(markerStyles, {});"," indexStyles.fill.color = indexStyles.fill.colors[i % indexStyles.fill.colors.length];"," indexStyles.fill.alpha = indexStyles.fill.alphas[i % indexStyles.fill.alphas.length];"," marker.set(indexStyles);"," }"," },"," "," /**"," * Creates a shape to be used as a marker."," *"," * @method _createMarker"," * @param {Object} styles Hash of style properties."," * @param {Number} order Order of the series."," * @param {Number} index Index within the series associated with the marker."," * @return Shape"," * @private"," */"," _createMarker: function(styles, order, index)"," {"," var graphic = this.get(\"graphic\"),"," marker,"," cfg = Y.clone(styles);"," graphic.set(\"autoDraw\", false);"," marker = graphic.addShape(cfg); "," marker.addClass(SERIES_MARKER);"," return marker;"," },"," "," /**"," * Creates a cache of markers for reuse."," *"," * @method _createMarkerCache"," * @private"," */"," _clearMarkerCache: function()"," {"," var len = this._markerCache.length,"," i = 0,"," marker;"," for(; i < len; ++i)"," {"," marker = this._markerCache[i];"," if(marker)"," {"," marker.destroy();"," }"," }"," this._markerCache = [];"," },",""," /**"," * Gets the default style values for the markers."," *"," * @method _getPlotDefaults"," * @return Object"," * @private"," */"," _getPlotDefaults: function()"," {"," var defs = {"," padding:{"," top: 0,"," left: 0,"," right: 0,"," bottom: 0"," },"," fill:{"," alphas:[\"1\"]"," },"," border: {"," weight: 0,"," alpha: 1"," }"," };"," defs.fill.colors = this._defaultSliceColors;"," defs.border.colors = this._defaultBorderColors;"," return defs;"," },",""," /**"," * Collection of default colors used for lines in a series when not specified by user."," *"," * @property _defaultLineColors"," * @type Array"," * @protected"," */"," _defaultLineColors:[\"#426ab3\", \"#d09b2c\", \"#000000\", \"#b82837\", \"#b384b5\", \"#ff7200\", \"#779de3\", \"#cbc8ba\", \"#7ed7a6\", \"#007a6c\"],",""," /**"," * Collection of default colors used for marker fills in a series when not specified by user."," *"," * @property _defaultFillColors"," * @type Array"," * @protected"," */"," _defaultFillColors:[\"#6084d0\", \"#eeb647\", \"#6c6b5f\", \"#d6484f\", \"#ce9ed1\", \"#ff9f3b\", \"#93b7ff\", \"#e0ddd0\", \"#94ecba\", \"#309687\"],"," "," /**"," * Collection of default colors used for marker borders in a series when not specified by user."," *"," * @property _defaultBorderColors"," * @type Array"," * @protected"," */"," _defaultBorderColors:[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"],"," "," /**"," * Collection of default colors used for area fills, histogram fills and pie fills in a series when not specified by user."," *"," * @property _defaultSliceColors"," * @type Array"," * @protected"," */"," _defaultSliceColors: [\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"],",""," /**"," * Colors used if style colors are not specified"," *"," * @method _getDefaultColor"," * @param {Number} index Index indicating the series order."," * @param {String} type Indicates which type of object needs the color."," * @return String"," * @protected"," */"," _getDefaultColor: function(index, type)"," {"," var colors = {"," line: this._defaultLineColors,"," fill: this._defaultFillColors,"," border: this._defaultBorderColors,"," slice: this._defaultSliceColors"," },"," col = colors[type],"," l = col.length;"," index = index || 0;"," if(index >= l)"," {"," index = index % l;"," }"," type = type || \"fill\";"," return colors[type][index];"," }","}, {"," ATTRS: {"," /**"," * Read-only attribute indicating the type of series."," *"," * @attribute type"," * @type String"," * @default pie"," */"," type: { "," value: \"pie\""," },"," "," /**"," * Order of this instance of this `type`."," *"," * @attribute order"," * @type Number"," */"," order: {},",""," /**"," * Reference to the `Graph` in which the series is drawn into."," *"," * @attribute graph"," * @type Graph"," */"," graph: {},"," "," /**"," * Reference to the `Axis` instance used for assigning "," * category values to the graph."," *"," * @attribute categoryAxis"," * @type Axis"," */"," categoryAxis: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"categoryAxis\");"," }"," },"," "," /**"," * Reference to the `Axis` instance used for assigning "," * series values to the graph."," *"," * @attribute categoryAxis"," * @type Axis"," */"," valueAxis: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"valueAxis\");"," }"," },",""," /**"," * Indicates which array to from the hash of value arrays in "," * the category `Axis` instance."," *"," * @attribute categoryKey"," * @type String"," */"," categoryKey: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"categoryKey\");"," }"," },"," /**"," * Indicates which array to from the hash of value arrays in "," * the value `Axis` instance."," *"," * @attribute valueKey"," * @type String"," */"," valueKey: {"," value: null,",""," validator: function(value)"," {"," return value !== this.get(\"valueKey\");"," }"," },",""," /**"," * Name used for for displaying category data"," *"," * @attribute categoryDisplayName"," * @type String"," */"," categoryDisplayName: {"," setter: function(val)"," {"," this._categoryDisplayName = val;"," return val;"," },",""," getter: function()"," {"," return this._categoryDisplayName || this.get(\"categoryKey\");"," }"," },",""," /**"," * Name used for for displaying value data"," *"," * @attribute valueDisplayName"," * @type String"," */"," valueDisplayName: {"," setter: function(val)"," {"," this._valueDisplayName = val;"," return val;"," },",""," getter: function()"," {"," return this._valueDisplayName || this.get(\"valueKey\");"," }"," },"," "," /**"," * @attribute slices"," * @type Array"," * @private"," */"," slices: null"," "," /**"," * Style properties used for drawing markers. This attribute is inherited from `MarkerSeries`. Below are the default values:"," * <dl>"," * <dt>fill</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>colors</dt><dd>An array of colors to be used for the marker fills. The color for each marker is retrieved from the "," * array below:<br/>"," * `[\"#66007f\", \"#a86f41\", \"#295454\", \"#996ab2\", \"#e8cdb7\", \"#90bdbd\",\"#000000\",\"#c3b8ca\", \"#968373\", \"#678585\"]`"," * </dd>"," * <dt>alphas</dt><dd>An array of alpha references (Number from 0 to 1) indicating the opacity of each marker fill. The default value is [1].</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>A hash containing the following values:"," * <dl>"," * <dt>color</dt><dd>An array of colors to be used for the marker borders. The color for each marker is retrieved from the"," * array below:<br/>"," * `[\"#205096\", \"#b38206\", \"#000000\", \"#94001e\", \"#9d6fa0\", \"#e55b00\", \"#5e85c9\", \"#adab9e\", \"#6ac291\", \"#006457\"]`"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the marker border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>over</dt><dd>hash containing styles for markers when highlighted by a `mouseover` event. The default "," * values for each style is null. When an over style is not set, the non-over value will be used. For example,"," * the default value for `marker.over.fill.color` is equivalent to `marker.fill.color`.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * Gridlines draws gridlines on a Graph."," *"," * @module charts"," * @submodule charts-base"," * @class Gridlines"," * @constructor"," * @extends Base"," * @uses Renderer"," */","Y.Gridlines = Y.Base.create(\"gridlines\", Y.Base, [Y.Renderer], {"," /**"," * Reference to the `Path` element used for drawing Gridlines."," *"," * @property _path"," * @type Path"," * @private"," */"," _path: null,",""," /**"," * Removes the Gridlines."," *"," * @method remove"," * @private"," */"," remove: function()"," {"," var path = this._path;"," if(path)"," {"," path.destroy();"," }"," },",""," /**"," * Draws the gridlines"," *"," * @method draw"," * @protected"," */"," draw: function()"," {"," if(this.get(\"axis\") && this.get(\"graph\"))"," {"," this._drawGridlines();"," }"," },",""," /**"," * Algorithm for drawing gridlines"," *"," * @method _drawGridlines"," * @private"," */"," _drawGridlines: function()"," {"," var path,"," axis = this.get(\"axis\"),"," axisPosition = axis.get(\"position\"),"," points,"," i = 0,"," l,"," direction = this.get(\"direction\"),"," graph = this.get(\"graph\"),"," w = graph.get(\"width\"),"," h = graph.get(\"height\"),"," line = this.get(\"styles\").line,"," color = line.color,"," weight = line.weight,"," alpha = line.alpha,"," lineFunction = direction == \"vertical\" ? this._verticalLine : this._horizontalLine;"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," {"," if(axisPosition != \"none\" && axis && axis.get(\"tickPoints\"))"," {"," points = axis.get(\"tickPoints\");"," l = points.length;"," }"," else"," {"," points = [];"," l = axis.get(\"styles\").majorUnit.count;"," for(; i < l; ++i)"," {"," points[i] = {"," x: w * (i/(l-1)),"," y: h * (i/(l-1))"," };"," }"," i = 0;"," }"," path = graph.get(\"gridlines\");"," path.set(\"width\", w);"," path.set(\"height\", h);"," path.set(\"stroke\", {"," weight: weight,"," color: color,"," opacity: alpha"," });"," for(; i < l; ++i)"," {"," lineFunction(path, points[i], w, h);"," }"," path.end();"," }"," },",""," /**"," * Algorithm for horizontal lines."," *"," * @method _horizontalLine"," * @param {Path} path Reference to path element"," * @param {Object} pt Coordinates corresponding to a major unit of an axis."," * @param {Number} w Width of the Graph"," * @param {Number} h Height of the Graph"," * @private"," */"," _horizontalLine: function(path, pt, w, h)"," {"," path.moveTo(0, pt.y);"," path.lineTo(w, pt.y);"," },",""," /**"," * Algorithm for vertical lines."," *"," * @method _verticalLine"," * @param {Path} path Reference to path element"," * @param {Object} pt Coordinates corresponding to a major unit of an axis."," * @param {Number} w Width of the Graph"," * @param {Number} h Height of the Graph"," * @private"," */"," _verticalLine: function(path, pt, w, h)"," {"," path.moveTo(pt.x, 0);"," path.lineTo(pt.x, h);"," },"," "," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var defs = {"," line: {"," color:\"#f0efe9\","," weight: 1,"," alpha: 1"," }"," };"," return defs;"," }","","},","{"," ATTRS: {"," /**"," * Indicates the direction of the gridline."," *"," * @attribute direction"," * @type String"," */"," direction: {},"," "," /**"," * Indicate the `Axis` in which to bind"," * the gridlines."," *"," * @attribute axis"," * @type Axis"," */"," axis: {},"," "," /**"," * Indicates the `Graph` in which the gridlines "," * are drawn."," *"," * @attribute graph"," * @type Graph"," */"," graph: {}"," }","});","/**"," * Graph manages and contains series instances for a `CartesianChart`"," * instance."," *"," * @module charts"," * @submodule charts-base"," * @class Graph"," * @constructor"," * @extends Widget"," * @uses Renderer"," */","Y.Graph = Y.Base.create(\"graph\", Y.Widget, [Y.Renderer], {"," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," var bb = this.get(\"boundingBox\");"," bb.setStyle(\"position\", \"absolute\");"," this.after(\"widthChange\", this._sizeChangeHandler);"," this.after(\"heightChange\", this._sizeChangeHandler);"," this.after(\"stylesChange\", this._updateStyles);"," this.after(\"groupMarkersChange\", this._drawSeries);"," },",""," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var background,"," cb,"," bg,"," sc = this.get(\"seriesCollection\"),"," series,"," i = 0,"," len = sc ? sc.length : 0,"," hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\");"," if(this.get(\"showBackground\"))"," {"," background = this.get(\"background\");"," cb = this.get(\"contentBox\");"," bg = this.get(\"styles\").background;"," bg.stroke = bg.border;"," bg.stroke.opacity = bg.stroke.alpha;"," bg.fill.opacity = bg.fill.alpha;"," bg.width = this.get(\"width\");"," bg.height = this.get(\"height\");"," bg.type = bg.shape;"," background.set(bg);"," }"," for(; i < len; ++i)"," {"," series = sc[i];"," if(series instanceof Y.CartesianSeries)"," {"," series.render();"," }"," }"," if(hgl && hgl instanceof Y.Gridlines)"," {"," hgl.draw();"," }"," if(vgl && vgl instanceof Y.Gridlines)"," {"," vgl.draw();"," }"," },"," "," /**"," * Object of arrays containing series mapped to a series type."," *"," * @property seriesTypes"," * @type Object"," * @private"," */"," seriesTypes: null,",""," /**"," * Returns a series instance based on an index."," * "," * @method getSeriesByIndex"," * @param {Number} val index of the series"," * @return CartesianSeries"," */"," getSeriesByIndex: function(val)"," {"," var col = this.get(\"seriesCollection\"),"," series;"," if(col && col.length > val)"," {"," series = col[val];"," }"," return series;"," },",""," /**"," * Returns a series instance based on a key value."," * "," * @method getSeriesByKey"," * @param {String} val key value of the series"," * @return CartesianSeries"," */"," getSeriesByKey: function(val)"," {"," var obj = this._seriesDictionary,"," series;"," if(obj && obj.hasOwnProperty(val))"," {"," series = obj[val];"," }"," return series;"," },",""," /**"," * Adds dispatcher to a `_dispatcher` used to"," * to ensure all series have redrawn before for firing event."," *"," * @method addDispatcher"," * @param {CartesianSeries} val series instance to add"," * @protected"," */"," addDispatcher: function(val)"," {"," if(!this._dispatchers)"," {"," this._dispatchers = [];"," }"," this._dispatchers.push(val);"," },",""," /**"," * Collection of series to be displayed in the graph."," *"," * @property _seriesCollection"," * @type Array"," * @private "," */"," _seriesCollection: null,"," "," /**"," * Object containing key value pairs of `CartesianSeries` instances."," *"," * @property _seriesDictionary"," * @type Object"," * @private"," */"," _seriesDictionary: null,",""," /**"," * Parses series instances to be displayed in the graph."," *"," * @method _parseSeriesCollection"," * @param {Array} Collection of `CartesianSeries` instances or objects container `CartesianSeries` attributes values."," * @private"," */"," _parseSeriesCollection: function(val)"," {"," if(!val)"," {"," return;"," } "," var len = val.length,"," i = 0,"," series,"," seriesKey;"," this._seriesCollection = [];"," this._seriesDictionary = {};"," this.seriesTypes = [];"," for(; i < len; ++i)"," { "," series = val[i];"," if(!(series instanceof Y.CartesianSeries) && !(series instanceof Y.PieSeries))"," {"," this._createSeries(series);"," continue;"," }"," this._addSeries(series);"," }"," len = this._seriesCollection.length;"," for(i = 0; i < len; ++i)"," {"," series = this.get(\"seriesCollection\")[i];"," seriesKey = series.get(\"direction\") == \"horizontal\" ? \"yKey\" : \"xKey\";"," this._seriesDictionary[series.get(seriesKey)] = series;"," }"," },",""," /**"," * Adds a series to the graph."," *"," * @method _addSeries"," * @param {CartesianSeries} series Series to add to the graph."," * @private"," */"," _addSeries: function(series)"," {"," var type = series.get(\"type\"),"," seriesCollection = this.get(\"seriesCollection\"),"," graphSeriesLength = seriesCollection.length,"," seriesTypes = this.seriesTypes,"," typeSeriesCollection; "," if(!series.get(\"graph\")) "," {"," series.set(\"graph\", this);"," }"," seriesCollection.push(series);"," if(!seriesTypes.hasOwnProperty(type))"," {"," this.seriesTypes[type] = [];"," }"," typeSeriesCollection = this.seriesTypes[type];"," series.set(\"graphOrder\", graphSeriesLength);"," series.set(\"order\", typeSeriesCollection.length);"," typeSeriesCollection.push(series);"," this.addDispatcher(series);"," series.after(\"drawingComplete\", Y.bind(this._drawingCompleteHandler, this));"," this.fire(\"seriesAdded\", series);"," },",""," /**"," * Creates a `CartesianSeries` instance from an object containing attribute key value pairs. The key value pairs include attributes for the specific series and a type value which defines the type of"," * series to be used. "," *"," * @method createSeries"," * @param {Object} seriesData Series attribute key value pairs."," * @private"," */"," _createSeries: function(seriesData)"," {"," var type = seriesData.type,"," seriesCollection = this.get(\"seriesCollection\"),"," seriesTypes = this.seriesTypes,"," typeSeriesCollection,"," seriesType,"," series;"," seriesData.graph = this;"," if(!seriesTypes.hasOwnProperty(type))"," {"," seriesTypes[type] = [];"," }"," typeSeriesCollection = seriesTypes[type];"," seriesData.graph = this;"," seriesData.order = typeSeriesCollection.length;"," seriesData.graphOrder = seriesCollection.length;"," seriesType = this._getSeries(seriesData.type);"," series = new seriesType(seriesData);"," this.addDispatcher(series);"," series.after(\"drawingComplete\", Y.bind(this._drawingCompleteHandler, this));"," typeSeriesCollection.push(series);"," seriesCollection.push(series);"," if(this.get(\"rendered\"))"," {"," series.render();"," }"," },"," "," /**"," * String reference for pre-defined `Series` classes."," *"," * @property _seriesMap"," * @type Object"," * @private"," */"," _seriesMap: {"," line : Y.LineSeries,"," column : Y.ColumnSeries,"," bar : Y.BarSeries,"," area : Y.AreaSeries,"," candlestick : Y.CandlestickSeries,"," ohlc : Y.OHLCSeries,"," stackedarea : Y.StackedAreaSeries,"," stackedline : Y.StackedLineSeries,"," stackedcolumn : Y.StackedColumnSeries,"," stackedbar : Y.StackedBarSeries,"," markerseries : Y.MarkerSeries,"," spline : Y.SplineSeries,"," areaspline : Y.AreaSplineSeries,"," stackedspline : Y.StackedSplineSeries,"," stackedareaspline : Y.StackedAreaSplineSeries,"," stackedmarkerseries : Y.StackedMarkerSeries,"," pie : Y.PieSeries,"," combo : Y.ComboSeries,"," stackedcombo : Y.StackedComboSeries,"," combospline : Y.ComboSplineSeries,"," stackedcombospline : Y.StackedComboSplineSeries"," },",""," /**"," * Returns a specific `CartesianSeries` class based on key value from a look up table of a direct reference to a class. When specifying a key value, the following options"," * are available:"," *"," * <table>"," * <tr><th>Key Value</th><th>Class</th></tr>"," * <tr><td>line</td><td>Y.LineSeries</td></tr> "," * <tr><td>column</td><td>Y.ColumnSeries</td></tr> "," * <tr><td>bar</td><td>Y.BarSeries</td></tr> "," * <tr><td>area</td><td>Y.AreaSeries</td></tr> "," * <tr><td>stackedarea</td><td>Y.StackedAreaSeries</td></tr> "," * <tr><td>stackedline</td><td>Y.StackedLineSeries</td></tr> "," * <tr><td>stackedcolumn</td><td>Y.StackedColumnSeries</td></tr> "," * <tr><td>stackedbar</td><td>Y.StackedBarSeries</td></tr> "," * <tr><td>markerseries</td><td>Y.MarkerSeries</td></tr> "," * <tr><td>spline</td><td>Y.SplineSeries</td></tr> "," * <tr><td>areaspline</td><td>Y.AreaSplineSeries</td></tr> "," * <tr><td>stackedspline</td><td>Y.StackedSplineSeries</td></tr>"," * <tr><td>stackedareaspline</td><td>Y.StackedAreaSplineSeries</td></tr>"," * <tr><td>stackedmarkerseries</td><td>Y.StackedMarkerSeries</td></tr>"," * <tr><td>pie</td><td>Y.PieSeries</td></tr>"," * <tr><td>combo</td><td>Y.ComboSeries</td></tr>"," * <tr><td>stackedcombo</td><td>Y.StackedComboSeries</td></tr>"," * <tr><td>combospline</td><td>Y.ComboSplineSeries</td></tr>"," * <tr><td>stackedcombospline</td><td>Y.StackedComboSplineSeries</td></tr>"," * </table>"," * "," * When referencing a class directly, you can specify any of the above classes or any custom class that extends `CartesianSeries` or `PieSeries`."," *"," * @method _getSeries"," * @param {String | Object} type Series type."," * @return CartesianSeries"," * @private"," */"," _getSeries: function(type)"," {"," var seriesClass;"," if(Y_Lang.isString(type))"," {"," seriesClass = this._seriesMap[type];"," }"," else "," {"," seriesClass = type;"," }"," return seriesClass;"," },",""," /**"," * Event handler for marker events."," *"," * @method _markerEventHandler"," * @param {Object} e Event object."," * @private"," */"," _markerEventHandler: function(e)"," {"," var type = e.type,"," markerNode = e.currentTarget,"," strArr = markerNode.getAttribute(\"id\").split(\"_\"),"," series = this.getSeriesByIndex(strArr[1]),"," index = strArr[2];"," series.updateMarkerState(type, index);"," },",""," /**"," * Collection of `CartesianSeries` instances to be redrawn."," *"," * @property _dispatchers"," * @type Array"," * @private"," */"," _dispatchers: null,",""," /**"," * Updates the `Graph` styles."," *"," * @method _updateStyles"," * @private"," */"," _updateStyles: function()"," {"," var styles = this.get(\"styles\").background,"," border = styles.border;"," border.opacity = border.alpha;"," styles.stroke = border;"," styles.fill.opacity = styles.fill.alpha;"," this.get(\"background\").set(styles);"," this._sizeChangeHandler();"," },",""," /**"," * Event handler for size changes."," *"," * @method _sizeChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _sizeChangeHandler: function(e)"," {"," var hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," bg = this.get(\"styles\").background,"," weight,"," background;"," if(bg && bg.border)"," {"," weight = bg.border.weight || 0;"," }"," if(this.get(\"showBackground\"))"," {"," background = this.get(\"background\");"," if(w && h)"," {"," background.set(\"width\", w);"," background.set(\"height\", h);"," }"," }"," if(this._gridlines)"," {"," this._gridlines.clear();"," }"," if(hgl && hgl instanceof Y.Gridlines)"," {"," hgl.draw();"," }"," if(vgl && vgl instanceof Y.Gridlines)"," {"," vgl.draw();"," }"," this._drawSeries();"," },",""," /**"," * Draws each series."," *"," * @method _drawSeries"," * @private"," */"," _drawSeries: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," var sc,"," i,"," len,"," graphic = this.get(\"graphic\");"," graphic.set(\"autoDraw\", false);"," this._callLater = false;"," this._drawing = true;"," sc = this.get(\"seriesCollection\");"," i = 0;"," len = sc ? sc.length : 0;"," for(; i < len; ++i)"," {"," sc[i].draw();"," if((!sc[i].get(\"xcoords\") || !sc[i].get(\"ycoords\")) && !sc[i] instanceof Y.PieSeries)"," {"," this._callLater = true;"," break;"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawSeries();"," }"," }, ",""," /**"," * Event handler for series drawingComplete event."," *"," * @method _drawingCompleteHandler"," * @param {Object} e Event object."," * @private"," */"," _drawingCompleteHandler: function(e)"," {"," var series = e.currentTarget,"," graphic,"," index = Y.Array.indexOf(this._dispatchers, series);"," if(index > -1)"," {"," this._dispatchers.splice(index, 1);"," }"," if(this._dispatchers.length < 1)"," {"," graphic = this.get(\"graphic\");"," if(!graphic.get(\"autoDraw\"))"," {"," graphic._redraw();"," }"," this.fire(\"chartRendered\");"," }"," },",""," /**"," * Gets the default value for the `styles` attribute. Overrides"," * base implementation."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var defs = {"," background: {"," shape: \"rect\","," fill:{"," color:\"#faf9f2\""," },"," border: {"," color:\"#dad8c9\","," weight: 1"," }"," }"," };"," return defs;"," },",""," /**"," * Destructor implementation Graph class. Removes all Graphic instances from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," if(this._graphic)"," {"," this._graphic.destroy();"," this._graphic = null;"," }"," if(this._background)"," {"," this._background.get(\"graphic\").destroy();"," this._background = null;"," }"," if(this._gridlines)"," {"," this._gridlines.get(\"graphic\").destroy();"," this._gridlines = null;"," }"," }","}, {"," ATTRS: {"," /**"," * The x-coordinate for the graph."," *"," * @attribute x"," * @type Number"," * @protected"," */"," x: {"," setter: function(val)"," {"," this.get(\"boundingBox\").setStyle(\"left\", val + \"px\");"," return val;"," }"," },",""," /**"," * The y-coordinate for the graph."," *"," * @attribute y"," * @type Number"," * @protected"," */"," y: {"," setter: function(val)"," {"," this.get(\"boundingBox\").setStyle(\"top\", val + \"px\");"," return val;"," }"," },",""," /**"," * Reference to the chart instance using the graph."," *"," * @attribute chart"," * @type ChartBase"," * @readOnly"," */"," chart: {},",""," /**"," * Collection of series. When setting the `seriesCollection` the array can contain a combination of either"," * `CartesianSeries` instances or object literals with properties that will define a series."," *"," * @attribute seriesCollection"," * @type CartesianSeries"," */"," seriesCollection: {"," getter: function()"," {"," return this._seriesCollection;"," },",""," setter: function(val)"," {"," this._parseSeriesCollection(val);"," return this._seriesCollection;"," }"," },"," "," /**"," * Indicates whether the `Graph` has a background."," *"," * @attribute showBackground"," * @type Boolean"," * @default true"," */"," showBackground: {"," value: true"," },",""," /**"," * Read-only hash lookup for all series on in the `Graph`."," *"," * @attribute seriesDictionary"," * @type Object"," * @readOnly"," */"," seriesDictionary: {"," readOnly: true,",""," getter: function()"," {"," return this._seriesDictionary;"," }"," },",""," /**"," * Reference to the horizontal `Gridlines` instance."," *"," * @attribute horizontalGridlines"," * @type Gridlines"," * @default null"," */"," horizontalGridlines: {"," value: null,",""," setter: function(val)"," {"," var gl = this.get(\"horizontalGridlines\");"," if(gl && gl instanceof Y.Gridlines)"," {"," gl.remove();"," }"," if(val instanceof Y.Gridlines)"," {"," gl = val;"," val.set(\"graph\", this);"," return val;"," }"," else if(val && val.axis)"," {"," gl = new Y.Gridlines({direction:\"horizontal\", axis:val.axis, graph:this, styles:val.styles});"," return gl;"," }"," }"," },"," "," /**"," * Reference to the vertical `Gridlines` instance."," *"," * @attribute verticalGridlines"," * @type Gridlines"," * @default null"," */"," verticalGridlines: {"," value: null,",""," setter: function(val)"," {"," var gl = this.get(\"verticalGridlines\");"," if(gl && gl instanceof Y.Gridlines)"," {"," gl.remove();"," }"," if(val instanceof Y.Gridlines)"," {"," gl = val;"," val.set(\"graph\", this);"," return val;"," }"," else if(val && val.axis)"," {"," gl = new Y.Gridlines({direction:\"vertical\", axis:val.axis, graph:this, styles:val.styles});"," return gl;"," }"," }"," },",""," /**"," * Reference to graphic instance used for the background."," *"," * @attribute background"," * @type Graphic"," * @readOnly"," */"," background: {"," getter: function()"," {"," if(!this._background)"," {"," this._backgroundGraphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._backgroundGraphic.get(\"node\").style.zIndex = 0; "," this._background = this._backgroundGraphic.addShape({type: \"rect\"});"," }"," return this._background;"," }"," },",""," /**"," * Reference to graphic instance used for gridlines."," *"," * @attribute gridlines"," * @type Graphic"," * @readOnly"," */"," gridlines: {"," readOnly: true,",""," getter: function()"," {"," if(!this._gridlines)"," {"," this._gridlinesGraphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._gridlinesGraphic.get(\"node\").style.zIndex = 1; "," this._gridlines = this._gridlinesGraphic.addShape({type: \"path\"});"," }"," return this._gridlines;"," }"," },"," "," /**"," * Reference to graphic instance used for series."," *"," * @attribute graphic"," * @type Graphic"," * @readOnly"," */"," graphic: {"," readOnly: true,",""," getter: function() "," {"," if(!this._graphic)"," {"," this._graphic = new Y.Graphic({render:this.get(\"contentBox\")});"," this._graphic.get(\"node\").style.zIndex = 2; "," this._graphic.set(\"autoDraw\", false);"," }"," return this._graphic;"," }"," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," value: false"," }",""," /**"," * Style properties used for drawing a background. Below are the default values:"," * <dl>"," * <dt>background</dt><dd>An object containing the following values:"," * <dl>"," * <dt>fill</dt><dd>Defines the style properties for the fill. Contains the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the fill. The default value is #faf9f2.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background fill. The default value is 1.</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>Defines the style properties for the border. Contains the following values:"," * <dl>"," * <dt>color</dt><dd>Color of the border. The default value is #dad8c9.</dd>"," * <dt>alpha</dt><dd>Number from 0 to 1 indicating the opacity of the background border. The default value is 1.</dd>"," * <dt>weight</dt><dd>Number indicating the width of the border. The default value is 1.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The ChartBase class is an abstract class used to create charts."," *"," * @module charts"," * @submodule charts-base"," * @class ChartBase"," * @constructor"," */","function ChartBase() {}","","ChartBase.ATTRS = {"," /**"," * Data used to generate the chart."," * "," * @attribute dataProvider"," * @type Array"," */"," dataProvider: {"," lazyAdd: false,",""," valueFn: function()"," {"," var defDataProvider = [];"," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = this._buildSeriesKeys(defDataProvider);"," }"," return defDataProvider;"," },",""," setter: function(val)"," {"," var dataProvider = this._setDataValues(val);"," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = this._buildSeriesKeys(dataProvider);"," }"," return dataProvider;"," }"," },",""," /**"," * A collection of keys that map to the series axes. If no keys are set,"," * they will be generated automatically depending on the data structure passed into "," * the chart."," *"," * @attribute seriesKeys"," * @type Array"," */"," seriesKeys: {"," getter: function()"," {"," return this._seriesKeys;"," },",""," setter: function(val)"," {"," this._seriesKeysExplicitlySet = true;"," this._seriesKeys = val;"," return val;"," }"," },",""," /**"," * Sets the `aria-label` for the chart."," *"," * @attribute ariaLabel"," * @type String"," */"," ariaLabel: {"," value: \"Chart Application\",",""," setter: function(val)"," {"," var cb = this.get(\"contentBox\");"," if(cb)"," {"," cb.setAttribute(\"aria-label\", val);"," }"," return val;"," }"," },"," "," /**"," * Sets the aria description for the chart."," *"," * @attribute ariaDescription"," * @type String"," */"," ariaDescription: {"," value: \"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.\",",""," setter: function(val)"," {"," if(this._description)"," {"," this._description.setContent(\"\");"," this._description.appendChild(DOCUMENT.createTextNode(val));"," }"," return val;"," }"," },"," "," /**"," * Reference to the default tooltip available for the chart."," * <p>Contains the following properties:</p>"," * <dl>"," * <dt>node</dt><dd>Reference to the actual dom node</dd>"," * <dt>showEvent</dt><dd>Event that should trigger the tooltip</dd>"," * <dt>hideEvent</dt><dd>Event that should trigger the removal of a tooltip (can be an event or an array of events)</dd>"," * <dt>styles</dt><dd>A hash of style properties that will be applied to the tooltip node</dd>"," * <dt>show</dt><dd>Indicates whether or not to show the tooltip</dd>"," * <dt>markerEventHandler</dt><dd>Displays and hides tooltip based on marker events</dd>"," * <dt>planarEventHandler</dt><dd>Displays and hides tooltip based on planar events</dd>"," * <dt>markerLabelFunction</dt><dd>Reference to the function used to format a marker event triggered tooltip's text. The method contains "," * the following arguments:"," * <dl>"," * <dt>categoryItem</dt><dd>An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided).</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category.</dd>"," * </dl>"," * </dd>"," * <dt>valueItem</dt><dd>An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * </dd>"," * <dt>itemIndex</dt><dd>The index of the item within the series.</dd>"," * <dt>series</dt><dd> The `CartesianSeries` instance of the item.</dd>"," * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>"," * </dl>"," * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you"," * will also need to override the tooltip's `setTextFunction` method to accept an html string."," * </dd>"," * <dt>planarLabelFunction</dt><dd>Reference to the function used to format a planar event triggered tooltip's text"," * <dl>"," * <dt>categoryAxis</dt><dd> `CategoryAxis` Reference to the categoryAxis of the chart."," * <dt>valueItems</dt><dd>Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:"," * <dl>"," * <dt>axis</dt><dd>The value axis of the series.</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * </dl> "," * </dd>"," * <dt>index</dt><dd>The index of the item within its series.</dd>"," * <dt>seriesArray</dt><dd>Array of series instances for each value item.</dd>"," * <dt>seriesIndex</dt><dd>The index of the series in the `seriesCollection`.</dd>"," * </dl>"," * </dd>"," * </dl>"," * The method returns an `HTMLElement` which is written into the DOM using `appendChild`. If you override this method and choose to return an html string, you"," * will also need to override the tooltip's `setTextFunction` method to accept an html string."," * </dd>"," * <dt>setTextFunction</dt><dd>Method that writes content returned from `planarLabelFunction` or `markerLabelFunction` into the the tooltip node."," * has the following signature:"," * <dl>"," * <dt>label</dt><dd>The `HTMLElement` that the content is to be added.</dd>"," * <dt>val</dt><dd>The content to be rendered into tooltip. This can be a `String` or `HTMLElement`. If an HTML string is used, it will be rendered as a"," * string.</dd>"," * </dl>"," * </dd>"," * </dl>"," * @attribute tooltip"," * @type Object"," */ "," tooltip: {"," valueFn: \"_getTooltip\",",""," setter: function(val)"," {"," return this._updateTooltip(val);"," }"," },",""," /** "," * The key value used for the chart's category axis. "," *"," * @attribute categoryKey"," * @type String"," * @default category"," */"," categoryKey: {"," value: \"category\""," },"," "," /**"," * Indicates the type of axis to use for the category axis."," *"," * <dl>"," * <dt>category</dt><dd>Specifies a `CategoryAxis`.</dd>"," * <dt>time</dt><dd>Specifies a `TimeAxis</dd>"," * </dl>"," *"," * @attribute categoryType"," * @type String"," * @default category"," */"," categoryType:{"," value:\"category\""," },",""," /**"," * Indicates the the type of interactions that will fire events."," *"," * <dl>"," * <dt>marker</dt><dd>Events will be broadcasted when the mouse interacts with individual markers.</dd>"," * <dt>planar</dt><dd>Events will be broadcasted when the mouse intersects the plane of any markers on the chart.</dd>"," * <dt>none</dt><dd>No events will be broadcasted.</dd>"," * </dl>"," *"," * @attribute interactionType"," * @type String"," * @default marker"," */"," interactionType: {"," value: \"marker\""," },",""," /**"," * Reference to all the axes in the chart."," *"," * @attribute axesCollection"," * @type Array"," */"," axesCollection: {},",""," /**"," * Reference to graph instance."," * "," * @attribute graph"," * @type Graph "," */"," graph: {"," valueFn: \"_getGraph\""," },",""," /**"," * Indicates whether or not markers for a series will be grouped and rendered in a single complex shape instance."," *"," * @attribute groupMarkers"," * @type Boolean"," */"," groupMarkers: {"," value: false"," }","};","","ChartBase.prototype = {"," /**"," * Handles groupMarkers change event."," *"," * @method _groupMarkersChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _groupMarkersChangeHandler: function(e)"," {"," var graph = this.get(\"graph\"),"," useGroupMarkers = e.newVal;"," if(graph)"," {"," graph.set(\"groupMarkers\", useGroupMarkers);"," }"," },",""," /**"," * Handler for itemRendered event."," *"," * @method _itemRendered"," * @param {Object} e Event object."," * @private"," */"," _itemRendered: function(e)"," {"," this._itemRenderQueue = this._itemRenderQueue.splice(1 + Y.Array.indexOf(this._itemRenderQueue, e.currentTarget), 1);"," if(this._itemRenderQueue.length < 1)"," {"," this._redraw();"," }"," },",""," /**"," * Default value function for the `Graph` attribute."," *"," * @method _getGraph"," * @return Graph"," * @private"," */"," _getGraph: function()"," {"," var graph = new Y.Graph({"," chart:this,"," groupMarkers: this.get(\"groupMarkers\") "," });"," graph.after(\"chartRendered\", Y.bind(function(e) {"," this.fire(\"chartRendered\");"," }, this));"," return graph; "," },",""," /**"," * Returns a series instance by index or key value."," *"," * @method getSeries"," * @param val"," * @return CartesianSeries"," */"," getSeries: function(val)"," {"," var series = null, "," graph = this.get(\"graph\");"," if(graph)"," {"," if(Y_Lang.isNumber(val))"," {"," series = graph.getSeriesByIndex(val);"," }"," else"," {"," series = graph.getSeriesByKey(val);"," }"," }"," return series;"," },",""," /**"," * Returns an `Axis` instance by key reference. If the axis was explicitly set through the `axes` attribute,"," * the key will be the same as the key used in the `axes` object. For default axes, the key for"," * the category axis is the value of the `categoryKey` (`category`). For the value axis, the default "," * key is `values`."," *"," * @method getAxisByKey"," * @param {String} val Key reference used to look up the axis."," * @return Axis"," */"," getAxisByKey: function(val)"," {"," var axis,"," axes = this.get(\"axes\");"," if(axes && axes.hasOwnProperty(val))"," {"," axis = axes[val];"," }"," return axis;"," },",""," /**"," * Returns the category axis for the chart."," *"," * @method getCategoryAxis"," * @return Axis"," */"," getCategoryAxis: function()"," {"," var axis,"," key = this.get(\"categoryKey\"),"," axes = this.get(\"axes\");"," if(axes.hasOwnProperty(key))"," {"," axis = axes[key];"," }"," return axis;"," },",""," /**"," * Default direction of the chart."," *"," * @property _direction"," * @type String"," * @default horizontal"," * @private"," */"," _direction: \"horizontal\","," "," /**"," * Storage for the `dataProvider` attribute."," *"," * @property _dataProvider"," * @type Array"," * @private"," */"," _dataProvider: null,",""," /**"," * Setter method for `dataProvider` attribute."," *"," * @method _setDataValues"," * @param {Array} val Array to be set as `dataProvider`."," * @return Array"," * @private"," */"," _setDataValues: function(val)"," {"," if(Y_Lang.isArray(val[0]))"," {"," var hash, "," dp = [], "," cats = val[0], "," i = 0, "," l = cats.length, "," n, "," sl = val.length;"," for(; i < l; ++i)"," {"," hash = {category:cats[i]};"," for(n = 1; n < sl; ++n)"," {"," hash[\"series\" + n] = val[n][i];"," }"," dp[i] = hash; "," }"," return dp;"," }"," return val;"," },",""," /**"," * Storage for `seriesCollection` attribute."," *"," * @property _seriesCollection"," * @type Array"," * @private "," */"," _seriesCollection: null,",""," /**"," * Setter method for `seriesCollection` attribute."," *"," * @property _setSeriesCollection"," * @param {Array} val Array of either `CartesianSeries` instances or objects containing series attribute key value pairs."," * @private"," */"," _setSeriesCollection: function(val)"," {"," this._seriesCollection = val;"," },"," /**"," * Helper method that returns the axis class that a key references."," *"," * @method _getAxisClass"," * @param {String} t The type of axis."," * @return Axis"," * @private"," */"," _getAxisClass: function(t)"," {"," return this._axisClass[t];"," },"," "," /**"," * Key value pairs of axis types. "," *"," * @property _axisClass"," * @type Object"," * @private"," */"," _axisClass: {"," stacked: Y.StackedAxis,"," numeric: Y.NumericAxis,"," category: Y.CategoryAxis,"," time: Y.TimeAxis"," },",""," /**"," * Collection of axes."," *"," * @property _axes"," * @type Array"," * @private"," */"," _axes: null,",""," /**"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this._itemRenderQueue = [];"," this._seriesIndex = -1;"," this._itemIndex = -1;"," this.after(\"dataProviderChange\", this._dataProviderChangeHandler);"," },",""," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var tt = this.get(\"tooltip\"),"," bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\");"," //move the position = absolute logic to a class file"," bb.setStyle(\"position\", \"absolute\");"," cb.setStyle(\"position\", \"absolute\");"," this._addAxes();"," this._addSeries();"," if(tt && tt.show)"," {"," this._addTooltip();"," }"," this._setAriaElements(bb, cb);"," },"," "," /**"," * Creates an aria `live-region`, `aria-label` and `aria-describedby` for the Chart."," *"," * @method _setAriaElements"," * @param {Node} cb Reference to the Chart's `contentBox` attribute."," * @private"," */"," _setAriaElements: function(bb, cb)"," {"," var description = this._getAriaOffscreenNode(),"," id = this.get(\"id\") + \"_description\","," liveRegion = this._getAriaOffscreenNode();"," cb.set(\"tabIndex\", 0);"," cb.set(\"role\", \"img\");"," cb.setAttribute(\"aria-label\", this.get(\"ariaLabel\"));"," cb.setAttribute(\"aria-describedby\", id);"," description.set(\"id\", id);"," description.set(\"tabIndex\", -1);"," description.appendChild(DOCUMENT.createTextNode(this.get(\"ariaDescription\")));"," liveRegion.set(\"id\", \"live-region\");"," liveRegion.set(\"aria-live\", \"polite\");"," liveRegion.set(\"aria-atomic\", \"true\");"," liveRegion.set(\"role\", \"status\");"," bb.setAttribute(\"role\", \"application\");"," bb.appendChild(description);"," bb.appendChild(liveRegion);"," this._description = description;"," this._liveRegion = liveRegion;"," },",""," /**"," * Sets a node offscreen for use as aria-description or aria-live-regin."," *"," * @method _setOffscreen"," * @return Node "," * @private"," */"," _getAriaOffscreenNode: function() "," {"," var node = Y.Node.create(\"<div></div>\"),"," ie = Y.UA.ie,"," clipRect = (ie && ie < 8) ? \"rect(1px 1px 1px 1px)\" : \"rect(1px, 1px, 1px, 1px)\";"," node.setStyle(\"position\", \"absolute\");"," node.setStyle(\"height\", \"1px\"); "," node.setStyle(\"width\", \"1px\"); "," node.setStyle(\"overflow\", \"hidden\");"," node.setStyle(\"clip\", clipRect); "," return node;"," },"," "," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," this._redraw();"," },",""," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.after(\"tooltipChange\", Y.bind(this._tooltipChangeHandler, this));"," this.after(\"widthChange\", this._sizeChanged);"," this.after(\"heightChange\", this._sizeChanged);"," this.after(\"groupMarkersChange\", this._groupMarkersChangeHandler);"," var tt = this.get(\"tooltip\"),"," hideEvent = \"mouseout\","," showEvent = \"mouseover\","," cb = this.get(\"contentBox\"),"," interactionType = this.get(\"interactionType\"),"," i = 0,"," len,"," markerClassName = \".\" + SERIES_MARKER,"," isTouch = ((WINDOW && (\"ontouchstart\" in WINDOW)) && !(Y.UA.chrome && Y.UA.chrome < 6));"," Y.on(\"keydown\", Y.bind(function(e) {"," var key = e.keyCode,"," numKey = parseFloat(key),"," msg;"," if(numKey > 36 && numKey < 41)"," {"," e.halt();"," msg = this._getAriaMessage(numKey);"," this._liveRegion.setContent(\"\");"," this._liveRegion.appendChild(DOCUMENT.createTextNode(msg));"," }"," }, this), this.get(\"contentBox\"));"," if(interactionType == \"marker\")"," {"," //if touch capabilities, toggle tooltip on touchend. otherwise, the tooltip attribute's hideEvent/showEvent types."," hideEvent = tt.hideEvent;"," showEvent = tt.showEvent;"," if(isTouch)"," {"," Y.delegate(\"touchend\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," //hide active tooltip if the chart is touched"," Y.on(\"touchend\", Y.bind(function(e) {"," e.halt(true);"," if(this._activeMarker)"," {"," this._activeMarker = null;"," this.hideTooltip(e);"," }"," }, this));"," }"," else"," {"," Y.delegate(\"mouseenter\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mousedown\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mouseup\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mouseleave\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"click\", Y.bind(this._markerEventDispatcher, this), cb, markerClassName);"," Y.delegate(\"mousemove\", Y.bind(this._positionTooltip, this), cb, markerClassName);"," }"," }"," else if(interactionType == \"planar\")"," {"," if(isTouch)"," {"," this._overlay.on(\"touchend\", Y.bind(this._planarEventDispatcher, this));"," }"," else"," {"," this._overlay.on(\"mousemove\", Y.bind(this._planarEventDispatcher, this));"," this.on(\"mouseout\", this.hideTooltip);"," }"," }"," if(tt)"," {"," this.on(\"markerEvent:touchend\", Y.bind(function(e) {"," var marker = e.series.get(\"markers\")[e.index];"," if(this._activeMarker && marker === this._activeMarker)"," {"," this._activeMarker = null;"," this.hideTooltip(e);"," }"," else"," {",""," this._activeMarker = marker;"," tt.markerEventHandler.apply(this, [e]);"," }"," }, this));"," if(hideEvent && showEvent && hideEvent == showEvent)"," {"," this.on(interactionType + \"Event:\" + hideEvent, this.toggleTooltip);"," }"," else"," {"," if(showEvent)"," {"," this.on(interactionType + \"Event:\" + showEvent, tt[interactionType + \"EventHandler\"]);"," }"," if(hideEvent)"," {"," if(Y_Lang.isArray(hideEvent))"," {"," len = hideEvent.length;"," for(; i < len; ++i)"," {"," this.on(interactionType + \"Event:\" + hideEvent[i], this.hideTooltip);"," }"," }"," this.on(interactionType + \"Event:\" + hideEvent, this.hideTooltip);"," }"," }"," }"," },"," "," /**"," * Event handler for marker events."," *"," * @method _markerEventDispatcher"," * @param {Object} e Event object."," * @private"," */"," _markerEventDispatcher: function(e)"," {"," var type = e.type,"," cb = this.get(\"contentBox\"),"," markerNode = e.currentTarget,"," strArr = markerNode.getAttribute(\"id\").split(\"_\"),"," index = strArr.pop(),"," seriesIndex = strArr.pop(),"," series = this.getSeries(parseInt(seriesIndex, 10)),"," items = this.getSeriesItems(series, index),"," isTouch = e && e.hasOwnProperty(\"changedTouches\"),"," pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,"," pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,"," x = pageX - cb.getX(),"," y = pageY - cb.getY();"," if(type == \"mouseenter\")"," {"," type = \"mouseover\";"," }"," else if(type == \"mouseleave\")"," {"," type = \"mouseout\";"," }"," series.updateMarkerState(type, index);"," e.halt();"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseover event."," * "," *"," * @event markerEvent:mouseover"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseout event."," *"," * @event markerEvent:mouseout"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mousedown event."," *"," * @event markerEvent:mousedown"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a mouseup event."," *"," * @event markerEvent:mouseup"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `marker` and a series marker has received a click event."," *"," * @event markerEvent:click"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>Hash containing information about the category `Axis`.</dd>"," * <dt>valueItem</dt><dd>Hash containing information about the value `Axis`.</dd>"," * <dt>node</dt><dd>The dom node of the marker.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>"," * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>"," * <dt>series</dt><dd>Reference to the series of the marker.</dd>"," * <dt>index</dt><dd>Index of the marker in the series.</dd>"," * <dt>seriesIndex</dt><dd>The `order` of the marker's series.</dd>"," * <dt>originEvent</dt><dd>Underlying dom event.</dd>"," * </dl>"," */"," this.fire(\"markerEvent:\" + type, {"," originEvent: e,"," pageX:pageX, "," pageY:pageY, "," categoryItem:items.category, "," valueItem:items.value, "," node:markerNode, "," x:x, "," y:y, "," series:series, "," index:index, "," seriesIndex:seriesIndex"," });"," },",""," /**"," * Event handler for dataProviderChange."," *"," * @method _dataProviderChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _dataProviderChangeHandler: function(e)"," {"," var dataProvider = e.newVal,"," axes,"," i,"," axis;"," this._seriesIndex = -1;"," this._itemIndex = -1;"," if(this instanceof Y.CartesianChart)"," {"," this.set(\"axes\", this.get(\"axes\"));"," this.set(\"seriesCollection\", this.get(\"seriesCollection\"));"," }"," axes = this.get(\"axes\");"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," if(axis instanceof Y.Axis)"," {"," if(axis.get(\"position\") != \"none\")"," {"," this._addToAxesRenderQueue(axis);"," }"," axis.set(\"dataProvider\", dataProvider);"," }"," }"," }"," }"," },"," "," /**"," * Event listener for toggling the tooltip. If a tooltip is visible, hide it. If not, it "," * will create and show a tooltip based on the event object."," * "," * @method toggleTooltip"," * @param {Object} e Event object."," */"," toggleTooltip: function(e)"," {"," var tt = this.get(\"tooltip\");"," if(tt.visible)"," {"," this.hideTooltip();"," }"," else"," {"," tt.markerEventHandler.apply(this, [e]);"," }"," },",""," /**"," * Shows a tooltip"," *"," * @method _showTooltip"," * @param {String} msg Message to dispaly in the tooltip."," * @param {Number} x x-coordinate "," * @param {Number} y y-coordinate"," * @private"," */"," _showTooltip: function(msg, x, y)"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node;"," if(msg)"," {"," tt.visible = true;"," tt.setTextFunction(node, msg);"," node.setStyle(\"top\", y + \"px\");"," node.setStyle(\"left\", x + \"px\");"," node.setStyle(\"visibility\", \"visible\");"," }"," },",""," /**"," * Positions the tooltip"," *"," * @method _positionTooltip"," * @param {Object} e Event object."," * @private"," */"," _positionTooltip: function(e)"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node,"," cb = this.get(\"contentBox\"),"," x = (e.pageX + 10) - cb.getX(),"," y = (e.pageY + 10) - cb.getY();"," if(node)"," {"," node.setStyle(\"left\", x + \"px\");"," node.setStyle(\"top\", y + \"px\");"," }"," },",""," /**"," * Hides the default tooltip"," *"," * @method hideTooltip"," */"," hideTooltip: function()"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node;"," tt.visible = false;"," node.set(\"innerHTML\", \"\");"," node.setStyle(\"left\", -10000);"," node.setStyle(\"top\", -10000);"," node.setStyle(\"visibility\", \"hidden\");"," },",""," /**"," * Adds a tooltip to the dom."," *"," * @method _addTooltip"," * @private"," */"," _addTooltip: function()"," {"," var tt = this.get(\"tooltip\"),"," id = this.get(\"id\") + \"_tooltip\","," cb = this.get(\"contentBox\"),"," oldNode = DOCUMENT.getElementById(id);"," if(oldNode)"," {"," cb.removeChild(oldNode);"," }"," tt.node.set(\"id\", id);"," tt.node.setStyle(\"visibility\", \"hidden\");"," cb.appendChild(tt.node);"," },",""," /**"," * Updates the tooltip attribute."," *"," * @method _updateTooltip"," * @param {Object} val Object containing properties for the tooltip."," * @return Object"," * @private"," */"," _updateTooltip: function(val)"," {"," var tt = this.get(\"tooltip\") || this._getTooltip(),"," i,"," styles,"," node,"," props = {"," markerLabelFunction:\"markerLabelFunction\","," planarLabelFunction:\"planarLabelFunction\","," setTextFunction:\"setTextFunction\","," showEvent:\"showEvent\","," hideEvent:\"hideEvent\","," markerEventHandler:\"markerEventHandler\","," planarEventHandler:\"planarEventHandler\","," show:\"show\""," };"," if(Y_Lang.isObject(val))"," {"," styles = val.styles;"," node = Y.one(val.node) || tt.node;"," if(styles)"," {"," for(i in styles)"," {"," if(styles.hasOwnProperty(i))"," {"," node.setStyle(i, styles[i]);"," }"," }"," }"," for(i in props)"," {"," if(val.hasOwnProperty(i))"," {"," tt[i] = val[i];"," }"," }"," tt.node = node;"," }"," return tt;"," },",""," /**"," * Default getter for `tooltip` attribute."," *"," * @method _getTooltip"," * @return Object"," * @private"," */"," _getTooltip: function()"," {"," var node = DOCUMENT.createElement(\"div\"),"," tooltipClass = _getClassName(\"chart-tooltip\"),"," tt = {"," setTextFunction: this._setText,"," markerLabelFunction: this._tooltipLabelFunction,"," planarLabelFunction: this._planarLabelFunction,"," show: true,"," hideEvent: \"mouseout\","," showEvent: \"mouseover\","," markerEventHandler: function(e)"," {"," var tt = this.get(\"tooltip\"),"," msg = tt.markerLabelFunction.apply(this, [e.categoryItem, e.valueItem, e.index, e.series, e.seriesIndex]);"," this._showTooltip(msg, e.x + 10, e.y + 10);"," },"," planarEventHandler: function(e)"," {"," var tt = this.get(\"tooltip\"),"," msg ,"," categoryAxis = this.get(\"categoryAxis\");"," msg = tt.planarLabelFunction.apply(this, [categoryAxis, e.valueItem, e.index, e.items, e.seriesIndex]);"," this._showTooltip(msg, e.x + 10, e.y + 10);"," }"," };"," node = Y.one(node);"," node.set(\"id\", this.get(\"id\") + \"_tooltip\");"," node.setStyle(\"fontSize\", \"85%\");"," node.setStyle(\"opacity\", \"0.83\");"," node.setStyle(\"position\", \"absolute\");"," node.setStyle(\"paddingTop\", \"2px\");"," node.setStyle(\"paddingRight\", \"5px\");"," node.setStyle(\"paddingBottom\", \"4px\");"," node.setStyle(\"paddingLeft\", \"2px\");"," node.setStyle(\"backgroundColor\", \"#fff\");"," node.setStyle(\"border\", \"1px solid #dbdccc\");"," node.setStyle(\"pointerEvents\", \"none\");"," node.setStyle(\"zIndex\", 3);"," node.setStyle(\"whiteSpace\", \"noWrap\");"," node.setStyle(\"visibility\", \"hidden\");"," node.addClass(tooltipClass);"," tt.node = Y.one(node);"," return tt;"," },",""," /**"," * Formats tooltip text when `interactionType` is `planar`."," *"," * @method _planarLabelFunction"," * @param {Axis} categoryAxis Reference to the categoryAxis of the chart."," * @param {Array} valueItems Array of objects for each series that has a data point in the coordinate plane of the event. Each object contains the following data:"," * <dl>"," * <dt>axis</dt><dd>The value axis of the series.</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * </dl> "," * @param {Number} index The index of the item within its series."," * @param {Array} seriesArray Array of series instances for each value item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {String | HTML} "," * @private"," */"," _planarLabelFunction: function(categoryAxis, valueItems, index, seriesArray, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," valueItem,"," i = 0,"," len = seriesArray.length,"," axis,"," categoryValue,"," seriesValue,"," series;"," if(categoryAxis)"," {"," categoryValue = categoryAxis.get(\"labelFunction\").apply(this, [categoryAxis.getKeyValueAt(this.get(\"categoryKey\"), index), categoryAxis.get(\"labelFormat\")]);"," if(!Y_Lang.isObject(categoryValue))"," {"," categoryValue = DOCUMENT.createTextNode(categoryValue);"," }"," msg.appendChild(categoryValue);"," }",""," for(; i < len; ++i)"," {"," series = seriesArray[i];"," if(series.get(\"visible\"))"," {"," valueItem = valueItems[i];"," axis = valueItem.axis;"," seriesValue = axis.get(\"labelFunction\").apply(this, [axis.getKeyValueAt(valueItem.key, index), axis.get(\"labelFormat\")]);"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName));"," msg.appendChild(DOCUMENT.createTextNode(\": \"));"," if(!Y_Lang.isObject(seriesValue))"," {"," seriesValue = DOCUMENT.createTextNode(seriesValue);"," }"," msg.appendChild(seriesValue);"," }"," }"," return msg;"," },",""," /**"," * Formats tooltip text when `interactionType` is `marker`."," *"," * @method _tooltipLabelFunction"," * @param {Object} categoryItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category</dd>"," * </dl>"," * @param {Object} valueItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * @param {Number} itemIndex The index of the item within the series."," * @param {CartesianSeries} series The `CartesianSeries` instance of the item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {String | HTML}"," * @private"," */"," _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," categoryValue = categoryItem.axis.get(\"labelFunction\").apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]),"," seriesValue = valueItem.axis.get(\"labelFunction\").apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]);"," msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName)); "," msg.appendChild(DOCUMENT.createTextNode(\": \")); "," if(!Y_Lang.isObject(categoryValue))"," {"," categoryValue = DOCUMENT.createTextNode(categoryValue);"," }"," msg.appendChild(categoryValue);"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName)); "," msg.appendChild(DOCUMENT.createTextNode(\": \")); "," if(!Y_Lang.isObject(seriesValue))"," {"," seriesValue = DOCUMENT.createTextNode(seriesValue);"," }"," msg.appendChild(seriesValue);"," return msg; "," },",""," /**"," * Event handler for the tooltipChange."," *"," * @method _tooltipChangeHandler"," * @param {Object} e Event object."," * @private"," */"," _tooltipChangeHandler: function(e)"," {"," if(this.get(\"tooltip\"))"," {"," var tt = this.get(\"tooltip\"),"," node = tt.node,"," show = tt.show,"," cb = this.get(\"contentBox\");"," if(node && show)"," {"," if(!cb.contains(node))"," {"," this._addTooltip();"," }"," }"," }"," },"," "," /**"," * Updates the content of text field. This method writes a value into a text field using "," * `appendChild`. If the value is a `String`, it is converted to a `TextNode` first. "," *"," * @method _setText"," * @param label {HTMLElement} label to be updated"," * @param val {String} value with which to update the label"," * @private"," */"," _setText: function(textField, val)"," { "," textField.setContent(\"\");"," if(Y_Lang.isNumber(val))"," {"," val = val + \"\";"," }"," else if(!val)"," {"," val = \"\";"," }"," if(IS_STRING(val))"," {"," val = DOCUMENT.createTextNode(val);"," }"," textField.appendChild(val);"," },",""," /**"," * Returns all the keys contained in a `dataProvider`."," *"," * @method _getAllKeys"," * @param {Array} dp Collection of objects to be parsed."," * @return Object"," */"," _getAllKeys: function(dp)"," {"," var i = 0,"," len = dp.length,"," item,"," key,"," keys = {};"," for(; i < len; ++i)"," {"," item = dp[i];"," for(key in item)"," {"," if(item.hasOwnProperty(key))"," {"," keys[key] = true;"," }"," }"," }"," return keys;"," },"," "," /**"," * Constructs seriesKeys if not explicitly specified."," *"," * @method _buildSeriesKeys"," * @param {Array} dataProvider The dataProvider for the chart."," * @return Array"," * @private"," */"," _buildSeriesKeys: function(dataProvider)"," {"," var allKeys,"," catKey = this.get(\"categoryKey\"),"," keys = [],"," i;"," if(this._seriesKeysExplicitlySet)"," {"," return this._seriesKeys;"," }"," allKeys = this._getAllKeys(dataProvider);"," for(i in allKeys)"," {"," if(allKeys.hasOwnProperty(i) && i != catKey)"," {"," keys.push(i);"," }"," }"," return keys;"," }","};","Y.ChartBase = ChartBase;","/**"," * The CartesianChart class creates a chart with horizontal and vertical axes."," *"," * @module charts"," * @submodule charts-base"," * @class CartesianChart"," * @extends ChartBase"," * @constructor"," */","Y.CartesianChart = Y.Base.create(\"cartesianChart\", Y.Widget, [Y.ChartBase], {"," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\"),"," tt = this.get(\"tooltip\"),"," overlay,"," overlayClass = _getClassName(\"overlay\");"," //move the position = absolute logic to a class file"," bb.setStyle(\"position\", \"absolute\");"," cb.setStyle(\"position\", \"absolute\");"," this._addAxes();"," this._addGridlines();"," this._addSeries();"," if(tt && tt.show)"," {"," this._addTooltip();"," }"," //If there is a style definition. Force them to set."," this.get(\"styles\");"," if(this.get(\"interactionType\") == \"planar\")"," {"," overlay = DOCUMENT.createElement(\"div\");"," this.get(\"contentBox\").appendChild(overlay);"," this._overlay = Y.one(overlay); "," this._overlay.set(\"id\", this.get(\"id\") + \"_overlay\");"," this._overlay.setStyle(\"position\", \"absolute\");"," this._overlay.setStyle(\"background\", \"#fff\");"," this._overlay.setStyle(\"opacity\", 0);"," this._overlay.addClass(overlayClass);"," this._overlay.setStyle(\"zIndex\", 4);"," }"," this._setAriaElements(bb, cb);"," this._redraw();"," },",""," /**"," * When `interactionType` is set to `planar`, listens for mouse move events and fires `planarEvent:mouseover` or `planarEvent:mouseout` depending on the position of the mouse in relation to "," * data points on the `Chart`."," *"," * @method _planarEventDispatcher"," * @param {Object} e Event object."," * @private"," */"," _planarEventDispatcher: function(e)"," {"," var graph = this.get(\"graph\"),"," bb = this.get(\"boundingBox\"),"," cb = graph.get(\"contentBox\"),"," isTouch = e && e.hasOwnProperty(\"changedTouches\"),"," pageX = isTouch ? e.changedTouches[0].pageX : e.pageX,"," pageY = isTouch ? e.changedTouches[0].pageY : e.pageY,"," posX = pageX - bb.getX(),"," posY = pageY - bb.getY(),"," offset = {"," x: pageX - cb.getX(),"," y: pageY - cb.getY()"," },"," sc = graph.get(\"seriesCollection\"),"," series,"," i = 0,"," index,"," oldIndex = this._selectedIndex,"," item,"," items = [],"," categoryItems = [],"," valueItems = [],"," direction = this.get(\"direction\"),"," hasMarkers,"," catAxis,"," valAxis,"," coord,"," //data columns and area data could be created on a graph level"," markerPlane,"," len,"," coords;"," e.halt(true);"," if(direction == \"horizontal\")"," {"," catAxis = \"x\";"," valAxis = \"y\";"," }"," else"," {"," valAxis = \"x\";"," catAxis = \"y\";"," }"," coord = offset[catAxis];"," if(sc)"," {"," len = sc.length;"," while(i < len && !markerPlane)"," {"," if(sc[i])"," {"," markerPlane = sc[i].get(catAxis + \"MarkerPlane\");"," }"," i++;"," }"," }"," if(markerPlane)"," {"," len = markerPlane.length;"," for(i = 0; i < len; ++i)"," {"," if(coord <= markerPlane[i].end && coord >= markerPlane[i].start)"," {"," index = i;"," break;"," }"," }"," len = sc.length;"," for(i = 0; i < len; ++i)"," {"," series = sc[i];"," coords = series.get(valAxis + \"coords\");"," hasMarkers = series.get(\"markers\");"," if(hasMarkers && !isNaN(oldIndex) && oldIndex > -1)"," {"," series.updateMarkerState(\"mouseout\", oldIndex);"," }"," if(coords && coords[index] > -1)"," {"," if(hasMarkers && !isNaN(index) && index > -1)"," {"," series.updateMarkerState(\"mouseover\", index);"," }"," item = this.getSeriesItems(series, index);"," categoryItems.push(item.category);"," valueItems.push(item.value);"," items.push(series);"," }"," "," }"," this._selectedIndex = index;",""," /**"," * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseover event."," * "," *"," * @event planarEvent:mouseover"," * @preventable false"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," * <dl>"," * <dt>categoryItem</dt><dd>An array of hashes, each containing information about the category `Axis` of each marker whose plane has been intersected.</dd>"," * <dt>valueItem</dt><dd>An array of hashes, each containing information about the value `Axis` of each marker whose plane has been intersected.</dd>"," * <dt>x</dt><dd>The x-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>y</dt><dd>The y-coordinate of the mouse in relation to the Chart.</dd>"," * <dt>pageX</dt><dd>The x location of the event on the page (including scroll)</dd>"," * <dt>pageY</dt><dd>The y location of the event on the page (including scroll)</dd>"," * <dt>items</dt><dd>An array including all the series which contain a marker whose plane has been intersected.</dd>"," * <dt>index</dt><dd>Index of the markers in their respective series.</dd>"," * <dt>originEvent</dt><dd>Underlying dom event.</dd>"," * </dl>"," */"," /**"," * Broadcasts when `interactionType` is set to `planar` and a series' marker plane has received a mouseout event."," *"," * @event planarEvent:mouseout"," * @preventable false"," * @param {EventFacade} e "," */"," if(index > -1)"," {"," this.fire(\"planarEvent:mouseover\", {"," categoryItem:categoryItems, "," valueItem:valueItems, "," x:posX, "," y:posY, "," pageX:pageX,"," pageY:pageY,"," items:items, "," index:index,"," originEvent:e"," });"," }"," else"," {"," this.fire(\"planarEvent:mouseout\");"," }"," }"," },",""," /**"," * Indicates the default series type for the chart."," *"," * @property _type"," * @type {String}"," * @private"," */"," _type: \"combo\",",""," /**"," * Queue of axes instances that will be updated. This method is used internally to determine when all axes have been updated."," *"," * @property _itemRenderQueue"," * @type Array"," * @private"," */"," _itemRenderQueue: null,",""," /**"," * Adds an `Axis` instance to the `_itemRenderQueue`."," *"," * @method _addToAxesRenderQueue"," * @param {Axis} axis An `Axis` instance."," * @private "," */"," _addToAxesRenderQueue: function(axis)"," {"," if(!this._itemRenderQueue)"," {"," this._itemRenderQueue = [];"," }"," if(Y.Array.indexOf(this._itemRenderQueue, axis) < 0)"," {"," this._itemRenderQueue.push(axis);"," }"," },",""," /**"," * Adds axis instance to the appropriate array based on position"," *"," * @method _addToAxesCollection"," * @param {String} position The position of the axis"," * @param {Axis} axis The `Axis` instance"," */"," _addToAxesCollection: function(position, axis)"," {"," var axesCollection = this.get(position + \"AxesCollection\");"," if(!axesCollection)"," {"," axesCollection = [];"," this.set(position + \"AxesCollection\", axesCollection);"," }"," axesCollection.push(axis);"," },",""," /**"," * Returns the default value for the `seriesCollection` attribute."," *"," * @method _getDefaultSeriesCollection"," * @param {Array} val Array containing either `CartesianSeries` instances or objects containing data to construct series instances."," * @return Array"," * @private"," */"," _getDefaultSeriesCollection: function()"," {"," var seriesCollection,"," dataProvider = this.get(\"dataProvider\");"," if(dataProvider)"," {"," seriesCollection = this._parseSeriesCollection();"," }"," return seriesCollection;"," },",""," /**"," * Parses and returns a series collection from an object and default properties."," *"," * @method _parseSeriesCollection"," * @param {Object} val Object contain properties for series being set."," * @return Object"," * @private"," */"," _parseSeriesCollection: function(val)"," {"," var dir = this.get(\"direction\"), "," sc = [], "," catAxis,"," valAxis,"," tempKeys = [],"," series,"," seriesKeys = this.get(\"seriesKeys\").concat(),"," i,"," index,"," l,"," type = this.get(\"type\"),"," key,"," catKey,"," seriesKey,"," graph,"," orphans = [],"," categoryKey = this.get(\"categoryKey\"),"," showMarkers = this.get(\"showMarkers\"),"," showAreaFill = this.get(\"showAreaFill\"),"," showLines = this.get(\"showLines\");"," val = val || []; "," if(dir == \"vertical\")"," {"," catAxis = \"yAxis\";"," catKey = \"yKey\";"," valAxis = \"xAxis\";"," seriesKey = \"xKey\";"," }"," else"," {"," catAxis = \"xAxis\";"," catKey = \"xKey\";"," valAxis = \"yAxis\";"," seriesKey = \"yKey\";"," }"," l = val.length;"," while(val && val.length > 0)"," {"," series = val.shift();"," key = this._getBaseAttribute(series, seriesKey);"," if(key)"," {"," index = Y.Array.indexOf(seriesKeys, key);"," if(index > -1)"," {"," seriesKeys.splice(index, 1);"," tempKeys.push(key);"," sc.push(series);"," }"," else"," {"," orphans.push(series);"," }"," }"," else"," {"," orphans.push(series);"," }"," }"," while(orphans.length > 0)"," {"," series = orphans.shift();"," if(seriesKeys.length > 0)"," {"," key = seriesKeys.shift();"," this._setBaseAttribute(series, seriesKey, key);"," tempKeys.push(key);"," sc.push(series);"," }"," else if(series instanceof Y.CartesianSeries)"," {"," series.destroy(true);"," }"," }"," if(seriesKeys.length > 0)"," {"," tempKeys = tempKeys.concat(seriesKeys);"," }"," l = tempKeys.length;"," for(i = 0; i < l; ++i)"," {"," series = sc[i] || {type:type};"," if(series instanceof Y.CartesianSeries)"," {"," this._parseSeriesAxes(series);"," continue;"," }",""," series[catKey] = series[catKey] || categoryKey;"," series[seriesKey] = series[seriesKey] || seriesKeys.shift();"," series[catAxis] = this._getCategoryAxis();"," series[valAxis] = this._getSeriesAxis(series[seriesKey]);"," "," series.type = series.type || type;"," series.direction = series.direction || dir;"," "," if((series.type == \"combo\" || series.type == \"stackedcombo\" || series.type == \"combospline\" || series.type == \"stackedcombospline\"))"," {"," if(showAreaFill !== null)"," {"," series.showAreaFill = (series.showAreaFill !== null && series.showAreaFill !== undefined) ? series.showAreaFill : showAreaFill;"," }"," if(showMarkers !== null)"," {"," series.showMarkers = (series.showMarkers !== null && series.showMarkers !== undefined) ? series.showMarkers : showMarkers;"," }"," if(showLines !== null)"," {"," series.showLines = (series.showLines !== null && series.showLines !== undefined) ? series.showLines : showLines;"," }"," }"," sc[i] = series;"," }"," if(sc)"," {"," graph = this.get(\"graph\");"," graph.set(\"seriesCollection\", sc);"," sc = graph.get(\"seriesCollection\");"," }"," return sc;"," },",""," /**"," * Parse and sets the axes for a series instance."," *"," * @method _parseSeriesAxes"," * @param {CartesianSeries} series A `CartesianSeries` instance."," * @private"," */"," _parseSeriesAxes: function(series)"," {"," var axes = this.get(\"axes\"),"," xAxis = series.get(\"xAxis\"),"," yAxis = series.get(\"yAxis\"),"," YAxis = Y.Axis,"," axis;"," if(xAxis && !(xAxis instanceof YAxis) && Y_Lang.isString(xAxis) && axes.hasOwnProperty(xAxis))"," {"," axis = axes[xAxis];"," if(axis instanceof YAxis)"," {"," series.set(\"xAxis\", axis);"," }"," }"," if(yAxis && !(yAxis instanceof YAxis) && Y_Lang.isString(yAxis) && axes.hasOwnProperty(yAxis))"," { "," axis = axes[yAxis];"," if(axis instanceof YAxis)"," {"," series.set(\"yAxis\", axis);"," }"," }",""," },",""," /**"," * Returns the category axis instance for the chart."," *"," * @method _getCategoryAxis"," * @return Axis"," * @private"," */"," _getCategoryAxis: function()"," {"," var axis,"," axes = this.get(\"axes\"),"," categoryAxisName = this.get(\"categoryAxisName\") || this.get(\"categoryKey\");"," axis = axes[categoryAxisName];"," return axis;"," },",""," /**"," * Returns the value axis for a series."," *"," * @method _getSeriesAxis"," * @param {String} key The key value used to determine the axis instance."," * @return Axis"," * @private"," */"," _getSeriesAxis:function(key, axisName)"," {"," var axes = this.get(\"axes\"),"," i,"," keys,"," axis;"," if(axes)"," {"," if(axisName && axes.hasOwnProperty(axisName))"," {"," axis = axes[axisName];"," }"," else"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," keys = axes[i].get(\"keys\");"," if(keys && keys.hasOwnProperty(key))"," {"," axis = axes[i];"," break;"," }"," }"," }"," }"," }"," return axis;"," },",""," /**"," * Gets an attribute from an object, using a getter for Base objects and a property for object"," * literals. Used for determining attributes from series/axis references which can be an actual class instance"," * or a hash of properties that will be used to create a class instance."," *"," * @method _getBaseAttribute"," * @param {Object} item Object or instance in which the attribute resides."," * @param {String} key Attribute whose value will be returned."," * @return Object"," * @private"," */"," _getBaseAttribute: function(item, key)"," {"," if(item instanceof Y.Base)"," {"," return item.get(key);"," }"," if(item.hasOwnProperty(key))"," {"," return item[key];"," }"," return null;"," },",""," /**"," * Sets an attribute on an object, using a setter of Base objects and a property for object"," * literals. Used for setting attributes on a Base class, either directly or to be stored in an object literal"," * for use at instantiation."," *"," * @method _setBaseAttribute"," * @param {Object} item Object or instance in which the attribute resides."," * @param {String} key Attribute whose value will be assigned."," * @param {Object} value Value to be assigned to the attribute."," * @private"," */"," _setBaseAttribute: function(item, key, value)"," {"," if(item instanceof Y.Base)"," {"," item.set(key, value);"," }"," else"," {"," item[key] = value;"," }"," },",""," /**"," * Creates `Axis` instances."," *"," * @method _setAxes"," * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances."," * @return Object"," * @private"," */"," _setAxes: function(val)"," {"," var hash = this._parseAxes(val),"," axes = {},"," axesAttrs = {"," edgeOffset: \"edgeOffset\", "," position: \"position\","," overlapGraph:\"overlapGraph\","," labelFunction:\"labelFunction\","," labelFunctionScope:\"labelFunctionScope\","," labelFormat:\"labelFormat\","," appendLabelFunction: \"appendLabelFunction\","," appendTitleFunction: \"appendTitleFunction\","," maximum:\"maximum\","," minimum:\"minimum\", "," roundingMethod:\"roundingMethod\","," alwaysShowZero:\"alwaysShowZero\","," title:\"title\","," width:\"width\","," height:\"height\""," },"," dp = this.get(\"dataProvider\"),"," ai,"," i, "," pos, "," axis,"," axisPosition,"," dh, "," axisClass, "," config,"," axesCollection;"," for(i in hash)"," {"," if(hash.hasOwnProperty(i))"," {"," dh = hash[i];"," if(dh instanceof Y.Axis)"," {"," axis = dh;"," }"," else"," {"," axis = null;"," config = {};"," config.dataProvider = dh.dataProvider || dp;"," config.keys = dh.keys;"," "," if(dh.hasOwnProperty(\"roundingUnit\"))"," {"," config.roundingUnit = dh.roundingUnit;"," }"," pos = dh.position;"," if(dh.styles)"," {"," config.styles = dh.styles;"," }"," config.position = dh.position;"," for(ai in axesAttrs)"," {"," if(axesAttrs.hasOwnProperty(ai) && dh.hasOwnProperty(ai))"," {"," config[ai] = dh[ai];"," }"," }"," "," //only check for existing axis if we constructed the default axes already"," if(val)"," {"," axis = this.getAxisByKey(i);"," }"," "," if(axis && axis instanceof Y.Axis)"," {"," axisPosition = axis.get(\"position\");"," if(pos != axisPosition)"," {"," if(axisPosition != \"none\")"," {"," axesCollection = this.get(axisPosition + \"AxesCollection\");"," axesCollection.splice(Y.Array.indexOf(axesCollection, axis), 1);"," }"," if(pos != \"none\")"," {"," this._addToAxesCollection(pos, axis);"," }"," }"," axis.setAttrs(config);"," }"," else"," {"," axisClass = this._getAxisClass(dh.type);"," axis = new axisClass(config);"," axis.after(\"axisRendered\", Y.bind(this._itemRendered, this));"," }"," }",""," if(axis)"," {"," axesCollection = this.get(pos + \"AxesCollection\");"," if(axesCollection && Y.Array.indexOf(axesCollection, axis) > 0)"," {"," axis.set(\"overlapGraph\", false);"," }"," axes[i] = axis;"," }"," }"," }"," return axes;"," },"," "," /**"," * Adds axes to the chart."," *"," * @method _addAxes"," * @private"," */"," _addAxes: function()"," {"," var axes = this.get(\"axes\"),"," i, "," axis, "," pos,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," node = Y.Node.one(this._parentNode);"," if(!this._axesCollection)"," { "," this._axesCollection = [];"," }"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," if(axis instanceof Y.Axis)"," {"," if(!w)"," {"," this.set(\"width\", node.get(\"offsetWidth\"));"," w = this.get(\"width\");"," }"," if(!h)"," {"," this.set(\"height\", node.get(\"offsetHeight\"));"," h = this.get(\"height\");"," }"," this._addToAxesRenderQueue(axis);"," pos = axis.get(\"position\");"," if(!this.get(pos + \"AxesCollection\"))"," {"," this.set(pos + \"AxesCollection\", [axis]);"," }"," else"," {"," this.get(pos + \"AxesCollection\").push(axis);"," }"," this._axesCollection.push(axis);"," if(axis.get(\"keys\").hasOwnProperty(this.get(\"categoryKey\")))"," {"," this.set(\"categoryAxis\", axis);"," }"," axis.render(this.get(\"contentBox\"));"," }"," }"," }"," },",""," /**"," * Renders the Graph."," *"," * @method _addSeries"," * @private"," */"," _addSeries: function()"," {"," var graph = this.get(\"graph\"),"," sc = this.get(\"seriesCollection\");"," graph.render(this.get(\"contentBox\"));",""," },",""," /**"," * Adds gridlines to the chart."," *"," * @method _addGridlines"," * @private"," */"," _addGridlines: function()"," {"," var graph = this.get(\"graph\"),"," hgl = this.get(\"horizontalGridlines\"),"," vgl = this.get(\"verticalGridlines\"),"," direction = this.get(\"direction\"),"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," seriesAxesCollection,"," catAxis = this.get(\"categoryAxis\"),"," hAxis,"," vAxis;"," if(this._axesCollection)"," {"," seriesAxesCollection = this._axesCollection.concat();"," seriesAxesCollection.splice(Y.Array.indexOf(seriesAxesCollection, catAxis), 1);"," }"," if(hgl)"," {"," if(leftAxesCollection && leftAxesCollection[0])"," {"," hAxis = leftAxesCollection[0];"," }"," else if(rightAxesCollection && rightAxesCollection[0])"," {"," hAxis = rightAxesCollection[0];"," }"," else "," {"," hAxis = direction == \"horizontal\" ? catAxis : seriesAxesCollection[0];"," }"," if(!this._getBaseAttribute(hgl, \"axis\") && hAxis)"," {"," this._setBaseAttribute(hgl, \"axis\", hAxis);"," }"," if(this._getBaseAttribute(hgl, \"axis\"))"," {"," graph.set(\"horizontalGridlines\", hgl);"," }"," }"," if(vgl)"," {"," if(bottomAxesCollection && bottomAxesCollection[0])"," {"," vAxis = bottomAxesCollection[0];"," }"," else if (topAxesCollection && topAxesCollection[0])"," {"," vAxis = topAxesCollection[0];"," }"," else "," {"," vAxis = direction == \"vertical\" ? catAxis : seriesAxesCollection[0];"," }"," if(!this._getBaseAttribute(vgl, \"axis\") && vAxis)"," {"," this._setBaseAttribute(vgl, \"axis\", vAxis);"," }"," if(this._getBaseAttribute(vgl, \"axis\"))"," {"," graph.set(\"verticalGridlines\", vgl);"," }"," }"," },"," "," /**"," * Default Function for the axes attribute."," *"," * @method _getDefaultAxes"," * @return Object"," * @private"," */"," _getDefaultAxes: function()"," {"," var axes;"," if(this.get(\"dataProvider\"))"," {"," axes = this._parseAxes();"," }"," return axes;"," },",""," /**"," * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances."," *"," * @method _parseAxes"," * @param {Object} axes Object containing `Axis` instances or `Axis` attributes."," * @return Object"," * @private"," */"," _parseAxes: function(axes)"," {"," var catKey = this.get(\"categoryKey\"),"," axis,"," attr,"," keys,"," newAxes = {},"," claimedKeys = [],"," categoryAxisName = this.get(\"categoryAxisName\") || this.get(\"categoryKey\"),"," valueAxisName = this.get(\"valueAxisName\"),"," seriesKeys = this.get(\"seriesKeys\").concat(),"," i, "," l,"," ii,"," ll,"," cIndex,"," direction = this.get(\"direction\"),"," seriesPosition,"," categoryPosition,"," valueAxes = [],"," seriesAxis = this.get(\"stacked\") ? \"stacked\" : \"numeric\";"," if(direction == \"vertical\")"," {"," seriesPosition = \"bottom\";"," categoryPosition = \"left\";"," }"," else"," {"," seriesPosition = \"left\";"," categoryPosition = \"bottom\";"," }"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," keys = this._getBaseAttribute(axis, \"keys\");"," attr = this._getBaseAttribute(axis, \"type\");"," if(attr == \"time\" || attr == \"category\")"," {"," categoryAxisName = i;"," this.set(\"categoryAxisName\", i);"," if(Y_Lang.isArray(keys) && keys.length > 0)"," {"," catKey = keys[0];"," this.set(\"categoryKey\", catKey);"," }"," newAxes[i] = axis;"," }"," else if(i == categoryAxisName)"," {"," newAxes[i] = axis;"," }"," else "," {"," newAxes[i] = axis;"," if(i != valueAxisName && keys && Y_Lang.isArray(keys))"," {"," ll = keys.length;"," for(ii = 0; ii < ll; ++ii)"," {"," claimedKeys.push(keys[ii]);"," }"," valueAxes.push(newAxes[i]);"," }"," if(!(this._getBaseAttribute(newAxes[i], \"type\")))"," {"," this._setBaseAttribute(newAxes[i], \"type\", seriesAxis);"," }"," if(!(this._getBaseAttribute(newAxes[i], \"position\")))"," {"," this._setBaseAttribute(newAxes[i], \"position\", this._getDefaultAxisPosition(newAxes[i], valueAxes, seriesPosition));"," }"," }"," }"," }"," }"," cIndex = Y.Array.indexOf(seriesKeys, catKey);"," if(cIndex > -1)"," {"," seriesKeys.splice(cIndex, 1);"," }"," l = claimedKeys.length;"," for(i = 0; i < l; ++i)"," {"," cIndex = Y.Array.indexOf(seriesKeys, claimedKeys[i]); "," if(cIndex > -1)"," {"," seriesKeys.splice(cIndex, 1);"," }"," }"," if(!newAxes.hasOwnProperty(categoryAxisName))"," {"," newAxes[categoryAxisName] = {};"," }"," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"keys\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"keys\", [catKey]);"," }"," "," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"position\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"position\", categoryPosition);"," }"," "," if(!(this._getBaseAttribute(newAxes[categoryAxisName], \"type\")))"," {"," this._setBaseAttribute(newAxes[categoryAxisName], \"type\", this.get(\"categoryType\"));"," }"," if(!newAxes.hasOwnProperty(valueAxisName) && seriesKeys && seriesKeys.length > 0)"," {"," newAxes[valueAxisName] = {keys:seriesKeys};"," valueAxes.push(newAxes[valueAxisName]);"," }"," if(claimedKeys.length > 0)"," {"," if(seriesKeys.length > 0)"," {"," seriesKeys = claimedKeys.concat(seriesKeys);"," }"," else"," {"," seriesKeys = claimedKeys;"," }"," }"," if(newAxes.hasOwnProperty(valueAxisName))"," {"," if(!(this._getBaseAttribute(newAxes[valueAxisName], \"position\")))"," {"," this._setBaseAttribute(newAxes[valueAxisName], \"position\", this._getDefaultAxisPosition(newAxes[valueAxisName], valueAxes, seriesPosition));"," }"," this._setBaseAttribute(newAxes[valueAxisName], \"type\", seriesAxis);"," this._setBaseAttribute(newAxes[valueAxisName], \"keys\", seriesKeys);"," } "," if(!this._seriesKeysExplicitlySet)"," {"," this._seriesKeys = seriesKeys;"," }"," return newAxes;"," },",""," /**"," * Determines the position of an axis when one is not specified."," *"," * @method _getDefaultAxisPosition"," * @param {Axis} axis `Axis` instance."," * @param {Array} valueAxes Array of `Axis` instances."," * @param {String} position Default position depending on the direction of the chart and type of axis."," * @return String"," * @private"," */"," _getDefaultAxisPosition: function(axis, valueAxes, position)"," {"," var direction = this.get(\"direction\"),"," i = Y.Array.indexOf(valueAxes, axis);"," "," if(valueAxes[i - 1] && valueAxes[i - 1].position)"," {"," if(direction == \"horizontal\")"," {"," if(valueAxes[i - 1].position == \"left\")"," {"," position = \"right\";"," }"," else if(valueAxes[i - 1].position == \"right\")"," {"," position = \"left\";"," }"," }"," else"," {"," if (valueAxes[i -1].position == \"bottom\")"," {"," position = \"top\";"," } "," else"," {"," position = \"bottom\";"," }"," }"," }"," return position;"," },",""," "," /**"," * Returns an object literal containing a categoryItem and a valueItem for a given series index. Below is the structure of each:"," * "," * @method getSeriesItems"," * @param {CartesianSeries} series Reference to a series."," * @param {Number} index Index of the specified item within a series."," * @return Object An object literal containing the following:"," *"," * <dl>"," * <dt>categoryItem</dt><dd>Object containing the following data related to the category axis of the series."," * <dl>"," * <dt>axis</dt><dd>Reference to the category axis of the series.</dd>"," * <dt>key</dt><dd>Category key for the series.</dd>"," * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>"," * </dl>"," * </dd>"," * <dt>valueItem</dt><dd>Object containing the following data related to the category axis of the series."," * <dl>"," * <dt>axis</dt><dd>Reference to the value axis of the series.</dd>"," * <dt>key</dt><dd>Value key for the series.</dd>"," * <dt>value</dt><dd>Value on the axis corresponding to the series index.</dd>"," * </dl>"," * </dd>"," * </dl>"," */"," getSeriesItems: function(series, index)"," {"," var xAxis = series.get(\"xAxis\"),"," yAxis = series.get(\"yAxis\"),"," xKey = series.get(\"xKey\"),"," yKey = series.get(\"yKey\"),"," categoryItem,"," valueItem;"," if(this.get(\"direction\") == \"vertical\")"," {"," categoryItem = {"," axis:yAxis,"," key:yKey,"," value:yAxis.getKeyValueAt(yKey, index)"," };"," valueItem = {"," axis:xAxis,"," key:xKey,"," value: xAxis.getKeyValueAt(xKey, index)"," };"," }"," else"," {"," valueItem = {"," axis:yAxis,"," key:yKey,"," value:yAxis.getKeyValueAt(yKey, index)"," };"," categoryItem = {"," axis:xAxis,"," key:xKey,"," value: xAxis.getKeyValueAt(xKey, index)"," };"," }"," categoryItem.displayName = series.get(\"categoryDisplayName\");"," valueItem.displayName = series.get(\"valueDisplayName\");"," categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);"," valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);"," return {category:categoryItem, value:valueItem};"," },",""," /**"," * Handler for sizeChanged event."," *"," * @method _sizeChanged"," * @param {Object} e Event object."," * @private"," */"," _sizeChanged: function(e)"," {"," if(this._axesCollection)"," {"," var ac = this._axesCollection,"," i = 0,"," l = ac.length;"," for(; i < l; ++i)"," {"," this._addToAxesRenderQueue(ac[i]);"," }"," this._redraw();"," }"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the top bounds of all vertical axes."," *"," * @method _getTopOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getTopOverflow: function(set1, set2, height)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, Math.abs(axis.getMaxLabelBounds().top) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the right bounds of all horizontal axes."," *"," * @method _getRightOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getRightOverflow: function(set1, set2, width)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, axis.getMaxLabelBounds().right - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the left bounds of all horizontal axes."," *"," * @method _getLeftOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} width Width of the axes"," * @return Number"," * @private"," */"," _getLeftOverflow: function(set1, set2, width)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, Math.abs(axis.getMinLabelBounds().left) - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, width) * 0.5));"," }"," }"," return overflow;"," },"," "," /**"," * Returns the maximum distance in pixels that the extends outside the bottom bounds of all vertical axes."," *"," * @method _getBottomOverflow"," * @param {Array} set1 Collection of axes to check."," * @param {Array} set2 Seconf collection of axes to check."," * @param {Number} height Height of the axes"," * @return Number"," * @private"," */"," _getBottomOverflow: function(set1, set2, height)"," {"," var i = 0,"," len,"," overflow = 0,"," axis;"," if(set1)"," {"," len = set1.length;"," for(; i < len; ++i)"," {"," axis = set1[i];"," overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," if(set2)"," {"," i = 0;"," len = set2.length;"," for(; i < len; ++i)"," {"," axis = set2[i];"," overflow = Math.max(overflow, axis.getMinLabelBounds().bottom - (axis.getEdgeOffset(axis.get(\"styles\").majorTicks.count, height) * 0.5));"," }"," }"," return overflow;"," },",""," /**"," * Redraws and position all the components of the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," leftPaneWidth = 0,"," rightPaneWidth = 0,"," topPaneHeight = 0,"," bottomPaneHeight = 0,"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," i = 0,"," l,"," axis,"," graphOverflow = \"visible\","," graph = this.get(\"graph\"),"," topOverflow,"," bottomOverflow,"," leftOverflow,"," rightOverflow,"," graphWidth,"," graphHeight,"," graphX,"," graphY,"," allowContentOverflow = this.get(\"allowContentOverflow\"),"," diff,"," rightAxesXCoords,"," leftAxesXCoords,"," topAxesYCoords,"," bottomAxesYCoords,"," graphRect = {};"," if(leftAxesCollection)"," {"," leftAxesXCoords = [];"," l = leftAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," leftAxesXCoords.unshift(leftPaneWidth);"," leftPaneWidth += leftAxesCollection[i].get(\"width\");"," }"," }"," if(rightAxesCollection)"," {"," rightAxesXCoords = [];"," l = rightAxesCollection.length;"," i = 0;"," for(i = l - 1; i > -1; --i)"," {"," rightPaneWidth += rightAxesCollection[i].get(\"width\");"," rightAxesXCoords.unshift(w - rightPaneWidth);"," }"," }"," if(topAxesCollection)"," {"," topAxesYCoords = [];"," l = topAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," topAxesYCoords.unshift(topPaneHeight);"," topPaneHeight += topAxesCollection[i].get(\"height\");"," }"," }"," if(bottomAxesCollection)"," {"," bottomAxesYCoords = [];"," l = bottomAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," bottomPaneHeight += bottomAxesCollection[i].get(\"height\");"," bottomAxesYCoords.unshift(h - bottomPaneHeight);"," }"," }"," "," graphWidth = w - (leftPaneWidth + rightPaneWidth);"," graphHeight = h - (bottomPaneHeight + topPaneHeight);"," graphRect.left = leftPaneWidth;"," graphRect.top = topPaneHeight;"," graphRect.bottom = h - bottomPaneHeight;"," graphRect.right = w - rightPaneWidth;"," if(!allowContentOverflow)"," {"," topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);"," bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);"," leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);"," rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);"," "," diff = topOverflow - topPaneHeight;"," if(diff > 0)"," {"," graphRect.top = topOverflow;"," if(topAxesYCoords)"," {"," i = 0;"," l = topAxesYCoords.length;"," for(; i < l; ++i)"," {"," topAxesYCoords[i] += diff;"," }"," }"," }",""," diff = bottomOverflow - bottomPaneHeight;"," if(diff > 0)"," {"," graphRect.bottom = h - bottomOverflow;"," if(bottomAxesYCoords)"," {"," i = 0;"," l = bottomAxesYCoords.length;"," for(; i < l; ++i)"," {"," bottomAxesYCoords[i] -= diff;"," }"," }"," }",""," diff = leftOverflow - leftPaneWidth;"," if(diff > 0)"," {"," graphRect.left = leftOverflow;"," if(leftAxesXCoords)"," {"," i = 0;"," l = leftAxesXCoords.length;"," for(; i < l; ++i)"," {"," leftAxesXCoords[i] += diff;"," }"," }"," }",""," diff = rightOverflow - rightPaneWidth;"," if(diff > 0)"," {"," graphRect.right = w - rightOverflow;"," if(rightAxesXCoords)"," {"," i = 0;"," l = rightAxesXCoords.length;"," for(; i < l; ++i)"," {"," rightAxesXCoords[i] -= diff;"," }"," }"," }"," }"," graphWidth = graphRect.right - graphRect.left;"," graphHeight = graphRect.bottom - graphRect.top;"," graphX = graphRect.left;"," graphY = graphRect.top;"," if(topAxesCollection)"," {"," l = topAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = topAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," axis.get(\"boundingBox\").setStyle(\"top\", topAxesYCoords[i] + \"px\");"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(bottomAxesCollection)"," {"," l = bottomAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = bottomAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," axis.get(\"boundingBox\").setStyle(\"top\", bottomAxesYCoords[i] + \"px\");"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(leftAxesCollection)"," {"," l = leftAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = leftAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," axis.get(\"boundingBox\").setStyle(\"left\", leftAxesXCoords[i] + \"px\");"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(rightAxesCollection)"," {"," l = rightAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = rightAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," axis.get(\"boundingBox\").setStyle(\"left\", rightAxesXCoords[i] + \"px\");"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.get(\"boundingBox\").setStyle(\"left\", graphX + \"px\");"," graph.get(\"boundingBox\").setStyle(\"top\", graphY + \"px\");"," graph.set(\"width\", graphWidth);"," graph.set(\"height\", graphHeight);"," graph.get(\"boundingBox\").setStyle(\"overflow\", graphOverflow);"," }",""," if(this._overlay)"," {"," this._overlay.setStyle(\"left\", graphX + \"px\");"," this._overlay.setStyle(\"top\", graphY + \"px\");"," this._overlay.setStyle(\"width\", graphWidth + \"px\");"," this._overlay.setStyle(\"height\", graphHeight + \"px\");"," }"," },",""," /**"," * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series and the Graph instance."," * Removes the tooltip and overlay HTML elements."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var graph = this.get(\"graph\"),"," i = 0,"," len,"," seriesCollection = this.get(\"seriesCollection\"),"," axesCollection = this._axesCollection,"," tooltip = this.get(\"tooltip\").node;"," if(this._description)"," {"," this._description.empty();"," this._description.remove(true);"," }"," if(this._liveRegion)"," {"," this._liveRegion.empty();"," this._liveRegion.remove(true);"," }"," len = seriesCollection ? seriesCollection.length : 0;"," for(; i < len; ++i)"," {"," if(seriesCollection[i] instanceof Y.CartesianSeries)"," {"," seriesCollection[i].destroy(true);"," }"," }"," len = axesCollection ? axesCollection.length : 0;"," for(i = 0; i < len; ++i)"," {"," if(axesCollection[i] instanceof Y.Axis)"," {"," axesCollection[i].destroy(true);"," }"," }"," if(graph)"," {"," graph.destroy(true);"," }"," if(tooltip)"," {"," tooltip.empty();"," tooltip.remove(true);"," }"," if(this._overlay)"," {"," this._overlay.empty();"," this._overlay.remove(true);"," }"," },",""," /**"," * Returns the appropriate message based on the key press."," *"," * @method _getAriaMessage"," * @param {Number} key The keycode that was pressed."," * @return String"," */"," _getAriaMessage: function(key)"," {"," var msg = \"\","," series,"," items,"," categoryItem,"," valueItem,"," seriesIndex = this._seriesIndex,"," itemIndex = this._itemIndex,"," seriesCollection = this.get(\"seriesCollection\"),"," len = seriesCollection.length,"," dataLength;"," if(key % 2 === 0)"," {"," if(len > 1)"," {"," if(key === 38)"," {"," seriesIndex = seriesIndex < 1 ? len - 1 : seriesIndex - 1;"," }"," else if(key === 40)"," {"," seriesIndex = seriesIndex >= len - 1 ? 0 : seriesIndex + 1;"," }"," this._itemIndex = -1;"," }"," else"," {"," seriesIndex = 0;"," }"," this._seriesIndex = seriesIndex;"," series = this.getSeries(parseInt(seriesIndex, 10));"," msg = series.get(\"valueDisplayName\") + \" series.\";"," }"," else"," {"," if(seriesIndex > -1)"," {"," msg = \"\";"," series = this.getSeries(parseInt(seriesIndex, 10));"," }"," else"," {"," seriesIndex = 0;"," this._seriesIndex = seriesIndex;"," series = this.getSeries(parseInt(seriesIndex, 10));"," msg = series.get(\"valueDisplayName\") + \" series.\";"," }"," dataLength = series._dataLength ? series._dataLength : 0;"," if(key === 37)"," {"," itemIndex = itemIndex > 0 ? itemIndex - 1 : dataLength - 1;"," }"," else if(key === 39)"," {"," itemIndex = itemIndex >= dataLength - 1 ? 0 : itemIndex + 1;"," }"," this._itemIndex = itemIndex;"," items = this.getSeriesItems(series, itemIndex);"," categoryItem = items.category;"," valueItem = items.value;"," if(categoryItem && valueItem && categoryItem.value && valueItem.value)"," {"," msg += categoryItem.displayName + \": \" + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]) + \", \";"," msg += valueItem.displayName + \": \" + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]) + \", \"; "," }"," else"," {"," msg += \"No data available.\";"," }"," msg += (itemIndex + 1) + \" of \" + dataLength + \". \";"," }"," return msg;"," }","}, {"," ATTRS: {"," /**"," * Indicates whether axis labels are allowed to overflow beyond the bounds of the chart's content box."," *"," * @attribute allowContentOverflow"," * @type Boolean"," */"," allowContentOverflow: {"," value: false"," },",""," /**"," * Style object for the axes."," *"," * @attribute axesStyles"," * @type Object"," * @private"," */"," axesStyles: {"," getter: function()"," {"," var axes = this.get(\"axes\"),"," i,"," styles = this._axesStyles;"," if(axes)"," {"," for(i in axes)"," {"," if(axes.hasOwnProperty(i) && axes[i] instanceof Y.Axis)"," {"," if(!styles)"," {"," styles = {};"," }"," styles[i] = axes[i].get(\"styles\");"," }"," }"," }"," return styles;"," },"," "," setter: function(val)"," {"," var axes = this.get(\"axes\"),"," i;"," for(i in val)"," {"," if(val.hasOwnProperty(i) && axes.hasOwnProperty(i))"," {"," this._setBaseAttribute(axes[i], \"styles\", val[i]);"," }"," }"," }"," },",""," /**"," * Style object for the series"," *"," * @attribute seriesStyles"," * @type Object"," * @private"," */"," seriesStyles: {"," getter: function()"," {"," var styles = this._seriesStyles,"," graph = this.get(\"graph\"),"," dict,"," i;"," if(graph)"," {"," dict = graph.get(\"seriesDictionary\");"," if(dict)"," {"," styles = {};"," for(i in dict)"," {"," if(dict.hasOwnProperty(i))"," {"," styles[i] = dict[i].get(\"styles\");"," }"," }"," }"," }"," return styles;"," },"," "," setter: function(val)"," {"," var i,"," l,"," s;"," "," if(Y_Lang.isArray(val))"," {"," s = this.get(\"seriesCollection\");"," i = 0;"," l = val.length;",""," for(; i < l; ++i)"," {"," this._setBaseAttribute(s[i], \"styles\", val[i]);"," }"," }"," else"," {"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," {"," s = this.getSeries(i);"," this._setBaseAttribute(s, \"styles\", val[i]);"," }"," }"," }"," }"," },",""," /**"," * Styles for the graph."," *"," * @attribute graphStyles"," * @type Object"," * @private"," */"," graphStyles: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return(graph.get(\"styles\"));"," }"," return this._graphStyles;"," },",""," setter: function(val)"," {"," var graph = this.get(\"graph\");"," this._setBaseAttribute(graph, \"styles\", val);"," }",""," },",""," /**"," * Style properties for the chart. Contains a key indexed hash of the following:"," * <dl>"," * <dt>series</dt><dd>A key indexed hash containing references to the `styles` attribute for each series in the chart."," * Specific style attributes vary depending on the series:"," * <ul>"," * <li><a href=\"AreaSeries.html#attr_styles\">AreaSeries</a></li>"," * <li><a href=\"BarSeries.html#attr_styles\">BarSeries</a></li>"," * <li><a href=\"ColumnSeries.html#attr_styles\">ColumnSeries</a></li>"," * <li><a href=\"ComboSeries.html#attr_styles\">ComboSeries</a></li>"," * <li><a href=\"LineSeries.html#attr_styles\">LineSeries</a></li>"," * <li><a href=\"MarkerSeries.html#attr_styles\">MarkerSeries</a></li>"," * <li><a href=\"SplineSeries.html#attr_styles\">SplineSeries</a></li>"," * </ul>"," * </dd>"," * <dt>axes</dt><dd>A key indexed hash containing references to the `styles` attribute for each axes in the chart. Specific"," * style attributes can be found in the <a href=\"Axis.html#attr_styles\">Axis</a> class.</dd>"," * <dt>graph</dt><dd>A reference to the `styles` attribute in the chart. Specific style attributes can be found in the"," * <a href=\"Graph.html#attr_styles\">Graph</a> class.</dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," styles: {"," getter: function()"," {"," var styles = { "," axes: this.get(\"axesStyles\"),"," series: this.get(\"seriesStyles\"),"," graph: this.get(\"graphStyles\")"," };"," return styles;"," },"," setter: function(val)"," {"," if(val.hasOwnProperty(\"axes\"))"," {"," if(this.get(\"axesStyles\"))"," {"," this.set(\"axesStyles\", val.axes);"," }"," else"," {"," this._axesStyles = val.axes;"," }"," }"," if(val.hasOwnProperty(\"series\"))"," {"," if(this.get(\"seriesStyles\"))"," {"," this.set(\"seriesStyles\", val.series);"," }"," else"," {"," this._seriesStyles = val.series;"," }"," }"," if(val.hasOwnProperty(\"graph\"))"," {"," this.set(\"graphStyles\", val.graph);"," }"," }"," },",""," /**"," * Axes to appear in the chart. This can be a key indexed hash of axis instances or object literals"," * used to construct the appropriate axes."," *"," * @attribute axes"," * @type Object"," */"," axes: {"," valueFn: \"_getDefaultAxes\",",""," setter: function(val)"," {"," if(this.get(\"dataProvider\"))"," {"," val = this._setAxes(val);"," }"," return val;"," }"," },",""," /**"," * Collection of series to appear on the chart. This can be an array of Series instances or object literals"," * used to construct the appropriate series."," *"," * @attribute seriesCollection"," * @type Array"," */"," seriesCollection: {"," valueFn: \"_getDefaultSeriesCollection\","," "," setter: function(val)"," {"," if(this.get(\"dataProvider\"))"," {"," val = this._parseSeriesCollection(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the left-aligned axes for the chart."," *"," * @attribute leftAxesCollection"," * @type Array"," * @private"," */"," leftAxesCollection: {},",""," /**"," * Reference to the bottom-aligned axes for the chart."," *"," * @attribute bottomAxesCollection"," * @type Array"," * @private"," */"," bottomAxesCollection: {},",""," /**"," * Reference to the right-aligned axes for the chart."," *"," * @attribute rightAxesCollection"," * @type Array"," * @private"," */"," rightAxesCollection: {},",""," /**"," * Reference to the top-aligned axes for the chart."," *"," * @attribute topAxesCollection"," * @type Array"," * @private"," */"," topAxesCollection: {},"," "," /**"," * Indicates whether or not the chart is stacked."," *"," * @attribute stacked"," * @type Boolean"," */"," stacked: {"," value: false"," },",""," /**"," * Direction of chart's category axis when there is no series collection specified. Charts can"," * be horizontal or vertical. When the chart type is column, the chart is horizontal."," * When the chart type is bar, the chart is vertical. "," *"," * @attribute direction"," * @type String"," */"," direction: {"," getter: function()"," {"," var type = this.get(\"type\");"," if(type == \"bar\")"," { "," return \"vertical\";"," }"," else if(type == \"column\")"," {"," return \"horizontal\";"," }"," return this._direction;"," },",""," setter: function(val)"," {"," this._direction = val;"," return this._direction;"," }"," },",""," /**"," * Indicates whether or not an area is filled in a combo chart."," * "," * @attribute showAreaFill"," * @type Boolean"," */"," showAreaFill: {},",""," /**"," * Indicates whether to display markers in a combo chart."," *"," * @attribute showMarkers"," * @type Boolean"," */"," showMarkers:{},",""," /**"," * Indicates whether to display lines in a combo chart."," *"," * @attribute showLines"," * @type Boolean"," */"," showLines:{},",""," /**"," * Indicates the key value used to identify a category axis in the `axes` hash. If"," * not specified, the categoryKey attribute value will be used."," * "," * @attribute categoryAxisName"," * @type String"," */"," categoryAxisName: {"," },",""," /**"," * Indicates the key value used to identify a the series axis when an axis not generated."," *"," * @attribute valueAxisName"," * @type String"," */"," valueAxisName: {"," value: \"values\""," },",""," /**"," * Reference to the horizontalGridlines for the chart."," *"," * @attribute horizontalGridlines"," * @type Gridlines"," */"," horizontalGridlines: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return graph.get(\"horizontalGridlines\");"," }"," return this._horizontalGridlines;"," },"," setter: function(val)"," {"," var graph = this.get(\"graph\");"," if(val && !Y_Lang.isObject(val))"," {"," val = {};"," }"," if(graph)"," {"," graph.set(\"horizontalGridlines\", val);"," }"," else"," {"," this._horizontalGridlines = val;"," }"," }"," },",""," /**"," * Reference to the verticalGridlines for the chart."," *"," * @attribute verticalGridlines"," * @type Gridlines"," */"," verticalGridlines: {"," getter: function()"," {"," var graph = this.get(\"graph\");"," if(graph)"," {"," return graph.get(\"verticalGridlines\");"," }"," return this._verticalGridlines;"," },"," setter: function(val)"," {"," var graph = this.get(\"graph\");"," if(val && !Y_Lang.isObject(val))"," {"," val = {};"," }"," if(graph)"," {"," graph.set(\"verticalGridlines\", val);"," }"," else"," {"," this._verticalGridlines = val;"," }"," }"," },"," "," /**"," * Type of chart when there is no series collection specified."," *"," * @attribute type"," * @type String "," */"," type: {"," getter: function()"," {"," if(this.get(\"stacked\"))"," {"," return \"stacked\" + this._type;"," }"," return this._type;"," },",""," setter: function(val)"," {"," if(this._type == \"bar\")"," {"," if(val != \"bar\")"," {"," this.set(\"direction\", \"horizontal\");"," }"," }"," else"," {"," if(val == \"bar\")"," {"," this.set(\"direction\", \"vertical\");"," }"," }"," this._type = val;"," return this._type;"," }"," },"," "," /**"," * Reference to the category axis used by the chart."," *"," * @attribute categoryAxis"," * @type Axis"," */"," categoryAxis:{}"," }","});","/**"," * The PieChart class creates a pie chart"," *"," * @module charts"," * @submodule charts-base"," * @class PieChart"," * @extends ChartBase"," * @constructor"," */","Y.PieChart = Y.Base.create(\"pieChart\", Y.Widget, [Y.ChartBase], {"," /**"," * Calculates and returns a `seriesCollection`."," *"," * @method _getSeriesCollection"," * @return Array"," * @private"," */"," _getSeriesCollection: function()"," {"," if(this._seriesCollection)"," {"," return this._seriesCollection;"," }"," var axes = this.get(\"axes\"),"," sc = [], "," seriesKeys,"," i = 0,"," l,"," type = this.get(\"type\"),"," key,"," catAxis = \"categoryAxis\","," catKey = \"categoryKey\","," valAxis = \"valueAxis\","," seriesKey = \"valueKey\";"," if(axes)"," {"," seriesKeys = axes.values.get(\"keyCollection\");"," key = axes.category.get(\"keyCollection\")[0];"," l = seriesKeys.length;"," for(; i < l; ++i)"," {"," sc[i] = {type:type};"," sc[i][catAxis] = \"category\";"," sc[i][valAxis] = \"values\";"," sc[i][catKey] = key;"," sc[i][seriesKey] = seriesKeys[i];"," }"," }"," this._seriesCollection = sc;"," return sc;"," },",""," /**"," * Creates `Axis` instances."," *"," * @method _parseAxes"," * @param {Object} val Object containing `Axis` instances or objects in which to construct `Axis` instances."," * @return Object"," * @private"," */"," _parseAxes: function(hash)"," {"," if(!this._axes)"," {"," this._axes = {};"," }"," var i, pos, axis, dh, config, axisClass,"," type = this.get(\"type\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," node = Y.Node.one(this._parentNode);"," if(!w)"," {"," this.set(\"width\", node.get(\"offsetWidth\"));"," w = this.get(\"width\");"," }"," if(!h)"," {"," this.set(\"height\", node.get(\"offsetHeight\"));"," h = this.get(\"height\");"," }"," for(i in hash)"," {"," if(hash.hasOwnProperty(i))"," {"," dh = hash[i];"," pos = type == \"pie\" ? \"none\" : dh.position;"," axisClass = this._getAxisClass(dh.type);"," config = {dataProvider:this.get(\"dataProvider\")};"," if(dh.hasOwnProperty(\"roundingUnit\"))"," {"," config.roundingUnit = dh.roundingUnit;"," }"," config.keys = dh.keys;"," config.width = w;"," config.height = h;"," config.position = pos;"," config.styles = dh.styles;"," axis = new axisClass(config);"," axis.on(\"axisRendered\", Y.bind(this._itemRendered, this));"," this._axes[i] = axis;"," }"," }"," },",""," /**"," * Adds axes to the chart."," *"," * @method _addAxes"," * @private"," */"," _addAxes: function()"," {"," var axes = this.get(\"axes\"),"," i, "," axis, "," p;"," if(!axes)"," {"," this.set(\"axes\", this._getDefaultAxes());"," axes = this.get(\"axes\");"," }"," if(!this._axesCollection)"," { "," this._axesCollection = [];"," }"," for(i in axes)"," {"," if(axes.hasOwnProperty(i))"," {"," axis = axes[i];"," p = axis.get(\"position\");"," if(!this.get(p + \"AxesCollection\"))"," {"," this.set(p + \"AxesCollection\", [axis]);"," }"," else"," {"," this.get(p + \"AxesCollection\").push(axis);"," }"," this._axesCollection.push(axis);"," }"," }"," },",""," /**"," * Renders the Graph."," *"," * @method _addSeries"," * @private"," */"," _addSeries: function()"," {"," var graph = this.get(\"graph\"),"," seriesCollection = this.get(\"seriesCollection\");"," this._parseSeriesAxes(seriesCollection);"," graph.set(\"showBackground\", false);"," graph.set(\"width\", this.get(\"width\"));"," graph.set(\"height\", this.get(\"height\"));"," graph.set(\"seriesCollection\", seriesCollection);"," this._seriesCollection = graph.get(\"seriesCollection\");"," graph.render(this.get(\"contentBox\"));"," },",""," /**"," * Parse and sets the axes for the chart."," *"," * @method _parseSeriesAxes"," * @param {Array} c A collection `PieSeries` instance."," * @private"," */"," _parseSeriesAxes: function(c)"," {"," var i = 0, "," len = c.length, "," s,"," axes = this.get(\"axes\"),"," axis;"," for(; i < len; ++i)"," {"," s = c[i];"," if(s)"," {"," //If series is an actual series instance, "," //replace axes attribute string ids with axes"," if(s instanceof Y.PieSeries)"," {"," axis = s.get(\"categoryAxis\");"," if(axis && !(axis instanceof Y.Axis))"," {"," s.set(\"categoryAxis\", axes[axis]);"," }"," axis = s.get(\"valueAxis\");"," if(axis && !(axis instanceof Y.Axis))"," {"," s.set(\"valueAxis\", axes[axis]);"," }"," continue;"," }"," s.categoryAxis = axes.category;"," s.valueAxis = axes.values;"," if(!s.type)"," {"," s.type = this.get(\"type\");"," }"," }"," }"," },",""," /**"," * Generates and returns a key-indexed object containing `Axis` instances or objects used to create `Axis` instances."," *"," * @method _getDefaultAxes"," * @return Object"," * @private"," */"," _getDefaultAxes: function()"," {"," var catKey = this.get(\"categoryKey\"),"," seriesKeys = this.get(\"seriesKeys\").concat(), "," seriesAxis = \"numeric\";"," return {"," values:{"," keys:seriesKeys,"," type:seriesAxis"," },"," category:{"," keys:[catKey],"," type:this.get(\"categoryType\")"," }"," };"," },"," "," /**"," * Returns an object literal containing a categoryItem and a valueItem for a given series index."," *"," * @method getSeriesItem"," * @param series Reference to a series."," * @param index Index of the specified item within a series."," * @return Object"," */"," getSeriesItems: function(series, index)"," {"," var categoryItem = {"," axis: series.get(\"categoryAxis\"),"," key: series.get(\"categoryKey\"),"," displayName: series.get(\"categoryDisplayName\")"," },"," valueItem = {"," axis: series.get(\"valueAxis\"),"," key: series.get(\"valueKey\"),"," displayName: series.get(\"valueDisplayName\")"," };"," categoryItem.value = categoryItem.axis.getKeyValueAt(categoryItem.key, index);"," valueItem.value = valueItem.axis.getKeyValueAt(valueItem.key, index);"," return {category:categoryItem, value:valueItem};"," },",""," /**"," * Handler for sizeChanged event."," *"," * @method _sizeChanged"," * @param {Object} e Event object."," * @private"," */"," _sizeChanged: function(e)"," {"," this._redraw();"," },",""," /**"," * Redraws the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var graph = this.get(\"graph\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," dimension;"," if(graph)"," {"," dimension = Math.min(w, h);"," graph.set(\"width\", dimension);"," graph.set(\"height\", dimension);"," }"," },"," "," /**"," * Formats tooltip text for a pie chart."," *"," * @method _tooltipLabelFunction"," * @param {Object} categoryItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the category is bound.</dd>"," * <dt>displayName</dt><dd>The display name set to the category (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key of the category.</dd>"," * <dt>value</dt><dd>The value of the category</dd>"," * </dl>"," * @param {Object} valueItem An object containing the following:"," * <dl>"," * <dt>axis</dt><dd>The axis to which the item's series is bound.</dd>"," * <dt>displayName</dt><dd>The display name of the series. (defaults to key if not provided)</dd>"," * <dt>key</dt><dd>The key for the series.</dd>"," * <dt>value</dt><dd>The value for the series item.</dd> "," * </dl>"," * @param {Number} itemIndex The index of the item within the series."," * @param {CartesianSeries} series The `PieSeries` instance of the item."," * @param {Number} seriesIndex The index of the series in the `seriesCollection`."," * @return {HTML}"," * @private"," */"," _tooltipLabelFunction: function(categoryItem, valueItem, itemIndex, series, seriesIndex)"," {"," var msg = DOCUMENT.createElement(\"div\"),"," total = series.getTotalValues(),"," pct = Math.round((valueItem.value / total) * 10000)/100;"," msg.appendChild(DOCUMENT.createTextNode(categoryItem.displayName +"," \": \" + categoryItem.axis.get(\"labelFunction\").apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]))); "," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(valueItem.displayName + "," \": \" + valueItem.axis.get(\"labelFunction\").apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")])));"," msg.appendChild(DOCUMENT.createElement(\"br\"));"," msg.appendChild(DOCUMENT.createTextNode(pct + \"%\")); "," return msg; "," },",""," /**"," * Returns the appropriate message based on the key press."," *"," * @method _getAriaMessage"," * @param {Number} key The keycode that was pressed."," * @return String"," */"," _getAriaMessage: function(key)"," {"," var msg = \"\","," categoryItem,"," items,"," series,"," valueItem,"," seriesIndex = 0,"," itemIndex = this._itemIndex,"," seriesCollection = this.get(\"seriesCollection\"),"," len,"," total,"," pct,"," markers;"," series = this.getSeries(parseInt(seriesIndex, 10));"," markers = series.get(\"markers\");"," len = markers && markers.length ? markers.length : 0;"," if(key === 37)"," {"," itemIndex = itemIndex > 0 ? itemIndex - 1 : len - 1;"," }"," else if(key === 39)"," {"," itemIndex = itemIndex >= len - 1 ? 0 : itemIndex + 1;"," }"," this._itemIndex = itemIndex;"," items = this.getSeriesItems(series, itemIndex);"," categoryItem = items.category;"," valueItem = items.value;"," total = series.getTotalValues();"," pct = Math.round((valueItem.value / total) * 10000)/100;"," if(categoryItem && valueItem)"," {"," msg += categoryItem.displayName + \": \" + categoryItem.axis.formatLabel.apply(this, [categoryItem.value, categoryItem.axis.get(\"labelFormat\")]) + \", \";"," msg += valueItem.displayName + \": \" + valueItem.axis.formatLabel.apply(this, [valueItem.value, valueItem.axis.get(\"labelFormat\")]) + \", \"; "," msg += \"Percent of total \" + valueItem.displayName + \": \" + pct + \"%,\"; "," }"," else"," {"," msg += \"No data available,\";"," }"," msg += (itemIndex + 1) + \" of \" + len + \". \";"," return msg;"," }","}, {"," ATTRS: {"," /**"," * Sets the aria description for the chart."," *"," * @attribute ariaDescription"," * @type String"," */"," ariaDescription: {"," value: \"Use the left and right keys to navigate through items.\",",""," setter: function(val)"," {"," if(this._description)"," {"," this._description.setContent(\"\");"," this._description.appendChild(DOCUMENT.createTextNode(val));"," }"," return val;"," }"," },"," "," /**"," * Axes to appear in the chart. "," *"," * @attribute axes"," * @type Object"," */"," axes: {"," getter: function()"," {"," return this._axes;"," },",""," setter: function(val)"," {"," this._parseAxes(val);"," }"," },",""," /**"," * Collection of series to appear on the chart. This can be an array of Series instances or object literals"," * used to describe a Series instance."," *"," * @attribute seriesCollection"," * @type Array"," */"," seriesCollection: {"," getter: function()"," {"," return this._getSeriesCollection();"," },"," "," setter: function(val)"," {"," return this._setSeriesCollection(val);"," }"," },"," "," /**"," * Type of chart when there is no series collection specified."," *"," * @attribute type"," * @type String "," */"," type: {"," value: \"pie\""," }"," }","});","","","}, '3.7.3', {\"requires\": [\"dom\", \"datatype-number\", \"datatype-date\", \"event-custom\", \"event-mouseenter\", \"event-touch\", \"widget\", \"widget-position\", \"widget-stack\", \"graphics\"]});"]; _yuitest_coverage["build/charts-base/charts-base.js"].lines = {"1":0,"17":0,"41":0,"43":0,"46":0,"48":0,"57":0,"77":0,"79":0,"81":0,"82":0,"84":0,"85":0,"86":0,"87":0,"88":0,"90":0,"98":0,"99":0,"107":0,"121":0,"124":0,"126":0,"128":0,"132":0,"136":0,"141":0,"143":0,"147":0,"148":0,"149":0,"150":0,"151":0,"162":0,"163":0,"169":0,"173":0,"179":0,"183":0,"187":0,"196":0,"198":0,"201":0,"203":0,"212":0,"216":0,"220":0,"225":0,"227":0,"231":0,"232":0,"233":0,"234":0,"235":0,"246":0,"247":0,"256":0,"258":0,"261":0,"263":0,"272":0,"276":0,"277":0,"286":0,"288":0,"291":0,"293":0,"302":0,"306":0,"307":0,"316":0,"318":0,"321":0,"323":0,"332":0,"336":0,"337":0,"347":0,"349":0,"360":0,"361":0,"366":0,"378":0,"380":0,"400":0,"401":0,"416":0,"418":0,"420":0,"421":0,"423":0,"425":0,"429":0,"432":0,"444":0,"453":0,"454":0,"464":0,"466":0,"476":0,"492":0,"497":0,"498":0,"500":0,"503":0,"504":0,"505":0,"507":0,"508":0,"509":0,"511":0,"512":0,"513":0,"515":0,"516":0,"517":0,"532":0,"538":0,"550":0,"556":0,"558":0,"560":0,"562":0,"564":0,"577":0,"589":0,"596":0,"598":0,"600":0,"602":0,"606":0,"608":0,"620":0,"622":0,"627":0,"628":0,"630":0,"642":0,"651":0,"652":0,"653":0,"655":0,"657":0,"658":0,"659":0,"660":0,"674":0,"685":0,"687":0,"688":0,"690":0,"692":0,"694":0,"696":0,"697":0,"701":0,"702":0,"704":0,"705":0,"706":0,"707":0,"708":0,"720":0,"726":0,"728":0,"729":0,"731":0,"733":0,"734":0,"736":0,"738":0,"739":0,"743":0,"744":0,"746":0,"747":0,"761":0,"762":0,"764":0,"766":0,"768":0,"770":0,"772":0,"776":0,"778":0,"800":0,"808":0,"810":0,"812":0,"813":0,"817":0,"826":0,"828":0,"838":0,"854":0,"859":0,"860":0,"862":0,"865":0,"866":0,"867":0,"869":0,"870":0,"871":0,"873":0,"874":0,"875":0,"877":0,"878":0,"879":0,"894":0,"900":0,"912":0,"919":0,"921":0,"923":0,"925":0,"927":0,"940":0,"952":0,"959":0,"961":0,"963":0,"965":0,"969":0,"971":0,"983":0,"985":0,"990":0,"991":0,"993":0,"1005":0,"1014":0,"1015":0,"1016":0,"1018":0,"1020":0,"1021":0,"1022":0,"1023":0,"1037":0,"1048":0,"1050":0,"1052":0,"1054":0,"1056":0,"1058":0,"1059":0,"1061":0,"1063":0,"1067":0,"1068":0,"1070":0,"1071":0,"1072":0,"1073":0,"1074":0,"1075":0,"1076":0,"1088":0,"1094":0,"1096":0,"1098":0,"1100":0,"1101":0,"1103":0,"1105":0,"1109":0,"1110":0,"1112":0,"1113":0,"1127":0,"1128":0,"1130":0,"1132":0,"1134":0,"1136":0,"1138":0,"1142":0,"1144":0,"1156":0,"1159":0,"1170":0,"1175":0,"1177":0,"1179":0,"1180":0,"1184":0,"1193":0,"1195":0,"1205":0,"1221":0,"1226":0,"1227":0,"1229":0,"1232":0,"1233":0,"1234":0,"1236":0,"1237":0,"1238":0,"1240":0,"1241":0,"1242":0,"1244":0,"1245":0,"1246":0,"1258":0,"1264":0,"1266":0,"1268":0,"1270":0,"1272":0,"1286":0,"1292":0,"1305":0,"1317":0,"1324":0,"1326":0,"1328":0,"1330":0,"1334":0,"1336":0,"1348":0,"1350":0,"1355":0,"1356":0,"1358":0,"1370":0,"1379":0,"1380":0,"1381":0,"1383":0,"1385":0,"1386":0,"1387":0,"1388":0,"1402":0,"1413":0,"1415":0,"1417":0,"1419":0,"1421":0,"1423":0,"1424":0,"1428":0,"1430":0,"1431":0,"1432":0,"1433":0,"1434":0,"1435":0,"1436":0,"1448":0,"1455":0,"1457":0,"1458":0,"1460":0,"1462":0,"1463":0,"1467":0,"1468":0,"1470":0,"1471":0,"1485":0,"1486":0,"1488":0,"1490":0,"1492":0,"1496":0,"1498":0,"1510":0,"1511":0,"1522":0,"1527":0,"1529":0,"1531":0,"1534":0,"1543":0,"1545":0,"1555":0,"1571":0,"1576":0,"1577":0,"1578":0,"1581":0,"1582":0,"1583":0,"1585":0,"1586":0,"1587":0,"1589":0,"1590":0,"1591":0,"1593":0,"1594":0,"1595":0,"1607":0,"1614":0,"1616":0,"1618":0,"1620":0,"1622":0,"1636":0,"1642":0,"1655":0,"1667":0,"1674":0,"1676":0,"1678":0,"1680":0,"1684":0,"1686":0,"1698":0,"1700":0,"1705":0,"1706":0,"1708":0,"1720":0,"1729":0,"1730":0,"1731":0,"1733":0,"1735":0,"1736":0,"1737":0,"1738":0,"1752":0,"1762":0,"1764":0,"1765":0,"1769":0,"1771":0,"1772":0,"1774":0,"1776":0,"1778":0,"1780":0,"1781":0,"1785":0,"1788":0,"1789":0,"1790":0,"1791":0,"1792":0,"1804":0,"1810":0,"1812":0,"1813":0,"1817":0,"1819":0,"1820":0,"1822":0,"1824":0,"1826":0,"1828":0,"1829":0,"1833":0,"1836":0,"1837":0,"1851":0,"1852":0,"1854":0,"1858":0,"1860":0,"1862":0,"1864":0,"1866":0,"1868":0,"1872":0,"1875":0,"1897":0,"1905":0,"1907":0,"1909":0,"1910":0,"1913":0,"1926":0,"1954":0,"1956":0,"1969":0,"1970":0,"1982":0,"1983":0,"1985":0,"1987":0,"1992":0,"1994":0,"2008":0,"2010":0,"2020":0,"2029":0,"2035":0,"2037":0,"2038":0,"2039":0,"2040":0,"2042":0,"2044":0,"2046":0,"2047":0,"2051":0,"2062":0,"2068":0,"2069":0,"2070":0,"2071":0,"2072":0,"2074":0,"2078":0,"2080":0,"2081":0,"2082":0,"2083":0,"2084":0,"2097":0,"2152":0,"2164":0,"2169":0,"2170":0,"2171":0,"2173":0,"2203":0,"2204":0,"2217":0,"2219":0,"2222":0,"2223":0,"2225":0,"2226":0,"2228":0,"2229":0,"2232":0,"2237":0,"2255":0,"2257":0,"2258":0,"2260":0,"2261":0,"2262":0,"2264":0,"2288":0,"2289":0,"2290":0,"2291":0,"2292":0,"2297":0,"2298":0,"2299":0,"2300":0,"2301":0,"2302":0,"2303":0,"2304":0,"2305":0,"2307":0,"2311":0,"2312":0,"2313":0,"2315":0,"2316":0,"2317":0,"2322":0,"2324":0,"2325":0,"2326":0,"2327":0,"2328":0,"2329":0,"2330":0,"2331":0,"2333":0,"2335":0,"2337":0,"2338":0,"2339":0,"2340":0,"2341":0,"2342":0,"2343":0,"2344":0,"2346":0,"2348":0,"2349":0,"2350":0,"2352":0,"2353":0,"2355":0,"2357":0,"2358":0,"2360":0,"2362":0,"2364":0,"2368":0,"2369":0,"2371":0,"2375":0,"2376":0,"2389":0,"2398":0,"2399":0,"2400":0,"2402":0,"2403":0,"2405":0,"2410":0,"2411":0,"2413":0,"2416":0,"2417":0,"2428":0,"2432":0,"2434":0,"2435":0,"2437":0,"2439":0,"2440":0,"2442":0,"2444":0,"2456":0,"2462":0,"2464":0,"2469":0,"2470":0,"2472":0,"2473":0,"2474":0,"2475":0,"2476":0,"2478":0,"2480":0,"2482":0,"2485":0,"2486":0,"2488":0,"2490":0,"2493":0,"2494":0,"2495":0,"2496":0,"2498":0,"2500":0,"2501":0,"2503":0,"2505":0,"2506":0,"2521":0,"2529":0,"2531":0,"2535":0,"2536":0,"2537":0,"2539":0,"2541":0,"2543":0,"2546":0,"2547":0,"2548":0,"2549":0,"2551":0,"2553":0,"2556":0,"2567":0,"2569":0,"2571":0,"2576":0,"2578":0,"2589":0,"2591":0,"2594":0,"2596":0,"2597":0,"2598":0,"2599":0,"2602":0,"2614":0,"2617":0,"2619":0,"2623":0,"2636":0,"2642":0,"2644":0,"2648":0,"2650":0,"2663":0,"2667":0,"2669":0,"2673":0,"2675":0,"2689":0,"2690":0,"2692":0,"2696":0,"2698":0,"2710":0,"2714":0,"2716":0,"2720":0,"2733":0,"2739":0,"2743":0,"2745":0,"2749":0,"2754":0,"2756":0,"2769":0,"2777":0,"2779":0,"2780":0,"2781":0,"2782":0,"2786":0,"2787":0,"2789":0,"2791":0,"2795":0,"2796":0,"2797":0,"2798":0,"2799":0,"2800":0,"2801":0,"2803":0,"2807":0,"2809":0,"2810":0,"2811":0,"2815":0,"2816":0,"2818":0,"2820":0,"2839":0,"2841":0,"2842":0,"2843":0,"2844":0,"2845":0,"2856":0,"2867":0,"2880":0,"2885":0,"2886":0,"2887":0,"2888":0,"2889":0,"2890":0,"2891":0,"2892":0,"2893":0,"2894":0,"2895":0,"2896":0,"2897":0,"2898":0,"2910":0,"2912":0,"2913":0,"2915":0,"2916":0,"2917":0,"2930":0,"2935":0,"2937":0,"2939":0,"2940":0,"2941":0,"2942":0,"2945":0,"2947":0,"2971":0,"2972":0,"2974":0,"2976":0,"2978":0,"2980":0,"2982":0,"2984":0,"3003":0,"3005":0,"3007":0,"3012":0,"3013":0,"3031":0,"3033":0,"3035":0,"3040":0,"3041":0,"3055":0,"3060":0,"3061":0,"3075":0,"3080":0,"3081":0,"3116":0,"3118":0,"3119":0,"3121":0,"3124":0,"3139":0,"3141":0,"3142":0,"3144":0,"3147":0,"3168":0,"3169":0,"3171":0,"3173":0,"3231":0,"3246":0,"3248":0,"3250":0,"3266":0,"3288":0,"3293":0,"3294":0,"3328":0,"3349":0,"3370":0,"3435":0,"3442":0,"3443":0,"3444":0,"3445":0,"3446":0,"3447":0,"3448":0,"3449":0,"3458":0,"3459":0,"3460":0,"3461":0,"3462":0,"3463":0,"3464":0,"3476":0,"3479":0,"3481":0,"3483":0,"3485":0,"3489":0,"3491":0,"3578":0,"3592":0,"3596":0,"3598":0,"3599":0,"3601":0,"3614":0,"3619":0,"3621":0,"3622":0,"3624":0,"3625":0,"3636":0,"3638":0,"3639":0,"3641":0,"3643":0,"3646":0,"3658":0,"3659":0,"3661":0,"3662":0,"3676":0,"3678":0,"3680":0,"3682":0,"3694":0,"3695":0,"3697":0,"3699":0,"3710":0,"3716":0,"3718":0,"3719":0,"3720":0,"3722":0,"3724":0,"3725":0,"3727":0,"3729":0,"3730":0,"3734":0,"3735":0,"3746":0,"3749":0,"3751":0,"3753":0,"3755":0,"3757":0,"3771":0,"3772":0,"3774":0,"3776":0,"3778":0,"3780":0,"3794":0,"3808":0,"3812":0,"3813":0,"3814":0,"3826":0,"3827":0,"3841":0,"3843":0,"3845":0,"3857":0,"3869":0,"3884":0,"3888":0,"3890":0,"3891":0,"3893":0,"3897":0,"3899":0,"3900":0,"3904":0,"3906":0,"3908":0,"3912":0,"3913":0,"3952":0,"3966":0,"3980":0,"3982":0,"3984":0,"3999":0,"4003":0,"4005":0,"4007":0,"4009":0,"4011":0,"4015":0,"4016":0,"4030":0,"4032":0,"4034":0,"4049":0,"4050":0,"4052":0,"4054":0,"4058":0,"4059":0,"4075":0,"4091":0,"4104":0,"4106":0,"4108":0,"4121":0,"4124":0,"4126":0,"4128":0,"4131":0,"4147":0,"4149":0,"4152":0,"4154":0,"4181":0,"4183":0,"4185":0,"4207":0,"4219":0,"4221":0,"4223":0,"4235":0,"4240":0,"4242":0,"4243":0,"4245":0,"4248":0,"4272":0,"4285":0,"4290":0,"4292":0,"4293":0,"4297":0,"4299":0,"4301":0,"4303":0,"4315":0,"4324":0,"4326":0,"4328":0,"4329":0,"4331":0,"4332":0,"4334":0,"4336":0,"4338":0,"4340":0,"4342":0,"4343":0,"4347":0,"4348":0,"4349":0,"4352":0,"4354":0,"4356":0,"4358":0,"4362":0,"4364":0,"4366":0,"4368":0,"4370":0,"4374":0,"4377":0,"4378":0,"4381":0,"4395":0,"4410":0,"4412":0,"4414":0,"4415":0,"4417":0,"4419":0,"4420":0,"4424":0,"4426":0,"4428":0,"4430":0,"4433":0,"4435":0,"4439":0,"4442":0,"4444":0,"4446":0,"4447":0,"4448":0,"4449":0,"4450":0,"4452":0,"4454":0,"4456":0,"4457":0,"4458":0,"4459":0,"4463":0,"4465":0,"4469":0,"4472":0,"4474":0,"4476":0,"4477":0,"4478":0,"4479":0,"4483":0,"4485":0,"4489":0,"4494":0,"4495":0,"4496":0,"4497":0,"4502":0,"4504":0,"4506":0,"4508":0,"4512":0,"4513":0,"4519":0,"4521":0,"4523":0,"4527":0,"4530":0,"4532":0,"4534":0,"4535":0,"4536":0,"4540":0,"4541":0,"4546":0,"4550":0,"4552":0,"4554":0,"4556":0,"4559":0,"4560":0,"4562":0,"4564":0,"4566":0,"4568":0,"4570":0,"4571":0,"4572":0,"4574":0,"4576":0,"4577":0,"4581":0,"4582":0,"4584":0,"4585":0,"4586":0,"4590":0,"4591":0,"4593":0,"4595":0,"4596":0,"4601":0,"4602":0,"4604":0,"4606":0,"4608":0,"4609":0,"4610":0,"4612":0,"4614":0,"4618":0,"4619":0,"4624":0,"4626":0,"4627":0,"4628":0,"4629":0,"4630":0,"4631":0,"4633":0,"4635":0,"4637":0,"4639":0,"4641":0,"4643":0,"4647":0,"4649":0,"4651":0,"4653":0,"4654":0,"4658":0,"4660":0,"4664":0,"4666":0,"4670":0,"4671":0,"4685":0,"4690":0,"4692":0,"4694":0,"4696":0,"4698":0,"4702":0,"4703":0,"4705":0,"4707":0,"4709":0,"4724":0,"4725":0,"4727":0,"4729":0,"4730":0,"4745":0,"4746":0,"4748":0,"4750":0,"4765":0,"4766":0,"4768":0,"4770":0,"4785":0,"4786":0,"4787":0,"4801":0,"4804":0,"4806":0,"4808":0,"4809":0,"4810":0,"4811":0,"4813":0,"4815":0,"4819":0,"4831":0,"4833":0,"4836":0,"4839":0,"4849":0,"4861":0,"4863":0,"4865":0,"4868":0,"4870":0,"4871":0,"4872":0,"4874":0,"4876":0,"4877":0,"4879":0,"4881":0,"4883":0,"4887":0,"4891":0,"4893":0,"4897":0,"4899":0,"4901":0,"4905":0,"4908":0,"4909":0,"4910":0,"4912":0,"4914":0,"4916":0,"4918":0,"4922":0,"4934":0,"4936":0,"4939":0,"4941":0,"4956":0,"4957":0,"4974":0,"4975":0,"4988":0,"4989":0,"4991":0,"4993":0,"4997":0,"4998":0,"5011":0,"5012":0,"5014":0,"5016":0,"5020":0,"5021":0,"5041":0,"5042":0,"5044":0,"5046":0,"5061":0,"5072":0,"5073":0,"5075":0,"5077":0,"5109":0,"5114":0,"5115":0,"5116":0,"5118":0,"5122":0,"5124":0,"5138":0,"5143":0,"5145":0,"5146":0,"5148":0,"5152":0,"5153":0,"5155":0,"5157":0,"5159":0,"5161":0,"5165":0,"5167":0,"5169":0,"5174":0,"5177":0,"5179":0,"5192":0,"5198":0,"5200":0,"5201":0,"5203":0,"5207":0,"5208":0,"5210":0,"5212":0,"5214":0,"5216":0,"5220":0,"5222":0,"5224":0,"5229":0,"5232":0,"5234":0,"5235":0,"5248":0,"5250":0,"5252":0,"5254":0,"5257":0,"5261":0,"5273":0,"5275":0,"5278":0,"5280":0,"5292":0,"5329":0,"5330":0,"5344":0,"5349":0,"5351":0,"5353":0,"5355":0,"5356":0,"5357":0,"5359":0,"5360":0,"5373":0,"5379":0,"5381":0,"5383":0,"5385":0,"5386":0,"5387":0,"5389":0,"5390":0,"5391":0,"5403":0,"5405":0,"5407":0,"5408":0,"5410":0,"5412":0,"5425":0,"5439":0,"5440":0,"5442":0,"5444":0,"5446":0,"5448":0,"5462":0,"5475":0,"5477":0,"5479":0,"5481":0,"5495":0,"5498":0,"5500":0,"5504":0,"5506":0,"5518":0,"5520":0,"5532":0,"5535":0,"5539":0,"5549":0,"5553":0,"5565":0,"5573":0,"5575":0,"5578":0,"5586":0,"5588":0,"5589":0,"5590":0,"5591":0,"5592":0,"5595":0,"5597":0,"5598":0,"5599":0,"5602":0,"5603":0,"5604":0,"5605":0,"5606":0,"5607":0,"5609":0,"5611":0,"5612":0,"5614":0,"5616":0,"5617":0,"5621":0,"5622":0,"5626":0,"5639":0,"5644":0,"5645":0,"5647":0,"5648":0,"5649":0,"5652":0,"5654":0,"5657":0,"5660":0,"5669":0,"5671":0,"5689":0,"5691":0,"5695":0,"5707":0,"5723":0,"5725":0,"5726":0,"5727":0,"5731":0,"5733":0,"5735":0,"5737":0,"5739":0,"5740":0,"5742":0,"5743":0,"5745":0,"5746":0,"5748":0,"5752":0,"5756":0,"5758":0,"5762":0,"5765":0,"5766":0,"5767":0,"5769":0,"5771":0,"5772":0,"5773":0,"5776":0,"5777":0,"5788":0,"5805":0,"5807":0,"5808":0,"5809":0,"5813":0,"5815":0,"5817":0,"5819":0,"5821":0,"5822":0,"5824":0,"5825":0,"5827":0,"5828":0,"5830":0,"5834":0,"5838":0,"5840":0,"5844":0,"5847":0,"5848":0,"5849":0,"5851":0,"5853":0,"5854":0,"5855":0,"5858":0,"5859":0,"5874":0,"5886":0,"5888":0,"5889":0,"5891":0,"5893":0,"5895":0,"5896":0,"5897":0,"5899":0,"5902":0,"5903":0,"5905":0,"5906":0,"5922":0,"5925":0,"5927":0,"5928":0,"5930":0,"5944":0,"5947":0,"5949":0,"5950":0,"5952":0,"5967":0,"5979":0,"5981":0,"5982":0,"5984":0,"5987":0,"5988":0,"5990":0,"5991":0,"5992":0,"5995":0,"5996":0,"5998":0,"5999":0,"6004":0,"6013":0,"6015":0,"6032":0,"6033":0,"6035":0,"6037":0,"6038":0,"6050":0,"6052":0,"6064":0,"6066":0,"6068":0,"6092":0,"6094":0,"6095":0,"6099":0,"6100":0,"6102":0,"6103":0,"6108":0,"6110":0,"6111":0,"6112":0,"6113":0,"6115":0,"6116":0,"6118":0,"6120":0,"6121":0,"6123":0,"6125":0,"6127":0,"6131":0,"6136":0,"6138":0,"6142":0,"6144":0,"6150":0,"6153":0,"6154":0,"6155":0,"6157":0,"6168":0,"6170":0,"6172":0,"6187":0,"6192":0,"6193":0,"6195":0,"6196":0,"6197":0,"6198":0,"6199":0,"6200":0,"6201":0,"6203":0,"6220":0,"6221":0,"6222":0,"6231":0,"6232":0,"6234":0,"6236":0,"6237":0,"6238":0,"6239":0,"6242":0,"6243":0,"6245":0,"6247":0,"6249":0,"6251":0,"6254":0,"6266":0,"6279":0,"6280":0,"6288":0,"6290":0,"6294":0,"6299":0,"6300":0,"6304":0,"6305":0,"6308":0,"6318":0,"6319":0,"6321":0,"6322":0,"6324":0,"6336":0,"6338":0,"6352":0,"6354":0,"6356":0,"6370":0,"6371":0,"6375":0,"6376":0,"6378":0,"6379":0,"6380":0,"6381":0,"6383":0,"6385":0,"6387":0,"6388":0,"6389":0,"6390":0,"6394":0,"6396":0,"6397":0,"6399":0,"6400":0,"6401":0,"6412":0,"6414":0,"6416":0,"6432":0,"6436":0,"6437":0,"6438":0,"6440":0,"6441":0,"6442":0,"6443":0,"6444":0,"6445":0,"6446":0,"6448":0,"6450":0,"6451":0,"6455":0,"6456":0,"6458":0,"6459":0,"6470":0,"6472":0,"6474":0,"6496":0,"6497":0,"6498":0,"6499":0,"6500":0,"6504":0,"6505":0,"6506":0,"6508":0,"6509":0,"6510":0,"6511":0,"6512":0,"6513":0,"6514":0,"6516":0,"6518":0,"6519":0,"6520":0,"6521":0,"6522":0,"6523":0,"6524":0,"6526":0,"6527":0,"6528":0,"6529":0,"6530":0,"6531":0,"6532":0,"6537":0,"6539":0,"6540":0,"6544":0,"6545":0,"6549":0,"6550":0,"6571":0,"6575":0,"6577":0,"6578":0,"6579":0,"6580":0,"6581":0,"6582":0,"6586":0,"6587":0,"6588":0,"6589":0,"6590":0,"6591":0,"6593":0,"6594":0,"6595":0,"6611":0,"6613":0,"6615":0,"6616":0,"6618":0,"6621":0,"6637":0,"6639":0,"6641":0,"6642":0,"6646":0,"6647":0,"6649":0,"6661":0,"6682":0,"6684":0,"6687":0,"6688":0,"6689":0,"6690":0,"6692":0,"6693":0,"6694":0,"6695":0,"6699":0,"6700":0,"6701":0,"6702":0,"6704":0,"6706":0,"6707":0,"6708":0,"6709":0,"6710":0,"6714":0,"6717":0,"6718":0,"6719":0,"6720":0,"6722":0,"6723":0,"6724":0,"6726":0,"6727":0,"6728":0,"6730":0,"6731":0,"6732":0,"6733":0,"6735":0,"6737":0,"6738":0,"6739":0,"6741":0,"6742":0,"6743":0,"6744":0,"6746":0,"6747":0,"6748":0,"6750":0,"6752":0,"6753":0,"6754":0,"6756":0,"6758":0,"6759":0,"6760":0,"6763":0,"6764":0,"6765":0,"6766":0,"6769":0,"6770":0,"6771":0,"6783":0,"6787":0,"6788":0,"6797":0,"6799":0,"6803":0,"6807":0,"6810":0,"6828":0,"6830":0,"6832":0,"6851":0,"6853":0,"6854":0,"6855":0,"6857":0,"6858":0,"6860":0,"6872":0,"6874":0,"6876":0,"6878":0,"6880":0,"6882":0,"6883":0,"6885":0,"6886":0,"6887":0,"6889":0,"6890":0,"6892":0,"6894":0,"6896":0,"6898":0,"6901":0,"6902":0,"6903":0,"6905":0,"6931":0,"6933":0,"6935":0,"6948":0,"6964":0,"6965":0,"6966":0,"7000":0,"7002":0,"7004":0,"7005":0,"7006":0,"7007":0,"7009":0,"7011":0,"7013":0,"7014":0,"7016":0,"7019":0,"7023":0,"7025":0,"7026":0,"7041":0,"7044":0,"7045":0,"7046":0,"7047":0,"7048":0,"7059":0,"7061":0,"7062":0,"7064":0,"7066":0,"7070":0,"7072":0,"7084":0,"7090":0,"7092":0,"7094":0,"7095":0,"7097":0,"7100":0,"7101":0,"7109":0,"7110":0,"7111":0,"7113":0,"7115":0,"7117":0,"7119":0,"7121":0,"7123":0,"7124":0,"7125":0,"7137":0,"7141":0,"7143":0,"7144":0,"7146":0,"7147":0,"7149":0,"7163":0,"7164":0,"7166":0,"7167":0,"7169":0,"7184":0,"7186":0,"7194":0,"7195":0,"7196":0,"7197":0,"7198":0,"7199":0,"7200":0,"7201":0,"7202":0,"7217":0,"7219":0,"7221":0,"7234":0,"7235":0,"7248":0,"7250":0,"7251":0,"7252":0,"7254":0,"7256":0,"7258":0,"7261":0,"7274":0,"7275":0,"7278":0,"7279":0,"7281":0,"7282":0,"7284":0,"7285":0,"7287":0,"7288":0,"7290":0,"7301":0,"7302":0,"7311":0,"7313":0,"7322":0,"7324":0,"7326":0,"7365":0,"7367":0,"7369":0,"7371":0,"7373":0,"7375":0,"7376":0,"7380":0,"7381":0,"7383":0,"7384":0,"7385":0,"7386":0,"7388":0,"7389":0,"7390":0,"7392":0,"7395":0,"7396":0,"7397":0,"7399":0,"7400":0,"7401":0,"7402":0,"7403":0,"7404":0,"7406":0,"7407":0,"7409":0,"7410":0,"7411":0,"7412":0,"7413":0,"7414":0,"7415":0,"7417":0,"7418":0,"7420":0,"7421":0,"7423":0,"7424":0,"7426":0,"7428":0,"7429":0,"7430":0,"7431":0,"7435":0,"7436":0,"7437":0,"7438":0,"7439":0,"7441":0,"7443":0,"7445":0,"7447":0,"7451":0,"7453":0,"7456":0,"7457":0,"7458":0,"7460":0,"7471":0,"7493":0,"7516":0,"7517":0,"7518":0,"7522":0,"7533":0,"7576":0,"7577":0,"7578":0,"7579":0,"7590":0,"7592":0,"7594":0,"7595":0,"7597":0,"7599":0,"7600":0,"7602":0,"7603":0,"7604":0,"7605":0,"7606":0,"7608":0,"7611":0,"7612":0,"7613":0,"7615":0,"7618":0,"7619":0,"7620":0,"7622":0,"7625":0,"7637":0,"7638":0,"7639":0,"7651":0,"7652":0,"7653":0,"7674":0,"7675":0,"7677":0,"7690":0,"7691":0,"7693":0,"7706":0,"7712":0,"7714":0,"7716":0,"7717":0,"7718":0,"7720":0,"7722":0,"7723":0,"7724":0,"7735":0,"7737":0,"7741":0,"7753":0,"7755":0,"7766":0,"7800":0,"7801":0,"7802":0,"7803":0,"7804":0,"7806":0,"7808":0,"7810":0,"7811":0,"7812":0,"7814":0,"7816":0,"7818":0,"7819":0,"7820":0,"7822":0,"7826":0,"7828":0,"7830":0,"7834":0,"7836":0,"7837":0,"7838":0,"7839":0,"7841":0,"7842":0,"7843":0,"7844":0,"7845":0,"7858":0,"7861":0,"7863":0,"7864":0,"7866":0,"7879":0,"7882":0,"7884":0,"7885":0,"7887":0,"7898":0,"7901":0,"7903":0,"7905":0,"7907":0,"7908":0,"7910":0,"7911":0,"7912":0,"7913":0,"7915":0,"7917":0,"7918":0,"7920":0,"7924":0,"7925":0,"7950":0,"8005":0,"8013":0,"8014":0,"8016":0,"8018":0,"8019":0,"8031":0,"8042":0,"8043":0,"8054":0,"8056":0,"8058":0,"8060":0,"8062":0,"8064":0,"8066":0,"8068":0,"8070":0,"8072":0,"8074":0,"8075":0,"8076":0,"8077":0,"8078":0,"8079":0,"8081":0,"8083":0,"8084":0,"8086":0,"8089":0,"8091":0,"8092":0,"8094":0,"8096":0,"8097":0,"8099":0,"8101":0,"8102":0,"8188":0,"8193":0,"8194":0,"8207":0,"8212":0,"8213":0,"8229":0,"8234":0,"8236":0,"8240":0,"8242":0,"8258":0,"8263":0,"8265":0,"8269":0,"8271":0,"8330":0,"8370":0,"8384":0,"8425":0,"8440":0,"8481":0,"8482":0,"8484":0,"8486":0,"8498":0,"8499":0,"8501":0,"8503":0,"8526":0,"8528":0,"8532":0,"8538":0,"8539":0,"8555":0,"8565":0,"8579":0,"8581":0,"8583":0,"8584":0,"8598":0,"8599":0,"8658":0,"8666":0,"8680":0,"8682":0,"8684":0,"8698":0,"8699":0,"8754":0,"8764":0,"8818":0,"8828":0,"8829":0,"8857":0,"8867":0,"8868":0,"8897":0,"8911":0,"8914":0,"8916":0,"8917":0,"8921":0,"8922":0,"8924":0,"8937":0,"8939":0,"8957":0,"8958":0,"8959":0,"8960":0,"8961":0,"8962":0,"8963":0,"8964":0,"8966":0,"8967":0,"8968":0,"8969":0,"8971":0,"8973":0,"8975":0,"8977":0,"8978":0,"8980":0,"8981":0,"8983":0,"9047":0,"9061":0,"9064":0,"9066":0,"9067":0,"9071":0,"9072":0,"9074":0,"9087":0,"9089":0,"9107":0,"9108":0,"9109":0,"9110":0,"9111":0,"9112":0,"9113":0,"9114":0,"9116":0,"9117":0,"9118":0,"9119":0,"9121":0,"9123":0,"9125":0,"9127":0,"9128":0,"9130":0,"9131":0,"9133":0,"9205":0,"9215":0,"9229":0,"9231":0,"9233":0,"9247":0,"9248":0,"9297":0,"9307":0,"9350":0,"9360":0,"9361":0,"9392":0,"9402":0,"9404":0,"9406":0,"9408":0,"9410":0,"9412":0,"9425":0,"9429":0,"9431":0,"9433":0,"9435":0,"9437":0,"9439":0,"9440":0,"9442":0,"9443":0,"9444":0,"9446":0,"9447":0,"9449":0,"9466":0,"9467":0,"9468":0,"9469":0,"9470":0,"9556":0,"9560":0,"9589":0,"9593":0,"9616":0,"9620":0,"9659":0,"9669":0,"9670":0,"9682":0,"9684":0,"9686":0,"9688":0,"9690":0,"9692":0,"9733":0,"9743":0,"9745":0,"9747":0,"9749":0,"9751":0,"9753":0,"9783":0,"9793":0,"9795":0,"9797":0,"9799":0,"9801":0,"9803":0,"9842":0,"9852":0,"9853":0,"9880":0,"9890":0,"9891":0,"9903":0,"9930":0,"9939":0,"9941":0,"9943":0,"9974":0,"9976":0,"9978":0,"9980":0,"9982":0,"9983":0,"9985":0,"9986":0,"9987":0,"9989":0,"9991":0,"9992":0,"9993":0,"9994":0,"9996":0,"9997":0,"9998":0,"10003":0,"10004":0,"10006":0,"10007":0,"10008":0,"10010":0,"10011":0,"10013":0,"10015":0,"10017":0,"10018":0,"10020":0,"10021":0,"10023":0,"10025":0,"10026":0,"10028":0,"10029":0,"10031":0,"10033":0,"10034":0,"10035":0,"10039":0,"10040":0,"10045":0,"10047":0,"10048":0,"10049":0,"10050":0,"10052":0,"10054":0,"10055":0,"10056":0,"10059":0,"10061":0,"10062":0,"10064":0,"10065":0,"10066":0,"10067":0,"10071":0,"10072":0,"10073":0,"10074":0,"10075":0,"10077":0,"10079":0,"10081":0,"10083":0,"10086":0,"10088":0,"10091":0,"10093":0,"10104":0,"10118":0,"10120":0,"10128":0,"10129":0,"10130":0,"10131":0,"10132":0,"10133":0,"10134":0,"10135":0,"10136":0,"10137":0,"10139":0,"10143":0,"10145":0,"10147":0,"10151":0,"10153":0,"10166":0,"10189":0,"10190":0,"10191":0,"10270":0,"10280":0,"10282":0,"10285":0,"10316":0,"10318":0,"10320":0,"10322":0,"10324":0,"10325":0,"10327":0,"10328":0,"10329":0,"10331":0,"10333":0,"10334":0,"10335":0,"10336":0,"10338":0,"10339":0,"10340":0,"10345":0,"10346":0,"10348":0,"10349":0,"10350":0,"10352":0,"10353":0,"10354":0,"10356":0,"10358":0,"10359":0,"10361":0,"10362":0,"10364":0,"10366":0,"10367":0,"10369":0,"10370":0,"10371":0,"10373":0,"10375":0,"10376":0,"10380":0,"10381":0,"10386":0,"10388":0,"10389":0,"10390":0,"10392":0,"10394":0,"10395":0,"10396":0,"10397":0,"10400":0,"10402":0,"10403":0,"10405":0,"10406":0,"10407":0,"10408":0,"10412":0,"10413":0,"10414":0,"10415":0,"10416":0,"10418":0,"10420":0,"10422":0,"10424":0,"10427":0,"10429":0,"10432":0,"10434":0,"10445":0,"10460":0,"10462":0,"10470":0,"10471":0,"10472":0,"10473":0,"10474":0,"10475":0,"10476":0,"10478":0,"10482":0,"10484":0,"10486":0,"10490":0,"10492":0,"10506":0,"10529":0,"10530":0,"10531":0,"10622":0,"10649":0,"10652":0,"10654":0,"10655":0,"10657":0,"10658":0,"10660":0,"10662":0,"10663":0,"10664":0,"10665":0,"10666":0,"10667":0,"10668":0,"10669":0,"10670":0,"10671":0,"10672":0,"10673":0,"10674":0,"10701":0,"10703":0,"10705":0,"10706":0,"10708":0,"10710":0,"10711":0,"10713":0,"10714":0,"10715":0,"10726":0,"10727":0,"10739":0,"10740":0,"10741":0,"10753":0,"10754":0,"10755":0,"10776":0,"10778":0,"10791":0,"10793":0,"10805":0,"10808":0,"10810":0,"10811":0,"10813":0,"10814":0,"10816":0,"10817":0,"10818":0,"10819":0,"10820":0,"10822":0,"10826":0,"10839":0,"10873":0,"10875":0,"10877":0,"10878":0,"10880":0,"10884":0,"10885":0,"10886":0,"10887":0,"10889":0,"10890":0,"10891":0,"10893":0,"10895":0,"10896":0,"10898":0,"10902":0,"10904":0,"10906":0,"10908":0,"10910":0,"10912":0,"10914":0,"10916":0,"10918":0,"10920":0,"10922":0,"10924":0,"10925":0,"10926":0,"10927":0,"10928":0,"10947":0,"10948":0,"10950":0,"10953":0,"10967":0,"10986":0,"10988":0,"10989":0,"10990":0,"10991":0,"10993":0,"10994":0,"10998":0,"10999":0,"11002":0,"11003":0,"11004":0,"11005":0,"11006":0,"11007":0,"11008":0,"11009":0,"11023":0,"11025":0,"11030":0,"11031":0,"11032":0,"11033":0,"11034":0,"11050":0,"11053":0,"11054":0,"11055":0,"11056":0,"11067":0,"11070":0,"11072":0,"11073":0,"11075":0,"11078":0,"11090":0,"11105":0,"11106":0,"11107":0,"11157":0,"11165":0,"11166":0,"11168":0,"11170":0,"11171":0,"11214":0,"11230":0,"11246":0,"11261":0,"11274":0,"11275":0,"11280":0,"11293":0,"11294":0,"11299":0,"11351":0,"11369":0,"11370":0,"11372":0,"11384":0,"11386":0,"11398":0,"11413":0,"11415":0,"11417":0,"11418":0,"11422":0,"11423":0,"11424":0,"11426":0,"11431":0,"11433":0,"11434":0,"11435":0,"11436":0,"11441":0,"11443":0,"11445":0,"11461":0,"11462":0,"11477":0,"11478":0,"11491":0,"11498":0,"11542":0,"11549":0,"11550":0,"11551":0,"11552":0,"11553":0,"11554":0,"11563":0,"11572":0,"11574":0,"11575":0,"11576":0,"11577":0,"11578":0,"11579":0,"11580":0,"11581":0,"11582":0,"11583":0,"11585":0,"11587":0,"11588":0,"11590":0,"11593":0,"11595":0,"11597":0,"11599":0,"11621":0,"11623":0,"11625":0,"11627":0,"11639":0,"11641":0,"11643":0,"11645":0,"11658":0,"11660":0,"11662":0,"11692":0,"11694":0,"11696":0,"11700":0,"11701":0,"11702":0,"11703":0,"11705":0,"11706":0,"11708":0,"11709":0,"11711":0,"11713":0,"11714":0,"11716":0,"11717":0,"11718":0,"11731":0,"11736":0,"11738":0,"11740":0,"11741":0,"11743":0,"11745":0,"11746":0,"11747":0,"11748":0,"11749":0,"11750":0,"11751":0,"11764":0,"11770":0,"11771":0,"11773":0,"11775":0,"11776":0,"11777":0,"11778":0,"11779":0,"11780":0,"11781":0,"11782":0,"11783":0,"11784":0,"11785":0,"11787":0,"11858":0,"11859":0,"11861":0,"11865":0,"11867":0,"11879":0,"11884":0,"11904":0,"11906":0,"11907":0,"11908":0,"11909":0,"11910":0,"11922":0,"11929":0,"11931":0,"11933":0,"11935":0,"11936":0,"11938":0,"11939":0,"11942":0,"11944":0,"11946":0,"11948":0,"11950":0,"11952":0,"11954":0,"11965":0,"11967":0,"11968":0,"11970":0,"11974":0,"11975":0,"11976":0,"11977":0,"11978":0,"11979":0,"11980":0,"11982":0,"11983":0,"11985":0,"11986":0,"11989":0,"11990":0,"11992":0,"12005":0,"12008":0,"12010":0,"12012":0,"12014":0,"12015":0,"12017":0,"12019":0,"12033":0,"12045":0,"12056":0,"12058":0,"12059":0,"12061":0,"12063":0,"12064":0,"12066":0,"12068":0,"12069":0,"12084":0,"12085":0,"12099":0,"12100":0,"12123":0,"12128":0,"12129":0,"12156":0,"12172":0,"12173":0,"12175":0,"12177":0,"12179":0,"12180":0,"12181":0,"12183":0,"12185":0,"12186":0,"12203":0,"12204":0,"12206":0,"12208":0,"12210":0,"12211":0,"12212":0,"12214":0,"12216":0,"12217":0,"12232":0,"12234":0,"12235":0,"12236":0,"12238":0,"12254":0,"12256":0,"12257":0,"12258":0,"12260":0,"12276":0,"12278":0,"12279":0,"12280":0,"12282":0,"12331":0,"12333":0,"12345":0,"12346":0,"12348":0,"12350":0,"12355":0,"12356":0,"12358":0,"12360":0,"12375":0,"12380":0,"12381":0,"12382":0,"12397":0,"12398":0,"12400":0,"12402":0,"12417":0,"12419":0,"12420":0,"12422":0,"12500":0,"12577":0,"12587":0,"12589":0,"12591":0,"12604":0,"12605":0,"12607":0,"12620":0,"12624":0,"12625":0,"12627":0,"12639":0,"12641":0,"12643":0,"12645":0,"12649":0,"12652":0,"12667":0,"12669":0,"12671":0,"12673":0,"12684":0,"12687":0,"12689":0,"12691":0,"12723":0,"12725":0,"12732":0,"12734":0,"12735":0,"12737":0,"12739":0,"12741":0,"12743":0,"12764":0,"12776":0,"12808":0,"12809":0,"12810":0,"12811":0,"12820":0,"12824":0,"12825":0,"12826":0,"12827":0,"12828":0,"12830":0,"12832":0,"12844":0,"12847":0,"12848":0,"12849":0,"12850":0,"12851":0,"12852":0,"12853":0,"12854":0,"12855":0,"12856":0,"12857":0,"12858":0,"12859":0,"12860":0,"12861":0,"12862":0,"12874":0,"12877":0,"12878":0,"12879":0,"12880":0,"12881":0,"12882":0,"12891":0,"12900":0,"12901":0,"12902":0,"12903":0,"12904":0,"12913":0,"12914":0,"12917":0,"12919":0,"12920":0,"12921":0,"12922":0,"12925":0,"12928":0,"12929":0,"12930":0,"12932":0,"12934":0,"12935":0,"12936":0,"12938":0,"12939":0,"12945":0,"12946":0,"12947":0,"12948":0,"12949":0,"12950":0,"12953":0,"12955":0,"12957":0,"12961":0,"12962":0,"12965":0,"12967":0,"12968":0,"12969":0,"12971":0,"12972":0,"12977":0,"12978":0,"12981":0,"12983":0,"12987":0,"12989":0,"12991":0,"12993":0,"12995":0,"12996":0,"12998":0,"13001":0,"13016":0,"13029":0,"13031":0,"13033":0,"13035":0,"13037":0,"13038":0,"13133":0,"13157":0,"13161":0,"13162":0,"13163":0,"13165":0,"13166":0,"13168":0,"13169":0,"13171":0,"13173":0,"13175":0,"13176":0,"13178":0,"13180":0,"13182":0,"13198":0,"13199":0,"13201":0,"13205":0,"13220":0,"13222":0,"13224":0,"13225":0,"13226":0,"13227":0,"13228":0,"13241":0,"13246":0,"13248":0,"13249":0,"13260":0,"13262":0,"13263":0,"13264":0,"13265":0,"13266":0,"13277":0,"13281":0,"13283":0,"13285":0,"13286":0,"13287":0,"13300":0,"13314":0,"13316":0,"13317":0,"13318":0,"13320":0,"13322":0,"13324":0,"13328":0,"13330":0,"13332":0,"13335":0,"13337":0,"13349":0,"13360":0,"13362":0,"13366":0,"13369":0,"13370":0,"13373":0,"13374":0,"13375":0,"13376":0,"13377":0,"13378":0,"13379":0,"13380":0,"13381":0,"13382":0,"13383":0,"13384":0,"13385":0,"13386":0,"13387":0,"13388":0,"13389":0,"13390":0,"13413":0,"13421":0,"13423":0,"13424":0,"13426":0,"13428":0,"13431":0,"13433":0,"13434":0,"13436":0,"13437":0,"13438":0,"13439":0,"13440":0,"13441":0,"13442":0,"13444":0,"13446":0,"13449":0,"13478":0,"13481":0,"13482":0,"13483":0,"13485":0,"13487":0,"13488":0,"13489":0,"13490":0,"13491":0,"13493":0,"13495":0,"13496":0,"13508":0,"13510":0,"13514":0,"13516":0,"13518":0,"13535":0,"13536":0,"13538":0,"13540":0,"13542":0,"13544":0,"13546":0,"13548":0,"13560":0,"13565":0,"13567":0,"13568":0,"13570":0,"13572":0,"13576":0,"13589":0,"13593":0,"13595":0,"13597":0,"13598":0,"13600":0,"13602":0,"13605":0,"13608":0,"13618":0,"13625":0,"13631":0,"13632":0,"13633":0,"13634":0,"13635":0,"13636":0,"13638":0,"13641":0,"13642":0,"13644":0,"13645":0,"13646":0,"13647":0,"13648":0,"13649":0,"13650":0,"13651":0,"13652":0,"13654":0,"13655":0,"13668":0,"13698":0,"13699":0,"13701":0,"13702":0,"13706":0,"13707":0,"13709":0,"13710":0,"13712":0,"13713":0,"13715":0,"13717":0,"13719":0,"13722":0,"13724":0,"13725":0,"13727":0,"13729":0,"13730":0,"13733":0,"13734":0,"13736":0,"13737":0,"13738":0,"13739":0,"13741":0,"13743":0,"13745":0,"13747":0,"13749":0,"13750":0,"13751":0,"13752":0,"13756":0,"13785":0,"13787":0,"13801":0,"13833":0,"13835":0,"13837":0,"13839":0,"13852":0,"13853":0,"13855":0,"13856":0,"13858":0,"13871":0,"13873":0,"13875":0,"13877":0,"13890":0,"13910":0,"13911":0,"13913":0,"13914":0,"13915":0,"13916":0,"13920":0,"13921":0,"13922":0,"13923":0,"13925":0,"13926":0,"13928":0,"13929":0,"13930":0,"13932":0,"13933":0,"13935":0,"13936":0,"13937":0,"13941":0,"13946":0,"13949":0,"13951":0,"13952":0,"13954":0,"13955":0,"13956":0,"13957":0,"13959":0,"13961":0,"13964":0,"13966":0,"13968":0,"13969":0,"13971":0,"13972":0,"13974":0,"13975":0,"13978":0,"13979":0,"13980":0,"13981":0,"13983":0,"13984":0,"13986":0,"13988":0,"13990":0,"13992":0,"13994":0,"13996":0,"13998":0,"14001":0,"14003":0,"14005":0,"14006":0,"14007":0,"14009":0,"14021":0,"14026":0,"14028":0,"14029":0,"14031":0,"14034":0,"14036":0,"14037":0,"14039":0,"14054":0,"14057":0,"14058":0,"14071":0,"14075":0,"14077":0,"14079":0,"14083":0,"14085":0,"14087":0,"14088":0,"14090":0,"14091":0,"14097":0,"14113":0,"14115":0,"14117":0,"14119":0,"14121":0,"14137":0,"14139":0,"14143":0,"14157":0,"14186":0,"14188":0,"14190":0,"14191":0,"14193":0,"14197":0,"14198":0,"14199":0,"14200":0,"14202":0,"14204":0,"14206":0,"14207":0,"14209":0,"14211":0,"14212":0,"14214":0,"14216":0,"14221":0,"14223":0,"14226":0,"14228":0,"14229":0,"14231":0,"14233":0,"14234":0,"14236":0,"14238":0,"14241":0,"14245":0,"14246":0,"14247":0,"14251":0,"14253":0,"14254":0,"14256":0,"14258":0,"14262":0,"14273":0,"14280":0,"14282":0,"14284":0,"14286":0,"14288":0,"14289":0,"14291":0,"14293":0,"14294":0,"14296":0,"14298":0,"14299":0,"14301":0,"14302":0,"14303":0,"14305":0,"14309":0,"14311":0,"14312":0,"14314":0,"14316":0,"14330":0,"14332":0,"14344":0,"14356":0,"14358":0,"14359":0,"14361":0,"14363":0,"14365":0,"14367":0,"14369":0,"14373":0,"14375":0,"14377":0,"14379":0,"14381":0,"14384":0,"14386":0,"14388":0,"14390":0,"14392":0,"14396":0,"14398":0,"14400":0,"14402":0,"14404":0,"14418":0,"14419":0,"14421":0,"14423":0,"14436":0,"14455":0,"14457":0,"14458":0,"14462":0,"14463":0,"14465":0,"14467":0,"14469":0,"14471":0,"14472":0,"14473":0,"14474":0,"14476":0,"14477":0,"14478":0,"14480":0,"14481":0,"14483":0,"14485":0,"14487":0,"14491":0,"14492":0,"14494":0,"14495":0,"14497":0,"14499":0,"14501":0,"14503":0,"14505":0,"14507":0,"14513":0,"14514":0,"14516":0,"14518":0,"14519":0,"14521":0,"14522":0,"14524":0,"14527":0,"14529":0,"14531":0,"14533":0,"14536":0,"14538":0,"14541":0,"14543":0,"14545":0,"14547":0,"14548":0,"14550":0,"14552":0,"14554":0,"14558":0,"14561":0,"14563":0,"14565":0,"14567":0,"14568":0,"14570":0,"14572":0,"14574":0,"14589":0,"14592":0,"14594":0,"14596":0,"14598":0,"14600":0,"14602":0,"14607":0,"14609":0,"14613":0,"14617":0,"14648":0,"14654":0,"14656":0,"14661":0,"14669":0,"14674":0,"14680":0,"14681":0,"14682":0,"14683":0,"14684":0,"14696":0,"14698":0,"14701":0,"14703":0,"14705":0,"14721":0,"14725":0,"14727":0,"14728":0,"14730":0,"14731":0,"14734":0,"14736":0,"14737":0,"14738":0,"14740":0,"14741":0,"14744":0,"14759":0,"14763":0,"14765":0,"14766":0,"14768":0,"14769":0,"14772":0,"14774":0,"14775":0,"14776":0,"14778":0,"14779":0,"14782":0,"14797":0,"14801":0,"14803":0,"14804":0,"14806":0,"14807":0,"14810":0,"14812":0,"14813":0,"14814":0,"14816":0,"14817":0,"14820":0,"14835":0,"14839":0,"14841":0,"14842":0,"14844":0,"14845":0,"14848":0,"14850":0,"14851":0,"14852":0,"14854":0,"14855":0,"14858":0,"14869":0,"14871":0,"14872":0,"14874":0,"14875":0,"14876":0,"14906":0,"14908":0,"14909":0,"14910":0,"14912":0,"14913":0,"14916":0,"14918":0,"14919":0,"14920":0,"14921":0,"14923":0,"14924":0,"14927":0,"14929":0,"14930":0,"14931":0,"14933":0,"14934":0,"14937":0,"14939":0,"14940":0,"14941":0,"14943":0,"14944":0,"14948":0,"14949":0,"14950":0,"14951":0,"14952":0,"14953":0,"14954":0,"14956":0,"14957":0,"14958":0,"14959":0,"14961":0,"14962":0,"14964":0,"14965":0,"14967":0,"14968":0,"14969":0,"14971":0,"14976":0,"14977":0,"14979":0,"14980":0,"14982":0,"14983":0,"14984":0,"14986":0,"14991":0,"14992":0,"14994":0,"14995":0,"14997":0,"14998":0,"14999":0,"15001":0,"15006":0,"15007":0,"15009":0,"15010":0,"15012":0,"15013":0,"15014":0,"15016":0,"15021":0,"15022":0,"15023":0,"15024":0,"15025":0,"15027":0,"15028":0,"15029":0,"15031":0,"15032":0,"15034":0,"15036":0,"15037":0,"15039":0,"15041":0,"15044":0,"15046":0,"15047":0,"15048":0,"15050":0,"15051":0,"15053":0,"15055":0,"15056":0,"15058":0,"15060":0,"15063":0,"15065":0,"15066":0,"15067":0,"15069":0,"15070":0,"15071":0,"15072":0,"15074":0,"15077":0,"15079":0,"15082":0,"15084":0,"15085":0,"15086":0,"15088":0,"15089":0,"15090":0,"15091":0,"15093":0,"15096":0,"15098":0,"15101":0,"15102":0,"15104":0,"15105":0,"15107":0,"15109":0,"15110":0,"15111":0,"15112":0,"15113":0,"15116":0,"15118":0,"15119":0,"15120":0,"15121":0,"15134":0,"15140":0,"15142":0,"15143":0,"15145":0,"15147":0,"15148":0,"15150":0,"15151":0,"15153":0,"15155":0,"15158":0,"15159":0,"15161":0,"15163":0,"15166":0,"15168":0,"15170":0,"15172":0,"15173":0,"15175":0,"15177":0,"15178":0,"15191":0,"15201":0,"15203":0,"15205":0,"15207":0,"15209":0,"15211":0,"15213":0,"15217":0,"15219":0,"15220":0,"15221":0,"15225":0,"15227":0,"15228":0,"15232":0,"15233":0,"15234":0,"15235":0,"15237":0,"15238":0,"15240":0,"15242":0,"15244":0,"15246":0,"15247":0,"15248":0,"15249":0,"15250":0,"15252":0,"15253":0,"15257":0,"15259":0,"15261":0,"15285":0,"15288":0,"15290":0,"15292":0,"15294":0,"15296":0,"15298":0,"15302":0,"15307":0,"15309":0,"15311":0,"15313":0,"15329":0,"15333":0,"15335":0,"15336":0,"15338":0,"15339":0,"15341":0,"15343":0,"15348":0,"15353":0,"15357":0,"15359":0,"15360":0,"15361":0,"15363":0,"15365":0,"15370":0,"15372":0,"15374":0,"15375":0,"15392":0,"15393":0,"15395":0,"15397":0,"15402":0,"15403":0,"15435":0,"15440":0,"15444":0,"15446":0,"15448":0,"15452":0,"15455":0,"15457":0,"15459":0,"15463":0,"15466":0,"15468":0,"15485":0,"15487":0,"15489":0,"15505":0,"15507":0,"15509":0,"15570":0,"15571":0,"15573":0,"15575":0,"15577":0,"15579":0,"15584":0,"15585":0,"15642":0,"15643":0,"15645":0,"15647":0,"15651":0,"15652":0,"15654":0,"15656":0,"15658":0,"15662":0,"15676":0,"15677":0,"15679":0,"15681":0,"15685":0,"15686":0,"15688":0,"15690":0,"15692":0,"15696":0,"15710":0,"15712":0,"15714":0,"15719":0,"15721":0,"15723":0,"15728":0,"15730":0,"15733":0,"15734":0,"15756":0,"15766":0,"15768":0,"15770":0,"15781":0,"15783":0,"15784":0,"15785":0,"15786":0,"15788":0,"15789":0,"15790":0,"15791":0,"15792":0,"15795":0,"15796":0,"15809":0,"15811":0,"15813":0,"15818":0,"15820":0,"15821":0,"15823":0,"15825":0,"15826":0,"15828":0,"15830":0,"15832":0,"15833":0,"15834":0,"15835":0,"15836":0,"15838":0,"15840":0,"15841":0,"15842":0,"15843":0,"15844":0,"15845":0,"15846":0,"15847":0,"15860":0,"15864":0,"15866":0,"15867":0,"15869":0,"15871":0,"15873":0,"15875":0,"15877":0,"15878":0,"15879":0,"15881":0,"15885":0,"15887":0,"15900":0,"15902":0,"15903":0,"15904":0,"15905":0,"15906":0,"15907":0,"15908":0,"15920":0,"15925":0,"15927":0,"15928":0,"15932":0,"15934":0,"15935":0,"15937":0,"15939":0,"15940":0,"15942":0,"15944":0,"15946":0,"15947":0,"15948":0,"15950":0,"15965":0,"15968":0,"15990":0,"16000":0,"16001":0,"16002":0,"16014":0,"16025":0,"16029":0,"16031":0,"16032":0,"16033":0,"16063":0,"16066":0,"16068":0,"16069":0,"16071":0,"16072":0,"16073":0,"16085":0,"16097":0,"16098":0,"16099":0,"16100":0,"16102":0,"16104":0,"16106":0,"16108":0,"16109":0,"16110":0,"16111":0,"16112":0,"16113":0,"16114":0,"16116":0,"16117":0,"16118":0,"16122":0,"16124":0,"16125":0,"16140":0,"16142":0,"16143":0,"16145":0,"16158":0,"16163":0,"16177":0,"16182":0}; _yuitest_coverage["build/charts-base/charts-base.js"].functions = {"ShapeGroup:41":0,"_draw:55":0,"_getRadiusCollection:119":0,"getter:134":0,"setter:160":0,"getter:167":0,"setter:171":0,"getter:177":0,"setter:181":0,"CircleGroup:196":0,"drawShape:210":0,"getter:218":0,"RectGroup:256":0,"drawShape:270":0,"DiamondGroup:286":0,"drawShape:300":0,"EllipseGroup:316":0,"drawShape:330":0,"Renderer:347":0,"getter:358":0,"setter:364":0,"_setStyles:398":0,"(anonymous 2):421":0,"_mergeStyles:414":0,"_getDefaultStyles:442":0,"_getDefaultMargins:474":0,"setTickOffsets:490":0,"drawTick:530":0,"getLineStart:548":0,"getLabelPoint:575":0,"updateMaxLabelSize:587":0,"getExplicitlySized:618":0,"positionTitle:640":0,"positionLabel:672":0,"_setRotationCoords:718":0,"_getTransformOrigin:759":0,"setCalculatedSize:798":0,"_getDefaultMargins:836":0,"setTickOffsets:852":0,"drawTick:892":0,"getLineStart:910":0,"getLabelPoint:938":0,"updateMaxLabelSize:950":0,"getExplicitlySized:981":0,"positionTitle:1003":0,"positionLabel:1035":0,"_setRotationCoords:1086":0,"_getTransformOrigin:1125":0,"offsetNodeForTick:1154":0,"setCalculatedSize:1168":0,"_getDefaultMargins:1203":0,"setTickOffsets:1219":0,"getLineStart:1256":0,"drawTick:1284":0,"getLabelPoint:1303":0,"updateMaxLabelSize:1315":0,"getExplicitlySized:1346":0,"positionTitle:1368":0,"positionLabel:1400":0,"_setRotationCoords:1446":0,"_getTransformOrigin:1483":0,"offsetNodeForTick:1508":0,"setCalculatedSize:1520":0,"_getDefaultMargins:1553":0,"setTickOffsets:1569":0,"getLineStart:1605":0,"drawTick:1634":0,"getLabelPoint:1653":0,"updateMaxLabelSize:1665":0,"getExplicitlySized:1696":0,"positionTitle:1718":0,"positionLabel:1750":0,"_setRotationCoords:1802":0,"_getTransformOrigin:1849":0,"setCalculatedSize:1895":0,"_dataChangeHandler:1952":0,"_positionChangeHandler:1967":0,"_updateGraphic:1980":0,"_updateHandler:2006":0,"renderUI:2018":0,"syncUI:2027":0,"_setCanvas:2060":0,"_getDefaultStyles:2095":0,"_handleSizeChange:2162":0,"drawLine:2201":0,"_getTextRotationProps:2215":0,"_drawAxis:2253":0,"_setTotalTitleSize:2387":0,"_updatePathElement:2426":0,"_setTitle:2454":0,"getLabel:2519":0,"_createLabelCache:2565":0,"_clearLabelCache:2587":0,"getLineEnd:2612":0,"getLength:2634":0,"getFirstPoint:2661":0,"getNextPoint:2687":0,"getLastPoint:2708":0,"getPosition:2731":0,"_rotate:2767":0,"_simulateRotateWithTransformOrigin:2837":0,"getMaxLabelBounds:2854":0,"getMinLabelBounds:2865":0,"_getLabelBounds:2878":0,"_removeChildren:2908":0,"destructor:2928":0,"_setText:2969":0,"getter:3001":0,"setter:3010":0,"getter:3029":0,"setter:3038":0,"getter:3053":0,"setter:3058":0,"getter:3073":0,"setter:3078":0,"getter:3114":0,"getter:3137":0,"setter:3166":0,"getter:3229":0,"getter:3244":0,"validator:3264":0,"getter:3286":0,"setter:3291":0,"value:3326":0,"valueFn:3347":0,"valueFn:3368":0,"initializer:3440":0,"bindUI:3456":0,"_dataProviderChangeHandler:3474":0,"addKey:3576":0,"_getKeyArray:3590":0,"_setDataByKey:3612":0,"_updateTotalData:3634":0,"removeKey:3656":0,"getKeyValueAt:3674":0,"getDataByKey:3692":0,"_updateMinAndMax:3708":0,"getTotalMajorUnits:3744":0,"getMajorUnitDistance:3769":0,"getEdgeOffset:3792":0,"getLabelByIndex:3806":0,"_keyChangeHandler:3824":0,"_hasDataOverflow:3839":0,"getMinimumValue:3855":0,"getMaximumValue:3867":0,"setter:3882":0,"getter:3950":0,"setter:3964":0,"getter:3978":0,"getter:3997":0,"setter:4013":0,"getter:4028":0,"getter:4047":0,"setter:4056":0,"getter:4073":0,"getter:4089":0,"getter:4102":0,"getter:4119":0,"NumericAxis:4147":0,"value:4179":0,"formatLabel:4217":0,"getTotalByKey:4233":0,"_getMinimumUnit:4270":0,"_getNiceNumber:4283":0,"_updateMinAndMax:4313":0,"_roundMinAndMax:4393":0,"getLabelByIndex:4683":0,"_roundToNearest:4722":0,"_roundUpToNearest:4743":0,"_roundDownToNearest:4763":0,"_roundToPrecision:4783":0,"_hasDataOverflow:4799":0,"StackedAxis:4831":0,"_updateMinAndMax:4847":0,"TimeAxis:4934":0,"getter:4954":0,"getter:4972":0,"getter:4986":0,"setter:4995":0,"getter:5009":0,"setter:5018":0,"value:5039":0,"formatLabel:5070":0,"getLabelByIndex:5107":0,"_getKeyArray:5136":0,"_setDataByKey:5190":0,"_getNumber:5246":0,"CategoryAxis:5273":0,"formatLabel:5290":0,"_updateMinAndMax:5327":0,"_getKeyArray:5342":0,"_setDataByKey:5371":0,"getDataByKey:5401":0,"getTotalMajorUnits:5423":0,"getMajorUnitDistance:5437":0,"getEdgeOffset:5460":0,"getKeyValueAt:5473":0,"getLabelByIndex:5493":0,"getMinimumValue:5516":0,"getMaximumValue:5530":0,"CurveUtil:5549":0,"getCurveControlPoints:5563":0,"getControlPoints:5637":0,"StackingUtil:5669":0,"_stackCoordinates:5687":0,"_stackXCoords:5705":0,"_stackYCoords:5786":0,"_cleanXNaN:5872":0,"_getPreviousValidCoordValue:5920":0,"_getNextValidCoordValue:5942":0,"_cleanYNaN:5965":0,"Lines:6013":0,"_getGraphic:6030":0,"_toggleVisible:6048":0,"drawLines:6062":0,"drawSpline:6166":0,"drawDashedLine:6218":0,"_getLineDefaults:6264":0,"getter:6292":0,"setter:6297":0,"Fills:6288":0,"_getPath:6316":0,"_toggleVisible:6334":0,"drawFill:6350":0,"drawAreaSpline:6410":0,"drawStackedAreaSpline:6468":0,"_getClosingPoints:6569":0,"_getHighestValidOrder:6609":0,"_getCoordsByOrderAndIndex:6635":0,"_getStackedClosingPoints:6659":0,"_getAreaDefaults:6781":0,"getter:6801":0,"Plots:6797":0,"drawPlots:6826":0,"_getGroupShape:6929":0,"_getPlotDefaults:6946":0,"getMarker:6998":0,"_createMarker:7039":0,"_createMarkerCache:7057":0,"_createGroupMarker:7082":0,"_toggleVisible:7135":0,"_clearMarkerCache:7161":0,"updateMarkerState:7182":0,"_getItemColor:7215":0,"_setStyles:7232":0,"_parseMarkerStyles:7246":0,"_getState:7272":0,"Histogram:7311":0,"drawSeries:7320":0,"_getPlotDefaults:7491":0,"render:7574":0,"(anonymous 3):7604":0,"(anonymous 4):7611":0,"(anonymous 5):7618":0,"addListeners:7588":0,"_xAxisChangeHandler:7635":0,"_yAxisChangeHandler:7649":0,"_xDataChangeHandler:7672":0,"_yDataChangeHandler:7688":0,"_updateAxisData:7704":0,"validate:7733":0,"_setCanvas:7751":0,"setAreaData:7764":0,"_getFirstValidIndex:7856":0,"_getLastValidIndex:7877":0,"draw:7896":0,"_getDefaultStyles:7948":0,"_getDefaultColor:8003":0,"_handleVisibleChange:8029":0,"getTotalValues:8040":0,"destructor:8052":0,"getter:8186":0,"setter:8191":0,"getter:8205":0,"setter:8210":0,"getter:8227":0,"setter:8232":0,"getter:8256":0,"setter:8261":0,"getter:8328":0,"setter:8368":0,"setter:8382":0,"getter:8423":0,"getter:8438":0,"getter:8480":0,"getter:8497":0,"getter:8524":0,"setter:8536":0,"drawSeries:8563":0,"_setStyles:8577":0,"_getDefaultStyles:8596":0,"drawSeries:8664":0,"_setStyles:8678":0,"_getDefaultStyles:8696":0,"drawSeries:8762":0,"setAreaData:8826":0,"setAreaData:8865":0,"_getMarkerDimensions:8909":0,"updateMarkerState:8935":0,"_getMarkerDimensions:9059":0,"updateMarkerState:9085":0,"drawSeries:9213":0,"_setStyles:9227":0,"_getDefaultStyles:9245":0,"drawSeries:9305":0,"drawSeries:9358":0,"drawSeries:9400":0,"_toggleVisible:9423":0,"_getDefaultStyles:9464":0,"getter:9554":0,"setter:9558":0,"getter:9587":0,"setter:9591":0,"getter:9614":0,"setter:9618":0,"setAreaData:9667":0,"drawSeries:9680":0,"drawSeries:9741":0,"drawSeries:9791":0,"setAreaData:9850":0,"setAreaData:9888":0,"drawSeries:9901":0,"drawSeries:9937":0,"updateMarkerState:10116":0,"_getPlotDefaults:10164":0,"drawSeries:10278":0,"updateMarkerState:10458":0,"_getPlotDefaults:10504":0,"_setMap:10647":0,"addListeners:10699":0,"validate:10724":0,"_categoryAxisChangeHandler:10737":0,"_valueAxisChangeHandler:10751":0,"_categoryDataChangeHandler:10774":0,"_valueDataChangeHandler:10789":0,"draw:10803":0,"drawPlots:10837":0,"_addHotspot:10965":0,"updateMarkerState:11021":0,"_createMarker:11048":0,"_clearMarkerCache:11065":0,"_getPlotDefaults:11088":0,"_getDefaultColor:11155":0,"validator:11212":0,"validator:11228":0,"validator:11244":0,"validator:11259":0,"setter:11272":0,"getter:11278":0,"setter:11291":0,"getter:11297":0,"remove:11367":0,"draw:11382":0,"_drawGridlines:11396":0,"_horizontalLine:11459":0,"_verticalLine:11475":0,"_getDefaultStyles:11489":0,"bindUI:11547":0,"syncUI:11561":0,"getSeriesByIndex:11619":0,"getSeriesByKey:11637":0,"addDispatcher:11656":0,"_parseSeriesCollection:11690":0,"_addSeries:11729":0,"_createSeries:11762":0,"_getSeries:11856":0,"_markerEventHandler:11877":0,"_updateStyles:11902":0,"_sizeChangeHandler:11920":0,"_drawSeries:11963":0,"_drawingCompleteHandler:12003":0,"_getDefaultStyles:12031":0,"destructor:12054":0,"setter:12082":0,"setter:12097":0,"getter:12121":0,"setter:12126":0,"getter:12154":0,"setter:12170":0,"setter:12201":0,"getter:12230":0,"getter:12252":0,"getter:12274":0,"ChartBase:12331":0,"valueFn:12343":0,"setter:12353":0,"getter:12373":0,"setter:12378":0,"setter:12395":0,"setter:12415":0,"setter:12498":0,"_groupMarkersChangeHandler:12585":0,"_itemRendered:12602":0,"(anonymous 6):12624":0,"_getGraph:12618":0,"getSeries:12637":0,"getAxisByKey:12665":0,"getCategoryAxis:12682":0,"_setDataValues:12721":0,"_setSeriesCollection:12762":0,"_getAxisClass:12774":0,"initializer:12806":0,"renderUI:12818":0,"_setAriaElements:12842":0,"_getAriaOffscreenNode:12872":0,"syncUI:12889":0,"(anonymous 7):12913":0,"(anonymous 8):12934":0,"(anonymous 9):12967":0,"bindUI:12898":0,"_markerEventDispatcher:13014":0,"_dataProviderChangeHandler:13155":0,"toggleTooltip:13196":0,"_showTooltip:13218":0,"_positionTooltip:13239":0,"hideTooltip:13258":0,"_addTooltip:13275":0,"_updateTooltip:13298":0,"markerEventHandler:13358":0,"planarEventHandler:13364":0,"_getTooltip:13347":0,"_planarLabelFunction:13411":0,"_tooltipLabelFunction:13476":0,"_tooltipChangeHandler:13506":0,"_setText:13533":0,"_getAllKeys:13558":0,"_buildSeriesKeys:13587":0,"renderUI:13623":0,"_planarEventDispatcher:13666":0,"_addToAxesRenderQueue:13831":0,"_addToAxesCollection:13850":0,"_getDefaultSeriesCollection:13869":0,"_parseSeriesCollection:13888":0,"_parseSeriesAxes:14019":0,"_getCategoryAxis:14052":0,"_getSeriesAxis:14069":0,"_getBaseAttribute:14111":0,"_setBaseAttribute:14135":0,"_setAxes:14155":0,"_addAxes:14271":0,"_addSeries:14328":0,"_addGridlines:14342":0,"_getDefaultAxes:14416":0,"_parseAxes:14434":0,"_getDefaultAxisPosition:14587":0,"getSeriesItems:14646":0,"_sizeChanged:14694":0,"_getTopOverflow:14719":0,"_getRightOverflow:14757":0,"_getLeftOverflow:14795":0,"_getBottomOverflow:14833":0,"_redraw:14867":0,"destructor:15132":0,"_getAriaMessage:15189":0,"getter:15283":0,"setter:15305":0,"getter:15327":0,"setter:15351":0,"getter:15390":0,"setter:15400":0,"getter:15433":0,"setter:15442":0,"setter:15483":0,"setter:15503":0,"getter:15568":0,"setter:15582":0,"getter:15640":0,"setter:15649":0,"getter:15674":0,"setter:15683":0,"getter:15708":0,"setter:15717":0,"_getSeriesCollection:15764":0,"_parseAxes:15807":0,"_addAxes:15858":0,"_addSeries:15898":0,"_parseSeriesAxes:15918":0,"_getDefaultAxes:15963":0,"getSeriesItems:15988":0,"_sizeChanged:16012":0,"_redraw:16023":0,"_tooltipLabelFunction:16061":0,"_getAriaMessage:16083":0,"setter:16138":0,"getter:16156":0,"setter:16161":0,"getter:16175":0,"setter:16180":0,"(anonymous 1):1":0}; _yuitest_coverage["build/charts-base/charts-base.js"].coveredLines = 3961;@@ -20679,4 +20679,4 @@ }); -}, '3.7.2', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});+}, '3.7.3', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});
bundle/charts-base/charts-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -16202,4 +16202,4 @@ }); -}, '3.7.2', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});+}, '3.7.3', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});
bundle/charts-base/charts-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("charts-base",function(e,t){function b(){}function w(e){w.superclass.constructor.apply(this,arguments)}function E(e){E.superclass.constructor.apply(this,arguments)}function S(e){S.superclass.constructor.apply(this,arguments)}function x(e){x.superclass.constructor.apply(this,arguments)}function T(){}function N(){}function C(){}function k(t){var n={area:{getter:function(){return this._defaults||this._getAreaDefaults()},setter:function(t){var n=this._defaults||this._getAreaDefaults();this._defaults=e.merge(n,t)}}};this.addAttrs(n,t),this.get("styles")}function L(e){var t={markers:{getter:function(){return this._markers}}};this.addAttrs(t,e)}function A(){}function O(){}var n=e.config,r=n.win,i=n.doc,s=e.Lang,o=s.isString,u=e.DOM,a,f,l,c,h=e.ClassNameManager.getClassName,p=h("seriesmarker"),d,v,m,g,y;d=function(e){d.superclass.constructor.apply(this,arguments)},d.NAME="shapeGroup",e.extend(d,e.Path,{_draw:function(){var e=this.get("xvalues"),t=this.get("yvalues"),n,r,i,o,u=0,a,f=[],l=this.get("dimensions"),c=l.width,h=l.height,p=l.radius,d=l.yRadius,v=this.get("id"),m=this.node.className,g=s.isArray(c),y=s.isArray(h),b=s.isArray(p),w=s.isArray(d);if(e&&t&&e.length>0){this.clear(),a=e.length;for(;u<a;++u)n=e[u],r=t[u],i=b?p[u]:p,o=w?d[u]:d,!isNaN(n)&&!isNaN(r)&&!isNaN(i)&&(this.drawShape({x:n,y:r,width:g?c[u]:c,height:y?h[u]:h,radius:i,yRadius:o}),this.closePath(),f[u]={id:v+"_"+u,className:m,coords:n-this._left+", "+(r-this._top)+", "+p,shape:"circle"});this._closePath()}},_getRadiusCollection:function(e){var t=0,n=e.length,r=[];for(;t<n;++t)r[t]=e[t]*.5;return r}}),d.ATTRS=e.merge(e.Path.ATTRS,{dimensions:{getter:function(){var e=this._dimensions,t,n,r,i;return e.hasOwnProperty("radius")?e:(r=e.width,i=e.height,t=s.isArray(r)?this._getRadiusCollection(r):r*.5,n=s.isArray(i)?this._getRadiusCollection(i):i*.5,{width:r,height:i,radius:t,yRadius:n})},setter:function(e){return this._dimensions=e,e}},xvalues:{getter:function(){return this._xvalues},setter:function(e){this._xvalues=e}},yvalues:{getter:function(){return this._yvalues},setter:function(e){this._yvalues=e}}}),e.ShapeGroup=d,v=function(e){v.superclass.constructor.apply(this,arguments)},v.NAME="circleGroup",e.extend(v,e.ShapeGroup,{drawShape:function(e){this.drawCircle(e.x,e.y,e.radius)}}),v.ATTRS=e.merge(e.ShapeGroup.ATTRS,{dimensions:{getter:function(){var e=this._dimensions,t,n,r,i;return e.hasOwnProperty("radius")?e:(r=e.width,i=e.height,t=s.isArray(r)?this._getRadiusCollection(r):r*.5,n=t,{width:r,height:i,radius:t,yRadius:n})}}}),v.ATTRS=e.ShapeGroup.ATTRS,e.CircleGroup=v,m=function(e){m.superclass.constructor.apply(this,arguments)},m.NAME="rectGroup",e.extend(m,e.ShapeGroup,{drawShape:function(e){this.drawRect(e.x,e.y,e.width,e.height)}}),m.ATTRS=e.ShapeGroup.ATTRS,e.RectGroup=m,y=function(e){y.superclass.constructor.apply(this,arguments)},y.NAME="diamondGroup",e.extend(y,e.ShapeGroup,{drawShape:function(e){this.drawDiamond(e.x,e.y,e.width,e.height)}}),y.ATTRS=e.ShapeGroup.ATTRS,e.DiamondGroup=y,g=function(e){g.superclass.constructor.apply(this,arguments)},g.NAME="diamondGroup",e.extend(g,e.ShapeGroup,{drawShape:function(e){this.drawEllipse(e.x,e.y,e.width,e.height)}}),g.ATTRS=e.ShapeGroup.ATTRS,e.EllipseGroup=g,b.ATTRS={styles:{getter:function(){return this._styles=this._styles||this._getDefaultStyles(),this._styles},setter:function(e){this._styles=this._setStyles(e)}},graphic:{}},b.NAME="renderer",b.prototype={_styles:null,_setStyles:function(e){var t=this.get("styles");return this._mergeStyles(e,t)},_mergeStyles:function(t,n){n||(n={});var r=e.merge(n,{});return e.Object.each(t,function(e,t,i){n.hasOwnProperty(t)&&s.isObject(e)&&!s.isFunction(e)&&!s.isArray(e)?r[t]=this._mergeStyles(e,n[t]):r[t]=e},this),r},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}}}},e.augment(b,e.Attribute),e.Renderer=b,a=function(){},a.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:4,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("topTickOffset",0),e.set("bottomTickOffset",0);switch(i){case"inside":e.set("rightTickOffset",n),e.set("leftTickOffset",0);break;case"outside":e.set("rightTickOffset",0),e.set("leftTickOffset",n);break;case"cross":e.set("rightTickOffset",r),e.set("leftTickOffset",r);break;default:e.set("rightTickOffset",0),e.set("leftTickOffset",0)}},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:s.left,y:t.y},a={x:o+s.left,y:t.y};r.drawLine(e,u,a)},getLineStart:function(){var e=this.get("styles"),t=e.padding,n=e.majorTicks,r=n.length,i=n.display,s={x:t.left,y:0};return i==="outside"?s.x+=r:i==="cross"&&(s.x+=r/2),s},getLabelPoint:function(e){return{x:e.x-this.get("leftTickOffset"),y:e.y}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=e:s===90?a=t:a=u*e+o*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitWidth){var t=this,n=t._explicitWidth,r=t._totalTitleSize,i=t.get("leftTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=n.right-n.left,o=e.offsetWidth,u=e.offsetHeight,a=o*-0.5+s*.5,f=t.get("height")*.5-u*.5;i.labelWidth=o,i.labelHeight=u,r&&r.left&&(a+=r.left),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("leftTickOffset"),o=this._totalTitleSize,u=t.x+o-s,a=t.y,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=i._maxLabelSize,p=this._labelWidths[r],d=this._labelHeights[r];l===0?(u-=p,a-=d*.5):l===90?u-=p*.5:l===-90?(u-=p*.5,a-=d):(u-=p+d*c/360,a-=d*.5),f.labelWidth=p,f.labelHeight=d,f.x=Math.round(h+u),f.y=Math.round(a),this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r,i,s=e.labelWidth,o=e.labelHeight;t===0?(r=s,i=o*.5):t===90?(i=0,r=s*.5):t===-90?(r=s*.5,i=o):(r=s+o*n/360,i=o*.5),e.x-=r,e.y-=i},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[.5,0]:e===-90?t=[.5,1]:t=[1,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=this.get("graphic"),n=e.get("styles"),r=n.label,i=e.get("leftTickOffset"),s=e._maxLabelSize,o=this._totalTitleSize,u=Math.round(o+i+s+r.margin.right);this._explicitWidth&&(u=this._explicitWidth),this.set("calculatedWidth",u),t.set("x",u-i)}},e.LeftAxisLayout=a,f=function(){},f.prototype={_getDefaultMargins:function(){return{top:0,left:4,right:0,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("topTickOffset",0),e.set("bottomTickOffset",0);switch(i){case"inside":e.set("leftTickOffset",n),e.set("rightTickOffset",0);break;case"outside":e.set("leftTickOffset",0),e.set("rightTickOffset",n);break;case"cross":e.set("rightTickOffset",r),e.set("leftTickOffset",r);break;default:e.set("leftTickOffset",0),e.set("rightTickOffset",0)}},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:s.left,y:t.y},a={x:s.left+o,y:t.y};r.drawLine(e,u,a)},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:n.left,y:n.top};return s==="inside"?o.x+=i:s==="cross"&&(o.x+=i/2),o},getLabelPoint:function(e){return{x:e.x+this.get("rightTickOffset"),y:e.y}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=e:s===90?a=t:a=u*e+o*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitWidth){var t=this,n=t._explicitWidth,r=this._totalTitleSize,i=t.get("rightTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.right-n.left,a=this.get("width")-s*.5-u*.5,f=t.get("height")*.5-o*.5;i.labelWidth=s,i.labelHeight=o,r&&r.right&&(a-=r.left),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("rightTickOffset"),o=n.label,u=0,a=t.x,f=t.y,l=this._labelRotationProps,c=l.rot,h=l.absRot,p=this._labelWidths[r],d=this._labelHeights[r];o.margin&&o.margin.left&&(u=o.margin.left),c===0?f-=d*.5:c===90?(a-=p*.5,f-=d):c===-90?a-=p*.5:(f-=d*.5,a+=d/2*h/90),a+=u,a+=s,l.labelWidth=p,l.labelHeight=d,l.x=Math.round(a),l.y=Math.round(f),this._rotate(e,l)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=0,i=0,s=e.labelWidth,o=e.labelHeight;t===0?i=o*.5:t===90?(r=s*.5,i=o):t===-90?r=s*.5:(i=o*.5,r=o/2*n/90),e.x-=r,e.y-=i},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[.5,1]:e===-90?t=[.5,0]:t=[0,.5],t},offsetNodeForTick:function(e){var t=this,n=t.get("leftTickOffset"),r=0-n;e.setStyle("left",r)},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=this._totalTitleSize,i=Math.round(e.get("rightTickOffset")+e._maxLabelSize+r+n.margin.left);this._explicitWidth&&(i=this._explicitWidth),e.set("calculatedWidth",i),e.get("contentBox").setStyle("width",i)}},e.RightAxisLayout=f,l=function(){},l.prototype={_getDefaultMargins:function(){return{top:4,left:0,right:0,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("topTickOffset",n),e.set("bottomTickOffset",0);break;case"outside":e.set("topTickOffset",0),e.set("bottomTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this.get("styles"),t=e.padding,n=e.majorTicks,r=n.length,i=n.display,s={x:0,y:t.top};return i==="inside"?s.y+=r:i==="cross"&&(s.y+=r/2),s},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y+this.get("bottomTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("bottomTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=n.bottom-n.top,o=e.offsetWidth,u=e.offsetHeight,a=t.get("width")*.5-o*.5,f=t.get("height")-u/2-s/2;i.labelWidth=o,i.labelHeight=u,r&&r.bottom&&(f-=r.bottom),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("bottomTickOffset"),o=n.label,u=0,a=i._labelRotationProps,f=a.rot,l=a.absRot,c=Math.round(t.x),h=Math.round(t.y),p=i._labelWidths[r],d=i._labelHeights[r];o.margin&&o.margin.top&&(u=o.margin.top),f>0?h-=d/2*f/90:f<0?(c-=p,h-=d/2*l/90):c-=p*.5,h+=u,h+=s,a.labelWidth=p,a.labelHeight=d,a.x=c,a.y=h,i._rotate(e,a)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t>0?(s=0,o=i/2*t/90):t<0?(s=r,o=i/2*n/90):(s=r*.5,o=0),e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e>0?t=[0,.5]:e<0?t=[1,.5]:t=[0,0],t},offsetNodeForTick:function(e){var t=this;t.get("contentBox").setStyle("top",0-t.get("topTickOffset"))},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=e._totalTitleSize,i=Math.round(e.get("bottomTickOffset")+e._maxLabelSize+n.margin.top+r);e._explicitHeight&&(i=e._explicitHeight),e.set("calculatedHeight",i)}},e.BottomAxisLayout=l,c=function(){},c.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:0,bottom:4}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("bottomTickOffset",n),e.set("topTickOffset",0);break;case"outside":e.set("bottomTickOffset",0),e.set("topTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:0,y:n.top};return s==="outside"?o.y+=i:s==="cross"&&(o.y+=i/2),o},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y-this.get("topTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("topTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.bottom-n.top,a=t.get("width")*.5-s*.5,f=u/2-o/2;i.labelWidth=s,i.labelHeight=o,r&&r.top&&(f+=r.top),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=this._totalTitleSize,o=i._maxLabelSize,u=t.x,a=t.y+s+o,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=this._labelWidths[r],p=this._labelHeights[r];l===0?(u-=h*.5,a-=p):l===90?(u-=h,a-=p*.5):l===-90?a-=p*.5:l>0?(u-=h,a-=p-p*l/180):a-=p-p*c/180,f.x=Math.round(u),f.y=Math.round(a),f.labelWidth=h,f.labelHeight=p,this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t===0?(s=r*.5,o=i):t===90?(s=r,o=i*.5):t===-90?o=i*.5:t>0?(s=r,o=i-i*t/180):o=i-i*n/180,e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[1,.5]:e===-90?t=[0,.5]:e>0?t=[1,.5]:t=[0,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=e.get("graphic"),n=e.get("styles"),r=n.label.margin,i=r.bottom+e._maxLabelSize,s=e._totalTitleSize,o=this.get("topTickOffset"),u=Math.round(o+i+s);this._explicitHeight&&(u=this._explicitWidth),e.set("calculatedHeight",u),t.set("y",u-o)}},e.TopAxisLayout=c,e.Axis=e.Base.create("axis",e.Widget,[e.Renderer],{_calculatedWidth:0,_calculatedHeight:0,_dataChangeHandler:function(e){this.get("rendered")&&this._drawAxis()},_positionChangeHandler:function(e){this._updateGraphic(e.newVal),this._updateHandler()},_updateGraphic:function(e){var t=this.get("graphic");e=="none"?t&&t.destroy():t||this._setCanvas()},_updateHandler:function(e){this.get("rendered")&&this._drawAxis()},renderUI:function(){this._updateGraphic(this.get("position"))},syncUI:function(){var e=this._layout,t,n,r,i,s;if(e){t=e._getDefaultMargins(),n=this.get("styles"),r=n.label.margin,i=n.title.margin;for(s in t)t.hasOwnProperty(s)&&(r[s]=r[s]===undefined?t[s]:r[s],i[s]=i[s]===undefined?t[s]:i[s])}this._drawAxis()},_setCanvas:function(){var t=this.get("contentBox"),n=this.get("boundingBox"),r=this.get("position"),i=this._parentNode,s=this.get("width"),o=this.get("height");n.setStyle("position","absolute"),n.setStyle("zIndex",2),s=s?s+"px":i.getStyle("width"),o=o?o+"px":i.getStyle("height"),r==="top"||r==="bottom"?t.setStyle("width",s):t.setStyle("height",o),t.setStyle("position","relative"),t.setStyle("left","0px"),t.setStyle("top","0px"),this.set("graphic",new e.Graphic),this.get("graphic").render(t)},_getDefaultStyles:function(){var t={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",alpha:1},majorUnit:{determinant:"count",count:11,distance:75},top:"0px",left:"0px",width:"100px",height:"100px",label:{color:"#808080",alpha:1,fontSize:"85%",rotation:0,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},title:{color:"#808080",alpha:1,fontSize:"85%",rotation:undefined,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},hideOverlappingLabelTicks:!1};return e.merge(e.Renderer.prototype._getDefaultStyles(),t)},_handleSizeChange:function(e){var t=e.attrName,n=this.get("position"),r=n=="left"||n=="right",i=this.get("contentBox"),s=n=="bottom"||n=="top";i.setStyle("width",this.get("width")),i.setStyle("height",this.get("height")),(s&&t=="width"||r&&t=="height")&&this._drawAxis()},_layoutClasses:{top:c,bottom:l,left:a,right:f},drawLine:function(e,t,n){e.moveTo(t.x,t.y),e.lineTo(n.x,n.y)},_getTextRotationProps:function(e){if(e.rotation===undefined)switch(this.get("position")){case"left":e.rotation=-90;break;case"right":e.rotation=90;break;default:e.rotation=0}var t=Math.min(90,Math.max(-90,e.rotation)),n=Math.abs(t),r=Math.PI/180,i=parseFloat(parseFloat(Math.sin(n*r)).toFixed(8)),s=parseFloat(parseFloat(Math.cos(n*r)).toFixed(8));return{rot:t,absRot:n,radCon:r,sinRadians:i,cosRadians:s,textAlpha:e.alpha}},_drawAxis:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;if(this._layout){var e=this.get("styles"),t=e.line,n=e.label,r=e.majorTicks,i=r.display!="none",s,o=e.majorUnit,u,a,f=0,l=this._layout,c,h,p,d,v,m,g=this.get("labelFunction"),y=this.get("labelFunctionScope"),b=this.get("labelFormat"),w=this.get("graphic"),E=this.get("path"),S,x;this._labelWidths=[],this._labelHeights=[],w.set("autoDraw",!1),E.clear(),E.set("stroke",{weight:t.weight,color:t.color,opacity:t.alpha}),this._labelRotationProps=this._getTextRotationProps(n),this._labelRotationProps.transformOrigin=l._getTransformOrigin(this._labelRotationProps.rot),l.setTickOffsets.apply(this),c=this.getLength(),p=l.getLineStart.apply(this),u=this.getTotalMajorUnits(o),a=this.getMajorUnitDistance(u,c,o),this.set("edgeOffset",this.getEdgeOffset(u,c)*.5);if(u<1)this._clearLabelCache();else{s=this.getFirstPoint(p),this.drawLine(E,p,this.getLineEnd(s)),i&&(S=this.get("tickPath"),S.clear(),S.set("stroke",{weight:r.weight,color:r.color,opacity:r.alpha}),l.drawTick.apply(this,[S,s,r])),this._createLabelCache(),this._tickPoints=[],this._maxLabelSize=0,this._totalTitleSize=0,this._titleSize=0,this._setTitle(),x=l.getExplicitlySized.apply(this,[e]);for(;f<u;++f)i&&l.drawTick.apply(this,[S,s,r]),h=this.getPosition(s),d=this.getLabel(s,n),this._labels.push(d),this._tickPoints.push({x:s.x,y:s.y}),this.get("appendLabelFunction")(d,g.apply(y,[this.getLabelByIndex(f,u),b])),v=Math.round(d.offsetWidth),m=Math.round(d.offsetHeight),x||this._layout.updateMaxLabelSize.apply(this,[v,m]),this._labelWidths.push(v),this._labelHeights.push(m),s=this.getNextPoint(s,a);this._clearLabelCache(),this.get("overlapGraph")&&l.offsetNodeForTick.apply(this,[this.get("contentBox")]),l.setCalculatedSize.apply(this),this._titleTextField&&this._layout.positionTitle.apply(this,[this._titleTextField]);for(f=0;f<u;++f)l.positionLabel.apply(this,[this.get("labels")[f],this._tickPoints[f],e,f])}}this._drawing=!1,this._callLater?this._drawAxis():(this._updatePathElement(),this.fire("axisRendered"))},_setTotalTitleSize:function(t){var n=this._titleTextField,r=n.offsetWidth,i=n.offsetHeight,s=this._titleRotationProps.rot,o,u,a=t.margin,f=this.get("position"),l=new e.Matrix;l.rotate(s),o=l.getContentRect(r,i),f=="left"||f=="right"?(u=o.right-o.left,a&&(u+=a.left+a.right)):(u=o.bottom-o.top,a&&(u+=a.top+a.bottom)),this._titleBounds=o,this._totalTitleSize=u},_updatePathElement:function(){var e=this._path,t=this._tickPath,n=!1,r=this.get("graphic");e&&(n=!0,e.end()),t&&(n=!0,t.end()),n&&r._redraw()},_setTitle:function(){var e,t,n,r=this.get("title"),s=this._titleTextField,o;if(r!==null&&r!==undefined){n={rotation:"rotation",margin:"margin",alpha:"alpha"},t=this.get("styles").title,s?i.createElementNS||s.style.filter&&(s.style.filter=null):(s=i.createElement("span"),s.style.display="block",s.style.whiteSpace="nowrap",s.setAttribute("class","axisTitle"),this.get("contentBox").append(s)),s.style.position="absolute";for(e in t)t.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(s.style[e]=t[e]);this.get("appendTitleFunction")(s,r),this._titleTextField=s,this._titleRotationProps=this._getTextRotationProps(t),this._setTotalTitleSize(t)}else s&&(o=s.parentNode,o&&o.removeChild(s),this._titleTextField=null,this._totalTitleSize=0)},getLabel:function(t,n){var r,s,o=this._labelCache,u={rotation:"rotation",margin:"margin",alpha:"alpha"};o&&o.length>0?s=o.shift():(s=i.createElement("span"),s.className=e.Lang.trim([s.className,"axisLabel"].join(" ")),this.get("contentBox").append(s)),i.createElementNS||s.style.filter&&(s.style.filter=null),s.style.display="block",s.style.whiteSpace="nowrap",s.style.position="absolute";for(r in n)n.hasOwnProperty(r)&&!u.hasOwnProperty(r)&&(s.style[r]=n[r]);return s},_createLabelCache:function(){if(this._labels)while(this._labels.length>0)this._labelCache.push(this._labels.shift());else this._clearLabelCache();this._labels=[]},_clearLabelCache:function(){if(this._labelCache){var t=this._labelCache.length,n=0,r;for(;n<t;++n)r=this._labelCache[n],this._removeChildren(r),e.Event.purgeElement(r,!0),r.parentNode.removeChild(r)}this._labelCache=[]},getLineEnd:function(e){var t=this.get("width"),n=this.get("height"),r=this.get("position");return r==="top"||r==="bottom"?{x:t,y:e.y}:{x:e.x,y:n}},getLength:function(){var e,t=this.get("styles"),n=t.padding,r=this.get("width"),i=this.get("height"),s=this.get("position");return s==="top"||s==="bottom"?e=r-(n.left+n.right):e=i-(n.top+n.bottom),e},getFirstPoint:function(e){var t=this.get("styles"),n=this.get("position"),r=t.padding,i={x:e.x,y:e.y};return n==="top"||n==="bottom"?i.x+=r.left+this.get("edgeOffset"):i.y+=this.get("height")-(r.top+this.get("edgeOffset")),i},getNextPoint:function(e,t){var n=this.get("position");return n==="top"||n==="bottom"?e.x=e.x+t:e.y=e.y-t,e},getLastPoint:function(){var e=this.get("styles"),t=e.padding,n=this.get("width"),r=this.get("position");return r==="top"||r==="bottom"?{x:n-t.right,y:t.top}:{x:t.left,y:t.top}},getPosition:function(e){var t,n=this.get("height"),r=this.get("styles"),i=r.padding,s=this.get("position"),o=this.get("dataType");return s==="left"||s==="right"?o==="numeric"?t=n-(i.top+i.bottom)-(e.y-i.top):t=e.y-i.top:t=e.x-i.left,t},_rotate:function(t,n){var r=n.rot,o=n.x,a=n.y,f,l,c=new e.Matrix,h=n.transformOrigin||[0,0],p;i.createElementNS?(c.translate(o,a),c.rotate(r),u.setStyle(t,"transformOrigin",h[0]*100+"% "+h[1]*100+"%"),u.setStyle(t,"transform",c.toCSSText())):(l=n.textAlpha,s.isNumber(l)&&l<1&&l>-1&&!isNaN(l)&&(f="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(l*100)+")"),r!==0?(c.rotate(r),p=c.getContentRect(n.labelWidth,n.labelHeight),c.init(),c.translate(p.left,p.top),c.translate(o,a),this._simulateRotateWithTransformOrigin(c,r,h,n.labelWidth,n.labelHeight),f?f+=" ":f="",f+=c.toFilterText(),t.style.left=c.dx+"px",t.style.top=c.dy+"px"):(t.style.left=o+"px",t.style.top=a+"px"),f&&(t.style.filter=f))},_simulateRotateWithTransformOrigin:function(e,t,n,r,i){var s=n[0]*r,o=n[1]*i;s=isNaN(s)?0:s,o=isNaN(o)?0:o,e.translate(s,o),e.rotate(t),e.translate(-s,-o)},getMaxLabelBounds:function(){return this._getLabelBounds(this.getMaximumValue())},getMinLabelBounds:function(){return this._getLabelBounds(this.getMinimumValue())},_getLabelBounds:function(t){var n=this._layout,r=this.get("styles").label,i=new e.Matrix,s,o=this._getTextRotationProps(r);return o.transformOrigin=n._getTransformOrigin(o.rot),s=this.getLabel({x:0,y:0},r),this.get("appendLabelFunction")(s,this.get("labelFunction").apply(this,[t,this.get("labelFormat")])),o.labelWidth=s.offsetWidth,o.labelHeight=s.offsetHeight,this._removeChildren(s),e.Event.purgeElement(s,!0),s.parentNode.removeChild(s),o.x=0,o.y=0,n._setRotationCoords(o),i.translate(o.x,o.y),this._simulateRotateWithTransformOrigin(i,o.rot,o.transformOrigin,o.labelWidth,o.labelHeight),i.getContentRect(o.labelWidth,o.labelHeight)},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},destructor:function(){var e=this.get("contentBox").getDOMNode(),t=this.get("labels"),n=this.get("graphic"),r,i=t?t.length:0;if(i>0)while(t.length>0)r=t.shift(),this._removeChildren(r),e.removeChild(r),r=null;n&&n.destroy()},_maxLabelSize:0,_setText:function(e,t){e.innerHTML="",s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)}},{ATTRS:{width:{lazyAdd:!1,getter:function(){return this._explicitWidth?this._explicitWidth:this._calculatedWidth},setter:function(e){return this._explicitWidth=e,e}},height:{lazyAdd:!1,getter:function(){return this._explicitHeight?this._explicitHeight:this._calculatedHeight},setter:function(e){return this._explicitHeight=e,e}},calculatedWidth:{getter:function(){return this._calculatedWidth},setter:function(e){return this._calculatedWidth=e,e}},calculatedHeight:{getter:function(){return this._calculatedHeight},setter:function(e){return this._calculatedHeight=e,e}},edgeOffset:{value:0},graphic:{},path:{readOnly:!0,getter:function(){if(!this._path){var e=this.get("graphic");e&&(this._path=e.addShape({type:"path"}))}return this._path}},tickPath:{readOnly:!0,getter:function(){if(!this._tickPath){var e=this.get("graphic");e&&(this._tickPath=e.addShape({type:"path"}))}return this._tickPath}},node:{},position:{setter:function(e){var t=this._layoutClasses[e];return e&&e!="none"&&(this._layout=new t),e}},topTickOffset:{value:0},bottomTickOffset:{value:0},leftTickOffset:{value:0},rightTickOffset:{value:0},labels:{readOnly:!0,getter:function(){return this._labels}},tickPoints:{readOnly:!0,getter:function(){return this.get("position")=="none"?this.get("styles").majorUnit.count:this._tickPoints}},overlapGraph:{value:!0,validator:function(e){return s.isBoolean(e)}},labelFunctionScope:{},maxLabelSize:{getter:function(){return this._maxLabelSize},setter:function(e){return this._maxLabelSize=e,e}},title:{value:null},labelFunction:{value:function(e,t){return e}},appendLabelFunction:{valueFn:function(){return this._setText}},appendTitleFunction:{valueFn:function(){return this._setText}}}}),e.AxisType=e.Base.create("baseAxis",e.Axis,[],{initializer:function(){this.after("dataReady",e.bind(this._dataChangeHandler,this)),this.after("dataUpdate",e.bind(this._dataChangeHandler,this)),this.after("minimumChange",e.bind(this._keyChangeHandler,this)),this.after("maximumChange",e.bind(this._keyChangeHandler,this)),this.after("keysChange",this._keyChangeHandler),this.after("dataProviderChange",this._dataProviderChangeHandler),this.after("alwaysShowZeroChange",this._keyChangeHandler),this.after("roundingMethodChange",this._keyChangeHandler)},bindUI:function(){this.after("stylesChange",this._updateHandler),this.after("overlapGraphChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange),this.after("calculatedWidthChange",this._handleSizeChange),this.after("calculatedHeightChange",this._handleSizeChange)},_dataProviderChangeHandler:function(e){var t=this.get("keyCollection").concat(),n=this.get("keys"),r;if(n)for(r in n)n.hasOwnProperty(r)&&delete n[r];t&&t.length&&this.set("keys",t)},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:!0,_dataReady:!1,addKey:function(e){this.set("keys",e)},_getKeyArray:function(e,t){var n=0,r,i=[],s=t.length;for(;n<s;++n)r=t[n],i[n]=r[e];return i},_setDataByKey:function(e,t){var n,r,i=[],s=this._dataClone.concat(),o=s.length;for(n=0;n<o;++n)r=s[n],i[n]=r[e];this.get("keys")[e]=i,this._updateTotalDataFlag=!0},_updateTotalData:function(){var e=this.get("keys"),t;this._data=[];for(t in e)e.hasOwnProperty(t)&&(this._data=this._data.concat(e[t]));this._updateTotalDataFlag=!1},removeKey:function(e){var t=this.get("keys");t.hasOwnProperty(e)&&(delete t[e],this._keyChangeHandler())},getKeyValueAt:function(e,t){var n=NaN,r=this.get("keys");return r[e]&&s.isNumber(parseFloat(r[e][t]))&&(n=r[e][t]),parseFloat(n)},getDataByKey:function(e){var t=this.get("keys");return t[e]?t[e]:null},_updateMinAndMax:function(){var e=this.get("data"),t=0,n=0,r,i,s;if(e&&e.length&&e.length>0){r=e.length,t=n=e[0];if(r>1)for(s=1;s<r;s++){i=e[s];if(isNaN(i))continue;t=Math.max(i,t),n=Math.min(i,n)}}this._dataMaximum=t,this._dataMinimum=n},getTotalMajorUnits:function(){var e,t=this.get("styles").majorUnit,n=this.get("length");return t.determinant==="count"?e=t.count:t.determinant==="distance"&&(e=n/t.distance+1),e},getMajorUnitDistance:function(e,t,n){var r;return n.determinant==="count"?r=t/(e-1):n.determinant==="distance"&&(r=n.distance),r},getEdgeOffset:function(e,t){return 0},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s;return t-=1,s=n+e*i,s},_keyChangeHandler:function(e){this._updateMinAndMax(),this.fire("dataUpdate")},_hasDataOverflow:function(){return this.get("setMin")||this.get("setMax")?!0:!1},getMinimumValue:function(){return this.get("minimum")},getMaximumValue:function(){return this.get("maximum")}},{ATTRS:{keys:{value:{},setter:function(e){var t={},n,r,i=this.get("dataProvider");if(s.isArray(e)){r=e.length;for(n=0;n<r;++n)t[e[n]]=this._getKeyArray(e[n],i)}else if(s.isString(e))t=this.get("keys"),t[e]=this._getKeyArray(e,i);else for(n in e)e.hasOwnProperty(n)&&(t[n]=this._getKeyArray(n,i));return this._updateTotalDataFlag=!0,t}},roundingMethod:{value:"niceNumber"},type:{readOnly:!0,getter:function(){return this._type}},dataProvider:{setter:function(e){return e}},dataMaximum:{getter:function(){return this._dataMaximum||this._updateMinAndMax(),this._dataMaximum}},maximum:{lazyAdd:!1,getter:function(){var e=this.get("dataMaximum"),t=this.get("minimum");return t===0&&e===0&&(e=10),s.isNumber(this._setMaximum)&&(e=this._setMaximum),parseFloat(e)},setter:function(e){return this._setMaximum=parseFloat(e),e}},dataMinimum:{getter:function(){return this._dataMinimum||this._updateMinAndMax(),this._dataMinimum}},minimum:{lazyAdd:!1,getter:function(){var e=this.get("dataMinimum");return s.isNumber(this._setMinimum)&&(e=this._setMinimum),parseFloat(e)},setter:function(e){return this._setMinimum=parseFloat(e),e}},setMax:{readOnly:!0,getter:function(){return s.isNumber(this._setMaximum)}},setMin:{readOnly:!0,getter:function(){return s.isNumber(this._setMinimum)}},data:{getter:function(){return(!this._data||this._updateTotalDataFlag)&&this._updateTotalData(),this._data}},keyCollection:{getter:function(){var e=this.get("keys"),t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},readOnly:!0}}}),w.NAME="numericAxis",w.ATTRS={alwaysShowZero:{value:!0},labelFunction:{value:function(t,n){return n?e.DataType.Number.format(t,n):t}},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}}},e.extend(w,e.AxisType,{formatLabel:function(t,n){return n?e.DataType.Number.format(t,n):t},getTotalByKey:function(e){var t=0,n=this.getDataByKey(e),r=0,i,s=n?n.length:0;for(;r<s;++r)i=parseFloat(n[r]),isNaN(i)||(t+=i);return t},_type:"numeric",_getMinimumUnit:function(e,t,n){return this._getNiceNumber(Math.ceil((e-t)/n))},_getNiceNumber:function(e){var t=e,n=Math.ceil(Math.log(t)*.4342944819032518),r=Math.pow(10,n),i;return r/2>=t?(i=Math.floor((r/2-t)/(Math.pow(10,n-1)/2)),t=r/2-i*Math.pow(10,n-1)/2):t=r,isNaN(t)?e:t},_updateMinAndMax:function(){var e=this.get("data"),t,n,r,i,o=0,u,a=this.get("setMax"),f=this.get("setMin");if(!a||!f){if(e&&e.length&&e.length>0){r=e.length;for(;o<r;o++){i=e[o];if(isNaN(i)){if(s.isObject(i)){n=t=0;for(u in i)i.hasOwnProperty(u)&&(t=Math.max(i[u],t),n=Math.min(i[u],n))}t=a?this._setMaximum:t,n=f?this._setMinimum:n;continue}f?n=this._setMinimum:n===undefined?n=i:n=Math.min(i,n),a?t=this._setMaximum:t===undefined?t=i:t=Math.max(i,t),this._actualMaximum=t,this._actualMinimum=n}}this._roundMinAndMax(n,t,f,a)}},_roundMinAndMax:function(e,t,n,r){var i,s,o=e>=0,u=t>0,a,f,l,c,h,p,d,v=this.getTotalMajorUnits()-1,m=this.get("alwaysShowZero"),g=this.get("roundingMethod"),y=(t-e)/v>=1;if(g)if(g=="niceNumber"){i=this._getMinimumUnit(t,e,v);if(o&&u)(m||e<i)&&!n?(e=0,i=this._getMinimumUnit(t,e,v)):e=this._roundDownToNearest(e,i),r?m||(e=t-i*v):n?t=e+i*v:t=this._roundUpToNearest(t,i);else if(u&&!o)if(m){c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;if(n){while(d<p&&h>=0)h--,c++,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;h>0?t=d*c:t=e+i*v}else if(r){while(p<d&&c>=0)h++,c--,d=Math.floor(e/h)*-1,p=Math.ceil(t/c);c>0?e=p*h*-1:e=t-i*v}else i=Math.max(p,d),i=this._getNiceNumber(i),t=i*c,e=i*h*-1}else r?e=t-i*v:n?t=e+i*v:(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i));else n?m?t=0:t=e+i*v:r?e=t-i*v:m||t===0||t+i>0?(t=0,i=this._getMinimumUnit(t,e,v),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))}else g=="auto"?o&&u?((m||e<(t-e)/v)&&!n&&(e=0),i=(t-e)/v,y&&(i=Math.ceil(i)),t=e+i*v):u&&!o?m?(c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,y?(p=Math.ceil(t/c),d=Math.floor(e/h)*-1):(p=t/c,d=e/h*-1),i=Math.max(p,d),t=i*c,e=i*h*-1):(i=(t-e)/v,y&&(i=Math.ceil(i)),e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i)):(i=(t-e)/v,y&&(i=Math.ceil(i)),m||t===0||t+i>0?(t=0,i=(t-e)/v,y&&Math.ceil(i),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))):!isNaN(g)&&isFinite(g)&&(i=g,s=i*v,a=t-e>s,l=this._roundDownToNearest(e,i),f=this._roundUpToNearest(t,i),r?e=t-s:n?t=e+s:o&&u?(m||l<=0?e=0:e=l,t=e+s):u&&!o?(e=l,t=f):(m||f>=0?t=0:t=f,e=t-s));this._dataMaximum=t,this._dataMinimum=e},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s,o=this.get("roundingMethod");return t-=1,e===0?s=n:e===t?s=r:(s=e*i,o=="niceNumber"&&(s=this._roundToNearest(s,i)),s+=n),parseFloat(s)},_roundToNearest:function(e,t){t=t||1;if(t===0)return e;var n=Math.round(this._roundToPrecision(e/t,10))*t;return this._roundToPrecision(n,10)},_roundUpToNearest:function(e,t){return t=t||1,t===0?e:Math.ceil(this._roundToPrecision(e/t,10))*t},_roundDownToNearest:function(e,t){return t=t||1,t===0?e:Math.floor(this._roundToPrecision(e/t,10))*t},_roundToPrecision:function(e,t){t=t||0;var n=Math.pow(10,t);return Math.round(n*e)/n},_hasDataOverflow:function(){var e,t,n;return this.get("setMin")||this.get("setMax")?!0:(e=this.get("roundingMethod"),t=this._actualMinimum,n=this._actualMaximum,s.isNumber(e)&&(s.isNumber(n)&&n>this._dataMaximum||s.isNumber(t)&&t<this._dataMinimum)?!0:!1)}}),e.NumericAxis=w,E.NAME="stackedAxis",e.extend(E,e.NumericAxis,{_updateMinAndMax:function(){var e=0,t=0,n=0,r=0,i=0,s=0,o,u,a=this.get("keys"),f=this.get("setMin"),l=this.get("setMax");for(o in a)a.hasOwnProperty(o)&&(i=Math.max(i,a[o].length));for(;s<i;++s){n=0,r=0;for(o in a)if(a.hasOwnProperty(o)){u=a[o][s];if(isNaN(u))continue;u>=0?n+=u:r+=u}n>0?e=Math.max(e,n):e=Math.max(e,r),r<0?t=Math.min(t,r):t=Math.min(t,n)}this._actualMaximum=e,this._actualMinimum=t,l&&(e=this._setMaximum),f&&(t=this._setMinimum),this._roundMinAndMax(t,e,f,l)}}),e.StackedAxis=E,S.NAME="timeAxis",S.ATTRS={setMax:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)}},setMin:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)}},maximum:{getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMaximum"))),parseFloat(e)},setter:function(e){return this._setMaximum=this._getNumber(e),e}},minimum:{getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMinimum"))),parseFloat(e)},setter:function(e){return this._setMinimum=this._getNumber(e),e}},labelFunction:{value:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t}},labelFormat:{value:"%b %d, %y"}},e.extend(S,e.AxisType,{formatLabel:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t},GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=this.get("position"),s,o;return t-=1,s=(r-n)/t*e,i=="bottom"||i=="top"?o=n+s:o=r-s,o},_getKeyArray:function(e,t){var n,r=[],i=0,o,u=t.length;for(;i<u;++i)n=t[i][e],s.isDate(n)?o=n.valueOf():(o=new Date(n),s.isDate(o)?o=o.valueOf():s.isNumber(n)?o=n:s.isNumber(parseFloat(n))?o=parseFloat(n):(typeof n!="string"&&(n=n),o=(new Date(n)).valueOf())),r[i]=o;return r},_setDataByKey:function(e,t){var n,r=[],i=this._dataClone.concat(),o,u,a=i.length;for(o=0;o<a;++o)n=i[o][e],s.isDate(n)?u=n.valueOf():(u=new Date(n),s.isDate(u)?u=u.valueOf():s.isNumber(n)?u=n:s.isNumber(parseFloat(n))?u=parseFloat(n):(typeof n!="string"&&(n=n.toString()),u=(new Date(n)).valueOf())),r[o]=u;this.get("keys")[e]=r,this._updateTotalDataFlag=!0},_getNumber:function(e){return s.isDate(e)?e=e.valueOf():!s.isNumber(e)&&e&&(e=(new Date(e)).valueOf()),e}}),e.TimeAxis=S,x.NAME="categoryAxis",e.extend(x,e.AxisType,{formatLabel:function(e,t){return e},_indices:null,GUID:"yuicategoryaxis",_type:"category",_updateMinAndMax:function(){this._dataMaximum=Math.max(this.get("data").length-1,0),this._dataMinimum=0},_getKeyArray:function(e,t){var n=0,r,i=[],s=[],o=t.length;this._indices||(this._indices={});for(;n<o;++n)r=t[n],i[n]=n,s[n]=r[e];return this._indices[e]=i,s},_setDataByKey:function(e){var t,n,r=[],i=[],s=this._dataClone.concat(),o=s.length;this._indices||(this._indices={});for(t=0;t<o;++t)n=s[t],r[t]=t,i[t]=n[e];this._indices[e]=r,this.get("keys")[e]=i.concat(),this._updateTotalDataFlag=!0},getDataByKey:function(e){this._indices||this.get("keys");var t=this._indices;return t[e]?t[e]:null},getTotalMajorUnits:function(e,t){return this.get("data").length},getMajorUnitDistance:function(e,t,n){var r;return n.determinant==="count"?r=t/e:n.determinant==="distance"&&(r=n.distance),r},getEdgeOffset:function(e,t){return t/e},getKeyValueAt:function(e,t){var n=NaN,r=this.get("keys");return r[e]&&r[e][t]&&(n=r[e][t]),n},getLabelByIndex:function(e,t){var n,r=this.get("data"),i=this.get("position");return i=="bottom"||i=="top"?n=r[e]:n=r[t-(e+1)],n},getMinimumValue:function(){var e=this.get("data"),t=e[0];return t},getMaximumValue:function(){var e=this.get("data"),t=e.length-1,n=e[t];return n}}),e.CategoryAxis=x,T.prototype={getCurveControlPoints:function(e,t){var n=[],r=1,i=e.length-1,s=[],o=[];if(i<1)return null;n[0]={startx:e[0],starty:t[0],endx:e[1],endy:t[1]};if(i===1)return n[0].ctrlx1=(2*e[0]+e[1])/3,n[0].ctrly2=(2*t[0]+t[1])/3,n[0].ctrlx2=2*n[0].ctrlx1-e[0],n[0].ctrly2=2*n[0].ctrly1-t[0],n;for(;r<i;++r)n.push({startx:Math.round(e[r]),starty:Math.round(t[r]),endx:Math.round(e[r+1]),endy:Math.round(t[r+1])}),s[r]=4*e[r]+2*e[r+1],o[r]=4*t[r]+2*t[r+1];s[0]=e[0]+2*e[1],s[i-1]=(8*e[i-1]+e[i])/2,s=this.getControlPoints(s.concat()),o[0]=t[0]+2*t[1],o[i-1]=(8*t[i-1]+t[i])/2,o=this.getControlPoints(o.concat());for(r=0;r<i;++r)n[r].ctrlx1=Math.round(s[r]),n[r].ctrly1=Math.round(o[r]),r<i-1?(n[r].ctrlx2=Math.round(2*e[r+1]-s[r+1]),n[r].ctrly2=Math.round(2*t[r+1]-o[r+1])):(n[r].ctrlx2=Math.round((e[i]+s[i-1])/2),n[r].ctrly2=Math.round((t[i]+o[i-1])/2));return n},getControlPoints:function(e){var t=e.length,n=[],r=[],i=2,s=1;n[0]=e[0]/i;for(;s<t;++s)r[s]=1/i,i=(s<t-1?4:3.5)-r[s],n[s]=(e[s]-n[s-1])/i;for(s=1;s<t;++s)n[t-s-1]-=r[t-s]*n[t-s];return n}},e.CurveUtil=T,N.prototype={_stacked:!0,_stackCoordinates:function(){this.get("direction")=="vertical"?this._stackXCoords():this._stackYCoords()},_stackXCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.seriesTypes[t],i=0,o=this.get("xcoords"),u=this.get("ycoords"),a,f,l,c,h=o.concat(),p,d,v=[],m;e>0?(p=r[e-1].get("stackedXCoords"),d=r[e-1].get("stackedYCoords"),a=p.length):a=o.length;for(;i<a;i+=1)if(s.isNumber(o[i])){if(e>0){l=p[i];if(!s.isNumber(l)){c=e;while(c>-1&&!s.isNumber(l))c-=1,c>-1?l=r[c].get("stackedXCoords")[i]:l=this._leftOrigin}o[i]=o[i]+l}h[i]=o[i]}else v.push(i);this._cleanXNaN(h,u),a=v.length;if(a>0)for(i=0;i<a;i+=1)m=v[i],f=e>0?p[m]:this._leftOrigin,h[m]=Math.max(h[m],f);this.set("stackedXCoords",h),this.set("stackedYCoords",u)},_stackYCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.get("height"),i=n.seriesTypes[t],o=0,u=this.get("xcoords"),a=this.get("ycoords"),f,l,c,h,p=a.concat(),d,v,m=[],g;e>0?(d=i[e-1].get("stackedXCoords"),v=i[e-1].get("stackedYCoords"),f=v.length):f=a.length;for(;o<f;o+=1)if(s.isNumber(a[o])){if(e>0){c=v[o];if(!s.isNumber(c)){h=e;while(h>-1&&!s.isNumber(c))h-=1,h>-1?c=i[h].get("stackedYCoords")[o]:c=this._bottomOrigin}a[o]=c-(r-a[o])}p[o]=a[o]}else m.push(o);this._cleanYNaN(u,p),f=m.length;if(f>0)for(o=0;o<f;o+=1)g=m[o],l=e>0?v[g]:r,p[g]=Math.min(p[g],l);this.set("stackedXCoords",u),this.set("stackedYCoords",p)},_cleanXNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=t.length;for(;p<d;++p)u=e[p],a=t[p],!c(u)&&p>0&&p<d-1&&(o=t[p-1],i=this._getPreviousValidCoordValue(e,p),l=t[p+1],f=this._getNextValidCoordValue(e,p),c(i)&&c(f)&&(h=(l-o)/(f-i),e[p]=(a+h*i-o)/h),n=NaN,r=NaN)},_getPreviousValidCoordValue:function(e,t){var n,r=s.isNumber,i=-1;while(!r(n)&&t>i)t-=1,n=e[t];return n},_getNextValidCoordValue:function(e,t){var n,r=s.isNumber,i=e.length;while(!r(n)&&t<i)t+=1,n=e[t];return n},_cleanYNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=e.length;for(;p<d;++p)u=e[p],a=t[p],!c(a)&&p>0&&p<d-1&&(i=e[p-1],o=this._getPreviousValidCoordValue(t,p),f=e[p+1],l=this._getNextValidCoordValue(t,p),c(o)&&c(l)&&(h=(l-o)/(f-i),t[p]=o+(h*u-h*i)),n=NaN,r=NaN)}},e.StackingUtil=N,C.prototype={_lineDefaults:null,_getGraphic:function(){var e=this.get("graphic")||this.get("graph").get("graphic");return this._lineGraphic||(this._lineGraphic=e.addShape({type:"path"})),this._lineGraphic.clear(),this._lineGraphic},_toggleVisible:function(e){this._lineGraphic&&this._lineGraphic.set("visible",e)},drawLines:function(){if(this.get("xcoords").length<1)return;var e=s.isNumber,t,n,r=this.get("direction"),i,o,u,a=!0,f,l,c,h,p,d=this.get("styles").line,v=d.lineType,m=d.color||this._getDefaultColor(this.get("graphOrder"),"line"),g=d.alpha,y=d.dashLength,b=d.gapSpace,w=d.connectDiscontinuousPoints,E=d.discontinuousType,S=d.discontinuousDashLength,x=d.discontinuousGapSpace,T=this._getGraphic();this._stacked?(t=this.get("stackedXCoords"),n=this.get("stackedYCoords")):(t=this.get("xcoords"),n=this.get("ycoords")),i=r==="vertical"?n.length:t.length,T.set("stroke",{weight:d.weight,color:m,opacity:g});for(p=0;p<i;p=++p){c=t[p],h=n[p],u=e(c)&&e(h);if(!u){o=u;continue}a?(a=!1,T.moveTo(c,h)):o?v!="dashed"?T.lineTo(c,h):this.drawDashedLine(T,f,l,c,h,y,b):w?E!="solid"?this.drawDashedLine(T,f,l,c,h,S,x):T.lineTo(c,h):T.moveTo(c,h),f=c,l=h,o=!0}T.end()},drawSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n=this.getCurveControlPoints(e,t),r=n.length,i,s,o,u,a,f,l=0,c=this.get("styles").line,h=this._getGraphic(),p=c.alpha,d=c.color||this._getDefaultColor(this.get("graphOrder"),"line");h.set("stroke",{weight:c.weight,color:d,opacity:p}),h.moveTo(e[0],t[0]);for(;l<r;l=++l)a=n[l].endx,f=n[l].endy,i=n[l].ctrlx1,s=n[l].ctrlx2,o=n[l].ctrly1,u=n[l].ctrly2,h.curveTo(i,o,s,u,a,f);h.end()},drawDashedLine:function(e,t,n,r,i,s,o){s=s||10,o=o||10;var u=s+o,a=r-t,f=i-n,l=Math.sqrt(Math.pow(a,2)+Math.pow(f,2)),c=Math.floor(Math.abs(l/u)),h=Math.atan2(f,a),p=t,d=n,v;a=Math.cos(h)*u,f=Math.sin(h)*u;for(v=0;v<c;++v)e.moveTo(p,d),e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s),p+=a,d+=f;e.moveTo(p,d),l=Math.sqrt((r-p)*(r-p)+(i-d)*(i-d)),l>s?e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&e.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),e.moveTo(r,i)},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:!0,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10}}},e.augment(C,e.Attribute),e.Lines=C,k.prototype={_getPath:function(){var e=this._path;return e||(e=this.get("graph").get("graphic").addShape({type:"path"}),this._path=e),e},_toggleVisible:function(e){this._path&&this._path.set("visible",e)},drawFill:function(e,t){if(e.length<1)return;var n=s.isNumber,r=e.length,i=e[0],o=t[0],u=i,a=o,f,l,c,h=!0,p=0,d=this.get("styles").area,v=this._getPath(),m=d.color||this._getDefaultColor(this.get("graphOrder"),"slice");v.clear(),v.set("fill",{color:m,opacity:d.alpha}),v.set("stroke",{weight:0});for(;p<r;p=++p){f=e[p],l=t[p],c=n(f)&&n(l);if(!c)continue;h?(this._firstValidX=f,this._firstValidY=l,h=!1,v.moveTo(f,l)):v.lineTo(f,l),u=f,a=l}this._lastValidX=u,this._lastValidY=a,v.end()},drawAreaSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n=this.getCurveControlPoints(e,t),r=n.length,i,s,o,u,a,f,l=0,c=e[0],h=t[0],p=this.get("styles").area,d=this._getPath(),v=p.color||this._getDefaultColor(this.get("graphOrder"),"slice");d.set("fill",{color:v,opacity:p.alpha}),d.set("stroke",{weight:0}),d.moveTo(c,h);for(;l<r;l=++l)a=n[l].endx,f=n[l].endy,i=n[l].ctrlx1,s=n[l].ctrlx2,o=n[l].ctrly1,u=n[l].ctrly2,d.curveTo(i,o,s,u,a,f);this.get("direction")==="vertical"?(d.lineTo(this._leftOrigin,f),d.lineTo(this._leftOrigin,h)):(d.lineTo(a,this._bottomOrigin),d.lineTo(c,this._bottomOrigin)),d.lineTo(c,h),d.end()},drawStackedAreaSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n,r=this.get("order"),i=this.get("type"),s=this.get("graph"),o=s.seriesTypes[i],u,a,f,l,c,h,p,d,v,m=0,g,y,b=this.get("styles").area,w=this._getPath(),E=b.color||this._getDefaultColor(this.get("graphOrder"),"slice");g=e[0],y=t[0],n=this.getCurveControlPoints(e,t),f=n.length,w.set("fill",{color:E,opacity:b.alpha}),w.set("stroke",{weight:0}),w.moveTo(g,y);for(;m<f;m=++m)d=n[m].endx,v=n[m].endy,l=n[m].ctrlx1,c=n[m].ctrlx2,h=n[m].ctrly1,p=n[m].ctrly2,w.curveTo(l,h,c,p,d,v);if(r>0){u=o[r-1].get("xcoords").concat().reverse(),a=o[r-1].get("ycoords").concat().reverse(),n=this.getCurveControlPoints(u,a),m=0,f=n.length,w.lineTo(u[0],a[0]);for(;m<f;m=++m)d=n[m].endx,v=n[m].endy,l=n[m].ctrlx1,c=n[m].ctrlx2,h=n[m].ctrly1,p=n[m].ctrly2,w.curveTo(l,h,c,p,d,v)}else this.get("direction")==="vertical"?(w.lineTo(this._leftOrigin,t[t.length-1]),w.lineTo(this._leftOrigin,y)):(w.lineTo(e[e.length-1],this._bottomOrigin),w.lineTo(g,this._bottomOrigin));w.lineTo(g,y),w.end()},_defaults:null,_getClosingPoints:function(){var e=this.get("xcoords").concat(),t=this.get("ycoords").concat(),n,r;return this.get("direction")==="vertical"?(r=this._getLastValidIndex(e),n=this._getFirstValidIndex(e),t.push(t[r]),t.push(t[n]),e.push(this._leftOrigin),e.push(this._leftOrigin)):(r=this._getLastValidIndex(t),n=this._getFirstValidIndex(t),e.push(e[r]),e.push(e[n]),t.push(this._bottomOrigin),t.push(this._bottomOrigin)),e.push(e[0]),t.push(t[0]),[e,t]},_getHighestValidOrder:function(e,t,n,r){var i=r=="vertical"?"stackedXCoords":"stackedYCoords",s;while(isNaN(s)&&n>-1)n-=1,n>-1&&(s=e[n].get(i)[t]);return n},_getCoordsByOrderAndIndex:function(e,t,n,r){var i,s;return r=="vertical"?(i=n<0?this._leftOrigin:e[n].get("stackedXCoords")[t],s=this.get("stackedYCoords")[t]):(i=this.get("stackedXCoords")[t],s=n<0?this._bottomOrigin:e[n].get("stackedYCoords")[t]),[i,s]},_getStackedClosingPoints:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=this.get("direction"),i=n.seriesTypes[t],s,o,u=this.get("stackedXCoords"),a=this.get("stackedYCoords"),f,l,c,h,p,d,v,m,g,y,b,w;if(e<1)return this._getClosingPoints();l=i[e-1],p=l.get("stackedXCoords").concat(),d=l.get("stackedYCoords").concat(),r=="vertical"?(s=this._getFirstValidIndex(u),o=this._getLastValidIndex(u),c=l._getFirstValidIndex(p),h=l._getLastValidIndex(p)):(s=this._getFirstValidIndex(a),o=this._getLastValidIndex(a),c=l._getFirstValidIndex(d),h=l._getLastValidIndex(d)),h>=s&&c<=o?(c=Math.max(s,c),h=Math.min(o,h),p=p.slice(c,h+1),d=d.slice(c,h+1),f=c):f=o,m=[u[s]],g=[a[s]],y=s;while((isNaN(b)||b<e-1)&&y<=f)w=b,b=this._getHighestValidOrder(i,y,e,r),!isNaN(w)&&b>w&&(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;p&&p.length>0&&h>s&&c<o&&(m=m.concat(p),g=g.concat(d),b=e-1),y=Math.max(s,h),e-=1,b=NaN;while(y<=o)w=b,b=this._getHighestValidOrder(i,y,e,r),isNaN(w)||(b>w?(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])):b<w&&(v=this._getCoordsByOrderAndIndex(i,y-1,b,r),m.push(v[0]),g.push(v[1]))),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;return m.reverse(),g.reverse(),[u.concat(m),a.concat(g)]},_getAreaDefaults:function(){return{}}},e.augment(k,e.Attribute),e.Fills=k,L.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c,h,p=r/2,d=i/2,v,m,g=null,y=null,b=this.get("graphOrder"),w=this.get("groupMarkers");if(w){v=[],m=[];for(;a<f;++a)v.push(parseFloat(o[a]-p)),m.push(parseFloat(u[a]-d));this._createGroupMarker({xvalues:v,yvalues:m,fill:n.fill,border:n.border,dimensions:{width:r,height:i},graphOrder:b,shape:n.shape});return}s.isArray(n.fill.color)&&(g=n.fill.color.concat()),s.isArray(n.border.color)&&(y=n.border.color.concat()),this._createMarkerCache();for(;a<f;++a){l=parseFloat(u[a]-d),c=parseFloat(o[a]-p);if(!t(c)||!t(l)){this._markers.push(null);continue}g&&(n.fill.color=g[a%g.length]),y&&(n.border.color=y[a%y.length]),n.x=c,n.y=l,h=this.getMarker(n,b,a)}this._clearMarkerCache()},_groupShapes:{circle:e.CircleGroup,rect:e.RectGroup,ellipse:e.EllipseGroup,diamond:e.DiamondGroup},_getGroupShape:function(e){return s.isString(e)&&(e=this._groupShapes[e]),e},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e},_markers:null,_markerCache:null,getMarker:function(e,t,n){var r,i=e.border;e.id=this.get("chart").get("id")+"_"+t+"_"+n,i.opacity=i.alpha,e.stroke=i,e.fill.opacity=e.fill.alpha;if(this._markerCache.length>0){while(!r){if(this._markerCache.length<1){r=this._createMarker(e,t,n);break}r=this._markerCache.shift()}r.set(e)}else r=this._createMarker(e,t,n);return this._markers.push(r),r},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),o.type=o.shape,s=i.addShape(o),s.addClass(p),s},_createMarkerCache:function(){this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null),this._markers&&this._markers.length>0?this._markerCache=this._markers.concat():this._markerCache=[],this._markers=[]},_createGroupMarker:function(e){var t,n=this.get("markers"),r=e.border,i,s,o;if(n&&n.length>0){while(n.length>0)t=n.shift(),t.destroy();this.set("markers",[])}r.opacity=r.alpha,s={id:this.get("chart").get("id")+"_"+e.graphOrder,stroke:r,fill:e.fill,dimensions:e.dimensions,xvalues:e.xvalues,yvalues:e.yvalues},s.fill.opacity=e.fill.alpha,o=this._getGroupShape(e.shape),o&&(s.type=o),e.hasOwnProperty("radius")&&!isNaN(e.radius)&&(s.dimensions.radius=e.radius),this._groupMarker&&this._groupMarker.destroy(),i=this.get("graphic"),this._groupMarker=i.addShape(s),i._redraw()},_toggleVisible:function(e){var t,n=this.get("markers"),r=0,i;if(n){i=n.length;for(;r<i;++r)t=n[r],t&&t.set("visible",e)}},_clearMarkerCache:function(){var e;while(this._markerCache.length>0)e=this._markerCache.shift(),e&&e.destroy()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,s=e.clone(this.get("styles").marker),o=this._getState(t),u=this.get("xcoords"),a=this.get("ycoords"),f=this._markers[n],l=o=="off"||!s[o]?s:s[o];l.fill.color=this._getItemColor(l.fill.color,n),l.border.color=this._getItemColor(l.border.color,n),l.stroke=l.border,f.set(l),r=l.width,i=l.height,f.set("x",u[n]-r/2),f.set("y",a[n]-i/2),f.set("visible",this.get("visible"))}},_getItemColor:function(e,t){return s.isArray(e)?e[t%e.length]:e},_setStyles:function(t){return t=this._parseMarkerStyles(t),e.Renderer.prototype._setStyles.apply(this,[t])},_parseMarkerStyles:function(e){if(e.marker){var t=this._getPlotDefaults();e.marker=this._mergeStyles(e.marker,t),e.marker.over&&(e.marker.over=this._mergeStyles(e.marker.over,e.marker)),e.marker.down&&(e.marker.down=this._mergeStyles(e.marker.down,e.marker))}return e},_getState:function(e){var t;switch(e){case"mouseout":t="off";break;case"mouseover":t="over";break;case"mouseup":t="over";break;case"mousedown":t="down"}return t},_stateSyles:null},e.augment(L,e.Attribute),e.Plots=L,A.prototype={drawSeries:function(){if(this.get("xcoords").length<1)return;var t=e.clone(this.get("styles").marker),n,r,i=this.get("xcoords"),o=this.get("ycoords"),u=0,a=i.length,f=o[0],l=this.get("type"),c=this.get("graph"),h=c.seriesTypes[l],p=h.length,d=0,v=0,m=0,g,y,b=this.get("order"),w=this.get("graphOrder"),E,S,x,T,N,C=null,k=null,L=[],A=[],O,M,_,D,P={width:[],height:[]},H=[],B=[],j=this.get("groupMarkers");s.isArray(t.fill.color)&&(C=t.fill.color.concat()),s.isArray(t.border.color)&&(k=t.border.color.concat()),this.get("direction")=="vertical"?(x="height",T="width"):(x="width",T="height"),n=t[x],r=t[T],this._createMarkerCache();for(;u<p;++u)y=h[u],d+=y.get("styles").marker[x],b>u&&(m=d);v=a*d,this._maxSize=c.get(x),v>this._maxSize&&(g=c.get(x)/v,d*=g,m*=g,n*=g,n=Math.max(n,1),this._maxSize=n),m-=d/2;for(u=0;u<a;++u){O=i[u]-d/2,M=O+d,_=o[u]-d/2,D=_+d,L.push({start:O,end:M}),A.push({start:_,end:D});if(isNaN(i[u])||isNaN(o[u])){this._markers.push(null);continue}N=this._getMarkerDimensions(i[u],o[u],r,m),!isNaN(N.calculatedSize)&&N.calculatedSize>0?(f=N.top,E=N.left,j?(P[x][u]=n,P[T][u]=N.calculatedSize,H.push(E),B.push(f)):(t[x]=n,t[T]=N.calculatedSize,t.x=E,t.y=f,C&&(t.fill.color=C[u%C.length]),k&&(t.border.color=k[u%k.length]),S=this.getMarker(t,w,u))):j||this._markers.push(null)}this.set("xMarkerPlane",L),this.set("yMarkerPlane",A),j?this._createGroupMarker({fill:t.fill,border:t.border,dimensions:P,xvalues:H,yvalues:B,shape:t.shape}):this._clearMarkerCache()},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:12,height:12,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},e.Histogram=A,e.CartesianSeries=e.Base.create("cartesianSeries",e.Base,[e.Renderer],{_xDisplayName:null,_yDisplayName:null,_leftOrigin:null,_bottomOrigin:null,render:function(){this._setCanvas(),this.addListeners(),this.set("rendered",!0),this.validate()},addListeners:function(){var t=this.get("xAxis"),n=this.get("yAxis");t&&(this._xDataReadyHandle=t.after("dataReady",e.bind(this._xDataChangeHandler,this)),this._xDataUpdateHandle=t.after("dataUpdate",e.bind(this._xDataChangeHandler,this))),n&&(this._yDataReadyHandle=n.after("dataReady",e.bind(this._yDataChangeHandler,this)),this._yDataUpdateHandle=n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))),this._xAxisChangeHandle=this.after("xAxisChange",this._xAxisChangeHandler),this._yAxisChangeHandle=this.after("yAxisChange",this._yAxisChangeHandler),this._stylesChangeHandle=this.after("stylesChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._widthChangeHandle=this.after("widthChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._heightChangeHandle=this.after("heightChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._visibleChangeHandle=this.after("visibleChange",this._handleVisibleChange)},_xAxisChangeHandler:function(t){var n=this.get("xAxis");n.after("dataReady",e.bind(this._xDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._xDataChangeHandler,this))},_yAxisChangeHandler:function(t){var n=this.get("yAxis");n.after("dataReady",e.bind(this._yDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))},GUID:"yuicartesianseries",_xDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_yDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_updateAxisData:function(){var e=this.get("xAxis"),t=this.get("yAxis"),n=this.get("xKey"),r=this.get("yKey"),i,s;return!e||!t||!n||!r?!1:(s=e.getDataByKey(n),i=t.getDataByKey(r),!s||!i?!1:(this.set("xData",s.concat()),this.set("yData",i.concat()),!0))},validate:function(){this.get("xData")&&this.get("yData")||this._updateAxisData()?this.draw():this.fire("drawingComplete")},_setCanvas:function(){var e=this.get("graph"),t=e.get("graphic");this.set("graphic",t)},setAreaData:function(){var e=s.isNumber,t,n,r=this.get("graph"),i=r.get("width"),o=r.get("height"),u=this.get("xAxis"),a=this.get("yAxis"),f=this.get("xData").concat(),l=this.get("yData").concat(),c,h,p=u.getEdgeOffset(f.length,i),d=a.getEdgeOffset(l.length,o),v=this.get("styles").padding,m=v.left,g=v.top,y=i-(m+v.right+p),b=o-(g+v.bottom+d),w=[],E=[],S=u.get("maximum"),x=u.get("minimum"),T=a.get("maximum"),N=a.get("minimum"),C=y/(S-x),k=b/(T-N),L,A=this.get("direction"),O=0,M=[],_=[],D=this.get("xMarkerPlaneOffset"),P=this.get("yMarkerPlaneOffset"),H=this.get("graphic");H.set("width",i),H.set("height",o),L=f.length,p*=.5,d*=.5,A==="vertical"&&(l=l.reverse()),this._leftOrigin=Math.round((0-x)*C+m+p),this._bottomOrigin=Math.round(b+g+d),N<0&&(this._bottomOrigin=this._bottomOrigin-(0-N)*k);for(;O<L;++O)c=parseFloat(f[O]),h=parseFloat(l[O]),e(c)?t=(c-x)*C+m+p:t=NaN,e(h)?n=b+g+d-(h-N)*k:n=NaN,w.push(t),E.push(n),M.push({start:t-D,end:t+D}),_.push({start:n-P,end:n+P});this.set("xcoords",w),this.set("ycoords",E),this.set("xMarkerPlane",M),this.set("yMarkerPlane",_),this._dataLength=L},_getFirstValidIndex:function(e){var t,n=-1,r=e.length;while(!s.isNumber(t)&&n<r)n+=1,t=e[n];return n},_getLastValidIndex:function(e){var t,n=e.length,r=-1;while(!s.isNumber(t)&&n>r)n-=1,t=e[n];return n},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(this.get("rendered")&&isFinite(t)&&isFinite(n)&&t>0&&n>0&&(this.get("xData")&&this.get("yData")||this._updateAxisData())){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.setAreaData(),this.get("xcoords")&&this.get("ycoords")&&this.drawSeries(),this._drawing=!1,this._callLater?this.draw():(this._toggleVisible(this.get("visible")),this.fire("drawingComplete"))}},_defaultPlaneOffset:4,_getDefaultStyles:function(){return{padding:{top:0,left:0,right:0,bottom:0}}},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]},_handleVisibleChange:function(e){this._toggleVisible(this.get("visible"))},getTotalValues:function(){var e=this.get("valueAxis").getTotalByKey(this.get("valueKey"));return e},destructor:function(){var t,n=this.get("markers");this.get("rendered")&&(this._xDataReadyHandle&&this._xDataReadyHandle.detach(),this._xDataUpdateHandle&&this._xDataUpdateHandle.detach(),this._yDataReadyHandle&&this._yDataReadyHandle.detach(),this._yDataUpdateHandle&&this._yDataUpdateHandle.detach(),this._xAxisChangeHandle.detach(),this._yAxisChangeHandle.detach(),this._stylesChangeHandle.detach(),this._widthChangeHandle.detach(),this._heightChangeHandle.detach(),this._visibleChangeHandle.detach());while(n&&n.length>0)t=n.shift(),t&&t instanceof e.Shape&&t.destroy();this._path&&(this._path.destroy(),this._path=null),this._lineGraphic&&(this._lineGraphic.destroy(),this._lineGraphic=null),this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null)}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey")},setter:function(e){return this._xDisplayName=e.toString(),e}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey")},setter:function(e){return this._yDisplayName=e.toString(),e}},categoryDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("yDisplayName"):this.get("xDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._yDisplayName=e:this._xDisplayName=e,e}},valueDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("xDisplayName"):this.get("yDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._xDisplayName=e:this._yDisplayName=e,e}},type:{value:"cartesian"},order:{},graphOrder:{},xcoords:{},ycoords:{},chart:{readOnly:!0,getter:function(){return this.get("graph").get("chart")}},graph:{},xAxis:{},yAxis:{},xKey:{setter:function(e){return e.toString()}},yKey:{setter:function(e){return e.toString()}},xData:{},yData:{},rendered:{value:!1},width:{readOnly:!0,getter:function(){this.get("graph").get("width")}},height:{readOnly:!0,getter:function(){this.get("graph").get("height")}},visible:{value:!0},xMarkerPlane:{},yMarkerPlane:{},xMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.width&&isFinite(e.width)?e.width*.5:this._defaultPlaneOffset}},yMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.height&&isFinite(e.height)?e.height*.5:this._defaultPlaneOffset}},direction:{value:"horizontal"},groupMarkers:{getter:function(){return this._groupMarkers===undefined?this.get("graph").get("groupMarkers"):this._groupMarkers},setter:function(e){return this._groupMarkers=e,e}}}}),e.MarkerSeries=e.Base.create("markerSeries",e.CartesianSeries,[e.Plots],{drawSeries:function(){this.drawPlots()},_setStyles:function(t){return t.marker||(t={marker:t}),t=this._parseMarkerStyles(t),e.MarkerSeries.superclass._mergeStyles.apply(this,[t,this._getDefaultStyles()])},_getDefaultStyles:function(){var t=this._mergeStyles({marker:this._getPlotDefaults()},e.MarkerSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"marker"}}}),e.LineSeries=e.Base.create("lineSeries",e.CartesianSeries,[e.Lines],{drawSeries:function(){this.drawLines()},_setStyles:function(t){return t.line||(t={line:t}),e.LineSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},e.LineSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"line"}}}),e.SplineSeries=e.Base.create("splineSeries",e.LineSeries,[e.CurveUtil,e.Lines],{drawSeries:function(){this.drawSpline()}},{ATTRS:{type:{value:"spline"}}}),e.StackedSplineSeries=e.Base.create("stackedSplineSeries",e.SplineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedSplineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedSpline"}}}),e.StackedMarkerSeries=e.Base.create("stackedMarkerSeries",e.MarkerSeries,[e.StackingUtil],{setAreaData:function(){e.StackedMarkerSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedMarker"}}}),e.ColumnSeries=e.Base.create("columnSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={left:e+r};return this._bottomOrigin>=t?(i.top=t,i.calculatedSize=this._bottomOrigin-i.top):(i.top=this._bottomOrigin,i.calculatedSize=t-this._bottomOrigin),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c,h=l.seriesTypes[this.get("type")],p=h.length,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?e.clone(r):e.clone(r[s]),i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.width,v),i.height=w.calculatedSize,i.width=Math.min(this._maxSize,i.width),a.set(i);for(;g<p;++g)y[g]=o[n]+d,c=h[g].get("styles").marker,d+=Math.min(this._maxSize,c.width),b>g&&(v=d),v-=d/2;for(g=0;g<p;++g)f=h[g].get("markers"),f&&(m=f[n],m&&m!==undefined&&m.set("x",y[g]-d/2))}}},{ATTRS:{type:{value:"column"}}}),e.BarSeries=e.Base.create("barSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={top:t+r};return e>=this._leftOrigin?(i.left=this._leftOrigin,i.calculatedSize=e-i.left):(i.left=e,i.calculatedSize=this._leftOrigin-e),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c=l.seriesTypes[this.get("type")],h=c.length,p,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?r:r[s],i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.height,v),i.width=w.calculatedSize,i.height=Math.min(this._maxSize,i.height),a.set(i);for(;g<h;++g)y[g]=u[n]+d,p=c[g].get("styles").marker,d+=Math.min(this._maxSize,p.height),b>g&&(v=d),v-=d/2;for(g=0;g<h;++g)f=c[g].get("markers"),f&&(m=f[n],m&&m!==undefined&&m.set("y",y[g]-d/2))}}},{ATTRS:{type:{value:"bar"},direction:{value:"vertical"}}}),e.AreaSeries=e.Base.create("areaSeries",e.CartesianSeries,[e.Fills],{drawSeries:function(){this.drawFill.apply(this,this._getClosingPoints())},_setStyles:function(t){return t.area||(t={area:t}),e.AreaSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({area:this._getAreaDefaults()},e.AreaSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"area"}}}),e.AreaSplineSeries=e.Base.create("areaSplineSeries",e.AreaSeries,[e.CurveUtil],{drawSeries:function(){this.drawAreaSpline()}},{ATTRS:{type:{value:"areaSpline"}}}),e.StackedAreaSplineSeries=e.Base.create("stackedAreaSplineSeries",e.AreaSeries,[e.CurveUtil,e.StackingUtil],{drawSeries:function(){this._stackCoordinates(),this.drawStackedAreaSpline()}},{ATTRS:{type:{value:"stackedAreaSpline"}}}),e.ComboSeries=e.Base.create("comboSeries",e.CartesianSeries,[e.Fills,e.Lines,e.Plots],{drawSeries:function(){this.get("showAreaFill")&&this.drawFill.apply(this,this._getClosingPoints()),this.get("showLines")&&this.drawLines(),this.get("showMarkers")&&this.drawPlots()},_toggleVisible:function(e){var t,n,r,i;this.get("showAreaFill")&&this._path&&this._path.set("visible",e),this.get("showLines")&&this._lineGraphic&&this._lineGraphic.set("visible",e);if(this.get("showMarkers")){t=this.get("markers");if(t){i=0,r=t.length;for(;i<r;++i)n=t[i],n&&n.set("visible",e)}}},_getDefaultStyles:function(){var t=e.ComboSeries.superclass._getDefaultStyles();return t.line=this._getLineDefaults(),t.marker=this._getPlotDefaults(),t.area=this._getAreaDefaults(),t}},{ATTRS:{type:{value:"combo"},showAreaFill:{value:!1},showLines:{value:!0},showMarkers:{value:!0},marker:{lazyAdd:!1,getter:function(){return this.get("styles").marker},setter:function(e){this.set("styles",{marker:e})}},line:{lazyAdd:!1,getter:function(){return this.get("styles").line},setter:function(e){this.set("styles",{line:e})}},area:{lazyAdd:!1,getter:function(){return this.get("styles").area},setter:function(e){this.set("styles",{area:e})}}}}),e.StackedComboSeries=e.Base.create("stackedComboSeries",e.ComboSeries,[e.StackingUtil],{setAreaData:function(){e.StackedComboSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)},drawSeries:function(){this.get("showAreaFill")&&this.drawFill.apply(this,this._getStackedClosingPoints()),this.get("showLines")&&this.drawLines(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"stackedCombo"},showAreaFill:{value:!0}}}),e.ComboSplineSeries=e.Base.create("comboSplineSeries",e.ComboSeries,[e.CurveUtil],{drawSeries:function(){this.get("showAreaFill")&&this.drawAreaSpline(),this.get("showLines")&&this.drawSpline(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"comboSpline"}}}),e.StackedComboSplineSeries=e.Base.create("stackedComboSplineSeries",e.StackedComboSeries,[e.CurveUtil],{drawSeries:function(){this.get("showAreaFill")&&this.drawStackedAreaSpline(),this.get("showLines")&&this.drawSpline(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"stackedComboSpline"},showAreaFill:{value:!0}}}),e.StackedLineSeries=e.Base.create("stackedLineSeries",e.LineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedLineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedLine"}}}),e.StackedAreaSeries=e.Base.create("stackedAreaSeries",e.AreaSeries,[e.StackingUtil],{setAreaData:function(){e.StackedAreaSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)},drawSeries:function(){this.drawFill.apply(this,this._getStackedClosingPoints())}},{ATTRS:{type:{value:"stackedArea"}}}),e.StackedColumnSeries=e.Base.create("stackedColumnSeries",e.ColumnSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*r,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(b=n.fill.color.concat()),s.isArray(n.border.color)&&(w=n.border.color.concat()),this._createMarkerCache(),N>this.get("width")&&(d=this.width/N,r*=d,r=Math.max(r,1));if(!T){E=p[v-1],S=E.get("negativeBaseValues"),x=E.get("positiveBaseValues");if(!S||!x)T=!0,x=[],S=[]}else S=[],x=[];this.set("negativeBaseValues",S),this.set("positiveBaseValues",x);for(a=0;a<f;++a){g=o[a],l=u[a];if(!t(l)||!t(g)){T&&(S[a]=this._bottomOrigin,x[a]=this._bottomOrigin),this._markers.push(null);continue}T?(i=Math.abs(this._bottomOrigin-l),l<this._bottomOrigin?(x[a]=l,S[a]=this._bottomOrigin):l>this._bottomOrigin?(x[a]=this._bottomOrigin,S[a]=l,l-=i):(x[a]=l,S[a]=l)):l>this._bottomOrigin?(l+=S[a]-this._bottomOrigin,i=l-S[a],S[a]=l,l-=i):l<=this._bottomOrigin&&(l=x[a]-(this._bottomOrigin-l),i=x[a]-l,x[a]=l),!isNaN(i)&&i>0?(g-=r/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,b&&(n.fill.color=b[a%b.length]),w&&(n.border.color=w[a%w.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,o=this._getState(t),u=this.get("xcoords"),a=this._markers[n],f=0,l,c;r=this.get("styles").marker,f=r.width*.5,i=o=="off"||!r[o]?e.clone(r):e.clone(r[o]),i.height=a.get("height"),i.x=u[n]-f,i.y=a.get("y"),i.id=a.get("id"),l=i.fill.color,c=i.border.color,s.isArray(l)?i.fill.color=l[n%l.length]:i.fill.color=this._getItemColor(i.fill.color,n),s.isArray(c)?i.border.color=c[n%c.length]:i.border.color=this._getItemColor(i.border.color,n),a.set(i)}},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedColumn"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.StackedBarSeries=e.Base.create("stackedBarSeries",e.BarSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*i,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(S=n.fill.color.concat()),s.isArray(n.border.color)&&(x=n.border.color.concat()),this._createMarkerCache(),N>this.get("height")&&(d=this.height/N,i*=d,i=Math.max(i,1));if(!T){b=p[v-1],w=b.get("negativeBaseValues"),E=b.get("positiveBaseValues");if(!w||!E)T=!0,E=[],w=[]}else w=[],E=[];this.set("negativeBaseValues",w),this.set("positiveBaseValues",E);for(a=0;a<f;++a){l=u[a],g=o[a];if(!t(l)||!t(g)){T&&(E[a]=this._leftOrigin,w[a]=this._leftOrigin),this._markers.push(null);continue}T?(r=Math.abs(g-this._leftOrigin),g>this._leftOrigin?(E[a]=g,w[a]=this._leftOrigin,g-=r):g<this._leftOrigin?(E[a]=this._leftOrigin,w[a]=g):(E[a]=g,w[a]=this._leftOrigin)):g<this._leftOrigin?(g=w[a]-(this._leftOrigin-o[a]),r=w[a]-g,w[a]=g):g>=this._leftOrigin&&(g+=E[a]-this._leftOrigin,r=g-E[a],E[a]=g,g-=r),!isNaN(r)&&r>0?(l-=i/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,S&&(n.fill.color=S[a%S.length]),x&&(n.border.color=x[a%x.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers[n]){var r=this._getState(t),i=this.get("ycoords"),o=this._markers[n],u=this.get("styles").marker,a=u.height,f=r=="off"||!u[r]?e.clone(u):e.clone(u[r]),l,c;f.y=i[n]-a/2,f.x=o.get("x"),f.width=o.get("width"),f.id=o.get("id"),l=f.fill.color,c=f.border.color,s.isArray(l)?f.fill.color=l[n%l.length]:f.fill.color=this._getItemColor(f.fill.color,n),s.isArray(c)?f.border.color=c[n%c.length]:f.border.color=this._getItemColor(f.border.color,n),o.set(f)}},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.PieSeries=e.Base.create("pieSeries",e.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var e="pieHotSpotMapi_"+Math.round(1e5*Math.random()),t=this.get("graph").get("contentBox"),n;if(this._image){t.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0)n=this._areaNodes.shift(),this._map.removeChild(n);t.removeChild(this._map)}this._image=i.createElement("img"),this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==",t.appendChild(this._image),this._image.setAttribute("usemap","#"+e),this._image.style.zIndex=3,this._image.style.opacity=0,this._image.setAttribute("alt","imagemap"),this._map=i.createElement("map"),this._map.style.zIndex=5,t.appendChild(this._map),this._map.setAttribute("name",e),this._map.setAttribute("id",e),this._areaNodes=[]},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var t=this.get("categoryAxis"),n=this.get("valueAxis");t&&(t.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),t.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))),n&&(n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))),this.after("categoryAxisChange",this.categoryAxisChangeHandler),this.after("valueAxisChange",this.valueAxisChangeHandler),this.after("stylesChange",this._updateHandler)},validate:function(){this.draw(),this._renderered=!0},_categoryAxisChangeHandler:function(t){var n=this.get("categoryAxis");n.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))},_valueAxisChangeHandler:function(t){var n=this.get("valueAxis");n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))},GUID:"pieseries",_categoryDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},_valueDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(isFinite(t)&&isFinite(n)&&t>0&&n>0){this._rendered=!0;if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.drawSeries(),this._drawing=!1,this._callLater?this.draw():this.fire("drawingComplete")}},drawPlots:function(){var t=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),n=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),r=0,i=t.length,s=this.get("styles").marker,o=s.fill.colors,u=s.fill.alphas||["1"],a=s.border.colors,f=[s.border.weight],l=[s.border.alpha],c=f.concat(),h=a.concat(),p=l.concat(),d,v,m=s.padding,g=this.get("graph"),y=Math.min(g.get("width"),g.get("height")),b=y-(m.left+m.right),w=y-(m.top+m.bottom),E=-90,S=b/2,x=w/2,T=Math.min(S,x),N=0,C,k=0,L,A,O,M,_,D=this.get("graphOrder"),P=e.Graphic.NAME=="canvasGraphic";for(;N<i;++N)C=parseFloat(t[N]),t.push(C),isNaN(C)||(r+=C);d=o?o.concat():null,v=u?u.concat():null,this._createMarkerCache(),P&&(this._setMap(),this._image.width=b,this._image.height=w);for(N=0;N<i;N++)C=t[N],r===0?k=360/t.length:k=360*(C/r),d&&d.length<1&&(d=o.concat()),v&&v.length<1&&(v=u.concat()),c&&c.length<1&&(c=f.concat()),c&&h.length<1&&(h=a.concat()),p&&p.length<1&&(p=l.concat()),O=c?c.shift():null,L=h?h.shift():null,A=p?p.shift():null,E+=k,M={border:{color:L,weight:O,alpha:A},fill:{color:d?d.shift():this._getDefaultColor(N,"slice"),alpha:v?v.shift():null},type:"pieslice",arc:k,radius:T,startAngle:E,cx:S,cy:x,width:b,height:w},_=this.getMarker(M,D,N),P&&this._addHotspot(M,D,N);this._clearMarkerCache()},_addHotspot:function(e,t,n){var r=i.createElement("area"),s=1,o=e.cx,u=e.cy,a=e.arc,f=e.startAngle-a,l=e.startAngle,c=e.radius,h=o+Math.cos(f/180*Math.PI)*c,d=u+Math.sin(f/180*Math.PI)*c,v=o+Math.cos(l/180*Math.PI)*c,m=u+Math.sin(l/180*Math.PI)*c,g=Math.floor(a/10)-1,y=a/Math.floor(a/10)/180*Math.PI,b=Math.atan((d-u)/(h-o)),w=o+", "+u+", "+h+", "+d,E,S,x;for(s=1;s<=g;++s)x=y*s,E=Math.cos(b+x),S=Math.sin(b+x),f<=90?(w+=", "+(o+c*Math.cos(b+y*s)),w+=", "+(u+c*Math.sin(b+y*s))):(w+=", "+(o-c*Math.cos(b+y*s)),w+=", "+(u-c*Math.sin(b+y*s)));w+=", "+v+", "+m,w+=", "+o+", "+u,this._map.appendChild(r),r.setAttribute("class",p),r.setAttribute("id","hotSpot_"+t+"_"+n),r.setAttribute("shape","polygon"),r.setAttribute("coords",w),this._areaNodes.push(r)},updateMarkerState:function(e,t){if(this._markers[t]){var n=this._getState(e),r,i,s=this._markers[t],o=this.get("styles").marker;r=n=="off"||!o[n]?o:o[n],i=this._mergeStyles(r,{}),i.fill.color=i.fill.colors[t%i.fill.colors.length],i.fill.alpha=i.fill.alphas[t%i.fill.alphas.length],s.set(i)}},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),s=i.addShape(o),s.addClass(p),s},_clearMarkerCache:function(){var e=this._markerCache.length,t=0,n;for(;t<e;++t)n=this._markerCache[t],n&&n.destroy();this._markerCache=[]},_getPlotDefaults:function(){var e={padding:{top:0,left:0,right:0,bottom:0},fill:{alphas:["1"]},border:{weight:0,alpha:1}};return e.fill.colors=this._defaultSliceColors,e.border.colors=this._defaultBorderColors,e},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(e){return e!==this.get("categoryAxis")}},valueAxis:{value:null,validator:function(e){return e!==this.get("valueAxis")}},categoryKey:{value:null,validator:function(e){return e!==this.get("categoryKey")}},valueKey:{value:null,validator:function(e){return e!==this.get("valueKey")}},categoryDisplayName:{setter:function(e){return this._categoryDisplayName=e,e},getter:function(){return this._categoryDisplayName||this.get("categoryKey")}},valueDisplayName:{setter:function(e){return this._valueDisplayName=e,e},getter:function(){return this._valueDisplayName||this.get("valueKey")}},slices:null}}),e.Gridlines=e.Base.create("gridlines",e.Base,[e.Renderer],{_path:null,remove:function(){var e=this._path;e&&e.destroy()},draw:function(){this.get("axis")&&this.get("graph")&&this._drawGridlines()},_drawGridlines:function(){var e,t=this.get("axis"),n=t.get("position"),r,i=0,s,o=this.get("direction"),u=this.get("graph"),a=u.get("width"),f=u.get("height"),l=this.get("styles").line,c=l.color,h=l.weight,p=l.alpha,d=o=="vertical"?this._verticalLine:this._horizontalLine;if(isFinite(a)&&isFinite(f)&&a>0&&f>0){if(n!="none"&&t&&t.get("tickPoints"))r=t.get("tickPoints"),s=r.length;else{r=[],s=t.get("styles").majorUnit.count;for(;i<s;++i)r[i]={x:a*(i/(s-1)),y:f*(i/(s-1))};i=0}e=u.get("gridlines"),e.set("width",a),e.set("height",f),e.set("stroke",{weight:h,color:c,opacity:p});for(;i<s;++i)d(e,r[i],a,f);e.end()}},_horizontalLine:function(e,t,n,r){e.moveTo(0,t.y),e.lineTo(n,t.y)},_verticalLine:function(e,t,n,r){e.moveTo(t.x,0),e.lineTo(t.x,r)},_getDefaultStyles:function(){var e={line:{color:"#f0efe9",weight:1,alpha:1}};return e}},{ATTRS:{direction:{},axis:{},graph:{}}}),e.Graph=e.Base.create("graph",e.Widget,[e.Renderer],{bindUI:function(){var e=this.get("boundingBox");e.setStyle("position","absolute"),this.after("widthChange",this._sizeChangeHandler),this.after("heightChange",this._sizeChangeHandler),this.after("stylesChange",this._updateStyles),this.after("groupMarkersChange",this._drawSeries)},syncUI:function(){var t,n,r,i=this.get("seriesCollection"),s,o=0,u=i?i.length:0,a=this.get("horizontalGridlines"),f=this.get("verticalGridlines");this.get("showBackground")&&(t=this.get("background"),n=this.get("contentBox"),r=this.get("styles").background,r.stroke=r.border,r.stroke.opacity=r.stroke.alpha,r.fill.opacity=r.fill.alpha,r.width=this.get("width"),r.height=this.get("height"),r.type=r.shape,t.set(r));for(;o<u;++o)s=i[o],s instanceof e.CartesianSeries&&s.render();a&&a instanceof e.Gridlines&&a.draw(),f&&f instanceof e.Gridlines&&f.draw()},seriesTypes:null,getSeriesByIndex:function(e){var t=this.get("seriesCollection"),n;return t&&t.length>e&&(n=t[e]),n},getSeriesByKey:function(e){var t=this._seriesDictionary,n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n},addDispatcher:function(e){this._dispatchers||(this._dispatchers=[]),this._dispatchers.push(e)},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(t){if(!t)return;var n=t.length,r=0,i,s;this._seriesCollection=[],this._seriesDictionary={},this.seriesTypes=[];for(;r<n;++r){i=t[r];if(!(i instanceof e.CartesianSeries||i instanceof e.PieSeries)){this._createSeries(i);continue}this._addSeries(i)}n=this._seriesCollection.length;for(r=0;r<n;++r)i=this.get("seriesCollection")[r],s=i.get("direction")=="horizontal"?"yKey":"xKey",this._seriesDictionary[i.get(s)]=i},_addSeries:function(t){var n=t.get("type"),r=this.get("seriesCollection"),i=r.length,s=this.seriesTypes,o;t.get("graph")||t.set("graph",this),r.push(t),s.hasOwnProperty(n)||(this.seriesTypes[n]=[]),o=this.seriesTypes[n],t.set("graphOrder",i),t.set("order",o.length),o.push(t),this.addDispatcher(t),t.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),this.fire("seriesAdded",t)},_createSeries:function(t){var n=t.type,r=this.get("seriesCollection"),i=this.seriesTypes,s,o,u;t.graph=this,i.hasOwnProperty(n)||(i[n]=[]),s=i[n],t.graph=this,t.order=s.length,t.graphOrder=r.length,o=this._getSeries(t.type),u=new o(t),this.addDispatcher(u),u.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),s.push(u),r.push(u),this.get("rendered")&&u.render()},_seriesMap:{line:e.LineSeries,column:e.ColumnSeries,bar:e.BarSeries,area:e.AreaSeries,candlestick:e.CandlestickSeries,ohlc:e.OHLCSeries,stackedarea:e.StackedAreaSeries,stackedline:e.StackedLineSeries,stackedcolumn:e.StackedColumnSeries,stackedbar:e.StackedBarSeries,markerseries:e.MarkerSeries,spline:e.SplineSeries,areaspline:e.AreaSplineSeries,stackedspline:e.StackedSplineSeries,stackedareaspline:e.StackedAreaSplineSeries,stackedmarkerseries:e.StackedMarkerSeries,pie:e.PieSeries,combo:e.ComboSeries,stackedcombo:e.StackedComboSeries,combospline:e.ComboSplineSeries,stackedcombospline:e.StackedComboSplineSeries},_getSeries:function(e){var t;return s.isString(e)?t=this._seriesMap[e]:t=e,t},_markerEventHandler:function(e){var t=e.type,n=e.currentTarget,r=n.getAttribute("id").split("_"),i=this.getSeriesByIndex(r[1]),s=r[2];i.updateMarkerState(t,s)},_dispatchers:null,_updateStyles:function(){var e=this.get("styles").background,t=e.border;t.opacity=t.alpha,e.stroke=t,e.fill.opacity=e.fill.alpha,this.get("background").set(e),this._sizeChangeHandler()},_sizeChangeHandler:function(t){var n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("width"),s=this.get("height"),o=this.get("styles").background,u,a;o&&o.border&&(u=o.border.weight||0),this.get("showBackground")&&(a=this.get("background"),i&&s&&(a.set("width",i),a.set("height",s))),this._gridlines&&this._gridlines.clear(),n&&n instanceof e.Gridlines&&n.draw(),r&&r instanceof e.Gridlines&&r.draw(),this._drawSeries()},_drawSeries:function(){if(this._drawing){this._callLater=!0;return}var t,n,r,i=this.get("graphic");i.set("autoDraw",!1),this._callLater=!1,this._drawing=!0,t=this.get("seriesCollection"),n=0,r=t?t.length:0;for(;n<r;++n){t[n].draw();if((!t[n].get("xcoords")||!t[n].get("ycoords"))&&!t[n]instanceof e.PieSeries){this._callLater=!0;break}}this._drawing=!1,this._callLater&&this._drawSeries()},_drawingCompleteHandler:function(t){var n=t.currentTarget,r,i=e.Array.indexOf(this._dispatchers,n);i>-1&&this._dispatchers.splice(i,1),this._dispatchers.length<1&&(r=this.get("graphic"),r.get("autoDraw")||r._redraw(),this.fire("chartRendered"))},_getDefaultStyles:function(){var e={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},destructor:function(){this._graphic&&(this._graphic.destroy(),this._graphic=null),this._background&&(this._background.get("graphic").destroy(),this._background=null),this._gridlines&&(this._gridlines.get("graphic").destroy(),this._gridlines=null)}},{ATTRS:{x:{setter:function(e){return this.get("boundingBox").setStyle("left",e+"px"),e}},y:{setter:function(e){return this.get("boundingBox").setStyle("top",e+"px"),e}},chart:{},seriesCollection:{getter:function(){return this._seriesCollection},setter:function(e){return this._parseSeriesCollection(e),this._seriesCollection}},showBackground:{value:!0},seriesDictionary:{readOnly:!0,getter:function(){return this._seriesDictionary}},horizontalGridlines:{value:null,setter:function(t){var n=this.get("horizontalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"horizontal",axis:t.axis,graph:this,styles:t.styles}),n}},verticalGridlines:{value:null,setter:function(t){var n=this.get("verticalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"vertical",axis:t.axis,graph:this,styles:t.styles}),n}},background:{getter:function(){return this._background||(this._backgroundGraphic=new e.Graphic({render:this.get("contentBox")}),this._backgroundGraphic.get("node").style.zIndex=0,this._background=this._backgroundGraphic.addShape({type:"rect"})),this._background}},gridlines:{readOnly:!0,getter:function(){return this._gridlines||(this._gridlinesGraphic=new e.Graphic({render:this.get("contentBox")}),this._gridlinesGraphic.get("node").style.zIndex=1,this._gridlines=this._gridlinesGraphic.addShape({type:"path"})),this._gridlines}},graphic:{readOnly:!0,getter:function(){return this._graphic||(this._graphic=new e.Graphic({render:this.get("contentBox")}),this._graphic.get("node").style.zIndex=2,this._graphic.set("autoDraw",!1)),this._graphic}},groupMarkers:{value:!1}}}),O.ATTRS={dataProvider:{lazyAdd:!1,valueFn:function(){var e=[];return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(e)),e},setter:function(e){var t=this._setDataValues(e);return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(t)),t}},seriesKeys:{getter:function(){return this._seriesKeys},setter:function(e){return this._seriesKeysExplicitlySet=!0,this._seriesKeys=e,e}},ariaLabel:{value:"Chart Application",setter:function(e){var t=this.get("contentBox");return t&&t.setAttribute("aria-label",e),e}},ariaDescription:{value:"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},tooltip:{valueFn:"_getTooltip",setter:function(e){return this._updateTooltip(e)}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},axesCollection:{},graph:{valueFn:"_getGraph"},groupMarkers:{value:!1}},O.prototype={_groupMarkersChangeHandler:function(e){var t=this.get("graph"),n=e.newVal;t&&t.set("groupMarkers",n)},_itemRendered:function(t){this._itemRenderQueue=this._itemRenderQueue.splice(1+e.Array.indexOf(this._itemRenderQueue,t.currentTarget),1),this._itemRenderQueue.length<1&&this._redraw()},_getGraph:function(){var t=new e.Graph({chart:this,groupMarkers:this.get("groupMarkers")});return t.after("chartRendered",e.bind(function(e){this.fire("chartRendered")},this)),t},getSeries:function(e){var t=null,n=this.get("graph");return n&&(s.isNumber(e)?t=n.getSeriesByIndex(e):t=n.getSeriesByKey(e)),t},getAxisByKey:function(e){var t,n=this.get("axes");return n&&n.hasOwnProperty(e)&&(t=n[e]),t},getCategoryAxis:function(){var e,t=this.get("categoryKey"),n=this.get("axes");return n.hasOwnProperty(t)&&(e=n[t]),e},_direction:"horizontal",_dataProvider:null,_setDataValues:function(e){if(s.isArray(e[0])){var t,n=[],r=e[0],i=0,o=r.length,u,a=e.length;for(;i<o;++i){t={category:r[i]};for(u=1;u<a;++u)t["series"+u]=e[u][i];n[i]=t}return n}return e},_seriesCollection:null,_setSeriesCollection:function(e){this._seriesCollection=e},_getAxisClass:function(e){return this._axisClass[e]},_axisClass:{stacked:e.StackedAxis,numeric:e.NumericAxis,category:e.CategoryAxis,time:e.TimeAxis},_axes:null,initializer:function(){this._itemRenderQueue=[],this._seriesIndex=-1,this._itemIndex=-1,this.after("dataProviderChange",this._dataProviderChangeHandler)},renderUI:function(){var e=this.get("tooltip"),t=this.get("boundingBox"),n=this.get("contentBox");t.setStyle("position","absolute"),n.setStyle("position","absolute"),this._addAxes(),this._addSeries(),e&&e.show&&this._addTooltip(),this._setAriaElements(t,n)},_setAriaElements:function(e,t){var n=this._getAriaOffscreenNode(),r=this.get("id")+"_description",s=this._getAriaOffscreenNode();t.set("tabIndex",0),t.set("role","img"),t.setAttribute("aria-label",this.get("ariaLabel")),t.setAttribute("aria-describedby",r),n.set("id",r),n.set("tabIndex",-1),n.appendChild(i.createTextNode(this.get("ariaDescription"))),s.set("id","live-region"),s.set("aria-live","polite"),s.set("aria-atomic","true"),s.set("role","status"),e.setAttribute("role","application"),e.appendChild(n),e.appendChild(s),this._description=n,this._liveRegion=s},_getAriaOffscreenNode:function(){var t=e.Node.create("<div></div>"),n=e.UA.ie,r=n&&n<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)";return t.setStyle("position","absolute"),t.setStyle("height","1px"),t.setStyle("width","1px"),t.setStyle("overflow","hidden"),t.setStyle("clip",r),t},syncUI:function(){this._redraw()},bindUI:function(){this.after("tooltipChange",e.bind(this._tooltipChangeHandler,this)),this.after("widthChange",this._sizeChanged),this.after("heightChange",this._sizeChanged),this.after("groupMarkersChange",this._groupMarkersChangeHandler);var t=this.get("tooltip"),n="mouseout",o="mouseover",u=this.get("contentBox"),a=this.get("interactionType"),f=0,l,c="."+p,h=r&&"ontouchstart"in r&&!(e.UA.chrome&&e.UA.chrome<6);e.on("keydown",e.bind(function(e){var t=e.keyCode,n=parseFloat(t),r;n>36&&n<41&&(e.halt(),r=this._getAriaMessage(n),this._liveRegion.setContent(""),this._liveRegion.appendChild(i.createTextNode(r)))},this),this.get("contentBox")),a=="marker"?(n=t.hideEvent,o=t.showEvent,h?(e.delegate("touchend",e.bind(this._markerEventDispatcher,this),u,c),e.on("touchend",e.bind(function(e){e.halt(!0),this._activeMarker&&(this._activeMarker=null,this.hideTooltip(e))},this))):(e.delegate("mouseenter",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousedown",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseup",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseleave",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("click",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousemove",e.bind(this._positionTooltip,this),u,c))):a=="planar"&&(h?this._overlay.on("touchend",e.bind(this._planarEventDispatcher,this)):(this._overlay.on("mousemove",e.bind(this._planarEventDispatcher,this)),this.on("mouseout",this.hideTooltip)));if(t){this.on("markerEvent:touchend",e.bind(function(e){var n=e.series.get("markers")[e.index];this._activeMarker&&n===this._activeMarker?(this._activeMarker=null,this.hideTooltip(e)):(this._activeMarker=n,t.markerEventHandler.apply(this,[e]))},this));if(n&&o&&n==o)this.on(a+"Event:"+n,this.toggleTooltip);else{o&&this.on(a+"Event:"+o,t[a+"EventHandler"]);if(n){if(s.isArray(n)){l=n.length;for(;f<l;++f)this.on(a+"Event:"+n[f],this.hideTooltip)}this.on(a+"Event:"+n,this.hideTooltip)}}}},_markerEventDispatcher:function(e){var t=e.type,n=this.get("contentBox"),r=e.currentTarget,i=r.getAttribute("id").split("_"),s=i.pop(),o=i.pop(),u=this.getSeries(parseInt(o,10)),a=this.getSeriesItems(u,s),f=e&&e.hasOwnProperty("changedTouches"),l=f?e.changedTouches[0].pageX:e.pageX,c=f?e.changedTouches[0].pageY:e.pageY,h=l-n.getX(),p=c-n.getY();t=="mouseenter"?t="mouseover":t=="mouseleave"&&(t="mouseout"),u.updateMarkerState(t,s),e.halt(),this.fire("markerEvent:"+t,{originEvent:e,pageX:l,pageY:c,categoryItem:a.category,valueItem:a.value,node:r,x:h,y:p,series:u,index:s,seriesIndex:o})},_dataProviderChangeHandler:function(t){var n=t.newVal,r,i,s;this._seriesIndex=-1,this._itemIndex=-1,this instanceof e.CartesianChart&&(this.set("axes",this.get("axes")),this.set("seriesCollection",this.get("seriesCollection"))),r=this.get("axes");if(r)for(i in r)r.hasOwnProperty(i)&&(s=r[i],s instanceof e.Axis&&(s.get("position")!="none"&&this._addToAxesRenderQueue(s),s.set("dataProvider",n)))},toggleTooltip:function(e){var t=this.get("tooltip");t.visible?this.hideTooltip():t.markerEventHandler.apply(this,[e])},_showTooltip:function(e,t,n){var r=this.get("tooltip"),i=r.node;e&&(r.visible=!0,r.setTextFunction(i,e),i.setStyle("top",n+"px"),i.setStyle("left",t+"px"),i.setStyle("visibility","visible"))},_positionTooltip:function(e){var t=this.get("tooltip"),n=t.node,r=this.get("contentBox"),i=e.pageX+10-r.getX(),s=e.pageY+10-r.getY();n&&(n.setStyle("left",i+"px"),n.setStyle("top",s+"px"))},hideTooltip:function(){var e=this.get("tooltip"),t=e.node;e.visible=!1,t.set("innerHTML",""),t.setStyle("left",-1e4),t.setStyle("top",-1e4),t.setStyle("visibility","hidden")},_addTooltip:function(){var e=this.get("tooltip"),t=this.get("id")+"_tooltip",n=this.get("contentBox"),r=i.getElementById(t);r&&n.removeChild(r),e.node.set("id",t),e.node.setStyle("visibility","hidden"),n.appendChild(e.node)},_updateTooltip:function(t){var n=this.get("tooltip")||this._getTooltip(),r,i,o,u={markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",setTextFunction:"setTextFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler",show:"show"};if(s.isObject(t)){i=t.styles,o=e.one(t.node)||n.node;if(i)for(r in i)i.hasOwnProperty(r)&&o.setStyle(r,i[r]);for(r in u)t.hasOwnProperty(r)&&(n[r]=t[r]);n.node=o}return n},_getTooltip:function(){var t=i.createElement("div"),n=h("chart-tooltip"),r={setTextFunction:this._setText,markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:!0,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(e){var t=this.get("tooltip"),n=t.markerLabelFunction.apply(this,[e.categoryItem,e.valueItem,e.index,e.series,e.seriesIndex]);this._showTooltip(n,e.x+10,e.y+10)},planarEventHandler:function(e){var t=this.get("tooltip"),n,r=this.get("categoryAxis");n=t.planarLabelFunction.apply(this,[r,e.valueItem,e.index,e.items,e.seriesIndex]),this._showTooltip(n,e.x+10,e.y+10)}};return t=e.one(t),t.set("id",this.get("id")+"_tooltip"),t.setStyle("fontSize","85%"),t.setStyle("opacity","0.83"),t.setStyle("position","absolute"),t.setStyle("paddingTop","2px"),t.setStyle("paddingRight","5px"),t.setStyle("paddingBottom","4px"),t.setStyle("paddingLeft","2px"),t.setStyle("backgroundColor","#fff"),t.setStyle("border","1px solid #dbdccc"),t.setStyle("pointerEvents","none"),t.setStyle("zIndex",3),t.setStyle("whiteSpace","noWrap"),t.setStyle("visibility","hidden"),t.addClass(n),r.node=e.one(t),r},_planarLabelFunction:function(e,t,n,r,o){var u=i.createElement("div"),a,f=0,l=r.length,c,h,p,d;e&&(h=e.get("labelFunction").apply(this,[e.getKeyValueAt(this.get("categoryKey"),n),e.get("labelFormat")]),s.isObject(h)||(h=i.createTextNode(h)),u.appendChild(h));for(;f<l;++f)d=r[f],d.get("visible")&&(a=t[f],c=a.axis,p=c.get("labelFunction").apply(this,[c.getKeyValueAt(a.key,n),c.get("labelFormat")]),u.appendChild(i.createElement("br")),u.appendChild(i.createTextNode(a.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(p)||(p=i.createTextNode(p)),u.appendChild(p));return u},_tooltipLabelFunction:function(e,t,n,r,o){var u=i.createElement("div"),a=e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]),f=t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]);return u.appendChild(i.createTextNode(e.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(a)||(a=i.createTextNode(a)),u.appendChild(a),u.appendChild(i.createElement("br")),u.appendChild(i.createTextNode(t.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(f)||(f=i.createTextNode(f)),u.appendChild(f),u},_tooltipChangeHandler:function(e){if(this.get("tooltip")){var t=this.get("tooltip"),n=t.node,r=t.show,i=this.get("contentBox");n&&r&&(i.contains(n)||this._addTooltip())}},_setText:function(e,t){e.setContent(""),s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)},_getAllKeys:function(e){var t=0,n=e.length,r,i,s={};for(;t<n;++t){r=e[t];for(i in r)r.hasOwnProperty(i)&&(s[i]=!0)}return s},_buildSeriesKeys:function(e){var t,n=this.get("categoryKey"),r=[],i;if(this._seriesKeysExplicitlySet)return this._seriesKeys;t=this._getAllKeys(e);for(i in t)t.hasOwnProperty(i)&&i!=n&&r.push(i);return r}},e.ChartBase=O,e.CartesianChart=e.Base.create("cartesianChart",e.Widget,[e.ChartBase],{renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("tooltip"),s,o=h("overlay");t.setStyle("position","absolute"),n.setStyle("position","absolute"),this._addAxes(),this._addGridlines(),this._addSeries(),r&&r.show&&this._addTooltip(),this.get("styles"),this.get("interactionType")=="planar"&&(s=i.createElement("div"),this.get("contentBox").appendChild(s),this._overlay=e.one(s),this._overlay.set("id",this.get("id")+"_overlay"),this._overlay.setStyle("position","absolute"),this._overlay.setStyle("background","#fff"),this._overlay.setStyle("opacity",0),this._overlay.addClass(o),this._overlay.setStyle("zIndex",4)),this._setAriaElements(t,n),this._redraw()},_planarEventDispatcher:function(e){var t=this.get("graph"),n=this.get("boundingBox"),r=t.get("contentBox"),i=e&&e.hasOwnProperty("changedTouches"),s=i?e.changedTouches[0].pageX:e.pageX,o=i?e.changedTouches[0].pageY:e.pageY,u=s-n.getX(),a=o-n.getY(),f={x:s-r.getX(),y:o-r.getY()},l=t.get("seriesCollection"),c,h=0,p,d=this._selectedIndex,v,m=[],g=[],y=[],b=this.get("direction"),w,E,S,x,T,N,C;e.halt(!0),b=="horizontal"?(E="x",S="y"):(S="x",E="y"),x=f[E];if(l){N=l.length;while(h<N&&!T)l[h]&&(T=l[h].get(E+"MarkerPlane")),h++}if(T){N=T.length;for(h=0;h<N;++h)if(x<=T[h].end&&x>=T[h].start){p=h;break}N=l.length;for(h=0;h<N;++h)c=l[h],C=c.get(S+"coords"),w=c.get("markers"),w&&!isNaN(d)&&d>-1&&c.updateMarkerState("mouseout",d),C&&C[p]>-1&&(w&&!isNaN(p)&&p>-1&&c.updateMarkerState("mouseover",p),v=this.getSeriesItems(c,p),g.push(v.category),y.push(v.value),m.push(c));this._selectedIndex=p,p>-1?this.fire("planarEvent:mouseover",{categoryItem:g,valueItem:y,x:u,y:a,pageX:s,pageY:o,items:m,index:p,originEvent:e}):this.fire("planarEvent:mouseout")}},_type:"combo",_itemRenderQueue:null,_addToAxesRenderQueue:function(t){this._itemRenderQueue||(this._itemRenderQueue=[]),e.Array.indexOf(this._itemRenderQueue,t)<0&&this._itemRenderQueue.push(t)},_addToAxesCollection:function(e,t){var n=this.get(e+"AxesCollection");n||(n=[],this.set(e+"AxesCollection",n)),n.push(t)},_getDefaultSeriesCollection:function(){var e,t=this.get("dataProvider");return t&&(e=this._parseSeriesCollection()),e},_parseSeriesCollection:function(t){var n=this.get("direction"),r=[],i,s,o=[],u,a=this.get("seriesKeys").concat(),f,l,c,h=this.get("type"),p,d,v,m,g=[],y=this.get("categoryKey"),b=this.get("showMarkers"),w=this.get("showAreaFill"),E=this.get("showLines");t=t||[],n=="vertical"?(i="yAxis",d="yKey",s="xAxis",v="xKey"):(i="xAxis",d="xKey",s="yAxis",v="yKey"),c=t.length;while(t&&t.length>0)u=t.shift(),p=this._getBaseAttribute(u,v),p?(l=e.Array.indexOf(a,p),l>-1?(a.splice(l,1),o.push(p),r.push(u)):g.push(u)):g.push(u);while(g.length>0)u=g.shift(),a.length>0?(p=a.shift(),this._setBaseAttribute(u,v,p),o.push(p),r.push(u)):u instanceof e.CartesianSeries&&u.destroy(!0);a.length>0&&(o=o.concat(a)),c=o.length;for(f=0;f<c;++f){u=r[f]||{type:h};if(u instanceof e.CartesianSeries){this._parseSeriesAxes(u);continue}u[d]=u[d]||y,u[v]=u[v]||a.shift(),u[i]=this._getCategoryAxis(),u[s]=this._getSeriesAxis(u[v]),u.type=u.type||h,u.direction=u.direction||n;if(u.type=="combo"||u.type=="stackedcombo"||u.type=="combospline"||u.type=="stackedcombospline")w!==null&&(u.showAreaFill=u.showAreaFill!==null&&u.showAreaFill!==undefined?u.showAreaFill:w),b!==null&&(u.showMarkers=u.showMarkers!==null&&u.showMarkers!==undefined?u.showMarkers:b),E!==null&&(u.showLines=u.showLines!==null&&u.showLines!==undefined?u.showLines:E);r[f]=u}return r&&(m=this.get("graph"),m.set("seriesCollection",r),r=m.get("seriesCollection")),r},_parseSeriesAxes:function(t){var n=this.get("axes"),r=t.get("xAxis"),i=t.get("yAxis"),o=e.Axis,u;r&&!(r instanceof o)&&s.isString(r)&&n.hasOwnProperty(r)&&(u=n[r],u instanceof o&&t.set("xAxis",u)),i&&!(i instanceof o)&&s.isString(i)&&n.hasOwnProperty(i)&&(u=n[i],u instanceof o&&t.set("yAxis",u))},_getCategoryAxis:function(){var e,t=this.get("axes"),n=this.get("categoryAxisName")||this.get("categoryKey");return e=t[n],e},_getSeriesAxis:function(e,t){var n=this.get("axes"),r,i,s;if(n)if(t&&n.hasOwnProperty(t))s=n[t];else for(r in n)if(n.hasOwnProperty(r)){i=n[r].get("keys");if(i&&i.hasOwnProperty(e)){s=n[r];break}}return s},_getBaseAttribute:function(t,n){return t instanceof e.Base?t.get(n):t.hasOwnProperty(n)?t[n]:null},_setBaseAttribute:function(t,n,r){t instanceof e.Base?t.set(n,r):t[n]=r},_setAxes:function(t){var n=this._parseAxes(t),r={},i={edgeOffset:"edgeOffset",position:"position",overlapGraph:"overlapGraph",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",appendLabelFunction:"appendLabelFunction",appendTitleFunction:"appendTitleFunction",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero",title:"title",width:"width",height:"height"},s=this.get("dataProvider"),o,u,a,f,l,c,h,p,d;for(u in n)if(n.hasOwnProperty(u)){c=n[u];if(c instanceof e.Axis)f=c;else{f=null,p={},p.dataProvider=c.dataProvider||s,p.keys=c.keys,c.hasOwnProperty("roundingUnit")&&(p.roundingUnit=c.roundingUnit),a=c.position,c.styles&&(p.styles=c.styles),p.position=c.position;for(o in i)i.hasOwnProperty(o)&&c.hasOwnProperty(o)&&(p[o]=c[o]);t&&(f=this.getAxisByKey(u)),f&&f instanceof e.Axis?(l=f.get("position"),a!=l&&(l!="none"&&(d=this.get(l+"AxesCollection"),d.splice(e.Array.indexOf(d,f),1)),a!="none"&&this._addToAxesCollection(a,f)),f.setAttrs(p)):(h=this._getAxisClass(c.type),f=new h(p),f.after("axisRendered",e.bind(this._itemRendered,this)))}f&&(d=this.get(a+"AxesCollection"),d&&e.Array.indexOf(d,f)>0&&f.set("overlapGraph",!1),r[u]=f)}return r},_addAxes:function(){var t=this.get("axes"),n,r,i,s=this.get("width"),o=this.get("height"),u=e.Node.one(this._parentNode);this._axesCollection||(this._axesCollection=[]);for(n in t)t.hasOwnProperty(n)&&(r=t[n],r instanceof e.Axis&&(s||(this.set("width",u.get("offsetWidth")),s=this.get("width")),o||(this.set("height",u.get("offsetHeight")),o=this.get("height")),this._addToAxesRenderQueue(r),i=r.get("position"),this.get(i+"AxesCollection")?this.get(i+"AxesCollection").push(r):this.set(i+"AxesCollection",[r]),this._axesCollection.push(r),r.get("keys").hasOwnProperty(this.get("categoryKey"))&&this.set("categoryAxis",r),r.render(this.get("contentBox"))))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");e.render(this.get("contentBox"))},_addGridlines:function(){var t=this.get("graph"),n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("direction"),s=this.get("leftAxesCollection"),o=this.get("rightAxesCollection"),u=this.get("bottomAxesCollection"),a=this.get("topAxesCollection"),f,l=this.get("categoryAxis"),c,h;this._axesCollection&&(f=this._axesCollection.concat(),f.splice(e.Array.indexOf(f,l),1)),n&&(s&&s[0]?c=s[0]:o&&o[0]?c=o[0]:c=i=="horizontal"?l:f[0],!this._getBaseAttribute(n,"axis")&&c&&this._setBaseAttribute(n,"axis",c),this._getBaseAttribute(n,"axis")&&t.set("horizontalGridlines",n)),r&&(u&&u[0]?h=u[0]:a&&a[0]?h=a[0]:h=i=="vertical"?l:f[0],!this._getBaseAttribute(r,"axis")&&h&&this._setBaseAttribute(r,"axis",h),this._getBaseAttribute(r,"axis")&&t.set("verticalGridlines",r))},_getDefaultAxes:function(){var e;return this.get("dataProvider")&&(e=this._parseAxes()),e},_parseAxes:function(t){var n=this.get("categoryKey"),r,i,o,u={},a=[],f=this.get("categoryAxisName")||this.get("categoryKey"),l=this.get("valueAxisName"),c=this.get("seriesKeys").concat(),h,p,d,v,m,g=this.get("direction"),y,b,w=[],E=this.get("stacked")?"stacked":"numeric";g=="vertical"?(y="bottom",b="left"):(y="left",b="bottom");if(t)for(h in t)if(t.hasOwnProperty(h)){r=t[h],o=this._getBaseAttribute(r,"keys"),i=this._getBaseAttribute(r,"type");if(i=="time"||i=="category")f=h,this.set("categoryAxisName",h),s.isArray(o)&&o.length>0&&(n=o[0],this.set("categoryKey",n)),u[h]=r;else if(h==f)u[h]=r;else{u[h]=r;if(h!=l&&o&&s.isArray(o)){v=o.length;for(d=0;d<v;++d)a.push(o[d]);w.push(u[h])}this._getBaseAttribute(u[h],"type")||this._setBaseAttribute(u[h],"type",E),this._getBaseAttribute(u[h],"position")||this._setBaseAttribute(u[h],"position",this._getDefaultAxisPosition(u[h],w,y))}}m=e.Array.indexOf(c,n),m>-1&&c.splice(m,1),p=a.length;for(h=0;h<p;++h)m=e.Array.indexOf(c,a[h]),m>-1&&c.splice(m,1);return u.hasOwnProperty(f)||(u[f]={}),this._getBaseAttribute(u[f],"keys")||this._setBaseAttribute(u[f],"keys",[n]),this._getBaseAttribute(u[f],"position")||this._setBaseAttribute(u[f],"position",b),this._getBaseAttribute(u[f],"type")||this._setBaseAttribute(u[f],"type",this.get("categoryType")),!u.hasOwnProperty(l)&&c&&c.length>0&&(u[l]={keys:c},w.push(u[l])),a.length>0&&(c.length>0?c=a.concat(c):c=a),u.hasOwnProperty(l)&&(this._getBaseAttribute(u[l],"position")||this._setBaseAttribute(u[l],"position",this._getDefaultAxisPosition(u[l],w,y)),this._setBaseAttribute(u[l],"type",E),this._setBaseAttribute(u[l],"keys",c)),this._seriesKeysExplicitlySet||(this._seriesKeys=c),u},_getDefaultAxisPosition:function(t,n,r){var i=this.get("direction"),s=e.Array.indexOf(n,t);return n[s-1]&&n[s-1].position&&(i=="horizontal"?n[s-1].position=="left"?r="right":n[s-1].position=="right"&&(r="left"):n[s-1].position=="bottom"?r="top":r="bottom"),r},getSeriesItems:function(e,t){var n=e.get("xAxis"),r=e.get("yAxis"),i=e.get("xKey"),s=e.get("yKey"),o,u;return this.get("direction")=="vertical"?(o={axis:r,key:s,value:r.getKeyValueAt(s,t)},u={axis:n,key:i,value:n.getKeyValueAt(i,t)}):(u={axis:r,key:s,value:r.getKeyValueAt(s,t)},o={axis:n,key:i,value:n.getKeyValueAt(i,t)}),o.displayName=e.get("categoryDisplayName"),u.displayName=e.get("valueDisplayName"),o.value=o.axis.getKeyValueAt(o.key,t),u.value=u.axis.getKeyValueAt(u.key,t),{category:o,value:u}},_sizeChanged:function(e){if(this._axesCollection){var t=this._axesCollection,n=0,r=t.length;for(;n<r;++n)this._addToAxesRenderQueue(t[n]);this._redraw()}},_getTopOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,Math.abs(o.getMaxLabelBounds().top)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,Math.abs(o.getMaxLabelBounds().top)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getRightOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,o.getMaxLabelBounds().right-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,o.getMaxLabelBounds().right-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getLeftOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,Math.abs(o.getMinLabelBounds().left)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,Math.abs(o.getMinLabelBounds().left)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getBottomOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,o.getMinLabelBounds().bottom-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,o.getMinLabelBounds().bottom-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=0,r=0,i=0,s=0,o=this.get("leftAxesCollection"),u=this.get("rightAxesCollection"),a=this.get("topAxesCollection"),f=this.get("bottomAxesCollection"),l=0,c,h,p="visible",d=this.get("graph"),v,m,g,y,b,w,E,S,x=this.get("allowContentOverflow"),T,N,C,k,L,A={};if(o){C=[],c=o.length;for(l=c-1;l>-1;--l)C.unshift(n),n+=o[l].get("width")}if(u){N=[],c=u.length,l=0;for(l=c-1;l>-1;--l)r+=u[l].get("width"),N.unshift(e-r)}if(a){k=[],c=a.length;for(l=c-1;l>-1;--l)k.unshift(i),i+=a[l].get("height")}if(f){L=[],c=f.length;for(l=c-1;l>-1;--l)s+=f[l].get("height"),L.unshift(t-s)}b=e-(n+r),w=t-(s+i),A.left=n,A.top=i,A.bottom=t-s,A.right=e-r;if(!x){v=this._getTopOverflow(o,u),m=this._getBottomOverflow(o,u),g=this._getLeftOverflow(f,a),y=this._getRightOverflow(f,a),T=v-i;if(T>0){A.top=v;if(k){l=0,c=k.length;for(;l<c;++l)k[l]+=T}}T=m-s;if(T>0){A.bottom=t-m;if(L){l=0,c=L.length;for(;l<c;++l)L[l]-=T}}T=g-n;if(T>0){A.left=g;if(C){l=0,c=C.length;for(;l<c;++l)C[l]+=T}}T=y-r;if(T>0){A.right=e-y;if(N){l=0,c=N.length;for(;l<c;++l)N[l]-=T}}}b=A.right-A.left,w=A.bottom-A.top,E=A.left,S=A.top;if(a){c=a.length,l=0;for(;l<c;l++)h=a[l],h.get("width")!==b&&h.set("width",b),h.get("boundingBox").setStyle("left",E+"px"),h.get("boundingBox").setStyle("top",k[l]+"px");h._hasDataOverflow()&&(p="hidden")}if(f){c=f.length,l=0;for(;l<c;l++)h=f[l],h.get("width")!==b&&h.set("width",b),h.get("boundingBox").setStyle("left",E+"px"),h.get("boundingBox").setStyle("top",L[l]+"px");h._hasDataOverflow()&&(p="hidden")}if(o){c=o.length,l=0;for(;l<c;++l)h=o[l],h.get("boundingBox").setStyle("top",S+"px"),h.get("boundingBox").setStyle("left",C[l]+"px"),h.get("height")!==w&&h.set("height",w);h._hasDataOverflow()&&(p="hidden")}if(u){c=u.length,l=0;for(;l<c;++l)h=u[l],h.get("boundingBox").setStyle("top",S+"px"),h.get("boundingBox").setStyle("left",N[l]+"px"),h.get("height")!==w&&h.set("height",w);h._hasDataOverflow()&&(p="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}d&&(d.get("boundingBox").setStyle("left",E+"px"),d.get("boundingBox").setStyle("top",S+"px"),d.set("width",b),d.set("height",w),d.get("boundingBox").setStyle("overflow",p)),this._overlay&&(this._overlay.setStyle("left",E+"px"),this._overlay.setStyle("top",S+"px"),this._overlay.setStyle("width",b+"px"),this._overlay.setStyle("height",w+"px"))},destructor:function(){var t=this.get("graph"),n=0,r,i=this.get("seriesCollection"),s=this._axesCollection,o=this.get("tooltip").node;this._description&&(this._description.empty(),this._description.remove(!0)),this._liveRegion&&(this._liveRegion.empty(),this._liveRegion.remove(!0)),r=i?i.length:0;for(;n<r;++n)i[n]instanceof e.CartesianSeries&&i[n].destroy(!0);r=s?s.length:0;for(n=0;n<r;++n)s[n]instanceof e.Axis&&s[n].destroy(!0);t&&t.destroy(!0),o&&(o.empty(),o.remove(!0)),this._overlay&&(this._overlay.empty(),this._overlay.remove(!0))},_getAriaMessage:function(e){var t="",n,r,i,s,o=this._seriesIndex,u=this._itemIndex,a=this.get("seriesCollection"),f=a.length,l;return e%2===0?(f>1?(e===38?o=o<1?f-1:o-1:e===40&&(o=o>=f-1?0:o+1),this._itemIndex=-1):o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."):(o>-1?(t="",n=this.getSeries(parseInt(o,10))):(o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."),l=n._dataLength?n._dataLength:0,e===37?u=u>0?u-1:l-1:e===39&&(u=u>=l-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(n,u),i=r.category,s=r.value,i&&s&&i.value&&s.value?(t+=i.displayName+": "+i.axis.formatLabel.apply(this,[i.value,i.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", "):t+="No data available.",t+=u+1+" of "+l+". "),t}},{ATTRS:{allowContentOverflow:{value:!1},axesStyles:{getter:function(){var t=this.get("axes"),n,r=this._axesStyles;if(t)for(n in t)t.hasOwnProperty(n)&&t[n]instanceof e.Axis&&(r||(r={}),r[n]=t[n].get("styles"));return r},setter:function(e){var t=this.get("axes"),n;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&this._setBaseAttribute(t[n],"styles",e[n])}},seriesStyles:{getter:function(){var e=this._seriesStyles,t=this.get("graph"),n,r;if(t){n=t.get("seriesDictionary");if(n){e={};for(r in n)n.hasOwnProperty(r)&&(e[r]=n[r].get("styles"))}}return e},setter:function(e){var t,n,r;if(s.isArray(e)){r=this.get("seriesCollection"),t=0,n=e.length;for(;t<n;++t)this._setBaseAttribute(r[t],"styles",e[t])}else for(t in e)e.hasOwnProperty(t)&&(r=this.getSeries(t),this._setBaseAttribute(r,"styles",e[t]))}},graphStyles:{getter:function(){var e=this.get("graph");return e?e.get("styles"):this._graphStyles},setter:function(e){var t=this.get("graph");this._setBaseAttribute(t,"styles",e)}},styles:{getter:function(){var e={axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")};return e},setter:function(e){e.hasOwnProperty("axes")&&(this.get("axesStyles")?this.set("axesStyles",e.axes):this._axesStyles=e.axes),e.hasOwnProperty("series")&&(this.get("seriesStyles")?this.set("seriesStyles",e.series):this._seriesStyles=e.series),e.hasOwnProperty("graph")&&this.set("graphStyles",e.graph)}},axes:{valueFn:"_getDefaultAxes",setter:function(e){return this.get("dataProvider")&&(e=this._setAxes(e)),e}},seriesCollection:{valueFn:"_getDefaultSeriesCollection",setter:function(e){return this.get("dataProvider")&&(e=this._parseSeriesCollection(e)),e}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:!1},direction:{getter:function(){var e=this.get("type");return e=="bar"?"vertical":e=="column"?"horizontal":this._direction},setter:function(e){return this._direction=e,this._direction}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("horizontalGridlines"):this._horizontalGridlines},setter:function(e){var t=this.get("graph");e&&!s.isObject(e)&&(e={}),t?t.set("horizontalGridlines",e):this._horizontalGridlines=e}},verticalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("verticalGridlines"):this._verticalGridlines},setter:function(e){var t=this.get("graph");e&&!s.isObject(e)&&(e={}),t?t.set("verticalGridlines",e):this._verticalGridlines=e}},type:{getter:function(){return this.get("stacked")?"stacked"+this._type:this._type},setter:function(e){return this._type=="bar"?e!="bar"&&this.set("direction","horizontal"):e=="bar"&&this.set("direction","vertical"),this._type=e,this._type}},categoryAxis:{}}}),e.PieChart=e.Base.create("pieChart",e.Widget,[e.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection)return this._seriesCollection;var e=this.get("axes"),t=[],n,r=0,i,s=this.get("type"),o,u="categoryAxis",a="categoryKey",f="valueAxis",l="valueKey";if(e){n=e.values.get("keyCollection"),o=e.category.get("keyCollection")[0],i=n.length;for(;r<i;++r)t[r]={type:s},t[r][u]="category",t[r][f]="values",t[r][a]=o,t[r][l]=n[r]}return this._seriesCollection=t,t},_parseAxes:function(t){this._axes||(this._axes={});var n,r,i,s,o,u,a=this.get("type"),f=this.get("width"),l=this.get("height"),c=e.Node.one(this._parentNode);f||(this.set("width",c.get("offsetWidth")),f=this.get("width")),l||(this.set("height",c.get("offsetHeight")),l=this.get("height"));for(n in t)t.hasOwnProperty(n)&&(s=t[n],r=a=="pie"?"none":s.position,u=this._getAxisClass(s.type),o={dataProvider:this.get("dataProvider")},s.hasOwnProperty("roundingUnit")&&(o.roundingUnit=s.roundingUnit),o.keys=s.keys,o.width=f,o.height=l,o.position=r,o.styles=s.styles,i=new u(o),i.on("axisRendered",e.bind(this._itemRendered,this)),this._axes[n]=i)},_addAxes:function(){var e=this.get("axes"),t,n,r;e||(this.set("axes",this._getDefaultAxes()),e=this.get("axes")),this._axesCollection||(this._axesCollection=[]);for(t in e)e.hasOwnProperty(t)&&(n=e[t],r=n.get("position"),this.get(r+"AxesCollection")?this.get(r+"AxesCollection").push(n):this.set(r+"AxesCollection",[n]),this._axesCollection.push(n))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");this._parseSeriesAxes(t),e.set("showBackground",!1),e.set("width",this.get("width")),e.set("height",this.get("height")),e.set("seriesCollection",t),this._seriesCollection=e.get("seriesCollection"),e.render(this.get("contentBox"))},_parseSeriesAxes:function(t){var n=0,r=t.length,i,s=this.get("axes"),o;for(;n<r;++n){i=t[n];if(i){if(i instanceof e.PieSeries){o=i.get("categoryAxis"),o&&!(o instanceof e.Axis)&&i.set("categoryAxis",s[o]),o=i.get("valueAxis"),o&&!(o instanceof e.Axis)&&i.set("valueAxis",s[o]);continue}i.categoryAxis=s.category,i.valueAxis=s.values,i.type||(i.type=this.get("type"))}}},_getDefaultAxes:function(){var e=this.get("categoryKey"),t=this.get("seriesKeys").concat(),n="numeric";return{values:{keys:t,type:n},category:{keys:[e],type:this.get("categoryType")}}},getSeriesItems:function(e,t){var n={axis:e.get("categoryAxis"),key:e.get("categoryKey"),displayName:e.get("categoryDisplayName")},r={axis:e.get("valueAxis"),key:e.get("valueKey"),displayName:e.get("valueDisplayName")};return n.value=n.axis.getKeyValueAt(n.key,t),r.value=r.axis.getKeyValueAt(r.key,t),{category:n,value:r}},_sizeChanged:function(e){this._redraw()},_redraw:function(){var e=this.get("graph"),t=this.get("width"),n=this.get("height"),r;e&&(r=Math.min(t,n),e.set("width",r),e.set("height",r))},_tooltipLabelFunction:function(e,t,n,r,s){var o=i.createElement("div"),u=r.getTotalValues(),a=Math.round(t.value/u*1e4)/100;return o.appendChild(i.createTextNode(e.displayName+": "+e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]))),o.appendChild(i.createElement("br")),o.appendChild(i.createTextNode(t.displayName+": "+t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]))),o.appendChild(i.createElement("br")),o.appendChild(i.createTextNode(a+"%")),o},_getAriaMessage:function(e){var t="",n,r,i,s,o=0,u=this._itemIndex,a=this.get("seriesCollection"),f,l,c,h;return i=this.getSeries(parseInt(o,10)),h=i.get("markers"),f=h&&h.length?h.length:0,e===37?u=u>0?u-1:f-1:e===39&&(u=u>=f-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(i,u),n=r.category,s=r.value,l=i.getTotalValues(),c=Math.round(s.value/l*1e4)/100,n&&s?(t+=n.displayName+": "+n.axis.formatLabel.apply(this,[n.value,n.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", ",t+="Percent of total "+s.displayName+": "+c+"%,"):t+="No data available,",t+=u+1+" of "+f+". ",t}},{ATTRS:{ariaDescription:{value:"Use the left and right keys to navigate through items.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},axes:{getter:function(){return this._axes},setter:function(e){this._parseAxes(e)}},seriesCollection:{getter:function(){return this._getSeriesCollection()},setter:function(e){return this._setSeriesCollection(e)}},type:{value:"pie"}}})},"3.7.2",{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]});+YUI.add("charts-base",function(e,t){function b(){}function w(e){w.superclass.constructor.apply(this,arguments)}function E(e){E.superclass.constructor.apply(this,arguments)}function S(e){S.superclass.constructor.apply(this,arguments)}function x(e){x.superclass.constructor.apply(this,arguments)}function T(){}function N(){}function C(){}function k(t){var n={area:{getter:function(){return this._defaults||this._getAreaDefaults()},setter:function(t){var n=this._defaults||this._getAreaDefaults();this._defaults=e.merge(n,t)}}};this.addAttrs(n,t),this.get("styles")}function L(e){var t={markers:{getter:function(){return this._markers}}};this.addAttrs(t,e)}function A(){}function O(){}var n=e.config,r=n.win,i=n.doc,s=e.Lang,o=s.isString,u=e.DOM,a,f,l,c,h=e.ClassNameManager.getClassName,p=h("seriesmarker"),d,v,m,g,y;d=function(e){d.superclass.constructor.apply(this,arguments)},d.NAME="shapeGroup",e.extend(d,e.Path,{_draw:function(){var e=this.get("xvalues"),t=this.get("yvalues"),n,r,i,o,u=0,a,f=[],l=this.get("dimensions"),c=l.width,h=l.height,p=l.radius,d=l.yRadius,v=this.get("id"),m=this.node.className,g=s.isArray(c),y=s.isArray(h),b=s.isArray(p),w=s.isArray(d);if(e&&t&&e.length>0){this.clear(),a=e.length;for(;u<a;++u)n=e[u],r=t[u],i=b?p[u]:p,o=w?d[u]:d,!isNaN(n)&&!isNaN(r)&&!isNaN(i)&&(this.drawShape({x:n,y:r,width:g?c[u]:c,height:y?h[u]:h,radius:i,yRadius:o}),this.closePath(),f[u]={id:v+"_"+u,className:m,coords:n-this._left+", "+(r-this._top)+", "+p,shape:"circle"});this._closePath()}},_getRadiusCollection:function(e){var t=0,n=e.length,r=[];for(;t<n;++t)r[t]=e[t]*.5;return r}}),d.ATTRS=e.merge(e.Path.ATTRS,{dimensions:{getter:function(){var e=this._dimensions,t,n,r,i;return e.hasOwnProperty("radius")?e:(r=e.width,i=e.height,t=s.isArray(r)?this._getRadiusCollection(r):r*.5,n=s.isArray(i)?this._getRadiusCollection(i):i*.5,{width:r,height:i,radius:t,yRadius:n})},setter:function(e){return this._dimensions=e,e}},xvalues:{getter:function(){return this._xvalues},setter:function(e){this._xvalues=e}},yvalues:{getter:function(){return this._yvalues},setter:function(e){this._yvalues=e}}}),e.ShapeGroup=d,v=function(e){v.superclass.constructor.apply(this,arguments)},v.NAME="circleGroup",e.extend(v,e.ShapeGroup,{drawShape:function(e){this.drawCircle(e.x,e.y,e.radius)}}),v.ATTRS=e.merge(e.ShapeGroup.ATTRS,{dimensions:{getter:function(){var e=this._dimensions,t,n,r,i;return e.hasOwnProperty("radius")?e:(r=e.width,i=e.height,t=s.isArray(r)?this._getRadiusCollection(r):r*.5,n=t,{width:r,height:i,radius:t,yRadius:n})}}}),v.ATTRS=e.ShapeGroup.ATTRS,e.CircleGroup=v,m=function(e){m.superclass.constructor.apply(this,arguments)},m.NAME="rectGroup",e.extend(m,e.ShapeGroup,{drawShape:function(e){this.drawRect(e.x,e.y,e.width,e.height)}}),m.ATTRS=e.ShapeGroup.ATTRS,e.RectGroup=m,y=function(e){y.superclass.constructor.apply(this,arguments)},y.NAME="diamondGroup",e.extend(y,e.ShapeGroup,{drawShape:function(e){this.drawDiamond(e.x,e.y,e.width,e.height)}}),y.ATTRS=e.ShapeGroup.ATTRS,e.DiamondGroup=y,g=function(e){g.superclass.constructor.apply(this,arguments)},g.NAME="diamondGroup",e.extend(g,e.ShapeGroup,{drawShape:function(e){this.drawEllipse(e.x,e.y,e.width,e.height)}}),g.ATTRS=e.ShapeGroup.ATTRS,e.EllipseGroup=g,b.ATTRS={styles:{getter:function(){return this._styles=this._styles||this._getDefaultStyles(),this._styles},setter:function(e){this._styles=this._setStyles(e)}},graphic:{}},b.NAME="renderer",b.prototype={_styles:null,_setStyles:function(e){var t=this.get("styles");return this._mergeStyles(e,t)},_mergeStyles:function(t,n){n||(n={});var r=e.merge(n,{});return e.Object.each(t,function(e,t,i){n.hasOwnProperty(t)&&s.isObject(e)&&!s.isFunction(e)&&!s.isArray(e)?r[t]=this._mergeStyles(e,n[t]):r[t]=e},this),r},_getDefaultStyles:function(){return{padding:{top:0,right:0,bottom:0,left:0}}}},e.augment(b,e.Attribute),e.Renderer=b,a=function(){},a.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:4,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("topTickOffset",0),e.set("bottomTickOffset",0);switch(i){case"inside":e.set("rightTickOffset",n),e.set("leftTickOffset",0);break;case"outside":e.set("rightTickOffset",0),e.set("leftTickOffset",n);break;case"cross":e.set("rightTickOffset",r),e.set("leftTickOffset",r);break;default:e.set("rightTickOffset",0),e.set("leftTickOffset",0)}},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:s.left,y:t.y},a={x:o+s.left,y:t.y};r.drawLine(e,u,a)},getLineStart:function(){var e=this.get("styles"),t=e.padding,n=e.majorTicks,r=n.length,i=n.display,s={x:t.left,y:0};return i==="outside"?s.x+=r:i==="cross"&&(s.x+=r/2),s},getLabelPoint:function(e){return{x:e.x-this.get("leftTickOffset"),y:e.y}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=e:s===90?a=t:a=u*e+o*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitWidth){var t=this,n=t._explicitWidth,r=t._totalTitleSize,i=t.get("leftTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=n.right-n.left,o=e.offsetWidth,u=e.offsetHeight,a=o*-0.5+s*.5,f=t.get("height")*.5-u*.5;i.labelWidth=o,i.labelHeight=u,r&&r.left&&(a+=r.left),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("leftTickOffset"),o=this._totalTitleSize,u=t.x+o-s,a=t.y,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=i._maxLabelSize,p=this._labelWidths[r],d=this._labelHeights[r];l===0?(u-=p,a-=d*.5):l===90?u-=p*.5:l===-90?(u-=p*.5,a-=d):(u-=p+d*c/360,a-=d*.5),f.labelWidth=p,f.labelHeight=d,f.x=Math.round(h+u),f.y=Math.round(a),this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r,i,s=e.labelWidth,o=e.labelHeight;t===0?(r=s,i=o*.5):t===90?(i=0,r=s*.5):t===-90?(r=s*.5,i=o):(r=s+o*n/360,i=o*.5),e.x-=r,e.y-=i},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[.5,0]:e===-90?t=[.5,1]:t=[1,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=this.get("graphic"),n=e.get("styles"),r=n.label,i=e.get("leftTickOffset"),s=e._maxLabelSize,o=this._totalTitleSize,u=Math.round(o+i+s+r.margin.right);this._explicitWidth&&(u=this._explicitWidth),this.set("calculatedWidth",u),t.set("x",u-i)}},e.LeftAxisLayout=a,f=function(){},f.prototype={_getDefaultMargins:function(){return{top:0,left:4,right:0,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("topTickOffset",0),e.set("bottomTickOffset",0);switch(i){case"inside":e.set("leftTickOffset",n),e.set("rightTickOffset",0);break;case"outside":e.set("leftTickOffset",0),e.set("rightTickOffset",n);break;case"cross":e.set("rightTickOffset",r),e.set("leftTickOffset",r);break;default:e.set("leftTickOffset",0),e.set("rightTickOffset",0)}},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:s.left,y:t.y},a={x:s.left+o,y:t.y};r.drawLine(e,u,a)},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:n.left,y:n.top};return s==="inside"?o.x+=i:s==="cross"&&(o.x+=i/2),o},getLabelPoint:function(e){return{x:e.x+this.get("rightTickOffset"),y:e.y}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=e:s===90?a=t:a=u*e+o*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitWidth){var t=this,n=t._explicitWidth,r=this._totalTitleSize,i=t.get("rightTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.right-n.left,a=this.get("width")-s*.5-u*.5,f=t.get("height")*.5-o*.5;i.labelWidth=s,i.labelHeight=o,r&&r.right&&(a-=r.left),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("rightTickOffset"),o=n.label,u=0,a=t.x,f=t.y,l=this._labelRotationProps,c=l.rot,h=l.absRot,p=this._labelWidths[r],d=this._labelHeights[r];o.margin&&o.margin.left&&(u=o.margin.left),c===0?f-=d*.5:c===90?(a-=p*.5,f-=d):c===-90?a-=p*.5:(f-=d*.5,a+=d/2*h/90),a+=u,a+=s,l.labelWidth=p,l.labelHeight=d,l.x=Math.round(a),l.y=Math.round(f),this._rotate(e,l)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=0,i=0,s=e.labelWidth,o=e.labelHeight;t===0?i=o*.5:t===90?(r=s*.5,i=o):t===-90?r=s*.5:(i=o*.5,r=o/2*n/90),e.x-=r,e.y-=i},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[.5,1]:e===-90?t=[.5,0]:t=[0,.5],t},offsetNodeForTick:function(e){var t=this,n=t.get("leftTickOffset"),r=0-n;e.setStyle("left",r)},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=this._totalTitleSize,i=Math.round(e.get("rightTickOffset")+e._maxLabelSize+r+n.margin.left);this._explicitWidth&&(i=this._explicitWidth),e.set("calculatedWidth",i),e.get("contentBox").setStyle("width",i)}},e.RightAxisLayout=f,l=function(){},l.prototype={_getDefaultMargins:function(){return{top:4,left:0,right:0,bottom:0}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("topTickOffset",n),e.set("bottomTickOffset",0);break;case"outside":e.set("topTickOffset",0),e.set("bottomTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this.get("styles"),t=e.padding,n=e.majorTicks,r=n.length,i=n.display,s={x:0,y:t.top};return i==="inside"?s.y+=r:i==="cross"&&(s.y+=r/2),s},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y+this.get("bottomTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("bottomTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=n.bottom-n.top,o=e.offsetWidth,u=e.offsetHeight,a=t.get("width")*.5-o*.5,f=t.get("height")-u/2-s/2;i.labelWidth=o,i.labelHeight=u,r&&r.bottom&&(f-=r.bottom),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=i.get("bottomTickOffset"),o=n.label,u=0,a=i._labelRotationProps,f=a.rot,l=a.absRot,c=Math.round(t.x),h=Math.round(t.y),p=i._labelWidths[r],d=i._labelHeights[r];o.margin&&o.margin.top&&(u=o.margin.top),f>0?h-=d/2*f/90:f<0?(c-=p,h-=d/2*l/90):c-=p*.5,h+=u,h+=s,a.labelWidth=p,a.labelHeight=d,a.x=c,a.y=h,i._rotate(e,a)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t>0?(s=0,o=i/2*t/90):t<0?(s=r,o=i/2*n/90):(s=r*.5,o=0),e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e>0?t=[0,.5]:e<0?t=[1,.5]:t=[0,0],t},offsetNodeForTick:function(e){var t=this;t.get("contentBox").setStyle("top",0-t.get("topTickOffset"))},setCalculatedSize:function(){var e=this,t=e.get("styles"),n=t.label,r=e._totalTitleSize,i=Math.round(e.get("bottomTickOffset")+e._maxLabelSize+n.margin.top+r);e._explicitHeight&&(i=e._explicitHeight),e.set("calculatedHeight",i)}},e.BottomAxisLayout=l,c=function(){},c.prototype={_getDefaultMargins:function(){return{top:0,left:0,right:0,bottom:4}},setTickOffsets:function(){var e=this,t=e.get("styles").majorTicks,n=t.length,r=n*.5,i=t.display;e.set("leftTickOffset",0),e.set("rightTickOffset",0);switch(i){case"inside":e.set("bottomTickOffset",n),e.set("topTickOffset",0);break;case"outside":e.set("bottomTickOffset",0),e.set("topTickOffset",n);break;case"cross":e.set("topTickOffset",r),e.set("bottomTickOffset",r);break;default:e.set("topTickOffset",0),e.set("bottomTickOffset",0)}},getLineStart:function(){var e=this,t=e.get("styles"),n=t.padding,r=t.majorTicks,i=r.length,s=r.display,o={x:0,y:n.top};return s==="outside"?o.y+=i:s==="cross"&&(o.y+=i/2),o},drawTick:function(e,t,n){var r=this,i=r.get("styles"),s=i.padding,o=n.length,u={x:t.x,y:s.top},a={x:t.x,y:o+s.top};r.drawLine(e,u,a)},getLabelPoint:function(e){return{x:e.x,y:e.y-this.get("topTickOffset")}},updateMaxLabelSize:function(e,t){var n=this,r=this._labelRotationProps,i=r.rot,s=r.absRot,o=r.sinRadians,u=r.cosRadians,a;i===0?a=t:s===90?a=e:a=o*e+u*t,n._maxLabelSize=Math.max(n._maxLabelSize,a)},getExplicitlySized:function(e){if(this._explicitHeight){var t=this,n=t._explicitHeight,r=t._totalTitleSize,i=t.get("topTickOffset"),s=e.label.margin.right;return t._maxLabelSize=n-(i+s+r),!0}return!1},positionTitle:function(e){var t=this,n=t._titleBounds,r=t.get("styles").title.margin,i=t._titleRotationProps,s=e.offsetWidth,o=e.offsetHeight,u=n.bottom-n.top,a=t.get("width")*.5-s*.5,f=u/2-o/2;i.labelWidth=s,i.labelHeight=o,r&&r.top&&(f+=r.top),i.x=a,i.y=f,i.transformOrigin=[.5,.5],t._rotate(e,i)},positionLabel:function(e,t,n,r){var i=this,s=this._totalTitleSize,o=i._maxLabelSize,u=t.x,a=t.y+s+o,f=this._labelRotationProps,l=f.rot,c=f.absRot,h=this._labelWidths[r],p=this._labelHeights[r];l===0?(u-=h*.5,a-=p):l===90?(u-=h,a-=p*.5):l===-90?a-=p*.5:l>0?(u-=h,a-=p-p*l/180):a-=p-p*c/180,f.x=Math.round(u),f.y=Math.round(a),f.labelWidth=h,f.labelHeight=p,this._rotate(e,f)},_setRotationCoords:function(e){var t=e.rot,n=e.absRot,r=e.labelWidth,i=e.labelHeight,s,o;t===0?(s=r*.5,o=i):t===90?(s=r,o=i*.5):t===-90?o=i*.5:t>0?(s=r,o=i-i*t/180):o=i-i*n/180,e.x-=s,e.y-=o},_getTransformOrigin:function(e){var t;return e===0?t=[0,0]:e===90?t=[1,.5]:e===-90?t=[0,.5]:e>0?t=[1,.5]:t=[0,.5],t},offsetNodeForTick:function(e){},setCalculatedSize:function(){var e=this,t=e.get("graphic"),n=e.get("styles"),r=n.label.margin,i=r.bottom+e._maxLabelSize,s=e._totalTitleSize,o=this.get("topTickOffset"),u=Math.round(o+i+s);this._explicitHeight&&(u=this._explicitWidth),e.set("calculatedHeight",u),t.set("y",u-o)}},e.TopAxisLayout=c,e.Axis=e.Base.create("axis",e.Widget,[e.Renderer],{_calculatedWidth:0,_calculatedHeight:0,_dataChangeHandler:function(e){this.get("rendered")&&this._drawAxis()},_positionChangeHandler:function(e){this._updateGraphic(e.newVal),this._updateHandler()},_updateGraphic:function(e){var t=this.get("graphic");e=="none"?t&&t.destroy():t||this._setCanvas()},_updateHandler:function(e){this.get("rendered")&&this._drawAxis()},renderUI:function(){this._updateGraphic(this.get("position"))},syncUI:function(){var e=this._layout,t,n,r,i,s;if(e){t=e._getDefaultMargins(),n=this.get("styles"),r=n.label.margin,i=n.title.margin;for(s in t)t.hasOwnProperty(s)&&(r[s]=r[s]===undefined?t[s]:r[s],i[s]=i[s]===undefined?t[s]:i[s])}this._drawAxis()},_setCanvas:function(){var t=this.get("contentBox"),n=this.get("boundingBox"),r=this.get("position"),i=this._parentNode,s=this.get("width"),o=this.get("height");n.setStyle("position","absolute"),n.setStyle("zIndex",2),s=s?s+"px":i.getStyle("width"),o=o?o+"px":i.getStyle("height"),r==="top"||r==="bottom"?t.setStyle("width",s):t.setStyle("height",o),t.setStyle("position","relative"),t.setStyle("left","0px"),t.setStyle("top","0px"),this.set("graphic",new e.Graphic),this.get("graphic").render(t)},_getDefaultStyles:function(){var t={majorTicks:{display:"inside",length:4,color:"#dad8c9",weight:1,alpha:1},minorTicks:{display:"none",length:2,color:"#dad8c9",weight:1},line:{weight:1,color:"#dad8c9",alpha:1},majorUnit:{determinant:"count",count:11,distance:75},top:"0px",left:"0px",width:"100px",height:"100px",label:{color:"#808080",alpha:1,fontSize:"85%",rotation:0,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},title:{color:"#808080",alpha:1,fontSize:"85%",rotation:undefined,margin:{top:undefined,right:undefined,bottom:undefined,left:undefined}},hideOverlappingLabelTicks:!1};return e.merge(e.Renderer.prototype._getDefaultStyles(),t)},_handleSizeChange:function(e){var t=e.attrName,n=this.get("position"),r=n=="left"||n=="right",i=this.get("contentBox"),s=n=="bottom"||n=="top";i.setStyle("width",this.get("width")),i.setStyle("height",this.get("height")),(s&&t=="width"||r&&t=="height")&&this._drawAxis()},_layoutClasses:{top:c,bottom:l,left:a,right:f},drawLine:function(e,t,n){e.moveTo(t.x,t.y),e.lineTo(n.x,n.y)},_getTextRotationProps:function(e){if(e.rotation===undefined)switch(this.get("position")){case"left":e.rotation=-90;break;case"right":e.rotation=90;break;default:e.rotation=0}var t=Math.min(90,Math.max(-90,e.rotation)),n=Math.abs(t),r=Math.PI/180,i=parseFloat(parseFloat(Math.sin(n*r)).toFixed(8)),s=parseFloat(parseFloat(Math.cos(n*r)).toFixed(8));return{rot:t,absRot:n,radCon:r,sinRadians:i,cosRadians:s,textAlpha:e.alpha}},_drawAxis:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;if(this._layout){var e=this.get("styles"),t=e.line,n=e.label,r=e.majorTicks,i=r.display!="none",s,o=e.majorUnit,u,a,f=0,l=this._layout,c,h,p,d,v,m,g=this.get("labelFunction"),y=this.get("labelFunctionScope"),b=this.get("labelFormat"),w=this.get("graphic"),E=this.get("path"),S,x;this._labelWidths=[],this._labelHeights=[],w.set("autoDraw",!1),E.clear(),E.set("stroke",{weight:t.weight,color:t.color,opacity:t.alpha}),this._labelRotationProps=this._getTextRotationProps(n),this._labelRotationProps.transformOrigin=l._getTransformOrigin(this._labelRotationProps.rot),l.setTickOffsets.apply(this),c=this.getLength(),p=l.getLineStart.apply(this),u=this.getTotalMajorUnits(o),a=this.getMajorUnitDistance(u,c,o),this.set("edgeOffset",this.getEdgeOffset(u,c)*.5);if(u<1)this._clearLabelCache();else{s=this.getFirstPoint(p),this.drawLine(E,p,this.getLineEnd(s)),i&&(S=this.get("tickPath"),S.clear(),S.set("stroke",{weight:r.weight,color:r.color,opacity:r.alpha}),l.drawTick.apply(this,[S,s,r])),this._createLabelCache(),this._tickPoints=[],this._maxLabelSize=0,this._totalTitleSize=0,this._titleSize=0,this._setTitle(),x=l.getExplicitlySized.apply(this,[e]);for(;f<u;++f)i&&l.drawTick.apply(this,[S,s,r]),h=this.getPosition(s),d=this.getLabel(s,n),this._labels.push(d),this._tickPoints.push({x:s.x,y:s.y}),this.get("appendLabelFunction")(d,g.apply(y,[this.getLabelByIndex(f,u),b])),v=Math.round(d.offsetWidth),m=Math.round(d.offsetHeight),x||this._layout.updateMaxLabelSize.apply(this,[v,m]),this._labelWidths.push(v),this._labelHeights.push(m),s=this.getNextPoint(s,a);this._clearLabelCache(),this.get("overlapGraph")&&l.offsetNodeForTick.apply(this,[this.get("contentBox")]),l.setCalculatedSize.apply(this),this._titleTextField&&this._layout.positionTitle.apply(this,[this._titleTextField]);for(f=0;f<u;++f)l.positionLabel.apply(this,[this.get("labels")[f],this._tickPoints[f],e,f])}}this._drawing=!1,this._callLater?this._drawAxis():(this._updatePathElement(),this.fire("axisRendered"))},_setTotalTitleSize:function(t){var n=this._titleTextField,r=n.offsetWidth,i=n.offsetHeight,s=this._titleRotationProps.rot,o,u,a=t.margin,f=this.get("position"),l=new e.Matrix;l.rotate(s),o=l.getContentRect(r,i),f=="left"||f=="right"?(u=o.right-o.left,a&&(u+=a.left+a.right)):(u=o.bottom-o.top,a&&(u+=a.top+a.bottom)),this._titleBounds=o,this._totalTitleSize=u},_updatePathElement:function(){var e=this._path,t=this._tickPath,n=!1,r=this.get("graphic");e&&(n=!0,e.end()),t&&(n=!0,t.end()),n&&r._redraw()},_setTitle:function(){var e,t,n,r=this.get("title"),s=this._titleTextField,o;if(r!==null&&r!==undefined){n={rotation:"rotation",margin:"margin",alpha:"alpha"},t=this.get("styles").title,s?i.createElementNS||s.style.filter&&(s.style.filter=null):(s=i.createElement("span"),s.style.display="block",s.style.whiteSpace="nowrap",s.setAttribute("class","axisTitle"),this.get("contentBox").append(s)),s.style.position="absolute";for(e in t)t.hasOwnProperty(e)&&!n.hasOwnProperty(e)&&(s.style[e]=t[e]);this.get("appendTitleFunction")(s,r),this._titleTextField=s,this._titleRotationProps=this._getTextRotationProps(t),this._setTotalTitleSize(t)}else s&&(o=s.parentNode,o&&o.removeChild(s),this._titleTextField=null,this._totalTitleSize=0)},getLabel:function(t,n){var r,s,o=this._labelCache,u={rotation:"rotation",margin:"margin",alpha:"alpha"};o&&o.length>0?s=o.shift():(s=i.createElement("span"),s.className=e.Lang.trim([s.className,"axisLabel"].join(" ")),this.get("contentBox").append(s)),i.createElementNS||s.style.filter&&(s.style.filter=null),s.style.display="block",s.style.whiteSpace="nowrap",s.style.position="absolute";for(r in n)n.hasOwnProperty(r)&&!u.hasOwnProperty(r)&&(s.style[r]=n[r]);return s},_createLabelCache:function(){if(this._labels)while(this._labels.length>0)this._labelCache.push(this._labels.shift());else this._clearLabelCache();this._labels=[]},_clearLabelCache:function(){if(this._labelCache){var t=this._labelCache.length,n=0,r;for(;n<t;++n)r=this._labelCache[n],this._removeChildren(r),e.Event.purgeElement(r,!0),r.parentNode.removeChild(r)}this._labelCache=[]},getLineEnd:function(e){var t=this.get("width"),n=this.get("height"),r=this.get("position");return r==="top"||r==="bottom"?{x:t,y:e.y}:{x:e.x,y:n}},getLength:function(){var e,t=this.get("styles"),n=t.padding,r=this.get("width"),i=this.get("height"),s=this.get("position");return s==="top"||s==="bottom"?e=r-(n.left+n.right):e=i-(n.top+n.bottom),e},getFirstPoint:function(e){var t=this.get("styles"),n=this.get("position"),r=t.padding,i={x:e.x,y:e.y};return n==="top"||n==="bottom"?i.x+=r.left+this.get("edgeOffset"):i.y+=this.get("height")-(r.top+this.get("edgeOffset")),i},getNextPoint:function(e,t){var n=this.get("position");return n==="top"||n==="bottom"?e.x=e.x+t:e.y=e.y-t,e},getLastPoint:function(){var e=this.get("styles"),t=e.padding,n=this.get("width"),r=this.get("position");return r==="top"||r==="bottom"?{x:n-t.right,y:t.top}:{x:t.left,y:t.top}},getPosition:function(e){var t,n=this.get("height"),r=this.get("styles"),i=r.padding,s=this.get("position"),o=this.get("dataType");return s==="left"||s==="right"?o==="numeric"?t=n-(i.top+i.bottom)-(e.y-i.top):t=e.y-i.top:t=e.x-i.left,t},_rotate:function(t,n){var r=n.rot,o=n.x,a=n.y,f,l,c=new e.Matrix,h=n.transformOrigin||[0,0],p;i.createElementNS?(c.translate(o,a),c.rotate(r),u.setStyle(t,"transformOrigin",h[0]*100+"% "+h[1]*100+"%"),u.setStyle(t,"transform",c.toCSSText())):(l=n.textAlpha,s.isNumber(l)&&l<1&&l>-1&&!isNaN(l)&&(f="progid:DXImageTransform.Microsoft.Alpha(Opacity="+Math.round(l*100)+")"),r!==0?(c.rotate(r),p=c.getContentRect(n.labelWidth,n.labelHeight),c.init(),c.translate(p.left,p.top),c.translate(o,a),this._simulateRotateWithTransformOrigin(c,r,h,n.labelWidth,n.labelHeight),f?f+=" ":f="",f+=c.toFilterText(),t.style.left=c.dx+"px",t.style.top=c.dy+"px"):(t.style.left=o+"px",t.style.top=a+"px"),f&&(t.style.filter=f))},_simulateRotateWithTransformOrigin:function(e,t,n,r,i){var s=n[0]*r,o=n[1]*i;s=isNaN(s)?0:s,o=isNaN(o)?0:o,e.translate(s,o),e.rotate(t),e.translate(-s,-o)},getMaxLabelBounds:function(){return this._getLabelBounds(this.getMaximumValue())},getMinLabelBounds:function(){return this._getLabelBounds(this.getMinimumValue())},_getLabelBounds:function(t){var n=this._layout,r=this.get("styles").label,i=new e.Matrix,s,o=this._getTextRotationProps(r);return o.transformOrigin=n._getTransformOrigin(o.rot),s=this.getLabel({x:0,y:0},r),this.get("appendLabelFunction")(s,this.get("labelFunction").apply(this,[t,this.get("labelFormat")])),o.labelWidth=s.offsetWidth,o.labelHeight=s.offsetHeight,this._removeChildren(s),e.Event.purgeElement(s,!0),s.parentNode.removeChild(s),o.x=0,o.y=0,n._setRotationCoords(o),i.translate(o.x,o.y),this._simulateRotateWithTransformOrigin(i,o.rot,o.transformOrigin,o.labelWidth,o.labelHeight),i.getContentRect(o.labelWidth,o.labelHeight)},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},destructor:function(){var e=this.get("contentBox").getDOMNode(),t=this.get("labels"),n=this.get("graphic"),r,i=t?t.length:0;if(i>0)while(t.length>0)r=t.shift(),this._removeChildren(r),e.removeChild(r),r=null;n&&n.destroy()},_maxLabelSize:0,_setText:function(e,t){e.innerHTML="",s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)}},{ATTRS:{width:{lazyAdd:!1,getter:function(){return this._explicitWidth?this._explicitWidth:this._calculatedWidth},setter:function(e){return this._explicitWidth=e,e}},height:{lazyAdd:!1,getter:function(){return this._explicitHeight?this._explicitHeight:this._calculatedHeight},setter:function(e){return this._explicitHeight=e,e}},calculatedWidth:{getter:function(){return this._calculatedWidth},setter:function(e){return this._calculatedWidth=e,e}},calculatedHeight:{getter:function(){return this._calculatedHeight},setter:function(e){return this._calculatedHeight=e,e}},edgeOffset:{value:0},graphic:{},path:{readOnly:!0,getter:function(){if(!this._path){var e=this.get("graphic");e&&(this._path=e.addShape({type:"path"}))}return this._path}},tickPath:{readOnly:!0,getter:function(){if(!this._tickPath){var e=this.get("graphic");e&&(this._tickPath=e.addShape({type:"path"}))}return this._tickPath}},node:{},position:{setter:function(e){var t=this._layoutClasses[e];return e&&e!="none"&&(this._layout=new t),e}},topTickOffset:{value:0},bottomTickOffset:{value:0},leftTickOffset:{value:0},rightTickOffset:{value:0},labels:{readOnly:!0,getter:function(){return this._labels}},tickPoints:{readOnly:!0,getter:function(){return this.get("position")=="none"?this.get("styles").majorUnit.count:this._tickPoints}},overlapGraph:{value:!0,validator:function(e){return s.isBoolean(e)}},labelFunctionScope:{},maxLabelSize:{getter:function(){return this._maxLabelSize},setter:function(e){return this._maxLabelSize=e,e}},title:{value:null},labelFunction:{value:function(e,t){return e}},appendLabelFunction:{valueFn:function(){return this._setText}},appendTitleFunction:{valueFn:function(){return this._setText}}}}),e.AxisType=e.Base.create("baseAxis",e.Axis,[],{initializer:function(){this.after("dataReady",e.bind(this._dataChangeHandler,this)),this.after("dataUpdate",e.bind(this._dataChangeHandler,this)),this.after("minimumChange",e.bind(this._keyChangeHandler,this)),this.after("maximumChange",e.bind(this._keyChangeHandler,this)),this.after("keysChange",this._keyChangeHandler),this.after("dataProviderChange",this._dataProviderChangeHandler),this.after("alwaysShowZeroChange",this._keyChangeHandler),this.after("roundingMethodChange",this._keyChangeHandler)},bindUI:function(){this.after("stylesChange",this._updateHandler),this.after("overlapGraphChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange),this.after("calculatedWidthChange",this._handleSizeChange),this.after("calculatedHeightChange",this._handleSizeChange)},_dataProviderChangeHandler:function(e){var t=this.get("keyCollection").concat(),n=this.get("keys"),r;if(n)for(r in n)n.hasOwnProperty(r)&&delete n[r];t&&t.length&&this.set("keys",t)},GUID:"yuibaseaxis",_type:null,_setMaximum:null,_dataMaximum:null,_setMinimum:null,_data:null,_updateTotalDataFlag:!0,_dataReady:!1,addKey:function(e){this.set("keys",e)},_getKeyArray:function(e,t){var n=0,r,i=[],s=t.length;for(;n<s;++n)r=t[n],i[n]=r[e];return i},_setDataByKey:function(e,t){var n,r,i=[],s=this._dataClone.concat(),o=s.length;for(n=0;n<o;++n)r=s[n],i[n]=r[e];this.get("keys")[e]=i,this._updateTotalDataFlag=!0},_updateTotalData:function(){var e=this.get("keys"),t;this._data=[];for(t in e)e.hasOwnProperty(t)&&(this._data=this._data.concat(e[t]));this._updateTotalDataFlag=!1},removeKey:function(e){var t=this.get("keys");t.hasOwnProperty(e)&&(delete t[e],this._keyChangeHandler())},getKeyValueAt:function(e,t){var n=NaN,r=this.get("keys");return r[e]&&s.isNumber(parseFloat(r[e][t]))&&(n=r[e][t]),parseFloat(n)},getDataByKey:function(e){var t=this.get("keys");return t[e]?t[e]:null},_updateMinAndMax:function(){var e=this.get("data"),t=0,n=0,r,i,s;if(e&&e.length&&e.length>0){r=e.length,t=n=e[0];if(r>1)for(s=1;s<r;s++){i=e[s];if(isNaN(i))continue;t=Math.max(i,t),n=Math.min(i,n)}}this._dataMaximum=t,this._dataMinimum=n},getTotalMajorUnits:function(){var e,t=this.get("styles").majorUnit,n=this.get("length");return t.determinant==="count"?e=t.count:t.determinant==="distance"&&(e=n/t.distance+1),e},getMajorUnitDistance:function(e,t,n){var r;return n.determinant==="count"?r=t/(e-1):n.determinant==="distance"&&(r=n.distance),r},getEdgeOffset:function(e,t){return 0},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s;return t-=1,s=n+e*i,s},_keyChangeHandler:function(e){this._updateMinAndMax(),this.fire("dataUpdate")},_hasDataOverflow:function(){return this.get("setMin")||this.get("setMax")?!0:!1},getMinimumValue:function(){return this.get("minimum")},getMaximumValue:function(){return this.get("maximum")}},{ATTRS:{keys:{value:{},setter:function(e){var t={},n,r,i=this.get("dataProvider");if(s.isArray(e)){r=e.length;for(n=0;n<r;++n)t[e[n]]=this._getKeyArray(e[n],i)}else if(s.isString(e))t=this.get("keys"),t[e]=this._getKeyArray(e,i);else for(n in e)e.hasOwnProperty(n)&&(t[n]=this._getKeyArray(n,i));return this._updateTotalDataFlag=!0,t}},roundingMethod:{value:"niceNumber"},type:{readOnly:!0,getter:function(){return this._type}},dataProvider:{setter:function(e){return e}},dataMaximum:{getter:function(){return this._dataMaximum||this._updateMinAndMax(),this._dataMaximum}},maximum:{lazyAdd:!1,getter:function(){var e=this.get("dataMaximum"),t=this.get("minimum");return t===0&&e===0&&(e=10),s.isNumber(this._setMaximum)&&(e=this._setMaximum),parseFloat(e)},setter:function(e){return this._setMaximum=parseFloat(e),e}},dataMinimum:{getter:function(){return this._dataMinimum||this._updateMinAndMax(),this._dataMinimum}},minimum:{lazyAdd:!1,getter:function(){var e=this.get("dataMinimum");return s.isNumber(this._setMinimum)&&(e=this._setMinimum),parseFloat(e)},setter:function(e){return this._setMinimum=parseFloat(e),e}},setMax:{readOnly:!0,getter:function(){return s.isNumber(this._setMaximum)}},setMin:{readOnly:!0,getter:function(){return s.isNumber(this._setMinimum)}},data:{getter:function(){return(!this._data||this._updateTotalDataFlag)&&this._updateTotalData(),this._data}},keyCollection:{getter:function(){var e=this.get("keys"),t,n=[];for(t in e)e.hasOwnProperty(t)&&n.push(t);return n},readOnly:!0}}}),w.NAME="numericAxis",w.ATTRS={alwaysShowZero:{value:!0},labelFunction:{value:function(t,n){return n?e.DataType.Number.format(t,n):t}},labelFormat:{value:{prefix:"",thousandsSeparator:"",decimalSeparator:"",decimalPlaces:"0",suffix:""}}},e.extend(w,e.AxisType,{formatLabel:function(t,n){return n?e.DataType.Number.format(t,n):t},getTotalByKey:function(e){var t=0,n=this.getDataByKey(e),r=0,i,s=n?n.length:0;for(;r<s;++r)i=parseFloat(n[r]),isNaN(i)||(t+=i);return t},_type:"numeric",_getMinimumUnit:function(e,t,n){return this._getNiceNumber(Math.ceil((e-t)/n))},_getNiceNumber:function(e){var t=e,n=Math.ceil(Math.log(t)*.4342944819032518),r=Math.pow(10,n),i;return r/2>=t?(i=Math.floor((r/2-t)/(Math.pow(10,n-1)/2)),t=r/2-i*Math.pow(10,n-1)/2):t=r,isNaN(t)?e:t},_updateMinAndMax:function(){var e=this.get("data"),t,n,r,i,o=0,u,a=this.get("setMax"),f=this.get("setMin");if(!a||!f){if(e&&e.length&&e.length>0){r=e.length;for(;o<r;o++){i=e[o];if(isNaN(i)){if(s.isObject(i)){n=t=0;for(u in i)i.hasOwnProperty(u)&&(t=Math.max(i[u],t),n=Math.min(i[u],n))}t=a?this._setMaximum:t,n=f?this._setMinimum:n;continue}f?n=this._setMinimum:n===undefined?n=i:n=Math.min(i,n),a?t=this._setMaximum:t===undefined?t=i:t=Math.max(i,t),this._actualMaximum=t,this._actualMinimum=n}}this._roundMinAndMax(n,t,f,a)}},_roundMinAndMax:function(e,t,n,r){var i,s,o=e>=0,u=t>0,a,f,l,c,h,p,d,v=this.getTotalMajorUnits()-1,m=this.get("alwaysShowZero"),g=this.get("roundingMethod"),y=(t-e)/v>=1;if(g)if(g=="niceNumber"){i=this._getMinimumUnit(t,e,v);if(o&&u)(m||e<i)&&!n?(e=0,i=this._getMinimumUnit(t,e,v)):e=this._roundDownToNearest(e,i),r?m||(e=t-i*v):n?t=e+i*v:t=this._roundUpToNearest(t,i);else if(u&&!o)if(m){c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;if(n){while(d<p&&h>=0)h--,c++,p=Math.ceil(t/c),d=Math.floor(e/h)*-1;h>0?t=d*c:t=e+i*v}else if(r){while(p<d&&c>=0)h++,c--,d=Math.floor(e/h)*-1,p=Math.ceil(t/c);c>0?e=p*h*-1:e=t-i*v}else i=Math.max(p,d),i=this._getNiceNumber(i),t=i*c,e=i*h*-1}else r?e=t-i*v:n?t=e+i*v:(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i));else n?m?t=0:t=e+i*v:r?e=t-i*v:m||t===0||t+i>0?(t=0,i=this._getMinimumUnit(t,e,v),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))}else g=="auto"?o&&u?((m||e<(t-e)/v)&&!n&&(e=0),i=(t-e)/v,y&&(i=Math.ceil(i)),t=e+i*v):u&&!o?m?(c=Math.round(v/(-1*e/t+1)),c=Math.max(Math.min(c,v-1),1),h=v-c,y?(p=Math.ceil(t/c),d=Math.floor(e/h)*-1):(p=t/c,d=e/h*-1),i=Math.max(p,d),t=i*c,e=i*h*-1):(i=(t-e)/v,y&&(i=Math.ceil(i)),e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i)):(i=(t-e)/v,y&&(i=Math.ceil(i)),m||t===0||t+i>0?(t=0,i=(t-e)/v,y&&Math.ceil(i),e=t-i*v):(e=this._roundDownToNearest(e,i),t=this._roundUpToNearest(t,i))):!isNaN(g)&&isFinite(g)&&(i=g,s=i*v,a=t-e>s,l=this._roundDownToNearest(e,i),f=this._roundUpToNearest(t,i),r?e=t-s:n?t=e+s:o&&u?(m||l<=0?e=0:e=l,t=e+s):u&&!o?(e=l,t=f):(m||f>=0?t=0:t=f,e=t-s));this._dataMaximum=t,this._dataMinimum=e},getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=(r-n)/(t-1),s,o=this.get("roundingMethod");return t-=1,e===0?s=n:e===t?s=r:(s=e*i,o=="niceNumber"&&(s=this._roundToNearest(s,i)),s+=n),parseFloat(s)},_roundToNearest:function(e,t){t=t||1;if(t===0)return e;var n=Math.round(this._roundToPrecision(e/t,10))*t;return this._roundToPrecision(n,10)},_roundUpToNearest:function(e,t){return t=t||1,t===0?e:Math.ceil(this._roundToPrecision(e/t,10))*t},_roundDownToNearest:function(e,t){return t=t||1,t===0?e:Math.floor(this._roundToPrecision(e/t,10))*t},_roundToPrecision:function(e,t){t=t||0;var n=Math.pow(10,t);return Math.round(n*e)/n},_hasDataOverflow:function(){var e,t,n;return this.get("setMin")||this.get("setMax")?!0:(e=this.get("roundingMethod"),t=this._actualMinimum,n=this._actualMaximum,s.isNumber(e)&&(s.isNumber(n)&&n>this._dataMaximum||s.isNumber(t)&&t<this._dataMinimum)?!0:!1)}}),e.NumericAxis=w,E.NAME="stackedAxis",e.extend(E,e.NumericAxis,{_updateMinAndMax:function(){var e=0,t=0,n=0,r=0,i=0,s=0,o,u,a=this.get("keys"),f=this.get("setMin"),l=this.get("setMax");for(o in a)a.hasOwnProperty(o)&&(i=Math.max(i,a[o].length));for(;s<i;++s){n=0,r=0;for(o in a)if(a.hasOwnProperty(o)){u=a[o][s];if(isNaN(u))continue;u>=0?n+=u:r+=u}n>0?e=Math.max(e,n):e=Math.max(e,r),r<0?t=Math.min(t,r):t=Math.min(t,n)}this._actualMaximum=e,this._actualMinimum=t,l&&(e=this._setMaximum),f&&(t=this._setMinimum),this._roundMinAndMax(t,e,f,l)}}),e.StackedAxis=E,S.NAME="timeAxis",S.ATTRS={setMax:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)}},setMin:{readOnly:!0,getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)}},maximum:{getter:function(){var e=this._getNumber(this._setMaximum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMaximum"))),parseFloat(e)},setter:function(e){return this._setMaximum=this._getNumber(e),e}},minimum:{getter:function(){var e=this._getNumber(this._setMinimum);return s.isNumber(e)||(e=this._getNumber(this.get("dataMinimum"))),parseFloat(e)},setter:function(e){return this._setMinimum=this._getNumber(e),e}},labelFunction:{value:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t}},labelFormat:{value:"%b %d, %y"}},e.extend(S,e.AxisType,{formatLabel:function(t,n){return t=e.DataType.Date.parse(t),n?e.DataType.Date.format(t,{format:n}):t},GUID:"yuitimeaxis",_dataType:"time",getLabelByIndex:function(e,t){var n=this.get("minimum"),r=this.get("maximum"),i=this.get("position"),s,o;return t-=1,s=(r-n)/t*e,i=="bottom"||i=="top"?o=n+s:o=r-s,o},_getKeyArray:function(e,t){var n,r=[],i=0,o,u=t.length;for(;i<u;++i)n=t[i][e],s.isDate(n)?o=n.valueOf():(o=new Date(n),s.isDate(o)?o=o.valueOf():s.isNumber(n)?o=n:s.isNumber(parseFloat(n))?o=parseFloat(n):(typeof n!="string"&&(n=n),o=(new Date(n)).valueOf())),r[i]=o;return r},_setDataByKey:function(e,t){var n,r=[],i=this._dataClone.concat(),o,u,a=i.length;for(o=0;o<a;++o)n=i[o][e],s.isDate(n)?u=n.valueOf():(u=new Date(n),s.isDate(u)?u=u.valueOf():s.isNumber(n)?u=n:s.isNumber(parseFloat(n))?u=parseFloat(n):(typeof n!="string"&&(n=n.toString()),u=(new Date(n)).valueOf())),r[o]=u;this.get("keys")[e]=r,this._updateTotalDataFlag=!0},_getNumber:function(e){return s.isDate(e)?e=e.valueOf():!s.isNumber(e)&&e&&(e=(new Date(e)).valueOf()),e}}),e.TimeAxis=S,x.NAME="categoryAxis",e.extend(x,e.AxisType,{formatLabel:function(e,t){return e},_indices:null,GUID:"yuicategoryaxis",_type:"category",_updateMinAndMax:function(){this._dataMaximum=Math.max(this.get("data").length-1,0),this._dataMinimum=0},_getKeyArray:function(e,t){var n=0,r,i=[],s=[],o=t.length;this._indices||(this._indices={});for(;n<o;++n)r=t[n],i[n]=n,s[n]=r[e];return this._indices[e]=i,s},_setDataByKey:function(e){var t,n,r=[],i=[],s=this._dataClone.concat(),o=s.length;this._indices||(this._indices={});for(t=0;t<o;++t)n=s[t],r[t]=t,i[t]=n[e];this._indices[e]=r,this.get("keys")[e]=i.concat(),this._updateTotalDataFlag=!0},getDataByKey:function(e){this._indices||this.get("keys");var t=this._indices;return t[e]?t[e]:null},getTotalMajorUnits:function(e,t){return this.get("data").length},getMajorUnitDistance:function(e,t,n){var r;return n.determinant==="count"?r=t/e:n.determinant==="distance"&&(r=n.distance),r},getEdgeOffset:function(e,t){return t/e},getKeyValueAt:function(e,t){var n=NaN,r=this.get("keys");return r[e]&&r[e][t]&&(n=r[e][t]),n},getLabelByIndex:function(e,t){var n,r=this.get("data"),i=this.get("position");return i=="bottom"||i=="top"?n=r[e]:n=r[t-(e+1)],n},getMinimumValue:function(){var e=this.get("data"),t=e[0];return t},getMaximumValue:function(){var e=this.get("data"),t=e.length-1,n=e[t];return n}}),e.CategoryAxis=x,T.prototype={getCurveControlPoints:function(e,t){var n=[],r=1,i=e.length-1,s=[],o=[];if(i<1)return null;n[0]={startx:e[0],starty:t[0],endx:e[1],endy:t[1]};if(i===1)return n[0].ctrlx1=(2*e[0]+e[1])/3,n[0].ctrly2=(2*t[0]+t[1])/3,n[0].ctrlx2=2*n[0].ctrlx1-e[0],n[0].ctrly2=2*n[0].ctrly1-t[0],n;for(;r<i;++r)n.push({startx:Math.round(e[r]),starty:Math.round(t[r]),endx:Math.round(e[r+1]),endy:Math.round(t[r+1])}),s[r]=4*e[r]+2*e[r+1],o[r]=4*t[r]+2*t[r+1];s[0]=e[0]+2*e[1],s[i-1]=(8*e[i-1]+e[i])/2,s=this.getControlPoints(s.concat()),o[0]=t[0]+2*t[1],o[i-1]=(8*t[i-1]+t[i])/2,o=this.getControlPoints(o.concat());for(r=0;r<i;++r)n[r].ctrlx1=Math.round(s[r]),n[r].ctrly1=Math.round(o[r]),r<i-1?(n[r].ctrlx2=Math.round(2*e[r+1]-s[r+1]),n[r].ctrly2=Math.round(2*t[r+1]-o[r+1])):(n[r].ctrlx2=Math.round((e[i]+s[i-1])/2),n[r].ctrly2=Math.round((t[i]+o[i-1])/2));return n},getControlPoints:function(e){var t=e.length,n=[],r=[],i=2,s=1;n[0]=e[0]/i;for(;s<t;++s)r[s]=1/i,i=(s<t-1?4:3.5)-r[s],n[s]=(e[s]-n[s-1])/i;for(s=1;s<t;++s)n[t-s-1]-=r[t-s]*n[t-s];return n}},e.CurveUtil=T,N.prototype={_stacked:!0,_stackCoordinates:function(){this.get("direction")=="vertical"?this._stackXCoords():this._stackYCoords()},_stackXCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.seriesTypes[t],i=0,o=this.get("xcoords"),u=this.get("ycoords"),a,f,l,c,h=o.concat(),p,d,v=[],m;e>0?(p=r[e-1].get("stackedXCoords"),d=r[e-1].get("stackedYCoords"),a=p.length):a=o.length;for(;i<a;i+=1)if(s.isNumber(o[i])){if(e>0){l=p[i];if(!s.isNumber(l)){c=e;while(c>-1&&!s.isNumber(l))c-=1,c>-1?l=r[c].get("stackedXCoords")[i]:l=this._leftOrigin}o[i]=o[i]+l}h[i]=o[i]}else v.push(i);this._cleanXNaN(h,u),a=v.length;if(a>0)for(i=0;i<a;i+=1)m=v[i],f=e>0?p[m]:this._leftOrigin,h[m]=Math.max(h[m],f);this.set("stackedXCoords",h),this.set("stackedYCoords",u)},_stackYCoords:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=n.get("height"),i=n.seriesTypes[t],o=0,u=this.get("xcoords"),a=this.get("ycoords"),f,l,c,h,p=a.concat(),d,v,m=[],g;e>0?(d=i[e-1].get("stackedXCoords"),v=i[e-1].get("stackedYCoords"),f=v.length):f=a.length;for(;o<f;o+=1)if(s.isNumber(a[o])){if(e>0){c=v[o];if(!s.isNumber(c)){h=e;while(h>-1&&!s.isNumber(c))h-=1,h>-1?c=i[h].get("stackedYCoords")[o]:c=this._bottomOrigin}a[o]=c-(r-a[o])}p[o]=a[o]}else m.push(o);this._cleanYNaN(u,p),f=m.length;if(f>0)for(o=0;o<f;o+=1)g=m[o],l=e>0?v[g]:r,p[g]=Math.min(p[g],l);this.set("stackedXCoords",u),this.set("stackedYCoords",p)},_cleanXNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=t.length;for(;p<d;++p)u=e[p],a=t[p],!c(u)&&p>0&&p<d-1&&(o=t[p-1],i=this._getPreviousValidCoordValue(e,p),l=t[p+1],f=this._getNextValidCoordValue(e,p),c(i)&&c(f)&&(h=(l-o)/(f-i),e[p]=(a+h*i-o)/h),n=NaN,r=NaN)},_getPreviousValidCoordValue:function(e,t){var n,r=s.isNumber,i=-1;while(!r(n)&&t>i)t-=1,n=e[t];return n},_getNextValidCoordValue:function(e,t){var n,r=s.isNumber,i=e.length;while(!r(n)&&t<i)t+=1,n=e[t];return n},_cleanYNaN:function(e,t){var n,r,i,o,u,a,f,l,c=s.isNumber,h,p=0,d=e.length;for(;p<d;++p)u=e[p],a=t[p],!c(a)&&p>0&&p<d-1&&(i=e[p-1],o=this._getPreviousValidCoordValue(t,p),f=e[p+1],l=this._getNextValidCoordValue(t,p),c(o)&&c(l)&&(h=(l-o)/(f-i),t[p]=o+(h*u-h*i)),n=NaN,r=NaN)}},e.StackingUtil=N,C.prototype={_lineDefaults:null,_getGraphic:function(){var e=this.get("graphic")||this.get("graph").get("graphic");return this._lineGraphic||(this._lineGraphic=e.addShape({type:"path"})),this._lineGraphic.clear(),this._lineGraphic},_toggleVisible:function(e){this._lineGraphic&&this._lineGraphic.set("visible",e)},drawLines:function(){if(this.get("xcoords").length<1)return;var e=s.isNumber,t,n,r=this.get("direction"),i,o,u,a=!0,f,l,c,h,p,d=this.get("styles").line,v=d.lineType,m=d.color||this._getDefaultColor(this.get("graphOrder"),"line"),g=d.alpha,y=d.dashLength,b=d.gapSpace,w=d.connectDiscontinuousPoints,E=d.discontinuousType,S=d.discontinuousDashLength,x=d.discontinuousGapSpace,T=this._getGraphic();this._stacked?(t=this.get("stackedXCoords"),n=this.get("stackedYCoords")):(t=this.get("xcoords"),n=this.get("ycoords")),i=r==="vertical"?n.length:t.length,T.set("stroke",{weight:d.weight,color:m,opacity:g});for(p=0;p<i;p=++p){c=t[p],h=n[p],u=e(c)&&e(h);if(!u){o=u;continue}a?(a=!1,T.moveTo(c,h)):o?v!="dashed"?T.lineTo(c,h):this.drawDashedLine(T,f,l,c,h,y,b):w?E!="solid"?this.drawDashedLine(T,f,l,c,h,S,x):T.lineTo(c,h):T.moveTo(c,h),f=c,l=h,o=!0}T.end()},drawSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n=this.getCurveControlPoints(e,t),r=n.length,i,s,o,u,a,f,l=0,c=this.get("styles").line,h=this._getGraphic(),p=c.alpha,d=c.color||this._getDefaultColor(this.get("graphOrder"),"line");h.set("stroke",{weight:c.weight,color:d,opacity:p}),h.moveTo(e[0],t[0]);for(;l<r;l=++l)a=n[l].endx,f=n[l].endy,i=n[l].ctrlx1,s=n[l].ctrlx2,o=n[l].ctrly1,u=n[l].ctrly2,h.curveTo(i,o,s,u,a,f);h.end()},drawDashedLine:function(e,t,n,r,i,s,o){s=s||10,o=o||10;var u=s+o,a=r-t,f=i-n,l=Math.sqrt(Math.pow(a,2)+Math.pow(f,2)),c=Math.floor(Math.abs(l/u)),h=Math.atan2(f,a),p=t,d=n,v;a=Math.cos(h)*u,f=Math.sin(h)*u;for(v=0;v<c;++v)e.moveTo(p,d),e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s),p+=a,d+=f;e.moveTo(p,d),l=Math.sqrt((r-p)*(r-p)+(i-d)*(i-d)),l>s?e.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&e.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),e.moveTo(r,i)},_getLineDefaults:function(){return{alpha:1,weight:6,lineType:"solid",dashLength:10,gapSpace:10,connectDiscontinuousPoints:!0,discontinuousType:"solid",discontinuousDashLength:10,discontinuousGapSpace:10}}},e.augment(C,e.Attribute),e.Lines=C,k.prototype={_getPath:function(){var e=this._path;return e||(e=this.get("graph").get("graphic").addShape({type:"path"}),this._path=e),e},_toggleVisible:function(e){this._path&&this._path.set("visible",e)},drawFill:function(e,t){if(e.length<1)return;var n=s.isNumber,r=e.length,i=e[0],o=t[0],u=i,a=o,f,l,c,h=!0,p=0,d=this.get("styles").area,v=this._getPath(),m=d.color||this._getDefaultColor(this.get("graphOrder"),"slice");v.clear(),v.set("fill",{color:m,opacity:d.alpha}),v.set("stroke",{weight:0});for(;p<r;p=++p){f=e[p],l=t[p],c=n(f)&&n(l);if(!c)continue;h?(this._firstValidX=f,this._firstValidY=l,h=!1,v.moveTo(f,l)):v.lineTo(f,l),u=f,a=l}this._lastValidX=u,this._lastValidY=a,v.end()},drawAreaSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n=this.getCurveControlPoints(e,t),r=n.length,i,s,o,u,a,f,l=0,c=e[0],h=t[0],p=this.get("styles").area,d=this._getPath(),v=p.color||this._getDefaultColor(this.get("graphOrder"),"slice");d.set("fill",{color:v,opacity:p.alpha}),d.set("stroke",{weight:0}),d.moveTo(c,h);for(;l<r;l=++l)a=n[l].endx,f=n[l].endy,i=n[l].ctrlx1,s=n[l].ctrlx2,o=n[l].ctrly1,u=n[l].ctrly2,d.curveTo(i,o,s,u,a,f);this.get("direction")==="vertical"?(d.lineTo(this._leftOrigin,f),d.lineTo(this._leftOrigin,h)):(d.lineTo(a,this._bottomOrigin),d.lineTo(c,this._bottomOrigin)),d.lineTo(c,h),d.end()},drawStackedAreaSpline:function(){if(this.get("xcoords").length<1)return;var e=this.get("xcoords"),t=this.get("ycoords"),n,r=this.get("order"),i=this.get("type"),s=this.get("graph"),o=s.seriesTypes[i],u,a,f,l,c,h,p,d,v,m=0,g,y,b=this.get("styles").area,w=this._getPath(),E=b.color||this._getDefaultColor(this.get("graphOrder"),"slice");g=e[0],y=t[0],n=this.getCurveControlPoints(e,t),f=n.length,w.set("fill",{color:E,opacity:b.alpha}),w.set("stroke",{weight:0}),w.moveTo(g,y);for(;m<f;m=++m)d=n[m].endx,v=n[m].endy,l=n[m].ctrlx1,c=n[m].ctrlx2,h=n[m].ctrly1,p=n[m].ctrly2,w.curveTo(l,h,c,p,d,v);if(r>0){u=o[r-1].get("xcoords").concat().reverse(),a=o[r-1].get("ycoords").concat().reverse(),n=this.getCurveControlPoints(u,a),m=0,f=n.length,w.lineTo(u[0],a[0]);for(;m<f;m=++m)d=n[m].endx,v=n[m].endy,l=n[m].ctrlx1,c=n[m].ctrlx2,h=n[m].ctrly1,p=n[m].ctrly2,w.curveTo(l,h,c,p,d,v)}else this.get("direction")==="vertical"?(w.lineTo(this._leftOrigin,t[t.length-1]),w.lineTo(this._leftOrigin,y)):(w.lineTo(e[e.length-1],this._bottomOrigin),w.lineTo(g,this._bottomOrigin));w.lineTo(g,y),w.end()},_defaults:null,_getClosingPoints:function(){var e=this.get("xcoords").concat(),t=this.get("ycoords").concat(),n,r;return this.get("direction")==="vertical"?(r=this._getLastValidIndex(e),n=this._getFirstValidIndex(e),t.push(t[r]),t.push(t[n]),e.push(this._leftOrigin),e.push(this._leftOrigin)):(r=this._getLastValidIndex(t),n=this._getFirstValidIndex(t),e.push(e[r]),e.push(e[n]),t.push(this._bottomOrigin),t.push(this._bottomOrigin)),e.push(e[0]),t.push(t[0]),[e,t]},_getHighestValidOrder:function(e,t,n,r){var i=r=="vertical"?"stackedXCoords":"stackedYCoords",s;while(isNaN(s)&&n>-1)n-=1,n>-1&&(s=e[n].get(i)[t]);return n},_getCoordsByOrderAndIndex:function(e,t,n,r){var i,s;return r=="vertical"?(i=n<0?this._leftOrigin:e[n].get("stackedXCoords")[t],s=this.get("stackedYCoords")[t]):(i=this.get("stackedXCoords")[t],s=n<0?this._bottomOrigin:e[n].get("stackedYCoords")[t]),[i,s]},_getStackedClosingPoints:function(){var e=this.get("order"),t=this.get("type"),n=this.get("graph"),r=this.get("direction"),i=n.seriesTypes[t],s,o,u=this.get("stackedXCoords"),a=this.get("stackedYCoords"),f,l,c,h,p,d,v,m,g,y,b,w;if(e<1)return this._getClosingPoints();l=i[e-1],p=l.get("stackedXCoords").concat(),d=l.get("stackedYCoords").concat(),r=="vertical"?(s=this._getFirstValidIndex(u),o=this._getLastValidIndex(u),c=l._getFirstValidIndex(p),h=l._getLastValidIndex(p)):(s=this._getFirstValidIndex(a),o=this._getLastValidIndex(a),c=l._getFirstValidIndex(d),h=l._getLastValidIndex(d)),h>=s&&c<=o?(c=Math.max(s,c),h=Math.min(o,h),p=p.slice(c,h+1),d=d.slice(c,h+1),f=c):f=o,m=[u[s]],g=[a[s]],y=s;while((isNaN(b)||b<e-1)&&y<=f)w=b,b=this._getHighestValidOrder(i,y,e,r),!isNaN(w)&&b>w&&(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;p&&p.length>0&&h>s&&c<o&&(m=m.concat(p),g=g.concat(d),b=e-1),y=Math.max(s,h),e-=1,b=NaN;while(y<=o)w=b,b=this._getHighestValidOrder(i,y,e,r),isNaN(w)||(b>w?(v=this._getCoordsByOrderAndIndex(i,y,w,r),m.push(v[0]),g.push(v[1])):b<w&&(v=this._getCoordsByOrderAndIndex(i,y-1,b,r),m.push(v[0]),g.push(v[1]))),v=this._getCoordsByOrderAndIndex(i,y,b,r),m.push(v[0]),g.push(v[1]),y+=1;return m.reverse(),g.reverse(),[u.concat(m),a.concat(g)]},_getAreaDefaults:function(){return{}}},e.augment(k,e.Attribute),e.Fills=k,L.prototype={_plotDefaults:null,drawPlots:function(){if(!this.get("xcoords")||this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c,h,p=r/2,d=i/2,v,m,g=null,y=null,b=this.get("graphOrder"),w=this.get("groupMarkers");if(w){v=[],m=[];for(;a<f;++a)v.push(parseFloat(o[a]-p)),m.push(parseFloat(u[a]-d));this._createGroupMarker({xvalues:v,yvalues:m,fill:n.fill,border:n.border,dimensions:{width:r,height:i},graphOrder:b,shape:n.shape});return}s.isArray(n.fill.color)&&(g=n.fill.color.concat()),s.isArray(n.border.color)&&(y=n.border.color.concat()),this._createMarkerCache();for(;a<f;++a){l=parseFloat(u[a]-d),c=parseFloat(o[a]-p);if(!t(c)||!t(l)){this._markers.push(null);continue}g&&(n.fill.color=g[a%g.length]),y&&(n.border.color=y[a%y.length]),n.x=c,n.y=l,h=this.getMarker(n,b,a)}this._clearMarkerCache()},_groupShapes:{circle:e.CircleGroup,rect:e.RectGroup,ellipse:e.EllipseGroup,diamond:e.DiamondGroup},_getGroupShape:function(e){return s.isString(e)&&(e=this._groupShapes[e]),e},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:1,alpha:1},width:10,height:10,shape:"circle"};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e},_markers:null,_markerCache:null,getMarker:function(e,t,n){var r,i=e.border;e.id=this.get("chart").get("id")+"_"+t+"_"+n,i.opacity=i.alpha,e.stroke=i,e.fill.opacity=e.fill.alpha;if(this._markerCache.length>0){while(!r){if(this._markerCache.length<1){r=this._createMarker(e,t,n);break}r=this._markerCache.shift()}r.set(e)}else r=this._createMarker(e,t,n);return this._markers.push(r),r},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),o.type=o.shape,s=i.addShape(o),s.addClass(p),s},_createMarkerCache:function(){this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null),this._markers&&this._markers.length>0?this._markerCache=this._markers.concat():this._markerCache=[],this._markers=[]},_createGroupMarker:function(e){var t,n=this.get("markers"),r=e.border,i,s,o;if(n&&n.length>0){while(n.length>0)t=n.shift(),t.destroy();this.set("markers",[])}r.opacity=r.alpha,s={id:this.get("chart").get("id")+"_"+e.graphOrder,stroke:r,fill:e.fill,dimensions:e.dimensions,xvalues:e.xvalues,yvalues:e.yvalues},s.fill.opacity=e.fill.alpha,o=this._getGroupShape(e.shape),o&&(s.type=o),e.hasOwnProperty("radius")&&!isNaN(e.radius)&&(s.dimensions.radius=e.radius),this._groupMarker&&this._groupMarker.destroy(),i=this.get("graphic"),this._groupMarker=i.addShape(s),i._redraw()},_toggleVisible:function(e){var t,n=this.get("markers"),r=0,i;if(n){i=n.length;for(;r<i;++r)t=n[r],t&&t.set("visible",e)}},_clearMarkerCache:function(){var e;while(this._markerCache.length>0)e=this._markerCache.shift(),e&&e.destroy()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,s=e.clone(this.get("styles").marker),o=this._getState(t),u=this.get("xcoords"),a=this.get("ycoords"),f=this._markers[n],l=o=="off"||!s[o]?s:s[o];l.fill.color=this._getItemColor(l.fill.color,n),l.border.color=this._getItemColor(l.border.color,n),l.stroke=l.border,f.set(l),r=l.width,i=l.height,f.set("x",u[n]-r/2),f.set("y",a[n]-i/2),f.set("visible",this.get("visible"))}},_getItemColor:function(e,t){return s.isArray(e)?e[t%e.length]:e},_setStyles:function(t){return t=this._parseMarkerStyles(t),e.Renderer.prototype._setStyles.apply(this,[t])},_parseMarkerStyles:function(e){if(e.marker){var t=this._getPlotDefaults();e.marker=this._mergeStyles(e.marker,t),e.marker.over&&(e.marker.over=this._mergeStyles(e.marker.over,e.marker)),e.marker.down&&(e.marker.down=this._mergeStyles(e.marker.down,e.marker))}return e},_getState:function(e){var t;switch(e){case"mouseout":t="off";break;case"mouseover":t="over";break;case"mouseup":t="over";break;case"mousedown":t="down"}return t},_stateSyles:null},e.augment(L,e.Attribute),e.Plots=L,A.prototype={drawSeries:function(){if(this.get("xcoords").length<1)return;var t=e.clone(this.get("styles").marker),n,r,i=this.get("xcoords"),o=this.get("ycoords"),u=0,a=i.length,f=o[0],l=this.get("type"),c=this.get("graph"),h=c.seriesTypes[l],p=h.length,d=0,v=0,m=0,g,y,b=this.get("order"),w=this.get("graphOrder"),E,S,x,T,N,C=null,k=null,L=[],A=[],O,M,_,D,P={width:[],height:[]},H=[],B=[],j=this.get("groupMarkers");s.isArray(t.fill.color)&&(C=t.fill.color.concat()),s.isArray(t.border.color)&&(k=t.border.color.concat()),this.get("direction")=="vertical"?(x="height",T="width"):(x="width",T="height"),n=t[x],r=t[T],this._createMarkerCache();for(;u<p;++u)y=h[u],d+=y.get("styles").marker[x],b>u&&(m=d);v=a*d,this._maxSize=c.get(x),v>this._maxSize&&(g=c.get(x)/v,d*=g,m*=g,n*=g,n=Math.max(n,1),this._maxSize=n),m-=d/2;for(u=0;u<a;++u){O=i[u]-d/2,M=O+d,_=o[u]-d/2,D=_+d,L.push({start:O,end:M}),A.push({start:_,end:D});if(isNaN(i[u])||isNaN(o[u])){this._markers.push(null);continue}N=this._getMarkerDimensions(i[u],o[u],r,m),!isNaN(N.calculatedSize)&&N.calculatedSize>0?(f=N.top,E=N.left,j?(P[x][u]=n,P[T][u]=N.calculatedSize,H.push(E),B.push(f)):(t[x]=n,t[T]=N.calculatedSize,t.x=E,t.y=f,C&&(t.fill.color=C[u%C.length]),k&&(t.border.color=k[u%k.length]),S=this.getMarker(t,w,u))):j||this._markers.push(null)}this.set("xMarkerPlane",L),this.set("yMarkerPlane",A),j?this._createGroupMarker({fill:t.fill,border:t.border,dimensions:P,xvalues:H,yvalues:B,shape:t.shape}):this._clearMarkerCache()},_defaultFillColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:12,height:12,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},e.Histogram=A,e.CartesianSeries=e.Base.create("cartesianSeries",e.Base,[e.Renderer],{_xDisplayName:null,_yDisplayName:null,_leftOrigin:null,_bottomOrigin:null,render:function(){this._setCanvas(),this.addListeners(),this.set("rendered",!0),this.validate()},addListeners:function(){var t=this.get("xAxis"),n=this.get("yAxis");t&&(this._xDataReadyHandle=t.after("dataReady",e.bind(this._xDataChangeHandler,this)),this._xDataUpdateHandle=t.after("dataUpdate",e.bind(this._xDataChangeHandler,this))),n&&(this._yDataReadyHandle=n.after("dataReady",e.bind(this._yDataChangeHandler,this)),this._yDataUpdateHandle=n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))),this._xAxisChangeHandle=this.after("xAxisChange",this._xAxisChangeHandler),this._yAxisChangeHandle=this.after("yAxisChange",this._yAxisChangeHandler),this._stylesChangeHandle=this.after("stylesChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._widthChangeHandle=this.after("widthChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._heightChangeHandle=this.after("heightChange",function(e){var t=this._updateAxisData();t&&this.draw()}),this._visibleChangeHandle=this.after("visibleChange",this._handleVisibleChange)},_xAxisChangeHandler:function(t){var n=this.get("xAxis");n.after("dataReady",e.bind(this._xDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._xDataChangeHandler,this))},_yAxisChangeHandler:function(t){var n=this.get("yAxis");n.after("dataReady",e.bind(this._yDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._yDataChangeHandler,this))},GUID:"yuicartesianseries",_xDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_yDataChangeHandler:function(e){var t=this._updateAxisData();t&&this.draw()},_updateAxisData:function(){var e=this.get("xAxis"),t=this.get("yAxis"),n=this.get("xKey"),r=this.get("yKey"),i,s;return!e||!t||!n||!r?!1:(s=e.getDataByKey(n),i=t.getDataByKey(r),!s||!i?!1:(this.set("xData",s.concat()),this.set("yData",i.concat()),!0))},validate:function(){this.get("xData")&&this.get("yData")||this._updateAxisData()?this.draw():this.fire("drawingComplete")},_setCanvas:function(){var e=this.get("graph"),t=e.get("graphic");this.set("graphic",t)},setAreaData:function(){var e=s.isNumber,t,n,r=this.get("graph"),i=r.get("width"),o=r.get("height"),u=this.get("xAxis"),a=this.get("yAxis"),f=this.get("xData").concat(),l=this.get("yData").concat(),c,h,p=u.getEdgeOffset(f.length,i),d=a.getEdgeOffset(l.length,o),v=this.get("styles").padding,m=v.left,g=v.top,y=i-(m+v.right+p),b=o-(g+v.bottom+d),w=[],E=[],S=u.get("maximum"),x=u.get("minimum"),T=a.get("maximum"),N=a.get("minimum"),C=y/(S-x),k=b/(T-N),L,A=this.get("direction"),O=0,M=[],_=[],D=this.get("xMarkerPlaneOffset"),P=this.get("yMarkerPlaneOffset"),H=this.get("graphic");H.set("width",i),H.set("height",o),L=f.length,p*=.5,d*=.5,A==="vertical"&&(l=l.reverse()),this._leftOrigin=Math.round((0-x)*C+m+p),this._bottomOrigin=Math.round(b+g+d),N<0&&(this._bottomOrigin=this._bottomOrigin-(0-N)*k);for(;O<L;++O)c=parseFloat(f[O]),h=parseFloat(l[O]),e(c)?t=(c-x)*C+m+p:t=NaN,e(h)?n=b+g+d-(h-N)*k:n=NaN,w.push(t),E.push(n),M.push({start:t-D,end:t+D}),_.push({start:n-P,end:n+P});this.set("xcoords",w),this.set("ycoords",E),this.set("xMarkerPlane",M),this.set("yMarkerPlane",_),this._dataLength=L},_getFirstValidIndex:function(e){var t,n=-1,r=e.length;while(!s.isNumber(t)&&n<r)n+=1,t=e[n];return n},_getLastValidIndex:function(e){var t,n=e.length,r=-1;while(!s.isNumber(t)&&n>r)n-=1,t=e[n];return n},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(this.get("rendered")&&isFinite(t)&&isFinite(n)&&t>0&&n>0&&(this.get("xData")&&this.get("yData")||this._updateAxisData())){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.setAreaData(),this.get("xcoords")&&this.get("ycoords")&&this.drawSeries(),this._drawing=!1,this._callLater?this.draw():(this._toggleVisible(this.get("visible")),this.fire("drawingComplete"))}},_defaultPlaneOffset:4,_getDefaultStyles:function(){return{padding:{top:0,left:0,right:0,bottom:0}}},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]},_handleVisibleChange:function(e){this._toggleVisible(this.get("visible"))},getTotalValues:function(){var e=this.get("valueAxis").getTotalByKey(this.get("valueKey"));return e},destructor:function(){var t,n=this.get("markers");this.get("rendered")&&(this._xDataReadyHandle&&this._xDataReadyHandle.detach(),this._xDataUpdateHandle&&this._xDataUpdateHandle.detach(),this._yDataReadyHandle&&this._yDataReadyHandle.detach(),this._yDataUpdateHandle&&this._yDataUpdateHandle.detach(),this._xAxisChangeHandle.detach(),this._yAxisChangeHandle.detach(),this._stylesChangeHandle.detach(),this._widthChangeHandle.detach(),this._heightChangeHandle.detach(),this._visibleChangeHandle.detach());while(n&&n.length>0)t=n.shift(),t&&t instanceof e.Shape&&t.destroy();this._path&&(this._path.destroy(),this._path=null),this._lineGraphic&&(this._lineGraphic.destroy(),this._lineGraphic=null),this._groupMarker&&(this._groupMarker.destroy(),this._groupMarker=null)}},{ATTRS:{xDisplayName:{getter:function(){return this._xDisplayName||this.get("xKey")},setter:function(e){return this._xDisplayName=e.toString(),e}},yDisplayName:{getter:function(){return this._yDisplayName||this.get("yKey")},setter:function(e){return this._yDisplayName=e.toString(),e}},categoryDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("yDisplayName"):this.get("xDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._yDisplayName=e:this._xDisplayName=e,e}},valueDisplayName:{lazyAdd:!1,getter:function(){return this.get("direction")=="vertical"?this.get("xDisplayName"):this.get("yDisplayName")},setter:function(e){return this.get("direction")=="vertical"?this._xDisplayName=e:this._yDisplayName=e,e}},type:{value:"cartesian"},order:{},graphOrder:{},xcoords:{},ycoords:{},chart:{readOnly:!0,getter:function(){return this.get("graph").get("chart")}},graph:{},xAxis:{},yAxis:{},xKey:{setter:function(e){return e.toString()}},yKey:{setter:function(e){return e.toString()}},xData:{},yData:{},rendered:{value:!1},width:{readOnly:!0,getter:function(){this.get("graph").get("width")}},height:{readOnly:!0,getter:function(){this.get("graph").get("height")}},visible:{value:!0},xMarkerPlane:{},yMarkerPlane:{},xMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.width&&isFinite(e.width)?e.width*.5:this._defaultPlaneOffset}},yMarkerPlaneOffset:{getter:function(){var e=this.get("styles").marker;return e&&e.height&&isFinite(e.height)?e.height*.5:this._defaultPlaneOffset}},direction:{value:"horizontal"},groupMarkers:{getter:function(){return this._groupMarkers===undefined?this.get("graph").get("groupMarkers"):this._groupMarkers},setter:function(e){return this._groupMarkers=e,e}}}}),e.MarkerSeries=e.Base.create("markerSeries",e.CartesianSeries,[e.Plots],{drawSeries:function(){this.drawPlots()},_setStyles:function(t){return t.marker||(t={marker:t}),t=this._parseMarkerStyles(t),e.MarkerSeries.superclass._mergeStyles.apply(this,[t,this._getDefaultStyles()])},_getDefaultStyles:function(){var t=this._mergeStyles({marker:this._getPlotDefaults()},e.MarkerSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"marker"}}}),e.LineSeries=e.Base.create("lineSeries",e.CartesianSeries,[e.Lines],{drawSeries:function(){this.drawLines()},_setStyles:function(t){return t.line||(t={line:t}),e.LineSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({line:this._getLineDefaults()},e.LineSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"line"}}}),e.SplineSeries=e.Base.create("splineSeries",e.LineSeries,[e.CurveUtil,e.Lines],{drawSeries:function(){this.drawSpline()}},{ATTRS:{type:{value:"spline"}}}),e.StackedSplineSeries=e.Base.create("stackedSplineSeries",e.SplineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedSplineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedSpline"}}}),e.StackedMarkerSeries=e.Base.create("stackedMarkerSeries",e.MarkerSeries,[e.StackingUtil],{setAreaData:function(){e.StackedMarkerSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedMarker"}}}),e.ColumnSeries=e.Base.create("columnSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={left:e+r};return this._bottomOrigin>=t?(i.top=t,i.calculatedSize=this._bottomOrigin-i.top):(i.top=this._bottomOrigin,i.calculatedSize=t-this._bottomOrigin),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c,h=l.seriesTypes[this.get("type")],p=h.length,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?e.clone(r):e.clone(r[s]),i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.width,v),i.height=w.calculatedSize,i.width=Math.min(this._maxSize,i.width),a.set(i);for(;g<p;++g)y[g]=o[n]+d,c=h[g].get("styles").marker,d+=Math.min(this._maxSize,c.width),b>g&&(v=d),v-=d/2;for(g=0;g<p;++g)f=h[g].get("markers"),f&&(m=f[n],m&&m!==undefined&&m.set("x",y[g]-d/2))}}},{ATTRS:{type:{value:"column"}}}),e.BarSeries=e.Base.create("barSeries",e.MarkerSeries,[e.Histogram],{_getMarkerDimensions:function(e,t,n,r){var i={top:t+r};return e>=this._leftOrigin?(i.left=this._leftOrigin,i.calculatedSize=e-i.left):(i.left=e,i.calculatedSize=this._leftOrigin-e),i},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r=e.clone(this.get("styles").marker),i,s=this._getState(t),o=this.get("xcoords"),u=this.get("ycoords"),a=this._markers[n],f,l=this.get("graph"),c=l.seriesTypes[this.get("type")],h=c.length,p,d=0,v=0,m,g=0,y=[],b=this.get("order"),w;i=s=="off"||!r[s]?r:r[s],i.fill.color=this._getItemColor(i.fill.color,n),i.border.color=this._getItemColor(i.border.color,n),w=this._getMarkerDimensions(o[n],u[n],r.height,v),i.width=w.calculatedSize,i.height=Math.min(this._maxSize,i.height),a.set(i);for(;g<h;++g)y[g]=u[n]+d,p=c[g].get("styles").marker,d+=Math.min(this._maxSize,p.height),b>g&&(v=d),v-=d/2;for(g=0;g<h;++g)f=c[g].get("markers"),f&&(m=f[n],m&&m!==undefined&&m.set("y",y[g]-d/2))}}},{ATTRS:{type:{value:"bar"},direction:{value:"vertical"}}}),e.AreaSeries=e.Base.create("areaSeries",e.CartesianSeries,[e.Fills],{drawSeries:function(){this.drawFill.apply(this,this._getClosingPoints())},_setStyles:function(t){return t.area||(t={area:t}),e.AreaSeries.superclass._setStyles.apply(this,[t])},_getDefaultStyles:function(){var t=this._mergeStyles({area:this._getAreaDefaults()},e.AreaSeries.superclass._getDefaultStyles());return t}},{ATTRS:{type:{value:"area"}}}),e.AreaSplineSeries=e.Base.create("areaSplineSeries",e.AreaSeries,[e.CurveUtil],{drawSeries:function(){this.drawAreaSpline()}},{ATTRS:{type:{value:"areaSpline"}}}),e.StackedAreaSplineSeries=e.Base.create("stackedAreaSplineSeries",e.AreaSeries,[e.CurveUtil,e.StackingUtil],{drawSeries:function(){this._stackCoordinates(),this.drawStackedAreaSpline()}},{ATTRS:{type:{value:"stackedAreaSpline"}}}),e.ComboSeries=e.Base.create("comboSeries",e.CartesianSeries,[e.Fills,e.Lines,e.Plots],{drawSeries:function(){this.get("showAreaFill")&&this.drawFill.apply(this,this._getClosingPoints()),this.get("showLines")&&this.drawLines(),this.get("showMarkers")&&this.drawPlots()},_toggleVisible:function(e){var t,n,r,i;this.get("showAreaFill")&&this._path&&this._path.set("visible",e),this.get("showLines")&&this._lineGraphic&&this._lineGraphic.set("visible",e);if(this.get("showMarkers")){t=this.get("markers");if(t){i=0,r=t.length;for(;i<r;++i)n=t[i],n&&n.set("visible",e)}}},_getDefaultStyles:function(){var t=e.ComboSeries.superclass._getDefaultStyles();return t.line=this._getLineDefaults(),t.marker=this._getPlotDefaults(),t.area=this._getAreaDefaults(),t}},{ATTRS:{type:{value:"combo"},showAreaFill:{value:!1},showLines:{value:!0},showMarkers:{value:!0},marker:{lazyAdd:!1,getter:function(){return this.get("styles").marker},setter:function(e){this.set("styles",{marker:e})}},line:{lazyAdd:!1,getter:function(){return this.get("styles").line},setter:function(e){this.set("styles",{line:e})}},area:{lazyAdd:!1,getter:function(){return this.get("styles").area},setter:function(e){this.set("styles",{area:e})}}}}),e.StackedComboSeries=e.Base.create("stackedComboSeries",e.ComboSeries,[e.StackingUtil],{setAreaData:function(){e.StackedComboSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)},drawSeries:function(){this.get("showAreaFill")&&this.drawFill.apply(this,this._getStackedClosingPoints()),this.get("showLines")&&this.drawLines(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"stackedCombo"},showAreaFill:{value:!0}}}),e.ComboSplineSeries=e.Base.create("comboSplineSeries",e.ComboSeries,[e.CurveUtil],{drawSeries:function(){this.get("showAreaFill")&&this.drawAreaSpline(),this.get("showLines")&&this.drawSpline(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"comboSpline"}}}),e.StackedComboSplineSeries=e.Base.create("stackedComboSplineSeries",e.StackedComboSeries,[e.CurveUtil],{drawSeries:function(){this.get("showAreaFill")&&this.drawStackedAreaSpline(),this.get("showLines")&&this.drawSpline(),this.get("showMarkers")&&this.drawPlots()}},{ATTRS:{type:{value:"stackedComboSpline"},showAreaFill:{value:!0}}}),e.StackedLineSeries=e.Base.create("stackedLineSeries",e.LineSeries,[e.StackingUtil],{setAreaData:function(){e.StackedLineSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)}},{ATTRS:{type:{value:"stackedLine"}}}),e.StackedAreaSeries=e.Base.create("stackedAreaSeries",e.AreaSeries,[e.StackingUtil],{setAreaData:function(){e.StackedAreaSeries.superclass.setAreaData.apply(this),this._stackCoordinates.apply(this)},drawSeries:function(){this.drawFill.apply(this,this._getStackedClosingPoints())}},{ATTRS:{type:{value:"stackedArea"}}}),e.StackedColumnSeries=e.Base.create("stackedColumnSeries",e.ColumnSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*r,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(b=n.fill.color.concat()),s.isArray(n.border.color)&&(w=n.border.color.concat()),this._createMarkerCache(),N>this.get("width")&&(d=this.width/N,r*=d,r=Math.max(r,1));if(!T){E=p[v-1],S=E.get("negativeBaseValues"),x=E.get("positiveBaseValues");if(!S||!x)T=!0,x=[],S=[]}else S=[],x=[];this.set("negativeBaseValues",S),this.set("positiveBaseValues",x);for(a=0;a<f;++a){g=o[a],l=u[a];if(!t(l)||!t(g)){T&&(S[a]=this._bottomOrigin,x[a]=this._bottomOrigin),this._markers.push(null);continue}T?(i=Math.abs(this._bottomOrigin-l),l<this._bottomOrigin?(x[a]=l,S[a]=this._bottomOrigin):l>this._bottomOrigin?(x[a]=this._bottomOrigin,S[a]=l,l-=i):(x[a]=l,S[a]=l)):l>this._bottomOrigin?(l+=S[a]-this._bottomOrigin,i=l-S[a],S[a]=l,l-=i):l<=this._bottomOrigin&&(l=x[a]-(this._bottomOrigin-l),i=x[a]-l,x[a]=l),!isNaN(i)&&i>0?(g-=r/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,b&&(n.fill.color=b[a%b.length]),w&&(n.border.color=w[a%w.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers&&this._markers[n]){var r,i,o=this._getState(t),u=this.get("xcoords"),a=this._markers[n],f=0,l,c;r=this.get("styles").marker,f=r.width*.5,i=o=="off"||!r[o]?e.clone(r):e.clone(r[o]),i.height=a.get("height"),i.x=u[n]-f,i.y=a.get("y"),i.id=a.get("id"),l=i.fill.color,c=i.border.color,s.isArray(l)?i.fill.color=l[n%l.length]:i.fill.color=this._getItemColor(i.fill.color,n),s.isArray(c)?i.border.color=c[n%c.length]:i.border.color=this._getItemColor(i.border.color,n),a.set(i)}},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedColumn"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.StackedBarSeries=e.Base.create("stackedBarSeries",e.BarSeries,[e.StackingUtil],{drawSeries:function(){if(this.get("xcoords").length<1)return;var t=s.isNumber,n=e.clone(this.get("styles").marker),r=n.width,i=n.height,o=this.get("xcoords"),u=this.get("ycoords"),a=0,f=o.length,l=u[0],c=this.get("type"),h=this.get("graph"),p=h.seriesTypes[c],d,v=this.get("order"),m=this.get("graphOrder"),g,y,b,w,E,S,x,T=v===0,N=f*i,C={width:[],height:[]},k=[],L=[],A=this.get("groupMarkers");s.isArray(n.fill.color)&&(S=n.fill.color.concat()),s.isArray(n.border.color)&&(x=n.border.color.concat()),this._createMarkerCache(),N>this.get("height")&&(d=this.height/N,i*=d,i=Math.max(i,1));if(!T){b=p[v-1],w=b.get("negativeBaseValues"),E=b.get("positiveBaseValues");if(!w||!E)T=!0,E=[],w=[]}else w=[],E=[];this.set("negativeBaseValues",w),this.set("positiveBaseValues",E);for(a=0;a<f;++a){l=u[a],g=o[a];if(!t(l)||!t(g)){T&&(E[a]=this._leftOrigin,w[a]=this._leftOrigin),this._markers.push(null);continue}T?(r=Math.abs(g-this._leftOrigin),g>this._leftOrigin?(E[a]=g,w[a]=this._leftOrigin,g-=r):g<this._leftOrigin?(E[a]=this._leftOrigin,w[a]=g):(E[a]=g,w[a]=this._leftOrigin)):g<this._leftOrigin?(g=w[a]-(this._leftOrigin-o[a]),r=w[a]-g,w[a]=g):g>=this._leftOrigin&&(g+=E[a]-this._leftOrigin,r=g-E[a],E[a]=g,g-=r),!isNaN(r)&&r>0?(l-=i/2,A?(C.width[a]=r,C.height[a]=i,k.push(g),L.push(l)):(n.width=r,n.height=i,n.x=g,n.y=l,S&&(n.fill.color=S[a%S.length]),x&&(n.border.color=x[a%x.length]),y=this.getMarker(n,m,a))):A||this._markers.push(null)}A?this._createGroupMarker({fill:n.fill,border:n.border,dimensions:C,xvalues:k,yvalues:L,shape:n.shape}):this._clearMarkerCache()},updateMarkerState:function(t,n){if(this._markers[n]){var r=this._getState(t),i=this.get("ycoords"),o=this._markers[n],u=this.get("styles").marker,a=u.height,f=r=="off"||!u[r]?e.clone(u):e.clone(u[r]),l,c;f.y=i[n]-a/2,f.x=o.get("x"),f.width=o.get("width"),f.id=o.get("id"),l=f.fill.color,c=f.border.color,s.isArray(l)?f.fill.color=l[n%l.length]:f.fill.color=this._getItemColor(f.fill.color,n),s.isArray(c)?f.border.color=c[n%c.length]:f.border.color=this._getItemColor(f.border.color,n),o.set(f)}},_getPlotDefaults:function(){var e={fill:{type:"solid",alpha:1,colors:null,alphas:null,ratios:null},border:{weight:0,alpha:1},width:24,height:24,shape:"rect",padding:{top:0,left:0,right:0,bottom:0}};return e.fill.color=this._getDefaultColor(this.get("graphOrder"),"fill"),e.border.color=this._getDefaultColor(this.get("graphOrder"),"border"),e}},{ATTRS:{type:{value:"stackedBar"},direction:{value:"vertical"},negativeBaseValues:{value:null},positiveBaseValues:{value:null}}}),e.PieSeries=e.Base.create("pieSeries",e.MarkerSeries,[],{_map:null,_image:null,_setMap:function(){var e="pieHotSpotMapi_"+Math.round(1e5*Math.random()),t=this.get("graph").get("contentBox"),n;if(this._image){t.removeChild(this._image);while(this._areaNodes&&this._areaNodes.length>0)n=this._areaNodes.shift(),this._map.removeChild(n);t.removeChild(this._map)}this._image=i.createElement("img"),this._image.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAABCAYAAAD9yd/wAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAABJJREFUeNpiZGBgSGPAAgACDAAIkABoFyloZQAAAABJRU5ErkJggg==",t.appendChild(this._image),this._image.setAttribute("usemap","#"+e),this._image.style.zIndex=3,this._image.style.opacity=0,this._image.setAttribute("alt","imagemap"),this._map=i.createElement("map"),this._map.style.zIndex=5,t.appendChild(this._map),this._map.setAttribute("name",e),this._map.setAttribute("id",e),this._areaNodes=[]},_categoryDisplayName:null,_valueDisplayName:null,addListeners:function(){var t=this.get("categoryAxis"),n=this.get("valueAxis");t&&(t.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),t.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))),n&&(n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))),this.after("categoryAxisChange",this.categoryAxisChangeHandler),this.after("valueAxisChange",this.valueAxisChangeHandler),this.after("stylesChange",this._updateHandler)},validate:function(){this.draw(),this._renderered=!0},_categoryAxisChangeHandler:function(t){var n=this.get("categoryAxis");n.after("dataReady",e.bind(this._categoryDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._categoryDataChangeHandler,this))},_valueAxisChangeHandler:function(t){var n=this.get("valueAxis");n.after("dataReady",e.bind(this._valueDataChangeHandler,this)),n.after("dataUpdate",e.bind(this._valueDataChangeHandler,this))},GUID:"pieseries",_categoryDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},_valueDataChangeHandler:function(e){this._rendered&&this.get("categoryKey")&&this.get("valueKey")&&this.draw()},draw:function(){var e=this.get("graph"),t=e.get("width"),n=e.get("height");if(isFinite(t)&&isFinite(n)&&t>0&&n>0){this._rendered=!0;if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.drawSeries(),this._drawing=!1,this._callLater?this.draw():this.fire("drawingComplete")}},drawPlots:function(){var t=this.get("valueAxis").getDataByKey(this.get("valueKey")).concat(),n=this.get("categoryAxis").getDataByKey(this.get("categoryKey")).concat(),r=0,i=t.length,s=this.get("styles").marker,o=s.fill.colors,u=s.fill.alphas||["1"],a=s.border.colors,f=[s.border.weight],l=[s.border.alpha],c=f.concat(),h=a.concat(),p=l.concat(),d,v,m=s.padding,g=this.get("graph"),y=Math.min(g.get("width"),g.get("height")),b=y-(m.left+m.right),w=y-(m.top+m.bottom),E=-90,S=b/2,x=w/2,T=Math.min(S,x),N=0,C,k=0,L,A,O,M,_,D=this.get("graphOrder"),P=e.Graphic.NAME=="canvasGraphic";for(;N<i;++N)C=parseFloat(t[N]),t.push(C),isNaN(C)||(r+=C);d=o?o.concat():null,v=u?u.concat():null,this._createMarkerCache(),P&&(this._setMap(),this._image.width=b,this._image.height=w);for(N=0;N<i;N++)C=t[N],r===0?k=360/t.length:k=360*(C/r),d&&d.length<1&&(d=o.concat()),v&&v.length<1&&(v=u.concat()),c&&c.length<1&&(c=f.concat()),c&&h.length<1&&(h=a.concat()),p&&p.length<1&&(p=l.concat()),O=c?c.shift():null,L=h?h.shift():null,A=p?p.shift():null,E+=k,M={border:{color:L,weight:O,alpha:A},fill:{color:d?d.shift():this._getDefaultColor(N,"slice"),alpha:v?v.shift():null},type:"pieslice",arc:k,radius:T,startAngle:E,cx:S,cy:x,width:b,height:w},_=this.getMarker(M,D,N),P&&this._addHotspot(M,D,N);this._clearMarkerCache()},_addHotspot:function(e,t,n){var r=i.createElement("area"),s=1,o=e.cx,u=e.cy,a=e.arc,f=e.startAngle-a,l=e.startAngle,c=e.radius,h=o+Math.cos(f/180*Math.PI)*c,d=u+Math.sin(f/180*Math.PI)*c,v=o+Math.cos(l/180*Math.PI)*c,m=u+Math.sin(l/180*Math.PI)*c,g=Math.floor(a/10)-1,y=a/Math.floor(a/10)/180*Math.PI,b=Math.atan((d-u)/(h-o)),w=o+", "+u+", "+h+", "+d,E,S,x;for(s=1;s<=g;++s)x=y*s,E=Math.cos(b+x),S=Math.sin(b+x),f<=90?(w+=", "+(o+c*Math.cos(b+y*s)),w+=", "+(u+c*Math.sin(b+y*s))):(w+=", "+(o-c*Math.cos(b+y*s)),w+=", "+(u-c*Math.sin(b+y*s)));w+=", "+v+", "+m,w+=", "+o+", "+u,this._map.appendChild(r),r.setAttribute("class",p),r.setAttribute("id","hotSpot_"+t+"_"+n),r.setAttribute("shape","polygon"),r.setAttribute("coords",w),this._areaNodes.push(r)},updateMarkerState:function(e,t){if(this._markers[t]){var n=this._getState(e),r,i,s=this._markers[t],o=this.get("styles").marker;r=n=="off"||!o[n]?o:o[n],i=this._mergeStyles(r,{}),i.fill.color=i.fill.colors[t%i.fill.colors.length],i.fill.alpha=i.fill.alphas[t%i.fill.alphas.length],s.set(i)}},_createMarker:function(t,n,r){var i=this.get("graphic"),s,o=e.clone(t);return i.set("autoDraw",!1),s=i.addShape(o),s.addClass(p),s},_clearMarkerCache:function(){var e=this._markerCache.length,t=0,n;for(;t<e;++t)n=this._markerCache[t],n&&n.destroy();this._markerCache=[]},_getPlotDefaults:function(){var e={padding:{top:0,left:0,right:0,bottom:0},fill:{alphas:["1"]},border:{weight:0,alpha:1}};return e.fill.colors=this._defaultSliceColors,e.border.colors=this._defaultBorderColors,e},_defaultLineColors:["#426ab3","#d09b2c","#000000","#b82837","#b384b5","#ff7200","#779de3","#cbc8ba","#7ed7a6","#007a6c"],_defaultFillColors:["#6084d0","#eeb647","#6c6b5f","#d6484f","#ce9ed1","#ff9f3b","#93b7ff","#e0ddd0","#94ecba","#309687"],_defaultBorderColors:["#205096","#b38206","#000000","#94001e","#9d6fa0","#e55b00","#5e85c9","#adab9e","#6ac291","#006457"],_defaultSliceColors:["#66007f","#a86f41","#295454","#996ab2","#e8cdb7","#90bdbd","#000000","#c3b8ca","#968373","#678585"],_getDefaultColor:function(e,t){var n={line:this._defaultLineColors,fill:this._defaultFillColors,border:this._defaultBorderColors,slice:this._defaultSliceColors},r=n[t],i=r.length;return e=e||0,e>=i&&(e%=i),t=t||"fill",n[t][e]}},{ATTRS:{type:{value:"pie"},order:{},graph:{},categoryAxis:{value:null,validator:function(e){return e!==this.get("categoryAxis")}},valueAxis:{value:null,validator:function(e){return e!==this.get("valueAxis")}},categoryKey:{value:null,validator:function(e){return e!==this.get("categoryKey")}},valueKey:{value:null,validator:function(e){return e!==this.get("valueKey")}},categoryDisplayName:{setter:function(e){return this._categoryDisplayName=e,e},getter:function(){return this._categoryDisplayName||this.get("categoryKey")}},valueDisplayName:{setter:function(e){return this._valueDisplayName=e,e},getter:function(){return this._valueDisplayName||this.get("valueKey")}},slices:null}}),e.Gridlines=e.Base.create("gridlines",e.Base,[e.Renderer],{_path:null,remove:function(){var e=this._path;e&&e.destroy()},draw:function(){this.get("axis")&&this.get("graph")&&this._drawGridlines()},_drawGridlines:function(){var e,t=this.get("axis"),n=t.get("position"),r,i=0,s,o=this.get("direction"),u=this.get("graph"),a=u.get("width"),f=u.get("height"),l=this.get("styles").line,c=l.color,h=l.weight,p=l.alpha,d=o=="vertical"?this._verticalLine:this._horizontalLine;if(isFinite(a)&&isFinite(f)&&a>0&&f>0){if(n!="none"&&t&&t.get("tickPoints"))r=t.get("tickPoints"),s=r.length;else{r=[],s=t.get("styles").majorUnit.count;for(;i<s;++i)r[i]={x:a*(i/(s-1)),y:f*(i/(s-1))};i=0}e=u.get("gridlines"),e.set("width",a),e.set("height",f),e.set("stroke",{weight:h,color:c,opacity:p});for(;i<s;++i)d(e,r[i],a,f);e.end()}},_horizontalLine:function(e,t,n,r){e.moveTo(0,t.y),e.lineTo(n,t.y)},_verticalLine:function(e,t,n,r){e.moveTo(t.x,0),e.lineTo(t.x,r)},_getDefaultStyles:function(){var e={line:{color:"#f0efe9",weight:1,alpha:1}};return e}},{ATTRS:{direction:{},axis:{},graph:{}}}),e.Graph=e.Base.create("graph",e.Widget,[e.Renderer],{bindUI:function(){var e=this.get("boundingBox");e.setStyle("position","absolute"),this.after("widthChange",this._sizeChangeHandler),this.after("heightChange",this._sizeChangeHandler),this.after("stylesChange",this._updateStyles),this.after("groupMarkersChange",this._drawSeries)},syncUI:function(){var t,n,r,i=this.get("seriesCollection"),s,o=0,u=i?i.length:0,a=this.get("horizontalGridlines"),f=this.get("verticalGridlines");this.get("showBackground")&&(t=this.get("background"),n=this.get("contentBox"),r=this.get("styles").background,r.stroke=r.border,r.stroke.opacity=r.stroke.alpha,r.fill.opacity=r.fill.alpha,r.width=this.get("width"),r.height=this.get("height"),r.type=r.shape,t.set(r));for(;o<u;++o)s=i[o],s instanceof e.CartesianSeries&&s.render();a&&a instanceof e.Gridlines&&a.draw(),f&&f instanceof e.Gridlines&&f.draw()},seriesTypes:null,getSeriesByIndex:function(e){var t=this.get("seriesCollection"),n;return t&&t.length>e&&(n=t[e]),n},getSeriesByKey:function(e){var t=this._seriesDictionary,n;return t&&t.hasOwnProperty(e)&&(n=t[e]),n},addDispatcher:function(e){this._dispatchers||(this._dispatchers=[]),this._dispatchers.push(e)},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(t){if(!t)return;var n=t.length,r=0,i,s;this._seriesCollection=[],this._seriesDictionary={},this.seriesTypes=[];for(;r<n;++r){i=t[r];if(!(i instanceof e.CartesianSeries||i instanceof e.PieSeries)){this._createSeries(i);continue}this._addSeries(i)}n=this._seriesCollection.length;for(r=0;r<n;++r)i=this.get("seriesCollection")[r],s=i.get("direction")=="horizontal"?"yKey":"xKey",this._seriesDictionary[i.get(s)]=i},_addSeries:function(t){var n=t.get("type"),r=this.get("seriesCollection"),i=r.length,s=this.seriesTypes,o;t.get("graph")||t.set("graph",this),r.push(t),s.hasOwnProperty(n)||(this.seriesTypes[n]=[]),o=this.seriesTypes[n],t.set("graphOrder",i),t.set("order",o.length),o.push(t),this.addDispatcher(t),t.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),this.fire("seriesAdded",t)},_createSeries:function(t){var n=t.type,r=this.get("seriesCollection"),i=this.seriesTypes,s,o,u;t.graph=this,i.hasOwnProperty(n)||(i[n]=[]),s=i[n],t.graph=this,t.order=s.length,t.graphOrder=r.length,o=this._getSeries(t.type),u=new o(t),this.addDispatcher(u),u.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),s.push(u),r.push(u),this.get("rendered")&&u.render()},_seriesMap:{line:e.LineSeries,column:e.ColumnSeries,bar:e.BarSeries,area:e.AreaSeries,candlestick:e.CandlestickSeries,ohlc:e.OHLCSeries,stackedarea:e.StackedAreaSeries,stackedline:e.StackedLineSeries,stackedcolumn:e.StackedColumnSeries,stackedbar:e.StackedBarSeries,markerseries:e.MarkerSeries,spline:e.SplineSeries,areaspline:e.AreaSplineSeries,stackedspline:e.StackedSplineSeries,stackedareaspline:e.StackedAreaSplineSeries,stackedmarkerseries:e.StackedMarkerSeries,pie:e.PieSeries,combo:e.ComboSeries,stackedcombo:e.StackedComboSeries,combospline:e.ComboSplineSeries,stackedcombospline:e.StackedComboSplineSeries},_getSeries:function(e){var t;return s.isString(e)?t=this._seriesMap[e]:t=e,t},_markerEventHandler:function(e){var t=e.type,n=e.currentTarget,r=n.getAttribute("id").split("_"),i=this.getSeriesByIndex(r[1]),s=r[2];i.updateMarkerState(t,s)},_dispatchers:null,_updateStyles:function(){var e=this.get("styles").background,t=e.border;t.opacity=t.alpha,e.stroke=t,e.fill.opacity=e.fill.alpha,this.get("background").set(e),this._sizeChangeHandler()},_sizeChangeHandler:function(t){var n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("width"),s=this.get("height"),o=this.get("styles").background,u,a;o&&o.border&&(u=o.border.weight||0),this.get("showBackground")&&(a=this.get("background"),i&&s&&(a.set("width",i),a.set("height",s))),this._gridlines&&this._gridlines.clear(),n&&n instanceof e.Gridlines&&n.draw(),r&&r instanceof e.Gridlines&&r.draw(),this._drawSeries()},_drawSeries:function(){if(this._drawing){this._callLater=!0;return}var t,n,r,i=this.get("graphic");i.set("autoDraw",!1),this._callLater=!1,this._drawing=!0,t=this.get("seriesCollection"),n=0,r=t?t.length:0;for(;n<r;++n){t[n].draw();if((!t[n].get("xcoords")||!t[n].get("ycoords"))&&!t[n]instanceof e.PieSeries){this._callLater=!0;break}}this._drawing=!1,this._callLater&&this._drawSeries()},_drawingCompleteHandler:function(t){var n=t.currentTarget,r,i=e.Array.indexOf(this._dispatchers,n);i>-1&&this._dispatchers.splice(i,1),this._dispatchers.length<1&&(r=this.get("graphic"),r.get("autoDraw")||r._redraw(),this.fire("chartRendered"))},_getDefaultStyles:function(){var e={background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},destructor:function(){this._graphic&&(this._graphic.destroy(),this._graphic=null),this._background&&(this._background.get("graphic").destroy(),this._background=null),this._gridlines&&(this._gridlines.get("graphic").destroy(),this._gridlines=null)}},{ATTRS:{x:{setter:function(e){return this.get("boundingBox").setStyle("left",e+"px"),e}},y:{setter:function(e){return this.get("boundingBox").setStyle("top",e+"px"),e}},chart:{},seriesCollection:{getter:function(){return this._seriesCollection},setter:function(e){return this._parseSeriesCollection(e),this._seriesCollection}},showBackground:{value:!0},seriesDictionary:{readOnly:!0,getter:function(){return this._seriesDictionary}},horizontalGridlines:{value:null,setter:function(t){var n=this.get("horizontalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"horizontal",axis:t.axis,graph:this,styles:t.styles}),n}},verticalGridlines:{value:null,setter:function(t){var n=this.get("verticalGridlines");n&&n instanceof e.Gridlines&&n.remove();if(t instanceof e.Gridlines)return n=t,t.set("graph",this),t;if(t&&t.axis)return n=new e.Gridlines({direction:"vertical",axis:t.axis,graph:this,styles:t.styles}),n}},background:{getter:function(){return this._background||(this._backgroundGraphic=new e.Graphic({render:this.get("contentBox")}),this._backgroundGraphic.get("node").style.zIndex=0,this._background=this._backgroundGraphic.addShape({type:"rect"})),this._background}},gridlines:{readOnly:!0,getter:function(){return this._gridlines||(this._gridlinesGraphic=new e.Graphic({render:this.get("contentBox")}),this._gridlinesGraphic.get("node").style.zIndex=1,this._gridlines=this._gridlinesGraphic.addShape({type:"path"})),this._gridlines}},graphic:{readOnly:!0,getter:function(){return this._graphic||(this._graphic=new e.Graphic({render:this.get("contentBox")}),this._graphic.get("node").style.zIndex=2,this._graphic.set("autoDraw",!1)),this._graphic}},groupMarkers:{value:!1}}}),O.ATTRS={dataProvider:{lazyAdd:!1,valueFn:function(){var e=[];return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(e)),e},setter:function(e){var t=this._setDataValues(e);return this._seriesKeysExplicitlySet||(this._seriesKeys=this._buildSeriesKeys(t)),t}},seriesKeys:{getter:function(){return this._seriesKeys},setter:function(e){return this._seriesKeysExplicitlySet=!0,this._seriesKeys=e,e}},ariaLabel:{value:"Chart Application",setter:function(e){var t=this.get("contentBox");return t&&t.setAttribute("aria-label",e),e}},ariaDescription:{value:"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},tooltip:{valueFn:"_getTooltip",setter:function(e){return this._updateTooltip(e)}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},axesCollection:{},graph:{valueFn:"_getGraph"},groupMarkers:{value:!1}},O.prototype={_groupMarkersChangeHandler:function(e){var t=this.get("graph"),n=e.newVal;t&&t.set("groupMarkers",n)},_itemRendered:function(t){this._itemRenderQueue=this._itemRenderQueue.splice(1+e.Array.indexOf(this._itemRenderQueue,t.currentTarget),1),this._itemRenderQueue.length<1&&this._redraw()},_getGraph:function(){var t=new e.Graph({chart:this,groupMarkers:this.get("groupMarkers")});return t.after("chartRendered",e.bind(function(e){this.fire("chartRendered")},this)),t},getSeries:function(e){var t=null,n=this.get("graph");return n&&(s.isNumber(e)?t=n.getSeriesByIndex(e):t=n.getSeriesByKey(e)),t},getAxisByKey:function(e){var t,n=this.get("axes");return n&&n.hasOwnProperty(e)&&(t=n[e]),t},getCategoryAxis:function(){var e,t=this.get("categoryKey"),n=this.get("axes");return n.hasOwnProperty(t)&&(e=n[t]),e},_direction:"horizontal",_dataProvider:null,_setDataValues:function(e){if(s.isArray(e[0])){var t,n=[],r=e[0],i=0,o=r.length,u,a=e.length;for(;i<o;++i){t={category:r[i]};for(u=1;u<a;++u)t["series"+u]=e[u][i];n[i]=t}return n}return e},_seriesCollection:null,_setSeriesCollection:function(e){this._seriesCollection=e},_getAxisClass:function(e){return this._axisClass[e]},_axisClass:{stacked:e.StackedAxis,numeric:e.NumericAxis,category:e.CategoryAxis,time:e.TimeAxis},_axes:null,initializer:function(){this._itemRenderQueue=[],this._seriesIndex=-1,this._itemIndex=-1,this.after("dataProviderChange",this._dataProviderChangeHandler)},renderUI:function(){var e=this.get("tooltip"),t=this.get("boundingBox"),n=this.get("contentBox");t.setStyle("position","absolute"),n.setStyle("position","absolute"),this._addAxes(),this._addSeries(),e&&e.show&&this._addTooltip(),this._setAriaElements(t,n)},_setAriaElements:function(e,t){var n=this._getAriaOffscreenNode(),r=this.get("id")+"_description",s=this._getAriaOffscreenNode();t.set("tabIndex",0),t.set("role","img"),t.setAttribute("aria-label",this.get("ariaLabel")),t.setAttribute("aria-describedby",r),n.set("id",r),n.set("tabIndex",-1),n.appendChild(i.createTextNode(this.get("ariaDescription"))),s.set("id","live-region"),s.set("aria-live","polite"),s.set("aria-atomic","true"),s.set("role","status"),e.setAttribute("role","application"),e.appendChild(n),e.appendChild(s),this._description=n,this._liveRegion=s},_getAriaOffscreenNode:function(){var t=e.Node.create("<div></div>"),n=e.UA.ie,r=n&&n<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)";return t.setStyle("position","absolute"),t.setStyle("height","1px"),t.setStyle("width","1px"),t.setStyle("overflow","hidden"),t.setStyle("clip",r),t},syncUI:function(){this._redraw()},bindUI:function(){this.after("tooltipChange",e.bind(this._tooltipChangeHandler,this)),this.after("widthChange",this._sizeChanged),this.after("heightChange",this._sizeChanged),this.after("groupMarkersChange",this._groupMarkersChangeHandler);var t=this.get("tooltip"),n="mouseout",o="mouseover",u=this.get("contentBox"),a=this.get("interactionType"),f=0,l,c="."+p,h=r&&"ontouchstart"in r&&!(e.UA.chrome&&e.UA.chrome<6);e.on("keydown",e.bind(function(e){var t=e.keyCode,n=parseFloat(t),r;n>36&&n<41&&(e.halt(),r=this._getAriaMessage(n),this._liveRegion.setContent(""),this._liveRegion.appendChild(i.createTextNode(r)))},this),this.get("contentBox")),a=="marker"?(n=t.hideEvent,o=t.showEvent,h?(e.delegate("touchend",e.bind(this._markerEventDispatcher,this),u,c),e.on("touchend",e.bind(function(e){e.halt(!0),this._activeMarker&&(this._activeMarker=null,this.hideTooltip(e))},this))):(e.delegate("mouseenter",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousedown",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseup",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mouseleave",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("click",e.bind(this._markerEventDispatcher,this),u,c),e.delegate("mousemove",e.bind(this._positionTooltip,this),u,c))):a=="planar"&&(h?this._overlay.on("touchend",e.bind(this._planarEventDispatcher,this)):(this._overlay.on("mousemove",e.bind(this._planarEventDispatcher,this)),this.on("mouseout",this.hideTooltip)));if(t){this.on("markerEvent:touchend",e.bind(function(e){var n=e.series.get("markers")[e.index];this._activeMarker&&n===this._activeMarker?(this._activeMarker=null,this.hideTooltip(e)):(this._activeMarker=n,t.markerEventHandler.apply(this,[e]))},this));if(n&&o&&n==o)this.on(a+"Event:"+n,this.toggleTooltip);else{o&&this.on(a+"Event:"+o,t[a+"EventHandler"]);if(n){if(s.isArray(n)){l=n.length;for(;f<l;++f)this.on(a+"Event:"+n[f],this.hideTooltip)}this.on(a+"Event:"+n,this.hideTooltip)}}}},_markerEventDispatcher:function(e){var t=e.type,n=this.get("contentBox"),r=e.currentTarget,i=r.getAttribute("id").split("_"),s=i.pop(),o=i.pop(),u=this.getSeries(parseInt(o,10)),a=this.getSeriesItems(u,s),f=e&&e.hasOwnProperty("changedTouches"),l=f?e.changedTouches[0].pageX:e.pageX,c=f?e.changedTouches[0].pageY:e.pageY,h=l-n.getX(),p=c-n.getY();t=="mouseenter"?t="mouseover":t=="mouseleave"&&(t="mouseout"),u.updateMarkerState(t,s),e.halt(),this.fire("markerEvent:"+t,{originEvent:e,pageX:l,pageY:c,categoryItem:a.category,valueItem:a.value,node:r,x:h,y:p,series:u,index:s,seriesIndex:o})},_dataProviderChangeHandler:function(t){var n=t.newVal,r,i,s;this._seriesIndex=-1,this._itemIndex=-1,this instanceof e.CartesianChart&&(this.set("axes",this.get("axes")),this.set("seriesCollection",this.get("seriesCollection"))),r=this.get("axes");if(r)for(i in r)r.hasOwnProperty(i)&&(s=r[i],s instanceof e.Axis&&(s.get("position")!="none"&&this._addToAxesRenderQueue(s),s.set("dataProvider",n)))},toggleTooltip:function(e){var t=this.get("tooltip");t.visible?this.hideTooltip():t.markerEventHandler.apply(this,[e])},_showTooltip:function(e,t,n){var r=this.get("tooltip"),i=r.node;e&&(r.visible=!0,r.setTextFunction(i,e),i.setStyle("top",n+"px"),i.setStyle("left",t+"px"),i.setStyle("visibility","visible"))},_positionTooltip:function(e){var t=this.get("tooltip"),n=t.node,r=this.get("contentBox"),i=e.pageX+10-r.getX(),s=e.pageY+10-r.getY();n&&(n.setStyle("left",i+"px"),n.setStyle("top",s+"px"))},hideTooltip:function(){var e=this.get("tooltip"),t=e.node;e.visible=!1,t.set("innerHTML",""),t.setStyle("left",-1e4),t.setStyle("top",-1e4),t.setStyle("visibility","hidden")},_addTooltip:function(){var e=this.get("tooltip"),t=this.get("id")+"_tooltip",n=this.get("contentBox"),r=i.getElementById(t);r&&n.removeChild(r),e.node.set("id",t),e.node.setStyle("visibility","hidden"),n.appendChild(e.node)},_updateTooltip:function(t){var n=this.get("tooltip")||this._getTooltip(),r,i,o,u={markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",setTextFunction:"setTextFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler",show:"show"};if(s.isObject(t)){i=t.styles,o=e.one(t.node)||n.node;if(i)for(r in i)i.hasOwnProperty(r)&&o.setStyle(r,i[r]);for(r in u)t.hasOwnProperty(r)&&(n[r]=t[r]);n.node=o}return n},_getTooltip:function(){var t=i.createElement("div"),n=h("chart-tooltip"),r={setTextFunction:this._setText,markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:!0,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(e){var t=this.get("tooltip"),n=t.markerLabelFunction.apply(this,[e.categoryItem,e.valueItem,e.index,e.series,e.seriesIndex]);this._showTooltip(n,e.x+10,e.y+10)},planarEventHandler:function(e){var t=this.get("tooltip"),n,r=this.get("categoryAxis");n=t.planarLabelFunction.apply(this,[r,e.valueItem,e.index,e.items,e.seriesIndex]),this._showTooltip(n,e.x+10,e.y+10)}};return t=e.one(t),t.set("id",this.get("id")+"_tooltip"),t.setStyle("fontSize","85%"),t.setStyle("opacity","0.83"),t.setStyle("position","absolute"),t.setStyle("paddingTop","2px"),t.setStyle("paddingRight","5px"),t.setStyle("paddingBottom","4px"),t.setStyle("paddingLeft","2px"),t.setStyle("backgroundColor","#fff"),t.setStyle("border","1px solid #dbdccc"),t.setStyle("pointerEvents","none"),t.setStyle("zIndex",3),t.setStyle("whiteSpace","noWrap"),t.setStyle("visibility","hidden"),t.addClass(n),r.node=e.one(t),r},_planarLabelFunction:function(e,t,n,r,o){var u=i.createElement("div"),a,f=0,l=r.length,c,h,p,d;e&&(h=e.get("labelFunction").apply(this,[e.getKeyValueAt(this.get("categoryKey"),n),e.get("labelFormat")]),s.isObject(h)||(h=i.createTextNode(h)),u.appendChild(h));for(;f<l;++f)d=r[f],d.get("visible")&&(a=t[f],c=a.axis,p=c.get("labelFunction").apply(this,[c.getKeyValueAt(a.key,n),c.get("labelFormat")]),u.appendChild(i.createElement("br")),u.appendChild(i.createTextNode(a.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(p)||(p=i.createTextNode(p)),u.appendChild(p));return u},_tooltipLabelFunction:function(e,t,n,r,o){var u=i.createElement("div"),a=e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]),f=t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]);return u.appendChild(i.createTextNode(e.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(a)||(a=i.createTextNode(a)),u.appendChild(a),u.appendChild(i.createElement("br")),u.appendChild(i.createTextNode(t.displayName)),u.appendChild(i.createTextNode(": ")),s.isObject(f)||(f=i.createTextNode(f)),u.appendChild(f),u},_tooltipChangeHandler:function(e){if(this.get("tooltip")){var t=this.get("tooltip"),n=t.node,r=t.show,i=this.get("contentBox");n&&r&&(i.contains(n)||this._addTooltip())}},_setText:function(e,t){e.setContent(""),s.isNumber(t)?t+="":t||(t=""),o(t)&&(t=i.createTextNode(t)),e.appendChild(t)},_getAllKeys:function(e){var t=0,n=e.length,r,i,s={};for(;t<n;++t){r=e[t];for(i in r)r.hasOwnProperty(i)&&(s[i]=!0)}return s},_buildSeriesKeys:function(e){var t,n=this.get("categoryKey"),r=[],i;if(this._seriesKeysExplicitlySet)return this._seriesKeys;t=this._getAllKeys(e);for(i in t)t.hasOwnProperty(i)&&i!=n&&r.push(i);return r}},e.ChartBase=O,e.CartesianChart=e.Base.create("cartesianChart",e.Widget,[e.ChartBase],{renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("tooltip"),s,o=h("overlay");t.setStyle("position","absolute"),n.setStyle("position","absolute"),this._addAxes(),this._addGridlines(),this._addSeries(),r&&r.show&&this._addTooltip(),this.get("styles"),this.get("interactionType")=="planar"&&(s=i.createElement("div"),this.get("contentBox").appendChild(s),this._overlay=e.one(s),this._overlay.set("id",this.get("id")+"_overlay"),this._overlay.setStyle("position","absolute"),this._overlay.setStyle("background","#fff"),this._overlay.setStyle("opacity",0),this._overlay.addClass(o),this._overlay.setStyle("zIndex",4)),this._setAriaElements(t,n),this._redraw()},_planarEventDispatcher:function(e){var t=this.get("graph"),n=this.get("boundingBox"),r=t.get("contentBox"),i=e&&e.hasOwnProperty("changedTouches"),s=i?e.changedTouches[0].pageX:e.pageX,o=i?e.changedTouches[0].pageY:e.pageY,u=s-n.getX(),a=o-n.getY(),f={x:s-r.getX(),y:o-r.getY()},l=t.get("seriesCollection"),c,h=0,p,d=this._selectedIndex,v,m=[],g=[],y=[],b=this.get("direction"),w,E,S,x,T,N,C;e.halt(!0),b=="horizontal"?(E="x",S="y"):(S="x",E="y"),x=f[E];if(l){N=l.length;while(h<N&&!T)l[h]&&(T=l[h].get(E+"MarkerPlane")),h++}if(T){N=T.length;for(h=0;h<N;++h)if(x<=T[h].end&&x>=T[h].start){p=h;break}N=l.length;for(h=0;h<N;++h)c=l[h],C=c.get(S+"coords"),w=c.get("markers"),w&&!isNaN(d)&&d>-1&&c.updateMarkerState("mouseout",d),C&&C[p]>-1&&(w&&!isNaN(p)&&p>-1&&c.updateMarkerState("mouseover",p),v=this.getSeriesItems(c,p),g.push(v.category),y.push(v.value),m.push(c));this._selectedIndex=p,p>-1?this.fire("planarEvent:mouseover",{categoryItem:g,valueItem:y,x:u,y:a,pageX:s,pageY:o,items:m,index:p,originEvent:e}):this.fire("planarEvent:mouseout")}},_type:"combo",_itemRenderQueue:null,_addToAxesRenderQueue:function(t){this._itemRenderQueue||(this._itemRenderQueue=[]),e.Array.indexOf(this._itemRenderQueue,t)<0&&this._itemRenderQueue.push(t)},_addToAxesCollection:function(e,t){var n=this.get(e+"AxesCollection");n||(n=[],this.set(e+"AxesCollection",n)),n.push(t)},_getDefaultSeriesCollection:function(){var e,t=this.get("dataProvider");return t&&(e=this._parseSeriesCollection()),e},_parseSeriesCollection:function(t){var n=this.get("direction"),r=[],i,s,o=[],u,a=this.get("seriesKeys").concat(),f,l,c,h=this.get("type"),p,d,v,m,g=[],y=this.get("categoryKey"),b=this.get("showMarkers"),w=this.get("showAreaFill"),E=this.get("showLines");t=t||[],n=="vertical"?(i="yAxis",d="yKey",s="xAxis",v="xKey"):(i="xAxis",d="xKey",s="yAxis",v="yKey"),c=t.length;while(t&&t.length>0)u=t.shift(),p=this._getBaseAttribute(u,v),p?(l=e.Array.indexOf(a,p),l>-1?(a.splice(l,1),o.push(p),r.push(u)):g.push(u)):g.push(u);while(g.length>0)u=g.shift(),a.length>0?(p=a.shift(),this._setBaseAttribute(u,v,p),o.push(p),r.push(u)):u instanceof e.CartesianSeries&&u.destroy(!0);a.length>0&&(o=o.concat(a)),c=o.length;for(f=0;f<c;++f){u=r[f]||{type:h};if(u instanceof e.CartesianSeries){this._parseSeriesAxes(u);continue}u[d]=u[d]||y,u[v]=u[v]||a.shift(),u[i]=this._getCategoryAxis(),u[s]=this._getSeriesAxis(u[v]),u.type=u.type||h,u.direction=u.direction||n;if(u.type=="combo"||u.type=="stackedcombo"||u.type=="combospline"||u.type=="stackedcombospline")w!==null&&(u.showAreaFill=u.showAreaFill!==null&&u.showAreaFill!==undefined?u.showAreaFill:w),b!==null&&(u.showMarkers=u.showMarkers!==null&&u.showMarkers!==undefined?u.showMarkers:b),E!==null&&(u.showLines=u.showLines!==null&&u.showLines!==undefined?u.showLines:E);r[f]=u}return r&&(m=this.get("graph"),m.set("seriesCollection",r),r=m.get("seriesCollection")),r},_parseSeriesAxes:function(t){var n=this.get("axes"),r=t.get("xAxis"),i=t.get("yAxis"),o=e.Axis,u;r&&!(r instanceof o)&&s.isString(r)&&n.hasOwnProperty(r)&&(u=n[r],u instanceof o&&t.set("xAxis",u)),i&&!(i instanceof o)&&s.isString(i)&&n.hasOwnProperty(i)&&(u=n[i],u instanceof o&&t.set("yAxis",u))},_getCategoryAxis:function(){var e,t=this.get("axes"),n=this.get("categoryAxisName")||this.get("categoryKey");return e=t[n],e},_getSeriesAxis:function(e,t){var n=this.get("axes"),r,i,s;if(n)if(t&&n.hasOwnProperty(t))s=n[t];else for(r in n)if(n.hasOwnProperty(r)){i=n[r].get("keys");if(i&&i.hasOwnProperty(e)){s=n[r];break}}return s},_getBaseAttribute:function(t,n){return t instanceof e.Base?t.get(n):t.hasOwnProperty(n)?t[n]:null},_setBaseAttribute:function(t,n,r){t instanceof e.Base?t.set(n,r):t[n]=r},_setAxes:function(t){var n=this._parseAxes(t),r={},i={edgeOffset:"edgeOffset",position:"position",overlapGraph:"overlapGraph",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",appendLabelFunction:"appendLabelFunction",appendTitleFunction:"appendTitleFunction",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero",title:"title",width:"width",height:"height"},s=this.get("dataProvider"),o,u,a,f,l,c,h,p,d;for(u in n)if(n.hasOwnProperty(u)){c=n[u];if(c instanceof e.Axis)f=c;else{f=null,p={},p.dataProvider=c.dataProvider||s,p.keys=c.keys,c.hasOwnProperty("roundingUnit")&&(p.roundingUnit=c.roundingUnit),a=c.position,c.styles&&(p.styles=c.styles),p.position=c.position;for(o in i)i.hasOwnProperty(o)&&c.hasOwnProperty(o)&&(p[o]=c[o]);t&&(f=this.getAxisByKey(u)),f&&f instanceof e.Axis?(l=f.get("position"),a!=l&&(l!="none"&&(d=this.get(l+"AxesCollection"),d.splice(e.Array.indexOf(d,f),1)),a!="none"&&this._addToAxesCollection(a,f)),f.setAttrs(p)):(h=this._getAxisClass(c.type),f=new h(p),f.after("axisRendered",e.bind(this._itemRendered,this)))}f&&(d=this.get(a+"AxesCollection"),d&&e.Array.indexOf(d,f)>0&&f.set("overlapGraph",!1),r[u]=f)}return r},_addAxes:function(){var t=this.get("axes"),n,r,i,s=this.get("width"),o=this.get("height"),u=e.Node.one(this._parentNode);this._axesCollection||(this._axesCollection=[]);for(n in t)t.hasOwnProperty(n)&&(r=t[n],r instanceof e.Axis&&(s||(this.set("width",u.get("offsetWidth")),s=this.get("width")),o||(this.set("height",u.get("offsetHeight")),o=this.get("height")),this._addToAxesRenderQueue(r),i=r.get("position"),this.get(i+"AxesCollection")?this.get(i+"AxesCollection").push(r):this.set(i+"AxesCollection",[r]),this._axesCollection.push(r),r.get("keys").hasOwnProperty(this.get("categoryKey"))&&this.set("categoryAxis",r),r.render(this.get("contentBox"))))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");e.render(this.get("contentBox"))},_addGridlines:function(){var t=this.get("graph"),n=this.get("horizontalGridlines"),r=this.get("verticalGridlines"),i=this.get("direction"),s=this.get("leftAxesCollection"),o=this.get("rightAxesCollection"),u=this.get("bottomAxesCollection"),a=this.get("topAxesCollection"),f,l=this.get("categoryAxis"),c,h;this._axesCollection&&(f=this._axesCollection.concat(),f.splice(e.Array.indexOf(f,l),1)),n&&(s&&s[0]?c=s[0]:o&&o[0]?c=o[0]:c=i=="horizontal"?l:f[0],!this._getBaseAttribute(n,"axis")&&c&&this._setBaseAttribute(n,"axis",c),this._getBaseAttribute(n,"axis")&&t.set("horizontalGridlines",n)),r&&(u&&u[0]?h=u[0]:a&&a[0]?h=a[0]:h=i=="vertical"?l:f[0],!this._getBaseAttribute(r,"axis")&&h&&this._setBaseAttribute(r,"axis",h),this._getBaseAttribute(r,"axis")&&t.set("verticalGridlines",r))},_getDefaultAxes:function(){var e;return this.get("dataProvider")&&(e=this._parseAxes()),e},_parseAxes:function(t){var n=this.get("categoryKey"),r,i,o,u={},a=[],f=this.get("categoryAxisName")||this.get("categoryKey"),l=this.get("valueAxisName"),c=this.get("seriesKeys").concat(),h,p,d,v,m,g=this.get("direction"),y,b,w=[],E=this.get("stacked")?"stacked":"numeric";g=="vertical"?(y="bottom",b="left"):(y="left",b="bottom");if(t)for(h in t)if(t.hasOwnProperty(h)){r=t[h],o=this._getBaseAttribute(r,"keys"),i=this._getBaseAttribute(r,"type");if(i=="time"||i=="category")f=h,this.set("categoryAxisName",h),s.isArray(o)&&o.length>0&&(n=o[0],this.set("categoryKey",n)),u[h]=r;else if(h==f)u[h]=r;else{u[h]=r;if(h!=l&&o&&s.isArray(o)){v=o.length;for(d=0;d<v;++d)a.push(o[d]);w.push(u[h])}this._getBaseAttribute(u[h],"type")||this._setBaseAttribute(u[h],"type",E),this._getBaseAttribute(u[h],"position")||this._setBaseAttribute(u[h],"position",this._getDefaultAxisPosition(u[h],w,y))}}m=e.Array.indexOf(c,n),m>-1&&c.splice(m,1),p=a.length;for(h=0;h<p;++h)m=e.Array.indexOf(c,a[h]),m>-1&&c.splice(m,1);return u.hasOwnProperty(f)||(u[f]={}),this._getBaseAttribute(u[f],"keys")||this._setBaseAttribute(u[f],"keys",[n]),this._getBaseAttribute(u[f],"position")||this._setBaseAttribute(u[f],"position",b),this._getBaseAttribute(u[f],"type")||this._setBaseAttribute(u[f],"type",this.get("categoryType")),!u.hasOwnProperty(l)&&c&&c.length>0&&(u[l]={keys:c},w.push(u[l])),a.length>0&&(c.length>0?c=a.concat(c):c=a),u.hasOwnProperty(l)&&(this._getBaseAttribute(u[l],"position")||this._setBaseAttribute(u[l],"position",this._getDefaultAxisPosition(u[l],w,y)),this._setBaseAttribute(u[l],"type",E),this._setBaseAttribute(u[l],"keys",c)),this._seriesKeysExplicitlySet||(this._seriesKeys=c),u},_getDefaultAxisPosition:function(t,n,r){var i=this.get("direction"),s=e.Array.indexOf(n,t);return n[s-1]&&n[s-1].position&&(i=="horizontal"?n[s-1].position=="left"?r="right":n[s-1].position=="right"&&(r="left"):n[s-1].position=="bottom"?r="top":r="bottom"),r},getSeriesItems:function(e,t){var n=e.get("xAxis"),r=e.get("yAxis"),i=e.get("xKey"),s=e.get("yKey"),o,u;return this.get("direction")=="vertical"?(o={axis:r,key:s,value:r.getKeyValueAt(s,t)},u={axis:n,key:i,value:n.getKeyValueAt(i,t)}):(u={axis:r,key:s,value:r.getKeyValueAt(s,t)},o={axis:n,key:i,value:n.getKeyValueAt(i,t)}),o.displayName=e.get("categoryDisplayName"),u.displayName=e.get("valueDisplayName"),o.value=o.axis.getKeyValueAt(o.key,t),u.value=u.axis.getKeyValueAt(u.key,t),{category:o,value:u}},_sizeChanged:function(e){if(this._axesCollection){var t=this._axesCollection,n=0,r=t.length;for(;n<r;++n)this._addToAxesRenderQueue(t[n]);this._redraw()}},_getTopOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,Math.abs(o.getMaxLabelBounds().top)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,Math.abs(o.getMaxLabelBounds().top)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getRightOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,o.getMaxLabelBounds().right-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,o.getMaxLabelBounds().right-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getLeftOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,Math.abs(o.getMinLabelBounds().left)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,Math.abs(o.getMinLabelBounds().left)-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_getBottomOverflow:function(e,t,n){var r=0,i,s=0,o;if(e){i=e.length;for(;r<i;++r)o=e[r],s=Math.max(s,o.getMinLabelBounds().bottom-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}if(t){r=0,i=t.length;for(;r<i;++r)o=t[r],s=Math.max(s,o.getMinLabelBounds().bottom-o.getEdgeOffset(o.get("styles").majorTicks.count,n)*.5)}return s},_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=0,r=0,i=0,s=0,o=this.get("leftAxesCollection"),u=this.get("rightAxesCollection"),a=this.get("topAxesCollection"),f=this.get("bottomAxesCollection"),l=0,c,h,p="visible",d=this.get("graph"),v,m,g,y,b,w,E,S,x=this.get("allowContentOverflow"),T,N,C,k,L,A={};if(o){C=[],c=o.length;for(l=c-1;l>-1;--l)C.unshift(n),n+=o[l].get("width")}if(u){N=[],c=u.length,l=0;for(l=c-1;l>-1;--l)r+=u[l].get("width"),N.unshift(e-r)}if(a){k=[],c=a.length;for(l=c-1;l>-1;--l)k.unshift(i),i+=a[l].get("height")}if(f){L=[],c=f.length;for(l=c-1;l>-1;--l)s+=f[l].get("height"),L.unshift(t-s)}b=e-(n+r),w=t-(s+i),A.left=n,A.top=i,A.bottom=t-s,A.right=e-r;if(!x){v=this._getTopOverflow(o,u),m=this._getBottomOverflow(o,u),g=this._getLeftOverflow(f,a),y=this._getRightOverflow(f,a),T=v-i;if(T>0){A.top=v;if(k){l=0,c=k.length;for(;l<c;++l)k[l]+=T}}T=m-s;if(T>0){A.bottom=t-m;if(L){l=0,c=L.length;for(;l<c;++l)L[l]-=T}}T=g-n;if(T>0){A.left=g;if(C){l=0,c=C.length;for(;l<c;++l)C[l]+=T}}T=y-r;if(T>0){A.right=e-y;if(N){l=0,c=N.length;for(;l<c;++l)N[l]-=T}}}b=A.right-A.left,w=A.bottom-A.top,E=A.left,S=A.top;if(a){c=a.length,l=0;for(;l<c;l++)h=a[l],h.get("width")!==b&&h.set("width",b),h.get("boundingBox").setStyle("left",E+"px"),h.get("boundingBox").setStyle("top",k[l]+"px");h._hasDataOverflow()&&(p="hidden")}if(f){c=f.length,l=0;for(;l<c;l++)h=f[l],h.get("width")!==b&&h.set("width",b),h.get("boundingBox").setStyle("left",E+"px"),h.get("boundingBox").setStyle("top",L[l]+"px");h._hasDataOverflow()&&(p="hidden")}if(o){c=o.length,l=0;for(;l<c;++l)h=o[l],h.get("boundingBox").setStyle("top",S+"px"),h.get("boundingBox").setStyle("left",C[l]+"px"),h.get("height")!==w&&h.set("height",w);h._hasDataOverflow()&&(p="hidden")}if(u){c=u.length,l=0;for(;l<c;++l)h=u[l],h.get("boundingBox").setStyle("top",S+"px"),h.get("boundingBox").setStyle("left",N[l]+"px"),h.get("height")!==w&&h.set("height",w);h._hasDataOverflow()&&(p="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}d&&(d.get("boundingBox").setStyle("left",E+"px"),d.get("boundingBox").setStyle("top",S+"px"),d.set("width",b),d.set("height",w),d.get("boundingBox").setStyle("overflow",p)),this._overlay&&(this._overlay.setStyle("left",E+"px"),this._overlay.setStyle("top",S+"px"),this._overlay.setStyle("width",b+"px"),this._overlay.setStyle("height",w+"px"))},destructor:function(){var t=this.get("graph"),n=0,r,i=this.get("seriesCollection"),s=this._axesCollection,o=this.get("tooltip").node;this._description&&(this._description.empty(),this._description.remove(!0)),this._liveRegion&&(this._liveRegion.empty(),this._liveRegion.remove(!0)),r=i?i.length:0;for(;n<r;++n)i[n]instanceof e.CartesianSeries&&i[n].destroy(!0);r=s?s.length:0;for(n=0;n<r;++n)s[n]instanceof e.Axis&&s[n].destroy(!0);t&&t.destroy(!0),o&&(o.empty(),o.remove(!0)),this._overlay&&(this._overlay.empty(),this._overlay.remove(!0))},_getAriaMessage:function(e){var t="",n,r,i,s,o=this._seriesIndex,u=this._itemIndex,a=this.get("seriesCollection"),f=a.length,l;return e%2===0?(f>1?(e===38?o=o<1?f-1:o-1:e===40&&(o=o>=f-1?0:o+1),this._itemIndex=-1):o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."):(o>-1?(t="",n=this.getSeries(parseInt(o,10))):(o=0,this._seriesIndex=o,n=this.getSeries(parseInt(o,10)),t=n.get("valueDisplayName")+" series."),l=n._dataLength?n._dataLength:0,e===37?u=u>0?u-1:l-1:e===39&&(u=u>=l-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(n,u),i=r.category,s=r.value,i&&s&&i.value&&s.value?(t+=i.displayName+": "+i.axis.formatLabel.apply(this,[i.value,i.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", "):t+="No data available.",t+=u+1+" of "+l+". "),t}},{ATTRS:{allowContentOverflow:{value:!1},axesStyles:{getter:function(){var t=this.get("axes"),n,r=this._axesStyles;if(t)for(n in t)t.hasOwnProperty(n)&&t[n]instanceof e.Axis&&(r||(r={}),r[n]=t[n].get("styles"));return r},setter:function(e){var t=this.get("axes"),n;for(n in e)e.hasOwnProperty(n)&&t.hasOwnProperty(n)&&this._setBaseAttribute(t[n],"styles",e[n])}},seriesStyles:{getter:function(){var e=this._seriesStyles,t=this.get("graph"),n,r;if(t){n=t.get("seriesDictionary");if(n){e={};for(r in n)n.hasOwnProperty(r)&&(e[r]=n[r].get("styles"))}}return e},setter:function(e){var t,n,r;if(s.isArray(e)){r=this.get("seriesCollection"),t=0,n=e.length;for(;t<n;++t)this._setBaseAttribute(r[t],"styles",e[t])}else for(t in e)e.hasOwnProperty(t)&&(r=this.getSeries(t),this._setBaseAttribute(r,"styles",e[t]))}},graphStyles:{getter:function(){var e=this.get("graph");return e?e.get("styles"):this._graphStyles},setter:function(e){var t=this.get("graph");this._setBaseAttribute(t,"styles",e)}},styles:{getter:function(){var e={axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")};return e},setter:function(e){e.hasOwnProperty("axes")&&(this.get("axesStyles")?this.set("axesStyles",e.axes):this._axesStyles=e.axes),e.hasOwnProperty("series")&&(this.get("seriesStyles")?this.set("seriesStyles",e.series):this._seriesStyles=e.series),e.hasOwnProperty("graph")&&this.set("graphStyles",e.graph)}},axes:{valueFn:"_getDefaultAxes",setter:function(e){return this.get("dataProvider")&&(e=this._setAxes(e)),e}},seriesCollection:{valueFn:"_getDefaultSeriesCollection",setter:function(e){return this.get("dataProvider")&&(e=this._parseSeriesCollection(e)),e}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:!1},direction:{getter:function(){var e=this.get("type");return e=="bar"?"vertical":e=="column"?"horizontal":this._direction},setter:function(e){return this._direction=e,this._direction}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("horizontalGridlines"):this._horizontalGridlines},setter:function(e){var t=this.get("graph");e&&!s.isObject(e)&&(e={}),t?t.set("horizontalGridlines",e):this._horizontalGridlines=e}},verticalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("verticalGridlines"):this._verticalGridlines},setter:function(e){var t=this.get("graph");e&&!s.isObject(e)&&(e={}),t?t.set("verticalGridlines",e):this._verticalGridlines=e}},type:{getter:function(){return this.get("stacked")?"stacked"+this._type:this._type},setter:function(e){return this._type=="bar"?e!="bar"&&this.set("direction","horizontal"):e=="bar"&&this.set("direction","vertical"),this._type=e,this._type}},categoryAxis:{}}}),e.PieChart=e.Base.create("pieChart",e.Widget,[e.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection)return this._seriesCollection;var e=this.get("axes"),t=[],n,r=0,i,s=this.get("type"),o,u="categoryAxis",a="categoryKey",f="valueAxis",l="valueKey";if(e){n=e.values.get("keyCollection"),o=e.category.get("keyCollection")[0],i=n.length;for(;r<i;++r)t[r]={type:s},t[r][u]="category",t[r][f]="values",t[r][a]=o,t[r][l]=n[r]}return this._seriesCollection=t,t},_parseAxes:function(t){this._axes||(this._axes={});var n,r,i,s,o,u,a=this.get("type"),f=this.get("width"),l=this.get("height"),c=e.Node.one(this._parentNode);f||(this.set("width",c.get("offsetWidth")),f=this.get("width")),l||(this.set("height",c.get("offsetHeight")),l=this.get("height"));for(n in t)t.hasOwnProperty(n)&&(s=t[n],r=a=="pie"?"none":s.position,u=this._getAxisClass(s.type),o={dataProvider:this.get("dataProvider")},s.hasOwnProperty("roundingUnit")&&(o.roundingUnit=s.roundingUnit),o.keys=s.keys,o.width=f,o.height=l,o.position=r,o.styles=s.styles,i=new u(o),i.on("axisRendered",e.bind(this._itemRendered,this)),this._axes[n]=i)},_addAxes:function(){var e=this.get("axes"),t,n,r;e||(this.set("axes",this._getDefaultAxes()),e=this.get("axes")),this._axesCollection||(this._axesCollection=[]);for(t in e)e.hasOwnProperty(t)&&(n=e[t],r=n.get("position"),this.get(r+"AxesCollection")?this.get(r+"AxesCollection").push(n):this.set(r+"AxesCollection",[n]),this._axesCollection.push(n))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");this._parseSeriesAxes(t),e.set("showBackground",!1),e.set("width",this.get("width")),e.set("height",this.get("height")),e.set("seriesCollection",t),this._seriesCollection=e.get("seriesCollection"),e.render(this.get("contentBox"))},_parseSeriesAxes:function(t){var n=0,r=t.length,i,s=this.get("axes"),o;for(;n<r;++n){i=t[n];if(i){if(i instanceof e.PieSeries){o=i.get("categoryAxis"),o&&!(o instanceof e.Axis)&&i.set("categoryAxis",s[o]),o=i.get("valueAxis"),o&&!(o instanceof e.Axis)&&i.set("valueAxis",s[o]);continue}i.categoryAxis=s.category,i.valueAxis=s.values,i.type||(i.type=this.get("type"))}}},_getDefaultAxes:function(){var e=this.get("categoryKey"),t=this.get("seriesKeys").concat(),n="numeric";return{values:{keys:t,type:n},category:{keys:[e],type:this.get("categoryType")}}},getSeriesItems:function(e,t){var n={axis:e.get("categoryAxis"),key:e.get("categoryKey"),displayName:e.get("categoryDisplayName")},r={axis:e.get("valueAxis"),key:e.get("valueKey"),displayName:e.get("valueDisplayName")};return n.value=n.axis.getKeyValueAt(n.key,t),r.value=r.axis.getKeyValueAt(r.key,t),{category:n,value:r}},_sizeChanged:function(e){this._redraw()},_redraw:function(){var e=this.get("graph"),t=this.get("width"),n=this.get("height"),r;e&&(r=Math.min(t,n),e.set("width",r),e.set("height",r))},_tooltipLabelFunction:function(e,t,n,r,s){var o=i.createElement("div"),u=r.getTotalValues(),a=Math.round(t.value/u*1e4)/100;return o.appendChild(i.createTextNode(e.displayName+": "+e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]))),o.appendChild(i.createElement("br")),o.appendChild(i.createTextNode(t.displayName+": "+t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]))),o.appendChild(i.createElement("br")),o.appendChild(i.createTextNode(a+"%")),o},_getAriaMessage:function(e){var t="",n,r,i,s,o=0,u=this._itemIndex,a=this.get("seriesCollection"),f,l,c,h;return i=this.getSeries(parseInt(o,10)),h=i.get("markers"),f=h&&h.length?h.length:0,e===37?u=u>0?u-1:f-1:e===39&&(u=u>=f-1?0:u+1),this._itemIndex=u,r=this.getSeriesItems(i,u),n=r.category,s=r.value,l=i.getTotalValues(),c=Math.round(s.value/l*1e4)/100,n&&s?(t+=n.displayName+": "+n.axis.formatLabel.apply(this,[n.value,n.axis.get("labelFormat")])+", ",t+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", ",t+="Percent of total "+s.displayName+": "+c+"%,"):t+="No data available,",t+=u+1+" of "+f+". ",t}},{ATTRS:{ariaDescription:{value:"Use the left and right keys to navigate through items.",setter:function(e){return this._description&&(this._description.setContent(""),this._description.appendChild(i.createTextNode(e))),e}},axes:{getter:function(){return this._axes},setter:function(e){this._parseAxes(e)}},seriesCollection:{getter:function(){return this._getSeriesCollection()},setter:function(e){return this._setSeriesCollection(e)}},type:{value:"pie"}}})},"3.7.3",{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]});
bundle/charts-base/charts-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -16202,4 +16202,4 @@ }); -}, '3.7.2', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});+}, '3.7.3', {"requires": ["dom", "datatype-number", "datatype-date", "event-custom", "event-mouseenter", "event-touch", "widget", "widget-position", "widget-stack", "graphics"]});
bundle/charts-legend/charts-legend-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/charts-legend/charts-legend.js", code: [] };-_yuitest_coverage["build/charts-legend/charts-legend.js"].code=["YUI.add('charts-legend', function (Y, NAME) {","","/**"," * Adds legend functionality to charts."," *"," * @module charts"," * @submodule charts-legend"," */","var DOCUMENT = Y.config.doc, ","TOP = \"top\",","RIGHT = \"right\",","BOTTOM = \"bottom\",","LEFT = \"left\",","EXTERNAL = \"external\",","HORIZONTAL = \"horizontal\",","VERTICAL = \"vertical\",","WIDTH = \"width\",","HEIGHT = \"height\",","POSITION = \"position\",","_X = \"x\",","_Y = \"y\",","PX = \"px\",","LEGEND = {"," setter: function(val)"," { "," var legend = this.get(\"legend\");"," if(legend)"," {"," legend.destroy(true);"," }"," if(val instanceof Y.ChartLegend)"," {"," legend = val;"," legend.set(\"chart\", this);"," }"," else"," {"," val.chart = this;"," if(!val.hasOwnProperty(\"render\"))"," {"," val.render = this.get(\"contentBox\");"," val.includeInChartLayout = true;"," }"," legend = new Y.ChartLegend(val);"," }"," return legend;"," }","},","","/**"," * Contains methods for displaying items horizontally in a legend."," *"," * @module charts"," * @submodule charts-legend"," * @class HorizontalLegendLayout"," */","HorizontalLegendLayout = {"," /**"," * Displays items horizontally in a legend."," *"," * @method _positionLegendItems"," * @param {Array} items Array of items to display in the legend."," * @param {Number} maxWidth The width of the largest item in the legend."," * @param {Number} maxHeight The height of the largest item in the legend."," * @param {Number} totalWidth The total width of all items in a legend."," * @param {Number} totalHeight The total height of all items in a legend."," * @param {Number} padding The left, top, right and bottom padding properties for the legend."," * @param {Number} horizontalGap The horizontal distance between items in a legend."," * @param {Number} verticalGap The vertical distance between items in a legend."," * @param {String} hAlign The horizontal alignment of the legend."," * @param {String} vAlign The vertical alignment of the legend."," * @protected"," */"," _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)"," {"," var i = 0,"," rowIterator = 0,"," item,"," node,"," itemWidth,"," itemHeight,"," len,"," width = this.get(\"width\"),"," rows,"," rowsLen,"," row,"," totalWidthArray,"," legendWidth,"," topHeight = padding.top - verticalGap,"," limit = width - (padding.left + padding.right),"," left, "," top,"," right,"," bottom;"," HorizontalLegendLayout._setRowArrays(items, limit, horizontalGap);"," rows = HorizontalLegendLayout.rowArray;"," totalWidthArray = HorizontalLegendLayout.totalWidthArray;"," rowsLen = rows.length;"," for(; rowIterator < rowsLen; ++ rowIterator)"," {"," topHeight += verticalGap;"," row = rows[rowIterator];"," len = row.length;"," legendWidth = HorizontalLegendLayout.getStartPoint(width, totalWidthArray[rowIterator], hAlign, padding);"," for(i = 0; i < len; ++i)"," {"," item = row[i];"," node = item.node;"," itemWidth = item.width;"," itemHeight = item.height;"," item.x = legendWidth;"," item.y = 0;"," left = !isNaN(left) ? Math.min(left, legendWidth) : legendWidth;"," top = !isNaN(top) ? Math.min(top, topHeight) : topHeight;"," right = !isNaN(right) ? Math.max(legendWidth + itemWidth, right) : legendWidth + itemWidth;"," bottom = !isNaN(bottom) ? Math.max(topHeight + itemHeight, bottom) : topHeight + itemHeight;"," node.setStyle(\"left\", legendWidth + PX);"," node.setStyle(\"top\", topHeight + PX);"," legendWidth += itemWidth + horizontalGap;"," }"," topHeight += item.height;"," }"," this._contentRect = {"," left: left,"," top: top,"," right: right,"," bottom: bottom"," };"," if(this.get(\"includeInChartLayout\"))"," {"," this.set(\"height\", topHeight + padding.bottom);"," }"," },",""," /**"," * Creates row and total width arrays used for displaying multiple rows of"," * legend items based on the items, available width and horizontalGap for the legend."," *"," * @method _setRowArrays"," * @param {Array} items Array of legend items to display in a legend."," * @param {Number} limit Total available width for displaying items in a legend."," * @param {Number} horizontalGap Horizontal distance between items in a legend."," * @protected"," */"," _setRowArrays: function(items, limit, horizontalGap)"," {"," var item = items[0],"," rowArray = [[item]],"," i = 1,"," rowIterator = 0,"," len = items.length,"," totalWidth = item.width,"," itemWidth,"," totalWidthArray = [[totalWidth]];"," for(; i < len; ++i)"," {"," item = items[i];"," itemWidth = item.width;"," if((totalWidth + horizontalGap + itemWidth) <= limit)"," {"," totalWidth += horizontalGap + itemWidth;"," rowArray[rowIterator].push(item);"," }"," else"," {"," totalWidth = horizontalGap + itemWidth;"," if(rowArray[rowIterator])"," {"," rowIterator += 1;"," }"," rowArray[rowIterator] = [item];"," }"," totalWidthArray[rowIterator] = totalWidth;"," }"," HorizontalLegendLayout.rowArray = rowArray;"," HorizontalLegendLayout.totalWidthArray = totalWidthArray;"," },",""," /**"," * Returns the starting x-coordinate for a row of legend items."," *"," * @method getStartPoint"," * @param {Number} w Width of the legend."," * @param {Number} totalWidth Total width of all labels in the row."," * @param {String} align Horizontal alignment of items for the legend."," * @param {Object} padding Object contain left, top, right and bottom padding properties."," * @return Number"," * @protected"," */"," getStartPoint: function(w, totalWidth, align, padding)"," {"," var startPoint;"," switch(align)"," {"," case LEFT :"," startPoint = padding.left;"," break;"," case \"center\" :"," startPoint = (w - totalWidth) * 0.5;"," break;"," case RIGHT :"," startPoint = w - totalWidth - padding.right;"," break;"," }"," return startPoint;"," }","},","","/**"," * Contains methods for displaying items vertically in a legend."," *"," * @module charts"," * @submodule charts-legend"," * @class VerticalLegendLayout"," */","VerticalLegendLayout = {"," /**"," * Displays items vertically in a legend."," *"," * @method _positionLegendItems"," * @param {Array} items Array of items to display in the legend."," * @param {Number} maxWidth The width of the largest item in the legend."," * @param {Number} maxHeight The height of the largest item in the legend."," * @param {Number} totalWidth The total width of all items in a legend."," * @param {Number} totalHeight The total height of all items in a legend."," * @param {Number} padding The left, top, right and bottom padding properties for the legend."," * @param {Number} horizontalGap The horizontal distance between items in a legend."," * @param {Number} verticalGap The vertical distance between items in a legend."," * @param {String} hAlign The horizontal alignment of the legend."," * @param {String} vAlign The vertical alignment of the legend."," * @protected"," */"," _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)"," {"," var i = 0,"," columnIterator = 0,"," item,"," node,"," itemHeight,"," itemWidth,"," len,"," height = this.get(\"height\"),"," columns,"," columnsLen,"," column,"," totalHeightArray,"," legendHeight,"," leftWidth = padding.left - horizontalGap,"," legendWidth,"," limit = height - (padding.top + padding.bottom),"," left, "," top,"," right,"," bottom;"," VerticalLegendLayout._setColumnArrays(items, limit, verticalGap);"," columns = VerticalLegendLayout.columnArray;"," totalHeightArray = VerticalLegendLayout.totalHeightArray;"," columnsLen = columns.length;"," for(; columnIterator < columnsLen; ++ columnIterator)"," {"," leftWidth += horizontalGap;"," column = columns[columnIterator];"," len = column.length;"," legendHeight = VerticalLegendLayout.getStartPoint(height, totalHeightArray[columnIterator], vAlign, padding);"," legendWidth = 0;"," for(i = 0; i < len; ++i)"," {"," item = column[i];"," node = item.node;"," itemHeight = item.height;"," itemWidth = item.width;"," item.y = legendHeight;"," item.x = leftWidth;"," left = !isNaN(left) ? Math.min(left, leftWidth) : leftWidth;"," top = !isNaN(top) ? Math.min(top, legendHeight) : legendHeight;"," right = !isNaN(right) ? Math.max(leftWidth + itemWidth, right) : leftWidth + itemWidth;"," bottom = !isNaN(bottom) ? Math.max(legendHeight + itemHeight, bottom) : legendHeight + itemHeight;"," node.setStyle(\"left\", leftWidth + PX);"," node.setStyle(\"top\", legendHeight + PX);"," legendHeight += itemHeight + verticalGap;"," legendWidth = Math.max(legendWidth, item.width);"," }"," leftWidth += legendWidth;"," }"," this._contentRect = {"," left: left,"," top: top,"," right: right,"," bottom: bottom"," };"," if(this.get(\"includeInChartLayout\"))"," {"," this.set(\"width\", leftWidth + padding.right);"," }"," },",""," /**"," * Creates column and total height arrays used for displaying multiple columns of"," * legend items based on the items, available height and verticalGap for the legend."," *"," * @method _setColumnArrays"," * @param {Array} items Array of legend items to display in a legend."," * @param {Number} limit Total available height for displaying items in a legend."," * @param {Number} verticalGap Vertical distance between items in a legend."," * @protected"," */"," _setColumnArrays: function(items, limit, verticalGap)"," {"," var item = items[0],"," columnArray = [[item]],"," i = 1,"," columnIterator = 0,"," len = items.length,"," totalHeight = item.height,"," itemHeight,"," totalHeightArray = [[totalHeight]];"," for(; i < len; ++i)"," {"," item = items[i];"," itemHeight = item.height;"," if((totalHeight + verticalGap + itemHeight) <= limit)"," {"," totalHeight += verticalGap + itemHeight;"," columnArray[columnIterator].push(item);"," }"," else"," {"," totalHeight = verticalGap + itemHeight;"," if(columnArray[columnIterator])"," {"," columnIterator += 1;"," }"," columnArray[columnIterator] = [item];"," }"," totalHeightArray[columnIterator] = totalHeight;"," }"," VerticalLegendLayout.columnArray = columnArray;"," VerticalLegendLayout.totalHeightArray = totalHeightArray;"," },",""," /**"," * Returns the starting y-coordinate for a column of legend items."," *"," * @method getStartPoint"," * @param {Number} h Height of the legend."," * @param {Number} totalHeight Total height of all labels in the column."," * @param {String} align Vertical alignment of items for the legend."," * @param {Object} padding Object contain left, top, right and bottom padding properties."," * @return Number"," * @protected"," */"," getStartPoint: function(h, totalHeight, align, padding)"," {"," var startPoint;"," switch(align)"," {"," case TOP :"," startPoint = padding.top;"," break;"," case \"middle\" :"," startPoint = (h - totalHeight) * 0.5;"," break;"," case BOTTOM :"," startPoint = h - totalHeight - padding.bottom;"," break;"," }"," return startPoint;"," }","},","","CartesianChartLegend = Y.Base.create(\"cartesianChartLegend\", Y.CartesianChart, [], {"," /**"," * Redraws and position all the components of the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," layoutBoxDimensions = this._getLayoutBoxDimensions(),"," leftPaneWidth = layoutBoxDimensions.left,"," rightPaneWidth = layoutBoxDimensions.right,"," topPaneHeight = layoutBoxDimensions.top,"," bottomPaneHeight = layoutBoxDimensions.bottom,"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," i = 0,"," l,"," axis,"," graphOverflow = \"visible\","," graph = this.get(\"graph\"),"," topOverflow,"," bottomOverflow,"," leftOverflow,"," rightOverflow,"," graphWidth,"," graphHeight,"," graphX,"," graphY,"," allowContentOverflow = this.get(\"allowContentOverflow\"),"," diff,"," rightAxesXCoords,"," leftAxesXCoords,"," topAxesYCoords,"," bottomAxesYCoords,"," legend = this.get(\"legend\"),"," graphRect = {};",""," if(leftAxesCollection)"," {"," leftAxesXCoords = [];"," l = leftAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," leftAxesXCoords.unshift(leftPaneWidth);"," leftPaneWidth += leftAxesCollection[i].get(\"width\");"," }"," }"," if(rightAxesCollection)"," {"," rightAxesXCoords = [];"," l = rightAxesCollection.length;"," i = 0;"," for(i = l - 1; i > -1; --i)"," {"," rightPaneWidth += rightAxesCollection[i].get(\"width\");"," rightAxesXCoords.unshift(w - rightPaneWidth);"," }"," }"," if(topAxesCollection)"," {"," topAxesYCoords = [];"," l = topAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," topAxesYCoords.unshift(topPaneHeight);"," topPaneHeight += topAxesCollection[i].get(\"height\");"," }"," }"," if(bottomAxesCollection)"," {"," bottomAxesYCoords = [];"," l = bottomAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," bottomPaneHeight += bottomAxesCollection[i].get(\"height\");"," bottomAxesYCoords.unshift(h - bottomPaneHeight);"," }"," }"," "," graphWidth = w - (leftPaneWidth + rightPaneWidth);"," graphHeight = h - (bottomPaneHeight + topPaneHeight);"," graphRect.left = leftPaneWidth;"," graphRect.top = topPaneHeight;"," graphRect.bottom = h - bottomPaneHeight;"," graphRect.right = w - rightPaneWidth;"," if(!allowContentOverflow)"," {"," topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);"," bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);"," leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);"," rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);"," "," diff = topOverflow - topPaneHeight;"," if(diff > 0)"," {"," graphRect.top = topOverflow;"," if(topAxesYCoords)"," {"," i = 0;"," l = topAxesYCoords.length;"," for(; i < l; ++i)"," {"," topAxesYCoords[i] += diff;"," }"," }"," }",""," diff = bottomOverflow - bottomPaneHeight;"," if(diff > 0)"," {"," graphRect.bottom = h - bottomOverflow;"," if(bottomAxesYCoords)"," {"," i = 0;"," l = bottomAxesYCoords.length;"," for(; i < l; ++i)"," {"," bottomAxesYCoords[i] -= diff;"," }"," }"," }",""," diff = leftOverflow - leftPaneWidth;"," if(diff > 0)"," {"," graphRect.left = leftOverflow;"," if(leftAxesXCoords)"," {"," i = 0;"," l = leftAxesXCoords.length;"," for(; i < l; ++i)"," {"," leftAxesXCoords[i] += diff;"," }"," }"," }",""," diff = rightOverflow - rightPaneWidth;"," if(diff > 0)"," {"," graphRect.right = w - rightOverflow;"," if(rightAxesXCoords)"," {"," i = 0;"," l = rightAxesXCoords.length;"," for(; i < l; ++i)"," {"," rightAxesXCoords[i] -= diff;"," }"," }"," }"," }"," graphWidth = graphRect.right - graphRect.left;"," graphHeight = graphRect.bottom - graphRect.top;"," graphX = graphRect.left;"," graphY = graphRect.top;"," if(legend)"," {"," if(legend.get(\"includeInChartLayout\"))"," {"," switch(legend.get(\"position\"))"," {"," case \"left\" : "," legend.set(\"y\", graphY);"," legend.set(\"height\", graphHeight);"," break;"," case \"top\" :"," legend.set(\"x\", graphX);"," legend.set(\"width\", graphWidth);"," break;"," case \"bottom\" : "," legend.set(\"x\", graphX);"," legend.set(\"width\", graphWidth);"," break;"," case \"right\" :"," legend.set(\"y\", graphY);"," legend.set(\"height\", graphHeight);"," break;"," }"," }"," }"," if(topAxesCollection)"," {"," l = topAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = topAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," axis.get(\"boundingBox\").setStyle(\"top\", topAxesYCoords[i] + PX);"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(bottomAxesCollection)"," {"," l = bottomAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = bottomAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," axis.get(\"boundingBox\").setStyle(\"top\", bottomAxesYCoords[i] + PX);"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(leftAxesCollection)"," {"," l = leftAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = leftAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," axis.get(\"boundingBox\").setStyle(\"left\", leftAxesXCoords[i] + PX);"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(rightAxesCollection)"," {"," l = rightAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = rightAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," axis.get(\"boundingBox\").setStyle(\"left\", rightAxesXCoords[i] + PX);"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," graph.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," graph.set(\"width\", graphWidth);"," graph.set(\"height\", graphHeight);"," graph.get(\"boundingBox\").setStyle(\"overflow\", graphOverflow);"," }",""," if(this._overlay)"," {"," this._overlay.setStyle(\"left\", graphX + PX);"," this._overlay.setStyle(\"top\", graphY + PX);"," this._overlay.setStyle(\"width\", graphWidth + PX);"," this._overlay.setStyle(\"height\", graphHeight + PX);"," }"," },",""," /**"," * Positions the legend in a chart and returns the properties of the legend to be used in the "," * chart's layout algorithm."," *"," * @method _getLayoutDimensions"," * @return {Object} The left, top, right and bottom values for the legend."," * @protected"," */"," _getLayoutBoxDimensions: function()"," {"," var box = {"," top: 0,"," right: 0,"," bottom: 0,"," left: 0"," },"," legend = this.get(\"legend\"),"," position,"," direction,"," dimension,"," size,"," w = this.get(WIDTH),"," h = this.get(HEIGHT),"," gap;"," if(legend && legend.get(\"includeInChartLayout\"))"," {"," gap = legend.get(\"styles\").gap;"," position = legend.get(POSITION);"," if(position != EXTERNAL)"," {"," direction = legend.get(\"direction\");"," dimension = direction == HORIZONTAL ? HEIGHT : WIDTH;"," size = legend.get(dimension);"," box[position] = size + gap;"," switch(position)"," {"," case TOP :"," legend.set(_Y, 0); "," break;"," case BOTTOM : "," legend.set(_Y, h - size); "," break;"," case RIGHT :"," legend.set(_X, w - size);"," break;"," case LEFT: "," legend.set(_X, 0);"," break;"," }"," }"," }"," return box;"," },",""," /**"," * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series, legend (if available) and the Graph instance."," * Removes the tooltip and overlay HTML elements."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var legend = this.get(\"legend\");"," if(legend)"," {"," legend.destroy(true);"," }"," }","}, {"," ATTRS: {"," legend: LEGEND"," }","});","","Y.CartesianChart = CartesianChartLegend;","","var PieChartLegend = Y.Base.create(\"pieChartLegend\", Y.PieChart, [], {"," /**"," * Redraws the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var graph = this.get(\"graph\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," graphWidth,"," graphHeight,"," legend = this.get(\"legend\"),"," x = 0,"," y = 0,"," legendX = 0,"," legendY = 0,"," legendWidth,"," legendHeight,"," dimension,"," gap,"," position,"," direction;"," if(graph)"," {"," if(legend)"," {"," position = legend.get(\"position\");"," direction = legend.get(\"direction\");"," graphWidth = graph.get(\"width\");"," graphHeight = graph.get(\"height\");"," legendWidth = legend.get(\"width\");"," legendHeight = legend.get(\"height\");"," gap = legend.get(\"styles\").gap;"," "," if((direction == \"vertical\" && (graphWidth + legendWidth + gap !== w)) || (direction == \"horizontal\" && (graphHeight + legendHeight + gap !== h)))"," {"," switch(legend.get(\"position\"))"," {"," case LEFT :"," dimension = Math.min(w - (legendWidth + gap), h);"," legendHeight = h;"," x = legendWidth + gap;"," legend.set(HEIGHT, legendHeight);"," break;"," case TOP :"," dimension = Math.min(h - (legendHeight + gap), w); "," legendWidth = w;"," y = legendHeight + gap;"," legend.set(WIDTH, legendWidth);"," break;"," case RIGHT :"," dimension = Math.min(w - (legendWidth + gap), h);"," legendHeight = h;"," legendX = dimension + gap;"," legend.set(HEIGHT, legendHeight);"," break;"," case BOTTOM :"," dimension = Math.min(h - (legendHeight + gap), w); "," legendWidth = w;"," legendY = dimension + gap; "," legend.set(WIDTH, legendWidth);"," break;"," }"," graph.set(WIDTH, dimension);"," graph.set(HEIGHT, dimension);"," }"," else"," {"," switch(legend.get(\"position\"))"," { "," case LEFT :"," x = legendWidth + gap;"," break;"," case TOP :"," y = legendHeight + gap;"," break;"," case RIGHT :"," legendX = graphWidth + gap;"," break;"," case BOTTOM :"," legendY = graphHeight + gap; "," break;"," }"," }"," }"," else"," {"," graph.set(_X, 0);"," graph.set(_Y, 0);"," graph.set(WIDTH, w);"," graph.set(HEIGHT, h);"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.set(_X, x);"," graph.set(_Y, y);"," }"," if(legend)"," {"," legend.set(_X, legendX);"," legend.set(_Y, legendY);"," }"," }","}, {"," ATTRS: {"," /**"," * The legend for the chart."," *"," * @attribute"," * @type Legend"," */"," legend: LEGEND"," }","});","Y.PieChart = PieChartLegend;","/**"," * ChartLegend provides a legend for a chart."," *"," * @class ChartLegend"," * @module charts"," * @submodule charts-legend"," * @extends Widget"," */","Y.ChartLegend = Y.Base.create(\"chartlegend\", Y.Widget, [Y.Renderer], {"," /**"," * Initializes the chart."," *"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this._items = [];"," },",""," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\"),"," styles = this.get(\"styles\").background,"," background = new Y.Rect({"," graphic: cb,"," fill: styles.fill,"," stroke: styles.border"," });"," bb.setStyle(\"display\", \"block\");"," bb.setStyle(\"position\", \"absolute\");"," this.set(\"background\", background);"," },"," "," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.get(\"chart\").after(\"seriesCollectionChange\", Y.bind(this._updateHandler, this));"," this.after(\"stylesChange\", this._updateHandler);"," this.after(\"positionChange\", this._positionChangeHandler);"," this.after(\"widthChange\", this._handleSizeChange);"," this.after(\"heightChange\", this._handleSizeChange);"," },"," "," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," {"," this._drawLegend();"," }"," },",""," /**"," * Handles changes to legend."," *"," * @method _updateHandler"," * @param {Object} e Event object"," * @private"," */"," _updateHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawLegend();"," }"," },",""," /** "," * Handles position changes."," *"," * @method _positionChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _positionChangeHandler: function(e)"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode && ((chart && this.get(\"includeInChartLayout\"))))"," {"," this.fire(\"legendRendered\");"," }"," else if(this.get(\"rendered\"))"," {"," this._drawLegend();"," }"," },",""," /**"," * Updates the legend when the size changes."," *"," * @method _handleSizeChange"," * @param {Object} e Event object."," * @private"," */"," _handleSizeChange: function(e)"," {"," var attrName = e.attrName,"," pos = this.get(POSITION),"," vert = pos == LEFT || pos == RIGHT,"," hor = pos == BOTTOM || pos == TOP;"," if((hor && attrName == WIDTH) || (vert && attrName == HEIGHT))"," {"," this._drawLegend();"," }"," },",""," /**"," * Draws the legend"," *"," * @method _drawLegend"," * @private"," */"," _drawLegend: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," if(this.get(\"includeInChartLayout\"))"," {"," this.get(\"chart\")._itemRenderQueue.unshift(this);"," }"," var chart = this.get(\"chart\"),"," node = this.get(\"contentBox\"),"," seriesCollection = chart.get(\"seriesCollection\"),"," series,"," styles = this.get(\"styles\"),"," padding = styles.padding,"," itemStyles = styles.item,"," seriesStyles,"," hSpacing = itemStyles.hSpacing,"," vSpacing = itemStyles.vSpacing,"," hAlign = styles.hAlign,"," vAlign = styles.vAlign,"," marker = styles.marker,"," labelStyles = itemStyles.label,"," displayName,"," layout = this._layout[this.get(\"direction\")],"," i, "," len,"," isArray,"," shape,"," shapeClass,"," item,"," fill,"," border,"," fillColors,"," borderColors,"," borderWeight,"," items = [],"," markerWidth = marker.width,"," markerHeight = marker.height,"," totalWidth = 0 - hSpacing,"," totalHeight = 0 - vSpacing,"," maxWidth = 0,"," maxHeight = 0,"," itemWidth,"," itemHeight;"," if(marker && marker.shape)"," {"," shape = marker.shape;"," }"," this._destroyLegendItems();"," if(chart instanceof Y.PieChart)"," {"," series = seriesCollection[0];"," displayName = series.get(\"categoryAxis\").getDataByKey(series.get(\"categoryKey\")); "," seriesStyles = series.get(\"styles\").marker;"," fillColors = seriesStyles.fill.colors;"," borderColors = seriesStyles.border.colors;"," borderWeight = seriesStyles.border.weight;"," i = 0;"," len = displayName.length;"," shape = shape || Y.Circle;"," isArray = Y.Lang.isArray(shape);"," for(; i < len; ++i)"," {"," shape = isArray ? shape[i] : shape;"," fill = {"," color: fillColors[i]"," };"," border = {"," colors: borderColors[i],"," weight: borderWeight"," };"," displayName = chart.getSeriesItems(series, i).category.value;"," item = this._getLegendItem(node, this._getShapeClass(shape), fill, border, labelStyles, markerWidth, markerHeight, displayName);"," itemWidth = item.width;"," itemHeight = item.height;"," maxWidth = Math.max(maxWidth, itemWidth);"," maxHeight = Math.max(maxHeight, itemHeight);"," totalWidth += itemWidth + hSpacing;"," totalHeight += itemHeight + vSpacing;"," items.push(item);"," }"," }"," else"," {"," i = 0;"," len = seriesCollection.length;"," for(; i < len; ++i)"," {"," series = seriesCollection[i];"," seriesStyles = this._getStylesBySeriesType(series, shape);"," if(!shape)"," {"," shape = seriesStyles.shape;"," if(!shape)"," {"," shape = Y.Circle;"," }"," }"," shapeClass = Y.Lang.isArray(shape) ? shape[i] : shape;"," item = this._getLegendItem(node, this._getShapeClass(shape), seriesStyles.fill, seriesStyles.border, labelStyles, markerWidth, markerHeight, series.get(\"valueDisplayName\"));"," itemWidth = item.width;"," itemHeight = item.height;"," maxWidth = Math.max(maxWidth, itemWidth);"," maxHeight = Math.max(maxHeight, itemHeight);"," totalWidth += itemWidth + hSpacing;"," totalHeight += itemHeight + vSpacing;"," items.push(item);"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawLegend();"," }"," else"," {"," layout._positionLegendItems.apply(this, [items, maxWidth, maxHeight, totalWidth, totalHeight, padding, hSpacing, vSpacing, hAlign, vAlign]);"," this._updateBackground(styles);"," this.fire(\"legendRendered\");"," }"," },",""," /**"," * Updates the background for the legend."," *"," * @method _updateBackground"," * @param {Object} styles Reference to the legend's styles attribute"," * @private"," */"," _updateBackground: function(styles)"," {"," var backgroundStyles = styles.background,"," contentRect = this._contentRect,"," padding = styles.padding,"," x = contentRect.left - padding.left,"," y = contentRect.top - padding.top,"," w = contentRect.right - x + padding.right,"," h = contentRect.bottom - y + padding.bottom;"," this.get(\"background\").set({"," fill: backgroundStyles.fill,"," stroke: backgroundStyles.border,"," width: w,"," height: h,"," x: x,"," y: y"," });"," },",""," /**"," * Retrieves the marker styles based on the type of series. For series that contain a marker, the marker styles are returned."," * "," * @method _getStylesBySeriesType"," * @param {CartesianSeries | PieSeries} The series in which the style properties will be received."," * @return Object An object containing fill, border and shape information."," * @private"," */"," _getStylesBySeriesType: function(series)"," {"," var styles = series.get(\"styles\"),"," color;"," if(series instanceof Y.LineSeries || series instanceof Y.StackedLineSeries)"," {"," styles = series.get(\"styles\").line;"," color = styles.color || series._getDefaultColor(series.get(\"graphOrder\"), \"line\");"," return {"," border: {"," weight: 1,"," color: color"," },"," fill: {"," color: color"," }"," };"," }"," else if(series instanceof Y.AreaSeries || series instanceof Y.StackedAreaSeries)"," {"," styles = series.get(\"styles\").area;"," color = styles.color || series._getDefaultColor(series.get(\"graphOrder\"), \"slice\");"," return {"," border: {"," weight: 1,"," color: color"," },"," fill: {"," color: color"," }"," };"," }"," else "," {"," styles = series.get(\"styles\").marker;"," return {"," fill: styles.fill,",""," border: {"," weight: styles.border.weight,",""," color: styles.border.color,",""," shape: styles.shape"," },"," shape: styles.shape"," };"," }"," },",""," /**"," * Returns a legend item consisting of the following properties:"," * <dl>"," * <dt>node</dt><dd>The `Node` containing the legend item elements.</dd>"," * <dt>shape</dt><dd>The `Shape` element for the legend item.</dd>"," * <dt>textNode</dt><dd>The `Node` containing the text></dd>"," * <dt>text</dt><dd></dd>"," * </dl>"," *"," * @method _getLegendItem"," * @param {Node} shapeProps Reference to the `node` attribute."," * @param {String | Class} shapeClass The type of shape"," * @param {Object} fill Properties for the shape's fill"," * @param {Object} border Properties for the shape's border"," * @param {String} text String to be rendered as the legend's text"," * @param {Number} width Total width of the legend item"," * @param {Number} height Total height of the legend item"," * @param {HTML | String} text Text for the legendItem"," * @return Object"," * @private"," */"," _getLegendItem: function(node, shapeClass, fill, border, labelStyles, w, h, text) "," {"," var containerNode = Y.one(DOCUMENT.createElement(\"div\")),"," textField = Y.one(DOCUMENT.createElement(\"span\")),"," shape,"," dimension,"," padding,"," left,"," item;"," containerNode.setStyle(POSITION, \"absolute\");"," textField.setStyle(POSITION, \"absolute\");"," textField.setStyles(labelStyles);"," textField.appendChild(DOCUMENT.createTextNode(text));"," containerNode.appendChild(textField);"," node.appendChild(containerNode);"," dimension = textField.get(\"offsetHeight\");"," padding = dimension - h;"," left = w + padding + 2;"," textField.setStyle(\"left\", left + PX);"," containerNode.setStyle(\"height\", dimension + PX);"," containerNode.setStyle(\"width\", (left + textField.get(\"offsetWidth\")) + PX);"," shape = new shapeClass({"," fill: fill,"," stroke: border,"," width: w,"," height: h,"," x: padding * 0.5,"," y: padding * 0.5,"," w: w,"," h: h,"," graphic: containerNode"," });"," textField.setStyle(\"left\", dimension + PX);"," item = {"," node: containerNode,"," width: containerNode.get(\"offsetWidth\"),"," height: containerNode.get(\"offsetHeight\"),"," shape: shape,"," textNode: textField,"," text: text"," };"," this._items.push(item);"," return item;"," },",""," /**"," * Evaluates and returns correct class for drawing a shape."," *"," * @method _getShapeClass"," * @return Shape"," * @private"," */"," _getShapeClass: function()"," { "," var graphic = this.get(\"background\").get(\"graphic\");"," return graphic._getShapeClass.apply(graphic, arguments);"," },"," "," /**"," * Returns the default hash for the `styles` attribute."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var styles = { "," padding: {"," top: 8,"," right: 8,"," bottom: 8,"," left: 9"," },"," gap: 10,"," hAlign: \"center\","," vAlign: \"top\","," marker: this._getPlotDefaults(),"," item: {"," hSpacing: 10,"," vSpacing: 5,"," label: {"," color:\"#808080\","," fontSize:\"85%\","," whiteSpace: \"nowrap\""," }"," },"," background: {"," shape: \"rect\","," fill:{"," color:\"#faf9f2\""," },"," border: {"," color:\"#dad8c9\","," weight: 1"," }"," }"," };"," return styles;"," },",""," /**"," * Gets the default values for series that use the utility. This method is used by"," * the class' `styles` attribute's getter to get build default values."," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," width: 10,"," height: 10"," };"," return defs;"," },",""," /**"," * Destroys legend items."," *"," * @method _destroyLegendItems"," * @private"," */"," _destroyLegendItems: function()"," {"," var item;"," if(this._items)"," {"," while(this._items.length > 0)"," {"," item = this._items.shift();"," item.shape.get(\"graphic\").destroy();"," item.node.empty();"," item.node.destroy(true);"," item.node = null;"," item = null;"," }"," }"," this._items = [];"," },",""," /**"," * Maps layout classes."," *"," * @property _layout"," * @private"," */"," _layout: {"," vertical: VerticalLegendLayout,"," horizontal: HorizontalLegendLayout"," },",""," /**"," * Destructor implementation ChartLegend class. Removes all items and the Graphic instance from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var background = this.get(\"background\"),"," backgroundGraphic;"," this._destroyLegendItems();"," if(background)"," {"," backgroundGraphic = background.get(\"graphic\");"," if(backgroundGraphic)"," {"," backgroundGraphic.destroy();"," }"," else"," {"," background.destroy();"," }"," }",""," }","}, {"," ATTRS: {"," /**"," * Indicates whether the chart's contentBox is the parentNode for the legend."," *"," * @attribute includeInChartLayout"," * @type Boolean"," * @private"," */"," includeInChartLayout: {"," value: false"," },",""," /**"," * Reference to the `Chart` instance."," *"," * @attribute chart"," * @type Chart"," */"," chart: {"," setter: function(val)"," {"," this.after(\"legendRendered\", Y.bind(val._itemRendered, val));"," return val;"," }"," },",""," /**"," * Indicates the direction in relation of the legend's layout. The `direction` of the legend is determined by its"," * `position` value."," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"vertical\""," },"," "," /**"," * Indicates the position and direction of the legend. Possible values are `left`, `top`, `right` and `bottom`. Values of `left` and"," * `right` values have a `direction` of `vertical`. Values of `top` and `bottom` values have a `direction` of `horizontal`."," *"," * @attribute position"," * @type String"," */"," position: {"," lazyAdd: false,",""," value: \"right\",",""," setter: function(val)"," {"," if(val == TOP || val == BOTTOM)"," {"," this.set(\"direction\", HORIZONTAL);"," }"," else if(val == LEFT || val == RIGHT)"," {"," this.set(\"direction\", VERTICAL);"," }"," return val;"," }"," },"," "," /**"," * The width of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that "," * it references. Under this circumstance, `width` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the "," * direction of the legend. If the `position` is `left` or `right` or the `direction` is `vertical`, width is `readOnly`. If the position is `top` or `bottom` or the `direction`"," * is `horizontal`, width can be explicitly set. If width is not explicitly set, the width will be determined by the width of the legend's parent element."," *"," * @attribute width"," * @type Number"," */"," width: {"," getter: function()"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode)"," {"," if((chart && this.get(\"includeInChartLayout\")) || this._width)"," {"," if(!this._width)"," {"," this._width = 0;"," }"," return this._width;"," }"," else"," {"," return parentNode.get(\"offsetWidth\");"," }"," }"," return \"\";"," },",""," setter: function(val)"," {"," this._width = val;"," return val;"," }"," },",""," /**"," * The height of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that "," * it references. Under this circumstance, `height` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the "," * direction of the legend. If the `position` is `top` or `bottom` or the `direction` is `horizontal`, height is `readOnly`. If the position is `left` or `right` or the `direction`"," * is `vertical`, height can be explicitly set. If height is not explicitly set, the height will be determined by the width of the legend's parent element."," *"," * @attribute height "," * @type Number"," */"," height: {"," valueFn: \"_heightGetter\",",""," getter: function()"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode) "," {"," if((chart && this.get(\"includeInChartLayout\")) || this._height)"," {"," if(!this._height)"," {"," this._height = 0;"," }"," return this._height;"," }"," else"," {"," return parentNode.get(\"offsetHeight\");"," }"," }"," return \"\";"," },",""," setter: function(val)"," {"," this._height = val;"," return val;"," }"," },",""," /**"," * Indicates the x position of legend."," *"," * @attribute x"," * @type Number"," * @readOnly"," */"," x: {"," lazyAdd: false,",""," value: 0,"," "," setter: function(val)"," {"," var node = this.get(\"boundingBox\");"," if(node)"," {"," node.setStyle(LEFT, val + PX);"," }"," return val;"," }"," },",""," /**"," * Indicates the y position of legend."," *"," * @attribute y"," * @type Number"," * @readOnly"," */"," y: {"," lazyAdd: false,",""," value: 0,"," "," setter: function(val)"," {"," var node = this.get(\"boundingBox\");"," if(node)"," {"," node.setStyle(TOP, val + PX);"," }"," return val;"," }"," },",""," /**"," * Array of items contained in the legend. Each item is an object containing the following properties:"," *"," * <dl>"," * <dt>node</dt><dd>Node containing text for the legend item.</dd>"," * <dt>marker</dt><dd>Shape for the legend item.</dd>"," * </dl>"," *"," * @attribute items"," * @type Array"," * @readOnly"," */"," items: {"," getter: function()"," {"," return this._items;"," }"," },",""," /**"," * Background for the legend."," *"," * @attribute background"," * @type Rect"," */"," background: {}",""," /**"," * Properties used to display and style the ChartLegend. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>gap</dt><dd>Distance, in pixels, between the `ChartLegend` instance and the chart's content. When `ChartLegend` is rendered within a `Chart` instance this value is applied.</dd>"," * <dt>hAlign</dt><dd>Defines the horizontal alignment of the `items` in a `ChartLegend` rendered in a horizontal direction. This value is applied when the instance's `position` is set to top or bottom. This attribute can be set to left, center or right. The default value is center.</dd>"," * <dt>vAlign</dt><dd>Defines the vertical alignment of the `items` in a `ChartLegend` rendered in vertical direction. This value is applied when the instance's `position` is set to left or right. The attribute can be set to top, middle or bottom. The default value is middle.</dd>"," * <dt>item</dt><dd>Set of style properties applied to the `items` of the `ChartLegend`."," * <dl>"," * <dt>hSpacing</dt><dd>Horizontal distance, in pixels, between legend `items`.</dd>"," * <dt>vSpacing</dt><dd>Vertical distance, in pixels, between legend `items`.</dd>"," * <dt>label</dt><dd>Properties for the text of an `item`."," * <dl>"," * <dt>color</dt><dd>Color of the text. The default values is \"#808080\".</dd>"," * <dt>fontSize</dt><dd>Font size for the text. The default value is \"85%\".</dd>"," * </dl>"," * </dd>"," * <dt>marker</dt><dd>Properties for the `item` markers."," * <dl>"," * <dt>width</dt><dd>Specifies the width of the markers.</dd>"," * <dt>height</dt><dd>Specifies the height of the markers.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * <dt>background</dt><dd>Properties for the `ChartLegend` background."," * <dl>"," * <dt>fill</dt><dd>Properties for the background fill."," * <dl>"," * <dt>color</dt><dd>Color for the fill. The default value is \"#faf9f2\".</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>Properties for the background border."," * <dl>"," * <dt>color</dt><dd>Color for the border. The default value is \"#dad8c9\".</dd>"," * <dt>weight</dt><dd>Weight of the border. The default values is 1.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The Chart class is the basic application used to create a chart."," *"," * @module charts"," * @class Chart"," * @constructor"," */","function Chart(cfg)","{"," if(cfg.type != \"pie\")"," {"," return new Y.CartesianChart(cfg);"," }"," else"," {"," return new Y.PieChart(cfg);"," }","}","Y.Chart = Chart;","","","}, '3.7.2', {\"requires\": [\"charts-base\"]});"];+_yuitest_coverage["build/charts-legend/charts-legend.js"].code=["YUI.add('charts-legend', function (Y, NAME) {","","/**"," * Adds legend functionality to charts."," *"," * @module charts"," * @submodule charts-legend"," */","var DOCUMENT = Y.config.doc, ","TOP = \"top\",","RIGHT = \"right\",","BOTTOM = \"bottom\",","LEFT = \"left\",","EXTERNAL = \"external\",","HORIZONTAL = \"horizontal\",","VERTICAL = \"vertical\",","WIDTH = \"width\",","HEIGHT = \"height\",","POSITION = \"position\",","_X = \"x\",","_Y = \"y\",","PX = \"px\",","LEGEND = {"," setter: function(val)"," { "," var legend = this.get(\"legend\");"," if(legend)"," {"," legend.destroy(true);"," }"," if(val instanceof Y.ChartLegend)"," {"," legend = val;"," legend.set(\"chart\", this);"," }"," else"," {"," val.chart = this;"," if(!val.hasOwnProperty(\"render\"))"," {"," val.render = this.get(\"contentBox\");"," val.includeInChartLayout = true;"," }"," legend = new Y.ChartLegend(val);"," }"," return legend;"," }","},","","/**"," * Contains methods for displaying items horizontally in a legend."," *"," * @module charts"," * @submodule charts-legend"," * @class HorizontalLegendLayout"," */","HorizontalLegendLayout = {"," /**"," * Displays items horizontally in a legend."," *"," * @method _positionLegendItems"," * @param {Array} items Array of items to display in the legend."," * @param {Number} maxWidth The width of the largest item in the legend."," * @param {Number} maxHeight The height of the largest item in the legend."," * @param {Number} totalWidth The total width of all items in a legend."," * @param {Number} totalHeight The total height of all items in a legend."," * @param {Number} padding The left, top, right and bottom padding properties for the legend."," * @param {Number} horizontalGap The horizontal distance between items in a legend."," * @param {Number} verticalGap The vertical distance between items in a legend."," * @param {String} hAlign The horizontal alignment of the legend."," * @param {String} vAlign The vertical alignment of the legend."," * @protected"," */"," _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)"," {"," var i = 0,"," rowIterator = 0,"," item,"," node,"," itemWidth,"," itemHeight,"," len,"," width = this.get(\"width\"),"," rows,"," rowsLen,"," row,"," totalWidthArray,"," legendWidth,"," topHeight = padding.top - verticalGap,"," limit = width - (padding.left + padding.right),"," left, "," top,"," right,"," bottom;"," HorizontalLegendLayout._setRowArrays(items, limit, horizontalGap);"," rows = HorizontalLegendLayout.rowArray;"," totalWidthArray = HorizontalLegendLayout.totalWidthArray;"," rowsLen = rows.length;"," for(; rowIterator < rowsLen; ++ rowIterator)"," {"," topHeight += verticalGap;"," row = rows[rowIterator];"," len = row.length;"," legendWidth = HorizontalLegendLayout.getStartPoint(width, totalWidthArray[rowIterator], hAlign, padding);"," for(i = 0; i < len; ++i)"," {"," item = row[i];"," node = item.node;"," itemWidth = item.width;"," itemHeight = item.height;"," item.x = legendWidth;"," item.y = 0;"," left = !isNaN(left) ? Math.min(left, legendWidth) : legendWidth;"," top = !isNaN(top) ? Math.min(top, topHeight) : topHeight;"," right = !isNaN(right) ? Math.max(legendWidth + itemWidth, right) : legendWidth + itemWidth;"," bottom = !isNaN(bottom) ? Math.max(topHeight + itemHeight, bottom) : topHeight + itemHeight;"," node.setStyle(\"left\", legendWidth + PX);"," node.setStyle(\"top\", topHeight + PX);"," legendWidth += itemWidth + horizontalGap;"," }"," topHeight += item.height;"," }"," this._contentRect = {"," left: left,"," top: top,"," right: right,"," bottom: bottom"," };"," if(this.get(\"includeInChartLayout\"))"," {"," this.set(\"height\", topHeight + padding.bottom);"," }"," },",""," /**"," * Creates row and total width arrays used for displaying multiple rows of"," * legend items based on the items, available width and horizontalGap for the legend."," *"," * @method _setRowArrays"," * @param {Array} items Array of legend items to display in a legend."," * @param {Number} limit Total available width for displaying items in a legend."," * @param {Number} horizontalGap Horizontal distance between items in a legend."," * @protected"," */"," _setRowArrays: function(items, limit, horizontalGap)"," {"," var item = items[0],"," rowArray = [[item]],"," i = 1,"," rowIterator = 0,"," len = items.length,"," totalWidth = item.width,"," itemWidth,"," totalWidthArray = [[totalWidth]];"," for(; i < len; ++i)"," {"," item = items[i];"," itemWidth = item.width;"," if((totalWidth + horizontalGap + itemWidth) <= limit)"," {"," totalWidth += horizontalGap + itemWidth;"," rowArray[rowIterator].push(item);"," }"," else"," {"," totalWidth = horizontalGap + itemWidth;"," if(rowArray[rowIterator])"," {"," rowIterator += 1;"," }"," rowArray[rowIterator] = [item];"," }"," totalWidthArray[rowIterator] = totalWidth;"," }"," HorizontalLegendLayout.rowArray = rowArray;"," HorizontalLegendLayout.totalWidthArray = totalWidthArray;"," },",""," /**"," * Returns the starting x-coordinate for a row of legend items."," *"," * @method getStartPoint"," * @param {Number} w Width of the legend."," * @param {Number} totalWidth Total width of all labels in the row."," * @param {String} align Horizontal alignment of items for the legend."," * @param {Object} padding Object contain left, top, right and bottom padding properties."," * @return Number"," * @protected"," */"," getStartPoint: function(w, totalWidth, align, padding)"," {"," var startPoint;"," switch(align)"," {"," case LEFT :"," startPoint = padding.left;"," break;"," case \"center\" :"," startPoint = (w - totalWidth) * 0.5;"," break;"," case RIGHT :"," startPoint = w - totalWidth - padding.right;"," break;"," }"," return startPoint;"," }","},","","/**"," * Contains methods for displaying items vertically in a legend."," *"," * @module charts"," * @submodule charts-legend"," * @class VerticalLegendLayout"," */","VerticalLegendLayout = {"," /**"," * Displays items vertically in a legend."," *"," * @method _positionLegendItems"," * @param {Array} items Array of items to display in the legend."," * @param {Number} maxWidth The width of the largest item in the legend."," * @param {Number} maxHeight The height of the largest item in the legend."," * @param {Number} totalWidth The total width of all items in a legend."," * @param {Number} totalHeight The total height of all items in a legend."," * @param {Number} padding The left, top, right and bottom padding properties for the legend."," * @param {Number} horizontalGap The horizontal distance between items in a legend."," * @param {Number} verticalGap The vertical distance between items in a legend."," * @param {String} hAlign The horizontal alignment of the legend."," * @param {String} vAlign The vertical alignment of the legend."," * @protected"," */"," _positionLegendItems: function(items, maxWidth, maxHeight, totalWidth, totalHeight, padding, horizontalGap, verticalGap, hAlign, vAlign)"," {"," var i = 0,"," columnIterator = 0,"," item,"," node,"," itemHeight,"," itemWidth,"," len,"," height = this.get(\"height\"),"," columns,"," columnsLen,"," column,"," totalHeightArray,"," legendHeight,"," leftWidth = padding.left - horizontalGap,"," legendWidth,"," limit = height - (padding.top + padding.bottom),"," left, "," top,"," right,"," bottom;"," VerticalLegendLayout._setColumnArrays(items, limit, verticalGap);"," columns = VerticalLegendLayout.columnArray;"," totalHeightArray = VerticalLegendLayout.totalHeightArray;"," columnsLen = columns.length;"," for(; columnIterator < columnsLen; ++ columnIterator)"," {"," leftWidth += horizontalGap;"," column = columns[columnIterator];"," len = column.length;"," legendHeight = VerticalLegendLayout.getStartPoint(height, totalHeightArray[columnIterator], vAlign, padding);"," legendWidth = 0;"," for(i = 0; i < len; ++i)"," {"," item = column[i];"," node = item.node;"," itemHeight = item.height;"," itemWidth = item.width;"," item.y = legendHeight;"," item.x = leftWidth;"," left = !isNaN(left) ? Math.min(left, leftWidth) : leftWidth;"," top = !isNaN(top) ? Math.min(top, legendHeight) : legendHeight;"," right = !isNaN(right) ? Math.max(leftWidth + itemWidth, right) : leftWidth + itemWidth;"," bottom = !isNaN(bottom) ? Math.max(legendHeight + itemHeight, bottom) : legendHeight + itemHeight;"," node.setStyle(\"left\", leftWidth + PX);"," node.setStyle(\"top\", legendHeight + PX);"," legendHeight += itemHeight + verticalGap;"," legendWidth = Math.max(legendWidth, item.width);"," }"," leftWidth += legendWidth;"," }"," this._contentRect = {"," left: left,"," top: top,"," right: right,"," bottom: bottom"," };"," if(this.get(\"includeInChartLayout\"))"," {"," this.set(\"width\", leftWidth + padding.right);"," }"," },",""," /**"," * Creates column and total height arrays used for displaying multiple columns of"," * legend items based on the items, available height and verticalGap for the legend."," *"," * @method _setColumnArrays"," * @param {Array} items Array of legend items to display in a legend."," * @param {Number} limit Total available height for displaying items in a legend."," * @param {Number} verticalGap Vertical distance between items in a legend."," * @protected"," */"," _setColumnArrays: function(items, limit, verticalGap)"," {"," var item = items[0],"," columnArray = [[item]],"," i = 1,"," columnIterator = 0,"," len = items.length,"," totalHeight = item.height,"," itemHeight,"," totalHeightArray = [[totalHeight]];"," for(; i < len; ++i)"," {"," item = items[i];"," itemHeight = item.height;"," if((totalHeight + verticalGap + itemHeight) <= limit)"," {"," totalHeight += verticalGap + itemHeight;"," columnArray[columnIterator].push(item);"," }"," else"," {"," totalHeight = verticalGap + itemHeight;"," if(columnArray[columnIterator])"," {"," columnIterator += 1;"," }"," columnArray[columnIterator] = [item];"," }"," totalHeightArray[columnIterator] = totalHeight;"," }"," VerticalLegendLayout.columnArray = columnArray;"," VerticalLegendLayout.totalHeightArray = totalHeightArray;"," },",""," /**"," * Returns the starting y-coordinate for a column of legend items."," *"," * @method getStartPoint"," * @param {Number} h Height of the legend."," * @param {Number} totalHeight Total height of all labels in the column."," * @param {String} align Vertical alignment of items for the legend."," * @param {Object} padding Object contain left, top, right and bottom padding properties."," * @return Number"," * @protected"," */"," getStartPoint: function(h, totalHeight, align, padding)"," {"," var startPoint;"," switch(align)"," {"," case TOP :"," startPoint = padding.top;"," break;"," case \"middle\" :"," startPoint = (h - totalHeight) * 0.5;"," break;"," case BOTTOM :"," startPoint = h - totalHeight - padding.bottom;"," break;"," }"," return startPoint;"," }","},","","CartesianChartLegend = Y.Base.create(\"cartesianChartLegend\", Y.CartesianChart, [], {"," /**"," * Redraws and position all the components of the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var w = this.get(\"width\"),"," h = this.get(\"height\"),"," layoutBoxDimensions = this._getLayoutBoxDimensions(),"," leftPaneWidth = layoutBoxDimensions.left,"," rightPaneWidth = layoutBoxDimensions.right,"," topPaneHeight = layoutBoxDimensions.top,"," bottomPaneHeight = layoutBoxDimensions.bottom,"," leftAxesCollection = this.get(\"leftAxesCollection\"),"," rightAxesCollection = this.get(\"rightAxesCollection\"),"," topAxesCollection = this.get(\"topAxesCollection\"),"," bottomAxesCollection = this.get(\"bottomAxesCollection\"),"," i = 0,"," l,"," axis,"," graphOverflow = \"visible\","," graph = this.get(\"graph\"),"," topOverflow,"," bottomOverflow,"," leftOverflow,"," rightOverflow,"," graphWidth,"," graphHeight,"," graphX,"," graphY,"," allowContentOverflow = this.get(\"allowContentOverflow\"),"," diff,"," rightAxesXCoords,"," leftAxesXCoords,"," topAxesYCoords,"," bottomAxesYCoords,"," legend = this.get(\"legend\"),"," graphRect = {};",""," if(leftAxesCollection)"," {"," leftAxesXCoords = [];"," l = leftAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," leftAxesXCoords.unshift(leftPaneWidth);"," leftPaneWidth += leftAxesCollection[i].get(\"width\");"," }"," }"," if(rightAxesCollection)"," {"," rightAxesXCoords = [];"," l = rightAxesCollection.length;"," i = 0;"," for(i = l - 1; i > -1; --i)"," {"," rightPaneWidth += rightAxesCollection[i].get(\"width\");"," rightAxesXCoords.unshift(w - rightPaneWidth);"," }"," }"," if(topAxesCollection)"," {"," topAxesYCoords = [];"," l = topAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," topAxesYCoords.unshift(topPaneHeight);"," topPaneHeight += topAxesCollection[i].get(\"height\");"," }"," }"," if(bottomAxesCollection)"," {"," bottomAxesYCoords = [];"," l = bottomAxesCollection.length;"," for(i = l - 1; i > -1; --i)"," {"," bottomPaneHeight += bottomAxesCollection[i].get(\"height\");"," bottomAxesYCoords.unshift(h - bottomPaneHeight);"," }"," }"," "," graphWidth = w - (leftPaneWidth + rightPaneWidth);"," graphHeight = h - (bottomPaneHeight + topPaneHeight);"," graphRect.left = leftPaneWidth;"," graphRect.top = topPaneHeight;"," graphRect.bottom = h - bottomPaneHeight;"," graphRect.right = w - rightPaneWidth;"," if(!allowContentOverflow)"," {"," topOverflow = this._getTopOverflow(leftAxesCollection, rightAxesCollection);"," bottomOverflow = this._getBottomOverflow(leftAxesCollection, rightAxesCollection);"," leftOverflow = this._getLeftOverflow(bottomAxesCollection, topAxesCollection);"," rightOverflow = this._getRightOverflow(bottomAxesCollection, topAxesCollection);"," "," diff = topOverflow - topPaneHeight;"," if(diff > 0)"," {"," graphRect.top = topOverflow;"," if(topAxesYCoords)"," {"," i = 0;"," l = topAxesYCoords.length;"," for(; i < l; ++i)"," {"," topAxesYCoords[i] += diff;"," }"," }"," }",""," diff = bottomOverflow - bottomPaneHeight;"," if(diff > 0)"," {"," graphRect.bottom = h - bottomOverflow;"," if(bottomAxesYCoords)"," {"," i = 0;"," l = bottomAxesYCoords.length;"," for(; i < l; ++i)"," {"," bottomAxesYCoords[i] -= diff;"," }"," }"," }",""," diff = leftOverflow - leftPaneWidth;"," if(diff > 0)"," {"," graphRect.left = leftOverflow;"," if(leftAxesXCoords)"," {"," i = 0;"," l = leftAxesXCoords.length;"," for(; i < l; ++i)"," {"," leftAxesXCoords[i] += diff;"," }"," }"," }",""," diff = rightOverflow - rightPaneWidth;"," if(diff > 0)"," {"," graphRect.right = w - rightOverflow;"," if(rightAxesXCoords)"," {"," i = 0;"," l = rightAxesXCoords.length;"," for(; i < l; ++i)"," {"," rightAxesXCoords[i] -= diff;"," }"," }"," }"," }"," graphWidth = graphRect.right - graphRect.left;"," graphHeight = graphRect.bottom - graphRect.top;"," graphX = graphRect.left;"," graphY = graphRect.top;"," if(legend)"," {"," if(legend.get(\"includeInChartLayout\"))"," {"," switch(legend.get(\"position\"))"," {"," case \"left\" : "," legend.set(\"y\", graphY);"," legend.set(\"height\", graphHeight);"," break;"," case \"top\" :"," legend.set(\"x\", graphX);"," legend.set(\"width\", graphWidth);"," break;"," case \"bottom\" : "," legend.set(\"x\", graphX);"," legend.set(\"width\", graphWidth);"," break;"," case \"right\" :"," legend.set(\"y\", graphY);"," legend.set(\"height\", graphHeight);"," break;"," }"," }"," }"," if(topAxesCollection)"," {"," l = topAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = topAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," axis.get(\"boundingBox\").setStyle(\"top\", topAxesYCoords[i] + PX);"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(bottomAxesCollection)"," {"," l = bottomAxesCollection.length;"," i = 0;"," for(; i < l; i++)"," {"," axis = bottomAxesCollection[i];"," if(axis.get(\"width\") !== graphWidth)"," {"," axis.set(\"width\", graphWidth);"," }"," axis.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," axis.get(\"boundingBox\").setStyle(\"top\", bottomAxesYCoords[i] + PX);"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(leftAxesCollection)"," {"," l = leftAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = leftAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," axis.get(\"boundingBox\").setStyle(\"left\", leftAxesXCoords[i] + PX);"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," if(rightAxesCollection)"," {"," l = rightAxesCollection.length;"," i = 0;"," for(; i < l; ++i)"," {"," axis = rightAxesCollection[i];"," axis.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," axis.get(\"boundingBox\").setStyle(\"left\", rightAxesXCoords[i] + PX);"," if(axis.get(\"height\") !== graphHeight)"," {"," axis.set(\"height\", graphHeight);"," }"," }"," if(axis._hasDataOverflow())"," {"," graphOverflow = \"hidden\";"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.get(\"boundingBox\").setStyle(\"left\", graphX + PX);"," graph.get(\"boundingBox\").setStyle(\"top\", graphY + PX);"," graph.set(\"width\", graphWidth);"," graph.set(\"height\", graphHeight);"," graph.get(\"boundingBox\").setStyle(\"overflow\", graphOverflow);"," }",""," if(this._overlay)"," {"," this._overlay.setStyle(\"left\", graphX + PX);"," this._overlay.setStyle(\"top\", graphY + PX);"," this._overlay.setStyle(\"width\", graphWidth + PX);"," this._overlay.setStyle(\"height\", graphHeight + PX);"," }"," },",""," /**"," * Positions the legend in a chart and returns the properties of the legend to be used in the "," * chart's layout algorithm."," *"," * @method _getLayoutDimensions"," * @return {Object} The left, top, right and bottom values for the legend."," * @protected"," */"," _getLayoutBoxDimensions: function()"," {"," var box = {"," top: 0,"," right: 0,"," bottom: 0,"," left: 0"," },"," legend = this.get(\"legend\"),"," position,"," direction,"," dimension,"," size,"," w = this.get(WIDTH),"," h = this.get(HEIGHT),"," gap;"," if(legend && legend.get(\"includeInChartLayout\"))"," {"," gap = legend.get(\"styles\").gap;"," position = legend.get(POSITION);"," if(position != EXTERNAL)"," {"," direction = legend.get(\"direction\");"," dimension = direction == HORIZONTAL ? HEIGHT : WIDTH;"," size = legend.get(dimension);"," box[position] = size + gap;"," switch(position)"," {"," case TOP :"," legend.set(_Y, 0); "," break;"," case BOTTOM : "," legend.set(_Y, h - size); "," break;"," case RIGHT :"," legend.set(_X, w - size);"," break;"," case LEFT: "," legend.set(_X, 0);"," break;"," }"," }"," }"," return box;"," },",""," /**"," * Destructor implementation for the CartesianChart class. Calls destroy on all axes, series, legend (if available) and the Graph instance."," * Removes the tooltip and overlay HTML elements."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var legend = this.get(\"legend\");"," if(legend)"," {"," legend.destroy(true);"," }"," }","}, {"," ATTRS: {"," legend: LEGEND"," }","});","","Y.CartesianChart = CartesianChartLegend;","","var PieChartLegend = Y.Base.create(\"pieChartLegend\", Y.PieChart, [], {"," /**"," * Redraws the chart instance."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," var graph = this.get(\"graph\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," graphWidth,"," graphHeight,"," legend = this.get(\"legend\"),"," x = 0,"," y = 0,"," legendX = 0,"," legendY = 0,"," legendWidth,"," legendHeight,"," dimension,"," gap,"," position,"," direction;"," if(graph)"," {"," if(legend)"," {"," position = legend.get(\"position\");"," direction = legend.get(\"direction\");"," graphWidth = graph.get(\"width\");"," graphHeight = graph.get(\"height\");"," legendWidth = legend.get(\"width\");"," legendHeight = legend.get(\"height\");"," gap = legend.get(\"styles\").gap;"," "," if((direction == \"vertical\" && (graphWidth + legendWidth + gap !== w)) || (direction == \"horizontal\" && (graphHeight + legendHeight + gap !== h)))"," {"," switch(legend.get(\"position\"))"," {"," case LEFT :"," dimension = Math.min(w - (legendWidth + gap), h);"," legendHeight = h;"," x = legendWidth + gap;"," legend.set(HEIGHT, legendHeight);"," break;"," case TOP :"," dimension = Math.min(h - (legendHeight + gap), w); "," legendWidth = w;"," y = legendHeight + gap;"," legend.set(WIDTH, legendWidth);"," break;"," case RIGHT :"," dimension = Math.min(w - (legendWidth + gap), h);"," legendHeight = h;"," legendX = dimension + gap;"," legend.set(HEIGHT, legendHeight);"," break;"," case BOTTOM :"," dimension = Math.min(h - (legendHeight + gap), w); "," legendWidth = w;"," legendY = dimension + gap; "," legend.set(WIDTH, legendWidth);"," break;"," }"," graph.set(WIDTH, dimension);"," graph.set(HEIGHT, dimension);"," }"," else"," {"," switch(legend.get(\"position\"))"," { "," case LEFT :"," x = legendWidth + gap;"," break;"," case TOP :"," y = legendHeight + gap;"," break;"," case RIGHT :"," legendX = graphWidth + gap;"," break;"," case BOTTOM :"," legendY = graphHeight + gap; "," break;"," }"," }"," }"," else"," {"," graph.set(_X, 0);"," graph.set(_Y, 0);"," graph.set(WIDTH, w);"," graph.set(HEIGHT, h);"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._redraw();"," return;"," }"," if(graph)"," {"," graph.set(_X, x);"," graph.set(_Y, y);"," }"," if(legend)"," {"," legend.set(_X, legendX);"," legend.set(_Y, legendY);"," }"," }","}, {"," ATTRS: {"," /**"," * The legend for the chart."," *"," * @attribute"," * @type Legend"," */"," legend: LEGEND"," }","});","Y.PieChart = PieChartLegend;","/**"," * ChartLegend provides a legend for a chart."," *"," * @class ChartLegend"," * @module charts"," * @submodule charts-legend"," * @extends Widget"," */","Y.ChartLegend = Y.Base.create(\"chartlegend\", Y.Widget, [Y.Renderer], {"," /**"," * Initializes the chart."," *"," * @method initializer"," * @private"," */"," initializer: function()"," {"," this._items = [];"," },",""," /**"," * @method renderUI"," * @private"," */"," renderUI: function()"," {"," var bb = this.get(\"boundingBox\"),"," cb = this.get(\"contentBox\"),"," styles = this.get(\"styles\").background,"," background = new Y.Rect({"," graphic: cb,"," fill: styles.fill,"," stroke: styles.border"," });"," bb.setStyle(\"display\", \"block\");"," bb.setStyle(\"position\", \"absolute\");"," this.set(\"background\", background);"," },"," "," /**"," * @method bindUI"," * @private"," */"," bindUI: function()"," {"," this.get(\"chart\").after(\"seriesCollectionChange\", Y.bind(this._updateHandler, this));"," this.after(\"stylesChange\", this._updateHandler);"," this.after(\"positionChange\", this._positionChangeHandler);"," this.after(\"widthChange\", this._handleSizeChange);"," this.after(\"heightChange\", this._handleSizeChange);"," },"," "," /**"," * @method syncUI"," * @private"," */"," syncUI: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," if(isFinite(w) && isFinite(h) && w > 0 && h > 0)"," {"," this._drawLegend();"," }"," },",""," /**"," * Handles changes to legend."," *"," * @method _updateHandler"," * @param {Object} e Event object"," * @private"," */"," _updateHandler: function(e)"," {"," if(this.get(\"rendered\"))"," {"," this._drawLegend();"," }"," },",""," /** "," * Handles position changes."," *"," * @method _positionChangeHandler"," * @param {Object} e Event object"," * @private"," */"," _positionChangeHandler: function(e)"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode && ((chart && this.get(\"includeInChartLayout\"))))"," {"," this.fire(\"legendRendered\");"," }"," else if(this.get(\"rendered\"))"," {"," this._drawLegend();"," }"," },",""," /**"," * Updates the legend when the size changes."," *"," * @method _handleSizeChange"," * @param {Object} e Event object."," * @private"," */"," _handleSizeChange: function(e)"," {"," var attrName = e.attrName,"," pos = this.get(POSITION),"," vert = pos == LEFT || pos == RIGHT,"," hor = pos == BOTTOM || pos == TOP;"," if((hor && attrName == WIDTH) || (vert && attrName == HEIGHT))"," {"," this._drawLegend();"," }"," },",""," /**"," * Draws the legend"," *"," * @method _drawLegend"," * @private"," */"," _drawLegend: function()"," {"," if(this._drawing)"," {"," this._callLater = true;"," return;"," }"," this._drawing = true;"," this._callLater = false;"," if(this.get(\"includeInChartLayout\"))"," {"," this.get(\"chart\")._itemRenderQueue.unshift(this);"," }"," var chart = this.get(\"chart\"),"," node = this.get(\"contentBox\"),"," seriesCollection = chart.get(\"seriesCollection\"),"," series,"," styles = this.get(\"styles\"),"," padding = styles.padding,"," itemStyles = styles.item,"," seriesStyles,"," hSpacing = itemStyles.hSpacing,"," vSpacing = itemStyles.vSpacing,"," hAlign = styles.hAlign,"," vAlign = styles.vAlign,"," marker = styles.marker,"," labelStyles = itemStyles.label,"," displayName,"," layout = this._layout[this.get(\"direction\")],"," i, "," len,"," isArray,"," shape,"," shapeClass,"," item,"," fill,"," border,"," fillColors,"," borderColors,"," borderWeight,"," items = [],"," markerWidth = marker.width,"," markerHeight = marker.height,"," totalWidth = 0 - hSpacing,"," totalHeight = 0 - vSpacing,"," maxWidth = 0,"," maxHeight = 0,"," itemWidth,"," itemHeight;"," if(marker && marker.shape)"," {"," shape = marker.shape;"," }"," this._destroyLegendItems();"," if(chart instanceof Y.PieChart)"," {"," series = seriesCollection[0];"," displayName = series.get(\"categoryAxis\").getDataByKey(series.get(\"categoryKey\")); "," seriesStyles = series.get(\"styles\").marker;"," fillColors = seriesStyles.fill.colors;"," borderColors = seriesStyles.border.colors;"," borderWeight = seriesStyles.border.weight;"," i = 0;"," len = displayName.length;"," shape = shape || Y.Circle;"," isArray = Y.Lang.isArray(shape);"," for(; i < len; ++i)"," {"," shape = isArray ? shape[i] : shape;"," fill = {"," color: fillColors[i]"," };"," border = {"," colors: borderColors[i],"," weight: borderWeight"," };"," displayName = chart.getSeriesItems(series, i).category.value;"," item = this._getLegendItem(node, this._getShapeClass(shape), fill, border, labelStyles, markerWidth, markerHeight, displayName);"," itemWidth = item.width;"," itemHeight = item.height;"," maxWidth = Math.max(maxWidth, itemWidth);"," maxHeight = Math.max(maxHeight, itemHeight);"," totalWidth += itemWidth + hSpacing;"," totalHeight += itemHeight + vSpacing;"," items.push(item);"," }"," }"," else"," {"," i = 0;"," len = seriesCollection.length;"," for(; i < len; ++i)"," {"," series = seriesCollection[i];"," seriesStyles = this._getStylesBySeriesType(series, shape);"," if(!shape)"," {"," shape = seriesStyles.shape;"," if(!shape)"," {"," shape = Y.Circle;"," }"," }"," shapeClass = Y.Lang.isArray(shape) ? shape[i] : shape;"," item = this._getLegendItem(node, this._getShapeClass(shape), seriesStyles.fill, seriesStyles.border, labelStyles, markerWidth, markerHeight, series.get(\"valueDisplayName\"));"," itemWidth = item.width;"," itemHeight = item.height;"," maxWidth = Math.max(maxWidth, itemWidth);"," maxHeight = Math.max(maxHeight, itemHeight);"," totalWidth += itemWidth + hSpacing;"," totalHeight += itemHeight + vSpacing;"," items.push(item);"," }"," }"," this._drawing = false;"," if(this._callLater)"," {"," this._drawLegend();"," }"," else"," {"," layout._positionLegendItems.apply(this, [items, maxWidth, maxHeight, totalWidth, totalHeight, padding, hSpacing, vSpacing, hAlign, vAlign]);"," this._updateBackground(styles);"," this.fire(\"legendRendered\");"," }"," },",""," /**"," * Updates the background for the legend."," *"," * @method _updateBackground"," * @param {Object} styles Reference to the legend's styles attribute"," * @private"," */"," _updateBackground: function(styles)"," {"," var backgroundStyles = styles.background,"," contentRect = this._contentRect,"," padding = styles.padding,"," x = contentRect.left - padding.left,"," y = contentRect.top - padding.top,"," w = contentRect.right - x + padding.right,"," h = contentRect.bottom - y + padding.bottom;"," this.get(\"background\").set({"," fill: backgroundStyles.fill,"," stroke: backgroundStyles.border,"," width: w,"," height: h,"," x: x,"," y: y"," });"," },",""," /**"," * Retrieves the marker styles based on the type of series. For series that contain a marker, the marker styles are returned."," * "," * @method _getStylesBySeriesType"," * @param {CartesianSeries | PieSeries} The series in which the style properties will be received."," * @return Object An object containing fill, border and shape information."," * @private"," */"," _getStylesBySeriesType: function(series)"," {"," var styles = series.get(\"styles\"),"," color;"," if(series instanceof Y.LineSeries || series instanceof Y.StackedLineSeries)"," {"," styles = series.get(\"styles\").line;"," color = styles.color || series._getDefaultColor(series.get(\"graphOrder\"), \"line\");"," return {"," border: {"," weight: 1,"," color: color"," },"," fill: {"," color: color"," }"," };"," }"," else if(series instanceof Y.AreaSeries || series instanceof Y.StackedAreaSeries)"," {"," styles = series.get(\"styles\").area;"," color = styles.color || series._getDefaultColor(series.get(\"graphOrder\"), \"slice\");"," return {"," border: {"," weight: 1,"," color: color"," },"," fill: {"," color: color"," }"," };"," }"," else "," {"," styles = series.get(\"styles\").marker;"," return {"," fill: styles.fill,",""," border: {"," weight: styles.border.weight,",""," color: styles.border.color,",""," shape: styles.shape"," },"," shape: styles.shape"," };"," }"," },",""," /**"," * Returns a legend item consisting of the following properties:"," * <dl>"," * <dt>node</dt><dd>The `Node` containing the legend item elements.</dd>"," * <dt>shape</dt><dd>The `Shape` element for the legend item.</dd>"," * <dt>textNode</dt><dd>The `Node` containing the text></dd>"," * <dt>text</dt><dd></dd>"," * </dl>"," *"," * @method _getLegendItem"," * @param {Node} shapeProps Reference to the `node` attribute."," * @param {String | Class} shapeClass The type of shape"," * @param {Object} fill Properties for the shape's fill"," * @param {Object} border Properties for the shape's border"," * @param {String} text String to be rendered as the legend's text"," * @param {Number} width Total width of the legend item"," * @param {Number} height Total height of the legend item"," * @param {HTML | String} text Text for the legendItem"," * @return Object"," * @private"," */"," _getLegendItem: function(node, shapeClass, fill, border, labelStyles, w, h, text) "," {"," var containerNode = Y.one(DOCUMENT.createElement(\"div\")),"," textField = Y.one(DOCUMENT.createElement(\"span\")),"," shape,"," dimension,"," padding,"," left,"," item;"," containerNode.setStyle(POSITION, \"absolute\");"," textField.setStyle(POSITION, \"absolute\");"," textField.setStyles(labelStyles);"," textField.appendChild(DOCUMENT.createTextNode(text));"," containerNode.appendChild(textField);"," node.appendChild(containerNode);"," dimension = textField.get(\"offsetHeight\");"," padding = dimension - h;"," left = w + padding + 2;"," textField.setStyle(\"left\", left + PX);"," containerNode.setStyle(\"height\", dimension + PX);"," containerNode.setStyle(\"width\", (left + textField.get(\"offsetWidth\")) + PX);"," shape = new shapeClass({"," fill: fill,"," stroke: border,"," width: w,"," height: h,"," x: padding * 0.5,"," y: padding * 0.5,"," w: w,"," h: h,"," graphic: containerNode"," });"," textField.setStyle(\"left\", dimension + PX);"," item = {"," node: containerNode,"," width: containerNode.get(\"offsetWidth\"),"," height: containerNode.get(\"offsetHeight\"),"," shape: shape,"," textNode: textField,"," text: text"," };"," this._items.push(item);"," return item;"," },",""," /**"," * Evaluates and returns correct class for drawing a shape."," *"," * @method _getShapeClass"," * @return Shape"," * @private"," */"," _getShapeClass: function()"," { "," var graphic = this.get(\"background\").get(\"graphic\");"," return graphic._getShapeClass.apply(graphic, arguments);"," },"," "," /**"," * Returns the default hash for the `styles` attribute."," *"," * @method _getDefaultStyles"," * @return Object"," * @protected"," */"," _getDefaultStyles: function()"," {"," var styles = { "," padding: {"," top: 8,"," right: 8,"," bottom: 8,"," left: 9"," },"," gap: 10,"," hAlign: \"center\","," vAlign: \"top\","," marker: this._getPlotDefaults(),"," item: {"," hSpacing: 10,"," vSpacing: 5,"," label: {"," color:\"#808080\","," fontSize:\"85%\","," whiteSpace: \"nowrap\""," }"," },"," background: {"," shape: \"rect\","," fill:{"," color:\"#faf9f2\""," },"," border: {"," color:\"#dad8c9\","," weight: 1"," }"," }"," };"," return styles;"," },",""," /**"," * Gets the default values for series that use the utility. This method is used by"," * the class' `styles` attribute's getter to get build default values."," *"," * @method _getPlotDefaults"," * @return Object"," * @protected"," */"," _getPlotDefaults: function()"," {"," var defs = {"," width: 10,"," height: 10"," };"," return defs;"," },",""," /**"," * Destroys legend items."," *"," * @method _destroyLegendItems"," * @private"," */"," _destroyLegendItems: function()"," {"," var item;"," if(this._items)"," {"," while(this._items.length > 0)"," {"," item = this._items.shift();"," item.shape.get(\"graphic\").destroy();"," item.node.empty();"," item.node.destroy(true);"," item.node = null;"," item = null;"," }"," }"," this._items = [];"," },",""," /**"," * Maps layout classes."," *"," * @property _layout"," * @private"," */"," _layout: {"," vertical: VerticalLegendLayout,"," horizontal: HorizontalLegendLayout"," },",""," /**"," * Destructor implementation ChartLegend class. Removes all items and the Graphic instance from the widget."," *"," * @method destructor"," * @protected"," */"," destructor: function()"," {"," var background = this.get(\"background\"),"," backgroundGraphic;"," this._destroyLegendItems();"," if(background)"," {"," backgroundGraphic = background.get(\"graphic\");"," if(backgroundGraphic)"," {"," backgroundGraphic.destroy();"," }"," else"," {"," background.destroy();"," }"," }",""," }","}, {"," ATTRS: {"," /**"," * Indicates whether the chart's contentBox is the parentNode for the legend."," *"," * @attribute includeInChartLayout"," * @type Boolean"," * @private"," */"," includeInChartLayout: {"," value: false"," },",""," /**"," * Reference to the `Chart` instance."," *"," * @attribute chart"," * @type Chart"," */"," chart: {"," setter: function(val)"," {"," this.after(\"legendRendered\", Y.bind(val._itemRendered, val));"," return val;"," }"," },",""," /**"," * Indicates the direction in relation of the legend's layout. The `direction` of the legend is determined by its"," * `position` value."," *"," * @attribute direction"," * @type String"," */"," direction: {"," value: \"vertical\""," },"," "," /**"," * Indicates the position and direction of the legend. Possible values are `left`, `top`, `right` and `bottom`. Values of `left` and"," * `right` values have a `direction` of `vertical`. Values of `top` and `bottom` values have a `direction` of `horizontal`."," *"," * @attribute position"," * @type String"," */"," position: {"," lazyAdd: false,",""," value: \"right\",",""," setter: function(val)"," {"," if(val == TOP || val == BOTTOM)"," {"," this.set(\"direction\", HORIZONTAL);"," }"," else if(val == LEFT || val == RIGHT)"," {"," this.set(\"direction\", VERTICAL);"," }"," return val;"," }"," },"," "," /**"," * The width of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that "," * it references. Under this circumstance, `width` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the "," * direction of the legend. If the `position` is `left` or `right` or the `direction` is `vertical`, width is `readOnly`. If the position is `top` or `bottom` or the `direction`"," * is `horizontal`, width can be explicitly set. If width is not explicitly set, the width will be determined by the width of the legend's parent element."," *"," * @attribute width"," * @type Number"," */"," width: {"," getter: function()"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode)"," {"," if((chart && this.get(\"includeInChartLayout\")) || this._width)"," {"," if(!this._width)"," {"," this._width = 0;"," }"," return this._width;"," }"," else"," {"," return parentNode.get(\"offsetWidth\");"," }"," }"," return \"\";"," },",""," setter: function(val)"," {"," this._width = val;"," return val;"," }"," },",""," /**"," * The height of the legend. Depending on the implementation of the ChartLegend, this value is `readOnly`. By default, the legend is included in the layout of the `Chart` that "," * it references. Under this circumstance, `height` is always `readOnly`. When the legend is rendered in its own dom element, the `readOnly` status is determined by the "," * direction of the legend. If the `position` is `top` or `bottom` or the `direction` is `horizontal`, height is `readOnly`. If the position is `left` or `right` or the `direction`"," * is `vertical`, height can be explicitly set. If height is not explicitly set, the height will be determined by the width of the legend's parent element."," *"," * @attribute height "," * @type Number"," */"," height: {"," valueFn: \"_heightGetter\",",""," getter: function()"," {"," var chart = this.get(\"chart\"),"," parentNode = this._parentNode;"," if(parentNode) "," {"," if((chart && this.get(\"includeInChartLayout\")) || this._height)"," {"," if(!this._height)"," {"," this._height = 0;"," }"," return this._height;"," }"," else"," {"," return parentNode.get(\"offsetHeight\");"," }"," }"," return \"\";"," },",""," setter: function(val)"," {"," this._height = val;"," return val;"," }"," },",""," /**"," * Indicates the x position of legend."," *"," * @attribute x"," * @type Number"," * @readOnly"," */"," x: {"," lazyAdd: false,",""," value: 0,"," "," setter: function(val)"," {"," var node = this.get(\"boundingBox\");"," if(node)"," {"," node.setStyle(LEFT, val + PX);"," }"," return val;"," }"," },",""," /**"," * Indicates the y position of legend."," *"," * @attribute y"," * @type Number"," * @readOnly"," */"," y: {"," lazyAdd: false,",""," value: 0,"," "," setter: function(val)"," {"," var node = this.get(\"boundingBox\");"," if(node)"," {"," node.setStyle(TOP, val + PX);"," }"," return val;"," }"," },",""," /**"," * Array of items contained in the legend. Each item is an object containing the following properties:"," *"," * <dl>"," * <dt>node</dt><dd>Node containing text for the legend item.</dd>"," * <dt>marker</dt><dd>Shape for the legend item.</dd>"," * </dl>"," *"," * @attribute items"," * @type Array"," * @readOnly"," */"," items: {"," getter: function()"," {"," return this._items;"," }"," },",""," /**"," * Background for the legend."," *"," * @attribute background"," * @type Rect"," */"," background: {}",""," /**"," * Properties used to display and style the ChartLegend. This attribute is inherited from `Renderer`. Below are the default values:"," *"," * <dl>"," * <dt>gap</dt><dd>Distance, in pixels, between the `ChartLegend` instance and the chart's content. When `ChartLegend` is rendered within a `Chart` instance this value is applied.</dd>"," * <dt>hAlign</dt><dd>Defines the horizontal alignment of the `items` in a `ChartLegend` rendered in a horizontal direction. This value is applied when the instance's `position` is set to top or bottom. This attribute can be set to left, center or right. The default value is center.</dd>"," * <dt>vAlign</dt><dd>Defines the vertical alignment of the `items` in a `ChartLegend` rendered in vertical direction. This value is applied when the instance's `position` is set to left or right. The attribute can be set to top, middle or bottom. The default value is middle.</dd>"," * <dt>item</dt><dd>Set of style properties applied to the `items` of the `ChartLegend`."," * <dl>"," * <dt>hSpacing</dt><dd>Horizontal distance, in pixels, between legend `items`.</dd>"," * <dt>vSpacing</dt><dd>Vertical distance, in pixels, between legend `items`.</dd>"," * <dt>label</dt><dd>Properties for the text of an `item`."," * <dl>"," * <dt>color</dt><dd>Color of the text. The default values is \"#808080\".</dd>"," * <dt>fontSize</dt><dd>Font size for the text. The default value is \"85%\".</dd>"," * </dl>"," * </dd>"," * <dt>marker</dt><dd>Properties for the `item` markers."," * <dl>"," * <dt>width</dt><dd>Specifies the width of the markers.</dd>"," * <dt>height</dt><dd>Specifies the height of the markers.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * <dt>background</dt><dd>Properties for the `ChartLegend` background."," * <dl>"," * <dt>fill</dt><dd>Properties for the background fill."," * <dl>"," * <dt>color</dt><dd>Color for the fill. The default value is \"#faf9f2\".</dd>"," * </dl>"," * </dd>"," * <dt>border</dt><dd>Properties for the background border."," * <dl>"," * <dt>color</dt><dd>Color for the border. The default value is \"#dad8c9\".</dd>"," * <dt>weight</dt><dd>Weight of the border. The default values is 1.</dd>"," * </dl>"," * </dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @attribute styles"," * @type Object"," */"," }","});","/**"," * The Chart class is the basic application used to create a chart."," *"," * @module charts"," * @class Chart"," * @constructor"," */","function Chart(cfg)","{"," if(cfg.type != \"pie\")"," {"," return new Y.CartesianChart(cfg);"," }"," else"," {"," return new Y.PieChart(cfg);"," }","}","Y.Chart = Chart;","","","}, '3.7.3', {\"requires\": [\"charts-base\"]});"]; _yuitest_coverage["build/charts-legend/charts-legend.js"].lines = {"1":0,"9":0,"26":0,"27":0,"29":0,"31":0,"33":0,"34":0,"38":0,"39":0,"41":0,"42":0,"44":0,"46":0,"76":0,"95":0,"96":0,"97":0,"98":0,"99":0,"101":0,"102":0,"103":0,"104":0,"105":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"121":0,"123":0,"129":0,"131":0,"147":0,"155":0,"157":0,"158":0,"159":0,"161":0,"162":0,"166":0,"167":0,"169":0,"171":0,"173":0,"175":0,"176":0,"192":0,"193":0,"196":0,"197":0,"199":0,"200":0,"202":0,"203":0,"205":0,"235":0,"255":0,"256":0,"257":0,"258":0,"259":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"283":0,"285":0,"291":0,"293":0,"309":0,"317":0,"319":0,"320":0,"321":0,"323":0,"324":0,"328":0,"329":0,"331":0,"333":0,"335":0,"337":0,"338":0,"354":0,"355":0,"358":0,"359":0,"361":0,"362":0,"364":0,"365":0,"367":0,"380":0,"382":0,"383":0,"385":0,"386":0,"387":0,"420":0,"422":0,"423":0,"424":0,"426":0,"427":0,"430":0,"432":0,"433":0,"434":0,"435":0,"437":0,"438":0,"441":0,"443":0,"444":0,"445":0,"447":0,"448":0,"451":0,"453":0,"454":0,"455":0,"457":0,"458":0,"462":0,"463":0,"464":0,"465":0,"466":0,"467":0,"468":0,"470":0,"471":0,"472":0,"473":0,"475":0,"476":0,"478":0,"479":0,"481":0,"482":0,"483":0,"485":0,"490":0,"491":0,"493":0,"494":0,"496":0,"497":0,"498":0,"500":0,"505":0,"506":0,"508":0,"509":0,"511":0,"512":0,"513":0,"515":0,"520":0,"521":0,"523":0,"524":0,"526":0,"527":0,"528":0,"530":0,"535":0,"536":0,"537":0,"538":0,"539":0,"541":0,"543":0,"546":0,"547":0,"548":0,"550":0,"551":0,"552":0,"554":0,"555":0,"556":0,"558":0,"559":0,"560":0,"564":0,"566":0,"567":0,"568":0,"570":0,"571":0,"573":0,"575":0,"576":0,"578":0,"580":0,"583":0,"585":0,"586":0,"587":0,"589":0,"590":0,"592":0,"594":0,"595":0,"597":0,"599":0,"602":0,"604":0,"605":0,"606":0,"608":0,"609":0,"610":0,"611":0,"613":0,"616":0,"618":0,"621":0,"623":0,"624":0,"625":0,"627":0,"628":0,"629":0,"630":0,"632":0,"635":0,"637":0,"640":0,"641":0,"643":0,"644":0,"646":0,"648":0,"649":0,"650":0,"651":0,"652":0,"655":0,"657":0,"658":0,"659":0,"660":0,"674":0,"688":0,"690":0,"691":0,"692":0,"694":0,"695":0,"696":0,"697":0,"698":0,"701":0,"702":0,"704":0,"705":0,"707":0,"708":0,"710":0,"711":0,"715":0,"727":0,"728":0,"730":0,"739":0,"741":0,"750":0,"752":0,"753":0,"755":0,"756":0,"757":0,"773":0,"775":0,"777":0,"778":0,"779":0,"780":0,"781":0,"782":0,"783":0,"785":0,"787":0,"790":0,"791":0,"792":0,"793":0,"794":0,"796":0,"797":0,"798":0,"799":0,"800":0,"802":0,"803":0,"804":0,"805":0,"806":0,"808":0,"809":0,"810":0,"811":0,"812":0,"814":0,"815":0,"819":0,"822":0,"823":0,"825":0,"826":0,"828":0,"829":0,"831":0,"832":0,"838":0,"839":0,"840":0,"841":0,"844":0,"845":0,"847":0,"848":0,"850":0,"852":0,"853":0,"855":0,"857":0,"858":0,"872":0,"881":0,"890":0,"899":0,"907":0,"908":0,"909":0,"918":0,"919":0,"920":0,"921":0,"922":0,"931":0,"933":0,"935":0,"948":0,"950":0,"963":0,"965":0,"967":0,"969":0,"971":0,"984":0,"988":0,"990":0,"1002":0,"1004":0,"1005":0,"1007":0,"1008":0,"1009":0,"1011":0,"1013":0,"1049":0,"1051":0,"1053":0,"1054":0,"1056":0,"1057":0,"1058":0,"1059":0,"1060":0,"1061":0,"1062":0,"1063":0,"1064":0,"1065":0,"1066":0,"1068":0,"1069":0,"1072":0,"1076":0,"1077":0,"1078":0,"1079":0,"1080":0,"1081":0,"1082":0,"1083":0,"1084":0,"1089":0,"1090":0,"1091":0,"1093":0,"1094":0,"1095":0,"1097":0,"1098":0,"1100":0,"1103":0,"1104":0,"1105":0,"1106":0,"1107":0,"1108":0,"1109":0,"1110":0,"1111":0,"1114":0,"1115":0,"1117":0,"1121":0,"1122":0,"1123":0,"1136":0,"1143":0,"1163":0,"1165":0,"1167":0,"1168":0,"1169":0,"1179":0,"1181":0,"1182":0,"1183":0,"1195":0,"1196":0,"1234":0,"1241":0,"1242":0,"1243":0,"1244":0,"1245":0,"1246":0,"1247":0,"1248":0,"1249":0,"1250":0,"1251":0,"1252":0,"1253":0,"1264":0,"1265":0,"1273":0,"1274":0,"1286":0,"1287":0,"1299":0,"1330":0,"1343":0,"1347":0,"1358":0,"1359":0,"1361":0,"1363":0,"1364":0,"1365":0,"1366":0,"1367":0,"1368":0,"1371":0,"1393":0,"1395":0,"1396":0,"1398":0,"1399":0,"1401":0,"1405":0,"1432":0,"1433":0,"1462":0,"1464":0,"1466":0,"1468":0,"1470":0,"1486":0,"1488":0,"1490":0,"1492":0,"1494":0,"1496":0,"1500":0,"1503":0,"1508":0,"1509":0,"1527":0,"1529":0,"1531":0,"1533":0,"1535":0,"1537":0,"1541":0,"1544":0,"1549":0,"1550":0,"1568":0,"1569":0,"1571":0,"1573":0,"1591":0,"1592":0,"1594":0,"1596":0,"1615":0,"1681":0,"1683":0,"1685":0,"1689":0,"1692":0}; _yuitest_coverage["build/charts-legend/charts-legend.js"].functions = {"setter:24":0,"_positionLegendItems:74":0,"_setRowArrays:145":0,"getStartPoint:190":0,"_positionLegendItems:233":0,"_setColumnArrays:307":0,"getStartPoint:352":0,"_redraw:378":0,"_getLayoutBoxDimensions:672":0,"destructor:725":0,"_redraw:748":0,"initializer:888":0,"renderUI:897":0,"bindUI:916":0,"syncUI:929":0,"_updateHandler:946":0,"_positionChangeHandler:961":0,"_handleSizeChange:982":0,"_drawLegend:1000":0,"_updateBackground:1134":0,"_getStylesBySeriesType:1161":0,"_getLegendItem:1232":0,"_getShapeClass:1284":0,"_getDefaultStyles:1297":0,"_getPlotDefaults:1341":0,"_destroyLegendItems:1356":0,"destructor:1391":0,"setter:1430":0,"setter:1460":0,"getter:1484":0,"setter:1506":0,"getter:1525":0,"setter:1547":0,"setter:1566":0,"setter:1589":0,"getter:1613":0,"Chart:1681":0,"(anonymous 1):1":0}; _yuitest_coverage["build/charts-legend/charts-legend.js"].coveredLines = 535;@@ -2304,4 +2304,4 @@ Y.Chart = Chart; -}, '3.7.2', {"requires": ["charts-base"]});+}, '3.7.3', {"requires": ["charts-base"]});
bundle/charts-legend/charts-legend-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1698,4 +1698,4 @@ Y.Chart = Chart; -}, '3.7.2', {"requires": ["charts-base"]});+}, '3.7.3', {"requires": ["charts-base"]});
bundle/charts-legend/charts-legend-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("charts-legend",function(e,t){function E(t){return t.type!="pie"?new e.CartesianChart(t):new e.PieChart(t)}var n=e.config.doc,r="top",i="right",s="bottom",o="left",u="external",a="horizontal",f="vertical",l="width",c="height",h="position",p="x",d="y",v="px",m={setter:function(t){var n=this.get("legend");return n&&n.destroy(!0),t instanceof e.ChartLegend?(n=t,n.set("chart",this)):(t.chart=this,t.hasOwnProperty("render")||(t.render=this.get("contentBox"),t.includeInChartLayout=!0),n=new e.ChartLegend(t)),n}},g={_positionLegendItems:function(e,t,n,r,i,s,o,u,a,f){var l=0,c=0,h,p,d,m,y,b=this.get("width"),w,E,S,x,T,N=s.top-u,C=b-(s.left+s.right),k,L,A,O;g._setRowArrays(e,C,o),w=g.rowArray,x=g.totalWidthArray,E=w.length;for(;c<E;++c){N+=u,S=w[c],y=S.length,T=g.getStartPoint(b,x[c],a,s);for(l=0;l<y;++l)h=S[l],p=h.node,d=h.width,m=h.height,h.x=T,h.y=0,k=isNaN(k)?T:Math.min(k,T),L=isNaN(L)?N:Math.min(L,N),A=isNaN(A)?T+d:Math.max(T+d,A),O=isNaN(O)?N+m:Math.max(N+m,O),p.setStyle("left",T+v),p.setStyle("top",N+v),T+=d+o;N+=h.height}this._contentRect={left:k,top:L,right:A,bottom:O},this.get("includeInChartLayout")&&this.set("height",N+s.bottom)},_setRowArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.width,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.width,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;g.rowArray=i,g.totalWidthArray=l},getStartPoint:function(e,t,n,r){var s;switch(n){case o:s=r.left;break;case"center":s=(e-t)*.5;break;case i:s=e-t-r.right}return s}},y={_positionLegendItems:function(e,t,n,r,i,s,o,u,a,f){var l=0,c=0,h,p,d,m,g,b=this.get("height"),w,E,S,x,T,N=s.left-o,C,k=b-(s.top+s.bottom),L,A,O,M;y._setColumnArrays(e,k,u),w=y.columnArray,x=y.totalHeightArray,E=w.length;for(;c<E;++c){N+=o,S=w[c],g=S.length,T=y.getStartPoint(b,x[c],f,s),C=0;for(l=0;l<g;++l)h=S[l],p=h.node,d=h.height,m=h.width,h.y=T,h.x=N,L=isNaN(L)?N:Math.min(L,N),A=isNaN(A)?T:Math.min(A,T),O=isNaN(O)?N+m:Math.max(N+m,O),M=isNaN(M)?T+d:Math.max(T+d,M),p.setStyle("left",N+v),p.setStyle("top",T+v),T+=d+u,C=Math.max(C,h.width);N+=C}this._contentRect={left:L,top:A,right:O,bottom:M},this.get("includeInChartLayout")&&this.set("width",N+s.right)},_setColumnArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.height,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.height,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;y.columnArray=i,y.totalHeightArray=l},getStartPoint:function(e,t,n,i){var o;switch(n){case r:o=i.top;break;case"middle":o=(e-t)*.5;break;case s:o=e-t-i.bottom}return o}},b=e.Base.create("cartesianChartLegend",e.CartesianChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=this._getLayoutBoxDimensions(),r=n.left,i=n.right,s=n.top,o=n.bottom,u=this.get("leftAxesCollection"),a=this.get("rightAxesCollection"),f=this.get("topAxesCollection"),l=this.get("bottomAxesCollection"),c=0,h,p,d="visible",m=this.get("graph"),g,y,b,w,E,S,x,T,N=this.get("allowContentOverflow"),C,k,L,A,O,M=this.get("legend"),_={};if(u){L=[],h=u.length;for(c=h-1;c>-1;--c)L.unshift(r),r+=u[c].get("width")}if(a){k=[],h=a.length,c=0;for(c=h-1;c>-1;--c)i+=a[c].get("width"),k.unshift(e-i)}if(f){A=[],h=f.length;for(c=h-1;c>-1;--c)A.unshift(s),s+=f[c].get("height")}if(l){O=[],h=l.length;for(c=h-1;c>-1;--c)o+=l[c].get("height"),O.unshift(t-o)}E=e-(r+i),S=t-(o+s),_.left=r,_.top=s,_.bottom=t-o,_.right=e-i;if(!N){g=this._getTopOverflow(u,a),y=this._getBottomOverflow(u,a),b=this._getLeftOverflow(l,f),w=this._getRightOverflow(l,f),C=g-s;if(C>0){_.top=g;if(A){c=0,h=A.length;for(;c<h;++c)A[c]+=C}}C=y-o;if(C>0){_.bottom=t-y;if(O){c=0,h=O.length;for(;c<h;++c)O[c]-=C}}C=b-r;if(C>0){_.left=b;if(L){c=0,h=L.length;for(;c<h;++c)L[c]+=C}}C=w-i;if(C>0){_.right=e-w;if(k){c=0,h=k.length;for(;c<h;++c)k[c]-=C}}}E=_.right-_.left,S=_.bottom-_.top,x=_.left,T=_.top;if(M&&M.get("includeInChartLayout"))switch(M.get("position")){case"left":M.set("y",T),M.set("height",S);break;case"top":M.set("x",x),M.set("width",E);break;case"bottom":M.set("x",x),M.set("width",E);break;case"right":M.set("y",T),M.set("height",S)}if(f){h=f.length,c=0;for(;c<h;c++)p=f[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",A[c]+v);p._hasDataOverflow()&&(d="hidden")}if(l){h=l.length,c=0;for(;c<h;c++)p=l[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",O[c]+v);p._hasDataOverflow()&&(d="hidden")}if(u){h=u.length,c=0;for(;c<h;++c)p=u[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",L[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}if(a){h=a.length,c=0;for(;c<h;++c)p=a[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",k[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}m&&(m.get("boundingBox").setStyle("left",x+v),m.get("boundingBox").setStyle("top",T+v),m.set("width",E),m.set("height",S),m.get("boundingBox").setStyle("overflow",d)),this._overlay&&(this._overlay.setStyle("left",x+v),this._overlay.setStyle("top",T+v),this._overlay.setStyle("width",E+v),this._overlay.setStyle("height",S+v))},_getLayoutBoxDimensions:function(){var e={top:0,right:0,bottom:0,left:0},t=this.get("legend"),n,f,v,m,g=this.get(l),y=this.get(c),b;if(t&&t.get("includeInChartLayout")){b=t.get("styles").gap,n=t.get(h);if(n!=u){f=t.get("direction"),v=f==a?c:l,m=t.get(v),e[n]=m+b;switch(n){case r:t.set(d,0);break;case s:t.set(d,y-m);break;case i:t.set(p,g-m);break;case o:t.set(p,0)}}}return e},destructor:function(){var e=this.get("legend");e&&e.destroy(!0)}},{ATTRS:{legend:m}});e.CartesianChart=b;var w=e.Base.create("pieChartLegend",e.PieChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("graph"),t=this.get("width"),n=this.get("height"),u,a,f=this.get("legend"),h=0,v=0,m=0,g=0,y,b,w,E,S,x;if(e)if(f){S=f.get("position"),x=f.get("direction"),u=e.get("width"),a=e.get("height"),y=f.get("width"),b=f.get("height"),E=f.get("styles").gap;if(x=="vertical"&&u+y+E!==t||x=="horizontal"&&a+b+E!==n){switch(f.get("position")){case o:w=Math.min(t-(y+E),n),b=n,h=y+E,f.set(c,b);break;case r:w=Math.min(n-(b+E),t),y=t,v=b+E,f.set(l,y);break;case i:w=Math.min(t-(y+E),n),b=n,m=w+E,f.set(c,b);break;case s:w=Math.min(n-(b+E),t),y=t,g=w+E,f.set(l,y)}e.set(l,w),e.set(c,w)}else switch(f.get("position")){case o:h=y+E;break;case r:v=b+E;break;case i:m=u+E;break;case s:g=a+E}}else e.set(p,0),e.set(d,0),e.set(l,t),e.set(c,n);this._drawing=!1;if(this._callLater){this._redraw();return}e&&(e.set(p,h),e.set(d,v)),f&&(f.set(p,m),f.set(d,g))}},{ATTRS:{legend:m}});e.PieChart=w,e.ChartLegend=e.Base.create("chartlegend",e.Widget,[e.Renderer],{initializer:function(){this._items=[]},renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("styles").background,i=new e.Rect({graphic:n,fill:r.fill,stroke:r.border});t.setStyle("display","block"),t.setStyle("position","absolute"),this.set("background",i)},bindUI:function(){this.get("chart").after("seriesCollectionChange",e.bind(this._updateHandler,this)),this.after("stylesChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange)},syncUI:function(){var e=this.get("width"),t=this.get("height");isFinite(e)&&isFinite(t)&&e>0&&t>0&&this._drawLegend()},_updateHandler:function(e){this.get("rendered")&&this._drawLegend()},_positionChangeHandler:function(e){var t=this.get("chart"),n=this._parentNode;n&&t&&this.get("includeInChartLayout")?this.fire("legendRendered"):this.get("rendered")&&this._drawLegend()},_handleSizeChange:function(e){var t=e.attrName,n=this.get(h),u=n==o||n==i,a=n==s||n==r;(a&&t==l||u&&t==c)&&this._drawLegend()},_drawLegend:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.get("includeInChartLayout")&&this.get("chart")._itemRenderQueue.unshift(this);var t=this.get("chart"),n=this.get("contentBox"),r=t.get("seriesCollection"),i,s=this.get("styles"),o=s.padding,u=s.item,a,f=u.hSpacing,l=u.vSpacing,c=s.hAlign,h=s.vAlign,p=s.marker,d=u.label,v,m=this._layout[this.get("direction")],g,y,b,w,E,S,x,T,N,C,k,L=[],A=p.width,O=p.height,M=0-f,_=0-l,D=0,P=0,H,B;p&&p.shape&&(w=p.shape),this._destroyLegendItems();if(t instanceof e.PieChart){i=r[0],v=i.get("categoryAxis").getDataByKey(i.get("categoryKey")),a=i.get("styles").marker,N=a.fill.colors,C=a.border.colors,k=a.border.weight,g=0,y=v.length,w=w||e.Circle,b=e.Lang.isArray(w);for(;g<y;++g)w=b?w[g]:w,x={color:N[g]},T={colors:C[g],weight:k},v=t.getSeriesItems(i,g).category.value,S=this._getLegendItem(n,this._getShapeClass(w),x,T,d,A,O,v),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}else{g=0,y=r.length;for(;g<y;++g)i=r[g],a=this._getStylesBySeriesType(i,w),w||(w=a.shape,w||(w=e.Circle)),E=e.Lang.isArray(w)?w[g]:w,S=this._getLegendItem(n,this._getShapeClass(w),a.fill,a.border,d,A,O,i.get("valueDisplayName")),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}this._drawing=!1,this._callLater?this._drawLegend():(m._positionLegendItems.apply(this,[L,D,P,M,_,o,f,l,c,h]),this._updateBackground(s),this.fire("legendRendered"))},_updateBackground:function(e){var t=e.background,n=this._contentRect,r=e.padding,i=n.left-r.left,s=n.top-r.top,o=n.right-i+r.right,u=n.bottom-s+r.bottom;this.get("background").set({fill:t.fill,stroke:t.border,width:o,height:u,x:i,y:s})},_getStylesBySeriesType:function(t){var n=t.get("styles"),r;return t instanceof e.LineSeries||t instanceof e.StackedLineSeries?(n=t.get("styles").line,r=n.color||t._getDefaultColor(t.get("graphOrder"),"line"),{border:{weight:1,color:r},fill:{color:r}}):t instanceof e.AreaSeries||t instanceof e.StackedAreaSeries?(n=t.get("styles").area,r=n.color||t._getDefaultColor(t.get("graphOrder"),"slice"),{border:{weight:1,color:r},fill:{color:r}}):(n=t.get("styles").marker,{fill:n.fill,border:{weight:n.border.weight,color:n.border.color,shape:n.shape},shape:n.shape})},_getLegendItem:function(t,r,i,s,o,u,a,f){var l=e.one(n.createElement("div")),c=e.one(n.createElement("span")),p,d,m,g,y;return l.setStyle(h,"absolute"),c.setStyle(h,"absolute"),c.setStyles(o),c.appendChild(n.createTextNode(f)),l.appendChild(c),t.appendChild(l),d=c.get("offsetHeight"),m=d-a,g=u+m+2,c.setStyle("left",g+v),l.setStyle("height",d+v),l.setStyle("width",g+c.get("offsetWidth")+v),p=new r({fill:i,stroke:s,width:u,height:a,x:m*.5,y:m*.5,w:u,h:a,graphic:l}),c.setStyle("left",d+v),y={node:l,width:l.get("offsetWidth"),height:l.get("offsetHeight"),shape:p,textNode:c,text:f},this._items.push(y),y},_getShapeClass:function(){var e=this.get("background").get("graphic");return e._getShapeClass.apply(e,arguments)},_getDefaultStyles:function(){var e={padding:{top:8,right:8,bottom:8,left:9},gap:10,hAlign:"center",vAlign:"top",marker:this._getPlotDefaults(),item:{hSpacing:10,vSpacing:5,label:{color:"#808080",fontSize:"85%",whiteSpace:"nowrap"}},background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},_getPlotDefaults:function(){var e={width:10,height:10};return e},_destroyLegendItems:function(){var e;if(this._items)while(this._items.length>0)e=this._items.shift(),e.shape.get("graphic").destroy(),e.node.empty(),e.node.destroy(!0),e.node=null,e=null;this._items=[]},_layout:{vertical:y,horizontal:g},destructor:function(){var e=this.get("background"),t;this._destroyLegendItems(),e&&(t=e.get("graphic"),t?t.destroy():e.destroy())}},{ATTRS:{includeInChartLayout:{value:!1},chart:{setter:function(t){return this.after("legendRendered",e.bind(t._itemRendered,t)),t}},direction:{value:"vertical"},position:{lazyAdd:!1,value:"right",setter:function(e){return e==r||e==s?this.set("direction",a):(e==o||e==i)&&this.set("direction",f),e}},width:{getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._width?(this._width||(this._width=0),this._width):t.get("offsetWidth"):""},setter:function(e){return this._width=e,e}},height:{valueFn:"_heightGetter",getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._height?(this._height||(this._height=0),this._height):t.get("offsetHeight"):""},setter:function(e){return this._height=e,e}},x:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(o,e+v),e}},y:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(r,e+v),e}},items:{getter:function(){return this._items}},background:{}}}),e.Chart=E},"3.7.2",{requires:["charts-base"]});+YUI.add("charts-legend",function(e,t){function E(t){return t.type!="pie"?new e.CartesianChart(t):new e.PieChart(t)}var n=e.config.doc,r="top",i="right",s="bottom",o="left",u="external",a="horizontal",f="vertical",l="width",c="height",h="position",p="x",d="y",v="px",m={setter:function(t){var n=this.get("legend");return n&&n.destroy(!0),t instanceof e.ChartLegend?(n=t,n.set("chart",this)):(t.chart=this,t.hasOwnProperty("render")||(t.render=this.get("contentBox"),t.includeInChartLayout=!0),n=new e.ChartLegend(t)),n}},g={_positionLegendItems:function(e,t,n,r,i,s,o,u,a,f){var l=0,c=0,h,p,d,m,y,b=this.get("width"),w,E,S,x,T,N=s.top-u,C=b-(s.left+s.right),k,L,A,O;g._setRowArrays(e,C,o),w=g.rowArray,x=g.totalWidthArray,E=w.length;for(;c<E;++c){N+=u,S=w[c],y=S.length,T=g.getStartPoint(b,x[c],a,s);for(l=0;l<y;++l)h=S[l],p=h.node,d=h.width,m=h.height,h.x=T,h.y=0,k=isNaN(k)?T:Math.min(k,T),L=isNaN(L)?N:Math.min(L,N),A=isNaN(A)?T+d:Math.max(T+d,A),O=isNaN(O)?N+m:Math.max(N+m,O),p.setStyle("left",T+v),p.setStyle("top",N+v),T+=d+o;N+=h.height}this._contentRect={left:k,top:L,right:A,bottom:O},this.get("includeInChartLayout")&&this.set("height",N+s.bottom)},_setRowArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.width,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.width,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;g.rowArray=i,g.totalWidthArray=l},getStartPoint:function(e,t,n,r){var s;switch(n){case o:s=r.left;break;case"center":s=(e-t)*.5;break;case i:s=e-t-r.right}return s}},y={_positionLegendItems:function(e,t,n,r,i,s,o,u,a,f){var l=0,c=0,h,p,d,m,g,b=this.get("height"),w,E,S,x,T,N=s.left-o,C,k=b-(s.top+s.bottom),L,A,O,M;y._setColumnArrays(e,k,u),w=y.columnArray,x=y.totalHeightArray,E=w.length;for(;c<E;++c){N+=o,S=w[c],g=S.length,T=y.getStartPoint(b,x[c],f,s),C=0;for(l=0;l<g;++l)h=S[l],p=h.node,d=h.height,m=h.width,h.y=T,h.x=N,L=isNaN(L)?N:Math.min(L,N),A=isNaN(A)?T:Math.min(A,T),O=isNaN(O)?N+m:Math.max(N+m,O),M=isNaN(M)?T+d:Math.max(T+d,M),p.setStyle("left",N+v),p.setStyle("top",T+v),T+=d+u,C=Math.max(C,h.width);N+=C}this._contentRect={left:L,top:A,right:O,bottom:M},this.get("includeInChartLayout")&&this.set("width",N+s.right)},_setColumnArrays:function(e,t,n){var r=e[0],i=[[r]],s=1,o=0,u=e.length,a=r.height,f,l=[[a]];for(;s<u;++s)r=e[s],f=r.height,a+n+f<=t?(a+=n+f,i[o].push(r)):(a=n+f,i[o]&&(o+=1),i[o]=[r]),l[o]=a;y.columnArray=i,y.totalHeightArray=l},getStartPoint:function(e,t,n,i){var o;switch(n){case r:o=i.top;break;case"middle":o=(e-t)*.5;break;case s:o=e-t-i.bottom}return o}},b=e.Base.create("cartesianChartLegend",e.CartesianChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("width"),t=this.get("height"),n=this._getLayoutBoxDimensions(),r=n.left,i=n.right,s=n.top,o=n.bottom,u=this.get("leftAxesCollection"),a=this.get("rightAxesCollection"),f=this.get("topAxesCollection"),l=this.get("bottomAxesCollection"),c=0,h,p,d="visible",m=this.get("graph"),g,y,b,w,E,S,x,T,N=this.get("allowContentOverflow"),C,k,L,A,O,M=this.get("legend"),_={};if(u){L=[],h=u.length;for(c=h-1;c>-1;--c)L.unshift(r),r+=u[c].get("width")}if(a){k=[],h=a.length,c=0;for(c=h-1;c>-1;--c)i+=a[c].get("width"),k.unshift(e-i)}if(f){A=[],h=f.length;for(c=h-1;c>-1;--c)A.unshift(s),s+=f[c].get("height")}if(l){O=[],h=l.length;for(c=h-1;c>-1;--c)o+=l[c].get("height"),O.unshift(t-o)}E=e-(r+i),S=t-(o+s),_.left=r,_.top=s,_.bottom=t-o,_.right=e-i;if(!N){g=this._getTopOverflow(u,a),y=this._getBottomOverflow(u,a),b=this._getLeftOverflow(l,f),w=this._getRightOverflow(l,f),C=g-s;if(C>0){_.top=g;if(A){c=0,h=A.length;for(;c<h;++c)A[c]+=C}}C=y-o;if(C>0){_.bottom=t-y;if(O){c=0,h=O.length;for(;c<h;++c)O[c]-=C}}C=b-r;if(C>0){_.left=b;if(L){c=0,h=L.length;for(;c<h;++c)L[c]+=C}}C=w-i;if(C>0){_.right=e-w;if(k){c=0,h=k.length;for(;c<h;++c)k[c]-=C}}}E=_.right-_.left,S=_.bottom-_.top,x=_.left,T=_.top;if(M&&M.get("includeInChartLayout"))switch(M.get("position")){case"left":M.set("y",T),M.set("height",S);break;case"top":M.set("x",x),M.set("width",E);break;case"bottom":M.set("x",x),M.set("width",E);break;case"right":M.set("y",T),M.set("height",S)}if(f){h=f.length,c=0;for(;c<h;c++)p=f[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",A[c]+v);p._hasDataOverflow()&&(d="hidden")}if(l){h=l.length,c=0;for(;c<h;c++)p=l[c],p.get("width")!==E&&p.set("width",E),p.get("boundingBox").setStyle("left",x+v),p.get("boundingBox").setStyle("top",O[c]+v);p._hasDataOverflow()&&(d="hidden")}if(u){h=u.length,c=0;for(;c<h;++c)p=u[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",L[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}if(a){h=a.length,c=0;for(;c<h;++c)p=a[c],p.get("boundingBox").setStyle("top",T+v),p.get("boundingBox").setStyle("left",k[c]+v),p.get("height")!==S&&p.set("height",S);p._hasDataOverflow()&&(d="hidden")}this._drawing=!1;if(this._callLater){this._redraw();return}m&&(m.get("boundingBox").setStyle("left",x+v),m.get("boundingBox").setStyle("top",T+v),m.set("width",E),m.set("height",S),m.get("boundingBox").setStyle("overflow",d)),this._overlay&&(this._overlay.setStyle("left",x+v),this._overlay.setStyle("top",T+v),this._overlay.setStyle("width",E+v),this._overlay.setStyle("height",S+v))},_getLayoutBoxDimensions:function(){var e={top:0,right:0,bottom:0,left:0},t=this.get("legend"),n,f,v,m,g=this.get(l),y=this.get(c),b;if(t&&t.get("includeInChartLayout")){b=t.get("styles").gap,n=t.get(h);if(n!=u){f=t.get("direction"),v=f==a?c:l,m=t.get(v),e[n]=m+b;switch(n){case r:t.set(d,0);break;case s:t.set(d,y-m);break;case i:t.set(p,g-m);break;case o:t.set(p,0)}}}return e},destructor:function(){var e=this.get("legend");e&&e.destroy(!0)}},{ATTRS:{legend:m}});e.CartesianChart=b;var w=e.Base.create("pieChartLegend",e.PieChart,[],{_redraw:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1;var e=this.get("graph"),t=this.get("width"),n=this.get("height"),u,a,f=this.get("legend"),h=0,v=0,m=0,g=0,y,b,w,E,S,x;if(e)if(f){S=f.get("position"),x=f.get("direction"),u=e.get("width"),a=e.get("height"),y=f.get("width"),b=f.get("height"),E=f.get("styles").gap;if(x=="vertical"&&u+y+E!==t||x=="horizontal"&&a+b+E!==n){switch(f.get("position")){case o:w=Math.min(t-(y+E),n),b=n,h=y+E,f.set(c,b);break;case r:w=Math.min(n-(b+E),t),y=t,v=b+E,f.set(l,y);break;case i:w=Math.min(t-(y+E),n),b=n,m=w+E,f.set(c,b);break;case s:w=Math.min(n-(b+E),t),y=t,g=w+E,f.set(l,y)}e.set(l,w),e.set(c,w)}else switch(f.get("position")){case o:h=y+E;break;case r:v=b+E;break;case i:m=u+E;break;case s:g=a+E}}else e.set(p,0),e.set(d,0),e.set(l,t),e.set(c,n);this._drawing=!1;if(this._callLater){this._redraw();return}e&&(e.set(p,h),e.set(d,v)),f&&(f.set(p,m),f.set(d,g))}},{ATTRS:{legend:m}});e.PieChart=w,e.ChartLegend=e.Base.create("chartlegend",e.Widget,[e.Renderer],{initializer:function(){this._items=[]},renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("styles").background,i=new e.Rect({graphic:n,fill:r.fill,stroke:r.border});t.setStyle("display","block"),t.setStyle("position","absolute"),this.set("background",i)},bindUI:function(){this.get("chart").after("seriesCollectionChange",e.bind(this._updateHandler,this)),this.after("stylesChange",this._updateHandler),this.after("positionChange",this._positionChangeHandler),this.after("widthChange",this._handleSizeChange),this.after("heightChange",this._handleSizeChange)},syncUI:function(){var e=this.get("width"),t=this.get("height");isFinite(e)&&isFinite(t)&&e>0&&t>0&&this._drawLegend()},_updateHandler:function(e){this.get("rendered")&&this._drawLegend()},_positionChangeHandler:function(e){var t=this.get("chart"),n=this._parentNode;n&&t&&this.get("includeInChartLayout")?this.fire("legendRendered"):this.get("rendered")&&this._drawLegend()},_handleSizeChange:function(e){var t=e.attrName,n=this.get(h),u=n==o||n==i,a=n==s||n==r;(a&&t==l||u&&t==c)&&this._drawLegend()},_drawLegend:function(){if(this._drawing){this._callLater=!0;return}this._drawing=!0,this._callLater=!1,this.get("includeInChartLayout")&&this.get("chart")._itemRenderQueue.unshift(this);var t=this.get("chart"),n=this.get("contentBox"),r=t.get("seriesCollection"),i,s=this.get("styles"),o=s.padding,u=s.item,a,f=u.hSpacing,l=u.vSpacing,c=s.hAlign,h=s.vAlign,p=s.marker,d=u.label,v,m=this._layout[this.get("direction")],g,y,b,w,E,S,x,T,N,C,k,L=[],A=p.width,O=p.height,M=0-f,_=0-l,D=0,P=0,H,B;p&&p.shape&&(w=p.shape),this._destroyLegendItems();if(t instanceof e.PieChart){i=r[0],v=i.get("categoryAxis").getDataByKey(i.get("categoryKey")),a=i.get("styles").marker,N=a.fill.colors,C=a.border.colors,k=a.border.weight,g=0,y=v.length,w=w||e.Circle,b=e.Lang.isArray(w);for(;g<y;++g)w=b?w[g]:w,x={color:N[g]},T={colors:C[g],weight:k},v=t.getSeriesItems(i,g).category.value,S=this._getLegendItem(n,this._getShapeClass(w),x,T,d,A,O,v),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}else{g=0,y=r.length;for(;g<y;++g)i=r[g],a=this._getStylesBySeriesType(i,w),w||(w=a.shape,w||(w=e.Circle)),E=e.Lang.isArray(w)?w[g]:w,S=this._getLegendItem(n,this._getShapeClass(w),a.fill,a.border,d,A,O,i.get("valueDisplayName")),H=S.width,B=S.height,D=Math.max(D,H),P=Math.max(P,B),M+=H+f,_+=B+l,L.push(S)}this._drawing=!1,this._callLater?this._drawLegend():(m._positionLegendItems.apply(this,[L,D,P,M,_,o,f,l,c,h]),this._updateBackground(s),this.fire("legendRendered"))},_updateBackground:function(e){var t=e.background,n=this._contentRect,r=e.padding,i=n.left-r.left,s=n.top-r.top,o=n.right-i+r.right,u=n.bottom-s+r.bottom;this.get("background").set({fill:t.fill,stroke:t.border,width:o,height:u,x:i,y:s})},_getStylesBySeriesType:function(t){var n=t.get("styles"),r;return t instanceof e.LineSeries||t instanceof e.StackedLineSeries?(n=t.get("styles").line,r=n.color||t._getDefaultColor(t.get("graphOrder"),"line"),{border:{weight:1,color:r},fill:{color:r}}):t instanceof e.AreaSeries||t instanceof e.StackedAreaSeries?(n=t.get("styles").area,r=n.color||t._getDefaultColor(t.get("graphOrder"),"slice"),{border:{weight:1,color:r},fill:{color:r}}):(n=t.get("styles").marker,{fill:n.fill,border:{weight:n.border.weight,color:n.border.color,shape:n.shape},shape:n.shape})},_getLegendItem:function(t,r,i,s,o,u,a,f){var l=e.one(n.createElement("div")),c=e.one(n.createElement("span")),p,d,m,g,y;return l.setStyle(h,"absolute"),c.setStyle(h,"absolute"),c.setStyles(o),c.appendChild(n.createTextNode(f)),l.appendChild(c),t.appendChild(l),d=c.get("offsetHeight"),m=d-a,g=u+m+2,c.setStyle("left",g+v),l.setStyle("height",d+v),l.setStyle("width",g+c.get("offsetWidth")+v),p=new r({fill:i,stroke:s,width:u,height:a,x:m*.5,y:m*.5,w:u,h:a,graphic:l}),c.setStyle("left",d+v),y={node:l,width:l.get("offsetWidth"),height:l.get("offsetHeight"),shape:p,textNode:c,text:f},this._items.push(y),y},_getShapeClass:function(){var e=this.get("background").get("graphic");return e._getShapeClass.apply(e,arguments)},_getDefaultStyles:function(){var e={padding:{top:8,right:8,bottom:8,left:9},gap:10,hAlign:"center",vAlign:"top",marker:this._getPlotDefaults(),item:{hSpacing:10,vSpacing:5,label:{color:"#808080",fontSize:"85%",whiteSpace:"nowrap"}},background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}};return e},_getPlotDefaults:function(){var e={width:10,height:10};return e},_destroyLegendItems:function(){var e;if(this._items)while(this._items.length>0)e=this._items.shift(),e.shape.get("graphic").destroy(),e.node.empty(),e.node.destroy(!0),e.node=null,e=null;this._items=[]},_layout:{vertical:y,horizontal:g},destructor:function(){var e=this.get("background"),t;this._destroyLegendItems(),e&&(t=e.get("graphic"),t?t.destroy():e.destroy())}},{ATTRS:{includeInChartLayout:{value:!1},chart:{setter:function(t){return this.after("legendRendered",e.bind(t._itemRendered,t)),t}},direction:{value:"vertical"},position:{lazyAdd:!1,value:"right",setter:function(e){return e==r||e==s?this.set("direction",a):(e==o||e==i)&&this.set("direction",f),e}},width:{getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._width?(this._width||(this._width=0),this._width):t.get("offsetWidth"):""},setter:function(e){return this._width=e,e}},height:{valueFn:"_heightGetter",getter:function(){var e=this.get("chart"),t=this._parentNode;return t?e&&this.get("includeInChartLayout")||this._height?(this._height||(this._height=0),this._height):t.get("offsetHeight"):""},setter:function(e){return this._height=e,e}},x:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(o,e+v),e}},y:{lazyAdd:!1,value:0,setter:function(e){var t=this.get("boundingBox");return t&&t.setStyle(r,e+v),e}},items:{getter:function(){return this._items}},background:{}}}),e.Chart=E},"3.7.3",{requires:["charts-base"]});
bundle/charts-legend/charts-legend.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1698,4 +1698,4 @@ Y.Chart = Chart; -}, '3.7.2', {"requires": ["charts-base"]});+}, '3.7.3', {"requires": ["charts-base"]});
bundle/charts/charts-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/charts/charts.js", code: [] };-_yuitest_coverage["build/charts/charts.js"].code=["YUI.add('charts', function (Y, NAME) {","","/**"," * The Chart class is the basic application used to create a chart."," *"," * @module charts"," * @class Chart"," * @constructor"," */","function Chart(cfg)","{"," if(cfg.type != \"pie\")"," {"," return new Y.CartesianChart(cfg);"," }"," else"," {"," return new Y.PieChart(cfg);"," }","}","Y.Chart = Chart;","","","}, '3.7.2', {\"requires\": [\"charts-base\"]});"];+_yuitest_coverage["build/charts/charts.js"].code=["YUI.add('charts', function (Y, NAME) {","","/**"," * The Chart class is the basic application used to create a chart."," *"," * @module charts"," * @class Chart"," * @constructor"," */","function Chart(cfg)","{"," if(cfg.type != \"pie\")"," {"," return new Y.CartesianChart(cfg);"," }"," else"," {"," return new Y.PieChart(cfg);"," }","}","Y.Chart = Chart;","","","}, '3.7.3', {\"requires\": [\"charts-base\"]});"]; _yuitest_coverage["build/charts/charts.js"].lines = {"1":0,"10":0,"12":0,"14":0,"18":0,"21":0}; _yuitest_coverage["build/charts/charts.js"].functions = {"Chart:10":0,"(anonymous 1):1":0}; _yuitest_coverage["build/charts/charts.js"].coveredLines = 6;@@ -68,4 +68,4 @@ Y.Chart = Chart; -}, '3.7.2', {"requires": ["charts-base"]});+}, '3.7.3', {"requires": ["charts-base"]});
bundle/charts/charts-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -27,4 +27,4 @@ Y.Chart = Chart; -}, '3.7.2', {"requires": ["charts-base"]});+}, '3.7.3', {"requires": ["charts-base"]});
bundle/charts/charts-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("charts",function(e,t){function n(t){return t.type!="pie"?new e.CartesianChart(t):new e.PieChart(t)}e.Chart=n},"3.7.2",{requires:["charts-base"]});+YUI.add("charts",function(e,t){function n(t){return t.type!="pie"?new e.CartesianChart(t):new e.PieChart(t)}e.Chart=n},"3.7.3",{requires:["charts-base"]});
bundle/charts/charts.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -27,4 +27,4 @@ Y.Chart = Chart; -}, '3.7.2', {"requires": ["charts-base"]});+}, '3.7.3', {"requires": ["charts-base"]});
bundle/classnamemanager/classnamemanager-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/classnamemanager/classnamemanager.js", code: [] };-_yuitest_coverage["build/classnamemanager/classnamemanager.js"].code=["YUI.add('classnamemanager', function (Y, NAME) {","","/**","* Contains a singleton (ClassNameManager) that enables easy creation and caching of ","* prefixed class names.","* @module classnamemanager","*/","","/**"," * A singleton class providing: "," * "," * <ul>"," * <li>Easy creation of prefixed class names</li>"," * <li>Caching of previously created class names for improved performance.</li>"," * </ul>"," * "," * @class ClassNameManager"," * @static "," */","","// String constants","var CLASS_NAME_PREFIX = 'classNamePrefix',"," CLASS_NAME_DELIMITER = 'classNameDelimiter',"," CONFIG = Y.config;","","// Global config","","/**"," * Configuration property indicating the prefix for all CSS class names in this YUI instance."," *"," * @property classNamePrefix"," * @type {String}"," * @default \"yui\""," * @static"," */","CONFIG[CLASS_NAME_PREFIX] = CONFIG[CLASS_NAME_PREFIX] || 'yui3';","","/**"," * Configuration property indicating the delimiter used to compose all CSS class names in"," * this YUI instance."," *"," * @property classNameDelimiter"," * @type {String}"," * @default \"-\""," * @static"," */","CONFIG[CLASS_NAME_DELIMITER] = CONFIG[CLASS_NAME_DELIMITER] || '-';","","Y.ClassNameManager = function () {",""," var sPrefix = CONFIG[CLASS_NAME_PREFIX],"," sDelimiter = CONFIG[CLASS_NAME_DELIMITER];",""," return {",""," /**"," * Returns a class name prefixed with the the value of the "," * <code>Y.config.classNamePrefix</code> attribute + the provided strings."," * Uses the <code>Y.config.classNameDelimiter</code> attribute to delimit the "," * provided strings. E.g. Y.ClassNameManager.getClassName('foo','bar'); // yui-foo-bar"," *"," * @method getClassName"," * @param {String}+ classnameSection one or more classname sections to be joined"," * @param {Boolean} skipPrefix If set to true, the classname will not be prefixed with the default Y.config.classNameDelimiter value. "," */"," getClassName: Y.cached(function () {",""," var args = Y.Array(arguments);",""," if (args[args.length-1] !== true) {"," args.unshift(sPrefix);"," } else {"," args.pop();"," }",""," return args.join(sDelimiter);"," })",""," };","","}();","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/classnamemanager/classnamemanager.js"].code=["YUI.add('classnamemanager', function (Y, NAME) {","","/**","* Contains a singleton (ClassNameManager) that enables easy creation and caching of ","* prefixed class names.","* @module classnamemanager","*/","","/**"," * A singleton class providing: "," * "," * <ul>"," * <li>Easy creation of prefixed class names</li>"," * <li>Caching of previously created class names for improved performance.</li>"," * </ul>"," * "," * @class ClassNameManager"," * @static "," */","","// String constants","var CLASS_NAME_PREFIX = 'classNamePrefix',"," CLASS_NAME_DELIMITER = 'classNameDelimiter',"," CONFIG = Y.config;","","// Global config","","/**"," * Configuration property indicating the prefix for all CSS class names in this YUI instance."," *"," * @property classNamePrefix"," * @type {String}"," * @default \"yui\""," * @static"," */","CONFIG[CLASS_NAME_PREFIX] = CONFIG[CLASS_NAME_PREFIX] || 'yui3';","","/**"," * Configuration property indicating the delimiter used to compose all CSS class names in"," * this YUI instance."," *"," * @property classNameDelimiter"," * @type {String}"," * @default \"-\""," * @static"," */","CONFIG[CLASS_NAME_DELIMITER] = CONFIG[CLASS_NAME_DELIMITER] || '-';","","Y.ClassNameManager = function () {",""," var sPrefix = CONFIG[CLASS_NAME_PREFIX],"," sDelimiter = CONFIG[CLASS_NAME_DELIMITER];",""," return {",""," /**"," * Returns a class name prefixed with the the value of the "," * <code>Y.config.classNamePrefix</code> attribute + the provided strings."," * Uses the <code>Y.config.classNameDelimiter</code> attribute to delimit the "," * provided strings. E.g. Y.ClassNameManager.getClassName('foo','bar'); // yui-foo-bar"," *"," * @method getClassName"," * @param {String}+ classnameSection one or more classname sections to be joined"," * @param {Boolean} skipPrefix If set to true, the classname will not be prefixed with the default Y.config.classNameDelimiter value. "," */"," getClassName: Y.cached(function () {",""," var args = Y.Array(arguments);",""," if (args[args.length-1] !== true) {"," args.unshift(sPrefix);"," } else {"," args.pop();"," }",""," return args.join(sDelimiter);"," })",""," };","","}();","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/classnamemanager/classnamemanager.js"].lines = {"1":0,"22":0,"36":0,"47":0,"49":0,"51":0,"54":0,"68":0,"70":0,"71":0,"73":0,"76":0}; _yuitest_coverage["build/classnamemanager/classnamemanager.js"].functions = {"(anonymous 2):66":0,"ClassNameManager:49":0,"(anonymous 1):1":0}; _yuitest_coverage["build/classnamemanager/classnamemanager.js"].coveredLines = 12;@@ -135,4 +135,4 @@ }(); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/classnamemanager/classnamemanager-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -87,4 +87,4 @@ }(); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/classnamemanager/classnamemanager-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("classnamemanager",function(e,t){var n="classNamePrefix",r="classNameDelimiter",i=e.config;i[n]=i[n]||"yui3",i[r]=i[r]||"-",e.ClassNameManager=function(){var t=i[n],s=i[r];return{getClassName:e.cached(function(){var n=e.Array(arguments);return n[n.length-1]!==!0?n.unshift(t):n.pop(),n.join(s)})}}()},"3.7.2",{requires:["yui-base"]});+YUI.add("classnamemanager",function(e,t){var n="classNamePrefix",r="classNameDelimiter",i=e.config;i[n]=i[n]||"yui3",i[r]=i[r]||"-",e.ClassNameManager=function(){var t=i[n],s=i[r];return{getClassName:e.cached(function(){var n=e.Array(arguments);return n[n.length-1]!==!0?n.unshift(t):n.pop(),n.join(s)})}}()},"3.7.3",{requires:["yui-base"]});
bundle/classnamemanager/classnamemanager.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -87,4 +87,4 @@ }(); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/clickable-rail/assets/slider-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/clickable-rail/assets/slider-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/clickable-rail/clickable-rail-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/clickable-rail/clickable-rail.js", code: [] };-_yuitest_coverage["build/clickable-rail/clickable-rail.js"].code=["YUI.add('clickable-rail', function (Y, NAME) {","","/**"," * Adds support for mouse interaction with the Slider rail triggering thumb"," * movement."," *"," * @module slider"," * @submodule clickable-rail"," */","","/**"," * Slider extension that allows clicking on the Slider's rail element,"," * triggering the thumb to align with the location of the click."," *"," * @class ClickableRail"," */","function ClickableRail() {"," this._initClickableRail();","}","","Y.ClickableRail = Y.mix(ClickableRail, {",""," // Prototype methods added to host class"," prototype: {",""," /**"," * Initializes the internal state and sets up events."," *"," * @method _initClickableRail"," * @protected"," */"," _initClickableRail: function () {"," this._evtGuid = this._evtGuid || (Y.guid() + '|');",""," /**"," * Broadcasts when the rail has received a mousedown event and"," * triggers the thumb positioning. Use"," * <code>e.preventDefault()</code> or"," * <code>set("clickableRail", false)</code> to prevent"," * the thumb positioning."," *"," * @event railMouseDown"," * @preventable _defRailMouseDownFn"," */"," this.publish('railMouseDown', {"," defaultFn: this._defRailMouseDownFn"," });",""," this.after('render', this._bindClickableRail);"," this.on('destroy', this._unbindClickableRail);"," },",""," /** "," * Attaches DOM event subscribers to support rail interaction."," *"," * @method _bindClickableRail"," * @protected"," */"," _bindClickableRail: function () {"," this._dd.addHandle(this.rail);",""," this.rail.on(this._evtGuid + Y.DD.Drag.START_EVENT,"," Y.bind(this._onRailMouseDown, this));"," },",""," /**"," * Detaches DOM event subscribers for cleanup/destruction cycle."," *"," * @method _unbindClickableRail"," * @protected"," */"," _unbindClickableRail: function () {"," if (this.get('rendered')) {"," var contentBox = this.get('contentBox'),"," rail = contentBox.one('.' + this.getClassName('rail'));",""," rail.detach(this.evtGuid + '*');"," }"," },",""," /**"," * Dispatches the railMouseDown event."," *"," * @method _onRailMouseDown"," * @param e {DOMEvent} the mousedown event object"," * @protected"," */"," _onRailMouseDown: function (e) {"," if (this.get('clickableRail') && !this.get('disabled')) {"," this.fire('railMouseDown', { ev: e });"," this.thumb.focus();"," }"," },",""," /**"," * Default behavior for the railMouseDown event. Centers the thumb at"," * the click location and passes control to the DDM to behave as though"," * the thumb itself were clicked in preparation for a drag operation."," *"," * @method _defRailMouseDownFn"," * @param e {Event} the EventFacade for the railMouseDown custom event"," * @protected"," */"," _defRailMouseDownFn: function (e) {"," e = e.ev;",""," // Logic that determines which thumb should be used is abstracted"," // to someday support multi-thumb sliders"," var dd = this._resolveThumb(e),"," i = this._key.xyIndex,"," length = parseFloat(this.get('length'), 10),"," thumb,"," thumbSize,"," xy;"," "," if (dd) {"," thumb = dd.get('dragNode');"," thumbSize = parseFloat(thumb.getStyle(this._key.dim), 10);",""," // Step 1. Allow for aligning to thumb center or edge, etc"," xy = this._getThumbDestination(e, thumb);",""," // Step 2. Remove page offsets to give just top/left style val"," xy = xy[ i ] - this.rail.getXY()[i];",""," // Step 3. Constrain within the rail in case of attempt to"," // center the thumb when clicking on the end of the rail"," xy = Math.min("," Math.max(xy, 0),"," (length - thumbSize));",""," this._uiMoveThumb(xy, { source: 'rail' });",""," // Set e.target for DD's IE9 patch which calls"," // e.target._node.setCapture() to allow imgs to be dragged."," // Without this, setCapture is called from the rail and rail"," // clicks on other Sliders may have their thumb movements"," // overridden by a different Slider (the thumb on the wrong"," // Slider moves)."," e.target = this.thumb.one('img') || this.thumb;",""," // Delegate to DD's natural behavior"," dd._handleMouseDownEvent(e);",""," // TODO: this won't trigger a slideEnd if the rail is clicked"," // check if dd._move(e); dd._dragThreshMet = true; dd.start();"," // will do the trick. Is that even a good idea?"," }"," },",""," /**"," * Resolves which thumb to actuate if any. Override this if you want to"," * support multiple thumbs. By default, returns the Drag instance for"," * the thumb stored by the Slider."," *"," * @method _resolveThumb"," * @param e {DOMEvent} the mousedown event object"," * @return {DD.Drag} the Drag instance that should be moved"," * @protected"," */"," _resolveThumb: function (e) {"," /* Temporary workaround"," var primaryOnly = this._dd.get('primaryButtonOnly'),"," validClick = !primaryOnly || e.button <= 1;",""," return (validClick) ? this._dd : null;"," */"," return this._dd;"," },",""," /**"," * Calculates the top left position the thumb should be moved to to"," * align the click XY with the center of the specified node."," *"," * @method _getThumbDestination"," * @param e {DOMEvent} The mousedown event object"," * @param node {Node} The node to position"," * @return {Array} the [top, left] pixel position of the destination"," * @protected"," */"," _getThumbDestination: function (e, node) {"," var offsetWidth = node.get('offsetWidth'),"," offsetHeight = node.get('offsetHeight');",""," // center"," return ["," (e.pageX - Math.round((offsetWidth / 2))),"," (e.pageY - Math.round((offsetHeight / 2)))"," ];"," }",""," },",""," // Static properties added onto host class"," ATTRS: {"," /**"," * Enable or disable clickable rail support."," *"," * @attribute clickableRail"," * @type {Boolean}"," * @default true"," */"," clickableRail: {"," value: true,"," validator: Y.Lang.isBoolean"," }"," }","","}, true);","","","}, '3.7.2', {\"requires\": [\"slider-base\"]});"];+_yuitest_coverage["build/clickable-rail/clickable-rail.js"].code=["YUI.add('clickable-rail', function (Y, NAME) {","","/**"," * Adds support for mouse interaction with the Slider rail triggering thumb"," * movement."," *"," * @module slider"," * @submodule clickable-rail"," */","","/**"," * Slider extension that allows clicking on the Slider's rail element,"," * triggering the thumb to align with the location of the click."," *"," * @class ClickableRail"," */","function ClickableRail() {"," this._initClickableRail();","}","","Y.ClickableRail = Y.mix(ClickableRail, {",""," // Prototype methods added to host class"," prototype: {",""," /**"," * Initializes the internal state and sets up events."," *"," * @method _initClickableRail"," * @protected"," */"," _initClickableRail: function () {"," this._evtGuid = this._evtGuid || (Y.guid() + '|');",""," /**"," * Broadcasts when the rail has received a mousedown event and"," * triggers the thumb positioning. Use"," * <code>e.preventDefault()</code> or"," * <code>set("clickableRail", false)</code> to prevent"," * the thumb positioning."," *"," * @event railMouseDown"," * @preventable _defRailMouseDownFn"," */"," this.publish('railMouseDown', {"," defaultFn: this._defRailMouseDownFn"," });",""," this.after('render', this._bindClickableRail);"," this.on('destroy', this._unbindClickableRail);"," },",""," /** "," * Attaches DOM event subscribers to support rail interaction."," *"," * @method _bindClickableRail"," * @protected"," */"," _bindClickableRail: function () {"," this._dd.addHandle(this.rail);",""," this.rail.on(this._evtGuid + Y.DD.Drag.START_EVENT,"," Y.bind(this._onRailMouseDown, this));"," },",""," /**"," * Detaches DOM event subscribers for cleanup/destruction cycle."," *"," * @method _unbindClickableRail"," * @protected"," */"," _unbindClickableRail: function () {"," if (this.get('rendered')) {"," var contentBox = this.get('contentBox'),"," rail = contentBox.one('.' + this.getClassName('rail'));",""," rail.detach(this.evtGuid + '*');"," }"," },",""," /**"," * Dispatches the railMouseDown event."," *"," * @method _onRailMouseDown"," * @param e {DOMEvent} the mousedown event object"," * @protected"," */"," _onRailMouseDown: function (e) {"," if (this.get('clickableRail') && !this.get('disabled')) {"," this.fire('railMouseDown', { ev: e });"," this.thumb.focus();"," }"," },",""," /**"," * Default behavior for the railMouseDown event. Centers the thumb at"," * the click location and passes control to the DDM to behave as though"," * the thumb itself were clicked in preparation for a drag operation."," *"," * @method _defRailMouseDownFn"," * @param e {Event} the EventFacade for the railMouseDown custom event"," * @protected"," */"," _defRailMouseDownFn: function (e) {"," e = e.ev;",""," // Logic that determines which thumb should be used is abstracted"," // to someday support multi-thumb sliders"," var dd = this._resolveThumb(e),"," i = this._key.xyIndex,"," length = parseFloat(this.get('length'), 10),"," thumb,"," thumbSize,"," xy;"," "," if (dd) {"," thumb = dd.get('dragNode');"," thumbSize = parseFloat(thumb.getStyle(this._key.dim), 10);",""," // Step 1. Allow for aligning to thumb center or edge, etc"," xy = this._getThumbDestination(e, thumb);",""," // Step 2. Remove page offsets to give just top/left style val"," xy = xy[ i ] - this.rail.getXY()[i];",""," // Step 3. Constrain within the rail in case of attempt to"," // center the thumb when clicking on the end of the rail"," xy = Math.min("," Math.max(xy, 0),"," (length - thumbSize));",""," this._uiMoveThumb(xy, { source: 'rail' });",""," // Set e.target for DD's IE9 patch which calls"," // e.target._node.setCapture() to allow imgs to be dragged."," // Without this, setCapture is called from the rail and rail"," // clicks on other Sliders may have their thumb movements"," // overridden by a different Slider (the thumb on the wrong"," // Slider moves)."," e.target = this.thumb.one('img') || this.thumb;",""," // Delegate to DD's natural behavior"," dd._handleMouseDownEvent(e);",""," // TODO: this won't trigger a slideEnd if the rail is clicked"," // check if dd._move(e); dd._dragThreshMet = true; dd.start();"," // will do the trick. Is that even a good idea?"," }"," },",""," /**"," * Resolves which thumb to actuate if any. Override this if you want to"," * support multiple thumbs. By default, returns the Drag instance for"," * the thumb stored by the Slider."," *"," * @method _resolveThumb"," * @param e {DOMEvent} the mousedown event object"," * @return {DD.Drag} the Drag instance that should be moved"," * @protected"," */"," _resolveThumb: function (e) {"," /* Temporary workaround"," var primaryOnly = this._dd.get('primaryButtonOnly'),"," validClick = !primaryOnly || e.button <= 1;",""," return (validClick) ? this._dd : null;"," */"," return this._dd;"," },",""," /**"," * Calculates the top left position the thumb should be moved to to"," * align the click XY with the center of the specified node."," *"," * @method _getThumbDestination"," * @param e {DOMEvent} The mousedown event object"," * @param node {Node} The node to position"," * @return {Array} the [top, left] pixel position of the destination"," * @protected"," */"," _getThumbDestination: function (e, node) {"," var offsetWidth = node.get('offsetWidth'),"," offsetHeight = node.get('offsetHeight');",""," // center"," return ["," (e.pageX - Math.round((offsetWidth / 2))),"," (e.pageY - Math.round((offsetHeight / 2)))"," ];"," }",""," },",""," // Static properties added onto host class"," ATTRS: {"," /**"," * Enable or disable clickable rail support."," *"," * @attribute clickableRail"," * @type {Boolean}"," * @default true"," */"," clickableRail: {"," value: true,"," validator: Y.Lang.isBoolean"," }"," }","","}, true);","","","}, '3.7.3', {\"requires\": [\"slider-base\"]});"]; _yuitest_coverage["build/clickable-rail/clickable-rail.js"].lines = {"1":0,"17":0,"18":0,"21":0,"33":0,"45":0,"49":0,"50":0,"60":0,"62":0,"73":0,"74":0,"77":0,"89":0,"90":0,"91":0,"105":0,"109":0,"116":0,"117":0,"118":0,"121":0,"124":0,"128":0,"132":0,"140":0,"143":0,"168":0,"182":0,"186":0}; _yuitest_coverage["build/clickable-rail/clickable-rail.js"].functions = {"ClickableRail:17":0,"_initClickableRail:32":0,"_bindClickableRail:59":0,"_unbindClickableRail:72":0,"_onRailMouseDown:88":0,"_defRailMouseDownFn:104":0,"_resolveThumb:161":0,"_getThumbDestination:181":0,"(anonymous 1):1":0}; _yuitest_coverage["build/clickable-rail/clickable-rail.js"].coveredLines = 30;@@ -287,4 +287,4 @@ }, true); -}, '3.7.2', {"requires": ["slider-base"]});+}, '3.7.3', {"requires": ["slider-base"]});
bundle/clickable-rail/clickable-rail-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -215,4 +215,4 @@ }, true); -}, '3.7.2', {"requires": ["slider-base"]});+}, '3.7.3', {"requires": ["slider-base"]});
bundle/clickable-rail/clickable-rail-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("clickable-rail",function(e,t){function n(){this._initClickableRail()}e.ClickableRail=e.mix(n,{prototype:{_initClickableRail:function(){this._evtGuid=this._evtGuid||e.guid()+"|",this.publish("railMouseDown",{defaultFn:this._defRailMouseDownFn}),this.after("render",this._bindClickableRail),this.on("destroy",this._unbindClickableRail)},_bindClickableRail:function(){this._dd.addHandle(this.rail),this.rail.on(this._evtGuid+e.DD.Drag.START_EVENT,e.bind(this._onRailMouseDown,this))},_unbindClickableRail:function(){if(this.get("rendered")){var e=this.get("contentBox"),t=e.one("."+this.getClassName("rail"));t.detach(this.evtGuid+"*")}},_onRailMouseDown:function(e){this.get("clickableRail")&&!this.get("disabled")&&(this.fire("railMouseDown",{ev:e}),this.thumb.focus())},_defRailMouseDownFn:function(e){e=e.ev;var t=this._resolveThumb(e),n=this._key.xyIndex,r=parseFloat(this.get("length"),10),i,s,o;t&&(i=t.get("dragNode"),s=parseFloat(i.getStyle(this._key.dim),10),o=this._getThumbDestination(e,i),o=o[n]-this.rail.getXY()[n],o=Math.min(Math.max(o,0),r-s),this._uiMoveThumb(o,{source:"rail"}),e.target=this.thumb.one("img")||this.thumb,t._handleMouseDownEvent(e))},_resolveThumb:function(e){return this._dd},_getThumbDestination:function(e,t){var n=t.get("offsetWidth"),r=t.get("offsetHeight");return[e.pageX-Math.round(n/2),e.pageY-Math.round(r/2)]}},ATTRS:{clickableRail:{value:!0,validator:e.Lang.isBoolean}}},!0)},"3.7.2",{requires:["slider-base"]});+YUI.add("clickable-rail",function(e,t){function n(){this._initClickableRail()}e.ClickableRail=e.mix(n,{prototype:{_initClickableRail:function(){this._evtGuid=this._evtGuid||e.guid()+"|",this.publish("railMouseDown",{defaultFn:this._defRailMouseDownFn}),this.after("render",this._bindClickableRail),this.on("destroy",this._unbindClickableRail)},_bindClickableRail:function(){this._dd.addHandle(this.rail),this.rail.on(this._evtGuid+e.DD.Drag.START_EVENT,e.bind(this._onRailMouseDown,this))},_unbindClickableRail:function(){if(this.get("rendered")){var e=this.get("contentBox"),t=e.one("."+this.getClassName("rail"));t.detach(this.evtGuid+"*")}},_onRailMouseDown:function(e){this.get("clickableRail")&&!this.get("disabled")&&(this.fire("railMouseDown",{ev:e}),this.thumb.focus())},_defRailMouseDownFn:function(e){e=e.ev;var t=this._resolveThumb(e),n=this._key.xyIndex,r=parseFloat(this.get("length"),10),i,s,o;t&&(i=t.get("dragNode"),s=parseFloat(i.getStyle(this._key.dim),10),o=this._getThumbDestination(e,i),o=o[n]-this.rail.getXY()[n],o=Math.min(Math.max(o,0),r-s),this._uiMoveThumb(o,{source:"rail"}),e.target=this.thumb.one("img")||this.thumb,t._handleMouseDownEvent(e))},_resolveThumb:function(e){return this._dd},_getThumbDestination:function(e,t){var n=t.get("offsetWidth"),r=t.get("offsetHeight");return[e.pageX-Math.round(n/2),e.pageY-Math.round(r/2)]}},ATTRS:{clickableRail:{value:!0,validator:e.Lang.isBoolean}}},!0)},"3.7.3",{requires:["slider-base"]});
bundle/clickable-rail/clickable-rail.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -215,4 +215,4 @@ }, true); -}, '3.7.2', {"requires": ["slider-base"]});+}, '3.7.3', {"requires": ["slider-base"]});
bundle/console-filters/assets/console-filters-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console-filters/assets/skins/sam/console-filters-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console-filters/assets/skins/sam/console-filters.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console-filters/console-filters-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/console-filters/console-filters.js", code: [] };-_yuitest_coverage["build/console-filters/console-filters.js"].code=["YUI.add('console-filters', function (Y, NAME) {","","/**"," * <p>Provides Plugin.ConsoleFilters plugin class.</p>"," *"," * <p>This plugin adds the ability to control which Console entries display by filtering on category and source. Two groups of checkboxes are added to the Console footer, one for categories and the other for sources. Only those messages that match a checked category or source are displayed.</p>"," *"," * @module console-filters"," * @namespace Plugin"," * @class ConsoleFilters"," */","","// Some common strings and functions","var getCN = Y.ClassNameManager.getClassName,"," CONSOLE = 'console',"," FILTERS = 'filters',"," FILTER = 'filter',"," CATEGORY = 'category',"," SOURCE = 'source',"," CATEGORY_DOT = 'category.',"," SOURCE_DOT = 'source.',",""," HOST = 'host',"," CHECKED = 'checked',"," DEF_VISIBILITY = 'defaultVisibility',",""," DOT = '.',"," EMPTY = '',",""," C_BODY = DOT + Y.Console.CHROME_CLASSES.console_bd_class,"," C_FOOT = DOT + Y.Console.CHROME_CLASSES.console_ft_class,",""," SEL_CHECK = 'input[type=checkbox].',"," "," isString = Y.Lang.isString;","","function ConsoleFilters() {"," ConsoleFilters.superclass.constructor.apply(this,arguments);","}","","Y.namespace('Plugin').ConsoleFilters = Y.extend(ConsoleFilters, Y.Plugin.Base,","","// Y.Plugin.ConsoleFilters prototype","{"," /**"," * Collection of all log messages passed through since the plugin's"," * instantiation. This holds all messages regardless of filter status."," * Used as a single source of truth for repopulating the Console body when"," * filters are changed."," *"," * @property _entries"," * @type Array"," * @protected"," */"," _entries : null,",""," /**"," * Maximum number of entries to store in the message cache."," *"," * @property _cacheLimit"," * @type {Number}"," * @default Infinity"," * @protected"," */"," _cacheLimit : Number.POSITIVE_INFINITY,",""," /**"," * The container node created to house the category filters."," *"," * @property _categories"," * @type Node"," * @protected"," */"," _categories : null,",""," /**"," * The container node created to house the source filters."," *"," * @property _sources"," * @type Node"," * @protected"," */"," _sources : null,",""," /**"," * Initialize entries collection and attach listeners to host events and"," * methods."," *"," * @method initializer"," * @protected"," */"," initializer : function () {"," this._entries = [];",""," this.get(HOST).on(\"entry\", this._onEntry, this);",""," this.doAfter(\"renderUI\", this.renderUI);"," this.doAfter(\"syncUI\", this.syncUI);"," this.doAfter(\"bindUI\", this.bindUI);",""," this.doAfter(\"clearConsole\", this._afterClearConsole);",""," if (this.get(HOST).get('rendered')) {"," this.renderUI();"," this.syncUI();"," this.bindUI();"," }",""," this.after(\"cacheLimitChange\", this._afterCacheLimitChange);"," },",""," /**"," * Removes the plugin UI and unwires events."," *"," * @method destructor"," * @protected"," */"," destructor : function () {"," //TODO: grab last {consoleLimit} entries and update the console with"," //them (no filtering)"," this._entries = [];",""," if (this._categories) {"," this._categories.remove();"," }"," if (this._sources) {"," this._sources.remove();"," }"," },",""," /**"," * Adds the category and source filter sections to the Console footer."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var foot = this.get(HOST).get('contentBox').one(C_FOOT),"," html;",""," if (foot) {"," html = Y.Lang.sub("," ConsoleFilters.CATEGORIES_TEMPLATE,"," ConsoleFilters.CHROME_CLASSES);",""," this._categories = foot.appendChild(Y.Node.create(html));",""," html = Y.Lang.sub("," ConsoleFilters.SOURCES_TEMPLATE,"," ConsoleFilters.CHROME_CLASSES);",""," this._sources = foot.appendChild(Y.Node.create(html));"," }"," },",""," /**"," * Binds to checkbox click events and internal attribute change events to"," * maintain the UI state."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," this._categories.on('click', Y.bind(this._onCategoryCheckboxClick, this));",""," this._sources.on('click', Y.bind(this._onSourceCheckboxClick, this));"," "," this.after('categoryChange',this._afterCategoryChange);"," this.after('sourceChange', this._afterSourceChange);"," },",""," /**"," * Updates the UI to be in accordance with the current state of the plugin."," *"," * @method syncUI"," */"," syncUI : function () {"," Y.each(this.get(CATEGORY), function (v, k) {"," this._uiSetCheckbox(CATEGORY, k, v);"," }, this);",""," Y.each(this.get(SOURCE), function (v, k) {"," this._uiSetCheckbox(SOURCE, k, v);"," }, this);",""," this.refreshConsole();"," },",""," /**"," * Ensures a filter is set up for any new categories or sources and"," * collects the messages in _entries. If the message is stamped with a"," * category or source that is currently being filtered out, the message"," * will not pass to the Console's print buffer."," *"," * @method _onEntry"," * @param e {Event} the custom event object"," * @protected"," */"," _onEntry : function (e) {"," this._entries.push(e.message);"," "," var cat = CATEGORY_DOT + e.message.category,"," src = SOURCE_DOT + e.message.source,"," cat_filter = this.get(cat),"," src_filter = this.get(src),"," overLimit = this._entries.length - this._cacheLimit,"," visible;",""," if (overLimit > 0) {"," this._entries.splice(0, overLimit);"," }",""," if (cat_filter === undefined) {"," visible = this.get(DEF_VISIBILITY);"," this.set(cat, visible);"," cat_filter = visible;"," }",""," if (src_filter === undefined) {"," visible = this.get(DEF_VISIBILITY);"," this.set(src, visible);"," src_filter = visible;"," }"," "," if (!cat_filter || !src_filter) {"," e.preventDefault();"," }"," },",""," /**"," * Flushes the cached entries after a call to the Console's clearConsole()."," *"," * @method _afterClearConsole"," * @protected"," */"," _afterClearConsole : function () {"," this._entries = [];"," },",""," /**"," * Triggers the Console to update if a known category filter"," * changes value (e.g. visible => hidden). Updates the appropriate"," * checkbox's checked state if necessary."," *"," * @method _afterCategoryChange"," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterCategoryChange : function (e) {"," var cat = e.subAttrName.replace(/category\\./, EMPTY),"," before = e.prevVal,"," after = e.newVal;",""," // Don't update the console for new categories"," if (!cat || before[cat] !== undefined) {"," this.refreshConsole();",""," this._filterBuffer();"," }",""," if (cat && !e.fromUI) {"," this._uiSetCheckbox(CATEGORY, cat, after[cat]);"," }"," },",""," /**"," * Triggers the Console to update if a known source filter"," * changes value (e.g. visible => hidden). Updates the appropriate"," * checkbox's checked state if necessary."," *"," * @method _afterSourceChange"," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterSourceChange : function (e) {"," var src = e.subAttrName.replace(/source\\./, EMPTY),"," before = e.prevVal,"," after = e.newVal;",""," // Don't update the console for new sources"," if (!src || before[src] !== undefined) {"," this.refreshConsole();",""," this._filterBuffer();"," }",""," if (src && !e.fromUI) {"," this._uiSetCheckbox(SOURCE, src, after[src]);"," }"," },",""," /**"," * Flushes the Console's print buffer of any entries that have a category"," * or source that is currently being excluded."," *"," * @method _filterBuffer"," * @protected"," */"," _filterBuffer : function () {"," var cats = this.get(CATEGORY),"," srcs = this.get(SOURCE),"," buffer = this.get(HOST).buffer,"," start = null,"," i;",""," for (i = buffer.length - 1; i >= 0; --i) {"," if (!cats[buffer[i].category] || !srcs[buffer[i].source]) {"," start = start || i;"," } else if (start) {"," buffer.splice(i,(start - i));"," start = null;"," }"," }"," if (start) {"," buffer.splice(0,start + 1);"," }"," },",""," /**"," * Trims the cache of entries to the appropriate new length."," *"," * @method _afterCacheLimitChange "," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterCacheLimitChange : function (e) {"," if (isFinite(e.newVal)) {"," var delta = this._entries.length - e.newVal;",""," if (delta > 0) {"," this._entries.splice(0,delta);"," }"," }"," },",""," /**"," * Repopulates the Console with entries appropriate to the current filter"," * settings."," *"," * @method refreshConsole"," */"," refreshConsole : function () {"," var entries = this._entries,"," host = this.get(HOST),"," body = host.get('contentBox').one(C_BODY),"," remaining = host.get('consoleLimit'),"," cats = this.get(CATEGORY),"," srcs = this.get(SOURCE),"," buffer = [],"," i,e;",""," if (body) {"," host._cancelPrintLoop();",""," // Evaluate all entries from latest to oldest"," for (i = entries.length - 1; i >= 0 && remaining >= 0; --i) {"," e = entries[i];"," if (cats[e.category] && srcs[e.source]) {"," buffer.unshift(e);"," --remaining;"," }"," }",""," body.setHTML(EMPTY);"," host.buffer = buffer;"," host.printBuffer();"," }"," },",""," /**"," * Updates the checked property of a filter checkbox of the specified type."," * If no checkbox is found for the input params, one is created."," *"," * @method _uiSetCheckbox"," * @param type {String} 'category' or 'source'"," * @param item {String} the name of the filter (e.g. 'info', 'event')"," * @param checked {Boolean} value to set the checkbox's checked property"," * @protected"," */"," _uiSetCheckbox : function (type, item, checked) {"," if (type && item) {"," var container = type === CATEGORY ?"," this._categories :"," this._sources,"," sel = SEL_CHECK + getCN(CONSOLE,FILTER,item),"," checkbox = container.one(sel),"," host;"," "," if (!checkbox) {"," host = this.get(HOST);",""," this._createCheckbox(container, item);",""," checkbox = container.one(sel);",""," host._uiSetHeight(host.get('height'));"," }"," "," checkbox.set(CHECKED, checked);"," }"," },",""," /**"," * Passes checkbox clicks on to the category attribute."," *"," * @method _onCategoryCheckboxClick"," * @param e {Event} the DOM event"," * @protected"," */"," _onCategoryCheckboxClick : function (e) {"," var t = e.target, cat;",""," if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {"," cat = t.get('value');"," if (cat && cat in this.get(CATEGORY)) {"," this.set(CATEGORY_DOT + cat, t.get(CHECKED), { fromUI: true });"," }"," }"," },",""," /**"," * Passes checkbox clicks on to the source attribute."," *"," * @method _onSourceCheckboxClick"," * @param e {Event} the DOM event"," * @protected"," */"," _onSourceCheckboxClick : function (e) {"," var t = e.target, src;",""," if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {"," src = t.get('value');"," if (src && src in this.get(SOURCE)) {"," this.set(SOURCE_DOT + src, t.get(CHECKED), { fromUI: true });"," }"," }"," },",""," /**"," * Hides any number of categories from the UI. Convenience method for"," * myConsole.filter.set('category.foo', false); set('category.bar', false);"," * and so on."," *"," * @method hideCategory"," * @param cat* {String} 1..n categories to filter out of the UI"," */"," hideCategory : function (cat, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.hideCategory, this);"," } else {"," this.set(CATEGORY_DOT + cat, false);"," }"," },",""," /**"," * Shows any number of categories in the UI. Convenience method for"," * myConsole.filter.set('category.foo', true); set('category.bar', true);"," * and so on."," *"," * @method showCategory"," * @param cat* {String} 1..n categories to allow to display in the UI"," */"," showCategory : function (cat, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.showCategory, this);"," } else {"," this.set(CATEGORY_DOT + cat, true);"," }"," },",""," /**"," * Hides any number of sources from the UI. Convenience method for"," * myConsole.filter.set('source.foo', false); set('source.bar', false);"," * and so on."," *"," * @method hideSource"," * @param src* {String} 1..n sources to filter out of the UI"," */"," hideSource : function (src, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.hideSource, this);"," } else {"," this.set(SOURCE_DOT + src, false);"," }"," },",""," /**"," * Shows any number of sources in the UI. Convenience method for"," * myConsole.filter.set('source.foo', true); set('source.bar', true);"," * and so on."," *"," * @method showSource"," * @param src* {String} 1..n sources to allow to display in the UI"," */"," showSource : function (src, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.showSource, this);"," } else {"," this.set(SOURCE_DOT + src, true);"," }"," },",""," /**"," * Creates a checkbox and label from the ConsoleFilters.FILTER_TEMPLATE for"," * the provided type and name. The checkbox and label are appended to the"," * container node passes as the first arg."," *"," * @method _createCheckbox"," * @param container {Node} the parentNode of the new checkbox and label"," * @param name {String} the identifier of the filter"," * @protected"," */"," _createCheckbox : function (container, name) {"," var info = Y.merge(ConsoleFilters.CHROME_CLASSES, {"," filter_name : name,"," filter_class : getCN(CONSOLE, FILTER, name)"," }),"," node = Y.Node.create("," Y.Lang.sub(ConsoleFilters.FILTER_TEMPLATE, info));",""," container.appendChild(node);"," },",""," /**"," * Validates category updates are objects and the subattribute is not too"," * deep."," *"," * @method _validateCategory"," * @param cat {String} the new category:visibility map"," * @param v {String} the subattribute path updated"," * @return Boolean"," * @protected"," */"," _validateCategory : function (cat, v) {"," return Y.Lang.isObject(v,true) && cat.split(/\\./).length < 3;"," },",""," /**"," * Validates source updates are objects and the subattribute is not too"," * deep."," *"," * @method _validateSource"," * @param cat {String} the new source:visibility map"," * @param v {String} the subattribute path updated"," * @return Boolean"," * @protected"," */"," _validateSource : function (src, v) {"," return Y.Lang.isObject(v,true) && src.split(/\\./).length < 3;"," },",""," /**"," * Setter method for cacheLimit attribute. Basically a validator to ensure"," * numeric input."," *"," * @method _setCacheLimit"," * @param v {Number} Maximum number of entries"," * @return {Number}"," * @protected"," */"," _setCacheLimit: function (v) {"," if (Y.Lang.isNumber(v)) {"," this._cacheLimit = v;"," return v;"," } else {"," return Y.Attribute.INVALID_VALUE;"," }"," }","},","","// Y.Plugin.ConsoleFilters static properties","{"," /**"," * Plugin name."," *"," * @property NAME"," * @type String"," * @static"," * @default 'consoleFilters'"," */"," NAME : 'consoleFilters',",""," /**"," * The namespace hung off the host object that this plugin will inhabit."," *"," * @property NS"," * @type String"," * @static"," * @default 'filter'"," */"," NS : FILTER,",""," /**"," * Markup template used to create the container for the category filters."," *"," * @property CATEGORIES_TEMPLATE"," * @type String"," * @static"," */"," CATEGORIES_TEMPLATE :"," '<div class=\"{categories}\"></div>',",""," /**"," * Markup template used to create the container for the source filters."," *"," * @property SOURCES_TEMPLATE"," * @type String"," * @static"," */"," SOURCES_TEMPLATE :"," '<div class=\"{sources}\"></div>',",""," /**"," * Markup template used to create the category and source filter checkboxes."," *"," * @property FILTER_TEMPLATE"," * @type String"," * @static"," */"," FILTER_TEMPLATE :"," // IE8 and FF3 don't permit breaking _between_ nowrap elements. IE8"," // doesn't understand (non spec) wbr tag, nor does it create text nodes"," // for spaces in innerHTML strings. The thin-space entity suffices to"," // create a breakable point."," '<label class=\"{filter_label}\">'+"," '<input type=\"checkbox\" value=\"{filter_name}\" '+"," 'class=\"{filter} {filter_class}\"> {filter_name}'+"," '</label> ',",""," /** "," * Classnames used by the templates when creating nodes."," *"," * @property CHROME_CLASSES"," * @type Object"," * @static"," * @protected"," */"," CHROME_CLASSES : {"," categories : getCN(CONSOLE,FILTERS,'categories'),"," sources : getCN(CONSOLE,FILTERS,'sources'),"," category : getCN(CONSOLE,FILTER,CATEGORY),"," source : getCN(CONSOLE,FILTER,SOURCE),"," filter : getCN(CONSOLE,FILTER),"," filter_label : getCN(CONSOLE,FILTER,'label')"," },",""," ATTRS : {"," /**"," * Default visibility applied to new categories and sources."," *"," * @attribute defaultVisibility"," * @type {Boolean}"," * @default true"," */"," defaultVisibility : {"," value : true,"," validator : Y.Lang.isBoolean"," },",""," /**"," * <p>Map of entry categories to their visibility status. Update a"," * particular category's visibility by setting the subattribute to true"," * (visible) or false (hidden).</p>"," *"," * <p>For example, yconsole.filter.set('category.info', false) to hide"," * log entries with the category/logLevel of 'info'.</p>"," *"," * <p>Similarly, yconsole.filter.get('category.warn') will return a"," * boolean indicating whether that category is currently being included"," * in the UI.</p>"," *"," * <p>Unlike the YUI instance configuration's logInclude and logExclude"," * properties, filtered entries are only hidden from the UI, but"," * can be made visible again.</p>"," *"," * @attribute category"," * @type Object"," */"," category : {"," value : {},"," validator : function (v,k) {"," return this._validateCategory(k,v);"," }"," },",""," /**"," * <p>Map of entry sources to their visibility status. Update a"," * particular sources's visibility by setting the subattribute to true"," * (visible) or false (hidden).</p>"," *"," * <p>For example, yconsole.filter.set('sources.slider', false) to hide"," * log entries originating from Y.Slider.</p>"," *"," * @attribute source"," * @type Object"," */"," source : {"," value : {},"," validator : function (v,k) {"," return this._validateSource(k,v);"," }"," },",""," /**"," * Maximum number of entries to store in the message cache. Use this to"," * limit the memory footprint in environments with heavy log usage."," * By default, there is no limit (Number.POSITIVE_INFINITY)."," *"," * @attribute cacheLimit"," * @type {Number}"," * @default Number.POSITIVE_INFINITY"," */"," cacheLimit : {"," value : Number.POSITIVE_INFINITY,"," setter : function (v) {"," return this._setCacheLimit(v);"," }"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"plugin\", \"console\"], \"skinnable\": true});"];+_yuitest_coverage["build/console-filters/console-filters.js"].code=["YUI.add('console-filters', function (Y, NAME) {","","/**"," * <p>Provides Plugin.ConsoleFilters plugin class.</p>"," *"," * <p>This plugin adds the ability to control which Console entries display by filtering on category and source. Two groups of checkboxes are added to the Console footer, one for categories and the other for sources. Only those messages that match a checked category or source are displayed.</p>"," *"," * @module console-filters"," * @namespace Plugin"," * @class ConsoleFilters"," */","","// Some common strings and functions","var getCN = Y.ClassNameManager.getClassName,"," CONSOLE = 'console',"," FILTERS = 'filters',"," FILTER = 'filter',"," CATEGORY = 'category',"," SOURCE = 'source',"," CATEGORY_DOT = 'category.',"," SOURCE_DOT = 'source.',",""," HOST = 'host',"," CHECKED = 'checked',"," DEF_VISIBILITY = 'defaultVisibility',",""," DOT = '.',"," EMPTY = '',",""," C_BODY = DOT + Y.Console.CHROME_CLASSES.console_bd_class,"," C_FOOT = DOT + Y.Console.CHROME_CLASSES.console_ft_class,",""," SEL_CHECK = 'input[type=checkbox].',"," "," isString = Y.Lang.isString;","","function ConsoleFilters() {"," ConsoleFilters.superclass.constructor.apply(this,arguments);","}","","Y.namespace('Plugin').ConsoleFilters = Y.extend(ConsoleFilters, Y.Plugin.Base,","","// Y.Plugin.ConsoleFilters prototype","{"," /**"," * Collection of all log messages passed through since the plugin's"," * instantiation. This holds all messages regardless of filter status."," * Used as a single source of truth for repopulating the Console body when"," * filters are changed."," *"," * @property _entries"," * @type Array"," * @protected"," */"," _entries : null,",""," /**"," * Maximum number of entries to store in the message cache."," *"," * @property _cacheLimit"," * @type {Number}"," * @default Infinity"," * @protected"," */"," _cacheLimit : Number.POSITIVE_INFINITY,",""," /**"," * The container node created to house the category filters."," *"," * @property _categories"," * @type Node"," * @protected"," */"," _categories : null,",""," /**"," * The container node created to house the source filters."," *"," * @property _sources"," * @type Node"," * @protected"," */"," _sources : null,",""," /**"," * Initialize entries collection and attach listeners to host events and"," * methods."," *"," * @method initializer"," * @protected"," */"," initializer : function () {"," this._entries = [];",""," this.get(HOST).on(\"entry\", this._onEntry, this);",""," this.doAfter(\"renderUI\", this.renderUI);"," this.doAfter(\"syncUI\", this.syncUI);"," this.doAfter(\"bindUI\", this.bindUI);",""," this.doAfter(\"clearConsole\", this._afterClearConsole);",""," if (this.get(HOST).get('rendered')) {"," this.renderUI();"," this.syncUI();"," this.bindUI();"," }",""," this.after(\"cacheLimitChange\", this._afterCacheLimitChange);"," },",""," /**"," * Removes the plugin UI and unwires events."," *"," * @method destructor"," * @protected"," */"," destructor : function () {"," //TODO: grab last {consoleLimit} entries and update the console with"," //them (no filtering)"," this._entries = [];",""," if (this._categories) {"," this._categories.remove();"," }"," if (this._sources) {"," this._sources.remove();"," }"," },",""," /**"," * Adds the category and source filter sections to the Console footer."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var foot = this.get(HOST).get('contentBox').one(C_FOOT),"," html;",""," if (foot) {"," html = Y.Lang.sub("," ConsoleFilters.CATEGORIES_TEMPLATE,"," ConsoleFilters.CHROME_CLASSES);",""," this._categories = foot.appendChild(Y.Node.create(html));",""," html = Y.Lang.sub("," ConsoleFilters.SOURCES_TEMPLATE,"," ConsoleFilters.CHROME_CLASSES);",""," this._sources = foot.appendChild(Y.Node.create(html));"," }"," },",""," /**"," * Binds to checkbox click events and internal attribute change events to"," * maintain the UI state."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," this._categories.on('click', Y.bind(this._onCategoryCheckboxClick, this));",""," this._sources.on('click', Y.bind(this._onSourceCheckboxClick, this));"," "," this.after('categoryChange',this._afterCategoryChange);"," this.after('sourceChange', this._afterSourceChange);"," },",""," /**"," * Updates the UI to be in accordance with the current state of the plugin."," *"," * @method syncUI"," */"," syncUI : function () {"," Y.each(this.get(CATEGORY), function (v, k) {"," this._uiSetCheckbox(CATEGORY, k, v);"," }, this);",""," Y.each(this.get(SOURCE), function (v, k) {"," this._uiSetCheckbox(SOURCE, k, v);"," }, this);",""," this.refreshConsole();"," },",""," /**"," * Ensures a filter is set up for any new categories or sources and"," * collects the messages in _entries. If the message is stamped with a"," * category or source that is currently being filtered out, the message"," * will not pass to the Console's print buffer."," *"," * @method _onEntry"," * @param e {Event} the custom event object"," * @protected"," */"," _onEntry : function (e) {"," this._entries.push(e.message);"," "," var cat = CATEGORY_DOT + e.message.category,"," src = SOURCE_DOT + e.message.source,"," cat_filter = this.get(cat),"," src_filter = this.get(src),"," overLimit = this._entries.length - this._cacheLimit,"," visible;",""," if (overLimit > 0) {"," this._entries.splice(0, overLimit);"," }",""," if (cat_filter === undefined) {"," visible = this.get(DEF_VISIBILITY);"," this.set(cat, visible);"," cat_filter = visible;"," }",""," if (src_filter === undefined) {"," visible = this.get(DEF_VISIBILITY);"," this.set(src, visible);"," src_filter = visible;"," }"," "," if (!cat_filter || !src_filter) {"," e.preventDefault();"," }"," },",""," /**"," * Flushes the cached entries after a call to the Console's clearConsole()."," *"," * @method _afterClearConsole"," * @protected"," */"," _afterClearConsole : function () {"," this._entries = [];"," },",""," /**"," * Triggers the Console to update if a known category filter"," * changes value (e.g. visible => hidden). Updates the appropriate"," * checkbox's checked state if necessary."," *"," * @method _afterCategoryChange"," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterCategoryChange : function (e) {"," var cat = e.subAttrName.replace(/category\\./, EMPTY),"," before = e.prevVal,"," after = e.newVal;",""," // Don't update the console for new categories"," if (!cat || before[cat] !== undefined) {"," this.refreshConsole();",""," this._filterBuffer();"," }",""," if (cat && !e.fromUI) {"," this._uiSetCheckbox(CATEGORY, cat, after[cat]);"," }"," },",""," /**"," * Triggers the Console to update if a known source filter"," * changes value (e.g. visible => hidden). Updates the appropriate"," * checkbox's checked state if necessary."," *"," * @method _afterSourceChange"," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterSourceChange : function (e) {"," var src = e.subAttrName.replace(/source\\./, EMPTY),"," before = e.prevVal,"," after = e.newVal;",""," // Don't update the console for new sources"," if (!src || before[src] !== undefined) {"," this.refreshConsole();",""," this._filterBuffer();"," }",""," if (src && !e.fromUI) {"," this._uiSetCheckbox(SOURCE, src, after[src]);"," }"," },",""," /**"," * Flushes the Console's print buffer of any entries that have a category"," * or source that is currently being excluded."," *"," * @method _filterBuffer"," * @protected"," */"," _filterBuffer : function () {"," var cats = this.get(CATEGORY),"," srcs = this.get(SOURCE),"," buffer = this.get(HOST).buffer,"," start = null,"," i;",""," for (i = buffer.length - 1; i >= 0; --i) {"," if (!cats[buffer[i].category] || !srcs[buffer[i].source]) {"," start = start || i;"," } else if (start) {"," buffer.splice(i,(start - i));"," start = null;"," }"," }"," if (start) {"," buffer.splice(0,start + 1);"," }"," },",""," /**"," * Trims the cache of entries to the appropriate new length."," *"," * @method _afterCacheLimitChange "," * @param e {Event} the attribute change event object"," * @protected"," */"," _afterCacheLimitChange : function (e) {"," if (isFinite(e.newVal)) {"," var delta = this._entries.length - e.newVal;",""," if (delta > 0) {"," this._entries.splice(0,delta);"," }"," }"," },",""," /**"," * Repopulates the Console with entries appropriate to the current filter"," * settings."," *"," * @method refreshConsole"," */"," refreshConsole : function () {"," var entries = this._entries,"," host = this.get(HOST),"," body = host.get('contentBox').one(C_BODY),"," remaining = host.get('consoleLimit'),"," cats = this.get(CATEGORY),"," srcs = this.get(SOURCE),"," buffer = [],"," i,e;",""," if (body) {"," host._cancelPrintLoop();",""," // Evaluate all entries from latest to oldest"," for (i = entries.length - 1; i >= 0 && remaining >= 0; --i) {"," e = entries[i];"," if (cats[e.category] && srcs[e.source]) {"," buffer.unshift(e);"," --remaining;"," }"," }",""," body.setHTML(EMPTY);"," host.buffer = buffer;"," host.printBuffer();"," }"," },",""," /**"," * Updates the checked property of a filter checkbox of the specified type."," * If no checkbox is found for the input params, one is created."," *"," * @method _uiSetCheckbox"," * @param type {String} 'category' or 'source'"," * @param item {String} the name of the filter (e.g. 'info', 'event')"," * @param checked {Boolean} value to set the checkbox's checked property"," * @protected"," */"," _uiSetCheckbox : function (type, item, checked) {"," if (type && item) {"," var container = type === CATEGORY ?"," this._categories :"," this._sources,"," sel = SEL_CHECK + getCN(CONSOLE,FILTER,item),"," checkbox = container.one(sel),"," host;"," "," if (!checkbox) {"," host = this.get(HOST);",""," this._createCheckbox(container, item);",""," checkbox = container.one(sel);",""," host._uiSetHeight(host.get('height'));"," }"," "," checkbox.set(CHECKED, checked);"," }"," },",""," /**"," * Passes checkbox clicks on to the category attribute."," *"," * @method _onCategoryCheckboxClick"," * @param e {Event} the DOM event"," * @protected"," */"," _onCategoryCheckboxClick : function (e) {"," var t = e.target, cat;",""," if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {"," cat = t.get('value');"," if (cat && cat in this.get(CATEGORY)) {"," this.set(CATEGORY_DOT + cat, t.get(CHECKED), { fromUI: true });"," }"," }"," },",""," /**"," * Passes checkbox clicks on to the source attribute."," *"," * @method _onSourceCheckboxClick"," * @param e {Event} the DOM event"," * @protected"," */"," _onSourceCheckboxClick : function (e) {"," var t = e.target, src;",""," if (t.hasClass(ConsoleFilters.CHROME_CLASSES.filter)) {"," src = t.get('value');"," if (src && src in this.get(SOURCE)) {"," this.set(SOURCE_DOT + src, t.get(CHECKED), { fromUI: true });"," }"," }"," },",""," /**"," * Hides any number of categories from the UI. Convenience method for"," * myConsole.filter.set('category.foo', false); set('category.bar', false);"," * and so on."," *"," * @method hideCategory"," * @param cat* {String} 1..n categories to filter out of the UI"," */"," hideCategory : function (cat, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.hideCategory, this);"," } else {"," this.set(CATEGORY_DOT + cat, false);"," }"," },",""," /**"," * Shows any number of categories in the UI. Convenience method for"," * myConsole.filter.set('category.foo', true); set('category.bar', true);"," * and so on."," *"," * @method showCategory"," * @param cat* {String} 1..n categories to allow to display in the UI"," */"," showCategory : function (cat, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.showCategory, this);"," } else {"," this.set(CATEGORY_DOT + cat, true);"," }"," },",""," /**"," * Hides any number of sources from the UI. Convenience method for"," * myConsole.filter.set('source.foo', false); set('source.bar', false);"," * and so on."," *"," * @method hideSource"," * @param src* {String} 1..n sources to filter out of the UI"," */"," hideSource : function (src, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.hideSource, this);"," } else {"," this.set(SOURCE_DOT + src, false);"," }"," },",""," /**"," * Shows any number of sources in the UI. Convenience method for"," * myConsole.filter.set('source.foo', true); set('source.bar', true);"," * and so on."," *"," * @method showSource"," * @param src* {String} 1..n sources to allow to display in the UI"," */"," showSource : function (src, multiple) {"," if (isString(multiple)) {"," Y.Array.each(arguments, this.showSource, this);"," } else {"," this.set(SOURCE_DOT + src, true);"," }"," },",""," /**"," * Creates a checkbox and label from the ConsoleFilters.FILTER_TEMPLATE for"," * the provided type and name. The checkbox and label are appended to the"," * container node passes as the first arg."," *"," * @method _createCheckbox"," * @param container {Node} the parentNode of the new checkbox and label"," * @param name {String} the identifier of the filter"," * @protected"," */"," _createCheckbox : function (container, name) {"," var info = Y.merge(ConsoleFilters.CHROME_CLASSES, {"," filter_name : name,"," filter_class : getCN(CONSOLE, FILTER, name)"," }),"," node = Y.Node.create("," Y.Lang.sub(ConsoleFilters.FILTER_TEMPLATE, info));",""," container.appendChild(node);"," },",""," /**"," * Validates category updates are objects and the subattribute is not too"," * deep."," *"," * @method _validateCategory"," * @param cat {String} the new category:visibility map"," * @param v {String} the subattribute path updated"," * @return Boolean"," * @protected"," */"," _validateCategory : function (cat, v) {"," return Y.Lang.isObject(v,true) && cat.split(/\\./).length < 3;"," },",""," /**"," * Validates source updates are objects and the subattribute is not too"," * deep."," *"," * @method _validateSource"," * @param cat {String} the new source:visibility map"," * @param v {String} the subattribute path updated"," * @return Boolean"," * @protected"," */"," _validateSource : function (src, v) {"," return Y.Lang.isObject(v,true) && src.split(/\\./).length < 3;"," },",""," /**"," * Setter method for cacheLimit attribute. Basically a validator to ensure"," * numeric input."," *"," * @method _setCacheLimit"," * @param v {Number} Maximum number of entries"," * @return {Number}"," * @protected"," */"," _setCacheLimit: function (v) {"," if (Y.Lang.isNumber(v)) {"," this._cacheLimit = v;"," return v;"," } else {"," return Y.Attribute.INVALID_VALUE;"," }"," }","},","","// Y.Plugin.ConsoleFilters static properties","{"," /**"," * Plugin name."," *"," * @property NAME"," * @type String"," * @static"," * @default 'consoleFilters'"," */"," NAME : 'consoleFilters',",""," /**"," * The namespace hung off the host object that this plugin will inhabit."," *"," * @property NS"," * @type String"," * @static"," * @default 'filter'"," */"," NS : FILTER,",""," /**"," * Markup template used to create the container for the category filters."," *"," * @property CATEGORIES_TEMPLATE"," * @type String"," * @static"," */"," CATEGORIES_TEMPLATE :"," '<div class=\"{categories}\"></div>',",""," /**"," * Markup template used to create the container for the source filters."," *"," * @property SOURCES_TEMPLATE"," * @type String"," * @static"," */"," SOURCES_TEMPLATE :"," '<div class=\"{sources}\"></div>',",""," /**"," * Markup template used to create the category and source filter checkboxes."," *"," * @property FILTER_TEMPLATE"," * @type String"," * @static"," */"," FILTER_TEMPLATE :"," // IE8 and FF3 don't permit breaking _between_ nowrap elements. IE8"," // doesn't understand (non spec) wbr tag, nor does it create text nodes"," // for spaces in innerHTML strings. The thin-space entity suffices to"," // create a breakable point."," '<label class=\"{filter_label}\">'+"," '<input type=\"checkbox\" value=\"{filter_name}\" '+"," 'class=\"{filter} {filter_class}\"> {filter_name}'+"," '</label> ',",""," /** "," * Classnames used by the templates when creating nodes."," *"," * @property CHROME_CLASSES"," * @type Object"," * @static"," * @protected"," */"," CHROME_CLASSES : {"," categories : getCN(CONSOLE,FILTERS,'categories'),"," sources : getCN(CONSOLE,FILTERS,'sources'),"," category : getCN(CONSOLE,FILTER,CATEGORY),"," source : getCN(CONSOLE,FILTER,SOURCE),"," filter : getCN(CONSOLE,FILTER),"," filter_label : getCN(CONSOLE,FILTER,'label')"," },",""," ATTRS : {"," /**"," * Default visibility applied to new categories and sources."," *"," * @attribute defaultVisibility"," * @type {Boolean}"," * @default true"," */"," defaultVisibility : {"," value : true,"," validator : Y.Lang.isBoolean"," },",""," /**"," * <p>Map of entry categories to their visibility status. Update a"," * particular category's visibility by setting the subattribute to true"," * (visible) or false (hidden).</p>"," *"," * <p>For example, yconsole.filter.set('category.info', false) to hide"," * log entries with the category/logLevel of 'info'.</p>"," *"," * <p>Similarly, yconsole.filter.get('category.warn') will return a"," * boolean indicating whether that category is currently being included"," * in the UI.</p>"," *"," * <p>Unlike the YUI instance configuration's logInclude and logExclude"," * properties, filtered entries are only hidden from the UI, but"," * can be made visible again.</p>"," *"," * @attribute category"," * @type Object"," */"," category : {"," value : {},"," validator : function (v,k) {"," return this._validateCategory(k,v);"," }"," },",""," /**"," * <p>Map of entry sources to their visibility status. Update a"," * particular sources's visibility by setting the subattribute to true"," * (visible) or false (hidden).</p>"," *"," * <p>For example, yconsole.filter.set('sources.slider', false) to hide"," * log entries originating from Y.Slider.</p>"," *"," * @attribute source"," * @type Object"," */"," source : {"," value : {},"," validator : function (v,k) {"," return this._validateSource(k,v);"," }"," },",""," /**"," * Maximum number of entries to store in the message cache. Use this to"," * limit the memory footprint in environments with heavy log usage."," * By default, there is no limit (Number.POSITIVE_INFINITY)."," *"," * @attribute cacheLimit"," * @type {Number}"," * @default Number.POSITIVE_INFINITY"," */"," cacheLimit : {"," value : Number.POSITIVE_INFINITY,"," setter : function (v) {"," return this._setCacheLimit(v);"," }"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"plugin\", \"console\"], \"skinnable\": true});"]; _yuitest_coverage["build/console-filters/console-filters.js"].lines = {"1":0,"14":0,"37":0,"38":0,"41":0,"93":0,"95":0,"97":0,"98":0,"99":0,"101":0,"103":0,"104":0,"105":0,"106":0,"109":0,"121":0,"123":0,"124":0,"126":0,"127":0,"138":0,"141":0,"142":0,"146":0,"148":0,"152":0,"164":0,"166":0,"168":0,"169":0,"178":0,"179":0,"182":0,"183":0,"186":0,"200":0,"202":0,"209":0,"210":0,"213":0,"214":0,"215":0,"216":0,"219":0,"220":0,"221":0,"222":0,"225":0,"226":0,"237":0,"250":0,"255":0,"256":0,"258":0,"261":0,"262":0,"276":0,"281":0,"282":0,"284":0,"287":0,"288":0,"300":0,"306":0,"307":0,"308":0,"309":0,"310":0,"311":0,"314":0,"315":0,"327":0,"328":0,"330":0,"331":0,"343":0,"352":0,"353":0,"356":0,"357":0,"358":0,"359":0,"360":0,"364":0,"365":0,"366":0,"381":0,"382":0,"389":0,"390":0,"392":0,"394":0,"396":0,"399":0,"411":0,"413":0,"414":0,"415":0,"416":0,"429":0,"431":0,"432":0,"433":0,"434":0,"448":0,"449":0,"451":0,"464":0,"465":0,"467":0,"480":0,"481":0,"483":0,"496":0,"497":0,"499":0,"514":0,"521":0,"535":0,"549":0,"562":0,"563":0,"564":0,"566":0,"682":0,"700":0,"716":0}; _yuitest_coverage["build/console-filters/console-filters.js"].functions = {"ConsoleFilters:37":0,"initializer:92":0,"destructor:118":0,"renderUI:137":0,"bindUI:163":0,"(anonymous 2):178":0,"(anonymous 3):182":0,"syncUI:177":0,"_onEntry:199":0,"_afterClearConsole:236":0,"_afterCategoryChange:249":0,"_afterSourceChange:275":0,"_filterBuffer:299":0,"_afterCacheLimitChange:326":0,"refreshConsole:342":0,"_uiSetCheckbox:380":0,"_onCategoryCheckboxClick:410":0,"_onSourceCheckboxClick:428":0,"hideCategory:447":0,"showCategory:463":0,"hideSource:479":0,"showSource:495":0,"_createCheckbox:513":0,"_validateCategory:534":0,"_validateSource:548":0,"_setCacheLimit:561":0,"validator:681":0,"validator:699":0,"setter:715":0,"(anonymous 1):1":0}; _yuitest_coverage["build/console-filters/console-filters.js"].coveredLines = 128;@@ -917,4 +917,4 @@ }); -}, '3.7.2', {"requires": ["plugin", "console"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "console"], "skinnable": true});
bundle/console-filters/console-filters-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -726,4 +726,4 @@ }); -}, '3.7.2', {"requires": ["plugin", "console"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "console"], "skinnable": true});
bundle/console-filters/console-filters-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("console-filters",function(e,t){function b(){b.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="console",i="filters",s="filter",o="category",u="source",a="category.",f="source.",l="host",c="checked",h="defaultVisibility",p=".",d="",v=p+e.Console.CHROME_CLASSES.console_bd_class,m=p+e.Console.CHROME_CLASSES.console_ft_class,g="input[type=checkbox].",y=e.Lang.isString;e.namespace("Plugin").ConsoleFilters=e.extend(b,e.Plugin.Base,{_entries:null,_cacheLimit:Number.POSITIVE_INFINITY,_categories:null,_sources:null,initializer:function(){this._entries=[],this.get(l).on("entry",this._onEntry,this),this.doAfter("renderUI",this.renderUI),this.doAfter("syncUI",this.syncUI),this.doAfter("bindUI",this.bindUI),this.doAfter("clearConsole",this._afterClearConsole),this.get(l).get("rendered")&&(this.renderUI(),this.syncUI(),this.bindUI()),this.after("cacheLimitChange",this._afterCacheLimitChange)},destructor:function(){this._entries=[],this._categories&&this._categories.remove(),this._sources&&this._sources.remove()},renderUI:function(){var t=this.get(l).get("contentBox").one(m),n;t&&(n=e.Lang.sub(b.CATEGORIES_TEMPLATE,b.CHROME_CLASSES),this._categories=t.appendChild(e.Node.create(n)),n=e.Lang.sub(b.SOURCES_TEMPLATE,b.CHROME_CLASSES),this._sources=t.appendChild(e.Node.create(n)))},bindUI:function(){this._categories.on("click",e.bind(this._onCategoryCheckboxClick,this)),this._sources.on("click",e.bind(this._onSourceCheckboxClick,this)),this.after("categoryChange",this._afterCategoryChange),this.after("sourceChange",this._afterSourceChange)},syncUI:function(){e.each(this.get(o),function(e,t){this._uiSetCheckbox(o,t,e)},this),e.each(this.get(u),function(e,t){this._uiSetCheckbox(u,t,e)},this),this.refreshConsole()},_onEntry:function(e){this._entries.push(e.message);var t=a+e.message.category,n=f+e.message.source,r=this.get(t),i=this.get(n),s=this._entries.length-this._cacheLimit,o;s>0&&this._entries.splice(0,s),r===undefined&&(o=this.get(h),this.set(t,o),r=o),i===undefined&&(o=this.get(h),this.set(n,o),i=o),(!r||!i)&&e.preventDefault()},_afterClearConsole:function(){this._entries=[]},_afterCategoryChange:function(e){var t=e.subAttrName.replace(/category\./,d),n=e.prevVal,r=e.newVal;if(!t||n[t]!==undefined)this.refreshConsole(),this._filterBuffer();t&&!e.fromUI&&this._uiSetCheckbox(o,t,r[t])},_afterSourceChange:function(e){var t=e.subAttrName.replace(/source\./,d),n=e.prevVal,r=e.newVal;if(!t||n[t]!==undefined)this.refreshConsole(),this._filterBuffer();t&&!e.fromUI&&this._uiSetCheckbox(u,t,r[t])},_filterBuffer:function(){var e=this.get(o),t=this.get(u),n=this.get(l).buffer,r=null,i;for(i=n.length-1;i>=0;--i)!e[n[i].category]||!t[n[i].source]?r=r||i:r&&(n.splice(i,r-i),r=null);r&&n.splice(0,r+1)},_afterCacheLimitChange:function(e){if(isFinite(e.newVal)){var t=this._entries.length-e.newVal;t>0&&this._entries.splice(0,t)}},refreshConsole:function(){var e=this._entries,t=this.get(l),n=t.get("contentBox").one(v),r=t.get("consoleLimit"),i=this.get(o),s=this.get(u),a=[],f,c;if(n){t._cancelPrintLoop();for(f=e.length-1;f>=0&&r>=0;--f)c=e[f],i[c.category]&&s[c.source]&&(a.unshift(c),--r);n.setHTML(d),t.buffer=a,t.printBuffer()}},_uiSetCheckbox:function(e,t,i){if(e&&t){var u=e===o?this._categories:this._sources,a=g+n(r,s,t),f=u.one(a),h;f||(h=this.get(l),this._createCheckbox(u,t),f=u.one(a),h._uiSetHeight(h.get("height"))),f.set(c,i)}},_onCategoryCheckboxClick:function(e){var t=e.target,n;t.hasClass(b.CHROME_CLASSES.filter)&&(n=t.get("value"),n&&n in this.get(o)&&this.set(a+n,t.get(c),{fromUI:!0}))},_onSourceCheckboxClick:function(e){var t=e.target,n;t.hasClass(b.CHROME_CLASSES.filter)&&(n=t.get("value"),n&&n in this.get(u)&&this.set(f+n,t.get(c),{fromUI:!0}))},hideCategory:function(t,n){y(n)?e.Array.each(arguments,this.hideCategory,this):this.set(a+t,!1)},showCategory:function(t,n){y(n)?e.Array.each(arguments,this.showCategory,this):this.set(a+t,!0)},hideSource:function(t,n){y(n)?e.Array.each(arguments,this.hideSource,this):this.set(f+t,!1)},showSource:function(t,n){y(n)?e.Array.each(arguments,this.showSource,this):this.set(f+t,!0)},_createCheckbox:function(t,i){var o=e.merge(b.CHROME_CLASSES,{filter_name:i,filter_class:n(r,s,i)}),u=e.Node.create(e.Lang.sub(b.FILTER_TEMPLATE,o));t.appendChild(u)},_validateCategory:function(t,n){return e.Lang.isObject(n,!0)&&t.split(/\./).length<3},_validateSource:function(t,n){return e.Lang.isObject(n,!0)&&t.split(/\./).length<3},_setCacheLimit:function(t){return e.Lang.isNumber(t)?(this._cacheLimit=t,t):e.Attribute.INVALID_VALUE}},{NAME:"consoleFilters",NS:s,CATEGORIES_TEMPLATE:'<div class="{categories}"></div>',SOURCES_TEMPLATE:'<div class="{sources}"></div>',FILTER_TEMPLATE:'<label class="{filter_label}"><input type="checkbox" value="{filter_name}" class="{filter} {filter_class}"> {filter_name}</label> ',CHROME_CLASSES:{categories:n(r,i,"categories"),sources:n(r,i,"sources"),category:n(r,s,o),source:n(r,s,u),filter:n(r,s),filter_label:n(r,s,"label")},ATTRS:{defaultVisibility:{value:!0,validator:e.Lang.isBoolean},category:{value:{},validator:function(e,t){return this._validateCategory(t,e)}},source:{value:{},validator:function(e,t){return this._validateSource(t,e)}},cacheLimit:{value:Number.POSITIVE_INFINITY,setter:function(e){return this._setCacheLimit(e)}}}})},"3.7.2",{requires:["plugin","console"],skinnable:!0});+YUI.add("console-filters",function(e,t){function b(){b.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="console",i="filters",s="filter",o="category",u="source",a="category.",f="source.",l="host",c="checked",h="defaultVisibility",p=".",d="",v=p+e.Console.CHROME_CLASSES.console_bd_class,m=p+e.Console.CHROME_CLASSES.console_ft_class,g="input[type=checkbox].",y=e.Lang.isString;e.namespace("Plugin").ConsoleFilters=e.extend(b,e.Plugin.Base,{_entries:null,_cacheLimit:Number.POSITIVE_INFINITY,_categories:null,_sources:null,initializer:function(){this._entries=[],this.get(l).on("entry",this._onEntry,this),this.doAfter("renderUI",this.renderUI),this.doAfter("syncUI",this.syncUI),this.doAfter("bindUI",this.bindUI),this.doAfter("clearConsole",this._afterClearConsole),this.get(l).get("rendered")&&(this.renderUI(),this.syncUI(),this.bindUI()),this.after("cacheLimitChange",this._afterCacheLimitChange)},destructor:function(){this._entries=[],this._categories&&this._categories.remove(),this._sources&&this._sources.remove()},renderUI:function(){var t=this.get(l).get("contentBox").one(m),n;t&&(n=e.Lang.sub(b.CATEGORIES_TEMPLATE,b.CHROME_CLASSES),this._categories=t.appendChild(e.Node.create(n)),n=e.Lang.sub(b.SOURCES_TEMPLATE,b.CHROME_CLASSES),this._sources=t.appendChild(e.Node.create(n)))},bindUI:function(){this._categories.on("click",e.bind(this._onCategoryCheckboxClick,this)),this._sources.on("click",e.bind(this._onSourceCheckboxClick,this)),this.after("categoryChange",this._afterCategoryChange),this.after("sourceChange",this._afterSourceChange)},syncUI:function(){e.each(this.get(o),function(e,t){this._uiSetCheckbox(o,t,e)},this),e.each(this.get(u),function(e,t){this._uiSetCheckbox(u,t,e)},this),this.refreshConsole()},_onEntry:function(e){this._entries.push(e.message);var t=a+e.message.category,n=f+e.message.source,r=this.get(t),i=this.get(n),s=this._entries.length-this._cacheLimit,o;s>0&&this._entries.splice(0,s),r===undefined&&(o=this.get(h),this.set(t,o),r=o),i===undefined&&(o=this.get(h),this.set(n,o),i=o),(!r||!i)&&e.preventDefault()},_afterClearConsole:function(){this._entries=[]},_afterCategoryChange:function(e){var t=e.subAttrName.replace(/category\./,d),n=e.prevVal,r=e.newVal;if(!t||n[t]!==undefined)this.refreshConsole(),this._filterBuffer();t&&!e.fromUI&&this._uiSetCheckbox(o,t,r[t])},_afterSourceChange:function(e){var t=e.subAttrName.replace(/source\./,d),n=e.prevVal,r=e.newVal;if(!t||n[t]!==undefined)this.refreshConsole(),this._filterBuffer();t&&!e.fromUI&&this._uiSetCheckbox(u,t,r[t])},_filterBuffer:function(){var e=this.get(o),t=this.get(u),n=this.get(l).buffer,r=null,i;for(i=n.length-1;i>=0;--i)!e[n[i].category]||!t[n[i].source]?r=r||i:r&&(n.splice(i,r-i),r=null);r&&n.splice(0,r+1)},_afterCacheLimitChange:function(e){if(isFinite(e.newVal)){var t=this._entries.length-e.newVal;t>0&&this._entries.splice(0,t)}},refreshConsole:function(){var e=this._entries,t=this.get(l),n=t.get("contentBox").one(v),r=t.get("consoleLimit"),i=this.get(o),s=this.get(u),a=[],f,c;if(n){t._cancelPrintLoop();for(f=e.length-1;f>=0&&r>=0;--f)c=e[f],i[c.category]&&s[c.source]&&(a.unshift(c),--r);n.setHTML(d),t.buffer=a,t.printBuffer()}},_uiSetCheckbox:function(e,t,i){if(e&&t){var u=e===o?this._categories:this._sources,a=g+n(r,s,t),f=u.one(a),h;f||(h=this.get(l),this._createCheckbox(u,t),f=u.one(a),h._uiSetHeight(h.get("height"))),f.set(c,i)}},_onCategoryCheckboxClick:function(e){var t=e.target,n;t.hasClass(b.CHROME_CLASSES.filter)&&(n=t.get("value"),n&&n in this.get(o)&&this.set(a+n,t.get(c),{fromUI:!0}))},_onSourceCheckboxClick:function(e){var t=e.target,n;t.hasClass(b.CHROME_CLASSES.filter)&&(n=t.get("value"),n&&n in this.get(u)&&this.set(f+n,t.get(c),{fromUI:!0}))},hideCategory:function(t,n){y(n)?e.Array.each(arguments,this.hideCategory,this):this.set(a+t,!1)},showCategory:function(t,n){y(n)?e.Array.each(arguments,this.showCategory,this):this.set(a+t,!0)},hideSource:function(t,n){y(n)?e.Array.each(arguments,this.hideSource,this):this.set(f+t,!1)},showSource:function(t,n){y(n)?e.Array.each(arguments,this.showSource,this):this.set(f+t,!0)},_createCheckbox:function(t,i){var o=e.merge(b.CHROME_CLASSES,{filter_name:i,filter_class:n(r,s,i)}),u=e.Node.create(e.Lang.sub(b.FILTER_TEMPLATE,o));t.appendChild(u)},_validateCategory:function(t,n){return e.Lang.isObject(n,!0)&&t.split(/\./).length<3},_validateSource:function(t,n){return e.Lang.isObject(n,!0)&&t.split(/\./).length<3},_setCacheLimit:function(t){return e.Lang.isNumber(t)?(this._cacheLimit=t,t):e.Attribute.INVALID_VALUE}},{NAME:"consoleFilters",NS:s,CATEGORIES_TEMPLATE:'<div class="{categories}"></div>',SOURCES_TEMPLATE:'<div class="{sources}"></div>',FILTER_TEMPLATE:'<label class="{filter_label}"><input type="checkbox" value="{filter_name}" class="{filter} {filter_class}"> {filter_name}</label> ',CHROME_CLASSES:{categories:n(r,i,"categories"),sources:n(r,i,"sources"),category:n(r,s,o),source:n(r,s,u),filter:n(r,s),filter_label:n(r,s,"label")},ATTRS:{defaultVisibility:{value:!0,validator:e.Lang.isBoolean},category:{value:{},validator:function(e,t){return this._validateCategory(t,e)}},source:{value:{},validator:function(e,t){return this._validateSource(t,e)}},cacheLimit:{value:Number.POSITIVE_INFINITY,setter:function(e){return this._setCacheLimit(e)}}}})},"3.7.3",{requires:["plugin","console"],skinnable:!0});
bundle/console-filters/console-filters.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -726,4 +726,4 @@ }); -}, '3.7.2', {"requires": ["plugin", "console"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "console"], "skinnable": true});
bundle/console/assets/console-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console/assets/console-filters-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console/assets/skins/sam/console-filters-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console/assets/skins/sam/console-filters.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console/assets/skins/sam/console-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console/assets/skins/sam/console.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/console/console-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/console/console.js", code: [] };-_yuitest_coverage["build/console/console.js"].code=["YUI.add('console', function (Y, NAME) {","","/**"," * Console creates a visualization for messages logged through calls to a YUI"," * instance's <code>Y.log( message, category, source )</code> method. The"," * debug versions of YUI modules will include logging statements to offer some"," * insight into the steps executed during that module's operation. Including"," * log statements in your code will cause those messages to also appear in the"," * Console. Use Console to aid in developing your page or application."," *"," * Entry categories "info", "warn", and "error""," * are also referred to as the log level, and entries are filtered against the"," * configured logLevel."," *"," * @module console"," * @class Console"," * @extends Widget"," * @param conf {Object} Configuration object (see Configuration attributes)"," * @constructor"," */","var getCN = Y.ClassNameManager.getClassName,"," CHECKED = 'checked',"," CLEAR = 'clear',"," CLICK = 'click',"," COLLAPSED = 'collapsed',"," CONSOLE = 'console',"," CONTENT_BOX = 'contentBox',"," DISABLED = 'disabled',"," ENTRY = 'entry',"," ERROR = 'error',"," HEIGHT = 'height',"," INFO = 'info',"," LAST_TIME = 'lastTime',"," PAUSE = 'pause',"," PAUSED = 'paused',"," RESET = 'reset',"," START_TIME = 'startTime',"," TITLE = 'title',"," WARN = 'warn',",""," DOT = '.',",""," C_BUTTON = getCN(CONSOLE,'button'),"," C_CHECKBOX = getCN(CONSOLE,'checkbox'),"," C_CLEAR = getCN(CONSOLE,CLEAR),"," C_COLLAPSE = getCN(CONSOLE,'collapse'),"," C_COLLAPSED = getCN(CONSOLE,COLLAPSED),"," C_CONSOLE_CONTROLS = getCN(CONSOLE,'controls'),"," C_CONSOLE_HD = getCN(CONSOLE,'hd'),"," C_CONSOLE_BD = getCN(CONSOLE,'bd'),"," C_CONSOLE_FT = getCN(CONSOLE,'ft'),"," C_CONSOLE_TITLE = getCN(CONSOLE,TITLE),"," C_ENTRY = getCN(CONSOLE,ENTRY),"," C_ENTRY_CAT = getCN(CONSOLE,ENTRY,'cat'),"," C_ENTRY_CONTENT = getCN(CONSOLE,ENTRY,'content'),"," C_ENTRY_META = getCN(CONSOLE,ENTRY,'meta'),"," C_ENTRY_SRC = getCN(CONSOLE,ENTRY,'src'),"," C_ENTRY_TIME = getCN(CONSOLE,ENTRY,'time'),"," C_PAUSE = getCN(CONSOLE,PAUSE),"," C_PAUSE_LABEL = getCN(CONSOLE,PAUSE,'label'),",""," RE_INLINE_SOURCE = /^(\\S+)\\s/,"," RE_AMP = /&(?!#?[a-z0-9]+;)/g,"," RE_GT = />/g,"," RE_LT = /</g,",""," ESC_AMP = '&',"," ESC_GT = '>',"," ESC_LT = '<',"," "," ENTRY_TEMPLATE_STR ="," '<div class=\"{entry_class} {cat_class} {src_class}\">'+"," '<p class=\"{entry_meta_class}\">'+"," '<span class=\"{entry_src_class}\">'+"," '{sourceAndDetail}'+"," '</span>'+"," '<span class=\"{entry_cat_class}\">'+"," '{category}</span>'+"," '<span class=\"{entry_time_class}\">'+"," ' {totalTime}ms (+{elapsedTime}) {localTime}'+"," '</span>'+"," '</p>'+"," '<pre class=\"{entry_content_class}\">{message}</pre>'+"," '</div>',",""," L = Y.Lang,"," create = Y.Node.create,"," isNumber = L.isNumber,"," isString = L.isString,"," merge = Y.merge,"," substitute = Y.Lang.sub;"," ","","function Console() {"," Console.superclass.constructor.apply(this,arguments);","}","","Y.Console = Y.extend(Console, Y.Widget,","","// Y.Console prototype","{"," /**"," * Category to prefix all event subscriptions to allow for ease of detach"," * during destroy."," *"," * @property _evtCat"," * @type string"," * @protected"," */"," _evtCat : null,",""," /**"," * Reference to the Node instance containing the header contents."," *"," * @property _head"," * @type Node"," * @default null"," * @protected"," */"," _head : null,",""," /**"," * Reference to the Node instance that will house the console messages."," *"," * @property _body"," * @type Node"," * @default null"," * @protected"," */"," _body : null,",""," /**"," * Reference to the Node instance containing the footer contents."," *"," * @property _foot"," * @type Node"," * @default null"," * @protected"," */"," _foot : null,",""," /**"," * Holds the object API returned from <code>Y.later</code> for the print"," * loop interval."," *"," * @property _printLoop"," * @type Object"," * @default null"," * @protected"," */"," _printLoop : null,",""," /**"," * Array of normalized message objects awaiting printing."," *"," * @property buffer"," * @type Array"," * @default null"," * @protected"," */"," buffer : null,",""," /**"," * Wrapper for <code>Y.log</code>."," *"," * @method log"," * @param arg* {MIXED} (all arguments passed through to <code>Y.log</code>)"," * @chainable"," */"," log : function () {"," Y.log.apply(Y,arguments);",""," return this;"," },",""," /**"," * Clear the console of messages and flush the buffer of pending messages."," *"," * @method clearConsole"," * @chainable"," */"," clearConsole : function () {"," // TODO: clear event listeners from console contents"," this._body.empty();",""," this._cancelPrintLoop();",""," this.buffer = [];",""," return this;"," },",""," /**"," * Clears the console and resets internal timers."," *"," * @method reset"," * @chainable"," */"," reset : function () {"," this.fire(RESET);"," "," return this;"," },",""," /**"," * Collapses the body and footer."," *"," * @method collapse"," * @chainable"," */"," collapse : function () {"," this.set(COLLAPSED, true);",""," return this;"," },",""," /**"," * Expands the body and footer if collapsed."," *"," * @method expand"," * @chainable"," */"," expand : function () {"," this.set(COLLAPSED, false);",""," return this;"," },",""," /**"," * Outputs buffered messages to the console UI. This is typically called"," * from a scheduled interval until the buffer is empty (referred to as the"," * print loop). The number of buffered messages output to the Console is"," * limited to the number provided as an argument. If no limit is passed,"," * all buffered messages are rendered."," * "," * @method printBuffer"," * @param limit {Number} (optional) max number of buffered entries to write"," * @chainable"," */"," printBuffer: function (limit) {"," var messages = this.buffer,"," debug = Y.config.debug,"," entries = [],"," consoleLimit= this.get('consoleLimit'),"," newestOnTop = this.get('newestOnTop'),"," anchor = newestOnTop ? this._body.get('firstChild') : null,"," i;",""," if (messages.length > consoleLimit) {"," messages.splice(0, messages.length - consoleLimit);"," }",""," limit = Math.min(messages.length, (limit || messages.length));"," "," // turn off logging system"," Y.config.debug = false;",""," if (!this.get(PAUSED) && this.get('rendered')) {",""," for (i = 0; i < limit && messages.length; ++i) {"," entries[i] = this._createEntryHTML(messages.shift());"," }",""," if (!messages.length) {"," this._cancelPrintLoop();"," }",""," if (entries.length) {"," if (newestOnTop) {"," entries.reverse();"," }",""," this._body.insertBefore(create(entries.join('')), anchor);",""," if (this.get('scrollIntoView')) {"," this.scrollToLatest();"," }",""," this._trimOldEntries();"," }"," }",""," // restore logging system"," Y.config.debug = debug;",""," return this;"," },",""," "," /**"," * Constructor code. Set up the buffer and entry template, publish"," * internal events, and subscribe to the configured logEvent."," * "," * @method initializer"," * @protected"," */"," initializer : function () {"," this._evtCat = Y.stamp(this) + '|';",""," this.buffer = [];",""," this.get('logSource').on(this._evtCat +"," this.get('logEvent'),Y.bind(\"_onLogEvent\",this));",""," /**"," * Transfers a received message to the print loop buffer. Default"," * behavior defined in _defEntryFn."," *"," * @event entry"," * @param event {Event.Facade} An Event Facade object with the following attribute specific properties added:"," * <dl>"," * <dt>message</dt>"," * <dd>The message data normalized into an object literal (see _normalizeMessage)</dd>"," * </dl>"," * @preventable _defEntryFn"," */"," this.publish(ENTRY, { defaultFn: this._defEntryFn });",""," /**"," * Triggers the reset behavior via the default logic in _defResetFn."," *"," * @event reset"," * @param event {Event.Facade} Event Facade object"," * @preventable _defResetFn"," */"," this.publish(RESET, { defaultFn: this._defResetFn });",""," this.after('rendered', this._schedulePrint);"," },",""," /**"," * Tears down the instance, flushing event subscriptions and purging the UI."," *"," * @method destructor"," * @protected"," */"," destructor : function () {"," var bb = this.get('boundingBox');",""," this._cancelPrintLoop();",""," this.get('logSource').detach(this._evtCat + '*');"," "," bb.purge(true);"," },",""," /**"," * Generate the Console UI."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," this._initHead();"," this._initBody();"," this._initFoot();",""," // Apply positioning to the bounding box if appropriate"," var style = this.get('style');"," if (style !== 'block') {"," this.get('boundingBox').addClass(this.getClassName(style));"," }"," },",""," /**"," * Sync the UI state to the current attribute state."," *"," * @method syncUI"," */"," syncUI : function () {"," this._uiUpdatePaused(this.get(PAUSED));"," this._uiUpdateCollapsed(this.get(COLLAPSED));"," this._uiSetHeight(this.get(HEIGHT));"," },",""," /**"," * Set up event listeners to wire up the UI to the internal state."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," this.get(CONTENT_BOX).one('button.'+C_COLLAPSE)."," on(CLICK,this._onCollapseClick,this);",""," this.get(CONTENT_BOX).one('input[type=checkbox].'+C_PAUSE)."," on(CLICK,this._onPauseClick,this);",""," this.get(CONTENT_BOX).one('button.'+C_CLEAR)."," on(CLICK,this._onClearClick,this);",""," // Attribute changes"," this.after(this._evtCat + 'stringsChange',"," this._afterStringsChange);"," this.after(this._evtCat + 'pausedChange',"," this._afterPausedChange);"," this.after(this._evtCat + 'consoleLimitChange',"," this._afterConsoleLimitChange);"," this.after(this._evtCat + 'collapsedChange',"," this._afterCollapsedChange);"," },",""," "," /**"," * Create the DOM structure for the header elements."," *"," * @method _initHead"," * @protected"," */"," _initHead : function () {"," var cb = this.get(CONTENT_BOX),"," info = merge(Console.CHROME_CLASSES, {"," str_collapse : this.get('strings.collapse'),"," str_title : this.get('strings.title')"," });",""," this._head = create(substitute(Console.HEADER_TEMPLATE,info));",""," cb.insertBefore(this._head,cb.get('firstChild'));"," },",""," /**"," * Create the DOM structure for the console body—where messages are"," * rendered."," *"," * @method _initBody"," * @protected"," */"," _initBody : function () {"," this._body = create(substitute("," Console.BODY_TEMPLATE,"," Console.CHROME_CLASSES));",""," this.get(CONTENT_BOX).appendChild(this._body);"," },",""," /**"," * Create the DOM structure for the footer elements."," *"," * @method _initFoot"," * @protected"," */"," _initFoot : function () {"," var info = merge(Console.CHROME_CLASSES, {"," id_guid : Y.guid(),"," str_pause : this.get('strings.pause'),"," str_clear : this.get('strings.clear')"," });",""," this._foot = create(substitute(Console.FOOTER_TEMPLATE,info));",""," this.get(CONTENT_BOX).appendChild(this._foot);"," },",""," /**"," * Determine if incoming log messages are within the configured logLevel"," * to be buffered for printing."," *"," * @method _isInLogLevel"," * @protected"," */"," _isInLogLevel : function (e) {"," var cat = e.cat, lvl = this.get('logLevel');",""," if (lvl !== INFO) {"," cat = cat || INFO;",""," if (isString(cat)) {"," cat = cat.toLowerCase();"," }",""," if ((cat === WARN && lvl === ERROR) ||"," (cat === INFO && lvl !== INFO)) {"," return false;"," }"," }",""," return true;"," },",""," /**"," * Create a log entry message from the inputs including the following keys:"," * <ul>"," * <li>time - this moment</li>"," * <li>message - leg message</li>"," * <li>category - logLevel or custom category for the message</li>"," * <li>source - when provided, the widget or util calling Y.log</li>"," * <li>sourceAndDetail - same as source but can include instance info</li>"," * <li>localTime - readable version of time</li>"," * <li>elapsedTime - ms since last entry</li>"," * <li>totalTime - ms since Console was instantiated or reset</li>"," * </ul>"," *"," * @method _normalizeMessage"," * @param e {Event} custom event containing the log message"," * @return Object the message object"," * @protected"," */"," _normalizeMessage : function (e) {",""," var msg = e.msg,"," cat = e.cat,"," src = e.src,",""," m = {"," time : new Date(),"," message : msg,"," category : cat || this.get('defaultCategory'),"," sourceAndDetail : src || this.get('defaultSource'),"," source : null,"," localTime : null,"," elapsedTime : null,"," totalTime : null"," };",""," // Extract m.source \"Foo\" from m.sourceAndDetail \"Foo bar baz\""," m.source = RE_INLINE_SOURCE.test(m.sourceAndDetail) ?"," RegExp.$1 : m.sourceAndDetail;"," m.localTime = m.time.toLocaleTimeString ? "," m.time.toLocaleTimeString() : (m.time + '');"," m.elapsedTime = m.time - this.get(LAST_TIME);"," m.totalTime = m.time - this.get(START_TIME);",""," this._set(LAST_TIME,m.time);",""," return m;"," },",""," /**"," * Sets an interval for buffered messages to be output to the console."," *"," * @method _schedulePrint"," * @protected"," */"," _schedulePrint : function () {"," if (!this._printLoop && !this.get(PAUSED) && this.get('rendered')) {"," this._printLoop = Y.later("," this.get('printTimeout'),"," this, this.printBuffer,"," this.get('printLimit'), true);"," }"," },",""," /**"," * Translates message meta into the markup for a console entry."," *"," * @method _createEntryHTML"," * @param m {Object} object literal containing normalized message metadata"," * @return String"," * @protected"," */"," _createEntryHTML : function (m) {"," m = merge("," this._htmlEscapeMessage(m),"," Console.ENTRY_CLASSES,"," {"," cat_class : this.getClassName(ENTRY,m.category),"," src_class : this.getClassName(ENTRY,m.source)"," });",""," return this.get('entryTemplate').replace(/\\{(\\w+)\\}/g,"," function (_,token) {"," return token in m ? m[token] : '';"," });"," },",""," /**"," * Scrolls to the most recent entry"," *"," * @method scrollToLatest"," * @chainable"," */"," scrollToLatest : function () {"," var scrollTop = this.get('newestOnTop') ?"," 0 :"," this._body.get('scrollHeight');",""," this._body.set('scrollTop', scrollTop);"," },",""," /**"," * Performs HTML escaping on strings in the message object."," *"," * @method _htmlEscapeMessage"," * @param m {Object} the normalized message object"," * @return Object the message object with proper escapement"," * @protected"," */"," _htmlEscapeMessage : function (m) {"," m.message = this._encodeHTML(m.message);"," m.source = this._encodeHTML(m.source);"," m.sourceAndDetail = this._encodeHTML(m.sourceAndDetail);"," m.category = this._encodeHTML(m.category);",""," return m;"," },",""," /**"," * Removes the oldest message entries from the UI to maintain the limit"," * specified in the consoleLimit configuration."," *"," * @method _trimOldEntries"," * @protected"," */"," _trimOldEntries : function () {"," // Turn off the logging system for the duration of this operation"," // to prevent an infinite loop"," Y.config.debug = false;",""," var bd = this._body,"," limit = this.get('consoleLimit'),"," debug = Y.config.debug,"," entries,e,i,l;",""," if (bd) {"," entries = bd.all(DOT+C_ENTRY);"," l = entries.size() - limit;",""," if (l > 0) {"," if (this.get('newestOnTop')) {"," i = limit;"," l = entries.size();"," } else {"," i = 0;"," }",""," this._body.setStyle('display','none');",""," for (;i < l; ++i) {"," e = entries.item(i);"," if (e) {"," e.remove();"," }"," }",""," this._body.setStyle('display','');"," }",""," }",""," Y.config.debug = debug;"," },",""," /**"," * Returns the input string with ampersands (&), <, and > encoded"," * as HTML entities."," *"," * @method _encodeHTML"," * @param s {String} the raw string"," * @return String the encoded string"," * @protected"," */"," _encodeHTML : function (s) {"," return isString(s) ?"," s.replace(RE_AMP,ESC_AMP)."," replace(RE_LT, ESC_LT)."," replace(RE_GT, ESC_GT) :"," s;"," },",""," /**"," * Clears the timeout for printing buffered messages."," *"," * @method _cancelPrintLoop"," * @protected"," */"," _cancelPrintLoop : function () {"," if (this._printLoop) {"," this._printLoop.cancel();"," this._printLoop = null;"," }"," },",""," /**"," * Validates input value for style attribute. Accepts only values 'inline',"," * 'block', and 'separate'."," *"," * @method _validateStyle"," * @param style {String} the proposed value"," * @return {Boolean} pass/fail"," * @protected"," */"," _validateStyle : function (style) {"," return style === 'inline' || style === 'block' || style === 'separate';"," },",""," /**"," * Event handler for clicking on the Pause checkbox to update the paused"," * attribute."," *"," * @method _onPauseClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onPauseClick : function (e) {"," this.set(PAUSED,e.target.get(CHECKED));"," },",""," /**"," * Event handler for clicking on the Clear button. Pass-through to"," * <code>this.clearConsole()</code>."," *"," * @method _onClearClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onClearClick : function (e) {"," this.clearConsole();"," },",""," /**"," * Event handler for clicking on the Collapse/Expand button. Sets the"," * "collapsed" attribute accordingly."," *"," * @method _onCollapseClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onCollapseClick : function (e) {"," this.set(COLLAPSED, !this.get(COLLAPSED));"," },","",""," /**"," * Validator for logSource attribute."," *"," * @method _validateLogSource"," * @param v {Object} the desired logSource"," * @return {Boolean} true if the input is an object with an <code>on</code>"," * method"," * @protected"," */"," _validateLogSource: function (v) {"," return v && Y.Lang.isFunction(v.on);"," },",""," /**"," * Setter method for logLevel attribute. Acceptable values are"," * "error", "warn", and "info" (case"," * insensitive). Other values are treated as "info"."," *"," * @method _setLogLevel"," * @param v {String} the desired log level"," * @return String One of Console.LOG_LEVEL_INFO, _WARN, or _ERROR"," * @protected"," */"," _setLogLevel : function (v) {"," if (isString(v)) {"," v = v.toLowerCase();"," }"," "," return (v === WARN || v === ERROR) ? v : INFO;"," },",""," /**"," * Getter method for useBrowserConsole attribute. Just a pass through to"," * the YUI instance configuration setting."," *"," * @method _getUseBrowserConsole"," * @return {Boolean} or null if logSource is not a YUI instance"," * @protected"," */"," _getUseBrowserConsole: function () {"," var logSource = this.get('logSource');"," return logSource instanceof YUI ?"," logSource.config.useBrowserConsole : null;"," },",""," /**"," * Setter method for useBrowserConsole attributes. Only functional if the"," * logSource attribute points to a YUI instance. Passes the value down to"," * the YUI instance. NOTE: multiple Console instances cannot maintain"," * independent useBrowserConsole values, since it is just a pass through to"," * the YUI instance configuration."," *"," * @method _setUseBrowserConsole"," * @param v {Boolean} false to disable browser console printing (default)"," * @return {Boolean} true|false if logSource is a YUI instance"," * @protected"," */"," _setUseBrowserConsole: function (v) {"," var logSource = this.get('logSource');"," if (logSource instanceof YUI) {"," v = !!v;"," logSource.config.useBrowserConsole = v;"," return v;"," } else {"," return Y.Attribute.INVALID_VALUE;"," }"," },",""," /**"," * Set the height of the Console container. Set the body height to the"," * difference between the configured height and the calculated heights of"," * the header and footer."," * Overrides Widget.prototype._uiSetHeight."," *"," * @method _uiSetHeight"," * @param v {String|Number} the new height"," * @protected"," */"," _uiSetHeight : function (v) {"," Console.superclass._uiSetHeight.apply(this,arguments);",""," if (this._head && this._foot) {"," var h = this.get('boundingBox').get('offsetHeight') -"," this._head.get('offsetHeight') -"," this._foot.get('offsetHeight');",""," this._body.setStyle(HEIGHT,h+'px');"," }"," },",""," /**"," * Over-ride default content box sizing to do nothing, since we're sizing"," * the body section to fill out height ourselves."," * "," * @method _uiSizeCB"," * @protected"," */"," _uiSizeCB : function() {"," // Do Nothing. Ideally want to move to Widget-StdMod, which accounts for"," // _uiSizeCB "," },",""," /**"," * Updates the UI if changes are made to any of the strings in the strings"," * attribute."," *"," * @method _afterStringsChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterStringsChange : function (e) {"," var prop = e.subAttrName ? e.subAttrName.split(DOT)[1] : null,"," cb = this.get(CONTENT_BOX),"," before = e.prevVal,"," after = e.newVal;",""," if ((!prop || prop === TITLE) && before.title !== after.title) {"," cb.all(DOT+C_CONSOLE_TITLE).setHTML(after.title);"," }",""," if ((!prop || prop === PAUSE) && before.pause !== after.pause) {"," cb.all(DOT+C_PAUSE_LABEL).setHTML(after.pause);"," }",""," if ((!prop || prop === CLEAR) && before.clear !== after.clear) {"," cb.all(DOT+C_CLEAR).set('value',after.clear);"," }"," },",""," /**"," * Updates the UI and schedules or cancels the print loop."," *"," * @method _afterPausedChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterPausedChange : function (e) {"," var paused = e.newVal;",""," if (e.src !== Y.Widget.SRC_UI) {"," this._uiUpdatePaused(paused);"," }",""," if (!paused) {"," this._schedulePrint();"," } else if (this._printLoop) {"," this._cancelPrintLoop();"," }"," },",""," /**"," * Checks or unchecks the paused checkbox"," *"," * @method _uiUpdatePaused"," * @param on {Boolean} the new checked state"," * @protected"," */"," _uiUpdatePaused : function (on) {"," var node = this._foot.all('input[type=checkbox].'+C_PAUSE);",""," if (node) {"," node.set(CHECKED,on);"," }"," },",""," /**"," * Calls this._trimOldEntries() in response to changes in the configured"," * consoleLimit attribute."," * "," * @method _afterConsoleLimitChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterConsoleLimitChange : function () {"," this._trimOldEntries();"," },","",""," /**"," * Updates the className of the contentBox, which should trigger CSS to"," * hide or show the body and footer sections depending on the new value."," *"," * @method _afterCollapsedChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterCollapsedChange : function (e) {"," this._uiUpdateCollapsed(e.newVal);"," },",""," /**"," * Updates the UI to reflect the new Collapsed state"," *"," * @method _uiUpdateCollapsed"," * @param v {Boolean} true for collapsed, false for expanded"," * @protected"," */"," _uiUpdateCollapsed : function (v) {"," var bb = this.get('boundingBox'),"," button = bb.all('button.'+C_COLLAPSE),"," method = v ? 'addClass' : 'removeClass',"," str = this.get('strings.'+(v ? 'expand' : 'collapse'));",""," bb[method](C_COLLAPSED);",""," if (button) {"," button.setHTML(str);"," }",""," this._uiSetHeight(v ? this._head.get('offsetHeight'): this.get(HEIGHT));"," },",""," /**"," * Makes adjustments to the UI if needed when the Console is hidden or shown"," *"," * @method _afterVisibleChange"," * @param e {Event} the visibleChange event"," * @protected"," */"," _afterVisibleChange : function (e) {"," Console.superclass._afterVisibleChange.apply(this,arguments);",""," this._uiUpdateFromHideShow(e.newVal);"," },",""," /**"," * Recalculates dimensions and updates appropriately when shown"," *"," * @method _uiUpdateFromHideShow"," * @param v {Boolean} true for visible, false for hidden"," * @protected"," */"," _uiUpdateFromHideShow : function (v) {"," if (v) {"," this._uiSetHeight(this.get(HEIGHT));"," }"," },",""," /**"," * Responds to log events by normalizing qualifying messages and passing"," * them along through the entry event for buffering etc."," * "," * @method _onLogEvent"," * @param msg {String} the log message"," * @param cat {String} OPTIONAL the category or logLevel of the message"," * @param src {String} OPTIONAL the source of the message (e.g. widget name)"," * @protected"," */"," _onLogEvent : function (e) {",""," if (!this.get(DISABLED) && this._isInLogLevel(e)) {",""," var debug = Y.config.debug;",""," /* TODO: needed? */"," Y.config.debug = false;",""," this.fire(ENTRY, {"," message : this._normalizeMessage(e)"," });",""," Y.config.debug = debug;"," }"," },",""," /**"," * Clears the console, resets the startTime attribute, enables and"," * unpauses the widget."," *"," * @method _defResetFn"," * @protected"," */"," _defResetFn : function () {"," this.clearConsole();"," this.set(START_TIME,new Date());"," this.set(DISABLED,false);"," this.set(PAUSED,false);"," },",""," /**"," * Buffers incoming message objects and schedules the printing."," *"," * @method _defEntryFn"," * @param e {Event} The Custom event carrying the message in its payload"," * @protected"," */"," _defEntryFn : function (e) {"," if (e.message) {"," this.buffer.push(e.message);"," this._schedulePrint();"," }"," }","","},","","// Y.Console static properties","{"," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME : CONSOLE,",""," /**"," * Static identifier for logLevel configuration setting to allow all"," * incoming messages to generate Console entries."," *"," * @property LOG_LEVEL_INFO"," * @type String"," * @static"," */"," LOG_LEVEL_INFO : INFO,",""," /**"," * Static identifier for logLevel configuration setting to allow only"," * incoming messages of logLevel "warn" or "error""," * to generate Console entries."," *"," * @property LOG_LEVEL_WARN"," * @type String"," * @static"," */"," LOG_LEVEL_WARN : WARN,",""," /**"," * Static identifier for logLevel configuration setting to allow only"," * incoming messages of logLevel "error" to generate"," * Console entries."," *"," * @property LOG_LEVEL_ERROR"," * @type String"," * @static"," */"," LOG_LEVEL_ERROR : ERROR,",""," /**"," * Map (object) of classNames used to populate the placeholders in the"," * Console.ENTRY_TEMPLATE markup when rendering a new Console entry."," *"," * <p>By default, the keys contained in the object are:</p>"," * <ul>"," * <li>entry_class</li>"," * <li>entry_meta_class</li>"," * <li>entry_cat_class</li>"," * <li>entry_src_class</li>"," * <li>entry_time_class</li>"," * <li>entry_content_class</li>"," * </ul>"," *"," * @property ENTRY_CLASSES"," * @type Object"," * @static"," */"," ENTRY_CLASSES : {"," entry_class : C_ENTRY,"," entry_meta_class : C_ENTRY_META,"," entry_cat_class : C_ENTRY_CAT,"," entry_src_class : C_ENTRY_SRC,"," entry_time_class : C_ENTRY_TIME,"," entry_content_class : C_ENTRY_CONTENT"," },",""," /**"," * Map (object) of classNames used to populate the placeholders in the"," * Console.HEADER_TEMPLATE, Console.BODY_TEMPLATE, and"," * Console.FOOTER_TEMPLATE markup when rendering the Console UI."," *"," * <p>By default, the keys contained in the object are:</p>"," * <ul>"," * <li>console_hd_class</li>"," * <li>console_bd_class</li>"," * <li>console_ft_class</li>"," * <li>console_controls_class</li>"," * <li>console_checkbox_class</li>"," * <li>console_pause_class</li>"," * <li>console_pause_label_class</li>"," * <li>console_button_class</li>"," * <li>console_clear_class</li>"," * <li>console_collapse_class</li>"," * <li>console_title_class</li>"," * </ul>"," *"," * @property CHROME_CLASSES"," * @type Object"," * @static"," */"," CHROME_CLASSES : {"," console_hd_class : C_CONSOLE_HD,"," console_bd_class : C_CONSOLE_BD,"," console_ft_class : C_CONSOLE_FT,"," console_controls_class : C_CONSOLE_CONTROLS,"," console_checkbox_class : C_CHECKBOX,"," console_pause_class : C_PAUSE,"," console_pause_label_class : C_PAUSE_LABEL,"," console_button_class : C_BUTTON,"," console_clear_class : C_CLEAR,"," console_collapse_class : C_COLLAPSE,"," console_title_class : C_CONSOLE_TITLE"," },",""," /**"," * Markup template used to generate the DOM structure for the header"," * section of the Console when it is rendered. The template includes"," * these {placeholder}s:"," *"," * <ul>"," * <li>console_button_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_collapse_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_hd_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_title_class - contributed by Console.CHROME_CLASSES</li>"," * <li>str_collapse - pulled from attribute strings.collapse</li>"," * <li>str_title - pulled from attribute strings.title</li>"," * </ul>"," *"," * @property HEADER_TEMPLATE"," * @type String"," * @static"," */"," HEADER_TEMPLATE :"," '<div class=\"{console_hd_class}\">'+"," '<h4 class=\"{console_title_class}\">{str_title}</h4>'+"," '<button type=\"button\" class=\"'+"," '{console_button_class} {console_collapse_class}\">{str_collapse}'+"," '</button>'+"," '</div>',",""," /**"," * Markup template used to generate the DOM structure for the Console body"," * (where the messages are inserted) when it is rendered. The template"," * includes only the {placeholder} "console_bd_class", which is"," * constributed by Console.CHROME_CLASSES."," *"," * @property BODY_TEMPLATE"," * @type String"," * @static"," */"," BODY_TEMPLATE : '<div class=\"{console_bd_class}\"></div>',",""," /**"," * Markup template used to generate the DOM structure for the footer"," * section of the Console when it is rendered. The template includes"," * many of the {placeholder}s from Console.CHROME_CLASSES as well as:"," *"," * <ul>"," * <li>id_guid - generated unique id, relates the label and checkbox</li>"," * <li>str_pause - pulled from attribute strings.pause</li>"," * <li>str_clear - pulled from attribute strings.clear</li>"," * </ul>"," *"," * @property FOOTER_TEMPLATE"," * @type String"," * @static"," */"," FOOTER_TEMPLATE :"," '<div class=\"{console_ft_class}\">'+"," '<div class=\"{console_controls_class}\">'+"," '<label for=\"{id_guid}\" class=\"{console_pause_label_class}\">'+"," '<input type=\"checkbox\" class=\"{console_checkbox_class} '+"," '{console_pause_class}\" value=\"1\" id=\"{id_guid}\"> '+"," '{str_pause}</label>' +"," '<button type=\"button\" class=\"'+"," '{console_button_class} {console_clear_class}\">{str_clear}'+"," '</button>'+"," '</div>'+"," '</div>',",""," /**"," * Default markup template used to create the DOM structure for Console"," * entries. The markup contains {placeholder}s for content and classes"," * that are replaced via Y.Lang.sub. The default template contains"," * the {placeholder}s identified in Console.ENTRY_CLASSES as well as the"," * following placeholders that will be populated by the log entry data:"," *"," * <ul>"," * <li>cat_class</li>"," * <li>src_class</li>"," * <li>totalTime</li>"," * <li>elapsedTime</li>"," * <li>localTime</li>"," * <li>sourceAndDetail</li>"," * <li>message</li>"," * </ul>"," *"," * @property ENTRY_TEMPLATE"," * @type String"," * @static"," */"," ENTRY_TEMPLATE : ENTRY_TEMPLATE_STR,",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @Type Object"," * @static"," */"," ATTRS : {",""," /**"," * Name of the custom event that will communicate log messages."," *"," * @attribute logEvent"," * @type String"," * @default \"yui:log\""," */"," logEvent : {"," value : 'yui:log',"," writeOnce : true,"," validator : isString"," },",""," /**"," * Object that will emit the log events. By default the YUI instance."," * To have a single Console capture events from all YUI instances, set"," * this to the Y.Global object."," *"," * @attribute logSource"," * @type EventTarget"," * @default Y"," */"," logSource : {"," value : Y,"," writeOnce : true,"," validator : function (v) {"," return this._validateLogSource(v);"," }"," },",""," /**"," * Collection of strings used to label elements in the Console UI."," * Default collection contains the following name:value pairs:"," *"," * <ul>"," * <li>title : "Log Console"</li>"," * <li>pause : "Pause"</li>"," * <li>clear : "Clear"</li>"," * <li>collapse : "Collapse"</li>"," * <li>expand : "Expand"</li>"," * </ul>"," *"," * @attribute strings"," * @type Object"," */"," strings : {"," valueFn: function() { return Y.Intl.get(\"console\"); }"," },",""," /**"," * Boolean to pause the outputting of new messages to the console."," * When paused, messages will accumulate in the buffer."," *"," * @attribute paused"," * @type boolean"," * @default false"," */"," paused : {"," value : false,"," validator : L.isBoolean"," },",""," /**"," * If a category is not specified in the Y.log(..) statement, this"," * category will be used. Categories "info","," * "warn", and "error" are also called log level."," *"," * @attribute defaultCategory"," * @type String"," * @default \"info\""," */"," defaultCategory : {"," value : INFO,"," validator : isString"," },",""," /**"," * If a source is not specified in the Y.log(..) statement, this"," * source will be used."," *"," * @attribute defaultSource"," * @type String"," * @default \"global\""," */"," defaultSource : {"," value : 'global',"," validator : isString"," },",""," /**"," * Markup template used to create the DOM structure for Console entries."," *"," * @attribute entryTemplate"," * @type String"," * @default Console.ENTRY_TEMPLATE"," */"," entryTemplate : {"," value : ENTRY_TEMPLATE_STR,"," validator : isString"," },",""," /**"," * Minimum entry log level to render into the Console. The initial"," * logLevel value for all Console instances defaults from the"," * Y.config.logLevel YUI configuration, or Console.LOG_LEVEL_INFO if"," * that configuration is not set."," *"," * Possible values are "info", "warn","," * "error" (case insensitive), or their corresponding statics"," * Console.LOG_LEVEL_INFO and so on."," *"," * @attribute logLevel"," * @type String"," * @default Y.config.logLevel or Console.LOG_LEVEL_INFO"," */"," logLevel : {"," value : Y.config.logLevel || INFO,"," setter : function (v) {"," return this._setLogLevel(v);"," }"," },",""," /**"," * Millisecond timeout between iterations of the print loop, moving"," * entries from the buffer to the UI."," *"," * @attribute printTimeout"," * @type Number"," * @default 100"," */"," printTimeout : {"," value : 100,"," validator : isNumber"," },",""," /**"," * Maximum number of entries printed in each iteration of the print"," * loop. This is used to prevent excessive logging locking the page UI."," *"," * @attribute printLimit"," * @type Number"," * @default 50"," */"," printLimit : {"," value : 50,"," validator : isNumber"," },",""," /**"," * Maximum number of Console entries allowed in the Console body at one"," * time. This is used to keep acquired messages from exploding the"," * DOM tree and impacting page performance."," *"," * @attribute consoleLimit"," * @type Number"," * @default 300"," */"," consoleLimit : {"," value : 300,"," validator : isNumber"," },",""," /**"," * New entries should display at the top of the Console or the bottom?"," *"," * @attribute newestOnTop"," * @type Boolean"," * @default true"," */"," newestOnTop : {"," value : true"," },",""," /**"," * When new entries are added to the Console UI, should they be"," * scrolled into view?"," *"," * @attribute scrollIntoView"," * @type Boolean"," * @default true"," */"," scrollIntoView : {"," value : true"," },",""," /**"," * The baseline time for this Console instance, used to measure elapsed"," * time from the moment the console module is <code>use</code>d to the"," * moment each new entry is logged (not rendered)."," *"," * This value is reset by the instance method myConsole.reset()."," *"," * @attribute startTime"," * @type Date"," * @default The moment the console module is <code>use</code>d"," */"," startTime : {"," value : new Date()"," },",""," /**"," * The precise time the last entry was logged. Used to measure elapsed"," * time between log messages."," *"," * @attribute lastTime"," * @type Date"," * @default The moment the console module is <code>use</code>d"," */"," lastTime : {"," value : new Date(),"," readOnly: true"," },",""," /**"," * Controls the collapsed state of the Console"," *"," * @attribute collapsed"," * @type Boolean"," * @default false"," */"," collapsed : {"," value : false"," },",""," /**"," * String with units, or number, representing the height of the Console,"," * inclusive of header and footer. If a number is provided, the default"," * unit, defined by Widget's DEF_UNIT, property is used."," *"," * @attribute height"," * @default \"300px\""," * @type {String | Number}"," */"," height: {"," value: \"300px\""," },",""," /**"," * String with units, or number, representing the width of the Console."," * If a number is provided, the default unit, defined by Widget's"," * DEF_UNIT, property is used."," *"," * @attribute width"," * @default \"300px\""," * @type {String | Number}"," */"," width: {"," value: \"300px\""," },",""," /**"," * Pass through to the YUI instance useBrowserConsole configuration."," * By default this is set to false, which will disable logging to the"," * browser console when a Console instance is created. If the"," * logSource is not a YUI instance, this has no effect."," * "," * @attribute useBrowserConsole"," * @type {Boolean}"," * @default false"," */"," useBrowserConsole : {"," lazyAdd: false,"," value: false,"," getter : function () {"," return this._getUseBrowserConsole();"," },"," setter : function (v) {"," return this._setUseBrowserConsole(v);"," }"," },",""," /**"," * Allows the Console to flow in the document. Available values are"," * 'inline', 'block', and 'separate' (the default). "," *"," * @attribute style"," * @type {String}"," * @default 'separate'"," */"," style : {"," value : 'separate',"," writeOnce : true,"," validator : function (v) {"," return this._validateStyle(v);"," }"," }"," }","","});","","","}, '3.7.2', {\"requires\": [\"yui-log\", \"widget\"], \"skinnable\": true, \"lang\": [\"en\", \"es\", \"ja\"]});"];-_yuitest_coverage["build/console/console.js"].lines = {"1":0,"21":0,"94":0,"95":0,"98":0,"171":0,"173":0,"184":0,"186":0,"188":0,"190":0,"200":0,"202":0,"212":0,"214":0,"224":0,"226":0,"241":0,"249":0,"250":0,"253":0,"256":0,"258":0,"260":0,"261":0,"264":0,"265":0,"268":0,"269":0,"270":0,"273":0,"275":0,"276":0,"279":0,"284":0,"286":0,"298":0,"300":0,"302":0,"317":0,"326":0,"328":0,"338":0,"340":0,"342":0,"344":0,"354":0,"355":0,"356":0,"359":0,"360":0,"361":0,"371":0,"372":0,"373":0,"383":0,"386":0,"389":0,"393":0,"395":0,"397":0,"399":0,"411":0,"417":0,"419":0,"430":0,"434":0,"444":0,"450":0,"452":0,"463":0,"465":0,"466":0,"468":0,"469":0,"472":0,"474":0,"478":0,"501":0,"517":0,"519":0,"521":0,"522":0,"524":0,"526":0,"536":0,"537":0,"553":0,"561":0,"563":0,"574":0,"578":0,"590":0,"591":0,"592":0,"593":0,"595":0,"608":0,"610":0,"615":0,"616":0,"617":0,"619":0,"620":0,"621":0,"622":0,"624":0,"627":0,"629":0,"630":0,"631":0,"632":0,"636":0,"641":0,"654":0,"668":0,"669":0,"670":0,"684":0,"696":0,"708":0,"720":0,"734":0,"748":0,"749":0,"752":0,"764":0,"765":0,"782":0,"783":0,"784":0,"785":0,"786":0,"788":0,"803":0,"805":0,"806":0,"810":0,"835":0,"840":0,"841":0,"844":0,"845":0,"848":0,"849":0,"861":0,"863":0,"864":0,"867":0,"868":0,"869":0,"870":0,"882":0,"884":0,"885":0,"898":0,"911":0,"922":0,"927":0,"929":0,"930":0,"933":0,"944":0,"946":0,"957":0,"958":0,"974":0,"976":0,"979":0,"981":0,"985":0,"997":0,"998":0,"999":0,"1000":0,"1011":0,"1012":0,"1013":0,"1252":0,"1272":0,"1344":0,"1490":0,"1493":0,"1509":0};-_yuitest_coverage["build/console/console.js"].functions = {"Console:94":0,"log:170":0,"clearConsole:182":0,"reset:199":0,"collapse:211":0,"expand:223":0,"printBuffer:240":0,"initializer:297":0,"destructor:337":0,"renderUI:353":0,"syncUI:370":0,"bindUI:382":0,"_initHead:410":0,"_initBody:429":0,"_initFoot:443":0,"_isInLogLevel:462":0,"_normalizeMessage:499":0,"_schedulePrint:535":0,"(anonymous 2):562":0,"_createEntryHTML:552":0,"scrollToLatest:573":0,"_htmlEscapeMessage:589":0,"_trimOldEntries:605":0,"_encodeHTML:653":0,"_cancelPrintLoop:667":0,"_validateStyle:683":0,"_onPauseClick:695":0,"_onClearClick:707":0,"_onCollapseClick:719":0,"_validateLogSource:733":0,"_setLogLevel:747":0,"_getUseBrowserConsole:763":0,"_setUseBrowserConsole:781":0,"_uiSetHeight:802":0,"_afterStringsChange:834":0,"_afterPausedChange:860":0,"_uiUpdatePaused:881":0,"_afterConsoleLimitChange:897":0,"_afterCollapsedChange:910":0,"_uiUpdateCollapsed:921":0,"_afterVisibleChange:943":0,"_uiUpdateFromHideShow:956":0,"_onLogEvent:972":0,"_defResetFn:996":0,"_defEntryFn:1010":0,"validator:1251":0,"valueFn:1272":0,"setter:1343":0,"getter:1489":0,"setter:1492":0,"validator:1508":0,"(anonymous 1):1":0};+_yuitest_coverage["build/console/console.js"].code=["YUI.add('console', function (Y, NAME) {","","/**"," * Console creates a visualization for messages logged through calls to a YUI"," * instance's <code>Y.log( message, category, source )</code> method. The"," * debug versions of YUI modules will include logging statements to offer some"," * insight into the steps executed during that module's operation. Including"," * log statements in your code will cause those messages to also appear in the"," * Console. Use Console to aid in developing your page or application."," *"," * Entry categories "info", "warn", and "error""," * are also referred to as the log level, and entries are filtered against the"," * configured logLevel."," *"," * @module console"," * @class Console"," * @extends Widget"," * @param conf {Object} Configuration object (see Configuration attributes)"," * @constructor"," */","var getCN = Y.ClassNameManager.getClassName,"," CHECKED = 'checked',"," CLEAR = 'clear',"," CLICK = 'click',"," COLLAPSED = 'collapsed',"," CONSOLE = 'console',"," CONTENT_BOX = 'contentBox',"," DISABLED = 'disabled',"," ENTRY = 'entry',"," ERROR = 'error',"," HEIGHT = 'height',"," INFO = 'info',"," LAST_TIME = 'lastTime',"," PAUSE = 'pause',"," PAUSED = 'paused',"," RESET = 'reset',"," START_TIME = 'startTime',"," TITLE = 'title',"," WARN = 'warn',",""," DOT = '.',",""," C_BUTTON = getCN(CONSOLE,'button'),"," C_CHECKBOX = getCN(CONSOLE,'checkbox'),"," C_CLEAR = getCN(CONSOLE,CLEAR),"," C_COLLAPSE = getCN(CONSOLE,'collapse'),"," C_COLLAPSED = getCN(CONSOLE,COLLAPSED),"," C_CONSOLE_CONTROLS = getCN(CONSOLE,'controls'),"," C_CONSOLE_HD = getCN(CONSOLE,'hd'),"," C_CONSOLE_BD = getCN(CONSOLE,'bd'),"," C_CONSOLE_FT = getCN(CONSOLE,'ft'),"," C_CONSOLE_TITLE = getCN(CONSOLE,TITLE),"," C_ENTRY = getCN(CONSOLE,ENTRY),"," C_ENTRY_CAT = getCN(CONSOLE,ENTRY,'cat'),"," C_ENTRY_CONTENT = getCN(CONSOLE,ENTRY,'content'),"," C_ENTRY_META = getCN(CONSOLE,ENTRY,'meta'),"," C_ENTRY_SRC = getCN(CONSOLE,ENTRY,'src'),"," C_ENTRY_TIME = getCN(CONSOLE,ENTRY,'time'),"," C_PAUSE = getCN(CONSOLE,PAUSE),"," C_PAUSE_LABEL = getCN(CONSOLE,PAUSE,'label'),",""," RE_INLINE_SOURCE = /^(\\S+)\\s/,"," RE_AMP = /&(?!#?[a-z0-9]+;)/g,"," RE_GT = />/g,"," RE_LT = /</g,",""," ESC_AMP = '&',"," ESC_GT = '>',"," ESC_LT = '<',"," "," ENTRY_TEMPLATE_STR ="," '<div class=\"{entry_class} {cat_class} {src_class}\">'+"," '<p class=\"{entry_meta_class}\">'+"," '<span class=\"{entry_src_class}\">'+"," '{sourceAndDetail}'+"," '</span>'+"," '<span class=\"{entry_cat_class}\">'+"," '{category}</span>'+"," '<span class=\"{entry_time_class}\">'+"," ' {totalTime}ms (+{elapsedTime}) {localTime}'+"," '</span>'+"," '</p>'+"," '<pre class=\"{entry_content_class}\">{message}</pre>'+"," '</div>',",""," L = Y.Lang,"," create = Y.Node.create,"," isNumber = L.isNumber,"," isString = L.isString,"," merge = Y.merge,"," substitute = Y.Lang.sub;"," ","","function Console() {"," Console.superclass.constructor.apply(this,arguments);","}","","Y.Console = Y.extend(Console, Y.Widget,","","// Y.Console prototype","{"," /**"," * Category to prefix all event subscriptions to allow for ease of detach"," * during destroy."," *"," * @property _evtCat"," * @type string"," * @protected"," */"," _evtCat : null,",""," /**"," * Reference to the Node instance containing the header contents."," *"," * @property _head"," * @type Node"," * @default null"," * @protected"," */"," _head : null,",""," /**"," * Reference to the Node instance that will house the console messages."," *"," * @property _body"," * @type Node"," * @default null"," * @protected"," */"," _body : null,",""," /**"," * Reference to the Node instance containing the footer contents."," *"," * @property _foot"," * @type Node"," * @default null"," * @protected"," */"," _foot : null,",""," /**"," * Holds the object API returned from <code>Y.later</code> for the print"," * loop interval."," *"," * @property _printLoop"," * @type Object"," * @default null"," * @protected"," */"," _printLoop : null,",""," /**"," * Array of normalized message objects awaiting printing."," *"," * @property buffer"," * @type Array"," * @default null"," * @protected"," */"," buffer : null,",""," /**"," * Wrapper for <code>Y.log</code>."," *"," * @method log"," * @param arg* {MIXED} (all arguments passed through to <code>Y.log</code>)"," * @chainable"," */"," log : function () {"," Y.log.apply(Y,arguments);",""," return this;"," },",""," /**"," * Clear the console of messages and flush the buffer of pending messages."," *"," * @method clearConsole"," * @chainable"," */"," clearConsole : function () {"," // TODO: clear event listeners from console contents"," this._body.empty();",""," this._cancelPrintLoop();",""," this.buffer = [];",""," return this;"," },",""," /**"," * Clears the console and resets internal timers."," *"," * @method reset"," * @chainable"," */"," reset : function () {"," this.fire(RESET);"," "," return this;"," },",""," /**"," * Collapses the body and footer."," *"," * @method collapse"," * @chainable"," */"," collapse : function () {"," this.set(COLLAPSED, true);",""," return this;"," },",""," /**"," * Expands the body and footer if collapsed."," *"," * @method expand"," * @chainable"," */"," expand : function () {"," this.set(COLLAPSED, false);",""," return this;"," },",""," /**"," * Outputs buffered messages to the console UI. This is typically called"," * from a scheduled interval until the buffer is empty (referred to as the"," * print loop). The number of buffered messages output to the Console is"," * limited to the number provided as an argument. If no limit is passed,"," * all buffered messages are rendered."," * "," * @method printBuffer"," * @param limit {Number} (optional) max number of buffered entries to write"," * @chainable"," */"," printBuffer: function (limit) {"," var messages = this.buffer,"," debug = Y.config.debug,"," entries = [],"," consoleLimit= this.get('consoleLimit'),"," newestOnTop = this.get('newestOnTop'),"," anchor = newestOnTop ? this._body.get('firstChild') : null,"," i;",""," if (messages.length > consoleLimit) {"," messages.splice(0, messages.length - consoleLimit);"," }",""," limit = Math.min(messages.length, (limit || messages.length));"," "," // turn off logging system"," Y.config.debug = false;",""," if (!this.get(PAUSED) && this.get('rendered')) {",""," for (i = 0; i < limit && messages.length; ++i) {"," entries[i] = this._createEntryHTML(messages.shift());"," }",""," if (!messages.length) {"," this._cancelPrintLoop();"," }",""," if (entries.length) {"," if (newestOnTop) {"," entries.reverse();"," }",""," this._body.insertBefore(create(entries.join('')), anchor);",""," if (this.get('scrollIntoView')) {"," this.scrollToLatest();"," }",""," this._trimOldEntries();"," }"," }",""," // restore logging system"," Y.config.debug = debug;",""," return this;"," },",""," "," /**"," * Constructor code. Set up the buffer and entry template, publish"," * internal events, and subscribe to the configured logEvent."," * "," * @method initializer"," * @protected"," */"," initializer : function () {"," this._evtCat = Y.stamp(this) + '|';",""," this.buffer = [];",""," this.get('logSource').on(this._evtCat +"," this.get('logEvent'),Y.bind(\"_onLogEvent\",this));",""," /**"," * Transfers a received message to the print loop buffer. Default"," * behavior defined in _defEntryFn."," *"," * @event entry"," * @param event {Event.Facade} An Event Facade object with the following attribute specific properties added:"," * <dl>"," * <dt>message</dt>"," * <dd>The message data normalized into an object literal (see _normalizeMessage)</dd>"," * </dl>"," * @preventable _defEntryFn"," */"," this.publish(ENTRY, { defaultFn: this._defEntryFn });",""," /**"," * Triggers the reset behavior via the default logic in _defResetFn."," *"," * @event reset"," * @param event {Event.Facade} Event Facade object"," * @preventable _defResetFn"," */"," this.publish(RESET, { defaultFn: this._defResetFn });",""," this.after('rendered', this._schedulePrint);"," },",""," /**"," * Tears down the instance, flushing event subscriptions and purging the UI."," *"," * @method destructor"," * @protected"," */"," destructor : function () {"," var bb = this.get('boundingBox');",""," this._cancelPrintLoop();",""," this.get('logSource').detach(this._evtCat + '*');"," "," bb.purge(true);"," },",""," /**"," * Generate the Console UI."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," this._initHead();"," this._initBody();"," this._initFoot();",""," // Apply positioning to the bounding box if appropriate"," var style = this.get('style');"," if (style !== 'block') {"," this.get('boundingBox').addClass(this.getClassName(style));"," }"," },",""," /**"," * Sync the UI state to the current attribute state."," *"," * @method syncUI"," */"," syncUI : function () {"," this._uiUpdatePaused(this.get(PAUSED));"," this._uiUpdateCollapsed(this.get(COLLAPSED));"," this._uiSetHeight(this.get(HEIGHT));"," },",""," /**"," * Set up event listeners to wire up the UI to the internal state."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," this.get(CONTENT_BOX).one('button.'+C_COLLAPSE)."," on(CLICK,this._onCollapseClick,this);",""," this.get(CONTENT_BOX).one('input[type=checkbox].'+C_PAUSE)."," on(CLICK,this._onPauseClick,this);",""," this.get(CONTENT_BOX).one('button.'+C_CLEAR)."," on(CLICK,this._onClearClick,this);",""," // Attribute changes"," this.after(this._evtCat + 'stringsChange',"," this._afterStringsChange);"," this.after(this._evtCat + 'pausedChange',"," this._afterPausedChange);"," this.after(this._evtCat + 'consoleLimitChange',"," this._afterConsoleLimitChange);"," this.after(this._evtCat + 'collapsedChange',"," this._afterCollapsedChange);"," },",""," "," /**"," * Create the DOM structure for the header elements."," *"," * @method _initHead"," * @protected"," */"," _initHead : function () {"," var cb = this.get(CONTENT_BOX),"," info = merge(Console.CHROME_CLASSES, {"," str_collapse : this.get('strings.collapse'),"," str_title : this.get('strings.title')"," });",""," this._head = create(substitute(Console.HEADER_TEMPLATE,info));",""," cb.insertBefore(this._head,cb.get('firstChild'));"," },",""," /**"," * Create the DOM structure for the console body—where messages are"," * rendered."," *"," * @method _initBody"," * @protected"," */"," _initBody : function () {"," this._body = create(substitute("," Console.BODY_TEMPLATE,"," Console.CHROME_CLASSES));",""," this.get(CONTENT_BOX).appendChild(this._body);"," },",""," /**"," * Create the DOM structure for the footer elements."," *"," * @method _initFoot"," * @protected"," */"," _initFoot : function () {"," var info = merge(Console.CHROME_CLASSES, {"," id_guid : Y.guid(),"," str_pause : this.get('strings.pause'),"," str_clear : this.get('strings.clear')"," });",""," this._foot = create(substitute(Console.FOOTER_TEMPLATE,info));",""," this.get(CONTENT_BOX).appendChild(this._foot);"," },",""," /**"," * Determine if incoming log messages are within the configured logLevel"," * to be buffered for printing."," *"," * @method _isInLogLevel"," * @protected"," */"," _isInLogLevel : function (e) {"," var cat = e.cat, lvl = this.get('logLevel');",""," if (lvl !== INFO) {"," cat = cat || INFO;",""," if (isString(cat)) {"," cat = cat.toLowerCase();"," }",""," if ((cat === WARN && lvl === ERROR) ||"," (cat === INFO && lvl !== INFO)) {"," return false;"," }"," }",""," return true;"," },",""," /**"," * Create a log entry message from the inputs including the following keys:"," * <ul>"," * <li>time - this moment</li>"," * <li>message - leg message</li>"," * <li>category - logLevel or custom category for the message</li>"," * <li>source - when provided, the widget or util calling Y.log</li>"," * <li>sourceAndDetail - same as source but can include instance info</li>"," * <li>localTime - readable version of time</li>"," * <li>elapsedTime - ms since last entry</li>"," * <li>totalTime - ms since Console was instantiated or reset</li>"," * </ul>"," *"," * @method _normalizeMessage"," * @param e {Event} custom event containing the log message"," * @return Object the message object"," * @protected"," */"," _normalizeMessage : function (e) {",""," var msg = e.msg,"," cat = e.cat,"," src = e.src,",""," m = {"," time : new Date(),"," message : msg,"," category : cat || this.get('defaultCategory'),"," sourceAndDetail : src || this.get('defaultSource'),"," source : null,"," localTime : null,"," elapsedTime : null,"," totalTime : null"," };",""," // Extract m.source \"Foo\" from m.sourceAndDetail \"Foo bar baz\""," m.source = RE_INLINE_SOURCE.test(m.sourceAndDetail) ?"," RegExp.$1 : m.sourceAndDetail;"," m.localTime = m.time.toLocaleTimeString ? "," m.time.toLocaleTimeString() : (m.time + '');"," m.elapsedTime = m.time - this.get(LAST_TIME);"," m.totalTime = m.time - this.get(START_TIME);",""," this._set(LAST_TIME,m.time);",""," return m;"," },",""," /**"," * Sets an interval for buffered messages to be output to the console."," *"," * @method _schedulePrint"," * @protected"," */"," _schedulePrint : function () {"," if (!this._printLoop && !this.get(PAUSED) && this.get('rendered')) {"," this._printLoop = Y.later("," this.get('printTimeout'),"," this, this.printBuffer,"," this.get('printLimit'), true);"," }"," },",""," /**"," * Translates message meta into the markup for a console entry."," *"," * @method _createEntryHTML"," * @param m {Object} object literal containing normalized message metadata"," * @return String"," * @protected"," */"," _createEntryHTML : function (m) {"," m = merge("," this._htmlEscapeMessage(m),"," Console.ENTRY_CLASSES,"," {"," cat_class : this.getClassName(ENTRY,m.category),"," src_class : this.getClassName(ENTRY,m.source)"," });",""," return this.get('entryTemplate').replace(/\\{(\\w+)\\}/g,"," function (_,token) {"," return token in m ? m[token] : '';"," });"," },",""," /**"," * Scrolls to the most recent entry"," *"," * @method scrollToLatest"," * @chainable"," */"," scrollToLatest : function () {"," var scrollTop = this.get('newestOnTop') ?"," 0 :"," this._body.get('scrollHeight');",""," this._body.set('scrollTop', scrollTop);"," },",""," /**"," * Performs HTML escaping on strings in the message object."," *"," * @method _htmlEscapeMessage"," * @param m {Object} the normalized message object"," * @return Object the message object with proper escapement"," * @protected"," */"," _htmlEscapeMessage : function (m) {"," m.message = this._encodeHTML(m.message);"," m.source = this._encodeHTML(m.source);"," m.sourceAndDetail = this._encodeHTML(m.sourceAndDetail);"," m.category = this._encodeHTML(m.category);",""," return m;"," },",""," /**"," * Removes the oldest message entries from the UI to maintain the limit"," * specified in the consoleLimit configuration."," *"," * @method _trimOldEntries"," * @protected"," */"," _trimOldEntries : function () {"," // Turn off the logging system for the duration of this operation"," // to prevent an infinite loop"," Y.config.debug = false;",""," var bd = this._body,"," limit = this.get('consoleLimit'),"," debug = Y.config.debug,"," entries,e,i,l;",""," if (bd) {"," entries = bd.all(DOT+C_ENTRY);"," l = entries.size() - limit;",""," if (l > 0) {"," if (this.get('newestOnTop')) {"," i = limit;"," l = entries.size();"," } else {"," i = 0;"," }",""," this._body.setStyle('display','none');",""," for (;i < l; ++i) {"," e = entries.item(i);"," if (e) {"," e.remove();"," }"," }",""," this._body.setStyle('display','');"," }",""," }",""," Y.config.debug = debug;"," },",""," /**"," * Returns the input string with ampersands (&), <, and > encoded"," * as HTML entities."," *"," * @method _encodeHTML"," * @param s {String} the raw string"," * @return String the encoded string"," * @protected"," */"," _encodeHTML : function (s) {"," return isString(s) ?"," s.replace(RE_AMP,ESC_AMP)."," replace(RE_LT, ESC_LT)."," replace(RE_GT, ESC_GT) :"," s;"," },",""," /**"," * Clears the timeout for printing buffered messages."," *"," * @method _cancelPrintLoop"," * @protected"," */"," _cancelPrintLoop : function () {"," if (this._printLoop) {"," this._printLoop.cancel();"," this._printLoop = null;"," }"," },",""," /**"," * Validates input value for style attribute. Accepts only values 'inline',"," * 'block', and 'separate'."," *"," * @method _validateStyle"," * @param style {String} the proposed value"," * @return {Boolean} pass/fail"," * @protected"," */"," _validateStyle : function (style) {"," return style === 'inline' || style === 'block' || style === 'separate';"," },",""," /**"," * Event handler for clicking on the Pause checkbox to update the paused"," * attribute."," *"," * @method _onPauseClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onPauseClick : function (e) {"," this.set(PAUSED,e.target.get(CHECKED));"," },",""," /**"," * Event handler for clicking on the Clear button. Pass-through to"," * <code>this.clearConsole()</code>."," *"," * @method _onClearClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onClearClick : function (e) {"," this.clearConsole();"," },",""," /**"," * Event handler for clicking on the Collapse/Expand button. Sets the"," * "collapsed" attribute accordingly."," *"," * @method _onCollapseClick"," * @param e {Event} DOM event facade for the click event"," * @protected"," */"," _onCollapseClick : function (e) {"," this.set(COLLAPSED, !this.get(COLLAPSED));"," },","",""," /**"," * Validator for logSource attribute."," *"," * @method _validateLogSource"," * @param v {Object} the desired logSource"," * @return {Boolean} true if the input is an object with an <code>on</code>"," * method"," * @protected"," */"," _validateLogSource: function (v) {"," return v && Y.Lang.isFunction(v.on);"," },",""," /**"," * Setter method for logLevel attribute. Acceptable values are"," * "error", "warn", and "info" (case"," * insensitive). Other values are treated as "info"."," *"," * @method _setLogLevel"," * @param v {String} the desired log level"," * @return String One of Console.LOG_LEVEL_INFO, _WARN, or _ERROR"," * @protected"," */"," _setLogLevel : function (v) {"," if (isString(v)) {"," v = v.toLowerCase();"," }"," "," return (v === WARN || v === ERROR) ? v : INFO;"," },",""," /**"," * Getter method for useBrowserConsole attribute. Just a pass through to"," * the YUI instance configuration setting."," *"," * @method _getUseBrowserConsole"," * @return {Boolean} or null if logSource is not a YUI instance"," * @protected"," */"," _getUseBrowserConsole: function () {"," var logSource = this.get('logSource');"," return logSource instanceof YUI ?"," logSource.config.useBrowserConsole : null;"," },",""," /**"," * Setter method for useBrowserConsole attributes. Only functional if the"," * logSource attribute points to a YUI instance. Passes the value down to"," * the YUI instance. NOTE: multiple Console instances cannot maintain"," * independent useBrowserConsole values, since it is just a pass through to"," * the YUI instance configuration."," *"," * @method _setUseBrowserConsole"," * @param v {Boolean} false to disable browser console printing (default)"," * @return {Boolean} true|false if logSource is a YUI instance"," * @protected"," */"," _setUseBrowserConsole: function (v) {"," var logSource = this.get('logSource');"," if (logSource instanceof YUI) {"," v = !!v;"," logSource.config.useBrowserConsole = v;"," return v;"," } else {"," return Y.Attribute.INVALID_VALUE;"," }"," },",""," /**"," * Set the height of the Console container. Set the body height to the"," * difference between the configured height and the calculated heights of"," * the header and footer."," * Overrides Widget.prototype._uiSetHeight."," *"," * @method _uiSetHeight"," * @param v {String|Number} the new height"," * @protected"," */"," _uiSetHeight : function (v) {"," Console.superclass._uiSetHeight.apply(this,arguments);",""," if (this._head && this._foot) {"," var h = this.get('boundingBox').get('offsetHeight') -"," this._head.get('offsetHeight') -"," this._foot.get('offsetHeight');",""," this._body.setStyle(HEIGHT,h+'px');"," }"," },",""," /**"," * Over-ride default content box sizing to do nothing, since we're sizing"," * the body section to fill out height ourselves."," * "," * @method _uiSizeCB"," * @protected"," */"," _uiSizeCB : function() {"," // Do Nothing. Ideally want to move to Widget-StdMod, which accounts for"," // _uiSizeCB "," },",""," /**"," * Updates the UI if changes are made to any of the strings in the strings"," * attribute."," *"," * @method _afterStringsChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterStringsChange : function (e) {"," var prop = e.subAttrName ? e.subAttrName.split(DOT)[1] : null,"," cb = this.get(CONTENT_BOX),"," before = e.prevVal,"," after = e.newVal;",""," if ((!prop || prop === TITLE) && before.title !== after.title) {"," cb.all(DOT+C_CONSOLE_TITLE).setHTML(after.title);"," }",""," if ((!prop || prop === PAUSE) && before.pause !== after.pause) {"," cb.all(DOT+C_PAUSE_LABEL).setHTML(after.pause);"," }",""," if ((!prop || prop === CLEAR) && before.clear !== after.clear) {"," cb.all(DOT+C_CLEAR).set('value',after.clear);"," }"," },",""," /**"," * Updates the UI and schedules or cancels the print loop."," *"," * @method _afterPausedChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterPausedChange : function (e) {"," var paused = e.newVal;",""," if (e.src !== Y.Widget.SRC_UI) {"," this._uiUpdatePaused(paused);"," }",""," if (!paused) {"," this._schedulePrint();"," } else if (this._printLoop) {"," this._cancelPrintLoop();"," }"," },",""," /**"," * Checks or unchecks the paused checkbox"," *"," * @method _uiUpdatePaused"," * @param on {Boolean} the new checked state"," * @protected"," */"," _uiUpdatePaused : function (on) {"," var node = this._foot.all('input[type=checkbox].'+C_PAUSE);",""," if (node) {"," node.set(CHECKED,on);"," }"," },",""," /**"," * Calls this._trimOldEntries() in response to changes in the configured"," * consoleLimit attribute."," * "," * @method _afterConsoleLimitChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterConsoleLimitChange : function () {"," this._trimOldEntries();"," },","",""," /**"," * Updates the className of the contentBox, which should trigger CSS to"," * hide or show the body and footer sections depending on the new value."," *"," * @method _afterCollapsedChange"," * @param e {Event} Custom event for the attribute change"," * @protected"," */"," _afterCollapsedChange : function (e) {"," this._uiUpdateCollapsed(e.newVal);"," },",""," /**"," * Updates the UI to reflect the new Collapsed state"," *"," * @method _uiUpdateCollapsed"," * @param v {Boolean} true for collapsed, false for expanded"," * @protected"," */"," _uiUpdateCollapsed : function (v) {"," var bb = this.get('boundingBox'),"," button = bb.all('button.'+C_COLLAPSE),"," method = v ? 'addClass' : 'removeClass',"," str = this.get('strings.'+(v ? 'expand' : 'collapse'));",""," bb[method](C_COLLAPSED);",""," if (button) {"," button.setHTML(str);"," }",""," this._uiSetHeight(v ? this._head.get('offsetHeight'): this.get(HEIGHT));"," },",""," /**"," * Makes adjustments to the UI if needed when the Console is hidden or shown"," *"," * @method _afterVisibleChange"," * @param e {Event} the visibleChange event"," * @protected"," */"," _afterVisibleChange : function (e) {"," Console.superclass._afterVisibleChange.apply(this,arguments);",""," this._uiUpdateFromHideShow(e.newVal);"," },",""," /**"," * Recalculates dimensions and updates appropriately when shown"," *"," * @method _uiUpdateFromHideShow"," * @param v {Boolean} true for visible, false for hidden"," * @protected"," */"," _uiUpdateFromHideShow : function (v) {"," if (v) {"," this._uiSetHeight(this.get(HEIGHT));"," }"," },",""," /**"," * Responds to log events by normalizing qualifying messages and passing"," * them along through the entry event for buffering etc."," * "," * @method _onLogEvent"," * @param msg {String} the log message"," * @param cat {String} OPTIONAL the category or logLevel of the message"," * @param src {String} OPTIONAL the source of the message (e.g. widget name)"," * @protected"," */"," _onLogEvent : function (e) {",""," if (!this.get(DISABLED) && this._isInLogLevel(e)) {",""," var debug = Y.config.debug;",""," /* TODO: needed? */"," Y.config.debug = false;",""," this.fire(ENTRY, {"," message : this._normalizeMessage(e)"," });",""," Y.config.debug = debug;"," }"," },",""," /**"," * Clears the console, resets the startTime attribute, enables and"," * unpauses the widget."," *"," * @method _defResetFn"," * @protected"," */"," _defResetFn : function () {"," this.clearConsole();"," this.set(START_TIME,new Date());"," this.set(DISABLED,false);"," this.set(PAUSED,false);"," },",""," /**"," * Buffers incoming message objects and schedules the printing."," *"," * @method _defEntryFn"," * @param e {Event} The Custom event carrying the message in its payload"," * @protected"," */"," _defEntryFn : function (e) {"," if (e.message) {"," this.buffer.push(e.message);"," this._schedulePrint();"," }"," }","","},","","// Y.Console static properties","{"," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME : CONSOLE,",""," /**"," * Static identifier for logLevel configuration setting to allow all"," * incoming messages to generate Console entries."," *"," * @property LOG_LEVEL_INFO"," * @type String"," * @static"," */"," LOG_LEVEL_INFO : INFO,",""," /**"," * Static identifier for logLevel configuration setting to allow only"," * incoming messages of logLevel "warn" or "error""," * to generate Console entries."," *"," * @property LOG_LEVEL_WARN"," * @type String"," * @static"," */"," LOG_LEVEL_WARN : WARN,",""," /**"," * Static identifier for logLevel configuration setting to allow only"," * incoming messages of logLevel "error" to generate"," * Console entries."," *"," * @property LOG_LEVEL_ERROR"," * @type String"," * @static"," */"," LOG_LEVEL_ERROR : ERROR,",""," /**"," * Map (object) of classNames used to populate the placeholders in the"," * Console.ENTRY_TEMPLATE markup when rendering a new Console entry."," *"," * <p>By default, the keys contained in the object are:</p>"," * <ul>"," * <li>entry_class</li>"," * <li>entry_meta_class</li>"," * <li>entry_cat_class</li>"," * <li>entry_src_class</li>"," * <li>entry_time_class</li>"," * <li>entry_content_class</li>"," * </ul>"," *"," * @property ENTRY_CLASSES"," * @type Object"," * @static"," */"," ENTRY_CLASSES : {"," entry_class : C_ENTRY,"," entry_meta_class : C_ENTRY_META,"," entry_cat_class : C_ENTRY_CAT,"," entry_src_class : C_ENTRY_SRC,"," entry_time_class : C_ENTRY_TIME,"," entry_content_class : C_ENTRY_CONTENT"," },",""," /**"," * Map (object) of classNames used to populate the placeholders in the"," * Console.HEADER_TEMPLATE, Console.BODY_TEMPLATE, and"," * Console.FOOTER_TEMPLATE markup when rendering the Console UI."," *"," * <p>By default, the keys contained in the object are:</p>"," * <ul>"," * <li>console_hd_class</li>"," * <li>console_bd_class</li>"," * <li>console_ft_class</li>"," * <li>console_controls_class</li>"," * <li>console_checkbox_class</li>"," * <li>console_pause_class</li>"," * <li>console_pause_label_class</li>"," * <li>console_button_class</li>"," * <li>console_clear_class</li>"," * <li>console_collapse_class</li>"," * <li>console_title_class</li>"," * </ul>"," *"," * @property CHROME_CLASSES"," * @type Object"," * @static"," */"," CHROME_CLASSES : {"," console_hd_class : C_CONSOLE_HD,"," console_bd_class : C_CONSOLE_BD,"," console_ft_class : C_CONSOLE_FT,"," console_controls_class : C_CONSOLE_CONTROLS,"," console_checkbox_class : C_CHECKBOX,"," console_pause_class : C_PAUSE,"," console_pause_label_class : C_PAUSE_LABEL,"," console_button_class : C_BUTTON,"," console_clear_class : C_CLEAR,"," console_collapse_class : C_COLLAPSE,"," console_title_class : C_CONSOLE_TITLE"," },",""," /**"," * Markup template used to generate the DOM structure for the header"," * section of the Console when it is rendered. The template includes"," * these {placeholder}s:"," *"," * <ul>"," * <li>console_button_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_collapse_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_hd_class - contributed by Console.CHROME_CLASSES</li>"," * <li>console_title_class - contributed by Console.CHROME_CLASSES</li>"," * <li>str_collapse - pulled from attribute strings.collapse</li>"," * <li>str_title - pulled from attribute strings.title</li>"," * </ul>"," *"," * @property HEADER_TEMPLATE"," * @type String"," * @static"," */"," HEADER_TEMPLATE :"," '<div class=\"{console_hd_class}\">'+"," '<h4 class=\"{console_title_class}\">{str_title}</h4>'+"," '<button type=\"button\" class=\"'+"," '{console_button_class} {console_collapse_class}\">{str_collapse}'+"," '</button>'+"," '</div>',",""," /**"," * Markup template used to generate the DOM structure for the Console body"," * (where the messages are inserted) when it is rendered. The template"," * includes only the {placeholder} "console_bd_class", which is"," * constributed by Console.CHROME_CLASSES."," *"," * @property BODY_TEMPLATE"," * @type String"," * @static"," */"," BODY_TEMPLATE : '<div class=\"{console_bd_class}\"></div>',",""," /**"," * Markup template used to generate the DOM structure for the footer"," * section of the Console when it is rendered. The template includes"," * many of the {placeholder}s from Console.CHROME_CLASSES as well as:"," *"," * <ul>"," * <li>id_guid - generated unique id, relates the label and checkbox</li>"," * <li>str_pause - pulled from attribute strings.pause</li>"," * <li>str_clear - pulled from attribute strings.clear</li>"," * </ul>"," *"," * @property FOOTER_TEMPLATE"," * @type String"," * @static"," */"," FOOTER_TEMPLATE :"," '<div class=\"{console_ft_class}\">'+"," '<div class=\"{console_controls_class}\">'+"," '<label class=\"{console_pause_label_class}\"><input type=\"checkbox\" class=\"{console_checkbox_class} {console_pause_class}\" value=\"1\" id=\"{id_guid}\"> {str_pause}</label>' +"," '<button type=\"button\" class=\"'+"," '{console_button_class} {console_clear_class}\">{str_clear}'+"," '</button>'+"," '</div>'+"," '</div>',",""," /**"," * Default markup template used to create the DOM structure for Console"," * entries. The markup contains {placeholder}s for content and classes"," * that are replaced via Y.Lang.sub. The default template contains"," * the {placeholder}s identified in Console.ENTRY_CLASSES as well as the"," * following placeholders that will be populated by the log entry data:"," *"," * <ul>"," * <li>cat_class</li>"," * <li>src_class</li>"," * <li>totalTime</li>"," * <li>elapsedTime</li>"," * <li>localTime</li>"," * <li>sourceAndDetail</li>"," * <li>message</li>"," * </ul>"," *"," * @property ENTRY_TEMPLATE"," * @type String"," * @static"," */"," ENTRY_TEMPLATE : ENTRY_TEMPLATE_STR,",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @Type Object"," * @static"," */"," ATTRS : {",""," /**"," * Name of the custom event that will communicate log messages."," *"," * @attribute logEvent"," * @type String"," * @default \"yui:log\""," */"," logEvent : {"," value : 'yui:log',"," writeOnce : true,"," validator : isString"," },",""," /**"," * Object that will emit the log events. By default the YUI instance."," * To have a single Console capture events from all YUI instances, set"," * this to the Y.Global object."," *"," * @attribute logSource"," * @type EventTarget"," * @default Y"," */"," logSource : {"," value : Y,"," writeOnce : true,"," validator : function (v) {"," return this._validateLogSource(v);"," }"," },",""," /**"," * Collection of strings used to label elements in the Console UI."," * Default collection contains the following name:value pairs:"," *"," * <ul>"," * <li>title : "Log Console"</li>"," * <li>pause : "Pause"</li>"," * <li>clear : "Clear"</li>"," * <li>collapse : "Collapse"</li>"," * <li>expand : "Expand"</li>"," * </ul>"," *"," * @attribute strings"," * @type Object"," */"," strings : {"," valueFn: function() { return Y.Intl.get(\"console\"); }"," },",""," /**"," * Boolean to pause the outputting of new messages to the console."," * When paused, messages will accumulate in the buffer."," *"," * @attribute paused"," * @type boolean"," * @default false"," */"," paused : {"," value : false,"," validator : L.isBoolean"," },",""," /**"," * If a category is not specified in the Y.log(..) statement, this"," * category will be used. Categories "info","," * "warn", and "error" are also called log level."," *"," * @attribute defaultCategory"," * @type String"," * @default \"info\""," */"," defaultCategory : {"," value : INFO,"," validator : isString"," },",""," /**"," * If a source is not specified in the Y.log(..) statement, this"," * source will be used."," *"," * @attribute defaultSource"," * @type String"," * @default \"global\""," */"," defaultSource : {"," value : 'global',"," validator : isString"," },",""," /**"," * Markup template used to create the DOM structure for Console entries."," *"," * @attribute entryTemplate"," * @type String"," * @default Console.ENTRY_TEMPLATE"," */"," entryTemplate : {"," value : ENTRY_TEMPLATE_STR,"," validator : isString"," },",""," /**"," * Minimum entry log level to render into the Console. The initial"," * logLevel value for all Console instances defaults from the"," * Y.config.logLevel YUI configuration, or Console.LOG_LEVEL_INFO if"," * that configuration is not set."," *"," * Possible values are "info", "warn","," * "error" (case insensitive), or their corresponding statics"," * Console.LOG_LEVEL_INFO and so on."," *"," * @attribute logLevel"," * @type String"," * @default Y.config.logLevel or Console.LOG_LEVEL_INFO"," */"," logLevel : {"," value : Y.config.logLevel || INFO,"," setter : function (v) {"," return this._setLogLevel(v);"," }"," },",""," /**"," * Millisecond timeout between iterations of the print loop, moving"," * entries from the buffer to the UI."," *"," * @attribute printTimeout"," * @type Number"," * @default 100"," */"," printTimeout : {"," value : 100,"," validator : isNumber"," },",""," /**"," * Maximum number of entries printed in each iteration of the print"," * loop. This is used to prevent excessive logging locking the page UI."," *"," * @attribute printLimit"," * @type Number"," * @default 50"," */"," printLimit : {"," value : 50,"," validator : isNumber"," },",""," /**"," * Maximum number of Console entries allowed in the Console body at one"," * time. This is used to keep acquired messages from exploding the"," * DOM tree and impacting page performance."," *"," * @attribute consoleLimit"," * @type Number"," * @default 300"," */"," consoleLimit : {"," value : 300,"," validator : isNumber"," },",""," /**"," * New entries should display at the top of the Console or the bottom?"," *"," * @attribute newestOnTop"," * @type Boolean"," * @default true"," */"," newestOnTop : {"," value : true"," },",""," /**"," * When new entries are added to the Console UI, should they be"," * scrolled into view?"," *"," * @attribute scrollIntoView"," * @type Boolean"," * @default true"," */"," scrollIntoView : {"," value : true"," },",""," /**"," * The baseline time for this Console instance, used to measure elapsed"," * time from the moment the console module is <code>use</code>d to the"," * moment each new entry is logged (not rendered)."," *"," * This value is reset by the instance method myConsole.reset()."," *"," * @attribute startTime"," * @type Date"," * @default The moment the console module is <code>use</code>d"," */"," startTime : {"," value : new Date()"," },",""," /**"," * The precise time the last entry was logged. Used to measure elapsed"," * time between log messages."," *"," * @attribute lastTime"," * @type Date"," * @default The moment the console module is <code>use</code>d"," */"," lastTime : {"," value : new Date(),"," readOnly: true"," },",""," /**"," * Controls the collapsed state of the Console"," *"," * @attribute collapsed"," * @type Boolean"," * @default false"," */"," collapsed : {"," value : false"," },",""," /**"," * String with units, or number, representing the height of the Console,"," * inclusive of header and footer. If a number is provided, the default"," * unit, defined by Widget's DEF_UNIT, property is used."," *"," * @attribute height"," * @default \"300px\""," * @type {String | Number}"," */"," height: {"," value: \"300px\""," },",""," /**"," * String with units, or number, representing the width of the Console."," * If a number is provided, the default unit, defined by Widget's"," * DEF_UNIT, property is used."," *"," * @attribute width"," * @default \"300px\""," * @type {String | Number}"," */"," width: {"," value: \"300px\""," },",""," /**"," * Pass through to the YUI instance useBrowserConsole configuration."," * By default this is set to false, which will disable logging to the"," * browser console when a Console instance is created. If the"," * logSource is not a YUI instance, this has no effect."," * "," * @attribute useBrowserConsole"," * @type {Boolean}"," * @default false"," */"," useBrowserConsole : {"," lazyAdd: false,"," value: false,"," getter : function () {"," return this._getUseBrowserConsole();"," },"," setter : function (v) {"," return this._setUseBrowserConsole(v);"," }"," },",""," /**"," * Allows the Console to flow in the document. Available values are"," * 'inline', 'block', and 'separate' (the default). "," *"," * @attribute style"," * @type {String}"," * @default 'separate'"," */"," style : {"," value : 'separate',"," writeOnce : true,"," validator : function (v) {"," return this._validateStyle(v);"," }"," }"," }","","});","","","}, '3.7.3', {\"requires\": [\"yui-log\", \"widget\"], \"skinnable\": true, \"lang\": [\"en\", \"es\", \"ja\"]});"];+_yuitest_coverage["build/console/console.js"].lines = {"1":0,"21":0,"94":0,"95":0,"98":0,"171":0,"173":0,"184":0,"186":0,"188":0,"190":0,"200":0,"202":0,"212":0,"214":0,"224":0,"226":0,"241":0,"249":0,"250":0,"253":0,"256":0,"258":0,"260":0,"261":0,"264":0,"265":0,"268":0,"269":0,"270":0,"273":0,"275":0,"276":0,"279":0,"284":0,"286":0,"298":0,"300":0,"302":0,"317":0,"326":0,"328":0,"338":0,"340":0,"342":0,"344":0,"354":0,"355":0,"356":0,"359":0,"360":0,"361":0,"371":0,"372":0,"373":0,"383":0,"386":0,"389":0,"393":0,"395":0,"397":0,"399":0,"411":0,"417":0,"419":0,"430":0,"434":0,"444":0,"450":0,"452":0,"463":0,"465":0,"466":0,"468":0,"469":0,"472":0,"474":0,"478":0,"501":0,"517":0,"519":0,"521":0,"522":0,"524":0,"526":0,"536":0,"537":0,"553":0,"561":0,"563":0,"574":0,"578":0,"590":0,"591":0,"592":0,"593":0,"595":0,"608":0,"610":0,"615":0,"616":0,"617":0,"619":0,"620":0,"621":0,"622":0,"624":0,"627":0,"629":0,"630":0,"631":0,"632":0,"636":0,"641":0,"654":0,"668":0,"669":0,"670":0,"684":0,"696":0,"708":0,"720":0,"734":0,"748":0,"749":0,"752":0,"764":0,"765":0,"782":0,"783":0,"784":0,"785":0,"786":0,"788":0,"803":0,"805":0,"806":0,"810":0,"835":0,"840":0,"841":0,"844":0,"845":0,"848":0,"849":0,"861":0,"863":0,"864":0,"867":0,"868":0,"869":0,"870":0,"882":0,"884":0,"885":0,"898":0,"911":0,"922":0,"927":0,"929":0,"930":0,"933":0,"944":0,"946":0,"957":0,"958":0,"974":0,"976":0,"979":0,"981":0,"985":0,"997":0,"998":0,"999":0,"1000":0,"1011":0,"1012":0,"1013":0,"1249":0,"1269":0,"1341":0,"1487":0,"1490":0,"1506":0};+_yuitest_coverage["build/console/console.js"].functions = {"Console:94":0,"log:170":0,"clearConsole:182":0,"reset:199":0,"collapse:211":0,"expand:223":0,"printBuffer:240":0,"initializer:297":0,"destructor:337":0,"renderUI:353":0,"syncUI:370":0,"bindUI:382":0,"_initHead:410":0,"_initBody:429":0,"_initFoot:443":0,"_isInLogLevel:462":0,"_normalizeMessage:499":0,"_schedulePrint:535":0,"(anonymous 2):562":0,"_createEntryHTML:552":0,"scrollToLatest:573":0,"_htmlEscapeMessage:589":0,"_trimOldEntries:605":0,"_encodeHTML:653":0,"_cancelPrintLoop:667":0,"_validateStyle:683":0,"_onPauseClick:695":0,"_onClearClick:707":0,"_onCollapseClick:719":0,"_validateLogSource:733":0,"_setLogLevel:747":0,"_getUseBrowserConsole:763":0,"_setUseBrowserConsole:781":0,"_uiSetHeight:802":0,"_afterStringsChange:834":0,"_afterPausedChange:860":0,"_uiUpdatePaused:881":0,"_afterConsoleLimitChange:897":0,"_afterCollapsedChange:910":0,"_uiUpdateCollapsed:921":0,"_afterVisibleChange:943":0,"_uiUpdateFromHideShow:956":0,"_onLogEvent:972":0,"_defResetFn:996":0,"_defEntryFn:1010":0,"validator:1248":0,"valueFn:1269":0,"setter:1340":0,"getter:1486":0,"setter:1489":0,"validator:1505":0,"(anonymous 1):1":0}; _yuitest_coverage["build/console/console.js"].coveredLines = 184; _yuitest_coverage["build/console/console.js"].coveredFunctions = 52; _yuitest_coverline("build/console/console.js", 1);@@ -1443,10 +1443,7 @@ FOOTER_TEMPLATE : '<div class="{console_ft_class}">'+ '<div class="{console_controls_class}">'+- '<label for="{id_guid}" class="{console_pause_label_class}">'+- '<input type="checkbox" class="{console_checkbox_class} '+- '{console_pause_class}" value="1" id="{id_guid}"> '+- '{str_pause}</label>' ++ '<label class="{console_pause_label_class}"><input type="checkbox" class="{console_checkbox_class} {console_pause_class}" value="1" id="{id_guid}"> {str_pause}</label>' + '<button type="button" class="'+ '{console_button_class} {console_clear_class}">{str_clear}'+ '</button>'+@@ -1512,8 +1509,8 @@ value : Y, writeOnce : true, validator : function (v) {- _yuitest_coverfunc("build/console/console.js", "validator", 1251);-_yuitest_coverline("build/console/console.js", 1252);+ _yuitest_coverfunc("build/console/console.js", "validator", 1248);+_yuitest_coverline("build/console/console.js", 1249); return this._validateLogSource(v); } },@@ -1534,8 +1531,8 @@ * @type Object */ strings : {- valueFn: function() { _yuitest_coverfunc("build/console/console.js", "valueFn", 1272);-_yuitest_coverline("build/console/console.js", 1272);+ valueFn: function() { _yuitest_coverfunc("build/console/console.js", "valueFn", 1269);+_yuitest_coverline("build/console/console.js", 1269); return Y.Intl.get("console"); } }, @@ -1608,8 +1605,8 @@ logLevel : { value : Y.config.logLevel || INFO, setter : function (v) {- _yuitest_coverfunc("build/console/console.js", "setter", 1343);-_yuitest_coverline("build/console/console.js", 1344);+ _yuitest_coverfunc("build/console/console.js", "setter", 1340);+_yuitest_coverline("build/console/console.js", 1341); return this._setLogLevel(v); } },@@ -1756,13 +1753,13 @@ lazyAdd: false, value: false, getter : function () {- _yuitest_coverfunc("build/console/console.js", "getter", 1489);-_yuitest_coverline("build/console/console.js", 1490);+ _yuitest_coverfunc("build/console/console.js", "getter", 1486);+_yuitest_coverline("build/console/console.js", 1487); return this._getUseBrowserConsole(); }, setter : function (v) {- _yuitest_coverfunc("build/console/console.js", "setter", 1492);-_yuitest_coverline("build/console/console.js", 1493);+ _yuitest_coverfunc("build/console/console.js", "setter", 1489);+_yuitest_coverline("build/console/console.js", 1490); return this._setUseBrowserConsole(v); } },@@ -1779,8 +1776,8 @@ value : 'separate', writeOnce : true, validator : function (v) {- _yuitest_coverfunc("build/console/console.js", "validator", 1508);-_yuitest_coverline("build/console/console.js", 1509);+ _yuitest_coverfunc("build/console/console.js", "validator", 1505);+_yuitest_coverline("build/console/console.js", 1506); return this._validateStyle(v); } }@@ -1789,4 +1786,4 @@ }); -}, '3.7.2', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});+}, '3.7.3', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});
bundle/console/console-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1186,10 +1186,7 @@ FOOTER_TEMPLATE : '<div class="{console_ft_class}">'+ '<div class="{console_controls_class}">'+- '<label for="{id_guid}" class="{console_pause_label_class}">'+- '<input type="checkbox" class="{console_checkbox_class} '+- '{console_pause_class}" value="1" id="{id_guid}"> '+- '{str_pause}</label>' ++ '<label class="{console_pause_label_class}"><input type="checkbox" class="{console_checkbox_class} {console_pause_class}" value="1" id="{id_guid}"> {str_pause}</label>' + '<button type="button" class="'+ '{console_button_class} {console_clear_class}">{str_clear}'+ '</button>'+@@ -1520,4 +1517,4 @@ }); -}, '3.7.2', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});+}, '3.7.3', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});
bundle/console/console-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("console",function(e,t){function et(){et.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="checked",i="clear",s="click",o="collapsed",u="console",a="contentBox",f="disabled",l="entry",c="error",h="height",p="info",d="lastTime",v="pause",m="paused",g="reset",y="startTime",b="title",w="warn",E=".",S=n(u,"button"),x=n(u,"checkbox"),T=n(u,i),N=n(u,"collapse"),C=n(u,o),k=n(u,"controls"),L=n(u,"hd"),A=n(u,"bd"),O=n(u,"ft"),M=n(u,b),_=n(u,l),D=n(u,l,"cat"),P=n(u,l,"content"),H=n(u,l,"meta"),B=n(u,l,"src"),j=n(u,l,"time"),F=n(u,v),I=n(u,v,"label"),q=/^(\S+)\s/,R=/&(?!#?[a-z0-9]+;)/g,U=/>/g,z=/</g,W="&",X=">",V="<",$='<div class="{entry_class} {cat_class} {src_class}"><p class="{entry_meta_class}"><span class="{entry_src_class}">{sourceAndDetail}</span><span class="{entry_cat_class}">{category}</span><span class="{entry_time_class}"> {totalTime}ms (+{elapsedTime}) {localTime}</span></p><pre class="{entry_content_class}">{message}</pre></div>',J=e.Lang,K=e.Node.create,Q=J.isNumber,G=J.isString,Y=e.merge,Z=e.Lang.sub;e.Console=e.extend(et,e.Widget,{_evtCat:null,_head:null,_body:null,_foot:null,_printLoop:null,buffer:null,log:function(){return e.log.apply(e,arguments),this},clearConsole:function(){return this._body.empty(),this._cancelPrintLoop(),this.buffer=[],this},reset:function(){return this.fire(g),this},collapse:function(){return this.set(o,!0),this},expand:function(){return this.set(o,!1),this},printBuffer:function(t){var n=this.buffer,r=e.config.debug,i=[],s=this.get("consoleLimit"),o=this.get("newestOnTop"),u=o?this._body.get("firstChild"):null,a;n.length>s&&n.splice(0,n.length-s),t=Math.min(n.length,t||n.length),e.config.debug=!1;if(!this.get(m)&&this.get("rendered")){for(a=0;a<t&&n.length;++a)i[a]=this._createEntryHTML(n.shift());n.length||this._cancelPrintLoop(),i.length&&(o&&i.reverse(),this._body.insertBefore(K(i.join("")),u),this.get("scrollIntoView")&&this.scrollToLatest(),this._trimOldEntries())}return e.config.debug=r,this},initializer:function(){this._evtCat=e.stamp(this)+"|",this.buffer=[],this.get("logSource").on(this._evtCat+this.get("logEvent"),e.bind("_onLogEvent",this)),this.publish(l,{defaultFn:this._defEntryFn}),this.publish(g,{defaultFn:this._defResetFn}),this.after("rendered",this._schedulePrint)},destructor:function(){var e=this.get("boundingBox");this._cancelPrintLoop(),this.get("logSource").detach(this._evtCat+"*"),e.purge(!0)},renderUI:function(){this._initHead(),this._initBody(),this._initFoot();var e=this.get("style");e!=="block"&&this.get("boundingBox").addClass(this.getClassName(e))},syncUI:function(){this._uiUpdatePaused(this.get(m)),this._uiUpdateCollapsed(this.get(o)),this._uiSetHeight(this.get(h))},bindUI:function(){this.get(a).one("button."+N).on(s,this._onCollapseClick,this),this.get(a).one("input[type=checkbox]."+F).on(s,this._onPauseClick,this),this.get(a).one("button."+T).on(s,this._onClearClick,this),this.after(this._evtCat+"stringsChange",this._afterStringsChange),this.after(this._evtCat+"pausedChange",this._afterPausedChange),this.after(this._evtCat+"consoleLimitChange",this._afterConsoleLimitChange),this.after(this._evtCat+"collapsedChange",this._afterCollapsedChange)},_initHead:function(){var e=this.get(a),t=Y(et.CHROME_CLASSES,{str_collapse:this.get("strings.collapse"),str_title:this.get("strings.title")});this._head=K(Z(et.HEADER_TEMPLATE,t)),e.insertBefore(this._head,e.get("firstChild"))},_initBody:function(){this._body=K(Z(et.BODY_TEMPLATE,et.CHROME_CLASSES)),this.get(a).appendChild(this._body)},_initFoot:function(){var t=Y(et.CHROME_CLASSES,{id_guid:e.guid(),str_pause:this.get("strings.pause"),str_clear:this.get("strings.clear")});this._foot=K(Z(et.FOOTER_TEMPLATE,t)),this.get(a).appendChild(this._foot)},_isInLogLevel:function(e){var t=e.cat,n=this.get("logLevel");if(n!==p){t=t||p,G(t)&&(t=t.toLowerCase());if(t===w&&n===c||t===p&&n!==p)return!1}return!0},_normalizeMessage:function(e){var t=e.msg,n=e.cat,r=e.src,i={time:new Date,message:t,category:n||this.get("defaultCategory"),sourceAndDetail:r||this.get("defaultSource"),source:null,localTime:null,elapsedTime:null,totalTime:null};return i.source=q.test(i.sourceAndDetail)?RegExp.$1:i.sourceAndDetail,i.localTime=i.time.toLocaleTimeString?i.time.toLocaleTimeString():i.time+"",i.elapsedTime=i.time-this.get(d),i.totalTime=i.time-this.get(y),this._set(d,i.time),i},_schedulePrint:function(){!this._printLoop&&!this.get(m)&&this.get("rendered")&&(this._printLoop=e.later(this.get("printTimeout"),this,this.printBuffer,this.get("printLimit"),!0))},_createEntryHTML:function(e){return e=Y(this._htmlEscapeMessage(e),et.ENTRY_CLASSES,{cat_class:this.getClassName(l,e.category),src_class:this.getClassName(l,e.source)}),this.get("entryTemplate").replace(/\{(\w+)\}/g,function(t,n){return n in e?e[n]:""})},scrollToLatest:function(){var e=this.get("newestOnTop")?0:this._body.get("scrollHeight");this._body.set("scrollTop",e)},_htmlEscapeMessage:function(e){return e.message=this._encodeHTML(e.message),e.source=this._encodeHTML(e.source),e.sourceAndDetail=this._encodeHTML(e.sourceAndDetail),e.category=this._encodeHTML(e.category),e},_trimOldEntries:function(){e.config.debug=!1;var t=this._body,n=this.get("consoleLimit"),r=e.config.debug,i,s,o,u;if(t){i=t.all(E+_),u=i.size()-n;if(u>0){this.get("newestOnTop")?(o=n,u=i.size()):o=0,this._body.setStyle("display","none");for(;o<u;++o)s=i.item(o),s&&s.remove();this._body.setStyle("display","")}}e.config.debug=r},_encodeHTML:function(e){return G(e)?e.replace(R,W).replace(z,V).replace(U,X):e},_cancelPrintLoop:function(){this._printLoop&&(this._printLoop.cancel(),this._printLoop=null)},_validateStyle:function(e){return e==="inline"||e==="block"||e==="separate"},_onPauseClick:function(e){this.set(m,e.target.get(r))},_onClearClick:function(e){this.clearConsole()},_onCollapseClick:function(e){this.set(o,!this.get(o))},_validateLogSource:function(t){return t&&e.Lang.isFunction(t.on)},_setLogLevel:function(e){return G(e)&&(e=e.toLowerCase()),e===w||e===c?e:p},_getUseBrowserConsole:function(){var e=this.get("logSource");return e instanceof YUI?e.config.useBrowserConsole:null},_setUseBrowserConsole:function(t){var n=this.get("logSource");return n instanceof YUI?(t=!!t,n.config.useBrowserConsole=t,t):e.Attribute.INVALID_VALUE},_uiSetHeight:function(e){et.superclass._uiSetHeight.apply(this,arguments);if(this._head&&this._foot){var t=this.get("boundingBox").get("offsetHeight")-this._head.get("offsetHeight")-this._foot.get("offsetHeight");this._body.setStyle(h,t+"px")}},_uiSizeCB:function(){},_afterStringsChange:function(e){var t=e.subAttrName?e.subAttrName.split(E)[1]:null,n=this.get(a),r=e.prevVal,s=e.newVal;(!t||t===b)&&r.title!==s.title&&n.all(E+M).setHTML(s.title),(!t||t===v)&&r.pause!==s.pause&&n.all(E+I).setHTML(s.pause),(!t||t===i)&&r.clear!==s.clear&&n.all(E+T).set("value",s.clear)},_afterPausedChange:function(t){var n=t.newVal;t.src!==e.Widget.SRC_UI&&this._uiUpdatePaused(n),n?this._printLoop&&this._cancelPrintLoop():this._schedulePrint()},_uiUpdatePaused:function(e){var t=this._foot.all("input[type=checkbox]."+F);t&&t.set(r,e)},_afterConsoleLimitChange:function(){this._trimOldEntries()},_afterCollapsedChange:function(e){this._uiUpdateCollapsed(e.newVal)},_uiUpdateCollapsed:function(e){var t=this.get("boundingBox"),n=t.all("button."+N),r=e?"addClass":"removeClass",i=this.get("strings."+(e?"expand":"collapse"));t[r](C),n&&n.setHTML(i),this._uiSetHeight(e?this._head.get("offsetHeight"):this.get(h))},_afterVisibleChange:function(e){et.superclass._afterVisibleChange.apply(this,arguments),this._uiUpdateFromHideShow(e.newVal)},_uiUpdateFromHideShow:function(e){e&&this._uiSetHeight(this.get(h))},_onLogEvent:function(t){if(!this.get(f)&&this._isInLogLevel(t)){var n=e.config.debug;e.config.debug=!1,this.fire(l,{message:this._normalizeMessage(t)}),e.config.debug=n}},_defResetFn:function(){this.clearConsole(),this.set(y,new Date),this.set(f,!1),this.set(m,!1)},_defEntryFn:function(e){e.message&&(this.buffer.push(e.message),this._schedulePrint())}},{NAME:u,LOG_LEVEL_INFO:p,LOG_LEVEL_WARN:w,LOG_LEVEL_ERROR:c,ENTRY_CLASSES:{entry_class:_,entry_meta_class:H,entry_cat_class:D,entry_src_class:B,entry_time_class:j,entry_content_class:P},CHROME_CLASSES:{console_hd_class:L,console_bd_class:A,console_ft_class:O,console_controls_class:k,console_checkbox_class:x,console_pause_class:F,console_pause_label_class:I,console_button_class:S,console_clear_class:T,console_collapse_class:N,console_title_class:M},HEADER_TEMPLATE:'<div class="{console_hd_class}"><h4 class="{console_title_class}">{str_title}</h4><button type="button" class="{console_button_class} {console_collapse_class}">{str_collapse}</button></div>',BODY_TEMPLATE:'<div class="{console_bd_class}"></div>',FOOTER_TEMPLATE:'<div class="{console_ft_class}"><div class="{console_controls_class}"><label for="{id_guid}" class="{console_pause_label_class}"><input type="checkbox" class="{console_checkbox_class} {console_pause_class}" value="1" id="{id_guid}"> {str_pause}</label><button type="button" class="{console_button_class} {console_clear_class}">{str_clear}</button></div></div>',ENTRY_TEMPLATE:$,ATTRS:{logEvent:{value:"yui:log",writeOnce:!0,validator:G},logSource:{value:e,writeOnce:!0,validator:function(e){return this._validateLogSource(e)}},strings:{valueFn:function(){return e.Intl.get("console")}},paused:{value:!1,validator:J.isBoolean},defaultCategory:{value:p,validator:G},defaultSource:{value:"global",validator:G},entryTemplate:{value:$,validator:G},logLevel:{value:e.config.logLevel||p,setter:function(e){return this._setLogLevel(e)}},printTimeout:{value:100,validator:Q},printLimit:{value:50,validator:Q},consoleLimit:{value:300,validator:Q},newestOnTop:{value:!0},scrollIntoView:{value:!0},startTime:{value:new Date},lastTime:{value:new Date,readOnly:!0},collapsed:{value:!1},height:{value:"300px"},width:{value:"300px"},useBrowserConsole:{lazyAdd:!1,value:!1,getter:function(){return this._getUseBrowserConsole()},setter:function(e){return this._setUseBrowserConsole(e)}},style:{value:"separate",writeOnce:!0,validator:function(e){return this._validateStyle(e)}}}})},"3.7.2",{requires:["yui-log","widget"],skinnable:!0,lang:["en","es","ja"]});+YUI.add("console",function(e,t){function et(){et.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="checked",i="clear",s="click",o="collapsed",u="console",a="contentBox",f="disabled",l="entry",c="error",h="height",p="info",d="lastTime",v="pause",m="paused",g="reset",y="startTime",b="title",w="warn",E=".",S=n(u,"button"),x=n(u,"checkbox"),T=n(u,i),N=n(u,"collapse"),C=n(u,o),k=n(u,"controls"),L=n(u,"hd"),A=n(u,"bd"),O=n(u,"ft"),M=n(u,b),_=n(u,l),D=n(u,l,"cat"),P=n(u,l,"content"),H=n(u,l,"meta"),B=n(u,l,"src"),j=n(u,l,"time"),F=n(u,v),I=n(u,v,"label"),q=/^(\S+)\s/,R=/&(?!#?[a-z0-9]+;)/g,U=/>/g,z=/</g,W="&",X=">",V="<",$='<div class="{entry_class} {cat_class} {src_class}"><p class="{entry_meta_class}"><span class="{entry_src_class}">{sourceAndDetail}</span><span class="{entry_cat_class}">{category}</span><span class="{entry_time_class}"> {totalTime}ms (+{elapsedTime}) {localTime}</span></p><pre class="{entry_content_class}">{message}</pre></div>',J=e.Lang,K=e.Node.create,Q=J.isNumber,G=J.isString,Y=e.merge,Z=e.Lang.sub;e.Console=e.extend(et,e.Widget,{_evtCat:null,_head:null,_body:null,_foot:null,_printLoop:null,buffer:null,log:function(){return e.log.apply(e,arguments),this},clearConsole:function(){return this._body.empty(),this._cancelPrintLoop(),this.buffer=[],this},reset:function(){return this.fire(g),this},collapse:function(){return this.set(o,!0),this},expand:function(){return this.set(o,!1),this},printBuffer:function(t){var n=this.buffer,r=e.config.debug,i=[],s=this.get("consoleLimit"),o=this.get("newestOnTop"),u=o?this._body.get("firstChild"):null,a;n.length>s&&n.splice(0,n.length-s),t=Math.min(n.length,t||n.length),e.config.debug=!1;if(!this.get(m)&&this.get("rendered")){for(a=0;a<t&&n.length;++a)i[a]=this._createEntryHTML(n.shift());n.length||this._cancelPrintLoop(),i.length&&(o&&i.reverse(),this._body.insertBefore(K(i.join("")),u),this.get("scrollIntoView")&&this.scrollToLatest(),this._trimOldEntries())}return e.config.debug=r,this},initializer:function(){this._evtCat=e.stamp(this)+"|",this.buffer=[],this.get("logSource").on(this._evtCat+this.get("logEvent"),e.bind("_onLogEvent",this)),this.publish(l,{defaultFn:this._defEntryFn}),this.publish(g,{defaultFn:this._defResetFn}),this.after("rendered",this._schedulePrint)},destructor:function(){var e=this.get("boundingBox");this._cancelPrintLoop(),this.get("logSource").detach(this._evtCat+"*"),e.purge(!0)},renderUI:function(){this._initHead(),this._initBody(),this._initFoot();var e=this.get("style");e!=="block"&&this.get("boundingBox").addClass(this.getClassName(e))},syncUI:function(){this._uiUpdatePaused(this.get(m)),this._uiUpdateCollapsed(this.get(o)),this._uiSetHeight(this.get(h))},bindUI:function(){this.get(a).one("button."+N).on(s,this._onCollapseClick,this),this.get(a).one("input[type=checkbox]."+F).on(s,this._onPauseClick,this),this.get(a).one("button."+T).on(s,this._onClearClick,this),this.after(this._evtCat+"stringsChange",this._afterStringsChange),this.after(this._evtCat+"pausedChange",this._afterPausedChange),this.after(this._evtCat+"consoleLimitChange",this._afterConsoleLimitChange),this.after(this._evtCat+"collapsedChange",this._afterCollapsedChange)},_initHead:function(){var e=this.get(a),t=Y(et.CHROME_CLASSES,{str_collapse:this.get("strings.collapse"),str_title:this.get("strings.title")});this._head=K(Z(et.HEADER_TEMPLATE,t)),e.insertBefore(this._head,e.get("firstChild"))},_initBody:function(){this._body=K(Z(et.BODY_TEMPLATE,et.CHROME_CLASSES)),this.get(a).appendChild(this._body)},_initFoot:function(){var t=Y(et.CHROME_CLASSES,{id_guid:e.guid(),str_pause:this.get("strings.pause"),str_clear:this.get("strings.clear")});this._foot=K(Z(et.FOOTER_TEMPLATE,t)),this.get(a).appendChild(this._foot)},_isInLogLevel:function(e){var t=e.cat,n=this.get("logLevel");if(n!==p){t=t||p,G(t)&&(t=t.toLowerCase());if(t===w&&n===c||t===p&&n!==p)return!1}return!0},_normalizeMessage:function(e){var t=e.msg,n=e.cat,r=e.src,i={time:new Date,message:t,category:n||this.get("defaultCategory"),sourceAndDetail:r||this.get("defaultSource"),source:null,localTime:null,elapsedTime:null,totalTime:null};return i.source=q.test(i.sourceAndDetail)?RegExp.$1:i.sourceAndDetail,i.localTime=i.time.toLocaleTimeString?i.time.toLocaleTimeString():i.time+"",i.elapsedTime=i.time-this.get(d),i.totalTime=i.time-this.get(y),this._set(d,i.time),i},_schedulePrint:function(){!this._printLoop&&!this.get(m)&&this.get("rendered")&&(this._printLoop=e.later(this.get("printTimeout"),this,this.printBuffer,this.get("printLimit"),!0))},_createEntryHTML:function(e){return e=Y(this._htmlEscapeMessage(e),et.ENTRY_CLASSES,{cat_class:this.getClassName(l,e.category),src_class:this.getClassName(l,e.source)}),this.get("entryTemplate").replace(/\{(\w+)\}/g,function(t,n){return n in e?e[n]:""})},scrollToLatest:function(){var e=this.get("newestOnTop")?0:this._body.get("scrollHeight");this._body.set("scrollTop",e)},_htmlEscapeMessage:function(e){return e.message=this._encodeHTML(e.message),e.source=this._encodeHTML(e.source),e.sourceAndDetail=this._encodeHTML(e.sourceAndDetail),e.category=this._encodeHTML(e.category),e},_trimOldEntries:function(){e.config.debug=!1;var t=this._body,n=this.get("consoleLimit"),r=e.config.debug,i,s,o,u;if(t){i=t.all(E+_),u=i.size()-n;if(u>0){this.get("newestOnTop")?(o=n,u=i.size()):o=0,this._body.setStyle("display","none");for(;o<u;++o)s=i.item(o),s&&s.remove();this._body.setStyle("display","")}}e.config.debug=r},_encodeHTML:function(e){return G(e)?e.replace(R,W).replace(z,V).replace(U,X):e},_cancelPrintLoop:function(){this._printLoop&&(this._printLoop.cancel(),this._printLoop=null)},_validateStyle:function(e){return e==="inline"||e==="block"||e==="separate"},_onPauseClick:function(e){this.set(m,e.target.get(r))},_onClearClick:function(e){this.clearConsole()},_onCollapseClick:function(e){this.set(o,!this.get(o))},_validateLogSource:function(t){return t&&e.Lang.isFunction(t.on)},_setLogLevel:function(e){return G(e)&&(e=e.toLowerCase()),e===w||e===c?e:p},_getUseBrowserConsole:function(){var e=this.get("logSource");return e instanceof YUI?e.config.useBrowserConsole:null},_setUseBrowserConsole:function(t){var n=this.get("logSource");return n instanceof YUI?(t=!!t,n.config.useBrowserConsole=t,t):e.Attribute.INVALID_VALUE},_uiSetHeight:function(e){et.superclass._uiSetHeight.apply(this,arguments);if(this._head&&this._foot){var t=this.get("boundingBox").get("offsetHeight")-this._head.get("offsetHeight")-this._foot.get("offsetHeight");this._body.setStyle(h,t+"px")}},_uiSizeCB:function(){},_afterStringsChange:function(e){var t=e.subAttrName?e.subAttrName.split(E)[1]:null,n=this.get(a),r=e.prevVal,s=e.newVal;(!t||t===b)&&r.title!==s.title&&n.all(E+M).setHTML(s.title),(!t||t===v)&&r.pause!==s.pause&&n.all(E+I).setHTML(s.pause),(!t||t===i)&&r.clear!==s.clear&&n.all(E+T).set("value",s.clear)},_afterPausedChange:function(t){var n=t.newVal;t.src!==e.Widget.SRC_UI&&this._uiUpdatePaused(n),n?this._printLoop&&this._cancelPrintLoop():this._schedulePrint()},_uiUpdatePaused:function(e){var t=this._foot.all("input[type=checkbox]."+F);t&&t.set(r,e)},_afterConsoleLimitChange:function(){this._trimOldEntries()},_afterCollapsedChange:function(e){this._uiUpdateCollapsed(e.newVal)},_uiUpdateCollapsed:function(e){var t=this.get("boundingBox"),n=t.all("button."+N),r=e?"addClass":"removeClass",i=this.get("strings."+(e?"expand":"collapse"));t[r](C),n&&n.setHTML(i),this._uiSetHeight(e?this._head.get("offsetHeight"):this.get(h))},_afterVisibleChange:function(e){et.superclass._afterVisibleChange.apply(this,arguments),this._uiUpdateFromHideShow(e.newVal)},_uiUpdateFromHideShow:function(e){e&&this._uiSetHeight(this.get(h))},_onLogEvent:function(t){if(!this.get(f)&&this._isInLogLevel(t)){var n=e.config.debug;e.config.debug=!1,this.fire(l,{message:this._normalizeMessage(t)}),e.config.debug=n}},_defResetFn:function(){this.clearConsole(),this.set(y,new Date),this.set(f,!1),this.set(m,!1)},_defEntryFn:function(e){e.message&&(this.buffer.push(e.message),this._schedulePrint())}},{NAME:u,LOG_LEVEL_INFO:p,LOG_LEVEL_WARN:w,LOG_LEVEL_ERROR:c,ENTRY_CLASSES:{entry_class:_,entry_meta_class:H,entry_cat_class:D,entry_src_class:B,entry_time_class:j,entry_content_class:P},CHROME_CLASSES:{console_hd_class:L,console_bd_class:A,console_ft_class:O,console_controls_class:k,console_checkbox_class:x,console_pause_class:F,console_pause_label_class:I,console_button_class:S,console_clear_class:T,console_collapse_class:N,console_title_class:M},HEADER_TEMPLATE:'<div class="{console_hd_class}"><h4 class="{console_title_class}">{str_title}</h4><button type="button" class="{console_button_class} {console_collapse_class}">{str_collapse}</button></div>',BODY_TEMPLATE:'<div class="{console_bd_class}"></div>',FOOTER_TEMPLATE:'<div class="{console_ft_class}"><div class="{console_controls_class}"><label class="{console_pause_label_class}"><input type="checkbox" class="{console_checkbox_class} {console_pause_class}" value="1" id="{id_guid}"> {str_pause}</label><button type="button" class="{console_button_class} {console_clear_class}">{str_clear}</button></div></div>',ENTRY_TEMPLATE:$,ATTRS:{logEvent:{value:"yui:log",writeOnce:!0,validator:G},logSource:{value:e,writeOnce:!0,validator:function(e){return this._validateLogSource(e)}},strings:{valueFn:function(){return e.Intl.get("console")}},paused:{value:!1,validator:J.isBoolean},defaultCategory:{value:p,validator:G},defaultSource:{value:"global",validator:G},entryTemplate:{value:$,validator:G},logLevel:{value:e.config.logLevel||p,setter:function(e){return this._setLogLevel(e)}},printTimeout:{value:100,validator:Q},printLimit:{value:50,validator:Q},consoleLimit:{value:300,validator:Q},newestOnTop:{value:!0},scrollIntoView:{value:!0},startTime:{value:new Date},lastTime:{value:new Date,readOnly:!0},collapsed:{value:!1},height:{value:"300px"},width:{value:"300px"},useBrowserConsole:{lazyAdd:!1,value:!1,getter:function(){return this._getUseBrowserConsole()},setter:function(e){return this._setUseBrowserConsole(e)}},style:{value:"separate",writeOnce:!0,validator:function(e){return this._validateStyle(e)}}}})},"3.7.3",{requires:["yui-log","widget"],skinnable:!0,lang:["en","es","ja"]});
bundle/console/console.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1186,10 +1186,7 @@ FOOTER_TEMPLATE : '<div class="{console_ft_class}">'+ '<div class="{console_controls_class}">'+- '<label for="{id_guid}" class="{console_pause_label_class}">'+- '<input type="checkbox" class="{console_checkbox_class} '+- '{console_pause_class}" value="1" id="{id_guid}"> '+- '{str_pause}</label>' ++ '<label class="{console_pause_label_class}"><input type="checkbox" class="{console_checkbox_class} {console_pause_class}" value="1" id="{id_guid}"> {str_pause}</label>' + '<button type="button" class="'+ '{console_button_class} {console_clear_class}">{str_clear}'+ '</button>'+@@ -1520,4 +1517,4 @@ }); -}, '3.7.2', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});+}, '3.7.3', {"requires": ["yui-log", "widget"], "skinnable": true, "lang": ["en", "es", "ja"]});
bundle/console/lang/console.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console",function(e){e.Intl.add("console","",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.2");+YUI.add("lang/console",function(e){e.Intl.add("console","",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.3");
bundle/console/lang/console_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console_en",function(e){e.Intl.add("console","en",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.2");+YUI.add("lang/console_en",function(e){e.Intl.add("console","en",{title:"Log Console",pause:"Pause",clear:"Clear",collapse:"Collapse",expand:"Expand"})},"3.7.3");
bundle/console/lang/console_es.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console_es",function(e){e.Intl.add("console","es",{title:"Consola de informacion",pause:"Pausa",clear:"Borrar",collapse:"Colapsar",expand:"Expandir"})},"3.7.2");+YUI.add("lang/console_es",function(e){e.Intl.add("console","es",{title:"Consola de informacion",pause:"Pausa",clear:"Borrar",collapse:"Colapsar",expand:"Expandir"})},"3.7.3");
bundle/console/lang/console_ja.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/console_ja",function(e){e.Intl.add("console","ja",{title:"\u30ed\u30b0\u30b3\u30f3\u30bd\u30fc\u30eb",pause:"\u4e00\u6642\u505c\u6b62",clear:"\u30af\u30ea\u30a2",collapse:"\u9589\u3058\u308b",expand:"\u958b\u304f"})},"3.7.2");+YUI.add("lang/console_ja",function(e){e.Intl.add("console","ja",{title:"\u30ed\u30b0\u30b3\u30f3\u30bd\u30fc\u30eb",pause:"\u4e00\u6642\u505c\u6b62",clear:"\u30af\u30ea\u30a2",collapse:"\u9589\u3058\u308b",expand:"\u958b\u304f"})},"3.7.3");
bundle/cookie/cookie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/cookie/cookie.js", code: [] };-_yuitest_coverage["build/cookie/cookie.js"].code=["YUI.add('cookie', function (Y, NAME) {","","/**"," * Utilities for cookie management"," * @module cookie"," */",""," //shortcuts"," var L = Y.Lang,"," O = Y.Object,"," NULL = null,"," "," //shortcuts to functions"," isString = L.isString,"," isObject = L.isObject,"," isUndefined = L.isUndefined,"," isFunction = L.isFunction,"," encode = encodeURIComponent,"," decode = decodeURIComponent,"," "," //shortcut to document"," doc = Y.config.doc;"," "," /*"," * Throws an error message."," */"," function error(message){"," throw new TypeError(message);"," } "," "," /*"," * Checks the validity of a cookie name."," */"," function validateCookieName(name){"," if (!isString(name) || name === \"\"){"," error(\"Cookie name must be a non-empty string.\");"," } "," }"," "," /*"," * Checks the validity of a subcookie name."," */ "," function validateSubcookieName(subName){"," if (!isString(subName) || subName === \"\"){"," error(\"Subcookie name must be a non-empty string.\");"," } "," }"," "," /**"," * Cookie utility."," * @class Cookie"," * @static"," */"," Y.Cookie = {"," "," //-------------------------------------------------------------------------"," // Private Methods"," //-------------------------------------------------------------------------"," "," /**"," * Creates a cookie string that can be assigned into document.cookie."," * @param {String} name The name of the cookie."," * @param {String} value The value of the cookie."," * @param {Boolean} encodeValue True to encode the value, false to leave as-is."," * @param {Object} options (Optional) Options for the cookie."," * @return {String} The formatted cookie string."," * @method _createCookieString"," * @private"," * @static"," */"," _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {"," "," options = options || {};"," "," var text /*:String*/ = encode(name) + \"=\" + (encodeValue ? encode(value) : value),"," expires = options.expires,"," path = options.path,"," domain = options.domain;"," "," "," if (isObject(options)){"," //expiration date"," if (expires instanceof Date){"," text += \"; expires=\" + expires.toUTCString();"," }"," "," //path"," if (isString(path) && path !== \"\"){"," text += \"; path=\" + path;"," }"," "," //domain"," if (isString(domain) && domain !== \"\"){"," text += \"; domain=\" + domain;"," }"," "," //secure"," if (options.secure === true){"," text += \"; secure\";"," }"," }"," "," return text;"," },"," "," /**"," * Formats a cookie value for an object containing multiple values."," * @param {Object} hash An object of key-value pairs to create a string for."," * @return {String} A string suitable for use as a cookie value."," * @method _createCookieHashString"," * @private"," * @static"," */"," _createCookieHashString : function (hash /*:Object*/) /*:String*/ {"," if (!isObject(hash)){"," error(\"Cookie._createCookieHashString(): Argument must be an object.\");"," }"," "," var text /*:Array*/ = [];",""," O.each(hash, function(value, key){"," if (!isFunction(value) && !isUndefined(value)){"," text.push(encode(key) + \"=\" + encode(String(value)));"," } "," });"," "," return text.join(\"&\");"," },"," "," /**"," * Parses a cookie hash string into an object."," * @param {String} text The cookie hash string to parse (format: n1=v1&n2=v2)."," * @return {Object} An object containing entries for each cookie value."," * @method _parseCookieHash"," * @private"," * @static"," */"," _parseCookieHash : function (text) {"," "," var hashParts = text.split(\"&\"),"," hashPart = NULL,"," hash = {};"," "," if (text.length){"," for (var i=0, len=hashParts.length; i < len; i++){"," hashPart = hashParts[i].split(\"=\");"," hash[decode(hashPart[0])] = decode(hashPart[1]);"," }"," }"," "," return hash; "," },"," "," /**"," * Parses a cookie string into an object representing all accessible cookies."," * @param {String} text The cookie string to parse."," * @param {Boolean} shouldDecode (Optional) Indicates if the cookie values should be decoded or not. Default is true."," * @return {Object} An object containing entries for each accessible cookie."," * @method _parseCookieString"," * @private"," * @static"," */"," _parseCookieString : function (text /*:String*/, shouldDecode /*:Boolean*/) /*:Object*/ {"," "," var cookies /*:Object*/ = {}; "," "," if (isString(text) && text.length > 0) {"," "," var decodeValue = (shouldDecode === false ? function(s){return s;} : decode), "," cookieParts = text.split(/;\\s/g),"," cookieName = NULL,"," cookieValue = NULL,"," cookieNameValue = NULL;"," "," for (var i=0, len=cookieParts.length; i < len; i++){"," "," //check for normally-formatted cookie (name-value)"," cookieNameValue = cookieParts[i].match(/([^=]+)=/i);"," if (cookieNameValue instanceof Array){"," try {"," cookieName = decode(cookieNameValue[1]);"," cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));"," } catch (ex){"," //intentionally ignore the cookie - the encoding is wrong"," }"," } else {"," //means the cookie does not have an \"=\", so treat it as a boolean flag"," cookieName = decode(cookieParts[i]);"," cookieValue = \"\";"," }"," cookies[cookieName] = cookieValue;"," }",""," }"," "," return cookies;"," }, "," "," /**"," * Sets the document object that the cookie utility uses for setting"," * cookies. This method is necessary to ensure that the cookie utility"," * unit tests can pass even when run on a domain instead of locally."," * This method should not be used otherwise; you should use "," * <code>Y.config.doc</code> to change the document that the cookie"," * utility uses for everyday purposes."," * @param {Object} newDoc The object to use as the document."," * @return {void}"," * @method _setDoc"," * @private"," */ "," _setDoc: function(newDoc){"," doc = newDoc;"," },"," "," //-------------------------------------------------------------------------"," // Public Methods"," //-------------------------------------------------------------------------"," "," /**"," * Determines if the cookie with the given name exists. This is useful for"," * Boolean cookies (those that do not follow the name=value convention)."," * @param {String} name The name of the cookie to check."," * @return {Boolean} True if the cookie exists, false if not."," * @method exists"," * @static"," */"," exists: function(name) {"," "," validateCookieName(name); //throws error"," "," var cookies = this._parseCookieString(doc.cookie, true);"," "," return cookies.hasOwnProperty(name);"," }, "," "," /**"," * Returns the cookie value for the given name."," * @param {String} name The name of the cookie to retrieve."," * @param {Function|Object} options (Optional) An object containing one or more"," * cookie options: raw (true/false) and converter (a function)."," * The converter function is run on the value before returning it. The"," * function is not used if the cookie doesn't exist. The function can be"," * passed instead of the options object for backwards compatibility. When"," * raw is set to true, the cookie value is not URI decoded."," * @return {Variant} If no converter is specified, returns a string or null if"," * the cookie doesn't exist. If the converter is specified, returns the value"," * returned from the converter or null if the cookie doesn't exist."," * @method get"," * @static"," */"," get : function (name, options) {"," "," validateCookieName(name); //throws error "," "," var cookies,"," cookie,"," converter;"," "," //if options is a function, then it's the converter"," if (isFunction(options)) {"," converter = options;"," options = {};"," } else if (isObject(options)) {"," converter = options.converter;"," } else {"," options = {};"," }"," "," cookies = this._parseCookieString(doc.cookie, !options.raw);"," cookie = cookies[name];"," "," //should return null, not undefined if the cookie doesn't exist"," if (isUndefined(cookie)) {"," return NULL;"," }"," "," if (!isFunction(converter)){"," return cookie;"," } else {"," return converter(cookie);"," }"," },"," "," /**"," * Returns the value of a subcookie."," * @param {String} name The name of the cookie to retrieve."," * @param {String} subName The name of the subcookie to retrieve."," * @param {Function} converter (Optional) A function to run on the value before returning"," * it. The function is not used if the cookie doesn't exist."," * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie"," * doesn't exist, null if also returned. If no converter is specified and the"," * subcookie exists, a string is returned. If a converter is specified and the"," * subcookie exists, the value returned from the converter is returned."," * @method getSub"," * @static"," */"," getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {"," "," var hash /*:Variant*/ = this.getSubs(name); "," "," if (hash !== NULL) {"," "," validateSubcookieName(subName); //throws error"," "," if (isUndefined(hash[subName])){"," return NULL;"," } "," "," if (!isFunction(converter)){"," return hash[subName];"," } else {"," return converter(hash[subName]);"," }"," } else {"," return NULL;"," }"," "," },"," "," /**"," * Returns an object containing name-value pairs stored in the cookie with the given name."," * @param {String} name The name of the cookie to retrieve."," * @return {Object} An object of name-value pairs if the cookie with the given name"," * exists, null if it does not."," * @method getSubs"," * @static"," */"," getSubs : function (name) {"," "," validateCookieName(name); //throws error"," "," var cookies = this._parseCookieString(doc.cookie, false);"," if (isString(cookies[name])){"," return this._parseCookieHash(cookies[name]);"," }"," return NULL;"," },"," "," /**"," * Removes a cookie from the machine by setting its expiration date to"," * sometime in the past."," * @param {String} name The name of the cookie to remove."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), "," * and secure (true/false). The expires option will be overwritten"," * by the method."," * @return {String} The created cookie string."," * @method remove"," * @static"," */"," remove : function (name, options) {"," "," validateCookieName(name); //throws error"," "," //set options"," options = Y.merge(options || {}, {"," expires: new Date(0)"," });"," "," //set cookie"," return this.set(name, \"\", options);"," },"," "," /**"," * Removes a sub cookie with a given name."," * @param {String} name The name of the cookie in which the subcookie exists."," * @param {String} subName The name of the subcookie to remove."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * removeIfEmpty (true/false), and secure (true/false). This must be the same"," * settings as the original subcookie."," * @return {String} The created cookie string."," * @method removeSub"," * @static"," */"," removeSub : function(name, subName, options) {"," "," validateCookieName(name); //throws error"," "," validateSubcookieName(subName); //throws error"," "," options = options || {};"," "," //get all subcookies for this cookie"," var subs = this.getSubs(name);"," "," //delete the indicated subcookie"," if (isObject(subs) && subs.hasOwnProperty(subName)){"," delete subs[subName];"," "," if (!options.removeIfEmpty) {"," //reset the cookie"," "," return this.setSubs(name, subs, options);"," } else {"," //reset the cookie if there are subcookies left, else remove"," for (var key in subs){"," if (subs.hasOwnProperty(key) && !isFunction(subs[key]) && !isUndefined(subs[key])){"," return this.setSubs(name, subs, options);"," }"," }"," "," return this.remove(name, options);"," } "," } else {"," return \"\";"," }"," "," },"," "," /**"," * Sets a cookie with a given name and value."," * @param {String} name The name of the cookie to set."," * @param {Variant} value The value to set for the cookie."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * secure (true/false), and raw (true/false). Setting raw to true indicates"," * that the cookie should not be URI encoded before being set."," * @return {String} The created cookie string."," * @method set"," * @static"," */"," set : function (name, value, options) {"," "," validateCookieName(name); //throws error"," "," if (isUndefined(value)){"," error(\"Cookie.set(): Value cannot be undefined.\");"," }"," "," options = options || {};"," "," var text = this._createCookieString(name, value, !options.raw, options);"," doc.cookie = text;"," return text;"," },"," "," /**"," * Sets a sub cookie with a given name to a particular value."," * @param {String} name The name of the cookie to set."," * @param {String} subName The name of the subcookie to set."," * @param {Variant} value The value to set."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * and secure (true/false)."," * @return {String} The created cookie string."," * @method setSub"," * @static"," */"," setSub : function (name, subName, value, options) {",""," validateCookieName(name); //throws error"," "," validateSubcookieName(subName); //throws error"," "," if (isUndefined(value)){"," error(\"Cookie.setSub(): Subcookie value cannot be undefined.\");"," }"," "," var hash = this.getSubs(name);"," "," if (!isObject(hash)){"," hash = {};"," }"," "," hash[subName] = value; "," "," return this.setSubs(name, hash, options);"," "," },"," "," /**"," * Sets a cookie with a given name to contain a hash of name-value pairs."," * @param {String} name The name of the cookie to set."," * @param {Object} value An object containing name-value pairs."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * and secure (true/false)."," * @return {String} The created cookie string."," * @method setSubs"," * @static"," */"," setSubs : function (name, value, options) {"," "," validateCookieName(name); //throws error"," "," if (!isObject(value)){"," error(\"Cookie.setSubs(): Cookie value must be an object.\");"," }"," "," var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);"," doc.cookie = text;"," return text; "," } "," "," };","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/cookie/cookie.js"].code=["YUI.add('cookie', function (Y, NAME) {","","/**"," * Utilities for cookie management"," * @module cookie"," */",""," //shortcuts"," var L = Y.Lang,"," O = Y.Object,"," NULL = null,"," "," //shortcuts to functions"," isString = L.isString,"," isObject = L.isObject,"," isUndefined = L.isUndefined,"," isFunction = L.isFunction,"," encode = encodeURIComponent,"," decode = decodeURIComponent,"," "," //shortcut to document"," doc = Y.config.doc;"," "," /*"," * Throws an error message."," */"," function error(message){"," throw new TypeError(message);"," } "," "," /*"," * Checks the validity of a cookie name."," */"," function validateCookieName(name){"," if (!isString(name) || name === \"\"){"," error(\"Cookie name must be a non-empty string.\");"," } "," }"," "," /*"," * Checks the validity of a subcookie name."," */ "," function validateSubcookieName(subName){"," if (!isString(subName) || subName === \"\"){"," error(\"Subcookie name must be a non-empty string.\");"," } "," }"," "," /**"," * Cookie utility."," * @class Cookie"," * @static"," */"," Y.Cookie = {"," "," //-------------------------------------------------------------------------"," // Private Methods"," //-------------------------------------------------------------------------"," "," /**"," * Creates a cookie string that can be assigned into document.cookie."," * @param {String} name The name of the cookie."," * @param {String} value The value of the cookie."," * @param {Boolean} encodeValue True to encode the value, false to leave as-is."," * @param {Object} options (Optional) Options for the cookie."," * @return {String} The formatted cookie string."," * @method _createCookieString"," * @private"," * @static"," */"," _createCookieString : function (name /*:String*/, value /*:Variant*/, encodeValue /*:Boolean*/, options /*:Object*/) /*:String*/ {"," "," options = options || {};"," "," var text /*:String*/ = encode(name) + \"=\" + (encodeValue ? encode(value) : value),"," expires = options.expires,"," path = options.path,"," domain = options.domain;"," "," "," if (isObject(options)){"," //expiration date"," if (expires instanceof Date){"," text += \"; expires=\" + expires.toUTCString();"," }"," "," //path"," if (isString(path) && path !== \"\"){"," text += \"; path=\" + path;"," }"," "," //domain"," if (isString(domain) && domain !== \"\"){"," text += \"; domain=\" + domain;"," }"," "," //secure"," if (options.secure === true){"," text += \"; secure\";"," }"," }"," "," return text;"," },"," "," /**"," * Formats a cookie value for an object containing multiple values."," * @param {Object} hash An object of key-value pairs to create a string for."," * @return {String} A string suitable for use as a cookie value."," * @method _createCookieHashString"," * @private"," * @static"," */"," _createCookieHashString : function (hash /*:Object*/) /*:String*/ {"," if (!isObject(hash)){"," error(\"Cookie._createCookieHashString(): Argument must be an object.\");"," }"," "," var text /*:Array*/ = [];",""," O.each(hash, function(value, key){"," if (!isFunction(value) && !isUndefined(value)){"," text.push(encode(key) + \"=\" + encode(String(value)));"," } "," });"," "," return text.join(\"&\");"," },"," "," /**"," * Parses a cookie hash string into an object."," * @param {String} text The cookie hash string to parse (format: n1=v1&n2=v2)."," * @return {Object} An object containing entries for each cookie value."," * @method _parseCookieHash"," * @private"," * @static"," */"," _parseCookieHash : function (text) {"," "," var hashParts = text.split(\"&\"),"," hashPart = NULL,"," hash = {};"," "," if (text.length){"," for (var i=0, len=hashParts.length; i < len; i++){"," hashPart = hashParts[i].split(\"=\");"," hash[decode(hashPart[0])] = decode(hashPart[1]);"," }"," }"," "," return hash; "," },"," "," /**"," * Parses a cookie string into an object representing all accessible cookies."," * @param {String} text The cookie string to parse."," * @param {Boolean} shouldDecode (Optional) Indicates if the cookie values should be decoded or not. Default is true."," * @return {Object} An object containing entries for each accessible cookie."," * @method _parseCookieString"," * @private"," * @static"," */"," _parseCookieString : function (text /*:String*/, shouldDecode /*:Boolean*/) /*:Object*/ {"," "," var cookies /*:Object*/ = {}; "," "," if (isString(text) && text.length > 0) {"," "," var decodeValue = (shouldDecode === false ? function(s){return s;} : decode), "," cookieParts = text.split(/;\\s/g),"," cookieName = NULL,"," cookieValue = NULL,"," cookieNameValue = NULL;"," "," for (var i=0, len=cookieParts.length; i < len; i++){"," "," //check for normally-formatted cookie (name-value)"," cookieNameValue = cookieParts[i].match(/([^=]+)=/i);"," if (cookieNameValue instanceof Array){"," try {"," cookieName = decode(cookieNameValue[1]);"," cookieValue = decodeValue(cookieParts[i].substring(cookieNameValue[1].length+1));"," } catch (ex){"," //intentionally ignore the cookie - the encoding is wrong"," }"," } else {"," //means the cookie does not have an \"=\", so treat it as a boolean flag"," cookieName = decode(cookieParts[i]);"," cookieValue = \"\";"," }"," cookies[cookieName] = cookieValue;"," }",""," }"," "," return cookies;"," }, "," "," /**"," * Sets the document object that the cookie utility uses for setting"," * cookies. This method is necessary to ensure that the cookie utility"," * unit tests can pass even when run on a domain instead of locally."," * This method should not be used otherwise; you should use "," * <code>Y.config.doc</code> to change the document that the cookie"," * utility uses for everyday purposes."," * @param {Object} newDoc The object to use as the document."," * @return {void}"," * @method _setDoc"," * @private"," */ "," _setDoc: function(newDoc){"," doc = newDoc;"," },"," "," //-------------------------------------------------------------------------"," // Public Methods"," //-------------------------------------------------------------------------"," "," /**"," * Determines if the cookie with the given name exists. This is useful for"," * Boolean cookies (those that do not follow the name=value convention)."," * @param {String} name The name of the cookie to check."," * @return {Boolean} True if the cookie exists, false if not."," * @method exists"," * @static"," */"," exists: function(name) {"," "," validateCookieName(name); //throws error"," "," var cookies = this._parseCookieString(doc.cookie, true);"," "," return cookies.hasOwnProperty(name);"," }, "," "," /**"," * Returns the cookie value for the given name."," * @param {String} name The name of the cookie to retrieve."," * @param {Function|Object} options (Optional) An object containing one or more"," * cookie options: raw (true/false) and converter (a function)."," * The converter function is run on the value before returning it. The"," * function is not used if the cookie doesn't exist. The function can be"," * passed instead of the options object for backwards compatibility. When"," * raw is set to true, the cookie value is not URI decoded."," * @return {Variant} If no converter is specified, returns a string or null if"," * the cookie doesn't exist. If the converter is specified, returns the value"," * returned from the converter or null if the cookie doesn't exist."," * @method get"," * @static"," */"," get : function (name, options) {"," "," validateCookieName(name); //throws error "," "," var cookies,"," cookie,"," converter;"," "," //if options is a function, then it's the converter"," if (isFunction(options)) {"," converter = options;"," options = {};"," } else if (isObject(options)) {"," converter = options.converter;"," } else {"," options = {};"," }"," "," cookies = this._parseCookieString(doc.cookie, !options.raw);"," cookie = cookies[name];"," "," //should return null, not undefined if the cookie doesn't exist"," if (isUndefined(cookie)) {"," return NULL;"," }"," "," if (!isFunction(converter)){"," return cookie;"," } else {"," return converter(cookie);"," }"," },"," "," /**"," * Returns the value of a subcookie."," * @param {String} name The name of the cookie to retrieve."," * @param {String} subName The name of the subcookie to retrieve."," * @param {Function} converter (Optional) A function to run on the value before returning"," * it. The function is not used if the cookie doesn't exist."," * @return {Variant} If the cookie doesn't exist, null is returned. If the subcookie"," * doesn't exist, null if also returned. If no converter is specified and the"," * subcookie exists, a string is returned. If a converter is specified and the"," * subcookie exists, the value returned from the converter is returned."," * @method getSub"," * @static"," */"," getSub : function (name /*:String*/, subName /*:String*/, converter /*:Function*/) /*:Variant*/ {"," "," var hash /*:Variant*/ = this.getSubs(name); "," "," if (hash !== NULL) {"," "," validateSubcookieName(subName); //throws error"," "," if (isUndefined(hash[subName])){"," return NULL;"," } "," "," if (!isFunction(converter)){"," return hash[subName];"," } else {"," return converter(hash[subName]);"," }"," } else {"," return NULL;"," }"," "," },"," "," /**"," * Returns an object containing name-value pairs stored in the cookie with the given name."," * @param {String} name The name of the cookie to retrieve."," * @return {Object} An object of name-value pairs if the cookie with the given name"," * exists, null if it does not."," * @method getSubs"," * @static"," */"," getSubs : function (name) {"," "," validateCookieName(name); //throws error"," "," var cookies = this._parseCookieString(doc.cookie, false);"," if (isString(cookies[name])){"," return this._parseCookieHash(cookies[name]);"," }"," return NULL;"," },"," "," /**"," * Removes a cookie from the machine by setting its expiration date to"," * sometime in the past."," * @param {String} name The name of the cookie to remove."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), "," * and secure (true/false). The expires option will be overwritten"," * by the method."," * @return {String} The created cookie string."," * @method remove"," * @static"," */"," remove : function (name, options) {"," "," validateCookieName(name); //throws error"," "," //set options"," options = Y.merge(options || {}, {"," expires: new Date(0)"," });"," "," //set cookie"," return this.set(name, \"\", options);"," },"," "," /**"," * Removes a sub cookie with a given name."," * @param {String} name The name of the cookie in which the subcookie exists."," * @param {String} subName The name of the subcookie to remove."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * removeIfEmpty (true/false), and secure (true/false). This must be the same"," * settings as the original subcookie."," * @return {String} The created cookie string."," * @method removeSub"," * @static"," */"," removeSub : function(name, subName, options) {"," "," validateCookieName(name); //throws error"," "," validateSubcookieName(subName); //throws error"," "," options = options || {};"," "," //get all subcookies for this cookie"," var subs = this.getSubs(name);"," "," //delete the indicated subcookie"," if (isObject(subs) && subs.hasOwnProperty(subName)){"," delete subs[subName];"," "," if (!options.removeIfEmpty) {"," //reset the cookie"," "," return this.setSubs(name, subs, options);"," } else {"," //reset the cookie if there are subcookies left, else remove"," for (var key in subs){"," if (subs.hasOwnProperty(key) && !isFunction(subs[key]) && !isUndefined(subs[key])){"," return this.setSubs(name, subs, options);"," }"," }"," "," return this.remove(name, options);"," } "," } else {"," return \"\";"," }"," "," },"," "," /**"," * Sets a cookie with a given name and value."," * @param {String} name The name of the cookie to set."," * @param {Variant} value The value to set for the cookie."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * secure (true/false), and raw (true/false). Setting raw to true indicates"," * that the cookie should not be URI encoded before being set."," * @return {String} The created cookie string."," * @method set"," * @static"," */"," set : function (name, value, options) {"," "," validateCookieName(name); //throws error"," "," if (isUndefined(value)){"," error(\"Cookie.set(): Value cannot be undefined.\");"," }"," "," options = options || {};"," "," var text = this._createCookieString(name, value, !options.raw, options);"," doc.cookie = text;"," return text;"," },"," "," /**"," * Sets a sub cookie with a given name to a particular value."," * @param {String} name The name of the cookie to set."," * @param {String} subName The name of the subcookie to set."," * @param {Variant} value The value to set."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * and secure (true/false)."," * @return {String} The created cookie string."," * @method setSub"," * @static"," */"," setSub : function (name, subName, value, options) {",""," validateCookieName(name); //throws error"," "," validateSubcookieName(subName); //throws error"," "," if (isUndefined(value)){"," error(\"Cookie.setSub(): Subcookie value cannot be undefined.\");"," }"," "," var hash = this.getSubs(name);"," "," if (!isObject(hash)){"," hash = {};"," }"," "," hash[subName] = value; "," "," return this.setSubs(name, hash, options);"," "," },"," "," /**"," * Sets a cookie with a given name to contain a hash of name-value pairs."," * @param {String} name The name of the cookie to set."," * @param {Object} value An object containing name-value pairs."," * @param {Object} options (Optional) An object containing one or more"," * cookie options: path (a string), domain (a string), expires (a Date object),"," * and secure (true/false)."," * @return {String} The created cookie string."," * @method setSubs"," * @static"," */"," setSubs : function (name, value, options) {"," "," validateCookieName(name); //throws error"," "," if (!isObject(value)){"," error(\"Cookie.setSubs(): Cookie value must be an object.\");"," }"," "," var text /*:String*/ = this._createCookieString(name, this._createCookieHashString(value), false, options);"," doc.cookie = text;"," return text; "," } "," "," };","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/cookie/cookie.js"].lines = {"1":0,"9":0,"27":0,"28":0,"34":0,"35":0,"36":0,"43":0,"44":0,"45":0,"54":0,"73":0,"75":0,"81":0,"83":0,"84":0,"88":0,"89":0,"93":0,"94":0,"98":0,"99":0,"103":0,"115":0,"116":0,"119":0,"121":0,"122":0,"123":0,"127":0,"140":0,"144":0,"145":0,"146":0,"147":0,"151":0,"165":0,"167":0,"169":0,"175":0,"178":0,"179":0,"180":0,"181":0,"182":0,"188":0,"189":0,"191":0,"196":0,"212":0,"229":0,"231":0,"233":0,"253":0,"255":0,"260":0,"261":0,"262":0,"263":0,"264":0,"266":0,"269":0,"270":0,"273":0,"274":0,"277":0,"278":0,"280":0,"299":0,"301":0,"303":0,"305":0,"306":0,"309":0,"310":0,"312":0,"315":0,"330":0,"332":0,"333":0,"334":0,"336":0,"353":0,"356":0,"361":0,"378":0,"380":0,"382":0,"385":0,"388":0,"389":0,"391":0,"394":0,"397":0,"398":0,"399":0,"403":0,"406":0,"425":0,"427":0,"428":0,"431":0,"433":0,"434":0,"435":0,"452":0,"454":0,"456":0,"457":0,"460":0,"462":0,"463":0,"466":0,"468":0,"485":0,"487":0,"488":0,"491":0,"492":0,"493":0}; _yuitest_coverage["build/cookie/cookie.js"].functions = {"error:27":0,"validateCookieName:34":0,"validateSubcookieName:43":0,"_createCookieString:71":0,"(anonymous 2):121":0,"_createCookieHashString:114":0,"_parseCookieHash:138":0,"(anonymous 3):169":0,"_parseCookieString:163":0,"_setDoc:211":0,"exists:227":0,"get:251":0,"getSub:297":0,"getSubs:328":0,"remove:351":0,"removeSub:376":0,"set:423":0,"setSub:450":0,"setSubs:483":0,"(anonymous 1):1":0}; _yuitest_coverage["build/cookie/cookie.js"].coveredLines = 120;@@ -675,4 +675,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/cookie/cookie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -502,4 +502,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/cookie/cookie-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("cookie",function(e,t){function h(e){throw new TypeError(e)}function p(e){(!s(e)||e==="")&&h("Cookie name must be a non-empty string.")}function d(e){(!s(e)||e==="")&&h("Subcookie name must be a non-empty string.")}var n=e.Lang,r=e.Object,i=null,s=n.isString,o=n.isObject,u=n.isUndefined,a=n.isFunction,f=encodeURIComponent,l=decodeURIComponent,c=e.config.doc;e.Cookie={_createCookieString:function(e,t,n,r){r=r||{};var i=f(e)+"="+(n?f(t):t),u=r.expires,a=r.path,l=r.domain;return o(r)&&(u instanceof Date&&(i+="; expires="+u.toUTCString()),s(a)&&a!==""&&(i+="; path="+a),s(l)&&l!==""&&(i+="; domain="+l),r.secure===!0&&(i+="; secure")),i},_createCookieHashString:function(e){o(e)||h("Cookie._createCookieHashString(): Argument must be an object.");var t=[];return r.each(e,function(e,n){!a(e)&&!u(e)&&t.push(f(n)+"="+f(String(e)))}),t.join("&")},_parseCookieHash:function(e){var t=e.split("&"),n=i,r={};if(e.length)for(var s=0,o=t.length;s<o;s++)n=t[s].split("="),r[l(n[0])]=l(n[1]);return r},_parseCookieString:function(e,t){var n={};if(s(e)&&e.length>0){var r=t===!1?function(e){return e}:l,o=e.split(/;\s/g),u=i,a=i,f=i;for(var c=0,h=o.length;c<h;c++){f=o[c].match(/([^=]+)=/i);if(f instanceof Array)try{u=l(f[1]),a=r(o[c].substring(f[1].length+1))}catch(p){}else u=l(o[c]),a="";n[u]=a}}return n},_setDoc:function(e){c=e},exists:function(e){p(e);var t=this._parseCookieString(c.cookie,!0);return t.hasOwnProperty(e)},get:function(e,t){p(e);var n,r,s;return a(t)?(s=t,t={}):o(t)?s=t.converter:t={},n=this._parseCookieString(c.cookie,!t.raw),r=n[e],u(r)?i:a(s)?s(r):r},getSub:function(e,t,n){var r=this.getSubs(e);return r!==i?(d(t),u(r[t])?i:a(n)?n(r[t]):r[t]):i},getSubs:function(e){p(e);var t=this._parseCookieString(c.cookie,!1);return s(t[e])?this._parseCookieHash(t[e]):i},remove:function(t,n){return p(t),n=e.merge(n||{},{expires:new Date(0)}),this.set(t,"",n)},removeSub:function(e,t,n){p(e),d(t),n=n||{};var r=this.getSubs(e);if(o(r)&&r.hasOwnProperty(t)){delete r[t];if(!n.removeIfEmpty)return this.setSubs(e,r,n);for(var i in r)if(r.hasOwnProperty(i)&&!a(r[i])&&!u(r[i]))return this.setSubs(e,r,n);return this.remove(e,n)}return""},set:function(e,t,n){p(e),u(t)&&h("Cookie.set(): Value cannot be undefined."),n=n||{};var r=this._createCookieString(e,t,!n.raw,n);return c.cookie=r,r},setSub:function(e,t,n,r){p(e),d(t),u(n)&&h("Cookie.setSub(): Subcookie value cannot be undefined.");var i=this.getSubs(e);return o(i)||(i={}),i[t]=n,this.setSubs(e,i,r)},setSubs:function(e,t,n){p(e),o(t)||h("Cookie.setSubs(): Cookie value must be an object.");var r=this._createCookieString(e,this._createCookieHashString(t),!1,n);return c.cookie=r,r}}},"3.7.2",{requires:["yui-base"]});+YUI.add("cookie",function(e,t){function h(e){throw new TypeError(e)}function p(e){(!s(e)||e==="")&&h("Cookie name must be a non-empty string.")}function d(e){(!s(e)||e==="")&&h("Subcookie name must be a non-empty string.")}var n=e.Lang,r=e.Object,i=null,s=n.isString,o=n.isObject,u=n.isUndefined,a=n.isFunction,f=encodeURIComponent,l=decodeURIComponent,c=e.config.doc;e.Cookie={_createCookieString:function(e,t,n,r){r=r||{};var i=f(e)+"="+(n?f(t):t),u=r.expires,a=r.path,l=r.domain;return o(r)&&(u instanceof Date&&(i+="; expires="+u.toUTCString()),s(a)&&a!==""&&(i+="; path="+a),s(l)&&l!==""&&(i+="; domain="+l),r.secure===!0&&(i+="; secure")),i},_createCookieHashString:function(e){o(e)||h("Cookie._createCookieHashString(): Argument must be an object.");var t=[];return r.each(e,function(e,n){!a(e)&&!u(e)&&t.push(f(n)+"="+f(String(e)))}),t.join("&")},_parseCookieHash:function(e){var t=e.split("&"),n=i,r={};if(e.length)for(var s=0,o=t.length;s<o;s++)n=t[s].split("="),r[l(n[0])]=l(n[1]);return r},_parseCookieString:function(e,t){var n={};if(s(e)&&e.length>0){var r=t===!1?function(e){return e}:l,o=e.split(/;\s/g),u=i,a=i,f=i;for(var c=0,h=o.length;c<h;c++){f=o[c].match(/([^=]+)=/i);if(f instanceof Array)try{u=l(f[1]),a=r(o[c].substring(f[1].length+1))}catch(p){}else u=l(o[c]),a="";n[u]=a}}return n},_setDoc:function(e){c=e},exists:function(e){p(e);var t=this._parseCookieString(c.cookie,!0);return t.hasOwnProperty(e)},get:function(e,t){p(e);var n,r,s;return a(t)?(s=t,t={}):o(t)?s=t.converter:t={},n=this._parseCookieString(c.cookie,!t.raw),r=n[e],u(r)?i:a(s)?s(r):r},getSub:function(e,t,n){var r=this.getSubs(e);return r!==i?(d(t),u(r[t])?i:a(n)?n(r[t]):r[t]):i},getSubs:function(e){p(e);var t=this._parseCookieString(c.cookie,!1);return s(t[e])?this._parseCookieHash(t[e]):i},remove:function(t,n){return p(t),n=e.merge(n||{},{expires:new Date(0)}),this.set(t,"",n)},removeSub:function(e,t,n){p(e),d(t),n=n||{};var r=this.getSubs(e);if(o(r)&&r.hasOwnProperty(t)){delete r[t];if(!n.removeIfEmpty)return this.setSubs(e,r,n);for(var i in r)if(r.hasOwnProperty(i)&&!a(r[i])&&!u(r[i]))return this.setSubs(e,r,n);return this.remove(e,n)}return""},set:function(e,t,n){p(e),u(t)&&h("Cookie.set(): Value cannot be undefined."),n=n||{};var r=this._createCookieString(e,t,!n.raw,n);return c.cookie=r,r},setSub:function(e,t,n,r){p(e),d(t),u(n)&&h("Cookie.setSub(): Subcookie value cannot be undefined.");var i=this.getSubs(e);return o(i)||(i={}),i[t]=n,this.setSubs(e,i,r)},setSubs:function(e,t,n){p(e),o(t)||h("Cookie.setSubs(): Cookie value must be an object.");var r=this._createCookieString(e,this._createCookieHashString(t),!1,n);return c.cookie=r,r}}},"3.7.3",{requires:["yui-base"]});
bundle/cookie/cookie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -502,4 +502,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/createlink-base/createlink-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/createlink-base/createlink-base.js", code: [] };-_yuitest_coverage["build/createlink-base/createlink-base.js"].code=["YUI.add('createlink-base', function (Y, NAME) {","",""," /**"," * Adds prompt style link creation. Adds an override for the <a href=\"Plugin.ExecCommand.html#method_COMMANDS.createlink\">createlink execCommand</a>."," * @class Plugin.CreateLinkBase"," * @static"," * @submodule createlink-base"," * @module editor"," */"," "," var CreateLinkBase = {};"," /**"," * Strings used by the plugin"," * @property STRINGS"," * @static"," */"," CreateLinkBase.STRINGS = {"," /**"," * String used for the Prompt"," * @property PROMPT"," * @static"," */"," PROMPT: 'Please enter the URL for the link to point to:',"," /**"," * String used as the default value of the Prompt"," * @property DEFAULT"," * @static"," */"," DEFAULT: 'http://'"," };",""," Y.namespace('Plugin');"," Y.Plugin.CreateLinkBase = CreateLinkBase;",""," Y.mix(Y.Plugin.ExecCommand.COMMANDS, {"," /**"," * Override for the createlink method from the <a href=\"Plugin.CreateLinkBase.html\">CreateLinkBase</a> plugin."," * @for ExecCommand"," * @method COMMANDS.createlink"," * @static"," * @param {String} cmd The command executed: createlink"," * @return {Node} Node instance of the item touched by this command."," */"," createlink: function(cmd) {"," var inst = this.get('host').getInstance(), out, a, sel, holder,"," url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);",""," if (url) {"," holder = inst.config.doc.createElement('div');"," url = url.replace(/\"/g, '').replace(/'/g, ''); //Remove single & double quotes"," url = inst.config.doc.createTextNode(url);"," holder.appendChild(url);"," url = holder.innerHTML;","",""," this.get('host')._execCommand(cmd, url);"," sel = new inst.EditorSelection();"," out = sel.getSelected();"," if (!sel.isCollapsed && out.size()) {"," //We have a selection"," a = out.item(0).one('a');"," if (a) {"," out.item(0).replace(a);"," }"," if (Y.UA.gecko) {"," if (a.get('parentNode').test('span')) {"," if (a.get('parentNode').one('br.yui-cursor')) {"," a.get('parentNode').insert(a, 'before');"," }"," }"," }"," } else {"," //No selection, insert a new node.."," this.get('host').execCommand('inserthtml', '<a href=\"' + url + '\">' + url + '</a>');"," }"," }"," return a;"," }"," });","","","","}, '3.7.2', {\"requires\": [\"editor-base\"]});"];-_yuitest_coverage["build/createlink-base/createlink-base.js"].lines = {"1":0,"12":0,"18":0,"33":0,"34":0,"36":0,"46":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"57":0,"58":0,"59":0,"60":0,"62":0,"63":0,"64":0,"66":0,"67":0,"68":0,"69":0,"75":0,"78":0};-_yuitest_coverage["build/createlink-base/createlink-base.js"].functions = {"createlink:45":0,"(anonymous 1):1":0};+_yuitest_coverage["build/createlink-base/createlink-base.js"].code=["YUI.add('createlink-base', function (Y, NAME) {","",""," /**"," * Adds prompt style link creation. Adds an override for the"," * <a href=\"Plugin.ExecCommand.html#method_COMMANDS.createlink\">createlink execCommand</a>."," * @class Plugin.CreateLinkBase"," * @static"," * @submodule createlink-base"," * @module editor"," */",""," var CreateLinkBase = {};"," /**"," * Strings used by the plugin"," * @property STRINGS"," * @static"," */"," CreateLinkBase.STRINGS = {"," /**"," * String used for the Prompt"," * @property PROMPT"," * @static"," */"," PROMPT: 'Please enter the URL for the link to point to:',"," /**"," * String used as the default value of the Prompt"," * @property DEFAULT"," * @static"," */"," DEFAULT: 'http://'"," };",""," Y.namespace('Plugin');"," Y.Plugin.CreateLinkBase = CreateLinkBase;",""," Y.mix(Y.Plugin.ExecCommand.COMMANDS, {"," /**"," * Override for the createlink method from the <a href=\"Plugin.CreateLinkBase.html\">CreateLinkBase</a> plugin."," * @for ExecCommand"," * @method COMMANDS.createlink"," * @static"," * @param {String} cmd The command executed: createlink"," * @return {Node} Node instance of the item touched by this command."," */"," createlink: function(cmd) {"," var inst = this.get('host').getInstance(), out, a, sel, holder,"," url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT);",""," if (url) {"," holder = inst.config.doc.createElement('div');"," url = url.replace(/\"/g, '').replace(/'/g, ''); //Remove single & double quotes"," url = inst.config.doc.createTextNode(url);"," holder.appendChild(url);"," url = holder.innerHTML;","",""," this.get('host')._execCommand(cmd, url);"," sel = new inst.EditorSelection();"," out = sel.getSelected();"," if (!sel.isCollapsed && out.size()) {"," //We have a selection"," a = out.item(0).one('a');"," if (a) {"," out.item(0).replace(a);"," }"," if (Y.UA.gecko) {"," if (a.get('parentNode').test('span')) {"," if (a.get('parentNode').one('br.yui-cursor')) {"," a.get('parentNode').insert(a, 'before');"," }"," }"," }"," } else {"," //No selection, insert a new node.."," this.get('host').execCommand('inserthtml', '<a href=\"' + url + '\">' + url + '</a>');"," }"," }"," return a;"," }"," });","","","","}, '3.7.3', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/createlink-base/createlink-base.js"].lines = {"1":0,"13":0,"19":0,"34":0,"35":0,"37":0,"47":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"58":0,"59":0,"60":0,"61":0,"63":0,"64":0,"65":0,"67":0,"68":0,"69":0,"70":0,"76":0,"79":0};+_yuitest_coverage["build/createlink-base/createlink-base.js"].functions = {"createlink:46":0,"(anonymous 1):1":0}; _yuitest_coverage["build/createlink-base/createlink-base.js"].coveredLines = 26; _yuitest_coverage["build/createlink-base/createlink-base.js"].coveredFunctions = 2; _yuitest_coverline("build/createlink-base/createlink-base.js", 1);@@ -42,22 +42,23 @@ /**- * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.+ * Adds prompt style link creation. Adds an override for the+ * <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>. * @class Plugin.CreateLinkBase * @static * @submodule createlink-base * @module editor */- + _yuitest_coverfunc("build/createlink-base/createlink-base.js", "(anonymous 1)", 1);-_yuitest_coverline("build/createlink-base/createlink-base.js", 12);+_yuitest_coverline("build/createlink-base/createlink-base.js", 13); var CreateLinkBase = {}; /** * Strings used by the plugin * @property STRINGS * @static */- _yuitest_coverline("build/createlink-base/createlink-base.js", 18);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 19); CreateLinkBase.STRINGS = { /** * String used for the Prompt@@ -73,12 +74,12 @@ DEFAULT: 'http://' }; - _yuitest_coverline("build/createlink-base/createlink-base.js", 33);-Y.namespace('Plugin'); _yuitest_coverline("build/createlink-base/createlink-base.js", 34);+Y.namespace('Plugin');+ _yuitest_coverline("build/createlink-base/createlink-base.js", 35); Y.Plugin.CreateLinkBase = CreateLinkBase; - _yuitest_coverline("build/createlink-base/createlink-base.js", 36);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 37); Y.mix(Y.Plugin.ExecCommand.COMMANDS, { /** * Override for the createlink method from the <a href="Plugin.CreateLinkBase.html">CreateLinkBase</a> plugin.@@ -89,63 +90,63 @@ * @return {Node} Node instance of the item touched by this command. */ createlink: function(cmd) {- _yuitest_coverfunc("build/createlink-base/createlink-base.js", "createlink", 45);-_yuitest_coverline("build/createlink-base/createlink-base.js", 46);+ _yuitest_coverfunc("build/createlink-base/createlink-base.js", "createlink", 46);+_yuitest_coverline("build/createlink-base/createlink-base.js", 47); var inst = this.get('host').getInstance(), out, a, sel, holder, url = prompt(CreateLinkBase.STRINGS.PROMPT, CreateLinkBase.STRINGS.DEFAULT); - _yuitest_coverline("build/createlink-base/createlink-base.js", 49);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 50); if (url) {- _yuitest_coverline("build/createlink-base/createlink-base.js", 50);-holder = inst.config.doc.createElement('div'); _yuitest_coverline("build/createlink-base/createlink-base.js", 51);-url = url.replace(/"/g, '').replace(/'/g, ''); //Remove single & double quotes+holder = inst.config.doc.createElement('div'); _yuitest_coverline("build/createlink-base/createlink-base.js", 52);-url = inst.config.doc.createTextNode(url);+url = url.replace(/"/g, '').replace(/'/g, ''); //Remove single & double quotes _yuitest_coverline("build/createlink-base/createlink-base.js", 53);-holder.appendChild(url);+url = inst.config.doc.createTextNode(url); _yuitest_coverline("build/createlink-base/createlink-base.js", 54);+holder.appendChild(url);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 55); url = holder.innerHTML; - _yuitest_coverline("build/createlink-base/createlink-base.js", 57);-this.get('host')._execCommand(cmd, url); _yuitest_coverline("build/createlink-base/createlink-base.js", 58);-sel = new inst.EditorSelection();+this.get('host')._execCommand(cmd, url); _yuitest_coverline("build/createlink-base/createlink-base.js", 59);-out = sel.getSelected();+sel = new inst.EditorSelection(); _yuitest_coverline("build/createlink-base/createlink-base.js", 60);+out = sel.getSelected();+ _yuitest_coverline("build/createlink-base/createlink-base.js", 61); if (!sel.isCollapsed && out.size()) { //We have a selection- _yuitest_coverline("build/createlink-base/createlink-base.js", 62);-a = out.item(0).one('a'); _yuitest_coverline("build/createlink-base/createlink-base.js", 63);+a = out.item(0).one('a');+ _yuitest_coverline("build/createlink-base/createlink-base.js", 64); if (a) {- _yuitest_coverline("build/createlink-base/createlink-base.js", 64);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 65); out.item(0).replace(a); }- _yuitest_coverline("build/createlink-base/createlink-base.js", 66);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 67); if (Y.UA.gecko) {- _yuitest_coverline("build/createlink-base/createlink-base.js", 67);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 68); if (a.get('parentNode').test('span')) {- _yuitest_coverline("build/createlink-base/createlink-base.js", 68);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 69); if (a.get('parentNode').one('br.yui-cursor')) {- _yuitest_coverline("build/createlink-base/createlink-base.js", 69);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 70); a.get('parentNode').insert(a, 'before'); } } } } else { //No selection, insert a new node..- _yuitest_coverline("build/createlink-base/createlink-base.js", 75);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 76); this.get('host').execCommand('inserthtml', '<a href="' + url + '">' + url + '</a>'); } }- _yuitest_coverline("build/createlink-base/createlink-base.js", 78);+ _yuitest_coverline("build/createlink-base/createlink-base.js", 79); return a; } }); -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/createlink-base/createlink-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,13 +8,14 @@ /**- * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.+ * Adds prompt style link creation. Adds an override for the+ * <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>. * @class Plugin.CreateLinkBase * @static * @submodule createlink-base * @module editor */- + var CreateLinkBase = {}; /** * Strings used by the plugin@@ -88,4 +89,4 @@ -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/createlink-base/createlink-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("createlink-base",function(e,t){var n={};n.STRINGS={PROMPT:"Please enter the URL for the link to point to:",DEFAULT:"http://"},e.namespace("Plugin"),e.Plugin.CreateLinkBase=n,e.mix(e.Plugin.ExecCommand.COMMANDS,{createlink:function(t){var r=this.get("host").getInstance(),i,s,o,u,a=prompt(n.STRINGS.PROMPT,n.STRINGS.DEFAULT);return a&&(u=r.config.doc.createElement("div"),a=a.replace(/"/g,"").replace(/'/g,""),a=r.config.doc.createTextNode(a),u.appendChild(a),a=u.innerHTML,this.get("host")._execCommand(t,a),o=new r.EditorSelection,i=o.getSelected(),!o.isCollapsed&&i.size()?(s=i.item(0).one("a"),s&&i.item(0).replace(s),e.UA.gecko&&s.get("parentNode").test("span")&&s.get("parentNode").one("br.yui-cursor")&&s.get("parentNode").insert(s,"before")):this.get("host").execCommand("inserthtml",'<a href="'+a+'">'+a+"</a>")),s}})},"3.7.2",{requires:["editor-base"]});+YUI.add("createlink-base",function(e,t){var n={};n.STRINGS={PROMPT:"Please enter the URL for the link to point to:",DEFAULT:"http://"},e.namespace("Plugin"),e.Plugin.CreateLinkBase=n,e.mix(e.Plugin.ExecCommand.COMMANDS,{createlink:function(t){var r=this.get("host").getInstance(),i,s,o,u,a=prompt(n.STRINGS.PROMPT,n.STRINGS.DEFAULT);return a&&(u=r.config.doc.createElement("div"),a=a.replace(/"/g,"").replace(/'/g,""),a=r.config.doc.createTextNode(a),u.appendChild(a),a=u.innerHTML,this.get("host")._execCommand(t,a),o=new r.EditorSelection,i=o.getSelected(),!o.isCollapsed&&i.size()?(s=i.item(0).one("a"),s&&i.item(0).replace(s),e.UA.gecko&&s.get("parentNode").test("span")&&s.get("parentNode").one("br.yui-cursor")&&s.get("parentNode").insert(s,"before")):this.get("host").execCommand("inserthtml",'<a href="'+a+'">'+a+"</a>")),s}})},"3.7.3",{requires:["editor-base"]});
bundle/createlink-base/createlink-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,13 +8,14 @@ /**- * Adds prompt style link creation. Adds an override for the <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>.+ * Adds prompt style link creation. Adds an override for the+ * <a href="Plugin.ExecCommand.html#method_COMMANDS.createlink">createlink execCommand</a>. * @class Plugin.CreateLinkBase * @static * @submodule createlink-base * @module editor */- + var CreateLinkBase = {}; /** * Strings used by the plugin@@ -87,4 +88,4 @@ -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/cssbase-context/base-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase-context/base-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase-context/cssbase-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase-context/cssbase-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase/base-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase/base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase/cssbase-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbase/cssbase.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbutton/cssbutton-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssbutton/cssbutton.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts-context/cssfonts-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts-context/cssfonts-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts-context/fonts-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts-context/fonts-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts/cssfonts-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts/cssfonts.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts/fonts-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssfonts/fonts.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids-base/cssgrids-base-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids-base/cssgrids-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids-context-deprecated/grids-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids-context-deprecated/grids-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids-units/cssgrids-units-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids-units/cssgrids-units.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids/cssgrids-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids/cssgrids.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids/grids-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssgrids/grids.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset-context/cssreset-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset-context/cssreset-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset-context/reset-context-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset-context/reset-context.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset/cssreset-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset/cssreset.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset/reset-min.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/cssreset/reset.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/dataschema-array/dataschema-array-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dataschema-array/dataschema-array.js", code: [] };-_yuitest_coverage["build/dataschema-array/dataschema-array.js"].code=["YUI.add('dataschema-array', function (Y, NAME) {","","/**"," * Provides a DataSchema implementation which can be used to work with data"," * stored in arrays."," *"," * @module dataschema"," * @submodule dataschema-array"," */","","/**","Provides a DataSchema implementation which can be used to work with data","stored in arrays.","","See the `apply` method below for usage.","","@class DataSchema.Array","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,",""," SchemaArray = {",""," ////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.Array static methods"," //"," ////////////////////////////////////////////////////////////////////////",""," /**"," Applies a schema to an array of data, returning a normalized object"," with results in the `results` property. The `meta` property of the"," response object is present for consistency, but is assigned an empty"," object. If the input data is absent or not an array, an `error`"," property will be added.",""," The input array is expected to contain objects, arrays, or strings.",""," If _schema_ is not specified or _schema.resultFields_ is not an array,"," `response.results` will be assigned the input array unchanged.",""," When a _schema_ is specified, the following will occur:",""," If the input array contains strings, they will be copied as-is into the"," `response.results` array.",""," If the input array contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the input array contains objects, the identified"," _schema.resultFields_ will be used to extract a value from those"," objects for the output result.",""," _schema.resultFields_ field identifiers are objects with the following properties:",""," * `key` : <strong>(required)</strong> The locator name (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use strings as identifiers"," instead of objects (see example below).",""," @example"," // Process array of arrays"," var schema = { resultFields: [ 'fruit', 'color' ] },"," data = ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ];",""," var response = Y.DataSchema.Array.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }",""," "," // Process array of objects"," data = ["," { fruit: 'Banana', color: 'yellow', price: '1.96' },"," { fruit: 'Orange', color: 'orange', price: '2.04' },"," { fruit: 'Eggplant', color: 'purple', price: '4.31' }"," ];",""," response = Y.DataSchema.Array.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'fruit',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.Array.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }"," "," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} data Array data."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = {results:[],meta:{}};",""," if(LANG.isArray(data_in)) {"," if(schema && LANG.isArray(schema.resultFields)) {"," // Parse results data"," data_out = SchemaArray._parseResults.call(this, schema.resultFields, data_in, data_out);"," }"," else {"," data_out.results = data_in;"," }"," }"," else {"," data_out.error = new Error(\"Array schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param fields {Array} Schema to parse against."," * @param array_in {Array} Array to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(fields, array_in, data_out) {"," var results = [],"," result, item, type, field, key, value, i, j;",""," for(i=array_in.length-1; i>-1; i--) {"," result = {};"," item = array_in[i];"," type = (LANG.isObject(item) && !LANG.isFunction(item)) ? 2 : (LANG.isArray(item)) ? 1 : (LANG.isString(item)) ? 0 : -1;"," if(type > 0) {"," for(j=fields.length-1; j>-1; j--) {"," field = fields[j];"," key = (!LANG.isUndefined(field.key)) ? field.key : field;"," value = (!LANG.isUndefined(item[key])) ? item[key] : item[j];"," result[key] = Y.DataSchema.Base.parse.call(this, value, field);"," }"," }"," else if(type === 0) {"," result = item;"," }"," else {"," //TODO: null or {}?"," result = null;"," }"," results[i] = result;"," }"," data_out.results = results;",""," return data_out;"," }"," };","","Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base);","","","}, '3.7.2', {\"requires\": [\"dataschema-base\"]});"];+_yuitest_coverage["build/dataschema-array/dataschema-array.js"].code=["YUI.add('dataschema-array', function (Y, NAME) {","","/**"," * Provides a DataSchema implementation which can be used to work with data"," * stored in arrays."," *"," * @module dataschema"," * @submodule dataschema-array"," */","","/**","Provides a DataSchema implementation which can be used to work with data","stored in arrays.","","See the `apply` method below for usage.","","@class DataSchema.Array","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,",""," SchemaArray = {",""," ////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.Array static methods"," //"," ////////////////////////////////////////////////////////////////////////",""," /**"," Applies a schema to an array of data, returning a normalized object"," with results in the `results` property. The `meta` property of the"," response object is present for consistency, but is assigned an empty"," object. If the input data is absent or not an array, an `error`"," property will be added.",""," The input array is expected to contain objects, arrays, or strings.",""," If _schema_ is not specified or _schema.resultFields_ is not an array,"," `response.results` will be assigned the input array unchanged.",""," When a _schema_ is specified, the following will occur:",""," If the input array contains strings, they will be copied as-is into the"," `response.results` array.",""," If the input array contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the input array contains objects, the identified"," _schema.resultFields_ will be used to extract a value from those"," objects for the output result.",""," _schema.resultFields_ field identifiers are objects with the following properties:",""," * `key` : <strong>(required)</strong> The locator name (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use strings as identifiers"," instead of objects (see example below).",""," @example"," // Process array of arrays"," var schema = { resultFields: [ 'fruit', 'color' ] },"," data = ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ];",""," var response = Y.DataSchema.Array.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }",""," "," // Process array of objects"," data = ["," { fruit: 'Banana', color: 'yellow', price: '1.96' },"," { fruit: 'Orange', color: 'orange', price: '2.04' },"," { fruit: 'Eggplant', color: 'purple', price: '4.31' }"," ];",""," response = Y.DataSchema.Array.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'fruit',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.Array.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }"," "," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} data Array data."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = {results:[],meta:{}};",""," if(LANG.isArray(data_in)) {"," if(schema && LANG.isArray(schema.resultFields)) {"," // Parse results data"," data_out = SchemaArray._parseResults.call(this, schema.resultFields, data_in, data_out);"," }"," else {"," data_out.results = data_in;"," }"," }"," else {"," data_out.error = new Error(\"Array schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param fields {Array} Schema to parse against."," * @param array_in {Array} Array to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(fields, array_in, data_out) {"," var results = [],"," result, item, type, field, key, value, i, j;",""," for(i=array_in.length-1; i>-1; i--) {"," result = {};"," item = array_in[i];"," type = (LANG.isObject(item) && !LANG.isFunction(item)) ? 2 : (LANG.isArray(item)) ? 1 : (LANG.isString(item)) ? 0 : -1;"," if(type > 0) {"," for(j=fields.length-1; j>-1; j--) {"," field = fields[j];"," key = (!LANG.isUndefined(field.key)) ? field.key : field;"," value = (!LANG.isUndefined(item[key])) ? item[key] : item[j];"," result[key] = Y.DataSchema.Base.parse.call(this, value, field);"," }"," }"," else if(type === 0) {"," result = item;"," }"," else {"," //TODO: null or {}?"," result = null;"," }"," results[i] = result;"," }"," data_out.results = results;",""," return data_out;"," }"," };","","Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base);","","","}, '3.7.3', {\"requires\": [\"dataschema-base\"]});"]; _yuitest_coverage["build/dataschema-array/dataschema-array.js"].lines = {"1":0,"21":0,"122":0,"125":0,"126":0,"128":0,"131":0,"135":0,"138":0,"153":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"168":0,"169":0,"173":0,"175":0,"177":0,"179":0,"183":0}; _yuitest_coverage["build/dataschema-array/dataschema-array.js"].functions = {"apply:121":0,"_parseResults:152":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dataschema-array/dataschema-array.js"].coveredLines = 27;@@ -252,4 +252,4 @@ Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-array/dataschema-array-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -192,4 +192,4 @@ Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-array/dataschema-array-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-array",function(e,t){var n=e.Lang,r={apply:function(e,t){var i=t,s={results:[],meta:{}};return n.isArray(i)?e&&n.isArray(e.resultFields)?s=r._parseResults.call(this,e.resultFields,i,s):s.results=i:s.error=new Error("Array schema parse failure"),s},_parseResults:function(t,r,i){var s=[],o,u,a,f,l,c,h,p;for(h=r.length-1;h>-1;h--){o={},u=r[h],a=n.isObject(u)&&!n.isFunction(u)?2:n.isArray(u)?1:n.isString(u)?0:-1;if(a>0)for(p=t.length-1;p>-1;p--)f=t[p],l=n.isUndefined(f.key)?f:f.key,c=n.isUndefined(u[l])?u[p]:u[l],o[l]=e.DataSchema.Base.parse.call(this,c,f);else a===0?o=u:o=null;s[h]=o}return i.results=s,i}};e.DataSchema.Array=e.mix(r,e.DataSchema.Base)},"3.7.2",{requires:["dataschema-base"]});+YUI.add("dataschema-array",function(e,t){var n=e.Lang,r={apply:function(e,t){var i=t,s={results:[],meta:{}};return n.isArray(i)?e&&n.isArray(e.resultFields)?s=r._parseResults.call(this,e.resultFields,i,s):s.results=i:s.error=new Error("Array schema parse failure"),s},_parseResults:function(t,r,i){var s=[],o,u,a,f,l,c,h,p;for(h=r.length-1;h>-1;h--){o={},u=r[h],a=n.isObject(u)&&!n.isFunction(u)?2:n.isArray(u)?1:n.isString(u)?0:-1;if(a>0)for(p=t.length-1;p>-1;p--)f=t[p],l=n.isUndefined(f.key)?f:f.key,c=n.isUndefined(u[l])?u[p]:u[l],o[l]=e.DataSchema.Base.parse.call(this,c,f);else a===0?o=u:o=null;s[h]=o}return i.results=s,i}};e.DataSchema.Array=e.mix(r,e.DataSchema.Base)},"3.7.3",{requires:["dataschema-base"]});
bundle/dataschema-array/dataschema-array.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -189,4 +189,4 @@ Y.DataSchema.Array = Y.mix(SchemaArray, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-base/dataschema-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dataschema-base/dataschema-base.js", code: [] };-_yuitest_coverage["build/dataschema-base/dataschema-base.js"].code=["YUI.add('dataschema-base', function (Y, NAME) {","","/**"," * The DataSchema utility provides a common configurable interface for widgets to"," * apply a given schema to a variety of data."," *"," * @module dataschema"," * @main dataschema"," */","","/**"," * Provides the base DataSchema implementation, which can be extended to "," * create DataSchemas for specific data formats, such XML, JSON, text and"," * arrays."," *"," * @module dataschema"," * @submodule dataschema-base"," */","","var LANG = Y.Lang,","/**"," * Base class for the YUI DataSchema Utility."," * @class DataSchema.Base"," * @static"," */"," SchemaBase = {"," /**"," * Overridable method returns data as-is."," *"," * @method apply"," * @param schema {Object} Schema to apply."," * @param data {Object} Data."," * @return {Object} Schema-parsed data."," * @static"," */"," apply: function(schema, data) {"," return data;"," },"," "," /**"," * Applies field parser, if defined"," *"," * @method parse"," * @param value {Object} Original value."," * @param field {Object} Field."," * @return {Object} Type-converted value."," */"," parse: function(value, field) {"," if(field.parser) {"," var parser = (LANG.isFunction(field.parser)) ?"," field.parser : Y.Parsers[field.parser+''];"," if(parser) {"," value = parser.call(this, value);"," }"," else {"," }"," }"," return value;"," }","};","","Y.namespace(\"DataSchema\").Base = SchemaBase;","Y.namespace(\"Parsers\");","","","}, '3.7.2', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/dataschema-base/dataschema-base.js"].code=["YUI.add('dataschema-base', function (Y, NAME) {","","/**"," * The DataSchema utility provides a common configurable interface for widgets to"," * apply a given schema to a variety of data."," *"," * @module dataschema"," * @main dataschema"," */","","/**"," * Provides the base DataSchema implementation, which can be extended to "," * create DataSchemas for specific data formats, such XML, JSON, text and"," * arrays."," *"," * @module dataschema"," * @submodule dataschema-base"," */","","var LANG = Y.Lang,","/**"," * Base class for the YUI DataSchema Utility."," * @class DataSchema.Base"," * @static"," */"," SchemaBase = {"," /**"," * Overridable method returns data as-is."," *"," * @method apply"," * @param schema {Object} Schema to apply."," * @param data {Object} Data."," * @return {Object} Schema-parsed data."," * @static"," */"," apply: function(schema, data) {"," return data;"," },"," "," /**"," * Applies field parser, if defined"," *"," * @method parse"," * @param value {Object} Original value."," * @param field {Object} Field."," * @return {Object} Type-converted value."," */"," parse: function(value, field) {"," if(field.parser) {"," var parser = (LANG.isFunction(field.parser)) ?"," field.parser : Y.Parsers[field.parser+''];"," if(parser) {"," value = parser.call(this, value);"," }"," else {"," }"," }"," return value;"," }","};","","Y.namespace(\"DataSchema\").Base = SchemaBase;","Y.namespace(\"Parsers\");","","","}, '3.7.3', {\"requires\": [\"base\"]});"]; _yuitest_coverage["build/dataschema-base/dataschema-base.js"].lines = {"1":0,"20":0,"37":0,"49":0,"50":0,"52":0,"53":0,"58":0,"62":0,"63":0}; _yuitest_coverage["build/dataschema-base/dataschema-base.js"].functions = {"apply:36":0,"parse:48":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dataschema-base/dataschema-base.js"].coveredLines = 10;@@ -115,4 +115,4 @@ Y.namespace("Parsers"); -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/dataschema-base/dataschema-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -70,4 +70,4 @@ Y.namespace("Parsers"); -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/dataschema-base/dataschema-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-base",function(e,t){var n=e.Lang,r={apply:function(e,t){return t},parse:function(t,r){if(r.parser){var i=n.isFunction(r.parser)?r.parser:e.Parsers[r.parser+""];i&&(t=i.call(this,t))}return t}};e.namespace("DataSchema").Base=r,e.namespace("Parsers")},"3.7.2",{requires:["base"]});+YUI.add("dataschema-base",function(e,t){var n=e.Lang,r={apply:function(e,t){return t},parse:function(t,r){if(r.parser){var i=n.isFunction(r.parser)?r.parser:e.Parsers[r.parser+""];i&&(t=i.call(this,t))}return t}};e.namespace("DataSchema").Base=r,e.namespace("Parsers")},"3.7.3",{requires:["base"]});
bundle/dataschema-base/dataschema-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -69,4 +69,4 @@ Y.namespace("Parsers"); -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/dataschema-json/dataschema-json-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dataschema-json/dataschema-json.js", code: [] };-_yuitest_coverage["build/dataschema-json/dataschema-json.js"].code=["YUI.add('dataschema-json', function (Y, NAME) {","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","@module dataschema","@submodule dataschema-json","**/","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","See the `apply` method for usage.","","@class DataSchema.JSON","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,"," isFunction = LANG.isFunction,"," isObject = LANG.isObject,"," isArray = LANG.isArray,"," // TODO: I don't think the calls to Base.* need to be done via Base since"," // Base is mixed into SchemaJSON. Investigate for later."," Base = Y.DataSchema.Base,",""," SchemaJSON;"," ","SchemaJSON = {","","/////////////////////////////////////////////////////////////////////////////","//","// DataSchema.JSON static methods","//","/////////////////////////////////////////////////////////////////////////////"," /**"," * Utility function converts JSON locator strings into walkable paths"," *"," * @method getPath"," * @param locator {String} JSON value locator."," * @return {String[]} Walkable path to data value."," * @static"," */"," getPath: function(locator) {"," var path = null,"," keys = [],"," i = 0;",""," if (locator) {"," // Strip the [\"string keys\"] and [1] array indexes"," // TODO: the first two steps can probably be reduced to one with"," // /\\[\\s*(['\"])?(.*?)\\1\\s*\\]/g, but the array indices would be"," // stored as strings. This is not likely an issue."," locator = locator."," replace(/\\[\\s*(['\"])(.*?)\\1\\s*\\]/g,"," function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);})."," replace(/\\[(\\d+)\\]/g,"," function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);})."," replace(/^\\./,''); // remove leading dot",""," // Validate against problematic characters."," // commented out because the path isn't sent to eval, so it"," // should be safe. I'm not sure what makes a locator invalid."," //if (!/[^\\w\\.\\$@]/.test(locator)) {"," path = locator.split('.');"," for (i=path.length-1; i >= 0; --i) {"," if (path[i].charAt(0) === '@') {"," path[i] = keys[parseInt(path[i].substr(1),10)];"," }"," }"," /*}"," else {"," }"," */"," }"," return path;"," },",""," /**"," * Utility function to walk a path and return the value located there."," *"," * @method getLocationValue"," * @param path {String[]} Locator path."," * @param data {String} Data to traverse."," * @return {Object} Data value at location."," * @static"," */"," getLocationValue: function (path, data) {"," var i = 0,"," len = path.length;"," for (;i<len;i++) {"," if (isObject(data) && (path[i] in data)) {"," data = data[path[i]];"," } else {"," data = undefined;"," break;"," }"," }"," return data;"," },",""," /**"," Applies a schema to an array of data located in a JSON structure, returning"," a normalized object with results in the `results` property. Additional"," information can be parsed out of the JSON for inclusion in the `meta`"," property of the response object. If an error is encountered during"," processing, an `error` property will be added.",""," The input _data_ is expected to be an object or array. If it is a string,"," it will be passed through `Y.JSON.parse()`.",""," If _data_ contains an array of data records to normalize, specify the"," _schema.resultListLocator_ as a dot separated path string just as you would"," reference it in JavaScript. So if your _data_ object has a record array at"," _data.response.results_, use _schema.resultListLocator_ ="," \"response.results\". Bracket notation can also be used for array indices or"," object properties (e.g. \"response['results']\"); This is called a \"path"," locator\"",""," Field data in the result list is extracted with field identifiers in"," _schema.resultFields_. Field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The path locator (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use path locators (strings) "," instead of field identifiers (objects) -- see example below.",""," If no processing of the result list array is needed, _schema.resultFields_"," can be omitted; the `response.results` will point directly to the array.",""," If the result list contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the result list contains objects, the identified _schema.resultFields_"," will be used to extract a value from those objects for the output result.",""," To extract additional information from the JSON, include an array of"," path locators in _schema.metaFields_. The collected values will be"," stored in `response.meta`.","",""," @example"," // Process array of arrays"," var schema = {"," resultListLocator: 'produce.fruit',"," resultFields: [ 'name', 'color' ]"," },"," data = {"," produce: {"," fruit: ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ]"," }"," };",""," var response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }",""," "," // Process array of objects + some metadata"," schema.metaFields = [ 'lastInventory' ];",""," data = {"," produce: {"," fruit: ["," { name: 'Banana', color: 'yellow', price: '1.96' },"," { name: 'Orange', color: 'orange', price: '2.04' },"," { name: 'Eggplant', color: 'purple', price: '4.31' }"," ]"," },"," lastInventory: '2011-07-19'"," };",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }"," // response.meta.lastInventory is '2001-07-19'","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'name',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }"," "," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {String} [schema.resultListLocator] Path locator for the"," location of the array of records to flatten into `response.results`"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} [schema.metaFields] Path locators to extract extra"," non-record related information from the data object."," @param {Object|Array|String} data JSON data or its string serialization."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," // Convert incoming JSON strings"," if (!isObject(data)) {"," try {"," data_in = Y.JSON.parse(data);"," }"," catch(e) {"," data_out.error = e;"," return data_out;"," }"," }",""," if (isObject(data_in) && schema) {"," // Parse results data"," data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);",""," // Parse meta data"," if (schema.metaFields !== undefined) {"," data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);"," }"," }"," else {"," data_out.error = new Error(\"JSON schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Object} Schema to parse against."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, json_in, data_out) {"," var getPath = SchemaJSON.getPath,"," getValue = SchemaJSON.getLocationValue,"," path = getPath(schema.resultListLocator),"," results = path ?"," (getValue(path, json_in) ||"," // Fall back to treat resultListLocator as a simple key"," json_in[schema.resultListLocator]) :"," // Or if no resultListLocator is supplied, use the input"," json_in;",""," if (isArray(results)) {"," // if no result fields are passed in, then just take"," // the results array whole-hog Sometimes you're getting"," // an array of strings, or want the whole object, so"," // resultFields don't make sense."," if (isArray(schema.resultFields)) {"," data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);"," } else {"," data_out.results = results;"," }"," } else if (schema.resultListLocator) {"," data_out.results = [];"," data_out.error = new Error(\"JSON results retrieval failure\");"," }",""," return data_out;"," },",""," /**"," * Get field data values out of list of full results"," *"," * @method _getFieldValues"," * @param fields {Array} Fields to find."," * @param array_in {Array} Results to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _getFieldValues: function(fields, array_in, data_out) {"," var results = [],"," len = fields.length,"," i, j,"," field, key, locator, path, parser, val,"," simplePaths = [], complexPaths = [], fieldParsers = [],"," result, record;",""," // First collect hashes of simple paths, complex paths, and parsers"," for (i=0; i<len; i++) {"," field = fields[i]; // A field can be a simple string or a hash"," key = field.key || field; // Find the key"," locator = field.locator || key; // Find the locator",""," // Validate and store locators for later"," path = SchemaJSON.getPath(locator);"," if (path) {"," if (path.length === 1) {"," simplePaths.push({"," key : key,"," path: path[0]"," });"," } else {"," complexPaths.push({"," key : key,"," path : path,"," locator: locator"," });"," }"," } else {"," }",""," // Validate and store parsers for later"," //TODO: use Y.DataSchema.parse?"," parser = (isFunction(field.parser)) ?"," field.parser :"," Y.Parsers[field.parser + ''];",""," if (parser) {"," fieldParsers.push({"," key : key,"," parser: parser"," });"," }"," }",""," // Traverse list of array_in, creating records of simple fields,"," // complex fields, and applying parsers as necessary"," for (i=array_in.length-1; i>=0; --i) {"," record = {};"," result = array_in[i];"," if(result) {"," // Cycle through complexLocators"," for (j=complexPaths.length - 1; j>=0; --j) {"," path = complexPaths[j];"," val = SchemaJSON.getLocationValue(path.path, result);"," if (val === undefined) {"," val = SchemaJSON.getLocationValue([path.locator], result);"," // Fail over keys like \"foo.bar\" from nested parsing"," // to single token parsing if a value is found in"," // results[\"foo.bar\"]"," if (val !== undefined) {"," simplePaths.push({"," key: path.key,"," path: path.locator"," });"," // Don't try to process the path as complex"," // for further results"," complexPaths.splice(i,1);"," continue;"," }"," }",""," record[path.key] = Base.parse.call(this,"," (SchemaJSON.getLocationValue(path.path, result)), path);"," }",""," // Cycle through simpleLocators"," for (j = simplePaths.length - 1; j >= 0; --j) {"," path = simplePaths[j];"," // Bug 1777850: The result might be an array instead of object"," record[path.key] = Base.parse.call(this,"," ((result[path.path] === undefined) ?"," result[j] : result[path.path]), path);"," }",""," // Cycle through fieldParsers"," for (j=fieldParsers.length-1; j>=0; --j) {"," key = fieldParsers[j].key;"," record[key] = fieldParsers[j].parser.call(this, record[key]);"," // Safety net"," if (record[key] === undefined) {"," record[key] = null;"," }"," }"," results[i] = record;"," }"," }"," data_out.results = results;"," return data_out;"," },",""," /**"," * Parses results data according to schema"," *"," * @method _parseMeta"," * @param metaFields {Object} Metafields definitions."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Schema-parsed meta data."," * @static"," * @protected"," */"," _parseMeta: function(metaFields, json_in, data_out) {"," if (isObject(metaFields)) {"," var key, path;"," for(key in metaFields) {"," if (metaFields.hasOwnProperty(key)) {"," path = SchemaJSON.getPath(metaFields[key]);"," if (path && json_in) {"," data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);"," }"," }"," }"," }"," else {"," data_out.error = new Error(\"JSON meta data retrieval failure\");"," }"," return data_out;"," }","};","","// TODO: Y.Object + mix() might be better here","Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);","","","}, '3.7.2', {\"requires\": [\"dataschema-base\", \"json\"]});"];+_yuitest_coverage["build/dataschema-json/dataschema-json.js"].code=["YUI.add('dataschema-json', function (Y, NAME) {","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","@module dataschema","@submodule dataschema-json","**/","","/**","Provides a DataSchema implementation which can be used to work with JSON data.","","See the `apply` method for usage.","","@class DataSchema.JSON","@extends DataSchema.Base","@static","**/","var LANG = Y.Lang,"," isFunction = LANG.isFunction,"," isObject = LANG.isObject,"," isArray = LANG.isArray,"," // TODO: I don't think the calls to Base.* need to be done via Base since"," // Base is mixed into SchemaJSON. Investigate for later."," Base = Y.DataSchema.Base,",""," SchemaJSON;"," ","SchemaJSON = {","","/////////////////////////////////////////////////////////////////////////////","//","// DataSchema.JSON static methods","//","/////////////////////////////////////////////////////////////////////////////"," /**"," * Utility function converts JSON locator strings into walkable paths"," *"," * @method getPath"," * @param locator {String} JSON value locator."," * @return {String[]} Walkable path to data value."," * @static"," */"," getPath: function(locator) {"," var path = null,"," keys = [],"," i = 0;",""," if (locator) {"," // Strip the [\"string keys\"] and [1] array indexes"," // TODO: the first two steps can probably be reduced to one with"," // /\\[\\s*(['\"])?(.*?)\\1\\s*\\]/g, but the array indices would be"," // stored as strings. This is not likely an issue."," locator = locator."," replace(/\\[\\s*(['\"])(.*?)\\1\\s*\\]/g,"," function (x,$1,$2) {keys[i]=$2;return '.@'+(i++);})."," replace(/\\[(\\d+)\\]/g,"," function (x,$1) {keys[i]=parseInt($1,10)|0;return '.@'+(i++);})."," replace(/^\\./,''); // remove leading dot",""," // Validate against problematic characters."," // commented out because the path isn't sent to eval, so it"," // should be safe. I'm not sure what makes a locator invalid."," //if (!/[^\\w\\.\\$@]/.test(locator)) {"," path = locator.split('.');"," for (i=path.length-1; i >= 0; --i) {"," if (path[i].charAt(0) === '@') {"," path[i] = keys[parseInt(path[i].substr(1),10)];"," }"," }"," /*}"," else {"," }"," */"," }"," return path;"," },",""," /**"," * Utility function to walk a path and return the value located there."," *"," * @method getLocationValue"," * @param path {String[]} Locator path."," * @param data {String} Data to traverse."," * @return {Object} Data value at location."," * @static"," */"," getLocationValue: function (path, data) {"," var i = 0,"," len = path.length;"," for (;i<len;i++) {"," if (isObject(data) && (path[i] in data)) {"," data = data[path[i]];"," } else {"," data = undefined;"," break;"," }"," }"," return data;"," },",""," /**"," Applies a schema to an array of data located in a JSON structure, returning"," a normalized object with results in the `results` property. Additional"," information can be parsed out of the JSON for inclusion in the `meta`"," property of the response object. If an error is encountered during"," processing, an `error` property will be added.",""," The input _data_ is expected to be an object or array. If it is a string,"," it will be passed through `Y.JSON.parse()`.",""," If _data_ contains an array of data records to normalize, specify the"," _schema.resultListLocator_ as a dot separated path string just as you would"," reference it in JavaScript. So if your _data_ object has a record array at"," _data.response.results_, use _schema.resultListLocator_ ="," \"response.results\". Bracket notation can also be used for array indices or"," object properties (e.g. \"response['results']\"); This is called a \"path"," locator\"",""," Field data in the result list is extracted with field identifiers in"," _schema.resultFields_. Field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The path locator (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use path locators (strings) "," instead of field identifiers (objects) -- see example below.",""," If no processing of the result list array is needed, _schema.resultFields_"," can be omitted; the `response.results` will point directly to the array.",""," If the result list contains arrays, `response.results` will contain an"," array of objects with key:value pairs assuming the fields in"," _schema.resultFields_ are ordered in accordance with the data array"," values.",""," If the result list contains objects, the identified _schema.resultFields_"," will be used to extract a value from those objects for the output result.",""," To extract additional information from the JSON, include an array of"," path locators in _schema.metaFields_. The collected values will be"," stored in `response.meta`.","",""," @example"," // Process array of arrays"," var schema = {"," resultListLocator: 'produce.fruit',"," resultFields: [ 'name', 'color' ]"," },"," data = {"," produce: {"," fruit: ["," [ 'Banana', 'yellow' ],"," [ 'Orange', 'orange' ],"," [ 'Eggplant', 'purple' ]"," ]"," }"," };",""," var response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }",""," "," // Process array of objects + some metadata"," schema.metaFields = [ 'lastInventory' ];",""," data = {"," produce: {"," fruit: ["," { name: 'Banana', color: 'yellow', price: '1.96' },"," { name: 'Orange', color: 'orange', price: '2.04' },"," { name: 'Eggplant', color: 'purple', price: '4.31' }"," ]"," },"," lastInventory: '2011-07-19'"," };",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"yellow\" }"," // response.meta.lastInventory is '2001-07-19'","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'name',"," parser: function (val) { return val.toUpperCase(); }"," },"," {"," key: 'price',"," parser: 'number' // Uses Y.Parsers.number"," }"," ];",""," response = Y.DataSchema.JSON.apply(schema, data);",""," // Note price was converted from a numeric string to a number"," // response.results[0] looks like { fruit: \"BANANA\", price: 1.96 }"," "," @method apply"," @param {Object} [schema] Schema to apply. Supported configuration"," properties are:"," @param {String} [schema.resultListLocator] Path locator for the"," location of the array of records to flatten into `response.results`"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} [schema.metaFields] Path locators to extract extra"," non-record related information from the data object."," @param {Object|Array|String} data JSON data or its string serialization."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," // Convert incoming JSON strings"," if (!isObject(data)) {"," try {"," data_in = Y.JSON.parse(data);"," }"," catch(e) {"," data_out.error = e;"," return data_out;"," }"," }",""," if (isObject(data_in) && schema) {"," // Parse results data"," data_out = SchemaJSON._parseResults.call(this, schema, data_in, data_out);",""," // Parse meta data"," if (schema.metaFields !== undefined) {"," data_out = SchemaJSON._parseMeta(schema.metaFields, data_in, data_out);"," }"," }"," else {"," data_out.error = new Error(\"JSON schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Object} Schema to parse against."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, json_in, data_out) {"," var getPath = SchemaJSON.getPath,"," getValue = SchemaJSON.getLocationValue,"," path = getPath(schema.resultListLocator),"," results = path ?"," (getValue(path, json_in) ||"," // Fall back to treat resultListLocator as a simple key"," json_in[schema.resultListLocator]) :"," // Or if no resultListLocator is supplied, use the input"," json_in;",""," if (isArray(results)) {"," // if no result fields are passed in, then just take"," // the results array whole-hog Sometimes you're getting"," // an array of strings, or want the whole object, so"," // resultFields don't make sense."," if (isArray(schema.resultFields)) {"," data_out = SchemaJSON._getFieldValues.call(this, schema.resultFields, results, data_out);"," } else {"," data_out.results = results;"," }"," } else if (schema.resultListLocator) {"," data_out.results = [];"," data_out.error = new Error(\"JSON results retrieval failure\");"," }",""," return data_out;"," },",""," /**"," * Get field data values out of list of full results"," *"," * @method _getFieldValues"," * @param fields {Array} Fields to find."," * @param array_in {Array} Results to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _getFieldValues: function(fields, array_in, data_out) {"," var results = [],"," len = fields.length,"," i, j,"," field, key, locator, path, parser, val,"," simplePaths = [], complexPaths = [], fieldParsers = [],"," result, record;",""," // First collect hashes of simple paths, complex paths, and parsers"," for (i=0; i<len; i++) {"," field = fields[i]; // A field can be a simple string or a hash"," key = field.key || field; // Find the key"," locator = field.locator || key; // Find the locator",""," // Validate and store locators for later"," path = SchemaJSON.getPath(locator);"," if (path) {"," if (path.length === 1) {"," simplePaths.push({"," key : key,"," path: path[0]"," });"," } else {"," complexPaths.push({"," key : key,"," path : path,"," locator: locator"," });"," }"," } else {"," }",""," // Validate and store parsers for later"," //TODO: use Y.DataSchema.parse?"," parser = (isFunction(field.parser)) ?"," field.parser :"," Y.Parsers[field.parser + ''];",""," if (parser) {"," fieldParsers.push({"," key : key,"," parser: parser"," });"," }"," }",""," // Traverse list of array_in, creating records of simple fields,"," // complex fields, and applying parsers as necessary"," for (i=array_in.length-1; i>=0; --i) {"," record = {};"," result = array_in[i];"," if(result) {"," // Cycle through complexLocators"," for (j=complexPaths.length - 1; j>=0; --j) {"," path = complexPaths[j];"," val = SchemaJSON.getLocationValue(path.path, result);"," if (val === undefined) {"," val = SchemaJSON.getLocationValue([path.locator], result);"," // Fail over keys like \"foo.bar\" from nested parsing"," // to single token parsing if a value is found in"," // results[\"foo.bar\"]"," if (val !== undefined) {"," simplePaths.push({"," key: path.key,"," path: path.locator"," });"," // Don't try to process the path as complex"," // for further results"," complexPaths.splice(i,1);"," continue;"," }"," }",""," record[path.key] = Base.parse.call(this,"," (SchemaJSON.getLocationValue(path.path, result)), path);"," }",""," // Cycle through simpleLocators"," for (j = simplePaths.length - 1; j >= 0; --j) {"," path = simplePaths[j];"," // Bug 1777850: The result might be an array instead of object"," record[path.key] = Base.parse.call(this,"," ((result[path.path] === undefined) ?"," result[j] : result[path.path]), path);"," }",""," // Cycle through fieldParsers"," for (j=fieldParsers.length-1; j>=0; --j) {"," key = fieldParsers[j].key;"," record[key] = fieldParsers[j].parser.call(this, record[key]);"," // Safety net"," if (record[key] === undefined) {"," record[key] = null;"," }"," }"," results[i] = record;"," }"," }"," data_out.results = results;"," return data_out;"," },",""," /**"," * Parses results data according to schema"," *"," * @method _parseMeta"," * @param metaFields {Object} Metafields definitions."," * @param json_in {Object} JSON to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Schema-parsed meta data."," * @static"," * @protected"," */"," _parseMeta: function(metaFields, json_in, data_out) {"," if (isObject(metaFields)) {"," var key, path;"," for(key in metaFields) {"," if (metaFields.hasOwnProperty(key)) {"," path = SchemaJSON.getPath(metaFields[key]);"," if (path && json_in) {"," data_out.meta[key] = SchemaJSON.getLocationValue(path, json_in);"," }"," }"," }"," }"," else {"," data_out.error = new Error(\"JSON meta data retrieval failure\");"," }"," return data_out;"," }","};","","// TODO: Y.Object + mix() might be better here","Y.DataSchema.JSON = Y.mix(SchemaJSON, Base);","","","}, '3.7.3', {\"requires\": [\"dataschema-base\", \"json\"]});"]; _yuitest_coverage["build/dataschema-json/dataschema-json.js"].lines = {"1":0,"19":0,"29":0,"45":0,"49":0,"54":0,"56":0,"58":0,"65":0,"66":0,"67":0,"68":0,"76":0,"89":0,"91":0,"92":0,"93":0,"95":0,"96":0,"99":0,"222":0,"226":0,"227":0,"228":0,"231":0,"232":0,"236":0,"238":0,"241":0,"242":0,"246":0,"249":0,"264":0,"274":0,"279":0,"280":0,"282":0,"284":0,"285":0,"286":0,"289":0,"304":0,"312":0,"313":0,"314":0,"315":0,"318":0,"319":0,"320":0,"321":0,"326":0,"337":0,"341":0,"342":0,"351":0,"352":0,"353":0,"354":0,"356":0,"357":0,"358":0,"359":0,"360":0,"364":0,"365":0,"371":0,"372":0,"376":0,"381":0,"382":0,"384":0,"390":0,"391":0,"392":0,"394":0,"395":0,"398":0,"401":0,"402":0,"417":0,"418":0,"419":0,"420":0,"421":0,"422":0,"423":0,"429":0,"431":0,"436":0}; _yuitest_coverage["build/dataschema-json/dataschema-json.js"].functions = {"(anonymous 2):56":0,"(anonymous 3):58":0,"getPath:44":0,"getLocationValue:88":0,"apply:221":0,"_parseResults:263":0,"_getFieldValues:303":0,"_parseMeta:416":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dataschema-json/dataschema-json.js"].coveredLines = 89;@@ -573,4 +573,4 @@ Y.DataSchema.JSON = Y.mix(SchemaJSON, Base); -}, '3.7.2', {"requires": ["dataschema-base", "json"]});+}, '3.7.3', {"requires": ["dataschema-base", "json"]});
bundle/dataschema-json/dataschema-json-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -446,4 +446,4 @@ Y.DataSchema.JSON = Y.mix(SchemaJSON, Base); -}, '3.7.2', {"requires": ["dataschema-base", "json"]});+}, '3.7.3', {"requires": ["dataschema-base", "json"]});
bundle/dataschema-json/dataschema-json-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-json",function(e,t){var n=e.Lang,r=n.isFunction,i=n.isObject,s=n.isArray,o=e.DataSchema.Base,u;u={getPath:function(e){var t=null,n=[],r=0;if(e){e=e.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(e,t,i){return n[r]=i,".@"+r++}).replace(/\[(\d+)\]/g,function(e,t){return n[r]=parseInt(t,10)|0,".@"+r++}).replace(/^\./,""),t=e.split(".");for(r=t.length-1;r>=0;--r)t[r].charAt(0)==="@"&&(t[r]=n[parseInt(t[r].substr(1),10)])}return t},getLocationValue:function(e,t){var n=0,r=e.length;for(;n<r;n++){if(!(i(t)&&e[n]in t)){t=undefined;break}t=t[e[n]]}return t},apply:function(t,n){var r=n,s={results:[],meta:{}};if(!i(n))try{r=e.JSON.parse(n)}catch(o){return s.error=o,s}return i(r)&&t?(s=u._parseResults.call(this,t,r,s),t.metaFields!==undefined&&(s=u._parseMeta(t.metaFields,r,s))):s.error=new Error("JSON schema parse failure"),s},_parseResults:function(e,t,n){var r=u.getPath,i=u.getLocationValue,o=r(e.resultListLocator),a=o?i(o,t)||t[e.resultListLocator]:t;return s(a)?s(e.resultFields)?n=u._getFieldValues.call(this,e.resultFields,a,n):n.results=a:e.resultListLocator&&(n.results=[],n.error=new Error("JSON results retrieval failure")),n},_getFieldValues:function(t,n,i){var s=[],a=t.length,f,l,c,h,p,d,v,m,g=[],y=[],b=[],w,E;for(f=0;f<a;f++)c=t[f],h=c.key||c,p=c.locator||h,d=u.getPath(p),d&&(d.length===1?g.push({key:h,path:d[0]}):y.push({key:h,path:d,locator:p})),v=r(c.parser)?c.parser:e.Parsers[c.parser+""],v&&b.push({key:h,parser:v});for(f=n.length-1;f>=0;--f){E={},w=n[f];if(w){for(l=y.length-1;l>=0;--l){d=y[l],m=u.getLocationValue(d.path,w);if(m===undefined){m=u.getLocationValue([d.locator],w);if(m!==undefined){g.push({key:d.key,path:d.locator}),y.splice(f,1);continue}}E[d.key]=o.parse.call(this,u.getLocationValue(d.path,w),d)}for(l=g.length-1;l>=0;--l)d=g[l],E[d.key]=o.parse.call(this,w[d.path]===undefined?w[l]:w[d.path],d);for(l=b.length-1;l>=0;--l)h=b[l].key,E[h]=b[l].parser.call(this,E[h]),E[h]===undefined&&(E[h]=null);s[f]=E}}return i.results=s,i},_parseMeta:function(e,t,n){if(i(e)){var r,s;for(r in e)e.hasOwnProperty(r)&&(s=u.getPath(e[r]),s&&t&&(n.meta[r]=u.getLocationValue(s,t)))}else n.error=new Error("JSON meta data retrieval failure");return n}},e.DataSchema.JSON=e.mix(u,o)},"3.7.2",{requires:["dataschema-base","json"]});+YUI.add("dataschema-json",function(e,t){var n=e.Lang,r=n.isFunction,i=n.isObject,s=n.isArray,o=e.DataSchema.Base,u;u={getPath:function(e){var t=null,n=[],r=0;if(e){e=e.replace(/\[\s*(['"])(.*?)\1\s*\]/g,function(e,t,i){return n[r]=i,".@"+r++}).replace(/\[(\d+)\]/g,function(e,t){return n[r]=parseInt(t,10)|0,".@"+r++}).replace(/^\./,""),t=e.split(".");for(r=t.length-1;r>=0;--r)t[r].charAt(0)==="@"&&(t[r]=n[parseInt(t[r].substr(1),10)])}return t},getLocationValue:function(e,t){var n=0,r=e.length;for(;n<r;n++){if(!(i(t)&&e[n]in t)){t=undefined;break}t=t[e[n]]}return t},apply:function(t,n){var r=n,s={results:[],meta:{}};if(!i(n))try{r=e.JSON.parse(n)}catch(o){return s.error=o,s}return i(r)&&t?(s=u._parseResults.call(this,t,r,s),t.metaFields!==undefined&&(s=u._parseMeta(t.metaFields,r,s))):s.error=new Error("JSON schema parse failure"),s},_parseResults:function(e,t,n){var r=u.getPath,i=u.getLocationValue,o=r(e.resultListLocator),a=o?i(o,t)||t[e.resultListLocator]:t;return s(a)?s(e.resultFields)?n=u._getFieldValues.call(this,e.resultFields,a,n):n.results=a:e.resultListLocator&&(n.results=[],n.error=new Error("JSON results retrieval failure")),n},_getFieldValues:function(t,n,i){var s=[],a=t.length,f,l,c,h,p,d,v,m,g=[],y=[],b=[],w,E;for(f=0;f<a;f++)c=t[f],h=c.key||c,p=c.locator||h,d=u.getPath(p),d&&(d.length===1?g.push({key:h,path:d[0]}):y.push({key:h,path:d,locator:p})),v=r(c.parser)?c.parser:e.Parsers[c.parser+""],v&&b.push({key:h,parser:v});for(f=n.length-1;f>=0;--f){E={},w=n[f];if(w){for(l=y.length-1;l>=0;--l){d=y[l],m=u.getLocationValue(d.path,w);if(m===undefined){m=u.getLocationValue([d.locator],w);if(m!==undefined){g.push({key:d.key,path:d.locator}),y.splice(f,1);continue}}E[d.key]=o.parse.call(this,u.getLocationValue(d.path,w),d)}for(l=g.length-1;l>=0;--l)d=g[l],E[d.key]=o.parse.call(this,w[d.path]===undefined?w[l]:w[d.path],d);for(l=b.length-1;l>=0;--l)h=b[l].key,E[h]=b[l].parser.call(this,E[h]),E[h]===undefined&&(E[h]=null);s[f]=E}}return i.results=s,i},_parseMeta:function(e,t,n){if(i(e)){var r,s;for(r in e)e.hasOwnProperty(r)&&(s=u.getPath(e[r]),s&&t&&(n.meta[r]=u.getLocationValue(s,t)))}else n.error=new Error("JSON meta data retrieval failure");return n}},e.DataSchema.JSON=e.mix(u,o)},"3.7.3",{requires:["dataschema-base","json"]});
bundle/dataschema-json/dataschema-json.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -442,4 +442,4 @@ Y.DataSchema.JSON = Y.mix(SchemaJSON, Base); -}, '3.7.2', {"requires": ["dataschema-base", "json"]});+}, '3.7.3', {"requires": ["dataschema-base", "json"]});
bundle/dataschema-text/dataschema-text-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dataschema-text/dataschema-text.js", code: [] };-_yuitest_coverage["build/dataschema-text/dataschema-text.js"].code=["YUI.add('dataschema-text', function (Y, NAME) {","","/**"," * Provides a DataSchema implementation which can be used to work with"," * delimited text data."," *"," * @module dataschema"," * @submodule dataschema-text"," */","","/**","Provides a DataSchema implementation which can be used to work with","delimited text data.","","See the `apply` method for usage.","","@class DataSchema.Text","@extends DataSchema.Base","@static","**/","","var Lang = Y.Lang,"," isString = Lang.isString,"," isUndef = Lang.isUndefined,",""," SchemaText = {",""," ////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.Text static methods"," //"," ////////////////////////////////////////////////////////////////////////"," /**"," Applies a schema to a string of delimited data, returning a normalized"," object with results in the `results` property. The `meta` property of"," the response object is present for consistency, but is assigned an"," empty object. If the input data is absent or not a string, an `error`"," property will be added.",""," Use _schema.resultDelimiter_ and _schema.fieldDelimiter_ to instruct"," `apply` how to split up the string into an array of data arrays for"," processing.",""," Use _schema.resultFields_ to specify the keys in the generated result"," objects in `response.results`. The key:value pairs will be assigned"," in the order of the _schema.resultFields_ array, assuming the values"," in the data records are defined in the same order.",""," _schema.resultFields_ field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The property name you want"," the data value assigned to in the result object (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use just the desired property"," name string as the field identifier instead of an object (see example"," below).",""," @example"," // Process simple csv"," var schema = {"," resultDelimiter: \"\\n\","," fieldDelimiter: \",\","," resultFields: [ 'fruit', 'color' ]"," },"," data = \"Banana,yellow\\nOrange,orange\\nEggplant,purple\";",""," var response = Y.DataSchema.Text.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'fruit',"," parser: function (val) { return val.toUpperCase(); }"," },"," 'color' // mix and match objects and strings"," ];",""," response = Y.DataSchema.Text.apply(schema, data);",""," // response.results[0] is { fruit: \"BANANA\", color: \"yellow\" }"," "," @method apply"," @param {Object} schema Schema to apply. Supported configuration"," properties are:"," @param {String} schema.resultDelimiter Character or character"," sequence that marks the end of one record and the start of"," another."," @param {String} [schema.fieldDelimiter] Character or character"," sequence that marks the end of a field and the start of"," another within the same record."," @param {Array} [schema.resultFields] Field identifiers to"," assign values in the response records. See above for details."," @param {String} data Text data."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," if (isString(data) && schema && isString(schema.resultDelimiter)) {"," // Parse results data"," data_out = SchemaText._parseResults.call(this, schema, data_in, data_out);"," } else {"," data_out.error = new Error(\"Text schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Array} Schema to parse against."," * @param text_in {String} Text to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, text_in, data_out) {"," var resultDelim = schema.resultDelimiter,"," fieldDelim = isString(schema.fieldDelimiter) &&"," schema.fieldDelimiter,"," fields = schema.resultFields || [],"," results = [],"," parse = Y.DataSchema.Base.parse,"," results_in, fields_in, result, item,"," field, key, value, i, j;",""," // Delete final delimiter at end of string if there"," if (text_in.slice(-resultDelim.length) === resultDelim) {"," text_in = text_in.slice(0, -resultDelim.length);"," }",""," // Split into results"," results_in = text_in.split(schema.resultDelimiter);",""," if (fieldDelim) {"," for (i = results_in.length - 1; i >= 0; --i) {"," result = {};"," item = results_in[i];",""," fields_in = item.split(schema.fieldDelimiter);",""," for (j = fields.length - 1; j >= 0; --j) {"," field = fields[j];"," key = (!isUndef(field.key)) ? field.key : field;"," // FIXME: unless the key is an array index, this test"," // for fields_in[key] is useless."," value = (!isUndef(fields_in[key])) ?"," fields_in[key] :"," fields_in[j];",""," result[key] = parse.call(this, value, field);"," }",""," results[i] = result;"," }"," } else {"," results = results_in;"," }",""," data_out.results = results;",""," return data_out;"," }"," };","","Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base);","","","}, '3.7.2', {\"requires\": [\"dataschema-base\"]});"];+_yuitest_coverage["build/dataschema-text/dataschema-text.js"].code=["YUI.add('dataschema-text', function (Y, NAME) {","","/**"," * Provides a DataSchema implementation which can be used to work with"," * delimited text data."," *"," * @module dataschema"," * @submodule dataschema-text"," */","","/**","Provides a DataSchema implementation which can be used to work with","delimited text data.","","See the `apply` method for usage.","","@class DataSchema.Text","@extends DataSchema.Base","@static","**/","","var Lang = Y.Lang,"," isString = Lang.isString,"," isUndef = Lang.isUndefined,",""," SchemaText = {",""," ////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.Text static methods"," //"," ////////////////////////////////////////////////////////////////////////"," /**"," Applies a schema to a string of delimited data, returning a normalized"," object with results in the `results` property. The `meta` property of"," the response object is present for consistency, but is assigned an"," empty object. If the input data is absent or not a string, an `error`"," property will be added.",""," Use _schema.resultDelimiter_ and _schema.fieldDelimiter_ to instruct"," `apply` how to split up the string into an array of data arrays for"," processing.",""," Use _schema.resultFields_ to specify the keys in the generated result"," objects in `response.results`. The key:value pairs will be assigned"," in the order of the _schema.resultFields_ array, assuming the values"," in the data records are defined in the same order.",""," _schema.resultFields_ field identifiers are objects with the following"," properties:",""," * `key` : <strong>(required)</strong> The property name you want"," the data value assigned to in the result object (String)"," * `parser`: A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value.",""," If no value parsing is needed, you can use just the desired property"," name string as the field identifier instead of an object (see example"," below).",""," @example"," // Process simple csv"," var schema = {"," resultDelimiter: \"\\n\","," fieldDelimiter: \",\","," resultFields: [ 'fruit', 'color' ]"," },"," data = \"Banana,yellow\\nOrange,orange\\nEggplant,purple\";",""," var response = Y.DataSchema.Text.apply(schema, data);",""," // response.results[0] is { fruit: \"Banana\", color: \"yellow\" }","",""," // Use parsers"," schema.resultFields = ["," {"," key: 'fruit',"," parser: function (val) { return val.toUpperCase(); }"," },"," 'color' // mix and match objects and strings"," ];",""," response = Y.DataSchema.Text.apply(schema, data);",""," // response.results[0] is { fruit: \"BANANA\", color: \"yellow\" }"," "," @method apply"," @param {Object} schema Schema to apply. Supported configuration"," properties are:"," @param {String} schema.resultDelimiter Character or character"," sequence that marks the end of one record and the start of"," another."," @param {String} [schema.fieldDelimiter] Character or character"," sequence that marks the end of a field and the start of"," another within the same record."," @param {Array} [schema.resultFields] Field identifiers to"," assign values in the response records. See above for details."," @param {String} data Text data."," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var data_in = data,"," data_out = { results: [], meta: {} };",""," if (isString(data) && schema && isString(schema.resultDelimiter)) {"," // Parse results data"," data_out = SchemaText._parseResults.call(this, schema, data_in, data_out);"," } else {"," data_out.error = new Error(\"Text schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Array} Schema to parse against."," * @param text_in {String} Text to parse."," * @param data_out {Object} In-progress parsed data to update."," * @return {Object} Parsed data object."," * @static"," * @protected"," */"," _parseResults: function(schema, text_in, data_out) {"," var resultDelim = schema.resultDelimiter,"," fieldDelim = isString(schema.fieldDelimiter) &&"," schema.fieldDelimiter,"," fields = schema.resultFields || [],"," results = [],"," parse = Y.DataSchema.Base.parse,"," results_in, fields_in, result, item,"," field, key, value, i, j;",""," // Delete final delimiter at end of string if there"," if (text_in.slice(-resultDelim.length) === resultDelim) {"," text_in = text_in.slice(0, -resultDelim.length);"," }",""," // Split into results"," results_in = text_in.split(schema.resultDelimiter);",""," if (fieldDelim) {"," for (i = results_in.length - 1; i >= 0; --i) {"," result = {};"," item = results_in[i];",""," fields_in = item.split(schema.fieldDelimiter);",""," for (j = fields.length - 1; j >= 0; --j) {"," field = fields[j];"," key = (!isUndef(field.key)) ? field.key : field;"," // FIXME: unless the key is an array index, this test"," // for fields_in[key] is useless."," value = (!isUndef(fields_in[key])) ?"," fields_in[key] :"," fields_in[j];",""," result[key] = parse.call(this, value, field);"," }",""," results[i] = result;"," }"," } else {"," results = results_in;"," }",""," data_out.results = results;",""," return data_out;"," }"," };","","Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base);","","","}, '3.7.3', {\"requires\": [\"dataschema-base\"]});"]; _yuitest_coverage["build/dataschema-text/dataschema-text.js"].lines = {"1":0,"22":0,"106":0,"109":0,"111":0,"113":0,"116":0,"131":0,"141":0,"142":0,"146":0,"148":0,"149":0,"150":0,"151":0,"153":0,"155":0,"156":0,"157":0,"160":0,"164":0,"167":0,"170":0,"173":0,"175":0,"179":0}; _yuitest_coverage["build/dataschema-text/dataschema-text.js"].functions = {"apply:105":0,"_parseResults:130":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dataschema-text/dataschema-text.js"].coveredLines = 26;@@ -247,4 +247,4 @@ Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-text/dataschema-text-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -186,4 +186,4 @@ Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-text/dataschema-text-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-text",function(e,t){var n=e.Lang,r=n.isString,i=n.isUndefined,s={apply:function(e,t){var n=t,i={results:[],meta:{}};return r(t)&&e&&r(e.resultDelimiter)?i=s._parseResults.call(this,e,n,i):i.error=new Error("Text schema parse failure"),i},_parseResults:function(t,n,s){var o=t.resultDelimiter,u=r(t.fieldDelimiter)&&t.fieldDelimiter,a=t.resultFields||[],f=[],l=e.DataSchema.Base.parse,c,h,p,d,v,m,g,y,b;n.slice(-o.length)===o&&(n=n.slice(0,-o.length)),c=n.split(t.resultDelimiter);if(u)for(y=c.length-1;y>=0;--y){p={},d=c[y],h=d.split(t.fieldDelimiter);for(b=a.length-1;b>=0;--b)v=a[b],m=i(v.key)?v:v.key,g=i(h[m])?h[b]:h[m],p[m]=l.call(this,g,v);f[y]=p}else f=c;return s.results=f,s}};e.DataSchema.Text=e.mix(s,e.DataSchema.Base)},"3.7.2",{requires:["dataschema-base"]});+YUI.add("dataschema-text",function(e,t){var n=e.Lang,r=n.isString,i=n.isUndefined,s={apply:function(e,t){var n=t,i={results:[],meta:{}};return r(t)&&e&&r(e.resultDelimiter)?i=s._parseResults.call(this,e,n,i):i.error=new Error("Text schema parse failure"),i},_parseResults:function(t,n,s){var o=t.resultDelimiter,u=r(t.fieldDelimiter)&&t.fieldDelimiter,a=t.resultFields||[],f=[],l=e.DataSchema.Base.parse,c,h,p,d,v,m,g,y,b;n.slice(-o.length)===o&&(n=n.slice(0,-o.length)),c=n.split(t.resultDelimiter);if(u)for(y=c.length-1;y>=0;--y){p={},d=c[y],h=d.split(t.fieldDelimiter);for(b=a.length-1;b>=0;--b)v=a[b],m=i(v.key)?v:v.key,g=i(h[m])?h[b]:h[m],p[m]=l.call(this,g,v);f[y]=p}else f=c;return s.results=f,s}};e.DataSchema.Text=e.mix(s,e.DataSchema.Base)},"3.7.3",{requires:["dataschema-base"]});
bundle/dataschema-text/dataschema-text.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -185,4 +185,4 @@ Y.DataSchema.Text = Y.mix(SchemaText, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-xml/dataschema-xml-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/dataschema-xml/dataschema-xml.js", code: [] };-_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].code=["YUI.add('dataschema-xml', function (Y, NAME) {","","/**","Provides a DataSchema implementation which can be used to work with XML data.","","@module dataschema","@submodule dataschema-xml","**/","","/**","Provides a DataSchema implementation which can be used to work with XML data.","","See the `apply` method for usage.","","@class DataSchema.XML","@extends DataSchema.Base","@static","**/","var Lang = Y.Lang,",""," okNodeType = {"," 1 : true,"," 9 : true,"," 11: true"," },",""," SchemaXML;","","SchemaXML = {",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.XML static methods"," //"," ////////////////////////////////////////////////////////////////////////////"," /**"," Applies a schema to an XML data tree, returning a normalized object with"," results in the `results` property. Additional information can be parsed out"," of the XML for inclusion in the `meta` property of the response object. If"," an error is encountered during processing, an `error` property will be"," added.",""," Field data in the nodes captured by the XPath in _schema.resultListLocator_"," is extracted with the field identifiers described in _schema.resultFields_."," Field identifiers are objects with the following properties:",""," * `key` : <strong>(required)</strong> The desired property name to use"," store the retrieved value in the result object. If `locator` is"," not specified, `key` is also used as the XPath locator (String)"," * `locator`: The XPath locator to the node or attribute within each"," result node found by _schema.resultListLocator_ containing the"," desired field data (String)"," * `parser` : A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value."," * `schema` : Used to retrieve nested field data into an array for"," assignment as the result field value. This object follows the same"," conventions as _schema_.",""," If no value parsing or nested parsing is needed, you can use XPath locators"," (strings) instead of field identifiers (objects) -- see example below.",""," `response.results` will contain an array of objects with key:value pairs."," The keys are the field identifier `key`s, and the values are the data"," values extracted from the nodes or attributes found by the field `locator`"," (or `key` fallback)."," "," To extract additional information from the XML, include an array of"," XPath locators in _schema.metaFields_. The collected values will be"," stored in `response.meta` with the XPath locator as keys.",""," @example"," var schema = {"," resultListLocator: '//produce/item',"," resultFields: ["," {"," locator: 'name',"," key: 'name'"," },"," {"," locator: 'color',"," key: 'color',"," parser: function (val) { return val.toUpperCase(); }"," }"," ]"," };",""," // Assumes data like"," // <inventory>"," // <produce>"," // <item><name>Banana</name><color>yellow</color></item>"," // <item><name>Orange</name><color>orange</color></item>"," // <item><name>Eggplant</name><color>purple</color></item>"," // </produce>"," // </inventory>",""," var response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"YELLOW\" }"," "," @method apply"," @param {Object} schema Schema to apply. Supported configuration"," properties are:"," @param {String} [schema.resultListLocator] XPath locator for the"," XML nodes that contain the data to flatten into `response.results`"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} [schema.metaFields] XPath locators to extract extra"," non-record related information from the XML data"," @param {XMLDoc} data XML data to parse"," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var xmldoc = data, // unnecessary variables"," data_out = { results: [], meta: {} };",""," if (xmldoc && okNodeType[xmldoc.nodeType] && schema) {"," // Parse results data"," data_out = SchemaXML._parseResults(schema, xmldoc, data_out);",""," // Parse meta data"," data_out = SchemaXML._parseMeta(schema.metaFields, xmldoc, data_out);"," } else {"," data_out.error = new Error(\"XML schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Get an XPath-specified value for a given field from an XML node or document."," *"," * @method _getLocationValue"," * @param field {String | Object} Field definition."," * @param context {Object} XML node or document to search within."," * @return {Object} Data value or null."," * @static"," * @protected"," */"," _getLocationValue: function(field, context) {"," var locator = field.locator || field.key || field,"," xmldoc = context.ownerDocument || context,"," result, res, value = null;",""," try {"," result = SchemaXML._getXPathResult(locator, context, xmldoc);"," while ((res = result.iterateNext())) {"," value = res.textContent || res.value || res.text || res.innerHTML || null;"," }",""," // FIXME: Why defer to a method that is mixed into this object?"," // DSchema.Base is mixed into DSchema.XML (et al), so"," // DSchema.XML.parse(...) will work. This supports the use case"," // where DSchema.Base.parse is changed, and that change is then"," // seen by all DSchema.* implementations, but does not support the"," // case where redefining DSchema.XML.parse changes behavior. In"," // fact, DSchema.XML.parse is never even called."," return Y.DataSchema.Base.parse.call(this, value, field);"," } catch (e) {"," }",""," return null;"," },",""," /**"," * Fetches the XPath-specified result for a given location in an XML node"," * or document."," * "," * @method _getXPathResult"," * @param locator {String} The XPath location."," * @param context {Object} XML node or document to search within."," * @param xmldoc {Object} XML document to resolve namespace."," * @return {Object} Data collection or null."," * @static"," * @protected"," */"," _getXPathResult: function(locator, context, xmldoc) {"," // Standards mode"," if (! Lang.isUndefined(xmldoc.evaluate)) {"," return xmldoc.evaluate(locator, context, xmldoc.createNSResolver(context.ownerDocument ? context.ownerDocument.documentElement : context.documentElement), 0, null);"," }"," // IE mode"," else {"," var values=[], locatorArray = locator.split(/\\b\\/\\b/), i=0, l=locatorArray.length, location, subloc, m, isNth;"," "," // XPath is supported"," try {"," // this fixes the IE 5.5+ issue where childnode selectors begin at 0 instead of 1"," xmldoc.setProperty(\"SelectionLanguage\", \"XPath\");"," values = context.selectNodes(locator);"," }"," // Fallback for DOM nodes and fragments"," catch (e) {"," // Iterate over each locator piece"," for (; i<l && context; i++) {"," location = locatorArray[i];",""," // grab nth child []"," if ((location.indexOf(\"[\") > -1) && (location.indexOf(\"]\") > -1)) {"," subloc = location.slice(location.indexOf(\"[\")+1, location.indexOf(\"]\"));"," //XPath is 1-based while DOM is 0-based"," subloc--;"," context = context.children[subloc];"," isNth = true;"," }"," // grab attribute value @"," else if (location.indexOf(\"@\") > -1) {"," subloc = location.substr(location.indexOf(\"@\"));"," context = subloc ? context.getAttribute(subloc.replace('@', '')) : context;"," }"," // grab that last instance of tagName"," else if (-1 < location.indexOf(\"//\")) {"," subloc = context.getElementsByTagName(location.substr(2));"," context = subloc.length ? subloc[subloc.length - 1] : null;"," }"," // find the last matching location in children"," else if (l != i + 1) {"," for (m=context.childNodes.length-1; 0 <= m; m-=1) {"," if (location === context.childNodes[m].tagName) {"," context = context.childNodes[m];"," m = -1;"," }"," }"," }"," }"," "," if (context) {"," // attribute"," if (Lang.isString(context)) {"," values[0] = {value: context};"," }"," // nth child"," else if (isNth) {"," values[0] = {value: context.innerHTML};"," }"," // all children"," else {"," values = Y.Array(context.childNodes, 0, true);"," }"," }"," }",""," // returning a mock-standard object for IE"," return {"," index: 0,"," "," iterateNext: function() {"," if (this.index >= this.values.length) {return undefined;}"," var result = this.values[this.index];"," this.index += 1;"," return result;"," },",""," values: values"," };"," }"," },",""," /**"," * Schema-parsed result field."," *"," * @method _parseField"," * @param field {String | Object} Required. Field definition."," * @param result {Object} Required. Schema parsed data object."," * @param context {Object} Required. XML node or document to search within."," * @static"," * @protected"," */"," _parseField: function(field, result, context) {"," var key = field.key || field,"," parsed;",""," if (field.schema) {"," parsed = { results: [], meta: {} };"," parsed = SchemaXML._parseResults(field.schema, context, parsed);",""," result[key] = parsed.results;"," } else {"," result[key] = SchemaXML._getLocationValue(field, context);"," }"," },",""," /**"," * Parses results data according to schema"," *"," * @method _parseMeta"," * @param xmldoc_in {Object} XML document parse."," * @param data_out {Object} In-progress schema-parsed data to update."," * @return {Object} Schema-parsed data."," * @static"," * @protected"," */"," _parseMeta: function(metaFields, xmldoc_in, data_out) {"," if(Lang.isObject(metaFields)) {"," var key,"," xmldoc = xmldoc_in.ownerDocument || xmldoc_in;",""," for(key in metaFields) {"," if (metaFields.hasOwnProperty(key)) {"," data_out.meta[key] = SchemaXML._getLocationValue(metaFields[key], xmldoc);"," }"," }"," }"," return data_out;"," },",""," /**"," * Schema-parsed result to add to results list."," *"," * @method _parseResult"," * @param fields {Array} Required. A collection of field definition."," * @param context {Object} Required. XML node or document to search within."," * @return {Object} Schema-parsed data."," * @static"," * @protected"," */"," _parseResult: function(fields, context) {"," var result = {}, j;",""," // Find each field value"," for (j=fields.length-1; 0 <= j; j--) {"," SchemaXML._parseField(fields[j], result, context);"," }",""," return result;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Object} Schema to parse against."," * @param context {Object} XML node or document to parse."," * @param data_out {Object} In-progress schema-parsed data to update."," * @return {Object} Schema-parsed data."," * @static"," * @protected"," */"," _parseResults: function(schema, context, data_out) {"," if (schema.resultListLocator && Lang.isArray(schema.resultFields)) {"," var xmldoc = context.ownerDocument || context,"," fields = schema.resultFields,"," results = [],"," node, nodeList, i=0;",""," if (schema.resultListLocator.match(/^[:\\-\\w]+$/)) {"," nodeList = context.getElementsByTagName(schema.resultListLocator);"," "," // loop through each result node"," for (i = nodeList.length - 1; i >= 0; --i) {"," results[i] = SchemaXML._parseResult(fields, nodeList[i]);"," }"," } else {"," nodeList = SchemaXML._getXPathResult(schema.resultListLocator, context, xmldoc);",""," // loop through the nodelist"," while ((node = nodeList.iterateNext())) {"," results[i] = SchemaXML._parseResult(fields, node);"," i += 1;"," }"," }",""," if (results.length) {"," data_out.results = results;"," } else {"," data_out.error = new Error(\"XML schema result nodes retrieval failure\");"," }"," }"," return data_out;"," }","};","","Y.DataSchema.XML = Y.mix(SchemaXML, Y.DataSchema.Base);","","","}, '3.7.2', {\"requires\": [\"dataschema-base\"]});"];-_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].lines = {"1":0,"19":0,"29":0,"117":0,"120":0,"122":0,"125":0,"127":0,"130":0,"144":0,"148":0,"149":0,"150":0,"151":0,"161":0,"165":0,"182":0,"183":0,"187":0,"190":0,"192":0,"193":0,"198":0,"199":0,"202":0,"203":0,"205":0,"206":0,"207":0,"210":0,"211":0,"212":0,"215":0,"216":0,"217":0,"220":0,"221":0,"222":0,"223":0,"224":0,"230":0,"232":0,"233":0,"236":0,"237":0,"241":0,"247":0,"251":0,"252":0,"253":0,"254":0,"273":0,"276":0,"277":0,"278":0,"280":0,"282":0,"297":0,"298":0,"301":0,"302":0,"303":0,"307":0,"321":0,"324":0,"325":0,"328":0,"343":0,"344":0,"349":0,"350":0,"353":0,"354":0,"357":0,"360":0,"361":0,"362":0,"366":0,"367":0,"369":0,"372":0,"376":0};-_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].functions = {"apply:116":0,"_getLocationValue:143":0,"iterateNext:250":0,"_getXPathResult:180":0,"_parseField:272":0,"_parseMeta:296":0,"_parseResult:320":0,"_parseResults:342":0,"(anonymous 1):1":0};-_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].coveredLines = 82;+_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].code=["YUI.add('dataschema-xml', function (Y, NAME) {","","/**","Provides a DataSchema implementation which can be used to work with XML data.","","@module dataschema","@submodule dataschema-xml","**/","","/**","Provides a DataSchema implementation which can be used to work with XML data.","","See the `apply` method for usage.","","@class DataSchema.XML","@extends DataSchema.Base","@static","**/","var Lang = Y.Lang,",""," okNodeType = {"," 1 : true,"," 9 : true,"," 11: true"," },",""," SchemaXML;","","SchemaXML = {",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DataSchema.XML static methods"," //"," ////////////////////////////////////////////////////////////////////////////"," /**"," Applies a schema to an XML data tree, returning a normalized object with"," results in the `results` property. Additional information can be parsed out"," of the XML for inclusion in the `meta` property of the response object. If"," an error is encountered during processing, an `error` property will be"," added.",""," Field data in the nodes captured by the XPath in _schema.resultListLocator_"," is extracted with the field identifiers described in _schema.resultFields_."," Field identifiers are objects with the following properties:",""," * `key` : <strong>(required)</strong> The desired property name to use"," store the retrieved value in the result object. If `locator` is"," not specified, `key` is also used as the XPath locator (String)"," * `locator`: The XPath locator to the node or attribute within each"," result node found by _schema.resultListLocator_ containing the"," desired field data (String)"," * `parser` : A function or the name of a function on `Y.Parsers` used"," to convert the input value into a normalized type. Parser"," functions are passed the value as input and are expected to"," return a value."," * `schema` : Used to retrieve nested field data into an array for"," assignment as the result field value. This object follows the same"," conventions as _schema_.",""," If no value parsing or nested parsing is needed, you can use XPath locators"," (strings) instead of field identifiers (objects) -- see example below.",""," `response.results` will contain an array of objects with key:value pairs."," The keys are the field identifier `key`s, and the values are the data"," values extracted from the nodes or attributes found by the field `locator`"," (or `key` fallback)."," "," To extract additional information from the XML, include an array of"," XPath locators in _schema.metaFields_. The collected values will be"," stored in `response.meta` with the XPath locator as keys.",""," @example"," var schema = {"," resultListLocator: '//produce/item',"," resultFields: ["," {"," locator: 'name',"," key: 'name'"," },"," {"," locator: 'color',"," key: 'color',"," parser: function (val) { return val.toUpperCase(); }"," }"," ]"," };",""," // Assumes data like"," // <inventory>"," // <produce>"," // <item><name>Banana</name><color>yellow</color></item>"," // <item><name>Orange</name><color>orange</color></item>"," // <item><name>Eggplant</name><color>purple</color></item>"," // </produce>"," // </inventory>",""," var response = Y.DataSchema.JSON.apply(schema, data);",""," // response.results[0] is { name: \"Banana\", color: \"YELLOW\" }"," "," @method apply"," @param {Object} schema Schema to apply. Supported configuration"," properties are:"," @param {String} [schema.resultListLocator] XPath locator for the"," XML nodes that contain the data to flatten into `response.results`"," @param {Array} [schema.resultFields] Field identifiers to"," locate/assign values in the response records. See above for"," details."," @param {Array} [schema.metaFields] XPath locators to extract extra"," non-record related information from the XML data"," @param {XMLDoc} data XML data to parse"," @return {Object} An Object with properties `results` and `meta`"," @static"," **/"," apply: function(schema, data) {"," var xmldoc = data, // unnecessary variables"," data_out = { results: [], meta: {} };",""," if (xmldoc && okNodeType[xmldoc.nodeType] && schema) {"," // Parse results data"," data_out = SchemaXML._parseResults(schema, xmldoc, data_out);",""," // Parse meta data"," data_out = SchemaXML._parseMeta(schema.metaFields, xmldoc, data_out);"," } else {"," data_out.error = new Error(\"XML schema parse failure\");"," }",""," return data_out;"," },",""," /**"," * Get an XPath-specified value for a given field from an XML node or document."," *"," * @method _getLocationValue"," * @param field {String | Object} Field definition."," * @param context {Object} XML node or document to search within."," * @return {Object} Data value or null."," * @static"," * @protected"," */"," _getLocationValue: function(field, context) {"," var locator = field.locator || field.key || field,"," xmldoc = context.ownerDocument || context,"," result, res, value = null;",""," try {"," result = SchemaXML._getXPathResult(locator, context, xmldoc);"," while ((res = result.iterateNext())) {"," value = res.textContent || res.value || res.text || res.innerHTML || res.innerText || null;"," }",""," // FIXME: Why defer to a method that is mixed into this object?"," // DSchema.Base is mixed into DSchema.XML (et al), so"," // DSchema.XML.parse(...) will work. This supports the use case"," // where DSchema.Base.parse is changed, and that change is then"," // seen by all DSchema.* implementations, but does not support the"," // case where redefining DSchema.XML.parse changes behavior. In"," // fact, DSchema.XML.parse is never even called."," return Y.DataSchema.Base.parse.call(this, value, field);"," } catch (e) {"," }",""," return null;"," },",""," /**"," * Fetches the XPath-specified result for a given location in an XML node"," * or document."," * "," * @method _getXPathResult"," * @param locator {String} The XPath location."," * @param context {Object} XML node or document to search within."," * @param xmldoc {Object} XML document to resolve namespace."," * @return {Object} Data collection or null."," * @static"," * @protected"," */"," _getXPathResult: function(locator, context, xmldoc) {"," // Standards mode"," if (! Lang.isUndefined(xmldoc.evaluate)) {"," return xmldoc.evaluate(locator, context, xmldoc.createNSResolver(context.ownerDocument ? context.ownerDocument.documentElement : context.documentElement), 0, null);"," "," }"," // IE mode"," else {"," var values=[], locatorArray = locator.split(/\\b\\/\\b/), i=0, l=locatorArray.length, location, subloc, m, isNth;"," "," // XPath is supported"," try {"," // this fixes the IE 5.5+ issue where childnode selectors begin at 0 instead of 1"," try {"," xmldoc.setProperty(\"SelectionLanguage\", \"XPath\");"," } catch (e) {}"," "," values = context.selectNodes(locator);"," }"," // Fallback for DOM nodes and fragments"," catch (e) {"," // Iterate over each locator piece"," for (; i<l && context; i++) {"," location = locatorArray[i];",""," // grab nth child []"," if ((location.indexOf(\"[\") > -1) && (location.indexOf(\"]\") > -1)) {"," subloc = location.slice(location.indexOf(\"[\")+1, location.indexOf(\"]\"));"," //XPath is 1-based while DOM is 0-based"," subloc--;"," context = context.children[subloc];"," isNth = true;"," }"," // grab attribute value @"," else if (location.indexOf(\"@\") > -1) {"," subloc = location.substr(location.indexOf(\"@\"));"," context = subloc ? context.getAttribute(subloc.replace('@', '')) : context;"," }"," // grab that last instance of tagName"," else if (-1 < location.indexOf(\"//\")) {"," subloc = context.getElementsByTagName(location.substr(2));"," context = subloc.length ? subloc[subloc.length - 1] : null;"," }"," // find the last matching location in children"," else if (l != i + 1) {"," for (m=context.childNodes.length-1; 0 <= m; m-=1) {"," if (location === context.childNodes[m].tagName) {"," context = context.childNodes[m];"," m = -1;"," }"," }"," }"," }"," "," if (context) {"," // attribute"," if (Lang.isString(context)) {"," values[0] = {value: context};"," }"," // nth child"," else if (isNth) {"," values[0] = {value: context.innerHTML};"," }"," // all children"," else {"," values = Y.Array(context.childNodes, 0, true);"," }"," }"," }",""," // returning a mock-standard object for IE"," return {"," index: 0,"," "," iterateNext: function() {"," if (this.index >= this.values.length) {return undefined;}"," var result = this.values[this.index];"," this.index += 1;"," return result;"," },",""," values: values"," };"," }"," },",""," /**"," * Schema-parsed result field."," *"," * @method _parseField"," * @param field {String | Object} Required. Field definition."," * @param result {Object} Required. Schema parsed data object."," * @param context {Object} Required. XML node or document to search within."," * @static"," * @protected"," */"," _parseField: function(field, result, context) {"," var key = field.key || field,"," parsed;",""," if (field.schema) {"," parsed = { results: [], meta: {} };"," parsed = SchemaXML._parseResults(field.schema, context, parsed);",""," result[key] = parsed.results;"," } else {"," result[key] = SchemaXML._getLocationValue(field, context);"," }"," },",""," /**"," * Parses results data according to schema"," *"," * @method _parseMeta"," * @param xmldoc_in {Object} XML document parse."," * @param data_out {Object} In-progress schema-parsed data to update."," * @return {Object} Schema-parsed data."," * @static"," * @protected"," */"," _parseMeta: function(metaFields, xmldoc_in, data_out) {"," if(Lang.isObject(metaFields)) {"," var key,"," xmldoc = xmldoc_in.ownerDocument || xmldoc_in;",""," for(key in metaFields) {"," if (metaFields.hasOwnProperty(key)) {"," data_out.meta[key] = SchemaXML._getLocationValue(metaFields[key], xmldoc);"," }"," }"," }"," return data_out;"," },",""," /**"," * Schema-parsed result to add to results list."," *"," * @method _parseResult"," * @param fields {Array} Required. A collection of field definition."," * @param context {Object} Required. XML node or document to search within."," * @return {Object} Schema-parsed data."," * @static"," * @protected"," */"," _parseResult: function(fields, context) {"," var result = {}, j;",""," // Find each field value"," for (j=fields.length-1; 0 <= j; j--) {"," SchemaXML._parseField(fields[j], result, context);"," }",""," return result;"," },",""," /**"," * Schema-parsed list of results from full data"," *"," * @method _parseResults"," * @param schema {Object} Schema to parse against."," * @param context {Object} XML node or document to parse."," * @param data_out {Object} In-progress schema-parsed data to update."," * @return {Object} Schema-parsed data."," * @static"," * @protected"," */"," _parseResults: function(schema, context, data_out) {"," if (schema.resultListLocator && Lang.isArray(schema.resultFields)) {"," var xmldoc = context.ownerDocument || context,"," fields = schema.resultFields,"," results = [],"," node, nodeList, i=0;",""," if (schema.resultListLocator.match(/^[:\\-\\w]+$/)) {"," nodeList = context.getElementsByTagName(schema.resultListLocator);"," "," // loop through each result node"," for (i = nodeList.length - 1; i >= 0; --i) {"," results[i] = SchemaXML._parseResult(fields, nodeList[i]);"," }"," } else {"," nodeList = SchemaXML._getXPathResult(schema.resultListLocator, context, xmldoc);",""," // loop through the nodelist"," while ((node = nodeList.iterateNext())) {"," results[i] = SchemaXML._parseResult(fields, node);"," i += 1;"," }"," }",""," if (results.length) {"," data_out.results = results;"," } else {"," data_out.error = new Error(\"XML schema result nodes retrieval failure\");"," }"," }"," return data_out;"," }","};","","Y.DataSchema.XML = Y.mix(SchemaXML, Y.DataSchema.Base);","","","}, '3.7.3', {\"requires\": [\"dataschema-base\"]});"];+_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].lines = {"1":0,"19":0,"29":0,"117":0,"120":0,"122":0,"125":0,"127":0,"130":0,"144":0,"148":0,"149":0,"150":0,"151":0,"161":0,"165":0,"182":0,"183":0,"188":0,"191":0,"193":0,"194":0,"197":0,"202":0,"203":0,"206":0,"207":0,"209":0,"210":0,"211":0,"214":0,"215":0,"216":0,"219":0,"220":0,"221":0,"224":0,"225":0,"226":0,"227":0,"228":0,"234":0,"236":0,"237":0,"240":0,"241":0,"245":0,"251":0,"255":0,"256":0,"257":0,"258":0,"277":0,"280":0,"281":0,"282":0,"284":0,"286":0,"301":0,"302":0,"305":0,"306":0,"307":0,"311":0,"325":0,"328":0,"329":0,"332":0,"347":0,"348":0,"353":0,"354":0,"357":0,"358":0,"361":0,"364":0,"365":0,"366":0,"370":0,"371":0,"373":0,"376":0,"380":0};+_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].functions = {"apply:116":0,"_getLocationValue:143":0,"iterateNext:254":0,"_getXPathResult:180":0,"_parseField:276":0,"_parseMeta:300":0,"_parseResult:324":0,"_parseResults:346":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].coveredLines = 83; _yuitest_coverage["build/dataschema-xml/dataschema-xml.js"].coveredFunctions = 9; _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 1); YUI.add('dataschema-xml', function (Y, NAME) {@@ -204,7 +204,7 @@ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 150); while ((res = result.iterateNext())) { _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 151);-value = res.textContent || res.value || res.text || res.innerHTML || null;+value = res.textContent || res.value || res.text || res.innerHTML || res.innerText || null; } // FIXME: Why defer to a method that is mixed into this object?@@ -242,110 +242,115 @@ if (! Lang.isUndefined(xmldoc.evaluate)) { _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 183); return xmldoc.evaluate(locator, context, xmldoc.createNSResolver(context.ownerDocument ? context.ownerDocument.documentElement : context.documentElement), 0, null);+ } // IE mode else {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 187);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 188); var values=[], locatorArray = locator.split(/\b\/\b/), i=0, l=locatorArray.length, location, subloc, m, isNth; // XPath is supported- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 190);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 191); try { // this fixes the IE 5.5+ issue where childnode selectors begin at 0 instead of 1- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 192);-xmldoc.setProperty("SelectionLanguage", "XPath"); _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 193);+try {+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 194);+xmldoc.setProperty("SelectionLanguage", "XPath");+ } catch (e) {}+ + _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 197); values = context.selectNodes(locator); } // Fallback for DOM nodes and fragments catch (e) { // Iterate over each locator piece- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 198);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 202); for (; i<l && context; i++) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 199);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 203); location = locatorArray[i]; // grab nth child []- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 202);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 206); if ((location.indexOf("[") > -1) && (location.indexOf("]") > -1)) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 203);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 207); subloc = location.slice(location.indexOf("[")+1, location.indexOf("]")); //XPath is 1-based while DOM is 0-based- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 205);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 209); subloc--;- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 206);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 210); context = context.children[subloc];- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 207);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 211); isNth = true; } // grab attribute value @- else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 210);+ else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 214); if (location.indexOf("@") > -1) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 211);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 215); subloc = location.substr(location.indexOf("@"));- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 212);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 216); context = subloc ? context.getAttribute(subloc.replace('@', '')) : context; } // grab that last instance of tagName- else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 215);+ else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 219); if (-1 < location.indexOf("//")) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 216);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 220); subloc = context.getElementsByTagName(location.substr(2));- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 217);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 221); context = subloc.length ? subloc[subloc.length - 1] : null; } // find the last matching location in children- else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 220);+ else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 224); if (l != i + 1) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 221);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 225); for (m=context.childNodes.length-1; 0 <= m; m-=1) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 222);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 226); if (location === context.childNodes[m].tagName) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 223);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 227); context = context.childNodes[m];- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 224);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 228); m = -1; } } }}}} } - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 230);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 234); if (context) { // attribute- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 232);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 236); if (Lang.isString(context)) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 233);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 237); values[0] = {value: context}; } // nth child- else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 236);+ else {_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 240); if (isNth) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 237);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 241); values[0] = {value: context.innerHTML}; } // all children else {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 241);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 245); values = Y.Array(context.childNodes, 0, true); }} } } // returning a mock-standard object for IE- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 247);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 251); return { index: 0, iterateNext: function() {- _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "iterateNext", 250);-_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 251);+ _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "iterateNext", 254);+_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 255); if (this.index >= this.values.length) {return undefined;}- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 252);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 256); var result = this.values[this.index];- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 253);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 257); this.index += 1;- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 254);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 258); return result; }, @@ -365,22 +370,22 @@ * @protected */ _parseField: function(field, result, context) {- _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseField", 272);-_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 273);+ _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseField", 276);+_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 277); var key = field.key || field, parsed; - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 276);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 280); if (field.schema) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 277);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 281); parsed = { results: [], meta: {} };- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 278);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 282); parsed = SchemaXML._parseResults(field.schema, context, parsed); - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 280);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 284); result[key] = parsed.results; } else {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 282);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 286); result[key] = SchemaXML._getLocationValue(field, context); } },@@ -396,23 +401,23 @@ * @protected */ _parseMeta: function(metaFields, xmldoc_in, data_out) {- _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseMeta", 296);-_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 297);+ _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseMeta", 300);+_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 301); if(Lang.isObject(metaFields)) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 298);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 302); var key, xmldoc = xmldoc_in.ownerDocument || xmldoc_in; - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 301);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 305); for(key in metaFields) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 302);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 306); if (metaFields.hasOwnProperty(key)) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 303);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 307); data_out.meta[key] = SchemaXML._getLocationValue(metaFields[key], xmldoc); } } }- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 307);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 311); return data_out; }, @@ -427,18 +432,18 @@ * @protected */ _parseResult: function(fields, context) {- _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseResult", 320);-_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 321);+ _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseResult", 324);+_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 325); var result = {}, j; // Find each field value- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 324);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 328); for (j=fields.length-1; 0 <= j; j--) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 325);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 329); SchemaXML._parseField(fields[j], result, context); } - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 328);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 332); return result; }, @@ -454,56 +459,56 @@ * @protected */ _parseResults: function(schema, context, data_out) {- _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseResults", 342);-_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 343);+ _yuitest_coverfunc("build/dataschema-xml/dataschema-xml.js", "_parseResults", 346);+_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 347); if (schema.resultListLocator && Lang.isArray(schema.resultFields)) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 344);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 348); var xmldoc = context.ownerDocument || context, fields = schema.resultFields, results = [], node, nodeList, i=0; - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 349);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 353); if (schema.resultListLocator.match(/^[:\-\w]+$/)) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 350);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 354); nodeList = context.getElementsByTagName(schema.resultListLocator); // loop through each result node- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 353);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 357); for (i = nodeList.length - 1; i >= 0; --i) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 354);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 358); results[i] = SchemaXML._parseResult(fields, nodeList[i]); } } else {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 357);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 361); nodeList = SchemaXML._getXPathResult(schema.resultListLocator, context, xmldoc); // loop through the nodelist- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 360);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 364); while ((node = nodeList.iterateNext())) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 361);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 365); results[i] = SchemaXML._parseResult(fields, node);- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 362);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 366); i += 1; } } - _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 366);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 370); if (results.length) {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 367);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 371); data_out.results = results; } else {- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 369);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 373); data_out.error = new Error("XML schema result nodes retrieval failure"); } }- _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 372);+ _yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 376); return data_out; } }; -_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 376);+_yuitest_coverline("build/dataschema-xml/dataschema-xml.js", 380); Y.DataSchema.XML = Y.mix(SchemaXML, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-xml/dataschema-xml-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -155,7 +155,7 @@ try { result = SchemaXML._getXPathResult(locator, context, xmldoc); while ((res = result.iterateNext())) {- value = res.textContent || res.value || res.text || res.innerHTML || null;+ value = res.textContent || res.value || res.text || res.innerHTML || res.innerText || null; } // FIXME: Why defer to a method that is mixed into this object?@@ -189,6 +189,7 @@ // Standards mode if (! Lang.isUndefined(xmldoc.evaluate)) { return xmldoc.evaluate(locator, context, xmldoc.createNSResolver(context.ownerDocument ? context.ownerDocument.documentElement : context.documentElement), 0, null);+ } // IE mode else {@@ -197,7 +198,10 @@ // XPath is supported try { // this fixes the IE 5.5+ issue where childnode selectors begin at 0 instead of 1- xmldoc.setProperty("SelectionLanguage", "XPath");+ try {+ xmldoc.setProperty("SelectionLanguage", "XPath");+ } catch (e) {}+ values = context.selectNodes(locator); } // Fallback for DOM nodes and fragments@@ -384,4 +388,4 @@ Y.DataSchema.XML = Y.mix(SchemaXML, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/dataschema-xml/dataschema-xml-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dataschema-xml",function(e,t){var n=e.Lang,r={1:!0,9:!0,11:!0},i;i={apply:function(e,t){var n=t,s={results:[],meta:{}};return n&&r[n.nodeType]&&e?(s=i._parseResults(e,n,s),s=i._parseMeta(e.metaFields,n,s)):s.error=new Error("XML schema parse failure"),s},_getLocationValue:function(t,n){var r=t.locator||t.key||t,s=n.ownerDocument||n,o,u,a=null;try{o=i._getXPathResult(r,n,s);while(u=o.iterateNext())a=u.textContent||u.value||u.text||u.innerHTML||null;return e.DataSchema.Base.parse.call(this,a,t)}catch(f){}return null},_getXPathResult:function(t,r,i){if(!n.isUndefined(i.evaluate))return i.evaluate(t,r,i.createNSResolver(r.ownerDocument?r.ownerDocument.documentElement:r.documentElement),0,null);var s=[],o=t.split(/\b\/\b/),u=0,a=o.length,f,l,c,h;try{i.setProperty("SelectionLanguage","XPath"),s=r.selectNodes(t)}catch(p){for(;u<a&&r;u++){f=o[u];if(f.indexOf("[")>-1&&f.indexOf("]")>-1)l=f.slice(f.indexOf("[")+1,f.indexOf("]")),l--,r=r.children[l],h=!0;else if(f.indexOf("@")>-1)l=f.substr(f.indexOf("@")),r=l?r.getAttribute(l.replace("@","")):r;else if(-1<f.indexOf("//"))l=r.getElementsByTagName(f.substr(2)),r=l.length?l[l.length-1]:null;else if(a!=u+1)for(c=r.childNodes.length-1;0<=c;c-=1)f===r.childNodes[c].tagName&&(r=r.childNodes[c],c=-1)}r&&(n.isString(r)?s[0]={value:r}:h?s[0]={value:r.innerHTML}:s=e.Array(r.childNodes,0,!0))}return{index:0,iterateNext:function(){if(this.index>=this.values.length)return undefined;var e=this.values[this.index];return this.index+=1,e},values:s}},_parseField:function(e,t,n){var r=e.key||e,s;e.schema?(s={results:[],meta:{}},s=i._parseResults(e.schema,n,s),t[r]=s.results):t[r]=i._getLocationValue(e,n)},_parseMeta:function(e,t,r){if(n.isObject(e)){var s,o=t.ownerDocument||t;for(s in e)e.hasOwnProperty(s)&&(r.meta[s]=i._getLocationValue(e[s],o))}return r},_parseResult:function(e,t){var n={},r;for(r=e.length-1;0<=r;r--)i._parseField(e[r],n,t);return n},_parseResults:function(e,t,r){if(e.resultListLocator&&n.isArray(e.resultFields)){var s=t.ownerDocument||t,o=e.resultFields,u=[],a,f,l=0;if(e.resultListLocator.match(/^[:\-\w]+$/)){f=t.getElementsByTagName(e.resultListLocator);for(l=f.length-1;l>=0;--l)u[l]=i._parseResult(o,f[l])}else{f=i._getXPathResult(e.resultListLocator,t,s);while(a=f.iterateNext())u[l]=i._parseResult(o,a),l+=1}u.length?r.results=u:r.error=new Error("XML schema result nodes retrieval failure")}return r}},e.DataSchema.XML=e.mix(i,e.DataSchema.Base)},"3.7.2",{requires:["dataschema-base"]});+YUI.add("dataschema-xml",function(e,t){var n=e.Lang,r={1:!0,9:!0,11:!0},i;i={apply:function(e,t){var n=t,s={results:[],meta:{}};return n&&r[n.nodeType]&&e?(s=i._parseResults(e,n,s),s=i._parseMeta(e.metaFields,n,s)):s.error=new Error("XML schema parse failure"),s},_getLocationValue:function(t,n){var r=t.locator||t.key||t,s=n.ownerDocument||n,o,u,a=null;try{o=i._getXPathResult(r,n,s);while(u=o.iterateNext())a=u.textContent||u.value||u.text||u.innerHTML||u.innerText||null;return e.DataSchema.Base.parse.call(this,a,t)}catch(f){}return null},_getXPathResult:function(t,r,i){if(!n.isUndefined(i.evaluate))return i.evaluate(t,r,i.createNSResolver(r.ownerDocument?r.ownerDocument.documentElement:r.documentElement),0,null);var s=[],o=t.split(/\b\/\b/),u=0,a=o.length,f,l,c,h;try{try{i.setProperty("SelectionLanguage","XPath")}catch(p){}s=r.selectNodes(t)}catch(p){for(;u<a&&r;u++){f=o[u];if(f.indexOf("[")>-1&&f.indexOf("]")>-1)l=f.slice(f.indexOf("[")+1,f.indexOf("]")),l--,r=r.children[l],h=!0;else if(f.indexOf("@")>-1)l=f.substr(f.indexOf("@")),r=l?r.getAttribute(l.replace("@","")):r;else if(-1<f.indexOf("//"))l=r.getElementsByTagName(f.substr(2)),r=l.length?l[l.length-1]:null;else if(a!=u+1)for(c=r.childNodes.length-1;0<=c;c-=1)f===r.childNodes[c].tagName&&(r=r.childNodes[c],c=-1)}r&&(n.isString(r)?s[0]={value:r}:h?s[0]={value:r.innerHTML}:s=e.Array(r.childNodes,0,!0))}return{index:0,iterateNext:function(){if(this.index>=this.values.length)return undefined;var e=this.values[this.index];return this.index+=1,e},values:s}},_parseField:function(e,t,n){var r=e.key||e,s;e.schema?(s={results:[],meta:{}},s=i._parseResults(e.schema,n,s),t[r]=s.results):t[r]=i._getLocationValue(e,n)},_parseMeta:function(e,t,r){if(n.isObject(e)){var s,o=t.ownerDocument||t;for(s in e)e.hasOwnProperty(s)&&(r.meta[s]=i._getLocationValue(e[s],o))}return r},_parseResult:function(e,t){var n={},r;for(r=e.length-1;0<=r;r--)i._parseField(e[r],n,t);return n},_parseResults:function(e,t,r){if(e.resultListLocator&&n.isArray(e.resultFields)){var s=t.ownerDocument||t,o=e.resultFields,u=[],a,f,l=0;if(e.resultListLocator.match(/^[:\-\w]+$/)){f=t.getElementsByTagName(e.resultListLocator);for(l=f.length-1;l>=0;--l)u[l]=i._parseResult(o,f[l])}else{f=i._getXPathResult(e.resultListLocator,t,s);while(a=f.iterateNext())u[l]=i._parseResult(o,a),l+=1}u.length?r.results=u:r.error=new Error("XML schema result nodes retrieval failure")}return r}},e.DataSchema.XML=e.mix(i,e.DataSchema.Base)},"3.7.3",{requires:["dataschema-base"]});
bundle/dataschema-xml/dataschema-xml.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -154,7 +154,7 @@ try { result = SchemaXML._getXPathResult(locator, context, xmldoc); while ((res = result.iterateNext())) {- value = res.textContent || res.value || res.text || res.innerHTML || null;+ value = res.textContent || res.value || res.text || res.innerHTML || res.innerText || null; } // FIXME: Why defer to a method that is mixed into this object?@@ -187,6 +187,7 @@ // Standards mode if (! Lang.isUndefined(xmldoc.evaluate)) { return xmldoc.evaluate(locator, context, xmldoc.createNSResolver(context.ownerDocument ? context.ownerDocument.documentElement : context.documentElement), 0, null);+ } // IE mode else {@@ -195,7 +196,10 @@ // XPath is supported try { // this fixes the IE 5.5+ issue where childnode selectors begin at 0 instead of 1- xmldoc.setProperty("SelectionLanguage", "XPath");+ try {+ xmldoc.setProperty("SelectionLanguage", "XPath");+ } catch (e) {}+ values = context.selectNodes(locator); } // Fallback for DOM nodes and fragments@@ -382,4 +386,4 @@ Y.DataSchema.XML = Y.mix(SchemaXML, Y.DataSchema.Base); -}, '3.7.2', {"requires": ["dataschema-base"]});+}, '3.7.3', {"requires": ["dataschema-base"]});
bundle/datasource-arrayschema/datasource-arrayschema-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-arrayschema/datasource-arrayschema.js", code: [] };-_yuitest_coverage["build/datasource-arrayschema/datasource-arrayschema.js"].code=["YUI.add('datasource-arrayschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on array data."," *"," * @module datasource"," * @submodule datasource-arrayschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceArraySchema"," * @extends Plugin.Base"," */ ","var DataSourceArraySchema = function() {"," DataSourceArraySchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceArraySchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceArraySchema\""," */"," NAME: \"dataSourceArraySchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceArraySchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceArraySchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var data = (Y.DataSource.IO && (this.get(\"host\") instanceof Y.DataSource.IO) && Y.Lang.isString(e.data.responseText)) ? e.data.responseText : e.data,"," response = Y.DataSchema.Array.apply.call(this, this.get(\"schema\"), data),"," payload = e.details[0];"," "," // Default"," if (!response) {"," response = {"," meta: {},"," results: data"," };"," }"," "," payload.response = response;",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceArraySchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema;","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-array\"]});"];+_yuitest_coverage["build/datasource-arrayschema/datasource-arrayschema.js"].code=["YUI.add('datasource-arrayschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on array data."," *"," * @module datasource"," * @submodule datasource-arrayschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceArraySchema"," * @extends Plugin.Base"," */ ","var DataSourceArraySchema = function() {"," DataSourceArraySchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceArraySchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceArraySchema\""," */"," NAME: \"dataSourceArraySchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceArraySchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceArraySchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var data = (Y.DataSource.IO && (this.get(\"host\") instanceof Y.DataSource.IO) && Y.Lang.isString(e.data.responseText)) ? e.data.responseText : e.data,"," response = Y.DataSchema.Array.apply.call(this, this.get(\"schema\"), data),"," payload = e.details[0];"," "," // Default"," if (!response) {"," response = {"," meta: {},"," results: data"," };"," }"," "," payload.response = response;",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceArraySchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema;","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-array\"]});"]; _yuitest_coverage["build/datasource-arrayschema/datasource-arrayschema.js"].lines = {"1":0,"15":0,"16":0,"19":0,"56":0,"65":0,"83":0,"88":0,"89":0,"95":0,"97":0,"99":0,"103":0}; _yuitest_coverage["build/datasource-arrayschema/datasource-arrayschema.js"].functions = {"DataSourceArraySchema:15":0,"initializer:64":0,"_beforeDefDataFn:82":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-arrayschema/datasource-arrayschema.js"].coveredLines = 13;@@ -159,4 +159,4 @@ Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-array"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-array"]});
bundle/datasource-arrayschema/datasource-arrayschema-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-array"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-array"]});
bundle/datasource-arrayschema/datasource-arrayschema-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-arrayschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceArraySchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=e.DataSource.IO&&this.get("host")instanceof e.DataSource.IO&&e.Lang.isString(t.data.responseText)?t.data.responseText:t.data,r=e.DataSchema.Array.apply.call(this,this.get("schema"),n),i=t.details[0];return r||(r={meta:{},results:n}),i.response=r,this.get("host").fire("response",i),new e.Do.Halt("DataSourceArraySchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceArraySchema=n},"3.7.2",{requires:["datasource-local","plugin","dataschema-array"]});+YUI.add("datasource-arrayschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceArraySchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=e.DataSource.IO&&this.get("host")instanceof e.DataSource.IO&&e.Lang.isString(t.data.responseText)?t.data.responseText:t.data,r=e.DataSchema.Array.apply.call(this,this.get("schema"),n),i=t.details[0];return r||(r={meta:{},results:n}),i.response=r,this.get("host").fire("response",i),new e.Do.Halt("DataSourceArraySchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceArraySchema=n},"3.7.3",{requires:["datasource-local","plugin","dataschema-array"]});
bundle/datasource-arrayschema/datasource-arrayschema.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ Y.namespace('Plugin').DataSourceArraySchema = DataSourceArraySchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-array"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-array"]});
bundle/datasource-cache/datasource-cache-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-cache/datasource-cache.js", code: [] };-_yuitest_coverage["build/datasource-cache/datasource-cache.js"].code=["YUI.add('datasource-cache', function (Y, NAME) {","","/**"," * Plugs DataSource with caching functionality."," *"," * @module datasource"," * @submodule datasource-cache"," */","","/**"," * DataSourceCache extension binds Cache to DataSource."," * @class DataSourceCacheExtension"," */","var DataSourceCacheExtension = function() {","};","","Y.mix(DataSourceCacheExtension, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCacheExtension\""," */"," NAME: \"dataSourceCacheExtension\"","});","","DataSourceCacheExtension.prototype = {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defRequestFn\", this._beforeDefRequestFn);"," this.doBefore(\"_defResponseFn\", this._beforeDefResponseFn);"," },",""," /**"," * First look for cached response, then send request to live data."," *"," * @method _beforeDefRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object.</dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _beforeDefRequestFn: function(e) {"," // Is response already in the Cache?"," var entry = (this.retrieve(e.request)) || null,"," payload = e.details[0];",""," if (entry && entry.response) {"," payload.cached = entry.cached;"," payload.response = entry.response;"," payload.data = entry.data;",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceCache extension halted _defRequestFn\");"," }"," },",""," /**"," * Adds data to cache before returning data."," *"," * @method _beforeDefResponseFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt> <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>cached (Object)</dt> <dd>True when response is cached.</dd>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Object)</dt> <dd>Error object.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _beforeDefResponseFn: function(e) {"," // Add to Cache before returning"," if(e.response && !e.cached) {"," this.add(e.request, e.response);"," }"," }","};","","Y.namespace(\"Plugin\").DataSourceCacheExtension = DataSourceCacheExtension;","","","","/**"," * DataSource plugin adds cache functionality."," * @class DataSourceCache"," * @extends Cache"," * @uses Plugin.Base, DataSourceCachePlugin"," */","function DataSourceCache(config) {"," var cache = config && config.cache ? config.cache : Y.Cache,"," tmpclass = Y.Base.create(\"dataSourceCache\", cache, [Y.Plugin.Base, Y.Plugin.DataSourceCacheExtension]),"," tmpinstance = new tmpclass(config);"," tmpclass.NS = \"tmpClass\";"," return tmpinstance;","}","","Y.mix(DataSourceCache, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCache\""," */"," NAME: \"dataSourceCache\"","});","","","Y.namespace(\"Plugin\").DataSourceCache = DataSourceCache;","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"plugin\", \"cache-base\"]});"];+_yuitest_coverage["build/datasource-cache/datasource-cache.js"].code=["YUI.add('datasource-cache', function (Y, NAME) {","","/**"," * Plugs DataSource with caching functionality."," *"," * @module datasource"," * @submodule datasource-cache"," */","","/**"," * DataSourceCache extension binds Cache to DataSource."," * @class DataSourceCacheExtension"," */","var DataSourceCacheExtension = function() {","};","","Y.mix(DataSourceCacheExtension, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCacheExtension\""," */"," NAME: \"dataSourceCacheExtension\"","});","","DataSourceCacheExtension.prototype = {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defRequestFn\", this._beforeDefRequestFn);"," this.doBefore(\"_defResponseFn\", this._beforeDefResponseFn);"," },",""," /**"," * First look for cached response, then send request to live data."," *"," * @method _beforeDefRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object.</dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _beforeDefRequestFn: function(e) {"," // Is response already in the Cache?"," var entry = (this.retrieve(e.request)) || null,"," payload = e.details[0];",""," if (entry && entry.response) {"," payload.cached = entry.cached;"," payload.response = entry.response;"," payload.data = entry.data;",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceCache extension halted _defRequestFn\");"," }"," },",""," /**"," * Adds data to cache before returning data."," *"," * @method _beforeDefResponseFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt> <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>cached (Object)</dt> <dd>True when response is cached.</dd>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Object)</dt> <dd>Error object.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _beforeDefResponseFn: function(e) {"," // Add to Cache before returning"," if(e.response && !e.cached) {"," this.add(e.request, e.response);"," }"," }","};","","Y.namespace(\"Plugin\").DataSourceCacheExtension = DataSourceCacheExtension;","","","","/**"," * DataSource plugin adds cache functionality."," * @class DataSourceCache"," * @extends Cache"," * @uses Plugin.Base, DataSourceCachePlugin"," */","function DataSourceCache(config) {"," var cache = config && config.cache ? config.cache : Y.Cache,"," tmpclass = Y.Base.create(\"dataSourceCache\", cache, [Y.Plugin.Base, Y.Plugin.DataSourceCacheExtension]),"," tmpinstance = new tmpclass(config);"," tmpclass.NS = \"tmpClass\";"," return tmpinstance;","}","","Y.mix(DataSourceCache, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"cache\""," */"," NS: \"cache\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceCache\""," */"," NAME: \"dataSourceCache\"","});","","","Y.namespace(\"Plugin\").DataSourceCache = DataSourceCache;","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"plugin\", \"cache-base\"]});"]; _yuitest_coverage["build/datasource-cache/datasource-cache.js"].lines = {"1":0,"14":0,"17":0,"42":0,"51":0,"52":0,"70":0,"73":0,"74":0,"75":0,"76":0,"78":0,"80":0,"113":0,"114":0,"119":0,"129":0,"130":0,"133":0,"134":0,"137":0,"163":0}; _yuitest_coverage["build/datasource-cache/datasource-cache.js"].functions = {"initializer:50":0,"_beforeDefRequestFn:68":0,"_beforeDefResponseFn:111":0,"DataSourceCache:129":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-cache/datasource-cache.js"].coveredLines = 22;@@ -229,4 +229,4 @@ Y.namespace("Plugin").DataSourceCache = DataSourceCache; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "cache-base"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "cache-base"]});
bundle/datasource-cache/datasource-cache-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -169,4 +169,4 @@ Y.namespace("Plugin").DataSourceCache = DataSourceCache; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "cache-base"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "cache-base"]});
bundle/datasource-cache/datasource-cache-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-cache",function(e,t){function r(t){var n=t&&t.cache?t.cache:e.Cache,r=e.Base.create("dataSourceCache",n,[e.Plugin.Base,e.Plugin.DataSourceCacheExtension]),i=new r(t);return r.NS="tmpClass",i}var n=function(){};e.mix(n,{NS:"cache",NAME:"dataSourceCacheExtension"}),n.prototype={initializer:function(e){this.doBefore("_defRequestFn",this._beforeDefRequestFn),this.doBefore("_defResponseFn",this._beforeDefResponseFn)},_beforeDefRequestFn:function(t){var n=this.retrieve(t.request)||null,r=t.details[0];if(n&&n.response)return r.cached=n.cached,r.response=n.response,r.data=n.data,this.get("host").fire("response",r),new e.Do.Halt("DataSourceCache extension halted _defRequestFn")},_beforeDefResponseFn:function(e){e.response&&!e.cached&&this.add(e.request,e.response)}},e.namespace("Plugin").DataSourceCacheExtension=n,e.mix(r,{NS:"cache",NAME:"dataSourceCache"}),e.namespace("Plugin").DataSourceCache=r},"3.7.2",{requires:["datasource-local","plugin","cache-base"]});+YUI.add("datasource-cache",function(e,t){function r(t){var n=t&&t.cache?t.cache:e.Cache,r=e.Base.create("dataSourceCache",n,[e.Plugin.Base,e.Plugin.DataSourceCacheExtension]),i=new r(t);return r.NS="tmpClass",i}var n=function(){};e.mix(n,{NS:"cache",NAME:"dataSourceCacheExtension"}),n.prototype={initializer:function(e){this.doBefore("_defRequestFn",this._beforeDefRequestFn),this.doBefore("_defResponseFn",this._beforeDefResponseFn)},_beforeDefRequestFn:function(t){var n=this.retrieve(t.request)||null,r=t.details[0];if(n&&n.response)return r.cached=n.cached,r.response=n.response,r.data=n.data,this.get("host").fire("response",r),new e.Do.Halt("DataSourceCache extension halted _defRequestFn")},_beforeDefResponseFn:function(e){e.response&&!e.cached&&this.add(e.request,e.response)}},e.namespace("Plugin").DataSourceCacheExtension=n,e.mix(r,{NS:"cache",NAME:"dataSourceCache"}),e.namespace("Plugin").DataSourceCache=r},"3.7.3",{requires:["datasource-local","plugin","cache-base"]});
bundle/datasource-cache/datasource-cache.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -169,4 +169,4 @@ Y.namespace("Plugin").DataSourceCache = DataSourceCache; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "cache-base"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "cache-base"]});
bundle/datasource-function/datasource-function-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-function/datasource-function.js", code: [] };-_yuitest_coverage["build/datasource-function/datasource-function.js"].code=["YUI.add('datasource-function', function (Y, NAME) {","","/**"," * Provides a DataSource implementation which can be used to retrieve data from"," * a custom function."," *"," * @module datasource"," * @submodule datasource-function"," */","","/**"," * Function subclass for the DataSource Utility."," * @class DataSource.Function"," * @extends DataSource.Local"," * @constructor"," */ ","var LANG = Y.Lang,",""," DSFn = function() {"," DSFn.superclass.constructor.apply(this, arguments);"," };"," ",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.Function static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(DSFn, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceFunction\""," */"," NAME: \"dataSourceFunction\",","",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.Function Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," /**"," * Stores the function that will serve the response data."," *"," * @attribute source"," * @type {Any}"," * @default null"," */"," source: {"," validator: LANG.isFunction"," }"," }","});"," ","Y.extend(DSFn, Y.DataSource.Local, {"," /**"," * Passes query data to the source function. Fires <code>response</code>"," * event with the function results (synchronously)."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following"," * properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var fn = this.get(\"source\"),"," payload = e.details[0];"," "," if (fn) {"," try {"," payload.data = fn(e.request, this, e);"," } catch (ex) {"," payload.error = ex;"," }"," } else {"," payload.error = new Error(\"Function data failure\");"," }",""," this.fire(\"data\", payload);"," "," return e.tId;"," }","});"," ","Y.DataSource.Function = DSFn;","","","}, '3.7.2', {\"requires\": [\"datasource-local\"]});"];+_yuitest_coverage["build/datasource-function/datasource-function.js"].code=["YUI.add('datasource-function', function (Y, NAME) {","","/**"," * Provides a DataSource implementation which can be used to retrieve data from"," * a custom function."," *"," * @module datasource"," * @submodule datasource-function"," */","","/**"," * Function subclass for the DataSource Utility."," * @class DataSource.Function"," * @extends DataSource.Local"," * @constructor"," */ ","var LANG = Y.Lang,",""," DSFn = function() {"," DSFn.superclass.constructor.apply(this, arguments);"," };"," ",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.Function static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(DSFn, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceFunction\""," */"," NAME: \"dataSourceFunction\",","",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.Function Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," /**"," * Stores the function that will serve the response data."," *"," * @attribute source"," * @type {Any}"," * @default null"," */"," source: {"," validator: LANG.isFunction"," }"," }","});"," ","Y.extend(DSFn, Y.DataSource.Local, {"," /**"," * Passes query data to the source function. Fires <code>response</code>"," * event with the function results (synchronously)."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following"," * properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var fn = this.get(\"source\"),"," payload = e.details[0];"," "," if (fn) {"," try {"," payload.data = fn(e.request, this, e);"," } catch (ex) {"," payload.error = ex;"," }"," } else {"," payload.error = new Error(\"Function data failure\");"," }",""," this.fire(\"data\", payload);"," "," return e.tId;"," }","});"," ","Y.DataSource.Function = DSFn;","","","}, '3.7.3', {\"requires\": [\"datasource-local\"]});"]; _yuitest_coverage["build/datasource-function/datasource-function.js"].lines = {"1":0,"17":0,"20":0,"29":0,"62":0,"84":0,"87":0,"88":0,"89":0,"91":0,"94":0,"97":0,"99":0,"103":0}; _yuitest_coverage["build/datasource-function/datasource-function.js"].functions = {"DSFn:19":0,"_defRequestFn:83":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-function/datasource-function.js"].coveredLines = 14;@@ -159,4 +159,4 @@ Y.DataSource.Function = DSFn; -}, '3.7.2', {"requires": ["datasource-local"]});+}, '3.7.3', {"requires": ["datasource-local"]});
bundle/datasource-function/datasource-function-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -111,4 +111,4 @@ Y.DataSource.Function = DSFn; -}, '3.7.2', {"requires": ["datasource-local"]});+}, '3.7.3', {"requires": ["datasource-local"]});
bundle/datasource-function/datasource-function-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-function",function(e,t){var n=e.Lang,r=function(){r.superclass.constructor.apply(this,arguments)};e.mix(r,{NAME:"dataSourceFunction",ATTRS:{source:{validator:n.isFunction}}}),e.extend(r,e.DataSource.Local,{_defRequestFn:function(e){var t=this.get("source"),n=e.details[0];if(t)try{n.data=t(e.request,this,e)}catch(r){n.error=r}else n.error=new Error("Function data failure");return this.fire("data",n),e.tId}}),e.DataSource.Function=r},"3.7.2",{requires:["datasource-local"]});+YUI.add("datasource-function",function(e,t){var n=e.Lang,r=function(){r.superclass.constructor.apply(this,arguments)};e.mix(r,{NAME:"dataSourceFunction",ATTRS:{source:{validator:n.isFunction}}}),e.extend(r,e.DataSource.Local,{_defRequestFn:function(e){var t=this.get("source"),n=e.details[0];if(t)try{n.data=t(e.request,this,e)}catch(r){n.error=r}else n.error=new Error("Function data failure");return this.fire("data",n),e.tId}}),e.DataSource.Function=r},"3.7.3",{requires:["datasource-local"]});
bundle/datasource-function/datasource-function.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ Y.DataSource.Function = DSFn; -}, '3.7.2', {"requires": ["datasource-local"]});+}, '3.7.3', {"requires": ["datasource-local"]});
bundle/datasource-get/datasource-get-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-get/datasource-get.js", code: [] };-_yuitest_coverage["build/datasource-get/datasource-get.js"].code=["YUI.add('datasource-get', function (Y, NAME) {","","/**"," * Provides a DataSource implementation which can be used to retrieve data via the Get Utility."," *"," * @module datasource"," * @submodule datasource-get"," */","","/**"," * Get Utility subclass for the DataSource Utility."," * @class DataSource.Get"," * @extends DataSource.Local"," * @constructor"," */ ","var DSGet = function() {"," DSGet.superclass.constructor.apply(this, arguments);","};"," "," ","Y.DataSource.Get = Y.extend(DSGet, Y.DataSource.Local, {"," /**"," * Passes query string to Get Utility. Fires <code>response</code> event when"," * response is received asynchronously."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var uri = this.get(\"source\"),"," get = this.get(\"get\"),"," guid = Y.guid().replace(/\\-/g, '_'),"," generateRequest = this.get( \"generateRequestCallback\" ),"," payload = e.details[0],"," self = this;",""," /**"," * Stores the most recent request id for validation against stale"," * response handling."," *"," * @property _last"," * @type {String}"," * @protected"," */"," this._last = guid;",""," // Dynamically add handler function with a closure to the callback stack"," // for access to guid"," YUI.Env.DataSource.callbacks[guid] = function(response) {"," delete YUI.Env.DataSource.callbacks[guid];"," delete Y.DataSource.Local.transactions[e.tId];",""," var process = self.get('asyncMode') !== \"ignoreStaleResponses\" ||"," self._last === guid;",""," if (process) {"," payload.data = response;",""," self.fire(\"data\", payload);"," } else {"," }",""," };",""," // Add the callback param to the request url"," uri += e.request + generateRequest.call( this, guid );","",""," Y.DataSource.Local.transactions[e.tId] = get.script(uri, {"," autopurge: true,"," // Works in Firefox only...."," onFailure: function (o) {"," delete YUI.Env.DataSource.callbacks[guid];"," delete Y.DataSource.Local.transactions[e.tId];",""," payload.error = new Error(o.msg || \"Script node data failure\");","",""," self.fire(\"data\", payload);"," },"," onTimeout: function(o) {"," delete YUI.Env.DataSource.callbacks[guid];"," delete Y.DataSource.Local.transactions[e.tId];",""," payload.error = new Error(o.msg || \"Script node data timeout\");","",""," self.fire(\"data\", payload);"," }"," });",""," return e.tId;"," },","",""," /**"," * Default method for adding callback param to url. See"," * generateRequestCallback attribute."," *"," * @method _generateRequest"," * @param guid {String} unique identifier for callback function wrapper"," * @protected"," */"," _generateRequest: function (guid) {"," return \"&\" + this.get(\"scriptCallbackParam\") +"," \"=YUI.Env.DataSource.callbacks.\" + guid;"," }","","}, {",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceGet\""," */"," NAME: \"dataSourceGet\",","",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.Get Attributes"," //"," ////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /**"," * Pointer to Get Utility."," *"," * @attribute get"," * @type Y.Get"," * @default Y.Get"," */"," get: {"," value: Y.Get,"," cloneDefaultValue: false"," },",""," /**"," * Defines request/response management in the following manner:"," * <dl>"," * <!--<dt>queueRequests</dt>"," * <dd>If a request is already in progress, wait until response is"," * returned before sending the next request.</dd>"," * <dt>cancelStaleRequests</dt>"," * <dd>If a request is already in progress, cancel it before"," * sending the next request.</dd>-->"," * <dt>ignoreStaleResponses</dt>"," * <dd>Send all requests, but handle only the response for the most"," * recently sent request.</dd>"," * <dt>allowAll</dt>"," * <dd>Send all requests and handle all responses.</dd>"," * </dl>"," *"," * @attribute asyncMode"," * @type String"," * @default \"allowAll\""," */"," asyncMode: {"," value: \"allowAll\""," },",""," /**"," * Callback string parameter name sent to the remote script. By default,"," * requests are sent to"," * <URI>?<scriptCallbackParam>=callbackFunction"," *"," * @attribute scriptCallbackParam"," * @type String"," * @default \"callback\""," */"," scriptCallbackParam : {"," value: \"callback\""," },",""," /**"," * Accepts the DataSource instance and a callback ID, and returns a callback"," * param/value string that gets appended to the script URI. Implementers"," * can customize this string to match their server's query syntax."," *"," * @attribute generateRequestCallback"," * @type Function"," */"," generateRequestCallback : {"," value: function () {"," return this._generateRequest.apply(this, arguments);"," }"," }"," }","});"," ","YUI.namespace(\"Env.DataSource.callbacks\");","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"get\"]});"];+_yuitest_coverage["build/datasource-get/datasource-get.js"].code=["YUI.add('datasource-get', function (Y, NAME) {","","/**"," * Provides a DataSource implementation which can be used to retrieve data via the Get Utility."," *"," * @module datasource"," * @submodule datasource-get"," */","","/**"," * Get Utility subclass for the DataSource Utility."," * @class DataSource.Get"," * @extends DataSource.Local"," * @constructor"," */ ","var DSGet = function() {"," DSGet.superclass.constructor.apply(this, arguments);","};"," "," ","Y.DataSource.Get = Y.extend(DSGet, Y.DataSource.Local, {"," /**"," * Passes query string to Get Utility. Fires <code>response</code> event when"," * response is received asynchronously."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var uri = this.get(\"source\"),"," get = this.get(\"get\"),"," guid = Y.guid().replace(/\\-/g, '_'),"," generateRequest = this.get( \"generateRequestCallback\" ),"," payload = e.details[0],"," self = this;",""," /**"," * Stores the most recent request id for validation against stale"," * response handling."," *"," * @property _last"," * @type {String}"," * @protected"," */"," this._last = guid;",""," // Dynamically add handler function with a closure to the callback stack"," // for access to guid"," YUI.Env.DataSource.callbacks[guid] = function(response) {"," delete YUI.Env.DataSource.callbacks[guid];"," delete Y.DataSource.Local.transactions[e.tId];",""," var process = self.get('asyncMode') !== \"ignoreStaleResponses\" ||"," self._last === guid;",""," if (process) {"," payload.data = response;",""," self.fire(\"data\", payload);"," } else {"," }",""," };",""," // Add the callback param to the request url"," uri += e.request + generateRequest.call( this, guid );","",""," Y.DataSource.Local.transactions[e.tId] = get.script(uri, {"," autopurge: true,"," // Works in Firefox only...."," onFailure: function (o) {"," delete YUI.Env.DataSource.callbacks[guid];"," delete Y.DataSource.Local.transactions[e.tId];",""," payload.error = new Error(o.msg || \"Script node data failure\");","",""," self.fire(\"data\", payload);"," },"," onTimeout: function(o) {"," delete YUI.Env.DataSource.callbacks[guid];"," delete Y.DataSource.Local.transactions[e.tId];",""," payload.error = new Error(o.msg || \"Script node data timeout\");","",""," self.fire(\"data\", payload);"," }"," });",""," return e.tId;"," },","",""," /**"," * Default method for adding callback param to url. See"," * generateRequestCallback attribute."," *"," * @method _generateRequest"," * @param guid {String} unique identifier for callback function wrapper"," * @protected"," */"," _generateRequest: function (guid) {"," return \"&\" + this.get(\"scriptCallbackParam\") +"," \"=YUI.Env.DataSource.callbacks.\" + guid;"," }","","}, {",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceGet\""," */"," NAME: \"dataSourceGet\",","",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.Get Attributes"," //"," ////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /**"," * Pointer to Get Utility."," *"," * @attribute get"," * @type Y.Get"," * @default Y.Get"," */"," get: {"," value: Y.Get,"," cloneDefaultValue: false"," },",""," /**"," * Defines request/response management in the following manner:"," * <dl>"," * <!--<dt>queueRequests</dt>"," * <dd>If a request is already in progress, wait until response is"," * returned before sending the next request.</dd>"," * <dt>cancelStaleRequests</dt>"," * <dd>If a request is already in progress, cancel it before"," * sending the next request.</dd>-->"," * <dt>ignoreStaleResponses</dt>"," * <dd>Send all requests, but handle only the response for the most"," * recently sent request.</dd>"," * <dt>allowAll</dt>"," * <dd>Send all requests and handle all responses.</dd>"," * </dl>"," *"," * @attribute asyncMode"," * @type String"," * @default \"allowAll\""," */"," asyncMode: {"," value: \"allowAll\""," },",""," /**"," * Callback string parameter name sent to the remote script. By default,"," * requests are sent to"," * <URI>?<scriptCallbackParam>=callbackFunction"," *"," * @attribute scriptCallbackParam"," * @type String"," * @default \"callback\""," */"," scriptCallbackParam : {"," value: \"callback\""," },",""," /**"," * Accepts the DataSource instance and a callback ID, and returns a callback"," * param/value string that gets appended to the script URI. Implementers"," * can customize this string to match their server's query syntax."," *"," * @attribute generateRequestCallback"," * @type Function"," */"," generateRequestCallback : {"," value: function () {"," return this._generateRequest.apply(this, arguments);"," }"," }"," }","});"," ","YUI.namespace(\"Env.DataSource.callbacks\");","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"get\"]});"]; _yuitest_coverage["build/datasource-get/datasource-get.js"].lines = {"1":0,"16":0,"17":0,"21":0,"42":0,"57":0,"61":0,"62":0,"63":0,"65":0,"68":0,"69":0,"71":0,"78":0,"81":0,"85":0,"86":0,"88":0,"91":0,"94":0,"95":0,"97":0,"100":0,"104":0,"117":0,"200":0,"206":0}; _yuitest_coverage["build/datasource-get/datasource-get.js"].functions = {"DSGet:16":0,"]:61":0,"onFailure:84":0,"onTimeout:93":0,"_defRequestFn:41":0,"_generateRequest:116":0,"value:199":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-get/datasource-get.js"].coveredLines = 27;@@ -280,4 +280,4 @@ YUI.namespace("Env.DataSource.callbacks"); -}, '3.7.2', {"requires": ["datasource-local", "get"]});+}, '3.7.3', {"requires": ["datasource-local", "get"]});
bundle/datasource-get/datasource-get-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -216,4 +216,4 @@ YUI.namespace("Env.DataSource.callbacks"); -}, '3.7.2', {"requires": ["datasource-local", "get"]});+}, '3.7.3', {"requires": ["datasource-local", "get"]});
bundle/datasource-get/datasource-get-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-get",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.DataSource.Get=e.extend(n,e.DataSource.Local,{_defRequestFn:function(t){var n=this.get("source"),r=this.get("get"),i=e.guid().replace(/\-/g,"_"),s=this.get("generateRequestCallback"),o=t.details[0],u=this;return this._last=i,YUI.Env.DataSource.callbacks[i]=function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId];var r=u.get("asyncMode")!=="ignoreStaleResponses"||u._last===i;r&&(o.data=n,u.fire("data",o))},n+=t.request+s.call(this,i),e.DataSource.Local.transactions[t.tId]=r.script(n,{autopurge:!0,onFailure:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data failure"),u.fire("data",o)},onTimeout:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data timeout"),u.fire("data",o)}}),t.tId},_generateRequest:function(e){return"&"+this.get("scriptCallbackParam")+"=YUI.Env.DataSource.callbacks."+e}},{NAME:"dataSourceGet",ATTRS:{get:{value:e.Get,cloneDefaultValue:!1},asyncMode:{value:"allowAll"},scriptCallbackParam:{value:"callback"},generateRequestCallback:{value:function(){return this._generateRequest.apply(this,arguments)}}}}),YUI.namespace("Env.DataSource.callbacks")},"3.7.2",{requires:["datasource-local","get"]});+YUI.add("datasource-get",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.DataSource.Get=e.extend(n,e.DataSource.Local,{_defRequestFn:function(t){var n=this.get("source"),r=this.get("get"),i=e.guid().replace(/\-/g,"_"),s=this.get("generateRequestCallback"),o=t.details[0],u=this;return this._last=i,YUI.Env.DataSource.callbacks[i]=function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId];var r=u.get("asyncMode")!=="ignoreStaleResponses"||u._last===i;r&&(o.data=n,u.fire("data",o))},n+=t.request+s.call(this,i),e.DataSource.Local.transactions[t.tId]=r.script(n,{autopurge:!0,onFailure:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data failure"),u.fire("data",o)},onTimeout:function(n){delete YUI.Env.DataSource.callbacks[i],delete e.DataSource.Local.transactions[t.tId],o.error=new Error(n.msg||"Script node data timeout"),u.fire("data",o)}}),t.tId},_generateRequest:function(e){return"&"+this.get("scriptCallbackParam")+"=YUI.Env.DataSource.callbacks."+e}},{NAME:"dataSourceGet",ATTRS:{get:{value:e.Get,cloneDefaultValue:!1},asyncMode:{value:"allowAll"},scriptCallbackParam:{value:"callback"},generateRequestCallback:{value:function(){return this._generateRequest.apply(this,arguments)}}}}),YUI.namespace("Env.DataSource.callbacks")},"3.7.3",{requires:["datasource-local","get"]});
bundle/datasource-get/datasource-get.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -212,4 +212,4 @@ YUI.namespace("Env.DataSource.callbacks"); -}, '3.7.2', {"requires": ["datasource-local", "get"]});+}, '3.7.3', {"requires": ["datasource-local", "get"]});
bundle/datasource-io/datasource-io-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-io/datasource-io.js", code: [] };-_yuitest_coverage["build/datasource-io/datasource-io.js"].code=["YUI.add('datasource-io', function (Y, NAME) {","","/**"," * Provides a DataSource implementation which can be used to retrieve data via the IO Utility."," *"," * @module datasource"," * @submodule datasource-io"," */","","/**"," * IO subclass for the DataSource Utility."," * @class DataSource.IO"," * @extends DataSource.Local"," * @constructor"," */ ","var DSIO = function() {"," DSIO.superclass.constructor.apply(this, arguments);","};"," ",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.IO static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(DSIO, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceIO\""," */"," NAME: \"dataSourceIO\",","",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.IO Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," /**"," * Pointer to IO Utility."," *"," * @attribute io"," * @type Y.io"," * @default Y.io"," */"," io: {"," value: Y.io,"," cloneDefaultValue: false"," },"," "," /**"," * Default IO Config."," *"," * @attribute ioConfig"," * @type Object"," * @default null"," */"," ioConfig: {"," value: null"," }"," }","});"," ","Y.extend(DSIO, Y.DataSource.Local, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._queue = {interval:null, conn:null, requests:[]};"," },",""," /**"," * IO success callback."," *"," * @method successHandler"," * @param id {String} Transaction ID."," * @param response {String} Response."," * @param e {Event.Facade} Event facade."," * @private"," */"," successHandler: function (id, response, e) {"," var defIOConfig = this.get(\"ioConfig\"),"," payload = e.details[0];",""," delete Y.DataSource.Local.transactions[e.tId];",""," payload.data = response;"," this.fire(\"data\", payload);","",""," if (defIOConfig && defIOConfig.on && defIOConfig.on.success) {"," defIOConfig.on.success.apply(defIOConfig.context || Y, arguments);"," }"," },",""," /**"," * IO failure callback."," *"," * @method failureHandler"," * @param id {String} Transaction ID."," * @param response {String} Response."," * @param e {Event.Facade} Event facade."," * @private"," */"," failureHandler: function (id, response, e) {"," var defIOConfig = this.get(\"ioConfig\"),"," payload = e.details[0];"," "," delete Y.DataSource.Local.transactions[e.tId];",""," payload.error = new Error(\"IO data failure\");",""," payload.data = response;"," this.fire(\"data\", payload);","",""," if (defIOConfig && defIOConfig.on && defIOConfig.on.failure) {"," defIOConfig.on.failure.apply(defIOConfig.context || Y, arguments);"," }"," },"," "," /**"," * @property _queue"," * @description Object literal to manage asynchronous request/response"," * cycles enabled if queue needs to be managed (asyncMode/ioConnMode):"," * <dl>"," * <dt>interval {Number}</dt>"," * <dd>Interval ID of in-progress queue.</dd>"," * <dt>conn</dt>"," * <dd>In-progress connection identifier (if applicable).</dd>"," * <dt>requests {Object[]}</dt>"," * <dd>Array of queued request objects: {request:request, callback:callback}.</dd>"," * </dl>"," * @type Object"," * @default {interval:null, conn:null, requests:[]}"," * @private"," */"," _queue: null,",""," /**"," * Passes query string to IO. Fires <code>response</code> event when"," * response is received asynchronously."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var uri = this.get(\"source\"),"," io = this.get(\"io\"),"," defIOConfig = this.get(\"ioConfig\"),"," request = e.request,"," cfg = Y.merge(defIOConfig, e.cfg, {"," on: Y.merge(defIOConfig, {"," success: this.successHandler,"," failure: this.failureHandler"," }),"," context: this,"," \"arguments\": e"," });"," "," // Support for POST transactions"," if(Y.Lang.isString(request)) {"," if(cfg.method && (cfg.method.toUpperCase() === \"POST\")) {"," cfg.data = cfg.data ? cfg.data+request : request;"," }"," else {"," uri += request;"," }"," }"," Y.DataSource.Local.transactions[e.tId] = io(uri, cfg);"," return e.tId;"," }","});"," ","Y.DataSource.IO = DSIO;","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"io-base\"]});"];+_yuitest_coverage["build/datasource-io/datasource-io.js"].code=["YUI.add('datasource-io', function (Y, NAME) {","","/**"," * Provides a DataSource implementation which can be used to retrieve data via the IO Utility."," *"," * @module datasource"," * @submodule datasource-io"," */","","/**"," * IO subclass for the DataSource Utility."," * @class DataSource.IO"," * @extends DataSource.Local"," * @constructor"," */ ","var DSIO = function() {"," DSIO.superclass.constructor.apply(this, arguments);","};"," ",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.IO static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(DSIO, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceIO\""," */"," NAME: \"dataSourceIO\",","",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource.IO Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," /**"," * Pointer to IO Utility."," *"," * @attribute io"," * @type Y.io"," * @default Y.io"," */"," io: {"," value: Y.io,"," cloneDefaultValue: false"," },"," "," /**"," * Default IO Config."," *"," * @attribute ioConfig"," * @type Object"," * @default null"," */"," ioConfig: {"," value: null"," }"," }","});"," ","Y.extend(DSIO, Y.DataSource.Local, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this._queue = {interval:null, conn:null, requests:[]};"," },",""," /**"," * IO success callback."," *"," * @method successHandler"," * @param id {String} Transaction ID."," * @param response {String} Response."," * @param e {Event.Facade} Event facade."," * @private"," */"," successHandler: function (id, response, e) {"," var defIOConfig = this.get(\"ioConfig\"),"," payload = e.details[0];",""," delete Y.DataSource.Local.transactions[e.tId];",""," payload.data = response;"," this.fire(\"data\", payload);","",""," if (defIOConfig && defIOConfig.on && defIOConfig.on.success) {"," defIOConfig.on.success.apply(defIOConfig.context || Y, arguments);"," }"," },",""," /**"," * IO failure callback."," *"," * @method failureHandler"," * @param id {String} Transaction ID."," * @param response {String} Response."," * @param e {Event.Facade} Event facade."," * @private"," */"," failureHandler: function (id, response, e) {"," var defIOConfig = this.get(\"ioConfig\"),"," payload = e.details[0];"," "," delete Y.DataSource.Local.transactions[e.tId];",""," payload.error = new Error(\"IO data failure\");",""," payload.data = response;"," this.fire(\"data\", payload);","",""," if (defIOConfig && defIOConfig.on && defIOConfig.on.failure) {"," defIOConfig.on.failure.apply(defIOConfig.context || Y, arguments);"," }"," },"," "," /**"," * @property _queue"," * @description Object literal to manage asynchronous request/response"," * cycles enabled if queue needs to be managed (asyncMode/ioConnMode):"," * <dl>"," * <dt>interval {Number}</dt>"," * <dd>Interval ID of in-progress queue.</dd>"," * <dt>conn</dt>"," * <dd>In-progress connection identifier (if applicable).</dd>"," * <dt>requests {Object[]}</dt>"," * <dd>Array of queued request objects: {request:request, callback:callback}.</dd>"," * </dl>"," * @type Object"," * @default {interval:null, conn:null, requests:[]}"," * @private"," */"," _queue: null,",""," /**"," * Passes query string to IO. Fires <code>response</code> event when"," * response is received asynchronously."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var uri = this.get(\"source\"),"," io = this.get(\"io\"),"," defIOConfig = this.get(\"ioConfig\"),"," request = e.request,"," cfg = Y.merge(defIOConfig, e.cfg, {"," on: Y.merge(defIOConfig, {"," success: this.successHandler,"," failure: this.failureHandler"," }),"," context: this,"," \"arguments\": e"," });"," "," // Support for POST transactions"," if(Y.Lang.isString(request)) {"," if(cfg.method && (cfg.method.toUpperCase() === \"POST\")) {"," cfg.data = cfg.data ? cfg.data+request : request;"," }"," else {"," uri += request;"," }"," }"," Y.DataSource.Local.transactions[e.tId] = io(uri, cfg);"," return e.tId;"," }","});"," ","Y.DataSource.IO = DSIO;","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"io-base\"]});"]; _yuitest_coverage["build/datasource-io/datasource-io.js"].lines = {"1":0,"16":0,"17":0,"26":0,"71":0,"80":0,"93":0,"96":0,"98":0,"99":0,"102":0,"103":0,"117":0,"120":0,"122":0,"124":0,"125":0,"128":0,"129":0,"171":0,"185":0,"186":0,"187":0,"190":0,"193":0,"194":0,"198":0}; _yuitest_coverage["build/datasource-io/datasource-io.js"].functions = {"DSIO:16":0,"initializer:79":0,"successHandler:92":0,"failureHandler:116":0,"_defRequestFn:170":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-io/datasource-io.js"].coveredLines = 27;@@ -270,4 +270,4 @@ Y.DataSource.IO = DSIO; -}, '3.7.2', {"requires": ["datasource-local", "io-base"]});+}, '3.7.3', {"requires": ["datasource-local", "io-base"]});
bundle/datasource-io/datasource-io-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -207,4 +207,4 @@ Y.DataSource.IO = DSIO; -}, '3.7.2', {"requires": ["datasource-local", "io-base"]});+}, '3.7.3', {"requires": ["datasource-local", "io-base"]});
bundle/datasource-io/datasource-io-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-io",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NAME:"dataSourceIO",ATTRS:{io:{value:e.io,cloneDefaultValue:!1},ioConfig:{value:null}}}),e.extend(n,e.DataSource.Local,{initializer:function(e){this._queue={interval:null,conn:null,requests:[]}},successHandler:function(t,n,r){var i=this.get("ioConfig"),s=r.details[0];delete e.DataSource.Local.transactions[r.tId],s.data=n,this.fire("data",s),i&&i.on&&i.on.success&&i.on.success.apply(i.context||e,arguments)},failureHandler:function(t,n,r){var i=this.get("ioConfig"),s=r.details[0];delete e.DataSource.Local.transactions[r.tId],s.error=new Error("IO data failure"),s.data=n,this.fire("data",s),i&&i.on&&i.on.failure&&i.on.failure.apply(i.context||e,arguments)},_queue:null,_defRequestFn:function(t){var n=this.get("source"),r=this.get("io"),i=this.get("ioConfig"),s=t.request,o=e.merge(i,t.cfg,{on:e.merge(i,{success:this.successHandler,failure:this.failureHandler}),context:this,arguments:t});return e.Lang.isString(s)&&(o.method&&o.method.toUpperCase()==="POST"?o.data=o.data?o.data+s:s:n+=s),e.DataSource.Local.transactions[t.tId]=r(n,o),t.tId}}),e.DataSource.IO=n},"3.7.2",{requires:["datasource-local","io-base"]});+YUI.add("datasource-io",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NAME:"dataSourceIO",ATTRS:{io:{value:e.io,cloneDefaultValue:!1},ioConfig:{value:null}}}),e.extend(n,e.DataSource.Local,{initializer:function(e){this._queue={interval:null,conn:null,requests:[]}},successHandler:function(t,n,r){var i=this.get("ioConfig"),s=r.details[0];delete e.DataSource.Local.transactions[r.tId],s.data=n,this.fire("data",s),i&&i.on&&i.on.success&&i.on.success.apply(i.context||e,arguments)},failureHandler:function(t,n,r){var i=this.get("ioConfig"),s=r.details[0];delete e.DataSource.Local.transactions[r.tId],s.error=new Error("IO data failure"),s.data=n,this.fire("data",s),i&&i.on&&i.on.failure&&i.on.failure.apply(i.context||e,arguments)},_queue:null,_defRequestFn:function(t){var n=this.get("source"),r=this.get("io"),i=this.get("ioConfig"),s=t.request,o=e.merge(i,t.cfg,{on:e.merge(i,{success:this.successHandler,failure:this.failureHandler}),context:this,arguments:t});return e.Lang.isString(s)&&(o.method&&o.method.toUpperCase()==="POST"?o.data=o.data?o.data+s:s:n+=s),e.DataSource.Local.transactions[t.tId]=r(n,o),t.tId}}),e.DataSource.IO=n},"3.7.3",{requires:["datasource-local","io-base"]});
bundle/datasource-io/datasource-io.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -204,4 +204,4 @@ Y.DataSource.IO = DSIO; -}, '3.7.2', {"requires": ["datasource-local", "io-base"]});+}, '3.7.3', {"requires": ["datasource-local", "io-base"]});
bundle/datasource-jsonschema/datasource-jsonschema-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-jsonschema/datasource-jsonschema.js", code: [] };-_yuitest_coverage["build/datasource-jsonschema/datasource-jsonschema.js"].code=["YUI.add('datasource-jsonschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on JSON data."," *"," * @module datasource"," * @submodule datasource-jsonschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceJSONSchema"," * @extends Plugin.Base"," */ ","var DataSourceJSONSchema = function() {"," DataSourceJSONSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceJSONSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceJSONSchema\""," */"," NAME: \"dataSourceJSONSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceJSONSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceJSONSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response. To accommodate XHR responses,"," * will first look for data in data.responseText. Otherwise will just work"," * with data."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var data = e.data && (e.data.responseText || e.data),"," schema = this.get('schema'),"," payload = e.details[0];"," "," payload.response = Y.DataSchema.JSON.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceJSONSchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceJSONSchema = DataSourceJSONSchema;","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-json\"]});"];+_yuitest_coverage["build/datasource-jsonschema/datasource-jsonschema.js"].code=["YUI.add('datasource-jsonschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on JSON data."," *"," * @module datasource"," * @submodule datasource-jsonschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceJSONSchema"," * @extends Plugin.Base"," */ ","var DataSourceJSONSchema = function() {"," DataSourceJSONSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceJSONSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceJSONSchema\""," */"," NAME: \"dataSourceJSONSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceJSONSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceJSONSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response. To accommodate XHR responses,"," * will first look for data in data.responseText. Otherwise will just work"," * with data."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var data = e.data && (e.data.responseText || e.data),"," schema = this.get('schema'),"," payload = e.details[0];"," "," payload.response = Y.DataSchema.JSON.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceJSONSchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceJSONSchema = DataSourceJSONSchema;","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-json\"]});"]; _yuitest_coverage["build/datasource-jsonschema/datasource-jsonschema.js"].lines = {"1":0,"15":0,"16":0,"19":0,"56":0,"65":0,"85":0,"89":0,"94":0,"96":0,"100":0}; _yuitest_coverage["build/datasource-jsonschema/datasource-jsonschema.js"].functions = {"DataSourceJSONSchema:15":0,"initializer:64":0,"_beforeDefDataFn:84":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-jsonschema/datasource-jsonschema.js"].coveredLines = 11;@@ -154,4 +154,4 @@ Y.namespace('Plugin').DataSourceJSONSchema = DataSourceJSONSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-json"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-json"]});
bundle/datasource-jsonschema/datasource-jsonschema-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -106,4 +106,4 @@ Y.namespace('Plugin').DataSourceJSONSchema = DataSourceJSONSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-json"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-json"]});
bundle/datasource-jsonschema/datasource-jsonschema-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-jsonschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceJSONSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=t.data&&(t.data.responseText||t.data),r=this.get("schema"),i=t.details[0];return i.response=e.DataSchema.JSON.apply.call(this,r,n)||{meta:{},results:n},this.get("host").fire("response",i),new e.Do.Halt("DataSourceJSONSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceJSONSchema=n},"3.7.2",{requires:["datasource-local","plugin","dataschema-json"]});+YUI.add("datasource-jsonschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceJSONSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=t.data&&(t.data.responseText||t.data),r=this.get("schema"),i=t.details[0];return i.response=e.DataSchema.JSON.apply.call(this,r,n)||{meta:{},results:n},this.get("host").fire("response",i),new e.Do.Halt("DataSourceJSONSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceJSONSchema=n},"3.7.3",{requires:["datasource-local","plugin","dataschema-json"]});
bundle/datasource-jsonschema/datasource-jsonschema.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -106,4 +106,4 @@ Y.namespace('Plugin').DataSourceJSONSchema = DataSourceJSONSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-json"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-json"]});
bundle/datasource-local/datasource-local-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-local/datasource-local.js", code: [] };-_yuitest_coverage["build/datasource-local/datasource-local.js"].code=["YUI.add('datasource-local', function (Y, NAME) {","","/**"," * The DataSource utility provides a common configurable interface for widgets to"," * access a variety of data, from JavaScript arrays to online database servers."," *"," * @module datasource"," * @main datasource"," */"," ","/**"," * Provides the base DataSource implementation, which can be extended to"," * create DataSources for specific data protocols, such as the IO Utility, the"," * Get Utility, or custom functions."," *"," * @module datasource"," * @submodule datasource-local"," */","","/**"," * Base class for the DataSource Utility."," * @class DataSource.Local"," * @extends Base"," * @constructor"," */ ","var LANG = Y.Lang,","","DSLocal = function() {"," DSLocal.superclass.constructor.apply(this, arguments);","};"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(DSLocal, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceLocal\""," */"," NAME: \"dataSourceLocal\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," /**"," * @attribute source"," * @description Pointer to live data."," * @type MIXED"," * @default null "," */"," source: {"," value: null"," }"," },",""," /**"," * Global transaction counter."," *"," * @property _tId"," * @type Number"," * @static"," * @private"," * @default 0"," */"," _tId: 0,",""," /**"," * Global in-progress transaction objects."," *"," * @property transactions"," * @type Object"," * @static"," */"," transactions: {},",""," /**"," * Returns data to callback."," *"," * @method issueCallback"," * @param e {EventFacade} Event Facade."," * @param caller {DataSource} Calling DataSource instance."," * @static"," */"," issueCallback: function (e, caller) {"," var callbacks = e.on || e.callback,"," callback = callbacks && callbacks.success,"," payload = e.details[0];",""," payload.error = (e.error || e.response.error);",""," if (payload.error) {"," caller.fire(\"error\", payload);"," callback = callbacks && callbacks.failure;"," }",""," if (callback) {"," //TODO: this should be executed from a specific context"," callback(payload);"," }"," }","});"," ","Y.extend(DSLocal, Y.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private "," */"," initializer: function(config) {"," this._initEvents();"," },",""," /**"," * This method creates all the events for this module."," * @method _initEvents"," * @private "," */"," _initEvents: function() {"," /**"," * Fired when a data request is received."," *"," * @event request"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl> "," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object"," * (deprecated, refer to <strong>on</strong></dd>"," * <dt>on (Object)</dt> <dd>The map of configured callback"," * functions.</dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @preventable _defRequestFn"," */"," this.publish(\"request\", {defaultFn: Y.bind(\"_defRequestFn\", this), queuable:true});"," "," /**"," * Fired when raw data is received."," *"," * @event data"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * </dl>"," * @preventable _defDataFn"," */"," this.publish(\"data\", {defaultFn: Y.bind(\"_defDataFn\", this), queuable:true});",""," /**"," * Fired when response is returned."," *"," * @event response"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt>"," * <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Boolean)</dt> <dd>Error flag.</dd>"," * </dl>"," * </dd>"," * <dt>error</dt>"," * <dd>Any error that occurred along the transaction lifecycle.</dd>"," * </dl>"," * @preventable _defResponseFn"," */"," this.publish(\"response\", {defaultFn: Y.bind(\"_defResponseFn\", this), queuable:true});",""," /**"," * Fired when an error is encountered."," *"," * @event error"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt>"," * <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Object)</dt> <dd>Error object.</dd>"," * </dl>"," * </dd>"," * <dt>error</dt>"," * <dd>Any error that occurred along the transaction lifecycle.</dd>"," * </dl>"," */",""," },",""," /**"," * Manages request/response transaction. Must fire <code>response</code>"," * event when response is received. This method should be implemented by"," * subclasses to achieve more complex behavior such as accessing remote data."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facadewith the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var data = this.get(\"source\"),"," payload = e.details[0];"," "," // Problematic data"," if(LANG.isUndefined(data)) {"," payload.error = new Error(\"Local source undefined\");"," }",""," payload.data = data;"," this.fire(\"data\", payload);"," },",""," /**"," * Normalizes raw data into a response that includes results and meta properties."," *"," * @method _defDataFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * </dl>"," * @protected"," */"," _defDataFn: function(e) {"," var data = e.data,"," meta = e.meta,"," response = {"," results: (LANG.isArray(data)) ? data : [data],"," meta: (meta) ? meta : {}"," },"," payload = e.details[0];",""," payload.response = response;"," this.fire(\"response\", payload);"," },",""," /**"," * Sends data as a normalized response to callback."," *"," * @method _defResponseFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt> <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Boolean)</dt> <dd>Error flag.</dd>"," * </dl>"," * </dd>"," * </dl>"," * @protected"," */"," _defResponseFn: function(e) {"," // Send the response back to the callback"," DSLocal.issueCallback(e, this);"," },"," "," /**"," * Generates a unique transaction ID and fires <code>request</code> event."," * <strong>Note</strong>: the property <code>callback</code> is a"," * deprecated alias for the <code>on</code> transaction configuration"," * property described below."," *"," * @method sendRequest"," * @param [request] {Object} An object literal with the following properties:"," * <dl>"," * <dt><code>request</code></dt>"," * <dd>The request to send to the live data source, if any.</dd>"," * <dt><code>on</code></dt>"," * <dd>An object literal with the following properties:"," * <dl>"," * <dt><code>success</code></dt>"," * <dd>The function to call when the data is ready.</dd>"," * <dt><code>failure</code></dt>"," * <dd>The function to call upon a response failure condition.</dd>"," * <dt><code>argument</code></dt>"," * <dd>Arbitrary data payload that will be passed back to the success and failure handlers.</dd>"," * </dl>"," * </dd>"," * <dt><code>cfg</code></dt>"," * <dd>Configuration object, if any.</dd>"," * </dl>"," * @return {Number} Transaction ID."," */"," sendRequest: function(request) {"," var tId = DSLocal._tId++,"," callbacks;",""," request = request || {};",""," callbacks = request.on || request.callback;",""," this.fire(\"request\", {"," tId: tId,"," request: request.request,"," on: callbacks,"," callback: callbacks,"," cfg: request.cfg || {}"," });","",""," return tId;"," }","});"," ","Y.namespace(\"DataSource\").Local = DSLocal;","","","}, '3.7.2', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/datasource-local/datasource-local.js"].code=["YUI.add('datasource-local', function (Y, NAME) {","","/**"," * The DataSource utility provides a common configurable interface for widgets to"," * access a variety of data, from JavaScript arrays to online database servers."," *"," * @module datasource"," * @main datasource"," */"," ","/**"," * Provides the base DataSource implementation, which can be extended to"," * create DataSources for specific data protocols, such as the IO Utility, the"," * Get Utility, or custom functions."," *"," * @module datasource"," * @submodule datasource-local"," */","","/**"," * Base class for the DataSource Utility."," * @class DataSource.Local"," * @extends Base"," * @constructor"," */ ","var LANG = Y.Lang,","","DSLocal = function() {"," DSLocal.superclass.constructor.apply(this, arguments);","};"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource static properties"," //"," /////////////////////////////////////////////////////////////////////////////","Y.mix(DSLocal, {"," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static "," * @final"," * @value \"dataSourceLocal\""," */"," NAME: \"dataSourceLocal\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSource Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," /**"," * @attribute source"," * @description Pointer to live data."," * @type MIXED"," * @default null "," */"," source: {"," value: null"," }"," },",""," /**"," * Global transaction counter."," *"," * @property _tId"," * @type Number"," * @static"," * @private"," * @default 0"," */"," _tId: 0,",""," /**"," * Global in-progress transaction objects."," *"," * @property transactions"," * @type Object"," * @static"," */"," transactions: {},",""," /**"," * Returns data to callback."," *"," * @method issueCallback"," * @param e {EventFacade} Event Facade."," * @param caller {DataSource} Calling DataSource instance."," * @static"," */"," issueCallback: function (e, caller) {"," var callbacks = e.on || e.callback,"," callback = callbacks && callbacks.success,"," payload = e.details[0];",""," payload.error = (e.error || e.response.error);",""," if (payload.error) {"," caller.fire(\"error\", payload);"," callback = callbacks && callbacks.failure;"," }",""," if (callback) {"," //TODO: this should be executed from a specific context"," callback(payload);"," }"," }","});"," ","Y.extend(DSLocal, Y.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private "," */"," initializer: function(config) {"," this._initEvents();"," },",""," /**"," * This method creates all the events for this module."," * @method _initEvents"," * @private "," */"," _initEvents: function() {"," /**"," * Fired when a data request is received."," *"," * @event request"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl> "," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>The callback object"," * (deprecated, refer to <strong>on</strong></dd>"," * <dt>on (Object)</dt> <dd>The map of configured callback"," * functions.</dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @preventable _defRequestFn"," */"," this.publish(\"request\", {defaultFn: Y.bind(\"_defRequestFn\", this), queuable:true});"," "," /**"," * Fired when raw data is received."," *"," * @event data"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * </dl>"," * @preventable _defDataFn"," */"," this.publish(\"data\", {defaultFn: Y.bind(\"_defDataFn\", this), queuable:true});",""," /**"," * Fired when response is returned."," *"," * @event response"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt>"," * <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Boolean)</dt> <dd>Error flag.</dd>"," * </dl>"," * </dd>"," * <dt>error</dt>"," * <dd>Any error that occurred along the transaction lifecycle.</dd>"," * </dl>"," * @preventable _defResponseFn"," */"," this.publish(\"response\", {defaultFn: Y.bind(\"_defResponseFn\", this), queuable:true});",""," /**"," * Fired when an error is encountered."," *"," * @event error"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt>"," * <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Object)</dt> <dd>Error object.</dd>"," * </dl>"," * </dd>"," * <dt>error</dt>"," * <dd>Any error that occurred along the transaction lifecycle.</dd>"," * </dl>"," */",""," },",""," /**"," * Manages request/response transaction. Must fire <code>response</code>"," * event when response is received. This method should be implemented by"," * subclasses to achieve more complex behavior such as accessing remote data."," *"," * @method _defRequestFn"," * @param e {Event.Facade} Event Facadewith the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * </dl>"," * @protected"," */"," _defRequestFn: function(e) {"," var data = this.get(\"source\"),"," payload = e.details[0];"," "," // Problematic data"," if(LANG.isUndefined(data)) {"," payload.error = new Error(\"Local source undefined\");"," }",""," payload.data = data;"," this.fire(\"data\", payload);"," },",""," /**"," * Normalizes raw data into a response that includes results and meta properties."," *"," * @method _defDataFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * </dl>"," * @protected"," */"," _defDataFn: function(e) {"," var data = e.data,"," meta = e.meta,"," response = {"," results: (LANG.isArray(data)) ? data : [data],"," meta: (meta) ? meta : {}"," },"," payload = e.details[0];",""," payload.response = response;"," this.fire(\"response\", payload);"," },",""," /**"," * Sends data as a normalized response to callback."," *"," * @method _defResponseFn"," * @param e {Event.Facade} Event Facade with the following properties:"," * <dl>"," * <dt>tId (Number)</dt> <dd>Unique transaction ID.</dd>"," * <dt>request (Object)</dt> <dd>The request.</dd>"," * <dt>callback (Object)</dt> <dd>Deprecated alias for the"," * <strong>on</strong> property</dd>"," * <dt>on (Object)</dt> <dd>The map of configured transaction"," * callbacks. An object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * </dd>"," * <dt>cfg (Object)</dt> <dd>Configuration object.</dd>"," * <dt>data (Object)</dt> <dd>Raw data.</dd>"," * <dt>response (Object)</dt> <dd>Normalized response object with the following properties:"," * <dl>"," * <dt>results (Object)</dt> <dd>Parsed results.</dd>"," * <dt>meta (Object)</dt> <dd>Parsed meta data.</dd>"," * <dt>error (Boolean)</dt> <dd>Error flag.</dd>"," * </dl>"," * </dd>"," * </dl>"," * @protected"," */"," _defResponseFn: function(e) {"," // Send the response back to the callback"," DSLocal.issueCallback(e, this);"," },"," "," /**"," * Generates a unique transaction ID and fires <code>request</code> event."," * <strong>Note</strong>: the property <code>callback</code> is a"," * deprecated alias for the <code>on</code> transaction configuration"," * property described below."," *"," * @method sendRequest"," * @param [request] {Object} An object literal with the following properties:"," * <dl>"," * <dt><code>request</code></dt>"," * <dd>The request to send to the live data source, if any.</dd>"," * <dt><code>on</code></dt>"," * <dd>An object literal with the following properties:"," * <dl>"," * <dt><code>success</code></dt>"," * <dd>The function to call when the data is ready.</dd>"," * <dt><code>failure</code></dt>"," * <dd>The function to call upon a response failure condition.</dd>"," * <dt><code>argument</code></dt>"," * <dd>Arbitrary data payload that will be passed back to the success and failure handlers.</dd>"," * </dl>"," * </dd>"," * <dt><code>cfg</code></dt>"," * <dd>Configuration object, if any.</dd>"," * </dl>"," * @return {Number} Transaction ID."," */"," sendRequest: function(request) {"," var tId = DSLocal._tId++,"," callbacks;",""," request = request || {};",""," callbacks = request.on || request.callback;",""," this.fire(\"request\", {"," tId: tId,"," request: request.request,"," on: callbacks,"," callback: callbacks,"," cfg: request.cfg || {}"," });","",""," return tId;"," }","});"," ","Y.namespace(\"DataSource\").Local = DSLocal;","","","}, '3.7.3', {\"requires\": [\"base\"]});"]; _yuitest_coverage["build/datasource-local/datasource-local.js"].lines = {"1":0,"26":0,"29":0,"37":0,"96":0,"100":0,"102":0,"103":0,"104":0,"107":0,"109":0,"114":0,"123":0,"148":0,"172":0,"206":0,"266":0,"270":0,"271":0,"274":0,"275":0,"301":0,"309":0,"310":0,"344":0,"375":0,"378":0,"380":0,"382":0,"391":0,"395":0}; _yuitest_coverage["build/datasource-local/datasource-local.js"].functions = {"DSLocal:28":0,"issueCallback:95":0,"initializer:122":0,"_initEvents:131":0,"_defRequestFn:265":0,"_defDataFn:300":0,"_defResponseFn:342":0,"sendRequest:374":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-local/datasource-local.js"].coveredLines = 31;@@ -474,4 +474,4 @@ Y.namespace("DataSource").Local = DSLocal; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/datasource-local/datasource-local-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -405,4 +405,4 @@ Y.namespace("DataSource").Local = DSLocal; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/datasource-local/datasource-local-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-local",function(e,t){var n=e.Lang,r=function(){r.superclass.constructor.apply(this,arguments)};e.mix(r,{NAME:"dataSourceLocal",ATTRS:{source:{value:null}},_tId:0,transactions:{},issueCallback:function(e,t){var n=e.on||e.callback,r=n&&n.success,i=e.details[0];i.error=e.error||e.response.error,i.error&&(t.fire("error",i),r=n&&n.failure),r&&r(i)}}),e.extend(r,e.Base,{initializer:function(e){this._initEvents()},_initEvents:function(){this.publish("request",{defaultFn:e.bind("_defRequestFn",this),queuable:!0}),this.publish("data",{defaultFn:e.bind("_defDataFn",this),queuable:!0}),this.publish("response",{defaultFn:e.bind("_defResponseFn",this),queuable:!0})},_defRequestFn:function(e){var t=this.get("source"),r=e.details[0];n.isUndefined(t)&&(r.error=new Error("Local source undefined")),r.data=t,this.fire("data",r)},_defDataFn:function(e){var t=e.data,r=e.meta,i={results:n.isArray(t)?t:[t],meta:r?r:{}},s=e.details[0];s.response=i,this.fire("response",s)},_defResponseFn:function(e){r.issueCallback(e,this)},sendRequest:function(e){var t=r._tId++,n;return e=e||{},n=e.on||e.callback,this.fire("request",{tId:t,request:e.request,on:n,callback:n,cfg:e.cfg||{}}),t}}),e.namespace("DataSource").Local=r},"3.7.2",{requires:["base"]});+YUI.add("datasource-local",function(e,t){var n=e.Lang,r=function(){r.superclass.constructor.apply(this,arguments)};e.mix(r,{NAME:"dataSourceLocal",ATTRS:{source:{value:null}},_tId:0,transactions:{},issueCallback:function(e,t){var n=e.on||e.callback,r=n&&n.success,i=e.details[0];i.error=e.error||e.response.error,i.error&&(t.fire("error",i),r=n&&n.failure),r&&r(i)}}),e.extend(r,e.Base,{initializer:function(e){this._initEvents()},_initEvents:function(){this.publish("request",{defaultFn:e.bind("_defRequestFn",this),queuable:!0}),this.publish("data",{defaultFn:e.bind("_defDataFn",this),queuable:!0}),this.publish("response",{defaultFn:e.bind("_defResponseFn",this),queuable:!0})},_defRequestFn:function(e){var t=this.get("source"),r=e.details[0];n.isUndefined(t)&&(r.error=new Error("Local source undefined")),r.data=t,this.fire("data",r)},_defDataFn:function(e){var t=e.data,r=e.meta,i={results:n.isArray(t)?t:[t],meta:r?r:{}},s=e.details[0];s.response=i,this.fire("response",s)},_defResponseFn:function(e){r.issueCallback(e,this)},sendRequest:function(e){var t=r._tId++,n;return e=e||{},n=e.on||e.callback,this.fire("request",{tId:t,request:e.request,on:n,callback:n,cfg:e.cfg||{}}),t}}),e.namespace("DataSource").Local=r},"3.7.3",{requires:["base"]});
bundle/datasource-local/datasource-local.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -401,4 +401,4 @@ Y.namespace("DataSource").Local = DSLocal; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/datasource-polling/datasource-polling-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-polling/datasource-polling.js", code: [] };-_yuitest_coverage["build/datasource-polling/datasource-polling.js"].code=["YUI.add('datasource-polling', function (Y, NAME) {","","/**"," * Extends DataSource with polling functionality."," *"," * @module datasource"," * @submodule datasource-polling"," */"," ","/**"," * Adds polling to the DataSource Utility."," * @class Pollable"," * @extends DataSource.Local"," */ ","function Pollable() {"," this._intervals = {};","}","","Pollable.prototype = {",""," /**"," * @property _intervals"," * @description Hash of polling interval IDs that have been enabled,"," * stored here to be able to clear all intervals."," * @private"," */"," _intervals: null,",""," /**"," * Sets up a polling mechanism to send requests at set intervals and"," * forward responses to given callback."," *"," * @method setInterval"," * @param msec {Number} Length of interval in milliseconds."," * @param [request] {Object} An object literal with the following properties:"," * <dl>"," * <dt><code>request</code></dt>"," * <dd>The request to send to the live data source, if any.</dd>"," * <dt><code>callback</code></dt>"," * <dd>An object literal with the following properties:"," * <dl>"," * <dt><code>success</code></dt>"," * <dd>The function to call when the data is ready.</dd>"," * <dt><code>failure</code></dt>"," * <dd>The function to call upon a response failure condition.</dd>"," * <dt><code>argument</code></dt>"," * <dd>Arbitrary data payload that will be passed back to the success and failure handlers.</dd>"," * </dl>"," * </dd>"," * <dt><code>cfg</code></dt>"," * <dd>Configuration object, if any.</dd>"," * </dl>"," * @return {Number} Interval ID."," */"," setInterval: function(msec, request) {"," var x = Y.later(msec, this, this.sendRequest, [ request ], true);"," this._intervals[x.id] = x;"," // First call happens immediately, but async"," Y.later(0, this, this.sendRequest, [request]);"," return x.id;"," },",""," /**"," * Disables polling mechanism associated with the given interval ID."," *"," * @method clearInterval"," * @param id {Number} Interval ID."," */"," clearInterval: function(id, key) {"," // In case of being called by clearAllIntervals()"," id = key || id;"," if(this._intervals[id]) {"," // Clear the interval"," this._intervals[id].cancel();"," // Clear from tracker"," delete this._intervals[id];"," }"," },",""," /**"," * Clears all intervals."," *"," * @method clearAllIntervals"," */"," clearAllIntervals: function() {"," Y.each(this._intervals, this.clearInterval, this);"," }","};"," ","Y.augment(Y.DataSource.Local, Pollable);","","","}, '3.7.2', {\"requires\": [\"datasource-local\"]});"];+_yuitest_coverage["build/datasource-polling/datasource-polling.js"].code=["YUI.add('datasource-polling', function (Y, NAME) {","","/**"," * Extends DataSource with polling functionality."," *"," * @module datasource"," * @submodule datasource-polling"," */"," ","/**"," * Adds polling to the DataSource Utility."," * @class Pollable"," * @extends DataSource.Local"," */ ","function Pollable() {"," this._intervals = {};","}","","Pollable.prototype = {",""," /**"," * @property _intervals"," * @description Hash of polling interval IDs that have been enabled,"," * stored here to be able to clear all intervals."," * @private"," */"," _intervals: null,",""," /**"," * Sets up a polling mechanism to send requests at set intervals and"," * forward responses to given callback."," *"," * @method setInterval"," * @param msec {Number} Length of interval in milliseconds."," * @param [request] {Object} An object literal with the following properties:"," * <dl>"," * <dt><code>request</code></dt>"," * <dd>The request to send to the live data source, if any.</dd>"," * <dt><code>callback</code></dt>"," * <dd>An object literal with the following properties:"," * <dl>"," * <dt><code>success</code></dt>"," * <dd>The function to call when the data is ready.</dd>"," * <dt><code>failure</code></dt>"," * <dd>The function to call upon a response failure condition.</dd>"," * <dt><code>argument</code></dt>"," * <dd>Arbitrary data payload that will be passed back to the success and failure handlers.</dd>"," * </dl>"," * </dd>"," * <dt><code>cfg</code></dt>"," * <dd>Configuration object, if any.</dd>"," * </dl>"," * @return {Number} Interval ID."," */"," setInterval: function(msec, request) {"," var x = Y.later(msec, this, this.sendRequest, [ request ], true);"," this._intervals[x.id] = x;"," // First call happens immediately, but async"," Y.later(0, this, this.sendRequest, [request]);"," return x.id;"," },",""," /**"," * Disables polling mechanism associated with the given interval ID."," *"," * @method clearInterval"," * @param id {Number} Interval ID."," */"," clearInterval: function(id, key) {"," // In case of being called by clearAllIntervals()"," id = key || id;"," if(this._intervals[id]) {"," // Clear the interval"," this._intervals[id].cancel();"," // Clear from tracker"," delete this._intervals[id];"," }"," },",""," /**"," * Clears all intervals."," *"," * @method clearAllIntervals"," */"," clearAllIntervals: function() {"," Y.each(this._intervals, this.clearInterval, this);"," }","};"," ","Y.augment(Y.DataSource.Local, Pollable);","","","}, '3.7.3', {\"requires\": [\"datasource-local\"]});"]; _yuitest_coverage["build/datasource-polling/datasource-polling.js"].lines = {"1":0,"15":0,"16":0,"19":0,"56":0,"57":0,"59":0,"60":0,"71":0,"72":0,"74":0,"76":0,"86":0,"90":0}; _yuitest_coverage["build/datasource-polling/datasource-polling.js"].functions = {"Pollable:15":0,"setInterval:55":0,"clearInterval:69":0,"clearAllIntervals:85":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-polling/datasource-polling.js"].coveredLines = 14;@@ -148,4 +148,4 @@ Y.augment(Y.DataSource.Local, Pollable); -}, '3.7.2', {"requires": ["datasource-local"]});+}, '3.7.3', {"requires": ["datasource-local"]});
bundle/datasource-polling/datasource-polling-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -96,4 +96,4 @@ Y.augment(Y.DataSource.Local, Pollable); -}, '3.7.2', {"requires": ["datasource-local"]});+}, '3.7.3', {"requires": ["datasource-local"]});
bundle/datasource-polling/datasource-polling-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-polling",function(e,t){function n(){this._intervals={}}n.prototype={_intervals:null,setInterval:function(t,n){var r=e.later(t,this,this.sendRequest,[n],!0);return this._intervals[r.id]=r,e.later(0,this,this.sendRequest,[n]),r.id},clearInterval:function(e,t){e=t||e,this._intervals[e]&&(this._intervals[e].cancel(),delete this._intervals[e])},clearAllIntervals:function(){e.each(this._intervals,this.clearInterval,this)}},e.augment(e.DataSource.Local,n)},"3.7.2",{requires:["datasource-local"]});+YUI.add("datasource-polling",function(e,t){function n(){this._intervals={}}n.prototype={_intervals:null,setInterval:function(t,n){var r=e.later(t,this,this.sendRequest,[n],!0);return this._intervals[r.id]=r,e.later(0,this,this.sendRequest,[n]),r.id},clearInterval:function(e,t){e=t||e,this._intervals[e]&&(this._intervals[e].cancel(),delete this._intervals[e])},clearAllIntervals:function(){e.each(this._intervals,this.clearInterval,this)}},e.augment(e.DataSource.Local,n)},"3.7.3",{requires:["datasource-local"]});
bundle/datasource-polling/datasource-polling.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -96,4 +96,4 @@ Y.augment(Y.DataSource.Local, Pollable); -}, '3.7.2', {"requires": ["datasource-local"]});+}, '3.7.3', {"requires": ["datasource-local"]});
bundle/datasource-textschema/datasource-textschema-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-textschema/datasource-textschema.js", code: [] };-_yuitest_coverage["build/datasource-textschema/datasource-textschema.js"].code=["YUI.add('datasource-textschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on text data."," *"," * @module datasource"," * @submodule datasource-textschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceTextSchema"," * @extends Plugin.Base"," */ ","var DataSourceTextSchema = function() {"," DataSourceTextSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceTextSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceTextSchema\""," */"," NAME: \"dataSourceTextSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceTextSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceTextSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var schema = this.get('schema'),"," payload = e.details[0],"," // TODO: Do I need to sniff for DS.IO + isString(responseText)?"," data = e.data.responseText || e.data;",""," payload.response = Y.DataSchema.Text.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceTextSchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceTextSchema = DataSourceTextSchema;","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-text\"]});"];+_yuitest_coverage["build/datasource-textschema/datasource-textschema.js"].code=["YUI.add('datasource-textschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on text data."," *"," * @module datasource"," * @submodule datasource-textschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceTextSchema"," * @extends Plugin.Base"," */ ","var DataSourceTextSchema = function() {"," DataSourceTextSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceTextSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceTextSchema\""," */"," NAME: \"dataSourceTextSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceTextSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceTextSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var schema = this.get('schema'),"," payload = e.details[0],"," // TODO: Do I need to sniff for DS.IO + isString(responseText)?"," data = e.data.responseText || e.data;",""," payload.response = Y.DataSchema.Text.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceTextSchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceTextSchema = DataSourceTextSchema;","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-text\"]});"]; _yuitest_coverage["build/datasource-textschema/datasource-textschema.js"].lines = {"1":0,"15":0,"16":0,"19":0,"56":0,"65":0,"83":0,"88":0,"93":0,"95":0,"99":0}; _yuitest_coverage["build/datasource-textschema/datasource-textschema.js"].functions = {"DataSourceTextSchema:15":0,"initializer:64":0,"_beforeDefDataFn:82":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-textschema/datasource-textschema.js"].coveredLines = 11;@@ -153,4 +153,4 @@ Y.namespace('Plugin').DataSourceTextSchema = DataSourceTextSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-text"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-text"]});
bundle/datasource-textschema/datasource-textschema-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -105,4 +105,4 @@ Y.namespace('Plugin').DataSourceTextSchema = DataSourceTextSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-text"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-text"]});
bundle/datasource-textschema/datasource-textschema-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-textschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceTextSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=this.get("schema"),r=t.details[0],i=t.data.responseText||t.data;return r.response=e.DataSchema.Text.apply.call(this,n,i)||{meta:{},results:i},this.get("host").fire("response",r),new e.Do.Halt("DataSourceTextSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceTextSchema=n},"3.7.2",{requires:["datasource-local","plugin","dataschema-text"]});+YUI.add("datasource-textschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceTextSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=this.get("schema"),r=t.details[0],i=t.data.responseText||t.data;return r.response=e.DataSchema.Text.apply.call(this,n,i)||{meta:{},results:i},this.get("host").fire("response",r),new e.Do.Halt("DataSourceTextSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceTextSchema=n},"3.7.3",{requires:["datasource-local","plugin","dataschema-text"]});
bundle/datasource-textschema/datasource-textschema.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -105,4 +105,4 @@ Y.namespace('Plugin').DataSourceTextSchema = DataSourceTextSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-text"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "dataschema-text"]});
bundle/datasource-xmlschema/datasource-xmlschema-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datasource-xmlschema/datasource-xmlschema.js", code: [] };-_yuitest_coverage["build/datasource-xmlschema/datasource-xmlschema.js"].code=["YUI.add('datasource-xmlschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on XML data."," *"," * @module datasource"," * @submodule datasource-xmlschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceXMLSchema"," * @extends Plugin.Base"," */ ","var DataSourceXMLSchema = function() {"," DataSourceXMLSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceXMLSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceXMLSchema\""," */"," NAME: \"dataSourceXMLSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceXMLSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceXMLSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var schema = this.get('schema'),"," payload = e.details[0],"," // TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?"," data = e.data.responseXML || e.data;",""," payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceXMLSchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema;","","","}, '3.7.2', {\"requires\": [\"datasource-local\", \"plugin\", \"dataschema-xml\"]});"];+_yuitest_coverage["build/datasource-xmlschema/datasource-xmlschema.js"].code=["YUI.add('datasource-xmlschema', function (Y, NAME) {","","/**"," * Extends DataSource with schema-parsing on XML data."," *"," * @module datasource"," * @submodule datasource-xmlschema"," */","","/**"," * Adds schema-parsing to the DataSource Utility."," * @class DataSourceXMLSchema"," * @extends Plugin.Base"," */ ","var DataSourceXMLSchema = function() {"," DataSourceXMLSchema.superclass.constructor.apply(this, arguments);","};","","Y.mix(DataSourceXMLSchema, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"schema\""," */"," NS: \"schema\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataSourceXMLSchema\""," */"," NAME: \"dataSourceXMLSchema\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // DataSourceXMLSchema Attributes"," //"," /////////////////////////////////////////////////////////////////////////////",""," ATTRS: {"," schema: {"," //value: {}"," }"," }","});","","Y.extend(DataSourceXMLSchema, Y.Plugin.Base, {"," /**"," * Internal init() handler."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," this.doBefore(\"_defDataFn\", this._beforeDefDataFn);"," },",""," /**"," * Parses raw data into a normalized response."," *"," * @method _beforeDefDataFn"," * @param tId {Number} Unique transaction ID."," * @param request {Object} The request."," * @param callback {Object} The callback object with the following properties:"," * <dl>"," * <dt>success (Function)</dt> <dd>Success handler.</dd>"," * <dt>failure (Function)</dt> <dd>Failure handler.</dd>"," * </dl>"," * @param data {Object} Raw data."," * @protected"," */"," _beforeDefDataFn: function(e) {"," var schema = this.get('schema'),"," payload = e.details[0],"," // TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?"," data = Y.XML.parse(e.data.responseText) || e.data;",""," payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || {"," meta: {},"," results: data"," };",""," this.get(\"host\").fire(\"response\", payload);",""," return new Y.Do.Halt(\"DataSourceXMLSchema plugin halted _defDataFn\");"," }","});"," ","Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema;","","","}, '3.7.3', {\"requires\": [\"datasource-local\", \"plugin\", \"datatype-xml\", \"dataschema-xml\"]});"]; _yuitest_coverage["build/datasource-xmlschema/datasource-xmlschema.js"].lines = {"1":0,"15":0,"16":0,"19":0,"56":0,"65":0,"83":0,"88":0,"93":0,"95":0,"99":0}; _yuitest_coverage["build/datasource-xmlschema/datasource-xmlschema.js"].functions = {"DataSourceXMLSchema:15":0,"initializer:64":0,"_beforeDefDataFn:82":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datasource-xmlschema/datasource-xmlschema.js"].coveredLines = 11;@@ -133,7 +133,7 @@ var schema = this.get('schema'), payload = e.details[0], // TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?- data = e.data.responseXML || e.data;+ data = Y.XML.parse(e.data.responseText) || e.data; _yuitest_coverline("build/datasource-xmlschema/datasource-xmlschema.js", 88); payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || {@@ -153,4 +153,4 @@ Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-xml"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "datatype-xml", "dataschema-xml"]});
bundle/datasource-xmlschema/datasource-xmlschema-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -89,7 +89,7 @@ var schema = this.get('schema'), payload = e.details[0], // TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?- data = e.data.responseXML || e.data;+ data = Y.XML.parse(e.data.responseText) || e.data; payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || { meta: {},@@ -105,4 +105,4 @@ Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-xml"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "datatype-xml", "dataschema-xml"]});
bundle/datasource-xmlschema/datasource-xmlschema-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datasource-xmlschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceXMLSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=this.get("schema"),r=t.details[0],i=t.data.responseXML||t.data;return r.response=e.DataSchema.XML.apply.call(this,n,i)||{meta:{},results:i},this.get("host").fire("response",r),new e.Do.Halt("DataSourceXMLSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceXMLSchema=n},"3.7.2",{requires:["datasource-local","plugin","dataschema-xml"]});+YUI.add("datasource-xmlschema",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.mix(n,{NS:"schema",NAME:"dataSourceXMLSchema",ATTRS:{schema:{}}}),e.extend(n,e.Plugin.Base,{initializer:function(e){this.doBefore("_defDataFn",this._beforeDefDataFn)},_beforeDefDataFn:function(t){var n=this.get("schema"),r=t.details[0],i=e.XML.parse(t.data.responseText)||t.data;return r.response=e.DataSchema.XML.apply.call(this,n,i)||{meta:{},results:i},this.get("host").fire("response",r),new e.Do.Halt("DataSourceXMLSchema plugin halted _defDataFn")}}),e.namespace("Plugin").DataSourceXMLSchema=n},"3.7.3",{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]});
bundle/datasource-xmlschema/datasource-xmlschema.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -89,7 +89,7 @@ var schema = this.get('schema'), payload = e.details[0], // TODO: Do I need to sniff for DS.IO + responseXML.nodeType 9?- data = e.data.responseXML || e.data;+ data = Y.XML.parse(e.data.responseText) || e.data; payload.response = Y.DataSchema.XML.apply.call(this, schema, data) || { meta: {},@@ -105,4 +105,4 @@ Y.namespace('Plugin').DataSourceXMLSchema = DataSourceXMLSchema; -}, '3.7.2', {"requires": ["datasource-local", "plugin", "dataschema-xml"]});+}, '3.7.3', {"requires": ["datasource-local", "plugin", "datatype-xml", "dataschema-xml"]});
bundle/datatable-base-deprecated/assets/datatable-base-deprecated-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base-deprecated/assets/skins/night/datatable-base-deprecated-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base-deprecated/assets/skins/night/datatable-base-deprecated.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base-deprecated/assets/skins/sam/datatable-base-deprecated-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base-deprecated/assets/skins/sam/datatable-base-deprecated.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base-deprecated/datatable-base-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/datatable-base-deprecated/datatable-base-deprecated.js", code: [] };-_yuitest_coverage["/build/datatable-base-deprecated/datatable-base-deprecated.js"].code=["YUI.add('datatable-base-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","var YLang = Y.Lang,"," YisValue = YLang.isValue,"," fromTemplate = Y.Lang.sub,"," YNode = Y.Node,"," Ycreate = YNode.create,"," YgetClassName = Y.ClassNameManager.getClassName,",""," DATATABLE = \"datatable\","," COLUMN = \"column\","," "," FOCUS = \"focus\","," KEYDOWN = \"keydown\","," MOUSEENTER = \"mouseenter\","," MOUSELEAVE = \"mouseleave\","," MOUSEUP = \"mouseup\","," MOUSEDOWN = \"mousedown\","," CLICK = \"click\","," DBLCLICK = \"dblclick\",",""," CLASS_COLUMNS = YgetClassName(DATATABLE, \"columns\"),"," CLASS_DATA = YgetClassName(DATATABLE, \"data\"),"," CLASS_MSG = YgetClassName(DATATABLE, \"msg\"),"," CLASS_LINER = YgetClassName(DATATABLE, \"liner\"),"," CLASS_FIRST = YgetClassName(DATATABLE, \"first\"),"," CLASS_LAST = YgetClassName(DATATABLE, \"last\"),"," CLASS_EVEN = YgetClassName(DATATABLE, \"even\"),"," CLASS_ODD = YgetClassName(DATATABLE, \"odd\"),",""," TEMPLATE_TABLE = '<table></table>',"," TEMPLATE_COL = '<col></col>',"," TEMPLATE_THEAD = '<thead class=\"'+CLASS_COLUMNS+'\"></thead>',"," TEMPLATE_TBODY = '<tbody class=\"'+CLASS_DATA+'\"></tbody>',"," TEMPLATE_TH = '<th id=\"{id}\" rowspan=\"{rowspan}\" colspan=\"{colspan}\" class=\"{classnames}\" abbr=\"{abbr}\"><div class=\"'+CLASS_LINER+'\">{value}</div></th>',"," TEMPLATE_TR = '<tr id=\"{id}\"></tr>',"," TEMPLATE_TD = '<td headers=\"{headers}\" class=\"{classnames}\"><div class=\"'+CLASS_LINER+'\">{value}</div></td>',"," TEMPLATE_VALUE = '{value}',"," TEMPLATE_MSG = '<tbody class=\"'+CLASS_MSG+'\"></tbody>';"," ","","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/*"," * The Column class defines and manages attributes of Columns for DataTable."," *"," * @class Column"," * @extends Widget"," * @constructor"," */","function Column(config) {"," Column.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(Column, {"," /*"," * Class name."," *"," * @property NAME"," * @type {String}"," * @static"," * @final"," * @value \"column\""," */"," NAME: \"column\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," Unique internal identifier, used to stamp ID on TH element."," "," @attribute id"," @type {String}"," @readOnly"," **/"," id: {"," valueFn: \"_defaultId\","," readOnly: true"," },"," "," /*"," User-supplied identifier. Defaults to id."," @attribute key"," @type {String}"," **/"," key: {"," valueFn: \"_defaultKey\""," },",""," /*"," Points to underlying data field (for sorting or formatting, for"," example). Useful when column doesn't hold any data itself, but is just"," a visual representation of data from another column or record field."," Defaults to key.",""," @attribute field"," @type {String}"," @default (column key)"," **/"," field: {"," valueFn: \"_defaultField\""," },",""," /*"," Display label for column header. Defaults to key.",""," @attribute label"," @type {String}"," **/"," label: {"," valueFn: \"_defaultLabel\""," },"," "," /*"," Array of child column definitions (for nested headers).",""," @attribute children"," @type {String}"," @default null"," **/"," children: {"," value: null"," },"," "," /*"," TH abbr attribute.",""," @attribute abbr"," @type {String}"," @default \"\""," **/"," abbr: {"," value: \"\""," },",""," //TODO: support custom classnames"," // TH CSS classnames"," classnames: {"," readOnly: true,"," getter: \"_getClassnames\""," },"," "," /*"," Formating template string or function for cells in this column.",""," Function formatters receive a single object (described below) and are"," expected to output the `innerHTML` of the cell.",""," String templates can include markup and {placeholder} tokens to be"," filled in from the object passed to function formatters.",""," @attribute formatter"," @type {String|Function}"," @param {Object} data Data relevant to the rendering of this cell"," @param {String} data.classnames CSS classes to add to the cell"," @param {Column} data.column This Column instance"," @param {Object} data.data The raw object data from the Record"," @param {String} data.field This Column's \"field\" attribute value"," @param {String} data.headers TH ids to reference in the cell's"," \"headers\" attribute"," @param {Record} data.record The Record instance for this row"," @param {Number} data.rowindex The index for this row"," @param {Node} data.tbody The TBODY Node that will house the cell"," @param {Node} data.tr The row TR Node that will house the cell"," @param {Any} data.value The raw Record data for this cell"," **/"," formatter: {},",""," /*"," The default markup to display in cells that have no corresponding record"," data or content from formatters.",""," @attribute emptyCellValue"," @type {String}"," @default ''"," **/"," emptyCellValue: {"," value: '',"," validator: Y.Lang.isString"," },",""," //requires datatable-sort"," sortable: {"," value: false"," },"," //sortOptions:defaultDir, sortFn, field",""," //TODO: support editable columns"," // Column editor"," editor: {},",""," //TODO: support resizeable columns"," //TODO: support setting widths"," // requires datatable-colresize"," width: {},"," resizeable: {},"," minimized: {},"," minWidth: {},"," maxAutoWidth: {}"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(Column, Y.Widget, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Return ID for instance."," *"," * @method _defaultId"," * @return {String}"," * @private"," */"," _defaultId: function() {"," return Y.guid();"," },",""," /*"," * Return key for instance. Defaults to ID if one was not provided."," *"," * @method _defaultKey"," * @return {String}"," * @private"," */"," _defaultKey: function() {"," return Y.guid();"," },",""," /*"," * Return field for instance. Defaults to key if one was not provided."," *"," * @method _defaultField"," * @return {String}"," * @private"," */"," _defaultField: function() {"," return this.get(\"key\");"," },",""," /*"," * Return label for instance. Defaults to key if one was not provided."," *"," * @method _defaultLabel"," * @return {String}"," * @private"," */"," _defaultLabel: function() {"," return this.get(\"key\");"," },",""," /*"," * Updates the UI if changes are made to abbr."," *"," * @method _afterAbbrChange"," * @param e {Event} Custom event for the attribute change."," * @private"," */"," _afterAbbrChange: function (e) {"," this._uiSetAbbr(e.newVal);"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // PROPERTIES"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Reference to Column's current position index within its Columnset's keys"," * array, if applicable. This property only applies to non-nested and bottom-"," * level child Columns. Value is set by Columnset code."," *"," * @property keyIndex"," * @type {Number}"," */"," keyIndex: null,"," "," /*"," * Array of TH IDs associated with this column, for TD \"headers\" attribute."," * Value is set by Columnset code"," *"," * @property headers"," * @type {String[]}"," */"," headers: null,",""," /*"," * Number of cells the header spans. Value is set by Columnset code."," *"," * @property colSpan"," * @type {Number}"," * @default 1"," */"," colSpan: 1,"," "," /*"," * Number of rows the header spans. Value is set by Columnset code."," *"," * @property rowSpan"," * @type {Number}"," * @default 1"," */"," rowSpan: 1,",""," /*"," * Column's parent Column instance, if applicable. Value is set by Columnset"," * code."," *"," * @property parent"," * @type {Column}"," */"," parent: null,",""," /*"," * The Node reference to the associated TH element."," *"," * @property thNode"," * @type {Node}"," */"," "," thNode: null,",""," /*TODO"," * The Node reference to the associated liner element."," *"," * @property thLinerNode"," * @type {Node}"," "," thLinerNode: null,*/"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," },",""," /*"," * Destructor."," *"," * @method destructor"," * @private"," */"," destructor: function() {"," },",""," /*"," * Returns classnames for Column."," *"," * @method _getClassnames"," * @private"," */"," _getClassnames: function () {"," return Y.ClassNameManager.getClassName(COLUMN, this.get(\"key\").replace(/[^\\w\\-]/g,\"\"));"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // SYNC"," //"," ////////////////////////////////////////////////////////////////////////////"," /*"," * Syncs UI to intial state."," *"," * @method syncUI"," * @private"," */"," syncUI: function() {"," this._uiSetAbbr(this.get(\"abbr\"));"," },",""," /*"," * Updates abbr."," *"," * @method _uiSetAbbr"," * @param val {String} New abbr."," * @protected"," */"," _uiSetAbbr: function(val) {"," this.thNode.set(\"abbr\", val);"," }","});","","Y.Column = Column;","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/*"," * The Columnset class defines and manages a collection of Columns."," *"," * @class Columnset"," * @extends Base"," * @constructor"," */","function Columnset(config) {"," Columnset.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(Columnset, {"," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"columnset\""," */"," NAME: \"columnset\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTES"," //"," /////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute definitions"," * @description Array of column definitions that will populate this Columnset."," * @type Array"," */"," definitions: {"," setter: \"_setDefinitions\""," }",""," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(Columnset, Y.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * @method _setDefinitions"," * @description Clones definitions before setting."," * @param definitions {Array} Array of column definitions."," * @return Array"," * @private"," */"," _setDefinitions: function(definitions) {"," return Y.clone(definitions);"," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // PROPERTIES"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Top-down tree representation of Column hierarchy. Used to create DOM"," * elements."," *"," * @property tree"," * @type {Column[]}"," */"," tree: null,",""," /*"," * Hash of all Columns by ID."," *"," * @property idHash"," * @type Object"," */"," idHash: null,",""," /*"," * Hash of all Columns by key."," *"," * @property keyHash"," * @type Object"," */"," keyHash: null,",""," /*"," * Array of only Columns that are meant to be displayed in DOM."," *"," * @property keys"," * @type {Column[]}"," */"," keys: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer. Generates all internal representations of the collection of"," * Columns."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function() {",""," // DOM tree representation of all Columns"," var tree = [],"," // Hash of all Columns by ID"," idHash = {},"," // Hash of all Columns by key"," keyHash = {},"," // Flat representation of only Columns that are meant to display data"," keys = [],"," // Original definitions"," definitions = this.get(\"definitions\"),",""," self = this;",""," // Internal recursive function to define Column instances"," function parseColumns(depth, currentDefinitions, parent) {"," var i=0,"," len = currentDefinitions.length,"," currentDefinition,"," column,"," currentChildren;",""," // One level down"," depth++;",""," // Create corresponding dom node if not already there for this depth"," if(!tree[depth]) {"," tree[depth] = [];"," }",""," // Parse each node at this depth for attributes and any children"," for(; i<len; ++i) {"," currentDefinition = currentDefinitions[i];",""," currentDefinition = YLang.isString(currentDefinition) ? {key:currentDefinition} : currentDefinition;",""," // Instantiate a new Column for each node"," column = new Y.Column(currentDefinition);",""," // Cross-reference Column ID back to the original object literal definition"," currentDefinition.yuiColumnId = column.get(\"id\");",""," // Add the new Column to the hash"," idHash[column.get(\"id\")] = column;"," keyHash[column.get(\"key\")] = column;",""," // Assign its parent as an attribute, if applicable"," if(parent) {"," column.parent = parent;"," }",""," // The Column has descendants"," if(YLang.isArray(currentDefinition.children)) {"," currentChildren = currentDefinition.children;"," column._set(\"children\", currentChildren);",""," self._setColSpans(column, currentDefinition);",""," self._cascadePropertiesToChildren(column, currentChildren);",""," // The children themselves must also be parsed for Column instances"," if(!tree[depth+1]) {"," tree[depth+1] = [];"," }"," parseColumns(depth, currentChildren, column);"," }"," // This Column does not have any children"," else {"," column.keyIndex = keys.length;"," // Default is already 1"," //column.colSpan = 1;"," keys.push(column);"," }",""," // Add the Column to the top-down dom tree"," tree[depth].push(column);"," }"," depth--;"," }",""," // Parse out Column instances from the array of object literals"," parseColumns(-1, definitions);","",""," // Save to the Columnset instance"," this.tree = tree;"," this.idHash = idHash;"," this.keyHash = keyHash;"," this.keys = keys;",""," this._setRowSpans();"," this._setHeaders();"," },",""," /*"," * Destructor."," *"," * @method destructor"," * @private"," */"," destructor: function() {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // COLUMN HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Cascade certain properties to children if not defined on their own."," *"," * @method _cascadePropertiesToChildren"," * @private"," */"," _cascadePropertiesToChildren: function(column, currentChildren) {"," //TODO: this is all a giant todo"," var i = 0,"," len = currentChildren.length,"," child;",""," // Cascade certain properties to children if not defined on their own"," for(; i<len; ++i) {"," child = currentChildren[i];"," if(column.get(\"className\") && (child.className === undefined)) {"," child.className = column.get(\"className\");"," }"," if(column.get(\"editor\") && (child.editor === undefined)) {"," child.editor = column.get(\"editor\");"," }"," if(column.get(\"formatter\") && (child.formatter === undefined)) {"," child.formatter = column.get(\"formatter\");"," }"," if(column.get(\"resizeable\") && (child.resizeable === undefined)) {"," child.resizeable = column.get(\"resizeable\");"," }"," if(column.get(\"sortable\") && (child.sortable === undefined)) {"," child.sortable = column.get(\"sortable\");"," }"," if(column.get(\"hidden\")) {"," child.hidden = true;"," }"," if(column.get(\"width\") && (child.width === undefined)) {"," child.width = column.get(\"width\");"," }"," if(column.get(\"minWidth\") && (child.minWidth === undefined)) {"," child.minWidth = column.get(\"minWidth\");"," }"," if(column.get(\"maxAutoWidth\") && (child.maxAutoWidth === undefined)) {"," child.maxAutoWidth = column.get(\"maxAutoWidth\");"," }"," }"," },",""," /*"," * @method _setColSpans"," * @description Calculates and sets colSpan attribute on given Column."," * @param column {Array} Column instance."," * @param definition {Object} Column definition."," * @private"," */"," _setColSpans: function(column, definition) {"," // Determine COLSPAN value for this Column"," var terminalChildNodes = 0;",""," function countTerminalChildNodes(ancestor) {"," var descendants = ancestor.children,"," i = 0,"," len = descendants.length;",""," // Drill down each branch and count terminal nodes"," for(; i<len; ++i) {"," // Keep drilling down"," if(YLang.isArray(descendants[i].children)) {"," countTerminalChildNodes(descendants[i]);"," }"," // Reached branch terminus"," else {"," terminalChildNodes++;"," }"," }"," }"," countTerminalChildNodes(definition);"," column.colSpan = terminalChildNodes;"," },",""," /*"," * @method _setRowSpans"," * @description Calculates and sets rowSpan attribute on all Columns."," * @private"," */"," _setRowSpans: function() {"," // Determine ROWSPAN value for each Column in the DOM tree"," function parseDomTreeForRowSpan(tree) {"," var maxRowDepth = 1,"," currentRow,"," currentColumn,"," m,p;",""," // Calculate the max depth of descendants for this row"," function countMaxRowDepth(row, tmpRowDepth) {"," tmpRowDepth = tmpRowDepth || 1;",""," var i = 0,"," len = row.length,"," col;",""," for(; i<len; ++i) {"," col = row[i];"," // Column has children, so keep counting"," if(YLang.isArray(col.children)) {"," tmpRowDepth++;"," countMaxRowDepth(col.children, tmpRowDepth);"," tmpRowDepth--;"," }"," // Column has children, so keep counting"," else if(col.get && YLang.isArray(col.get(\"children\"))) {"," tmpRowDepth++;"," countMaxRowDepth(col.get(\"children\"), tmpRowDepth);"," tmpRowDepth--;"," }"," // No children, is it the max depth?"," else {"," if(tmpRowDepth > maxRowDepth) {"," maxRowDepth = tmpRowDepth;"," }"," }"," }"," }",""," // Count max row depth for each row"," for(m=0; m<tree.length; m++) {"," currentRow = tree[m];"," countMaxRowDepth(currentRow);",""," // Assign the right ROWSPAN values to each Column in the row"," for(p=0; p<currentRow.length; p++) {"," currentColumn = currentRow[p];"," if(!YLang.isArray(currentColumn.get(\"children\"))) {"," currentColumn.rowSpan = maxRowDepth;"," }"," // Default is already 1"," // else currentColumn.rowSpan =1;"," }",""," // Reset counter for next row"," maxRowDepth = 1;"," }"," }"," parseDomTreeForRowSpan(this.tree);"," },",""," /*"," * @method _setHeaders"," * @description Calculates and sets headers attribute on all Columns."," * @private"," */"," _setHeaders: function() {"," var headers, column,"," allKeys = this.keys,"," i=0, len = allKeys.length;",""," function recurseAncestorsForHeaders(headers, column) {"," headers.push(column.get(\"id\"));"," if(column.parent) {"," recurseAncestorsForHeaders(headers, column.parent);"," }"," }"," for(; i<len; ++i) {"," headers = [];"," column = allKeys[i];"," recurseAncestorsForHeaders(headers, column);"," column.headers = headers.reverse().join(\" \");"," }"," },",""," //TODO"," getColumn: function() {"," }","});","","Y.Columnset = Columnset;","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","The DataTable widget provides a progressively enhanced DHTML control for","displaying tabular data across A-grade browsers.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","corresponds to the 3.4.1 version of DataTable and will be removed from the","library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@main datatable-deprecated","@deprecated","**/","","/**","Provides the base DataTable implementation, which can be extended to add","additional functionality, such as sorting or scrolling.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","corresponds to the 3.4.1 version of DataTable and will be removed from the","library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-base-deprecated","@deprecated","**/","","/*"," * Base class for the DataTable widget."," * @class DataTable.Base"," * @extends Widget"," * @constructor"," */","function DTBase(config) {"," DTBase.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DTBase, {",""," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTable\""," */"," NAME: \"dataTable\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute columnset"," * @description Pointer to Columnset instance."," * @type Array | Y.Columnset"," */"," columnset: {"," setter: \"_setColumnset\""," },",""," /*"," * @attribute recordset"," * @description Pointer to Recordset instance."," * @type Array | Y.Recordset"," */"," recordset: {"," valueFn: '_initRecordset',"," setter: \"_setRecordset\""," },",""," /*TODO"," * @attribute state"," * @description Internal state."," * @readonly"," * @type"," */"," /*state: {"," value: new Y.State(),"," readOnly: true",""," },*/",""," /*"," * @attribute summary"," * @description Summary."," * @type String"," */"," summary: {"," },",""," /*"," * @attribute caption"," * @description Caption"," * @type String"," */"," caption: {"," },",""," /*"," * @attribute thValueTemplate"," * @description Tokenized markup template for TH value."," * @type String"," * @default '{value}'"," */"," thValueTemplate: {"," value: TEMPLATE_VALUE"," },",""," /*"," * @attribute tdValueTemplate"," * @description Tokenized markup template for TD value."," * @type String"," * @default '{value}'"," */"," tdValueTemplate: {"," value: TEMPLATE_VALUE"," },",""," /*"," * @attribute trTemplate"," * @description Tokenized markup template for TR node creation."," * @type String"," * @default '<tr id=\"{id}\"></tr>'"," */"," trTemplate: {"," value: TEMPLATE_TR"," }"," },","","/////////////////////////////////////////////////////////////////////////////","//","// TODO: HTML_PARSER","//","/////////////////////////////////////////////////////////////////////////////"," HTML_PARSER: {"," /*caption: function (srcNode) {"," "," }*/"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DTBase, Y.Widget, {"," /*"," * @property thTemplate"," * @description Tokenized markup template for TH node creation."," * @type String"," * @default '<th id=\"{id}\" rowspan=\"{rowspan}\" colspan=\"{colspan}\" class=\"{classnames}\" abbr=\"{abbr}\"><div class=\"'+CLASS_LINER+'\">{value}</div></th>'"," */"," thTemplate: TEMPLATE_TH,",""," /*"," * @property tdTemplate"," * @description Tokenized markup template for TD node creation."," * @type String"," * @default '<td headers=\"{headers}\" class=\"{classnames}\"><div class=\"yui3-datatable-liner\">{value}</div></td>'"," */"," tdTemplate: TEMPLATE_TD,"," "," /*"," * @property _theadNode"," * @description Pointer to THEAD node."," * @type {Node}"," * @private"," */"," _theadNode: null,"," "," /*"," * @property _tbodyNode"," * @description Pointer to TBODY node."," * @type {Node}"," * @private"," */"," _tbodyNode: null,"," "," /*"," * @property _msgNode"," * @description Pointer to message display node."," * @type {Node}"," * @private"," */"," _msgNode: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * @method _setColumnset"," * @description Converts Array to Y.Columnset."," * @param columns {Array | Y.Columnset}"," * @return {Columnset}"," * @private"," */"," _setColumnset: function(columns) {"," return YLang.isArray(columns) ? new Y.Columnset({definitions:columns}) : columns;"," },",""," /*"," * Updates the UI if Columnset is changed."," *"," * @method _afterColumnsetChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterColumnsetChange: function (e) {"," this._uiSetColumnset(e.newVal);"," },",""," /*"," * @method _setRecordset"," * @description Converts Array to Y.Recordset."," * @param records {Array | Recordset}"," * @return {Recordset}"," * @private"," */"," _setRecordset: function(rs) {"," if(YLang.isArray(rs)) {"," rs = new Y.Recordset({records:rs});"," }",""," rs.addTarget(this);"," return rs;"," },"," "," /*"," * Updates the UI if Recordset is changed."," *"," * @method _afterRecordsetChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterRecordsetChange: function (e) {"," this._uiSetRecordset(e.newVal);"," },",""," /*"," * Updates the UI if Recordset records are changed."," *"," * @method _afterRecordsChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterRecordsChange: function (e) {"," this._uiSetRecordset(this.get('recordset'));"," },",""," /*"," * Updates the UI if summary is changed."," *"," * @method _afterSummaryChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterSummaryChange: function (e) {"," this._uiSetSummary(e.newVal);"," },",""," /*"," * Updates the UI if caption is changed."," *"," * @method _afterCaptionChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterCaptionChange: function (e) {"," this._uiSetCaption(e.newVal);"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Destructor."," *"," * @method destructor"," * @private"," */"," destructor: function() {"," this.get(\"recordset\").removeTarget(this);"," },"," "," ////////////////////////////////////////////////////////////////////////////"," //"," // RENDER"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Renders UI."," *"," * @method renderUI"," * @private"," */"," renderUI: function() {"," // TABLE"," this._addTableNode(this.get(\"contentBox\"));",""," // COLGROUP"," this._addColgroupNode(this._tableNode);",""," // THEAD"," this._addTheadNode(this._tableNode);",""," // Primary TBODY"," this._addTbodyNode(this._tableNode);",""," // Message TBODY"," this._addMessageNode(this._tableNode);",""," // CAPTION"," this._addCaptionNode(this._tableNode);"," },",""," /*"," * Creates and attaches TABLE element to given container."," *"," * @method _addTableNode"," * @param containerNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addTableNode: function(containerNode) {"," if (!this._tableNode) {"," this._tableNode = containerNode.appendChild(Ycreate(TEMPLATE_TABLE));"," }"," return this._tableNode;"," },",""," /*"," * Creates and attaches COLGROUP element to given TABLE."," *"," * @method _addColgroupNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addColgroupNode: function(tableNode) {"," // Add COLs to DOCUMENT FRAGMENT"," var len = this.get(\"columnset\").keys.length,"," i = 0,"," allCols = [\"<colgroup>\"];",""," for(; i<len; ++i) {"," allCols.push(TEMPLATE_COL);"," }",""," allCols.push(\"</colgroup>\");",""," // Create COLGROUP"," this._colgroupNode = tableNode.insertBefore(Ycreate(allCols.join(\"\")), tableNode.get(\"firstChild\"));",""," return this._colgroupNode;"," },",""," /*"," * Creates and attaches THEAD element to given container."," *"," * @method _addTheadNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addTheadNode: function(tableNode) {"," if(tableNode) {"," this._theadNode = tableNode.insertBefore(Ycreate(TEMPLATE_THEAD), this._colgroupNode.next());"," return this._theadNode;"," }"," },",""," /*"," * Creates and attaches TBODY element to given container."," *"," * @method _addTbodyNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addTbodyNode: function(tableNode) {"," this._tbodyNode = tableNode.appendChild(Ycreate(TEMPLATE_TBODY));"," return this._tbodyNode;"," },",""," /*"," * Creates and attaches message display element to given container."," *"," * @method _addMessageNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addMessageNode: function(tableNode) {"," this._msgNode = tableNode.insertBefore(Ycreate(TEMPLATE_MSG), this._tbodyNode);"," return this._msgNode;"," },",""," /*"," * Creates and attaches CAPTION element to given container."," *"," * @method _addCaptionNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addCaptionNode: function(tableNode) {"," this._captionNode = Y.Node.create('<caption></caption>');"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // BIND"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Binds events."," *"," * @method bindUI"," * @private"," */"," bindUI: function() {"," this.after({"," columnsetChange: this._afterColumnsetChange,"," summaryChange : this._afterSummaryChange,"," captionChange : this._afterCaptionChange,"," recordsetChange: this._afterRecordsChange,"," \"recordset:tableChange\": this._afterRecordsChange"," });"," },"," "," delegate: function(type) {"," //TODO: is this necessary?"," if(type===\"dblclick\") {"," this.get(\"boundingBox\").delegate.apply(this.get(\"boundingBox\"), arguments);"," }"," else {"," this.get(\"contentBox\").delegate.apply(this.get(\"contentBox\"), arguments);"," }"," },"," ",""," ////////////////////////////////////////////////////////////////////////////"," //"," // SYNC"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Syncs UI to intial state."," *"," * @method syncUI"," * @private"," */"," syncUI: function() {"," // THEAD ROWS"," this._uiSetColumnset(this.get(\"columnset\"));"," // DATA ROWS"," this._uiSetRecordset(this.get(\"recordset\"));"," // SUMMARY"," this._uiSetSummary(this.get(\"summary\"));"," // CAPTION"," this._uiSetCaption(this.get(\"caption\"));"," },",""," /*"," * Updates summary."," *"," * @method _uiSetSummary"," * @param val {String} New summary."," * @protected"," */"," _uiSetSummary: function(val) {"," val = YisValue(val) ? val : \"\";"," this._tableNode.set(\"summary\", val);"," },",""," /*"," * Updates caption."," *"," * @method _uiSetCaption"," * @param val {String} New caption."," * @protected"," */"," _uiSetCaption: function(val) {"," var caption = this._captionNode,"," inDoc = caption.inDoc(),"," method = val ? (!inDoc && 'prepend') : (inDoc && 'removeChild');",""," caption.setContent(val || '');",""," if (method) {"," // prepend of remove necessary"," this._tableNode[method](caption);"," }"," },","",""," ////////////////////////////////////////////////////////////////////////////"," //"," // THEAD/COLUMNSET FUNCTIONALITY"," //"," ////////////////////////////////////////////////////////////////////////////"," /*"," * Updates THEAD."," *"," * @method _uiSetColumnset"," * @param cs {Columnset} New Columnset."," * @protected"," */"," _uiSetColumnset: function(cs) {"," var tree = cs.tree,"," thead = this._theadNode,"," i = 0,"," len = tree.length,"," parent = thead.get(\"parentNode\"),"," nextSibling = thead.next();"," "," // Move THEAD off DOM"," thead.remove();"," "," thead.get(\"children\").remove(true);",""," // Iterate tree of columns to add THEAD rows"," for(; i<len; ++i) {"," this._addTheadTrNode({"," thead: thead,"," columns: tree[i],"," id : '' // to avoid {id} leftovers from the trTemplate"," }, (i === 0), (i === len - 1));"," }",""," // Column helpers needs _theadNode to exist"," //this._createColumnHelpers();",""," "," // Re-attach THEAD to DOM"," parent.insert(thead, nextSibling);",""," },"," "," /*"," * Creates and attaches header row element."," *"," * @method _addTheadTrNode"," * @param o {Object} {thead, columns}."," * @param isFirst {Boolean} Is first row."," * @param isFirst {Boolean} Is last row."," * @protected"," */"," _addTheadTrNode: function(o, isFirst, isLast) {"," o.tr = this._createTheadTrNode(o, isFirst, isLast);"," this._attachTheadTrNode(o);"," },"," ",""," /*"," * Creates header row element."," *"," * @method _createTheadTrNode"," * @param o {Object} {thead, columns}."," * @param isFirst {Boolean} Is first row."," * @param isLast {Boolean} Is last row."," * @protected"," * @return {Node}"," */"," _createTheadTrNode: function(o, isFirst, isLast) {"," //TODO: custom classnames"," var tr = Ycreate(fromTemplate(this.get(\"trTemplate\"), o)),"," i = 0,"," columns = o.columns,"," len = columns.length,"," column;",""," // Set FIRST/LAST class"," if(isFirst) {"," tr.addClass(CLASS_FIRST);"," }"," if(isLast) {"," tr.addClass(CLASS_LAST);"," }",""," for(; i<len; ++i) {"," column = columns[i];"," this._addTheadThNode({value:column.get(\"label\"), column: column, tr:tr});"," }",""," return tr;"," },",""," /*"," * Attaches header row element."," *"," * @method _attachTheadTrNode"," * @param o {Object} {thead, columns, tr}."," * @protected"," */"," _attachTheadTrNode: function(o) {"," o.thead.appendChild(o.tr);"," },",""," /*"," * Creates and attaches header cell element."," *"," * @method _addTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _addTheadThNode: function(o) {"," o.th = this._createTheadThNode(o);"," this._attachTheadThNode(o);"," //TODO: assign all node pointers: thNode, thLinerNode, thLabelNode"," o.column.thNode = o.th;"," },",""," /*"," * Creates header cell element."," *"," * @method _createTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," * @return {Node}"," */"," _createTheadThNode: function(o) {"," var column = o.column;"," "," // Populate template object"," o.id = column.get(\"id\");//TODO: validate 1 column ID per document"," o.colspan = column.colSpan;"," o.rowspan = column.rowSpan;"," o.abbr = column.get(\"abbr\");"," o.classnames = column.get(\"classnames\");"," o.value = fromTemplate(this.get(\"thValueTemplate\"), o);",""," /*TODO"," // Clear minWidth on hidden Columns"," if(column.get(\"hidden\")) {"," //this._clearMinWidth(column);"," }"," */"," "," return Ycreate(fromTemplate(this.thTemplate, o));"," },",""," /*"," * Attaches header cell element."," *"," * @method _attachTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _attachTheadThNode: function(o) {"," o.tr.appendChild(o.th);"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // TBODY/RECORDSET FUNCTIONALITY"," //"," ////////////////////////////////////////////////////////////////////////////"," /*"," * Updates TBODY."," *"," * @method _uiSetRecordset"," * @param rs {Recordset} New Recordset."," * @protected"," */"," _uiSetRecordset: function(rs) {"," var self = this,"," oldTbody = this._tbodyNode,"," parent = oldTbody.get(\"parentNode\"),"," nextSibling = oldTbody.next(),"," columns = this.get('columnset').keys,"," cellValueTemplate = this.get('tdValueTemplate'),"," o = {},"," newTbody, i, len, column, formatter;",""," // Replace TBODY with a new one"," //TODO: split _addTbodyNode into create/attach"," oldTbody.remove();"," oldTbody = null;"," newTbody = this._addTbodyNode(this._tableNode);"," newTbody.remove();"," this._tbodyNode = newTbody;"," o.tbody = newTbody;",""," o.rowTemplate = this.get('trTemplate');"," o.columns = [];",""," // Build up column data to avoid passing through Attribute APIs inside"," // render loops for rows and cells"," for (i = columns.length - 1; i >= 0; --i) {"," column = columns[i];"," o.columns[i] = {"," column : column,"," fields : column.get('field'),"," classnames : column.get('classnames'),"," emptyCellValue: column.get('emptyCellValue')"," }",""," formatter = column.get('formatter');",""," if (YLang.isFunction(formatter)) {"," // function formatters need to run before checking if the value"," // needs defaulting from column.emptyCellValue"," formatter = Y.bind(this._functionFormatter, this, formatter);"," } else {"," if (!YLang.isString(formatter)) {"," formatter = cellValueTemplate;"," }",""," // string formatters need the value defaulted before processing"," formatter = Y.bind(this._templateFormatter, this, formatter);"," }",""," o.columns[i].formatter = formatter;"," }","",""," // Iterate Recordset to use existing TR when possible or add new TR"," // TODO i = this.get(\"state.offsetIndex\")"," // TODO len =this.get(\"state.pageLength\")"," for (i = 0, len = rs.size(); i < len; ++i) {"," o.record = rs.item(i);"," o.data = o.record.get(\"data\");"," o.rowindex = i;"," this._addTbodyTrNode(o); //TODO: sometimes rowindex != recordindex"," }"," "," // TBODY to DOM"," parent.insert(this._tbodyNode, nextSibling);"," },",""," _functionFormatter: function (formatter, o) {"," var value = formatter.call(this, o);",""," return (value !== undefined) ? value : o.emptyCellValue;"," },",""," _templateFormatter: function (template, o) {"," if (o.value === undefined) {"," o.value = o.emptyCellValue;"," }",""," return fromTemplate(template, o);"," },",""," /*"," * Creates and attaches data row element."," *"," * @method _addTbodyTrNode"," * @param o {Object} {tbody, record}"," * @protected"," */"," _addTbodyTrNode: function(o) {"," var row = o.tbody.one(\"#\" + o.record.get(\"id\"));",""," o.tr = row || this._createTbodyTrNode(o);",""," this._attachTbodyTrNode(o);"," },",""," /*"," * Creates data row element."," *"," * @method _createTbodyTrNode"," * @param o {Object} {tbody, record}"," * @protected"," * @return {Node}"," */"," _createTbodyTrNode: function(o) {"," var columns = o.columns,"," i, len, columnInfo;",""," o.tr = Ycreate(fromTemplate(o.rowTemplate, { id: o.record.get('id') }));"," "," for (i = 0, len = columns.length; i < len; ++i) {"," columnInfo = columns[i];"," o.column = columnInfo.column;"," o.field = columnInfo.fields;"," o.classnames = columnInfo.classnames;"," o.formatter = columnInfo.formatter;"," o.emptyCellValue= columnInfo.emptyCellValue;",""," this._addTbodyTdNode(o);"," }"," "," return o.tr;"," },",""," /*"," * Attaches data row element."," *"," * @method _attachTbodyTrNode"," * @param o {Object} {tbody, record, tr}."," * @protected"," */"," _attachTbodyTrNode: function(o) {"," var tbody = o.tbody,"," tr = o.tr,"," index = o.rowindex,"," nextSibling = tbody.get(\"children\").item(index) || null,"," isOdd = (index % 2);"," "," if(isOdd) {"," tr.replaceClass(CLASS_EVEN, CLASS_ODD);"," } else {"," tr.replaceClass(CLASS_ODD, CLASS_EVEN);"," }"," "," tbody.insertBefore(tr, nextSibling);"," },",""," /*"," * Creates and attaches data cell element."," *"," * @method _addTbodyTdNode"," * @param o {Object} {record, column, tr}."," * @protected"," */"," _addTbodyTdNode: function(o) {"," o.td = this._createTbodyTdNode(o);"," this._attachTbodyTdNode(o);"," delete o.td;"," },"," "," /*"," Creates a TD Node from the tdTemplate property using the input object as"," template {placeholder} values. The created Node is also assigned to the"," `td` property on the input object.",""," If the input object already has a `td` property, it is returned an no new"," Node is created.",""," @method createCell"," @param {Object} data Template values"," @return {Node}"," **/"," createCell: function (data) {"," return data && (data.td ||"," (data.td = Ycreate(fromTemplate(this.tdTemplate, data))));"," },",""," /*"," * Creates data cell element."," *"," * @method _createTbodyTdNode"," * @param o {Object} {record, column, tr}."," * @protected"," * @return {Node}"," */"," _createTbodyTdNode: function(o) {"," o.headers = o.column.headers;"," o.value = this.formatDataCell(o);",""," return o.td || this.createCell(o);"," },"," "," /*"," * Attaches data cell element."," *"," * @method _attachTbodyTdNode"," * @param o {Object} {record, column, tr, headers, classnames, value}."," * @protected"," */"," _attachTbodyTdNode: function(o) {"," o.tr.appendChild(o.td);"," },",""," /*"," * Returns markup to insert into data cell element."," *"," * @method formatDataCell"," * @param @param o {Object} {record, column, tr, headers, classnames}."," */"," formatDataCell: function (o) {"," o.value = o.data[o.field];",""," return o.formatter.call(this, o);"," },",""," _initRecordset: function () {"," return new Y.Recordset({ records: [] });"," }","});","","Y.namespace(\"DataTable\").Base = DTBase;","","","}, '3.7.2' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});"];+_yuitest_coverage["/build/datatable-base-deprecated/datatable-base-deprecated.js"].code=["YUI.add('datatable-base-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","var YLang = Y.Lang,"," YisValue = YLang.isValue,"," fromTemplate = Y.Lang.sub,"," YNode = Y.Node,"," Ycreate = YNode.create,"," YgetClassName = Y.ClassNameManager.getClassName,",""," DATATABLE = \"datatable\","," COLUMN = \"column\","," "," FOCUS = \"focus\","," KEYDOWN = \"keydown\","," MOUSEENTER = \"mouseenter\","," MOUSELEAVE = \"mouseleave\","," MOUSEUP = \"mouseup\","," MOUSEDOWN = \"mousedown\","," CLICK = \"click\","," DBLCLICK = \"dblclick\",",""," CLASS_COLUMNS = YgetClassName(DATATABLE, \"columns\"),"," CLASS_DATA = YgetClassName(DATATABLE, \"data\"),"," CLASS_MSG = YgetClassName(DATATABLE, \"msg\"),"," CLASS_LINER = YgetClassName(DATATABLE, \"liner\"),"," CLASS_FIRST = YgetClassName(DATATABLE, \"first\"),"," CLASS_LAST = YgetClassName(DATATABLE, \"last\"),"," CLASS_EVEN = YgetClassName(DATATABLE, \"even\"),"," CLASS_ODD = YgetClassName(DATATABLE, \"odd\"),",""," TEMPLATE_TABLE = '<table></table>',"," TEMPLATE_COL = '<col></col>',"," TEMPLATE_THEAD = '<thead class=\"'+CLASS_COLUMNS+'\"></thead>',"," TEMPLATE_TBODY = '<tbody class=\"'+CLASS_DATA+'\"></tbody>',"," TEMPLATE_TH = '<th id=\"{id}\" rowspan=\"{rowspan}\" colspan=\"{colspan}\" class=\"{classnames}\" abbr=\"{abbr}\"><div class=\"'+CLASS_LINER+'\">{value}</div></th>',"," TEMPLATE_TR = '<tr id=\"{id}\"></tr>',"," TEMPLATE_TD = '<td headers=\"{headers}\" class=\"{classnames}\"><div class=\"'+CLASS_LINER+'\">{value}</div></td>',"," TEMPLATE_VALUE = '{value}',"," TEMPLATE_MSG = '<tbody class=\"'+CLASS_MSG+'\"></tbody>';"," ","","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/*"," * The Column class defines and manages attributes of Columns for DataTable."," *"," * @class Column"," * @extends Widget"," * @constructor"," */","function Column(config) {"," Column.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(Column, {"," /*"," * Class name."," *"," * @property NAME"," * @type {String}"," * @static"," * @final"," * @value \"column\""," */"," NAME: \"column\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," Unique internal identifier, used to stamp ID on TH element."," "," @attribute id"," @type {String}"," @readOnly"," **/"," id: {"," valueFn: \"_defaultId\","," readOnly: true"," },"," "," /*"," User-supplied identifier. Defaults to id."," @attribute key"," @type {String}"," **/"," key: {"," valueFn: \"_defaultKey\""," },",""," /*"," Points to underlying data field (for sorting or formatting, for"," example). Useful when column doesn't hold any data itself, but is just"," a visual representation of data from another column or record field."," Defaults to key.",""," @attribute field"," @type {String}"," @default (column key)"," **/"," field: {"," valueFn: \"_defaultField\""," },",""," /*"," Display label for column header. Defaults to key.",""," @attribute label"," @type {String}"," **/"," label: {"," valueFn: \"_defaultLabel\""," },"," "," /*"," Array of child column definitions (for nested headers).",""," @attribute children"," @type {String}"," @default null"," **/"," children: {"," value: null"," },"," "," /*"," TH abbr attribute.",""," @attribute abbr"," @type {String}"," @default \"\""," **/"," abbr: {"," value: \"\""," },",""," //TODO: support custom classnames"," // TH CSS classnames"," classnames: {"," readOnly: true,"," getter: \"_getClassnames\""," },"," "," /*"," Formating template string or function for cells in this column.",""," Function formatters receive a single object (described below) and are"," expected to output the `innerHTML` of the cell.",""," String templates can include markup and {placeholder} tokens to be"," filled in from the object passed to function formatters.",""," @attribute formatter"," @type {String|Function}"," @param {Object} data Data relevant to the rendering of this cell"," @param {String} data.classnames CSS classes to add to the cell"," @param {Column} data.column This Column instance"," @param {Object} data.data The raw object data from the Record"," @param {String} data.field This Column's \"field\" attribute value"," @param {String} data.headers TH ids to reference in the cell's"," \"headers\" attribute"," @param {Record} data.record The Record instance for this row"," @param {Number} data.rowindex The index for this row"," @param {Node} data.tbody The TBODY Node that will house the cell"," @param {Node} data.tr The row TR Node that will house the cell"," @param {Any} data.value The raw Record data for this cell"," **/"," formatter: {},",""," /*"," The default markup to display in cells that have no corresponding record"," data or content from formatters.",""," @attribute emptyCellValue"," @type {String}"," @default ''"," **/"," emptyCellValue: {"," value: '',"," validator: Y.Lang.isString"," },",""," //requires datatable-sort"," sortable: {"," value: false"," },"," //sortOptions:defaultDir, sortFn, field",""," //TODO: support editable columns"," // Column editor"," editor: {},",""," //TODO: support resizeable columns"," //TODO: support setting widths"," // requires datatable-colresize"," width: {},"," resizeable: {},"," minimized: {},"," minWidth: {},"," maxAutoWidth: {}"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(Column, Y.Widget, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Return ID for instance."," *"," * @method _defaultId"," * @return {String}"," * @private"," */"," _defaultId: function() {"," return Y.guid();"," },",""," /*"," * Return key for instance. Defaults to ID if one was not provided."," *"," * @method _defaultKey"," * @return {String}"," * @private"," */"," _defaultKey: function() {"," return Y.guid();"," },",""," /*"," * Return field for instance. Defaults to key if one was not provided."," *"," * @method _defaultField"," * @return {String}"," * @private"," */"," _defaultField: function() {"," return this.get(\"key\");"," },",""," /*"," * Return label for instance. Defaults to key if one was not provided."," *"," * @method _defaultLabel"," * @return {String}"," * @private"," */"," _defaultLabel: function() {"," return this.get(\"key\");"," },",""," /*"," * Updates the UI if changes are made to abbr."," *"," * @method _afterAbbrChange"," * @param e {Event} Custom event for the attribute change."," * @private"," */"," _afterAbbrChange: function (e) {"," this._uiSetAbbr(e.newVal);"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // PROPERTIES"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Reference to Column's current position index within its Columnset's keys"," * array, if applicable. This property only applies to non-nested and bottom-"," * level child Columns. Value is set by Columnset code."," *"," * @property keyIndex"," * @type {Number}"," */"," keyIndex: null,"," "," /*"," * Array of TH IDs associated with this column, for TD \"headers\" attribute."," * Value is set by Columnset code"," *"," * @property headers"," * @type {String[]}"," */"," headers: null,",""," /*"," * Number of cells the header spans. Value is set by Columnset code."," *"," * @property colSpan"," * @type {Number}"," * @default 1"," */"," colSpan: 1,"," "," /*"," * Number of rows the header spans. Value is set by Columnset code."," *"," * @property rowSpan"," * @type {Number}"," * @default 1"," */"," rowSpan: 1,",""," /*"," * Column's parent Column instance, if applicable. Value is set by Columnset"," * code."," *"," * @property parent"," * @type {Column}"," */"," parent: null,",""," /*"," * The Node reference to the associated TH element."," *"," * @property thNode"," * @type {Node}"," */"," "," thNode: null,",""," /*TODO"," * The Node reference to the associated liner element."," *"," * @property thLinerNode"," * @type {Node}"," "," thLinerNode: null,*/"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," },",""," /*"," * Destructor."," *"," * @method destructor"," * @private"," */"," destructor: function() {"," },",""," /*"," * Returns classnames for Column."," *"," * @method _getClassnames"," * @private"," */"," _getClassnames: function () {"," return Y.ClassNameManager.getClassName(COLUMN, this.get(\"key\").replace(/[^\\w\\-]/g,\"\"));"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // SYNC"," //"," ////////////////////////////////////////////////////////////////////////////"," /*"," * Syncs UI to intial state."," *"," * @method syncUI"," * @private"," */"," syncUI: function() {"," this._uiSetAbbr(this.get(\"abbr\"));"," },",""," /*"," * Updates abbr."," *"," * @method _uiSetAbbr"," * @param val {String} New abbr."," * @protected"," */"," _uiSetAbbr: function(val) {"," this.thNode.set(\"abbr\", val);"," }","});","","Y.Column = Column;","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/*"," * The Columnset class defines and manages a collection of Columns."," *"," * @class Columnset"," * @extends Base"," * @constructor"," */","function Columnset(config) {"," Columnset.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(Columnset, {"," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"columnset\""," */"," NAME: \"columnset\",",""," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTES"," //"," /////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute definitions"," * @description Array of column definitions that will populate this Columnset."," * @type Array"," */"," definitions: {"," setter: \"_setDefinitions\""," }",""," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(Columnset, Y.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * @method _setDefinitions"," * @description Clones definitions before setting."," * @param definitions {Array} Array of column definitions."," * @return Array"," * @private"," */"," _setDefinitions: function(definitions) {"," return Y.clone(definitions);"," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // PROPERTIES"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Top-down tree representation of Column hierarchy. Used to create DOM"," * elements."," *"," * @property tree"," * @type {Column[]}"," */"," tree: null,",""," /*"," * Hash of all Columns by ID."," *"," * @property idHash"," * @type Object"," */"," idHash: null,",""," /*"," * Hash of all Columns by key."," *"," * @property keyHash"," * @type Object"," */"," keyHash: null,",""," /*"," * Array of only Columns that are meant to be displayed in DOM."," *"," * @property keys"," * @type {Column[]}"," */"," keys: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer. Generates all internal representations of the collection of"," * Columns."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function() {",""," // DOM tree representation of all Columns"," var tree = [],"," // Hash of all Columns by ID"," idHash = {},"," // Hash of all Columns by key"," keyHash = {},"," // Flat representation of only Columns that are meant to display data"," keys = [],"," // Original definitions"," definitions = this.get(\"definitions\"),",""," self = this;",""," // Internal recursive function to define Column instances"," function parseColumns(depth, currentDefinitions, parent) {"," var i=0,"," len = currentDefinitions.length,"," currentDefinition,"," column,"," currentChildren;",""," // One level down"," depth++;",""," // Create corresponding dom node if not already there for this depth"," if(!tree[depth]) {"," tree[depth] = [];"," }",""," // Parse each node at this depth for attributes and any children"," for(; i<len; ++i) {"," currentDefinition = currentDefinitions[i];",""," currentDefinition = YLang.isString(currentDefinition) ? {key:currentDefinition} : currentDefinition;",""," // Instantiate a new Column for each node"," column = new Y.Column(currentDefinition);",""," // Cross-reference Column ID back to the original object literal definition"," currentDefinition.yuiColumnId = column.get(\"id\");",""," // Add the new Column to the hash"," idHash[column.get(\"id\")] = column;"," keyHash[column.get(\"key\")] = column;",""," // Assign its parent as an attribute, if applicable"," if(parent) {"," column.parent = parent;"," }",""," // The Column has descendants"," if(YLang.isArray(currentDefinition.children)) {"," currentChildren = currentDefinition.children;"," column._set(\"children\", currentChildren);",""," self._setColSpans(column, currentDefinition);",""," self._cascadePropertiesToChildren(column, currentChildren);",""," // The children themselves must also be parsed for Column instances"," if(!tree[depth+1]) {"," tree[depth+1] = [];"," }"," parseColumns(depth, currentChildren, column);"," }"," // This Column does not have any children"," else {"," column.keyIndex = keys.length;"," // Default is already 1"," //column.colSpan = 1;"," keys.push(column);"," }",""," // Add the Column to the top-down dom tree"," tree[depth].push(column);"," }"," depth--;"," }",""," // Parse out Column instances from the array of object literals"," parseColumns(-1, definitions);","",""," // Save to the Columnset instance"," this.tree = tree;"," this.idHash = idHash;"," this.keyHash = keyHash;"," this.keys = keys;",""," this._setRowSpans();"," this._setHeaders();"," },",""," /*"," * Destructor."," *"," * @method destructor"," * @private"," */"," destructor: function() {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // COLUMN HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Cascade certain properties to children if not defined on their own."," *"," * @method _cascadePropertiesToChildren"," * @private"," */"," _cascadePropertiesToChildren: function(column, currentChildren) {"," //TODO: this is all a giant todo"," var i = 0,"," len = currentChildren.length,"," child;",""," // Cascade certain properties to children if not defined on their own"," for(; i<len; ++i) {"," child = currentChildren[i];"," if(column.get(\"className\") && (child.className === undefined)) {"," child.className = column.get(\"className\");"," }"," if(column.get(\"editor\") && (child.editor === undefined)) {"," child.editor = column.get(\"editor\");"," }"," if(column.get(\"formatter\") && (child.formatter === undefined)) {"," child.formatter = column.get(\"formatter\");"," }"," if(column.get(\"resizeable\") && (child.resizeable === undefined)) {"," child.resizeable = column.get(\"resizeable\");"," }"," if(column.get(\"sortable\") && (child.sortable === undefined)) {"," child.sortable = column.get(\"sortable\");"," }"," if(column.get(\"hidden\")) {"," child.hidden = true;"," }"," if(column.get(\"width\") && (child.width === undefined)) {"," child.width = column.get(\"width\");"," }"," if(column.get(\"minWidth\") && (child.minWidth === undefined)) {"," child.minWidth = column.get(\"minWidth\");"," }"," if(column.get(\"maxAutoWidth\") && (child.maxAutoWidth === undefined)) {"," child.maxAutoWidth = column.get(\"maxAutoWidth\");"," }"," }"," },",""," /*"," * @method _setColSpans"," * @description Calculates and sets colSpan attribute on given Column."," * @param column {Array} Column instance."," * @param definition {Object} Column definition."," * @private"," */"," _setColSpans: function(column, definition) {"," // Determine COLSPAN value for this Column"," var terminalChildNodes = 0;",""," function countTerminalChildNodes(ancestor) {"," var descendants = ancestor.children,"," i = 0,"," len = descendants.length;",""," // Drill down each branch and count terminal nodes"," for(; i<len; ++i) {"," // Keep drilling down"," if(YLang.isArray(descendants[i].children)) {"," countTerminalChildNodes(descendants[i]);"," }"," // Reached branch terminus"," else {"," terminalChildNodes++;"," }"," }"," }"," countTerminalChildNodes(definition);"," column.colSpan = terminalChildNodes;"," },",""," /*"," * @method _setRowSpans"," * @description Calculates and sets rowSpan attribute on all Columns."," * @private"," */"," _setRowSpans: function() {"," // Determine ROWSPAN value for each Column in the DOM tree"," function parseDomTreeForRowSpan(tree) {"," var maxRowDepth = 1,"," currentRow,"," currentColumn,"," m,p;",""," // Calculate the max depth of descendants for this row"," function countMaxRowDepth(row, tmpRowDepth) {"," tmpRowDepth = tmpRowDepth || 1;",""," var i = 0,"," len = row.length,"," col;",""," for(; i<len; ++i) {"," col = row[i];"," // Column has children, so keep counting"," if(YLang.isArray(col.children)) {"," tmpRowDepth++;"," countMaxRowDepth(col.children, tmpRowDepth);"," tmpRowDepth--;"," }"," // Column has children, so keep counting"," else if(col.get && YLang.isArray(col.get(\"children\"))) {"," tmpRowDepth++;"," countMaxRowDepth(col.get(\"children\"), tmpRowDepth);"," tmpRowDepth--;"," }"," // No children, is it the max depth?"," else {"," if(tmpRowDepth > maxRowDepth) {"," maxRowDepth = tmpRowDepth;"," }"," }"," }"," }",""," // Count max row depth for each row"," for(m=0; m<tree.length; m++) {"," currentRow = tree[m];"," countMaxRowDepth(currentRow);",""," // Assign the right ROWSPAN values to each Column in the row"," for(p=0; p<currentRow.length; p++) {"," currentColumn = currentRow[p];"," if(!YLang.isArray(currentColumn.get(\"children\"))) {"," currentColumn.rowSpan = maxRowDepth;"," }"," // Default is already 1"," // else currentColumn.rowSpan =1;"," }",""," // Reset counter for next row"," maxRowDepth = 1;"," }"," }"," parseDomTreeForRowSpan(this.tree);"," },",""," /*"," * @method _setHeaders"," * @description Calculates and sets headers attribute on all Columns."," * @private"," */"," _setHeaders: function() {"," var headers, column,"," allKeys = this.keys,"," i=0, len = allKeys.length;",""," function recurseAncestorsForHeaders(headers, column) {"," headers.push(column.get(\"id\"));"," if(column.parent) {"," recurseAncestorsForHeaders(headers, column.parent);"," }"," }"," for(; i<len; ++i) {"," headers = [];"," column = allKeys[i];"," recurseAncestorsForHeaders(headers, column);"," column.headers = headers.reverse().join(\" \");"," }"," },",""," //TODO"," getColumn: function() {"," }","});","","Y.Columnset = Columnset;","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","The DataTable widget provides a progressively enhanced DHTML control for","displaying tabular data across A-grade browsers.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","corresponds to the 3.4.1 version of DataTable and will be removed from the","library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@main datatable-deprecated","@deprecated","**/","","/**","Provides the base DataTable implementation, which can be extended to add","additional functionality, such as sorting or scrolling.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","corresponds to the 3.4.1 version of DataTable and will be removed from the","library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-base-deprecated","@deprecated","**/","","/*"," * Base class for the DataTable widget."," * @class DataTable.Base"," * @extends Widget"," * @constructor"," */","function DTBase(config) {"," DTBase.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DTBase, {",""," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTable\""," */"," NAME: \"dataTable\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute columnset"," * @description Pointer to Columnset instance."," * @type Array | Y.Columnset"," */"," columnset: {"," setter: \"_setColumnset\""," },",""," /*"," * @attribute recordset"," * @description Pointer to Recordset instance."," * @type Array | Y.Recordset"," */"," recordset: {"," valueFn: '_initRecordset',"," setter: \"_setRecordset\""," },",""," /*TODO"," * @attribute state"," * @description Internal state."," * @readonly"," * @type"," */"," /*state: {"," value: new Y.State(),"," readOnly: true",""," },*/",""," /*"," * @attribute summary"," * @description Summary."," * @type String"," */"," summary: {"," },",""," /*"," * @attribute caption"," * @description Caption"," * @type String"," */"," caption: {"," },",""," /*"," * @attribute thValueTemplate"," * @description Tokenized markup template for TH value."," * @type String"," * @default '{value}'"," */"," thValueTemplate: {"," value: TEMPLATE_VALUE"," },",""," /*"," * @attribute tdValueTemplate"," * @description Tokenized markup template for TD value."," * @type String"," * @default '{value}'"," */"," tdValueTemplate: {"," value: TEMPLATE_VALUE"," },",""," /*"," * @attribute trTemplate"," * @description Tokenized markup template for TR node creation."," * @type String"," * @default '<tr id=\"{id}\"></tr>'"," */"," trTemplate: {"," value: TEMPLATE_TR"," }"," },","","/////////////////////////////////////////////////////////////////////////////","//","// TODO: HTML_PARSER","//","/////////////////////////////////////////////////////////////////////////////"," HTML_PARSER: {"," /*caption: function (srcNode) {"," "," }*/"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DTBase, Y.Widget, {"," /*"," * @property thTemplate"," * @description Tokenized markup template for TH node creation."," * @type String"," * @default '<th id=\"{id}\" rowspan=\"{rowspan}\" colspan=\"{colspan}\" class=\"{classnames}\" abbr=\"{abbr}\"><div class=\"'+CLASS_LINER+'\">{value}</div></th>'"," */"," thTemplate: TEMPLATE_TH,",""," /*"," * @property tdTemplate"," * @description Tokenized markup template for TD node creation."," * @type String"," * @default '<td headers=\"{headers}\" class=\"{classnames}\"><div class=\"yui3-datatable-liner\">{value}</div></td>'"," */"," tdTemplate: TEMPLATE_TD,"," "," /*"," * @property _theadNode"," * @description Pointer to THEAD node."," * @type {Node}"," * @private"," */"," _theadNode: null,"," "," /*"," * @property _tbodyNode"," * @description Pointer to TBODY node."," * @type {Node}"," * @private"," */"," _tbodyNode: null,"," "," /*"," * @property _msgNode"," * @description Pointer to message display node."," * @type {Node}"," * @private"," */"," _msgNode: null,",""," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * @method _setColumnset"," * @description Converts Array to Y.Columnset."," * @param columns {Array | Y.Columnset}"," * @return {Columnset}"," * @private"," */"," _setColumnset: function(columns) {"," return YLang.isArray(columns) ? new Y.Columnset({definitions:columns}) : columns;"," },",""," /*"," * Updates the UI if Columnset is changed."," *"," * @method _afterColumnsetChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterColumnsetChange: function (e) {"," this._uiSetColumnset(e.newVal);"," },",""," /*"," * @method _setRecordset"," * @description Converts Array to Y.Recordset."," * @param records {Array | Recordset}"," * @return {Recordset}"," * @private"," */"," _setRecordset: function(rs) {"," if(YLang.isArray(rs)) {"," rs = new Y.Recordset({records:rs});"," }",""," rs.addTarget(this);"," return rs;"," },"," "," /*"," * Updates the UI if Recordset is changed."," *"," * @method _afterRecordsetChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterRecordsetChange: function (e) {"," this._uiSetRecordset(e.newVal);"," },",""," /*"," * Updates the UI if Recordset records are changed."," *"," * @method _afterRecordsChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterRecordsChange: function (e) {"," this._uiSetRecordset(this.get('recordset'));"," },",""," /*"," * Updates the UI if summary is changed."," *"," * @method _afterSummaryChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterSummaryChange: function (e) {"," this._uiSetSummary(e.newVal);"," },",""," /*"," * Updates the UI if caption is changed."," *"," * @method _afterCaptionChange"," * @param e {Event} Custom event for the attribute change."," * @protected"," */"," _afterCaptionChange: function (e) {"," this._uiSetCaption(e.newVal);"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Destructor."," *"," * @method destructor"," * @private"," */"," destructor: function() {"," this.get(\"recordset\").removeTarget(this);"," },"," "," ////////////////////////////////////////////////////////////////////////////"," //"," // RENDER"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Renders UI."," *"," * @method renderUI"," * @private"," */"," renderUI: function() {"," // TABLE"," this._addTableNode(this.get(\"contentBox\"));",""," // COLGROUP"," this._addColgroupNode(this._tableNode);",""," // THEAD"," this._addTheadNode(this._tableNode);",""," // Primary TBODY"," this._addTbodyNode(this._tableNode);",""," // Message TBODY"," this._addMessageNode(this._tableNode);",""," // CAPTION"," this._addCaptionNode(this._tableNode);"," },",""," /*"," * Creates and attaches TABLE element to given container."," *"," * @method _addTableNode"," * @param containerNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addTableNode: function(containerNode) {"," if (!this._tableNode) {"," this._tableNode = containerNode.appendChild(Ycreate(TEMPLATE_TABLE));"," }"," return this._tableNode;"," },",""," /*"," * Creates and attaches COLGROUP element to given TABLE."," *"," * @method _addColgroupNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addColgroupNode: function(tableNode) {"," // Add COLs to DOCUMENT FRAGMENT"," var len = this.get(\"columnset\").keys.length,"," i = 0,"," allCols = [\"<colgroup>\"];",""," for(; i<len; ++i) {"," allCols.push(TEMPLATE_COL);"," }",""," allCols.push(\"</colgroup>\");",""," // Create COLGROUP"," this._colgroupNode = tableNode.insertBefore(Ycreate(allCols.join(\"\")), tableNode.get(\"firstChild\"));",""," return this._colgroupNode;"," },",""," /*"," * Creates and attaches THEAD element to given container."," *"," * @method _addTheadNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addTheadNode: function(tableNode) {"," if(tableNode) {"," this._theadNode = tableNode.insertBefore(Ycreate(TEMPLATE_THEAD), this._colgroupNode.next());"," return this._theadNode;"," }"," },",""," /*"," * Creates and attaches TBODY element to given container."," *"," * @method _addTbodyNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addTbodyNode: function(tableNode) {"," this._tbodyNode = tableNode.appendChild(Ycreate(TEMPLATE_TBODY));"," return this._tbodyNode;"," },",""," /*"," * Creates and attaches message display element to given container."," *"," * @method _addMessageNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addMessageNode: function(tableNode) {"," this._msgNode = tableNode.insertBefore(Ycreate(TEMPLATE_MSG), this._tbodyNode);"," return this._msgNode;"," },",""," /*"," * Creates and attaches CAPTION element to given container."," *"," * @method _addCaptionNode"," * @param tableNode {Node} Parent node."," * @protected"," * @return {Node}"," */"," _addCaptionNode: function(tableNode) {"," this._captionNode = Y.Node.create('<caption></caption>');"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // BIND"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Binds events."," *"," * @method bindUI"," * @private"," */"," bindUI: function() {"," this.after({"," columnsetChange: this._afterColumnsetChange,"," summaryChange : this._afterSummaryChange,"," captionChange : this._afterCaptionChange,"," recordsetChange: this._afterRecordsChange,"," \"recordset:tableChange\": this._afterRecordsChange"," });"," },"," "," delegate: function(type) {"," //TODO: is this necessary?"," if(type===\"dblclick\") {"," this.get(\"boundingBox\").delegate.apply(this.get(\"boundingBox\"), arguments);"," }"," else {"," this.get(\"contentBox\").delegate.apply(this.get(\"contentBox\"), arguments);"," }"," },"," ",""," ////////////////////////////////////////////////////////////////////////////"," //"," // SYNC"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Syncs UI to intial state."," *"," * @method syncUI"," * @private"," */"," syncUI: function() {"," // THEAD ROWS"," this._uiSetColumnset(this.get(\"columnset\"));"," // DATA ROWS"," this._uiSetRecordset(this.get(\"recordset\"));"," // SUMMARY"," this._uiSetSummary(this.get(\"summary\"));"," // CAPTION"," this._uiSetCaption(this.get(\"caption\"));"," },",""," /*"," * Updates summary."," *"," * @method _uiSetSummary"," * @param val {String} New summary."," * @protected"," */"," _uiSetSummary: function(val) {"," val = YisValue(val) ? val : \"\";"," this._tableNode.set(\"summary\", val);"," },",""," /*"," * Updates caption."," *"," * @method _uiSetCaption"," * @param val {String} New caption."," * @protected"," */"," _uiSetCaption: function(val) {"," var caption = this._captionNode,"," inDoc = caption.inDoc(),"," method = val ? (!inDoc && 'prepend') : (inDoc && 'removeChild');",""," caption.setContent(val || '');",""," if (method) {"," // prepend of remove necessary"," this._tableNode[method](caption);"," }"," },","",""," ////////////////////////////////////////////////////////////////////////////"," //"," // THEAD/COLUMNSET FUNCTIONALITY"," //"," ////////////////////////////////////////////////////////////////////////////"," /*"," * Updates THEAD."," *"," * @method _uiSetColumnset"," * @param cs {Columnset} New Columnset."," * @protected"," */"," _uiSetColumnset: function(cs) {"," var tree = cs.tree,"," thead = this._theadNode,"," i = 0,"," len = tree.length,"," parent = thead.get(\"parentNode\"),"," nextSibling = thead.next();"," "," // Move THEAD off DOM"," thead.remove();"," "," thead.get(\"children\").remove(true);",""," // Iterate tree of columns to add THEAD rows"," for(; i<len; ++i) {"," this._addTheadTrNode({"," thead: thead,"," columns: tree[i],"," id : '' // to avoid {id} leftovers from the trTemplate"," }, (i === 0), (i === len - 1));"," }",""," // Column helpers needs _theadNode to exist"," //this._createColumnHelpers();",""," "," // Re-attach THEAD to DOM"," parent.insert(thead, nextSibling);",""," },"," "," /*"," * Creates and attaches header row element."," *"," * @method _addTheadTrNode"," * @param o {Object} {thead, columns}."," * @param isFirst {Boolean} Is first row."," * @param isFirst {Boolean} Is last row."," * @protected"," */"," _addTheadTrNode: function(o, isFirst, isLast) {"," o.tr = this._createTheadTrNode(o, isFirst, isLast);"," this._attachTheadTrNode(o);"," },"," ",""," /*"," * Creates header row element."," *"," * @method _createTheadTrNode"," * @param o {Object} {thead, columns}."," * @param isFirst {Boolean} Is first row."," * @param isLast {Boolean} Is last row."," * @protected"," * @return {Node}"," */"," _createTheadTrNode: function(o, isFirst, isLast) {"," //TODO: custom classnames"," var tr = Ycreate(fromTemplate(this.get(\"trTemplate\"), o)),"," i = 0,"," columns = o.columns,"," len = columns.length,"," column;",""," // Set FIRST/LAST class"," if(isFirst) {"," tr.addClass(CLASS_FIRST);"," }"," if(isLast) {"," tr.addClass(CLASS_LAST);"," }",""," for(; i<len; ++i) {"," column = columns[i];"," this._addTheadThNode({value:column.get(\"label\"), column: column, tr:tr});"," }",""," return tr;"," },",""," /*"," * Attaches header row element."," *"," * @method _attachTheadTrNode"," * @param o {Object} {thead, columns, tr}."," * @protected"," */"," _attachTheadTrNode: function(o) {"," o.thead.appendChild(o.tr);"," },",""," /*"," * Creates and attaches header cell element."," *"," * @method _addTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _addTheadThNode: function(o) {"," o.th = this._createTheadThNode(o);"," this._attachTheadThNode(o);"," //TODO: assign all node pointers: thNode, thLinerNode, thLabelNode"," o.column.thNode = o.th;"," },",""," /*"," * Creates header cell element."," *"," * @method _createTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," * @return {Node}"," */"," _createTheadThNode: function(o) {"," var column = o.column;"," "," // Populate template object"," o.id = column.get(\"id\");//TODO: validate 1 column ID per document"," o.colspan = column.colSpan;"," o.rowspan = column.rowSpan;"," o.abbr = column.get(\"abbr\");"," o.classnames = column.get(\"classnames\");"," o.value = fromTemplate(this.get(\"thValueTemplate\"), o);",""," /*TODO"," // Clear minWidth on hidden Columns"," if(column.get(\"hidden\")) {"," //this._clearMinWidth(column);"," }"," */"," "," return Ycreate(fromTemplate(this.thTemplate, o));"," },",""," /*"," * Attaches header cell element."," *"," * @method _attachTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _attachTheadThNode: function(o) {"," o.tr.appendChild(o.th);"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // TBODY/RECORDSET FUNCTIONALITY"," //"," ////////////////////////////////////////////////////////////////////////////"," /*"," * Updates TBODY."," *"," * @method _uiSetRecordset"," * @param rs {Recordset} New Recordset."," * @protected"," */"," _uiSetRecordset: function(rs) {"," var self = this,"," oldTbody = this._tbodyNode,"," parent = oldTbody.get(\"parentNode\"),"," nextSibling = oldTbody.next(),"," columns = this.get('columnset').keys,"," cellValueTemplate = this.get('tdValueTemplate'),"," o = {},"," newTbody, i, len, column, formatter;",""," // Replace TBODY with a new one"," //TODO: split _addTbodyNode into create/attach"," oldTbody.remove();"," oldTbody = null;"," newTbody = this._addTbodyNode(this._tableNode);"," newTbody.remove();"," this._tbodyNode = newTbody;"," o.tbody = newTbody;",""," o.rowTemplate = this.get('trTemplate');"," o.columns = [];",""," // Build up column data to avoid passing through Attribute APIs inside"," // render loops for rows and cells"," for (i = columns.length - 1; i >= 0; --i) {"," column = columns[i];"," o.columns[i] = {"," column : column,"," fields : column.get('field'),"," classnames : column.get('classnames'),"," emptyCellValue: column.get('emptyCellValue')"," }",""," formatter = column.get('formatter');",""," if (YLang.isFunction(formatter)) {"," // function formatters need to run before checking if the value"," // needs defaulting from column.emptyCellValue"," formatter = Y.bind(this._functionFormatter, this, formatter);"," } else {"," if (!YLang.isString(formatter)) {"," formatter = cellValueTemplate;"," }",""," // string formatters need the value defaulted before processing"," formatter = Y.bind(this._templateFormatter, this, formatter);"," }",""," o.columns[i].formatter = formatter;"," }","",""," // Iterate Recordset to use existing TR when possible or add new TR"," // TODO i = this.get(\"state.offsetIndex\")"," // TODO len =this.get(\"state.pageLength\")"," for (i = 0, len = rs.size(); i < len; ++i) {"," o.record = rs.item(i);"," o.data = o.record.get(\"data\");"," o.rowindex = i;"," this._addTbodyTrNode(o); //TODO: sometimes rowindex != recordindex"," }"," "," // TBODY to DOM"," parent.insert(this._tbodyNode, nextSibling);"," },",""," _functionFormatter: function (formatter, o) {"," var value = formatter.call(this, o);",""," return (value !== undefined) ? value : o.emptyCellValue;"," },",""," _templateFormatter: function (template, o) {"," if (o.value === undefined) {"," o.value = o.emptyCellValue;"," }",""," return fromTemplate(template, o);"," },",""," /*"," * Creates and attaches data row element."," *"," * @method _addTbodyTrNode"," * @param o {Object} {tbody, record}"," * @protected"," */"," _addTbodyTrNode: function(o) {"," var row = o.tbody.one(\"#\" + o.record.get(\"id\"));",""," o.tr = row || this._createTbodyTrNode(o);",""," this._attachTbodyTrNode(o);"," },",""," /*"," * Creates data row element."," *"," * @method _createTbodyTrNode"," * @param o {Object} {tbody, record}"," * @protected"," * @return {Node}"," */"," _createTbodyTrNode: function(o) {"," var columns = o.columns,"," i, len, columnInfo;",""," o.tr = Ycreate(fromTemplate(o.rowTemplate, { id: o.record.get('id') }));"," "," for (i = 0, len = columns.length; i < len; ++i) {"," columnInfo = columns[i];"," o.column = columnInfo.column;"," o.field = columnInfo.fields;"," o.classnames = columnInfo.classnames;"," o.formatter = columnInfo.formatter;"," o.emptyCellValue= columnInfo.emptyCellValue;",""," this._addTbodyTdNode(o);"," }"," "," return o.tr;"," },",""," /*"," * Attaches data row element."," *"," * @method _attachTbodyTrNode"," * @param o {Object} {tbody, record, tr}."," * @protected"," */"," _attachTbodyTrNode: function(o) {"," var tbody = o.tbody,"," tr = o.tr,"," index = o.rowindex,"," nextSibling = tbody.get(\"children\").item(index) || null,"," isOdd = (index % 2);"," "," if(isOdd) {"," tr.replaceClass(CLASS_EVEN, CLASS_ODD);"," } else {"," tr.replaceClass(CLASS_ODD, CLASS_EVEN);"," }"," "," tbody.insertBefore(tr, nextSibling);"," },",""," /*"," * Creates and attaches data cell element."," *"," * @method _addTbodyTdNode"," * @param o {Object} {record, column, tr}."," * @protected"," */"," _addTbodyTdNode: function(o) {"," o.td = this._createTbodyTdNode(o);"," this._attachTbodyTdNode(o);"," delete o.td;"," },"," "," /*"," Creates a TD Node from the tdTemplate property using the input object as"," template {placeholder} values. The created Node is also assigned to the"," `td` property on the input object.",""," If the input object already has a `td` property, it is returned an no new"," Node is created.",""," @method createCell"," @param {Object} data Template values"," @return {Node}"," **/"," createCell: function (data) {"," return data && (data.td ||"," (data.td = Ycreate(fromTemplate(this.tdTemplate, data))));"," },",""," /*"," * Creates data cell element."," *"," * @method _createTbodyTdNode"," * @param o {Object} {record, column, tr}."," * @protected"," * @return {Node}"," */"," _createTbodyTdNode: function(o) {"," o.headers = o.column.headers;"," o.value = this.formatDataCell(o);",""," return o.td || this.createCell(o);"," },"," "," /*"," * Attaches data cell element."," *"," * @method _attachTbodyTdNode"," * @param o {Object} {record, column, tr, headers, classnames, value}."," * @protected"," */"," _attachTbodyTdNode: function(o) {"," o.tr.appendChild(o.td);"," },",""," /*"," * Returns markup to insert into data cell element."," *"," * @method formatDataCell"," * @param @param o {Object} {record, column, tr, headers, classnames}."," */"," formatDataCell: function (o) {"," o.value = o.data[o.field];",""," return o.formatter.call(this, o);"," },",""," _initRecordset: function () {"," return new Y.Recordset({ records: [] });"," }","});","","Y.namespace(\"DataTable\").Base = DTBase;","","","}, '3.7.3' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});"]; _yuitest_coverage["/build/datatable-base-deprecated/datatable-base-deprecated.js"].lines = {"1":0,"6":0,"56":0,"57":0,"65":0,"222":0,"236":0,"247":0,"258":0,"269":0,"280":0,"382":0,"397":0,"408":0,"412":0,"423":0,"424":0,"432":0,"467":0,"481":0,"538":0,"551":0,"552":0,"559":0,"562":0,"563":0,"567":0,"568":0,"570":0,"573":0,"576":0,"579":0,"580":0,"583":0,"584":0,"588":0,"589":0,"590":0,"592":0,"594":0,"597":0,"598":0,"600":0,"604":0,"607":0,"611":0,"613":0,"617":0,"621":0,"622":0,"623":0,"624":0,"626":0,"627":0,"652":0,"657":0,"658":0,"659":0,"660":0,"662":0,"663":0,"665":0,"666":0,"668":0,"669":0,"671":0,"672":0,"674":0,"675":0,"677":0,"678":0,"680":0,"681":0,"683":0,"684":0,"698":0,"700":0,"701":0,"706":0,"708":0,"709":0,"713":0,"717":0,"718":0,"728":0,"729":0,"735":0,"736":0,"738":0,"742":0,"743":0,"745":0,"746":0,"747":0,"748":0,"751":0,"752":0,"753":0,"754":0,"758":0,"759":0,"766":0,"767":0,"768":0,"771":0,"772":0,"773":0,"774":0,"781":0,"784":0,"793":0,"797":0,"798":0,"799":0,"800":0,"803":0,"804":0,"805":0,"806":0,"807":0,"816":0,"866":0,"867":0,"875":0,"989":0,"1043":0,"1054":0,"1065":0,"1066":0,"1069":0,"1070":0,"1081":0,"1092":0,"1103":0,"1114":0,"1130":0,"1147":0,"1150":0,"1153":0,"1156":0,"1159":0,"1162":0,"1174":0,"1175":0,"1177":0,"1190":0,"1194":0,"1195":0,"1198":0,"1201":0,"1203":0,"1215":0,"1216":0,"1217":0,"1230":0,"1231":0,"1243":0,"1244":0,"1256":0,"1272":0,"1283":0,"1284":0,"1287":0,"1306":0,"1308":0,"1310":0,"1312":0,"1323":0,"1324":0,"1335":0,"1339":0,"1341":0,"1343":0,"1361":0,"1369":0,"1371":0,"1374":0,"1375":0,"1387":0,"1401":0,"1402":0,"1418":0,"1425":0,"1426":0,"1428":0,"1429":0,"1432":0,"1433":0,"1434":0,"1437":0,"1448":0,"1459":0,"1460":0,"1462":0,"1474":0,"1477":0,"1478":0,"1479":0,"1480":0,"1481":0,"1482":0,"1491":0,"1502":0,"1518":0,"1529":0,"1530":0,"1531":0,"1532":0,"1533":0,"1534":0,"1536":0,"1537":0,"1541":0,"1542":0,"1543":0,"1550":0,"1552":0,"1555":0,"1557":0,"1558":0,"1562":0,"1565":0,"1572":0,"1573":0,"1574":0,"1575":0,"1576":0,"1580":0,"1584":0,"1586":0,"1590":0,"1591":0,"1594":0,"1605":0,"1607":0,"1609":0,"1621":0,"1624":0,"1626":0,"1627":0,"1628":0,"1629":0,"1630":0,"1631":0,"1632":0,"1634":0,"1637":0,"1648":0,"1654":0,"1655":0,"1657":0,"1660":0,"1671":0,"1672":0,"1673":0,"1689":0,"1702":0,"1703":0,"1705":0,"1716":0,"1726":0,"1728":0,"1732":0,"1736":0}; _yuitest_coverage["/build/datatable-base-deprecated/datatable-base-deprecated.js"].functions = {"Column:56":0,"_defaultId:235":0,"_defaultKey:246":0,"_defaultField:257":0,"_defaultLabel:268":0,"_afterAbbrChange:279":0,"_getClassnames:381":0,"syncUI:396":0,"_uiSetAbbr:407":0,"Columnset:423":0,"_setDefinitions:480":0,"parseColumns:551":0,"initializer:535":0,"_cascadePropertiesToChildren:650":0,"countTerminalChildNodes:700":0,"_setColSpans:696":0,"countMaxRowDepth:735":0,"parseDomTreeForRowSpan:728":0,"_setRowSpans:726":0,"recurseAncestorsForHeaders:797":0,"_setHeaders:792":0,"DTBase:866":0,"_setColumnset:1042":0,"_afterColumnsetChange:1053":0,"_setRecordset:1064":0,"_afterRecordsetChange:1080":0,"_afterRecordsChange:1091":0,"_afterSummaryChange:1102":0,"_afterCaptionChange:1113":0,"destructor:1129":0,"renderUI:1145":0,"_addTableNode:1173":0,"_addColgroupNode:1188":0,"_addTheadNode:1214":0,"_addTbodyNode:1229":0,"_addMessageNode:1242":0,"_addCaptionNode:1255":0,"bindUI:1271":0,"delegate:1281":0,"syncUI:1304":0,"_uiSetSummary:1322":0,"_uiSetCaption:1334":0,"_uiSetColumnset:1360":0,"_addTheadTrNode:1400":0,"_createTheadTrNode:1416":0,"_attachTheadTrNode:1447":0,"_addTheadThNode:1458":0,"_createTheadThNode:1473":0,"_attachTheadThNode:1501":0,"_uiSetRecordset:1517":0,"_functionFormatter:1583":0,"_templateFormatter:1589":0,"_addTbodyTrNode:1604":0,"_createTbodyTrNode:1620":0,"_attachTbodyTrNode:1647":0,"_addTbodyTdNode:1670":0,"createCell:1688":0,"_createTbodyTdNode:1701":0,"_attachTbodyTdNode:1715":0,"formatDataCell:1725":0,"_initRecordset:1731":0,"(anonymous 1):1":0}; _yuitest_coverage["/build/datatable-base-deprecated/datatable-base-deprecated.js"].coveredLines = 264;@@ -2101,4 +2101,4 @@ Y.namespace("DataTable").Base = DTBase; -}, '3.7.2' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});+}, '3.7.3' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});
bundle/datatable-base-deprecated/datatable-base-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1742,4 +1742,4 @@ Y.namespace("DataTable").Base = DTBase; -}, '3.7.2' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});+}, '3.7.3' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});
bundle/datatable-base-deprecated/datatable-base-deprecated-min.js view
@@ -1,8 +1,8 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("datatable-base-deprecated",function(c){var w=c.Lang,g=w.isValue,F=c.Lang.sub,d=c.Node,t=d.create,p=c.ClassNameManager.getClassName,q="datatable",r="column",H="focus",K="keydown",h="mouseenter",o="mouseleave",k="mouseup",z="mousedown",C="click",v="dblclick",e=p(q,"columns"),B=p(q,"data"),b=p(q,"msg"),l=p(q,"liner"),E=p(q,"first"),i=p(q,"last"),u=p(q,"even"),A=p(q,"odd"),D="<table></table>",x="<col></col>",I='<thead class="'+e+'"></thead>',f='<tbody class="'+B+'"></tbody>',J='<th id="{id}" rowspan="{rowspan}" colspan="{colspan}" class="{classnames}" abbr="{abbr}"><div class="'+l+'">{value}</div></th>',G='<tr id="{id}"></tr>',a='<td headers="{headers}" class="{classnames}"><div class="'+l+'">{value}</div></td>',j="{value}",n='<tbody class="'+b+'"></tbody>';function m(L){m.superclass.constructor.apply(this,arguments);}c.mix(m,{NAME:"column",ATTRS:{id:{valueFn:"_defaultId",readOnly:true},key:{valueFn:"_defaultKey"},field:{valueFn:"_defaultField"},label:{valueFn:"_defaultLabel"},children:{value:null},abbr:{value:""},classnames:{readOnly:true,getter:"_getClassnames"},formatter:{},emptyCellValue:{value:"",validator:c.Lang.isString},sortable:{value:false},editor:{},width:{},resizeable:{},minimized:{},minWidth:{},maxAutoWidth:{}}});c.extend(m,c.Widget,{_defaultId:function(){return c.guid();},_defaultKey:function(){return c.guid();},_defaultField:function(){return this.get("key");},_defaultLabel:function(){return this.get("key");},_afterAbbrChange:function(L){this._uiSetAbbr(L.newVal);},keyIndex:null,headers:null,colSpan:1,rowSpan:1,parent:null,thNode:null,initializer:function(L){},destructor:function(){},_getClassnames:function(){return c.ClassNameManager.getClassName(r,this.get("key").replace(/[^\w\-]/g,""));},syncUI:function(){this._uiSetAbbr(this.get("abbr"));},_uiSetAbbr:function(L){this.thNode.set("abbr",L);}});c.Column=m;function y(L){y.superclass.constructor.apply(this,arguments);}c.mix(y,{NAME:"columnset",ATTRS:{definitions:{setter:"_setDefinitions"}}});c.extend(y,c.Base,{_setDefinitions:function(L){return c.clone(L);},tree:null,idHash:null,keyHash:null,keys:null,initializer:function(){var L=[],Q={},R={},P=[],O=this.get("definitions"),M=this;function N(Z,Y,X){var U=0,T=Y.length,W,V,S;Z++;if(!L[Z]){L[Z]=[];}for(;U<T;++U){W=Y[U];W=w.isString(W)?{key:W}:W;V=new c.Column(W);W.yuiColumnId=V.get("id");Q[V.get("id")]=V;R[V.get("key")]=V;if(X){V.parent=X;}if(w.isArray(W.children)){S=W.children;V._set("children",S);M._setColSpans(V,W);M._cascadePropertiesToChildren(V,S);if(!L[Z+1]){L[Z+1]=[];}N(Z,S,V);}else{V.keyIndex=P.length;P.push(V);}L[Z].push(V);}Z--;}N(-1,O);this.tree=L;this.idHash=Q;this.keyHash=R;this.keys=P;this._setRowSpans();this._setHeaders();},destructor:function(){},_cascadePropertiesToChildren:function(O,M){var N=0,L=M.length,P;for(;N<L;++N){P=M[N];if(O.get("className")&&(P.className===undefined)){P.className=O.get("className");}if(O.get("editor")&&(P.editor===undefined)){P.editor=O.get("editor");}if(O.get("formatter")&&(P.formatter===undefined)){P.formatter=O.get("formatter");}if(O.get("resizeable")&&(P.resizeable===undefined)){P.resizeable=O.get("resizeable");}if(O.get("sortable")&&(P.sortable===undefined)){P.sortable=O.get("sortable");}if(O.get("hidden")){P.hidden=true;}if(O.get("width")&&(P.width===undefined)){P.width=O.get("width");}if(O.get("minWidth")&&(P.minWidth===undefined)){P.minWidth=O.get("minWidth");}if(O.get("maxAutoWidth")&&(P.maxAutoWidth===undefined)){P.maxAutoWidth=O.get("maxAutoWidth");}}},_setColSpans:function(N,M){var O=0;function L(R){var S=R.children,Q=0,P=S.length;for(;Q<P;++Q){if(w.isArray(S[Q].children)){L(S[Q]);}else{O++;}}}L(M);N.colSpan=O;},_setRowSpans:function(){function L(N){var O=1,Q,P,M,S;function R(X,W){W=W||1;var V=0,T=X.length,U;for(;V<T;++V){U=X[V];if(w.isArray(U.children)){W++;R(U.children,W);W--;}else{if(U.get&&w.isArray(U.get("children"))){W++;R(U.get("children"),W);W--;}else{if(W>O){O=W;}}}}}for(M=0;M<N.length;M++){Q=N[M];R(Q);for(S=0;S<Q.length;S++){P=Q[S];if(!w.isArray(P.get("children"))){P.rowSpan=O;}}O=1;}}L(this.tree);},_setHeaders:function(){var Q,O,N=this.keys,M=0,L=N.length;function P(S,R){S.push(R.get("id"));if(R.parent){P(S,R.parent);}}for(;M<L;++M){Q=[];O=N[M];P(Q,O);O.headers=Q.reverse().join(" ");}},getColumn:function(){}});c.Columnset=y;function s(L){s.superclass.constructor.apply(this,arguments);}c.mix(s,{NAME:"dataTable",ATTRS:{columnset:{setter:"_setColumnset"},recordset:{valueFn:"_initRecordset",setter:"_setRecordset"},summary:{},caption:{},thValueTemplate:{value:j},tdValueTemplate:{value:j},trTemplate:{value:G}},HTML_PARSER:{}});c.extend(s,c.Widget,{thTemplate:J,tdTemplate:a,_theadNode:null,_tbodyNode:null,_msgNode:null,_setColumnset:function(L){return w.isArray(L)?new c.Columnset({definitions:L}):L;},_afterColumnsetChange:function(L){this._uiSetColumnset(L.newVal);},_setRecordset:function(L){if(w.isArray(L)){L=new c.Recordset({records:L});}L.addTarget(this);return L;},_afterRecordsetChange:function(L){this._uiSetRecordset(L.newVal);},_afterRecordsChange:function(L){this._uiSetRecordset(this.get("recordset"));},_afterSummaryChange:function(L){this._uiSetSummary(L.newVal);},_afterCaptionChange:function(L){this._uiSetCaption(L.newVal);},destructor:function(){this.get("recordset").removeTarget(this);},renderUI:function(){this._addTableNode(this.get("contentBox"));this._addColgroupNode(this._tableNode);this._addTheadNode(this._tableNode);this._addTbodyNode(this._tableNode);this._addMessageNode(this._tableNode);this._addCaptionNode(this._tableNode);},_addTableNode:function(L){if(!this._tableNode){this._tableNode=L.appendChild(t(D));}return this._tableNode;},_addColgroupNode:function(N){var L=this.get("columnset").keys.length,M=0,O=["<colgroup>"];for(;M<L;++M){O.push(x);}O.push("</colgroup>");this._colgroupNode=N.insertBefore(t(O.join("")),N.get("firstChild"));return this._colgroupNode;},_addTheadNode:function(L){if(L){this._theadNode=L.insertBefore(t(I),this._colgroupNode.next());return this._theadNode;}},_addTbodyNode:function(L){this._tbodyNode=L.appendChild(t(f));-return this._tbodyNode;},_addMessageNode:function(L){this._msgNode=L.insertBefore(t(n),this._tbodyNode);return this._msgNode;},_addCaptionNode:function(L){this._captionNode=c.Node.create("<caption></caption>");},bindUI:function(){this.after({columnsetChange:this._afterColumnsetChange,summaryChange:this._afterSummaryChange,captionChange:this._afterCaptionChange,recordsetChange:this._afterRecordsChange,"recordset:tableChange":this._afterRecordsChange});},delegate:function(L){if(L==="dblclick"){this.get("boundingBox").delegate.apply(this.get("boundingBox"),arguments);}else{this.get("contentBox").delegate.apply(this.get("contentBox"),arguments);}},syncUI:function(){this._uiSetColumnset(this.get("columnset"));this._uiSetRecordset(this.get("recordset"));this._uiSetSummary(this.get("summary"));this._uiSetCaption(this.get("caption"));},_uiSetSummary:function(L){L=g(L)?L:"";this._tableNode.set("summary",L);},_uiSetCaption:function(N){var L=this._captionNode,M=L.inDoc(),O=N?(!M&&"prepend"):(M&&"removeChild");L.setContent(N||"");if(O){this._tableNode[O](L);}},_uiSetColumnset:function(P){var M=P.tree,R=this._theadNode,N=0,L=M.length,O=R.get("parentNode"),Q=R.next();R.remove();R.get("children").remove(true);for(;N<L;++N){this._addTheadTrNode({thead:R,columns:M[N],id:""},(N===0),(N===L-1));}O.insert(R,Q);},_addTheadTrNode:function(N,L,M){N.tr=this._createTheadTrNode(N,L,M);this._attachTheadTrNode(N);},_createTheadTrNode:function(S,M,R){var Q=t(F(this.get("trTemplate"),S)),O=0,N=S.columns,L=N.length,P;if(M){Q.addClass(E);}if(R){Q.addClass(i);}for(;O<L;++O){P=N[O];this._addTheadThNode({value:P.get("label"),column:P,tr:Q});}return Q;},_attachTheadTrNode:function(L){L.thead.appendChild(L.tr);},_addTheadThNode:function(L){L.th=this._createTheadThNode(L);this._attachTheadThNode(L);L.column.thNode=L.th;},_createTheadThNode:function(M){var L=M.column;M.id=L.get("id");M.colspan=L.colSpan;M.rowspan=L.rowSpan;M.abbr=L.get("abbr");M.classnames=L.get("classnames");M.value=F(this.get("thValueTemplate"),M);return t(F(this.thTemplate,M));},_attachTheadThNode:function(L){L.tr.appendChild(L.th);},_uiSetRecordset:function(O){var X=this,T=this._tbodyNode,W=T.get("parentNode"),P=T.next(),N=this.get("columnset").keys,R=this.get("tdValueTemplate"),L={},U,Q,S,M,V;T.remove();T=null;U=this._addTbodyNode(this._tableNode);U.remove();this._tbodyNode=U;L.tbody=U;L.rowTemplate=this.get("trTemplate");L.columns=[];for(Q=N.length-1;Q>=0;--Q){M=N[Q];L.columns[Q]={column:M,fields:M.get("field"),classnames:M.get("classnames"),emptyCellValue:M.get("emptyCellValue")};V=M.get("formatter");if(w.isFunction(V)){V=c.bind(this._functionFormatter,this,V);}else{if(!w.isString(V)){V=R;}V=c.bind(this._templateFormatter,this,V);}L.columns[Q].formatter=V;}for(Q=0,S=O.size();Q<S;++Q){L.record=O.item(Q);L.data=L.record.get("data");L.rowindex=Q;this._addTbodyTrNode(L);}W.insert(this._tbodyNode,P);},_functionFormatter:function(L,N){var M=L.call(this,N);return(M!==undefined)?M:N.emptyCellValue;},_templateFormatter:function(L,M){if(M.value===undefined){M.value=M.emptyCellValue;}return F(L,M);},_addTbodyTrNode:function(M){var L=M.tbody.one("#"+M.record.get("id"));M.tr=L||this._createTbodyTrNode(M);this._attachTbodyTrNode(M);},_createTbodyTrNode:function(P){var N=P.columns,M,L,O;P.tr=t(F(P.rowTemplate,{id:P.record.get("id")}));for(M=0,L=N.length;M<L;++M){O=N[M];P.column=O.column;P.field=O.fields;P.classnames=O.classnames;P.formatter=O.formatter;P.emptyCellValue=O.emptyCellValue;this._addTbodyTdNode(P);}return P.tr;},_attachTbodyTrNode:function(Q){var N=Q.tbody,P=Q.tr,M=Q.rowindex,O=N.get("children").item(M)||null,L=(M%2);if(L){P.replaceClass(u,A);}else{P.replaceClass(A,u);}N.insertBefore(P,O);},_addTbodyTdNode:function(L){L.td=this._createTbodyTdNode(L);this._attachTbodyTdNode(L);delete L.td;},createCell:function(L){return L&&(L.td||(L.td=t(F(this.tdTemplate,L))));},_createTbodyTdNode:function(L){L.headers=L.column.headers;L.value=this.formatDataCell(L);return L.td||this.createCell(L);},_attachTbodyTdNode:function(L){L.tr.appendChild(L.td);},formatDataCell:function(L){L.value=L.data[L.field];return L.formatter.call(this,L);},_initRecordset:function(){return new c.Recordset({records:[]});}});c.namespace("DataTable").Base=s;},"3.7.2",{requires:["recordset-base","widget","substitute","event-mouseenter"]});+return this._tbodyNode;},_addMessageNode:function(L){this._msgNode=L.insertBefore(t(n),this._tbodyNode);return this._msgNode;},_addCaptionNode:function(L){this._captionNode=c.Node.create("<caption></caption>");},bindUI:function(){this.after({columnsetChange:this._afterColumnsetChange,summaryChange:this._afterSummaryChange,captionChange:this._afterCaptionChange,recordsetChange:this._afterRecordsChange,"recordset:tableChange":this._afterRecordsChange});},delegate:function(L){if(L==="dblclick"){this.get("boundingBox").delegate.apply(this.get("boundingBox"),arguments);}else{this.get("contentBox").delegate.apply(this.get("contentBox"),arguments);}},syncUI:function(){this._uiSetColumnset(this.get("columnset"));this._uiSetRecordset(this.get("recordset"));this._uiSetSummary(this.get("summary"));this._uiSetCaption(this.get("caption"));},_uiSetSummary:function(L){L=g(L)?L:"";this._tableNode.set("summary",L);},_uiSetCaption:function(N){var L=this._captionNode,M=L.inDoc(),O=N?(!M&&"prepend"):(M&&"removeChild");L.setContent(N||"");if(O){this._tableNode[O](L);}},_uiSetColumnset:function(P){var M=P.tree,R=this._theadNode,N=0,L=M.length,O=R.get("parentNode"),Q=R.next();R.remove();R.get("children").remove(true);for(;N<L;++N){this._addTheadTrNode({thead:R,columns:M[N],id:""},(N===0),(N===L-1));}O.insert(R,Q);},_addTheadTrNode:function(N,L,M){N.tr=this._createTheadTrNode(N,L,M);this._attachTheadTrNode(N);},_createTheadTrNode:function(S,M,R){var Q=t(F(this.get("trTemplate"),S)),O=0,N=S.columns,L=N.length,P;if(M){Q.addClass(E);}if(R){Q.addClass(i);}for(;O<L;++O){P=N[O];this._addTheadThNode({value:P.get("label"),column:P,tr:Q});}return Q;},_attachTheadTrNode:function(L){L.thead.appendChild(L.tr);},_addTheadThNode:function(L){L.th=this._createTheadThNode(L);this._attachTheadThNode(L);L.column.thNode=L.th;},_createTheadThNode:function(M){var L=M.column;M.id=L.get("id");M.colspan=L.colSpan;M.rowspan=L.rowSpan;M.abbr=L.get("abbr");M.classnames=L.get("classnames");M.value=F(this.get("thValueTemplate"),M);return t(F(this.thTemplate,M));},_attachTheadThNode:function(L){L.tr.appendChild(L.th);},_uiSetRecordset:function(O){var X=this,T=this._tbodyNode,W=T.get("parentNode"),P=T.next(),N=this.get("columnset").keys,R=this.get("tdValueTemplate"),L={},U,Q,S,M,V;T.remove();T=null;U=this._addTbodyNode(this._tableNode);U.remove();this._tbodyNode=U;L.tbody=U;L.rowTemplate=this.get("trTemplate");L.columns=[];for(Q=N.length-1;Q>=0;--Q){M=N[Q];L.columns[Q]={column:M,fields:M.get("field"),classnames:M.get("classnames"),emptyCellValue:M.get("emptyCellValue")};V=M.get("formatter");if(w.isFunction(V)){V=c.bind(this._functionFormatter,this,V);}else{if(!w.isString(V)){V=R;}V=c.bind(this._templateFormatter,this,V);}L.columns[Q].formatter=V;}for(Q=0,S=O.size();Q<S;++Q){L.record=O.item(Q);L.data=L.record.get("data");L.rowindex=Q;this._addTbodyTrNode(L);}W.insert(this._tbodyNode,P);},_functionFormatter:function(L,N){var M=L.call(this,N);return(M!==undefined)?M:N.emptyCellValue;},_templateFormatter:function(L,M){if(M.value===undefined){M.value=M.emptyCellValue;}return F(L,M);},_addTbodyTrNode:function(M){var L=M.tbody.one("#"+M.record.get("id"));M.tr=L||this._createTbodyTrNode(M);this._attachTbodyTrNode(M);},_createTbodyTrNode:function(P){var N=P.columns,M,L,O;P.tr=t(F(P.rowTemplate,{id:P.record.get("id")}));for(M=0,L=N.length;M<L;++M){O=N[M];P.column=O.column;P.field=O.fields;P.classnames=O.classnames;P.formatter=O.formatter;P.emptyCellValue=O.emptyCellValue;this._addTbodyTdNode(P);}return P.tr;},_attachTbodyTrNode:function(Q){var N=Q.tbody,P=Q.tr,M=Q.rowindex,O=N.get("children").item(M)||null,L=(M%2);if(L){P.replaceClass(u,A);}else{P.replaceClass(A,u);}N.insertBefore(P,O);},_addTbodyTdNode:function(L){L.td=this._createTbodyTdNode(L);this._attachTbodyTdNode(L);delete L.td;},createCell:function(L){return L&&(L.td||(L.td=t(F(this.tdTemplate,L))));},_createTbodyTdNode:function(L){L.headers=L.column.headers;L.value=this.formatDataCell(L);return L.td||this.createCell(L);},_attachTbodyTdNode:function(L){L.tr.appendChild(L.td);},formatDataCell:function(L){L.value=L.data[L.field];return L.formatter.call(this,L);},_initRecordset:function(){return new c.Recordset({records:[]});}});c.namespace("DataTable").Base=s;},"3.7.3",{requires:["recordset-base","widget","substitute","event-mouseenter"]});
bundle/datatable-base-deprecated/datatable-base-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1742,4 +1742,4 @@ Y.namespace("DataTable").Base = DTBase; -}, '3.7.2' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});+}, '3.7.3' ,{requires:['recordset-base','widget','substitute','event-mouseenter']});
bundle/datatable-base/assets/datatable-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base/assets/skins/night/datatable-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base/assets/skins/night/datatable-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base/assets/skins/sam/datatable-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base/assets/skins/sam/datatable-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-base/datatable-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-base/datatable-base.js", code: [] };-_yuitest_coverage["build/datatable-base/datatable-base.js"].code=["YUI.add('datatable-base', function (Y, NAME) {","","/**","A Widget for displaying tabular data. The base implementation of DataTable","provides the ability to dynamically generate an HTML table from a set of column","configurations and row data.","","Two classes are included in the `datatable-base` module: `Y.DataTable` and","`Y.DataTable.Base`.","","@module datatable","@submodule datatable-base","@main datatable","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","A Widget for displaying tabular data. Before feature modules are `use()`d,","this class is functionally equivalent to DataTable.Base. However, feature","modules can modify this class in non-destructive ways, expanding the API and","functionality.","","This is the primary DataTable class. Out of the box, it provides the ability","to dynamically generate an HTML table from a set of column configurations and","row data. But feature module inclusion can add table sorting, pagintaion,","highlighting, selection, and more.","","<pre><code>","// The functionality of this table would require additional modules be use()d,","// but the feature APIs are aggregated onto Y.DataTable.","// (Snippet is for illustration. Not all features are available today.)","var table = new Y.DataTable({"," columns: ["," { type: 'checkbox', defaultChecked: true },"," { key: 'firstName', sortable: true, resizable: true },"," { key: 'lastName', sortable: true },"," { key: 'role', formatter: toRoleName }"," ],"," data: {"," source: 'http://myserver.com/service/json',"," type: 'json',"," schema: {"," resultListLocator: 'results.users',"," fields: ["," 'username',"," 'firstName',"," 'lastName',"," { key: 'role', type: 'number' }"," ]"," }"," },"," recordType: UserModel,"," pagedData: {"," location: 'footer',"," pageSizes: [20, 50, 'all'],"," rowsPerPage: 20,"," pageLinks: 5"," },"," editable: true","});","</code></pre>","","### Column Configuration","","The column configurations are set in the form of an array of objects, where","each object corresponds to a column. For columns populated directly from the","row data, a 'key' property is required to bind the column to that property or","attribute in the row data.","","Not all columns need to relate to row data, nor do all properties or attributes","of the row data need to have a corresponding column. However, only those","columns included in the `columns` configuration attribute will be rendered.","","Other column configuration properties are supported by the configured","`view`, class as well as any features added by plugins or class extensions.","See the description of DataTable.TableView and its subviews","DataTable.HeaderView, DataTable.BodyView, and DataTable.FooterView (and other","DataTable feature classes) to see what column properties they support.","","Some examples of column configurations would be:","","<pre><code>","// Basic","var columns = [{ key: 'firstName' }, { key: 'lastName' }, { key: 'age' }];","","// For columns without any additional configuration, strings can be used","var columns = ['firstName', 'lastName', 'age'];","","// Multi-row column headers (see DataTable.HeaderView for details)","var columns = ["," {"," label: 'Name',"," children: ["," { key: 'firstName' },"," { key: 'lastName' }"," ]"," },"," 'age' // mixing and matching objects and strings is ok","];","","// Including columns that are not related 1:1 to row data fields/attributes","// (See DataTable.BodyView for details)","var columns = ["," {"," label: 'Name', // Needed for the column header"," formatter: function (o) {"," // Fill the column cells with data from firstName and lastName"," if (o.data.age > 55) {"," o.className += ' senior';"," }"," return o.data.lastName + ', ' + o.data.firstName;"," }"," },"," 'age'","];","","// Columns that include feature configurations (for illustration; not all","// features are available today).","var columns = ["," { type: 'checkbox', defaultChecked: true },"," { key: 'firstName', sortable: true, resizable: true, min-width: '300px' },"," { key: 'lastName', sortable: true, resizable: true, min-width: '300px' },"," { key: 'age', emptyCellValue: '<em>unknown</em>' }","];","</code></pre>","","### Row Data Configuration","","The `data` configuration attribute is responsible for housing the data objects that will be rendered as rows. You can provide this information in two ways by default:","","1. An array of simple objects with key:value pairs","2. A ModelList of Base-based class instances (presumably Model subclass"," instances)","","If an array of objects is passed, it will be translated into a ModelList filled","with instances of the class provided to the `recordType` attribute. This","attribute can also create a custom Model subclass from an array of field names","or an object of attribute configurations. If no `recordType` is provided, one","will be created for you from available information (see `_initRecordType`).","Providing either your own ModelList instance for `data`, or at least Model","class for `recordType`, is the best way to control client-server","synchronization when modifying data on the client side.","","The ModelList instance that manages the table's data is available in the `data`","property on the DataTable instance.","","","### Rendering","","Table rendering is a collaborative process between the DataTable and its","configured `view`. The DataTable creates an instance of the configured `view`","(DataTable.TableView by default), and calls its `render()` method.","DataTable.TableView, for instance, then creates the `<table>` and `<caption>`,","then delegates the rendering of the specific sections of the table to subviews,","which can be configured as `headerView`, `bodyView`, and `footerView`.","DataTable.TableView defaults the `headerView` to DataTable.HeaderView and the","`bodyView` to DataTable.BodyView, but leaves the `footerView` unassigned.","Setting any subview to `null` will result in that table section not being","rendered.","","@class DataTable","@extends DataTable.Base","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","The baseline implementation of a DataTable. This class should be used","primarily as a superclass for a custom DataTable with a specific set of","features. Because features can be composed onto `Y.DataTable`, custom","subclasses of DataTable.Base will remain unmodified when new feature modules","are loaded.","","Example usage might look like this:","","<pre><code>","// Custom subclass with only sorting and mutability added. If other datatable","// feature modules are loaded, this class will not be affected.","var MyTableClass = Y.Base.create('table', Y.DataTable.Base,"," [ Y.DataTable.Sortable, Y.DataTable.Mutable ]);","","var table = new MyTableClass({"," columns: ['firstName', 'lastName', 'age'],"," data: ["," { firstName: 'Frank', lastName: 'Zappa', age: 71 },"," { firstName: 'Frank', lastName: 'Lloyd Wright', age: 144 },"," { firstName: 'Albert', lastName: 'Einstein', age: 132 },"," ..."," ]","});","","table.render('#over-there');","","// DataTable.Base can be instantiated if a featureless table is needed.","var table = new Y.DataTable.Base({"," columns: ['firstName', 'lastName', 'age'],"," data: ["," { firstName: 'Frank', lastName: 'Zappa', age: 71 },"," { firstName: 'Frank', lastName: 'Lloyd Wright', age: 144 },"," { firstName: 'Albert', lastName: 'Einstein', age: 132 },"," ..."," ]","});","","table.render('#in-here');","</code></pre>","","DataTable.Base is built from DataTable.Core, and sets the default `view`","to `Y.DataTable.TableView`.","","@class Base","@extends Widget","@uses DataTable.Core","@namespace DataTable","@since 3.5.0","**/","Y.DataTable.Base = Y.Base.create('datatable', Y.Widget, [Y.DataTable.Core], {",""," /**"," Pass through to `delegate()` called from the `contentBox`.",""," @method delegate"," @param type {String} the event type to delegate"," @param fn {Function} the callback function to execute. This function"," will be provided the event object for the delegated event."," @param spec {String|Function} a selector that must match the target of the"," event or a function to test target and its parents for a match"," @param context {Object} optional argument that specifies what 'this' refers to"," @param args* {any} 0..n additional arguments to pass on to the callback"," function. These arguments will be added after the event object."," @return {EventHandle} the detach handle"," @since 3.5.0"," **/"," delegate: function () {"," var contentBox = this.get('contentBox');",""," return contentBox.delegate.apply(contentBox, arguments);"," },",""," /**"," Destroys the table `View` if it's been created.",""," @method destructor"," @protected"," @since 3.6.0"," **/"," destructor: function () {"," if (this.view) {"," this.view.destroy();"," }"," },",""," /**"," Returns the `<td>` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," <pre><code>// Previous cell in the previous row"," var cell = table.getCell(e.target, [-1, -1]);",""," // Next cell"," var cell = table.getCell(e.target, 'next');"," var cell = table.getCell(e.taregt, [0, 1];</pre></code>",""," This is actually just a pass through to the `view` instance's method"," by the same name.",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (seed, shift) {"," return this.view && this.view.getCell &&"," this.view.getCell.apply(this.view, arguments);"," },",""," /**"," Returns the `<tr>` Node from the given row index, Model, or Model's"," `clientId`. If the rows haven't been rendered yet, or if the row can't be"," found by the input, `null` is returned.",""," This is actually just a pass through to the `view` instance's method"," by the same name.",""," @method getRow"," @param {Number|String|Model} id Row index, Model instance, or clientId"," @return {Node}"," @since 3.5.0"," **/"," getRow: function (id) {"," return this.view && this.view.getRow &&"," this.view.getRow.apply(this.view, arguments);"," },",""," /**"," Updates the `_displayColumns` property.",""," @method _afterDisplayColumnsChange"," @param {EventFacade} e The `columnsChange` event"," @protected"," @since 3.6.0"," **/"," // FIXME: This is a kludge for back compat with features that reference"," // _displayColumns. They should be updated to TableView plugins."," _afterDisplayColumnsChange: function (e) {"," this._extractDisplayColumns(e.newVal || []);"," },",""," /**"," Attaches subscriptions to relay core change events to the view.",""," @method bindUI"," @protected"," @since 3.6.0"," **/"," bindUI: function () {"," this._eventHandles.relayCoreChanges = this.after("," ['columnsChange',"," 'dataChange',"," 'summaryChange',"," 'captionChange',"," 'widthChange'],"," Y.bind('_relayCoreAttrChange', this));"," },",""," /**"," The default behavior of the `renderView` event. Calls `render()` on the"," `View` instance on the event.",""," @method _defRenderViewFn"," @param {EventFacade} e The `renderView` event"," @protected"," **/"," _defRenderViewFn: function (e) {"," e.view.render();"," },",""," /**"," Processes the full column array, distilling the columns down to those that"," correspond to cell data columns.",""," @method _extractDisplayColumns"," @param {Object[]} columns The full set of table columns"," @protected"," **/"," // FIXME: this is a kludge for back compat, duplicating logic in the"," // tableView"," _extractDisplayColumns: function (columns) {"," var displayColumns = [];",""," function process(cols) {"," var i, len, col;",""," for (i = 0, len = cols.length; i < len; ++i) {"," col = cols[i];",""," if (Y.Lang.isArray(col.children)) {"," process(col.children);"," } else {"," displayColumns.push(col);"," }"," }"," }",""," process(columns);",""," /**"," Array of the columns that correspond to those with value cells in the"," data rows. Excludes colspan header columns (configured with `children`).",""," @property _displayColumns"," @type {Object[]}"," @since 3.5.0"," **/"," this._displayColumns = displayColumns;"," },",""," /**"," Sets up the instance's events.",""," @method initializer"," @param {Object} [config] Configuration object passed at construction"," @protected"," @since 3.6.0"," **/"," initializer: function () {"," this.publish('renderView', {"," defaultFn: Y.bind('_defRenderViewFn', this)"," });",""," // Have to use get('columns'), not config.columns because the setter"," // needs to transform string columns to objects."," this._extractDisplayColumns(this.get('columns') || []);",""," // FIXME: kludge for back compat of features that reference"," // _displayColumns on the instance. They need to be updated to"," // TableView plugins, most likely."," this.after('columnsChange', Y.bind('_afterDisplayColumnsChange', this));"," },",""," /**"," Relays attribute changes to the instance's `view`.",""," @method _relayCoreAttrChange"," @param {EventFacade} e The change event"," @protected"," @since 3.6.0"," **/"," _relayCoreAttrChange: function (e) {"," var attr = (e.attrName === 'data') ? 'modelList' : e.attrName;",""," this.view.set(attr, e.newVal);"," },",""," /**"," Instantiates the configured `view` class that will be responsible for"," setting up the View class.",""," @method @renderUI"," @protected"," @since 3.6.0"," **/"," renderUI: function () {"," var self = this,"," View = this.get('view');",""," if (View) {"," this.view = new View("," Y.merge("," this.getAttrs(),"," {"," host : this,"," container: this.get('contentBox'),"," modelList: this.data"," },"," this.get('viewConfig')));",""," // For back compat, share the view instances and primary nodes"," // on this instance."," // TODO: Remove this?"," if (!this._eventHandles.legacyFeatureProps) {"," this._eventHandles.legacyFeatureProps = this.view.after({"," renderHeader: function (e) {"," self.head = e.view;"," self._theadNode = e.view.theadNode;"," // TODO: clean up the repetition."," // This is here so that subscribers to renderHeader etc"," // have access to this._tableNode from the DT instance"," self._tableNode = e.view.get('container');"," },"," renderFooter: function (e) {"," self.foot = e.view;"," self._tfootNode = e.view.tfootNode;"," self._tableNode = e.view.get('container');"," },"," renderBody: function (e) {"," self.body = e.view;"," self._tbodyNode = e.view.tbodyNode;"," self._tableNode = e.view.get('container');"," },"," // FIXME: guarantee that the properties are available, even"," // if the configured (or omitted) views don't create them"," renderTable: function (e) {"," var contentBox = this.get('container');",""," self._tableNode = this.tableNode ||"," contentBox.one('.' + this.getClassName('table') +"," ', table');",""," // FIXME: _captionNode isn't available until after"," // renderTable unless in the renderX subs I look for"," // it under the container's parentNode (to account for"," // scroll breaking out the caption table)."," self._captionNode = this.captionNode ||"," contentBox.one('caption');",""," if (!self._theadNode) {"," self._theadNode = contentBox.one("," '.' + this.getClassName('columns') + ', thead');"," }",""," if (!self._tbodyNode) {"," self._tbodyNode = contentBox.one("," '.' + this.getClassName('data') + ', tbody');"," }",""," if (!self._tfootNode) {"," self._tfootNode = contentBox.one("," '.' + this.getClassName('footer') + ', tfoot');"," }"," }"," });"," }",""," // To *somewhat* preserve table.on('renderHeader', fn) in the"," // form of table.on('table:renderHeader', fn), because I couldn't"," // figure out another option."," this.view.addTarget(this);"," }"," },",""," /**"," Fires the `renderView` event, delegating UI updates to the configured View.",""," @method syncUI"," @since 3.5.0"," **/"," syncUI: function () {"," if (this.view) {"," this.fire('renderView', { view: this.view });"," }"," },",""," /**"," Verifies the input value is a function with a `render` method on its"," prototype. `null` is also accepted to remove the default View.",""," @method _validateView"," @protected"," @since 3.5.0"," **/"," _validateView: function (val) {"," // TODO support View instances?"," return val === null || (Y.Lang.isFunction(val) && val.prototype.render);"," }","}, {"," ATTRS: {"," /**"," The View class used to render the `<table>` into the Widget's"," `contentBox`. This View can handle the entire table rendering itself"," or delegate to other Views.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," When the DataTable is rendered, an instance of this View will be"," created and its `render()` method called. The View instance will be"," assigned to the DataTable instance's `view` property.",""," @attribute view"," @type {Function}"," @default Y.DataTable.TableView"," @since 3.6.0"," **/"," view: {"," value: Y.DataTable.TableView,"," validator: '_validateView'"," },",""," /**"," Configuration object passed to the class constructor in `view`"," during render.",""," @attribute viewConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," viewConfig: {}",""," /**"," If the View class assigned to the DataTable's `view` attribute supports"," it, this class will be used for rendering the contents of the"," `<thead>`—the column headers for the table."," "," Similar to `view`, the instance of this View will be assigned to the"," DataTable instance's `head` property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute headerView"," @type {Function|Object}"," @default Y.DataTable.HeaderView"," @since 3.5.0"," **/"," /*"," headerView: {"," value: Y.DataTable.HeaderView,"," validator: '_validateView'"," },"," */",""," /**"," Configuration object passed to the class constructor in `headerView`"," during render.",""," @attribute headerConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," //headConfig: {},",""," /**"," If the View class assigned to the DataTable's `view` attribute supports"," it, this class will be used for rendering the contents of the `<tfoot>`."," "," Similar to `view`, the instance of this View will be assigned to the"," DataTable instance's `foot` property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute footerView"," @type {Function|Object}"," @since 3.5.0"," **/"," /*"," footerView: {"," validator: '_validateView'"," },"," */",""," /**"," Configuration object passed to the class constructor in `footerView`"," during render.",""," @attribute footerConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," //footerConfig: {},",""," /**"," If the View class assigned to the DataTable's `view` attribute supports"," it, this class will be used for rendering the contents of the `<tbody>`"," including all data rows."," "," Similar to `view`, the instance of this View will be assigned to the"," DataTable instance's `body` property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute bodyView"," @type {Function}"," @default Y.DataTable.BodyView"," @since 3.5.0"," **/"," /*"," bodyView: {"," value: Y.DataTable.BodyView,"," validator: '_validateView'"," },"," */",""," /**"," Configuration object passed to the class constructor in `bodyView`"," during render.",""," @attribute bodyConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," //bodyConfig: {}"," }","});","","// The DataTable API docs are above DataTable.Base docs.","Y.DataTable = Y.mix("," Y.Base.create('datatable', Y.DataTable.Base, []), // Create the class"," Y.DataTable); // Migrate static and namespaced classes","","","}, '3.7.2', {\"requires\": [\"datatable-core\", \"datatable-table\", \"datatable-head\", \"datatable-body\", \"base-build\", \"widget\"], \"skinnable\": true});"];+_yuitest_coverage["build/datatable-base/datatable-base.js"].code=["YUI.add('datatable-base', function (Y, NAME) {","","/**","A Widget for displaying tabular data. The base implementation of DataTable","provides the ability to dynamically generate an HTML table from a set of column","configurations and row data.","","Two classes are included in the `datatable-base` module: `Y.DataTable` and","`Y.DataTable.Base`.","","@module datatable","@submodule datatable-base","@main datatable","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","A Widget for displaying tabular data. Before feature modules are `use()`d,","this class is functionally equivalent to DataTable.Base. However, feature","modules can modify this class in non-destructive ways, expanding the API and","functionality.","","This is the primary DataTable class. Out of the box, it provides the ability","to dynamically generate an HTML table from a set of column configurations and","row data. But feature module inclusion can add table sorting, pagintaion,","highlighting, selection, and more.","","<pre><code>","// The functionality of this table would require additional modules be use()d,","// but the feature APIs are aggregated onto Y.DataTable.","// (Snippet is for illustration. Not all features are available today.)","var table = new Y.DataTable({"," columns: ["," { type: 'checkbox', defaultChecked: true },"," { key: 'firstName', sortable: true, resizable: true },"," { key: 'lastName', sortable: true },"," { key: 'role', formatter: toRoleName }"," ],"," data: {"," source: 'http://myserver.com/service/json',"," type: 'json',"," schema: {"," resultListLocator: 'results.users',"," fields: ["," 'username',"," 'firstName',"," 'lastName',"," { key: 'role', type: 'number' }"," ]"," }"," },"," recordType: UserModel,"," pagedData: {"," location: 'footer',"," pageSizes: [20, 50, 'all'],"," rowsPerPage: 20,"," pageLinks: 5"," },"," editable: true","});","</code></pre>","","### Column Configuration","","The column configurations are set in the form of an array of objects, where","each object corresponds to a column. For columns populated directly from the","row data, a 'key' property is required to bind the column to that property or","attribute in the row data.","","Not all columns need to relate to row data, nor do all properties or attributes","of the row data need to have a corresponding column. However, only those","columns included in the `columns` configuration attribute will be rendered.","","Other column configuration properties are supported by the configured","`view`, class as well as any features added by plugins or class extensions.","See the description of DataTable.TableView and its subviews","DataTable.HeaderView, DataTable.BodyView, and DataTable.FooterView (and other","DataTable feature classes) to see what column properties they support.","","Some examples of column configurations would be:","","<pre><code>","// Basic","var columns = [{ key: 'firstName' }, { key: 'lastName' }, { key: 'age' }];","","// For columns without any additional configuration, strings can be used","var columns = ['firstName', 'lastName', 'age'];","","// Multi-row column headers (see DataTable.HeaderView for details)","var columns = ["," {"," label: 'Name',"," children: ["," { key: 'firstName' },"," { key: 'lastName' }"," ]"," },"," 'age' // mixing and matching objects and strings is ok","];","","// Including columns that are not related 1:1 to row data fields/attributes","// (See DataTable.BodyView for details)","var columns = ["," {"," label: 'Name', // Needed for the column header"," formatter: function (o) {"," // Fill the column cells with data from firstName and lastName"," if (o.data.age > 55) {"," o.className += ' senior';"," }"," return o.data.lastName + ', ' + o.data.firstName;"," }"," },"," 'age'","];","","// Columns that include feature configurations (for illustration; not all","// features are available today).","var columns = ["," { type: 'checkbox', defaultChecked: true },"," { key: 'firstName', sortable: true, resizable: true, min-width: '300px' },"," { key: 'lastName', sortable: true, resizable: true, min-width: '300px' },"," { key: 'age', emptyCellValue: '<em>unknown</em>' }","];","</code></pre>","","### Row Data Configuration","","The `data` configuration attribute is responsible for housing the data objects that will be rendered as rows. You can provide this information in two ways by default:","","1. An array of simple objects with key:value pairs","2. A ModelList of Base-based class instances (presumably Model subclass"," instances)","","If an array of objects is passed, it will be translated into a ModelList filled","with instances of the class provided to the `recordType` attribute. This","attribute can also create a custom Model subclass from an array of field names","or an object of attribute configurations. If no `recordType` is provided, one","will be created for you from available information (see `_initRecordType`).","Providing either your own ModelList instance for `data`, or at least Model","class for `recordType`, is the best way to control client-server","synchronization when modifying data on the client side.","","The ModelList instance that manages the table's data is available in the `data`","property on the DataTable instance.","","","### Rendering","","Table rendering is a collaborative process between the DataTable and its","configured `view`. The DataTable creates an instance of the configured `view`","(DataTable.TableView by default), and calls its `render()` method.","DataTable.TableView, for instance, then creates the `<table>` and `<caption>`,","then delegates the rendering of the specific sections of the table to subviews,","which can be configured as `headerView`, `bodyView`, and `footerView`.","DataTable.TableView defaults the `headerView` to DataTable.HeaderView and the","`bodyView` to DataTable.BodyView, but leaves the `footerView` unassigned.","Setting any subview to `null` will result in that table section not being","rendered.","","@class DataTable","@extends DataTable.Base","@since 3.5.0","**/","","// DataTable API docs included before DataTable.Base to make yuidoc work","/**","The baseline implementation of a DataTable. This class should be used","primarily as a superclass for a custom DataTable with a specific set of","features. Because features can be composed onto `Y.DataTable`, custom","subclasses of DataTable.Base will remain unmodified when new feature modules","are loaded.","","Example usage might look like this:","","<pre><code>","// Custom subclass with only sorting and mutability added. If other datatable","// feature modules are loaded, this class will not be affected.","var MyTableClass = Y.Base.create('table', Y.DataTable.Base,"," [ Y.DataTable.Sortable, Y.DataTable.Mutable ]);","","var table = new MyTableClass({"," columns: ['firstName', 'lastName', 'age'],"," data: ["," { firstName: 'Frank', lastName: 'Zappa', age: 71 },"," { firstName: 'Frank', lastName: 'Lloyd Wright', age: 144 },"," { firstName: 'Albert', lastName: 'Einstein', age: 132 },"," ..."," ]","});","","table.render('#over-there');","","// DataTable.Base can be instantiated if a featureless table is needed.","var table = new Y.DataTable.Base({"," columns: ['firstName', 'lastName', 'age'],"," data: ["," { firstName: 'Frank', lastName: 'Zappa', age: 71 },"," { firstName: 'Frank', lastName: 'Lloyd Wright', age: 144 },"," { firstName: 'Albert', lastName: 'Einstein', age: 132 },"," ..."," ]","});","","table.render('#in-here');","</code></pre>","","DataTable.Base is built from DataTable.Core, and sets the default `view`","to `Y.DataTable.TableView`.","","@class Base","@extends Widget","@uses DataTable.Core","@namespace DataTable","@since 3.5.0","**/","Y.DataTable.Base = Y.Base.create('datatable', Y.Widget, [Y.DataTable.Core], {",""," /**"," Pass through to `delegate()` called from the `contentBox`.",""," @method delegate"," @param type {String} the event type to delegate"," @param fn {Function} the callback function to execute. This function"," will be provided the event object for the delegated event."," @param spec {String|Function} a selector that must match the target of the"," event or a function to test target and its parents for a match"," @param context {Object} optional argument that specifies what 'this' refers to"," @param args* {any} 0..n additional arguments to pass on to the callback"," function. These arguments will be added after the event object."," @return {EventHandle} the detach handle"," @since 3.5.0"," **/"," delegate: function () {"," var contentBox = this.get('contentBox');",""," return contentBox.delegate.apply(contentBox, arguments);"," },",""," /**"," Destroys the table `View` if it's been created.",""," @method destructor"," @protected"," @since 3.6.0"," **/"," destructor: function () {"," if (this.view) {"," this.view.destroy();"," }"," },",""," /**"," Returns the `<td>` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," <pre><code>// Previous cell in the previous row"," var cell = table.getCell(e.target, [-1, -1]);",""," // Next cell"," var cell = table.getCell(e.target, 'next');"," var cell = table.getCell(e.taregt, [0, 1];</pre></code>",""," This is actually just a pass through to the `view` instance's method"," by the same name.",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (seed, shift) {"," return this.view && this.view.getCell &&"," this.view.getCell.apply(this.view, arguments);"," },",""," /**"," Returns the `<tr>` Node from the given row index, Model, or Model's"," `clientId`. If the rows haven't been rendered yet, or if the row can't be"," found by the input, `null` is returned.",""," This is actually just a pass through to the `view` instance's method"," by the same name.",""," @method getRow"," @param {Number|String|Model} id Row index, Model instance, or clientId"," @return {Node}"," @since 3.5.0"," **/"," getRow: function (id) {"," return this.view && this.view.getRow &&"," this.view.getRow.apply(this.view, arguments);"," },",""," /**"," Updates the `_displayColumns` property.",""," @method _afterDisplayColumnsChange"," @param {EventFacade} e The `columnsChange` event"," @protected"," @since 3.6.0"," **/"," // FIXME: This is a kludge for back compat with features that reference"," // _displayColumns. They should be updated to TableView plugins."," _afterDisplayColumnsChange: function (e) {"," this._extractDisplayColumns(e.newVal || []);"," },",""," /**"," Attaches subscriptions to relay core change events to the view.",""," @method bindUI"," @protected"," @since 3.6.0"," **/"," bindUI: function () {"," this._eventHandles.relayCoreChanges = this.after("," ['columnsChange',"," 'dataChange',"," 'summaryChange',"," 'captionChange',"," 'widthChange'],"," Y.bind('_relayCoreAttrChange', this));"," },",""," /**"," The default behavior of the `renderView` event. Calls `render()` on the"," `View` instance on the event.",""," @method _defRenderViewFn"," @param {EventFacade} e The `renderView` event"," @protected"," **/"," _defRenderViewFn: function (e) {"," e.view.render();"," },",""," /**"," Processes the full column array, distilling the columns down to those that"," correspond to cell data columns.",""," @method _extractDisplayColumns"," @param {Object[]} columns The full set of table columns"," @protected"," **/"," // FIXME: this is a kludge for back compat, duplicating logic in the"," // tableView"," _extractDisplayColumns: function (columns) {"," var displayColumns = [];",""," function process(cols) {"," var i, len, col;",""," for (i = 0, len = cols.length; i < len; ++i) {"," col = cols[i];",""," if (Y.Lang.isArray(col.children)) {"," process(col.children);"," } else {"," displayColumns.push(col);"," }"," }"," }",""," process(columns);",""," /**"," Array of the columns that correspond to those with value cells in the"," data rows. Excludes colspan header columns (configured with `children`).",""," @property _displayColumns"," @type {Object[]}"," @since 3.5.0"," **/"," this._displayColumns = displayColumns;"," },",""," /**"," Sets up the instance's events.",""," @method initializer"," @param {Object} [config] Configuration object passed at construction"," @protected"," @since 3.6.0"," **/"," initializer: function () {"," this.publish('renderView', {"," defaultFn: Y.bind('_defRenderViewFn', this)"," });",""," // Have to use get('columns'), not config.columns because the setter"," // needs to transform string columns to objects."," this._extractDisplayColumns(this.get('columns') || []);",""," // FIXME: kludge for back compat of features that reference"," // _displayColumns on the instance. They need to be updated to"," // TableView plugins, most likely."," this.after('columnsChange', Y.bind('_afterDisplayColumnsChange', this));"," },",""," /**"," Relays attribute changes to the instance's `view`.",""," @method _relayCoreAttrChange"," @param {EventFacade} e The change event"," @protected"," @since 3.6.0"," **/"," _relayCoreAttrChange: function (e) {"," var attr = (e.attrName === 'data') ? 'modelList' : e.attrName;",""," this.view.set(attr, e.newVal);"," },",""," /**"," Instantiates the configured `view` class that will be responsible for"," setting up the View class.",""," @method @renderUI"," @protected"," @since 3.6.0"," **/"," renderUI: function () {"," var self = this,"," View = this.get('view');",""," if (View) {"," this.view = new View("," Y.merge("," this.getAttrs(),"," {"," host : this,"," container: this.get('contentBox'),"," modelList: this.data"," },"," this.get('viewConfig')));",""," // For back compat, share the view instances and primary nodes"," // on this instance."," // TODO: Remove this?"," if (!this._eventHandles.legacyFeatureProps) {"," this._eventHandles.legacyFeatureProps = this.view.after({"," renderHeader: function (e) {"," self.head = e.view;"," self._theadNode = e.view.theadNode;"," // TODO: clean up the repetition."," // This is here so that subscribers to renderHeader etc"," // have access to this._tableNode from the DT instance"," self._tableNode = e.view.get('container');"," },"," renderFooter: function (e) {"," self.foot = e.view;"," self._tfootNode = e.view.tfootNode;"," self._tableNode = e.view.get('container');"," },"," renderBody: function (e) {"," self.body = e.view;"," self._tbodyNode = e.view.tbodyNode;"," self._tableNode = e.view.get('container');"," },"," // FIXME: guarantee that the properties are available, even"," // if the configured (or omitted) views don't create them"," renderTable: function (e) {"," var contentBox = this.get('container');",""," self._tableNode = this.tableNode ||"," contentBox.one('.' + this.getClassName('table') +"," ', table');",""," // FIXME: _captionNode isn't available until after"," // renderTable unless in the renderX subs I look for"," // it under the container's parentNode (to account for"," // scroll breaking out the caption table)."," self._captionNode = this.captionNode ||"," contentBox.one('caption');",""," if (!self._theadNode) {"," self._theadNode = contentBox.one("," '.' + this.getClassName('columns') + ', thead');"," }",""," if (!self._tbodyNode) {"," self._tbodyNode = contentBox.one("," '.' + this.getClassName('data') + ', tbody');"," }",""," if (!self._tfootNode) {"," self._tfootNode = contentBox.one("," '.' + this.getClassName('footer') + ', tfoot');"," }"," }"," });"," }",""," // To *somewhat* preserve table.on('renderHeader', fn) in the"," // form of table.on('table:renderHeader', fn), because I couldn't"," // figure out another option."," this.view.addTarget(this);"," }"," },",""," /**"," Fires the `renderView` event, delegating UI updates to the configured View.",""," @method syncUI"," @since 3.5.0"," **/"," syncUI: function () {"," if (this.view) {"," this.fire('renderView', { view: this.view });"," }"," },",""," /**"," Verifies the input value is a function with a `render` method on its"," prototype. `null` is also accepted to remove the default View.",""," @method _validateView"," @protected"," @since 3.5.0"," **/"," _validateView: function (val) {"," // TODO support View instances?"," return val === null || (Y.Lang.isFunction(val) && val.prototype.render);"," }","}, {"," ATTRS: {"," /**"," The View class used to render the `<table>` into the Widget's"," `contentBox`. This View can handle the entire table rendering itself"," or delegate to other Views.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," When the DataTable is rendered, an instance of this View will be"," created and its `render()` method called. The View instance will be"," assigned to the DataTable instance's `view` property.",""," @attribute view"," @type {Function}"," @default Y.DataTable.TableView"," @since 3.6.0"," **/"," view: {"," value: Y.DataTable.TableView,"," validator: '_validateView'"," },",""," /**"," Configuration object passed to the class constructor in `view`"," during render.",""," @attribute viewConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," viewConfig: {}",""," /**"," If the View class assigned to the DataTable's `view` attribute supports"," it, this class will be used for rendering the contents of the"," `<thead>`—the column headers for the table."," "," Similar to `view`, the instance of this View will be assigned to the"," DataTable instance's `head` property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute headerView"," @type {Function|Object}"," @default Y.DataTable.HeaderView"," @since 3.5.0"," **/"," /*"," headerView: {"," value: Y.DataTable.HeaderView,"," validator: '_validateView'"," },"," */",""," /**"," Configuration object passed to the class constructor in `headerView`"," during render.",""," @attribute headerConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," //headConfig: {},",""," /**"," If the View class assigned to the DataTable's `view` attribute supports"," it, this class will be used for rendering the contents of the `<tfoot>`."," "," Similar to `view`, the instance of this View will be assigned to the"," DataTable instance's `foot` property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute footerView"," @type {Function|Object}"," @since 3.5.0"," **/"," /*"," footerView: {"," validator: '_validateView'"," },"," */",""," /**"," Configuration object passed to the class constructor in `footerView`"," during render.",""," @attribute footerConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," //footerConfig: {},",""," /**"," If the View class assigned to the DataTable's `view` attribute supports"," it, this class will be used for rendering the contents of the `<tbody>`"," including all data rows."," "," Similar to `view`, the instance of this View will be assigned to the"," DataTable instance's `body` property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute bodyView"," @type {Function}"," @default Y.DataTable.BodyView"," @since 3.5.0"," **/"," /*"," bodyView: {"," value: Y.DataTable.BodyView,"," validator: '_validateView'"," },"," */",""," /**"," Configuration object passed to the class constructor in `bodyView`"," during render.",""," @attribute bodyConfig"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.6.0"," **/"," //bodyConfig: {}"," }","});","","// The DataTable API docs are above DataTable.Base docs.","Y.DataTable = Y.mix("," Y.Base.create('datatable', Y.DataTable.Base, []), // Create the class"," Y.DataTable); // Migrate static and namespaced classes","","","}, '3.7.3', {\"requires\": [\"datatable-core\", \"datatable-table\", \"datatable-head\", \"datatable-body\", \"base-build\", \"widget\"], \"skinnable\": true});"]; _yuitest_coverage["build/datatable-base/datatable-base.js"].lines = {"1":0,"218":0,"236":0,"238":0,"249":0,"250":0,"284":0,"302":0,"317":0,"328":0,"346":0,"360":0,"362":0,"363":0,"365":0,"366":0,"368":0,"369":0,"371":0,"376":0,"386":0,"398":0,"404":0,"409":0,"421":0,"423":0,"435":0,"438":0,"439":0,"452":0,"453":0,"455":0,"456":0,"460":0,"463":0,"464":0,"465":0,"468":0,"469":0,"470":0,"475":0,"477":0,"485":0,"488":0,"489":0,"493":0,"494":0,"498":0,"499":0,"509":0,"520":0,"521":0,"535":0,"678":0}; _yuitest_coverage["build/datatable-base/datatable-base.js"].functions = {"delegate:235":0,"destructor:248":0,"getCell:283":0,"getRow:301":0,"_afterDisplayColumnsChange:316":0,"bindUI:327":0,"_defRenderViewFn:345":0,"process:362":0,"_extractDisplayColumns:359":0,"initializer:397":0,"_relayCoreAttrChange:420":0,"renderHeader:454":0,"renderFooter:462":0,"renderBody:467":0,"renderTable:474":0,"renderUI:434":0,"syncUI:519":0,"_validateView:533":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-base/datatable-base.js"].coveredLines = 54;@@ -792,4 +792,4 @@ Y.DataTable); // Migrate static and namespaced classes -}, '3.7.2', {"requires": ["datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget"], "skinnable": true});
bundle/datatable-base/datatable-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -686,4 +686,4 @@ Y.DataTable); // Migrate static and namespaced classes -}, '3.7.2', {"requires": ["datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget"], "skinnable": true});
bundle/datatable-base/datatable-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-base",function(e,t){e.DataTable.Base=e.Base.create("datatable",e.Widget,[e.DataTable.Core],{delegate:function(){var e=this.get("contentBox");return e.delegate.apply(e,arguments)},destructor:function(){this.view&&this.view.destroy()},getCell:function(e,t){return this.view&&this.view.getCell&&this.view.getCell.apply(this.view,arguments)},getRow:function(e){return this.view&&this.view.getRow&&this.view.getRow.apply(this.view,arguments)},_afterDisplayColumnsChange:function(e){this._extractDisplayColumns(e.newVal||[])},bindUI:function(){this._eventHandles.relayCoreChanges=this.after(["columnsChange","dataChange","summaryChange","captionChange","widthChange"],e.bind("_relayCoreAttrChange",this))},_defRenderViewFn:function(e){e.view.render()},_extractDisplayColumns:function(t){function r(t){var i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e.Lang.isArray(o.children)?r(o.children):n.push(o)}var n=[];r(t),this._displayColumns=n},initializer:function(){this.publish("renderView",{defaultFn:e.bind("_defRenderViewFn",this)}),this._extractDisplayColumns(this.get("columns")||[]),this.after("columnsChange",e.bind("_afterDisplayColumnsChange",this))},_relayCoreAttrChange:function(e){var t=e.attrName==="data"?"modelList":e.attrName;this.view.set(t,e.newVal)},renderUI:function(){var t=this,n=this.get("view");n&&(this.view=new n(e.merge(this.getAttrs(),{host:this,container:this.get("contentBox"),modelList:this.data},this.get("viewConfig"))),this._eventHandles.legacyFeatureProps||(this._eventHandles.legacyFeatureProps=this.view.after({renderHeader:function(e){t.head=e.view,t._theadNode=e.view.theadNode,t._tableNode=e.view.get("container")},renderFooter:function(e){t.foot=e.view,t._tfootNode=e.view.tfootNode,t._tableNode=e.view.get("container")},renderBody:function(e){t.body=e.view,t._tbodyNode=e.view.tbodyNode,t._tableNode=e.view.get("container")},renderTable:function(e){var n=this.get("container");t._tableNode=this.tableNode||n.one("."+this.getClassName("table")+", table"),t._captionNode=this.captionNode||n.one("caption"),t._theadNode||(t._theadNode=n.one("."+this.getClassName("columns")+", thead")),t._tbodyNode||(t._tbodyNode=n.one("."+this.getClassName("data")+", tbody")),t._tfootNode||(t._tfootNode=n.one("."+this.getClassName("footer")+", tfoot"))}})),this.view.addTarget(this))},syncUI:function(){this.view&&this.fire("renderView",{view:this.view})},_validateView:function(t){return t===null||e.Lang.isFunction(t)&&t.prototype.render}},{ATTRS:{view:{value:e.DataTable.TableView,validator:"_validateView"},viewConfig:{}}}),e.DataTable=e.mix(e.Base.create("datatable",e.DataTable.Base,[]),e.DataTable)},"3.7.2",{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0});+YUI.add("datatable-base",function(e,t){e.DataTable.Base=e.Base.create("datatable",e.Widget,[e.DataTable.Core],{delegate:function(){var e=this.get("contentBox");return e.delegate.apply(e,arguments)},destructor:function(){this.view&&this.view.destroy()},getCell:function(e,t){return this.view&&this.view.getCell&&this.view.getCell.apply(this.view,arguments)},getRow:function(e){return this.view&&this.view.getRow&&this.view.getRow.apply(this.view,arguments)},_afterDisplayColumnsChange:function(e){this._extractDisplayColumns(e.newVal||[])},bindUI:function(){this._eventHandles.relayCoreChanges=this.after(["columnsChange","dataChange","summaryChange","captionChange","widthChange"],e.bind("_relayCoreAttrChange",this))},_defRenderViewFn:function(e){e.view.render()},_extractDisplayColumns:function(t){function r(t){var i,s,o;for(i=0,s=t.length;i<s;++i)o=t[i],e.Lang.isArray(o.children)?r(o.children):n.push(o)}var n=[];r(t),this._displayColumns=n},initializer:function(){this.publish("renderView",{defaultFn:e.bind("_defRenderViewFn",this)}),this._extractDisplayColumns(this.get("columns")||[]),this.after("columnsChange",e.bind("_afterDisplayColumnsChange",this))},_relayCoreAttrChange:function(e){var t=e.attrName==="data"?"modelList":e.attrName;this.view.set(t,e.newVal)},renderUI:function(){var t=this,n=this.get("view");n&&(this.view=new n(e.merge(this.getAttrs(),{host:this,container:this.get("contentBox"),modelList:this.data},this.get("viewConfig"))),this._eventHandles.legacyFeatureProps||(this._eventHandles.legacyFeatureProps=this.view.after({renderHeader:function(e){t.head=e.view,t._theadNode=e.view.theadNode,t._tableNode=e.view.get("container")},renderFooter:function(e){t.foot=e.view,t._tfootNode=e.view.tfootNode,t._tableNode=e.view.get("container")},renderBody:function(e){t.body=e.view,t._tbodyNode=e.view.tbodyNode,t._tableNode=e.view.get("container")},renderTable:function(e){var n=this.get("container");t._tableNode=this.tableNode||n.one("."+this.getClassName("table")+", table"),t._captionNode=this.captionNode||n.one("caption"),t._theadNode||(t._theadNode=n.one("."+this.getClassName("columns")+", thead")),t._tbodyNode||(t._tbodyNode=n.one("."+this.getClassName("data")+", tbody")),t._tfootNode||(t._tfootNode=n.one("."+this.getClassName("footer")+", tfoot"))}})),this.view.addTarget(this))},syncUI:function(){this.view&&this.fire("renderView",{view:this.view})},_validateView:function(t){return t===null||e.Lang.isFunction(t)&&t.prototype.render}},{ATTRS:{view:{value:e.DataTable.TableView,validator:"_validateView"},viewConfig:{}}}),e.DataTable=e.mix(e.Base.create("datatable",e.DataTable.Base,[]),e.DataTable)},"3.7.3",{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0});
bundle/datatable-base/datatable-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -686,4 +686,4 @@ Y.DataTable); // Migrate static and namespaced classes -}, '3.7.2', {"requires": ["datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-core", "datatable-table", "datatable-head", "datatable-body", "base-build", "widget"], "skinnable": true});
bundle/datatable-body/datatable-body-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-body/datatable-body.js", code: [] };-_yuitest_coverage["build/datatable-body/datatable-body.js"].code=["YUI.add('datatable-body', function (Y, NAME) {","","/**","View class responsible for rendering the `<tbody>` section of a table. Used as","the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-body","@since 3.5.0","**/","var Lang = Y.Lang,"," isArray = Lang.isArray,"," isNumber = Lang.isNumber,"," isString = Lang.isString,"," fromTemplate = Lang.sub,"," htmlEscape = Y.Escape.html,"," toArray = Y.Array,"," bind = Y.bind,"," YObject = Y.Object;","","/**","View class responsible for rendering the `<tbody>` section of a table. Used as","the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","Translates the provided `modelList` into a rendered `<tbody>` based on the data","in the constituent Models, altered or ammended by any special column","configurations.","","The `columns` configuration, passed to the constructor, determines which","columns will be rendered.","","The rendering process involves constructing an HTML template for a complete row","of data, built by concatenating a customized copy of the instance's","`CELL_TEMPLATE` into the `ROW_TEMPLATE` once for each column. This template is","then populated with values from each Model in the `modelList`, aggregating a","complete HTML string of all row and column data. A `<tbody>` Node is then created from the markup and any column `nodeFormatter`s are applied.","","Supported properties of the column objects include:",""," * `key` - Used to link a column to an attribute in a Model."," * `name` - Used for columns that don't relate to an attribute in the Model"," (`formatter` or `nodeFormatter` only) if the implementer wants a"," predictable name to refer to in their CSS."," * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this"," column only."," * `formatter` - Used to customize or override the content value from the"," Model. These do not have access to the cell or row Nodes and should"," return string (HTML) content."," * `nodeFormatter` - Used to provide content for a cell as well as perform any"," custom modifications on the cell or row Node that could not be performed by"," `formatter`s. Should be used sparingly for better performance."," * `emptyCellValue` - String (HTML) value to use if the Model data for a"," column, or the content generated by a `formatter`, is the empty string,"," `null`, or `undefined`."," * `allowHTML` - Set to `true` if a column value, `formatter`, or"," `emptyCellValue` can contain HTML. This defaults to `false` to protect"," against XSS."," * `className` - Space delimited CSS classes to add to all `<td>`s in a column.","","Column `formatter`s are passed an object (`o`) with the following properties:",""," * `value` - The current value of the column's associated attribute, if any."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `className` - Initially empty string to allow `formatter`s to add CSS "," classes to the cell's `<td>`."," * `rowIndex` - The zero-based row number."," * `rowClass` - Initially empty string to allow `formatter`s to add CSS"," classes to the cell's containing row `<tr>`.","","They may return a value or update `o.value` to assign specific HTML content. A","returned value has higher precedence.","","Column `nodeFormatter`s are passed an object (`o`) with the following","properties:",""," * `value` - The current value of the column's associated attribute, if any."," * `td` - The `<td>` Node instance."," * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`."," When adding content to the cell, prefer appending into this property."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `rowIndex` - The zero-based row number.","","They are expected to inject content into the cell's Node directly, including","any \"empty\" cell content. Each `nodeFormatter` will have access through the","Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as","it will not be attached yet.","","If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be","`destroy()`ed to remove them from the Node cache and free up memory. The DOM","elements will remain as will any content added to them. _It is highly","advisable to always return `false` from your `nodeFormatter`s_.","","@class BodyView","@namespace DataTable","@extends View","@since 3.5.0","**/","Y.namespace('DataTable').BodyView = Y.Base.create('tableBody', Y.View, [], {"," // -- Instance properties -------------------------------------------------",""," /**"," HTML template used to create table cells.",""," @property CELL_TEMPLATE"," @type {HTML}"," @default '<td {headers} class=\"{className}\">{content}</td>'"," @since 3.5.0"," **/"," CELL_TEMPLATE: '<td {headers} class=\"{className}\">{content}</td>',",""," /**"," CSS class applied to even rows. This is assigned at instantiation."," "," For DataTable, this will be `yui3-datatable-even`.",""," @property CLASS_EVEN"," @type {String}"," @default 'yui3-table-even'"," @since 3.5.0"," **/"," //CLASS_EVEN: null",""," /**"," CSS class applied to odd rows. This is assigned at instantiation."," "," When used by DataTable instances, this will be `yui3-datatable-odd`.",""," @property CLASS_ODD"," @type {String}"," @default 'yui3-table-odd'"," @since 3.5.0"," **/"," //CLASS_ODD: null",""," /**"," HTML template used to create table rows.",""," @property ROW_TEMPLATE"," @type {HTML}"," @default '<tr id=\"{rowId}\" data-yui3-record=\"{clientId}\" class=\"{rowClass}\">{content}</tr>'"," @since 3.5.0"," **/"," ROW_TEMPLATE : '<tr id=\"{rowId}\" data-yui3-record=\"{clientId}\" class=\"{rowClass}\">{content}</tr>',",""," /**"," The object that serves as the source of truth for column and row data."," This property is assigned at instantiation from the `host` property of"," the configuration object passed to the constructor.",""," @property host"," @type {Object}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //host: null,",""," /**"," HTML templates used to create the `<tbody>` containing the table rows.",""," @property TBODY_TEMPLATE"," @type {HTML}"," @default '<tbody class=\"{className}\">{content}</tbody>'"," @since 3.6.0"," **/"," TBODY_TEMPLATE: '<tbody class=\"{className}\"></tbody>',",""," // -- Public methods ------------------------------------------------------",""," /**"," Returns the `<td>` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," <pre><code>// Previous cell in the previous row"," var cell = table.getCell(e.target, [-1, -1]);",""," // Next cell"," var cell = table.getCell(e.target, 'next');"," var cell = table.getCell(e.taregt, [0, 1];</pre></code>",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (seed, shift) {"," var tbody = this.tbodyNode,"," row, cell, index, rowIndexOffset;",""," if (seed && tbody) {"," if (isArray(seed)) {"," row = tbody.get('children').item(seed[0]);"," cell = row && row.get('children').item(seed[1]);"," } else if (Y.instanceOf(seed, Y.Node)) {"," cell = seed.ancestor('.' + this.getClassName('cell'), true);"," }",""," if (cell && shift) {"," rowIndexOffset = tbody.get('firstChild.rowIndex');"," if (isString(shift)) {"," // TODO this should be a static object map"," switch (shift) {"," case 'above' : shift = [-1, 0]; break;"," case 'below' : shift = [1, 0]; break;"," case 'next' : shift = [0, 1]; break;"," case 'previous': shift = [0, -1]; break;"," }"," }",""," if (isArray(shift)) {"," index = cell.get('parentNode.rowIndex') +"," shift[0] - rowIndexOffset;"," row = tbody.get('children').item(index);",""," index = cell.get('cellIndex') + shift[1];"," cell = row && row.get('children').item(index);"," }"," }"," }"," "," return cell || null;"," },",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," @since 3.5.0"," **/"," getClassName: function () {"," var host = this.host,"," args;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," args = toArray(arguments);"," args.unshift(this.constructor.NAME);"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager, args);"," }"," },",""," /**"," Returns the Model associated to the row Node or id provided. Passing the"," Node or id for a descendant of the row also works.",""," If no Model can be found, `null` is returned.",""," @method getRecord"," @param {String|Node} seed Row Node or `id`, or one for a descendant of a row"," @return {Model}"," @since 3.5.0"," **/"," getRecord: function (seed) {"," var modelList = this.get('modelList'),"," tbody = this.tbodyNode,"," row = null,"," record;",""," if (tbody) {"," if (isString(seed)) {"," seed = tbody.one('#' + seed);"," }",""," if (Y.instanceOf(seed, Y.Node)) {"," row = seed.ancestor(function (node) {"," return node.get('parentNode').compareTo(tbody);"," }, true);",""," record = row &&"," modelList.getByClientId(row.getData('yui3-record'));"," }"," }",""," return record || null;"," },",""," /**"," Returns the `<tr>` Node from the given row index, Model, or Model's"," `clientId`. If the rows haven't been rendered yet, or if the row can't be"," found by the input, `null` is returned.",""," @method getRow"," @param {Number|String|Model} id Row index, Model instance, or clientId"," @return {Node}"," @since 3.5.0"," **/"," getRow: function (id) {"," var tbody = this.tbodyNode,"," row = null;",""," if (tbody) {"," if (id) {"," id = this._idMap[id.get ? id.get('clientId') : id] || id;"," }",""," row = isNumber(id) ?"," tbody.get('children').item(id) :"," tbody.one('#' + id);"," }",""," return row;"," },",""," /**"," Creates the table's `<tbody>` content by assembling markup generated by"," populating the `ROW\\_TEMPLATE`, and `CELL\\_TEMPLATE` templates with content"," from the `columns` and `modelList` attributes.",""," The rendering process happens in three stages:",""," 1. A row template is assembled from the `columns` attribute (see"," `_createRowTemplate`)",""," 2. An HTML string is built up by concatening the application of the data in"," each Model in the `modelList` to the row template. For cells with"," `formatter`s, the function is called to generate cell content. Cells"," with `nodeFormatter`s are ignored. For all other cells, the data value"," from the Model attribute for the given column key is used. The"," accumulated row markup is then inserted into the container.",""," 3. If any column is configured with a `nodeFormatter`, the `modelList` is"," iterated again to apply the `nodeFormatter`s.",""," Supported properties of the column objects include:",""," * `key` - Used to link a column to an attribute in a Model."," * `name` - Used for columns that don't relate to an attribute in the Model"," (`formatter` or `nodeFormatter` only) if the implementer wants a"," predictable name to refer to in their CSS."," * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in"," this column only."," * `formatter` - Used to customize or override the content value from the"," Model. These do not have access to the cell or row Nodes and should"," return string (HTML) content."," * `nodeFormatter` - Used to provide content for a cell as well as perform"," any custom modifications on the cell or row Node that could not be"," performed by `formatter`s. Should be used sparingly for better"," performance."," * `emptyCellValue` - String (HTML) value to use if the Model data for a"," column, or the content generated by a `formatter`, is the empty string,"," `null`, or `undefined`."," * `allowHTML` - Set to `true` if a column value, `formatter`, or"," `emptyCellValue` can contain HTML. This defaults to `false` to protect"," against XSS."," * `className` - Space delimited CSS classes to add to all `<td>`s in a"," column.",""," Column `formatter`s are passed an object (`o`) with the following"," properties:",""," * `value` - The current value of the column's associated attribute, if"," any."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `className` - Initially empty string to allow `formatter`s to add CSS "," classes to the cell's `<td>`."," * `rowIndex` - The zero-based row number."," * `rowClass` - Initially empty string to allow `formatter`s to add CSS"," classes to the cell's containing row `<tr>`.",""," They may return a value or update `o.value` to assign specific HTML"," content. A returned value has higher precedence.",""," Column `nodeFormatter`s are passed an object (`o`) with the following"," properties:",""," * `value` - The current value of the column's associated attribute, if"," any."," * `td` - The `<td>` Node instance."," * `cell` - The `<div>` liner Node instance if present, otherwise, the"," `<td>`. When adding content to the cell, prefer appending into this"," property."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `rowIndex` - The zero-based row number.",""," They are expected to inject content into the cell's Node directly, including"," any \"empty\" cell content. Each `nodeFormatter` will have access through the"," Node API to all cells and rows in the `<tbody>`, but not to the `<table>`,"," as it will not be attached yet.",""," If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be"," `destroy()`ed to remove them from the Node cache and free up memory. The"," DOM elements will remain as will any content added to them. _It is highly"," advisable to always return `false` from your `nodeFormatter`s_.",""," @method render"," @return {BodyView} The instance"," @chainable"," @since 3.5.0"," **/"," render: function () {"," var table = this.get('container'),"," data = this.get('modelList'),"," columns = this.get('columns'),"," tbody = this.tbodyNode ||"," (this.tbodyNode = this._createTBodyNode());"," "," // Needed for mutation"," this._createRowTemplate(columns);",""," if (data) {"," tbody.setHTML(this._createDataHTML(columns));",""," this._applyNodeFormatters(tbody, columns);"," }",""," if (tbody.get('parentNode') !== table) {"," table.appendChild(tbody);"," }",""," this.bindUI();",""," return this;"," },",""," // -- Protected and private methods ---------------------------------------"," /**"," Handles changes in the source's columns attribute. Redraws the table data.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," // TODO: Preserve existing DOM"," // This will involve parsing and comparing the old and new column configs"," // and reacting to four types of changes:"," // 1. formatter, nodeFormatter, emptyCellValue changes"," // 2. column deletions"," // 3. column additions"," // 4. column moves (preserve cells)"," _afterColumnsChange: function (e) {"," this.render();"," },",""," /**"," Handles modelList changes, including additions, deletions, and updates.",""," Modifies the existing table DOM accordingly.",""," @method _afterDataChange"," @param {EventFacade} e The `change` event from the ModelList"," @protected"," @since 3.5.0"," **/"," _afterDataChange: function (e) {"," //var type = e.type.slice(e.type.lastIndexOf(':') + 1);",""," // TODO: Isolate changes"," this.render();"," },",""," /**"," Handles replacement of the modelList.",""," Rerenders the `<tbody>` contents.",""," @method _afterModelListChange"," @param {EventFacade} e The `modelListChange` event"," @protected"," @since 3.6.0"," **/"," _afterModelListChange: function (e) {"," var handles = this._eventHandles;",""," if (handles.dataChange) {"," handles.dataChange.detach();"," delete handles.dataChange;"," this.bindUI();"," }",""," if (this.tbodyNode) {"," this.render();"," }"," },",""," /**"," Iterates the `modelList`, and calls any `nodeFormatter`s found in the"," `columns` param on the appropriate cell Nodes in the `tbody`.",""," @method _applyNodeFormatters"," @param {Node} tbody The `<tbody>` Node whose columns to update"," @param {Object[]} columns The column configurations"," @protected"," @since 3.5.0"," **/"," _applyNodeFormatters: function (tbody, columns) {"," var host = this.host,"," data = this.get('modelList'),"," formatters = [],"," linerQuery = '.' + this.getClassName('liner'),"," rows, i, len;",""," // Only iterate the ModelList again if there are nodeFormatters"," for (i = 0, len = columns.length; i < len; ++i) {"," if (columns[i].nodeFormatter) {"," formatters.push(i);"," }"," }",""," if (data && formatters.length) {"," rows = tbody.get('childNodes');",""," data.each(function (record, index) {"," var formatterData = {"," data : record.toJSON(),"," record : record,"," rowIndex : index"," },"," row = rows.item(index),"," i, len, col, key, cells, cell, keep;","",""," if (row) {"," cells = row.get('childNodes');"," for (i = 0, len = formatters.length; i < len; ++i) {"," cell = cells.item(formatters[i]);",""," if (cell) {"," col = formatterData.column = columns[formatters[i]];"," key = col.key || col.id;",""," formatterData.value = record.get(key);"," formatterData.td = cell;"," formatterData.cell = cell.one(linerQuery) || cell;",""," keep = col.nodeFormatter.call(host,formatterData);",""," if (keep === false) {"," // Remove from the Node cache to reduce"," // memory footprint. This also purges events,"," // which you shouldn't be scoping to a cell"," // anyway. You've been warned. Incidentally,"," // you should always return false. Just sayin."," cell.destroy(true);"," }"," }"," }"," }"," });"," }"," },",""," /**"," Binds event subscriptions from the UI and the host (if assigned).",""," @method bindUI"," @protected"," @since 3.5.0"," **/"," bindUI: function () {"," var handles = this._eventHandles,"," modelList = this.get('modelList'),"," changeEvent = modelList.model.NAME + ':change';",""," if (!handles.columnsChange) {"," handles.columnsChange = this.after('columnsChange',"," bind('_afterColumnsChange', this));"," }",""," if (modelList && !handles.dataChange) {"," handles.dataChange = modelList.after("," ['add', 'remove', 'reset', changeEvent],"," bind('_afterDataChange', this));"," }"," },",""," /**"," Iterates the `modelList` and applies each Model to the `_rowTemplate`,"," allowing any column `formatter` or `emptyCellValue` to override cell"," content for the appropriate column. The aggregated HTML string is"," returned.",""," @method _createDataHTML"," @param {Object[]} columns The column configurations to customize the"," generated cell content or class names"," @return {HTML} The markup for all Models in the `modelList`, each applied"," to the `_rowTemplate`"," @protected"," @since 3.5.0"," **/"," _createDataHTML: function (columns) {"," var data = this.get('modelList'),"," html = '';",""," if (data) {"," data.each(function (model, index) {"," html += this._createRowHTML(model, index, columns);"," }, this);"," }",""," return html;"," },",""," /**"," Applies the data of a given Model, modified by any column formatters and"," supplemented by other template values to the instance's `_rowTemplate` (see"," `_createRowTemplate`). The generated string is then returned.",""," The data from Model's attributes is fetched by `toJSON` and this data"," object is appended with other properties to supply values to {placeholders}"," in the template. For a template generated from a Model with 'foo' and 'bar'"," attributes, the data object would end up with the following properties"," before being used to populate the `_rowTemplate`:",""," * `clientID` - From Model, used the assign the `<tr>`'s 'id' attribute."," * `foo` - The value to populate the 'foo' column cell content. This"," value will be the value stored in the Model's `foo` attribute, or the"," result of the column's `formatter` if assigned. If the value is '', "," `null`, or `undefined`, and the column's `emptyCellValue` is assigned,"," that value will be used."," * `bar` - Same for the 'bar' column cell content."," * `foo-className` - String of CSS classes to apply to the `<td>`."," * `bar-className` - Same."," * `rowClass` - String of CSS classes to apply to the `<tr>`. This"," will be the odd/even class per the specified index plus any additional"," classes assigned by column formatters (via `o.rowClass`).",""," Because this object is available to formatters, any additional properties"," can be added to fill in custom {placeholders} in the `_rowTemplate`.",""," @method _createRowHTML"," @param {Model} model The Model instance to apply to the row template"," @param {Number} index The index the row will be appearing"," @param {Object[]} columns The column configurations"," @return {HTML} The markup for the provided Model, less any `nodeFormatter`s"," @protected"," @since 3.5.0"," **/"," _createRowHTML: function (model, index, columns) {"," var data = model.toJSON(),"," clientId = model.get('clientId'),"," values = {"," rowId : this._getRowId(clientId),"," clientId: clientId,"," rowClass: (index % 2) ? this.CLASS_ODD : this.CLASS_EVEN"," },"," host = this.host || this,"," i, len, col, token, value, formatterData;",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," value = data[col.key];"," token = col._id || col.key;",""," values[token + '-className'] = '';",""," if (col.formatter) {"," formatterData = {"," value : value,"," data : data,"," column : col,"," record : model,"," className: '',"," rowClass : '',"," rowIndex : index"," };",""," if (typeof col.formatter === 'string') {"," if (value !== undefined) {"," // TODO: look for known formatters by string name"," value = fromTemplate(col.formatter, formatterData);"," }"," } else {"," // Formatters can either return a value"," value = col.formatter.call(host, formatterData);",""," // or update the value property of the data obj passed"," if (value === undefined) {"," value = formatterData.value;"," }",""," values[token + '-className'] = formatterData.className;"," values.rowClass += ' ' + formatterData.rowClass;"," }"," }",""," if (value === undefined || value === null || value === '') {"," value = col.emptyCellValue || '';"," }",""," values[token] = col.allowHTML ? value : htmlEscape(value);",""," values.rowClass = values.rowClass.replace(/\\s+/g, ' ');"," }",""," return fromTemplate(this._rowTemplate, values);"," },",""," /**"," Creates a custom HTML template string for use in generating the markup for"," individual table rows with {placeholder}s to capture data from the Models"," in the `modelList` attribute or from column `formatter`s.",""," Assigns the `_rowTemplate` property.",""," @method _createRowTemplate"," @param {Object[]} columns Array of column configuration objects"," @protected"," @since 3.5.0"," **/"," _createRowTemplate: function (columns) {"," var html = '',"," cellTemplate = this.CELL_TEMPLATE,"," i, len, col, key, token, headers, tokenValues;",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," key = col.key;"," token = col._id || key;"," // Only include headers if there are more than one"," headers = (col._headers || []).length > 1 ?"," 'headers=\"' + col._headers.join(' ') + '\"' : '';",""," tokenValues = {"," content : '{' + token + '}',"," headers : headers,"," className: this.getClassName('col', token) + ' ' +"," (col.className || '') + ' ' +"," this.getClassName('cell') +"," ' {' + token + '-className}'"," };",""," if (col.nodeFormatter) {"," // Defer all node decoration to the formatter"," tokenValues.content = '';"," }",""," html += fromTemplate(col.cellTemplate || cellTemplate, tokenValues);"," }",""," this._rowTemplate = fromTemplate(this.ROW_TEMPLATE, {"," content: html"," });"," },",""," /**"," Creates the `<tbody>` node that will store the data rows.",""," @method _createTBodyNode"," @return {Node}"," @protected"," @since 3.6.0"," **/"," _createTBodyNode: function () {"," return Y.Node.create(fromTemplate(this.TBODY_TEMPLATE, {"," className: this.getClassName('data')"," }));"," },",""," /**"," Destroys the instance.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," (new Y.EventHandle(YObject.values(this._eventHandles))).detach();"," },",""," /**"," Holds the event subscriptions needing to be detached when the instance is"," `destroy()`ed.",""," @property _eventHandles"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_eventHandles: null,",""," /**"," Returns the row ID associated with a Model's clientId.",""," @method _getRowId"," @param {String} clientId The Model clientId"," @return {String}"," @protected"," **/"," _getRowId: function (clientId) {"," return this._idMap[clientId] || (this._idMap[clientId] = Y.guid());"," },",""," /**"," Map of Model clientIds to row ids.",""," @property _idMap"," @type {Object}"," @protected"," **/"," //_idMap,",""," /**"," Initializes the instance. Reads the following configuration properties in"," addition to the instance attributes:",""," * `columns` - (REQUIRED) The initial column information"," * `host` - The object to serve as source of truth for column info and"," for generating class names",""," @method initializer"," @param {Object} config Configuration data"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.host = config.host;",""," this._eventHandles = {"," modelListChange: this.after('modelListChange',"," bind('_afterModelListChange', this))"," };"," this._idMap = {};",""," this.CLASS_ODD = this.getClassName('odd');"," this.CLASS_EVEN = this.getClassName('even');",""," }",""," /**"," The HTML template used to create a full row of markup for a single Model in"," the `modelList` plus any customizations defined in the column"," configurations.",""," @property _rowTemplate"," @type {HTML}"," @default (initially unset)"," @protected"," @since 3.5.0"," **/"," //_rowTemplate: null","});","","","}, '3.7.2', {\"requires\": [\"datatable-core\", \"view\", \"classnamemanager\"]});"];+_yuitest_coverage["build/datatable-body/datatable-body.js"].code=["YUI.add('datatable-body', function (Y, NAME) {","","/**","View class responsible for rendering the `<tbody>` section of a table. Used as","the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-body","@since 3.5.0","**/","var Lang = Y.Lang,"," isArray = Lang.isArray,"," isNumber = Lang.isNumber,"," isString = Lang.isString,"," fromTemplate = Lang.sub,"," htmlEscape = Y.Escape.html,"," toArray = Y.Array,"," bind = Y.bind,"," YObject = Y.Object;","","/**","View class responsible for rendering the `<tbody>` section of a table. Used as","the default `bodyView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","Translates the provided `modelList` into a rendered `<tbody>` based on the data","in the constituent Models, altered or ammended by any special column","configurations.","","The `columns` configuration, passed to the constructor, determines which","columns will be rendered.","","The rendering process involves constructing an HTML template for a complete row","of data, built by concatenating a customized copy of the instance's","`CELL_TEMPLATE` into the `ROW_TEMPLATE` once for each column. This template is","then populated with values from each Model in the `modelList`, aggregating a","complete HTML string of all row and column data. A `<tbody>` Node is then created from the markup and any column `nodeFormatter`s are applied.","","Supported properties of the column objects include:",""," * `key` - Used to link a column to an attribute in a Model."," * `name` - Used for columns that don't relate to an attribute in the Model"," (`formatter` or `nodeFormatter` only) if the implementer wants a"," predictable name to refer to in their CSS."," * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this"," column only."," * `formatter` - Used to customize or override the content value from the"," Model. These do not have access to the cell or row Nodes and should"," return string (HTML) content."," * `nodeFormatter` - Used to provide content for a cell as well as perform any"," custom modifications on the cell or row Node that could not be performed by"," `formatter`s. Should be used sparingly for better performance."," * `emptyCellValue` - String (HTML) value to use if the Model data for a"," column, or the content generated by a `formatter`, is the empty string,"," `null`, or `undefined`."," * `allowHTML` - Set to `true` if a column value, `formatter`, or"," `emptyCellValue` can contain HTML. This defaults to `false` to protect"," against XSS."," * `className` - Space delimited CSS classes to add to all `<td>`s in a column.","","Column `formatter`s are passed an object (`o`) with the following properties:",""," * `value` - The current value of the column's associated attribute, if any."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `className` - Initially empty string to allow `formatter`s to add CSS "," classes to the cell's `<td>`."," * `rowIndex` - The zero-based row number."," * `rowClass` - Initially empty string to allow `formatter`s to add CSS"," classes to the cell's containing row `<tr>`.","","They may return a value or update `o.value` to assign specific HTML content. A","returned value has higher precedence.","","Column `nodeFormatter`s are passed an object (`o`) with the following","properties:",""," * `value` - The current value of the column's associated attribute, if any."," * `td` - The `<td>` Node instance."," * `cell` - The `<div>` liner Node instance if present, otherwise, the `<td>`."," When adding content to the cell, prefer appending into this property."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `rowIndex` - The zero-based row number.","","They are expected to inject content into the cell's Node directly, including","any \"empty\" cell content. Each `nodeFormatter` will have access through the","Node API to all cells and rows in the `<tbody>`, but not to the `<table>`, as","it will not be attached yet.","","If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be","`destroy()`ed to remove them from the Node cache and free up memory. The DOM","elements will remain as will any content added to them. _It is highly","advisable to always return `false` from your `nodeFormatter`s_.","","@class BodyView","@namespace DataTable","@extends View","@since 3.5.0","**/","Y.namespace('DataTable').BodyView = Y.Base.create('tableBody', Y.View, [], {"," // -- Instance properties -------------------------------------------------",""," /**"," HTML template used to create table cells.",""," @property CELL_TEMPLATE"," @type {HTML}"," @default '<td {headers} class=\"{className}\">{content}</td>'"," @since 3.5.0"," **/"," CELL_TEMPLATE: '<td {headers} class=\"{className}\">{content}</td>',",""," /**"," CSS class applied to even rows. This is assigned at instantiation."," "," For DataTable, this will be `yui3-datatable-even`.",""," @property CLASS_EVEN"," @type {String}"," @default 'yui3-table-even'"," @since 3.5.0"," **/"," //CLASS_EVEN: null",""," /**"," CSS class applied to odd rows. This is assigned at instantiation."," "," When used by DataTable instances, this will be `yui3-datatable-odd`.",""," @property CLASS_ODD"," @type {String}"," @default 'yui3-table-odd'"," @since 3.5.0"," **/"," //CLASS_ODD: null",""," /**"," HTML template used to create table rows.",""," @property ROW_TEMPLATE"," @type {HTML}"," @default '<tr id=\"{rowId}\" data-yui3-record=\"{clientId}\" class=\"{rowClass}\">{content}</tr>'"," @since 3.5.0"," **/"," ROW_TEMPLATE : '<tr id=\"{rowId}\" data-yui3-record=\"{clientId}\" class=\"{rowClass}\">{content}</tr>',",""," /**"," The object that serves as the source of truth for column and row data."," This property is assigned at instantiation from the `host` property of"," the configuration object passed to the constructor.",""," @property host"," @type {Object}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //host: null,",""," /**"," HTML templates used to create the `<tbody>` containing the table rows.",""," @property TBODY_TEMPLATE"," @type {HTML}"," @default '<tbody class=\"{className}\">{content}</tbody>'"," @since 3.6.0"," **/"," TBODY_TEMPLATE: '<tbody class=\"{className}\"></tbody>',",""," // -- Public methods ------------------------------------------------------",""," /**"," Returns the `<td>` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," <pre><code>// Previous cell in the previous row"," var cell = table.getCell(e.target, [-1, -1]);",""," // Next cell"," var cell = table.getCell(e.target, 'next');"," var cell = table.getCell(e.taregt, [0, 1];</pre></code>",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (seed, shift) {"," var tbody = this.tbodyNode,"," row, cell, index, rowIndexOffset;",""," if (seed && tbody) {"," if (isArray(seed)) {"," row = tbody.get('children').item(seed[0]);"," cell = row && row.get('children').item(seed[1]);"," } else if (Y.instanceOf(seed, Y.Node)) {"," cell = seed.ancestor('.' + this.getClassName('cell'), true);"," }",""," if (cell && shift) {"," rowIndexOffset = tbody.get('firstChild.rowIndex');"," if (isString(shift)) {"," // TODO this should be a static object map"," switch (shift) {"," case 'above' : shift = [-1, 0]; break;"," case 'below' : shift = [1, 0]; break;"," case 'next' : shift = [0, 1]; break;"," case 'previous': shift = [0, -1]; break;"," }"," }",""," if (isArray(shift)) {"," index = cell.get('parentNode.rowIndex') +"," shift[0] - rowIndexOffset;"," row = tbody.get('children').item(index);",""," index = cell.get('cellIndex') + shift[1];"," cell = row && row.get('children').item(index);"," }"," }"," }"," "," return cell || null;"," },",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," @since 3.5.0"," **/"," getClassName: function () {"," var host = this.host,"," args;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," args = toArray(arguments);"," args.unshift(this.constructor.NAME);"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager, args);"," }"," },",""," /**"," Returns the Model associated to the row Node or id provided. Passing the"," Node or id for a descendant of the row also works.",""," If no Model can be found, `null` is returned.",""," @method getRecord"," @param {String|Node} seed Row Node or `id`, or one for a descendant of a row"," @return {Model}"," @since 3.5.0"," **/"," getRecord: function (seed) {"," var modelList = this.get('modelList'),"," tbody = this.tbodyNode,"," row = null,"," record;",""," if (tbody) {"," if (isString(seed)) {"," seed = tbody.one('#' + seed);"," }",""," if (Y.instanceOf(seed, Y.Node)) {"," row = seed.ancestor(function (node) {"," return node.get('parentNode').compareTo(tbody);"," }, true);",""," record = row &&"," modelList.getByClientId(row.getData('yui3-record'));"," }"," }",""," return record || null;"," },",""," /**"," Returns the `<tr>` Node from the given row index, Model, or Model's"," `clientId`. If the rows haven't been rendered yet, or if the row can't be"," found by the input, `null` is returned.",""," @method getRow"," @param {Number|String|Model} id Row index, Model instance, or clientId"," @return {Node}"," @since 3.5.0"," **/"," getRow: function (id) {"," var tbody = this.tbodyNode,"," row = null;",""," if (tbody) {"," if (id) {"," id = this._idMap[id.get ? id.get('clientId') : id] || id;"," }",""," row = isNumber(id) ?"," tbody.get('children').item(id) :"," tbody.one('#' + id);"," }",""," return row;"," },",""," /**"," Creates the table's `<tbody>` content by assembling markup generated by"," populating the `ROW\\_TEMPLATE`, and `CELL\\_TEMPLATE` templates with content"," from the `columns` and `modelList` attributes.",""," The rendering process happens in three stages:",""," 1. A row template is assembled from the `columns` attribute (see"," `_createRowTemplate`)",""," 2. An HTML string is built up by concatening the application of the data in"," each Model in the `modelList` to the row template. For cells with"," `formatter`s, the function is called to generate cell content. Cells"," with `nodeFormatter`s are ignored. For all other cells, the data value"," from the Model attribute for the given column key is used. The"," accumulated row markup is then inserted into the container.",""," 3. If any column is configured with a `nodeFormatter`, the `modelList` is"," iterated again to apply the `nodeFormatter`s.",""," Supported properties of the column objects include:",""," * `key` - Used to link a column to an attribute in a Model."," * `name` - Used for columns that don't relate to an attribute in the Model"," (`formatter` or `nodeFormatter` only) if the implementer wants a"," predictable name to refer to in their CSS."," * `cellTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in"," this column only."," * `formatter` - Used to customize or override the content value from the"," Model. These do not have access to the cell or row Nodes and should"," return string (HTML) content."," * `nodeFormatter` - Used to provide content for a cell as well as perform"," any custom modifications on the cell or row Node that could not be"," performed by `formatter`s. Should be used sparingly for better"," performance."," * `emptyCellValue` - String (HTML) value to use if the Model data for a"," column, or the content generated by a `formatter`, is the empty string,"," `null`, or `undefined`."," * `allowHTML` - Set to `true` if a column value, `formatter`, or"," `emptyCellValue` can contain HTML. This defaults to `false` to protect"," against XSS."," * `className` - Space delimited CSS classes to add to all `<td>`s in a"," column.",""," Column `formatter`s are passed an object (`o`) with the following"," properties:",""," * `value` - The current value of the column's associated attribute, if"," any."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `className` - Initially empty string to allow `formatter`s to add CSS "," classes to the cell's `<td>`."," * `rowIndex` - The zero-based row number."," * `rowClass` - Initially empty string to allow `formatter`s to add CSS"," classes to the cell's containing row `<tr>`.",""," They may return a value or update `o.value` to assign specific HTML"," content. A returned value has higher precedence.",""," Column `nodeFormatter`s are passed an object (`o`) with the following"," properties:",""," * `value` - The current value of the column's associated attribute, if"," any."," * `td` - The `<td>` Node instance."," * `cell` - The `<div>` liner Node instance if present, otherwise, the"," `<td>`. When adding content to the cell, prefer appending into this"," property."," * `data` - An object map of Model keys to their current values."," * `record` - The Model instance."," * `column` - The column configuration object for the current column."," * `rowIndex` - The zero-based row number.",""," They are expected to inject content into the cell's Node directly, including"," any \"empty\" cell content. Each `nodeFormatter` will have access through the"," Node API to all cells and rows in the `<tbody>`, but not to the `<table>`,"," as it will not be attached yet.",""," If a `nodeFormatter` returns `false`, the `o.td` and `o.cell` Nodes will be"," `destroy()`ed to remove them from the Node cache and free up memory. The"," DOM elements will remain as will any content added to them. _It is highly"," advisable to always return `false` from your `nodeFormatter`s_.",""," @method render"," @return {BodyView} The instance"," @chainable"," @since 3.5.0"," **/"," render: function () {"," var table = this.get('container'),"," data = this.get('modelList'),"," columns = this.get('columns'),"," tbody = this.tbodyNode ||"," (this.tbodyNode = this._createTBodyNode());"," "," // Needed for mutation"," this._createRowTemplate(columns);",""," if (data) {"," tbody.setHTML(this._createDataHTML(columns));",""," this._applyNodeFormatters(tbody, columns);"," }",""," if (tbody.get('parentNode') !== table) {"," table.appendChild(tbody);"," }",""," this.bindUI();",""," return this;"," },",""," // -- Protected and private methods ---------------------------------------"," /**"," Handles changes in the source's columns attribute. Redraws the table data.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," // TODO: Preserve existing DOM"," // This will involve parsing and comparing the old and new column configs"," // and reacting to four types of changes:"," // 1. formatter, nodeFormatter, emptyCellValue changes"," // 2. column deletions"," // 3. column additions"," // 4. column moves (preserve cells)"," _afterColumnsChange: function (e) {"," this.render();"," },",""," /**"," Handles modelList changes, including additions, deletions, and updates.",""," Modifies the existing table DOM accordingly.",""," @method _afterDataChange"," @param {EventFacade} e The `change` event from the ModelList"," @protected"," @since 3.5.0"," **/"," _afterDataChange: function (e) {"," //var type = e.type.slice(e.type.lastIndexOf(':') + 1);",""," // TODO: Isolate changes"," this.render();"," },",""," /**"," Handles replacement of the modelList.",""," Rerenders the `<tbody>` contents.",""," @method _afterModelListChange"," @param {EventFacade} e The `modelListChange` event"," @protected"," @since 3.6.0"," **/"," _afterModelListChange: function (e) {"," var handles = this._eventHandles;",""," if (handles.dataChange) {"," handles.dataChange.detach();"," delete handles.dataChange;"," this.bindUI();"," }",""," if (this.tbodyNode) {"," this.render();"," }"," },",""," /**"," Iterates the `modelList`, and calls any `nodeFormatter`s found in the"," `columns` param on the appropriate cell Nodes in the `tbody`.",""," @method _applyNodeFormatters"," @param {Node} tbody The `<tbody>` Node whose columns to update"," @param {Object[]} columns The column configurations"," @protected"," @since 3.5.0"," **/"," _applyNodeFormatters: function (tbody, columns) {"," var host = this.host,"," data = this.get('modelList'),"," formatters = [],"," linerQuery = '.' + this.getClassName('liner'),"," rows, i, len;",""," // Only iterate the ModelList again if there are nodeFormatters"," for (i = 0, len = columns.length; i < len; ++i) {"," if (columns[i].nodeFormatter) {"," formatters.push(i);"," }"," }",""," if (data && formatters.length) {"," rows = tbody.get('childNodes');",""," data.each(function (record, index) {"," var formatterData = {"," data : record.toJSON(),"," record : record,"," rowIndex : index"," },"," row = rows.item(index),"," i, len, col, key, cells, cell, keep;","",""," if (row) {"," cells = row.get('childNodes');"," for (i = 0, len = formatters.length; i < len; ++i) {"," cell = cells.item(formatters[i]);",""," if (cell) {"," col = formatterData.column = columns[formatters[i]];"," key = col.key || col.id;",""," formatterData.value = record.get(key);"," formatterData.td = cell;"," formatterData.cell = cell.one(linerQuery) || cell;",""," keep = col.nodeFormatter.call(host,formatterData);",""," if (keep === false) {"," // Remove from the Node cache to reduce"," // memory footprint. This also purges events,"," // which you shouldn't be scoping to a cell"," // anyway. You've been warned. Incidentally,"," // you should always return false. Just sayin."," cell.destroy(true);"," }"," }"," }"," }"," });"," }"," },",""," /**"," Binds event subscriptions from the UI and the host (if assigned).",""," @method bindUI"," @protected"," @since 3.5.0"," **/"," bindUI: function () {"," var handles = this._eventHandles,"," modelList = this.get('modelList'),"," changeEvent = modelList.model.NAME + ':change';",""," if (!handles.columnsChange) {"," handles.columnsChange = this.after('columnsChange',"," bind('_afterColumnsChange', this));"," }",""," if (modelList && !handles.dataChange) {"," handles.dataChange = modelList.after("," ['add', 'remove', 'reset', changeEvent],"," bind('_afterDataChange', this));"," }"," },",""," /**"," Iterates the `modelList` and applies each Model to the `_rowTemplate`,"," allowing any column `formatter` or `emptyCellValue` to override cell"," content for the appropriate column. The aggregated HTML string is"," returned.",""," @method _createDataHTML"," @param {Object[]} columns The column configurations to customize the"," generated cell content or class names"," @return {HTML} The markup for all Models in the `modelList`, each applied"," to the `_rowTemplate`"," @protected"," @since 3.5.0"," **/"," _createDataHTML: function (columns) {"," var data = this.get('modelList'),"," html = '';",""," if (data) {"," data.each(function (model, index) {"," html += this._createRowHTML(model, index, columns);"," }, this);"," }",""," return html;"," },",""," /**"," Applies the data of a given Model, modified by any column formatters and"," supplemented by other template values to the instance's `_rowTemplate` (see"," `_createRowTemplate`). The generated string is then returned.",""," The data from Model's attributes is fetched by `toJSON` and this data"," object is appended with other properties to supply values to {placeholders}"," in the template. For a template generated from a Model with 'foo' and 'bar'"," attributes, the data object would end up with the following properties"," before being used to populate the `_rowTemplate`:",""," * `clientID` - From Model, used the assign the `<tr>`'s 'id' attribute."," * `foo` - The value to populate the 'foo' column cell content. This"," value will be the value stored in the Model's `foo` attribute, or the"," result of the column's `formatter` if assigned. If the value is '', "," `null`, or `undefined`, and the column's `emptyCellValue` is assigned,"," that value will be used."," * `bar` - Same for the 'bar' column cell content."," * `foo-className` - String of CSS classes to apply to the `<td>`."," * `bar-className` - Same."," * `rowClass` - String of CSS classes to apply to the `<tr>`. This"," will be the odd/even class per the specified index plus any additional"," classes assigned by column formatters (via `o.rowClass`).",""," Because this object is available to formatters, any additional properties"," can be added to fill in custom {placeholders} in the `_rowTemplate`.",""," @method _createRowHTML"," @param {Model} model The Model instance to apply to the row template"," @param {Number} index The index the row will be appearing"," @param {Object[]} columns The column configurations"," @return {HTML} The markup for the provided Model, less any `nodeFormatter`s"," @protected"," @since 3.5.0"," **/"," _createRowHTML: function (model, index, columns) {"," var data = model.toJSON(),"," clientId = model.get('clientId'),"," values = {"," rowId : this._getRowId(clientId),"," clientId: clientId,"," rowClass: (index % 2) ? this.CLASS_ODD : this.CLASS_EVEN"," },"," host = this.host || this,"," i, len, col, token, value, formatterData;",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," value = data[col.key];"," token = col._id || col.key;",""," values[token + '-className'] = '';",""," if (col.formatter) {"," formatterData = {"," value : value,"," data : data,"," column : col,"," record : model,"," className: '',"," rowClass : '',"," rowIndex : index"," };",""," if (typeof col.formatter === 'string') {"," if (value !== undefined) {"," // TODO: look for known formatters by string name"," value = fromTemplate(col.formatter, formatterData);"," }"," } else {"," // Formatters can either return a value"," value = col.formatter.call(host, formatterData);",""," // or update the value property of the data obj passed"," if (value === undefined) {"," value = formatterData.value;"," }",""," values[token + '-className'] = formatterData.className;"," values.rowClass += ' ' + formatterData.rowClass;"," }"," }",""," if (value === undefined || value === null || value === '') {"," value = col.emptyCellValue || '';"," }",""," values[token] = col.allowHTML ? value : htmlEscape(value);",""," values.rowClass = values.rowClass.replace(/\\s+/g, ' ');"," }",""," return fromTemplate(this._rowTemplate, values);"," },",""," /**"," Creates a custom HTML template string for use in generating the markup for"," individual table rows with {placeholder}s to capture data from the Models"," in the `modelList` attribute or from column `formatter`s.",""," Assigns the `_rowTemplate` property.",""," @method _createRowTemplate"," @param {Object[]} columns Array of column configuration objects"," @protected"," @since 3.5.0"," **/"," _createRowTemplate: function (columns) {"," var html = '',"," cellTemplate = this.CELL_TEMPLATE,"," i, len, col, key, token, headers, tokenValues;",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," key = col.key;"," token = col._id || key;"," // Only include headers if there are more than one"," headers = (col._headers || []).length > 1 ?"," 'headers=\"' + col._headers.join(' ') + '\"' : '';",""," tokenValues = {"," content : '{' + token + '}',"," headers : headers,"," className: this.getClassName('col', token) + ' ' +"," (col.className || '') + ' ' +"," this.getClassName('cell') +"," ' {' + token + '-className}'"," };",""," if (col.nodeFormatter) {"," // Defer all node decoration to the formatter"," tokenValues.content = '';"," }",""," html += fromTemplate(col.cellTemplate || cellTemplate, tokenValues);"," }",""," this._rowTemplate = fromTemplate(this.ROW_TEMPLATE, {"," content: html"," });"," },",""," /**"," Creates the `<tbody>` node that will store the data rows.",""," @method _createTBodyNode"," @return {Node}"," @protected"," @since 3.6.0"," **/"," _createTBodyNode: function () {"," return Y.Node.create(fromTemplate(this.TBODY_TEMPLATE, {"," className: this.getClassName('data')"," }));"," },",""," /**"," Destroys the instance.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," (new Y.EventHandle(YObject.values(this._eventHandles))).detach();"," },",""," /**"," Holds the event subscriptions needing to be detached when the instance is"," `destroy()`ed.",""," @property _eventHandles"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_eventHandles: null,",""," /**"," Returns the row ID associated with a Model's clientId.",""," @method _getRowId"," @param {String} clientId The Model clientId"," @return {String}"," @protected"," **/"," _getRowId: function (clientId) {"," return this._idMap[clientId] || (this._idMap[clientId] = Y.guid());"," },",""," /**"," Map of Model clientIds to row ids.",""," @property _idMap"," @type {Object}"," @protected"," **/"," //_idMap,",""," /**"," Initializes the instance. Reads the following configuration properties in"," addition to the instance attributes:",""," * `columns` - (REQUIRED) The initial column information"," * `host` - The object to serve as source of truth for column info and"," for generating class names",""," @method initializer"," @param {Object} config Configuration data"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.host = config.host;",""," this._eventHandles = {"," modelListChange: this.after('modelListChange',"," bind('_afterModelListChange', this))"," };"," this._idMap = {};",""," this.CLASS_ODD = this.getClassName('odd');"," this.CLASS_EVEN = this.getClassName('even');",""," }",""," /**"," The HTML template used to create a full row of markup for a single Model in"," the `modelList` plus any customizations defined in the column"," configurations.",""," @property _rowTemplate"," @type {HTML}"," @default (initially unset)"," @protected"," @since 3.5.0"," **/"," //_rowTemplate: null","});","","","}, '3.7.3', {\"requires\": [\"datatable-core\", \"view\", \"classnamemanager\"]});"]; _yuitest_coverage["build/datatable-body/datatable-body.js"].lines = {"1":0,"11":0,"102":0,"201":0,"204":0,"205":0,"206":0,"207":0,"208":0,"209":0,"212":0,"213":0,"214":0,"216":0,"217":0,"218":0,"219":0,"220":0,"224":0,"225":0,"227":0,"229":0,"230":0,"235":0,"254":0,"257":0,"258":0,"260":0,"261":0,"262":0,"279":0,"284":0,"285":0,"286":0,"289":0,"290":0,"291":0,"294":0,"299":0,"313":0,"316":0,"317":0,"318":0,"321":0,"326":0,"420":0,"427":0,"429":0,"430":0,"432":0,"435":0,"436":0,"439":0,"441":0,"461":0,"478":0,"492":0,"494":0,"495":0,"496":0,"497":0,"500":0,"501":0,"516":0,"523":0,"524":0,"525":0,"529":0,"530":0,"532":0,"533":0,"542":0,"543":0,"544":0,"545":0,"547":0,"548":0,"549":0,"551":0,"552":0,"553":0,"555":0,"557":0,"563":0,"580":0,"584":0,"585":0,"589":0,"590":0,"611":0,"614":0,"615":0,"616":0,"620":0,"659":0,"669":0,"670":0,"671":0,"672":0,"674":0,"676":0,"677":0,"687":0,"688":0,"690":0,"694":0,"697":0,"698":0,"701":0,"702":0,"706":0,"707":0,"710":0,"712":0,"715":0,"731":0,"735":0,"736":0,"737":0,"738":0,"740":0,"743":0,"752":0,"754":0,"757":0,"760":0,"774":0,"787":0,"811":0,"837":0,"839":0,"843":0,"845":0,"846":0}; _yuitest_coverage["build/datatable-body/datatable-body.js"].functions = {"getCell:200":0,"getClassName:253":0,"(anonymous 2):290":0,"getRecord:278":0,"getRow:312":0,"render:419":0,"_afterColumnsChange:460":0,"_afterDataChange:474":0,"_afterModelListChange:491":0,"(anonymous 3):532":0,"_applyNodeFormatters:515":0,"bindUI:579":0,"(anonymous 4):615":0,"_createDataHTML:610":0,"_createRowHTML:658":0,"_createRowTemplate:730":0,"_createTBodyNode:773":0,"destructor:786":0,"_getRowId:810":0,"initializer:836":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-body/datatable-body.js"].coveredLines = 134;@@ -1056,4 +1056,4 @@ }); -}, '3.7.2', {"requires": ["datatable-core", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "view", "classnamemanager"]});
bundle/datatable-body/datatable-body-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -868,4 +868,4 @@ }); -}, '3.7.2', {"requires": ["datatable-core", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "view", "classnamemanager"]});
bundle/datatable-body/datatable-body-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-body",function(e,t){var n=e.Lang,r=n.isArray,i=n.isNumber,s=n.isString,o=n.sub,u=e.Escape.html,a=e.Array,f=e.bind,l=e.Object;e.namespace("DataTable").BodyView=e.Base.create("tableBody",e.View,[],{CELL_TEMPLATE:'<td {headers} class="{className}">{content}</td>',ROW_TEMPLATE:'<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>',TBODY_TEMPLATE:'<tbody class="{className}"></tbody>',getCell:function(t,n){var i=this.tbodyNode,o,u,a,f;if(t&&i){r(t)?(o=i.get("children").item(t[0]),u=o&&o.get("children").item(t[1])):e.instanceOf(t,e.Node)&&(u=t.ancestor("."+this.getClassName("cell"),!0));if(u&&n){f=i.get("firstChild.rowIndex");if(s(n))switch(n){case"above":n=[-1,0];break;case"below":n=[1,0];break;case"next":n=[0,1];break;case"previous":n=[0,-1]}r(n)&&(a=u.get("parentNode.rowIndex")+n[0]-f,o=i.get("children").item(a),a=u.get("cellIndex")+n[1],u=o&&o.get("children").item(a))}}return u||null},getClassName:function(){var t=this.host,n;return t&&t.getClassName?t.getClassName.apply(t,arguments):(n=a(arguments),n.unshift(this.constructor.NAME),e.ClassNameManager.getClassName.apply(e.ClassNameManager,n))},getRecord:function(t){var n=this.get("modelList"),r=this.tbodyNode,i=null,o;return r&&(s(t)&&(t=r.one("#"+t)),e.instanceOf(t,e.Node)&&(i=t.ancestor(function(e){return e.get("parentNode").compareTo(r)},!0),o=i&&n.getByClientId(i.getData("yui3-record")))),o||null},getRow:function(e){var t=this.tbodyNode,n=null;return t&&(e&&(e=this._idMap[e.get?e.get("clientId"):e]||e),n=i(e)?t.get("children").item(e):t.one("#"+e)),n},render:function(){var e=this.get("container"),t=this.get("modelList"),n=this.get("columns"),r=this.tbodyNode||(this.tbodyNode=this._createTBodyNode());return this._createRowTemplate(n),t&&(r.setHTML(this._createDataHTML(n)),this._applyNodeFormatters(r,n)),r.get("parentNode")!==e&&e.appendChild(r),this.bindUI(),this},_afterColumnsChange:function(e){this.render()},_afterDataChange:function(e){this.render()},_afterModelListChange:function(e){var t=this._eventHandles;t.dataChange&&(t.dataChange.detach(),delete t.dataChange,this.bindUI()),this.tbodyNode&&this.render()},_applyNodeFormatters:function(e,t){var n=this.host,r=this.get("modelList"),i=[],s="."+this.getClassName("liner"),o,u,a;for(u=0,a=t.length;u<a;++u)t[u].nodeFormatter&&i.push(u);r&&i.length&&(o=e.get("childNodes"),r.each(function(e,r){var u={data:e.toJSON(),record:e,rowIndex:r},a=o.item(r),f,l,c,h,p,d,v;if(a){p=a.get("childNodes");for(f=0,l=i.length;f<l;++f)d=p.item(i[f]),d&&(c=u.column=t[i[f]],h=c.key||c.id,u.value=e.get(h),u.td=d,u.cell=d.one(s)||d,v=c.nodeFormatter.call(n,u),v===!1&&d.destroy(!0))}}))},bindUI:function(){var e=this._eventHandles,t=this.get("modelList"),n=t.model.NAME+":change";e.columnsChange||(e.columnsChange=this.after("columnsChange",f("_afterColumnsChange",this))),t&&!e.dataChange&&(e.dataChange=t.after(["add","remove","reset",n],f("_afterDataChange",this)))},_createDataHTML:function(e){var t=this.get("modelList"),n="";return t&&t.each(function(t,r){n+=this._createRowHTML(t,r,e)},this),n},_createRowHTML:function(e,t,n){var r=e.toJSON(),i=e.get("clientId"),s={rowId:this._getRowId(i),clientId:i,rowClass:t%2?this.CLASS_ODD:this.CLASS_EVEN},a=this.host||this,f,l,c,h,p,d;for(f=0,l=n.length;f<l;++f){c=n[f],p=r[c.key],h=c._id||c.key,s[h+"-className"]="",c.formatter&&(d={value:p,data:r,column:c,record:e,className:"",rowClass:"",rowIndex:t},typeof c.formatter=="string"?p!==undefined&&(p=o(c.formatter,d)):(p=c.formatter.call(a,d),p===undefined&&(p=d.value),s[h+"-className"]=d.className,s.rowClass+=" "+d.rowClass));if(p===undefined||p===null||p==="")p=c.emptyCellValue||"";s[h]=c.allowHTML?p:u(p),s.rowClass=s.rowClass.replace(/\s+/g," ")}return o(this._rowTemplate,s)},_createRowTemplate:function(e){var t="",n=this.CELL_TEMPLATE,r,i,s,u,a,f,l;for(r=0,i=e.length;r<i;++r)s=e[r],u=s.key,a=s._id||u,f=(s._headers||[]).length>1?'headers="'+s._headers.join(" ")+'"':"",l={content:"{"+a+"}",headers:f,className:this.getClassName("col",a)+" "+(s.className||"")+" "+this.getClassName("cell")+" {"+a+"-className}"},s.nodeFormatter&&(l.content=""),t+=o(s.cellTemplate||n,l);this._rowTemplate=o(this.ROW_TEMPLATE,{content:t})},_createTBodyNode:function(){return e.Node.create(o(this.TBODY_TEMPLATE,{className:this.getClassName("data")}))},destructor:function(){(new e.EventHandle(l.values(this._eventHandles))).detach()},_getRowId:function(t){return this._idMap[t]||(this._idMap[t]=e.guid())},initializer:function(e){this.host=e.host,this._eventHandles={modelListChange:this.after("modelListChange",f("_afterModelListChange",this))},this._idMap={},this.CLASS_ODD=this.getClassName("odd"),this.CLASS_EVEN=this.getClassName("even")}})},"3.7.2",{requires:["datatable-core","view","classnamemanager"]});+YUI.add("datatable-body",function(e,t){var n=e.Lang,r=n.isArray,i=n.isNumber,s=n.isString,o=n.sub,u=e.Escape.html,a=e.Array,f=e.bind,l=e.Object;e.namespace("DataTable").BodyView=e.Base.create("tableBody",e.View,[],{CELL_TEMPLATE:'<td {headers} class="{className}">{content}</td>',ROW_TEMPLATE:'<tr id="{rowId}" data-yui3-record="{clientId}" class="{rowClass}">{content}</tr>',TBODY_TEMPLATE:'<tbody class="{className}"></tbody>',getCell:function(t,n){var i=this.tbodyNode,o,u,a,f;if(t&&i){r(t)?(o=i.get("children").item(t[0]),u=o&&o.get("children").item(t[1])):e.instanceOf(t,e.Node)&&(u=t.ancestor("."+this.getClassName("cell"),!0));if(u&&n){f=i.get("firstChild.rowIndex");if(s(n))switch(n){case"above":n=[-1,0];break;case"below":n=[1,0];break;case"next":n=[0,1];break;case"previous":n=[0,-1]}r(n)&&(a=u.get("parentNode.rowIndex")+n[0]-f,o=i.get("children").item(a),a=u.get("cellIndex")+n[1],u=o&&o.get("children").item(a))}}return u||null},getClassName:function(){var t=this.host,n;return t&&t.getClassName?t.getClassName.apply(t,arguments):(n=a(arguments),n.unshift(this.constructor.NAME),e.ClassNameManager.getClassName.apply(e.ClassNameManager,n))},getRecord:function(t){var n=this.get("modelList"),r=this.tbodyNode,i=null,o;return r&&(s(t)&&(t=r.one("#"+t)),e.instanceOf(t,e.Node)&&(i=t.ancestor(function(e){return e.get("parentNode").compareTo(r)},!0),o=i&&n.getByClientId(i.getData("yui3-record")))),o||null},getRow:function(e){var t=this.tbodyNode,n=null;return t&&(e&&(e=this._idMap[e.get?e.get("clientId"):e]||e),n=i(e)?t.get("children").item(e):t.one("#"+e)),n},render:function(){var e=this.get("container"),t=this.get("modelList"),n=this.get("columns"),r=this.tbodyNode||(this.tbodyNode=this._createTBodyNode());return this._createRowTemplate(n),t&&(r.setHTML(this._createDataHTML(n)),this._applyNodeFormatters(r,n)),r.get("parentNode")!==e&&e.appendChild(r),this.bindUI(),this},_afterColumnsChange:function(e){this.render()},_afterDataChange:function(e){this.render()},_afterModelListChange:function(e){var t=this._eventHandles;t.dataChange&&(t.dataChange.detach(),delete t.dataChange,this.bindUI()),this.tbodyNode&&this.render()},_applyNodeFormatters:function(e,t){var n=this.host,r=this.get("modelList"),i=[],s="."+this.getClassName("liner"),o,u,a;for(u=0,a=t.length;u<a;++u)t[u].nodeFormatter&&i.push(u);r&&i.length&&(o=e.get("childNodes"),r.each(function(e,r){var u={data:e.toJSON(),record:e,rowIndex:r},a=o.item(r),f,l,c,h,p,d,v;if(a){p=a.get("childNodes");for(f=0,l=i.length;f<l;++f)d=p.item(i[f]),d&&(c=u.column=t[i[f]],h=c.key||c.id,u.value=e.get(h),u.td=d,u.cell=d.one(s)||d,v=c.nodeFormatter.call(n,u),v===!1&&d.destroy(!0))}}))},bindUI:function(){var e=this._eventHandles,t=this.get("modelList"),n=t.model.NAME+":change";e.columnsChange||(e.columnsChange=this.after("columnsChange",f("_afterColumnsChange",this))),t&&!e.dataChange&&(e.dataChange=t.after(["add","remove","reset",n],f("_afterDataChange",this)))},_createDataHTML:function(e){var t=this.get("modelList"),n="";return t&&t.each(function(t,r){n+=this._createRowHTML(t,r,e)},this),n},_createRowHTML:function(e,t,n){var r=e.toJSON(),i=e.get("clientId"),s={rowId:this._getRowId(i),clientId:i,rowClass:t%2?this.CLASS_ODD:this.CLASS_EVEN},a=this.host||this,f,l,c,h,p,d;for(f=0,l=n.length;f<l;++f){c=n[f],p=r[c.key],h=c._id||c.key,s[h+"-className"]="",c.formatter&&(d={value:p,data:r,column:c,record:e,className:"",rowClass:"",rowIndex:t},typeof c.formatter=="string"?p!==undefined&&(p=o(c.formatter,d)):(p=c.formatter.call(a,d),p===undefined&&(p=d.value),s[h+"-className"]=d.className,s.rowClass+=" "+d.rowClass));if(p===undefined||p===null||p==="")p=c.emptyCellValue||"";s[h]=c.allowHTML?p:u(p),s.rowClass=s.rowClass.replace(/\s+/g," ")}return o(this._rowTemplate,s)},_createRowTemplate:function(e){var t="",n=this.CELL_TEMPLATE,r,i,s,u,a,f,l;for(r=0,i=e.length;r<i;++r)s=e[r],u=s.key,a=s._id||u,f=(s._headers||[]).length>1?'headers="'+s._headers.join(" ")+'"':"",l={content:"{"+a+"}",headers:f,className:this.getClassName("col",a)+" "+(s.className||"")+" "+this.getClassName("cell")+" {"+a+"-className}"},s.nodeFormatter&&(l.content=""),t+=o(s.cellTemplate||n,l);this._rowTemplate=o(this.ROW_TEMPLATE,{content:t})},_createTBodyNode:function(){return e.Node.create(o(this.TBODY_TEMPLATE,{className:this.getClassName("data")}))},destructor:function(){(new e.EventHandle(l.values(this._eventHandles))).detach()},_getRowId:function(t){return this._idMap[t]||(this._idMap[t]=e.guid())},initializer:function(e){this.host=e.host,this._eventHandles={modelListChange:this.after("modelListChange",f("_afterModelListChange",this))},this._idMap={},this.CLASS_ODD=this.getClassName("odd"),this.CLASS_EVEN=this.getClassName("even")}})},"3.7.3",{requires:["datatable-core","view","classnamemanager"]});
bundle/datatable-body/datatable-body.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -868,4 +868,4 @@ }); -}, '3.7.2', {"requires": ["datatable-core", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "view", "classnamemanager"]});
bundle/datatable-column-widths/datatable-column-widths-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-column-widths/datatable-column-widths.js", code: [] };-_yuitest_coverage["build/datatable-column-widths/datatable-column-widths.js"].code=["YUI.add('datatable-column-widths', function (Y, NAME) {","","/**","Adds basic, programmatic column width support to DataTable via column","configuration property `width` and method `table.setColumnWidth(id, width);`.","","@module datatable","@submodule datatable-column-widths","@since 3.5.0","**/","var isNumber = Y.Lang.isNumber,"," arrayIndex = Y.Array.indexOf;","","Y.Features.add('table', 'badColWidth', {"," test: function () {"," var body = Y.one('body'),"," node, broken;",""," if (body) {"," // In modern browsers, <col style=\"width:X\"> will make columns,"," // *including padding and borders* X wide. The cell content width"," // is reduced. In old browsers and all Opera versions to date, the"," // col's width style is passed to the cells, which causes cell"," // padding/border to bloat the rendered width."," node = body.insertBefore("," '<table style=\"position:absolute;visibility:hidden;border:0 none\">' +"," '<colgroup><col style=\"width:9px\"></colgroup>' +"," '<tbody><tr>' +"," '<td style=\"' +"," 'padding:0 4px;' +"," 'font:normal 2px/2px arial;' +"," 'border:0 none\">' +"," '.' + // Just something to give the cell dimension"," '</td></tr></tbody>' +"," '</table>',"," body.get('firstChild'));",""," broken = node.one('td').getComputedStyle('width') !== '1px';",""," node.remove(true);"," }",""," return broken;"," }","});","","/**","_API docs for this extension are included in the DataTable class._","","Adds basic, programmatic column width support to DataTable. Note, this does not","add support for truncated columns. Due to the way HTML tables render, column","width is more like a \"recommended width\". Column content wider than the","assigned width will cause the column to expand, despite the configured width.","Similarly if the table is too narrow to fit the column with the configured","column width, the column width will be reduced.","","To set a column width, either add a `width` value to the column configuration","or call the `setColumnWidth(id, width)` method.","","Note, assigning column widths is possible without this module, as each cell is","decorated with a class appropriate for that column which you can statically","target in your site's CSS.","","To achieve absolute column widths, with content truncation, you can either:","","1. Use this module, configure *all* columns to have `width`s, then add"," `table-layout: fixed;` to your CSS for the appropriate `<table>`, or","2. Wrap the contents of all cells in the column with a `<div>` (using a"," `cellTemplate` or `formatter`), assign the div's style `width`, then assign"," the column `width` or add a CSS `width` to the column class created by"," DataTable.","","<pre><code>.yui3-datatable .yui3-datatable-col-foo {"," padding: 0;"," width: 125px;","}",".yui3-datatable .yui3-datatable-col-foo .yui3-datatable-liner {"," overflow: hidden;"," padding: 4px 10px;"," width: 125px;","}","</pre></code>","","<pre><code>var table = new Y.DataTable({"," columns: ["," {"," key: 'foo',"," cellTemplate:"," '<td class=\"{className}\">' +"," '<div class=\"yui3-datatable-liner\">{content}</div>' +"," '</td>'"," },"," ..."," ],"," ...","});","</code></pre>","","To add a liner to all columns, either provide a custom `bodyView` to the","DataTable constructor or update the default `bodyView`'s `CELL_TEMPLATE` like","so:","","<pre><code>table.on('renderBody', function (e) {"," e.view.CELL_TEMPLATE = e.view.CELL_TEMPLATE.replace(/\\{content\\}/,"," '<div class=\"yui3-datatable-liner\">{content}</div>');","});","</code></pre>","","Keep in mind that DataTable skins apply cell `padding`, so assign your CSS","`width`s accordingly or override the `padding` style for that column's `<td>`s","to 0, and add `padding` to the liner `<div>`'s styles as shown above.","","@class DataTable.ColumnWidths","@for DataTable","@since 3.5.0","**/","function ColumnWidths() {}","","Y.mix(ColumnWidths.prototype, {"," /**"," The HTML template used to create the table's `<col>`s.",""," @property COL_TEMPLATE"," @type {HTML}"," @default '<col/>'"," @since 3.5.0"," **/"," COL_TEMPLATE: '<col/>',",""," /**"," The HTML template used to create the table's `<colgroup>`.",""," @property COLGROUP_TEMPLATE"," @type {HTML}"," @default '<colgroup/>'"," @since 3.5.0"," **/"," COLGROUP_TEMPLATE: '<colgroup/>',",""," /**"," Assigns the style width of the `<col>` representing the column identifed by"," `id` and updates the column configuration.",""," Pass the empty string for `width` to return a column to auto sizing.",""," This does not trigger a `columnsChange` event today, but I can be convinced"," that it should.",""," @method setColumnWidth"," @param {Number|String|Object} id The column config object or key, name, or"," index of a column in the host's `_displayColumns` array."," @param {Number|String} width CSS width value. Numbers are treated as pixels"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," setColumnWidth: function (id, width) {"," var col = this.getColumn(id),"," index = col && arrayIndex(this._displayColumns, col);",""," if (index > -1) {"," if (isNumber(width)) {"," width += 'px';"," }",""," col.width = width;",""," this._setColumnWidth(index, width);"," }",""," return this;"," },",""," //--------------------------------------------------------------------------"," // Protected properties and methods"," //--------------------------------------------------------------------------"," /**"," Renders the table's `<colgroup>` and populates the `_colgroupNode` property.",""," @method _createColumnGroup"," @protected"," @since 3.5.0"," **/"," _createColumnGroup: function () {"," return Y.Node.create(this.COLGROUP_TEMPLATE);"," },",""," /**"," Hooks up to the rendering lifecycle to also render the `<colgroup>` and"," subscribe to `columnChange` events.",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.after(['renderView', 'columnsChange'], this._uiSetColumnWidths);"," },",""," /**"," Sets a columns's `<col>` element width style. This is needed to get around"," browser rendering differences.",""," The colIndex corresponds to the item index of the `<col>` in the table's"," `<colgroup>`.",""," To unset the width, pass a falsy value for the `width`.",""," @method _setColumnWidth"," @param {Number} colIndex The display column index"," @param {Number|String} width The desired width"," @protected"," @since 3.5.0"," **/"," // TODO: move this to a conditional module"," _setColumnWidth: function (colIndex, width) {"," // Opera (including Opera Next circa 1/13/2012) and IE7- pass on the"," // width style to the cells directly, allowing padding and borders to"," // expand the rendered width. Chrome 16, Safari 5.1.1, and FF 3.6+ all"," // make the rendered width equal the col's style width, reducing the"," // cells' calculated width."," var colgroup = this._colgroupNode,"," col = colgroup && colgroup.all('col').item(colIndex),"," cell, getCStyle;",""," if (col) {"," if (width && isNumber(width)) {"," width += 'px';"," }",""," col.setStyle('width', width);",""," // Adjust the width for browsers that make"," // td.style.width === col.style.width"," if (width && Y.Features.test('table', 'badColWidth')) {"," cell = this.getCell([0, colIndex]);"," "," if (cell) {"," getCStyle = function (prop) {"," return parseInt(cell.getComputedStyle(prop), 10)|0;"," };",""," col.setStyle('width',"," // I hate this"," parseInt(width, 10) -"," getCStyle('paddingLeft') -"," getCStyle('paddingRight') -"," getCStyle('borderLeftWidth') -"," getCStyle('borderRightWidth') + 'px');",""," }"," }"," }"," },",""," /**"," Populates the table's `<colgroup>` with a `<col>` per item in the `columns`"," attribute without children. It is assumed that these are the columns that"," have data cells renderered for them.",""," @method _uiSetColumnWidths"," @protected"," @since 3.5.0"," **/"," _uiSetColumnWidths: function () {"," if (!this.view) {"," return;"," }",""," var template = this.COL_TEMPLATE,"," colgroup = this._colgroupNode,"," columns = this._displayColumns,"," i, len;",""," if (!colgroup) {"," colgroup = this._colgroupNode = this._createColumnGroup();",""," this._tableNode.insertBefore("," colgroup,"," this._tableNode.one('> thead, > tfoot, > tbody'));"," } else {"," colgroup.empty();"," }",""," for (i = 0, len = columns.length; i < len; ++i) {",""," colgroup.append(template);",""," this._setColumnWidth(i, columns[i].width);"," }"," }","}, true);","","Y.DataTable.ColumnWidths = ColumnWidths;","","Y.Base.mix(Y.DataTable, [ColumnWidths]);","","","}, '3.7.2', {\"requires\": [\"datatable-base\"]});"];+_yuitest_coverage["build/datatable-column-widths/datatable-column-widths.js"].code=["YUI.add('datatable-column-widths', function (Y, NAME) {","","/**","Adds basic, programmatic column width support to DataTable via column","configuration property `width` and method `table.setColumnWidth(id, width);`.","","@module datatable","@submodule datatable-column-widths","@since 3.5.0","**/","var isNumber = Y.Lang.isNumber,"," arrayIndex = Y.Array.indexOf;","","Y.Features.add('table', 'badColWidth', {"," test: function () {"," var body = Y.one('body'),"," node, broken;",""," if (body) {"," // In modern browsers, <col style=\"width:X\"> will make columns,"," // *including padding and borders* X wide. The cell content width"," // is reduced. In old browsers and all Opera versions to date, the"," // col's width style is passed to the cells, which causes cell"," // padding/border to bloat the rendered width."," node = body.insertBefore("," '<table style=\"position:absolute;visibility:hidden;border:0 none\">' +"," '<colgroup><col style=\"width:9px\"></colgroup>' +"," '<tbody><tr>' +"," '<td style=\"' +"," 'padding:0 4px;' +"," 'font:normal 2px/2px arial;' +"," 'border:0 none\">' +"," '.' + // Just something to give the cell dimension"," '</td></tr></tbody>' +"," '</table>',"," body.get('firstChild'));",""," broken = node.one('td').getComputedStyle('width') !== '1px';",""," node.remove(true);"," }",""," return broken;"," }","});","","/**","_API docs for this extension are included in the DataTable class._","","Adds basic, programmatic column width support to DataTable. Note, this does not","add support for truncated columns. Due to the way HTML tables render, column","width is more like a \"recommended width\". Column content wider than the","assigned width will cause the column to expand, despite the configured width.","Similarly if the table is too narrow to fit the column with the configured","column width, the column width will be reduced.","","To set a column width, either add a `width` value to the column configuration","or call the `setColumnWidth(id, width)` method.","","Note, assigning column widths is possible without this module, as each cell is","decorated with a class appropriate for that column which you can statically","target in your site's CSS.","","To achieve absolute column widths, with content truncation, you can either:","","1. Use this module, configure *all* columns to have `width`s, then add"," `table-layout: fixed;` to your CSS for the appropriate `<table>`, or","2. Wrap the contents of all cells in the column with a `<div>` (using a"," `cellTemplate` or `formatter`), assign the div's style `width`, then assign"," the column `width` or add a CSS `width` to the column class created by"," DataTable.","","<pre><code>.yui3-datatable .yui3-datatable-col-foo {"," padding: 0;"," width: 125px;","}",".yui3-datatable .yui3-datatable-col-foo .yui3-datatable-liner {"," overflow: hidden;"," padding: 4px 10px;"," width: 125px;","}","</pre></code>","","<pre><code>var table = new Y.DataTable({"," columns: ["," {"," key: 'foo',"," cellTemplate:"," '<td class=\"{className}\">' +"," '<div class=\"yui3-datatable-liner\">{content}</div>' +"," '</td>'"," },"," ..."," ],"," ...","});","</code></pre>","","To add a liner to all columns, either provide a custom `bodyView` to the","DataTable constructor or update the default `bodyView`'s `CELL_TEMPLATE` like","so:","","<pre><code>table.on('renderBody', function (e) {"," e.view.CELL_TEMPLATE = e.view.CELL_TEMPLATE.replace(/\\{content\\}/,"," '<div class=\"yui3-datatable-liner\">{content}</div>');","});","</code></pre>","","Keep in mind that DataTable skins apply cell `padding`, so assign your CSS","`width`s accordingly or override the `padding` style for that column's `<td>`s","to 0, and add `padding` to the liner `<div>`'s styles as shown above.","","@class DataTable.ColumnWidths","@for DataTable","@since 3.5.0","**/","function ColumnWidths() {}","","Y.mix(ColumnWidths.prototype, {"," /**"," The HTML template used to create the table's `<col>`s.",""," @property COL_TEMPLATE"," @type {HTML}"," @default '<col/>'"," @since 3.5.0"," **/"," COL_TEMPLATE: '<col/>',",""," /**"," The HTML template used to create the table's `<colgroup>`.",""," @property COLGROUP_TEMPLATE"," @type {HTML}"," @default '<colgroup/>'"," @since 3.5.0"," **/"," COLGROUP_TEMPLATE: '<colgroup/>',",""," /**"," Assigns the style width of the `<col>` representing the column identifed by"," `id` and updates the column configuration.",""," Pass the empty string for `width` to return a column to auto sizing.",""," This does not trigger a `columnsChange` event today, but I can be convinced"," that it should.",""," @method setColumnWidth"," @param {Number|String|Object} id The column config object or key, name, or"," index of a column in the host's `_displayColumns` array."," @param {Number|String} width CSS width value. Numbers are treated as pixels"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," setColumnWidth: function (id, width) {"," var col = this.getColumn(id),"," index = col && arrayIndex(this._displayColumns, col);",""," if (index > -1) {"," if (isNumber(width)) {"," width += 'px';"," }",""," col.width = width;",""," this._setColumnWidth(index, width);"," }",""," return this;"," },",""," //--------------------------------------------------------------------------"," // Protected properties and methods"," //--------------------------------------------------------------------------"," /**"," Renders the table's `<colgroup>` and populates the `_colgroupNode` property.",""," @method _createColumnGroup"," @protected"," @since 3.5.0"," **/"," _createColumnGroup: function () {"," return Y.Node.create(this.COLGROUP_TEMPLATE);"," },",""," /**"," Hooks up to the rendering lifecycle to also render the `<colgroup>` and"," subscribe to `columnChange` events.",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.after(['renderView', 'columnsChange'], this._uiSetColumnWidths);"," },",""," /**"," Sets a columns's `<col>` element width style. This is needed to get around"," browser rendering differences.",""," The colIndex corresponds to the item index of the `<col>` in the table's"," `<colgroup>`.",""," To unset the width, pass a falsy value for the `width`.",""," @method _setColumnWidth"," @param {Number} colIndex The display column index"," @param {Number|String} width The desired width"," @protected"," @since 3.5.0"," **/"," // TODO: move this to a conditional module"," _setColumnWidth: function (colIndex, width) {"," // Opera (including Opera Next circa 1/13/2012) and IE7- pass on the"," // width style to the cells directly, allowing padding and borders to"," // expand the rendered width. Chrome 16, Safari 5.1.1, and FF 3.6+ all"," // make the rendered width equal the col's style width, reducing the"," // cells' calculated width."," var colgroup = this._colgroupNode,"," col = colgroup && colgroup.all('col').item(colIndex),"," cell, getCStyle;",""," if (col) {"," if (width && isNumber(width)) {"," width += 'px';"," }",""," col.setStyle('width', width);",""," // Adjust the width for browsers that make"," // td.style.width === col.style.width"," if (width && Y.Features.test('table', 'badColWidth')) {"," cell = this.getCell([0, colIndex]);"," "," if (cell) {"," getCStyle = function (prop) {"," return parseInt(cell.getComputedStyle(prop), 10)|0;"," };",""," col.setStyle('width',"," // I hate this"," parseInt(width, 10) -"," getCStyle('paddingLeft') -"," getCStyle('paddingRight') -"," getCStyle('borderLeftWidth') -"," getCStyle('borderRightWidth') + 'px');",""," }"," }"," }"," },",""," /**"," Populates the table's `<colgroup>` with a `<col>` per item in the `columns`"," attribute without children. It is assumed that these are the columns that"," have data cells renderered for them.",""," @method _uiSetColumnWidths"," @protected"," @since 3.5.0"," **/"," _uiSetColumnWidths: function () {"," if (!this.view) {"," return;"," }",""," var template = this.COL_TEMPLATE,"," colgroup = this._colgroupNode,"," columns = this._displayColumns,"," i, len;",""," if (!colgroup) {"," colgroup = this._colgroupNode = this._createColumnGroup();",""," this._tableNode.insertBefore("," colgroup,"," this._tableNode.one('> thead, > tfoot, > tbody'));"," } else {"," colgroup.empty();"," }",""," for (i = 0, len = columns.length; i < len; ++i) {",""," colgroup.append(template);",""," this._setColumnWidth(i, columns[i].width);"," }"," }","}, true);","","Y.DataTable.ColumnWidths = ColumnWidths;","","Y.Base.mix(Y.DataTable, [ColumnWidths]);","","","}, '3.7.3', {\"requires\": [\"datatable-base\"]});"]; _yuitest_coverage["build/datatable-column-widths/datatable-column-widths.js"].lines = {"1":0,"11":0,"14":0,"16":0,"19":0,"25":0,"38":0,"40":0,"43":0,"117":0,"119":0,"158":0,"161":0,"162":0,"163":0,"166":0,"168":0,"171":0,"185":0,"197":0,"222":0,"226":0,"227":0,"228":0,"231":0,"235":0,"236":0,"238":0,"239":0,"240":0,"243":0,"266":0,"267":0,"270":0,"275":0,"276":0,"278":0,"282":0,"285":0,"287":0,"289":0,"294":0,"296":0}; _yuitest_coverage["build/datatable-column-widths/datatable-column-widths.js"].functions = {"test:15":0,"ColumnWidths:117":0,"setColumnWidth:157":0,"_createColumnGroup:184":0,"initializer:196":0,"getCStyle:239":0,"_setColumnWidth:216":0,"_uiSetColumnWidths:265":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-column-widths/datatable-column-widths.js"].coveredLines = 43;@@ -386,4 +386,4 @@ Y.Base.mix(Y.DataTable, [ColumnWidths]); -}, '3.7.2', {"requires": ["datatable-base"]});+}, '3.7.3', {"requires": ["datatable-base"]});
bundle/datatable-column-widths/datatable-column-widths-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -302,4 +302,4 @@ Y.Base.mix(Y.DataTable, [ColumnWidths]); -}, '3.7.2', {"requires": ["datatable-base"]});+}, '3.7.3', {"requires": ["datatable-base"]});
bundle/datatable-column-widths/datatable-column-widths-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-column-widths",function(e,t){function i(){}var n=e.Lang.isNumber,r=e.Array.indexOf;e.Features.add("table","badColWidth",{test:function(){var t=e.one("body"),n,r;return t&&(n=t.insertBefore('<table style="position:absolute;visibility:hidden;border:0 none"><colgroup><col style="width:9px"></colgroup><tbody><tr><td style="padding:0 4px;font:normal 2px/2px arial;border:0 none">.</td></tr></tbody></table>',t.get("firstChild")),r=n.one("td").getComputedStyle("width")!=="1px",n.remove(!0)),r}}),e.mix(i.prototype,{COL_TEMPLATE:"<col/>",COLGROUP_TEMPLATE:"<colgroup/>",setColumnWidth:function(e,t){var i=this.getColumn(e),s=i&&r(this._displayColumns,i);return s>-1&&(n(t)&&(t+="px"),i.width=t,this._setColumnWidth(s,t)),this},_createColumnGroup:function(){return e.Node.create(this.COLGROUP_TEMPLATE)},initializer:function(e){this.after(["renderView","columnsChange"],this._uiSetColumnWidths)},_setColumnWidth:function(t,r){var i=this._colgroupNode,s=i&&i.all("col").item(t),o,u;s&&(r&&n(r)&&(r+="px"),s.setStyle("width",r),r&&e.Features.test("table","badColWidth")&&(o=this.getCell([0,t]),o&&(u=function(e){return parseInt(o.getComputedStyle(e),10)|0},s.setStyle("width",parseInt(r,10)-u("paddingLeft")-u("paddingRight")-u("borderLeftWidth")-u("borderRightWidth")+"px"))))},_uiSetColumnWidths:function(){if(!this.view)return;var e=this.COL_TEMPLATE,t=this._colgroupNode,n=this._displayColumns,r,i;t?t.empty():(t=this._colgroupNode=this._createColumnGroup(),this._tableNode.insertBefore(t,this._tableNode.one("> thead, > tfoot, > tbody")));for(r=0,i=n.length;r<i;++r)t.append(e),this._setColumnWidth(r,n[r].width)}},!0),e.DataTable.ColumnWidths=i,e.Base.mix(e.DataTable,[i])},"3.7.2",{requires:["datatable-base"]});+YUI.add("datatable-column-widths",function(e,t){function i(){}var n=e.Lang.isNumber,r=e.Array.indexOf;e.Features.add("table","badColWidth",{test:function(){var t=e.one("body"),n,r;return t&&(n=t.insertBefore('<table style="position:absolute;visibility:hidden;border:0 none"><colgroup><col style="width:9px"></colgroup><tbody><tr><td style="padding:0 4px;font:normal 2px/2px arial;border:0 none">.</td></tr></tbody></table>',t.get("firstChild")),r=n.one("td").getComputedStyle("width")!=="1px",n.remove(!0)),r}}),e.mix(i.prototype,{COL_TEMPLATE:"<col/>",COLGROUP_TEMPLATE:"<colgroup/>",setColumnWidth:function(e,t){var i=this.getColumn(e),s=i&&r(this._displayColumns,i);return s>-1&&(n(t)&&(t+="px"),i.width=t,this._setColumnWidth(s,t)),this},_createColumnGroup:function(){return e.Node.create(this.COLGROUP_TEMPLATE)},initializer:function(e){this.after(["renderView","columnsChange"],this._uiSetColumnWidths)},_setColumnWidth:function(t,r){var i=this._colgroupNode,s=i&&i.all("col").item(t),o,u;s&&(r&&n(r)&&(r+="px"),s.setStyle("width",r),r&&e.Features.test("table","badColWidth")&&(o=this.getCell([0,t]),o&&(u=function(e){return parseInt(o.getComputedStyle(e),10)|0},s.setStyle("width",parseInt(r,10)-u("paddingLeft")-u("paddingRight")-u("borderLeftWidth")-u("borderRightWidth")+"px"))))},_uiSetColumnWidths:function(){if(!this.view)return;var e=this.COL_TEMPLATE,t=this._colgroupNode,n=this._displayColumns,r,i;t?t.empty():(t=this._colgroupNode=this._createColumnGroup(),this._tableNode.insertBefore(t,this._tableNode.one("> thead, > tfoot, > tbody")));for(r=0,i=n.length;r<i;++r)t.append(e),this._setColumnWidth(r,n[r].width)}},!0),e.DataTable.ColumnWidths=i,e.Base.mix(e.DataTable,[i])},"3.7.3",{requires:["datatable-base"]});
bundle/datatable-column-widths/datatable-column-widths.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -302,4 +302,4 @@ Y.Base.mix(Y.DataTable, [ColumnWidths]); -}, '3.7.2', {"requires": ["datatable-base"]});+}, '3.7.3', {"requires": ["datatable-base"]});
bundle/datatable-core/datatable-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-core/datatable-core.js", code: [] };-_yuitest_coverage["build/datatable-core/datatable-core.js"].code=["YUI.add('datatable-core', function (Y, NAME) {","","/**","The core implementation of the `DataTable` and `DataTable.Base` Widgets.","","@module datatable","@submodule datatable-core","@since 3.5.0","**/","","var INVALID = Y.Attribute.INVALID_VALUE,",""," Lang = Y.Lang,"," isFunction = Lang.isFunction,"," isObject = Lang.isObject,"," isArray = Lang.isArray,"," isString = Lang.isString,"," isNumber = Lang.isNumber,",""," toArray = Y.Array,",""," keys = Y.Object.keys,",""," Table;"," ","/**","_API docs for this extension are included in the DataTable class._","","Class extension providing the core API and structure for the DataTable Widget.","","Use this class extension with Widget or another Base-based superclass to create","the basic DataTable model API and composing class structure.","","@class DataTable.Core","@for DataTable","@since 3.5.0","**/","Table = Y.namespace('DataTable').Core = function () {};","","Table.ATTRS = {"," /**"," Columns to include in the rendered table."," "," If omitted, the attributes on the configured `recordType` or the first item"," in the `data` collection will be used as a source.",""," This attribute takes an array of strings or objects (mixing the two is"," fine). Each string or object is considered a column to be rendered."," Strings are converted to objects, so `columns: ['first', 'last']` becomes"," `columns: [{ key: 'first' }, { key: 'last' }]`.",""," DataTable.Core only concerns itself with a few properties of columns."," These properties are:",""," * `key` - Used to identify the record field/attribute containing content for"," this column. Also used to create a default Model if no `recordType` or"," `data` are provided during construction. If `name` is not specified, this"," is assigned to the `_id` property (with added incrementer if the key is"," used by multiple columns)."," * `children` - Traversed to initialize nested column objects"," * `name` - Used in place of, or in addition to, the `key`. Useful for"," columns that aren't bound to a field/attribute in the record data. This"," is assigned to the `_id` property."," * `id` - For backward compatibility. Implementers can specify the id of"," the header cell. This should be avoided, if possible, to avoid the"," potential for creating DOM elements with duplicate IDs."," * `field` - For backward compatibility. Implementers should use `name`."," * `_id` - Assigned unique-within-this-instance id for a column. By order"," of preference, assumes the value of `name`, `key`, `id`, or `_yuid`."," This is used by the rendering views as well as feature module"," as a means to identify a specific column without ambiguity (such as"," multiple columns using the same `key`."," * `_yuid` - Guid stamp assigned to the column object."," * `_parent` - Assigned to all child columns, referencing their parent"," column.",""," @attribute columns"," @type {Object[]|String[]}"," @default (from `recordType` ATTRS or first item in the `data`)"," @since 3.5.0"," **/"," columns: {"," // TODO: change to setter to clone input array/objects"," validator: isArray,"," setter: '_setColumns',"," getter: '_getColumns'"," },",""," /**"," Model subclass to use as the `model` for the ModelList stored in the `data`"," attribute.",""," If not provided, it will try really hard to figure out what to use. The"," following attempts will be made to set a default value:"," "," 1. If the `data` attribute is set with a ModelList instance and its `model`"," property is set, that will be used."," 2. If the `data` attribute is set with a ModelList instance, and its"," `model` property is unset, but it is populated, the `ATTRS` of the"," `constructor of the first item will be used."," 3. If the `data` attribute is set with a non-empty array, a Model subclass"," will be generated using the keys of the first item as its `ATTRS` (see"," the `_createRecordClass` method)."," 4. If the `columns` attribute is set, a Model subclass will be generated"," using the columns defined with a `key`. This is least desirable because"," columns can be duplicated or nested in a way that's not parsable."," 5. If neither `data` nor `columns` is set or populated, a change event"," subscriber will listen for the first to be changed and try all over"," again.",""," @attribute recordType"," @type {Function}"," @default (see description)"," @since 3.5.0"," **/"," recordType: {"," getter: '_getRecordType',"," setter: '_setRecordType'"," },",""," /**"," The collection of data records to display. This attribute is a pass"," through to a `data` property, which is a ModelList instance.",""," If this attribute is passed a ModelList or subclass, it will be assigned to"," the property directly. If an array of objects is passed, a new ModelList"," will be created using the configured `recordType` as its `model` property"," and seeded with the array.",""," Retrieving this attribute will return the ModelList stored in the `data`"," property.",""," @attribute data"," @type {ModelList|Object[]}"," @default `new ModelList()`"," @since 3.5.0"," **/"," data: {"," valueFn: '_initData',"," setter : '_setData',"," lazyAdd: false"," },",""," /**"," Content for the `<table summary=\"ATTRIBUTE VALUE HERE\">`. Values assigned"," to this attribute will be HTML escaped for security.",""," @attribute summary"," @type {String}"," @default '' (empty string)"," @since 3.5.0"," **/"," //summary: {},",""," /**"," HTML content of an optional `<caption>` element to appear above the table."," Leave this config unset or set to a falsy value to remove the caption.",""," @attribute caption"," @type HTML"," @default '' (empty string)"," @since 3.5.0"," **/"," //caption: {},",""," /**"," Deprecated as of 3.5.0. Passes through to the `data` attribute.",""," WARNING: `get('recordset')` will NOT return a Recordset instance as of"," 3.5.0. This is a break in backward compatibility.",""," @attribute recordset"," @type {Object[]|Recordset}"," @deprecated Use the `data` attribute"," @since 3.5.0"," **/"," recordset: {"," setter: '_setRecordset',"," getter: '_getRecordset',"," lazyAdd: false"," },",""," /**"," Deprecated as of 3.5.0. Passes through to the `columns` attribute.",""," WARNING: `get('columnset')` will NOT return a Columnset instance as of"," 3.5.0. This is a break in backward compatibility.",""," @attribute columnset"," @type {Object[]}"," @deprecated Use the `columns` attribute"," @since 3.5.0"," **/"," columnset: {"," setter: '_setColumnset',"," getter: '_getColumnset',"," lazyAdd: false"," }","};","","Y.mix(Table.prototype, {"," // -- Instance properties -------------------------------------------------"," /**"," The ModelList that manages the table's data.",""," @property data"," @type {ModelList}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //data: null,",""," // -- Public methods ------------------------------------------------------",""," /**"," Gets the column configuration object for the given key, name, or index. For"," nested columns, `name` can be an array of indexes, each identifying the index"," of that column in the respective parent's \"children\" array.",""," If you pass a column object, it will be returned.",""," For columns with keys, you can also fetch the column with"," `instance.get('columns.foo')`.",""," @method getColumn"," @param {String|Number|Number[]} name Key, \"name\", index, or index array to"," identify the column"," @return {Object} the column configuration object"," @since 3.5.0"," **/"," getColumn: function (name) {"," var col, columns, i, len, cols;",""," if (isObject(name) && !isArray(name)) {"," // TODO: support getting a column from a DOM node - this will cross"," // the line into the View logic, so it should be relayed",""," // Assume an object passed in is already a column def"," col = name;"," } else {"," col = this.get('columns.' + name);"," }",""," if (col) {"," return col;"," }",""," columns = this.get('columns');",""," if (isNumber(name) || isArray(name)) {"," name = toArray(name);"," cols = columns;",""," for (i = 0, len = name.length - 1; cols && i < len; ++i) {"," cols = cols[name[i]] && cols[name[i]].children;"," }",""," return (cols && cols[name[i]]) || null;"," }",""," return null;"," },",""," /**"," Returns the Model associated to the record `id`, `clientId`, or index (not"," row index). If none of those yield a Model from the `data` ModelList, the"," arguments will be passed to the `view` instance's `getRecord` method"," if it has one.",""," If no Model can be found, `null` is returned.",""," @method getRecord"," @param {Number|String|Node} seed Record `id`, `clientId`, index, Node, or"," identifier for a row or child element"," @return {Model}"," @since 3.5.0"," **/"," getRecord: function (seed) {"," var record = this.data.getById(seed) || this.data.getByClientId(seed);",""," if (!record) {"," if (isNumber(seed)) {"," record = this.data.item(seed);"," }"," "," // TODO: this should be split out to base somehow"," if (!record && this.view && this.view.getRecord) {"," record = this.view.getRecord.apply(this.view, arguments);"," }"," }",""," return record || null;"," },",""," // -- Protected and private properties and methods ------------------------",""," /**"," This tells `Y.Base` that it should create ad-hoc attributes for config"," properties passed to DataTable's constructor. This is useful for setting"," configurations on the DataTable that are intended for the rendering View(s).",""," @property _allowAdHocAttrs"," @type Boolean"," @default true"," @protected"," @since 3.6.0"," **/"," _allowAdHocAttrs: true,",""," /**"," A map of column key to column configuration objects parsed from the"," `columns` attribute.",""," @property _columnMap"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_columnMap: null,",""," /**"," The Node instance of the table containing the data rows. This is set when"," the table is rendered. It may also be set by progressive enhancement,"," though this extension does not provide the logic to parse from source.",""," @property _tableNode"," @type {Node}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_tableNode: null,",""," /**"," Updates the `_columnMap` property in response to changes in the `columns`"," attribute.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," _afterColumnsChange: function (e) {"," this._setColumnMap(e.newVal);"," },",""," /**"," Updates the `modelList` attributes of the rendered views in response to the"," `data` attribute being assigned a new ModelList.",""," @method _afterDataChange"," @param {EventFacade} e the `dataChange` event"," @protected"," @since 3.5.0"," **/"," _afterDataChange: function (e) {"," var modelList = e.newVal;",""," this.data = e.newVal;",""," if (!this.get('columns') && modelList.size()) {"," // TODO: this will cause a re-render twice because the Views are"," // subscribed to columnsChange"," this._initColumns();"," }"," },",""," /**"," Assigns to the new recordType as the model for the data ModelList",""," @method _afterRecordTypeChange"," @param {EventFacade} e recordTypeChange event"," @protected"," @since 3.6.0"," **/"," _afterRecordTypeChange: function (e) {"," var data = this.data.toJSON();",""," this.data.model = e.newVal;",""," this.data.reset(data);",""," if (!this.get('columns') && data) {"," if (data.length) {"," this._initColumns();"," } else {"," this.set('columns', keys(e.newVal.ATTRS));"," }"," }"," },",""," /**"," Creates a Model subclass from an array of attribute names or an object of"," attribute definitions. This is used to generate a class suitable to"," represent the data passed to the `data` attribute if no `recordType` is"," set.",""," @method _createRecordClass"," @param {String[]|Object} attrs Names assigned to the Model subclass's"," `ATTRS` or its entire `ATTRS` definition object"," @return {Model}"," @protected"," @since 3.5.0"," **/"," _createRecordClass: function (attrs) {"," var ATTRS, i, len;",""," if (isArray(attrs)) {"," ATTRS = {};",""," for (i = 0, len = attrs.length; i < len; ++i) {"," ATTRS[attrs[i]] = {};"," }"," } else if (isObject(attrs)) {"," ATTRS = attrs;"," }",""," return Y.Base.create('record', Y.Model, [], null, { ATTRS: ATTRS });"," },",""," /**"," Tears down the instance.",""," @method destructor"," @protected"," @since 3.6.0"," **/"," destructor: function () {"," new Y.EventHandle(Y.Object.values(this._eventHandles)).detach();"," },",""," /**"," The getter for the `columns` attribute. Returns the array of column"," configuration objects if `instance.get('columns')` is called, or the"," specific column object if `instance.get('columns.columnKey')` is called.",""," @method _getColumns"," @param {Object[]} columns The full array of column objects"," @param {String} name The attribute name requested"," (e.g. 'columns' or 'columns.foo');"," @protected"," @since 3.5.0"," **/"," _getColumns: function (columns, name) {"," // Workaround for an attribute oddity (ticket #2529254)"," // getter is expected to return an object if get('columns.foo') is called."," // Note 'columns.' is 8 characters"," return name.length > 8 ? this._columnMap : columns;"," },",""," /**"," Relays the `get()` request for the deprecated `columnset` attribute to the"," `columns` attribute.",""," THIS BREAKS BACKWARD COMPATIBILITY. 3.4.1 and prior implementations will"," expect a Columnset instance returned from `get('columnset')`.",""," @method _getColumnset"," @param {Object} ignored The current value stored in the `columnset` state"," @param {String} name The attribute name requested"," (e.g. 'columnset' or 'columnset.foo');"," @deprecated This will be removed with the `columnset` attribute in a future"," version."," @protected"," @since 3.5.0"," **/"," _getColumnset: function (_, name) {"," return this.get(name.replace(/^columnset/, 'columns'));"," },",""," /**"," Returns the Model class of the instance's `data` attribute ModelList. If"," not set, returns the explicitly configured value.",""," @method _getRecordType"," @param {Model} val The currently configured value"," @return {Model}"," **/"," _getRecordType: function (val) {"," // Prefer the value stored in the attribute because the attribute"," // change event defaultFn sets e.newVal = this.get('recordType')"," // before notifying the after() subs. But if this getter returns"," // this.data.model, then after() subs would get e.newVal === previous"," // model before _afterRecordTypeChange can set"," // this.data.model = e.newVal"," return val || (this.data && this.data.model);"," },",""," /**"," Initializes the `_columnMap` property from the configured `columns`"," attribute. If `columns` is not set, but there are records in the `data`"," ModelList, use"," `ATTRS` of that class.",""," @method _initColumns"," @protected"," @since 3.5.0"," **/"," _initColumns: function () {"," var columns = this.get('columns') || [],"," item;"," "," // Default column definition from the configured recordType"," if (!columns.length && this.data.size()) {"," // TODO: merge superclass attributes up to Model?"," item = this.data.item(0);",""," if (item.toJSON) {"," item = item.toJSON();"," }",""," this.set('columns', keys(item));"," }",""," this._setColumnMap(columns);"," },",""," /**"," Sets up the change event subscriptions to maintain internal state.",""," @method _initCoreEvents"," @protected"," @since 3.6.0"," **/"," _initCoreEvents: function () {"," this._eventHandles.coreAttrChanges = this.after({"," columnsChange : Y.bind('_afterColumnsChange', this),"," recordTypeChange: Y.bind('_afterRecordTypeChange', this),"," dataChange : Y.bind('_afterDataChange', this)"," });"," },",""," /**"," Defaults the `data` attribute to an empty ModelList if not set during"," construction. Uses the configured `recordType` for the ModelList's `model`"," proeprty if set.",""," @method _initData"," @protected"," @return {ModelList}"," @since 3.6.0"," **/"," _initData: function () {"," var recordType = this.get('recordType'),"," // TODO: LazyModelList if recordType doesn't have complex ATTRS"," modelList = new Y.ModelList();",""," if (recordType) {"," modelList.model = recordType;"," }",""," return modelList;"," },",""," /**"," Initializes the instance's `data` property from the value of the `data`"," attribute. If the attribute value is a ModelList, it is assigned directly"," to `this.data`. If it is an array, a ModelList is created, its `model`"," property is set to the configured `recordType` class, and it is seeded with"," the array data. This ModelList is then assigned to `this.data`.",""," @method _initDataProperty"," @param {Array|ModelList|ArrayList} data Collection of data to populate the"," DataTable"," @protected"," @since 3.6.0"," **/"," _initDataProperty: function (data) {"," var recordType;",""," if (!this.data) {"," recordType = this.get('recordType');",""," if (data && data.each && data.toJSON) {"," this.data = data;",""," if (recordType) {"," this.data.model = recordType;"," }"," } else {"," // TODO: customize the ModelList or read the ModelList class"," // from a configuration option?"," this.data = new Y.ModelList();"," "," if (recordType) {"," this.data.model = recordType;"," }"," }",""," // TODO: Replace this with an event relay for specific events."," // Using bubbling causes subscription conflicts with the models'"," // aggregated change event and 'change' events from DOM elements"," // inside the table (via Widget UI event)."," this.data.addTarget(this);"," }"," },",""," /**"," Initializes the columns, `recordType` and data ModelList.",""," @method initializer"," @param {Object} config Configuration object passed to constructor"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," var data = config.data,"," columns = config.columns,"," recordType;",""," // Referencing config.data to allow _setData to be more stringent"," // about its behavior"," this._initDataProperty(data);",""," // Default columns from recordType ATTRS if recordType is supplied at"," // construction. If no recordType is supplied, but the data is"," // supplied as a non-empty array, use the keys of the first item"," // as the columns."," if (!columns) {"," recordType = (config.recordType || config.data === this.data) &&"," this.get('recordType');",""," if (recordType) {"," columns = keys(recordType.ATTRS);"," } else if (isArray(data) && data.length) {"," columns = keys(data[0]);"," }",""," if (columns) {"," this.set('columns', columns);"," }"," }",""," this._initColumns();",""," this._eventHandles = {};",""," this._initCoreEvents();"," },",""," /**"," Iterates the array of column configurations to capture all columns with a"," `key` property. An map is built with column keys as the property name and"," the corresponding column object as the associated value. This map is then"," assigned to the instance's `_columnMap` property.",""," @method _setColumnMap"," @param {Object[]|String[]} columns The array of column config objects"," @protected"," @since 3.6.0"," **/"," _setColumnMap: function (columns) {"," var map = {};"," "," function process(cols) {"," var i, len, col, key;",""," for (i = 0, len = cols.length; i < len; ++i) {"," col = cols[i];"," key = col.key;",""," // First in wins for multiple columns with the same key"," // because the first call to genId (in _setColumns) will"," // return the same key, which will then be overwritten by the"," // subsequent same-keyed column. So table.getColumn(key) would"," // return the last same-keyed column."," if (key && !map[key]) {"," map[key] = col;"," }",""," //TODO: named columns can conflict with keyed columns"," map[col._id] = col;",""," if (col.children) {"," process(col.children);"," }"," }"," }",""," process(columns);",""," this._columnMap = map;"," },",""," /**"," Translates string columns into objects with that string as the value of its"," `key` property.",""," All columns are assigned a `_yuid` stamp and `_id` property corresponding"," to the column's configured `name` or `key` property with any spaces"," replaced with dashes. If the same `name` or `key` appears in multiple"," columns, subsequent appearances will have their `_id` appended with an"," incrementing number (e.g. if column \"foo\" is included in the `columns`"," attribute twice, the first will get `_id` of \"foo\", and the second an `_id`"," of \"foo1\"). Columns that are children of other columns will have the"," `_parent` property added, assigned the column object to which they belong.",""," @method _setColumns"," @param {null|Object[]|String[]} val Array of config objects or strings"," @return {null|Object[]}"," @protected"," **/"," _setColumns: function (val) {"," var keys = {},"," known = [],"," knownCopies = [],"," arrayIndex = Y.Array.indexOf;"," "," function copyObj(o) {"," var copy = {},"," key, val, i;",""," known.push(o);"," knownCopies.push(copy);",""," for (key in o) {"," if (o.hasOwnProperty(key)) {"," val = o[key];",""," if (isArray(val)) {"," copy[key] = val.slice();"," } else if (isObject(val, true)) {"," i = arrayIndex(val, known);",""," copy[key] = i === -1 ? copyObj(val) : knownCopies[i];"," } else {"," copy[key] = o[key];"," }"," }"," }",""," return copy;"," }",""," function genId(name) {"," // Sanitize the name for use in generated CSS classes."," // TODO: is there more to do for other uses of _id?"," name = name.replace(/\\s+/, '-');",""," if (keys[name]) {"," name += (keys[name]++);"," } else {"," keys[name] = 1;"," }",""," return name;"," }",""," function process(cols, parent) {"," var columns = [],"," i, len, col, yuid;",""," for (i = 0, len = cols.length; i < len; ++i) {"," columns[i] = // chained assignment"," col = isString(cols[i]) ? { key: cols[i] } : copyObj(cols[i]);",""," yuid = Y.stamp(col);",""," // For backward compatibility"," if (!col.id) {"," // Implementers can shoot themselves in the foot by setting"," // this config property to a non-unique value"," col.id = yuid;"," }"," if (col.field) {"," // Field is now known as \"name\" to avoid confusion with data"," // fields or schema.resultFields"," col.name = col.field;"," }",""," if (parent) {"," col._parent = parent;"," } else {"," delete col._parent;"," }",""," // Unique id based on the column's configured name or key,"," // falling back to the yuid. Duplicates will have a counter"," // added to the end."," col._id = genId(col.name || col.key || col.id);",""," if (isArray(col.children)) {"," col.children = process(col.children, col);"," }"," }",""," return columns;"," }",""," return val && process(val);"," },",""," /**"," Relays attribute assignments of the deprecated `columnset` attribute to the"," `columns` attribute. If a Columnset is object is passed, its basic object"," structure is mined.",""," @method _setColumnset"," @param {Array|Columnset} val The columnset value to relay"," @deprecated This will be removed with the deprecated `columnset` attribute"," in a later version."," @protected"," @since 3.5.0"," **/"," _setColumnset: function (val) {"," this.set('columns', val);",""," return isArray(val) ? val : INVALID;"," },",""," /**"," Accepts an object with `each` and `getAttrs` (preferably a ModelList or"," subclass) or an array of data objects. If an array is passes, it will"," create a ModelList to wrap the data. In doing so, it will set the created"," ModelList's `model` property to the class in the `recordType` attribute,"," which will be defaulted if not yet set.",""," If the `data` property is already set with a ModelList, passing an array as"," the value will call the ModelList's `reset()` method with that array rather"," than replacing the stored ModelList wholesale.",""," Any non-ModelList-ish and non-array value is invalid.",""," @method _setData"," @protected"," @since 3.5.0"," **/"," _setData: function (val) {"," if (val === null) {"," val = [];"," }",""," if (isArray(val)) {"," this._initDataProperty();",""," // silent to prevent subscribers to both reset and dataChange"," // from reacting to the change twice."," // TODO: would it be better to return INVALID to silence the"," // dataChange event, or even allow both events?"," this.data.reset(val, { silent: true });",""," // Return the instance ModelList to avoid storing unprocessed"," // data in the state and their vivified Model representations in"," // the instance's data property. Decreases memory consumption."," val = this.data;"," } else if (!val || !val.each || !val.toJSON) {"," // ModelList/ArrayList duck typing"," val = INVALID;"," }",""," return val;"," },",""," /**"," Relays the value assigned to the deprecated `recordset` attribute to the"," `data` attribute. If a Recordset instance is passed, the raw object data"," will be culled from it.",""," @method _setRecordset"," @param {Object[]|Recordset} val The recordset value to relay"," @deprecated This will be removed with the deprecated `recordset` attribute"," in a later version."," @protected"," @since 3.5.0"," **/"," _setRecordset: function (val) {"," var data;",""," if (val && Y.Recordset && val instanceof Y.Recordset) {"," data = [];"," val.each(function (record) {"," data.push(record.get('data'));"," });"," val = data;"," }",""," this.set('data', val);",""," return val;"," },",""," /**"," Accepts a Base subclass (preferably a Model subclass). Alternately, it will"," generate a custom Model subclass from an array of attribute names or an"," object defining attributes and their respective configurations (it is"," assigned as the `ATTRS` of the new class).",""," Any other value is invalid.",""," @method _setRecordType"," @param {Function|String[]|Object} val The Model subclass, array of"," attribute names, or the `ATTRS` definition for a custom model"," subclass"," @return {Function} A Base/Model subclass"," @protected"," @since 3.5.0"," **/"," _setRecordType: function (val) {"," var modelClass;",""," // Duck type based on known/likely consumed APIs"," if (isFunction(val) && val.prototype.toJSON && val.prototype.setAttrs) {"," modelClass = val;"," } else if (isObject(val)) {"," modelClass = this._createRecordClass(val);"," }",""," return modelClass || INVALID;"," }","","});","","","}, '3.7.2', {\"requires\": [\"escape\", \"model-list\", \"node-event-delegate\"]});"];+_yuitest_coverage["build/datatable-core/datatable-core.js"].code=["YUI.add('datatable-core', function (Y, NAME) {","","/**","The core implementation of the `DataTable` and `DataTable.Base` Widgets.","","@module datatable","@submodule datatable-core","@since 3.5.0","**/","","var INVALID = Y.Attribute.INVALID_VALUE,",""," Lang = Y.Lang,"," isFunction = Lang.isFunction,"," isObject = Lang.isObject,"," isArray = Lang.isArray,"," isString = Lang.isString,"," isNumber = Lang.isNumber,",""," toArray = Y.Array,",""," keys = Y.Object.keys,",""," Table;"," ","/**","_API docs for this extension are included in the DataTable class._","","Class extension providing the core API and structure for the DataTable Widget.","","Use this class extension with Widget or another Base-based superclass to create","the basic DataTable model API and composing class structure.","","@class DataTable.Core","@for DataTable","@since 3.5.0","**/","Table = Y.namespace('DataTable').Core = function () {};","","Table.ATTRS = {"," /**"," Columns to include in the rendered table."," "," If omitted, the attributes on the configured `recordType` or the first item"," in the `data` collection will be used as a source.",""," This attribute takes an array of strings or objects (mixing the two is"," fine). Each string or object is considered a column to be rendered."," Strings are converted to objects, so `columns: ['first', 'last']` becomes"," `columns: [{ key: 'first' }, { key: 'last' }]`.",""," DataTable.Core only concerns itself with a few properties of columns."," These properties are:",""," * `key` - Used to identify the record field/attribute containing content for"," this column. Also used to create a default Model if no `recordType` or"," `data` are provided during construction. If `name` is not specified, this"," is assigned to the `_id` property (with added incrementer if the key is"," used by multiple columns)."," * `children` - Traversed to initialize nested column objects"," * `name` - Used in place of, or in addition to, the `key`. Useful for"," columns that aren't bound to a field/attribute in the record data. This"," is assigned to the `_id` property."," * `id` - For backward compatibility. Implementers can specify the id of"," the header cell. This should be avoided, if possible, to avoid the"," potential for creating DOM elements with duplicate IDs."," * `field` - For backward compatibility. Implementers should use `name`."," * `_id` - Assigned unique-within-this-instance id for a column. By order"," of preference, assumes the value of `name`, `key`, `id`, or `_yuid`."," This is used by the rendering views as well as feature module"," as a means to identify a specific column without ambiguity (such as"," multiple columns using the same `key`."," * `_yuid` - Guid stamp assigned to the column object."," * `_parent` - Assigned to all child columns, referencing their parent"," column.",""," @attribute columns"," @type {Object[]|String[]}"," @default (from `recordType` ATTRS or first item in the `data`)"," @since 3.5.0"," **/"," columns: {"," // TODO: change to setter to clone input array/objects"," validator: isArray,"," setter: '_setColumns',"," getter: '_getColumns'"," },",""," /**"," Model subclass to use as the `model` for the ModelList stored in the `data`"," attribute.",""," If not provided, it will try really hard to figure out what to use. The"," following attempts will be made to set a default value:"," "," 1. If the `data` attribute is set with a ModelList instance and its `model`"," property is set, that will be used."," 2. If the `data` attribute is set with a ModelList instance, and its"," `model` property is unset, but it is populated, the `ATTRS` of the"," `constructor of the first item will be used."," 3. If the `data` attribute is set with a non-empty array, a Model subclass"," will be generated using the keys of the first item as its `ATTRS` (see"," the `_createRecordClass` method)."," 4. If the `columns` attribute is set, a Model subclass will be generated"," using the columns defined with a `key`. This is least desirable because"," columns can be duplicated or nested in a way that's not parsable."," 5. If neither `data` nor `columns` is set or populated, a change event"," subscriber will listen for the first to be changed and try all over"," again.",""," @attribute recordType"," @type {Function}"," @default (see description)"," @since 3.5.0"," **/"," recordType: {"," getter: '_getRecordType',"," setter: '_setRecordType'"," },",""," /**"," The collection of data records to display. This attribute is a pass"," through to a `data` property, which is a ModelList instance.",""," If this attribute is passed a ModelList or subclass, it will be assigned to"," the property directly. If an array of objects is passed, a new ModelList"," will be created using the configured `recordType` as its `model` property"," and seeded with the array.",""," Retrieving this attribute will return the ModelList stored in the `data`"," property.",""," @attribute data"," @type {ModelList|Object[]}"," @default `new ModelList()`"," @since 3.5.0"," **/"," data: {"," valueFn: '_initData',"," setter : '_setData',"," lazyAdd: false"," },",""," /**"," Content for the `<table summary=\"ATTRIBUTE VALUE HERE\">`. Values assigned"," to this attribute will be HTML escaped for security.",""," @attribute summary"," @type {String}"," @default '' (empty string)"," @since 3.5.0"," **/"," //summary: {},",""," /**"," HTML content of an optional `<caption>` element to appear above the table."," Leave this config unset or set to a falsy value to remove the caption.",""," @attribute caption"," @type HTML"," @default '' (empty string)"," @since 3.5.0"," **/"," //caption: {},",""," /**"," Deprecated as of 3.5.0. Passes through to the `data` attribute.",""," WARNING: `get('recordset')` will NOT return a Recordset instance as of"," 3.5.0. This is a break in backward compatibility.",""," @attribute recordset"," @type {Object[]|Recordset}"," @deprecated Use the `data` attribute"," @since 3.5.0"," **/"," recordset: {"," setter: '_setRecordset',"," getter: '_getRecordset',"," lazyAdd: false"," },",""," /**"," Deprecated as of 3.5.0. Passes through to the `columns` attribute.",""," WARNING: `get('columnset')` will NOT return a Columnset instance as of"," 3.5.0. This is a break in backward compatibility.",""," @attribute columnset"," @type {Object[]}"," @deprecated Use the `columns` attribute"," @since 3.5.0"," **/"," columnset: {"," setter: '_setColumnset',"," getter: '_getColumnset',"," lazyAdd: false"," }","};","","Y.mix(Table.prototype, {"," // -- Instance properties -------------------------------------------------"," /**"," The ModelList that manages the table's data.",""," @property data"," @type {ModelList}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //data: null,",""," // -- Public methods ------------------------------------------------------",""," /**"," Gets the column configuration object for the given key, name, or index. For"," nested columns, `name` can be an array of indexes, each identifying the index"," of that column in the respective parent's \"children\" array.",""," If you pass a column object, it will be returned.",""," For columns with keys, you can also fetch the column with"," `instance.get('columns.foo')`.",""," @method getColumn"," @param {String|Number|Number[]} name Key, \"name\", index, or index array to"," identify the column"," @return {Object} the column configuration object"," @since 3.5.0"," **/"," getColumn: function (name) {"," var col, columns, i, len, cols;",""," if (isObject(name) && !isArray(name)) {"," // TODO: support getting a column from a DOM node - this will cross"," // the line into the View logic, so it should be relayed",""," // Assume an object passed in is already a column def"," col = name;"," } else {"," col = this.get('columns.' + name);"," }",""," if (col) {"," return col;"," }",""," columns = this.get('columns');",""," if (isNumber(name) || isArray(name)) {"," name = toArray(name);"," cols = columns;",""," for (i = 0, len = name.length - 1; cols && i < len; ++i) {"," cols = cols[name[i]] && cols[name[i]].children;"," }",""," return (cols && cols[name[i]]) || null;"," }",""," return null;"," },",""," /**"," Returns the Model associated to the record `id`, `clientId`, or index (not"," row index). If none of those yield a Model from the `data` ModelList, the"," arguments will be passed to the `view` instance's `getRecord` method"," if it has one.",""," If no Model can be found, `null` is returned.",""," @method getRecord"," @param {Number|String|Node} seed Record `id`, `clientId`, index, Node, or"," identifier for a row or child element"," @return {Model}"," @since 3.5.0"," **/"," getRecord: function (seed) {"," var record = this.data.getById(seed) || this.data.getByClientId(seed);",""," if (!record) {"," if (isNumber(seed)) {"," record = this.data.item(seed);"," }"," "," // TODO: this should be split out to base somehow"," if (!record && this.view && this.view.getRecord) {"," record = this.view.getRecord.apply(this.view, arguments);"," }"," }",""," return record || null;"," },",""," // -- Protected and private properties and methods ------------------------",""," /**"," This tells `Y.Base` that it should create ad-hoc attributes for config"," properties passed to DataTable's constructor. This is useful for setting"," configurations on the DataTable that are intended for the rendering View(s).",""," @property _allowAdHocAttrs"," @type Boolean"," @default true"," @protected"," @since 3.6.0"," **/"," _allowAdHocAttrs: true,",""," /**"," A map of column key to column configuration objects parsed from the"," `columns` attribute.",""," @property _columnMap"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_columnMap: null,",""," /**"," The Node instance of the table containing the data rows. This is set when"," the table is rendered. It may also be set by progressive enhancement,"," though this extension does not provide the logic to parse from source.",""," @property _tableNode"," @type {Node}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_tableNode: null,",""," /**"," Updates the `_columnMap` property in response to changes in the `columns`"," attribute.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," _afterColumnsChange: function (e) {"," this._setColumnMap(e.newVal);"," },",""," /**"," Updates the `modelList` attributes of the rendered views in response to the"," `data` attribute being assigned a new ModelList.",""," @method _afterDataChange"," @param {EventFacade} e the `dataChange` event"," @protected"," @since 3.5.0"," **/"," _afterDataChange: function (e) {"," var modelList = e.newVal;",""," this.data = e.newVal;",""," if (!this.get('columns') && modelList.size()) {"," // TODO: this will cause a re-render twice because the Views are"," // subscribed to columnsChange"," this._initColumns();"," }"," },",""," /**"," Assigns to the new recordType as the model for the data ModelList",""," @method _afterRecordTypeChange"," @param {EventFacade} e recordTypeChange event"," @protected"," @since 3.6.0"," **/"," _afterRecordTypeChange: function (e) {"," var data = this.data.toJSON();",""," this.data.model = e.newVal;",""," this.data.reset(data);",""," if (!this.get('columns') && data) {"," if (data.length) {"," this._initColumns();"," } else {"," this.set('columns', keys(e.newVal.ATTRS));"," }"," }"," },",""," /**"," Creates a Model subclass from an array of attribute names or an object of"," attribute definitions. This is used to generate a class suitable to"," represent the data passed to the `data` attribute if no `recordType` is"," set.",""," @method _createRecordClass"," @param {String[]|Object} attrs Names assigned to the Model subclass's"," `ATTRS` or its entire `ATTRS` definition object"," @return {Model}"," @protected"," @since 3.5.0"," **/"," _createRecordClass: function (attrs) {"," var ATTRS, i, len;",""," if (isArray(attrs)) {"," ATTRS = {};",""," for (i = 0, len = attrs.length; i < len; ++i) {"," ATTRS[attrs[i]] = {};"," }"," } else if (isObject(attrs)) {"," ATTRS = attrs;"," }",""," return Y.Base.create('record', Y.Model, [], null, { ATTRS: ATTRS });"," },",""," /**"," Tears down the instance.",""," @method destructor"," @protected"," @since 3.6.0"," **/"," destructor: function () {"," new Y.EventHandle(Y.Object.values(this._eventHandles)).detach();"," },",""," /**"," The getter for the `columns` attribute. Returns the array of column"," configuration objects if `instance.get('columns')` is called, or the"," specific column object if `instance.get('columns.columnKey')` is called.",""," @method _getColumns"," @param {Object[]} columns The full array of column objects"," @param {String} name The attribute name requested"," (e.g. 'columns' or 'columns.foo');"," @protected"," @since 3.5.0"," **/"," _getColumns: function (columns, name) {"," // Workaround for an attribute oddity (ticket #2529254)"," // getter is expected to return an object if get('columns.foo') is called."," // Note 'columns.' is 8 characters"," return name.length > 8 ? this._columnMap : columns;"," },",""," /**"," Relays the `get()` request for the deprecated `columnset` attribute to the"," `columns` attribute.",""," THIS BREAKS BACKWARD COMPATIBILITY. 3.4.1 and prior implementations will"," expect a Columnset instance returned from `get('columnset')`.",""," @method _getColumnset"," @param {Object} ignored The current value stored in the `columnset` state"," @param {String} name The attribute name requested"," (e.g. 'columnset' or 'columnset.foo');"," @deprecated This will be removed with the `columnset` attribute in a future"," version."," @protected"," @since 3.5.0"," **/"," _getColumnset: function (_, name) {"," return this.get(name.replace(/^columnset/, 'columns'));"," },",""," /**"," Returns the Model class of the instance's `data` attribute ModelList. If"," not set, returns the explicitly configured value.",""," @method _getRecordType"," @param {Model} val The currently configured value"," @return {Model}"," **/"," _getRecordType: function (val) {"," // Prefer the value stored in the attribute because the attribute"," // change event defaultFn sets e.newVal = this.get('recordType')"," // before notifying the after() subs. But if this getter returns"," // this.data.model, then after() subs would get e.newVal === previous"," // model before _afterRecordTypeChange can set"," // this.data.model = e.newVal"," return val || (this.data && this.data.model);"," },",""," /**"," Initializes the `_columnMap` property from the configured `columns`"," attribute. If `columns` is not set, but there are records in the `data`"," ModelList, use"," `ATTRS` of that class.",""," @method _initColumns"," @protected"," @since 3.5.0"," **/"," _initColumns: function () {"," var columns = this.get('columns') || [],"," item;"," "," // Default column definition from the configured recordType"," if (!columns.length && this.data.size()) {"," // TODO: merge superclass attributes up to Model?"," item = this.data.item(0);",""," if (item.toJSON) {"," item = item.toJSON();"," }",""," this.set('columns', keys(item));"," }",""," this._setColumnMap(columns);"," },",""," /**"," Sets up the change event subscriptions to maintain internal state.",""," @method _initCoreEvents"," @protected"," @since 3.6.0"," **/"," _initCoreEvents: function () {"," this._eventHandles.coreAttrChanges = this.after({"," columnsChange : Y.bind('_afterColumnsChange', this),"," recordTypeChange: Y.bind('_afterRecordTypeChange', this),"," dataChange : Y.bind('_afterDataChange', this)"," });"," },",""," /**"," Defaults the `data` attribute to an empty ModelList if not set during"," construction. Uses the configured `recordType` for the ModelList's `model`"," proeprty if set.",""," @method _initData"," @protected"," @return {ModelList}"," @since 3.6.0"," **/"," _initData: function () {"," var recordType = this.get('recordType'),"," // TODO: LazyModelList if recordType doesn't have complex ATTRS"," modelList = new Y.ModelList();",""," if (recordType) {"," modelList.model = recordType;"," }",""," return modelList;"," },",""," /**"," Initializes the instance's `data` property from the value of the `data`"," attribute. If the attribute value is a ModelList, it is assigned directly"," to `this.data`. If it is an array, a ModelList is created, its `model`"," property is set to the configured `recordType` class, and it is seeded with"," the array data. This ModelList is then assigned to `this.data`.",""," @method _initDataProperty"," @param {Array|ModelList|ArrayList} data Collection of data to populate the"," DataTable"," @protected"," @since 3.6.0"," **/"," _initDataProperty: function (data) {"," var recordType;",""," if (!this.data) {"," recordType = this.get('recordType');",""," if (data && data.each && data.toJSON) {"," this.data = data;",""," if (recordType) {"," this.data.model = recordType;"," }"," } else {"," // TODO: customize the ModelList or read the ModelList class"," // from a configuration option?"," this.data = new Y.ModelList();"," "," if (recordType) {"," this.data.model = recordType;"," }"," }",""," // TODO: Replace this with an event relay for specific events."," // Using bubbling causes subscription conflicts with the models'"," // aggregated change event and 'change' events from DOM elements"," // inside the table (via Widget UI event)."," this.data.addTarget(this);"," }"," },",""," /**"," Initializes the columns, `recordType` and data ModelList.",""," @method initializer"," @param {Object} config Configuration object passed to constructor"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," var data = config.data,"," columns = config.columns,"," recordType;",""," // Referencing config.data to allow _setData to be more stringent"," // about its behavior"," this._initDataProperty(data);",""," // Default columns from recordType ATTRS if recordType is supplied at"," // construction. If no recordType is supplied, but the data is"," // supplied as a non-empty array, use the keys of the first item"," // as the columns."," if (!columns) {"," recordType = (config.recordType || config.data === this.data) &&"," this.get('recordType');",""," if (recordType) {"," columns = keys(recordType.ATTRS);"," } else if (isArray(data) && data.length) {"," columns = keys(data[0]);"," }",""," if (columns) {"," this.set('columns', columns);"," }"," }",""," this._initColumns();",""," this._eventHandles = {};",""," this._initCoreEvents();"," },",""," /**"," Iterates the array of column configurations to capture all columns with a"," `key` property. An map is built with column keys as the property name and"," the corresponding column object as the associated value. This map is then"," assigned to the instance's `_columnMap` property.",""," @method _setColumnMap"," @param {Object[]|String[]} columns The array of column config objects"," @protected"," @since 3.6.0"," **/"," _setColumnMap: function (columns) {"," var map = {};"," "," function process(cols) {"," var i, len, col, key;",""," for (i = 0, len = cols.length; i < len; ++i) {"," col = cols[i];"," key = col.key;",""," // First in wins for multiple columns with the same key"," // because the first call to genId (in _setColumns) will"," // return the same key, which will then be overwritten by the"," // subsequent same-keyed column. So table.getColumn(key) would"," // return the last same-keyed column."," if (key && !map[key]) {"," map[key] = col;"," }",""," //TODO: named columns can conflict with keyed columns"," map[col._id] = col;",""," if (col.children) {"," process(col.children);"," }"," }"," }",""," process(columns);",""," this._columnMap = map;"," },",""," /**"," Translates string columns into objects with that string as the value of its"," `key` property.",""," All columns are assigned a `_yuid` stamp and `_id` property corresponding"," to the column's configured `name` or `key` property with any spaces"," replaced with dashes. If the same `name` or `key` appears in multiple"," columns, subsequent appearances will have their `_id` appended with an"," incrementing number (e.g. if column \"foo\" is included in the `columns`"," attribute twice, the first will get `_id` of \"foo\", and the second an `_id`"," of \"foo1\"). Columns that are children of other columns will have the"," `_parent` property added, assigned the column object to which they belong.",""," @method _setColumns"," @param {null|Object[]|String[]} val Array of config objects or strings"," @return {null|Object[]}"," @protected"," **/"," _setColumns: function (val) {"," var keys = {},"," known = [],"," knownCopies = [],"," arrayIndex = Y.Array.indexOf;"," "," function copyObj(o) {"," var copy = {},"," key, val, i;",""," known.push(o);"," knownCopies.push(copy);",""," for (key in o) {"," if (o.hasOwnProperty(key)) {"," val = o[key];",""," if (isArray(val)) {"," copy[key] = val.slice();"," } else if (isObject(val, true)) {"," i = arrayIndex(val, known);",""," copy[key] = i === -1 ? copyObj(val) : knownCopies[i];"," } else {"," copy[key] = o[key];"," }"," }"," }",""," return copy;"," }",""," function genId(name) {"," // Sanitize the name for use in generated CSS classes."," // TODO: is there more to do for other uses of _id?"," name = name.replace(/\\s+/, '-');",""," if (keys[name]) {"," name += (keys[name]++);"," } else {"," keys[name] = 1;"," }",""," return name;"," }",""," function process(cols, parent) {"," var columns = [],"," i, len, col, yuid;",""," for (i = 0, len = cols.length; i < len; ++i) {"," columns[i] = // chained assignment"," col = isString(cols[i]) ? { key: cols[i] } : copyObj(cols[i]);",""," yuid = Y.stamp(col);",""," // For backward compatibility"," if (!col.id) {"," // Implementers can shoot themselves in the foot by setting"," // this config property to a non-unique value"," col.id = yuid;"," }"," if (col.field) {"," // Field is now known as \"name\" to avoid confusion with data"," // fields or schema.resultFields"," col.name = col.field;"," }",""," if (parent) {"," col._parent = parent;"," } else {"," delete col._parent;"," }",""," // Unique id based on the column's configured name or key,"," // falling back to the yuid. Duplicates will have a counter"," // added to the end."," col._id = genId(col.name || col.key || col.id);",""," if (isArray(col.children)) {"," col.children = process(col.children, col);"," }"," }",""," return columns;"," }",""," return val && process(val);"," },",""," /**"," Relays attribute assignments of the deprecated `columnset` attribute to the"," `columns` attribute. If a Columnset is object is passed, its basic object"," structure is mined.",""," @method _setColumnset"," @param {Array|Columnset} val The columnset value to relay"," @deprecated This will be removed with the deprecated `columnset` attribute"," in a later version."," @protected"," @since 3.5.0"," **/"," _setColumnset: function (val) {"," this.set('columns', val);",""," return isArray(val) ? val : INVALID;"," },",""," /**"," Accepts an object with `each` and `getAttrs` (preferably a ModelList or"," subclass) or an array of data objects. If an array is passes, it will"," create a ModelList to wrap the data. In doing so, it will set the created"," ModelList's `model` property to the class in the `recordType` attribute,"," which will be defaulted if not yet set.",""," If the `data` property is already set with a ModelList, passing an array as"," the value will call the ModelList's `reset()` method with that array rather"," than replacing the stored ModelList wholesale.",""," Any non-ModelList-ish and non-array value is invalid.",""," @method _setData"," @protected"," @since 3.5.0"," **/"," _setData: function (val) {"," if (val === null) {"," val = [];"," }",""," if (isArray(val)) {"," this._initDataProperty();",""," // silent to prevent subscribers to both reset and dataChange"," // from reacting to the change twice."," // TODO: would it be better to return INVALID to silence the"," // dataChange event, or even allow both events?"," this.data.reset(val, { silent: true });",""," // Return the instance ModelList to avoid storing unprocessed"," // data in the state and their vivified Model representations in"," // the instance's data property. Decreases memory consumption."," val = this.data;"," } else if (!val || !val.each || !val.toJSON) {"," // ModelList/ArrayList duck typing"," val = INVALID;"," }",""," return val;"," },",""," /**"," Relays the value assigned to the deprecated `recordset` attribute to the"," `data` attribute. If a Recordset instance is passed, the raw object data"," will be culled from it.",""," @method _setRecordset"," @param {Object[]|Recordset} val The recordset value to relay"," @deprecated This will be removed with the deprecated `recordset` attribute"," in a later version."," @protected"," @since 3.5.0"," **/"," _setRecordset: function (val) {"," var data;",""," if (val && Y.Recordset && val instanceof Y.Recordset) {"," data = [];"," val.each(function (record) {"," data.push(record.get('data'));"," });"," val = data;"," }",""," this.set('data', val);",""," return val;"," },",""," /**"," Accepts a Base subclass (preferably a Model subclass). Alternately, it will"," generate a custom Model subclass from an array of attribute names or an"," object defining attributes and their respective configurations (it is"," assigned as the `ATTRS` of the new class).",""," Any other value is invalid.",""," @method _setRecordType"," @param {Function|String[]|Object} val The Model subclass, array of"," attribute names, or the `ATTRS` definition for a custom model"," subclass"," @return {Function} A Base/Model subclass"," @protected"," @since 3.5.0"," **/"," _setRecordType: function (val) {"," var modelClass;",""," // Duck type based on known/likely consumed APIs"," if (isFunction(val) && val.prototype.toJSON && val.prototype.setAttrs) {"," modelClass = val;"," } else if (isObject(val)) {"," modelClass = this._createRecordClass(val);"," }",""," return modelClass || INVALID;"," }","","});","","","}, '3.7.3', {\"requires\": [\"escape\", \"model-list\", \"node-event-delegate\"]});"]; _yuitest_coverage["build/datatable-core/datatable-core.js"].lines = {"1":0,"11":0,"38":0,"40":0,"201":0,"232":0,"234":0,"239":0,"241":0,"244":0,"245":0,"248":0,"250":0,"251":0,"252":0,"254":0,"255":0,"258":0,"261":0,"279":0,"281":0,"282":0,"283":0,"287":0,"288":0,"292":0,"345":0,"358":0,"360":0,"362":0,"365":0,"378":0,"380":0,"382":0,"384":0,"385":0,"386":0,"388":0,"407":0,"409":0,"410":0,"412":0,"413":0,"415":0,"416":0,"419":0,"430":0,"449":0,"469":0,"487":0,"501":0,"505":0,"507":0,"509":0,"510":0,"513":0,"516":0,"527":0,"545":0,"549":0,"550":0,"553":0,"570":0,"572":0,"573":0,"575":0,"576":0,"578":0,"579":0,"584":0,"586":0,"587":0,"595":0,"608":0,"614":0,"620":0,"621":0,"624":0,"625":0,"626":0,"627":0,"630":0,"631":0,"635":0,"637":0,"639":0,"654":0,"656":0,"657":0,"659":0,"660":0,"661":0,"668":0,"669":0,"673":0,"675":0,"676":0,"681":0,"683":0,"705":0,"710":0,"711":0,"714":0,"715":0,"717":0,"718":0,"719":0,"721":0,"722":0,"723":0,"724":0,"726":0,"728":0,"733":0,"736":0,"739":0,"741":0,"742":0,"744":0,"747":0,"750":0,"751":0,"754":0,"755":0,"758":0,"761":0,"764":0,"766":0,"769":0,"772":0,"773":0,"775":0,"781":0,"783":0,"784":0,"788":0,"791":0,"807":0,"809":0,"830":0,"831":0,"834":0,"835":0,"841":0,"846":0,"847":0,"849":0,"852":0,"868":0,"870":0,"871":0,"872":0,"873":0,"875":0,"878":0,"880":0,"900":0,"903":0,"904":0,"905":0,"906":0,"909":0}; _yuitest_coverage["build/datatable-core/datatable-core.js"].functions = {"getColumn:231":0,"getRecord:278":0,"_afterColumnsChange:344":0,"_afterDataChange:357":0,"_afterRecordTypeChange:377":0,"_createRecordClass:406":0,"destructor:429":0,"_getColumns:445":0,"_getColumnset:468":0,"_getRecordType:480":0,"_initColumns:500":0,"_initCoreEvents:526":0,"_initData:544":0,"_initDataProperty:569":0,"initializer:607":0,"process:656":0,"_setColumnMap:653":0,"copyObj:710":0,"genId:736":0,"process:750":0,"_setColumns:704":0,"_setColumnset:806":0,"_setData:829":0,"(anonymous 2):872":0,"_setRecordset:867":0,"_setRecordType:899":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-core/datatable-core.js"].coveredLines = 162;@@ -1140,4 +1140,4 @@ }); -}, '3.7.2', {"requires": ["escape", "model-list", "node-event-delegate"]});+}, '3.7.3', {"requires": ["escape", "model-list", "node-event-delegate"]});
bundle/datatable-core/datatable-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -918,4 +918,4 @@ }); -}, '3.7.2', {"requires": ["escape", "model-list", "node-event-delegate"]});+}, '3.7.3', {"requires": ["escape", "model-list", "node-event-delegate"]});
bundle/datatable-core/datatable-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-core",function(e,t){var n=e.Attribute.INVALID_VALUE,r=e.Lang,i=r.isFunction,s=r.isObject,o=r.isArray,u=r.isString,a=r.isNumber,f=e.Array,l=e.Object.keys,c;c=e.namespace("DataTable").Core=function(){},c.ATTRS={columns:{validator:o,setter:"_setColumns",getter:"_getColumns"},recordType:{getter:"_getRecordType",setter:"_setRecordType"},data:{valueFn:"_initData",setter:"_setData",lazyAdd:!1},recordset:{setter:"_setRecordset",getter:"_getRecordset",lazyAdd:!1},columnset:{setter:"_setColumnset",getter:"_getColumnset",lazyAdd:!1}},e.mix(c.prototype,{getColumn:function(e){var t,n,r,i,u;s(e)&&!o(e)?t=e:t=this.get("columns."+e);if(t)return t;n=this.get("columns");if(a(e)||o(e)){e=f(e),u=n;for(r=0,i=e.length-1;u&&r<i;++r)u=u[e[r]]&&u[e[r]].children;return u&&u[e[r]]||null}return null},getRecord:function(e){var t=this.data.getById(e)||this.data.getByClientId(e);return t||(a(e)&&(t=this.data.item(e)),!t&&this.view&&this.view.getRecord&&(t=this.view.getRecord.apply(this.view,arguments))),t||null},_allowAdHocAttrs:!0,_afterColumnsChange:function(e){this._setColumnMap(e.newVal)},_afterDataChange:function(e){var t=e.newVal;this.data=e.newVal,!this.get("columns")&&t.size()&&this._initColumns()},_afterRecordTypeChange:function(e){var t=this.data.toJSON();this.data.model=e.newVal,this.data.reset(t),!this.get("columns")&&t&&(t.length?this._initColumns():this.set("columns",l(e.newVal.ATTRS)))},_createRecordClass:function(t){var n,r,i;if(o(t)){n={};for(r=0,i=t.length;r<i;++r)n[t[r]]={}}else s(t)&&(n=t);return e.Base.create("record",e.Model,[],null,{ATTRS:n})},destructor:function(){(new e.EventHandle(e.Object.values(this._eventHandles))).detach()},_getColumns:function(e,t){return t.length>8?this._columnMap:e},_getColumnset:function(e,t){return this.get(t.replace(/^columnset/,"columns"))},_getRecordType:function(e){return e||this.data&&this.data.model},_initColumns:function(){var e=this.get("columns")||[],t;!e.length&&this.data.size()&&(t=this.data.item(0),t.toJSON&&(t=t.toJSON()),this.set("columns",l(t))),this._setColumnMap(e)},_initCoreEvents:function(){this._eventHandles.coreAttrChanges=this.after({columnsChange:e.bind("_afterColumnsChange",this),recordTypeChange:e.bind("_afterRecordTypeChange",this),dataChange:e.bind("_afterDataChange",this)})},_initData:function(){var t=this.get("recordType"),n=new e.ModelList;return t&&(n.model=t),n},_initDataProperty:function(t){var n;this.data||(n=this.get("recordType"),t&&t.each&&t.toJSON?(this.data=t,n&&(this.data.model=n)):(this.data=new e.ModelList,n&&(this.data.model=n)),this.data.addTarget(this))},initializer:function(e){var t=e.data,n=e.columns,r;this._initDataProperty(t),n||(r=(e.recordType||e.data===this.data)&&this.get("recordType"),r?n=l(r.ATTRS):o(t)&&t.length&&(n=l(t[0])),n&&this.set("columns",n)),this._initColumns(),this._eventHandles={},this._initCoreEvents()},_setColumnMap:function(e){function n(e){var r,i,s,o;for(r=0,i=e.length;r<i;++r)s=e[r],o=s.key,o&&!t[o]&&(t[o]=s),t[s._id]=s,s.children&&n(s.children)}var t={};n(e),this._columnMap=t},_setColumns:function(t){function f(e){var t={},n,u,l;r.push(e),i.push(t);for(n in e)e.hasOwnProperty(n)&&(u=e[n],o(u)?t[n]=u.slice():s(u,!0)?(l=a(u,r),t[n]=l===-1?f(u):i[l]):t[n]=e[n]);return t}function l(e){return e=e.replace(/\s+/,"-"),n[e]?e+=n[e]++:n[e]=1,e}function c(t,n){var r=[],i,s,a,h;for(i=0,s=t.length;i<s;++i)r[i]=a=u(t[i])?{key:t[i]}:f(t[i]),h=e.stamp(a),a.id||(a.id=h),a.field&&(a.name=a.field),n?a._parent=n:delete a._parent,a._id=l(a.name||a.key||a.id),o(a.children)&&(a.children=c(a.children,a));return r}var n={},r=[],i=[],a=e.Array.indexOf;return t&&c(t)},_setColumnset:function(e){return this.set("columns",e),o(e)?e:n},_setData:function(e){e===null&&(e=[]);if(o(e))this._initDataProperty(),this.data.reset(e,{silent:!0}),e=this.data;else if(!e||!e.each||!e.toJSON)e=n;return e},_setRecordset:function(t){var n;return t&&e.Recordset&&t instanceof e.Recordset&&(n=[],t.each(function(e){n.push(e.get("data"))}),t=n),this.set("data",t),t},_setRecordType:function(e){var t;return i(e)&&e.prototype.toJSON&&e.prototype.setAttrs?t=e:s(e)&&(t=this._createRecordClass(e)),t||n}})},"3.7.2",{requires:["escape","model-list","node-event-delegate"]});+YUI.add("datatable-core",function(e,t){var n=e.Attribute.INVALID_VALUE,r=e.Lang,i=r.isFunction,s=r.isObject,o=r.isArray,u=r.isString,a=r.isNumber,f=e.Array,l=e.Object.keys,c;c=e.namespace("DataTable").Core=function(){},c.ATTRS={columns:{validator:o,setter:"_setColumns",getter:"_getColumns"},recordType:{getter:"_getRecordType",setter:"_setRecordType"},data:{valueFn:"_initData",setter:"_setData",lazyAdd:!1},recordset:{setter:"_setRecordset",getter:"_getRecordset",lazyAdd:!1},columnset:{setter:"_setColumnset",getter:"_getColumnset",lazyAdd:!1}},e.mix(c.prototype,{getColumn:function(e){var t,n,r,i,u;s(e)&&!o(e)?t=e:t=this.get("columns."+e);if(t)return t;n=this.get("columns");if(a(e)||o(e)){e=f(e),u=n;for(r=0,i=e.length-1;u&&r<i;++r)u=u[e[r]]&&u[e[r]].children;return u&&u[e[r]]||null}return null},getRecord:function(e){var t=this.data.getById(e)||this.data.getByClientId(e);return t||(a(e)&&(t=this.data.item(e)),!t&&this.view&&this.view.getRecord&&(t=this.view.getRecord.apply(this.view,arguments))),t||null},_allowAdHocAttrs:!0,_afterColumnsChange:function(e){this._setColumnMap(e.newVal)},_afterDataChange:function(e){var t=e.newVal;this.data=e.newVal,!this.get("columns")&&t.size()&&this._initColumns()},_afterRecordTypeChange:function(e){var t=this.data.toJSON();this.data.model=e.newVal,this.data.reset(t),!this.get("columns")&&t&&(t.length?this._initColumns():this.set("columns",l(e.newVal.ATTRS)))},_createRecordClass:function(t){var n,r,i;if(o(t)){n={};for(r=0,i=t.length;r<i;++r)n[t[r]]={}}else s(t)&&(n=t);return e.Base.create("record",e.Model,[],null,{ATTRS:n})},destructor:function(){(new e.EventHandle(e.Object.values(this._eventHandles))).detach()},_getColumns:function(e,t){return t.length>8?this._columnMap:e},_getColumnset:function(e,t){return this.get(t.replace(/^columnset/,"columns"))},_getRecordType:function(e){return e||this.data&&this.data.model},_initColumns:function(){var e=this.get("columns")||[],t;!e.length&&this.data.size()&&(t=this.data.item(0),t.toJSON&&(t=t.toJSON()),this.set("columns",l(t))),this._setColumnMap(e)},_initCoreEvents:function(){this._eventHandles.coreAttrChanges=this.after({columnsChange:e.bind("_afterColumnsChange",this),recordTypeChange:e.bind("_afterRecordTypeChange",this),dataChange:e.bind("_afterDataChange",this)})},_initData:function(){var t=this.get("recordType"),n=new e.ModelList;return t&&(n.model=t),n},_initDataProperty:function(t){var n;this.data||(n=this.get("recordType"),t&&t.each&&t.toJSON?(this.data=t,n&&(this.data.model=n)):(this.data=new e.ModelList,n&&(this.data.model=n)),this.data.addTarget(this))},initializer:function(e){var t=e.data,n=e.columns,r;this._initDataProperty(t),n||(r=(e.recordType||e.data===this.data)&&this.get("recordType"),r?n=l(r.ATTRS):o(t)&&t.length&&(n=l(t[0])),n&&this.set("columns",n)),this._initColumns(),this._eventHandles={},this._initCoreEvents()},_setColumnMap:function(e){function n(e){var r,i,s,o;for(r=0,i=e.length;r<i;++r)s=e[r],o=s.key,o&&!t[o]&&(t[o]=s),t[s._id]=s,s.children&&n(s.children)}var t={};n(e),this._columnMap=t},_setColumns:function(t){function f(e){var t={},n,u,l;r.push(e),i.push(t);for(n in e)e.hasOwnProperty(n)&&(u=e[n],o(u)?t[n]=u.slice():s(u,!0)?(l=a(u,r),t[n]=l===-1?f(u):i[l]):t[n]=e[n]);return t}function l(e){return e=e.replace(/\s+/,"-"),n[e]?e+=n[e]++:n[e]=1,e}function c(t,n){var r=[],i,s,a,h;for(i=0,s=t.length;i<s;++i)r[i]=a=u(t[i])?{key:t[i]}:f(t[i]),h=e.stamp(a),a.id||(a.id=h),a.field&&(a.name=a.field),n?a._parent=n:delete a._parent,a._id=l(a.name||a.key||a.id),o(a.children)&&(a.children=c(a.children,a));return r}var n={},r=[],i=[],a=e.Array.indexOf;return t&&c(t)},_setColumnset:function(e){return this.set("columns",e),o(e)?e:n},_setData:function(e){e===null&&(e=[]);if(o(e))this._initDataProperty(),this.data.reset(e,{silent:!0}),e=this.data;else if(!e||!e.each||!e.toJSON)e=n;return e},_setRecordset:function(t){var n;return t&&e.Recordset&&t instanceof e.Recordset&&(n=[],t.each(function(e){n.push(e.get("data"))}),t=n),this.set("data",t),t},_setRecordType:function(e){var t;return i(e)&&e.prototype.toJSON&&e.prototype.setAttrs?t=e:s(e)&&(t=this._createRecordClass(e)),t||n}})},"3.7.3",{requires:["escape","model-list","node-event-delegate"]});
bundle/datatable-core/datatable-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -918,4 +918,4 @@ }); -}, '3.7.2', {"requires": ["escape", "model-list", "node-event-delegate"]});+}, '3.7.3', {"requires": ["escape", "model-list", "node-event-delegate"]});
bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/datatable-datasource-deprecated/datatable-datasource-deprecated.js", code: [] };-_yuitest_coverage["/build/datatable-datasource-deprecated/datatable-datasource-deprecated.js"].code=["YUI.add('datatable-datasource-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","Plugs DataTable with DataSource integration.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","is designed to work with `datatable-base-deprecated` (effectively the 3.4.1","version of DataTable) and will be removed from the library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-datasource-deprecated","@deprecated","**/","","/*"," * Adds DataSource integration to DataTable."," * @class DataTableDataSource"," * @extends Plugin.Base"," */","function DataTableDataSource() {"," DataTableDataSource.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableDataSource, {"," /*"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"datasource\""," */"," NS: \"datasource\",",""," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableDataSource\""," */"," NAME: \"dataTableDataSource\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute datasource"," * @description Pointer to DataSource instance."," * @type {DataSource}"," */"," datasource: {"," setter: \"_setDataSource\""," },"," "," /*"," * @attribute initialRequest"," * @description Request sent to DataSource immediately upon initialization."," * @type Object"," */"," initialRequest: {"," setter: \"_setInitialRequest\""," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableDataSource, Y.Plugin.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * @method _setDataSource"," * @description Creates new DataSource instance if one is not provided."," * @param ds {Object | Y.DataSource}"," * @return {DataSource}"," * @private"," */"," _setDataSource: function(ds) {"," return ds || new Y.DataSource.Local(ds);"," },",""," /*"," * @method _setInitialRequest"," * @description Sends request to DataSource."," * @param request {Object} DataSource request."," * @private"," */"," _setInitialRequest: function(request) {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," if(!Y.Lang.isUndefined(config.initialRequest)) {"," this.load({request:config.initialRequest});"," }"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DATA"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Load data by calling DataSource's sendRequest() method under the hood."," *"," * @method load"," * @param config {object} Optional configuration parameters:"," *"," * <dl>"," * <dt>request</dt><dd>Pass in a new request, or initialRequest is used.</dd>"," * <dt>callback</dt><dd>Pass in DataSource callback object, or the following default is used:"," * <dl>"," * <dt>success</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>failure</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>scope</dt><dd>datatable</dd>"," * <dt>argument</dt><dd>datatable.getState()</dd>"," * </dl>"," * </dd>"," * <dt>datasource</dt><dd>Pass in a new DataSource instance to override the current DataSource for this transaction.</dd>"," * </dl>"," */"," load: function(config) {"," config = config || {};"," config.request = config.request || this.get(\"initialRequest\");"," config.callback = config.callback || {"," success: Y.bind(this.onDataReturnInitializeTable, this),"," failure: Y.bind(this.onDataReturnInitializeTable, this),"," argument: this.get(\"host\").get(\"state\") //TODO"," };",""," var ds = (config.datasource || this.get(\"datasource\"));"," if(ds) {"," ds.sendRequest(config);"," }"," },",""," /*"," * Callback function passed to DataSource's sendRequest() method populates"," * an entire DataTable with new data, clearing previous data, if any."," *"," * @method onDataReturnInitializeTable"," * @param e {Event.Facade} DataSource Event Facade object."," */"," onDataReturnInitializeTable : function(e) {"," var records = (e.response && e.response.results) || [];",""," this.get(\"host\").get(\"recordset\").set(\"records\", records);"," }","});","","Y.namespace(\"Plugin\").DataTableDataSource = DataTableDataSource;","","","","","","}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});"];+_yuitest_coverage["/build/datatable-datasource-deprecated/datatable-datasource-deprecated.js"].code=["YUI.add('datatable-datasource-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","Plugs DataTable with DataSource integration.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","is designed to work with `datatable-base-deprecated` (effectively the 3.4.1","version of DataTable) and will be removed from the library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-datasource-deprecated","@deprecated","**/","","/*"," * Adds DataSource integration to DataTable."," * @class DataTableDataSource"," * @extends Plugin.Base"," */","function DataTableDataSource() {"," DataTableDataSource.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableDataSource, {"," /*"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"datasource\""," */"," NS: \"datasource\",",""," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableDataSource\""," */"," NAME: \"dataTableDataSource\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute datasource"," * @description Pointer to DataSource instance."," * @type {DataSource}"," */"," datasource: {"," setter: \"_setDataSource\""," },"," "," /*"," * @attribute initialRequest"," * @description Request sent to DataSource immediately upon initialization."," * @type Object"," */"," initialRequest: {"," setter: \"_setInitialRequest\""," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableDataSource, Y.Plugin.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * @method _setDataSource"," * @description Creates new DataSource instance if one is not provided."," * @param ds {Object | Y.DataSource}"," * @return {DataSource}"," * @private"," */"," _setDataSource: function(ds) {"," return ds || new Y.DataSource.Local(ds);"," },",""," /*"," * @method _setInitialRequest"," * @description Sends request to DataSource."," * @param request {Object} DataSource request."," * @private"," */"," _setInitialRequest: function(request) {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," if(!Y.Lang.isUndefined(config.initialRequest)) {"," this.load({request:config.initialRequest});"," }"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DATA"," //"," ////////////////////////////////////////////////////////////////////////////",""," /*"," * Load data by calling DataSource's sendRequest() method under the hood."," *"," * @method load"," * @param config {object} Optional configuration parameters:"," *"," * <dl>"," * <dt>request</dt><dd>Pass in a new request, or initialRequest is used.</dd>"," * <dt>callback</dt><dd>Pass in DataSource callback object, or the following default is used:"," * <dl>"," * <dt>success</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>failure</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>scope</dt><dd>datatable</dd>"," * <dt>argument</dt><dd>datatable.getState()</dd>"," * </dl>"," * </dd>"," * <dt>datasource</dt><dd>Pass in a new DataSource instance to override the current DataSource for this transaction.</dd>"," * </dl>"," */"," load: function(config) {"," config = config || {};"," config.request = config.request || this.get(\"initialRequest\");"," config.callback = config.callback || {"," success: Y.bind(this.onDataReturnInitializeTable, this),"," failure: Y.bind(this.onDataReturnInitializeTable, this),"," argument: this.get(\"host\").get(\"state\") //TODO"," };",""," var ds = (config.datasource || this.get(\"datasource\"));"," if(ds) {"," ds.sendRequest(config);"," }"," },",""," /*"," * Callback function passed to DataSource's sendRequest() method populates"," * an entire DataTable with new data, clearing previous data, if any."," *"," * @method onDataReturnInitializeTable"," * @param e {Event.Facade} DataSource Event Facade object."," */"," onDataReturnInitializeTable : function(e) {"," var records = (e.response && e.response.results) || [];",""," this.get(\"host\").get(\"recordset\").set(\"records\", records);"," }","});","","Y.namespace(\"Plugin\").DataTableDataSource = DataTableDataSource;","","","","","","}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});"]; _yuitest_coverage["/build/datatable-datasource-deprecated/datatable-datasource-deprecated.js"].lines = {"1":0,"30":0,"31":0,"39":0,"94":0,"108":0,"133":0,"134":0,"164":0,"165":0,"166":0,"172":0,"173":0,"174":0,"186":0,"188":0,"192":0}; _yuitest_coverage["/build/datatable-datasource-deprecated/datatable-datasource-deprecated.js"].functions = {"DataTableDataSource:30":0,"_setDataSource:107":0,"initializer:132":0,"load:163":0,"onDataReturnInitializeTable:185":0,"(anonymous 1):1":0}; _yuitest_coverage["/build/datatable-datasource-deprecated/datatable-datasource-deprecated.js"].coveredLines = 17;@@ -257,4 +257,4 @@ -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});
bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -201,4 +201,4 @@ -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});
bundle/datatable-datasource-deprecated/datatable-datasource-deprecated-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-datasource-deprecated",function(b){function a(){a.superclass.constructor.apply(this,arguments);}b.mix(a,{NS:"datasource",NAME:"dataTableDataSource",ATTRS:{datasource:{setter:"_setDataSource"},initialRequest:{setter:"_setInitialRequest"}}});b.extend(a,b.Plugin.Base,{_setDataSource:function(c){return c||new b.DataSource.Local(c);},_setInitialRequest:function(c){},initializer:function(c){if(!b.Lang.isUndefined(c.initialRequest)){this.load({request:c.initialRequest});}},load:function(c){c=c||{};c.request=c.request||this.get("initialRequest");c.callback=c.callback||{success:b.bind(this.onDataReturnInitializeTable,this),failure:b.bind(this.onDataReturnInitializeTable,this),argument:this.get("host").get("state")};var d=(c.datasource||this.get("datasource"));if(d){d.sendRequest(c);}},onDataReturnInitializeTable:function(d){var c=(d.response&&d.response.results)||[];this.get("host").get("recordset").set("records",c);}});b.namespace("Plugin").DataTableDataSource=a;},"3.7.2",{requires:["datatable-base-deprecated","plugin","datasource-local"]});+YUI.add("datatable-datasource-deprecated",function(b){function a(){a.superclass.constructor.apply(this,arguments);}b.mix(a,{NS:"datasource",NAME:"dataTableDataSource",ATTRS:{datasource:{setter:"_setDataSource"},initialRequest:{setter:"_setInitialRequest"}}});b.extend(a,b.Plugin.Base,{_setDataSource:function(c){return c||new b.DataSource.Local(c);},_setInitialRequest:function(c){},initializer:function(c){if(!b.Lang.isUndefined(c.initialRequest)){this.load({request:c.initialRequest});}},load:function(c){c=c||{};c.request=c.request||this.get("initialRequest");c.callback=c.callback||{success:b.bind(this.onDataReturnInitializeTable,this),failure:b.bind(this.onDataReturnInitializeTable,this),argument:this.get("host").get("state")};var d=(c.datasource||this.get("datasource"));if(d){d.sendRequest(c);}},onDataReturnInitializeTable:function(d){var c=(d.response&&d.response.results)||[];this.get("host").get("recordset").set("records",c);}});b.namespace("Plugin").DataTableDataSource=a;},"3.7.3",{requires:["datatable-base-deprecated","plugin","datasource-local"]});
bundle/datatable-datasource-deprecated/datatable-datasource-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -201,4 +201,4 @@ -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','datasource-local']});
bundle/datatable-datasource/datatable-datasource-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-datasource/datatable-datasource.js", code: [] };-_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].code=["YUI.add('datatable-datasource', function (Y, NAME) {","","/**"," * Plugs DataTable with DataSource integration."," *"," * @module datatable"," * @submodule datatable-datasource"," */","","/**"," * Adds DataSource integration to DataTable."," * @class Plugin.DataTableDataSource"," * @extends Plugin.Base"," */","function DataTableDataSource() {"," DataTableDataSource.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableDataSource, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"datasource\""," */"," NS: \"datasource\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableDataSource\""," */"," NAME: \"dataTableDataSource\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /**"," * @attribute datasource"," * @description Pointer to DataSource instance."," * @type {DataSource}"," */"," datasource: {"," setter: \"_setDataSource\""," },"," "," /**"," * @attribute initialRequest"," * @description Request sent to DataSource immediately upon initialization."," * @type Object"," */"," initialRequest: {"," setter: \"_setInitialRequest\""," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableDataSource, Y.Plugin.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * @method _setDataSource"," * @description Creates new DataSource instance if one is not provided."," * @param ds {Object | Y.DataSource}"," * @return {DataSource}"," * @private"," */"," _setDataSource: function(ds) {"," return ds || new Y.DataSource.Local(ds);"," },",""," /**"," * @method _setInitialRequest"," * @description Sends request to DataSource."," * @param request {Object} DataSource request."," * @private"," */"," _setInitialRequest: function(request) {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," if(!Y.Lang.isUndefined(config.initialRequest)) {"," this.load({request:config.initialRequest});"," }"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DATA"," //"," ////////////////////////////////////////////////////////////////////////////",""," /**"," * Load data by calling DataSource's sendRequest() method under the hood."," *"," * @method load"," * @param config {object} Optional configuration parameters:"," *"," * <dl>"," * <dt>request</dt><dd>Pass in a new request, or initialRequest is used.</dd>"," * <dt>callback</dt><dd>Pass in DataSource callback object, or the following default is used:"," * <dl>"," * <dt>success</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>failure</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>scope</dt><dd>datatable</dd>"," * <dt>argument</dt><dd>datatable.getState()</dd>"," * </dl>"," * </dd>"," * <dt>datasource</dt><dd>Pass in a new DataSource instance to override the current DataSource for this transaction.</dd>"," * </dl>"," */"," load: function(config) {"," config = config || {};"," config.request = config.request || this.get(\"initialRequest\");"," config.callback = config.callback || {"," success: Y.bind(this.onDataReturnInitializeTable, this),"," failure: Y.bind(this.onDataReturnInitializeTable, this),"," argument: this.get(\"host\").get(\"state\") //TODO"," };",""," var ds = (config.datasource || this.get(\"datasource\"));"," if(ds) {"," ds.sendRequest(config);"," }"," },",""," /**"," * Callback function passed to DataSource's sendRequest() method populates"," * an entire DataTable with new data, clearing previous data, if any."," *"," * @method onDataReturnInitializeTable"," * @param e {Event.Facade} DataSource Event Facade object."," */"," onDataReturnInitializeTable : function(e) {"," var records = (e.response && e.response.results) || [];",""," this.get(\"host\").set(\"data\", records);"," }","});","","Y.namespace(\"Plugin\").DataTableDataSource = DataTableDataSource;","","","}, '3.7.2', {\"requires\": [\"datatable-base\", \"plugin\", \"datasource-local\"]});"];+_yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].code=["YUI.add('datatable-datasource', function (Y, NAME) {","","/**"," * Plugs DataTable with DataSource integration."," *"," * @module datatable"," * @submodule datatable-datasource"," */","","/**"," * Adds DataSource integration to DataTable."," * @class Plugin.DataTableDataSource"," * @extends Plugin.Base"," */","function DataTableDataSource() {"," DataTableDataSource.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableDataSource, {"," /**"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"datasource\""," */"," NS: \"datasource\",",""," /**"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableDataSource\""," */"," NAME: \"dataTableDataSource\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /**"," * @attribute datasource"," * @description Pointer to DataSource instance."," * @type {DataSource}"," */"," datasource: {"," setter: \"_setDataSource\""," },"," "," /**"," * @attribute initialRequest"," * @description Request sent to DataSource immediately upon initialization."," * @type Object"," */"," initialRequest: {"," setter: \"_setInitialRequest\""," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableDataSource, Y.Plugin.Base, {"," /////////////////////////////////////////////////////////////////////////////"," //"," // ATTRIBUTE HELPERS"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * @method _setDataSource"," * @description Creates new DataSource instance if one is not provided."," * @param ds {Object | Y.DataSource}"," * @return {DataSource}"," * @private"," */"," _setDataSource: function(ds) {"," return ds || new Y.DataSource.Local(ds);"," },",""," /**"," * @method _setInitialRequest"," * @description Sends request to DataSource."," * @param request {Object} DataSource request."," * @private"," */"," _setInitialRequest: function(request) {"," },",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /**"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," if(!Y.Lang.isUndefined(config.initialRequest)) {"," this.load({request:config.initialRequest});"," }"," },",""," ////////////////////////////////////////////////////////////////////////////"," //"," // DATA"," //"," ////////////////////////////////////////////////////////////////////////////",""," /**"," * Load data by calling DataSource's sendRequest() method under the hood."," *"," * @method load"," * @param config {object} Optional configuration parameters:"," *"," * <dl>"," * <dt>request</dt><dd>Pass in a new request, or initialRequest is used.</dd>"," * <dt>callback</dt><dd>Pass in DataSource callback object, or the following default is used:"," * <dl>"," * <dt>success</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>failure</dt><dd>datatable.onDataReturnInitializeTable</dd>"," * <dt>scope</dt><dd>datatable</dd>"," * <dt>argument</dt><dd>datatable.getState()</dd>"," * </dl>"," * </dd>"," * <dt>datasource</dt><dd>Pass in a new DataSource instance to override the current DataSource for this transaction.</dd>"," * </dl>"," */"," load: function(config) {"," config = config || {};"," config.request = config.request || this.get(\"initialRequest\");"," config.callback = config.callback || {"," success: Y.bind(this.onDataReturnInitializeTable, this),"," failure: Y.bind(this.onDataReturnInitializeTable, this),"," argument: this.get(\"host\").get(\"state\") //TODO"," };",""," var ds = (config.datasource || this.get(\"datasource\"));"," if(ds) {"," ds.sendRequest(config);"," }"," },",""," /**"," * Callback function passed to DataSource's sendRequest() method populates"," * an entire DataTable with new data, clearing previous data, if any."," *"," * @method onDataReturnInitializeTable"," * @param e {Event.Facade} DataSource Event Facade object."," */"," onDataReturnInitializeTable : function(e) {"," var records = (e.response && e.response.results) || [];",""," this.get(\"host\").set(\"data\", records);"," }","});","","Y.namespace(\"Plugin\").DataTableDataSource = DataTableDataSource;","","","}, '3.7.3', {\"requires\": [\"datatable-base\", \"plugin\", \"datasource-local\"]});"]; _yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].lines = {"1":0,"15":0,"16":0,"24":0,"79":0,"93":0,"118":0,"119":0,"149":0,"150":0,"151":0,"157":0,"158":0,"159":0,"171":0,"173":0,"177":0}; _yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].functions = {"DataTableDataSource:15":0,"_setDataSource:92":0,"initializer:117":0,"load:148":0,"onDataReturnInitializeTable:170":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-datasource/datatable-datasource.js"].coveredLines = 17;@@ -239,4 +239,4 @@ Y.namespace("Plugin").DataTableDataSource = DataTableDataSource; -}, '3.7.2', {"requires": ["datatable-base", "plugin", "datasource-local"]});+}, '3.7.3', {"requires": ["datatable-base", "plugin", "datasource-local"]});
bundle/datatable-datasource/datatable-datasource-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -183,4 +183,4 @@ Y.namespace("Plugin").DataTableDataSource = DataTableDataSource; -}, '3.7.2', {"requires": ["datatable-base", "plugin", "datasource-local"]});+}, '3.7.3', {"requires": ["datatable-base", "plugin", "datasource-local"]});
bundle/datatable-datasource/datatable-datasource-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-datasource",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.mix(n,{NS:"datasource",NAME:"dataTableDataSource",ATTRS:{datasource:{setter:"_setDataSource"},initialRequest:{setter:"_setInitialRequest"}}}),e.extend(n,e.Plugin.Base,{_setDataSource:function(t){return t||new e.DataSource.Local(t)},_setInitialRequest:function(e){},initializer:function(t){e.Lang.isUndefined(t.initialRequest)||this.load({request:t.initialRequest})},load:function(t){t=t||{},t.request=t.request||this.get("initialRequest"),t.callback=t.callback||{success:e.bind(this.onDataReturnInitializeTable,this),failure:e.bind(this.onDataReturnInitializeTable,this),argument:this.get("host").get("state")};var n=t.datasource||this.get("datasource");n&&n.sendRequest(t)},onDataReturnInitializeTable:function(e){var t=e.response&&e.response.results||[];this.get("host").set("data",t)}}),e.namespace("Plugin").DataTableDataSource=n},"3.7.2",{requires:["datatable-base","plugin","datasource-local"]});+YUI.add("datatable-datasource",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.mix(n,{NS:"datasource",NAME:"dataTableDataSource",ATTRS:{datasource:{setter:"_setDataSource"},initialRequest:{setter:"_setInitialRequest"}}}),e.extend(n,e.Plugin.Base,{_setDataSource:function(t){return t||new e.DataSource.Local(t)},_setInitialRequest:function(e){},initializer:function(t){e.Lang.isUndefined(t.initialRequest)||this.load({request:t.initialRequest})},load:function(t){t=t||{},t.request=t.request||this.get("initialRequest"),t.callback=t.callback||{success:e.bind(this.onDataReturnInitializeTable,this),failure:e.bind(this.onDataReturnInitializeTable,this),argument:this.get("host").get("state")};var n=t.datasource||this.get("datasource");n&&n.sendRequest(t)},onDataReturnInitializeTable:function(e){var t=e.response&&e.response.results||[];this.get("host").set("data",t)}}),e.namespace("Plugin").DataTableDataSource=n},"3.7.3",{requires:["datatable-base","plugin","datasource-local"]});
bundle/datatable-datasource/datatable-datasource.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -183,4 +183,4 @@ Y.namespace("Plugin").DataTableDataSource = DataTableDataSource; -}, '3.7.2', {"requires": ["datatable-base", "plugin", "datasource-local"]});+}, '3.7.3', {"requires": ["datatable-base", "plugin", "datasource-local"]});
bundle/datatable-head/datatable-head-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-head/datatable-head.js", code: [] };-_yuitest_coverage["build/datatable-head/datatable-head.js"].code=["YUI.add('datatable-head', function (Y, NAME) {","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-head","@since 3.5.0","**/","var Lang = Y.Lang,"," fromTemplate = Lang.sub,"," isArray = Lang.isArray,"," toArray = Y.Array;","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","Translates the provided array of column configuration objects into a rendered","`<thead>` based on the data in those objects."," ","","The structure of the column data is expected to be a single array of objects,","where each object corresponds to a `<th>`. Those objects may contain a","`children` property containing a similarly structured array to indicate the","nested cells should be grouped under the parent column's colspan in a separate","row of header cells. E.g.","","<pre><code>","new Y.DataTable.HeaderView({"," container: tableNode,"," columns: ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]","}).render();","</code></pre>","","This would translate to the following visualization:","","<pre>","---------------------","| | name |","| |---------------","| id | First | Last |","---------------------","</pre>","","Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this"," column only."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `className` - Adds this string of CSS classes to the column header","","Through the life of instantiation and rendering, the column objects will have","the following properties added to them:",""," * `id` - (Defaulted by DataTable) The id to assign the rendered column"," * `_colspan` - To supply the `<th>` attribute"," * `_rowspan` - To supply the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column","","The column object is also used to provide values for {placeholder} tokens in the","instance's `CELL_TEMPLATE`, so you can modify the template and include other","column object properties to populate them.","","@class HeaderView","@namespace DataTable","@extends View","@since 3.5.0","**/","Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {"," // -- Instance properties -------------------------------------------------",""," /**"," Template used to create the table's header cell markup. Override this to"," customize how header cell markup is created.",""," @property CELL_TEMPLATE"," @type {HTML}"," @default '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}>{content}</th>'"," @since 3.5.0"," **/"," CELL_TEMPLATE:"," '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}>{content}</th>',",""," /**"," The data representation of the header rows to render. This is assigned by"," parsing the `columns` configuration array, and is used by the render()"," method.",""," @property columns"," @type {Array[]}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //columns: null,",""," /**"," Template used to create the table's header row markup. Override this to"," customize the row markup.",""," @property ROW_TEMPLATE"," @type {HTML}"," @default '<tr>{content}</tr>'"," @since 3.5.0"," **/"," ROW_TEMPLATE:"," '<tr>{content}</tr>',",""," /**"," The object that serves as the source of truth for column and row data."," This property is assigned at instantiation from the `source` property of"," the configuration object passed to the constructor.",""," @property source"," @type {Object}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //source: null,",""," /**"," HTML templates used to create the `<thead>` containing the table headers.",""," @property THEAD_TEMPLATE"," @type {HTML}"," @default '<thead class=\"{className}\">{content}</thead>'"," @since 3.6.0"," **/"," THEAD_TEMPLATE: '<thead class=\"{className}\"></thead>',",""," // -- Public methods ------------------------------------------------------",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," **/"," getClassName: function () {"," // TODO: add attribute with setter? to host to use property this.host"," // for performance"," var host = this.host,"," NAME = (host && host.constructor.NAME) ||"," this.constructor.NAME;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager,"," [NAME].concat(toArray(arguments, 0, true)));"," }"," },",""," /**"," Creates the `<thead>` Node content by assembling markup generated by"," populating the `ROW_TEMPLATE` and `CELL_TEMPLATE` templates with content"," from the `columns` property."," "," @method render"," @return {HeaderView} The instance"," @chainable"," @since 3.5.0"," **/"," render: function () {"," var table = this.get('container'),"," thead = this.theadNode ||"," (this.theadNode = this._createTHeadNode()),"," columns = this.columns,"," defaults = {"," _colspan: 1,"," _rowspan: 1,"," abbr: ''"," },"," i, len, j, jlen, col, html, content, values;",""," if (thead && columns) {"," html = '';",""," if (columns.length) {"," for (i = 0, len = columns.length; i < len; ++i) {"," content = '';",""," for (j = 0, jlen = columns[i].length; j < jlen; ++j) {"," col = columns[i][j];"," values = Y.merge("," defaults,"," col, {"," className: this.getClassName('header'),"," content : col.label || col.key ||"," (\"Column \" + (j + 1))"," }"," );",""," values._id = col._id ?"," ' data-yui3-col-id=\"' + col._id + '\"' : '';"," "," if (col.abbr) {"," values.abbr = ' abbr=\"' + col.abbr + '\"';"," }",""," if (col.className) {"," values.className += ' ' + col.className;"," }",""," if (col._first) {"," values.className += ' ' + this.getClassName('first', 'header');"," }",""," if (col._id) {"," values.className +="," ' ' + this.getClassName('col', col._id);"," }",""," content += fromTemplate("," col.headerTemplate || this.CELL_TEMPLATE, values);"," }",""," html += fromTemplate(this.ROW_TEMPLATE, {"," content: content"," });"," }"," }",""," thead.setHTML(html);",""," if (thead.get('parentNode') !== table) {"," table.insertBefore(thead, table.one('tfoot, tbody'));"," }"," }",""," this.bindUI();",""," return this;"," },",""," // -- Protected and private properties and methods ------------------------",""," /**"," Handles changes in the source's columns attribute. Redraws the headers.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," _afterColumnsChange: function (e) {"," this.columns = this._parseColumns(e.newVal);",""," this.render();"," },",""," /**"," Binds event subscriptions from the UI and the source (if assigned).",""," @method bindUI"," @protected"," @since 3.5.0"," **/"," bindUI: function () {"," if (!this._eventHandles.columnsChange) {"," // TODO: How best to decouple this?"," this._eventHandles.columnsChange ="," this.after('columnsChange',"," Y.bind('_afterColumnsChange', this));"," }"," },",""," /**"," Creates the `<thead>` node that will store the header rows and cells.",""," @method _createTHeadNode"," @return {Node}"," @protected"," @since 3.6.0"," **/"," _createTHeadNode: function () {"," return Y.Node.create(fromTemplate(this.THEAD_TEMPLATE, {"," className: this.getClassName('columns')"," }));"," },"," "," /**"," Destroys the instance.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," (new Y.EventHandle(Y.Object.values(this._eventHandles))).detach();"," },",""," /**"," Holds the event subscriptions needing to be detached when the instance is"," `destroy()`ed.",""," @property _eventHandles"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_eventHandles: null,",""," /**"," Initializes the instance. Reads the following configuration properties:",""," * `columns` - (REQUIRED) The initial column information"," * `host` - The object to serve as source of truth for column info",""," @method initializer"," @param {Object} config Configuration data"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.host = config.host;"," this.columns = this._parseColumns(config.columns);",""," this._eventHandles = [];"," },",""," /**"," Translate the input column format into a structure useful for rendering a"," `<thead>`, rows, and cells. The structure of the input is expected to be a"," single array of objects, where each object corresponds to a `<th>`. Those"," objects may contain a `children` property containing a similarly structured"," array to indicate the nested cells should be grouped under the parent"," column's colspan in a separate row of header cells. E.g.",""," <pre><code>"," ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]"," </code></pre>",""," would indicate two header rows with the first column 'id' being assigned a"," `rowspan` of `2`, the 'name' column appearing in the first row with a"," `colspan` of `2`, and the 'firstName' and 'lastName' columns appearing in"," the second row, below the 'name' column.",""," <pre>"," ---------------------"," | | name |"," | |---------------"," | id | First | Last |"," ---------------------"," </pre>",""," Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells"," in this column only.",""," The output structure is basically a simulation of the `<thead>` structure"," with arrays for rows and objects for cells. Column objects have the"," following properties added to them:"," "," * `id` - (Defaulted by DataTable) The id to assign the rendered"," column"," * `_colspan` - Per the `<th>` attribute"," * `_rowspan` - Per the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column",""," The column object is also used to provide values for {placeholder}"," replacement in the `CELL_TEMPLATE`, so you can modify the template and"," include other column object properties to populate them.",""," @method _parseColumns"," @param {Object[]} data Array of column object data"," @return {Array[]} An array of arrays corresponding to the header row"," structure to render"," @protected"," @since 3.5.0"," **/"," _parseColumns: function (data) {"," var columns = [],"," stack = [],"," rowSpan = 1,"," entry, row, col, children, parent, i, len, j;"," "," if (isArray(data) && data.length) {"," // don't modify the input array"," data = data.slice();",""," // First pass, assign colspans and calculate row count for"," // non-nested headers' rowspan"," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," row[i] = col = Y.merge(row[i]);"," children = col.children;",""," Y.stamp(col);",""," if (!col.id) {"," col.id = Y.guid();"," }",""," if (isArray(children) && children.length) {"," stack.push([children, -1]);"," entry[1] = i;",""," rowSpan = Math.max(rowSpan, stack.length);",""," // break to let the while loop process the children"," break;"," } else {"," col._colspan = 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," if (stack.length > 1) {"," entry = stack[stack.length - 2];"," parent = entry[0][entry[1]];",""," parent._colspan = 0;",""," for (i = 0, len = row.length; i < len; ++i) {"," // Can't use .length because in 3+ rows, colspan"," // needs to aggregate the colspans of children"," row[i]._parent = parent;"," parent._colspan += row[i]._colspan;"," }"," }"," stack.pop();"," }"," }",""," // Second pass, build row arrays and assign rowspan"," for (i = 0; i < rowSpan; ++i) {"," columns.push([]);"," }",""," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," col = row[i];"," children = col.children;",""," columns[stack.length - 1].push(col);",""," entry[1] = i;",""," // collect the IDs of parent cols"," col._headers = [col.id];",""," for (j = stack.length - 2; j >= 0; --j) {"," parent = stack[j][0][stack[j][1]];",""," col._headers.unshift(parent.id);"," }",""," if (children && children.length) {"," // parent cells must assume rowspan 1 (long story)",""," // break to let the while loop process the children"," stack.push([children, -1]);"," break;"," } else {"," col._rowspan = rowSpan - stack.length + 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," stack.pop();"," }"," }"," }",""," for (i = 0, len = columns.length; i < len; i += col._rowspan) {"," col = columns[i][0];",""," col._first = true;"," }",""," return columns;"," }","});","","","}, '3.7.2', {\"requires\": [\"datatable-core\", \"view\", \"classnamemanager\"]});"];+_yuitest_coverage["build/datatable-head/datatable-head.js"].code=["YUI.add('datatable-head', function (Y, NAME) {","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-head","@since 3.5.0","**/","var Lang = Y.Lang,"," fromTemplate = Lang.sub,"," isArray = Lang.isArray,"," toArray = Y.Array;","","/**","View class responsible for rendering the `<thead>` section of a table. Used as","the default `headerView` for `Y.DataTable.Base` and `Y.DataTable` classes.","","Translates the provided array of column configuration objects into a rendered","`<thead>` based on the data in those objects."," ","","The structure of the column data is expected to be a single array of objects,","where each object corresponds to a `<th>`. Those objects may contain a","`children` property containing a similarly structured array to indicate the","nested cells should be grouped under the parent column's colspan in a separate","row of header cells. E.g.","","<pre><code>","new Y.DataTable.HeaderView({"," container: tableNode,"," columns: ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]","}).render();","</code></pre>","","This would translate to the following visualization:","","<pre>","---------------------","| | name |","| |---------------","| id | First | Last |","---------------------","</pre>","","Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells in this"," column only."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `className` - Adds this string of CSS classes to the column header","","Through the life of instantiation and rendering, the column objects will have","the following properties added to them:",""," * `id` - (Defaulted by DataTable) The id to assign the rendered column"," * `_colspan` - To supply the `<th>` attribute"," * `_rowspan` - To supply the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column","","The column object is also used to provide values for {placeholder} tokens in the","instance's `CELL_TEMPLATE`, so you can modify the template and include other","column object properties to populate them.","","@class HeaderView","@namespace DataTable","@extends View","@since 3.5.0","**/","Y.namespace('DataTable').HeaderView = Y.Base.create('tableHeader', Y.View, [], {"," // -- Instance properties -------------------------------------------------",""," /**"," Template used to create the table's header cell markup. Override this to"," customize how header cell markup is created.",""," @property CELL_TEMPLATE"," @type {HTML}"," @default '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}>{content}</th>'"," @since 3.5.0"," **/"," CELL_TEMPLATE:"," '<th id=\"{id}\" colspan=\"{_colspan}\" rowspan=\"{_rowspan}\" class=\"{className}\" scope=\"col\" {_id}{abbr}>{content}</th>',",""," /**"," The data representation of the header rows to render. This is assigned by"," parsing the `columns` configuration array, and is used by the render()"," method.",""," @property columns"," @type {Array[]}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //columns: null,",""," /**"," Template used to create the table's header row markup. Override this to"," customize the row markup.",""," @property ROW_TEMPLATE"," @type {HTML}"," @default '<tr>{content}</tr>'"," @since 3.5.0"," **/"," ROW_TEMPLATE:"," '<tr>{content}</tr>',",""," /**"," The object that serves as the source of truth for column and row data."," This property is assigned at instantiation from the `source` property of"," the configuration object passed to the constructor.",""," @property source"," @type {Object}"," @default (initially unset)"," @since 3.5.0"," **/"," //TODO: should this be protected?"," //source: null,",""," /**"," HTML templates used to create the `<thead>` containing the table headers.",""," @property THEAD_TEMPLATE"," @type {HTML}"," @default '<thead class=\"{className}\">{content}</thead>'"," @since 3.6.0"," **/"," THEAD_TEMPLATE: '<thead class=\"{className}\"></thead>',",""," // -- Public methods ------------------------------------------------------",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," **/"," getClassName: function () {"," // TODO: add attribute with setter? to host to use property this.host"," // for performance"," var host = this.host,"," NAME = (host && host.constructor.NAME) ||"," this.constructor.NAME;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager,"," [NAME].concat(toArray(arguments, 0, true)));"," }"," },",""," /**"," Creates the `<thead>` Node content by assembling markup generated by"," populating the `ROW_TEMPLATE` and `CELL_TEMPLATE` templates with content"," from the `columns` property."," "," @method render"," @return {HeaderView} The instance"," @chainable"," @since 3.5.0"," **/"," render: function () {"," var table = this.get('container'),"," thead = this.theadNode ||"," (this.theadNode = this._createTHeadNode()),"," columns = this.columns,"," defaults = {"," _colspan: 1,"," _rowspan: 1,"," abbr: ''"," },"," i, len, j, jlen, col, html, content, values;",""," if (thead && columns) {"," html = '';",""," if (columns.length) {"," for (i = 0, len = columns.length; i < len; ++i) {"," content = '';",""," for (j = 0, jlen = columns[i].length; j < jlen; ++j) {"," col = columns[i][j];"," values = Y.merge("," defaults,"," col, {"," className: this.getClassName('header'),"," content : col.label || col.key ||"," (\"Column \" + (j + 1))"," }"," );",""," values._id = col._id ?"," ' data-yui3-col-id=\"' + col._id + '\"' : '';"," "," if (col.abbr) {"," values.abbr = ' abbr=\"' + col.abbr + '\"';"," }",""," if (col.className) {"," values.className += ' ' + col.className;"," }",""," if (col._first) {"," values.className += ' ' + this.getClassName('first', 'header');"," }",""," if (col._id) {"," values.className +="," ' ' + this.getClassName('col', col._id);"," }",""," content += fromTemplate("," col.headerTemplate || this.CELL_TEMPLATE, values);"," }",""," html += fromTemplate(this.ROW_TEMPLATE, {"," content: content"," });"," }"," }",""," thead.setHTML(html);",""," if (thead.get('parentNode') !== table) {"," table.insertBefore(thead, table.one('tfoot, tbody'));"," }"," }",""," this.bindUI();",""," return this;"," },",""," // -- Protected and private properties and methods ------------------------",""," /**"," Handles changes in the source's columns attribute. Redraws the headers.",""," @method _afterColumnsChange"," @param {EventFacade} e The `columnsChange` event object"," @protected"," @since 3.5.0"," **/"," _afterColumnsChange: function (e) {"," this.columns = this._parseColumns(e.newVal);",""," this.render();"," },",""," /**"," Binds event subscriptions from the UI and the source (if assigned).",""," @method bindUI"," @protected"," @since 3.5.0"," **/"," bindUI: function () {"," if (!this._eventHandles.columnsChange) {"," // TODO: How best to decouple this?"," this._eventHandles.columnsChange ="," this.after('columnsChange',"," Y.bind('_afterColumnsChange', this));"," }"," },",""," /**"," Creates the `<thead>` node that will store the header rows and cells.",""," @method _createTHeadNode"," @return {Node}"," @protected"," @since 3.6.0"," **/"," _createTHeadNode: function () {"," return Y.Node.create(fromTemplate(this.THEAD_TEMPLATE, {"," className: this.getClassName('columns')"," }));"," },"," "," /**"," Destroys the instance.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," (new Y.EventHandle(Y.Object.values(this._eventHandles))).detach();"," },",""," /**"," Holds the event subscriptions needing to be detached when the instance is"," `destroy()`ed.",""," @property _eventHandles"," @type {Object}"," @default undefined (initially unset)"," @protected"," @since 3.5.0"," **/"," //_eventHandles: null,",""," /**"," Initializes the instance. Reads the following configuration properties:",""," * `columns` - (REQUIRED) The initial column information"," * `host` - The object to serve as source of truth for column info",""," @method initializer"," @param {Object} config Configuration data"," @protected"," @since 3.5.0"," **/"," initializer: function (config) {"," this.host = config.host;"," this.columns = this._parseColumns(config.columns);",""," this._eventHandles = [];"," },",""," /**"," Translate the input column format into a structure useful for rendering a"," `<thead>`, rows, and cells. The structure of the input is expected to be a"," single array of objects, where each object corresponds to a `<th>`. Those"," objects may contain a `children` property containing a similarly structured"," array to indicate the nested cells should be grouped under the parent"," column's colspan in a separate row of header cells. E.g.",""," <pre><code>"," ["," { key: 'id' }, // no nesting"," { key: 'name', children: ["," { key: 'firstName', label: 'First' },"," { key: 'lastName', label: 'Last' } ] }"," ]"," </code></pre>",""," would indicate two header rows with the first column 'id' being assigned a"," `rowspan` of `2`, the 'name' column appearing in the first row with a"," `colspan` of `2`, and the 'firstName' and 'lastName' columns appearing in"," the second row, below the 'name' column.",""," <pre>"," ---------------------"," | | name |"," | |---------------"," | id | First | Last |"," ---------------------"," </pre>",""," Supported properties of the column objects include:",""," * `label` - The HTML content of the header cell."," * `key` - If `label` is not specified, the `key` is used for content."," * `children` - Array of columns to appear below this column in the next"," row."," * `abbr` - The content of the 'abbr' attribute of the `<th>`"," * `headerTemplate` - Overrides the instance's `CELL_TEMPLATE` for cells"," in this column only.",""," The output structure is basically a simulation of the `<thead>` structure"," with arrays for rows and objects for cells. Column objects have the"," following properties added to them:"," "," * `id` - (Defaulted by DataTable) The id to assign the rendered"," column"," * `_colspan` - Per the `<th>` attribute"," * `_rowspan` - Per the `<th>` attribute"," * `_parent` - (Added by DataTable) If the column is a child of another"," column, this points to its parent column",""," The column object is also used to provide values for {placeholder}"," replacement in the `CELL_TEMPLATE`, so you can modify the template and"," include other column object properties to populate them.",""," @method _parseColumns"," @param {Object[]} data Array of column object data"," @return {Array[]} An array of arrays corresponding to the header row"," structure to render"," @protected"," @since 3.5.0"," **/"," _parseColumns: function (data) {"," var columns = [],"," stack = [],"," rowSpan = 1,"," entry, row, col, children, parent, i, len, j;"," "," if (isArray(data) && data.length) {"," // don't modify the input array"," data = data.slice();",""," // First pass, assign colspans and calculate row count for"," // non-nested headers' rowspan"," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," row[i] = col = Y.merge(row[i]);"," children = col.children;",""," Y.stamp(col);",""," if (!col.id) {"," col.id = Y.guid();"," }",""," if (isArray(children) && children.length) {"," stack.push([children, -1]);"," entry[1] = i;",""," rowSpan = Math.max(rowSpan, stack.length);",""," // break to let the while loop process the children"," break;"," } else {"," col._colspan = 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," if (stack.length > 1) {"," entry = stack[stack.length - 2];"," parent = entry[0][entry[1]];",""," parent._colspan = 0;",""," for (i = 0, len = row.length; i < len; ++i) {"," // Can't use .length because in 3+ rows, colspan"," // needs to aggregate the colspans of children"," row[i]._parent = parent;"," parent._colspan += row[i]._colspan;"," }"," }"," stack.pop();"," }"," }",""," // Second pass, build row arrays and assign rowspan"," for (i = 0; i < rowSpan; ++i) {"," columns.push([]);"," }",""," stack.push([data, -1]);",""," while (stack.length) {"," entry = stack[stack.length - 1];"," row = entry[0];"," i = entry[1] + 1;",""," for (len = row.length; i < len; ++i) {"," col = row[i];"," children = col.children;",""," columns[stack.length - 1].push(col);",""," entry[1] = i;",""," // collect the IDs of parent cols"," col._headers = [col.id];",""," for (j = stack.length - 2; j >= 0; --j) {"," parent = stack[j][0][stack[j][1]];",""," col._headers.unshift(parent.id);"," }",""," if (children && children.length) {"," // parent cells must assume rowspan 1 (long story)",""," // break to let the while loop process the children"," stack.push([children, -1]);"," break;"," } else {"," col._rowspan = rowSpan - stack.length + 1;"," }"," }",""," if (i >= len) {"," // All columns in this row are processed"," stack.pop();"," }"," }"," }",""," for (i = 0, len = columns.length; i < len; i += col._rowspan) {"," col = columns[i][0];",""," col._first = true;"," }",""," return columns;"," }","});","","","}, '3.7.3', {\"requires\": [\"datatable-core\", \"view\", \"classnamemanager\"]});"]; _yuitest_coverage["build/datatable-head/datatable-head.js"].lines = {"1":0,"11":0,"81":0,"163":0,"167":0,"168":0,"170":0,"187":0,"198":0,"199":0,"201":0,"202":0,"203":0,"205":0,"206":0,"207":0,"216":0,"219":0,"220":0,"223":0,"224":0,"227":0,"228":0,"231":0,"232":0,"236":0,"240":0,"246":0,"248":0,"249":0,"253":0,"255":0,"269":0,"271":0,"282":0,"284":0,"299":0,"312":0,"339":0,"340":0,"342":0,"408":0,"413":0,"415":0,"419":0,"421":0,"422":0,"423":0,"424":0,"426":0,"427":0,"428":0,"430":0,"432":0,"433":0,"436":0,"437":0,"438":0,"440":0,"443":0,"445":0,"449":0,"451":0,"452":0,"453":0,"455":0,"457":0,"460":0,"461":0,"464":0,"469":0,"470":0,"473":0,"475":0,"476":0,"477":0,"478":0,"480":0,"481":0,"482":0,"484":0,"486":0,"489":0,"491":0,"492":0,"494":0,"497":0,"501":0,"502":0,"504":0,"508":0,"510":0,"515":0,"516":0,"518":0,"521":0}; _yuitest_coverage["build/datatable-head/datatable-head.js"].functions = {"getClassName:160":0,"render:186":0,"_afterColumnsChange:268":0,"bindUI:281":0,"_createTHeadNode:298":0,"destructor:311":0,"initializer:338":0,"_parseColumns:407":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-head/datatable-head.js"].coveredLines = 96;@@ -667,4 +667,4 @@ }); -}, '3.7.2', {"requires": ["datatable-core", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "view", "classnamemanager"]});
bundle/datatable-head/datatable-head-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -529,4 +529,4 @@ }); -}, '3.7.2', {"requires": ["datatable-core", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "view", "classnamemanager"]});
bundle/datatable-head/datatable-head-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-head",function(e,t){var n=e.Lang,r=n.sub,i=n.isArray,s=e.Array;e.namespace("DataTable").HeaderView=e.Base.create("tableHeader",e.View,[],{CELL_TEMPLATE:'<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>',ROW_TEMPLATE:"<tr>{content}</tr>",THEAD_TEMPLATE:'<thead class="{className}"></thead>',getClassName:function(){var t=this.host,n=t&&t.constructor.NAME||this.constructor.NAME;return t&&t.getClassName?t.getClassName.apply(t,arguments):e.ClassNameManager.getClassName.apply(e.ClassNameManager,[n].concat(s(arguments,0,!0)))},render:function(){var t=this.get("container"),n=this.theadNode||(this.theadNode=this._createTHeadNode()),i=this.columns,s={_colspan:1,_rowspan:1,abbr:""},o,u,a,f,l,c,h,p;if(n&&i){c="";if(i.length)for(o=0,u=i.length;o<u;++o){h="";for(a=0,f=i[o].length;a<f;++a)l=i[o][a],p=e.merge(s,l,{className:this.getClassName("header"),content:l.label||l.key||"Column "+(a+1)}),p._id=l._id?' data-yui3-col-id="'+l._id+'"':"",l.abbr&&(p.abbr=' abbr="'+l.abbr+'"'),l.className&&(p.className+=" "+l.className),l._first&&(p.className+=" "+this.getClassName("first","header")),l._id&&(p.className+=" "+this.getClassName("col",l._id)),h+=r(l.headerTemplate||this.CELL_TEMPLATE,p);c+=r(this.ROW_TEMPLATE,{content:h})}n.setHTML(c),n.get("parentNode")!==t&&t.insertBefore(n,t.one("tfoot, tbody"))}return this.bindUI(),this},_afterColumnsChange:function(e){this.columns=this._parseColumns(e.newVal),this.render()},bindUI:function(){this._eventHandles.columnsChange||(this._eventHandles.columnsChange=this.after("columnsChange",e.bind("_afterColumnsChange",this)))},_createTHeadNode:function(){return e.Node.create(r(this.THEAD_TEMPLATE,{className:this.getClassName("columns")}))},destructor:function(){(new e.EventHandle(e.Object.values(this._eventHandles))).detach()},initializer:function(e){this.host=e.host,this.columns=this._parseColumns(e.columns),this._eventHandles=[]},_parseColumns:function(t){var n=[],r=[],s=1,o,u,a,f,l,c,h,p;if(i(t)&&t.length){t=t.slice(),r.push([t,-1]);while(r.length){o=r[r.length-1],u=o[0],c=o[1]+1;for(h=u.length;c<h;++c){u[c]=a=e.merge(u[c]),f=a.children,e.stamp(a),a.id||(a.id=e.guid());if(i(f)&&f.length){r.push([f,-1]),o[1]=c,s=Math.max(s,r.length);break}a._colspan=1}if(c>=h){if(r.length>1){o=r[r.length-2],l=o[0][o[1]],l._colspan=0;for(c=0,h=u.length;c<h;++c)u[c]._parent=l,l._colspan+=u[c]._colspan}r.pop()}}for(c=0;c<s;++c)n.push([]);r.push([t,-1]);while(r.length){o=r[r.length-1],u=o[0],c=o[1]+1;for(h=u.length;c<h;++c){a=u[c],f=a.children,n[r.length-1].push(a),o[1]=c,a._headers=[a.id];for(p=r.length-2;p>=0;--p)l=r[p][0][r[p][1]],a._headers.unshift(l.id);if(f&&f.length){r.push([f,-1]);break}a._rowspan=s-r.length+1}c>=h&&r.pop()}}for(c=0,h=n.length;c<h;c+=a._rowspan)a=n[c][0],a._first=!0;return n}})},"3.7.2",{requires:["datatable-core","view","classnamemanager"]});+YUI.add("datatable-head",function(e,t){var n=e.Lang,r=n.sub,i=n.isArray,s=e.Array;e.namespace("DataTable").HeaderView=e.Base.create("tableHeader",e.View,[],{CELL_TEMPLATE:'<th id="{id}" colspan="{_colspan}" rowspan="{_rowspan}" class="{className}" scope="col" {_id}{abbr}>{content}</th>',ROW_TEMPLATE:"<tr>{content}</tr>",THEAD_TEMPLATE:'<thead class="{className}"></thead>',getClassName:function(){var t=this.host,n=t&&t.constructor.NAME||this.constructor.NAME;return t&&t.getClassName?t.getClassName.apply(t,arguments):e.ClassNameManager.getClassName.apply(e.ClassNameManager,[n].concat(s(arguments,0,!0)))},render:function(){var t=this.get("container"),n=this.theadNode||(this.theadNode=this._createTHeadNode()),i=this.columns,s={_colspan:1,_rowspan:1,abbr:""},o,u,a,f,l,c,h,p;if(n&&i){c="";if(i.length)for(o=0,u=i.length;o<u;++o){h="";for(a=0,f=i[o].length;a<f;++a)l=i[o][a],p=e.merge(s,l,{className:this.getClassName("header"),content:l.label||l.key||"Column "+(a+1)}),p._id=l._id?' data-yui3-col-id="'+l._id+'"':"",l.abbr&&(p.abbr=' abbr="'+l.abbr+'"'),l.className&&(p.className+=" "+l.className),l._first&&(p.className+=" "+this.getClassName("first","header")),l._id&&(p.className+=" "+this.getClassName("col",l._id)),h+=r(l.headerTemplate||this.CELL_TEMPLATE,p);c+=r(this.ROW_TEMPLATE,{content:h})}n.setHTML(c),n.get("parentNode")!==t&&t.insertBefore(n,t.one("tfoot, tbody"))}return this.bindUI(),this},_afterColumnsChange:function(e){this.columns=this._parseColumns(e.newVal),this.render()},bindUI:function(){this._eventHandles.columnsChange||(this._eventHandles.columnsChange=this.after("columnsChange",e.bind("_afterColumnsChange",this)))},_createTHeadNode:function(){return e.Node.create(r(this.THEAD_TEMPLATE,{className:this.getClassName("columns")}))},destructor:function(){(new e.EventHandle(e.Object.values(this._eventHandles))).detach()},initializer:function(e){this.host=e.host,this.columns=this._parseColumns(e.columns),this._eventHandles=[]},_parseColumns:function(t){var n=[],r=[],s=1,o,u,a,f,l,c,h,p;if(i(t)&&t.length){t=t.slice(),r.push([t,-1]);while(r.length){o=r[r.length-1],u=o[0],c=o[1]+1;for(h=u.length;c<h;++c){u[c]=a=e.merge(u[c]),f=a.children,e.stamp(a),a.id||(a.id=e.guid());if(i(f)&&f.length){r.push([f,-1]),o[1]=c,s=Math.max(s,r.length);break}a._colspan=1}if(c>=h){if(r.length>1){o=r[r.length-2],l=o[0][o[1]],l._colspan=0;for(c=0,h=u.length;c<h;++c)u[c]._parent=l,l._colspan+=u[c]._colspan}r.pop()}}for(c=0;c<s;++c)n.push([]);r.push([t,-1]);while(r.length){o=r[r.length-1],u=o[0],c=o[1]+1;for(h=u.length;c<h;++c){a=u[c],f=a.children,n[r.length-1].push(a),o[1]=c,a._headers=[a.id];for(p=r.length-2;p>=0;--p)l=r[p][0][r[p][1]],a._headers.unshift(l.id);if(f&&f.length){r.push([f,-1]);break}a._rowspan=s-r.length+1}c>=h&&r.pop()}}for(c=0,h=n.length;c<h;c+=a._rowspan)a=n[c][0],a._first=!0;return n}})},"3.7.3",{requires:["datatable-core","view","classnamemanager"]});
bundle/datatable-head/datatable-head.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -529,4 +529,4 @@ }); -}, '3.7.2', {"requires": ["datatable-core", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "view", "classnamemanager"]});
bundle/datatable-message/assets/datatable-message-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-message/assets/skins/night/datatable-message-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-message/assets/skins/night/datatable-message.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-message/assets/skins/sam/datatable-message-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-message/assets/skins/sam/datatable-message.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-message/datatable-message-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-message/datatable-message.js", code: [] };-_yuitest_coverage["build/datatable-message/datatable-message.js"].code=["YUI.add('datatable-message', function (Y, NAME) {","","/**","Adds support for a message container to appear in the table. This can be used","to indicate loading progress, lack of records, or any other communication","needed.","","@module datatable","@submodule datatable-message","@since 3.5.0","**/","var Message;","","/**","_API docs for this extension are included in the DataTable class._","","Adds support for a message container to appear in the table. This can be used","to indicate loading progress, lack of records, or any other communication","needed.","","Features added to `Y.DataTable`, and made available for custom classes at","`Y.DataTable.Message`.","","@class DataTable.Message","@for DataTable","@since 3.5.0","**/","Y.namespace('DataTable').Message = Message = function () {};","","Message.ATTRS = {"," /**"," Enables the display of messages in the table. Setting this to false will"," prevent the message Node from being created and `showMessage` from doing"," anything.",""," @attribute showMessages"," @type {Boolean}"," @default true"," @since 3.5.0"," **/"," showMessages: {"," value: true,"," validator: Y.Lang.isBoolean"," }","};","","Y.mix(Message.prototype, {"," /**"," Template used to generate the node that will be used to report messages.",""," @property MESSAGE_TEMPLATE"," @type {HTML}"," @default <tbody class=\"{className}\"><td class=\"{contentClass}\" colspan=\"{colspan}\"></td></tbody>"," @since 3.5.0"," **/"," MESSAGE_TEMPLATE: '<tbody class=\"{className}\"><tr><td class=\"{contentClass}\" colspan=\"{colspan}\"></td></tr></tbody>',",""," /**"," Hides the message node.",""," @method hideMessage"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," hideMessage: function () {"," this.get('boundingBox').removeClass("," this.getClassName('message', 'visible'));",""," return this;"," },",""," /**"," Display the message node and set its content to `message`. If there is a"," localized `strings` entry for the value of `message`, that string will be"," used.",""," @method showMessage"," @param {String} message The message name or message itself to display"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," showMessage: function (message) {"," var content = this.getString(message) || message;",""," if (!this._messageNode) {"," this._initMessageNode();"," }",""," if (this.get('showMessages')) {"," if (content) {"," this._messageNode.one("," '.' + this.getClassName('message', 'content'))"," .setHTML(content);",""," this.get('boundingBox').addClass("," this.getClassName('message','visible'));"," } else {"," // TODO: is this right?"," // If no message provided, remove the message node."," this.hideMessage();"," }"," }",""," return this;"," },",""," //--------------------------------------------------------------------------"," // Protected methods"," //--------------------------------------------------------------------------"," /**"," Updates the colspan of the `<td>` used to display the messages.",""," @method _afterMessageColumnsChange"," @param {EventFacade} e The columnsChange event"," @protected"," @since 3.5.0"," **/"," _afterMessageColumnsChange: function (e) {"," var contentNode;",""," if (this._messageNode) {"," contentNode = this._messageNode.one("," '.' + this.getClassName('message', 'content'));",""," if (contentNode) {"," // FIXME: This needs to become a class extension plus a view or"," // plugin for the table view."," contentNode.set('colSpan', this._displayColumns.length);"," }"," }"," },",""," /**"," Relays to `_uiSetMessage` to hide or show the message node.",""," @method _afterMessageDataChange"," @param {EventFacade} e The dataChange event"," @protected"," @since 3.5.0"," **/"," _afterMessageDataChange: function (e) {"," this._uiSetMessage();"," },",""," /**"," Removes the message node if `showMessages` is `false`, or relays to"," `_uiSetMessage` if `true`.",""," @method _afterShowMessagesChange"," @param {EventFacade} e The showMessagesChange event"," @protected"," @since 3.5.0"," **/"," _afterShowMessagesChange: function (e) {"," if (e.newVal) {"," this._uiSetMessage(e);"," } else if (this._messageNode) {"," this.get('boundingBox').removeClass("," this.getClassName('message', 'visible'));",""," this._messageNode.remove().destroy(true);"," this._messageNode = null;"," }"," },",""," /**"," Binds the events necessary to keep the message node in sync with the current"," table and configuration state.",""," @method _bindMessageUI"," @protected"," @since 3.5.0"," **/"," _bindMessageUI: function () {"," this.after(['dataChange', '*:add', '*:remove', '*:reset'],"," Y.bind('_afterMessageDataChange', this));",""," this.after('columnsChange', Y.bind('_afterMessageColumnsChange', this));",""," this.after('showMessagesChange',"," Y.bind('_afterShowMessagesChange', this));"," },",""," /**"," Merges in the message related strings and hooks into the rendering cycle to"," also render and bind the message node.",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this._initMessageStrings();",""," if (this.get('showMessages')) {"," this.after('renderBody', Y.bind('_initMessageNode', this));"," }",""," this.after(Y.bind('_bindMessageUI', this), this, 'bindUI');"," this.after(Y.bind('_syncMessageUI', this), this, 'syncUI');"," },",""," /**"," Creates the `_messageNode` property from the configured `MESSAGE_TEMPLATE`"," and inserts it before the `<table>`'s `<tbody>` node.",""," @method _initMessageNode"," @protected"," @since 3.5.0"," **/"," _initMessageNode: function () {"," if (!this._messageNode) {"," this._messageNode = Y.Node.create("," Y.Lang.sub(this.MESSAGE_TEMPLATE, {"," className: this.getClassName('message'),"," contentClass: this.getClassName('message', 'content'),"," colspan: this._displayColumns.length || 1"," }));",""," this._tableNode.insertBefore(this._messageNode, this._tbodyNode);"," }"," },",""," /**"," Add the messaging related strings to the `strings` map."," "," @method _initMessageStrings"," @protected"," @since 3.5.0"," **/"," _initMessageStrings: function () {"," // Not a valueFn because other class extensions will want to add to it"," this.set('strings', Y.mix((this.get('strings') || {}), "," Y.Intl.get('datatable-message')));"," },",""," /**"," Node used to display messages from `showMessage`.",""," @property _messageNode"," @type {Node}"," @value `undefined` (not initially set)"," @since 3.5.0"," **/"," //_messageNode: null,",""," /**"," Synchronizes the message UI with the table state.",""," @method _syncMessageUI"," @protected"," @since 3.5.0"," **/"," _syncMessageUI: function () {"," this._uiSetMessage();"," },",""," /**"," Calls `hideMessage` or `showMessage` as appropriate based on the presence of"," records in the `data` ModelList.",""," This is called when `data` is reset or records are added or removed. Also,"," if the `showMessages` attribute is updated. In either case, if the"," triggering event has a `message` property on the EventFacade, it will be"," passed to `showMessage` (if appropriate). If no such property is on the"," facade, the `emptyMessage` will be used (see the strings).",""," @method _uiSetMessage"," @param {EventFacade} e The columnsChange event"," @protected"," @since 3.5.0"," **/"," _uiSetMessage: function (e) {"," if (!this.data.size()) {"," this.showMessage((e && e.message) || 'emptyMessage');"," } else {"," this.hideMessage();"," }"," }","});","","","if (Y.Lang.isFunction(Y.DataTable)) {"," Y.Base.mix(Y.DataTable, [ Message ]);","}","","","}, '3.7.2', {\"requires\": [\"datatable-base\"], \"lang\": [\"en\"], \"skinnable\": true});"];+_yuitest_coverage["build/datatable-message/datatable-message.js"].code=["YUI.add('datatable-message', function (Y, NAME) {","","/**","Adds support for a message container to appear in the table. This can be used","to indicate loading progress, lack of records, or any other communication","needed.","","@module datatable","@submodule datatable-message","@since 3.5.0","**/","var Message;","","/**","_API docs for this extension are included in the DataTable class._","","Adds support for a message container to appear in the table. This can be used","to indicate loading progress, lack of records, or any other communication","needed.","","Features added to `Y.DataTable`, and made available for custom classes at","`Y.DataTable.Message`.","","@class DataTable.Message","@for DataTable","@since 3.5.0","**/","Y.namespace('DataTable').Message = Message = function () {};","","Message.ATTRS = {"," /**"," Enables the display of messages in the table. Setting this to false will"," prevent the message Node from being created and `showMessage` from doing"," anything.",""," @attribute showMessages"," @type {Boolean}"," @default true"," @since 3.5.0"," **/"," showMessages: {"," value: true,"," validator: Y.Lang.isBoolean"," }","};","","Y.mix(Message.prototype, {"," /**"," Template used to generate the node that will be used to report messages.",""," @property MESSAGE_TEMPLATE"," @type {HTML}"," @default <tbody class=\"{className}\"><td class=\"{contentClass}\" colspan=\"{colspan}\"></td></tbody>"," @since 3.5.0"," **/"," MESSAGE_TEMPLATE: '<tbody class=\"{className}\"><tr><td class=\"{contentClass}\" colspan=\"{colspan}\"></td></tr></tbody>',",""," /**"," Hides the message node.",""," @method hideMessage"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," hideMessage: function () {"," this.get('boundingBox').removeClass("," this.getClassName('message', 'visible'));",""," return this;"," },",""," /**"," Display the message node and set its content to `message`. If there is a"," localized `strings` entry for the value of `message`, that string will be"," used.",""," @method showMessage"," @param {String} message The message name or message itself to display"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," showMessage: function (message) {"," var content = this.getString(message) || message;",""," if (!this._messageNode) {"," this._initMessageNode();"," }",""," if (this.get('showMessages')) {"," if (content) {"," this._messageNode.one("," '.' + this.getClassName('message', 'content'))"," .setHTML(content);",""," this.get('boundingBox').addClass("," this.getClassName('message','visible'));"," } else {"," // TODO: is this right?"," // If no message provided, remove the message node."," this.hideMessage();"," }"," }",""," return this;"," },",""," //--------------------------------------------------------------------------"," // Protected methods"," //--------------------------------------------------------------------------"," /**"," Updates the colspan of the `<td>` used to display the messages.",""," @method _afterMessageColumnsChange"," @param {EventFacade} e The columnsChange event"," @protected"," @since 3.5.0"," **/"," _afterMessageColumnsChange: function (e) {"," var contentNode;",""," if (this._messageNode) {"," contentNode = this._messageNode.one("," '.' + this.getClassName('message', 'content'));",""," if (contentNode) {"," // FIXME: This needs to become a class extension plus a view or"," // plugin for the table view."," contentNode.set('colSpan', this._displayColumns.length);"," }"," }"," },",""," /**"," Relays to `_uiSetMessage` to hide or show the message node.",""," @method _afterMessageDataChange"," @param {EventFacade} e The dataChange event"," @protected"," @since 3.5.0"," **/"," _afterMessageDataChange: function (e) {"," this._uiSetMessage();"," },",""," /**"," Removes the message node if `showMessages` is `false`, or relays to"," `_uiSetMessage` if `true`.",""," @method _afterShowMessagesChange"," @param {EventFacade} e The showMessagesChange event"," @protected"," @since 3.5.0"," **/"," _afterShowMessagesChange: function (e) {"," if (e.newVal) {"," this._uiSetMessage(e);"," } else if (this._messageNode) {"," this.get('boundingBox').removeClass("," this.getClassName('message', 'visible'));",""," this._messageNode.remove().destroy(true);"," this._messageNode = null;"," }"," },",""," /**"," Binds the events necessary to keep the message node in sync with the current"," table and configuration state.",""," @method _bindMessageUI"," @protected"," @since 3.5.0"," **/"," _bindMessageUI: function () {"," this.after(['dataChange', '*:add', '*:remove', '*:reset'],"," Y.bind('_afterMessageDataChange', this));",""," this.after('columnsChange', Y.bind('_afterMessageColumnsChange', this));",""," this.after('showMessagesChange',"," Y.bind('_afterShowMessagesChange', this));"," },",""," /**"," Merges in the message related strings and hooks into the rendering cycle to"," also render and bind the message node.",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this._initMessageStrings();",""," if (this.get('showMessages')) {"," this.after('renderBody', Y.bind('_initMessageNode', this));"," }",""," this.after(Y.bind('_bindMessageUI', this), this, 'bindUI');"," this.after(Y.bind('_syncMessageUI', this), this, 'syncUI');"," },",""," /**"," Creates the `_messageNode` property from the configured `MESSAGE_TEMPLATE`"," and inserts it before the `<table>`'s `<tbody>` node.",""," @method _initMessageNode"," @protected"," @since 3.5.0"," **/"," _initMessageNode: function () {"," if (!this._messageNode) {"," this._messageNode = Y.Node.create("," Y.Lang.sub(this.MESSAGE_TEMPLATE, {"," className: this.getClassName('message'),"," contentClass: this.getClassName('message', 'content'),"," colspan: this._displayColumns.length || 1"," }));",""," this._tableNode.insertBefore(this._messageNode, this._tbodyNode);"," }"," },",""," /**"," Add the messaging related strings to the `strings` map."," "," @method _initMessageStrings"," @protected"," @since 3.5.0"," **/"," _initMessageStrings: function () {"," // Not a valueFn because other class extensions will want to add to it"," this.set('strings', Y.mix((this.get('strings') || {}), "," Y.Intl.get('datatable-message')));"," },",""," /**"," Node used to display messages from `showMessage`.",""," @property _messageNode"," @type {Node}"," @value `undefined` (not initially set)"," @since 3.5.0"," **/"," //_messageNode: null,",""," /**"," Synchronizes the message UI with the table state.",""," @method _syncMessageUI"," @protected"," @since 3.5.0"," **/"," _syncMessageUI: function () {"," this._uiSetMessage();"," },",""," /**"," Calls `hideMessage` or `showMessage` as appropriate based on the presence of"," records in the `data` ModelList.",""," This is called when `data` is reset or records are added or removed. Also,"," if the `showMessages` attribute is updated. In either case, if the"," triggering event has a `message` property on the EventFacade, it will be"," passed to `showMessage` (if appropriate). If no such property is on the"," facade, the `emptyMessage` will be used (see the strings).",""," @method _uiSetMessage"," @param {EventFacade} e The columnsChange event"," @protected"," @since 3.5.0"," **/"," _uiSetMessage: function (e) {"," if (!this.data.size()) {"," this.showMessage((e && e.message) || 'emptyMessage');"," } else {"," this.hideMessage();"," }"," }","});","","","if (Y.Lang.isFunction(Y.DataTable)) {"," Y.Base.mix(Y.DataTable, [ Message ]);","}","","","}, '3.7.3', {\"requires\": [\"datatable-base\"], \"lang\": [\"en\"], \"skinnable\": true});"]; _yuitest_coverage["build/datatable-message/datatable-message.js"].lines = {"1":0,"12":0,"28":0,"30":0,"47":0,"67":0,"70":0,"85":0,"87":0,"88":0,"91":0,"92":0,"93":0,"97":0,"102":0,"106":0,"121":0,"123":0,"124":0,"127":0,"130":0,"144":0,"157":0,"158":0,"159":0,"160":0,"163":0,"164":0,"177":0,"180":0,"182":0,"195":0,"197":0,"198":0,"201":0,"202":0,"214":0,"215":0,"222":0,"235":0,"257":0,"276":0,"277":0,"279":0,"285":0,"286":0}; _yuitest_coverage["build/datatable-message/datatable-message.js"].functions = {"hideMessage:66":0,"showMessage:84":0,"_afterMessageColumnsChange:120":0,"_afterMessageDataChange:143":0,"_afterShowMessagesChange:156":0,"_bindMessageUI:176":0,"initializer:194":0,"_initMessageNode:213":0,"_initMessageStrings:233":0,"_syncMessageUI:256":0,"_uiSetMessage:275":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-message/datatable-message.js"].coveredLines = 46;@@ -384,4 +384,4 @@ } -}, '3.7.2', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
bundle/datatable-message/datatable-message-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -293,4 +293,4 @@ } -}, '3.7.2', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
bundle/datatable-message/datatable-message-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-message",function(e,t){var n;e.namespace("DataTable").Message=n=function(){},n.ATTRS={showMessages:{value:!0,validator:e.Lang.isBoolean}},e.mix(n.prototype,{MESSAGE_TEMPLATE:'<tbody class="{className}"><tr><td class="{contentClass}" colspan="{colspan}"></td></tr></tbody>',hideMessage:function(){return this.get("boundingBox").removeClass(this.getClassName("message","visible")),this},showMessage:function(e){var t=this.getString(e)||e;return this._messageNode||this._initMessageNode(),this.get("showMessages")&&(t?(this._messageNode.one("."+this.getClassName("message","content")).setHTML(t),this.get("boundingBox").addClass(this.getClassName("message","visible"))):this.hideMessage()),this},_afterMessageColumnsChange:function(e){var t;this._messageNode&&(t=this._messageNode.one("."+this.getClassName("message","content")),t&&t.set("colSpan",this._displayColumns.length))},_afterMessageDataChange:function(e){this._uiSetMessage()},_afterShowMessagesChange:function(e){e.newVal?this._uiSetMessage(e):this._messageNode&&(this.get("boundingBox").removeClass(this.getClassName("message","visible")),this._messageNode.remove().destroy(!0),this._messageNode=null)},_bindMessageUI:function(){this.after(["dataChange","*:add","*:remove","*:reset"],e.bind("_afterMessageDataChange",this)),this.after("columnsChange",e.bind("_afterMessageColumnsChange",this)),this.after("showMessagesChange",e.bind("_afterShowMessagesChange",this))},initializer:function(){this._initMessageStrings(),this.get("showMessages")&&this.after("renderBody",e.bind("_initMessageNode",this)),this.after(e.bind("_bindMessageUI",this),this,"bindUI"),this.after(e.bind("_syncMessageUI",this),this,"syncUI")},_initMessageNode:function(){this._messageNode||(this._messageNode=e.Node.create(e.Lang.sub(this.MESSAGE_TEMPLATE,{className:this.getClassName("message"),contentClass:this.getClassName("message","content"),colspan:this._displayColumns.length||1})),this._tableNode.insertBefore(this._messageNode,this._tbodyNode))},_initMessageStrings:function(){this.set("strings",e.mix(this.get("strings")||{},e.Intl.get("datatable-message")))},_syncMessageUI:function(){this._uiSetMessage()},_uiSetMessage:function(e){this.data.size()?this.hideMessage():this.showMessage(e&&e.message||"emptyMessage")}}),e.Lang.isFunction(e.DataTable)&&e.Base.mix(e.DataTable,[n])},"3.7.2",{requires:["datatable-base"],lang:["en"],skinnable:!0});+YUI.add("datatable-message",function(e,t){var n;e.namespace("DataTable").Message=n=function(){},n.ATTRS={showMessages:{value:!0,validator:e.Lang.isBoolean}},e.mix(n.prototype,{MESSAGE_TEMPLATE:'<tbody class="{className}"><tr><td class="{contentClass}" colspan="{colspan}"></td></tr></tbody>',hideMessage:function(){return this.get("boundingBox").removeClass(this.getClassName("message","visible")),this},showMessage:function(e){var t=this.getString(e)||e;return this._messageNode||this._initMessageNode(),this.get("showMessages")&&(t?(this._messageNode.one("."+this.getClassName("message","content")).setHTML(t),this.get("boundingBox").addClass(this.getClassName("message","visible"))):this.hideMessage()),this},_afterMessageColumnsChange:function(e){var t;this._messageNode&&(t=this._messageNode.one("."+this.getClassName("message","content")),t&&t.set("colSpan",this._displayColumns.length))},_afterMessageDataChange:function(e){this._uiSetMessage()},_afterShowMessagesChange:function(e){e.newVal?this._uiSetMessage(e):this._messageNode&&(this.get("boundingBox").removeClass(this.getClassName("message","visible")),this._messageNode.remove().destroy(!0),this._messageNode=null)},_bindMessageUI:function(){this.after(["dataChange","*:add","*:remove","*:reset"],e.bind("_afterMessageDataChange",this)),this.after("columnsChange",e.bind("_afterMessageColumnsChange",this)),this.after("showMessagesChange",e.bind("_afterShowMessagesChange",this))},initializer:function(){this._initMessageStrings(),this.get("showMessages")&&this.after("renderBody",e.bind("_initMessageNode",this)),this.after(e.bind("_bindMessageUI",this),this,"bindUI"),this.after(e.bind("_syncMessageUI",this),this,"syncUI")},_initMessageNode:function(){this._messageNode||(this._messageNode=e.Node.create(e.Lang.sub(this.MESSAGE_TEMPLATE,{className:this.getClassName("message"),contentClass:this.getClassName("message","content"),colspan:this._displayColumns.length||1})),this._tableNode.insertBefore(this._messageNode,this._tbodyNode))},_initMessageStrings:function(){this.set("strings",e.mix(this.get("strings")||{},e.Intl.get("datatable-message")))},_syncMessageUI:function(){this._uiSetMessage()},_uiSetMessage:function(e){this.data.size()?this.hideMessage():this.showMessage(e&&e.message||"emptyMessage")}}),e.Lang.isFunction(e.DataTable)&&e.Base.mix(e.DataTable,[n])},"3.7.3",{requires:["datatable-base"],lang:["en"],skinnable:!0});
bundle/datatable-message/datatable-message.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -293,4 +293,4 @@ } -}, '3.7.2', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
bundle/datatable-message/lang/datatable-message.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatable-message",function(e){e.Intl.add("datatable-message","",{emptyMessage:"No data to display",loadingMessage:"Loading..."})},"3.7.2");+YUI.add("lang/datatable-message",function(e){e.Intl.add("datatable-message","",{emptyMessage:"No data to display",loadingMessage:"Loading..."})},"3.7.3");
bundle/datatable-message/lang/datatable-message_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatable-message_en",function(e){e.Intl.add("datatable-message","en",{emptyMessage:"No data to display",loadingMessage:"Loading..."})},"3.7.2");+YUI.add("lang/datatable-message_en",function(e){e.Intl.add("datatable-message","en",{emptyMessage:"No data to display",loadingMessage:"Loading..."})},"3.7.3");
bundle/datatable-mutable/datatable-mutable-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-mutable/datatable-mutable.js", code: [] };-_yuitest_coverage["build/datatable-mutable/datatable-mutable.js"].code=["YUI.add('datatable-mutable', function (Y, NAME) {","","/**","Adds mutation convenience methods such as `table.addRow(data)` to `Y.DataTable`. (or other built class).","","@module datatable","@submodule datatable-mutable","@since 3.5.0","**/","var toArray = Y.Array,"," YLang = Y.Lang,"," isString = YLang.isString,"," isArray = YLang.isArray,"," isObject = YLang.isObject,"," isNumber = YLang.isNumber,"," arrayIndex = Y.Array.indexOf,"," Mutable;","","/**","_API docs for this extension are included in the DataTable class._","","Class extension to add mutation convenience methods to `Y.DataTable` (or other","built class).","","Column mutation methods are paired with new custom events:",""," * addColumn"," * removeColumn"," * modifyColumn"," * moveColumn","","Row mutation events are bubbled from the DataTable's `data` ModelList through","the DataTable instance.","","@class DataTable.Mutable","@for DataTable","@since 3.5.0","**/","Y.namespace('DataTable').Mutable = Mutable = function () {};","","Mutable.ATTRS = {"," /**"," Controls whether `addRow`, `removeRow`, and `modifyRow` should trigger the"," underlying Model's sync layer by default.",""," When `true`, it is unnecessary to pass the \"sync\" configuration property to"," those methods to trigger per-operation sync.","",""," @attribute autoSync"," @type {Boolean}"," @default `false`"," @since 3.5.0"," **/"," autoSync: {"," value: false,"," validator: YLang.isBoolean"," }","};","","Y.mix(Mutable.prototype, {"," /**"," Adds the column configuration to the DataTable's `columns` configuration."," If the `index` parameter is supplied, it is injected at that index. If the"," table has nested headers, inject a subcolumn by passing an array of indexes"," to identify the new column's final location.",""," The `index` parameter is required if adding a nested column.",""," This method is a convienience method for fetching the DataTable's `columns`"," attribute, updating it, and calling "," `table.set('columns', _updatedColumnsDefs_)`",""," For example:",""," <pre><code>// Becomes last column"," table.addColumn('name');",""," // Inserted after the current second column, moving the current third column"," // to index 4"," table.addColumn({ key: 'price', formatter: currencyFormatter }, 2 );",""," // Insert a new column in a set of headers three rows deep. The index array"," // translates to"," // [ 2, -- in the third column's children"," // 1, -- in the second child's children"," // 3 ] -- as the fourth child column"," table.addColumn({ key: 'age', sortable: true }, [ 2, 1, 3 ]);"," </code></pre>",""," @method addColumn"," @param {Object|String} config The new column configuration object"," @param {Number|Number[]} [index] the insertion index"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," addColumn: function (config, index) {"," if (isString(config)) {"," config = { key: config };"," }",""," if (config) {"," if (arguments.length < 2 || (!isNumber(index) && !isArray(index))) {"," index = this.get('columns').length;"," }",""," this.fire('addColumn', {"," column: config,"," index: index"," });"," }"," return this;"," },",""," /**"," Updates an existing column definition. Fires the `modifyColumn` event.",""," For example:",""," <pre><code>// Add a formatter to the existing 'price' column definition"," table.modifyColumn('price', { formatter: currencyFormatter });",""," // Change the label on a header cell in a set of nested headers three rows"," // deep. The index array translates to"," // [ 2, -- in the third column's children"," // 1, -- the second child"," // 3 ] -- the fourth child column"," table.modifyColumn([2, 1, 3], { label: 'Experience' });"," </code></pre>",""," @method modifyColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @param {Object} config The new column configuration properties"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," modifyColumn: function (name, config) {"," if (isString(config)) {"," config = { key: config };"," }",""," if (isObject(config)) {"," this.fire('modifyColumn', {"," column: name,"," newColumnDef: config"," });"," }",""," return this;"," },",""," /**"," Moves an existing column to a new location. Fires the `moveColumn` event.",""," The destination index can be a number or array of numbers to place a column"," header in a nested header row.",""," @method moveColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @param {Number|Number[]} index The destination index of the column"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," moveColumn: function (name, index) {"," if (name !== undefined && (isNumber(index) || isArray(index))) {"," this.fire('moveColumn', {"," column: name,"," index: index"," });"," }",""," return this;"," },",""," /**"," Removes an existing column. Fires the `removeColumn` event.",""," @method removeColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," removeColumn: function (name) {"," if (name !== undefined) {"," this.fire('removeColumn', {"," column: name"," });"," }",""," return this;"," },",""," /**"," Adds a new record to the DataTable's `data` ModelList. Record data can be"," an object of field values or an instance of the DataTable's configured"," `recordType` class.",""," This relays all parameters to the `data` ModelList's `add` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be `save()`d.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `save()` method.",""," @method addRow"," @param {Object} data The data or Model instance for the new record"," @param {Object} [config] Configuration to pass along"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," addRow: function (data, config) {"," // Allow autoSync: true + addRow({ data }, { sync: false })"," var sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," models, model, i, len, args;",""," if (data && this.data) {"," models = this.data.add.apply(this.data, arguments);",""," if (sync) {"," models = toArray(models);"," args = toArray(arguments, 1, true);",""," for (i = 0, len = models.length; i < len; ++i) {"," model = models[i];",""," if (model.isNew()) {"," models[i].save.apply(models[i], args);"," }"," }"," }"," }",""," return this;"," },",""," /**"," Removes a record from the DataTable's `data` ModelList. The record can be"," provided explicitly or targeted by it's `id` (see ModelList's `getById`"," method), `clientId`, or index in the ModelList.",""," After locating the target Model, this relays the Model and all other passed"," arguments to the `data` ModelList's `remove` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be destroyed, passing"," `{ delete: true }` to trigger calling the Model's sync layer.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `destroy()` method.",""," @method removeRow"," @param {Object|String|Number} id The Model instance or identifier "," @param {Object} [config] Configuration to pass along"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," removeRow: function (id, config) {"," var modelList = this.data,"," // Allow autoSync: true + addRow({ data }, { sync: false })"," sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," models, model, i, len, args;",""," // TODO: support removing via DOM element. This should be relayed to View"," if (isObject(id) && id instanceof this.get('recordType')) {"," model = id;"," } else if (modelList && id !== undefined) {"," model = modelList.getById(id) ||"," modelList.getByClientId(id) ||"," modelList.item(id);"," }",""," if (model) {"," args = toArray(arguments, 1, true);",""," models = modelList.remove.apply(modelList,"," [model].concat(args));",""," if (sync) {"," if (!isObject(args[0])) {"," args.unshift({});"," }",""," args[0]['delete'] = true;",""," models = toArray(models);",""," for (i = 0, len = models.length; i < len; ++i) {"," model = models[i];"," model.destroy.apply(model, args);"," }"," }"," }",""," return this;"," },",""," /**"," Updates an existing record in the DataTable's `data` ModelList. The record"," can be provided explicitly or targeted by it's `id` (see ModelList's"," `getById` method), `clientId`, or index in the ModelList.",""," After locating the target Model, this relays the all other passed"," arguments to the Model's `setAttrs` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be `save()`d.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `save()` method.",""," @method modifyRow"," @param {Object|String|Number} id The Model instance or identifier "," @param {Object} data New data values for the Model"," @param {Object} [config] Configuration to pass along to `setAttrs()`"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," modifyRow: function (id, data, config) {"," var modelList = this.data,"," // Allow autoSync: true + addRow({ data }, { sync: false })"," sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," model, args;",""," if (isObject(id) && id instanceof this.get('recordType')) {"," model = id;"," } else if (modelList && id !== undefined) {"," model = modelList.getById(id) ||"," modelList.getByClientId(id) ||"," modelList.item(id);"," }",""," if (model && isObject(data)) {"," args = toArray(arguments, 1, true);",""," model.setAttrs.apply(model, args);",""," if (sync && !model.isNew()) {"," model.save.apply(model, args);"," }"," }",""," return this;"," },",""," // --------------------------------------------------------------------------"," // Protected properties and methods"," // --------------------------------------------------------------------------",""," /**"," Default function for the `addColumn` event.",""," Inserts the specified column at the provided index.",""," @method _defAddColumnFn"," @param {EventFacade} e The `addColumn` event"," @param {Object} e.column The new column definition object"," @param {Number|Number[]} e.index The array index to insert the new column"," @protected"," @since 3.5.0"," **/"," _defAddColumnFn: function (e) {"," var index = toArray(e.index),"," columns = this.get('columns'),"," cols = columns,"," i, len;",""," for (i = 0, len = index.length - 1; cols && i < len; ++i) {"," cols = cols[index[i]] && cols[index[i]].children;"," }",""," if (cols) {"," cols.splice(index[i], 0, e.column);",""," this.set('columns', columns, { originEvent: e });"," }"," },",""," /**"," Default function for the `modifyColumn` event.",""," Mixes the new column properties into the specified column definition.",""," @method _defModifyColumnFn"," @param {EventFacade} e The `modifyColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @param {Object} e.newColumnDef The properties to assign to the column"," @protected"," @since 3.5.0"," **/"," _defModifyColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column);",""," if (column) {"," Y.mix(column, e.newColumnDef, true);"," "," this.set('columns', columns, { originEvent: e });"," }"," },",""," /**"," Default function for the `moveColumn` event.",""," Removes the specified column from its current location and inserts it at the"," specified array index (may be an array of indexes for nested headers).",""," @method _defMoveColumnFn"," @param {EventFacade} e The `moveColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @param {Object} e.index The destination index to move to"," @protected"," @since 3.5.0"," **/"," _defMoveColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column),"," toIndex = toArray(e.index),"," fromCols, fromIndex, toCols, i, len;",""," if (column) {"," fromCols = column._parent ? column._parent.children : columns;"," fromIndex = arrayIndex(fromCols, column);",""," if (fromIndex > -1) {"," toCols = columns;",""," for (i = 0, len = toIndex.length - 1; toCols && i < len; ++i) {"," toCols = toCols[toIndex[i]] && toCols[toIndex[i]].children;"," }",""," if (toCols) {"," len = toCols.length;"," fromCols.splice(fromIndex, 1);"," toIndex = toIndex[i];",""," if (len > toCols.lenth) {"," // spliced off the same array, so adjust destination"," // index if necessary"," if (fromIndex < toIndex) {"," toIndex--;"," }"," }",""," toCols.splice(toIndex, 0, column);",""," this.set('columns', columns, { originEvent: e });"," }"," }"," }"," },",""," /**"," Default function for the `removeColumn` event.",""," Splices the specified column from its containing columns array.",""," @method _defRemoveColumnFn"," @param {EventFacade} e The `removeColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @protected"," @since 3.5.0"," **/"," _defRemoveColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column),"," cols, index;",""," if (column) {"," cols = column._parent ? column._parent.children : columns;"," index = Y.Array.indexOf(cols, column);",""," if (index > -1) {"," cols.splice(index, 1);",""," this.set('columns', columns, { originEvent: e });"," }"," }"," },",""," /**"," Publishes the events used by the mutation methods:",""," * addColumn"," * removeColumn"," * modifyColumn"," * moveColumn",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this.publish({"," addColumn: { defaultFn: Y.bind('_defAddColumnFn', this) },"," removeColumn: { defaultFn: Y.bind('_defRemoveColumnFn', this) },"," moveColumn: { defaultFn: Y.bind('_defMoveColumnFn', this) },"," modifyColumn: { defaultFn: Y.bind('_defModifyColumnFn', this) }"," });"," }","});","","/**","Adds an array of new records to the DataTable's `data` ModelList. Record data","can be an array of objects containing field values or an array of instance of","the DataTable's configured `recordType` class.","","This relays all parameters to the `data` ModelList's `add` method.","","Technically, this is an alias to `addRow`, but please use the appropriately","named method for readability.","","If a configuration object is passed as a second argument, and that object","has `sync: true` set, the underlying Models will be `save()`d.","","If the DataTable's `autoSync` attribute is set to `true`, the additional","argument is not needed.","","If syncing and the last argument is a function, that function will be used","as a callback to each Model's `save()` method.","","@method addRows","@param {Object[]} data The data or Model instances to add","@param {Object} [config] Configuration to pass along","@param {Function} [callback] Callback function for each Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash.","@return {DataTable}","@chainable","@since 3.5.0","**/","Mutable.prototype.addRows = Mutable.prototype.addRow;","","// Add feature APIs to public Y.DataTable class","if (YLang.isFunction(Y.DataTable)) {"," Y.Base.mix(Y.DataTable, [Mutable]);","}","","/**","Fired by the `addColumn` method.","","@event addColumn","@preventable _defAddColumnFn","@param {Object} column The new column definition object","@param {Number|Number[]} index The array index to insert the new column","@since 3.5.0","**/","","/**","Fired by the `removeColumn` method.","","@event removeColumn","@preventable _defRemoveColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@since 3.5.0","**/","","/**","Fired by the `modifyColumn` method.","","@event modifyColumn","@preventable _defModifyColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@param {Object} newColumnDef The properties to assign to the column","@since 3.5.0","**/","","/**","Fired by the `moveColumn` method.","","@event moveColumn","@preventable _defMoveColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@param {Object} index The destination index to move to","@since 3.5.0","**/","","","","}, '3.7.2', {\"requires\": [\"datatable-base\"]});"];+_yuitest_coverage["build/datatable-mutable/datatable-mutable.js"].code=["YUI.add('datatable-mutable', function (Y, NAME) {","","/**","Adds mutation convenience methods such as `table.addRow(data)` to `Y.DataTable`. (or other built class).","","@module datatable","@submodule datatable-mutable","@since 3.5.0","**/","var toArray = Y.Array,"," YLang = Y.Lang,"," isString = YLang.isString,"," isArray = YLang.isArray,"," isObject = YLang.isObject,"," isNumber = YLang.isNumber,"," arrayIndex = Y.Array.indexOf,"," Mutable;","","/**","_API docs for this extension are included in the DataTable class._","","Class extension to add mutation convenience methods to `Y.DataTable` (or other","built class).","","Column mutation methods are paired with new custom events:",""," * addColumn"," * removeColumn"," * modifyColumn"," * moveColumn","","Row mutation events are bubbled from the DataTable's `data` ModelList through","the DataTable instance.","","@class DataTable.Mutable","@for DataTable","@since 3.5.0","**/","Y.namespace('DataTable').Mutable = Mutable = function () {};","","Mutable.ATTRS = {"," /**"," Controls whether `addRow`, `removeRow`, and `modifyRow` should trigger the"," underlying Model's sync layer by default.",""," When `true`, it is unnecessary to pass the \"sync\" configuration property to"," those methods to trigger per-operation sync.","",""," @attribute autoSync"," @type {Boolean}"," @default `false`"," @since 3.5.0"," **/"," autoSync: {"," value: false,"," validator: YLang.isBoolean"," }","};","","Y.mix(Mutable.prototype, {"," /**"," Adds the column configuration to the DataTable's `columns` configuration."," If the `index` parameter is supplied, it is injected at that index. If the"," table has nested headers, inject a subcolumn by passing an array of indexes"," to identify the new column's final location.",""," The `index` parameter is required if adding a nested column.",""," This method is a convienience method for fetching the DataTable's `columns`"," attribute, updating it, and calling "," `table.set('columns', _updatedColumnsDefs_)`",""," For example:",""," <pre><code>// Becomes last column"," table.addColumn('name');",""," // Inserted after the current second column, moving the current third column"," // to index 4"," table.addColumn({ key: 'price', formatter: currencyFormatter }, 2 );",""," // Insert a new column in a set of headers three rows deep. The index array"," // translates to"," // [ 2, -- in the third column's children"," // 1, -- in the second child's children"," // 3 ] -- as the fourth child column"," table.addColumn({ key: 'age', sortable: true }, [ 2, 1, 3 ]);"," </code></pre>",""," @method addColumn"," @param {Object|String} config The new column configuration object"," @param {Number|Number[]} [index] the insertion index"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," addColumn: function (config, index) {"," if (isString(config)) {"," config = { key: config };"," }",""," if (config) {"," if (arguments.length < 2 || (!isNumber(index) && !isArray(index))) {"," index = this.get('columns').length;"," }",""," this.fire('addColumn', {"," column: config,"," index: index"," });"," }"," return this;"," },",""," /**"," Updates an existing column definition. Fires the `modifyColumn` event.",""," For example:",""," <pre><code>// Add a formatter to the existing 'price' column definition"," table.modifyColumn('price', { formatter: currencyFormatter });",""," // Change the label on a header cell in a set of nested headers three rows"," // deep. The index array translates to"," // [ 2, -- in the third column's children"," // 1, -- the second child"," // 3 ] -- the fourth child column"," table.modifyColumn([2, 1, 3], { label: 'Experience' });"," </code></pre>",""," @method modifyColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @param {Object} config The new column configuration properties"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," modifyColumn: function (name, config) {"," if (isString(config)) {"," config = { key: config };"," }",""," if (isObject(config)) {"," this.fire('modifyColumn', {"," column: name,"," newColumnDef: config"," });"," }",""," return this;"," },",""," /**"," Moves an existing column to a new location. Fires the `moveColumn` event.",""," The destination index can be a number or array of numbers to place a column"," header in a nested header row.",""," @method moveColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @param {Number|Number[]} index The destination index of the column"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," moveColumn: function (name, index) {"," if (name !== undefined && (isNumber(index) || isArray(index))) {"," this.fire('moveColumn', {"," column: name,"," index: index"," });"," }",""," return this;"," },",""," /**"," Removes an existing column. Fires the `removeColumn` event.",""," @method removeColumn"," @param {String|Number|Number[]|Object} name The column key, name, index, or"," current configuration object"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," removeColumn: function (name) {"," if (name !== undefined) {"," this.fire('removeColumn', {"," column: name"," });"," }",""," return this;"," },",""," /**"," Adds a new record to the DataTable's `data` ModelList. Record data can be"," an object of field values or an instance of the DataTable's configured"," `recordType` class.",""," This relays all parameters to the `data` ModelList's `add` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be `save()`d.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `save()` method.",""," @method addRow"," @param {Object} data The data or Model instance for the new record"," @param {Object} [config] Configuration to pass along"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," addRow: function (data, config) {"," // Allow autoSync: true + addRow({ data }, { sync: false })"," var sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," models, model, i, len, args;",""," if (data && this.data) {"," models = this.data.add.apply(this.data, arguments);",""," if (sync) {"," models = toArray(models);"," args = toArray(arguments, 1, true);",""," for (i = 0, len = models.length; i < len; ++i) {"," model = models[i];",""," if (model.isNew()) {"," models[i].save.apply(models[i], args);"," }"," }"," }"," }",""," return this;"," },",""," /**"," Removes a record from the DataTable's `data` ModelList. The record can be"," provided explicitly or targeted by it's `id` (see ModelList's `getById`"," method), `clientId`, or index in the ModelList.",""," After locating the target Model, this relays the Model and all other passed"," arguments to the `data` ModelList's `remove` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be destroyed, passing"," `{ delete: true }` to trigger calling the Model's sync layer.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `destroy()` method.",""," @method removeRow"," @param {Object|String|Number} id The Model instance or identifier "," @param {Object} [config] Configuration to pass along"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," removeRow: function (id, config) {"," var modelList = this.data,"," // Allow autoSync: true + addRow({ data }, { sync: false })"," sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," models, model, i, len, args;",""," // TODO: support removing via DOM element. This should be relayed to View"," if (isObject(id) && id instanceof this.get('recordType')) {"," model = id;"," } else if (modelList && id !== undefined) {"," model = modelList.getById(id) ||"," modelList.getByClientId(id) ||"," modelList.item(id);"," }",""," if (model) {"," args = toArray(arguments, 1, true);",""," models = modelList.remove.apply(modelList,"," [model].concat(args));",""," if (sync) {"," if (!isObject(args[0])) {"," args.unshift({});"," }",""," args[0]['delete'] = true;",""," models = toArray(models);",""," for (i = 0, len = models.length; i < len; ++i) {"," model = models[i];"," model.destroy.apply(model, args);"," }"," }"," }",""," return this;"," },",""," /**"," Updates an existing record in the DataTable's `data` ModelList. The record"," can be provided explicitly or targeted by it's `id` (see ModelList's"," `getById` method), `clientId`, or index in the ModelList.",""," After locating the target Model, this relays the all other passed"," arguments to the Model's `setAttrs` method.",""," If a configuration object is passed as a second argument, and that object"," has `sync: true` set, the underlying Model will be `save()`d.",""," If the DataTable's `autoSync` attribute is set to `true`, the additional"," argument is not needed.",""," If syncing and the last argument is a function, that function will be used"," as a callback to the Model's `save()` method.",""," @method modifyRow"," @param {Object|String|Number} id The Model instance or identifier "," @param {Object} data New data values for the Model"," @param {Object} [config] Configuration to pass along to `setAttrs()`"," @param {Function} [callback] Callback function for Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," modifyRow: function (id, data, config) {"," var modelList = this.data,"," // Allow autoSync: true + addRow({ data }, { sync: false })"," sync = (config && ('sync' in config)) ?"," config.sync :"," this.get('autoSync'),"," model, args;",""," if (isObject(id) && id instanceof this.get('recordType')) {"," model = id;"," } else if (modelList && id !== undefined) {"," model = modelList.getById(id) ||"," modelList.getByClientId(id) ||"," modelList.item(id);"," }",""," if (model && isObject(data)) {"," args = toArray(arguments, 1, true);",""," model.setAttrs.apply(model, args);",""," if (sync && !model.isNew()) {"," model.save.apply(model, args);"," }"," }",""," return this;"," },",""," // --------------------------------------------------------------------------"," // Protected properties and methods"," // --------------------------------------------------------------------------",""," /**"," Default function for the `addColumn` event.",""," Inserts the specified column at the provided index.",""," @method _defAddColumnFn"," @param {EventFacade} e The `addColumn` event"," @param {Object} e.column The new column definition object"," @param {Number|Number[]} e.index The array index to insert the new column"," @protected"," @since 3.5.0"," **/"," _defAddColumnFn: function (e) {"," var index = toArray(e.index),"," columns = this.get('columns'),"," cols = columns,"," i, len;",""," for (i = 0, len = index.length - 1; cols && i < len; ++i) {"," cols = cols[index[i]] && cols[index[i]].children;"," }",""," if (cols) {"," cols.splice(index[i], 0, e.column);",""," this.set('columns', columns, { originEvent: e });"," }"," },",""," /**"," Default function for the `modifyColumn` event.",""," Mixes the new column properties into the specified column definition.",""," @method _defModifyColumnFn"," @param {EventFacade} e The `modifyColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @param {Object} e.newColumnDef The properties to assign to the column"," @protected"," @since 3.5.0"," **/"," _defModifyColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column);",""," if (column) {"," Y.mix(column, e.newColumnDef, true);"," "," this.set('columns', columns, { originEvent: e });"," }"," },",""," /**"," Default function for the `moveColumn` event.",""," Removes the specified column from its current location and inserts it at the"," specified array index (may be an array of indexes for nested headers).",""," @method _defMoveColumnFn"," @param {EventFacade} e The `moveColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @param {Object} e.index The destination index to move to"," @protected"," @since 3.5.0"," **/"," _defMoveColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column),"," toIndex = toArray(e.index),"," fromCols, fromIndex, toCols, i, len;",""," if (column) {"," fromCols = column._parent ? column._parent.children : columns;"," fromIndex = arrayIndex(fromCols, column);",""," if (fromIndex > -1) {"," toCols = columns;",""," for (i = 0, len = toIndex.length - 1; toCols && i < len; ++i) {"," toCols = toCols[toIndex[i]] && toCols[toIndex[i]].children;"," }",""," if (toCols) {"," len = toCols.length;"," fromCols.splice(fromIndex, 1);"," toIndex = toIndex[i];",""," if (len > toCols.lenth) {"," // spliced off the same array, so adjust destination"," // index if necessary"," if (fromIndex < toIndex) {"," toIndex--;"," }"," }",""," toCols.splice(toIndex, 0, column);",""," this.set('columns', columns, { originEvent: e });"," }"," }"," }"," },",""," /**"," Default function for the `removeColumn` event.",""," Splices the specified column from its containing columns array.",""," @method _defRemoveColumnFn"," @param {EventFacade} e The `removeColumn` event"," @param {Object|String|Number|Number[]} e.column The column definition object or identifier"," @protected"," @since 3.5.0"," **/"," _defRemoveColumnFn: function (e) {"," var columns = this.get('columns'),"," column = this.getColumn(e.column),"," cols, index;",""," if (column) {"," cols = column._parent ? column._parent.children : columns;"," index = Y.Array.indexOf(cols, column);",""," if (index > -1) {"," cols.splice(index, 1);",""," this.set('columns', columns, { originEvent: e });"," }"," }"," },",""," /**"," Publishes the events used by the mutation methods:",""," * addColumn"," * removeColumn"," * modifyColumn"," * moveColumn",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this.publish({"," addColumn: { defaultFn: Y.bind('_defAddColumnFn', this) },"," removeColumn: { defaultFn: Y.bind('_defRemoveColumnFn', this) },"," moveColumn: { defaultFn: Y.bind('_defMoveColumnFn', this) },"," modifyColumn: { defaultFn: Y.bind('_defModifyColumnFn', this) }"," });"," }","});","","/**","Adds an array of new records to the DataTable's `data` ModelList. Record data","can be an array of objects containing field values or an array of instance of","the DataTable's configured `recordType` class.","","This relays all parameters to the `data` ModelList's `add` method.","","Technically, this is an alias to `addRow`, but please use the appropriately","named method for readability.","","If a configuration object is passed as a second argument, and that object","has `sync: true` set, the underlying Models will be `save()`d.","","If the DataTable's `autoSync` attribute is set to `true`, the additional","argument is not needed.","","If syncing and the last argument is a function, that function will be used","as a callback to each Model's `save()` method.","","@method addRows","@param {Object[]} data The data or Model instances to add","@param {Object} [config] Configuration to pass along","@param {Function} [callback] Callback function for each Model's `save()`"," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash.","@return {DataTable}","@chainable","@since 3.5.0","**/","Mutable.prototype.addRows = Mutable.prototype.addRow;","","// Add feature APIs to public Y.DataTable class","if (YLang.isFunction(Y.DataTable)) {"," Y.Base.mix(Y.DataTable, [Mutable]);","}","","/**","Fired by the `addColumn` method.","","@event addColumn","@preventable _defAddColumnFn","@param {Object} column The new column definition object","@param {Number|Number[]} index The array index to insert the new column","@since 3.5.0","**/","","/**","Fired by the `removeColumn` method.","","@event removeColumn","@preventable _defRemoveColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@since 3.5.0","**/","","/**","Fired by the `modifyColumn` method.","","@event modifyColumn","@preventable _defModifyColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@param {Object} newColumnDef The properties to assign to the column","@since 3.5.0","**/","","/**","Fired by the `moveColumn` method.","","@event moveColumn","@preventable _defMoveColumnFn","@param {Object|String|Number|Number[]} column The column definition object or identifier","@param {Object} index The destination index to move to","@since 3.5.0","**/","","","","}, '3.7.3', {\"requires\": [\"datatable-base\"]});"]; _yuitest_coverage["build/datatable-mutable/datatable-mutable.js"].lines = {"1":0,"10":0,"39":0,"41":0,"61":0,"99":0,"100":0,"103":0,"104":0,"105":0,"108":0,"113":0,"141":0,"142":0,"145":0,"146":0,"152":0,"170":0,"171":0,"177":0,"191":0,"192":0,"197":0,"232":0,"237":0,"238":0,"240":0,"241":0,"242":0,"244":0,"245":0,"247":0,"248":0,"254":0,"290":0,"298":0,"299":0,"300":0,"301":0,"306":0,"307":0,"309":0,"312":0,"313":0,"314":0,"317":0,"319":0,"321":0,"322":0,"323":0,"328":0,"364":0,"371":0,"372":0,"373":0,"374":0,"379":0,"380":0,"382":0,"384":0,"385":0,"389":0,"409":0,"414":0,"415":0,"418":0,"419":0,"421":0,"438":0,"441":0,"442":0,"444":0,"462":0,"467":0,"468":0,"469":0,"471":0,"472":0,"474":0,"475":0,"478":0,"479":0,"480":0,"481":0,"483":0,"486":0,"487":0,"491":0,"493":0,"511":0,"515":0,"516":0,"517":0,"519":0,"520":0,"522":0,"540":0,"582":0,"585":0,"586":0}; _yuitest_coverage["build/datatable-mutable/datatable-mutable.js"].functions = {"addColumn:98":0,"modifyColumn:140":0,"moveColumn:169":0,"removeColumn:190":0,"addRow:230":0,"removeRow:289":0,"modifyRow:363":0,"_defAddColumnFn:408":0,"_defModifyColumnFn:437":0,"_defMoveColumnFn:461":0,"_defRemoveColumnFn:510":0,"initializer:539":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-mutable/datatable-mutable.js"].coveredLines = 100;@@ -779,4 +779,4 @@ -}, '3.7.2', {"requires": ["datatable-base"]});+}, '3.7.3', {"requires": ["datatable-base"]});
bundle/datatable-mutable/datatable-mutable-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -638,4 +638,4 @@ -}, '3.7.2', {"requires": ["datatable-base"]});+}, '3.7.3', {"requires": ["datatable-base"]});
bundle/datatable-mutable/datatable-mutable-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-mutable",function(e,t){var n=e.Array,r=e.Lang,i=r.isString,s=r.isArray,o=r.isObject,u=r.isNumber,a=e.Array.indexOf,f;e.namespace("DataTable").Mutable=f=function(){},f.ATTRS={autoSync:{value:!1,validator:r.isBoolean}},e.mix(f.prototype,{addColumn:function(e,t){i(e)&&(e={key:e});if(e){if(arguments.length<2||!u(t)&&!s(t))t=this.get("columns").length;this.fire("addColumn",{column:e,index:t})}return this},modifyColumn:function(e,t){return i(t)&&(t={key:t}),o(t)&&this.fire("modifyColumn",{column:e,newColumnDef:t}),this},moveColumn:function(e,t){return e!==undefined&&(u(t)||s(t))&&this.fire("moveColumn",{column:e,index:t}),this},removeColumn:function(e){return e!==undefined&&this.fire("removeColumn",{column:e}),this},addRow:function(e,t){var r=t&&"sync"in t?t.sync:this.get("autoSync"),i,s,o,u,a;if(e&&this.data){i=this.data.add.apply(this.data,arguments);if(r){i=n(i),a=n(arguments,1,!0);for(o=0,u=i.length;o<u;++o)s=i[o],s.isNew()&&i[o].save.apply(i[o],a)}}return this},removeRow:function(e,t){var r=this.data,i=t&&"sync"in t?t.sync:this.get("autoSync"),s,u,a,f,l;o(e)&&e instanceof this.get("recordType")?u=e:r&&e!==undefined&&(u=r.getById(e)||r.getByClientId(e)||r.item(e));if(u){l=n(arguments,1,!0),s=r.remove.apply(r,[u].concat(l));if(i){o(l[0])||l.unshift({}),l[0]["delete"]=!0,s=n(s);for(a=0,f=s.length;a<f;++a)u=s[a],u.destroy.apply(u,l)}}return this},modifyRow:function(e,t,r){var i=this.data,s=r&&"sync"in r?r.sync:this.get("autoSync"),u,a;return o(e)&&e instanceof this.get("recordType")?u=e:i&&e!==undefined&&(u=i.getById(e)||i.getByClientId(e)||i.item(e)),u&&o(t)&&(a=n(arguments,1,!0),u.setAttrs.apply(u,a),s&&!u.isNew()&&u.save.apply(u,a)),this},_defAddColumnFn:function(e){var t=n(e.index),r=this.get("columns"),i=r,s,o;for(s=0,o=t.length-1;i&&s<o;++s)i=i[t[s]]&&i[t[s]].children;i&&(i.splice(t[s],0,e.column),this.set("columns",r,{originEvent:e}))},_defModifyColumnFn:function(t){var n=this.get("columns"),r=this.getColumn(t.column);r&&(e.mix(r,t.newColumnDef,!0),this.set("columns",n,{originEvent:t}))},_defMoveColumnFn:function(e){var t=this.get("columns"),r=this.getColumn(e.column),i=n(e.index),s,o,u,f,l;if(r){s=r._parent?r._parent.children:t,o=a(s,r);if(o>-1){u=t;for(f=0,l=i.length-1;u&&f<l;++f)u=u[i[f]]&&u[i[f]].children;u&&(l=u.length,s.splice(o,1),i=i[f],l>u.lenth&&o<i&&i--,u.splice(i,0,r),this.set("columns",t,{originEvent:e}))}}},_defRemoveColumnFn:function(t){var n=this.get("columns"),r=this.getColumn(t.column),i,s;r&&(i=r._parent?r._parent.children:n,s=e.Array.indexOf(i,r),s>-1&&(i.splice(s,1),this.set("columns",n,{originEvent:t})))},initializer:function(){this.publish({addColumn:{defaultFn:e.bind("_defAddColumnFn",this)},removeColumn:{defaultFn:e.bind("_defRemoveColumnFn",this)},moveColumn:{defaultFn:e.bind("_defMoveColumnFn",this)},modifyColumn:{defaultFn:e.bind("_defModifyColumnFn",this)}})}}),f.prototype.addRows=f.prototype.addRow,r.isFunction(e.DataTable)&&e.Base.mix(e.DataTable,[f])},"3.7.2",{requires:["datatable-base"]});+YUI.add("datatable-mutable",function(e,t){var n=e.Array,r=e.Lang,i=r.isString,s=r.isArray,o=r.isObject,u=r.isNumber,a=e.Array.indexOf,f;e.namespace("DataTable").Mutable=f=function(){},f.ATTRS={autoSync:{value:!1,validator:r.isBoolean}},e.mix(f.prototype,{addColumn:function(e,t){i(e)&&(e={key:e});if(e){if(arguments.length<2||!u(t)&&!s(t))t=this.get("columns").length;this.fire("addColumn",{column:e,index:t})}return this},modifyColumn:function(e,t){return i(t)&&(t={key:t}),o(t)&&this.fire("modifyColumn",{column:e,newColumnDef:t}),this},moveColumn:function(e,t){return e!==undefined&&(u(t)||s(t))&&this.fire("moveColumn",{column:e,index:t}),this},removeColumn:function(e){return e!==undefined&&this.fire("removeColumn",{column:e}),this},addRow:function(e,t){var r=t&&"sync"in t?t.sync:this.get("autoSync"),i,s,o,u,a;if(e&&this.data){i=this.data.add.apply(this.data,arguments);if(r){i=n(i),a=n(arguments,1,!0);for(o=0,u=i.length;o<u;++o)s=i[o],s.isNew()&&i[o].save.apply(i[o],a)}}return this},removeRow:function(e,t){var r=this.data,i=t&&"sync"in t?t.sync:this.get("autoSync"),s,u,a,f,l;o(e)&&e instanceof this.get("recordType")?u=e:r&&e!==undefined&&(u=r.getById(e)||r.getByClientId(e)||r.item(e));if(u){l=n(arguments,1,!0),s=r.remove.apply(r,[u].concat(l));if(i){o(l[0])||l.unshift({}),l[0]["delete"]=!0,s=n(s);for(a=0,f=s.length;a<f;++a)u=s[a],u.destroy.apply(u,l)}}return this},modifyRow:function(e,t,r){var i=this.data,s=r&&"sync"in r?r.sync:this.get("autoSync"),u,a;return o(e)&&e instanceof this.get("recordType")?u=e:i&&e!==undefined&&(u=i.getById(e)||i.getByClientId(e)||i.item(e)),u&&o(t)&&(a=n(arguments,1,!0),u.setAttrs.apply(u,a),s&&!u.isNew()&&u.save.apply(u,a)),this},_defAddColumnFn:function(e){var t=n(e.index),r=this.get("columns"),i=r,s,o;for(s=0,o=t.length-1;i&&s<o;++s)i=i[t[s]]&&i[t[s]].children;i&&(i.splice(t[s],0,e.column),this.set("columns",r,{originEvent:e}))},_defModifyColumnFn:function(t){var n=this.get("columns"),r=this.getColumn(t.column);r&&(e.mix(r,t.newColumnDef,!0),this.set("columns",n,{originEvent:t}))},_defMoveColumnFn:function(e){var t=this.get("columns"),r=this.getColumn(e.column),i=n(e.index),s,o,u,f,l;if(r){s=r._parent?r._parent.children:t,o=a(s,r);if(o>-1){u=t;for(f=0,l=i.length-1;u&&f<l;++f)u=u[i[f]]&&u[i[f]].children;u&&(l=u.length,s.splice(o,1),i=i[f],l>u.lenth&&o<i&&i--,u.splice(i,0,r),this.set("columns",t,{originEvent:e}))}}},_defRemoveColumnFn:function(t){var n=this.get("columns"),r=this.getColumn(t.column),i,s;r&&(i=r._parent?r._parent.children:n,s=e.Array.indexOf(i,r),s>-1&&(i.splice(s,1),this.set("columns",n,{originEvent:t})))},initializer:function(){this.publish({addColumn:{defaultFn:e.bind("_defAddColumnFn",this)},removeColumn:{defaultFn:e.bind("_defRemoveColumnFn",this)},moveColumn:{defaultFn:e.bind("_defMoveColumnFn",this)},modifyColumn:{defaultFn:e.bind("_defModifyColumnFn",this)}})}}),f.prototype.addRows=f.prototype.addRow,r.isFunction(e.DataTable)&&e.Base.mix(e.DataTable,[f])},"3.7.3",{requires:["datatable-base"]});
bundle/datatable-mutable/datatable-mutable.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -633,4 +633,4 @@ -}, '3.7.2', {"requires": ["datatable-base"]});+}, '3.7.3', {"requires": ["datatable-base"]});
bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/datatable-scroll-deprecated/datatable-scroll-deprecated.js", code: [] };-_yuitest_coverage["/build/datatable-scroll-deprecated/datatable-scroll-deprecated.js"].code=["YUI.add('datatable-scroll-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","Extends DataTable base to enable x,y, and xy scrolling.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","is designed to work with `datatable-base-deprecated` (effectively the 3.4.1","version of DataTable) and will be removed from the library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-scroll-deprecated","@deprecated","**/","","","var YNode = Y.Node,"," YLang = Y.Lang,"," YUA = Y.UA,"," YgetClassName = Y.ClassNameManager.getClassName,"," DATATABLE = \"datatable\","," CLASS_HEADER = YgetClassName(DATATABLE, \"hd\"),"," CLASS_BODY = YgetClassName(DATATABLE, \"bd\"),"," CLASS_DATA = YgetClassName(DATATABLE, \"data\"),"," CLASS_LINER = YgetClassName(DATATABLE, \"liner\"),"," CLASS_SCROLLABLE = YgetClassName(DATATABLE, \"scrollable\"),"," CONTAINER_HEADER = '<div class=\"'+CLASS_HEADER+'\"></div>',"," CONTAINER_BODY = '<div class=\"'+CLASS_BODY+'\"></div>',"," TEMPLATE_TABLE = '<table></table>',"," scrollbarWidth = Y.cached(function () {"," var testNode = Y.one('body').appendChild('<div style=\"position:absolute;visibility:hidden;overflow:scroll;width:20px;\"><p style=\"height:1px\"/></div>'),"," width = testNode.get('offsetWidth') - testNode.get('clientWidth');",""," testNode.remove(true);",""," return width;"," });"," ","/*"," * Adds scrolling to DataTable."," * @class DataTableScroll"," * @extends Plugin.Base"," */","function DataTableScroll() {"," DataTableScroll.superclass.constructor.apply(this, arguments);","}","","Y.mix(DataTableScroll, {"," NS: \"scroll\",",""," NAME: \"dataTableScroll\",",""," ATTRS: {"," "," /*"," * The width for the table. Set to a string (ex: \"200px\", \"20em\") if you want the table to scroll in the x direction."," *"," * @attribute width"," * @public"," * @type string"," */"," width: {"," value: undefined,"," writeOnce: \"initOnly\""," },"," "," /*"," * The height for the table. Set to a string (ex: \"200px\", \"20em\") if you want the table to scroll in the y-direction."," *"," * @attribute height"," * @public"," * @type string"," */"," height: {"," value: undefined,"," writeOnce: \"initOnly\""," },"," "," "," /*"," * The scrolling direction for the table."," *"," * @attribute scroll"," * @private"," * @type string"," */"," _scroll: {"," //value: 'y',"," valueFn: function() {"," var w = this.get('width'),"," h = this.get('height');"," "," if (w && h) {"," return 'xy';"," }"," else if (w) {"," return 'x';"," }"," else if (h) {"," return 'y';"," }"," else {"," return null;"," }"," }"," },"," "," "," /*"," * The hexadecimal colour value to set on the top-right of the table if a scrollbar exists. "," *"," * @attribute COLOR_COLUMNFILLER"," * @public"," * @type string"," */"," COLOR_COLUMNFILLER: {"," value: '#f2f2f2',"," validator: YLang.isString,"," setter: function(param) {"," if (this._headerContainerNode) {"," this._headerContainerNode.setStyle('backgroundColor', param);"," }"," }"," }"," }","});","","Y.extend(DataTableScroll, Y.Plugin.Base, {"," "," /*"," * The table node created in datatable-base"," *"," * @property _parentTableNode"," * @private"," * @type {Node}"," */"," _parentTableNode: null,"," "," "," /*"," * The THEAD node which resides within the table node created in datatable-base"," *"," * @property _parentTheadNode"," * @private"," * @type {Node}"," */"," _parentTheadNode: null,"," "," "," /*"," * The TBODY node which resides within the table node created in datatable-base"," *"," * @property _parentTbodyNode"," * @private"," * @type {Node}"," */"," _parentTbodyNode: null,"," "," "," /*"," * The TBODY Message node which resides within the table node created in datatable-base"," *"," * @property _parentMsgNode"," * @private"," * @type {Node}"," */"," _parentMsgNode: null,"," "," "," /*"," * The contentBox specified for the datatable in datatable-base"," *"," * @property _parentContainer"," * @private"," * @type {Node}"," */"," _parentContainer: null,"," "," "," /*"," * The DIV node that contains all the scrollable elements (a table with a tbody on it)"," *"," * @property _bodyContainerNode"," * @private"," * @type {Node}"," */"," _bodyContainerNode: null,"," "," "," /*"," * The DIV node that contains a table with a THEAD in it (which syncs its horizontal scroll with the _bodyContainerNode above)"," *"," * @property _headerContainerNode"," * @private"," * @type {Node}"," */"," _headerContainerNode: null,"," "," "," //--------------------------------------"," // Methods"," //--------------------------------------","",""," "," initializer: function(config) {"," var dt = this.get(\"host\");"," this._parentContainer = dt.get('contentBox');"," this._parentContainer.addClass(CLASS_SCROLLABLE);"," this._setUpNodes();"," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // Set up Table Nodes"," //"," /////////////////////////////////////////////////////////////////////////////"," "," /*"," * Set up methods to fire after host methods execute"," *"," * @method _setUpNodes"," * @private"," */ "," _setUpNodes: function() {"," "," this.afterHostMethod(\"_addTableNode\", this._setUpParentTableNode);"," this.afterHostMethod(\"_addTheadNode\", this._setUpParentTheadNode); "," this.afterHostMethod(\"_addTbodyNode\", this._setUpParentTbodyNode);"," this.afterHostMethod(\"_addMessageNode\", this._setUpParentMessageNode);"," //this.beforeHostMethod('renderUI', this._removeCaptionNode);"," this.afterHostMethod(\"renderUI\", this.renderUI);"," this.afterHostMethod(\"bindUI\", this.bindUI);"," this.afterHostMethod(\"syncUI\", this.syncUI);"," "," if (this.get('_scroll') !== 'x') {"," this.afterHostMethod('_attachTheadThNode', this._attachTheadThNode);"," this.afterHostMethod('_attachTbodyTdNode', this._attachTbodyTdNode);"," }"," "," },"," "," /*"," * Stores the main <table> node provided by the host as a private property"," *"," * @method _setUpParentTableNode"," * @private"," */"," _setUpParentTableNode: function() {"," this._parentTableNode = this.get('host')._tableNode;"," },"," "," "," /*"," * Stores the main <thead> node provided by the host as a private property"," *"," * @method _setUpParentTheadNode"," * @private"," */"," _setUpParentTheadNode: function() {"," this._parentTheadNode = this.get('host')._theadNode;"," },"," "," /*"," * Stores the main <tbody> node provided by the host as a private property"," *"," * @method _setUpParentTbodyNode"," * @private"," */"," _setUpParentTbodyNode: function() {"," this._parentTbodyNode = this.get('host')._tbodyNode;"," },"," "," "," /*"," * Stores the main <tbody> message node provided by the host as a private property"," *"," * @method _setUpParentMessageNode"," * @private"," */"," _setUpParentMessageNode: function() {"," this._parentMsgNode = this.get('host')._msgNode;"," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // Renderer"," //"," /////////////////////////////////////////////////////////////////////////////"," "," /*"," * Primary rendering method that takes the datatable rendered in"," * the host, and splits it up into two separate <divs> each containing two "," * separate tables (one containing the head and one containing the body). "," * This method fires after renderUI is called on datatable-base."," * "," * @method renderUI"," */"," renderUI: function() {"," //Y.Profiler.start('render');"," this._createBodyContainer();"," this._createHeaderContainer();"," this._setContentBoxDimensions();"," //Y.Profiler.stop('render');"," //console.log(Y.Profiler.getReport(\"render\"));"," },"," "," /*"," Binds event subscriptions to keep the state and UI in sync",""," @method bindUI"," **/"," bindUI: function () {"," // FIXME: I don't know why the string bind, but I don't want to break"," // stuff until I have time to rebuild it properly"," this._bodyContainerNode.on('scroll', Y.bind(\"_onScroll\", this));",""," this.afterHostEvent(\"recordsetChange\", this.syncUI);"," this.afterHostEvent(\"recordset:recordsChange\", this.syncUI);"," },",""," /*"," * Post rendering method that is responsible for creating a column"," * filler, and performing width and scroll synchronization between the <th> "," * elements and the <td> elements."," * This method fires after syncUI is called on datatable-base"," * "," * @method syncUI"," * @public"," */"," syncUI: function() {"," //Y.Profiler.start('sync');"," this._removeCaptionNode();"," this._syncWidths();"," this._syncScroll();"," //Y.Profiler.stop('sync');"," //console.log(Y.Profiler.getReport(\"sync\"));"," "," },"," "," /*"," * Remove the caption created in base. Scrolling datatables dont support captions."," * "," * @method _removeCaptionNode"," * @private"," */"," _removeCaptionNode: function() {"," this.get('host')._captionNode.remove();"," //Y.DataTable.Base.prototype.createCaption = function(v) {/*do nothing*/};"," //Y.DataTable.Base.prototype._uiSetCaption = function(v) {/*do nothing*/};"," },",""," /*"," * Adjusts the width of the TH and the TDs to make sure that the two are in sync"," * "," * Implementation Details: "," * Compares the width of the TH liner div to the the width of the TD node."," * The TD liner width is not actually used because the TD often stretches"," * past the liner if the parent DIV is very large. Measuring the TD width"," * is more accurate."," * "," * Instead of measuring via .get('width'), 'clientWidth' is used, as it"," * returns a number, whereas 'width' returns a string, In IE6,"," * 'clientWidth' is not supported, so 'offsetWidth' is used. 'offsetWidth'"," * is not as accurate on Chrome,FF as 'clientWidth' - thus the need for"," * the fork."," * "," * @method _syncWidths"," * @private"," */"," _syncWidths: function() {"," var headerTable = this._parentContainer.one('.' + CLASS_HEADER),"," bodyTable = this._parentContainer.one('.' + CLASS_BODY),"," // nodelist of all the THs"," headers = headerTable.all('thead .' + CLASS_LINER),"," // nodelist of the TDs in the first row"," firstRow = bodyTable.one('.' + CLASS_DATA + ' tr'),"," cells = firstRow && firstRow.all('.' + CLASS_LINER),"," // FIXME: Code smell"," widthProperty = (YUA.ie) ? 'offsetWidth' : 'clientWidth';",""," //stylesheet = new YStyleSheet('columnsSheet'),"," //className;"," "," // If there are data rows, iterate each header and the cells of the"," // first row comparing cell widths. Assign the larger width to the"," // narrower node (header or cell)."," if (cells && cells.size()) {"," headers.each(function (header, i) {"," var cell = cells.item(i),"," headerWidth = header.get(widthProperty),"," cellWidth = cell.get(widthProperty),"," width = Math.max(headerWidth, cellWidth);",""," width -= (parseInt(header.getComputedStyle('paddingLeft'),10)|0) +"," (parseInt(header.getComputedStyle('paddingRight'),10)|0);"," "," header.setStyle('width', width + 'px');"," cell.setStyle('width', width + 'px');"," });"," }"," /*"," // If browser is not IE - get the clientWidth of the Liner"," // div and the TD."," // Note: We are not getting the width of the TDLiner, we"," // are getting the width of the actual cell. Why? Because"," // when the table is set to auto width, the cell will grow"," // to try to fit the table in its container. The liner"," // could potentially be much smaller than the cell width."," // TODO: Explore if there is a better way using only LINERS"," // widths - I don't think this should be a problem, given"," // that the liner is a div, a block element and will"," // expand to width."," if (!ie) {"," // TODO: this should actually be done with"," // getComputedStyle('width') but this messes up"," // columns. Explore this option."," thWidth = thLiner.get('clientWidth');"," tdWidth = td.item(i).get('clientWidth');"," } else {"," // IE wasn't recognizing clientWidths, so we are using"," // offsetWidths."," // TODO: should use getComputedStyle('width') because"," // offsetWidth will screw up when padding is changed."," // TODO: for some reason, using"," // tdLiner.get('clientWidth') doesn't work - why not?"," thWidth = thLiner.get('offsetWidth');"," tdWidth = td.item(i).get('offsetWidth');"," //thWidth = parseFloat(thLiner.getComputedStyle('width').split('px')[0]);"," //tdWidth = parseFloat(td.item(i).getComputedStyle('width').split('px')[0]);"," }"," "," // expand the TH or the TD to match the wider"," if (thWidth > tdWidth) {"," tdLiner.setStyle('width', (thWidth - 20 + 'px'));"," //thLiner.setStyle('width', (tdWidth - 20 + 'px'));"," //stylesheet.set(className,{'width': (thWidth - 20 + 'px')});"," } else if (tdWidth > thWidth) {"," // if you don't set an explicit width here, when the width"," // is set in line 368, it will auto-shrink the widths of"," // the other cells (because they dont have an explicit"," // width)"," thLiner.setStyle('width', (tdWidth - 20 + 'px'));"," tdLiner.setStyle('width', (tdWidth - 20 + 'px'));"," //stylesheet.set(className,{'width': (tdWidth - 20 + 'px')});"," }"," "," //}",""," }"," */"," "," //stylesheet.enable();",""," },"," "," /*"," * Adds the approriate width to the liner divs of the TH nodes before they are appended to DOM"," *"," * @method _attachTheadThNode"," * @private"," */"," _attachTheadThNode: function(o) {"," var width = o.column.get('width');"," "," if (width) {"," o.th.one('.' + CLASS_LINER)"," .setStyles({"," width: width,"," overflow:'hidden'"," });"," }"," },"," "," /*"," * Adds the appropriate width to the liner divs of the TD nodes before they are appended to DOM"," *"," * @method _attachTbodyTdNode"," * @private"," */"," _attachTbodyTdNode: function(o) {"," var width = o.column.get('width');"," "," if (width) {"," o.td.one('.' + CLASS_LINER)"," .setStyles({"," width: width,"," overflow: 'hidden'"," });"," }"," },"," "," /*"," * Creates the body DIV that contains all the data. "," *"," * @method _createBodyContainer"," * @private"," */"," _createBodyContainer: function() {"," var bd = YNode.create(CONTAINER_BODY);"," "," this._bodyContainerNode = bd; "," this._setStylesForTbody();"," "," bd.appendChild(this._parentTableNode);"," this._parentContainer.appendChild(bd);"," },"," "," /*"," * Creates the DIV that contains a <table> with all the headers. "," *"," * @method _createHeaderContainer"," * @private"," */"," _createHeaderContainer: function() {"," var hd = YNode.create(CONTAINER_HEADER),"," tbl = YNode.create(TEMPLATE_TABLE);"," "," this._headerContainerNode = hd;"," "," //hd.setStyle('backgroundColor',this.get(\"COLOR_COLUMNFILLER\"));"," this._setStylesForThead();"," tbl.appendChild(this._parentTheadNode);"," hd.appendChild(tbl);"," this._parentContainer.prepend(hd);"," "," },"," "," /*"," * Creates styles for the TBODY based on what type of table it is."," *"," * @method _setStylesForTbody"," * @private"," */"," _setStylesForTbody: function() {"," var dir = this.get('_scroll'),"," w = this.get('width') || \"\","," h = this.get('height') || \"\","," el = this._bodyContainerNode,"," styles = {width:\"\", height:h};"," "," if (dir === 'x') {"," //X-Scrolling tables should not have a Y-Scrollbar so overflow-y is hidden. THe width on x-scrolling tables must be set by user."," styles.overflowY = 'hidden';"," styles.width = w;"," } else if (dir === 'y') {"," //Y-Scrolling tables should not have a X-Scrollbar so overflow-x is hidden. The width isn't neccessary because it can be auto."," styles.overflowX = 'hidden';"," } else if (dir === 'xy') {"," styles.width = w;"," } else {"," //scrolling is set to 'null' - ie: width and height are not set. Don't have any type of scrolling."," styles.overflowX = 'hidden';"," styles.overflowY = 'hidden';"," styles.width = w;"," }"," "," el.setStyles(styles);"," return el;"," },"," "," "," /*"," * Creates styles for the THEAD based on what type of datatable it is."," *"," * @method _setStylesForThead"," * @private"," */"," _setStylesForThead: function() {"," var w = this.get('width') || \"\","," el = this._headerContainerNode;"," "," //if (dir !== 'y') {"," el.setStyles({'width': w, 'overflow': 'hidden'});"," // }"," },"," "," /*"," * Sets an auto width on the content box if it doesn't exist or if its a y-datatable."," *"," * @method _setContentBoxDimensions"," * @private"," */"," _setContentBoxDimensions: function() {"," "," if (this.get('_scroll') === 'y' || (!this.get('width'))) {"," this._parentContainer.setStyle('width', 'auto');"," }"," "," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // Scroll Syncing"," //"," /////////////////////////////////////////////////////////////////////////////"," "," /*"," * Ensures that scrolling is synced across the two tables"," *"," * @method _onScroll"," * @private"," */"," _onScroll: function() {"," this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft'));"," },"," "," /*"," * Syncs padding around scrollable tables, including Column header right-padding"," * and container width and height."," *"," * @method _syncScroll"," * @private "," */"," _syncScroll : function() {"," this._syncScrollX();"," this._syncScrollY();"," this._syncScrollOverhang();"," if (YUA.opera) {"," // Bug 1925874"," this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft'));"," "," if(!this.get(\"width\")) {"," // Bug 1926125"," document.body.style += '';"," }"," }"," },"," "," /*"," * Snaps container width for y-scrolling tables."," *"," * @method _syncScrollY"," * @private"," */"," _syncScrollY : function() {"," var tBody = this._parentTbodyNode,"," tBodyContainer = this._bodyContainerNode,"," w;"," // X-scrolling not enabled"," if(!this.get(\"width\")) {"," // Snap outer container width to content"," w = (tBodyContainer.get('scrollHeight') > tBodyContainer.get('clientHeight')) ?"," // but account for y-scrollbar since it is visible"," (tBody.get('parentNode').get('clientWidth') + scrollbarWidth()) + \"px\" :"," // no y-scrollbar, just borders"," (tBody.get('parentNode').get('clientWidth') + 2) + \"px\";"," this._parentContainer.setStyle('width', w);"," }"," },"," "," /*"," * Snaps container height for x-scrolling tables in IE. Syncs message TBODY width. "," * Taken from YUI2 ScrollingDataTable.js"," *"," * @method _syncScrollX"," * @private"," */"," _syncScrollX: function() {"," var tBody = this._parentTbodyNode,"," tBodyContainer = this._bodyContainerNode,"," w;",""," this._headerContainerNode.set('scrollLeft',"," this._bodyContainerNode.get('scrollLeft'));"," "," if (!this.get('height') && (YUA.ie)) {"," w = (tBodyContainer.get('scrollWidth') > tBodyContainer.get('offsetWidth')) ?"," (tBody.get('parentNode').get('offsetHeight') + scrollbarWidth()) + \"px\" : "," tBody.get('parentNode').get('offsetHeight') + \"px\";"," "," tBodyContainer.setStyle('height', w);"," }"," "," if (tBody.get('rows').size()) {"," this._parentMsgNode.get('parentNode').setStyle('width', \"\");"," } else {"," this._parentMsgNode.get('parentNode').setStyle('width', this._parentTheadNode.get('parentNode').get('offsetWidth')+'px');"," }"," "," },"," "," /*"," * Adds/removes Column header overhang as necesary."," * Taken from YUI2 ScrollingDataTable.js"," *"," * @method _syncScrollOverhang"," * @private"," */"," _syncScrollOverhang: function() {"," var tBodyContainer = this._bodyContainerNode,"," padding = 1;"," "," //when its both x and y scrolling"," if ((tBodyContainer.get('scrollHeight') > tBodyContainer.get('clientHeight')) || (tBodyContainer.get('scrollWidth') > tBodyContainer.get('clientWidth'))) {"," padding = 18;"," }"," "," this._setOverhangValue(padding);"," "," // After the widths have synced, there is a wrapping issue in the"," // headerContainer in IE6. The header does not span the full length of"," // the table (does not cover all of the y-scrollbar). By adding this"," // line in when there is a y-scroll, the header will span correctly."," // TODO: this should not really occur on this.get('_scroll') === y - it"," // should occur when scrollHeight > clientHeight, but clientHeight is"," // not getting recognized in IE6?"," if (YUA.ie !== 0 && this.get('_scroll') === 'y' && this._bodyContainerNode.get('scrollHeight') > this._bodyContainerNode.get('offsetHeight'))"," {"," this._headerContainerNode.setStyle('width', this._parentContainer.get('width'));"," }"," },"," "," "," /*"," * Sets Column header overhang to given width."," * Taken from YUI2 ScrollingDataTable.js with minor modifications"," *"," * @method _setOverhangValue"," * @param nBorderWidth {Number} Value of new border for overhang. "," * @private"," */ "," _setOverhangValue: function(borderWidth) {"," var host = this.get('host'),"," cols = host.get('columnset').get('definitions'),"," //lastHeaders = cols[cols.length-1] || [],"," len = cols.length,"," value = borderWidth + \"px solid \" + this.get(\"COLOR_COLUMNFILLER\"),"," children = YNode.all('#'+this._parentContainer.get('id')+ ' .' + CLASS_HEADER + ' table thead th');",""," children.item(len-1).setStyle('borderRight', value);"," }"," ","});","","Y.namespace(\"Plugin\").DataTableScroll = DataTableScroll;","","","}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin']});"];+_yuitest_coverage["/build/datatable-scroll-deprecated/datatable-scroll-deprecated.js"].code=["YUI.add('datatable-scroll-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","Extends DataTable base to enable x,y, and xy scrolling.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","is designed to work with `datatable-base-deprecated` (effectively the 3.4.1","version of DataTable) and will be removed from the library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-scroll-deprecated","@deprecated","**/","","","var YNode = Y.Node,"," YLang = Y.Lang,"," YUA = Y.UA,"," YgetClassName = Y.ClassNameManager.getClassName,"," DATATABLE = \"datatable\","," CLASS_HEADER = YgetClassName(DATATABLE, \"hd\"),"," CLASS_BODY = YgetClassName(DATATABLE, \"bd\"),"," CLASS_DATA = YgetClassName(DATATABLE, \"data\"),"," CLASS_LINER = YgetClassName(DATATABLE, \"liner\"),"," CLASS_SCROLLABLE = YgetClassName(DATATABLE, \"scrollable\"),"," CONTAINER_HEADER = '<div class=\"'+CLASS_HEADER+'\"></div>',"," CONTAINER_BODY = '<div class=\"'+CLASS_BODY+'\"></div>',"," TEMPLATE_TABLE = '<table></table>',"," scrollbarWidth = Y.cached(function () {"," var testNode = Y.one('body').appendChild('<div style=\"position:absolute;visibility:hidden;overflow:scroll;width:20px;\"><p style=\"height:1px\"/></div>'),"," width = testNode.get('offsetWidth') - testNode.get('clientWidth');",""," testNode.remove(true);",""," return width;"," });"," ","/*"," * Adds scrolling to DataTable."," * @class DataTableScroll"," * @extends Plugin.Base"," */","function DataTableScroll() {"," DataTableScroll.superclass.constructor.apply(this, arguments);","}","","Y.mix(DataTableScroll, {"," NS: \"scroll\",",""," NAME: \"dataTableScroll\",",""," ATTRS: {"," "," /*"," * The width for the table. Set to a string (ex: \"200px\", \"20em\") if you want the table to scroll in the x direction."," *"," * @attribute width"," * @public"," * @type string"," */"," width: {"," value: undefined,"," writeOnce: \"initOnly\""," },"," "," /*"," * The height for the table. Set to a string (ex: \"200px\", \"20em\") if you want the table to scroll in the y-direction."," *"," * @attribute height"," * @public"," * @type string"," */"," height: {"," value: undefined,"," writeOnce: \"initOnly\""," },"," "," "," /*"," * The scrolling direction for the table."," *"," * @attribute scroll"," * @private"," * @type string"," */"," _scroll: {"," //value: 'y',"," valueFn: function() {"," var w = this.get('width'),"," h = this.get('height');"," "," if (w && h) {"," return 'xy';"," }"," else if (w) {"," return 'x';"," }"," else if (h) {"," return 'y';"," }"," else {"," return null;"," }"," }"," },"," "," "," /*"," * The hexadecimal colour value to set on the top-right of the table if a scrollbar exists. "," *"," * @attribute COLOR_COLUMNFILLER"," * @public"," * @type string"," */"," COLOR_COLUMNFILLER: {"," value: '#f2f2f2',"," validator: YLang.isString,"," setter: function(param) {"," if (this._headerContainerNode) {"," this._headerContainerNode.setStyle('backgroundColor', param);"," }"," }"," }"," }","});","","Y.extend(DataTableScroll, Y.Plugin.Base, {"," "," /*"," * The table node created in datatable-base"," *"," * @property _parentTableNode"," * @private"," * @type {Node}"," */"," _parentTableNode: null,"," "," "," /*"," * The THEAD node which resides within the table node created in datatable-base"," *"," * @property _parentTheadNode"," * @private"," * @type {Node}"," */"," _parentTheadNode: null,"," "," "," /*"," * The TBODY node which resides within the table node created in datatable-base"," *"," * @property _parentTbodyNode"," * @private"," * @type {Node}"," */"," _parentTbodyNode: null,"," "," "," /*"," * The TBODY Message node which resides within the table node created in datatable-base"," *"," * @property _parentMsgNode"," * @private"," * @type {Node}"," */"," _parentMsgNode: null,"," "," "," /*"," * The contentBox specified for the datatable in datatable-base"," *"," * @property _parentContainer"," * @private"," * @type {Node}"," */"," _parentContainer: null,"," "," "," /*"," * The DIV node that contains all the scrollable elements (a table with a tbody on it)"," *"," * @property _bodyContainerNode"," * @private"," * @type {Node}"," */"," _bodyContainerNode: null,"," "," "," /*"," * The DIV node that contains a table with a THEAD in it (which syncs its horizontal scroll with the _bodyContainerNode above)"," *"," * @property _headerContainerNode"," * @private"," * @type {Node}"," */"," _headerContainerNode: null,"," "," "," //--------------------------------------"," // Methods"," //--------------------------------------","",""," "," initializer: function(config) {"," var dt = this.get(\"host\");"," this._parentContainer = dt.get('contentBox');"," this._parentContainer.addClass(CLASS_SCROLLABLE);"," this._setUpNodes();"," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // Set up Table Nodes"," //"," /////////////////////////////////////////////////////////////////////////////"," "," /*"," * Set up methods to fire after host methods execute"," *"," * @method _setUpNodes"," * @private"," */ "," _setUpNodes: function() {"," "," this.afterHostMethod(\"_addTableNode\", this._setUpParentTableNode);"," this.afterHostMethod(\"_addTheadNode\", this._setUpParentTheadNode); "," this.afterHostMethod(\"_addTbodyNode\", this._setUpParentTbodyNode);"," this.afterHostMethod(\"_addMessageNode\", this._setUpParentMessageNode);"," //this.beforeHostMethod('renderUI', this._removeCaptionNode);"," this.afterHostMethod(\"renderUI\", this.renderUI);"," this.afterHostMethod(\"bindUI\", this.bindUI);"," this.afterHostMethod(\"syncUI\", this.syncUI);"," "," if (this.get('_scroll') !== 'x') {"," this.afterHostMethod('_attachTheadThNode', this._attachTheadThNode);"," this.afterHostMethod('_attachTbodyTdNode', this._attachTbodyTdNode);"," }"," "," },"," "," /*"," * Stores the main <table> node provided by the host as a private property"," *"," * @method _setUpParentTableNode"," * @private"," */"," _setUpParentTableNode: function() {"," this._parentTableNode = this.get('host')._tableNode;"," },"," "," "," /*"," * Stores the main <thead> node provided by the host as a private property"," *"," * @method _setUpParentTheadNode"," * @private"," */"," _setUpParentTheadNode: function() {"," this._parentTheadNode = this.get('host')._theadNode;"," },"," "," /*"," * Stores the main <tbody> node provided by the host as a private property"," *"," * @method _setUpParentTbodyNode"," * @private"," */"," _setUpParentTbodyNode: function() {"," this._parentTbodyNode = this.get('host')._tbodyNode;"," },"," "," "," /*"," * Stores the main <tbody> message node provided by the host as a private property"," *"," * @method _setUpParentMessageNode"," * @private"," */"," _setUpParentMessageNode: function() {"," this._parentMsgNode = this.get('host')._msgNode;"," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // Renderer"," //"," /////////////////////////////////////////////////////////////////////////////"," "," /*"," * Primary rendering method that takes the datatable rendered in"," * the host, and splits it up into two separate <divs> each containing two "," * separate tables (one containing the head and one containing the body). "," * This method fires after renderUI is called on datatable-base."," * "," * @method renderUI"," */"," renderUI: function() {"," //Y.Profiler.start('render');"," this._createBodyContainer();"," this._createHeaderContainer();"," this._setContentBoxDimensions();"," //Y.Profiler.stop('render');"," //console.log(Y.Profiler.getReport(\"render\"));"," },"," "," /*"," Binds event subscriptions to keep the state and UI in sync",""," @method bindUI"," **/"," bindUI: function () {"," // FIXME: I don't know why the string bind, but I don't want to break"," // stuff until I have time to rebuild it properly"," this._bodyContainerNode.on('scroll', Y.bind(\"_onScroll\", this));",""," this.afterHostEvent(\"recordsetChange\", this.syncUI);"," this.afterHostEvent(\"recordset:recordsChange\", this.syncUI);"," },",""," /*"," * Post rendering method that is responsible for creating a column"," * filler, and performing width and scroll synchronization between the <th> "," * elements and the <td> elements."," * This method fires after syncUI is called on datatable-base"," * "," * @method syncUI"," * @public"," */"," syncUI: function() {"," //Y.Profiler.start('sync');"," this._removeCaptionNode();"," this._syncWidths();"," this._syncScroll();"," //Y.Profiler.stop('sync');"," //console.log(Y.Profiler.getReport(\"sync\"));"," "," },"," "," /*"," * Remove the caption created in base. Scrolling datatables dont support captions."," * "," * @method _removeCaptionNode"," * @private"," */"," _removeCaptionNode: function() {"," this.get('host')._captionNode.remove();"," //Y.DataTable.Base.prototype.createCaption = function(v) {/*do nothing*/};"," //Y.DataTable.Base.prototype._uiSetCaption = function(v) {/*do nothing*/};"," },",""," /*"," * Adjusts the width of the TH and the TDs to make sure that the two are in sync"," * "," * Implementation Details: "," * Compares the width of the TH liner div to the the width of the TD node."," * The TD liner width is not actually used because the TD often stretches"," * past the liner if the parent DIV is very large. Measuring the TD width"," * is more accurate."," * "," * Instead of measuring via .get('width'), 'clientWidth' is used, as it"," * returns a number, whereas 'width' returns a string, In IE6,"," * 'clientWidth' is not supported, so 'offsetWidth' is used. 'offsetWidth'"," * is not as accurate on Chrome,FF as 'clientWidth' - thus the need for"," * the fork."," * "," * @method _syncWidths"," * @private"," */"," _syncWidths: function() {"," var headerTable = this._parentContainer.one('.' + CLASS_HEADER),"," bodyTable = this._parentContainer.one('.' + CLASS_BODY),"," // nodelist of all the THs"," headers = headerTable.all('thead .' + CLASS_LINER),"," // nodelist of the TDs in the first row"," firstRow = bodyTable.one('.' + CLASS_DATA + ' tr'),"," cells = firstRow && firstRow.all('.' + CLASS_LINER),"," // FIXME: Code smell"," widthProperty = (YUA.ie) ? 'offsetWidth' : 'clientWidth';",""," //stylesheet = new YStyleSheet('columnsSheet'),"," //className;"," "," // If there are data rows, iterate each header and the cells of the"," // first row comparing cell widths. Assign the larger width to the"," // narrower node (header or cell)."," if (cells && cells.size()) {"," headers.each(function (header, i) {"," var cell = cells.item(i),"," headerWidth = header.get(widthProperty),"," cellWidth = cell.get(widthProperty),"," width = Math.max(headerWidth, cellWidth);",""," width -= (parseInt(header.getComputedStyle('paddingLeft'),10)|0) +"," (parseInt(header.getComputedStyle('paddingRight'),10)|0);"," "," header.setStyle('width', width + 'px');"," cell.setStyle('width', width + 'px');"," });"," }"," /*"," // If browser is not IE - get the clientWidth of the Liner"," // div and the TD."," // Note: We are not getting the width of the TDLiner, we"," // are getting the width of the actual cell. Why? Because"," // when the table is set to auto width, the cell will grow"," // to try to fit the table in its container. The liner"," // could potentially be much smaller than the cell width."," // TODO: Explore if there is a better way using only LINERS"," // widths - I don't think this should be a problem, given"," // that the liner is a div, a block element and will"," // expand to width."," if (!ie) {"," // TODO: this should actually be done with"," // getComputedStyle('width') but this messes up"," // columns. Explore this option."," thWidth = thLiner.get('clientWidth');"," tdWidth = td.item(i).get('clientWidth');"," } else {"," // IE wasn't recognizing clientWidths, so we are using"," // offsetWidths."," // TODO: should use getComputedStyle('width') because"," // offsetWidth will screw up when padding is changed."," // TODO: for some reason, using"," // tdLiner.get('clientWidth') doesn't work - why not?"," thWidth = thLiner.get('offsetWidth');"," tdWidth = td.item(i).get('offsetWidth');"," //thWidth = parseFloat(thLiner.getComputedStyle('width').split('px')[0]);"," //tdWidth = parseFloat(td.item(i).getComputedStyle('width').split('px')[0]);"," }"," "," // expand the TH or the TD to match the wider"," if (thWidth > tdWidth) {"," tdLiner.setStyle('width', (thWidth - 20 + 'px'));"," //thLiner.setStyle('width', (tdWidth - 20 + 'px'));"," //stylesheet.set(className,{'width': (thWidth - 20 + 'px')});"," } else if (tdWidth > thWidth) {"," // if you don't set an explicit width here, when the width"," // is set in line 368, it will auto-shrink the widths of"," // the other cells (because they dont have an explicit"," // width)"," thLiner.setStyle('width', (tdWidth - 20 + 'px'));"," tdLiner.setStyle('width', (tdWidth - 20 + 'px'));"," //stylesheet.set(className,{'width': (tdWidth - 20 + 'px')});"," }"," "," //}",""," }"," */"," "," //stylesheet.enable();",""," },"," "," /*"," * Adds the approriate width to the liner divs of the TH nodes before they are appended to DOM"," *"," * @method _attachTheadThNode"," * @private"," */"," _attachTheadThNode: function(o) {"," var width = o.column.get('width');"," "," if (width) {"," o.th.one('.' + CLASS_LINER)"," .setStyles({"," width: width,"," overflow:'hidden'"," });"," }"," },"," "," /*"," * Adds the appropriate width to the liner divs of the TD nodes before they are appended to DOM"," *"," * @method _attachTbodyTdNode"," * @private"," */"," _attachTbodyTdNode: function(o) {"," var width = o.column.get('width');"," "," if (width) {"," o.td.one('.' + CLASS_LINER)"," .setStyles({"," width: width,"," overflow: 'hidden'"," });"," }"," },"," "," /*"," * Creates the body DIV that contains all the data. "," *"," * @method _createBodyContainer"," * @private"," */"," _createBodyContainer: function() {"," var bd = YNode.create(CONTAINER_BODY);"," "," this._bodyContainerNode = bd; "," this._setStylesForTbody();"," "," bd.appendChild(this._parentTableNode);"," this._parentContainer.appendChild(bd);"," },"," "," /*"," * Creates the DIV that contains a <table> with all the headers. "," *"," * @method _createHeaderContainer"," * @private"," */"," _createHeaderContainer: function() {"," var hd = YNode.create(CONTAINER_HEADER),"," tbl = YNode.create(TEMPLATE_TABLE);"," "," this._headerContainerNode = hd;"," "," //hd.setStyle('backgroundColor',this.get(\"COLOR_COLUMNFILLER\"));"," this._setStylesForThead();"," tbl.appendChild(this._parentTheadNode);"," hd.appendChild(tbl);"," this._parentContainer.prepend(hd);"," "," },"," "," /*"," * Creates styles for the TBODY based on what type of table it is."," *"," * @method _setStylesForTbody"," * @private"," */"," _setStylesForTbody: function() {"," var dir = this.get('_scroll'),"," w = this.get('width') || \"\","," h = this.get('height') || \"\","," el = this._bodyContainerNode,"," styles = {width:\"\", height:h};"," "," if (dir === 'x') {"," //X-Scrolling tables should not have a Y-Scrollbar so overflow-y is hidden. THe width on x-scrolling tables must be set by user."," styles.overflowY = 'hidden';"," styles.width = w;"," } else if (dir === 'y') {"," //Y-Scrolling tables should not have a X-Scrollbar so overflow-x is hidden. The width isn't neccessary because it can be auto."," styles.overflowX = 'hidden';"," } else if (dir === 'xy') {"," styles.width = w;"," } else {"," //scrolling is set to 'null' - ie: width and height are not set. Don't have any type of scrolling."," styles.overflowX = 'hidden';"," styles.overflowY = 'hidden';"," styles.width = w;"," }"," "," el.setStyles(styles);"," return el;"," },"," "," "," /*"," * Creates styles for the THEAD based on what type of datatable it is."," *"," * @method _setStylesForThead"," * @private"," */"," _setStylesForThead: function() {"," var w = this.get('width') || \"\","," el = this._headerContainerNode;"," "," //if (dir !== 'y') {"," el.setStyles({'width': w, 'overflow': 'hidden'});"," // }"," },"," "," /*"," * Sets an auto width on the content box if it doesn't exist or if its a y-datatable."," *"," * @method _setContentBoxDimensions"," * @private"," */"," _setContentBoxDimensions: function() {"," "," if (this.get('_scroll') === 'y' || (!this.get('width'))) {"," this._parentContainer.setStyle('width', 'auto');"," }"," "," },"," "," /////////////////////////////////////////////////////////////////////////////"," //"," // Scroll Syncing"," //"," /////////////////////////////////////////////////////////////////////////////"," "," /*"," * Ensures that scrolling is synced across the two tables"," *"," * @method _onScroll"," * @private"," */"," _onScroll: function() {"," this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft'));"," },"," "," /*"," * Syncs padding around scrollable tables, including Column header right-padding"," * and container width and height."," *"," * @method _syncScroll"," * @private "," */"," _syncScroll : function() {"," this._syncScrollX();"," this._syncScrollY();"," this._syncScrollOverhang();"," if (YUA.opera) {"," // Bug 1925874"," this._headerContainerNode.set('scrollLeft', this._bodyContainerNode.get('scrollLeft'));"," "," if(!this.get(\"width\")) {"," // Bug 1926125"," document.body.style += '';"," }"," }"," },"," "," /*"," * Snaps container width for y-scrolling tables."," *"," * @method _syncScrollY"," * @private"," */"," _syncScrollY : function() {"," var tBody = this._parentTbodyNode,"," tBodyContainer = this._bodyContainerNode,"," w;"," // X-scrolling not enabled"," if(!this.get(\"width\")) {"," // Snap outer container width to content"," w = (tBodyContainer.get('scrollHeight') > tBodyContainer.get('clientHeight')) ?"," // but account for y-scrollbar since it is visible"," (tBody.get('parentNode').get('clientWidth') + scrollbarWidth()) + \"px\" :"," // no y-scrollbar, just borders"," (tBody.get('parentNode').get('clientWidth') + 2) + \"px\";"," this._parentContainer.setStyle('width', w);"," }"," },"," "," /*"," * Snaps container height for x-scrolling tables in IE. Syncs message TBODY width. "," * Taken from YUI2 ScrollingDataTable.js"," *"," * @method _syncScrollX"," * @private"," */"," _syncScrollX: function() {"," var tBody = this._parentTbodyNode,"," tBodyContainer = this._bodyContainerNode,"," w;",""," this._headerContainerNode.set('scrollLeft',"," this._bodyContainerNode.get('scrollLeft'));"," "," if (!this.get('height') && (YUA.ie)) {"," w = (tBodyContainer.get('scrollWidth') > tBodyContainer.get('offsetWidth')) ?"," (tBody.get('parentNode').get('offsetHeight') + scrollbarWidth()) + \"px\" : "," tBody.get('parentNode').get('offsetHeight') + \"px\";"," "," tBodyContainer.setStyle('height', w);"," }"," "," if (tBody.get('rows').size()) {"," this._parentMsgNode.get('parentNode').setStyle('width', \"\");"," } else {"," this._parentMsgNode.get('parentNode').setStyle('width', this._parentTheadNode.get('parentNode').get('offsetWidth')+'px');"," }"," "," },"," "," /*"," * Adds/removes Column header overhang as necesary."," * Taken from YUI2 ScrollingDataTable.js"," *"," * @method _syncScrollOverhang"," * @private"," */"," _syncScrollOverhang: function() {"," var tBodyContainer = this._bodyContainerNode,"," padding = 1;"," "," //when its both x and y scrolling"," if ((tBodyContainer.get('scrollHeight') > tBodyContainer.get('clientHeight')) || (tBodyContainer.get('scrollWidth') > tBodyContainer.get('clientWidth'))) {"," padding = 18;"," }"," "," this._setOverhangValue(padding);"," "," // After the widths have synced, there is a wrapping issue in the"," // headerContainer in IE6. The header does not span the full length of"," // the table (does not cover all of the y-scrollbar). By adding this"," // line in when there is a y-scroll, the header will span correctly."," // TODO: this should not really occur on this.get('_scroll') === y - it"," // should occur when scrollHeight > clientHeight, but clientHeight is"," // not getting recognized in IE6?"," if (YUA.ie !== 0 && this.get('_scroll') === 'y' && this._bodyContainerNode.get('scrollHeight') > this._bodyContainerNode.get('offsetHeight'))"," {"," this._headerContainerNode.setStyle('width', this._parentContainer.get('width'));"," }"," },"," "," "," /*"," * Sets Column header overhang to given width."," * Taken from YUI2 ScrollingDataTable.js with minor modifications"," *"," * @method _setOverhangValue"," * @param nBorderWidth {Number} Value of new border for overhang. "," * @private"," */ "," _setOverhangValue: function(borderWidth) {"," var host = this.get('host'),"," cols = host.get('columnset').get('definitions'),"," //lastHeaders = cols[cols.length-1] || [],"," len = cols.length,"," value = borderWidth + \"px solid \" + this.get(\"COLOR_COLUMNFILLER\"),"," children = YNode.all('#'+this._parentContainer.get('id')+ ' .' + CLASS_HEADER + ' table thead th');",""," children.item(len-1).setStyle('borderRight', value);"," }"," ","});","","Y.namespace(\"Plugin\").DataTableScroll = DataTableScroll;","","","}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin']});"]; _yuitest_coverage["/build/datatable-scroll-deprecated/datatable-scroll-deprecated.js"].lines = {"1":0,"26":0,"40":0,"43":0,"45":0,"53":0,"54":0,"57":0,"99":0,"102":0,"103":0,"105":0,"106":0,"108":0,"109":0,"112":0,"129":0,"130":0,"137":0,"216":0,"217":0,"218":0,"219":0,"236":0,"237":0,"238":0,"239":0,"241":0,"242":0,"243":0,"245":0,"246":0,"247":0,"259":0,"270":0,"280":0,"291":0,"310":0,"311":0,"312":0,"325":0,"327":0,"328":0,"342":0,"343":0,"344":0,"357":0,"381":0,"397":0,"398":0,"399":0,"404":0,"407":0,"408":0,"473":0,"475":0,"476":0,"491":0,"493":0,"494":0,"509":0,"511":0,"512":0,"514":0,"515":0,"525":0,"528":0,"531":0,"532":0,"533":0,"534":0,"545":0,"551":0,"553":0,"554":0,"555":0,"557":0,"558":0,"559":0,"562":0,"563":0,"564":0,"567":0,"568":0,"579":0,"583":0,"595":0,"596":0,"614":0,"625":0,"626":0,"627":0,"628":0,"630":0,"632":0,"634":0,"646":0,"650":0,"652":0,"657":0,"669":0,"673":0,"676":0,"677":0,"681":0,"684":0,"685":0,"687":0,"700":0,"704":0,"705":0,"708":0,"717":0,"719":0,"733":0,"740":0,"745":0}; _yuitest_coverage["/build/datatable-scroll-deprecated/datatable-scroll-deprecated.js"].functions = {"(anonymous 2):39":0,"DataTableScroll:53":0,"valueFn:98":0,"setter:128":0,"initializer:215":0,"_setUpNodes:234":0,"_setUpParentTableNode:258":0,"_setUpParentTheadNode:269":0,"_setUpParentTbodyNode:279":0,"_setUpParentMessageNode:290":0,"renderUI:308":0,"bindUI:322":0,"syncUI:340":0,"_removeCaptionNode:356":0,"(anonymous 3):398":0,"_syncWidths:380":0,"_attachTheadThNode:472":0,"_attachTbodyTdNode:490":0,"_createBodyContainer:508":0,"_createHeaderContainer:524":0,"_setStylesForTbody:544":0,"_setStylesForThead:578":0,"_setContentBoxDimensions:593":0,"_onScroll:613":0,"_syncScroll:624":0,"_syncScrollY:645":0,"_syncScrollX:668":0,"_syncScrollOverhang:699":0,"_setOverhangValue:732":0,"(anonymous 1):1":0}; _yuitest_coverage["/build/datatable-scroll-deprecated/datatable-scroll-deprecated.js"].coveredLines = 117;@@ -931,4 +931,4 @@ Y.namespace("Plugin").DataTableScroll = DataTableScroll; -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin']});
bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -751,4 +751,4 @@ Y.namespace("Plugin").DataTableScroll = DataTableScroll; -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin']});
bundle/datatable-scroll-deprecated/datatable-scroll-deprecated-min.js view
@@ -1,8 +1,8 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("datatable-scroll-deprecated",function(b){var m=b.Node,k=b.Lang,o=b.UA,g=b.ClassNameManager.getClassName,n="datatable",a=g(n,"hd"),e=g(n,"bd"),d=g(n,"data"),l=g(n,"liner"),j=g(n,"scrollable"),i='<div class="'+a+'"></div>',c='<div class="'+e+'"></div>',h="<table></table>",f=b.cached(function(){var q=b.one("body").appendChild('<div style="position:absolute;visibility:hidden;overflow:scroll;width:20px;"><p style="height:1px"/></div>'),r=q.get("offsetWidth")-q.get("clientWidth");q.remove(true);return r;});function p(){p.superclass.constructor.apply(this,arguments);}b.mix(p,{NS:"scroll",NAME:"dataTableScroll",ATTRS:{width:{value:undefined,writeOnce:"initOnly"},height:{value:undefined,writeOnce:"initOnly"},_scroll:{valueFn:function(){var q=this.get("width"),r=this.get("height");if(q&&r){return"xy";}else{if(q){return"x";}else{if(r){return"y";}else{return null;}}}}},COLOR_COLUMNFILLER:{value:"#f2f2f2",validator:k.isString,setter:function(q){if(this._headerContainerNode){this._headerContainerNode.setStyle("backgroundColor",q);}}}}});b.extend(p,b.Plugin.Base,{_parentTableNode:null,_parentTheadNode:null,_parentTbodyNode:null,_parentMsgNode:null,_parentContainer:null,_bodyContainerNode:null,_headerContainerNode:null,initializer:function(q){var r=this.get("host");this._parentContainer=r.get("contentBox");this._parentContainer.addClass(j);this._setUpNodes();},_setUpNodes:function(){this.afterHostMethod("_addTableNode",this._setUpParentTableNode);this.afterHostMethod("_addTheadNode",this._setUpParentTheadNode);this.afterHostMethod("_addTbodyNode",this._setUpParentTbodyNode);this.afterHostMethod("_addMessageNode",this._setUpParentMessageNode);this.afterHostMethod("renderUI",this.renderUI);this.afterHostMethod("bindUI",this.bindUI);this.afterHostMethod("syncUI",this.syncUI);if(this.get("_scroll")!=="x"){this.afterHostMethod("_attachTheadThNode",this._attachTheadThNode);this.afterHostMethod("_attachTbodyTdNode",this._attachTbodyTdNode);}},_setUpParentTableNode:function(){this._parentTableNode=this.get("host")._tableNode;},_setUpParentTheadNode:function(){this._parentTheadNode=this.get("host")._theadNode;},_setUpParentTbodyNode:function(){this._parentTbodyNode=this.get("host")._tbodyNode;},_setUpParentMessageNode:function(){this._parentMsgNode=this.get("host")._msgNode;},renderUI:function(){this._createBodyContainer();this._createHeaderContainer();this._setContentBoxDimensions();},bindUI:function(){this._bodyContainerNode.on("scroll",b.bind("_onScroll",this));this.afterHostEvent("recordsetChange",this.syncUI);this.afterHostEvent("recordset:recordsChange",this.syncUI);},syncUI:function(){this._removeCaptionNode();this._syncWidths();this._syncScroll();},_removeCaptionNode:function(){this.get("host")._captionNode.remove();},_syncWidths:function(){var t=this._parentContainer.one("."+a),q=this._parentContainer.one("."+e),v=t.all("thead ."+l),u=q.one("."+d+" tr"),s=u&&u.all("."+l),r=(o.ie)?"offsetWidth":"clientWidth";if(s&&s.size()){v.each(function(B,y){var w=s.item(y),x=B.get(r),A=w.get(r),z=Math.max(x,A);z-=(parseInt(B.getComputedStyle("paddingLeft"),10)|0)+(parseInt(B.getComputedStyle("paddingRight"),10)|0);B.setStyle("width",z+"px");w.setStyle("width",z+"px");});}},_attachTheadThNode:function(r){var q=r.column.get("width");if(q){r.th.one("."+l).setStyles({width:q,overflow:"hidden"});}},_attachTbodyTdNode:function(r){var q=r.column.get("width");if(q){r.td.one("."+l).setStyles({width:q,overflow:"hidden"});}},_createBodyContainer:function(){var q=m.create(c);this._bodyContainerNode=q;this._setStylesForTbody();q.appendChild(this._parentTableNode);this._parentContainer.appendChild(q);},_createHeaderContainer:function(){var r=m.create(i),q=m.create(h);this._headerContainerNode=r;this._setStylesForThead();q.appendChild(this._parentTheadNode);r.appendChild(q);this._parentContainer.prepend(r);},_setStylesForTbody:function(){var r=this.get("_scroll"),q=this.get("width")||"",t=this.get("height")||"",s=this._bodyContainerNode,u={width:"",height:t};if(r==="x"){u.overflowY="hidden";u.width=q;}else{if(r==="y"){u.overflowX="hidden";}else{if(r==="xy"){u.width=q;}else{u.overflowX="hidden";u.overflowY="hidden";u.width=q;}}}s.setStyles(u);return s;},_setStylesForThead:function(){var q=this.get("width")||"",r=this._headerContainerNode;r.setStyles({"width":q,"overflow":"hidden"});},_setContentBoxDimensions:function(){if(this.get("_scroll")==="y"||(!this.get("width"))){this._parentContainer.setStyle("width","auto");}},_onScroll:function(){this._headerContainerNode.set("scrollLeft",this._bodyContainerNode.get("scrollLeft"));},_syncScroll:function(){this._syncScrollX();this._syncScrollY();this._syncScrollOverhang();if(o.opera){this._headerContainerNode.set("scrollLeft",this._bodyContainerNode.get("scrollLeft"));if(!this.get("width")){document.body.style+="";}}},_syncScrollY:function(){var q=this._parentTbodyNode,s=this._bodyContainerNode,r;if(!this.get("width")){r=(s.get("scrollHeight")>s.get("clientHeight"))?(q.get("parentNode").get("clientWidth")+f())+"px":(q.get("parentNode").get("clientWidth")+2)+"px";this._parentContainer.setStyle("width",r);}},_syncScrollX:function(){var q=this._parentTbodyNode,s=this._bodyContainerNode,r;this._headerContainerNode.set("scrollLeft",this._bodyContainerNode.get("scrollLeft"));if(!this.get("height")&&(o.ie)){r=(s.get("scrollWidth")>s.get("offsetWidth"))?(q.get("parentNode").get("offsetHeight")+f())+"px":q.get("parentNode").get("offsetHeight")+"px";s.setStyle("height",r);}if(q.get("rows").size()){this._parentMsgNode.get("parentNode").setStyle("width","");}else{this._parentMsgNode.get("parentNode").setStyle("width",this._parentTheadNode.get("parentNode").get("offsetWidth")+"px");}},_syncScrollOverhang:function(){var q=this._bodyContainerNode,r=1;if((q.get("scrollHeight")>q.get("clientHeight"))||(q.get("scrollWidth")>q.get("clientWidth"))){r=18;}this._setOverhangValue(r);if(o.ie!==0&&this.get("_scroll")==="y"&&this._bodyContainerNode.get("scrollHeight")>this._bodyContainerNode.get("offsetHeight")){this._headerContainerNode.setStyle("width",this._parentContainer.get("width"));-}},_setOverhangValue:function(r){var t=this.get("host"),v=t.get("columnset").get("definitions"),q=v.length,u=r+"px solid "+this.get("COLOR_COLUMNFILLER"),s=m.all("#"+this._parentContainer.get("id")+" ."+a+" table thead th");s.item(q-1).setStyle("borderRight",u);}});b.namespace("Plugin").DataTableScroll=p;},"3.7.2",{requires:["datatable-base-deprecated","plugin"]});+}},_setOverhangValue:function(r){var t=this.get("host"),v=t.get("columnset").get("definitions"),q=v.length,u=r+"px solid "+this.get("COLOR_COLUMNFILLER"),s=m.all("#"+this._parentContainer.get("id")+" ."+a+" table thead th");s.item(q-1).setStyle("borderRight",u);}});b.namespace("Plugin").DataTableScroll=p;},"3.7.3",{requires:["datatable-base-deprecated","plugin"]});
bundle/datatable-scroll-deprecated/datatable-scroll-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -751,4 +751,4 @@ Y.namespace("Plugin").DataTableScroll = DataTableScroll; -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin']});
bundle/datatable-scroll/assets/datatable-scroll-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-scroll/assets/skins/night/datatable-scroll-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-scroll/assets/skins/night/datatable-scroll.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-scroll/assets/skins/sam/datatable-scroll-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-scroll/assets/skins/sam/datatable-scroll.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-scroll/datatable-scroll-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-scroll/datatable-scroll.js", code: [] };-_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].code=["YUI.add('datatable-scroll', function (Y, NAME) {","","/**","Adds the ability to make the table rows scrollable while preserving the header","placement.","","@module datatable-scroll","@for DataTable","@since 3.5.0","**/","var YLang = Y.Lang,"," isString = YLang.isString,"," isNumber = YLang.isNumber,"," isArray = YLang.isArray,",""," Scrollable;","","// Returns the numeric value portion of the computed style, defaulting to 0","function styleDim(node, style) {"," return parseInt(node.getComputedStyle(style), 10) | 0;","}","","/**","_API docs for this extension are included in the DataTable class._","","Adds the ability to make the table rows scrollable while preserving the header","placement.","","There are two types of scrolling, horizontal (x) and vertical (y). Horizontal","scrolling is achieved by wrapping the entire table in a scrollable container.","Vertical scrolling is achieved by splitting the table headers and data into two","separate tables, the latter of which is wrapped in a vertically scrolling","container. In this case, column widths of header cells and data cells are kept","in sync programmatically.","","Since the split table synchronization can be costly at runtime, the split is only done if the data in the table stretches beyond the configured `height` value.","","To activate or deactivate scrolling, set the `scrollable` attribute to one of","the following values:",""," * `false` - (default) Scrolling is disabled."," * `true` or 'xy' - If `height` is set, vertical scrolling will be activated, if"," `width` is set, horizontal scrolling will be activated."," * 'x' - Activate horizontal scrolling only. Requires the `width` attribute is"," also set."," * 'y' - Activate vertical scrolling only. Requires the `height` attribute is"," also set.","","@class DataTable.Scrollable","@for DataTable","@since 3.5.0","**/","Y.DataTable.Scrollable = Scrollable = function () {};","","Scrollable.ATTRS = {"," /**"," Activates or deactivates scrolling in the table. Acceptable values are:",""," * `false` - (default) Scrolling is disabled."," * `true` or 'xy' - If `height` is set, vertical scrolling will be"," activated, if `width` is set, horizontal scrolling will be activated."," * 'x' - Activate horizontal scrolling only. Requires the `width` attribute"," is also set."," * 'y' - Activate vertical scrolling only. Requires the `height` attribute"," is also set.",""," @attribute scrollable"," @type {String|Boolean}"," @value false"," @since 3.5.0"," **/"," scrollable: {"," value: false,"," setter: '_setScrollable'"," }","};","","Y.mix(Scrollable.prototype, {",""," /**"," Scrolls a given row or cell into view if the table is scrolling. Pass the"," `clientId` of a Model from the DataTable's `data` ModelList or its row"," index to scroll to a row or a [row index, column index] array to scroll to"," a cell. Alternately, to scroll to any element contained within the table's"," scrolling areas, pass its ID, or the Node itself (though you could just as"," well call `node.scrollIntoView()` yourself, but hey, whatever).",""," @method scrollTo"," @param {String|Number|Number[]|Node} id A row clientId, row index, cell"," coordinate array, id string, or Node"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," scrollTo: function (id) {"," var target;",""," if (id && this._tbodyNode && (this._yScrollNode || this._xScrollNode)) {"," if (isArray(id)) {"," target = this.getCell(id);"," } else if (isNumber(id)) { "," target = this.getRow(id);"," } else if (isString(id)) {"," target = this._tbodyNode.one('#' + id);"," } else if (id instanceof Y.Node &&"," // TODO: ancestor(yScrollNode, xScrollNode)"," id.ancestor('.yui3-datatable') === this.get('boundingBox')) {"," target = id;"," }",""," target && target.scrollIntoView();"," }",""," return this;"," },",""," //--------------------------------------------------------------------------"," // Protected properties and methods"," //--------------------------------------------------------------------------",""," /**"," Template for the `<table>` that is used to fix the caption in place when"," the table is horizontally scrolling.",""," @property _CAPTION_TABLE_TEMPLATE"," @type {HTML}"," @value '<table class=\"{className}\" role=\"presentation\"></table>'"," @protected"," @since 3.5.0"," **/"," _CAPTION_TABLE_TEMPLATE: '<table class=\"{className}\" role=\"presentation\"></table>',",""," /**"," Template used to create sizable element liners around header content to"," synchronize fixed header column widths.",""," @property _SCROLL_LINER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"></div>'"," @protected"," @since 3.5.0"," **/"," _SCROLL_LINER_TEMPLATE: '<div class=\"{className}\"></div>',",""," /**"," Template for the virtual scrollbar needed in \"y\" and \"xy\" scrolling setups.",""," @property _SCROLLBAR_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"><div></div></div>'"," @protected"," @since 3.5.0"," **/"," _SCROLLBAR_TEMPLATE: '<div class=\"{className}\"><div></div></div>',",""," /**"," Template for the `<div>` that is used to contain the table when the table is"," horizontally scrolling.",""," @property _X_SCROLLER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"></div>'"," @protected"," @since 3.5.0"," **/"," _X_SCROLLER_TEMPLATE: '<div class=\"{className}\"></div>',",""," /**"," Template for the `<table>` used to contain the fixed column headers for"," vertically scrolling tables.",""," @property _Y_SCROLL_HEADER_TEMPLATE"," @type {HTML}"," @value '<table cellspacing=\"0\" role=\"presentation\" aria-hidden=\"true\" class=\"{className}\"></table>'"," @protected"," @since 3.5.0"," **/"," _Y_SCROLL_HEADER_TEMPLATE: '<table cellspacing=\"0\" aria-hidden=\"true\" class=\"{className}\"></table>',",""," /**"," Template for the `<div>` that is used to contain the rows when the table is"," vertically scrolling.",""," @property _Y_SCROLLER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"><div class=\"{scrollerClassName}\"></div></div>'"," @protected"," @since 3.5.0"," **/"," _Y_SCROLLER_TEMPLATE: '<div class=\"{className}\"><div class=\"{scrollerClassName}\"></div></div>',",""," /**"," Adds padding to the last cells in the fixed header for vertically scrolling"," tables. This padding is equal in width to the scrollbar, so can't be"," relegated to a stylesheet.",""," @method _addScrollbarPadding"," @protected"," @since 3.5.0"," **/"," _addScrollbarPadding: function () {"," var fixedHeader = this._yScrollHeader,"," headerClass = '.' + this.getClassName('header'),"," scrollbarWidth, rows, header, i, len;",""," if (fixedHeader) {"," scrollbarWidth = Y.DOM.getScrollbarWidth() + 'px';"," rows = fixedHeader.all('tr');",""," for (i = 0, len = rows.size(); i < len; i += +header.get('rowSpan')) {"," header = rows.item(i).all(headerClass).pop();"," header.setStyle('paddingRight', scrollbarWidth);"," }"," }"," },",""," /**"," Reacts to changes in the `scrollable` attribute by updating the `_xScroll`"," and `_yScroll` properties and syncing the scrolling structure accordingly.",""," @method _afterScrollableChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollableChange: function (e) {"," var scroller = this._xScrollNode;",""," if (this._xScroll && scroller) {"," if (this._yScroll && !this._yScrollNode) {"," scroller.setStyle('paddingRight',"," Y.DOM.getScrollbarWidth() + 'px');"," } else if (!this._yScroll && this._yScrollNode) {"," scroller.setStyle('paddingRight', '');"," }"," }",""," this._syncScrollUI();"," },",""," /**"," Reacts to changes in the `caption` attribute by adding, removing, or"," syncing the caption table when the table is set to scroll.",""," @method _afterScrollCaptionChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollCaptionChange: function (e) {"," if (this._xScroll || this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /**"," Reacts to changes in the `columns` attribute of vertically scrolling tables"," by refreshing the fixed headers, scroll container, and virtual scrollbar"," position.",""," @method _afterScrollColumnsChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollColumnsChange: function (e) {"," if (this._xScroll || this._yScroll) {"," if (this._yScroll && this._yScrollHeader) {"," this._syncScrollHeaders();"," }",""," this._syncScrollUI();"," }"," },",""," /**"," Reacts to changes in vertically scrolling table's `data` ModelList by"," synchronizing the fixed column header widths and virtual scrollbar height.",""," @method _afterScrollDataChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollDataChange: function (e) {"," if (this._xScroll || this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /**"," Reacts to changes in the `height` attribute of vertically scrolling tables"," by updating the height of the `<div>` wrapping the data table and the"," virtual scrollbar. If `scrollable` was set to \"y\" or \"xy\" but lacking a"," declared `height` until the received change, `_syncScrollUI` is called to"," create the fixed headers etc.",""," @method _afterScrollHeightChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollHeightChange: function (e) {"," if (this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /* (not an API doc comment on purpose)"," Reacts to the sort event (if the table is also sortable) by updating the"," fixed header classes to match the data table's headers.",""," THIS IS A HACK that will be removed immediately after the 3.5.0 release."," If you're reading this and the current version is greater than 3.5.0, I"," should be publicly scolded."," */"," _afterScrollSort: function (e) {"," var headers, headerClass;",""," if (this._yScroll && this._yScrollHeader) {"," headerClass = '.' + this.getClassName('header');"," headers = this._theadNode.all(headerClass);",""," this._yScrollHeader.all(headerClass).each(function (header, i) {"," header.set('className', headers.item(i).get('className'));"," });"," }"," },",""," /**"," Reacts to changes in the width of scrolling tables by expanding the width of"," the `<div>` wrapping the data table for horizontally scrolling tables or"," upding the position of the virtual scrollbar for vertically scrolling"," tables.",""," @method _afterScrollWidthChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollWidthChange: function (e) {"," if (this._xScroll || this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /**"," Binds virtual scrollbar interaction to the `_yScrollNode`'s `scrollTop` and"," vice versa.",""," @method _bindScrollbar"," @protected"," @since 3.5.0"," **/"," _bindScrollbar: function () {"," var scrollbar = this._scrollbarNode,"," scroller = this._yScrollNode;",""," if (scrollbar && scroller && !this._scrollbarEventHandle) {"," this._scrollbarEventHandle = new Y.Event.Handle(["," scrollbar.on('scroll', this._syncScrollPosition, this),"," scroller.on('scroll', this._syncScrollPosition, this)"," ]);"," }"," },",""," /**"," Binds to the window resize event to update the vertical scrolling table"," headers and wrapper `<div>` dimensions.",""," @method _bindScrollResize"," @protected"," @since 3.5.0"," **/"," _bindScrollResize: function () {"," if (!this._scrollResizeHandle) {"," // TODO: sync header widths and scrollbar position. If the height"," // of the headers has changed, update the scrollbar dims as well."," this._scrollResizeHandle = Y.on('resize',"," this._syncScrollUI, null, this);"," }"," },",""," /**"," Attaches internal subscriptions to keep the scrolling structure up to date"," with changes in the table's `data`, `columns`, `caption`, or `height`. The"," `width` is taken care of already.",""," This executes after the table's native `bindUI` method.",""," @method _bindScrollUI"," @protected"," @since 3.5.0"," **/"," _bindScrollUI: function () {"," this.after({"," columnsChange: Y.bind('_afterScrollColumnsChange', this),"," heightChange : Y.bind('_afterScrollHeightChange', this),"," widthChange : Y.bind('_afterScrollWidthChange', this),"," captionChange: Y.bind('_afterScrollCaptionChange', this),"," scrollableChange: Y.bind('_afterScrollableChange', this),"," // FIXME: this is a last minute hack to work around the fact that"," // DT doesn't use a tableView to render table content that can be"," // replaced with a scrolling table view. This must be removed asap!"," sort : Y.bind('_afterScrollSort', this)"," });",""," this.after(['dataChange', '*:add', '*:remove', '*:reset', '*:change'],"," Y.bind('_afterScrollDataChange', this));"," },",""," /**"," Clears the lock and timer used to manage synchronizing the scroll position"," between the vertical scroll container and the virtual scrollbar.",""," @method _clearScrollLock"," @protected"," @since 3.5.0"," **/"," _clearScrollLock: function () {"," if (this._scrollLock) {"," this._scrollLock.cancel();"," delete this._scrollLock;"," }"," },",""," /**"," Creates a virtual scrollbar from the `_SCROLLBAR_TEMPLATE`, assigning it to"," the `_scrollbarNode` property.",""," @method _createScrollbar"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createScrollbar: function () {"," var scrollbar = this._scrollbarNode;",""," if (!scrollbar) {"," scrollbar = this._scrollbarNode = Y.Node.create("," Y.Lang.sub(this._SCROLLBAR_TEMPLATE, {"," className: this.getClassName('scrollbar')"," }));",""," // IE 6-10 require the scrolled area to be visible (at least 1px)"," // or they don't respond to clicking on the scrollbar rail or arrows"," scrollbar.setStyle('width', (Y.DOM.getScrollbarWidth() + 1) + 'px');"," }",""," return scrollbar;"," },",""," /**"," Creates a separate table to contain the caption when the table is"," configured to scroll vertically or horizontally.",""," @method _createScrollCaptionTable"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createScrollCaptionTable: function () {"," if (!this._captionTable) {"," this._captionTable = Y.Node.create("," Y.Lang.sub(this._CAPTION_TABLE_TEMPLATE, {"," className: this.getClassName('caption', 'table')"," }));",""," this._captionTable.empty();"," }",""," return this._captionTable;"," },",""," /**"," Populates the `_xScrollNode` property by creating the `<div>` Node described"," by the `_X_SCROLLER_TEMPLATE`.",""," @method _createXScrollNode"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createXScrollNode: function () {"," if (!this._xScrollNode) {"," this._xScrollNode = Y.Node.create("," Y.Lang.sub(this._X_SCROLLER_TEMPLATE, {"," className: this.getClassName('x','scroller')"," }));"," }",""," return this._xScrollNode;"," },",""," /**"," Populates the `_yScrollHeader` property by creating the `<table>` Node"," described by the `_Y_SCROLL_HEADER_TEMPLATE`.",""," @method _createYScrollHeader"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createYScrollHeader: function () {"," var fixedHeader = this._yScrollHeader;",""," if (!fixedHeader) {"," fixedHeader = this._yScrollHeader = Y.Node.create("," Y.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE, {"," className: this.getClassName('scroll','columns')"," }));"," }",""," return fixedHeader;"," },",""," /**"," Populates the `_yScrollNode` property by creating the `<div>` Node described"," by the `_Y_SCROLLER_TEMPLATE`.",""," @method _createYScrollNode"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createYScrollNode: function () {"," var scrollerClass;",""," if (!this._yScrollNode) {"," scrollerClass = this.getClassName('y', 'scroller');",""," this._yScrollContainer = Y.Node.create("," Y.Lang.sub(this._Y_SCROLLER_TEMPLATE, {"," className: this.getClassName('y','scroller','container'),"," scrollerClassName: scrollerClass"," }));",""," this._yScrollNode = this._yScrollContainer"," .one('.' + scrollerClass);"," }",""," return this._yScrollContainer;"," },",""," /**"," Removes the nodes used to create horizontal and vertical scrolling and"," rejoins the caption to the main table if needed.",""," @method _disableScrolling"," @protected"," @since 3.5.0"," **/"," _disableScrolling: function () {"," this._removeScrollCaptionTable();"," this._disableXScrolling();"," this._disableYScrolling();"," this._unbindScrollResize();",""," this._uiSetWidth(this.get('width'));"," },",""," /**"," Removes the nodes used to allow horizontal scrolling.",""," @method _disableXScrolling"," @protected"," @since 3.5.0"," **/"," _disableXScrolling: function () {"," this._removeXScrollNode();"," },",""," /**"," Removes the nodes used to allow vertical scrolling.",""," @method _disableYScrolling"," @protected"," @since 3.5.0"," **/"," _disableYScrolling: function () {"," this._removeYScrollHeader();"," this._removeYScrollNode();"," this._removeYScrollContainer();"," this._removeScrollbar();"," },",""," /**"," Cleans up external event subscriptions.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," this._unbindScrollbar();"," this._unbindScrollResize();"," this._clearScrollLock();"," },",""," /**"," Sets up event handlers and AOP advice methods to bind the DataTable's natural"," behaviors with the scrolling APIs and state.",""," @method initializer"," @param {Object} config The config object passed to the constructor (ignored)"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this._setScrollProperties();",""," this.after(['scrollableChange', 'heightChange', 'widthChange'],"," this._setScrollProperties);",""," this.after('renderView', Y.bind('_syncScrollUI', this));",""," Y.Do.after(this._bindScrollUI, this, 'bindUI');"," },",""," /**"," Removes the table used to house the caption when the table is scrolling.",""," @method _removeScrollCaptionTable"," @protected"," @since 3.5.0"," **/"," _removeScrollCaptionTable: function () {"," if (this._captionTable) {"," if (this._captionNode) {"," this._tableNode.prepend(this._captionNode);"," }",""," this._captionTable.remove().destroy(true);",""," delete this._captionTable;"," }"," },",""," /**"," Removes the `<div>` wrapper used to contain the data table when the table"," is horizontally scrolling.",""," @method _removeXScrollNode"," @protected"," @since 3.5.0"," **/"," _removeXScrollNode: function () {"," var scroller = this._xScrollNode;",""," if (scroller) {"," scroller.replace(scroller.get('childNodes').toFrag());"," scroller.remove().destroy(true);",""," delete this._xScrollNode;"," }"," },",""," /**"," Removes the `<div>` wrapper used to contain the data table and fixed header"," when the table is vertically scrolling.",""," @method _removeYScrollContainer"," @protected"," @since 3.5.0"," **/"," _removeYScrollContainer: function () {"," var scroller = this._yScrollContainer;",""," if (scroller) {"," scroller.replace(scroller.get('childNodes').toFrag());"," scroller.remove().destroy(true);",""," delete this._yScrollContainer;"," }"," },",""," /**"," Removes the `<table>` used to contain the fixed column headers when the"," table is vertically scrolling.",""," @method _removeYScrollHeader"," @protected"," @since 3.5.0"," **/"," _removeYScrollHeader: function () {"," if (this._yScrollHeader) {"," this._yScrollHeader.remove().destroy(true);",""," delete this._yScrollHeader;"," }"," },",""," /**"," Removes the `<div>` wrapper used to contain the data table when the table"," is vertically scrolling.",""," @method _removeYScrollNode"," @protected"," @since 3.5.0"," **/"," _removeYScrollNode: function () {"," var scroller = this._yScrollNode;",""," if (scroller) {"," scroller.replace(scroller.get('childNodes').toFrag());"," scroller.remove().destroy(true);",""," delete this._yScrollNode;"," }"," },",""," /**"," Removes the virtual scrollbar used by scrolling tables.",""," @method _removeScrollbar"," @protected"," @since 3.5.0"," **/"," _removeScrollbar: function () {"," if (this._scrollbarNode) {"," this._scrollbarNode.remove().destroy(true);",""," delete this._scrollbarNode;"," }"," if (this._scrollbarEventHandle) {"," this._scrollbarEventHandle.detach();",""," delete this._scrollbarEventHandle;"," }"," },",""," /**"," Accepts (case insensitive) values \"x\", \"y\", \"xy\", `true`, and `false`."," `true` is translated to \"xy\" and upper case values are converted to lower"," case. All other values are invalid.",""," @method _setScrollable"," @param {String|Boolea} val Incoming value for the `scrollable` attribute"," @return {String}"," @protected"," @since 3.5.0"," **/"," _setScrollable: function (val) {"," if (val === true) {"," val = 'xy';"," }",""," if (isString(val)) {"," val = val.toLowerCase();"," }",""," return (val === false || val === 'y' || val === 'x' || val === 'xy') ?"," val :"," Y.Attribute.INVALID_VALUE;"," },",""," /**"," Assigns the `_xScroll` and `_yScroll` properties to true if an"," appropriate value is set in the `scrollable` attribute and the `height`"," and/or `width` is set.",""," @method _setScrollProperties"," @protected"," @since 3.5.0"," **/"," _setScrollProperties: function () {"," var scrollable = this.get('scrollable') || '',"," width = this.get('width'),"," height = this.get('height');",""," this._xScroll = width && scrollable.indexOf('x') > -1;"," this._yScroll = height && scrollable.indexOf('y') > -1;"," },",""," /**"," Keeps the virtual scrollbar and the scrolling `<div>` wrapper around the"," data table in vertically scrolling tables in sync.",""," @method _syncScrollPosition"," @param {DOMEventFacade} e The scroll event"," @protected"," @since 3.5.0"," **/"," _syncScrollPosition: function (e) {"," var scrollbar = this._scrollbarNode,"," scroller = this._yScrollNode,"," source = e.currentTarget,"," other;",""," if (scrollbar && scroller) {"," if (this._scrollLock && this._scrollLock.source !== source) {"," return;"," }",""," this._clearScrollLock();"," this._scrollLock = Y.later(300, this, this._clearScrollLock);"," this._scrollLock.source = source;",""," other = (source === scrollbar) ? scroller : scrollbar;"," other.set('scrollTop', source.get('scrollTop'));"," }"," },",""," /**"," Splits the caption from the data `<table>` if the table is configured to"," scroll. If not, rejoins the caption to the data `<table>` if it needs to"," be.",""," @method _syncScrollCaptionUI"," @protected"," @since 3.5.0"," **/"," _syncScrollCaptionUI: function () {"," var caption = this._captionNode,"," table = this._tableNode,"," captionTable = this._captionTable,"," id;",""," if (caption) {"," id = caption.getAttribute('id');",""," if (!captionTable) {"," captionTable = this._createScrollCaptionTable();",""," this.get('contentBox').prepend(captionTable);"," }",""," if (!caption.get('parentNode').compareTo(captionTable)) {"," captionTable.empty().insert(caption);",""," if (!id) {"," id = Y.stamp(caption);"," caption.setAttribute('id', id);"," }",""," table.setAttribute('aria-describedby', id);"," }"," } else if (captionTable) {"," this._removeScrollCaptionTable();"," }"," },",""," /**"," Assigns widths to the fixed header columns to match the columns in the data"," table.",""," @method _syncScrollColumnWidths"," @protected"," @since 3.5.0"," **/"," _syncScrollColumnWidths: function () {"," var widths = [];",""," if (this._theadNode && this._yScrollHeader) {"," // Capture dims and assign widths in two passes to avoid reflows for"," // each access of clientWidth/getComputedStyle"," this._theadNode.all('.' + this.getClassName('header'))"," .each(function (header) {"," widths.push("," // FIXME: IE returns the col.style.width from"," // getComputedStyle even if the column has been"," // compressed below that width, so it must use"," // clientWidth. FF requires getComputedStyle because it"," // uses fractional widths that round up to an overall"," // cell/table width 1px greater than the data table's"," // cell/table width, resulting in misaligned columns or"," // fixed header bleed through. I can't think of a"," // *reasonable* way to capture the correct width without"," // a sniff. Math.min(cW - p, getCS(w)) was imperfect"," // and punished all browsers, anyway."," (Y.UA.ie && Y.UA.ie < 8) ?"," (header.get('clientWidth') -"," styleDim(header, 'paddingLeft') -"," styleDim(header, 'paddingRight')) + 'px' :"," header.getComputedStyle('width'));"," });",""," this._yScrollHeader.all('.' + this.getClassName('scroll', 'liner'))"," .each(function (liner, i) {"," liner.setStyle('width', widths[i]);"," });"," }"," },",""," /**"," Creates matching headers in the fixed header table for vertically scrolling"," tables and synchronizes the column widths.",""," @method _syncScrollHeaders"," @protected"," @since 3.5.0"," **/"," _syncScrollHeaders: function () {"," var fixedHeader = this._yScrollHeader,"," linerTemplate = this._SCROLL_LINER_TEMPLATE,"," linerClass = this.getClassName('scroll', 'liner'),"," headerClass = this.getClassName('header'),"," headers = this._theadNode.all('.' + headerClass);",""," if (this._theadNode && fixedHeader) {"," fixedHeader.empty().appendChild("," this._theadNode.cloneNode(true));",""," // Prevent duplicate IDs and assign ARIA attributes to hide"," // from screen readers"," fixedHeader.all('[id]').removeAttribute('id');",""," fixedHeader.all('.' + headerClass).each(function (header, i) {"," var liner = Y.Node.create(Y.Lang.sub(linerTemplate, {"," className: linerClass"," })),"," refHeader = headers.item(i);",""," // Can't assign via skin css because sort (and potentially"," // others) might override the padding values."," liner.setStyle('padding',"," refHeader.getComputedStyle('paddingTop') + ' ' +"," refHeader.getComputedStyle('paddingRight') + ' ' +"," refHeader.getComputedStyle('paddingBottom') + ' ' +"," refHeader.getComputedStyle('paddingLeft'));",""," liner.appendChild(header.get('childNodes').toFrag());",""," header.appendChild(liner);"," }, this);",""," this._syncScrollColumnWidths();",""," this._addScrollbarPadding();"," }"," },",""," /**"," Wraps the table for X and Y scrolling, if necessary, if the `scrollable`"," attribute is set. Synchronizes dimensions and DOM placement of all"," scrolling related nodes.",""," @method _syncScrollUI"," @protected"," @since 3.5.0"," **/"," _syncScrollUI: function () {"," var x = this._xScroll,"," y = this._yScroll,"," xScroller = this._xScrollNode,"," yScroller = this._yScrollNode,"," scrollLeft = xScroller && xScroller.get('scrollLeft'),"," scrollTop = yScroller && yScroller.get('scrollTop');",""," this._uiSetScrollable();",""," // TODO: Probably should split this up into syncX, syncY, and syncXY"," if (x || y) {"," if ((this.get('width') || '').slice(-1) === '%') {"," this._bindScrollResize();"," } else {"," this._unbindScrollResize();"," }",""," this._syncScrollCaptionUI();"," } else {"," this._disableScrolling();"," }",""," if (this._yScrollHeader) {"," this._yScrollHeader.setStyle('display', 'none');"," }",""," if (x) {"," if (!y) {"," this._disableYScrolling();"," }",""," this._syncXScrollUI(y);"," }",""," if (y) {"," if (!x) {"," this._disableXScrolling();"," }",""," this._syncYScrollUI(x);"," }",""," // Restore scroll position"," if (scrollLeft && this._xScrollNode) {"," this._xScrollNode.set('scrollLeft', scrollLeft);"," }"," if (scrollTop && this._yScrollNode) {"," this._yScrollNode.set('scrollTop', scrollTop);"," }"," },",""," /**"," Wraps the table in a scrolling `<div>` of the configured width for \"x\""," scrolling.",""," @method _syncXScrollUI"," @param {Boolean} xy True if the table is configured with scrollable =\"xy\""," @protected"," @since 3.5.0"," **/"," _syncXScrollUI: function (xy) {"," var scroller = this._xScrollNode,"," yScroller = this._yScrollContainer,"," table = this._tableNode,"," width = this.get('width'),"," bbWidth = this.get('boundingBox').get('offsetWidth'),"," scrollbarWidth = Y.DOM.getScrollbarWidth(),"," borderWidth, tableWidth;",""," if (!scroller) {"," scroller = this._createXScrollNode();",""," // Not using table.wrap() because IE went all crazy, wrapping the"," // table in the last td in the table itself."," (yScroller || table).replace(scroller).appendTo(scroller);"," }",""," // Can't use offsetHeight - clientHeight because IE6 returns"," // clientHeight of 0 intially."," borderWidth = styleDim(scroller, 'borderLeftWidth') +"," styleDim(scroller, 'borderRightWidth');",""," scroller.setStyle('width', '');"," this._uiSetDim('width', '');"," if (xy && this._yScrollContainer) {"," this._yScrollContainer.setStyle('width', '');"," }",""," // Lock the table's unconstrained width to avoid configured column"," // widths being ignored"," if (Y.UA.ie && Y.UA.ie < 8) {"," // Have to assign a style and trigger a reflow to allow the"," // subsequent clearing of width + reflow to expand the table to"," // natural width in IE 6"," table.setStyle('width', width);"," table.get('offsetWidth');"," }"," table.setStyle('width', '');"," tableWidth = table.get('offsetWidth');"," table.setStyle('width', tableWidth + 'px');",""," this._uiSetDim('width', width);",""," // Can't use 100% width because the borders add additional width"," // TODO: Cache the border widths, though it won't prevent a reflow"," scroller.setStyle('width', (bbWidth - borderWidth) + 'px');",""," // expand the table to fill the assigned width if it doesn't"," // already overflow the configured width"," if ((scroller.get('offsetWidth') - borderWidth) > tableWidth) {"," // Assumes the wrapped table doesn't have borders"," if (xy) {"," table.setStyle('width', (scroller.get('offsetWidth') -"," borderWidth - scrollbarWidth) + 'px');"," } else {"," table.setStyle('width', '100%');"," }"," }"," },",""," /**"," Wraps the table in a scrolling `<div>` of the configured height (accounting"," for the caption if there is one) if \"y\" scrolling is enabled. Otherwise,"," unwraps the table if necessary.",""," @method _syncYScrollUI"," @param {Boolean} xy True if the table is configured with scrollable = \"xy\""," @protected"," @since 3.5.0"," **/"," _syncYScrollUI: function (xy) {"," var yScroller = this._yScrollContainer,"," yScrollNode = this._yScrollNode,"," xScroller = this._xScrollNode,"," fixedHeader = this._yScrollHeader,"," scrollbar = this._scrollbarNode,"," table = this._tableNode,"," thead = this._theadNode,"," captionTable = this._captionTable,"," boundingBox = this.get('boundingBox'),"," contentBox = this.get('contentBox'),"," width = this.get('width'),"," height = boundingBox.get('offsetHeight'),"," scrollbarWidth = Y.DOM.getScrollbarWidth(),"," outerScroller;",""," if (captionTable && !xy) {"," captionTable.setStyle('width', width || '100%');"," }",""," if (!yScroller) {"," yScroller = this._createYScrollNode();",""," yScrollNode = this._yScrollNode;",""," table.replace(yScroller).appendTo(yScrollNode);"," }",""," outerScroller = xy ? xScroller : yScroller;",""," if (!xy) {"," table.setStyle('width', '');"," }",""," // Set the scroller height"," if (xy) {"," // Account for the horizontal scrollbar in the overall height"," height -= scrollbarWidth;"," }",""," yScrollNode.setStyle('height',"," (height - outerScroller.get('offsetTop') -"," // because IE6 is returning clientHeight 0 initially"," styleDim(outerScroller, 'borderTopWidth') -"," styleDim(outerScroller, 'borderBottomWidth')) + 'px');",""," // Set the scroller width"," if (xy) {"," // For xy scrolling tables, the table should expand freely within"," // the x scroller"," yScroller.setStyle('width',"," (table.get('offsetWidth') + scrollbarWidth) + 'px');"," } else {"," this._uiSetYScrollWidth(width);"," }",""," if (captionTable && !xy) {"," captionTable.setStyle('width', yScroller.get('offsetWidth') + 'px');"," }",""," // Allow headerless scrolling"," if (thead && !fixedHeader) {"," fixedHeader = this._createYScrollHeader();",""," yScroller.prepend(fixedHeader);",""," this._syncScrollHeaders();"," }",""," if (fixedHeader) {"," this._syncScrollColumnWidths();",""," fixedHeader.setStyle('display', '');"," // This might need to come back if FF has issues"," //fixedHeader.setStyle('width', '100%');"," //(yScroller.get('clientWidth') + scrollbarWidth) + 'px');",""," if (!scrollbar) {"," scrollbar = this._createScrollbar();",""," this._bindScrollbar();",""," contentBox.prepend(scrollbar);"," }",""," this._uiSetScrollbarHeight();"," this._uiSetScrollbarPosition(outerScroller);"," }"," },",""," /**"," Assigns the appropriate class to the `boundingBox` to identify the DataTable"," as horizontally scrolling, vertically scrolling, or both (adds both classes).",""," Classes added are \"yui3-datatable-scrollable-x\" or \"...-y\"",""," @method _uiSetScrollable"," @protected"," @since 3.5.0"," **/"," _uiSetScrollable: function () {"," this.get('boundingBox')"," .toggleClass(this.getClassName('scrollable','x'), this._xScroll)"," .toggleClass(this.getClassName('scrollable','y'), this._yScroll);"," },",""," /**"," Updates the virtual scrollbar's height to avoid overlapping with the fixed"," headers.",""," @method _uiSetScrollbarHeight"," @protected"," @since 3.5.0"," **/"," _uiSetScrollbarHeight: function () {"," var scrollbar = this._scrollbarNode,"," scroller = this._yScrollNode,"," fixedHeader = this._yScrollHeader;",""," if (scrollbar && scroller && fixedHeader) {"," scrollbar.get('firstChild').setStyle('height',"," this._tbodyNode.get('scrollHeight') + 'px');",""," scrollbar.setStyle('height', "," (parseFloat(scroller.getComputedStyle('height')) -"," parseFloat(fixedHeader.getComputedStyle('height'))) + 'px');"," }"," },",""," /**"," Updates the virtual scrollbar's placement to avoid overlapping the fixed"," headers or the data table.",""," @method _uiSetScrollbarPosition"," @param {Node} scroller Reference node to position the scrollbar over"," @protected"," @since 3.5.0"," **/"," _uiSetScrollbarPosition: function (scroller) {"," var scrollbar = this._scrollbarNode,"," fixedHeader = this._yScrollHeader;",""," if (scrollbar && scroller && fixedHeader) {"," scrollbar.setStyles({"," // Using getCS instead of offsetHeight because FF uses"," // fractional values, but reports ints to offsetHeight, so"," // offsetHeight is unreliable. It is probably fine to use"," // offsetHeight in this case but this was left in place after"," // fixing an off-by-1px issue in FF 10- by fixing the caption"," // font style so FF picked it up."," top: (parseFloat(fixedHeader.getComputedStyle('height')) +"," styleDim(scroller, 'borderTopWidth') +"," scroller.get('offsetTop')) + 'px',",""," // Minus 1 because IE 6-10 require the scrolled area to be"," // visible by at least 1px or it won't respond to clicks on the"," // scrollbar rail or endcap arrows."," left: (scroller.get('offsetWidth') -"," Y.DOM.getScrollbarWidth() - 1 -"," styleDim(scroller, 'borderRightWidth')) + 'px'"," });"," }"," },",""," /**"," Assigns the width of the `<div>` wrapping the data table in vertically"," scrolling tables.",""," If the table can't compress to the specified width, the container is"," expanded accordingly.",""," @method _uiSetYScrollWidth"," @param {String} width The CSS width to attempt to set"," @protected"," @since 3.5.0"," **/"," _uiSetYScrollWidth: function (width) {"," var scroller = this._yScrollContainer,"," table = this._tableNode,"," tableWidth, borderWidth, scrollerWidth, scrollbarWidth;",""," if (scroller && table) {"," scrollbarWidth = Y.DOM.getScrollbarWidth();",""," if (width) {"," // Assumes no table border"," borderWidth = scroller.get('offsetWidth') -"," scroller.get('clientWidth') +"," scrollbarWidth; // added back at the end",""," // The table's rendered width might be greater than the"," // configured width"," scroller.setStyle('width', width);",""," // Have to subtract the border width from the configured width"," // because the scroller's width will need to be reduced by the"," // border width as well during the width reassignment below."," scrollerWidth = scroller.get('clientWidth') - borderWidth;",""," // Assumes no table borders"," table.setStyle('width', scrollerWidth + 'px');",""," tableWidth = table.get('offsetWidth');",""," // Expand the scroll node width if the table can't fit."," // Otherwise, reassign the scroller a pixel width that"," // accounts for the borders."," scroller.setStyle('width',"," (tableWidth + scrollbarWidth) + 'px');"," } else {"," // Allow the table to expand naturally"," table.setStyle('width', '');"," scroller.setStyle('width', '');",""," scroller.setStyle('width',"," (table.get('offsetWidth') + scrollbarWidth) + 'px');"," }"," }"," },",""," /**"," Detaches the scroll event subscriptions used to maintain scroll position"," parity between the scrollable `<div>` wrapper around the data table and the"," virtual scrollbar for vertically scrolling tables.",""," @method _unbindScrollbar"," @protected"," @since 3.5.0"," **/"," _unbindScrollbar: function () {"," if (this._scrollbarEventHandle) {"," this._scrollbarEventHandle.detach();"," }"," },",""," /**"," Detaches the resize event subscription used to maintain column parity for"," vertically scrolling tables with percentage widths.",""," @method _unbindScrollResize"," @protected"," @since 3.5.0"," **/"," _unbindScrollResize: function () {"," if (this._scrollResizeHandle) {"," this._scrollResizeHandle.detach();"," delete this._scrollResizeHandle;"," }"," }",""," /**"," Indicates horizontal table scrolling is enabled.",""," @property _xScroll"," @type {Boolean}"," @default undefined (not initially set)"," @private"," @since 3.5.0"," **/"," //_xScroll: null,",""," /**"," Indicates vertical table scrolling is enabled.",""," @property _yScroll"," @type {Boolean}"," @default undefined (not initially set)"," @private"," @since 3.5.0"," **/"," //_yScroll: null,",""," /**"," Fixed column header `<table>` Node for vertical scrolling tables.",""," @property _yScrollHeader"," @type {Node}"," @default undefined (not initially set)"," @protected"," @since 3.5.0"," **/"," //_yScrollHeader: null,",""," /**"," Overflow Node used to contain the data rows in a vertically scrolling table.",""," @property _yScrollNode"," @type {Node}"," @default undefined (not initially set)"," @protected"," @since 3.5.0"," **/"," //_yScrollNode: null,",""," /**"," Overflow Node used to contain the table headers and data in a horizontally"," scrolling table.",""," @property _xScrollNode"," @type {Node}"," @default undefined (not initially set)"," @protected"," @since 3.5.0"," **/"," //_xScrollNode: null","}, true);","","Y.Base.mix(Y.DataTable, [Scrollable]);","","","}, '3.7.2', {\"requires\": [\"datatable-base\", \"datatable-column-widths\", \"dom-screen\"], \"skinnable\": true});"];+_yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].code=["YUI.add('datatable-scroll', function (Y, NAME) {","","/**","Adds the ability to make the table rows scrollable while preserving the header","placement.","","@module datatable-scroll","@for DataTable","@since 3.5.0","**/","var YLang = Y.Lang,"," isString = YLang.isString,"," isNumber = YLang.isNumber,"," isArray = YLang.isArray,",""," Scrollable;","","// Returns the numeric value portion of the computed style, defaulting to 0","function styleDim(node, style) {"," return parseInt(node.getComputedStyle(style), 10) | 0;","}","","/**","_API docs for this extension are included in the DataTable class._","","Adds the ability to make the table rows scrollable while preserving the header","placement.","","There are two types of scrolling, horizontal (x) and vertical (y). Horizontal","scrolling is achieved by wrapping the entire table in a scrollable container.","Vertical scrolling is achieved by splitting the table headers and data into two","separate tables, the latter of which is wrapped in a vertically scrolling","container. In this case, column widths of header cells and data cells are kept","in sync programmatically.","","Since the split table synchronization can be costly at runtime, the split is only done if the data in the table stretches beyond the configured `height` value.","","To activate or deactivate scrolling, set the `scrollable` attribute to one of","the following values:",""," * `false` - (default) Scrolling is disabled."," * `true` or 'xy' - If `height` is set, vertical scrolling will be activated, if"," `width` is set, horizontal scrolling will be activated."," * 'x' - Activate horizontal scrolling only. Requires the `width` attribute is"," also set."," * 'y' - Activate vertical scrolling only. Requires the `height` attribute is"," also set.","","@class DataTable.Scrollable","@for DataTable","@since 3.5.0","**/","Y.DataTable.Scrollable = Scrollable = function () {};","","Scrollable.ATTRS = {"," /**"," Activates or deactivates scrolling in the table. Acceptable values are:",""," * `false` - (default) Scrolling is disabled."," * `true` or 'xy' - If `height` is set, vertical scrolling will be"," activated, if `width` is set, horizontal scrolling will be activated."," * 'x' - Activate horizontal scrolling only. Requires the `width` attribute"," is also set."," * 'y' - Activate vertical scrolling only. Requires the `height` attribute"," is also set.",""," @attribute scrollable"," @type {String|Boolean}"," @value false"," @since 3.5.0"," **/"," scrollable: {"," value: false,"," setter: '_setScrollable'"," }","};","","Y.mix(Scrollable.prototype, {",""," /**"," Scrolls a given row or cell into view if the table is scrolling. Pass the"," `clientId` of a Model from the DataTable's `data` ModelList or its row"," index to scroll to a row or a [row index, column index] array to scroll to"," a cell. Alternately, to scroll to any element contained within the table's"," scrolling areas, pass its ID, or the Node itself (though you could just as"," well call `node.scrollIntoView()` yourself, but hey, whatever).",""," @method scrollTo"," @param {String|Number|Number[]|Node} id A row clientId, row index, cell"," coordinate array, id string, or Node"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," scrollTo: function (id) {"," var target;",""," if (id && this._tbodyNode && (this._yScrollNode || this._xScrollNode)) {"," if (isArray(id)) {"," target = this.getCell(id);"," } else if (isNumber(id)) { "," target = this.getRow(id);"," } else if (isString(id)) {"," target = this._tbodyNode.one('#' + id);"," } else if (id instanceof Y.Node &&"," // TODO: ancestor(yScrollNode, xScrollNode)"," id.ancestor('.yui3-datatable') === this.get('boundingBox')) {"," target = id;"," }",""," target && target.scrollIntoView();"," }",""," return this;"," },",""," //--------------------------------------------------------------------------"," // Protected properties and methods"," //--------------------------------------------------------------------------",""," /**"," Template for the `<table>` that is used to fix the caption in place when"," the table is horizontally scrolling.",""," @property _CAPTION_TABLE_TEMPLATE"," @type {HTML}"," @value '<table class=\"{className}\" role=\"presentation\"></table>'"," @protected"," @since 3.5.0"," **/"," _CAPTION_TABLE_TEMPLATE: '<table class=\"{className}\" role=\"presentation\"></table>',",""," /**"," Template used to create sizable element liners around header content to"," synchronize fixed header column widths.",""," @property _SCROLL_LINER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"></div>'"," @protected"," @since 3.5.0"," **/"," _SCROLL_LINER_TEMPLATE: '<div class=\"{className}\"></div>',",""," /**"," Template for the virtual scrollbar needed in \"y\" and \"xy\" scrolling setups.",""," @property _SCROLLBAR_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"><div></div></div>'"," @protected"," @since 3.5.0"," **/"," _SCROLLBAR_TEMPLATE: '<div class=\"{className}\"><div></div></div>',",""," /**"," Template for the `<div>` that is used to contain the table when the table is"," horizontally scrolling.",""," @property _X_SCROLLER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"></div>'"," @protected"," @since 3.5.0"," **/"," _X_SCROLLER_TEMPLATE: '<div class=\"{className}\"></div>',",""," /**"," Template for the `<table>` used to contain the fixed column headers for"," vertically scrolling tables.",""," @property _Y_SCROLL_HEADER_TEMPLATE"," @type {HTML}"," @value '<table cellspacing=\"0\" role=\"presentation\" aria-hidden=\"true\" class=\"{className}\"></table>'"," @protected"," @since 3.5.0"," **/"," _Y_SCROLL_HEADER_TEMPLATE: '<table cellspacing=\"0\" aria-hidden=\"true\" class=\"{className}\"></table>',",""," /**"," Template for the `<div>` that is used to contain the rows when the table is"," vertically scrolling.",""," @property _Y_SCROLLER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\"><div class=\"{scrollerClassName}\"></div></div>'"," @protected"," @since 3.5.0"," **/"," _Y_SCROLLER_TEMPLATE: '<div class=\"{className}\"><div class=\"{scrollerClassName}\"></div></div>',",""," /**"," Adds padding to the last cells in the fixed header for vertically scrolling"," tables. This padding is equal in width to the scrollbar, so can't be"," relegated to a stylesheet.",""," @method _addScrollbarPadding"," @protected"," @since 3.5.0"," **/"," _addScrollbarPadding: function () {"," var fixedHeader = this._yScrollHeader,"," headerClass = '.' + this.getClassName('header'),"," scrollbarWidth, rows, header, i, len;",""," if (fixedHeader) {"," scrollbarWidth = Y.DOM.getScrollbarWidth() + 'px';"," rows = fixedHeader.all('tr');",""," for (i = 0, len = rows.size(); i < len; i += +header.get('rowSpan')) {"," header = rows.item(i).all(headerClass).pop();"," header.setStyle('paddingRight', scrollbarWidth);"," }"," }"," },",""," /**"," Reacts to changes in the `scrollable` attribute by updating the `_xScroll`"," and `_yScroll` properties and syncing the scrolling structure accordingly.",""," @method _afterScrollableChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollableChange: function (e) {"," var scroller = this._xScrollNode;",""," if (this._xScroll && scroller) {"," if (this._yScroll && !this._yScrollNode) {"," scroller.setStyle('paddingRight',"," Y.DOM.getScrollbarWidth() + 'px');"," } else if (!this._yScroll && this._yScrollNode) {"," scroller.setStyle('paddingRight', '');"," }"," }",""," this._syncScrollUI();"," },",""," /**"," Reacts to changes in the `caption` attribute by adding, removing, or"," syncing the caption table when the table is set to scroll.",""," @method _afterScrollCaptionChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollCaptionChange: function (e) {"," if (this._xScroll || this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /**"," Reacts to changes in the `columns` attribute of vertically scrolling tables"," by refreshing the fixed headers, scroll container, and virtual scrollbar"," position.",""," @method _afterScrollColumnsChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollColumnsChange: function (e) {"," if (this._xScroll || this._yScroll) {"," if (this._yScroll && this._yScrollHeader) {"," this._syncScrollHeaders();"," }",""," this._syncScrollUI();"," }"," },",""," /**"," Reacts to changes in vertically scrolling table's `data` ModelList by"," synchronizing the fixed column header widths and virtual scrollbar height.",""," @method _afterScrollDataChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollDataChange: function (e) {"," if (this._xScroll || this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /**"," Reacts to changes in the `height` attribute of vertically scrolling tables"," by updating the height of the `<div>` wrapping the data table and the"," virtual scrollbar. If `scrollable` was set to \"y\" or \"xy\" but lacking a"," declared `height` until the received change, `_syncScrollUI` is called to"," create the fixed headers etc.",""," @method _afterScrollHeightChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollHeightChange: function (e) {"," if (this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /* (not an API doc comment on purpose)"," Reacts to the sort event (if the table is also sortable) by updating the"," fixed header classes to match the data table's headers.",""," THIS IS A HACK that will be removed immediately after the 3.5.0 release."," If you're reading this and the current version is greater than 3.5.0, I"," should be publicly scolded."," */"," _afterScrollSort: function (e) {"," var headers, headerClass;",""," if (this._yScroll && this._yScrollHeader) {"," headerClass = '.' + this.getClassName('header');"," headers = this._theadNode.all(headerClass);",""," this._yScrollHeader.all(headerClass).each(function (header, i) {"," header.set('className', headers.item(i).get('className'));"," });"," }"," },",""," /**"," Reacts to changes in the width of scrolling tables by expanding the width of"," the `<div>` wrapping the data table for horizontally scrolling tables or"," upding the position of the virtual scrollbar for vertically scrolling"," tables.",""," @method _afterScrollWidthChange"," @param {EventFacade} e The relevant change event (ignored)"," @protected"," @since 3.5.0"," **/"," _afterScrollWidthChange: function (e) {"," if (this._xScroll || this._yScroll) {"," this._syncScrollUI();"," }"," },",""," /**"," Binds virtual scrollbar interaction to the `_yScrollNode`'s `scrollTop` and"," vice versa.",""," @method _bindScrollbar"," @protected"," @since 3.5.0"," **/"," _bindScrollbar: function () {"," var scrollbar = this._scrollbarNode,"," scroller = this._yScrollNode;",""," if (scrollbar && scroller && !this._scrollbarEventHandle) {"," this._scrollbarEventHandle = new Y.Event.Handle(["," scrollbar.on('scroll', this._syncScrollPosition, this),"," scroller.on('scroll', this._syncScrollPosition, this)"," ]);"," }"," },",""," /**"," Binds to the window resize event to update the vertical scrolling table"," headers and wrapper `<div>` dimensions.",""," @method _bindScrollResize"," @protected"," @since 3.5.0"," **/"," _bindScrollResize: function () {"," if (!this._scrollResizeHandle) {"," // TODO: sync header widths and scrollbar position. If the height"," // of the headers has changed, update the scrollbar dims as well."," this._scrollResizeHandle = Y.on('resize',"," this._syncScrollUI, null, this);"," }"," },",""," /**"," Attaches internal subscriptions to keep the scrolling structure up to date"," with changes in the table's `data`, `columns`, `caption`, or `height`. The"," `width` is taken care of already.",""," This executes after the table's native `bindUI` method.",""," @method _bindScrollUI"," @protected"," @since 3.5.0"," **/"," _bindScrollUI: function () {"," this.after({"," columnsChange: Y.bind('_afterScrollColumnsChange', this),"," heightChange : Y.bind('_afterScrollHeightChange', this),"," widthChange : Y.bind('_afterScrollWidthChange', this),"," captionChange: Y.bind('_afterScrollCaptionChange', this),"," scrollableChange: Y.bind('_afterScrollableChange', this),"," // FIXME: this is a last minute hack to work around the fact that"," // DT doesn't use a tableView to render table content that can be"," // replaced with a scrolling table view. This must be removed asap!"," sort : Y.bind('_afterScrollSort', this)"," });",""," this.after(['dataChange', '*:add', '*:remove', '*:reset', '*:change'],"," Y.bind('_afterScrollDataChange', this));"," },",""," /**"," Clears the lock and timer used to manage synchronizing the scroll position"," between the vertical scroll container and the virtual scrollbar.",""," @method _clearScrollLock"," @protected"," @since 3.5.0"," **/"," _clearScrollLock: function () {"," if (this._scrollLock) {"," this._scrollLock.cancel();"," delete this._scrollLock;"," }"," },",""," /**"," Creates a virtual scrollbar from the `_SCROLLBAR_TEMPLATE`, assigning it to"," the `_scrollbarNode` property.",""," @method _createScrollbar"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createScrollbar: function () {"," var scrollbar = this._scrollbarNode;",""," if (!scrollbar) {"," scrollbar = this._scrollbarNode = Y.Node.create("," Y.Lang.sub(this._SCROLLBAR_TEMPLATE, {"," className: this.getClassName('scrollbar')"," }));",""," // IE 6-10 require the scrolled area to be visible (at least 1px)"," // or they don't respond to clicking on the scrollbar rail or arrows"," scrollbar.setStyle('width', (Y.DOM.getScrollbarWidth() + 1) + 'px');"," }",""," return scrollbar;"," },",""," /**"," Creates a separate table to contain the caption when the table is"," configured to scroll vertically or horizontally.",""," @method _createScrollCaptionTable"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createScrollCaptionTable: function () {"," if (!this._captionTable) {"," this._captionTable = Y.Node.create("," Y.Lang.sub(this._CAPTION_TABLE_TEMPLATE, {"," className: this.getClassName('caption', 'table')"," }));",""," this._captionTable.empty();"," }",""," return this._captionTable;"," },",""," /**"," Populates the `_xScrollNode` property by creating the `<div>` Node described"," by the `_X_SCROLLER_TEMPLATE`.",""," @method _createXScrollNode"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createXScrollNode: function () {"," if (!this._xScrollNode) {"," this._xScrollNode = Y.Node.create("," Y.Lang.sub(this._X_SCROLLER_TEMPLATE, {"," className: this.getClassName('x','scroller')"," }));"," }",""," return this._xScrollNode;"," },",""," /**"," Populates the `_yScrollHeader` property by creating the `<table>` Node"," described by the `_Y_SCROLL_HEADER_TEMPLATE`.",""," @method _createYScrollHeader"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createYScrollHeader: function () {"," var fixedHeader = this._yScrollHeader;",""," if (!fixedHeader) {"," fixedHeader = this._yScrollHeader = Y.Node.create("," Y.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE, {"," className: this.getClassName('scroll','columns')"," }));"," }",""," return fixedHeader;"," },",""," /**"," Populates the `_yScrollNode` property by creating the `<div>` Node described"," by the `_Y_SCROLLER_TEMPLATE`.",""," @method _createYScrollNode"," @return {Node} The created Node"," @protected"," @since 3.5.0"," **/"," _createYScrollNode: function () {"," var scrollerClass;",""," if (!this._yScrollNode) {"," scrollerClass = this.getClassName('y', 'scroller');",""," this._yScrollContainer = Y.Node.create("," Y.Lang.sub(this._Y_SCROLLER_TEMPLATE, {"," className: this.getClassName('y','scroller','container'),"," scrollerClassName: scrollerClass"," }));",""," this._yScrollNode = this._yScrollContainer"," .one('.' + scrollerClass);"," }",""," return this._yScrollContainer;"," },",""," /**"," Removes the nodes used to create horizontal and vertical scrolling and"," rejoins the caption to the main table if needed.",""," @method _disableScrolling"," @protected"," @since 3.5.0"," **/"," _disableScrolling: function () {"," this._removeScrollCaptionTable();"," this._disableXScrolling();"," this._disableYScrolling();"," this._unbindScrollResize();",""," this._uiSetWidth(this.get('width'));"," },",""," /**"," Removes the nodes used to allow horizontal scrolling.",""," @method _disableXScrolling"," @protected"," @since 3.5.0"," **/"," _disableXScrolling: function () {"," this._removeXScrollNode();"," },",""," /**"," Removes the nodes used to allow vertical scrolling.",""," @method _disableYScrolling"," @protected"," @since 3.5.0"," **/"," _disableYScrolling: function () {"," this._removeYScrollHeader();"," this._removeYScrollNode();"," this._removeYScrollContainer();"," this._removeScrollbar();"," },",""," /**"," Cleans up external event subscriptions.",""," @method destructor"," @protected"," @since 3.5.0"," **/"," destructor: function () {"," this._unbindScrollbar();"," this._unbindScrollResize();"," this._clearScrollLock();"," },",""," /**"," Sets up event handlers and AOP advice methods to bind the DataTable's natural"," behaviors with the scrolling APIs and state.",""," @method initializer"," @param {Object} config The config object passed to the constructor (ignored)"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," this._setScrollProperties();",""," this.after(['scrollableChange', 'heightChange', 'widthChange'],"," this._setScrollProperties);",""," this.after('renderView', Y.bind('_syncScrollUI', this));",""," Y.Do.after(this._bindScrollUI, this, 'bindUI');"," },",""," /**"," Removes the table used to house the caption when the table is scrolling.",""," @method _removeScrollCaptionTable"," @protected"," @since 3.5.0"," **/"," _removeScrollCaptionTable: function () {"," if (this._captionTable) {"," if (this._captionNode) {"," this._tableNode.prepend(this._captionNode);"," }",""," this._captionTable.remove().destroy(true);",""," delete this._captionTable;"," }"," },",""," /**"," Removes the `<div>` wrapper used to contain the data table when the table"," is horizontally scrolling.",""," @method _removeXScrollNode"," @protected"," @since 3.5.0"," **/"," _removeXScrollNode: function () {"," var scroller = this._xScrollNode;",""," if (scroller) {"," scroller.replace(scroller.get('childNodes').toFrag());"," scroller.remove().destroy(true);",""," delete this._xScrollNode;"," }"," },",""," /**"," Removes the `<div>` wrapper used to contain the data table and fixed header"," when the table is vertically scrolling.",""," @method _removeYScrollContainer"," @protected"," @since 3.5.0"," **/"," _removeYScrollContainer: function () {"," var scroller = this._yScrollContainer;",""," if (scroller) {"," scroller.replace(scroller.get('childNodes').toFrag());"," scroller.remove().destroy(true);",""," delete this._yScrollContainer;"," }"," },",""," /**"," Removes the `<table>` used to contain the fixed column headers when the"," table is vertically scrolling.",""," @method _removeYScrollHeader"," @protected"," @since 3.5.0"," **/"," _removeYScrollHeader: function () {"," if (this._yScrollHeader) {"," this._yScrollHeader.remove().destroy(true);",""," delete this._yScrollHeader;"," }"," },",""," /**"," Removes the `<div>` wrapper used to contain the data table when the table"," is vertically scrolling.",""," @method _removeYScrollNode"," @protected"," @since 3.5.0"," **/"," _removeYScrollNode: function () {"," var scroller = this._yScrollNode;",""," if (scroller) {"," scroller.replace(scroller.get('childNodes').toFrag());"," scroller.remove().destroy(true);",""," delete this._yScrollNode;"," }"," },",""," /**"," Removes the virtual scrollbar used by scrolling tables.",""," @method _removeScrollbar"," @protected"," @since 3.5.0"," **/"," _removeScrollbar: function () {"," if (this._scrollbarNode) {"," this._scrollbarNode.remove().destroy(true);",""," delete this._scrollbarNode;"," }"," if (this._scrollbarEventHandle) {"," this._scrollbarEventHandle.detach();",""," delete this._scrollbarEventHandle;"," }"," },",""," /**"," Accepts (case insensitive) values \"x\", \"y\", \"xy\", `true`, and `false`."," `true` is translated to \"xy\" and upper case values are converted to lower"," case. All other values are invalid.",""," @method _setScrollable"," @param {String|Boolea} val Incoming value for the `scrollable` attribute"," @return {String}"," @protected"," @since 3.5.0"," **/"," _setScrollable: function (val) {"," if (val === true) {"," val = 'xy';"," }",""," if (isString(val)) {"," val = val.toLowerCase();"," }",""," return (val === false || val === 'y' || val === 'x' || val === 'xy') ?"," val :"," Y.Attribute.INVALID_VALUE;"," },",""," /**"," Assigns the `_xScroll` and `_yScroll` properties to true if an"," appropriate value is set in the `scrollable` attribute and the `height`"," and/or `width` is set.",""," @method _setScrollProperties"," @protected"," @since 3.5.0"," **/"," _setScrollProperties: function () {"," var scrollable = this.get('scrollable') || '',"," width = this.get('width'),"," height = this.get('height');",""," this._xScroll = width && scrollable.indexOf('x') > -1;"," this._yScroll = height && scrollable.indexOf('y') > -1;"," },",""," /**"," Keeps the virtual scrollbar and the scrolling `<div>` wrapper around the"," data table in vertically scrolling tables in sync.",""," @method _syncScrollPosition"," @param {DOMEventFacade} e The scroll event"," @protected"," @since 3.5.0"," **/"," _syncScrollPosition: function (e) {"," var scrollbar = this._scrollbarNode,"," scroller = this._yScrollNode,"," source = e.currentTarget,"," other;",""," if (scrollbar && scroller) {"," if (this._scrollLock && this._scrollLock.source !== source) {"," return;"," }",""," this._clearScrollLock();"," this._scrollLock = Y.later(300, this, this._clearScrollLock);"," this._scrollLock.source = source;",""," other = (source === scrollbar) ? scroller : scrollbar;"," other.set('scrollTop', source.get('scrollTop'));"," }"," },",""," /**"," Splits the caption from the data `<table>` if the table is configured to"," scroll. If not, rejoins the caption to the data `<table>` if it needs to"," be.",""," @method _syncScrollCaptionUI"," @protected"," @since 3.5.0"," **/"," _syncScrollCaptionUI: function () {"," var caption = this._captionNode,"," table = this._tableNode,"," captionTable = this._captionTable,"," id;",""," if (caption) {"," id = caption.getAttribute('id');",""," if (!captionTable) {"," captionTable = this._createScrollCaptionTable();",""," this.get('contentBox').prepend(captionTable);"," }",""," if (!caption.get('parentNode').compareTo(captionTable)) {"," captionTable.empty().insert(caption);",""," if (!id) {"," id = Y.stamp(caption);"," caption.setAttribute('id', id);"," }",""," table.setAttribute('aria-describedby', id);"," }"," } else if (captionTable) {"," this._removeScrollCaptionTable();"," }"," },",""," /**"," Assigns widths to the fixed header columns to match the columns in the data"," table.",""," @method _syncScrollColumnWidths"," @protected"," @since 3.5.0"," **/"," _syncScrollColumnWidths: function () {"," var widths = [];",""," if (this._theadNode && this._yScrollHeader) {"," // Capture dims and assign widths in two passes to avoid reflows for"," // each access of clientWidth/getComputedStyle"," this._theadNode.all('.' + this.getClassName('header'))"," .each(function (header) {"," widths.push("," // FIXME: IE returns the col.style.width from"," // getComputedStyle even if the column has been"," // compressed below that width, so it must use"," // clientWidth. FF requires getComputedStyle because it"," // uses fractional widths that round up to an overall"," // cell/table width 1px greater than the data table's"," // cell/table width, resulting in misaligned columns or"," // fixed header bleed through. I can't think of a"," // *reasonable* way to capture the correct width without"," // a sniff. Math.min(cW - p, getCS(w)) was imperfect"," // and punished all browsers, anyway."," (Y.UA.ie && Y.UA.ie < 8) ?"," (header.get('clientWidth') -"," styleDim(header, 'paddingLeft') -"," styleDim(header, 'paddingRight')) + 'px' :"," header.getComputedStyle('width'));"," });",""," this._yScrollHeader.all('.' + this.getClassName('scroll', 'liner'))"," .each(function (liner, i) {"," liner.setStyle('width', widths[i]);"," });"," }"," },",""," /**"," Creates matching headers in the fixed header table for vertically scrolling"," tables and synchronizes the column widths.",""," @method _syncScrollHeaders"," @protected"," @since 3.5.0"," **/"," _syncScrollHeaders: function () {"," var fixedHeader = this._yScrollHeader,"," linerTemplate = this._SCROLL_LINER_TEMPLATE,"," linerClass = this.getClassName('scroll', 'liner'),"," headerClass = this.getClassName('header'),"," headers = this._theadNode.all('.' + headerClass);",""," if (this._theadNode && fixedHeader) {"," fixedHeader.empty().appendChild("," this._theadNode.cloneNode(true));",""," // Prevent duplicate IDs and assign ARIA attributes to hide"," // from screen readers"," fixedHeader.all('[id]').removeAttribute('id');",""," fixedHeader.all('.' + headerClass).each(function (header, i) {"," var liner = Y.Node.create(Y.Lang.sub(linerTemplate, {"," className: linerClass"," })),"," refHeader = headers.item(i);",""," // Can't assign via skin css because sort (and potentially"," // others) might override the padding values."," liner.setStyle('padding',"," refHeader.getComputedStyle('paddingTop') + ' ' +"," refHeader.getComputedStyle('paddingRight') + ' ' +"," refHeader.getComputedStyle('paddingBottom') + ' ' +"," refHeader.getComputedStyle('paddingLeft'));",""," liner.appendChild(header.get('childNodes').toFrag());",""," header.appendChild(liner);"," }, this);",""," this._syncScrollColumnWidths();",""," this._addScrollbarPadding();"," }"," },",""," /**"," Wraps the table for X and Y scrolling, if necessary, if the `scrollable`"," attribute is set. Synchronizes dimensions and DOM placement of all"," scrolling related nodes.",""," @method _syncScrollUI"," @protected"," @since 3.5.0"," **/"," _syncScrollUI: function () {"," var x = this._xScroll,"," y = this._yScroll,"," xScroller = this._xScrollNode,"," yScroller = this._yScrollNode,"," scrollLeft = xScroller && xScroller.get('scrollLeft'),"," scrollTop = yScroller && yScroller.get('scrollTop');",""," this._uiSetScrollable();",""," // TODO: Probably should split this up into syncX, syncY, and syncXY"," if (x || y) {"," if ((this.get('width') || '').slice(-1) === '%') {"," this._bindScrollResize();"," } else {"," this._unbindScrollResize();"," }",""," this._syncScrollCaptionUI();"," } else {"," this._disableScrolling();"," }",""," if (this._yScrollHeader) {"," this._yScrollHeader.setStyle('display', 'none');"," }",""," if (x) {"," if (!y) {"," this._disableYScrolling();"," }",""," this._syncXScrollUI(y);"," }",""," if (y) {"," if (!x) {"," this._disableXScrolling();"," }",""," this._syncYScrollUI(x);"," }",""," // Restore scroll position"," if (scrollLeft && this._xScrollNode) {"," this._xScrollNode.set('scrollLeft', scrollLeft);"," }"," if (scrollTop && this._yScrollNode) {"," this._yScrollNode.set('scrollTop', scrollTop);"," }"," },",""," /**"," Wraps the table in a scrolling `<div>` of the configured width for \"x\""," scrolling.",""," @method _syncXScrollUI"," @param {Boolean} xy True if the table is configured with scrollable =\"xy\""," @protected"," @since 3.5.0"," **/"," _syncXScrollUI: function (xy) {"," var scroller = this._xScrollNode,"," yScroller = this._yScrollContainer,"," table = this._tableNode,"," width = this.get('width'),"," bbWidth = this.get('boundingBox').get('offsetWidth'),"," scrollbarWidth = Y.DOM.getScrollbarWidth(),"," borderWidth, tableWidth;",""," if (!scroller) {"," scroller = this._createXScrollNode();",""," // Not using table.wrap() because IE went all crazy, wrapping the"," // table in the last td in the table itself."," (yScroller || table).replace(scroller).appendTo(scroller);"," }",""," // Can't use offsetHeight - clientHeight because IE6 returns"," // clientHeight of 0 intially."," borderWidth = styleDim(scroller, 'borderLeftWidth') +"," styleDim(scroller, 'borderRightWidth');",""," scroller.setStyle('width', '');"," this._uiSetDim('width', '');"," if (xy && this._yScrollContainer) {"," this._yScrollContainer.setStyle('width', '');"," }",""," // Lock the table's unconstrained width to avoid configured column"," // widths being ignored"," if (Y.UA.ie && Y.UA.ie < 8) {"," // Have to assign a style and trigger a reflow to allow the"," // subsequent clearing of width + reflow to expand the table to"," // natural width in IE 6"," table.setStyle('width', width);"," table.get('offsetWidth');"," }"," table.setStyle('width', '');"," tableWidth = table.get('offsetWidth');"," table.setStyle('width', tableWidth + 'px');",""," this._uiSetDim('width', width);",""," // Can't use 100% width because the borders add additional width"," // TODO: Cache the border widths, though it won't prevent a reflow"," scroller.setStyle('width', (bbWidth - borderWidth) + 'px');",""," // expand the table to fill the assigned width if it doesn't"," // already overflow the configured width"," if ((scroller.get('offsetWidth') - borderWidth) > tableWidth) {"," // Assumes the wrapped table doesn't have borders"," if (xy) {"," table.setStyle('width', (scroller.get('offsetWidth') -"," borderWidth - scrollbarWidth) + 'px');"," } else {"," table.setStyle('width', '100%');"," }"," }"," },",""," /**"," Wraps the table in a scrolling `<div>` of the configured height (accounting"," for the caption if there is one) if \"y\" scrolling is enabled. Otherwise,"," unwraps the table if necessary.",""," @method _syncYScrollUI"," @param {Boolean} xy True if the table is configured with scrollable = \"xy\""," @protected"," @since 3.5.0"," **/"," _syncYScrollUI: function (xy) {"," var yScroller = this._yScrollContainer,"," yScrollNode = this._yScrollNode,"," xScroller = this._xScrollNode,"," fixedHeader = this._yScrollHeader,"," scrollbar = this._scrollbarNode,"," table = this._tableNode,"," thead = this._theadNode,"," captionTable = this._captionTable,"," boundingBox = this.get('boundingBox'),"," contentBox = this.get('contentBox'),"," width = this.get('width'),"," height = boundingBox.get('offsetHeight'),"," scrollbarWidth = Y.DOM.getScrollbarWidth(),"," outerScroller;",""," if (captionTable && !xy) {"," captionTable.setStyle('width', width || '100%');"," }",""," if (!yScroller) {"," yScroller = this._createYScrollNode();",""," yScrollNode = this._yScrollNode;",""," table.replace(yScroller).appendTo(yScrollNode);"," }",""," outerScroller = xy ? xScroller : yScroller;",""," if (!xy) {"," table.setStyle('width', '');"," }",""," // Set the scroller height"," if (xy) {"," // Account for the horizontal scrollbar in the overall height"," height -= scrollbarWidth;"," }",""," yScrollNode.setStyle('height',"," (height - outerScroller.get('offsetTop') -"," // because IE6 is returning clientHeight 0 initially"," styleDim(outerScroller, 'borderTopWidth') -"," styleDim(outerScroller, 'borderBottomWidth')) + 'px');",""," // Set the scroller width"," if (xy) {"," // For xy scrolling tables, the table should expand freely within"," // the x scroller"," yScroller.setStyle('width',"," (table.get('offsetWidth') + scrollbarWidth) + 'px');"," } else {"," this._uiSetYScrollWidth(width);"," }",""," if (captionTable && !xy) {"," captionTable.setStyle('width', yScroller.get('offsetWidth') + 'px');"," }",""," // Allow headerless scrolling"," if (thead && !fixedHeader) {"," fixedHeader = this._createYScrollHeader();",""," yScroller.prepend(fixedHeader);",""," this._syncScrollHeaders();"," }",""," if (fixedHeader) {"," this._syncScrollColumnWidths();",""," fixedHeader.setStyle('display', '');"," // This might need to come back if FF has issues"," //fixedHeader.setStyle('width', '100%');"," //(yScroller.get('clientWidth') + scrollbarWidth) + 'px');",""," if (!scrollbar) {"," scrollbar = this._createScrollbar();",""," this._bindScrollbar();",""," contentBox.prepend(scrollbar);"," }",""," this._uiSetScrollbarHeight();"," this._uiSetScrollbarPosition(outerScroller);"," }"," },",""," /**"," Assigns the appropriate class to the `boundingBox` to identify the DataTable"," as horizontally scrolling, vertically scrolling, or both (adds both classes).",""," Classes added are \"yui3-datatable-scrollable-x\" or \"...-y\"",""," @method _uiSetScrollable"," @protected"," @since 3.5.0"," **/"," _uiSetScrollable: function () {"," this.get('boundingBox')"," .toggleClass(this.getClassName('scrollable','x'), this._xScroll)"," .toggleClass(this.getClassName('scrollable','y'), this._yScroll);"," },",""," /**"," Updates the virtual scrollbar's height to avoid overlapping with the fixed"," headers.",""," @method _uiSetScrollbarHeight"," @protected"," @since 3.5.0"," **/"," _uiSetScrollbarHeight: function () {"," var scrollbar = this._scrollbarNode,"," scroller = this._yScrollNode,"," fixedHeader = this._yScrollHeader;",""," if (scrollbar && scroller && fixedHeader) {"," scrollbar.get('firstChild').setStyle('height',"," this._tbodyNode.get('scrollHeight') + 'px');",""," scrollbar.setStyle('height', "," (parseFloat(scroller.getComputedStyle('height')) -"," parseFloat(fixedHeader.getComputedStyle('height'))) + 'px');"," }"," },",""," /**"," Updates the virtual scrollbar's placement to avoid overlapping the fixed"," headers or the data table.",""," @method _uiSetScrollbarPosition"," @param {Node} scroller Reference node to position the scrollbar over"," @protected"," @since 3.5.0"," **/"," _uiSetScrollbarPosition: function (scroller) {"," var scrollbar = this._scrollbarNode,"," fixedHeader = this._yScrollHeader;",""," if (scrollbar && scroller && fixedHeader) {"," scrollbar.setStyles({"," // Using getCS instead of offsetHeight because FF uses"," // fractional values, but reports ints to offsetHeight, so"," // offsetHeight is unreliable. It is probably fine to use"," // offsetHeight in this case but this was left in place after"," // fixing an off-by-1px issue in FF 10- by fixing the caption"," // font style so FF picked it up."," top: (parseFloat(fixedHeader.getComputedStyle('height')) +"," styleDim(scroller, 'borderTopWidth') +"," scroller.get('offsetTop')) + 'px',",""," // Minus 1 because IE 6-10 require the scrolled area to be"," // visible by at least 1px or it won't respond to clicks on the"," // scrollbar rail or endcap arrows."," left: (scroller.get('offsetWidth') -"," Y.DOM.getScrollbarWidth() - 1 -"," styleDim(scroller, 'borderRightWidth')) + 'px'"," });"," }"," },",""," /**"," Assigns the width of the `<div>` wrapping the data table in vertically"," scrolling tables.",""," If the table can't compress to the specified width, the container is"," expanded accordingly.",""," @method _uiSetYScrollWidth"," @param {String} width The CSS width to attempt to set"," @protected"," @since 3.5.0"," **/"," _uiSetYScrollWidth: function (width) {"," var scroller = this._yScrollContainer,"," table = this._tableNode,"," tableWidth, borderWidth, scrollerWidth, scrollbarWidth;",""," if (scroller && table) {"," scrollbarWidth = Y.DOM.getScrollbarWidth();",""," if (width) {"," // Assumes no table border"," borderWidth = scroller.get('offsetWidth') -"," scroller.get('clientWidth') +"," scrollbarWidth; // added back at the end",""," // The table's rendered width might be greater than the"," // configured width"," scroller.setStyle('width', width);",""," // Have to subtract the border width from the configured width"," // because the scroller's width will need to be reduced by the"," // border width as well during the width reassignment below."," scrollerWidth = scroller.get('clientWidth') - borderWidth;",""," // Assumes no table borders"," table.setStyle('width', scrollerWidth + 'px');",""," tableWidth = table.get('offsetWidth');",""," // Expand the scroll node width if the table can't fit."," // Otherwise, reassign the scroller a pixel width that"," // accounts for the borders."," scroller.setStyle('width',"," (tableWidth + scrollbarWidth) + 'px');"," } else {"," // Allow the table to expand naturally"," table.setStyle('width', '');"," scroller.setStyle('width', '');",""," scroller.setStyle('width',"," (table.get('offsetWidth') + scrollbarWidth) + 'px');"," }"," }"," },",""," /**"," Detaches the scroll event subscriptions used to maintain scroll position"," parity between the scrollable `<div>` wrapper around the data table and the"," virtual scrollbar for vertically scrolling tables.",""," @method _unbindScrollbar"," @protected"," @since 3.5.0"," **/"," _unbindScrollbar: function () {"," if (this._scrollbarEventHandle) {"," this._scrollbarEventHandle.detach();"," }"," },",""," /**"," Detaches the resize event subscription used to maintain column parity for"," vertically scrolling tables with percentage widths.",""," @method _unbindScrollResize"," @protected"," @since 3.5.0"," **/"," _unbindScrollResize: function () {"," if (this._scrollResizeHandle) {"," this._scrollResizeHandle.detach();"," delete this._scrollResizeHandle;"," }"," }",""," /**"," Indicates horizontal table scrolling is enabled.",""," @property _xScroll"," @type {Boolean}"," @default undefined (not initially set)"," @private"," @since 3.5.0"," **/"," //_xScroll: null,",""," /**"," Indicates vertical table scrolling is enabled.",""," @property _yScroll"," @type {Boolean}"," @default undefined (not initially set)"," @private"," @since 3.5.0"," **/"," //_yScroll: null,",""," /**"," Fixed column header `<table>` Node for vertical scrolling tables.",""," @property _yScrollHeader"," @type {Node}"," @default undefined (not initially set)"," @protected"," @since 3.5.0"," **/"," //_yScrollHeader: null,",""," /**"," Overflow Node used to contain the data rows in a vertically scrolling table.",""," @property _yScrollNode"," @type {Node}"," @default undefined (not initially set)"," @protected"," @since 3.5.0"," **/"," //_yScrollNode: null,",""," /**"," Overflow Node used to contain the table headers and data in a horizontally"," scrolling table.",""," @property _xScrollNode"," @type {Node}"," @default undefined (not initially set)"," @protected"," @since 3.5.0"," **/"," //_xScrollNode: null","}, true);","","Y.Base.mix(Y.DataTable, [Scrollable]);","","","}, '3.7.3', {\"requires\": [\"datatable-base\", \"datatable-column-widths\", \"dom-screen\"], \"skinnable\": true});"]; _yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].lines = {"1":0,"11":0,"19":0,"20":0,"53":0,"55":0,"78":0,"96":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"108":0,"111":0,"114":0,"202":0,"206":0,"207":0,"208":0,"210":0,"211":0,"212":0,"227":0,"229":0,"230":0,"231":0,"233":0,"234":0,"238":0,"251":0,"252":0,"267":0,"268":0,"269":0,"272":0,"286":0,"287":0,"304":0,"305":0,"318":0,"320":0,"321":0,"322":0,"324":0,"325":0,"342":0,"343":0,"356":0,"359":0,"360":0,"376":0,"379":0,"396":0,"408":0,"421":0,"422":0,"423":0,"437":0,"439":0,"440":0,"447":0,"450":0,"463":0,"464":0,"469":0,"472":0,"485":0,"486":0,"492":0,"505":0,"507":0,"508":0,"514":0,"527":0,"529":0,"530":0,"532":0,"538":0,"542":0,"554":0,"555":0,"556":0,"557":0,"559":0,"570":0,"581":0,"582":0,"583":0,"584":0,"595":0,"596":0,"597":0,"610":0,"612":0,"615":0,"617":0,"628":0,"629":0,"630":0,"633":0,"635":0,"648":0,"650":0,"651":0,"652":0,"654":0,"667":0,"669":0,"670":0,"671":0,"673":0,"686":0,"687":0,"689":0,"702":0,"704":0,"705":0,"706":0,"708":0,"720":0,"721":0,"723":0,"725":0,"726":0,"728":0,"744":0,"745":0,"748":0,"749":0,"752":0,"767":0,"771":0,"772":0,"785":0,"790":0,"791":0,"792":0,"795":0,"796":0,"797":0,"799":0,"800":0,"814":0,"819":0,"820":0,"822":0,"823":0,"825":0,"828":0,"829":0,"831":0,"832":0,"833":0,"836":0,"838":0,"839":0,"852":0,"854":0,"857":0,"859":0,"878":0,"880":0,"894":0,"900":0,"901":0,"906":0,"908":0,"909":0,"916":0,"922":0,"924":0,"927":0,"929":0,"943":0,"950":0,"953":0,"954":0,"955":0,"957":0,"960":0,"962":0,"965":0,"966":0,"969":0,"970":0,"971":0,"974":0,"977":0,"978":0,"979":0,"982":0,"986":0,"987":0,"989":0,"990":0,"1004":0,"1012":0,"1013":0,"1017":0,"1022":0,"1025":0,"1026":0,"1027":0,"1028":0,"1033":0,"1037":0,"1038":0,"1040":0,"1041":0,"1042":0,"1044":0,"1048":0,"1052":0,"1054":0,"1055":0,"1058":0,"1074":0,"1089":0,"1090":0,"1093":0,"1094":0,"1096":0,"1098":0,"1101":0,"1103":0,"1104":0,"1108":0,"1110":0,"1113":0,"1120":0,"1123":0,"1126":0,"1129":0,"1130":0,"1134":0,"1135":0,"1137":0,"1139":0,"1142":0,"1143":0,"1145":0,"1150":0,"1151":0,"1153":0,"1155":0,"1158":0,"1159":0,"1174":0,"1188":0,"1192":0,"1193":0,"1196":0,"1212":0,"1215":0,"1216":0,"1250":0,"1254":0,"1255":0,"1257":0,"1259":0,"1265":0,"1270":0,"1273":0,"1275":0,"1280":0,"1284":0,"1285":0,"1287":0,"1303":0,"1304":0,"1317":0,"1318":0,"1319":0,"1380":0}; _yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].functions = {"styleDim:19":0,"scrollTo:95":0,"_addScrollbarPadding:201":0,"_afterScrollableChange:226":0,"_afterScrollCaptionChange:250":0,"_afterScrollColumnsChange:266":0,"_afterScrollDataChange:285":0,"_afterScrollHeightChange:303":0,"(anonymous 2):324":0,"_afterScrollSort:317":0,"_afterScrollWidthChange:341":0,"_bindScrollbar:355":0,"_bindScrollResize:375":0,"_bindScrollUI:395":0,"_clearScrollLock:420":0,"_createScrollbar:436":0,"_createScrollCaptionTable:462":0,"_createXScrollNode:484":0,"_createYScrollHeader:504":0,"_createYScrollNode:526":0,"_disableScrolling:553":0,"_disableXScrolling:569":0,"_disableYScrolling:580":0,"destructor:594":0,"initializer:609":0,"_removeScrollCaptionTable:627":0,"_removeXScrollNode:647":0,"_removeYScrollContainer:666":0,"_removeYScrollHeader:685":0,"_removeYScrollNode:701":0,"_removeScrollbar:719":0,"_setScrollable:743":0,"_setScrollProperties:766":0,"_syncScrollPosition:784":0,"_syncScrollCaptionUI:813":0,"(anonymous 3):858":0,"(anonymous 4):879":0,"_syncScrollColumnWidths:851":0,"(anonymous 5):908":0,"_syncScrollHeaders:893":0,"_syncScrollUI:942":0,"_syncXScrollUI:1003":0,"_syncYScrollUI:1073":0,"_uiSetScrollable:1173":0,"_uiSetScrollbarHeight:1187":0,"_uiSetScrollbarPosition:1211":0,"_uiSetYScrollWidth:1249":0,"_unbindScrollbar:1302":0,"_unbindScrollResize:1316":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-scroll/datatable-scroll.js"].coveredLines = 278;@@ -1747,4 +1747,4 @@ Y.Base.mix(Y.DataTable, [Scrollable]); -}, '3.7.2', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});
bundle/datatable-scroll/datatable-scroll-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1386,4 +1386,4 @@ Y.Base.mix(Y.DataTable, [Scrollable]); -}, '3.7.2', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});
bundle/datatable-scroll/datatable-scroll-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-scroll",function(e,t){function u(e,t){return parseInt(e.getComputedStyle(t),10)|0}var n=e.Lang,r=n.isString,i=n.isNumber,s=n.isArray,o;e.DataTable.Scrollable=o=function(){},o.ATTRS={scrollable:{value:!1,setter:"_setScrollable"}},e.mix(o.prototype,{scrollTo:function(t){var n;return t&&this._tbodyNode&&(this._yScrollNode||this._xScrollNode)&&(s(t)?n=this.getCell(t):i(t)?n=this.getRow(t):r(t)?n=this._tbodyNode.one("#"+t):t instanceof e.Node&&t.ancestor(".yui3-datatable")===this.get("boundingBox")&&(n=t),n&&n.scrollIntoView()),this},_CAPTION_TABLE_TEMPLATE:'<table class="{className}" role="presentation"></table>',_SCROLL_LINER_TEMPLATE:'<div class="{className}"></div>',_SCROLLBAR_TEMPLATE:'<div class="{className}"><div></div></div>',_X_SCROLLER_TEMPLATE:'<div class="{className}"></div>',_Y_SCROLL_HEADER_TEMPLATE:'<table cellspacing="0" aria-hidden="true" class="{className}"></table>',_Y_SCROLLER_TEMPLATE:'<div class="{className}"><div class="{scrollerClassName}"></div></div>',_addScrollbarPadding:function(){var t=this._yScrollHeader,n="."+this.getClassName("header"),r,i,s,o,u;if(t){r=e.DOM.getScrollbarWidth()+"px",i=t.all("tr");for(o=0,u=i.size();o<u;o+=+s.get("rowSpan"))s=i.item(o).all(n).pop(),s.setStyle("paddingRight",r)}},_afterScrollableChange:function(t){var n=this._xScrollNode;this._xScroll&&n&&(this._yScroll&&!this._yScrollNode?n.setStyle("paddingRight",e.DOM.getScrollbarWidth()+"px"):!this._yScroll&&this._yScrollNode&&n.setStyle("paddingRight","")),this._syncScrollUI()},_afterScrollCaptionChange:function(e){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_afterScrollColumnsChange:function(e){if(this._xScroll||this._yScroll)this._yScroll&&this._yScrollHeader&&this._syncScrollHeaders(),this._syncScrollUI()},_afterScrollDataChange:function(e){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_afterScrollHeightChange:function(e){this._yScroll&&this._syncScrollUI()},_afterScrollSort:function(e){var t,n;this._yScroll&&this._yScrollHeader&&(n="."+this.getClassName("header"),t=this._theadNode.all(n),this._yScrollHeader.all(n).each(function(e,n){e.set("className",t.item(n).get("className"))}))},_afterScrollWidthChange:function(e){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_bindScrollbar:function(){var t=this._scrollbarNode,n=this._yScrollNode;t&&n&&!this._scrollbarEventHandle&&(this._scrollbarEventHandle=new e.Event.Handle([t.on("scroll",this._syncScrollPosition,this),n.on("scroll",this._syncScrollPosition,this)]))},_bindScrollResize:function(){this._scrollResizeHandle||(this._scrollResizeHandle=e.on("resize",this._syncScrollUI,null,this))},_bindScrollUI:function(){this.after({columnsChange:e.bind("_afterScrollColumnsChange",this),heightChange:e.bind("_afterScrollHeightChange",this),widthChange:e.bind("_afterScrollWidthChange",this),captionChange:e.bind("_afterScrollCaptionChange",this),scrollableChange:e.bind("_afterScrollableChange",this),sort:e.bind("_afterScrollSort",this)}),this.after(["dataChange","*:add","*:remove","*:reset","*:change"],e.bind("_afterScrollDataChange",this))},_clearScrollLock:function(){this._scrollLock&&(this._scrollLock.cancel(),delete this._scrollLock)},_createScrollbar:function(){var t=this._scrollbarNode;return t||(t=this._scrollbarNode=e.Node.create(e.Lang.sub(this._SCROLLBAR_TEMPLATE,{className:this.getClassName("scrollbar")})),t.setStyle("width",e.DOM.getScrollbarWidth()+1+"px")),t},_createScrollCaptionTable:function(){return this._captionTable||(this._captionTable=e.Node.create(e.Lang.sub(this._CAPTION_TABLE_TEMPLATE,{className:this.getClassName("caption","table")})),this._captionTable.empty()),this._captionTable},_createXScrollNode:function(){return this._xScrollNode||(this._xScrollNode=e.Node.create(e.Lang.sub(this._X_SCROLLER_TEMPLATE,{className:this.getClassName("x","scroller")}))),this._xScrollNode},_createYScrollHeader:function(){var t=this._yScrollHeader;return t||(t=this._yScrollHeader=e.Node.create(e.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE,{className:this.getClassName("scroll","columns")}))),t},_createYScrollNode:function(){var t;return this._yScrollNode||(t=this.getClassName("y","scroller"),this._yScrollContainer=e.Node.create(e.Lang.sub(this._Y_SCROLLER_TEMPLATE,{className:this.getClassName("y","scroller","container"),scrollerClassName:t})),this._yScrollNode=this._yScrollContainer.one("."+t)),this._yScrollContainer},_disableScrolling:function(){this._removeScrollCaptionTable(),this._disableXScrolling(),this._disableYScrolling(),this._unbindScrollResize(),this._uiSetWidth(this.get("width"))},_disableXScrolling:function(){this._removeXScrollNode()},_disableYScrolling:function(){this._removeYScrollHeader(),this._removeYScrollNode(),this._removeYScrollContainer(),this._removeScrollbar()},destructor:function(){this._unbindScrollbar(),this._unbindScrollResize(),this._clearScrollLock()},initializer:function(){this._setScrollProperties(),this.after(["scrollableChange","heightChange","widthChange"],this._setScrollProperties),this.after("renderView",e.bind("_syncScrollUI",this)),e.Do.after(this._bindScrollUI,this,"bindUI")},_removeScrollCaptionTable:function(){this._captionTable&&(this._captionNode&&this._tableNode.prepend(this._captionNode),this._captionTable.remove().destroy(!0),delete this._captionTable)},_removeXScrollNode:function(){var e=this._xScrollNode;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._xScrollNode)},_removeYScrollContainer:function(){var e=this._yScrollContainer;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._yScrollContainer)},_removeYScrollHeader:function(){this._yScrollHeader&&(this._yScrollHeader.remove().destroy(!0),delete this._yScrollHeader)},_removeYScrollNode:function(){var e=this._yScrollNode;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._yScrollNode)},_removeScrollbar:function(){this._scrollbarNode&&(this._scrollbarNode.remove().destroy(!0),delete this._scrollbarNode),this._scrollbarEventHandle&&(this._scrollbarEventHandle.detach(),delete this._scrollbarEventHandle)},_setScrollable:function(t){return t===!0&&(t="xy"),r(t)&&(t=t.toLowerCase()),t===!1||t==="y"||t==="x"||t==="xy"?t:e.Attribute.INVALID_VALUE},_setScrollProperties:function(){var e=this.get("scrollable")||"",t=this.get("width"),n=this.get("height");this._xScroll=t&&e.indexOf("x")>-1,this._yScroll=n&&e.indexOf("y")>-1},_syncScrollPosition:function(t){var n=this._scrollbarNode,r=this._yScrollNode,i=t.currentTarget,s;if(n&&r){if(this._scrollLock&&this._scrollLock.source!==i)return;this._clearScrollLock(),this._scrollLock=e.later(300,this,this._clearScrollLock),this._scrollLock.source=i,s=i===n?r:n,s.set("scrollTop",i.get("scrollTop"))}},_syncScrollCaptionUI:function(){var t=this._captionNode,n=this._tableNode,r=this._captionTable,i;t?(i=t.getAttribute("id"),r||(r=this._createScrollCaptionTable(),this.get("contentBox").prepend(r)),t.get("parentNode").compareTo(r)||(r.empty().insert(t),i||(i=e.stamp(t),t.setAttribute("id",i)),n.setAttribute("aria-describedby",i))):r&&this._removeScrollCaptionTable()},_syncScrollColumnWidths:function(){var t=[];this._theadNode&&this._yScrollHeader&&(this._theadNode.all("."+this.getClassName("header")).each(function(n){t.push(e.UA.ie&&e.UA.ie<8?n.get("clientWidth")-u(n,"paddingLeft")-u(n,"paddingRight")+"px":n.getComputedStyle("width"))}),this._yScrollHeader.all("."+this.getClassName("scroll","liner")).each(function(e,n){e.setStyle("width",t[n])}))},_syncScrollHeaders:function(){var t=this._yScrollHeader,n=this._SCROLL_LINER_TEMPLATE,r=this.getClassName("scroll","liner"),i=this.getClassName("header"),s=this._theadNode.all("."+i);this._theadNode&&t&&(t.empty().appendChild(this._theadNode.cloneNode(!0)),t.all("[id]").removeAttribute("id"),t.all("."+i).each(function(t,i){var o=e.Node.create(e.Lang.sub(n,{className:r})),u=s.item(i);o.setStyle("padding",u.getComputedStyle("paddingTop")+" "+u.getComputedStyle("paddingRight")+" "+u.getComputedStyle("paddingBottom")+" "+u.getComputedStyle("paddingLeft")),o.appendChild(t.get("childNodes").toFrag()),t.appendChild(o)},this),this._syncScrollColumnWidths(),this._addScrollbarPadding())},_syncScrollUI:function(){var e=this._xScroll,t=this._yScroll,n=this._xScrollNode,r=this._yScrollNode,i=n&&n.get("scrollLeft"),s=r&&r.get("scrollTop");this._uiSetScrollable(),e||t?((this.get("width")||"").slice(-1)==="%"?this._bindScrollResize():this._unbindScrollResize(),this._syncScrollCaptionUI()):this._disableScrolling(),this._yScrollHeader&&this._yScrollHeader.setStyle("display","none"),e&&(t||this._disableYScrolling(),this._syncXScrollUI(t)),t&&(e||this._disableXScrolling(),this._syncYScrollUI(e)),i&&this._xScrollNode&&this._xScrollNode.set("scrollLeft",i),s&&this._yScrollNode&&this._yScrollNode.set("scrollTop",s)},_syncXScrollUI:function(t){var n=this._xScrollNode,r=this._yScrollContainer,i=this._tableNode,s=this.get("width"),o=this.get("boundingBox").get("offsetWidth"),a=e.DOM.getScrollbarWidth(),f,l;n||(n=this._createXScrollNode(),(r||i).replace(n).appendTo(n)),f=u(n,"borderLeftWidth")+u(n,"borderRightWidth"),n.setStyle("width",""),this._uiSetDim("width",""),t&&this._yScrollContainer&&this._yScrollContainer.setStyle("width",""),e.UA.ie&&e.UA.ie<8&&(i.setStyle("width",s),i.get("offsetWidth")),i.setStyle("width",""),l=i.get("offsetWidth"),i.setStyle("width",l+"px"),this._uiSetDim("width",s),n.setStyle("width",o-f+"px"),n.get("offsetWidth")-f>l&&(t?i.setStyle("width",n.get("offsetWidth")-f-a+"px"):i.setStyle("width","100%"))},_syncYScrollUI:function(t){var n=this._yScrollContainer,r=this._yScrollNode,i=this._xScrollNode,s=this._yScrollHeader,o=this._scrollbarNode,a=this._tableNode,f=this._theadNode,l=this._captionTable,c=this.get("boundingBox"),h=this.get("contentBox"),p=this.get("width"),d=c.get("offsetHeight"),v=e.DOM.getScrollbarWidth(),m;l&&!t&&l.setStyle("width",p||"100%"),n||(n=this._createYScrollNode(),r=this._yScrollNode,a.replace(n).appendTo(r)),m=t?i:n,t||a.setStyle("width",""),t&&(d-=v),r.setStyle("height",d-m.get("offsetTop")-u(m,"borderTopWidth")-u(m,"borderBottomWidth")+"px"),t?n.setStyle("width",a.get("offsetWidth")+v+"px"):this._uiSetYScrollWidth(p),l&&!t&&l.setStyle("width",n.get("offsetWidth")+"px"),f&&!s&&(s=this._createYScrollHeader(),n.prepend(s),this._syncScrollHeaders()),s&&(this._syncScrollColumnWidths(),s.setStyle("display",""),o||(o=this._createScrollbar(),this._bindScrollbar(),h.prepend(o)),this._uiSetScrollbarHeight(),this._uiSetScrollbarPosition(m))},_uiSetScrollable:function(){this.get("boundingBox").toggleClass(this.getClassName("scrollable","x"),this._xScroll).toggleClass(this.getClassName("scrollable","y"),this._yScroll)},_uiSetScrollbarHeight:function(){var e=this._scrollbarNode,t=this._yScrollNode,n=this._yScrollHeader;e&&t&&n&&(e.get("firstChild").setStyle("height",this._tbodyNode.get("scrollHeight")+"px"),e.setStyle("height",parseFloat(t.getComputedStyle("height"))-parseFloat(n.getComputedStyle("height"))+"px"))},_uiSetScrollbarPosition:function(t){var n=this._scrollbarNode,r=this._yScrollHeader;n&&t&&r&&n.setStyles({top:parseFloat(r.getComputedStyle("height"))+u(t,"borderTopWidth")+t.get("offsetTop")+"px",left:t.get("offsetWidth")-e.DOM.getScrollbarWidth()-1-u(t,"borderRightWidth")+"px"})},_uiSetYScrollWidth:function(t){var n=this._yScrollContainer,r=this._tableNode,i,s,o,u;n&&r&&(u=e.DOM.getScrollbarWidth(),t?(s=n.get("offsetWidth")-n.get("clientWidth")+u,n.setStyle("width",t),o=n.get("clientWidth")-s,r.setStyle("width",o+"px"),i=r.get("offsetWidth"),n.setStyle("width",i+u+"px")):(r.setStyle("width",""),n.setStyle("width",""),n.setStyle("width",r.get("offsetWidth")+u+"px")))},_unbindScrollbar:function(){this._scrollbarEventHandle&&this._scrollbarEventHandle.detach()},_unbindScrollResize:function(){this._scrollResizeHandle&&(this._scrollResizeHandle.detach(),delete this._scrollResizeHandle)}},!0),e.Base.mix(e.DataTable,[o])},"3.7.2",{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0});+YUI.add("datatable-scroll",function(e,t){function u(e,t){return parseInt(e.getComputedStyle(t),10)|0}var n=e.Lang,r=n.isString,i=n.isNumber,s=n.isArray,o;e.DataTable.Scrollable=o=function(){},o.ATTRS={scrollable:{value:!1,setter:"_setScrollable"}},e.mix(o.prototype,{scrollTo:function(t){var n;return t&&this._tbodyNode&&(this._yScrollNode||this._xScrollNode)&&(s(t)?n=this.getCell(t):i(t)?n=this.getRow(t):r(t)?n=this._tbodyNode.one("#"+t):t instanceof e.Node&&t.ancestor(".yui3-datatable")===this.get("boundingBox")&&(n=t),n&&n.scrollIntoView()),this},_CAPTION_TABLE_TEMPLATE:'<table class="{className}" role="presentation"></table>',_SCROLL_LINER_TEMPLATE:'<div class="{className}"></div>',_SCROLLBAR_TEMPLATE:'<div class="{className}"><div></div></div>',_X_SCROLLER_TEMPLATE:'<div class="{className}"></div>',_Y_SCROLL_HEADER_TEMPLATE:'<table cellspacing="0" aria-hidden="true" class="{className}"></table>',_Y_SCROLLER_TEMPLATE:'<div class="{className}"><div class="{scrollerClassName}"></div></div>',_addScrollbarPadding:function(){var t=this._yScrollHeader,n="."+this.getClassName("header"),r,i,s,o,u;if(t){r=e.DOM.getScrollbarWidth()+"px",i=t.all("tr");for(o=0,u=i.size();o<u;o+=+s.get("rowSpan"))s=i.item(o).all(n).pop(),s.setStyle("paddingRight",r)}},_afterScrollableChange:function(t){var n=this._xScrollNode;this._xScroll&&n&&(this._yScroll&&!this._yScrollNode?n.setStyle("paddingRight",e.DOM.getScrollbarWidth()+"px"):!this._yScroll&&this._yScrollNode&&n.setStyle("paddingRight","")),this._syncScrollUI()},_afterScrollCaptionChange:function(e){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_afterScrollColumnsChange:function(e){if(this._xScroll||this._yScroll)this._yScroll&&this._yScrollHeader&&this._syncScrollHeaders(),this._syncScrollUI()},_afterScrollDataChange:function(e){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_afterScrollHeightChange:function(e){this._yScroll&&this._syncScrollUI()},_afterScrollSort:function(e){var t,n;this._yScroll&&this._yScrollHeader&&(n="."+this.getClassName("header"),t=this._theadNode.all(n),this._yScrollHeader.all(n).each(function(e,n){e.set("className",t.item(n).get("className"))}))},_afterScrollWidthChange:function(e){(this._xScroll||this._yScroll)&&this._syncScrollUI()},_bindScrollbar:function(){var t=this._scrollbarNode,n=this._yScrollNode;t&&n&&!this._scrollbarEventHandle&&(this._scrollbarEventHandle=new e.Event.Handle([t.on("scroll",this._syncScrollPosition,this),n.on("scroll",this._syncScrollPosition,this)]))},_bindScrollResize:function(){this._scrollResizeHandle||(this._scrollResizeHandle=e.on("resize",this._syncScrollUI,null,this))},_bindScrollUI:function(){this.after({columnsChange:e.bind("_afterScrollColumnsChange",this),heightChange:e.bind("_afterScrollHeightChange",this),widthChange:e.bind("_afterScrollWidthChange",this),captionChange:e.bind("_afterScrollCaptionChange",this),scrollableChange:e.bind("_afterScrollableChange",this),sort:e.bind("_afterScrollSort",this)}),this.after(["dataChange","*:add","*:remove","*:reset","*:change"],e.bind("_afterScrollDataChange",this))},_clearScrollLock:function(){this._scrollLock&&(this._scrollLock.cancel(),delete this._scrollLock)},_createScrollbar:function(){var t=this._scrollbarNode;return t||(t=this._scrollbarNode=e.Node.create(e.Lang.sub(this._SCROLLBAR_TEMPLATE,{className:this.getClassName("scrollbar")})),t.setStyle("width",e.DOM.getScrollbarWidth()+1+"px")),t},_createScrollCaptionTable:function(){return this._captionTable||(this._captionTable=e.Node.create(e.Lang.sub(this._CAPTION_TABLE_TEMPLATE,{className:this.getClassName("caption","table")})),this._captionTable.empty()),this._captionTable},_createXScrollNode:function(){return this._xScrollNode||(this._xScrollNode=e.Node.create(e.Lang.sub(this._X_SCROLLER_TEMPLATE,{className:this.getClassName("x","scroller")}))),this._xScrollNode},_createYScrollHeader:function(){var t=this._yScrollHeader;return t||(t=this._yScrollHeader=e.Node.create(e.Lang.sub(this._Y_SCROLL_HEADER_TEMPLATE,{className:this.getClassName("scroll","columns")}))),t},_createYScrollNode:function(){var t;return this._yScrollNode||(t=this.getClassName("y","scroller"),this._yScrollContainer=e.Node.create(e.Lang.sub(this._Y_SCROLLER_TEMPLATE,{className:this.getClassName("y","scroller","container"),scrollerClassName:t})),this._yScrollNode=this._yScrollContainer.one("."+t)),this._yScrollContainer},_disableScrolling:function(){this._removeScrollCaptionTable(),this._disableXScrolling(),this._disableYScrolling(),this._unbindScrollResize(),this._uiSetWidth(this.get("width"))},_disableXScrolling:function(){this._removeXScrollNode()},_disableYScrolling:function(){this._removeYScrollHeader(),this._removeYScrollNode(),this._removeYScrollContainer(),this._removeScrollbar()},destructor:function(){this._unbindScrollbar(),this._unbindScrollResize(),this._clearScrollLock()},initializer:function(){this._setScrollProperties(),this.after(["scrollableChange","heightChange","widthChange"],this._setScrollProperties),this.after("renderView",e.bind("_syncScrollUI",this)),e.Do.after(this._bindScrollUI,this,"bindUI")},_removeScrollCaptionTable:function(){this._captionTable&&(this._captionNode&&this._tableNode.prepend(this._captionNode),this._captionTable.remove().destroy(!0),delete this._captionTable)},_removeXScrollNode:function(){var e=this._xScrollNode;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._xScrollNode)},_removeYScrollContainer:function(){var e=this._yScrollContainer;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._yScrollContainer)},_removeYScrollHeader:function(){this._yScrollHeader&&(this._yScrollHeader.remove().destroy(!0),delete this._yScrollHeader)},_removeYScrollNode:function(){var e=this._yScrollNode;e&&(e.replace(e.get("childNodes").toFrag()),e.remove().destroy(!0),delete this._yScrollNode)},_removeScrollbar:function(){this._scrollbarNode&&(this._scrollbarNode.remove().destroy(!0),delete this._scrollbarNode),this._scrollbarEventHandle&&(this._scrollbarEventHandle.detach(),delete this._scrollbarEventHandle)},_setScrollable:function(t){return t===!0&&(t="xy"),r(t)&&(t=t.toLowerCase()),t===!1||t==="y"||t==="x"||t==="xy"?t:e.Attribute.INVALID_VALUE},_setScrollProperties:function(){var e=this.get("scrollable")||"",t=this.get("width"),n=this.get("height");this._xScroll=t&&e.indexOf("x")>-1,this._yScroll=n&&e.indexOf("y")>-1},_syncScrollPosition:function(t){var n=this._scrollbarNode,r=this._yScrollNode,i=t.currentTarget,s;if(n&&r){if(this._scrollLock&&this._scrollLock.source!==i)return;this._clearScrollLock(),this._scrollLock=e.later(300,this,this._clearScrollLock),this._scrollLock.source=i,s=i===n?r:n,s.set("scrollTop",i.get("scrollTop"))}},_syncScrollCaptionUI:function(){var t=this._captionNode,n=this._tableNode,r=this._captionTable,i;t?(i=t.getAttribute("id"),r||(r=this._createScrollCaptionTable(),this.get("contentBox").prepend(r)),t.get("parentNode").compareTo(r)||(r.empty().insert(t),i||(i=e.stamp(t),t.setAttribute("id",i)),n.setAttribute("aria-describedby",i))):r&&this._removeScrollCaptionTable()},_syncScrollColumnWidths:function(){var t=[];this._theadNode&&this._yScrollHeader&&(this._theadNode.all("."+this.getClassName("header")).each(function(n){t.push(e.UA.ie&&e.UA.ie<8?n.get("clientWidth")-u(n,"paddingLeft")-u(n,"paddingRight")+"px":n.getComputedStyle("width"))}),this._yScrollHeader.all("."+this.getClassName("scroll","liner")).each(function(e,n){e.setStyle("width",t[n])}))},_syncScrollHeaders:function(){var t=this._yScrollHeader,n=this._SCROLL_LINER_TEMPLATE,r=this.getClassName("scroll","liner"),i=this.getClassName("header"),s=this._theadNode.all("."+i);this._theadNode&&t&&(t.empty().appendChild(this._theadNode.cloneNode(!0)),t.all("[id]").removeAttribute("id"),t.all("."+i).each(function(t,i){var o=e.Node.create(e.Lang.sub(n,{className:r})),u=s.item(i);o.setStyle("padding",u.getComputedStyle("paddingTop")+" "+u.getComputedStyle("paddingRight")+" "+u.getComputedStyle("paddingBottom")+" "+u.getComputedStyle("paddingLeft")),o.appendChild(t.get("childNodes").toFrag()),t.appendChild(o)},this),this._syncScrollColumnWidths(),this._addScrollbarPadding())},_syncScrollUI:function(){var e=this._xScroll,t=this._yScroll,n=this._xScrollNode,r=this._yScrollNode,i=n&&n.get("scrollLeft"),s=r&&r.get("scrollTop");this._uiSetScrollable(),e||t?((this.get("width")||"").slice(-1)==="%"?this._bindScrollResize():this._unbindScrollResize(),this._syncScrollCaptionUI()):this._disableScrolling(),this._yScrollHeader&&this._yScrollHeader.setStyle("display","none"),e&&(t||this._disableYScrolling(),this._syncXScrollUI(t)),t&&(e||this._disableXScrolling(),this._syncYScrollUI(e)),i&&this._xScrollNode&&this._xScrollNode.set("scrollLeft",i),s&&this._yScrollNode&&this._yScrollNode.set("scrollTop",s)},_syncXScrollUI:function(t){var n=this._xScrollNode,r=this._yScrollContainer,i=this._tableNode,s=this.get("width"),o=this.get("boundingBox").get("offsetWidth"),a=e.DOM.getScrollbarWidth(),f,l;n||(n=this._createXScrollNode(),(r||i).replace(n).appendTo(n)),f=u(n,"borderLeftWidth")+u(n,"borderRightWidth"),n.setStyle("width",""),this._uiSetDim("width",""),t&&this._yScrollContainer&&this._yScrollContainer.setStyle("width",""),e.UA.ie&&e.UA.ie<8&&(i.setStyle("width",s),i.get("offsetWidth")),i.setStyle("width",""),l=i.get("offsetWidth"),i.setStyle("width",l+"px"),this._uiSetDim("width",s),n.setStyle("width",o-f+"px"),n.get("offsetWidth")-f>l&&(t?i.setStyle("width",n.get("offsetWidth")-f-a+"px"):i.setStyle("width","100%"))},_syncYScrollUI:function(t){var n=this._yScrollContainer,r=this._yScrollNode,i=this._xScrollNode,s=this._yScrollHeader,o=this._scrollbarNode,a=this._tableNode,f=this._theadNode,l=this._captionTable,c=this.get("boundingBox"),h=this.get("contentBox"),p=this.get("width"),d=c.get("offsetHeight"),v=e.DOM.getScrollbarWidth(),m;l&&!t&&l.setStyle("width",p||"100%"),n||(n=this._createYScrollNode(),r=this._yScrollNode,a.replace(n).appendTo(r)),m=t?i:n,t||a.setStyle("width",""),t&&(d-=v),r.setStyle("height",d-m.get("offsetTop")-u(m,"borderTopWidth")-u(m,"borderBottomWidth")+"px"),t?n.setStyle("width",a.get("offsetWidth")+v+"px"):this._uiSetYScrollWidth(p),l&&!t&&l.setStyle("width",n.get("offsetWidth")+"px"),f&&!s&&(s=this._createYScrollHeader(),n.prepend(s),this._syncScrollHeaders()),s&&(this._syncScrollColumnWidths(),s.setStyle("display",""),o||(o=this._createScrollbar(),this._bindScrollbar(),h.prepend(o)),this._uiSetScrollbarHeight(),this._uiSetScrollbarPosition(m))},_uiSetScrollable:function(){this.get("boundingBox").toggleClass(this.getClassName("scrollable","x"),this._xScroll).toggleClass(this.getClassName("scrollable","y"),this._yScroll)},_uiSetScrollbarHeight:function(){var e=this._scrollbarNode,t=this._yScrollNode,n=this._yScrollHeader;e&&t&&n&&(e.get("firstChild").setStyle("height",this._tbodyNode.get("scrollHeight")+"px"),e.setStyle("height",parseFloat(t.getComputedStyle("height"))-parseFloat(n.getComputedStyle("height"))+"px"))},_uiSetScrollbarPosition:function(t){var n=this._scrollbarNode,r=this._yScrollHeader;n&&t&&r&&n.setStyles({top:parseFloat(r.getComputedStyle("height"))+u(t,"borderTopWidth")+t.get("offsetTop")+"px",left:t.get("offsetWidth")-e.DOM.getScrollbarWidth()-1-u(t,"borderRightWidth")+"px"})},_uiSetYScrollWidth:function(t){var n=this._yScrollContainer,r=this._tableNode,i,s,o,u;n&&r&&(u=e.DOM.getScrollbarWidth(),t?(s=n.get("offsetWidth")-n.get("clientWidth")+u,n.setStyle("width",t),o=n.get("clientWidth")-s,r.setStyle("width",o+"px"),i=r.get("offsetWidth"),n.setStyle("width",i+u+"px")):(r.setStyle("width",""),n.setStyle("width",""),n.setStyle("width",r.get("offsetWidth")+u+"px")))},_unbindScrollbar:function(){this._scrollbarEventHandle&&this._scrollbarEventHandle.detach()},_unbindScrollResize:function(){this._scrollResizeHandle&&(this._scrollResizeHandle.detach(),delete this._scrollResizeHandle)}},!0),e.Base.mix(e.DataTable,[o])},"3.7.3",{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0});
bundle/datatable-scroll/datatable-scroll.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1386,4 +1386,4 @@ Y.Base.mix(Y.DataTable, [Scrollable]); -}, '3.7.2', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base", "datatable-column-widths", "dom-screen"], "skinnable": true});
bundle/datatable-sort-deprecated/datatable-sort-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/datatable-sort-deprecated/datatable-sort-deprecated.js", code: [] };-_yuitest_coverage["/build/datatable-sort-deprecated/datatable-sort-deprecated.js"].code=["YUI.add('datatable-sort-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","Plugs DataTable with sorting functionality.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","is designed to work with `datatable-base-deprecated` (effectively the 3.4.1","version of DataTable) and will be removed from the library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-sort-deprecated","@deprecated","**/","","/*"," * Adds column sorting to DataTable."," * @class DataTableSort"," * @extends Plugin.Base"," */","var YgetClassName = Y.ClassNameManager.getClassName,",""," DATATABLE = \"datatable\","," COLUMN = \"column\","," ASC = \"asc\","," DESC = \"desc\",",""," //TODO: Don't use hrefs - use tab/arrow/enter"," TEMPLATE = '<a class=\"{link_class}\" title=\"{link_title}\" href=\"{link_href}\">{value}</a>';","","","function DataTableSort() {"," DataTableSort.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableSort, {"," /*"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"sort\""," */"," NS: \"sort\",",""," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableSort\""," */"," NAME: \"dataTableSort\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute trigger"," * @description Defines the trigger that causes a column to be sorted:"," * {event, selector}, where \"event\" is an event type and \"selector\" is"," * is a node query selector."," * @type Object"," * @default {event:\"click\", selector:\"th\"}"," * @writeOnce \"initOnly\""," */"," trigger: {"," value: {event:\"click\", selector:\"th\"},"," writeOnce: \"initOnly\""," },"," "," /*"," * @attribute lastSortedBy"," * @description Describes last known sort state: {key,dir}, where"," * \"key\" is column key and \"dir\" is either \"asc\" or \"desc\"."," * @type Object"," */"," lastSortedBy: {"," setter: \"_setLastSortedBy\","," lazyAdd: false"," },"," "," /*"," * @attribute template"," * @description Tokenized markup template for TH sort element."," * @type String"," * @default '<a class=\"{link_class}\" title=\"{link_title}\" href=\"{link_href}\">{value}</a>'"," */"," template: {"," value: TEMPLATE"," },",""," /*"," * Strings used in the UI elements."," *"," * The strings used are defaulted from the datatable-sort language pack"," * for the language identified in the YUI \"lang\" configuration (which"," * defaults to \"en\")."," *"," * Configurable strings are \"sortBy\" and \"reverseSortBy\", which are"," * assigned to the sort link's title attribute."," *"," * @attribute strings"," * @type {Object}"," */"," strings: {"," valueFn: function () { return Y.Intl.get('datatable-sort-deprecated'); }"," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableSort, Y.Plugin.Base, {",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," var dt = this.get(\"host\"),"," trigger = this.get(\"trigger\");"," "," dt.get(\"recordset\").plug(Y.Plugin.RecordsetSort, {dt: dt});"," dt.get(\"recordset\").sort.addTarget(dt);"," "," // Wrap link around TH value"," this.doBefore(\"_createTheadThNode\", this._beforeCreateTheadThNode);"," "," // Add class"," this.doBefore(\"_attachTheadThNode\", this._beforeAttachTheadThNode);"," this.doBefore(\"_attachTbodyTdNode\", this._beforeAttachTbodyTdNode);",""," // Attach trigger handlers"," dt.delegate(trigger.event, Y.bind(this._onEventSortColumn,this), trigger.selector);",""," // Attach UI hooks"," dt.after(\"recordsetSort:sort\", function() {"," this._uiSetRecordset(this.get(\"recordset\"));"," });"," this.on(\"lastSortedByChange\", function(e) {"," this._uiSetLastSortedBy(e.prevVal, e.newVal, dt);"," });",""," //TODO"," //dt.after(\"recordset:mutation\", function() {//reset lastSortedBy});"," "," //TODO"," //add Column sortFn ATTR"," "," // Update UI after the fact (render-then-plug case)"," if(dt.get(\"rendered\")) {"," dt._uiSetColumnset(dt.get(\"columnset\"));"," this._uiSetLastSortedBy(null, this.get(\"lastSortedBy\"), dt);"," }"," },",""," /*"," * @method _setLastSortedBy"," * @description Normalizes lastSortedBy"," * @param val {String | Object} {key, dir} or \"key\""," * @return {key, dir, notdir}"," * @private"," */"," _setLastSortedBy: function(val) {"," if (Y.Lang.isString(val)) {"," val = { key: val, dir: \"desc\" };"," }",""," if (val) {"," return (val.dir === \"desc\") ?"," { key: val.key, dir: \"desc\", notdir: \"asc\" } :"," { key: val.key, dir: \"asc\", notdir:\"desc\" };"," } else {"," return null;"," }"," },",""," /*"," * Updates sort UI."," *"," * @method _uiSetLastSortedBy"," * @param val {Object} New lastSortedBy object {key,dir}."," * @param dt {Y.DataTable.Base} Host."," * @protected"," */"," _uiSetLastSortedBy: function(prevVal, newVal, dt) {"," var strings = this.get('strings'),"," columnset = dt.get(\"columnset\"),"," prevKey = prevVal && prevVal.key,"," newKey = newVal && newVal.key,"," prevClass = prevVal && dt.getClassName(prevVal.dir),"," newClass = newVal && dt.getClassName(newVal.dir),"," prevColumn = columnset.keyHash[prevKey],"," newColumn = columnset.keyHash[newKey],"," tbodyNode = dt._tbodyNode,"," fromTemplate = Y.Lang.sub,"," th, sortArrow, sortLabel;",""," // Clear previous UI"," if (prevColumn && prevClass) {"," th = prevColumn.thNode;"," sortArrow = th.one('a');",""," if (sortArrow) {"," sortArrow.set('title', fromTemplate(strings.sortBy, {"," column: prevColumn.get('label')"," }));"," }",""," th.removeClass(prevClass);"," tbodyNode.all(\".\" + YgetClassName(COLUMN, prevColumn.get(\"id\")))"," .removeClass(prevClass);"," }",""," // Add new sort UI"," if (newColumn && newClass) {"," th = newColumn.thNode;"," sortArrow = th.one('a');",""," if (sortArrow) {"," sortLabel = (newVal.dir === ASC) ? \"reverseSortBy\" : \"sortBy\";",""," sortArrow.set('title', fromTemplate(strings[sortLabel], {"," column: newColumn.get('label')"," }));"," }",""," th.addClass(newClass);",""," tbodyNode.all(\".\" + YgetClassName(COLUMN, newColumn.get(\"id\")))"," .addClass(newClass);"," }"," },",""," /*"," * Before header cell element is created, inserts link markup around {value}."," *"," * @method _beforeCreateTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _beforeCreateTheadThNode: function(o) {"," var sortedBy, sortLabel;",""," if (o.column.get(\"sortable\")) {"," sortedBy = this.get('lastSortedBy');",""," sortLabel = (sortedBy && sortedBy.dir === ASC &&"," sortedBy.key === o.column.get('key')) ?"," \"reverseSortBy\" : \"sortBy\";",""," o.value = Y.Lang.sub(this.get(\"template\"), {"," link_class: o.link_class || \"\","," link_title: Y.Lang.sub(this.get('strings.' + sortLabel), {"," column: o.column.get('label')"," }),"," link_href: \"#\","," value: o.value"," });"," }"," },",""," /*"," * Before header cell element is attached, sets applicable class names."," *"," * @method _beforeAttachTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _beforeAttachTheadThNode: function(o) {"," var lastSortedBy = this.get(\"lastSortedBy\"),"," key = lastSortedBy && lastSortedBy.key,"," dir = lastSortedBy && lastSortedBy.dir,"," notdir = lastSortedBy && lastSortedBy.notdir;",""," // This Column is sortable"," if(o.column.get(\"sortable\")) {"," o.th.addClass(YgetClassName(DATATABLE, \"sortable\"));"," }"," // This Column is currently sorted"," if(key && (key === o.column.get(\"key\"))) {"," o.th.replaceClass(YgetClassName(DATATABLE, notdir), YgetClassName(DATATABLE, dir));"," }"," },",""," /*"," * Before header cell element is attached, sets applicable class names."," *"," * @method _beforeAttachTbodyTdNode"," * @param o {Object} {record, column, tr, headers, classnames, value}."," * @protected"," */"," _beforeAttachTbodyTdNode: function(o) {"," var lastSortedBy = this.get(\"lastSortedBy\"),"," key = lastSortedBy && lastSortedBy.key,"," dir = lastSortedBy && lastSortedBy.dir,"," notdir = lastSortedBy && lastSortedBy.notdir;",""," // This Column is sortable"," if(o.column.get(\"sortable\")) {"," o.td.addClass(YgetClassName(DATATABLE, \"sortable\"));"," }"," // This Column is currently sorted"," if(key && (key === o.column.get(\"key\"))) {"," o.td.replaceClass(YgetClassName(DATATABLE, notdir), YgetClassName(DATATABLE, dir));"," }"," },"," /*"," * In response to the \"trigger\" event, sorts the underlying Recordset and"," * updates the lastSortedBy attribute."," *"," * @method _onEventSortColumn"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _onEventSortColumn: function(e) {"," e.halt();"," //TODO: normalize e.currentTarget to TH"," var table = this.get(\"host\"),"," column = table.get(\"columnset\").idHash[e.currentTarget.get(\"id\")],"," key, field, lastSort, desc, sorter;",""," if (column.get(\"sortable\")) {"," key = column.get(\"key\");"," field = column.get(\"field\");"," lastSort = this.get(\"lastSortedBy\") || {};"," desc = (lastSort.key === key && lastSort.dir === ASC);"," sorter = column.get(\"sortFn\");",""," table.get(\"recordset\").sort.sort(field, desc, sorter);",""," this.set(\"lastSortedBy\", {"," key: key,"," dir: (desc) ? DESC : ASC"," });"," }"," }","});","","Y.namespace(\"Plugin\").DataTableSort = DataTableSort;","","","","","","}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});"];+_yuitest_coverage["/build/datatable-sort-deprecated/datatable-sort-deprecated.js"].code=["YUI.add('datatable-sort-deprecated', function(Y) {","","// API Doc comments disabled to avoid deprecated class leakage into","// non-deprecated class API docs. See the 3.4.1 datatable API doc files in the","// download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip for reference.","/**","Plugs DataTable with sorting functionality.","","DEPRECATED. As of YUI 3.5.0, DataTable has been rebuilt. This module","is designed to work with `datatable-base-deprecated` (effectively the 3.4.1","version of DataTable) and will be removed from the library in a future version.","","See http://yuilibrary.com/yui/docs/migration.html for help upgrading to the","latest version.","","For complete API docs for the classes in this and other deprecated","DataTable-related modules, refer to the static API doc files in the 3.4.1","download at http://yui.zenfs.com/releases/yui3/yui_3.4.1.zip","","@module datatable-deprecated","@submodule datatable-sort-deprecated","@deprecated","**/","","/*"," * Adds column sorting to DataTable."," * @class DataTableSort"," * @extends Plugin.Base"," */","var YgetClassName = Y.ClassNameManager.getClassName,",""," DATATABLE = \"datatable\","," COLUMN = \"column\","," ASC = \"asc\","," DESC = \"desc\",",""," //TODO: Don't use hrefs - use tab/arrow/enter"," TEMPLATE = '<a class=\"{link_class}\" title=\"{link_title}\" href=\"{link_href}\">{value}</a>';","","","function DataTableSort() {"," DataTableSort.superclass.constructor.apply(this, arguments);","}","","/////////////////////////////////////////////////////////////////////////////","//","// STATIC PROPERTIES","//","/////////////////////////////////////////////////////////////////////////////","Y.mix(DataTableSort, {"," /*"," * The namespace for the plugin. This will be the property on the host which"," * references the plugin instance."," *"," * @property NS"," * @type String"," * @static"," * @final"," * @value \"sort\""," */"," NS: \"sort\",",""," /*"," * Class name."," *"," * @property NAME"," * @type String"," * @static"," * @final"," * @value \"dataTableSort\""," */"," NAME: \"dataTableSort\",","","/////////////////////////////////////////////////////////////////////////////","//","// ATTRIBUTES","//","/////////////////////////////////////////////////////////////////////////////"," ATTRS: {"," /*"," * @attribute trigger"," * @description Defines the trigger that causes a column to be sorted:"," * {event, selector}, where \"event\" is an event type and \"selector\" is"," * is a node query selector."," * @type Object"," * @default {event:\"click\", selector:\"th\"}"," * @writeOnce \"initOnly\""," */"," trigger: {"," value: {event:\"click\", selector:\"th\"},"," writeOnce: \"initOnly\""," },"," "," /*"," * @attribute lastSortedBy"," * @description Describes last known sort state: {key,dir}, where"," * \"key\" is column key and \"dir\" is either \"asc\" or \"desc\"."," * @type Object"," */"," lastSortedBy: {"," setter: \"_setLastSortedBy\","," lazyAdd: false"," },"," "," /*"," * @attribute template"," * @description Tokenized markup template for TH sort element."," * @type String"," * @default '<a class=\"{link_class}\" title=\"{link_title}\" href=\"{link_href}\">{value}</a>'"," */"," template: {"," value: TEMPLATE"," },",""," /*"," * Strings used in the UI elements."," *"," * The strings used are defaulted from the datatable-sort language pack"," * for the language identified in the YUI \"lang\" configuration (which"," * defaults to \"en\")."," *"," * Configurable strings are \"sortBy\" and \"reverseSortBy\", which are"," * assigned to the sort link's title attribute."," *"," * @attribute strings"," * @type {Object}"," */"," strings: {"," valueFn: function () { return Y.Intl.get('datatable-sort-deprecated'); }"," }"," }","});","","/////////////////////////////////////////////////////////////////////////////","//","// PROTOTYPE","//","/////////////////////////////////////////////////////////////////////////////","Y.extend(DataTableSort, Y.Plugin.Base, {",""," /////////////////////////////////////////////////////////////////////////////"," //"," // METHODS"," //"," /////////////////////////////////////////////////////////////////////////////"," /*"," * Initializer."," *"," * @method initializer"," * @param config {Object} Config object."," * @private"," */"," initializer: function(config) {"," var dt = this.get(\"host\"),"," trigger = this.get(\"trigger\");"," "," dt.get(\"recordset\").plug(Y.Plugin.RecordsetSort, {dt: dt});"," dt.get(\"recordset\").sort.addTarget(dt);"," "," // Wrap link around TH value"," this.doBefore(\"_createTheadThNode\", this._beforeCreateTheadThNode);"," "," // Add class"," this.doBefore(\"_attachTheadThNode\", this._beforeAttachTheadThNode);"," this.doBefore(\"_attachTbodyTdNode\", this._beforeAttachTbodyTdNode);",""," // Attach trigger handlers"," dt.delegate(trigger.event, Y.bind(this._onEventSortColumn,this), trigger.selector);",""," // Attach UI hooks"," dt.after(\"recordsetSort:sort\", function() {"," this._uiSetRecordset(this.get(\"recordset\"));"," });"," this.on(\"lastSortedByChange\", function(e) {"," this._uiSetLastSortedBy(e.prevVal, e.newVal, dt);"," });",""," //TODO"," //dt.after(\"recordset:mutation\", function() {//reset lastSortedBy});"," "," //TODO"," //add Column sortFn ATTR"," "," // Update UI after the fact (render-then-plug case)"," if(dt.get(\"rendered\")) {"," dt._uiSetColumnset(dt.get(\"columnset\"));"," this._uiSetLastSortedBy(null, this.get(\"lastSortedBy\"), dt);"," }"," },",""," /*"," * @method _setLastSortedBy"," * @description Normalizes lastSortedBy"," * @param val {String | Object} {key, dir} or \"key\""," * @return {key, dir, notdir}"," * @private"," */"," _setLastSortedBy: function(val) {"," if (Y.Lang.isString(val)) {"," val = { key: val, dir: \"desc\" };"," }",""," if (val) {"," return (val.dir === \"desc\") ?"," { key: val.key, dir: \"desc\", notdir: \"asc\" } :"," { key: val.key, dir: \"asc\", notdir:\"desc\" };"," } else {"," return null;"," }"," },",""," /*"," * Updates sort UI."," *"," * @method _uiSetLastSortedBy"," * @param val {Object} New lastSortedBy object {key,dir}."," * @param dt {Y.DataTable.Base} Host."," * @protected"," */"," _uiSetLastSortedBy: function(prevVal, newVal, dt) {"," var strings = this.get('strings'),"," columnset = dt.get(\"columnset\"),"," prevKey = prevVal && prevVal.key,"," newKey = newVal && newVal.key,"," prevClass = prevVal && dt.getClassName(prevVal.dir),"," newClass = newVal && dt.getClassName(newVal.dir),"," prevColumn = columnset.keyHash[prevKey],"," newColumn = columnset.keyHash[newKey],"," tbodyNode = dt._tbodyNode,"," fromTemplate = Y.Lang.sub,"," th, sortArrow, sortLabel;",""," // Clear previous UI"," if (prevColumn && prevClass) {"," th = prevColumn.thNode;"," sortArrow = th.one('a');",""," if (sortArrow) {"," sortArrow.set('title', fromTemplate(strings.sortBy, {"," column: prevColumn.get('label')"," }));"," }",""," th.removeClass(prevClass);"," tbodyNode.all(\".\" + YgetClassName(COLUMN, prevColumn.get(\"id\")))"," .removeClass(prevClass);"," }",""," // Add new sort UI"," if (newColumn && newClass) {"," th = newColumn.thNode;"," sortArrow = th.one('a');",""," if (sortArrow) {"," sortLabel = (newVal.dir === ASC) ? \"reverseSortBy\" : \"sortBy\";",""," sortArrow.set('title', fromTemplate(strings[sortLabel], {"," column: newColumn.get('label')"," }));"," }",""," th.addClass(newClass);",""," tbodyNode.all(\".\" + YgetClassName(COLUMN, newColumn.get(\"id\")))"," .addClass(newClass);"," }"," },",""," /*"," * Before header cell element is created, inserts link markup around {value}."," *"," * @method _beforeCreateTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _beforeCreateTheadThNode: function(o) {"," var sortedBy, sortLabel;",""," if (o.column.get(\"sortable\")) {"," sortedBy = this.get('lastSortedBy');",""," sortLabel = (sortedBy && sortedBy.dir === ASC &&"," sortedBy.key === o.column.get('key')) ?"," \"reverseSortBy\" : \"sortBy\";",""," o.value = Y.Lang.sub(this.get(\"template\"), {"," link_class: o.link_class || \"\","," link_title: Y.Lang.sub(this.get('strings.' + sortLabel), {"," column: o.column.get('label')"," }),"," link_href: \"#\","," value: o.value"," });"," }"," },",""," /*"," * Before header cell element is attached, sets applicable class names."," *"," * @method _beforeAttachTheadThNode"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _beforeAttachTheadThNode: function(o) {"," var lastSortedBy = this.get(\"lastSortedBy\"),"," key = lastSortedBy && lastSortedBy.key,"," dir = lastSortedBy && lastSortedBy.dir,"," notdir = lastSortedBy && lastSortedBy.notdir;",""," // This Column is sortable"," if(o.column.get(\"sortable\")) {"," o.th.addClass(YgetClassName(DATATABLE, \"sortable\"));"," }"," // This Column is currently sorted"," if(key && (key === o.column.get(\"key\"))) {"," o.th.replaceClass(YgetClassName(DATATABLE, notdir), YgetClassName(DATATABLE, dir));"," }"," },",""," /*"," * Before header cell element is attached, sets applicable class names."," *"," * @method _beforeAttachTbodyTdNode"," * @param o {Object} {record, column, tr, headers, classnames, value}."," * @protected"," */"," _beforeAttachTbodyTdNode: function(o) {"," var lastSortedBy = this.get(\"lastSortedBy\"),"," key = lastSortedBy && lastSortedBy.key,"," dir = lastSortedBy && lastSortedBy.dir,"," notdir = lastSortedBy && lastSortedBy.notdir;",""," // This Column is sortable"," if(o.column.get(\"sortable\")) {"," o.td.addClass(YgetClassName(DATATABLE, \"sortable\"));"," }"," // This Column is currently sorted"," if(key && (key === o.column.get(\"key\"))) {"," o.td.replaceClass(YgetClassName(DATATABLE, notdir), YgetClassName(DATATABLE, dir));"," }"," },"," /*"," * In response to the \"trigger\" event, sorts the underlying Recordset and"," * updates the lastSortedBy attribute."," *"," * @method _onEventSortColumn"," * @param o {Object} {value, column, tr}."," * @protected"," */"," _onEventSortColumn: function(e) {"," e.halt();"," //TODO: normalize e.currentTarget to TH"," var table = this.get(\"host\"),"," column = table.get(\"columnset\").idHash[e.currentTarget.get(\"id\")],"," key, field, lastSort, desc, sorter;",""," if (column.get(\"sortable\")) {"," key = column.get(\"key\");"," field = column.get(\"field\");"," lastSort = this.get(\"lastSortedBy\") || {};"," desc = (lastSort.key === key && lastSort.dir === ASC);"," sorter = column.get(\"sortFn\");",""," table.get(\"recordset\").sort.sort(field, desc, sorter);",""," this.set(\"lastSortedBy\", {"," key: key,"," dir: (desc) ? DESC : ASC"," });"," }"," }","});","","Y.namespace(\"Plugin\").DataTableSort = DataTableSort;","","","","","","}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});"]; _yuitest_coverage["/build/datatable-sort-deprecated/datatable-sort-deprecated.js"].lines = {"1":0,"30":0,"41":0,"42":0,"50":0,"129":0,"139":0,"154":0,"157":0,"158":0,"161":0,"164":0,"165":0,"168":0,"171":0,"172":0,"174":0,"175":0,"185":0,"186":0,"187":0,"199":0,"200":0,"203":0,"204":0,"208":0,"221":0,"234":0,"235":0,"236":0,"238":0,"239":0,"244":0,"245":0,"250":0,"251":0,"252":0,"254":0,"255":0,"257":0,"262":0,"264":0,"277":0,"279":0,"280":0,"282":0,"286":0,"305":0,"311":0,"312":0,"315":0,"316":0,"328":0,"334":0,"335":0,"338":0,"339":0,"351":0,"353":0,"357":0,"358":0,"359":0,"360":0,"361":0,"362":0,"364":0,"366":0,"374":0}; _yuitest_coverage["/build/datatable-sort-deprecated/datatable-sort-deprecated.js"].functions = {"DataTableSort:41":0,"valueFn:129":0,"(anonymous 2):171":0,"(anonymous 3):174":0,"initializer:153":0,"_setLastSortedBy:198":0,"_uiSetLastSortedBy:220":0,"_beforeCreateTheadThNode:276":0,"_beforeAttachTheadThNode:304":0,"_beforeAttachTbodyTdNode:327":0,"_onEventSortColumn:350":0,"(anonymous 1):1":0}; _yuitest_coverage["/build/datatable-sort-deprecated/datatable-sort-deprecated.js"].coveredLines = 68;@@ -496,4 +496,4 @@ -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});
bundle/datatable-sort-deprecated/datatable-sort-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -383,4 +383,4 @@ -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});
bundle/datatable-sort-deprecated/datatable-sort-deprecated-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-sort-deprecated",function(g){var f=g.ClassNameManager.getClassName,h="datatable",b="column",d="asc",c="desc",a='<a class="{link_class}" title="{link_title}" href="{link_href}">{value}</a>';function e(){e.superclass.constructor.apply(this,arguments);}g.mix(e,{NS:"sort",NAME:"dataTableSort",ATTRS:{trigger:{value:{event:"click",selector:"th"},writeOnce:"initOnly"},lastSortedBy:{setter:"_setLastSortedBy",lazyAdd:false},template:{value:a},strings:{valueFn:function(){return g.Intl.get("datatable-sort-deprecated");}}}});g.extend(e,g.Plugin.Base,{initializer:function(j){var k=this.get("host"),i=this.get("trigger");k.get("recordset").plug(g.Plugin.RecordsetSort,{dt:k});k.get("recordset").sort.addTarget(k);this.doBefore("_createTheadThNode",this._beforeCreateTheadThNode);this.doBefore("_attachTheadThNode",this._beforeAttachTheadThNode);this.doBefore("_attachTbodyTdNode",this._beforeAttachTbodyTdNode);k.delegate(i.event,g.bind(this._onEventSortColumn,this),i.selector);k.after("recordsetSort:sort",function(){this._uiSetRecordset(this.get("recordset"));});this.on("lastSortedByChange",function(l){this._uiSetLastSortedBy(l.prevVal,l.newVal,k);});if(k.get("rendered")){k._uiSetColumnset(k.get("columnset"));this._uiSetLastSortedBy(null,this.get("lastSortedBy"),k);}},_setLastSortedBy:function(i){if(g.Lang.isString(i)){i={key:i,dir:"desc"};}if(i){return(i.dir==="desc")?{key:i.key,dir:"desc",notdir:"asc"}:{key:i.key,dir:"asc",notdir:"desc"};}else{return null;}},_uiSetLastSortedBy:function(n,m,l){var w=this.get("strings"),k=l.get("columnset"),x=n&&n.key,u=m&&m.key,i=n&&l.getClassName(n.dir),p=m&&l.getClassName(m.dir),r=k.keyHash[x],o=k.keyHash[u],q=l._tbodyNode,v=g.Lang.sub,j,t,s;if(r&&i){j=r.thNode;t=j.one("a");if(t){t.set("title",v(w.sortBy,{column:r.get("label")}));}j.removeClass(i);q.all("."+f(b,r.get("id"))).removeClass(i);}if(o&&p){j=o.thNode;t=j.one("a");if(t){s=(m.dir===d)?"reverseSortBy":"sortBy";t.set("title",v(w[s],{column:o.get("label")}));}j.addClass(p);q.all("."+f(b,o.get("id"))).addClass(p);}},_beforeCreateTheadThNode:function(k){var i,j;if(k.column.get("sortable")){i=this.get("lastSortedBy");j=(i&&i.dir===d&&i.key===k.column.get("key"))?"reverseSortBy":"sortBy";k.value=g.Lang.sub(this.get("template"),{link_class:k.link_class||"",link_title:g.Lang.sub(this.get("strings."+j),{column:k.column.get("label")}),link_href:"#",value:k.value});}},_beforeAttachTheadThNode:function(m){var l=this.get("lastSortedBy"),k=l&&l.key,i=l&&l.dir,j=l&&l.notdir;if(m.column.get("sortable")){m.th.addClass(f(h,"sortable"));}if(k&&(k===m.column.get("key"))){m.th.replaceClass(f(h,j),f(h,i));}},_beforeAttachTbodyTdNode:function(m){var l=this.get("lastSortedBy"),k=l&&l.key,i=l&&l.dir,j=l&&l.notdir;if(m.column.get("sortable")){m.td.addClass(f(h,"sortable"));}if(k&&(k===m.column.get("key"))){m.td.replaceClass(f(h,j),f(h,i));}},_onEventSortColumn:function(n){n.halt();var l=this.get("host"),k=l.get("columnset").idHash[n.currentTarget.get("id")],j,m,i,o,p;if(k.get("sortable")){j=k.get("key");m=k.get("field");i=this.get("lastSortedBy")||{};o=(i.key===j&&i.dir===d);p=k.get("sortFn");l.get("recordset").sort.sort(m,o,p);this.set("lastSortedBy",{key:j,dir:(o)?c:d});}}});g.namespace("Plugin").DataTableSort=e;},"3.7.2",{requires:["datatable-base-deprecated","plugin","recordset-sort"],lang:["en"]});+YUI.add("datatable-sort-deprecated",function(g){var f=g.ClassNameManager.getClassName,h="datatable",b="column",d="asc",c="desc",a='<a class="{link_class}" title="{link_title}" href="{link_href}">{value}</a>';function e(){e.superclass.constructor.apply(this,arguments);}g.mix(e,{NS:"sort",NAME:"dataTableSort",ATTRS:{trigger:{value:{event:"click",selector:"th"},writeOnce:"initOnly"},lastSortedBy:{setter:"_setLastSortedBy",lazyAdd:false},template:{value:a},strings:{valueFn:function(){return g.Intl.get("datatable-sort-deprecated");}}}});g.extend(e,g.Plugin.Base,{initializer:function(j){var k=this.get("host"),i=this.get("trigger");k.get("recordset").plug(g.Plugin.RecordsetSort,{dt:k});k.get("recordset").sort.addTarget(k);this.doBefore("_createTheadThNode",this._beforeCreateTheadThNode);this.doBefore("_attachTheadThNode",this._beforeAttachTheadThNode);this.doBefore("_attachTbodyTdNode",this._beforeAttachTbodyTdNode);k.delegate(i.event,g.bind(this._onEventSortColumn,this),i.selector);k.after("recordsetSort:sort",function(){this._uiSetRecordset(this.get("recordset"));});this.on("lastSortedByChange",function(l){this._uiSetLastSortedBy(l.prevVal,l.newVal,k);});if(k.get("rendered")){k._uiSetColumnset(k.get("columnset"));this._uiSetLastSortedBy(null,this.get("lastSortedBy"),k);}},_setLastSortedBy:function(i){if(g.Lang.isString(i)){i={key:i,dir:"desc"};}if(i){return(i.dir==="desc")?{key:i.key,dir:"desc",notdir:"asc"}:{key:i.key,dir:"asc",notdir:"desc"};}else{return null;}},_uiSetLastSortedBy:function(n,m,l){var w=this.get("strings"),k=l.get("columnset"),x=n&&n.key,u=m&&m.key,i=n&&l.getClassName(n.dir),p=m&&l.getClassName(m.dir),r=k.keyHash[x],o=k.keyHash[u],q=l._tbodyNode,v=g.Lang.sub,j,t,s;if(r&&i){j=r.thNode;t=j.one("a");if(t){t.set("title",v(w.sortBy,{column:r.get("label")}));}j.removeClass(i);q.all("."+f(b,r.get("id"))).removeClass(i);}if(o&&p){j=o.thNode;t=j.one("a");if(t){s=(m.dir===d)?"reverseSortBy":"sortBy";t.set("title",v(w[s],{column:o.get("label")}));}j.addClass(p);q.all("."+f(b,o.get("id"))).addClass(p);}},_beforeCreateTheadThNode:function(k){var i,j;if(k.column.get("sortable")){i=this.get("lastSortedBy");j=(i&&i.dir===d&&i.key===k.column.get("key"))?"reverseSortBy":"sortBy";k.value=g.Lang.sub(this.get("template"),{link_class:k.link_class||"",link_title:g.Lang.sub(this.get("strings."+j),{column:k.column.get("label")}),link_href:"#",value:k.value});}},_beforeAttachTheadThNode:function(m){var l=this.get("lastSortedBy"),k=l&&l.key,i=l&&l.dir,j=l&&l.notdir;if(m.column.get("sortable")){m.th.addClass(f(h,"sortable"));}if(k&&(k===m.column.get("key"))){m.th.replaceClass(f(h,j),f(h,i));}},_beforeAttachTbodyTdNode:function(m){var l=this.get("lastSortedBy"),k=l&&l.key,i=l&&l.dir,j=l&&l.notdir;if(m.column.get("sortable")){m.td.addClass(f(h,"sortable"));}if(k&&(k===m.column.get("key"))){m.td.replaceClass(f(h,j),f(h,i));}},_onEventSortColumn:function(n){n.halt();var l=this.get("host"),k=l.get("columnset").idHash[n.currentTarget.get("id")],j,m,i,o,p;if(k.get("sortable")){j=k.get("key");m=k.get("field");i=this.get("lastSortedBy")||{};o=(i.key===j&&i.dir===d);p=k.get("sortFn");l.get("recordset").sort.sort(m,o,p);this.set("lastSortedBy",{key:j,dir:(o)?c:d});}}});g.namespace("Plugin").DataTableSort=e;},"3.7.3",{requires:["datatable-base-deprecated","plugin","recordset-sort"],lang:["en"]});
bundle/datatable-sort-deprecated/datatable-sort-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -383,4 +383,4 @@ -}, '3.7.2' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});+}, '3.7.3' ,{requires:['datatable-base-deprecated','plugin','recordset-sort'], lang:['en']});
bundle/datatable-sort-deprecated/lang/datatable-sort-deprecated.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatable-sort-deprecated",function(a){a.Intl.add("datatable-sort-deprecated","",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"});},"3.7.2");+YUI.add("lang/datatable-sort-deprecated",function(a){a.Intl.add("datatable-sort-deprecated","",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"});},"3.7.3");
bundle/datatable-sort-deprecated/lang/datatable-sort-deprecated_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatable-sort-deprecated_en",function(a){a.Intl.add("datatable-sort-deprecated","en",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"});},"3.7.2");+YUI.add("lang/datatable-sort-deprecated_en",function(a){a.Intl.add("datatable-sort-deprecated","en",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"});},"3.7.3");
bundle/datatable-sort/assets/datatable-sort-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-sort/assets/skins/night/datatable-sort-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-sort/assets/skins/night/datatable-sort.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-sort/assets/skins/sam/datatable-sort-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-sort/assets/skins/sam/datatable-sort.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/datatable-sort/datatable-sort-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-sort/datatable-sort.js", code: [] };-_yuitest_coverage["build/datatable-sort/datatable-sort.js"].code=["YUI.add('datatable-sort', function (Y, NAME) {","","/**","Adds support for sorting the table data by API methods `table.sort(...)` or","`table.toggleSort(...)` or by clicking on column headers in the rendered UI.","","@module datatable","@submodule datatable-sort","@since 3.5.0","**/","var YLang = Y.Lang,"," isBoolean = YLang.isBoolean,"," isString = YLang.isString,"," isArray = YLang.isArray,"," isObject = YLang.isObject,",""," toArray = Y.Array,"," sub = YLang.sub,",""," dirMap = {"," asc : 1,"," desc: -1,"," \"1\" : 1,"," \"-1\": -1"," };","","","/**","_API docs for this extension are included in the DataTable class._","","This DataTable class extension adds support for sorting the table data by API","methods `table.sort(...)` or `table.toggleSort(...)` or by clicking on column","headers in the rendered UI.","","Sorting by the API is enabled automatically when this module is `use()`d. To","enable UI triggered sorting, set the DataTable's `sortable` attribute to","`true`.","","<pre><code>","var table = new Y.DataTable({"," columns: [ 'id', 'username', 'name', 'birthdate' ],"," data: [ ... ],"," sortable: true","});","","table.render('#table');","</code></pre>","","Setting `sortable` to `true` will enable UI sorting for all columns. To enable","UI sorting for certain columns only, set `sortable` to an array of column keys,","or just add `sortable: true` to the respective column configuration objects.","This uses the default setting of `sortable: auto` for the DataTable instance.","","<pre><code>","var table = new Y.DataTable({"," columns: ["," 'id',"," { key: 'username', sortable: true },"," { key: 'name', sortable: true },"," { key: 'birthdate', sortable: true }"," ],"," data: [ ... ]"," // sortable: 'auto' is the default","});","","// OR","var table = new Y.DataTable({"," columns: [ 'id', 'username', 'name', 'birthdate' ],"," data: [ ... ],"," sortable: [ 'username', 'name', 'birthdate' ]","});","</code></pre>","","To disable UI sorting for all columns, set `sortable` to `false`. This still","permits sorting via the API methods.","","As new records are inserted into the table's `data` ModelList, they will be inserted at the correct index to preserve the sort order.","","The current sort order is stored in the `sortBy` attribute. Assigning this value at instantiation will automatically sort your data.","","Sorting is done by a simple value comparison using < and > on the field","value. If you need custom sorting, add a sort function in the column's","`sortFn` property. Columns whose content is generated by formatters, but don't","relate to a single `key`, require a `sortFn` to be sortable.","","<pre><code>","function nameSort(a, b, desc) {"," var aa = a.get('lastName') + a.get('firstName'),"," bb = a.get('lastName') + b.get('firstName'),"," order = (aa > bb) ? 1 : -(aa < bb);"," "," return desc ? -order : order;","}","","var table = new Y.DataTable({"," columns: [ 'id', 'username', { key: name, sortFn: nameSort }, 'birthdate' ],"," data: [ ... ],"," sortable: [ 'username', 'name', 'birthdate' ]","});","</code></pre>","","See the user guide for more details.","","@class DataTable.Sortable","@for DataTable","@since 3.5.0","**/","function Sortable() {}","","Sortable.ATTRS = {"," // Which columns in the UI should suggest and respond to sorting interaction"," // pass an empty array if no UI columns should show sortable, but you want the"," // table.sort(...) API"," /**"," Controls which column headers can trigger sorting by user clicks.",""," Acceptable values are:",""," * \"auto\" - (default) looks for `sortable: true` in the column configurations"," * `true` - all columns are enabled"," * `false - no UI sortable is enabled"," * {String[]} - array of key names to give sortable headers",""," @attribute sortable"," @type {String|String[]|Boolean}"," @default \"auto\""," @since 3.5.0"," **/"," sortable: {"," value: 'auto',"," validator: '_validateSortable'"," },",""," /**"," The current sort configuration to maintain in the data.",""," Accepts column `key` strings or objects with a single property, the column"," `key`, with a value of 1, -1, \"asc\", or \"desc\". E.g. `{ username: 'asc'"," }`. String values are assumed to be ascending.",""," Example values would be:",""," * `\"username\"` - sort by the data's `username` field or the `key`"," associated to a column with that `name`."," * `{ username: \"desc\" }` - sort by `username` in descending order."," Alternately, use values \"asc\", 1 (same as \"asc\"), or -1 (same as \"desc\")."," * `[\"lastName\", \"firstName\"]` - ascending sort by `lastName`, but for"," records with the same `lastName`, ascending subsort by `firstName`."," Array can have as many items as you want."," * `[{ lastName: -1 }, \"firstName\"]` - descending sort by `lastName`,"," ascending subsort by `firstName`. Mixed types are ok.",""," @attribute sortBy"," @type {String|String[]|Object|Object[]}"," @since 3.5.0"," **/"," sortBy: {"," validator: '_validateSortBy',"," getter: '_getSortBy'"," },",""," /**"," Strings containing language for sorting tooltips.",""," @attribute strings"," @type {Object}"," @default (strings for current lang configured in the YUI instance config)"," @since 3.5.0"," **/"," strings: {}","};","","Y.mix(Sortable.prototype, {",""," /**"," Sort the data in the `data` ModelList and refresh the table with the new"," order.",""," Acceptable values for `fields` are `key` strings or objects with a single"," property, the column `key`, with a value of 1, -1, \"asc\", or \"desc\". E.g."," `{ username: 'asc' }`. String values are assumed to be ascending.",""," Example values would be:",""," * `\"username\"` - sort by the data's `username` field or the `key`"," associated to a column with that `name`."," * `{ username: \"desc\" }` - sort by `username` in descending order."," Alternately, use values \"asc\", 1 (same as \"asc\"), or -1 (same as \"desc\")."," * `[\"lastName\", \"firstName\"]` - ascending sort by `lastName`, but for"," records with the same `lastName`, ascending subsort by `firstName`."," Array can have as many items as you want."," * `[{ lastName: -1 }, \"firstName\"]` - descending sort by `lastName`,"," ascending subsort by `firstName`. Mixed types are ok.",""," @method sort"," @param {String|String[]|Object|Object[]} fields The field(s) to sort by"," @param {Object} [payload] Extra `sort` event payload you want to send along"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," sort: function (fields, payload) {"," /**"," Notifies of an impending sort, either from clicking on a column"," header, or from a call to the `sort` or `toggleSort` method.",""," The requested sort is available in the `sortBy` property of the event.",""," The default behavior of this event sets the table's `sortBy` attribute.",""," @event sort"," @param {String|String[]|Object|Object[]} sortBy The requested sort"," @preventable _defSortFn"," **/"," return this.fire('sort', Y.merge((payload || {}), {"," sortBy: fields || this.get('sortBy')"," }));"," },",""," /**"," Template for the node that will wrap the header content for sortable"," columns.",""," @property SORTABLE_HEADER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\" tabindex=\"0\"><span class=\"{indicatorClass}\"></span></div>'"," @since 3.5.0"," **/"," SORTABLE_HEADER_TEMPLATE: '<div class=\"{className}\" tabindex=\"0\"><span class=\"{indicatorClass}\"></span></div>',",""," /**"," Reverse the current sort direction of one or more fields currently being"," sorted by.",""," Pass the `key` of the column or columns you want the sort order reversed"," for.",""," @method toggleSort"," @param {String|String[]} fields The field(s) to reverse sort order for"," @param {Object} [payload] Extra `sort` event payload you want to send along"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," toggleSort: function (columns, payload) {"," var current = this._sortBy,"," sortBy = [],"," i, len, j, col, index;",""," // To avoid updating column configs or sortBy directly"," for (i = 0, len = current.length; i < len; ++i) {"," col = {};"," col[current[i]._id] = current[i].sortDir;"," sortBy.push(col);"," }",""," if (columns) {"," columns = toArray(columns);",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," index = -1;",""," for (j = sortBy.length - 1; i >= 0; --i) {"," if (sortBy[j][col]) {"," sortBy[j][col] *= -1;"," break;"," }"," }"," }"," } else {"," for (i = 0, len = sortBy.length; i < len; ++i) {"," for (col in sortBy[i]) {"," if (sortBy[i].hasOwnProperty(col)) {"," sortBy[i][col] *= -1;"," break;"," }"," }"," }"," }",""," return this.fire('sort', Y.merge((payload || {}), {"," sortBy: sortBy"," }));"," },",""," //--------------------------------------------------------------------------"," // Protected properties and methods"," //--------------------------------------------------------------------------"," /**"," Sorts the `data` ModelList based on the new `sortBy` configuration.",""," @method _afterSortByChange"," @param {EventFacade} e The `sortByChange` event"," @protected"," @since 3.5.0"," **/"," _afterSortByChange: function (e) {"," // Can't use a setter because it's a chicken and egg problem. The"," // columns need to be set up to translate, but columns are initialized"," // from Core's initializer. So construction-time assignment would"," // fail."," this._setSortBy();",""," // Don't sort unless sortBy has been set"," if (this._sortBy.length) {"," if (!this.data.comparator) {"," this.data.comparator = this._sortComparator;"," }",""," this.data.sort();"," }"," },",""," /**"," Applies the sorting logic to the new ModelList if the `newVal` is a new"," ModelList.",""," @method _afterSortDataChange"," @param {EventFacade} e the `dataChange` event"," @protected"," @since 3.5.0"," **/"," _afterSortDataChange: function (e) {"," // object values always trigger a change event, but we only want to"," // call _initSortFn if the value passed to the `data` attribute was a"," // new ModelList, not a set of new data as an array, or even the same"," // ModelList."," if (e.prevVal !== e.newVal || e.newVal.hasOwnProperty('_compare')) {"," this._initSortFn();"," }"," },",""," /**"," Checks if any of the fields in the modified record are fields that are"," currently being sorted by, and if so, resorts the `data` ModelList.",""," @method _afterSortRecordChange"," @param {EventFacade} e The Model's `change` event"," @protected"," @since 3.5.0"," **/"," _afterSortRecordChange: function (e) {"," var i, len;",""," for (i = 0, len = this._sortBy.length; i < len; ++i) {"," if (e.changed[this._sortBy[i].key]) {"," this.data.sort();"," break;"," }"," }"," },",""," /**"," Subscribes to state changes that warrant updating the UI, and adds the"," click handler for triggering the sort operation from the UI.",""," @method _bindSortUI"," @protected"," @since 3.5.0"," **/"," _bindSortUI: function () {"," var handles = this._eventHandles;"," "," if (!handles.sortAttrs) {"," handles.sortAttrs = this.after("," ['sortableChange', 'sortByChange', 'columnsChange'],"," Y.bind('_uiSetSortable', this));"," }",""," if (!handles.sortUITrigger && this._theadNode) {"," handles.sortUITrigger = this.delegate(['click','keydown'],"," Y.rbind('_onUITriggerSort', this),"," '.' + this.getClassName('sortable', 'column'));"," }"," },",""," /**"," Sets the `sortBy` attribute from the `sort` event's `e.sortBy` value.",""," @method _defSortFn"," @param {EventFacade} e The `sort` event"," @protected"," @since 3.5.0"," **/"," _defSortFn: function (e) {"," this.set.apply(this, ['sortBy', e.sortBy].concat(e.details));"," },",""," /**"," Getter for the `sortBy` attribute."," "," Supports the special subattribute \"sortBy.state\" to get a normalized JSON"," version of the current sort state. Otherwise, returns the last assigned"," value.",""," For example:",""," <pre><code>var table = new Y.DataTable({"," columns: [ ... ],"," data: [ ... ],"," sortBy: 'username'"," });",""," table.get('sortBy'); // 'username'"," table.get('sortBy.state'); // { key: 'username', dir: 1 }",""," table.sort(['lastName', { firstName: \"desc\" }]);"," table.get('sortBy'); // ['lastName', { firstName: \"desc\" }]"," table.get('sortBy.state'); // [{ key: \"lastName\", dir: 1 }, { key: \"firstName\", dir: -1 }]"," </code></pre>",""," @method _getSortBy"," @param {String|String[]|Object|Object[]} val The current sortBy value"," @param {String} detail String passed to `get(HERE)`. to parse subattributes"," @protected"," @since 3.5.0"," **/"," _getSortBy: function (val, detail) {"," var state, i, len, col;",""," // \"sortBy.\" is 7 characters. Used to catch "," detail = detail.slice(7);",""," // TODO: table.get('sortBy.asObject')? table.get('sortBy.json')?"," if (detail === 'state') {"," state = [];",""," for (i = 0, len = this._sortBy.length; i < len; ++i) {"," col = this._sortBy[i];"," state.push({"," column: col._id,"," dir: col.sortDir"," });"," }",""," // TODO: Always return an array?"," return { state: (state.length === 1) ? state[0] : state };"," } else {"," return val;"," }"," },",""," /**"," Sets up the initial sort state and instance properties. Publishes events"," and subscribes to attribute change events to maintain internal state.",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," var boundParseSortable = Y.bind('_parseSortable', this);",""," this._parseSortable();",""," this._setSortBy();",""," this._initSortFn();",""," this._initSortStrings();",""," this.after({"," 'table:renderHeader': Y.bind('_renderSortable', this),"," dataChange : Y.bind('_afterSortDataChange', this),"," sortByChange : Y.bind('_afterSortByChange', this),"," sortableChange : boundParseSortable,"," columnsChange : boundParseSortable"," });"," this.data.after(this.data.model.NAME + \":change\","," Y.bind('_afterSortRecordChange', this));",""," // TODO: this event needs magic, allowing async remote sorting"," this.publish('sort', {"," defaultFn: Y.bind('_defSortFn', this)"," });"," },",""," /**"," Creates a `_compare` function for the `data` ModelList to allow custom"," sorting by multiple fields.",""," @method _initSortFn"," @protected"," @since 3.5.0"," **/"," _initSortFn: function () {"," var self = this;",""," // TODO: This should be a ModelList extension."," // FIXME: Modifying a component of the host seems a little smelly"," // FIXME: Declaring inline override to leverage closure vs"," // compiling a new function for each column/sortable change or"," // binding the _compare implementation to this, resulting in an"," // extra function hop during sorting. Lesser of three evils?"," this.data._compare = function (a, b) {"," var cmp = 0,"," i, len, col, dir, aa, bb;",""," for (i = 0, len = self._sortBy.length; !cmp && i < len; ++i) {"," col = self._sortBy[i];"," dir = col.sortDir;",""," if (col.sortFn) {"," cmp = col.sortFn(a, b, (dir === -1));"," } else {"," // FIXME? Requires columns without sortFns to have key"," aa = a.get(col.key) || '';"," bb = b.get(col.key) || '';",""," cmp = (aa > bb) ? dir : ((aa < bb) ? -dir : 0);"," }"," }",""," return cmp;"," };",""," if (this._sortBy.length) {"," this.data.comparator = this._sortComparator;",""," // TODO: is this necessary? Should it be elsewhere?"," this.data.sort();"," } else {"," // Leave the _compare method in place to avoid having to set it"," // up again. Mistake?"," delete this.data.comparator;"," }"," },",""," /**"," Add the sort related strings to the `strings` map."," "," @method _initSortStrings"," @protected"," @since 3.5.0"," **/"," _initSortStrings: function () {"," // Not a valueFn because other class extensions will want to add to it"," this.set('strings', Y.mix((this.get('strings') || {}), "," Y.Intl.get('datatable-sort')));"," },",""," /**"," Fires the `sort` event in response to user clicks on sortable column"," headers.",""," @method _onUITriggerSort"," @param {DOMEventFacade} e The `click` event"," @protected"," @since 3.5.0"," **/"," _onUITriggerSort: function (e) {"," var id = e.currentTarget.getAttribute('data-yui3-col-id'),"," sortBy = e.shiftKey ? this.get('sortBy') : [{}],"," column = id && this.getColumn(id),"," i, len;",""," if (e.type === 'keydown' && e.keyCode !== 32) {"," return;"," }",""," // In case a headerTemplate injected a link"," // TODO: Is this overreaching?"," e.preventDefault();",""," if (column) {"," if (e.shiftKey) {"," for (i = 0, len = sortBy.length; i < len; ++i) {"," if (id === sortBy[i] || Math.abs(sortBy[i][id] === 1)) {"," if (!isObject(sortBy[i])) {"," sortBy[i] = {};"," }",""," sortBy[i][id] = -(column.sortDir|0) || 1;"," break;"," }"," }",""," if (i >= len) {"," sortBy.push(column._id);"," }"," } else {"," sortBy[0][id] = -(column.sortDir|0) || 1;"," }",""," this.fire('sort', {"," originEvent: e,"," sortBy: sortBy"," });"," }"," },",""," /**"," Normalizes the possible input values for the `sortable` attribute, storing"," the results in the `_sortable` property.",""," @method _parseSortable"," @protected"," @since 3.5.0"," **/"," _parseSortable: function () {"," var sortable = this.get('sortable'),"," columns = [],"," i, len, col;",""," if (isArray(sortable)) {"," for (i = 0, len = sortable.length; i < len; ++i) {"," col = sortable[i];",""," // isArray is called because arrays are objects, but will rely"," // on getColumn to nullify them for the subsequent if (col)"," if (!isObject(col, true) || isArray(col)) {"," col = this.getColumn(col);"," }",""," if (col) {"," columns.push(col);"," }"," }"," } else if (sortable) {"," columns = this._displayColumns.slice();",""," if (sortable === 'auto') {"," for (i = columns.length - 1; i >= 0; --i) {"," if (!columns[i].sortable) {"," columns.splice(i, 1);"," }"," }"," }"," }",""," this._sortable = columns;"," },",""," /**"," Initial application of the sortable UI.",""," @method _renderSortable"," @protected"," @since 3.5.0"," **/"," _renderSortable: function () {"," this._uiSetSortable();",""," this._bindSortUI();"," },",""," /**"," Parses the current `sortBy` attribute into a normalized structure for the"," `data` ModelList's `_compare` method. Also updates the column"," configurations' `sortDir` properties.",""," @method _setSortBy"," @protected"," @since 3.5.0"," **/"," _setSortBy: function () {"," var columns = this._displayColumns,"," sortBy = this.get('sortBy') || [],"," sortedClass = ' ' + this.getClassName('sorted'),"," i, len, name, dir, field, column;",""," this._sortBy = [];",""," // Purge current sort state from column configs"," for (i = 0, len = columns.length; i < len; ++i) {"," column = columns[i];",""," delete column.sortDir;",""," if (column.className) {"," // TODO: be more thorough"," column.className = column.className.replace(sortedClass, '');"," }"," }",""," sortBy = toArray(sortBy);",""," for (i = 0, len = sortBy.length; i < len; ++i) {"," name = sortBy[i];"," dir = 1;",""," if (isObject(name)) {"," field = name;"," // Have to use a for-in loop to process sort({ foo: -1 })"," for (name in field) {"," if (field.hasOwnProperty(name)) {"," dir = dirMap[field[name]];"," break;"," }"," }"," }",""," if (name) {"," // Allow sorting of any model field and any column"," // FIXME: this isn't limited to model attributes, but there's no"," // convenient way to get a list of the attributes for a Model"," // subclass *including* the attributes of its superclasses."," column = this.getColumn(name) || { _id: name, key: name };",""," if (column) {"," column.sortDir = dir;",""," if (!column.className) {"," column.className = '';"," }",""," column.className += sortedClass;",""," this._sortBy.push(column);"," }"," }"," }"," },",""," /**"," Array of column configuration objects of those columns that need UI setup"," for user interaction.",""," @property _sortable"," @type {Object[]}"," @protected"," @since 3.5.0"," **/"," //_sortable: null,",""," /**"," Array of column configuration objects for those columns that are currently"," being used to sort the data. Fake column objects are used for fields that"," are not rendered as columns.",""," @property _sortBy"," @type {Object[]}"," @protected"," @since 3.5.0"," **/"," //_sortBy: null,",""," /**"," Replacement `comparator` for the `data` ModelList that defers sorting logic"," to the `_compare` method. The deferral is accomplished by returning `this`.",""," @method _sortComparator"," @param {Model} item The record being evaluated for sort position"," @return {Model} The record"," @protected"," @since 3.5.0"," **/"," _sortComparator: function (item) {"," // Defer sorting to ModelList's _compare"," return item;"," },",""," /**"," Applies the appropriate classes to the `boundingBox` and column headers to"," indicate sort state and sortability.",""," Also currently wraps the header content of sortable columns in a `<div>`"," liner to give a CSS anchor for sort indicators.",""," @method _uiSetSortable"," @protected"," @since 3.5.0"," **/"," _uiSetSortable: function () {"," var columns = this._sortable || [],"," sortableClass = this.getClassName('sortable', 'column'),"," ascClass = this.getClassName('sorted'),"," descClass = this.getClassName('sorted', 'desc'),"," linerClass = this.getClassName('sort', 'liner'),"," indicatorClass= this.getClassName('sort', 'indicator'),"," sortableCols = {},"," i, len, col, node, liner, title, desc;",""," this.get('boundingBox').toggleClass("," this.getClassName('sortable'),"," columns.length);",""," for (i = 0, len = columns.length; i < len; ++i) {"," sortableCols[columns[i].id] = columns[i];"," }",""," // TODO: this.head.render() + decorate cells?"," this._theadNode.all('.' + sortableClass).each(function (node) {"," var col = sortableCols[node.get('id')],"," liner = node.one('.' + linerClass),"," indicator;",""," if (col) {"," if (!col.sortDir) {"," node.removeClass(ascClass)"," .removeClass(descClass);"," }"," } else {"," node.removeClass(sortableClass)"," .removeClass(ascClass)"," .removeClass(descClass);",""," if (liner) {"," liner.replace(liner.get('childNodes').toFrag());"," }",""," indicator = node.one('.' + indicatorClass);",""," if (indicator) {"," indicator.remove().destroy(true);"," }"," }"," });",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," node = this._theadNode.one('#' + col.id);"," desc = col.sortDir === -1;",""," if (node) {"," liner = node.one('.' + linerClass);",""," node.addClass(sortableClass);",""," if (col.sortDir) {"," node.addClass(ascClass);",""," node.toggleClass(descClass, desc);",""," node.setAttribute('aria-sort', desc ?"," 'descending' : 'ascending');"," }",""," if (!liner) {"," liner = Y.Node.create(Y.Lang.sub("," this.SORTABLE_HEADER_TEMPLATE, {"," className: linerClass,"," indicatorClass: indicatorClass"," }));",""," liner.prepend(node.get('childNodes').toFrag());",""," node.append(liner);"," }",""," title = sub(this.getString("," (col.sortDir === 1) ? 'reverseSortBy' : 'sortBy'), {"," column: col.abbr || col.label ||"," col.key || ('column ' + i)"," });",""," node.setAttribute('title', title);"," // To combat VoiceOver from reading the sort title as the"," // column header"," node.setAttribute('aria-labelledby', col.id);"," }"," }"," },",""," /**"," Allows values `true`, `false`, \"auto\", or arrays of column names through.",""," @method _validateSortable"," @param {Any} val The input value to `set(\"sortable\", VAL)`"," @return {Boolean}"," @protected"," @since 3.5.0"," **/"," _validateSortable: function (val) {"," return val === 'auto' || isBoolean(val) || isArray(val);"," },",""," /**"," Allows strings, arrays of strings, objects, or arrays of objects.",""," @method _validateSortBy"," @param {String|String[]|Object|Object[]} val The new `sortBy` value"," @return {Boolean}"," @protected"," @since 3.5.0"," **/"," _validateSortBy: function (val) {"," return val === null ||"," isString(val) ||"," isObject(val, true) ||"," (isArray(val) && (isString(val[0]) || isObject(val, true)));"," }","","}, true);","","Y.DataTable.Sortable = Sortable;","","Y.Base.mix(Y.DataTable, [Sortable]);","","","}, '3.7.2', {\"requires\": [\"datatable-base\"], \"lang\": [\"en\"], \"skinnable\": true});"];+_yuitest_coverage["build/datatable-sort/datatable-sort.js"].code=["YUI.add('datatable-sort', function (Y, NAME) {","","/**","Adds support for sorting the table data by API methods `table.sort(...)` or","`table.toggleSort(...)` or by clicking on column headers in the rendered UI.","","@module datatable","@submodule datatable-sort","@since 3.5.0","**/","var YLang = Y.Lang,"," isBoolean = YLang.isBoolean,"," isString = YLang.isString,"," isArray = YLang.isArray,"," isObject = YLang.isObject,",""," toArray = Y.Array,"," sub = YLang.sub,",""," dirMap = {"," asc : 1,"," desc: -1,"," \"1\" : 1,"," \"-1\": -1"," };","","","/**","_API docs for this extension are included in the DataTable class._","","This DataTable class extension adds support for sorting the table data by API","methods `table.sort(...)` or `table.toggleSort(...)` or by clicking on column","headers in the rendered UI.","","Sorting by the API is enabled automatically when this module is `use()`d. To","enable UI triggered sorting, set the DataTable's `sortable` attribute to","`true`.","","<pre><code>","var table = new Y.DataTable({"," columns: [ 'id', 'username', 'name', 'birthdate' ],"," data: [ ... ],"," sortable: true","});","","table.render('#table');","</code></pre>","","Setting `sortable` to `true` will enable UI sorting for all columns. To enable","UI sorting for certain columns only, set `sortable` to an array of column keys,","or just add `sortable: true` to the respective column configuration objects.","This uses the default setting of `sortable: auto` for the DataTable instance.","","<pre><code>","var table = new Y.DataTable({"," columns: ["," 'id',"," { key: 'username', sortable: true },"," { key: 'name', sortable: true },"," { key: 'birthdate', sortable: true }"," ],"," data: [ ... ]"," // sortable: 'auto' is the default","});","","// OR","var table = new Y.DataTable({"," columns: [ 'id', 'username', 'name', 'birthdate' ],"," data: [ ... ],"," sortable: [ 'username', 'name', 'birthdate' ]","});","</code></pre>","","To disable UI sorting for all columns, set `sortable` to `false`. This still","permits sorting via the API methods.","","As new records are inserted into the table's `data` ModelList, they will be inserted at the correct index to preserve the sort order.","","The current sort order is stored in the `sortBy` attribute. Assigning this value at instantiation will automatically sort your data.","","Sorting is done by a simple value comparison using < and > on the field","value. If you need custom sorting, add a sort function in the column's","`sortFn` property. Columns whose content is generated by formatters, but don't","relate to a single `key`, require a `sortFn` to be sortable.","","<pre><code>","function nameSort(a, b, desc) {"," var aa = a.get('lastName') + a.get('firstName'),"," bb = a.get('lastName') + b.get('firstName'),"," order = (aa > bb) ? 1 : -(aa < bb);"," "," return desc ? -order : order;","}","","var table = new Y.DataTable({"," columns: [ 'id', 'username', { key: name, sortFn: nameSort }, 'birthdate' ],"," data: [ ... ],"," sortable: [ 'username', 'name', 'birthdate' ]","});","</code></pre>","","See the user guide for more details.","","@class DataTable.Sortable","@for DataTable","@since 3.5.0","**/","function Sortable() {}","","Sortable.ATTRS = {"," // Which columns in the UI should suggest and respond to sorting interaction"," // pass an empty array if no UI columns should show sortable, but you want the"," // table.sort(...) API"," /**"," Controls which column headers can trigger sorting by user clicks.",""," Acceptable values are:",""," * \"auto\" - (default) looks for `sortable: true` in the column configurations"," * `true` - all columns are enabled"," * `false - no UI sortable is enabled"," * {String[]} - array of key names to give sortable headers",""," @attribute sortable"," @type {String|String[]|Boolean}"," @default \"auto\""," @since 3.5.0"," **/"," sortable: {"," value: 'auto',"," validator: '_validateSortable'"," },",""," /**"," The current sort configuration to maintain in the data.",""," Accepts column `key` strings or objects with a single property, the column"," `key`, with a value of 1, -1, \"asc\", or \"desc\". E.g. `{ username: 'asc'"," }`. String values are assumed to be ascending.",""," Example values would be:",""," * `\"username\"` - sort by the data's `username` field or the `key`"," associated to a column with that `name`."," * `{ username: \"desc\" }` - sort by `username` in descending order."," Alternately, use values \"asc\", 1 (same as \"asc\"), or -1 (same as \"desc\")."," * `[\"lastName\", \"firstName\"]` - ascending sort by `lastName`, but for"," records with the same `lastName`, ascending subsort by `firstName`."," Array can have as many items as you want."," * `[{ lastName: -1 }, \"firstName\"]` - descending sort by `lastName`,"," ascending subsort by `firstName`. Mixed types are ok.",""," @attribute sortBy"," @type {String|String[]|Object|Object[]}"," @since 3.5.0"," **/"," sortBy: {"," validator: '_validateSortBy',"," getter: '_getSortBy'"," },",""," /**"," Strings containing language for sorting tooltips.",""," @attribute strings"," @type {Object}"," @default (strings for current lang configured in the YUI instance config)"," @since 3.5.0"," **/"," strings: {}","};","","Y.mix(Sortable.prototype, {",""," /**"," Sort the data in the `data` ModelList and refresh the table with the new"," order.",""," Acceptable values for `fields` are `key` strings or objects with a single"," property, the column `key`, with a value of 1, -1, \"asc\", or \"desc\". E.g."," `{ username: 'asc' }`. String values are assumed to be ascending.",""," Example values would be:",""," * `\"username\"` - sort by the data's `username` field or the `key`"," associated to a column with that `name`."," * `{ username: \"desc\" }` - sort by `username` in descending order."," Alternately, use values \"asc\", 1 (same as \"asc\"), or -1 (same as \"desc\")."," * `[\"lastName\", \"firstName\"]` - ascending sort by `lastName`, but for"," records with the same `lastName`, ascending subsort by `firstName`."," Array can have as many items as you want."," * `[{ lastName: -1 }, \"firstName\"]` - descending sort by `lastName`,"," ascending subsort by `firstName`. Mixed types are ok.",""," @method sort"," @param {String|String[]|Object|Object[]} fields The field(s) to sort by"," @param {Object} [payload] Extra `sort` event payload you want to send along"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," sort: function (fields, payload) {"," /**"," Notifies of an impending sort, either from clicking on a column"," header, or from a call to the `sort` or `toggleSort` method.",""," The requested sort is available in the `sortBy` property of the event.",""," The default behavior of this event sets the table's `sortBy` attribute.",""," @event sort"," @param {String|String[]|Object|Object[]} sortBy The requested sort"," @preventable _defSortFn"," **/"," return this.fire('sort', Y.merge((payload || {}), {"," sortBy: fields || this.get('sortBy')"," }));"," },",""," /**"," Template for the node that will wrap the header content for sortable"," columns.",""," @property SORTABLE_HEADER_TEMPLATE"," @type {HTML}"," @value '<div class=\"{className}\" tabindex=\"0\"><span class=\"{indicatorClass}\"></span></div>'"," @since 3.5.0"," **/"," SORTABLE_HEADER_TEMPLATE: '<div class=\"{className}\" tabindex=\"0\"><span class=\"{indicatorClass}\"></span></div>',",""," /**"," Reverse the current sort direction of one or more fields currently being"," sorted by.",""," Pass the `key` of the column or columns you want the sort order reversed"," for.",""," @method toggleSort"," @param {String|String[]} fields The field(s) to reverse sort order for"," @param {Object} [payload] Extra `sort` event payload you want to send along"," @return {DataTable}"," @chainable"," @since 3.5.0"," **/"," toggleSort: function (columns, payload) {"," var current = this._sortBy,"," sortBy = [],"," i, len, j, col, index;",""," // To avoid updating column configs or sortBy directly"," for (i = 0, len = current.length; i < len; ++i) {"," col = {};"," col[current[i]._id] = current[i].sortDir;"," sortBy.push(col);"," }",""," if (columns) {"," columns = toArray(columns);",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," index = -1;",""," for (j = sortBy.length - 1; i >= 0; --i) {"," if (sortBy[j][col]) {"," sortBy[j][col] *= -1;"," break;"," }"," }"," }"," } else {"," for (i = 0, len = sortBy.length; i < len; ++i) {"," for (col in sortBy[i]) {"," if (sortBy[i].hasOwnProperty(col)) {"," sortBy[i][col] *= -1;"," break;"," }"," }"," }"," }",""," return this.fire('sort', Y.merge((payload || {}), {"," sortBy: sortBy"," }));"," },",""," //--------------------------------------------------------------------------"," // Protected properties and methods"," //--------------------------------------------------------------------------"," /**"," Sorts the `data` ModelList based on the new `sortBy` configuration.",""," @method _afterSortByChange"," @param {EventFacade} e The `sortByChange` event"," @protected"," @since 3.5.0"," **/"," _afterSortByChange: function (e) {"," // Can't use a setter because it's a chicken and egg problem. The"," // columns need to be set up to translate, but columns are initialized"," // from Core's initializer. So construction-time assignment would"," // fail."," this._setSortBy();",""," // Don't sort unless sortBy has been set"," if (this._sortBy.length) {"," if (!this.data.comparator) {"," this.data.comparator = this._sortComparator;"," }",""," this.data.sort();"," }"," },",""," /**"," Applies the sorting logic to the new ModelList if the `newVal` is a new"," ModelList.",""," @method _afterSortDataChange"," @param {EventFacade} e the `dataChange` event"," @protected"," @since 3.5.0"," **/"," _afterSortDataChange: function (e) {"," // object values always trigger a change event, but we only want to"," // call _initSortFn if the value passed to the `data` attribute was a"," // new ModelList, not a set of new data as an array, or even the same"," // ModelList."," if (e.prevVal !== e.newVal || e.newVal.hasOwnProperty('_compare')) {"," this._initSortFn();"," }"," },",""," /**"," Checks if any of the fields in the modified record are fields that are"," currently being sorted by, and if so, resorts the `data` ModelList.",""," @method _afterSortRecordChange"," @param {EventFacade} e The Model's `change` event"," @protected"," @since 3.5.0"," **/"," _afterSortRecordChange: function (e) {"," var i, len;",""," for (i = 0, len = this._sortBy.length; i < len; ++i) {"," if (e.changed[this._sortBy[i].key]) {"," this.data.sort();"," break;"," }"," }"," },",""," /**"," Subscribes to state changes that warrant updating the UI, and adds the"," click handler for triggering the sort operation from the UI.",""," @method _bindSortUI"," @protected"," @since 3.5.0"," **/"," _bindSortUI: function () {"," var handles = this._eventHandles;"," "," if (!handles.sortAttrs) {"," handles.sortAttrs = this.after("," ['sortableChange', 'sortByChange', 'columnsChange'],"," Y.bind('_uiSetSortable', this));"," }",""," if (!handles.sortUITrigger && this._theadNode) {"," handles.sortUITrigger = this.delegate(['click','keydown'],"," Y.rbind('_onUITriggerSort', this),"," '.' + this.getClassName('sortable', 'column'));"," }"," },",""," /**"," Sets the `sortBy` attribute from the `sort` event's `e.sortBy` value.",""," @method _defSortFn"," @param {EventFacade} e The `sort` event"," @protected"," @since 3.5.0"," **/"," _defSortFn: function (e) {"," this.set.apply(this, ['sortBy', e.sortBy].concat(e.details));"," },",""," /**"," Getter for the `sortBy` attribute."," "," Supports the special subattribute \"sortBy.state\" to get a normalized JSON"," version of the current sort state. Otherwise, returns the last assigned"," value.",""," For example:",""," <pre><code>var table = new Y.DataTable({"," columns: [ ... ],"," data: [ ... ],"," sortBy: 'username'"," });",""," table.get('sortBy'); // 'username'"," table.get('sortBy.state'); // { key: 'username', dir: 1 }",""," table.sort(['lastName', { firstName: \"desc\" }]);"," table.get('sortBy'); // ['lastName', { firstName: \"desc\" }]"," table.get('sortBy.state'); // [{ key: \"lastName\", dir: 1 }, { key: \"firstName\", dir: -1 }]"," </code></pre>",""," @method _getSortBy"," @param {String|String[]|Object|Object[]} val The current sortBy value"," @param {String} detail String passed to `get(HERE)`. to parse subattributes"," @protected"," @since 3.5.0"," **/"," _getSortBy: function (val, detail) {"," var state, i, len, col;",""," // \"sortBy.\" is 7 characters. Used to catch "," detail = detail.slice(7);",""," // TODO: table.get('sortBy.asObject')? table.get('sortBy.json')?"," if (detail === 'state') {"," state = [];",""," for (i = 0, len = this._sortBy.length; i < len; ++i) {"," col = this._sortBy[i];"," state.push({"," column: col._id,"," dir: col.sortDir"," });"," }",""," // TODO: Always return an array?"," return { state: (state.length === 1) ? state[0] : state };"," } else {"," return val;"," }"," },",""," /**"," Sets up the initial sort state and instance properties. Publishes events"," and subscribes to attribute change events to maintain internal state.",""," @method initializer"," @protected"," @since 3.5.0"," **/"," initializer: function () {"," var boundParseSortable = Y.bind('_parseSortable', this);",""," this._parseSortable();",""," this._setSortBy();",""," this._initSortFn();",""," this._initSortStrings();",""," this.after({"," 'table:renderHeader': Y.bind('_renderSortable', this),"," dataChange : Y.bind('_afterSortDataChange', this),"," sortByChange : Y.bind('_afterSortByChange', this),"," sortableChange : boundParseSortable,"," columnsChange : boundParseSortable"," });"," this.data.after(this.data.model.NAME + \":change\","," Y.bind('_afterSortRecordChange', this));",""," // TODO: this event needs magic, allowing async remote sorting"," this.publish('sort', {"," defaultFn: Y.bind('_defSortFn', this)"," });"," },",""," /**"," Creates a `_compare` function for the `data` ModelList to allow custom"," sorting by multiple fields.",""," @method _initSortFn"," @protected"," @since 3.5.0"," **/"," _initSortFn: function () {"," var self = this;",""," // TODO: This should be a ModelList extension."," // FIXME: Modifying a component of the host seems a little smelly"," // FIXME: Declaring inline override to leverage closure vs"," // compiling a new function for each column/sortable change or"," // binding the _compare implementation to this, resulting in an"," // extra function hop during sorting. Lesser of three evils?"," this.data._compare = function (a, b) {"," var cmp = 0,"," i, len, col, dir, aa, bb;",""," for (i = 0, len = self._sortBy.length; !cmp && i < len; ++i) {"," col = self._sortBy[i];"," dir = col.sortDir;",""," if (col.sortFn) {"," cmp = col.sortFn(a, b, (dir === -1));"," } else {"," // FIXME? Requires columns without sortFns to have key"," aa = a.get(col.key) || '';"," bb = b.get(col.key) || '';",""," cmp = (aa > bb) ? dir : ((aa < bb) ? -dir : 0);"," }"," }",""," return cmp;"," };",""," if (this._sortBy.length) {"," this.data.comparator = this._sortComparator;",""," // TODO: is this necessary? Should it be elsewhere?"," this.data.sort();"," } else {"," // Leave the _compare method in place to avoid having to set it"," // up again. Mistake?"," delete this.data.comparator;"," }"," },",""," /**"," Add the sort related strings to the `strings` map."," "," @method _initSortStrings"," @protected"," @since 3.5.0"," **/"," _initSortStrings: function () {"," // Not a valueFn because other class extensions will want to add to it"," this.set('strings', Y.mix((this.get('strings') || {}), "," Y.Intl.get('datatable-sort')));"," },",""," /**"," Fires the `sort` event in response to user clicks on sortable column"," headers.",""," @method _onUITriggerSort"," @param {DOMEventFacade} e The `click` event"," @protected"," @since 3.5.0"," **/"," _onUITriggerSort: function (e) {"," var id = e.currentTarget.getAttribute('data-yui3-col-id'),"," sortBy = e.shiftKey ? this.get('sortBy') : [{}],"," column = id && this.getColumn(id),"," i, len;",""," if (e.type === 'keydown' && e.keyCode !== 32) {"," return;"," }",""," // In case a headerTemplate injected a link"," // TODO: Is this overreaching?"," e.preventDefault();",""," if (column) {"," if (e.shiftKey) {"," for (i = 0, len = sortBy.length; i < len; ++i) {"," if (id === sortBy[i] || Math.abs(sortBy[i][id] === 1)) {"," if (!isObject(sortBy[i])) {"," sortBy[i] = {};"," }",""," sortBy[i][id] = -(column.sortDir|0) || 1;"," break;"," }"," }",""," if (i >= len) {"," sortBy.push(column._id);"," }"," } else {"," sortBy[0][id] = -(column.sortDir|0) || 1;"," }",""," this.fire('sort', {"," originEvent: e,"," sortBy: sortBy"," });"," }"," },",""," /**"," Normalizes the possible input values for the `sortable` attribute, storing"," the results in the `_sortable` property.",""," @method _parseSortable"," @protected"," @since 3.5.0"," **/"," _parseSortable: function () {"," var sortable = this.get('sortable'),"," columns = [],"," i, len, col;",""," if (isArray(sortable)) {"," for (i = 0, len = sortable.length; i < len; ++i) {"," col = sortable[i];",""," // isArray is called because arrays are objects, but will rely"," // on getColumn to nullify them for the subsequent if (col)"," if (!isObject(col, true) || isArray(col)) {"," col = this.getColumn(col);"," }",""," if (col) {"," columns.push(col);"," }"," }"," } else if (sortable) {"," columns = this._displayColumns.slice();",""," if (sortable === 'auto') {"," for (i = columns.length - 1; i >= 0; --i) {"," if (!columns[i].sortable) {"," columns.splice(i, 1);"," }"," }"," }"," }",""," this._sortable = columns;"," },",""," /**"," Initial application of the sortable UI.",""," @method _renderSortable"," @protected"," @since 3.5.0"," **/"," _renderSortable: function () {"," this._uiSetSortable();",""," this._bindSortUI();"," },",""," /**"," Parses the current `sortBy` attribute into a normalized structure for the"," `data` ModelList's `_compare` method. Also updates the column"," configurations' `sortDir` properties.",""," @method _setSortBy"," @protected"," @since 3.5.0"," **/"," _setSortBy: function () {"," var columns = this._displayColumns,"," sortBy = this.get('sortBy') || [],"," sortedClass = ' ' + this.getClassName('sorted'),"," i, len, name, dir, field, column;",""," this._sortBy = [];",""," // Purge current sort state from column configs"," for (i = 0, len = columns.length; i < len; ++i) {"," column = columns[i];",""," delete column.sortDir;",""," if (column.className) {"," // TODO: be more thorough"," column.className = column.className.replace(sortedClass, '');"," }"," }",""," sortBy = toArray(sortBy);",""," for (i = 0, len = sortBy.length; i < len; ++i) {"," name = sortBy[i];"," dir = 1;",""," if (isObject(name)) {"," field = name;"," // Have to use a for-in loop to process sort({ foo: -1 })"," for (name in field) {"," if (field.hasOwnProperty(name)) {"," dir = dirMap[field[name]];"," break;"," }"," }"," }",""," if (name) {"," // Allow sorting of any model field and any column"," // FIXME: this isn't limited to model attributes, but there's no"," // convenient way to get a list of the attributes for a Model"," // subclass *including* the attributes of its superclasses."," column = this.getColumn(name) || { _id: name, key: name };",""," if (column) {"," column.sortDir = dir;",""," if (!column.className) {"," column.className = '';"," }",""," column.className += sortedClass;",""," this._sortBy.push(column);"," }"," }"," }"," },",""," /**"," Array of column configuration objects of those columns that need UI setup"," for user interaction.",""," @property _sortable"," @type {Object[]}"," @protected"," @since 3.5.0"," **/"," //_sortable: null,",""," /**"," Array of column configuration objects for those columns that are currently"," being used to sort the data. Fake column objects are used for fields that"," are not rendered as columns.",""," @property _sortBy"," @type {Object[]}"," @protected"," @since 3.5.0"," **/"," //_sortBy: null,",""," /**"," Replacement `comparator` for the `data` ModelList that defers sorting logic"," to the `_compare` method. The deferral is accomplished by returning `this`.",""," @method _sortComparator"," @param {Model} item The record being evaluated for sort position"," @return {Model} The record"," @protected"," @since 3.5.0"," **/"," _sortComparator: function (item) {"," // Defer sorting to ModelList's _compare"," return item;"," },",""," /**"," Applies the appropriate classes to the `boundingBox` and column headers to"," indicate sort state and sortability.",""," Also currently wraps the header content of sortable columns in a `<div>`"," liner to give a CSS anchor for sort indicators.",""," @method _uiSetSortable"," @protected"," @since 3.5.0"," **/"," _uiSetSortable: function () {"," var columns = this._sortable || [],"," sortableClass = this.getClassName('sortable', 'column'),"," ascClass = this.getClassName('sorted'),"," descClass = this.getClassName('sorted', 'desc'),"," linerClass = this.getClassName('sort', 'liner'),"," indicatorClass= this.getClassName('sort', 'indicator'),"," sortableCols = {},"," i, len, col, node, liner, title, desc;",""," this.get('boundingBox').toggleClass("," this.getClassName('sortable'),"," columns.length);",""," for (i = 0, len = columns.length; i < len; ++i) {"," sortableCols[columns[i].id] = columns[i];"," }",""," // TODO: this.head.render() + decorate cells?"," this._theadNode.all('.' + sortableClass).each(function (node) {"," var col = sortableCols[node.get('id')],"," liner = node.one('.' + linerClass),"," indicator;",""," if (col) {"," if (!col.sortDir) {"," node.removeClass(ascClass)"," .removeClass(descClass);"," }"," } else {"," node.removeClass(sortableClass)"," .removeClass(ascClass)"," .removeClass(descClass);",""," if (liner) {"," liner.replace(liner.get('childNodes').toFrag());"," }",""," indicator = node.one('.' + indicatorClass);",""," if (indicator) {"," indicator.remove().destroy(true);"," }"," }"," });",""," for (i = 0, len = columns.length; i < len; ++i) {"," col = columns[i];"," node = this._theadNode.one('#' + col.id);"," desc = col.sortDir === -1;",""," if (node) {"," liner = node.one('.' + linerClass);",""," node.addClass(sortableClass);",""," if (col.sortDir) {"," node.addClass(ascClass);",""," node.toggleClass(descClass, desc);",""," node.setAttribute('aria-sort', desc ?"," 'descending' : 'ascending');"," }",""," if (!liner) {"," liner = Y.Node.create(Y.Lang.sub("," this.SORTABLE_HEADER_TEMPLATE, {"," className: linerClass,"," indicatorClass: indicatorClass"," }));",""," liner.prepend(node.get('childNodes').toFrag());",""," node.append(liner);"," }",""," title = sub(this.getString("," (col.sortDir === 1) ? 'reverseSortBy' : 'sortBy'), {"," column: col.abbr || col.label ||"," col.key || ('column ' + i)"," });",""," node.setAttribute('title', title);"," // To combat VoiceOver from reading the sort title as the"," // column header"," node.setAttribute('aria-labelledby', col.id);"," }"," }"," },",""," /**"," Allows values `true`, `false`, \"auto\", or arrays of column names through.",""," @method _validateSortable"," @param {Any} val The input value to `set(\"sortable\", VAL)`"," @return {Boolean}"," @protected"," @since 3.5.0"," **/"," _validateSortable: function (val) {"," return val === 'auto' || isBoolean(val) || isArray(val);"," },",""," /**"," Allows strings, arrays of strings, objects, or arrays of objects.",""," @method _validateSortBy"," @param {String|String[]|Object|Object[]} val The new `sortBy` value"," @return {Boolean}"," @protected"," @since 3.5.0"," **/"," _validateSortBy: function (val) {"," return val === null ||"," isString(val) ||"," isObject(val, true) ||"," (isArray(val) && (isString(val[0]) || isObject(val, true)));"," }","","}, true);","","Y.DataTable.Sortable = Sortable;","","Y.Base.mix(Y.DataTable, [Sortable]);","","","}, '3.7.3', {\"requires\": [\"datatable-base\"], \"lang\": [\"en\"], \"skinnable\": true});"]; _yuitest_coverage["build/datatable-sort/datatable-sort.js"].lines = {"1":0,"11":0,"108":0,"110":0,"173":0,"215":0,"246":0,"251":0,"252":0,"253":0,"254":0,"257":0,"258":0,"260":0,"261":0,"262":0,"264":0,"265":0,"266":0,"267":0,"272":0,"273":0,"274":0,"275":0,"276":0,"282":0,"303":0,"306":0,"307":0,"308":0,"311":0,"329":0,"330":0,"344":0,"346":0,"347":0,"348":0,"349":0,"363":0,"365":0,"366":0,"371":0,"372":0,"387":0,"420":0,"423":0,"426":0,"427":0,"429":0,"430":0,"431":0,"438":0,"440":0,"453":0,"455":0,"457":0,"459":0,"461":0,"463":0,"470":0,"474":0,"488":0,"496":0,"497":0,"500":0,"501":0,"502":0,"504":0,"505":0,"508":0,"509":0,"511":0,"515":0,"518":0,"519":0,"522":0,"526":0,"539":0,"553":0,"558":0,"559":0,"564":0,"566":0,"567":0,"568":0,"569":0,"570":0,"571":0,"574":0,"575":0,"579":0,"580":0,"583":0,"586":0,"602":0,"606":0,"607":0,"608":0,"612":0,"613":0,"616":0,"617":0,"620":0,"621":0,"623":0,"624":0,"625":0,"626":0,"632":0,"643":0,"645":0,"658":0,"663":0,"666":0,"667":0,"669":0,"671":0,"673":0,"677":0,"679":0,"680":0,"681":0,"683":0,"684":0,"686":0,"687":0,"688":0,"689":0,"694":0,"699":0,"701":0,"702":0,"704":0,"705":0,"708":0,"710":0,"751":0,"766":0,"775":0,"779":0,"780":0,"784":0,"785":0,"789":0,"790":0,"791":0,"795":0,"799":0,"800":0,"803":0,"805":0,"806":0,"811":0,"812":0,"813":0,"814":0,"816":0,"817":0,"819":0,"821":0,"822":0,"824":0,"826":0,"830":0,"831":0,"837":0,"839":0,"842":0,"848":0,"851":0,"866":0,"879":0,"887":0,"889":0}; _yuitest_coverage["build/datatable-sort/datatable-sort.js"].functions = {"Sortable:108":0,"sort:202":0,"toggleSort:245":0,"_afterSortByChange:298":0,"_afterSortDataChange:324":0,"_afterSortRecordChange:343":0,"_bindSortUI:362":0,"_defSortFn:386":0,"_getSortBy:419":0,"initializer:452":0,"_compare:496":0,"_initSortFn:487":0,"_initSortStrings:537":0,"_onUITriggerSort:552":0,"_parseSortable:601":0,"_renderSortable:642":0,"_setSortBy:657":0,"_sortComparator:749":0,"(anonymous 2):784":0,"_uiSetSortable:765":0,"_validateSortable:865":0,"_validateSortBy:878":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-sort/datatable-sort.js"].coveredLines = 174;@@ -1124,4 +1124,4 @@ Y.Base.mix(Y.DataTable, [Sortable]); -}, '3.7.2', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
bundle/datatable-sort/datatable-sort-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -895,4 +895,4 @@ Y.Base.mix(Y.DataTable, [Sortable]); -}, '3.7.2', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
bundle/datatable-sort/datatable-sort-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-sort",function(e,t){function l(){}var n=e.Lang,r=n.isBoolean,i=n.isString,s=n.isArray,o=n.isObject,u=e.Array,a=n.sub,f={asc:1,desc:-1,1:1,"-1":-1};l.ATTRS={sortable:{value:"auto",validator:"_validateSortable"},sortBy:{validator:"_validateSortBy",getter:"_getSortBy"},strings:{}},e.mix(l.prototype,{sort:function(t,n){return this.fire("sort",e.merge(n||{},{sortBy:t||this.get("sortBy")}))},SORTABLE_HEADER_TEMPLATE:'<div class="{className}" tabindex="0"><span class="{indicatorClass}"></span></div>',toggleSort:function(t,n){var r=this._sortBy,i=[],s,o,a,f,l;for(s=0,o=r.length;s<o;++s)f={},f[r[s]._id]=r[s].sortDir,i.push(f);if(t){t=u(t);for(s=0,o=t.length;s<o;++s){f=t[s],l=-1;for(a=i.length-1;s>=0;--s)if(i[a][f]){i[a][f]*=-1;break}}}else for(s=0,o=i.length;s<o;++s)for(f in i[s])if(i[s].hasOwnProperty(f)){i[s][f]*=-1;break}return this.fire("sort",e.merge(n||{},{sortBy:i}))},_afterSortByChange:function(e){this._setSortBy(),this._sortBy.length&&(this.data.comparator||(this.data.comparator=this._sortComparator),this.data.sort())},_afterSortDataChange:function(e){(e.prevVal!==e.newVal||e.newVal.hasOwnProperty("_compare"))&&this._initSortFn()},_afterSortRecordChange:function(e){var t,n;for(t=0,n=this._sortBy.length;t<n;++t)if(e.changed[this._sortBy[t].key]){this.data.sort();break}},_bindSortUI:function(){var t=this._eventHandles;t.sortAttrs||(t.sortAttrs=this.after(["sortableChange","sortByChange","columnsChange"],e.bind("_uiSetSortable",this))),!t.sortUITrigger&&this._theadNode&&(t.sortUITrigger=this.delegate(["click","keydown"],e.rbind("_onUITriggerSort",this),"."+this.getClassName("sortable","column")))},_defSortFn:function(e){this.set.apply(this,["sortBy",e.sortBy].concat(e.details))},_getSortBy:function(e,t){var n,r,i,s;t=t.slice(7);if(t==="state"){n=[];for(r=0,i=this._sortBy.length;r<i;++r)s=this._sortBy[r],n.push({column:s._id,dir:s.sortDir});return{state:n.length===1?n[0]:n}}return e},initializer:function(){var t=e.bind("_parseSortable",this);this._parseSortable(),this._setSortBy(),this._initSortFn(),this._initSortStrings(),this.after({"table:renderHeader":e.bind("_renderSortable",this),dataChange:e.bind("_afterSortDataChange",this),sortByChange:e.bind("_afterSortByChange",this),sortableChange:t,columnsChange:t}),this.data.after(this.data.model.NAME+":change",e.bind("_afterSortRecordChange",this)),this.publish("sort",{defaultFn:e.bind("_defSortFn",this)})},_initSortFn:function(){var e=this;this.data._compare=function(t,n){var r=0,i,s,o,u,a,f;for(i=0,s=e._sortBy.length;!r&&i<s;++i)o=e._sortBy[i],u=o.sortDir,o.sortFn?r=o.sortFn(t,n,u===-1):(a=t.get(o.key)||"",f=n.get(o.key)||"",r=a>f?u:a<f?-u:0);return r},this._sortBy.length?(this.data.comparator=this._sortComparator,this.data.sort()):delete this.data.comparator},_initSortStrings:function(){this.set("strings",e.mix(this.get("strings")||{},e.Intl.get("datatable-sort")))},_onUITriggerSort:function(e){var t=e.currentTarget.getAttribute("data-yui3-col-id"),n=e.shiftKey?this.get("sortBy"):[{}],r=t&&this.getColumn(t),i,s;if(e.type==="keydown"&&e.keyCode!==32)return;e.preventDefault();if(r){if(e.shiftKey){for(i=0,s=n.length;i<s;++i)if(t===n[i]||Math.abs(n[i][t]===1)){o(n[i])||(n[i]={}),n[i][t]=-(r.sortDir|0)||1;break}i>=s&&n.push(r._id)}else n[0][t]=-(r.sortDir|0)||1;this.fire("sort",{originEvent:e,sortBy:n})}},_parseSortable:function(){var e=this.get("sortable"),t=[],n,r,i;if(s(e))for(n=0,r=e.length;n<r;++n){i=e[n];if(!o(i,!0)||s(i))i=this.getColumn(i);i&&t.push(i)}else if(e){t=this._displayColumns.slice();if(e==="auto")for(n=t.length-1;n>=0;--n)t[n].sortable||t.splice(n,1)}this._sortable=t},_renderSortable:function(){this._uiSetSortable(),this._bindSortUI()},_setSortBy:function(){var e=this._displayColumns,t=this.get("sortBy")||[],n=" "+this.getClassName("sorted"),r,i,s,a,l,c;this._sortBy=[];for(r=0,i=e.length;r<i;++r)c=e[r],delete c.sortDir,c.className&&(c.className=c.className.replace(n,""));t=u(t);for(r=0,i=t.length;r<i;++r){s=t[r],a=1;if(o(s)){l=s;for(s in l)if(l.hasOwnProperty(s)){a=f[l[s]];break}}s&&(c=this.getColumn(s)||{_id:s,key:s},c&&(c.sortDir=a,c.className||(c.className=""),c.className+=n,this._sortBy.push(c)))}},_sortComparator:function(e){return e},_uiSetSortable:function(){var t=this._sortable||[],n=this.getClassName("sortable","column"),r=this.getClassName("sorted"),i=this.getClassName("sorted","desc"),s=this.getClassName("sort","liner"),o=this.getClassName("sort","indicator"),u={},f,l,c,h,p,d,v;this.get("boundingBox").toggleClass(this.getClassName("sortable"),t.length);for(f=0,l=t.length;f<l;++f)u[t[f].id]=t[f];this._theadNode.all("."+n).each(function(e){var t=u[e.get("id")],a=e.one("."+s),f;t?t.sortDir||e.removeClass(r).removeClass(i):(e.removeClass(n).removeClass(r).removeClass(i),a&&a.replace(a.get("childNodes").toFrag()),f=e.one("."+o),f&&f.remove().destroy(!0))});for(f=0,l=t.length;f<l;++f)c=t[f],h=this._theadNode.one("#"+c.id),v=c.sortDir===-1,h&&(p=h.one("."+s),h.addClass(n),c.sortDir&&(h.addClass(r),h.toggleClass(i,v),h.setAttribute("aria-sort",v?"descending":"ascending")),p||(p=e.Node.create(e.Lang.sub(this.SORTABLE_HEADER_TEMPLATE,{className:s,indicatorClass:o})),p.prepend(h.get("childNodes").toFrag()),h.append(p)),d=a(this.getString(c.sortDir===1?"reverseSortBy":"sortBy"),{column:c.abbr||c.label||c.key||"column "+f}),h.setAttribute("title",d),h.setAttribute("aria-labelledby",c.id))},_validateSortable:function(e){return e==="auto"||r(e)||s(e)},_validateSortBy:function(e){return e===null||i(e)||o(e,!0)||s(e)&&(i(e[0])||o(e,!0))}},!0),e.DataTable.Sortable=l,e.Base.mix(e.DataTable,[l])},"3.7.2",{requires:["datatable-base"],lang:["en"],skinnable:!0});+YUI.add("datatable-sort",function(e,t){function l(){}var n=e.Lang,r=n.isBoolean,i=n.isString,s=n.isArray,o=n.isObject,u=e.Array,a=n.sub,f={asc:1,desc:-1,1:1,"-1":-1};l.ATTRS={sortable:{value:"auto",validator:"_validateSortable"},sortBy:{validator:"_validateSortBy",getter:"_getSortBy"},strings:{}},e.mix(l.prototype,{sort:function(t,n){return this.fire("sort",e.merge(n||{},{sortBy:t||this.get("sortBy")}))},SORTABLE_HEADER_TEMPLATE:'<div class="{className}" tabindex="0"><span class="{indicatorClass}"></span></div>',toggleSort:function(t,n){var r=this._sortBy,i=[],s,o,a,f,l;for(s=0,o=r.length;s<o;++s)f={},f[r[s]._id]=r[s].sortDir,i.push(f);if(t){t=u(t);for(s=0,o=t.length;s<o;++s){f=t[s],l=-1;for(a=i.length-1;s>=0;--s)if(i[a][f]){i[a][f]*=-1;break}}}else for(s=0,o=i.length;s<o;++s)for(f in i[s])if(i[s].hasOwnProperty(f)){i[s][f]*=-1;break}return this.fire("sort",e.merge(n||{},{sortBy:i}))},_afterSortByChange:function(e){this._setSortBy(),this._sortBy.length&&(this.data.comparator||(this.data.comparator=this._sortComparator),this.data.sort())},_afterSortDataChange:function(e){(e.prevVal!==e.newVal||e.newVal.hasOwnProperty("_compare"))&&this._initSortFn()},_afterSortRecordChange:function(e){var t,n;for(t=0,n=this._sortBy.length;t<n;++t)if(e.changed[this._sortBy[t].key]){this.data.sort();break}},_bindSortUI:function(){var t=this._eventHandles;t.sortAttrs||(t.sortAttrs=this.after(["sortableChange","sortByChange","columnsChange"],e.bind("_uiSetSortable",this))),!t.sortUITrigger&&this._theadNode&&(t.sortUITrigger=this.delegate(["click","keydown"],e.rbind("_onUITriggerSort",this),"."+this.getClassName("sortable","column")))},_defSortFn:function(e){this.set.apply(this,["sortBy",e.sortBy].concat(e.details))},_getSortBy:function(e,t){var n,r,i,s;t=t.slice(7);if(t==="state"){n=[];for(r=0,i=this._sortBy.length;r<i;++r)s=this._sortBy[r],n.push({column:s._id,dir:s.sortDir});return{state:n.length===1?n[0]:n}}return e},initializer:function(){var t=e.bind("_parseSortable",this);this._parseSortable(),this._setSortBy(),this._initSortFn(),this._initSortStrings(),this.after({"table:renderHeader":e.bind("_renderSortable",this),dataChange:e.bind("_afterSortDataChange",this),sortByChange:e.bind("_afterSortByChange",this),sortableChange:t,columnsChange:t}),this.data.after(this.data.model.NAME+":change",e.bind("_afterSortRecordChange",this)),this.publish("sort",{defaultFn:e.bind("_defSortFn",this)})},_initSortFn:function(){var e=this;this.data._compare=function(t,n){var r=0,i,s,o,u,a,f;for(i=0,s=e._sortBy.length;!r&&i<s;++i)o=e._sortBy[i],u=o.sortDir,o.sortFn?r=o.sortFn(t,n,u===-1):(a=t.get(o.key)||"",f=n.get(o.key)||"",r=a>f?u:a<f?-u:0);return r},this._sortBy.length?(this.data.comparator=this._sortComparator,this.data.sort()):delete this.data.comparator},_initSortStrings:function(){this.set("strings",e.mix(this.get("strings")||{},e.Intl.get("datatable-sort")))},_onUITriggerSort:function(e){var t=e.currentTarget.getAttribute("data-yui3-col-id"),n=e.shiftKey?this.get("sortBy"):[{}],r=t&&this.getColumn(t),i,s;if(e.type==="keydown"&&e.keyCode!==32)return;e.preventDefault();if(r){if(e.shiftKey){for(i=0,s=n.length;i<s;++i)if(t===n[i]||Math.abs(n[i][t]===1)){o(n[i])||(n[i]={}),n[i][t]=-(r.sortDir|0)||1;break}i>=s&&n.push(r._id)}else n[0][t]=-(r.sortDir|0)||1;this.fire("sort",{originEvent:e,sortBy:n})}},_parseSortable:function(){var e=this.get("sortable"),t=[],n,r,i;if(s(e))for(n=0,r=e.length;n<r;++n){i=e[n];if(!o(i,!0)||s(i))i=this.getColumn(i);i&&t.push(i)}else if(e){t=this._displayColumns.slice();if(e==="auto")for(n=t.length-1;n>=0;--n)t[n].sortable||t.splice(n,1)}this._sortable=t},_renderSortable:function(){this._uiSetSortable(),this._bindSortUI()},_setSortBy:function(){var e=this._displayColumns,t=this.get("sortBy")||[],n=" "+this.getClassName("sorted"),r,i,s,a,l,c;this._sortBy=[];for(r=0,i=e.length;r<i;++r)c=e[r],delete c.sortDir,c.className&&(c.className=c.className.replace(n,""));t=u(t);for(r=0,i=t.length;r<i;++r){s=t[r],a=1;if(o(s)){l=s;for(s in l)if(l.hasOwnProperty(s)){a=f[l[s]];break}}s&&(c=this.getColumn(s)||{_id:s,key:s},c&&(c.sortDir=a,c.className||(c.className=""),c.className+=n,this._sortBy.push(c)))}},_sortComparator:function(e){return e},_uiSetSortable:function(){var t=this._sortable||[],n=this.getClassName("sortable","column"),r=this.getClassName("sorted"),i=this.getClassName("sorted","desc"),s=this.getClassName("sort","liner"),o=this.getClassName("sort","indicator"),u={},f,l,c,h,p,d,v;this.get("boundingBox").toggleClass(this.getClassName("sortable"),t.length);for(f=0,l=t.length;f<l;++f)u[t[f].id]=t[f];this._theadNode.all("."+n).each(function(e){var t=u[e.get("id")],a=e.one("."+s),f;t?t.sortDir||e.removeClass(r).removeClass(i):(e.removeClass(n).removeClass(r).removeClass(i),a&&a.replace(a.get("childNodes").toFrag()),f=e.one("."+o),f&&f.remove().destroy(!0))});for(f=0,l=t.length;f<l;++f)c=t[f],h=this._theadNode.one("#"+c.id),v=c.sortDir===-1,h&&(p=h.one("."+s),h.addClass(n),c.sortDir&&(h.addClass(r),h.toggleClass(i,v),h.setAttribute("aria-sort",v?"descending":"ascending")),p||(p=e.Node.create(e.Lang.sub(this.SORTABLE_HEADER_TEMPLATE,{className:s,indicatorClass:o})),p.prepend(h.get("childNodes").toFrag()),h.append(p)),d=a(this.getString(c.sortDir===1?"reverseSortBy":"sortBy"),{column:c.abbr||c.label||c.key||"column "+f}),h.setAttribute("title",d),h.setAttribute("aria-labelledby",c.id))},_validateSortable:function(e){return e==="auto"||r(e)||s(e)},_validateSortBy:function(e){return e===null||i(e)||o(e,!0)||s(e)&&(i(e[0])||o(e,!0))}},!0),e.DataTable.Sortable=l,e.Base.mix(e.DataTable,[l])},"3.7.3",{requires:["datatable-base"],lang:["en"],skinnable:!0});
bundle/datatable-sort/datatable-sort.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -895,4 +895,4 @@ Y.Base.mix(Y.DataTable, [Sortable]); -}, '3.7.2', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});+}, '3.7.3', {"requires": ["datatable-base"], "lang": ["en"], "skinnable": true});
bundle/datatable-sort/lang/datatable-sort.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatable-sort",function(e){e.Intl.add("datatable-sort","",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"})},"3.7.2");+YUI.add("lang/datatable-sort",function(e){e.Intl.add("datatable-sort","",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"})},"3.7.3");
bundle/datatable-sort/lang/datatable-sort_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatable-sort_en",function(e){e.Intl.add("datatable-sort","en",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"})},"3.7.2");+YUI.add("lang/datatable-sort_en",function(e){e.Intl.add("datatable-sort","en",{asc:"Ascending",desc:"Descending",sortBy:"Sort by {column}",reverseSortBy:"Reverse sort by {column}"})},"3.7.3");
bundle/datatable-table/datatable-table-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatable-table/datatable-table.js", code: [] };-_yuitest_coverage["build/datatable-table/datatable-table.js"].code=["YUI.add('datatable-table', function (Y, NAME) {","","/**","View class responsible for rendering a `<table>` from provided data. Used as","the default `view` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-table","@since 3.6.0","**/","var toArray = Y.Array,"," YLang = Y.Lang,"," fromTemplate = YLang.sub,",""," isArray = YLang.isArray,"," isFunction = YLang.isFunction;","","/**","View class responsible for rendering a `<table>` from provided data. Used as","the default `view` for `Y.DataTable.Base` and `Y.DataTable` classes.","","","","@class TableView","@namespace DataTable","@extends View","@since 3.6.0","**/","Y.namespace('DataTable').TableView = Y.Base.create('table', Y.View, [], {",""," /**"," The HTML template used to create the caption Node if the `caption`"," attribute is set.",""," @property CAPTION_TEMPLATE"," @type {HTML}"," @default '<caption class=\"{className}\"/>'"," @since 3.6.0"," **/"," CAPTION_TEMPLATE: '<caption class=\"{className}\"/>',",""," /**"," The HTML template used to create the table Node.",""," @property TABLE_TEMPLATE"," @type {HTML}"," @default '<table cellspacing=\"0\" class=\"{className}\"/>'"," @since 3.6.0"," **/"," TABLE_TEMPLATE : '<table cellspacing=\"0\" class=\"{className}\"/>',",""," /**"," The object or instance of the class assigned to `bodyView` that is"," responsible for rendering and managing the table's `<tbody>`(s) and its"," content.",""," @property body"," @type {Object}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //body: null,",""," /**"," The object or instance of the class assigned to `footerView` that is"," responsible for rendering and managing the table's `<tfoot>` and its"," content.",""," @property foot"," @type {Object}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //foot: null,",""," /**"," The object or instance of the class assigned to `headerView` that is"," responsible for rendering and managing the table's `<thead>` and its"," content.",""," @property head"," @type {Object}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //head: null,",""," //-----------------------------------------------------------------------//"," // Public methods"," //-----------------------------------------------------------------------//",""," /**"," Returns the `<td>` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," <pre><code>// Previous cell in the previous row"," var cell = table.getCell(e.target, [-1, -1]);",""," // Next cell"," var cell = table.getCell(e.target, 'next');"," var cell = table.getCell(e.taregt, [0, 1];</pre></code>",""," This is actually just a pass through to the `bodyView` instance's method"," by the same name.",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (seed, shift) {"," return this.body && this.body.getCell &&"," this.body.getCell.apply(this.body, arguments);"," },",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," **/"," getClassName: function () {"," // TODO: add attr with setter for host?"," var host = this.host,"," NAME = (host && host.constructor.NAME) ||"," this.constructor.NAME;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager,"," [NAME].concat(toArray(arguments, 0, true)));"," }"," },",""," /**"," Relays call to the `bodyView`'s `getRecord` method if it has one.",""," @method getRecord"," @param {String|Node} seed Node or identifier for a row or child element"," @return {Model}"," @since 3.6.0"," **/"," getRecord: function () {"," return this.body && this.body.getRecord &&"," this.body.getRecord.apply(this.body, arguments);"," },",""," /**"," Returns the `<tr>` Node from the given row index, Model, or Model's"," `clientId`. If the rows haven't been rendered yet, or if the row can't be"," found by the input, `null` is returned.",""," This is actually just a pass through to the `bodyView` instance's method"," by the same name.",""," @method getRow"," @param {Number|String|Model} id Row index, Model instance, or clientId"," @return {Node}"," @since 3.5.0"," **/"," getRow: function (id) {"," return this.body && this.body.getRow &&"," this.body.getRow.apply(this.body, arguments);"," },","",""," //-----------------------------------------------------------------------//"," // Protected and private methods"," //-----------------------------------------------------------------------//"," /**"," Updates the table's `summary` attribute.",""," @method _afterSummaryChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _afterSummaryChange: function (e) {"," this._uiSetSummary(e.newVal);"," },",""," /**"," Updates the table's `<caption>`.",""," @method _afterCaptionChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _afterCaptionChange: function (e) {"," this._uiSetCaption(e.newVal);"," },",""," /**"," Updates the table's width.",""," @method _afterWidthChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _afterWidthChange: function (e) {"," this._uiSetWidth(e.newVal);"," },",""," /**"," Attaches event subscriptions to relay attribute changes to the child Views.",""," @method _bindUI"," @protected"," @since 3.6.0"," **/"," _bindUI: function () {"," var relay;",""," if (!this._eventHandles) {"," relay = Y.bind('_relayAttrChange', this);",""," this._eventHandles = this.after({"," columnsChange : relay,"," modelListChange: relay,"," summaryChange : Y.bind('_afterSummaryChange', this),"," captionChange : Y.bind('_afterCaptionChange', this),"," widthChange : Y.bind('_afterWidthChange', this)"," });"," }"," },",""," /**"," Creates the `<table>`.",""," @method _createTable"," @return {Node} The `<table>` node"," @protected"," @since 3.5.0"," **/"," _createTable: function () {"," return Y.Node.create(fromTemplate(this.TABLE_TEMPLATE, {"," className: this.getClassName('table')"," })).empty();"," },",""," /**"," Calls `render()` on the `bodyView` class instance.",""," @method _defRenderBodyFn"," @param {EventFacade} e The renderBody event"," @protected"," @since 3.5.0"," **/"," _defRenderBodyFn: function (e) {"," e.view.render();"," },",""," /**"," Calls `render()` on the `footerView` class instance.",""," @method _defRenderFooterFn"," @param {EventFacade} e The renderFooter event"," @protected"," @since 3.5.0"," **/"," _defRenderFooterFn: function (e) {"," e.view.render();"," },",""," /**"," Calls `render()` on the `headerView` class instance.",""," @method _defRenderHeaderFn"," @param {EventFacade} e The renderHeader event"," @protected"," @since 3.5.0"," **/"," _defRenderHeaderFn: function (e) {"," e.view.render();"," },",""," /**"," Renders the `<table>` and, if there are associated Views, the `<thead>`,"," `<tfoot>`, and `<tbody>` (empty until `syncUI`).",""," Assigns the generated table nodes to the `tableNode`, `_theadNode`,"," `_tfootNode`, and `_tbodyNode` properties. Assigns the instantiated Views"," to the `head`, `foot`, and `body` properties.","",""," @method _defRenderTableFn"," @param {EventFacade} e The renderTable event"," @protected"," @since 3.5.0"," **/"," _defRenderTableFn: function (e) {"," var container = this.get('container'),"," attrs = this.getAttrs();",""," if (!this.tableNode) {"," this.tableNode = this._createTable();"," }",""," attrs.host = this.get('host') || this;"," attrs.table = this;"," attrs.container = this.tableNode;",""," this._uiSetCaption(this.get('caption'));"," this._uiSetSummary(this.get('summary'));"," this._uiSetWidth(this.get('width'));",""," if (this.head || e.headerView) {"," if (!this.head) {"," this.head = new e.headerView(Y.merge(attrs, e.headerConfig));"," }",""," this.fire('renderHeader', { view: this.head });"," }",""," if (this.foot || e.footerView) {"," if (!this.foot) {"," this.foot = new e.footerView(Y.merge(attrs, e.footerConfig));"," }",""," this.fire('renderFooter', { view: this.foot });"," }",""," attrs.columns = this.displayColumns;",""," if (this.body || e.bodyView) {"," if (!this.body) {"," this.body = new e.bodyView(Y.merge(attrs, e.bodyConfig));"," }",""," this.fire('renderBody', { view: this.body });"," }",""," if (!container.contains(this.tableNode)) {"," container.append(this.tableNode);"," }",""," this._bindUI();"," },",""," /**"," Cleans up state, destroys child views, etc.",""," @method destructor"," @protected"," **/"," destructor: function () {"," if (this.head && this.head.destroy) {"," this.head.destroy();"," }"," delete this.head;",""," if (this.foot && this.foot.destroy) {"," this.foot.destroy();"," }"," delete this.foot;",""," if (this.body && this.body.destroy) {"," this.body.destroy();"," }"," delete this.body;",""," if (this._eventHandles) {"," this._eventHandles.detach();"," delete this._eventHandles;"," }",""," if (this.tableNode) {"," this.tableNode.remove().destroy(true);"," }"," },",""," /**"," Processes the full column array, distilling the columns down to those that"," correspond to cell data columns.",""," @method _extractDisplayColumns"," @protected"," **/"," _extractDisplayColumns: function () {"," var columns = this.get('columns'),"," displayColumns = [];",""," function process(cols) {"," var i, len, col;",""," for (i = 0, len = cols.length; i < len; ++i) {"," col = cols[i];",""," if (isArray(col.children)) {"," process(col.children);"," } else {"," displayColumns.push(col);"," }"," }"," }",""," process(columns);",""," /**"," Array of the columns that correspond to those with value cells in the"," data rows. Excludes colspan header columns (configured with `children`).",""," @property displayColumns"," @type {Object[]}"," @since 3.6.0"," **/"," this.displayColumns = displayColumns;"," },",""," /**"," Publishes core events.",""," @method _initEvents"," @protected"," @since 3.5.0"," **/"," _initEvents: function () {"," this.publish({"," // Y.bind used to allow late binding for method override support"," renderTable : { defaultFn: Y.bind('_defRenderTableFn', this) },"," renderHeader: { defaultFn: Y.bind('_defRenderHeaderFn', this) },"," renderBody : { defaultFn: Y.bind('_defRenderBodyFn', this) },"," renderFooter: { defaultFn: Y.bind('_defRenderFooterFn', this) }"," });"," },",""," /**"," Constructor logic.",""," @method intializer"," @param {Object} config Configuration object passed to the constructor"," @protected"," @since 3.6.0"," **/"," initializer: function (config) {"," this.host = config.host;",""," this._initEvents();",""," this._extractDisplayColumns();",""," this.after('columnsChange', this._extractDisplayColumns, this);"," },",""," /**"," Relays attribute changes to the child Views.",""," @method _relayAttrChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _relayAttrChange: function (e) {"," var attr = e.attrName,"," val = e.newVal;",""," if (this.head) {"," this.head.set(attr, val);"," }",""," if (this.foot) {"," this.foot.set(attr, val);"," }",""," if (this.body) {"," if (attr === 'columns') {"," val = this.displayColumns;"," }",""," this.body.set(attr, val);"," }"," },",""," /**"," Creates the UI in the configured `container`.",""," @method render"," @return {TableView}"," @chainable"," **/"," render: function () {"," if (this.get('container')) {"," this.fire('renderTable', {"," headerView : this.get('headerView'),"," headerConfig: this.get('headerConfig'),",""," bodyView : this.get('bodyView'),"," bodyConfig : this.get('bodyConfig'),",""," footerView : this.get('footerView'),"," footerConfig: this.get('footerConfig')"," });"," }",""," return this;"," },",""," /**"," Creates, removes, or updates the table's `<caption>` element per the input"," value. Empty values result in the caption being removed.",""," @method _uiSetCaption"," @param {HTML} htmlContent The content to populate the table caption"," @protected"," @since 3.5.0"," **/"," _uiSetCaption: function (htmlContent) {"," var table = this.tableNode,"," caption = this.captionNode;",""," if (htmlContent) {"," if (!caption) {"," this.captionNode = caption = Y.Node.create("," fromTemplate(this.CAPTION_TEMPLATE, {"," className: this.getClassName('caption')"," }));",""," table.prepend(this.captionNode);"," }",""," caption.setHTML(htmlContent);",""," } else if (caption) {"," caption.remove(true);",""," delete this.captionNode;"," }"," },",""," /**"," Updates the table's `summary` attribute with the input value.",""," @method _uiSetSummary"," @protected"," @since 3.5.0"," **/"," _uiSetSummary: function (summary) {"," if (summary) {"," this.tableNode.setAttribute('summary', summary);"," } else {"," this.tableNode.removeAttribute('summary');"," }"," },",""," /**"," Sets the `boundingBox` and table width per the input value.",""," @method _uiSetWidth"," @param {Number|String} width The width to make the table"," @protected"," @since 3.5.0"," **/"," _uiSetWidth: function (width) {"," var table = this.tableNode;",""," // Table width needs to account for borders"," table.setStyle('width', !width ? '' :"," (this.get('container').get('offsetWidth') -"," (parseInt(table.getComputedStyle('borderLeftWidth'), 10)|0) -"," (parseInt(table.getComputedStyle('borderLeftWidth'), 10)|0)) +"," 'px');",""," table.setStyle('width', width);"," },",""," /**"," Ensures that the input is a View class or at least has a `render` method.",""," @method _validateView"," @param {View|Function} val The View class"," @return {Boolean}"," @protected"," **/"," _validateView: function (val) {"," return isFunction(val) && val.prototype.render;"," }","}, {"," ATTRS: {"," /**"," Content for the `<table summary=\"ATTRIBUTE VALUE HERE\">`. Values"," assigned to this attribute will be HTML escaped for security.",""," @attribute summary"," @type {String}"," @default '' (empty string)"," @since 3.5.0"," **/"," //summary: {},",""," /**"," HTML content of an optional `<caption>` element to appear above the"," table. Leave this config unset or set to a falsy value to remove the"," caption.",""," @attribute caption"," @type HTML"," @default undefined (initially unset)"," @since 3.6.0"," **/"," //caption: {},",""," /**"," Columns to include in the rendered table.",""," This attribute takes an array of objects. Each object is considered a"," data column or header cell to be rendered. How the objects are"," translated into markup is delegated to the `headerView`, `bodyView`,"," and `footerView`.",""," The raw value is passed to the `headerView` and `footerView`. The"," `bodyView` receives the instance's `displayColumns` array, which is"," parsed from the columns array. If there are no nested columns (columns"," configured with a `children` array), the `displayColumns` is the same"," as the raw value."," "," @attribute columns"," @type {Object[]}"," @since 3.6.0"," **/"," columns: {"," validator: isArray"," },",""," /**"," Width of the table including borders. This value requires units, so"," `200` is invalid, but `'200px'` is valid. Setting the empty string"," (the default) will allow the browser to set the table width.",""," @attribute width"," @type {String}"," @default ''"," @since 3.6.0"," **/"," width: {"," value: '',"," validator: YLang.isString"," },",""," /**"," An instance of this class is used to render the contents of the"," `<thead>`—the column headers for the table."," "," The instance of this View will be assigned to the instance's `head`"," property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute headerView"," @type {Function|Object}"," @default Y.DataTable.HeaderView"," @since 3.6.0"," **/"," headerView: {"," value: Y.DataTable.HeaderView,"," validator: '_validateView'"," },",""," /**"," Configuration overrides used when instantiating the `headerView`"," instance.",""," @attribute headerConfig"," @type {Object}"," @since 3.6.0"," **/"," //headerConfig: {},",""," /**"," An instance of this class is used to render the contents of the"," `<tfoot>` (if appropriate)."," "," The instance of this View will be assigned to the instance's `foot`"," property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute footerView"," @type {Function|Object}"," @since 3.6.0"," **/"," footerView: {"," validator: '_validateView'"," },",""," /**"," Configuration overrides used when instantiating the `footerView`"," instance.",""," @attribute footerConfig"," @type {Object}"," @since 3.6.0"," **/"," //footerConfig: {},",""," /**"," An instance of this class is used to render the contents of the table's"," `<tbody>`—the data cells in the table."," "," The instance of this View will be assigned to the instance's `body`"," property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute bodyView"," @type {Function|Object}"," @default Y.DataTable.BodyView"," @since 3.6.0"," **/"," bodyView: {"," value: Y.DataTable.BodyView,"," validator: '_validateView'"," }",""," /**"," Configuration overrides used when instantiating the `bodyView`"," instance.",""," @attribute bodyConfig"," @type {Object}"," @since 3.6.0"," **/"," //bodyConfig: {}"," }","});","","","","","}, '3.7.2', {\"requires\": [\"datatable-core\", \"datatable-head\", \"datatable-body\", \"view\", \"classnamemanager\"]});"];+_yuitest_coverage["build/datatable-table/datatable-table.js"].code=["YUI.add('datatable-table', function (Y, NAME) {","","/**","View class responsible for rendering a `<table>` from provided data. Used as","the default `view` for `Y.DataTable.Base` and `Y.DataTable` classes.","","@module datatable","@submodule datatable-table","@since 3.6.0","**/","var toArray = Y.Array,"," YLang = Y.Lang,"," fromTemplate = YLang.sub,",""," isArray = YLang.isArray,"," isFunction = YLang.isFunction;","","/**","View class responsible for rendering a `<table>` from provided data. Used as","the default `view` for `Y.DataTable.Base` and `Y.DataTable` classes.","","","","@class TableView","@namespace DataTable","@extends View","@since 3.6.0","**/","Y.namespace('DataTable').TableView = Y.Base.create('table', Y.View, [], {",""," /**"," The HTML template used to create the caption Node if the `caption`"," attribute is set.",""," @property CAPTION_TEMPLATE"," @type {HTML}"," @default '<caption class=\"{className}\"/>'"," @since 3.6.0"," **/"," CAPTION_TEMPLATE: '<caption class=\"{className}\"/>',",""," /**"," The HTML template used to create the table Node.",""," @property TABLE_TEMPLATE"," @type {HTML}"," @default '<table cellspacing=\"0\" class=\"{className}\"/>'"," @since 3.6.0"," **/"," TABLE_TEMPLATE : '<table cellspacing=\"0\" class=\"{className}\"/>',",""," /**"," The object or instance of the class assigned to `bodyView` that is"," responsible for rendering and managing the table's `<tbody>`(s) and its"," content.",""," @property body"," @type {Object}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //body: null,",""," /**"," The object or instance of the class assigned to `footerView` that is"," responsible for rendering and managing the table's `<tfoot>` and its"," content.",""," @property foot"," @type {Object}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //foot: null,",""," /**"," The object or instance of the class assigned to `headerView` that is"," responsible for rendering and managing the table's `<thead>` and its"," content.",""," @property head"," @type {Object}"," @default undefined (initially unset)"," @since 3.5.0"," **/"," //head: null,",""," //-----------------------------------------------------------------------//"," // Public methods"," //-----------------------------------------------------------------------//",""," /**"," Returns the `<td>` Node from the given row and column index. Alternately,"," the `seed` can be a Node. If so, the nearest ancestor cell is returned."," If the `seed` is a cell, it is returned. If there is no cell at the given"," coordinates, `null` is returned.",""," Optionally, include an offset array or string to return a cell near the"," cell identified by the `seed`. The offset can be an array containing the"," number of rows to shift followed by the number of columns to shift, or one"," of \"above\", \"below\", \"next\", or \"previous\".",""," <pre><code>// Previous cell in the previous row"," var cell = table.getCell(e.target, [-1, -1]);",""," // Next cell"," var cell = table.getCell(e.target, 'next');"," var cell = table.getCell(e.taregt, [0, 1];</pre></code>",""," This is actually just a pass through to the `bodyView` instance's method"," by the same name.",""," @method getCell"," @param {Number[]|Node} seed Array of row and column indexes, or a Node that"," is either the cell itself or a descendant of one."," @param {Number[]|String} [shift] Offset by which to identify the returned"," cell Node"," @return {Node}"," @since 3.5.0"," **/"," getCell: function (seed, shift) {"," return this.body && this.body.getCell &&"," this.body.getCell.apply(this.body, arguments);"," },",""," /**"," Returns the generated CSS classname based on the input. If the `host`"," attribute is configured, it will attempt to relay to its `getClassName`"," or use its static `NAME` property as a string base."," "," If `host` is absent or has neither method nor `NAME`, a CSS classname"," will be generated using this class's `NAME`.",""," @method getClassName"," @param {String} token* Any number of token strings to assemble the"," classname from."," @return {String}"," @protected"," **/"," getClassName: function () {"," // TODO: add attr with setter for host?"," var host = this.host,"," NAME = (host && host.constructor.NAME) ||"," this.constructor.NAME;",""," if (host && host.getClassName) {"," return host.getClassName.apply(host, arguments);"," } else {"," return Y.ClassNameManager.getClassName"," .apply(Y.ClassNameManager,"," [NAME].concat(toArray(arguments, 0, true)));"," }"," },",""," /**"," Relays call to the `bodyView`'s `getRecord` method if it has one.",""," @method getRecord"," @param {String|Node} seed Node or identifier for a row or child element"," @return {Model}"," @since 3.6.0"," **/"," getRecord: function () {"," return this.body && this.body.getRecord &&"," this.body.getRecord.apply(this.body, arguments);"," },",""," /**"," Returns the `<tr>` Node from the given row index, Model, or Model's"," `clientId`. If the rows haven't been rendered yet, or if the row can't be"," found by the input, `null` is returned.",""," This is actually just a pass through to the `bodyView` instance's method"," by the same name.",""," @method getRow"," @param {Number|String|Model} id Row index, Model instance, or clientId"," @return {Node}"," @since 3.5.0"," **/"," getRow: function (id) {"," return this.body && this.body.getRow &&"," this.body.getRow.apply(this.body, arguments);"," },","",""," //-----------------------------------------------------------------------//"," // Protected and private methods"," //-----------------------------------------------------------------------//"," /**"," Updates the table's `summary` attribute.",""," @method _afterSummaryChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _afterSummaryChange: function (e) {"," this._uiSetSummary(e.newVal);"," },",""," /**"," Updates the table's `<caption>`.",""," @method _afterCaptionChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _afterCaptionChange: function (e) {"," this._uiSetCaption(e.newVal);"," },",""," /**"," Updates the table's width.",""," @method _afterWidthChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _afterWidthChange: function (e) {"," this._uiSetWidth(e.newVal);"," },",""," /**"," Attaches event subscriptions to relay attribute changes to the child Views.",""," @method _bindUI"," @protected"," @since 3.6.0"," **/"," _bindUI: function () {"," var relay;",""," if (!this._eventHandles) {"," relay = Y.bind('_relayAttrChange', this);",""," this._eventHandles = this.after({"," columnsChange : relay,"," modelListChange: relay,"," summaryChange : Y.bind('_afterSummaryChange', this),"," captionChange : Y.bind('_afterCaptionChange', this),"," widthChange : Y.bind('_afterWidthChange', this)"," });"," }"," },",""," /**"," Creates the `<table>`.",""," @method _createTable"," @return {Node} The `<table>` node"," @protected"," @since 3.5.0"," **/"," _createTable: function () {"," return Y.Node.create(fromTemplate(this.TABLE_TEMPLATE, {"," className: this.getClassName('table')"," })).empty();"," },",""," /**"," Calls `render()` on the `bodyView` class instance.",""," @method _defRenderBodyFn"," @param {EventFacade} e The renderBody event"," @protected"," @since 3.5.0"," **/"," _defRenderBodyFn: function (e) {"," e.view.render();"," },",""," /**"," Calls `render()` on the `footerView` class instance.",""," @method _defRenderFooterFn"," @param {EventFacade} e The renderFooter event"," @protected"," @since 3.5.0"," **/"," _defRenderFooterFn: function (e) {"," e.view.render();"," },",""," /**"," Calls `render()` on the `headerView` class instance.",""," @method _defRenderHeaderFn"," @param {EventFacade} e The renderHeader event"," @protected"," @since 3.5.0"," **/"," _defRenderHeaderFn: function (e) {"," e.view.render();"," },",""," /**"," Renders the `<table>` and, if there are associated Views, the `<thead>`,"," `<tfoot>`, and `<tbody>` (empty until `syncUI`).",""," Assigns the generated table nodes to the `tableNode`, `_theadNode`,"," `_tfootNode`, and `_tbodyNode` properties. Assigns the instantiated Views"," to the `head`, `foot`, and `body` properties.","",""," @method _defRenderTableFn"," @param {EventFacade} e The renderTable event"," @protected"," @since 3.5.0"," **/"," _defRenderTableFn: function (e) {"," var container = this.get('container'),"," attrs = this.getAttrs();",""," if (!this.tableNode) {"," this.tableNode = this._createTable();"," }",""," attrs.host = this.get('host') || this;"," attrs.table = this;"," attrs.container = this.tableNode;",""," this._uiSetCaption(this.get('caption'));"," this._uiSetSummary(this.get('summary'));"," this._uiSetWidth(this.get('width'));",""," if (this.head || e.headerView) {"," if (!this.head) {"," this.head = new e.headerView(Y.merge(attrs, e.headerConfig));"," }",""," this.fire('renderHeader', { view: this.head });"," }",""," if (this.foot || e.footerView) {"," if (!this.foot) {"," this.foot = new e.footerView(Y.merge(attrs, e.footerConfig));"," }",""," this.fire('renderFooter', { view: this.foot });"," }",""," attrs.columns = this.displayColumns;",""," if (this.body || e.bodyView) {"," if (!this.body) {"," this.body = new e.bodyView(Y.merge(attrs, e.bodyConfig));"," }",""," this.fire('renderBody', { view: this.body });"," }",""," if (!container.contains(this.tableNode)) {"," container.append(this.tableNode);"," }",""," this._bindUI();"," },",""," /**"," Cleans up state, destroys child views, etc.",""," @method destructor"," @protected"," **/"," destructor: function () {"," if (this.head && this.head.destroy) {"," this.head.destroy();"," }"," delete this.head;",""," if (this.foot && this.foot.destroy) {"," this.foot.destroy();"," }"," delete this.foot;",""," if (this.body && this.body.destroy) {"," this.body.destroy();"," }"," delete this.body;",""," if (this._eventHandles) {"," this._eventHandles.detach();"," delete this._eventHandles;"," }",""," if (this.tableNode) {"," this.tableNode.remove().destroy(true);"," }"," },",""," /**"," Processes the full column array, distilling the columns down to those that"," correspond to cell data columns.",""," @method _extractDisplayColumns"," @protected"," **/"," _extractDisplayColumns: function () {"," var columns = this.get('columns'),"," displayColumns = [];",""," function process(cols) {"," var i, len, col;",""," for (i = 0, len = cols.length; i < len; ++i) {"," col = cols[i];",""," if (isArray(col.children)) {"," process(col.children);"," } else {"," displayColumns.push(col);"," }"," }"," }",""," process(columns);",""," /**"," Array of the columns that correspond to those with value cells in the"," data rows. Excludes colspan header columns (configured with `children`).",""," @property displayColumns"," @type {Object[]}"," @since 3.6.0"," **/"," this.displayColumns = displayColumns;"," },",""," /**"," Publishes core events.",""," @method _initEvents"," @protected"," @since 3.5.0"," **/"," _initEvents: function () {"," this.publish({"," // Y.bind used to allow late binding for method override support"," renderTable : { defaultFn: Y.bind('_defRenderTableFn', this) },"," renderHeader: { defaultFn: Y.bind('_defRenderHeaderFn', this) },"," renderBody : { defaultFn: Y.bind('_defRenderBodyFn', this) },"," renderFooter: { defaultFn: Y.bind('_defRenderFooterFn', this) }"," });"," },",""," /**"," Constructor logic.",""," @method intializer"," @param {Object} config Configuration object passed to the constructor"," @protected"," @since 3.6.0"," **/"," initializer: function (config) {"," this.host = config.host;",""," this._initEvents();",""," this._extractDisplayColumns();",""," this.after('columnsChange', this._extractDisplayColumns, this);"," },",""," /**"," Relays attribute changes to the child Views.",""," @method _relayAttrChange"," @param {EventHandle} e The change event"," @protected"," @since 3.6.0"," **/"," _relayAttrChange: function (e) {"," var attr = e.attrName,"," val = e.newVal;",""," if (this.head) {"," this.head.set(attr, val);"," }",""," if (this.foot) {"," this.foot.set(attr, val);"," }",""," if (this.body) {"," if (attr === 'columns') {"," val = this.displayColumns;"," }",""," this.body.set(attr, val);"," }"," },",""," /**"," Creates the UI in the configured `container`.",""," @method render"," @return {TableView}"," @chainable"," **/"," render: function () {"," if (this.get('container')) {"," this.fire('renderTable', {"," headerView : this.get('headerView'),"," headerConfig: this.get('headerConfig'),",""," bodyView : this.get('bodyView'),"," bodyConfig : this.get('bodyConfig'),",""," footerView : this.get('footerView'),"," footerConfig: this.get('footerConfig')"," });"," }",""," return this;"," },",""," /**"," Creates, removes, or updates the table's `<caption>` element per the input"," value. Empty values result in the caption being removed.",""," @method _uiSetCaption"," @param {HTML} htmlContent The content to populate the table caption"," @protected"," @since 3.5.0"," **/"," _uiSetCaption: function (htmlContent) {"," var table = this.tableNode,"," caption = this.captionNode;",""," if (htmlContent) {"," if (!caption) {"," this.captionNode = caption = Y.Node.create("," fromTemplate(this.CAPTION_TEMPLATE, {"," className: this.getClassName('caption')"," }));",""," table.prepend(this.captionNode);"," }",""," caption.setHTML(htmlContent);",""," } else if (caption) {"," caption.remove(true);",""," delete this.captionNode;"," }"," },",""," /**"," Updates the table's `summary` attribute with the input value.",""," @method _uiSetSummary"," @protected"," @since 3.5.0"," **/"," _uiSetSummary: function (summary) {"," if (summary) {"," this.tableNode.setAttribute('summary', summary);"," } else {"," this.tableNode.removeAttribute('summary');"," }"," },",""," /**"," Sets the `boundingBox` and table width per the input value.",""," @method _uiSetWidth"," @param {Number|String} width The width to make the table"," @protected"," @since 3.5.0"," **/"," _uiSetWidth: function (width) {"," var table = this.tableNode;",""," // Table width needs to account for borders"," table.setStyle('width', !width ? '' :"," (this.get('container').get('offsetWidth') -"," (parseInt(table.getComputedStyle('borderLeftWidth'), 10)|0) -"," (parseInt(table.getComputedStyle('borderLeftWidth'), 10)|0)) +"," 'px');",""," table.setStyle('width', width);"," },",""," /**"," Ensures that the input is a View class or at least has a `render` method.",""," @method _validateView"," @param {View|Function} val The View class"," @return {Boolean}"," @protected"," **/"," _validateView: function (val) {"," return isFunction(val) && val.prototype.render;"," }","}, {"," ATTRS: {"," /**"," Content for the `<table summary=\"ATTRIBUTE VALUE HERE\">`. Values"," assigned to this attribute will be HTML escaped for security.",""," @attribute summary"," @type {String}"," @default '' (empty string)"," @since 3.5.0"," **/"," //summary: {},",""," /**"," HTML content of an optional `<caption>` element to appear above the"," table. Leave this config unset or set to a falsy value to remove the"," caption.",""," @attribute caption"," @type HTML"," @default undefined (initially unset)"," @since 3.6.0"," **/"," //caption: {},",""," /**"," Columns to include in the rendered table.",""," This attribute takes an array of objects. Each object is considered a"," data column or header cell to be rendered. How the objects are"," translated into markup is delegated to the `headerView`, `bodyView`,"," and `footerView`.",""," The raw value is passed to the `headerView` and `footerView`. The"," `bodyView` receives the instance's `displayColumns` array, which is"," parsed from the columns array. If there are no nested columns (columns"," configured with a `children` array), the `displayColumns` is the same"," as the raw value."," "," @attribute columns"," @type {Object[]}"," @since 3.6.0"," **/"," columns: {"," validator: isArray"," },",""," /**"," Width of the table including borders. This value requires units, so"," `200` is invalid, but `'200px'` is valid. Setting the empty string"," (the default) will allow the browser to set the table width.",""," @attribute width"," @type {String}"," @default ''"," @since 3.6.0"," **/"," width: {"," value: '',"," validator: YLang.isString"," },",""," /**"," An instance of this class is used to render the contents of the"," `<thead>`—the column headers for the table."," "," The instance of this View will be assigned to the instance's `head`"," property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute headerView"," @type {Function|Object}"," @default Y.DataTable.HeaderView"," @since 3.6.0"," **/"," headerView: {"," value: Y.DataTable.HeaderView,"," validator: '_validateView'"," },",""," /**"," Configuration overrides used when instantiating the `headerView`"," instance.",""," @attribute headerConfig"," @type {Object}"," @since 3.6.0"," **/"," //headerConfig: {},",""," /**"," An instance of this class is used to render the contents of the"," `<tfoot>` (if appropriate)."," "," The instance of this View will be assigned to the instance's `foot`"," property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute footerView"," @type {Function|Object}"," @since 3.6.0"," **/"," footerView: {"," validator: '_validateView'"," },",""," /**"," Configuration overrides used when instantiating the `footerView`"," instance.",""," @attribute footerConfig"," @type {Object}"," @since 3.6.0"," **/"," //footerConfig: {},",""," /**"," An instance of this class is used to render the contents of the table's"," `<tbody>`—the data cells in the table."," "," The instance of this View will be assigned to the instance's `body`"," property.",""," It is not strictly necessary that the class function assigned here be"," a View subclass. It must however have a `render()` method.",""," @attribute bodyView"," @type {Function|Object}"," @default Y.DataTable.BodyView"," @since 3.6.0"," **/"," bodyView: {"," value: Y.DataTable.BodyView,"," validator: '_validateView'"," }",""," /**"," Configuration overrides used when instantiating the `bodyView`"," instance.",""," @attribute bodyConfig"," @type {Object}"," @since 3.6.0"," **/"," //bodyConfig: {}"," }","});","","","","","}, '3.7.3', {\"requires\": [\"datatable-core\", \"datatable-head\", \"datatable-body\", \"view\", \"classnamemanager\"]});"]; _yuitest_coverage["build/datatable-table/datatable-table.js"].lines = {"1":0,"11":0,"29":0,"122":0,"142":0,"146":0,"147":0,"149":0,"164":0,"182":0,"199":0,"211":0,"223":0,"234":0,"236":0,"237":0,"239":0,"258":0,"272":0,"284":0,"296":0,"314":0,"317":0,"318":0,"321":0,"322":0,"323":0,"325":0,"326":0,"327":0,"329":0,"330":0,"331":0,"334":0,"337":0,"338":0,"339":0,"342":0,"345":0,"347":0,"348":0,"349":0,"352":0,"355":0,"356":0,"359":0,"369":0,"370":0,"372":0,"374":0,"375":0,"377":0,"379":0,"380":0,"382":0,"384":0,"385":0,"386":0,"389":0,"390":0,"402":0,"405":0,"406":0,"408":0,"409":0,"411":0,"412":0,"414":0,"419":0,"429":0,"440":0,"458":0,"460":0,"462":0,"464":0,"476":0,"479":0,"480":0,"483":0,"484":0,"487":0,"488":0,"489":0,"492":0,"504":0,"505":0,"517":0,"530":0,"533":0,"534":0,"535":0,"540":0,"543":0,"545":0,"546":0,"548":0,"560":0,"561":0,"563":0,"576":0,"579":0,"585":0,"597":0}; _yuitest_coverage["build/datatable-table/datatable-table.js"].functions = {"getCell:121":0,"getClassName:140":0,"getRecord:163":0,"getRow:181":0,"_afterSummaryChange:198":0,"_afterCaptionChange:210":0,"_afterWidthChange:222":0,"_bindUI:233":0,"_createTable:257":0,"_defRenderBodyFn:271":0,"_defRenderFooterFn:283":0,"_defRenderHeaderFn:295":0,"_defRenderTableFn:313":0,"destructor:368":0,"process:405":0,"_extractDisplayColumns:401":0,"_initEvents:439":0,"initializer:457":0,"_relayAttrChange:475":0,"render:503":0,"_uiSetCaption:529":0,"_uiSetSummary:559":0,"_uiSetWidth:575":0,"_validateView:596":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatable-table/datatable-table.js"].coveredLines = 103;@@ -918,4 +918,4 @@ -}, '3.7.2', {"requires": ["datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager"]});
bundle/datatable-table/datatable-table-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -757,4 +757,4 @@ -}, '3.7.2', {"requires": ["datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager"]});
bundle/datatable-table/datatable-table-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatable-table",function(e,t){var n=e.Array,r=e.Lang,i=r.sub,s=r.isArray,o=r.isFunction;e.namespace("DataTable").TableView=e.Base.create("table",e.View,[],{CAPTION_TEMPLATE:'<caption class="{className}"/>',TABLE_TEMPLATE:'<table cellspacing="0" class="{className}"/>',getCell:function(e,t){return this.body&&this.body.getCell&&this.body.getCell.apply(this.body,arguments)},getClassName:function(){var t=this.host,r=t&&t.constructor.NAME||this.constructor.NAME;return t&&t.getClassName?t.getClassName.apply(t,arguments):e.ClassNameManager.getClassName.apply(e.ClassNameManager,[r].concat(n(arguments,0,!0)))},getRecord:function(){return this.body&&this.body.getRecord&&this.body.getRecord.apply(this.body,arguments)},getRow:function(e){return this.body&&this.body.getRow&&this.body.getRow.apply(this.body,arguments)},_afterSummaryChange:function(e){this._uiSetSummary(e.newVal)},_afterCaptionChange:function(e){this._uiSetCaption(e.newVal)},_afterWidthChange:function(e){this._uiSetWidth(e.newVal)},_bindUI:function(){var t;this._eventHandles||(t=e.bind("_relayAttrChange",this),this._eventHandles=this.after({columnsChange:t,modelListChange:t,summaryChange:e.bind("_afterSummaryChange",this),captionChange:e.bind("_afterCaptionChange",this),widthChange:e.bind("_afterWidthChange",this)}))},_createTable:function(){return e.Node.create(i(this.TABLE_TEMPLATE,{className:this.getClassName("table")})).empty()},_defRenderBodyFn:function(e){e.view.render()},_defRenderFooterFn:function(e){e.view.render()},_defRenderHeaderFn:function(e){e.view.render()},_defRenderTableFn:function(t){var n=this.get("container"),r=this.getAttrs();this.tableNode||(this.tableNode=this._createTable()),r.host=this.get("host")||this,r.table=this,r.container=this.tableNode,this._uiSetCaption(this.get("caption")),this._uiSetSummary(this.get("summary")),this._uiSetWidth(this.get("width"));if(this.head||t.headerView)this.head||(this.head=new t.headerView(e.merge(r,t.headerConfig))),this.fire("renderHeader",{view:this.head});if(this.foot||t.footerView)this.foot||(this.foot=new t.footerView(e.merge(r,t.footerConfig))),this.fire("renderFooter",{view:this.foot});r.columns=this.displayColumns;if(this.body||t.bodyView)this.body||(this.body=new t.bodyView(e.merge(r,t.bodyConfig))),this.fire("renderBody",{view:this.body});n.contains(this.tableNode)||n.append(this.tableNode),this._bindUI()},destructor:function(){this.head&&this.head.destroy&&this.head.destroy(),delete this.head,this.foot&&this.foot.destroy&&this.foot.destroy(),delete this.foot,this.body&&this.body.destroy&&this.body.destroy(),delete this.body,this._eventHandles&&(this._eventHandles.detach(),delete this._eventHandles),this.tableNode&&this.tableNode.remove().destroy(!0)},_extractDisplayColumns:function(){function n(e){var r,i,o;for(r=0,i=e.length;r<i;++r)o=e[r],s(o.children)?n(o.children):t.push(o)}var e=this.get("columns"),t=[];n(e),this.displayColumns=t},_initEvents:function(){this.publish({renderTable:{defaultFn:e.bind("_defRenderTableFn",this)},renderHeader:{defaultFn:e.bind("_defRenderHeaderFn",this)},renderBody:{defaultFn:e.bind("_defRenderBodyFn",this)},renderFooter:{defaultFn:e.bind("_defRenderFooterFn",this)}})},initializer:function(e){this.host=e.host,this._initEvents(),this._extractDisplayColumns(),this.after("columnsChange",this._extractDisplayColumns,this)},_relayAttrChange:function(e){var t=e.attrName,n=e.newVal;this.head&&this.head.set(t,n),this.foot&&this.foot.set(t,n),this.body&&(t==="columns"&&(n=this.displayColumns),this.body.set(t,n))},render:function(){return this.get("container")&&this.fire("renderTable",{headerView:this.get("headerView"),headerConfig:this.get("headerConfig"),bodyView:this.get("bodyView"),bodyConfig:this.get("bodyConfig"),footerView:this.get("footerView"),footerConfig:this.get("footerConfig")}),this},_uiSetCaption:function(t){var n=this.tableNode,r=this.captionNode;t?(r||(this.captionNode=r=e.Node.create(i(this.CAPTION_TEMPLATE,{className:this.getClassName("caption")})),n.prepend(this.captionNode)),r.setHTML(t)):r&&(r.remove(!0),delete this.captionNode)},_uiSetSummary:function(e){e?this.tableNode.setAttribute("summary",e):this.tableNode.removeAttribute("summary")},_uiSetWidth:function(e){var t=this.tableNode;t.setStyle("width",e?this.get("container").get("offsetWidth")-(parseInt(t.getComputedStyle("borderLeftWidth"),10)|0)-(parseInt(t.getComputedStyle("borderLeftWidth"),10)|0)+"px":""),t.setStyle("width",e)},_validateView:function(e){return o(e)&&e.prototype.render}},{ATTRS:{columns:{validator:s},width:{value:"",validator:r.isString},headerView:{value:e.DataTable.HeaderView,validator:"_validateView"},footerView:{validator:"_validateView"},bodyView:{value:e.DataTable.BodyView,validator:"_validateView"}}})},"3.7.2",{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]});+YUI.add("datatable-table",function(e,t){var n=e.Array,r=e.Lang,i=r.sub,s=r.isArray,o=r.isFunction;e.namespace("DataTable").TableView=e.Base.create("table",e.View,[],{CAPTION_TEMPLATE:'<caption class="{className}"/>',TABLE_TEMPLATE:'<table cellspacing="0" class="{className}"/>',getCell:function(e,t){return this.body&&this.body.getCell&&this.body.getCell.apply(this.body,arguments)},getClassName:function(){var t=this.host,r=t&&t.constructor.NAME||this.constructor.NAME;return t&&t.getClassName?t.getClassName.apply(t,arguments):e.ClassNameManager.getClassName.apply(e.ClassNameManager,[r].concat(n(arguments,0,!0)))},getRecord:function(){return this.body&&this.body.getRecord&&this.body.getRecord.apply(this.body,arguments)},getRow:function(e){return this.body&&this.body.getRow&&this.body.getRow.apply(this.body,arguments)},_afterSummaryChange:function(e){this._uiSetSummary(e.newVal)},_afterCaptionChange:function(e){this._uiSetCaption(e.newVal)},_afterWidthChange:function(e){this._uiSetWidth(e.newVal)},_bindUI:function(){var t;this._eventHandles||(t=e.bind("_relayAttrChange",this),this._eventHandles=this.after({columnsChange:t,modelListChange:t,summaryChange:e.bind("_afterSummaryChange",this),captionChange:e.bind("_afterCaptionChange",this),widthChange:e.bind("_afterWidthChange",this)}))},_createTable:function(){return e.Node.create(i(this.TABLE_TEMPLATE,{className:this.getClassName("table")})).empty()},_defRenderBodyFn:function(e){e.view.render()},_defRenderFooterFn:function(e){e.view.render()},_defRenderHeaderFn:function(e){e.view.render()},_defRenderTableFn:function(t){var n=this.get("container"),r=this.getAttrs();this.tableNode||(this.tableNode=this._createTable()),r.host=this.get("host")||this,r.table=this,r.container=this.tableNode,this._uiSetCaption(this.get("caption")),this._uiSetSummary(this.get("summary")),this._uiSetWidth(this.get("width"));if(this.head||t.headerView)this.head||(this.head=new t.headerView(e.merge(r,t.headerConfig))),this.fire("renderHeader",{view:this.head});if(this.foot||t.footerView)this.foot||(this.foot=new t.footerView(e.merge(r,t.footerConfig))),this.fire("renderFooter",{view:this.foot});r.columns=this.displayColumns;if(this.body||t.bodyView)this.body||(this.body=new t.bodyView(e.merge(r,t.bodyConfig))),this.fire("renderBody",{view:this.body});n.contains(this.tableNode)||n.append(this.tableNode),this._bindUI()},destructor:function(){this.head&&this.head.destroy&&this.head.destroy(),delete this.head,this.foot&&this.foot.destroy&&this.foot.destroy(),delete this.foot,this.body&&this.body.destroy&&this.body.destroy(),delete this.body,this._eventHandles&&(this._eventHandles.detach(),delete this._eventHandles),this.tableNode&&this.tableNode.remove().destroy(!0)},_extractDisplayColumns:function(){function n(e){var r,i,o;for(r=0,i=e.length;r<i;++r)o=e[r],s(o.children)?n(o.children):t.push(o)}var e=this.get("columns"),t=[];n(e),this.displayColumns=t},_initEvents:function(){this.publish({renderTable:{defaultFn:e.bind("_defRenderTableFn",this)},renderHeader:{defaultFn:e.bind("_defRenderHeaderFn",this)},renderBody:{defaultFn:e.bind("_defRenderBodyFn",this)},renderFooter:{defaultFn:e.bind("_defRenderFooterFn",this)}})},initializer:function(e){this.host=e.host,this._initEvents(),this._extractDisplayColumns(),this.after("columnsChange",this._extractDisplayColumns,this)},_relayAttrChange:function(e){var t=e.attrName,n=e.newVal;this.head&&this.head.set(t,n),this.foot&&this.foot.set(t,n),this.body&&(t==="columns"&&(n=this.displayColumns),this.body.set(t,n))},render:function(){return this.get("container")&&this.fire("renderTable",{headerView:this.get("headerView"),headerConfig:this.get("headerConfig"),bodyView:this.get("bodyView"),bodyConfig:this.get("bodyConfig"),footerView:this.get("footerView"),footerConfig:this.get("footerConfig")}),this},_uiSetCaption:function(t){var n=this.tableNode,r=this.captionNode;t?(r||(this.captionNode=r=e.Node.create(i(this.CAPTION_TEMPLATE,{className:this.getClassName("caption")})),n.prepend(this.captionNode)),r.setHTML(t)):r&&(r.remove(!0),delete this.captionNode)},_uiSetSummary:function(e){e?this.tableNode.setAttribute("summary",e):this.tableNode.removeAttribute("summary")},_uiSetWidth:function(e){var t=this.tableNode;t.setStyle("width",e?this.get("container").get("offsetWidth")-(parseInt(t.getComputedStyle("borderLeftWidth"),10)|0)-(parseInt(t.getComputedStyle("borderLeftWidth"),10)|0)+"px":""),t.setStyle("width",e)},_validateView:function(e){return o(e)&&e.prototype.render}},{ATTRS:{columns:{validator:s},width:{value:"",validator:r.isString},headerView:{value:e.DataTable.HeaderView,validator:"_validateView"},footerView:{validator:"_validateView"},bodyView:{value:e.DataTable.BodyView,validator:"_validateView"}}})},"3.7.3",{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]});
bundle/datatable-table/datatable-table.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -757,4 +757,4 @@ -}, '3.7.2', {"requires": ["datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager"]});+}, '3.7.3', {"requires": ["datatable-core", "datatable-head", "datatable-body", "view", "classnamemanager"]});
bundle/datatype-date-format/datatype-date-format-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatype-date-format/datatype-date-format.js", code: [] };-_yuitest_coverage["build/datatype-date-format/datatype-date-format.js"].code=["YUI.add('datatype-date-format', function (Y, NAME) {","","/**"," * The `datatype` module is an alias for three utilities, Y.Date, "," * Y.Number and Y.XML, that provide type-conversion and string-formatting"," * convenience methods for various JavaScript object types."," *"," * @module datatype"," * @main datatype"," */","","/**"," * The Date Utility provides type-conversion and string-formatting"," * convenience methods for Dates."," *"," * @module datatype-date"," * @main datatype-date"," */","","/**"," * Date module."," *"," * @module datatype-date"," */","","/**"," * Format date module implements strftime formatters for javascript based on the"," * Open Group specification defined at"," * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html"," * This implementation does not include modified conversion specifiers (i.e., Ex and Ox)"," *"," * @module datatype-date"," * @submodule datatype-date-format"," */","","/**"," * Date provides a set of utility functions to operate against Date objects."," *"," * @class Date"," * @static"," */","","/**"," * Pad a number with leading spaces, zeroes or something else"," * @method xPad"," * @param x {Number} The number to be padded"," * @param pad {String} The character to pad the number with"," * @param r {Number} (optional) The base of the pad, eg, 10 implies to two digits, 100 implies to 3 digits."," * @private"," */","var xPad=function (x, pad, r)","{"," if(typeof r === \"undefined\")"," {"," r=10;"," }"," pad = pad + \"\"; "," for( ; parseInt(x, 10)<r && r>1; r/=10) {"," x = pad + x;"," }"," return x.toString();","};","","var Dt = {"," formats: {"," a: function (d, l) { return l.a[d.getDay()]; },"," A: function (d, l) { return l.A[d.getDay()]; },"," b: function (d, l) { return l.b[d.getMonth()]; },"," B: function (d, l) { return l.B[d.getMonth()]; },"," C: function (d) { return xPad(parseInt(d.getFullYear()/100, 10), 0); },"," d: [\"getDate\", \"0\"],"," e: [\"getDate\", \" \"],"," g: function (d) { return xPad(parseInt(Dt.formats.G(d)%100, 10), 0); },"," G: function (d) {"," var y = d.getFullYear();"," var V = parseInt(Dt.formats.V(d), 10);"," var W = parseInt(Dt.formats.W(d), 10);"," "," if(W > V) {"," y++;"," } else if(W===0 && V>=52) {"," y--;"," }"," "," return y;"," },"," H: [\"getHours\", \"0\"],"," I: function (d) { var I=d.getHours()%12; return xPad(I===0?12:I, 0); },"," j: function (d) {"," var gmd_1 = new Date(\"\" + d.getFullYear() + \"/1/1 GMT\");"," var gmdate = new Date(\"\" + d.getFullYear() + \"/\" + (d.getMonth()+1) + \"/\" + d.getDate() + \" GMT\");"," var ms = gmdate - gmd_1;"," var doy = parseInt(ms/60000/60/24, 10)+1;"," return xPad(doy, 0, 100);"," },"," k: [\"getHours\", \" \"],"," l: function (d) { var I=d.getHours()%12; return xPad(I===0?12:I, \" \"); },"," m: function (d) { return xPad(d.getMonth()+1, 0); },"," M: [\"getMinutes\", \"0\"],"," p: function (d, l) { return l.p[d.getHours() >= 12 ? 1 : 0 ]; },"," P: function (d, l) { return l.P[d.getHours() >= 12 ? 1 : 0 ]; },"," s: function (d, l) { return parseInt(d.getTime()/1000, 10); },"," S: [\"getSeconds\", \"0\"],"," u: function (d) { var dow = d.getDay(); return dow===0?7:dow; },"," U: function (d) {"," var doy = parseInt(Dt.formats.j(d), 10);"," var rdow = 6-d.getDay();"," var woy = parseInt((doy+rdow)/7, 10);"," return xPad(woy, 0);"," },"," V: function (d) {"," var woy = parseInt(Dt.formats.W(d), 10);"," var dow1_1 = (new Date(\"\" + d.getFullYear() + \"/1/1\")).getDay();"," // First week is 01 and not 00 as in the case of %U and %W,"," // so we add 1 to the final result except if day 1 of the year"," // is a Monday (then %W returns 01)."," // We also need to subtract 1 if the day 1 of the year is "," // Friday-Sunday, so the resulting equation becomes:"," var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1);"," if(idow === 53 && (new Date(\"\" + d.getFullYear() + \"/12/31\")).getDay() < 4)"," {"," idow = 1;"," }"," else if(idow === 0)"," {"," idow = Dt.formats.V(new Date(\"\" + (d.getFullYear()-1) + \"/12/31\"));"," }"," "," return xPad(idow, 0);"," },"," w: \"getDay\","," W: function (d) {"," var doy = parseInt(Dt.formats.j(d), 10);"," var rdow = 7-Dt.formats.u(d);"," var woy = parseInt((doy+rdow)/7, 10);"," return xPad(woy, 0, 10);"," },"," y: function (d) { return xPad(d.getFullYear()%100, 0); },"," Y: \"getFullYear\","," z: function (d) {"," var o = d.getTimezoneOffset();"," var H = xPad(parseInt(Math.abs(o/60), 10), 0);"," var M = xPad(Math.abs(o%60), 0);"," return (o>0?\"-\":\"+\") + H + M;"," },"," Z: function (d) {"," var tz = d.toString().replace(/^.*:\\d\\d( GMT[+-]\\d+)? \\(?([A-Za-z ]+)\\)?\\d*$/, \"$2\").replace(/[a-z ]/g, \"\");"," if(tz.length > 4) {"," tz = Dt.formats.z(d);"," }"," return tz;"," },"," \"%\": function (d) { return \"%\"; }"," },",""," aggregates: {"," c: \"locale\","," D: \"%m/%d/%y\","," F: \"%Y-%m-%d\","," h: \"%b\","," n: \"\\n\","," r: \"%I:%M:%S %p\","," R: \"%H:%M\","," t: \"\\t\","," T: \"%H:%M:%S\","," x: \"locale\","," X: \"locale\""," //\"+\": \"%a %b %e %T %Z %Y\""," },",""," /**"," * Takes a native JavaScript Date and formats it as a string for display to user."," *"," * @for Date"," * @method format"," * @param oDate {Date} Date."," * @param oConfig {Object} (Optional) Object literal of configuration values:"," * <dl>"," * <dt>format {HTML} (Optional)</dt>"," * <dd>"," * <p>"," * Any strftime string is supported, such as \"%I:%M:%S %p\". strftime has several format specifiers defined by the Open group at "," * <a href=\"http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html\">http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html</a>"," * PHP added a few of its own, defined at <a href=\"http://www.php.net/strftime\">http://www.php.net/strftime</a>"," * </p>"," * <p>"," * This javascript implementation supports all the PHP specifiers and a few more. The full list is below."," * </p>"," * <p>"," * If not specified, it defaults to the ISO 8601 standard date format: %Y-%m-%d."," * </p>"," * <dl>"," * <dt>%a</dt> <dd>abbreviated weekday name according to the current locale</dd>"," * <dt>%A</dt> <dd>full weekday name according to the current locale</dd>"," * <dt>%b</dt> <dd>abbreviated month name according to the current locale</dd>"," * <dt>%B</dt> <dd>full month name according to the current locale</dd>"," * <dt>%c</dt> <dd>preferred date and time representation for the current locale</dd>"," * <dt>%C</dt> <dd>century number (the year divided by 100 and truncated to an integer, range 00 to 99)</dd>"," * <dt>%d</dt> <dd>day of the month as a decimal number (range 01 to 31)</dd>"," * <dt>%D</dt> <dd>same as %m/%d/%y</dd>"," * <dt>%e</dt> <dd>day of the month as a decimal number, a single digit is preceded by a space (range \" 1\" to \"31\")</dd>"," * <dt>%F</dt> <dd>same as %Y-%m-%d (ISO 8601 date format)</dd>"," * <dt>%g</dt> <dd>like %G, but without the century</dd>"," * <dt>%G</dt> <dd>The 4-digit year corresponding to the ISO week number</dd>"," * <dt>%h</dt> <dd>same as %b</dd>"," * <dt>%H</dt> <dd>hour as a decimal number using a 24-hour clock (range 00 to 23)</dd>"," * <dt>%I</dt> <dd>hour as a decimal number using a 12-hour clock (range 01 to 12)</dd>"," * <dt>%j</dt> <dd>day of the year as a decimal number (range 001 to 366)</dd>"," * <dt>%k</dt> <dd>hour as a decimal number using a 24-hour clock (range 0 to 23); single digits are preceded by a blank. (See also %H.)</dd>"," * <dt>%l</dt> <dd>hour as a decimal number using a 12-hour clock (range 1 to 12); single digits are preceded by a blank. (See also %I.) </dd>"," * <dt>%m</dt> <dd>month as a decimal number (range 01 to 12)</dd>"," * <dt>%M</dt> <dd>minute as a decimal number</dd>"," * <dt>%n</dt> <dd>newline character</dd>"," * <dt>%p</dt> <dd>either \"AM\" or \"PM\" according to the given time value, or the corresponding strings for the current locale</dd>"," * <dt>%P</dt> <dd>like %p, but lower case</dd>"," * <dt>%r</dt> <dd>time in a.m. and p.m. notation equal to %I:%M:%S %p</dd>"," * <dt>%R</dt> <dd>time in 24 hour notation equal to %H:%M</dd>"," * <dt>%s</dt> <dd>number of seconds since the Epoch, ie, since 1970-01-01 00:00:00 UTC</dd>"," * <dt>%S</dt> <dd>second as a decimal number</dd>"," * <dt>%t</dt> <dd>tab character</dd>"," * <dt>%T</dt> <dd>current time, equal to %H:%M:%S</dd>"," * <dt>%u</dt> <dd>weekday as a decimal number [1,7], with 1 representing Monday</dd>"," * <dt>%U</dt> <dd>week number of the current year as a decimal number, starting with the"," * first Sunday as the first day of the first week</dd>"," * <dt>%V</dt> <dd>The ISO 8601:1988 week number of the current year as a decimal number,"," * range 01 to 53, where week 1 is the first week that has at least 4 days"," * in the current year, and with Monday as the first day of the week.</dd>"," * <dt>%w</dt> <dd>day of the week as a decimal, Sunday being 0</dd>"," * <dt>%W</dt> <dd>week number of the current year as a decimal number, starting with the"," * first Monday as the first day of the first week</dd>"," * <dt>%x</dt> <dd>preferred date representation for the current locale without the time</dd>"," * <dt>%X</dt> <dd>preferred time representation for the current locale without the date</dd>"," * <dt>%y</dt> <dd>year as a decimal number without a century (range 00 to 99)</dd>"," * <dt>%Y</dt> <dd>year as a decimal number including the century</dd>"," * <dt>%z</dt> <dd>numerical time zone representation</dd>"," * <dt>%Z</dt> <dd>time zone name or abbreviation</dd>"," * <dt>%%</dt> <dd>a literal \"%\" character</dd>"," * </dl>"," * </dd>"," * </dl>"," * @return {HTML} Formatted date for display."," */"," format : function (oDate, oConfig) {"," oConfig = oConfig || {};"," "," if(!Y.Lang.isDate(oDate)) {"," return Y.Lang.isValue(oDate) ? oDate : \"\";"," }",""," var format, resources, compatMode, sLocale, LOCALE;",""," format = oConfig.format || \"%Y-%m-%d\";",""," resources = Y.Intl.get('datatype-date-format');",""," var replace_aggs = function (m0, m1) {"," if (compatMode && m1 === \"r\") {"," return resources[m1];"," }"," var f = Dt.aggregates[m1];"," return (f === \"locale\" ? resources[m1] : f);"," };",""," var replace_formats = function (m0, m1) {"," var f = Dt.formats[m1];"," switch(Y.Lang.type(f)) {"," case \"string\": // string => built in date function"," return oDate[f]();"," case \"function\": // function => our own function"," return f.call(oDate, oDate, resources);"," case \"array\": // built in function with padding"," if(Y.Lang.type(f[0]) === \"string\") {"," return xPad(oDate[f[0]](), f[1]);"," } // no break; (fall through to default:)"," default:"," return m1;"," }"," };",""," // First replace aggregates (run in a loop because an agg may be made up of other aggs)"," while(format.match(/%[cDFhnrRtTxX]/)) {"," format = format.replace(/%([cDFhnrRtTxX])/g, replace_aggs);"," }",""," // Now replace formats (do not run in a loop otherwise %%a will be replace with the value of %a)"," var str = format.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g, replace_formats);",""," replace_aggs = replace_formats = undefined;",""," return str;"," }","};","","Y.mix(Y.namespace(\"Date\"), Dt);","","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.7.2', {\"lang\": [\"ar\", \"ar-JO\", \"ca\", \"ca-ES\", \"da\", \"da-DK\", \"de\", \"de-AT\", \"de-DE\", \"el\", \"el-GR\", \"en\", \"en-AU\", \"en-CA\", \"en-GB\", \"en-IE\", \"en-IN\", \"en-JO\", \"en-MY\", \"en-NZ\", \"en-PH\", \"en-SG\", \"en-US\", \"es\", \"es-AR\", \"es-BO\", \"es-CL\", \"es-CO\", \"es-EC\", \"es-ES\", \"es-MX\", \"es-PE\", \"es-PY\", \"es-US\", \"es-UY\", \"es-VE\", \"fi\", \"fi-FI\", \"fr\", \"fr-BE\", \"fr-CA\", \"fr-FR\", \"hi\", \"hi-IN\", \"id\", \"id-ID\", \"it\", \"it-IT\", \"ja\", \"ja-JP\", \"ko\", \"ko-KR\", \"ms\", \"ms-MY\", \"nb\", \"nb-NO\", \"nl\", \"nl-BE\", \"nl-NL\", \"pl\", \"pl-PL\", \"pt\", \"pt-BR\", \"ro\", \"ro-RO\", \"ru\", \"ru-RU\", \"sv\", \"sv-SE\", \"th\", \"th-TH\", \"tr\", \"tr-TR\", \"vi\", \"vi-VN\", \"zh-Hans\", \"zh-Hans-CN\", \"zh-Hant\", \"zh-Hant-HK\", \"zh-Hant-TW\"]});"];+_yuitest_coverage["build/datatype-date-format/datatype-date-format.js"].code=["YUI.add('datatype-date-format', function (Y, NAME) {","","/**"," * The `datatype` module is an alias for three utilities, Y.Date, "," * Y.Number and Y.XML, that provide type-conversion and string-formatting"," * convenience methods for various JavaScript object types."," *"," * @module datatype"," * @main datatype"," */","","/**"," * The Date Utility provides type-conversion and string-formatting"," * convenience methods for Dates."," *"," * @module datatype-date"," * @main datatype-date"," */","","/**"," * Date module."," *"," * @module datatype-date"," */","","/**"," * Format date module implements strftime formatters for javascript based on the"," * Open Group specification defined at"," * http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html"," * This implementation does not include modified conversion specifiers (i.e., Ex and Ox)"," *"," * @module datatype-date"," * @submodule datatype-date-format"," */","","/**"," * Date provides a set of utility functions to operate against Date objects."," *"," * @class Date"," * @static"," */","","/**"," * Pad a number with leading spaces, zeroes or something else"," * @method xPad"," * @param x {Number} The number to be padded"," * @param pad {String} The character to pad the number with"," * @param r {Number} (optional) The base of the pad, eg, 10 implies to two digits, 100 implies to 3 digits."," * @private"," */","var xPad=function (x, pad, r)","{"," if(typeof r === \"undefined\")"," {"," r=10;"," }"," pad = pad + \"\"; "," for( ; parseInt(x, 10)<r && r>1; r/=10) {"," x = pad + x;"," }"," return x.toString();","};","","var Dt = {"," formats: {"," a: function (d, l) { return l.a[d.getDay()]; },"," A: function (d, l) { return l.A[d.getDay()]; },"," b: function (d, l) { return l.b[d.getMonth()]; },"," B: function (d, l) { return l.B[d.getMonth()]; },"," C: function (d) { return xPad(parseInt(d.getFullYear()/100, 10), 0); },"," d: [\"getDate\", \"0\"],"," e: [\"getDate\", \" \"],"," g: function (d) { return xPad(parseInt(Dt.formats.G(d)%100, 10), 0); },"," G: function (d) {"," var y = d.getFullYear();"," var V = parseInt(Dt.formats.V(d), 10);"," var W = parseInt(Dt.formats.W(d), 10);"," "," if(W > V) {"," y++;"," } else if(W===0 && V>=52) {"," y--;"," }"," "," return y;"," },"," H: [\"getHours\", \"0\"],"," I: function (d) { var I=d.getHours()%12; return xPad(I===0?12:I, 0); },"," j: function (d) {"," var gmd_1 = new Date(\"\" + d.getFullYear() + \"/1/1 GMT\");"," var gmdate = new Date(\"\" + d.getFullYear() + \"/\" + (d.getMonth()+1) + \"/\" + d.getDate() + \" GMT\");"," var ms = gmdate - gmd_1;"," var doy = parseInt(ms/60000/60/24, 10)+1;"," return xPad(doy, 0, 100);"," },"," k: [\"getHours\", \" \"],"," l: function (d) { var I=d.getHours()%12; return xPad(I===0?12:I, \" \"); },"," m: function (d) { return xPad(d.getMonth()+1, 0); },"," M: [\"getMinutes\", \"0\"],"," p: function (d, l) { return l.p[d.getHours() >= 12 ? 1 : 0 ]; },"," P: function (d, l) { return l.P[d.getHours() >= 12 ? 1 : 0 ]; },"," s: function (d, l) { return parseInt(d.getTime()/1000, 10); },"," S: [\"getSeconds\", \"0\"],"," u: function (d) { var dow = d.getDay(); return dow===0?7:dow; },"," U: function (d) {"," var doy = parseInt(Dt.formats.j(d), 10);"," var rdow = 6-d.getDay();"," var woy = parseInt((doy+rdow)/7, 10);"," return xPad(woy, 0);"," },"," V: function (d) {"," var woy = parseInt(Dt.formats.W(d), 10);"," var dow1_1 = (new Date(\"\" + d.getFullYear() + \"/1/1\")).getDay();"," // First week is 01 and not 00 as in the case of %U and %W,"," // so we add 1 to the final result except if day 1 of the year"," // is a Monday (then %W returns 01)."," // We also need to subtract 1 if the day 1 of the year is "," // Friday-Sunday, so the resulting equation becomes:"," var idow = woy + (dow1_1 > 4 || dow1_1 <= 1 ? 0 : 1);"," if(idow === 53 && (new Date(\"\" + d.getFullYear() + \"/12/31\")).getDay() < 4)"," {"," idow = 1;"," }"," else if(idow === 0)"," {"," idow = Dt.formats.V(new Date(\"\" + (d.getFullYear()-1) + \"/12/31\"));"," }"," "," return xPad(idow, 0);"," },"," w: \"getDay\","," W: function (d) {"," var doy = parseInt(Dt.formats.j(d), 10);"," var rdow = 7-Dt.formats.u(d);"," var woy = parseInt((doy+rdow)/7, 10);"," return xPad(woy, 0, 10);"," },"," y: function (d) { return xPad(d.getFullYear()%100, 0); },"," Y: \"getFullYear\","," z: function (d) {"," var o = d.getTimezoneOffset();"," var H = xPad(parseInt(Math.abs(o/60), 10), 0);"," var M = xPad(Math.abs(o%60), 0);"," return (o>0?\"-\":\"+\") + H + M;"," },"," Z: function (d) {"," var tz = d.toString().replace(/^.*:\\d\\d( GMT[+-]\\d+)? \\(?([A-Za-z ]+)\\)?\\d*$/, \"$2\").replace(/[a-z ]/g, \"\");"," if(tz.length > 4) {"," tz = Dt.formats.z(d);"," }"," return tz;"," },"," \"%\": function (d) { return \"%\"; }"," },",""," aggregates: {"," c: \"locale\","," D: \"%m/%d/%y\","," F: \"%Y-%m-%d\","," h: \"%b\","," n: \"\\n\","," r: \"%I:%M:%S %p\","," R: \"%H:%M\","," t: \"\\t\","," T: \"%H:%M:%S\","," x: \"locale\","," X: \"locale\""," //\"+\": \"%a %b %e %T %Z %Y\""," },",""," /**"," * Takes a native JavaScript Date and formats it as a string for display to user."," *"," * @for Date"," * @method format"," * @param oDate {Date} Date."," * @param oConfig {Object} (Optional) Object literal of configuration values:"," * <dl>"," * <dt>format {HTML} (Optional)</dt>"," * <dd>"," * <p>"," * Any strftime string is supported, such as \"%I:%M:%S %p\". strftime has several format specifiers defined by the Open group at "," * <a href=\"http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html\">http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html</a>"," * PHP added a few of its own, defined at <a href=\"http://www.php.net/strftime\">http://www.php.net/strftime</a>"," * </p>"," * <p>"," * This javascript implementation supports all the PHP specifiers and a few more. The full list is below."," * </p>"," * <p>"," * If not specified, it defaults to the ISO 8601 standard date format: %Y-%m-%d."," * </p>"," * <dl>"," * <dt>%a</dt> <dd>abbreviated weekday name according to the current locale</dd>"," * <dt>%A</dt> <dd>full weekday name according to the current locale</dd>"," * <dt>%b</dt> <dd>abbreviated month name according to the current locale</dd>"," * <dt>%B</dt> <dd>full month name according to the current locale</dd>"," * <dt>%c</dt> <dd>preferred date and time representation for the current locale</dd>"," * <dt>%C</dt> <dd>century number (the year divided by 100 and truncated to an integer, range 00 to 99)</dd>"," * <dt>%d</dt> <dd>day of the month as a decimal number (range 01 to 31)</dd>"," * <dt>%D</dt> <dd>same as %m/%d/%y</dd>"," * <dt>%e</dt> <dd>day of the month as a decimal number, a single digit is preceded by a space (range \" 1\" to \"31\")</dd>"," * <dt>%F</dt> <dd>same as %Y-%m-%d (ISO 8601 date format)</dd>"," * <dt>%g</dt> <dd>like %G, but without the century</dd>"," * <dt>%G</dt> <dd>The 4-digit year corresponding to the ISO week number</dd>"," * <dt>%h</dt> <dd>same as %b</dd>"," * <dt>%H</dt> <dd>hour as a decimal number using a 24-hour clock (range 00 to 23)</dd>"," * <dt>%I</dt> <dd>hour as a decimal number using a 12-hour clock (range 01 to 12)</dd>"," * <dt>%j</dt> <dd>day of the year as a decimal number (range 001 to 366)</dd>"," * <dt>%k</dt> <dd>hour as a decimal number using a 24-hour clock (range 0 to 23); single digits are preceded by a blank. (See also %H.)</dd>"," * <dt>%l</dt> <dd>hour as a decimal number using a 12-hour clock (range 1 to 12); single digits are preceded by a blank. (See also %I.) </dd>"," * <dt>%m</dt> <dd>month as a decimal number (range 01 to 12)</dd>"," * <dt>%M</dt> <dd>minute as a decimal number</dd>"," * <dt>%n</dt> <dd>newline character</dd>"," * <dt>%p</dt> <dd>either \"AM\" or \"PM\" according to the given time value, or the corresponding strings for the current locale</dd>"," * <dt>%P</dt> <dd>like %p, but lower case</dd>"," * <dt>%r</dt> <dd>time in a.m. and p.m. notation equal to %I:%M:%S %p</dd>"," * <dt>%R</dt> <dd>time in 24 hour notation equal to %H:%M</dd>"," * <dt>%s</dt> <dd>number of seconds since the Epoch, ie, since 1970-01-01 00:00:00 UTC</dd>"," * <dt>%S</dt> <dd>second as a decimal number</dd>"," * <dt>%t</dt> <dd>tab character</dd>"," * <dt>%T</dt> <dd>current time, equal to %H:%M:%S</dd>"," * <dt>%u</dt> <dd>weekday as a decimal number [1,7], with 1 representing Monday</dd>"," * <dt>%U</dt> <dd>week number of the current year as a decimal number, starting with the"," * first Sunday as the first day of the first week</dd>"," * <dt>%V</dt> <dd>The ISO 8601:1988 week number of the current year as a decimal number,"," * range 01 to 53, where week 1 is the first week that has at least 4 days"," * in the current year, and with Monday as the first day of the week.</dd>"," * <dt>%w</dt> <dd>day of the week as a decimal, Sunday being 0</dd>"," * <dt>%W</dt> <dd>week number of the current year as a decimal number, starting with the"," * first Monday as the first day of the first week</dd>"," * <dt>%x</dt> <dd>preferred date representation for the current locale without the time</dd>"," * <dt>%X</dt> <dd>preferred time representation for the current locale without the date</dd>"," * <dt>%y</dt> <dd>year as a decimal number without a century (range 00 to 99)</dd>"," * <dt>%Y</dt> <dd>year as a decimal number including the century</dd>"," * <dt>%z</dt> <dd>numerical time zone representation</dd>"," * <dt>%Z</dt> <dd>time zone name or abbreviation</dd>"," * <dt>%%</dt> <dd>a literal \"%\" character</dd>"," * </dl>"," * </dd>"," * </dl>"," * @return {HTML} Formatted date for display."," */"," format : function (oDate, oConfig) {"," oConfig = oConfig || {};"," "," if(!Y.Lang.isDate(oDate)) {"," return Y.Lang.isValue(oDate) ? oDate : \"\";"," }",""," var format, resources, compatMode, sLocale, LOCALE;",""," format = oConfig.format || \"%Y-%m-%d\";",""," resources = Y.Intl.get('datatype-date-format');",""," var replace_aggs = function (m0, m1) {"," if (compatMode && m1 === \"r\") {"," return resources[m1];"," }"," var f = Dt.aggregates[m1];"," return (f === \"locale\" ? resources[m1] : f);"," };",""," var replace_formats = function (m0, m1) {"," var f = Dt.formats[m1];"," switch(Y.Lang.type(f)) {"," case \"string\": // string => built in date function"," return oDate[f]();"," case \"function\": // function => our own function"," return f.call(oDate, oDate, resources);"," case \"array\": // built in function with padding"," if(Y.Lang.type(f[0]) === \"string\") {"," return xPad(oDate[f[0]](), f[1]);"," } // no break; (fall through to default:)"," default:"," return m1;"," }"," };",""," // First replace aggregates (run in a loop because an agg may be made up of other aggs)"," while(format.match(/%[cDFhnrRtTxX]/)) {"," format = format.replace(/%([cDFhnrRtTxX])/g, replace_aggs);"," }",""," // Now replace formats (do not run in a loop otherwise %%a will be replace with the value of %a)"," var str = format.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g, replace_formats);",""," replace_aggs = replace_formats = undefined;",""," return str;"," }","};","","Y.mix(Y.namespace(\"Date\"), Dt);","","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.7.3', {\"lang\": [\"ar\", \"ar-JO\", \"ca\", \"ca-ES\", \"da\", \"da-DK\", \"de\", \"de-AT\", \"de-DE\", \"el\", \"el-GR\", \"en\", \"en-AU\", \"en-CA\", \"en-GB\", \"en-IE\", \"en-IN\", \"en-JO\", \"en-MY\", \"en-NZ\", \"en-PH\", \"en-SG\", \"en-US\", \"es\", \"es-AR\", \"es-BO\", \"es-CL\", \"es-CO\", \"es-EC\", \"es-ES\", \"es-MX\", \"es-PE\", \"es-PY\", \"es-US\", \"es-UY\", \"es-VE\", \"fi\", \"fi-FI\", \"fr\", \"fr-BE\", \"fr-CA\", \"fr-FR\", \"hi\", \"hi-IN\", \"id\", \"id-ID\", \"it\", \"it-IT\", \"ja\", \"ja-JP\", \"ko\", \"ko-KR\", \"ms\", \"ms-MY\", \"nb\", \"nb-NO\", \"nl\", \"nl-BE\", \"nl-NL\", \"pl\", \"pl-PL\", \"pt\", \"pt-BR\", \"ro\", \"ro-RO\", \"ru\", \"ru-RU\", \"sv\", \"sv-SE\", \"th\", \"th-TH\", \"tr\", \"tr-TR\", \"vi\", \"vi-VN\", \"zh-Hans\", \"zh-Hans-CN\", \"zh-Hant\", \"zh-Hant-HK\", \"zh-Hant-TW\"]});"]; _yuitest_coverage["build/datatype-date-format/datatype-date-format.js"].lines = {"1":0,"51":0,"53":0,"55":0,"57":0,"58":0,"59":0,"61":0,"64":0,"66":0,"67":0,"68":0,"69":0,"70":0,"73":0,"75":0,"76":0,"77":0,"79":0,"80":0,"81":0,"82":0,"85":0,"88":0,"90":0,"91":0,"92":0,"93":0,"94":0,"97":0,"98":0,"100":0,"101":0,"102":0,"104":0,"106":0,"107":0,"108":0,"109":0,"112":0,"113":0,"119":0,"120":0,"122":0,"124":0,"126":0,"129":0,"133":0,"134":0,"135":0,"136":0,"138":0,"141":0,"142":0,"143":0,"144":0,"147":0,"148":0,"149":0,"151":0,"153":0,"244":0,"246":0,"247":0,"250":0,"252":0,"254":0,"256":0,"257":0,"258":0,"260":0,"261":0,"264":0,"265":0,"266":0,"268":0,"270":0,"272":0,"273":0,"276":0,"281":0,"282":0,"286":0,"288":0,"290":0,"294":0,"297":0,"298":0}; _yuitest_coverage["build/datatype-date-format/datatype-date-format.js"].functions = {"xPad:51":0,"a:66":0,"A:67":0,"b:68":0,"B:69":0,"C:70":0,"g:73":0,"G:74":0,"I:88":0,"j:89":0,"l:97":0,"m:98":0,"p:100":0,"P:101":0,"s:102":0,"u:104":0,"U:105":0,"V:111":0,"W:132":0,"y:138":0,"z:140":0,"Z:146":0,"\"%\":153":0,"replace_aggs:256":0,"replace_formats:264":0,"format:243":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatype-date-format/datatype-date-format.js"].coveredLines = 88;@@ -452,4 +452,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2', {"lang": ["ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW"]});+}, '3.7.3', {"lang": ["ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW"]});
bundle/datatype-date-format/datatype-date-format-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -306,4 +306,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2', {"lang": ["ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW"]});+}, '3.7.3', {"lang": ["ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW"]});
bundle/datatype-date-format/datatype-date-format-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-date-format",function(e,t){var n=function(e,t,n){typeof n=="undefined"&&(n=10),t+="";for(;parseInt(e,10)<n&&n>1;n/=10)e=t+e;return e.toString()},r={formats:{a:function(e,t){return t.a[e.getDay()]},A:function(e,t){return t.A[e.getDay()]},b:function(e,t){return t.b[e.getMonth()]},B:function(e,t){return t.B[e.getMonth()]},C:function(e){return n(parseInt(e.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(e){return n(parseInt(r.formats.G(e)%100,10),0)},G:function(e){var t=e.getFullYear(),n=parseInt(r.formats.V(e),10),i=parseInt(r.formats.W(e),10);return i>n?t++:i===0&&n>=52&&t--,t},H:["getHours","0"],I:function(e){var t=e.getHours()%12;return n(t===0?12:t,0)},j:function(e){var t=new Date(""+e.getFullYear()+"/1/1 GMT"),r=new Date(""+e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate()+" GMT"),i=r-t,s=parseInt(i/6e4/60/24,10)+1;return n(s,0,100)},k:["getHours"," "],l:function(e){var t=e.getHours()%12;return n(t===0?12:t," ")},m:function(e){return n(e.getMonth()+1,0)},M:["getMinutes","0"],p:function(e,t){return t.p[e.getHours()>=12?1:0]},P:function(e,t){return t.P[e.getHours()>=12?1:0]},s:function(e,t){return parseInt(e.getTime()/1e3,10)},S:["getSeconds","0"],u:function(e){var t=e.getDay();return t===0?7:t},U:function(e){var t=parseInt(r.formats.j(e),10),i=6-e.getDay(),s=parseInt((t+i)/7,10);return n(s,0)},V:function(e){var t=parseInt(r.formats.W(e),10),i=(new Date(""+e.getFullYear()+"/1/1")).getDay(),s=t+(i>4||i<=1?0:1);return s===53&&(new Date(""+e.getFullYear()+"/12/31")).getDay()<4?s=1:s===0&&(s=r.formats.V(new Date(""+(e.getFullYear()-1)+"/12/31"))),n(s,0)},w:"getDay",W:function(e){var t=parseInt(r.formats.j(e),10),i=7-r.formats.u(e),s=parseInt((t+i)/7,10);return n(s,0,10)},y:function(e){return n(e.getFullYear()%100,0)},Y:"getFullYear",z:function(e){var t=e.getTimezoneOffset(),r=n(parseInt(Math.abs(t/60),10),0),i=n(Math.abs(t%60),0);return(t>0?"-":"+")+r+i},Z:function(e){var t=e.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");return t.length>4&&(t=r.formats.z(e)),t},"%":function(e){return"%"}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:" ",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(t,i){i=i||{};if(!e.Lang.isDate(t))return e.Lang.isValue(t)?t:"";var s,o,u,a,f;s=i.format||"%Y-%m-%d",o=e.Intl.get("datatype-date-format");var l=function(e,t){if(u&&t==="r")return o[t];var n=r.aggregates[t];return n==="locale"?o[t]:n},c=function(i,s){var u=r.formats[s];switch(e.Lang.type(u)){case"string":return t[u]();case"function":return u.call(t,t,o);case"array":if(e.Lang.type(u[0])==="string")return n(t[u[0]](),u[1]);default:return s}};while(s.match(/%[cDFhnrRtTxX]/))s=s.replace(/%([cDFhnrRtTxX])/g,l);var h=s.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,c);return l=c=undefined,h}};e.mix(e.namespace("Date"),r),e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.2",{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]});+YUI.add("datatype-date-format",function(e,t){var n=function(e,t,n){typeof n=="undefined"&&(n=10),t+="";for(;parseInt(e,10)<n&&n>1;n/=10)e=t+e;return e.toString()},r={formats:{a:function(e,t){return t.a[e.getDay()]},A:function(e,t){return t.A[e.getDay()]},b:function(e,t){return t.b[e.getMonth()]},B:function(e,t){return t.B[e.getMonth()]},C:function(e){return n(parseInt(e.getFullYear()/100,10),0)},d:["getDate","0"],e:["getDate"," "],g:function(e){return n(parseInt(r.formats.G(e)%100,10),0)},G:function(e){var t=e.getFullYear(),n=parseInt(r.formats.V(e),10),i=parseInt(r.formats.W(e),10);return i>n?t++:i===0&&n>=52&&t--,t},H:["getHours","0"],I:function(e){var t=e.getHours()%12;return n(t===0?12:t,0)},j:function(e){var t=new Date(""+e.getFullYear()+"/1/1 GMT"),r=new Date(""+e.getFullYear()+"/"+(e.getMonth()+1)+"/"+e.getDate()+" GMT"),i=r-t,s=parseInt(i/6e4/60/24,10)+1;return n(s,0,100)},k:["getHours"," "],l:function(e){var t=e.getHours()%12;return n(t===0?12:t," ")},m:function(e){return n(e.getMonth()+1,0)},M:["getMinutes","0"],p:function(e,t){return t.p[e.getHours()>=12?1:0]},P:function(e,t){return t.P[e.getHours()>=12?1:0]},s:function(e,t){return parseInt(e.getTime()/1e3,10)},S:["getSeconds","0"],u:function(e){var t=e.getDay();return t===0?7:t},U:function(e){var t=parseInt(r.formats.j(e),10),i=6-e.getDay(),s=parseInt((t+i)/7,10);return n(s,0)},V:function(e){var t=parseInt(r.formats.W(e),10),i=(new Date(""+e.getFullYear()+"/1/1")).getDay(),s=t+(i>4||i<=1?0:1);return s===53&&(new Date(""+e.getFullYear()+"/12/31")).getDay()<4?s=1:s===0&&(s=r.formats.V(new Date(""+(e.getFullYear()-1)+"/12/31"))),n(s,0)},w:"getDay",W:function(e){var t=parseInt(r.formats.j(e),10),i=7-r.formats.u(e),s=parseInt((t+i)/7,10);return n(s,0,10)},y:function(e){return n(e.getFullYear()%100,0)},Y:"getFullYear",z:function(e){var t=e.getTimezoneOffset(),r=n(parseInt(Math.abs(t/60),10),0),i=n(Math.abs(t%60),0);return(t>0?"-":"+")+r+i},Z:function(e){var t=e.toString().replace(/^.*:\d\d( GMT[+-]\d+)? \(?([A-Za-z ]+)\)?\d*$/,"$2").replace(/[a-z ]/g,"");return t.length>4&&(t=r.formats.z(e)),t},"%":function(e){return"%"}},aggregates:{c:"locale",D:"%m/%d/%y",F:"%Y-%m-%d",h:"%b",n:"\n",r:"%I:%M:%S %p",R:"%H:%M",t:" ",T:"%H:%M:%S",x:"locale",X:"locale"},format:function(t,i){i=i||{};if(!e.Lang.isDate(t))return e.Lang.isValue(t)?t:"";var s,o,u,a,f;s=i.format||"%Y-%m-%d",o=e.Intl.get("datatype-date-format");var l=function(e,t){if(u&&t==="r")return o[t];var n=r.aggregates[t];return n==="locale"?o[t]:n},c=function(i,s){var u=r.formats[s];switch(e.Lang.type(u)){case"string":return t[u]();case"function":return u.call(t,t,o);case"array":if(e.Lang.type(u[0])==="string")return n(t[u[0]](),u[1]);default:return s}};while(s.match(/%[cDFhnrRtTxX]/))s=s.replace(/%([cDFhnrRtTxX])/g,l);var h=s.replace(/%([aAbBCdegGHIjklmMpPsSuUVwWyYzZ%])/g,c);return l=c=undefined,h}};e.mix(e.namespace("Date"),r),e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.3",{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]});
bundle/datatype-date-format/datatype-date-format.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -304,4 +304,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2', {"lang": ["ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW"]});+}, '3.7.3', {"lang": ["ar", "ar-JO", "ca", "ca-ES", "da", "da-DK", "de", "de-AT", "de-DE", "el", "el-GR", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-JO", "en-MY", "en-NZ", "en-PH", "en-SG", "en-US", "es", "es-AR", "es-BO", "es-CL", "es-CO", "es-EC", "es-ES", "es-MX", "es-PE", "es-PY", "es-US", "es-UY", "es-VE", "fi", "fi-FI", "fr", "fr-BE", "fr-CA", "fr-FR", "hi", "hi-IN", "id", "id-ID", "it", "it-IT", "ja", "ja-JP", "ko", "ko-KR", "ms", "ms-MY", "nb", "nb-NO", "nl", "nl-BE", "nl-NL", "pl", "pl-PL", "pt", "pt-BR", "ro", "ro-RO", "ru", "ru-RU", "sv", "sv-SE", "th", "th-TH", "tr", "tr-TR", "vi", "vi-VN", "zh-Hans", "zh-Hans-CN", "zh-Hant", "zh-Hant-HK", "zh-Hant-TW"]});
bundle/datatype-date-format/lang/datatype-date-format.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format",function(e){e.Intl.add("datatype-date-format","",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%Y-%m-%dT%H:%M:%S%z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format",function(e){e.Intl.add("datatype-date-format","",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%Y-%m-%dT%H:%M:%S%z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ar-JO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ar-JO",function(e){e.Intl.add("datatype-date-format","ar-JO",{a:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],A:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0625\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],b:["\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0634\u0628\u0627\u0637","\u0622\u0630\u0627\u0631","\u0646\u064a\u0633\u0627\u0646","\u0623\u064a\u0627\u0631","\u062d\u0632\u064a\u0631\u0627\u0646","\u062a\u0645\u0648\u0632","\u0622\u0628","\u0623\u064a\u0644\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"],B:["\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0634\u0628\u0627\u0637","\u0622\u0630\u0627\u0631","\u0646\u064a\u0633\u0627\u0646","\u0623\u064a\u0627\u0631","\u062d\u0632\u064a\u0631\u0627\u0646","\u062a\u0645\u0648\u0632","\u0622\u0628","\u0623\u064a\u0644\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"],c:"%a\u060c %d %B %Y %Z %l:%M:%S %p",p:["\u0635","\u0645"],P:["\u0635","\u0645"],x:"%d\u200f/%m\u200f/%Y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_ar-JO",function(e){e.Intl.add("datatype-date-format","ar-JO",{a:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0627\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],A:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0625\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],b:["\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0634\u0628\u0627\u0637","\u0622\u0630\u0627\u0631","\u0646\u064a\u0633\u0627\u0646","\u0623\u064a\u0627\u0631","\u062d\u0632\u064a\u0631\u0627\u0646","\u062a\u0645\u0648\u0632","\u0622\u0628","\u0623\u064a\u0644\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"],B:["\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0634\u0628\u0627\u0637","\u0622\u0630\u0627\u0631","\u0646\u064a\u0633\u0627\u0646","\u0623\u064a\u0627\u0631","\u062d\u0632\u064a\u0631\u0627\u0646","\u062a\u0645\u0648\u0632","\u0622\u0628","\u0623\u064a\u0644\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u0623\u0648\u0644","\u062a\u0634\u0631\u064a\u0646 \u0627\u0644\u062b\u0627\u0646\u064a","\u0643\u0627\u0646\u0648\u0646 \u0627\u0644\u0623\u0648\u0644"],c:"%a\u060c %d %B %Y %Z %l:%M:%S %p",p:["\u0635","\u0645"],P:["\u0635","\u0645"],x:"%d\u200f/%m\u200f/%Y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ar.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ar",function(e){e.Intl.add("datatype-date-format","ar",{a:["\u0623\u062d\u062f","\u0625\u062b\u0646\u064a\u0646","\u062b\u0644\u0627\u062b\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639\u0629","\u0633\u0628\u062a"],A:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0625\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],b:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],B:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],c:"%a\u060c %d %B %Y %Z %l:%M:%S %p",p:["\u0635","\u0645"],P:["\u0635","\u0645"],x:"%d\u200f/%m\u200f/%Y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_ar",function(e){e.Intl.add("datatype-date-format","ar",{a:["\u0623\u062d\u062f","\u0625\u062b\u0646\u064a\u0646","\u062b\u0644\u0627\u062b\u0627\u0621","\u0623\u0631\u0628\u0639\u0627\u0621","\u062e\u0645\u064a\u0633","\u062c\u0645\u0639\u0629","\u0633\u0628\u062a"],A:["\u0627\u0644\u0623\u062d\u062f","\u0627\u0644\u0625\u062b\u0646\u064a\u0646","\u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621","\u0627\u0644\u0623\u0631\u0628\u0639\u0627\u0621","\u0627\u0644\u062e\u0645\u064a\u0633","\u0627\u0644\u062c\u0645\u0639\u0629","\u0627\u0644\u0633\u0628\u062a"],b:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],B:["\u064a\u0646\u0627\u064a\u0631","\u0641\u0628\u0631\u0627\u064a\u0631","\u0645\u0627\u0631\u0633","\u0623\u0628\u0631\u064a\u0644","\u0645\u0627\u064a\u0648","\u064a\u0648\u0646\u064a\u0648","\u064a\u0648\u0644\u064a\u0648","\u0623\u063a\u0633\u0637\u0633","\u0633\u0628\u062a\u0645\u0628\u0631","\u0623\u0643\u062a\u0648\u0628\u0631","\u0646\u0648\u0641\u0645\u0628\u0631","\u062f\u064a\u0633\u0645\u0628\u0631"],c:"%a\u060c %d %B %Y %Z %l:%M:%S %p",p:["\u0635","\u0645"],P:["\u0635","\u0645"],x:"%d\u200f/%m\u200f/%Y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ca-ES.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ca-ES",function(e){e.Intl.add("datatype-date-format","ca-ES",{a:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],A:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],b:["gen.","febr.","mar\u00e7","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],B:["gener","febrer","mar\u00e7","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],c:"%a %d %b %Y %k:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%k:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ca-ES",function(e){e.Intl.add("datatype-date-format","ca-ES",{a:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],A:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],b:["gen.","febr.","mar\u00e7","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],B:["gener","febrer","mar\u00e7","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],c:"%a %d %b %Y %k:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%k:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ca.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ca",function(e){e.Intl.add("datatype-date-format","ca",{a:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],A:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],b:["gen.","febr.","mar\u00e7","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],B:["gener","febrer","mar\u00e7","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],c:"%a %d %b %Y %k:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%k:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ca",function(e){e.Intl.add("datatype-date-format","ca",{a:["dg.","dl.","dt.","dc.","dj.","dv.","ds."],A:["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],b:["gen.","febr.","mar\u00e7","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des."],B:["gener","febrer","mar\u00e7","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],c:"%a %d %b %Y %k:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%k:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_da-DK.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_da-DK",function(e){e.Intl.add("datatype-date-format","da-DK",{a:["s\u00f8n","man","tir","ons","tor","fre","l\u00f8r"],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],c:"%a. %d. %b %Y %H.%M.%S %Z",p:["F.M.","E.M."],P:["f.m.","e.m."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_da-DK",function(e){e.Intl.add("datatype-date-format","da-DK",{a:["s\u00f8n","man","tir","ons","tor","fre","l\u00f8r"],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],c:"%a. %d. %b %Y %H.%M.%S %Z",p:["F.M.","E.M."],P:["f.m.","e.m."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_da.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_da",function(e){e.Intl.add("datatype-date-format","da",{a:["s\u00f8n","man","tir","ons","tor","fre","l\u00f8r"],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],c:"%a. %d. %b %Y %H.%M.%S %Z",p:["F.M.","E.M."],P:["f.m.","e.m."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_da",function(e){e.Intl.add("datatype-date-format","da",{a:["s\u00f8n","man","tir","ons","tor","fre","l\u00f8r"],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mar.","apr.","maj","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],c:"%a. %d. %b %Y %H.%M.%S %Z",p:["F.M.","E.M."],P:["f.m.","e.m."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_de-AT.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_de-AT",function(e){e.Intl.add("datatype-date-format","de-AT",{a:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],A:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],b:["J\u00e4n","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],B:["J\u00e4nner","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],c:"%a, %d. %b %Y %H:%M:%S %Z",p:["VORM.","NACHM."],P:["vorm.","nachm."],x:"%d.%m.%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_de-AT",function(e){e.Intl.add("datatype-date-format","de-AT",{a:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],A:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],b:["J\u00e4n","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],B:["J\u00e4nner","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],c:"%a, %d. %b %Y %H:%M:%S %Z",p:["VORM.","NACHM."],P:["vorm.","nachm."],x:"%d.%m.%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_de-DE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_de-DE",function(e){e.Intl.add("datatype-date-format","de-DE",{a:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],A:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],b:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],B:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],c:"%a, %d. %b %Y %H:%M:%S %Z",p:["VORM.","NACHM."],P:["vorm.","nachm."],x:"%d.%m.%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_de-DE",function(e){e.Intl.add("datatype-date-format","de-DE",{a:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],A:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],b:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],B:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],c:"%a, %d. %b %Y %H:%M:%S %Z",p:["VORM.","NACHM."],P:["vorm.","nachm."],x:"%d.%m.%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_de.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_de",function(e){e.Intl.add("datatype-date-format","de",{a:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],A:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],b:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],B:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],c:"%a, %d. %b %Y %H:%M:%S %Z",p:["VORM.","NACHM."],P:["vorm.","nachm."],x:"%d.%m.%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_de",function(e){e.Intl.add("datatype-date-format","de",{a:["So.","Mo.","Di.","Mi.","Do.","Fr.","Sa."],A:["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],b:["Jan","Feb","M\u00e4r","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],B:["Januar","Februar","M\u00e4rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],c:"%a, %d. %b %Y %H:%M:%S %Z",p:["VORM.","NACHM."],P:["vorm.","nachm."],x:"%d.%m.%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_el-GR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_el-GR",function(e){e.Intl.add("datatype-date-format","el-GR",{a:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],A:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],b:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03ca","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],B:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["\u03a0.\u039c.","\u039c.\u039c."],P:["\u03c0.\u03bc.","\u03bc.\u03bc."],x:"%d/%m/%Y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_el-GR",function(e){e.Intl.add("datatype-date-format","el-GR",{a:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],A:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],b:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03ca","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],B:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["\u03a0.\u039c.","\u039c.\u039c."],P:["\u03c0.\u03bc.","\u03bc.\u03bc."],x:"%d/%m/%Y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_el.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_el",function(e){e.Intl.add("datatype-date-format","el",{a:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],A:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],b:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03ca","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],B:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["\u03a0.\u039c.","\u039c.\u039c."],P:["\u03c0.\u03bc.","\u03bc.\u03bc."],x:"%d/%m/%Y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_el",function(e){e.Intl.add("datatype-date-format","el",{a:["\u039a\u03c5\u03c1","\u0394\u03b5\u03c5","\u03a4\u03c1\u03b9","\u03a4\u03b5\u03c4","\u03a0\u03b5\u03bc","\u03a0\u03b1\u03c1","\u03a3\u03b1\u03b2"],A:["\u039a\u03c5\u03c1\u03b9\u03b1\u03ba\u03ae","\u0394\u03b5\u03c5\u03c4\u03ad\u03c1\u03b1","\u03a4\u03c1\u03af\u03c4\u03b7","\u03a4\u03b5\u03c4\u03ac\u03c1\u03c4\u03b7","\u03a0\u03ad\u03bc\u03c0\u03c4\u03b7","\u03a0\u03b1\u03c1\u03b1\u03c3\u03ba\u03b5\u03c5\u03ae","\u03a3\u03ac\u03b2\u03b2\u03b1\u03c4\u03bf"],b:["\u0399\u03b1\u03bd","\u03a6\u03b5\u03b2","\u039c\u03b1\u03c1","\u0391\u03c0\u03c1","\u039c\u03b1\u03ca","\u0399\u03bf\u03c5\u03bd","\u0399\u03bf\u03c5\u03bb","\u0391\u03c5\u03b3","\u03a3\u03b5\u03c0","\u039f\u03ba\u03c4","\u039d\u03bf\u03b5","\u0394\u03b5\u03ba"],B:["\u0399\u03b1\u03bd\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u03a6\u03b5\u03b2\u03c1\u03bf\u03c5\u03b1\u03c1\u03af\u03bf\u03c5","\u039c\u03b1\u03c1\u03c4\u03af\u03bf\u03c5","\u0391\u03c0\u03c1\u03b9\u03bb\u03af\u03bf\u03c5","\u039c\u03b1\u0390\u03bf\u03c5","\u0399\u03bf\u03c5\u03bd\u03af\u03bf\u03c5","\u0399\u03bf\u03c5\u03bb\u03af\u03bf\u03c5","\u0391\u03c5\u03b3\u03bf\u03cd\u03c3\u03c4\u03bf\u03c5","\u03a3\u03b5\u03c0\u03c4\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u039f\u03ba\u03c4\u03c9\u03b2\u03c1\u03af\u03bf\u03c5","\u039d\u03bf\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5","\u0394\u03b5\u03ba\u03b5\u03bc\u03b2\u03c1\u03af\u03bf\u03c5"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["\u03a0.\u039c.","\u039c.\u039c."],P:["\u03c0.\u03bc.","\u03bc.\u03bc."],x:"%d/%m/%Y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-AU.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-AU",function(e){e.Intl.add("datatype-date-format","en-AU",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-AU",function(e){e.Intl.add("datatype-date-format","en-AU",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-CA.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-CA",function(e){e.Intl.add("datatype-date-format","en-CA",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%y-%m-%d",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-CA",function(e){e.Intl.add("datatype-date-format","en-CA",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%y-%m-%d",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-GB.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-GB",function(e){e.Intl.add("datatype-date-format","en-GB",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-GB",function(e){e.Intl.add("datatype-date-format","en-GB",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-IE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-IE",function(e){e.Intl.add("datatype-date-format","en-IE",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-IE",function(e){e.Intl.add("datatype-date-format","en-IE",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-IN.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-IN",function(e){e.Intl.add("datatype-date-format","en-IN",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-IN",function(e){e.Intl.add("datatype-date-format","en-IN",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-JO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-JO",function(e){e.Intl.add("datatype-date-format","en-JO",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-JO",function(e){e.Intl.add("datatype-date-format","en-JO",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-MY.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-MY",function(e){e.Intl.add("datatype-date-format","en-MY",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-MY",function(e){e.Intl.add("datatype-date-format","en-MY",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-NZ.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-NZ",function(e){e.Intl.add("datatype-date-format","en-NZ",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-NZ",function(e){e.Intl.add("datatype-date-format","en-NZ",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-PH.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-PH",function(e){e.Intl.add("datatype-date-format","en-PH",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-PH",function(e){e.Intl.add("datatype-date-format","en-PH",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-SG.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-SG",function(e){e.Intl.add("datatype-date-format","en-SG",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-SG",function(e){e.Intl.add("datatype-date-format","en-SG",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en-US.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en-US",function(e){e.Intl.add("datatype-date-format","en-US",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en-US",function(e){e.Intl.add("datatype-date-format","en-US",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_en",function(e){e.Intl.add("datatype-date-format","en",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_en",function(e){e.Intl.add("datatype-date-format","en",{a:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],A:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],b:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],B:["January","February","March","April","May","June","July","August","September","October","November","December"],c:"%a, %b %d, %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-AR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-AR",function(e){e.Intl.add("datatype-date-format","es-AR",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %Hh'%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%Hh'%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-AR",function(e){e.Intl.add("datatype-date-format","es-AR",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %Hh'%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%Hh'%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-BO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-BO",function(e){e.Intl.add("datatype-date-format","es-BO",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-BO",function(e){e.Intl.add("datatype-date-format","es-BO",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-CL.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-CL",function(e){e.Intl.add("datatype-date-format","es-CL",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-CL",function(e){e.Intl.add("datatype-date-format","es-CL",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-CO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-CO",function(e){e.Intl.add("datatype-date-format","es-CO",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-CO",function(e){e.Intl.add("datatype-date-format","es-CO",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-EC.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-EC",function(e){e.Intl.add("datatype-date-format","es-EC",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-EC",function(e){e.Intl.add("datatype-date-format","es-EC",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-ES.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-ES",function(e){e.Intl.add("datatype-date-format","es-ES",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-ES",function(e){e.Intl.add("datatype-date-format","es-ES",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-MX.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-MX",function(e){e.Intl.add("datatype-date-format","es-MX",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-MX",function(e){e.Intl.add("datatype-date-format","es-MX",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-PE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-PE",function(e){e.Intl.add("datatype-date-format","es-PE",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %HH%M'%S\" %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%HH%M'%S\""})},"3.7.2");+YUI.add("lang/datatype-date-format_es-PE",function(e){e.Intl.add("datatype-date-format","es-PE",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %HH%M'%S\" %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%HH%M'%S\""})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-PY.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-PY",function(e){e.Intl.add("datatype-date-format","es-PY",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-PY",function(e){e.Intl.add("datatype-date-format","es-PY",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-US.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-US",function(e){e.Intl.add("datatype-date-format","es-US",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-US",function(e){e.Intl.add("datatype-date-format","es-US",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%m/%d/%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-UY.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-UY",function(e){e.Intl.add("datatype-date-format","es-UY",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-UY",function(e){e.Intl.add("datatype-date-format","es-UY",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es-VE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es-VE",function(e){e.Intl.add("datatype-date-format","es-VE",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es-VE",function(e){e.Intl.add("datatype-date-format","es-VE",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_es.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_es",function(e){e.Intl.add("datatype-date-format","es",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_es",function(e){e.Intl.add("datatype-date-format","es",{a:["dom","lun","mar","mi\u00e9","jue","vie","s\u00e1b"],A:["domingo","lunes","martes","mi\u00e9rcoles","jueves","viernes","s\u00e1bado"],b:["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],B:["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["A.M.","P.M."],P:["a.m.","p.m."],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_fi-FI.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_fi-FI",function(e){e.Intl.add("datatype-date-format","fi-FI",{a:["su","ma","ti","ke","to","pe","la"],A:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],b:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],B:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],c:"%a %d. %b %Y %k.%M.%S %Z",p:["AP.","IP."],P:["ap.","ip."],x:"%d.%m.%Y",X:"%k.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_fi-FI",function(e){e.Intl.add("datatype-date-format","fi-FI",{a:["su","ma","ti","ke","to","pe","la"],A:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],b:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],B:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],c:"%a %d. %b %Y %k.%M.%S %Z",p:["AP.","IP."],P:["ap.","ip."],x:"%d.%m.%Y",X:"%k.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_fi.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_fi",function(e){e.Intl.add("datatype-date-format","fi",{a:["su","ma","ti","ke","to","pe","la"],A:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],b:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],B:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],c:"%a %d. %b %Y %k.%M.%S %Z",p:["AP.","IP."],P:["ap.","ip."],x:"%d.%m.%Y",X:"%k.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_fi",function(e){e.Intl.add("datatype-date-format","fi",{a:["su","ma","ti","ke","to","pe","la"],A:["sunnuntaina","maanantaina","tiistaina","keskiviikkona","torstaina","perjantaina","lauantaina"],b:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],B:["tammikuuta","helmikuuta","maaliskuuta","huhtikuuta","toukokuuta","kes\u00e4kuuta","hein\u00e4kuuta","elokuuta","syyskuuta","lokakuuta","marraskuuta","joulukuuta"],c:"%a %d. %b %Y %k.%M.%S %Z",p:["AP.","IP."],P:["ap.","ip."],x:"%d.%m.%Y",X:"%k.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_fr-BE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_fr-BE",function(e){e.Intl.add("datatype-date-format","fr-BE",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %k h %M min %S s %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%k h %M min %S s"})},"3.7.2");+YUI.add("lang/datatype-date-format_fr-BE",function(e){e.Intl.add("datatype-date-format","fr-BE",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %k h %M min %S s %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%k h %M min %S s"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_fr-CA.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_fr-CA",function(e){e.Intl.add("datatype-date-format","fr-CA",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %H h %M min %S s %Z",p:["AM","PM"],P:["am","pm"],x:"%y-%m-%d",X:"%H h %M min %S s"})},"3.7.2");+YUI.add("lang/datatype-date-format_fr-CA",function(e){e.Intl.add("datatype-date-format","fr-CA",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %H h %M min %S s %Z",p:["AM","PM"],P:["am","pm"],x:"%y-%m-%d",X:"%H h %M min %S s"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_fr-FR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_fr-FR",function(e){e.Intl.add("datatype-date-format","fr-FR",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_fr-FR",function(e){e.Intl.add("datatype-date-format","fr-FR",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_fr.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_fr",function(e){e.Intl.add("datatype-date-format","fr",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_fr",function(e){e.Intl.add("datatype-date-format","fr",{a:["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],A:["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],b:["janv.","f\u00e9vr.","mars","avr.","mai","juin","juil.","ao\u00fbt","sept.","oct.","nov.","d\u00e9c."],B:["janvier","f\u00e9vrier","mars","avril","mai","juin","juillet","ao\u00fbt","septembre","octobre","novembre","d\u00e9cembre"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_hi-IN.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_hi-IN",function(e){e.Intl.add("datatype-date-format","hi-IN",{a:["\u0930\u0935\u093f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0932","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],A:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0932\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],b:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],B:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_hi-IN",function(e){e.Intl.add("datatype-date-format","hi-IN",{a:["\u0930\u0935\u093f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0932","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],A:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0932\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],b:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],B:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_hi.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_hi",function(e){e.Intl.add("datatype-date-format","hi",{a:["\u0930\u0935\u093f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0932","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],A:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0932\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],b:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],B:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%l:%M:%S %p"})},"3.7.2");+YUI.add("lang/datatype-date-format_hi",function(e){e.Intl.add("datatype-date-format","hi",{a:["\u0930\u0935\u093f","\u0938\u094b\u092e","\u092e\u0902\u0917\u0932","\u092c\u0941\u0927","\u0917\u0941\u0930\u0941","\u0936\u0941\u0915\u094d\u0930","\u0936\u0928\u093f"],A:["\u0930\u0935\u093f\u0935\u093e\u0930","\u0938\u094b\u092e\u0935\u093e\u0930","\u092e\u0902\u0917\u0932\u0935\u093e\u0930","\u092c\u0941\u0927\u0935\u093e\u0930","\u0917\u0941\u0930\u0941\u0935\u093e\u0930","\u0936\u0941\u0915\u094d\u0930\u0935\u093e\u0930","\u0936\u0928\u093f\u0935\u093e\u0930"],b:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],B:["\u091c\u0928\u0935\u0930\u0940","\u092b\u0930\u0935\u0930\u0940","\u092e\u093e\u0930\u094d\u091a","\u0905\u092a\u094d\u0930\u0948\u0932","\u092e\u0908","\u091c\u0942\u0928","\u091c\u0941\u0932\u093e\u0908","\u0905\u0917\u0938\u094d\u0924","\u0938\u093f\u0924\u092e\u094d\u092c\u0930","\u0905\u0915\u094d\u0924\u0942\u092c\u0930","\u0928\u0935\u092e\u094d\u092c\u0930","\u0926\u093f\u0938\u092e\u094d\u092c\u0930"],c:"%a, %d %b %Y %l:%M:%S %p %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%l:%M:%S %p"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_id-ID.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_id-ID",function(e){e.Intl.add("datatype-date-format","id-ID",{a:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],A:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],b:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],B:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_id-ID",function(e){e.Intl.add("datatype-date-format","id-ID",{a:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],A:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],b:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],B:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_id.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_id",function(e){e.Intl.add("datatype-date-format","id",{a:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],A:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],b:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],B:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_id",function(e){e.Intl.add("datatype-date-format","id",{a:["Min","Sen","Sel","Rab","Kam","Jum","Sab"],A:["Minggu","Senin","Selasa","Rabu","Kamis","Jumat","Sabtu"],b:["Jan","Feb","Mar","Apr","Mei","Jun","Jul","Agu","Sep","Okt","Nov","Des"],B:["Januari","Februari","Maret","April","Mei","Juni","Juli","Agustus","September","Oktober","November","Desember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_it-IT.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_it-IT",function(e){e.Intl.add("datatype-date-format","it-IT",{a:["dom","lun","mar","mer","gio","ven","sab"],A:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],b:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],B:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],c:"%a %d %b %Y %H.%M.%S %Z",p:["M.","P."],P:["m.","p."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_it-IT",function(e){e.Intl.add("datatype-date-format","it-IT",{a:["dom","lun","mar","mer","gio","ven","sab"],A:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],b:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],B:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],c:"%a %d %b %Y %H.%M.%S %Z",p:["M.","P."],P:["m.","p."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_it.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_it",function(e){e.Intl.add("datatype-date-format","it",{a:["dom","lun","mar","mer","gio","ven","sab"],A:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],b:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],B:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],c:"%a %d %b %Y %H.%M.%S %Z",p:["M.","P."],P:["m.","p."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_it",function(e){e.Intl.add("datatype-date-format","it",{a:["dom","lun","mar","mer","gio","ven","sab"],A:["domenica","luned\u00ec","marted\u00ec","mercoled\u00ec","gioved\u00ec","venerd\u00ec","sabato"],b:["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],B:["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],c:"%a %d %b %Y %H.%M.%S %Z",p:["M.","P."],P:["m.","p."],x:"%d/%m/%y",X:"%H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ja-JP.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ja-JP",function(e){e.Intl.add("datatype-date-format","ja-JP",{a:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],A:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%m\u6708%d\u65e5(%a)%k\u6642%M\u5206%S\u79d2 %Z",p:["\u5348\u524d","\u5348\u5f8c"],P:["\u5348\u524d","\u5348\u5f8c"],x:"%y/%m/%d",X:"%k\u6642%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_ja-JP",function(e){e.Intl.add("datatype-date-format","ja-JP",{a:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],A:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%m\u6708%d\u65e5(%a)%k\u6642%M\u5206%S\u79d2 %Z",p:["\u5348\u524d","\u5348\u5f8c"],P:["\u5348\u524d","\u5348\u5f8c"],x:"%y/%m/%d",X:"%k\u6642%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ja.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ja",function(e){e.Intl.add("datatype-date-format","ja",{a:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],A:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%m\u6708%d\u65e5(%a)%k\u6642%M\u5206%S\u79d2 %Z",p:["\u5348\u524d","\u5348\u5f8c"],P:["\u5348\u524d","\u5348\u5f8c"],x:"%y/%m/%d",X:"%k\u6642%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_ja",function(e){e.Intl.add("datatype-date-format","ja",{a:["\u65e5","\u6708","\u706b","\u6c34","\u6728","\u91d1","\u571f"],A:["\u65e5\u66dc\u65e5","\u6708\u66dc\u65e5","\u706b\u66dc\u65e5","\u6c34\u66dc\u65e5","\u6728\u66dc\u65e5","\u91d1\u66dc\u65e5","\u571f\u66dc\u65e5"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%m\u6708%d\u65e5(%a)%k\u6642%M\u5206%S\u79d2 %Z",p:["\u5348\u524d","\u5348\u5f8c"],P:["\u5348\u524d","\u5348\u5f8c"],x:"%y/%m/%d",X:"%k\u6642%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ko-KR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ko-KR",function(e){e.Intl.add("datatype-date-format","ko-KR",{a:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],A:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],b:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],B:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],c:"%Y\ub144 %b %d\uc77c %a%p %I\uc2dc %M\ubd84 %S\ucd08 %Z",p:["\uc624\uc804","\uc624\ud6c4"],P:["\uc624\uc804","\uc624\ud6c4"],x:"%y. %m. %d.",X:"%p %I\uc2dc %M\ubd84 %S\ucd08"})},"3.7.2");+YUI.add("lang/datatype-date-format_ko-KR",function(e){e.Intl.add("datatype-date-format","ko-KR",{a:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],A:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],b:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],B:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],c:"%Y\ub144 %b %d\uc77c %a%p %I\uc2dc %M\ubd84 %S\ucd08 %Z",p:["\uc624\uc804","\uc624\ud6c4"],P:["\uc624\uc804","\uc624\ud6c4"],x:"%y. %m. %d.",X:"%p %I\uc2dc %M\ubd84 %S\ucd08"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ko.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ko",function(e){e.Intl.add("datatype-date-format","ko",{a:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],A:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],b:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],B:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],c:"%Y\ub144 %b %d\uc77c %a%p %I\uc2dc %M\ubd84 %S\ucd08 %Z",p:["\uc624\uc804","\uc624\ud6c4"],P:["\uc624\uc804","\uc624\ud6c4"],x:"%y. %m. %d.",X:"%p %I\uc2dc %M\ubd84 %S\ucd08"})},"3.7.2");+YUI.add("lang/datatype-date-format_ko",function(e){e.Intl.add("datatype-date-format","ko",{a:["\uc77c","\uc6d4","\ud654","\uc218","\ubaa9","\uae08","\ud1a0"],A:["\uc77c\uc694\uc77c","\uc6d4\uc694\uc77c","\ud654\uc694\uc77c","\uc218\uc694\uc77c","\ubaa9\uc694\uc77c","\uae08\uc694\uc77c","\ud1a0\uc694\uc77c"],b:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],B:["1\uc6d4","2\uc6d4","3\uc6d4","4\uc6d4","5\uc6d4","6\uc6d4","7\uc6d4","8\uc6d4","9\uc6d4","10\uc6d4","11\uc6d4","12\uc6d4"],c:"%Y\ub144 %b %d\uc77c %a%p %I\uc2dc %M\ubd84 %S\ucd08 %Z",p:["\uc624\uc804","\uc624\ud6c4"],P:["\uc624\uc804","\uc624\ud6c4"],x:"%y. %m. %d.",X:"%p %I\uc2dc %M\ubd84 %S\ucd08"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ms-MY.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ms-MY",function(e){e.Intl.add("datatype-date-format","ms-MY",{a:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],A:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],b:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogos","Sep","Okt","Nov","Dis"],B:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ms-MY",function(e){e.Intl.add("datatype-date-format","ms-MY",{a:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],A:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],b:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogos","Sep","Okt","Nov","Dis"],B:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ms.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ms",function(e){e.Intl.add("datatype-date-format","ms",{a:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],A:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],b:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogos","Sep","Okt","Nov","Dis"],B:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ms",function(e){e.Intl.add("datatype-date-format","ms",{a:["Ahd","Isn","Sel","Rab","Kha","Jum","Sab"],A:["Ahad","Isnin","Selasa","Rabu","Khamis","Jumaat","Sabtu"],b:["Jan","Feb","Mac","Apr","Mei","Jun","Jul","Ogos","Sep","Okt","Nov","Dis"],B:["Januari","Februari","Mac","April","Mei","Jun","Julai","Ogos","September","Oktober","November","Disember"],c:"%a, %Y %b %d %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%Y-%m-%d",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_nb-NO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_nb-NO",function(e){e.Intl.add("datatype-date-format","nb-NO",{a:["s\u00f8n.","man.","tir.","ons.","tor.","fre.","l\u00f8r."],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],B:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],c:"%a %d. %b %Y kl. %H.%M.%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"kl. %H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_nb-NO",function(e){e.Intl.add("datatype-date-format","nb-NO",{a:["s\u00f8n.","man.","tir.","ons.","tor.","fre.","l\u00f8r."],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],B:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],c:"%a %d. %b %Y kl. %H.%M.%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"kl. %H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_nb.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_nb",function(e){e.Intl.add("datatype-date-format","nb",{a:["s\u00f8n.","man.","tir.","ons.","tor.","fre.","l\u00f8r."],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],B:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],c:"%a %d. %b %Y kl. %H.%M.%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"kl. %H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_nb",function(e){e.Intl.add("datatype-date-format","nb",{a:["s\u00f8n.","man.","tir.","ons.","tor.","fre.","l\u00f8r."],A:["s\u00f8ndag","mandag","tirsdag","onsdag","torsdag","fredag","l\u00f8rdag"],b:["jan.","feb.","mars","apr.","mai","juni","juli","aug.","sep.","okt.","nov.","des."],B:["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],c:"%a %d. %b %Y kl. %H.%M.%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"kl. %H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_nl-BE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_nl-BE",function(e){e.Intl.add("datatype-date-format","nl-BE",{a:["zo","ma","di","wo","do","vr","za"],A:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],b:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_nl-BE",function(e){e.Intl.add("datatype-date-format","nl-BE",{a:["zo","ma","di","wo","do","vr","za"],A:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],b:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_nl-NL.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_nl-NL",function(e){e.Intl.add("datatype-date-format","nl-NL",{a:["zo","ma","di","wo","do","vr","za"],A:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],b:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_nl-NL",function(e){e.Intl.add("datatype-date-format","nl-NL",{a:["zo","ma","di","wo","do","vr","za"],A:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],b:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_nl.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_nl",function(e){e.Intl.add("datatype-date-format","nl",{a:["zo","ma","di","wo","do","vr","za"],A:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],b:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_nl",function(e){e.Intl.add("datatype-date-format","nl",{a:["zo","ma","di","wo","do","vr","za"],A:["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],b:["jan.","feb.","mrt.","apr.","mei","jun.","jul.","aug.","sep.","okt.","nov.","dec."],B:["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],c:"%a %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_pl-PL.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_pl-PL",function(e){e.Intl.add("datatype-date-format","pl-PL",{a:["niedz.","pon.","wt.","\u015br.","czw.","pt.","sob."],A:["niedziela","poniedzia\u0142ek","wtorek","\u015broda","czwartek","pi\u0105tek","sobota"],b:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","pa\u017a","lis","gru"],B:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","wrze\u015bnia","pa\u017adziernika","listopada","grudnia"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_pl-PL",function(e){e.Intl.add("datatype-date-format","pl-PL",{a:["niedz.","pon.","wt.","\u015br.","czw.","pt.","sob."],A:["niedziela","poniedzia\u0142ek","wtorek","\u015broda","czwartek","pi\u0105tek","sobota"],b:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","pa\u017a","lis","gru"],B:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","wrze\u015bnia","pa\u017adziernika","listopada","grudnia"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_pl.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_pl",function(e){e.Intl.add("datatype-date-format","pl",{a:["niedz.","pon.","wt.","\u015br.","czw.","pt.","sob."],A:["niedziela","poniedzia\u0142ek","wtorek","\u015broda","czwartek","pi\u0105tek","sobota"],b:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","pa\u017a","lis","gru"],B:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","wrze\u015bnia","pa\u017adziernika","listopada","grudnia"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_pl",function(e){e.Intl.add("datatype-date-format","pl",{a:["niedz.","pon.","wt.","\u015br.","czw.","pt.","sob."],A:["niedziela","poniedzia\u0142ek","wtorek","\u015broda","czwartek","pi\u0105tek","sobota"],b:["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","pa\u017a","lis","gru"],B:["stycznia","lutego","marca","kwietnia","maja","czerwca","lipca","sierpnia","wrze\u015bnia","pa\u017adziernika","listopada","grudnia"],c:"%a, %d %b %Y %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d-%m-%y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_pt-BR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_pt-BR",function(e){e.Intl.add("datatype-date-format","pt-BR",{a:["dom","seg","ter","qua","qui","sex","s\u00e1b"],A:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira","s\u00e1bado"],b:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],B:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],c:"%a, %d de %b de %Y %Hh%Mmin%Ss %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%Hh%Mmin%Ss"})},"3.7.2");+YUI.add("lang/datatype-date-format_pt-BR",function(e){e.Intl.add("datatype-date-format","pt-BR",{a:["dom","seg","ter","qua","qui","sex","s\u00e1b"],A:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira","s\u00e1bado"],b:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],B:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],c:"%a, %d de %b de %Y %Hh%Mmin%Ss %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%Hh%Mmin%Ss"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_pt.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_pt",function(e){e.Intl.add("datatype-date-format","pt",{a:["dom","seg","ter","qua","qui","sex","s\u00e1b"],A:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira","s\u00e1bado"],b:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],B:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],c:"%a, %d de %b de %Y %Hh%Mmin%Ss %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%Hh%Mmin%Ss"})},"3.7.2");+YUI.add("lang/datatype-date-format_pt",function(e){e.Intl.add("datatype-date-format","pt",{a:["dom","seg","ter","qua","qui","sex","s\u00e1b"],A:["domingo","segunda-feira","ter\u00e7a-feira","quarta-feira","quinta-feira","sexta-feira","s\u00e1bado"],b:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],B:["janeiro","fevereiro","mar\u00e7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],c:"%a, %d de %b de %Y %Hh%Mmin%Ss %Z",p:["AM","PM"],P:["am","pm"],x:"%d/%m/%y",X:"%Hh%Mmin%Ss"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ro-RO.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ro-RO",function(e){e.Intl.add("datatype-date-format","ro-RO",{a:["Du","Lu","Ma","Mi","Jo","Vi","S\u00e2"],A:["duminic\u0103","luni","mar\u021bi","miercuri","joi","vineri","s\u00e2mb\u0103t\u0103"],b:["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],B:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],c:"%a, %d %b %Y, %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ro-RO",function(e){e.Intl.add("datatype-date-format","ro-RO",{a:["Du","Lu","Ma","Mi","Jo","Vi","S\u00e2"],A:["duminic\u0103","luni","mar\u021bi","miercuri","joi","vineri","s\u00e2mb\u0103t\u0103"],b:["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],B:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],c:"%a, %d %b %Y, %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ro.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ro",function(e){e.Intl.add("datatype-date-format","ro",{a:["Du","Lu","Ma","Mi","Jo","Vi","S\u00e2"],A:["duminic\u0103","luni","mar\u021bi","miercuri","joi","vineri","s\u00e2mb\u0103t\u0103"],b:["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],B:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],c:"%a, %d %b %Y, %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ro",function(e){e.Intl.add("datatype-date-format","ro",{a:["Du","Lu","Ma","Mi","Jo","Vi","S\u00e2"],A:["duminic\u0103","luni","mar\u021bi","miercuri","joi","vineri","s\u00e2mb\u0103t\u0103"],b:["ian.","feb.","mar.","apr.","mai","iun.","iul.","aug.","sept.","oct.","nov.","dec."],B:["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie"],c:"%a, %d %b %Y, %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ru-RU.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ru-RU",function(e){e.Intl.add("datatype-date-format","ru-RU",{a:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],A:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],b:["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440.","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.","\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a."],B:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"],c:"%a, %d %b %Y %k:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"%k:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ru-RU",function(e){e.Intl.add("datatype-date-format","ru-RU",{a:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],A:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],b:["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440.","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.","\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a."],B:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"],c:"%a, %d %b %Y %k:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"%k:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_ru.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_ru",function(e){e.Intl.add("datatype-date-format","ru",{a:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],A:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],b:["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440.","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.","\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a."],B:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"],c:"%a, %d %b %Y %k:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"%k:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_ru",function(e){e.Intl.add("datatype-date-format","ru",{a:["\u0412\u0441","\u041f\u043d","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041f\u0442","\u0421\u0431"],A:["\u0432\u043e\u0441\u043a\u0440\u0435\u0441\u0435\u043d\u044c\u0435","\u043f\u043e\u043d\u0435\u0434\u0435\u043b\u044c\u043d\u0438\u043a","\u0432\u0442\u043e\u0440\u043d\u0438\u043a","\u0441\u0440\u0435\u0434\u0430","\u0447\u0435\u0442\u0432\u0435\u0440\u0433","\u043f\u044f\u0442\u043d\u0438\u0446\u0430","\u0441\u0443\u0431\u0431\u043e\u0442\u0430"],b:["\u044f\u043d\u0432.","\u0444\u0435\u0432\u0440.","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440.","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433.","\u0441\u0435\u043d\u0442.","\u043e\u043a\u0442.","\u043d\u043e\u044f\u0431.","\u0434\u0435\u043a."],B:["\u044f\u043d\u0432\u0430\u0440\u044f","\u0444\u0435\u0432\u0440\u0430\u043b\u044f","\u043c\u0430\u0440\u0442\u0430","\u0430\u043f\u0440\u0435\u043b\u044f","\u043c\u0430\u044f","\u0438\u044e\u043d\u044f","\u0438\u044e\u043b\u044f","\u0430\u0432\u0433\u0443\u0441\u0442\u0430","\u0441\u0435\u043d\u0442\u044f\u0431\u0440\u044f","\u043e\u043a\u0442\u044f\u0431\u0440\u044f","\u043d\u043e\u044f\u0431\u0440\u044f","\u0434\u0435\u043a\u0430\u0431\u0440\u044f"],c:"%a, %d %b %Y %k:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%y",X:"%k:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_sv-SE.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_sv-SE",function(e){e.Intl.add("datatype-date-format","sv-SE",{a:["s\u00f6n","m\u00e5n","tis","ons","tors","fre","l\u00f6r"],A:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],b:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],B:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],c:"%a %d %b %Y kl. %H.%M.%S %Z",p:["FM","EM"],P:["fm","em"],x:"%Y-%m-%d",X:"kl. %H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_sv-SE",function(e){e.Intl.add("datatype-date-format","sv-SE",{a:["s\u00f6n","m\u00e5n","tis","ons","tors","fre","l\u00f6r"],A:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],b:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],B:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],c:"%a %d %b %Y kl. %H.%M.%S %Z",p:["FM","EM"],P:["fm","em"],x:"%Y-%m-%d",X:"kl. %H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_sv.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_sv",function(e){e.Intl.add("datatype-date-format","sv",{a:["s\u00f6n","m\u00e5n","tis","ons","tors","fre","l\u00f6r"],A:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],b:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],B:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],c:"%a %d %b %Y kl. %H.%M.%S %Z",p:["FM","EM"],P:["fm","em"],x:"%Y-%m-%d",X:"kl. %H.%M.%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_sv",function(e){e.Intl.add("datatype-date-format","sv",{a:["s\u00f6n","m\u00e5n","tis","ons","tors","fre","l\u00f6r"],A:["s\u00f6ndag","m\u00e5ndag","tisdag","onsdag","torsdag","fredag","l\u00f6rdag"],b:["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec"],B:["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],c:"%a %d %b %Y kl. %H.%M.%S %Z",p:["FM","EM"],P:["fm","em"],x:"%Y-%m-%d",X:"kl. %H.%M.%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_th-TH.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_th-TH",function(e){e.Intl.add("datatype-date-format","th-TH",{a:["\u0e2d\u0e32.","\u0e08.","\u0e2d.","\u0e1e.","\u0e1e\u0e24.","\u0e28.","\u0e2a."],A:["\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18","\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35","\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"],b:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],B:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],c:"%a %d %b %Y, %k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35 %Z",p:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],P:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],x:"%d/%m/%Y",X:"%k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35"})},"3.7.2");+YUI.add("lang/datatype-date-format_th-TH",function(e){e.Intl.add("datatype-date-format","th-TH",{a:["\u0e2d\u0e32.","\u0e08.","\u0e2d.","\u0e1e.","\u0e1e\u0e24.","\u0e28.","\u0e2a."],A:["\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18","\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35","\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"],b:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],B:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],c:"%a %d %b %Y, %k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35 %Z",p:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],P:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],x:"%d/%m/%Y",X:"%k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_th.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_th",function(e){e.Intl.add("datatype-date-format","th",{a:["\u0e2d\u0e32.","\u0e08.","\u0e2d.","\u0e1e.","\u0e1e\u0e24.","\u0e28.","\u0e2a."],A:["\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18","\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35","\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"],b:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],B:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],c:"%a %d %b %Y, %k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35 %Z",p:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],P:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],x:"%d/%m/%Y",X:"%k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35"})},"3.7.2");+YUI.add("lang/datatype-date-format_th",function(e){e.Intl.add("datatype-date-format","th",{a:["\u0e2d\u0e32.","\u0e08.","\u0e2d.","\u0e1e.","\u0e1e\u0e24.","\u0e28.","\u0e2a."],A:["\u0e27\u0e31\u0e19\u0e2d\u0e32\u0e17\u0e34\u0e15\u0e22\u0e4c","\u0e27\u0e31\u0e19\u0e08\u0e31\u0e19\u0e17\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e2d\u0e31\u0e07\u0e04\u0e32\u0e23","\u0e27\u0e31\u0e19\u0e1e\u0e38\u0e18","\u0e27\u0e31\u0e19\u0e1e\u0e24\u0e2b\u0e31\u0e2a\u0e1a\u0e14\u0e35","\u0e27\u0e31\u0e19\u0e28\u0e38\u0e01\u0e23\u0e4c","\u0e27\u0e31\u0e19\u0e40\u0e2a\u0e32\u0e23\u0e4c"],b:["\u0e21.\u0e04.","\u0e01.\u0e1e.","\u0e21\u0e35.\u0e04.","\u0e40\u0e21.\u0e22.","\u0e1e.\u0e04.","\u0e21\u0e34.\u0e22.","\u0e01.\u0e04.","\u0e2a.\u0e04.","\u0e01.\u0e22.","\u0e15.\u0e04.","\u0e1e.\u0e22.","\u0e18.\u0e04."],B:["\u0e21\u0e01\u0e23\u0e32\u0e04\u0e21","\u0e01\u0e38\u0e21\u0e20\u0e32\u0e1e\u0e31\u0e19\u0e18\u0e4c","\u0e21\u0e35\u0e19\u0e32\u0e04\u0e21","\u0e40\u0e21\u0e29\u0e32\u0e22\u0e19","\u0e1e\u0e24\u0e29\u0e20\u0e32\u0e04\u0e21","\u0e21\u0e34\u0e16\u0e38\u0e19\u0e32\u0e22\u0e19","\u0e01\u0e23\u0e01\u0e0e\u0e32\u0e04\u0e21","\u0e2a\u0e34\u0e07\u0e2b\u0e32\u0e04\u0e21","\u0e01\u0e31\u0e19\u0e22\u0e32\u0e22\u0e19","\u0e15\u0e38\u0e25\u0e32\u0e04\u0e21","\u0e1e\u0e24\u0e28\u0e08\u0e34\u0e01\u0e32\u0e22\u0e19","\u0e18\u0e31\u0e19\u0e27\u0e32\u0e04\u0e21"],c:"%a %d %b %Y, %k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35 %Z",p:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],P:["\u0e01\u0e48\u0e2d\u0e19\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07","\u0e2b\u0e25\u0e31\u0e07\u0e40\u0e17\u0e35\u0e48\u0e22\u0e07"],x:"%d/%m/%Y",X:"%k \u0e19\u0e32\u0e2c\u0e34\u0e01\u0e32 %M \u0e19\u0e32\u0e17\u0e35 %S \u0e27\u0e34\u0e19\u0e32\u0e17\u0e35"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_tr-TR.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_tr-TR",function(e){e.Intl.add("datatype-date-format","tr-TR",{a:["Paz","Pzt","Sal","\u00c7ar","Per","Cum","Cmt"],A:["Pazar","Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],b:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],B:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k"],c:"%d %b %Y %a %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_tr-TR",function(e){e.Intl.add("datatype-date-format","tr-TR",{a:["Paz","Pzt","Sal","\u00c7ar","Per","Cum","Cmt"],A:["Pazar","Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],b:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],B:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k"],c:"%d %b %Y %a %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_tr.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_tr",function(e){e.Intl.add("datatype-date-format","tr",{a:["Paz","Pzt","Sal","\u00c7ar","Per","Cum","Cmt"],A:["Pazar","Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],b:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],B:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k"],c:"%d %b %Y %a %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_tr",function(e){e.Intl.add("datatype-date-format","tr",{a:["Paz","Pzt","Sal","\u00c7ar","Per","Cum","Cmt"],A:["Pazar","Pazartesi","Sal\u0131","\u00c7ar\u015famba","Per\u015fembe","Cuma","Cumartesi"],b:["Oca","\u015eub","Mar","Nis","May","Haz","Tem","A\u011fu","Eyl","Eki","Kas","Ara"],B:["Ocak","\u015eubat","Mart","Nisan","May\u0131s","Haziran","Temmuz","A\u011fustos","Eyl\u00fcl","Ekim","Kas\u0131m","Aral\u0131k"],c:"%d %b %Y %a %H:%M:%S %Z",p:["AM","PM"],P:["am","pm"],x:"%d.%m.%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_vi-VN.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_vi-VN",function(e){e.Intl.add("datatype-date-format","vi-VN",{a:["CN","Th 2","Th 3","Th 4","Th 5","Th 6","Th 7"],A:["Ch\u1ee7 nh\u1eadt","Th\u1ee9 hai","Th\u1ee9 ba","Th\u1ee9 t\u01b0","Th\u1ee9 n\u0103m","Th\u1ee9 s\u00e1u","Th\u1ee9 b\u1ea3y"],b:["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],B:["th\u00e1ng m\u1ed9t","th\u00e1ng hai","th\u00e1ng ba","th\u00e1ng t\u01b0","th\u00e1ng n\u0103m","th\u00e1ng s\u00e1u","th\u00e1ng b\u1ea3y","th\u00e1ng t\u00e1m","th\u00e1ng ch\u00edn","th\u00e1ng m\u01b0\u1eddi","th\u00e1ng m\u01b0\u1eddi m\u1ed9t","th\u00e1ng m\u01b0\u1eddi hai"],c:"%H:%M:%S %Z %a, %d %b %Y",p:["SA","CH"],P:["sa","ch"],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_vi-VN",function(e){e.Intl.add("datatype-date-format","vi-VN",{a:["CN","Th 2","Th 3","Th 4","Th 5","Th 6","Th 7"],A:["Ch\u1ee7 nh\u1eadt","Th\u1ee9 hai","Th\u1ee9 ba","Th\u1ee9 t\u01b0","Th\u1ee9 n\u0103m","Th\u1ee9 s\u00e1u","Th\u1ee9 b\u1ea3y"],b:["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],B:["th\u00e1ng m\u1ed9t","th\u00e1ng hai","th\u00e1ng ba","th\u00e1ng t\u01b0","th\u00e1ng n\u0103m","th\u00e1ng s\u00e1u","th\u00e1ng b\u1ea3y","th\u00e1ng t\u00e1m","th\u00e1ng ch\u00edn","th\u00e1ng m\u01b0\u1eddi","th\u00e1ng m\u01b0\u1eddi m\u1ed9t","th\u00e1ng m\u01b0\u1eddi hai"],c:"%H:%M:%S %Z %a, %d %b %Y",p:["SA","CH"],P:["sa","ch"],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_vi.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_vi",function(e){e.Intl.add("datatype-date-format","vi",{a:["CN","Th 2","Th 3","Th 4","Th 5","Th 6","Th 7"],A:["Ch\u1ee7 nh\u1eadt","Th\u1ee9 hai","Th\u1ee9 ba","Th\u1ee9 t\u01b0","Th\u1ee9 n\u0103m","Th\u1ee9 s\u00e1u","Th\u1ee9 b\u1ea3y"],b:["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],B:["th\u00e1ng m\u1ed9t","th\u00e1ng hai","th\u00e1ng ba","th\u00e1ng t\u01b0","th\u00e1ng n\u0103m","th\u00e1ng s\u00e1u","th\u00e1ng b\u1ea3y","th\u00e1ng t\u00e1m","th\u00e1ng ch\u00edn","th\u00e1ng m\u01b0\u1eddi","th\u00e1ng m\u01b0\u1eddi m\u1ed9t","th\u00e1ng m\u01b0\u1eddi hai"],c:"%H:%M:%S %Z %a, %d %b %Y",p:["SA","CH"],P:["sa","ch"],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.2");+YUI.add("lang/datatype-date-format_vi",function(e){e.Intl.add("datatype-date-format","vi",{a:["CN","Th 2","Th 3","Th 4","Th 5","Th 6","Th 7"],A:["Ch\u1ee7 nh\u1eadt","Th\u1ee9 hai","Th\u1ee9 ba","Th\u1ee9 t\u01b0","Th\u1ee9 n\u0103m","Th\u1ee9 s\u00e1u","Th\u1ee9 b\u1ea3y"],b:["thg 1","thg 2","thg 3","thg 4","thg 5","thg 6","thg 7","thg 8","thg 9","thg 10","thg 11","thg 12"],B:["th\u00e1ng m\u1ed9t","th\u00e1ng hai","th\u00e1ng ba","th\u00e1ng t\u01b0","th\u00e1ng n\u0103m","th\u00e1ng s\u00e1u","th\u00e1ng b\u1ea3y","th\u00e1ng t\u00e1m","th\u00e1ng ch\u00edn","th\u00e1ng m\u01b0\u1eddi","th\u00e1ng m\u01b0\u1eddi m\u1ed9t","th\u00e1ng m\u01b0\u1eddi hai"],c:"%H:%M:%S %Z %a, %d %b %Y",p:["SA","CH"],P:["sa","ch"],x:"%d/%m/%Y",X:"%H:%M:%S"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_zh-Hans-CN.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_zh-Hans-CN",function(e){e.Intl.add("datatype-date-format","zh-Hans-CN",{a:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u65f6%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y-%m-%d",X:"%p%l\u65f6%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_zh-Hans-CN",function(e){e.Intl.add("datatype-date-format","zh-Hans-CN",{a:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u65f6%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y-%m-%d",X:"%p%l\u65f6%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_zh-Hans.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_zh-Hans",function(e){e.Intl.add("datatype-date-format","zh-Hans",{a:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u65f6%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y-%m-%d",X:"%p%l\u65f6%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_zh-Hans",function(e){e.Intl.add("datatype-date-format","zh-Hans",{a:["\u5468\u65e5","\u5468\u4e00","\u5468\u4e8c","\u5468\u4e09","\u5468\u56db","\u5468\u4e94","\u5468\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u65f6%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y-%m-%d",X:"%p%l\u65f6%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_zh-Hant-HK.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_zh-Hant-HK",function(e){e.Intl.add("datatype-date-format","zh-Hant-HK",{a:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u6642%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y\u5e74%m\u6708%d\u65e5",X:"%p%l\u6642%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_zh-Hant-HK",function(e){e.Intl.add("datatype-date-format","zh-Hant-HK",{a:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u6642%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y\u5e74%m\u6708%d\u65e5",X:"%p%l\u6642%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_zh-Hant-TW.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_zh-Hant-TW",function(e){e.Intl.add("datatype-date-format","zh-Hant-TW",{a:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u6642%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y/%m/%d",X:"%p%l\u6642%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_zh-Hant-TW",function(e){e.Intl.add("datatype-date-format","zh-Hant-TW",{a:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u6642%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y/%m/%d",X:"%p%l\u6642%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-format/lang/datatype-date-format_zh-Hant.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/datatype-date-format_zh-Hant",function(e){e.Intl.add("datatype-date-format","zh-Hant",{a:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u6642%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y/%m/%d",X:"%p%l\u6642%M\u5206%S\u79d2"})},"3.7.2");+YUI.add("lang/datatype-date-format_zh-Hant",function(e){e.Intl.add("datatype-date-format","zh-Hant",{a:["\u9031\u65e5","\u9031\u4e00","\u9031\u4e8c","\u9031\u4e09","\u9031\u56db","\u9031\u4e94","\u9031\u516d"],A:["\u661f\u671f\u65e5","\u661f\u671f\u4e00","\u661f\u671f\u4e8c","\u661f\u671f\u4e09","\u661f\u671f\u56db","\u661f\u671f\u4e94","\u661f\u671f\u516d"],b:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],B:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],c:"%Y\u5e74%b%d\u65e5%a%Z%p%l\u6642%M\u5206%S\u79d2",p:["\u4e0a\u5348","\u4e0b\u5348"],P:["\u4e0a\u5348","\u4e0b\u5348"],x:"%y/%m/%d",X:"%p%l\u6642%M\u5206%S\u79d2"})},"3.7.3");
bundle/datatype-date-math/datatype-date-math-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatype-date-math/datatype-date-math.js", code: [] };-_yuitest_coverage["build/datatype-date-math/datatype-date-math.js"].code=["YUI.add('datatype-date-math', function (Y, NAME) {","","/**"," * Date Math submodule."," *"," * @module datatype-date"," * @submodule datatype-date-math"," * @for Date"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Date\"), {",""," /**"," * Checks whether a native JavaScript Date contains a valid value."," * @for Date"," * @method isValidDate"," * @param oDate {Date} Date in the month for which the number of days is desired."," * @return {Boolean} True if the date argument contains a valid value."," */"," isValidDate : function (oDate) {"," if(LANG.isDate(oDate) && (isFinite(oDate)) && (oDate != \"Invalid Date\") && !isNaN(oDate) && (oDate != null)) {"," return true;"," }"," else {"," return false;"," }"," },",""," /**"," * Checks whether two dates correspond to the same date and time."," * @for Date"," * @method areEqual"," * @param aDate {Date} The first date to compare."," * @param bDate {Date} The second date to compare."," * @return {Boolean} True if the two dates correspond to the same"," * date and time."," */ "," areEqual : function (aDate, bDate) {"," return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() == bDate.getTime())); "," },",""," /**"," * Checks whether the first date comes later than the second."," * @for Date"," * @method isGreater"," * @param aDate {Date} The first date to compare."," * @param bDate {Date} The second date to compare."," * @return {Boolean} True if the first date is later than the second."," */ "," isGreater : function (aDate, bDate) {"," return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() > bDate.getTime()));"," },",""," /**"," * Checks whether the first date comes later than or is the same as"," * the second."," * @for Date"," * @method isGreaterOrEqual"," * @param aDate {Date} The first date to compare."," * @param bDate {Date} The second date to compare."," * @return {Boolean} True if the first date is later than or "," * the same as the second."," */ "," isGreaterOrEqual : function (aDate, bDate) {"," return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() >= bDate.getTime()));"," },","",""," /**"," * Checks whether the date is between two other given dates."," * @for Date"," * @method isInRange"," * @param aDate {Date} The date to check"," * @param bDate {Date} Lower bound of the range."," * @param cDate {Date} Higher bound of the range."," * @return {Boolean} True if the date is between the two other given dates."," */ "," isInRange : function (aDate, bDate, cDate) {"," return (this.isGreaterOrEqual(aDate, bDate) && this.isGreaterOrEqual(cDate, aDate));"," },",""," /**"," * Adds a specified number of days to the given date."," * @for Date"," * @method addDays"," * @param oDate {Date} The date to add days to."," * @param numMonths {Number} The number of days to add (can be negative)"," * @return {Date} A new Date with the specified number of days"," * added to the original date."," */ "," addDays : function (oDate, numDays) {"," return new Date(oDate.getTime() + 86400000*numDays);"," },","",""," /**"," * Adds a specified number of months to the given date."," * @for Date"," * @method addMonths"," * @param oDate {Date} The date to add months to."," * @param numMonths {Number} The number of months to add (can be negative)"," * @return {Date} A new Date with the specified number of months"," * added to the original date."," */ "," addMonths : function (oDate, numMonths) {"," var newYear = oDate.getFullYear();"," var newMonth = oDate.getMonth() + numMonths; "," "," newYear = Math.floor(newYear + newMonth / 12);"," newMonth = (newMonth % 12 + 12) % 12;"," "," var newDate = new Date (oDate.getTime());"," newDate.setFullYear(newYear);"," newDate.setMonth(newMonth);"," "," return newDate;"," },",""," /**"," * Adds a specified number of years to the given date."," * @for Date"," * @method addYears"," * @param oDate {Date} The date to add years to."," * @param numYears {Number} The number of years to add (can be negative)"," * @return {Date} A new Date with the specified number of years"," * added to the original date."," */ "," addYears : function (oDate, numYears) {"," var newYear = oDate.getFullYear() + numYears;"," var newDate = new Date(oDate.getTime());"," "," newDate.setFullYear(newYear);"," return newDate;"," },",""," /**"," * Lists all dates in a given month."," * @for Date"," * @method listOfDatesInMonth"," * @param oDate {Date} The date corresponding to the month for"," * which a list of dates is required."," * @return {Array} An `Array` of `Date`s from a given month."," */ "," listOfDatesInMonth : function (oDate) {"," if (!this.isValidDate(oDate)) {"," return [];"," }",""," var daysInMonth = this.daysInMonth(oDate),"," year = oDate.getFullYear(),"," month = oDate.getMonth(),"," output = [];",""," for (var day = 1; day <= daysInMonth; day++) {"," output.push(new Date(year, month, day, 12, 0, 0));"," }",""," return output;"," },",""," /**"," * Takes a native JavaScript Date and returns the number of days"," * in the month that the given date belongs to."," * @for Date"," * @method daysInMonth"," * @param oDate {Date} Date in the month for which the number "," * of days is desired."," * @return {Number} A number (either 28, 29, 30 or 31) of days "," * in the given month."," */"," daysInMonth : function (oDate) {"," if (!this.isValidDate(oDate)) {"," return 0;"," }"," "," var mon = oDate.getMonth();"," var lengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];",""," if (mon != 1) {"," return lengths[mon];"," }"," else {",""," var year = oDate.getFullYear();"," if (year%400 === 0) {"," return 29;"," } "," else if (year%100 === 0) {"," return 28;"," }"," else if (year%4 === 0) {"," return 29;"," }"," else {"," return 28;"," }"," } "," }","","});","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/datatype-date-math/datatype-date-math.js"].code=["YUI.add('datatype-date-math', function (Y, NAME) {","","/**"," * Date Math submodule."," *"," * @module datatype-date"," * @submodule datatype-date-math"," * @for Date"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Date\"), {",""," /**"," * Checks whether a native JavaScript Date contains a valid value."," * @for Date"," * @method isValidDate"," * @param oDate {Date} Date in the month for which the number of days is desired."," * @return {Boolean} True if the date argument contains a valid value."," */"," isValidDate : function (oDate) {"," if(LANG.isDate(oDate) && (isFinite(oDate)) && (oDate != \"Invalid Date\") && !isNaN(oDate) && (oDate != null)) {"," return true;"," }"," else {"," return false;"," }"," },",""," /**"," * Checks whether two dates correspond to the same date and time."," * @for Date"," * @method areEqual"," * @param aDate {Date} The first date to compare."," * @param bDate {Date} The second date to compare."," * @return {Boolean} True if the two dates correspond to the same"," * date and time."," */ "," areEqual : function (aDate, bDate) {"," return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() == bDate.getTime())); "," },",""," /**"," * Checks whether the first date comes later than the second."," * @for Date"," * @method isGreater"," * @param aDate {Date} The first date to compare."," * @param bDate {Date} The second date to compare."," * @return {Boolean} True if the first date is later than the second."," */ "," isGreater : function (aDate, bDate) {"," return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() > bDate.getTime()));"," },",""," /**"," * Checks whether the first date comes later than or is the same as"," * the second."," * @for Date"," * @method isGreaterOrEqual"," * @param aDate {Date} The first date to compare."," * @param bDate {Date} The second date to compare."," * @return {Boolean} True if the first date is later than or "," * the same as the second."," */ "," isGreaterOrEqual : function (aDate, bDate) {"," return (this.isValidDate(aDate) && this.isValidDate(bDate) && (aDate.getTime() >= bDate.getTime()));"," },","",""," /**"," * Checks whether the date is between two other given dates."," * @for Date"," * @method isInRange"," * @param aDate {Date} The date to check"," * @param bDate {Date} Lower bound of the range."," * @param cDate {Date} Higher bound of the range."," * @return {Boolean} True if the date is between the two other given dates."," */ "," isInRange : function (aDate, bDate, cDate) {"," return (this.isGreaterOrEqual(aDate, bDate) && this.isGreaterOrEqual(cDate, aDate));"," },",""," /**"," * Adds a specified number of days to the given date."," * @for Date"," * @method addDays"," * @param oDate {Date} The date to add days to."," * @param numMonths {Number} The number of days to add (can be negative)"," * @return {Date} A new Date with the specified number of days"," * added to the original date."," */ "," addDays : function (oDate, numDays) {"," return new Date(oDate.getTime() + 86400000*numDays);"," },","",""," /**"," * Adds a specified number of months to the given date."," * @for Date"," * @method addMonths"," * @param oDate {Date} The date to add months to."," * @param numMonths {Number} The number of months to add (can be negative)"," * @return {Date} A new Date with the specified number of months"," * added to the original date."," */ "," addMonths : function (oDate, numMonths) {"," var newYear = oDate.getFullYear();"," var newMonth = oDate.getMonth() + numMonths; "," "," newYear = Math.floor(newYear + newMonth / 12);"," newMonth = (newMonth % 12 + 12) % 12;"," "," var newDate = new Date (oDate.getTime());"," newDate.setFullYear(newYear);"," newDate.setMonth(newMonth);"," "," return newDate;"," },",""," /**"," * Adds a specified number of years to the given date."," * @for Date"," * @method addYears"," * @param oDate {Date} The date to add years to."," * @param numYears {Number} The number of years to add (can be negative)"," * @return {Date} A new Date with the specified number of years"," * added to the original date."," */ "," addYears : function (oDate, numYears) {"," var newYear = oDate.getFullYear() + numYears;"," var newDate = new Date(oDate.getTime());"," "," newDate.setFullYear(newYear);"," return newDate;"," },",""," /**"," * Lists all dates in a given month."," * @for Date"," * @method listOfDatesInMonth"," * @param oDate {Date} The date corresponding to the month for"," * which a list of dates is required."," * @return {Array} An `Array` of `Date`s from a given month."," */ "," listOfDatesInMonth : function (oDate) {"," if (!this.isValidDate(oDate)) {"," return [];"," }",""," var daysInMonth = this.daysInMonth(oDate),"," year = oDate.getFullYear(),"," month = oDate.getMonth(),"," output = [];",""," for (var day = 1; day <= daysInMonth; day++) {"," output.push(new Date(year, month, day, 12, 0, 0));"," }",""," return output;"," },",""," /**"," * Takes a native JavaScript Date and returns the number of days"," * in the month that the given date belongs to."," * @for Date"," * @method daysInMonth"," * @param oDate {Date} Date in the month for which the number "," * of days is desired."," * @return {Number} A number (either 28, 29, 30 or 31) of days "," * in the given month."," */"," daysInMonth : function (oDate) {"," if (!this.isValidDate(oDate)) {"," return 0;"," }"," "," var mon = oDate.getMonth();"," var lengths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];",""," if (mon != 1) {"," return lengths[mon];"," }"," else {",""," var year = oDate.getFullYear();"," if (year%400 === 0) {"," return 29;"," } "," else if (year%100 === 0) {"," return 28;"," }"," else if (year%4 === 0) {"," return 29;"," }"," else {"," return 28;"," }"," } "," }","","});","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/datatype-date-math/datatype-date-math.js"].lines = {"1":0,"10":0,"12":0,"22":0,"23":0,"26":0,"40":0,"52":0,"66":0,"80":0,"93":0,"107":0,"108":0,"110":0,"111":0,"113":0,"114":0,"115":0,"117":0,"130":0,"131":0,"133":0,"134":0,"146":0,"147":0,"150":0,"155":0,"156":0,"159":0,"173":0,"174":0,"177":0,"178":0,"180":0,"181":0,"185":0,"186":0,"187":0,"189":0,"190":0,"192":0,"193":0,"196":0,"203":0,"204":0}; _yuitest_coverage["build/datatype-date-math/datatype-date-math.js"].functions = {"isValidDate:21":0,"areEqual:39":0,"isGreater:51":0,"isGreaterOrEqual:65":0,"isInRange:79":0,"addDays:92":0,"addMonths:106":0,"addYears:129":0,"listOfDatesInMonth:145":0,"daysInMonth:172":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatype-date-math/datatype-date-math.js"].coveredLines = 45;@@ -299,4 +299,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/datatype-date-math/datatype-date-math-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -211,4 +211,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/datatype-date-math/datatype-date-math-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-date-math",function(e,t){var n=e.Lang;e.mix(e.namespace("Date"),{isValidDate:function(e){return n.isDate(e)&&isFinite(e)&&e!="Invalid Date"&&!isNaN(e)&&e!=null?!0:!1},areEqual:function(e,t){return this.isValidDate(e)&&this.isValidDate(t)&&e.getTime()==t.getTime()},isGreater:function(e,t){return this.isValidDate(e)&&this.isValidDate(t)&&e.getTime()>t.getTime()},isGreaterOrEqual:function(e,t){return this.isValidDate(e)&&this.isValidDate(t)&&e.getTime()>=t.getTime()},isInRange:function(e,t,n){return this.isGreaterOrEqual(e,t)&&this.isGreaterOrEqual(n,e)},addDays:function(e,t){return new Date(e.getTime()+864e5*t)},addMonths:function(e,t){var n=e.getFullYear(),r=e.getMonth()+t;n=Math.floor(n+r/12),r=(r%12+12)%12;var i=new Date(e.getTime());return i.setFullYear(n),i.setMonth(r),i},addYears:function(e,t){var n=e.getFullYear()+t,r=new Date(e.getTime());return r.setFullYear(n),r},listOfDatesInMonth:function(e){if(!this.isValidDate(e))return[];var t=this.daysInMonth(e),n=e.getFullYear(),r=e.getMonth(),i=[];for(var s=1;s<=t;s++)i.push(new Date(n,r,s,12,0,0));return i},daysInMonth:function(e){if(!this.isValidDate(e))return 0;var t=e.getMonth(),n=[31,28,31,30,31,30,31,31,30,31,30,31];if(t!=1)return n[t];var r=e.getFullYear();return r%400===0?29:r%100===0?28:r%4===0?29:28}}),e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.2",{requires:["yui-base"]});+YUI.add("datatype-date-math",function(e,t){var n=e.Lang;e.mix(e.namespace("Date"),{isValidDate:function(e){return n.isDate(e)&&isFinite(e)&&e!="Invalid Date"&&!isNaN(e)&&e!=null?!0:!1},areEqual:function(e,t){return this.isValidDate(e)&&this.isValidDate(t)&&e.getTime()==t.getTime()},isGreater:function(e,t){return this.isValidDate(e)&&this.isValidDate(t)&&e.getTime()>t.getTime()},isGreaterOrEqual:function(e,t){return this.isValidDate(e)&&this.isValidDate(t)&&e.getTime()>=t.getTime()},isInRange:function(e,t,n){return this.isGreaterOrEqual(e,t)&&this.isGreaterOrEqual(n,e)},addDays:function(e,t){return new Date(e.getTime()+864e5*t)},addMonths:function(e,t){var n=e.getFullYear(),r=e.getMonth()+t;n=Math.floor(n+r/12),r=(r%12+12)%12;var i=new Date(e.getTime());return i.setFullYear(n),i.setMonth(r),i},addYears:function(e,t){var n=e.getFullYear()+t,r=new Date(e.getTime());return r.setFullYear(n),r},listOfDatesInMonth:function(e){if(!this.isValidDate(e))return[];var t=this.daysInMonth(e),n=e.getFullYear(),r=e.getMonth(),i=[];for(var s=1;s<=t;s++)i.push(new Date(n,r,s,12,0,0));return i},daysInMonth:function(e){if(!this.isValidDate(e))return 0;var t=e.getMonth(),n=[31,28,31,30,31,30,31,31,30,31,30,31];if(t!=1)return n[t];var r=e.getFullYear();return r%400===0?29:r%100===0?28:r%4===0?29:28}}),e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.3",{requires:["yui-base"]});
bundle/datatype-date-math/datatype-date-math.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -210,4 +210,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/datatype-date-parse/datatype-date-parse-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatype-date-parse/datatype-date-parse.js", code: [] };-_yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].code=["YUI.add('datatype-date-parse', function (Y, NAME) {","","/**"," * Parse number submodule."," *"," * @module datatype-date"," * @submodule datatype-date-parse"," * @for Date"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Date\"), {"," /**"," * Converts data to type Date."," *"," * @method parse"," * @param data {String | Number} Data to convert. Values supported by the Date constructor are supported."," * @return {Date} A Date, or null."," */"," parse: function(data) {"," var date = null;",""," //Convert to date"," if(!(LANG.isDate(data))) {"," date = new Date(data);"," }"," else {"," return date;"," }",""," // Validate"," if(LANG.isDate(date) && (date != \"Invalid Date\") && !isNaN(date)) { // Workaround for bug 2527965"," return date;"," }"," else {"," return null;"," }"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").date = Y.Date.parse;","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.7.2');"];+_yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].code=["YUI.add('datatype-date-parse', function (Y, NAME) {","","/**"," * Parse number submodule."," *"," * @module datatype-date"," * @submodule datatype-date-parse"," * @for Date"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Date\"), {"," /**"," * Converts data to type Date."," *"," * @method parse"," * @param data {String | Number} Data to convert. Values supported by the Date constructor are supported."," * @return {Date} A Date, or null."," */"," parse: function(data) {"," var date = null;",""," //Convert to date"," if(!(LANG.isDate(data))) {"," date = new Date(data);"," }"," else {"," return date;"," }",""," // Validate"," if(LANG.isDate(date) && (date != \"Invalid Date\") && !isNaN(date)) { // Workaround for bug 2527965"," return date;"," }"," else {"," return null;"," }"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").date = Y.Date.parse;","","Y.namespace(\"DataType\");","Y.DataType.Date = Y.Date;","","","}, '3.7.3');"]; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].lines = {"1":0,"10":0,"12":0,"21":0,"24":0,"25":0,"28":0,"32":0,"33":0,"36":0,"42":0,"44":0,"45":0}; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].functions = {"parse:20":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatype-date-parse/datatype-date-parse.js"].coveredLines = 13;@@ -99,4 +99,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-date-parse/datatype-date-parse-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -52,4 +52,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-date-parse/datatype-date-parse-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-date-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("Date"),{parse:function(e){var t=null;return n.isDate(e)?t:(t=new Date(e),n.isDate(t)&&t!="Invalid Date"&&!isNaN(t)?t:null)}}),e.namespace("Parsers").date=e.Date.parse,e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.2");+YUI.add("datatype-date-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("Date"),{parse:function(e){var t=null;return n.isDate(e)?t:(t=new Date(e),n.isDate(t)&&t!="Invalid Date"&&!isNaN(t)?t:null)}}),e.namespace("Parsers").date=e.Date.parse,e.namespace("DataType"),e.DataType.Date=e.Date},"3.7.3");
bundle/datatype-date-parse/datatype-date-parse.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -51,4 +51,4 @@ Y.DataType.Date = Y.Date; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-number-format/datatype-number-format-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatype-number-format/datatype-number-format.js", code: [] };-_yuitest_coverage["build/datatype-number-format/datatype-number-format.js"].code=["YUI.add('datatype-number-format', function (Y, NAME) {","","/**"," * The Number Utility provides type-conversion and string-formatting"," * convenience methods for Numbers."," *"," * @module datatype-number"," * @main datatype-number"," */","","/**"," * Format number submodule."," *"," * @module datatype-number"," * @submodule datatype-number-format"," */"," ","/**"," * Number provides a set of utility functions to operate against Number objects."," *"," * @class Number"," * @static"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Number\"), {"," /**"," * Takes a Number and formats to string for display to user."," *"," * @method format"," * @param data {Number} Number."," * @param config {Object} (Optional) Optional configuration values:"," * <dl>"," * <dt>prefix {HTML}</dd>"," * <dd>String prepended before each number, like a currency designator \"$\"</dd>"," * <dt>decimalPlaces {Number}</dd>"," * <dd>Number of decimal places to round. Must be a number 0 to 20.</dd>"," * <dt>decimalSeparator {HTML}</dd>"," * <dd>Decimal separator</dd>"," * <dt>thousandsSeparator {HTML}</dd>"," * <dd>Thousands separator</dd>"," * <dt>suffix {HTML}</dd>"," * <dd>String appended after each number, like \" items\" (note the space)</dd>"," * </dl>"," * @return {HTML} Formatted number for display. Note, the following values"," * return as \"\": null, undefined, NaN, \"\"."," */"," format: function(data, config) {"," if(LANG.isNumber(data)) {"," config = config || {};",""," var isNeg = (data < 0),"," output = data + \"\","," decPlaces = config.decimalPlaces,"," decSep = config.decimalSeparator || \".\","," thouSep = config.thousandsSeparator,"," decIndex,"," newOutput, count, i;",""," // Decimal precision"," if(LANG.isNumber(decPlaces) && (decPlaces >= 0) && (decPlaces <= 20)) {"," // Round to the correct decimal place"," output = data.toFixed(decPlaces);"," }",""," // Decimal separator"," if(decSep !== \".\"){"," output = output.replace(\".\", decSep);"," }",""," // Add the thousands separator"," if(thouSep) {"," // Find the dot or where it would be"," decIndex = output.lastIndexOf(decSep);"," decIndex = (decIndex > -1) ? decIndex : output.length;"," // Start with the dot and everything to the right"," newOutput = output.substring(decIndex);"," // Working left, every third time add a separator, every time add a digit"," for (count = 0, i=decIndex; i>0; i--) {"," if ((count%3 === 0) && (i !== decIndex) && (!isNeg || (i > 1))) {"," newOutput = thouSep + newOutput;"," }"," newOutput = output.charAt(i-1) + newOutput;"," count++;"," }"," output = newOutput;"," }",""," // Prepend prefix"," output = (config.prefix) ? config.prefix + output : output;",""," // Append suffix"," output = (config.suffix) ? output + config.suffix : output;",""," return output;"," }"," // Not a Number, just return as string"," else {"," return (LANG.isValue(data) && data.toString) ? data.toString() : \"\";"," }"," }","});","","Y.namespace(\"DataType\");","Y.DataType.Number = Y.Number;","","","}, '3.7.2');"];+_yuitest_coverage["build/datatype-number-format/datatype-number-format.js"].code=["YUI.add('datatype-number-format', function (Y, NAME) {","","/**"," * The Number Utility provides type-conversion and string-formatting"," * convenience methods for Numbers."," *"," * @module datatype-number"," * @main datatype-number"," */","","/**"," * Format number submodule."," *"," * @module datatype-number"," * @submodule datatype-number-format"," */"," ","/**"," * Number provides a set of utility functions to operate against Number objects."," *"," * @class Number"," * @static"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Number\"), {"," /**"," * Takes a Number and formats to string for display to user."," *"," * @method format"," * @param data {Number} Number."," * @param config {Object} (Optional) Optional configuration values:"," * <dl>"," * <dt>prefix {HTML}</dd>"," * <dd>String prepended before each number, like a currency designator \"$\"</dd>"," * <dt>decimalPlaces {Number}</dd>"," * <dd>Number of decimal places to round. Must be a number 0 to 20.</dd>"," * <dt>decimalSeparator {HTML}</dd>"," * <dd>Decimal separator</dd>"," * <dt>thousandsSeparator {HTML}</dd>"," * <dd>Thousands separator</dd>"," * <dt>suffix {HTML}</dd>"," * <dd>String appended after each number, like \" items\" (note the space)</dd>"," * </dl>"," * @return {HTML} Formatted number for display. Note, the following values"," * return as \"\": null, undefined, NaN, \"\"."," */"," format: function(data, config) {"," if(LANG.isNumber(data)) {"," config = config || {};",""," var isNeg = (data < 0),"," output = data + \"\","," decPlaces = config.decimalPlaces,"," decSep = config.decimalSeparator || \".\","," thouSep = config.thousandsSeparator,"," decIndex,"," newOutput, count, i;",""," // Decimal precision"," if(LANG.isNumber(decPlaces) && (decPlaces >= 0) && (decPlaces <= 20)) {"," // Round to the correct decimal place"," output = data.toFixed(decPlaces);"," }",""," // Decimal separator"," if(decSep !== \".\"){"," output = output.replace(\".\", decSep);"," }",""," // Add the thousands separator"," if(thouSep) {"," // Find the dot or where it would be"," decIndex = output.lastIndexOf(decSep);"," decIndex = (decIndex > -1) ? decIndex : output.length;"," // Start with the dot and everything to the right"," newOutput = output.substring(decIndex);"," // Working left, every third time add a separator, every time add a digit"," for (count = 0, i=decIndex; i>0; i--) {"," if ((count%3 === 0) && (i !== decIndex) && (!isNeg || (i > 1))) {"," newOutput = thouSep + newOutput;"," }"," newOutput = output.charAt(i-1) + newOutput;"," count++;"," }"," output = newOutput;"," }",""," // Prepend prefix"," output = (config.prefix) ? config.prefix + output : output;",""," // Append suffix"," output = (config.suffix) ? output + config.suffix : output;",""," return output;"," }"," // Not a Number, just return as string"," else {"," return (LANG.isValue(data) && data.toString) ? data.toString() : \"\";"," }"," }","});","","Y.namespace(\"DataType\");","Y.DataType.Number = Y.Number;","","","}, '3.7.3');"]; _yuitest_coverage["build/datatype-number-format/datatype-number-format.js"].lines = {"1":0,"24":0,"26":0,"49":0,"50":0,"52":0,"61":0,"63":0,"67":0,"68":0,"72":0,"74":0,"75":0,"77":0,"79":0,"80":0,"81":0,"83":0,"84":0,"86":0,"90":0,"93":0,"95":0,"99":0,"104":0,"105":0}; _yuitest_coverage["build/datatype-number-format/datatype-number-format.js"].functions = {"format:48":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatype-number-format/datatype-number-format.js"].coveredLines = 26;@@ -172,4 +172,4 @@ Y.DataType.Number = Y.Number; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-number-format/datatype-number-format-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -112,4 +112,4 @@ Y.DataType.Number = Y.Number; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-number-format/datatype-number-format-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-number-format",function(e,t){var n=e.Lang;e.mix(e.namespace("Number"),{format:function(e,t){if(n.isNumber(e)){t=t||{};var r=e<0,i=e+"",s=t.decimalPlaces,o=t.decimalSeparator||".",u=t.thousandsSeparator,a,f,l,c;n.isNumber(s)&&s>=0&&s<=20&&(i=e.toFixed(s)),o!=="."&&(i=i.replace(".",o));if(u){a=i.lastIndexOf(o),a=a>-1?a:i.length,f=i.substring(a);for(l=0,c=a;c>0;c--)l%3===0&&c!==a&&(!r||c>1)&&(f=u+f),f=i.charAt(c-1)+f,l++;i=f}return i=t.prefix?t.prefix+i:i,i=t.suffix?i+t.suffix:i,i}return n.isValue(e)&&e.toString?e.toString():""}}),e.namespace("DataType"),e.DataType.Number=e.Number},"3.7.2");+YUI.add("datatype-number-format",function(e,t){var n=e.Lang;e.mix(e.namespace("Number"),{format:function(e,t){if(n.isNumber(e)){t=t||{};var r=e<0,i=e+"",s=t.decimalPlaces,o=t.decimalSeparator||".",u=t.thousandsSeparator,a,f,l,c;n.isNumber(s)&&s>=0&&s<=20&&(i=e.toFixed(s)),o!=="."&&(i=i.replace(".",o));if(u){a=i.lastIndexOf(o),a=a>-1?a:i.length,f=i.substring(a);for(l=0,c=a;c>0;c--)l%3===0&&c!==a&&(!r||c>1)&&(f=u+f),f=i.charAt(c-1)+f,l++;i=f}return i=t.prefix?t.prefix+i:i,i=t.suffix?i+t.suffix:i,i}return n.isValue(e)&&e.toString?e.toString():""}}),e.namespace("DataType"),e.DataType.Number=e.Number},"3.7.3");
bundle/datatype-number-format/datatype-number-format.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -111,4 +111,4 @@ Y.DataType.Number = Y.Number; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-number-parse/datatype-number-parse-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/datatype-number-parse/datatype-number-parse.js", code: [] };-_yuitest_coverage["build/datatype-number-parse/datatype-number-parse.js"].code=["YUI.add('datatype-number-parse', function (Y, NAME) {","","/**"," * Parse number submodule."," *"," * @module datatype-number"," * @submodule datatype-number-parse"," * @for Number"," */","","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Number\"), {"," /**"," * Converts data to type Number."," *"," * @method parse"," * @param data {String | Number | Boolean} Data to convert. The following"," * values return as null: null, undefined, NaN, \"\"."," * @return {Number} A number, or null."," */"," parse: function(data) {"," var number = (data === null) ? data : +data;"," if(LANG.isNumber(number)) {"," return number;"," }"," else {"," return null;"," }"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").number = Y.Number.parse;","Y.namespace(\"DataType\");","Y.DataType.Number = Y.Number;","","","}, '3.7.2');"];+_yuitest_coverage["build/datatype-number-parse/datatype-number-parse.js"].code=["YUI.add('datatype-number-parse', function (Y, NAME) {","","/**"," * Parse number submodule."," *"," * @module datatype-number"," * @submodule datatype-number-parse"," * @for Number"," */","","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"Number\"), {"," /**"," * Converts data to type Number."," *"," * @method parse"," * @param data {String | Number | Boolean} Data to convert. The following"," * values return as null: null, undefined, NaN, \"\"."," * @return {Number} A number, or null."," */"," parse: function(data) {"," var number = (data === null) ? data : +data;"," if(LANG.isNumber(number)) {"," return number;"," }"," else {"," return null;"," }"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").number = Y.Number.parse;","Y.namespace(\"DataType\");","Y.DataType.Number = Y.Number;","","","}, '3.7.3');"]; _yuitest_coverage["build/datatype-number-parse/datatype-number-parse.js"].lines = {"1":0,"11":0,"13":0,"23":0,"24":0,"25":0,"28":0,"34":0,"35":0,"36":0}; _yuitest_coverage["build/datatype-number-parse/datatype-number-parse.js"].functions = {"parse:22":0,"(anonymous 1):1":0}; _yuitest_coverage["build/datatype-number-parse/datatype-number-parse.js"].coveredLines = 10;@@ -87,4 +87,4 @@ Y.DataType.Number = Y.Number; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-number-parse/datatype-number-parse-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -43,4 +43,4 @@ Y.DataType.Number = Y.Number; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-number-parse/datatype-number-parse-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-number-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("Number"),{parse:function(e){var t=e===null?e:+e;return n.isNumber(t)?t:null}}),e.namespace("Parsers").number=e.Number.parse,e.namespace("DataType"),e.DataType.Number=e.Number},"3.7.2");+YUI.add("datatype-number-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("Number"),{parse:function(e){var t=e===null?e:+e;return n.isNumber(t)?t:null}}),e.namespace("Parsers").number=e.Number.parse,e.namespace("DataType"),e.DataType.Number=e.Number},"3.7.3");
bundle/datatype-number-parse/datatype-number-parse.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -42,4 +42,4 @@ Y.DataType.Number = Y.Number; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-xml-format/datatype-xml-format-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/datatype-xml-format/datatype-xml-format.js", code: [] };-_yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].code=["YUI.add('datatype-xml-format', function (Y, NAME) {","","/**"," * The Number Utility provides type-conversion and string-formatting"," * convenience methods for Numbers."," *"," * @module datatype-xml"," * @submodule datatype-xml-format"," */","","/**"," * XML provides a set of utility functions to operate against XML documents."," *"," * @class XML"," * @static"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"XML\"), {"," /**"," * Converts data to type XMLDocument."," *"," * @method format"," * @param data {XMLDoc} Data to convert."," * @return {String} String."," */"," format: function(data) {"," try {"," if(!LANG.isUndefined(XMLSerializer)) {"," return (new XMLSerializer()).serializeToString(data);"," }"," }"," catch(e) {"," if(data && data.xml) {"," return data.xml;"," }"," else {"," return (LANG.isValue(data) && data.toString) ? data.toString() : \"\";"," }"," }"," }","});","","Y.namespace(\"DataType\");","Y.DataType.XML = Y.XML;","","","}, '3.7.2');"];-_yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].lines = {"1":0,"17":0,"19":0,"28":0,"29":0,"30":0,"34":0,"35":0,"38":0,"44":0,"45":0};+_yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].code=["YUI.add('datatype-xml-format', function (Y, NAME) {","","/**"," * The Number Utility provides type-conversion and string-formatting"," * convenience methods for Numbers."," *"," * @module datatype-xml"," * @submodule datatype-xml-format"," */","","/**"," * XML provides a set of utility functions to operate against XML documents."," *"," * @class XML"," * @static"," */","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"XML\"), {"," /**"," * Converts data to type XMLDocument."," *"," * @method format"," * @param data {XMLDoc} Data to convert."," * @return {String} String."," */"," format: function(data) {"," try {"," if(!LANG.isUndefined(data.getXml)) {"," return data.getXml();"," }",""," if(!LANG.isUndefined(XMLSerializer)) {"," return (new XMLSerializer()).serializeToString(data);"," }"," }"," catch(e) {"," if(data && data.xml) {"," return data.xml;"," }"," else {"," return (LANG.isValue(data) && data.toString) ? data.toString() : \"\";"," }"," }"," }","});","","Y.namespace(\"DataType\");","Y.DataType.XML = Y.XML;","","","}, '3.7.3');"];+_yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].lines = {"1":0,"17":0,"19":0,"28":0,"29":0,"30":0,"33":0,"34":0,"38":0,"39":0,"42":0,"48":0,"49":0}; _yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].functions = {"format:27":0,"(anonymous 1):1":0};-_yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].coveredLines = 11;+_yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].coveredLines = 13; _yuitest_coverage["build/datatype-xml-format/datatype-xml-format.js"].coveredFunctions = 2; _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 1); YUI.add('datatype-xml-format', function (Y, NAME) {@@ -72,29 +72,35 @@ _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 28); try { _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 29);-if(!LANG.isUndefined(XMLSerializer)) {+if(!LANG.isUndefined(data.getXml)) { _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 30);+return data.getXml();+ }++ _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 33);+if(!LANG.isUndefined(XMLSerializer)) {+ _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 34); return (new XMLSerializer()).serializeToString(data); } } catch(e) {- _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 34);+ _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 38); if(data && data.xml) {- _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 35);+ _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 39); return data.xml; } else {- _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 38);+ _yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 42); return (LANG.isValue(data) && data.toString) ? data.toString() : ""; } } } }); -_yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 44);+_yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 48); Y.namespace("DataType");-_yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 45);+_yuitest_coverline("build/datatype-xml-format/datatype-xml-format.js", 49); Y.DataType.XML = Y.XML; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-xml-format/datatype-xml-format-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,6 +32,10 @@ */ format: function(data) { try {+ if(!LANG.isUndefined(data.getXml)) {+ return data.getXml();+ }+ if(!LANG.isUndefined(XMLSerializer)) { return (new XMLSerializer()).serializeToString(data); }@@ -52,4 +56,4 @@ Y.DataType.XML = Y.XML; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-xml-format/datatype-xml-format-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-xml-format",function(e,t){var n=e.Lang;e.mix(e.namespace("XML"),{format:function(e){try{if(!n.isUndefined(XMLSerializer))return(new XMLSerializer).serializeToString(e)}catch(t){return e&&e.xml?e.xml:n.isValue(e)&&e.toString?e.toString():""}}}),e.namespace("DataType"),e.DataType.XML=e.XML},"3.7.2");+YUI.add("datatype-xml-format",function(e,t){var n=e.Lang;e.mix(e.namespace("XML"),{format:function(e){try{if(!n.isUndefined(e.getXml))return e.getXml();if(!n.isUndefined(XMLSerializer))return(new XMLSerializer).serializeToString(e)}catch(t){return e&&e.xml?e.xml:n.isValue(e)&&e.toString?e.toString():""}}}),e.namespace("DataType"),e.DataType.XML=e.XML},"3.7.3");
bundle/datatype-xml-format/datatype-xml-format.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,6 +32,10 @@ */ format: function(data) { try {+ if(!LANG.isUndefined(data.getXml)) {+ return data.getXml();+ }+ if(!LANG.isUndefined(XMLSerializer)) { return (new XMLSerializer()).serializeToString(data); }@@ -51,4 +55,4 @@ Y.DataType.XML = Y.XML; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-xml-parse/datatype-xml-parse-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/datatype-xml-parse/datatype-xml-parse.js", code: [] };-_yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].code=["YUI.add('datatype-xml-parse', function (Y, NAME) {","","/**"," * Parse XML submodule."," *"," * @module datatype-xml"," * @submodule datatype-xml-parse"," * @for XML"," */","","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"XML\"), {"," /**"," * Converts data to type XMLDocument."," *"," * @method parse"," * @param data {String} Data to convert."," * @return {XMLDoc} XML Document."," */"," parse: function(data) {"," var xmlDoc = null;"," if(LANG.isString(data)) {"," try {"," if(!LANG.isUndefined(ActiveXObject)) {"," xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");"," xmlDoc.async = false;"," xmlDoc.loadXML(data);"," }"," }"," catch(ee) {"," try {"," if(!LANG.isUndefined(DOMParser)) {"," xmlDoc = new DOMParser().parseFromString(data, \"text/xml\");"," }"," }"," catch(e) {"," }"," }"," }"," "," if( (LANG.isNull(xmlDoc)) || (LANG.isNull(xmlDoc.documentElement)) || (xmlDoc.documentElement.nodeName === \"parsererror\") ) {"," }"," "," return xmlDoc;"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").xml = Y.XML.parse;","","Y.namespace(\"DataType\");","Y.DataType.XML = Y.XML;","","","}, '3.7.2');"];-_yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].lines = {"1":0,"11":0,"13":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"32":0,"33":0,"34":0,"42":0,"45":0,"50":0,"52":0,"53":0};+_yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].code=["YUI.add('datatype-xml-parse', function (Y, NAME) {","","/**"," * Parse XML submodule."," *"," * @module datatype-xml"," * @submodule datatype-xml-parse"," * @for XML"," */","","var LANG = Y.Lang;","","Y.mix(Y.namespace(\"XML\"), {"," /**"," * Converts data to type XMLDocument."," *"," * @method parse"," * @param data {String} Data to convert."," * @return {XMLDoc} XML Document."," */"," parse: function(data) {"," var xmlDoc = null;"," if(LANG.isString(data)) {"," try {"," if(!LANG.isUndefined(ActiveXObject)) {"," xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");"," xmlDoc.async = false;"," xmlDoc.loadXML(data);"," }"," }"," catch(ee) {"," try {"," if (!LANG.isUndefined(DOMParser)) {"," xmlDoc = new DOMParser().parseFromString(data, \"text/xml\");"," }"," if (!LANG.isUndefined(Windows.Data.Xml.Dom)) {"," xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();"," xmlDoc.loadXml(data);"," }"," }"," catch(e) {"," }"," }"," }"," "," if( (LANG.isNull(xmlDoc)) || (LANG.isNull(xmlDoc.documentElement)) || (xmlDoc.documentElement.nodeName === \"parsererror\") ) {"," }"," "," return xmlDoc;"," }","});","","// Add Parsers shortcut","Y.namespace(\"Parsers\").xml = Y.XML.parse;","","Y.namespace(\"DataType\");","Y.DataType.XML = Y.XML;","","","}, '3.7.3');"];+_yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].lines = {"1":0,"11":0,"13":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"32":0,"33":0,"34":0,"36":0,"37":0,"38":0,"46":0,"49":0,"54":0,"56":0,"57":0}; _yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].functions = {"parse:21":0,"(anonymous 1):1":0};-_yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].coveredLines = 18;+_yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].coveredLines = 21; _yuitest_coverage["build/datatype-xml-parse/datatype-xml-parse.js"].coveredFunctions = 2; _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 1); YUI.add('datatype-xml-parse', function (Y, NAME) {@@ -83,33 +83,40 @@ _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 32); try { _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 33);-if(!LANG.isUndefined(DOMParser)) {+if (!LANG.isUndefined(DOMParser)) { _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 34); xmlDoc = new DOMParser().parseFromString(data, "text/xml"); }+ _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 36);+if (!LANG.isUndefined(Windows.Data.Xml.Dom)) {+ _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 37);+xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();+ _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 38);+xmlDoc.loadXml(data);+ } } catch(e) { } } } - _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 42);+ _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 46); if( (LANG.isNull(xmlDoc)) || (LANG.isNull(xmlDoc.documentElement)) || (xmlDoc.documentElement.nodeName === "parsererror") ) { } - _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 45);+ _yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 49); return xmlDoc; } }); // Add Parsers shortcut-_yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 50);+_yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 54); Y.namespace("Parsers").xml = Y.XML.parse; -_yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 52);+_yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 56); Y.namespace("DataType");-_yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 53);+_yuitest_coverline("build/datatype-xml-parse/datatype-xml-parse.js", 57); Y.DataType.XML = Y.XML; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-xml-parse/datatype-xml-parse-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -36,13 +36,17 @@ } catch(ee) { try {- if(!LANG.isUndefined(DOMParser)) {+ if (!LANG.isUndefined(DOMParser)) { xmlDoc = new DOMParser().parseFromString(data, "text/xml"); }+ if (!LANG.isUndefined(Windows.Data.Xml.Dom)) {+ xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();+ xmlDoc.loadXml(data);+ } } catch(e) { }- Y.log(ee.message + " (Could not parse data to type XML Document)", "warn", "xml");+ Y.log(ee.message + " (Could not initialize the ActiveX control for XML parsing)", "warn", "xml"); } } @@ -61,4 +65,4 @@ Y.DataType.XML = Y.XML; -}, '3.7.2');+}, '3.7.3');
bundle/datatype-xml-parse/datatype-xml-parse-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("datatype-xml-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("XML"),{parse:function(e){var t=null;if(n.isString(e))try{n.isUndefined(ActiveXObject)||(t=new ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(e))}catch(r){try{n.isUndefined(DOMParser)||(t=(new DOMParser).parseFromString(e,"text/xml"))}catch(i){}}return n.isNull(t)||n.isNull(t.documentElement)||t.documentElement.nodeName==="parsererror",t}}),e.namespace("Parsers").xml=e.XML.parse,e.namespace("DataType"),e.DataType.XML=e.XML},"3.7.2");+YUI.add("datatype-xml-parse",function(e,t){var n=e.Lang;e.mix(e.namespace("XML"),{parse:function(e){var t=null;if(n.isString(e))try{n.isUndefined(ActiveXObject)||(t=new ActiveXObject("Microsoft.XMLDOM"),t.async=!1,t.loadXML(e))}catch(r){try{n.isUndefined(DOMParser)||(t=(new DOMParser).parseFromString(e,"text/xml")),n.isUndefined(Windows.Data.Xml.Dom)||(t=new Windows.Data.Xml.Dom.XmlDocument,t.loadXml(e))}catch(i){}}return n.isNull(t)||n.isNull(t.documentElement)||t.documentElement.nodeName==="parsererror",t}}),e.namespace("Parsers").xml=e.XML.parse,e.namespace("DataType"),e.DataType.XML=e.XML},"3.7.3");
bundle/datatype-xml-parse/datatype-xml-parse.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -36,9 +36,13 @@ } catch(ee) { try {- if(!LANG.isUndefined(DOMParser)) {+ if (!LANG.isUndefined(DOMParser)) { xmlDoc = new DOMParser().parseFromString(data, "text/xml"); }+ if (!LANG.isUndefined(Windows.Data.Xml.Dom)) {+ xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();+ xmlDoc.loadXml(data);+ } } catch(e) { }@@ -59,4 +63,4 @@ Y.DataType.XML = Y.XML; -}, '3.7.2');+}, '3.7.3');
bundle/dd-constrain/dd-constrain-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/dd-constrain/dd-constrain.js", code: [] };-_yuitest_coverage["build/dd-constrain/dd-constrain.js"].code=["YUI.add('dd-constrain', function (Y, NAME) {","",""," /**"," * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic."," * @module dd"," * @main dd"," * @submodule dd-constrain"," */"," /**"," * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints."," * @class DDConstrained"," * @extends Base"," * @constructor"," * @namespace Plugin"," */",""," var DRAG_NODE = 'dragNode',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," HOST = 'host',"," TICK_X_ARRAY = 'tickXArray',"," TICK_Y_ARRAY = 'tickYArray',"," DDM = Y.DD.DDM,"," TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',"," VIEW = 'view',"," proto = null,",""," /**"," * @event drag:tickAlignX"," * @description Fires when this node is aligned with the tickX value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_X = 'drag:tickAlignX',",""," /**"," * @event drag:tickAlignY"," * @description Fires when this node is aligned with the tickY value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_Y = 'drag:tickAlignY',",""," C = function(config) {"," this._lazyAddAttrs = false;"," C.superclass.constructor.apply(this, arguments);"," };",""," C.NAME = 'ddConstrained';"," /**"," * @property NS"," * @default con"," * @readonly"," * @protected"," * @static"," * @description The Constrained instance will be placed on the Drag instance under the con namespace."," * @type {String}","*/"," C.NS = 'con';",""," C.ATTRS = {"," host: {"," },"," /**"," * @attribute stickX"," * @description Stick the drag movement to the X-Axis. Default: false"," * @type Boolean"," */"," stickX: {"," value: false"," },"," /**"," * @attribute stickY"," * @description Stick the drag movement to the Y-Axis"," * @type Boolean"," */"," stickY: {"," value: false"," },"," /**"," * @attribute tickX"," * @description The X tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickX: {"," value: false"," },"," /**"," * @attribute tickY"," * @description The Y tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickY: {"," value: false"," },"," /**"," * @attribute tickXArray"," * @description An array of page coordinates to use as X ticks for drag movement."," * @type Array"," */"," tickXArray: {"," value: false"," },"," /**"," * @attribute tickYArray"," * @description An array of page coordinates to use as Y ticks for drag movement."," * @type Array"," */"," tickYArray: {"," value: false"," },"," /**"," * @attribute gutter"," * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @type String"," */"," gutter: {"," value: '0',"," setter: function(gutter) {"," return Y.DD.DDM.cssSizestoObject(gutter);"," }"," },"," /**"," * @attribute constrain"," * @description Will attempt to constrain the drag node to the boundaries. Arguments:<br>"," * 'view': Contrain to Viewport<br>"," * '#selector_string': Constrain to this node<br>"," * '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions"," * @type {String/Object/Node}"," */"," constrain: {"," value: VIEW,"," setter: function(con) {"," var node = Y.one(con);"," if (node) {"," con = node;"," }"," return con;"," }"," },"," /**"," * @deprecated"," * @attribute constrain2region"," * @description An Object Literal containing a valid region (top, right, bottom, left) of page positions to constrain the drag node to."," * @type Object"," */"," constrain2region: {"," setter: function(r) {"," return this.set('constrain', r);"," }"," },"," /**"," * @deprecated"," * @attribute constrain2node"," * @description Will attempt to constrain the drag node to the boundaries of this node."," * @type Object"," */"," constrain2node: {"," setter: function(n) {"," return this.set('constrain', Y.one(n));"," }"," },"," /**"," * @deprecated"," * @attribute constrain2view"," * @description Will attempt to constrain the drag node to the boundaries of the viewport region."," * @type Object"," */"," constrain2view: {"," setter: function(n) {"," return this.set('constrain', VIEW);"," }"," },"," /**"," * @attribute cacheRegion"," * @description Should the region be cached for performace. Default: true"," * @type Boolean"," */"," cacheRegion: {"," value: true"," }"," };",""," proto = {"," _lastTickXFired: null,"," _lastTickYFired: null,",""," initializer: function() {"," this._createEvents();",""," this._eventHandles = ["," this.get(HOST).on('drag:end', Y.bind(this._handleEnd, this)),"," this.get(HOST).on('drag:start', Y.bind(this._handleStart, this)),"," this.get(HOST).after('drag:align', Y.bind(this.align, this)),"," this.get(HOST).after('drag:drag', Y.bind(this.drag, this))"," ];"," },"," destructor: function() {"," Y.each("," this._eventHandles,"," function(handle, index) {"," handle.detach();"," }"," );",""," this._eventHandles.length = 0;"," },"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {"," var ev = ["," EV_TICK_ALIGN_X,"," EV_TICK_ALIGN_Y"," ];",""," Y.each(ev, function(v, k) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," bubbles: true,"," queuable: false,"," prefix: 'drag'"," });"," }, this);"," },"," /**"," * @private"," * @method _handleEnd"," * @description Fires on drag:end"," */"," _handleEnd: function() {"," this._lastTickYFired = null;"," this._lastTickXFired = null;"," },"," /**"," * @private"," * @method _handleStart"," * @description Fires on drag:start and clears the _regionCache"," */"," _handleStart: function() {"," this.resetCache();"," },"," /**"," * @private"," * @property _regionCache"," * @description Store a cache of the region that we are constraining to"," * @type Object"," */"," _regionCache: null,"," /**"," * @private"," * @method _cacheRegion"," * @description Get's the region and caches it, called from window.resize and when the cache is null"," */"," _cacheRegion: function() {"," this._regionCache = this.get('constrain').get('region');"," },"," /**"," * @method resetCache"," * @description Reset the internal region cache."," */"," resetCache: function() {"," this._regionCache = null;"," },"," /**"," * @private"," * @method _getConstraint"," * @description Standardizes the 'constraint' attribute"," */"," _getConstraint: function() {"," var con = this.get('constrain'),"," g = this.get('gutter'),"," region;",""," if (con) {"," if (con instanceof Y.Node) {"," if (!this._regionCache) {"," this._eventHandles.push(Y.on('resize', Y.bind(this._cacheRegion, this), Y.config.win));"," this._cacheRegion();"," }"," region = Y.clone(this._regionCache);"," if (!this.get('cacheRegion')) {"," this.resetCache();"," }"," } else if (Y.Lang.isObject(con)) {"," region = Y.clone(con);"," }"," }"," if (!con || !region) {"," con = VIEW;"," }"," if (con === VIEW) {"," region = this.get(HOST).get(DRAG_NODE).get('viewportRegion');"," }",""," Y.each(g, function(i, n) {"," if ((n == RIGHT) || (n == BOTTOM)) {"," region[n] -= i;"," } else {"," region[n] += i;"," }"," });"," return region;"," },",""," /**"," * @method getRegion"," * @description Get the active region: viewport, node, custom region"," * @param {Boolean} inc Include the node's height and width"," * @return {Object} The active region."," */"," getRegion: function(inc) {"," var r = {}, oh = null, ow = null,"," host = this.get(HOST);",""," r = this._getConstraint();",""," if (inc) {"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT);"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);"," r[RIGHT] = r[RIGHT] - ow;"," r[BOTTOM] = r[BOTTOM] - oh;"," }"," return r;"," },"," /**"," * @private"," * @method _checkRegion"," * @description Check if xy is inside a given region, if not change to it be inside."," * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region."," * @return {Array} The new XY that is inside the region"," */"," _checkRegion: function(_xy) {"," var oxy = _xy,"," r = this.getRegion(),"," host = this.get(HOST),"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT),"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);",""," if (oxy[1] > (r[BOTTOM] - oh)) {"," _xy[1] = (r[BOTTOM] - oh);"," }"," if (r[TOP] > oxy[1]) {"," _xy[1] = r[TOP];",""," }"," if (oxy[0] > (r[RIGHT] - ow)) {"," _xy[0] = (r[RIGHT] - ow);"," }"," if (r[LEFT] > oxy[0]) {"," _xy[0] = r[LEFT];"," }",""," return _xy;"," },"," /**"," * @method inRegion"," * @description Checks if the XY passed or the dragNode is inside the active region."," * @param {Array} xy Optional XY to check, if not supplied this.get('dragNode').getXY() is used."," * @return {Boolean} True if the XY is inside the region, false otherwise."," */"," inRegion: function(xy) {"," xy = xy || this.get(HOST).get(DRAG_NODE).getXY();",""," var _xy = this._checkRegion([xy[0], xy[1]]),"," inside = false;"," if ((xy[0] === _xy[0]) && (xy[1] === _xy[1])) {"," inside = true;"," }"," return inside;"," },"," /**"," * @method align"," * @description Modifies the Drag.actXY method from the after drag:align event. This is where the constraining happens."," */"," align: function() {"," var host = this.get(HOST),"," _xy = [host.actXY[0], host.actXY[1]],"," r = this.getRegion(true);",""," if (this.get('stickX')) {"," _xy[1] = (host.startXY[1] - host.deltaXY[1]);"," }"," if (this.get('stickY')) {"," _xy[0] = (host.startXY[0] - host.deltaXY[0]);"," }",""," if (r) {"," _xy = this._checkRegion(_xy);"," }",""," _xy = this._checkTicks(_xy, r);",""," host.actXY = _xy;"," },"," /**"," * @method drag"," * @description Fires after drag:drag. Handle the tickX and tickX align events."," */"," drag: function(event) {"," var host = this.get(HOST),"," xt = this.get('tickX'),"," yt = this.get('tickY'),"," _xy = [host.actXY[0], host.actXY[1]];",""," if ((Y.Lang.isNumber(xt) || this.get(TICK_X_ARRAY)) && (this._lastTickXFired !== _xy[0])) {"," this._tickAlignX();"," this._lastTickXFired = _xy[0];"," }",""," if ((Y.Lang.isNumber(yt) || this.get(TICK_Y_ARRAY)) && (this._lastTickYFired !== _xy[1])) {"," this._tickAlignY();"," this._lastTickYFired = _xy[1];"," }"," },"," /**"," * @private"," * @method _checkTicks"," * @description This method delegates the proper helper method for tick calculations"," * @param {Array} xy The XY coords for the Drag"," * @param {Object} r The optional region that we are bound to."," * @return {Array} The calced XY coords"," */"," _checkTicks: function(xy, r) {"," var host = this.get(HOST),"," lx = (host.startXY[0] - host.deltaXY[0]),"," ly = (host.startXY[1] - host.deltaXY[1]),"," xt = this.get('tickX'),"," yt = this.get('tickY');"," if (xt && !this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTicks(xy[0], lx, xt, r[LEFT], r[RIGHT]);"," }"," if (yt && !this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTicks(xy[1], ly, yt, r[TOP], r[BOTTOM]);"," }"," if (this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTickArray(xy[0], this.get(TICK_X_ARRAY), r[LEFT], r[RIGHT]);"," }"," if (this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTickArray(xy[1], this.get(TICK_Y_ARRAY), r[TOP], r[BOTTOM]);"," }",""," return xy;"," },"," /**"," * @private"," * @method _tickAlignX"," * @description Fires when the actXY[0] reach a new value respecting the tickX gap."," */"," _tickAlignX: function() {"," this.fire(EV_TICK_ALIGN_X);"," },"," /**"," * @private"," * @method _tickAlignY"," * @description Fires when the actXY[1] reach a new value respecting the tickY gap."," */"," _tickAlignY: function() {"," this.fire(EV_TICK_ALIGN_Y);"," }"," };",""," Y.namespace('Plugin');"," Y.extend(C, Y.Base, proto);"," Y.Plugin.DDConstrained = C;",""," Y.mix(DDM, {"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTicks"," * @description Helper method to calculate the tick offsets for a given position"," * @param {Number} pos The current X or Y position"," * @param {Number} start The start X or Y position"," * @param {Number} tick The X or Y tick increment"," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return {Number} The new position based on the tick calculation"," */"," _calcTicks: function(pos, start, tick, off1, off2) {"," var ix = ((pos - start) / tick),"," min = Math.floor(ix),"," max = Math.ceil(ix);"," if ((min !== 0) || (max !== 0)) {"," if ((ix >= min) && (ix <= max)) {"," pos = (start + (tick * min));"," if (off1 && off2) {"," if (pos < off1) {"," pos = (start + (tick * (min + 1)));"," }"," if (pos > off2) {"," pos = (start + (tick * (min - 1)));"," }"," }"," }"," }"," return pos;"," },"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTickArray"," * @description This method is used with the tickXArray and tickYArray config options"," * @param {Number} pos The current X or Y position"," * @param {Number} ticks The array containing our custom tick positions."," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return The tick position"," */"," _calcTickArray: function(pos, ticks, off1, off2) {"," var i = 0, len = ticks.length, next = 0,"," diff1, diff2, ret;",""," if (!ticks || (ticks.length === 0)) {"," return pos;"," }"," if (ticks[0] >= pos) {"," return ticks[0];"," }",""," for (i = 0; i < len; i++) {"," next = (i + 1);"," if (ticks[next] && ticks[next] >= pos) {"," diff1 = pos - ticks[i];"," diff2 = ticks[next] - pos;"," ret = (diff2 > diff1) ? ticks[i] : ticks[next];"," if (off1 && off2) {"," if (ret > off2) {"," if (ticks[i]) {"," ret = ticks[i];"," } else {"," ret = ticks[len - 1];"," }"," }"," }"," return ret;"," }",""," }"," return ticks[ticks.length - 1];"," }"," });","","","","}, '3.7.2', {\"requires\": [\"dd-drag\"]});"];-_yuitest_coverage["build/dd-constrain/dd-constrain.js"].lines = {"1":0,"18":0,"49":0,"50":0,"53":0,"63":0,"65":0,"124":0,"138":0,"139":0,"140":0,"142":0,"153":0,"164":0,"175":0,"188":0,"193":0,"195":0,"203":0,"206":0,"210":0,"218":0,"223":0,"224":0,"239":0,"240":0,"248":0,"263":0,"270":0,"278":0,"282":0,"283":0,"284":0,"285":0,"286":0,"288":0,"289":0,"290":0,"292":0,"293":0,"296":0,"297":0,"299":0,"300":0,"303":0,"304":0,"305":0,"307":0,"310":0,"320":0,"323":0,"325":0,"326":0,"327":0,"328":0,"329":0,"331":0,"341":0,"347":0,"348":0,"350":0,"351":0,"354":0,"355":0,"357":0,"358":0,"361":0,"370":0,"372":0,"374":0,"375":0,"377":0,"384":0,"388":0,"389":0,"391":0,"392":0,"395":0,"396":0,"399":0,"401":0,"408":0,"413":0,"414":0,"415":0,"418":0,"419":0,"420":0,"432":0,"437":0,"438":0,"440":0,"441":0,"443":0,"444":0,"446":0,"447":0,"450":0,"458":0,"466":0,"470":0,"471":0,"472":0,"474":0,"489":0,"492":0,"493":0,"494":0,"495":0,"496":0,"497":0,"499":0,"500":0,"505":0,"520":0,"523":0,"524":0,"526":0,"527":0,"530":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"539":0,"541":0,"545":0,"549":0};-_yuitest_coverage["build/dd-constrain/dd-constrain.js"].functions = {"C:48":0,"setter:123":0,"setter:137":0,"setter:152":0,"setter:163":0,"setter:174":0,"initializer:192":0,"(anonymous 2):205":0,"destructor:202":0,"(anonymous 3):223":0,"_createEvents:217":0,"_handleEnd:238":0,"_handleStart:247":0,"_cacheRegion:262":0,"resetCache:269":0,"(anonymous 4):303":0,"_getConstraint:277":0,"getRegion:319":0,"_checkRegion:340":0,"inRegion:369":0,"align:383":0,"drag:407":0,"_checkTicks:431":0,"_tickAlignX:457":0,"_tickAlignY:465":0,"_calcTicks:488":0,"_calcTickArray:519":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-constrain/dd-constrain.js"].code=["YUI.add('dd-constrain', function (Y, NAME) {","",""," /**"," * The Drag & Drop Utility allows you to create a draggable interface efficiently,"," * buffering you from browser-level abnormalities and enabling you to focus on the interesting"," * logic surrounding your particular implementation. This component enables you to create a"," * variety of standard draggable objects with just a few lines of code and then,"," * using its extensive API, add your own specific implementation logic."," * @module dd"," * @main dd"," * @submodule dd-constrain"," */"," /**"," * Plugin for the dd-drag module to add the constraining methods to it."," * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints."," * @class DDConstrained"," * @extends Base"," * @constructor"," * @namespace Plugin"," */",""," var DRAG_NODE = 'dragNode',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," HOST = 'host',"," TICK_X_ARRAY = 'tickXArray',"," TICK_Y_ARRAY = 'tickYArray',"," DDM = Y.DD.DDM,"," TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',"," VIEW = 'view',"," proto = null,",""," /**"," * @event drag:tickAlignX"," * @description Fires when this node is aligned with the tickX value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_X = 'drag:tickAlignX',",""," /**"," * @event drag:tickAlignY"," * @description Fires when this node is aligned with the tickY value."," * @param {EventFacade} event An Event Facade object"," * @type {CustomEvent}"," */"," EV_TICK_ALIGN_Y = 'drag:tickAlignY',",""," C = function() {"," this._lazyAddAttrs = false;"," C.superclass.constructor.apply(this, arguments);"," };",""," C.NAME = 'ddConstrained';"," /**"," * @property NS"," * @default con"," * @readonly"," * @protected"," * @static"," * @description The Constrained instance will be placed on the Drag instance under the con namespace."," * @type {String}","*/"," C.NS = 'con';",""," C.ATTRS = {"," host: {"," },"," /**"," * @attribute stickX"," * @description Stick the drag movement to the X-Axis. Default: false"," * @type Boolean"," */"," stickX: {"," value: false"," },"," /**"," * @attribute stickY"," * @description Stick the drag movement to the Y-Axis"," * @type Boolean"," */"," stickY: {"," value: false"," },"," /**"," * @attribute tickX"," * @description The X tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickX: {"," value: false"," },"," /**"," * @attribute tickY"," * @description The Y tick offset the drag node should snap to on each drag move. False for no ticks. Default: false"," * @type Number/false"," */"," tickY: {"," value: false"," },"," /**"," * @attribute tickXArray"," * @description An array of page coordinates to use as X ticks for drag movement."," * @type Array"," */"," tickXArray: {"," value: false"," },"," /**"," * @attribute tickYArray"," * @description An array of page coordinates to use as Y ticks for drag movement."," * @type Array"," */"," tickYArray: {"," value: false"," },"," /**"," * CSS style string for the gutter of a region (supports negative values): '5 0'"," * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @attribute gutter"," * @type String"," */"," gutter: {"," value: '0',"," setter: function(gutter) {"," return Y.DD.DDM.cssSizestoObject(gutter);"," }"," },"," /**"," * @attribute constrain"," * @description Will attempt to constrain the drag node to the boundaries. Arguments:<br>"," * 'view': Contrain to Viewport<br>"," * '#selector_string': Constrain to this node<br>"," * '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions"," * @type {String/Object/Node}"," */"," constrain: {"," value: VIEW,"," setter: function(con) {"," var node = Y.one(con);"," if (node) {"," con = node;"," }"," return con;"," }"," },"," /**"," * @deprecated"," * @attribute constrain2region"," * @description An Object Literal containing a valid region (top, right, bottom, left) of page positions to constrain the drag node to."," * @type Object"," */"," constrain2region: {"," setter: function(r) {"," return this.set('constrain', r);"," }"," },"," /**"," * @deprecated"," * @attribute constrain2node"," * @description Will attempt to constrain the drag node to the boundaries of this node."," * @type Object"," */"," constrain2node: {"," setter: function(n) {"," return this.set('constrain', Y.one(n));"," }"," },"," /**"," * @deprecated"," * @attribute constrain2view"," * @description Will attempt to constrain the drag node to the boundaries of the viewport region."," * @type Object"," */"," constrain2view: {"," setter: function() {"," return this.set('constrain', VIEW);"," }"," },"," /**"," * @attribute cacheRegion"," * @description Should the region be cached for performace. Default: true"," * @type Boolean"," */"," cacheRegion: {"," value: true"," }"," };",""," proto = {"," _lastTickXFired: null,"," _lastTickYFired: null,",""," initializer: function() {"," this._createEvents();",""," this._eventHandles = ["," this.get(HOST).on('drag:end', Y.bind(this._handleEnd, this)),"," this.get(HOST).on('drag:start', Y.bind(this._handleStart, this)),"," this.get(HOST).after('drag:align', Y.bind(this.align, this)),"," this.get(HOST).after('drag:drag', Y.bind(this.drag, this))"," ];"," },"," destructor: function() {"," Y.each("," this._eventHandles,"," function(handle) {"," handle.detach();"," }"," );",""," this._eventHandles.length = 0;"," },"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {"," var ev = ["," EV_TICK_ALIGN_X,"," EV_TICK_ALIGN_Y"," ];",""," Y.each(ev, function(v) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," bubbles: true,"," queuable: false,"," prefix: 'drag'"," });"," }, this);"," },"," /**"," * @private"," * @method _handleEnd"," * @description Fires on drag:end"," */"," _handleEnd: function() {"," this._lastTickYFired = null;"," this._lastTickXFired = null;"," },"," /**"," * @private"," * @method _handleStart"," * @description Fires on drag:start and clears the _regionCache"," */"," _handleStart: function() {"," this.resetCache();"," },"," /**"," * @private"," * @property _regionCache"," * @description Store a cache of the region that we are constraining to"," * @type Object"," */"," _regionCache: null,"," /**"," * @private"," * @method _cacheRegion"," * @description Get's the region and caches it, called from window.resize and when the cache is null"," */"," _cacheRegion: function() {"," this._regionCache = this.get('constrain').get('region');"," },"," /**"," * @method resetCache"," * @description Reset the internal region cache."," */"," resetCache: function() {"," this._regionCache = null;"," },"," /**"," * @private"," * @method _getConstraint"," * @description Standardizes the 'constraint' attribute"," */"," _getConstraint: function() {"," var con = this.get('constrain'),"," g = this.get('gutter'),"," region;",""," if (con) {"," if (con instanceof Y.Node) {"," if (!this._regionCache) {"," this._eventHandles.push(Y.on('resize', Y.bind(this._cacheRegion, this), Y.config.win));"," this._cacheRegion();"," }"," region = Y.clone(this._regionCache);"," if (!this.get('cacheRegion')) {"," this.resetCache();"," }"," } else if (Y.Lang.isObject(con)) {"," region = Y.clone(con);"," }"," }"," if (!con || !region) {"," con = VIEW;"," }"," if (con === VIEW) {"," region = this.get(HOST).get(DRAG_NODE).get('viewportRegion');"," }",""," Y.each(g, function(i, n) {"," if ((n === RIGHT) || (n === BOTTOM)) {"," region[n] -= i;"," } else {"," region[n] += i;"," }"," });"," return region;"," },",""," /**"," * @method getRegion"," * @description Get the active region: viewport, node, custom region"," * @param {Boolean} inc Include the node's height and width"," * @return {Object} The active region."," */"," getRegion: function(inc) {"," var r = {}, oh = null, ow = null,"," host = this.get(HOST);",""," r = this._getConstraint();",""," if (inc) {"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT);"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);"," r[RIGHT] = r[RIGHT] - ow;"," r[BOTTOM] = r[BOTTOM] - oh;"," }"," return r;"," },"," /**"," * @private"," * @method _checkRegion"," * @description Check if xy is inside a given region, if not change to it be inside."," * @param {Array} _xy The XY to check if it's in the current region, if it isn't"," * inside the region, it will reset the xy array to be inside the region."," * @return {Array} The new XY that is inside the region"," */"," _checkRegion: function(_xy) {"," var oxy = _xy,"," r = this.getRegion(),"," host = this.get(HOST),"," oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT),"," ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);",""," if (oxy[1] > (r[BOTTOM] - oh)) {"," _xy[1] = (r[BOTTOM] - oh);"," }"," if (r[TOP] > oxy[1]) {"," _xy[1] = r[TOP];",""," }"," if (oxy[0] > (r[RIGHT] - ow)) {"," _xy[0] = (r[RIGHT] - ow);"," }"," if (r[LEFT] > oxy[0]) {"," _xy[0] = r[LEFT];"," }",""," return _xy;"," },"," /**"," * @method inRegion"," * @description Checks if the XY passed or the dragNode is inside the active region."," * @param {Array} xy Optional XY to check, if not supplied this.get('dragNode').getXY() is used."," * @return {Boolean} True if the XY is inside the region, false otherwise."," */"," inRegion: function(xy) {"," xy = xy || this.get(HOST).get(DRAG_NODE).getXY();",""," var _xy = this._checkRegion([xy[0], xy[1]]),"," inside = false;"," if ((xy[0] === _xy[0]) && (xy[1] === _xy[1])) {"," inside = true;"," }"," return inside;"," },"," /**"," * @method align"," * @description Modifies the Drag.actXY method from the after drag:align event. This is where the constraining happens."," */"," align: function() {"," var host = this.get(HOST),"," _xy = [host.actXY[0], host.actXY[1]],"," r = this.getRegion(true);",""," if (this.get('stickX')) {"," _xy[1] = (host.startXY[1] - host.deltaXY[1]);"," }"," if (this.get('stickY')) {"," _xy[0] = (host.startXY[0] - host.deltaXY[0]);"," }",""," if (r) {"," _xy = this._checkRegion(_xy);"," }",""," _xy = this._checkTicks(_xy, r);",""," host.actXY = _xy;"," },"," /**"," * @method drag"," * @description Fires after drag:drag. Handle the tickX and tickX align events."," */"," drag: function() {"," var host = this.get(HOST),"," xt = this.get('tickX'),"," yt = this.get('tickY'),"," _xy = [host.actXY[0], host.actXY[1]];",""," if ((Y.Lang.isNumber(xt) || this.get(TICK_X_ARRAY)) && (this._lastTickXFired !== _xy[0])) {"," this._tickAlignX();"," this._lastTickXFired = _xy[0];"," }",""," if ((Y.Lang.isNumber(yt) || this.get(TICK_Y_ARRAY)) && (this._lastTickYFired !== _xy[1])) {"," this._tickAlignY();"," this._lastTickYFired = _xy[1];"," }"," },"," /**"," * @private"," * @method _checkTicks"," * @description This method delegates the proper helper method for tick calculations"," * @param {Array} xy The XY coords for the Drag"," * @param {Object} r The optional region that we are bound to."," * @return {Array} The calced XY coords"," */"," _checkTicks: function(xy, r) {"," var host = this.get(HOST),"," lx = (host.startXY[0] - host.deltaXY[0]),"," ly = (host.startXY[1] - host.deltaXY[1]),"," xt = this.get('tickX'),"," yt = this.get('tickY');"," if (xt && !this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTicks(xy[0], lx, xt, r[LEFT], r[RIGHT]);"," }"," if (yt && !this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTicks(xy[1], ly, yt, r[TOP], r[BOTTOM]);"," }"," if (this.get(TICK_X_ARRAY)) {"," xy[0] = DDM._calcTickArray(xy[0], this.get(TICK_X_ARRAY), r[LEFT], r[RIGHT]);"," }"," if (this.get(TICK_Y_ARRAY)) {"," xy[1] = DDM._calcTickArray(xy[1], this.get(TICK_Y_ARRAY), r[TOP], r[BOTTOM]);"," }",""," return xy;"," },"," /**"," * @private"," * @method _tickAlignX"," * @description Fires when the actXY[0] reach a new value respecting the tickX gap."," */"," _tickAlignX: function() {"," this.fire(EV_TICK_ALIGN_X);"," },"," /**"," * @private"," * @method _tickAlignY"," * @description Fires when the actXY[1] reach a new value respecting the tickY gap."," */"," _tickAlignY: function() {"," this.fire(EV_TICK_ALIGN_Y);"," }"," };",""," Y.namespace('Plugin');"," Y.extend(C, Y.Base, proto);"," Y.Plugin.DDConstrained = C;",""," Y.mix(DDM, {"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTicks"," * @description Helper method to calculate the tick offsets for a given position"," * @param {Number} pos The current X or Y position"," * @param {Number} start The start X or Y position"," * @param {Number} tick The X or Y tick increment"," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return {Number} The new position based on the tick calculation"," */"," _calcTicks: function(pos, start, tick, off1, off2) {"," var ix = ((pos - start) / tick),"," min = Math.floor(ix),"," max = Math.ceil(ix);"," if ((min !== 0) || (max !== 0)) {"," if ((ix >= min) && (ix <= max)) {"," pos = (start + (tick * min));"," if (off1 && off2) {"," if (pos < off1) {"," pos = (start + (tick * (min + 1)));"," }"," if (pos > off2) {"," pos = (start + (tick * (min - 1)));"," }"," }"," }"," }"," return pos;"," },"," /**"," * @for DDM"," * @namespace DD"," * @private"," * @method _calcTickArray"," * @description This method is used with the tickXArray and tickYArray config options"," * @param {Number} pos The current X or Y position"," * @param {Number} ticks The array containing our custom tick positions."," * @param {Number} off1 The min offset that we can't pass (region)"," * @param {Number} off2 The max offset that we can't pass (region)"," * @return The tick position"," */"," _calcTickArray: function(pos, ticks, off1, off2) {"," var i = 0, len = ticks.length, next = 0,"," diff1, diff2, ret;",""," if (!ticks || (ticks.length === 0)) {"," return pos;"," }"," if (ticks[0] >= pos) {"," return ticks[0];"," }",""," for (i = 0; i < len; i++) {"," next = (i + 1);"," if (ticks[next] && ticks[next] >= pos) {"," diff1 = pos - ticks[i];"," diff2 = ticks[next] - pos;"," ret = (diff2 > diff1) ? ticks[i] : ticks[next];"," if (off1 && off2) {"," if (ret > off2) {"," if (ticks[i]) {"," ret = ticks[i];"," } else {"," ret = ticks[len - 1];"," }"," }"," }"," return ret;"," }",""," }"," return ticks[ticks.length - 1];"," }"," });","","","","}, '3.7.3', {\"requires\": [\"dd-drag\"]});"];+_yuitest_coverage["build/dd-constrain/dd-constrain.js"].lines = {"1":0,"23":0,"54":0,"55":0,"58":0,"68":0,"70":0,"130":0,"144":0,"145":0,"146":0,"148":0,"159":0,"170":0,"181":0,"194":0,"199":0,"201":0,"209":0,"212":0,"216":0,"224":0,"229":0,"230":0,"245":0,"246":0,"254":0,"269":0,"276":0,"284":0,"288":0,"289":0,"290":0,"291":0,"292":0,"294":0,"295":0,"296":0,"298":0,"299":0,"302":0,"303":0,"305":0,"306":0,"309":0,"310":0,"311":0,"313":0,"316":0,"326":0,"329":0,"331":0,"332":0,"333":0,"334":0,"335":0,"337":0,"348":0,"354":0,"355":0,"357":0,"358":0,"361":0,"362":0,"364":0,"365":0,"368":0,"377":0,"379":0,"381":0,"382":0,"384":0,"391":0,"395":0,"396":0,"398":0,"399":0,"402":0,"403":0,"406":0,"408":0,"415":0,"420":0,"421":0,"422":0,"425":0,"426":0,"427":0,"439":0,"444":0,"445":0,"447":0,"448":0,"450":0,"451":0,"453":0,"454":0,"457":0,"465":0,"473":0,"477":0,"478":0,"479":0,"481":0,"496":0,"499":0,"500":0,"501":0,"502":0,"503":0,"504":0,"506":0,"507":0,"512":0,"527":0,"530":0,"531":0,"533":0,"534":0,"537":0,"538":0,"539":0,"540":0,"541":0,"542":0,"543":0,"544":0,"545":0,"546":0,"548":0,"552":0,"556":0};+_yuitest_coverage["build/dd-constrain/dd-constrain.js"].functions = {"C:53":0,"setter:129":0,"setter:143":0,"setter:158":0,"setter:169":0,"setter:180":0,"initializer:198":0,"(anonymous 2):211":0,"destructor:208":0,"(anonymous 3):229":0,"_createEvents:223":0,"_handleEnd:244":0,"_handleStart:253":0,"_cacheRegion:268":0,"resetCache:275":0,"(anonymous 4):309":0,"_getConstraint:283":0,"getRegion:325":0,"_checkRegion:347":0,"inRegion:376":0,"align:390":0,"drag:414":0,"_checkTicks:438":0,"_tickAlignX:464":0,"_tickAlignY:472":0,"_calcTicks:495":0,"_calcTickArray:526":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-constrain/dd-constrain.js"].coveredLines = 132; _yuitest_coverage["build/dd-constrain/dd-constrain.js"].coveredFunctions = 28; _yuitest_coverline("build/dd-constrain/dd-constrain.js", 1);@@ -42,13 +42,18 @@ /**- * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.+ * The Drag & Drop Utility allows you to create a draggable interface efficiently,+ * buffering you from browser-level abnormalities and enabling you to focus on the interesting+ * logic surrounding your particular implementation. This component enables you to create a+ * variety of standard draggable objects with just a few lines of code and then,+ * using its extensive API, add your own specific implementation logic. * @module dd * @main dd * @submodule dd-constrain */ /**- * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.+ * Plugin for the dd-drag module to add the constraining methods to it.+ * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints. * @class DDConstrained * @extends Base * @constructor@@ -56,7 +61,7 @@ */ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 1)", 1);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 18);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 23); var DRAG_NODE = 'dragNode', OFFSET_HEIGHT = 'offsetHeight', OFFSET_WIDTH = 'offsetWidth',@@ -87,15 +92,15 @@ */ EV_TICK_ALIGN_Y = 'drag:tickAlignY', - C = function(config) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "C", 48);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 49);+ C = function() {+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "C", 53);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 54); this._lazyAddAttrs = false;- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 50);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 55); C.superclass.constructor.apply(this, arguments); }; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 53);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 58); C.NAME = 'ddConstrained'; /** * @property NS@@ -106,10 +111,10 @@ * @description The Constrained instance will be placed on the Drag instance under the con namespace. * @type {String} */- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 63);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 68); C.NS = 'con'; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 65);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 70); C.ATTRS = { host: { },@@ -162,15 +167,16 @@ value: false }, /**+ * CSS style string for the gutter of a region (supports negative values): '5 0'+ * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @attribute gutter- * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @type String */ gutter: { value: '0', setter: function(gutter) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 123);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 124);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 129);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 130); return Y.DD.DDM.cssSizestoObject(gutter); } },@@ -185,15 +191,15 @@ constrain: { value: VIEW, setter: function(con) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 137);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 138);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 143);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 144); var node = Y.one(con);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 139);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 145); if (node) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 140);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 146); con = node; }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 142);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 148); return con; } },@@ -205,8 +211,8 @@ */ constrain2region: { setter: function(r) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 152);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 153);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 158);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 159); return this.set('constrain', r); } },@@ -218,8 +224,8 @@ */ constrain2node: { setter: function(n) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 163);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 164);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 169);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 170); return this.set('constrain', Y.one(n)); } },@@ -230,9 +236,9 @@ * @type Object */ constrain2view: {- setter: function(n) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 174);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 175);+ setter: function() {+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "setter", 180);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 181); return this.set('constrain', VIEW); } },@@ -246,17 +252,17 @@ } }; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 188);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 194); proto = { _lastTickXFired: null, _lastTickYFired: null, initializer: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "initializer", 192);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 193);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "initializer", 198);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 199); this._createEvents(); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 195);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 201); this._eventHandles = [ this.get(HOST).on('drag:end', Y.bind(this._handleEnd, this)), this.get(HOST).on('drag:start', Y.bind(this._handleStart, this)),@@ -265,18 +271,18 @@ ]; }, destructor: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "destructor", 202);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 203);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "destructor", 208);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 209); Y.each( this._eventHandles,- function(handle, index) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 2)", 205);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 206);+ function(handle) {+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 2)", 211);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 212); handle.detach(); } ); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 210);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 216); this._eventHandles.length = 0; }, /**@@ -285,17 +291,17 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_createEvents", 217);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 218);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_createEvents", 223);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 224); var ev = [ EV_TICK_ALIGN_X, EV_TICK_ALIGN_Y ]; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 223);-Y.each(ev, function(v, k) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 3)", 223);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 224);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 229);+Y.each(ev, function(v) {+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 3)", 229);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 230); this.publish(v, { type: v, emitFacade: true,@@ -311,10 +317,10 @@ * @description Fires on drag:end */ _handleEnd: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleEnd", 238);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 239);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleEnd", 244);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 245); this._lastTickYFired = null;- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 240);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 246); this._lastTickXFired = null; }, /**@@ -323,8 +329,8 @@ * @description Fires on drag:start and clears the _regionCache */ _handleStart: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleStart", 247);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 248);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_handleStart", 253);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 254); this.resetCache(); }, /**@@ -340,8 +346,8 @@ * @description Get's the region and caches it, called from window.resize and when the cache is null */ _cacheRegion: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_cacheRegion", 262);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 263);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_cacheRegion", 268);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 269); this._regionCache = this.get('constrain').get('region'); }, /**@@ -349,8 +355,8 @@ * @description Reset the internal region cache. */ resetCache: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "resetCache", 269);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 270);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "resetCache", 275);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 276); this._regionCache = null; }, /**@@ -359,60 +365,60 @@ * @description Standardizes the 'constraint' attribute */ _getConstraint: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_getConstraint", 277);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 278);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_getConstraint", 283);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 284); var con = this.get('constrain'), g = this.get('gutter'), region; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 282);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 288); if (con) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 283);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 289); if (con instanceof Y.Node) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 284);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 290); if (!this._regionCache) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 285);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 291); this._eventHandles.push(Y.on('resize', Y.bind(this._cacheRegion, this), Y.config.win));- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 286);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 292); this._cacheRegion(); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 288);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 294); region = Y.clone(this._regionCache);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 289);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 295); if (!this.get('cacheRegion')) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 290);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 296); this.resetCache(); }- } else {_yuitest_coverline("build/dd-constrain/dd-constrain.js", 292);+ } else {_yuitest_coverline("build/dd-constrain/dd-constrain.js", 298); if (Y.Lang.isObject(con)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 293);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 299); region = Y.clone(con); }} }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 296);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 302); if (!con || !region) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 297);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 303); con = VIEW; }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 299);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 305); if (con === VIEW) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 300);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 306); region = this.get(HOST).get(DRAG_NODE).get('viewportRegion'); } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 303);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 309); Y.each(g, function(i, n) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 4)", 303);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 304);-if ((n == RIGHT) || (n == BOTTOM)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 305);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "(anonymous 4)", 309);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 310);+if ((n === RIGHT) || (n === BOTTOM)) {+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 311); region[n] -= i; } else {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 307);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 313); region[n] += i; } });- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 310);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 316); return region; }, @@ -423,67 +429,68 @@ * @return {Object} The active region. */ getRegion: function(inc) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "getRegion", 319);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 320);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "getRegion", 325);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 326); var r = {}, oh = null, ow = null, host = this.get(HOST); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 323);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 329); r = this._getConstraint(); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 325);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 331); if (inc) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 326);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 332); oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 327);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 333); ow = host.get(DRAG_NODE).get(OFFSET_WIDTH);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 328);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 334); r[RIGHT] = r[RIGHT] - ow;- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 329);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 335); r[BOTTOM] = r[BOTTOM] - oh; }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 331);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 337); return r; }, /** * @private * @method _checkRegion * @description Check if xy is inside a given region, if not change to it be inside.- * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region.+ * @param {Array} _xy The XY to check if it's in the current region, if it isn't+ * inside the region, it will reset the xy array to be inside the region. * @return {Array} The new XY that is inside the region */ _checkRegion: function(_xy) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkRegion", 340);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 341);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkRegion", 347);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 348); var oxy = _xy, r = this.getRegion(), host = this.get(HOST), oh = host.get(DRAG_NODE).get(OFFSET_HEIGHT), ow = host.get(DRAG_NODE).get(OFFSET_WIDTH); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 347);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 354); if (oxy[1] > (r[BOTTOM] - oh)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 348);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 355); _xy[1] = (r[BOTTOM] - oh); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 350);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 357); if (r[TOP] > oxy[1]) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 351);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 358); _xy[1] = r[TOP]; }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 354);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 361); if (oxy[0] > (r[RIGHT] - ow)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 355);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 362); _xy[0] = (r[RIGHT] - ow); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 357);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 364); if (r[LEFT] > oxy[0]) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 358);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 365); _xy[0] = r[LEFT]; } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 361);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 368); return _xy; }, /**@@ -493,19 +500,19 @@ * @return {Boolean} True if the XY is inside the region, false otherwise. */ inRegion: function(xy) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "inRegion", 369);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 370);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "inRegion", 376);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 377); xy = xy || this.get(HOST).get(DRAG_NODE).getXY(); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 372);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 379); var _xy = this._checkRegion([xy[0], xy[1]]), inside = false;- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 374);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 381); if ((xy[0] === _xy[0]) && (xy[1] === _xy[1])) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 375);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 382); inside = true; }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 377);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 384); return inside; }, /**@@ -513,60 +520,60 @@ * @description Modifies the Drag.actXY method from the after drag:align event. This is where the constraining happens. */ align: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "align", 383);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 384);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "align", 390);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 391); var host = this.get(HOST), _xy = [host.actXY[0], host.actXY[1]], r = this.getRegion(true); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 388);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 395); if (this.get('stickX')) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 389);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 396); _xy[1] = (host.startXY[1] - host.deltaXY[1]); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 391);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 398); if (this.get('stickY')) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 392);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 399); _xy[0] = (host.startXY[0] - host.deltaXY[0]); } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 395);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 402); if (r) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 396);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 403); _xy = this._checkRegion(_xy); } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 399);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 406); _xy = this._checkTicks(_xy, r); - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 401);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 408); host.actXY = _xy; }, /** * @method drag * @description Fires after drag:drag. Handle the tickX and tickX align events. */- drag: function(event) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "drag", 407);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 408);+ drag: function() {+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "drag", 414);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 415); var host = this.get(HOST), xt = this.get('tickX'), yt = this.get('tickY'), _xy = [host.actXY[0], host.actXY[1]]; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 413);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 420); if ((Y.Lang.isNumber(xt) || this.get(TICK_X_ARRAY)) && (this._lastTickXFired !== _xy[0])) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 414);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 421); this._tickAlignX();- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 415);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 422); this._lastTickXFired = _xy[0]; } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 418);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 425); if ((Y.Lang.isNumber(yt) || this.get(TICK_Y_ARRAY)) && (this._lastTickYFired !== _xy[1])) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 419);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 426); this._tickAlignY();- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 420);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 427); this._lastTickYFired = _xy[1]; } },@@ -579,35 +586,35 @@ * @return {Array} The calced XY coords */ _checkTicks: function(xy, r) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkTicks", 431);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 432);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_checkTicks", 438);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 439); var host = this.get(HOST), lx = (host.startXY[0] - host.deltaXY[0]), ly = (host.startXY[1] - host.deltaXY[1]), xt = this.get('tickX'), yt = this.get('tickY');- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 437);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 444); if (xt && !this.get(TICK_X_ARRAY)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 438);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 445); xy[0] = DDM._calcTicks(xy[0], lx, xt, r[LEFT], r[RIGHT]); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 440);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 447); if (yt && !this.get(TICK_Y_ARRAY)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 441);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 448); xy[1] = DDM._calcTicks(xy[1], ly, yt, r[TOP], r[BOTTOM]); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 443);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 450); if (this.get(TICK_X_ARRAY)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 444);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 451); xy[0] = DDM._calcTickArray(xy[0], this.get(TICK_X_ARRAY), r[LEFT], r[RIGHT]); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 446);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 453); if (this.get(TICK_Y_ARRAY)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 447);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 454); xy[1] = DDM._calcTickArray(xy[1], this.get(TICK_Y_ARRAY), r[TOP], r[BOTTOM]); } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 450);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 457); return xy; }, /**@@ -616,8 +623,8 @@ * @description Fires when the actXY[0] reach a new value respecting the tickX gap. */ _tickAlignX: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignX", 457);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 458);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignX", 464);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 465); this.fire(EV_TICK_ALIGN_X); }, /**@@ -626,20 +633,20 @@ * @description Fires when the actXY[1] reach a new value respecting the tickY gap. */ _tickAlignY: function() {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignY", 465);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 466);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_tickAlignY", 472);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 473); this.fire(EV_TICK_ALIGN_Y); } }; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 470);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 477); Y.namespace('Plugin');- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 471);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 478); Y.extend(C, Y.Base, proto);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 472);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 479); Y.Plugin.DDConstrained = C; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 474);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 481); Y.mix(DDM, { /** * @for DDM@@ -655,33 +662,33 @@ * @return {Number} The new position based on the tick calculation */ _calcTicks: function(pos, start, tick, off1, off2) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTicks", 488);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 489);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTicks", 495);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 496); var ix = ((pos - start) / tick), min = Math.floor(ix), max = Math.ceil(ix);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 492);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 499); if ((min !== 0) || (max !== 0)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 493);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 500); if ((ix >= min) && (ix <= max)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 494);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 501); pos = (start + (tick * min));- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 495);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 502); if (off1 && off2) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 496);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 503); if (pos < off1) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 497);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 504); pos = (start + (tick * (min + 1))); }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 499);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 506); if (pos > off2) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 500);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 507); pos = (start + (tick * (min - 1))); } } } }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 505);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 512); return pos; }, /**@@ -697,58 +704,58 @@ * @return The tick position */ _calcTickArray: function(pos, ticks, off1, off2) {- _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTickArray", 519);-_yuitest_coverline("build/dd-constrain/dd-constrain.js", 520);+ _yuitest_coverfunc("build/dd-constrain/dd-constrain.js", "_calcTickArray", 526);+_yuitest_coverline("build/dd-constrain/dd-constrain.js", 527); var i = 0, len = ticks.length, next = 0, diff1, diff2, ret; - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 523);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 530); if (!ticks || (ticks.length === 0)) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 524);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 531); return pos; }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 526);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 533); if (ticks[0] >= pos) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 527);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 534); return ticks[0]; } - _yuitest_coverline("build/dd-constrain/dd-constrain.js", 530);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 537); for (i = 0; i < len; i++) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 531);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 538); next = (i + 1);- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 532);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 539); if (ticks[next] && ticks[next] >= pos) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 533);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 540); diff1 = pos - ticks[i];- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 534);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 541); diff2 = ticks[next] - pos;- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 535);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 542); ret = (diff2 > diff1) ? ticks[i] : ticks[next];- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 536);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 543); if (off1 && off2) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 537);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 544); if (ret > off2) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 538);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 545); if (ticks[i]) {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 539);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 546); ret = ticks[i]; } else {- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 541);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 548); ret = ticks[len - 1]; } } }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 545);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 552); return ret; } }- _yuitest_coverline("build/dd-constrain/dd-constrain.js", 549);+ _yuitest_coverline("build/dd-constrain/dd-constrain.js", 556); return ticks[ticks.length - 1]; } }); -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-constrain/dd-constrain-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,13 +8,18 @@ /**- * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.+ * The Drag & Drop Utility allows you to create a draggable interface efficiently,+ * buffering you from browser-level abnormalities and enabling you to focus on the interesting+ * logic surrounding your particular implementation. This component enables you to create a+ * variety of standard draggable objects with just a few lines of code and then,+ * using its extensive API, add your own specific implementation logic. * @module dd * @main dd * @submodule dd-constrain */ /**- * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.+ * Plugin for the dd-drag module to add the constraining methods to it.+ * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints. * @class DDConstrained * @extends Base * @constructor@@ -51,7 +56,7 @@ */ EV_TICK_ALIGN_Y = 'drag:tickAlignY', - C = function(config) {+ C = function() { this._lazyAddAttrs = false; C.superclass.constructor.apply(this, arguments); };@@ -120,8 +125,9 @@ value: false }, /**+ * CSS style string for the gutter of a region (supports negative values): '5 0'+ * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @attribute gutter- * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @type String */ gutter: {@@ -177,7 +183,7 @@ * @type Object */ constrain2view: {- setter: function(n) {+ setter: function() { return this.set('constrain', VIEW); } },@@ -208,7 +214,7 @@ destructor: function() { Y.each( this._eventHandles,- function(handle, index) {+ function(handle) { handle.detach(); } );@@ -226,7 +232,7 @@ EV_TICK_ALIGN_Y ]; - Y.each(ev, function(v, k) {+ Y.each(ev, function(v) { this.publish(v, { type: v, emitFacade: true,@@ -307,7 +313,7 @@ } Y.each(g, function(i, n) {- if ((n == RIGHT) || (n == BOTTOM)) {+ if ((n === RIGHT) || (n === BOTTOM)) { region[n] -= i; } else { region[n] += i;@@ -340,7 +346,8 @@ * @private * @method _checkRegion * @description Check if xy is inside a given region, if not change to it be inside.- * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region.+ * @param {Array} _xy The XY to check if it's in the current region, if it isn't+ * inside the region, it will reset the xy array to be inside the region. * @return {Array} The new XY that is inside the region */ _checkRegion: function(_xy) {@@ -410,7 +417,7 @@ * @method drag * @description Fires after drag:drag. Handle the tickX and tickX align events. */- drag: function(event) {+ drag: function() { var host = this.get(HOST), xt = this.get('tickX'), yt = this.get('tickY'),@@ -558,4 +565,4 @@ -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-constrain/dd-constrain-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-constrain",function(e,t){var n="dragNode",r="offsetHeight",i="offsetWidth",s="host",o="tickXArray",u="tickYArray",a=e.DD.DDM,f="top",l="right",c="bottom",h="left",p="view",d=null,v="drag:tickAlignX",m="drag:tickAlignY",g=function(e){this._lazyAddAttrs=!1,g.superclass.constructor.apply(this,arguments)};g.NAME="ddConstrained",g.NS="con",g.ATTRS={host:{},stickX:{value:!1},stickY:{value:!1},tickX:{value:!1},tickY:{value:!1},tickXArray:{value:!1},tickYArray:{value:!1},gutter:{value:"0",setter:function(t){return e.DD.DDM.cssSizestoObject(t)}},constrain:{value:p,setter:function(t){var n=e.one(t);return n&&(t=n),t}},constrain2region:{setter:function(e){return this.set("constrain",e)}},constrain2node:{setter:function(t){return this.set("constrain",e.one(t))}},constrain2view:{setter:function(e){return this.set("constrain",p)}},cacheRegion:{value:!0}},d={_lastTickXFired:null,_lastTickYFired:null,initializer:function(){this._createEvents(),this._eventHandles=[this.get(s).on("drag:end",e.bind(this._handleEnd,this)),this.get(s).on("drag:start",e.bind(this._handleStart,this)),this.get(s).after("drag:align",e.bind(this.align,this)),this.get(s).after("drag:drag",e.bind(this.drag,this))]},destructor:function(){e.each(this._eventHandles,function(e,t){e.detach()}),this._eventHandles.length=0},_createEvents:function(){var t=[v,m];e.each(t,function(e,t){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,queuable:!1,prefix:"drag"})},this)},_handleEnd:function(){this._lastTickYFired=null,this._lastTickXFired=null},_handleStart:function(){this.resetCache()},_regionCache:null,_cacheRegion:function(){this._regionCache=this.get("constrain").get("region")},resetCache:function(){this._regionCache=null},_getConstraint:function(){var t=this.get("constrain"),r=this.get("gutter"),i;t&&(t instanceof e.Node?(this._regionCache||(this._eventHandles.push(e.on("resize",e.bind(this._cacheRegion,this),e.config.win)),this._cacheRegion()),i=e.clone(this._regionCache),this.get("cacheRegion")||this.resetCache()):e.Lang.isObject(t)&&(i=e.clone(t)));if(!t||!i)t=p;return t===p&&(i=this.get(s).get(n).get("viewportRegion")),e.each(r,function(e,t){t==l||t==c?i[t]-=e:i[t]+=e}),i},getRegion:function(e){var t={},o=null,u=null,a=this.get(s);return t=this._getConstraint(),e&&(o=a.get(n).get(r),u=a.get(n).get(i),t[l]=t[l]-u,t[c]=t[c]-o),t},_checkRegion:function(e){var t=e,o=this.getRegion(),u=this.get(s),a=u.get(n).get(r),p=u.get(n).get(i);return t[1]>o[c]-a&&(e[1]=o[c]-a),o[f]>t[1]&&(e[1]=o[f]),t[0]>o[l]-p&&(e[0]=o[l]-p),o[h]>t[0]&&(e[0]=o[h]),e},inRegion:function(e){e=e||this.get(s).get(n).getXY();var t=this._checkRegion([e[0],e[1]]),r=!1;return e[0]===t[0]&&e[1]===t[1]&&(r=!0),r},align:function(){var e=this.get(s),t=[e.actXY[0],e.actXY[1]],n=this.getRegion(!0);this.get("stickX")&&(t[1]=e.startXY[1]-e.deltaXY[1]),this.get("stickY")&&(t[0]=e.startXY[0]-e.deltaXY[0]),n&&(t=this._checkRegion(t)),t=this._checkTicks(t,n),e.actXY=t},drag:function(t){var n=this.get(s),r=this.get("tickX"),i=this.get("tickY"),a=[n.actXY[0],n.actXY[1]];(e.Lang.isNumber(r)||this.get(o))&&this._lastTickXFired!==a[0]&&(this._tickAlignX(),this._lastTickXFired=a[0]),(e.Lang.isNumber(i)||this.get(u))&&this._lastTickYFired!==a[1]&&(this._tickAlignY(),this._lastTickYFired=a[1])},_checkTicks:function(e,t){var n=this.get(s),r=n.startXY[0]-n.deltaXY[0],i=n.startXY[1]-n.deltaXY[1],p=this.get("tickX"),d=this.get("tickY");return p&&!this.get(o)&&(e[0]=a._calcTicks(e[0],r,p,t[h],t[l])),d&&!this.get(u)&&(e[1]=a._calcTicks(e[1],i,d,t[f],t[c])),this.get(o)&&(e[0]=a._calcTickArray(e[0],this.get(o),t[h],t[l])),this.get(u)&&(e[1]=a._calcTickArray(e[1],this.get(u),t[f],t[c])),e},_tickAlignX:function(){this.fire(v)},_tickAlignY:function(){this.fire(m)}},e.namespace("Plugin"),e.extend(g,e.Base,d),e.Plugin.DDConstrained=g,e.mix(a,{_calcTicks:function(e,t,n,r,i){var s=(e-t)/n,o=Math.floor(s),u=Math.ceil(s);return(o!==0||u!==0)&&s>=o&&s<=u&&(e=t+n*o,r&&i&&(e<r&&(e=t+n*(o+1)),e>i&&(e=t+n*(o-1)))),e},_calcTickArray:function(e,t,n,r){var i=0,s=t.length,o=0,u,a,f;if(!t||t.length===0)return e;if(t[0]>=e)return t[0];for(i=0;i<s;i++){o=i+1;if(t[o]&&t[o]>=e)return u=e-t[i],a=t[o]-e,f=a>u?t[i]:t[o],n&&r&&f>r&&(t[i]?f=t[i]:f=t[s-1]),f}return t[t.length-1]}})},"3.7.2",{requires:["dd-drag"]});+YUI.add("dd-constrain",function(e,t){var n="dragNode",r="offsetHeight",i="offsetWidth",s="host",o="tickXArray",u="tickYArray",a=e.DD.DDM,f="top",l="right",c="bottom",h="left",p="view",d=null,v="drag:tickAlignX",m="drag:tickAlignY",g=function(){this._lazyAddAttrs=!1,g.superclass.constructor.apply(this,arguments)};g.NAME="ddConstrained",g.NS="con",g.ATTRS={host:{},stickX:{value:!1},stickY:{value:!1},tickX:{value:!1},tickY:{value:!1},tickXArray:{value:!1},tickYArray:{value:!1},gutter:{value:"0",setter:function(t){return e.DD.DDM.cssSizestoObject(t)}},constrain:{value:p,setter:function(t){var n=e.one(t);return n&&(t=n),t}},constrain2region:{setter:function(e){return this.set("constrain",e)}},constrain2node:{setter:function(t){return this.set("constrain",e.one(t))}},constrain2view:{setter:function(){return this.set("constrain",p)}},cacheRegion:{value:!0}},d={_lastTickXFired:null,_lastTickYFired:null,initializer:function(){this._createEvents(),this._eventHandles=[this.get(s).on("drag:end",e.bind(this._handleEnd,this)),this.get(s).on("drag:start",e.bind(this._handleStart,this)),this.get(s).after("drag:align",e.bind(this.align,this)),this.get(s).after("drag:drag",e.bind(this.drag,this))]},destructor:function(){e.each(this._eventHandles,function(e){e.detach()}),this._eventHandles.length=0},_createEvents:function(){var t=[v,m];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,queuable:!1,prefix:"drag"})},this)},_handleEnd:function(){this._lastTickYFired=null,this._lastTickXFired=null},_handleStart:function(){this.resetCache()},_regionCache:null,_cacheRegion:function(){this._regionCache=this.get("constrain").get("region")},resetCache:function(){this._regionCache=null},_getConstraint:function(){var t=this.get("constrain"),r=this.get("gutter"),i;t&&(t instanceof e.Node?(this._regionCache||(this._eventHandles.push(e.on("resize",e.bind(this._cacheRegion,this),e.config.win)),this._cacheRegion()),i=e.clone(this._regionCache),this.get("cacheRegion")||this.resetCache()):e.Lang.isObject(t)&&(i=e.clone(t)));if(!t||!i)t=p;return t===p&&(i=this.get(s).get(n).get("viewportRegion")),e.each(r,function(e,t){t===l||t===c?i[t]-=e:i[t]+=e}),i},getRegion:function(e){var t={},o=null,u=null,a=this.get(s);return t=this._getConstraint(),e&&(o=a.get(n).get(r),u=a.get(n).get(i),t[l]=t[l]-u,t[c]=t[c]-o),t},_checkRegion:function(e){var t=e,o=this.getRegion(),u=this.get(s),a=u.get(n).get(r),p=u.get(n).get(i);return t[1]>o[c]-a&&(e[1]=o[c]-a),o[f]>t[1]&&(e[1]=o[f]),t[0]>o[l]-p&&(e[0]=o[l]-p),o[h]>t[0]&&(e[0]=o[h]),e},inRegion:function(e){e=e||this.get(s).get(n).getXY();var t=this._checkRegion([e[0],e[1]]),r=!1;return e[0]===t[0]&&e[1]===t[1]&&(r=!0),r},align:function(){var e=this.get(s),t=[e.actXY[0],e.actXY[1]],n=this.getRegion(!0);this.get("stickX")&&(t[1]=e.startXY[1]-e.deltaXY[1]),this.get("stickY")&&(t[0]=e.startXY[0]-e.deltaXY[0]),n&&(t=this._checkRegion(t)),t=this._checkTicks(t,n),e.actXY=t},drag:function(){var t=this.get(s),n=this.get("tickX"),r=this.get("tickY"),i=[t.actXY[0],t.actXY[1]];(e.Lang.isNumber(n)||this.get(o))&&this._lastTickXFired!==i[0]&&(this._tickAlignX(),this._lastTickXFired=i[0]),(e.Lang.isNumber(r)||this.get(u))&&this._lastTickYFired!==i[1]&&(this._tickAlignY(),this._lastTickYFired=i[1])},_checkTicks:function(e,t){var n=this.get(s),r=n.startXY[0]-n.deltaXY[0],i=n.startXY[1]-n.deltaXY[1],p=this.get("tickX"),d=this.get("tickY");return p&&!this.get(o)&&(e[0]=a._calcTicks(e[0],r,p,t[h],t[l])),d&&!this.get(u)&&(e[1]=a._calcTicks(e[1],i,d,t[f],t[c])),this.get(o)&&(e[0]=a._calcTickArray(e[0],this.get(o),t[h],t[l])),this.get(u)&&(e[1]=a._calcTickArray(e[1],this.get(u),t[f],t[c])),e},_tickAlignX:function(){this.fire(v)},_tickAlignY:function(){this.fire(m)}},e.namespace("Plugin"),e.extend(g,e.Base,d),e.Plugin.DDConstrained=g,e.mix(a,{_calcTicks:function(e,t,n,r,i){var s=(e-t)/n,o=Math.floor(s),u=Math.ceil(s);return(o!==0||u!==0)&&s>=o&&s<=u&&(e=t+n*o,r&&i&&(e<r&&(e=t+n*(o+1)),e>i&&(e=t+n*(o-1)))),e},_calcTickArray:function(e,t,n,r){var i=0,s=t.length,o=0,u,a,f;if(!t||t.length===0)return e;if(t[0]>=e)return t[0];for(i=0;i<s;i++){o=i+1;if(t[o]&&t[o]>=e)return u=e-t[i],a=t[o]-e,f=a>u?t[i]:t[o],n&&r&&f>r&&(t[i]?f=t[i]:f=t[s-1]),f}return t[t.length-1]}})},"3.7.3",{requires:["dd-drag"]});
bundle/dd-constrain/dd-constrain.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,13 +8,18 @@ /**- * The Drag & Drop Utility allows you to create a draggable interface efficiently, buffering you from browser-level abnormalities and enabling you to focus on the interesting logic surrounding your particular implementation. This component enables you to create a variety of standard draggable objects with just a few lines of code and then, using its extensive API, add your own specific implementation logic.+ * The Drag & Drop Utility allows you to create a draggable interface efficiently,+ * buffering you from browser-level abnormalities and enabling you to focus on the interesting+ * logic surrounding your particular implementation. This component enables you to create a+ * variety of standard draggable objects with just a few lines of code and then,+ * using its extensive API, add your own specific implementation logic. * @module dd * @main dd * @submodule dd-constrain */ /**- * Plugin for the dd-drag module to add the constraining methods to it. It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints.+ * Plugin for the dd-drag module to add the constraining methods to it.+ * It supports constraining to a node or viewport. It supports tick based moves and XY axis constraints. * @class DDConstrained * @extends Base * @constructor@@ -51,7 +56,7 @@ */ EV_TICK_ALIGN_Y = 'drag:tickAlignY', - C = function(config) {+ C = function() { this._lazyAddAttrs = false; C.superclass.constructor.apply(this, arguments); };@@ -120,8 +125,9 @@ value: false }, /**+ * CSS style string for the gutter of a region (supports negative values): '5 0'+ * (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @attribute gutter- * @description CSS style string for the gutter of a region (supports negative values): '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @type String */ gutter: {@@ -177,7 +183,7 @@ * @type Object */ constrain2view: {- setter: function(n) {+ setter: function() { return this.set('constrain', VIEW); } },@@ -208,7 +214,7 @@ destructor: function() { Y.each( this._eventHandles,- function(handle, index) {+ function(handle) { handle.detach(); } );@@ -226,7 +232,7 @@ EV_TICK_ALIGN_Y ]; - Y.each(ev, function(v, k) {+ Y.each(ev, function(v) { this.publish(v, { type: v, emitFacade: true,@@ -307,7 +313,7 @@ } Y.each(g, function(i, n) {- if ((n == RIGHT) || (n == BOTTOM)) {+ if ((n === RIGHT) || (n === BOTTOM)) { region[n] -= i; } else { region[n] += i;@@ -340,7 +346,8 @@ * @private * @method _checkRegion * @description Check if xy is inside a given region, if not change to it be inside.- * @param {Array} _xy The XY to check if it's in the current region, if it isn't inside the region, it will reset the xy array to be inside the region.+ * @param {Array} _xy The XY to check if it's in the current region, if it isn't+ * inside the region, it will reset the xy array to be inside the region. * @return {Array} The new XY that is inside the region */ _checkRegion: function(_xy) {@@ -410,7 +417,7 @@ * @method drag * @description Fires after drag:drag. Handle the tickX and tickX align events. */- drag: function(event) {+ drag: function() { var host = this.get(HOST), xt = this.get('tickX'), yt = this.get('tickY'),@@ -558,4 +565,4 @@ -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-ddm-base/dd-ddm-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/dd-ddm-base/dd-ddm-base.js", code: [] };-_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].code=["YUI.add('dd-ddm-base', function (Y, NAME) {","",""," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @module dd"," * @submodule dd-ddm-base"," */ "," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @class DDM"," * @extends Base"," * @constructor"," * @namespace DD"," */"," "," var DDMBase = function() {"," DDMBase.superclass.constructor.apply(this, arguments);"," };",""," DDMBase.NAME = 'ddm';",""," DDMBase.ATTRS = {"," /**"," * @attribute dragCursor"," * @description The cursor to apply when dragging, if shimmed the shim will get the cursor."," * @type String"," */"," dragCursor: {"," value: 'move'"," },"," /**"," * @attribute clickPixelThresh"," * @description The number of pixels to move to start a drag operation, default is 3."," * @type Number"," */"," clickPixelThresh: {"," value: 3"," },"," /**"," * @attribute clickTimeThresh"," * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000."," * @type Number"," */ "," clickTimeThresh: {"," value: 1000"," },"," /**"," * @attribute throttleTime"," * @description The number of milliseconds to throttle the mousemove event. Default: 150"," * @type Number"," */ "," throttleTime: {"," //value: 150"," value: -1"," },"," /**"," * @attribute dragMode"," * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. "," * @type String"," */ "," dragMode: {"," value: 'point',"," setter: function(mode) {"," this._setDragMode(mode);"," return mode;"," } "," }",""," };",""," Y.extend(DDMBase, Y.Base, {"," _createPG: function() {},"," /**"," * @property _active"," * @description flag set when we activate our first drag, so DDM can start listening for events."," * @type {Boolean}"," */"," _active: null,"," /**"," * @private"," * @method _setDragMode"," * @description Handler for dragMode attribute setter."," * @param String/Number The Number value or the String for the DragMode to default all future drag instances to."," * @return Number The Mode to be set"," */"," _setDragMode: function(mode) {"," if (mode === null) {"," mode = Y.DD.DDM.get('dragMode');"," }"," switch (mode) {"," case 1:"," case 'intersect':"," return 1;"," case 2:"," case 'strict':"," return 2;"," case 0:"," case 'point':"," return 0;"," }"," return 0; "," },"," /**"," * @property CSS_PREFIX"," * @description The PREFIX to attach to all DD CSS class names"," * @type {String}"," */"," CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),"," _activateTargets: function() {}, "," /**"," * @private"," * @property _drags"," * @description Holder for all registered drag elements."," * @type {Array}"," */"," _drags: [],"," /**"," * @property activeDrag"," * @description A reference to the currently active draggable object."," * @type {Drag}"," */"," activeDrag: false,"," /**"," * @private"," * @method _regDrag"," * @description Adds a reference to the drag object to the DDM._drags array, called in the constructor of Drag."," * @param {Drag} d The Drag object"," */"," _regDrag: function(d) {"," if (this.getDrag(d.get('node'))) {"," return false;"," }"," "," if (!this._active) {"," this._setupListeners();"," }"," this._drags.push(d);"," return true;"," },"," /**"," * @private"," * @method _unregDrag"," * @description Remove this drag object from the DDM._drags array."," * @param {Drag} d The drag object."," */"," _unregDrag: function(d) {"," var tmp = [];"," Y.each(this._drags, function(n, i) {"," if (n !== d) {"," tmp[tmp.length] = n;"," }"," });"," this._drags = tmp;"," },"," /**"," * @private"," * @method _setupListeners"," * @description Add the document listeners."," */"," _setupListeners: function() {"," this._createPG();"," this._active = true;",""," var doc = Y.one(Y.config.doc);"," doc.on('mousemove', Y.throttle(Y.bind(this._docMove, this), this.get('throttleTime')));"," doc.on('mouseup', Y.bind(this._end, this));"," },"," /**"," * @private"," * @method _start"," * @description Internal method used by Drag to signal the start of a drag operation"," */"," _start: function() {"," this.fire('ddm:start');"," this._startDrag();"," },"," /**"," * @private"," * @method _startDrag"," * @description Factory method to be overwritten by other DDM's"," * @param {Number} x The x position of the drag element"," * @param {Number} y The y position of the drag element"," * @param {Number} w The width of the drag element"," * @param {Number} h The height of the drag element"," */"," _startDrag: function() {},"," /**"," * @private"," * @method _endDrag"," * @description Factory method to be overwritten by other DDM's"," */"," _endDrag: function() {},"," _dropMove: function() {},"," /**"," * @private"," * @method _end"," * @description Internal method used by Drag to signal the end of a drag operation"," */"," _end: function() {"," if (this.activeDrag) {"," this._shimming = false;"," this._endDrag();"," this.fire('ddm:end');"," this.activeDrag.end.call(this.activeDrag);"," this.activeDrag = null;"," }"," },"," /**"," * @method stopDrag"," * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag."," * @return {Self}"," * @chainable"," */ "," stopDrag: function() {"," if (this.activeDrag) {"," this._end();"," }"," return this;"," },"," /**"," * @private"," * @property _shimming"," * @description Set to true when drag starts and useShim is true. Used in pairing with _docMove"," * @see _docMove"," * @type {Boolean}"," */"," _shimming: false,"," /**"," * @private"," * @method _docMove"," * @description Internal listener for the mousemove on Document. Checks if the shim is in place to only call _move once per mouse move"," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _docMove: function(ev) {"," if (!this._shimming) {"," this._move(ev);"," }"," },"," /**"," * @private"," * @method _move"," * @description Internal listener for the mousemove DOM event to pass to the Drag's move method."," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _move: function(ev) {"," if (this.activeDrag) {"," this.activeDrag._move.call(this.activeDrag, ev);"," this._dropMove();"," }"," },"," /**"," * //TODO Private, rename??..."," * @private"," * @method cssSizestoObject"," * @description Helper method to use to set the gutter from the attribute setter."," * @param {String} gutter CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @return {Object} The gutter Object Literal."," */"," cssSizestoObject: function(gutter) {"," var x = gutter.split(' ');"," "," switch (x.length) {"," case 1: x[1] = x[2] = x[3] = x[0]; break;"," case 2: x[2] = x[0]; x[3] = x[1]; break;"," case 3: x[3] = x[1]; break;"," }",""," return {"," top : parseInt(x[0],10),"," right : parseInt(x[1],10),"," bottom: parseInt(x[2],10),"," left : parseInt(x[3],10)"," };"," },"," /**"," * @method getDrag"," * @description Get a valid Drag instance back from a Node or a selector string, false otherwise"," * @param {String/Object} node The Node instance or Selector string to check for a valid Drag Object"," * @return {Object}"," */"," getDrag: function(node) {"," var drag = false,"," n = Y.one(node);"," if (n instanceof Y.Node) {"," Y.each(this._drags, function(v, k) {"," if (n.compareTo(v.get('node'))) {"," drag = v;"," }"," });"," }"," return drag;"," },"," /**"," * @method swapPosition"," * @description Swap the position of 2 nodes based on their CSS positioning."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapPosition: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var xy1 = n1.getXY(),"," xy2 = n2.getXY();",""," n1.setXY(xy2);"," n2.setXY(xy1);"," return n1;"," },"," /**"," * @method getNode"," * @description Return a node instance from the given node, selector string or Y.Base extended object."," * @param {Node/Object/String} n The node to resolve."," * @return {Node}"," */"," getNode: function(n) {"," if (n instanceof Y.Node) {"," return n;"," }"," if (n && n.get) {"," if (Y.Widget && (n instanceof Y.Widget)) {"," n = n.get('boundingBox');"," } else {"," n = n.get('node');"," }"," } else {"," n = Y.one(n);"," }"," return n;"," },"," /**"," * @method swapNode"," * @description Swap the position of 2 nodes based on their DOM location."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapNode: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var p = n2.get('parentNode'),"," s = n2.get('nextSibling');",""," if (s == n1) {"," p.insertBefore(n1, n2);"," } else if (n2 == n1.get('nextSibling')) {"," p.insertBefore(n2, n1);"," } else {"," n1.get('parentNode').replaceChild(n2, n1);"," p.insertBefore(n1, s);"," }"," return n1;"," }"," });",""," Y.namespace('DD');"," Y.DD.DDM = new DDMBase();",""," /**"," * @event ddm:start"," * @description Fires from the DDM before all drag events fire."," * @type {CustomEvent}"," */"," /**"," * @event ddm:end"," * @description Fires from the DDM after the DDM finishes, before the drag end events."," * @type {CustomEvent}"," */","","","","","}, '3.7.2', {\"requires\": [\"node\", \"base\", \"yui-throttle\", \"classnamemanager\"]});"];-_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].lines = {"1":0,"17":0,"18":0,"21":0,"23":0,"65":0,"66":0,"72":0,"88":0,"89":0,"91":0,"94":0,"97":0,"100":0,"102":0,"131":0,"132":0,"135":0,"136":0,"138":0,"139":0,"148":0,"149":0,"150":0,"151":0,"154":0,"162":0,"163":0,"165":0,"166":0,"167":0,"175":0,"176":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"216":0,"217":0,"219":0,"236":0,"237":0,"247":0,"248":0,"249":0,"261":0,"263":0,"264":0,"265":0,"266":0,"269":0,"283":0,"285":0,"286":0,"287":0,"288":0,"292":0,"302":0,"303":0,"304":0,"307":0,"308":0,"309":0,"318":0,"319":0,"321":0,"322":0,"323":0,"325":0,"328":0,"330":0,"340":0,"341":0,"342":0,"345":0,"346":0,"347":0,"348":0,"350":0,"351":0,"353":0,"357":0,"358":0};-_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].functions = {"DDMBase:17":0,"setter:64":0,"_setDragMode:87":0,"_regDrag:130":0,"(anonymous 2):149":0,"_unregDrag:147":0,"_setupListeners:161":0,"_start:174":0,"_end:200":0,"stopDrag:215":0,"_docMove:235":0,"_move:246":0,"cssSizestoObject:260":0,"(anonymous 3):286":0,"getDrag:282":0,"swapPosition:301":0,"getNode:317":0,"swapNode:339":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].code=["YUI.add('dd-ddm-base', function (Y, NAME) {","",""," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @module dd"," * @submodule dd-ddm-base"," */"," /**"," * Provides the base Drag Drop Manger required for making a Node draggable."," * @class DDM"," * @extends Base"," * @constructor"," * @namespace DD"," */",""," var DDMBase = function() {"," DDMBase.superclass.constructor.apply(this, arguments);"," };",""," DDMBase.NAME = 'ddm';",""," DDMBase.ATTRS = {"," /**"," * @attribute dragCursor"," * @description The cursor to apply when dragging, if shimmed the shim will get the cursor."," * @type String"," */"," dragCursor: {"," value: 'move'"," },"," /**"," * @attribute clickPixelThresh"," * @description The number of pixels to move to start a drag operation, default is 3."," * @type Number"," */"," clickPixelThresh: {"," value: 3"," },"," /**"," * @attribute clickTimeThresh"," * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000."," * @type Number"," */"," clickTimeThresh: {"," value: 1000"," },"," /**"," * @attribute throttleTime"," * @description The number of milliseconds to throttle the mousemove event. Default: 150"," * @type Number"," */"," throttleTime: {"," //value: 150"," value: -1"," },"," /**"," * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances."," * @attribute dragMode"," * @type String"," */"," dragMode: {"," value: 'point',"," setter: function(mode) {"," this._setDragMode(mode);"," return mode;"," }"," }",""," };",""," Y.extend(DDMBase, Y.Base, {"," _createPG: function() {},"," /**"," * @property _active"," * @description flag set when we activate our first drag, so DDM can start listening for events."," * @type {Boolean}"," */"," _active: null,"," /**"," * @private"," * @method _setDragMode"," * @description Handler for dragMode attribute setter."," * @param String/Number The Number value or the String for the DragMode to default all future drag instances to."," * @return Number The Mode to be set"," */"," _setDragMode: function(mode) {"," if (mode === null) {"," mode = Y.DD.DDM.get('dragMode');"," }"," switch (mode) {"," case 1:"," case 'intersect':"," return 1;"," case 2:"," case 'strict':"," return 2;"," case 0:"," case 'point':"," return 0;"," }"," return 0;"," },"," /**"," * @property CSS_PREFIX"," * @description The PREFIX to attach to all DD CSS class names"," * @type {String}"," */"," CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),"," _activateTargets: function() {},"," /**"," * @private"," * @property _drags"," * @description Holder for all registered drag elements."," * @type {Array}"," */"," _drags: [],"," /**"," * @property activeDrag"," * @description A reference to the currently active draggable object."," * @type {Drag}"," */"," activeDrag: false,"," /**"," * @private"," * @method _regDrag"," * @description Adds a reference to the drag object to the DDM._drags array, called in the constructor of Drag."," * @param {Drag} d The Drag object"," */"," _regDrag: function(d) {"," if (this.getDrag(d.get('node'))) {"," return false;"," }",""," if (!this._active) {"," this._setupListeners();"," }"," this._drags.push(d);"," return true;"," },"," /**"," * @private"," * @method _unregDrag"," * @description Remove this drag object from the DDM._drags array."," * @param {Drag} d The drag object."," */"," _unregDrag: function(d) {"," var tmp = [];"," Y.each(this._drags, function(n) {"," if (n !== d) {"," tmp[tmp.length] = n;"," }"," });"," this._drags = tmp;"," },"," /**"," * @private"," * @method _setupListeners"," * @description Add the document listeners."," */"," _setupListeners: function() {"," this._createPG();"," this._active = true;",""," var doc = Y.one(Y.config.doc);"," doc.on('mousemove', Y.throttle(Y.bind(this._docMove, this), this.get('throttleTime')));"," doc.on('mouseup', Y.bind(this._end, this));"," },"," /**"," * @private"," * @method _start"," * @description Internal method used by Drag to signal the start of a drag operation"," */"," _start: function() {"," this.fire('ddm:start');"," this._startDrag();"," },"," /**"," * @private"," * @method _startDrag"," * @description Factory method to be overwritten by other DDM's"," * @param {Number} x The x position of the drag element"," * @param {Number} y The y position of the drag element"," * @param {Number} w The width of the drag element"," * @param {Number} h The height of the drag element"," */"," _startDrag: function() {},"," /**"," * @private"," * @method _endDrag"," * @description Factory method to be overwritten by other DDM's"," */"," _endDrag: function() {},"," _dropMove: function() {},"," /**"," * @private"," * @method _end"," * @description Internal method used by Drag to signal the end of a drag operation"," */"," _end: function() {"," if (this.activeDrag) {"," this._shimming = false;"," this._endDrag();"," this.fire('ddm:end');"," this.activeDrag.end.call(this.activeDrag);"," this.activeDrag = null;"," }"," },"," /**"," * @method stopDrag"," * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag."," * @return {Self}"," * @chainable"," */"," stopDrag: function() {"," if (this.activeDrag) {"," this._end();"," }"," return this;"," },"," /**"," * @private"," * @property _shimming"," * @description Set to true when drag starts and useShim is true. Used in pairing with _docMove"," * @see _docMove"," * @type {Boolean}"," */"," _shimming: false,"," /**"," * @private"," * @method _docMove"," * @description Internal listener for the mousemove on Document. Checks if the shim is in place to only call _move once per mouse move"," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _docMove: function(ev) {"," if (!this._shimming) {"," this._move(ev);"," }"," },"," /**"," * @private"," * @method _move"," * @description Internal listener for the mousemove DOM event to pass to the Drag's move method."," * @param {Event.Facade} ev The Dom mousemove Event"," */"," _move: function(ev) {"," if (this.activeDrag) {"," this.activeDrag._move.call(this.activeDrag, ev);"," this._dropMove();"," }"," },"," /**"," * //TODO Private, rename??..."," * Helper method to use to set the gutter from the attribute setter."," * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)"," * @private"," * @method cssSizestoObject"," * @param {String} gutter CSS style string for gutter"," * @return {Object} The gutter Object Literal."," */"," cssSizestoObject: function(gutter) {"," var x = gutter.split(' ');",""," switch (x.length) {"," case 1: x[1] = x[2] = x[3] = x[0]; break;"," case 2: x[2] = x[0]; x[3] = x[1]; break;"," case 3: x[3] = x[1]; break;"," }",""," return {"," top : parseInt(x[0],10),"," right : parseInt(x[1],10),"," bottom: parseInt(x[2],10),"," left : parseInt(x[3],10)"," };"," },"," /**"," * @method getDrag"," * @description Get a valid Drag instance back from a Node or a selector string, false otherwise"," * @param {String/Object} node The Node instance or Selector string to check for a valid Drag Object"," * @return {Object}"," */"," getDrag: function(node) {"," var drag = false,"," n = Y.one(node);"," if (n instanceof Y.Node) {"," Y.each(this._drags, function(v) {"," if (n.compareTo(v.get('node'))) {"," drag = v;"," }"," });"," }"," return drag;"," },"," /**"," * @method swapPosition"," * @description Swap the position of 2 nodes based on their CSS positioning."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapPosition: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var xy1 = n1.getXY(),"," xy2 = n2.getXY();",""," n1.setXY(xy2);"," n2.setXY(xy1);"," return n1;"," },"," /**"," * @method getNode"," * @description Return a node instance from the given node, selector string or Y.Base extended object."," * @param {Node/Object/String} n The node to resolve."," * @return {Node}"," */"," getNode: function(n) {"," if (n instanceof Y.Node) {"," return n;"," }"," if (n && n.get) {"," if (Y.Widget && (n instanceof Y.Widget)) {"," n = n.get('boundingBox');"," } else {"," n = n.get('node');"," }"," } else {"," n = Y.one(n);"," }"," return n;"," },"," /**"," * @method swapNode"," * @description Swap the position of 2 nodes based on their DOM location."," * @param {Node} n1 The first node to swap"," * @param {Node} n2 The first node to swap"," * @return {Node}"," */"," swapNode: function(n1, n2) {"," n1 = Y.DD.DDM.getNode(n1);"," n2 = Y.DD.DDM.getNode(n2);"," var p = n2.get('parentNode'),"," s = n2.get('nextSibling');",""," if (s === n1) {"," p.insertBefore(n1, n2);"," } else if (n2 === n1.get('nextSibling')) {"," p.insertBefore(n2, n1);"," } else {"," n1.get('parentNode').replaceChild(n2, n1);"," p.insertBefore(n1, s);"," }"," return n1;"," }"," });",""," Y.namespace('DD');"," Y.DD.DDM = new DDMBase();",""," /**"," * @event ddm:start"," * @description Fires from the DDM before all drag events fire."," * @type {CustomEvent}"," */"," /**"," * @event ddm:end"," * @description Fires from the DDM after the DDM finishes, before the drag end events."," * @type {CustomEvent}"," */","","","","","}, '3.7.3', {\"requires\": [\"node\", \"base\", \"yui-throttle\", \"classnamemanager\"]});"];+_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].lines = {"1":0,"17":0,"18":0,"21":0,"23":0,"65":0,"66":0,"72":0,"88":0,"89":0,"91":0,"94":0,"97":0,"100":0,"102":0,"131":0,"132":0,"135":0,"136":0,"138":0,"139":0,"148":0,"149":0,"150":0,"151":0,"154":0,"162":0,"163":0,"165":0,"166":0,"167":0,"175":0,"176":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"216":0,"217":0,"219":0,"236":0,"237":0,"247":0,"248":0,"249":0,"262":0,"264":0,"265":0,"266":0,"267":0,"270":0,"284":0,"286":0,"287":0,"288":0,"289":0,"293":0,"303":0,"304":0,"305":0,"308":0,"309":0,"310":0,"319":0,"320":0,"322":0,"323":0,"324":0,"326":0,"329":0,"331":0,"341":0,"342":0,"343":0,"346":0,"347":0,"348":0,"349":0,"351":0,"352":0,"354":0,"358":0,"359":0};+_yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].functions = {"DDMBase:17":0,"setter:64":0,"_setDragMode:87":0,"_regDrag:130":0,"(anonymous 2):149":0,"_unregDrag:147":0,"_setupListeners:161":0,"_start:174":0,"_end:200":0,"stopDrag:215":0,"_docMove:235":0,"_move:246":0,"cssSizestoObject:261":0,"(anonymous 3):287":0,"getDrag:283":0,"swapPosition:302":0,"getNode:318":0,"swapNode:340":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].coveredLines = 85; _yuitest_coverage["build/dd-ddm-base/dd-ddm-base.js"].coveredFunctions = 19; _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 1);@@ -45,7 +45,7 @@ * Provides the base Drag Drop Manger required for making a Node draggable. * @module dd * @submodule dd-ddm-base- */ + */ /** * Provides the base Drag Drop Manger required for making a Node draggable. * @class DDM@@ -53,7 +53,7 @@ * @constructor * @namespace DD */- + _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 1)", 1); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 17); var DDMBase = function() {@@ -87,7 +87,7 @@ * @attribute clickTimeThresh * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000. * @type Number- */ + */ clickTimeThresh: { value: 1000 },@@ -95,16 +95,16 @@ * @attribute throttleTime * @description The number of milliseconds to throttle the mousemove event. Default: 150 * @type Number- */ + */ throttleTime: { //value: 150 value: -1 }, /**+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. * @attribute dragMode- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. * @type String- */ + */ dragMode: { value: 'point', setter: function(mode) {@@ -113,7 +113,7 @@ this._setDragMode(mode); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 66); return mode;- } + } } };@@ -157,7 +157,7 @@ return 0; } _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 102);-return 0; +return 0; }, /** * @property CSS_PREFIX@@ -165,7 +165,7 @@ * @type {String} */ CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),- _activateTargets: function() {}, + _activateTargets: function() {}, /** * @private * @property _drags@@ -192,7 +192,7 @@ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 132); return false; }- + _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 135); if (!this._active) { _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 136);@@ -214,7 +214,7 @@ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 148); var tmp = []; _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 149);-Y.each(this._drags, function(n, i) {+Y.each(this._drags, function(n) { _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 2)", 149); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 150); if (n !== d) {@@ -299,7 +299,7 @@ * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag. * @return {Self} * @chainable- */ + */ stopDrag: function() { _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "stopDrag", 215); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 216);@@ -350,28 +350,29 @@ }, /** * //TODO Private, rename??...+ * Helper method to use to set the gutter from the attribute setter.+ * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @private * @method cssSizestoObject- * @description Helper method to use to set the gutter from the attribute setter.- * @param {String} gutter CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)+ * @param {String} gutter CSS style string for gutter * @return {Object} The gutter Object Literal. */ cssSizestoObject: function(gutter) {- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "cssSizestoObject", 260);-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 261);+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "cssSizestoObject", 261);+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 262); var x = gutter.split(' ');- - _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 263);++ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 264); switch (x.length) {- case 1: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 264);+ case 1: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 265); x[1] = x[2] = x[3] = x[0]; break;- case 2: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 265);+ case 2: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 266); x[2] = x[0]; x[3] = x[1]; break;- case 3: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 266);+ case 3: _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 267); x[3] = x[1]; break; } - _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 269);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 270); return { top : parseInt(x[0],10), right : parseInt(x[1],10),@@ -386,23 +387,23 @@ * @return {Object} */ getDrag: function(node) {- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getDrag", 282);-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 283);+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getDrag", 283);+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 284); var drag = false, n = Y.one(node);- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 285);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 286); if (n instanceof Y.Node) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 286);-Y.each(this._drags, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 3)", 286);-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 287);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 287);+Y.each(this._drags, function(v) {+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "(anonymous 3)", 287);+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 288); if (n.compareTo(v.get('node'))) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 288);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 289); drag = v; } }); }- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 292);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 293); return drag; }, /**@@ -413,20 +414,20 @@ * @return {Node} */ swapPosition: function(n1, n2) {- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapPosition", 301);-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 302);+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapPosition", 302);+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 303); n1 = Y.DD.DDM.getNode(n1);- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 303);-n2 = Y.DD.DDM.getNode(n2); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 304);+n2 = Y.DD.DDM.getNode(n2);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 305); var xy1 = n1.getXY(), xy2 = n2.getXY(); - _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 307);-n1.setXY(xy2); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 308);-n2.setXY(xy1);+n1.setXY(xy2); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 309);+n2.setXY(xy1);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 310); return n1; }, /**@@ -436,27 +437,27 @@ * @return {Node} */ getNode: function(n) {- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getNode", 317);-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 318);+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "getNode", 318);+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 319); if (n instanceof Y.Node) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 319);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 320); return n; }- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 321);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 322); if (n && n.get) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 322);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 323); if (Y.Widget && (n instanceof Y.Widget)) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 323);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 324); n = n.get('boundingBox'); } else {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 325);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 326); n = n.get('node'); } } else {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 328);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 329); n = Y.one(n); }- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 330);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 331); return n; }, /**@@ -467,37 +468,37 @@ * @return {Node} */ swapNode: function(n1, n2) {- _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapNode", 339);-_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 340);+ _yuitest_coverfunc("build/dd-ddm-base/dd-ddm-base.js", "swapNode", 340);+_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 341); n1 = Y.DD.DDM.getNode(n1);- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 341);-n2 = Y.DD.DDM.getNode(n2); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 342);+n2 = Y.DD.DDM.getNode(n2);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 343); var p = n2.get('parentNode'), s = n2.get('nextSibling'); - _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 345);-if (s == n1) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 346);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 346);+if (s === n1) {+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 347); p.insertBefore(n1, n2);- } else {_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 347);-if (n2 == n1.get('nextSibling')) {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 348);+ } else {_yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 348);+if (n2 === n1.get('nextSibling')) {+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 349); p.insertBefore(n2, n1); } else {- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 350);-n1.get('parentNode').replaceChild(n2, n1); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 351);+n1.get('parentNode').replaceChild(n2, n1);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 352); p.insertBefore(n1, s); }}- _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 353);+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 354); return n1; } }); - _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 357);-Y.namespace('DD'); _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 358);+Y.namespace('DD');+ _yuitest_coverline("build/dd-ddm-base/dd-ddm-base.js", 359); Y.DD.DDM = new DDMBase(); /**@@ -514,4 +515,4 @@ -}, '3.7.2', {"requires": ["node", "base", "yui-throttle", "classnamemanager"]});+}, '3.7.3', {"requires": ["node", "base", "yui-throttle", "classnamemanager"]});
bundle/dd-ddm-base/dd-ddm-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the base Drag Drop Manger required for making a Node draggable. * @module dd * @submodule dd-ddm-base- */ + */ /** * Provides the base Drag Drop Manger required for making a Node draggable. * @class DDM@@ -19,7 +19,7 @@ * @constructor * @namespace DD */- + var DDMBase = function() { DDMBase.superclass.constructor.apply(this, arguments); };@@ -47,7 +47,7 @@ * @attribute clickTimeThresh * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000. * @type Number- */ + */ clickTimeThresh: { value: 1000 },@@ -55,22 +55,22 @@ * @attribute throttleTime * @description The number of milliseconds to throttle the mousemove event. Default: 150 * @type Number- */ + */ throttleTime: { //value: 150 value: -1 }, /**+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. * @attribute dragMode- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. * @type String- */ + */ dragMode: { value: 'point', setter: function(mode) { this._setDragMode(mode); return mode;- } + } } };@@ -105,7 +105,7 @@ case 'point': return 0; }- return 0; + return 0; }, /** * @property CSS_PREFIX@@ -113,7 +113,7 @@ * @type {String} */ CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),- _activateTargets: function() {}, + _activateTargets: function() {}, /** * @private * @property _drags@@ -137,7 +137,7 @@ if (this.getDrag(d.get('node'))) { return false; }- + if (!this._active) { this._setupListeners(); }@@ -152,7 +152,7 @@ */ _unregDrag: function(d) { var tmp = [];- Y.each(this._drags, function(n, i) {+ Y.each(this._drags, function(n) { if (n !== d) { tmp[tmp.length] = n; }@@ -217,7 +217,7 @@ * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag. * @return {Self} * @chainable- */ + */ stopDrag: function() { if (this.activeDrag) { this._end();@@ -257,15 +257,16 @@ }, /** * //TODO Private, rename??...+ * Helper method to use to set the gutter from the attribute setter.+ * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @private * @method cssSizestoObject- * @description Helper method to use to set the gutter from the attribute setter.- * @param {String} gutter CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)+ * @param {String} gutter CSS style string for gutter * @return {Object} The gutter Object Literal. */ cssSizestoObject: function(gutter) { var x = gutter.split(' ');- + switch (x.length) { case 1: x[1] = x[2] = x[3] = x[0]; break; case 2: x[2] = x[0]; x[3] = x[1]; break;@@ -289,7 +290,7 @@ var drag = false, n = Y.one(node); if (n instanceof Y.Node) {- Y.each(this._drags, function(v, k) {+ Y.each(this._drags, function(v) { if (n.compareTo(v.get('node'))) { drag = v; }@@ -348,9 +349,9 @@ var p = n2.get('parentNode'), s = n2.get('nextSibling'); - if (s == n1) {+ if (s === n1) { p.insertBefore(n1, n2);- } else if (n2 == n1.get('nextSibling')) {+ } else if (n2 === n1.get('nextSibling')) { p.insertBefore(n2, n1); } else { n1.get('parentNode').replaceChild(n2, n1);@@ -377,4 +378,4 @@ -}, '3.7.2', {"requires": ["node", "base", "yui-throttle", "classnamemanager"]});+}, '3.7.3', {"requires": ["node", "base", "yui-throttle", "classnamemanager"]});
bundle/dd-ddm-base/dd-ddm-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-ddm-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.NAME="ddm",n.ATTRS={dragCursor:{value:"move"},clickPixelThresh:{value:3},clickTimeThresh:{value:1e3},throttleTime:{value:-1},dragMode:{value:"point",setter:function(e){return this._setDragMode(e),e}}},e.extend(n,e.Base,{_createPG:function(){},_active:null,_setDragMode:function(t){t===null&&(t=e.DD.DDM.get("dragMode"));switch(t){case 1:case"intersect":return 1;case 2:case"strict":return 2;case 0:case"point":return 0}return 0},CSS_PREFIX:e.ClassNameManager.getClassName("dd"),_activateTargets:function(){},_drags:[],activeDrag:!1,_regDrag:function(e){return this.getDrag(e.get("node"))?!1:(this._active||this._setupListeners(),this._drags.push(e),!0)},_unregDrag:function(t){var n=[];e.each(this._drags,function(e,r){e!==t&&(n[n.length]=e)}),this._drags=n},_setupListeners:function(){this._createPG(),this._active=!0;var t=e.one(e.config.doc);t.on("mousemove",e.throttle(e.bind(this._docMove,this),this.get("throttleTime"))),t.on("mouseup",e.bind(this._end,this))},_start:function(){this.fire("ddm:start"),this._startDrag()},_startDrag:function(){},_endDrag:function(){},_dropMove:function(){},_end:function(){this.activeDrag&&(this._shimming=!1,this._endDrag(),this.fire("ddm:end"),this.activeDrag.end.call(this.activeDrag),this.activeDrag=null)},stopDrag:function(){return this.activeDrag&&this._end(),this},_shimming:!1,_docMove:function(e){this._shimming||this._move(e)},_move:function(e){this.activeDrag&&(this.activeDrag._move.call(this.activeDrag,e),this._dropMove())},cssSizestoObject:function(e){var t=e.split(" ");switch(t.length){case 1:t[1]=t[2]=t[3]=t[0];break;case 2:t[2]=t[0],t[3]=t[1];break;case 3:t[3]=t[1]}return{top:parseInt(t[0],10),right:parseInt(t[1],10),bottom:parseInt(t[2],10),left:parseInt(t[3],10)}},getDrag:function(t){var n=!1,r=e.one(t);return r instanceof e.Node&&e.each(this._drags,function(e,t){r.compareTo(e.get("node"))&&(n=e)}),n},swapPosition:function(t,n){t=e.DD.DDM.getNode(t),n=e.DD.DDM.getNode(n);var r=t.getXY(),i=n.getXY();return t.setXY(i),n.setXY(r),t},getNode:function(t){return t instanceof e.Node?t:(t&&t.get?e.Widget&&t instanceof e.Widget?t=t.get("boundingBox"):t=t.get("node"):t=e.one(t),t)},swapNode:function(t,n){t=e.DD.DDM.getNode(t),n=e.DD.DDM.getNode(n);var r=n.get("parentNode"),i=n.get("nextSibling");return i==t?r.insertBefore(t,n):n==t.get("nextSibling")?r.insertBefore(n,t):(t.get("parentNode").replaceChild(n,t),r.insertBefore(t,i)),t}}),e.namespace("DD"),e.DD.DDM=new n},"3.7.2",{requires:["node","base","yui-throttle","classnamemanager"]});+YUI.add("dd-ddm-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};n.NAME="ddm",n.ATTRS={dragCursor:{value:"move"},clickPixelThresh:{value:3},clickTimeThresh:{value:1e3},throttleTime:{value:-1},dragMode:{value:"point",setter:function(e){return this._setDragMode(e),e}}},e.extend(n,e.Base,{_createPG:function(){},_active:null,_setDragMode:function(t){t===null&&(t=e.DD.DDM.get("dragMode"));switch(t){case 1:case"intersect":return 1;case 2:case"strict":return 2;case 0:case"point":return 0}return 0},CSS_PREFIX:e.ClassNameManager.getClassName("dd"),_activateTargets:function(){},_drags:[],activeDrag:!1,_regDrag:function(e){return this.getDrag(e.get("node"))?!1:(this._active||this._setupListeners(),this._drags.push(e),!0)},_unregDrag:function(t){var n=[];e.each(this._drags,function(e){e!==t&&(n[n.length]=e)}),this._drags=n},_setupListeners:function(){this._createPG(),this._active=!0;var t=e.one(e.config.doc);t.on("mousemove",e.throttle(e.bind(this._docMove,this),this.get("throttleTime"))),t.on("mouseup",e.bind(this._end,this))},_start:function(){this.fire("ddm:start"),this._startDrag()},_startDrag:function(){},_endDrag:function(){},_dropMove:function(){},_end:function(){this.activeDrag&&(this._shimming=!1,this._endDrag(),this.fire("ddm:end"),this.activeDrag.end.call(this.activeDrag),this.activeDrag=null)},stopDrag:function(){return this.activeDrag&&this._end(),this},_shimming:!1,_docMove:function(e){this._shimming||this._move(e)},_move:function(e){this.activeDrag&&(this.activeDrag._move.call(this.activeDrag,e),this._dropMove())},cssSizestoObject:function(e){var t=e.split(" ");switch(t.length){case 1:t[1]=t[2]=t[3]=t[0];break;case 2:t[2]=t[0],t[3]=t[1];break;case 3:t[3]=t[1]}return{top:parseInt(t[0],10),right:parseInt(t[1],10),bottom:parseInt(t[2],10),left:parseInt(t[3],10)}},getDrag:function(t){var n=!1,r=e.one(t);return r instanceof e.Node&&e.each(this._drags,function(e){r.compareTo(e.get("node"))&&(n=e)}),n},swapPosition:function(t,n){t=e.DD.DDM.getNode(t),n=e.DD.DDM.getNode(n);var r=t.getXY(),i=n.getXY();return t.setXY(i),n.setXY(r),t},getNode:function(t){return t instanceof e.Node?t:(t&&t.get?e.Widget&&t instanceof e.Widget?t=t.get("boundingBox"):t=t.get("node"):t=e.one(t),t)},swapNode:function(t,n){t=e.DD.DDM.getNode(t),n=e.DD.DDM.getNode(n);var r=n.get("parentNode"),i=n.get("nextSibling");return i===t?r.insertBefore(t,n):n===t.get("nextSibling")?r.insertBefore(n,t):(t.get("parentNode").replaceChild(n,t),r.insertBefore(t,i)),t}}),e.namespace("DD"),e.DD.DDM=new n},"3.7.3",{requires:["node","base","yui-throttle","classnamemanager"]});
bundle/dd-ddm-base/dd-ddm-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the base Drag Drop Manger required for making a Node draggable. * @module dd * @submodule dd-ddm-base- */ + */ /** * Provides the base Drag Drop Manger required for making a Node draggable. * @class DDM@@ -19,7 +19,7 @@ * @constructor * @namespace DD */- + var DDMBase = function() { DDMBase.superclass.constructor.apply(this, arguments); };@@ -47,7 +47,7 @@ * @attribute clickTimeThresh * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000. * @type Number- */ + */ clickTimeThresh: { value: 1000 },@@ -55,22 +55,22 @@ * @attribute throttleTime * @description The number of milliseconds to throttle the mousemove event. Default: 150 * @type Number- */ + */ throttleTime: { //value: 150 value: -1 }, /**+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. * @attribute dragMode- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of all future Drag instances. * @type String- */ + */ dragMode: { value: 'point', setter: function(mode) { this._setDragMode(mode); return mode;- } + } } };@@ -105,7 +105,7 @@ case 'point': return 0; }- return 0; + return 0; }, /** * @property CSS_PREFIX@@ -113,7 +113,7 @@ * @type {String} */ CSS_PREFIX: Y.ClassNameManager.getClassName('dd'),- _activateTargets: function() {}, + _activateTargets: function() {}, /** * @private * @property _drags@@ -137,7 +137,7 @@ if (this.getDrag(d.get('node'))) { return false; }- + if (!this._active) { this._setupListeners(); }@@ -152,7 +152,7 @@ */ _unregDrag: function(d) { var tmp = [];- Y.each(this._drags, function(n, i) {+ Y.each(this._drags, function(n) { if (n !== d) { tmp[tmp.length] = n; }@@ -217,7 +217,7 @@ * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag. * @return {Self} * @chainable- */ + */ stopDrag: function() { if (this.activeDrag) { this._end();@@ -257,15 +257,16 @@ }, /** * //TODO Private, rename??...+ * Helper method to use to set the gutter from the attribute setter.+ * CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px) * @private * @method cssSizestoObject- * @description Helper method to use to set the gutter from the attribute setter.- * @param {String} gutter CSS style string for gutter: '5 0' (sets top and bottom to 5px, left and right to 0px), '1 2 3 4' (top 1px, right 2px, bottom 3px, left 4px)+ * @param {String} gutter CSS style string for gutter * @return {Object} The gutter Object Literal. */ cssSizestoObject: function(gutter) { var x = gutter.split(' ');- + switch (x.length) { case 1: x[1] = x[2] = x[3] = x[0]; break; case 2: x[2] = x[0]; x[3] = x[1]; break;@@ -289,7 +290,7 @@ var drag = false, n = Y.one(node); if (n instanceof Y.Node) {- Y.each(this._drags, function(v, k) {+ Y.each(this._drags, function(v) { if (n.compareTo(v.get('node'))) { drag = v; }@@ -348,9 +349,9 @@ var p = n2.get('parentNode'), s = n2.get('nextSibling'); - if (s == n1) {+ if (s === n1) { p.insertBefore(n1, n2);- } else if (n2 == n1.get('nextSibling')) {+ } else if (n2 === n1.get('nextSibling')) { p.insertBefore(n2, n1); } else { n1.get('parentNode').replaceChild(n2, n1);@@ -377,4 +378,4 @@ -}, '3.7.2', {"requires": ["node", "base", "yui-throttle", "classnamemanager"]});+}, '3.7.3', {"requires": ["node", "base", "yui-throttle", "classnamemanager"]});
bundle/dd-ddm-drop/dd-ddm-drop-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/dd-ddm-drop/dd-ddm-drop.js", code: [] };-_yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].code=["YUI.add('dd-ddm-drop', function (Y, NAME) {","",""," /**"," * Extends the dd-ddm Class to add support for the placement of Drop Target shims inside the viewport shim. It also handles all Drop Target related events and interactions."," * @module dd"," * @submodule dd-ddm-drop"," * @for DDM"," * @namespace DD"," */",""," //TODO CSS class name for the bestMatch.."," Y.mix(Y.DD.DDM, {"," /**"," * @private"," * @property _noShim"," * @description This flag turns off the use of the mouseover/mouseout shim. It should not be used unless you know what you are doing."," * @type {Boolean}"," */"," _noShim: false,"," /**"," * @private"," * @property _activeShims"," * @description Placeholder for all active shims on the page"," * @type {Array}"," */"," _activeShims: [],"," /**"," * @private"," * @method _hasActiveShim"," * @description This method checks the _activeShims Object to see if there is a shim active."," * @return {Boolean}"," */"," _hasActiveShim: function() {"," if (this._noShim) {"," return true;"," }"," return this._activeShims.length;"," },"," /**"," * @private"," * @method _addActiveShim "," * @description Adds a Drop Target to the list of active shims"," * @param {Object} d The Drop instance to add to the list."," */"," _addActiveShim: function(d) {"," this._activeShims[this._activeShims.length] = d;"," },"," /**"," * @private"," * @method _removeActiveShim "," * @description Removes a Drop Target to the list of active shims"," * @param {Object} d The Drop instance to remove from the list."," */"," _removeActiveShim: function(d) {"," var s = [];"," Y.each(this._activeShims, function(v, k) {"," if (v._yuid !== d._yuid) {"," s[s.length] = v;"," }"," "," });"," this._activeShims = s;"," },"," /**"," * @method syncActiveShims"," * @description This method will sync the position of the shims on the Drop Targets that are currently active."," * @param {Boolean} force Resize/sync all Targets."," */"," syncActiveShims: function(force) {"," Y.later(0, this, function(force) {"," var drops = ((force) ? this.targets : this._lookup());"," Y.each(drops, function(v, k) {"," v.sizeShim.call(v);"," }, this);"," }, force);"," },"," /**"," * @private"," * @property mode"," * @description The mode that the drag operations will run in 0 for Point, 1 for Intersect, 2 for Strict"," * @type Number"," */"," mode: 0,"," /**"," * @private"," * @property POINT"," * @description In point mode, a Drop is targeted by the cursor being over the Target"," * @type Number"," */"," POINT: 0,"," /**"," * @private"," * @property INTERSECT"," * @description In intersect mode, a Drop is targeted by \"part\" of the drag node being over the Target"," * @type Number"," */"," INTERSECT: 1,"," /**"," * @private"," * @property STRICT"," * @description In strict mode, a Drop is targeted by the \"entire\" drag node being over the Target"," * @type Number"," */"," STRICT: 2,"," /**"," * @property useHash"," * @description Should we only check targets that are in the viewport on drags (for performance), default: true"," * @type {Boolean}"," */"," useHash: true,"," /**"," * @property activeDrop"," * @description A reference to the active Drop Target"," * @type {Object}"," */"," activeDrop: null,"," /**"," * @property validDrops"," * @description An array of the valid Drop Targets for this interaction."," * @type {Array}"," */"," //TODO Change array/object literals to be in sync.."," validDrops: [],"," /**"," * @property otherDrops"," * @description An object literal of Other Drop Targets that we encountered during this interaction (in the case of overlapping Drop Targets)"," * @type {Object}"," */"," otherDrops: {},"," /**"," * @property targets"," * @description All of the Targets"," * @type {Array}"," */"," targets: [],"," /**"," * @private "," * @method _addValid"," * @description Add a Drop Target to the list of Valid Targets. This list get's regenerated on each new drag operation."," * @param {Object} drop"," * @return {Self}"," * @chainable"," */"," _addValid: function(drop) {"," this.validDrops[this.validDrops.length] = drop;"," return this;"," },"," /**"," * @private "," * @method _removeValid"," * @description Removes a Drop Target from the list of Valid Targets. This list get's regenerated on each new drag operation."," * @param {Object} drop"," * @return {Self}"," * @chainable"," */"," _removeValid: function(drop) {"," var drops = [];"," Y.each(this.validDrops, function(v, k) {"," if (v !== drop) {"," drops[drops.length] = v;"," }"," });",""," this.validDrops = drops;"," return this;"," },"," /**"," * @method isOverTarget"," * @description Check to see if the Drag element is over the target, method varies on current mode"," * @param {Object} drop The drop to check against"," * @return {Boolean}"," */"," isOverTarget: function(drop) {"," if (this.activeDrag && drop) {"," var xy = this.activeDrag.mouseXY, r, dMode = this.activeDrag.get('dragMode'),"," aRegion, node = drop.shim;"," if (xy && this.activeDrag) {"," aRegion = this.activeDrag.region;"," if (dMode == this.STRICT) {"," return this.activeDrag.get('dragNode').inRegion(drop.region, true, aRegion);"," }"," if (drop && drop.shim) {"," if ((dMode == this.INTERSECT) && this._noShim) {"," r = aRegion || this.activeDrag.get('node');"," return drop.get('node').intersect(r, drop.region).inRegion;"," }",""," if (this._noShim) {"," node = drop.get('node');"," }"," return node.intersect({"," top: xy[1],"," bottom: xy[1],"," left: xy[0], "," right: xy[0]"," }, drop.region).inRegion;"," }"," }"," }"," return false;"," },"," /**"," * @method clearCache"," * @description Clears the cache data used for this interaction."," */"," clearCache: function() {"," this.validDrops = [];"," this.otherDrops = {};"," this._activeShims = [];"," },"," /**"," * @private"," * @method _activateTargets"," * @description Clear the cache and activate the shims of all the targets"," */"," _activateTargets: function() {"," this._noShim = true;"," this.clearCache();"," Y.each(this.targets, function(v, k) {"," v._activateShim([]);"," if (v.get('noShim') == true) {"," this._noShim = false;"," }"," }, this);"," this._handleTargetOver();"," "," },"," /**"," * @method getBestMatch"," * @description This method will gather the area for all potential targets and see which has the hightest covered area and return it."," * @param {Array} drops An Array of drops to scan for the best match."," * @param {Boolean} all If present, it returns an Array. First item is best match, second is an Array of the other items in the original Array."," * @return {Object or Array} "," */"," getBestMatch: function(drops, all) {"," var biggest = null, area = 0, out;"," "," Y.each(drops, function(v, k) {"," var inter = this.activeDrag.get('dragNode').intersect(v.get('node'));"," v.region.area = inter.area;",""," if (inter.inRegion) {"," if (inter.area > area) {"," area = inter.area;"," biggest = v;"," }"," }"," }, this);"," if (all) {"," out = [];"," //TODO Sort the others in numeric order by area covered.."," Y.each(drops, function(v, k) {"," if (v !== biggest) {"," out[out.length] = v;"," }"," }, this);"," return [biggest, out];"," }"," return biggest;"," },"," /**"," * @private"," * @method _deactivateTargets"," * @description This method fires the drop:hit, drag:drophit, drag:dropmiss methods and deactivates the shims.."," */"," _deactivateTargets: function() {"," var other = [], tmp,"," activeDrag = this.activeDrag,"," activeDrop = this.activeDrop;"," "," //TODO why is this check so hard??"," if (activeDrag && activeDrop && this.otherDrops[activeDrop]) {"," if (!activeDrag.get('dragMode')) {"," //TODO otherDrops -- private.."," other = this.otherDrops;"," delete other[activeDrop];"," } else {"," tmp = this.getBestMatch(this.otherDrops, true);"," activeDrop = tmp[0];"," other = tmp[1];"," }"," activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over');"," if (activeDrop) {"," activeDrop.fire('drop:hit', { drag: activeDrag, drop: activeDrop, others: other });"," activeDrag.fire('drag:drophit', { drag: activeDrag, drop: activeDrop, others: other });"," }"," } else if (activeDrag && activeDrag.get('dragging')) {"," activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over');"," activeDrag.fire('drag:dropmiss', { pageX: activeDrag.lastXY[0], pageY: activeDrag.lastXY[1] });"," }"," "," this.activeDrop = null;",""," Y.each(this.targets, function(v, k) {"," v._deactivateShim([]);"," }, this);"," },"," /**"," * @private"," * @method _dropMove"," * @description This method is called when the move method is called on the Drag Object."," */"," _dropMove: function() {"," if (this._hasActiveShim()) {"," this._handleTargetOver();"," } else {"," Y.each(this.otherDrops, function(v, k) {"," v._handleOut.apply(v, []);"," });"," }"," },"," /**"," * @private"," * @method _lookup"," * @description Filters the list of Drops down to those in the viewport."," * @return {Array} The valid Drop Targets that are in the viewport."," */"," _lookup: function() {"," if (!this.useHash || this._noShim) {"," return this.validDrops;"," }"," var drops = [];"," //Only scan drop shims that are in the Viewport"," Y.each(this.validDrops, function(v, k) {"," if (v.shim && v.shim.inViewportRegion(false, v.region)) {"," drops[drops.length] = v;"," }"," });"," return drops;"," "," },"," /**"," * @private"," * @method _handleTargetOver"," * @description This method execs _handleTargetOver on all valid Drop Targets"," */"," _handleTargetOver: function() {"," var drops = this._lookup();"," Y.each(drops, function(v, k) {"," v._handleTargetOver.call(v);"," }, this);"," },"," /**"," * @private"," * @method _regTarget"," * @description Add the passed in Target to the targets collection"," * @param {Object} t The Target to add to the targets collection"," */"," _regTarget: function(t) {"," this.targets[this.targets.length] = t;"," },"," /**"," * @private"," * @method _unregTarget"," * @description Remove the passed in Target from the targets collection"," * @param {Object} drop The Target to remove from the targets collection"," */"," _unregTarget: function(drop) {"," var targets = [], vdrops;"," Y.each(this.targets, function(v, k) {"," if (v != drop) {"," targets[targets.length] = v;"," }"," }, this);"," this.targets = targets;",""," vdrops = [];"," Y.each(this.validDrops, function(v, k) {"," if (v !== drop) {"," vdrops[vdrops.length] = v;"," }"," });",""," this.validDrops = vdrops;"," },"," /**"," * @method getDrop"," * @description Get a valid Drop instance back from a Node or a selector string, false otherwise"," * @param {String/Object} node The Node instance or Selector string to check for a valid Drop Object"," * @return {Object}"," */"," getDrop: function(node) {"," var drop = false,"," n = Y.one(node);"," if (n instanceof Y.Node) {"," Y.each(this.targets, function(v, k) {"," if (n.compareTo(v.get('node'))) {"," drop = v;"," }"," });"," }"," return drop;"," }"," }, true);","","","","","}, '3.7.2', {\"requires\": [\"dd-ddm\"]});"];-_yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].lines = {"1":0,"13":0,"35":0,"36":0,"38":0,"47":0,"56":0,"57":0,"58":0,"59":0,"63":0,"71":0,"72":0,"73":0,"74":0,"146":0,"147":0,"158":0,"159":0,"160":0,"161":0,"165":0,"166":0,"175":0,"176":0,"178":0,"179":0,"180":0,"181":0,"183":0,"184":0,"185":0,"186":0,"189":0,"190":0,"192":0,"201":0,"208":0,"209":0,"210":0,"218":0,"219":0,"220":0,"221":0,"222":0,"223":0,"226":0,"237":0,"239":0,"240":0,"241":0,"243":0,"244":0,"245":0,"246":0,"250":0,"251":0,"253":0,"254":0,"255":0,"258":0,"260":0,"268":0,"273":0,"274":0,"276":0,"277":0,"279":0,"280":0,"281":0,"283":0,"284":0,"285":0,"286":0,"288":0,"289":0,"290":0,"293":0,"295":0,"296":0,"305":0,"306":0,"308":0,"309":0,"320":0,"321":0,"323":0,"325":0,"326":0,"327":0,"330":0,"339":0,"340":0,"341":0,"351":0,"360":0,"361":0,"362":0,"363":0,"366":0,"368":0,"369":0,"370":0,"371":0,"375":0,"384":0,"386":0,"387":0,"388":0,"389":0,"393":0};-_yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].functions = {"_hasActiveShim:34":0,"_addActiveShim:46":0,"(anonymous 2):57":0,"_removeActiveShim:55":0,"(anonymous 4):73":0,"(anonymous 3):71":0,"syncActiveShims:70":0,"_addValid:145":0,"(anonymous 5):159":0,"_removeValid:157":0,"isOverTarget:174":0,"clearCache:207":0,"(anonymous 6):220":0,"_activateTargets:217":0,"(anonymous 7):239":0,"(anonymous 8):253":0,"getBestMatch:236":0,"(anonymous 9):295":0,"_deactivateTargets:267":0,"(anonymous 10):308":0,"_dropMove:304":0,"(anonymous 11):325":0,"_lookup:319":0,"(anonymous 12):340":0,"_handleTargetOver:338":0,"_regTarget:350":0,"(anonymous 13):361":0,"(anonymous 14):369":0,"_unregTarget:359":0,"(anonymous 15):387":0,"getDrop:383":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].code=["YUI.add('dd-ddm-drop', function (Y, NAME) {","",""," /**"," * Extends the dd-ddm Class to add support for the placement of Drop Target"," * shims inside the viewport shim. It also handles all Drop Target related events and interactions."," * @module dd"," * @submodule dd-ddm-drop"," * @for DDM"," * @namespace DD"," */",""," //TODO CSS class name for the bestMatch.."," Y.mix(Y.DD.DDM, {"," /**"," * @private"," * @property _noShim"," * @description This flag turns off the use of the mouseover/mouseout shim. It should not be used unless you know what you are doing."," * @type {Boolean}"," */"," _noShim: false,"," /**"," * @private"," * @property _activeShims"," * @description Placeholder for all active shims on the page"," * @type {Array}"," */"," _activeShims: [],"," /**"," * @private"," * @method _hasActiveShim"," * @description This method checks the _activeShims Object to see if there is a shim active."," * @return {Boolean}"," */"," _hasActiveShim: function() {"," if (this._noShim) {"," return true;"," }"," return this._activeShims.length;"," },"," /**"," * @private"," * @method _addActiveShim"," * @description Adds a Drop Target to the list of active shims"," * @param {Object} d The Drop instance to add to the list."," */"," _addActiveShim: function(d) {"," this._activeShims[this._activeShims.length] = d;"," },"," /**"," * @private"," * @method _removeActiveShim"," * @description Removes a Drop Target to the list of active shims"," * @param {Object} d The Drop instance to remove from the list."," */"," _removeActiveShim: function(d) {"," var s = [];"," Y.each(this._activeShims, function(v) {"," if (v._yuid !== d._yuid) {"," s[s.length] = v;"," }",""," });"," this._activeShims = s;"," },"," /**"," * @method syncActiveShims"," * @description This method will sync the position of the shims on the Drop Targets that are currently active."," * @param {Boolean} force Resize/sync all Targets."," */"," syncActiveShims: function(force) {"," Y.later(0, this, function(force) {"," var drops = ((force) ? this.targets : this._lookup());"," Y.each(drops, function(v) {"," v.sizeShim.call(v);"," }, this);"," }, force);"," },"," /**"," * @private"," * @property mode"," * @description The mode that the drag operations will run in 0 for Point, 1 for Intersect, 2 for Strict"," * @type Number"," */"," mode: 0,"," /**"," * @private"," * @property POINT"," * @description In point mode, a Drop is targeted by the cursor being over the Target"," * @type Number"," */"," POINT: 0,"," /**"," * @private"," * @property INTERSECT"," * @description In intersect mode, a Drop is targeted by \"part\" of the drag node being over the Target"," * @type Number"," */"," INTERSECT: 1,"," /**"," * @private"," * @property STRICT"," * @description In strict mode, a Drop is targeted by the \"entire\" drag node being over the Target"," * @type Number"," */"," STRICT: 2,"," /**"," * @property useHash"," * @description Should we only check targets that are in the viewport on drags (for performance), default: true"," * @type {Boolean}"," */"," useHash: true,"," /**"," * @property activeDrop"," * @description A reference to the active Drop Target"," * @type {Object}"," */"," activeDrop: null,"," /**"," * @property validDrops"," * @description An array of the valid Drop Targets for this interaction."," * @type {Array}"," */"," //TODO Change array/object literals to be in sync.."," validDrops: [],"," /**"," * @property otherDrops"," * @description An object literal of Other Drop Targets that we encountered during this interaction (in the case of overlapping Drop Targets)"," * @type {Object}"," */"," otherDrops: {},"," /**"," * @property targets"," * @description All of the Targets"," * @type {Array}"," */"," targets: [],"," /**"," * @private"," * @method _addValid"," * @description Add a Drop Target to the list of Valid Targets. This list get's regenerated on each new drag operation."," * @param {Object} drop"," * @return {Self}"," * @chainable"," */"," _addValid: function(drop) {"," this.validDrops[this.validDrops.length] = drop;"," return this;"," },"," /**"," * @private"," * @method _removeValid"," * @description Removes a Drop Target from the list of Valid Targets. This list get's regenerated on each new drag operation."," * @param {Object} drop"," * @return {Self}"," * @chainable"," */"," _removeValid: function(drop) {"," var drops = [];"," Y.each(this.validDrops, function(v) {"," if (v !== drop) {"," drops[drops.length] = v;"," }"," });",""," this.validDrops = drops;"," return this;"," },"," /**"," * @method isOverTarget"," * @description Check to see if the Drag element is over the target, method varies on current mode"," * @param {Object} drop The drop to check against"," * @return {Boolean}"," */"," isOverTarget: function(drop) {"," if (this.activeDrag && drop) {"," var xy = this.activeDrag.mouseXY, r, dMode = this.activeDrag.get('dragMode'),"," aRegion, node = drop.shim;"," if (xy && this.activeDrag) {"," aRegion = this.activeDrag.region;"," if (dMode === this.STRICT) {"," return this.activeDrag.get('dragNode').inRegion(drop.region, true, aRegion);"," }"," if (drop && drop.shim) {"," if ((dMode === this.INTERSECT) && this._noShim) {"," r = aRegion || this.activeDrag.get('node');"," return drop.get('node').intersect(r, drop.region).inRegion;"," }",""," if (this._noShim) {"," node = drop.get('node');"," }"," return node.intersect({"," top: xy[1],"," bottom: xy[1],"," left: xy[0],"," right: xy[0]"," }, drop.region).inRegion;"," }"," }"," }"," return false;"," },"," /**"," * @method clearCache"," * @description Clears the cache data used for this interaction."," */"," clearCache: function() {"," this.validDrops = [];"," this.otherDrops = {};"," this._activeShims = [];"," },"," /**"," * @private"," * @method _activateTargets"," * @description Clear the cache and activate the shims of all the targets"," */"," _activateTargets: function() {"," this._noShim = true;"," this.clearCache();"," Y.each(this.targets, function(v) {"," v._activateShim([]);"," if (v.get('noShim') === true) {"," this._noShim = false;"," }"," }, this);"," this._handleTargetOver();",""," },"," /**"," * @method getBestMatch"," * @description This method will gather the area for all potential targets and see which has the hightest covered area and return it."," * @param {Array} drops An Array of drops to scan for the best match."," * @param {Boolean} all If present, it returns an Array. First item is best match, second is an Array of the other items in the original Array."," * @return {Object or Array}"," */"," getBestMatch: function(drops, all) {"," var biggest = null, area = 0, out;",""," Y.each(drops, function(v) {"," var inter = this.activeDrag.get('dragNode').intersect(v.get('node'));"," v.region.area = inter.area;",""," if (inter.inRegion) {"," if (inter.area > area) {"," area = inter.area;"," biggest = v;"," }"," }"," }, this);"," if (all) {"," out = [];"," //TODO Sort the others in numeric order by area covered.."," Y.each(drops, function(v) {"," if (v !== biggest) {"," out[out.length] = v;"," }"," }, this);"," return [biggest, out];"," }"," return biggest;"," },"," /**"," * @private"," * @method _deactivateTargets"," * @description This method fires the drop:hit, drag:drophit, drag:dropmiss methods and deactivates the shims.."," */"," _deactivateTargets: function() {"," var other = [], tmp,"," activeDrag = this.activeDrag,"," activeDrop = this.activeDrop;",""," //TODO why is this check so hard??"," if (activeDrag && activeDrop && this.otherDrops[activeDrop]) {"," if (!activeDrag.get('dragMode')) {"," //TODO otherDrops -- private.."," other = this.otherDrops;"," delete other[activeDrop];"," } else {"," tmp = this.getBestMatch(this.otherDrops, true);"," activeDrop = tmp[0];"," other = tmp[1];"," }"," activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over');"," if (activeDrop) {"," activeDrop.fire('drop:hit', { drag: activeDrag, drop: activeDrop, others: other });"," activeDrag.fire('drag:drophit', { drag: activeDrag, drop: activeDrop, others: other });"," }"," } else if (activeDrag && activeDrag.get('dragging')) {"," activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over');"," activeDrag.fire('drag:dropmiss', { pageX: activeDrag.lastXY[0], pageY: activeDrag.lastXY[1] });"," }",""," this.activeDrop = null;",""," Y.each(this.targets, function(v) {"," v._deactivateShim([]);"," }, this);"," },"," /**"," * @private"," * @method _dropMove"," * @description This method is called when the move method is called on the Drag Object."," */"," _dropMove: function() {"," if (this._hasActiveShim()) {"," this._handleTargetOver();"," } else {"," Y.each(this.otherDrops, function(v) {"," v._handleOut.apply(v, []);"," });"," }"," },"," /**"," * @private"," * @method _lookup"," * @description Filters the list of Drops down to those in the viewport."," * @return {Array} The valid Drop Targets that are in the viewport."," */"," _lookup: function() {"," if (!this.useHash || this._noShim) {"," return this.validDrops;"," }"," var drops = [];"," //Only scan drop shims that are in the Viewport"," Y.each(this.validDrops, function(v) {"," if (v.shim && v.shim.inViewportRegion(false, v.region)) {"," drops[drops.length] = v;"," }"," });"," return drops;",""," },"," /**"," * @private"," * @method _handleTargetOver"," * @description This method execs _handleTargetOver on all valid Drop Targets"," */"," _handleTargetOver: function() {"," var drops = this._lookup();"," Y.each(drops, function(v) {"," v._handleTargetOver.call(v);"," }, this);"," },"," /**"," * @private"," * @method _regTarget"," * @description Add the passed in Target to the targets collection"," * @param {Object} t The Target to add to the targets collection"," */"," _regTarget: function(t) {"," this.targets[this.targets.length] = t;"," },"," /**"," * @private"," * @method _unregTarget"," * @description Remove the passed in Target from the targets collection"," * @param {Object} drop The Target to remove from the targets collection"," */"," _unregTarget: function(drop) {"," var targets = [], vdrops;"," Y.each(this.targets, function(v) {"," if (v !== drop) {"," targets[targets.length] = v;"," }"," }, this);"," this.targets = targets;",""," vdrops = [];"," Y.each(this.validDrops, function(v) {"," if (v !== drop) {"," vdrops[vdrops.length] = v;"," }"," });",""," this.validDrops = vdrops;"," },"," /**"," * @method getDrop"," * @description Get a valid Drop instance back from a Node or a selector string, false otherwise"," * @param {String/Object} node The Node instance or Selector string to check for a valid Drop Object"," * @return {Object}"," */"," getDrop: function(node) {"," var drop = false,"," n = Y.one(node);"," if (n instanceof Y.Node) {"," Y.each(this.targets, function(v) {"," if (n.compareTo(v.get('node'))) {"," drop = v;"," }"," });"," }"," return drop;"," }"," }, true);","","","","","}, '3.7.3', {\"requires\": [\"dd-ddm\"]});"];+_yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].lines = {"1":0,"14":0,"36":0,"37":0,"39":0,"48":0,"57":0,"58":0,"59":0,"60":0,"64":0,"72":0,"73":0,"74":0,"75":0,"147":0,"148":0,"159":0,"160":0,"161":0,"162":0,"166":0,"167":0,"176":0,"177":0,"179":0,"180":0,"181":0,"182":0,"184":0,"185":0,"186":0,"187":0,"190":0,"191":0,"193":0,"202":0,"209":0,"210":0,"211":0,"219":0,"220":0,"221":0,"222":0,"223":0,"224":0,"227":0,"238":0,"240":0,"241":0,"242":0,"244":0,"245":0,"246":0,"247":0,"251":0,"252":0,"254":0,"255":0,"256":0,"259":0,"261":0,"269":0,"274":0,"275":0,"277":0,"278":0,"280":0,"281":0,"282":0,"284":0,"285":0,"286":0,"287":0,"289":0,"290":0,"291":0,"294":0,"296":0,"297":0,"306":0,"307":0,"309":0,"310":0,"321":0,"322":0,"324":0,"326":0,"327":0,"328":0,"331":0,"340":0,"341":0,"342":0,"352":0,"361":0,"362":0,"363":0,"364":0,"367":0,"369":0,"370":0,"371":0,"372":0,"376":0,"385":0,"387":0,"388":0,"389":0,"390":0,"394":0};+_yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].functions = {"_hasActiveShim:35":0,"_addActiveShim:47":0,"(anonymous 2):58":0,"_removeActiveShim:56":0,"(anonymous 4):74":0,"(anonymous 3):72":0,"syncActiveShims:71":0,"_addValid:146":0,"(anonymous 5):160":0,"_removeValid:158":0,"isOverTarget:175":0,"clearCache:208":0,"(anonymous 6):221":0,"_activateTargets:218":0,"(anonymous 7):240":0,"(anonymous 8):254":0,"getBestMatch:237":0,"(anonymous 9):296":0,"_deactivateTargets:268":0,"(anonymous 10):309":0,"_dropMove:305":0,"(anonymous 11):326":0,"_lookup:320":0,"(anonymous 12):341":0,"_handleTargetOver:339":0,"_regTarget:351":0,"(anonymous 13):362":0,"(anonymous 14):370":0,"_unregTarget:360":0,"(anonymous 15):388":0,"getDrop:384":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].coveredLines = 111; _yuitest_coverage["build/dd-ddm-drop/dd-ddm-drop.js"].coveredFunctions = 32; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 1);@@ -42,7 +42,8 @@ /**- * Extends the dd-ddm Class to add support for the placement of Drop Target shims inside the viewport shim. It also handles all Drop Target related events and interactions.+ * Extends the dd-ddm Class to add support for the placement of Drop Target+ * shims inside the viewport shim. It also handles all Drop Target related events and interactions. * @module dd * @submodule dd-ddm-drop * @for DDM@@ -51,7 +52,7 @@ //TODO CSS class name for the bestMatch.. _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 1)", 1);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 13);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 14); Y.mix(Y.DD.DDM, { /** * @private@@ -74,47 +75,47 @@ * @return {Boolean} */ _hasActiveShim: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_hasActiveShim", 34);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 35);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_hasActiveShim", 35);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 36); if (this._noShim) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 36);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 37); return true; }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 38);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 39); return this._activeShims.length; }, /** * @private- * @method _addActiveShim + * @method _addActiveShim * @description Adds a Drop Target to the list of active shims * @param {Object} d The Drop instance to add to the list. */ _addActiveShim: function(d) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_addActiveShim", 46);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 47);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_addActiveShim", 47);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 48); this._activeShims[this._activeShims.length] = d; }, /** * @private- * @method _removeActiveShim + * @method _removeActiveShim * @description Removes a Drop Target to the list of active shims * @param {Object} d The Drop instance to remove from the list. */ _removeActiveShim: function(d) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_removeActiveShim", 55);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 56);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_removeActiveShim", 56);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 57); var s = [];- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 57);-Y.each(this._activeShims, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 2)", 57);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 58);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 58);+Y.each(this._activeShims, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 2)", 58);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 59); if (v._yuid !== d._yuid) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 59);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 60); s[s.length] = v; }- + });- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 63);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 64); this._activeShims = s; }, /**@@ -123,16 +124,16 @@ * @param {Boolean} force Resize/sync all Targets. */ syncActiveShims: function(force) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "syncActiveShims", 70);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 71);-Y.later(0, this, function(force) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 3)", 71);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "syncActiveShims", 71); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 72);+Y.later(0, this, function(force) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 3)", 72);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 73); var drops = ((force) ? this.targets : this._lookup());- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 73);-Y.each(drops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 4)", 73);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 74);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 74);+Y.each(drops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 4)", 74);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 75); v.sizeShim.call(v); }, this); }, force);@@ -197,7 +198,7 @@ */ targets: [], /**- * @private + * @private * @method _addValid * @description Add a Drop Target to the list of Valid Targets. This list get's regenerated on each new drag operation. * @param {Object} drop@@ -205,14 +206,14 @@ * @chainable */ _addValid: function(drop) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_addValid", 145);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 146);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_addValid", 146);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 147); this.validDrops[this.validDrops.length] = drop;- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 147);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 148); return this; }, /**- * @private + * @private * @method _removeValid * @description Removes a Drop Target from the list of Valid Targets. This list get's regenerated on each new drag operation. * @param {Object} drop@@ -220,22 +221,22 @@ * @chainable */ _removeValid: function(drop) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_removeValid", 157);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 158);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_removeValid", 158);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 159); var drops = [];- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 159);-Y.each(this.validDrops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 5)", 159);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 160);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 160);+Y.each(this.validDrops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 5)", 160);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 161); if (v !== drop) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 161);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 162); drops[drops.length] = v; } }); - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 165);-this.validDrops = drops; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 166);+this.validDrops = drops;+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 167); return this; }, /**@@ -245,47 +246,47 @@ * @return {Boolean} */ isOverTarget: function(drop) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "isOverTarget", 174);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 175);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "isOverTarget", 175);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 176); if (this.activeDrag && drop) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 176);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 177); var xy = this.activeDrag.mouseXY, r, dMode = this.activeDrag.get('dragMode'), aRegion, node = drop.shim;- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 178);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 179); if (xy && this.activeDrag) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 179);-aRegion = this.activeDrag.region; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 180);-if (dMode == this.STRICT) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 181);+aRegion = this.activeDrag.region;+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 181);+if (dMode === this.STRICT) {+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 182); return this.activeDrag.get('dragNode').inRegion(drop.region, true, aRegion); }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 183);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 184); if (drop && drop.shim) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 184);-if ((dMode == this.INTERSECT) && this._noShim) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 185);-r = aRegion || this.activeDrag.get('node');+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 185);+if ((dMode === this.INTERSECT) && this._noShim) { _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 186);+r = aRegion || this.activeDrag.get('node');+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 187); return drop.get('node').intersect(r, drop.region).inRegion; } - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 189);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 190); if (this._noShim) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 190);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 191); node = drop.get('node'); }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 192);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 193); return node.intersect({ top: xy[1], bottom: xy[1],- left: xy[0], + left: xy[0], right: xy[0] }, drop.region).inRegion; } } }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 201);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 202); return false; }, /**@@ -293,12 +294,12 @@ * @description Clears the cache data used for this interaction. */ clearCache: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "clearCache", 207);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 208);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "clearCache", 208);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 209); this.validDrops = [];- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 209);-this.otherDrops = {}; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 210);+this.otherDrops = {};+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 211); this._activeShims = []; }, /**@@ -307,75 +308,75 @@ * @description Clear the cache and activate the shims of all the targets */ _activateTargets: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_activateTargets", 217);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 218);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_activateTargets", 218);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 219); this._noShim = true;- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 219);-this.clearCache(); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 220);-Y.each(this.targets, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 6)", 220);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 221);+this.clearCache();+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 221);+Y.each(this.targets, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 6)", 221);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 222); v._activateShim([]);- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 222);-if (v.get('noShim') == true) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 223);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 223);+if (v.get('noShim') === true) {+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 224); this._noShim = false; } }, this);- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 226);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 227); this._handleTargetOver();- + }, /** * @method getBestMatch * @description This method will gather the area for all potential targets and see which has the hightest covered area and return it. * @param {Array} drops An Array of drops to scan for the best match. * @param {Boolean} all If present, it returns an Array. First item is best match, second is an Array of the other items in the original Array.- * @return {Object or Array} + * @return {Object or Array} */ getBestMatch: function(drops, all) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "getBestMatch", 236);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 237);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "getBestMatch", 237);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 238); var biggest = null, area = 0, out;- - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 239);-Y.each(drops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 7)", 239);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 240);++ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 240);+Y.each(drops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 7)", 240);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 241); var inter = this.activeDrag.get('dragNode').intersect(v.get('node'));- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 241);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 242); v.region.area = inter.area; - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 243);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 244); if (inter.inRegion) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 244);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 245); if (inter.area > area) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 245);-area = inter.area; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 246);+area = inter.area;+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 247); biggest = v; } } }, this);- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 250);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 251); if (all) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 251);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 252); out = []; //TODO Sort the others in numeric order by area covered..- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 253);-Y.each(drops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 8)", 253);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 254);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 254);+Y.each(drops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 8)", 254);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 255); if (v !== biggest) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 255);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 256); out[out.length] = v; } }, this);- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 258);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 259); return [biggest, out]; }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 260);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 261); return biggest; }, /**@@ -384,54 +385,54 @@ * @description This method fires the drop:hit, drag:drophit, drag:dropmiss methods and deactivates the shims.. */ _deactivateTargets: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_deactivateTargets", 267);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 268);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_deactivateTargets", 268);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 269); var other = [], tmp, activeDrag = this.activeDrag, activeDrop = this.activeDrop;- + //TODO why is this check so hard??- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 273);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 274); if (activeDrag && activeDrop && this.otherDrops[activeDrop]) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 274);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 275); if (!activeDrag.get('dragMode')) { //TODO otherDrops -- private..- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 276);-other = this.otherDrops; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 277);+other = this.otherDrops;+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 278); delete other[activeDrop]; } else {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 279);-tmp = this.getBestMatch(this.otherDrops, true); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 280);-activeDrop = tmp[0];+tmp = this.getBestMatch(this.otherDrops, true); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 281);+activeDrop = tmp[0];+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 282); other = tmp[1]; }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 283);-activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over'); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 284);+activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over');+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 285); if (activeDrop) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 285);-activeDrop.fire('drop:hit', { drag: activeDrag, drop: activeDrop, others: other }); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 286);+activeDrop.fire('drop:hit', { drag: activeDrag, drop: activeDrop, others: other });+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 287); activeDrag.fire('drag:drophit', { drag: activeDrag, drop: activeDrop, others: other }); }- } else {_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 288);+ } else {_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 289); if (activeDrag && activeDrag.get('dragging')) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 289);-activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over'); _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 290);+activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over');+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 291); activeDrag.fire('drag:dropmiss', { pageX: activeDrag.lastXY[0], pageY: activeDrag.lastXY[1] }); }}- - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 293);++ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 294); this.activeDrop = null; - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 295);-Y.each(this.targets, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 9)", 295);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 296);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 296);+Y.each(this.targets, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 9)", 296);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 297); v._deactivateShim([]); }, this); },@@ -441,16 +442,16 @@ * @description This method is called when the move method is called on the Drag Object. */ _dropMove: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_dropMove", 304);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 305);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_dropMove", 305);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 306); if (this._hasActiveShim()) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 306);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 307); this._handleTargetOver(); } else {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 308);-Y.each(this.otherDrops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 10)", 308);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 309);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 309);+Y.each(this.otherDrops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 10)", 309);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 310); v._handleOut.apply(v, []); }); }@@ -462,27 +463,27 @@ * @return {Array} The valid Drop Targets that are in the viewport. */ _lookup: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_lookup", 319);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 320);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_lookup", 320);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 321); if (!this.useHash || this._noShim) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 321);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 322); return this.validDrops; }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 323);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 324); var drops = []; //Only scan drop shims that are in the Viewport- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 325);-Y.each(this.validDrops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 11)", 325);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 326);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 326);+Y.each(this.validDrops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 11)", 326);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 327); if (v.shim && v.shim.inViewportRegion(false, v.region)) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 327);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 328); drops[drops.length] = v; } });- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 330);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 331); return drops;- + }, /** * @private@@ -490,13 +491,13 @@ * @description This method execs _handleTargetOver on all valid Drop Targets */ _handleTargetOver: function() {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_handleTargetOver", 338);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 339);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_handleTargetOver", 339);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 340); var drops = this._lookup();- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 340);-Y.each(drops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 12)", 340);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 341);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 341);+Y.each(drops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 12)", 341);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 342); v._handleTargetOver.call(v); }, this); },@@ -507,8 +508,8 @@ * @param {Object} t The Target to add to the targets collection */ _regTarget: function(t) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_regTarget", 350);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 351);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_regTarget", 351);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 352); this.targets[this.targets.length] = t; }, /**@@ -518,34 +519,34 @@ * @param {Object} drop The Target to remove from the targets collection */ _unregTarget: function(drop) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_unregTarget", 359);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 360);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "_unregTarget", 360);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 361); var targets = [], vdrops;- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 361);-Y.each(this.targets, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 13)", 361);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 362);-if (v != drop) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 363);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 362);+Y.each(this.targets, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 13)", 362);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 363);+if (v !== drop) {+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 364); targets[targets.length] = v; } }, this);- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 366);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 367); this.targets = targets; - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 368);-vdrops = []; _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 369);-Y.each(this.validDrops, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 14)", 369);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 370);+vdrops = [];+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 370);+Y.each(this.validDrops, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 14)", 370);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 371); if (v !== drop) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 371);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 372); vdrops[vdrops.length] = v; } }); - _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 375);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 376); this.validDrops = vdrops; }, /**@@ -555,23 +556,23 @@ * @return {Object} */ getDrop: function(node) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "getDrop", 383);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 384);+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "getDrop", 384);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 385); var drop = false, n = Y.one(node);- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 386);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 387); if (n instanceof Y.Node) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 387);-Y.each(this.targets, function(v, k) {- _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 15)", 387);-_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 388);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 388);+Y.each(this.targets, function(v) {+ _yuitest_coverfunc("build/dd-ddm-drop/dd-ddm-drop.js", "(anonymous 15)", 388);+_yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 389); if (n.compareTo(v.get('node'))) {- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 389);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 390); drop = v; } }); }- _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 393);+ _yuitest_coverline("build/dd-ddm-drop/dd-ddm-drop.js", 394); return drop; } }, true);@@ -579,4 +580,4 @@ -}, '3.7.2', {"requires": ["dd-ddm"]});+}, '3.7.3', {"requires": ["dd-ddm"]});
bundle/dd-ddm-drop/dd-ddm-drop-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,7 +8,8 @@ /**- * Extends the dd-ddm Class to add support for the placement of Drop Target shims inside the viewport shim. It also handles all Drop Target related events and interactions.+ * Extends the dd-ddm Class to add support for the placement of Drop Target+ * shims inside the viewport shim. It also handles all Drop Target related events and interactions. * @module dd * @submodule dd-ddm-drop * @for DDM@@ -45,7 +46,7 @@ }, /** * @private- * @method _addActiveShim + * @method _addActiveShim * @description Adds a Drop Target to the list of active shims * @param {Object} d The Drop instance to add to the list. */@@ -54,17 +55,17 @@ }, /** * @private- * @method _removeActiveShim + * @method _removeActiveShim * @description Removes a Drop Target to the list of active shims * @param {Object} d The Drop instance to remove from the list. */ _removeActiveShim: function(d) { var s = [];- Y.each(this._activeShims, function(v, k) {+ Y.each(this._activeShims, function(v) { if (v._yuid !== d._yuid) { s[s.length] = v; }- + }); this._activeShims = s; },@@ -76,7 +77,7 @@ syncActiveShims: function(force) { Y.later(0, this, function(force) { var drops = ((force) ? this.targets : this._lookup());- Y.each(drops, function(v, k) {+ Y.each(drops, function(v) { v.sizeShim.call(v); }, this); }, force);@@ -141,7 +142,7 @@ */ targets: [], /**- * @private + * @private * @method _addValid * @description Add a Drop Target to the list of Valid Targets. This list get's regenerated on each new drag operation. * @param {Object} drop@@ -153,7 +154,7 @@ return this; }, /**- * @private + * @private * @method _removeValid * @description Removes a Drop Target from the list of Valid Targets. This list get's regenerated on each new drag operation. * @param {Object} drop@@ -162,7 +163,7 @@ */ _removeValid: function(drop) { var drops = [];- Y.each(this.validDrops, function(v, k) {+ Y.each(this.validDrops, function(v) { if (v !== drop) { drops[drops.length] = v; }@@ -183,11 +184,11 @@ aRegion, node = drop.shim; if (xy && this.activeDrag) { aRegion = this.activeDrag.region;- if (dMode == this.STRICT) {+ if (dMode === this.STRICT) { return this.activeDrag.get('dragNode').inRegion(drop.region, true, aRegion); } if (drop && drop.shim) {- if ((dMode == this.INTERSECT) && this._noShim) {+ if ((dMode === this.INTERSECT) && this._noShim) { r = aRegion || this.activeDrag.get('node'); return drop.get('node').intersect(r, drop.region).inRegion; }@@ -198,7 +199,7 @@ return node.intersect({ top: xy[1], bottom: xy[1],- left: xy[0], + left: xy[0], right: xy[0] }, drop.region).inRegion; }@@ -223,26 +224,26 @@ _activateTargets: function() { this._noShim = true; this.clearCache();- Y.each(this.targets, function(v, k) {+ Y.each(this.targets, function(v) { v._activateShim([]);- if (v.get('noShim') == true) {+ if (v.get('noShim') === true) { this._noShim = false; } }, this); this._handleTargetOver();- + }, /** * @method getBestMatch * @description This method will gather the area for all potential targets and see which has the hightest covered area and return it. * @param {Array} drops An Array of drops to scan for the best match. * @param {Boolean} all If present, it returns an Array. First item is best match, second is an Array of the other items in the original Array.- * @return {Object or Array} + * @return {Object or Array} */ getBestMatch: function(drops, all) { var biggest = null, area = 0, out;- - Y.each(drops, function(v, k) {++ Y.each(drops, function(v) { var inter = this.activeDrag.get('dragNode').intersect(v.get('node')); v.region.area = inter.area; @@ -256,7 +257,7 @@ if (all) { out = []; //TODO Sort the others in numeric order by area covered..- Y.each(drops, function(v, k) {+ Y.each(drops, function(v) { if (v !== biggest) { out[out.length] = v; }@@ -274,7 +275,7 @@ var other = [], tmp, activeDrag = this.activeDrag, activeDrop = this.activeDrop;- + //TODO why is this check so hard?? if (activeDrag && activeDrop && this.otherDrops[activeDrop]) { if (!activeDrag.get('dragMode')) {@@ -295,10 +296,10 @@ activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over'); activeDrag.fire('drag:dropmiss', { pageX: activeDrag.lastXY[0], pageY: activeDrag.lastXY[1] }); }- + this.activeDrop = null; - Y.each(this.targets, function(v, k) {+ Y.each(this.targets, function(v) { v._deactivateShim([]); }, this); },@@ -311,7 +312,7 @@ if (this._hasActiveShim()) { this._handleTargetOver(); } else {- Y.each(this.otherDrops, function(v, k) {+ Y.each(this.otherDrops, function(v) { v._handleOut.apply(v, []); }); }@@ -328,13 +329,13 @@ } var drops = []; //Only scan drop shims that are in the Viewport- Y.each(this.validDrops, function(v, k) {+ Y.each(this.validDrops, function(v) { if (v.shim && v.shim.inViewportRegion(false, v.region)) { drops[drops.length] = v; } }); return drops;- + }, /** * @private@@ -343,7 +344,7 @@ */ _handleTargetOver: function() { var drops = this._lookup();- Y.each(drops, function(v, k) {+ Y.each(drops, function(v) { v._handleTargetOver.call(v); }, this); },@@ -364,15 +365,15 @@ */ _unregTarget: function(drop) { var targets = [], vdrops;- Y.each(this.targets, function(v, k) {- if (v != drop) {+ Y.each(this.targets, function(v) {+ if (v !== drop) { targets[targets.length] = v; } }, this); this.targets = targets; vdrops = [];- Y.each(this.validDrops, function(v, k) {+ Y.each(this.validDrops, function(v) { if (v !== drop) { vdrops[vdrops.length] = v; }@@ -390,7 +391,7 @@ var drop = false, n = Y.one(node); if (n instanceof Y.Node) {- Y.each(this.targets, function(v, k) {+ Y.each(this.targets, function(v) { if (n.compareTo(v.get('node'))) { drop = v; }@@ -403,4 +404,4 @@ -}, '3.7.2', {"requires": ["dd-ddm"]});+}, '3.7.3', {"requires": ["dd-ddm"]});
bundle/dd-ddm-drop/dd-ddm-drop-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-ddm-drop",function(e,t){e.mix(e.DD.DDM,{_noShim:!1,_activeShims:[],_hasActiveShim:function(){return this._noShim?!0:this._activeShims.length},_addActiveShim:function(e){this._activeShims[this._activeShims.length]=e},_removeActiveShim:function(t){var n=[];e.each(this._activeShims,function(e,r){e._yuid!==t._yuid&&(n[n.length]=e)}),this._activeShims=n},syncActiveShims:function(t){e.later(0,this,function(t){var n=t?this.targets:this._lookup();e.each(n,function(e,t){e.sizeShim.call(e)},this)},t)},mode:0,POINT:0,INTERSECT:1,STRICT:2,useHash:!0,activeDrop:null,validDrops:[],otherDrops:{},targets:[],_addValid:function(e){return this.validDrops[this.validDrops.length]=e,this},_removeValid:function(t){var n=[];return e.each(this.validDrops,function(e,r){e!==t&&(n[n.length]=e)}),this.validDrops=n,this},isOverTarget:function(e){if(this.activeDrag&&e){var t=this.activeDrag.mouseXY,n,r=this.activeDrag.get("dragMode"),i,s=e.shim;if(t&&this.activeDrag){i=this.activeDrag.region;if(r==this.STRICT)return this.activeDrag.get("dragNode").inRegion(e.region,!0,i);if(e&&e.shim)return r==this.INTERSECT&&this._noShim?(n=i||this.activeDrag.get("node"),e.get("node").intersect(n,e.region).inRegion):(this._noShim&&(s=e.get("node")),s.intersect({top:t[1],bottom:t[1],left:t[0],right:t[0]},e.region).inRegion)}}return!1},clearCache:function(){this.validDrops=[],this.otherDrops={},this._activeShims=[]},_activateTargets:function(){this._noShim=!0,this.clearCache(),e.each(this.targets,function(e,t){e._activateShim([]),e.get("noShim")==1&&(this._noShim=!1)},this),this._handleTargetOver()},getBestMatch:function(t,n){var r=null,i=0,s;return e.each(t,function(e,t){var n=this.activeDrag.get("dragNode").intersect(e.get("node"));e.region.area=n.area,n.inRegion&&n.area>i&&(i=n.area,r=e)},this),n?(s=[],e.each(t,function(e,t){e!==r&&(s[s.length]=e)},this),[r,s]):r},_deactivateTargets:function(){var t=[],n,r=this.activeDrag,i=this.activeDrop;r&&i&&this.otherDrops[i]?(r.get("dragMode")?(n=this.getBestMatch(this.otherDrops,!0),i=n[0],t=n[1]):(t=this.otherDrops,delete t[i]),r.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),i&&(i.fire("drop:hit",{drag:r,drop:i,others:t}),r.fire("drag:drophit",{drag:r,drop:i,others:t}))):r&&r.get("dragging")&&(r.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),r.fire("drag:dropmiss",{pageX:r.lastXY[0],pageY:r.lastXY[1]})),this.activeDrop=null,e.each(this.targets,function(e,t){e._deactivateShim([])},this)},_dropMove:function(){this._hasActiveShim()?this._handleTargetOver():e.each(this.otherDrops,function(e,t){e._handleOut.apply(e,[])})},_lookup:function(){if(!this.useHash||this._noShim)return this.validDrops;var t=[];return e.each(this.validDrops,function(e,n){e.shim&&e.shim.inViewportRegion(!1,e.region)&&(t[t.length]=e)}),t},_handleTargetOver:function(){var t=this._lookup();e.each(t,function(e,t){e._handleTargetOver.call(e)},this)},_regTarget:function(e){this.targets[this.targets.length]=e},_unregTarget:function(t){var n=[],r;e.each(this.targets,function(e,r){e!=t&&(n[n.length]=e)},this),this.targets=n,r=[],e.each(this.validDrops,function(e,n){e!==t&&(r[r.length]=e)}),this.validDrops=r},getDrop:function(t){var n=!1,r=e.one(t);return r instanceof e.Node&&e.each(this.targets,function(e,t){r.compareTo(e.get("node"))&&(n=e)}),n}},!0)},"3.7.2",{requires:["dd-ddm"]});+YUI.add("dd-ddm-drop",function(e,t){e.mix(e.DD.DDM,{_noShim:!1,_activeShims:[],_hasActiveShim:function(){return this._noShim?!0:this._activeShims.length},_addActiveShim:function(e){this._activeShims[this._activeShims.length]=e},_removeActiveShim:function(t){var n=[];e.each(this._activeShims,function(e){e._yuid!==t._yuid&&(n[n.length]=e)}),this._activeShims=n},syncActiveShims:function(t){e.later(0,this,function(t){var n=t?this.targets:this._lookup();e.each(n,function(e){e.sizeShim.call(e)},this)},t)},mode:0,POINT:0,INTERSECT:1,STRICT:2,useHash:!0,activeDrop:null,validDrops:[],otherDrops:{},targets:[],_addValid:function(e){return this.validDrops[this.validDrops.length]=e,this},_removeValid:function(t){var n=[];return e.each(this.validDrops,function(e){e!==t&&(n[n.length]=e)}),this.validDrops=n,this},isOverTarget:function(e){if(this.activeDrag&&e){var t=this.activeDrag.mouseXY,n,r=this.activeDrag.get("dragMode"),i,s=e.shim;if(t&&this.activeDrag){i=this.activeDrag.region;if(r===this.STRICT)return this.activeDrag.get("dragNode").inRegion(e.region,!0,i);if(e&&e.shim)return r===this.INTERSECT&&this._noShim?(n=i||this.activeDrag.get("node"),e.get("node").intersect(n,e.region).inRegion):(this._noShim&&(s=e.get("node")),s.intersect({top:t[1],bottom:t[1],left:t[0],right:t[0]},e.region).inRegion)}}return!1},clearCache:function(){this.validDrops=[],this.otherDrops={},this._activeShims=[]},_activateTargets:function(){this._noShim=!0,this.clearCache(),e.each(this.targets,function(e){e._activateShim([]),e.get("noShim")===!0&&(this._noShim=!1)},this),this._handleTargetOver()},getBestMatch:function(t,n){var r=null,i=0,s;return e.each(t,function(e){var t=this.activeDrag.get("dragNode").intersect(e.get("node"));e.region.area=t.area,t.inRegion&&t.area>i&&(i=t.area,r=e)},this),n?(s=[],e.each(t,function(e){e!==r&&(s[s.length]=e)},this),[r,s]):r},_deactivateTargets:function(){var t=[],n,r=this.activeDrag,i=this.activeDrop;r&&i&&this.otherDrops[i]?(r.get("dragMode")?(n=this.getBestMatch(this.otherDrops,!0),i=n[0],t=n[1]):(t=this.otherDrops,delete t[i]),r.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),i&&(i.fire("drop:hit",{drag:r,drop:i,others:t}),r.fire("drag:drophit",{drag:r,drop:i,others:t}))):r&&r.get("dragging")&&(r.get("node").removeClass(this.CSS_PREFIX+"-drag-over"),r.fire("drag:dropmiss",{pageX:r.lastXY[0],pageY:r.lastXY[1]})),this.activeDrop=null,e.each(this.targets,function(e){e._deactivateShim([])},this)},_dropMove:function(){this._hasActiveShim()?this._handleTargetOver():e.each(this.otherDrops,function(e){e._handleOut.apply(e,[])})},_lookup:function(){if(!this.useHash||this._noShim)return this.validDrops;var t=[];return e.each(this.validDrops,function(e){e.shim&&e.shim.inViewportRegion(!1,e.region)&&(t[t.length]=e)}),t},_handleTargetOver:function(){var t=this._lookup();e.each(t,function(e){e._handleTargetOver.call(e)},this)},_regTarget:function(e){this.targets[this.targets.length]=e},_unregTarget:function(t){var n=[],r;e.each(this.targets,function(e){e!==t&&(n[n.length]=e)},this),this.targets=n,r=[],e.each(this.validDrops,function(e){e!==t&&(r[r.length]=e)}),this.validDrops=r},getDrop:function(t){var n=!1,r=e.one(t);return r instanceof e.Node&&e.each(this.targets,function(e){r.compareTo(e.get("node"))&&(n=e)}),n}},!0)},"3.7.3",{requires:["dd-ddm"]});
bundle/dd-ddm-drop/dd-ddm-drop.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,7 +8,8 @@ /**- * Extends the dd-ddm Class to add support for the placement of Drop Target shims inside the viewport shim. It also handles all Drop Target related events and interactions.+ * Extends the dd-ddm Class to add support for the placement of Drop Target+ * shims inside the viewport shim. It also handles all Drop Target related events and interactions. * @module dd * @submodule dd-ddm-drop * @for DDM@@ -45,7 +46,7 @@ }, /** * @private- * @method _addActiveShim + * @method _addActiveShim * @description Adds a Drop Target to the list of active shims * @param {Object} d The Drop instance to add to the list. */@@ -54,17 +55,17 @@ }, /** * @private- * @method _removeActiveShim + * @method _removeActiveShim * @description Removes a Drop Target to the list of active shims * @param {Object} d The Drop instance to remove from the list. */ _removeActiveShim: function(d) { var s = [];- Y.each(this._activeShims, function(v, k) {+ Y.each(this._activeShims, function(v) { if (v._yuid !== d._yuid) { s[s.length] = v; }- + }); this._activeShims = s; },@@ -76,7 +77,7 @@ syncActiveShims: function(force) { Y.later(0, this, function(force) { var drops = ((force) ? this.targets : this._lookup());- Y.each(drops, function(v, k) {+ Y.each(drops, function(v) { v.sizeShim.call(v); }, this); }, force);@@ -141,7 +142,7 @@ */ targets: [], /**- * @private + * @private * @method _addValid * @description Add a Drop Target to the list of Valid Targets. This list get's regenerated on each new drag operation. * @param {Object} drop@@ -153,7 +154,7 @@ return this; }, /**- * @private + * @private * @method _removeValid * @description Removes a Drop Target from the list of Valid Targets. This list get's regenerated on each new drag operation. * @param {Object} drop@@ -162,7 +163,7 @@ */ _removeValid: function(drop) { var drops = [];- Y.each(this.validDrops, function(v, k) {+ Y.each(this.validDrops, function(v) { if (v !== drop) { drops[drops.length] = v; }@@ -183,11 +184,11 @@ aRegion, node = drop.shim; if (xy && this.activeDrag) { aRegion = this.activeDrag.region;- if (dMode == this.STRICT) {+ if (dMode === this.STRICT) { return this.activeDrag.get('dragNode').inRegion(drop.region, true, aRegion); } if (drop && drop.shim) {- if ((dMode == this.INTERSECT) && this._noShim) {+ if ((dMode === this.INTERSECT) && this._noShim) { r = aRegion || this.activeDrag.get('node'); return drop.get('node').intersect(r, drop.region).inRegion; }@@ -198,7 +199,7 @@ return node.intersect({ top: xy[1], bottom: xy[1],- left: xy[0], + left: xy[0], right: xy[0] }, drop.region).inRegion; }@@ -223,26 +224,26 @@ _activateTargets: function() { this._noShim = true; this.clearCache();- Y.each(this.targets, function(v, k) {+ Y.each(this.targets, function(v) { v._activateShim([]);- if (v.get('noShim') == true) {+ if (v.get('noShim') === true) { this._noShim = false; } }, this); this._handleTargetOver();- + }, /** * @method getBestMatch * @description This method will gather the area for all potential targets and see which has the hightest covered area and return it. * @param {Array} drops An Array of drops to scan for the best match. * @param {Boolean} all If present, it returns an Array. First item is best match, second is an Array of the other items in the original Array.- * @return {Object or Array} + * @return {Object or Array} */ getBestMatch: function(drops, all) { var biggest = null, area = 0, out;- - Y.each(drops, function(v, k) {++ Y.each(drops, function(v) { var inter = this.activeDrag.get('dragNode').intersect(v.get('node')); v.region.area = inter.area; @@ -256,7 +257,7 @@ if (all) { out = []; //TODO Sort the others in numeric order by area covered..- Y.each(drops, function(v, k) {+ Y.each(drops, function(v) { if (v !== biggest) { out[out.length] = v; }@@ -274,7 +275,7 @@ var other = [], tmp, activeDrag = this.activeDrag, activeDrop = this.activeDrop;- + //TODO why is this check so hard?? if (activeDrag && activeDrop && this.otherDrops[activeDrop]) { if (!activeDrag.get('dragMode')) {@@ -295,10 +296,10 @@ activeDrag.get('node').removeClass(this.CSS_PREFIX + '-drag-over'); activeDrag.fire('drag:dropmiss', { pageX: activeDrag.lastXY[0], pageY: activeDrag.lastXY[1] }); }- + this.activeDrop = null; - Y.each(this.targets, function(v, k) {+ Y.each(this.targets, function(v) { v._deactivateShim([]); }, this); },@@ -311,7 +312,7 @@ if (this._hasActiveShim()) { this._handleTargetOver(); } else {- Y.each(this.otherDrops, function(v, k) {+ Y.each(this.otherDrops, function(v) { v._handleOut.apply(v, []); }); }@@ -328,13 +329,13 @@ } var drops = []; //Only scan drop shims that are in the Viewport- Y.each(this.validDrops, function(v, k) {+ Y.each(this.validDrops, function(v) { if (v.shim && v.shim.inViewportRegion(false, v.region)) { drops[drops.length] = v; } }); return drops;- + }, /** * @private@@ -343,7 +344,7 @@ */ _handleTargetOver: function() { var drops = this._lookup();- Y.each(drops, function(v, k) {+ Y.each(drops, function(v) { v._handleTargetOver.call(v); }, this); },@@ -364,15 +365,15 @@ */ _unregTarget: function(drop) { var targets = [], vdrops;- Y.each(this.targets, function(v, k) {- if (v != drop) {+ Y.each(this.targets, function(v) {+ if (v !== drop) { targets[targets.length] = v; } }, this); this.targets = targets; vdrops = [];- Y.each(this.validDrops, function(v, k) {+ Y.each(this.validDrops, function(v) { if (v !== drop) { vdrops[vdrops.length] = v; }@@ -390,7 +391,7 @@ var drop = false, n = Y.one(node); if (n instanceof Y.Node) {- Y.each(this.targets, function(v, k) {+ Y.each(this.targets, function(v) { if (n.compareTo(v.get('node'))) { drop = v; }@@ -403,4 +404,4 @@ -}, '3.7.2', {"requires": ["dd-ddm"]});+}, '3.7.3', {"requires": ["dd-ddm"]});
bundle/dd-ddm/dd-ddm-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/dd-ddm/dd-ddm.js", code: [] };-_yuitest_coverage["build/dd-ddm/dd-ddm.js"].code=["YUI.add('dd-ddm', function (Y, NAME) {","",""," /**"," * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable node to drag to be dragged over an iframe or any other node that traps mousemove events."," * It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets."," * @module dd"," * @submodule dd-ddm"," * @for DDM"," * @namespace DD"," */"," Y.mix(Y.DD.DDM, {"," /**"," * @private"," * @property _pg"," * @description The shim placed over the screen to track the mousemove event."," * @type {Node}"," */"," _pg: null,"," /**"," * @private"," * @property _debugShim"," * @description Set this to true to set the shims opacity to .5 for debugging it, default: false."," * @type {Boolean}"," */"," _debugShim: false,"," _activateTargets: function() { },"," _deactivateTargets: function() {},"," _startDrag: function() {"," if (this.activeDrag && this.activeDrag.get('useShim')) {"," this._shimming = true;"," this._pg_activate();"," this._activateTargets();"," }"," },"," _endDrag: function() {"," this._pg_deactivate();"," this._deactivateTargets();"," },"," /**"," * @private"," * @method _pg_deactivate"," * @description Deactivates the shim"," */"," _pg_deactivate: function() {"," this._pg.setStyle('display', 'none');"," },"," /**"," * @private"," * @method _pg_activate"," * @description Activates the shim"," */"," _pg_activate: function() {"," if (!this._pg) {"," this._createPG();"," }"," var ah = this.activeDrag.get('activeHandle'), cur = 'auto';"," if (ah) {"," cur = ah.getStyle('cursor');"," }"," if (cur == 'auto') {"," cur = this.get('dragCursor');"," }"," "," this._pg_size();"," this._pg.setStyles({"," top: 0,"," left: 0,"," display: 'block',"," opacity: ((this._debugShim) ? '.5' : '0'),"," cursor: cur"," });"," },"," /**"," * @private"," * @method _pg_size"," * @description Sizes the shim on: activatation, window:scroll, window:resize"," */"," _pg_size: function() {"," if (this.activeDrag) {"," var b = Y.one('body'),"," h = b.get('docHeight'),"," w = b.get('docWidth');"," this._pg.setStyles({"," height: h + 'px',"," width: w + 'px'"," });"," }"," },"," /**"," * @private"," * @method _createPG"," * @description Creates the shim and adds it's listeners to it."," */"," _createPG: function() {"," var pg = Y.Node.create('<div></div>'),"," bd = Y.one('body'), win;"," pg.setStyles({"," top: '0',"," left: '0',"," position: 'absolute',"," zIndex: '9999',"," overflow: 'hidden',"," backgroundColor: 'red',"," display: 'none',"," height: '5px',"," width: '5px'"," });"," pg.set('id', Y.stamp(pg));"," pg.addClass(Y.DD.DDM.CSS_PREFIX + '-shim');"," bd.prepend(pg);"," this._pg = pg;"," this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime')));"," this._pg.on('mouseup', Y.bind(this._end, this));"," "," win = Y.one('win');"," Y.on('window:resize', Y.bind(this._pg_size, this));"," win.on('scroll', Y.bind(this._pg_size, this));"," } "," }, true);","","","","","}, '3.7.2', {\"requires\": [\"dd-ddm-base\", \"event-resize\"]});"];-_yuitest_coverage["build/dd-ddm/dd-ddm.js"].lines = {"1":0,"12":0,"30":0,"31":0,"32":0,"33":0,"37":0,"38":0,"46":0,"54":0,"55":0,"57":0,"58":0,"59":0,"61":0,"62":0,"65":0,"66":0,"80":0,"81":0,"84":0,"96":0,"98":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"116":0,"117":0,"118":0};-_yuitest_coverage["build/dd-ddm/dd-ddm.js"].functions = {"_startDrag:29":0,"_endDrag:36":0,"_pg_deactivate:45":0,"_pg_activate:53":0,"_pg_size:79":0,"_createPG:95":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-ddm/dd-ddm.js"].code=["YUI.add('dd-ddm', function (Y, NAME) {","",""," /**"," * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable"," * anode to drag to be dragged over an iframe or any other node that traps mousemove events."," * It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets."," * @module dd"," * @submodule dd-ddm"," * @for DDM"," * @namespace DD"," */"," Y.mix(Y.DD.DDM, {"," /**"," * @private"," * @property _pg"," * @description The shim placed over the screen to track the mousemove event."," * @type {Node}"," */"," _pg: null,"," /**"," * @private"," * @property _debugShim"," * @description Set this to true to set the shims opacity to .5 for debugging it, default: false."," * @type {Boolean}"," */"," _debugShim: false,"," _activateTargets: function() { },"," _deactivateTargets: function() {},"," _startDrag: function() {"," if (this.activeDrag && this.activeDrag.get('useShim')) {"," this._shimming = true;"," this._pg_activate();"," this._activateTargets();"," }"," },"," _endDrag: function() {"," this._pg_deactivate();"," this._deactivateTargets();"," },"," /**"," * @private"," * @method _pg_deactivate"," * @description Deactivates the shim"," */"," _pg_deactivate: function() {"," this._pg.setStyle('display', 'none');"," },"," /**"," * @private"," * @method _pg_activate"," * @description Activates the shim"," */"," _pg_activate: function() {"," if (!this._pg) {"," this._createPG();"," }"," var ah = this.activeDrag.get('activeHandle'), cur = 'auto';"," if (ah) {"," cur = ah.getStyle('cursor');"," }"," if (cur === 'auto') {"," cur = this.get('dragCursor');"," }",""," this._pg_size();"," this._pg.setStyles({"," top: 0,"," left: 0,"," display: 'block',"," opacity: ((this._debugShim) ? '.5' : '0'),"," cursor: cur"," });"," },"," /**"," * @private"," * @method _pg_size"," * @description Sizes the shim on: activatation, window:scroll, window:resize"," */"," _pg_size: function() {"," if (this.activeDrag) {"," var b = Y.one('body'),"," h = b.get('docHeight'),"," w = b.get('docWidth');"," this._pg.setStyles({"," height: h + 'px',"," width: w + 'px'"," });"," }"," },"," /**"," * @private"," * @method _createPG"," * @description Creates the shim and adds it's listeners to it."," */"," _createPG: function() {"," var pg = Y.Node.create('<div></div>'),"," bd = Y.one('body'), win;"," pg.setStyles({"," top: '0',"," left: '0',"," position: 'absolute',"," zIndex: '9999',"," overflow: 'hidden',"," backgroundColor: 'red',"," display: 'none',"," height: '5px',"," width: '5px'"," });"," pg.set('id', Y.stamp(pg));"," pg.addClass(Y.DD.DDM.CSS_PREFIX + '-shim');"," bd.prepend(pg);"," this._pg = pg;"," this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime')));"," this._pg.on('mouseup', Y.bind(this._end, this));",""," win = Y.one('win');"," Y.on('window:resize', Y.bind(this._pg_size, this));"," win.on('scroll', Y.bind(this._pg_size, this));"," }"," }, true);","","","","","}, '3.7.3', {\"requires\": [\"dd-ddm-base\", \"event-resize\"]});"];+_yuitest_coverage["build/dd-ddm/dd-ddm.js"].lines = {"1":0,"13":0,"31":0,"32":0,"33":0,"34":0,"38":0,"39":0,"47":0,"55":0,"56":0,"58":0,"59":0,"60":0,"62":0,"63":0,"66":0,"67":0,"81":0,"82":0,"85":0,"97":0,"99":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"117":0,"118":0,"119":0};+_yuitest_coverage["build/dd-ddm/dd-ddm.js"].functions = {"_startDrag:30":0,"_endDrag:37":0,"_pg_deactivate:46":0,"_pg_activate:54":0,"_pg_size:80":0,"_createPG:96":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-ddm/dd-ddm.js"].coveredLines = 32; _yuitest_coverage["build/dd-ddm/dd-ddm.js"].coveredFunctions = 7; _yuitest_coverline("build/dd-ddm/dd-ddm.js", 1);@@ -42,7 +42,8 @@ /**- * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable node to drag to be dragged over an iframe or any other node that traps mousemove events.+ * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable+ * anode to drag to be dragged over an iframe or any other node that traps mousemove events. * It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets. * @module dd * @submodule dd-ddm@@ -50,7 +51,7 @@ * @namespace DD */ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "(anonymous 1)", 1);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 12);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 13); Y.mix(Y.DD.DDM, { /** * @private@@ -69,22 +70,22 @@ _activateTargets: function() { }, _deactivateTargets: function() {}, _startDrag: function() {- _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_startDrag", 29);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 30);+ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_startDrag", 30);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 31); if (this.activeDrag && this.activeDrag.get('useShim')) {- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 31);-this._shimming = true; _yuitest_coverline("build/dd-ddm/dd-ddm.js", 32);-this._pg_activate();+this._shimming = true; _yuitest_coverline("build/dd-ddm/dd-ddm.js", 33);+this._pg_activate();+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 34); this._activateTargets(); } }, _endDrag: function() {- _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_endDrag", 36);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 37);+ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_endDrag", 37);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 38); this._pg_deactivate();- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 38);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 39); this._deactivateTargets(); }, /**@@ -93,8 +94,8 @@ * @description Deactivates the shim */ _pg_deactivate: function() {- _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_pg_deactivate", 45);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 46);+ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_pg_deactivate", 46);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 47); this._pg.setStyle('display', 'none'); }, /**@@ -103,28 +104,28 @@ * @description Activates the shim */ _pg_activate: function() {- _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_pg_activate", 53);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 54);+ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_pg_activate", 54);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 55); if (!this._pg) {- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 55);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 56); this._createPG(); }- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 57);-var ah = this.activeDrag.get('activeHandle'), cur = 'auto'; _yuitest_coverline("build/dd-ddm/dd-ddm.js", 58);+var ah = this.activeDrag.get('activeHandle'), cur = 'auto';+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 59); if (ah) {- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 59);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 60); cur = ah.getStyle('cursor'); }- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 61);-if (cur == 'auto') {- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 62);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 62);+if (cur === 'auto') {+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 63); cur = this.get('dragCursor'); }- - _yuitest_coverline("build/dd-ddm/dd-ddm.js", 65);-this._pg_size();+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 66);+this._pg_size();+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 67); this._pg.setStyles({ top: 0, left: 0,@@ -139,14 +140,14 @@ * @description Sizes the shim on: activatation, window:scroll, window:resize */ _pg_size: function() {- _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_pg_size", 79);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 80);+ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_pg_size", 80);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 81); if (this.activeDrag) {- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 81);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 82); var b = Y.one('body'), h = b.get('docHeight'), w = b.get('docWidth');- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 84);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 85); this._pg.setStyles({ height: h + 'px', width: w + 'px'@@ -159,11 +160,11 @@ * @description Creates the shim and adds it's listeners to it. */ _createPG: function() {- _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_createPG", 95);-_yuitest_coverline("build/dd-ddm/dd-ddm.js", 96);+ _yuitest_coverfunc("build/dd-ddm/dd-ddm.js", "_createPG", 96);+_yuitest_coverline("build/dd-ddm/dd-ddm.js", 97); var pg = Y.Node.create('<div></div>'), bd = Y.one('body'), win;- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 98);+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 99); pg.setStyles({ top: '0', left: '0',@@ -175,29 +176,29 @@ height: '5px', width: '5px' });- _yuitest_coverline("build/dd-ddm/dd-ddm.js", 109);-pg.set('id', Y.stamp(pg)); _yuitest_coverline("build/dd-ddm/dd-ddm.js", 110);-pg.addClass(Y.DD.DDM.CSS_PREFIX + '-shim');+pg.set('id', Y.stamp(pg)); _yuitest_coverline("build/dd-ddm/dd-ddm.js", 111);-bd.prepend(pg);+pg.addClass(Y.DD.DDM.CSS_PREFIX + '-shim'); _yuitest_coverline("build/dd-ddm/dd-ddm.js", 112);-this._pg = pg;+bd.prepend(pg); _yuitest_coverline("build/dd-ddm/dd-ddm.js", 113);-this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime')));+this._pg = pg; _yuitest_coverline("build/dd-ddm/dd-ddm.js", 114);+this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime')));+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 115); this._pg.on('mouseup', Y.bind(this._end, this));- - _yuitest_coverline("build/dd-ddm/dd-ddm.js", 116);-win = Y.one('win');+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 117);-Y.on('window:resize', Y.bind(this._pg_size, this));+win = Y.one('win'); _yuitest_coverline("build/dd-ddm/dd-ddm.js", 118);+Y.on('window:resize', Y.bind(this._pg_size, this));+ _yuitest_coverline("build/dd-ddm/dd-ddm.js", 119); win.on('scroll', Y.bind(this._pg_size, this));- } + } }, true); -}, '3.7.2', {"requires": ["dd-ddm-base", "event-resize"]});+}, '3.7.3', {"requires": ["dd-ddm-base", "event-resize"]});
bundle/dd-ddm/dd-ddm-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,7 +8,8 @@ /**- * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable node to drag to be dragged over an iframe or any other node that traps mousemove events.+ * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable+ * anode to drag to be dragged over an iframe or any other node that traps mousemove events. * It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets. * @module dd * @submodule dd-ddm@@ -64,10 +65,10 @@ if (ah) { cur = ah.getStyle('cursor'); }- if (cur == 'auto') {+ if (cur === 'auto') { cur = this.get('dragCursor'); }- + this._pg_size(); this._pg.setStyles({ top: 0,@@ -118,14 +119,14 @@ this._pg = pg; this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime'))); this._pg.on('mouseup', Y.bind(this._end, this));- + win = Y.one('win'); Y.on('window:resize', Y.bind(this._pg_size, this)); win.on('scroll', Y.bind(this._pg_size, this));- } + } }, true); -}, '3.7.2', {"requires": ["dd-ddm-base", "event-resize"]});+}, '3.7.3', {"requires": ["dd-ddm-base", "event-resize"]});
bundle/dd-ddm/dd-ddm-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-ddm",function(e,t){e.mix(e.DD.DDM,{_pg:null,_debugShim:!1,_activateTargets:function(){},_deactivateTargets:function(){},_startDrag:function(){this.activeDrag&&this.activeDrag.get("useShim")&&(this._shimming=!0,this._pg_activate(),this._activateTargets())},_endDrag:function(){this._pg_deactivate(),this._deactivateTargets()},_pg_deactivate:function(){this._pg.setStyle("display","none")},_pg_activate:function(){this._pg||this._createPG();var e=this.activeDrag.get("activeHandle"),t="auto";e&&(t=e.getStyle("cursor")),t=="auto"&&(t=this.get("dragCursor")),this._pg_size(),this._pg.setStyles({top:0,left:0,display:"block",opacity:this._debugShim?".5":"0",cursor:t})},_pg_size:function(){if(this.activeDrag){var t=e.one("body"),n=t.get("docHeight"),r=t.get("docWidth");this._pg.setStyles({height:n+"px",width:r+"px"})}},_createPG:function(){var t=e.Node.create("<div></div>"),n=e.one("body"),r;t.setStyles({top:"0",left:"0",position:"absolute",zIndex:"9999",overflow:"hidden",backgroundColor:"red",display:"none",height:"5px",width:"5px"}),t.set("id",e.stamp(t)),t.addClass(e.DD.DDM.CSS_PREFIX+"-shim"),n.prepend(t),this._pg=t,this._pg.on("mousemove",e.throttle(e.bind(this._move,this),this.get("throttleTime"))),this._pg.on("mouseup",e.bind(this._end,this)),r=e.one("win"),e.on("window:resize",e.bind(this._pg_size,this)),r.on("scroll",e.bind(this._pg_size,this))}},!0)},"3.7.2",{requires:["dd-ddm-base","event-resize"]});+YUI.add("dd-ddm",function(e,t){e.mix(e.DD.DDM,{_pg:null,_debugShim:!1,_activateTargets:function(){},_deactivateTargets:function(){},_startDrag:function(){this.activeDrag&&this.activeDrag.get("useShim")&&(this._shimming=!0,this._pg_activate(),this._activateTargets())},_endDrag:function(){this._pg_deactivate(),this._deactivateTargets()},_pg_deactivate:function(){this._pg.setStyle("display","none")},_pg_activate:function(){this._pg||this._createPG();var e=this.activeDrag.get("activeHandle"),t="auto";e&&(t=e.getStyle("cursor")),t==="auto"&&(t=this.get("dragCursor")),this._pg_size(),this._pg.setStyles({top:0,left:0,display:"block",opacity:this._debugShim?".5":"0",cursor:t})},_pg_size:function(){if(this.activeDrag){var t=e.one("body"),n=t.get("docHeight"),r=t.get("docWidth");this._pg.setStyles({height:n+"px",width:r+"px"})}},_createPG:function(){var t=e.Node.create("<div></div>"),n=e.one("body"),r;t.setStyles({top:"0",left:"0",position:"absolute",zIndex:"9999",overflow:"hidden",backgroundColor:"red",display:"none",height:"5px",width:"5px"}),t.set("id",e.stamp(t)),t.addClass(e.DD.DDM.CSS_PREFIX+"-shim"),n.prepend(t),this._pg=t,this._pg.on("mousemove",e.throttle(e.bind(this._move,this),this.get("throttleTime"))),this._pg.on("mouseup",e.bind(this._end,this)),r=e.one("win"),e.on("window:resize",e.bind(this._pg_size,this)),r.on("scroll",e.bind(this._pg_size,this))}},!0)},"3.7.3",{requires:["dd-ddm-base","event-resize"]});
bundle/dd-ddm/dd-ddm.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,7 +8,8 @@ /**- * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable node to drag to be dragged over an iframe or any other node that traps mousemove events.+ * Extends the dd-ddm-base Class to add support for the viewport shim to allow a draggable+ * anode to drag to be dragged over an iframe or any other node that traps mousemove events. * It is also required to have Drop Targets enabled, as the viewport shim will contain the shims for the Drop Targets. * @module dd * @submodule dd-ddm@@ -64,10 +65,10 @@ if (ah) { cur = ah.getStyle('cursor'); }- if (cur == 'auto') {+ if (cur === 'auto') { cur = this.get('dragCursor'); }- + this._pg_size(); this._pg.setStyles({ top: 0,@@ -118,14 +119,14 @@ this._pg = pg; this._pg.on('mousemove', Y.throttle(Y.bind(this._move, this), this.get('throttleTime'))); this._pg.on('mouseup', Y.bind(this._end, this));- + win = Y.one('win'); Y.on('window:resize', Y.bind(this._pg_size, this)); win.on('scroll', Y.bind(this._pg_size, this));- } + } }, true); -}, '3.7.2', {"requires": ["dd-ddm-base", "event-resize"]});+}, '3.7.3', {"requires": ["dd-ddm-base", "event-resize"]});
bundle/dd-delegate/dd-delegate-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dd-delegate/dd-delegate.js", code: [] };-_yuitest_coverage["build/dd-delegate/dd-delegate.js"].code=["YUI.add('dd-delegate', function (Y, NAME) {","",""," /**"," * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate."," * @module dd"," * @submodule dd-delegate"," */ "," /**"," * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate."," * @class Delegate"," * @extends Base"," * @constructor"," * @namespace DD"," */","",""," var Delegate = function(o) {"," Delegate.superclass.constructor.apply(this, arguments);"," },"," CONT = 'container',"," NODES = 'nodes',"," _tmpNode = Y.Node.create('<div>Temp Node</div>');","",""," Y.extend(Delegate, Y.Base, {"," /**"," * @private"," * @property _bubbleTargets"," * @description The default bubbleTarget for this object. Default: Y.DD.DDM"," */"," _bubbleTargets: Y.DD.DDM,"," /**"," * @property dd"," * @description A reference to the temporary dd instance used under the hood."," */ "," dd: null,"," /**"," * @property _shimState"," * @private"," * @description The state of the Y.DD.DDM._noShim property to it can be reset."," */ "," _shimState: null,"," /**"," * @private"," * @property _handles"," * @description Array of event handles to be destroyed"," */"," _handles: null,"," /**"," * @private"," * @method _onNodeChange"," * @description Listens to the nodeChange event and sets the dragNode on the temp dd instance."," * @param {Event} e The Event."," */"," _onNodeChange: function(e) {"," this.set('dragNode', e.newVal);"," },"," /**"," * @private"," * @method _afterDragEnd"," * @description Listens for the drag:end event and updates the temp dd instance."," * @param {Event} e The Event."," */"," _afterDragEnd: function(e) {"," Y.DD.DDM._noShim = this._shimState;",""," this.set('lastNode', this.dd.get('node'));"," this.get('lastNode').removeClass(Y.DD.DDM.CSS_PREFIX + '-dragging');"," this.dd._unprep();"," this.dd.set('node', _tmpNode);"," },"," /**"," * @private"," * @method _delMouseDown"," * @description The callback for the Y.DD.Delegate instance used"," * @param {Event} e The MouseDown Event."," */"," _delMouseDown: function(e) {"," var tar = e.currentTarget,"," dd = this.dd,"," dNode = tar,"," config = this.get('dragConfig');"," "," if (tar.test(this.get(NODES)) && !tar.test(this.get('invalid'))) {"," this._shimState = Y.DD.DDM._noShim;"," Y.DD.DDM._noShim = true;"," this.set('currentNode', tar);"," dd.set('node', tar);"," if (config && config.dragNode) {"," dNode = config.dragNode;"," } else if (dd.proxy) {"," dNode = Y.DD.DDM._proxy;"," }"," dd.set('dragNode', dNode);"," dd._prep();"," "," dd.fire('drag:mouseDown', { ev: e });"," }"," },"," /**"," * @private"," * @method _onMouseEnter"," * @description Sets the target shim state"," * @param {Event} e The MouseEnter Event"," */"," _onMouseEnter: function(e) {"," this._shimState = Y.DD.DDM._noShim;"," Y.DD.DDM._noShim = true;"," },"," /**"," * @private"," * @method _onMouseLeave"," * @description Resets the target shim state"," * @param {Event} e The MouseLeave Event"," */"," _onMouseLeave: function(e) {"," Y.DD.DDM._noShim = this._shimState;"," },"," initializer: function(cfg) {"," this._handles = [];"," //Create a tmp DD instance under the hood."," //var conf = Y.clone(this.get('dragConfig') || {}),"," var conf = this.get('dragConfig') || {},"," cont = this.get(CONT);",""," conf.node = _tmpNode.cloneNode(true);"," conf.bubbleTargets = this;",""," if (this.get('handles')) {"," conf.handles = this.get('handles');"," }",""," this.dd = new Y.DD.Drag(conf);",""," //On end drag, detach the listeners"," this.dd.after('drag:end', Y.bind(this._afterDragEnd, this));"," this.dd.on('dragNodeChange', Y.bind(this._onNodeChange, this));"," this.dd.after('drag:mouseup', function() {"," this._unprep();"," });",""," //Attach the delegate to the container"," this._handles.push(Y.delegate(Y.DD.Drag.START_EVENT, Y.bind(this._delMouseDown, this), cont, this.get(NODES)));",""," this._handles.push(Y.on('mouseenter', Y.bind(this._onMouseEnter, this), cont));",""," this._handles.push(Y.on('mouseleave', Y.bind(this._onMouseLeave, this), cont));",""," Y.later(50, this, this.syncTargets);"," Y.DD.DDM.regDelegate(this);"," },"," /**"," * @method syncTargets"," * @description Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query."," * @return {Self}"," * @chainable"," */ "," syncTargets: function() {"," if (!Y.Plugin.Drop || this.get('destroyed')) {"," return;"," }"," var items, groups, config;",""," if (this.get('target')) {"," items = Y.one(this.get(CONT)).all(this.get(NODES));"," groups = this.dd.get('groups');"," config = this.get('dragConfig');"," "," if (config && config.groups) {"," groups = config.groups;"," }",""," items.each(function(i) {"," this.createDrop(i, groups);"," }, this);"," }"," return this;"," },"," /**"," * @method createDrop"," * @description Apply the Drop plugin to this node"," * @param {Node} node The Node to apply the plugin to"," * @param {Array} groups The default groups to assign this target to."," * @return Node"," */"," createDrop: function(node, groups) {"," var config = {"," useShim: false,"," bubbleTargets: this"," };",""," if (!node.drop) {"," node.plug(Y.Plugin.Drop, config);"," }"," node.drop.set('groups', groups);"," return node;"," },"," destructor: function() {"," if (this.dd) {"," this.dd.destroy();"," }"," if (Y.Plugin.Drop) {"," var targets = Y.one(this.get(CONT)).all(this.get(NODES));"," targets.unplug(Y.Plugin.Drop);"," }"," Y.each(this._handles, function(v) {"," v.detach();"," });"," }"," }, {"," NAME: 'delegate',"," ATTRS: {"," /**"," * @attribute container"," * @description A selector query to get the container to listen for mousedown events on. All \"nodes\" should be a child of this container."," * @type String"," */ "," container: {"," value: 'body'"," },"," /**"," * @attribute nodes"," * @description A selector query to get the children of the \"container\" to make draggable elements from."," * @type String"," */ "," nodes: {"," value: '.dd-draggable'"," },"," /**"," * @attribute invalid"," * @description A selector query to test a node to see if it's an invalid item."," * @type String"," */ "," invalid: {"," value: 'input, select, button, a, textarea'"," },"," /**"," * @attribute lastNode"," * @description Y.Node instance of the last item dragged."," * @type Node"," */ "," lastNode: {"," value: _tmpNode"," },"," /**"," * @attribute currentNode"," * @description Y.Node instance of the dd node."," * @type Node"," */ "," currentNode: {"," value: _tmpNode"," },"," /**"," * @attribute dragNode"," * @description Y.Node instance of the dd dragNode."," * @type Node"," */ "," dragNode: {"," value: _tmpNode"," },"," /**"," * @attribute over"," * @description Is the mouse currently over the container"," * @type Boolean"," */ "," over: {"," value: false"," },"," /**"," * @attribute target"," * @description Should the items also be a drop target."," * @type Boolean"," */ "," target: {"," value: false"," },"," /**"," * @attribute dragConfig"," * @description The default config to be used when creating the DD instance."," * @type Object"," */ "," dragConfig: {"," value: null"," },"," /**"," * @attribute handles"," * @description The handles config option added to the temp DD instance."," * @type Array"," */ "," handles: {"," value: null"," }"," }"," });",""," Y.mix(Y.DD.DDM, {"," /**"," * @private"," * @for DDM"," * @property _delegates"," * @description Holder for all Y.DD.Delegate instances"," * @type Array"," */"," _delegates: [],"," /**"," * @for DDM"," * @method regDelegate"," * @description Register a Delegate with the DDM"," */"," regDelegate: function(del) {"," this._delegates.push(del);"," },"," /**"," * @for DDM"," * @method getDelegate"," * @description Get a delegate instance from a container node"," * @return Y.DD.Delegate"," */"," getDelegate: function(node) {"," var del = null;"," node = Y.one(node);"," Y.each(this._delegates, function(v) {"," if (node.test(v.get(CONT))) {"," del = v;"," }"," }, this);"," return del;"," }"," });",""," Y.namespace('DD'); "," Y.DD.Delegate = Delegate;","","","","","}, '3.7.2', {\"requires\": [\"dd-drag\", \"dd-drop-plugin\", \"event-mouseenter\"]});"];+_yuitest_coverage["build/dd-delegate/dd-delegate.js"].code=["YUI.add('dd-delegate', function (Y, NAME) {","",""," /**"," * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate."," * @module dd"," * @submodule dd-delegate"," */"," /**"," * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate."," * @class Delegate"," * @extends Base"," * @constructor"," * @namespace DD"," */","",""," var Delegate = function() {"," Delegate.superclass.constructor.apply(this, arguments);"," },"," CONT = 'container',"," NODES = 'nodes',"," _tmpNode = Y.Node.create('<div>Temp Node</div>');","",""," Y.extend(Delegate, Y.Base, {"," /**"," * @private"," * @property _bubbleTargets"," * @description The default bubbleTarget for this object. Default: Y.DD.DDM"," */"," _bubbleTargets: Y.DD.DDM,"," /**"," * @property dd"," * @description A reference to the temporary dd instance used under the hood."," */"," dd: null,"," /**"," * @property _shimState"," * @private"," * @description The state of the Y.DD.DDM._noShim property to it can be reset."," */"," _shimState: null,"," /**"," * @private"," * @property _handles"," * @description Array of event handles to be destroyed"," */"," _handles: null,"," /**"," * @private"," * @method _onNodeChange"," * @description Listens to the nodeChange event and sets the dragNode on the temp dd instance."," * @param {Event} e The Event."," */"," _onNodeChange: function(e) {"," this.set('dragNode', e.newVal);"," },"," /**"," * @private"," * @method _afterDragEnd"," * @description Listens for the drag:end event and updates the temp dd instance."," * @param {Event} e The Event."," */"," _afterDragEnd: function() {"," Y.DD.DDM._noShim = this._shimState;",""," this.set('lastNode', this.dd.get('node'));"," this.get('lastNode').removeClass(Y.DD.DDM.CSS_PREFIX + '-dragging');"," this.dd._unprep();"," this.dd.set('node', _tmpNode);"," },"," /**"," * @private"," * @method _delMouseDown"," * @description The callback for the Y.DD.Delegate instance used"," * @param {Event} e The MouseDown Event."," */"," _delMouseDown: function(e) {"," var tar = e.currentTarget,"," dd = this.dd,"," dNode = tar,"," config = this.get('dragConfig');",""," if (tar.test(this.get(NODES)) && !tar.test(this.get('invalid'))) {"," this._shimState = Y.DD.DDM._noShim;"," Y.DD.DDM._noShim = true;"," this.set('currentNode', tar);"," dd.set('node', tar);"," if (config && config.dragNode) {"," dNode = config.dragNode;"," } else if (dd.proxy) {"," dNode = Y.DD.DDM._proxy;"," }"," dd.set('dragNode', dNode);"," dd._prep();",""," dd.fire('drag:mouseDown', { ev: e });"," }"," },"," /**"," * @private"," * @method _onMouseEnter"," * @description Sets the target shim state"," * @param {Event} e The MouseEnter Event"," */"," _onMouseEnter: function() {"," this._shimState = Y.DD.DDM._noShim;"," Y.DD.DDM._noShim = true;"," },"," /**"," * @private"," * @method _onMouseLeave"," * @description Resets the target shim state"," * @param {Event} e The MouseLeave Event"," */"," _onMouseLeave: function() {"," Y.DD.DDM._noShim = this._shimState;"," },"," initializer: function() {"," this._handles = [];"," //Create a tmp DD instance under the hood."," //var conf = Y.clone(this.get('dragConfig') || {}),"," var conf = this.get('dragConfig') || {},"," cont = this.get(CONT);",""," conf.node = _tmpNode.cloneNode(true);"," conf.bubbleTargets = this;",""," if (this.get('handles')) {"," conf.handles = this.get('handles');"," }",""," this.dd = new Y.DD.Drag(conf);",""," //On end drag, detach the listeners"," this.dd.after('drag:end', Y.bind(this._afterDragEnd, this));"," this.dd.on('dragNodeChange', Y.bind(this._onNodeChange, this));"," this.dd.after('drag:mouseup', function() {"," this._unprep();"," });",""," //Attach the delegate to the container"," this._handles.push(Y.delegate(Y.DD.Drag.START_EVENT, Y.bind(this._delMouseDown, this), cont, this.get(NODES)));",""," this._handles.push(Y.on('mouseenter', Y.bind(this._onMouseEnter, this), cont));",""," this._handles.push(Y.on('mouseleave', Y.bind(this._onMouseLeave, this), cont));",""," Y.later(50, this, this.syncTargets);"," Y.DD.DDM.regDelegate(this);"," },"," /**"," * @method syncTargets"," * @description Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query."," * @return {Self}"," * @chainable"," */"," syncTargets: function() {"," if (!Y.Plugin.Drop || this.get('destroyed')) {"," return;"," }"," var items, groups, config;",""," if (this.get('target')) {"," items = Y.one(this.get(CONT)).all(this.get(NODES));"," groups = this.dd.get('groups');"," config = this.get('dragConfig');",""," if (config && config.groups) {"," groups = config.groups;"," }",""," items.each(function(i) {"," this.createDrop(i, groups);"," }, this);"," }"," return this;"," },"," /**"," * @method createDrop"," * @description Apply the Drop plugin to this node"," * @param {Node} node The Node to apply the plugin to"," * @param {Array} groups The default groups to assign this target to."," * @return Node"," */"," createDrop: function(node, groups) {"," var config = {"," useShim: false,"," bubbleTargets: this"," };",""," if (!node.drop) {"," node.plug(Y.Plugin.Drop, config);"," }"," node.drop.set('groups', groups);"," return node;"," },"," destructor: function() {"," if (this.dd) {"," this.dd.destroy();"," }"," if (Y.Plugin.Drop) {"," var targets = Y.one(this.get(CONT)).all(this.get(NODES));"," targets.unplug(Y.Plugin.Drop);"," }"," Y.each(this._handles, function(v) {"," v.detach();"," });"," }"," }, {"," NAME: 'delegate',"," ATTRS: {"," /**"," * @attribute container"," * @description A selector query to get the container to listen for mousedown events on. All \"nodes\" should be a child of this container."," * @type String"," */"," container: {"," value: 'body'"," },"," /**"," * @attribute nodes"," * @description A selector query to get the children of the \"container\" to make draggable elements from."," * @type String"," */"," nodes: {"," value: '.dd-draggable'"," },"," /**"," * @attribute invalid"," * @description A selector query to test a node to see if it's an invalid item."," * @type String"," */"," invalid: {"," value: 'input, select, button, a, textarea'"," },"," /**"," * @attribute lastNode"," * @description Y.Node instance of the last item dragged."," * @type Node"," */"," lastNode: {"," value: _tmpNode"," },"," /**"," * @attribute currentNode"," * @description Y.Node instance of the dd node."," * @type Node"," */"," currentNode: {"," value: _tmpNode"," },"," /**"," * @attribute dragNode"," * @description Y.Node instance of the dd dragNode."," * @type Node"," */"," dragNode: {"," value: _tmpNode"," },"," /**"," * @attribute over"," * @description Is the mouse currently over the container"," * @type Boolean"," */"," over: {"," value: false"," },"," /**"," * @attribute target"," * @description Should the items also be a drop target."," * @type Boolean"," */"," target: {"," value: false"," },"," /**"," * @attribute dragConfig"," * @description The default config to be used when creating the DD instance."," * @type Object"," */"," dragConfig: {"," value: null"," },"," /**"," * @attribute handles"," * @description The handles config option added to the temp DD instance."," * @type Array"," */"," handles: {"," value: null"," }"," }"," });",""," Y.mix(Y.DD.DDM, {"," /**"," * @private"," * @for DDM"," * @property _delegates"," * @description Holder for all Y.DD.Delegate instances"," * @type Array"," */"," _delegates: [],"," /**"," * @for DDM"," * @method regDelegate"," * @description Register a Delegate with the DDM"," */"," regDelegate: function(del) {"," this._delegates.push(del);"," },"," /**"," * @for DDM"," * @method getDelegate"," * @description Get a delegate instance from a container node"," * @return Y.DD.Delegate"," */"," getDelegate: function(node) {"," var del = null;"," node = Y.one(node);"," Y.each(this._delegates, function(v) {"," if (node.test(v.get(CONT))) {"," del = v;"," }"," }, this);"," return del;"," }"," });",""," Y.namespace('DD');"," Y.DD.Delegate = Delegate;","","","","","}, '3.7.3', {\"requires\": [\"dd-drag\", \"dd-drop-plugin\", \"event-mouseenter\"]});"]; _yuitest_coverage["build/dd-delegate/dd-delegate.js"].lines = {"1":0,"18":0,"19":0,"26":0,"57":0,"66":0,"68":0,"69":0,"70":0,"71":0,"80":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"95":0,"96":0,"98":0,"108":0,"109":0,"118":0,"121":0,"124":0,"127":0,"128":0,"130":0,"131":0,"134":0,"137":0,"138":0,"139":0,"140":0,"144":0,"146":0,"148":0,"150":0,"151":0,"160":0,"161":0,"163":0,"165":0,"166":0,"167":0,"168":0,"170":0,"171":0,"174":0,"175":0,"178":0,"188":0,"193":0,"194":0,"196":0,"197":0,"200":0,"201":0,"203":0,"204":0,"205":0,"207":0,"208":0,"297":0,"312":0,"321":0,"322":0,"323":0,"324":0,"325":0,"328":0,"332":0,"333":0}; _yuitest_coverage["build/dd-delegate/dd-delegate.js"].functions = {"Delegate:18":0,"_onNodeChange:56":0,"_afterDragEnd:65":0,"_delMouseDown:79":0,"_onMouseEnter:107":0,"_onMouseLeave:117":0,"(anonymous 2):139":0,"initializer:120":0,"(anonymous 3):174":0,"syncTargets:159":0,"createDrop:187":0,"(anonymous 4):207":0,"destructor:199":0,"regDelegate:311":0,"(anonymous 5):323":0,"getDelegate:320":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-delegate/dd-delegate.js"].coveredLines = 76;@@ -45,7 +45,7 @@ * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate. * @module dd * @submodule dd-delegate- */ + */ /** * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate. * @class Delegate@@ -57,7 +57,7 @@ _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "(anonymous 1)", 1); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 18);-var Delegate = function(o) {+var Delegate = function() { _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "Delegate", 18); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 19); Delegate.superclass.constructor.apply(this, arguments);@@ -78,13 +78,13 @@ /** * @property dd * @description A reference to the temporary dd instance used under the hood.- */ + */ dd: null, /** * @property _shimState * @private * @description The state of the Y.DD.DDM._noShim property to it can be reset.- */ + */ _shimState: null, /** * @private@@ -109,7 +109,7 @@ * @description Listens for the drag:end event and updates the temp dd instance. * @param {Event} e The Event. */- _afterDragEnd: function(e) {+ _afterDragEnd: function() { _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "_afterDragEnd", 65); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 66); Y.DD.DDM._noShim = this._shimState;@@ -136,7 +136,7 @@ dd = this.dd, dNode = tar, config = this.get('dragConfig');- + _yuitest_coverline("build/dd-delegate/dd-delegate.js", 85); if (tar.test(this.get(NODES)) && !tar.test(this.get('invalid'))) { _yuitest_coverline("build/dd-delegate/dd-delegate.js", 86);@@ -160,7 +160,7 @@ dd.set('dragNode', dNode); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 96); dd._prep();- + _yuitest_coverline("build/dd-delegate/dd-delegate.js", 98); dd.fire('drag:mouseDown', { ev: e }); }@@ -171,7 +171,7 @@ * @description Sets the target shim state * @param {Event} e The MouseEnter Event */- _onMouseEnter: function(e) {+ _onMouseEnter: function() { _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "_onMouseEnter", 107); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 108); this._shimState = Y.DD.DDM._noShim;@@ -184,12 +184,12 @@ * @description Resets the target shim state * @param {Event} e The MouseLeave Event */- _onMouseLeave: function(e) {+ _onMouseLeave: function() { _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "_onMouseLeave", 117); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 118); Y.DD.DDM._noShim = this._shimState; },- initializer: function(cfg) {+ initializer: function() { _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "initializer", 120); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 121); this._handles = [];@@ -245,7 +245,7 @@ * @description Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query. * @return {Self} * @chainable- */ + */ syncTargets: function() { _yuitest_coverfunc("build/dd-delegate/dd-delegate.js", "syncTargets", 159); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 160);@@ -264,7 +264,7 @@ groups = this.dd.get('groups'); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 168); config = this.get('dragConfig');- + _yuitest_coverline("build/dd-delegate/dd-delegate.js", 170); if (config && config.groups) { _yuitest_coverline("build/dd-delegate/dd-delegate.js", 171);@@ -334,7 +334,7 @@ * @attribute container * @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container. * @type String- */ + */ container: { value: 'body' },@@ -342,7 +342,7 @@ * @attribute nodes * @description A selector query to get the children of the "container" to make draggable elements from. * @type String- */ + */ nodes: { value: '.dd-draggable' },@@ -350,7 +350,7 @@ * @attribute invalid * @description A selector query to test a node to see if it's an invalid item. * @type String- */ + */ invalid: { value: 'input, select, button, a, textarea' },@@ -358,7 +358,7 @@ * @attribute lastNode * @description Y.Node instance of the last item dragged. * @type Node- */ + */ lastNode: { value: _tmpNode },@@ -366,7 +366,7 @@ * @attribute currentNode * @description Y.Node instance of the dd node. * @type Node- */ + */ currentNode: { value: _tmpNode },@@ -374,7 +374,7 @@ * @attribute dragNode * @description Y.Node instance of the dd dragNode. * @type Node- */ + */ dragNode: { value: _tmpNode },@@ -382,7 +382,7 @@ * @attribute over * @description Is the mouse currently over the container * @type Boolean- */ + */ over: { value: false },@@ -390,7 +390,7 @@ * @attribute target * @description Should the items also be a drop target. * @type Boolean- */ + */ target: { value: false },@@ -398,7 +398,7 @@ * @attribute dragConfig * @description The default config to be used when creating the DD instance. * @type Object- */ + */ dragConfig: { value: null },@@ -406,7 +406,7 @@ * @attribute handles * @description The handles config option added to the temp DD instance. * @type Array- */ + */ handles: { value: null }@@ -460,11 +460,11 @@ }); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 332);-Y.namespace('DD'); +Y.namespace('DD'); _yuitest_coverline("build/dd-delegate/dd-delegate.js", 333); Y.DD.Delegate = Delegate; -}, '3.7.2', {"requires": ["dd-drag", "dd-drop-plugin", "event-mouseenter"]});+}, '3.7.3', {"requires": ["dd-drag", "dd-drop-plugin", "event-mouseenter"]});
bundle/dd-delegate/dd-delegate-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate. * @module dd * @submodule dd-delegate- */ + */ /** * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate. * @class Delegate@@ -21,7 +21,7 @@ */ - var Delegate = function(o) {+ var Delegate = function() { Delegate.superclass.constructor.apply(this, arguments); }, CONT = 'container',@@ -39,13 +39,13 @@ /** * @property dd * @description A reference to the temporary dd instance used under the hood.- */ + */ dd: null, /** * @property _shimState * @private * @description The state of the Y.DD.DDM._noShim property to it can be reset.- */ + */ _shimState: null, /** * @private@@ -68,7 +68,7 @@ * @description Listens for the drag:end event and updates the temp dd instance. * @param {Event} e The Event. */- _afterDragEnd: function(e) {+ _afterDragEnd: function() { Y.DD.DDM._noShim = this._shimState; this.set('lastNode', this.dd.get('node'));@@ -87,7 +87,7 @@ dd = this.dd, dNode = tar, config = this.get('dragConfig');- + if (tar.test(this.get(NODES)) && !tar.test(this.get('invalid'))) { this._shimState = Y.DD.DDM._noShim; Y.DD.DDM._noShim = true;@@ -100,7 +100,7 @@ } dd.set('dragNode', dNode); dd._prep();- + dd.fire('drag:mouseDown', { ev: e }); } },@@ -110,7 +110,7 @@ * @description Sets the target shim state * @param {Event} e The MouseEnter Event */- _onMouseEnter: function(e) {+ _onMouseEnter: function() { this._shimState = Y.DD.DDM._noShim; Y.DD.DDM._noShim = true; },@@ -120,10 +120,10 @@ * @description Resets the target shim state * @param {Event} e The MouseLeave Event */- _onMouseLeave: function(e) {+ _onMouseLeave: function() { Y.DD.DDM._noShim = this._shimState; },- initializer: function(cfg) {+ initializer: function() { this._handles = []; //Create a tmp DD instance under the hood. //var conf = Y.clone(this.get('dragConfig') || {}),@@ -161,7 +161,7 @@ * @description Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query. * @return {Self} * @chainable- */ + */ syncTargets: function() { if (!Y.Plugin.Drop || this.get('destroyed')) { return;@@ -172,7 +172,7 @@ items = Y.one(this.get(CONT)).all(this.get(NODES)); groups = this.dd.get('groups'); config = this.get('dragConfig');- + if (config && config.groups) { groups = config.groups; }@@ -221,7 +221,7 @@ * @attribute container * @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container. * @type String- */ + */ container: { value: 'body' },@@ -229,7 +229,7 @@ * @attribute nodes * @description A selector query to get the children of the "container" to make draggable elements from. * @type String- */ + */ nodes: { value: '.dd-draggable' },@@ -237,7 +237,7 @@ * @attribute invalid * @description A selector query to test a node to see if it's an invalid item. * @type String- */ + */ invalid: { value: 'input, select, button, a, textarea' },@@ -245,7 +245,7 @@ * @attribute lastNode * @description Y.Node instance of the last item dragged. * @type Node- */ + */ lastNode: { value: _tmpNode },@@ -253,7 +253,7 @@ * @attribute currentNode * @description Y.Node instance of the dd node. * @type Node- */ + */ currentNode: { value: _tmpNode },@@ -261,7 +261,7 @@ * @attribute dragNode * @description Y.Node instance of the dd dragNode. * @type Node- */ + */ dragNode: { value: _tmpNode },@@ -269,7 +269,7 @@ * @attribute over * @description Is the mouse currently over the container * @type Boolean- */ + */ over: { value: false },@@ -277,7 +277,7 @@ * @attribute target * @description Should the items also be a drop target. * @type Boolean- */ + */ target: { value: false },@@ -285,7 +285,7 @@ * @attribute dragConfig * @description The default config to be used when creating the DD instance. * @type Object- */ + */ dragConfig: { value: null },@@ -293,7 +293,7 @@ * @attribute handles * @description The handles config option added to the temp DD instance. * @type Array- */ + */ handles: { value: null }@@ -335,10 +335,10 @@ } }); - Y.namespace('DD'); + Y.namespace('DD'); Y.DD.Delegate = Delegate; -}, '3.7.2', {"requires": ["dd-drag", "dd-drop-plugin", "event-mouseenter"]});+}, '3.7.3', {"requires": ["dd-drag", "dd-drop-plugin", "event-mouseenter"]});
bundle/dd-delegate/dd-delegate-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-delegate",function(e,t){var n=function(e){n.superclass.constructor.apply(this,arguments)},r="container",i="nodes",s=e.Node.create("<div>Temp Node</div>");e.extend(n,e.Base,{_bubbleTargets:e.DD.DDM,dd:null,_shimState:null,_handles:null,_onNodeChange:function(e){this.set("dragNode",e.newVal)},_afterDragEnd:function(t){e.DD.DDM._noShim=this._shimState,this.set("lastNode",this.dd.get("node")),this.get("lastNode").removeClass(e.DD.DDM.CSS_PREFIX+"-dragging"),this.dd._unprep(),this.dd.set("node",s)},_delMouseDown:function(t){var n=t.currentTarget,r=this.dd,s=n,o=this.get("dragConfig");n.test(this.get(i))&&!n.test(this.get("invalid"))&&(this._shimState=e.DD.DDM._noShim,e.DD.DDM._noShim=!0,this.set("currentNode",n),r.set("node",n),o&&o.dragNode?s=o.dragNode:r.proxy&&(s=e.DD.DDM._proxy),r.set("dragNode",s),r._prep(),r.fire("drag:mouseDown",{ev:t}))},_onMouseEnter:function(t){this._shimState=e.DD.DDM._noShim,e.DD.DDM._noShim=!0},_onMouseLeave:function(t){e.DD.DDM._noShim=this._shimState},initializer:function(t){this._handles=[];var n=this.get("dragConfig")||{},o=this.get(r);n.node=s.cloneNode(!0),n.bubbleTargets=this,this.get("handles")&&(n.handles=this.get("handles")),this.dd=new e.DD.Drag(n),this.dd.after("drag:end",e.bind(this._afterDragEnd,this)),this.dd.on("dragNodeChange",e.bind(this._onNodeChange,this)),this.dd.after("drag:mouseup",function(){this._unprep()}),this._handles.push(e.delegate(e.DD.Drag.START_EVENT,e.bind(this._delMouseDown,this),o,this.get(i))),this._handles.push(e.on("mouseenter",e.bind(this._onMouseEnter,this),o)),this._handles.push(e.on("mouseleave",e.bind(this._onMouseLeave,this),o)),e.later(50,this,this.syncTargets),e.DD.DDM.regDelegate(this)},syncTargets:function(){if(!e.Plugin.Drop||this.get("destroyed"))return;var t,n,s;return this.get("target")&&(t=e.one(this.get(r)).all(this.get(i)),n=this.dd.get("groups"),s=this.get("dragConfig"),s&&s.groups&&(n=s.groups),t.each(function(e){this.createDrop(e,n)},this)),this},createDrop:function(t,n){var r={useShim:!1,bubbleTargets:this};return t.drop||t.plug(e.Plugin.Drop,r),t.drop.set("groups",n),t},destructor:function(){this.dd&&this.dd.destroy();if(e.Plugin.Drop){var t=e.one(this.get(r)).all(this.get(i));t.unplug(e.Plugin.Drop)}e.each(this._handles,function(e){e.detach()})}},{NAME:"delegate",ATTRS:{container:{value:"body"},nodes:{value:".dd-draggable"},invalid:{value:"input, select, button, a, textarea"},lastNode:{value:s},currentNode:{value:s},dragNode:{value:s},over:{value:!1},target:{value:!1},dragConfig:{value:null},handles:{value:null}}}),e.mix(e.DD.DDM,{_delegates:[],regDelegate:function(e){this._delegates.push(e)},getDelegate:function(t){var n=null;return t=e.one(t),e.each(this._delegates,function(e){t.test(e.get(r))&&(n=e)},this),n}}),e.namespace("DD"),e.DD.Delegate=n},"3.7.2",{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]});+YUI.add("dd-delegate",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="container",i="nodes",s=e.Node.create("<div>Temp Node</div>");e.extend(n,e.Base,{_bubbleTargets:e.DD.DDM,dd:null,_shimState:null,_handles:null,_onNodeChange:function(e){this.set("dragNode",e.newVal)},_afterDragEnd:function(){e.DD.DDM._noShim=this._shimState,this.set("lastNode",this.dd.get("node")),this.get("lastNode").removeClass(e.DD.DDM.CSS_PREFIX+"-dragging"),this.dd._unprep(),this.dd.set("node",s)},_delMouseDown:function(t){var n=t.currentTarget,r=this.dd,s=n,o=this.get("dragConfig");n.test(this.get(i))&&!n.test(this.get("invalid"))&&(this._shimState=e.DD.DDM._noShim,e.DD.DDM._noShim=!0,this.set("currentNode",n),r.set("node",n),o&&o.dragNode?s=o.dragNode:r.proxy&&(s=e.DD.DDM._proxy),r.set("dragNode",s),r._prep(),r.fire("drag:mouseDown",{ev:t}))},_onMouseEnter:function(){this._shimState=e.DD.DDM._noShim,e.DD.DDM._noShim=!0},_onMouseLeave:function(){e.DD.DDM._noShim=this._shimState},initializer:function(){this._handles=[];var t=this.get("dragConfig")||{},n=this.get(r);t.node=s.cloneNode(!0),t.bubbleTargets=this,this.get("handles")&&(t.handles=this.get("handles")),this.dd=new e.DD.Drag(t),this.dd.after("drag:end",e.bind(this._afterDragEnd,this)),this.dd.on("dragNodeChange",e.bind(this._onNodeChange,this)),this.dd.after("drag:mouseup",function(){this._unprep()}),this._handles.push(e.delegate(e.DD.Drag.START_EVENT,e.bind(this._delMouseDown,this),n,this.get(i))),this._handles.push(e.on("mouseenter",e.bind(this._onMouseEnter,this),n)),this._handles.push(e.on("mouseleave",e.bind(this._onMouseLeave,this),n)),e.later(50,this,this.syncTargets),e.DD.DDM.regDelegate(this)},syncTargets:function(){if(!e.Plugin.Drop||this.get("destroyed"))return;var t,n,s;return this.get("target")&&(t=e.one(this.get(r)).all(this.get(i)),n=this.dd.get("groups"),s=this.get("dragConfig"),s&&s.groups&&(n=s.groups),t.each(function(e){this.createDrop(e,n)},this)),this},createDrop:function(t,n){var r={useShim:!1,bubbleTargets:this};return t.drop||t.plug(e.Plugin.Drop,r),t.drop.set("groups",n),t},destructor:function(){this.dd&&this.dd.destroy();if(e.Plugin.Drop){var t=e.one(this.get(r)).all(this.get(i));t.unplug(e.Plugin.Drop)}e.each(this._handles,function(e){e.detach()})}},{NAME:"delegate",ATTRS:{container:{value:"body"},nodes:{value:".dd-draggable"},invalid:{value:"input, select, button, a, textarea"},lastNode:{value:s},currentNode:{value:s},dragNode:{value:s},over:{value:!1},target:{value:!1},dragConfig:{value:null},handles:{value:null}}}),e.mix(e.DD.DDM,{_delegates:[],regDelegate:function(e){this._delegates.push(e)},getDelegate:function(t){var n=null;return t=e.one(t),e.each(this._delegates,function(e){t.test(e.get(r))&&(n=e)},this),n}}),e.namespace("DD"),e.DD.Delegate=n},"3.7.3",{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]});
bundle/dd-delegate/dd-delegate.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate. * @module dd * @submodule dd-delegate- */ + */ /** * Provides the ability to drag multiple nodes under a container element using only one Y.DD.Drag instance as a delegate. * @class Delegate@@ -21,7 +21,7 @@ */ - var Delegate = function(o) {+ var Delegate = function() { Delegate.superclass.constructor.apply(this, arguments); }, CONT = 'container',@@ -39,13 +39,13 @@ /** * @property dd * @description A reference to the temporary dd instance used under the hood.- */ + */ dd: null, /** * @property _shimState * @private * @description The state of the Y.DD.DDM._noShim property to it can be reset.- */ + */ _shimState: null, /** * @private@@ -68,7 +68,7 @@ * @description Listens for the drag:end event and updates the temp dd instance. * @param {Event} e The Event. */- _afterDragEnd: function(e) {+ _afterDragEnd: function() { Y.DD.DDM._noShim = this._shimState; this.set('lastNode', this.dd.get('node'));@@ -87,7 +87,7 @@ dd = this.dd, dNode = tar, config = this.get('dragConfig');- + if (tar.test(this.get(NODES)) && !tar.test(this.get('invalid'))) { this._shimState = Y.DD.DDM._noShim; Y.DD.DDM._noShim = true;@@ -100,7 +100,7 @@ } dd.set('dragNode', dNode); dd._prep();- + dd.fire('drag:mouseDown', { ev: e }); } },@@ -110,7 +110,7 @@ * @description Sets the target shim state * @param {Event} e The MouseEnter Event */- _onMouseEnter: function(e) {+ _onMouseEnter: function() { this._shimState = Y.DD.DDM._noShim; Y.DD.DDM._noShim = true; },@@ -120,10 +120,10 @@ * @description Resets the target shim state * @param {Event} e The MouseLeave Event */- _onMouseLeave: function(e) {+ _onMouseLeave: function() { Y.DD.DDM._noShim = this._shimState; },- initializer: function(cfg) {+ initializer: function() { this._handles = []; //Create a tmp DD instance under the hood. //var conf = Y.clone(this.get('dragConfig') || {}),@@ -161,7 +161,7 @@ * @description Applies the Y.Plugin.Drop to all nodes matching the cont + nodes selector query. * @return {Self} * @chainable- */ + */ syncTargets: function() { if (!Y.Plugin.Drop || this.get('destroyed')) { return;@@ -172,7 +172,7 @@ items = Y.one(this.get(CONT)).all(this.get(NODES)); groups = this.dd.get('groups'); config = this.get('dragConfig');- + if (config && config.groups) { groups = config.groups; }@@ -221,7 +221,7 @@ * @attribute container * @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container. * @type String- */ + */ container: { value: 'body' },@@ -229,7 +229,7 @@ * @attribute nodes * @description A selector query to get the children of the "container" to make draggable elements from. * @type String- */ + */ nodes: { value: '.dd-draggable' },@@ -237,7 +237,7 @@ * @attribute invalid * @description A selector query to test a node to see if it's an invalid item. * @type String- */ + */ invalid: { value: 'input, select, button, a, textarea' },@@ -245,7 +245,7 @@ * @attribute lastNode * @description Y.Node instance of the last item dragged. * @type Node- */ + */ lastNode: { value: _tmpNode },@@ -253,7 +253,7 @@ * @attribute currentNode * @description Y.Node instance of the dd node. * @type Node- */ + */ currentNode: { value: _tmpNode },@@ -261,7 +261,7 @@ * @attribute dragNode * @description Y.Node instance of the dd dragNode. * @type Node- */ + */ dragNode: { value: _tmpNode },@@ -269,7 +269,7 @@ * @attribute over * @description Is the mouse currently over the container * @type Boolean- */ + */ over: { value: false },@@ -277,7 +277,7 @@ * @attribute target * @description Should the items also be a drop target. * @type Boolean- */ + */ target: { value: false },@@ -285,7 +285,7 @@ * @attribute dragConfig * @description The default config to be used when creating the DD instance. * @type Object- */ + */ dragConfig: { value: null },@@ -293,7 +293,7 @@ * @attribute handles * @description The handles config option added to the temp DD instance. * @type Array- */ + */ handles: { value: null }@@ -335,10 +335,10 @@ } }); - Y.namespace('DD'); + Y.namespace('DD'); Y.DD.Delegate = Delegate; -}, '3.7.2', {"requires": ["dd-drag", "dd-drop-plugin", "event-mouseenter"]});+}, '3.7.3', {"requires": ["dd-drag", "dd-drop-plugin", "event-mouseenter"]});
bundle/dd-drag/dd-drag-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/dd-drag/dd-drag.js", code: [] };-_yuitest_coverage["build/dd-drag/dd-drag.js"].code=["YUI.add('dd-drag', function (Y, NAME) {","",""," /**"," * Provides the ability to drag a Node."," * @module dd"," * @submodule dd-drag"," */ "," /**"," * Provides the ability to drag a Node."," * @class Drag"," * @extends Base"," * @constructor"," * @namespace DD"," */",""," var DDM = Y.DD.DDM,"," NODE = 'node',"," DRAGGING = 'dragging',"," DRAG_NODE = 'dragNode',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth', "," /**"," * @event drag:mouseup"," * @description Handles the mouseup DOM event, does nothing internally just fires."," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:mouseDown"," * @description Handles the mousedown DOM event, checks to see if you have a valid handle then starts the drag timers."," * @preventable _defMouseDownFn"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_MOUSE_DOWN = 'drag:mouseDown',"," /**"," * @event drag:afterMouseDown"," * @description Fires after the mousedown event has been cleared."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_AFTER_MOUSE_DOWN = 'drag:afterMouseDown',"," /**"," * @event drag:removeHandle"," * @description Fires after a handle is removed."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_REMOVE_HANDLE = 'drag:removeHandle',"," /**"," * @event drag:addHandle"," * @description Fires after a handle is added."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_ADD_HANDLE = 'drag:addHandle',"," /**"," * @event drag:removeInvalid"," * @description Fires after an invalid selector is removed."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_REMOVE_INVALID = 'drag:removeInvalid',"," /**"," * @event drag:addInvalid"," * @description Fires after an invalid selector is added."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_ADD_INVALID = 'drag:addInvalid',"," /**"," * @event drag:start"," * @description Fires at the start of a drag operation."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The original node position X.</dd>"," * <dt>pageY</dt><dd>The original node position Y.</dd>"," * <dt>startTime</dt><dd>The startTime of the event. getTime on the current Date object.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_START = 'drag:start',"," /**"," * @event drag:end"," * @description Fires at the end of a drag operation."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * <dt>startTime</dt><dd>The startTime of the event, from the start event.</dd>"," * <dt>endTime</dt><dd>The endTime of the event. getTime on the current Date object.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_END = 'drag:end',"," /**"," * @event drag:drag"," * @description Fires every mousemove during a drag operation."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * <dt>scroll</dt><dd>Should a scroll action occur.</dd>"," * <dt>info</dt><dd>Object hash containing calculated XY arrays: start, xy, delta, offset</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DRAG = 'drag:drag',"," /**"," * @event drag:align"," * @preventable _defAlignFn"," * @description Fires when this node is aligned."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_ALIGN = 'drag:align',"," /**"," * @event drag:over"," * @description Fires when this node is over a Drop Target. (Fired from dd-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:enter"," * @description Fires when this node enters a Drop Target. (Fired from dd-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:exit"," * @description Fires when this node exits a Drop Target. (Fired from dd-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:drophit"," * @description Fires when this node is dropped on a valid Drop Target. (Fired from dd-ddm-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The best guess on what was dropped on.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:dropmiss"," * @description Fires when this node is dropped on an invalid Drop Target. (Fired from dd-ddm-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," "," Drag = function(o) {"," this._lazyAddAttrs = false;"," Drag.superclass.constructor.apply(this, arguments);",""," var valid = DDM._regDrag(this);"," if (!valid) {"," Y.error('Failed to register node, already in use: ' + o.node);"," }"," };",""," Drag.NAME = 'drag';"," "," /**"," * This property defaults to \"mousedown\", but when drag-gestures is loaded, it is changed to \"gesturemovestart\""," * @static"," * @property START_EVENT"," */"," Drag.START_EVENT = 'mousedown';",""," Drag.ATTRS = {"," /**"," * @attribute node"," * @description Y.Node instance to use as the element to initiate a drag operation"," * @type Node"," */"," node: {"," setter: function(node) {"," if (this._canDrag(node)) {"," return node;"," }"," var n = Y.one(node);"," if (!n) {"," Y.error('DD.Drag: Invalid Node Given: ' + node);"," }"," return n;"," }"," },"," /**"," * @attribute dragNode"," * @description Y.Node instance to use as the draggable element, defaults to node"," * @type Node"," */"," dragNode: {"," setter: function(node) {"," if (this._canDrag(node)) {"," return node;"," }"," var n = Y.one(node);"," if (!n) {"," Y.error('DD.Drag: Invalid dragNode Given: ' + node);"," }"," return n;"," }"," },"," /**"," * @attribute offsetNode"," * @description Offset the drag element by the difference in cursor position: default true"," * @type Boolean"," */"," offsetNode: {"," value: true"," },"," /**"," * @attribute startCentered"," * @description Center the dragNode to the mouse position on drag:start: default false"," * @type Boolean"," */"," startCentered: {"," value: false"," },"," /**"," * @attribute clickPixelThresh"," * @description The number of pixels to move to start a drag operation, default is 3."," * @type Number"," */"," clickPixelThresh: {"," value: DDM.get('clickPixelThresh')"," },"," /**"," * @attribute clickTimeThresh"," * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000."," * @type Number"," */"," clickTimeThresh: {"," value: DDM.get('clickTimeThresh')"," },"," /**"," * @attribute lock"," * @description Set to lock this drag element so that it can't be dragged: default false."," * @type Boolean"," */"," lock: {"," value: false,"," setter: function(lock) {"," if (lock) {"," this.get(NODE).addClass(DDM.CSS_PREFIX + '-locked');"," } else {"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-locked');"," }"," return lock;"," }"," },"," /**"," * @attribute data"," * @description A payload holder to store arbitrary data about this drag object, can be used to store any value."," * @type Mixed"," */"," data: {"," value: false"," },"," /**"," * @attribute move"," * @description If this is false, the drag element will not move with the cursor: default true. Can be used to \"resize\" the element."," * @type Boolean"," */"," move: {"," value: true"," },"," /**"," * @attribute useShim"," * @description Use the protective shim on all drag operations: default true. Only works with dd-ddm, not dd-ddm-base."," * @type Boolean"," */"," useShim: {"," value: true"," },"," /**"," * @attribute activeHandle"," * @description This config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false."," * @type Node"," */"," activeHandle: {"," value: false"," },"," /**"," * @attribute primaryButtonOnly"," * @description By default a drag operation will only begin if the mousedown occurred with the primary mouse button. Setting this to false will allow for all mousedown events to trigger a drag."," * @type Boolean"," */"," primaryButtonOnly: {"," value: true"," },"," /**"," * @attribute dragging"," * @description This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change."," * @type Boolean"," */"," dragging: {"," value: false"," },"," parent: {"," value: false"," },"," /**"," * @attribute target"," * @description This attribute only works if the dd-drop module has been loaded. It will make this node a drop target as well as draggable."," * @type Boolean"," */"," target: {"," value: false,"," setter: function(config) {"," this._handleTarget(config);"," return config;"," }"," },"," /**"," * @attribute dragMode"," * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance."," * @type String"," */"," dragMode: {"," value: null,"," setter: function(mode) {"," return DDM._setDragMode(mode);"," }"," },"," /**"," * @attribute groups"," * @description Array of groups to add this drag into."," * @type Array"," */"," groups: {"," value: ['default'],"," getter: function() {"," if (!this._groups) {"," this._groups = {};"," }"," var ret = [];"," Y.each(this._groups, function(v, k) {"," ret[ret.length] = k;"," });"," return ret;"," },"," setter: function(g) {"," this._groups = {};"," Y.each(g, function(v, k) {"," this._groups[v] = true;"," }, this);"," return g;"," }"," },"," /**"," * @attribute handles"," * @description Array of valid handles to add. Adding something here will set all handles, even if previously added with addHandle"," * @type Array"," */"," handles: {"," value: null,"," setter: function(g) {"," if (g) {"," this._handles = {};"," Y.each(g, function(v, k) {"," var key = v;"," if (v instanceof Y.Node || v instanceof Y.NodeList) {"," key = v._yuid;"," }"," this._handles[key] = v;"," }, this);"," } else {"," this._handles = null;"," }"," return g;"," }"," },"," /**"," * @deprecated"," * @attribute bubbles"," * @description Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config"," * @type Object"," */"," bubbles: {"," setter: function(t) {"," this.addTarget(t);"," return t;"," }"," },"," /**"," * @attribute haltDown"," * @description Should the mousedown event be halted. Default: true"," * @type Boolean"," */"," haltDown: {"," value: true"," }"," };",""," Y.extend(Drag, Y.Base, {"," /**"," * Checks the object for the methods needed to drag the object around. "," * Normally this would be a node instance, but in the case of Graphics, it"," * may be an SVG node or something similar."," * @method _canDrag"," * @private"," * @param {Object} n The object to check"," * @return {Boolean} True or false if the Object contains the methods needed to Drag"," */"," _canDrag: function(n) {"," if (n && n.setXY && n.getXY && n.test && n.contains) {"," return true;"," }"," return false;"," },"," /**"," * @private"," * @property _bubbleTargets"," * @description The default bubbleTarget for this object. Default: Y.DD.DDM"," */"," _bubbleTargets: Y.DD.DDM,"," /**"," * @method addToGroup"," * @description Add this Drag instance to a group, this should be used for on-the-fly group additions."," * @param {String} g The group to add this Drag Instance to."," * @return {Self}"," * @chainable"," */"," addToGroup: function(g) {"," this._groups[g] = true;"," DDM._activateTargets();"," return this;"," },"," /**"," * @method removeFromGroup"," * @description Remove this Drag instance from a group, this should be used for on-the-fly group removals."," * @param {String} g The group to remove this Drag Instance from."," * @return {Self}"," * @chainable"," */"," removeFromGroup: function(g) {"," delete this._groups[g];"," DDM._activateTargets();"," return this;"," },"," /**"," * @property target"," * @description This will be a reference to the Drop instance associated with this drag if the target: true config attribute is set.."," * @type {Object}"," */"," target: null,"," /**"," * @private"," * @method _handleTarget"," * @description Attribute handler for the target config attribute."," * @param {Boolean/Object} config The Config"," */"," _handleTarget: function(config) {"," if (Y.DD.Drop) {"," if (config === false) {"," if (this.target) {"," DDM._unregTarget(this.target);"," this.target = null;"," }"," } else {"," if (!Y.Lang.isObject(config)) {"," config = {};"," }"," config.bubbleTargets = config.bubbleTargets || Y.Object.values(this._yuievt.targets);"," config.node = this.get(NODE);"," config.groups = config.groups || this.get('groups');"," this.target = new Y.DD.Drop(config);"," }"," }"," },"," /**"," * @private"," * @property _groups"," * @description Storage Array for the groups this drag belongs to."," * @type {Array}"," */"," _groups: null,"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {"," "," this.publish(EV_MOUSE_DOWN, {"," defaultFn: this._defMouseDownFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });"," "," this.publish(EV_ALIGN, {"," defaultFn: this._defAlignFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });"," "," this.publish(EV_DRAG, {"," defaultFn: this._defDragFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });"," "," this.publish(EV_END, {"," defaultFn: this._defEndFn,"," preventedFn: this._prevEndFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });"," "," var ev = ["," EV_AFTER_MOUSE_DOWN,"," EV_REMOVE_HANDLE,"," EV_ADD_HANDLE,"," EV_REMOVE_INVALID,"," EV_ADD_INVALID,"," EV_START,"," 'drag:drophit',"," 'drag:dropmiss',"," 'drag:over',"," 'drag:enter',"," 'drag:exit'"," ];"," "," Y.each(ev, function(v, k) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," bubbles: true,"," preventable: false,"," queuable: false,"," prefix: 'drag'"," });"," }, this);"," },"," /**"," * @private"," * @property _ev_md"," * @description A private reference to the mousedown DOM event"," * @type {EventFacade}"," */"," _ev_md: null,"," /**"," * @private"," * @property _startTime"," * @description The getTime of the mousedown event. Not used, just here in case someone wants/needs to use it."," * @type Date"," */"," _startTime: null,"," /**"," * @private"," * @property _endTime"," * @description The getTime of the mouseup event. Not used, just here in case someone wants/needs to use it."," * @type Date"," */"," _endTime: null,"," /**"," * @private"," * @property _handles"," * @description A private hash of the valid drag handles"," * @type {Object}"," */"," _handles: null,"," /**"," * @private"," * @property _invalids"," * @description A private hash of the invalid selector strings"," * @type {Object}"," */"," _invalids: null,"," /**"," * @private"," * @property _invalidsDefault"," * @description A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true}"," * @type {Object}"," */"," _invalidsDefault: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true },"," /**"," * @private"," * @property _dragThreshMet"," * @description Private flag to see if the drag threshhold was met"," * @type {Boolean}"," */"," _dragThreshMet: null,"," /**"," * @private"," * @property _fromTimeout"," * @description Flag to determine if the drag operation came from a timeout"," * @type {Boolean}"," */"," _fromTimeout: null,"," /**"," * @private"," * @property _clickTimeout"," * @description Holder for the setTimeout call"," * @type {Boolean}"," */"," _clickTimeout: null,"," /**"," * @property deltaXY"," * @description The offset of the mouse position to the element's position"," * @type {Array}"," */"," deltaXY: null,"," /**"," * @property startXY"," * @description The initial mouse position"," * @type {Array}"," */"," startXY: null,"," /**"," * @property nodeXY"," * @description The initial element position"," * @type {Array}"," */"," nodeXY: null,"," /**"," * @property lastXY"," * @description The position of the element as it's moving (for offset calculations)"," * @type {Array}"," */"," lastXY: null,"," /**"," * @property actXY"," * @description The xy that the node will be set to. Changing this will alter the position as it's dragged."," * @type {Array}"," */"," actXY: null,"," /**"," * @property realXY"," * @description The real xy position of the node."," * @type {Array}"," */"," realXY: null,"," /**"," * @property mouseXY"," * @description The XY coords of the mousemove"," * @type {Array}"," */"," mouseXY: null,"," /**"," * @property region"," * @description A region object associated with this drag, used for checking regions while dragging."," * @type Object"," */"," region: null, "," /**"," * @private"," * @method _handleMouseUp"," * @description Handler for the mouseup DOM event"," * @param {EventFacade} ev The Event"," */"," _handleMouseUp: function(ev) {"," this.fire('drag:mouseup');"," this._fixIEMouseUp();"," if (DDM.activeDrag) {"," DDM._end();"," }"," },"," /** "," * @private"," * @method _fixDragStart"," * @description The function we use as the ondragstart handler when we start a drag in Internet Explorer. This keeps IE from blowing up on images as drag handles."," * @param {Event} e The Event"," */"," _fixDragStart: function(e) {"," if (this.validClick(e)) {"," e.preventDefault();"," }"," },"," /** "," * @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 _fixIEMouseDown"," * @description This method copies the onselectstart listner on the document to the _ieSelectFix property"," */"," _fixIEMouseDown: function(e) {"," if (Y.UA.ie) {"," this._ieSelectBack = Y.config.doc.body.onselectstart;"," Y.config.doc.body.onselectstart = this._ieSelectFix;"," } "," },"," /**"," * @private"," * @method _fixIEMouseUp"," * @description This method copies the _ieSelectFix property back to the onselectstart listner on the document."," */"," _fixIEMouseUp: function() {"," if (Y.UA.ie) {"," Y.config.doc.body.onselectstart = this._ieSelectBack;"," } "," },"," /**"," * @private"," * @method _handleMouseDownEvent"," * @description Handler for the mousedown DOM event"," * @param {EventFacade} ev The Event"," */"," _handleMouseDownEvent: function(ev) {"," this.fire(EV_MOUSE_DOWN, { ev: ev });"," },"," /**"," * @private"," * @method _defMouseDownFn"," * @description Handler for the mousedown DOM event"," * @param {EventFacade} e The Event"," */"," _defMouseDownFn: function(e) {"," var ev = e.ev;",""," this._dragThreshMet = false;"," this._ev_md = ev;"," "," if (this.get('primaryButtonOnly') && ev.button > 1) {"," return false;"," }"," if (this.validClick(ev)) {"," this._fixIEMouseDown(ev);"," if (this.get('haltDown')) {"," ev.halt();"," } else {"," ev.preventDefault();"," }"," "," this._setStartPosition([ev.pageX, ev.pageY]);",""," DDM.activeDrag = this;"," "," this._clickTimeout = Y.later(this.get('clickTimeThresh'), this, this._timeoutCheck);"," }"," this.fire(EV_AFTER_MOUSE_DOWN, { ev: ev });"," },"," /**"," * @method validClick"," * @description Method first checks to see if we have handles, if so it validates the click against the handle. Then if it finds a valid handle, it checks it against the invalid handles list. Returns true if a good handle was used, false otherwise."," * @param {EventFacade} ev The Event"," * @return {Boolean}"," */"," validClick: function(ev) {"," var r = false, n = false,"," tar = ev.target,"," hTest = null,"," els = null,"," nlist = null,"," set = false;"," if (this._handles) {"," Y.each(this._handles, function(i, n) {"," if (i instanceof Y.Node || i instanceof Y.NodeList) {"," if (!r) {"," nlist = i;"," if (nlist instanceof Y.Node) {"," nlist = new Y.NodeList(i._node);"," }"," nlist.each(function(nl) {"," if (nl.contains(tar)) {"," r = true;"," }"," });"," }"," } else if (Y.Lang.isString(n)) {"," //Am I this or am I inside this"," if (tar.test(n + ', ' + n + ' *') && !hTest) {"," hTest = n;"," r = true;"," }"," }"," });"," } else {"," n = this.get(NODE);"," if (n.contains(tar) || n.compareTo(tar)) {"," r = true;"," }"," }"," if (r) {"," if (this._invalids) {"," Y.each(this._invalids, function(i, n) {"," if (Y.Lang.isString(n)) {"," //Am I this or am I inside this"," if (tar.test(n + ', ' + n + ' *')) {"," r = false;"," }"," }"," });"," }"," }"," if (r) {"," if (hTest) {"," els = ev.currentTarget.all(hTest);"," set = false;"," els.each(function(n, i) {"," if ((n.contains(tar) || n.compareTo(tar)) && !set) {"," set = true;"," this.set('activeHandle', n);"," }"," }, this);"," } else {"," this.set('activeHandle', this.get(NODE));"," }"," }"," return r;"," },"," /**"," * @private"," * @method _setStartPosition"," * @description Sets the current position of the Element and calculates the offset"," * @param {Array} xy The XY coords to set the position to."," */"," _setStartPosition: function(xy) {"," this.startXY = xy;"," "," this.nodeXY = this.lastXY = this.realXY = this.get(NODE).getXY();"," "," if (this.get('offsetNode')) {"," this.deltaXY = [(this.startXY[0] - this.nodeXY[0]), (this.startXY[1] - this.nodeXY[1])];"," } else {"," this.deltaXY = [0, 0];"," }"," },"," /**"," * @private"," * @method _timeoutCheck"," * @description The method passed to setTimeout to determine if the clickTimeThreshold was met."," */"," _timeoutCheck: function() {"," if (!this.get('lock') && !this._dragThreshMet && this._ev_md) {"," this._fromTimeout = this._dragThreshMet = true;"," this.start();"," this._alignNode([this._ev_md.pageX, this._ev_md.pageY], true);"," }"," },"," /**"," * @method removeHandle"," * @description Remove a Selector added by addHandle"," * @param {String} str The selector for the handle to be removed. "," * @return {Self}"," * @chainable"," */"," removeHandle: function(str) {"," var key = str;"," if (str instanceof Y.Node || str instanceof Y.NodeList) {"," key = str._yuid;"," }"," if (this._handles[key]) {"," delete this._handles[key];"," this.fire(EV_REMOVE_HANDLE, { handle: str });"," }"," return this;"," },"," /**"," * @method addHandle"," * @description Add a handle to a drag element. Drag only initiates when a mousedown happens on this element."," * @param {String} str The selector to test for a valid handle. Must be a child of the element."," * @return {Self}"," * @chainable"," */"," addHandle: function(str) {"," if (!this._handles) {"," this._handles = {};"," }"," var key = str;"," if (str instanceof Y.Node || str instanceof Y.NodeList) {"," key = str._yuid;"," }"," this._handles[key] = str;"," this.fire(EV_ADD_HANDLE, { handle: str });"," return this;"," },"," /**"," * @method removeInvalid"," * @description Remove an invalid handle added by addInvalid"," * @param {String} str The invalid handle to remove from the internal list."," * @return {Self}"," * @chainable"," */"," removeInvalid: function(str) {"," if (this._invalids[str]) {"," this._invalids[str] = null;"," delete this._invalids[str];"," this.fire(EV_REMOVE_INVALID, { handle: str });"," }"," return this;"," },"," /**"," * @method addInvalid"," * @description Add a selector string to test the handle against. If the test passes the drag operation will not continue."," * @param {String} str The selector to test against to determine if this is an invalid drag handle."," * @return {Self}"," * @chainable"," */"," addInvalid: function(str) {"," if (Y.Lang.isString(str)) {"," this._invalids[str] = true;"," this.fire(EV_ADD_INVALID, { handle: str });"," }"," return this;"," },"," /**"," * @private"," * @method initializer"," * @description Internal init handler"," */"," initializer: function(cfg) {",""," this.get(NODE).dd = this;",""," if (!this.get(NODE).get('id')) {"," var id = Y.stamp(this.get(NODE));"," this.get(NODE).set('id', id);"," }",""," this.actXY = [];"," "," this._invalids = Y.clone(this._invalidsDefault, true);",""," this._createEvents();"," "," if (!this.get(DRAG_NODE)) {"," this.set(DRAG_NODE, this.get(NODE));"," }",""," //Fix for #2528096"," //Don't prep the DD instance until all plugins are loaded."," this.on('initializedChange', Y.bind(this._prep, this));",""," //Shouldn't have to do this.."," this.set('groups', this.get('groups'));"," },"," /**"," * @private"," * @method _prep"," * @description Attach event listners and add classname"," */"," _prep: function() {"," this._dragThreshMet = false;"," var node = this.get(NODE);"," node.addClass(DDM.CSS_PREFIX + '-draggable');"," node.on(Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this));"," node.on('mouseup', Y.bind(this._handleMouseUp, this));"," node.on('dragstart', Y.bind(this._fixDragStart, this));"," },"," /**"," * @private"," * @method _unprep"," * @description Detach event listeners and remove classname"," */"," _unprep: function() {"," var node = this.get(NODE);"," node.removeClass(DDM.CSS_PREFIX + '-draggable');"," node.detachAll('mouseup');"," node.detachAll('dragstart');"," node.detachAll(Drag.START_EVENT);"," this.mouseXY = [];"," this.deltaXY = [0,0];"," this.startXY = [];"," this.nodeXY = [];"," this.lastXY = [];"," this.actXY = [];"," this.realXY = [];"," },"," /**"," * @method start"," * @description Starts the drag operation"," * @return {Self}"," * @chainable"," */"," start: function() {"," if (!this.get('lock') && !this.get(DRAGGING)) {"," var node = this.get(NODE), ow, oh, xy;"," this._startTime = (new Date()).getTime();",""," DDM._start();"," node.addClass(DDM.CSS_PREFIX + '-dragging');"," this.fire(EV_START, {"," pageX: this.nodeXY[0],"," pageY: this.nodeXY[1],"," startTime: this._startTime"," });"," node = this.get(DRAG_NODE);"," xy = this.nodeXY;"," "," ow = node.get(OFFSET_WIDTH);"," oh = node.get(OFFSET_HEIGHT);"," "," if (this.get('startCentered')) {"," this._setStartPosition([xy[0] + (ow / 2), xy[1] + (oh / 2)]);"," }"," "," "," this.region = {"," '0': xy[0], "," '1': xy[1],"," area: 0,"," top: xy[1],"," right: xy[0] + ow,"," bottom: xy[1] + oh,"," left: xy[0]"," };"," this.set(DRAGGING, true);"," }"," return this;"," },"," /**"," * @method end"," * @description Ends the drag operation"," * @return {Self}"," * @chainable"," */"," end: function() {"," this._endTime = (new Date()).getTime();"," if (this._clickTimeout) {"," this._clickTimeout.cancel();"," }"," this._dragThreshMet = this._fromTimeout = false;",""," if (!this.get('lock') && this.get(DRAGGING)) {"," this.fire(EV_END, {"," pageX: this.lastXY[0],"," pageY: this.lastXY[1],"," startTime: this._startTime,"," endTime: this._endTime"," });"," }"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-dragging');"," this.set(DRAGGING, false);"," this.deltaXY = [0, 0];",""," return this;"," },"," /**"," * @private"," * @method _defEndFn"," * @description Handler for fixing the selection in IE"," */"," _defEndFn: function(e) {"," this._fixIEMouseUp();"," this._ev_md = null;"," },"," /**"," * @private"," * @method _prevEndFn"," * @description Handler for preventing the drag:end event. It will reset the node back to it's start position"," */"," _prevEndFn: function(e) {"," this._fixIEMouseUp();"," //Bug #1852577"," this.get(DRAG_NODE).setXY(this.nodeXY);"," this._ev_md = null;"," this.region = null;"," },"," /**"," * @private"," * @method _align"," * @description Calculates the offsets and set's the XY that the element will move to."," * @param {Array} xy The xy coords to align with."," */"," _align: function(xy) {"," this.fire(EV_ALIGN, {pageX: xy[0], pageY: xy[1] });"," },"," /**"," * @private"," * @method _defAlignFn"," * @description Calculates the offsets and set's the XY that the element will move to."," * @param {EventFacade} e The drag:align event."," */"," _defAlignFn: function(e) {"," this.actXY = [e.pageX - this.deltaXY[0], e.pageY - this.deltaXY[1]];"," },"," /**"," * @private"," * @method _alignNode"," * @description This method performs the alignment before the element move."," * @param {Array} eXY The XY to move the element to, usually comes from the mousemove DOM event."," */"," _alignNode: function(eXY, scroll) {"," this._align(eXY);"," if (!scroll) {"," this._moveNode();"," }"," },"," /**"," * @private"," * @method _moveNode"," * @description This method performs the actual element move."," */"," _moveNode: function(scroll) {"," //if (!this.get(DRAGGING)) {"," // return;"," //}"," var diffXY = [], diffXY2 = [], startXY = this.nodeXY, xy = this.actXY;",""," diffXY[0] = (xy[0] - this.lastXY[0]);"," diffXY[1] = (xy[1] - this.lastXY[1]);",""," diffXY2[0] = (xy[0] - this.nodeXY[0]);"," diffXY2[1] = (xy[1] - this.nodeXY[1]);","",""," this.region = {"," '0': xy[0], "," '1': xy[1],"," area: 0,"," top: xy[1],"," right: xy[0] + this.get(DRAG_NODE).get(OFFSET_WIDTH),"," bottom: xy[1] + this.get(DRAG_NODE).get(OFFSET_HEIGHT),"," left: xy[0]"," };",""," this.fire(EV_DRAG, {"," pageX: xy[0],"," pageY: xy[1],"," scroll: scroll,"," info: {"," start: startXY,"," xy: xy,"," delta: diffXY,"," offset: diffXY2"," } "," });"," "," this.lastXY = xy;"," },"," /**"," * @private"," * @method _defDragFn"," * @description Default function for drag:drag. Fired from _moveNode."," * @param {EventFacade} ev The drag:drag event"," */"," _defDragFn: function(e) {"," if (this.get('move')) {"," if (e.scroll && e.scroll.node) {"," e.scroll.node.set('scrollTop', e.scroll.top);"," e.scroll.node.set('scrollLeft', e.scroll.left);"," }"," this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);"," this.realXY = [e.pageX, e.pageY];"," }"," },"," /**"," * @private"," * @method _move"," * @description Fired from DragDropMgr (DDM) on mousemove."," * @param {EventFacade} ev The mousemove DOM event"," */"," _move: function(ev) {"," if (this.get('lock')) {"," return false;"," }",""," this.mouseXY = [ev.pageX, ev.pageY];"," if (!this._dragThreshMet) {"," var diffX = Math.abs(this.startXY[0] - ev.pageX),"," diffY = Math.abs(this.startXY[1] - ev.pageY);"," if (diffX > this.get('clickPixelThresh') || diffY > this.get('clickPixelThresh')) {"," this._dragThreshMet = true;"," this.start();"," this._alignNode([ev.pageX, ev.pageY]);"," }"," } else {"," if (this._clickTimeout) {"," this._clickTimeout.cancel();"," }"," this._alignNode([ev.pageX, ev.pageY]);"," }"," },"," /**"," * @method stopDrag"," * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag."," * @return {Self}"," * @chainable"," */"," stopDrag: function() {"," if (this.get(DRAGGING)) {"," DDM._end();"," }"," return this;"," },"," /**"," * @private"," * @method destructor"," * @description Lifecycle destructor, unreg the drag from the DDM and remove listeners"," */"," destructor: function() {"," this._unprep();"," if (this.target) {"," this.target.destroy();"," }"," DDM._unregDrag(this);"," }"," });"," Y.namespace('DD'); "," Y.DD.Drag = Drag;","","","","","}, '3.7.2', {\"requires\": [\"dd-ddm-base\"]});"];-_yuitest_coverage["build/dd-drag/dd-drag.js"].lines = {"1":0,"17":0,"195":0,"196":0,"198":0,"199":0,"200":0,"204":0,"211":0,"213":0,"221":0,"222":0,"224":0,"225":0,"226":0,"228":0,"238":0,"239":0,"241":0,"242":0,"243":0,"245":0,"288":0,"289":0,"291":0,"293":0,"355":0,"356":0,"367":0,"378":0,"379":0,"381":0,"382":0,"383":0,"385":0,"388":0,"389":0,"390":0,"392":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"410":0,"413":0,"415":0,"426":0,"427":0,"440":0,"451":0,"452":0,"454":0,"470":0,"471":0,"472":0,"482":0,"483":0,"484":0,"499":0,"500":0,"501":0,"502":0,"503":0,"506":0,"507":0,"509":0,"510":0,"511":0,"512":0,"530":0,"538":0,"546":0,"554":0,"563":0,"577":0,"578":0,"706":0,"707":0,"708":0,"709":0,"719":0,"720":0,"729":0,"743":0,"744":0,"745":0,"754":0,"755":0,"765":0,"774":0,"776":0,"777":0,"779":0,"780":0,"782":0,"783":0,"784":0,"785":0,"787":0,"790":0,"792":0,"794":0,"796":0,"805":0,"811":0,"812":0,"813":0,"814":0,"815":0,"816":0,"817":0,"819":0,"820":0,"821":0,"825":0,"827":0,"828":0,"829":0,"834":0,"835":0,"836":0,"839":0,"840":0,"841":0,"842":0,"844":0,"845":0,"851":0,"852":0,"853":0,"854":0,"855":0,"856":0,"857":0,"858":0,"862":0,"865":0,"874":0,"876":0,"878":0,"879":0,"881":0,"890":0,"891":0,"892":0,"893":0,"904":0,"905":0,"906":0,"908":0,"909":0,"910":0,"912":0,"922":0,"923":0,"925":0,"926":0,"927":0,"929":0,"930":0,"931":0,"941":0,"942":0,"943":0,"944":0,"946":0,"956":0,"957":0,"958":0,"960":0,"969":0,"971":0,"972":0,"973":0,"976":0,"978":0,"980":0,"982":0,"983":0,"988":0,"991":0,"999":0,"1000":0,"1001":0,"1002":0,"1003":0,"1004":0,"1012":0,"1013":0,"1014":0,"1015":0,"1016":0,"1017":0,"1018":0,"1019":0,"1020":0,"1021":0,"1022":0,"1023":0,"1032":0,"1033":0,"1034":0,"1036":0,"1037":0,"1038":0,"1043":0,"1044":0,"1046":0,"1047":0,"1049":0,"1050":0,"1054":0,"1063":0,"1065":0,"1074":0,"1075":0,"1076":0,"1078":0,"1080":0,"1081":0,"1088":0,"1089":0,"1090":0,"1092":0,"1100":0,"1101":0,"1109":0,"1111":0,"1112":0,"1113":0,"1122":0,"1131":0,"1140":0,"1141":0,"1142":0,"1154":0,"1156":0,"1157":0,"1159":0,"1160":0,"1163":0,"1173":0,"1185":0,"1194":0,"1195":0,"1196":0,"1197":0,"1199":0,"1200":0,"1210":0,"1211":0,"1214":0,"1215":0,"1216":0,"1218":0,"1219":0,"1220":0,"1221":0,"1224":0,"1225":0,"1227":0,"1237":0,"1238":0,"1240":0,"1248":0,"1249":0,"1250":0,"1252":0,"1255":0,"1256":0};-_yuitest_coverage["build/dd-drag/dd-drag.js"].functions = {"Drag:194":0,"setter:220":0,"setter:237":0,"setter:287":0,"setter:354":0,"setter:366":0,"(anonymous 2):382":0,"getter:377":0,"(anonymous 3):389":0,"setter:387":0,"(anonymous 4):405":0,"setter:402":0,"setter:425":0,"_canDrag:450":0,"addToGroup:469":0,"removeFromGroup:481":0,"_handleTarget:498":0,"(anonymous 5):577":0,"_createEvents:528":0,"_handleMouseUp:705":0,"_fixDragStart:718":0,"_ieSelectFix:728":0,"_fixIEMouseDown:742":0,"_fixIEMouseUp:753":0,"_handleMouseDownEvent:764":0,"_defMouseDownFn:773":0,"(anonymous 7):819":0,"(anonymous 6):812":0,"(anonymous 8):841":0,"(anonymous 9):855":0,"validClick:804":0,"_setStartPosition:873":0,"_timeoutCheck:889":0,"removeHandle:903":0,"addHandle:921":0,"removeInvalid:940":0,"addInvalid:955":0,"initializer:967":0,"_prep:998":0,"_unprep:1011":0,"start:1031":0,"end:1073":0,"_defEndFn:1099":0,"_prevEndFn:1108":0,"_align:1121":0,"_defAlignFn:1130":0,"_alignNode:1139":0,"_moveNode:1150":0,"_defDragFn:1193":0,"_move:1209":0,"stopDrag:1236":0,"destructor:1247":0,"(anonymous 1):1":0};-_yuitest_coverage["build/dd-drag/dd-drag.js"].coveredLines = 272;+_yuitest_coverage["build/dd-drag/dd-drag.js"].code=["YUI.add('dd-drag', function (Y, NAME) {","",""," /**"," * Provides the ability to drag a Node."," * @module dd"," * @submodule dd-drag"," */"," /**"," * Provides the ability to drag a Node."," * @class Drag"," * @extends Base"," * @constructor"," * @namespace DD"," */",""," var DDM = Y.DD.DDM,"," NODE = 'node',"," DRAGGING = 'dragging',"," DRAG_NODE = 'dragNode',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," /**"," * @event drag:mouseup"," * @description Handles the mouseup DOM event, does nothing internally just fires."," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:mouseDown"," * @description Handles the mousedown DOM event, checks to see if you have a valid handle then starts the drag timers."," * @preventable _defMouseDownFn"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_MOUSE_DOWN = 'drag:mouseDown',"," /**"," * @event drag:afterMouseDown"," * @description Fires after the mousedown event has been cleared."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>ev</dt><dd>The original mousedown event.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_AFTER_MOUSE_DOWN = 'drag:afterMouseDown',"," /**"," * @event drag:removeHandle"," * @description Fires after a handle is removed."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_REMOVE_HANDLE = 'drag:removeHandle',"," /**"," * @event drag:addHandle"," * @description Fires after a handle is added."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_ADD_HANDLE = 'drag:addHandle',"," /**"," * @event drag:removeInvalid"," * @description Fires after an invalid selector is removed."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was removed.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_REMOVE_INVALID = 'drag:removeInvalid',"," /**"," * @event drag:addInvalid"," * @description Fires after an invalid selector is added."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl><dt>handle</dt><dd>The handle that was added.</dd></dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_ADD_INVALID = 'drag:addInvalid',"," /**"," * @event drag:start"," * @description Fires at the start of a drag operation."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The original node position X.</dd>"," * <dt>pageY</dt><dd>The original node position Y.</dd>"," * <dt>startTime</dt><dd>The startTime of the event. getTime on the current Date object.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_START = 'drag:start',"," /**"," * @event drag:end"," * @description Fires at the end of a drag operation."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * <dt>startTime</dt><dd>The startTime of the event, from the start event.</dd>"," * <dt>endTime</dt><dd>The endTime of the event. getTime on the current Date object.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_END = 'drag:end',"," /**"," * @event drag:drag"," * @description Fires every mousemove during a drag operation."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * <dt>scroll</dt><dd>Should a scroll action occur.</dd>"," * <dt>info</dt><dd>Object hash containing calculated XY arrays: start, xy, delta, offset</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DRAG = 'drag:drag',"," /**"," * @event drag:align"," * @preventable _defAlignFn"," * @description Fires when this node is aligned."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_ALIGN = 'drag:align',"," /**"," * @event drag:over"," * @description Fires when this node is over a Drop Target. (Fired from dd-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:enter"," * @description Fires when this node enters a Drop Target. (Fired from dd-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:exit"," * @description Fires when this node exits a Drop Target. (Fired from dd-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:drophit"," * @description Fires when this node is dropped on a valid Drop Target. (Fired from dd-ddm-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The best guess on what was dropped on.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," /**"," * @event drag:dropmiss"," * @description Fires when this node is dropped on an invalid Drop Target. (Fired from dd-ddm-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>pageX</dt><dd>The current node position X.</dd>"," * <dt>pageY</dt><dd>The current node position Y.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */",""," Drag = function(o) {"," this._lazyAddAttrs = false;"," Drag.superclass.constructor.apply(this, arguments);",""," var valid = DDM._regDrag(this);"," if (!valid) {"," Y.error('Failed to register node, already in use: ' + o.node);"," }"," };",""," Drag.NAME = 'drag';",""," /**"," * This property defaults to \"mousedown\", but when drag-gestures is loaded, it is changed to \"gesturemovestart\""," * @static"," * @property START_EVENT"," */"," Drag.START_EVENT = 'mousedown';",""," Drag.ATTRS = {"," /**"," * @attribute node"," * @description Y.Node instance to use as the element to initiate a drag operation"," * @type Node"," */"," node: {"," setter: function(node) {"," if (this._canDrag(node)) {"," return node;"," }"," var n = Y.one(node);"," if (!n) {"," Y.error('DD.Drag: Invalid Node Given: ' + node);"," }"," return n;"," }"," },"," /**"," * @attribute dragNode"," * @description Y.Node instance to use as the draggable element, defaults to node"," * @type Node"," */"," dragNode: {"," setter: function(node) {"," if (this._canDrag(node)) {"," return node;"," }"," var n = Y.one(node);"," if (!n) {"," Y.error('DD.Drag: Invalid dragNode Given: ' + node);"," }"," return n;"," }"," },"," /**"," * @attribute offsetNode"," * @description Offset the drag element by the difference in cursor position: default true"," * @type Boolean"," */"," offsetNode: {"," value: true"," },"," /**"," * @attribute startCentered"," * @description Center the dragNode to the mouse position on drag:start: default false"," * @type Boolean"," */"," startCentered: {"," value: false"," },"," /**"," * @attribute clickPixelThresh"," * @description The number of pixels to move to start a drag operation, default is 3."," * @type Number"," */"," clickPixelThresh: {"," value: DDM.get('clickPixelThresh')"," },"," /**"," * @attribute clickTimeThresh"," * @description The number of milliseconds a mousedown has to pass to start a drag operation, default is 1000."," * @type Number"," */"," clickTimeThresh: {"," value: DDM.get('clickTimeThresh')"," },"," /**"," * @attribute lock"," * @description Set to lock this drag element so that it can't be dragged: default false."," * @type Boolean"," */"," lock: {"," value: false,"," setter: function(lock) {"," if (lock) {"," this.get(NODE).addClass(DDM.CSS_PREFIX + '-locked');"," } else {"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-locked');"," }"," return lock;"," }"," },"," /**"," * @attribute data"," * @description A payload holder to store arbitrary data about this drag object, can be used to store any value."," * @type Mixed"," */"," data: {"," value: false"," },"," /**"," * @attribute move"," * @description If this is false, the drag element will not move with the cursor: default true. Can be used to \"resize\" the element."," * @type Boolean"," */"," move: {"," value: true"," },"," /**"," * @attribute useShim"," * @description Use the protective shim on all drag operations: default true. Only works with dd-ddm, not dd-ddm-base."," * @type Boolean"," */"," useShim: {"," value: true"," },"," /**"," * Config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false."," * @attribute activeHandle"," * @type Node"," */"," activeHandle: {"," value: false"," },"," /**"," * By default a drag operation will only begin if the mousedown occurred with the primary mouse button."," * Setting this to false will allow for all mousedown events to trigger a drag."," * @attribute primaryButtonOnly"," * @type Boolean"," */"," primaryButtonOnly: {"," value: true"," },"," /**"," * This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change."," * @attribute dragging"," * @type Boolean"," */"," dragging: {"," value: false"," },"," parent: {"," value: false"," },"," /**"," * @attribute target"," * @description This attribute only works if the dd-drop module has been loaded. It will make this node a drop target as well as draggable."," * @type Boolean"," */"," target: {"," value: false,"," setter: function(config) {"," this._handleTarget(config);"," return config;"," }"," },"," /**"," * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance."," * @attribute dragMode"," * @type String"," */"," dragMode: {"," value: null,"," setter: function(mode) {"," return DDM._setDragMode(mode);"," }"," },"," /**"," * @attribute groups"," * @description Array of groups to add this drag into."," * @type Array"," */"," groups: {"," value: ['default'],"," getter: function() {"," if (!this._groups) {"," this._groups = {};"," }"," var ret = [];"," Y.each(this._groups, function(v, k) {"," ret[ret.length] = k;"," });"," return ret;"," },"," setter: function(g) {"," this._groups = {};"," Y.each(g, function(v) {"," this._groups[v] = true;"," }, this);"," return g;"," }"," },"," /**"," * @attribute handles"," * @description Array of valid handles to add. Adding something here will set all handles, even if previously added with addHandle"," * @type Array"," */"," handles: {"," value: null,"," setter: function(g) {"," if (g) {"," this._handles = {};"," Y.each(g, function(v) {"," var key = v;"," if (v instanceof Y.Node || v instanceof Y.NodeList) {"," key = v._yuid;"," }"," this._handles[key] = v;"," }, this);"," } else {"," this._handles = null;"," }"," return g;"," }"," },"," /**"," * Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config"," * @deprecated"," * @attribute bubbles"," * @type Object"," */"," bubbles: {"," setter: function(t) {"," this.addTarget(t);"," return t;"," }"," },"," /**"," * @attribute haltDown"," * @description Should the mousedown event be halted. Default: true"," * @type Boolean"," */"," haltDown: {"," value: true"," }"," };",""," Y.extend(Drag, Y.Base, {"," /**"," * Checks the object for the methods needed to drag the object around."," * Normally this would be a node instance, but in the case of Graphics, it"," * may be an SVG node or something similar."," * @method _canDrag"," * @private"," * @param {Object} n The object to check"," * @return {Boolean} True or false if the Object contains the methods needed to Drag"," */"," _canDrag: function(n) {"," if (n && n.setXY && n.getXY && n.test && n.contains) {"," return true;"," }"," return false;"," },"," /**"," * @private"," * @property _bubbleTargets"," * @description The default bubbleTarget for this object. Default: Y.DD.DDM"," */"," _bubbleTargets: Y.DD.DDM,"," /**"," * @method addToGroup"," * @description Add this Drag instance to a group, this should be used for on-the-fly group additions."," * @param {String} g The group to add this Drag Instance to."," * @return {Self}"," * @chainable"," */"," addToGroup: function(g) {"," this._groups[g] = true;"," DDM._activateTargets();"," return this;"," },"," /**"," * @method removeFromGroup"," * @description Remove this Drag instance from a group, this should be used for on-the-fly group removals."," * @param {String} g The group to remove this Drag Instance from."," * @return {Self}"," * @chainable"," */"," removeFromGroup: function(g) {"," delete this._groups[g];"," DDM._activateTargets();"," return this;"," },"," /**"," * @property target"," * @description This will be a reference to the Drop instance associated with this drag if the target: true config attribute is set.."," * @type {Object}"," */"," target: null,"," /**"," * @private"," * @method _handleTarget"," * @description Attribute handler for the target config attribute."," * @param {Boolean/Object} config The Config"," */"," _handleTarget: function(config) {"," if (Y.DD.Drop) {"," if (config === false) {"," if (this.target) {"," DDM._unregTarget(this.target);"," this.target = null;"," }"," } else {"," if (!Y.Lang.isObject(config)) {"," config = {};"," }"," config.bubbleTargets = config.bubbleTargets || Y.Object.values(this._yuievt.targets);"," config.node = this.get(NODE);"," config.groups = config.groups || this.get('groups');"," this.target = new Y.DD.Drop(config);"," }"," }"," },"," /**"," * @private"," * @property _groups"," * @description Storage Array for the groups this drag belongs to."," * @type {Array}"," */"," _groups: null,"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {",""," this.publish(EV_MOUSE_DOWN, {"," defaultFn: this._defMouseDownFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });",""," this.publish(EV_ALIGN, {"," defaultFn: this._defAlignFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });",""," this.publish(EV_DRAG, {"," defaultFn: this._defDragFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });",""," this.publish(EV_END, {"," defaultFn: this._defEndFn,"," preventedFn: this._prevEndFn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: 'drag'"," });",""," var ev = ["," EV_AFTER_MOUSE_DOWN,"," EV_REMOVE_HANDLE,"," EV_ADD_HANDLE,"," EV_REMOVE_INVALID,"," EV_ADD_INVALID,"," EV_START,"," 'drag:drophit',"," 'drag:dropmiss',"," 'drag:over',"," 'drag:enter',"," 'drag:exit'"," ];",""," Y.each(ev, function(v) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," bubbles: true,"," preventable: false,"," queuable: false,"," prefix: 'drag'"," });"," }, this);"," },"," /**"," * @private"," * @property _ev_md"," * @description A private reference to the mousedown DOM event"," * @type {EventFacade}"," */"," _ev_md: null,"," /**"," * @private"," * @property _startTime"," * @description The getTime of the mousedown event. Not used, just here in case someone wants/needs to use it."," * @type Date"," */"," _startTime: null,"," /**"," * @private"," * @property _endTime"," * @description The getTime of the mouseup event. Not used, just here in case someone wants/needs to use it."," * @type Date"," */"," _endTime: null,"," /**"," * @private"," * @property _handles"," * @description A private hash of the valid drag handles"," * @type {Object}"," */"," _handles: null,"," /**"," * @private"," * @property _invalids"," * @description A private hash of the invalid selector strings"," * @type {Object}"," */"," _invalids: null,"," /**"," * A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true}"," * @private"," * @property _invalidsDefault"," * @type {Object}"," */"," _invalidsDefault: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true },"," /**"," * @private"," * @property _dragThreshMet"," * @description Private flag to see if the drag threshhold was met"," * @type {Boolean}"," */"," _dragThreshMet: null,"," /**"," * @private"," * @property _fromTimeout"," * @description Flag to determine if the drag operation came from a timeout"," * @type {Boolean}"," */"," _fromTimeout: null,"," /**"," * @private"," * @property _clickTimeout"," * @description Holder for the setTimeout call"," * @type {Boolean}"," */"," _clickTimeout: null,"," /**"," * @property deltaXY"," * @description The offset of the mouse position to the element's position"," * @type {Array}"," */"," deltaXY: null,"," /**"," * @property startXY"," * @description The initial mouse position"," * @type {Array}"," */"," startXY: null,"," /**"," * @property nodeXY"," * @description The initial element position"," * @type {Array}"," */"," nodeXY: null,"," /**"," * @property lastXY"," * @description The position of the element as it's moving (for offset calculations)"," * @type {Array}"," */"," lastXY: null,"," /**"," * @property actXY"," * @description The xy that the node will be set to. Changing this will alter the position as it's dragged."," * @type {Array}"," */"," actXY: null,"," /**"," * @property realXY"," * @description The real xy position of the node."," * @type {Array}"," */"," realXY: null,"," /**"," * @property mouseXY"," * @description The XY coords of the mousemove"," * @type {Array}"," */"," mouseXY: null,"," /**"," * @property region"," * @description A region object associated with this drag, used for checking regions while dragging."," * @type Object"," */"," region: null,"," /**"," * @private"," * @method _handleMouseUp"," * @description Handler for the mouseup DOM event"," * @param {EventFacade} ev The Event"," */"," _handleMouseUp: function() {"," this.fire('drag:mouseup');"," this._fixIEMouseUp();"," if (DDM.activeDrag) {"," DDM._end();"," }"," },"," /**"," * The function we use as the ondragstart handler when we start a drag"," * in Internet Explorer. This keeps IE from blowing up on images as drag handles."," * @private"," * @method _fixDragStart"," * @param {Event} e The Event"," */"," _fixDragStart: function(e) {"," if (this.validClick(e)) {"," e.preventDefault();"," }"," },"," /**"," * @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 _fixIEMouseDown"," * @description This method copies the onselectstart listner on the document to the _ieSelectFix property"," */"," _fixIEMouseDown: function() {"," if (Y.UA.ie) {"," this._ieSelectBack = Y.config.doc.body.onselectstart;"," Y.config.doc.body.onselectstart = this._ieSelectFix;"," }"," },"," /**"," * @private"," * @method _fixIEMouseUp"," * @description This method copies the _ieSelectFix property back to the onselectstart listner on the document."," */"," _fixIEMouseUp: function() {"," if (Y.UA.ie) {"," Y.config.doc.body.onselectstart = this._ieSelectBack;"," }"," },"," /**"," * @private"," * @method _handleMouseDownEvent"," * @description Handler for the mousedown DOM event"," * @param {EventFacade} ev The Event"," */"," _handleMouseDownEvent: function(ev) {"," this.fire(EV_MOUSE_DOWN, { ev: ev });"," },"," /**"," * @private"," * @method _defMouseDownFn"," * @description Handler for the mousedown DOM event"," * @param {EventFacade} e The Event"," */"," _defMouseDownFn: function(e) {"," var ev = e.ev;",""," this._dragThreshMet = false;"," this._ev_md = ev;",""," if (this.get('primaryButtonOnly') && ev.button > 1) {"," return false;"," }"," if (this.validClick(ev)) {"," this._fixIEMouseDown(ev);"," if (Drag.START_EVENT.indexOf('gesture') !== 0) {"," //Only do these if it's not a gesture"," if (this.get('haltDown')) {"," ev.halt();"," } else {"," ev.preventDefault();"," }"," }",""," this._setStartPosition([ev.pageX, ev.pageY]);",""," DDM.activeDrag = this;",""," this._clickTimeout = Y.later(this.get('clickTimeThresh'), this, this._timeoutCheck);"," }"," this.fire(EV_AFTER_MOUSE_DOWN, { ev: ev });"," },"," /**"," * Method first checks to see if we have handles, if so it validates the click"," * against the handle. Then if it finds a valid handle, it checks it against"," * the invalid handles list. Returns true if a good handle was used, false otherwise."," * @method validClick"," * @param {EventFacade} ev The Event"," * @return {Boolean}"," */"," validClick: function(ev) {"," var r = false, n = false,"," tar = ev.target,"," hTest = null,"," els = null,"," nlist = null,"," set = false;"," if (this._handles) {"," Y.each(this._handles, function(i, n) {"," if (i instanceof Y.Node || i instanceof Y.NodeList) {"," if (!r) {"," nlist = i;"," if (nlist instanceof Y.Node) {"," nlist = new Y.NodeList(i._node);"," }"," nlist.each(function(nl) {"," if (nl.contains(tar)) {"," r = true;"," }"," });"," }"," } else if (Y.Lang.isString(n)) {"," //Am I this or am I inside this"," if (tar.test(n + ', ' + n + ' *') && !hTest) {"," hTest = n;"," r = true;"," }"," }"," });"," } else {"," n = this.get(NODE);"," if (n.contains(tar) || n.compareTo(tar)) {"," r = true;"," }"," }"," if (r) {"," if (this._invalids) {"," Y.each(this._invalids, function(i, n) {"," if (Y.Lang.isString(n)) {"," //Am I this or am I inside this"," if (tar.test(n + ', ' + n + ' *')) {"," r = false;"," }"," }"," });"," }"," }"," if (r) {"," if (hTest) {"," els = ev.currentTarget.all(hTest);"," set = false;"," els.each(function(n) {"," if ((n.contains(tar) || n.compareTo(tar)) && !set) {"," set = true;"," this.set('activeHandle', n);"," }"," }, this);"," } else {"," this.set('activeHandle', this.get(NODE));"," }"," }"," return r;"," },"," /**"," * @private"," * @method _setStartPosition"," * @description Sets the current position of the Element and calculates the offset"," * @param {Array} xy The XY coords to set the position to."," */"," _setStartPosition: function(xy) {"," this.startXY = xy;",""," this.nodeXY = this.lastXY = this.realXY = this.get(NODE).getXY();",""," if (this.get('offsetNode')) {"," this.deltaXY = [(this.startXY[0] - this.nodeXY[0]), (this.startXY[1] - this.nodeXY[1])];"," } else {"," this.deltaXY = [0, 0];"," }"," },"," /**"," * @private"," * @method _timeoutCheck"," * @description The method passed to setTimeout to determine if the clickTimeThreshold was met."," */"," _timeoutCheck: function() {"," if (!this.get('lock') && !this._dragThreshMet && this._ev_md) {"," this._fromTimeout = this._dragThreshMet = true;"," this.start();"," this._alignNode([this._ev_md.pageX, this._ev_md.pageY], true);"," }"," },"," /**"," * @method removeHandle"," * @description Remove a Selector added by addHandle"," * @param {String} str The selector for the handle to be removed."," * @return {Self}"," * @chainable"," */"," removeHandle: function(str) {"," var key = str;"," if (str instanceof Y.Node || str instanceof Y.NodeList) {"," key = str._yuid;"," }"," if (this._handles[key]) {"," delete this._handles[key];"," this.fire(EV_REMOVE_HANDLE, { handle: str });"," }"," return this;"," },"," /**"," * @method addHandle"," * @description Add a handle to a drag element. Drag only initiates when a mousedown happens on this element."," * @param {String} str The selector to test for a valid handle. Must be a child of the element."," * @return {Self}"," * @chainable"," */"," addHandle: function(str) {"," if (!this._handles) {"," this._handles = {};"," }"," var key = str;"," if (str instanceof Y.Node || str instanceof Y.NodeList) {"," key = str._yuid;"," }"," this._handles[key] = str;"," this.fire(EV_ADD_HANDLE, { handle: str });"," return this;"," },"," /**"," * @method removeInvalid"," * @description Remove an invalid handle added by addInvalid"," * @param {String} str The invalid handle to remove from the internal list."," * @return {Self}"," * @chainable"," */"," removeInvalid: function(str) {"," if (this._invalids[str]) {"," this._invalids[str] = null;"," delete this._invalids[str];"," this.fire(EV_REMOVE_INVALID, { handle: str });"," }"," return this;"," },"," /**"," * @method addInvalid"," * @description Add a selector string to test the handle against. If the test passes the drag operation will not continue."," * @param {String} str The selector to test against to determine if this is an invalid drag handle."," * @return {Self}"," * @chainable"," */"," addInvalid: function(str) {"," if (Y.Lang.isString(str)) {"," this._invalids[str] = true;"," this.fire(EV_ADD_INVALID, { handle: str });"," }"," return this;"," },"," /**"," * @private"," * @method initializer"," * @description Internal init handler"," */"," initializer: function() {",""," this.get(NODE).dd = this;",""," if (!this.get(NODE).get('id')) {"," var id = Y.stamp(this.get(NODE));"," this.get(NODE).set('id', id);"," }",""," this.actXY = [];",""," this._invalids = Y.clone(this._invalidsDefault, true);",""," this._createEvents();",""," if (!this.get(DRAG_NODE)) {"," this.set(DRAG_NODE, this.get(NODE));"," }",""," //Fix for #2528096"," //Don't prep the DD instance until all plugins are loaded."," this.on('initializedChange', Y.bind(this._prep, this));",""," //Shouldn't have to do this.."," this.set('groups', this.get('groups'));"," },"," /**"," * @private"," * @method _prep"," * @description Attach event listners and add classname"," */"," _prep: function() {"," this._dragThreshMet = false;"," var node = this.get(NODE);"," node.addClass(DDM.CSS_PREFIX + '-draggable');"," node.on(Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this));"," node.on('mouseup', Y.bind(this._handleMouseUp, this));"," node.on('dragstart', Y.bind(this._fixDragStart, this));"," },"," /**"," * @private"," * @method _unprep"," * @description Detach event listeners and remove classname"," */"," _unprep: function() {"," var node = this.get(NODE);"," node.removeClass(DDM.CSS_PREFIX + '-draggable');"," node.detachAll('mouseup');"," node.detachAll('dragstart');"," node.detachAll(Drag.START_EVENT);"," this.mouseXY = [];"," this.deltaXY = [0,0];"," this.startXY = [];"," this.nodeXY = [];"," this.lastXY = [];"," this.actXY = [];"," this.realXY = [];"," },"," /**"," * @method start"," * @description Starts the drag operation"," * @return {Self}"," * @chainable"," */"," start: function() {"," if (!this.get('lock') && !this.get(DRAGGING)) {"," var node = this.get(NODE), ow, oh, xy;"," this._startTime = (new Date()).getTime();",""," DDM._start();"," node.addClass(DDM.CSS_PREFIX + '-dragging');"," this.fire(EV_START, {"," pageX: this.nodeXY[0],"," pageY: this.nodeXY[1],"," startTime: this._startTime"," });"," node = this.get(DRAG_NODE);"," xy = this.nodeXY;",""," ow = node.get(OFFSET_WIDTH);"," oh = node.get(OFFSET_HEIGHT);",""," if (this.get('startCentered')) {"," this._setStartPosition([xy[0] + (ow / 2), xy[1] + (oh / 2)]);"," }","",""," this.region = {"," '0': xy[0],"," '1': xy[1],"," area: 0,"," top: xy[1],"," right: xy[0] + ow,"," bottom: xy[1] + oh,"," left: xy[0]"," };"," this.set(DRAGGING, true);"," }"," return this;"," },"," /**"," * @method end"," * @description Ends the drag operation"," * @return {Self}"," * @chainable"," */"," end: function() {"," this._endTime = (new Date()).getTime();"," if (this._clickTimeout) {"," this._clickTimeout.cancel();"," }"," this._dragThreshMet = this._fromTimeout = false;",""," if (!this.get('lock') && this.get(DRAGGING)) {"," this.fire(EV_END, {"," pageX: this.lastXY[0],"," pageY: this.lastXY[1],"," startTime: this._startTime,"," endTime: this._endTime"," });"," }"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-dragging');"," this.set(DRAGGING, false);"," this.deltaXY = [0, 0];",""," return this;"," },"," /**"," * @private"," * @method _defEndFn"," * @description Handler for fixing the selection in IE"," */"," _defEndFn: function() {"," this._fixIEMouseUp();"," this._ev_md = null;"," },"," /**"," * @private"," * @method _prevEndFn"," * @description Handler for preventing the drag:end event. It will reset the node back to it's start position"," */"," _prevEndFn: function() {"," this._fixIEMouseUp();"," //Bug #1852577"," this.get(DRAG_NODE).setXY(this.nodeXY);"," this._ev_md = null;"," this.region = null;"," },"," /**"," * @private"," * @method _align"," * @description Calculates the offsets and set's the XY that the element will move to."," * @param {Array} xy The xy coords to align with."," */"," _align: function(xy) {"," this.fire(EV_ALIGN, {pageX: xy[0], pageY: xy[1] });"," },"," /**"," * @private"," * @method _defAlignFn"," * @description Calculates the offsets and set's the XY that the element will move to."," * @param {EventFacade} e The drag:align event."," */"," _defAlignFn: function(e) {"," this.actXY = [e.pageX - this.deltaXY[0], e.pageY - this.deltaXY[1]];"," },"," /**"," * @private"," * @method _alignNode"," * @description This method performs the alignment before the element move."," * @param {Array} eXY The XY to move the element to, usually comes from the mousemove DOM event."," */"," _alignNode: function(eXY, scroll) {"," this._align(eXY);"," if (!scroll) {"," this._moveNode();"," }"," },"," /**"," * @private"," * @method _moveNode"," * @description This method performs the actual element move."," */"," _moveNode: function(scroll) {"," //if (!this.get(DRAGGING)) {"," // return;"," //}"," var diffXY = [], diffXY2 = [], startXY = this.nodeXY, xy = this.actXY;",""," diffXY[0] = (xy[0] - this.lastXY[0]);"," diffXY[1] = (xy[1] - this.lastXY[1]);",""," diffXY2[0] = (xy[0] - this.nodeXY[0]);"," diffXY2[1] = (xy[1] - this.nodeXY[1]);","",""," this.region = {"," '0': xy[0],"," '1': xy[1],"," area: 0,"," top: xy[1],"," right: xy[0] + this.get(DRAG_NODE).get(OFFSET_WIDTH),"," bottom: xy[1] + this.get(DRAG_NODE).get(OFFSET_HEIGHT),"," left: xy[0]"," };",""," this.fire(EV_DRAG, {"," pageX: xy[0],"," pageY: xy[1],"," scroll: scroll,"," info: {"," start: startXY,"," xy: xy,"," delta: diffXY,"," offset: diffXY2"," }"," });",""," this.lastXY = xy;"," },"," /**"," * @private"," * @method _defDragFn"," * @description Default function for drag:drag. Fired from _moveNode."," * @param {EventFacade} ev The drag:drag event"," */"," _defDragFn: function(e) {"," if (this.get('move')) {"," if (e.scroll && e.scroll.node) {"," e.scroll.node.set('scrollTop', e.scroll.top);"," e.scroll.node.set('scrollLeft', e.scroll.left);"," }"," this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);"," this.realXY = [e.pageX, e.pageY];"," }"," },"," /**"," * @private"," * @method _move"," * @description Fired from DragDropMgr (DDM) on mousemove."," * @param {EventFacade} ev The mousemove DOM event"," */"," _move: function(ev) {"," if (this.get('lock')) {"," return false;"," }",""," this.mouseXY = [ev.pageX, ev.pageY];"," if (!this._dragThreshMet) {"," var diffX = Math.abs(this.startXY[0] - ev.pageX),"," diffY = Math.abs(this.startXY[1] - ev.pageY);"," if (diffX > this.get('clickPixelThresh') || diffY > this.get('clickPixelThresh')) {"," this._dragThreshMet = true;"," this.start();"," //This only happens on gestures to stop the page from scrolling"," if (ev && ev.preventDefault) {"," ev.preventDefault();"," }"," this._alignNode([ev.pageX, ev.pageY]);"," }"," } else {"," if (this._clickTimeout) {"," this._clickTimeout.cancel();"," }"," this._alignNode([ev.pageX, ev.pageY]);"," }"," },"," /**"," * @method stopDrag"," * @description Method will forcefully stop a drag operation. For example calling this from inside an ESC keypress handler will stop this drag."," * @return {Self}"," * @chainable"," */"," stopDrag: function() {"," if (this.get(DRAGGING)) {"," DDM._end();"," }"," return this;"," },"," /**"," * @private"," * @method destructor"," * @description Lifecycle destructor, unreg the drag from the DDM and remove listeners"," */"," destructor: function() {"," this._unprep();"," if (this.target) {"," this.target.destroy();"," }"," DDM._unregDrag(this);"," }"," });"," Y.namespace('DD');"," Y.DD.Drag = Drag;","","","","","}, '3.7.3', {\"requires\": [\"dd-ddm-base\"]});"];+_yuitest_coverage["build/dd-drag/dd-drag.js"].lines = {"1":0,"17":0,"195":0,"196":0,"198":0,"199":0,"200":0,"204":0,"211":0,"213":0,"221":0,"222":0,"224":0,"225":0,"226":0,"228":0,"238":0,"239":0,"241":0,"242":0,"243":0,"245":0,"288":0,"289":0,"291":0,"293":0,"356":0,"357":0,"368":0,"379":0,"380":0,"382":0,"383":0,"384":0,"386":0,"389":0,"390":0,"391":0,"393":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"411":0,"414":0,"416":0,"427":0,"428":0,"441":0,"452":0,"453":0,"455":0,"471":0,"472":0,"473":0,"483":0,"484":0,"485":0,"500":0,"501":0,"502":0,"503":0,"504":0,"507":0,"508":0,"510":0,"511":0,"512":0,"513":0,"531":0,"539":0,"547":0,"555":0,"564":0,"578":0,"579":0,"707":0,"708":0,"709":0,"710":0,"721":0,"722":0,"731":0,"745":0,"746":0,"747":0,"756":0,"757":0,"767":0,"776":0,"778":0,"779":0,"781":0,"782":0,"784":0,"785":0,"786":0,"788":0,"789":0,"791":0,"795":0,"797":0,"799":0,"801":0,"812":0,"818":0,"819":0,"820":0,"821":0,"822":0,"823":0,"824":0,"826":0,"827":0,"828":0,"832":0,"834":0,"835":0,"836":0,"841":0,"842":0,"843":0,"846":0,"847":0,"848":0,"849":0,"851":0,"852":0,"858":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"865":0,"869":0,"872":0,"881":0,"883":0,"885":0,"886":0,"888":0,"897":0,"898":0,"899":0,"900":0,"911":0,"912":0,"913":0,"915":0,"916":0,"917":0,"919":0,"929":0,"930":0,"932":0,"933":0,"934":0,"936":0,"937":0,"938":0,"948":0,"949":0,"950":0,"951":0,"953":0,"963":0,"964":0,"965":0,"967":0,"976":0,"978":0,"979":0,"980":0,"983":0,"985":0,"987":0,"989":0,"990":0,"995":0,"998":0,"1006":0,"1007":0,"1008":0,"1009":0,"1010":0,"1011":0,"1019":0,"1020":0,"1021":0,"1022":0,"1023":0,"1024":0,"1025":0,"1026":0,"1027":0,"1028":0,"1029":0,"1030":0,"1039":0,"1040":0,"1041":0,"1043":0,"1044":0,"1045":0,"1050":0,"1051":0,"1053":0,"1054":0,"1056":0,"1057":0,"1061":0,"1070":0,"1072":0,"1081":0,"1082":0,"1083":0,"1085":0,"1087":0,"1088":0,"1095":0,"1096":0,"1097":0,"1099":0,"1107":0,"1108":0,"1116":0,"1118":0,"1119":0,"1120":0,"1129":0,"1138":0,"1147":0,"1148":0,"1149":0,"1161":0,"1163":0,"1164":0,"1166":0,"1167":0,"1170":0,"1180":0,"1192":0,"1201":0,"1202":0,"1203":0,"1204":0,"1206":0,"1207":0,"1217":0,"1218":0,"1221":0,"1222":0,"1223":0,"1225":0,"1226":0,"1227":0,"1229":0,"1230":0,"1232":0,"1235":0,"1236":0,"1238":0,"1248":0,"1249":0,"1251":0,"1259":0,"1260":0,"1261":0,"1263":0,"1266":0,"1267":0};+_yuitest_coverage["build/dd-drag/dd-drag.js"].functions = {"Drag:194":0,"setter:220":0,"setter:237":0,"setter:287":0,"setter:355":0,"setter:367":0,"(anonymous 2):383":0,"getter:378":0,"(anonymous 3):390":0,"setter:388":0,"(anonymous 4):406":0,"setter:403":0,"setter:426":0,"_canDrag:451":0,"addToGroup:470":0,"removeFromGroup:482":0,"_handleTarget:499":0,"(anonymous 5):578":0,"_createEvents:529":0,"_handleMouseUp:706":0,"_fixDragStart:720":0,"_ieSelectFix:730":0,"_fixIEMouseDown:744":0,"_fixIEMouseUp:755":0,"_handleMouseDownEvent:766":0,"_defMouseDownFn:775":0,"(anonymous 7):826":0,"(anonymous 6):819":0,"(anonymous 8):848":0,"(anonymous 9):862":0,"validClick:811":0,"_setStartPosition:880":0,"_timeoutCheck:896":0,"removeHandle:910":0,"addHandle:928":0,"removeInvalid:947":0,"addInvalid:962":0,"initializer:974":0,"_prep:1005":0,"_unprep:1018":0,"start:1038":0,"end:1080":0,"_defEndFn:1106":0,"_prevEndFn:1115":0,"_align:1128":0,"_defAlignFn:1137":0,"_alignNode:1146":0,"_moveNode:1157":0,"_defDragFn:1200":0,"_move:1216":0,"stopDrag:1247":0,"destructor:1258":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-drag/dd-drag.js"].coveredLines = 275; _yuitest_coverage["build/dd-drag/dd-drag.js"].coveredFunctions = 53; _yuitest_coverline("build/dd-drag/dd-drag.js", 1); YUI.add('dd-drag', function (Y, NAME) {@@ -45,7 +45,7 @@ * Provides the ability to drag a Node. * @module dd * @submodule dd-drag- */ + */ /** * Provides the ability to drag a Node. * @class Drag@@ -61,7 +61,7 @@ DRAGGING = 'dragging', DRAG_NODE = 'dragNode', OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth', + OFFSET_WIDTH = 'offsetWidth', /** * @event drag:mouseup * @description Handles the mouseup DOM event, does nothing internally just fires.@@ -232,7 +232,7 @@ * @bubbles DDM * @type {CustomEvent} */- + Drag = function(o) { _yuitest_coverfunc("build/dd-drag/dd-drag.js", "Drag", 194); _yuitest_coverline("build/dd-drag/dd-drag.js", 195);@@ -251,7 +251,7 @@ _yuitest_coverline("build/dd-drag/dd-drag.js", 204); Drag.NAME = 'drag';- + /** * This property defaults to "mousedown", but when drag-gestures is loaded, it is changed to "gesturemovestart" * @static@@ -388,24 +388,25 @@ value: true }, /**+ * Config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false. * @attribute activeHandle- * @description This config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false. * @type Node */ activeHandle: { value: false }, /**+ * By default a drag operation will only begin if the mousedown occurred with the primary mouse button.+ * Setting this to false will allow for all mousedown events to trigger a drag. * @attribute primaryButtonOnly- * @description By default a drag operation will only begin if the mousedown occurred with the primary mouse button. Setting this to false will allow for all mousedown events to trigger a drag. * @type Boolean */ primaryButtonOnly: { value: true }, /**+ * This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change. * @attribute dragging- * @description This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change. * @type Boolean */ dragging: {@@ -422,23 +423,23 @@ target: { value: false, setter: function(config) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 354);-_yuitest_coverline("build/dd-drag/dd-drag.js", 355);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 355);+_yuitest_coverline("build/dd-drag/dd-drag.js", 356); this._handleTarget(config);- _yuitest_coverline("build/dd-drag/dd-drag.js", 356);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 357); return config; } }, /**+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance. * @attribute dragMode- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance. * @type String */ dragMode: { value: null, setter: function(mode) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 366);-_yuitest_coverline("build/dd-drag/dd-drag.js", 367);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 367);+_yuitest_coverline("build/dd-drag/dd-drag.js", 368); return DDM._setDragMode(mode); } },@@ -450,34 +451,34 @@ groups: { value: ['default'], getter: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "getter", 377);-_yuitest_coverline("build/dd-drag/dd-drag.js", 378);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "getter", 378);+_yuitest_coverline("build/dd-drag/dd-drag.js", 379); if (!this._groups) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 379);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 380); this._groups = {}; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 381);-var ret = []; _yuitest_coverline("build/dd-drag/dd-drag.js", 382);+var ret = [];+ _yuitest_coverline("build/dd-drag/dd-drag.js", 383); Y.each(this._groups, function(v, k) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 2)", 382);-_yuitest_coverline("build/dd-drag/dd-drag.js", 383);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 2)", 383);+_yuitest_coverline("build/dd-drag/dd-drag.js", 384); ret[ret.length] = k; });- _yuitest_coverline("build/dd-drag/dd-drag.js", 385);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 386); return ret; }, setter: function(g) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 387);-_yuitest_coverline("build/dd-drag/dd-drag.js", 388);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 388);+_yuitest_coverline("build/dd-drag/dd-drag.js", 389); this._groups = {};- _yuitest_coverline("build/dd-drag/dd-drag.js", 389);-Y.each(g, function(v, k) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 3)", 389);-_yuitest_coverline("build/dd-drag/dd-drag.js", 390);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 390);+Y.each(g, function(v) {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 3)", 390);+_yuitest_coverline("build/dd-drag/dd-drag.js", 391); this._groups[v] = true; }, this);- _yuitest_coverline("build/dd-drag/dd-drag.js", 392);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 393); return g; } },@@ -489,44 +490,44 @@ handles: { value: null, setter: function(g) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 402);-_yuitest_coverline("build/dd-drag/dd-drag.js", 403);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 403);+_yuitest_coverline("build/dd-drag/dd-drag.js", 404); if (g) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 404);-this._handles = {}; _yuitest_coverline("build/dd-drag/dd-drag.js", 405);-Y.each(g, function(v, k) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 4)", 405);-_yuitest_coverline("build/dd-drag/dd-drag.js", 406);+this._handles = {};+ _yuitest_coverline("build/dd-drag/dd-drag.js", 406);+Y.each(g, function(v) {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 4)", 406);+_yuitest_coverline("build/dd-drag/dd-drag.js", 407); var key = v;- _yuitest_coverline("build/dd-drag/dd-drag.js", 407);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 408); if (v instanceof Y.Node || v instanceof Y.NodeList) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 408);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 409); key = v._yuid; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 410);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 411); this._handles[key] = v; }, this); } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 413);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 414); this._handles = null; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 415);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 416); return g; } }, /**+ * Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config * @deprecated * @attribute bubbles- * @description Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config * @type Object */ bubbles: { setter: function(t) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 425);-_yuitest_coverline("build/dd-drag/dd-drag.js", 426);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "setter", 426);+_yuitest_coverline("build/dd-drag/dd-drag.js", 427); this.addTarget(t);- _yuitest_coverline("build/dd-drag/dd-drag.js", 427);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 428); return t; } },@@ -540,10 +541,10 @@ } }; - _yuitest_coverline("build/dd-drag/dd-drag.js", 440);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 441); Y.extend(Drag, Y.Base, { /**- * Checks the object for the methods needed to drag the object around. + * Checks the object for the methods needed to drag the object around. * Normally this would be a node instance, but in the case of Graphics, it * may be an SVG node or something similar. * @method _canDrag@@ -552,13 +553,13 @@ * @return {Boolean} True or false if the Object contains the methods needed to Drag */ _canDrag: function(n) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_canDrag", 450);-_yuitest_coverline("build/dd-drag/dd-drag.js", 451);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_canDrag", 451);+_yuitest_coverline("build/dd-drag/dd-drag.js", 452); if (n && n.setXY && n.getXY && n.test && n.contains) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 452);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 453); return true; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 454);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 455); return false; }, /**@@ -575,12 +576,12 @@ * @chainable */ addToGroup: function(g) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "addToGroup", 469);-_yuitest_coverline("build/dd-drag/dd-drag.js", 470);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "addToGroup", 470);+_yuitest_coverline("build/dd-drag/dd-drag.js", 471); this._groups[g] = true;- _yuitest_coverline("build/dd-drag/dd-drag.js", 471);-DDM._activateTargets(); _yuitest_coverline("build/dd-drag/dd-drag.js", 472);+DDM._activateTargets();+ _yuitest_coverline("build/dd-drag/dd-drag.js", 473); return this; }, /**@@ -591,12 +592,12 @@ * @chainable */ removeFromGroup: function(g) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "removeFromGroup", 481);-_yuitest_coverline("build/dd-drag/dd-drag.js", 482);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "removeFromGroup", 482);+_yuitest_coverline("build/dd-drag/dd-drag.js", 483); delete this._groups[g];- _yuitest_coverline("build/dd-drag/dd-drag.js", 483);-DDM._activateTargets(); _yuitest_coverline("build/dd-drag/dd-drag.js", 484);+DDM._activateTargets();+ _yuitest_coverline("build/dd-drag/dd-drag.js", 485); return this; }, /**@@ -612,31 +613,31 @@ * @param {Boolean/Object} config The Config */ _handleTarget: function(config) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_handleTarget", 498);-_yuitest_coverline("build/dd-drag/dd-drag.js", 499);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_handleTarget", 499);+_yuitest_coverline("build/dd-drag/dd-drag.js", 500); if (Y.DD.Drop) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 500);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 501); if (config === false) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 501);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 502); if (this.target) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 502);-DDM._unregTarget(this.target); _yuitest_coverline("build/dd-drag/dd-drag.js", 503);+DDM._unregTarget(this.target);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 504); this.target = null; } } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 506);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 507); if (!Y.Lang.isObject(config)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 507);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 508); config = {}; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 509);-config.bubbleTargets = config.bubbleTargets || Y.Object.values(this._yuievt.targets); _yuitest_coverline("build/dd-drag/dd-drag.js", 510);-config.node = this.get(NODE);+config.bubbleTargets = config.bubbleTargets || Y.Object.values(this._yuievt.targets); _yuitest_coverline("build/dd-drag/dd-drag.js", 511);-config.groups = config.groups || this.get('groups');+config.node = this.get(NODE); _yuitest_coverline("build/dd-drag/dd-drag.js", 512);+config.groups = config.groups || this.get('groups');+ _yuitest_coverline("build/dd-drag/dd-drag.js", 513); this.target = new Y.DD.Drop(config); } }@@ -654,9 +655,9 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- - _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_createEvents", 528);-_yuitest_coverline("build/dd-drag/dd-drag.js", 530);++ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_createEvents", 529);+_yuitest_coverline("build/dd-drag/dd-drag.js", 531); this.publish(EV_MOUSE_DOWN, { defaultFn: this._defMouseDownFn, queuable: false,@@ -664,8 +665,8 @@ bubbles: true, prefix: 'drag' });- - _yuitest_coverline("build/dd-drag/dd-drag.js", 538);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 539); this.publish(EV_ALIGN, { defaultFn: this._defAlignFn, queuable: false,@@ -673,8 +674,8 @@ bubbles: true, prefix: 'drag' });- - _yuitest_coverline("build/dd-drag/dd-drag.js", 546);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 547); this.publish(EV_DRAG, { defaultFn: this._defDragFn, queuable: false,@@ -682,8 +683,8 @@ bubbles: true, prefix: 'drag' });- - _yuitest_coverline("build/dd-drag/dd-drag.js", 554);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 555); this.publish(EV_END, { defaultFn: this._defEndFn, preventedFn: this._prevEndFn,@@ -692,8 +693,8 @@ bubbles: true, prefix: 'drag' });- - _yuitest_coverline("build/dd-drag/dd-drag.js", 563);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 564); var ev = [ EV_AFTER_MOUSE_DOWN, EV_REMOVE_HANDLE,@@ -707,11 +708,11 @@ 'drag:enter', 'drag:exit' ];- - _yuitest_coverline("build/dd-drag/dd-drag.js", 577);-Y.each(ev, function(v, k) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 5)", 577);-_yuitest_coverline("build/dd-drag/dd-drag.js", 578);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 578);+Y.each(ev, function(v) {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 5)", 578);+_yuitest_coverline("build/dd-drag/dd-drag.js", 579); this.publish(v, { type: v, emitFacade: true,@@ -758,9 +759,9 @@ */ _invalids: null, /**+ * A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true} * @private * @property _invalidsDefault- * @description A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true} * @type {Object} */ _invalidsDefault: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true },@@ -832,50 +833,51 @@ * @description A region object associated with this drag, used for checking regions while dragging. * @type Object */- region: null, + region: null, /** * @private * @method _handleMouseUp * @description Handler for the mouseup DOM event * @param {EventFacade} ev The Event */- _handleMouseUp: function(ev) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_handleMouseUp", 705);-_yuitest_coverline("build/dd-drag/dd-drag.js", 706);+ _handleMouseUp: function() {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_handleMouseUp", 706);+_yuitest_coverline("build/dd-drag/dd-drag.js", 707); this.fire('drag:mouseup');- _yuitest_coverline("build/dd-drag/dd-drag.js", 707);-this._fixIEMouseUp(); _yuitest_coverline("build/dd-drag/dd-drag.js", 708);+this._fixIEMouseUp();+ _yuitest_coverline("build/dd-drag/dd-drag.js", 709); if (DDM.activeDrag) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 709);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 710); DDM._end(); } },- /** + /**+ * The function we use as the ondragstart handler when we start a drag+ * in Internet Explorer. This keeps IE from blowing up on images as drag handles. * @private * @method _fixDragStart- * @description The function we use as the ondragstart handler when we start a drag in Internet Explorer. This keeps IE from blowing up on images as drag handles. * @param {Event} e The Event */ _fixDragStart: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_fixDragStart", 718);-_yuitest_coverline("build/dd-drag/dd-drag.js", 719);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_fixDragStart", 720);+_yuitest_coverline("build/dd-drag/dd-drag.js", 721); if (this.validClick(e)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 720);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 722); e.preventDefault(); } },- /** + /** * @private * @method _ieSelectFix * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer */ _ieSelectFix: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_ieSelectFix", 728);-_yuitest_coverline("build/dd-drag/dd-drag.js", 729);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_ieSelectFix", 730);+_yuitest_coverline("build/dd-drag/dd-drag.js", 731); 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.@@ -886,15 +888,15 @@ * @method _fixIEMouseDown * @description This method copies the onselectstart listner on the document to the _ieSelectFix property */- _fixIEMouseDown: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_fixIEMouseDown", 742);-_yuitest_coverline("build/dd-drag/dd-drag.js", 743);+ _fixIEMouseDown: function() {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_fixIEMouseDown", 744);+_yuitest_coverline("build/dd-drag/dd-drag.js", 745); if (Y.UA.ie) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 744);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 746); this._ieSelectBack = Y.config.doc.body.onselectstart;- _yuitest_coverline("build/dd-drag/dd-drag.js", 745);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 747); Y.config.doc.body.onselectstart = this._ieSelectFix;- } + } }, /** * @private@@ -902,12 +904,12 @@ * @description This method copies the _ieSelectFix property back to the onselectstart listner on the document. */ _fixIEMouseUp: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_fixIEMouseUp", 753);-_yuitest_coverline("build/dd-drag/dd-drag.js", 754);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_fixIEMouseUp", 755);+_yuitest_coverline("build/dd-drag/dd-drag.js", 756); if (Y.UA.ie) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 755);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 757); Y.config.doc.body.onselectstart = this._ieSelectBack;- } + } }, /** * @private@@ -916,8 +918,8 @@ * @param {EventFacade} ev The Event */ _handleMouseDownEvent: function(ev) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_handleMouseDownEvent", 764);-_yuitest_coverline("build/dd-drag/dd-drag.js", 765);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_handleMouseDownEvent", 766);+_yuitest_coverline("build/dd-drag/dd-drag.js", 767); this.fire(EV_MOUSE_DOWN, { ev: ev }); }, /**@@ -927,151 +929,157 @@ * @param {EventFacade} e The Event */ _defMouseDownFn: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defMouseDownFn", 773);-_yuitest_coverline("build/dd-drag/dd-drag.js", 774);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defMouseDownFn", 775);+_yuitest_coverline("build/dd-drag/dd-drag.js", 776); var ev = e.ev; - _yuitest_coverline("build/dd-drag/dd-drag.js", 776);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 778); this._dragThreshMet = false;- _yuitest_coverline("build/dd-drag/dd-drag.js", 777);-this._ev_md = ev;- _yuitest_coverline("build/dd-drag/dd-drag.js", 779);+this._ev_md = ev;++ _yuitest_coverline("build/dd-drag/dd-drag.js", 781); if (this.get('primaryButtonOnly') && ev.button > 1) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 780);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 782); return false; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 782);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 784); if (this.validClick(ev)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 783);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 785); this._fixIEMouseDown(ev);- _yuitest_coverline("build/dd-drag/dd-drag.js", 784);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 786);+if (Drag.START_EVENT.indexOf('gesture') !== 0) {+ //Only do these if it's not a gesture+ _yuitest_coverline("build/dd-drag/dd-drag.js", 788); if (this.get('haltDown')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 785);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 789); ev.halt();- } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 787);+ } else {+ _yuitest_coverline("build/dd-drag/dd-drag.js", 791); ev.preventDefault();+ } }- - _yuitest_coverline("build/dd-drag/dd-drag.js", 790);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 795); this._setStartPosition([ev.pageX, ev.pageY]); - _yuitest_coverline("build/dd-drag/dd-drag.js", 792);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 797); DDM.activeDrag = this;- - _yuitest_coverline("build/dd-drag/dd-drag.js", 794);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 799); this._clickTimeout = Y.later(this.get('clickTimeThresh'), this, this._timeoutCheck); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 796);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 801); this.fire(EV_AFTER_MOUSE_DOWN, { ev: ev }); }, /**+ * Method first checks to see if we have handles, if so it validates the click+ * against the handle. Then if it finds a valid handle, it checks it against+ * the invalid handles list. Returns true if a good handle was used, false otherwise. * @method validClick- * @description Method first checks to see if we have handles, if so it validates the click against the handle. Then if it finds a valid handle, it checks it against the invalid handles list. Returns true if a good handle was used, false otherwise. * @param {EventFacade} ev The Event * @return {Boolean} */ validClick: function(ev) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "validClick", 804);-_yuitest_coverline("build/dd-drag/dd-drag.js", 805);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "validClick", 811);+_yuitest_coverline("build/dd-drag/dd-drag.js", 812); var r = false, n = false, tar = ev.target, hTest = null, els = null, nlist = null, set = false;- _yuitest_coverline("build/dd-drag/dd-drag.js", 811);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 818); if (this._handles) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 812);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 819); Y.each(this._handles, function(i, n) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 6)", 812);-_yuitest_coverline("build/dd-drag/dd-drag.js", 813);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 6)", 819);+_yuitest_coverline("build/dd-drag/dd-drag.js", 820); if (i instanceof Y.Node || i instanceof Y.NodeList) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 814);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 821); if (!r) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 815);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 822); nlist = i;- _yuitest_coverline("build/dd-drag/dd-drag.js", 816);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 823); if (nlist instanceof Y.Node) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 817);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 824); nlist = new Y.NodeList(i._node); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 819);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 826); nlist.each(function(nl) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 7)", 819);-_yuitest_coverline("build/dd-drag/dd-drag.js", 820);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 7)", 826);+_yuitest_coverline("build/dd-drag/dd-drag.js", 827); if (nl.contains(tar)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 821);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 828); r = true; } }); }- } else {_yuitest_coverline("build/dd-drag/dd-drag.js", 825);+ } else {_yuitest_coverline("build/dd-drag/dd-drag.js", 832); if (Y.Lang.isString(n)) { //Am I this or am I inside this- _yuitest_coverline("build/dd-drag/dd-drag.js", 827);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 834); if (tar.test(n + ', ' + n + ' *') && !hTest) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 828);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 835); hTest = n;- _yuitest_coverline("build/dd-drag/dd-drag.js", 829);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 836); r = true; } }} }); } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 834);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 841); n = this.get(NODE);- _yuitest_coverline("build/dd-drag/dd-drag.js", 835);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 842); if (n.contains(tar) || n.compareTo(tar)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 836);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 843); r = true; } }- _yuitest_coverline("build/dd-drag/dd-drag.js", 839);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 846); if (r) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 840);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 847); if (this._invalids) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 841);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 848); Y.each(this._invalids, function(i, n) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 8)", 841);-_yuitest_coverline("build/dd-drag/dd-drag.js", 842);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 8)", 848);+_yuitest_coverline("build/dd-drag/dd-drag.js", 849); if (Y.Lang.isString(n)) { //Am I this or am I inside this- _yuitest_coverline("build/dd-drag/dd-drag.js", 844);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 851); if (tar.test(n + ', ' + n + ' *')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 845);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 852); r = false; } } }); } }- _yuitest_coverline("build/dd-drag/dd-drag.js", 851);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 858); if (r) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 852);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 859); if (hTest) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 853);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 860); els = ev.currentTarget.all(hTest);- _yuitest_coverline("build/dd-drag/dd-drag.js", 854);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 861); set = false;- _yuitest_coverline("build/dd-drag/dd-drag.js", 855);-els.each(function(n, i) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 9)", 855);-_yuitest_coverline("build/dd-drag/dd-drag.js", 856);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 862);+els.each(function(n) {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "(anonymous 9)", 862);+_yuitest_coverline("build/dd-drag/dd-drag.js", 863); if ((n.contains(tar) || n.compareTo(tar)) && !set) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 857);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 864); set = true;- _yuitest_coverline("build/dd-drag/dd-drag.js", 858);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 865); this.set('activeHandle', n); } }, this); } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 862);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 869); this.set('activeHandle', this.get(NODE)); } }- _yuitest_coverline("build/dd-drag/dd-drag.js", 865);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 872); return r; }, /**@@ -1081,19 +1089,19 @@ * @param {Array} xy The XY coords to set the position to. */ _setStartPosition: function(xy) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_setStartPosition", 873);-_yuitest_coverline("build/dd-drag/dd-drag.js", 874);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_setStartPosition", 880);+_yuitest_coverline("build/dd-drag/dd-drag.js", 881); this.startXY = xy;- - _yuitest_coverline("build/dd-drag/dd-drag.js", 876);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 883); this.nodeXY = this.lastXY = this.realXY = this.get(NODE).getXY();- - _yuitest_coverline("build/dd-drag/dd-drag.js", 878);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 885); if (this.get('offsetNode')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 879);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 886); this.deltaXY = [(this.startXY[0] - this.nodeXY[0]), (this.startXY[1] - this.nodeXY[1])]; } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 881);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 888); this.deltaXY = [0, 0]; } },@@ -1103,41 +1111,41 @@ * @description The method passed to setTimeout to determine if the clickTimeThreshold was met. */ _timeoutCheck: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_timeoutCheck", 889);-_yuitest_coverline("build/dd-drag/dd-drag.js", 890);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_timeoutCheck", 896);+_yuitest_coverline("build/dd-drag/dd-drag.js", 897); if (!this.get('lock') && !this._dragThreshMet && this._ev_md) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 891);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 898); this._fromTimeout = this._dragThreshMet = true;- _yuitest_coverline("build/dd-drag/dd-drag.js", 892);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 899); this.start();- _yuitest_coverline("build/dd-drag/dd-drag.js", 893);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 900); this._alignNode([this._ev_md.pageX, this._ev_md.pageY], true); } }, /** * @method removeHandle * @description Remove a Selector added by addHandle- * @param {String} str The selector for the handle to be removed. + * @param {String} str The selector for the handle to be removed. * @return {Self} * @chainable */ removeHandle: function(str) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "removeHandle", 903);-_yuitest_coverline("build/dd-drag/dd-drag.js", 904);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "removeHandle", 910);+_yuitest_coverline("build/dd-drag/dd-drag.js", 911); var key = str;- _yuitest_coverline("build/dd-drag/dd-drag.js", 905);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 912); if (str instanceof Y.Node || str instanceof Y.NodeList) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 906);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 913); key = str._yuid; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 908);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 915); if (this._handles[key]) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 909);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 916); delete this._handles[key];- _yuitest_coverline("build/dd-drag/dd-drag.js", 910);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 917); this.fire(EV_REMOVE_HANDLE, { handle: str }); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 912);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 919); return this; }, /**@@ -1148,24 +1156,24 @@ * @chainable */ addHandle: function(str) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "addHandle", 921);-_yuitest_coverline("build/dd-drag/dd-drag.js", 922);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "addHandle", 928);+_yuitest_coverline("build/dd-drag/dd-drag.js", 929); if (!this._handles) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 923);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 930); this._handles = {}; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 925);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 932); var key = str;- _yuitest_coverline("build/dd-drag/dd-drag.js", 926);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 933); if (str instanceof Y.Node || str instanceof Y.NodeList) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 927);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 934); key = str._yuid; }- _yuitest_coverline("build/dd-drag/dd-drag.js", 929);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 936); this._handles[key] = str;- _yuitest_coverline("build/dd-drag/dd-drag.js", 930);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 937); this.fire(EV_ADD_HANDLE, { handle: str });- _yuitest_coverline("build/dd-drag/dd-drag.js", 931);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 938); return this; }, /**@@ -1176,17 +1184,17 @@ * @chainable */ removeInvalid: function(str) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "removeInvalid", 940);-_yuitest_coverline("build/dd-drag/dd-drag.js", 941);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "removeInvalid", 947);+_yuitest_coverline("build/dd-drag/dd-drag.js", 948); if (this._invalids[str]) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 942);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 949); this._invalids[str] = null;- _yuitest_coverline("build/dd-drag/dd-drag.js", 943);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 950); delete this._invalids[str];- _yuitest_coverline("build/dd-drag/dd-drag.js", 944);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 951); this.fire(EV_REMOVE_INVALID, { handle: str }); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 946);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 953); return this; }, /**@@ -1197,15 +1205,15 @@ * @chainable */ addInvalid: function(str) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "addInvalid", 955);-_yuitest_coverline("build/dd-drag/dd-drag.js", 956);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "addInvalid", 962);+_yuitest_coverline("build/dd-drag/dd-drag.js", 963); if (Y.Lang.isString(str)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 957);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 964); this._invalids[str] = true;- _yuitest_coverline("build/dd-drag/dd-drag.js", 958);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 965); this.fire(EV_ADD_INVALID, { handle: str }); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 960);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 967); return this; }, /**@@ -1213,42 +1221,42 @@ * @method initializer * @description Internal init handler */- initializer: function(cfg) {+ initializer: function() { - _yuitest_coverfunc("build/dd-drag/dd-drag.js", "initializer", 967);-_yuitest_coverline("build/dd-drag/dd-drag.js", 969);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "initializer", 974);+_yuitest_coverline("build/dd-drag/dd-drag.js", 976); this.get(NODE).dd = this; - _yuitest_coverline("build/dd-drag/dd-drag.js", 971);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 978); if (!this.get(NODE).get('id')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 972);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 979); var id = Y.stamp(this.get(NODE));- _yuitest_coverline("build/dd-drag/dd-drag.js", 973);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 980); this.get(NODE).set('id', id); } - _yuitest_coverline("build/dd-drag/dd-drag.js", 976);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 983); this.actXY = [];- - _yuitest_coverline("build/dd-drag/dd-drag.js", 978);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 985); this._invalids = Y.clone(this._invalidsDefault, true); - _yuitest_coverline("build/dd-drag/dd-drag.js", 980);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 987); this._createEvents();- - _yuitest_coverline("build/dd-drag/dd-drag.js", 982);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 989); if (!this.get(DRAG_NODE)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 983);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 990); this.set(DRAG_NODE, this.get(NODE)); } //Fix for #2528096 //Don't prep the DD instance until all plugins are loaded.- _yuitest_coverline("build/dd-drag/dd-drag.js", 988);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 995); this.on('initializedChange', Y.bind(this._prep, this)); //Shouldn't have to do this..- _yuitest_coverline("build/dd-drag/dd-drag.js", 991);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 998); this.set('groups', this.get('groups')); }, /**@@ -1257,18 +1265,18 @@ * @description Attach event listners and add classname */ _prep: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_prep", 998);-_yuitest_coverline("build/dd-drag/dd-drag.js", 999);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_prep", 1005);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1006); this._dragThreshMet = false;- _yuitest_coverline("build/dd-drag/dd-drag.js", 1000);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1007); var node = this.get(NODE);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1001);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1008); node.addClass(DDM.CSS_PREFIX + '-draggable');- _yuitest_coverline("build/dd-drag/dd-drag.js", 1002);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1009); node.on(Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this));- _yuitest_coverline("build/dd-drag/dd-drag.js", 1003);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1010); node.on('mouseup', Y.bind(this._handleMouseUp, this));- _yuitest_coverline("build/dd-drag/dd-drag.js", 1004);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1011); node.on('dragstart', Y.bind(this._fixDragStart, this)); }, /**@@ -1277,30 +1285,30 @@ * @description Detach event listeners and remove classname */ _unprep: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_unprep", 1011);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1012);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_unprep", 1018);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1019); var node = this.get(NODE);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1013);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1020); node.removeClass(DDM.CSS_PREFIX + '-draggable');- _yuitest_coverline("build/dd-drag/dd-drag.js", 1014);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1021); node.detachAll('mouseup');- _yuitest_coverline("build/dd-drag/dd-drag.js", 1015);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1022); node.detachAll('dragstart');- _yuitest_coverline("build/dd-drag/dd-drag.js", 1016);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1023); node.detachAll(Drag.START_EVENT);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1017);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1024); this.mouseXY = [];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1018);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1025); this.deltaXY = [0,0];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1019);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1026); this.startXY = [];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1020);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1027); this.nodeXY = [];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1021);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1028); this.lastXY = [];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1022);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1029); this.actXY = [];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1023);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1030); this.realXY = []; }, /**@@ -1310,44 +1318,44 @@ * @chainable */ start: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "start", 1031);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1032);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "start", 1038);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1039); if (!this.get('lock') && !this.get(DRAGGING)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1033);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1040); var node = this.get(NODE), ow, oh, xy;- _yuitest_coverline("build/dd-drag/dd-drag.js", 1034);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1041); this._startTime = (new Date()).getTime(); - _yuitest_coverline("build/dd-drag/dd-drag.js", 1036);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1043); DDM._start();- _yuitest_coverline("build/dd-drag/dd-drag.js", 1037);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1044); node.addClass(DDM.CSS_PREFIX + '-dragging');- _yuitest_coverline("build/dd-drag/dd-drag.js", 1038);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1045); this.fire(EV_START, { pageX: this.nodeXY[0], pageY: this.nodeXY[1], startTime: this._startTime });- _yuitest_coverline("build/dd-drag/dd-drag.js", 1043);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1050); node = this.get(DRAG_NODE);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1044);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1051); xy = this.nodeXY;- - _yuitest_coverline("build/dd-drag/dd-drag.js", 1046);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 1053); ow = node.get(OFFSET_WIDTH);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1047);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1054); oh = node.get(OFFSET_HEIGHT);- - _yuitest_coverline("build/dd-drag/dd-drag.js", 1049);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 1056); if (this.get('startCentered')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1050);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1057); this._setStartPosition([xy[0] + (ow / 2), xy[1] + (oh / 2)]); }- - - _yuitest_coverline("build/dd-drag/dd-drag.js", 1054);+++ _yuitest_coverline("build/dd-drag/dd-drag.js", 1061); this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -1355,10 +1363,10 @@ bottom: xy[1] + oh, left: xy[0] };- _yuitest_coverline("build/dd-drag/dd-drag.js", 1063);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1070); this.set(DRAGGING, true); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1065);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1072); return this; }, /**@@ -1368,20 +1376,20 @@ * @chainable */ end: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "end", 1073);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1074);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "end", 1080);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1081); this._endTime = (new Date()).getTime();- _yuitest_coverline("build/dd-drag/dd-drag.js", 1075);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1082); if (this._clickTimeout) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1076);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1083); this._clickTimeout.cancel(); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1078);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1085); this._dragThreshMet = this._fromTimeout = false; - _yuitest_coverline("build/dd-drag/dd-drag.js", 1080);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1087); if (!this.get('lock') && this.get(DRAGGING)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1081);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1088); this.fire(EV_END, { pageX: this.lastXY[0], pageY: this.lastXY[1],@@ -1389,14 +1397,14 @@ endTime: this._endTime }); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1088);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1095); this.get(NODE).removeClass(DDM.CSS_PREFIX + '-dragging');- _yuitest_coverline("build/dd-drag/dd-drag.js", 1089);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1096); this.set(DRAGGING, false);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1090);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1097); this.deltaXY = [0, 0]; - _yuitest_coverline("build/dd-drag/dd-drag.js", 1092);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1099); return this; }, /**@@ -1404,11 +1412,11 @@ * @method _defEndFn * @description Handler for fixing the selection in IE */- _defEndFn: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defEndFn", 1099);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1100);+ _defEndFn: function() {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defEndFn", 1106);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1107); this._fixIEMouseUp();- _yuitest_coverline("build/dd-drag/dd-drag.js", 1101);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1108); this._ev_md = null; }, /**@@ -1416,16 +1424,16 @@ * @method _prevEndFn * @description Handler for preventing the drag:end event. It will reset the node back to it's start position */- _prevEndFn: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_prevEndFn", 1108);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1109);+ _prevEndFn: function() {+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_prevEndFn", 1115);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1116); this._fixIEMouseUp(); //Bug #1852577- _yuitest_coverline("build/dd-drag/dd-drag.js", 1111);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1118); this.get(DRAG_NODE).setXY(this.nodeXY);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1112);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1119); this._ev_md = null;- _yuitest_coverline("build/dd-drag/dd-drag.js", 1113);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1120); this.region = null; }, /**@@ -1435,8 +1443,8 @@ * @param {Array} xy The xy coords to align with. */ _align: function(xy) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_align", 1121);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1122);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_align", 1128);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1129); this.fire(EV_ALIGN, {pageX: xy[0], pageY: xy[1] }); }, /**@@ -1446,8 +1454,8 @@ * @param {EventFacade} e The drag:align event. */ _defAlignFn: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defAlignFn", 1130);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1131);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defAlignFn", 1137);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1138); this.actXY = [e.pageX - this.deltaXY[0], e.pageY - this.deltaXY[1]]; }, /**@@ -1457,12 +1465,12 @@ * @param {Array} eXY The XY to move the element to, usually comes from the mousemove DOM event. */ _alignNode: function(eXY, scroll) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_alignNode", 1139);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1140);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_alignNode", 1146);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1147); this._align(eXY);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1141);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1148); if (!scroll) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1142);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1149); this._moveNode(); } },@@ -1475,24 +1483,24 @@ //if (!this.get(DRAGGING)) { // return; //}- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_moveNode", 1150);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1154);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_moveNode", 1157);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1161); var diffXY = [], diffXY2 = [], startXY = this.nodeXY, xy = this.actXY; - _yuitest_coverline("build/dd-drag/dd-drag.js", 1156);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1163); diffXY[0] = (xy[0] - this.lastXY[0]);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1157);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1164); diffXY[1] = (xy[1] - this.lastXY[1]); - _yuitest_coverline("build/dd-drag/dd-drag.js", 1159);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1166); diffXY2[0] = (xy[0] - this.nodeXY[0]);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1160);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1167); diffXY2[1] = (xy[1] - this.nodeXY[1]); - _yuitest_coverline("build/dd-drag/dd-drag.js", 1163);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1170); this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -1501,7 +1509,7 @@ left: xy[0] }; - _yuitest_coverline("build/dd-drag/dd-drag.js", 1173);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1180); this.fire(EV_DRAG, { pageX: xy[0], pageY: xy[1],@@ -1511,10 +1519,10 @@ xy: xy, delta: diffXY, offset: diffXY2- } + } });- - _yuitest_coverline("build/dd-drag/dd-drag.js", 1185);++ _yuitest_coverline("build/dd-drag/dd-drag.js", 1192); this.lastXY = xy; }, /**@@ -1524,19 +1532,19 @@ * @param {EventFacade} ev The drag:drag event */ _defDragFn: function(e) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defDragFn", 1193);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1194);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_defDragFn", 1200);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1201); if (this.get('move')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1195);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1202); if (e.scroll && e.scroll.node) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1196);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1203); e.scroll.node.set('scrollTop', e.scroll.top);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1197);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1204); e.scroll.node.set('scrollLeft', e.scroll.left); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1199);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1206); this.get(DRAG_NODE).setXY([e.pageX, e.pageY]);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1200);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1207); this.realXY = [e.pageX, e.pageY]; } },@@ -1547,36 +1555,42 @@ * @param {EventFacade} ev The mousemove DOM event */ _move: function(ev) {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_move", 1209);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1210);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "_move", 1216);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1217); if (this.get('lock')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1211);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1218); return false; } - _yuitest_coverline("build/dd-drag/dd-drag.js", 1214);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1221); this.mouseXY = [ev.pageX, ev.pageY];- _yuitest_coverline("build/dd-drag/dd-drag.js", 1215);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1222); if (!this._dragThreshMet) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1216);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1223); var diffX = Math.abs(this.startXY[0] - ev.pageX), diffY = Math.abs(this.startXY[1] - ev.pageY);- _yuitest_coverline("build/dd-drag/dd-drag.js", 1218);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1225); if (diffX > this.get('clickPixelThresh') || diffY > this.get('clickPixelThresh')) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1219);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1226); this._dragThreshMet = true;- _yuitest_coverline("build/dd-drag/dd-drag.js", 1220);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1227); this.start();- _yuitest_coverline("build/dd-drag/dd-drag.js", 1221);+ //This only happens on gestures to stop the page from scrolling+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1229);+if (ev && ev.preventDefault) {+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1230);+ev.preventDefault();+ }+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1232); this._alignNode([ev.pageX, ev.pageY]); } } else {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1224);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1235); if (this._clickTimeout) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1225);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1236); this._clickTimeout.cancel(); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1227);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1238); this._alignNode([ev.pageX, ev.pageY]); } },@@ -1587,13 +1601,13 @@ * @chainable */ stopDrag: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "stopDrag", 1236);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1237);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "stopDrag", 1247);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1248); if (this.get(DRAGGING)) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1238);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1249); DDM._end(); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1240);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1251); return this; }, /**@@ -1602,24 +1616,24 @@ * @description Lifecycle destructor, unreg the drag from the DDM and remove listeners */ destructor: function() {- _yuitest_coverfunc("build/dd-drag/dd-drag.js", "destructor", 1247);-_yuitest_coverline("build/dd-drag/dd-drag.js", 1248);+ _yuitest_coverfunc("build/dd-drag/dd-drag.js", "destructor", 1258);+_yuitest_coverline("build/dd-drag/dd-drag.js", 1259); this._unprep();- _yuitest_coverline("build/dd-drag/dd-drag.js", 1249);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1260); if (this.target) {- _yuitest_coverline("build/dd-drag/dd-drag.js", 1250);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1261); this.target.destroy(); }- _yuitest_coverline("build/dd-drag/dd-drag.js", 1252);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1263); DDM._unregDrag(this); } });- _yuitest_coverline("build/dd-drag/dd-drag.js", 1255);-Y.namespace('DD'); - _yuitest_coverline("build/dd-drag/dd-drag.js", 1256);+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1266);+Y.namespace('DD');+ _yuitest_coverline("build/dd-drag/dd-drag.js", 1267); Y.DD.Drag = Drag; -}, '3.7.2', {"requires": ["dd-ddm-base"]});+}, '3.7.3', {"requires": ["dd-ddm-base"]});
bundle/dd-drag/dd-drag-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the ability to drag a Node. * @module dd * @submodule dd-drag- */ + */ /** * Provides the ability to drag a Node. * @class Drag@@ -25,7 +25,7 @@ DRAGGING = 'dragging', DRAG_NODE = 'dragNode', OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth', + OFFSET_WIDTH = 'offsetWidth', /** * @event drag:mouseup * @description Handles the mouseup DOM event, does nothing internally just fires.@@ -196,7 +196,7 @@ * @bubbles DDM * @type {CustomEvent} */- + Drag = function(o) { this._lazyAddAttrs = false; Drag.superclass.constructor.apply(this, arguments);@@ -208,7 +208,7 @@ }; Drag.NAME = 'drag';- + /** * This property defaults to "mousedown", but when drag-gestures is loaded, it is changed to "gesturemovestart" * @static@@ -324,24 +324,25 @@ value: true }, /**+ * Config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false. * @attribute activeHandle- * @description This config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false. * @type Node */ activeHandle: { value: false }, /**+ * By default a drag operation will only begin if the mousedown occurred with the primary mouse button.+ * Setting this to false will allow for all mousedown events to trigger a drag. * @attribute primaryButtonOnly- * @description By default a drag operation will only begin if the mousedown occurred with the primary mouse button. Setting this to false will allow for all mousedown events to trigger a drag. * @type Boolean */ primaryButtonOnly: { value: true }, /**+ * This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change. * @attribute dragging- * @description This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change. * @type Boolean */ dragging: {@@ -363,8 +364,8 @@ } }, /**+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance. * @attribute dragMode- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance. * @type String */ dragMode: {@@ -392,7 +393,7 @@ }, setter: function(g) { this._groups = {};- Y.each(g, function(v, k) {+ Y.each(g, function(v) { this._groups[v] = true; }, this); return g;@@ -408,7 +409,7 @@ setter: function(g) { if (g) { this._handles = {};- Y.each(g, function(v, k) {+ Y.each(g, function(v) { var key = v; if (v instanceof Y.Node || v instanceof Y.NodeList) { key = v._yuid;@@ -422,9 +423,9 @@ } }, /**+ * Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config * @deprecated * @attribute bubbles- * @description Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config * @type Object */ bubbles: {@@ -446,7 +447,7 @@ Y.extend(Drag, Y.Base, { /**- * Checks the object for the methods needed to drag the object around. + * Checks the object for the methods needed to drag the object around. * Normally this would be a node instance, but in the case of Graphics, it * may be an SVG node or something similar. * @method _canDrag@@ -533,7 +534,7 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- + this.publish(EV_MOUSE_DOWN, { defaultFn: this._defMouseDownFn, queuable: false,@@ -541,7 +542,7 @@ bubbles: true, prefix: 'drag' });- + this.publish(EV_ALIGN, { defaultFn: this._defAlignFn, queuable: false,@@ -549,7 +550,7 @@ bubbles: true, prefix: 'drag' });- + this.publish(EV_DRAG, { defaultFn: this._defDragFn, queuable: false,@@ -557,7 +558,7 @@ bubbles: true, prefix: 'drag' });- + this.publish(EV_END, { defaultFn: this._defEndFn, preventedFn: this._prevEndFn,@@ -566,7 +567,7 @@ bubbles: true, prefix: 'drag' });- + var ev = [ EV_AFTER_MOUSE_DOWN, EV_REMOVE_HANDLE,@@ -580,8 +581,8 @@ 'drag:enter', 'drag:exit' ];- - Y.each(ev, function(v, k) {++ Y.each(ev, function(v) { this.publish(v, { type: v, emitFacade: true,@@ -628,9 +629,9 @@ */ _invalids: null, /**+ * A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true} * @private * @property _invalidsDefault- * @description A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true} * @type {Object} */ _invalidsDefault: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true },@@ -702,24 +703,25 @@ * @description A region object associated with this drag, used for checking regions while dragging. * @type Object */- region: null, + region: null, /** * @private * @method _handleMouseUp * @description Handler for the mouseup DOM event * @param {EventFacade} ev The Event */- _handleMouseUp: function(ev) {+ _handleMouseUp: function() { this.fire('drag:mouseup'); this._fixIEMouseUp(); if (DDM.activeDrag) { DDM._end(); } },- /** + /**+ * The function we use as the ondragstart handler when we start a drag+ * in Internet Explorer. This keeps IE from blowing up on images as drag handles. * @private * @method _fixDragStart- * @description The function we use as the ondragstart handler when we start a drag in Internet Explorer. This keeps IE from blowing up on images as drag handles. * @param {Event} e The Event */ _fixDragStart: function(e) {@@ -727,7 +729,7 @@ e.preventDefault(); } },- /** + /** * @private * @method _ieSelectFix * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer@@ -735,7 +737,7 @@ _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.@@ -746,11 +748,11 @@ * @method _fixIEMouseDown * @description This method copies the onselectstart listner on the document to the _ieSelectFix property */- _fixIEMouseDown: function(e) {+ _fixIEMouseDown: function() { if (Y.UA.ie) { this._ieSelectBack = Y.config.doc.body.onselectstart; Y.config.doc.body.onselectstart = this._ieSelectFix;- } + } }, /** * @private@@ -760,7 +762,7 @@ _fixIEMouseUp: function() { if (Y.UA.ie) { Y.config.doc.body.onselectstart = this._ieSelectBack;- } + } }, /** * @private@@ -782,31 +784,36 @@ this._dragThreshMet = false; this._ev_md = ev;- + if (this.get('primaryButtonOnly') && ev.button > 1) { return false; } if (this.validClick(ev)) { this._fixIEMouseDown(ev);- if (this.get('haltDown')) {- Y.log('Halting MouseDown', 'info', 'drag');- ev.halt();- } else {- Y.log('Preventing Default on MouseDown', 'info', 'drag');- ev.preventDefault();+ if (Drag.START_EVENT.indexOf('gesture') !== 0) {+ //Only do these if it's not a gesture+ if (this.get('haltDown')) {+ Y.log('Halting MouseDown', 'info', 'drag');+ ev.halt();+ } else {+ Y.log('Preventing Default on MouseDown', 'info', 'drag');+ ev.preventDefault();+ } }- + this._setStartPosition([ev.pageX, ev.pageY]); DDM.activeDrag = this;- + this._clickTimeout = Y.later(this.get('clickTimeThresh'), this, this._timeoutCheck); } this.fire(EV_AFTER_MOUSE_DOWN, { ev: ev }); }, /**+ * Method first checks to see if we have handles, if so it validates the click+ * against the handle. Then if it finds a valid handle, it checks it against+ * the invalid handles list. Returns true if a good handle was used, false otherwise. * @method validClick- * @description Method first checks to see if we have handles, if so it validates the click against the handle. Then if it finds a valid handle, it checks it against the invalid handles list. Returns true if a good handle was used, false otherwise. * @param {EventFacade} ev The Event * @return {Boolean} */@@ -861,7 +868,7 @@ if (hTest) { els = ev.currentTarget.all(hTest); set = false;- els.each(function(n, i) {+ els.each(function(n) { if ((n.contains(tar) || n.compareTo(tar)) && !set) { set = true; this.set('activeHandle', n);@@ -881,9 +888,9 @@ */ _setStartPosition: function(xy) { this.startXY = xy;- + this.nodeXY = this.lastXY = this.realXY = this.get(NODE).getXY();- + if (this.get('offsetNode')) { this.deltaXY = [(this.startXY[0] - this.nodeXY[0]), (this.startXY[1] - this.nodeXY[1])]; } else {@@ -905,7 +912,7 @@ /** * @method removeHandle * @description Remove a Selector added by addHandle- * @param {String} str The selector for the handle to be removed. + * @param {String} str The selector for the handle to be removed. * @return {Self} * @chainable */@@ -973,7 +980,7 @@ * @method initializer * @description Internal init handler */- initializer: function(cfg) {+ initializer: function() { this.get(NODE).dd = this; @@ -983,11 +990,11 @@ } this.actXY = [];- + this._invalids = Y.clone(this._invalidsDefault, true); this._createEvents();- + if (!this.get(DRAG_NODE)) { this.set(DRAG_NODE, this.get(NODE)); }@@ -1051,17 +1058,17 @@ }); node = this.get(DRAG_NODE); xy = this.nodeXY;- + ow = node.get(OFFSET_WIDTH); oh = node.get(OFFSET_HEIGHT);- + if (this.get('startCentered')) { this._setStartPosition([xy[0] + (ow / 2), xy[1] + (oh / 2)]); }- - ++ this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -1105,7 +1112,7 @@ * @method _defEndFn * @description Handler for fixing the selection in IE */- _defEndFn: function(e) {+ _defEndFn: function() { this._fixIEMouseUp(); this._ev_md = null; },@@ -1114,7 +1121,7 @@ * @method _prevEndFn * @description Handler for preventing the drag:end event. It will reset the node back to it's start position */- _prevEndFn: function(e) {+ _prevEndFn: function() { this._fixIEMouseUp(); //Bug #1852577 this.get(DRAG_NODE).setXY(this.nodeXY);@@ -1170,7 +1177,7 @@ this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -1188,9 +1195,9 @@ xy: xy, delta: diffXY, offset: diffXY2- } + } });- + this.lastXY = xy; }, /**@@ -1227,6 +1234,10 @@ if (diffX > this.get('clickPixelThresh') || diffY > this.get('clickPixelThresh')) { this._dragThreshMet = true; this.start();+ //This only happens on gestures to stop the page from scrolling+ if (ev && ev.preventDefault) {+ ev.preventDefault();+ } this._alignNode([ev.pageX, ev.pageY]); } } else {@@ -1261,10 +1272,10 @@ DDM._unregDrag(this); } });- Y.namespace('DD'); + Y.namespace('DD'); Y.DD.Drag = Drag; -}, '3.7.2', {"requires": ["dd-ddm-base"]});+}, '3.7.3', {"requires": ["dd-ddm-base"]});
bundle/dd-drag/dd-drag-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-drag",function(e,t){var n=e.DD.DDM,r="node",i="dragging",s="dragNode",o="offsetHeight",u="offsetWidth",a="drag:mouseDown",f="drag:afterMouseDown",l="drag:removeHandle",c="drag:addHandle",h="drag:removeInvalid",p="drag:addInvalid",d="drag:start",v="drag:end",m="drag:drag",g="drag:align",y=function(t){this._lazyAddAttrs=!1,y.superclass.constructor.apply(this,arguments);var r=n._regDrag(this);r||e.error("Failed to register node, already in use: "+t.node)};y.NAME="drag",y.START_EVENT="mousedown",y.ATTRS={node:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid Node Given: "+t),n}},dragNode:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid dragNode Given: "+t),n}},offsetNode:{value:!0},startCentered:{value:!1},clickPixelThresh:{value:n.get("clickPixelThresh")},clickTimeThresh:{value:n.get("clickTimeThresh")},lock:{value:!1,setter:function(e){return e?this.get(r).addClass(n.CSS_PREFIX+"-locked"):this.get(r).removeClass(n.CSS_PREFIX+"-locked"),e}},data:{value:!1},move:{value:!0},useShim:{value:!0},activeHandle:{value:!1},primaryButtonOnly:{value:!0},dragging:{value:!1},parent:{value:!1},target:{value:!1,setter:function(e){return this._handleTarget(e),e}},dragMode:{value:null,setter:function(e){return n._setDragMode(e)}},groups:{value:["default"],getter:function(){this._groups||(this._groups={});var t=[];return e.each(this._groups,function(e,n){t[t.length]=n}),t},setter:function(t){return this._groups={},e.each(t,function(e,t){this._groups[e]=!0},this),t}},handles:{value:null,setter:function(t){return t?(this._handles={},e.each(t,function(t,n){var r=t;if(t instanceof e.Node||t instanceof e.NodeList)r=t._yuid;this._handles[r]=t},this)):this._handles=null,t}},bubbles:{setter:function(e){return this.addTarget(e),e}},haltDown:{value:!0}},e.extend(y,e.Base,{_canDrag:function(e){return e&&e.setXY&&e.getXY&&e.test&&e.contains?!0:!1},_bubbleTargets:e.DD.DDM,addToGroup:function(e){return this._groups[e]=!0,n._activateTargets(),this},removeFromGroup:function(e){return delete this._groups[e],n._activateTargets(),this},target:null,_handleTarget:function(t){e.DD.Drop&&(t===!1?this.target&&(n._unregTarget(this.target),this.target=null):(e.Lang.isObject(t)||(t={}),t.bubbleTargets=t.bubbleTargets||e.Object.values(this._yuievt.targets),t.node=this.get(r),t.groups=t.groups||this.get("groups"),this.target=new e.DD.Drop(t)))},_groups:null,_createEvents:function(){this.publish(a,{defaultFn:this._defMouseDownFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(g,{defaultFn:this._defAlignFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(m,{defaultFn:this._defDragFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(v,{defaultFn:this._defEndFn,preventedFn:this._prevEndFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});var t=[f,l,c,h,p,d,"drag:drophit","drag:dropmiss","drag:over","drag:enter","drag:exit"];e.each(t,function(e,t){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,preventable:!1,queuable:!1,prefix:"drag"})},this)},_ev_md:null,_startTime:null,_endTime:null,_handles:null,_invalids:null,_invalidsDefault:{textarea:!0,input:!0,a:!0,button:!0,select:!0},_dragThreshMet:null,_fromTimeout:null,_clickTimeout:null,deltaXY:null,startXY:null,nodeXY:null,lastXY:null,actXY:null,realXY:null,mouseXY:null,region:null,_handleMouseUp:function(e){this.fire("drag:mouseup"),this._fixIEMouseUp(),n.activeDrag&&n._end()},_fixDragStart:function(e){this.validClick(e)&&e.preventDefault()},_ieSelectFix:function(){return!1},_ieSelectBack:null,_fixIEMouseDown:function(t){e.UA.ie&&(this._ieSelectBack=e.config.doc.body.onselectstart,e.config.doc.body.onselectstart=this._ieSelectFix)},_fixIEMouseUp:function(){e.UA.ie&&(e.config.doc.body.onselectstart=this._ieSelectBack)},_handleMouseDownEvent:function(e){this.fire(a,{ev:e})},_defMouseDownFn:function(t){var r=t.ev;this._dragThreshMet=!1,this._ev_md=r;if(this.get("primaryButtonOnly")&&r.button>1)return!1;this.validClick(r)&&(this._fixIEMouseDown(r),this.get("haltDown")?r.halt():r.preventDefault(),this._setStartPosition([r.pageX,r.pageY]),n.activeDrag=this,this._clickTimeout=e.later(this.get("clickTimeThresh"),this,this._timeoutCheck)),this.fire(f,{ev:r})},validClick:function(t){var n=!1,i=!1,s=t.target,o=null,u=null,a=null,f=!1;if(this._handles)e.each(this._handles,function(t,r){t instanceof e.Node||t instanceof e.NodeList?n||(a=t,a instanceof e.Node&&(a=new e.NodeList(t._node)),a.each(function(e){e.contains(s)&&(n=!0)})):e.Lang.isString(r)&&s.test(r+", "+r+" *")&&!o&&(o=r,n=!0)});else{i=this.get(r);if(i.contains(s)||i.compareTo(s))n=!0}return n&&this._invalids&&e.each(this._invalids,function(t,r){e.Lang.isString(r)&&s.test(r+", "+r+" *")&&(n=!1)}),n&&(o?(u=t.currentTarget.all(o),f=!1,u.each(function(e,t){(e.contains(s)||e.compareTo(s))&&!f&&(f=!0,this.set("activeHandle",e))},this)):this.set("activeHandle",this.get(r))),n},_setStartPosition:function(e){this.startXY=e,this.nodeXY=this.lastXY=this.realXY=this.get(r).getXY(),this.get("offsetNode")?this.deltaXY=[this.startXY[0]-this.nodeXY[0],this.startXY[1]-this.nodeXY[1]]:this.deltaXY=[0,0]},_timeoutCheck:function(){!this.get("lock")&&!this._dragThreshMet&&this._ev_md&&(this._fromTimeout=this._dragThreshMet=!0,this.start(),this._alignNode([this._ev_md.pageX,this._ev_md.pageY],!0))},removeHandle:function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]&&(delete this._handles[n],this.fire(l,{handle:t})),this},addHandle:function(t){this._handles||(this._handles={});var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]=t,this.fire(c,{handle:t}),this},removeInvalid:function(e){return this._invalids[e]&&(this._invalids[e]=null,delete this._invalids[e],this.fire(h,{handle:e})),this},addInvalid:function(t){return e.Lang.isString(t)&&(this._invalids[t]=!0,this.fire(p,{handle:t})),this},initializer:function(t){this.get(r).dd=this;if(!this.get(r).get("id")){var n=e.stamp(this.get(r));this.get(r).set("id",n)}this.actXY=[],this._invalids=e.clone(this._invalidsDefault,!0),this._createEvents(),this.get(s)||this.set(s,this.get(r)),this.on("initializedChange",e.bind(this._prep,this)),this.set("groups",this.get("groups"))},_prep:function(){this._dragThreshMet=!1;var t=this.get(r);t.addClass(n.CSS_PREFIX+"-draggable"),t.on(y.START_EVENT,e.bind(this._handleMouseDownEvent,this)),t.on("mouseup",e.bind(this._handleMouseUp,this)),t.on("dragstart",e.bind(this._fixDragStart,this))},_unprep:function(){var e=this.get(r);e.removeClass(n.CSS_PREFIX+"-draggable"),e.detachAll("mouseup"),e.detachAll("dragstart"),e.detachAll(y.START_EVENT),this.mouseXY=[],this.deltaXY=[0,0],this.startXY=[],this.nodeXY=[],this.lastXY=[],this.actXY=[],this.realXY=[]},start:function(){if(!this.get("lock")&&!this.get(i)){var e=this.get(r),t,a,f;this._startTime=(new Date).getTime(),n._start(),e.addClass(n.CSS_PREFIX+"-dragging"),this.fire(d,{pageX:this.nodeXY[0],pageY:this.nodeXY[1],startTime:this._startTime}),e=this.get(s),f=this.nodeXY,t=e.get(u),a=e.get(o),this.get("startCentered")&&this._setStartPosition([f[0]+t/2,f[1]+a/2]),this.region={0:f[0],1:f[1],area:0,top:f[1],right:f[0]+t,bottom:f[1]+a,left:f[0]},this.set(i,!0)}return this},end:function(){return this._endTime=(new Date).getTime(),this._clickTimeout&&this._clickTimeout.cancel(),this._dragThreshMet=this._fromTimeout=!1,!this.get("lock")&&this.get(i)&&this.fire(v,{pageX:this.lastXY[0],pageY:this.lastXY[1],startTime:this._startTime,endTime:this._endTime}),this.get(r).removeClass(n.CSS_PREFIX+"-dragging"),this.set(i,!1),this.deltaXY=[0,0],this},_defEndFn:function(e){this._fixIEMouseUp(),this._ev_md=null},_prevEndFn:function(e){this._fixIEMouseUp(),this.get(s).setXY(this.nodeXY),this._ev_md=null,this.region=null},_align:function(e){this.fire(g,{pageX:e[0],pageY:e[1]})},_defAlignFn:function(e){this.actXY=[e.pageX-this.deltaXY[0],e.pageY-this.deltaXY[1]]},_alignNode:function(e,t){this._align(e),t||this._moveNode()},_moveNode:function(e){var t=[],n=[],r=this.nodeXY,i=this.actXY;t[0]=i[0]-this.lastXY[0],t[1]=i[1]-this.lastXY[1],n[0]=i[0]-this.nodeXY[0],n[1]=i[1]-this.nodeXY[1],this.region={0:i[0],1:i[1],area:0,top:i[1],right:i[0]+this.get(s).get(u),bottom:i[1]+this.get(s).get(o),left:i[0]},this.fire(m,{pageX:i[0],pageY:i[1],scroll:e,info:{start:r,xy:i,delta:t,offset:n}}),this.lastXY=i},_defDragFn:function(e){this.get("move")&&(e.scroll&&e.scroll.node&&(e.scroll.node.set("scrollTop",e.scroll.top),e.scroll.node.set("scrollLeft",e.scroll.left)),this.get(s).setXY([e.pageX,e.pageY]),this.realXY=[e.pageX,e.pageY])},_move:function(e){if(this.get("lock"))return!1;this.mouseXY=[e.pageX,e.pageY];if(!this._dragThreshMet){var t=Math.abs(this.startXY[0]-e.pageX),n=Math.abs(this.startXY[1]-e.pageY);if(t>this.get("clickPixelThresh")||n>this.get("clickPixelThresh"))this._dragThreshMet=!0,this.start(),this._alignNode([e.pageX,e.pageY])}else this._clickTimeout&&this._clickTimeout.cancel(),this._alignNode([e.pageX,e.pageY])},stopDrag:function(){return this.get(i)&&n._end(),this},destructor:function(){this._unprep(),this.target&&this.target.destroy(),n._unregDrag(this)}}),e.namespace("DD"),e.DD.Drag=y},"3.7.2",{requires:["dd-ddm-base"]});+YUI.add("dd-drag",function(e,t){var n=e.DD.DDM,r="node",i="dragging",s="dragNode",o="offsetHeight",u="offsetWidth",a="drag:mouseDown",f="drag:afterMouseDown",l="drag:removeHandle",c="drag:addHandle",h="drag:removeInvalid",p="drag:addInvalid",d="drag:start",v="drag:end",m="drag:drag",g="drag:align",y=function(t){this._lazyAddAttrs=!1,y.superclass.constructor.apply(this,arguments);var r=n._regDrag(this);r||e.error("Failed to register node, already in use: "+t.node)};y.NAME="drag",y.START_EVENT="mousedown",y.ATTRS={node:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid Node Given: "+t),n}},dragNode:{setter:function(t){if(this._canDrag(t))return t;var n=e.one(t);return n||e.error("DD.Drag: Invalid dragNode Given: "+t),n}},offsetNode:{value:!0},startCentered:{value:!1},clickPixelThresh:{value:n.get("clickPixelThresh")},clickTimeThresh:{value:n.get("clickTimeThresh")},lock:{value:!1,setter:function(e){return e?this.get(r).addClass(n.CSS_PREFIX+"-locked"):this.get(r).removeClass(n.CSS_PREFIX+"-locked"),e}},data:{value:!1},move:{value:!0},useShim:{value:!0},activeHandle:{value:!1},primaryButtonOnly:{value:!0},dragging:{value:!1},parent:{value:!1},target:{value:!1,setter:function(e){return this._handleTarget(e),e}},dragMode:{value:null,setter:function(e){return n._setDragMode(e)}},groups:{value:["default"],getter:function(){this._groups||(this._groups={});var t=[];return e.each(this._groups,function(e,n){t[t.length]=n}),t},setter:function(t){return this._groups={},e.each(t,function(e){this._groups[e]=!0},this),t}},handles:{value:null,setter:function(t){return t?(this._handles={},e.each(t,function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;this._handles[n]=t},this)):this._handles=null,t}},bubbles:{setter:function(e){return this.addTarget(e),e}},haltDown:{value:!0}},e.extend(y,e.Base,{_canDrag:function(e){return e&&e.setXY&&e.getXY&&e.test&&e.contains?!0:!1},_bubbleTargets:e.DD.DDM,addToGroup:function(e){return this._groups[e]=!0,n._activateTargets(),this},removeFromGroup:function(e){return delete this._groups[e],n._activateTargets(),this},target:null,_handleTarget:function(t){e.DD.Drop&&(t===!1?this.target&&(n._unregTarget(this.target),this.target=null):(e.Lang.isObject(t)||(t={}),t.bubbleTargets=t.bubbleTargets||e.Object.values(this._yuievt.targets),t.node=this.get(r),t.groups=t.groups||this.get("groups"),this.target=new e.DD.Drop(t)))},_groups:null,_createEvents:function(){this.publish(a,{defaultFn:this._defMouseDownFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(g,{defaultFn:this._defAlignFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(m,{defaultFn:this._defDragFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"}),this.publish(v,{defaultFn:this._defEndFn,preventedFn:this._prevEndFn,queuable:!1,emitFacade:!0,bubbles:!0,prefix:"drag"});var t=[f,l,c,h,p,d,"drag:drophit","drag:dropmiss","drag:over","drag:enter","drag:exit"];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,bubbles:!0,preventable:!1,queuable:!1,prefix:"drag"})},this)},_ev_md:null,_startTime:null,_endTime:null,_handles:null,_invalids:null,_invalidsDefault:{textarea:!0,input:!0,a:!0,button:!0,select:!0},_dragThreshMet:null,_fromTimeout:null,_clickTimeout:null,deltaXY:null,startXY:null,nodeXY:null,lastXY:null,actXY:null,realXY:null,mouseXY:null,region:null,_handleMouseUp:function(){this.fire("drag:mouseup"),this._fixIEMouseUp(),n.activeDrag&&n._end()},_fixDragStart:function(e){this.validClick(e)&&e.preventDefault()},_ieSelectFix:function(){return!1},_ieSelectBack:null,_fixIEMouseDown:function(){e.UA.ie&&(this._ieSelectBack=e.config.doc.body.onselectstart,e.config.doc.body.onselectstart=this._ieSelectFix)},_fixIEMouseUp:function(){e.UA.ie&&(e.config.doc.body.onselectstart=this._ieSelectBack)},_handleMouseDownEvent:function(e){this.fire(a,{ev:e})},_defMouseDownFn:function(t){var r=t.ev;this._dragThreshMet=!1,this._ev_md=r;if(this.get("primaryButtonOnly")&&r.button>1)return!1;this.validClick(r)&&(this._fixIEMouseDown(r),y.START_EVENT.indexOf("gesture")!==0&&(this.get("haltDown")?r.halt():r.preventDefault()),this._setStartPosition([r.pageX,r.pageY]),n.activeDrag=this,this._clickTimeout=e.later(this.get("clickTimeThresh"),this,this._timeoutCheck)),this.fire(f,{ev:r})},validClick:function(t){var n=!1,i=!1,s=t.target,o=null,u=null,a=null,f=!1;if(this._handles)e.each(this._handles,function(t,r){t instanceof e.Node||t instanceof e.NodeList?n||(a=t,a instanceof e.Node&&(a=new e.NodeList(t._node)),a.each(function(e){e.contains(s)&&(n=!0)})):e.Lang.isString(r)&&s.test(r+", "+r+" *")&&!o&&(o=r,n=!0)});else{i=this.get(r);if(i.contains(s)||i.compareTo(s))n=!0}return n&&this._invalids&&e.each(this._invalids,function(t,r){e.Lang.isString(r)&&s.test(r+", "+r+" *")&&(n=!1)}),n&&(o?(u=t.currentTarget.all(o),f=!1,u.each(function(e){(e.contains(s)||e.compareTo(s))&&!f&&(f=!0,this.set("activeHandle",e))},this)):this.set("activeHandle",this.get(r))),n},_setStartPosition:function(e){this.startXY=e,this.nodeXY=this.lastXY=this.realXY=this.get(r).getXY(),this.get("offsetNode")?this.deltaXY=[this.startXY[0]-this.nodeXY[0],this.startXY[1]-this.nodeXY[1]]:this.deltaXY=[0,0]},_timeoutCheck:function(){!this.get("lock")&&!this._dragThreshMet&&this._ev_md&&(this._fromTimeout=this._dragThreshMet=!0,this.start(),this._alignNode([this._ev_md.pageX,this._ev_md.pageY],!0))},removeHandle:function(t){var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]&&(delete this._handles[n],this.fire(l,{handle:t})),this},addHandle:function(t){this._handles||(this._handles={});var n=t;if(t instanceof e.Node||t instanceof e.NodeList)n=t._yuid;return this._handles[n]=t,this.fire(c,{handle:t}),this},removeInvalid:function(e){return this._invalids[e]&&(this._invalids[e]=null,delete this._invalids[e],this.fire(h,{handle:e})),this},addInvalid:function(t){return e.Lang.isString(t)&&(this._invalids[t]=!0,this.fire(p,{handle:t})),this},initializer:function(){this.get(r).dd=this;if(!this.get(r).get("id")){var t=e.stamp(this.get(r));this.get(r).set("id",t)}this.actXY=[],this._invalids=e.clone(this._invalidsDefault,!0),this._createEvents(),this.get(s)||this.set(s,this.get(r)),this.on("initializedChange",e.bind(this._prep,this)),this.set("groups",this.get("groups"))},_prep:function(){this._dragThreshMet=!1;var t=this.get(r);t.addClass(n.CSS_PREFIX+"-draggable"),t.on(y.START_EVENT,e.bind(this._handleMouseDownEvent,this)),t.on("mouseup",e.bind(this._handleMouseUp,this)),t.on("dragstart",e.bind(this._fixDragStart,this))},_unprep:function(){var e=this.get(r);e.removeClass(n.CSS_PREFIX+"-draggable"),e.detachAll("mouseup"),e.detachAll("dragstart"),e.detachAll(y.START_EVENT),this.mouseXY=[],this.deltaXY=[0,0],this.startXY=[],this.nodeXY=[],this.lastXY=[],this.actXY=[],this.realXY=[]},start:function(){if(!this.get("lock")&&!this.get(i)){var e=this.get(r),t,a,f;this._startTime=(new Date).getTime(),n._start(),e.addClass(n.CSS_PREFIX+"-dragging"),this.fire(d,{pageX:this.nodeXY[0],pageY:this.nodeXY[1],startTime:this._startTime}),e=this.get(s),f=this.nodeXY,t=e.get(u),a=e.get(o),this.get("startCentered")&&this._setStartPosition([f[0]+t/2,f[1]+a/2]),this.region={0:f[0],1:f[1],area:0,top:f[1],right:f[0]+t,bottom:f[1]+a,left:f[0]},this.set(i,!0)}return this},end:function(){return this._endTime=(new Date).getTime(),this._clickTimeout&&this._clickTimeout.cancel(),this._dragThreshMet=this._fromTimeout=!1,!this.get("lock")&&this.get(i)&&this.fire(v,{pageX:this.lastXY[0],pageY:this.lastXY[1],startTime:this._startTime,endTime:this._endTime}),this.get(r).removeClass(n.CSS_PREFIX+"-dragging"),this.set(i,!1),this.deltaXY=[0,0],this},_defEndFn:function(){this._fixIEMouseUp(),this._ev_md=null},_prevEndFn:function(){this._fixIEMouseUp(),this.get(s).setXY(this.nodeXY),this._ev_md=null,this.region=null},_align:function(e){this.fire(g,{pageX:e[0],pageY:e[1]})},_defAlignFn:function(e){this.actXY=[e.pageX-this.deltaXY[0],e.pageY-this.deltaXY[1]]},_alignNode:function(e,t){this._align(e),t||this._moveNode()},_moveNode:function(e){var t=[],n=[],r=this.nodeXY,i=this.actXY;t[0]=i[0]-this.lastXY[0],t[1]=i[1]-this.lastXY[1],n[0]=i[0]-this.nodeXY[0],n[1]=i[1]-this.nodeXY[1],this.region={0:i[0],1:i[1],area:0,top:i[1],right:i[0]+this.get(s).get(u),bottom:i[1]+this.get(s).get(o),left:i[0]},this.fire(m,{pageX:i[0],pageY:i[1],scroll:e,info:{start:r,xy:i,delta:t,offset:n}}),this.lastXY=i},_defDragFn:function(e){this.get("move")&&(e.scroll&&e.scroll.node&&(e.scroll.node.set("scrollTop",e.scroll.top),e.scroll.node.set("scrollLeft",e.scroll.left)),this.get(s).setXY([e.pageX,e.pageY]),this.realXY=[e.pageX,e.pageY])},_move:function(e){if(this.get("lock"))return!1;this.mouseXY=[e.pageX,e.pageY];if(!this._dragThreshMet){var t=Math.abs(this.startXY[0]-e.pageX),n=Math.abs(this.startXY[1]-e.pageY);if(t>this.get("clickPixelThresh")||n>this.get("clickPixelThresh"))this._dragThreshMet=!0,this.start(),e&&e.preventDefault&&e.preventDefault(),this._alignNode([e.pageX,e.pageY])}else this._clickTimeout&&this._clickTimeout.cancel(),this._alignNode([e.pageX,e.pageY])},stopDrag:function(){return this.get(i)&&n._end(),this},destructor:function(){this._unprep(),this.target&&this.target.destroy(),n._unregDrag(this)}}),e.namespace("DD"),e.DD.Drag=y},"3.7.3",{requires:["dd-ddm-base"]});
bundle/dd-drag/dd-drag.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the ability to drag a Node. * @module dd * @submodule dd-drag- */ + */ /** * Provides the ability to drag a Node. * @class Drag@@ -25,7 +25,7 @@ DRAGGING = 'dragging', DRAG_NODE = 'dragNode', OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth', + OFFSET_WIDTH = 'offsetWidth', /** * @event drag:mouseup * @description Handles the mouseup DOM event, does nothing internally just fires.@@ -196,7 +196,7 @@ * @bubbles DDM * @type {CustomEvent} */- + Drag = function(o) { this._lazyAddAttrs = false; Drag.superclass.constructor.apply(this, arguments);@@ -208,7 +208,7 @@ }; Drag.NAME = 'drag';- + /** * This property defaults to "mousedown", but when drag-gestures is loaded, it is changed to "gesturemovestart" * @static@@ -324,24 +324,25 @@ value: true }, /**+ * Config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false. * @attribute activeHandle- * @description This config option is set by Drag to inform you of which handle fired the drag event (in the case that there are several handles): default false. * @type Node */ activeHandle: { value: false }, /**+ * By default a drag operation will only begin if the mousedown occurred with the primary mouse button.+ * Setting this to false will allow for all mousedown events to trigger a drag. * @attribute primaryButtonOnly- * @description By default a drag operation will only begin if the mousedown occurred with the primary mouse button. Setting this to false will allow for all mousedown events to trigger a drag. * @type Boolean */ primaryButtonOnly: { value: true }, /**+ * This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change. * @attribute dragging- * @description This attribute is not meant to be used by the implementor, it is meant to be used as an Event tracker so you can listen for it to change. * @type Boolean */ dragging: {@@ -363,8 +364,8 @@ } }, /**+ * This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance. * @attribute dragMode- * @description This attribute only works if the dd-drop module is active. It will set the dragMode (point, intersect, strict) of this Drag instance. * @type String */ dragMode: {@@ -392,7 +393,7 @@ }, setter: function(g) { this._groups = {};- Y.each(g, function(v, k) {+ Y.each(g, function(v) { this._groups[v] = true; }, this); return g;@@ -408,7 +409,7 @@ setter: function(g) { if (g) { this._handles = {};- Y.each(g, function(v, k) {+ Y.each(g, function(v) { var key = v; if (v instanceof Y.Node || v instanceof Y.NodeList) { key = v._yuid;@@ -422,9 +423,9 @@ } }, /**+ * Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config * @deprecated * @attribute bubbles- * @description Controls the default bubble parent for this Drag instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config * @type Object */ bubbles: {@@ -445,7 +446,7 @@ Y.extend(Drag, Y.Base, { /**- * Checks the object for the methods needed to drag the object around. + * Checks the object for the methods needed to drag the object around. * Normally this would be a node instance, but in the case of Graphics, it * may be an SVG node or something similar. * @method _canDrag@@ -532,7 +533,7 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- + this.publish(EV_MOUSE_DOWN, { defaultFn: this._defMouseDownFn, queuable: false,@@ -540,7 +541,7 @@ bubbles: true, prefix: 'drag' });- + this.publish(EV_ALIGN, { defaultFn: this._defAlignFn, queuable: false,@@ -548,7 +549,7 @@ bubbles: true, prefix: 'drag' });- + this.publish(EV_DRAG, { defaultFn: this._defDragFn, queuable: false,@@ -556,7 +557,7 @@ bubbles: true, prefix: 'drag' });- + this.publish(EV_END, { defaultFn: this._defEndFn, preventedFn: this._prevEndFn,@@ -565,7 +566,7 @@ bubbles: true, prefix: 'drag' });- + var ev = [ EV_AFTER_MOUSE_DOWN, EV_REMOVE_HANDLE,@@ -579,8 +580,8 @@ 'drag:enter', 'drag:exit' ];- - Y.each(ev, function(v, k) {++ Y.each(ev, function(v) { this.publish(v, { type: v, emitFacade: true,@@ -627,9 +628,9 @@ */ _invalids: null, /**+ * A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true} * @private * @property _invalidsDefault- * @description A private hash of the default invalid selector strings: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true} * @type {Object} */ _invalidsDefault: {'textarea': true, 'input': true, 'a': true, 'button': true, 'select': true },@@ -701,24 +702,25 @@ * @description A region object associated with this drag, used for checking regions while dragging. * @type Object */- region: null, + region: null, /** * @private * @method _handleMouseUp * @description Handler for the mouseup DOM event * @param {EventFacade} ev The Event */- _handleMouseUp: function(ev) {+ _handleMouseUp: function() { this.fire('drag:mouseup'); this._fixIEMouseUp(); if (DDM.activeDrag) { DDM._end(); } },- /** + /**+ * The function we use as the ondragstart handler when we start a drag+ * in Internet Explorer. This keeps IE from blowing up on images as drag handles. * @private * @method _fixDragStart- * @description The function we use as the ondragstart handler when we start a drag in Internet Explorer. This keeps IE from blowing up on images as drag handles. * @param {Event} e The Event */ _fixDragStart: function(e) {@@ -726,7 +728,7 @@ e.preventDefault(); } },- /** + /** * @private * @method _ieSelectFix * @description The function we use as the onselectstart handler when we start a drag in Internet Explorer@@ -734,7 +736,7 @@ _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.@@ -745,11 +747,11 @@ * @method _fixIEMouseDown * @description This method copies the onselectstart listner on the document to the _ieSelectFix property */- _fixIEMouseDown: function(e) {+ _fixIEMouseDown: function() { if (Y.UA.ie) { this._ieSelectBack = Y.config.doc.body.onselectstart; Y.config.doc.body.onselectstart = this._ieSelectFix;- } + } }, /** * @private@@ -759,7 +761,7 @@ _fixIEMouseUp: function() { if (Y.UA.ie) { Y.config.doc.body.onselectstart = this._ieSelectBack;- } + } }, /** * @private@@ -781,29 +783,34 @@ this._dragThreshMet = false; this._ev_md = ev;- + if (this.get('primaryButtonOnly') && ev.button > 1) { return false; } if (this.validClick(ev)) { this._fixIEMouseDown(ev);- if (this.get('haltDown')) {- ev.halt();- } else {- ev.preventDefault();+ if (Drag.START_EVENT.indexOf('gesture') !== 0) {+ //Only do these if it's not a gesture+ if (this.get('haltDown')) {+ ev.halt();+ } else {+ ev.preventDefault();+ } }- + this._setStartPosition([ev.pageX, ev.pageY]); DDM.activeDrag = this;- + this._clickTimeout = Y.later(this.get('clickTimeThresh'), this, this._timeoutCheck); } this.fire(EV_AFTER_MOUSE_DOWN, { ev: ev }); }, /**+ * Method first checks to see if we have handles, if so it validates the click+ * against the handle. Then if it finds a valid handle, it checks it against+ * the invalid handles list. Returns true if a good handle was used, false otherwise. * @method validClick- * @description Method first checks to see if we have handles, if so it validates the click against the handle. Then if it finds a valid handle, it checks it against the invalid handles list. Returns true if a good handle was used, false otherwise. * @param {EventFacade} ev The Event * @return {Boolean} */@@ -858,7 +865,7 @@ if (hTest) { els = ev.currentTarget.all(hTest); set = false;- els.each(function(n, i) {+ els.each(function(n) { if ((n.contains(tar) || n.compareTo(tar)) && !set) { set = true; this.set('activeHandle', n);@@ -878,9 +885,9 @@ */ _setStartPosition: function(xy) { this.startXY = xy;- + this.nodeXY = this.lastXY = this.realXY = this.get(NODE).getXY();- + if (this.get('offsetNode')) { this.deltaXY = [(this.startXY[0] - this.nodeXY[0]), (this.startXY[1] - this.nodeXY[1])]; } else {@@ -902,7 +909,7 @@ /** * @method removeHandle * @description Remove a Selector added by addHandle- * @param {String} str The selector for the handle to be removed. + * @param {String} str The selector for the handle to be removed. * @return {Self} * @chainable */@@ -970,7 +977,7 @@ * @method initializer * @description Internal init handler */- initializer: function(cfg) {+ initializer: function() { this.get(NODE).dd = this; @@ -980,11 +987,11 @@ } this.actXY = [];- + this._invalids = Y.clone(this._invalidsDefault, true); this._createEvents();- + if (!this.get(DRAG_NODE)) { this.set(DRAG_NODE, this.get(NODE)); }@@ -1048,17 +1055,17 @@ }); node = this.get(DRAG_NODE); xy = this.nodeXY;- + ow = node.get(OFFSET_WIDTH); oh = node.get(OFFSET_HEIGHT);- + if (this.get('startCentered')) { this._setStartPosition([xy[0] + (ow / 2), xy[1] + (oh / 2)]); }- - ++ this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -1102,7 +1109,7 @@ * @method _defEndFn * @description Handler for fixing the selection in IE */- _defEndFn: function(e) {+ _defEndFn: function() { this._fixIEMouseUp(); this._ev_md = null; },@@ -1111,7 +1118,7 @@ * @method _prevEndFn * @description Handler for preventing the drag:end event. It will reset the node back to it's start position */- _prevEndFn: function(e) {+ _prevEndFn: function() { this._fixIEMouseUp(); //Bug #1852577 this.get(DRAG_NODE).setXY(this.nodeXY);@@ -1167,7 +1174,7 @@ this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -1185,9 +1192,9 @@ xy: xy, delta: diffXY, offset: diffXY2- } + } });- + this.lastXY = xy; }, /**@@ -1224,6 +1231,10 @@ if (diffX > this.get('clickPixelThresh') || diffY > this.get('clickPixelThresh')) { this._dragThreshMet = true; this.start();+ //This only happens on gestures to stop the page from scrolling+ if (ev && ev.preventDefault) {+ ev.preventDefault();+ } this._alignNode([ev.pageX, ev.pageY]); } } else {@@ -1258,10 +1269,10 @@ DDM._unregDrag(this); } });- Y.namespace('DD'); + Y.namespace('DD'); Y.DD.Drag = Drag; -}, '3.7.2', {"requires": ["dd-ddm-base"]});+}, '3.7.3', {"requires": ["dd-ddm-base"]});
bundle/dd-drop-plugin/dd-drop-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dd-drop-plugin/dd-drop-plugin.js", code: [] };-_yuitest_coverage["build/dd-drop-plugin/dd-drop-plugin.js"].code=["YUI.add('dd-drop-plugin', function (Y, NAME) {","",""," /**"," * Simple Drop plugin that can be attached to a Node via the plug method."," * @module dd"," * @submodule dd-drop-plugin"," */"," /**"," * Simple Drop plugin that can be attached to a Node via the plug method."," * @class Drop"," * @extends DD.Drop"," * @constructor"," * @namespace Plugin"," */","",""," var Drop = function(config) {"," config.node = config.host;"," Drop.superclass.constructor.apply(this, arguments);"," };"," "," /**"," * @property NAME"," * @description dd-drop-plugin"," * @type {String}"," */"," Drop.NAME = \"dd-drop-plugin\";"," /**"," * @property NS"," * @description The Drop instance will be placed on the Node instance under the drop namespace. It can be accessed via Node.drop;"," * @type {String}"," */"," Drop.NS = \"drop\";","",""," Y.extend(Drop, Y.DD.Drop);"," Y.namespace('Plugin');"," Y.Plugin.Drop = Drop;","","","","","}, '3.7.2', {\"requires\": [\"dd-drop\"]});"];+_yuitest_coverage["build/dd-drop-plugin/dd-drop-plugin.js"].code=["YUI.add('dd-drop-plugin', function (Y, NAME) {","",""," /**"," * Simple Drop plugin that can be attached to a Node via the plug method."," * @module dd"," * @submodule dd-drop-plugin"," */"," /**"," * Simple Drop plugin that can be attached to a Node via the plug method."," * @class Drop"," * @extends DD.Drop"," * @constructor"," * @namespace Plugin"," */","",""," var Drop = function(config) {"," config.node = config.host;"," Drop.superclass.constructor.apply(this, arguments);"," };",""," /**"," * @property NAME"," * @description dd-drop-plugin"," * @type {String}"," */"," Drop.NAME = \"dd-drop-plugin\";"," /**"," * @property NS"," * @description The Drop instance will be placed on the Node instance under the drop namespace. It can be accessed via Node.drop;"," * @type {String}"," */"," Drop.NS = \"drop\";","",""," Y.extend(Drop, Y.DD.Drop);"," Y.namespace('Plugin');"," Y.Plugin.Drop = Drop;","","","","","}, '3.7.3', {\"requires\": [\"dd-drop\"]});"]; _yuitest_coverage["build/dd-drop-plugin/dd-drop-plugin.js"].lines = {"1":0,"18":0,"19":0,"20":0,"28":0,"34":0,"37":0,"38":0,"39":0}; _yuitest_coverage["build/dd-drop-plugin/dd-drop-plugin.js"].functions = {"Drop:18":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-drop-plugin/dd-drop-plugin.js"].coveredLines = 9;@@ -64,7 +64,7 @@ _yuitest_coverline("build/dd-drop-plugin/dd-drop-plugin.js", 20); Drop.superclass.constructor.apply(this, arguments); };- + /** * @property NAME * @description dd-drop-plugin@@ -91,4 +91,4 @@ -}, '3.7.2', {"requires": ["dd-drop"]});+}, '3.7.3', {"requires": ["dd-drop"]});
bundle/dd-drop-plugin/dd-drop-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -25,7 +25,7 @@ config.node = config.host; Drop.superclass.constructor.apply(this, arguments); };- + /** * @property NAME * @description dd-drop-plugin@@ -47,4 +47,4 @@ -}, '3.7.2', {"requires": ["dd-drop"]});+}, '3.7.3', {"requires": ["dd-drop"]});
bundle/dd-drop-plugin/dd-drop-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-drop-plugin",function(e,t){var n=function(e){e.node=e.host,n.superclass.constructor.apply(this,arguments)};n.NAME="dd-drop-plugin",n.NS="drop",e.extend(n,e.DD.Drop),e.namespace("Plugin"),e.Plugin.Drop=n},"3.7.2",{requires:["dd-drop"]});+YUI.add("dd-drop-plugin",function(e,t){var n=function(e){e.node=e.host,n.superclass.constructor.apply(this,arguments)};n.NAME="dd-drop-plugin",n.NS="drop",e.extend(n,e.DD.Drop),e.namespace("Plugin"),e.Plugin.Drop=n},"3.7.3",{requires:["dd-drop"]});
bundle/dd-drop-plugin/dd-drop-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -25,7 +25,7 @@ config.node = config.host; Drop.superclass.constructor.apply(this, arguments); };- + /** * @property NAME * @description dd-drop-plugin@@ -47,4 +47,4 @@ -}, '3.7.2', {"requires": ["dd-drop"]});+}, '3.7.3', {"requires": ["dd-drop"]});
bundle/dd-drop/dd-drop-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/dd-drop/dd-drop.js", code: [] };-_yuitest_coverage["build/dd-drop/dd-drop.js"].code=["YUI.add('dd-drop', function (Y, NAME) {","",""," /**"," * Provides the ability to create a Drop Target."," * @module dd"," * @submodule dd-drop"," */ "," /**"," * Provides the ability to create a Drop Target."," * @class Drop"," * @extends Base"," * @constructor"," * @namespace DD"," */",""," var NODE = 'node',"," DDM = Y.DD.DDM,"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," /**"," * @event drop:over"," * @description Fires when a drag element is over this target."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl> "," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DROP_OVER = 'drop:over',"," /**"," * @event drop:enter"," * @description Fires when a drag element enters this target."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl> "," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DROP_ENTER = 'drop:enter',"," /**"," * @event drop:exit"," * @description Fires when a drag element exits this target."," * @param {EventFacade} event An Event Facade object"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DROP_EXIT = 'drop:exit',",""," /**"," * @event drop:hit"," * @description Fires when a draggable node is dropped on this Drop Target. (Fired from dd-ddm-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The best guess on what was dropped on.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>"," * </dl> "," * @bubbles DDM"," * @type {CustomEvent}"," */"," ",""," Drop = function() {"," this._lazyAddAttrs = false;"," Drop.superclass.constructor.apply(this, arguments);","",""," //DD init speed up."," Y.on('domready', Y.bind(function() {"," Y.later(100, this, this._createShim);"," }, this));"," DDM._regTarget(this);",""," /* TODO"," if (Dom.getStyle(this.el, 'position') == 'fixed') {"," Event.on(window, 'scroll', function() {"," this.activateShim();"," }, this, true);"," }"," */"," };",""," Drop.NAME = 'drop';",""," Drop.ATTRS = {"," /**"," * @attribute node"," * @description Y.Node instanace to use as the element to make a Drop Target"," * @type Node"," */ "," node: {"," setter: function(node) {"," var n = Y.one(node);"," if (!n) {"," Y.error('DD.Drop: Invalid Node Given: ' + node);"," }"," return n; "," }"," },"," /**"," * @attribute groups"," * @description Array of groups to add this drop into."," * @type Array"," */ "," groups: {"," value: ['default'],"," getter: function() {"," if (!this._groups) {"," this._groups = {};"," }"," var ret = [];"," Y.each(this._groups, function(v, k) {"," ret[ret.length] = k;"," });"," return ret;"," }, "," setter: function(g) {"," this._groups = {};"," Y.each(g, function(v, k) {"," this._groups[v] = true;"," }, this);"," return g;"," }"," }, "," /**"," * @attribute padding"," * @description CSS style padding to make the Drop Target bigger than the node."," * @type String"," */"," padding: {"," value: '0',"," setter: function(p) {"," return DDM.cssSizestoObject(p);"," }"," },"," /**"," * @attribute lock"," * @description Set to lock this drop element."," * @type Boolean"," */ "," lock: {"," value: false,"," setter: function(lock) {"," if (lock) {"," this.get(NODE).addClass(DDM.CSS_PREFIX + '-drop-locked');"," } else {"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-locked');"," }"," return lock;"," }"," },"," /**"," * @deprecated"," * @attribute bubbles"," * @description Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config."," * @type Object"," */"," bubbles: {"," setter: function(t) {"," this.addTarget(t);"," return t;"," }"," },"," /**"," * @deprecated"," * @attribute useShim"," * @description Use the Drop shim. Default: true"," * @type Boolean"," */"," useShim: {"," value: true,"," setter: function(v) {"," Y.DD.DDM._noShim = !v;"," return v;"," }"," }"," };",""," Y.extend(Drop, Y.Base, {"," /**"," * @private"," * @property _bubbleTargets"," * @description The default bubbleTarget for this object. Default: Y.DD.DDM"," */"," _bubbleTargets: Y.DD.DDM,"," /**"," * @method addToGroup"," * @description Add this Drop instance to a group, this should be used for on-the-fly group additions."," * @param {String} g The group to add this Drop Instance to."," * @return {Self}"," * @chainable"," */"," addToGroup: function(g) {"," this._groups[g] = true;"," return this;"," },"," /**"," * @method removeFromGroup"," * @description Remove this Drop instance from a group, this should be used for on-the-fly group removals."," * @param {String} g The group to remove this Drop Instance from."," * @return {Self}"," * @chainable"," */"," removeFromGroup: function(g) {"," delete this._groups[g];"," return this;"," },"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {"," "," var ev = ["," EV_DROP_OVER,"," EV_DROP_ENTER,"," EV_DROP_EXIT,"," 'drop:hit'"," ];",""," Y.each(ev, function(v, k) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," preventable: false,"," bubbles: true,"," queuable: false,"," prefix: 'drop'"," });"," }, this);"," },"," /**"," * @private"," * @property _valid"," * @description Flag for determining if the target is valid in this operation."," * @type Boolean"," */"," _valid: null,"," /**"," * @private"," * @property _groups"," * @description The groups this target belongs to."," * @type Array"," */"," _groups: null,"," /**"," * @property shim"," * @description Node reference to the targets shim"," * @type {Object}"," */"," shim: null,"," /**"," * @property region"," * @description A region object associated with this target, used for checking regions while dragging."," * @type Object"," */"," region: null,"," /**"," * @property overTarget"," * @description This flag is tripped when a drag element is over this target."," * @type Boolean"," */"," overTarget: null,"," /**"," * @method inGroup"," * @description Check if this target is in one of the supplied groups."," * @param {Array} groups The groups to check against"," * @return Boolean"," */"," inGroup: function(groups) {"," this._valid = false;"," var ret = false;"," Y.each(groups, function(v, k) {"," if (this._groups[v]) {"," ret = true;"," this._valid = true;"," }"," }, this);"," return ret;"," },"," /**"," * @private"," * @method initializer"," * @description Private lifecycle method"," */"," initializer: function(cfg) {"," Y.later(100, this, this._createEvents);",""," var node = this.get(NODE), id;"," if (!node.get('id')) {"," id = Y.stamp(node);"," node.set('id', id);"," }"," node.addClass(DDM.CSS_PREFIX + '-drop');"," //Shouldn't have to do this.."," this.set('groups', this.get('groups')); "," },"," /**"," * @private"," * @method destructor"," * @description Lifecycle destructor, unreg the drag from the DDM and remove listeners"," */"," destructor: function() {"," DDM._unregTarget(this);"," if (this.shim && (this.shim !== this.get(NODE))) {"," this.shim.detachAll();"," this.shim.remove();"," this.shim = null;"," }"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop');"," this.detachAll();"," },"," /**"," * @private"," * @method _deactivateShim"," * @description Removes classes from the target, resets some flags and sets the shims deactive position [-999, -999]"," */"," _deactivateShim: function() {"," if (!this.shim) {"," return false;"," }"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-valid');"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-invalid');"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-over');",""," if (this.get('useShim')) {"," this.shim.setStyles({"," top: '-999px',"," left: '-999px',"," zIndex: '1'"," });"," }"," this.overTarget = false;"," },"," /**"," * @private"," * @method _activateShim"," * @description Activates the shim and adds some interaction CSS classes"," */"," _activateShim: function() {"," if (!DDM.activeDrag) {"," return false; //Nothing is dragging, no reason to activate."," }"," if (this.get(NODE) === DDM.activeDrag.get(NODE)) {"," return false;"," }"," if (this.get('lock')) {"," return false;"," }"," var node = this.get(NODE);"," //TODO Visibility Check.."," //if (this.inGroup(DDM.activeDrag.get('groups')) && this.get(NODE).isVisible()) {"," if (this.inGroup(DDM.activeDrag.get('groups'))) {"," node.removeClass(DDM.CSS_PREFIX + '-drop-active-invalid');"," node.addClass(DDM.CSS_PREFIX + '-drop-active-valid');"," DDM._addValid(this);"," this.overTarget = false;"," if (!this.get('useShim')) {"," this.shim = this.get(NODE);"," }"," this.sizeShim();"," } else {"," DDM._removeValid(this);"," node.removeClass(DDM.CSS_PREFIX + '-drop-active-valid');"," node.addClass(DDM.CSS_PREFIX + '-drop-active-invalid');"," }"," },"," /**"," * @method sizeShim"," * @description Positions and sizes the shim with the raw data from the node, this can be used to programatically adjust the Targets shim for Animation.."," */"," sizeShim: function() {"," if (!DDM.activeDrag) {"," return false; //Nothing is dragging, no reason to activate."," }"," if (this.get(NODE) === DDM.activeDrag.get(NODE)) {"," return false;"," }"," //if (this.get('lock') || !this.get('useShim')) {"," if (this.get('lock')) {"," return false;"," }"," if (!this.shim) {"," Y.later(100, this, this.sizeShim);"," return false;"," }"," var node = this.get(NODE),"," nh = node.get(OFFSET_HEIGHT),"," nw = node.get(OFFSET_WIDTH),"," xy = node.getXY(),"," p = this.get('padding'),"," dd, dH, dW;","",""," //Apply padding"," nw = nw + p.left + p.right;"," nh = nh + p.top + p.bottom;"," xy[0] = xy[0] - p.left;"," xy[1] = xy[1] - p.top;"," ",""," if (DDM.activeDrag.get('dragMode') === DDM.INTERSECT) {"," //Intersect Mode, make the shim bigger"," dd = DDM.activeDrag;"," dH = dd.get(NODE).get(OFFSET_HEIGHT);"," dW = dd.get(NODE).get(OFFSET_WIDTH);"," "," nh = (nh + dH);"," nw = (nw + dW);"," xy[0] = xy[0] - (dW - dd.deltaXY[0]);"," xy[1] = xy[1] - (dH - dd.deltaXY[1]);",""," }"," "," if (this.get('useShim')) {"," //Set the style on the shim"," this.shim.setStyles({"," height: nh + 'px',"," width: nw + 'px',"," top: xy[1] + 'px',"," left: xy[0] + 'px'"," });"," }",""," //Create the region to be used by intersect when a drag node is over us."," this.region = {"," '0': xy[0], "," '1': xy[1],"," area: 0,"," top: xy[1],"," right: xy[0] + nw,"," bottom: xy[1] + nh,"," left: xy[0]"," };"," },"," /**"," * @private"," * @method _createShim"," * @description Creates the Target shim and adds it to the DDM's playground.."," */"," _createShim: function() {"," //No playground, defer"," if (!DDM._pg) {"," Y.later(10, this, this._createShim);"," return;"," }"," //Shim already here, cancel"," if (this.shim) {"," return;"," }"," var s = this.get('node');",""," if (this.get('useShim')) {"," s = Y.Node.create('<div id=\"' + this.get(NODE).get('id') + '_shim\"></div>');"," s.setStyles({"," height: this.get(NODE).get(OFFSET_HEIGHT) + 'px',"," width: this.get(NODE).get(OFFSET_WIDTH) + 'px',"," backgroundColor: 'yellow',"," opacity: '.5',"," zIndex: '1',"," overflow: 'hidden',"," top: '-900px',"," left: '-900px',"," position: 'absolute'"," });",""," DDM._pg.appendChild(s);",""," s.on('mouseover', Y.bind(this._handleOverEvent, this));"," s.on('mouseout', Y.bind(this._handleOutEvent, this));"," }","",""," this.shim = s;"," },"," /**"," * @private"," * @method _handleOverTarget"," * @description This handles the over target call made from this object or from the DDM"," */"," _handleTargetOver: function() {"," if (DDM.isOverTarget(this)) {"," this.get(NODE).addClass(DDM.CSS_PREFIX + '-drop-over');"," DDM.activeDrop = this;"," DDM.otherDrops[this] = this;"," if (this.overTarget) {"," DDM.activeDrag.fire('drag:over', { drop: this, drag: DDM.activeDrag });"," this.fire(EV_DROP_OVER, { drop: this, drag: DDM.activeDrag });"," } else {"," //Prevent an enter before a start.."," if (DDM.activeDrag.get('dragging')) {"," this.overTarget = true;"," this.fire(EV_DROP_ENTER, { drop: this, drag: DDM.activeDrag });"," DDM.activeDrag.fire('drag:enter', { drop: this, drag: DDM.activeDrag });"," DDM.activeDrag.get(NODE).addClass(DDM.CSS_PREFIX + '-drag-over');"," //TODO - Is this needed??"," //DDM._handleTargetOver();"," }"," }"," } else {"," this._handleOut();"," }"," },"," /**"," * @private"," * @method _handleOverEvent"," * @description Handles the mouseover DOM event on the Target Shim"," */"," _handleOverEvent: function() {"," this.shim.setStyle('zIndex', '999');"," DDM._addActiveShim(this);"," },"," /**"," * @private"," * @method _handleOutEvent"," * @description Handles the mouseout DOM event on the Target Shim"," */"," _handleOutEvent: function() {"," this.shim.setStyle('zIndex', '1');"," DDM._removeActiveShim(this);"," },"," /**"," * @private"," * @method _handleOut"," * @description Handles out of target calls/checks"," */"," _handleOut: function(force) {"," if (!DDM.isOverTarget(this) || force) {"," if (this.overTarget) {"," this.overTarget = false;"," if (!force) {"," DDM._removeActiveShim(this);"," }"," if (DDM.activeDrag) {"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-over');"," DDM.activeDrag.get(NODE).removeClass(DDM.CSS_PREFIX + '-drag-over');"," this.fire(EV_DROP_EXIT, { drop: this, drag: DDM.activeDrag });"," DDM.activeDrag.fire('drag:exit', { drop: this, drag: DDM.activeDrag });"," delete DDM.otherDrops[this];"," }"," }"," }"," }"," });",""," Y.DD.Drop = Drop;","","","","","}, '3.7.2', {\"requires\": [\"dd-drag\", \"dd-ddm-drop\"]});"];-_yuitest_coverage["build/dd-drop/dd-drop.js"].lines = {"1":0,"17":0,"69":0,"70":0,"74":0,"75":0,"77":0,"88":0,"90":0,"98":0,"99":0,"100":0,"102":0,"113":0,"114":0,"116":0,"117":0,"118":0,"120":0,"123":0,"124":0,"125":0,"127":0,"138":0,"149":0,"150":0,"152":0,"154":0,"165":0,"166":0,"178":0,"179":0,"184":0,"199":0,"200":0,"210":0,"211":0,"220":0,"227":0,"228":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"285":0,"293":0,"295":0,"296":0,"297":0,"298":0,"300":0,"302":0,"310":0,"311":0,"312":0,"313":0,"314":0,"316":0,"317":0,"325":0,"326":0,"328":0,"329":0,"330":0,"332":0,"333":0,"339":0,"347":0,"348":0,"350":0,"351":0,"353":0,"354":0,"356":0,"359":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"367":0,"369":0,"370":0,"371":0,"379":0,"380":0,"382":0,"383":0,"386":0,"387":0,"389":0,"390":0,"391":0,"393":0,"402":0,"403":0,"404":0,"405":0,"408":0,"410":0,"411":0,"412":0,"414":0,"415":0,"416":0,"417":0,"421":0,"423":0,"432":0,"449":0,"450":0,"451":0,"454":0,"455":0,"457":0,"459":0,"460":0,"461":0,"473":0,"475":0,"476":0,"480":0,"488":0,"489":0,"490":0,"491":0,"492":0,"493":0,"494":0,"497":0,"498":0,"499":0,"500":0,"501":0,"507":0,"516":0,"517":0,"525":0,"526":0,"534":0,"535":0,"536":0,"537":0,"538":0,"540":0,"541":0,"542":0,"543":0,"544":0,"545":0,"552":0};-_yuitest_coverage["build/dd-drop/dd-drop.js"].functions = {"(anonymous 2):74":0,"Drop:68":0,"setter:97":0,"(anonymous 3):117":0,"getter:112":0,"(anonymous 4):124":0,"setter:122":0,"setter:137":0,"setter:148":0,"setter:164":0,"setter:177":0,"addToGroup:198":0,"removeFromGroup:209":0,"(anonymous 5):227":0,"_createEvents:218":0,"(anonymous 6):279":0,"inGroup:276":0,"initializer:292":0,"destructor:309":0,"_deactivateShim:324":0,"_activateShim:346":0,"sizeShim:378":0,"_createShim:447":0,"_handleTargetOver:487":0,"_handleOverEvent:515":0,"_handleOutEvent:524":0,"_handleOut:533":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-drop/dd-drop.js"].code=["YUI.add('dd-drop', function (Y, NAME) {","",""," /**"," * Provides the ability to create a Drop Target."," * @module dd"," * @submodule dd-drop"," */"," /**"," * Provides the ability to create a Drop Target."," * @class Drop"," * @extends Base"," * @constructor"," * @namespace DD"," */",""," var NODE = 'node',"," DDM = Y.DD.DDM,"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," /**"," * @event drop:over"," * @description Fires when a drag element is over this target."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DROP_OVER = 'drop:over',"," /**"," * @event drop:enter"," * @description Fires when a drag element enters this target."," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The drop object at the time of the event.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DROP_ENTER = 'drop:enter',"," /**"," * @event drop:exit"," * @description Fires when a drag element exits this target."," * @param {EventFacade} event An Event Facade object"," * @bubbles DDM"," * @type {CustomEvent}"," */"," EV_DROP_EXIT = 'drop:exit',",""," /**"," * @event drop:hit"," * @description Fires when a draggable node is dropped on this Drop Target. (Fired from dd-ddm-drop)"," * @param {EventFacade} event An Event Facade object with the following specific property added:"," * <dl>"," * <dt>drop</dt><dd>The best guess on what was dropped on.</dd>"," * <dt>drag</dt><dd>The drag object at the time of the event.</dd>"," * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>"," * </dl>"," * @bubbles DDM"," * @type {CustomEvent}"," */","",""," Drop = function() {"," this._lazyAddAttrs = false;"," Drop.superclass.constructor.apply(this, arguments);","",""," //DD init speed up."," Y.on('domready', Y.bind(function() {"," Y.later(100, this, this._createShim);"," }, this));"," DDM._regTarget(this);",""," /* TODO"," if (Dom.getStyle(this.el, 'position') == 'fixed') {"," Event.on(window, 'scroll', function() {"," this.activateShim();"," }, this, true);"," }"," */"," };",""," Drop.NAME = 'drop';",""," Drop.ATTRS = {"," /**"," * @attribute node"," * @description Y.Node instanace to use as the element to make a Drop Target"," * @type Node"," */"," node: {"," setter: function(node) {"," var n = Y.one(node);"," if (!n) {"," Y.error('DD.Drop: Invalid Node Given: ' + node);"," }"," return n;"," }"," },"," /**"," * @attribute groups"," * @description Array of groups to add this drop into."," * @type Array"," */"," groups: {"," value: ['default'],"," getter: function() {"," if (!this._groups) {"," this._groups = {};"," }"," var ret = [];"," Y.each(this._groups, function(v, k) {"," ret[ret.length] = k;"," });"," return ret;"," },"," setter: function(g) {"," this._groups = {};"," Y.each(g, function(v) {"," this._groups[v] = true;"," }, this);"," return g;"," }"," },"," /**"," * @attribute padding"," * @description CSS style padding to make the Drop Target bigger than the node."," * @type String"," */"," padding: {"," value: '0',"," setter: function(p) {"," return DDM.cssSizestoObject(p);"," }"," },"," /**"," * @attribute lock"," * @description Set to lock this drop element."," * @type Boolean"," */"," lock: {"," value: false,"," setter: function(lock) {"," if (lock) {"," this.get(NODE).addClass(DDM.CSS_PREFIX + '-drop-locked');"," } else {"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-locked');"," }"," return lock;"," }"," },"," /**"," * Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling."," * Use bubbleTargets in config."," * @deprecated"," * @attribute bubbles"," * @type Object"," */"," bubbles: {"," setter: function(t) {"," this.addTarget(t);"," return t;"," }"," },"," /**"," * @deprecated"," * @attribute useShim"," * @description Use the Drop shim. Default: true"," * @type Boolean"," */"," useShim: {"," value: true,"," setter: function(v) {"," Y.DD.DDM._noShim = !v;"," return v;"," }"," }"," };",""," Y.extend(Drop, Y.Base, {"," /**"," * @private"," * @property _bubbleTargets"," * @description The default bubbleTarget for this object. Default: Y.DD.DDM"," */"," _bubbleTargets: Y.DD.DDM,"," /**"," * @method addToGroup"," * @description Add this Drop instance to a group, this should be used for on-the-fly group additions."," * @param {String} g The group to add this Drop Instance to."," * @return {Self}"," * @chainable"," */"," addToGroup: function(g) {"," this._groups[g] = true;"," return this;"," },"," /**"," * @method removeFromGroup"," * @description Remove this Drop instance from a group, this should be used for on-the-fly group removals."," * @param {String} g The group to remove this Drop Instance from."," * @return {Self}"," * @chainable"," */"," removeFromGroup: function(g) {"," delete this._groups[g];"," return this;"," },"," /**"," * @private"," * @method _createEvents"," * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling."," */"," _createEvents: function() {",""," var ev = ["," EV_DROP_OVER,"," EV_DROP_ENTER,"," EV_DROP_EXIT,"," 'drop:hit'"," ];",""," Y.each(ev, function(v) {"," this.publish(v, {"," type: v,"," emitFacade: true,"," preventable: false,"," bubbles: true,"," queuable: false,"," prefix: 'drop'"," });"," }, this);"," },"," /**"," * @private"," * @property _valid"," * @description Flag for determining if the target is valid in this operation."," * @type Boolean"," */"," _valid: null,"," /**"," * @private"," * @property _groups"," * @description The groups this target belongs to."," * @type Array"," */"," _groups: null,"," /**"," * @property shim"," * @description Node reference to the targets shim"," * @type {Object}"," */"," shim: null,"," /**"," * @property region"," * @description A region object associated with this target, used for checking regions while dragging."," * @type Object"," */"," region: null,"," /**"," * @property overTarget"," * @description This flag is tripped when a drag element is over this target."," * @type Boolean"," */"," overTarget: null,"," /**"," * @method inGroup"," * @description Check if this target is in one of the supplied groups."," * @param {Array} groups The groups to check against"," * @return Boolean"," */"," inGroup: function(groups) {"," this._valid = false;"," var ret = false;"," Y.each(groups, function(v) {"," if (this._groups[v]) {"," ret = true;"," this._valid = true;"," }"," }, this);"," return ret;"," },"," /**"," * @private"," * @method initializer"," * @description Private lifecycle method"," */"," initializer: function() {"," Y.later(100, this, this._createEvents);",""," var node = this.get(NODE), id;"," if (!node.get('id')) {"," id = Y.stamp(node);"," node.set('id', id);"," }"," node.addClass(DDM.CSS_PREFIX + '-drop');"," //Shouldn't have to do this.."," this.set('groups', this.get('groups'));"," },"," /**"," * @private"," * @method destructor"," * @description Lifecycle destructor, unreg the drag from the DDM and remove listeners"," */"," destructor: function() {"," DDM._unregTarget(this);"," if (this.shim && (this.shim !== this.get(NODE))) {"," this.shim.detachAll();"," this.shim.remove();"," this.shim = null;"," }"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop');"," this.detachAll();"," },"," /**"," * @private"," * @method _deactivateShim"," * @description Removes classes from the target, resets some flags and sets the shims deactive position [-999, -999]"," */"," _deactivateShim: function() {"," if (!this.shim) {"," return false;"," }"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-valid');"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-invalid');"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-over');",""," if (this.get('useShim')) {"," this.shim.setStyles({"," top: '-999px',"," left: '-999px',"," zIndex: '1'"," });"," }"," this.overTarget = false;"," },"," /**"," * @private"," * @method _activateShim"," * @description Activates the shim and adds some interaction CSS classes"," */"," _activateShim: function() {"," if (!DDM.activeDrag) {"," return false; //Nothing is dragging, no reason to activate."," }"," if (this.get(NODE) === DDM.activeDrag.get(NODE)) {"," return false;"," }"," if (this.get('lock')) {"," return false;"," }"," var node = this.get(NODE);"," //TODO Visibility Check.."," //if (this.inGroup(DDM.activeDrag.get('groups')) && this.get(NODE).isVisible()) {"," if (this.inGroup(DDM.activeDrag.get('groups'))) {"," node.removeClass(DDM.CSS_PREFIX + '-drop-active-invalid');"," node.addClass(DDM.CSS_PREFIX + '-drop-active-valid');"," DDM._addValid(this);"," this.overTarget = false;"," if (!this.get('useShim')) {"," this.shim = this.get(NODE);"," }"," this.sizeShim();"," } else {"," DDM._removeValid(this);"," node.removeClass(DDM.CSS_PREFIX + '-drop-active-valid');"," node.addClass(DDM.CSS_PREFIX + '-drop-active-invalid');"," }"," },"," /**"," * Positions and sizes the shim with the raw data from the node,"," * this can be used to programatically adjust the Targets shim for Animation.."," * @method sizeShim"," */"," sizeShim: function() {"," if (!DDM.activeDrag) {"," return false; //Nothing is dragging, no reason to activate."," }"," if (this.get(NODE) === DDM.activeDrag.get(NODE)) {"," return false;"," }"," //if (this.get('lock') || !this.get('useShim')) {"," if (this.get('lock')) {"," return false;"," }"," if (!this.shim) {"," Y.later(100, this, this.sizeShim);"," return false;"," }"," var node = this.get(NODE),"," nh = node.get(OFFSET_HEIGHT),"," nw = node.get(OFFSET_WIDTH),"," xy = node.getXY(),"," p = this.get('padding'),"," dd, dH, dW;","",""," //Apply padding"," nw = nw + p.left + p.right;"," nh = nh + p.top + p.bottom;"," xy[0] = xy[0] - p.left;"," xy[1] = xy[1] - p.top;","",""," if (DDM.activeDrag.get('dragMode') === DDM.INTERSECT) {"," //Intersect Mode, make the shim bigger"," dd = DDM.activeDrag;"," dH = dd.get(NODE).get(OFFSET_HEIGHT);"," dW = dd.get(NODE).get(OFFSET_WIDTH);",""," nh = (nh + dH);"," nw = (nw + dW);"," xy[0] = xy[0] - (dW - dd.deltaXY[0]);"," xy[1] = xy[1] - (dH - dd.deltaXY[1]);",""," }",""," if (this.get('useShim')) {"," //Set the style on the shim"," this.shim.setStyles({"," height: nh + 'px',"," width: nw + 'px',"," top: xy[1] + 'px',"," left: xy[0] + 'px'"," });"," }",""," //Create the region to be used by intersect when a drag node is over us."," this.region = {"," '0': xy[0],"," '1': xy[1],"," area: 0,"," top: xy[1],"," right: xy[0] + nw,"," bottom: xy[1] + nh,"," left: xy[0]"," };"," },"," /**"," * @private"," * @method _createShim"," * @description Creates the Target shim and adds it to the DDM's playground.."," */"," _createShim: function() {"," //No playground, defer"," if (!DDM._pg) {"," Y.later(10, this, this._createShim);"," return;"," }"," //Shim already here, cancel"," if (this.shim) {"," return;"," }"," var s = this.get('node');",""," if (this.get('useShim')) {"," s = Y.Node.create('<div id=\"' + this.get(NODE).get('id') + '_shim\"></div>');"," s.setStyles({"," height: this.get(NODE).get(OFFSET_HEIGHT) + 'px',"," width: this.get(NODE).get(OFFSET_WIDTH) + 'px',"," backgroundColor: 'yellow',"," opacity: '.5',"," zIndex: '1',"," overflow: 'hidden',"," top: '-900px',"," left: '-900px',"," position: 'absolute'"," });",""," DDM._pg.appendChild(s);",""," s.on('mouseover', Y.bind(this._handleOverEvent, this));"," s.on('mouseout', Y.bind(this._handleOutEvent, this));"," }","",""," this.shim = s;"," },"," /**"," * @private"," * @method _handleOverTarget"," * @description This handles the over target call made from this object or from the DDM"," */"," _handleTargetOver: function() {"," if (DDM.isOverTarget(this)) {"," this.get(NODE).addClass(DDM.CSS_PREFIX + '-drop-over');"," DDM.activeDrop = this;"," DDM.otherDrops[this] = this;"," if (this.overTarget) {"," DDM.activeDrag.fire('drag:over', { drop: this, drag: DDM.activeDrag });"," this.fire(EV_DROP_OVER, { drop: this, drag: DDM.activeDrag });"," } else {"," //Prevent an enter before a start.."," if (DDM.activeDrag.get('dragging')) {"," this.overTarget = true;"," this.fire(EV_DROP_ENTER, { drop: this, drag: DDM.activeDrag });"," DDM.activeDrag.fire('drag:enter', { drop: this, drag: DDM.activeDrag });"," DDM.activeDrag.get(NODE).addClass(DDM.CSS_PREFIX + '-drag-over');"," //TODO - Is this needed??"," //DDM._handleTargetOver();"," }"," }"," } else {"," this._handleOut();"," }"," },"," /**"," * @private"," * @method _handleOverEvent"," * @description Handles the mouseover DOM event on the Target Shim"," */"," _handleOverEvent: function() {"," this.shim.setStyle('zIndex', '999');"," DDM._addActiveShim(this);"," },"," /**"," * @private"," * @method _handleOutEvent"," * @description Handles the mouseout DOM event on the Target Shim"," */"," _handleOutEvent: function() {"," this.shim.setStyle('zIndex', '1');"," DDM._removeActiveShim(this);"," },"," /**"," * @private"," * @method _handleOut"," * @description Handles out of target calls/checks"," */"," _handleOut: function(force) {"," if (!DDM.isOverTarget(this) || force) {"," if (this.overTarget) {"," this.overTarget = false;"," if (!force) {"," DDM._removeActiveShim(this);"," }"," if (DDM.activeDrag) {"," this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-over');"," DDM.activeDrag.get(NODE).removeClass(DDM.CSS_PREFIX + '-drag-over');"," this.fire(EV_DROP_EXIT, { drop: this, drag: DDM.activeDrag });"," DDM.activeDrag.fire('drag:exit', { drop: this, drag: DDM.activeDrag });"," delete DDM.otherDrops[this];"," }"," }"," }"," }"," });",""," Y.DD.Drop = Drop;","","","","","}, '3.7.3', {\"requires\": [\"dd-drag\", \"dd-ddm-drop\"]});"];+_yuitest_coverage["build/dd-drop/dd-drop.js"].lines = {"1":0,"17":0,"69":0,"70":0,"74":0,"75":0,"77":0,"88":0,"90":0,"98":0,"99":0,"100":0,"102":0,"113":0,"114":0,"116":0,"117":0,"118":0,"120":0,"123":0,"124":0,"125":0,"127":0,"138":0,"149":0,"150":0,"152":0,"154":0,"166":0,"167":0,"179":0,"180":0,"185":0,"200":0,"201":0,"211":0,"212":0,"221":0,"228":0,"229":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"286":0,"294":0,"296":0,"297":0,"298":0,"299":0,"301":0,"303":0,"311":0,"312":0,"313":0,"314":0,"315":0,"317":0,"318":0,"326":0,"327":0,"329":0,"330":0,"331":0,"333":0,"334":0,"340":0,"348":0,"349":0,"351":0,"352":0,"354":0,"355":0,"357":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"366":0,"368":0,"370":0,"371":0,"372":0,"381":0,"382":0,"384":0,"385":0,"388":0,"389":0,"391":0,"392":0,"393":0,"395":0,"404":0,"405":0,"406":0,"407":0,"410":0,"412":0,"413":0,"414":0,"416":0,"417":0,"418":0,"419":0,"423":0,"425":0,"434":0,"451":0,"452":0,"453":0,"456":0,"457":0,"459":0,"461":0,"462":0,"463":0,"475":0,"477":0,"478":0,"482":0,"490":0,"491":0,"492":0,"493":0,"494":0,"495":0,"496":0,"499":0,"500":0,"501":0,"502":0,"503":0,"509":0,"518":0,"519":0,"527":0,"528":0,"536":0,"537":0,"538":0,"539":0,"540":0,"542":0,"543":0,"544":0,"545":0,"546":0,"547":0,"554":0};+_yuitest_coverage["build/dd-drop/dd-drop.js"].functions = {"(anonymous 2):74":0,"Drop:68":0,"setter:97":0,"(anonymous 3):117":0,"getter:112":0,"(anonymous 4):124":0,"setter:122":0,"setter:137":0,"setter:148":0,"setter:165":0,"setter:178":0,"addToGroup:199":0,"removeFromGroup:210":0,"(anonymous 5):228":0,"_createEvents:219":0,"(anonymous 6):280":0,"inGroup:277":0,"initializer:293":0,"destructor:310":0,"_deactivateShim:325":0,"_activateShim:347":0,"sizeShim:380":0,"_createShim:449":0,"_handleTargetOver:489":0,"_handleOverEvent:517":0,"_handleOutEvent:526":0,"_handleOut:535":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-drop/dd-drop.js"].coveredLines = 154; _yuitest_coverage["build/dd-drop/dd-drop.js"].coveredFunctions = 28; _yuitest_coverline("build/dd-drop/dd-drop.js", 1);@@ -45,7 +45,7 @@ * Provides the ability to create a Drop Target. * @module dd * @submodule dd-drop- */ + */ /** * Provides the ability to create a Drop Target. * @class Drop@@ -67,7 +67,7 @@ * <dl> * <dt>drop</dt><dd>The drop object at the time of the event.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */@@ -79,7 +79,7 @@ * <dl> * <dt>drop</dt><dd>The drop object at the time of the event.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */@@ -101,12 +101,12 @@ * <dt>drop</dt><dd>The best guess on what was dropped on.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd> * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */- + Drop = function() { _yuitest_coverfunc("build/dd-drop/dd-drop.js", "Drop", 68); _yuitest_coverline("build/dd-drop/dd-drop.js", 69);@@ -143,7 +143,7 @@ * @attribute node * @description Y.Node instanace to use as the element to make a Drop Target * @type Node- */ + */ node: { setter: function(node) { _yuitest_coverfunc("build/dd-drop/dd-drop.js", "setter", 97);@@ -155,14 +155,14 @@ Y.error('DD.Drop: Invalid Node Given: ' + node); } _yuitest_coverline("build/dd-drop/dd-drop.js", 102);-return n; +return n; } }, /** * @attribute groups * @description Array of groups to add this drop into. * @type Array- */ + */ groups: { value: ['default'], getter: function() {@@ -182,13 +182,13 @@ }); _yuitest_coverline("build/dd-drop/dd-drop.js", 120); return ret;- }, + }, setter: function(g) { _yuitest_coverfunc("build/dd-drop/dd-drop.js", "setter", 122); _yuitest_coverline("build/dd-drop/dd-drop.js", 123); this._groups = {}; _yuitest_coverline("build/dd-drop/dd-drop.js", 124);-Y.each(g, function(v, k) {+Y.each(g, function(v) { _yuitest_coverfunc("build/dd-drop/dd-drop.js", "(anonymous 4)", 124); _yuitest_coverline("build/dd-drop/dd-drop.js", 125); this._groups[v] = true;@@ -196,7 +196,7 @@ _yuitest_coverline("build/dd-drop/dd-drop.js", 127); return g; }- }, + }, /** * @attribute padding * @description CSS style padding to make the Drop Target bigger than the node.@@ -214,7 +214,7 @@ * @attribute lock * @description Set to lock this drop element. * @type Boolean- */ + */ lock: { value: false, setter: function(lock) {@@ -232,17 +232,18 @@ } }, /**+ * Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling.+ * Use bubbleTargets in config. * @deprecated * @attribute bubbles- * @description Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config. * @type Object */ bubbles: { setter: function(t) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "setter", 164);-_yuitest_coverline("build/dd-drop/dd-drop.js", 165);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "setter", 165);+_yuitest_coverline("build/dd-drop/dd-drop.js", 166); this.addTarget(t);- _yuitest_coverline("build/dd-drop/dd-drop.js", 166);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 167); return t; } },@@ -255,16 +256,16 @@ useShim: { value: true, setter: function(v) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "setter", 177);-_yuitest_coverline("build/dd-drop/dd-drop.js", 178);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "setter", 178);+_yuitest_coverline("build/dd-drop/dd-drop.js", 179); Y.DD.DDM._noShim = !v;- _yuitest_coverline("build/dd-drop/dd-drop.js", 179);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 180); return v; } } }; - _yuitest_coverline("build/dd-drop/dd-drop.js", 184);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 185); Y.extend(Drop, Y.Base, { /** * @private@@ -280,10 +281,10 @@ * @chainable */ addToGroup: function(g) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "addToGroup", 198);-_yuitest_coverline("build/dd-drop/dd-drop.js", 199);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "addToGroup", 199);+_yuitest_coverline("build/dd-drop/dd-drop.js", 200); this._groups[g] = true;- _yuitest_coverline("build/dd-drop/dd-drop.js", 200);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 201); return this; }, /**@@ -294,10 +295,10 @@ * @chainable */ removeFromGroup: function(g) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "removeFromGroup", 209);-_yuitest_coverline("build/dd-drop/dd-drop.js", 210);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "removeFromGroup", 210);+_yuitest_coverline("build/dd-drop/dd-drop.js", 211); delete this._groups[g];- _yuitest_coverline("build/dd-drop/dd-drop.js", 211);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 212); return this; }, /**@@ -306,9 +307,9 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- - _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_createEvents", 218);-_yuitest_coverline("build/dd-drop/dd-drop.js", 220);++ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_createEvents", 219);+_yuitest_coverline("build/dd-drop/dd-drop.js", 221); var ev = [ EV_DROP_OVER, EV_DROP_ENTER,@@ -316,10 +317,10 @@ 'drop:hit' ]; - _yuitest_coverline("build/dd-drop/dd-drop.js", 227);-Y.each(ev, function(v, k) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "(anonymous 5)", 227);-_yuitest_coverline("build/dd-drop/dd-drop.js", 228);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 228);+Y.each(ev, function(v) {+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "(anonymous 5)", 228);+_yuitest_coverline("build/dd-drop/dd-drop.js", 229); this.publish(v, { type: v, emitFacade: true,@@ -369,23 +370,23 @@ * @return Boolean */ inGroup: function(groups) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "inGroup", 276);-_yuitest_coverline("build/dd-drop/dd-drop.js", 277);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "inGroup", 277);+_yuitest_coverline("build/dd-drop/dd-drop.js", 278); this._valid = false;- _yuitest_coverline("build/dd-drop/dd-drop.js", 278);-var ret = false; _yuitest_coverline("build/dd-drop/dd-drop.js", 279);-Y.each(groups, function(v, k) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "(anonymous 6)", 279);-_yuitest_coverline("build/dd-drop/dd-drop.js", 280);+var ret = false;+ _yuitest_coverline("build/dd-drop/dd-drop.js", 280);+Y.each(groups, function(v) {+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "(anonymous 6)", 280);+_yuitest_coverline("build/dd-drop/dd-drop.js", 281); if (this._groups[v]) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 281);-ret = true; _yuitest_coverline("build/dd-drop/dd-drop.js", 282);+ret = true;+ _yuitest_coverline("build/dd-drop/dd-drop.js", 283); this._valid = true; } }, this);- _yuitest_coverline("build/dd-drop/dd-drop.js", 285);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 286); return ret; }, /**@@ -393,25 +394,25 @@ * @method initializer * @description Private lifecycle method */- initializer: function(cfg) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "initializer", 292);-_yuitest_coverline("build/dd-drop/dd-drop.js", 293);+ initializer: function() {+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "initializer", 293);+_yuitest_coverline("build/dd-drop/dd-drop.js", 294); Y.later(100, this, this._createEvents); - _yuitest_coverline("build/dd-drop/dd-drop.js", 295);-var node = this.get(NODE), id; _yuitest_coverline("build/dd-drop/dd-drop.js", 296);+var node = this.get(NODE), id;+ _yuitest_coverline("build/dd-drop/dd-drop.js", 297); if (!node.get('id')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 297);-id = Y.stamp(node); _yuitest_coverline("build/dd-drop/dd-drop.js", 298);+id = Y.stamp(node);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 299); node.set('id', id); }- _yuitest_coverline("build/dd-drop/dd-drop.js", 300);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 301); node.addClass(DDM.CSS_PREFIX + '-drop'); //Shouldn't have to do this..- _yuitest_coverline("build/dd-drop/dd-drop.js", 302);-this.set('groups', this.get('groups')); + _yuitest_coverline("build/dd-drop/dd-drop.js", 303);+this.set('groups', this.get('groups')); }, /** * @private@@ -419,21 +420,21 @@ * @description Lifecycle destructor, unreg the drag from the DDM and remove listeners */ destructor: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "destructor", 309);-_yuitest_coverline("build/dd-drop/dd-drop.js", 310);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "destructor", 310);+_yuitest_coverline("build/dd-drop/dd-drop.js", 311); DDM._unregTarget(this);- _yuitest_coverline("build/dd-drop/dd-drop.js", 311);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 312); if (this.shim && (this.shim !== this.get(NODE))) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 312);-this.shim.detachAll(); _yuitest_coverline("build/dd-drop/dd-drop.js", 313);-this.shim.remove();+this.shim.detachAll(); _yuitest_coverline("build/dd-drop/dd-drop.js", 314);+this.shim.remove();+ _yuitest_coverline("build/dd-drop/dd-drop.js", 315); this.shim = null; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 316);-this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop'); _yuitest_coverline("build/dd-drop/dd-drop.js", 317);+this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop');+ _yuitest_coverline("build/dd-drop/dd-drop.js", 318); this.detachAll(); }, /**@@ -442,29 +443,29 @@ * @description Removes classes from the target, resets some flags and sets the shims deactive position [-999, -999] */ _deactivateShim: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_deactivateShim", 324);-_yuitest_coverline("build/dd-drop/dd-drop.js", 325);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_deactivateShim", 325);+_yuitest_coverline("build/dd-drop/dd-drop.js", 326); if (!this.shim) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 326);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 327); return false; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 328);-this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-valid'); _yuitest_coverline("build/dd-drop/dd-drop.js", 329);-this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-invalid');+this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-valid'); _yuitest_coverline("build/dd-drop/dd-drop.js", 330);+this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-active-invalid');+ _yuitest_coverline("build/dd-drop/dd-drop.js", 331); this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-over'); - _yuitest_coverline("build/dd-drop/dd-drop.js", 332);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 333); if (this.get('useShim')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 333);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 334); this.shim.setStyles({ top: '-999px', left: '-999px', zIndex: '1' }); }- _yuitest_coverline("build/dd-drop/dd-drop.js", 339);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 340); this.overTarget = false; }, /**@@ -473,82 +474,83 @@ * @description Activates the shim and adds some interaction CSS classes */ _activateShim: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_activateShim", 346);-_yuitest_coverline("build/dd-drop/dd-drop.js", 347);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_activateShim", 347);+_yuitest_coverline("build/dd-drop/dd-drop.js", 348); if (!DDM.activeDrag) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 348);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 349); return false; //Nothing is dragging, no reason to activate. }- _yuitest_coverline("build/dd-drop/dd-drop.js", 350);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 351); if (this.get(NODE) === DDM.activeDrag.get(NODE)) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 351);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 352); return false; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 353);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 354); if (this.get('lock')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 354);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 355); return false; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 356);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 357); var node = this.get(NODE); //TODO Visibility Check.. //if (this.inGroup(DDM.activeDrag.get('groups')) && this.get(NODE).isVisible()) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 359);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 360); if (this.inGroup(DDM.activeDrag.get('groups'))) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 360);-node.removeClass(DDM.CSS_PREFIX + '-drop-active-invalid'); _yuitest_coverline("build/dd-drop/dd-drop.js", 361);-node.addClass(DDM.CSS_PREFIX + '-drop-active-valid');+node.removeClass(DDM.CSS_PREFIX + '-drop-active-invalid'); _yuitest_coverline("build/dd-drop/dd-drop.js", 362);-DDM._addValid(this);+node.addClass(DDM.CSS_PREFIX + '-drop-active-valid'); _yuitest_coverline("build/dd-drop/dd-drop.js", 363);-this.overTarget = false;+DDM._addValid(this); _yuitest_coverline("build/dd-drop/dd-drop.js", 364);+this.overTarget = false;+ _yuitest_coverline("build/dd-drop/dd-drop.js", 365); if (!this.get('useShim')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 365);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 366); this.shim = this.get(NODE); }- _yuitest_coverline("build/dd-drop/dd-drop.js", 367);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 368); this.sizeShim(); } else {- _yuitest_coverline("build/dd-drop/dd-drop.js", 369);-DDM._removeValid(this); _yuitest_coverline("build/dd-drop/dd-drop.js", 370);-node.removeClass(DDM.CSS_PREFIX + '-drop-active-valid');+DDM._removeValid(this); _yuitest_coverline("build/dd-drop/dd-drop.js", 371);+node.removeClass(DDM.CSS_PREFIX + '-drop-active-valid');+ _yuitest_coverline("build/dd-drop/dd-drop.js", 372); node.addClass(DDM.CSS_PREFIX + '-drop-active-invalid'); } }, /**+ * Positions and sizes the shim with the raw data from the node,+ * this can be used to programatically adjust the Targets shim for Animation.. * @method sizeShim- * @description Positions and sizes the shim with the raw data from the node, this can be used to programatically adjust the Targets shim for Animation.. */ sizeShim: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "sizeShim", 378);-_yuitest_coverline("build/dd-drop/dd-drop.js", 379);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "sizeShim", 380);+_yuitest_coverline("build/dd-drop/dd-drop.js", 381); if (!DDM.activeDrag) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 380);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 382); return false; //Nothing is dragging, no reason to activate. }- _yuitest_coverline("build/dd-drop/dd-drop.js", 382);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 384); if (this.get(NODE) === DDM.activeDrag.get(NODE)) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 383);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 385); return false; } //if (this.get('lock') || !this.get('useShim')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 386);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 388); if (this.get('lock')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 387);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 389); return false; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 389);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 391); if (!this.shim) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 390);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 392); Y.later(100, this, this.sizeShim);- _yuitest_coverline("build/dd-drop/dd-drop.js", 391);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 393); return false; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 393);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 395); var node = this.get(NODE), nh = node.get(OFFSET_HEIGHT), nw = node.get(OFFSET_WIDTH),@@ -558,41 +560,41 @@ //Apply padding- _yuitest_coverline("build/dd-drop/dd-drop.js", 402);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 404); nw = nw + p.left + p.right;- _yuitest_coverline("build/dd-drop/dd-drop.js", 403);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 405); nh = nh + p.top + p.bottom;- _yuitest_coverline("build/dd-drop/dd-drop.js", 404);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 406); xy[0] = xy[0] - p.left;- _yuitest_coverline("build/dd-drop/dd-drop.js", 405);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 407); xy[1] = xy[1] - p.top;- - _yuitest_coverline("build/dd-drop/dd-drop.js", 408);++ _yuitest_coverline("build/dd-drop/dd-drop.js", 410); if (DDM.activeDrag.get('dragMode') === DDM.INTERSECT) { //Intersect Mode, make the shim bigger- _yuitest_coverline("build/dd-drop/dd-drop.js", 410);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 412); dd = DDM.activeDrag;- _yuitest_coverline("build/dd-drop/dd-drop.js", 411);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 413); dH = dd.get(NODE).get(OFFSET_HEIGHT);- _yuitest_coverline("build/dd-drop/dd-drop.js", 412);-dW = dd.get(NODE).get(OFFSET_WIDTH);- _yuitest_coverline("build/dd-drop/dd-drop.js", 414);+dW = dd.get(NODE).get(OFFSET_WIDTH);++ _yuitest_coverline("build/dd-drop/dd-drop.js", 416); nh = (nh + dH);- _yuitest_coverline("build/dd-drop/dd-drop.js", 415);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 417); nw = (nw + dW);- _yuitest_coverline("build/dd-drop/dd-drop.js", 416);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 418); xy[0] = xy[0] - (dW - dd.deltaXY[0]);- _yuitest_coverline("build/dd-drop/dd-drop.js", 417);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 419); xy[1] = xy[1] - (dH - dd.deltaXY[1]); }- - _yuitest_coverline("build/dd-drop/dd-drop.js", 421);++ _yuitest_coverline("build/dd-drop/dd-drop.js", 423); if (this.get('useShim')) { //Set the style on the shim- _yuitest_coverline("build/dd-drop/dd-drop.js", 423);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 425); this.shim.setStyles({ height: nh + 'px', width: nw + 'px',@@ -602,9 +604,9 @@ } //Create the region to be used by intersect when a drag node is over us.- _yuitest_coverline("build/dd-drop/dd-drop.js", 432);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 434); this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -620,28 +622,28 @@ */ _createShim: function() { //No playground, defer- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_createShim", 447);-_yuitest_coverline("build/dd-drop/dd-drop.js", 449);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_createShim", 449);+_yuitest_coverline("build/dd-drop/dd-drop.js", 451); if (!DDM._pg) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 450);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 452); Y.later(10, this, this._createShim);- _yuitest_coverline("build/dd-drop/dd-drop.js", 451);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 453); return; } //Shim already here, cancel- _yuitest_coverline("build/dd-drop/dd-drop.js", 454);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 456); if (this.shim) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 455);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 457); return; }- _yuitest_coverline("build/dd-drop/dd-drop.js", 457);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 459); var s = this.get('node'); - _yuitest_coverline("build/dd-drop/dd-drop.js", 459);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 461); if (this.get('useShim')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 460);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 462); s = Y.Node.create('<div id="' + this.get(NODE).get('id') + '_shim"></div>');- _yuitest_coverline("build/dd-drop/dd-drop.js", 461);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 463); s.setStyles({ height: this.get(NODE).get(OFFSET_HEIGHT) + 'px', width: this.get(NODE).get(OFFSET_WIDTH) + 'px',@@ -654,17 +656,17 @@ position: 'absolute' }); - _yuitest_coverline("build/dd-drop/dd-drop.js", 473);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 475); DDM._pg.appendChild(s); - _yuitest_coverline("build/dd-drop/dd-drop.js", 475);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 477); s.on('mouseover', Y.bind(this._handleOverEvent, this));- _yuitest_coverline("build/dd-drop/dd-drop.js", 476);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 478); s.on('mouseout', Y.bind(this._handleOutEvent, this)); } - _yuitest_coverline("build/dd-drop/dd-drop.js", 480);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 482); this.shim = s; }, /**@@ -673,39 +675,39 @@ * @description This handles the over target call made from this object or from the DDM */ _handleTargetOver: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleTargetOver", 487);-_yuitest_coverline("build/dd-drop/dd-drop.js", 488);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleTargetOver", 489);+_yuitest_coverline("build/dd-drop/dd-drop.js", 490); if (DDM.isOverTarget(this)) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 489);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 491); this.get(NODE).addClass(DDM.CSS_PREFIX + '-drop-over');- _yuitest_coverline("build/dd-drop/dd-drop.js", 490);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 492); DDM.activeDrop = this;- _yuitest_coverline("build/dd-drop/dd-drop.js", 491);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 493); DDM.otherDrops[this] = this;- _yuitest_coverline("build/dd-drop/dd-drop.js", 492);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 494); if (this.overTarget) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 493);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 495); DDM.activeDrag.fire('drag:over', { drop: this, drag: DDM.activeDrag });- _yuitest_coverline("build/dd-drop/dd-drop.js", 494);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 496); this.fire(EV_DROP_OVER, { drop: this, drag: DDM.activeDrag }); } else { //Prevent an enter before a start..- _yuitest_coverline("build/dd-drop/dd-drop.js", 497);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 499); if (DDM.activeDrag.get('dragging')) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 498);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 500); this.overTarget = true;- _yuitest_coverline("build/dd-drop/dd-drop.js", 499);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 501); this.fire(EV_DROP_ENTER, { drop: this, drag: DDM.activeDrag });- _yuitest_coverline("build/dd-drop/dd-drop.js", 500);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 502); DDM.activeDrag.fire('drag:enter', { drop: this, drag: DDM.activeDrag });- _yuitest_coverline("build/dd-drop/dd-drop.js", 501);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 503); DDM.activeDrag.get(NODE).addClass(DDM.CSS_PREFIX + '-drag-over'); //TODO - Is this needed?? //DDM._handleTargetOver(); } } } else {- _yuitest_coverline("build/dd-drop/dd-drop.js", 507);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 509); this._handleOut(); } },@@ -715,10 +717,10 @@ * @description Handles the mouseover DOM event on the Target Shim */ _handleOverEvent: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleOverEvent", 515);-_yuitest_coverline("build/dd-drop/dd-drop.js", 516);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleOverEvent", 517);+_yuitest_coverline("build/dd-drop/dd-drop.js", 518); this.shim.setStyle('zIndex', '999');- _yuitest_coverline("build/dd-drop/dd-drop.js", 517);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 519); DDM._addActiveShim(this); }, /**@@ -727,10 +729,10 @@ * @description Handles the mouseout DOM event on the Target Shim */ _handleOutEvent: function() {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleOutEvent", 524);-_yuitest_coverline("build/dd-drop/dd-drop.js", 525);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleOutEvent", 526);+_yuitest_coverline("build/dd-drop/dd-drop.js", 527); this.shim.setStyle('zIndex', '1');- _yuitest_coverline("build/dd-drop/dd-drop.js", 526);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 528); DDM._removeActiveShim(this); }, /**@@ -739,29 +741,29 @@ * @description Handles out of target calls/checks */ _handleOut: function(force) {- _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleOut", 533);-_yuitest_coverline("build/dd-drop/dd-drop.js", 534);+ _yuitest_coverfunc("build/dd-drop/dd-drop.js", "_handleOut", 535);+_yuitest_coverline("build/dd-drop/dd-drop.js", 536); if (!DDM.isOverTarget(this) || force) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 535);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 537); if (this.overTarget) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 536);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 538); this.overTarget = false;- _yuitest_coverline("build/dd-drop/dd-drop.js", 537);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 539); if (!force) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 538);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 540); DDM._removeActiveShim(this); }- _yuitest_coverline("build/dd-drop/dd-drop.js", 540);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 542); if (DDM.activeDrag) {- _yuitest_coverline("build/dd-drop/dd-drop.js", 541);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 543); this.get(NODE).removeClass(DDM.CSS_PREFIX + '-drop-over');- _yuitest_coverline("build/dd-drop/dd-drop.js", 542);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 544); DDM.activeDrag.get(NODE).removeClass(DDM.CSS_PREFIX + '-drag-over');- _yuitest_coverline("build/dd-drop/dd-drop.js", 543);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 545); this.fire(EV_DROP_EXIT, { drop: this, drag: DDM.activeDrag });- _yuitest_coverline("build/dd-drop/dd-drop.js", 544);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 546); DDM.activeDrag.fire('drag:exit', { drop: this, drag: DDM.activeDrag });- _yuitest_coverline("build/dd-drop/dd-drop.js", 545);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 547); delete DDM.otherDrops[this]; } }@@ -769,10 +771,10 @@ } }); - _yuitest_coverline("build/dd-drop/dd-drop.js", 552);+ _yuitest_coverline("build/dd-drop/dd-drop.js", 554); Y.DD.Drop = Drop; -}, '3.7.2', {"requires": ["dd-drag", "dd-ddm-drop"]});+}, '3.7.3', {"requires": ["dd-drag", "dd-ddm-drop"]});
bundle/dd-drop/dd-drop-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the ability to create a Drop Target. * @module dd * @submodule dd-drop- */ + */ /** * Provides the ability to create a Drop Target. * @class Drop@@ -31,7 +31,7 @@ * <dl> * <dt>drop</dt><dd>The drop object at the time of the event.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */@@ -43,7 +43,7 @@ * <dl> * <dt>drop</dt><dd>The drop object at the time of the event.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */@@ -65,12 +65,12 @@ * <dt>drop</dt><dd>The best guess on what was dropped on.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd> * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */- + Drop = function() { this._lazyAddAttrs = false; Drop.superclass.constructor.apply(this, arguments);@@ -98,21 +98,21 @@ * @attribute node * @description Y.Node instanace to use as the element to make a Drop Target * @type Node- */ + */ node: { setter: function(node) { var n = Y.one(node); if (!n) { Y.error('DD.Drop: Invalid Node Given: ' + node); }- return n; + return n; } }, /** * @attribute groups * @description Array of groups to add this drop into. * @type Array- */ + */ groups: { value: ['default'], getter: function() {@@ -124,15 +124,15 @@ ret[ret.length] = k; }); return ret;- }, + }, setter: function(g) { this._groups = {};- Y.each(g, function(v, k) {+ Y.each(g, function(v) { this._groups[v] = true; }, this); return g; }- }, + }, /** * @attribute padding * @description CSS style padding to make the Drop Target bigger than the node.@@ -148,7 +148,7 @@ * @attribute lock * @description Set to lock this drop element. * @type Boolean- */ + */ lock: { value: false, setter: function(lock) {@@ -161,9 +161,10 @@ } }, /**+ * Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling.+ * Use bubbleTargets in config. * @deprecated * @attribute bubbles- * @description Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config. * @type Object */ bubbles: {@@ -223,7 +224,7 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- + var ev = [ EV_DROP_OVER, EV_DROP_ENTER,@@ -231,7 +232,7 @@ 'drop:hit' ]; - Y.each(ev, function(v, k) {+ Y.each(ev, function(v) { this.publish(v, { type: v, emitFacade: true,@@ -283,7 +284,7 @@ inGroup: function(groups) { this._valid = false; var ret = false;- Y.each(groups, function(v, k) {+ Y.each(groups, function(v) { if (this._groups[v]) { ret = true; this._valid = true;@@ -296,7 +297,7 @@ * @method initializer * @description Private lifecycle method */- initializer: function(cfg) {+ initializer: function() { Y.later(100, this, this._createEvents); var node = this.get(NODE), id;@@ -306,7 +307,7 @@ } node.addClass(DDM.CSS_PREFIX + '-drop'); //Shouldn't have to do this..- this.set('groups', this.get('groups')); + this.set('groups', this.get('groups')); }, /** * @private@@ -379,8 +380,9 @@ } }, /**+ * Positions and sizes the shim with the raw data from the node,+ * this can be used to programatically adjust the Targets shim for Animation.. * @method sizeShim- * @description Positions and sizes the shim with the raw data from the node, this can be used to programatically adjust the Targets shim for Animation.. */ sizeShim: function() { if (!DDM.activeDrag) {@@ -410,21 +412,21 @@ nh = nh + p.top + p.bottom; xy[0] = xy[0] - p.left; xy[1] = xy[1] - p.top;- + if (DDM.activeDrag.get('dragMode') === DDM.INTERSECT) { //Intersect Mode, make the shim bigger dd = DDM.activeDrag; dH = dd.get(NODE).get(OFFSET_HEIGHT); dW = dd.get(NODE).get(OFFSET_WIDTH);- + nh = (nh + dH); nw = (nw + dW); xy[0] = xy[0] - (dW - dd.deltaXY[0]); xy[1] = xy[1] - (dH - dd.deltaXY[1]); }- + if (this.get('useShim')) { //Set the style on the shim this.shim.setStyles({@@ -437,7 +439,7 @@ //Create the region to be used by intersect when a drag node is over us. this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -561,4 +563,4 @@ -}, '3.7.2', {"requires": ["dd-drag", "dd-ddm-drop"]});+}, '3.7.3', {"requires": ["dd-drag", "dd-ddm-drop"]});
bundle/dd-drop/dd-drop-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-drop",function(e,t){var n="node",r=e.DD.DDM,i="offsetHeight",s="offsetWidth",o="drop:over",u="drop:enter",a="drop:exit",f=function(){this._lazyAddAttrs=!1,f.superclass.constructor.apply(this,arguments),e.on("domready",e.bind(function(){e.later(100,this,this._createShim)},this)),r._regTarget(this)};f.NAME="drop",f.ATTRS={node:{setter:function(t){var n=e.one(t);return n||e.error("DD.Drop: Invalid Node Given: "+t),n}},groups:{value:["default"],getter:function(){this._groups||(this._groups={});var t=[];return e.each(this._groups,function(e,n){t[t.length]=n}),t},setter:function(t){return this._groups={},e.each(t,function(e,t){this._groups[e]=!0},this),t}},padding:{value:"0",setter:function(e){return r.cssSizestoObject(e)}},lock:{value:!1,setter:function(e){return e?this.get(n).addClass(r.CSS_PREFIX+"-drop-locked"):this.get(n).removeClass(r.CSS_PREFIX+"-drop-locked"),e}},bubbles:{setter:function(e){return this.addTarget(e),e}},useShim:{value:!0,setter:function(t){return e.DD.DDM._noShim=!t,t}}},e.extend(f,e.Base,{_bubbleTargets:e.DD.DDM,addToGroup:function(e){return this._groups[e]=!0,this},removeFromGroup:function(e){return delete this._groups[e],this},_createEvents:function(){var t=[o,u,a,"drop:hit"];e.each(t,function(e,t){this.publish(e,{type:e,emitFacade:!0,preventable:!1,bubbles:!0,queuable:!1,prefix:"drop"})},this)},_valid:null,_groups:null,shim:null,region:null,overTarget:null,inGroup:function(t){this._valid=!1;var n=!1;return e.each(t,function(e,t){this._groups[e]&&(n=!0,this._valid=!0)},this),n},initializer:function(t){e.later(100,this,this._createEvents);var i=this.get(n),s;i.get("id")||(s=e.stamp(i),i.set("id",s)),i.addClass(r.CSS_PREFIX+"-drop"),this.set("groups",this.get("groups"))},destructor:function(){r._unregTarget(this),this.shim&&this.shim!==this.get(n)&&(this.shim.detachAll(),this.shim.remove(),this.shim=null),this.get(n).removeClass(r.CSS_PREFIX+"-drop"),this.detachAll()},_deactivateShim:function(){if(!this.shim)return!1;this.get(n).removeClass(r.CSS_PREFIX+"-drop-active-valid"),this.get(n).removeClass(r.CSS_PREFIX+"-drop-active-invalid"),this.get(n).removeClass(r.CSS_PREFIX+"-drop-over"),this.get("useShim")&&this.shim.setStyles({top:"-999px",left:"-999px",zIndex:"1"}),this.overTarget=!1},_activateShim:function(){if(!r.activeDrag)return!1;if(this.get(n)===r.activeDrag.get(n))return!1;if(this.get("lock"))return!1;var e=this.get(n);this.inGroup(r.activeDrag.get("groups"))?(e.removeClass(r.CSS_PREFIX+"-drop-active-invalid"),e.addClass(r.CSS_PREFIX+"-drop-active-valid"),r._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get(n)),this.sizeShim()):(r._removeValid(this),e.removeClass(r.CSS_PREFIX+"-drop-active-valid"),e.addClass(r.CSS_PREFIX+"-drop-active-invalid"))},sizeShim:function(){if(!r.activeDrag)return!1;if(this.get(n)===r.activeDrag.get(n))return!1;if(this.get("lock"))return!1;if(!this.shim)return e.later(100,this,this.sizeShim),!1;var t=this.get(n),o=t.get(i),u=t.get(s),a=t.getXY(),f=this.get("padding"),l,c,h;u=u+f.left+f.right,o=o+f.top+f.bottom,a[0]=a[0]-f.left,a[1]=a[1]-f.top,r.activeDrag.get("dragMode")===r.INTERSECT&&(l=r.activeDrag,c=l.get(n).get(i),h=l.get(n).get(s),o+=c,u+=h,a[0]=a[0]-(h-l.deltaXY[0]),a[1]=a[1]-(c-l.deltaXY[1])),this.get("useShim")&&this.shim.setStyles({height:o+"px",width:u+"px",top:a[1]+"px",left:a[0]+"px"}),this.region={0:a[0],1:a[1],area:0,top:a[1],right:a[0]+u,bottom:a[1]+o,left:a[0]}},_createShim:function(){if(!r._pg){e.later(10,this,this._createShim);return}if(this.shim)return;var t=this.get("node");this.get("useShim")&&(t=e.Node.create('<div id="'+this.get(n).get("id")+'_shim"></div>'),t.setStyles({height:this.get(n).get(i)+"px",width:this.get(n).get(s)+"px",backgroundColor:"yellow",opacity:".5",zIndex:"1",overflow:"hidden",top:"-900px",left:"-900px",position:"absolute"}),r._pg.appendChild(t),t.on("mouseover",e.bind(this._handleOverEvent,this)),t.on("mouseout",e.bind(this._handleOutEvent,this))),this.shim=t},_handleTargetOver:function(){r.isOverTarget(this)?(this.get(n).addClass(r.CSS_PREFIX+"-drop-over"),r.activeDrop=this,r.otherDrops[this]=this,this.overTarget?(r.activeDrag.fire("drag:over",{drop:this,drag:r.activeDrag}),this.fire(o,{drop:this,drag:r.activeDrag})):r.activeDrag.get("dragging")&&(this.overTarget=!0,this.fire(u,{drop:this,drag:r.activeDrag}),r.activeDrag.fire("drag:enter",{drop:this,drag:r.activeDrag}),r.activeDrag.get(n).addClass(r.CSS_PREFIX+"-drag-over"))):this._handleOut()},_handleOverEvent:function(){this.shim.setStyle("zIndex","999"),r._addActiveShim(this)},_handleOutEvent:function(){this.shim.setStyle("zIndex","1"),r._removeActiveShim(this)},_handleOut:function(e){(!r.isOverTarget(this)||e)&&this.overTarget&&(this.overTarget=!1,e||r._removeActiveShim(this),r.activeDrag&&(this.get(n).removeClass(r.CSS_PREFIX+"-drop-over"),r.activeDrag.get(n).removeClass(r.CSS_PREFIX+"-drag-over"),this.fire(a,{drop:this,drag:r.activeDrag}),r.activeDrag.fire("drag:exit",{drop:this,drag:r.activeDrag}),delete r.otherDrops[this]))}}),e.DD.Drop=f},"3.7.2",{requires:["dd-drag","dd-ddm-drop"]});+YUI.add("dd-drop",function(e,t){var n="node",r=e.DD.DDM,i="offsetHeight",s="offsetWidth",o="drop:over",u="drop:enter",a="drop:exit",f=function(){this._lazyAddAttrs=!1,f.superclass.constructor.apply(this,arguments),e.on("domready",e.bind(function(){e.later(100,this,this._createShim)},this)),r._regTarget(this)};f.NAME="drop",f.ATTRS={node:{setter:function(t){var n=e.one(t);return n||e.error("DD.Drop: Invalid Node Given: "+t),n}},groups:{value:["default"],getter:function(){this._groups||(this._groups={});var t=[];return e.each(this._groups,function(e,n){t[t.length]=n}),t},setter:function(t){return this._groups={},e.each(t,function(e){this._groups[e]=!0},this),t}},padding:{value:"0",setter:function(e){return r.cssSizestoObject(e)}},lock:{value:!1,setter:function(e){return e?this.get(n).addClass(r.CSS_PREFIX+"-drop-locked"):this.get(n).removeClass(r.CSS_PREFIX+"-drop-locked"),e}},bubbles:{setter:function(e){return this.addTarget(e),e}},useShim:{value:!0,setter:function(t){return e.DD.DDM._noShim=!t,t}}},e.extend(f,e.Base,{_bubbleTargets:e.DD.DDM,addToGroup:function(e){return this._groups[e]=!0,this},removeFromGroup:function(e){return delete this._groups[e],this},_createEvents:function(){var t=[o,u,a,"drop:hit"];e.each(t,function(e){this.publish(e,{type:e,emitFacade:!0,preventable:!1,bubbles:!0,queuable:!1,prefix:"drop"})},this)},_valid:null,_groups:null,shim:null,region:null,overTarget:null,inGroup:function(t){this._valid=!1;var n=!1;return e.each(t,function(e){this._groups[e]&&(n=!0,this._valid=!0)},this),n},initializer:function(){e.later(100,this,this._createEvents);var t=this.get(n),i;t.get("id")||(i=e.stamp(t),t.set("id",i)),t.addClass(r.CSS_PREFIX+"-drop"),this.set("groups",this.get("groups"))},destructor:function(){r._unregTarget(this),this.shim&&this.shim!==this.get(n)&&(this.shim.detachAll(),this.shim.remove(),this.shim=null),this.get(n).removeClass(r.CSS_PREFIX+"-drop"),this.detachAll()},_deactivateShim:function(){if(!this.shim)return!1;this.get(n).removeClass(r.CSS_PREFIX+"-drop-active-valid"),this.get(n).removeClass(r.CSS_PREFIX+"-drop-active-invalid"),this.get(n).removeClass(r.CSS_PREFIX+"-drop-over"),this.get("useShim")&&this.shim.setStyles({top:"-999px",left:"-999px",zIndex:"1"}),this.overTarget=!1},_activateShim:function(){if(!r.activeDrag)return!1;if(this.get(n)===r.activeDrag.get(n))return!1;if(this.get("lock"))return!1;var e=this.get(n);this.inGroup(r.activeDrag.get("groups"))?(e.removeClass(r.CSS_PREFIX+"-drop-active-invalid"),e.addClass(r.CSS_PREFIX+"-drop-active-valid"),r._addValid(this),this.overTarget=!1,this.get("useShim")||(this.shim=this.get(n)),this.sizeShim()):(r._removeValid(this),e.removeClass(r.CSS_PREFIX+"-drop-active-valid"),e.addClass(r.CSS_PREFIX+"-drop-active-invalid"))},sizeShim:function(){if(!r.activeDrag)return!1;if(this.get(n)===r.activeDrag.get(n))return!1;if(this.get("lock"))return!1;if(!this.shim)return e.later(100,this,this.sizeShim),!1;var t=this.get(n),o=t.get(i),u=t.get(s),a=t.getXY(),f=this.get("padding"),l,c,h;u=u+f.left+f.right,o=o+f.top+f.bottom,a[0]=a[0]-f.left,a[1]=a[1]-f.top,r.activeDrag.get("dragMode")===r.INTERSECT&&(l=r.activeDrag,c=l.get(n).get(i),h=l.get(n).get(s),o+=c,u+=h,a[0]=a[0]-(h-l.deltaXY[0]),a[1]=a[1]-(c-l.deltaXY[1])),this.get("useShim")&&this.shim.setStyles({height:o+"px",width:u+"px",top:a[1]+"px",left:a[0]+"px"}),this.region={0:a[0],1:a[1],area:0,top:a[1],right:a[0]+u,bottom:a[1]+o,left:a[0]}},_createShim:function(){if(!r._pg){e.later(10,this,this._createShim);return}if(this.shim)return;var t=this.get("node");this.get("useShim")&&(t=e.Node.create('<div id="'+this.get(n).get("id")+'_shim"></div>'),t.setStyles({height:this.get(n).get(i)+"px",width:this.get(n).get(s)+"px",backgroundColor:"yellow",opacity:".5",zIndex:"1",overflow:"hidden",top:"-900px",left:"-900px",position:"absolute"}),r._pg.appendChild(t),t.on("mouseover",e.bind(this._handleOverEvent,this)),t.on("mouseout",e.bind(this._handleOutEvent,this))),this.shim=t},_handleTargetOver:function(){r.isOverTarget(this)?(this.get(n).addClass(r.CSS_PREFIX+"-drop-over"),r.activeDrop=this,r.otherDrops[this]=this,this.overTarget?(r.activeDrag.fire("drag:over",{drop:this,drag:r.activeDrag}),this.fire(o,{drop:this,drag:r.activeDrag})):r.activeDrag.get("dragging")&&(this.overTarget=!0,this.fire(u,{drop:this,drag:r.activeDrag}),r.activeDrag.fire("drag:enter",{drop:this,drag:r.activeDrag}),r.activeDrag.get(n).addClass(r.CSS_PREFIX+"-drag-over"))):this._handleOut()},_handleOverEvent:function(){this.shim.setStyle("zIndex","999"),r._addActiveShim(this)},_handleOutEvent:function(){this.shim.setStyle("zIndex","1"),r._removeActiveShim(this)},_handleOut:function(e){(!r.isOverTarget(this)||e)&&this.overTarget&&(this.overTarget=!1,e||r._removeActiveShim(this),r.activeDrag&&(this.get(n).removeClass(r.CSS_PREFIX+"-drop-over"),r.activeDrag.get(n).removeClass(r.CSS_PREFIX+"-drag-over"),this.fire(a,{drop:this,drag:r.activeDrag}),r.activeDrag.fire("drag:exit",{drop:this,drag:r.activeDrag}),delete r.otherDrops[this]))}}),e.DD.Drop=f},"3.7.3",{requires:["dd-drag","dd-ddm-drop"]});
bundle/dd-drop/dd-drop.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,7 +11,7 @@ * Provides the ability to create a Drop Target. * @module dd * @submodule dd-drop- */ + */ /** * Provides the ability to create a Drop Target. * @class Drop@@ -31,7 +31,7 @@ * <dl> * <dt>drop</dt><dd>The drop object at the time of the event.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */@@ -43,7 +43,7 @@ * <dl> * <dt>drop</dt><dd>The drop object at the time of the event.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */@@ -65,12 +65,12 @@ * <dt>drop</dt><dd>The best guess on what was dropped on.</dd> * <dt>drag</dt><dd>The drag object at the time of the event.</dd> * <dt>others</dt><dd>An array of all the other drop targets that was dropped on.</dd>- * </dl> + * </dl> * @bubbles DDM * @type {CustomEvent} */- + Drop = function() { this._lazyAddAttrs = false; Drop.superclass.constructor.apply(this, arguments);@@ -98,21 +98,21 @@ * @attribute node * @description Y.Node instanace to use as the element to make a Drop Target * @type Node- */ + */ node: { setter: function(node) { var n = Y.one(node); if (!n) { Y.error('DD.Drop: Invalid Node Given: ' + node); }- return n; + return n; } }, /** * @attribute groups * @description Array of groups to add this drop into. * @type Array- */ + */ groups: { value: ['default'], getter: function() {@@ -124,15 +124,15 @@ ret[ret.length] = k; }); return ret;- }, + }, setter: function(g) { this._groups = {};- Y.each(g, function(v, k) {+ Y.each(g, function(v) { this._groups[v] = true; }, this); return g; }- }, + }, /** * @attribute padding * @description CSS style padding to make the Drop Target bigger than the node.@@ -148,7 +148,7 @@ * @attribute lock * @description Set to lock this drop element. * @type Boolean- */ + */ lock: { value: false, setter: function(lock) {@@ -161,9 +161,10 @@ } }, /**+ * Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling.+ * Use bubbleTargets in config. * @deprecated * @attribute bubbles- * @description Controls the default bubble parent for this Drop instance. Default: Y.DD.DDM. Set to false to disable bubbling. Use bubbleTargets in config. * @type Object */ bubbles: {@@ -222,7 +223,7 @@ * @description This method creates all the events for this Event Target and publishes them so we get Event Bubbling. */ _createEvents: function() {- + var ev = [ EV_DROP_OVER, EV_DROP_ENTER,@@ -230,7 +231,7 @@ 'drop:hit' ]; - Y.each(ev, function(v, k) {+ Y.each(ev, function(v) { this.publish(v, { type: v, emitFacade: true,@@ -282,7 +283,7 @@ inGroup: function(groups) { this._valid = false; var ret = false;- Y.each(groups, function(v, k) {+ Y.each(groups, function(v) { if (this._groups[v]) { ret = true; this._valid = true;@@ -295,7 +296,7 @@ * @method initializer * @description Private lifecycle method */- initializer: function(cfg) {+ initializer: function() { Y.later(100, this, this._createEvents); var node = this.get(NODE), id;@@ -305,7 +306,7 @@ } node.addClass(DDM.CSS_PREFIX + '-drop'); //Shouldn't have to do this..- this.set('groups', this.get('groups')); + this.set('groups', this.get('groups')); }, /** * @private@@ -378,8 +379,9 @@ } }, /**+ * Positions and sizes the shim with the raw data from the node,+ * this can be used to programatically adjust the Targets shim for Animation.. * @method sizeShim- * @description Positions and sizes the shim with the raw data from the node, this can be used to programatically adjust the Targets shim for Animation.. */ sizeShim: function() { if (!DDM.activeDrag) {@@ -409,21 +411,21 @@ nh = nh + p.top + p.bottom; xy[0] = xy[0] - p.left; xy[1] = xy[1] - p.top;- + if (DDM.activeDrag.get('dragMode') === DDM.INTERSECT) { //Intersect Mode, make the shim bigger dd = DDM.activeDrag; dH = dd.get(NODE).get(OFFSET_HEIGHT); dW = dd.get(NODE).get(OFFSET_WIDTH);- + nh = (nh + dH); nw = (nw + dW); xy[0] = xy[0] - (dW - dd.deltaXY[0]); xy[1] = xy[1] - (dH - dd.deltaXY[1]); }- + if (this.get('useShim')) { //Set the style on the shim this.shim.setStyles({@@ -436,7 +438,7 @@ //Create the region to be used by intersect when a drag node is over us. this.region = {- '0': xy[0], + '0': xy[0], '1': xy[1], area: 0, top: xy[1],@@ -560,4 +562,4 @@ -}, '3.7.2', {"requires": ["dd-drag", "dd-ddm-drop"]});+}, '3.7.3', {"requires": ["dd-drag", "dd-ddm-drop"]});
bundle/dd-gestures/dd-gestures-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/dd-gestures/dd-gestures.js", code: [] };-_yuitest_coverage["build/dd-gestures/dd-gestures.js"].code=["YUI.add('dd-gestures', function (Y, NAME) {","",""," /**"," * This module is the conditional loaded `dd` module to support gesture events"," * in the event that `dd` is loaded onto a device that support touch based events."," *"," * This module is loaded and over rides 2 key methods on `DD.Drag` and `DD.DDM` to"," * attach the gesture events. Overrides `DD.Drag._prep` and `DD.DDM._setupListeners`"," * methods as well as set's the property `DD.Drag.START_EVENT` to `gesturemovestart`"," * to enable gesture movement instead of mouse based movement."," * @module dd"," * @submodule dd-gestures"," */"," "," Y.DD.Drag.START_EVENT = 'gesturemovestart';",""," Y.DD.Drag.prototype._prep = function() {"," this._dragThreshMet = false;"," var node = this.get('node'), DDM = Y.DD.DDM;",""," node.addClass(DDM.CSS_PREFIX + '-draggable');",""," node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {"," minDistance: 0,"," minTime: 0"," });",""," node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });"," node.on('dragstart', Y.bind(this._fixDragStart, this));",""," };",""," Y.DD.DDM._setupListeners = function() {"," var DDM = Y.DD.DDM;",""," this._createPG();"," this._active = true;"," Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), { standAlone: true });"," };","","","","}, '3.7.2', {\"requires\": [\"dd-drag\", \"event-synthetic\", \"event-gestures\"]});"];-_yuitest_coverage["build/dd-gestures/dd-gestures.js"].lines = {"1":0,"16":0,"18":0,"19":0,"20":0,"22":0,"24":0,"29":0,"30":0,"34":0,"35":0,"37":0,"38":0,"39":0};-_yuitest_coverage["build/dd-gestures/dd-gestures.js"].functions = {"_prep:18":0,"_setupListeners:34":0,"(anonymous 1):1":0};-_yuitest_coverage["build/dd-gestures/dd-gestures.js"].coveredLines = 14;-_yuitest_coverage["build/dd-gestures/dd-gestures.js"].coveredFunctions = 3;+_yuitest_coverage["build/dd-gestures/dd-gestures.js"].code=["YUI.add('dd-gestures', function (Y, NAME) {","",""," /**"," * This module is the conditional loaded `dd` module to support gesture events"," * in the event that `dd` is loaded onto a device that support touch based events."," *"," * This module is loaded and over rides 2 key methods on `DD.Drag` and `DD.DDM` to"," * attach the gesture events. Overrides `DD.Drag._prep` and `DD.DDM._setupListeners`"," * methods as well as set's the property `DD.Drag.START_EVENT` to `gesturemovestart`"," * to enable gesture movement instead of mouse based movement."," * @module dd"," * @submodule dd-gestures"," */",""," Y.DD.Drag.START_EVENT = 'gesturemovestart';",""," Y.DD.Drag.prototype._prep = function() {"," this._dragThreshMet = false;"," var node = this.get('node'), DDM = Y.DD.DDM;",""," node.addClass(DDM.CSS_PREFIX + '-draggable');",""," node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {"," minDistance: this.get('clickPixelThresh'),"," minTime: this.get('clickTimeThresh')"," });",""," node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });"," node.on('dragstart', Y.bind(this._fixDragStart, this));",""," };",""," var _unprep = Y.DD.Drag.prototype._unprep;",""," Y.DD.Drag.prototype._unprep = function() {"," var node = this.get('node');"," _unprep.call(this);"," node.detachAll('gesturemoveend');"," };",""," Y.DD.DDM._setupListeners = function() {"," var DDM = Y.DD.DDM;",""," this._createPG();"," this._active = true;"," Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), { standAlone: true });"," };","","","","}, '3.7.3', {\"requires\": [\"dd-drag\", \"event-synthetic\", \"event-gestures\"]});"];+_yuitest_coverage["build/dd-gestures/dd-gestures.js"].lines = {"1":0,"16":0,"18":0,"19":0,"20":0,"22":0,"24":0,"29":0,"30":0,"34":0,"36":0,"37":0,"38":0,"39":0,"42":0,"43":0,"45":0,"46":0,"47":0};+_yuitest_coverage["build/dd-gestures/dd-gestures.js"].functions = {"_prep:18":0,"_unprep:36":0,"_setupListeners:42":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dd-gestures/dd-gestures.js"].coveredLines = 19;+_yuitest_coverage["build/dd-gestures/dd-gestures.js"].coveredFunctions = 4; _yuitest_coverline("build/dd-gestures/dd-gestures.js", 1); YUI.add('dd-gestures', function (Y, NAME) { @@ -52,7 +52,7 @@ * @module dd * @submodule dd-gestures */- + _yuitest_coverfunc("build/dd-gestures/dd-gestures.js", "(anonymous 1)", 1); _yuitest_coverline("build/dd-gestures/dd-gestures.js", 16); Y.DD.Drag.START_EVENT = 'gesturemovestart';@@ -70,8 +70,8 @@ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 24); node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {- minDistance: 0,- minTime: 0+ minDistance: this.get('clickPixelThresh'),+ minTime: this.get('clickTimeThresh') }); _yuitest_coverline("build/dd-gestures/dd-gestures.js", 29);@@ -82,19 +82,33 @@ }; _yuitest_coverline("build/dd-gestures/dd-gestures.js", 34);+var _unprep = Y.DD.Drag.prototype._unprep;++ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 36);+Y.DD.Drag.prototype._unprep = function() {+ _yuitest_coverfunc("build/dd-gestures/dd-gestures.js", "_unprep", 36);+_yuitest_coverline("build/dd-gestures/dd-gestures.js", 37);+var node = this.get('node');+ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 38);+_unprep.call(this);+ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 39);+node.detachAll('gesturemoveend');+ };++ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 42); Y.DD.DDM._setupListeners = function() {- _yuitest_coverfunc("build/dd-gestures/dd-gestures.js", "_setupListeners", 34);-_yuitest_coverline("build/dd-gestures/dd-gestures.js", 35);+ _yuitest_coverfunc("build/dd-gestures/dd-gestures.js", "_setupListeners", 42);+_yuitest_coverline("build/dd-gestures/dd-gestures.js", 43); var DDM = Y.DD.DDM; - _yuitest_coverline("build/dd-gestures/dd-gestures.js", 37);+ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 45); this._createPG();- _yuitest_coverline("build/dd-gestures/dd-gestures.js", 38);+ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 46); this._active = true;- _yuitest_coverline("build/dd-gestures/dd-gestures.js", 39);+ _yuitest_coverline("build/dd-gestures/dd-gestures.js", 47); Y.one(Y.config.doc).on('gesturemove', Y.throttle(Y.bind(DDM._move, DDM), DDM.get('throttleTime')), { standAlone: true }); }; -}, '3.7.2', {"requires": ["dd-drag", "event-synthetic", "event-gestures"]});+}, '3.7.3', {"requires": ["dd-drag", "event-synthetic", "event-gestures"]});
bundle/dd-gestures/dd-gestures-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ * @submodule dd-gestures */ Y.log('Drag gesture support loaded', 'info', 'drag-gestures');- + Y.DD.Drag.START_EVENT = 'gesturemovestart'; Y.DD.Drag.prototype._prep = function() {@@ -30,8 +30,8 @@ node.addClass(DDM.CSS_PREFIX + '-draggable'); node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {- minDistance: 0,- minTime: 0+ minDistance: this.get('clickPixelThresh'),+ minTime: this.get('clickTimeThresh') }); node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });@@ -39,6 +39,14 @@ }; + var _unprep = Y.DD.Drag.prototype._unprep;++ Y.DD.Drag.prototype._unprep = function() {+ var node = this.get('node');+ _unprep.call(this);+ node.detachAll('gesturemoveend');+ };+ Y.DD.DDM._setupListeners = function() { var DDM = Y.DD.DDM; @@ -49,4 +57,4 @@ -}, '3.7.2', {"requires": ["dd-drag", "event-synthetic", "event-gestures"]});+}, '3.7.3', {"requires": ["dd-drag", "event-synthetic", "event-gestures"]});
bundle/dd-gestures/dd-gestures-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-gestures",function(e,t){e.DD.Drag.START_EVENT="gesturemovestart",e.DD.Drag.prototype._prep=function(){this._dragThreshMet=!1;var t=this.get("node"),n=e.DD.DDM;t.addClass(n.CSS_PREFIX+"-draggable"),t.on(e.DD.Drag.START_EVENT,e.bind(this._handleMouseDownEvent,this),{minDistance:0,minTime:0}),t.on("gesturemoveend",e.bind(this._handleMouseUp,this),{standAlone:!0}),t.on("dragstart",e.bind(this._fixDragStart,this))},e.DD.DDM._setupListeners=function(){var t=e.DD.DDM;this._createPG(),this._active=!0,e.one(e.config.doc).on("gesturemove",e.throttle(e.bind(t._move,t),t.get("throttleTime")),{standAlone:!0})}},"3.7.2",{requires:["dd-drag","event-synthetic","event-gestures"]});+YUI.add("dd-gestures",function(e,t){e.DD.Drag.START_EVENT="gesturemovestart",e.DD.Drag.prototype._prep=function(){this._dragThreshMet=!1;var t=this.get("node"),n=e.DD.DDM;t.addClass(n.CSS_PREFIX+"-draggable"),t.on(e.DD.Drag.START_EVENT,e.bind(this._handleMouseDownEvent,this),{minDistance:this.get("clickPixelThresh"),minTime:this.get("clickTimeThresh")}),t.on("gesturemoveend",e.bind(this._handleMouseUp,this),{standAlone:!0}),t.on("dragstart",e.bind(this._fixDragStart,this))};var n=e.DD.Drag.prototype._unprep;e.DD.Drag.prototype._unprep=function(){var e=this.get("node");n.call(this),e.detachAll("gesturemoveend")},e.DD.DDM._setupListeners=function(){var t=e.DD.DDM;this._createPG(),this._active=!0,e.one(e.config.doc).on("gesturemove",e.throttle(e.bind(t._move,t),t.get("throttleTime")),{standAlone:!0})}},"3.7.3",{requires:["dd-drag","event-synthetic","event-gestures"]});
bundle/dd-gestures/dd-gestures.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -18,7 +18,7 @@ * @module dd * @submodule dd-gestures */- + Y.DD.Drag.START_EVENT = 'gesturemovestart'; Y.DD.Drag.prototype._prep = function() {@@ -28,8 +28,8 @@ node.addClass(DDM.CSS_PREFIX + '-draggable'); node.on(Y.DD.Drag.START_EVENT, Y.bind(this._handleMouseDownEvent, this), {- minDistance: 0,- minTime: 0+ minDistance: this.get('clickPixelThresh'),+ minTime: this.get('clickTimeThresh') }); node.on('gesturemoveend', Y.bind(this._handleMouseUp, this), { standAlone: true });@@ -37,6 +37,14 @@ }; + var _unprep = Y.DD.Drag.prototype._unprep;++ Y.DD.Drag.prototype._unprep = function() {+ var node = this.get('node');+ _unprep.call(this);+ node.detachAll('gesturemoveend');+ };+ Y.DD.DDM._setupListeners = function() { var DDM = Y.DD.DDM; @@ -47,4 +55,4 @@ -}, '3.7.2', {"requires": ["dd-drag", "event-synthetic", "event-gestures"]});+}, '3.7.3', {"requires": ["dd-drag", "event-synthetic", "event-gestures"]});
bundle/dd-plugin/dd-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dd-plugin/dd-plugin.js", code: [] };-_yuitest_coverage["build/dd-plugin/dd-plugin.js"].code=["YUI.add('dd-plugin', function (Y, NAME) {","","",""," /**"," * Simple Drag plugin that can be attached to a Node or Widget via the plug method."," * @module dd"," * @submodule dd-plugin"," */"," /**"," * Simple Drag plugin that can be attached to a Node or Widget via the plug method."," * @class Drag"," * @extends DD.Drag"," * @constructor"," * @namespace Plugin"," */"," var Drag = function(config) {"," if (Y.Widget && config.host instanceof Y.Widget) {"," config.node = config.host.get('boundingBox');"," config.widget = config.host;"," } else {"," config.node = config.host;"," config.widget = false;"," }"," Drag.superclass.constructor.call(this, config);"," },",""," EV_START = 'drag:start',"," EV_DRAG = 'drag:drag',"," EV_DRAG_END = 'drag:end';"," "," /**"," * @property NAME"," * @description dd-plugin"," * @type {String}"," */"," Drag.NAME = \"dd-plugin\";",""," /**"," * @property NS"," * @description The Drag instance will be placed on the Node instance under the dd namespace. It can be accessed via Node.dd;"," * @type {String}"," */"," Drag.NS = \"dd\";",""," Y.extend(Drag, Y.DD.Drag, {"," "," _widgetHandles: null,"," "," /**"," * refers to a Y.Widget if its the host, otherwise = false."," *"," * @attribute _widget"," * @private"," */"," _widget: undefined,",""," "," /**"," * refers to the [x,y] coordinate where the drag was stopped last"," *"," * @attribute _stoppedPosition"," * @private"," */"," _stoppedPosition: undefined,","",""," /**"," * Returns true if widget uses widgetPosition, otherwise returns false"," *"," * @method _usesWidgetPosition"," * @private"," */"," _usesWidgetPosition: function(widget) {"," var r = false;"," if (widget) {"," r = (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) ? true : false;"," }"," return r;"," },"," /**"," * Attached to the `drag:start` event, it checks if this plugin needs"," * to attach or detach listeners for widgets. If `dd-proxy` is plugged"," * the default widget positioning should be ignored."," * @method _checkEvents"," * @private"," */"," _checkEvents: function() {"," if (this._widget) {"," //It's a widget"," if (this.proxy) {"," //It's a proxy"," if (this._widgetHandles.length > 0) {"," //Remove Listeners"," this._removeWidgetListeners();"," }"," } else {"," if (this._widgetHandles.length === 0) {"," this._attachWidgetListeners();"," }"," }"," }"," },"," /**"," * Remove the attached widget listeners"," * @method _removeWidgetListeners"," * @private"," */"," _removeWidgetListeners: function() {"," Y.Array.each(this._widgetHandles, function(handle) {"," handle.detach();"," });"," this._widgetHandles = [];"," },"," /**"," * If this is a Widget, then attach the positioning listeners"," * @method _attachWidgetListeners"," * @private"," */"," _attachWidgetListeners: function() {"," //if this thing is a widget, and it uses widgetposition..."," if (this._usesWidgetPosition(this._widget)) {"," "," //set the x,y on the widget's ATTRS"," this._widgetHandles.push(this.on(EV_DRAG, this._setWidgetCoords));",""," //store the new position that the widget ends up on"," this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); "," }"," },"," /**"," * Sets up event listeners on drag events if interacting with a widget"," *"," * @method initializer"," * @protected"," */"," initializer: function(config) {"," "," this._widgetHandles = [];",""," this._widget = config.widget;",""," this.on(EV_START, this._checkEvents); //Always run, don't check"," "," this._attachWidgetListeners();"," "," },",""," /**"," * Updates x,y or xy attributes on widget based on where the widget is dragged"," *"," * @method initializer"," * @param {EventFacade} e Event Facade"," * @private"," */"," _setWidgetCoords: function(e) {",""," //get the last position where the widget was, or get the starting point"," var nodeXY = this._stoppedPosition || e.target.nodeXY,"," realXY = e.target.realXY,",""," //amount moved = [(x2 - x1) , (y2 - y1)]"," movedXY = [realXY[0] - nodeXY[0], realXY[1] - nodeXY[1]];",""," //if both have changed.."," if (movedXY[0] !== 0 && movedXY[1] !== 0) {"," this._widget.set('xy', realXY);"," }",""," //if only x is 0, set the Y"," else if (movedXY[0] === 0) {"," this._widget.set('y',realXY[1]);"," }",""," //otherwise, y is 0, so set X"," else if (movedXY[1] === 0){"," this._widget.set('x', realXY[0]);"," }"," },",""," /**"," * Updates the last position where the widget was stopped."," *"," * @method _updateStopPosition"," * @param {EventFacade} e Event Facade"," * @private"," */"," _updateStopPosition: function(e) {"," this._stoppedPosition = e.target.realXY;"," }"," });",""," Y.namespace('Plugin');"," Y.Plugin.Drag = Drag;","","","","","","}, '3.7.2', {\"optional\": [\"dd-constrain\", \"dd-proxy\"], \"requires\": [\"dd-drag\"]});"];+_yuitest_coverage["build/dd-plugin/dd-plugin.js"].code=["YUI.add('dd-plugin', function (Y, NAME) {","","",""," /**"," * Simple Drag plugin that can be attached to a Node or Widget via the plug method."," * @module dd"," * @submodule dd-plugin"," */"," /**"," * Simple Drag plugin that can be attached to a Node or Widget via the plug method."," * @class Drag"," * @extends DD.Drag"," * @constructor"," * @namespace Plugin"," */"," var Drag = function(config) {"," if (Y.Widget && config.host instanceof Y.Widget) {"," config.node = config.host.get('boundingBox');"," config.widget = config.host;"," } else {"," config.node = config.host;"," config.widget = false;"," }"," Drag.superclass.constructor.call(this, config);"," },",""," EV_START = 'drag:start',"," EV_DRAG = 'drag:drag',"," EV_DRAG_END = 'drag:end';",""," /**"," * @property NAME"," * @description dd-plugin"," * @type {String}"," */"," Drag.NAME = \"dd-plugin\";",""," /**"," * @property NS"," * @description The Drag instance will be placed on the Node instance under the dd namespace. It can be accessed via Node.dd;"," * @type {String}"," */"," Drag.NS = \"dd\";",""," Y.extend(Drag, Y.DD.Drag, {",""," _widgetHandles: null,",""," /**"," * refers to a Y.Widget if its the host, otherwise = false."," *"," * @attribute _widget"," * @private"," */"," _widget: undefined,","",""," /**"," * refers to the [x,y] coordinate where the drag was stopped last"," *"," * @attribute _stoppedPosition"," * @private"," */"," _stoppedPosition: undefined,","",""," /**"," * Returns true if widget uses widgetPosition, otherwise returns false"," *"," * @method _usesWidgetPosition"," * @private"," */"," _usesWidgetPosition: function(widget) {"," var r = false;"," if (widget) {"," r = (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) ? true : false;"," }"," return r;"," },"," /**"," * Attached to the `drag:start` event, it checks if this plugin needs"," * to attach or detach listeners for widgets. If `dd-proxy` is plugged"," * the default widget positioning should be ignored."," * @method _checkEvents"," * @private"," */"," _checkEvents: function() {"," if (this._widget) {"," //It's a widget"," if (this.proxy) {"," //It's a proxy"," if (this._widgetHandles.length > 0) {"," //Remove Listeners"," this._removeWidgetListeners();"," }"," } else {"," if (this._widgetHandles.length === 0) {"," this._attachWidgetListeners();"," }"," }"," }"," },"," /**"," * Remove the attached widget listeners"," * @method _removeWidgetListeners"," * @private"," */"," _removeWidgetListeners: function() {"," Y.Array.each(this._widgetHandles, function(handle) {"," handle.detach();"," });"," this._widgetHandles = [];"," },"," /**"," * If this is a Widget, then attach the positioning listeners"," * @method _attachWidgetListeners"," * @private"," */"," _attachWidgetListeners: function() {"," //if this thing is a widget, and it uses widgetposition..."," if (this._usesWidgetPosition(this._widget)) {",""," //set the x,y on the widget's ATTRS"," this._widgetHandles.push(this.on(EV_DRAG, this._setWidgetCoords));",""," //store the new position that the widget ends up on"," this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition));"," }"," },"," /**"," * Sets up event listeners on drag events if interacting with a widget"," *"," * @method initializer"," * @protected"," */"," initializer: function(config) {",""," this._widgetHandles = [];",""," this._widget = config.widget;",""," this.on(EV_START, this._checkEvents); //Always run, don't check",""," this._attachWidgetListeners();",""," },",""," /**"," * Updates x,y or xy attributes on widget based on where the widget is dragged"," *"," * @method initializer"," * @param {EventFacade} e Event Facade"," * @private"," */"," _setWidgetCoords: function(e) {",""," //get the last position where the widget was, or get the starting point"," var nodeXY = this._stoppedPosition || e.target.nodeXY,"," realXY = e.target.realXY,",""," //amount moved = [(x2 - x1) , (y2 - y1)]"," movedXY = [realXY[0] - nodeXY[0], realXY[1] - nodeXY[1]];",""," //if both have changed.."," if (movedXY[0] !== 0 && movedXY[1] !== 0) {"," this._widget.set('xy', realXY);"," }",""," //if only x is 0, set the Y"," else if (movedXY[0] === 0) {"," this._widget.set('y',realXY[1]);"," }",""," //otherwise, y is 0, so set X"," else if (movedXY[1] === 0){"," this._widget.set('x', realXY[0]);"," }"," },",""," /**"," * Updates the last position where the widget was stopped."," *"," * @method _updateStopPosition"," * @param {EventFacade} e Event Facade"," * @private"," */"," _updateStopPosition: function(e) {"," this._stoppedPosition = e.target.realXY;"," }"," });",""," Y.namespace('Plugin');"," Y.Plugin.Drag = Drag;","","","","","","}, '3.7.3', {\"optional\": [\"dd-constrain\", \"dd-proxy\"], \"requires\": [\"dd-drag\"]});"]; _yuitest_coverage["build/dd-plugin/dd-plugin.js"].lines = {"1":0,"17":0,"18":0,"19":0,"20":0,"22":0,"23":0,"25":0,"37":0,"44":0,"46":0,"75":0,"76":0,"77":0,"79":0,"89":0,"91":0,"93":0,"95":0,"98":0,"99":0,"110":0,"111":0,"113":0,"122":0,"125":0,"128":0,"139":0,"141":0,"143":0,"145":0,"159":0,"166":0,"167":0,"171":0,"172":0,"176":0,"177":0,"189":0,"193":0,"194":0}; _yuitest_coverage["build/dd-plugin/dd-plugin.js"].functions = {"Drag:17":0,"_usesWidgetPosition:74":0,"_checkEvents:88":0,"(anonymous 2):110":0,"_removeWidgetListeners:109":0,"_attachWidgetListeners:120":0,"initializer:137":0,"_setWidgetCoords:156":0,"_updateStopPosition:188":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-plugin/dd-plugin.js"].coveredLines = 41;@@ -77,7 +77,7 @@ EV_START = 'drag:start', EV_DRAG = 'drag:drag', EV_DRAG_END = 'drag:end';- + /** * @property NAME * @description dd-plugin@@ -96,9 +96,9 @@ _yuitest_coverline("build/dd-plugin/dd-plugin.js", 46); Y.extend(Drag, Y.DD.Drag, {- + _widgetHandles: null,- + /** * refers to a Y.Widget if its the host, otherwise = false. *@@ -107,7 +107,7 @@ */ _widget: undefined, - + /** * refers to the [x,y] coordinate where the drag was stopped last *@@ -191,14 +191,14 @@ _yuitest_coverfunc("build/dd-plugin/dd-plugin.js", "_attachWidgetListeners", 120); _yuitest_coverline("build/dd-plugin/dd-plugin.js", 122); if (this._usesWidgetPosition(this._widget)) {- + //set the x,y on the widget's ATTRS _yuitest_coverline("build/dd-plugin/dd-plugin.js", 125); this._widgetHandles.push(this.on(EV_DRAG, this._setWidgetCoords)); //store the new position that the widget ends up on _yuitest_coverline("build/dd-plugin/dd-plugin.js", 128);-this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); +this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); } }, /**@@ -208,7 +208,7 @@ * @protected */ initializer: function(config) {- + _yuitest_coverfunc("build/dd-plugin/dd-plugin.js", "initializer", 137); _yuitest_coverline("build/dd-plugin/dd-plugin.js", 139); this._widgetHandles = [];@@ -218,10 +218,10 @@ _yuitest_coverline("build/dd-plugin/dd-plugin.js", 143); this.on(EV_START, this._checkEvents); //Always run, don't check- + _yuitest_coverline("build/dd-plugin/dd-plugin.js", 145); this._attachWidgetListeners();- + }, /**@@ -287,4 +287,4 @@ -}, '3.7.2', {"optional": ["dd-constrain", "dd-proxy"], "requires": ["dd-drag"]});+}, '3.7.3', {"optional": ["dd-constrain", "dd-proxy"], "requires": ["dd-drag"]});
bundle/dd-plugin/dd-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -34,7 +34,7 @@ EV_START = 'drag:start', EV_DRAG = 'drag:drag', EV_DRAG_END = 'drag:end';- + /** * @property NAME * @description dd-plugin@@ -50,9 +50,9 @@ Drag.NS = "dd"; Y.extend(Drag, Y.DD.Drag, {- + _widgetHandles: null,- + /** * refers to a Y.Widget if its the host, otherwise = false. *@@ -61,7 +61,7 @@ */ _widget: undefined, - + /** * refers to the [x,y] coordinate where the drag was stopped last *@@ -131,12 +131,12 @@ //if this thing is a widget, and it uses widgetposition... if (this._usesWidgetPosition(this._widget)) { Y.log('Attaching widget events', 'info', 'dd-plugin');- + //set the x,y on the widget's ATTRS this._widgetHandles.push(this.on(EV_DRAG, this._setWidgetCoords)); //store the new position that the widget ends up on- this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); + this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); } }, /**@@ -146,15 +146,15 @@ * @protected */ initializer: function(config) {- + this._widgetHandles = []; this._widget = config.widget; this.on(EV_START, this._checkEvents); //Always run, don't check- + this._attachWidgetListeners();- + }, /**@@ -208,4 +208,4 @@ -}, '3.7.2', {"optional": ["dd-constrain", "dd-proxy"], "requires": ["dd-drag"]});+}, '3.7.3', {"optional": ["dd-constrain", "dd-proxy"], "requires": ["dd-drag"]});
bundle/dd-plugin/dd-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-plugin",function(e,t){var n=function(t){e.Widget&&t.host instanceof e.Widget?(t.node=t.host.get("boundingBox"),t.widget=t.host):(t.node=t.host,t.widget=!1),n.superclass.constructor.call(this,t)},r="drag:start",i="drag:drag",s="drag:end";n.NAME="dd-plugin",n.NS="dd",e.extend(n,e.DD.Drag,{_widgetHandles:null,_widget:undefined,_stoppedPosition:undefined,_usesWidgetPosition:function(t){var n=!1;return t&&(n=t.hasImpl&&t.hasImpl(e.WidgetPosition)?!0:!1),n},_checkEvents:function(){this._widget&&(this.proxy?this._widgetHandles.length>0&&this._removeWidgetListeners():this._widgetHandles.length===0&&this._attachWidgetListeners())},_removeWidgetListeners:function(){e.Array.each(this._widgetHandles,function(e){e.detach()}),this._widgetHandles=[]},_attachWidgetListeners:function(){this._usesWidgetPosition(this._widget)&&(this._widgetHandles.push(this.on(i,this._setWidgetCoords)),this._widgetHandles.push(this.on(s,this._updateStopPosition)))},initializer:function(e){this._widgetHandles=[],this._widget=e.widget,this.on(r,this._checkEvents),this._attachWidgetListeners()},_setWidgetCoords:function(e){var t=this._stoppedPosition||e.target.nodeXY,n=e.target.realXY,r=[n[0]-t[0],n[1]-t[1]];r[0]!==0&&r[1]!==0?this._widget.set("xy",n):r[0]===0?this._widget.set("y",n[1]):r[1]===0&&this._widget.set("x",n[0])},_updateStopPosition:function(e){this._stoppedPosition=e.target.realXY}}),e.namespace("Plugin"),e.Plugin.Drag=n},"3.7.2",{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]});+YUI.add("dd-plugin",function(e,t){var n=function(t){e.Widget&&t.host instanceof e.Widget?(t.node=t.host.get("boundingBox"),t.widget=t.host):(t.node=t.host,t.widget=!1),n.superclass.constructor.call(this,t)},r="drag:start",i="drag:drag",s="drag:end";n.NAME="dd-plugin",n.NS="dd",e.extend(n,e.DD.Drag,{_widgetHandles:null,_widget:undefined,_stoppedPosition:undefined,_usesWidgetPosition:function(t){var n=!1;return t&&(n=t.hasImpl&&t.hasImpl(e.WidgetPosition)?!0:!1),n},_checkEvents:function(){this._widget&&(this.proxy?this._widgetHandles.length>0&&this._removeWidgetListeners():this._widgetHandles.length===0&&this._attachWidgetListeners())},_removeWidgetListeners:function(){e.Array.each(this._widgetHandles,function(e){e.detach()}),this._widgetHandles=[]},_attachWidgetListeners:function(){this._usesWidgetPosition(this._widget)&&(this._widgetHandles.push(this.on(i,this._setWidgetCoords)),this._widgetHandles.push(this.on(s,this._updateStopPosition)))},initializer:function(e){this._widgetHandles=[],this._widget=e.widget,this.on(r,this._checkEvents),this._attachWidgetListeners()},_setWidgetCoords:function(e){var t=this._stoppedPosition||e.target.nodeXY,n=e.target.realXY,r=[n[0]-t[0],n[1]-t[1]];r[0]!==0&&r[1]!==0?this._widget.set("xy",n):r[0]===0?this._widget.set("y",n[1]):r[1]===0&&this._widget.set("x",n[0])},_updateStopPosition:function(e){this._stoppedPosition=e.target.realXY}}),e.namespace("Plugin"),e.Plugin.Drag=n},"3.7.3",{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]});
bundle/dd-plugin/dd-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -34,7 +34,7 @@ EV_START = 'drag:start', EV_DRAG = 'drag:drag', EV_DRAG_END = 'drag:end';- + /** * @property NAME * @description dd-plugin@@ -50,9 +50,9 @@ Drag.NS = "dd"; Y.extend(Drag, Y.DD.Drag, {- + _widgetHandles: null,- + /** * refers to a Y.Widget if its the host, otherwise = false. *@@ -61,7 +61,7 @@ */ _widget: undefined, - + /** * refers to the [x,y] coordinate where the drag was stopped last *@@ -126,12 +126,12 @@ _attachWidgetListeners: function() { //if this thing is a widget, and it uses widgetposition... if (this._usesWidgetPosition(this._widget)) {- + //set the x,y on the widget's ATTRS this._widgetHandles.push(this.on(EV_DRAG, this._setWidgetCoords)); //store the new position that the widget ends up on- this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); + this._widgetHandles.push(this.on(EV_DRAG_END, this._updateStopPosition)); } }, /**@@ -141,15 +141,15 @@ * @protected */ initializer: function(config) {- + this._widgetHandles = []; this._widget = config.widget; this.on(EV_START, this._checkEvents); //Always run, don't check- + this._attachWidgetListeners();- + }, /**@@ -203,4 +203,4 @@ -}, '3.7.2', {"optional": ["dd-constrain", "dd-proxy"], "requires": ["dd-drag"]});+}, '3.7.3', {"optional": ["dd-constrain", "dd-proxy"], "requires": ["dd-drag"]});
bundle/dd-proxy/dd-proxy-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dd-proxy/dd-proxy.js", code: [] };-_yuitest_coverage["build/dd-proxy/dd-proxy.js"].code=["YUI.add('dd-proxy', function (Y, NAME) {","",""," /**"," * Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node."," * @module dd"," * @submodule dd-proxy"," */"," /**"," * Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node."," * @class DDProxy"," * @extends Base"," * @constructor"," * @namespace Plugin "," */"," var DDM = Y.DD.DDM,"," NODE = 'node',"," DRAG_NODE = 'dragNode',"," HOST = 'host',"," TRUE = true, proto,"," P = function(config) {"," P.superclass.constructor.apply(this, arguments);"," };"," "," P.NAME = 'DDProxy';"," /**"," * @property NS"," * @default con"," * @readonly"," * @protected"," * @static"," * @description The Proxy instance will be placed on the Drag instance under the proxy namespace."," * @type {String}"," */"," P.NS = 'proxy';",""," P.ATTRS = {"," host: {"," },"," /**"," * @attribute moveOnEnd"," * @description Move the original node at the end of the drag. Default: true"," * @type Boolean"," */"," moveOnEnd: {"," value: TRUE"," },"," /**"," * @attribute hideOnEnd"," * @description Hide the drag node at the end of the drag. Default: true"," * @type Boolean"," */"," hideOnEnd: {"," value: TRUE"," },"," /**"," * @attribute resizeFrame"," * @description Make the Proxy node assume the size of the original node. Default: true"," * @type Boolean"," */"," resizeFrame: {"," value: TRUE"," },"," /**"," * @attribute positionProxy"," * @description Make the Proxy node appear in the same place as the original node. Default: true"," * @type Boolean"," */"," positionProxy: {"," value: TRUE"," },"," /**"," * @attribute borderStyle"," * @description The default border style for the border of the proxy. Default: 1px solid #808080"," * @type Boolean"," */"," borderStyle: {"," value: '1px solid #808080'"," },"," /**"," * @attribute cloneNode"," * @description Should the node be cloned into the proxy for you. Default: false"," * @type Boolean"," */"," cloneNode: {"," value: false"," }"," };",""," proto = {"," /**"," * @private"," * @property _hands"," * @description Holds the event handles for setting the proxy"," */"," _hands: null,"," /**"," * @private"," * @method _init"," * @description Handler for the proxy config attribute"," */"," _init: function() {"," if (!DDM._proxy) {"," DDM._createFrame();"," Y.on('domready', Y.bind(this._init, this));"," return;"," }"," if (!this._hands) {"," this._hands = [];"," }"," var h, h1, host = this.get(HOST), dnode = host.get(DRAG_NODE);"," if (dnode.compareTo(host.get(NODE))) {"," if (DDM._proxy) {"," host.set(DRAG_NODE, DDM._proxy);"," }"," }"," Y.each(this._hands, function(v) {"," v.detach();"," });"," h = DDM.on('ddm:start', Y.bind(function() {"," if (DDM.activeDrag === host) {"," DDM._setFrame(host);"," }"," }, this));"," h1 = DDM.on('ddm:end', Y.bind(function() {"," if (host.get('dragging')) {"," if (this.get('moveOnEnd')) {"," host.get(NODE).setXY(host.lastXY);"," }"," if (this.get('hideOnEnd')) {"," host.get(DRAG_NODE).setStyle('display', 'none');"," }"," if (this.get('cloneNode')) {"," host.get(DRAG_NODE).remove();"," host.set(DRAG_NODE, DDM._proxy);"," }"," }"," }, this));"," this._hands = [h, h1];"," },"," initializer: function() {"," this._init();"," },"," destructor: function() {"," var host = this.get(HOST);"," Y.each(this._hands, function(v) {"," v.detach();"," });"," host.set(DRAG_NODE, host.get(NODE));"," },"," clone: function() {"," var host = this.get(HOST),"," n = host.get(NODE),"," c = n.cloneNode(true);",""," delete c._yuid;"," c.setAttribute('id', Y.guid());"," c.setStyle('position', 'absolute');"," n.get('parentNode').appendChild(c);"," host.set(DRAG_NODE, c);"," return c;"," }"," };"," "," Y.namespace('Plugin');"," Y.extend(P, Y.Base, proto);"," Y.Plugin.DDProxy = P;",""," //Add a couple of methods to the DDM"," Y.mix(DDM, {"," /**"," * @private"," * @for DDM"," * @namespace DD"," * @method _createFrame"," * @description Create the proxy element if it doesn't already exist and set the DD.DDM._proxy value"," */"," _createFrame: function() {"," if (!DDM._proxy) {"," DDM._proxy = TRUE;",""," var p = Y.Node.create('<div></div>'),"," b = Y.one('body');",""," p.setStyles({"," position: 'absolute',"," display: 'none',"," zIndex: '999',"," top: '-999px',"," left: '-999px'"," });",""," b.prepend(p);"," p.set('id', Y.guid());"," p.addClass(DDM.CSS_PREFIX + '-proxy');"," DDM._proxy = p;"," }"," },"," /**"," * @private"," * @for DDM"," * @namespace DD"," * @method _setFrame"," * @description If resizeProxy is set to true (default) it will resize the proxy element to match the size of the Drag Element."," * If positionProxy is set to true (default) it will position the proxy element in the same location as the Drag Element."," */"," _setFrame: function(drag) {"," var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';"," "," ah = DDM.activeDrag.get('activeHandle');"," if (ah) {"," cur = ah.getStyle('cursor');"," }"," if (cur == 'auto') {"," cur = DDM.get('dragCursor');"," }",""," d.setStyles({"," visibility: 'hidden',"," display: 'block',"," cursor: cur,"," border: drag.proxy.get('borderStyle')"," });",""," if (drag.proxy.get('cloneNode')) {"," d = drag.proxy.clone();"," }",""," if (drag.proxy.get('resizeFrame')) {"," d.setStyles({"," height: n.get('offsetHeight') + 'px',"," width: n.get('offsetWidth') + 'px'"," });"," }",""," if (drag.proxy.get('positionProxy')) {"," d.setXY(drag.nodeXY);"," }"," d.setStyle('visibility', 'visible');"," }"," });",""," //Create the frame when DOM is ready"," //Y.on('domready', Y.bind(DDM._createFrame, DDM));","","","","","}, '3.7.2', {\"requires\": [\"dd-drag\"]});"];+_yuitest_coverage["build/dd-proxy/dd-proxy.js"].code=["YUI.add('dd-proxy', function (Y, NAME) {","",""," /**"," * Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node."," * @module dd"," * @submodule dd-proxy"," */"," /**"," * Plugin for dd-drag for creating a proxy drag node, instead of dragging the original node."," * @class DDProxy"," * @extends Base"," * @constructor"," * @namespace Plugin"," */"," var DDM = Y.DD.DDM,"," NODE = 'node',"," DRAG_NODE = 'dragNode',"," HOST = 'host',"," TRUE = true, proto,"," P = function() {"," P.superclass.constructor.apply(this, arguments);"," };",""," P.NAME = 'DDProxy';"," /**"," * @property NS"," * @default con"," * @readonly"," * @protected"," * @static"," * @description The Proxy instance will be placed on the Drag instance under the proxy namespace."," * @type {String}"," */"," P.NS = 'proxy';",""," P.ATTRS = {"," host: {"," },"," /**"," * @attribute moveOnEnd"," * @description Move the original node at the end of the drag. Default: true"," * @type Boolean"," */"," moveOnEnd: {"," value: TRUE"," },"," /**"," * @attribute hideOnEnd"," * @description Hide the drag node at the end of the drag. Default: true"," * @type Boolean"," */"," hideOnEnd: {"," value: TRUE"," },"," /**"," * @attribute resizeFrame"," * @description Make the Proxy node assume the size of the original node. Default: true"," * @type Boolean"," */"," resizeFrame: {"," value: TRUE"," },"," /**"," * @attribute positionProxy"," * @description Make the Proxy node appear in the same place as the original node. Default: true"," * @type Boolean"," */"," positionProxy: {"," value: TRUE"," },"," /**"," * @attribute borderStyle"," * @description The default border style for the border of the proxy. Default: 1px solid #808080"," * @type Boolean"," */"," borderStyle: {"," value: '1px solid #808080'"," },"," /**"," * @attribute cloneNode"," * @description Should the node be cloned into the proxy for you. Default: false"," * @type Boolean"," */"," cloneNode: {"," value: false"," }"," };",""," proto = {"," /**"," * @private"," * @property _hands"," * @description Holds the event handles for setting the proxy"," */"," _hands: null,"," /**"," * @private"," * @method _init"," * @description Handler for the proxy config attribute"," */"," _init: function() {"," if (!DDM._proxy) {"," DDM._createFrame();"," Y.on('domready', Y.bind(this._init, this));"," return;"," }"," if (!this._hands) {"," this._hands = [];"," }"," var h, h1, host = this.get(HOST), dnode = host.get(DRAG_NODE);"," if (dnode.compareTo(host.get(NODE))) {"," if (DDM._proxy) {"," host.set(DRAG_NODE, DDM._proxy);"," }"," }"," Y.each(this._hands, function(v) {"," v.detach();"," });"," h = DDM.on('ddm:start', Y.bind(function() {"," if (DDM.activeDrag === host) {"," DDM._setFrame(host);"," }"," }, this));"," h1 = DDM.on('ddm:end', Y.bind(function() {"," if (host.get('dragging')) {"," if (this.get('moveOnEnd')) {"," host.get(NODE).setXY(host.lastXY);"," }"," if (this.get('hideOnEnd')) {"," host.get(DRAG_NODE).setStyle('display', 'none');"," }"," if (this.get('cloneNode')) {"," host.get(DRAG_NODE).remove();"," host.set(DRAG_NODE, DDM._proxy);"," }"," }"," }, this));"," this._hands = [h, h1];"," },"," initializer: function() {"," this._init();"," },"," destructor: function() {"," var host = this.get(HOST);"," Y.each(this._hands, function(v) {"," v.detach();"," });"," host.set(DRAG_NODE, host.get(NODE));"," },"," clone: function() {"," var host = this.get(HOST),"," n = host.get(NODE),"," c = n.cloneNode(true);",""," delete c._yuid;"," c.setAttribute('id', Y.guid());"," c.setStyle('position', 'absolute');"," n.get('parentNode').appendChild(c);"," host.set(DRAG_NODE, c);"," return c;"," }"," };",""," Y.namespace('Plugin');"," Y.extend(P, Y.Base, proto);"," Y.Plugin.DDProxy = P;",""," //Add a couple of methods to the DDM"," Y.mix(DDM, {"," /**"," * @private"," * @for DDM"," * @namespace DD"," * @method _createFrame"," * @description Create the proxy element if it doesn't already exist and set the DD.DDM._proxy value"," */"," _createFrame: function() {"," if (!DDM._proxy) {"," DDM._proxy = TRUE;",""," var p = Y.Node.create('<div></div>'),"," b = Y.one('body');",""," p.setStyles({"," position: 'absolute',"," display: 'none',"," zIndex: '999',"," top: '-999px',"," left: '-999px'"," });",""," b.prepend(p);"," p.set('id', Y.guid());"," p.addClass(DDM.CSS_PREFIX + '-proxy');"," DDM._proxy = p;"," }"," },"," /**"," * @private"," * @for DDM"," * @namespace DD"," * @method _setFrame"," * @description If resizeProxy is set to true (default) it will resize the proxy element to match the size of the Drag Element."," * If positionProxy is set to true (default) it will position the proxy element in the same location as the Drag Element."," */"," _setFrame: function(drag) {"," var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';",""," ah = DDM.activeDrag.get('activeHandle');"," if (ah) {"," cur = ah.getStyle('cursor');"," }"," if (cur === 'auto') {"," cur = DDM.get('dragCursor');"," }",""," d.setStyles({"," visibility: 'hidden',"," display: 'block',"," cursor: cur,"," border: drag.proxy.get('borderStyle')"," });",""," if (drag.proxy.get('cloneNode')) {"," d = drag.proxy.clone();"," }",""," if (drag.proxy.get('resizeFrame')) {"," d.setStyles({"," height: n.get('offsetHeight') + 'px',"," width: n.get('offsetWidth') + 'px'"," });"," }",""," if (drag.proxy.get('positionProxy')) {"," d.setXY(drag.nodeXY);"," }"," d.setStyle('visibility', 'visible');"," }"," });",""," //Create the frame when DOM is ready"," //Y.on('domready', Y.bind(DDM._createFrame, DDM));","","","","","}, '3.7.3', {\"requires\": [\"dd-drag\"]});"]; _yuitest_coverage["build/dd-proxy/dd-proxy.js"].lines = {"1":0,"16":0,"22":0,"25":0,"35":0,"37":0,"90":0,"103":0,"104":0,"105":0,"106":0,"108":0,"109":0,"111":0,"112":0,"113":0,"114":0,"117":0,"118":0,"120":0,"121":0,"122":0,"125":0,"126":0,"127":0,"128":0,"130":0,"131":0,"133":0,"134":0,"135":0,"139":0,"142":0,"145":0,"146":0,"147":0,"149":0,"152":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"165":0,"166":0,"167":0,"170":0,"179":0,"180":0,"182":0,"185":0,"193":0,"194":0,"195":0,"196":0,"208":0,"210":0,"211":0,"212":0,"214":0,"215":0,"218":0,"225":0,"226":0,"229":0,"230":0,"236":0,"237":0,"239":0}; _yuitest_coverage["build/dd-proxy/dd-proxy.js"].functions = {"P:21":0,"(anonymous 2):117":0,"(anonymous 3):120":0,"(anonymous 4):125":0,"_init:102":0,"initializer:141":0,"(anonymous 5):146":0,"destructor:144":0,"clone:151":0,"_createFrame:178":0,"_setFrame:207":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-proxy/dd-proxy.js"].coveredLines = 70;@@ -51,7 +51,7 @@ * @class DDProxy * @extends Base * @constructor- * @namespace Plugin + * @namespace Plugin */ _yuitest_coverfunc("build/dd-proxy/dd-proxy.js", "(anonymous 1)", 1); _yuitest_coverline("build/dd-proxy/dd-proxy.js", 16);@@ -60,12 +60,12 @@ DRAG_NODE = 'dragNode', HOST = 'host', TRUE = true, proto,- P = function(config) {+ P = function() { _yuitest_coverfunc("build/dd-proxy/dd-proxy.js", "P", 21); _yuitest_coverline("build/dd-proxy/dd-proxy.js", 22); P.superclass.constructor.apply(this, arguments); };- + _yuitest_coverline("build/dd-proxy/dd-proxy.js", 25); P.NAME = 'DDProxy'; /**@@ -254,7 +254,7 @@ return c; } };- + _yuitest_coverline("build/dd-proxy/dd-proxy.js", 165); Y.namespace('Plugin'); _yuitest_coverline("build/dd-proxy/dd-proxy.js", 166);@@ -314,7 +314,7 @@ _yuitest_coverfunc("build/dd-proxy/dd-proxy.js", "_setFrame", 207); _yuitest_coverline("build/dd-proxy/dd-proxy.js", 208); var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';- + _yuitest_coverline("build/dd-proxy/dd-proxy.js", 210); ah = DDM.activeDrag.get('activeHandle'); _yuitest_coverline("build/dd-proxy/dd-proxy.js", 211);@@ -323,7 +323,7 @@ cur = ah.getStyle('cursor'); } _yuitest_coverline("build/dd-proxy/dd-proxy.js", 214);-if (cur == 'auto') {+if (cur === 'auto') { _yuitest_coverline("build/dd-proxy/dd-proxy.js", 215); cur = DDM.get('dragCursor'); }@@ -367,4 +367,4 @@ -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-proxy/dd-proxy-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,17 +17,17 @@ * @class DDProxy * @extends Base * @constructor- * @namespace Plugin + * @namespace Plugin */ var DDM = Y.DD.DDM, NODE = 'node', DRAG_NODE = 'dragNode', HOST = 'host', TRUE = true, proto,- P = function(config) {+ P = function() { P.superclass.constructor.apply(this, arguments); };- + P.NAME = 'DDProxy'; /** * @property NS@@ -167,7 +167,7 @@ return c; } };- + Y.namespace('Plugin'); Y.extend(P, Y.Base, proto); Y.Plugin.DDProxy = P;@@ -212,12 +212,12 @@ */ _setFrame: function(drag) { var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';- + ah = DDM.activeDrag.get('activeHandle'); if (ah) { cur = ah.getStyle('cursor'); }- if (cur == 'auto') {+ if (cur === 'auto') { cur = DDM.get('dragCursor'); } @@ -252,4 +252,4 @@ -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-proxy/dd-proxy-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-proxy",function(e,t){var n=e.DD.DDM,r="node",i="dragNode",s="host",o=!0,u,a=function(e){a.superclass.constructor.apply(this,arguments)};a.NAME="DDProxy",a.NS="proxy",a.ATTRS={host:{},moveOnEnd:{value:o},hideOnEnd:{value:o},resizeFrame:{value:o},positionProxy:{value:o},borderStyle:{value:"1px solid #808080"},cloneNode:{value:!1}},u={_hands:null,_init:function(){if(!n._proxy){n._createFrame(),e.on("domready",e.bind(this._init,this));return}this._hands||(this._hands=[]);var t,o,u=this.get(s),a=u.get(i);a.compareTo(u.get(r))&&n._proxy&&u.set(i,n._proxy),e.each(this._hands,function(e){e.detach()}),t=n.on("ddm:start",e.bind(function(){n.activeDrag===u&&n._setFrame(u)},this)),o=n.on("ddm:end",e.bind(function(){u.get("dragging")&&(this.get("moveOnEnd")&&u.get(r).setXY(u.lastXY),this.get("hideOnEnd")&&u.get(i).setStyle("display","none"),this.get("cloneNode")&&(u.get(i).remove(),u.set(i,n._proxy)))},this)),this._hands=[t,o]},initializer:function(){this._init()},destructor:function(){var t=this.get(s);e.each(this._hands,function(e){e.detach()}),t.set(i,t.get(r))},clone:function(){var t=this.get(s),n=t.get(r),o=n.cloneNode(!0);return delete o._yuid,o.setAttribute("id",e.guid()),o.setStyle("position","absolute"),n.get("parentNode").appendChild(o),t.set(i,o),o}},e.namespace("Plugin"),e.extend(a,e.Base,u),e.Plugin.DDProxy=a,e.mix(n,{_createFrame:function(){if(!n._proxy){n._proxy=o;var t=e.Node.create("<div></div>"),r=e.one("body");t.setStyles({position:"absolute",display:"none",zIndex:"999",top:"-999px",left:"-999px"}),r.prepend(t),t.set("id",e.guid()),t.addClass(n.CSS_PREFIX+"-proxy"),n._proxy=t}},_setFrame:function(e){var t=e.get(r),s=e.get(i),o,u="auto";o=n.activeDrag.get("activeHandle"),o&&(u=o.getStyle("cursor")),u=="auto"&&(u=n.get("dragCursor")),s.setStyles({visibility:"hidden",display:"block",cursor:u,border:e.proxy.get("borderStyle")}),e.proxy.get("cloneNode")&&(s=e.proxy.clone()),e.proxy.get("resizeFrame")&&s.setStyles({height:t.get("offsetHeight")+"px",width:t.get("offsetWidth")+"px"}),e.proxy.get("positionProxy")&&s.setXY(e.nodeXY),s.setStyle("visibility","visible")}})},"3.7.2",{requires:["dd-drag"]});+YUI.add("dd-proxy",function(e,t){var n=e.DD.DDM,r="node",i="dragNode",s="host",o=!0,u,a=function(){a.superclass.constructor.apply(this,arguments)};a.NAME="DDProxy",a.NS="proxy",a.ATTRS={host:{},moveOnEnd:{value:o},hideOnEnd:{value:o},resizeFrame:{value:o},positionProxy:{value:o},borderStyle:{value:"1px solid #808080"},cloneNode:{value:!1}},u={_hands:null,_init:function(){if(!n._proxy){n._createFrame(),e.on("domready",e.bind(this._init,this));return}this._hands||(this._hands=[]);var t,o,u=this.get(s),a=u.get(i);a.compareTo(u.get(r))&&n._proxy&&u.set(i,n._proxy),e.each(this._hands,function(e){e.detach()}),t=n.on("ddm:start",e.bind(function(){n.activeDrag===u&&n._setFrame(u)},this)),o=n.on("ddm:end",e.bind(function(){u.get("dragging")&&(this.get("moveOnEnd")&&u.get(r).setXY(u.lastXY),this.get("hideOnEnd")&&u.get(i).setStyle("display","none"),this.get("cloneNode")&&(u.get(i).remove(),u.set(i,n._proxy)))},this)),this._hands=[t,o]},initializer:function(){this._init()},destructor:function(){var t=this.get(s);e.each(this._hands,function(e){e.detach()}),t.set(i,t.get(r))},clone:function(){var t=this.get(s),n=t.get(r),o=n.cloneNode(!0);return delete o._yuid,o.setAttribute("id",e.guid()),o.setStyle("position","absolute"),n.get("parentNode").appendChild(o),t.set(i,o),o}},e.namespace("Plugin"),e.extend(a,e.Base,u),e.Plugin.DDProxy=a,e.mix(n,{_createFrame:function(){if(!n._proxy){n._proxy=o;var t=e.Node.create("<div></div>"),r=e.one("body");t.setStyles({position:"absolute",display:"none",zIndex:"999",top:"-999px",left:"-999px"}),r.prepend(t),t.set("id",e.guid()),t.addClass(n.CSS_PREFIX+"-proxy"),n._proxy=t}},_setFrame:function(e){var t=e.get(r),s=e.get(i),o,u="auto";o=n.activeDrag.get("activeHandle"),o&&(u=o.getStyle("cursor")),u==="auto"&&(u=n.get("dragCursor")),s.setStyles({visibility:"hidden",display:"block",cursor:u,border:e.proxy.get("borderStyle")}),e.proxy.get("cloneNode")&&(s=e.proxy.clone()),e.proxy.get("resizeFrame")&&s.setStyles({height:t.get("offsetHeight")+"px",width:t.get("offsetWidth")+"px"}),e.proxy.get("positionProxy")&&s.setXY(e.nodeXY),s.setStyle("visibility","visible")}})},"3.7.3",{requires:["dd-drag"]});
bundle/dd-proxy/dd-proxy.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,17 +17,17 @@ * @class DDProxy * @extends Base * @constructor- * @namespace Plugin + * @namespace Plugin */ var DDM = Y.DD.DDM, NODE = 'node', DRAG_NODE = 'dragNode', HOST = 'host', TRUE = true, proto,- P = function(config) {+ P = function() { P.superclass.constructor.apply(this, arguments); };- + P.NAME = 'DDProxy'; /** * @property NS@@ -167,7 +167,7 @@ return c; } };- + Y.namespace('Plugin'); Y.extend(P, Y.Base, proto); Y.Plugin.DDProxy = P;@@ -212,12 +212,12 @@ */ _setFrame: function(drag) { var n = drag.get(NODE), d = drag.get(DRAG_NODE), ah, cur = 'auto';- + ah = DDM.activeDrag.get('activeHandle'); if (ah) { cur = ah.getStyle('cursor'); }- if (cur == 'auto') {+ if (cur === 'auto') { cur = DDM.get('dragCursor'); } @@ -252,4 +252,4 @@ -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-scroll/dd-scroll-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dd-scroll/dd-scroll.js", code: [] };-_yuitest_coverage["build/dd-scroll/dd-scroll.js"].code=["YUI.add('dd-scroll', function (Y, NAME) {","",""," /**"," * Base scroller class used to create the Plugin.DDNodeScroll and Plugin.DDWinScroll."," * This class should not be called on it's own, it's designed to be a plugin."," * @module dd"," * @submodule dd-scroll"," */"," /**"," * Base scroller class used to create the Plugin.DDNodeScroll and Plugin.DDWinScroll."," * This class should not be called on it's own, it's designed to be a plugin."," * @class Scroll"," * @extends Base"," * @namespace DD"," * @constructor"," */",""," var S = function() {"," S.superclass.constructor.apply(this, arguments);",""," },"," WS, NS,"," HOST = 'host',"," BUFFER = 'buffer',"," PARENT_SCROLL = 'parentScroll',"," WINDOW_SCROLL = 'windowScroll',"," SCROLL_TOP = 'scrollTop',"," SCROLL_LEFT = 'scrollLeft',"," OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight';","",""," S.ATTRS = {"," /**"," * @attribute parentScroll"," * @description Internal config option to hold the node that we are scrolling. Should not be set by the developer."," * @type Node"," */"," parentScroll: {"," value: false,"," setter: function(node) {"," if (node) {"," return node;"," }"," return false;"," }"," },"," /**"," * @attribute buffer"," * @description The number of pixels from the edge of the screen to turn on scrolling. Default: 30"," * @type Number"," */"," buffer: {"," value: 30,"," validator: Y.Lang.isNumber"," },"," /**"," * @attribute scrollDelay"," * @description The number of milliseconds delay to pass to the auto scroller. Default: 235"," * @type Number"," */"," scrollDelay: {"," value: 235,"," validator: Y.Lang.isNumber"," },"," /**"," * @attribute host"," * @description The host we are plugged into."," * @type Object"," */"," host: {"," value: null"," },"," /**"," * @attribute windowScroll"," * @description Turn on window scroll support, default: false"," * @type Boolean"," */"," windowScroll: {"," value: false,"," validator: Y.Lang.isBoolean"," },"," /**"," * @attribute vertical"," * @description Allow vertical scrolling, default: true."," * @type Boolean"," */"," vertical: {"," value: true,"," validator: Y.Lang.isBoolean"," },"," /**"," * @attribute horizontal"," * @description Allow horizontal scrolling, default: true."," * @type Boolean"," */"," horizontal: {"," value: true,"," validator: Y.Lang.isBoolean"," }"," };",""," Y.extend(S, Y.Base, {"," /**"," * @private"," * @property _scrolling"," * @description Tells if we are actively scrolling or not."," * @type Boolean"," */"," _scrolling: null,"," /**"," * @private"," * @property _vpRegionCache"," * @description Cache of the Viewport dims."," * @type Object"," */"," _vpRegionCache: null,"," /**"," * @private"," * @property _dimCache"," * @description Cache of the dragNode dims."," * @type Object"," */"," _dimCache: null,"," /**"," * @private"," * @property _scrollTimer"," * @description Holder for the Timer object returned from Y.later."," * @type {Y.later}"," */"," _scrollTimer: null,"," /**"," * @private"," * @method _getVPRegion"," * @description Sets the _vpRegionCache property with an Object containing the dims from the viewport."," */ "," _getVPRegion: function() {"," var r = {},"," n = this.get(PARENT_SCROLL),"," b = this.get(BUFFER),"," ws = this.get(WINDOW_SCROLL),"," xy = ((ws) ? [] : n.getXY()),"," w = ((ws) ? 'winWidth' : OFFSET_WIDTH),"," h = ((ws) ? 'winHeight' : OFFSET_HEIGHT),"," t = ((ws) ? n.get(SCROLL_TOP) : xy[1]),"," l = ((ws) ? n.get(SCROLL_LEFT) : xy[0]);",""," r = {"," top: t + b,"," right: (n.get(w) + l) - b,"," bottom: (n.get(h) + t) - b,"," left: l + b"," };"," this._vpRegionCache = r;"," return r;"," },"," initializer: function() {"," var h = this.get(HOST);"," h.after('drag:start', Y.bind(this.start, this));"," h.after('drag:end', Y.bind(this.end, this));"," h.on('drag:align', Y.bind(this.align, this));",""," //TODO - This doesn't work yet??"," Y.one('win').on('scroll', Y.bind(function() {"," this._vpRegionCache = null;"," }, this));"," },"," /**"," * @private"," * @method _checkWinScroll"," * @description Check to see if we need to fire the scroll timer. If scroll timer is running this will scroll the window."," * @param {Boolean} move Should we move the window. From Y.later"," */ "," _checkWinScroll: function(move) {"," var r = this._getVPRegion(),"," ho = this.get(HOST),"," ws = this.get(WINDOW_SCROLL),"," xy = ho.lastXY,"," scroll = false,"," b = this.get(BUFFER),"," win = this.get(PARENT_SCROLL),"," sTop = win.get(SCROLL_TOP),"," sLeft = win.get(SCROLL_LEFT),"," w = this._dimCache.w,"," h = this._dimCache.h,"," bottom = xy[1] + h,"," top = xy[1],"," right = xy[0] + w,"," left = xy[0],"," nt = top,"," nl = left,"," st = sTop,"," sl = sLeft;"," "," if (this.get('horizontal')) {"," if (left <= r.left) {"," scroll = true;"," nl = xy[0] - ((ws) ? b : 0);"," sl = sLeft - b;"," }"," if (right >= r.right) {"," scroll = true;"," nl = xy[0] + ((ws) ? b : 0);"," sl = sLeft + b;"," }"," }"," if (this.get('vertical')) {"," if (bottom >= r.bottom) {"," scroll = true;"," nt = xy[1] + ((ws) ? b : 0);"," st = sTop + b;",""," }"," if (top <= r.top) {"," scroll = true;"," nt = xy[1] - ((ws) ? b : 0);"," st = sTop - b;"," }"," }",""," if (st < 0) {"," st = 0;"," nt = xy[1];"," }",""," if (sl < 0) {"," sl = 0;"," nl = xy[0];"," }",""," if (nt < 0) {"," nt = xy[1];"," }"," if (nl < 0) {"," nl = xy[0];"," }"," if (ho.con) {"," if (!ho.con.inRegion([nl + sl, nt + st])) {"," move = false;"," }"," }"," if (move) {"," ho.actXY = [nl, nt];"," ho._alignNode([nl, nt], true); //We are srolling.."," xy = ho.actXY;"," ho.actXY = [nl, nt];"," ho._moveNode({ node: win, top: st, left: sl});"," if (!st && !sl) {"," this._cancelScroll();"," }"," } else {"," if (scroll) {"," this._initScroll();"," } else {"," this._cancelScroll();"," }"," }"," },"," /**"," * @private"," * @method _initScroll"," * @description Cancel a previous scroll timer and init a new one."," */ "," _initScroll: function() {"," this._cancelScroll();"," this._scrollTimer = Y.Lang.later(this.get('scrollDelay'), this, this._checkWinScroll, [true], true);",""," },"," /**"," * @private"," * @method _cancelScroll"," * @description Cancel a currently running scroll timer."," */ "," _cancelScroll: function() {"," this._scrolling = false;"," if (this._scrollTimer) {"," this._scrollTimer.cancel();"," delete this._scrollTimer;"," }"," },"," /**"," * @method align"," * @description Called from the drag:align event to determine if we need to scroll."," */ "," align: function(e) {"," if (this._scrolling) {"," this._cancelScroll();"," e.preventDefault();"," }"," if (!this._scrolling) {"," this._checkWinScroll();"," }"," },"," /**"," * @private"," * @method _setDimCache"," * @description Set the cache of the dragNode dims."," */ "," _setDimCache: function() {"," var node = this.get(HOST).get('dragNode');"," this._dimCache = {"," h: node.get(OFFSET_HEIGHT),"," w: node.get(OFFSET_WIDTH)"," };"," },"," /**"," * @method start"," * @description Called from the drag:start event"," */"," start: function() {"," this._setDimCache();"," },"," /**"," * @method end"," * @description Called from the drag:end event"," */"," end: function(xy) {"," this._dimCache = null;"," this._cancelScroll();"," }"," });",""," Y.namespace('Plugin');",""," "," /**"," * Extends the Scroll class to make the window scroll while dragging."," * @class DDWindowScroll"," * @extends Scroll"," * @namespace Plugin"," * @constructor"," */"," WS = function() {"," WS.superclass.constructor.apply(this, arguments);"," };"," WS.ATTRS = Y.merge(S.ATTRS, {"," /**"," * @attribute windowScroll"," * @description Turn on window scroll support, default: true"," * @type Boolean"," */"," windowScroll: {"," value: true,"," setter: function(scroll) {"," if (scroll) {"," this.set(PARENT_SCROLL, Y.one('win'));"," }"," return scroll;"," }"," }"," });"," Y.extend(WS, S, {"," //Shouldn't have to do this.."," initializer: function() {"," this.set('windowScroll', this.get('windowScroll'));"," }"," });"," /**"," * @property NS"," * @default winscroll"," * @readonly"," * @protected"," * @static"," * @description The Scroll instance will be placed on the Drag instance under the winscroll namespace."," * @type {String}"," */"," WS.NAME = WS.NS = 'winscroll';"," Y.Plugin.DDWinScroll = WS;"," ",""," /**"," * Extends the Scroll class to make a parent node scroll while dragging."," * @class DDNodeScroll"," * @extends Scroll"," * @namespace Plugin"," * @constructor"," */"," NS = function() {"," NS.superclass.constructor.apply(this, arguments);",""," };"," NS.ATTRS = Y.merge(S.ATTRS, {"," /**"," * @attribute node"," * @description The node we want to scroll. Used to set the internal parentScroll attribute."," * @type Node"," */"," node: {"," value: false,"," setter: function(node) {"," var n = Y.one(node);"," if (!n) {"," if (node !== false) {"," Y.error('DDNodeScroll: Invalid Node Given: ' + node);"," }"," } else {"," this.set(PARENT_SCROLL, n);"," }"," return n;"," }"," }"," });"," Y.extend(NS, S, {"," //Shouldn't have to do this.."," initializer: function() {"," this.set('node', this.get('node'));"," }"," });"," /**"," * @property NS"," * @default nodescroll"," * @readonly"," * @protected"," * @static"," * @description The NodeScroll instance will be placed on the Drag instance under the nodescroll namespace."," * @type {String}"," */"," NS.NAME = NS.NS = 'nodescroll';"," Y.Plugin.DDNodeScroll = NS;",""," Y.DD.Scroll = S; ","","","","","}, '3.7.2', {\"requires\": [\"dd-drag\"]});"];+_yuitest_coverage["build/dd-scroll/dd-scroll.js"].code=["YUI.add('dd-scroll', function (Y, NAME) {","",""," /**"," * Base scroller class used to create the Plugin.DDNodeScroll and Plugin.DDWinScroll."," * This class should not be called on it's own, it's designed to be a plugin."," * @module dd"," * @submodule dd-scroll"," */"," /**"," * Base scroller class used to create the Plugin.DDNodeScroll and Plugin.DDWinScroll."," * This class should not be called on it's own, it's designed to be a plugin."," * @class Scroll"," * @extends Base"," * @namespace DD"," * @constructor"," */",""," var S = function() {"," S.superclass.constructor.apply(this, arguments);",""," },"," WS, NS,"," HOST = 'host',"," BUFFER = 'buffer',"," PARENT_SCROLL = 'parentScroll',"," WINDOW_SCROLL = 'windowScroll',"," SCROLL_TOP = 'scrollTop',"," SCROLL_LEFT = 'scrollLeft',"," OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight';","",""," S.ATTRS = {"," /**"," * @attribute parentScroll"," * @description Internal config option to hold the node that we are scrolling. Should not be set by the developer."," * @type Node"," */"," parentScroll: {"," value: false,"," setter: function(node) {"," if (node) {"," return node;"," }"," return false;"," }"," },"," /**"," * @attribute buffer"," * @description The number of pixels from the edge of the screen to turn on scrolling. Default: 30"," * @type Number"," */"," buffer: {"," value: 30,"," validator: Y.Lang.isNumber"," },"," /**"," * @attribute scrollDelay"," * @description The number of milliseconds delay to pass to the auto scroller. Default: 235"," * @type Number"," */"," scrollDelay: {"," value: 235,"," validator: Y.Lang.isNumber"," },"," /**"," * @attribute host"," * @description The host we are plugged into."," * @type Object"," */"," host: {"," value: null"," },"," /**"," * @attribute windowScroll"," * @description Turn on window scroll support, default: false"," * @type Boolean"," */"," windowScroll: {"," value: false,"," validator: Y.Lang.isBoolean"," },"," /**"," * @attribute vertical"," * @description Allow vertical scrolling, default: true."," * @type Boolean"," */"," vertical: {"," value: true,"," validator: Y.Lang.isBoolean"," },"," /**"," * @attribute horizontal"," * @description Allow horizontal scrolling, default: true."," * @type Boolean"," */"," horizontal: {"," value: true,"," validator: Y.Lang.isBoolean"," }"," };",""," Y.extend(S, Y.Base, {"," /**"," * @private"," * @property _scrolling"," * @description Tells if we are actively scrolling or not."," * @type Boolean"," */"," _scrolling: null,"," /**"," * @private"," * @property _vpRegionCache"," * @description Cache of the Viewport dims."," * @type Object"," */"," _vpRegionCache: null,"," /**"," * @private"," * @property _dimCache"," * @description Cache of the dragNode dims."," * @type Object"," */"," _dimCache: null,"," /**"," * @private"," * @property _scrollTimer"," * @description Holder for the Timer object returned from Y.later."," * @type {Y.later}"," */"," _scrollTimer: null,"," /**"," * @private"," * @method _getVPRegion"," * @description Sets the _vpRegionCache property with an Object containing the dims from the viewport."," */"," _getVPRegion: function() {"," var r = {},"," n = this.get(PARENT_SCROLL),"," b = this.get(BUFFER),"," ws = this.get(WINDOW_SCROLL),"," xy = ((ws) ? [] : n.getXY()),"," w = ((ws) ? 'winWidth' : OFFSET_WIDTH),"," h = ((ws) ? 'winHeight' : OFFSET_HEIGHT),"," t = ((ws) ? n.get(SCROLL_TOP) : xy[1]),"," l = ((ws) ? n.get(SCROLL_LEFT) : xy[0]);",""," r = {"," top: t + b,"," right: (n.get(w) + l) - b,"," bottom: (n.get(h) + t) - b,"," left: l + b"," };"," this._vpRegionCache = r;"," return r;"," },"," initializer: function() {"," var h = this.get(HOST);"," h.after('drag:start', Y.bind(this.start, this));"," h.after('drag:end', Y.bind(this.end, this));"," h.on('drag:align', Y.bind(this.align, this));",""," //TODO - This doesn't work yet??"," Y.one('win').on('scroll', Y.bind(function() {"," this._vpRegionCache = null;"," }, this));"," },"," /**"," * @private"," * @method _checkWinScroll"," * @description Check to see if we need to fire the scroll timer. If scroll timer is running this will scroll the window."," * @param {Boolean} move Should we move the window. From Y.later"," */"," _checkWinScroll: function(move) {"," var r = this._getVPRegion(),"," ho = this.get(HOST),"," ws = this.get(WINDOW_SCROLL),"," xy = ho.lastXY,"," scroll = false,"," b = this.get(BUFFER),"," win = this.get(PARENT_SCROLL),"," sTop = win.get(SCROLL_TOP),"," sLeft = win.get(SCROLL_LEFT),"," w = this._dimCache.w,"," h = this._dimCache.h,"," bottom = xy[1] + h,"," top = xy[1],"," right = xy[0] + w,"," left = xy[0],"," nt = top,"," nl = left,"," st = sTop,"," sl = sLeft;",""," if (this.get('horizontal')) {"," if (left <= r.left) {"," scroll = true;"," nl = xy[0] - ((ws) ? b : 0);"," sl = sLeft - b;"," }"," if (right >= r.right) {"," scroll = true;"," nl = xy[0] + ((ws) ? b : 0);"," sl = sLeft + b;"," }"," }"," if (this.get('vertical')) {"," if (bottom >= r.bottom) {"," scroll = true;"," nt = xy[1] + ((ws) ? b : 0);"," st = sTop + b;",""," }"," if (top <= r.top) {"," scroll = true;"," nt = xy[1] - ((ws) ? b : 0);"," st = sTop - b;"," }"," }",""," if (st < 0) {"," st = 0;"," nt = xy[1];"," }",""," if (sl < 0) {"," sl = 0;"," nl = xy[0];"," }",""," if (nt < 0) {"," nt = xy[1];"," }"," if (nl < 0) {"," nl = xy[0];"," }"," if (ho.con) {"," if (!ho.con.inRegion([nl + sl, nt + st])) {"," move = false;"," }"," }"," if (move) {"," ho.actXY = [nl, nt];"," ho._alignNode([nl, nt], true); //We are srolling.."," xy = ho.actXY;"," ho.actXY = [nl, nt];"," ho._moveNode({ node: win, top: st, left: sl});"," if (!st && !sl) {"," this._cancelScroll();"," }"," } else {"," if (scroll) {"," this._initScroll();"," } else {"," this._cancelScroll();"," }"," }"," },"," /**"," * @private"," * @method _initScroll"," * @description Cancel a previous scroll timer and init a new one."," */"," _initScroll: function() {"," this._cancelScroll();"," this._scrollTimer = Y.Lang.later(this.get('scrollDelay'), this, this._checkWinScroll, [true], true);",""," },"," /**"," * @private"," * @method _cancelScroll"," * @description Cancel a currently running scroll timer."," */"," _cancelScroll: function() {"," this._scrolling = false;"," if (this._scrollTimer) {"," this._scrollTimer.cancel();"," delete this._scrollTimer;"," }"," },"," /**"," * @method align"," * @description Called from the drag:align event to determine if we need to scroll."," */"," align: function(e) {"," if (this._scrolling) {"," this._cancelScroll();"," e.preventDefault();"," }"," if (!this._scrolling) {"," this._checkWinScroll();"," }"," },"," /**"," * @private"," * @method _setDimCache"," * @description Set the cache of the dragNode dims."," */"," _setDimCache: function() {"," var node = this.get(HOST).get('dragNode');"," this._dimCache = {"," h: node.get(OFFSET_HEIGHT),"," w: node.get(OFFSET_WIDTH)"," };"," },"," /**"," * @method start"," * @description Called from the drag:start event"," */"," start: function() {"," this._setDimCache();"," },"," /**"," * @method end"," * @description Called from the drag:end event"," */"," end: function() {"," this._dimCache = null;"," this._cancelScroll();"," }"," });",""," Y.namespace('Plugin');","",""," /**"," * Extends the Scroll class to make the window scroll while dragging."," * @class DDWindowScroll"," * @extends Scroll"," * @namespace Plugin"," * @constructor"," */"," WS = function() {"," WS.superclass.constructor.apply(this, arguments);"," };"," WS.ATTRS = Y.merge(S.ATTRS, {"," /**"," * @attribute windowScroll"," * @description Turn on window scroll support, default: true"," * @type Boolean"," */"," windowScroll: {"," value: true,"," setter: function(scroll) {"," if (scroll) {"," this.set(PARENT_SCROLL, Y.one('win'));"," }"," return scroll;"," }"," }"," });"," Y.extend(WS, S, {"," //Shouldn't have to do this.."," initializer: function() {"," this.set('windowScroll', this.get('windowScroll'));"," }"," });"," /**"," * @property NS"," * @default winscroll"," * @readonly"," * @protected"," * @static"," * @description The Scroll instance will be placed on the Drag instance under the winscroll namespace."," * @type {String}"," */"," WS.NAME = WS.NS = 'winscroll';"," Y.Plugin.DDWinScroll = WS;","",""," /**"," * Extends the Scroll class to make a parent node scroll while dragging."," * @class DDNodeScroll"," * @extends Scroll"," * @namespace Plugin"," * @constructor"," */"," NS = function() {"," NS.superclass.constructor.apply(this, arguments);",""," };"," NS.ATTRS = Y.merge(S.ATTRS, {"," /**"," * @attribute node"," * @description The node we want to scroll. Used to set the internal parentScroll attribute."," * @type Node"," */"," node: {"," value: false,"," setter: function(node) {"," var n = Y.one(node);"," if (!n) {"," if (node !== false) {"," Y.error('DDNodeScroll: Invalid Node Given: ' + node);"," }"," } else {"," this.set(PARENT_SCROLL, n);"," }"," return n;"," }"," }"," });"," Y.extend(NS, S, {"," //Shouldn't have to do this.."," initializer: function() {"," this.set('node', this.get('node'));"," }"," });"," /**"," * @property NS"," * @default nodescroll"," * @readonly"," * @protected"," * @static"," * @description The NodeScroll instance will be placed on the Drag instance under the nodescroll namespace."," * @type {String}"," */"," NS.NAME = NS.NS = 'nodescroll';"," Y.Plugin.DDNodeScroll = NS;",""," Y.DD.Scroll = S;","","","","","}, '3.7.3', {\"requires\": [\"dd-drag\"]});"]; _yuitest_coverage["build/dd-scroll/dd-scroll.js"].lines = {"1":0,"19":0,"20":0,"34":0,"43":0,"44":0,"46":0,"104":0,"139":0,"149":0,"155":0,"156":0,"159":0,"160":0,"161":0,"162":0,"165":0,"166":0,"176":0,"196":0,"197":0,"198":0,"199":0,"200":0,"202":0,"203":0,"204":0,"205":0,"208":0,"209":0,"210":0,"211":0,"212":0,"215":0,"216":0,"217":0,"218":0,"222":0,"223":0,"224":0,"227":0,"228":0,"229":0,"232":0,"233":0,"235":0,"236":0,"238":0,"239":0,"240":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"253":0,"254":0,"256":0,"266":0,"267":0,"276":0,"277":0,"278":0,"279":0,"287":0,"288":0,"289":0,"291":0,"292":0,"301":0,"302":0,"312":0,"319":0,"320":0,"324":0,"334":0,"335":0,"337":0,"346":0,"347":0,"349":0,"353":0,"356":0,"368":0,"369":0,"379":0,"380":0,"383":0,"392":0,"393":0,"394":0,"395":0,"398":0,"400":0,"404":0,"407":0,"419":0,"420":0,"422":0}; _yuitest_coverage["build/dd-scroll/dd-scroll.js"].functions = {"S:19":0,"setter:42":0,"_getVPRegion:138":0,"(anonymous 2):165":0,"initializer:158":0,"_checkWinScroll:175":0,"_initScroll:265":0,"_cancelScroll:275":0,"align:286":0,"_setDimCache:300":0,"start:311":0,"end:318":0,"WS:334":0,"setter:345":0,"initializer:355":0,"NS:379":0,"setter:391":0,"initializer:406":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dd-scroll/dd-scroll.js"].coveredLines = 102;@@ -184,7 +184,7 @@ * @private * @method _getVPRegion * @description Sets the _vpRegionCache property with an Object containing the dims from the viewport.- */ + */ _getVPRegion: function() { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "_getVPRegion", 138); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 139);@@ -234,7 +234,7 @@ * @method _checkWinScroll * @description Check to see if we need to fire the scroll timer. If scroll timer is running this will scroll the window. * @param {Boolean} move Should we move the window. From Y.later- */ + */ _checkWinScroll: function(move) { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "_checkWinScroll", 175); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 176);@@ -257,7 +257,7 @@ nl = left, st = sTop, sl = sLeft;- + _yuitest_coverline("build/dd-scroll/dd-scroll.js", 196); if (this.get('horizontal')) { _yuitest_coverline("build/dd-scroll/dd-scroll.js", 197);@@ -368,7 +368,7 @@ * @private * @method _initScroll * @description Cancel a previous scroll timer and init a new one.- */ + */ _initScroll: function() { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "_initScroll", 265); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 266);@@ -381,7 +381,7 @@ * @private * @method _cancelScroll * @description Cancel a currently running scroll timer.- */ + */ _cancelScroll: function() { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "_cancelScroll", 275); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 276);@@ -397,7 +397,7 @@ /** * @method align * @description Called from the drag:align event to determine if we need to scroll.- */ + */ align: function(e) { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "align", 286); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 287);@@ -417,7 +417,7 @@ * @private * @method _setDimCache * @description Set the cache of the dragNode dims.- */ + */ _setDimCache: function() { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "_setDimCache", 300); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 301);@@ -441,7 +441,7 @@ * @method end * @description Called from the drag:end event */- end: function(xy) {+ end: function() { _yuitest_coverfunc("build/dd-scroll/dd-scroll.js", "end", 318); _yuitest_coverline("build/dd-scroll/dd-scroll.js", 319); this._dimCache = null;@@ -453,7 +453,7 @@ _yuitest_coverline("build/dd-scroll/dd-scroll.js", 324); Y.namespace('Plugin'); - + /** * Extends the Scroll class to make the window scroll while dragging. * @class DDWindowScroll@@ -510,8 +510,8 @@ WS.NAME = WS.NS = 'winscroll'; _yuitest_coverline("build/dd-scroll/dd-scroll.js", 369); Y.Plugin.DDWinScroll = WS;- + /** * Extends the Scroll class to make a parent node scroll while dragging. * @class DDNodeScroll@@ -579,9 +579,9 @@ Y.Plugin.DDNodeScroll = NS; _yuitest_coverline("build/dd-scroll/dd-scroll.js", 422);-Y.DD.Scroll = S; +Y.DD.Scroll = S; -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-scroll/dd-scroll-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -140,7 +140,7 @@ * @private * @method _getVPRegion * @description Sets the _vpRegionCache property with an Object containing the dims from the viewport.- */ + */ _getVPRegion: function() { var r = {}, n = this.get(PARENT_SCROLL),@@ -177,7 +177,7 @@ * @method _checkWinScroll * @description Check to see if we need to fire the scroll timer. If scroll timer is running this will scroll the window. * @param {Boolean} move Should we move the window. From Y.later- */ + */ _checkWinScroll: function(move) { var r = this._getVPRegion(), ho = this.get(HOST),@@ -198,7 +198,7 @@ nl = left, st = sTop, sl = sLeft;- + if (this.get('horizontal')) { if (left <= r.left) { scroll = true;@@ -267,7 +267,7 @@ * @private * @method _initScroll * @description Cancel a previous scroll timer and init a new one.- */ + */ _initScroll: function() { this._cancelScroll(); this._scrollTimer = Y.Lang.later(this.get('scrollDelay'), this, this._checkWinScroll, [true], true);@@ -277,7 +277,7 @@ * @private * @method _cancelScroll * @description Cancel a currently running scroll timer.- */ + */ _cancelScroll: function() { this._scrolling = false; if (this._scrollTimer) {@@ -288,7 +288,7 @@ /** * @method align * @description Called from the drag:align event to determine if we need to scroll.- */ + */ align: function(e) { if (this._scrolling) { this._cancelScroll();@@ -302,7 +302,7 @@ * @private * @method _setDimCache * @description Set the cache of the dragNode dims.- */ + */ _setDimCache: function() { var node = this.get(HOST).get('dragNode'); this._dimCache = {@@ -321,7 +321,7 @@ * @method end * @description Called from the drag:end event */- end: function(xy) {+ end: function() { this._dimCache = null; this._cancelScroll(); }@@ -329,7 +329,7 @@ Y.namespace('Plugin'); - + /** * Extends the Scroll class to make the window scroll while dragging. * @class DDWindowScroll@@ -373,8 +373,8 @@ */ WS.NAME = WS.NS = 'winscroll'; Y.Plugin.DDWinScroll = WS;- + /** * Extends the Scroll class to make a parent node scroll while dragging. * @class DDNodeScroll@@ -425,9 +425,9 @@ NS.NAME = NS.NS = 'nodescroll'; Y.Plugin.DDNodeScroll = NS; - Y.DD.Scroll = S; + Y.DD.Scroll = S; -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dd-scroll/dd-scroll-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dd-scroll",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r,i,s="host",o="buffer",u="parentScroll",a="windowScroll",f="scrollTop",l="scrollLeft",c="offsetWidth",h="offsetHeight";n.ATTRS={parentScroll:{value:!1,setter:function(e){return e?e:!1}},buffer:{value:30,validator:e.Lang.isNumber},scrollDelay:{value:235,validator:e.Lang.isNumber},host:{value:null},windowScroll:{value:!1,validator:e.Lang.isBoolean},vertical:{value:!0,validator:e.Lang.isBoolean},horizontal:{value:!0,validator:e.Lang.isBoolean}},e.extend(n,e.Base,{_scrolling:null,_vpRegionCache:null,_dimCache:null,_scrollTimer:null,_getVPRegion:function(){var e={},t=this.get(u),n=this.get(o),r=this.get(a),i=r?[]:t.getXY(),s=r?"winWidth":c,p=r?"winHeight":h,d=r?t.get(f):i[1],v=r?t.get(l):i[0];return e={top:d+n,right:t.get(s)+v-n,bottom:t.get(p)+d-n,left:v+n},this._vpRegionCache=e,e},initializer:function(){var t=this.get(s);t.after("drag:start",e.bind(this.start,this)),t.after("drag:end",e.bind(this.end,this)),t.on("drag:align",e.bind(this.align,this)),e.one("win").on("scroll",e.bind(function(){this._vpRegionCache=null},this))},_checkWinScroll:function(e){var t=this._getVPRegion(),n=this.get(s),r=this.get(a),i=n.lastXY,c=!1,h=this.get(o),p=this.get(u),d=p.get(f),v=p.get(l),m=this._dimCache.w,g=this._dimCache.h,y=i[1]+g,b=i[1],w=i[0]+m,E=i[0],S=b,x=E,T=d,N=v;this.get("horizontal")&&(E<=t.left&&(c=!0,x=i[0]-(r?h:0),N=v-h),w>=t.right&&(c=!0,x=i[0]+(r?h:0),N=v+h)),this.get("vertical")&&(y>=t.bottom&&(c=!0,S=i[1]+(r?h:0),T=d+h),b<=t.top&&(c=!0,S=i[1]-(r?h:0),T=d-h)),T<0&&(T=0,S=i[1]),N<0&&(N=0,x=i[0]),S<0&&(S=i[1]),x<0&&(x=i[0]),n.con&&(n.con.inRegion([x+N,S+T])||(e=!1)),e?(n.actXY=[x,S],n._alignNode([x,S],!0),i=n.actXY,n.actXY=[x,S],n._moveNode({node:p,top:T,left:N}),!T&&!N&&this._cancelScroll()):c?this._initScroll():this._cancelScroll()},_initScroll:function(){this._cancelScroll(),this._scrollTimer=e.Lang.later(this.get("scrollDelay"),this,this._checkWinScroll,[!0],!0)},_cancelScroll:function(){this._scrolling=!1,this._scrollTimer&&(this._scrollTimer.cancel(),delete this._scrollTimer)},align:function(e){this._scrolling&&(this._cancelScroll(),e.preventDefault()),this._scrolling||this._checkWinScroll()},_setDimCache:function(){var e=this.get(s).get("dragNode");this._dimCache={h:e.get(h),w:e.get(c)}},start:function(){this._setDimCache()},end:function(e){this._dimCache=null,this._cancelScroll()}}),e.namespace("Plugin"),r=function(){r.superclass.constructor.apply(this,arguments)},r.ATTRS=e.merge(n.ATTRS,{windowScroll:{value:!0,setter:function(t){return t&&this.set(u,e.one("win")),t}}}),e.extend(r,n,{initializer:function(){this.set("windowScroll",this.get("windowScroll"))}}),r.NAME=r.NS="winscroll",e.Plugin.DDWinScroll=r,i=function(){i.superclass.constructor.apply(this,arguments)},i.ATTRS=e.merge(n.ATTRS,{node:{value:!1,setter:function(t){var n=e.one(t);return n?this.set(u,n):t!==!1&&e.error("DDNodeScroll: Invalid Node Given: "+t),n}}}),e.extend(i,n,{initializer:function(){this.set("node",this.get("node"))}}),i.NAME=i.NS="nodescroll",e.Plugin.DDNodeScroll=i,e.DD.Scroll=n},"3.7.2",{requires:["dd-drag"]});+YUI.add("dd-scroll",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r,i,s="host",o="buffer",u="parentScroll",a="windowScroll",f="scrollTop",l="scrollLeft",c="offsetWidth",h="offsetHeight";n.ATTRS={parentScroll:{value:!1,setter:function(e){return e?e:!1}},buffer:{value:30,validator:e.Lang.isNumber},scrollDelay:{value:235,validator:e.Lang.isNumber},host:{value:null},windowScroll:{value:!1,validator:e.Lang.isBoolean},vertical:{value:!0,validator:e.Lang.isBoolean},horizontal:{value:!0,validator:e.Lang.isBoolean}},e.extend(n,e.Base,{_scrolling:null,_vpRegionCache:null,_dimCache:null,_scrollTimer:null,_getVPRegion:function(){var e={},t=this.get(u),n=this.get(o),r=this.get(a),i=r?[]:t.getXY(),s=r?"winWidth":c,p=r?"winHeight":h,d=r?t.get(f):i[1],v=r?t.get(l):i[0];return e={top:d+n,right:t.get(s)+v-n,bottom:t.get(p)+d-n,left:v+n},this._vpRegionCache=e,e},initializer:function(){var t=this.get(s);t.after("drag:start",e.bind(this.start,this)),t.after("drag:end",e.bind(this.end,this)),t.on("drag:align",e.bind(this.align,this)),e.one("win").on("scroll",e.bind(function(){this._vpRegionCache=null},this))},_checkWinScroll:function(e){var t=this._getVPRegion(),n=this.get(s),r=this.get(a),i=n.lastXY,c=!1,h=this.get(o),p=this.get(u),d=p.get(f),v=p.get(l),m=this._dimCache.w,g=this._dimCache.h,y=i[1]+g,b=i[1],w=i[0]+m,E=i[0],S=b,x=E,T=d,N=v;this.get("horizontal")&&(E<=t.left&&(c=!0,x=i[0]-(r?h:0),N=v-h),w>=t.right&&(c=!0,x=i[0]+(r?h:0),N=v+h)),this.get("vertical")&&(y>=t.bottom&&(c=!0,S=i[1]+(r?h:0),T=d+h),b<=t.top&&(c=!0,S=i[1]-(r?h:0),T=d-h)),T<0&&(T=0,S=i[1]),N<0&&(N=0,x=i[0]),S<0&&(S=i[1]),x<0&&(x=i[0]),n.con&&(n.con.inRegion([x+N,S+T])||(e=!1)),e?(n.actXY=[x,S],n._alignNode([x,S],!0),i=n.actXY,n.actXY=[x,S],n._moveNode({node:p,top:T,left:N}),!T&&!N&&this._cancelScroll()):c?this._initScroll():this._cancelScroll()},_initScroll:function(){this._cancelScroll(),this._scrollTimer=e.Lang.later(this.get("scrollDelay"),this,this._checkWinScroll,[!0],!0)},_cancelScroll:function(){this._scrolling=!1,this._scrollTimer&&(this._scrollTimer.cancel(),delete this._scrollTimer)},align:function(e){this._scrolling&&(this._cancelScroll(),e.preventDefault()),this._scrolling||this._checkWinScroll()},_setDimCache:function(){var e=this.get(s).get("dragNode");this._dimCache={h:e.get(h),w:e.get(c)}},start:function(){this._setDimCache()},end:function(){this._dimCache=null,this._cancelScroll()}}),e.namespace("Plugin"),r=function(){r.superclass.constructor.apply(this,arguments)},r.ATTRS=e.merge(n.ATTRS,{windowScroll:{value:!0,setter:function(t){return t&&this.set(u,e.one("win")),t}}}),e.extend(r,n,{initializer:function(){this.set("windowScroll",this.get("windowScroll"))}}),r.NAME=r.NS="winscroll",e.Plugin.DDWinScroll=r,i=function(){i.superclass.constructor.apply(this,arguments)},i.ATTRS=e.merge(n.ATTRS,{node:{value:!1,setter:function(t){var n=e.one(t);return n?this.set(u,n):t!==!1&&e.error("DDNodeScroll: Invalid Node Given: "+t),n}}}),e.extend(i,n,{initializer:function(){this.set("node",this.get("node"))}}),i.NAME=i.NS="nodescroll",e.Plugin.DDNodeScroll=i,e.DD.Scroll=n},"3.7.3",{requires:["dd-drag"]});
bundle/dd-scroll/dd-scroll.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -140,7 +140,7 @@ * @private * @method _getVPRegion * @description Sets the _vpRegionCache property with an Object containing the dims from the viewport.- */ + */ _getVPRegion: function() { var r = {}, n = this.get(PARENT_SCROLL),@@ -177,7 +177,7 @@ * @method _checkWinScroll * @description Check to see if we need to fire the scroll timer. If scroll timer is running this will scroll the window. * @param {Boolean} move Should we move the window. From Y.later- */ + */ _checkWinScroll: function(move) { var r = this._getVPRegion(), ho = this.get(HOST),@@ -198,7 +198,7 @@ nl = left, st = sTop, sl = sLeft;- + if (this.get('horizontal')) { if (left <= r.left) { scroll = true;@@ -267,7 +267,7 @@ * @private * @method _initScroll * @description Cancel a previous scroll timer and init a new one.- */ + */ _initScroll: function() { this._cancelScroll(); this._scrollTimer = Y.Lang.later(this.get('scrollDelay'), this, this._checkWinScroll, [true], true);@@ -277,7 +277,7 @@ * @private * @method _cancelScroll * @description Cancel a currently running scroll timer.- */ + */ _cancelScroll: function() { this._scrolling = false; if (this._scrollTimer) {@@ -288,7 +288,7 @@ /** * @method align * @description Called from the drag:align event to determine if we need to scroll.- */ + */ align: function(e) { if (this._scrolling) { this._cancelScroll();@@ -302,7 +302,7 @@ * @private * @method _setDimCache * @description Set the cache of the dragNode dims.- */ + */ _setDimCache: function() { var node = this.get(HOST).get('dragNode'); this._dimCache = {@@ -321,7 +321,7 @@ * @method end * @description Called from the drag:end event */- end: function(xy) {+ end: function() { this._dimCache = null; this._cancelScroll(); }@@ -329,7 +329,7 @@ Y.namespace('Plugin'); - + /** * Extends the Scroll class to make the window scroll while dragging. * @class DDWindowScroll@@ -373,8 +373,8 @@ */ WS.NAME = WS.NS = 'winscroll'; Y.Plugin.DDWinScroll = WS;- + /** * Extends the Scroll class to make a parent node scroll while dragging. * @class DDNodeScroll@@ -425,9 +425,9 @@ NS.NAME = NS.NS = 'nodescroll'; Y.Plugin.DDNodeScroll = NS; - Y.DD.Scroll = S; + Y.DD.Scroll = S; -}, '3.7.2', {"requires": ["dd-drag"]});+}, '3.7.3', {"requires": ["dd-drag"]});
bundle/dial/assets/dial-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/dial/assets/skins/night/dial-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/dial/assets/skins/night/dial.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/dial/assets/skins/sam/dial-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/dial/assets/skins/sam/dial.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/dial/dial-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/dial/dial.js", code: [] };-_yuitest_coverage["build/dial/dial.js"].code=["YUI.add('dial', function (Y, NAME) {","","/**"," * Create a circular dial value range input visualized as a draggable handle on a"," * background element."," * "," * @module dial"," */"," var supportsVML = false;"," //testVMLNode;",""," if (Y.UA.ie && Y.UA.ie < 9){"," supportsVML = true;"," }",""," var Lang = Y.Lang,"," Widget = Y.Widget,"," Node = Y.Node;",""," /**"," * Create a dial to represent an input control capable of representing a"," * series of intermediate states based on the position of the Dial's handle."," * These states are typically aligned to a value algorithm whereby the angle of the handle's"," * position corresponds to a given value."," *"," * @class Dial"," * @extends Widget"," * @param config {Object} Configuration object"," * @constructor"," */"," function Dial(config) {"," Dial.superclass.constructor.apply(this, arguments);"," }",""," // Y.Dial static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'dial'"," * @readOnly"," * @protected"," * @static"," */"," Dial.NAME = \"dial\";",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," Dial.ATTRS = {",""," /**"," * minimum value allowed"," *"," * @attribute min"," * @type {Number}"," * @default -220"," */"," min : {"," value:-220"," },",""," /**"," * maximum value allowed"," *"," * @attribute max"," * @type {Number}"," * @default 220"," */"," max : {"," value:220"," },",""," /**"," * diameter of the circular background object."," * Other objects scale accordingly."," * Set this only before rendering."," *"," * @attribute diameter"," * @type {Number} the number of px in diameter"," * @default 100"," * @writeOnce"," */"," diameter : {"," value:100"," },",""," /**"," * diameter of the handle object which users drag to change the value."," * Dial sets the pixel dimension of the handle equal to handleDiameter * diameter."," * Set this only before rendering."," *"," * @attribute handleDiameter"," * @type {Number}"," * @default 0.2"," * @writeOnce"," */"," handleDiameter : {"," value:0.2"," },",""," /**"," * diameter of the marker object which follows the angle of the handle during value changes."," * Dial sets the pixel dimension of the marker equal to markerDiameter * diameter."," * Set this only before rendering."," *"," * @attribute markerDiameter"," * @type {Number}"," * @default 0.1"," * @writeOnce"," */"," markerDiameter : {"," value:0.1"," },",""," /**"," * diameter of the center button object."," * Dial sets the pixel dimension of the centerButton equal to centerButtonDiameter * diameter."," * Set this only before rendering."," *"," * @attribute centerButtonDiameter"," * @type {Number}"," * @default 0.1"," * @writeOnce"," */"," centerButtonDiameter : {"," value:0.5"," },",""," /**"," * initial value of the Dial"," *"," * @attribute value"," * @type {Number}"," * @default 0"," */"," value : {"," value:0,"," validator: function(val) {"," return this._validateValue(val);"," }"," },"," "," /**"," * amount to increment/decrement the dial value"," * when the arrow up/down/left/right keys are pressed"," *"," * @attribute minorStep"," * @type {Number}"," * @default 1"," */"," minorStep : {"," value:1"," },",""," /**"," * amount to increment/decrement the dial value"," * when the page up/down keys are pressed"," *"," * @attribute majorStep"," * @type {Number}"," * @default 10"," */"," majorStep : {"," value:10"," },",""," /**"," * number of value increments in one 360 degree revolution "," * of the handle around the dial"," *"," * @attribute stepsPerRevolution"," * @type {Number}"," * @default 100"," */"," stepsPerRevolution : {"," value:100"," },",""," /**"," * number of decimal places of accuracy in the value "," *"," * @attribute decimalPlaces"," * @type {Number}"," * @default 0"," */"," decimalPlaces : {"," value:0"," },",""," /**"," * visible strings for the dial UI. This attribute is "," * defined by the base Widget class but has an empty value. The"," * Dial is simply providing a default value for the attribute."," * Gets localized strings in the current language"," *"," * @attribute strings"," * @type {Object} the values are HTML strings"," * @default {label: 'My label', resetStr: 'Reset', tooltipHandle: 'Drag to set value'}"," */"," strings: {"," valueFn: function () {"," return Y.Intl.get('dial');"," }"," },",""," /**"," * distance from the center of the dial to the "," * center of the marker and handle, when at rest. "," * The value is a percent of the radius of the dial."," *"," * @attribute handleDistance"," * @type {number}"," * @default 0.75"," */"," handleDistance:{"," value:0.75"," }"," "," };",""," /**"," * returns a properly formed yui class name"," *"," * @method"," * @param {String} string to be appended at the end of class name"," * @return"," * @private"," */"," function makeClassName(str) {"," return Y.ClassNameManager.getClassName(Dial.NAME, str);"," }"," "," /** array of static constants used to identify the classname applied to the Dial DOM objects "," *"," * @property CSS_CLASSES"," * @type {Array}"," * @private"," * @static"," */"," Dial.CSS_CLASSES = {"," label : makeClassName(\"label\"),"," labelString : makeClassName(\"label-string\"),"," valueString : makeClassName(\"value-string\"),"," northMark : makeClassName(\"north-mark\"),"," ring : makeClassName('ring'),"," ringVml : makeClassName('ring-vml'),"," marker : makeClassName(\"marker\"),"," markerVml : makeClassName(\"marker-vml\"),"," markerMaxMin : makeClassName(\"marker-max-min\"),"," centerButton : makeClassName(\"center-button\"),"," centerButtonVml : makeClassName('center-button-vml'),"," resetString : makeClassName(\"reset-string\"),"," handle : makeClassName(\"handle\"),"," handleVml : makeClassName(\"handle-vml\"),"," hidden : makeClassName(\"hidden\"),"," dragging : Y.ClassNameManager.getClassName(\"dd-dragging\")"," };"," "," /* Static constants used to define the markup templates used to create Dial DOM elements */"," ",""," /**"," * template that will contain the Dial's label."," *"," * @property LABEL_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-label]\"><span id=\"\" class=\"[...-label-string]\">{label}</span><span class=\"[...-value-string]\"></span></div>"," * @protected"," */",""," Dial.LABEL_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.label + '\"><span id=\"\" class=\"' + Dial.CSS_CLASSES.labelString + '\">{label}</span><span class=\"' + Dial.CSS_CLASSES.valueString + '\"></span></div>';",""," if(supportsVML === false){"," /**"," * template that will contain the Dial's background ring."," *"," * @property RING_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-ring]\"><div class=\"[...-northMark]\"></div></div>"," * @protected"," */"," Dial.RING_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.ring + '\"><div class=\"' + Dial.CSS_CLASSES.northMark + '\"></div></div>';",""," /**"," * template that will contain the Dial's current angle marker."," *"," * @property MARKER_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-marker] [...-marker-hidden]\"><div class=\"[...-markerUser]\"></div></div>"," * @protected"," */"," Dial.MARKER_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.marker + ' ' + Dial.CSS_CLASSES.hidden + '\"></div>';",""," /**"," * template that will contain the Dial's center button."," *"," * @property CENTER_BUTTON_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-centerButton]\"><div class=\"[...-resetString]\">' + Y.Lang.sub('{resetStr}', Dial.ATTRS.strings.value) + '</div></div>"," * @protected"," */"," Dial.CENTER_BUTTON_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.centerButton + '\"><div class=\"' + Dial.CSS_CLASSES.resetString + ' ' + Dial.CSS_CLASSES.hidden + '\">{resetStr}</div></div>';",""," /**"," * template that will contain the Dial's handle."," *"," * @property HANDLE_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-handle]\"><div class=\"[...-handleUser]\" aria-labelledby=\"\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\"></div></div>';// title=\"{tooltipHandle}\""," * @protected"," */"," Dial.HANDLE_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.handle + '\" aria-labelledby=\"\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\" title=\"{tooltipHandle}\">';"," "," }else{ // VML case"," Dial.RING_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.ring + ' ' + Dial.CSS_CLASSES.ringVml + '\">'+"," '<div class=\"' + Dial.CSS_CLASSES.northMark + '\"></div>'+"," '<v:oval strokecolor=\"#ceccc0\" strokeweight=\"1px\"><v:fill type=gradient color=\"#8B8A7F\" color2=\"#EDEDEB\" angle=\"45\"/></v:oval>'+"," '</div>'+"," '';"," Dial.MARKER_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.markerVml + ' ' + Dial.CSS_CLASSES.hidden + '\">'+"," '<v:oval stroked=\"false\">'+"," '<v:fill opacity=\"20%\" color=\"#000\"/>'+"," '</v:oval>'+"," '</div>'+"," '';"," Dial.CENTER_BUTTON_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.centerButton + ' ' + Dial.CSS_CLASSES.centerButtonVml + '\">'+"," '<v:oval strokecolor=\"#ceccc0\" strokeweight=\"1px\">'+"," '<v:fill type=gradient color=\"#C7C5B9\" color2=\"#fefcf6\" colors=\"35% #d9d7cb, 65% #fefcf6\" angle=\"45\"/>'+"," '<v:shadow on=\"True\" color=\"#000\" opacity=\"10%\" offset=\"2px, 2px\"/>'+"," '</v:oval>'+"," '<div class=\"' + Dial.CSS_CLASSES.resetString + ' ' + Dial.CSS_CLASSES.hidden + '\">{resetStr}</div>'+"," '</div>'+"," '';"," Dial.HANDLE_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.handleVml + '\" aria-labelledby=\"\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\" title=\"{tooltipHandle}\">'+"," '<v:oval stroked=\"false\">'+"," '<v:fill opacity=\"20%\" color=\"#6C3A3A\"/>'+"," '</v:oval>'+"," '</div>'+"," '';"," }",""," /* Dial extends the base Widget class */"," Y.extend(Dial, Widget, {",""," /**"," * creates the DOM structure for the Dial."," *"," * @method renderUI"," * @protected"," */"," renderUI : function() {"," this._renderLabel();"," this._renderRing();"," this._renderMarker();"," this._renderCenterButton();"," this._renderHandle();"," "," // object handles"," this.contentBox = this.get(\"contentBox\");",""," // constants"," this._originalValue = this.get('value');"," this._minValue = this.get('min'); // saves doing a .get many times, but we need to remember to update this if/when we allow changing min or max after instantiation"," this._maxValue = this.get('max');"," this._stepsPerRevolution = this.get('stepsPerRevolution');"," this._minTimesWrapped = (Math.floor(this._minValue / this._stepsPerRevolution - 1));"," this._maxTimesWrapped = (Math.floor(this._maxValue / this._stepsPerRevolution + 1));",""," // variables"," this._timesWrapped = 0;"," this._angle = this._getAngleFromValue(this.get('value'));"," this._prevAng = this._angle;"," "," // init"," this._setTimesWrappedFromValue(this._originalValue);"," this._handleNode.set('aria-valuemin', this._minValue);"," this._handleNode.set('aria-valuemax', this._maxValue);"," },",""," /**"," * Sets -webkit-border-radius to 50% of width/height of the ring, handle, marker, and center-button."," * This is needed for iOS 3.x."," * The objects render square if the radius is > 50% of the width/height"," * @method _setBorderRadius"," * @private"," */"," _setBorderRadius : function(){"," this._ringNode.setStyles({'WebkitBorderRadius':this._ringNodeRadius + 'px',"," 'MozBorderRadius':this._ringNodeRadius + 'px',"," 'borderRadius':this._ringNodeRadius + 'px'"," });"," this._handleNode.setStyles({'WebkitBorderRadius':this._handleNodeRadius + 'px',"," 'MozBorderRadius':this._handleNodeRadius + 'px',"," 'borderRadius':this._handleNodeRadius + 'px'"," });"," this._markerNode.setStyles({'WebkitBorderRadius':this._markerNodeRadius + 'px',"," 'MozBorderRadius':this._markerNodeRadius + 'px',"," 'borderRadius':this._markerNodeRadius + 'px'"," });"," this._centerButtonNode.setStyles({'WebkitBorderRadius':this._centerButtonNodeRadius + 'px',"," 'MozBorderRadius':this._centerButtonNodeRadius + 'px',"," 'borderRadius':this._centerButtonNodeRadius + 'px'"," });"," },"," "," /**"," * Handles the mouseenter on the centerButton"," * "," * @method _handleCenterButtonEnter"," * @protected"," */"," _handleCenterButtonEnter : function(){"," this._resetString.removeClass(Dial.CSS_CLASSES.hidden); "," }, "," "," /**"," * Handles the mouseleave on the centerButton"," * "," * @method _handleCenterButtonLeave"," * @protected"," */"," _handleCenterButtonLeave : function(){"," this._resetString.addClass(Dial.CSS_CLASSES.hidden); "," }, "," "," /**"," * Creates the Y.DD.Drag instance used for the handle movement and"," * binds Dial interaction to the configured value model."," *"," * @method bindUI"," * @protected"," */"," bindUI : function() {"," this.after(\"valueChange\", this._afterValueChange);",""," var boundingBox = this.get(\"boundingBox\"),"," // Looking for a key event which will fire continously across browsers while the key is held down."," keyEvent = (!Y.UA.opera) ? \"down:\" : \"press:\", "," // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home"," keyEventSpec = keyEvent + \"38,40,33,34,35,36\","," // 37 , 39 = arrow left/right"," keyLeftRightSpec = keyEvent + \"37,39\","," // 37 , 39 = arrow left/right + meta (command/apple key) for mac"," keyLeftRightSpecMeta = keyEvent + \"37+meta,39+meta\";",""," Y.on(\"key\", Y.bind(this._onDirectionKey, this), boundingBox, keyEventSpec);"," Y.on(\"key\", Y.bind(this._onLeftRightKey, this), boundingBox, keyLeftRightSpec);"," boundingBox.on(\"key\", this._onLeftRightKeyMeta, keyLeftRightSpecMeta, this);",""," Y.on('mouseenter', Y.bind(this._handleCenterButtonEnter, this), this._centerButtonNode);"," Y.on('mouseleave', Y.bind(this._handleCenterButtonLeave, this), this._centerButtonNode);"," // Needed to replace mousedown/up with gesturemovestart/end to make behavior on touch devices work the same."," Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441] "," Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); "," Y.on('gesturemovestart', Y.bind(this._handleHandleMousedown, this), this._handleNode);",""," Y.on('gesturemovestart', Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766] "," Y.on('gesturemoveend', Y.bind(this._handleRingMouseup, this), this._ringNode);",""," this._dd1 = new Y.DD.Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so "," node: this._handleNode,"," on : {"," 'drag:drag' : Y.bind(this._handleDrag, this),"," 'drag:start' : Y.bind(this._handleDragStart, this),"," 'drag:end' : Y.bind(this._handleDragEnd, this) //,"," }"," });"," Y.bind(this._dd1.addHandle(this._ringNode), this); // [#2530206] added the ring as a handle to the dd1 (the dd of the handleNode)"," },",""," /**"," * Sets _timesWrapped based on Dial value"," * to net integer revolutions the user dragged the handle around the Dial"," *"," * @method _setTimesWrappedFromValue"," * @param val {Number} current value of the Dial"," * @private"," */"," _setTimesWrappedFromValue : function(val){"," if(val % this._stepsPerRevolution === 0){"," this._timesWrapped = (val / this._stepsPerRevolution);"," }else{"," this._timesWrapped = Math.floor(val / this._stepsPerRevolution);"," }"," },"," "," /**"," * gets the angle of the line from the center of the Dial to the center of the handle "," *"," * @method _getAngleFromHandleCenter"," * @param handleCenterX {number} "," * @param handleCenterY {number}"," * @return ang {number} the angle"," * @protected"," */"," _getAngleFromHandleCenter : function(handleCenterX, handleCenterY){"," var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI); "," ang = ((this._dialCenterX - handleCenterX) < 0) ? ang + 90 : ang + 90 + 180; // Compensate for neg angles from Math.atan"," return ang;"," },"," "," /**"," * calculates the XY of the center of the dial relative to the ring node. "," * This is needed for calculating the angle of the handle"," *"," * @method _calculateDialCenter"," * @protected"," */"," _calculateDialCenter : function(){ // #2531111 value, and marker don't track handle when dial position changes on page (resize when inline)"," this._dialCenterX = this._ringNode.get('offsetWidth') / 2; "," this._dialCenterY = this._ringNode.get('offsetHeight') / 2;"," },"," "," /**"," * Handles the mouseup on the ring"," * "," * @method _handleRingMouseup"," * @protected"," */"," _handleRingMouseup : function(){"," this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] "," }, "," "," /**"," * Handles the mouseup on the centerButton"," * "," * @method _handleCenterButtonMouseup"," * @protected"," */"," _handleCenterButtonMouseup : function(){"," this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] "," }, "," "," /**"," * Handles the mousedown on the handle"," * "," * @method _handleHandleMousedown"," * @protected"," */"," _handleHandleMousedown : function(){"," this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]"," // this is better done here instead of on _handleDragEnd "," // because we should make the keyboard accessible after a click of the handle "," }, "," "," /**"," * handles the user dragging the handle around the Dial, gets the angle, "," * checks for wrapping around top center."," * Sets the new value of the Dial"," *"," * @method _handleDrag"," * @param e {DOMEvent} the drag event object"," * @protected"," */"," _handleDrag : function(e){"," var handleCenterX,"," handleCenterY,"," ang,"," newValue;",""," // The event was emitted from drag:drag of handle. "," // The center of the handle is top left position of the handle node + radius of handle."," // This is different than a mousedown on the ring."," handleCenterX = (parseInt(this._handleNode.getStyle('left'),10) + this._handleNodeRadius);"," handleCenterY = (parseInt(this._handleNode.getStyle('top'),10) + this._handleNodeRadius);"," ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);",""," // check for need to set timesWrapped"," if((this._prevAng > 270) && (ang < 90)){ // If wrapping, clockwise"," if(this._timesWrapped < this._maxTimesWrapped){"," this._timesWrapped = (this._timesWrapped + 1);"," }"," }else if((this._prevAng < 90) && (ang > 270)){ // if un-wrapping, counter-clockwise"," if(this._timesWrapped > this._minTimesWrapped){"," this._timesWrapped = (this._timesWrapped - 1);"," }"," }"," newValue = this._getValueFromAngle(ang); // This function needs the current _timesWrapped value. That's why it comes after the _timesWrapped code above"," "," // If you've gone past max more than one full revolution, we decrement the _timesWrapped value"," // This gives the effect of a ratchet mechanism."," // It feels like you are never more than one revolution past max"," // The effect is the same for min, only in reverse."," // We can't reset the _timesWrapped to the max or min here."," // If we did, the next (continuous) drag would reset the value incorrectly."," if(newValue > (this._maxValue + this._stepsPerRevolution) ){"," this._timesWrapped --;"," }else if(newValue < (this._minValue - this._stepsPerRevolution) ){"," this._timesWrapped ++;"," }"," this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress ",""," this._handleValuesBeyondMinMax(e, newValue);"," },",""," /**"," * handles a mousedown or gesturemovestart event on the ring node"," *"," * @method _handleMousedown"," * @param e {DOMEvent} the event object"," * @private"," */"," _handleMousedown : function(e){ // #2530306"," var minAng = this._getAngleFromValue(this._minValue),"," maxAng = this._getAngleFromValue(this._maxValue),"," newValue, oppositeMidRangeAngle,"," handleCenterX, handleCenterY, "," ang;",""," // The event was emitted from mousedown on the ring node,"," // so the center of the handle should be the XY of mousedown. "," if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click"," handleCenterX = (e.clientX - this._ringNode.getX());"," handleCenterY = (e.clientY - this._ringNode.getY());"," }else{"," handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());"," handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY());"," }"," ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);"," "," /* ///////////////////////////////////////////////////////////////////////////////////////////////////////"," * The next sections of logic"," * set this._timesWrapped in the different cases of value range"," * and value range position, "," * then the Dial value is set at the end of this method"," */ ///////////////////////////////////////////////////////////////////////////////////////////////////////"," "," "," ////////////////////////////////////////////////////////////////////////////////////////////////////////////"," if(this._maxValue - this._minValue > this._stepsPerRevolution){"," // Case: range min-to-max is greater than stepsPerRevolution (one revolution) ",""," // This checks the shortest way around the dial between the prevAng and this ang."," if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping"," "," // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped "," if((this._timesWrapped > this._minTimesWrapped) && "," (this._timesWrapped < this._maxTimesWrapped)"," ){ "," // this checks which direction, clock wise or CCW and incr or decr _timesWrapped"," this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);"," }"," // special case of getting un-stuck from a min value case "," // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry"," // because prevAng is set to 0 or > 0"," }else if("," (this._timesWrapped === this._minTimesWrapped) && "," (ang - this._prevAng < 180)"," ){ "," this._timesWrapped ++;"," } //it didn't cross a wrapping boundary",""," } /////////////////////////////////////////////////////////////////////////////////////////////////////////"," else if(this._maxValue - this._minValue === this._stepsPerRevolution){ "," // Case: range min-to-max === stepsPerRevolution (one revolution)"," // This means min and max will be at same angle"," // This does not mean they are at \"north\" "," "," if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)"," // The only way it can be, is if min and max are not at north"," this._timesWrapped = 1;"," }else{"," this._timesWrapped = 0;"," }"," "," } //////////////////////////////////////////////////////////////////////////////////////////////////////////"," else if(minAng > maxAng){ "," // Case: range includes the wrap point (north) "," // Because of \"else if\"..."," // range is < stepsPerRevolution"," "," if( "," (this._prevAng >= minAng) && // if prev angle was greater than angle of min and..."," (ang <= (minAng + maxAng) / 2) // the angle of this click is less than "," // the angle opposite the mid-range angle, then..."," ){"," this._timesWrapped ++; "," }else if( "," (this._prevAng <= maxAng) && "," // if prev angle is < max angle and..."," "," (ang > (minAng + maxAng) / 2)"," // the angle of this click is greater than,"," // the angle opposite the mid-range angle and..."," "," ){ "," this._timesWrapped --;"," }"," "," } ////////////////////////////////////////////////////////////////////////////////////////////////////"," else{ "," // \"else\" Case: min-to-max range doesn't include the wrap point"," // Because of \"else if\"..."," // range is still < stepsPerRevolution"," "," if ((ang < minAng) || (ang > maxAng)){ // angle is out of range"," oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360; "," // This is the bisection of the min-to-max range + 180. (opposite the bisection)",""," if(oppositeMidRangeAngle > 180){"," newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');"," }else{ //oppositeMidRangeAngle <= 180"," newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');"," }"," this._prevAng = this._getAngleFromValue(newValue);"," this.set('value', newValue);"," this._setTimesWrappedFromValue(newValue);"," return;"," }"," }"," "," // Now that _timesWrapped is set value ......................................................................."," newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value."," this._prevAng = ang; ",""," this._handleValuesBeyondMinMax(e, newValue);"," },",""," /**"," * handles the case where the value is less than min or greater than max"," *"," * @method _handleValuesBeyondMinMax"," * @param e {DOMEvent} the event object"," * @param newValue {number} current value of the dial"," * @protected"," */"," _handleValuesBeyondMinMax : function(e, newValue){ // #2530306"," // If _getValueFromAngle() is passed 0, it increments the _timesWrapped value."," // handle hitting max and min and going beyond, stops at max or min "," if((newValue >= this._minValue) && (newValue <= this._maxValue)) {"," this.set('value', newValue);"," // [#2530206] transfer the mousedown event from the _ringNode to the _handleNode drag, so we can mousedown, then continue dragging"," if(e.currentTarget === this._ringNode){"," // Delegate to DD's natural behavior"," this._dd1._handleMouseDownEvent(e);"," } "," }else if(newValue > this._maxValue){"," this.set('value', this._maxValue);"," if(e.type === 'gesturemovestart'){"," this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag"," } "," }else if(newValue < this._minValue){"," this.set('value', this._minValue);"," if(e.type === 'gesturemovestart'){"," this._prevAng = this._getAngleFromValue(this._minValue);"," } "," }"," },",""," /**"," * handles the user starting to drag the handle around the Dial"," *"," * @method _handleDragStart"," * @param e {DOMEvent} the drag event object"," * @protected"," */"," _handleDragStart : function(e){"," this._markerNode.removeClass(Dial.CSS_CLASSES.hidden);"," },",""," /*"," * When handle is handleDragEnd, this animates the return to the fixed dial"," */ ",""," /**"," * handles the end of a user dragging the handle, animates the handle returning to"," * resting position."," *"," * @method _handleDragEnd"," * @protected"," */"," _handleDragEnd : function(){"," var node = this._handleNode; "," node.transition({"," duration: 0.08, // seconds"," easing: 'ease-in',"," left: this._setNodeToFixedRadius(this._handleNode, true)[0] + 'px',"," top: this._setNodeToFixedRadius(this._handleNode, true)[1] + 'px'"," }, Y.bind(function(){"," var value = this.get('value');"," //[#2530206] only hide marker if not at max or min"," // more persistant user visibility of when the dial is at max or min"," if((value > this._minValue) && (value < this._maxValue)){"," this._markerNode.addClass(Dial.CSS_CLASSES.hidden);"," }else{"," this._setTimesWrappedFromValue(value); //#2530766 secondary bug when drag past max + cross wrapping boundry"," this._prevAng = this._getAngleFromValue(value); //#2530766 secondary bug when drag past max + cross wrapping boundry"," }"," }, this)"," );"," },",""," /**"," * returns the XY of the fixed position, handleDistance, from the center of the Dial (resting position)."," * The XY also represents the angle related to the current value."," * If typeArray is true, [X,Y] is returned."," * If typeArray is false, the XY of the obj node passed in is set."," *"," * @method _setNodeToFixedRadius"," * @param obj {Node}"," * @param typeArray {Boolean} true returns an array [X,Y]"," * @protected"," * @return {Array} an array of [XY] is optionally returned"," */"," _setNodeToFixedRadius : function(obj, typeArray){"," var thisAngle = (this._angle - 90),"," rad = (Math.PI / 180),"," newY = Math.round(Math.sin(thisAngle * rad) * this._handleDistance),"," newX = Math.round(Math.cos(thisAngle * rad) * this._handleDistance),"," dia = obj.get('offsetWidth'); //Ticket #2529852"," "," newY = newY - (dia * 0.5);"," newX = newX - (dia * 0.5);"," if(typeArray){ // just need the style for css transform left and top to animate the handle drag:end"," return [(this._ringNodeRadius + newX), (this._ringNodeRadius + newY)];"," }else{"," obj.setStyle('left', (this._ringNodeRadius + newX) + 'px');"," obj.setStyle('top', (this._ringNodeRadius + newY) + 'px');"," }"," },",""," /**"," * Synchronizes the DOM state with the attribute settings."," *"," * @method syncUI"," */"," syncUI : function() {"," // Make the marker and the resetString display so their placement and borderRadius can be calculated, then hide them again."," // We would have used visibility:hidden in the css of this class, "," // but IE8 VML never returns to visible after applying visibility:hidden then removing it."," this._setSizes();"," this._calculateDialCenter(); // #2531111 initialize center of dial"," this._setBorderRadius();"," this._uiSetValue(this.get(\"value\"));"," this._markerNode.addClass(Dial.CSS_CLASSES.hidden);"," this._resetString.addClass(Dial.CSS_CLASSES.hidden);"," },",""," /**"," * sets the sizes of ring, center-button, marker, handle, and VML ovals in pixels."," * Needed only because some IE versions "," * ignore CSS percent sizes/offsets."," * so these must be set in pixels."," * Normally these are set in % of the ring."," *"," * @method _setSizes"," * @protected"," */"," _setSizes : function(){"," var dia = this.get('diameter'),"," offset, offsetResetX, offsetResetY,"," setSize = function(node, dia, percent){"," var suffix = 'px';"," node.getElementsByTagName('oval').setStyle('width', (dia * percent) + suffix);"," node.getElementsByTagName('oval').setStyle('height', (dia * percent) + suffix);"," node.setStyle('width', (dia * percent) + suffix);"," node.setStyle('height', (dia * percent) + suffix);"," };"," setSize(this._ringNode, dia, 1.0);"," setSize(this._handleNode, dia, this.get('handleDiameter'));"," setSize(this._markerNode, dia, this.get('markerDiameter'));"," setSize(this._centerButtonNode, dia, this.get('centerButtonDiameter'));"," "," // Set these (used for trig) this way instead of relative to dia, "," // in case they have borders, have images etc."," this._ringNodeRadius = this._ringNode.get('offsetWidth') * 0.5;"," this._handleNodeRadius = this._handleNode.get('offsetWidth') * 0.5;"," this._markerNodeRadius = this._markerNode.get('offsetWidth') * 0.5;"," this._centerButtonNodeRadius = this._centerButtonNode.get('offsetWidth') * 0.5;"," this._handleDistance = this._ringNodeRadius * this.get('handleDistance');"," // place the centerButton"," offset = (this._ringNodeRadius - this._centerButtonNodeRadius);"," this._centerButtonNode.setStyle('left', offset + 'px');"," this._centerButtonNode.setStyle('top', offset + 'px');"," /* "," Place the resetString"," This seems like it should be able to be done with CSS,"," But since there is also a VML oval in IE that is absolute positioned,"," The resetString ends up behind the VML oval."," */"," offsetResetX = (this._centerButtonNodeRadius - (this._resetString.get('offsetWidth') * 0.5));"," offsetResetY = (this._centerButtonNodeRadius - (this._resetString.get('offsetHeight') * 0.5));"," this._resetString.setStyles({'left':offsetResetX + 'px', 'top':offsetResetY + 'px'});"," },","",""," /**"," * renders the DOM object for the Dial's label"," *"," * @method _renderLabel"," * @protected"," */"," _renderLabel : function() {"," var contentBox = this.get(\"contentBox\"),"," label = contentBox.one(\".\" + Dial.CSS_CLASSES.label);"," if (!label) {"," label = Node.create(Y.Lang.sub(Dial.LABEL_TEMPLATE, this.get('strings')));"," contentBox.append(label);"," }"," this._labelNode = label;"," this._valueStringNode = this._labelNode.one(\".\" + Dial.CSS_CLASSES.valueString);"," },",""," /**"," * renders the DOM object for the Dial's background ring"," *"," * @method _renderRing"," * @protected"," */"," _renderRing : function() {"," var contentBox = this.get(\"contentBox\"),"," ring = contentBox.one(\".\" + Dial.CSS_CLASSES.ring);"," if (!ring) {"," ring = contentBox.appendChild(Dial.RING_TEMPLATE);"," ring.setStyles({width:this.get('diameter') + 'px', height:this.get('diameter') + 'px'});"," }"," this._ringNode = ring;"," },",""," /**"," * renders the DOM object for the Dial's background marker which "," * tracks the angle of the user dragging the handle"," *"," * @method _renderMarker"," * @protected"," */"," _renderMarker : function() {"," var contentBox = this.get(\"contentBox\"),"," marker = contentBox.one(\".\" + Dial.CSS_CLASSES.marker);"," if (!marker) {"," marker = contentBox.one('.' + Dial.CSS_CLASSES.ring).appendChild(Dial.MARKER_TEMPLATE);"," }"," this._markerNode = marker;"," },"," "," /**"," * renders the DOM object for the Dial's center"," *"," * @method _renderCenterButton"," * @protected"," */"," _renderCenterButton : function() {"," var contentBox = this.get(\"contentBox\"),"," centerButton = contentBox.one(\".\" + Dial.CSS_CLASSES.centerButton);"," if (!centerButton) {"," centerButton = Node.create(Y.Lang.sub(Dial.CENTER_BUTTON_TEMPLATE, this.get('strings')));"," contentBox.one('.' + Dial.CSS_CLASSES.ring).append(centerButton);"," }"," this._centerButtonNode = centerButton;"," this._resetString = this._centerButtonNode.one('.' + Dial.CSS_CLASSES.resetString);"," },",""," /**"," * renders the DOM object for the Dial's user draggable handle"," *"," * @method _renderHandle"," * @protected"," */"," _renderHandle : function() { "," var labelId = Dial.CSS_CLASSES.label + Y.guid(), //get this unique id once then use for handle and label for ARIA"," contentBox = this.get(\"contentBox\"),"," handle = contentBox.one(\".\" + Dial.CSS_CLASSES.handle);"," if (!handle) {"," handle = Node.create(Y.Lang.sub(Dial.HANDLE_TEMPLATE, this.get('strings')));"," handle.setAttribute('aria-labelledby', labelId); // get unique id for specifying a label & handle for ARIA"," this._labelNode.one('.' + Dial.CSS_CLASSES.labelString).setAttribute('id', labelId); // When handle gets focus, screen reader will include label text when reading the value."," contentBox.one('.' + Dial.CSS_CLASSES.ring).append(handle);"," }"," this._handleNode = handle;"," },",""," /**"," * sets the visible UI label HTML string"," *"," * @method _setLabelString"," * @param str {HTML}"," * @protected"," * @deprecated Use DialObjName.set('strings',{'label':'My new label'}); before DialObjName.render();",""," */"," _setLabelString : function(str) {"," this.get(\"contentBox\").one(\".\" + Dial.CSS_CLASSES.labelString).setHTML(str);"," },",""," /**"," * sets the visible UI label HTML string"," *"," * @method _setResetString"," * @param str {HTML}"," * @protected"," * @deprecated Use DialObjName.set('strings',{'resetStr':'My new reset string'}); before DialObjName.render();"," */"," _setResetString : function(str) {"," this.get(\"contentBox\").one(\".\" + Dial.CSS_CLASSES.resetString).setHTML(str);"," // this._setXYResetString(); // This used to recenter the string in the button. Done with CSS now. Method has been removed."," // this._resetString.setHTML(''); //We no longer show/hide the reset string with setHTML but by addClass and removeClass .yui3-dial-reset-string-hidden"," },",""," /**"," * sets the tooltip HTML string in the Dial's handle"," *"," * @method _setTooltipString"," * @param str {HTML}"," * @protected"," * @deprecated Use DialObjName.set('strings',{'tooltipHandle':'My new tooltip'}); before DialObjName.render();"," */"," _setTooltipString : function(str) {"," this._handleNode.set('title', str);"," },",""," /**"," * sets the Dial's value in response to key events."," * Left and right keys are in a separate method "," * in case an implementation wants to increment values"," * but needs left and right arrow keys for other purposes."," *"," * @method _onDirectionKey"," * @param e {Event} the key event"," * @protected"," */"," _onDirectionKey : function(e) {"," e.preventDefault();"," switch (e.charCode) {"," case 38: // up"," this._incrMinor();"," break;"," case 40: // down"," this._decrMinor();"," break;"," case 36: // home"," this._setToMin();"," break;"," case 35: // end"," this._setToMax();"," break;"," case 33: // page up"," this._incrMajor();"," break;"," case 34: // page down"," this._decrMajor();"," break;"," }"," },",""," /**"," * sets the Dial's value in response to left or right key events"," *"," * @method _onLeftRightKey"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKey : function(e) {"," e.preventDefault();"," switch (e.charCode) {"," case 37: // left"," this._decrMinor();"," break;"," case 39: // right"," this._incrMinor();"," break;"," }"," },",""," /**"," * sets the Dial's value in response to left or right key events when a meta (mac command/apple) key is also pressed"," *"," * @method _onLeftRightKeyMeta"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKeyMeta : function(e) {"," e.preventDefault();"," switch (e.charCode) {"," case 37: // left + meta"," this._setToMin();"," break;"," case 39: // right + meta"," this._setToMax();"," break;"," }"," },"," "," /**"," * increments Dial value by a minor increment"," *"," * @method _incrMinor"," * @protected"," */"," _incrMinor : function(){"," var newVal = (this.get('value') + this.get(\"minorStep\"));"," newVal = Math.min(newVal, this.get(\"max\"));"," // [#2530045] .toFixed returns a string."," // Dial's value needs a number. -0 makes it a number, but removes trailing zeros."," // Added toFixed(...) again in _uiSetValue where content of yui3-dial-value-string is set."," // Removing the toFixed here, loses the feature of \"snap-to\" when for example, stepsPerRevolution is 10 and decimalPlaces is 0."," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },"," "," /**"," * decrements Dial value by a minor increment"," *"," * @method _decrMinor"," * @protected"," */"," _decrMinor : function(){"," var newVal = (this.get('value') - this.get(\"minorStep\"));"," newVal = Math.max(newVal, this.get(\"min\"));"," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },"," "," /**"," * increments Dial value by a major increment"," *"," * @method _incrMajor"," * @protected"," */"," _incrMajor : function(){"," var newVal = (this.get('value') + this.get(\"majorStep\"));"," newVal = Math.min(newVal, this.get(\"max\"));"," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },"," "," /**"," * decrements Dial value by a major increment"," *"," * @method _decrMajor"," * @protected"," */"," _decrMajor : function(){"," var newVal = (this.get('value') - this.get(\"majorStep\"));"," newVal = Math.max(newVal, this.get(\"min\"));"," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },",""," /**"," * sets Dial value to dial's max attr"," *"," * @method _setToMax"," * @protected"," */"," _setToMax : function(){"," this.set('value', this.get(\"max\"));"," }, "," "," /**"," * sets Dial value to dial's min attr"," *"," * @method _setToMin"," * @protected"," */"," _setToMin : function(){"," this.set('value', this.get(\"min\"));"," }, "," "," /**"," * resets Dial value to the orignal initial value. "," *"," * @method _resetDial"," * @protected"," */"," _resetDial : function(e){"," if(e){"," e.stopPropagation(); //[#2530206] need to add so mousedown doesn't propagate to ring and move the handle"," }"," this.set('value', this._originalValue);"," this._resetString.addClass(Dial.CSS_CLASSES.hidden); //[#2530441]"," this._handleNode.focus();"," },"," "," /**"," * returns the handle angle associated with the current value of the Dial. "," * Returns a number between 0 and 360."," *"," * @method _getAngleFromValue"," * @param newVal {Number} the current value of the Dial"," * @return {Number} the angle associated with the current Dial value"," * @protected"," */"," _getAngleFromValue : function(newVal){"," var nonWrappedPartOfValue = newVal % this._stepsPerRevolution,"," angleFromValue = nonWrappedPartOfValue / this._stepsPerRevolution * 360;"," return (angleFromValue < 0) ? (angleFromValue + 360) : angleFromValue;"," },",""," /**"," * returns the value of the Dial calculated from the current handle angle"," *"," * @method _getValueFromAngle"," * @param angle {Number} the current angle of the Dial's handle"," * @return {Number} the current Dial value corresponding to the handle position"," * @protected"," */"," _getValueFromAngle : function(angle){"," if(angle < 0){"," angle = (360 + angle);"," }else if(angle === 0){"," angle = 360;"," }"," var value = (angle / 360) * this._stepsPerRevolution;"," value = (value + (this._timesWrapped * this._stepsPerRevolution));"," //return Math.round(value * 100) / 100;"," return value.toFixed(this.get('decimalPlaces')) - 0;"," },",""," /**"," * calls the method to update the UI whenever the Dial value changes"," *"," * @method _afterValueChange"," * @param e {Event}"," * @protected"," */"," _afterValueChange : function(e) {"," this._uiSetValue(e.newVal);"," },",""," /**"," * Changes a value to have the correct decimal places per the attribute decimalPlaces"," *"," * @method _valueToDecimalPlaces"," * @param val {Number} a raw value to set to the Dial"," * @return {Number} the input val changed to have the correct decimal places"," * @protected"," */"," _valueToDecimalPlaces : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min."," "," },",""," /**"," * Updates the UI display value of the Dial to reflect "," * the value passed in."," * Makes all other needed UI display changes"," *"," * @method _uiSetValue"," * @param val {Number} value of the Dial"," * @protected"," */"," _uiSetValue : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min."," this._angle = this._getAngleFromValue(val);"," if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){"," this._setTimesWrappedFromValue(val);"," this._setNodeToFixedRadius(this._handleNode, false);"," this._prevAng = this._getAngleFromValue(this.get('value'));"," }"," this._valueStringNode.setHTML(val.toFixed(this.get('decimalPlaces'))); // [#2530045]"," this._handleNode.set('aria-valuenow', val);"," this._handleNode.set('aria-valuetext', val);"," this._setNodeToFixedRadius(this._markerNode, false);"," if((val === this._maxValue) || (val === this._minValue)){"," this._markerNode.addClass(Dial.CSS_CLASSES.markerMaxMin);"," if(supportsVML === true){"," this._markerNode.getElementsByTagName('fill').set('color', '#AB3232');"," }"," this._markerNode.removeClass(Dial.CSS_CLASSES.hidden);"," }else{ // not max or min"," if(supportsVML === true){"," this._markerNode.getElementsByTagName('fill').set('color', '#000');"," }"," this._markerNode.removeClass(Dial.CSS_CLASSES.markerMaxMin);"," if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){ // if not max || min, and not dragging handle, hide the marker"," this._markerNode.addClass(Dial.CSS_CLASSES.hidden);"," }"," }"," },",""," /**"," * value attribute default validator. Verifies that"," * the value being set lies between the min/max value"," *"," * @method _validateValue"," * @param val {Number} value of the Dial"," * @protected"," */"," _validateValue: function(val) {"," var min = this.get(\"min\"),"," max = this.get(\"max\");"," return (Lang.isNumber(val) && val >= min && val <= max);"," }"," });"," Y.Dial = Dial;","","","}, '3.7.2', {\"requires\": [\"widget\", \"dd-drag\", \"event-mouseenter\", \"event-move\", \"event-key\", \"transition\", \"intl\"], \"lang\": [\"en\", \"es\"], \"skinnable\": true});"];-_yuitest_coverage["build/dial/dial.js"].lines = {"1":0,"9":0,"12":0,"13":0,"16":0,"31":0,"32":0,"47":0,"58":0,"148":0,"211":0,"238":0,"239":0,"249":0,"280":0,"282":0,"291":0,"301":0,"311":0,"321":0,"324":0,"329":0,"335":0,"343":0,"352":0,"361":0,"362":0,"363":0,"364":0,"365":0,"368":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"379":0,"380":0,"381":0,"384":0,"385":0,"386":0,"397":0,"401":0,"405":0,"409":0,"422":0,"432":0,"443":0,"445":0,"455":0,"456":0,"457":0,"459":0,"460":0,"462":0,"463":0,"464":0,"466":0,"467":0,"469":0,"477":0,"489":0,"490":0,"492":0,"506":0,"507":0,"508":0,"519":0,"520":0,"530":0,"540":0,"550":0,"565":0,"573":0,"574":0,"575":0,"578":0,"579":0,"580":0,"582":0,"583":0,"584":0,"587":0,"595":0,"596":0,"597":0,"598":0,"600":0,"602":0,"613":0,"621":0,"622":0,"623":0,"625":0,"626":0,"628":0,"639":0,"643":0,"646":0,"650":0,"655":0,"659":0,"663":0,"668":0,"670":0,"672":0,"676":0,"681":0,"686":0,"687":0,"696":0,"705":0,"706":0,"709":0,"710":0,"712":0,"714":0,"715":0,"716":0,"717":0,"722":0,"723":0,"725":0,"739":0,"740":0,"742":0,"744":0,"746":0,"747":0,"748":0,"749":0,"751":0,"752":0,"753":0,"754":0,"767":0,"782":0,"783":0,"789":0,"792":0,"793":0,"795":0,"796":0,"815":0,"821":0,"822":0,"823":0,"824":0,"826":0,"827":0,"840":0,"841":0,"842":0,"843":0,"844":0,"845":0,"859":0,"862":0,"863":0,"864":0,"865":0,"866":0,"868":0,"869":0,"870":0,"871":0,"875":0,"876":0,"877":0,"878":0,"879":0,"881":0,"882":0,"883":0,"890":0,"891":0,"892":0,"903":0,"905":0,"906":0,"907":0,"909":0,"910":0,"920":0,"922":0,"923":0,"924":0,"926":0,"937":0,"939":0,"940":0,"942":0,"952":0,"954":0,"955":0,"956":0,"958":0,"959":0,"969":0,"972":0,"973":0,"974":0,"975":0,"976":0,"978":0,"991":0,"1003":0,"1017":0,"1031":0,"1032":0,"1034":0,"1035":0,"1037":0,"1038":0,"1040":0,"1041":0,"1043":0,"1044":0,"1046":0,"1047":0,"1049":0,"1050":0,"1062":0,"1063":0,"1065":0,"1066":0,"1068":0,"1069":0,"1081":0,"1082":0,"1084":0,"1085":0,"1087":0,"1088":0,"1099":0,"1100":0,"1105":0,"1115":0,"1116":0,"1117":0,"1127":0,"1128":0,"1129":0,"1139":0,"1140":0,"1141":0,"1151":0,"1161":0,"1171":0,"1172":0,"1174":0,"1175":0,"1176":0,"1189":0,"1191":0,"1203":0,"1204":0,"1205":0,"1206":0,"1208":0,"1209":0,"1211":0,"1222":0,"1247":0,"1248":0,"1249":0,"1250":0,"1251":0,"1253":0,"1254":0,"1255":0,"1256":0,"1257":0,"1258":0,"1259":0,"1260":0,"1262":0,"1264":0,"1265":0,"1267":0,"1268":0,"1269":0,"1283":0,"1285":0,"1288":0};-_yuitest_coverage["build/dial/dial.js"].functions = {"Dial:31":0,"validator:147":0,"valueFn:210":0,"makeClassName:238":0,"renderUI:360":0,"_setBorderRadius:396":0,"_handleCenterButtonEnter:421":0,"_handleCenterButtonLeave:431":0,"bindUI:442":0,"_setTimesWrappedFromValue:488":0,"_getAngleFromHandleCenter:505":0,"_calculateDialCenter:518":0,"_handleRingMouseup:529":0,"_handleCenterButtonMouseup:539":0,"_handleHandleMousedown:549":0,"_handleDrag:564":0,"_handleMousedown:612":0,"_handleValuesBeyondMinMax:736":0,"_handleDragStart:766":0,"(anonymous 2):788":0,"_handleDragEnd:781":0,"_setNodeToFixedRadius:814":0,"syncUI:836":0,"setSize:861":0,"_setSizes:858":0,"_renderLabel:902":0,"_renderRing:919":0,"_renderMarker:936":0,"_renderCenterButton:951":0,"_renderHandle:968":0,"_setLabelString:990":0,"_setResetString:1002":0,"_setTooltipString:1016":0,"_onDirectionKey:1030":0,"_onLeftRightKey:1061":0,"_onLeftRightKeyMeta:1080":0,"_incrMinor:1098":0,"_decrMinor:1114":0,"_incrMajor:1126":0,"_decrMajor:1138":0,"_setToMax:1150":0,"_setToMin:1160":0,"_resetDial:1170":0,"_getAngleFromValue:1188":0,"_getValueFromAngle:1202":0,"_afterValueChange:1221":0,"_uiSetValue:1246":0,"_validateValue:1282":0,"(anonymous 1):1":0};-_yuitest_coverage["build/dial/dial.js"].coveredLines = 287;+_yuitest_coverage["build/dial/dial.js"].code=["YUI.add('dial', function (Y, NAME) {","","/**"," * Create a circular dial value range input visualized as a draggable handle on a"," * background element."," *"," * @module dial"," */"," var supportsVML = false;"," //testVMLNode;",""," if (Y.UA.ie && Y.UA.ie < 9){"," supportsVML = true;"," }",""," var Lang = Y.Lang,"," Widget = Y.Widget,"," Node = Y.Node;",""," /**"," * Create a dial to represent an input control capable of representing a"," * series of intermediate states based on the position of the Dial's handle."," * These states are typically aligned to a value algorithm whereby the angle of the handle's"," * position corresponds to a given value."," *"," * @class Dial"," * @extends Widget"," * @param config {Object} Configuration object"," * @constructor"," */"," function Dial(config) {"," Dial.superclass.constructor.apply(this, arguments);"," }",""," // Y.Dial static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'dial'"," * @readOnly"," * @protected"," * @static"," */"," Dial.NAME = \"dial\";",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," Dial.ATTRS = {",""," /**"," * minimum value allowed"," *"," * @attribute min"," * @type {Number}"," * @default -220"," */"," min : {"," value:-220"," },",""," /**"," * maximum value allowed"," *"," * @attribute max"," * @type {Number}"," * @default 220"," */"," max : {"," value:220"," },",""," /**"," * diameter of the circular background object."," * Other objects scale accordingly."," * Set this only before rendering."," *"," * @attribute diameter"," * @type {Number} the number of px in diameter"," * @default 100"," * @writeOnce"," */"," diameter : {"," value:100"," },",""," /**"," * diameter of the handle object which users drag to change the value."," * Dial sets the pixel dimension of the handle equal to handleDiameter * diameter."," * Set this only before rendering."," *"," * @attribute handleDiameter"," * @type {Number}"," * @default 0.2"," * @writeOnce"," */"," handleDiameter : {"," value:0.2"," },",""," /**"," * diameter of the marker object which follows the angle of the handle during value changes."," * Dial sets the pixel dimension of the marker equal to markerDiameter * diameter."," * Set this only before rendering."," *"," * @attribute markerDiameter"," * @type {Number}"," * @default 0.1"," * @writeOnce"," */"," markerDiameter : {"," value:0.1"," },",""," /**"," * diameter of the center button object."," * Dial sets the pixel dimension of the centerButton equal to centerButtonDiameter * diameter."," * Set this only before rendering."," *"," * @attribute centerButtonDiameter"," * @type {Number}"," * @default 0.1"," * @writeOnce"," */"," centerButtonDiameter : {"," value:0.5"," },",""," /**"," * initial value of the Dial"," *"," * @attribute value"," * @type {Number}"," * @default 0"," */"," value : {"," value:0,"," validator: function(val) {"," return this._validateValue(val);"," }"," },",""," /**"," * amount to increment/decrement the dial value"," * when the arrow up/down/left/right keys are pressed"," *"," * @attribute minorStep"," * @type {Number}"," * @default 1"," */"," minorStep : {"," value:1"," },",""," /**"," * amount to increment/decrement the dial value"," * when the page up/down keys are pressed"," *"," * @attribute majorStep"," * @type {Number}"," * @default 10"," */"," majorStep : {"," value:10"," },",""," /**"," * number of value increments in one 360 degree revolution"," * of the handle around the dial"," *"," * @attribute stepsPerRevolution"," * @type {Number}"," * @default 100"," */"," stepsPerRevolution : {"," value:100"," },",""," /**"," * number of decimal places of accuracy in the value"," *"," * @attribute decimalPlaces"," * @type {Number}"," * @default 0"," */"," decimalPlaces : {"," value:0"," },",""," /**"," * visible strings for the dial UI. This attribute is"," * defined by the base Widget class but has an empty value. The"," * Dial is simply providing a default value for the attribute."," * Gets localized strings in the current language"," *"," * @attribute strings"," * @type {Object} the values are HTML strings"," * @default {label: 'My label', resetStr: 'Reset', tooltipHandle: 'Drag to set value'}"," */"," strings: {"," valueFn: function () {"," return Y.Intl.get('dial');"," }"," },",""," /**"," * distance from the center of the dial to the"," * center of the marker and handle, when at rest."," * The value is a percent of the radius of the dial."," *"," * @attribute handleDistance"," * @type {number}"," * @default 0.75"," */"," handleDistance:{"," value:0.75"," }",""," };",""," /**"," * returns a properly formed yui class name"," *"," * @method"," * @param {String} string to be appended at the end of class name"," * @return"," * @private"," */"," function makeClassName(str) {"," return Y.ClassNameManager.getClassName(Dial.NAME, str);"," }",""," /** array of static constants used to identify the classname applied to the Dial DOM objects"," *"," * @property CSS_CLASSES"," * @type {Array}"," * @private"," * @static"," */"," Dial.CSS_CLASSES = {"," label : makeClassName(\"label\"),"," labelString : makeClassName(\"label-string\"),"," valueString : makeClassName(\"value-string\"),"," northMark : makeClassName(\"north-mark\"),"," ring : makeClassName('ring'),"," ringVml : makeClassName('ring-vml'),"," marker : makeClassName(\"marker\"),"," markerVml : makeClassName(\"marker-vml\"),"," markerMaxMin : makeClassName(\"marker-max-min\"),"," centerButton : makeClassName(\"center-button\"),"," centerButtonVml : makeClassName('center-button-vml'),"," resetString : makeClassName(\"reset-string\"),"," handle : makeClassName(\"handle\"),"," handleVml : makeClassName(\"handle-vml\"),"," hidden : makeClassName(\"hidden\"),"," dragging : Y.ClassNameManager.getClassName(\"dd-dragging\")"," };",""," /* Static constants used to define the markup templates used to create Dial DOM elements */","",""," /**"," * template that will contain the Dial's label."," *"," * @property LABEL_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-label]\"><span id=\"\" class=\"[...-label-string]\">{label}</span><span class=\"[...-value-string]\"></span></div>"," * @protected"," */",""," Dial.LABEL_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.label + '\"><span id=\"\" class=\"' + Dial.CSS_CLASSES.labelString + '\">{label}</span><span class=\"' + Dial.CSS_CLASSES.valueString + '\"></span></div>';",""," if(supportsVML === false){"," /**"," * template that will contain the Dial's background ring."," *"," * @property RING_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-ring]\"><div class=\"[...-northMark]\"></div></div>"," * @protected"," */"," Dial.RING_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.ring + '\"><div class=\"' + Dial.CSS_CLASSES.northMark + '\"></div></div>';",""," /**"," * template that will contain the Dial's current angle marker."," *"," * @property MARKER_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-marker] [...-marker-hidden]\"><div class=\"[...-markerUser]\"></div></div>"," * @protected"," */"," Dial.MARKER_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.marker + ' ' + Dial.CSS_CLASSES.hidden + '\"></div>';",""," /**"," * template that will contain the Dial's center button."," *"," * @property CENTER_BUTTON_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-centerButton]\"><div class=\"[...-resetString]\">' + Y.Lang.sub('{resetStr}', Dial.ATTRS.strings.value) + '</div></div>"," * @protected"," */"," Dial.CENTER_BUTTON_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.centerButton + '\"><div class=\"' + Dial.CSS_CLASSES.resetString + ' ' + Dial.CSS_CLASSES.hidden + '\">{resetStr}</div></div>';",""," /**"," * template that will contain the Dial's handle."," *"," * @property HANDLE_TEMPLATE"," * @type {HTML}"," * @default <div class=\"[...-handle]\"><div class=\"[...-handleUser]\" aria-labelledby=\"\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\"></div></div>';// title=\"{tooltipHandle}\""," * @protected"," */"," Dial.HANDLE_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.handle + '\" aria-labelledby=\"\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\" title=\"{tooltipHandle}\">';",""," }else{ // VML case"," Dial.RING_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.ring + ' ' + Dial.CSS_CLASSES.ringVml + '\">'+"," '<div class=\"' + Dial.CSS_CLASSES.northMark + '\"></div>'+"," '<v:oval strokecolor=\"#ceccc0\" strokeweight=\"1px\"><v:fill type=gradient color=\"#8B8A7F\" color2=\"#EDEDEB\" angle=\"45\"/></v:oval>'+"," '</div>'+"," '';"," Dial.MARKER_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.markerVml + ' ' + Dial.CSS_CLASSES.hidden + '\">'+"," '<v:oval stroked=\"false\">'+"," '<v:fill opacity=\"20%\" color=\"#000\"/>'+"," '</v:oval>'+"," '</div>'+"," '';"," Dial.CENTER_BUTTON_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.centerButton + ' ' + Dial.CSS_CLASSES.centerButtonVml + '\">'+"," '<v:oval strokecolor=\"#ceccc0\" strokeweight=\"1px\">'+"," '<v:fill type=gradient color=\"#C7C5B9\" color2=\"#fefcf6\" colors=\"35% #d9d7cb, 65% #fefcf6\" angle=\"45\"/>'+"," '<v:shadow on=\"True\" color=\"#000\" opacity=\"10%\" offset=\"2px, 2px\"/>'+"," '</v:oval>'+"," '<div class=\"' + Dial.CSS_CLASSES.resetString + ' ' + Dial.CSS_CLASSES.hidden + '\">{resetStr}</div>'+"," '</div>'+"," '';"," Dial.HANDLE_TEMPLATE = '<div class=\"' + Dial.CSS_CLASSES.handleVml + '\" aria-labelledby=\"\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\" title=\"{tooltipHandle}\">'+"," '<v:oval stroked=\"false\">'+"," '<v:fill opacity=\"20%\" color=\"#6C3A3A\"/>'+"," '</v:oval>'+"," '</div>'+"," '';"," }",""," /* Dial extends the base Widget class */"," Y.extend(Dial, Widget, {",""," /**"," * creates the DOM structure for the Dial."," *"," * @method renderUI"," * @protected"," */"," renderUI : function() {"," this._renderLabel();"," this._renderRing();"," this._renderMarker();"," this._renderCenterButton();"," this._renderHandle();",""," // object handles"," this.contentBox = this.get(\"contentBox\");",""," // constants"," this._originalValue = this.get('value');"," this._minValue = this.get('min'); // saves doing a .get many times, but we need to remember to update this if/when we allow changing min or max after instantiation"," this._maxValue = this.get('max');"," this._stepsPerRevolution = this.get('stepsPerRevolution');"," this._minTimesWrapped = (Math.floor(this._minValue / this._stepsPerRevolution - 1));"," this._maxTimesWrapped = (Math.floor(this._maxValue / this._stepsPerRevolution + 1));",""," // variables"," this._timesWrapped = 0;"," this._angle = this._getAngleFromValue(this.get('value'));"," this._prevAng = this._angle;",""," // init"," this._setTimesWrappedFromValue(this._originalValue);"," this._handleNode.set('aria-valuemin', this._minValue);"," this._handleNode.set('aria-valuemax', this._maxValue);"," },",""," /**"," * Sets -webkit-border-radius to 50% of width/height of the ring, handle, marker, and center-button."," * This is needed for iOS 3.x."," * The objects render square if the radius is > 50% of the width/height"," * @method _setBorderRadius"," * @private"," */"," _setBorderRadius : function(){"," this._ringNode.setStyles({'WebkitBorderRadius':this._ringNodeRadius + 'px',"," 'MozBorderRadius':this._ringNodeRadius + 'px',"," 'borderRadius':this._ringNodeRadius + 'px'"," });"," this._handleNode.setStyles({'WebkitBorderRadius':this._handleNodeRadius + 'px',"," 'MozBorderRadius':this._handleNodeRadius + 'px',"," 'borderRadius':this._handleNodeRadius + 'px'"," });"," this._markerNode.setStyles({'WebkitBorderRadius':this._markerNodeRadius + 'px',"," 'MozBorderRadius':this._markerNodeRadius + 'px',"," 'borderRadius':this._markerNodeRadius + 'px'"," });"," this._centerButtonNode.setStyles({'WebkitBorderRadius':this._centerButtonNodeRadius + 'px',"," 'MozBorderRadius':this._centerButtonNodeRadius + 'px',"," 'borderRadius':this._centerButtonNodeRadius + 'px'"," });"," },",""," /**"," * Handles the mouseenter on the centerButton"," *"," * @method _handleCenterButtonEnter"," * @protected"," */"," _handleCenterButtonEnter : function(){"," this._resetString.removeClass(Dial.CSS_CLASSES.hidden);"," },",""," /**"," * Handles the mouseleave on the centerButton"," *"," * @method _handleCenterButtonLeave"," * @protected"," */"," _handleCenterButtonLeave : function(){"," this._resetString.addClass(Dial.CSS_CLASSES.hidden);"," },",""," /**"," * Creates the Y.DD.Drag instance used for the handle movement and"," * binds Dial interaction to the configured value model."," *"," * @method bindUI"," * @protected"," */"," bindUI : function() {",""," this.after(\"valueChange\", this._afterValueChange);",""," var boundingBox = this.get(\"boundingBox\"),"," // Looking for a key event which will fire continously across browsers while the key is held down."," keyEvent = (!Y.UA.opera) ? \"down:\" : \"press:\","," // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home"," keyEventSpec = keyEvent + \"38,40,33,34,35,36\","," // 37 , 39 = arrow left/right"," keyLeftRightSpec = keyEvent + \"37,39\","," // 37 , 39 = arrow left/right + meta (command/apple key) for mac"," keyLeftRightSpecMeta = keyEvent + \"37+meta,39+meta\","," Drag = Y.DD.Drag;",""," Y.on(\"key\", Y.bind(this._onDirectionKey, this), boundingBox, keyEventSpec);"," Y.on(\"key\", Y.bind(this._onLeftRightKey, this), boundingBox, keyLeftRightSpec);"," boundingBox.on(\"key\", this._onLeftRightKeyMeta, keyLeftRightSpecMeta, this);",""," Y.on('mouseenter', Y.bind(this._handleCenterButtonEnter, this), this._centerButtonNode);"," Y.on('mouseleave', Y.bind(this._handleCenterButtonLeave, this), this._centerButtonNode);"," // Needed to replace mousedown/up with gesturemovestart/end to make behavior on touch devices work the same."," Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441]"," Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode);","",""," Y.on(Drag.START_EVENT, Y.bind(this._handleHandleMousedown, this), this._handleNode);"," Y.on(Drag.START_EVENT, Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766]",""," //TODO: Can this be merged this into the drag:end event listener to avoid another registration?"," Y.on('gesturemoveend', Y.bind(this._handleRingMouseup, this), this._ringNode);",""," this._dd1 = new Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so"," node: this._handleNode,"," on : {"," 'drag:drag' : Y.bind(this._handleDrag, this),"," 'drag:start' : Y.bind(this._handleDragStart, this),"," 'drag:end' : Y.bind(this._handleDragEnd, this) //,"," }"," });"," Y.bind(this._dd1.addHandle(this._ringNode), this); // [#2530206] added the ring as a handle to the dd1 (the dd of the handleNode)"," },",""," /**"," * Sets _timesWrapped based on Dial value"," * to net integer revolutions the user dragged the handle around the Dial"," *"," * @method _setTimesWrappedFromValue"," * @param val {Number} current value of the Dial"," * @private"," */"," _setTimesWrappedFromValue : function(val){"," if(val % this._stepsPerRevolution === 0){"," this._timesWrapped = (val / this._stepsPerRevolution);"," }else{"," this._timesWrapped = Math.floor(val / this._stepsPerRevolution);"," }"," },",""," /**"," * gets the angle of the line from the center of the Dial to the center of the handle"," *"," * @method _getAngleFromHandleCenter"," * @param handleCenterX {number}"," * @param handleCenterY {number}"," * @return ang {number} the angle"," * @protected"," */"," _getAngleFromHandleCenter : function(handleCenterX, handleCenterY){"," var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI);"," ang = ((this._dialCenterX - handleCenterX) < 0) ? ang + 90 : ang + 90 + 180; // Compensate for neg angles from Math.atan"," return ang;"," },",""," /**"," * calculates the XY of the center of the dial relative to the ring node."," * This is needed for calculating the angle of the handle"," *"," * @method _calculateDialCenter"," * @protected"," */"," _calculateDialCenter : function(){ // #2531111 value, and marker don't track handle when dial position changes on page (resize when inline)"," this._dialCenterX = this._ringNode.get('offsetWidth') / 2;"," this._dialCenterY = this._ringNode.get('offsetHeight') / 2;"," },",""," /**"," * Handles the mouseup on the ring"," *"," * @method _handleRingMouseup"," * @protected"," */"," _handleRingMouseup : function(){"," this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]"," },",""," /**"," * Handles the mouseup on the centerButton"," *"," * @method _handleCenterButtonMouseup"," * @protected"," */"," _handleCenterButtonMouseup : function(){"," this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]"," },",""," /**"," * Handles the mousedown on the handle"," *"," * @method _handleHandleMousedown"," * @protected"," */"," _handleHandleMousedown : function(){"," this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]"," // this is better done here instead of on _handleDragEnd"," // because we should make the keyboard accessible after a click of the handle"," },",""," /**"," * handles the user dragging the handle around the Dial, gets the angle,"," * checks for wrapping around top center."," * Sets the new value of the Dial"," *"," * @method _handleDrag"," * @param e {DOMEvent} the drag event object"," * @protected"," */"," _handleDrag : function(e){"," var handleCenterX,"," handleCenterY,"," ang,"," newValue;",""," // The event was emitted from drag:drag of handle."," // The center of the handle is top left position of the handle node + radius of handle."," // This is different than a mousedown on the ring."," handleCenterX = (parseInt(this._handleNode.getStyle('left'),10) + this._handleNodeRadius);"," handleCenterY = (parseInt(this._handleNode.getStyle('top'),10) + this._handleNodeRadius);"," ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);",""," // check for need to set timesWrapped"," if((this._prevAng > 270) && (ang < 90)){ // If wrapping, clockwise"," if(this._timesWrapped < this._maxTimesWrapped){"," this._timesWrapped = (this._timesWrapped + 1);"," }"," }else if((this._prevAng < 90) && (ang > 270)){ // if un-wrapping, counter-clockwise"," if(this._timesWrapped > this._minTimesWrapped){"," this._timesWrapped = (this._timesWrapped - 1);"," }"," }"," newValue = this._getValueFromAngle(ang); // This function needs the current _timesWrapped value. That's why it comes after the _timesWrapped code above",""," // If you've gone past max more than one full revolution, we decrement the _timesWrapped value"," // This gives the effect of a ratchet mechanism."," // It feels like you are never more than one revolution past max"," // The effect is the same for min, only in reverse."," // We can't reset the _timesWrapped to the max or min here."," // If we did, the next (continuous) drag would reset the value incorrectly."," if(newValue > (this._maxValue + this._stepsPerRevolution) ){"," this._timesWrapped --;"," }else if(newValue < (this._minValue - this._stepsPerRevolution) ){"," this._timesWrapped ++;"," }"," this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress",""," this._handleValuesBeyondMinMax(e, newValue);"," },",""," /**"," * handles a mousedown or gesturemovestart event on the ring node"," *"," * @method _handleMousedown"," * @param e {DOMEvent} the event object"," * @private"," */"," _handleMousedown : function(e){ // #2530306",""," if (this._ringNode.compareTo(e.target)) {"," var minAng = this._getAngleFromValue(this._minValue),"," maxAng = this._getAngleFromValue(this._maxValue),"," newValue, oppositeMidRangeAngle,"," handleCenterX, handleCenterY,"," ang;","","",""," // The event was emitted from mousedown on the ring node,"," // so the center of the handle should be the XY of mousedown."," if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click"," handleCenterX = (e.clientX - this._ringNode.getX());"," handleCenterY = (e.clientY - this._ringNode.getY());"," }else{"," handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());"," handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY());"," }"," ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);",""," /* ///////////////////////////////////////////////////////////////////////////////////////////////////////"," * The next sections of logic"," * set this._timesWrapped in the different cases of value range"," * and value range position,"," * then the Dial value is set at the end of this method"," */ ///////////////////////////////////////////////////////////////////////////////////////////////////////","",""," ////////////////////////////////////////////////////////////////////////////////////////////////////////////"," if(this._maxValue - this._minValue > this._stepsPerRevolution){",""," // Case: range min-to-max is greater than stepsPerRevolution (one revolution)",""," // This checks the shortest way around the dial between the prevAng and this ang."," if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping",""," // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped"," if((this._timesWrapped > this._minTimesWrapped) &&"," (this._timesWrapped < this._maxTimesWrapped)"," ){"," // this checks which direction, clock wise or CCW and incr or decr _timesWrapped"," this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);"," }"," // special case of getting un-stuck from a min value case"," // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry"," // because prevAng is set to 0 or > 0"," }else if("," (this._timesWrapped === this._minTimesWrapped) &&"," (ang - this._prevAng < 180)"," ){"," this._timesWrapped ++;"," } //it didn't cross a wrapping boundary",""," } /////////////////////////////////////////////////////////////////////////////////////////////////////////"," else if(this._maxValue - this._minValue === this._stepsPerRevolution){"," // Case: range min-to-max === stepsPerRevolution (one revolution)"," // This means min and max will be at same angle"," // This does not mean they are at \"north\"",""," if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)"," // The only way it can be, is if min and max are not at north"," this._timesWrapped = 1;"," }else{"," this._timesWrapped = 0;"," }",""," } //////////////////////////////////////////////////////////////////////////////////////////////////////////"," else if(minAng > maxAng){"," // Case: range includes the wrap point (north)"," // Because of \"else if\"..."," // range is < stepsPerRevolution",""," if("," (this._prevAng >= minAng) && // if prev angle was greater than angle of min and..."," (ang <= (minAng + maxAng) / 2) // the angle of this click is less than"," // the angle opposite the mid-range angle, then..."," ){"," this._timesWrapped ++;"," }else if("," (this._prevAng <= maxAng) &&"," // if prev angle is < max angle and...",""," (ang > (minAng + maxAng) / 2)"," // the angle of this click is greater than,"," // the angle opposite the mid-range angle and...",""," ){"," this._timesWrapped --;"," }",""," } ////////////////////////////////////////////////////////////////////////////////////////////////////"," else{"," // \"else\" Case: min-to-max range doesn't include the wrap point"," // Because of \"else if\"..."," // range is still < stepsPerRevolution",""," if ((ang < minAng) || (ang > maxAng)){ // angle is out of range"," oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360;"," // This is the bisection of the min-to-max range + 180. (opposite the bisection)",""," if(oppositeMidRangeAngle > 180){"," newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');"," }else{ //oppositeMidRangeAngle <= 180"," newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');"," }"," this._prevAng = this._getAngleFromValue(newValue);"," this.set('value', newValue);"," this._setTimesWrappedFromValue(newValue);"," return;"," }"," }",""," // Now that _timesWrapped is set value ......................................................................."," newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value."," this._prevAng = ang;",""," this._handleValuesBeyondMinMax(e, newValue);"," }"," },",""," /**"," * handles the case where the value is less than min or greater than max"," *"," * @method _handleValuesBeyondMinMax"," * @param e {DOMEvent} the event object"," * @param newValue {number} current value of the dial"," * @protected"," */"," _handleValuesBeyondMinMax : function(e, newValue){ // #2530306"," // If _getValueFromAngle() is passed 0, it increments the _timesWrapped value."," // handle hitting max and min and going beyond, stops at max or min"," if((newValue >= this._minValue) && (newValue <= this._maxValue)) {"," this.set('value', newValue);"," // [#2530206] transfer the mousedown event from the _ringNode to the _handleNode drag, so we can mousedown, then continue dragging"," if(e.currentTarget === this._ringNode){"," // Delegate to DD's natural behavior"," this._dd1._handleMouseDownEvent(e);"," }"," } else if(newValue > this._maxValue){"," this.set('value', this._maxValue);"," this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag"," } else if(newValue < this._minValue){"," this.set('value', this._minValue);"," this._prevAng = this._getAngleFromValue(this._minValue);"," }"," },",""," /**"," * handles the user starting to drag the handle around the Dial"," *"," * @method _handleDragStart"," * @param e {DOMEvent} the drag event object"," * @protected"," */"," _handleDragStart : function(e){"," this._markerNode.removeClass(Dial.CSS_CLASSES.hidden);"," },",""," /*"," * When handle is handleDragEnd, this animates the return to the fixed dial"," */",""," /**"," * handles the end of a user dragging the handle, animates the handle returning to"," * resting position."," *"," * @method _handleDragEnd"," * @protected"," */"," _handleDragEnd : function(){"," var node = this._handleNode;"," node.transition({"," duration: 0.08, // seconds"," easing: 'ease-in',"," left: this._setNodeToFixedRadius(this._handleNode, true)[0] + 'px',"," top: this._setNodeToFixedRadius(this._handleNode, true)[1] + 'px'"," }, Y.bind(function(){"," var value = this.get('value');"," //[#2530206] only hide marker if not at max or min"," // more persistant user visibility of when the dial is at max or min"," if((value > this._minValue) && (value < this._maxValue)){"," this._markerNode.addClass(Dial.CSS_CLASSES.hidden);"," }else{"," this._setTimesWrappedFromValue(value); //#2530766 secondary bug when drag past max + cross wrapping boundry"," this._prevAng = this._getAngleFromValue(value); //#2530766 secondary bug when drag past max + cross wrapping boundry"," }"," }, this)"," );"," },",""," /**"," * returns the XY of the fixed position, handleDistance, from the center of the Dial (resting position)."," * The XY also represents the angle related to the current value."," * If typeArray is true, [X,Y] is returned."," * If typeArray is false, the XY of the obj node passed in is set."," *"," * @method _setNodeToFixedRadius"," * @param obj {Node}"," * @param typeArray {Boolean} true returns an array [X,Y]"," * @protected"," * @return {Array} an array of [XY] is optionally returned"," */"," _setNodeToFixedRadius : function(obj, typeArray){"," var thisAngle = (this._angle - 90),"," rad = (Math.PI / 180),"," newY = Math.round(Math.sin(thisAngle * rad) * this._handleDistance),"," newX = Math.round(Math.cos(thisAngle * rad) * this._handleDistance),"," dia = obj.get('offsetWidth'); //Ticket #2529852",""," newY = newY - (dia * 0.5);"," newX = newX - (dia * 0.5);"," if(typeArray){ // just need the style for css transform left and top to animate the handle drag:end"," return [(this._ringNodeRadius + newX), (this._ringNodeRadius + newY)];"," }else{"," obj.setStyle('left', (this._ringNodeRadius + newX) + 'px');"," obj.setStyle('top', (this._ringNodeRadius + newY) + 'px');"," }"," },",""," /**"," * Synchronizes the DOM state with the attribute settings."," *"," * @method syncUI"," */"," syncUI : function() {"," // Make the marker and the resetString display so their placement and borderRadius can be calculated, then hide them again."," // We would have used visibility:hidden in the css of this class,"," // but IE8 VML never returns to visible after applying visibility:hidden then removing it."," this._setSizes();"," this._calculateDialCenter(); // #2531111 initialize center of dial"," this._setBorderRadius();"," this._uiSetValue(this.get(\"value\"));"," this._markerNode.addClass(Dial.CSS_CLASSES.hidden);"," this._resetString.addClass(Dial.CSS_CLASSES.hidden);"," },",""," /**"," * sets the sizes of ring, center-button, marker, handle, and VML ovals in pixels."," * Needed only because some IE versions"," * ignore CSS percent sizes/offsets."," * so these must be set in pixels."," * Normally these are set in % of the ring."," *"," * @method _setSizes"," * @protected"," */"," _setSizes : function(){"," var dia = this.get('diameter'),"," offset, offsetResetX, offsetResetY,"," setSize = function(node, dia, percent){"," var suffix = 'px';"," node.getElementsByTagName('oval').setStyle('width', (dia * percent) + suffix);"," node.getElementsByTagName('oval').setStyle('height', (dia * percent) + suffix);"," node.setStyle('width', (dia * percent) + suffix);"," node.setStyle('height', (dia * percent) + suffix);"," };"," setSize(this._ringNode, dia, 1.0);"," setSize(this._handleNode, dia, this.get('handleDiameter'));"," setSize(this._markerNode, dia, this.get('markerDiameter'));"," setSize(this._centerButtonNode, dia, this.get('centerButtonDiameter'));",""," // Set these (used for trig) this way instead of relative to dia,"," // in case they have borders, have images etc."," this._ringNodeRadius = this._ringNode.get('offsetWidth') * 0.5;"," this._handleNodeRadius = this._handleNode.get('offsetWidth') * 0.5;"," this._markerNodeRadius = this._markerNode.get('offsetWidth') * 0.5;"," this._centerButtonNodeRadius = this._centerButtonNode.get('offsetWidth') * 0.5;"," this._handleDistance = this._ringNodeRadius * this.get('handleDistance');"," // place the centerButton"," offset = (this._ringNodeRadius - this._centerButtonNodeRadius);"," this._centerButtonNode.setStyle('left', offset + 'px');"," this._centerButtonNode.setStyle('top', offset + 'px');"," /*"," Place the resetString"," This seems like it should be able to be done with CSS,"," But since there is also a VML oval in IE that is absolute positioned,"," The resetString ends up behind the VML oval."," */"," offsetResetX = (this._centerButtonNodeRadius - (this._resetString.get('offsetWidth') * 0.5));"," offsetResetY = (this._centerButtonNodeRadius - (this._resetString.get('offsetHeight') * 0.5));"," this._resetString.setStyles({'left':offsetResetX + 'px', 'top':offsetResetY + 'px'});"," },","",""," /**"," * renders the DOM object for the Dial's label"," *"," * @method _renderLabel"," * @protected"," */"," _renderLabel : function() {"," var contentBox = this.get(\"contentBox\"),"," label = contentBox.one(\".\" + Dial.CSS_CLASSES.label);"," if (!label) {"," label = Node.create(Y.Lang.sub(Dial.LABEL_TEMPLATE, this.get('strings')));"," contentBox.append(label);"," }"," this._labelNode = label;"," this._valueStringNode = this._labelNode.one(\".\" + Dial.CSS_CLASSES.valueString);"," },",""," /**"," * renders the DOM object for the Dial's background ring"," *"," * @method _renderRing"," * @protected"," */"," _renderRing : function() {"," var contentBox = this.get(\"contentBox\"),"," ring = contentBox.one(\".\" + Dial.CSS_CLASSES.ring);"," if (!ring) {"," ring = contentBox.appendChild(Dial.RING_TEMPLATE);"," ring.setStyles({width:this.get('diameter') + 'px', height:this.get('diameter') + 'px'});"," }"," this._ringNode = ring;"," },",""," /**"," * renders the DOM object for the Dial's background marker which"," * tracks the angle of the user dragging the handle"," *"," * @method _renderMarker"," * @protected"," */"," _renderMarker : function() {"," var contentBox = this.get(\"contentBox\"),"," marker = contentBox.one(\".\" + Dial.CSS_CLASSES.marker);"," if (!marker) {"," marker = contentBox.one('.' + Dial.CSS_CLASSES.ring).appendChild(Dial.MARKER_TEMPLATE);"," }"," this._markerNode = marker;"," },",""," /**"," * renders the DOM object for the Dial's center"," *"," * @method _renderCenterButton"," * @protected"," */"," _renderCenterButton : function() {"," var contentBox = this.get(\"contentBox\"),"," centerButton = contentBox.one(\".\" + Dial.CSS_CLASSES.centerButton);"," if (!centerButton) {"," centerButton = Node.create(Y.Lang.sub(Dial.CENTER_BUTTON_TEMPLATE, this.get('strings')));"," contentBox.one('.' + Dial.CSS_CLASSES.ring).append(centerButton);"," }"," this._centerButtonNode = centerButton;"," this._resetString = this._centerButtonNode.one('.' + Dial.CSS_CLASSES.resetString);"," },",""," /**"," * renders the DOM object for the Dial's user draggable handle"," *"," * @method _renderHandle"," * @protected"," */"," _renderHandle : function() {"," var labelId = Dial.CSS_CLASSES.label + Y.guid(), //get this unique id once then use for handle and label for ARIA"," contentBox = this.get(\"contentBox\"),"," handle = contentBox.one(\".\" + Dial.CSS_CLASSES.handle);"," if (!handle) {"," handle = Node.create(Y.Lang.sub(Dial.HANDLE_TEMPLATE, this.get('strings')));"," handle.setAttribute('aria-labelledby', labelId); // get unique id for specifying a label & handle for ARIA"," this._labelNode.one('.' + Dial.CSS_CLASSES.labelString).setAttribute('id', labelId); // When handle gets focus, screen reader will include label text when reading the value."," contentBox.one('.' + Dial.CSS_CLASSES.ring).append(handle);"," }"," this._handleNode = handle;"," },",""," /**"," * sets the visible UI label HTML string"," *"," * @method _setLabelString"," * @param str {HTML}"," * @protected"," * @deprecated Use DialObjName.set('strings',{'label':'My new label'}); before DialObjName.render();",""," */"," _setLabelString : function(str) {"," this.get(\"contentBox\").one(\".\" + Dial.CSS_CLASSES.labelString).setHTML(str);"," },",""," /**"," * sets the visible UI label HTML string"," *"," * @method _setResetString"," * @param str {HTML}"," * @protected"," * @deprecated Use DialObjName.set('strings',{'resetStr':'My new reset string'}); before DialObjName.render();"," */"," _setResetString : function(str) {"," this.get(\"contentBox\").one(\".\" + Dial.CSS_CLASSES.resetString).setHTML(str);"," // this._setXYResetString(); // This used to recenter the string in the button. Done with CSS now. Method has been removed."," // this._resetString.setHTML(''); //We no longer show/hide the reset string with setHTML but by addClass and removeClass .yui3-dial-reset-string-hidden"," },",""," /**"," * sets the tooltip HTML string in the Dial's handle"," *"," * @method _setTooltipString"," * @param str {HTML}"," * @protected"," * @deprecated Use DialObjName.set('strings',{'tooltipHandle':'My new tooltip'}); before DialObjName.render();"," */"," _setTooltipString : function(str) {"," this._handleNode.set('title', str);"," },",""," /**"," * sets the Dial's value in response to key events."," * Left and right keys are in a separate method"," * in case an implementation wants to increment values"," * but needs left and right arrow keys for other purposes."," *"," * @method _onDirectionKey"," * @param e {Event} the key event"," * @protected"," */"," _onDirectionKey : function(e) {"," e.preventDefault();"," switch (e.charCode) {"," case 38: // up"," this._incrMinor();"," break;"," case 40: // down"," this._decrMinor();"," break;"," case 36: // home"," this._setToMin();"," break;"," case 35: // end"," this._setToMax();"," break;"," case 33: // page up"," this._incrMajor();"," break;"," case 34: // page down"," this._decrMajor();"," break;"," }"," },",""," /**"," * sets the Dial's value in response to left or right key events"," *"," * @method _onLeftRightKey"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKey : function(e) {"," e.preventDefault();"," switch (e.charCode) {"," case 37: // left"," this._decrMinor();"," break;"," case 39: // right"," this._incrMinor();"," break;"," }"," },",""," /**"," * sets the Dial's value in response to left or right key events when a meta (mac command/apple) key is also pressed"," *"," * @method _onLeftRightKeyMeta"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKeyMeta : function(e) {"," e.preventDefault();"," switch (e.charCode) {"," case 37: // left + meta"," this._setToMin();"," break;"," case 39: // right + meta"," this._setToMax();"," break;"," }"," },",""," /**"," * increments Dial value by a minor increment"," *"," * @method _incrMinor"," * @protected"," */"," _incrMinor : function(){"," var newVal = (this.get('value') + this.get(\"minorStep\"));"," newVal = Math.min(newVal, this.get(\"max\"));"," // [#2530045] .toFixed returns a string."," // Dial's value needs a number. -0 makes it a number, but removes trailing zeros."," // Added toFixed(...) again in _uiSetValue where content of yui3-dial-value-string is set."," // Removing the toFixed here, loses the feature of \"snap-to\" when for example, stepsPerRevolution is 10 and decimalPlaces is 0."," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },",""," /**"," * decrements Dial value by a minor increment"," *"," * @method _decrMinor"," * @protected"," */"," _decrMinor : function(){"," var newVal = (this.get('value') - this.get(\"minorStep\"));"," newVal = Math.max(newVal, this.get(\"min\"));"," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },",""," /**"," * increments Dial value by a major increment"," *"," * @method _incrMajor"," * @protected"," */"," _incrMajor : function(){"," var newVal = (this.get('value') + this.get(\"majorStep\"));"," newVal = Math.min(newVal, this.get(\"max\"));"," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },",""," /**"," * decrements Dial value by a major increment"," *"," * @method _decrMajor"," * @protected"," */"," _decrMajor : function(){"," var newVal = (this.get('value') - this.get(\"majorStep\"));"," newVal = Math.max(newVal, this.get(\"min\"));"," this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0);"," },",""," /**"," * sets Dial value to dial's max attr"," *"," * @method _setToMax"," * @protected"," */"," _setToMax : function(){"," this.set('value', this.get(\"max\"));"," },",""," /**"," * sets Dial value to dial's min attr"," *"," * @method _setToMin"," * @protected"," */"," _setToMin : function(){"," this.set('value', this.get(\"min\"));"," },",""," /**"," * resets Dial value to the orignal initial value."," *"," * @method _resetDial"," * @protected"," */"," _resetDial : function(e){"," if(e){"," e.stopPropagation(); //[#2530206] need to add so mousedown doesn't propagate to ring and move the handle"," }"," this.set('value', this._originalValue);"," this._resetString.addClass(Dial.CSS_CLASSES.hidden); //[#2530441]"," this._handleNode.focus();"," },",""," /**"," * returns the handle angle associated with the current value of the Dial."," * Returns a number between 0 and 360."," *"," * @method _getAngleFromValue"," * @param newVal {Number} the current value of the Dial"," * @return {Number} the angle associated with the current Dial value"," * @protected"," */"," _getAngleFromValue : function(newVal){"," var nonWrappedPartOfValue = newVal % this._stepsPerRevolution,"," angleFromValue = nonWrappedPartOfValue / this._stepsPerRevolution * 360;"," return (angleFromValue < 0) ? (angleFromValue + 360) : angleFromValue;"," },",""," /**"," * returns the value of the Dial calculated from the current handle angle"," *"," * @method _getValueFromAngle"," * @param angle {Number} the current angle of the Dial's handle"," * @return {Number} the current Dial value corresponding to the handle position"," * @protected"," */"," _getValueFromAngle : function(angle){"," if(angle < 0){"," angle = (360 + angle);"," }else if(angle === 0){"," angle = 360;"," }"," var value = (angle / 360) * this._stepsPerRevolution;"," value = (value + (this._timesWrapped * this._stepsPerRevolution));"," //return Math.round(value * 100) / 100;"," return value.toFixed(this.get('decimalPlaces')) - 0;"," },",""," /**"," * calls the method to update the UI whenever the Dial value changes"," *"," * @method _afterValueChange"," * @param e {Event}"," * @protected"," */"," _afterValueChange : function(e) {"," this._uiSetValue(e.newVal);"," },",""," /**"," * Changes a value to have the correct decimal places per the attribute decimalPlaces"," *"," * @method _valueToDecimalPlaces"," * @param val {Number} a raw value to set to the Dial"," * @return {Number} the input val changed to have the correct decimal places"," * @protected"," */"," _valueToDecimalPlaces : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min.",""," },",""," /**"," * Updates the UI display value of the Dial to reflect"," * the value passed in."," * Makes all other needed UI display changes"," *"," * @method _uiSetValue"," * @param val {Number} value of the Dial"," * @protected"," */"," _uiSetValue : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min."," this._angle = this._getAngleFromValue(val);"," if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){"," this._setTimesWrappedFromValue(val);"," this._setNodeToFixedRadius(this._handleNode, false);"," this._prevAng = this._getAngleFromValue(this.get('value'));"," }"," this._valueStringNode.setHTML(val.toFixed(this.get('decimalPlaces'))); // [#2530045]"," this._handleNode.set('aria-valuenow', val);"," this._handleNode.set('aria-valuetext', val);"," this._setNodeToFixedRadius(this._markerNode, false);"," if((val === this._maxValue) || (val === this._minValue)){"," this._markerNode.addClass(Dial.CSS_CLASSES.markerMaxMin);"," if(supportsVML === true){"," this._markerNode.getElementsByTagName('fill').set('color', '#AB3232');"," }"," this._markerNode.removeClass(Dial.CSS_CLASSES.hidden);"," }else{ // not max or min"," if(supportsVML === true){"," this._markerNode.getElementsByTagName('fill').set('color', '#000');"," }"," this._markerNode.removeClass(Dial.CSS_CLASSES.markerMaxMin);"," if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){ // if not max || min, and not dragging handle, hide the marker"," this._markerNode.addClass(Dial.CSS_CLASSES.hidden);"," }"," }"," },",""," /**"," * value attribute default validator. Verifies that"," * the value being set lies between the min/max value"," *"," * @method _validateValue"," * @param val {Number} value of the Dial"," * @protected"," */"," _validateValue: function(val) {"," var min = this.get(\"min\"),"," max = this.get(\"max\");"," return (Lang.isNumber(val) && val >= min && val <= max);"," }"," });"," Y.Dial = Dial;","","","}, '3.7.3', {\"requires\": [\"widget\", \"dd-drag\", \"event-mouseenter\", \"event-move\", \"event-key\", \"transition\", \"intl\"], \"lang\": [\"en\", \"es\"], \"skinnable\": true});"];+_yuitest_coverage["build/dial/dial.js"].lines = {"1":0,"9":0,"12":0,"13":0,"16":0,"31":0,"32":0,"47":0,"58":0,"148":0,"211":0,"238":0,"239":0,"249":0,"280":0,"282":0,"291":0,"301":0,"311":0,"321":0,"324":0,"329":0,"335":0,"343":0,"352":0,"361":0,"362":0,"363":0,"364":0,"365":0,"368":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"379":0,"380":0,"381":0,"384":0,"385":0,"386":0,"397":0,"401":0,"405":0,"409":0,"422":0,"432":0,"444":0,"446":0,"457":0,"458":0,"459":0,"461":0,"462":0,"464":0,"465":0,"468":0,"469":0,"472":0,"474":0,"482":0,"494":0,"495":0,"497":0,"511":0,"512":0,"513":0,"524":0,"525":0,"535":0,"545":0,"555":0,"570":0,"578":0,"579":0,"580":0,"583":0,"584":0,"585":0,"587":0,"588":0,"589":0,"592":0,"600":0,"601":0,"602":0,"603":0,"605":0,"607":0,"619":0,"620":0,"630":0,"631":0,"632":0,"634":0,"635":0,"637":0,"648":0,"653":0,"656":0,"660":0,"665":0,"669":0,"673":0,"678":0,"680":0,"682":0,"686":0,"691":0,"696":0,"697":0,"706":0,"715":0,"716":0,"719":0,"720":0,"722":0,"724":0,"725":0,"726":0,"727":0,"732":0,"733":0,"735":0,"750":0,"751":0,"753":0,"755":0,"757":0,"758":0,"759":0,"760":0,"761":0,"762":0,"774":0,"789":0,"790":0,"796":0,"799":0,"800":0,"802":0,"803":0,"822":0,"828":0,"829":0,"830":0,"831":0,"833":0,"834":0,"847":0,"848":0,"849":0,"850":0,"851":0,"852":0,"866":0,"869":0,"870":0,"871":0,"872":0,"873":0,"875":0,"876":0,"877":0,"878":0,"882":0,"883":0,"884":0,"885":0,"886":0,"888":0,"889":0,"890":0,"897":0,"898":0,"899":0,"910":0,"912":0,"913":0,"914":0,"916":0,"917":0,"927":0,"929":0,"930":0,"931":0,"933":0,"944":0,"946":0,"947":0,"949":0,"959":0,"961":0,"962":0,"963":0,"965":0,"966":0,"976":0,"979":0,"980":0,"981":0,"982":0,"983":0,"985":0,"998":0,"1010":0,"1024":0,"1038":0,"1039":0,"1041":0,"1042":0,"1044":0,"1045":0,"1047":0,"1048":0,"1050":0,"1051":0,"1053":0,"1054":0,"1056":0,"1057":0,"1069":0,"1070":0,"1072":0,"1073":0,"1075":0,"1076":0,"1088":0,"1089":0,"1091":0,"1092":0,"1094":0,"1095":0,"1106":0,"1107":0,"1112":0,"1122":0,"1123":0,"1124":0,"1134":0,"1135":0,"1136":0,"1146":0,"1147":0,"1148":0,"1158":0,"1168":0,"1178":0,"1179":0,"1181":0,"1182":0,"1183":0,"1196":0,"1198":0,"1210":0,"1211":0,"1212":0,"1213":0,"1215":0,"1216":0,"1218":0,"1229":0,"1254":0,"1255":0,"1256":0,"1257":0,"1258":0,"1260":0,"1261":0,"1262":0,"1263":0,"1264":0,"1265":0,"1266":0,"1267":0,"1269":0,"1271":0,"1272":0,"1274":0,"1275":0,"1276":0,"1290":0,"1292":0,"1295":0};+_yuitest_coverage["build/dial/dial.js"].functions = {"Dial:31":0,"validator:147":0,"valueFn:210":0,"makeClassName:238":0,"renderUI:360":0,"_setBorderRadius:396":0,"_handleCenterButtonEnter:421":0,"_handleCenterButtonLeave:431":0,"bindUI:442":0,"_setTimesWrappedFromValue:493":0,"_getAngleFromHandleCenter:510":0,"_calculateDialCenter:523":0,"_handleRingMouseup:534":0,"_handleCenterButtonMouseup:544":0,"_handleHandleMousedown:554":0,"_handleDrag:569":0,"_handleMousedown:617":0,"_handleValuesBeyondMinMax:747":0,"_handleDragStart:773":0,"(anonymous 2):795":0,"_handleDragEnd:788":0,"_setNodeToFixedRadius:821":0,"syncUI:843":0,"setSize:868":0,"_setSizes:865":0,"_renderLabel:909":0,"_renderRing:926":0,"_renderMarker:943":0,"_renderCenterButton:958":0,"_renderHandle:975":0,"_setLabelString:997":0,"_setResetString:1009":0,"_setTooltipString:1023":0,"_onDirectionKey:1037":0,"_onLeftRightKey:1068":0,"_onLeftRightKeyMeta:1087":0,"_incrMinor:1105":0,"_decrMinor:1121":0,"_incrMajor:1133":0,"_decrMajor:1145":0,"_setToMax:1157":0,"_setToMin:1167":0,"_resetDial:1177":0,"_getAngleFromValue:1195":0,"_getValueFromAngle:1209":0,"_afterValueChange:1228":0,"_uiSetValue:1253":0,"_validateValue:1289":0,"(anonymous 1):1":0};+_yuitest_coverage["build/dial/dial.js"].coveredLines = 286; _yuitest_coverage["build/dial/dial.js"].coveredFunctions = 49; _yuitest_coverline("build/dial/dial.js", 1); YUI.add('dial', function (Y, NAME) {@@ -43,7 +43,7 @@ /** * Create a circular dial value range input visualized as a draggable handle on a * background element.- * + * * @module dial */ _yuitest_coverfunc("build/dial/dial.js", "(anonymous 1)", 1);@@ -200,7 +200,7 @@ return this._validateValue(val); } },- + /** * amount to increment/decrement the dial value * when the arrow up/down/left/right keys are pressed@@ -226,7 +226,7 @@ }, /**- * number of value increments in one 360 degree revolution + * number of value increments in one 360 degree revolution * of the handle around the dial * * @attribute stepsPerRevolution@@ -238,7 +238,7 @@ }, /**- * number of decimal places of accuracy in the value + * number of decimal places of accuracy in the value * * @attribute decimalPlaces * @type {Number}@@ -249,7 +249,7 @@ }, /**- * visible strings for the dial UI. This attribute is + * visible strings for the dial UI. This attribute is * defined by the base Widget class but has an empty value. The * Dial is simply providing a default value for the attribute. * Gets localized strings in the current language@@ -267,8 +267,8 @@ }, /**- * distance from the center of the dial to the - * center of the marker and handle, when at rest. + * distance from the center of the dial to the+ * center of the marker and handle, when at rest. * The value is a percent of the radius of the dial. * * @attribute handleDistance@@ -278,7 +278,7 @@ handleDistance:{ value:0.75 }- + }; /**@@ -295,8 +295,8 @@ _yuitest_coverline("build/dial/dial.js", 239); return Y.ClassNameManager.getClassName(Dial.NAME, str); }- - /** array of static constants used to identify the classname applied to the Dial DOM objects ++ /** array of static constants used to identify the classname applied to the Dial DOM objects * * @property CSS_CLASSES * @type {Array}@@ -322,10 +322,10 @@ hidden : makeClassName("hidden"), dragging : Y.ClassNameManager.getClassName("dd-dragging") };- + /* Static constants used to define the markup templates used to create Dial DOM elements */- + /** * template that will contain the Dial's label. *@@ -383,7 +383,7 @@ */ _yuitest_coverline("build/dial/dial.js", 321); Dial.HANDLE_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.handle + '" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">';- + }else{ // VML case _yuitest_coverline("build/dial/dial.js", 324); Dial.RING_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.ring + ' ' + Dial.CSS_CLASSES.ringVml + '">'+@@ -438,7 +438,7 @@ this._renderCenterButton(); _yuitest_coverline("build/dial/dial.js", 365); this._renderHandle();- + // object handles _yuitest_coverline("build/dial/dial.js", 368); this.contentBox = this.get("contentBox");@@ -464,7 +464,7 @@ this._angle = this._getAngleFromValue(this.get('value')); _yuitest_coverline("build/dial/dial.js", 381); this._prevAng = this._angle;- + // init _yuitest_coverline("build/dial/dial.js", 384); this._setTimesWrappedFromValue(this._originalValue);@@ -504,31 +504,31 @@ 'borderRadius':this._centerButtonNodeRadius + 'px' }); },- + /** * Handles the mouseenter on the centerButton- * + * * @method _handleCenterButtonEnter * @protected */ _handleCenterButtonEnter : function(){ _yuitest_coverfunc("build/dial/dial.js", "_handleCenterButtonEnter", 421); _yuitest_coverline("build/dial/dial.js", 422);-this._resetString.removeClass(Dial.CSS_CLASSES.hidden); - }, - +this._resetString.removeClass(Dial.CSS_CLASSES.hidden);+ },+ /** * Handles the mouseleave on the centerButton- * + * * @method _handleCenterButtonLeave * @protected */ _handleCenterButtonLeave : function(){ _yuitest_coverfunc("build/dial/dial.js", "_handleCenterButtonLeave", 431); _yuitest_coverline("build/dial/dial.js", 432);-this._resetString.addClass(Dial.CSS_CLASSES.hidden); - }, - +this._resetString.addClass(Dial.CSS_CLASSES.hidden);+ },+ /** * Creates the Y.DD.Drag instance used for the handle movement and * binds Dial interaction to the configured value model.@@ -537,47 +537,52 @@ * @protected */ bindUI : function() {+ _yuitest_coverfunc("build/dial/dial.js", "bindUI", 442);-_yuitest_coverline("build/dial/dial.js", 443);+_yuitest_coverline("build/dial/dial.js", 444); this.after("valueChange", this._afterValueChange); - _yuitest_coverline("build/dial/dial.js", 445);+ _yuitest_coverline("build/dial/dial.js", 446); var boundingBox = this.get("boundingBox"), // Looking for a key event which will fire continously across browsers while the key is held down.- keyEvent = (!Y.UA.opera) ? "down:" : "press:", + keyEvent = (!Y.UA.opera) ? "down:" : "press:", // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home keyEventSpec = keyEvent + "38,40,33,34,35,36", // 37 , 39 = arrow left/right keyLeftRightSpec = keyEvent + "37,39", // 37 , 39 = arrow left/right + meta (command/apple key) for mac- keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta";+ keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta",+ Drag = Y.DD.Drag; - _yuitest_coverline("build/dial/dial.js", 455);+ _yuitest_coverline("build/dial/dial.js", 457); Y.on("key", Y.bind(this._onDirectionKey, this), boundingBox, keyEventSpec);- _yuitest_coverline("build/dial/dial.js", 456);+ _yuitest_coverline("build/dial/dial.js", 458); Y.on("key", Y.bind(this._onLeftRightKey, this), boundingBox, keyLeftRightSpec);- _yuitest_coverline("build/dial/dial.js", 457);+ _yuitest_coverline("build/dial/dial.js", 459); boundingBox.on("key", this._onLeftRightKeyMeta, keyLeftRightSpecMeta, this); - _yuitest_coverline("build/dial/dial.js", 459);+ _yuitest_coverline("build/dial/dial.js", 461); Y.on('mouseenter', Y.bind(this._handleCenterButtonEnter, this), this._centerButtonNode);- _yuitest_coverline("build/dial/dial.js", 460);+ _yuitest_coverline("build/dial/dial.js", 462); Y.on('mouseleave', Y.bind(this._handleCenterButtonLeave, this), this._centerButtonNode); // Needed to replace mousedown/up with gesturemovestart/end to make behavior on touch devices work the same.- _yuitest_coverline("build/dial/dial.js", 462);-Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441] - _yuitest_coverline("build/dial/dial.js", 463);-Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); _yuitest_coverline("build/dial/dial.js", 464);-Y.on('gesturemovestart', Y.bind(this._handleHandleMousedown, this), this._handleNode);+Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441]+ _yuitest_coverline("build/dial/dial.js", 465);+Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); - _yuitest_coverline("build/dial/dial.js", 466);-Y.on('gesturemovestart', Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766] - _yuitest_coverline("build/dial/dial.js", 467);-Y.on('gesturemoveend', Y.bind(this._handleRingMouseup, this), this._ringNode); + _yuitest_coverline("build/dial/dial.js", 468);+Y.on(Drag.START_EVENT, Y.bind(this._handleHandleMousedown, this), this._handleNode); _yuitest_coverline("build/dial/dial.js", 469);-this._dd1 = new Y.DD.Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so +Y.on(Drag.START_EVENT, Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766]++ //TODO: Can this be merged this into the drag:end event listener to avoid another registration?+ _yuitest_coverline("build/dial/dial.js", 472);+Y.on('gesturemoveend', Y.bind(this._handleRingMouseup, this), this._ringNode);++ _yuitest_coverline("build/dial/dial.js", 474);+this._dd1 = new Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so node: this._handleNode, on : { 'drag:drag' : Y.bind(this._handleDrag, this),@@ -585,7 +590,7 @@ 'drag:end' : Y.bind(this._handleDragEnd, this) //, } });- _yuitest_coverline("build/dial/dial.js", 477);+ _yuitest_coverline("build/dial/dial.js", 482); Y.bind(this._dd1.addHandle(this._ringNode), this); // [#2530206] added the ring as a handle to the dd1 (the dd of the handleNode) }, @@ -598,91 +603,91 @@ * @private */ _setTimesWrappedFromValue : function(val){- _yuitest_coverfunc("build/dial/dial.js", "_setTimesWrappedFromValue", 488);-_yuitest_coverline("build/dial/dial.js", 489);+ _yuitest_coverfunc("build/dial/dial.js", "_setTimesWrappedFromValue", 493);+_yuitest_coverline("build/dial/dial.js", 494); if(val % this._stepsPerRevolution === 0){- _yuitest_coverline("build/dial/dial.js", 490);+ _yuitest_coverline("build/dial/dial.js", 495); this._timesWrapped = (val / this._stepsPerRevolution); }else{- _yuitest_coverline("build/dial/dial.js", 492);+ _yuitest_coverline("build/dial/dial.js", 497); this._timesWrapped = Math.floor(val / this._stepsPerRevolution); } },- + /**- * gets the angle of the line from the center of the Dial to the center of the handle + * gets the angle of the line from the center of the Dial to the center of the handle * * @method _getAngleFromHandleCenter- * @param handleCenterX {number} + * @param handleCenterX {number} * @param handleCenterY {number} * @return ang {number} the angle * @protected */ _getAngleFromHandleCenter : function(handleCenterX, handleCenterY){- _yuitest_coverfunc("build/dial/dial.js", "_getAngleFromHandleCenter", 505);-_yuitest_coverline("build/dial/dial.js", 506);-var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI); - _yuitest_coverline("build/dial/dial.js", 507);+ _yuitest_coverfunc("build/dial/dial.js", "_getAngleFromHandleCenter", 510);+_yuitest_coverline("build/dial/dial.js", 511);+var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI);+ _yuitest_coverline("build/dial/dial.js", 512); ang = ((this._dialCenterX - handleCenterX) < 0) ? ang + 90 : ang + 90 + 180; // Compensate for neg angles from Math.atan- _yuitest_coverline("build/dial/dial.js", 508);+ _yuitest_coverline("build/dial/dial.js", 513); return ang; },- + /**- * calculates the XY of the center of the dial relative to the ring node. + * calculates the XY of the center of the dial relative to the ring node. * This is needed for calculating the angle of the handle * * @method _calculateDialCenter * @protected */ _calculateDialCenter : function(){ // #2531111 value, and marker don't track handle when dial position changes on page (resize when inline)- _yuitest_coverfunc("build/dial/dial.js", "_calculateDialCenter", 518);-_yuitest_coverline("build/dial/dial.js", 519);-this._dialCenterX = this._ringNode.get('offsetWidth') / 2; - _yuitest_coverline("build/dial/dial.js", 520);+ _yuitest_coverfunc("build/dial/dial.js", "_calculateDialCenter", 523);+_yuitest_coverline("build/dial/dial.js", 524);+this._dialCenterX = this._ringNode.get('offsetWidth') / 2;+ _yuitest_coverline("build/dial/dial.js", 525); this._dialCenterY = this._ringNode.get('offsetHeight') / 2; },- + /** * Handles the mouseup on the ring- * + * * @method _handleRingMouseup * @protected */ _handleRingMouseup : function(){- _yuitest_coverfunc("build/dial/dial.js", "_handleRingMouseup", 529);-_yuitest_coverline("build/dial/dial.js", 530);-this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] - }, - + _yuitest_coverfunc("build/dial/dial.js", "_handleRingMouseup", 534);+_yuitest_coverline("build/dial/dial.js", 535);+this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]+ },+ /** * Handles the mouseup on the centerButton- * + * * @method _handleCenterButtonMouseup * @protected */ _handleCenterButtonMouseup : function(){- _yuitest_coverfunc("build/dial/dial.js", "_handleCenterButtonMouseup", 539);-_yuitest_coverline("build/dial/dial.js", 540);-this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] - }, - + _yuitest_coverfunc("build/dial/dial.js", "_handleCenterButtonMouseup", 544);+_yuitest_coverline("build/dial/dial.js", 545);+this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]+ },+ /** * Handles the mousedown on the handle- * + * * @method _handleHandleMousedown * @protected */ _handleHandleMousedown : function(){- _yuitest_coverfunc("build/dial/dial.js", "_handleHandleMousedown", 549);-_yuitest_coverline("build/dial/dial.js", 550);+ _yuitest_coverfunc("build/dial/dial.js", "_handleHandleMousedown", 554);+_yuitest_coverline("build/dial/dial.js", 555); this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]- // this is better done here instead of on _handleDragEnd - // because we should make the keyboard accessible after a click of the handle - }, - + // this is better done here instead of on _handleDragEnd+ // because we should make the keyboard accessible after a click of the handle+ },+ /**- * handles the user dragging the handle around the Dial, gets the angle, + * handles the user dragging the handle around the Dial, gets the angle, * checks for wrapping around top center. * Sets the new value of the Dial *@@ -691,61 +696,61 @@ * @protected */ _handleDrag : function(e){- _yuitest_coverfunc("build/dial/dial.js", "_handleDrag", 564);-_yuitest_coverline("build/dial/dial.js", 565);+ _yuitest_coverfunc("build/dial/dial.js", "_handleDrag", 569);+_yuitest_coverline("build/dial/dial.js", 570); var handleCenterX, handleCenterY, ang, newValue; - // The event was emitted from drag:drag of handle. + // The event was emitted from drag:drag of handle. // The center of the handle is top left position of the handle node + radius of handle. // This is different than a mousedown on the ring.- _yuitest_coverline("build/dial/dial.js", 573);+ _yuitest_coverline("build/dial/dial.js", 578); handleCenterX = (parseInt(this._handleNode.getStyle('left'),10) + this._handleNodeRadius);- _yuitest_coverline("build/dial/dial.js", 574);+ _yuitest_coverline("build/dial/dial.js", 579); handleCenterY = (parseInt(this._handleNode.getStyle('top'),10) + this._handleNodeRadius);- _yuitest_coverline("build/dial/dial.js", 575);+ _yuitest_coverline("build/dial/dial.js", 580); ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY); // check for need to set timesWrapped- _yuitest_coverline("build/dial/dial.js", 578);+ _yuitest_coverline("build/dial/dial.js", 583); if((this._prevAng > 270) && (ang < 90)){ // If wrapping, clockwise- _yuitest_coverline("build/dial/dial.js", 579);+ _yuitest_coverline("build/dial/dial.js", 584); if(this._timesWrapped < this._maxTimesWrapped){- _yuitest_coverline("build/dial/dial.js", 580);+ _yuitest_coverline("build/dial/dial.js", 585); this._timesWrapped = (this._timesWrapped + 1); }- }else {_yuitest_coverline("build/dial/dial.js", 582);+ }else {_yuitest_coverline("build/dial/dial.js", 587); if((this._prevAng < 90) && (ang > 270)){ // if un-wrapping, counter-clockwise- _yuitest_coverline("build/dial/dial.js", 583);+ _yuitest_coverline("build/dial/dial.js", 588); if(this._timesWrapped > this._minTimesWrapped){- _yuitest_coverline("build/dial/dial.js", 584);+ _yuitest_coverline("build/dial/dial.js", 589); this._timesWrapped = (this._timesWrapped - 1); } }}- _yuitest_coverline("build/dial/dial.js", 587);+ _yuitest_coverline("build/dial/dial.js", 592); newValue = this._getValueFromAngle(ang); // This function needs the current _timesWrapped value. That's why it comes after the _timesWrapped code above- + // If you've gone past max more than one full revolution, we decrement the _timesWrapped value // This gives the effect of a ratchet mechanism. // It feels like you are never more than one revolution past max // The effect is the same for min, only in reverse. // We can't reset the _timesWrapped to the max or min here. // If we did, the next (continuous) drag would reset the value incorrectly.- _yuitest_coverline("build/dial/dial.js", 595);+ _yuitest_coverline("build/dial/dial.js", 600); if(newValue > (this._maxValue + this._stepsPerRevolution) ){- _yuitest_coverline("build/dial/dial.js", 596);+ _yuitest_coverline("build/dial/dial.js", 601); this._timesWrapped --;- }else {_yuitest_coverline("build/dial/dial.js", 597);+ }else {_yuitest_coverline("build/dial/dial.js", 602); if(newValue < (this._minValue - this._stepsPerRevolution) ){- _yuitest_coverline("build/dial/dial.js", 598);+ _yuitest_coverline("build/dial/dial.js", 603); this._timesWrapped ++; }}- _yuitest_coverline("build/dial/dial.js", 600);-this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress + _yuitest_coverline("build/dial/dial.js", 605);+this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress - _yuitest_coverline("build/dial/dial.js", 602);+ _yuitest_coverline("build/dial/dial.js", 607); this._handleValuesBeyondMinMax(e, newValue); }, @@ -757,154 +762,161 @@ * @private */ _handleMousedown : function(e){ // #2530306- _yuitest_coverfunc("build/dial/dial.js", "_handleMousedown", 612);-_yuitest_coverline("build/dial/dial.js", 613);++ _yuitest_coverfunc("build/dial/dial.js", "_handleMousedown", 617);+_yuitest_coverline("build/dial/dial.js", 619);+if (this._ringNode.compareTo(e.target)) {+ _yuitest_coverline("build/dial/dial.js", 620); var minAng = this._getAngleFromValue(this._minValue),- maxAng = this._getAngleFromValue(this._maxValue),- newValue, oppositeMidRangeAngle,- handleCenterX, handleCenterY, - ang;+ maxAng = this._getAngleFromValue(this._maxValue),+ newValue, oppositeMidRangeAngle,+ handleCenterX, handleCenterY,+ ang; - // The event was emitted from mousedown on the ring node,- // so the center of the handle should be the XY of mousedown. - _yuitest_coverline("build/dial/dial.js", 621);+++ // The event was emitted from mousedown on the ring node,+ // so the center of the handle should be the XY of mousedown.+ _yuitest_coverline("build/dial/dial.js", 630); if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click- _yuitest_coverline("build/dial/dial.js", 622);+ _yuitest_coverline("build/dial/dial.js", 631); handleCenterX = (e.clientX - this._ringNode.getX());- _yuitest_coverline("build/dial/dial.js", 623);+ _yuitest_coverline("build/dial/dial.js", 632); handleCenterY = (e.clientY - this._ringNode.getY());- }else{- _yuitest_coverline("build/dial/dial.js", 625);+ }else{+ _yuitest_coverline("build/dial/dial.js", 634); handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());- _yuitest_coverline("build/dial/dial.js", 626);+ _yuitest_coverline("build/dial/dial.js", 635); handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY());- }- _yuitest_coverline("build/dial/dial.js", 628);+ }+ _yuitest_coverline("build/dial/dial.js", 637); ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);- - /* ///////////////////////////////////////////////////////////////////////////////////////////////////////- * The next sections of logic- * set this._timesWrapped in the different cases of value range- * and value range position, - * then the Dial value is set at the end of this method- */ ///////////////////////////////////////////////////////////////////////////////////////////////////////- - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////- _yuitest_coverline("build/dial/dial.js", 639);++ /* ///////////////////////////////////////////////////////////////////////////////////////////////////////+ * The next sections of logic+ * set this._timesWrapped in the different cases of value range+ * and value range position,+ * then the Dial value is set at the end of this method+ */ ///////////////////////////////////////////////////////////////////////////////////////////////////////+++ ////////////////////////////////////////////////////////////////////////////////////////////////////////////+ _yuitest_coverline("build/dial/dial.js", 648); if(this._maxValue - this._minValue > this._stepsPerRevolution){- // Case: range min-to-max is greater than stepsPerRevolution (one revolution) - // This checks the shortest way around the dial between the prevAng and this ang.- _yuitest_coverline("build/dial/dial.js", 643);+ // Case: range min-to-max is greater than stepsPerRevolution (one revolution)++ // This checks the shortest way around the dial between the prevAng and this ang.+ _yuitest_coverline("build/dial/dial.js", 653); if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping- - // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped - _yuitest_coverline("build/dial/dial.js", 646);-if((this._timesWrapped > this._minTimesWrapped) && - (this._timesWrapped < this._maxTimesWrapped)- ){ - // this checks which direction, clock wise or CCW and incr or decr _timesWrapped- _yuitest_coverline("build/dial/dial.js", 650);++ // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped+ _yuitest_coverline("build/dial/dial.js", 656);+if((this._timesWrapped > this._minTimesWrapped) &&+ (this._timesWrapped < this._maxTimesWrapped)+ ){+ // this checks which direction, clock wise or CCW and incr or decr _timesWrapped+ _yuitest_coverline("build/dial/dial.js", 660); this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);- }- // special case of getting un-stuck from a min value case - // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry- // because prevAng is set to 0 or > 0- }else {_yuitest_coverline("build/dial/dial.js", 655);+ }+ // special case of getting un-stuck from a min value case+ // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry+ // because prevAng is set to 0 or > 0+ }else {_yuitest_coverline("build/dial/dial.js", 665); if(- (this._timesWrapped === this._minTimesWrapped) && - (ang - this._prevAng < 180)- ){ - _yuitest_coverline("build/dial/dial.js", 659);+ (this._timesWrapped === this._minTimesWrapped) &&+ (ang - this._prevAng < 180)+ ){+ _yuitest_coverline("build/dial/dial.js", 669); this._timesWrapped ++;- }} //it didn't cross a wrapping boundary+ }} //it didn't cross a wrapping boundary - } /////////////////////////////////////////////////////////////////////////////////////////////////////////- else {_yuitest_coverline("build/dial/dial.js", 663);-if(this._maxValue - this._minValue === this._stepsPerRevolution){ - // Case: range min-to-max === stepsPerRevolution (one revolution)- // This means min and max will be at same angle- // This does not mean they are at "north" - - _yuitest_coverline("build/dial/dial.js", 668);+ } /////////////////////////////////////////////////////////////////////////////////////////////////////////+ else {_yuitest_coverline("build/dial/dial.js", 673);+if(this._maxValue - this._minValue === this._stepsPerRevolution){+ // Case: range min-to-max === stepsPerRevolution (one revolution)+ // This means min and max will be at same angle+ // This does not mean they are at "north"++ _yuitest_coverline("build/dial/dial.js", 678); if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)- // The only way it can be, is if min and max are not at north- _yuitest_coverline("build/dial/dial.js", 670);+ // The only way it can be, is if min and max are not at north+ _yuitest_coverline("build/dial/dial.js", 680); this._timesWrapped = 1;- }else{- _yuitest_coverline("build/dial/dial.js", 672);+ }else{+ _yuitest_coverline("build/dial/dial.js", 682); this._timesWrapped = 0;- }- - } //////////////////////////////////////////////////////////////////////////////////////////////////////////- else {_yuitest_coverline("build/dial/dial.js", 676);-if(minAng > maxAng){ - // Case: range includes the wrap point (north) - // Because of "else if"...- // range is < stepsPerRevolution- - _yuitest_coverline("build/dial/dial.js", 681);-if( - (this._prevAng >= minAng) && // if prev angle was greater than angle of min and...- (ang <= (minAng + maxAng) / 2) // the angle of this click is less than - // the angle opposite the mid-range angle, then...- ){- _yuitest_coverline("build/dial/dial.js", 686);-this._timesWrapped ++; - }else {_yuitest_coverline("build/dial/dial.js", 687);-if( - (this._prevAng <= maxAng) && - // if prev angle is < max angle and...- - (ang > (minAng + maxAng) / 2)- // the angle of this click is greater than,- // the angle opposite the mid-range angle and...- - ){ - _yuitest_coverline("build/dial/dial.js", 696);+ }++ } //////////////////////////////////////////////////////////////////////////////////////////////////////////+ else {_yuitest_coverline("build/dial/dial.js", 686);+if(minAng > maxAng){+ // Case: range includes the wrap point (north)+ // Because of "else if"...+ // range is < stepsPerRevolution++ _yuitest_coverline("build/dial/dial.js", 691);+if(+ (this._prevAng >= minAng) && // if prev angle was greater than angle of min and...+ (ang <= (minAng + maxAng) / 2) // the angle of this click is less than+ // the angle opposite the mid-range angle, then...+ ){+ _yuitest_coverline("build/dial/dial.js", 696);+this._timesWrapped ++;+ }else {_yuitest_coverline("build/dial/dial.js", 697);+if(+ (this._prevAng <= maxAng) &&+ // if prev angle is < max angle and...++ (ang > (minAng + maxAng) / 2)+ // the angle of this click is greater than,+ // the angle opposite the mid-range angle and...++ ){+ _yuitest_coverline("build/dial/dial.js", 706); this._timesWrapped --;- }}- - } ////////////////////////////////////////////////////////////////////////////////////////////////////- else{ - // "else" Case: min-to-max range doesn't include the wrap point- // Because of "else if"...- // range is still < stepsPerRevolution- - _yuitest_coverline("build/dial/dial.js", 705);+ }}++ } ////////////////////////////////////////////////////////////////////////////////////////////////////+ else{+ // "else" Case: min-to-max range doesn't include the wrap point+ // Because of "else if"...+ // range is still < stepsPerRevolution++ _yuitest_coverline("build/dial/dial.js", 715); if ((ang < minAng) || (ang > maxAng)){ // angle is out of range- _yuitest_coverline("build/dial/dial.js", 706);-oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360; - // This is the bisection of the min-to-max range + 180. (opposite the bisection)+ _yuitest_coverline("build/dial/dial.js", 716);+oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360;+ // This is the bisection of the min-to-max range + 180. (opposite the bisection) - _yuitest_coverline("build/dial/dial.js", 709);+ _yuitest_coverline("build/dial/dial.js", 719); if(oppositeMidRangeAngle > 180){- _yuitest_coverline("build/dial/dial.js", 710);+ _yuitest_coverline("build/dial/dial.js", 720); newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');- }else{ //oppositeMidRangeAngle <= 180- _yuitest_coverline("build/dial/dial.js", 712);+ }else{ //oppositeMidRangeAngle <= 180+ _yuitest_coverline("build/dial/dial.js", 722); newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');- }- _yuitest_coverline("build/dial/dial.js", 714);+ }+ _yuitest_coverline("build/dial/dial.js", 724); this._prevAng = this._getAngleFromValue(newValue);- _yuitest_coverline("build/dial/dial.js", 715);+ _yuitest_coverline("build/dial/dial.js", 725); this.set('value', newValue);- _yuitest_coverline("build/dial/dial.js", 716);+ _yuitest_coverline("build/dial/dial.js", 726); this._setTimesWrappedFromValue(newValue);- _yuitest_coverline("build/dial/dial.js", 717);+ _yuitest_coverline("build/dial/dial.js", 727); return;- }- }}}- - // Now that _timesWrapped is set value .......................................................................- _yuitest_coverline("build/dial/dial.js", 722);+ }+ }}}++ // Now that _timesWrapped is set value .......................................................................+ _yuitest_coverline("build/dial/dial.js", 732); newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value.- _yuitest_coverline("build/dial/dial.js", 723);-this._prevAng = ang; + _yuitest_coverline("build/dial/dial.js", 733);+this._prevAng = ang; - _yuitest_coverline("build/dial/dial.js", 725);+ _yuitest_coverline("build/dial/dial.js", 735); this._handleValuesBeyondMinMax(e, newValue);+ } }, /**@@ -917,37 +929,31 @@ */ _handleValuesBeyondMinMax : function(e, newValue){ // #2530306 // If _getValueFromAngle() is passed 0, it increments the _timesWrapped value.- // handle hitting max and min and going beyond, stops at max or min - _yuitest_coverfunc("build/dial/dial.js", "_handleValuesBeyondMinMax", 736);-_yuitest_coverline("build/dial/dial.js", 739);+ // handle hitting max and min and going beyond, stops at max or min+ _yuitest_coverfunc("build/dial/dial.js", "_handleValuesBeyondMinMax", 747);+_yuitest_coverline("build/dial/dial.js", 750); if((newValue >= this._minValue) && (newValue <= this._maxValue)) {- _yuitest_coverline("build/dial/dial.js", 740);+ _yuitest_coverline("build/dial/dial.js", 751); this.set('value', newValue); // [#2530206] transfer the mousedown event from the _ringNode to the _handleNode drag, so we can mousedown, then continue dragging- _yuitest_coverline("build/dial/dial.js", 742);+ _yuitest_coverline("build/dial/dial.js", 753); if(e.currentTarget === this._ringNode){ // Delegate to DD's natural behavior- _yuitest_coverline("build/dial/dial.js", 744);+ _yuitest_coverline("build/dial/dial.js", 755); this._dd1._handleMouseDownEvent(e);- } - }else {_yuitest_coverline("build/dial/dial.js", 746);+ }+ } else {_yuitest_coverline("build/dial/dial.js", 757); if(newValue > this._maxValue){- _yuitest_coverline("build/dial/dial.js", 747);+ _yuitest_coverline("build/dial/dial.js", 758); this.set('value', this._maxValue);- _yuitest_coverline("build/dial/dial.js", 748);-if(e.type === 'gesturemovestart'){- _yuitest_coverline("build/dial/dial.js", 749);+ _yuitest_coverline("build/dial/dial.js", 759); this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag- } - }else {_yuitest_coverline("build/dial/dial.js", 751);+ } else {_yuitest_coverline("build/dial/dial.js", 760); if(newValue < this._minValue){- _yuitest_coverline("build/dial/dial.js", 752);+ _yuitest_coverline("build/dial/dial.js", 761); this.set('value', this._minValue);- _yuitest_coverline("build/dial/dial.js", 753);-if(e.type === 'gesturemovestart'){- _yuitest_coverline("build/dial/dial.js", 754);+ _yuitest_coverline("build/dial/dial.js", 762); this._prevAng = this._getAngleFromValue(this._minValue);- } }}} }, @@ -959,14 +965,14 @@ * @protected */ _handleDragStart : function(e){- _yuitest_coverfunc("build/dial/dial.js", "_handleDragStart", 766);-_yuitest_coverline("build/dial/dial.js", 767);+ _yuitest_coverfunc("build/dial/dial.js", "_handleDragStart", 773);+_yuitest_coverline("build/dial/dial.js", 774); this._markerNode.removeClass(Dial.CSS_CLASSES.hidden); }, /* * When handle is handleDragEnd, this animates the return to the fixed dial- */ + */ /** * handles the end of a user dragging the handle, animates the handle returning to@@ -976,29 +982,29 @@ * @protected */ _handleDragEnd : function(){- _yuitest_coverfunc("build/dial/dial.js", "_handleDragEnd", 781);-_yuitest_coverline("build/dial/dial.js", 782);-var node = this._handleNode; - _yuitest_coverline("build/dial/dial.js", 783);+ _yuitest_coverfunc("build/dial/dial.js", "_handleDragEnd", 788);+_yuitest_coverline("build/dial/dial.js", 789);+var node = this._handleNode;+ _yuitest_coverline("build/dial/dial.js", 790); node.transition({ duration: 0.08, // seconds easing: 'ease-in', left: this._setNodeToFixedRadius(this._handleNode, true)[0] + 'px', top: this._setNodeToFixedRadius(this._handleNode, true)[1] + 'px' }, Y.bind(function(){- _yuitest_coverfunc("build/dial/dial.js", "(anonymous 2)", 788);-_yuitest_coverline("build/dial/dial.js", 789);+ _yuitest_coverfunc("build/dial/dial.js", "(anonymous 2)", 795);+_yuitest_coverline("build/dial/dial.js", 796); var value = this.get('value'); //[#2530206] only hide marker if not at max or min // more persistant user visibility of when the dial is at max or min- _yuitest_coverline("build/dial/dial.js", 792);+ _yuitest_coverline("build/dial/dial.js", 799); if((value > this._minValue) && (value < this._maxValue)){- _yuitest_coverline("build/dial/dial.js", 793);+ _yuitest_coverline("build/dial/dial.js", 800); this._markerNode.addClass(Dial.CSS_CLASSES.hidden); }else{- _yuitest_coverline("build/dial/dial.js", 795);+ _yuitest_coverline("build/dial/dial.js", 802); this._setTimesWrappedFromValue(value); //#2530766 secondary bug when drag past max + cross wrapping boundry- _yuitest_coverline("build/dial/dial.js", 796);+ _yuitest_coverline("build/dial/dial.js", 803); this._prevAng = this._getAngleFromValue(value); //#2530766 secondary bug when drag past max + cross wrapping boundry } }, this)@@ -1018,26 +1024,26 @@ * @return {Array} an array of [XY] is optionally returned */ _setNodeToFixedRadius : function(obj, typeArray){- _yuitest_coverfunc("build/dial/dial.js", "_setNodeToFixedRadius", 814);-_yuitest_coverline("build/dial/dial.js", 815);+ _yuitest_coverfunc("build/dial/dial.js", "_setNodeToFixedRadius", 821);+_yuitest_coverline("build/dial/dial.js", 822); var thisAngle = (this._angle - 90), rad = (Math.PI / 180), newY = Math.round(Math.sin(thisAngle * rad) * this._handleDistance), newX = Math.round(Math.cos(thisAngle * rad) * this._handleDistance), dia = obj.get('offsetWidth'); //Ticket #2529852- - _yuitest_coverline("build/dial/dial.js", 821);++ _yuitest_coverline("build/dial/dial.js", 828); newY = newY - (dia * 0.5);- _yuitest_coverline("build/dial/dial.js", 822);+ _yuitest_coverline("build/dial/dial.js", 829); newX = newX - (dia * 0.5);- _yuitest_coverline("build/dial/dial.js", 823);+ _yuitest_coverline("build/dial/dial.js", 830); if(typeArray){ // just need the style for css transform left and top to animate the handle drag:end- _yuitest_coverline("build/dial/dial.js", 824);+ _yuitest_coverline("build/dial/dial.js", 831); return [(this._ringNodeRadius + newX), (this._ringNodeRadius + newY)]; }else{- _yuitest_coverline("build/dial/dial.js", 826);+ _yuitest_coverline("build/dial/dial.js", 833); obj.setStyle('left', (this._ringNodeRadius + newX) + 'px');- _yuitest_coverline("build/dial/dial.js", 827);+ _yuitest_coverline("build/dial/dial.js", 834); obj.setStyle('top', (this._ringNodeRadius + newY) + 'px'); } },@@ -1049,26 +1055,26 @@ */ syncUI : function() { // Make the marker and the resetString display so their placement and borderRadius can be calculated, then hide them again.- // We would have used visibility:hidden in the css of this class, + // We would have used visibility:hidden in the css of this class, // but IE8 VML never returns to visible after applying visibility:hidden then removing it.- _yuitest_coverfunc("build/dial/dial.js", "syncUI", 836);-_yuitest_coverline("build/dial/dial.js", 840);+ _yuitest_coverfunc("build/dial/dial.js", "syncUI", 843);+_yuitest_coverline("build/dial/dial.js", 847); this._setSizes();- _yuitest_coverline("build/dial/dial.js", 841);+ _yuitest_coverline("build/dial/dial.js", 848); this._calculateDialCenter(); // #2531111 initialize center of dial- _yuitest_coverline("build/dial/dial.js", 842);+ _yuitest_coverline("build/dial/dial.js", 849); this._setBorderRadius();- _yuitest_coverline("build/dial/dial.js", 843);+ _yuitest_coverline("build/dial/dial.js", 850); this._uiSetValue(this.get("value"));- _yuitest_coverline("build/dial/dial.js", 844);+ _yuitest_coverline("build/dial/dial.js", 851); this._markerNode.addClass(Dial.CSS_CLASSES.hidden);- _yuitest_coverline("build/dial/dial.js", 845);+ _yuitest_coverline("build/dial/dial.js", 852); this._resetString.addClass(Dial.CSS_CLASSES.hidden); }, /** * sets the sizes of ring, center-button, marker, handle, and VML ovals in pixels.- * Needed only because some IE versions + * Needed only because some IE versions * ignore CSS percent sizes/offsets. * so these must be set in pixels. * Normally these are set in % of the ring.@@ -1077,62 +1083,62 @@ * @protected */ _setSizes : function(){- _yuitest_coverfunc("build/dial/dial.js", "_setSizes", 858);-_yuitest_coverline("build/dial/dial.js", 859);+ _yuitest_coverfunc("build/dial/dial.js", "_setSizes", 865);+_yuitest_coverline("build/dial/dial.js", 866); var dia = this.get('diameter'), offset, offsetResetX, offsetResetY, setSize = function(node, dia, percent){- _yuitest_coverfunc("build/dial/dial.js", "setSize", 861);-_yuitest_coverline("build/dial/dial.js", 862);+ _yuitest_coverfunc("build/dial/dial.js", "setSize", 868);+_yuitest_coverline("build/dial/dial.js", 869); var suffix = 'px';- _yuitest_coverline("build/dial/dial.js", 863);+ _yuitest_coverline("build/dial/dial.js", 870); node.getElementsByTagName('oval').setStyle('width', (dia * percent) + suffix);- _yuitest_coverline("build/dial/dial.js", 864);+ _yuitest_coverline("build/dial/dial.js", 871); node.getElementsByTagName('oval').setStyle('height', (dia * percent) + suffix);- _yuitest_coverline("build/dial/dial.js", 865);+ _yuitest_coverline("build/dial/dial.js", 872); node.setStyle('width', (dia * percent) + suffix);- _yuitest_coverline("build/dial/dial.js", 866);+ _yuitest_coverline("build/dial/dial.js", 873); node.setStyle('height', (dia * percent) + suffix); };- _yuitest_coverline("build/dial/dial.js", 868);+ _yuitest_coverline("build/dial/dial.js", 875); setSize(this._ringNode, dia, 1.0);- _yuitest_coverline("build/dial/dial.js", 869);+ _yuitest_coverline("build/dial/dial.js", 876); setSize(this._handleNode, dia, this.get('handleDiameter'));- _yuitest_coverline("build/dial/dial.js", 870);+ _yuitest_coverline("build/dial/dial.js", 877); setSize(this._markerNode, dia, this.get('markerDiameter'));- _yuitest_coverline("build/dial/dial.js", 871);+ _yuitest_coverline("build/dial/dial.js", 878); setSize(this._centerButtonNode, dia, this.get('centerButtonDiameter'));- - // Set these (used for trig) this way instead of relative to dia, ++ // Set these (used for trig) this way instead of relative to dia, // in case they have borders, have images etc.- _yuitest_coverline("build/dial/dial.js", 875);+ _yuitest_coverline("build/dial/dial.js", 882); this._ringNodeRadius = this._ringNode.get('offsetWidth') * 0.5;- _yuitest_coverline("build/dial/dial.js", 876);+ _yuitest_coverline("build/dial/dial.js", 883); this._handleNodeRadius = this._handleNode.get('offsetWidth') * 0.5;- _yuitest_coverline("build/dial/dial.js", 877);+ _yuitest_coverline("build/dial/dial.js", 884); this._markerNodeRadius = this._markerNode.get('offsetWidth') * 0.5;- _yuitest_coverline("build/dial/dial.js", 878);+ _yuitest_coverline("build/dial/dial.js", 885); this._centerButtonNodeRadius = this._centerButtonNode.get('offsetWidth') * 0.5;- _yuitest_coverline("build/dial/dial.js", 879);+ _yuitest_coverline("build/dial/dial.js", 886); this._handleDistance = this._ringNodeRadius * this.get('handleDistance'); // place the centerButton- _yuitest_coverline("build/dial/dial.js", 881);+ _yuitest_coverline("build/dial/dial.js", 888); offset = (this._ringNodeRadius - this._centerButtonNodeRadius);- _yuitest_coverline("build/dial/dial.js", 882);+ _yuitest_coverline("build/dial/dial.js", 889); this._centerButtonNode.setStyle('left', offset + 'px');- _yuitest_coverline("build/dial/dial.js", 883);+ _yuitest_coverline("build/dial/dial.js", 890); this._centerButtonNode.setStyle('top', offset + 'px');- /* + /* Place the resetString This seems like it should be able to be done with CSS, But since there is also a VML oval in IE that is absolute positioned, The resetString ends up behind the VML oval. */- _yuitest_coverline("build/dial/dial.js", 890);+ _yuitest_coverline("build/dial/dial.js", 897); offsetResetX = (this._centerButtonNodeRadius - (this._resetString.get('offsetWidth') * 0.5));- _yuitest_coverline("build/dial/dial.js", 891);+ _yuitest_coverline("build/dial/dial.js", 898); offsetResetY = (this._centerButtonNodeRadius - (this._resetString.get('offsetHeight') * 0.5));- _yuitest_coverline("build/dial/dial.js", 892);+ _yuitest_coverline("build/dial/dial.js", 899); this._resetString.setStyles({'left':offsetResetX + 'px', 'top':offsetResetY + 'px'}); }, @@ -1144,20 +1150,20 @@ * @protected */ _renderLabel : function() {- _yuitest_coverfunc("build/dial/dial.js", "_renderLabel", 902);-_yuitest_coverline("build/dial/dial.js", 903);+ _yuitest_coverfunc("build/dial/dial.js", "_renderLabel", 909);+_yuitest_coverline("build/dial/dial.js", 910); var contentBox = this.get("contentBox"), label = contentBox.one("." + Dial.CSS_CLASSES.label);- _yuitest_coverline("build/dial/dial.js", 905);+ _yuitest_coverline("build/dial/dial.js", 912); if (!label) {- _yuitest_coverline("build/dial/dial.js", 906);+ _yuitest_coverline("build/dial/dial.js", 913); label = Node.create(Y.Lang.sub(Dial.LABEL_TEMPLATE, this.get('strings')));- _yuitest_coverline("build/dial/dial.js", 907);+ _yuitest_coverline("build/dial/dial.js", 914); contentBox.append(label); }- _yuitest_coverline("build/dial/dial.js", 909);+ _yuitest_coverline("build/dial/dial.js", 916); this._labelNode = label;- _yuitest_coverline("build/dial/dial.js", 910);+ _yuitest_coverline("build/dial/dial.js", 917); this._valueStringNode = this._labelNode.one("." + Dial.CSS_CLASSES.valueString); }, @@ -1168,42 +1174,42 @@ * @protected */ _renderRing : function() {- _yuitest_coverfunc("build/dial/dial.js", "_renderRing", 919);-_yuitest_coverline("build/dial/dial.js", 920);+ _yuitest_coverfunc("build/dial/dial.js", "_renderRing", 926);+_yuitest_coverline("build/dial/dial.js", 927); var contentBox = this.get("contentBox"), ring = contentBox.one("." + Dial.CSS_CLASSES.ring);- _yuitest_coverline("build/dial/dial.js", 922);+ _yuitest_coverline("build/dial/dial.js", 929); if (!ring) {- _yuitest_coverline("build/dial/dial.js", 923);+ _yuitest_coverline("build/dial/dial.js", 930); ring = contentBox.appendChild(Dial.RING_TEMPLATE);- _yuitest_coverline("build/dial/dial.js", 924);+ _yuitest_coverline("build/dial/dial.js", 931); ring.setStyles({width:this.get('diameter') + 'px', height:this.get('diameter') + 'px'}); }- _yuitest_coverline("build/dial/dial.js", 926);+ _yuitest_coverline("build/dial/dial.js", 933); this._ringNode = ring; }, /**- * renders the DOM object for the Dial's background marker which + * renders the DOM object for the Dial's background marker which * tracks the angle of the user dragging the handle * * @method _renderMarker * @protected */ _renderMarker : function() {- _yuitest_coverfunc("build/dial/dial.js", "_renderMarker", 936);-_yuitest_coverline("build/dial/dial.js", 937);+ _yuitest_coverfunc("build/dial/dial.js", "_renderMarker", 943);+_yuitest_coverline("build/dial/dial.js", 944); var contentBox = this.get("contentBox"), marker = contentBox.one("." + Dial.CSS_CLASSES.marker);- _yuitest_coverline("build/dial/dial.js", 939);+ _yuitest_coverline("build/dial/dial.js", 946); if (!marker) {- _yuitest_coverline("build/dial/dial.js", 940);+ _yuitest_coverline("build/dial/dial.js", 947); marker = contentBox.one('.' + Dial.CSS_CLASSES.ring).appendChild(Dial.MARKER_TEMPLATE); }- _yuitest_coverline("build/dial/dial.js", 942);+ _yuitest_coverline("build/dial/dial.js", 949); this._markerNode = marker; },- + /** * renders the DOM object for the Dial's center *@@ -1211,20 +1217,20 @@ * @protected */ _renderCenterButton : function() {- _yuitest_coverfunc("build/dial/dial.js", "_renderCenterButton", 951);-_yuitest_coverline("build/dial/dial.js", 952);+ _yuitest_coverfunc("build/dial/dial.js", "_renderCenterButton", 958);+_yuitest_coverline("build/dial/dial.js", 959); var contentBox = this.get("contentBox"), centerButton = contentBox.one("." + Dial.CSS_CLASSES.centerButton);- _yuitest_coverline("build/dial/dial.js", 954);+ _yuitest_coverline("build/dial/dial.js", 961); if (!centerButton) {- _yuitest_coverline("build/dial/dial.js", 955);+ _yuitest_coverline("build/dial/dial.js", 962); centerButton = Node.create(Y.Lang.sub(Dial.CENTER_BUTTON_TEMPLATE, this.get('strings')));- _yuitest_coverline("build/dial/dial.js", 956);+ _yuitest_coverline("build/dial/dial.js", 963); contentBox.one('.' + Dial.CSS_CLASSES.ring).append(centerButton); }- _yuitest_coverline("build/dial/dial.js", 958);+ _yuitest_coverline("build/dial/dial.js", 965); this._centerButtonNode = centerButton;- _yuitest_coverline("build/dial/dial.js", 959);+ _yuitest_coverline("build/dial/dial.js", 966); this._resetString = this._centerButtonNode.one('.' + Dial.CSS_CLASSES.resetString); }, @@ -1234,24 +1240,24 @@ * @method _renderHandle * @protected */- _renderHandle : function() { - _yuitest_coverfunc("build/dial/dial.js", "_renderHandle", 968);-_yuitest_coverline("build/dial/dial.js", 969);+ _renderHandle : function() {+ _yuitest_coverfunc("build/dial/dial.js", "_renderHandle", 975);+_yuitest_coverline("build/dial/dial.js", 976); var labelId = Dial.CSS_CLASSES.label + Y.guid(), //get this unique id once then use for handle and label for ARIA contentBox = this.get("contentBox"), handle = contentBox.one("." + Dial.CSS_CLASSES.handle);- _yuitest_coverline("build/dial/dial.js", 972);+ _yuitest_coverline("build/dial/dial.js", 979); if (!handle) {- _yuitest_coverline("build/dial/dial.js", 973);+ _yuitest_coverline("build/dial/dial.js", 980); handle = Node.create(Y.Lang.sub(Dial.HANDLE_TEMPLATE, this.get('strings')));- _yuitest_coverline("build/dial/dial.js", 974);+ _yuitest_coverline("build/dial/dial.js", 981); handle.setAttribute('aria-labelledby', labelId); // get unique id for specifying a label & handle for ARIA- _yuitest_coverline("build/dial/dial.js", 975);+ _yuitest_coverline("build/dial/dial.js", 982); this._labelNode.one('.' + Dial.CSS_CLASSES.labelString).setAttribute('id', labelId); // When handle gets focus, screen reader will include label text when reading the value.- _yuitest_coverline("build/dial/dial.js", 976);+ _yuitest_coverline("build/dial/dial.js", 983); contentBox.one('.' + Dial.CSS_CLASSES.ring).append(handle); }- _yuitest_coverline("build/dial/dial.js", 978);+ _yuitest_coverline("build/dial/dial.js", 985); this._handleNode = handle; }, @@ -1265,8 +1271,8 @@ */ _setLabelString : function(str) {- _yuitest_coverfunc("build/dial/dial.js", "_setLabelString", 990);-_yuitest_coverline("build/dial/dial.js", 991);+ _yuitest_coverfunc("build/dial/dial.js", "_setLabelString", 997);+_yuitest_coverline("build/dial/dial.js", 998); this.get("contentBox").one("." + Dial.CSS_CLASSES.labelString).setHTML(str); }, @@ -1279,8 +1285,8 @@ * @deprecated Use DialObjName.set('strings',{'resetStr':'My new reset string'}); before DialObjName.render(); */ _setResetString : function(str) {- _yuitest_coverfunc("build/dial/dial.js", "_setResetString", 1002);-_yuitest_coverline("build/dial/dial.js", 1003);+ _yuitest_coverfunc("build/dial/dial.js", "_setResetString", 1009);+_yuitest_coverline("build/dial/dial.js", 1010); this.get("contentBox").one("." + Dial.CSS_CLASSES.resetString).setHTML(str); // this._setXYResetString(); // This used to recenter the string in the button. Done with CSS now. Method has been removed. // this._resetString.setHTML(''); //We no longer show/hide the reset string with setHTML but by addClass and removeClass .yui3-dial-reset-string-hidden@@ -1295,14 +1301,14 @@ * @deprecated Use DialObjName.set('strings',{'tooltipHandle':'My new tooltip'}); before DialObjName.render(); */ _setTooltipString : function(str) {- _yuitest_coverfunc("build/dial/dial.js", "_setTooltipString", 1016);-_yuitest_coverline("build/dial/dial.js", 1017);+ _yuitest_coverfunc("build/dial/dial.js", "_setTooltipString", 1023);+_yuitest_coverline("build/dial/dial.js", 1024); this._handleNode.set('title', str); }, /** * sets the Dial's value in response to key events.- * Left and right keys are in a separate method + * Left and right keys are in a separate method * in case an implementation wants to increment values * but needs left and right arrow keys for other purposes. *@@ -1311,40 +1317,40 @@ * @protected */ _onDirectionKey : function(e) {- _yuitest_coverfunc("build/dial/dial.js", "_onDirectionKey", 1030);-_yuitest_coverline("build/dial/dial.js", 1031);+ _yuitest_coverfunc("build/dial/dial.js", "_onDirectionKey", 1037);+_yuitest_coverline("build/dial/dial.js", 1038); e.preventDefault();- _yuitest_coverline("build/dial/dial.js", 1032);+ _yuitest_coverline("build/dial/dial.js", 1039); switch (e.charCode) { case 38: // up- _yuitest_coverline("build/dial/dial.js", 1034);+ _yuitest_coverline("build/dial/dial.js", 1041); this._incrMinor();- _yuitest_coverline("build/dial/dial.js", 1035);+ _yuitest_coverline("build/dial/dial.js", 1042); break; case 40: // down- _yuitest_coverline("build/dial/dial.js", 1037);+ _yuitest_coverline("build/dial/dial.js", 1044); this._decrMinor();- _yuitest_coverline("build/dial/dial.js", 1038);+ _yuitest_coverline("build/dial/dial.js", 1045); break; case 36: // home- _yuitest_coverline("build/dial/dial.js", 1040);+ _yuitest_coverline("build/dial/dial.js", 1047); this._setToMin();- _yuitest_coverline("build/dial/dial.js", 1041);+ _yuitest_coverline("build/dial/dial.js", 1048); break; case 35: // end- _yuitest_coverline("build/dial/dial.js", 1043);+ _yuitest_coverline("build/dial/dial.js", 1050); this._setToMax();- _yuitest_coverline("build/dial/dial.js", 1044);+ _yuitest_coverline("build/dial/dial.js", 1051); break; case 33: // page up- _yuitest_coverline("build/dial/dial.js", 1046);+ _yuitest_coverline("build/dial/dial.js", 1053); this._incrMajor();- _yuitest_coverline("build/dial/dial.js", 1047);+ _yuitest_coverline("build/dial/dial.js", 1054); break; case 34: // page down- _yuitest_coverline("build/dial/dial.js", 1049);+ _yuitest_coverline("build/dial/dial.js", 1056); this._decrMajor();- _yuitest_coverline("build/dial/dial.js", 1050);+ _yuitest_coverline("build/dial/dial.js", 1057); break; } },@@ -1357,20 +1363,20 @@ * @protected */ _onLeftRightKey : function(e) {- _yuitest_coverfunc("build/dial/dial.js", "_onLeftRightKey", 1061);-_yuitest_coverline("build/dial/dial.js", 1062);+ _yuitest_coverfunc("build/dial/dial.js", "_onLeftRightKey", 1068);+_yuitest_coverline("build/dial/dial.js", 1069); e.preventDefault();- _yuitest_coverline("build/dial/dial.js", 1063);+ _yuitest_coverline("build/dial/dial.js", 1070); switch (e.charCode) { case 37: // left- _yuitest_coverline("build/dial/dial.js", 1065);+ _yuitest_coverline("build/dial/dial.js", 1072); this._decrMinor();- _yuitest_coverline("build/dial/dial.js", 1066);+ _yuitest_coverline("build/dial/dial.js", 1073); break; case 39: // right- _yuitest_coverline("build/dial/dial.js", 1068);+ _yuitest_coverline("build/dial/dial.js", 1075); this._incrMinor();- _yuitest_coverline("build/dial/dial.js", 1069);+ _yuitest_coverline("build/dial/dial.js", 1076); break; } },@@ -1383,24 +1389,24 @@ * @protected */ _onLeftRightKeyMeta : function(e) {- _yuitest_coverfunc("build/dial/dial.js", "_onLeftRightKeyMeta", 1080);-_yuitest_coverline("build/dial/dial.js", 1081);+ _yuitest_coverfunc("build/dial/dial.js", "_onLeftRightKeyMeta", 1087);+_yuitest_coverline("build/dial/dial.js", 1088); e.preventDefault();- _yuitest_coverline("build/dial/dial.js", 1082);+ _yuitest_coverline("build/dial/dial.js", 1089); switch (e.charCode) { case 37: // left + meta- _yuitest_coverline("build/dial/dial.js", 1084);+ _yuitest_coverline("build/dial/dial.js", 1091); this._setToMin();- _yuitest_coverline("build/dial/dial.js", 1085);+ _yuitest_coverline("build/dial/dial.js", 1092); break; case 39: // right + meta- _yuitest_coverline("build/dial/dial.js", 1087);+ _yuitest_coverline("build/dial/dial.js", 1094); this._setToMax();- _yuitest_coverline("build/dial/dial.js", 1088);+ _yuitest_coverline("build/dial/dial.js", 1095); break; } },- + /** * increments Dial value by a minor increment *@@ -1408,19 +1414,19 @@ * @protected */ _incrMinor : function(){- _yuitest_coverfunc("build/dial/dial.js", "_incrMinor", 1098);-_yuitest_coverline("build/dial/dial.js", 1099);+ _yuitest_coverfunc("build/dial/dial.js", "_incrMinor", 1105);+_yuitest_coverline("build/dial/dial.js", 1106); var newVal = (this.get('value') + this.get("minorStep"));- _yuitest_coverline("build/dial/dial.js", 1100);+ _yuitest_coverline("build/dial/dial.js", 1107); newVal = Math.min(newVal, this.get("max")); // [#2530045] .toFixed returns a string. // Dial's value needs a number. -0 makes it a number, but removes trailing zeros. // Added toFixed(...) again in _uiSetValue where content of yui3-dial-value-string is set. // Removing the toFixed here, loses the feature of "snap-to" when for example, stepsPerRevolution is 10 and decimalPlaces is 0.- _yuitest_coverline("build/dial/dial.js", 1105);+ _yuitest_coverline("build/dial/dial.js", 1112); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * decrements Dial value by a minor increment *@@ -1428,15 +1434,15 @@ * @protected */ _decrMinor : function(){- _yuitest_coverfunc("build/dial/dial.js", "_decrMinor", 1114);-_yuitest_coverline("build/dial/dial.js", 1115);+ _yuitest_coverfunc("build/dial/dial.js", "_decrMinor", 1121);+_yuitest_coverline("build/dial/dial.js", 1122); var newVal = (this.get('value') - this.get("minorStep"));- _yuitest_coverline("build/dial/dial.js", 1116);+ _yuitest_coverline("build/dial/dial.js", 1123); newVal = Math.max(newVal, this.get("min"));- _yuitest_coverline("build/dial/dial.js", 1117);+ _yuitest_coverline("build/dial/dial.js", 1124); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * increments Dial value by a major increment *@@ -1444,15 +1450,15 @@ * @protected */ _incrMajor : function(){- _yuitest_coverfunc("build/dial/dial.js", "_incrMajor", 1126);-_yuitest_coverline("build/dial/dial.js", 1127);+ _yuitest_coverfunc("build/dial/dial.js", "_incrMajor", 1133);+_yuitest_coverline("build/dial/dial.js", 1134); var newVal = (this.get('value') + this.get("majorStep"));- _yuitest_coverline("build/dial/dial.js", 1128);+ _yuitest_coverline("build/dial/dial.js", 1135); newVal = Math.min(newVal, this.get("max"));- _yuitest_coverline("build/dial/dial.js", 1129);+ _yuitest_coverline("build/dial/dial.js", 1136); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * decrements Dial value by a major increment *@@ -1460,12 +1466,12 @@ * @protected */ _decrMajor : function(){- _yuitest_coverfunc("build/dial/dial.js", "_decrMajor", 1138);-_yuitest_coverline("build/dial/dial.js", 1139);+ _yuitest_coverfunc("build/dial/dial.js", "_decrMajor", 1145);+_yuitest_coverline("build/dial/dial.js", 1146); var newVal = (this.get('value') - this.get("majorStep"));- _yuitest_coverline("build/dial/dial.js", 1140);+ _yuitest_coverline("build/dial/dial.js", 1147); newVal = Math.max(newVal, this.get("min"));- _yuitest_coverline("build/dial/dial.js", 1141);+ _yuitest_coverline("build/dial/dial.js", 1148); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); }, @@ -1476,11 +1482,11 @@ * @protected */ _setToMax : function(){- _yuitest_coverfunc("build/dial/dial.js", "_setToMax", 1150);-_yuitest_coverline("build/dial/dial.js", 1151);+ _yuitest_coverfunc("build/dial/dial.js", "_setToMax", 1157);+_yuitest_coverline("build/dial/dial.js", 1158); this.set('value', this.get("max"));- }, - + },+ /** * sets Dial value to dial's min attr *@@ -1488,34 +1494,34 @@ * @protected */ _setToMin : function(){- _yuitest_coverfunc("build/dial/dial.js", "_setToMin", 1160);-_yuitest_coverline("build/dial/dial.js", 1161);+ _yuitest_coverfunc("build/dial/dial.js", "_setToMin", 1167);+_yuitest_coverline("build/dial/dial.js", 1168); this.set('value', this.get("min"));- }, - + },+ /**- * resets Dial value to the orignal initial value. + * resets Dial value to the orignal initial value. * * @method _resetDial * @protected */ _resetDial : function(e){- _yuitest_coverfunc("build/dial/dial.js", "_resetDial", 1170);-_yuitest_coverline("build/dial/dial.js", 1171);+ _yuitest_coverfunc("build/dial/dial.js", "_resetDial", 1177);+_yuitest_coverline("build/dial/dial.js", 1178); if(e){- _yuitest_coverline("build/dial/dial.js", 1172);+ _yuitest_coverline("build/dial/dial.js", 1179); e.stopPropagation(); //[#2530206] need to add so mousedown doesn't propagate to ring and move the handle }- _yuitest_coverline("build/dial/dial.js", 1174);+ _yuitest_coverline("build/dial/dial.js", 1181); this.set('value', this._originalValue);- _yuitest_coverline("build/dial/dial.js", 1175);+ _yuitest_coverline("build/dial/dial.js", 1182); this._resetString.addClass(Dial.CSS_CLASSES.hidden); //[#2530441]- _yuitest_coverline("build/dial/dial.js", 1176);+ _yuitest_coverline("build/dial/dial.js", 1183); this._handleNode.focus(); },- + /**- * returns the handle angle associated with the current value of the Dial. + * returns the handle angle associated with the current value of the Dial. * Returns a number between 0 and 360. * * @method _getAngleFromValue@@ -1524,11 +1530,11 @@ * @protected */ _getAngleFromValue : function(newVal){- _yuitest_coverfunc("build/dial/dial.js", "_getAngleFromValue", 1188);-_yuitest_coverline("build/dial/dial.js", 1189);+ _yuitest_coverfunc("build/dial/dial.js", "_getAngleFromValue", 1195);+_yuitest_coverline("build/dial/dial.js", 1196); var nonWrappedPartOfValue = newVal % this._stepsPerRevolution, angleFromValue = nonWrappedPartOfValue / this._stepsPerRevolution * 360;- _yuitest_coverline("build/dial/dial.js", 1191);+ _yuitest_coverline("build/dial/dial.js", 1198); return (angleFromValue < 0) ? (angleFromValue + 360) : angleFromValue; }, @@ -1541,22 +1547,22 @@ * @protected */ _getValueFromAngle : function(angle){- _yuitest_coverfunc("build/dial/dial.js", "_getValueFromAngle", 1202);-_yuitest_coverline("build/dial/dial.js", 1203);+ _yuitest_coverfunc("build/dial/dial.js", "_getValueFromAngle", 1209);+_yuitest_coverline("build/dial/dial.js", 1210); if(angle < 0){- _yuitest_coverline("build/dial/dial.js", 1204);+ _yuitest_coverline("build/dial/dial.js", 1211); angle = (360 + angle);- }else {_yuitest_coverline("build/dial/dial.js", 1205);+ }else {_yuitest_coverline("build/dial/dial.js", 1212); if(angle === 0){- _yuitest_coverline("build/dial/dial.js", 1206);+ _yuitest_coverline("build/dial/dial.js", 1213); angle = 360; }}- _yuitest_coverline("build/dial/dial.js", 1208);+ _yuitest_coverline("build/dial/dial.js", 1215); var value = (angle / 360) * this._stepsPerRevolution;- _yuitest_coverline("build/dial/dial.js", 1209);+ _yuitest_coverline("build/dial/dial.js", 1216); value = (value + (this._timesWrapped * this._stepsPerRevolution)); //return Math.round(value * 100) / 100;- _yuitest_coverline("build/dial/dial.js", 1211);+ _yuitest_coverline("build/dial/dial.js", 1218); return value.toFixed(this.get('decimalPlaces')) - 0; }, @@ -1568,8 +1574,8 @@ * @protected */ _afterValueChange : function(e) {- _yuitest_coverfunc("build/dial/dial.js", "_afterValueChange", 1221);-_yuitest_coverline("build/dial/dial.js", 1222);+ _yuitest_coverfunc("build/dial/dial.js", "_afterValueChange", 1228);+_yuitest_coverline("build/dial/dial.js", 1229); this._uiSetValue(e.newVal); }, @@ -1582,11 +1588,11 @@ * @protected */ _valueToDecimalPlaces : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min.- + }, /**- * Updates the UI display value of the Dial to reflect + * Updates the UI display value of the Dial to reflect * the value passed in. * Makes all other needed UI display changes *@@ -1595,48 +1601,48 @@ * @protected */ _uiSetValue : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min.- _yuitest_coverfunc("build/dial/dial.js", "_uiSetValue", 1246);-_yuitest_coverline("build/dial/dial.js", 1247);+ _yuitest_coverfunc("build/dial/dial.js", "_uiSetValue", 1253);+_yuitest_coverline("build/dial/dial.js", 1254); this._angle = this._getAngleFromValue(val);- _yuitest_coverline("build/dial/dial.js", 1248);+ _yuitest_coverline("build/dial/dial.js", 1255); if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){- _yuitest_coverline("build/dial/dial.js", 1249);+ _yuitest_coverline("build/dial/dial.js", 1256); this._setTimesWrappedFromValue(val);- _yuitest_coverline("build/dial/dial.js", 1250);+ _yuitest_coverline("build/dial/dial.js", 1257); this._setNodeToFixedRadius(this._handleNode, false);- _yuitest_coverline("build/dial/dial.js", 1251);+ _yuitest_coverline("build/dial/dial.js", 1258); this._prevAng = this._getAngleFromValue(this.get('value')); }- _yuitest_coverline("build/dial/dial.js", 1253);+ _yuitest_coverline("build/dial/dial.js", 1260); this._valueStringNode.setHTML(val.toFixed(this.get('decimalPlaces'))); // [#2530045]- _yuitest_coverline("build/dial/dial.js", 1254);+ _yuitest_coverline("build/dial/dial.js", 1261); this._handleNode.set('aria-valuenow', val);- _yuitest_coverline("build/dial/dial.js", 1255);+ _yuitest_coverline("build/dial/dial.js", 1262); this._handleNode.set('aria-valuetext', val);- _yuitest_coverline("build/dial/dial.js", 1256);+ _yuitest_coverline("build/dial/dial.js", 1263); this._setNodeToFixedRadius(this._markerNode, false);- _yuitest_coverline("build/dial/dial.js", 1257);+ _yuitest_coverline("build/dial/dial.js", 1264); if((val === this._maxValue) || (val === this._minValue)){- _yuitest_coverline("build/dial/dial.js", 1258);+ _yuitest_coverline("build/dial/dial.js", 1265); this._markerNode.addClass(Dial.CSS_CLASSES.markerMaxMin);- _yuitest_coverline("build/dial/dial.js", 1259);+ _yuitest_coverline("build/dial/dial.js", 1266); if(supportsVML === true){- _yuitest_coverline("build/dial/dial.js", 1260);+ _yuitest_coverline("build/dial/dial.js", 1267); this._markerNode.getElementsByTagName('fill').set('color', '#AB3232'); }- _yuitest_coverline("build/dial/dial.js", 1262);+ _yuitest_coverline("build/dial/dial.js", 1269); this._markerNode.removeClass(Dial.CSS_CLASSES.hidden); }else{ // not max or min- _yuitest_coverline("build/dial/dial.js", 1264);+ _yuitest_coverline("build/dial/dial.js", 1271); if(supportsVML === true){- _yuitest_coverline("build/dial/dial.js", 1265);+ _yuitest_coverline("build/dial/dial.js", 1272); this._markerNode.getElementsByTagName('fill').set('color', '#000'); }- _yuitest_coverline("build/dial/dial.js", 1267);+ _yuitest_coverline("build/dial/dial.js", 1274); this._markerNode.removeClass(Dial.CSS_CLASSES.markerMaxMin);- _yuitest_coverline("build/dial/dial.js", 1268);+ _yuitest_coverline("build/dial/dial.js", 1275); if(this._handleNode.hasClass(Dial.CSS_CLASSES.dragging) === false){ // if not max || min, and not dragging handle, hide the marker- _yuitest_coverline("build/dial/dial.js", 1269);+ _yuitest_coverline("build/dial/dial.js", 1276); this._markerNode.addClass(Dial.CSS_CLASSES.hidden); } }@@ -1651,16 +1657,16 @@ * @protected */ _validateValue: function(val) {- _yuitest_coverfunc("build/dial/dial.js", "_validateValue", 1282);-_yuitest_coverline("build/dial/dial.js", 1283);+ _yuitest_coverfunc("build/dial/dial.js", "_validateValue", 1289);+_yuitest_coverline("build/dial/dial.js", 1290); var min = this.get("min"), max = this.get("max");- _yuitest_coverline("build/dial/dial.js", 1285);+ _yuitest_coverline("build/dial/dial.js", 1292); return (Lang.isNumber(val) && val >= min && val <= max); } });- _yuitest_coverline("build/dial/dial.js", 1288);+ _yuitest_coverline("build/dial/dial.js", 1295); Y.Dial = Dial; -}, '3.7.2', {"requires": ["widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl"], "lang": ["en", "es"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl"], "lang": ["en", "es"], "skinnable": true});
bundle/dial/dial-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,7 +9,7 @@ /** * Create a circular dial value range input visualized as a draggable handle on a * background element.- * + * * @module dial */ var supportsVML = false;@@ -154,7 +154,7 @@ return this._validateValue(val); } },- + /** * amount to increment/decrement the dial value * when the arrow up/down/left/right keys are pressed@@ -180,7 +180,7 @@ }, /**- * number of value increments in one 360 degree revolution + * number of value increments in one 360 degree revolution * of the handle around the dial * * @attribute stepsPerRevolution@@ -192,7 +192,7 @@ }, /**- * number of decimal places of accuracy in the value + * number of decimal places of accuracy in the value * * @attribute decimalPlaces * @type {Number}@@ -203,7 +203,7 @@ }, /**- * visible strings for the dial UI. This attribute is + * visible strings for the dial UI. This attribute is * defined by the base Widget class but has an empty value. The * Dial is simply providing a default value for the attribute. * Gets localized strings in the current language@@ -219,8 +219,8 @@ }, /**- * distance from the center of the dial to the - * center of the marker and handle, when at rest. + * distance from the center of the dial to the+ * center of the marker and handle, when at rest. * The value is a percent of the radius of the dial. * * @attribute handleDistance@@ -230,7 +230,7 @@ handleDistance:{ value:0.75 }- + }; /**@@ -244,8 +244,8 @@ function makeClassName(str) { return Y.ClassNameManager.getClassName(Dial.NAME, str); }- - /** array of static constants used to identify the classname applied to the Dial DOM objects ++ /** array of static constants used to identify the classname applied to the Dial DOM objects * * @property CSS_CLASSES * @type {Array}@@ -270,10 +270,10 @@ hidden : makeClassName("hidden"), dragging : Y.ClassNameManager.getClassName("dd-dragging") };- + /* Static constants used to define the markup templates used to create Dial DOM elements */- + /** * template that will contain the Dial's label. *@@ -325,7 +325,7 @@ * @protected */ Dial.HANDLE_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.handle + '" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">';- + }else{ // VML case Dial.RING_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.ring + ' ' + Dial.CSS_CLASSES.ringVml + '">'+ '<div class="' + Dial.CSS_CLASSES.northMark + '"></div>'+@@ -369,7 +369,7 @@ this._renderMarker(); this._renderCenterButton(); this._renderHandle();- + // object handles this.contentBox = this.get("contentBox"); @@ -385,7 +385,7 @@ this._timesWrapped = 0; this._angle = this._getAngleFromValue(this.get('value')); this._prevAng = this._angle;- + // init this._setTimesWrappedFromValue(this._originalValue); this._handleNode.set('aria-valuemin', this._minValue);@@ -417,27 +417,27 @@ 'borderRadius':this._centerButtonNodeRadius + 'px' }); },- + /** * Handles the mouseenter on the centerButton- * + * * @method _handleCenterButtonEnter * @protected */ _handleCenterButtonEnter : function(){- this._resetString.removeClass(Dial.CSS_CLASSES.hidden); - }, - + this._resetString.removeClass(Dial.CSS_CLASSES.hidden);+ },+ /** * Handles the mouseleave on the centerButton- * + * * @method _handleCenterButtonLeave * @protected */ _handleCenterButtonLeave : function(){- this._resetString.addClass(Dial.CSS_CLASSES.hidden); - }, - + this._resetString.addClass(Dial.CSS_CLASSES.hidden);+ },+ /** * Creates the Y.DD.Drag instance used for the handle movement and * binds Dial interaction to the configured value model.@@ -446,17 +446,19 @@ * @protected */ bindUI : function() {+ this.after("valueChange", this._afterValueChange); var boundingBox = this.get("boundingBox"), // Looking for a key event which will fire continously across browsers while the key is held down.- keyEvent = (!Y.UA.opera) ? "down:" : "press:", + keyEvent = (!Y.UA.opera) ? "down:" : "press:", // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home keyEventSpec = keyEvent + "38,40,33,34,35,36", // 37 , 39 = arrow left/right keyLeftRightSpec = keyEvent + "37,39", // 37 , 39 = arrow left/right + meta (command/apple key) for mac- keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta";+ keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta",+ Drag = Y.DD.Drag; Y.on("key", Y.bind(this._onDirectionKey, this), boundingBox, keyEventSpec); Y.on("key", Y.bind(this._onLeftRightKey, this), boundingBox, keyLeftRightSpec);@@ -465,14 +467,17 @@ Y.on('mouseenter', Y.bind(this._handleCenterButtonEnter, this), this._centerButtonNode); Y.on('mouseleave', Y.bind(this._handleCenterButtonLeave, this), this._centerButtonNode); // Needed to replace mousedown/up with gesturemovestart/end to make behavior on touch devices work the same.- Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441] - Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); - Y.on('gesturemovestart', Y.bind(this._handleHandleMousedown, this), this._handleNode);+ Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441]+ Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); - Y.on('gesturemovestart', Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766] ++ Y.on(Drag.START_EVENT, Y.bind(this._handleHandleMousedown, this), this._handleNode);+ Y.on(Drag.START_EVENT, Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766]++ //TODO: Can this be merged this into the drag:end event listener to avoid another registration? Y.on('gesturemoveend', Y.bind(this._handleRingMouseup, this), this._ringNode); - this._dd1 = new Y.DD.Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so + this._dd1 = new Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so node: this._handleNode, on : { 'drag:drag' : Y.bind(this._handleDrag, this),@@ -498,68 +503,68 @@ this._timesWrapped = Math.floor(val / this._stepsPerRevolution); } },- + /**- * gets the angle of the line from the center of the Dial to the center of the handle + * gets the angle of the line from the center of the Dial to the center of the handle * * @method _getAngleFromHandleCenter- * @param handleCenterX {number} + * @param handleCenterX {number} * @param handleCenterY {number} * @return ang {number} the angle * @protected */ _getAngleFromHandleCenter : function(handleCenterX, handleCenterY){- var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI); + var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI); ang = ((this._dialCenterX - handleCenterX) < 0) ? ang + 90 : ang + 90 + 180; // Compensate for neg angles from Math.atan return ang; },- + /**- * calculates the XY of the center of the dial relative to the ring node. + * calculates the XY of the center of the dial relative to the ring node. * This is needed for calculating the angle of the handle * * @method _calculateDialCenter * @protected */ _calculateDialCenter : function(){ // #2531111 value, and marker don't track handle when dial position changes on page (resize when inline)- this._dialCenterX = this._ringNode.get('offsetWidth') / 2; + this._dialCenterX = this._ringNode.get('offsetWidth') / 2; this._dialCenterY = this._ringNode.get('offsetHeight') / 2; },- + /** * Handles the mouseup on the ring- * + * * @method _handleRingMouseup * @protected */ _handleRingMouseup : function(){- this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] - }, - + this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]+ },+ /** * Handles the mouseup on the centerButton- * + * * @method _handleCenterButtonMouseup * @protected */ _handleCenterButtonMouseup : function(){- this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] - }, - + this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]+ },+ /** * Handles the mousedown on the handle- * + * * @method _handleHandleMousedown * @protected */ _handleHandleMousedown : function(){ this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]- // this is better done here instead of on _handleDragEnd - // because we should make the keyboard accessible after a click of the handle - }, - + // this is better done here instead of on _handleDragEnd+ // because we should make the keyboard accessible after a click of the handle+ },+ /**- * handles the user dragging the handle around the Dial, gets the angle, + * handles the user dragging the handle around the Dial, gets the angle, * checks for wrapping around top center. * Sets the new value of the Dial *@@ -573,7 +578,7 @@ ang, newValue; - // The event was emitted from drag:drag of handle. + // The event was emitted from drag:drag of handle. // The center of the handle is top left position of the handle node + radius of handle. // This is different than a mousedown on the ring. handleCenterX = (parseInt(this._handleNode.getStyle('left'),10) + this._handleNodeRadius);@@ -591,7 +596,7 @@ } } newValue = this._getValueFromAngle(ang); // This function needs the current _timesWrapped value. That's why it comes after the _timesWrapped code above- + // If you've gone past max more than one full revolution, we decrement the _timesWrapped value // This gives the effect of a ratchet mechanism. // It feels like you are never more than one revolution past max@@ -603,7 +608,7 @@ }else if(newValue < (this._minValue - this._stepsPerRevolution) ){ this._timesWrapped ++; }- this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress + this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress this._handleValuesBeyondMinMax(e, newValue); },@@ -616,119 +621,125 @@ * @private */ _handleMousedown : function(e){ // #2530306- var minAng = this._getAngleFromValue(this._minValue),- maxAng = this._getAngleFromValue(this._maxValue),- newValue, oppositeMidRangeAngle,- handleCenterX, handleCenterY, - ang; - // The event was emitted from mousedown on the ring node,- // so the center of the handle should be the XY of mousedown. - if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click- handleCenterX = (e.clientX - this._ringNode.getX());- handleCenterY = (e.clientY - this._ringNode.getY());- }else{- handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());- handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY());- }- ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);- - /* ///////////////////////////////////////////////////////////////////////////////////////////////////////- * The next sections of logic- * set this._timesWrapped in the different cases of value range- * and value range position, - * then the Dial value is set at the end of this method- */ ///////////////////////////////////////////////////////////////////////////////////////////////////////- - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////- if(this._maxValue - this._minValue > this._stepsPerRevolution){- // Case: range min-to-max is greater than stepsPerRevolution (one revolution) + if (this._ringNode.compareTo(e.target)) {+ var minAng = this._getAngleFromValue(this._minValue),+ maxAng = this._getAngleFromValue(this._maxValue),+ newValue, oppositeMidRangeAngle,+ handleCenterX, handleCenterY,+ ang; - // This checks the shortest way around the dial between the prevAng and this ang.- if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping- - // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped - if((this._timesWrapped > this._minTimesWrapped) && - (this._timesWrapped < this._maxTimesWrapped)- ){ - // this checks which direction, clock wise or CCW and incr or decr _timesWrapped- this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);- }- // special case of getting un-stuck from a min value case - // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry- // because prevAng is set to 0 or > 0- }else if(- (this._timesWrapped === this._minTimesWrapped) && - (ang - this._prevAng < 180)- ){ - this._timesWrapped ++;- } //it didn't cross a wrapping boundary - } /////////////////////////////////////////////////////////////////////////////////////////////////////////- else if(this._maxValue - this._minValue === this._stepsPerRevolution){ - // Case: range min-to-max === stepsPerRevolution (one revolution)- // This means min and max will be at same angle- // This does not mean they are at "north" - - if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)- // The only way it can be, is if min and max are not at north- this._timesWrapped = 1;++ // The event was emitted from mousedown on the ring node,+ // so the center of the handle should be the XY of mousedown.+ if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click+ handleCenterX = (e.clientX - this._ringNode.getX());+ handleCenterY = (e.clientY - this._ringNode.getY()); }else{- this._timesWrapped = 0;- }- - } //////////////////////////////////////////////////////////////////////////////////////////////////////////- else if(minAng > maxAng){ - // Case: range includes the wrap point (north) - // Because of "else if"...- // range is < stepsPerRevolution- - if( - (this._prevAng >= minAng) && // if prev angle was greater than angle of min and...- (ang <= (minAng + maxAng) / 2) // the angle of this click is less than - // the angle opposite the mid-range angle, then...- ){- this._timesWrapped ++; - }else if( - (this._prevAng <= maxAng) && - // if prev angle is < max angle and...- - (ang > (minAng + maxAng) / 2)- // the angle of this click is greater than,- // the angle opposite the mid-range angle and...- - ){ - this._timesWrapped --;+ handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());+ handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY()); }- - } ////////////////////////////////////////////////////////////////////////////////////////////////////- else{ - // "else" Case: min-to-max range doesn't include the wrap point- // Because of "else if"...- // range is still < stepsPerRevolution- - if ((ang < minAng) || (ang > maxAng)){ // angle is out of range- oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360; - // This is the bisection of the min-to-max range + 180. (opposite the bisection)+ ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY); - if(oppositeMidRangeAngle > 180){- newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');- }else{ //oppositeMidRangeAngle <= 180- newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');+ /* ///////////////////////////////////////////////////////////////////////////////////////////////////////+ * The next sections of logic+ * set this._timesWrapped in the different cases of value range+ * and value range position,+ * then the Dial value is set at the end of this method+ */ ///////////////////////////////////////////////////////////////////////////////////////////////////////+++ ////////////////////////////////////////////////////////////////////////////////////////////////////////////+ if(this._maxValue - this._minValue > this._stepsPerRevolution){++ // Case: range min-to-max is greater than stepsPerRevolution (one revolution)++ // This checks the shortest way around the dial between the prevAng and this ang.+ if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping++ // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped+ if((this._timesWrapped > this._minTimesWrapped) &&+ (this._timesWrapped < this._maxTimesWrapped)+ ){+ // this checks which direction, clock wise or CCW and incr or decr _timesWrapped+ this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);+ }+ // special case of getting un-stuck from a min value case+ // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry+ // because prevAng is set to 0 or > 0+ }else if(+ (this._timesWrapped === this._minTimesWrapped) &&+ (ang - this._prevAng < 180)+ ){+ this._timesWrapped ++;+ } //it didn't cross a wrapping boundary++ } /////////////////////////////////////////////////////////////////////////////////////////////////////////+ else if(this._maxValue - this._minValue === this._stepsPerRevolution){+ // Case: range min-to-max === stepsPerRevolution (one revolution)+ // This means min and max will be at same angle+ // This does not mean they are at "north"++ if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)+ // The only way it can be, is if min and max are not at north+ this._timesWrapped = 1;+ }else{+ this._timesWrapped = 0; }- this._prevAng = this._getAngleFromValue(newValue);- this.set('value', newValue);- this._setTimesWrappedFromValue(newValue);- return;++ } //////////////////////////////////////////////////////////////////////////////////////////////////////////+ else if(minAng > maxAng){+ // Case: range includes the wrap point (north)+ // Because of "else if"...+ // range is < stepsPerRevolution++ if(+ (this._prevAng >= minAng) && // if prev angle was greater than angle of min and...+ (ang <= (minAng + maxAng) / 2) // the angle of this click is less than+ // the angle opposite the mid-range angle, then...+ ){+ this._timesWrapped ++;+ }else if(+ (this._prevAng <= maxAng) &&+ // if prev angle is < max angle and...++ (ang > (minAng + maxAng) / 2)+ // the angle of this click is greater than,+ // the angle opposite the mid-range angle and...++ ){+ this._timesWrapped --;+ }++ } ////////////////////////////////////////////////////////////////////////////////////////////////////+ else{+ // "else" Case: min-to-max range doesn't include the wrap point+ // Because of "else if"...+ // range is still < stepsPerRevolution++ if ((ang < minAng) || (ang > maxAng)){ // angle is out of range+ oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360;+ // This is the bisection of the min-to-max range + 180. (opposite the bisection)++ if(oppositeMidRangeAngle > 180){+ newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');+ }else{ //oppositeMidRangeAngle <= 180+ newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');+ }+ this._prevAng = this._getAngleFromValue(newValue);+ this.set('value', newValue);+ this._setTimesWrappedFromValue(newValue);+ return;+ } }- }- - // Now that _timesWrapped is set value .......................................................................- newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value.- this._prevAng = ang; - this._handleValuesBeyondMinMax(e, newValue);+ // Now that _timesWrapped is set value .......................................................................+ newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value.+ this._prevAng = ang;++ this._handleValuesBeyondMinMax(e, newValue);+ } }, /**@@ -741,24 +752,20 @@ */ _handleValuesBeyondMinMax : function(e, newValue){ // #2530306 // If _getValueFromAngle() is passed 0, it increments the _timesWrapped value.- // handle hitting max and min and going beyond, stops at max or min + // handle hitting max and min and going beyond, stops at max or min if((newValue >= this._minValue) && (newValue <= this._maxValue)) { this.set('value', newValue); // [#2530206] transfer the mousedown event from the _ringNode to the _handleNode drag, so we can mousedown, then continue dragging if(e.currentTarget === this._ringNode){ // Delegate to DD's natural behavior this._dd1._handleMouseDownEvent(e);- } - }else if(newValue > this._maxValue){+ }+ } else if(newValue > this._maxValue){ this.set('value', this._maxValue);- if(e.type === 'gesturemovestart'){- this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag- } - }else if(newValue < this._minValue){+ this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag+ } else if(newValue < this._minValue){ this.set('value', this._minValue);- if(e.type === 'gesturemovestart'){- this._prevAng = this._getAngleFromValue(this._minValue);- } + this._prevAng = this._getAngleFromValue(this._minValue); } }, @@ -775,7 +782,7 @@ /* * When handle is handleDragEnd, this animates the return to the fixed dial- */ + */ /** * handles the end of a user dragging the handle, animates the handle returning to@@ -785,7 +792,7 @@ * @protected */ _handleDragEnd : function(){- var node = this._handleNode; + var node = this._handleNode; node.transition({ duration: 0.08, // seconds easing: 'ease-in',@@ -823,7 +830,7 @@ newY = Math.round(Math.sin(thisAngle * rad) * this._handleDistance), newX = Math.round(Math.cos(thisAngle * rad) * this._handleDistance), dia = obj.get('offsetWidth'); //Ticket #2529852- + newY = newY - (dia * 0.5); newX = newX - (dia * 0.5); if(typeArray){ // just need the style for css transform left and top to animate the handle drag:end@@ -841,7 +848,7 @@ */ syncUI : function() { // Make the marker and the resetString display so their placement and borderRadius can be calculated, then hide them again.- // We would have used visibility:hidden in the css of this class, + // We would have used visibility:hidden in the css of this class, // but IE8 VML never returns to visible after applying visibility:hidden then removing it. this._setSizes(); this._calculateDialCenter(); // #2531111 initialize center of dial@@ -853,7 +860,7 @@ /** * sets the sizes of ring, center-button, marker, handle, and VML ovals in pixels.- * Needed only because some IE versions + * Needed only because some IE versions * ignore CSS percent sizes/offsets. * so these must be set in pixels. * Normally these are set in % of the ring.@@ -875,8 +882,8 @@ setSize(this._handleNode, dia, this.get('handleDiameter')); setSize(this._markerNode, dia, this.get('markerDiameter')); setSize(this._centerButtonNode, dia, this.get('centerButtonDiameter'));- - // Set these (used for trig) this way instead of relative to dia, ++ // Set these (used for trig) this way instead of relative to dia, // in case they have borders, have images etc. this._ringNodeRadius = this._ringNode.get('offsetWidth') * 0.5; this._handleNodeRadius = this._handleNode.get('offsetWidth') * 0.5;@@ -887,7 +894,7 @@ offset = (this._ringNodeRadius - this._centerButtonNodeRadius); this._centerButtonNode.setStyle('left', offset + 'px'); this._centerButtonNode.setStyle('top', offset + 'px');- /* + /* Place the resetString This seems like it should be able to be done with CSS, But since there is also a VML oval in IE that is absolute positioned,@@ -933,7 +940,7 @@ }, /**- * renders the DOM object for the Dial's background marker which + * renders the DOM object for the Dial's background marker which * tracks the angle of the user dragging the handle * * @method _renderMarker@@ -947,7 +954,7 @@ } this._markerNode = marker; },- + /** * renders the DOM object for the Dial's center *@@ -971,7 +978,7 @@ * @method _renderHandle * @protected */- _renderHandle : function() { + _renderHandle : function() { var labelId = Dial.CSS_CLASSES.label + Y.guid(), //get this unique id once then use for handle and label for ARIA contentBox = this.get("contentBox"), handle = contentBox.one("." + Dial.CSS_CLASSES.handle);@@ -1025,7 +1032,7 @@ /** * sets the Dial's value in response to key events.- * Left and right keys are in a separate method + * Left and right keys are in a separate method * in case an implementation wants to increment values * but needs left and right arrow keys for other purposes. *@@ -1094,7 +1101,7 @@ break; } },- + /** * increments Dial value by a minor increment *@@ -1110,7 +1117,7 @@ // Removing the toFixed here, loses the feature of "snap-to" when for example, stepsPerRevolution is 10 and decimalPlaces is 0. this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * decrements Dial value by a minor increment *@@ -1122,7 +1129,7 @@ newVal = Math.max(newVal, this.get("min")); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * increments Dial value by a major increment *@@ -1134,7 +1141,7 @@ newVal = Math.min(newVal, this.get("max")); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * decrements Dial value by a major increment *@@ -1155,8 +1162,8 @@ */ _setToMax : function(){ this.set('value', this.get("max"));- }, - + },+ /** * sets Dial value to dial's min attr *@@ -1165,10 +1172,10 @@ */ _setToMin : function(){ this.set('value', this.get("min"));- }, - + },+ /**- * resets Dial value to the orignal initial value. + * resets Dial value to the orignal initial value. * * @method _resetDial * @protected@@ -1181,9 +1188,9 @@ this._resetString.addClass(Dial.CSS_CLASSES.hidden); //[#2530441] this._handleNode.focus(); },- + /**- * returns the handle angle associated with the current value of the Dial. + * returns the handle angle associated with the current value of the Dial. * Returns a number between 0 and 360. * * @method _getAngleFromValue@@ -1237,11 +1244,11 @@ * @protected */ _valueToDecimalPlaces : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min.- + }, /**- * Updates the UI display value of the Dial to reflect + * Updates the UI display value of the Dial to reflect * the value passed in. * Makes all other needed UI display changes *@@ -1294,4 +1301,4 @@ Y.Dial = Dial; -}, '3.7.2', {"requires": ["widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl"], "lang": ["en", "es"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl"], "lang": ["en", "es"], "skinnable": true});
bundle/dial/dial-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dial",function(e,t){function o(e){o.superclass.constructor.apply(this,arguments)}function u(t){return e.ClassNameManager.getClassName(o.NAME,t)}var n=!1;e.UA.ie&&e.UA.ie<9&&(n=!0);var r=e.Lang,i=e.Widget,s=e.Node;o.NAME="dial",o.ATTRS={min:{value:-220},max:{value:220},diameter:{value:100},handleDiameter:{value:.2},markerDiameter:{value:.1},centerButtonDiameter:{value:.5},value:{value:0,validator:function(e){return this._validateValue(e)}},minorStep:{value:1},majorStep:{value:10},stepsPerRevolution:{value:100},decimalPlaces:{value:0},strings:{valueFn:function(){return e.Intl.get("dial")}},handleDistance:{value:.75}},o.CSS_CLASSES={label:u("label"),labelString:u("label-string"),valueString:u("value-string"),northMark:u("north-mark"),ring:u("ring"),ringVml:u("ring-vml"),marker:u("marker"),markerVml:u("marker-vml"),markerMaxMin:u("marker-max-min"),centerButton:u("center-button"),centerButtonVml:u("center-button-vml"),resetString:u("reset-string"),handle:u("handle"),handleVml:u("handle-vml"),hidden:u("hidden"),dragging:e.ClassNameManager.getClassName("dd-dragging")},o.LABEL_TEMPLATE='<div class="'+o.CSS_CLASSES.label+'"><span id="" class="'+o.CSS_CLASSES.labelString+'">{label}</span><span class="'+o.CSS_CLASSES.valueString+'"></span></div>',n===!1?(o.RING_TEMPLATE='<div class="'+o.CSS_CLASSES.ring+'"><div class="'+o.CSS_CLASSES.northMark+'"></div></div>',o.MARKER_TEMPLATE='<div class="'+o.CSS_CLASSES.marker+" "+o.CSS_CLASSES.hidden+'"></div>',o.CENTER_BUTTON_TEMPLATE='<div class="'+o.CSS_CLASSES.centerButton+'"><div class="'+o.CSS_CLASSES.resetString+" "+o.CSS_CLASSES.hidden+'">{resetStr}</div></div>',o.HANDLE_TEMPLATE='<div class="'+o.CSS_CLASSES.handle+'" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">'):(o.RING_TEMPLATE='<div class="'+o.CSS_CLASSES.ring+" "+o.CSS_CLASSES.ringVml+'">'+'<div class="'+o.CSS_CLASSES.northMark+'"></div>'+'<v:oval strokecolor="#ceccc0" strokeweight="1px"><v:fill type=gradient color="#8B8A7F" color2="#EDEDEB" angle="45"/></v:oval>'+"</div>"+"",o.MARKER_TEMPLATE='<div class="'+o.CSS_CLASSES.markerVml+" "+o.CSS_CLASSES.hidden+'">'+'<v:oval stroked="false">'+'<v:fill opacity="20%" color="#000"/>'+"</v:oval>"+"</div>"+"",o.CENTER_BUTTON_TEMPLATE='<div class="'+o.CSS_CLASSES.centerButton+" "+o.CSS_CLASSES.centerButtonVml+'">'+'<v:oval strokecolor="#ceccc0" strokeweight="1px">'+'<v:fill type=gradient color="#C7C5B9" color2="#fefcf6" colors="35% #d9d7cb, 65% #fefcf6" angle="45"/>'+'<v:shadow on="True" color="#000" opacity="10%" offset="2px, 2px"/>'+"</v:oval>"+'<div class="'+o.CSS_CLASSES.resetString+" "+o.CSS_CLASSES.hidden+'">{resetStr}</div>'+"</div>"+"",o.HANDLE_TEMPLATE='<div class="'+o.CSS_CLASSES.handleVml+'" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">'+'<v:oval stroked="false">'+'<v:fill opacity="20%" color="#6C3A3A"/>'+"</v:oval>"+"</div>"+""),e.extend(o,i,{renderUI:function(){this._renderLabel(),this._renderRing(),this._renderMarker(),this._renderCenterButton(),this._renderHandle(),this.contentBox=this.get("contentBox"),this._originalValue=this.get("value"),this._minValue=this.get("min"),this._maxValue=this.get("max"),this._stepsPerRevolution=this.get("stepsPerRevolution"),this._minTimesWrapped=Math.floor(this._minValue/this._stepsPerRevolution-1),this._maxTimesWrapped=Math.floor(this._maxValue/this._stepsPerRevolution+1),this._timesWrapped=0,this._angle=this._getAngleFromValue(this.get("value")),this._prevAng=this._angle,this._setTimesWrappedFromValue(this._originalValue),this._handleNode.set("aria-valuemin",this._minValue),this._handleNode.set("aria-valuemax",this._maxValue)},_setBorderRadius:function(){this._ringNode.setStyles({WebkitBorderRadius:this._ringNodeRadius+"px",MozBorderRadius:this._ringNodeRadius+"px",borderRadius:this._ringNodeRadius+"px"}),this._handleNode.setStyles({WebkitBorderRadius:this._handleNodeRadius+"px",MozBorderRadius:this._handleNodeRadius+"px",borderRadius:this._handleNodeRadius+"px"}),this._markerNode.setStyles({WebkitBorderRadius:this._markerNodeRadius+"px",MozBorderRadius:this._markerNodeRadius+"px",borderRadius:this._markerNodeRadius+"px"}),this._centerButtonNode.setStyles({WebkitBorderRadius:this._centerButtonNodeRadius+"px",MozBorderRadius:this._centerButtonNodeRadius+"px",borderRadius:this._centerButtonNodeRadius+"px"})},_handleCenterButtonEnter:function(){this._resetString.removeClass(o.CSS_CLASSES.hidden)},_handleCenterButtonLeave:function(){this._resetString.addClass(o.CSS_CLASSES.hidden)},bindUI:function(){this.after("valueChange",this._afterValueChange);var t=this.get("boundingBox"),n=e.UA.opera?"press:":"down:",r=n+"38,40,33,34,35,36",i=n+"37,39",s=n+"37+meta,39+meta";e.on("key",e.bind(this._onDirectionKey,this),t,r),e.on("key",e.bind(this._onLeftRightKey,this),t,i),t.on("key",this._onLeftRightKeyMeta,s,this),e.on("mouseenter",e.bind(this._handleCenterButtonEnter,this),this._centerButtonNode),e.on("mouseleave",e.bind(this._handleCenterButtonLeave,this),this._centerButtonNode),e.on("gesturemovestart",e.bind(this._resetDial,this),this._centerButtonNode),e.on("gesturemoveend",e.bind(this._handleCenterButtonMouseup,this),this._centerButtonNode),e.on("gesturemovestart",e.bind(this._handleHandleMousedown,this),this._handleNode),e.on("gesturemovestart",e.bind(this._handleMousedown,this),this._ringNode),e.on("gesturemoveend",e.bind(this._handleRingMouseup,this),this._ringNode),this._dd1=new e.DD.Drag({node:this._handleNode,on:{"drag:drag":e.bind(this._handleDrag,this),"drag:start":e.bind(this._handleDragStart,this),"drag:end":e.bind(this._handleDragEnd,this)}}),e.bind(this._dd1.addHandle(this._ringNode),this)},_setTimesWrappedFromValue:function(e){e%this._stepsPerRevolution===0?this._timesWrapped=e/this._stepsPerRevolution:this._timesWrapped=Math.floor(e/this._stepsPerRevolution)},_getAngleFromHandleCenter:function(e,t){var n=Math.atan((this._dialCenterY-t)/(this._dialCenterX-e))*(180/Math.PI);return n=this._dialCenterX-e<0?n+90:n+90+180,n},_calculateDialCenter:function(){this._dialCenterX=this._ringNode.get("offsetWidth")/2,this._dialCenterY=this._ringNode.get("offsetHeight")/2},_handleRingMouseup:function(){this._handleNode.focus()},_handleCenterButtonMouseup:function(){this._handleNode.focus()},_handleHandleMousedown:function(){this._handleNode.focus()},_handleDrag:function(e){var t,n,r,i;t=parseInt(this._handleNode.getStyle("left"),10)+this._handleNodeRadius,n=parseInt(this._handleNode.getStyle("top"),10)+this._handleNodeRadius,r=this._getAngleFromHandleCenter(t,n),this._prevAng>270&&r<90?this._timesWrapped<this._maxTimesWrapped&&(this._timesWrapped=this._timesWrapped+1):this._prevAng<90&&r>270&&this._timesWrapped>this._minTimesWrapped&&(this._timesWrapped=this._timesWrapped-1),i=this._getValueFromAngle(r),i>this._maxValue+this._stepsPerRevolution?this._timesWrapped--:i<this._minValue-this._stepsPerRevolution&&this._timesWrapped++,this._prevAng=r,this._handleValuesBeyondMinMax(e,i)},_handleMousedown:function(t){var n=this._getAngleFromValue(this._minValue),r=this._getAngleFromValue(this._maxValue),i,s,o,u,a;e.UA.ios?(o=t.clientX-this._ringNode.getX(),u=t.clientY-this._ringNode.getY()):(o=t.clientX+e.one("document").get("scrollLeft")-this._ringNode.getX(),u=t.clientY+e.one("document").get("scrollTop")-this._ringNode.getY()),a=this._getAngleFromHandleCenter(o,u);if(this._maxValue-this._minValue>this._stepsPerRevolution)Math.abs(this._prevAng-a)>180?this._timesWrapped>this._minTimesWrapped&&this._timesWrapped<this._maxTimesWrapped&&(this._timesWrapped=this._prevAng-a>0?this._timesWrapped+1:this._timesWrapped-1):this._timesWrapped===this._minTimesWrapped&&a-this._prevAng<180&&this._timesWrapped++;else if(this._maxValue-this._minValue===this._stepsPerRevolution)a<n?this._timesWrapped=1:this._timesWrapped=0;else if(n>r)this._prevAng>=n&&a<=(n+r)/2?this._timesWrapped++:this._prevAng<=r&&a>(n+r)/2&&this._timesWrapped--;else if(a<n||a>r){s=((n+r)/2+180)%360,s>180?i=r<a&&a<s?this.get("max"):this.get("min"):i=n>a&&a>s?this.get("min"):this.get("max"),this._prevAng=this._getAngleFromValue(i),this.set("value",i),this._setTimesWrappedFromValue(i);return}i=this._getValueFromAngle(a),this._prevAng=a,this._handleValuesBeyondMinMax(t,i)},_handleValuesBeyondMinMax:function(e,t){t>=this._minValue&&t<=this._maxValue?(this.set("value",t),e.currentTarget===this._ringNode&&this._dd1._handleMouseDownEvent(e)):t>this._maxValue?(this.set("value",this._maxValue),e.type==="gesturemovestart"&&(this._prevAng=this._getAngleFromValue(this._maxValue))):t<this._minValue&&(this.set("value",this._minValue),e.type==="gesturemovestart"&&(this._prevAng=this._getAngleFromValue(this._minValue)))},_handleDragStart:function(e){this._markerNode.removeClass(o.CSS_CLASSES.hidden)},_handleDragEnd:function(){var t=this._handleNode;t.transition({duration:.08,easing:"ease-in",left:this._setNodeToFixedRadius(this._handleNode,!0)[0]+"px",top:this._setNodeToFixedRadius(this._handleNode,!0)[1]+"px"},e.bind(function(){var e=this.get("value");e>this._minValue&&e<this._maxValue?this._markerNode.addClass(o.CSS_CLASSES.hidden):(this._setTimesWrappedFromValue(e),this._prevAng=this._getAngleFromValue(e))},this))},_setNodeToFixedRadius:function(e,t){var n=this._angle-90,r=Math.PI/180,i=Math.round(Math.sin(n*r)*this._handleDistance),s=Math.round(Math.cos(n*r)*this._handleDistance),o=e.get("offsetWidth");i-=o*.5,s-=o*.5;if(t)return[this._ringNodeRadius+s,this._ringNodeRadius+i];e.setStyle("left",this._ringNodeRadius+s+"px"),e.setStyle("top",this._ringNodeRadius+i+"px")},syncUI:function(){this._setSizes(),this._calculateDialCenter(),this._setBorderRadius(),this._uiSetValue(this.get("value")),this._markerNode.addClass(o.CSS_CLASSES.hidden),this._resetString.addClass(o.CSS_CLASSES.hidden)},_setSizes:function(){var e=this.get("diameter"),t,n,r,i=function(e,t,n){var r="px";e.getElementsByTagName("oval").setStyle("width",t*n+r),e.getElementsByTagName("oval").setStyle("height",t*n+r),e.setStyle("width",t*n+r),e.setStyle("height",t*n+r)};i(this._ringNode,e,1),i(this._handleNode,e,this.get("handleDiameter")),i(this._markerNode,e,this.get("markerDiameter")),i(this._centerButtonNode,e,this.get("centerButtonDiameter")),this._ringNodeRadius=this._ringNode.get("offsetWidth")*.5,this._handleNodeRadius=this._handleNode.get("offsetWidth")*.5,this._markerNodeRadius=this._markerNode.get("offsetWidth")*.5,this._centerButtonNodeRadius=this._centerButtonNode.get("offsetWidth")*.5,this._handleDistance=this._ringNodeRadius*this.get("handleDistance"),t=this._ringNodeRadius-this._centerButtonNodeRadius,this._centerButtonNode.setStyle("left",t+"px"),this._centerButtonNode.setStyle("top",t+"px"),n=this._centerButtonNodeRadius-this._resetString.get("offsetWidth")*.5,r=this._centerButtonNodeRadius-this._resetString.get("offsetHeight")*.5,this._resetString.setStyles({left:n+"px",top:r+"px"})},_renderLabel:function(){var t=this.get("contentBox"),n=t.one("."+o.CSS_CLASSES.label);n||(n=s.create(e.Lang.sub(o.LABEL_TEMPLATE,this.get("strings"))),t.append(n)),this._labelNode=n,this._valueStringNode=this._labelNode.one("."+o.CSS_CLASSES.valueString)},_renderRing:function(){var e=this.get("contentBox"),t=e.one("."+o.CSS_CLASSES.ring);t||(t=e.appendChild(o.RING_TEMPLATE),t.setStyles({width:this.get("diameter")+"px",height:this.get("diameter")+"px"})),this._ringNode=t},_renderMarker:function(){var e=this.get("contentBox"),t=e.one("."+o.CSS_CLASSES.marker);t||(t=e.one("."+o.CSS_CLASSES.ring).appendChild(o.MARKER_TEMPLATE)),this._markerNode=t},_renderCenterButton:function(){var t=this.get("contentBox"),n=t.one("."+o.CSS_CLASSES.centerButton);n||(n=s.create(e.Lang.sub(o.CENTER_BUTTON_TEMPLATE,this.get("strings"))),t.one("."+o.CSS_CLASSES.ring).append(n)),this._centerButtonNode=n,this._resetString=this._centerButtonNode.one("."+o.CSS_CLASSES.resetString)},_renderHandle:function(){var t=o.CSS_CLASSES.label+e.guid(),n=this.get("contentBox"),r=n.one("."+o.CSS_CLASSES.handle);r||(r=s.create(e.Lang.sub(o.HANDLE_TEMPLATE,this.get("strings"))),r.setAttribute("aria-labelledby",t),this._labelNode.one("."+o.CSS_CLASSES.labelString).setAttribute("id",t),n.one("."+o.CSS_CLASSES.ring).append(r)),this._handleNode=r},_setLabelString:function(e){this.get("contentBox").one("."+o.CSS_CLASSES.labelString).setHTML(e)},_setResetString:function(e){this.get("contentBox").one("."+o.CSS_CLASSES.resetString).setHTML(e)},_setTooltipString:function(e){this._handleNode.set("title",e)},_onDirectionKey:function(e){e.preventDefault();switch(e.charCode){case 38:this._incrMinor();break;case 40:this._decrMinor();break;case 36:this._setToMin();break;case 35:this._setToMax();break;case 33:this._incrMajor();break;case 34:this._decrMajor()}},_onLeftRightKey:function(e){e.preventDefault();switch(e.charCode){case 37:this._decrMinor();break;case 39:this._incrMinor()}},_onLeftRightKeyMeta:function(e){e.preventDefault();switch(e.charCode){case 37:this._setToMin();break;case 39:this._setToMax()}},_incrMinor:function(){var e=this.get("value")+this.get("minorStep");e=Math.min(e,this.get("max")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_decrMinor:function(){var e=this.get("value")-this.get("minorStep");e=Math.max(e,this.get("min")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_incrMajor:function(){var e=this.get("value")+this.get("majorStep");e=Math.min(e,this.get("max")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_decrMajor:function(){var e=this.get("value")-this.get("majorStep");e=Math.max(e,this.get("min")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_setToMax:function(){this.set("value",this.get("max"))},_setToMin:function(){this.set("value",this.get("min"))},_resetDial:function(e){e&&e.stopPropagation(),this.set("value",this._originalValue),this._resetString.addClass(o.CSS_CLASSES.hidden),this._handleNode.focus()},_getAngleFromValue:function(e){var t=e%this._stepsPerRevolution,n=t/this._stepsPerRevolution*360;return n<0?n+360:n},_getValueFromAngle:function(e){e<0?e=360+e:e===0&&(e=360);var t=e/360*this._stepsPerRevolution;return t+=this._timesWrapped*this._stepsPerRevolution,t.toFixed(this.get("decimalPlaces"))-0},_afterValueChange:function(e){this._uiSetValue(e.newVal)},_valueToDecimalPlaces:function(e){},_uiSetValue:function(e){this._angle=this._getAngleFromValue(e),this._handleNode.hasClass(o.CSS_CLASSES.dragging)===!1&&(this._setTimesWrappedFromValue(e),this._setNodeToFixedRadius(this._handleNode,!1),this._prevAng=this._getAngleFromValue(this.get("value"))),this._valueStringNode.setHTML(e.toFixed(this.get("decimalPlaces"))),this._handleNode.set("aria-valuenow",e),this._handleNode.set("aria-valuetext",e),this._setNodeToFixedRadius(this._markerNode,!1),e===this._maxValue||e===this._minValue?(this._markerNode.addClass(o.CSS_CLASSES.markerMaxMin),n===!0&&this._markerNode.getElementsByTagName("fill").set("color","#AB3232"),this._markerNode.removeClass(o.CSS_CLASSES.hidden)):(n===!0&&this._markerNode.getElementsByTagName("fill").set("color","#000"),this._markerNode.removeClass(o.CSS_CLASSES.markerMaxMin),this._handleNode.hasClass(o.CSS_CLASSES.dragging)===!1&&this._markerNode.addClass(o.CSS_CLASSES.hidden))},_validateValue:function(e){var t=this.get("min"),n=this.get("max");return r.isNumber(e)&&e>=t&&e<=n}}),e.Dial=o},"3.7.2",{requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],lang:["en","es"],skinnable:!0});+YUI.add("dial",function(e,t){function o(e){o.superclass.constructor.apply(this,arguments)}function u(t){return e.ClassNameManager.getClassName(o.NAME,t)}var n=!1;e.UA.ie&&e.UA.ie<9&&(n=!0);var r=e.Lang,i=e.Widget,s=e.Node;o.NAME="dial",o.ATTRS={min:{value:-220},max:{value:220},diameter:{value:100},handleDiameter:{value:.2},markerDiameter:{value:.1},centerButtonDiameter:{value:.5},value:{value:0,validator:function(e){return this._validateValue(e)}},minorStep:{value:1},majorStep:{value:10},stepsPerRevolution:{value:100},decimalPlaces:{value:0},strings:{valueFn:function(){return e.Intl.get("dial")}},handleDistance:{value:.75}},o.CSS_CLASSES={label:u("label"),labelString:u("label-string"),valueString:u("value-string"),northMark:u("north-mark"),ring:u("ring"),ringVml:u("ring-vml"),marker:u("marker"),markerVml:u("marker-vml"),markerMaxMin:u("marker-max-min"),centerButton:u("center-button"),centerButtonVml:u("center-button-vml"),resetString:u("reset-string"),handle:u("handle"),handleVml:u("handle-vml"),hidden:u("hidden"),dragging:e.ClassNameManager.getClassName("dd-dragging")},o.LABEL_TEMPLATE='<div class="'+o.CSS_CLASSES.label+'"><span id="" class="'+o.CSS_CLASSES.labelString+'">{label}</span><span class="'+o.CSS_CLASSES.valueString+'"></span></div>',n===!1?(o.RING_TEMPLATE='<div class="'+o.CSS_CLASSES.ring+'"><div class="'+o.CSS_CLASSES.northMark+'"></div></div>',o.MARKER_TEMPLATE='<div class="'+o.CSS_CLASSES.marker+" "+o.CSS_CLASSES.hidden+'"></div>',o.CENTER_BUTTON_TEMPLATE='<div class="'+o.CSS_CLASSES.centerButton+'"><div class="'+o.CSS_CLASSES.resetString+" "+o.CSS_CLASSES.hidden+'">{resetStr}</div></div>',o.HANDLE_TEMPLATE='<div class="'+o.CSS_CLASSES.handle+'" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">'):(o.RING_TEMPLATE='<div class="'+o.CSS_CLASSES.ring+" "+o.CSS_CLASSES.ringVml+'">'+'<div class="'+o.CSS_CLASSES.northMark+'"></div>'+'<v:oval strokecolor="#ceccc0" strokeweight="1px"><v:fill type=gradient color="#8B8A7F" color2="#EDEDEB" angle="45"/></v:oval>'+"</div>"+"",o.MARKER_TEMPLATE='<div class="'+o.CSS_CLASSES.markerVml+" "+o.CSS_CLASSES.hidden+'">'+'<v:oval stroked="false">'+'<v:fill opacity="20%" color="#000"/>'+"</v:oval>"+"</div>"+"",o.CENTER_BUTTON_TEMPLATE='<div class="'+o.CSS_CLASSES.centerButton+" "+o.CSS_CLASSES.centerButtonVml+'">'+'<v:oval strokecolor="#ceccc0" strokeweight="1px">'+'<v:fill type=gradient color="#C7C5B9" color2="#fefcf6" colors="35% #d9d7cb, 65% #fefcf6" angle="45"/>'+'<v:shadow on="True" color="#000" opacity="10%" offset="2px, 2px"/>'+"</v:oval>"+'<div class="'+o.CSS_CLASSES.resetString+" "+o.CSS_CLASSES.hidden+'">{resetStr}</div>'+"</div>"+"",o.HANDLE_TEMPLATE='<div class="'+o.CSS_CLASSES.handleVml+'" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">'+'<v:oval stroked="false">'+'<v:fill opacity="20%" color="#6C3A3A"/>'+"</v:oval>"+"</div>"+""),e.extend(o,i,{renderUI:function(){this._renderLabel(),this._renderRing(),this._renderMarker(),this._renderCenterButton(),this._renderHandle(),this.contentBox=this.get("contentBox"),this._originalValue=this.get("value"),this._minValue=this.get("min"),this._maxValue=this.get("max"),this._stepsPerRevolution=this.get("stepsPerRevolution"),this._minTimesWrapped=Math.floor(this._minValue/this._stepsPerRevolution-1),this._maxTimesWrapped=Math.floor(this._maxValue/this._stepsPerRevolution+1),this._timesWrapped=0,this._angle=this._getAngleFromValue(this.get("value")),this._prevAng=this._angle,this._setTimesWrappedFromValue(this._originalValue),this._handleNode.set("aria-valuemin",this._minValue),this._handleNode.set("aria-valuemax",this._maxValue)},_setBorderRadius:function(){this._ringNode.setStyles({WebkitBorderRadius:this._ringNodeRadius+"px",MozBorderRadius:this._ringNodeRadius+"px",borderRadius:this._ringNodeRadius+"px"}),this._handleNode.setStyles({WebkitBorderRadius:this._handleNodeRadius+"px",MozBorderRadius:this._handleNodeRadius+"px",borderRadius:this._handleNodeRadius+"px"}),this._markerNode.setStyles({WebkitBorderRadius:this._markerNodeRadius+"px",MozBorderRadius:this._markerNodeRadius+"px",borderRadius:this._markerNodeRadius+"px"}),this._centerButtonNode.setStyles({WebkitBorderRadius:this._centerButtonNodeRadius+"px",MozBorderRadius:this._centerButtonNodeRadius+"px",borderRadius:this._centerButtonNodeRadius+"px"})},_handleCenterButtonEnter:function(){this._resetString.removeClass(o.CSS_CLASSES.hidden)},_handleCenterButtonLeave:function(){this._resetString.addClass(o.CSS_CLASSES.hidden)},bindUI:function(){this.after("valueChange",this._afterValueChange);var t=this.get("boundingBox"),n=e.UA.opera?"press:":"down:",r=n+"38,40,33,34,35,36",i=n+"37,39",s=n+"37+meta,39+meta",o=e.DD.Drag;e.on("key",e.bind(this._onDirectionKey,this),t,r),e.on("key",e.bind(this._onLeftRightKey,this),t,i),t.on("key",this._onLeftRightKeyMeta,s,this),e.on("mouseenter",e.bind(this._handleCenterButtonEnter,this),this._centerButtonNode),e.on("mouseleave",e.bind(this._handleCenterButtonLeave,this),this._centerButtonNode),e.on("gesturemovestart",e.bind(this._resetDial,this),this._centerButtonNode),e.on("gesturemoveend",e.bind(this._handleCenterButtonMouseup,this),this._centerButtonNode),e.on(o.START_EVENT,e.bind(this._handleHandleMousedown,this),this._handleNode),e.on(o.START_EVENT,e.bind(this._handleMousedown,this),this._ringNode),e.on("gesturemoveend",e.bind(this._handleRingMouseup,this),this._ringNode),this._dd1=new o({node:this._handleNode,on:{"drag:drag":e.bind(this._handleDrag,this),"drag:start":e.bind(this._handleDragStart,this),"drag:end":e.bind(this._handleDragEnd,this)}}),e.bind(this._dd1.addHandle(this._ringNode),this)},_setTimesWrappedFromValue:function(e){e%this._stepsPerRevolution===0?this._timesWrapped=e/this._stepsPerRevolution:this._timesWrapped=Math.floor(e/this._stepsPerRevolution)},_getAngleFromHandleCenter:function(e,t){var n=Math.atan((this._dialCenterY-t)/(this._dialCenterX-e))*(180/Math.PI);return n=this._dialCenterX-e<0?n+90:n+90+180,n},_calculateDialCenter:function(){this._dialCenterX=this._ringNode.get("offsetWidth")/2,this._dialCenterY=this._ringNode.get("offsetHeight")/2},_handleRingMouseup:function(){this._handleNode.focus()},_handleCenterButtonMouseup:function(){this._handleNode.focus()},_handleHandleMousedown:function(){this._handleNode.focus()},_handleDrag:function(e){var t,n,r,i;t=parseInt(this._handleNode.getStyle("left"),10)+this._handleNodeRadius,n=parseInt(this._handleNode.getStyle("top"),10)+this._handleNodeRadius,r=this._getAngleFromHandleCenter(t,n),this._prevAng>270&&r<90?this._timesWrapped<this._maxTimesWrapped&&(this._timesWrapped=this._timesWrapped+1):this._prevAng<90&&r>270&&this._timesWrapped>this._minTimesWrapped&&(this._timesWrapped=this._timesWrapped-1),i=this._getValueFromAngle(r),i>this._maxValue+this._stepsPerRevolution?this._timesWrapped--:i<this._minValue-this._stepsPerRevolution&&this._timesWrapped++,this._prevAng=r,this._handleValuesBeyondMinMax(e,i)},_handleMousedown:function(t){if(this._ringNode.compareTo(t.target)){var n=this._getAngleFromValue(this._minValue),r=this._getAngleFromValue(this._maxValue),i,s,o,u,a;e.UA.ios?(o=t.clientX-this._ringNode.getX(),u=t.clientY-this._ringNode.getY()):(o=t.clientX+e.one("document").get("scrollLeft")-this._ringNode.getX(),u=t.clientY+e.one("document").get("scrollTop")-this._ringNode.getY()),a=this._getAngleFromHandleCenter(o,u);if(this._maxValue-this._minValue>this._stepsPerRevolution)Math.abs(this._prevAng-a)>180?this._timesWrapped>this._minTimesWrapped&&this._timesWrapped<this._maxTimesWrapped&&(this._timesWrapped=this._prevAng-a>0?this._timesWrapped+1:this._timesWrapped-1):this._timesWrapped===this._minTimesWrapped&&a-this._prevAng<180&&this._timesWrapped++;else if(this._maxValue-this._minValue===this._stepsPerRevolution)a<n?this._timesWrapped=1:this._timesWrapped=0;else if(n>r)this._prevAng>=n&&a<=(n+r)/2?this._timesWrapped++:this._prevAng<=r&&a>(n+r)/2&&this._timesWrapped--;else if(a<n||a>r){s=((n+r)/2+180)%360,s>180?i=r<a&&a<s?this.get("max"):this.get("min"):i=n>a&&a>s?this.get("min"):this.get("max"),this._prevAng=this._getAngleFromValue(i),this.set("value",i),this._setTimesWrappedFromValue(i);return}i=this._getValueFromAngle(a),this._prevAng=a,this._handleValuesBeyondMinMax(t,i)}},_handleValuesBeyondMinMax:function(e,t){t>=this._minValue&&t<=this._maxValue?(this.set("value",t),e.currentTarget===this._ringNode&&this._dd1._handleMouseDownEvent(e)):t>this._maxValue?(this.set("value",this._maxValue),this._prevAng=this._getAngleFromValue(this._maxValue)):t<this._minValue&&(this.set("value",this._minValue),this._prevAng=this._getAngleFromValue(this._minValue))},_handleDragStart:function(e){this._markerNode.removeClass(o.CSS_CLASSES.hidden)},_handleDragEnd:function(){var t=this._handleNode;t.transition({duration:.08,easing:"ease-in",left:this._setNodeToFixedRadius(this._handleNode,!0)[0]+"px",top:this._setNodeToFixedRadius(this._handleNode,!0)[1]+"px"},e.bind(function(){var e=this.get("value");e>this._minValue&&e<this._maxValue?this._markerNode.addClass(o.CSS_CLASSES.hidden):(this._setTimesWrappedFromValue(e),this._prevAng=this._getAngleFromValue(e))},this))},_setNodeToFixedRadius:function(e,t){var n=this._angle-90,r=Math.PI/180,i=Math.round(Math.sin(n*r)*this._handleDistance),s=Math.round(Math.cos(n*r)*this._handleDistance),o=e.get("offsetWidth");i-=o*.5,s-=o*.5;if(t)return[this._ringNodeRadius+s,this._ringNodeRadius+i];e.setStyle("left",this._ringNodeRadius+s+"px"),e.setStyle("top",this._ringNodeRadius+i+"px")},syncUI:function(){this._setSizes(),this._calculateDialCenter(),this._setBorderRadius(),this._uiSetValue(this.get("value")),this._markerNode.addClass(o.CSS_CLASSES.hidden),this._resetString.addClass(o.CSS_CLASSES.hidden)},_setSizes:function(){var e=this.get("diameter"),t,n,r,i=function(e,t,n){var r="px";e.getElementsByTagName("oval").setStyle("width",t*n+r),e.getElementsByTagName("oval").setStyle("height",t*n+r),e.setStyle("width",t*n+r),e.setStyle("height",t*n+r)};i(this._ringNode,e,1),i(this._handleNode,e,this.get("handleDiameter")),i(this._markerNode,e,this.get("markerDiameter")),i(this._centerButtonNode,e,this.get("centerButtonDiameter")),this._ringNodeRadius=this._ringNode.get("offsetWidth")*.5,this._handleNodeRadius=this._handleNode.get("offsetWidth")*.5,this._markerNodeRadius=this._markerNode.get("offsetWidth")*.5,this._centerButtonNodeRadius=this._centerButtonNode.get("offsetWidth")*.5,this._handleDistance=this._ringNodeRadius*this.get("handleDistance"),t=this._ringNodeRadius-this._centerButtonNodeRadius,this._centerButtonNode.setStyle("left",t+"px"),this._centerButtonNode.setStyle("top",t+"px"),n=this._centerButtonNodeRadius-this._resetString.get("offsetWidth")*.5,r=this._centerButtonNodeRadius-this._resetString.get("offsetHeight")*.5,this._resetString.setStyles({left:n+"px",top:r+"px"})},_renderLabel:function(){var t=this.get("contentBox"),n=t.one("."+o.CSS_CLASSES.label);n||(n=s.create(e.Lang.sub(o.LABEL_TEMPLATE,this.get("strings"))),t.append(n)),this._labelNode=n,this._valueStringNode=this._labelNode.one("."+o.CSS_CLASSES.valueString)},_renderRing:function(){var e=this.get("contentBox"),t=e.one("."+o.CSS_CLASSES.ring);t||(t=e.appendChild(o.RING_TEMPLATE),t.setStyles({width:this.get("diameter")+"px",height:this.get("diameter")+"px"})),this._ringNode=t},_renderMarker:function(){var e=this.get("contentBox"),t=e.one("."+o.CSS_CLASSES.marker);t||(t=e.one("."+o.CSS_CLASSES.ring).appendChild(o.MARKER_TEMPLATE)),this._markerNode=t},_renderCenterButton:function(){var t=this.get("contentBox"),n=t.one("."+o.CSS_CLASSES.centerButton);n||(n=s.create(e.Lang.sub(o.CENTER_BUTTON_TEMPLATE,this.get("strings"))),t.one("."+o.CSS_CLASSES.ring).append(n)),this._centerButtonNode=n,this._resetString=this._centerButtonNode.one("."+o.CSS_CLASSES.resetString)},_renderHandle:function(){var t=o.CSS_CLASSES.label+e.guid(),n=this.get("contentBox"),r=n.one("."+o.CSS_CLASSES.handle);r||(r=s.create(e.Lang.sub(o.HANDLE_TEMPLATE,this.get("strings"))),r.setAttribute("aria-labelledby",t),this._labelNode.one("."+o.CSS_CLASSES.labelString).setAttribute("id",t),n.one("."+o.CSS_CLASSES.ring).append(r)),this._handleNode=r},_setLabelString:function(e){this.get("contentBox").one("."+o.CSS_CLASSES.labelString).setHTML(e)},_setResetString:function(e){this.get("contentBox").one("."+o.CSS_CLASSES.resetString).setHTML(e)},_setTooltipString:function(e){this._handleNode.set("title",e)},_onDirectionKey:function(e){e.preventDefault();switch(e.charCode){case 38:this._incrMinor();break;case 40:this._decrMinor();break;case 36:this._setToMin();break;case 35:this._setToMax();break;case 33:this._incrMajor();break;case 34:this._decrMajor()}},_onLeftRightKey:function(e){e.preventDefault();switch(e.charCode){case 37:this._decrMinor();break;case 39:this._incrMinor()}},_onLeftRightKeyMeta:function(e){e.preventDefault();switch(e.charCode){case 37:this._setToMin();break;case 39:this._setToMax()}},_incrMinor:function(){var e=this.get("value")+this.get("minorStep");e=Math.min(e,this.get("max")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_decrMinor:function(){var e=this.get("value")-this.get("minorStep");e=Math.max(e,this.get("min")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_incrMajor:function(){var e=this.get("value")+this.get("majorStep");e=Math.min(e,this.get("max")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_decrMajor:function(){var e=this.get("value")-this.get("majorStep");e=Math.max(e,this.get("min")),this.set("value",e.toFixed(this.get("decimalPlaces"))-0)},_setToMax:function(){this.set("value",this.get("max"))},_setToMin:function(){this.set("value",this.get("min"))},_resetDial:function(e){e&&e.stopPropagation(),this.set("value",this._originalValue),this._resetString.addClass(o.CSS_CLASSES.hidden),this._handleNode.focus()},_getAngleFromValue:function(e){var t=e%this._stepsPerRevolution,n=t/this._stepsPerRevolution*360;return n<0?n+360:n},_getValueFromAngle:function(e){e<0?e=360+e:e===0&&(e=360);var t=e/360*this._stepsPerRevolution;return t+=this._timesWrapped*this._stepsPerRevolution,t.toFixed(this.get("decimalPlaces"))-0},_afterValueChange:function(e){this._uiSetValue(e.newVal)},_valueToDecimalPlaces:function(e){},_uiSetValue:function(e){this._angle=this._getAngleFromValue(e),this._handleNode.hasClass(o.CSS_CLASSES.dragging)===!1&&(this._setTimesWrappedFromValue(e),this._setNodeToFixedRadius(this._handleNode,!1),this._prevAng=this._getAngleFromValue(this.get("value"))),this._valueStringNode.setHTML(e.toFixed(this.get("decimalPlaces"))),this._handleNode.set("aria-valuenow",e),this._handleNode.set("aria-valuetext",e),this._setNodeToFixedRadius(this._markerNode,!1),e===this._maxValue||e===this._minValue?(this._markerNode.addClass(o.CSS_CLASSES.markerMaxMin),n===!0&&this._markerNode.getElementsByTagName("fill").set("color","#AB3232"),this._markerNode.removeClass(o.CSS_CLASSES.hidden)):(n===!0&&this._markerNode.getElementsByTagName("fill").set("color","#000"),this._markerNode.removeClass(o.CSS_CLASSES.markerMaxMin),this._handleNode.hasClass(o.CSS_CLASSES.dragging)===!1&&this._markerNode.addClass(o.CSS_CLASSES.hidden))},_validateValue:function(e){var t=this.get("min"),n=this.get("max");return r.isNumber(e)&&e>=t&&e<=n}}),e.Dial=o},"3.7.3",{requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],lang:["en","es"],skinnable:!0});
bundle/dial/dial.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,7 +9,7 @@ /** * Create a circular dial value range input visualized as a draggable handle on a * background element.- * + * * @module dial */ var supportsVML = false;@@ -154,7 +154,7 @@ return this._validateValue(val); } },- + /** * amount to increment/decrement the dial value * when the arrow up/down/left/right keys are pressed@@ -180,7 +180,7 @@ }, /**- * number of value increments in one 360 degree revolution + * number of value increments in one 360 degree revolution * of the handle around the dial * * @attribute stepsPerRevolution@@ -192,7 +192,7 @@ }, /**- * number of decimal places of accuracy in the value + * number of decimal places of accuracy in the value * * @attribute decimalPlaces * @type {Number}@@ -203,7 +203,7 @@ }, /**- * visible strings for the dial UI. This attribute is + * visible strings for the dial UI. This attribute is * defined by the base Widget class but has an empty value. The * Dial is simply providing a default value for the attribute. * Gets localized strings in the current language@@ -219,8 +219,8 @@ }, /**- * distance from the center of the dial to the - * center of the marker and handle, when at rest. + * distance from the center of the dial to the+ * center of the marker and handle, when at rest. * The value is a percent of the radius of the dial. * * @attribute handleDistance@@ -230,7 +230,7 @@ handleDistance:{ value:0.75 }- + }; /**@@ -244,8 +244,8 @@ function makeClassName(str) { return Y.ClassNameManager.getClassName(Dial.NAME, str); }- - /** array of static constants used to identify the classname applied to the Dial DOM objects ++ /** array of static constants used to identify the classname applied to the Dial DOM objects * * @property CSS_CLASSES * @type {Array}@@ -270,10 +270,10 @@ hidden : makeClassName("hidden"), dragging : Y.ClassNameManager.getClassName("dd-dragging") };- + /* Static constants used to define the markup templates used to create Dial DOM elements */- + /** * template that will contain the Dial's label. *@@ -325,7 +325,7 @@ * @protected */ Dial.HANDLE_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.handle + '" aria-labelledby="" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0" title="{tooltipHandle}">';- + }else{ // VML case Dial.RING_TEMPLATE = '<div class="' + Dial.CSS_CLASSES.ring + ' ' + Dial.CSS_CLASSES.ringVml + '">'+ '<div class="' + Dial.CSS_CLASSES.northMark + '"></div>'+@@ -369,7 +369,7 @@ this._renderMarker(); this._renderCenterButton(); this._renderHandle();- + // object handles this.contentBox = this.get("contentBox"); @@ -385,7 +385,7 @@ this._timesWrapped = 0; this._angle = this._getAngleFromValue(this.get('value')); this._prevAng = this._angle;- + // init this._setTimesWrappedFromValue(this._originalValue); this._handleNode.set('aria-valuemin', this._minValue);@@ -417,27 +417,27 @@ 'borderRadius':this._centerButtonNodeRadius + 'px' }); },- + /** * Handles the mouseenter on the centerButton- * + * * @method _handleCenterButtonEnter * @protected */ _handleCenterButtonEnter : function(){- this._resetString.removeClass(Dial.CSS_CLASSES.hidden); - }, - + this._resetString.removeClass(Dial.CSS_CLASSES.hidden);+ },+ /** * Handles the mouseleave on the centerButton- * + * * @method _handleCenterButtonLeave * @protected */ _handleCenterButtonLeave : function(){- this._resetString.addClass(Dial.CSS_CLASSES.hidden); - }, - + this._resetString.addClass(Dial.CSS_CLASSES.hidden);+ },+ /** * Creates the Y.DD.Drag instance used for the handle movement and * binds Dial interaction to the configured value model.@@ -446,17 +446,19 @@ * @protected */ bindUI : function() {+ this.after("valueChange", this._afterValueChange); var boundingBox = this.get("boundingBox"), // Looking for a key event which will fire continously across browsers while the key is held down.- keyEvent = (!Y.UA.opera) ? "down:" : "press:", + keyEvent = (!Y.UA.opera) ? "down:" : "press:", // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home keyEventSpec = keyEvent + "38,40,33,34,35,36", // 37 , 39 = arrow left/right keyLeftRightSpec = keyEvent + "37,39", // 37 , 39 = arrow left/right + meta (command/apple key) for mac- keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta";+ keyLeftRightSpecMeta = keyEvent + "37+meta,39+meta",+ Drag = Y.DD.Drag; Y.on("key", Y.bind(this._onDirectionKey, this), boundingBox, keyEventSpec); Y.on("key", Y.bind(this._onLeftRightKey, this), boundingBox, keyLeftRightSpec);@@ -465,14 +467,17 @@ Y.on('mouseenter', Y.bind(this._handleCenterButtonEnter, this), this._centerButtonNode); Y.on('mouseleave', Y.bind(this._handleCenterButtonLeave, this), this._centerButtonNode); // Needed to replace mousedown/up with gesturemovestart/end to make behavior on touch devices work the same.- Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441] - Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); - Y.on('gesturemovestart', Y.bind(this._handleHandleMousedown, this), this._handleNode);+ Y.on('gesturemovestart', Y.bind(this._resetDial, this), this._centerButtonNode); //[#2530441]+ Y.on('gesturemoveend', Y.bind(this._handleCenterButtonMouseup, this), this._centerButtonNode); - Y.on('gesturemovestart', Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766] ++ Y.on(Drag.START_EVENT, Y.bind(this._handleHandleMousedown, this), this._handleNode);+ Y.on(Drag.START_EVENT, Y.bind(this._handleMousedown, this), this._ringNode); // [#2530766]++ //TODO: Can this be merged this into the drag:end event listener to avoid another registration? Y.on('gesturemoveend', Y.bind(this._handleRingMouseup, this), this._ringNode); - this._dd1 = new Y.DD.Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so + this._dd1 = new Drag({ //// [#2530206] changed global this._dd1 from just var dd1 = new Y.DD.drag so node: this._handleNode, on : { 'drag:drag' : Y.bind(this._handleDrag, this),@@ -498,68 +503,68 @@ this._timesWrapped = Math.floor(val / this._stepsPerRevolution); } },- + /**- * gets the angle of the line from the center of the Dial to the center of the handle + * gets the angle of the line from the center of the Dial to the center of the handle * * @method _getAngleFromHandleCenter- * @param handleCenterX {number} + * @param handleCenterX {number} * @param handleCenterY {number} * @return ang {number} the angle * @protected */ _getAngleFromHandleCenter : function(handleCenterX, handleCenterY){- var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI); + var ang = Math.atan( (this._dialCenterY - handleCenterY) / (this._dialCenterX - handleCenterX) ) * (180 / Math.PI); ang = ((this._dialCenterX - handleCenterX) < 0) ? ang + 90 : ang + 90 + 180; // Compensate for neg angles from Math.atan return ang; },- + /**- * calculates the XY of the center of the dial relative to the ring node. + * calculates the XY of the center of the dial relative to the ring node. * This is needed for calculating the angle of the handle * * @method _calculateDialCenter * @protected */ _calculateDialCenter : function(){ // #2531111 value, and marker don't track handle when dial position changes on page (resize when inline)- this._dialCenterX = this._ringNode.get('offsetWidth') / 2; + this._dialCenterX = this._ringNode.get('offsetWidth') / 2; this._dialCenterY = this._ringNode.get('offsetHeight') / 2; },- + /** * Handles the mouseup on the ring- * + * * @method _handleRingMouseup * @protected */ _handleRingMouseup : function(){- this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] - }, - + this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]+ },+ /** * Handles the mouseup on the centerButton- * + * * @method _handleCenterButtonMouseup * @protected */ _handleCenterButtonMouseup : function(){- this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206] - }, - + this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]+ },+ /** * Handles the mousedown on the handle- * + * * @method _handleHandleMousedown * @protected */ _handleHandleMousedown : function(){ this._handleNode.focus(); // need to re-focus on the handle so keyboard is accessible [#2530206]- // this is better done here instead of on _handleDragEnd - // because we should make the keyboard accessible after a click of the handle - }, - + // this is better done here instead of on _handleDragEnd+ // because we should make the keyboard accessible after a click of the handle+ },+ /**- * handles the user dragging the handle around the Dial, gets the angle, + * handles the user dragging the handle around the Dial, gets the angle, * checks for wrapping around top center. * Sets the new value of the Dial *@@ -573,7 +578,7 @@ ang, newValue; - // The event was emitted from drag:drag of handle. + // The event was emitted from drag:drag of handle. // The center of the handle is top left position of the handle node + radius of handle. // This is different than a mousedown on the ring. handleCenterX = (parseInt(this._handleNode.getStyle('left'),10) + this._handleNodeRadius);@@ -591,7 +596,7 @@ } } newValue = this._getValueFromAngle(ang); // This function needs the current _timesWrapped value. That's why it comes after the _timesWrapped code above- + // If you've gone past max more than one full revolution, we decrement the _timesWrapped value // This gives the effect of a ratchet mechanism. // It feels like you are never more than one revolution past max@@ -603,7 +608,7 @@ }else if(newValue < (this._minValue - this._stepsPerRevolution) ){ this._timesWrapped ++; }- this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress + this._prevAng = ang; // need to keep the previous angle in order to check for wrapping on the next drag, click, or keypress this._handleValuesBeyondMinMax(e, newValue); },@@ -616,119 +621,125 @@ * @private */ _handleMousedown : function(e){ // #2530306- var minAng = this._getAngleFromValue(this._minValue),- maxAng = this._getAngleFromValue(this._maxValue),- newValue, oppositeMidRangeAngle,- handleCenterX, handleCenterY, - ang; - // The event was emitted from mousedown on the ring node,- // so the center of the handle should be the XY of mousedown. - if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click- handleCenterX = (e.clientX - this._ringNode.getX());- handleCenterY = (e.clientY - this._ringNode.getY());- }else{- handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());- handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY());- }- ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY);- - /* ///////////////////////////////////////////////////////////////////////////////////////////////////////- * The next sections of logic- * set this._timesWrapped in the different cases of value range- * and value range position, - * then the Dial value is set at the end of this method- */ ///////////////////////////////////////////////////////////////////////////////////////////////////////- - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////- if(this._maxValue - this._minValue > this._stepsPerRevolution){- // Case: range min-to-max is greater than stepsPerRevolution (one revolution) + if (this._ringNode.compareTo(e.target)) {+ var minAng = this._getAngleFromValue(this._minValue),+ maxAng = this._getAngleFromValue(this._maxValue),+ newValue, oppositeMidRangeAngle,+ handleCenterX, handleCenterY,+ ang; - // This checks the shortest way around the dial between the prevAng and this ang.- if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping- - // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped - if((this._timesWrapped > this._minTimesWrapped) && - (this._timesWrapped < this._maxTimesWrapped)- ){ - // this checks which direction, clock wise or CCW and incr or decr _timesWrapped- this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);- }- // special case of getting un-stuck from a min value case - // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry- // because prevAng is set to 0 or > 0- }else if(- (this._timesWrapped === this._minTimesWrapped) && - (ang - this._prevAng < 180)- ){ - this._timesWrapped ++;- } //it didn't cross a wrapping boundary - } /////////////////////////////////////////////////////////////////////////////////////////////////////////- else if(this._maxValue - this._minValue === this._stepsPerRevolution){ - // Case: range min-to-max === stepsPerRevolution (one revolution)- // This means min and max will be at same angle- // This does not mean they are at "north" - - if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)- // The only way it can be, is if min and max are not at north- this._timesWrapped = 1;++ // The event was emitted from mousedown on the ring node,+ // so the center of the handle should be the XY of mousedown.+ if(Y.UA.ios){ // ios adds the scrollLeft and top onto clientX and Y in a native click+ handleCenterX = (e.clientX - this._ringNode.getX());+ handleCenterY = (e.clientY - this._ringNode.getY()); }else{- this._timesWrapped = 0;- }- - } //////////////////////////////////////////////////////////////////////////////////////////////////////////- else if(minAng > maxAng){ - // Case: range includes the wrap point (north) - // Because of "else if"...- // range is < stepsPerRevolution- - if( - (this._prevAng >= minAng) && // if prev angle was greater than angle of min and...- (ang <= (minAng + maxAng) / 2) // the angle of this click is less than - // the angle opposite the mid-range angle, then...- ){- this._timesWrapped ++; - }else if( - (this._prevAng <= maxAng) && - // if prev angle is < max angle and...- - (ang > (minAng + maxAng) / 2)- // the angle of this click is greater than,- // the angle opposite the mid-range angle and...- - ){ - this._timesWrapped --;+ handleCenterX = (e.clientX + Y.one('document').get('scrollLeft') - this._ringNode.getX());+ handleCenterY = (e.clientY + Y.one('document').get('scrollTop') - this._ringNode.getY()); }- - } ////////////////////////////////////////////////////////////////////////////////////////////////////- else{ - // "else" Case: min-to-max range doesn't include the wrap point- // Because of "else if"...- // range is still < stepsPerRevolution- - if ((ang < minAng) || (ang > maxAng)){ // angle is out of range- oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360; - // This is the bisection of the min-to-max range + 180. (opposite the bisection)+ ang = this._getAngleFromHandleCenter(handleCenterX, handleCenterY); - if(oppositeMidRangeAngle > 180){- newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');- }else{ //oppositeMidRangeAngle <= 180- newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');+ /* ///////////////////////////////////////////////////////////////////////////////////////////////////////+ * The next sections of logic+ * set this._timesWrapped in the different cases of value range+ * and value range position,+ * then the Dial value is set at the end of this method+ */ ///////////////////////////////////////////////////////////////////////////////////////////////////////+++ ////////////////////////////////////////////////////////////////////////////////////////////////////////////+ if(this._maxValue - this._minValue > this._stepsPerRevolution){++ // Case: range min-to-max is greater than stepsPerRevolution (one revolution)++ // This checks the shortest way around the dial between the prevAng and this ang.+ if(Math.abs(this._prevAng - ang) > 180){ // this crossed a wrapping++ // Only change the _timesWrapped if it's between minTimesWrapped and maxTimesWrapped+ if((this._timesWrapped > this._minTimesWrapped) &&+ (this._timesWrapped < this._maxTimesWrapped)+ ){+ // this checks which direction, clock wise or CCW and incr or decr _timesWrapped+ this._timesWrapped = ((this._prevAng - ang) > 0) ? (this._timesWrapped + 1) : (this._timesWrapped - 1);+ }+ // special case of getting un-stuck from a min value case+ // where timesWrapped is minTimesWrapped but new ang won't trigger a cross wrap boundry+ // because prevAng is set to 0 or > 0+ }else if(+ (this._timesWrapped === this._minTimesWrapped) &&+ (ang - this._prevAng < 180)+ ){+ this._timesWrapped ++;+ } //it didn't cross a wrapping boundary++ } /////////////////////////////////////////////////////////////////////////////////////////////////////////+ else if(this._maxValue - this._minValue === this._stepsPerRevolution){+ // Case: range min-to-max === stepsPerRevolution (one revolution)+ // This means min and max will be at same angle+ // This does not mean they are at "north"++ if(ang < minAng){ // if mousedown angle is < minAng (and maxAng, because they're the same)+ // The only way it can be, is if min and max are not at north+ this._timesWrapped = 1;+ }else{+ this._timesWrapped = 0; }- this._prevAng = this._getAngleFromValue(newValue);- this.set('value', newValue);- this._setTimesWrappedFromValue(newValue);- return;++ } //////////////////////////////////////////////////////////////////////////////////////////////////////////+ else if(minAng > maxAng){+ // Case: range includes the wrap point (north)+ // Because of "else if"...+ // range is < stepsPerRevolution++ if(+ (this._prevAng >= minAng) && // if prev angle was greater than angle of min and...+ (ang <= (minAng + maxAng) / 2) // the angle of this click is less than+ // the angle opposite the mid-range angle, then...+ ){+ this._timesWrapped ++;+ }else if(+ (this._prevAng <= maxAng) &&+ // if prev angle is < max angle and...++ (ang > (minAng + maxAng) / 2)+ // the angle of this click is greater than,+ // the angle opposite the mid-range angle and...++ ){+ this._timesWrapped --;+ }++ } ////////////////////////////////////////////////////////////////////////////////////////////////////+ else{+ // "else" Case: min-to-max range doesn't include the wrap point+ // Because of "else if"...+ // range is still < stepsPerRevolution++ if ((ang < minAng) || (ang > maxAng)){ // angle is out of range+ oppositeMidRangeAngle = (((minAng + maxAng) / 2) + 180) % 360;+ // This is the bisection of the min-to-max range + 180. (opposite the bisection)++ if(oppositeMidRangeAngle > 180){+ newValue = ((maxAng < ang) && (ang < oppositeMidRangeAngle)) ? this.get('max') : this.get('min');+ }else{ //oppositeMidRangeAngle <= 180+ newValue = ((minAng > ang) && (ang > oppositeMidRangeAngle)) ? this.get('min') : this.get('max');+ }+ this._prevAng = this._getAngleFromValue(newValue);+ this.set('value', newValue);+ this._setTimesWrappedFromValue(newValue);+ return;+ } }- }- - // Now that _timesWrapped is set value .......................................................................- newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value.- this._prevAng = ang; - this._handleValuesBeyondMinMax(e, newValue);+ // Now that _timesWrapped is set value .......................................................................+ newValue = this._getValueFromAngle(ang); // This function needs the correct, current _timesWrapped value.+ this._prevAng = ang;++ this._handleValuesBeyondMinMax(e, newValue);+ } }, /**@@ -741,24 +752,20 @@ */ _handleValuesBeyondMinMax : function(e, newValue){ // #2530306 // If _getValueFromAngle() is passed 0, it increments the _timesWrapped value.- // handle hitting max and min and going beyond, stops at max or min + // handle hitting max and min and going beyond, stops at max or min if((newValue >= this._minValue) && (newValue <= this._maxValue)) { this.set('value', newValue); // [#2530206] transfer the mousedown event from the _ringNode to the _handleNode drag, so we can mousedown, then continue dragging if(e.currentTarget === this._ringNode){ // Delegate to DD's natural behavior this._dd1._handleMouseDownEvent(e);- } - }else if(newValue > this._maxValue){+ }+ } else if(newValue > this._maxValue){ this.set('value', this._maxValue);- if(e.type === 'gesturemovestart'){- this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag- } - }else if(newValue < this._minValue){+ this._prevAng = this._getAngleFromValue(this._maxValue); // #2530766 need for mousedown on the ring; causes prob for drag+ } else if(newValue < this._minValue){ this.set('value', this._minValue);- if(e.type === 'gesturemovestart'){- this._prevAng = this._getAngleFromValue(this._minValue);- } + this._prevAng = this._getAngleFromValue(this._minValue); } }, @@ -775,7 +782,7 @@ /* * When handle is handleDragEnd, this animates the return to the fixed dial- */ + */ /** * handles the end of a user dragging the handle, animates the handle returning to@@ -785,7 +792,7 @@ * @protected */ _handleDragEnd : function(){- var node = this._handleNode; + var node = this._handleNode; node.transition({ duration: 0.08, // seconds easing: 'ease-in',@@ -823,7 +830,7 @@ newY = Math.round(Math.sin(thisAngle * rad) * this._handleDistance), newX = Math.round(Math.cos(thisAngle * rad) * this._handleDistance), dia = obj.get('offsetWidth'); //Ticket #2529852- + newY = newY - (dia * 0.5); newX = newX - (dia * 0.5); if(typeArray){ // just need the style for css transform left and top to animate the handle drag:end@@ -841,7 +848,7 @@ */ syncUI : function() { // Make the marker and the resetString display so their placement and borderRadius can be calculated, then hide them again.- // We would have used visibility:hidden in the css of this class, + // We would have used visibility:hidden in the css of this class, // but IE8 VML never returns to visible after applying visibility:hidden then removing it. this._setSizes(); this._calculateDialCenter(); // #2531111 initialize center of dial@@ -853,7 +860,7 @@ /** * sets the sizes of ring, center-button, marker, handle, and VML ovals in pixels.- * Needed only because some IE versions + * Needed only because some IE versions * ignore CSS percent sizes/offsets. * so these must be set in pixels. * Normally these are set in % of the ring.@@ -875,8 +882,8 @@ setSize(this._handleNode, dia, this.get('handleDiameter')); setSize(this._markerNode, dia, this.get('markerDiameter')); setSize(this._centerButtonNode, dia, this.get('centerButtonDiameter'));- - // Set these (used for trig) this way instead of relative to dia, ++ // Set these (used for trig) this way instead of relative to dia, // in case they have borders, have images etc. this._ringNodeRadius = this._ringNode.get('offsetWidth') * 0.5; this._handleNodeRadius = this._handleNode.get('offsetWidth') * 0.5;@@ -887,7 +894,7 @@ offset = (this._ringNodeRadius - this._centerButtonNodeRadius); this._centerButtonNode.setStyle('left', offset + 'px'); this._centerButtonNode.setStyle('top', offset + 'px');- /* + /* Place the resetString This seems like it should be able to be done with CSS, But since there is also a VML oval in IE that is absolute positioned,@@ -933,7 +940,7 @@ }, /**- * renders the DOM object for the Dial's background marker which + * renders the DOM object for the Dial's background marker which * tracks the angle of the user dragging the handle * * @method _renderMarker@@ -947,7 +954,7 @@ } this._markerNode = marker; },- + /** * renders the DOM object for the Dial's center *@@ -971,7 +978,7 @@ * @method _renderHandle * @protected */- _renderHandle : function() { + _renderHandle : function() { var labelId = Dial.CSS_CLASSES.label + Y.guid(), //get this unique id once then use for handle and label for ARIA contentBox = this.get("contentBox"), handle = contentBox.one("." + Dial.CSS_CLASSES.handle);@@ -1025,7 +1032,7 @@ /** * sets the Dial's value in response to key events.- * Left and right keys are in a separate method + * Left and right keys are in a separate method * in case an implementation wants to increment values * but needs left and right arrow keys for other purposes. *@@ -1094,7 +1101,7 @@ break; } },- + /** * increments Dial value by a minor increment *@@ -1110,7 +1117,7 @@ // Removing the toFixed here, loses the feature of "snap-to" when for example, stepsPerRevolution is 10 and decimalPlaces is 0. this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * decrements Dial value by a minor increment *@@ -1122,7 +1129,7 @@ newVal = Math.max(newVal, this.get("min")); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * increments Dial value by a major increment *@@ -1134,7 +1141,7 @@ newVal = Math.min(newVal, this.get("max")); this.set('value', newVal.toFixed(this.get('decimalPlaces')) - 0); },- + /** * decrements Dial value by a major increment *@@ -1155,8 +1162,8 @@ */ _setToMax : function(){ this.set('value', this.get("max"));- }, - + },+ /** * sets Dial value to dial's min attr *@@ -1165,10 +1172,10 @@ */ _setToMin : function(){ this.set('value', this.get("min"));- }, - + },+ /**- * resets Dial value to the orignal initial value. + * resets Dial value to the orignal initial value. * * @method _resetDial * @protected@@ -1181,9 +1188,9 @@ this._resetString.addClass(Dial.CSS_CLASSES.hidden); //[#2530441] this._handleNode.focus(); },- + /**- * returns the handle angle associated with the current value of the Dial. + * returns the handle angle associated with the current value of the Dial. * Returns a number between 0 and 360. * * @method _getAngleFromValue@@ -1237,11 +1244,11 @@ * @protected */ _valueToDecimalPlaces : function(val) { // [#2530206] cleaned up and better user feedback of when it's max or min.- + }, /**- * Updates the UI display value of the Dial to reflect + * Updates the UI display value of the Dial to reflect * the value passed in. * Makes all other needed UI display changes *@@ -1294,4 +1301,4 @@ Y.Dial = Dial; -}, '3.7.2', {"requires": ["widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl"], "lang": ["en", "es"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "dd-drag", "event-mouseenter", "event-move", "event-key", "transition", "intl"], "lang": ["en", "es"], "skinnable": true});
bundle/dial/lang/dial.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/dial",function(e){e.Intl.add("dial","",{label:"My label",resetStr:"Reset",tooltipHandle:"Drag to set value"})},"3.7.2");+YUI.add("lang/dial",function(e){e.Intl.add("dial","",{label:"My label",resetStr:"Reset",tooltipHandle:"Drag to set value"})},"3.7.3");
bundle/dial/lang/dial_en.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/dial_en",function(e){e.Intl.add("dial","en",{label:"My label",resetStr:"Reset",tooltipHandle:"Drag to set value"})},"3.7.2");+YUI.add("lang/dial_en",function(e){e.Intl.add("dial","en",{label:"My label",resetStr:"Reset",tooltipHandle:"Drag to set value"})},"3.7.3");
bundle/dial/lang/dial_es.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lang/dial_es",function(e){e.Intl.add("dial","es",{label:"Mi etiqueta",resetStr:"Resetear",tooltipHandle:"Arrastre para ajustar el valor"})},"3.7.2");+YUI.add("lang/dial_es",function(e){e.Intl.add("dial","es",{label:"Mi etiqueta",resetStr:"Resetear",tooltipHandle:"Arrastre para ajustar el valor"})},"3.7.3");
bundle/dom-attrs/dom-attrs-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -211,4 +211,4 @@ }); -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-attrs/dom-attrs-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-attrs",function(h){var e=h.config.doc.documentElement,b=h.DOM,a="tagName",g="ownerDocument",c="",f=h.Features.add,d=h.Features.test;h.mix(b,{getText:(e.textContent!==undefined)?function(j){var i="";if(j){i=j.textContent;}return i||"";}:function(j){var i="";if(j){i=j.innerText||j.nodeValue;}return i||"";},setText:(e.textContent!==undefined)?function(i,j){if(i){i.textContent=j;}}:function(i,j){if("innerText" in i){i.innerText=j;}else{if("nodeValue" in i){i.nodeValue=j;}}},CUSTOM_ATTRIBUTES:(!e.hasAttribute)?{"for":"htmlFor","class":"className"}:{"htmlFor":"for","className":"class"},setAttribute:function(k,i,l,j){if(k&&i&&k.setAttribute){i=b.CUSTOM_ATTRIBUTES[i]||i;k.setAttribute(i,l,j);}},getAttribute:function(l,i,k){k=(k!==undefined)?k:2;var j="";if(l&&i&&l.getAttribute){i=b.CUSTOM_ATTRIBUTES[i]||i;j=l.getAttribute(i,k);if(j===null){j="";}}return j;},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(k){var j="",i;if(k&&k[a]){i=b.VALUE_GETTERS[k[a].toLowerCase()];if(i){j=i(k);}else{j=k.value;}}if(j===c){j=c;}return(typeof j==="string")?j:"";},setValue:function(i,j){var k;if(i&&i[a]){k=b.VALUE_SETTERS[i[a].toLowerCase()];if(k){k(i,j);}else{i.value=j;}}},creators:{}});f("value-set","select",{test:function(){var i=h.config.doc.createElement("select");i.innerHTML="<option>1</option><option>2</option>";i.value="2";return(i.value&&i.value==="2");}});if(!d("value-set","select")){b.VALUE_SETTERS.select=function(m,n){for(var k=0,j=m.getElementsByTagName("option"),l;l=j[k++];){if(b.getValue(l)===n){l.selected=true;break;}}};}h.mix(b.VALUE_GETTERS,{button:function(i){return(i.attributes&&i.attributes.value)?i.attributes.value.value:"";}});h.mix(b.VALUE_SETTERS,{button:function(j,k){var i=j.attributes.value;if(!i){i=j[g].createAttribute("value");j.setAttributeNode(i);}i.value=k;}});h.mix(b.VALUE_GETTERS,{option:function(j){var i=j.attributes;return(i.value&&i.value.specified)?j.value:j.text;},select:function(j){var k=j.value,i=j.options;if(i&&i.length){if(j.multiple){}else{k=b.getValue(i[j.selectedIndex]);}}return k;}});},"3.7.2",{requires:["dom-core"]});+YUI.add("dom-attrs",function(h){var e=h.config.doc.documentElement,b=h.DOM,a="tagName",g="ownerDocument",c="",f=h.Features.add,d=h.Features.test;h.mix(b,{getText:(e.textContent!==undefined)?function(j){var i="";if(j){i=j.textContent;}return i||"";}:function(j){var i="";if(j){i=j.innerText||j.nodeValue;}return i||"";},setText:(e.textContent!==undefined)?function(i,j){if(i){i.textContent=j;}}:function(i,j){if("innerText" in i){i.innerText=j;}else{if("nodeValue" in i){i.nodeValue=j;}}},CUSTOM_ATTRIBUTES:(!e.hasAttribute)?{"for":"htmlFor","class":"className"}:{"htmlFor":"for","className":"class"},setAttribute:function(k,i,l,j){if(k&&i&&k.setAttribute){i=b.CUSTOM_ATTRIBUTES[i]||i;k.setAttribute(i,l,j);}},getAttribute:function(l,i,k){k=(k!==undefined)?k:2;var j="";if(l&&i&&l.getAttribute){i=b.CUSTOM_ATTRIBUTES[i]||i;j=l.getAttribute(i,k);if(j===null){j="";}}return j;},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(k){var j="",i;if(k&&k[a]){i=b.VALUE_GETTERS[k[a].toLowerCase()];if(i){j=i(k);}else{j=k.value;}}if(j===c){j=c;}return(typeof j==="string")?j:"";},setValue:function(i,j){var k;if(i&&i[a]){k=b.VALUE_SETTERS[i[a].toLowerCase()];if(k){k(i,j);}else{i.value=j;}}},creators:{}});f("value-set","select",{test:function(){var i=h.config.doc.createElement("select");i.innerHTML="<option>1</option><option>2</option>";i.value="2";return(i.value&&i.value==="2");}});if(!d("value-set","select")){b.VALUE_SETTERS.select=function(m,n){for(var k=0,j=m.getElementsByTagName("option"),l;l=j[k++];){if(b.getValue(l)===n){l.selected=true;break;}}};}h.mix(b.VALUE_GETTERS,{button:function(i){return(i.attributes&&i.attributes.value)?i.attributes.value.value:"";}});h.mix(b.VALUE_SETTERS,{button:function(j,k){var i=j.attributes.value;if(!i){i=j[g].createAttribute("value");j.setAttributeNode(i);}i.value=k;}});h.mix(b.VALUE_GETTERS,{option:function(j){var i=j.attributes;return(i.value&&i.value.specified)?j.value:j.text;},select:function(j){var k=j.value,i=j.options;if(i&&i.length){if(j.multiple){}else{k=b.getValue(i[j.selectedIndex]);}}return k;}});},"3.7.3",{requires:["dom-core"]});
bundle/dom-attrs/dom-attrs.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -208,4 +208,4 @@ }); -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-base/dom-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dom-base/dom-base.js", code: [] };-_yuitest_coverage["build/dom-base/dom-base.js"].code=["YUI.add('dom-base', function (Y, NAME) {","","/**","* @for DOM","* @module dom","*/","var documentElement = Y.config.doc.documentElement,"," Y_DOM = Y.DOM,"," TAG_NAME = 'tagName',"," OWNER_DOCUMENT = 'ownerDocument',"," EMPTY_STRING = '',"," addFeature = Y.Features.add,"," testFeature = Y.Features.test;","","Y.mix(Y_DOM, {"," /**"," * Returns the text content of the HTMLElement. "," * @method getText "," * @param {HTMLElement} element The html element. "," * @return {String} The text content of the element (includes text of any descending elements)."," */"," getText: (documentElement.textContent !== undefined) ?"," function(element) {"," var ret = '';"," if (element) {"," ret = element.textContent;"," }"," return ret || '';"," } : function(element) {"," var ret = '';"," if (element) {"," ret = element.innerText || element.nodeValue; // might be a textNode"," }"," return ret || '';"," },",""," /**"," * Sets the text content of the HTMLElement. "," * @method setText "," * @param {HTMLElement} element The html element. "," * @param {String} content The content to add. "," */"," setText: (documentElement.textContent !== undefined) ?"," function(element, content) {"," if (element) {"," element.textContent = content;"," }"," } : function(element, content) {"," if ('innerText' in element) {"," element.innerText = content;"," } else if ('nodeValue' in element) {"," element.nodeValue = content;"," }"," },",""," CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8"," 'for': 'htmlFor',"," 'class': 'className'"," } : { // w3c"," 'htmlFor': 'for',"," 'className': 'class'"," },",""," /**"," * Provides a normalized attribute interface. "," * @method setAttribute"," * @param {HTMLElement} el The target element for the attribute."," * @param {String} attr The attribute to set."," * @param {String} val The value of the attribute."," */"," setAttribute: function(el, attr, val, ieAttr) {"," if (el && attr && el.setAttribute) {"," attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr;"," el.setAttribute(attr, val, ieAttr);"," }"," },","",""," /**"," * Provides a normalized attribute interface. "," * @method getAttribute"," * @param {HTMLElement} el The target element for the attribute."," * @param {String} attr The attribute to get."," * @return {String} The current value of the attribute. "," */"," getAttribute: function(el, attr, ieAttr) {"," ieAttr = (ieAttr !== undefined) ? ieAttr : 2;"," var ret = '';"," if (el && attr && el.getAttribute) {"," attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr;"," ret = el.getAttribute(attr, ieAttr);",""," if (ret === null) {"," ret = ''; // per DOM spec"," }"," }"," return ret;"," },",""," VALUE_SETTERS: {},",""," VALUE_GETTERS: {},",""," getValue: function(node) {"," var ret = '', // TODO: return null?"," getter;",""," if (node && node[TAG_NAME]) {"," getter = Y_DOM.VALUE_GETTERS[node[TAG_NAME].toLowerCase()];",""," if (getter) {"," ret = getter(node);"," } else {"," ret = node.value;"," }"," }",""," // workaround for IE8 JSON stringify bug"," // which converts empty string values to null"," if (ret === EMPTY_STRING) {"," ret = EMPTY_STRING; // for real"," }",""," return (typeof ret === 'string') ? ret : '';"," },",""," setValue: function(node, val) {"," var setter;",""," if (node && node[TAG_NAME]) {"," setter = Y_DOM.VALUE_SETTERS[node[TAG_NAME].toLowerCase()];",""," if (setter) {"," setter(node, val);"," } else {"," node.value = val;"," }"," }"," },",""," creators: {}","});","","addFeature('value-set', 'select', {"," test: function() {"," var node = Y.config.doc.createElement('select');"," node.innerHTML = '<option>1</option><option>2</option>';"," node.value = '2';"," return (node.value && node.value === '2');"," }","});","","if (!testFeature('value-set', 'select')) {"," Y_DOM.VALUE_SETTERS.select = function(node, val) {"," for (var i = 0, options = node.getElementsByTagName('option'), option;"," option = options[i++];) {"," if (Y_DOM.getValue(option) === val) {"," option.selected = true;"," //Y_DOM.setAttribute(option, 'selected', 'selected');"," break;"," }"," }"," };","}","","Y.mix(Y_DOM.VALUE_GETTERS, {"," button: function(node) {"," return (node.attributes && node.attributes.value) ? node.attributes.value.value : '';"," }","});","","Y.mix(Y_DOM.VALUE_SETTERS, {"," // IE: node.value changes the button text, which should be handled via innerHTML"," button: function(node, val) {"," var attr = node.attributes.value;"," if (!attr) {"," attr = node[OWNER_DOCUMENT].createAttribute('value');"," node.setAttributeNode(attr);"," }",""," attr.value = val;"," }","});","","","Y.mix(Y_DOM.VALUE_GETTERS, {"," option: function(node) {"," var attrs = node.attributes;"," return (attrs.value && attrs.value.specified) ? node.value : node.text;"," },",""," select: function(node) {"," var val = node.value,"," options = node.options;",""," if (options && options.length) {"," // TODO: implement multipe select"," if (node.multiple) {"," } else if (node.selectedIndex > -1) {"," val = Y_DOM.getValue(options[node.selectedIndex]);"," }"," }",""," return val;"," }","});","var addClass, hasClass, removeClass;","","Y.mix(Y.DOM, {"," /**"," * Determines whether a DOM element has the given className."," * @method hasClass"," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {String} className the class name to search for"," * @return {Boolean} Whether or not the element has the given class. "," */"," hasClass: function(node, className) {"," var re = Y.DOM._getRegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)');"," return re.test(node.className);"," },",""," /**"," * Adds a class name to a given DOM element."," * @method addClass "," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {String} className the class name to add to the class attribute"," */"," addClass: function(node, className) {"," if (!Y.DOM.hasClass(node, className)) { // skip if already present "," node.className = Y.Lang.trim([node.className, className].join(' '));"," }"," },",""," /**"," * Removes a class name from a given element."," * @method removeClass "," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {String} className the class name to remove from the class attribute"," */"," removeClass: function(node, className) {"," if (className && hasClass(node, className)) {"," node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\\\s+)' +"," className + '(?:\\\\s+|$)'), ' '));",""," if ( hasClass(node, className) ) { // in case of multiple adjacent"," removeClass(node, className);"," }"," } "," },",""," /**"," * Replace a class with another class for a given element."," * If no oldClassName is present, the newClassName is simply added."," * @method replaceClass "," * @for DOM"," * @param {HTMLElement} element The DOM element "," * @param {String} oldClassName the class name to be replaced"," * @param {String} newClassName the class name that will be replacing the old class name"," */"," replaceClass: function(node, oldC, newC) {"," removeClass(node, oldC); // remove first in case oldC === newC"," addClass(node, newC);"," },",""," /**"," * If the className exists on the node it is removed, if it doesn't exist it is added."," * @method toggleClass "," * @for DOM"," * @param {HTMLElement} element The DOM element"," * @param {String} className the class name to be toggled"," * @param {Boolean} addClass optional boolean to indicate whether class"," * should be added or removed regardless of current state"," */"," toggleClass: function(node, className, force) {"," var add = (force !== undefined) ? force :"," !(hasClass(node, className));",""," if (add) {"," addClass(node, className);"," } else {"," removeClass(node, className);"," }"," }","});","","hasClass = Y.DOM.hasClass;","removeClass = Y.DOM.removeClass;","addClass = Y.DOM.addClass;","","var re_tag = /<([a-z]+)/i,",""," Y_DOM = Y.DOM,",""," addFeature = Y.Features.add,"," testFeature = Y.Features.test,",""," creators = {},",""," createFromDIV = function(html, tag) {"," var div = Y.config.doc.createElement('div'),"," ret = true;",""," div.innerHTML = html;"," if (!div.firstChild || div.firstChild.tagName !== tag.toUpperCase()) {"," ret = false;"," }",""," return ret;"," },",""," re_tbody = /(?:\\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\\s*<tbody/,",""," TABLE_OPEN = '<table>',"," TABLE_CLOSE = '</table>';","","Y.mix(Y.DOM, {"," _fragClones: {},",""," _create: function(html, doc, tag) {"," tag = tag || 'div';",""," var frag = Y_DOM._fragClones[tag];"," if (frag) {"," frag = frag.cloneNode(false);"," } else {"," frag = Y_DOM._fragClones[tag] = doc.createElement(tag);"," }"," frag.innerHTML = html;"," return frag;"," },",""," _children: function(node, tag) {"," var i = 0,"," children = node.children,"," childNodes,"," hasComments,"," child;",""," if (children && children.tags) { // use tags filter when possible"," if (tag) {"," children = node.children.tags(tag);"," } else { // IE leaks comments into children"," hasComments = children.tags('!').length;"," }"," }"," "," if (!children || (!children.tags && tag) || hasComments) {"," childNodes = children || node.childNodes;"," children = [];"," while ((child = childNodes[i++])) {"," if (child.nodeType === 1) {"," if (!tag || tag === child.tagName) {"," children.push(child);"," }"," }"," }"," }",""," return children || [];"," },",""," /**"," * Creates a new dom node using the provided markup string. "," * @method create"," * @param {String} html The markup used to create the element"," * @param {HTMLDocument} doc An optional document context "," * @return {HTMLElement|DocumentFragment} returns a single HTMLElement "," * when creating one node, and a documentFragment when creating"," * multiple nodes."," */"," create: function(html, doc) {"," if (typeof html === 'string') {"," html = Y.Lang.trim(html); // match IE which trims whitespace from innerHTML",""," }",""," doc = doc || Y.config.doc;"," var m = re_tag.exec(html),"," create = Y_DOM._create,"," custom = creators,"," ret = null,"," creator,"," tag, nodes;",""," if (html != undefined) { // not undefined or null"," if (m && m[1]) {"," creator = custom[m[1].toLowerCase()];"," if (typeof creator === 'function') {"," create = creator; "," } else {"," tag = creator;"," }"," }",""," nodes = create(html, doc, tag).childNodes;",""," if (nodes.length === 1) { // return single node, breaking parentNode ref from \"fragment\""," ret = nodes[0].parentNode.removeChild(nodes[0]);"," } else if (nodes[0] && nodes[0].className === 'yui3-big-dummy') { // using dummy node to preserve some attributes (e.g. OPTION not selected)"," if (nodes.length === 2) {"," ret = nodes[0].nextSibling;"," } else {"," nodes[0].parentNode.removeChild(nodes[0]); "," ret = Y_DOM._nl2frag(nodes, doc);"," }"," } else { // return multiple nodes as a fragment"," ret = Y_DOM._nl2frag(nodes, doc);"," }",""," }",""," return ret;"," },",""," _nl2frag: function(nodes, doc) {"," var ret = null,"," i, len;",""," if (nodes && (nodes.push || nodes.item) && nodes[0]) {"," doc = doc || nodes[0].ownerDocument; "," ret = doc.createDocumentFragment();",""," if (nodes.item) { // convert live list to static array"," nodes = Y.Array(nodes, 0, true);"," }",""," for (i = 0, len = nodes.length; i < len; i++) {"," ret.appendChild(nodes[i]); "," }"," } // else inline with log for minification"," return ret;"," },",""," /**"," * Inserts content in a node at the given location "," * @method addHTML"," * @param {HTMLElement} node The node to insert into"," * @param {HTMLElement | Array | HTMLCollection} content The content to be inserted "," * @param {HTMLElement} where Where to insert the content"," * If no \"where\" is given, content is appended to the node"," * Possible values for \"where\""," * <dl>"," * <dt>HTMLElement</dt>"," * <dd>The element to insert before</dd>"," * <dt>\"replace\"</dt>"," * <dd>Replaces the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts before the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts content before the node</dd>"," * <dt>\"after\"</dt>"," * <dd>Inserts content after the node</dd>"," * </dl>"," */"," addHTML: function(node, content, where) {"," var nodeParent = node.parentNode,"," i = 0,"," item,"," ret = content,"," newNode;"," ",""," if (content != undefined) { // not null or undefined (maybe 0)"," if (content.nodeType) { // DOM node, just add it"," newNode = content;"," } else if (typeof content == 'string' || typeof content == 'number') {"," ret = newNode = Y_DOM.create(content);"," } else if (content[0] && content[0].nodeType) { // array or collection "," newNode = Y.config.doc.createDocumentFragment();"," while ((item = content[i++])) {"," newNode.appendChild(item); // append to fragment for insertion"," }"," }"," }",""," if (where) {"," if (newNode && where.parentNode) { // insert regardless of relationship to node"," where.parentNode.insertBefore(newNode, where);"," } else {"," switch (where) {"," case 'replace':"," while (node.firstChild) {"," node.removeChild(node.firstChild);"," }"," if (newNode) { // allow empty content to clear node"," node.appendChild(newNode);"," }"," break;"," case 'before':"," if (newNode) {"," nodeParent.insertBefore(newNode, node);"," }"," break;"," case 'after':"," if (newNode) {"," if (node.nextSibling) { // IE errors if refNode is null"," nodeParent.insertBefore(newNode, node.nextSibling);"," } else {"," nodeParent.appendChild(newNode);"," }"," }"," break;"," default:"," if (newNode) {"," node.appendChild(newNode);"," }"," }"," }"," } else if (newNode) {"," node.appendChild(newNode);"," }",""," return ret;"," },",""," wrap: function(node, html) {"," var parent = (html && html.nodeType) ? html : Y.DOM.create(html),"," nodes = parent.getElementsByTagName('*');",""," if (nodes.length) {"," parent = nodes[nodes.length - 1];"," }",""," if (node.parentNode) { "," node.parentNode.replaceChild(parent, node);"," }"," parent.appendChild(node);"," },",""," unwrap: function(node) {"," var parent = node.parentNode,"," lastChild = parent.lastChild,"," next = node,"," grandparent;",""," if (parent) {"," grandparent = parent.parentNode;"," if (grandparent) {"," node = parent.firstChild;"," while (node !== lastChild) {"," next = node.nextSibling;"," grandparent.insertBefore(node, parent);"," node = next;"," }"," grandparent.replaceChild(lastChild, parent);"," } else {"," parent.removeChild(node);"," }"," }"," }","});","","addFeature('innerhtml', 'table', {"," test: function() {"," var node = Y.config.doc.createElement('table');"," try {"," node.innerHTML = '<tbody></tbody>';"," } catch(e) {"," return false;"," }"," return (node.firstChild && node.firstChild.nodeName === 'TBODY');"," }","});","","addFeature('innerhtml-div', 'tr', {"," test: function() {"," return createFromDIV('<tr></tr>', 'tr');"," }","});","","addFeature('innerhtml-div', 'script', {"," test: function() {"," return createFromDIV('<script></script>', 'script');"," }","});","","if (!testFeature('innerhtml', 'table')) {"," // TODO: thead/tfoot with nested tbody"," // IE adds TBODY when creating TABLE elements (which may share this impl)"," creators.tbody = function(html, doc) {"," var frag = Y_DOM.create(TABLE_OPEN + html + TABLE_CLOSE, doc),"," tb = Y.DOM._children(frag, 'tbody')[0];",""," if (frag.children.length > 1 && tb && !re_tbody.test(html)) {"," tb.parentNode.removeChild(tb); // strip extraneous tbody"," }"," return frag;"," };","}","","if (!testFeature('innerhtml-div', 'script')) {"," creators.script = function(html, doc) {"," var frag = doc.createElement('div');",""," frag.innerHTML = '-' + html;"," frag.removeChild(frag.firstChild);"," return frag;"," };",""," creators.link = creators.style = creators.script;","}","","if (!testFeature('innerhtml-div', 'tr')) {"," Y.mix(creators, {"," option: function(html, doc) {"," return Y_DOM.create('<select><option class=\"yui3-big-dummy\" selected></option>' + html + '</select>', doc);"," },",""," tr: function(html, doc) {"," return Y_DOM.create('<tbody>' + html + '</tbody>', doc);"," },",""," td: function(html, doc) {"," return Y_DOM.create('<tr>' + html + '</tr>', doc);"," }, ",""," col: function(html, doc) {"," return Y_DOM.create('<colgroup>' + html + '</colgroup>', doc);"," }, ",""," tbody: 'table'"," });",""," Y.mix(creators, {"," legend: 'fieldset',"," th: creators.td,"," thead: creators.tbody,"," tfoot: creators.tbody,"," caption: creators.tbody,"," colgroup: creators.tbody,"," optgroup: creators.option"," });","}","","Y_DOM.creators = creators;","Y.mix(Y.DOM, {"," /**"," * Sets the width of the element to the given size, regardless"," * of box model, border, padding, etc."," * @method setWidth"," * @param {HTMLElement} element The DOM element. "," * @param {String|Number} size The pixel height to size to"," */",""," setWidth: function(node, size) {"," Y.DOM._setSize(node, 'width', size);"," },",""," /**"," * Sets the height of the element to the given size, regardless"," * of box model, border, padding, etc."," * @method setHeight"," * @param {HTMLElement} element The DOM element. "," * @param {String|Number} size The pixel height to size to"," */",""," setHeight: function(node, size) {"," Y.DOM._setSize(node, 'height', size);"," },",""," _setSize: function(node, prop, val) {"," val = (val > 0) ? val : 0;"," var size = 0;",""," node.style[prop] = val + 'px';"," size = (prop === 'height') ? node.offsetHeight : node.offsetWidth;",""," if (size > val) {"," val = val - (size - val);",""," if (val < 0) {"," val = 0;"," }",""," node.style[prop] = val + 'px';"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"dom-core\"]});"];+_yuitest_coverage["build/dom-base/dom-base.js"].code=["YUI.add('dom-base', function (Y, NAME) {","","/**","* @for DOM","* @module dom","*/","var documentElement = Y.config.doc.documentElement,"," Y_DOM = Y.DOM,"," TAG_NAME = 'tagName',"," OWNER_DOCUMENT = 'ownerDocument',"," EMPTY_STRING = '',"," addFeature = Y.Features.add,"," testFeature = Y.Features.test;","","Y.mix(Y_DOM, {"," /**"," * Returns the text content of the HTMLElement. "," * @method getText "," * @param {HTMLElement} element The html element. "," * @return {String} The text content of the element (includes text of any descending elements)."," */"," getText: (documentElement.textContent !== undefined) ?"," function(element) {"," var ret = '';"," if (element) {"," ret = element.textContent;"," }"," return ret || '';"," } : function(element) {"," var ret = '';"," if (element) {"," ret = element.innerText || element.nodeValue; // might be a textNode"," }"," return ret || '';"," },",""," /**"," * Sets the text content of the HTMLElement. "," * @method setText "," * @param {HTMLElement} element The html element. "," * @param {String} content The content to add. "," */"," setText: (documentElement.textContent !== undefined) ?"," function(element, content) {"," if (element) {"," element.textContent = content;"," }"," } : function(element, content) {"," if ('innerText' in element) {"," element.innerText = content;"," } else if ('nodeValue' in element) {"," element.nodeValue = content;"," }"," },",""," CUSTOM_ATTRIBUTES: (!documentElement.hasAttribute) ? { // IE < 8"," 'for': 'htmlFor',"," 'class': 'className'"," } : { // w3c"," 'htmlFor': 'for',"," 'className': 'class'"," },",""," /**"," * Provides a normalized attribute interface. "," * @method setAttribute"," * @param {HTMLElement} el The target element for the attribute."," * @param {String} attr The attribute to set."," * @param {String} val The value of the attribute."," */"," setAttribute: function(el, attr, val, ieAttr) {"," if (el && attr && el.setAttribute) {"," attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr;"," el.setAttribute(attr, val, ieAttr);"," }"," },","",""," /**"," * Provides a normalized attribute interface. "," * @method getAttribute"," * @param {HTMLElement} el The target element for the attribute."," * @param {String} attr The attribute to get."," * @return {String} The current value of the attribute. "," */"," getAttribute: function(el, attr, ieAttr) {"," ieAttr = (ieAttr !== undefined) ? ieAttr : 2;"," var ret = '';"," if (el && attr && el.getAttribute) {"," attr = Y_DOM.CUSTOM_ATTRIBUTES[attr] || attr;"," ret = el.getAttribute(attr, ieAttr);",""," if (ret === null) {"," ret = ''; // per DOM spec"," }"," }"," return ret;"," },",""," VALUE_SETTERS: {},",""," VALUE_GETTERS: {},",""," getValue: function(node) {"," var ret = '', // TODO: return null?"," getter;",""," if (node && node[TAG_NAME]) {"," getter = Y_DOM.VALUE_GETTERS[node[TAG_NAME].toLowerCase()];",""," if (getter) {"," ret = getter(node);"," } else {"," ret = node.value;"," }"," }",""," // workaround for IE8 JSON stringify bug"," // which converts empty string values to null"," if (ret === EMPTY_STRING) {"," ret = EMPTY_STRING; // for real"," }",""," return (typeof ret === 'string') ? ret : '';"," },",""," setValue: function(node, val) {"," var setter;",""," if (node && node[TAG_NAME]) {"," setter = Y_DOM.VALUE_SETTERS[node[TAG_NAME].toLowerCase()];",""," if (setter) {"," setter(node, val);"," } else {"," node.value = val;"," }"," }"," },",""," creators: {}","});","","addFeature('value-set', 'select', {"," test: function() {"," var node = Y.config.doc.createElement('select');"," node.innerHTML = '<option>1</option><option>2</option>';"," node.value = '2';"," return (node.value && node.value === '2');"," }","});","","if (!testFeature('value-set', 'select')) {"," Y_DOM.VALUE_SETTERS.select = function(node, val) {"," for (var i = 0, options = node.getElementsByTagName('option'), option;"," option = options[i++];) {"," if (Y_DOM.getValue(option) === val) {"," option.selected = true;"," //Y_DOM.setAttribute(option, 'selected', 'selected');"," break;"," }"," }"," };","}","","Y.mix(Y_DOM.VALUE_GETTERS, {"," button: function(node) {"," return (node.attributes && node.attributes.value) ? node.attributes.value.value : '';"," }","});","","Y.mix(Y_DOM.VALUE_SETTERS, {"," // IE: node.value changes the button text, which should be handled via innerHTML"," button: function(node, val) {"," var attr = node.attributes.value;"," if (!attr) {"," attr = node[OWNER_DOCUMENT].createAttribute('value');"," node.setAttributeNode(attr);"," }",""," attr.value = val;"," }","});","","","Y.mix(Y_DOM.VALUE_GETTERS, {"," option: function(node) {"," var attrs = node.attributes;"," return (attrs.value && attrs.value.specified) ? node.value : node.text;"," },",""," select: function(node) {"," var val = node.value,"," options = node.options;",""," if (options && options.length) {"," // TODO: implement multipe select"," if (node.multiple) {"," } else if (node.selectedIndex > -1) {"," val = Y_DOM.getValue(options[node.selectedIndex]);"," }"," }",""," return val;"," }","});","var addClass, hasClass, removeClass;","","Y.mix(Y.DOM, {"," /**"," * Determines whether a DOM element has the given className."," * @method hasClass"," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {String} className the class name to search for"," * @return {Boolean} Whether or not the element has the given class. "," */"," hasClass: function(node, className) {"," var re = Y.DOM._getRegExp('(?:^|\\\\s+)' + className + '(?:\\\\s+|$)');"," return re.test(node.className);"," },",""," /**"," * Adds a class name to a given DOM element."," * @method addClass "," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {String} className the class name to add to the class attribute"," */"," addClass: function(node, className) {"," if (!Y.DOM.hasClass(node, className)) { // skip if already present "," node.className = Y.Lang.trim([node.className, className].join(' '));"," }"," },",""," /**"," * Removes a class name from a given element."," * @method removeClass "," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {String} className the class name to remove from the class attribute"," */"," removeClass: function(node, className) {"," if (className && hasClass(node, className)) {"," node.className = Y.Lang.trim(node.className.replace(Y.DOM._getRegExp('(?:^|\\\\s+)' +"," className + '(?:\\\\s+|$)'), ' '));",""," if ( hasClass(node, className) ) { // in case of multiple adjacent"," removeClass(node, className);"," }"," } "," },",""," /**"," * Replace a class with another class for a given element."," * If no oldClassName is present, the newClassName is simply added."," * @method replaceClass "," * @for DOM"," * @param {HTMLElement} element The DOM element "," * @param {String} oldClassName the class name to be replaced"," * @param {String} newClassName the class name that will be replacing the old class name"," */"," replaceClass: function(node, oldC, newC) {"," removeClass(node, oldC); // remove first in case oldC === newC"," addClass(node, newC);"," },",""," /**"," * If the className exists on the node it is removed, if it doesn't exist it is added."," * @method toggleClass "," * @for DOM"," * @param {HTMLElement} element The DOM element"," * @param {String} className the class name to be toggled"," * @param {Boolean} addClass optional boolean to indicate whether class"," * should be added or removed regardless of current state"," */"," toggleClass: function(node, className, force) {"," var add = (force !== undefined) ? force :"," !(hasClass(node, className));",""," if (add) {"," addClass(node, className);"," } else {"," removeClass(node, className);"," }"," }","});","","hasClass = Y.DOM.hasClass;","removeClass = Y.DOM.removeClass;","addClass = Y.DOM.addClass;","","var re_tag = /<([a-z]+)/i,",""," Y_DOM = Y.DOM,",""," addFeature = Y.Features.add,"," testFeature = Y.Features.test,",""," creators = {},",""," createFromDIV = function(html, tag) {"," var div = Y.config.doc.createElement('div'),"," ret = true;",""," div.innerHTML = html;"," if (!div.firstChild || div.firstChild.tagName !== tag.toUpperCase()) {"," ret = false;"," }",""," return ret;"," },",""," re_tbody = /(?:\\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\\s*<tbody/,",""," TABLE_OPEN = '<table>',"," TABLE_CLOSE = '</table>';","","Y.mix(Y.DOM, {"," _fragClones: {},",""," _create: function(html, doc, tag) {"," tag = tag || 'div';",""," var frag = Y_DOM._fragClones[tag];"," if (frag) {"," frag = frag.cloneNode(false);"," } else {"," frag = Y_DOM._fragClones[tag] = doc.createElement(tag);"," }"," frag.innerHTML = html;"," return frag;"," },",""," _children: function(node, tag) {"," var i = 0,"," children = node.children,"," childNodes,"," hasComments,"," child;",""," if (children && children.tags) { // use tags filter when possible"," if (tag) {"," children = node.children.tags(tag);"," } else { // IE leaks comments into children"," hasComments = children.tags('!').length;"," }"," }"," "," if (!children || (!children.tags && tag) || hasComments) {"," childNodes = children || node.childNodes;"," children = [];"," while ((child = childNodes[i++])) {"," if (child.nodeType === 1) {"," if (!tag || tag === child.tagName) {"," children.push(child);"," }"," }"," }"," }",""," return children || [];"," },",""," /**"," * Creates a new dom node using the provided markup string. "," * @method create"," * @param {String} html The markup used to create the element"," * @param {HTMLDocument} doc An optional document context "," * @return {HTMLElement|DocumentFragment} returns a single HTMLElement "," * when creating one node, and a documentFragment when creating"," * multiple nodes."," */"," create: function(html, doc) {"," if (typeof html === 'string') {"," html = Y.Lang.trim(html); // match IE which trims whitespace from innerHTML",""," }",""," doc = doc || Y.config.doc;"," var m = re_tag.exec(html),"," create = Y_DOM._create,"," custom = creators,"," ret = null,"," creator,"," tag, nodes;",""," if (html != undefined) { // not undefined or null"," if (m && m[1]) {"," creator = custom[m[1].toLowerCase()];"," if (typeof creator === 'function') {"," create = creator; "," } else {"," tag = creator;"," }"," }",""," nodes = create(html, doc, tag).childNodes;",""," if (nodes.length === 1) { // return single node, breaking parentNode ref from \"fragment\""," ret = nodes[0].parentNode.removeChild(nodes[0]);"," } else if (nodes[0] && nodes[0].className === 'yui3-big-dummy') { // using dummy node to preserve some attributes (e.g. OPTION not selected)"," if (nodes.length === 2) {"," ret = nodes[0].nextSibling;"," } else {"," nodes[0].parentNode.removeChild(nodes[0]); "," ret = Y_DOM._nl2frag(nodes, doc);"," }"," } else { // return multiple nodes as a fragment"," ret = Y_DOM._nl2frag(nodes, doc);"," }",""," }",""," return ret;"," },",""," _nl2frag: function(nodes, doc) {"," var ret = null,"," i, len;",""," if (nodes && (nodes.push || nodes.item) && nodes[0]) {"," doc = doc || nodes[0].ownerDocument; "," ret = doc.createDocumentFragment();",""," if (nodes.item) { // convert live list to static array"," nodes = Y.Array(nodes, 0, true);"," }",""," for (i = 0, len = nodes.length; i < len; i++) {"," ret.appendChild(nodes[i]); "," }"," } // else inline with log for minification"," return ret;"," },",""," /**"," * Inserts content in a node at the given location "," * @method addHTML"," * @param {HTMLElement} node The node to insert into"," * @param {HTMLElement | Array | HTMLCollection} content The content to be inserted "," * @param {HTMLElement} where Where to insert the content"," * If no \"where\" is given, content is appended to the node"," * Possible values for \"where\""," * <dl>"," * <dt>HTMLElement</dt>"," * <dd>The element to insert before</dd>"," * <dt>\"replace\"</dt>"," * <dd>Replaces the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts before the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts content before the node</dd>"," * <dt>\"after\"</dt>"," * <dd>Inserts content after the node</dd>"," * </dl>"," */"," addHTML: function(node, content, where) {"," var nodeParent = node.parentNode,"," i = 0,"," item,"," ret = content,"," newNode;"," ",""," if (content != undefined) { // not null or undefined (maybe 0)"," if (content.nodeType) { // DOM node, just add it"," newNode = content;"," } else if (typeof content == 'string' || typeof content == 'number') {"," ret = newNode = Y_DOM.create(content);"," } else if (content[0] && content[0].nodeType) { // array or collection "," newNode = Y.config.doc.createDocumentFragment();"," while ((item = content[i++])) {"," newNode.appendChild(item); // append to fragment for insertion"," }"," }"," }",""," if (where) {"," if (newNode && where.parentNode) { // insert regardless of relationship to node"," where.parentNode.insertBefore(newNode, where);"," } else {"," switch (where) {"," case 'replace':"," while (node.firstChild) {"," node.removeChild(node.firstChild);"," }"," if (newNode) { // allow empty content to clear node"," node.appendChild(newNode);"," }"," break;"," case 'before':"," if (newNode) {"," nodeParent.insertBefore(newNode, node);"," }"," break;"," case 'after':"," if (newNode) {"," if (node.nextSibling) { // IE errors if refNode is null"," nodeParent.insertBefore(newNode, node.nextSibling);"," } else {"," nodeParent.appendChild(newNode);"," }"," }"," break;"," default:"," if (newNode) {"," node.appendChild(newNode);"," }"," }"," }"," } else if (newNode) {"," node.appendChild(newNode);"," }",""," return ret;"," },",""," wrap: function(node, html) {"," var parent = (html && html.nodeType) ? html : Y.DOM.create(html),"," nodes = parent.getElementsByTagName('*');",""," if (nodes.length) {"," parent = nodes[nodes.length - 1];"," }",""," if (node.parentNode) { "," node.parentNode.replaceChild(parent, node);"," }"," parent.appendChild(node);"," },",""," unwrap: function(node) {"," var parent = node.parentNode,"," lastChild = parent.lastChild,"," next = node,"," grandparent;",""," if (parent) {"," grandparent = parent.parentNode;"," if (grandparent) {"," node = parent.firstChild;"," while (node !== lastChild) {"," next = node.nextSibling;"," grandparent.insertBefore(node, parent);"," node = next;"," }"," grandparent.replaceChild(lastChild, parent);"," } else {"," parent.removeChild(node);"," }"," }"," }","});","","addFeature('innerhtml', 'table', {"," test: function() {"," var node = Y.config.doc.createElement('table');"," try {"," node.innerHTML = '<tbody></tbody>';"," } catch(e) {"," return false;"," }"," return (node.firstChild && node.firstChild.nodeName === 'TBODY');"," }","});","","addFeature('innerhtml-div', 'tr', {"," test: function() {"," return createFromDIV('<tr></tr>', 'tr');"," }","});","","addFeature('innerhtml-div', 'script', {"," test: function() {"," return createFromDIV('<script></script>', 'script');"," }","});","","if (!testFeature('innerhtml', 'table')) {"," // TODO: thead/tfoot with nested tbody"," // IE adds TBODY when creating TABLE elements (which may share this impl)"," creators.tbody = function(html, doc) {"," var frag = Y_DOM.create(TABLE_OPEN + html + TABLE_CLOSE, doc),"," tb = Y.DOM._children(frag, 'tbody')[0];",""," if (frag.children.length > 1 && tb && !re_tbody.test(html)) {"," tb.parentNode.removeChild(tb); // strip extraneous tbody"," }"," return frag;"," };","}","","if (!testFeature('innerhtml-div', 'script')) {"," creators.script = function(html, doc) {"," var frag = doc.createElement('div');",""," frag.innerHTML = '-' + html;"," frag.removeChild(frag.firstChild);"," return frag;"," };",""," creators.link = creators.style = creators.script;","}","","if (!testFeature('innerhtml-div', 'tr')) {"," Y.mix(creators, {"," option: function(html, doc) {"," return Y_DOM.create('<select><option class=\"yui3-big-dummy\" selected></option>' + html + '</select>', doc);"," },",""," tr: function(html, doc) {"," return Y_DOM.create('<tbody>' + html + '</tbody>', doc);"," },",""," td: function(html, doc) {"," return Y_DOM.create('<tr>' + html + '</tr>', doc);"," }, ",""," col: function(html, doc) {"," return Y_DOM.create('<colgroup>' + html + '</colgroup>', doc);"," }, ",""," tbody: 'table'"," });",""," Y.mix(creators, {"," legend: 'fieldset',"," th: creators.td,"," thead: creators.tbody,"," tfoot: creators.tbody,"," caption: creators.tbody,"," colgroup: creators.tbody,"," optgroup: creators.option"," });","}","","Y_DOM.creators = creators;","Y.mix(Y.DOM, {"," /**"," * Sets the width of the element to the given size, regardless"," * of box model, border, padding, etc."," * @method setWidth"," * @param {HTMLElement} element The DOM element. "," * @param {String|Number} size The pixel height to size to"," */",""," setWidth: function(node, size) {"," Y.DOM._setSize(node, 'width', size);"," },",""," /**"," * Sets the height of the element to the given size, regardless"," * of box model, border, padding, etc."," * @method setHeight"," * @param {HTMLElement} element The DOM element. "," * @param {String|Number} size The pixel height to size to"," */",""," setHeight: function(node, size) {"," Y.DOM._setSize(node, 'height', size);"," },",""," _setSize: function(node, prop, val) {"," val = (val > 0) ? val : 0;"," var size = 0;",""," node.style[prop] = val + 'px';"," size = (prop === 'height') ? node.offsetHeight : node.offsetWidth;",""," if (size > val) {"," val = val - (size - val);",""," if (val < 0) {"," val = 0;"," }",""," node.style[prop] = val + 'px';"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"dom-core\"]});"]; _yuitest_coverage["build/dom-base/dom-base.js"].lines = {"1":0,"7":0,"15":0,"24":0,"25":0,"26":0,"28":0,"30":0,"31":0,"32":0,"34":0,"45":0,"46":0,"49":0,"50":0,"51":0,"52":0,"72":0,"73":0,"74":0,"87":0,"88":0,"89":0,"90":0,"91":0,"93":0,"94":0,"97":0,"105":0,"108":0,"109":0,"111":0,"112":0,"114":0,"120":0,"121":0,"124":0,"128":0,"130":0,"131":0,"133":0,"134":0,"136":0,"144":0,"146":0,"147":0,"148":0,"149":0,"153":0,"154":0,"155":0,"157":0,"158":0,"160":0,"166":0,"168":0,"172":0,"175":0,"176":0,"177":0,"178":0,"181":0,"186":0,"188":0,"189":0,"193":0,"196":0,"198":0,"199":0,"200":0,"204":0,"207":0,"209":0,"219":0,"220":0,"231":0,"232":0,"244":0,"245":0,"248":0,"249":0,"264":0,"265":0,"278":0,"281":0,"282":0,"284":0,"289":0,"290":0,"291":0,"293":0,"303":0,"306":0,"307":0,"308":0,"311":0,"319":0,"323":0,"325":0,"326":0,"327":0,"329":0,"331":0,"332":0,"336":0,"342":0,"343":0,"344":0,"346":0,"350":0,"351":0,"352":0,"353":0,"354":0,"355":0,"356":0,"362":0,"375":0,"376":0,"380":0,"381":0,"388":0,"389":0,"390":0,"391":0,"392":0,"394":0,"398":0,"400":0,"401":0,"402":0,"403":0,"404":0,"406":0,"407":0,"410":0,"415":0,"419":0,"422":0,"423":0,"424":0,"426":0,"427":0,"430":0,"431":0,"434":0,"459":0,"466":0,"467":0,"468":0,"469":0,"470":0,"471":0,"472":0,"473":0,"474":0,"479":0,"480":0,"481":0,"483":0,"485":0,"486":0,"488":0,"489":0,"491":0,"493":0,"494":0,"496":0,"498":0,"499":0,"500":0,"502":0,"505":0,"507":0,"508":0,"512":0,"513":0,"516":0,"520":0,"523":0,"524":0,"527":0,"528":0,"530":0,"534":0,"539":0,"540":0,"541":0,"542":0,"543":0,"544":0,"545":0,"546":0,"548":0,"550":0,"556":0,"558":0,"559":0,"560":0,"562":0,"564":0,"568":0,"570":0,"574":0,"576":0,"580":0,"583":0,"584":0,"587":0,"588":0,"590":0,"594":0,"595":0,"596":0,"598":0,"599":0,"600":0,"603":0,"606":0,"607":0,"609":0,"613":0,"617":0,"621":0,"627":0,"638":0,"639":0,"649":0,"661":0,"665":0,"666":0,"668":0,"669":0,"671":0,"672":0,"674":0,"675":0,"678":0}; _yuitest_coverage["build/dom-base/dom-base.js"].functions = {"(anonymous 2):23":0,"}:29":0,"(anonymous 3):44":0,"}:48":0,"setAttribute:71":0,"getAttribute:86":0,"getValue:104":0,"setValue:127":0,"test:145":0,"select:154":0,"button:167":0,"button:174":0,"option:187":0,"select:192":0,"hasClass:218":0,"addClass:230":0,"removeClass:243":0,"replaceClass:263":0,"toggleClass:277":0,"createFromDIV:302":0,"_create:322":0,"_children:335":0,"create:374":0,"_nl2frag:418":0,"addHTML:458":0,"wrap:519":0,"unwrap:533":0,"test:557":0,"test:569":0,"test:575":0,"tbody:583":0,"script:595":0,"option:608":0,"tr:612":0,"td:616":0,"col:620":0,"setWidth:648":0,"setHeight:660":0,"_setSize:664":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dom-base/dom-base.js"].coveredLines = 238;@@ -998,4 +998,4 @@ }); -}, '3.7.2', {"requires": ["dom-core"]});+}, '3.7.3', {"requires": ["dom-core"]});
bundle/dom-base/dom-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -691,4 +691,4 @@ }); -}, '3.7.2', {"requires": ["dom-core"]});+}, '3.7.3', {"requires": ["dom-core"]});
bundle/dom-base/dom-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-base",function(e,t){var n=e.config.doc.documentElement,r=e.DOM,i="tagName",s="ownerDocument",o="",u=e.Features.add,a=e.Features.test;e.mix(r,{getText:n.textContent!==undefined?function(e){var t="";return e&&(t=e.textContent),t||""}:function(e){var t="";return e&&(t=e.innerText||e.nodeValue),t||""},setText:n.textContent!==undefined?function(e,t){e&&(e.textContent=t)}:function(e,t){"innerText"in e?e.innerText=t:"nodeValue"in e&&(e.nodeValue=t)},CUSTOM_ATTRIBUTES:n.hasAttribute?{htmlFor:"for",className:"class"}:{"for":"htmlFor","class":"className"},setAttribute:function(e,t,n,i){e&&t&&e.setAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,e.setAttribute(t,n,i))},getAttribute:function(e,t,n){n=n!==undefined?n:2;var i="";return e&&t&&e.getAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,i=e.getAttribute(t,n),i===null&&(i="")),i},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(e){var t="",n;return e&&e[i]&&(n=r.VALUE_GETTERS[e[i].toLowerCase()],n?t=n(e):t=e.value),t===o&&(t=o),typeof t=="string"?t:""},setValue:function(e,t){var n;e&&e[i]&&(n=r.VALUE_SETTERS[e[i].toLowerCase()],n?n(e,t):e.value=t)},creators:{}}),u("value-set","select",{test:function(){var t=e.config.doc.createElement("select");return t.innerHTML="<option>1</option><option>2</option>",t.value="2",t.value&&t.value==="2"}}),a("value-set","select")||(r.VALUE_SETTERS.select=function(e,t){for(var n=0,i=e.getElementsByTagName("option"),s;s=i[n++];)if(r.getValue(s)===t){s.selected=!0;break}}),e.mix(r.VALUE_GETTERS,{button:function(e){return e.attributes&&e.attributes.value?e.attributes.value.value:""}}),e.mix(r.VALUE_SETTERS,{button:function(e,t){var n=e.attributes.value;n||(n=e[s].createAttribute("value"),e.setAttributeNode(n)),n.value=t}}),e.mix(r.VALUE_GETTERS,{option:function(e){var t=e.attributes;return t.value&&t.value.specified?e.value:e.text},select:function(e){var t=e.value,n=e.options;return n&&n.length&&(e.multiple||e.selectedIndex>-1&&(t=r.getValue(n[e.selectedIndex]))),t}});var f,l,c;e.mix(e.DOM,{hasClass:function(t,n){var r=e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)");return r.test(t.className)},addClass:function(t,n){e.DOM.hasClass(t,n)||(t.className=e.Lang.trim([t.className,n].join(" ")))},removeClass:function(t,n){n&&l(t,n)&&(t.className=e.Lang.trim(t.className.replace(e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)")," ")),l(t,n)&&c(t,n))},replaceClass:function(e,t,n){c(e,t),f(e,n)},toggleClass:function(e,t,n){var r=n!==undefined?n:!l(e,t);r?f(e,t):c(e,t)}}),l=e.DOM.hasClass,c=e.DOM.removeClass,f=e.DOM.addClass;var h=/<([a-z]+)/i,r=e.DOM,u=e.Features.add,a=e.Features.test,p={},d=function(t,n){var r=e.config.doc.createElement("div"),i=!0;r.innerHTML=t;if(!r.firstChild||r.firstChild.tagName!==n.toUpperCase())i=!1;return i},v=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,m="<table>",g="</table>";e.mix(e.DOM,{_fragClones:{},_create:function(e,t,n){n=n||"div";var i=r._fragClones[n];return i?i=i.cloneNode(!1):i=r._fragClones[n]=t.createElement(n),i.innerHTML=e,i},_children:function(e,t){var n=0,r=e.children,i,s,o;r&&r.tags&&(t?r=e.children.tags(t):s=r.tags("!").length);if(!r||!r.tags&&t||s){i=r||e.childNodes,r=[];while(o=i[n++])o.nodeType===1&&(!t||t===o.tagName)&&r.push(o)}return r||[]},create:function(t,n){typeof t=="string"&&(t=e.Lang.trim(t)),n=n||e.config.doc;var i=h.exec(t),s=r._create,o=p,u=null,a,f,l;return t!=undefined&&(i&&i[1]&&(a=o[i[1].toLowerCase()],typeof a=="function"?s=a:f=a),l=s(t,n,f).childNodes,l.length===1?u=l[0].parentNode.removeChild(l[0]):l[0]&&l[0].className==="yui3-big-dummy"?l.length===2?u=l[0].nextSibling:(l[0].parentNode.removeChild(l[0]),u=r._nl2frag(l,n)):u=r._nl2frag(l,n)),u},_nl2frag:function(t,n){var r=null,i,s;if(t&&(t.push||t.item)&&t[0]){n=n||t[0].ownerDocument,r=n.createDocumentFragment(),t.item&&(t=e.Array(t,0,!0));for(i=0,s=t.length;i<s;i++)r.appendChild(t[i])}return r},addHTML:function(t,n,i){var s=t.parentNode,o=0,u,a=n,f;if(n!=undefined)if(n.nodeType)f=n;else if(typeof n=="string"||typeof n=="number")a=f=r.create(n);else if(n[0]&&n[0].nodeType){f=e.config.doc.createDocumentFragment();while(u=n[o++])f.appendChild(u)}if(i)if(f&&i.parentNode)i.parentNode.insertBefore(f,i);else switch(i){case"replace":while(t.firstChild)t.removeChild(t.firstChild);f&&t.appendChild(f);break;case"before":f&&s.insertBefore(f,t);break;case"after":f&&(t.nextSibling?s.insertBefore(f,t.nextSibling):s.appendChild(f));break;default:f&&t.appendChild(f)}else f&&t.appendChild(f);return a},wrap:function(t,n){var r=n&&n.nodeType?n:e.DOM.create(n),i=r.getElementsByTagName("*");i.length&&(r=i[i.length-1]),t.parentNode&&t.parentNode.replaceChild(r,t),r.appendChild(t)},unwrap:function(e){var t=e.parentNode,n=t.lastChild,r=e,i;if(t){i=t.parentNode;if(i){e=t.firstChild;while(e!==n)r=e.nextSibling,i.insertBefore(e,t),e=r;i.replaceChild(n,t)}else t.removeChild(e)}}}),u("innerhtml","table",{test:function(){var t=e.config.doc.createElement("table");try{t.innerHTML="<tbody></tbody>"}catch(n){return!1}return t.firstChild&&t.firstChild.nodeName==="TBODY"}}),u("innerhtml-div","tr",{test:function(){return d("<tr></tr>","tr")}}),u("innerhtml-div","script",{test:function(){return d("<script></script>","script")}}),a("innerhtml","table")||(p.tbody=function(t,n){var i=r.create(m+t+g,n),s=e.DOM._children(i,"tbody")[0];return i.children.length>1&&s&&!v.test(t)&&s.parentNode.removeChild(s),i}),a("innerhtml-div","script")||(p.script=function(e,t){var n=t.createElement("div");return n.innerHTML="-"+e,n.removeChild(n.firstChild),n},p.link=p.style=p.script),a("innerhtml-div","tr")||(e.mix(p,{option:function(e,t){return r.create('<select><option class="yui3-big-dummy" selected></option>'+e+"</select>",t)},tr:function(e,t){return r.create("<tbody>"+e+"</tbody>",t)},td:function(e,t){return r.create("<tr>"+e+"</tr>",t)},col:function(e,t){return r.create("<colgroup>"+e+"</colgroup>",t)},tbody:"table"}),e.mix(p,{legend:"fieldset",th:p.td,thead:p.tbody,tfoot:p.tbody,caption:p.tbody,colgroup:p.tbody,optgroup:p.option})),r.creators=p,e.mix(e.DOM,{setWidth:function(t,n){e.DOM._setSize(t,"width",n)},setHeight:function(t,n){e.DOM._setSize(t,"height",n)},_setSize:function(e,t,n){n=n>0?n:0;var r=0;e.style[t]=n+"px",r=t==="height"?e.offsetHeight:e.offsetWidth,r>n&&(n-=r-n,n<0&&(n=0),e.style[t]=n+"px")}})},"3.7.2",{requires:["dom-core"]});+YUI.add("dom-base",function(e,t){var n=e.config.doc.documentElement,r=e.DOM,i="tagName",s="ownerDocument",o="",u=e.Features.add,a=e.Features.test;e.mix(r,{getText:n.textContent!==undefined?function(e){var t="";return e&&(t=e.textContent),t||""}:function(e){var t="";return e&&(t=e.innerText||e.nodeValue),t||""},setText:n.textContent!==undefined?function(e,t){e&&(e.textContent=t)}:function(e,t){"innerText"in e?e.innerText=t:"nodeValue"in e&&(e.nodeValue=t)},CUSTOM_ATTRIBUTES:n.hasAttribute?{htmlFor:"for",className:"class"}:{"for":"htmlFor","class":"className"},setAttribute:function(e,t,n,i){e&&t&&e.setAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,e.setAttribute(t,n,i))},getAttribute:function(e,t,n){n=n!==undefined?n:2;var i="";return e&&t&&e.getAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,i=e.getAttribute(t,n),i===null&&(i="")),i},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(e){var t="",n;return e&&e[i]&&(n=r.VALUE_GETTERS[e[i].toLowerCase()],n?t=n(e):t=e.value),t===o&&(t=o),typeof t=="string"?t:""},setValue:function(e,t){var n;e&&e[i]&&(n=r.VALUE_SETTERS[e[i].toLowerCase()],n?n(e,t):e.value=t)},creators:{}}),u("value-set","select",{test:function(){var t=e.config.doc.createElement("select");return t.innerHTML="<option>1</option><option>2</option>",t.value="2",t.value&&t.value==="2"}}),a("value-set","select")||(r.VALUE_SETTERS.select=function(e,t){for(var n=0,i=e.getElementsByTagName("option"),s;s=i[n++];)if(r.getValue(s)===t){s.selected=!0;break}}),e.mix(r.VALUE_GETTERS,{button:function(e){return e.attributes&&e.attributes.value?e.attributes.value.value:""}}),e.mix(r.VALUE_SETTERS,{button:function(e,t){var n=e.attributes.value;n||(n=e[s].createAttribute("value"),e.setAttributeNode(n)),n.value=t}}),e.mix(r.VALUE_GETTERS,{option:function(e){var t=e.attributes;return t.value&&t.value.specified?e.value:e.text},select:function(e){var t=e.value,n=e.options;return n&&n.length&&(e.multiple||e.selectedIndex>-1&&(t=r.getValue(n[e.selectedIndex]))),t}});var f,l,c;e.mix(e.DOM,{hasClass:function(t,n){var r=e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)");return r.test(t.className)},addClass:function(t,n){e.DOM.hasClass(t,n)||(t.className=e.Lang.trim([t.className,n].join(" ")))},removeClass:function(t,n){n&&l(t,n)&&(t.className=e.Lang.trim(t.className.replace(e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)")," ")),l(t,n)&&c(t,n))},replaceClass:function(e,t,n){c(e,t),f(e,n)},toggleClass:function(e,t,n){var r=n!==undefined?n:!l(e,t);r?f(e,t):c(e,t)}}),l=e.DOM.hasClass,c=e.DOM.removeClass,f=e.DOM.addClass;var h=/<([a-z]+)/i,r=e.DOM,u=e.Features.add,a=e.Features.test,p={},d=function(t,n){var r=e.config.doc.createElement("div"),i=!0;r.innerHTML=t;if(!r.firstChild||r.firstChild.tagName!==n.toUpperCase())i=!1;return i},v=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,m="<table>",g="</table>";e.mix(e.DOM,{_fragClones:{},_create:function(e,t,n){n=n||"div";var i=r._fragClones[n];return i?i=i.cloneNode(!1):i=r._fragClones[n]=t.createElement(n),i.innerHTML=e,i},_children:function(e,t){var n=0,r=e.children,i,s,o;r&&r.tags&&(t?r=e.children.tags(t):s=r.tags("!").length);if(!r||!r.tags&&t||s){i=r||e.childNodes,r=[];while(o=i[n++])o.nodeType===1&&(!t||t===o.tagName)&&r.push(o)}return r||[]},create:function(t,n){typeof t=="string"&&(t=e.Lang.trim(t)),n=n||e.config.doc;var i=h.exec(t),s=r._create,o=p,u=null,a,f,l;return t!=undefined&&(i&&i[1]&&(a=o[i[1].toLowerCase()],typeof a=="function"?s=a:f=a),l=s(t,n,f).childNodes,l.length===1?u=l[0].parentNode.removeChild(l[0]):l[0]&&l[0].className==="yui3-big-dummy"?l.length===2?u=l[0].nextSibling:(l[0].parentNode.removeChild(l[0]),u=r._nl2frag(l,n)):u=r._nl2frag(l,n)),u},_nl2frag:function(t,n){var r=null,i,s;if(t&&(t.push||t.item)&&t[0]){n=n||t[0].ownerDocument,r=n.createDocumentFragment(),t.item&&(t=e.Array(t,0,!0));for(i=0,s=t.length;i<s;i++)r.appendChild(t[i])}return r},addHTML:function(t,n,i){var s=t.parentNode,o=0,u,a=n,f;if(n!=undefined)if(n.nodeType)f=n;else if(typeof n=="string"||typeof n=="number")a=f=r.create(n);else if(n[0]&&n[0].nodeType){f=e.config.doc.createDocumentFragment();while(u=n[o++])f.appendChild(u)}if(i)if(f&&i.parentNode)i.parentNode.insertBefore(f,i);else switch(i){case"replace":while(t.firstChild)t.removeChild(t.firstChild);f&&t.appendChild(f);break;case"before":f&&s.insertBefore(f,t);break;case"after":f&&(t.nextSibling?s.insertBefore(f,t.nextSibling):s.appendChild(f));break;default:f&&t.appendChild(f)}else f&&t.appendChild(f);return a},wrap:function(t,n){var r=n&&n.nodeType?n:e.DOM.create(n),i=r.getElementsByTagName("*");i.length&&(r=i[i.length-1]),t.parentNode&&t.parentNode.replaceChild(r,t),r.appendChild(t)},unwrap:function(e){var t=e.parentNode,n=t.lastChild,r=e,i;if(t){i=t.parentNode;if(i){e=t.firstChild;while(e!==n)r=e.nextSibling,i.insertBefore(e,t),e=r;i.replaceChild(n,t)}else t.removeChild(e)}}}),u("innerhtml","table",{test:function(){var t=e.config.doc.createElement("table");try{t.innerHTML="<tbody></tbody>"}catch(n){return!1}return t.firstChild&&t.firstChild.nodeName==="TBODY"}}),u("innerhtml-div","tr",{test:function(){return d("<tr></tr>","tr")}}),u("innerhtml-div","script",{test:function(){return d("<script></script>","script")}}),a("innerhtml","table")||(p.tbody=function(t,n){var i=r.create(m+t+g,n),s=e.DOM._children(i,"tbody")[0];return i.children.length>1&&s&&!v.test(t)&&s.parentNode.removeChild(s),i}),a("innerhtml-div","script")||(p.script=function(e,t){var n=t.createElement("div");return n.innerHTML="-"+e,n.removeChild(n.firstChild),n},p.link=p.style=p.script),a("innerhtml-div","tr")||(e.mix(p,{option:function(e,t){return r.create('<select><option class="yui3-big-dummy" selected></option>'+e+"</select>",t)},tr:function(e,t){return r.create("<tbody>"+e+"</tbody>",t)},td:function(e,t){return r.create("<tr>"+e+"</tr>",t)},col:function(e,t){return r.create("<colgroup>"+e+"</colgroup>",t)},tbody:"table"}),e.mix(p,{legend:"fieldset",th:p.td,thead:p.tbody,tfoot:p.tbody,caption:p.tbody,colgroup:p.tbody,optgroup:p.option})),r.creators=p,e.mix(e.DOM,{setWidth:function(t,n){e.DOM._setSize(t,"width",n)},setHeight:function(t,n){e.DOM._setSize(t,"height",n)},_setSize:function(e,t,n){n=n>0?n:0;var r=0;e.style[t]=n+"px",r=t==="height"?e.offsetHeight:e.offsetWidth,r>n&&(n-=r-n,n<0&&(n=0),e.style[t]=n+"px")}})},"3.7.3",{requires:["dom-core"]});
bundle/dom-base/dom-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -687,4 +687,4 @@ }); -}, '3.7.2', {"requires": ["dom-core"]});+}, '3.7.3', {"requires": ["dom-core"]});
bundle/dom-class/dom-class-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -95,4 +95,4 @@ -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-class/dom-class-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-class",function(d){var b,a,c;d.mix(d.DOM,{hasClass:function(g,f){var e=d.DOM._getRegExp("(?:^|\\s+)"+f+"(?:\\s+|$)");return e.test(g.className);},addClass:function(f,e){if(!d.DOM.hasClass(f,e)){f.className=d.Lang.trim([f.className,e].join(" "));}},removeClass:function(f,e){if(e&&a(f,e)){f.className=d.Lang.trim(f.className.replace(d.DOM._getRegExp("(?:^|\\s+)"+e+"(?:\\s+|$)")," "));if(a(f,e)){c(f,e);}}},replaceClass:function(f,e,g){c(f,e);b(f,g);},toggleClass:function(f,e,g){var h=(g!==undefined)?g:!(a(f,e));if(h){b(f,e);}else{c(f,e);}}});a=d.DOM.hasClass;c=d.DOM.removeClass;b=d.DOM.addClass;},"3.7.2",{requires:["dom-core"]});+YUI.add("dom-class",function(d){var b,a,c;d.mix(d.DOM,{hasClass:function(g,f){var e=d.DOM._getRegExp("(?:^|\\s+)"+f+"(?:\\s+|$)");return e.test(g.className);},addClass:function(f,e){if(!d.DOM.hasClass(f,e)){f.className=d.Lang.trim([f.className,e].join(" "));}},removeClass:function(f,e){if(e&&a(f,e)){f.className=d.Lang.trim(f.className.replace(d.DOM._getRegExp("(?:^|\\s+)"+e+"(?:\\s+|$)")," "));if(a(f,e)){c(f,e);}}},replaceClass:function(f,e,g){c(f,e);b(f,g);},toggleClass:function(f,e,g){var h=(g!==undefined)?g:!(a(f,e));if(h){b(f,e);}else{c(f,e);}}});a=d.DOM.hasClass;c=d.DOM.removeClass;b=d.DOM.addClass;},"3.7.3",{requires:["dom-core"]});
bundle/dom-class/dom-class.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -94,4 +94,4 @@ -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-core/dom-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dom-core/dom-core.js", code: [] };-_yuitest_coverage["build/dom-core/dom-core.js"].code=["YUI.add('dom-core', function (Y, NAME) {","","var NODE_TYPE = 'nodeType',"," OWNER_DOCUMENT = 'ownerDocument',"," DOCUMENT_ELEMENT = 'documentElement',"," DEFAULT_VIEW = 'defaultView',"," PARENT_WINDOW = 'parentWindow',"," TAG_NAME = 'tagName',"," PARENT_NODE = 'parentNode',"," PREVIOUS_SIBLING = 'previousSibling',"," NEXT_SIBLING = 'nextSibling',"," CONTAINS = 'contains',"," COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition',"," EMPTY_ARRAY = [],"," "," // IE < 8 throws on node.contains(textNode)"," supportsContainsTextNode = (function() {"," var node = Y.config.doc.createElement('div'),"," textNode = node.appendChild(Y.config.doc.createTextNode('')),"," result = false;"," "," try {"," result = node.contains(textNode);"," } catch(e) {}",""," return result;"," })(),","","/** "," * The DOM utility provides a cross-browser abtraction layer"," * normalizing DOM tasks, and adds extra helper functionality"," * for other common tasks. "," * @module dom"," * @main dom"," * @submodule dom-base"," * @for DOM"," *"," */","","/**"," * Provides DOM helper methods."," * @class DOM"," *"," */"," ","Y_DOM = {"," /**"," * Returns the HTMLElement with the given ID (Wrapper for document.getElementById)."," * @method byId "," * @param {String} id the id attribute "," * @param {Object} doc optional The document to search. Defaults to current document "," * @return {HTMLElement | null} The HTMLElement with the id, or null if none found. "," */"," byId: function(id, doc) {"," // handle dupe IDs and IE name collision"," return Y_DOM.allById(id, doc)[0] || null;"," },",""," getId: function(node) {"," var id;"," // HTMLElement returned from FORM when INPUT name === \"id\""," // IE < 8: HTMLCollection returned when INPUT id === \"id\""," // via both getAttribute and form.id "," if (node.id && !node.id.tagName && !node.id.item) {"," id = node.id;"," } else if (node.attributes && node.attributes.id) {"," id = node.attributes.id.value;"," }",""," return id;"," },",""," setId: function(node, id) {"," if (node.setAttribute) {"," node.setAttribute('id', id);"," } else {"," node.id = id;"," }"," },",""," /*"," * Finds the ancestor of the element."," * @method ancestor"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, the parentNode is returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan "," * @return {HTMLElement | null} The matching DOM node or null if none found. "," */"," ancestor: function(element, fn, testSelf, stopFn) {"," var ret = null;"," if (testSelf) {"," ret = (!fn || fn(element)) ? element : null;",""," }"," return ret || Y_DOM.elementByAxis(element, PARENT_NODE, fn, null, stopFn);"," },",""," /*"," * Finds the ancestors of the element."," * @method ancestors"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, all ancestors are returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan "," * @return {Array} An array containing all matching DOM nodes."," */"," ancestors: function(element, fn, testSelf, stopFn) {"," var ancestor = element,"," ret = [];",""," while ((ancestor = Y_DOM.ancestor(ancestor, fn, testSelf, stopFn))) {"," testSelf = false;"," if (ancestor) {"," ret.unshift(ancestor);",""," if (stopFn && stopFn(ancestor)) {"," return ret;"," }"," }"," }",""," return ret;"," },",""," /**"," * Searches the element by the given axis for the first matching element."," * @method elementByAxis"," * @param {HTMLElement} element The html element."," * @param {String} axis The axis to search (parentNode, nextSibling, previousSibling)."," * @param {Function} fn optional An optional boolean test to apply."," * @param {Boolean} all optional Whether all node types should be returned, or just element nodes."," * The optional function is passed the current HTMLElement being tested as its only argument."," * If no function is given, the first element is returned."," * @return {HTMLElement | null} The matching element or null if none found."," */"," elementByAxis: function(element, axis, fn, all, stopAt) {"," while (element && (element = element[axis])) { // NOTE: assignment"," if ( (all || element[TAG_NAME]) && (!fn || fn(element)) ) {"," return element;"," }",""," if (stopAt && stopAt(element)) {"," return null;"," }"," }"," return null;"," },",""," /**"," * Determines whether or not one HTMLElement is or contains another HTMLElement."," * @method contains"," * @param {HTMLElement} element The containing html element."," * @param {HTMLElement} needle The html element that may be contained."," * @return {Boolean} Whether or not the element is or contains the needle."," */"," contains: function(element, needle) {"," var ret = false;",""," if ( !needle || !element || !needle[NODE_TYPE] || !element[NODE_TYPE]) {"," ret = false;"," } else if (element[CONTAINS] &&"," // IE < 8 throws on node.contains(textNode) so fall back to brute."," // Falling back for other nodeTypes as well."," (needle[NODE_TYPE] === 1 || supportsContainsTextNode)) {"," ret = element[CONTAINS](needle);"," } else if (element[COMPARE_DOCUMENT_POSITION]) {"," // Match contains behavior (node.contains(node) === true)."," // Needed for Firefox < 4."," if (element === needle || !!(element[COMPARE_DOCUMENT_POSITION](needle) & 16)) { "," ret = true;"," }"," } else {"," ret = Y_DOM._bruteContains(element, needle);"," }",""," return ret;"," },",""," /**"," * Determines whether or not the HTMLElement is part of the document."," * @method inDoc"," * @param {HTMLElement} element The containing html element."," * @param {HTMLElement} doc optional The document to check."," * @return {Boolean} Whether or not the element is attached to the document. "," */"," inDoc: function(element, doc) {"," var ret = false,"," rootNode;",""," if (element && element.nodeType) {"," (doc) || (doc = element[OWNER_DOCUMENT]);",""," rootNode = doc[DOCUMENT_ELEMENT];",""," // contains only works with HTML_ELEMENT"," if (rootNode && rootNode.contains && element.tagName) {"," ret = rootNode.contains(element);"," } else {"," ret = Y_DOM.contains(rootNode, element);"," }"," }",""," return ret;",""," },",""," allById: function(id, root) {"," root = root || Y.config.doc;"," var nodes = [],"," ret = [],"," i,"," node;",""," if (root.querySelectorAll) {"," ret = root.querySelectorAll('[id=\"' + id + '\"]');"," } else if (root.all) {"," nodes = root.all(id);",""," if (nodes) {"," // root.all may return HTMLElement or HTMLCollection."," // some elements are also HTMLCollection (FORM, SELECT)."," if (nodes.nodeName) {"," if (nodes.id === id) { // avoid false positive on name"," ret.push(nodes);"," nodes = EMPTY_ARRAY; // done, no need to filter"," } else { // prep for filtering"," nodes = [nodes];"," }"," }",""," if (nodes.length) {"," // filter out matches on node.name"," // and element.id as reference to element with id === 'id'"," for (i = 0; node = nodes[i++];) {"," if (node.id === id || "," (node.attributes && node.attributes.id &&"," node.attributes.id.value === id)) { "," ret.push(node);"," }"," }"," }"," }"," } else {"," ret = [Y_DOM._getDoc(root).getElementById(id)];"," }"," "," return ret;"," },","",""," isWindow: function(obj) {"," return !!(obj && obj.alert && obj.document);"," },",""," _removeChildNodes: function(node) {"," while (node.firstChild) {"," node.removeChild(node.firstChild);"," }"," },",""," siblings: function(node, fn) {"," var nodes = [],"," sibling = node;",""," while ((sibling = sibling[PREVIOUS_SIBLING])) {"," if (sibling[TAG_NAME] && (!fn || fn(sibling))) {"," nodes.unshift(sibling);"," }"," }",""," sibling = node;"," while ((sibling = sibling[NEXT_SIBLING])) {"," if (sibling[TAG_NAME] && (!fn || fn(sibling))) {"," nodes.push(sibling);"," }"," }",""," return nodes;"," },",""," /**"," * Brute force version of contains."," * Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc)."," * @method _bruteContains"," * @private"," * @param {HTMLElement} element The containing html element."," * @param {HTMLElement} needle The html element that may be contained."," * @return {Boolean} Whether or not the element is or contains the needle."," */"," _bruteContains: function(element, needle) {"," while (needle) {"," if (element === needle) {"," return true;"," }"," needle = needle.parentNode;"," }"," return false;"," },","","// TODO: move to Lang?"," /**"," * Memoizes dynamic regular expressions to boost runtime performance. "," * @method _getRegExp"," * @private"," * @param {String} str The string to convert to a regular expression."," * @param {String} flags optional An optinal string of flags."," * @return {RegExp} An instance of RegExp"," */"," _getRegExp: function(str, flags) {"," flags = flags || '';"," Y_DOM._regexCache = Y_DOM._regexCache || {};"," if (!Y_DOM._regexCache[str + flags]) {"," Y_DOM._regexCache[str + flags] = new RegExp(str, flags);"," }"," return Y_DOM._regexCache[str + flags];"," },","","// TODO: make getDoc/Win true privates?"," /**"," * returns the appropriate document."," * @method _getDoc"," * @private"," * @param {HTMLElement} element optional Target element."," * @return {Object} The document for the given element or the default document. "," */"," _getDoc: function(element) {"," var doc = Y.config.doc;"," if (element) {"," doc = (element[NODE_TYPE] === 9) ? element : // element === document"," element[OWNER_DOCUMENT] || // element === DOM node"," element.document || // element === window"," Y.config.doc; // default"," }",""," return doc;"," },",""," /**"," * returns the appropriate window."," * @method _getWin"," * @private"," * @param {HTMLElement} element optional Target element."," * @return {Object} The window for the given element or the default window. "," */"," _getWin: function(element) {"," var doc = Y_DOM._getDoc(element);"," return doc[DEFAULT_VIEW] || doc[PARENT_WINDOW] || Y.config.win;"," },",""," _batch: function(nodes, fn, arg1, arg2, arg3, etc) {"," fn = (typeof fn === 'string') ? Y_DOM[fn] : fn;"," var result,"," i = 0,"," node,"," ret;",""," if (fn && nodes) {"," while ((node = nodes[i++])) {"," result = result = fn.call(Y_DOM, node, arg1, arg2, arg3, etc);"," if (typeof result !== 'undefined') {"," (ret) || (ret = []);"," ret.push(result);"," }"," }"," }",""," return (typeof ret !== 'undefined') ? ret : nodes;"," },",""," generateID: function(el) {"," var id = el.id;",""," if (!id) {"," id = Y.stamp(el);"," el.id = id; "," } ",""," return id; "," }","};","","","Y.DOM = Y_DOM;","","","}, '3.7.2', {\"requires\": [\"oop\", \"features\"]});"];+_yuitest_coverage["build/dom-core/dom-core.js"].code=["YUI.add('dom-core', function (Y, NAME) {","","var NODE_TYPE = 'nodeType',"," OWNER_DOCUMENT = 'ownerDocument',"," DOCUMENT_ELEMENT = 'documentElement',"," DEFAULT_VIEW = 'defaultView',"," PARENT_WINDOW = 'parentWindow',"," TAG_NAME = 'tagName',"," PARENT_NODE = 'parentNode',"," PREVIOUS_SIBLING = 'previousSibling',"," NEXT_SIBLING = 'nextSibling',"," CONTAINS = 'contains',"," COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition',"," EMPTY_ARRAY = [],"," "," // IE < 8 throws on node.contains(textNode)"," supportsContainsTextNode = (function() {"," var node = Y.config.doc.createElement('div'),"," textNode = node.appendChild(Y.config.doc.createTextNode('')),"," result = false;"," "," try {"," result = node.contains(textNode);"," } catch(e) {}",""," return result;"," })(),","","/** "," * The DOM utility provides a cross-browser abtraction layer"," * normalizing DOM tasks, and adds extra helper functionality"," * for other common tasks. "," * @module dom"," * @main dom"," * @submodule dom-base"," * @for DOM"," *"," */","","/**"," * Provides DOM helper methods."," * @class DOM"," *"," */"," ","Y_DOM = {"," /**"," * Returns the HTMLElement with the given ID (Wrapper for document.getElementById)."," * @method byId "," * @param {String} id the id attribute "," * @param {Object} doc optional The document to search. Defaults to current document "," * @return {HTMLElement | null} The HTMLElement with the id, or null if none found. "," */"," byId: function(id, doc) {"," // handle dupe IDs and IE name collision"," return Y_DOM.allById(id, doc)[0] || null;"," },",""," getId: function(node) {"," var id;"," // HTMLElement returned from FORM when INPUT name === \"id\""," // IE < 8: HTMLCollection returned when INPUT id === \"id\""," // via both getAttribute and form.id "," if (node.id && !node.id.tagName && !node.id.item) {"," id = node.id;"," } else if (node.attributes && node.attributes.id) {"," id = node.attributes.id.value;"," }",""," return id;"," },",""," setId: function(node, id) {"," if (node.setAttribute) {"," node.setAttribute('id', id);"," } else {"," node.id = id;"," }"," },",""," /*"," * Finds the ancestor of the element."," * @method ancestor"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, the parentNode is returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan "," * @return {HTMLElement | null} The matching DOM node or null if none found. "," */"," ancestor: function(element, fn, testSelf, stopFn) {"," var ret = null;"," if (testSelf) {"," ret = (!fn || fn(element)) ? element : null;",""," }"," return ret || Y_DOM.elementByAxis(element, PARENT_NODE, fn, null, stopFn);"," },",""," /*"," * Finds the ancestors of the element."," * @method ancestors"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, all ancestors are returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan "," * @return {Array} An array containing all matching DOM nodes."," */"," ancestors: function(element, fn, testSelf, stopFn) {"," var ancestor = element,"," ret = [];",""," while ((ancestor = Y_DOM.ancestor(ancestor, fn, testSelf, stopFn))) {"," testSelf = false;"," if (ancestor) {"," ret.unshift(ancestor);",""," if (stopFn && stopFn(ancestor)) {"," return ret;"," }"," }"," }",""," return ret;"," },",""," /**"," * Searches the element by the given axis for the first matching element."," * @method elementByAxis"," * @param {HTMLElement} element The html element."," * @param {String} axis The axis to search (parentNode, nextSibling, previousSibling)."," * @param {Function} fn optional An optional boolean test to apply."," * @param {Boolean} all optional Whether all node types should be returned, or just element nodes."," * The optional function is passed the current HTMLElement being tested as its only argument."," * If no function is given, the first element is returned."," * @return {HTMLElement | null} The matching element or null if none found."," */"," elementByAxis: function(element, axis, fn, all, stopAt) {"," while (element && (element = element[axis])) { // NOTE: assignment"," if ( (all || element[TAG_NAME]) && (!fn || fn(element)) ) {"," return element;"," }",""," if (stopAt && stopAt(element)) {"," return null;"," }"," }"," return null;"," },",""," /**"," * Determines whether or not one HTMLElement is or contains another HTMLElement."," * @method contains"," * @param {HTMLElement} element The containing html element."," * @param {HTMLElement} needle The html element that may be contained."," * @return {Boolean} Whether or not the element is or contains the needle."," */"," contains: function(element, needle) {"," var ret = false;",""," if ( !needle || !element || !needle[NODE_TYPE] || !element[NODE_TYPE]) {"," ret = false;"," } else if (element[CONTAINS] &&"," // IE < 8 throws on node.contains(textNode) so fall back to brute."," // Falling back for other nodeTypes as well."," (needle[NODE_TYPE] === 1 || supportsContainsTextNode)) {"," ret = element[CONTAINS](needle);"," } else if (element[COMPARE_DOCUMENT_POSITION]) {"," // Match contains behavior (node.contains(node) === true)."," // Needed for Firefox < 4."," if (element === needle || !!(element[COMPARE_DOCUMENT_POSITION](needle) & 16)) { "," ret = true;"," }"," } else {"," ret = Y_DOM._bruteContains(element, needle);"," }",""," return ret;"," },",""," /**"," * Determines whether or not the HTMLElement is part of the document."," * @method inDoc"," * @param {HTMLElement} element The containing html element."," * @param {HTMLElement} doc optional The document to check."," * @return {Boolean} Whether or not the element is attached to the document. "," */"," inDoc: function(element, doc) {"," var ret = false,"," rootNode;",""," if (element && element.nodeType) {"," (doc) || (doc = element[OWNER_DOCUMENT]);",""," rootNode = doc[DOCUMENT_ELEMENT];",""," // contains only works with HTML_ELEMENT"," if (rootNode && rootNode.contains && element.tagName) {"," ret = rootNode.contains(element);"," } else {"," ret = Y_DOM.contains(rootNode, element);"," }"," }",""," return ret;",""," },",""," allById: function(id, root) {"," root = root || Y.config.doc;"," var nodes = [],"," ret = [],"," i,"," node;",""," if (root.querySelectorAll) {"," ret = root.querySelectorAll('[id=\"' + id + '\"]');"," } else if (root.all) {"," nodes = root.all(id);",""," if (nodes) {"," // root.all may return HTMLElement or HTMLCollection."," // some elements are also HTMLCollection (FORM, SELECT)."," if (nodes.nodeName) {"," if (nodes.id === id) { // avoid false positive on name"," ret.push(nodes);"," nodes = EMPTY_ARRAY; // done, no need to filter"," } else { // prep for filtering"," nodes = [nodes];"," }"," }",""," if (nodes.length) {"," // filter out matches on node.name"," // and element.id as reference to element with id === 'id'"," for (i = 0; node = nodes[i++];) {"," if (node.id === id || "," (node.attributes && node.attributes.id &&"," node.attributes.id.value === id)) { "," ret.push(node);"," }"," }"," }"," }"," } else {"," ret = [Y_DOM._getDoc(root).getElementById(id)];"," }"," "," return ret;"," },","",""," isWindow: function(obj) {"," return !!(obj && obj.scrollTo && obj.document);"," },",""," _removeChildNodes: function(node) {"," while (node.firstChild) {"," node.removeChild(node.firstChild);"," }"," },",""," siblings: function(node, fn) {"," var nodes = [],"," sibling = node;",""," while ((sibling = sibling[PREVIOUS_SIBLING])) {"," if (sibling[TAG_NAME] && (!fn || fn(sibling))) {"," nodes.unshift(sibling);"," }"," }",""," sibling = node;"," while ((sibling = sibling[NEXT_SIBLING])) {"," if (sibling[TAG_NAME] && (!fn || fn(sibling))) {"," nodes.push(sibling);"," }"," }",""," return nodes;"," },",""," /**"," * Brute force version of contains."," * Used for browsers without contains support for non-HTMLElement Nodes (textNodes, etc)."," * @method _bruteContains"," * @private"," * @param {HTMLElement} element The containing html element."," * @param {HTMLElement} needle The html element that may be contained."," * @return {Boolean} Whether or not the element is or contains the needle."," */"," _bruteContains: function(element, needle) {"," while (needle) {"," if (element === needle) {"," return true;"," }"," needle = needle.parentNode;"," }"," return false;"," },","","// TODO: move to Lang?"," /**"," * Memoizes dynamic regular expressions to boost runtime performance. "," * @method _getRegExp"," * @private"," * @param {String} str The string to convert to a regular expression."," * @param {String} flags optional An optinal string of flags."," * @return {RegExp} An instance of RegExp"," */"," _getRegExp: function(str, flags) {"," flags = flags || '';"," Y_DOM._regexCache = Y_DOM._regexCache || {};"," if (!Y_DOM._regexCache[str + flags]) {"," Y_DOM._regexCache[str + flags] = new RegExp(str, flags);"," }"," return Y_DOM._regexCache[str + flags];"," },","","// TODO: make getDoc/Win true privates?"," /**"," * returns the appropriate document."," * @method _getDoc"," * @private"," * @param {HTMLElement} element optional Target element."," * @return {Object} The document for the given element or the default document. "," */"," _getDoc: function(element) {"," var doc = Y.config.doc;"," if (element) {"," doc = (element[NODE_TYPE] === 9) ? element : // element === document"," element[OWNER_DOCUMENT] || // element === DOM node"," element.document || // element === window"," Y.config.doc; // default"," }",""," return doc;"," },",""," /**"," * returns the appropriate window."," * @method _getWin"," * @private"," * @param {HTMLElement} element optional Target element."," * @return {Object} The window for the given element or the default window. "," */"," _getWin: function(element) {"," var doc = Y_DOM._getDoc(element);"," return doc[DEFAULT_VIEW] || doc[PARENT_WINDOW] || Y.config.win;"," },",""," _batch: function(nodes, fn, arg1, arg2, arg3, etc) {"," fn = (typeof fn === 'string') ? Y_DOM[fn] : fn;"," var result,"," i = 0,"," node,"," ret;",""," if (fn && nodes) {"," while ((node = nodes[i++])) {"," result = result = fn.call(Y_DOM, node, arg1, arg2, arg3, etc);"," if (typeof result !== 'undefined') {"," (ret) || (ret = []);"," ret.push(result);"," }"," }"," }",""," return (typeof ret !== 'undefined') ? ret : nodes;"," },",""," generateID: function(el) {"," var id = el.id;",""," if (!id) {"," id = Y.stamp(el);"," el.id = id; "," } ",""," return id; "," }","};","","","Y.DOM = Y_DOM;","","","}, '3.7.3', {\"requires\": [\"oop\", \"features\"]});"]; _yuitest_coverage["build/dom-core/dom-core.js"].lines = {"1":0,"3":0,"18":0,"22":0,"23":0,"26":0,"56":0,"60":0,"64":0,"65":0,"66":0,"67":0,"70":0,"74":0,"75":0,"77":0,"92":0,"93":0,"94":0,"97":0,"111":0,"114":0,"115":0,"116":0,"117":0,"119":0,"120":0,"125":0,"140":0,"141":0,"142":0,"145":0,"146":0,"149":0,"160":0,"162":0,"163":0,"164":0,"168":0,"169":0,"172":0,"173":0,"176":0,"179":0,"190":0,"193":0,"194":0,"196":0,"199":0,"200":0,"202":0,"206":0,"211":0,"212":0,"217":0,"218":0,"219":0,"220":0,"222":0,"225":0,"226":0,"227":0,"228":0,"230":0,"234":0,"237":0,"238":0,"241":0,"247":0,"250":0,"255":0,"259":0,"260":0,"265":0,"268":0,"269":0,"270":0,"274":0,"275":0,"276":0,"277":0,"281":0,"294":0,"295":0,"296":0,"298":0,"300":0,"313":0,"314":0,"315":0,"316":0,"318":0,"330":0,"331":0,"332":0,"338":0,"349":0,"350":0,"354":0,"355":0,"360":0,"361":0,"362":0,"363":0,"364":0,"365":0,"370":0,"374":0,"376":0,"377":0,"378":0,"381":0,"386":0}; _yuitest_coverage["build/dom-core/dom-core.js"].functions = {"(anonymous 2):17":0,"byId:54":0,"getId:59":0,"setId:73":0,"ancestor:91":0,"ancestors:110":0,"elementByAxis:139":0,"contains:159":0,"inDoc:189":0,"allById:210":0,"isWindow:254":0,"_removeChildNodes:258":0,"siblings:264":0,"_bruteContains:293":0,"_getRegExp:312":0,"_getDoc:329":0,"_getWin:348":0,"_batch:353":0,"generateID:373":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dom-core/dom-core.js"].coveredLines = 113;@@ -374,7 +374,7 @@ isWindow: function(obj) { _yuitest_coverfunc("build/dom-core/dom-core.js", "isWindow", 254); _yuitest_coverline("build/dom-core/dom-core.js", 255);-return !!(obj && obj.alert && obj.document);+return !!(obj && obj.scrollTo && obj.document); }, _removeChildNodes: function(node) {@@ -558,4 +558,4 @@ Y.DOM = Y_DOM; -}, '3.7.2', {"requires": ["oop", "features"]});+}, '3.7.3', {"requires": ["oop", "features"]});
bundle/dom-core/dom-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -258,7 +258,7 @@ isWindow: function(obj) {- return !!(obj && obj.alert && obj.document);+ return !!(obj && obj.scrollTo && obj.document); }, _removeChildNodes: function(node) {@@ -392,4 +392,4 @@ Y.DOM = Y_DOM; -}, '3.7.2', {"requires": ["oop", "features"]});+}, '3.7.3', {"requires": ["oop", "features"]});
bundle/dom-core/dom-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-core",function(e,t){var n="nodeType",r="ownerDocument",i="documentElement",s="defaultView",o="parentWindow",u="tagName",a="parentNode",f="previousSibling",l="nextSibling",c="contains",h="compareDocumentPosition",p=[],d=function(){var t=e.config.doc.createElement("div"),n=t.appendChild(e.config.doc.createTextNode("")),r=!1;try{r=t.contains(n)}catch(i){}return r}(),v={byId:function(e,t){return v.allById(e,t)[0]||null},getId:function(e){var t;return e.id&&!e.id.tagName&&!e.id.item?t=e.id:e.attributes&&e.attributes.id&&(t=e.attributes.id.value),t},setId:function(e,t){e.setAttribute?e.setAttribute("id",t):e.id=t},ancestor:function(e,t,n,r){var i=null;return n&&(i=!t||t(e)?e:null),i||v.elementByAxis(e,a,t,null,r)},ancestors:function(e,t,n,r){var i=e,s=[];while(i=v.ancestor(i,t,n,r)){n=!1;if(i){s.unshift(i);if(r&&r(i))return s}}return s},elementByAxis:function(e,t,n,r,i){while(e&&(e=e[t])){if((r||e[u])&&(!n||n(e)))return e;if(i&&i(e))return null}return null},contains:function(e,t){var r=!1;if(!t||!e||!t[n]||!e[n])r=!1;else if(e[c]&&(t[n]===1||d))r=e[c](t);else if(e[h]){if(e===t||!!(e[h](t)&16))r=!0}else r=v._bruteContains(e,t);return r},inDoc:function(e,t){var n=!1,s;return e&&e.nodeType&&(t||(t=e[r]),s=t[i],s&&s.contains&&e.tagName?n=s.contains(e):n=v.contains(s,e)),n},allById:function(t,n){n=n||e.config.doc;var r=[],i=[],s,o;if(n.querySelectorAll)i=n.querySelectorAll('[id="'+t+'"]');else if(n.all){r=n.all(t);if(r){r.nodeName&&(r.id===t?(i.push(r),r=p):r=[r]);if(r.length)for(s=0;o=r[s++];)(o.id===t||o.attributes&&o.attributes.id&&o.attributes.id.value===t)&&i.push(o)}}else i=[v._getDoc(n).getElementById(t)];return i},isWindow:function(e){return!!(e&&e.alert&&e.document)},_removeChildNodes:function(e){while(e.firstChild)e.removeChild(e.firstChild)},siblings:function(e,t){var n=[],r=e;while(r=r[f])r[u]&&(!t||t(r))&&n.unshift(r);r=e;while(r=r[l])r[u]&&(!t||t(r))&&n.push(r);return n},_bruteContains:function(e,t){while(t){if(e===t)return!0;t=t.parentNode}return!1},_getRegExp:function(e,t){return t=t||"",v._regexCache=v._regexCache||{},v._regexCache[e+t]||(v._regexCache[e+t]=new RegExp(e,t)),v._regexCache[e+t]},_getDoc:function(t){var i=e.config.doc;return t&&(i=t[n]===9?t:t[r]||t.document||e.config.doc),i},_getWin:function(t){var n=v._getDoc(t);return n[s]||n[o]||e.config.win},_batch:function(e,t,n,r,i,s){t=typeof t=="string"?v[t]:t;var o,u=0,a,f;if(t&&e)while(a=e[u++])o=o=t.call(v,a,n,r,i,s),typeof o!="undefined"&&(f||(f=[]),f.push(o));return typeof f!="undefined"?f:e},generateID:function(t){var n=t.id;return n||(n=e.stamp(t),t.id=n),n}};e.DOM=v},"3.7.2",{requires:["oop","features"]});+YUI.add("dom-core",function(e,t){var n="nodeType",r="ownerDocument",i="documentElement",s="defaultView",o="parentWindow",u="tagName",a="parentNode",f="previousSibling",l="nextSibling",c="contains",h="compareDocumentPosition",p=[],d=function(){var t=e.config.doc.createElement("div"),n=t.appendChild(e.config.doc.createTextNode("")),r=!1;try{r=t.contains(n)}catch(i){}return r}(),v={byId:function(e,t){return v.allById(e,t)[0]||null},getId:function(e){var t;return e.id&&!e.id.tagName&&!e.id.item?t=e.id:e.attributes&&e.attributes.id&&(t=e.attributes.id.value),t},setId:function(e,t){e.setAttribute?e.setAttribute("id",t):e.id=t},ancestor:function(e,t,n,r){var i=null;return n&&(i=!t||t(e)?e:null),i||v.elementByAxis(e,a,t,null,r)},ancestors:function(e,t,n,r){var i=e,s=[];while(i=v.ancestor(i,t,n,r)){n=!1;if(i){s.unshift(i);if(r&&r(i))return s}}return s},elementByAxis:function(e,t,n,r,i){while(e&&(e=e[t])){if((r||e[u])&&(!n||n(e)))return e;if(i&&i(e))return null}return null},contains:function(e,t){var r=!1;if(!t||!e||!t[n]||!e[n])r=!1;else if(e[c]&&(t[n]===1||d))r=e[c](t);else if(e[h]){if(e===t||!!(e[h](t)&16))r=!0}else r=v._bruteContains(e,t);return r},inDoc:function(e,t){var n=!1,s;return e&&e.nodeType&&(t||(t=e[r]),s=t[i],s&&s.contains&&e.tagName?n=s.contains(e):n=v.contains(s,e)),n},allById:function(t,n){n=n||e.config.doc;var r=[],i=[],s,o;if(n.querySelectorAll)i=n.querySelectorAll('[id="'+t+'"]');else if(n.all){r=n.all(t);if(r){r.nodeName&&(r.id===t?(i.push(r),r=p):r=[r]);if(r.length)for(s=0;o=r[s++];)(o.id===t||o.attributes&&o.attributes.id&&o.attributes.id.value===t)&&i.push(o)}}else i=[v._getDoc(n).getElementById(t)];return i},isWindow:function(e){return!!(e&&e.scrollTo&&e.document)},_removeChildNodes:function(e){while(e.firstChild)e.removeChild(e.firstChild)},siblings:function(e,t){var n=[],r=e;while(r=r[f])r[u]&&(!t||t(r))&&n.unshift(r);r=e;while(r=r[l])r[u]&&(!t||t(r))&&n.push(r);return n},_bruteContains:function(e,t){while(t){if(e===t)return!0;t=t.parentNode}return!1},_getRegExp:function(e,t){return t=t||"",v._regexCache=v._regexCache||{},v._regexCache[e+t]||(v._regexCache[e+t]=new RegExp(e,t)),v._regexCache[e+t]},_getDoc:function(t){var i=e.config.doc;return t&&(i=t[n]===9?t:t[r]||t.document||e.config.doc),i},_getWin:function(t){var n=v._getDoc(t);return n[s]||n[o]||e.config.win},_batch:function(e,t,n,r,i,s){t=typeof t=="string"?v[t]:t;var o,u=0,a,f;if(t&&e)while(a=e[u++])o=o=t.call(v,a,n,r,i,s),typeof o!="undefined"&&(f||(f=[]),f.push(o));return typeof f!="undefined"?f:e},generateID:function(t){var n=t.id;return n||(n=e.stamp(t),t.id=n),n}};e.DOM=v},"3.7.3",{requires:["oop","features"]});
bundle/dom-core/dom-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -258,7 +258,7 @@ isWindow: function(obj) {- return !!(obj && obj.alert && obj.document);+ return !!(obj && obj.scrollTo && obj.document); }, _removeChildNodes: function(node) {@@ -392,4 +392,4 @@ Y.DOM = Y_DOM; -}, '3.7.2', {"requires": ["oop", "features"]});+}, '3.7.3', {"requires": ["oop", "features"]});
bundle/dom-create/dom-create-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -282,4 +282,4 @@ Y_DOM.creators = creators; -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-create/dom-create-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-create",function(a){var c=/<([a-z]+)/i,d=a.DOM,i=a.Features.add,g=a.Features.test,f={},e=function(m,k){var n=a.config.doc.createElement("div"),l=true;n.innerHTML=m;if(!n.firstChild||n.firstChild.tagName!==k.toUpperCase()){l=false;}return l;},j=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,b="<table>",h="</table>";a.mix(a.DOM,{_fragClones:{},_create:function(l,m,k){k=k||"div";var n=d._fragClones[k];if(n){n=n.cloneNode(false);}else{n=d._fragClones[k]=m.createElement(k);}n.innerHTML=l;return n;},create:function(p,s){if(typeof p==="string"){p=a.Lang.trim(p);}s=s||a.config.doc;var o=c.exec(p),q=d._create,l=f,r=null,n,t,k;if(p!=undefined){if(o&&o[1]){n=l[o[1].toLowerCase()];if(typeof n==="function"){q=n;}else{t=n;}}k=q(p,s,t).childNodes;if(k.length===1){r=k[0].parentNode.removeChild(k[0]);}else{if(k[0]&&k[0].className==="yui3-big-dummy"){if(k.length===2){r=k[0].nextSibling;}else{k[0].parentNode.removeChild(k[0]);r=d._nl2frag(k,s);}}else{r=d._nl2frag(k,s);}}}return r;},_nl2frag:function(l,o){var m=null,n,k;if(l&&(l.push||l.item)&&l[0]){o=o||l[0].ownerDocument;m=o.createDocumentFragment();if(l.item){l=a.Array(l,0,true);}for(n=0,k=l.length;n<k;n++){m.appendChild(l[n]);}}return m;},addHTML:function(r,q,m){var k=r.parentNode,o=0,p,l=q,n;if(q!=undefined){if(q.nodeType){n=q;}else{if(typeof q=="string"||typeof q=="number"){l=n=d.create(q);}else{if(q[0]&&q[0].nodeType){n=a.config.doc.createDocumentFragment();while((p=q[o++])){n.appendChild(p);}}}}}if(m){if(m.nodeType){m.parentNode.insertBefore(n,m);}else{switch(m){case"replace":while(r.firstChild){r.removeChild(r.firstChild);}if(n){r.appendChild(n);}break;case"before":k.insertBefore(n,r);break;case"after":if(r.nextSibling){k.insertBefore(n,r.nextSibling);}else{k.appendChild(n);}break;default:r.appendChild(n);}}}else{if(n){r.appendChild(n);}}return l;}});i("innerhtml","table",{test:function(){var k=a.config.doc.createElement("table");try{k.innerHTML="<tbody></tbody>";}catch(l){return false;}return(k.firstChild&&k.firstChild.nodeName==="TBODY");}});i("innerhtml-div","tr",{test:function(){return e("<tr></tr>","tr");}});i("innerhtml-div","script",{test:function(){return e("<script><\/script>","script");}});if(!g("innerhtml","table")){f.tbody=function(l,m){var n=d.create(b+l+h,m),k=n.children.tags("tbody")[0];if(n.children.length>1&&k&&!j.test(l)){k.parentNode.removeChild(k);}return n;};}if(!g("innerhtml-div","script")){f.script=function(k,l){var m=l.createElement("div");m.innerHTML="-"+k;m.removeChild(m.firstChild);return m;};f.link=f.style=f.script;}if(!g("innerhtml-div","tr")){a.mix(f,{option:function(k,l){return d.create('<select><option class="yui3-big-dummy" selected></option>'+k+"</select>",l);},tr:function(k,l){return d.create("<tbody>"+k+"</tbody>",l);},td:function(k,l){return d.create("<tr>"+k+"</tr>",l);},col:function(k,l){return d.create("<colgroup>"+k+"</colgroup>",l);},tbody:"table"});a.mix(f,{legend:"fieldset",th:f.td,thead:f.tbody,tfoot:f.tbody,caption:f.tbody,colgroup:f.tbody,optgroup:f.option});}d.creators=f;},"3.7.2",{requires:["dom-core"]});+YUI.add("dom-create",function(a){var c=/<([a-z]+)/i,d=a.DOM,i=a.Features.add,g=a.Features.test,f={},e=function(m,k){var n=a.config.doc.createElement("div"),l=true;n.innerHTML=m;if(!n.firstChild||n.firstChild.tagName!==k.toUpperCase()){l=false;}return l;},j=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,b="<table>",h="</table>";a.mix(a.DOM,{_fragClones:{},_create:function(l,m,k){k=k||"div";var n=d._fragClones[k];if(n){n=n.cloneNode(false);}else{n=d._fragClones[k]=m.createElement(k);}n.innerHTML=l;return n;},create:function(p,s){if(typeof p==="string"){p=a.Lang.trim(p);}s=s||a.config.doc;var o=c.exec(p),q=d._create,l=f,r=null,n,t,k;if(p!=undefined){if(o&&o[1]){n=l[o[1].toLowerCase()];if(typeof n==="function"){q=n;}else{t=n;}}k=q(p,s,t).childNodes;if(k.length===1){r=k[0].parentNode.removeChild(k[0]);}else{if(k[0]&&k[0].className==="yui3-big-dummy"){if(k.length===2){r=k[0].nextSibling;}else{k[0].parentNode.removeChild(k[0]);r=d._nl2frag(k,s);}}else{r=d._nl2frag(k,s);}}}return r;},_nl2frag:function(l,o){var m=null,n,k;if(l&&(l.push||l.item)&&l[0]){o=o||l[0].ownerDocument;m=o.createDocumentFragment();if(l.item){l=a.Array(l,0,true);}for(n=0,k=l.length;n<k;n++){m.appendChild(l[n]);}}return m;},addHTML:function(r,q,m){var k=r.parentNode,o=0,p,l=q,n;if(q!=undefined){if(q.nodeType){n=q;}else{if(typeof q=="string"||typeof q=="number"){l=n=d.create(q);}else{if(q[0]&&q[0].nodeType){n=a.config.doc.createDocumentFragment();while((p=q[o++])){n.appendChild(p);}}}}}if(m){if(m.nodeType){m.parentNode.insertBefore(n,m);}else{switch(m){case"replace":while(r.firstChild){r.removeChild(r.firstChild);}if(n){r.appendChild(n);}break;case"before":k.insertBefore(n,r);break;case"after":if(r.nextSibling){k.insertBefore(n,r.nextSibling);}else{k.appendChild(n);}break;default:r.appendChild(n);}}}else{if(n){r.appendChild(n);}}return l;}});i("innerhtml","table",{test:function(){var k=a.config.doc.createElement("table");try{k.innerHTML="<tbody></tbody>";}catch(l){return false;}return(k.firstChild&&k.firstChild.nodeName==="TBODY");}});i("innerhtml-div","tr",{test:function(){return e("<tr></tr>","tr");}});i("innerhtml-div","script",{test:function(){return e("<script><\/script>","script");}});if(!g("innerhtml","table")){f.tbody=function(l,m){var n=d.create(b+l+h,m),k=n.children.tags("tbody")[0];if(n.children.length>1&&k&&!j.test(l)){k.parentNode.removeChild(k);}return n;};}if(!g("innerhtml-div","script")){f.script=function(k,l){var m=l.createElement("div");m.innerHTML="-"+k;m.removeChild(m.firstChild);return m;};f.link=f.style=f.script;}if(!g("innerhtml-div","tr")){a.mix(f,{option:function(k,l){return d.create('<select><option class="yui3-big-dummy" selected></option>'+k+"</select>",l);},tr:function(k,l){return d.create("<tbody>"+k+"</tbody>",l);},td:function(k,l){return d.create("<tr>"+k+"</tr>",l);},col:function(k,l){return d.create("<colgroup>"+k+"</colgroup>",l);},tbody:"table"});a.mix(f,{legend:"fieldset",th:f.td,thead:f.tbody,tfoot:f.tbody,caption:f.tbody,colgroup:f.tbody,optgroup:f.option});}d.creators=f;},"3.7.3",{requires:["dom-core"]});
bundle/dom-create/dom-create.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -281,4 +281,4 @@ Y_DOM.creators = creators; -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-deprecated/dom-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dom-deprecated/dom-deprecated.js", code: [] };-_yuitest_coverage["build/dom-deprecated/dom-deprecated.js"].code=["YUI.add('dom-deprecated', function (Y, NAME) {","","","Y.mix(Y.DOM, {"," // @deprecated"," children: function(node, tag) {"," var ret = [];"," if (node) {"," tag = tag || '*';"," ret = Y.Selector.query('> ' + tag, node); "," }"," return ret;"," },",""," // @deprecated"," firstByTag: function(tag, root) {"," var ret;"," root = root || Y.config.doc;",""," if (tag && root.getElementsByTagName) {"," ret = root.getElementsByTagName(tag)[0];"," }",""," return ret || null;"," },",""," /*"," * Finds the previous sibling of the element."," * @method previous"," * @deprecated Use elementByAxis"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, the first sibling is returned."," * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes."," * @return {HTMLElement | null} The matching DOM node or null if none found. "," */"," previous: function(element, fn, all) {"," return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);"," },",""," /*"," * Finds the next sibling of the element."," * @method next"," * @deprecated Use elementByAxis"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, the first sibling is returned."," * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes."," * @return {HTMLElement | null} The matching DOM node or null if none found. "," */"," next: function(element, fn, all) {"," return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);"," }","","});","","","","}, '3.7.2', {\"requires\": [\"dom-base\"]});"];+_yuitest_coverage["build/dom-deprecated/dom-deprecated.js"].code=["YUI.add('dom-deprecated', function (Y, NAME) {","","","Y.mix(Y.DOM, {"," // @deprecated"," children: function(node, tag) {"," var ret = [];"," if (node) {"," tag = tag || '*';"," ret = Y.Selector.query('> ' + tag, node); "," }"," return ret;"," },",""," // @deprecated"," firstByTag: function(tag, root) {"," var ret;"," root = root || Y.config.doc;",""," if (tag && root.getElementsByTagName) {"," ret = root.getElementsByTagName(tag)[0];"," }",""," return ret || null;"," },",""," /*"," * Finds the previous sibling of the element."," * @method previous"," * @deprecated Use elementByAxis"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, the first sibling is returned."," * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes."," * @return {HTMLElement | null} The matching DOM node or null if none found. "," */"," previous: function(element, fn, all) {"," return Y.DOM.elementByAxis(element, 'previousSibling', fn, all);"," },",""," /*"," * Finds the next sibling of the element."," * @method next"," * @deprecated Use elementByAxis"," * @param {HTMLElement} element The html element."," * @param {Function} fn optional An optional boolean test to apply."," * The optional function is passed the current DOM node being tested as its only argument."," * If no function is given, the first sibling is returned."," * @param {Boolean} all optional Whether all node types should be scanned, or just element nodes."," * @return {HTMLElement | null} The matching DOM node or null if none found. "," */"," next: function(element, fn, all) {"," return Y.DOM.elementByAxis(element, 'nextSibling', fn, all);"," }","","});","","","","}, '3.7.3', {\"requires\": [\"dom-base\"]});"]; _yuitest_coverage["build/dom-deprecated/dom-deprecated.js"].lines = {"1":0,"4":0,"7":0,"8":0,"9":0,"10":0,"12":0,"17":0,"18":0,"20":0,"21":0,"24":0,"39":0,"54":0}; _yuitest_coverage["build/dom-deprecated/dom-deprecated.js"].functions = {"children:6":0,"firstByTag:16":0,"previous:38":0,"next:53":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dom-deprecated/dom-deprecated.js"].coveredLines = 14;@@ -116,4 +116,4 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/dom-deprecated/dom-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -64,4 +64,4 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/dom-deprecated/dom-deprecated-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-deprecated",function(e,t){e.mix(e.DOM,{children:function(t,n){var r=[];return t&&(n=n||"*",r=e.Selector.query("> "+n,t)),r},firstByTag:function(t,n){var r;return n=n||e.config.doc,t&&n.getElementsByTagName&&(r=n.getElementsByTagName(t)[0]),r||null},previous:function(t,n,r){return e.DOM.elementByAxis(t,"previousSibling",n,r)},next:function(t,n,r){return e.DOM.elementByAxis(t,"nextSibling",n,r)}})},"3.7.2",{requires:["dom-base"]});+YUI.add("dom-deprecated",function(e,t){e.mix(e.DOM,{children:function(t,n){var r=[];return t&&(n=n||"*",r=e.Selector.query("> "+n,t)),r},firstByTag:function(t,n){var r;return n=n||e.config.doc,t&&n.getElementsByTagName&&(r=n.getElementsByTagName(t)[0]),r||null},previous:function(t,n,r){return e.DOM.elementByAxis(t,"previousSibling",n,r)},next:function(t,n,r){return e.DOM.elementByAxis(t,"nextSibling",n,r)}})},"3.7.3",{requires:["dom-base"]});
bundle/dom-deprecated/dom-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -64,4 +64,4 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/dom-screen/dom-screen-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dom-screen/dom-screen.js", code: [] };-_yuitest_coverage["build/dom-screen/dom-screen.js"].code=["YUI.add('dom-screen', function (Y, NAME) {","","(function(Y) {","","/**"," * Adds position and region management functionality to DOM."," * @module dom"," * @submodule dom-screen"," * @for DOM"," */","","var DOCUMENT_ELEMENT = 'documentElement',"," COMPAT_MODE = 'compatMode',"," POSITION = 'position',"," FIXED = 'fixed',"," RELATIVE = 'relative',"," LEFT = 'left',"," TOP = 'top',"," _BACK_COMPAT = 'BackCompat',"," MEDIUM = 'medium',"," BORDER_LEFT_WIDTH = 'borderLeftWidth',"," BORDER_TOP_WIDTH = 'borderTopWidth',"," GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',"," GET_COMPUTED_STYLE = 'getComputedStyle',",""," Y_DOM = Y.DOM,",""," // TODO: how about thead/tbody/tfoot/tr?"," // TODO: does caption matter?"," RE_TABLE = /^t(?:able|d|h)$/i,",""," SCROLL_NODE;","","if (Y.UA.ie) {"," if (Y.config.doc[COMPAT_MODE] !== 'BackCompat') {"," SCROLL_NODE = DOCUMENT_ELEMENT; "," } else {"," SCROLL_NODE = 'body';"," }","}","","Y.mix(Y_DOM, {"," /**"," * Returns the inner height of the viewport (exludes scrollbar). "," * @method winHeight"," * @return {Number} The current height of the viewport."," */"," winHeight: function(node) {"," var h = Y_DOM._getWinSize(node).height;"," return h;"," },",""," /**"," * Returns the inner width of the viewport (exludes scrollbar). "," * @method winWidth"," * @return {Number} The current width of the viewport."," */"," winWidth: function(node) {"," var w = Y_DOM._getWinSize(node).width;"," return w;"," },",""," /**"," * Document height "," * @method docHeight"," * @return {Number} The current height of the document."," */"," docHeight: function(node) {"," var h = Y_DOM._getDocSize(node).height;"," return Math.max(h, Y_DOM._getWinSize(node).height);"," },",""," /**"," * Document width "," * @method docWidth"," * @return {Number} The current width of the document."," */"," docWidth: function(node) {"," var w = Y_DOM._getDocSize(node).width;"," return Math.max(w, Y_DOM._getWinSize(node).width);"," },",""," /**"," * Amount page has been scroll horizontally "," * @method docScrollX"," * @return {Number} The current amount the screen is scrolled horizontally."," */"," docScrollX: function(node, doc) {"," doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization"," var dv = doc.defaultView,"," pageOffset = (dv) ? dv.pageXOffset : 0;"," return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft, pageOffset);"," },",""," /**"," * Amount page has been scroll vertically "," * @method docScrollY"," * @return {Number} The current amount the screen is scrolled vertically."," */"," docScrollY: function(node, doc) {"," doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization"," var dv = doc.defaultView,"," pageOffset = (dv) ? dv.pageYOffset : 0;"," return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop, pageOffset);"," },",""," /**"," * Gets the current position of an element based on page coordinates. "," * Element must be part of the DOM tree to have page coordinates"," * (display:none or elements not appended return false)."," * @method getXY"," * @param element The target element"," * @return {Array} The XY position of the element",""," TODO: test inDocument/display?"," */"," getXY: function() {"," if (Y.config.doc[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) {"," return function(node) {"," var xy = null,"," scrollLeft,"," scrollTop,"," mode,"," box,"," offX,"," offY,"," doc,"," win,"," inDoc,"," rootNode;",""," if (node && node.tagName) {"," doc = node.ownerDocument;"," mode = doc[COMPAT_MODE];",""," if (mode !== _BACK_COMPAT) {"," rootNode = doc[DOCUMENT_ELEMENT];"," } else {"," rootNode = doc.body;"," }",""," // inline inDoc check for perf"," if (rootNode.contains) {"," inDoc = rootNode.contains(node); "," } else {"," inDoc = Y.DOM.contains(rootNode, node);"," }",""," if (inDoc) {"," win = doc.defaultView;",""," // inline scroll calc for perf"," if (win && 'pageXOffset' in win) {"," scrollLeft = win.pageXOffset;"," scrollTop = win.pageYOffset;"," } else {"," scrollLeft = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollLeft : Y_DOM.docScrollX(node, doc);"," scrollTop = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollTop : Y_DOM.docScrollY(node, doc);"," }",""," if (Y.UA.ie) { // IE < 8, quirks, or compatMode"," if (!doc.documentMode || doc.documentMode < 8 || mode === _BACK_COMPAT) {"," offX = rootNode.clientLeft;"," offY = rootNode.clientTop;"," }"," }"," box = node[GET_BOUNDING_CLIENT_RECT]();"," xy = [box.left, box.top];",""," if (offX || offY) {"," xy[0] -= offX;"," xy[1] -= offY;"," "," }"," if ((scrollTop || scrollLeft)) {"," if (!Y.UA.ios || (Y.UA.ios >= 4.2)) {"," xy[0] += scrollLeft;"," xy[1] += scrollTop;"," }"," "," }"," } else {"," xy = Y_DOM._getOffset(node); "," }"," }"," return xy; "," };"," } else {"," return function(node) { // manually calculate by crawling up offsetParents"," //Calculate the Top and Left border sizes (assumes pixels)"," var xy = null,"," doc,"," parentNode,"," bCheck,"," scrollTop,"," scrollLeft;",""," if (node) {"," if (Y_DOM.inDoc(node)) {"," xy = [node.offsetLeft, node.offsetTop];"," doc = node.ownerDocument;"," parentNode = node;"," // TODO: refactor with !! or just falsey"," bCheck = ((Y.UA.gecko || Y.UA.webkit > 519) ? true : false);",""," // TODO: worth refactoring for TOP/LEFT only?"," while ((parentNode = parentNode.offsetParent)) {"," xy[0] += parentNode.offsetLeft;"," xy[1] += parentNode.offsetTop;"," if (bCheck) {"," xy = Y_DOM._calcBorders(parentNode, xy);"," }"," }",""," // account for any scrolled ancestors"," if (Y_DOM.getStyle(node, POSITION) != FIXED) {"," parentNode = node;",""," while ((parentNode = parentNode.parentNode)) {"," scrollTop = parentNode.scrollTop;"," scrollLeft = parentNode.scrollLeft;",""," //Firefox does something funky with borders when overflow is not visible."," if (Y.UA.gecko && (Y_DOM.getStyle(parentNode, 'overflow') !== 'visible')) {"," xy = Y_DOM._calcBorders(parentNode, xy);"," }"," ",""," if (scrollTop || scrollLeft) {"," xy[0] -= scrollLeft;"," xy[1] -= scrollTop;"," }"," }"," xy[0] += Y_DOM.docScrollX(node, doc);"," xy[1] += Y_DOM.docScrollY(node, doc);",""," } else {"," //Fix FIXED position -- add scrollbars"," xy[0] += Y_DOM.docScrollX(node, doc);"," xy[1] += Y_DOM.docScrollY(node, doc);"," }"," } else {"," xy = Y_DOM._getOffset(node);"," }"," }",""," return xy; "," };"," }"," }(),// NOTE: Executing for loadtime branching",""," /**"," Gets the width of vertical scrollbars on overflowed containers in the body"," content.",""," @method getScrollbarWidth"," @return {Number} Pixel width of a scrollbar in the current browser"," **/"," getScrollbarWidth: Y.cached(function () {"," var doc = Y.config.doc,"," testNode = doc.createElement('div'),"," body = doc.getElementsByTagName('body')[0],"," // 0.1 because cached doesn't support falsy refetch values"," width = 0.1;"," "," if (body) {"," testNode.style.cssText = \"position:absolute;visibility:hidden;overflow:scroll;width:20px;\";"," testNode.appendChild(doc.createElement('p')).style.height = '1px';"," body.insertBefore(testNode, body.firstChild);"," width = testNode.offsetWidth - testNode.clientWidth;",""," body.removeChild(testNode);"," }",""," return width;"," }, null, 0.1),",""," /**"," * Gets the current X position of an element based on page coordinates. "," * Element must be part of the DOM tree to have page coordinates"," * (display:none or elements not appended return false)."," * @method getX"," * @param element The target element"," * @return {Number} The X position of the element"," */",""," getX: function(node) {"," return Y_DOM.getXY(node)[0];"," },",""," /**"," * Gets the current Y position of an element based on page coordinates. "," * Element must be part of the DOM tree to have page coordinates"," * (display:none or elements not appended return false)."," * @method getY"," * @param element The target element"," * @return {Number} The Y position of the element"," */",""," getY: function(node) {"," return Y_DOM.getXY(node)[1];"," },",""," /**"," * Set the position of an html element in page coordinates."," * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false)."," * @method setXY"," * @param element The target element"," * @param {Array} xy Contains X & Y values for new position (coordinates are page-based)"," * @param {Boolean} noRetry By default we try and set the position a second time if the first fails"," */"," setXY: function(node, xy, noRetry) {"," var setStyle = Y_DOM.setStyle,"," pos,"," delta,"," newXY,"," currentXY;",""," if (node && xy) {"," pos = Y_DOM.getStyle(node, POSITION);",""," delta = Y_DOM._getOffset(node); "," if (pos == 'static') { // default to relative"," pos = RELATIVE;"," setStyle(node, POSITION, pos);"," }"," currentXY = Y_DOM.getXY(node);",""," if (xy[0] !== null) {"," setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px');"," }",""," if (xy[1] !== null) {"," setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px');"," }",""," if (!noRetry) {"," newXY = Y_DOM.getXY(node);"," if (newXY[0] !== xy[0] || newXY[1] !== xy[1]) {"," Y_DOM.setXY(node, xy, true); "," }"," }"," "," } else {"," }"," },",""," /**"," * Set the X position of an html element in page coordinates, regardless of how the element is positioned."," * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false)."," * @method setX"," * @param element The target element"," * @param {Number} x The X values for new position (coordinates are page-based)"," */"," setX: function(node, x) {"," return Y_DOM.setXY(node, [x, null]);"," },",""," /**"," * Set the Y position of an html element in page coordinates, regardless of how the element is positioned."," * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false)."," * @method setY"," * @param element The target element"," * @param {Number} y The Y values for new position (coordinates are page-based)"," */"," setY: function(node, y) {"," return Y_DOM.setXY(node, [null, y]);"," },",""," /**"," * @method swapXY"," * @description Swap the xy position with another node"," * @param {Node} node The node to swap with"," * @param {Node} otherNode The other node to swap with"," * @return {Node}"," */"," swapXY: function(node, otherNode) {"," var xy = Y_DOM.getXY(node);"," Y_DOM.setXY(node, Y_DOM.getXY(otherNode));"," Y_DOM.setXY(otherNode, xy);"," },",""," _calcBorders: function(node, xy2) {"," var t = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0,"," l = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0;"," if (Y.UA.gecko) {"," if (RE_TABLE.test(node.tagName)) {"," t = 0;"," l = 0;"," }"," }"," xy2[0] += l;"," xy2[1] += t;"," return xy2;"," },",""," _getWinSize: function(node, doc) {"," doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc;"," var win = doc.defaultView || doc.parentWindow,"," mode = doc[COMPAT_MODE],"," h = win.innerHeight,"," w = win.innerWidth,"," root = doc[DOCUMENT_ELEMENT];",""," if ( mode && !Y.UA.opera ) { // IE, Gecko"," if (mode != 'CSS1Compat') { // Quirks"," root = doc.body; "," }"," h = root.clientHeight;"," w = root.clientWidth;"," }"," return { height: h, width: w };"," },",""," _getDocSize: function(node) {"," var doc = (node) ? Y_DOM._getDoc(node) : Y.config.doc,"," root = doc[DOCUMENT_ELEMENT];",""," if (doc[COMPAT_MODE] != 'CSS1Compat') {"," root = doc.body;"," }",""," return { height: root.scrollHeight, width: root.scrollWidth };"," }","});","","})(Y);","(function(Y) {","var TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',",""," getOffsets = function(r1, r2) {"," var t = Math.max(r1[TOP], r2[TOP]),"," r = Math.min(r1[RIGHT], r2[RIGHT]),"," b = Math.min(r1[BOTTOM], r2[BOTTOM]),"," l = Math.max(r1[LEFT], r2[LEFT]),"," ret = {};"," "," ret[TOP] = t;"," ret[RIGHT] = r;"," ret[BOTTOM] = b;"," ret[LEFT] = l;"," return ret;"," },",""," DOM = Y.DOM;","","Y.mix(DOM, {"," /**"," * Returns an Object literal containing the following about this element: (top, right, bottom, left)"," * @for DOM"," * @method region"," * @param {HTMLElement} element The DOM element. "," * @return {Object} Object literal containing the following about this element: (top, right, bottom, left)"," */"," region: function(node) {"," var xy = DOM.getXY(node),"," ret = false;"," "," if (node && xy) {"," ret = DOM._getRegion("," xy[1], // top"," xy[0] + node.offsetWidth, // right"," xy[1] + node.offsetHeight, // bottom"," xy[0] // left"," );"," }",""," return ret;"," },",""," /**"," * Find the intersect information for the passed nodes."," * @method intersect"," * @for DOM"," * @param {HTMLElement} element The first element "," * @param {HTMLElement | Object} element2 The element or region to check the interect with"," * @param {Object} altRegion An object literal containing the region for the first element if we already have the data (for performance e.g. DragDrop)"," * @return {Object} Object literal containing the following intersection data: (top, right, bottom, left, area, yoff, xoff, inRegion)"," */"," intersect: function(node, node2, altRegion) {"," var r = altRegion || DOM.region(node), region = {},"," n = node2,"," off;",""," if (n.tagName) {"," region = DOM.region(n);"," } else if (Y.Lang.isObject(node2)) {"," region = node2;"," } else {"," return false;"," }"," "," off = getOffsets(region, r);"," return {"," top: off[TOP],"," right: off[RIGHT],"," bottom: off[BOTTOM],"," left: off[LEFT],"," area: ((off[BOTTOM] - off[TOP]) * (off[RIGHT] - off[LEFT])),"," yoff: ((off[BOTTOM] - off[TOP])),"," xoff: (off[RIGHT] - off[LEFT]),"," inRegion: DOM.inRegion(node, node2, false, altRegion)"," };"," "," },"," /**"," * Check if any part of this node is in the passed region"," * @method inRegion"," * @for DOM"," * @param {Object} node The node to get the region from"," * @param {Object} node2 The second node to get the region from or an Object literal of the region"," * @param {Boolean} all Should all of the node be inside the region"," * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance e.g. DragDrop)"," * @return {Boolean} True if in region, false if not."," */"," inRegion: function(node, node2, all, altRegion) {"," var region = {},"," r = altRegion || DOM.region(node),"," n = node2,"," off;",""," if (n.tagName) {"," region = DOM.region(n);"," } else if (Y.Lang.isObject(node2)) {"," region = node2;"," } else {"," return false;"," }"," "," if (all) {"," return ("," r[LEFT] >= region[LEFT] &&"," r[RIGHT] <= region[RIGHT] && "," r[TOP] >= region[TOP] && "," r[BOTTOM] <= region[BOTTOM] );"," } else {"," off = getOffsets(region, r);"," if (off[BOTTOM] >= off[TOP] && off[RIGHT] >= off[LEFT]) {"," return true;"," } else {"," return false;"," }"," "," }"," },",""," /**"," * Check if any part of this element is in the viewport"," * @method inViewportRegion"," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {Boolean} all Should all of the node be inside the region"," * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance e.g. DragDrop)"," * @return {Boolean} True if in region, false if not."," */"," inViewportRegion: function(node, all, altRegion) {"," return DOM.inRegion(node, DOM.viewportRegion(node), all, altRegion);"," "," },",""," _getRegion: function(t, r, b, l) {"," var region = {};",""," region[TOP] = region[1] = t;"," region[LEFT] = region[0] = l;"," region[BOTTOM] = b;"," region[RIGHT] = r;"," region.width = region[RIGHT] - region[LEFT];"," region.height = region[BOTTOM] - region[TOP];",""," return region;"," },",""," /**"," * Returns an Object literal containing the following about the visible region of viewport: (top, right, bottom, left)"," * @method viewportRegion"," * @for DOM"," * @return {Object} Object literal containing the following about the visible region of the viewport: (top, right, bottom, left)"," */"," viewportRegion: function(node) {"," node = node || Y.config.doc.documentElement;"," var ret = false,"," scrollX,"," scrollY;",""," if (node) {"," scrollX = DOM.docScrollX(node);"," scrollY = DOM.docScrollY(node);",""," ret = DOM._getRegion(scrollY, // top"," DOM.winWidth(node) + scrollX, // right"," scrollY + DOM.winHeight(node), // bottom"," scrollX); // left"," }",""," return ret;"," }","});","})(Y);","","","}, '3.7.2', {\"requires\": [\"dom-base\", \"dom-style\"]});"];+_yuitest_coverage["build/dom-screen/dom-screen.js"].code=["YUI.add('dom-screen', function (Y, NAME) {","","(function(Y) {","","/**"," * Adds position and region management functionality to DOM."," * @module dom"," * @submodule dom-screen"," * @for DOM"," */","","var DOCUMENT_ELEMENT = 'documentElement',"," COMPAT_MODE = 'compatMode',"," POSITION = 'position',"," FIXED = 'fixed',"," RELATIVE = 'relative',"," LEFT = 'left',"," TOP = 'top',"," _BACK_COMPAT = 'BackCompat',"," MEDIUM = 'medium',"," BORDER_LEFT_WIDTH = 'borderLeftWidth',"," BORDER_TOP_WIDTH = 'borderTopWidth',"," GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',"," GET_COMPUTED_STYLE = 'getComputedStyle',",""," Y_DOM = Y.DOM,",""," // TODO: how about thead/tbody/tfoot/tr?"," // TODO: does caption matter?"," RE_TABLE = /^t(?:able|d|h)$/i,",""," SCROLL_NODE;","","if (Y.UA.ie) {"," if (Y.config.doc[COMPAT_MODE] !== 'BackCompat') {"," SCROLL_NODE = DOCUMENT_ELEMENT; "," } else {"," SCROLL_NODE = 'body';"," }","}","","Y.mix(Y_DOM, {"," /**"," * Returns the inner height of the viewport (exludes scrollbar). "," * @method winHeight"," * @return {Number} The current height of the viewport."," */"," winHeight: function(node) {"," var h = Y_DOM._getWinSize(node).height;"," return h;"," },",""," /**"," * Returns the inner width of the viewport (exludes scrollbar). "," * @method winWidth"," * @return {Number} The current width of the viewport."," */"," winWidth: function(node) {"," var w = Y_DOM._getWinSize(node).width;"," return w;"," },",""," /**"," * Document height "," * @method docHeight"," * @return {Number} The current height of the document."," */"," docHeight: function(node) {"," var h = Y_DOM._getDocSize(node).height;"," return Math.max(h, Y_DOM._getWinSize(node).height);"," },",""," /**"," * Document width "," * @method docWidth"," * @return {Number} The current width of the document."," */"," docWidth: function(node) {"," var w = Y_DOM._getDocSize(node).width;"," return Math.max(w, Y_DOM._getWinSize(node).width);"," },",""," /**"," * Amount page has been scroll horizontally "," * @method docScrollX"," * @return {Number} The current amount the screen is scrolled horizontally."," */"," docScrollX: function(node, doc) {"," doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization"," var dv = doc.defaultView,"," pageOffset = (dv) ? dv.pageXOffset : 0;"," return Math.max(doc[DOCUMENT_ELEMENT].scrollLeft, doc.body.scrollLeft, pageOffset);"," },",""," /**"," * Amount page has been scroll vertically "," * @method docScrollY"," * @return {Number} The current amount the screen is scrolled vertically."," */"," docScrollY: function(node, doc) {"," doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc; // perf optimization"," var dv = doc.defaultView,"," pageOffset = (dv) ? dv.pageYOffset : 0;"," return Math.max(doc[DOCUMENT_ELEMENT].scrollTop, doc.body.scrollTop, pageOffset);"," },",""," /**"," * Gets the current position of an element based on page coordinates. "," * Element must be part of the DOM tree to have page coordinates"," * (display:none or elements not appended return false)."," * @method getXY"," * @param element The target element"," * @return {Array} The XY position of the element",""," TODO: test inDocument/display?"," */"," getXY: function() {"," if (Y.config.doc[DOCUMENT_ELEMENT][GET_BOUNDING_CLIENT_RECT]) {"," return function(node) {"," var xy = null,"," scrollLeft,"," scrollTop,"," mode,"," box,"," offX,"," offY,"," doc,"," win,"," inDoc,"," rootNode;",""," if (node && node.tagName) {"," doc = node.ownerDocument;"," mode = doc[COMPAT_MODE];",""," if (mode !== _BACK_COMPAT) {"," rootNode = doc[DOCUMENT_ELEMENT];"," } else {"," rootNode = doc.body;"," }",""," // inline inDoc check for perf"," if (rootNode.contains) {"," inDoc = rootNode.contains(node); "," } else {"," inDoc = Y.DOM.contains(rootNode, node);"," }",""," if (inDoc) {"," win = doc.defaultView;",""," // inline scroll calc for perf"," if (win && 'pageXOffset' in win) {"," scrollLeft = win.pageXOffset;"," scrollTop = win.pageYOffset;"," } else {"," scrollLeft = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollLeft : Y_DOM.docScrollX(node, doc);"," scrollTop = (SCROLL_NODE) ? doc[SCROLL_NODE].scrollTop : Y_DOM.docScrollY(node, doc);"," }",""," if (Y.UA.ie) { // IE < 8, quirks, or compatMode"," if (!doc.documentMode || doc.documentMode < 8 || mode === _BACK_COMPAT) {"," offX = rootNode.clientLeft;"," offY = rootNode.clientTop;"," }"," }"," box = node[GET_BOUNDING_CLIENT_RECT]();"," xy = [box.left, box.top];",""," if (offX || offY) {"," xy[0] -= offX;"," xy[1] -= offY;"," "," }"," if ((scrollTop || scrollLeft)) {"," if (!Y.UA.ios || (Y.UA.ios >= 4.2)) {"," xy[0] += scrollLeft;"," xy[1] += scrollTop;"," }"," "," }"," } else {"," xy = Y_DOM._getOffset(node); "," }"," }"," return xy; "," };"," } else {"," return function(node) { // manually calculate by crawling up offsetParents"," //Calculate the Top and Left border sizes (assumes pixels)"," var xy = null,"," doc,"," parentNode,"," bCheck,"," scrollTop,"," scrollLeft;",""," if (node) {"," if (Y_DOM.inDoc(node)) {"," xy = [node.offsetLeft, node.offsetTop];"," doc = node.ownerDocument;"," parentNode = node;"," // TODO: refactor with !! or just falsey"," bCheck = ((Y.UA.gecko || Y.UA.webkit > 519) ? true : false);",""," // TODO: worth refactoring for TOP/LEFT only?"," while ((parentNode = parentNode.offsetParent)) {"," xy[0] += parentNode.offsetLeft;"," xy[1] += parentNode.offsetTop;"," if (bCheck) {"," xy = Y_DOM._calcBorders(parentNode, xy);"," }"," }",""," // account for any scrolled ancestors"," if (Y_DOM.getStyle(node, POSITION) != FIXED) {"," parentNode = node;",""," while ((parentNode = parentNode.parentNode)) {"," scrollTop = parentNode.scrollTop;"," scrollLeft = parentNode.scrollLeft;",""," //Firefox does something funky with borders when overflow is not visible."," if (Y.UA.gecko && (Y_DOM.getStyle(parentNode, 'overflow') !== 'visible')) {"," xy = Y_DOM._calcBorders(parentNode, xy);"," }"," ",""," if (scrollTop || scrollLeft) {"," xy[0] -= scrollLeft;"," xy[1] -= scrollTop;"," }"," }"," xy[0] += Y_DOM.docScrollX(node, doc);"," xy[1] += Y_DOM.docScrollY(node, doc);",""," } else {"," //Fix FIXED position -- add scrollbars"," xy[0] += Y_DOM.docScrollX(node, doc);"," xy[1] += Y_DOM.docScrollY(node, doc);"," }"," } else {"," xy = Y_DOM._getOffset(node);"," }"," }",""," return xy; "," };"," }"," }(),// NOTE: Executing for loadtime branching",""," /**"," Gets the width of vertical scrollbars on overflowed containers in the body"," content.",""," @method getScrollbarWidth"," @return {Number} Pixel width of a scrollbar in the current browser"," **/"," getScrollbarWidth: Y.cached(function () {"," var doc = Y.config.doc,"," testNode = doc.createElement('div'),"," body = doc.getElementsByTagName('body')[0],"," // 0.1 because cached doesn't support falsy refetch values"," width = 0.1;"," "," if (body) {"," testNode.style.cssText = \"position:absolute;visibility:hidden;overflow:scroll;width:20px;\";"," testNode.appendChild(doc.createElement('p')).style.height = '1px';"," body.insertBefore(testNode, body.firstChild);"," width = testNode.offsetWidth - testNode.clientWidth;",""," body.removeChild(testNode);"," }",""," return width;"," }, null, 0.1),",""," /**"," * Gets the current X position of an element based on page coordinates. "," * Element must be part of the DOM tree to have page coordinates"," * (display:none or elements not appended return false)."," * @method getX"," * @param element The target element"," * @return {Number} The X position of the element"," */",""," getX: function(node) {"," return Y_DOM.getXY(node)[0];"," },",""," /**"," * Gets the current Y position of an element based on page coordinates. "," * Element must be part of the DOM tree to have page coordinates"," * (display:none or elements not appended return false)."," * @method getY"," * @param element The target element"," * @return {Number} The Y position of the element"," */",""," getY: function(node) {"," return Y_DOM.getXY(node)[1];"," },",""," /**"," * Set the position of an html element in page coordinates."," * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false)."," * @method setXY"," * @param element The target element"," * @param {Array} xy Contains X & Y values for new position (coordinates are page-based)"," * @param {Boolean} noRetry By default we try and set the position a second time if the first fails"," */"," setXY: function(node, xy, noRetry) {"," var setStyle = Y_DOM.setStyle,"," pos,"," delta,"," newXY,"," currentXY;",""," if (node && xy) {"," pos = Y_DOM.getStyle(node, POSITION);",""," delta = Y_DOM._getOffset(node); "," if (pos == 'static') { // default to relative"," pos = RELATIVE;"," setStyle(node, POSITION, pos);"," }"," currentXY = Y_DOM.getXY(node);",""," if (xy[0] !== null) {"," setStyle(node, LEFT, xy[0] - currentXY[0] + delta[0] + 'px');"," }",""," if (xy[1] !== null) {"," setStyle(node, TOP, xy[1] - currentXY[1] + delta[1] + 'px');"," }",""," if (!noRetry) {"," newXY = Y_DOM.getXY(node);"," if (newXY[0] !== xy[0] || newXY[1] !== xy[1]) {"," Y_DOM.setXY(node, xy, true); "," }"," }"," "," } else {"," }"," },",""," /**"," * Set the X position of an html element in page coordinates, regardless of how the element is positioned."," * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false)."," * @method setX"," * @param element The target element"," * @param {Number} x The X values for new position (coordinates are page-based)"," */"," setX: function(node, x) {"," return Y_DOM.setXY(node, [x, null]);"," },",""," /**"," * Set the Y position of an html element in page coordinates, regardless of how the element is positioned."," * The element(s) must be part of the DOM tree to have page coordinates (display:none or elements not appended return false)."," * @method setY"," * @param element The target element"," * @param {Number} y The Y values for new position (coordinates are page-based)"," */"," setY: function(node, y) {"," return Y_DOM.setXY(node, [null, y]);"," },",""," /**"," * @method swapXY"," * @description Swap the xy position with another node"," * @param {Node} node The node to swap with"," * @param {Node} otherNode The other node to swap with"," * @return {Node}"," */"," swapXY: function(node, otherNode) {"," var xy = Y_DOM.getXY(node);"," Y_DOM.setXY(node, Y_DOM.getXY(otherNode));"," Y_DOM.setXY(otherNode, xy);"," },",""," _calcBorders: function(node, xy2) {"," var t = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_TOP_WIDTH), 10) || 0,"," l = parseInt(Y_DOM[GET_COMPUTED_STYLE](node, BORDER_LEFT_WIDTH), 10) || 0;"," if (Y.UA.gecko) {"," if (RE_TABLE.test(node.tagName)) {"," t = 0;"," l = 0;"," }"," }"," xy2[0] += l;"," xy2[1] += t;"," return xy2;"," },",""," _getWinSize: function(node, doc) {"," doc = doc || (node) ? Y_DOM._getDoc(node) : Y.config.doc;"," var win = doc.defaultView || doc.parentWindow,"," mode = doc[COMPAT_MODE],"," h = win.innerHeight,"," w = win.innerWidth,"," root = doc[DOCUMENT_ELEMENT];",""," if ( mode && !Y.UA.opera ) { // IE, Gecko"," if (mode != 'CSS1Compat') { // Quirks"," root = doc.body; "," }"," h = root.clientHeight;"," w = root.clientWidth;"," }"," return { height: h, width: w };"," },",""," _getDocSize: function(node) {"," var doc = (node) ? Y_DOM._getDoc(node) : Y.config.doc,"," root = doc[DOCUMENT_ELEMENT];",""," if (doc[COMPAT_MODE] != 'CSS1Compat') {"," root = doc.body;"," }",""," return { height: root.scrollHeight, width: root.scrollWidth };"," }","});","","})(Y);","(function(Y) {","var TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',",""," getOffsets = function(r1, r2) {"," var t = Math.max(r1[TOP], r2[TOP]),"," r = Math.min(r1[RIGHT], r2[RIGHT]),"," b = Math.min(r1[BOTTOM], r2[BOTTOM]),"," l = Math.max(r1[LEFT], r2[LEFT]),"," ret = {};"," "," ret[TOP] = t;"," ret[RIGHT] = r;"," ret[BOTTOM] = b;"," ret[LEFT] = l;"," return ret;"," },",""," DOM = Y.DOM;","","Y.mix(DOM, {"," /**"," * Returns an Object literal containing the following about this element: (top, right, bottom, left)"," * @for DOM"," * @method region"," * @param {HTMLElement} element The DOM element. "," * @return {Object} Object literal containing the following about this element: (top, right, bottom, left)"," */"," region: function(node) {"," var xy = DOM.getXY(node),"," ret = false;"," "," if (node && xy) {"," ret = DOM._getRegion("," xy[1], // top"," xy[0] + node.offsetWidth, // right"," xy[1] + node.offsetHeight, // bottom"," xy[0] // left"," );"," }",""," return ret;"," },",""," /**"," * Find the intersect information for the passed nodes."," * @method intersect"," * @for DOM"," * @param {HTMLElement} element The first element "," * @param {HTMLElement | Object} element2 The element or region to check the interect with"," * @param {Object} altRegion An object literal containing the region for the first element if we already have the data (for performance e.g. DragDrop)"," * @return {Object} Object literal containing the following intersection data: (top, right, bottom, left, area, yoff, xoff, inRegion)"," */"," intersect: function(node, node2, altRegion) {"," var r = altRegion || DOM.region(node), region = {},"," n = node2,"," off;",""," if (n.tagName) {"," region = DOM.region(n);"," } else if (Y.Lang.isObject(node2)) {"," region = node2;"," } else {"," return false;"," }"," "," off = getOffsets(region, r);"," return {"," top: off[TOP],"," right: off[RIGHT],"," bottom: off[BOTTOM],"," left: off[LEFT],"," area: ((off[BOTTOM] - off[TOP]) * (off[RIGHT] - off[LEFT])),"," yoff: ((off[BOTTOM] - off[TOP])),"," xoff: (off[RIGHT] - off[LEFT]),"," inRegion: DOM.inRegion(node, node2, false, altRegion)"," };"," "," },"," /**"," * Check if any part of this node is in the passed region"," * @method inRegion"," * @for DOM"," * @param {Object} node The node to get the region from"," * @param {Object} node2 The second node to get the region from or an Object literal of the region"," * @param {Boolean} all Should all of the node be inside the region"," * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance e.g. DragDrop)"," * @return {Boolean} True if in region, false if not."," */"," inRegion: function(node, node2, all, altRegion) {"," var region = {},"," r = altRegion || DOM.region(node),"," n = node2,"," off;",""," if (n.tagName) {"," region = DOM.region(n);"," } else if (Y.Lang.isObject(node2)) {"," region = node2;"," } else {"," return false;"," }"," "," if (all) {"," return ("," r[LEFT] >= region[LEFT] &&"," r[RIGHT] <= region[RIGHT] && "," r[TOP] >= region[TOP] && "," r[BOTTOM] <= region[BOTTOM] );"," } else {"," off = getOffsets(region, r);"," if (off[BOTTOM] >= off[TOP] && off[RIGHT] >= off[LEFT]) {"," return true;"," } else {"," return false;"," }"," "," }"," },",""," /**"," * Check if any part of this element is in the viewport"," * @method inViewportRegion"," * @for DOM"," * @param {HTMLElement} element The DOM element. "," * @param {Boolean} all Should all of the node be inside the region"," * @param {Object} altRegion An object literal containing the region for this node if we already have the data (for performance e.g. DragDrop)"," * @return {Boolean} True if in region, false if not."," */"," inViewportRegion: function(node, all, altRegion) {"," return DOM.inRegion(node, DOM.viewportRegion(node), all, altRegion);"," "," },",""," _getRegion: function(t, r, b, l) {"," var region = {};",""," region[TOP] = region[1] = t;"," region[LEFT] = region[0] = l;"," region[BOTTOM] = b;"," region[RIGHT] = r;"," region.width = region[RIGHT] - region[LEFT];"," region.height = region[BOTTOM] - region[TOP];",""," return region;"," },",""," /**"," * Returns an Object literal containing the following about the visible region of viewport: (top, right, bottom, left)"," * @method viewportRegion"," * @for DOM"," * @return {Object} Object literal containing the following about the visible region of the viewport: (top, right, bottom, left)"," */"," viewportRegion: function(node) {"," node = node || Y.config.doc.documentElement;"," var ret = false,"," scrollX,"," scrollY;",""," if (node) {"," scrollX = DOM.docScrollX(node);"," scrollY = DOM.docScrollY(node);",""," ret = DOM._getRegion(scrollY, // top"," DOM.winWidth(node) + scrollX, // right"," scrollY + DOM.winHeight(node), // bottom"," scrollX); // left"," }",""," return ret;"," }","});","})(Y);","","","}, '3.7.3', {\"requires\": [\"dom-base\", \"dom-style\"]});"]; _yuitest_coverage["build/dom-screen/dom-screen.js"].lines = {"1":0,"3":0,"12":0,"34":0,"35":0,"36":0,"38":0,"42":0,"49":0,"50":0,"59":0,"60":0,"69":0,"70":0,"79":0,"80":0,"89":0,"90":0,"92":0,"101":0,"102":0,"104":0,"118":0,"119":0,"120":0,"132":0,"133":0,"134":0,"136":0,"137":0,"139":0,"143":0,"144":0,"146":0,"149":0,"150":0,"153":0,"154":0,"155":0,"157":0,"158":0,"161":0,"162":0,"163":0,"164":0,"167":0,"168":0,"170":0,"171":0,"172":0,"175":0,"176":0,"177":0,"178":0,"183":0,"186":0,"189":0,"191":0,"198":0,"199":0,"200":0,"201":0,"202":0,"204":0,"207":0,"208":0,"209":0,"210":0,"211":0,"216":0,"217":0,"219":0,"220":0,"221":0,"224":0,"225":0,"229":0,"230":0,"231":0,"234":0,"235":0,"239":0,"240":0,"243":0,"247":0,"260":0,"266":0,"267":0,"268":0,"269":0,"270":0,"272":0,"275":0,"288":0,"301":0,"313":0,"319":0,"320":0,"322":0,"323":0,"324":0,"325":0,"327":0,"329":0,"330":0,"333":0,"334":0,"337":0,"338":0,"339":0,"340":0,"356":0,"367":0,"378":0,"379":0,"380":0,"384":0,"386":0,"387":0,"388":0,"389":0,"392":0,"393":0,"394":0,"398":0,"399":0,"405":0,"406":0,"407":0,"409":0,"410":0,"412":0,"416":0,"419":0,"420":0,"423":0,"428":0,"429":0,"435":0,"441":0,"442":0,"443":0,"444":0,"445":0,"450":0,"459":0,"462":0,"463":0,"471":0,"484":0,"488":0,"489":0,"490":0,"491":0,"493":0,"496":0,"497":0,"520":0,"525":0,"526":0,"527":0,"528":0,"530":0,"533":0,"534":0,"540":0,"541":0,"542":0,"544":0,"560":0,"565":0,"567":0,"568":0,"569":0,"570":0,"571":0,"572":0,"574":0,"584":0,"585":0,"589":0,"590":0,"591":0,"593":0,"599":0}; _yuitest_coverage["build/dom-screen/dom-screen.js"].functions = {"winHeight:48":0,"winWidth:58":0,"docHeight:68":0,"docWidth:78":0,"docScrollX:88":0,"docScrollY:100":0,"(anonymous 3):119":0,"(anonymous 4):189":0,"getXY:117":0,"(anonymous 5):259":0,"getX:287":0,"getY:300":0,"setXY:312":0,"setX:355":0,"setY:366":0,"swapXY:377":0,"_calcBorders:383":0,"_getWinSize:397":0,"_getDocSize:415":0,"(anonymous 2):3":0,"getOffsets:434":0,"region:458":0,"intersect:483":0,"inRegion:519":0,"inViewportRegion:559":0,"_getRegion:564":0,"viewportRegion:583":0,"(anonymous 6):428":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dom-screen/dom-screen.js"].coveredLines = 185;@@ -855,4 +855,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base", "dom-style"]});+}, '3.7.3', {"requires": ["dom-base", "dom-style"]});
bundle/dom-screen/dom-screen-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -614,4 +614,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base", "dom-style"]});+}, '3.7.3', {"requires": ["dom-base", "dom-style"]});
bundle/dom-screen/dom-screen-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-screen",function(e,t){(function(e){var t="documentElement",n="compatMode",r="position",i="fixed",s="relative",o="left",u="top",a="BackCompat",f="medium",l="borderLeftWidth",c="borderTopWidth",h="getBoundingClientRect",p="getComputedStyle",d=e.DOM,v=/^t(?:able|d|h)$/i,m;e.UA.ie&&(e.config.doc[n]!=="BackCompat"?m=t:m="body"),e.mix(d,{winHeight:function(e){var t=d._getWinSize(e).height;return t},winWidth:function(e){var t=d._getWinSize(e).width;return t},docHeight:function(e){var t=d._getDocSize(e).height;return Math.max(t,d._getWinSize(e).height)},docWidth:function(e){var t=d._getDocSize(e).width;return Math.max(t,d._getWinSize(e).width)},docScrollX:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageXOffset:0;return Math.max(r[t].scrollLeft,r.body.scrollLeft,s)},docScrollY:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageYOffset:0;return Math.max(r[t].scrollTop,r.body.scrollTop,s)},getXY:function(){return e.config.doc[t][h]?function(r){var i=null,s,o,u,f,l,c,p,v,g,y;if(r&&r.tagName){p=r.ownerDocument,u=p[n],u!==a?y=p[t]:y=p.body,y.contains?g=y.contains(r):g=e.DOM.contains(y,r);if(g){v=p.defaultView,v&&"pageXOffset"in v?(s=v.pageXOffset,o=v.pageYOffset):(s=m?p[m].scrollLeft:d.docScrollX(r,p),o=m?p[m].scrollTop:d.docScrollY(r,p)),e.UA.ie&&(!p.documentMode||p.documentMode<8||u===a)&&(l=y.clientLeft,c=y.clientTop),f=r[h](),i=[f.left,f.top];if(l||c)i[0]-=l,i[1]-=c;if(o||s)if(!e.UA.ios||e.UA.ios>=4.2)i[0]+=s,i[1]+=o}else i=d._getOffset(r)}return i}:function(t){var n=null,s,o,u,a,f;if(t)if(d.inDoc(t)){n=[t.offsetLeft,t.offsetTop],s=t.ownerDocument,o=t,u=e.UA.gecko||e.UA.webkit>519?!0:!1;while(o=o.offsetParent)n[0]+=o.offsetLeft,n[1]+=o.offsetTop,u&&(n=d._calcBorders(o,n));if(d.getStyle(t,r)!=i){o=t;while(o=o.parentNode){a=o.scrollTop,f=o.scrollLeft,e.UA.gecko&&d.getStyle(o,"overflow")!=="visible"&&(n=d._calcBorders(o,n));if(a||f)n[0]-=f,n[1]-=a}n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n=d._getOffset(t);return n}}(),getScrollbarWidth:e.cached(function(){var t=e.config.doc,n=t.createElement("div"),r=t.getElementsByTagName("body")[0],i=.1;return r&&(n.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;",n.appendChild(t.createElement("p")).style.height="1px",r.insertBefore(n,r.firstChild),i=n.offsetWidth-n.clientWidth,r.removeChild(n)),i},null,.1),getX:function(e){return d.getXY(e)[0]},getY:function(e){return d.getXY(e)[1]},setXY:function(e,t,n){var i=d.setStyle,a,f,l,c;e&&t&&(a=d.getStyle(e,r),f=d._getOffset(e),a=="static"&&(a=s,i(e,r,a)),c=d.getXY(e),t[0]!==null&&i(e,o,t[0]-c[0]+f[0]+"px"),t[1]!==null&&i(e,u,t[1]-c[1]+f[1]+"px"),n||(l=d.getXY(e),(l[0]!==t[0]||l[1]!==t[1])&&d.setXY(e,t,!0)))},setX:function(e,t){return d.setXY(e,[t,null])},setY:function(e,t){return d.setXY(e,[null,t])},swapXY:function(e,t){var n=d.getXY(e);d.setXY(e,d.getXY(t)),d.setXY(t,n)},_calcBorders:function(t,n){var r=parseInt(d[p](t,c),10)||0,i=parseInt(d[p](t,l),10)||0;return e.UA.gecko&&v.test(t.tagName)&&(r=0,i=0),n[0]+=i,n[1]+=r,n},_getWinSize:function(r,i){i=i||r?d._getDoc(r):e.config.doc;var s=i.defaultView||i.parentWindow,o=i[n],u=s.innerHeight,a=s.innerWidth,f=i[t];return o&&!e.UA.opera&&(o!="CSS1Compat"&&(f=i.body),u=f.clientHeight,a=f.clientWidth),{height:u,width:a}},_getDocSize:function(r){var i=r?d._getDoc(r):e.config.doc,s=i[t];return i[n]!="CSS1Compat"&&(s=i.body),{height:s.scrollHeight,width:s.scrollWidth}}})})(e),function(e){var t="top",n="right",r="bottom",i="left",s=function(e,s){var o=Math.max(e[t],s[t]),u=Math.min(e[n],s[n]),a=Math.min(e[r],s[r]),f=Math.max(e[i],s[i]),l={};return l[t]=o,l[n]=u,l[r]=a,l[i]=f,l},o=e.DOM;e.mix(o,{region:function(e){var t=o.getXY(e),n=!1;return e&&t&&(n=o._getRegion(t[1],t[0]+e.offsetWidth,t[1]+e.offsetHeight,t[0])),n},intersect:function(u,a,f){var l=f||o.region(u),c={},h=a,p;if(h.tagName)c=o.region(h);else{if(!e.Lang.isObject(a))return!1;c=a}return p=s(c,l),{top:p[t],right:p[n],bottom:p[r],left:p[i],area:(p[r]-p[t])*(p[n]-p[i]),yoff:p[r]-p[t],xoff:p[n]-p[i],inRegion:o.inRegion(u,a,!1,f)}},inRegion:function(u,a,f,l){var c={},h=l||o.region(u),p=a,d;if(p.tagName)c=o.region(p);else{if(!e.Lang.isObject(a))return!1;c=a}return f?h[i]>=c[i]&&h[n]<=c[n]&&h[t]>=c[t]&&h[r]<=c[r]:(d=s(c,h),d[r]>=d[t]&&d[n]>=d[i]?!0:!1)},inViewportRegion:function(e,t,n){return o.inRegion(e,o.viewportRegion(e),t,n)},_getRegion:function(e,s,o,u){var a={};return a[t]=a[1]=e,a[i]=a[0]=u,a[r]=o,a[n]=s,a.width=a[n]-a[i],a.height=a[r]-a[t],a},viewportRegion:function(t){t=t||e.config.doc.documentElement;var n=!1,r,i;return t&&(r=o.docScrollX(t),i=o.docScrollY(t),n=o._getRegion(i,o.winWidth(t)+r,i+o.winHeight(t),r)),n}})}(e)},"3.7.2",{requires:["dom-base","dom-style"]});+YUI.add("dom-screen",function(e,t){(function(e){var t="documentElement",n="compatMode",r="position",i="fixed",s="relative",o="left",u="top",a="BackCompat",f="medium",l="borderLeftWidth",c="borderTopWidth",h="getBoundingClientRect",p="getComputedStyle",d=e.DOM,v=/^t(?:able|d|h)$/i,m;e.UA.ie&&(e.config.doc[n]!=="BackCompat"?m=t:m="body"),e.mix(d,{winHeight:function(e){var t=d._getWinSize(e).height;return t},winWidth:function(e){var t=d._getWinSize(e).width;return t},docHeight:function(e){var t=d._getDocSize(e).height;return Math.max(t,d._getWinSize(e).height)},docWidth:function(e){var t=d._getDocSize(e).width;return Math.max(t,d._getWinSize(e).width)},docScrollX:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageXOffset:0;return Math.max(r[t].scrollLeft,r.body.scrollLeft,s)},docScrollY:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageYOffset:0;return Math.max(r[t].scrollTop,r.body.scrollTop,s)},getXY:function(){return e.config.doc[t][h]?function(r){var i=null,s,o,u,f,l,c,p,v,g,y;if(r&&r.tagName){p=r.ownerDocument,u=p[n],u!==a?y=p[t]:y=p.body,y.contains?g=y.contains(r):g=e.DOM.contains(y,r);if(g){v=p.defaultView,v&&"pageXOffset"in v?(s=v.pageXOffset,o=v.pageYOffset):(s=m?p[m].scrollLeft:d.docScrollX(r,p),o=m?p[m].scrollTop:d.docScrollY(r,p)),e.UA.ie&&(!p.documentMode||p.documentMode<8||u===a)&&(l=y.clientLeft,c=y.clientTop),f=r[h](),i=[f.left,f.top];if(l||c)i[0]-=l,i[1]-=c;if(o||s)if(!e.UA.ios||e.UA.ios>=4.2)i[0]+=s,i[1]+=o}else i=d._getOffset(r)}return i}:function(t){var n=null,s,o,u,a,f;if(t)if(d.inDoc(t)){n=[t.offsetLeft,t.offsetTop],s=t.ownerDocument,o=t,u=e.UA.gecko||e.UA.webkit>519?!0:!1;while(o=o.offsetParent)n[0]+=o.offsetLeft,n[1]+=o.offsetTop,u&&(n=d._calcBorders(o,n));if(d.getStyle(t,r)!=i){o=t;while(o=o.parentNode){a=o.scrollTop,f=o.scrollLeft,e.UA.gecko&&d.getStyle(o,"overflow")!=="visible"&&(n=d._calcBorders(o,n));if(a||f)n[0]-=f,n[1]-=a}n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n=d._getOffset(t);return n}}(),getScrollbarWidth:e.cached(function(){var t=e.config.doc,n=t.createElement("div"),r=t.getElementsByTagName("body")[0],i=.1;return r&&(n.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;",n.appendChild(t.createElement("p")).style.height="1px",r.insertBefore(n,r.firstChild),i=n.offsetWidth-n.clientWidth,r.removeChild(n)),i},null,.1),getX:function(e){return d.getXY(e)[0]},getY:function(e){return d.getXY(e)[1]},setXY:function(e,t,n){var i=d.setStyle,a,f,l,c;e&&t&&(a=d.getStyle(e,r),f=d._getOffset(e),a=="static"&&(a=s,i(e,r,a)),c=d.getXY(e),t[0]!==null&&i(e,o,t[0]-c[0]+f[0]+"px"),t[1]!==null&&i(e,u,t[1]-c[1]+f[1]+"px"),n||(l=d.getXY(e),(l[0]!==t[0]||l[1]!==t[1])&&d.setXY(e,t,!0)))},setX:function(e,t){return d.setXY(e,[t,null])},setY:function(e,t){return d.setXY(e,[null,t])},swapXY:function(e,t){var n=d.getXY(e);d.setXY(e,d.getXY(t)),d.setXY(t,n)},_calcBorders:function(t,n){var r=parseInt(d[p](t,c),10)||0,i=parseInt(d[p](t,l),10)||0;return e.UA.gecko&&v.test(t.tagName)&&(r=0,i=0),n[0]+=i,n[1]+=r,n},_getWinSize:function(r,i){i=i||r?d._getDoc(r):e.config.doc;var s=i.defaultView||i.parentWindow,o=i[n],u=s.innerHeight,a=s.innerWidth,f=i[t];return o&&!e.UA.opera&&(o!="CSS1Compat"&&(f=i.body),u=f.clientHeight,a=f.clientWidth),{height:u,width:a}},_getDocSize:function(r){var i=r?d._getDoc(r):e.config.doc,s=i[t];return i[n]!="CSS1Compat"&&(s=i.body),{height:s.scrollHeight,width:s.scrollWidth}}})})(e),function(e){var t="top",n="right",r="bottom",i="left",s=function(e,s){var o=Math.max(e[t],s[t]),u=Math.min(e[n],s[n]),a=Math.min(e[r],s[r]),f=Math.max(e[i],s[i]),l={};return l[t]=o,l[n]=u,l[r]=a,l[i]=f,l},o=e.DOM;e.mix(o,{region:function(e){var t=o.getXY(e),n=!1;return e&&t&&(n=o._getRegion(t[1],t[0]+e.offsetWidth,t[1]+e.offsetHeight,t[0])),n},intersect:function(u,a,f){var l=f||o.region(u),c={},h=a,p;if(h.tagName)c=o.region(h);else{if(!e.Lang.isObject(a))return!1;c=a}return p=s(c,l),{top:p[t],right:p[n],bottom:p[r],left:p[i],area:(p[r]-p[t])*(p[n]-p[i]),yoff:p[r]-p[t],xoff:p[n]-p[i],inRegion:o.inRegion(u,a,!1,f)}},inRegion:function(u,a,f,l){var c={},h=l||o.region(u),p=a,d;if(p.tagName)c=o.region(p);else{if(!e.Lang.isObject(a))return!1;c=a}return f?h[i]>=c[i]&&h[n]<=c[n]&&h[t]>=c[t]&&h[r]<=c[r]:(d=s(c,h),d[r]>=d[t]&&d[n]>=d[i]?!0:!1)},inViewportRegion:function(e,t,n){return o.inRegion(e,o.viewportRegion(e),t,n)},_getRegion:function(e,s,o,u){var a={};return a[t]=a[1]=e,a[i]=a[0]=u,a[r]=o,a[n]=s,a.width=a[n]-a[i],a.height=a[r]-a[t],a},viewportRegion:function(t){t=t||e.config.doc.documentElement;var n=!1,r,i;return t&&(r=o.docScrollX(t),i=o.docScrollY(t),n=o._getRegion(i,o.winWidth(t)+r,i+o.winHeight(t),r)),n}})}(e)},"3.7.3",{requires:["dom-base","dom-style"]});
bundle/dom-screen/dom-screen.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -608,4 +608,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base", "dom-style"]});+}, '3.7.3', {"requires": ["dom-base", "dom-style"]});
bundle/dom-size/dom-size-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -51,4 +51,4 @@ }); -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-size/dom-size-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-size",function(a){a.mix(a.DOM,{setWidth:function(c,b){a.DOM._setSize(c,"width",b);},setHeight:function(c,b){a.DOM._setSize(c,"height",b);},_setSize:function(c,e,d){d=(d>0)?d:0;var b=0;c.style[e]=d+"px";b=(e==="height")?c.offsetHeight:c.offsetWidth;if(b>d){d=d-(b-d);if(d<0){d=0;}c.style[e]=d+"px";}}});},"3.7.2",{requires:["dom-core"]});+YUI.add("dom-size",function(a){a.mix(a.DOM,{setWidth:function(c,b){a.DOM._setSize(c,"width",b);},setHeight:function(c,b){a.DOM._setSize(c,"height",b);},_setSize:function(c,e,d){d=(d>0)?d:0;var b=0;c.style[e]=d+"px";b=(e==="height")?c.offsetHeight:c.offsetWidth;if(b>d){d=d-(b-d);if(d<0){d=0;}c.style[e]=d+"px";}}});},"3.7.3",{requires:["dom-core"]});
bundle/dom-size/dom-size.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -51,4 +51,4 @@ }); -}, '3.7.2' ,{requires:['dom-core']});+}, '3.7.3' ,{requires:['dom-core']});
bundle/dom-style-ie/dom-style-ie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dom-style-ie/dom-style-ie.js", code: [] };-_yuitest_coverage["build/dom-style-ie/dom-style-ie.js"].code=["YUI.add('dom-style-ie', function (Y, NAME) {","","(function(Y) {","var HAS_LAYOUT = 'hasLayout',"," PX = 'px',"," FILTER = 'filter',"," FILTERS = 'filters',"," OPACITY = 'opacity',"," AUTO = 'auto',",""," BORDER_WIDTH = 'borderWidth',"," BORDER_TOP_WIDTH = 'borderTopWidth',"," BORDER_RIGHT_WIDTH = 'borderRightWidth',"," BORDER_BOTTOM_WIDTH = 'borderBottomWidth',"," BORDER_LEFT_WIDTH = 'borderLeftWidth',"," WIDTH = 'width',"," HEIGHT = 'height',"," TRANSPARENT = 'transparent',"," VISIBLE = 'visible',"," GET_COMPUTED_STYLE = 'getComputedStyle',"," UNDEFINED = undefined,"," documentElement = Y.config.doc.documentElement,",""," testFeature = Y.Features.test,"," addFeature = Y.Features.add,",""," // TODO: unit-less lineHeight (e.g. 1.22)"," re_unit = /^(\\d[.\\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,",""," isIE8 = (Y.UA.ie >= 8),",""," _getStyleObj = function(node) {"," return node.currentStyle || node.style;"," },",""," ComputedStyle = {"," CUSTOM_STYLES: {},",""," get: function(el, property) {"," var value = '',"," current;",""," if (el) {"," current = _getStyleObj(el)[property];",""," if (property === OPACITY && Y.DOM.CUSTOM_STYLES[OPACITY]) {"," value = Y.DOM.CUSTOM_STYLES[OPACITY].get(el); "," } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert"," value = current;"," } else if (Y.DOM.IE.COMPUTED[property]) { // use compute function"," value = Y.DOM.IE.COMPUTED[property](el, property);"," } else if (re_unit.test(current)) { // convert to pixel"," value = ComputedStyle.getPixel(el, property) + PX;"," } else {"," value = current;"," }"," }",""," return value;"," },",""," sizeOffsets: {"," width: ['Left', 'Right'],"," height: ['Top', 'Bottom'],"," top: ['Top'],"," bottom: ['Bottom']"," },",""," getOffset: function(el, prop) {"," var current = _getStyleObj(el)[prop], // value of \"width\", \"top\", etc."," capped = prop.charAt(0).toUpperCase() + prop.substr(1), // \"Width\", \"Top\", etc."," offset = 'offset' + capped, // \"offsetWidth\", \"offsetTop\", etc."," pixel = 'pixel' + capped, // \"pixelWidth\", \"pixelTop\", etc."," sizeOffsets = ComputedStyle.sizeOffsets[prop], "," mode = el.ownerDocument.compatMode,"," value = '';",""," // IE pixelWidth incorrect for percent"," // manually compute by subtracting padding and border from offset size"," // NOTE: clientWidth/Height (size minus border) is 0 when current === AUTO so offsetHeight is used"," // reverting to auto from auto causes position stacking issues (old impl)"," if (current === AUTO || current.indexOf('%') > -1) {"," value = el['offset' + capped];",""," if (mode !== 'BackCompat') {"," if (sizeOffsets[0]) {"," value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[0]);"," value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[0] + 'Width', 1);"," }",""," if (sizeOffsets[1]) {"," value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[1]);"," value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[1] + 'Width', 1);"," }"," }",""," } else { // use style.pixelWidth, etc. to convert to pixels"," // need to map style.width to currentStyle (no currentStyle.pixelWidth)"," if (!el.style[pixel] && !el.style[prop]) {"," el.style[prop] = current;"," }"," value = el.style[pixel];"," "," }"," return value + PX;"," },",""," borderMap: {"," thin: (isIE8) ? '1px' : '2px',"," medium: (isIE8) ? '3px': '4px', "," thick: (isIE8) ? '5px' : '6px'"," },",""," getBorderWidth: function(el, property, omitUnit) {"," var unit = omitUnit ? '' : PX,"," current = el.currentStyle[property];",""," if (current.indexOf(PX) < 0) { // look up keywords if a border exists"," if (ComputedStyle.borderMap[current] &&"," el.currentStyle.borderStyle !== 'none') {"," current = ComputedStyle.borderMap[current];"," } else { // otherwise no border (default is \"medium\")"," current = 0;"," }"," }"," return (omitUnit) ? parseFloat(current) : current;"," },",""," getPixel: function(node, att) {"," // use pixelRight to convert to px"," var val = null,"," style = _getStyleObj(node),"," styleRight = style.right,"," current = style[att];",""," node.style.right = current;"," val = node.style.pixelRight;"," node.style.right = styleRight; // revert",""," return val;"," },",""," getMargin: function(node, att) {"," var val,"," style = _getStyleObj(node);",""," if (style[att] == AUTO) {"," val = 0;"," } else {"," val = ComputedStyle.getPixel(node, att);"," }"," return val + PX;"," },",""," getVisibility: function(node, att) {"," var current;"," while ( (current = node.currentStyle) && current[att] == 'inherit') { // NOTE: assignment in test"," node = node.parentNode;"," }"," return (current) ? current[att] : VISIBLE;"," },",""," getColor: function(node, att) {"," var current = _getStyleObj(node)[att];",""," if (!current || current === TRANSPARENT) {"," Y.DOM.elementByAxis(node, 'parentNode', null, function(parent) {"," current = _getStyleObj(parent)[att];"," if (current && current !== TRANSPARENT) {"," node = parent;"," return true;"," }"," });"," }",""," return Y.Color.toRGB(current);"," },",""," getBorderColor: function(node, att) {"," var current = _getStyleObj(node),"," val = current[att] || current.color;"," return Y.Color.toRGB(Y.Color.toHex(val));"," }"," },",""," //fontSize: getPixelFont,"," IEComputed = {};","","addFeature('style', 'computedStyle', {"," test: function() {"," return 'getComputedStyle' in Y.config.win;"," }","});","","addFeature('style', 'opacity', {"," test: function() {"," return 'opacity' in documentElement.style;"," }","});","","addFeature('style', 'filter', {"," test: function() {"," return 'filters' in documentElement;"," }","});","","// use alpha filter for IE opacity","if (!testFeature('style', 'opacity') && testFeature('style', 'filter')) {"," Y.DOM.CUSTOM_STYLES[OPACITY] = {"," get: function(node) {"," var val = 100;"," try { // will error if no DXImageTransform"," val = node[FILTERS]['DXImageTransform.Microsoft.Alpha'][OPACITY];",""," } catch(e) {"," try { // make sure its in the document"," val = node[FILTERS]('alpha')[OPACITY];"," } catch(err) {"," }"," }"," return val / 100;"," },",""," set: function(node, val, style) {"," var current,"," styleObj = _getStyleObj(node),"," currentFilter = styleObj[FILTER];",""," style = style || node.style;"," if (val === '') { // normalize inline style behavior"," current = (OPACITY in styleObj) ? styleObj[OPACITY] : 1; // revert to original opacity"," val = current;"," }",""," if (typeof currentFilter == 'string') { // in case not appended"," style[FILTER] = currentFilter.replace(/alpha([^)]*\\))/gi, '') +"," ((val < 1) ? 'alpha(' + OPACITY + '=' + val * 100 + ')' : '');",""," if (!style[FILTER]) {"," style.removeAttribute(FILTER);"," }",""," if (!styleObj[HAS_LAYOUT]) {"," style.zoom = 1; // needs layout "," }"," }"," }"," };","}","","try {"," Y.config.doc.createElement('div').style.height = '-1px';","} catch(e) { // IE throws error on invalid style set; trap common cases"," Y.DOM.CUSTOM_STYLES.height = {"," set: function(node, val, style) {"," var floatVal = parseFloat(val);"," if (floatVal >= 0 || val === 'auto' || val === '') {"," style.height = val;"," } else {"," }"," }"," };",""," Y.DOM.CUSTOM_STYLES.width = {"," set: function(node, val, style) {"," var floatVal = parseFloat(val);"," if (floatVal >= 0 || val === 'auto' || val === '') {"," style.width = val;"," } else {"," }"," }"," };","}","","if (!testFeature('style', 'computedStyle')) {"," // TODO: top, right, bottom, left"," IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset;",""," IEComputed.color = IEComputed.backgroundColor = ComputedStyle.getColor;",""," IEComputed[BORDER_WIDTH] = IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] ="," IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] ="," ComputedStyle.getBorderWidth;",""," IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom ="," IEComputed.marginLeft = ComputedStyle.getMargin;",""," IEComputed.visibility = ComputedStyle.getVisibility;"," IEComputed.borderColor = IEComputed.borderTopColor ="," IEComputed.borderRightColor = IEComputed.borderBottomColor ="," IEComputed.borderLeftColor = ComputedStyle.getBorderColor;",""," Y.DOM[GET_COMPUTED_STYLE] = ComputedStyle.get; ",""," Y.namespace('DOM.IE');"," Y.DOM.IE.COMPUTED = IEComputed;"," Y.DOM.IE.ComputedStyle = ComputedStyle;","}","","})(Y);","","","}, '3.7.2', {\"requires\": [\"dom-style\"]});"];+_yuitest_coverage["build/dom-style-ie/dom-style-ie.js"].code=["YUI.add('dom-style-ie', function (Y, NAME) {","","(function(Y) {","var HAS_LAYOUT = 'hasLayout',"," PX = 'px',"," FILTER = 'filter',"," FILTERS = 'filters',"," OPACITY = 'opacity',"," AUTO = 'auto',",""," BORDER_WIDTH = 'borderWidth',"," BORDER_TOP_WIDTH = 'borderTopWidth',"," BORDER_RIGHT_WIDTH = 'borderRightWidth',"," BORDER_BOTTOM_WIDTH = 'borderBottomWidth',"," BORDER_LEFT_WIDTH = 'borderLeftWidth',"," WIDTH = 'width',"," HEIGHT = 'height',"," TRANSPARENT = 'transparent',"," VISIBLE = 'visible',"," GET_COMPUTED_STYLE = 'getComputedStyle',"," UNDEFINED = undefined,"," documentElement = Y.config.doc.documentElement,",""," testFeature = Y.Features.test,"," addFeature = Y.Features.add,",""," // TODO: unit-less lineHeight (e.g. 1.22)"," re_unit = /^(\\d[.\\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,",""," isIE8 = (Y.UA.ie >= 8),",""," _getStyleObj = function(node) {"," return node.currentStyle || node.style;"," },",""," ComputedStyle = {"," CUSTOM_STYLES: {},",""," get: function(el, property) {"," var value = '',"," current;",""," if (el) {"," current = _getStyleObj(el)[property];",""," if (property === OPACITY && Y.DOM.CUSTOM_STYLES[OPACITY]) {"," value = Y.DOM.CUSTOM_STYLES[OPACITY].get(el); "," } else if (!current || (current.indexOf && current.indexOf(PX) > -1)) { // no need to convert"," value = current;"," } else if (Y.DOM.IE.COMPUTED[property]) { // use compute function"," value = Y.DOM.IE.COMPUTED[property](el, property);"," } else if (re_unit.test(current)) { // convert to pixel"," value = ComputedStyle.getPixel(el, property) + PX;"," } else {"," value = current;"," }"," }",""," return value;"," },",""," sizeOffsets: {"," width: ['Left', 'Right'],"," height: ['Top', 'Bottom'],"," top: ['Top'],"," bottom: ['Bottom']"," },",""," getOffset: function(el, prop) {"," var current = _getStyleObj(el)[prop], // value of \"width\", \"top\", etc."," capped = prop.charAt(0).toUpperCase() + prop.substr(1), // \"Width\", \"Top\", etc."," offset = 'offset' + capped, // \"offsetWidth\", \"offsetTop\", etc."," pixel = 'pixel' + capped, // \"pixelWidth\", \"pixelTop\", etc."," sizeOffsets = ComputedStyle.sizeOffsets[prop], "," mode = el.ownerDocument.compatMode,"," value = '';",""," // IE pixelWidth incorrect for percent"," // manually compute by subtracting padding and border from offset size"," // NOTE: clientWidth/Height (size minus border) is 0 when current === AUTO so offsetHeight is used"," // reverting to auto from auto causes position stacking issues (old impl)"," if (current === AUTO || current.indexOf('%') > -1) {"," value = el['offset' + capped];",""," if (mode !== 'BackCompat') {"," if (sizeOffsets[0]) {"," value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[0]);"," value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[0] + 'Width', 1);"," }",""," if (sizeOffsets[1]) {"," value -= ComputedStyle.getPixel(el, 'padding' + sizeOffsets[1]);"," value -= ComputedStyle.getBorderWidth(el, 'border' + sizeOffsets[1] + 'Width', 1);"," }"," }",""," } else { // use style.pixelWidth, etc. to convert to pixels"," // need to map style.width to currentStyle (no currentStyle.pixelWidth)"," if (!el.style[pixel] && !el.style[prop]) {"," el.style[prop] = current;"," }"," value = el.style[pixel];"," "," }"," return value + PX;"," },",""," borderMap: {"," thin: (isIE8) ? '1px' : '2px',"," medium: (isIE8) ? '3px': '4px', "," thick: (isIE8) ? '5px' : '6px'"," },",""," getBorderWidth: function(el, property, omitUnit) {"," var unit = omitUnit ? '' : PX,"," current = el.currentStyle[property];",""," if (current.indexOf(PX) < 0) { // look up keywords if a border exists"," if (ComputedStyle.borderMap[current] &&"," el.currentStyle.borderStyle !== 'none') {"," current = ComputedStyle.borderMap[current];"," } else { // otherwise no border (default is \"medium\")"," current = 0;"," }"," }"," return (omitUnit) ? parseFloat(current) : current;"," },",""," getPixel: function(node, att) {"," // use pixelRight to convert to px"," var val = null,"," style = _getStyleObj(node),"," styleRight = style.right,"," current = style[att];",""," node.style.right = current;"," val = node.style.pixelRight;"," node.style.right = styleRight; // revert",""," return val;"," },",""," getMargin: function(node, att) {"," var val,"," style = _getStyleObj(node);",""," if (style[att] == AUTO) {"," val = 0;"," } else {"," val = ComputedStyle.getPixel(node, att);"," }"," return val + PX;"," },",""," getVisibility: function(node, att) {"," var current;"," while ( (current = node.currentStyle) && current[att] == 'inherit') { // NOTE: assignment in test"," node = node.parentNode;"," }"," return (current) ? current[att] : VISIBLE;"," },",""," getColor: function(node, att) {"," var current = _getStyleObj(node)[att];",""," if (!current || current === TRANSPARENT) {"," Y.DOM.elementByAxis(node, 'parentNode', null, function(parent) {"," current = _getStyleObj(parent)[att];"," if (current && current !== TRANSPARENT) {"," node = parent;"," return true;"," }"," });"," }",""," return Y.Color.toRGB(current);"," },",""," getBorderColor: function(node, att) {"," var current = _getStyleObj(node),"," val = current[att] || current.color;"," return Y.Color.toRGB(Y.Color.toHex(val));"," }"," },",""," //fontSize: getPixelFont,"," IEComputed = {};","","addFeature('style', 'computedStyle', {"," test: function() {"," return 'getComputedStyle' in Y.config.win;"," }","});","","addFeature('style', 'opacity', {"," test: function() {"," return 'opacity' in documentElement.style;"," }","});","","addFeature('style', 'filter', {"," test: function() {"," return 'filters' in documentElement;"," }","});","","// use alpha filter for IE opacity","if (!testFeature('style', 'opacity') && testFeature('style', 'filter')) {"," Y.DOM.CUSTOM_STYLES[OPACITY] = {"," get: function(node) {"," var val = 100;"," try { // will error if no DXImageTransform"," val = node[FILTERS]['DXImageTransform.Microsoft.Alpha'][OPACITY];",""," } catch(e) {"," try { // make sure its in the document"," val = node[FILTERS]('alpha')[OPACITY];"," } catch(err) {"," }"," }"," return val / 100;"," },",""," set: function(node, val, style) {"," var current,"," styleObj = _getStyleObj(node),"," currentFilter = styleObj[FILTER];",""," style = style || node.style;"," if (val === '') { // normalize inline style behavior"," current = (OPACITY in styleObj) ? styleObj[OPACITY] : 1; // revert to original opacity"," val = current;"," }",""," if (typeof currentFilter == 'string') { // in case not appended"," style[FILTER] = currentFilter.replace(/alpha([^)]*\\))/gi, '') +"," ((val < 1) ? 'alpha(' + OPACITY + '=' + val * 100 + ')' : '');",""," if (!style[FILTER]) {"," style.removeAttribute(FILTER);"," }",""," if (!styleObj[HAS_LAYOUT]) {"," style.zoom = 1; // needs layout "," }"," }"," }"," };","}","","try {"," Y.config.doc.createElement('div').style.height = '-1px';","} catch(e) { // IE throws error on invalid style set; trap common cases"," Y.DOM.CUSTOM_STYLES.height = {"," set: function(node, val, style) {"," var floatVal = parseFloat(val);"," if (floatVal >= 0 || val === 'auto' || val === '') {"," style.height = val;"," } else {"," }"," }"," };",""," Y.DOM.CUSTOM_STYLES.width = {"," set: function(node, val, style) {"," var floatVal = parseFloat(val);"," if (floatVal >= 0 || val === 'auto' || val === '') {"," style.width = val;"," } else {"," }"," }"," };","}","","if (!testFeature('style', 'computedStyle')) {"," // TODO: top, right, bottom, left"," IEComputed[WIDTH] = IEComputed[HEIGHT] = ComputedStyle.getOffset;",""," IEComputed.color = IEComputed.backgroundColor = ComputedStyle.getColor;",""," IEComputed[BORDER_WIDTH] = IEComputed[BORDER_TOP_WIDTH] = IEComputed[BORDER_RIGHT_WIDTH] ="," IEComputed[BORDER_BOTTOM_WIDTH] = IEComputed[BORDER_LEFT_WIDTH] ="," ComputedStyle.getBorderWidth;",""," IEComputed.marginTop = IEComputed.marginRight = IEComputed.marginBottom ="," IEComputed.marginLeft = ComputedStyle.getMargin;",""," IEComputed.visibility = ComputedStyle.getVisibility;"," IEComputed.borderColor = IEComputed.borderTopColor ="," IEComputed.borderRightColor = IEComputed.borderBottomColor ="," IEComputed.borderLeftColor = ComputedStyle.getBorderColor;",""," Y.DOM[GET_COMPUTED_STYLE] = ComputedStyle.get; ",""," Y.namespace('DOM.IE');"," Y.DOM.IE.COMPUTED = IEComputed;"," Y.DOM.IE.ComputedStyle = ComputedStyle;","}","","})(Y);","","","}, '3.7.3', {\"requires\": [\"dom-style\"]});"]; _yuitest_coverage["build/dom-style-ie/dom-style-ie.js"].lines = {"1":0,"3":0,"4":0,"33":0,"40":0,"43":0,"44":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"55":0,"59":0,"70":0,"82":0,"83":0,"85":0,"86":0,"87":0,"88":0,"91":0,"92":0,"93":0,"99":0,"100":0,"102":0,"105":0,"115":0,"118":0,"119":0,"121":0,"123":0,"126":0,"131":0,"136":0,"137":0,"138":0,"140":0,"144":0,"147":0,"148":0,"150":0,"152":0,"156":0,"157":0,"158":0,"160":0,"164":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"176":0,"180":0,"182":0,"189":0,"191":0,"195":0,"197":0,"201":0,"203":0,"208":0,"209":0,"211":0,"212":0,"213":0,"216":0,"217":0,"221":0,"225":0,"229":0,"230":0,"231":0,"232":0,"235":0,"236":0,"239":0,"240":0,"243":0,"244":0,"251":0,"252":0,"254":0,"256":0,"257":0,"258":0,"264":0,"266":0,"267":0,"268":0,"275":0,"277":0,"279":0,"281":0,"285":0,"288":0,"289":0,"293":0,"295":0,"296":0,"297":0}; _yuitest_coverage["build/dom-style-ie/dom-style-ie.js"].functions = {"_getStyleObj:32":0,"get:39":0,"getOffset:69":0,"getBorderWidth:114":0,"getPixel:129":0,"getMargin:143":0,"getVisibility:155":0,"(anonymous 3):167":0,"getColor:163":0,"getBorderColor:179":0,"test:190":0,"test:196":0,"test:202":0,"get:210":0,"set:224":0,"set:255":0,"set:265":0,"(anonymous 2):3":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dom-style-ie/dom-style-ie.js"].coveredLines = 107;@@ -465,4 +465,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style"]});+}, '3.7.3', {"requires": ["dom-style"]});
bundle/dom-style-ie/dom-style-ie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -309,4 +309,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style"]});+}, '3.7.3', {"requires": ["dom-style"]});
bundle/dom-style-ie/dom-style-ie-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-style-ie",function(e,t){(function(e){var t="hasLayout",n="px",r="filter",i="filters",s="opacity",o="auto",u="borderWidth",a="borderTopWidth",f="borderRightWidth",l="borderBottomWidth",c="borderLeftWidth",h="width",p="height",d="transparent",v="visible",m="getComputedStyle",g=undefined,y=e.config.doc.documentElement,b=e.Features.test,w=e.Features.add,E=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,S=e.UA.ie>=8,x=function(e){return e.currentStyle||e.style},T={CUSTOM_STYLES:{},get:function(t,r){var i="",o;return t&&(o=x(t)[r],r===s&&e.DOM.CUSTOM_STYLES[s]?i=e.DOM.CUSTOM_STYLES[s].get(t):!o||o.indexOf&&o.indexOf(n)>-1?i=o:e.DOM.IE.COMPUTED[r]?i=e.DOM.IE.COMPUTED[r](t,r):E.test(o)?i=T.getPixel(t,r)+n:i=o),i},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(e,t){var r=x(e)[t],i=t.charAt(0).toUpperCase()+t.substr(1),s="offset"+i,u="pixel"+i,a=T.sizeOffsets[t],f=e.ownerDocument.compatMode,l="";return r===o||r.indexOf("%")>-1?(l=e["offset"+i],f!=="BackCompat"&&(a[0]&&(l-=T.getPixel(e,"padding"+a[0]),l-=T.getBorderWidth(e,"border"+a[0]+"Width",1)),a[1]&&(l-=T.getPixel(e,"padding"+a[1]),l-=T.getBorderWidth(e,"border"+a[1]+"Width",1)))):(!e.style[u]&&!e.style[t]&&(e.style[t]=r),l=e.style[u]),l+n},borderMap:{thin:S?"1px":"2px",medium:S?"3px":"4px",thick:S?"5px":"6px"},getBorderWidth:function(e,t,r){var i=r?"":n,s=e.currentStyle[t];return s.indexOf(n)<0&&(T.borderMap[s]&&e.currentStyle.borderStyle!=="none"?s=T.borderMap[s]:s=0),r?parseFloat(s):s},getPixel:function(e,t){var n=null,r=x(e),i=r.right,s=r[t];return e.style.right=s,n=e.style.pixelRight,e.style.right=i,n},getMargin:function(e,t){var r,i=x(e);return i[t]==o?r=0:r=T.getPixel(e,t),r+n},getVisibility:function(e,t){var n;while((n=e.currentStyle)&&n[t]=="inherit")e=e.parentNode;return n?n[t]:v},getColor:function(t,n){var r=x(t)[n];return(!r||r===d)&&e.DOM.elementByAxis(t,"parentNode",null,function(e){r=x(e)[n];if(r&&r!==d)return t=e,!0}),e.Color.toRGB(r)},getBorderColor:function(t,n){var r=x(t),i=r[n]||r.color;return e.Color.toRGB(e.Color.toHex(i))}},N={};w("style","computedStyle",{test:function(){return"getComputedStyle"in e.config.win}}),w("style","opacity",{test:function(){return"opacity"in y.style}}),w("style","filter",{test:function(){return"filters"in y}}),!b("style","opacity")&&b("style","filter")&&(e.DOM.CUSTOM_STYLES[s]={get:function(e){var t=100;try{t=e[i]["DXImageTransform.Microsoft.Alpha"][s]}catch(n){try{t=e[i]("alpha")[s]}catch(r){}}return t/100},set:function(e,n,i){var o,u=x(e),a=u[r];i=i||e.style,n===""&&(o=s in u?u[s]:1,n=o),typeof a=="string"&&(i[r]=a.replace(/alpha([^)]*\))/gi,"")+(n<1?"alpha("+s+"="+n*100+")":""),i[r]||i.removeAttribute(r),u[t]||(i.zoom=1))}});try{e.config.doc.createElement("div").style.height="-1px"}catch(C){e.DOM.CUSTOM_STYLES.height={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.height=t}},e.DOM.CUSTOM_STYLES.width={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.width=t}}}b("style","computedStyle")||(N[h]=N[p]=T.getOffset,N.color=N.backgroundColor=T.getColor,N[u]=N[a]=N[f]=N[l]=N[c]=T.getBorderWidth,N.marginTop=N.marginRight=N.marginBottom=N.marginLeft=T.getMargin,N.visibility=T.getVisibility,N.borderColor=N.borderTopColor=N.borderRightColor=N.borderBottomColor=N.borderLeftColor=T.getBorderColor,e.DOM[m]=T.get,e.namespace("DOM.IE"),e.DOM.IE.COMPUTED=N,e.DOM.IE.ComputedStyle=T)})(e)},"3.7.2",{requires:["dom-style"]});+YUI.add("dom-style-ie",function(e,t){(function(e){var t="hasLayout",n="px",r="filter",i="filters",s="opacity",o="auto",u="borderWidth",a="borderTopWidth",f="borderRightWidth",l="borderBottomWidth",c="borderLeftWidth",h="width",p="height",d="transparent",v="visible",m="getComputedStyle",g=undefined,y=e.config.doc.documentElement,b=e.Features.test,w=e.Features.add,E=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,S=e.UA.ie>=8,x=function(e){return e.currentStyle||e.style},T={CUSTOM_STYLES:{},get:function(t,r){var i="",o;return t&&(o=x(t)[r],r===s&&e.DOM.CUSTOM_STYLES[s]?i=e.DOM.CUSTOM_STYLES[s].get(t):!o||o.indexOf&&o.indexOf(n)>-1?i=o:e.DOM.IE.COMPUTED[r]?i=e.DOM.IE.COMPUTED[r](t,r):E.test(o)?i=T.getPixel(t,r)+n:i=o),i},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(e,t){var r=x(e)[t],i=t.charAt(0).toUpperCase()+t.substr(1),s="offset"+i,u="pixel"+i,a=T.sizeOffsets[t],f=e.ownerDocument.compatMode,l="";return r===o||r.indexOf("%")>-1?(l=e["offset"+i],f!=="BackCompat"&&(a[0]&&(l-=T.getPixel(e,"padding"+a[0]),l-=T.getBorderWidth(e,"border"+a[0]+"Width",1)),a[1]&&(l-=T.getPixel(e,"padding"+a[1]),l-=T.getBorderWidth(e,"border"+a[1]+"Width",1)))):(!e.style[u]&&!e.style[t]&&(e.style[t]=r),l=e.style[u]),l+n},borderMap:{thin:S?"1px":"2px",medium:S?"3px":"4px",thick:S?"5px":"6px"},getBorderWidth:function(e,t,r){var i=r?"":n,s=e.currentStyle[t];return s.indexOf(n)<0&&(T.borderMap[s]&&e.currentStyle.borderStyle!=="none"?s=T.borderMap[s]:s=0),r?parseFloat(s):s},getPixel:function(e,t){var n=null,r=x(e),i=r.right,s=r[t];return e.style.right=s,n=e.style.pixelRight,e.style.right=i,n},getMargin:function(e,t){var r,i=x(e);return i[t]==o?r=0:r=T.getPixel(e,t),r+n},getVisibility:function(e,t){var n;while((n=e.currentStyle)&&n[t]=="inherit")e=e.parentNode;return n?n[t]:v},getColor:function(t,n){var r=x(t)[n];return(!r||r===d)&&e.DOM.elementByAxis(t,"parentNode",null,function(e){r=x(e)[n];if(r&&r!==d)return t=e,!0}),e.Color.toRGB(r)},getBorderColor:function(t,n){var r=x(t),i=r[n]||r.color;return e.Color.toRGB(e.Color.toHex(i))}},N={};w("style","computedStyle",{test:function(){return"getComputedStyle"in e.config.win}}),w("style","opacity",{test:function(){return"opacity"in y.style}}),w("style","filter",{test:function(){return"filters"in y}}),!b("style","opacity")&&b("style","filter")&&(e.DOM.CUSTOM_STYLES[s]={get:function(e){var t=100;try{t=e[i]["DXImageTransform.Microsoft.Alpha"][s]}catch(n){try{t=e[i]("alpha")[s]}catch(r){}}return t/100},set:function(e,n,i){var o,u=x(e),a=u[r];i=i||e.style,n===""&&(o=s in u?u[s]:1,n=o),typeof a=="string"&&(i[r]=a.replace(/alpha([^)]*\))/gi,"")+(n<1?"alpha("+s+"="+n*100+")":""),i[r]||i.removeAttribute(r),u[t]||(i.zoom=1))}});try{e.config.doc.createElement("div").style.height="-1px"}catch(C){e.DOM.CUSTOM_STYLES.height={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.height=t}},e.DOM.CUSTOM_STYLES.width={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.width=t}}}b("style","computedStyle")||(N[h]=N[p]=T.getOffset,N.color=N.backgroundColor=T.getColor,N[u]=N[a]=N[f]=N[l]=N[c]=T.getBorderWidth,N.marginTop=N.marginRight=N.marginBottom=N.marginLeft=T.getMargin,N.visibility=T.getVisibility,N.borderColor=N.borderTopColor=N.borderRightColor=N.borderBottomColor=N.borderLeftColor=T.getBorderColor,e.DOM[m]=T.get,e.namespace("DOM.IE"),e.DOM.IE.COMPUTED=N,e.DOM.IE.ComputedStyle=T)})(e)},"3.7.3",{requires:["dom-style"]});
bundle/dom-style-ie/dom-style-ie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -306,4 +306,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style"]});+}, '3.7.3', {"requires": ["dom-style"]});
bundle/dom-style/dom-style-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dom-style/dom-style.js", code: [] };-_yuitest_coverage["build/dom-style/dom-style.js"].code=["YUI.add('dom-style', function (Y, NAME) {","","(function(Y) {","/** "," * Add style management functionality to DOM."," * @module dom"," * @submodule dom-style"," * @for DOM"," */","","var DOCUMENT_ELEMENT = 'documentElement',"," DEFAULT_VIEW = 'defaultView',"," OWNER_DOCUMENT = 'ownerDocument',"," STYLE = 'style',"," FLOAT = 'float',"," CSS_FLOAT = 'cssFloat',"," STYLE_FLOAT = 'styleFloat',"," TRANSPARENT = 'transparent',"," GET_COMPUTED_STYLE = 'getComputedStyle',"," GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',",""," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," UNDEFINED = undefined,",""," Y_DOM = Y.DOM,",""," TRANSFORM = 'transform',"," TRANSFORMORIGIN = 'transformOrigin',"," VENDOR_TRANSFORM = ["," 'WebkitTransform',"," 'MozTransform',"," 'OTransform',"," 'msTransform'"," ],",""," re_color = /color$/i,"," re_unit = /width|height|top|left|right|bottom|margin|padding/i;","","Y.Array.each(VENDOR_TRANSFORM, function(val) {"," if (val in DOCUMENT[DOCUMENT_ELEMENT].style) {"," TRANSFORM = val;"," TRANSFORMORIGIN = val + \"Origin\";"," }","});","","Y.mix(Y_DOM, {"," DEFAULT_UNIT: 'px',",""," CUSTOM_STYLES: {"," },","",""," /**"," * Sets a style property for a given element."," * @method setStyle"," * @param {HTMLElement} An HTMLElement to apply the style to."," * @param {String} att The style property to set. "," * @param {String|Number} val The value. "," */"," setStyle: function(node, att, val, style) {"," style = style || node.style;"," var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES;",""," if (style) {"," if (val === null || val === '') { // normalize unsetting"," val = '';"," } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit"," val += Y_DOM.DEFAULT_UNIT;"," }",""," if (att in CUSTOM_STYLES) {"," if (CUSTOM_STYLES[att].set) {"," CUSTOM_STYLES[att].set(node, val, style);"," return; // NOTE: return"," } else if (typeof CUSTOM_STYLES[att] === 'string') {"," att = CUSTOM_STYLES[att];"," }"," } else if (att === '') { // unset inline styles"," att = 'cssText';"," val = '';"," }"," style[att] = val; "," }"," },",""," /**"," * Returns the current style value for the given property."," * @method getStyle"," * @param {HTMLElement} An HTMLElement to get the style from."," * @param {String} att The style property to get. "," */"," getStyle: function(node, att, style) {"," style = style || node.style;"," var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES,"," val = '';",""," if (style) {"," if (att in CUSTOM_STYLES) {"," if (CUSTOM_STYLES[att].get) {"," return CUSTOM_STYLES[att].get(node, att, style); // NOTE: return"," } else if (typeof CUSTOM_STYLES[att] === 'string') {"," att = CUSTOM_STYLES[att];"," }"," }"," val = style[att];"," if (val === '') { // TODO: is empty string sufficient?"," val = Y_DOM[GET_COMPUTED_STYLE](node, att);"," }"," }",""," return val;"," },",""," /**"," * Sets multiple style properties."," * @method setStyles"," * @param {HTMLElement} node An HTMLElement to apply the styles to. "," * @param {Object} hash An object literal of property:value pairs. "," */"," setStyles: function(node, hash) {"," var style = node.style;"," Y.each(hash, function(v, n) {"," Y_DOM.setStyle(node, n, v, style);"," }, Y_DOM);"," },",""," /**"," * Returns the computed style for the given node."," * @method getComputedStyle"," * @param {HTMLElement} An HTMLElement to get the style from."," * @param {String} att The style property to get. "," * @return {String} The computed value of the style property. "," */"," getComputedStyle: function(node, att) {"," var val = '',"," doc = node[OWNER_DOCUMENT],"," computed;",""," if (node[STYLE] && doc[DEFAULT_VIEW] && doc[DEFAULT_VIEW][GET_COMPUTED_STYLE]) {"," computed = doc[DEFAULT_VIEW][GET_COMPUTED_STYLE](node, null);"," if (computed) { // FF may be null in some cases (ticket #2530548)"," val = computed[att];"," }"," }"," return val;"," }","});","","// normalize reserved word float alternatives (\"cssFloat\" or \"styleFloat\")","if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][CSS_FLOAT] !== UNDEFINED) {"," Y_DOM.CUSTOM_STYLES[FLOAT] = CSS_FLOAT;","} else if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][STYLE_FLOAT] !== UNDEFINED) {"," Y_DOM.CUSTOM_STYLES[FLOAT] = STYLE_FLOAT;","}","","// fix opera computedStyle default color unit (convert to rgb)","if (Y.UA.opera) {"," Y_DOM[GET_COMPUTED_STYLE] = function(node, att) {"," var view = node[OWNER_DOCUMENT][DEFAULT_VIEW],"," val = view[GET_COMPUTED_STYLE](node, '')[att];",""," if (re_color.test(att)) {"," val = Y.Color.toRGB(val);"," }",""," return val;"," };","","}","","// safari converts transparent to rgba(), others use \"transparent\"","if (Y.UA.webkit) {"," Y_DOM[GET_COMPUTED_STYLE] = function(node, att) {"," var view = node[OWNER_DOCUMENT][DEFAULT_VIEW],"," val = view[GET_COMPUTED_STYLE](node, '')[att];",""," if (val === 'rgba(0, 0, 0, 0)') {"," val = TRANSPARENT; "," }",""," return val;"," };","","}","","Y.DOM._getAttrOffset = function(node, attr) {"," var val = Y.DOM[GET_COMPUTED_STYLE](node, attr),"," offsetParent = node.offsetParent,"," position,"," parentOffset,"," offset;",""," if (val === 'auto') {"," position = Y.DOM.getStyle(node, 'position');"," if (position === 'static' || position === 'relative') {"," val = 0; "," } else if (offsetParent && offsetParent[GET_BOUNDING_CLIENT_RECT]) {"," parentOffset = offsetParent[GET_BOUNDING_CLIENT_RECT]()[attr];"," offset = node[GET_BOUNDING_CLIENT_RECT]()[attr];"," if (attr === 'left' || attr === 'top') {"," val = offset - parentOffset;"," } else {"," val = parentOffset - node[GET_BOUNDING_CLIENT_RECT]()[attr];"," }"," }"," }",""," return val;","};","","Y.DOM._getOffset = function(node) {"," var pos,"," xy = null;",""," if (node) {"," pos = Y_DOM.getStyle(node, 'position');"," xy = ["," parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'left'), 10),"," parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'top'), 10)"," ];",""," if ( isNaN(xy[0]) ) { // in case of 'auto'"," xy[0] = parseInt(Y_DOM.getStyle(node, 'left'), 10); // try inline"," if ( isNaN(xy[0]) ) { // default to offset value"," xy[0] = (pos === 'relative') ? 0 : node.offsetLeft || 0;"," }"," } ",""," if ( isNaN(xy[1]) ) { // in case of 'auto'"," xy[1] = parseInt(Y_DOM.getStyle(node, 'top'), 10); // try inline"," if ( isNaN(xy[1]) ) { // default to offset value"," xy[1] = (pos === 'relative') ? 0 : node.offsetTop || 0;"," }"," } "," }",""," return xy;","","};","","Y_DOM.CUSTOM_STYLES.transform = {"," set: function(node, val, style) {"," style[TRANSFORM] = val;"," },",""," get: function(node, style) {"," return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORM);"," }","};","","Y_DOM.CUSTOM_STYLES.transformOrigin = {"," set: function(node, val, style) {"," style[TRANSFORMORIGIN] = val;"," },",""," get: function(node, style) {"," return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORMORIGIN);"," }","};","","","})(Y);","(function(Y) {","var PARSE_INT = parseInt,"," RE = RegExp;","","Y.Color = {"," KEYWORDS: {"," black: '000',"," silver: 'c0c0c0',"," gray: '808080',"," white: 'fff',"," maroon: '800000',"," red: 'f00',"," purple: '800080',"," fuchsia: 'f0f',"," green: '008000',"," lime: '0f0',"," olive: '808000',"," yellow: 'ff0',"," navy: '000080',"," blue: '00f',"," teal: '008080',"," aqua: '0ff'"," },",""," re_RGB: /^rgb\\(([0-9]+)\\s*,\\s*([0-9]+)\\s*,\\s*([0-9]+)\\)$/i,"," re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,"," re_hex3: /([0-9A-F])/gi,",""," toRGB: function(val) {"," if (!Y.Color.re_RGB.test(val)) {"," val = Y.Color.toHex(val);"," }",""," if(Y.Color.re_hex.exec(val)) {"," val = 'rgb(' + ["," PARSE_INT(RE.$1, 16),"," PARSE_INT(RE.$2, 16),"," PARSE_INT(RE.$3, 16)"," ].join(', ') + ')';"," }"," return val;"," },",""," toHex: function(val) {"," val = Y.Color.KEYWORDS[val] || val;"," if (Y.Color.re_RGB.exec(val)) {"," val = ["," Number(RE.$1).toString(16),"," Number(RE.$2).toString(16),"," Number(RE.$3).toString(16)"," ];",""," for (var i = 0; i < val.length; i++) {"," if (val[i].length < 2) {"," val[i] = '0' + val[i];"," }"," }",""," val = val.join('');"," }",""," if (val.length < 6) {"," val = val.replace(Y.Color.re_hex3, '$1$1');"," }",""," if (val !== 'transparent' && val.indexOf('#') < 0) {"," val = '#' + val;"," }",""," return val.toUpperCase();"," }","};","})(Y);","","","","}, '3.7.2', {\"requires\": [\"dom-base\"]});"];+_yuitest_coverage["build/dom-style/dom-style.js"].code=["YUI.add('dom-style', function (Y, NAME) {","","(function(Y) {","/** "," * Add style management functionality to DOM."," * @module dom"," * @submodule dom-style"," * @for DOM"," */","","var DOCUMENT_ELEMENT = 'documentElement',"," DEFAULT_VIEW = 'defaultView',"," OWNER_DOCUMENT = 'ownerDocument',"," STYLE = 'style',"," FLOAT = 'float',"," CSS_FLOAT = 'cssFloat',"," STYLE_FLOAT = 'styleFloat',"," TRANSPARENT = 'transparent',"," GET_COMPUTED_STYLE = 'getComputedStyle',"," GET_BOUNDING_CLIENT_RECT = 'getBoundingClientRect',",""," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," UNDEFINED = undefined,",""," Y_DOM = Y.DOM,",""," TRANSFORM = 'transform',"," TRANSFORMORIGIN = 'transformOrigin',"," VENDOR_TRANSFORM = ["," 'WebkitTransform',"," 'MozTransform',"," 'OTransform',"," 'msTransform'"," ],",""," re_color = /color$/i,"," re_unit = /width|height|top|left|right|bottom|margin|padding/i;","","Y.Array.each(VENDOR_TRANSFORM, function(val) {"," if (val in DOCUMENT[DOCUMENT_ELEMENT].style) {"," TRANSFORM = val;"," TRANSFORMORIGIN = val + \"Origin\";"," }","});","","Y.mix(Y_DOM, {"," DEFAULT_UNIT: 'px',",""," CUSTOM_STYLES: {"," },","",""," /**"," * Sets a style property for a given element."," * @method setStyle"," * @param {HTMLElement} An HTMLElement to apply the style to."," * @param {String} att The style property to set. "," * @param {String|Number} val The value. "," */"," setStyle: function(node, att, val, style) {"," style = style || node.style;"," var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES;",""," if (style) {"," if (val === null || val === '') { // normalize unsetting"," val = '';"," } else if (!isNaN(new Number(val)) && re_unit.test(att)) { // number values may need a unit"," val += Y_DOM.DEFAULT_UNIT;"," }",""," if (att in CUSTOM_STYLES) {"," if (CUSTOM_STYLES[att].set) {"," CUSTOM_STYLES[att].set(node, val, style);"," return; // NOTE: return"," } else if (typeof CUSTOM_STYLES[att] === 'string') {"," att = CUSTOM_STYLES[att];"," }"," } else if (att === '') { // unset inline styles"," att = 'cssText';"," val = '';"," }"," style[att] = val; "," }"," },",""," /**"," * Returns the current style value for the given property."," * @method getStyle"," * @param {HTMLElement} An HTMLElement to get the style from."," * @param {String} att The style property to get. "," */"," getStyle: function(node, att, style) {"," style = style || node.style;"," var CUSTOM_STYLES = Y_DOM.CUSTOM_STYLES,"," val = '';",""," if (style) {"," if (att in CUSTOM_STYLES) {"," if (CUSTOM_STYLES[att].get) {"," return CUSTOM_STYLES[att].get(node, att, style); // NOTE: return"," } else if (typeof CUSTOM_STYLES[att] === 'string') {"," att = CUSTOM_STYLES[att];"," }"," }"," val = style[att];"," if (val === '') { // TODO: is empty string sufficient?"," val = Y_DOM[GET_COMPUTED_STYLE](node, att);"," }"," }",""," return val;"," },",""," /**"," * Sets multiple style properties."," * @method setStyles"," * @param {HTMLElement} node An HTMLElement to apply the styles to. "," * @param {Object} hash An object literal of property:value pairs. "," */"," setStyles: function(node, hash) {"," var style = node.style;"," Y.each(hash, function(v, n) {"," Y_DOM.setStyle(node, n, v, style);"," }, Y_DOM);"," },",""," /**"," * Returns the computed style for the given node."," * @method getComputedStyle"," * @param {HTMLElement} An HTMLElement to get the style from."," * @param {String} att The style property to get. "," * @return {String} The computed value of the style property. "," */"," getComputedStyle: function(node, att) {"," var val = '',"," doc = node[OWNER_DOCUMENT],"," computed;",""," if (node[STYLE] && doc[DEFAULT_VIEW] && doc[DEFAULT_VIEW][GET_COMPUTED_STYLE]) {"," computed = doc[DEFAULT_VIEW][GET_COMPUTED_STYLE](node, null);"," if (computed) { // FF may be null in some cases (ticket #2530548)"," val = computed[att];"," }"," }"," return val;"," }","});","","// normalize reserved word float alternatives (\"cssFloat\" or \"styleFloat\")","if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][CSS_FLOAT] !== UNDEFINED) {"," Y_DOM.CUSTOM_STYLES[FLOAT] = CSS_FLOAT;","} else if (DOCUMENT[DOCUMENT_ELEMENT][STYLE][STYLE_FLOAT] !== UNDEFINED) {"," Y_DOM.CUSTOM_STYLES[FLOAT] = STYLE_FLOAT;","}","","// fix opera computedStyle default color unit (convert to rgb)","if (Y.UA.opera) {"," Y_DOM[GET_COMPUTED_STYLE] = function(node, att) {"," var view = node[OWNER_DOCUMENT][DEFAULT_VIEW],"," val = view[GET_COMPUTED_STYLE](node, '')[att];",""," if (re_color.test(att)) {"," val = Y.Color.toRGB(val);"," }",""," return val;"," };","","}","","// safari converts transparent to rgba(), others use \"transparent\"","if (Y.UA.webkit) {"," Y_DOM[GET_COMPUTED_STYLE] = function(node, att) {"," var view = node[OWNER_DOCUMENT][DEFAULT_VIEW],"," val = view[GET_COMPUTED_STYLE](node, '')[att];",""," if (val === 'rgba(0, 0, 0, 0)') {"," val = TRANSPARENT; "," }",""," return val;"," };","","}","","Y.DOM._getAttrOffset = function(node, attr) {"," var val = Y.DOM[GET_COMPUTED_STYLE](node, attr),"," offsetParent = node.offsetParent,"," position,"," parentOffset,"," offset;",""," if (val === 'auto') {"," position = Y.DOM.getStyle(node, 'position');"," if (position === 'static' || position === 'relative') {"," val = 0; "," } else if (offsetParent && offsetParent[GET_BOUNDING_CLIENT_RECT]) {"," parentOffset = offsetParent[GET_BOUNDING_CLIENT_RECT]()[attr];"," offset = node[GET_BOUNDING_CLIENT_RECT]()[attr];"," if (attr === 'left' || attr === 'top') {"," val = offset - parentOffset;"," } else {"," val = parentOffset - node[GET_BOUNDING_CLIENT_RECT]()[attr];"," }"," }"," }",""," return val;","};","","Y.DOM._getOffset = function(node) {"," var pos,"," xy = null;",""," if (node) {"," pos = Y_DOM.getStyle(node, 'position');"," xy = ["," parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'left'), 10),"," parseInt(Y_DOM[GET_COMPUTED_STYLE](node, 'top'), 10)"," ];",""," if ( isNaN(xy[0]) ) { // in case of 'auto'"," xy[0] = parseInt(Y_DOM.getStyle(node, 'left'), 10); // try inline"," if ( isNaN(xy[0]) ) { // default to offset value"," xy[0] = (pos === 'relative') ? 0 : node.offsetLeft || 0;"," }"," } ",""," if ( isNaN(xy[1]) ) { // in case of 'auto'"," xy[1] = parseInt(Y_DOM.getStyle(node, 'top'), 10); // try inline"," if ( isNaN(xy[1]) ) { // default to offset value"," xy[1] = (pos === 'relative') ? 0 : node.offsetTop || 0;"," }"," } "," }",""," return xy;","","};","","Y_DOM.CUSTOM_STYLES.transform = {"," set: function(node, val, style) {"," style[TRANSFORM] = val;"," },",""," get: function(node, style) {"," return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORM);"," }","};","","Y_DOM.CUSTOM_STYLES.transformOrigin = {"," set: function(node, val, style) {"," style[TRANSFORMORIGIN] = val;"," },",""," get: function(node, style) {"," return Y_DOM[GET_COMPUTED_STYLE](node, TRANSFORMORIGIN);"," }","};","","","})(Y);","(function(Y) {","var PARSE_INT = parseInt,"," RE = RegExp;","","Y.Color = {"," KEYWORDS: {"," black: '000',"," silver: 'c0c0c0',"," gray: '808080',"," white: 'fff',"," maroon: '800000',"," red: 'f00',"," purple: '800080',"," fuchsia: 'f0f',"," green: '008000',"," lime: '0f0',"," olive: '808000',"," yellow: 'ff0',"," navy: '000080',"," blue: '00f',"," teal: '008080',"," aqua: '0ff'"," },",""," re_RGB: /^rgb\\(([0-9]+)\\s*,\\s*([0-9]+)\\s*,\\s*([0-9]+)\\)$/i,"," re_hex: /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,"," re_hex3: /([0-9A-F])/gi,",""," toRGB: function(val) {"," if (!Y.Color.re_RGB.test(val)) {"," val = Y.Color.toHex(val);"," }",""," if(Y.Color.re_hex.exec(val)) {"," val = 'rgb(' + ["," PARSE_INT(RE.$1, 16),"," PARSE_INT(RE.$2, 16),"," PARSE_INT(RE.$3, 16)"," ].join(', ') + ')';"," }"," return val;"," },",""," toHex: function(val) {"," val = Y.Color.KEYWORDS[val] || val;"," if (Y.Color.re_RGB.exec(val)) {"," val = ["," Number(RE.$1).toString(16),"," Number(RE.$2).toString(16),"," Number(RE.$3).toString(16)"," ];",""," for (var i = 0; i < val.length; i++) {"," if (val[i].length < 2) {"," val[i] = '0' + val[i];"," }"," }",""," val = val.join('');"," }",""," if (val.length < 6) {"," val = val.replace(Y.Color.re_hex3, '$1$1');"," }",""," if (val !== 'transparent' && val.indexOf('#') < 0) {"," val = '#' + val;"," }",""," return val.toUpperCase();"," }","};","})(Y);","","","","}, '3.7.3', {\"requires\": [\"dom-base\"]});"]; _yuitest_coverage["build/dom-style/dom-style.js"].lines = {"1":0,"3":0,"11":0,"40":0,"41":0,"42":0,"43":0,"47":0,"62":0,"63":0,"65":0,"66":0,"67":0,"68":0,"69":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"79":0,"80":0,"81":0,"83":0,"94":0,"95":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"106":0,"107":0,"108":0,"112":0,"122":0,"123":0,"124":0,"136":0,"140":0,"141":0,"142":0,"143":0,"146":0,"151":0,"152":0,"153":0,"154":0,"158":0,"159":0,"160":0,"163":0,"164":0,"167":0,"173":0,"174":0,"175":0,"178":0,"179":0,"182":0,"187":0,"188":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"204":0,"209":0,"212":0,"213":0,"216":0,"217":0,"218":0,"223":0,"224":0,"225":0,"226":0,"230":0,"231":0,"232":0,"233":0,"238":0,"242":0,"244":0,"248":0,"252":0,"254":0,"258":0,"264":0,"265":0,"268":0,"293":0,"294":0,"297":0,"298":0,"304":0,"308":0,"309":0,"310":0,"316":0,"317":0,"318":0,"322":0,"325":0,"326":0,"329":0,"330":0,"333":0}; _yuitest_coverage["build/dom-style/dom-style.js"].functions = {"(anonymous 3):40":0,"setStyle:61":0,"getStyle:93":0,"(anonymous 4):123":0,"setStyles:121":0,"getComputedStyle:135":0,"]:159":0,"]:174":0,"_getAttrOffset:187":0,"_getOffset:212":0,"set:243":0,"get:247":0,"set:253":0,"get:257":0,"(anonymous 2):3":0,"toRGB:292":0,"toHex:307":0,"(anonymous 5):264":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dom-style/dom-style.js"].coveredLines = 115;@@ -510,4 +510,4 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/dom-style/dom-style-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -343,4 +343,4 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/dom-style/dom-style-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dom-style",function(e,t){(function(e){var t="documentElement",n="defaultView",r="ownerDocument",i="style",s="float",o="cssFloat",u="styleFloat",a="transparent",f="getComputedStyle",l="getBoundingClientRect",c=e.config.win,h=e.config.doc,p=undefined,d=e.DOM,v="transform",m="transformOrigin",g=["WebkitTransform","MozTransform","OTransform","msTransform"],y=/color$/i,b=/width|height|top|left|right|bottom|margin|padding/i;e.Array.each(g,function(e){e in h[t].style&&(v=e,m=e+"Origin")}),e.mix(d,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(e,t,n,r){r=r||e.style;var i=d.CUSTOM_STYLES;if(r){n===null||n===""?n="":!isNaN(new Number(n))&&b.test(t)&&(n+=d.DEFAULT_UNIT);if(t in i){if(i[t].set){i[t].set(e,n,r);return}typeof i[t]=="string"&&(t=i[t])}else t===""&&(t="cssText",n="");r[t]=n}},getStyle:function(e,t,n){n=n||e.style;var r=d.CUSTOM_STYLES,i="";if(n){if(t in r){if(r[t].get)return r[t].get(e,t,n);typeof r[t]=="string"&&(t=r[t])}i=n[t],i===""&&(i=d[f](e,t))}return i},setStyles:function(t,n){var r=t.style;e.each(n,function(e,n){d.setStyle(t,n,e,r)},d)},getComputedStyle:function(e,t){var s="",o=e[r],u;return e[i]&&o[n]&&o[n][f]&&(u=o[n][f](e,null),u&&(s=u[t])),s}}),h[t][i][o]!==p?d.CUSTOM_STYLES[s]=o:h[t][i][u]!==p&&(d.CUSTOM_STYLES[s]=u),e.UA.opera&&(d[f]=function(t,i){var s=t[r][n],o=s[f](t,"")[i];return y.test(i)&&(o=e.Color.toRGB(o)),o}),e.UA.webkit&&(d[f]=function(e,t){var i=e[r][n],s=i[f](e,"")[t];return s==="rgba(0, 0, 0, 0)"&&(s=a),s}),e.DOM._getAttrOffset=function(t,n){var r=e.DOM[f](t,n),i=t.offsetParent,s,o,u;return r==="auto"&&(s=e.DOM.getStyle(t,"position"),s==="static"||s==="relative"?r=0:i&&i[l]&&(o=i[l]()[n],u=t[l]()[n],n==="left"||n==="top"?r=u-o:r=o-t[l]()[n])),r},e.DOM._getOffset=function(e){var t,n=null;return e&&(t=d.getStyle(e,"position"),n=[parseInt(d[f](e,"left"),10),parseInt(d[f](e,"top"),10)],isNaN(n[0])&&(n[0]=parseInt(d.getStyle(e,"left"),10),isNaN(n[0])&&(n[0]=t==="relative"?0:e.offsetLeft||0)),isNaN(n[1])&&(n[1]=parseInt(d.getStyle(e,"top"),10),isNaN(n[1])&&(n[1]=t==="relative"?0:e.offsetTop||0))),n},d.CUSTOM_STYLES.transform={set:function(e,t,n){n[v]=t},get:function(e,t){return d[f](e,v)}},d.CUSTOM_STYLES.transformOrigin={set:function(e,t,n){n[m]=t},get:function(e,t){return d[f](e,m)}}})(e),function(e){var t=parseInt,n=RegExp;e.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(r){return e.Color.re_RGB.test(r)||(r=e.Color.toHex(r)),e.Color.re_hex.exec(r)&&(r="rgb("+[t(n.$1,16),t(n.$2,16),t(n.$3,16)].join(", ")+")"),r},toHex:function(t){t=e.Color.KEYWORDS[t]||t;if(e.Color.re_RGB.exec(t)){t=[Number(n.$1).toString(16),Number(n.$2).toString(16),Number(n.$3).toString(16)];for(var r=0;r<t.length;r++)t[r].length<2&&(t[r]="0"+t[r]);t=t.join("")}return t.length<6&&(t=t.replace(e.Color.re_hex3,"$1$1")),t!=="transparent"&&t.indexOf("#")<0&&(t="#"+t),t.toUpperCase()}}}(e)},"3.7.2",{requires:["dom-base"]});+YUI.add("dom-style",function(e,t){(function(e){var t="documentElement",n="defaultView",r="ownerDocument",i="style",s="float",o="cssFloat",u="styleFloat",a="transparent",f="getComputedStyle",l="getBoundingClientRect",c=e.config.win,h=e.config.doc,p=undefined,d=e.DOM,v="transform",m="transformOrigin",g=["WebkitTransform","MozTransform","OTransform","msTransform"],y=/color$/i,b=/width|height|top|left|right|bottom|margin|padding/i;e.Array.each(g,function(e){e in h[t].style&&(v=e,m=e+"Origin")}),e.mix(d,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(e,t,n,r){r=r||e.style;var i=d.CUSTOM_STYLES;if(r){n===null||n===""?n="":!isNaN(new Number(n))&&b.test(t)&&(n+=d.DEFAULT_UNIT);if(t in i){if(i[t].set){i[t].set(e,n,r);return}typeof i[t]=="string"&&(t=i[t])}else t===""&&(t="cssText",n="");r[t]=n}},getStyle:function(e,t,n){n=n||e.style;var r=d.CUSTOM_STYLES,i="";if(n){if(t in r){if(r[t].get)return r[t].get(e,t,n);typeof r[t]=="string"&&(t=r[t])}i=n[t],i===""&&(i=d[f](e,t))}return i},setStyles:function(t,n){var r=t.style;e.each(n,function(e,n){d.setStyle(t,n,e,r)},d)},getComputedStyle:function(e,t){var s="",o=e[r],u;return e[i]&&o[n]&&o[n][f]&&(u=o[n][f](e,null),u&&(s=u[t])),s}}),h[t][i][o]!==p?d.CUSTOM_STYLES[s]=o:h[t][i][u]!==p&&(d.CUSTOM_STYLES[s]=u),e.UA.opera&&(d[f]=function(t,i){var s=t[r][n],o=s[f](t,"")[i];return y.test(i)&&(o=e.Color.toRGB(o)),o}),e.UA.webkit&&(d[f]=function(e,t){var i=e[r][n],s=i[f](e,"")[t];return s==="rgba(0, 0, 0, 0)"&&(s=a),s}),e.DOM._getAttrOffset=function(t,n){var r=e.DOM[f](t,n),i=t.offsetParent,s,o,u;return r==="auto"&&(s=e.DOM.getStyle(t,"position"),s==="static"||s==="relative"?r=0:i&&i[l]&&(o=i[l]()[n],u=t[l]()[n],n==="left"||n==="top"?r=u-o:r=o-t[l]()[n])),r},e.DOM._getOffset=function(e){var t,n=null;return e&&(t=d.getStyle(e,"position"),n=[parseInt(d[f](e,"left"),10),parseInt(d[f](e,"top"),10)],isNaN(n[0])&&(n[0]=parseInt(d.getStyle(e,"left"),10),isNaN(n[0])&&(n[0]=t==="relative"?0:e.offsetLeft||0)),isNaN(n[1])&&(n[1]=parseInt(d.getStyle(e,"top"),10),isNaN(n[1])&&(n[1]=t==="relative"?0:e.offsetTop||0))),n},d.CUSTOM_STYLES.transform={set:function(e,t,n){n[v]=t},get:function(e,t){return d[f](e,v)}},d.CUSTOM_STYLES.transformOrigin={set:function(e,t,n){n[m]=t},get:function(e,t){return d[f](e,m)}}})(e),function(e){var t=parseInt,n=RegExp;e.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(r){return e.Color.re_RGB.test(r)||(r=e.Color.toHex(r)),e.Color.re_hex.exec(r)&&(r="rgb("+[t(n.$1,16),t(n.$2,16),t(n.$3,16)].join(", ")+")"),r},toHex:function(t){t=e.Color.KEYWORDS[t]||t;if(e.Color.re_RGB.exec(t)){t=[Number(n.$1).toString(16),Number(n.$2).toString(16),Number(n.$3).toString(16)];for(var r=0;r<t.length;r++)t[r].length<2&&(t[r]="0"+t[r]);t=t.join("")}return t.length<6&&(t=t.replace(e.Color.re_hex3,"$1$1")),t!=="transparent"&&t.indexOf("#")<0&&(t="#"+t),t.toUpperCase()}}}(e)},"3.7.3",{requires:["dom-base"]});
bundle/dom-style/dom-style.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -343,4 +343,4 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/dump/dump-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/dump/dump.js", code: [] };-_yuitest_coverage["build/dump/dump.js"].code=["YUI.add('dump', function (Y, NAME) {","","/**"," * Returns a simple string representation of the object or array."," * Other types of objects will be returned unprocessed. Arrays"," * are expected to be indexed. Use object notation for"," * associative arrays."," *"," * If included, the dump method is added to the YUI instance."," *"," * @module dump"," */",""," var L = Y.Lang,"," OBJ = '{...}',"," FUN = 'f(){...}',"," COMMA = ', ',"," ARROW = ' => ',",""," /**"," * Returns a simple string representation of the object or array."," * Other types of objects will be returned unprocessed. Arrays"," * are expected to be indexed."," *"," * @method dump"," * @param {Object} o The object to dump."," * @param {Number} d How deep to recurse child objects, default 3."," * @return {String} the dump result."," * @for YUI"," */"," dump = function(o, d) {"," var i, len, s = [], type = L.type(o);",""," // Cast non-objects to string"," // Skip dates because the std toString is what we want"," // Skip HTMLElement-like objects because trying to dump"," // an element will cause an unhandled exception in FF 2.x"," if (!L.isObject(o)) {"," return o + '';"," } else if (type == 'date') {"," return o;"," } else if (o.nodeType && o.tagName) {"," return o.tagName + '#' + o.id;"," } else if (o.document && o.navigator) {"," return 'window';"," } else if (o.location && o.body) {"," return 'document';"," } else if (type == 'function') {"," return FUN;"," }",""," // dig into child objects the depth specifed. Default 3"," d = (L.isNumber(d)) ? d : 3;",""," // arrays [1, 2, 3]"," if (type == 'array') {"," s.push('[');"," for (i = 0, len = o.length; i < len; i = i + 1) {"," if (L.isObject(o[i])) {"," s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ);"," } else {"," s.push(o[i]);"," }"," s.push(COMMA);"," }"," if (s.length > 1) {"," s.pop();"," }"," s.push(']');"," // regexp /foo/"," } else if (type == 'regexp') {"," s.push(o.toString());"," // objects {k1 => v1, k2 => v2}"," } else {"," s.push('{');"," for (i in o) {"," if (o.hasOwnProperty(i)) {"," try {"," s.push(i + ARROW);"," if (L.isObject(o[i])) {"," s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ);"," } else {"," s.push(o[i]);"," }"," s.push(COMMA);"," } catch (e) {"," s.push('Error: ' + e.message);"," }"," }"," }"," if (s.length > 1) {"," s.pop();"," }"," s.push('}');"," }",""," return s.join('');"," };",""," Y.dump = dump;"," L.dump = dump;","","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/dump/dump.js"].code=["YUI.add('dump', function (Y, NAME) {","","/**"," * Returns a simple string representation of the object or array."," * Other types of objects will be returned unprocessed. Arrays"," * are expected to be indexed. Use object notation for"," * associative arrays."," *"," * If included, the dump method is added to the YUI instance."," *"," * @module dump"," */",""," var L = Y.Lang,"," OBJ = '{...}',"," FUN = 'f(){...}',"," COMMA = ', ',"," ARROW = ' => ',",""," /**"," * Returns a simple string representation of the object or array."," * Other types of objects will be returned unprocessed. Arrays"," * are expected to be indexed."," *"," * @method dump"," * @param {Object} o The object to dump."," * @param {Number} d How deep to recurse child objects, default 3."," * @return {String} the dump result."," * @for YUI"," */"," dump = function(o, d) {"," var i, len, s = [], type = L.type(o);",""," // Cast non-objects to string"," // Skip dates because the std toString is what we want"," // Skip HTMLElement-like objects because trying to dump"," // an element will cause an unhandled exception in FF 2.x"," if (!L.isObject(o)) {"," return o + '';"," } else if (type == 'date') {"," return o;"," } else if (o.nodeType && o.tagName) {"," return o.tagName + '#' + o.id;"," } else if (o.document && o.navigator) {"," return 'window';"," } else if (o.location && o.body) {"," return 'document';"," } else if (type == 'function') {"," return FUN;"," }",""," // dig into child objects the depth specifed. Default 3"," d = (L.isNumber(d)) ? d : 3;",""," // arrays [1, 2, 3]"," if (type == 'array') {"," s.push('[');"," for (i = 0, len = o.length; i < len; i = i + 1) {"," if (L.isObject(o[i])) {"," s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ);"," } else {"," s.push(o[i]);"," }"," s.push(COMMA);"," }"," if (s.length > 1) {"," s.pop();"," }"," s.push(']');"," // regexp /foo/"," } else if (type == 'regexp') {"," s.push(o.toString());"," // objects {k1 => v1, k2 => v2}"," } else {"," s.push('{');"," for (i in o) {"," if (o.hasOwnProperty(i)) {"," try {"," s.push(i + ARROW);"," if (L.isObject(o[i])) {"," s.push((d > 0) ? L.dump(o[i], d - 1) : OBJ);"," } else {"," s.push(o[i]);"," }"," s.push(COMMA);"," } catch (e) {"," s.push('Error: ' + e.message);"," }"," }"," }"," if (s.length > 1) {"," s.pop();"," }"," s.push('}');"," }",""," return s.join('');"," };",""," Y.dump = dump;"," L.dump = dump;","","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/dump/dump.js"].lines = {"1":0,"14":0,"32":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"53":0,"56":0,"57":0,"58":0,"59":0,"60":0,"62":0,"64":0,"66":0,"67":0,"69":0,"71":0,"72":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"83":0,"85":0,"87":0,"91":0,"92":0,"94":0,"97":0,"100":0,"101":0}; _yuitest_coverage["build/dump/dump.js"].functions = {"dump:31":0,"(anonymous 1):1":0}; _yuitest_coverage["build/dump/dump.js"].coveredLines = 44;@@ -187,4 +187,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/dump/dump-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -108,4 +108,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/dump/dump-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("dump",function(e,t){var n=e.Lang,r="{...}",i="f(){...}",s=", ",o=" => ",u=function(e,t){var u,a,f=[],l=n.type(e);if(!n.isObject(e))return e+"";if(l=="date")return e;if(e.nodeType&&e.tagName)return e.tagName+"#"+e.id;if(e.document&&e.navigator)return"window";if(e.location&&e.body)return"document";if(l=="function")return i;t=n.isNumber(t)?t:3;if(l=="array"){f.push("[");for(u=0,a=e.length;u<a;u+=1)n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s);f.length>1&&f.pop(),f.push("]")}else if(l=="regexp")f.push(e.toString());else{f.push("{");for(u in e)if(e.hasOwnProperty(u))try{f.push(u+o),n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s)}catch(c){f.push("Error: "+c.message)}f.length>1&&f.pop(),f.push("}")}return f.join("")};e.dump=u,n.dump=u},"3.7.2",{requires:["yui-base"]});+YUI.add("dump",function(e,t){var n=e.Lang,r="{...}",i="f(){...}",s=", ",o=" => ",u=function(e,t){var u,a,f=[],l=n.type(e);if(!n.isObject(e))return e+"";if(l=="date")return e;if(e.nodeType&&e.tagName)return e.tagName+"#"+e.id;if(e.document&&e.navigator)return"window";if(e.location&&e.body)return"document";if(l=="function")return i;t=n.isNumber(t)?t:3;if(l=="array"){f.push("[");for(u=0,a=e.length;u<a;u+=1)n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s);f.length>1&&f.pop(),f.push("]")}else if(l=="regexp")f.push(e.toString());else{f.push("{");for(u in e)if(e.hasOwnProperty(u))try{f.push(u+o),n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s)}catch(c){f.push("Error: "+c.message)}f.length>1&&f.pop(),f.push("}")}return f.join("")};e.dump=u,n.dump=u},"3.7.3",{requires:["yui-base"]});
bundle/dump/dump.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -108,4 +108,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/editor-base/editor-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/editor-base/editor-base.js", code: [] };-_yuitest_coverage["build/editor-base/editor-base.js"].code=["YUI.add('editor-base', function (Y, NAME) {","",""," /**"," * Base class for Editor. Handles the business logic of Editor, no GUI involved only utility methods and events."," *"," * var editor = new Y.EditorBase({"," * content: 'Foo'"," * });"," * editor.render('#demo');"," *"," * @class EditorBase"," * @extends Base"," * @module editor"," * @main editor"," * @submodule editor-base"," * @constructor"," */"," "," var EditorBase = function() {"," EditorBase.superclass.constructor.apply(this, arguments);"," }, LAST_CHILD = ':last-child', BODY = 'body';",""," Y.extend(EditorBase, Y.Base, {"," /**"," * Internal reference to the Y.Frame instance"," * @property frame"," */"," frame: null,"," initializer: function() {"," var frame = new Y.Frame({"," designMode: true,"," title: EditorBase.STRINGS.title,"," use: EditorBase.USE,"," dir: this.get('dir'),"," extracss: this.get('extracss'),"," linkedcss: this.get('linkedcss'),"," defaultblock: this.get('defaultblock'),"," host: this"," }).plug(Y.Plugin.ExecCommand);","",""," frame.after('ready', Y.bind(this._afterFrameReady, this));"," frame.addTarget(this);",""," this.frame = frame;",""," this.publish('nodeChange', {"," emitFacade: true,"," bubbles: true,"," defaultFn: this._defNodeChangeFn"," });"," "," //this.plug(Y.Plugin.EditorPara);"," },"," destructor: function() {"," this.frame.destroy();",""," this.detachAll();"," },"," /**"," * Copy certain styles from one node instance to another (used for new paragraph creation mainly)"," * @method copyStyles"," * @param {Node} from The Node instance to copy the styles from "," * @param {Node} to The Node instance to copy the styles to"," */"," copyStyles: function(from, to) {"," if (from.test('a')) {"," //Don't carry the A styles"," return;"," }"," var styles = ['color', 'fontSize', 'fontFamily', 'backgroundColor', 'fontStyle' ],"," newStyles = {};",""," Y.each(styles, function(v) {"," newStyles[v] = from.getStyle(v);"," });"," if (from.ancestor('b,strong')) {"," newStyles.fontWeight = 'bold';"," }"," if (from.ancestor('u')) {"," if (!newStyles.textDecoration) {"," newStyles.textDecoration = 'underline';"," }"," }"," to.setStyles(newStyles);"," },"," /**"," * Holder for the selection bookmark in IE."," * @property _lastBookmark"," * @private"," */"," _lastBookmark: null,"," /**"," * Resolves the e.changedNode in the nodeChange event if it comes from the document. If"," * the event came from the document, it will get the last child of the last child of the document"," * and return that instead."," * @method _resolveChangedNode"," * @param {Node} n The node to resolve"," * @private"," */"," _resolveChangedNode: function(n) {"," var inst = this.getInstance(), lc, lc2, found;"," if (n && n.test(BODY)) {"," var sel = new inst.EditorSelection();"," if (sel && sel.anchorNode) {"," n = sel.anchorNode;"," }"," }"," if (inst && n && n.test('html')) {"," lc = inst.one(BODY).one(LAST_CHILD);"," while (!found) {"," if (lc) {"," lc2 = lc.one(LAST_CHILD);"," if (lc2) {"," lc = lc2;"," } else {"," found = true;"," }"," } else {"," found = true;"," }"," }"," if (lc) {"," if (lc.test('br')) {"," if (lc.previous()) {"," lc = lc.previous();"," } else {"," lc = lc.get('parentNode');"," }"," }"," if (lc) {"," n = lc;"," }"," }"," }"," if (!n) {"," //Fallback to make sure a node is attached to the event"," n = inst.one(BODY);"," }"," return n;"," },"," /**"," * The default handler for the nodeChange event."," * @method _defNodeChangeFn"," * @param {Event} e The event"," * @private"," */"," _defNodeChangeFn: function(e) {"," var startTime = (new Date()).getTime();"," var inst = this.getInstance(), sel, cur,"," btag = inst.EditorSelection.DEFAULT_BLOCK_TAG;",""," if (Y.UA.ie) {"," try {"," sel = inst.config.doc.selection.createRange();"," if (sel.getBookmark) {"," this._lastBookmark = sel.getBookmark();"," }"," } catch (ie) {}"," }",""," e.changedNode = this._resolveChangedNode(e.changedNode);","",""," /*"," * @TODO"," * This whole method needs to be fixed and made more dynamic."," * Maybe static functions for the e.changeType and an object bag"," * to walk through and filter to pass off the event to before firing.."," */"," "," switch (e.changedType) {"," case 'keydown':"," if (!Y.UA.gecko) {"," if (!EditorBase.NC_KEYS[e.changedEvent.keyCode] && !e.changedEvent.shiftKey && !e.changedEvent.ctrlKey && (e.changedEvent.keyCode !== 13)) {"," //inst.later(100, inst, inst.EditorSelection.cleanCursor);"," }"," }"," break;"," case 'tab':"," if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) {"," e.changedEvent.frameEvent.preventDefault();"," if (Y.UA.webkit) {"," this.execCommand('inserttext', '\\t');"," } else if (Y.UA.gecko) {"," this.frame.exec._command('inserthtml', EditorBase.TABKEY);"," } else if (Y.UA.ie) {"," this.execCommand('inserthtml', EditorBase.TABKEY);"," }"," }"," break;"," case 'backspace-up':"," // Fixes #2531090 - Joins text node strings so they become one for bidi"," if (Y.UA.webkit && e.changedNode) {"," e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));"," }"," break;"," }"," if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) {"," /*"," * When executing execCommand 'indent or 'outdent' Webkit applies"," * a class to the BLOCKQUOTE that adds left/right margin to it"," * This strips that style so it is just a normal BLOCKQUOTE"," */"," var bq = inst.all('.webkit-indent-blockquote, blockquote');"," if (bq.size()) {"," bq.setStyle('margin', '');"," }"," }",""," var changed = this.getDomPath(e.changedNode, false),"," cmds = {}, family, fsize, classes = [],"," fColor = '', bColor = '';",""," if (e.commands) {"," cmds = e.commands;"," }"," "," var normal = false;",""," Y.each(changed, function(el) {"," var tag = el.tagName.toLowerCase(),"," cmd = EditorBase.TAG2CMD[tag];",""," if (cmd) {"," cmds[cmd] = 1;"," }",""," //Bold and Italic styles"," var s = el.currentStyle || el.style;"," "," if ((''+s.fontWeight) == 'normal') {"," normal = true;"," }"," if ((''+s.fontWeight) == 'bold') { //Cast this to a string"," cmds.bold = 1;"," }"," if (Y.UA.ie) {"," if (s.fontWeight > 400) {"," cmds.bold = 1;"," }"," }"," if (s.fontStyle == 'italic') {"," cmds.italic = 1;"," }",""," if (s.textDecoration.indexOf('underline') > -1) {"," cmds.underline = 1;"," }"," if (s.textDecoration.indexOf('line-through') > -1) {"," cmds.strikethrough = 1;"," }"," "," var n = inst.one(el);"," if (n.getStyle('fontFamily')) {"," var family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase();"," if (family2) {"," family = family2;"," }"," if (family) {"," family = family.replace(/'/g, '').replace(/\"/g, '');"," }"," }",""," fsize = EditorBase.NORMALIZE_FONTSIZE(n);","",""," var cls = el.className.split(' ');",""," Y.each(cls, function(v) {"," if (v !== '' && (v.substr(0, 4) !== 'yui_')) {"," classes.push(v);"," }"," });",""," fColor = EditorBase.FILTER_RGB(n.getStyle('color'));"," var bColor2 = EditorBase.FILTER_RGB(s.backgroundColor);"," if (bColor2 !== 'transparent') {"," if (bColor2 !== '') {"," bColor = bColor2;"," }"," }"," "," });"," "," if (normal) {"," delete cmds.bold;"," delete cmds.italic;"," }",""," e.dompath = inst.all(changed);"," e.classNames = classes;"," e.commands = cmds;",""," //TODO Dont' like this, not dynamic enough.."," if (!e.fontFamily) {"," e.fontFamily = family;"," }"," if (!e.fontSize) {"," e.fontSize = fsize;"," }"," if (!e.fontColor) {"," e.fontColor = fColor;"," }"," if (!e.backgroundColor) {"," e.backgroundColor = bColor;"," }",""," var endTime = (new Date()).getTime();"," },"," /**"," * Walk the dom tree from this node up to body, returning a reversed array of parents."," * @method getDomPath"," * @param {Node} node The Node to start from "," */"," getDomPath: function(node, nodeList) {"," var domPath = [], domNode,"," inst = this.frame.getInstance();",""," domNode = inst.Node.getDOMNode(node);"," //return inst.all(domNode);",""," while (domNode !== null) {"," "," if ((domNode === inst.config.doc.documentElement) || (domNode === inst.config.doc) || !domNode.tagName) {"," domNode = null;"," break;"," }"," "," if (!inst.DOM.inDoc(domNode)) {"," domNode = null;"," break;"," }"," "," //Check to see if we get el.nodeName and nodeType"," if (domNode.nodeName && domNode.nodeType && (domNode.nodeType == 1)) {"," domPath.push(domNode);"," }",""," if (domNode == inst.config.doc.body) {"," domNode = null;"," break;"," }",""," domNode = domNode.parentNode;"," }",""," /*{{{ Using Node "," while (node !== null) {"," if (node.test('html') || node.test('doc') || !node.get('tagName')) {"," node = null;"," break;"," }"," if (!node.inDoc()) {"," node = null;"," break;"," }"," //Check to see if we get el.nodeName and nodeType"," if (node.get('nodeName') && node.get('nodeType') && (node.get('nodeType') == 1)) {"," domPath.push(inst.Node.getDOMNode(node));"," }",""," if (node.test('body')) {"," node = null;"," break;"," }",""," node = node.get('parentNode');"," }"," }}}*/",""," if (domPath.length === 0) {"," domPath[0] = inst.config.doc.body;"," }",""," if (nodeList) {"," return inst.all(domPath.reverse());"," } else {"," return domPath.reverse();"," }",""," },"," /**"," * After frame ready, bind mousedown & keyup listeners"," * @method _afterFrameReady"," * @private"," */"," _afterFrameReady: function() {"," var inst = this.frame.getInstance();"," "," this.frame.on('dom:mouseup', Y.bind(this._onFrameMouseUp, this));"," this.frame.on('dom:mousedown', Y.bind(this._onFrameMouseDown, this));"," this.frame.on('dom:keydown', Y.bind(this._onFrameKeyDown, this));",""," if (Y.UA.ie) {"," this.frame.on('dom:activate', Y.bind(this._onFrameActivate, this));"," this.frame.on('dom:beforedeactivate', Y.bind(this._beforeFrameDeactivate, this));"," }"," this.frame.on('dom:keyup', Y.bind(this._onFrameKeyUp, this));"," this.frame.on('dom:keypress', Y.bind(this._onFrameKeyPress, this));"," this.frame.on('dom:paste', Y.bind(this._onPaste, this));",""," inst.EditorSelection.filter();"," this.fire('ready');"," },"," /**"," * Caches the current cursor position in IE."," * @method _beforeFrameDeactivate"," * @private"," */"," _beforeFrameDeactivate: function(e) {"," if (e.frameTarget.test('html')) { //Means it came from a scrollbar"," return;"," }"," var inst = this.getInstance(),"," sel = inst.config.doc.selection.createRange();"," "," if (sel.compareEndPoints && !sel.compareEndPoints('StartToEnd', sel)) {"," sel.pasteHTML('<var id=\"yui-ie-cursor\">');"," }"," },"," /**"," * Moves the cached selection bookmark back so IE can place the cursor in the right place."," * @method _onFrameActivate"," * @private"," */"," _onFrameActivate: function(e) {"," if (e.frameTarget.test('html')) { //Means it came from a scrollbar"," return;"," }"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," range = sel.createRange(),"," cur = inst.all('#yui-ie-cursor');",""," if (cur.size()) {"," cur.each(function(n) {"," n.set('id', '');"," if (range.moveToElementText) {"," try {"," range.moveToElementText(n._node);"," var moved = range.move('character', -1);"," if (moved === -1) { //Only move up if we actually moved back."," range.move('character', 1);"," }"," range.select();"," range.text = '';"," } catch (e) {}"," }"," n.remove();"," });"," }"," },"," /**"," * Fires nodeChange event"," * @method _onPaste"," * @private"," */"," _onPaste: function(e) {"," this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'paste', changedEvent: e.frameEvent });"," },"," /**"," * Fires nodeChange event"," * @method _onFrameMouseUp"," * @private"," */"," _onFrameMouseUp: function(e) {"," this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'mouseup', changedEvent: e.frameEvent });"," },"," /**"," * Fires nodeChange event"," * @method _onFrameMouseDown"," * @private"," */"," _onFrameMouseDown: function(e) {"," this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'mousedown', changedEvent: e.frameEvent });"," },"," /**"," * Caches a copy of the selection for key events. Only creating the selection on keydown"," * @property _currentSelection"," * @private"," */"," _currentSelection: null,"," /**"," * Holds the timer for selection clearing"," * @property _currentSelectionTimer"," * @private"," */"," _currentSelectionTimer: null,"," /**"," * Flag to determine if we can clear the selection or not."," * @property _currentSelectionClear"," * @private"," */"," _currentSelectionClear: null,"," /**"," * Fires nodeChange event"," * @method _onFrameKeyDown"," * @private"," */"," _onFrameKeyDown: function(e) {"," var inst, sel;"," if (!this._currentSelection) {"," if (this._currentSelectionTimer) {"," this._currentSelectionTimer.cancel();"," }"," this._currentSelectionTimer = Y.later(850, this, function() {"," this._currentSelectionClear = true;"," });"," "," inst = this.frame.getInstance();"," sel = new inst.EditorSelection(e);",""," this._currentSelection = sel;"," } else {"," sel = this._currentSelection;"," }",""," inst = this.frame.getInstance();"," sel = new inst.EditorSelection();",""," this._currentSelection = sel;"," "," if (sel && sel.anchorNode) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keydown', changedEvent: e.frameEvent });"," if (EditorBase.NC_KEYS[e.keyCode]) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode], changedEvent: e.frameEvent });"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-down', changedEvent: e.frameEvent });"," }"," }"," },"," /**"," * Fires nodeChange event"," * @method _onFrameKeyPress"," * @private"," */"," _onFrameKeyPress: function(e) {"," var sel = this._currentSelection;",""," if (sel && sel.anchorNode) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keypress', changedEvent: e.frameEvent });"," if (EditorBase.NC_KEYS[e.keyCode]) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-press', changedEvent: e.frameEvent });"," }"," }"," },"," /**"," * Fires nodeChange event for keyup on specific keys"," * @method _onFrameKeyUp"," * @private"," */"," _onFrameKeyUp: function(e) {"," var inst = this.frame.getInstance(),"," sel = new inst.EditorSelection(e);",""," if (sel && sel.anchorNode) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keyup', selection: sel, changedEvent: e.frameEvent });"," if (EditorBase.NC_KEYS[e.keyCode]) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-up', selection: sel, changedEvent: e.frameEvent });"," }"," }"," if (this._currentSelectionClear) {"," this._currentSelectionClear = this._currentSelection = null;"," }"," },"," /**"," * Pass through to the frame.execCommand method"," * @method execCommand"," * @param {String} cmd The command to pass: inserthtml, insertimage, bold"," * @param {String} val The optional value of the command: Helvetica"," * @return {Node/NodeList} The Node or Nodelist affected by the command. Only returns on override commands, not browser defined commands."," */"," execCommand: function(cmd, val) {"," var ret = this.frame.execCommand(cmd, val),"," inst = this.frame.getInstance(),"," sel = new inst.EditorSelection(), cmds = {},"," e = { changedNode: sel.anchorNode, changedType: 'execcommand', nodes: ret };",""," switch (cmd) {"," case 'forecolor':"," e.fontColor = val;"," break;"," case 'backcolor':"," e.backgroundColor = val;"," break;"," case 'fontsize':"," e.fontSize = val;"," break;"," case 'fontname':"," e.fontFamily = val;"," break;"," }",""," cmds[cmd] = 1;"," e.commands = cmds;",""," this.fire('nodeChange', e);",""," return ret;"," },"," /**"," * Get the YUI instance of the frame"," * @method getInstance"," * @return {YUI} The YUI instance bound to the frame."," */"," getInstance: function() {"," return this.frame.getInstance();"," },"," /**"," * Renders the Y.Frame to the passed node."," * @method render"," * @param {Selector/HTMLElement/Node} node The node to append the Editor to"," * @return {EditorBase}"," * @chainable"," */"," render: function(node) {"," this.frame.set('content', this.get('content'));"," this.frame.render(node);"," return this;"," },"," /**"," * Focus the contentWindow of the iframe"," * @method focus"," * @param {Function} fn Callback function to execute after focus happens"," * @return {EditorBase}"," * @chainable"," */"," focus: function(fn) {"," this.frame.focus(fn);"," return this;"," },"," /**"," * Handles the showing of the Editor instance. Currently only handles the iframe"," * @method show"," * @return {EditorBase}"," * @chainable"," */"," show: function() {"," this.frame.show();"," return this;"," },"," /**"," * Handles the hiding of the Editor instance. Currently only handles the iframe"," * @method hide"," * @return {EditorBase}"," * @chainable"," */"," hide: function() {"," this.frame.hide();"," return this;"," },"," /**"," * (Un)Filters the content of the Editor, cleaning YUI related code. //TODO better filtering"," * @method getContent"," * @return {String} The filtered content of the Editor"," */"," getContent: function() {"," var html = '', inst = this.getInstance();"," if (inst && inst.EditorSelection) {"," html = inst.EditorSelection.unfilter();"," }"," //Removing the _yuid from the objects in IE"," html = html.replace(/ _yuid=\"([^>]*)\"/g, '');"," return html;"," }"," }, {"," /**"," * @static"," * @method NORMALIZE_FONTSIZE"," * @description Pulls the fontSize from a node, then checks for string values (x-large, x-small)"," * and converts them to pixel sizes. If the parsed size is different from the original, it calls"," * node.setStyle to update the node with a pixel size for normalization."," */"," NORMALIZE_FONTSIZE: function(n) {"," var size = n.getStyle('fontSize'), oSize = size;"," "," switch (size) {"," case '-webkit-xxx-large':"," size = '48px';"," break;"," case 'xx-large':"," size = '32px';"," break;"," case 'x-large':"," size = '24px';"," break;"," case 'large':"," size = '18px';"," break;"," case 'medium':"," size = '16px';"," break;"," case 'small':"," size = '13px';"," break;"," case 'x-small':"," size = '10px';"," break;"," }"," if (oSize !== size) {"," n.setStyle('fontSize', size);"," }"," return size;"," },"," /**"," * @static"," * @property TABKEY"," * @description The HTML markup to use for the tabkey"," */"," TABKEY: '<span class=\"tab\"> </span>',"," /**"," * @static"," * @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;"," }, "," /**"," * @static"," * @property TAG2CMD"," * @description A hash table of tags to their execcomand's"," */"," TAG2CMD: {"," 'b': 'bold',"," 'strong': 'bold',"," 'i': 'italic',"," 'em': 'italic',"," 'u': 'underline',"," 'sup': 'superscript',"," 'sub': 'subscript',"," 'img': 'insertimage',"," 'a' : 'createlink',"," 'ul' : 'insertunorderedlist',"," 'ol' : 'insertorderedlist'"," },"," /**"," * Hash table of keys to fire a nodeChange event for."," * @static"," * @property NC_KEYS"," * @type Object"," */"," NC_KEYS: {"," 8: 'backspace',"," 9: 'tab',"," 13: 'enter',"," 32: 'space',"," 33: 'pageup',"," 34: 'pagedown',"," 35: 'end',"," 36: 'home',"," 37: 'left',"," 38: 'up',"," 39: 'right',"," 40: 'down',"," 46: 'delete'"," },"," /**"," * The default modules to use inside the Frame"," * @static"," * @property USE"," * @type Array"," */"," USE: ['substitute', 'node', 'selector-css3', 'editor-selection', 'stylesheet'],"," /**"," * The Class Name: editorBase"," * @static"," * @property NAME"," */"," NAME: 'editorBase',"," /**"," * Editor Strings. By default contains only the `title` property for the"," * Title of frame document (default \"Rich Text Editor\")."," *"," * @static"," * @property STRINGS"," */"," STRINGS: {"," title: 'Rich Text Editor'"," },"," ATTRS: {"," /**"," * The content to load into the Editor Frame"," * @attribute content"," */"," content: {"," value: '<br class=\"yui-cursor\">',"," setter: function(str) {"," if (str.substr(0, 1) === \"\\n\") {"," str = str.substr(1);"," }"," if (str === '') {"," str = '<br class=\"yui-cursor\">';"," }"," if (str === ' ') {"," if (Y.UA.gecko) {"," str = '<br class=\"yui-cursor\">';"," }"," }"," return this.frame.set('content', str);"," },"," getter: function() {"," return this.frame.get('content');"," }"," },"," /**"," * The value of the dir attribute on the HTML element of the frame. Default: ltr"," * @attribute dir"," */"," dir: {"," writeOnce: true,"," value: 'ltr'"," },"," /**"," * @attribute linkedcss"," * @description An array of url's to external linked style sheets"," * @type String"," */ "," linkedcss: {"," value: '',"," setter: function(css) {"," if (this.frame) {"," this.frame.set('linkedcss', css);"," }"," return css;"," }"," },"," /**"," * @attribute extracss"," * @description A string of CSS to add to the Head of the Editor"," * @type String"," */ "," extracss: {"," value: false,"," setter: function(css) {"," if (this.frame) {"," this.frame.set('extracss', css);"," }"," return css;"," }"," },"," /**"," * @attribute defaultblock"," * @description The default tag to use for block level items, defaults to: p"," * @type String"," */ "," defaultblock: {"," value: 'p'"," }"," }"," });",""," Y.EditorBase = EditorBase;",""," /**"," * @event nodeChange"," * @description Fired from several mouse/key/paste event points."," * @param {Event.Facade} event An Event Facade object with the following specific properties added:"," * <dl>"," * <dt>changedEvent</dt><dd>The event that caused the nodeChange</dd>"," * <dt>changedNode</dt><dd>The node that was interacted with</dd>"," * <dt>changedType</dt><dd>The type of change: mousedown, mouseup, right, left, backspace, tab, enter, etc..</dd>"," * <dt>commands</dt><dd>The list of execCommands that belong to this change and the dompath that's associated with the changedNode</dd>"," * <dt>classNames</dt><dd>An array of classNames that are applied to the changedNode and all of it's parents</dd>"," * <dt>dompath</dt><dd>A sorted array of node instances that make up the DOM path from the changedNode to body.</dd>"," * <dt>backgroundColor</dt><dd>The cascaded backgroundColor of the changedNode</dd>"," * <dt>fontColor</dt><dd>The cascaded fontColor of the changedNode</dd>"," * <dt>fontFamily</dt><dd>The cascaded fontFamily of the changedNode</dd>"," * <dt>fontSize</dt><dd>The cascaded fontSize of the changedNode</dd>"," * </dl>"," * @type {Event.Custom}"," */",""," /**"," * @event ready"," * @description Fired after the frame is ready."," * @param {Event.Facade} event An Event Facade object."," * @type {Event.Custom}"," */","","","","","","}, '3.7.2', {\"requires\": [\"base\", \"frame\", \"node\", \"exec-command\", \"editor-selection\"]});"];-_yuitest_coverage["build/editor-base/editor-base.js"].lines = {"1":0,"20":0,"21":0,"24":0,"31":0,"43":0,"44":0,"46":0,"48":0,"57":0,"59":0,"68":0,"70":0,"72":0,"75":0,"76":0,"78":0,"79":0,"81":0,"82":0,"83":0,"86":0,"103":0,"104":0,"105":0,"106":0,"107":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"118":0,"121":0,"124":0,"125":0,"126":0,"127":0,"129":0,"132":0,"133":0,"137":0,"139":0,"141":0,"150":0,"151":0,"154":0,"155":0,"156":0,"157":0,"158":0,"163":0,"173":0,"175":0,"176":0,"180":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"189":0,"192":0,"195":0,"196":0,"198":0,"200":0,"206":0,"207":0,"208":0,"212":0,"216":0,"217":0,"220":0,"222":0,"223":0,"226":0,"227":0,"231":0,"233":0,"234":0,"236":0,"237":0,"239":0,"240":0,"241":0,"244":0,"245":0,"248":0,"249":0,"251":0,"252":0,"255":0,"256":0,"257":0,"258":0,"259":0,"261":0,"262":0,"266":0,"269":0,"271":0,"272":0,"273":0,"277":0,"278":0,"279":0,"280":0,"281":0,"287":0,"288":0,"289":0,"292":0,"293":0,"294":0,"297":0,"298":0,"300":0,"301":0,"303":0,"304":0,"306":0,"307":0,"310":0,"318":0,"321":0,"324":0,"326":0,"327":0,"328":0,"331":0,"332":0,"333":0,"337":0,"338":0,"341":0,"342":0,"343":0,"346":0,"373":0,"374":0,"377":0,"378":0,"380":0,"390":0,"392":0,"393":0,"394":0,"396":0,"397":0,"398":0,"400":0,"401":0,"402":0,"404":0,"405":0,"413":0,"414":0,"416":0,"419":0,"420":0,"429":0,"430":0,"432":0,"437":0,"438":0,"439":0,"440":0,"441":0,"442":0,"443":0,"444":0,"445":0,"447":0,"448":0,"451":0,"461":0,"469":0,"477":0,"503":0,"504":0,"505":0,"506":0,"508":0,"509":0,"512":0,"513":0,"515":0,"517":0,"520":0,"521":0,"523":0,"525":0,"526":0,"527":0,"528":0,"529":0,"539":0,"541":0,"542":0,"543":0,"544":0,"554":0,"557":0,"558":0,"559":0,"560":0,"563":0,"564":0,"575":0,"580":0,"582":0,"583":0,"585":0,"586":0,"588":0,"589":0,"591":0,"592":0,"595":0,"596":0,"598":0,"600":0,"608":0,"618":0,"619":0,"620":0,"630":0,"631":0,"640":0,"641":0,"650":0,"651":0,"659":0,"660":0,"661":0,"664":0,"665":0,"676":0,"678":0,"680":0,"681":0,"683":0,"684":0,"686":0,"687":0,"689":0,"690":0,"692":0,"693":0,"695":0,"696":0,"698":0,"699":0,"701":0,"702":0,"704":0,"720":0,"721":0,"722":0,"724":0,"725":0,"726":0,"727":0,"729":0,"730":0,"731":0,"733":0,"736":0,"808":0,"809":0,"811":0,"812":0,"814":0,"815":0,"816":0,"819":0,"822":0,"841":0,"842":0,"844":0,"855":0,"856":0,"858":0,"872":0};-_yuitest_coverage["build/editor-base/editor-base.js"].functions = {"EditorBase:20":0,"initializer:30":0,"destructor:56":0,"(anonymous 2):75":0,"copyStyles:67":0,"_resolveChangedNode:102":0,"(anonymous 4):271":0,"(anonymous 3):222":0,"_defNodeChangeFn:149":0,"getDomPath:317":0,"_afterFrameReady:389":0,"_beforeFrameDeactivate:412":0,"(anonymous 5):438":0,"_onFrameActivate:428":0,"_onPaste:460":0,"_onFrameMouseUp:468":0,"_onFrameMouseDown:476":0,"(anonymous 6):508":0,"_onFrameKeyDown:502":0,"_onFrameKeyPress:538":0,"_onFrameKeyUp:553":0,"execCommand:574":0,"getInstance:607":0,"render:617":0,"focus:629":0,"show:639":0,"hide:649":0,"getContent:658":0,"NORMALIZE_FONTSIZE:675":0,"FILTER_RGB:719":0,"setter:807":0,"getter:821":0,"setter:840":0,"setter:854":0,"(anonymous 1):1":0};-_yuitest_coverage["build/editor-base/editor-base.js"].coveredLines = 289;+_yuitest_coverage["build/editor-base/editor-base.js"].code=["YUI.add('editor-base', function (Y, NAME) {","",""," /**"," * Base class for Editor. Handles the business logic of Editor, no GUI involved only utility methods and events."," *"," * var editor = new Y.EditorBase({"," * content: 'Foo'"," * });"," * editor.render('#demo');"," *"," * @class EditorBase"," * @extends Base"," * @module editor"," * @main editor"," * @submodule editor-base"," * @constructor"," */",""," var EditorBase = function() {"," EditorBase.superclass.constructor.apply(this, arguments);"," }, LAST_CHILD = ':last-child', BODY = 'body';",""," Y.extend(EditorBase, Y.Base, {"," /**"," * Internal reference to the Y.Frame instance"," * @property frame"," */"," frame: null,"," initializer: function() {"," var frame = new Y.Frame({"," designMode: true,"," title: EditorBase.STRINGS.title,"," use: EditorBase.USE,"," dir: this.get('dir'),"," extracss: this.get('extracss'),"," linkedcss: this.get('linkedcss'),"," defaultblock: this.get('defaultblock'),"," host: this"," }).plug(Y.Plugin.ExecCommand);","",""," frame.after('ready', Y.bind(this._afterFrameReady, this));"," frame.addTarget(this);",""," this.frame = frame;",""," this.publish('nodeChange', {"," emitFacade: true,"," bubbles: true,"," defaultFn: this._defNodeChangeFn"," });",""," //this.plug(Y.Plugin.EditorPara);"," },"," destructor: function() {"," this.frame.destroy();",""," this.detachAll();"," },"," /**"," * Copy certain styles from one node instance to another (used for new paragraph creation mainly)"," * @method copyStyles"," * @param {Node} from The Node instance to copy the styles from"," * @param {Node} to The Node instance to copy the styles to"," */"," copyStyles: function(from, to) {"," if (from.test('a')) {"," //Don't carry the A styles"," return;"," }"," var styles = ['color', 'fontSize', 'fontFamily', 'backgroundColor', 'fontStyle' ],"," newStyles = {};",""," Y.each(styles, function(v) {"," newStyles[v] = from.getStyle(v);"," });"," if (from.ancestor('b,strong')) {"," newStyles.fontWeight = 'bold';"," }"," if (from.ancestor('u')) {"," if (!newStyles.textDecoration) {"," newStyles.textDecoration = 'underline';"," }"," }"," to.setStyles(newStyles);"," },"," /**"," * Holder for the selection bookmark in IE."," * @property _lastBookmark"," * @private"," */"," _lastBookmark: null,"," /**"," * Resolves the e.changedNode in the nodeChange event if it comes from the document. If"," * the event came from the document, it will get the last child of the last child of the document"," * and return that instead."," * @method _resolveChangedNode"," * @param {Node} n The node to resolve"," * @private"," */"," _resolveChangedNode: function(n) {"," var inst = this.getInstance(), lc, lc2, found, sel;"," if (n && n.test(BODY)) {"," sel = new inst.EditorSelection();"," if (sel && sel.anchorNode) {"," n = sel.anchorNode;"," }"," }"," if (inst && n && n.test('html')) {"," lc = inst.one(BODY).one(LAST_CHILD);"," while (!found) {"," if (lc) {"," lc2 = lc.one(LAST_CHILD);"," if (lc2) {"," lc = lc2;"," } else {"," found = true;"," }"," } else {"," found = true;"," }"," }"," if (lc) {"," if (lc.test('br')) {"," if (lc.previous()) {"," lc = lc.previous();"," } else {"," lc = lc.get('parentNode');"," }"," }"," if (lc) {"," n = lc;"," }"," }"," }"," if (!n) {"," //Fallback to make sure a node is attached to the event"," n = inst.one(BODY);"," }"," return n;"," },"," /**"," * The default handler for the nodeChange event."," * @method _defNodeChangeFn"," * @param {Event} e The event"," * @private"," */"," _defNodeChangeFn: function(e) {"," var startTime = (new Date()).getTime(),"," inst = this.getInstance(), sel,"," changed, endTime,"," cmds = {}, family, fsize, classes = [],"," fColor = '', bColor = '', bq,"," normal = false;",""," if (Y.UA.ie) {"," try {"," sel = inst.config.doc.selection.createRange();"," if (sel.getBookmark) {"," this._lastBookmark = sel.getBookmark();"," }"," } catch (ie) {}"," }",""," e.changedNode = this._resolveChangedNode(e.changedNode);","",""," /*"," * @TODO"," * This whole method needs to be fixed and made more dynamic."," * Maybe static functions for the e.changeType and an object bag"," * to walk through and filter to pass off the event to before firing.."," */",""," switch (e.changedType) {"," case 'tab':"," if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) {"," e.changedEvent.frameEvent.preventDefault();"," if (Y.UA.webkit) {"," this.execCommand('inserttext', '\\t');"," } else if (Y.UA.gecko) {"," this.frame.exec._command('inserthtml', EditorBase.TABKEY);"," } else if (Y.UA.ie) {"," this.execCommand('inserthtml', EditorBase.TABKEY);"," }"," }"," break;"," case 'backspace-up':"," // Fixes #2531090 - Joins text node strings so they become one for bidi"," if (Y.UA.webkit && e.changedNode) {"," e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));"," }"," break;"," }"," if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) {"," /*"," * When executing execCommand 'indent or 'outdent' Webkit applies"," * a class to the BLOCKQUOTE that adds left/right margin to it"," * This strips that style so it is just a normal BLOCKQUOTE"," */"," bq = inst.all('.webkit-indent-blockquote, blockquote');"," if (bq.size()) {"," bq.setStyle('margin', '');"," }"," }",""," changed = this.getDomPath(e.changedNode, false);",""," if (e.commands) {"," cmds = e.commands;"," }","",""," Y.each(changed, function(el) {"," var tag = el.tagName.toLowerCase(),"," cmd = EditorBase.TAG2CMD[tag], s,"," n, family2, cls, bColor2;",""," if (cmd) {"," cmds[cmd] = 1;"," }",""," //Bold and Italic styles"," s = el.currentStyle || el.style;",""," if ((''+s.fontWeight) === 'normal') {"," normal = true;"," }"," if ((''+s.fontWeight) === 'bold') { //Cast this to a string"," cmds.bold = 1;"," }"," if (Y.UA.ie) {"," if (s.fontWeight > 400) {"," cmds.bold = 1;"," }"," }"," if (s.fontStyle === 'italic') {"," cmds.italic = 1;"," }",""," if (s.textDecoration.indexOf('underline') > -1) {"," cmds.underline = 1;"," }"," if (s.textDecoration.indexOf('line-through') > -1) {"," cmds.strikethrough = 1;"," }",""," n = inst.one(el);"," if (n.getStyle('fontFamily')) {"," family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase();"," if (family2) {"," family = family2;"," }"," if (family) {"," family = family.replace(/'/g, '').replace(/\"/g, '');"," }"," }",""," fsize = EditorBase.NORMALIZE_FONTSIZE(n);","",""," cls = el.className.split(' ');"," Y.each(cls, function(v) {"," if (v !== '' && (v.substr(0, 4) !== 'yui_')) {"," classes.push(v);"," }"," });",""," fColor = EditorBase.FILTER_RGB(n.getStyle('color'));"," bColor2 = EditorBase.FILTER_RGB(s.backgroundColor);"," if (bColor2 !== 'transparent') {"," if (bColor2 !== '') {"," bColor = bColor2;"," }"," }",""," });",""," if (normal) {"," delete cmds.bold;"," delete cmds.italic;"," }",""," e.dompath = inst.all(changed);"," e.classNames = classes;"," e.commands = cmds;",""," //TODO Dont' like this, not dynamic enough.."," if (!e.fontFamily) {"," e.fontFamily = family;"," }"," if (!e.fontSize) {"," e.fontSize = fsize;"," }"," if (!e.fontColor) {"," e.fontColor = fColor;"," }"," if (!e.backgroundColor) {"," e.backgroundColor = bColor;"," }",""," endTime = (new Date()).getTime();"," },"," /**"," * Walk the dom tree from this node up to body, returning a reversed array of parents."," * @method getDomPath"," * @param {Node} node The Node to start from"," */"," getDomPath: function(node, nodeList) {"," var domPath = [], domNode,"," inst = this.frame.getInstance();",""," domNode = inst.Node.getDOMNode(node);"," //return inst.all(domNode);",""," while (domNode !== null) {",""," if ((domNode === inst.config.doc.documentElement) || (domNode === inst.config.doc) || !domNode.tagName) {"," domNode = null;"," break;"," }",""," if (!inst.DOM.inDoc(domNode)) {"," domNode = null;"," break;"," }",""," //Check to see if we get el.nodeName and nodeType"," if (domNode.nodeName && domNode.nodeType && (domNode.nodeType === 1)) {"," domPath.push(domNode);"," }",""," if (domNode === inst.config.doc.body) {"," domNode = null;"," break;"," }",""," domNode = domNode.parentNode;"," }",""," /*{{{ Using Node"," while (node !== null) {"," if (node.test('html') || node.test('doc') || !node.get('tagName')) {"," node = null;"," break;"," }"," if (!node.inDoc()) {"," node = null;"," break;"," }"," //Check to see if we get el.nodeName and nodeType"," if (node.get('nodeName') && node.get('nodeType') && (node.get('nodeType') == 1)) {"," domPath.push(inst.Node.getDOMNode(node));"," }",""," if (node.test('body')) {"," node = null;"," break;"," }",""," node = node.get('parentNode');"," }"," }}}*/",""," if (domPath.length === 0) {"," domPath[0] = inst.config.doc.body;"," }",""," if (nodeList) {"," return inst.all(domPath.reverse());"," } else {"," return domPath.reverse();"," }",""," },"," /**"," * After frame ready, bind mousedown & keyup listeners"," * @method _afterFrameReady"," * @private"," */"," _afterFrameReady: function() {"," var inst = this.frame.getInstance();",""," this.frame.on('dom:mouseup', Y.bind(this._onFrameMouseUp, this));"," this.frame.on('dom:mousedown', Y.bind(this._onFrameMouseDown, this));"," this.frame.on('dom:keydown', Y.bind(this._onFrameKeyDown, this));",""," if (Y.UA.ie) {"," this.frame.on('dom:activate', Y.bind(this._onFrameActivate, this));"," this.frame.on('dom:beforedeactivate', Y.bind(this._beforeFrameDeactivate, this));"," }"," this.frame.on('dom:keyup', Y.bind(this._onFrameKeyUp, this));"," this.frame.on('dom:keypress', Y.bind(this._onFrameKeyPress, this));"," this.frame.on('dom:paste', Y.bind(this._onPaste, this));",""," inst.EditorSelection.filter();"," this.fire('ready');"," },"," /**"," * Caches the current cursor position in IE."," * @method _beforeFrameDeactivate"," * @private"," */"," _beforeFrameDeactivate: function(e) {"," if (e.frameTarget.test('html')) { //Means it came from a scrollbar"," return;"," }"," var inst = this.getInstance(),"," sel = inst.config.doc.selection.createRange();",""," if (sel.compareEndPoints && !sel.compareEndPoints('StartToEnd', sel)) {"," sel.pasteHTML('<var id=\"yui-ie-cursor\">');"," }"," },"," /**"," * Moves the cached selection bookmark back so IE can place the cursor in the right place."," * @method _onFrameActivate"," * @private"," */"," _onFrameActivate: function(e) {"," if (e.frameTarget.test('html')) { //Means it came from a scrollbar"," return;"," }"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," range = sel.createRange(),"," cur = inst.all('#yui-ie-cursor');",""," if (cur.size()) {"," cur.each(function(n) {"," n.set('id', '');"," if (range.moveToElementText) {"," try {"," range.moveToElementText(n._node);"," var moved = range.move('character', -1);"," if (moved === -1) { //Only move up if we actually moved back."," range.move('character', 1);"," }"," range.select();"," range.text = '';"," } catch (e) {}"," }"," n.remove();"," });"," }"," },"," /**"," * Fires nodeChange event"," * @method _onPaste"," * @private"," */"," _onPaste: function(e) {"," this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'paste', changedEvent: e.frameEvent });"," },"," /**"," * Fires nodeChange event"," * @method _onFrameMouseUp"," * @private"," */"," _onFrameMouseUp: function(e) {"," this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'mouseup', changedEvent: e.frameEvent });"," },"," /**"," * Fires nodeChange event"," * @method _onFrameMouseDown"," * @private"," */"," _onFrameMouseDown: function(e) {"," this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'mousedown', changedEvent: e.frameEvent });"," },"," /**"," * Caches a copy of the selection for key events. Only creating the selection on keydown"," * @property _currentSelection"," * @private"," */"," _currentSelection: null,"," /**"," * Holds the timer for selection clearing"," * @property _currentSelectionTimer"," * @private"," */"," _currentSelectionTimer: null,"," /**"," * Flag to determine if we can clear the selection or not."," * @property _currentSelectionClear"," * @private"," */"," _currentSelectionClear: null,"," /**"," * Fires nodeChange event"," * @method _onFrameKeyDown"," * @private"," */"," _onFrameKeyDown: function(e) {"," var inst, sel;"," if (!this._currentSelection) {"," if (this._currentSelectionTimer) {"," this._currentSelectionTimer.cancel();"," }"," this._currentSelectionTimer = Y.later(850, this, function() {"," this._currentSelectionClear = true;"," });",""," inst = this.frame.getInstance();"," sel = new inst.EditorSelection(e);",""," this._currentSelection = sel;"," } else {"," sel = this._currentSelection;"," }",""," inst = this.frame.getInstance();"," sel = new inst.EditorSelection();",""," this._currentSelection = sel;",""," if (sel && sel.anchorNode) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keydown', changedEvent: e.frameEvent });"," if (EditorBase.NC_KEYS[e.keyCode]) {"," this.fire('nodeChange', {"," changedNode: sel.anchorNode,"," changedType: EditorBase.NC_KEYS[e.keyCode],"," changedEvent: e.frameEvent"," });"," this.fire('nodeChange', {"," changedNode: sel.anchorNode,"," changedType: EditorBase.NC_KEYS[e.keyCode] + '-down',"," changedEvent: e.frameEvent"," });"," }"," }"," },"," /**"," * Fires nodeChange event"," * @method _onFrameKeyPress"," * @private"," */"," _onFrameKeyPress: function(e) {"," var sel = this._currentSelection;",""," if (sel && sel.anchorNode) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keypress', changedEvent: e.frameEvent });"," if (EditorBase.NC_KEYS[e.keyCode]) {"," this.fire('nodeChange', {"," changedNode: sel.anchorNode,"," changedType: EditorBase.NC_KEYS[e.keyCode] + '-press',"," changedEvent: e.frameEvent"," });"," }"," }"," },"," /**"," * Fires nodeChange event for keyup on specific keys"," * @method _onFrameKeyUp"," * @private"," */"," _onFrameKeyUp: function(e) {"," var inst = this.frame.getInstance(),"," sel = new inst.EditorSelection(e);",""," if (sel && sel.anchorNode) {"," this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keyup', selection: sel, changedEvent: e.frameEvent });"," if (EditorBase.NC_KEYS[e.keyCode]) {"," this.fire('nodeChange', {"," changedNode: sel.anchorNode,"," changedType: EditorBase.NC_KEYS[e.keyCode] + '-up',"," selection: sel,"," changedEvent: e.frameEvent"," });"," }"," }"," if (this._currentSelectionClear) {"," this._currentSelectionClear = this._currentSelection = null;"," }"," },"," /**"," * Pass through to the frame.execCommand method"," * @method execCommand"," * @param {String} cmd The command to pass: inserthtml, insertimage, bold"," * @param {String} val The optional value of the command: Helvetica"," * @return {Node/NodeList} The Node or Nodelist affected by the command. Only returns on override commands, not browser defined commands."," */"," execCommand: function(cmd, val) {"," var ret = this.frame.execCommand(cmd, val),"," inst = this.frame.getInstance(),"," sel = new inst.EditorSelection(), cmds = {},"," e = { changedNode: sel.anchorNode, changedType: 'execcommand', nodes: ret };",""," switch (cmd) {"," case 'forecolor':"," e.fontColor = val;"," break;"," case 'backcolor':"," e.backgroundColor = val;"," break;"," case 'fontsize':"," e.fontSize = val;"," break;"," case 'fontname':"," e.fontFamily = val;"," break;"," }",""," cmds[cmd] = 1;"," e.commands = cmds;",""," this.fire('nodeChange', e);",""," return ret;"," },"," /**"," * Get the YUI instance of the frame"," * @method getInstance"," * @return {YUI} The YUI instance bound to the frame."," */"," getInstance: function() {"," return this.frame.getInstance();"," },"," /**"," * Renders the Y.Frame to the passed node."," * @method render"," * @param {Selector/HTMLElement/Node} node The node to append the Editor to"," * @return {EditorBase}"," * @chainable"," */"," render: function(node) {"," this.frame.set('content', this.get('content'));"," this.frame.render(node);"," return this;"," },"," /**"," * Focus the contentWindow of the iframe"," * @method focus"," * @param {Function} fn Callback function to execute after focus happens"," * @return {EditorBase}"," * @chainable"," */"," focus: function(fn) {"," this.frame.focus(fn);"," return this;"," },"," /**"," * Handles the showing of the Editor instance. Currently only handles the iframe"," * @method show"," * @return {EditorBase}"," * @chainable"," */"," show: function() {"," this.frame.show();"," return this;"," },"," /**"," * Handles the hiding of the Editor instance. Currently only handles the iframe"," * @method hide"," * @return {EditorBase}"," * @chainable"," */"," hide: function() {"," this.frame.hide();"," return this;"," },"," /**"," * (Un)Filters the content of the Editor, cleaning YUI related code. //TODO better filtering"," * @method getContent"," * @return {String} The filtered content of the Editor"," */"," getContent: function() {"," var html = '', inst = this.getInstance();"," if (inst && inst.EditorSelection) {"," html = inst.EditorSelection.unfilter();"," }"," //Removing the _yuid from the objects in IE"," html = html.replace(/ _yuid=\"([^>]*)\"/g, '');"," return html;"," }"," }, {"," /**"," * @static"," * @method NORMALIZE_FONTSIZE"," * @description Pulls the fontSize from a node, then checks for string values (x-large, x-small)"," * and converts them to pixel sizes. If the parsed size is different from the original, it calls"," * node.setStyle to update the node with a pixel size for normalization."," */"," NORMALIZE_FONTSIZE: function(n) {"," var size = n.getStyle('fontSize'), oSize = size;",""," switch (size) {"," case '-webkit-xxx-large':"," size = '48px';"," break;"," case 'xx-large':"," size = '32px';"," break;"," case 'x-large':"," size = '24px';"," break;"," case 'large':"," size = '18px';"," break;"," case 'medium':"," size = '16px';"," break;"," case 'small':"," size = '13px';"," break;"," case 'x-small':"," size = '10px';"," break;"," }"," if (oSize !== size) {"," n.setStyle('fontSize', size);"," }"," return size;"," },"," /**"," * @static"," * @property TABKEY"," * @description The HTML markup to use for the tabkey"," */"," TABKEY: '<span class=\"tab\"> </span>',"," /**"," * @static"," * @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\"),"," rgb = css.replace(exp, \"$1,$2,$3,$4,$5\").split(','),"," r, g, b;",""," if (rgb.length === 5) {"," r = parseInt(rgb[1], 10).toString(16);"," g = parseInt(rgb[2], 10).toString(16);"," 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;"," },"," /**"," * @static"," * @property TAG2CMD"," * @description A hash table of tags to their execcomand's"," */"," TAG2CMD: {"," 'b': 'bold',"," 'strong': 'bold',"," 'i': 'italic',"," 'em': 'italic',"," 'u': 'underline',"," 'sup': 'superscript',"," 'sub': 'subscript',"," 'img': 'insertimage',"," 'a' : 'createlink',"," 'ul' : 'insertunorderedlist',"," 'ol' : 'insertorderedlist'"," },"," /**"," * Hash table of keys to fire a nodeChange event for."," * @static"," * @property NC_KEYS"," * @type Object"," */"," NC_KEYS: {"," 8: 'backspace',"," 9: 'tab',"," 13: 'enter',"," 32: 'space',"," 33: 'pageup',"," 34: 'pagedown',"," 35: 'end',"," 36: 'home',"," 37: 'left',"," 38: 'up',"," 39: 'right',"," 40: 'down',"," 46: 'delete'"," },"," /**"," * The default modules to use inside the Frame"," * @static"," * @property USE"," * @type Array"," */"," USE: ['substitute', 'node', 'selector-css3', 'editor-selection', 'stylesheet'],"," /**"," * The Class Name: editorBase"," * @static"," * @property NAME"," */"," NAME: 'editorBase',"," /**"," * Editor Strings. By default contains only the `title` property for the"," * Title of frame document (default \"Rich Text Editor\")."," *"," * @static"," * @property STRINGS"," */"," STRINGS: {"," title: 'Rich Text Editor'"," },"," ATTRS: {"," /**"," * The content to load into the Editor Frame"," * @attribute content"," */"," content: {"," value: '<br class=\"yui-cursor\">',"," setter: function(str) {"," if (str.substr(0, 1) === \"\\n\") {"," str = str.substr(1);"," }"," if (str === '') {"," str = '<br class=\"yui-cursor\">';"," }"," if (str === ' ') {"," if (Y.UA.gecko) {"," str = '<br class=\"yui-cursor\">';"," }"," }"," return this.frame.set('content', str);"," },"," getter: function() {"," return this.frame.get('content');"," }"," },"," /**"," * The value of the dir attribute on the HTML element of the frame. Default: ltr"," * @attribute dir"," */"," dir: {"," writeOnce: true,"," value: 'ltr'"," },"," /**"," * @attribute linkedcss"," * @description An array of url's to external linked style sheets"," * @type String"," */"," linkedcss: {"," value: '',"," setter: function(css) {"," if (this.frame) {"," this.frame.set('linkedcss', css);"," }"," return css;"," }"," },"," /**"," * @attribute extracss"," * @description A string of CSS to add to the Head of the Editor"," * @type String"," */"," extracss: {"," value: false,"," setter: function(css) {"," if (this.frame) {"," this.frame.set('extracss', css);"," }"," return css;"," }"," },"," /**"," * @attribute defaultblock"," * @description The default tag to use for block level items, defaults to: p"," * @type String"," */"," defaultblock: {"," value: 'p'"," }"," }"," });",""," Y.EditorBase = EditorBase;",""," /**"," * @event nodeChange"," * @description Fired from several mouse/key/paste event points."," * @param {Event.Facade} event An Event Facade object with the following specific properties added:"," * <dl>"," * <dt>changedEvent</dt><dd>The event that caused the nodeChange</dd>"," * <dt>changedNode</dt><dd>The node that was interacted with</dd>"," * <dt>changedType</dt><dd>The type of change: mousedown, mouseup, right, left, backspace, tab, enter, etc..</dd>"," * <dt>commands</dt><dd>The list of execCommands that belong to this change and the dompath that's associated with the changedNode</dd>"," * <dt>classNames</dt><dd>An array of classNames that are applied to the changedNode and all of it's parents</dd>"," * <dt>dompath</dt><dd>A sorted array of node instances that make up the DOM path from the changedNode to body.</dd>"," * <dt>backgroundColor</dt><dd>The cascaded backgroundColor of the changedNode</dd>"," * <dt>fontColor</dt><dd>The cascaded fontColor of the changedNode</dd>"," * <dt>fontFamily</dt><dd>The cascaded fontFamily of the changedNode</dd>"," * <dt>fontSize</dt><dd>The cascaded fontSize of the changedNode</dd>"," * </dl>"," * @type {Event.Custom}"," */",""," /**"," * @event ready"," * @description Fired after the frame is ready."," * @param {Event.Facade} event An Event Facade object."," * @type {Event.Custom}"," */","","","","","","}, '3.7.3', {\"requires\": [\"base\", \"frame\", \"node\", \"exec-command\", \"editor-selection\"]});"];+_yuitest_coverage["build/editor-base/editor-base.js"].lines = {"1":0,"20":0,"21":0,"24":0,"31":0,"43":0,"44":0,"46":0,"48":0,"57":0,"59":0,"68":0,"70":0,"72":0,"75":0,"76":0,"78":0,"79":0,"81":0,"82":0,"83":0,"86":0,"103":0,"104":0,"105":0,"106":0,"107":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"118":0,"121":0,"124":0,"125":0,"126":0,"127":0,"129":0,"132":0,"133":0,"137":0,"139":0,"141":0,"150":0,"157":0,"158":0,"159":0,"160":0,"161":0,"166":0,"176":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"184":0,"185":0,"188":0,"191":0,"192":0,"194":0,"196":0,"202":0,"203":0,"204":0,"208":0,"210":0,"211":0,"215":0,"216":0,"220":0,"221":0,"225":0,"227":0,"228":0,"230":0,"231":0,"233":0,"234":0,"235":0,"238":0,"239":0,"242":0,"243":0,"245":0,"246":0,"249":0,"250":0,"251":0,"252":0,"253":0,"255":0,"256":0,"260":0,"263":0,"264":0,"265":0,"266":0,"270":0,"271":0,"272":0,"273":0,"274":0,"280":0,"281":0,"282":0,"285":0,"286":0,"287":0,"290":0,"291":0,"293":0,"294":0,"296":0,"297":0,"299":0,"300":0,"303":0,"311":0,"314":0,"317":0,"319":0,"320":0,"321":0,"324":0,"325":0,"326":0,"330":0,"331":0,"334":0,"335":0,"336":0,"339":0,"366":0,"367":0,"370":0,"371":0,"373":0,"383":0,"385":0,"386":0,"387":0,"389":0,"390":0,"391":0,"393":0,"394":0,"395":0,"397":0,"398":0,"406":0,"407":0,"409":0,"412":0,"413":0,"422":0,"423":0,"425":0,"430":0,"431":0,"432":0,"433":0,"434":0,"435":0,"436":0,"437":0,"438":0,"440":0,"441":0,"444":0,"454":0,"462":0,"470":0,"496":0,"497":0,"498":0,"499":0,"501":0,"502":0,"505":0,"506":0,"508":0,"510":0,"513":0,"514":0,"516":0,"518":0,"519":0,"520":0,"521":0,"526":0,"540":0,"542":0,"543":0,"544":0,"545":0,"559":0,"562":0,"563":0,"564":0,"565":0,"573":0,"574":0,"585":0,"590":0,"592":0,"593":0,"595":0,"596":0,"598":0,"599":0,"601":0,"602":0,"605":0,"606":0,"608":0,"610":0,"618":0,"628":0,"629":0,"630":0,"640":0,"641":0,"650":0,"651":0,"660":0,"661":0,"669":0,"670":0,"671":0,"674":0,"675":0,"686":0,"688":0,"690":0,"691":0,"693":0,"694":0,"696":0,"697":0,"699":0,"700":0,"702":0,"703":0,"705":0,"706":0,"708":0,"709":0,"711":0,"712":0,"714":0,"730":0,"731":0,"735":0,"736":0,"737":0,"738":0,"740":0,"741":0,"742":0,"744":0,"747":0,"819":0,"820":0,"822":0,"823":0,"825":0,"826":0,"827":0,"830":0,"833":0,"852":0,"853":0,"855":0,"866":0,"867":0,"869":0,"883":0};+_yuitest_coverage["build/editor-base/editor-base.js"].functions = {"EditorBase:20":0,"initializer:30":0,"destructor:56":0,"(anonymous 2):75":0,"copyStyles:67":0,"_resolveChangedNode:102":0,"(anonymous 4):264":0,"(anonymous 3):215":0,"_defNodeChangeFn:149":0,"getDomPath:310":0,"_afterFrameReady:382":0,"_beforeFrameDeactivate:405":0,"(anonymous 5):431":0,"_onFrameActivate:421":0,"_onPaste:453":0,"_onFrameMouseUp:461":0,"_onFrameMouseDown:469":0,"(anonymous 6):501":0,"_onFrameKeyDown:495":0,"_onFrameKeyPress:539":0,"_onFrameKeyUp:558":0,"execCommand:584":0,"getInstance:617":0,"render:627":0,"focus:639":0,"show:649":0,"hide:659":0,"getContent:668":0,"NORMALIZE_FONTSIZE:685":0,"FILTER_RGB:729":0,"setter:818":0,"getter:832":0,"setter:851":0,"setter:865":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-base/editor-base.js"].coveredLines = 283; _yuitest_coverage["build/editor-base/editor-base.js"].coveredFunctions = 35; _yuitest_coverline("build/editor-base/editor-base.js", 1); YUI.add('editor-base', function (Y, NAME) {@@ -56,7 +56,7 @@ * @submodule editor-base * @constructor */- + _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 1)", 1); _yuitest_coverline("build/editor-base/editor-base.js", 20); var EditorBase = function() {@@ -101,7 +101,7 @@ bubbles: true, defaultFn: this._defNodeChangeFn });- + //this.plug(Y.Plugin.EditorPara); }, destructor: function() {@@ -115,7 +115,7 @@ /** * Copy certain styles from one node instance to another (used for new paragraph creation mainly) * @method copyStyles- * @param {Node} from The Node instance to copy the styles from + * @param {Node} from The Node instance to copy the styles from * @param {Node} to The Node instance to copy the styles to */ copyStyles: function(from, to) {@@ -169,11 +169,11 @@ _resolveChangedNode: function(n) { _yuitest_coverfunc("build/editor-base/editor-base.js", "_resolveChangedNode", 102); _yuitest_coverline("build/editor-base/editor-base.js", 103);-var inst = this.getInstance(), lc, lc2, found;+var inst = this.getInstance(), lc, lc2, found, sel; _yuitest_coverline("build/editor-base/editor-base.js", 104); if (n && n.test(BODY)) { _yuitest_coverline("build/editor-base/editor-base.js", 105);-var sel = new inst.EditorSelection();+sel = new inst.EditorSelection(); _yuitest_coverline("build/editor-base/editor-base.js", 106); if (sel && sel.anchorNode) { _yuitest_coverline("build/editor-base/editor-base.js", 107);@@ -241,26 +241,28 @@ _defNodeChangeFn: function(e) { _yuitest_coverfunc("build/editor-base/editor-base.js", "_defNodeChangeFn", 149); _yuitest_coverline("build/editor-base/editor-base.js", 150);-var startTime = (new Date()).getTime();- _yuitest_coverline("build/editor-base/editor-base.js", 151);-var inst = this.getInstance(), sel, cur,- btag = inst.EditorSelection.DEFAULT_BLOCK_TAG;+var startTime = (new Date()).getTime(),+ inst = this.getInstance(), sel,+ changed, endTime,+ cmds = {}, family, fsize, classes = [],+ fColor = '', bColor = '', bq,+ normal = false; - _yuitest_coverline("build/editor-base/editor-base.js", 154);+ _yuitest_coverline("build/editor-base/editor-base.js", 157); if (Y.UA.ie) {- _yuitest_coverline("build/editor-base/editor-base.js", 155);+ _yuitest_coverline("build/editor-base/editor-base.js", 158); try {- _yuitest_coverline("build/editor-base/editor-base.js", 156);+ _yuitest_coverline("build/editor-base/editor-base.js", 159); sel = inst.config.doc.selection.createRange();- _yuitest_coverline("build/editor-base/editor-base.js", 157);+ _yuitest_coverline("build/editor-base/editor-base.js", 160); if (sel.getBookmark) {- _yuitest_coverline("build/editor-base/editor-base.js", 158);+ _yuitest_coverline("build/editor-base/editor-base.js", 161); this._lastBookmark = sel.getBookmark(); } } catch (ie) {} } - _yuitest_coverline("build/editor-base/editor-base.js", 163);+ _yuitest_coverline("build/editor-base/editor-base.js", 166); e.changedNode = this._resolveChangedNode(e.changedNode); @@ -270,276 +272,262 @@ * Maybe static functions for the e.changeType and an object bag * to walk through and filter to pass off the event to before firing.. */- - _yuitest_coverline("build/editor-base/editor-base.js", 173);++ _yuitest_coverline("build/editor-base/editor-base.js", 176); switch (e.changedType) {- case 'keydown':- _yuitest_coverline("build/editor-base/editor-base.js", 175);-if (!Y.UA.gecko) {- _yuitest_coverline("build/editor-base/editor-base.js", 176);-if (!EditorBase.NC_KEYS[e.changedEvent.keyCode] && !e.changedEvent.shiftKey && !e.changedEvent.ctrlKey && (e.changedEvent.keyCode !== 13)) {- //inst.later(100, inst, inst.EditorSelection.cleanCursor);- }- }- _yuitest_coverline("build/editor-base/editor-base.js", 180);-break; case 'tab':- _yuitest_coverline("build/editor-base/editor-base.js", 182);+ _yuitest_coverline("build/editor-base/editor-base.js", 178); if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) {- _yuitest_coverline("build/editor-base/editor-base.js", 183);+ _yuitest_coverline("build/editor-base/editor-base.js", 179); e.changedEvent.frameEvent.preventDefault();- _yuitest_coverline("build/editor-base/editor-base.js", 184);+ _yuitest_coverline("build/editor-base/editor-base.js", 180); if (Y.UA.webkit) {- _yuitest_coverline("build/editor-base/editor-base.js", 185);+ _yuitest_coverline("build/editor-base/editor-base.js", 181); this.execCommand('inserttext', '\t');- } else {_yuitest_coverline("build/editor-base/editor-base.js", 186);+ } else {_yuitest_coverline("build/editor-base/editor-base.js", 182); if (Y.UA.gecko) {- _yuitest_coverline("build/editor-base/editor-base.js", 187);+ _yuitest_coverline("build/editor-base/editor-base.js", 183); this.frame.exec._command('inserthtml', EditorBase.TABKEY);- } else {_yuitest_coverline("build/editor-base/editor-base.js", 188);+ } else {_yuitest_coverline("build/editor-base/editor-base.js", 184); if (Y.UA.ie) {- _yuitest_coverline("build/editor-base/editor-base.js", 189);+ _yuitest_coverline("build/editor-base/editor-base.js", 185); this.execCommand('inserthtml', EditorBase.TABKEY); }}} }- _yuitest_coverline("build/editor-base/editor-base.js", 192);+ _yuitest_coverline("build/editor-base/editor-base.js", 188); break; case 'backspace-up': // Fixes #2531090 - Joins text node strings so they become one for bidi- _yuitest_coverline("build/editor-base/editor-base.js", 195);+ _yuitest_coverline("build/editor-base/editor-base.js", 191); if (Y.UA.webkit && e.changedNode) {- _yuitest_coverline("build/editor-base/editor-base.js", 196);+ _yuitest_coverline("build/editor-base/editor-base.js", 192); e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));- }- _yuitest_coverline("build/editor-base/editor-base.js", 198);+ }+ _yuitest_coverline("build/editor-base/editor-base.js", 194); break; }- _yuitest_coverline("build/editor-base/editor-base.js", 200);+ _yuitest_coverline("build/editor-base/editor-base.js", 196); if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) { /* * When executing execCommand 'indent or 'outdent' Webkit applies * a class to the BLOCKQUOTE that adds left/right margin to it * This strips that style so it is just a normal BLOCKQUOTE */- _yuitest_coverline("build/editor-base/editor-base.js", 206);-var bq = inst.all('.webkit-indent-blockquote, blockquote');- _yuitest_coverline("build/editor-base/editor-base.js", 207);+ _yuitest_coverline("build/editor-base/editor-base.js", 202);+bq = inst.all('.webkit-indent-blockquote, blockquote');+ _yuitest_coverline("build/editor-base/editor-base.js", 203); if (bq.size()) {- _yuitest_coverline("build/editor-base/editor-base.js", 208);+ _yuitest_coverline("build/editor-base/editor-base.js", 204); bq.setStyle('margin', ''); } } - _yuitest_coverline("build/editor-base/editor-base.js", 212);-var changed = this.getDomPath(e.changedNode, false),- cmds = {}, family, fsize, classes = [],- fColor = '', bColor = '';+ _yuitest_coverline("build/editor-base/editor-base.js", 208);+changed = this.getDomPath(e.changedNode, false); - _yuitest_coverline("build/editor-base/editor-base.js", 216);+ _yuitest_coverline("build/editor-base/editor-base.js", 210); if (e.commands) {- _yuitest_coverline("build/editor-base/editor-base.js", 217);+ _yuitest_coverline("build/editor-base/editor-base.js", 211); cmds = e.commands; }- - _yuitest_coverline("build/editor-base/editor-base.js", 220);-var normal = false; - _yuitest_coverline("build/editor-base/editor-base.js", 222);++ _yuitest_coverline("build/editor-base/editor-base.js", 215); Y.each(changed, function(el) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 3)", 222);-_yuitest_coverline("build/editor-base/editor-base.js", 223);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 3)", 215);+_yuitest_coverline("build/editor-base/editor-base.js", 216); var tag = el.tagName.toLowerCase(),- cmd = EditorBase.TAG2CMD[tag];+ cmd = EditorBase.TAG2CMD[tag], s,+ n, family2, cls, bColor2; - _yuitest_coverline("build/editor-base/editor-base.js", 226);+ _yuitest_coverline("build/editor-base/editor-base.js", 220); if (cmd) {- _yuitest_coverline("build/editor-base/editor-base.js", 227);+ _yuitest_coverline("build/editor-base/editor-base.js", 221); cmds[cmd] = 1; } //Bold and Italic styles- _yuitest_coverline("build/editor-base/editor-base.js", 231);-var s = el.currentStyle || el.style;- - _yuitest_coverline("build/editor-base/editor-base.js", 233);-if ((''+s.fontWeight) == 'normal') {- _yuitest_coverline("build/editor-base/editor-base.js", 234);+ _yuitest_coverline("build/editor-base/editor-base.js", 225);+s = el.currentStyle || el.style;++ _yuitest_coverline("build/editor-base/editor-base.js", 227);+if ((''+s.fontWeight) === 'normal') {+ _yuitest_coverline("build/editor-base/editor-base.js", 228); normal = true; }- _yuitest_coverline("build/editor-base/editor-base.js", 236);-if ((''+s.fontWeight) == 'bold') { //Cast this to a string- _yuitest_coverline("build/editor-base/editor-base.js", 237);+ _yuitest_coverline("build/editor-base/editor-base.js", 230);+if ((''+s.fontWeight) === 'bold') { //Cast this to a string+ _yuitest_coverline("build/editor-base/editor-base.js", 231); cmds.bold = 1; }- _yuitest_coverline("build/editor-base/editor-base.js", 239);+ _yuitest_coverline("build/editor-base/editor-base.js", 233); if (Y.UA.ie) {- _yuitest_coverline("build/editor-base/editor-base.js", 240);+ _yuitest_coverline("build/editor-base/editor-base.js", 234); if (s.fontWeight > 400) {- _yuitest_coverline("build/editor-base/editor-base.js", 241);+ _yuitest_coverline("build/editor-base/editor-base.js", 235); cmds.bold = 1; } }- _yuitest_coverline("build/editor-base/editor-base.js", 244);-if (s.fontStyle == 'italic') {- _yuitest_coverline("build/editor-base/editor-base.js", 245);+ _yuitest_coverline("build/editor-base/editor-base.js", 238);+if (s.fontStyle === 'italic') {+ _yuitest_coverline("build/editor-base/editor-base.js", 239); cmds.italic = 1; } - _yuitest_coverline("build/editor-base/editor-base.js", 248);+ _yuitest_coverline("build/editor-base/editor-base.js", 242); if (s.textDecoration.indexOf('underline') > -1) {- _yuitest_coverline("build/editor-base/editor-base.js", 249);+ _yuitest_coverline("build/editor-base/editor-base.js", 243); cmds.underline = 1; }- _yuitest_coverline("build/editor-base/editor-base.js", 251);+ _yuitest_coverline("build/editor-base/editor-base.js", 245); if (s.textDecoration.indexOf('line-through') > -1) {- _yuitest_coverline("build/editor-base/editor-base.js", 252);+ _yuitest_coverline("build/editor-base/editor-base.js", 246); cmds.strikethrough = 1; }- - _yuitest_coverline("build/editor-base/editor-base.js", 255);-var n = inst.one(el);- _yuitest_coverline("build/editor-base/editor-base.js", 256);++ _yuitest_coverline("build/editor-base/editor-base.js", 249);+n = inst.one(el);+ _yuitest_coverline("build/editor-base/editor-base.js", 250); if (n.getStyle('fontFamily')) {- _yuitest_coverline("build/editor-base/editor-base.js", 257);-var family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase();- _yuitest_coverline("build/editor-base/editor-base.js", 258);+ _yuitest_coverline("build/editor-base/editor-base.js", 251);+family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase();+ _yuitest_coverline("build/editor-base/editor-base.js", 252); if (family2) {- _yuitest_coverline("build/editor-base/editor-base.js", 259);+ _yuitest_coverline("build/editor-base/editor-base.js", 253); family = family2; }- _yuitest_coverline("build/editor-base/editor-base.js", 261);+ _yuitest_coverline("build/editor-base/editor-base.js", 255); if (family) {- _yuitest_coverline("build/editor-base/editor-base.js", 262);+ _yuitest_coverline("build/editor-base/editor-base.js", 256); family = family.replace(/'/g, '').replace(/"/g, ''); } } - _yuitest_coverline("build/editor-base/editor-base.js", 266);+ _yuitest_coverline("build/editor-base/editor-base.js", 260); fsize = EditorBase.NORMALIZE_FONTSIZE(n); - _yuitest_coverline("build/editor-base/editor-base.js", 269);-var cls = el.className.split(' ');-- _yuitest_coverline("build/editor-base/editor-base.js", 271);+ _yuitest_coverline("build/editor-base/editor-base.js", 263);+cls = el.className.split(' ');+ _yuitest_coverline("build/editor-base/editor-base.js", 264); Y.each(cls, function(v) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 4)", 271);-_yuitest_coverline("build/editor-base/editor-base.js", 272);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 4)", 264);+_yuitest_coverline("build/editor-base/editor-base.js", 265); if (v !== '' && (v.substr(0, 4) !== 'yui_')) {- _yuitest_coverline("build/editor-base/editor-base.js", 273);+ _yuitest_coverline("build/editor-base/editor-base.js", 266); classes.push(v); } }); - _yuitest_coverline("build/editor-base/editor-base.js", 277);+ _yuitest_coverline("build/editor-base/editor-base.js", 270); fColor = EditorBase.FILTER_RGB(n.getStyle('color'));- _yuitest_coverline("build/editor-base/editor-base.js", 278);-var bColor2 = EditorBase.FILTER_RGB(s.backgroundColor);- _yuitest_coverline("build/editor-base/editor-base.js", 279);+ _yuitest_coverline("build/editor-base/editor-base.js", 271);+bColor2 = EditorBase.FILTER_RGB(s.backgroundColor);+ _yuitest_coverline("build/editor-base/editor-base.js", 272); if (bColor2 !== 'transparent') {- _yuitest_coverline("build/editor-base/editor-base.js", 280);+ _yuitest_coverline("build/editor-base/editor-base.js", 273); if (bColor2 !== '') {- _yuitest_coverline("build/editor-base/editor-base.js", 281);+ _yuitest_coverline("build/editor-base/editor-base.js", 274); bColor = bColor2; } }- + });- - _yuitest_coverline("build/editor-base/editor-base.js", 287);++ _yuitest_coverline("build/editor-base/editor-base.js", 280); if (normal) {- _yuitest_coverline("build/editor-base/editor-base.js", 288);+ _yuitest_coverline("build/editor-base/editor-base.js", 281); delete cmds.bold;- _yuitest_coverline("build/editor-base/editor-base.js", 289);+ _yuitest_coverline("build/editor-base/editor-base.js", 282); delete cmds.italic; } - _yuitest_coverline("build/editor-base/editor-base.js", 292);+ _yuitest_coverline("build/editor-base/editor-base.js", 285); e.dompath = inst.all(changed);- _yuitest_coverline("build/editor-base/editor-base.js", 293);+ _yuitest_coverline("build/editor-base/editor-base.js", 286); e.classNames = classes;- _yuitest_coverline("build/editor-base/editor-base.js", 294);+ _yuitest_coverline("build/editor-base/editor-base.js", 287); e.commands = cmds; //TODO Dont' like this, not dynamic enough..- _yuitest_coverline("build/editor-base/editor-base.js", 297);+ _yuitest_coverline("build/editor-base/editor-base.js", 290); if (!e.fontFamily) {- _yuitest_coverline("build/editor-base/editor-base.js", 298);+ _yuitest_coverline("build/editor-base/editor-base.js", 291); e.fontFamily = family; }- _yuitest_coverline("build/editor-base/editor-base.js", 300);+ _yuitest_coverline("build/editor-base/editor-base.js", 293); if (!e.fontSize) {- _yuitest_coverline("build/editor-base/editor-base.js", 301);+ _yuitest_coverline("build/editor-base/editor-base.js", 294); e.fontSize = fsize; }- _yuitest_coverline("build/editor-base/editor-base.js", 303);+ _yuitest_coverline("build/editor-base/editor-base.js", 296); if (!e.fontColor) {- _yuitest_coverline("build/editor-base/editor-base.js", 304);+ _yuitest_coverline("build/editor-base/editor-base.js", 297); e.fontColor = fColor; }- _yuitest_coverline("build/editor-base/editor-base.js", 306);+ _yuitest_coverline("build/editor-base/editor-base.js", 299); if (!e.backgroundColor) {- _yuitest_coverline("build/editor-base/editor-base.js", 307);+ _yuitest_coverline("build/editor-base/editor-base.js", 300); e.backgroundColor = bColor; } - _yuitest_coverline("build/editor-base/editor-base.js", 310);-var endTime = (new Date()).getTime();+ _yuitest_coverline("build/editor-base/editor-base.js", 303);+endTime = (new Date()).getTime(); }, /** * Walk the dom tree from this node up to body, returning a reversed array of parents. * @method getDomPath- * @param {Node} node The Node to start from + * @param {Node} node The Node to start from */ getDomPath: function(node, nodeList) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "getDomPath", 317);-_yuitest_coverline("build/editor-base/editor-base.js", 318);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "getDomPath", 310);+_yuitest_coverline("build/editor-base/editor-base.js", 311); var domPath = [], domNode, inst = this.frame.getInstance(); - _yuitest_coverline("build/editor-base/editor-base.js", 321);+ _yuitest_coverline("build/editor-base/editor-base.js", 314); domNode = inst.Node.getDOMNode(node); //return inst.all(domNode); - _yuitest_coverline("build/editor-base/editor-base.js", 324);+ _yuitest_coverline("build/editor-base/editor-base.js", 317); while (domNode !== null) {- - _yuitest_coverline("build/editor-base/editor-base.js", 326);++ _yuitest_coverline("build/editor-base/editor-base.js", 319); if ((domNode === inst.config.doc.documentElement) || (domNode === inst.config.doc) || !domNode.tagName) {- _yuitest_coverline("build/editor-base/editor-base.js", 327);+ _yuitest_coverline("build/editor-base/editor-base.js", 320); domNode = null;- _yuitest_coverline("build/editor-base/editor-base.js", 328);+ _yuitest_coverline("build/editor-base/editor-base.js", 321); break; }- - _yuitest_coverline("build/editor-base/editor-base.js", 331);++ _yuitest_coverline("build/editor-base/editor-base.js", 324); if (!inst.DOM.inDoc(domNode)) {- _yuitest_coverline("build/editor-base/editor-base.js", 332);+ _yuitest_coverline("build/editor-base/editor-base.js", 325); domNode = null;- _yuitest_coverline("build/editor-base/editor-base.js", 333);+ _yuitest_coverline("build/editor-base/editor-base.js", 326); break; }- + //Check to see if we get el.nodeName and nodeType- _yuitest_coverline("build/editor-base/editor-base.js", 337);-if (domNode.nodeName && domNode.nodeType && (domNode.nodeType == 1)) {- _yuitest_coverline("build/editor-base/editor-base.js", 338);+ _yuitest_coverline("build/editor-base/editor-base.js", 330);+if (domNode.nodeName && domNode.nodeType && (domNode.nodeType === 1)) {+ _yuitest_coverline("build/editor-base/editor-base.js", 331); domPath.push(domNode); } - _yuitest_coverline("build/editor-base/editor-base.js", 341);-if (domNode == inst.config.doc.body) {- _yuitest_coverline("build/editor-base/editor-base.js", 342);+ _yuitest_coverline("build/editor-base/editor-base.js", 334);+if (domNode === inst.config.doc.body) {+ _yuitest_coverline("build/editor-base/editor-base.js", 335); domNode = null;- _yuitest_coverline("build/editor-base/editor-base.js", 343);+ _yuitest_coverline("build/editor-base/editor-base.js", 336); break; } - _yuitest_coverline("build/editor-base/editor-base.js", 346);+ _yuitest_coverline("build/editor-base/editor-base.js", 339); domNode = domNode.parentNode; } - /*{{{ Using Node + /*{{{ Using Node while (node !== null) { if (node.test('html') || node.test('doc') || !node.get('tagName')) { node = null;@@ -563,18 +551,18 @@ } }}}*/ - _yuitest_coverline("build/editor-base/editor-base.js", 373);+ _yuitest_coverline("build/editor-base/editor-base.js", 366); if (domPath.length === 0) {- _yuitest_coverline("build/editor-base/editor-base.js", 374);+ _yuitest_coverline("build/editor-base/editor-base.js", 367); domPath[0] = inst.config.doc.body; } - _yuitest_coverline("build/editor-base/editor-base.js", 377);+ _yuitest_coverline("build/editor-base/editor-base.js", 370); if (nodeList) {- _yuitest_coverline("build/editor-base/editor-base.js", 378);+ _yuitest_coverline("build/editor-base/editor-base.js", 371); return inst.all(domPath.reverse()); } else {- _yuitest_coverline("build/editor-base/editor-base.js", 380);+ _yuitest_coverline("build/editor-base/editor-base.js", 373); return domPath.reverse(); } @@ -585,34 +573,34 @@ * @private */ _afterFrameReady: function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_afterFrameReady", 389);-_yuitest_coverline("build/editor-base/editor-base.js", 390);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_afterFrameReady", 382);+_yuitest_coverline("build/editor-base/editor-base.js", 383); var inst = this.frame.getInstance();- - _yuitest_coverline("build/editor-base/editor-base.js", 392);++ _yuitest_coverline("build/editor-base/editor-base.js", 385); this.frame.on('dom:mouseup', Y.bind(this._onFrameMouseUp, this));- _yuitest_coverline("build/editor-base/editor-base.js", 393);+ _yuitest_coverline("build/editor-base/editor-base.js", 386); this.frame.on('dom:mousedown', Y.bind(this._onFrameMouseDown, this));- _yuitest_coverline("build/editor-base/editor-base.js", 394);+ _yuitest_coverline("build/editor-base/editor-base.js", 387); this.frame.on('dom:keydown', Y.bind(this._onFrameKeyDown, this)); - _yuitest_coverline("build/editor-base/editor-base.js", 396);+ _yuitest_coverline("build/editor-base/editor-base.js", 389); if (Y.UA.ie) {- _yuitest_coverline("build/editor-base/editor-base.js", 397);+ _yuitest_coverline("build/editor-base/editor-base.js", 390); this.frame.on('dom:activate', Y.bind(this._onFrameActivate, this));- _yuitest_coverline("build/editor-base/editor-base.js", 398);+ _yuitest_coverline("build/editor-base/editor-base.js", 391); this.frame.on('dom:beforedeactivate', Y.bind(this._beforeFrameDeactivate, this)); }- _yuitest_coverline("build/editor-base/editor-base.js", 400);+ _yuitest_coverline("build/editor-base/editor-base.js", 393); this.frame.on('dom:keyup', Y.bind(this._onFrameKeyUp, this));- _yuitest_coverline("build/editor-base/editor-base.js", 401);+ _yuitest_coverline("build/editor-base/editor-base.js", 394); this.frame.on('dom:keypress', Y.bind(this._onFrameKeyPress, this));- _yuitest_coverline("build/editor-base/editor-base.js", 402);+ _yuitest_coverline("build/editor-base/editor-base.js", 395); this.frame.on('dom:paste', Y.bind(this._onPaste, this)); - _yuitest_coverline("build/editor-base/editor-base.js", 404);+ _yuitest_coverline("build/editor-base/editor-base.js", 397); inst.EditorSelection.filter();- _yuitest_coverline("build/editor-base/editor-base.js", 405);+ _yuitest_coverline("build/editor-base/editor-base.js", 398); this.fire('ready'); }, /**@@ -621,19 +609,19 @@ * @private */ _beforeFrameDeactivate: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_beforeFrameDeactivate", 412);-_yuitest_coverline("build/editor-base/editor-base.js", 413);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_beforeFrameDeactivate", 405);+_yuitest_coverline("build/editor-base/editor-base.js", 406); if (e.frameTarget.test('html')) { //Means it came from a scrollbar- _yuitest_coverline("build/editor-base/editor-base.js", 414);+ _yuitest_coverline("build/editor-base/editor-base.js", 407); return; }- _yuitest_coverline("build/editor-base/editor-base.js", 416);+ _yuitest_coverline("build/editor-base/editor-base.js", 409); var inst = this.getInstance(), sel = inst.config.doc.selection.createRange();- - _yuitest_coverline("build/editor-base/editor-base.js", 419);++ _yuitest_coverline("build/editor-base/editor-base.js", 412); if (sel.compareEndPoints && !sel.compareEndPoints('StartToEnd', sel)) {- _yuitest_coverline("build/editor-base/editor-base.js", 420);+ _yuitest_coverline("build/editor-base/editor-base.js", 413); sel.pasteHTML('<var id="yui-ie-cursor">'); } },@@ -643,45 +631,45 @@ * @private */ _onFrameActivate: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameActivate", 428);-_yuitest_coverline("build/editor-base/editor-base.js", 429);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameActivate", 421);+_yuitest_coverline("build/editor-base/editor-base.js", 422); if (e.frameTarget.test('html')) { //Means it came from a scrollbar- _yuitest_coverline("build/editor-base/editor-base.js", 430);+ _yuitest_coverline("build/editor-base/editor-base.js", 423); return; }- _yuitest_coverline("build/editor-base/editor-base.js", 432);+ _yuitest_coverline("build/editor-base/editor-base.js", 425); var inst = this.getInstance(), sel = new inst.EditorSelection(), range = sel.createRange(), cur = inst.all('#yui-ie-cursor'); - _yuitest_coverline("build/editor-base/editor-base.js", 437);+ _yuitest_coverline("build/editor-base/editor-base.js", 430); if (cur.size()) {- _yuitest_coverline("build/editor-base/editor-base.js", 438);+ _yuitest_coverline("build/editor-base/editor-base.js", 431); cur.each(function(n) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 5)", 438);-_yuitest_coverline("build/editor-base/editor-base.js", 439);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 5)", 431);+_yuitest_coverline("build/editor-base/editor-base.js", 432); n.set('id', '');- _yuitest_coverline("build/editor-base/editor-base.js", 440);+ _yuitest_coverline("build/editor-base/editor-base.js", 433); if (range.moveToElementText) {- _yuitest_coverline("build/editor-base/editor-base.js", 441);+ _yuitest_coverline("build/editor-base/editor-base.js", 434); try {- _yuitest_coverline("build/editor-base/editor-base.js", 442);+ _yuitest_coverline("build/editor-base/editor-base.js", 435); range.moveToElementText(n._node);- _yuitest_coverline("build/editor-base/editor-base.js", 443);+ _yuitest_coverline("build/editor-base/editor-base.js", 436); var moved = range.move('character', -1);- _yuitest_coverline("build/editor-base/editor-base.js", 444);+ _yuitest_coverline("build/editor-base/editor-base.js", 437); if (moved === -1) { //Only move up if we actually moved back.- _yuitest_coverline("build/editor-base/editor-base.js", 445);+ _yuitest_coverline("build/editor-base/editor-base.js", 438); range.move('character', 1); }- _yuitest_coverline("build/editor-base/editor-base.js", 447);+ _yuitest_coverline("build/editor-base/editor-base.js", 440); range.select();- _yuitest_coverline("build/editor-base/editor-base.js", 448);+ _yuitest_coverline("build/editor-base/editor-base.js", 441); range.text = ''; } catch (e) {} }- _yuitest_coverline("build/editor-base/editor-base.js", 451);+ _yuitest_coverline("build/editor-base/editor-base.js", 444); n.remove(); }); }@@ -692,8 +680,8 @@ * @private */ _onPaste: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onPaste", 460);-_yuitest_coverline("build/editor-base/editor-base.js", 461);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onPaste", 453);+_yuitest_coverline("build/editor-base/editor-base.js", 454); this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'paste', changedEvent: e.frameEvent }); }, /**@@ -702,8 +690,8 @@ * @private */ _onFrameMouseUp: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameMouseUp", 468);-_yuitest_coverline("build/editor-base/editor-base.js", 469);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameMouseUp", 461);+_yuitest_coverline("build/editor-base/editor-base.js", 462); this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'mouseup', changedEvent: e.frameEvent }); }, /**@@ -712,8 +700,8 @@ * @private */ _onFrameMouseDown: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameMouseDown", 476);-_yuitest_coverline("build/editor-base/editor-base.js", 477);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameMouseDown", 469);+_yuitest_coverline("build/editor-base/editor-base.js", 470); this.fire('nodeChange', { changedNode: e.frameTarget, changedType: 'mousedown', changedEvent: e.frameEvent }); }, /**@@ -740,53 +728,61 @@ * @private */ _onFrameKeyDown: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameKeyDown", 502);-_yuitest_coverline("build/editor-base/editor-base.js", 503);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameKeyDown", 495);+_yuitest_coverline("build/editor-base/editor-base.js", 496); var inst, sel;- _yuitest_coverline("build/editor-base/editor-base.js", 504);+ _yuitest_coverline("build/editor-base/editor-base.js", 497); if (!this._currentSelection) {- _yuitest_coverline("build/editor-base/editor-base.js", 505);+ _yuitest_coverline("build/editor-base/editor-base.js", 498); if (this._currentSelectionTimer) {- _yuitest_coverline("build/editor-base/editor-base.js", 506);+ _yuitest_coverline("build/editor-base/editor-base.js", 499); this._currentSelectionTimer.cancel(); }- _yuitest_coverline("build/editor-base/editor-base.js", 508);+ _yuitest_coverline("build/editor-base/editor-base.js", 501); this._currentSelectionTimer = Y.later(850, this, function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 6)", 508);-_yuitest_coverline("build/editor-base/editor-base.js", 509);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "(anonymous 6)", 501);+_yuitest_coverline("build/editor-base/editor-base.js", 502); this._currentSelectionClear = true; });- - _yuitest_coverline("build/editor-base/editor-base.js", 512);++ _yuitest_coverline("build/editor-base/editor-base.js", 505); inst = this.frame.getInstance();- _yuitest_coverline("build/editor-base/editor-base.js", 513);+ _yuitest_coverline("build/editor-base/editor-base.js", 506); sel = new inst.EditorSelection(e); - _yuitest_coverline("build/editor-base/editor-base.js", 515);+ _yuitest_coverline("build/editor-base/editor-base.js", 508); this._currentSelection = sel; } else {- _yuitest_coverline("build/editor-base/editor-base.js", 517);+ _yuitest_coverline("build/editor-base/editor-base.js", 510); sel = this._currentSelection; } - _yuitest_coverline("build/editor-base/editor-base.js", 520);+ _yuitest_coverline("build/editor-base/editor-base.js", 513); inst = this.frame.getInstance();- _yuitest_coverline("build/editor-base/editor-base.js", 521);+ _yuitest_coverline("build/editor-base/editor-base.js", 514); sel = new inst.EditorSelection(); - _yuitest_coverline("build/editor-base/editor-base.js", 523);+ _yuitest_coverline("build/editor-base/editor-base.js", 516); this._currentSelection = sel;- - _yuitest_coverline("build/editor-base/editor-base.js", 525);++ _yuitest_coverline("build/editor-base/editor-base.js", 518); if (sel && sel.anchorNode) {- _yuitest_coverline("build/editor-base/editor-base.js", 526);+ _yuitest_coverline("build/editor-base/editor-base.js", 519); this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keydown', changedEvent: e.frameEvent });- _yuitest_coverline("build/editor-base/editor-base.js", 527);+ _yuitest_coverline("build/editor-base/editor-base.js", 520); if (EditorBase.NC_KEYS[e.keyCode]) {- _yuitest_coverline("build/editor-base/editor-base.js", 528);-this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode], changedEvent: e.frameEvent });- _yuitest_coverline("build/editor-base/editor-base.js", 529);-this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-down', changedEvent: e.frameEvent });+ _yuitest_coverline("build/editor-base/editor-base.js", 521);+this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode],+ changedEvent: e.frameEvent+ });+ _yuitest_coverline("build/editor-base/editor-base.js", 526);+this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-down',+ changedEvent: e.frameEvent+ }); } } },@@ -796,18 +792,22 @@ * @private */ _onFrameKeyPress: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameKeyPress", 538);-_yuitest_coverline("build/editor-base/editor-base.js", 539);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameKeyPress", 539);+_yuitest_coverline("build/editor-base/editor-base.js", 540); var sel = this._currentSelection; - _yuitest_coverline("build/editor-base/editor-base.js", 541);+ _yuitest_coverline("build/editor-base/editor-base.js", 542); if (sel && sel.anchorNode) {- _yuitest_coverline("build/editor-base/editor-base.js", 542);-this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keypress', changedEvent: e.frameEvent }); _yuitest_coverline("build/editor-base/editor-base.js", 543);+this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keypress', changedEvent: e.frameEvent });+ _yuitest_coverline("build/editor-base/editor-base.js", 544); if (EditorBase.NC_KEYS[e.keyCode]) {- _yuitest_coverline("build/editor-base/editor-base.js", 544);-this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-press', changedEvent: e.frameEvent });+ _yuitest_coverline("build/editor-base/editor-base.js", 545);+this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-press',+ changedEvent: e.frameEvent+ }); } } },@@ -817,24 +817,29 @@ * @private */ _onFrameKeyUp: function(e) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameKeyUp", 553);-_yuitest_coverline("build/editor-base/editor-base.js", 554);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "_onFrameKeyUp", 558);+_yuitest_coverline("build/editor-base/editor-base.js", 559); var inst = this.frame.getInstance(), sel = new inst.EditorSelection(e); - _yuitest_coverline("build/editor-base/editor-base.js", 557);+ _yuitest_coverline("build/editor-base/editor-base.js", 562); if (sel && sel.anchorNode) {- _yuitest_coverline("build/editor-base/editor-base.js", 558);+ _yuitest_coverline("build/editor-base/editor-base.js", 563); this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keyup', selection: sel, changedEvent: e.frameEvent });- _yuitest_coverline("build/editor-base/editor-base.js", 559);+ _yuitest_coverline("build/editor-base/editor-base.js", 564); if (EditorBase.NC_KEYS[e.keyCode]) {- _yuitest_coverline("build/editor-base/editor-base.js", 560);-this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-up', selection: sel, changedEvent: e.frameEvent });+ _yuitest_coverline("build/editor-base/editor-base.js", 565);+this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-up',+ selection: sel,+ changedEvent: e.frameEvent+ }); } }- _yuitest_coverline("build/editor-base/editor-base.js", 563);+ _yuitest_coverline("build/editor-base/editor-base.js", 573); if (this._currentSelectionClear) {- _yuitest_coverline("build/editor-base/editor-base.js", 564);+ _yuitest_coverline("build/editor-base/editor-base.js", 574); this._currentSelectionClear = this._currentSelection = null; } },@@ -846,46 +851,46 @@ * @return {Node/NodeList} The Node or Nodelist affected by the command. Only returns on override commands, not browser defined commands. */ execCommand: function(cmd, val) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "execCommand", 574);-_yuitest_coverline("build/editor-base/editor-base.js", 575);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "execCommand", 584);+_yuitest_coverline("build/editor-base/editor-base.js", 585); var ret = this.frame.execCommand(cmd, val), inst = this.frame.getInstance(), sel = new inst.EditorSelection(), cmds = {}, e = { changedNode: sel.anchorNode, changedType: 'execcommand', nodes: ret }; - _yuitest_coverline("build/editor-base/editor-base.js", 580);+ _yuitest_coverline("build/editor-base/editor-base.js", 590); switch (cmd) { case 'forecolor':- _yuitest_coverline("build/editor-base/editor-base.js", 582);+ _yuitest_coverline("build/editor-base/editor-base.js", 592); e.fontColor = val;- _yuitest_coverline("build/editor-base/editor-base.js", 583);+ _yuitest_coverline("build/editor-base/editor-base.js", 593); break; case 'backcolor':- _yuitest_coverline("build/editor-base/editor-base.js", 585);+ _yuitest_coverline("build/editor-base/editor-base.js", 595); e.backgroundColor = val;- _yuitest_coverline("build/editor-base/editor-base.js", 586);+ _yuitest_coverline("build/editor-base/editor-base.js", 596); break; case 'fontsize':- _yuitest_coverline("build/editor-base/editor-base.js", 588);+ _yuitest_coverline("build/editor-base/editor-base.js", 598); e.fontSize = val;- _yuitest_coverline("build/editor-base/editor-base.js", 589);+ _yuitest_coverline("build/editor-base/editor-base.js", 599); break; case 'fontname':- _yuitest_coverline("build/editor-base/editor-base.js", 591);+ _yuitest_coverline("build/editor-base/editor-base.js", 601); e.fontFamily = val;- _yuitest_coverline("build/editor-base/editor-base.js", 592);+ _yuitest_coverline("build/editor-base/editor-base.js", 602); break; } - _yuitest_coverline("build/editor-base/editor-base.js", 595);+ _yuitest_coverline("build/editor-base/editor-base.js", 605); cmds[cmd] = 1;- _yuitest_coverline("build/editor-base/editor-base.js", 596);+ _yuitest_coverline("build/editor-base/editor-base.js", 606); e.commands = cmds; - _yuitest_coverline("build/editor-base/editor-base.js", 598);+ _yuitest_coverline("build/editor-base/editor-base.js", 608); this.fire('nodeChange', e); - _yuitest_coverline("build/editor-base/editor-base.js", 600);+ _yuitest_coverline("build/editor-base/editor-base.js", 610); return ret; }, /**@@ -894,8 +899,8 @@ * @return {YUI} The YUI instance bound to the frame. */ getInstance: function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "getInstance", 607);-_yuitest_coverline("build/editor-base/editor-base.js", 608);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "getInstance", 617);+_yuitest_coverline("build/editor-base/editor-base.js", 618); return this.frame.getInstance(); }, /**@@ -906,12 +911,12 @@ * @chainable */ render: function(node) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "render", 617);-_yuitest_coverline("build/editor-base/editor-base.js", 618);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "render", 627);+_yuitest_coverline("build/editor-base/editor-base.js", 628); this.frame.set('content', this.get('content'));- _yuitest_coverline("build/editor-base/editor-base.js", 619);+ _yuitest_coverline("build/editor-base/editor-base.js", 629); this.frame.render(node);- _yuitest_coverline("build/editor-base/editor-base.js", 620);+ _yuitest_coverline("build/editor-base/editor-base.js", 630); return this; }, /**@@ -922,10 +927,10 @@ * @chainable */ focus: function(fn) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "focus", 629);-_yuitest_coverline("build/editor-base/editor-base.js", 630);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "focus", 639);+_yuitest_coverline("build/editor-base/editor-base.js", 640); this.frame.focus(fn);- _yuitest_coverline("build/editor-base/editor-base.js", 631);+ _yuitest_coverline("build/editor-base/editor-base.js", 641); return this; }, /**@@ -935,10 +940,10 @@ * @chainable */ show: function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "show", 639);-_yuitest_coverline("build/editor-base/editor-base.js", 640);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "show", 649);+_yuitest_coverline("build/editor-base/editor-base.js", 650); this.frame.show();- _yuitest_coverline("build/editor-base/editor-base.js", 641);+ _yuitest_coverline("build/editor-base/editor-base.js", 651); return this; }, /**@@ -948,10 +953,10 @@ * @chainable */ hide: function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "hide", 649);-_yuitest_coverline("build/editor-base/editor-base.js", 650);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "hide", 659);+_yuitest_coverline("build/editor-base/editor-base.js", 660); this.frame.hide();- _yuitest_coverline("build/editor-base/editor-base.js", 651);+ _yuitest_coverline("build/editor-base/editor-base.js", 661); return this; }, /**@@ -960,18 +965,18 @@ * @return {String} The filtered content of the Editor */ getContent: function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "getContent", 658);-_yuitest_coverline("build/editor-base/editor-base.js", 659);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "getContent", 668);+_yuitest_coverline("build/editor-base/editor-base.js", 669); var html = '', inst = this.getInstance();- _yuitest_coverline("build/editor-base/editor-base.js", 660);+ _yuitest_coverline("build/editor-base/editor-base.js", 670); if (inst && inst.EditorSelection) {- _yuitest_coverline("build/editor-base/editor-base.js", 661);+ _yuitest_coverline("build/editor-base/editor-base.js", 671); html = inst.EditorSelection.unfilter(); } //Removing the _yuid from the objects in IE- _yuitest_coverline("build/editor-base/editor-base.js", 664);+ _yuitest_coverline("build/editor-base/editor-base.js", 674); html = html.replace(/ _yuid="([^>]*)"/g, '');- _yuitest_coverline("build/editor-base/editor-base.js", 665);+ _yuitest_coverline("build/editor-base/editor-base.js", 675); return html; } }, {@@ -983,54 +988,54 @@ * node.setStyle to update the node with a pixel size for normalization. */ NORMALIZE_FONTSIZE: function(n) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "NORMALIZE_FONTSIZE", 675);-_yuitest_coverline("build/editor-base/editor-base.js", 676);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "NORMALIZE_FONTSIZE", 685);+_yuitest_coverline("build/editor-base/editor-base.js", 686); var size = n.getStyle('fontSize'), oSize = size;- - _yuitest_coverline("build/editor-base/editor-base.js", 678);++ _yuitest_coverline("build/editor-base/editor-base.js", 688); switch (size) { case '-webkit-xxx-large':- _yuitest_coverline("build/editor-base/editor-base.js", 680);+ _yuitest_coverline("build/editor-base/editor-base.js", 690); size = '48px';- _yuitest_coverline("build/editor-base/editor-base.js", 681);+ _yuitest_coverline("build/editor-base/editor-base.js", 691); break; case 'xx-large':- _yuitest_coverline("build/editor-base/editor-base.js", 683);+ _yuitest_coverline("build/editor-base/editor-base.js", 693); size = '32px';- _yuitest_coverline("build/editor-base/editor-base.js", 684);+ _yuitest_coverline("build/editor-base/editor-base.js", 694); break; case 'x-large':- _yuitest_coverline("build/editor-base/editor-base.js", 686);+ _yuitest_coverline("build/editor-base/editor-base.js", 696); size = '24px';- _yuitest_coverline("build/editor-base/editor-base.js", 687);+ _yuitest_coverline("build/editor-base/editor-base.js", 697); break; case 'large':- _yuitest_coverline("build/editor-base/editor-base.js", 689);+ _yuitest_coverline("build/editor-base/editor-base.js", 699); size = '18px';- _yuitest_coverline("build/editor-base/editor-base.js", 690);+ _yuitest_coverline("build/editor-base/editor-base.js", 700); break; case 'medium':- _yuitest_coverline("build/editor-base/editor-base.js", 692);+ _yuitest_coverline("build/editor-base/editor-base.js", 702); size = '16px';- _yuitest_coverline("build/editor-base/editor-base.js", 693);+ _yuitest_coverline("build/editor-base/editor-base.js", 703); break; case 'small':- _yuitest_coverline("build/editor-base/editor-base.js", 695);+ _yuitest_coverline("build/editor-base/editor-base.js", 705); size = '13px';- _yuitest_coverline("build/editor-base/editor-base.js", 696);+ _yuitest_coverline("build/editor-base/editor-base.js", 706); break; case 'x-small':- _yuitest_coverline("build/editor-base/editor-base.js", 698);+ _yuitest_coverline("build/editor-base/editor-base.js", 708); size = '10px';- _yuitest_coverline("build/editor-base/editor-base.js", 699);+ _yuitest_coverline("build/editor-base/editor-base.js", 709); break; }- _yuitest_coverline("build/editor-base/editor-base.js", 701);+ _yuitest_coverline("build/editor-base/editor-base.js", 711); if (oSize !== size) {- _yuitest_coverline("build/editor-base/editor-base.js", 702);+ _yuitest_coverline("build/editor-base/editor-base.js", 712); n.setStyle('fontSize', size); }- _yuitest_coverline("build/editor-base/editor-base.js", 704);+ _yuitest_coverline("build/editor-base/editor-base.js", 714); return size; }, /**@@ -1047,37 +1052,37 @@ * @return String */ FILTER_RGB: function(css) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "FILTER_RGB", 719);-_yuitest_coverline("build/editor-base/editor-base.js", 720);-if (css.toLowerCase().indexOf('rgb') != -1) {- _yuitest_coverline("build/editor-base/editor-base.js", 721);-var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");- _yuitest_coverline("build/editor-base/editor-base.js", 722);-var rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(',');- - _yuitest_coverline("build/editor-base/editor-base.js", 724);-if (rgb.length == 5) {- _yuitest_coverline("build/editor-base/editor-base.js", 725);-var r = parseInt(rgb[1], 10).toString(16);- _yuitest_coverline("build/editor-base/editor-base.js", 726);-var g = parseInt(rgb[2], 10).toString(16);- _yuitest_coverline("build/editor-base/editor-base.js", 727);-var b = parseInt(rgb[3], 10).toString(16);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "FILTER_RGB", 729);+_yuitest_coverline("build/editor-base/editor-base.js", 730);+if (css.toLowerCase().indexOf('rgb') !== -1) {+ _yuitest_coverline("build/editor-base/editor-base.js", 731);+var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"),+ rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','),+ r, g, b; - _yuitest_coverline("build/editor-base/editor-base.js", 729);-r = r.length == 1 ? '0' + r : r;- _yuitest_coverline("build/editor-base/editor-base.js", 730);-g = g.length == 1 ? '0' + g : g;- _yuitest_coverline("build/editor-base/editor-base.js", 731);-b = b.length == 1 ? '0' + b : b;+ _yuitest_coverline("build/editor-base/editor-base.js", 735);+if (rgb.length === 5) {+ _yuitest_coverline("build/editor-base/editor-base.js", 736);+r = parseInt(rgb[1], 10).toString(16);+ _yuitest_coverline("build/editor-base/editor-base.js", 737);+g = parseInt(rgb[2], 10).toString(16);+ _yuitest_coverline("build/editor-base/editor-base.js", 738);+b = parseInt(rgb[3], 10).toString(16); - _yuitest_coverline("build/editor-base/editor-base.js", 733);+ _yuitest_coverline("build/editor-base/editor-base.js", 740);+r = r.length === 1 ? '0' + r : r;+ _yuitest_coverline("build/editor-base/editor-base.js", 741);+g = g.length === 1 ? '0' + g : g;+ _yuitest_coverline("build/editor-base/editor-base.js", 742);+b = b.length === 1 ? '0' + b : b;++ _yuitest_coverline("build/editor-base/editor-base.js", 744); css = "#" + r + g + b; } }- _yuitest_coverline("build/editor-base/editor-base.js", 736);+ _yuitest_coverline("build/editor-base/editor-base.js", 747); return css;- }, + }, /** * @static * @property TAG2CMD@@ -1148,31 +1153,31 @@ content: { value: '<br class="yui-cursor">', setter: function(str) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "setter", 807);-_yuitest_coverline("build/editor-base/editor-base.js", 808);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "setter", 818);+_yuitest_coverline("build/editor-base/editor-base.js", 819); if (str.substr(0, 1) === "\n") {- _yuitest_coverline("build/editor-base/editor-base.js", 809);+ _yuitest_coverline("build/editor-base/editor-base.js", 820); str = str.substr(1); }- _yuitest_coverline("build/editor-base/editor-base.js", 811);+ _yuitest_coverline("build/editor-base/editor-base.js", 822); if (str === '') {- _yuitest_coverline("build/editor-base/editor-base.js", 812);+ _yuitest_coverline("build/editor-base/editor-base.js", 823); str = '<br class="yui-cursor">'; }- _yuitest_coverline("build/editor-base/editor-base.js", 814);+ _yuitest_coverline("build/editor-base/editor-base.js", 825); if (str === ' ') {- _yuitest_coverline("build/editor-base/editor-base.js", 815);+ _yuitest_coverline("build/editor-base/editor-base.js", 826); if (Y.UA.gecko) {- _yuitest_coverline("build/editor-base/editor-base.js", 816);+ _yuitest_coverline("build/editor-base/editor-base.js", 827); str = '<br class="yui-cursor">'; } }- _yuitest_coverline("build/editor-base/editor-base.js", 819);+ _yuitest_coverline("build/editor-base/editor-base.js", 830); return this.frame.set('content', str); }, getter: function() {- _yuitest_coverfunc("build/editor-base/editor-base.js", "getter", 821);-_yuitest_coverline("build/editor-base/editor-base.js", 822);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "getter", 832);+_yuitest_coverline("build/editor-base/editor-base.js", 833); return this.frame.get('content'); } },@@ -1188,17 +1193,17 @@ * @attribute linkedcss * @description An array of url's to external linked style sheets * @type String- */ + */ linkedcss: { value: '', setter: function(css) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "setter", 840);-_yuitest_coverline("build/editor-base/editor-base.js", 841);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "setter", 851);+_yuitest_coverline("build/editor-base/editor-base.js", 852); if (this.frame) {- _yuitest_coverline("build/editor-base/editor-base.js", 842);+ _yuitest_coverline("build/editor-base/editor-base.js", 853); this.frame.set('linkedcss', css); }- _yuitest_coverline("build/editor-base/editor-base.js", 844);+ _yuitest_coverline("build/editor-base/editor-base.js", 855); return css; } },@@ -1206,17 +1211,17 @@ * @attribute extracss * @description A string of CSS to add to the Head of the Editor * @type String- */ + */ extracss: { value: false, setter: function(css) {- _yuitest_coverfunc("build/editor-base/editor-base.js", "setter", 854);-_yuitest_coverline("build/editor-base/editor-base.js", 855);+ _yuitest_coverfunc("build/editor-base/editor-base.js", "setter", 865);+_yuitest_coverline("build/editor-base/editor-base.js", 866); if (this.frame) {- _yuitest_coverline("build/editor-base/editor-base.js", 856);+ _yuitest_coverline("build/editor-base/editor-base.js", 867); this.frame.set('extracss', css); }- _yuitest_coverline("build/editor-base/editor-base.js", 858);+ _yuitest_coverline("build/editor-base/editor-base.js", 869); return css; } },@@ -1224,14 +1229,14 @@ * @attribute defaultblock * @description The default tag to use for block level items, defaults to: p * @type String- */ + */ defaultblock: { value: 'p' } } }); - _yuitest_coverline("build/editor-base/editor-base.js", 872);+ _yuitest_coverline("build/editor-base/editor-base.js", 883); Y.EditorBase = EditorBase; /**@@ -1264,4 +1269,4 @@ -}, '3.7.2', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});+}, '3.7.3', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});
bundle/editor-base/editor-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -22,7 +22,7 @@ * @submodule editor-base * @constructor */- + var EditorBase = function() { EditorBase.superclass.constructor.apply(this, arguments); }, LAST_CHILD = ':last-child', BODY = 'body';@@ -56,7 +56,7 @@ bubbles: true, defaultFn: this._defNodeChangeFn });- + //this.plug(Y.Plugin.EditorPara); }, destructor: function() {@@ -67,7 +67,7 @@ /** * Copy certain styles from one node instance to another (used for new paragraph creation mainly) * @method copyStyles- * @param {Node} from The Node instance to copy the styles from + * @param {Node} from The Node instance to copy the styles from * @param {Node} to The Node instance to copy the styles to */ copyStyles: function(from, to) {@@ -106,9 +106,9 @@ * @private */ _resolveChangedNode: function(n) {- var inst = this.getInstance(), lc, lc2, found;+ var inst = this.getInstance(), lc, lc2, found, sel; if (n && n.test(BODY)) {- var sel = new inst.EditorSelection();+ sel = new inst.EditorSelection(); if (sel && sel.anchorNode) { n = sel.anchorNode; }@@ -153,10 +153,12 @@ * @private */ _defNodeChangeFn: function(e) {- var startTime = (new Date()).getTime();- //Y.log('Default nodeChange function: ' + e.changedType, 'info', 'editor');- var inst = this.getInstance(), sel, cur,- btag = inst.EditorSelection.DEFAULT_BLOCK_TAG;+ var startTime = (new Date()).getTime(),+ inst = this.getInstance(), sel,+ changed, endTime,+ cmds = {}, family, fsize, classes = [],+ fColor = '', bColor = '', bq,+ normal = false; if (Y.UA.ie) { try {@@ -176,15 +178,8 @@ * Maybe static functions for the e.changeType and an object bag * to walk through and filter to pass off the event to before firing.. */- + switch (e.changedType) {- case 'keydown':- if (!Y.UA.gecko) {- if (!EditorBase.NC_KEYS[e.changedEvent.keyCode] && !e.changedEvent.shiftKey && !e.changedEvent.ctrlKey && (e.changedEvent.keyCode !== 13)) {- //inst.later(100, inst, inst.EditorSelection.cleanCursor);- }- }- break; case 'tab': if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) { e.changedEvent.frameEvent.preventDefault();@@ -201,8 +196,8 @@ case 'backspace-up': // Fixes #2531090 - Joins text node strings so they become one for bidi if (Y.UA.webkit && e.changedNode) {- e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));- }+ e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));+ } break; } if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) {@@ -211,37 +206,35 @@ * a class to the BLOCKQUOTE that adds left/right margin to it * This strips that style so it is just a normal BLOCKQUOTE */- var bq = inst.all('.webkit-indent-blockquote, blockquote');+ bq = inst.all('.webkit-indent-blockquote, blockquote'); if (bq.size()) { bq.setStyle('margin', ''); } } - var changed = this.getDomPath(e.changedNode, false),- cmds = {}, family, fsize, classes = [],- fColor = '', bColor = '';+ changed = this.getDomPath(e.changedNode, false); if (e.commands) { cmds = e.commands; }- - var normal = false; + Y.each(changed, function(el) { var tag = el.tagName.toLowerCase(),- cmd = EditorBase.TAG2CMD[tag];+ cmd = EditorBase.TAG2CMD[tag], s,+ n, family2, cls, bColor2; if (cmd) { cmds[cmd] = 1; } //Bold and Italic styles- var s = el.currentStyle || el.style;- - if ((''+s.fontWeight) == 'normal') {+ s = el.currentStyle || el.style;++ if ((''+s.fontWeight) === 'normal') { normal = true; }- if ((''+s.fontWeight) == 'bold') { //Cast this to a string+ if ((''+s.fontWeight) === 'bold') { //Cast this to a string cmds.bold = 1; } if (Y.UA.ie) {@@ -249,7 +242,7 @@ cmds.bold = 1; } }- if (s.fontStyle == 'italic') {+ if (s.fontStyle === 'italic') { cmds.italic = 1; } @@ -259,10 +252,10 @@ if (s.textDecoration.indexOf('line-through') > -1) { cmds.strikethrough = 1; }- - var n = inst.one(el);++ n = inst.one(el); if (n.getStyle('fontFamily')) {- var family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase();+ family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase(); if (family2) { family = family2; }@@ -274,8 +267,7 @@ fsize = EditorBase.NORMALIZE_FONTSIZE(n); - var cls = el.className.split(' ');-+ cls = el.className.split(' '); Y.each(cls, function(v) { if (v !== '' && (v.substr(0, 4) !== 'yui_')) { classes.push(v);@@ -283,15 +275,15 @@ }); fColor = EditorBase.FILTER_RGB(n.getStyle('color'));- var bColor2 = EditorBase.FILTER_RGB(s.backgroundColor);+ bColor2 = EditorBase.FILTER_RGB(s.backgroundColor); if (bColor2 !== 'transparent') { if (bColor2 !== '') { bColor = bColor2; } }- + });- + if (normal) { delete cmds.bold; delete cmds.italic;@@ -315,39 +307,39 @@ e.backgroundColor = bColor; } - var endTime = (new Date()).getTime();+ endTime = (new Date()).getTime(); Y.log('_defNodeChangeTimer 2: ' + (endTime - startTime) + 'ms', 'info', 'selection'); }, /** * Walk the dom tree from this node up to body, returning a reversed array of parents. * @method getDomPath- * @param {Node} node The Node to start from + * @param {Node} node The Node to start from */ getDomPath: function(node, nodeList) {- var domPath = [], domNode,+ var domPath = [], domNode, inst = this.frame.getInstance(); domNode = inst.Node.getDOMNode(node); //return inst.all(domNode); while (domNode !== null) {- + if ((domNode === inst.config.doc.documentElement) || (domNode === inst.config.doc) || !domNode.tagName) { domNode = null; break; }- + if (!inst.DOM.inDoc(domNode)) { domNode = null; break; }- + //Check to see if we get el.nodeName and nodeType- if (domNode.nodeName && domNode.nodeType && (domNode.nodeType == 1)) {+ if (domNode.nodeName && domNode.nodeType && (domNode.nodeType === 1)) { domPath.push(domNode); } - if (domNode == inst.config.doc.body) {+ if (domNode === inst.config.doc.body) { domNode = null; break; }@@ -355,7 +347,7 @@ domNode = domNode.parentNode; } - /*{{{ Using Node + /*{{{ Using Node while (node !== null) { if (node.test('html') || node.test('doc') || !node.get('tagName')) { node = null;@@ -397,7 +389,7 @@ */ _afterFrameReady: function() { var inst = this.frame.getInstance();- + this.frame.on('dom:mouseup', Y.bind(this._onFrameMouseUp, this)); this.frame.on('dom:mousedown', Y.bind(this._onFrameMouseDown, this)); this.frame.on('dom:keydown', Y.bind(this._onFrameKeyDown, this));@@ -424,7 +416,7 @@ } var inst = this.getInstance(), sel = inst.config.doc.selection.createRange();- + if (sel.compareEndPoints && !sel.compareEndPoints('StartToEnd', sel)) { sel.pasteHTML('<var id="yui-ie-cursor">'); }@@ -517,7 +509,7 @@ this._currentSelectionTimer = Y.later(850, this, function() { this._currentSelectionClear = true; });- + inst = this.frame.getInstance(); sel = new inst.EditorSelection(e); @@ -530,12 +522,20 @@ sel = new inst.EditorSelection(); this._currentSelection = sel;- + if (sel && sel.anchorNode) { this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keydown', changedEvent: e.frameEvent }); if (EditorBase.NC_KEYS[e.keyCode]) {- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode], changedEvent: e.frameEvent });- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-down', changedEvent: e.frameEvent });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode],+ changedEvent: e.frameEvent+ });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-down',+ changedEvent: e.frameEvent+ }); } } },@@ -550,7 +550,11 @@ if (sel && sel.anchorNode) { this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keypress', changedEvent: e.frameEvent }); if (EditorBase.NC_KEYS[e.keyCode]) {- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-press', changedEvent: e.frameEvent });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-press',+ changedEvent: e.frameEvent+ }); } } },@@ -566,7 +570,12 @@ if (sel && sel.anchorNode) { this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keyup', selection: sel, changedEvent: e.frameEvent }); if (EditorBase.NC_KEYS[e.keyCode]) {- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-up', selection: sel, changedEvent: e.frameEvent });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-up',+ selection: sel,+ changedEvent: e.frameEvent+ }); } } if (this._currentSelectionClear) {@@ -683,7 +692,7 @@ */ NORMALIZE_FONTSIZE: function(n) { var size = n.getStyle('fontSize'), oSize = size;- + switch (size) { case '-webkit-xxx-large': size = '48px';@@ -726,24 +735,25 @@ * @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);+ if (css.toLowerCase().indexOf('rgb') !== -1) {+ var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"),+ rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','),+ r, g, b; - r = r.length == 1 ? '0' + r : r;- g = g.length == 1 ? '0' + g : g;- b = b.length == 1 ? '0' + b : b;+ if (rgb.length === 5) {+ r = parseInt(rgb[1], 10).toString(16);+ g = parseInt(rgb[2], 10).toString(16);+ 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;- }, + }, /** * @static * @property TAG2CMD@@ -844,7 +854,7 @@ * @attribute linkedcss * @description An array of url's to external linked style sheets * @type String- */ + */ linkedcss: { value: '', setter: function(css) {@@ -858,7 +868,7 @@ * @attribute extracss * @description A string of CSS to add to the Head of the Editor * @type String- */ + */ extracss: { value: false, setter: function(css) {@@ -872,7 +882,7 @@ * @attribute defaultblock * @description The default tag to use for block level items, defaults to: p * @type String- */ + */ defaultblock: { value: 'p' }@@ -911,4 +921,4 @@ -}, '3.7.2', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});+}, '3.7.3', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});
bundle/editor-base/editor-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r=":last-child",i="body";e.extend(n,e.Base,{frame:null,initializer:function(){var t=(new e.Frame({designMode:!0,title:n.STRINGS.title,use:n.USE,dir:this.get("dir"),extracss:this.get("extracss"),linkedcss:this.get("linkedcss"),defaultblock:this.get("defaultblock"),host:this})).plug(e.Plugin.ExecCommand);t.after("ready",e.bind(this._afterFrameReady,this)),t.addTarget(this),this.frame=t,this.publish("nodeChange",{emitFacade:!0,bubbles:!0,defaultFn:this._defNodeChangeFn})},destructor:function(){this.frame.destroy(),this.detachAll()},copyStyles:function(t,n){if(t.test("a"))return;var r=["color","fontSize","fontFamily","backgroundColor","fontStyle"],i={};e.each(r,function(e){i[e]=t.getStyle(e)}),t.ancestor("b,strong")&&(i.fontWeight="bold"),t.ancestor("u")&&(i.textDecoration||(i.textDecoration="underline")),n.setStyles(i)},_lastBookmark:null,_resolveChangedNode:function(e){var t=this.getInstance(),n,s,o;if(e&&e.test(i)){var u=new t.EditorSelection;u&&u.anchorNode&&(e=u.anchorNode)}if(t&&e&&e.test("html")){n=t.one(i).one(r);while(!o)n?(s=n.one(r),s?n=s:o=!0):o=!0;n&&(n.test("br")&&(n.previous()?n=n.previous():n=n.get("parentNode")),n&&(e=n))}return e||(e=t.one(i)),e},_defNodeChangeFn:function(t){var r=(new Date).getTime(),i=this.getInstance(),s,o,u=i.EditorSelection.DEFAULT_BLOCK_TAG;if(e.UA.ie)try{s=i.config.doc.selection.createRange(),s.getBookmark&&(this._lastBookmark=s.getBookmark())}catch(a){}t.changedNode=this._resolveChangedNode(t.changedNode);switch(t.changedType){case"keydown":e.UA.gecko||!n.NC_KEYS[t.changedEvent.keyCode]&&!t.changedEvent.shiftKey&&!t.changedEvent.ctrlKey&&t.changedEvent.keyCode!==13;break;case"tab":!t.changedNode.test("li, li *")&&!t.changedEvent.shiftKey&&(t.changedEvent.frameEvent.preventDefault(),e.UA.webkit?this.execCommand("inserttext"," "):e.UA.gecko?this.frame.exec._command("inserthtml",n.TABKEY):e.UA.ie&&this.execCommand("inserthtml",n.TABKEY));break;case"backspace-up":e.UA.webkit&&t.changedNode&&t.changedNode.set("innerHTML",t.changedNode.get("innerHTML"))}if(e.UA.webkit&&t.commands&&(t.commands.indent||t.commands.outdent)){var f=i.all(".webkit-indent-blockquote, blockquote");f.size()&&f.setStyle("margin","")}var l=this.getDomPath(t.changedNode,!1),c={},h,p,d=[],v="",m="";t.commands&&(c=t.commands);var g=!1;e.each(l,function(t){var r=t.tagName.toLowerCase(),s=n.TAG2CMD[r];s&&(c[s]=1);var o=t.currentStyle||t.style;""+o.fontWeight=="normal"&&(g=!0),""+o.fontWeight=="bold"&&(c.bold=1),e.UA.ie&&o.fontWeight>400&&(c.bold=1),o.fontStyle=="italic"&&(c.italic=1),o.textDecoration.indexOf("underline")>-1&&(c.underline=1),o.textDecoration.indexOf("line-through")>-1&&(c.strikethrough=1);var u=i.one(t);if(u.getStyle("fontFamily")){var a=u.getStyle("fontFamily").split(",")[0].toLowerCase();a&&(h=a),h&&(h=h.replace(/'/g,"").replace(/"/g,""))}p=n.NORMALIZE_FONTSIZE(u);var f=t.className.split(" ");e.each(f,function(e){e!==""&&e.substr(0,4)!=="yui_"&&d.push(e)}),v=n.FILTER_RGB(u.getStyle("color"));var l=n.FILTER_RGB(o.backgroundColor);l!=="transparent"&&l!==""&&(m=l)}),g&&(delete c.bold,delete c.italic),t.dompath=i.all(l),t.classNames=d,t.commands=c,t.fontFamily||(t.fontFamily=h),t.fontSize||(t.fontSize=p),t.fontColor||(t.fontColor=v),t.backgroundColor||(t.backgroundColor=m);var y=(new Date).getTime()},getDomPath:function(e,t){var n=[],r,i=this.frame.getInstance();r=i.Node.getDOMNode(e);while(r!==null){if(r===i.config.doc.documentElement||r===i.config.doc||!r.tagName){r=null;break}if(!i.DOM.inDoc(r)){r=null;break}r.nodeName&&r.nodeType&&r.nodeType==1&&n.push(r);if(r==i.config.doc.body){r=null;break}r=r.parentNode}return n.length===0&&(n[0]=i.config.doc.body),t?i.all(n.reverse()):n.reverse()},_afterFrameReady:function(){var t=this.frame.getInstance();this.frame.on("dom:mouseup",e.bind(this._onFrameMouseUp,this)),this.frame.on("dom:mousedown",e.bind(this._onFrameMouseDown,this)),this.frame.on("dom:keydown",e.bind(this._onFrameKeyDown,this)),e.UA.ie&&(this.frame.on("dom:activate",e.bind(this._onFrameActivate,this)),this.frame.on("dom:beforedeactivate",e.bind(this._beforeFrameDeactivate,this))),this.frame.on("dom:keyup",e.bind(this._onFrameKeyUp,this)),this.frame.on("dom:keypress",e.bind(this._onFrameKeyPress,this)),this.frame.on("dom:paste",e.bind(this._onPaste,this)),t.EditorSelection.filter(),this.fire("ready")},_beforeFrameDeactivate:function(e){if(e.frameTarget.test("html"))return;var t=this.getInstance(),n=t.config.doc.selection.createRange();n.compareEndPoints&&!n.compareEndPoints("StartToEnd",n)&&n.pasteHTML('<var id="yui-ie-cursor">')},_onFrameActivate:function(e){if(e.frameTarget.test("html"))return;var t=this.getInstance(),n=new t.EditorSelection,r=n.createRange(),i=t.all("#yui-ie-cursor");i.size()&&i.each(function(e){e.set("id","");if(r.moveToElementText)try{r.moveToElementText(e._node);var t=r.move("character",-1);t===-1&&r.move("character",1),r.select(),r.text=""}catch(n){}e.remove()})},_onPaste:function(e){this.fire("nodeChange",{changedNode:e.frameTarget,changedType:"paste",changedEvent:e.frameEvent})},_onFrameMouseUp:function(e){this.fire("nodeChange",{changedNode:e.frameTarget,changedType:"mouseup",changedEvent:e.frameEvent})},_onFrameMouseDown:function(e){this.fire("nodeChange",{changedNode:e.frameTarget,changedType:"mousedown",changedEvent:e.frameEvent})},_currentSelection:null,_currentSelectionTimer:null,_currentSelectionClear:null,_onFrameKeyDown:function(t){var r,i;this._currentSelection?i=this._currentSelection:(this._currentSelectionTimer&&this._currentSelectionTimer.cancel(),this._currentSelectionTimer=e.later(850,this,function(){this._currentSelectionClear=!0}),r=this.frame.getInstance(),i=new r.EditorSelection(t),this._currentSelection=i),r=this.frame.getInstance(),i=new r.EditorSelection,this._currentSelection=i,i&&i.anchorNode&&(this.fire("nodeChange",{changedNode:i.anchorNode,changedType:"keydown",changedEvent:t.frameEvent}),n.NC_KEYS[t.keyCode]&&(this.fire("nodeChange",{changedNode:i.anchorNode,changedType:n.NC_KEYS[t.keyCode],changedEvent:t.frameEvent}),this.fire("nodeChange",{changedNode:i.anchorNode,changedType:n.NC_KEYS[t.keyCode]+"-down",changedEvent:t.frameEvent})))},_onFrameKeyPress:function(e){var t=this._currentSelection;t&&t.anchorNode&&(this.fire("nodeChange",{changedNode:t.anchorNode,changedType:"keypress",changedEvent:e.frameEvent}),n.NC_KEYS[e.keyCode]&&this.fire("nodeChange",{changedNode:t.anchorNode,changedType:n.NC_KEYS[e.keyCode]+"-press",changedEvent:e.frameEvent}))},_onFrameKeyUp:function(e){var t=this.frame.getInstance(),r=new t.EditorSelection(e);r&&r.anchorNode&&(this.fire("nodeChange",{changedNode:r.anchorNode,changedType:"keyup",selection:r,changedEvent:e.frameEvent}),n.NC_KEYS[e.keyCode]&&this.fire("nodeChange",{changedNode:r.anchorNode,changedType:n.NC_KEYS[e.keyCode]+"-up",selection:r,changedEvent:e.frameEvent})),this._currentSelectionClear&&(this._currentSelectionClear=this._currentSelection=null)},execCommand:function(e,t){var n=this.frame.execCommand(e,t),r=this.frame.getInstance(),i=new r.EditorSelection,s={},o={changedNode:i.anchorNode,changedType:"execcommand",nodes:n};switch(e){case"forecolor":o.fontColor=t;break;case"backcolor":o.backgroundColor=t;break;case"fontsize":o.fontSize=t;break;case"fontname":o.fontFamily=t}return s[e]=1,o.commands=s,this.fire("nodeChange",o),n},getInstance:function(){return this.frame.getInstance()},render:function(e){return this.frame.set("content",this.get("content")),this.frame.render(e),this},focus:function(e){return this.frame.focus(e),this},show:function(){return this.frame.show(),this},hide:function(){return this.frame.hide(),this},getContent:function(){var e="",t=this.getInstance();return t&&t.EditorSelection&&(e=t.EditorSelection.unfilter()),e=e.replace(/ _yuid="([^>]*)"/g,""),e}},{NORMALIZE_FONTSIZE:function(e){var t=e.getStyle("fontSize"),n=t;switch(t){case"-webkit-xxx-large":t="48px";break;case"xx-large":t="32px";break;case"x-large":t="24px";break;case"large":t="18px";break;case"medium":t="16px";break;case"small":t="13px";break;case"x-small":t="10px"}return n!==t&&e.setStyle("fontSize",t),t},TABKEY:'<span class="tab"> </span>',FILTER_RGB:function(e){if(e.toLowerCase().indexOf("rgb")!=-1){var t=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi"),n=e.replace(t,"$1,$2,$3,$4,$5").split(",");if(n.length==5){var r=parseInt(n[1],10).toString(16),i=parseInt(n[2],10).toString(16),s=parseInt(n[3],10).toString(16);r=r.length==1?"0"+r:r,i=i.length==1?"0"+i:i,s=s.length==1?"0"+s:s,e="#"+r+i+s}}return e},TAG2CMD:{b:"bold",strong:"bold",i:"italic",em:"italic",u:"underline",sup:"superscript",sub:"subscript",img:"insertimage",a:"createlink",ul:"insertunorderedlist",ol:"insertorderedlist"},NC_KEYS:{8:"backspace",9:"tab",13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",46:"delete"},USE:["substitute","node","selector-css3","editor-selection","stylesheet"],NAME:"editorBase",STRINGS:{title:"Rich Text Editor"},ATTRS:{content:{value:'<br class="yui-cursor">',setter:function(t){return t.substr(0,1)==="\n"&&(t=t.substr(1)),t===""&&(t='<br class="yui-cursor">'),t===" "&&e.UA.gecko&&(t='<br class="yui-cursor">'),this.frame.set("content",t)},getter:function(){return this.frame.get("content")}},dir:{writeOnce:!0,value:"ltr"},linkedcss:{value:"",setter:function(e){return this.frame&&this.frame.set("linkedcss",e),e}},extracss:{value:!1,setter:function(e){return this.frame&&this.frame.set("extracss",e),e}},defaultblock:{value:"p"}}}),e.EditorBase=n},"3.7.2",{requires:["base","frame","node","exec-command","editor-selection"]});+YUI.add("editor-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r=":last-child",i="body";e.extend(n,e.Base,{frame:null,initializer:function(){var t=(new e.Frame({designMode:!0,title:n.STRINGS.title,use:n.USE,dir:this.get("dir"),extracss:this.get("extracss"),linkedcss:this.get("linkedcss"),defaultblock:this.get("defaultblock"),host:this})).plug(e.Plugin.ExecCommand);t.after("ready",e.bind(this._afterFrameReady,this)),t.addTarget(this),this.frame=t,this.publish("nodeChange",{emitFacade:!0,bubbles:!0,defaultFn:this._defNodeChangeFn})},destructor:function(){this.frame.destroy(),this.detachAll()},copyStyles:function(t,n){if(t.test("a"))return;var r=["color","fontSize","fontFamily","backgroundColor","fontStyle"],i={};e.each(r,function(e){i[e]=t.getStyle(e)}),t.ancestor("b,strong")&&(i.fontWeight="bold"),t.ancestor("u")&&(i.textDecoration||(i.textDecoration="underline")),n.setStyles(i)},_lastBookmark:null,_resolveChangedNode:function(e){var t=this.getInstance(),n,s,o,u;e&&e.test(i)&&(u=new t.EditorSelection,u&&u.anchorNode&&(e=u.anchorNode));if(t&&e&&e.test("html")){n=t.one(i).one(r);while(!o)n?(s=n.one(r),s?n=s:o=!0):o=!0;n&&(n.test("br")&&(n.previous()?n=n.previous():n=n.get("parentNode")),n&&(e=n))}return e||(e=t.one(i)),e},_defNodeChangeFn:function(t){var r=(new Date).getTime(),i=this.getInstance(),s,o,u,a={},f,l,c=[],h="",p="",d,v=!1;if(e.UA.ie)try{s=i.config.doc.selection.createRange(),s.getBookmark&&(this._lastBookmark=s.getBookmark())}catch(m){}t.changedNode=this._resolveChangedNode(t.changedNode);switch(t.changedType){case"tab":!t.changedNode.test("li, li *")&&!t.changedEvent.shiftKey&&(t.changedEvent.frameEvent.preventDefault(),e.UA.webkit?this.execCommand("inserttext"," "):e.UA.gecko?this.frame.exec._command("inserthtml",n.TABKEY):e.UA.ie&&this.execCommand("inserthtml",n.TABKEY));break;case"backspace-up":e.UA.webkit&&t.changedNode&&t.changedNode.set("innerHTML",t.changedNode.get("innerHTML"))}e.UA.webkit&&t.commands&&(t.commands.indent||t.commands.outdent)&&(d=i.all(".webkit-indent-blockquote, blockquote"),d.size()&&d.setStyle("margin","")),o=this.getDomPath(t.changedNode,!1),t.commands&&(a=t.commands),e.each(o,function(t){var r=t.tagName.toLowerCase(),s=n.TAG2CMD[r],o,u,d,m,g;s&&(a[s]=1),o=t.currentStyle||t.style,""+o.fontWeight=="normal"&&(v=!0),""+o.fontWeight=="bold"&&(a.bold=1),e.UA.ie&&o.fontWeight>400&&(a.bold=1),o.fontStyle==="italic"&&(a.italic=1),o.textDecoration.indexOf("underline")>-1&&(a.underline=1),o.textDecoration.indexOf("line-through")>-1&&(a.strikethrough=1),u=i.one(t),u.getStyle("fontFamily")&&(d=u.getStyle("fontFamily").split(",")[0].toLowerCase(),d&&(f=d),f&&(f=f.replace(/'/g,"").replace(/"/g,""))),l=n.NORMALIZE_FONTSIZE(u),m=t.className.split(" "),e.each(m,function(e){e!==""&&e.substr(0,4)!=="yui_"&&c.push(e)}),h=n.FILTER_RGB(u.getStyle("color")),g=n.FILTER_RGB(o.backgroundColor),g!=="transparent"&&g!==""&&(p=g)}),v&&(delete a.bold,delete a.italic),t.dompath=i.all(o),t.classNames=c,t.commands=a,t.fontFamily||(t.fontFamily=f),t.fontSize||(t.fontSize=l),t.fontColor||(t.fontColor=h),t.backgroundColor||(t.backgroundColor=p),u=(new Date).getTime()},getDomPath:function(e,t){var n=[],r,i=this.frame.getInstance();r=i.Node.getDOMNode(e);while(r!==null){if(r===i.config.doc.documentElement||r===i.config.doc||!r.tagName){r=null;break}if(!i.DOM.inDoc(r)){r=null;break}r.nodeName&&r.nodeType&&r.nodeType===1&&n.push(r);if(r===i.config.doc.body){r=null;break}r=r.parentNode}return n.length===0&&(n[0]=i.config.doc.body),t?i.all(n.reverse()):n.reverse()},_afterFrameReady:function(){var t=this.frame.getInstance();this.frame.on("dom:mouseup",e.bind(this._onFrameMouseUp,this)),this.frame.on("dom:mousedown",e.bind(this._onFrameMouseDown,this)),this.frame.on("dom:keydown",e.bind(this._onFrameKeyDown,this)),e.UA.ie&&(this.frame.on("dom:activate",e.bind(this._onFrameActivate,this)),this.frame.on("dom:beforedeactivate",e.bind(this._beforeFrameDeactivate,this))),this.frame.on("dom:keyup",e.bind(this._onFrameKeyUp,this)),this.frame.on("dom:keypress",e.bind(this._onFrameKeyPress,this)),this.frame.on("dom:paste",e.bind(this._onPaste,this)),t.EditorSelection.filter(),this.fire("ready")},_beforeFrameDeactivate:function(e){if(e.frameTarget.test("html"))return;var t=this.getInstance(),n=t.config.doc.selection.createRange();n.compareEndPoints&&!n.compareEndPoints("StartToEnd",n)&&n.pasteHTML('<var id="yui-ie-cursor">')},_onFrameActivate:function(e){if(e.frameTarget.test("html"))return;var t=this.getInstance(),n=new t.EditorSelection,r=n.createRange(),i=t.all("#yui-ie-cursor");i.size()&&i.each(function(e){e.set("id","");if(r.moveToElementText)try{r.moveToElementText(e._node);var t=r.move("character",-1);t===-1&&r.move("character",1),r.select(),r.text=""}catch(n){}e.remove()})},_onPaste:function(e){this.fire("nodeChange",{changedNode:e.frameTarget,changedType:"paste",changedEvent:e.frameEvent})},_onFrameMouseUp:function(e){this.fire("nodeChange",{changedNode:e.frameTarget,changedType:"mouseup",changedEvent:e.frameEvent})},_onFrameMouseDown:function(e){this.fire("nodeChange",{changedNode:e.frameTarget,changedType:"mousedown",changedEvent:e.frameEvent})},_currentSelection:null,_currentSelectionTimer:null,_currentSelectionClear:null,_onFrameKeyDown:function(t){var r,i;this._currentSelection?i=this._currentSelection:(this._currentSelectionTimer&&this._currentSelectionTimer.cancel(),this._currentSelectionTimer=e.later(850,this,function(){this._currentSelectionClear=!0}),r=this.frame.getInstance(),i=new r.EditorSelection(t),this._currentSelection=i),r=this.frame.getInstance(),i=new r.EditorSelection,this._currentSelection=i,i&&i.anchorNode&&(this.fire("nodeChange",{changedNode:i.anchorNode,changedType:"keydown",changedEvent:t.frameEvent}),n.NC_KEYS[t.keyCode]&&(this.fire("nodeChange",{changedNode:i.anchorNode,changedType:n.NC_KEYS[t.keyCode],changedEvent:t.frameEvent}),this.fire("nodeChange",{changedNode:i.anchorNode,changedType:n.NC_KEYS[t.keyCode]+"-down",changedEvent:t.frameEvent})))},_onFrameKeyPress:function(e){var t=this._currentSelection;t&&t.anchorNode&&(this.fire("nodeChange",{changedNode:t.anchorNode,changedType:"keypress",changedEvent:e.frameEvent}),n.NC_KEYS[e.keyCode]&&this.fire("nodeChange",{changedNode:t.anchorNode,changedType:n.NC_KEYS[e.keyCode]+"-press",changedEvent:e.frameEvent}))},_onFrameKeyUp:function(e){var t=this.frame.getInstance(),r=new t.EditorSelection(e);r&&r.anchorNode&&(this.fire("nodeChange",{changedNode:r.anchorNode,changedType:"keyup",selection:r,changedEvent:e.frameEvent}),n.NC_KEYS[e.keyCode]&&this.fire("nodeChange",{changedNode:r.anchorNode,changedType:n.NC_KEYS[e.keyCode]+"-up",selection:r,changedEvent:e.frameEvent})),this._currentSelectionClear&&(this._currentSelectionClear=this._currentSelection=null)},execCommand:function(e,t){var n=this.frame.execCommand(e,t),r=this.frame.getInstance(),i=new r.EditorSelection,s={},o={changedNode:i.anchorNode,changedType:"execcommand",nodes:n};switch(e){case"forecolor":o.fontColor=t;break;case"backcolor":o.backgroundColor=t;break;case"fontsize":o.fontSize=t;break;case"fontname":o.fontFamily=t}return s[e]=1,o.commands=s,this.fire("nodeChange",o),n},getInstance:function(){return this.frame.getInstance()},render:function(e){return this.frame.set("content",this.get("content")),this.frame.render(e),this},focus:function(e){return this.frame.focus(e),this},show:function(){return this.frame.show(),this},hide:function(){return this.frame.hide(),this},getContent:function(){var e="",t=this.getInstance();return t&&t.EditorSelection&&(e=t.EditorSelection.unfilter()),e=e.replace(/ _yuid="([^>]*)"/g,""),e}},{NORMALIZE_FONTSIZE:function(e){var t=e.getStyle("fontSize"),n=t;switch(t){case"-webkit-xxx-large":t="48px";break;case"xx-large":t="32px";break;case"x-large":t="24px";break;case"large":t="18px";break;case"medium":t="16px";break;case"small":t="13px";break;case"x-small":t="10px"}return n!==t&&e.setStyle("fontSize",t),t},TABKEY:'<span class="tab"> </span>',FILTER_RGB:function(e){if(e.toLowerCase().indexOf("rgb")!==-1){var t=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi"),n=e.replace(t,"$1,$2,$3,$4,$5").split(","),r,i,s;n.length===5&&(r=parseInt(n[1],10).toString(16),i=parseInt(n[2],10).toString(16),s=parseInt(n[3],10).toString(16),r=r.length===1?"0"+r:r,i=i.length===1?"0"+i:i,s=s.length===1?"0"+s:s,e="#"+r+i+s)}return e},TAG2CMD:{b:"bold",strong:"bold",i:"italic",em:"italic",u:"underline",sup:"superscript",sub:"subscript",img:"insertimage",a:"createlink",ul:"insertunorderedlist",ol:"insertorderedlist"},NC_KEYS:{8:"backspace",9:"tab",13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",46:"delete"},USE:["substitute","node","selector-css3","editor-selection","stylesheet"],NAME:"editorBase",STRINGS:{title:"Rich Text Editor"},ATTRS:{content:{value:'<br class="yui-cursor">',setter:function(t){return t.substr(0,1)==="\n"&&(t=t.substr(1)),t===""&&(t='<br class="yui-cursor">'),t===" "&&e.UA.gecko&&(t='<br class="yui-cursor">'),this.frame.set("content",t)},getter:function(){return this.frame.get("content")}},dir:{writeOnce:!0,value:"ltr"},linkedcss:{value:"",setter:function(e){return this.frame&&this.frame.set("linkedcss",e),e}},extracss:{value:!1,setter:function(e){return this.frame&&this.frame.set("extracss",e),e}},defaultblock:{value:"p"}}}),e.EditorBase=n},"3.7.3",{requires:["base","frame","node","exec-command","editor-selection"]});
bundle/editor-base/editor-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -22,7 +22,7 @@ * @submodule editor-base * @constructor */- + var EditorBase = function() { EditorBase.superclass.constructor.apply(this, arguments); }, LAST_CHILD = ':last-child', BODY = 'body';@@ -56,7 +56,7 @@ bubbles: true, defaultFn: this._defNodeChangeFn });- + //this.plug(Y.Plugin.EditorPara); }, destructor: function() {@@ -67,7 +67,7 @@ /** * Copy certain styles from one node instance to another (used for new paragraph creation mainly) * @method copyStyles- * @param {Node} from The Node instance to copy the styles from + * @param {Node} from The Node instance to copy the styles from * @param {Node} to The Node instance to copy the styles to */ copyStyles: function(from, to) {@@ -106,9 +106,9 @@ * @private */ _resolveChangedNode: function(n) {- var inst = this.getInstance(), lc, lc2, found;+ var inst = this.getInstance(), lc, lc2, found, sel; if (n && n.test(BODY)) {- var sel = new inst.EditorSelection();+ sel = new inst.EditorSelection(); if (sel && sel.anchorNode) { n = sel.anchorNode; }@@ -153,9 +153,12 @@ * @private */ _defNodeChangeFn: function(e) {- var startTime = (new Date()).getTime();- var inst = this.getInstance(), sel, cur,- btag = inst.EditorSelection.DEFAULT_BLOCK_TAG;+ var startTime = (new Date()).getTime(),+ inst = this.getInstance(), sel,+ changed, endTime,+ cmds = {}, family, fsize, classes = [],+ fColor = '', bColor = '', bq,+ normal = false; if (Y.UA.ie) { try {@@ -175,15 +178,8 @@ * Maybe static functions for the e.changeType and an object bag * to walk through and filter to pass off the event to before firing.. */- + switch (e.changedType) {- case 'keydown':- if (!Y.UA.gecko) {- if (!EditorBase.NC_KEYS[e.changedEvent.keyCode] && !e.changedEvent.shiftKey && !e.changedEvent.ctrlKey && (e.changedEvent.keyCode !== 13)) {- //inst.later(100, inst, inst.EditorSelection.cleanCursor);- }- }- break; case 'tab': if (!e.changedNode.test('li, li *') && !e.changedEvent.shiftKey) { e.changedEvent.frameEvent.preventDefault();@@ -199,8 +195,8 @@ case 'backspace-up': // Fixes #2531090 - Joins text node strings so they become one for bidi if (Y.UA.webkit && e.changedNode) {- e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));- }+ e.changedNode.set('innerHTML', e.changedNode.get('innerHTML'));+ } break; } if (Y.UA.webkit && e.commands && (e.commands.indent || e.commands.outdent)) {@@ -209,37 +205,35 @@ * a class to the BLOCKQUOTE that adds left/right margin to it * This strips that style so it is just a normal BLOCKQUOTE */- var bq = inst.all('.webkit-indent-blockquote, blockquote');+ bq = inst.all('.webkit-indent-blockquote, blockquote'); if (bq.size()) { bq.setStyle('margin', ''); } } - var changed = this.getDomPath(e.changedNode, false),- cmds = {}, family, fsize, classes = [],- fColor = '', bColor = '';+ changed = this.getDomPath(e.changedNode, false); if (e.commands) { cmds = e.commands; }- - var normal = false; + Y.each(changed, function(el) { var tag = el.tagName.toLowerCase(),- cmd = EditorBase.TAG2CMD[tag];+ cmd = EditorBase.TAG2CMD[tag], s,+ n, family2, cls, bColor2; if (cmd) { cmds[cmd] = 1; } //Bold and Italic styles- var s = el.currentStyle || el.style;- - if ((''+s.fontWeight) == 'normal') {+ s = el.currentStyle || el.style;++ if ((''+s.fontWeight) === 'normal') { normal = true; }- if ((''+s.fontWeight) == 'bold') { //Cast this to a string+ if ((''+s.fontWeight) === 'bold') { //Cast this to a string cmds.bold = 1; } if (Y.UA.ie) {@@ -247,7 +241,7 @@ cmds.bold = 1; } }- if (s.fontStyle == 'italic') {+ if (s.fontStyle === 'italic') { cmds.italic = 1; } @@ -257,10 +251,10 @@ if (s.textDecoration.indexOf('line-through') > -1) { cmds.strikethrough = 1; }- - var n = inst.one(el);++ n = inst.one(el); if (n.getStyle('fontFamily')) {- var family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase();+ family2 = n.getStyle('fontFamily').split(',')[0].toLowerCase(); if (family2) { family = family2; }@@ -272,8 +266,7 @@ fsize = EditorBase.NORMALIZE_FONTSIZE(n); - var cls = el.className.split(' ');-+ cls = el.className.split(' '); Y.each(cls, function(v) { if (v !== '' && (v.substr(0, 4) !== 'yui_')) { classes.push(v);@@ -281,15 +274,15 @@ }); fColor = EditorBase.FILTER_RGB(n.getStyle('color'));- var bColor2 = EditorBase.FILTER_RGB(s.backgroundColor);+ bColor2 = EditorBase.FILTER_RGB(s.backgroundColor); if (bColor2 !== 'transparent') { if (bColor2 !== '') { bColor = bColor2; } }- + });- + if (normal) { delete cmds.bold; delete cmds.italic;@@ -313,38 +306,38 @@ e.backgroundColor = bColor; } - var endTime = (new Date()).getTime();+ endTime = (new Date()).getTime(); }, /** * Walk the dom tree from this node up to body, returning a reversed array of parents. * @method getDomPath- * @param {Node} node The Node to start from + * @param {Node} node The Node to start from */ getDomPath: function(node, nodeList) {- var domPath = [], domNode,+ var domPath = [], domNode, inst = this.frame.getInstance(); domNode = inst.Node.getDOMNode(node); //return inst.all(domNode); while (domNode !== null) {- + if ((domNode === inst.config.doc.documentElement) || (domNode === inst.config.doc) || !domNode.tagName) { domNode = null; break; }- + if (!inst.DOM.inDoc(domNode)) { domNode = null; break; }- + //Check to see if we get el.nodeName and nodeType- if (domNode.nodeName && domNode.nodeType && (domNode.nodeType == 1)) {+ if (domNode.nodeName && domNode.nodeType && (domNode.nodeType === 1)) { domPath.push(domNode); } - if (domNode == inst.config.doc.body) {+ if (domNode === inst.config.doc.body) { domNode = null; break; }@@ -352,7 +345,7 @@ domNode = domNode.parentNode; } - /*{{{ Using Node + /*{{{ Using Node while (node !== null) { if (node.test('html') || node.test('doc') || !node.get('tagName')) { node = null;@@ -394,7 +387,7 @@ */ _afterFrameReady: function() { var inst = this.frame.getInstance();- + this.frame.on('dom:mouseup', Y.bind(this._onFrameMouseUp, this)); this.frame.on('dom:mousedown', Y.bind(this._onFrameMouseDown, this)); this.frame.on('dom:keydown', Y.bind(this._onFrameKeyDown, this));@@ -421,7 +414,7 @@ } var inst = this.getInstance(), sel = inst.config.doc.selection.createRange();- + if (sel.compareEndPoints && !sel.compareEndPoints('StartToEnd', sel)) { sel.pasteHTML('<var id="yui-ie-cursor">'); }@@ -514,7 +507,7 @@ this._currentSelectionTimer = Y.later(850, this, function() { this._currentSelectionClear = true; });- + inst = this.frame.getInstance(); sel = new inst.EditorSelection(e); @@ -527,12 +520,20 @@ sel = new inst.EditorSelection(); this._currentSelection = sel;- + if (sel && sel.anchorNode) { this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keydown', changedEvent: e.frameEvent }); if (EditorBase.NC_KEYS[e.keyCode]) {- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode], changedEvent: e.frameEvent });- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-down', changedEvent: e.frameEvent });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode],+ changedEvent: e.frameEvent+ });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-down',+ changedEvent: e.frameEvent+ }); } } },@@ -547,7 +548,11 @@ if (sel && sel.anchorNode) { this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keypress', changedEvent: e.frameEvent }); if (EditorBase.NC_KEYS[e.keyCode]) {- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-press', changedEvent: e.frameEvent });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-press',+ changedEvent: e.frameEvent+ }); } } },@@ -563,7 +568,12 @@ if (sel && sel.anchorNode) { this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: 'keyup', selection: sel, changedEvent: e.frameEvent }); if (EditorBase.NC_KEYS[e.keyCode]) {- this.fire('nodeChange', { changedNode: sel.anchorNode, changedType: EditorBase.NC_KEYS[e.keyCode] + '-up', selection: sel, changedEvent: e.frameEvent });+ this.fire('nodeChange', {+ changedNode: sel.anchorNode,+ changedType: EditorBase.NC_KEYS[e.keyCode] + '-up',+ selection: sel,+ changedEvent: e.frameEvent+ }); } } if (this._currentSelectionClear) {@@ -680,7 +690,7 @@ */ NORMALIZE_FONTSIZE: function(n) { var size = n.getStyle('fontSize'), oSize = size;- + switch (size) { case '-webkit-xxx-large': size = '48px';@@ -723,24 +733,25 @@ * @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);+ if (css.toLowerCase().indexOf('rgb') !== -1) {+ var exp = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi"),+ rgb = css.replace(exp, "$1,$2,$3,$4,$5").split(','),+ r, g, b; - r = r.length == 1 ? '0' + r : r;- g = g.length == 1 ? '0' + g : g;- b = b.length == 1 ? '0' + b : b;+ if (rgb.length === 5) {+ r = parseInt(rgb[1], 10).toString(16);+ g = parseInt(rgb[2], 10).toString(16);+ 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;- }, + }, /** * @static * @property TAG2CMD@@ -840,7 +851,7 @@ * @attribute linkedcss * @description An array of url's to external linked style sheets * @type String- */ + */ linkedcss: { value: '', setter: function(css) {@@ -854,7 +865,7 @@ * @attribute extracss * @description A string of CSS to add to the Head of the Editor * @type String- */ + */ extracss: { value: false, setter: function(css) {@@ -868,7 +879,7 @@ * @attribute defaultblock * @description The default tag to use for block level items, defaults to: p * @type String- */ + */ defaultblock: { value: 'p' }@@ -907,4 +918,4 @@ -}, '3.7.2', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});+}, '3.7.3', {"requires": ["base", "frame", "node", "exec-command", "editor-selection"]});
bundle/editor-bidi/editor-bidi-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/editor-bidi/editor-bidi.js", code: [] };-_yuitest_coverage["build/editor-bidi/editor-bidi.js"].code=["YUI.add('editor-bidi', function (Y, NAME) {","",""," /**"," * Plugin for Editor to support BiDirectional (bidi) text operations."," * @class Plugin.EditorBidi"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-bidi"," */","",""," var EditorBidi = function() {"," EditorBidi.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',"," B_C_CHANGE = 'bidiContextChange', FIRST_P = BODY + ' > p', STYLE = 'style';",""," Y.extend(EditorBidi, Y.Base, {"," /**"," * Place holder for the last direction when checking for a switch"," * @private"," * @property lastDirection"," */"," lastDirection: null,"," /**"," * Tells us that an initial bidi check has already been performed"," * @private"," * @property firstEvent"," */"," firstEvent: null,",""," /**"," * Method checks to see if the direction of the text has changed based on a nodeChange event."," * @private"," * @method _checkForChange"," */"," _checkForChange: function() {"," var host = this.get(HOST),"," inst = host.getInstance(),"," sel = new inst.EditorSelection(),"," node, direction;"," "," if (sel.isCollapsed) {"," node = EditorBidi.blockParent(sel.focusNode);"," if (node) {"," direction = node.getStyle('direction');"," if (direction !== this.lastDirection) {"," host.fire(B_C_CHANGE, { changedTo: direction });"," this.lastDirection = direction;"," }"," }"," } else {"," host.fire(B_C_CHANGE, { changedTo: 'select' });"," this.lastDirection = null;"," }"," },",""," /**"," * Checked for a change after a specific nodeChange event has been fired."," * @private"," * @method _afterNodeChange"," */"," _afterNodeChange: function(e) { "," // If this is the first event ever, or an event that can result in a context change"," if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) {"," this._checkForChange();"," this.firstEvent = false;"," }"," },",""," /**"," * Checks for a direction change after a mouseup occurs."," * @private"," * @method _afterMouseUp"," */"," _afterMouseUp: function(e) {"," this._checkForChange();"," this.firstEvent = false;"," },"," initializer: function() {"," var host = this.get(HOST);",""," this.firstEvent = true;"," "," host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this));"," host.after('dom:mouseup', Y.bind(this._afterMouseUp, this));"," }"," }, {"," /**"," * The events to check for a direction change on"," * @property EVENTS"," * @static"," */"," EVENTS: {"," 'backspace-up': true,"," 'pageup-up': true,"," 'pagedown-down': true,"," 'end-up': true,"," 'home-up': true,"," 'left-up': true,"," 'up-up': true,"," 'right-up': true,"," 'down-up': true,"," 'delete-up': true"," },",""," /**"," * More elements may be needed. BODY *must* be in the list to take care of the special case."," * "," * blockParent could be changed to use inst.EditorSelection.BLOCKS"," * instead, but that would make Y.Plugin.EditorBidi.blockParent"," * unusable in non-RTE contexts (it being usable is a nice"," * side-effect)."," * @property BLOCKS"," * @static"," */"," //BLOCKS: Y.EditorSelection.BLOCKS+',LI,HR,' + BODY,"," BLOCKS: Y.EditorSelection.BLOCKS,"," /**"," * Template for creating a block element"," * @static"," * @property DIV_WRAPPER"," */"," DIV_WRAPPER: '<DIV></DIV>',"," /**"," * Returns a block parent for a given element"," * @static"," * @method blockParent"," */"," blockParent: function(node, wrap) {"," var parent = node, divNode, firstChild;"," "," if (!parent) {"," parent = Y.one(BODY);"," }"," "," if (!parent.test(EditorBidi.BLOCKS)) {"," parent = parent.ancestor(EditorBidi.BLOCKS);"," }"," if (wrap && parent.test(BODY)) {"," // This shouldn't happen if the RTE handles everything"," // according to spec: we should get to a P before BODY. But"," // we don't want to set the direction of BODY even if that"," // happens, so we wrap everything in a DIV."," "," // The code is based on YUI3's Y.EditorSelection._wrapBlock function."," divNode = Y.Node.create(EditorBidi.DIV_WRAPPER);"," parent.get('children').each(function(node, index) {"," if (index === 0) {"," firstChild = node;"," } else {"," divNode.append(node);"," }"," });"," firstChild.replace(divNode);"," divNode.prepend(firstChild);"," parent = divNode;"," }"," return parent;"," },"," /**"," * The data key to store on the node."," * @static"," * @property _NODE_SELECTED"," */"," _NODE_SELECTED: 'bidiSelected',"," /**"," * Generates a list of all the block parents of the current NodeList"," * @static"," * @method addParents"," */"," addParents: function(nodeArray) {"," var i, parent, addParent;",""," for (i = 0; i < nodeArray.length; i += 1) {"," nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);"," }",""," // This works automagically, since new parents added get processed"," // later themselves. So if there's a node early in the process that"," // we haven't discovered some of its siblings yet, thus resulting in"," // its parent not added, the parent will be added later, since those"," // siblings will be added to the array and then get processed."," for (i = 0; i < nodeArray.length; i += 1) {"," parent = nodeArray[i].get('parentNode');",""," // Don't add the parent if the parent is the BODY element."," // We don't want to change the direction of BODY. Also don't"," // do it if the parent is already in the list."," if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) {"," addParent = true;"," parent.get('children').some(function(sibling) {"," if (!sibling.getData(EditorBidi._NODE_SELECTED)) {"," addParent = false;"," return true; // stop more processing"," }"," });"," if (addParent) {"," nodeArray.push(parent);"," parent.setData(EditorBidi._NODE_SELECTED, true);"," }"," }"," } ",""," for (i = 0; i < nodeArray.length; i += 1) {"," nodeArray[i].clearData(EditorBidi._NODE_SELECTED);"," }",""," return nodeArray;"," },","",""," /**"," * editorBidi"," * @static"," * @property NAME"," */"," NAME: 'editorBidi',"," /**"," * editorBidi"," * @static"," * @property NS"," */"," NS: 'editorBidi',"," ATTRS: {"," host: {"," value: false"," }"," },"," /**"," * Regex for testing/removing text-align style from an element"," * @static"," * @property RE_TEXT_ALIGN"," */"," RE_TEXT_ALIGN: /text-align:\\s*\\w*\\s*;/,"," /**"," * Method to test a node's style attribute for text-align and removing it."," * @static"," * @method removeTextAlign"," */"," removeTextAlign: function(n) {"," if (n) {"," if (n.getAttribute(STYLE).match(EditorBidi.RE_TEXT_ALIGN)) {"," n.setAttribute(STYLE, n.getAttribute(STYLE).replace(EditorBidi.RE_TEXT_ALIGN, ''));"," }"," if (n.hasAttribute('align')) {"," n.removeAttribute('align');"," }"," }"," return n;"," }"," });"," "," Y.namespace('Plugin');"," "," Y.Plugin.EditorBidi = EditorBidi;",""," /**"," * bidi execCommand override for setting the text direction of a node."," * This property is added to the `Y.Plugin.ExecCommands.COMMANDS`"," * collection."," *"," * @for Plugin.ExecCommand"," * @property bidi"," */"," //TODO -- This should not add this command unless the plugin is added to the instance.."," Y.Plugin.ExecCommand.COMMANDS.bidi = function(cmd, direction) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," ns = this.get(HOST).get(HOST).editorBidi,"," returnValue, block,"," selected, selectedBlocks, dir;",""," if (!ns) {"," Y.error('bidi execCommand is not available without the EditorBiDi plugin.');"," return;"," }",""," inst.EditorSelection.filterBlocks();",""," if (sel.isCollapsed) { // No selection"," block = EditorBidi.blockParent(sel.anchorNode);"," if (!block) {"," block = inst.one('body').one(inst.EditorSelection.BLOCKS);"," }"," //Remove text-align attribute if it exists"," block = EditorBidi.removeTextAlign(block);"," if (!direction) {"," //If no direction is set, auto-detect the proper setting to make it \"toggle\""," dir = block.getAttribute(DIR);"," if (!dir || dir == 'ltr') {"," direction = 'rtl';"," } else {"," direction = 'ltr';"," }"," }"," block.setAttribute(DIR, direction);"," if (Y.UA.ie) {"," var b = block.all('br.yui-cursor');"," if (b.size() === 1 && block.get('childNodes').size() == 1) {"," b.remove();"," }"," }"," returnValue = block;"," } else { // some text is selected"," selected = sel.getSelected();"," selectedBlocks = [];"," selected.each(function(node) {"," selectedBlocks.push(EditorBidi.blockParent(node));"," });"," selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks));"," selectedBlocks.each(function(n) {"," var d = direction;"," //Remove text-align attribute if it exists"," n = EditorBidi.removeTextAlign(n);"," if (!d) {"," dir = n.getAttribute(DIR);"," if (!dir || dir == 'ltr') {"," d = 'rtl';"," } else {"," d = 'ltr';"," }"," }"," n.setAttribute(DIR, d);"," });"," returnValue = selectedBlocks;"," }"," ns._checkForChange();"," return returnValue;"," };","","","","","}, '3.7.2', {\"requires\": [\"editor-base\"]});"];-_yuitest_coverage["build/editor-bidi/editor-bidi.js"].lines = {"1":0,"14":0,"15":0,"19":0,"39":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"54":0,"55":0,"66":0,"67":0,"68":0,"78":0,"79":0,"82":0,"84":0,"86":0,"87":0,"132":0,"134":0,"135":0,"138":0,"139":0,"141":0,"148":0,"149":0,"150":0,"151":0,"153":0,"156":0,"157":0,"158":0,"160":0,"174":0,"176":0,"177":0,"185":0,"186":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"199":0,"200":0,"201":0,"206":0,"207":0,"210":0,"243":0,"244":0,"245":0,"247":0,"248":0,"251":0,"255":0,"257":0,"268":0,"269":0,"275":0,"276":0,"277":0,"280":0,"282":0,"283":0,"284":0,"285":0,"288":0,"289":0,"291":0,"292":0,"293":0,"295":0,"298":0,"299":0,"300":0,"301":0,"302":0,"305":0,"307":0,"308":0,"309":0,"310":0,"312":0,"313":0,"314":0,"316":0,"317":0,"318":0,"319":0,"320":0,"322":0,"325":0,"327":0,"329":0,"330":0};-_yuitest_coverage["build/editor-bidi/editor-bidi.js"].functions = {"EditorBidi:14":0,"_checkForChange:38":0,"_afterNodeChange:64":0,"_afterMouseUp:77":0,"initializer:81":0,"(anonymous 2):149":0,"blockParent:131":0,"(anonymous 3):193":0,"addParents:173":0,"removeTextAlign:242":0,"(anonymous 4):309":0,"(anonymous 5):313":0,"bidi:268":0,"(anonymous 1):1":0};-_yuitest_coverage["build/editor-bidi/editor-bidi.js"].coveredLines = 102;+_yuitest_coverage["build/editor-bidi/editor-bidi.js"].code=["YUI.add('editor-bidi', function (Y, NAME) {","",""," /**"," * Plugin for Editor to support BiDirectional (bidi) text operations."," * @class Plugin.EditorBidi"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-bidi"," */","",""," var EditorBidi = function() {"," EditorBidi.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',"," B_C_CHANGE = 'bidiContextChange', STYLE = 'style';",""," Y.extend(EditorBidi, Y.Base, {"," /**"," * Place holder for the last direction when checking for a switch"," * @private"," * @property lastDirection"," */"," lastDirection: null,"," /**"," * Tells us that an initial bidi check has already been performed"," * @private"," * @property firstEvent"," */"," firstEvent: null,",""," /**"," * Method checks to see if the direction of the text has changed based on a nodeChange event."," * @private"," * @method _checkForChange"," */"," _checkForChange: function() {"," var host = this.get(HOST),"," inst = host.getInstance(),"," sel = new inst.EditorSelection(),"," node, direction;",""," if (sel.isCollapsed) {"," node = EditorBidi.blockParent(sel.focusNode);"," if (node) {"," direction = node.getStyle('direction');"," if (direction !== this.lastDirection) {"," host.fire(B_C_CHANGE, { changedTo: direction });"," this.lastDirection = direction;"," }"," }"," } else {"," host.fire(B_C_CHANGE, { changedTo: 'select' });"," this.lastDirection = null;"," }"," },",""," /**"," * Checked for a change after a specific nodeChange event has been fired."," * @private"," * @method _afterNodeChange"," */"," _afterNodeChange: function(e) {"," // If this is the first event ever, or an event that can result in a context change"," if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) {"," this._checkForChange();"," this.firstEvent = false;"," }"," },",""," /**"," * Checks for a direction change after a mouseup occurs."," * @private"," * @method _afterMouseUp"," */"," _afterMouseUp: function() {"," this._checkForChange();"," this.firstEvent = false;"," },"," initializer: function() {"," var host = this.get(HOST);",""," this.firstEvent = true;",""," host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this));"," host.after('dom:mouseup', Y.bind(this._afterMouseUp, this));"," }"," }, {"," /**"," * The events to check for a direction change on"," * @property EVENTS"," * @static"," */"," EVENTS: {"," 'backspace-up': true,"," 'pageup-up': true,"," 'pagedown-down': true,"," 'end-up': true,"," 'home-up': true,"," 'left-up': true,"," 'up-up': true,"," 'right-up': true,"," 'down-up': true,"," 'delete-up': true"," },",""," /**"," * More elements may be needed. BODY *must* be in the list to take care of the special case."," *"," * blockParent could be changed to use inst.EditorSelection.BLOCKS"," * instead, but that would make Y.Plugin.EditorBidi.blockParent"," * unusable in non-RTE contexts (it being usable is a nice"," * side-effect)."," * @property BLOCKS"," * @static"," */"," //BLOCKS: Y.EditorSelection.BLOCKS+',LI,HR,' + BODY,"," BLOCKS: Y.EditorSelection.BLOCKS,"," /**"," * Template for creating a block element"," * @static"," * @property DIV_WRAPPER"," */"," DIV_WRAPPER: '<DIV></DIV>',"," /**"," * Returns a block parent for a given element"," * @static"," * @method blockParent"," */"," blockParent: function(node, wrap) {"," var parent = node, divNode, firstChild;",""," if (!parent) {"," parent = Y.one(BODY);"," }",""," if (!parent.test(EditorBidi.BLOCKS)) {"," parent = parent.ancestor(EditorBidi.BLOCKS);"," }"," if (wrap && parent.test(BODY)) {"," // This shouldn't happen if the RTE handles everything"," // according to spec: we should get to a P before BODY. But"," // we don't want to set the direction of BODY even if that"," // happens, so we wrap everything in a DIV.",""," // The code is based on YUI3's Y.EditorSelection._wrapBlock function."," divNode = Y.Node.create(EditorBidi.DIV_WRAPPER);"," parent.get('children').each(function(node, index) {"," if (index === 0) {"," firstChild = node;"," } else {"," divNode.append(node);"," }"," });"," firstChild.replace(divNode);"," divNode.prepend(firstChild);"," parent = divNode;"," }"," return parent;"," },"," /**"," * The data key to store on the node."," * @static"," * @property _NODE_SELECTED"," */"," _NODE_SELECTED: 'bidiSelected',"," /**"," * Generates a list of all the block parents of the current NodeList"," * @static"," * @method addParents"," */"," addParents: function(nodeArray) {"," var i, parent, addParent;"," tester = function(sibling) {"," if (!sibling.getData(EditorBidi._NODE_SELECTED)) {"," addParent = false;"," return true; // stop more processing"," }"," };",""," for (i = 0; i < nodeArray.length; i += 1) {"," nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);"," }",""," // This works automagically, since new parents added get processed"," // later themselves. So if there's a node early in the process that"," // we haven't discovered some of its siblings yet, thus resulting in"," // its parent not added, the parent will be added later, since those"," // siblings will be added to the array and then get processed."," for (i = 0; i < nodeArray.length; i += 1) {"," parent = nodeArray[i].get('parentNode');",""," // Don't add the parent if the parent is the BODY element."," // We don't want to change the direction of BODY. Also don't"," // do it if the parent is already in the list."," if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) {"," addParent = true;"," parent.get('children').some(tester);"," if (addParent) {"," nodeArray.push(parent);"," parent.setData(EditorBidi._NODE_SELECTED, true);"," }"," }"," }",""," for (i = 0; i < nodeArray.length; i += 1) {"," nodeArray[i].clearData(EditorBidi._NODE_SELECTED);"," }",""," return nodeArray;"," },","",""," /**"," * editorBidi"," * @static"," * @property NAME"," */"," NAME: 'editorBidi',"," /**"," * editorBidi"," * @static"," * @property NS"," */"," NS: 'editorBidi',"," ATTRS: {"," host: {"," value: false"," }"," },"," /**"," * Regex for testing/removing text-align style from an element"," * @static"," * @property RE_TEXT_ALIGN"," */"," RE_TEXT_ALIGN: /text-align:\\s*\\w*\\s*;/,"," /**"," * Method to test a node's style attribute for text-align and removing it."," * @static"," * @method removeTextAlign"," */"," removeTextAlign: function(n) {"," if (n) {"," if (n.getAttribute(STYLE).match(EditorBidi.RE_TEXT_ALIGN)) {"," n.setAttribute(STYLE, n.getAttribute(STYLE).replace(EditorBidi.RE_TEXT_ALIGN, ''));"," }"," if (n.hasAttribute('align')) {"," n.removeAttribute('align');"," }"," }"," return n;"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorBidi = EditorBidi;",""," /**"," * bidi execCommand override for setting the text direction of a node."," * This property is added to the `Y.Plugin.ExecCommands.COMMANDS`"," * collection."," *"," * @for Plugin.ExecCommand"," * @property bidi"," */"," //TODO -- This should not add this command unless the plugin is added to the instance.."," Y.Plugin.ExecCommand.COMMANDS.bidi = function(cmd, direction) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," ns = this.get(HOST).get(HOST).editorBidi,"," returnValue, block, b,"," selected, selectedBlocks, dir;",""," if (!ns) {"," Y.error('bidi execCommand is not available without the EditorBiDi plugin.');"," return;"," }",""," inst.EditorSelection.filterBlocks();",""," if (sel.isCollapsed) { // No selection"," block = EditorBidi.blockParent(sel.anchorNode);"," if (!block) {"," block = inst.one('body').one(inst.EditorSelection.BLOCKS);"," }"," //Remove text-align attribute if it exists"," block = EditorBidi.removeTextAlign(block);"," if (!direction) {"," //If no direction is set, auto-detect the proper setting to make it \"toggle\""," dir = block.getAttribute(DIR);"," if (!dir || dir === 'ltr') {"," direction = 'rtl';"," } else {"," direction = 'ltr';"," }"," }"," block.setAttribute(DIR, direction);"," if (Y.UA.ie) {"," b = block.all('br.yui-cursor');"," if (b.size() === 1 && block.get('childNodes').size() === 1) {"," b.remove();"," }"," }"," returnValue = block;"," } else { // some text is selected"," selected = sel.getSelected();"," selectedBlocks = [];"," selected.each(function(node) {"," selectedBlocks.push(EditorBidi.blockParent(node));"," });"," selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks));"," selectedBlocks.each(function(n) {"," var d = direction;"," //Remove text-align attribute if it exists"," n = EditorBidi.removeTextAlign(n);"," if (!d) {"," dir = n.getAttribute(DIR);"," if (!dir || dir === 'ltr') {"," d = 'rtl';"," } else {"," d = 'ltr';"," }"," }"," n.setAttribute(DIR, d);"," });"," returnValue = selectedBlocks;"," }"," ns._checkForChange();"," return returnValue;"," };","","","","","}, '3.7.3', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/editor-bidi/editor-bidi.js"].lines = {"1":0,"14":0,"15":0,"19":0,"39":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"54":0,"55":0,"66":0,"67":0,"68":0,"78":0,"79":0,"82":0,"84":0,"86":0,"87":0,"132":0,"134":0,"135":0,"138":0,"139":0,"141":0,"148":0,"149":0,"150":0,"151":0,"153":0,"156":0,"157":0,"158":0,"160":0,"174":0,"175":0,"176":0,"177":0,"178":0,"182":0,"183":0,"191":0,"192":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"207":0,"208":0,"211":0,"244":0,"245":0,"246":0,"248":0,"249":0,"252":0,"256":0,"258":0,"269":0,"270":0,"276":0,"277":0,"278":0,"281":0,"283":0,"284":0,"285":0,"286":0,"289":0,"290":0,"292":0,"293":0,"294":0,"296":0,"299":0,"300":0,"301":0,"302":0,"303":0,"306":0,"308":0,"309":0,"310":0,"311":0,"313":0,"314":0,"315":0,"317":0,"318":0,"319":0,"320":0,"321":0,"323":0,"326":0,"328":0,"330":0,"331":0};+_yuitest_coverage["build/editor-bidi/editor-bidi.js"].functions = {"EditorBidi:14":0,"_checkForChange:38":0,"_afterNodeChange:64":0,"_afterMouseUp:77":0,"initializer:81":0,"(anonymous 2):149":0,"blockParent:131":0,"tester:175":0,"addParents:173":0,"removeTextAlign:243":0,"(anonymous 3):310":0,"(anonymous 4):314":0,"bidi:269":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-bidi/editor-bidi.js"].coveredLines = 103; _yuitest_coverage["build/editor-bidi/editor-bidi.js"].coveredFunctions = 14; _yuitest_coverline("build/editor-bidi/editor-bidi.js", 1); YUI.add('editor-bidi', function (Y, NAME) {@@ -58,7 +58,7 @@ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 15); EditorBidi.superclass.constructor.apply(this, arguments); }, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',- B_C_CHANGE = 'bidiContextChange', FIRST_P = BODY + ' > p', STYLE = 'style';+ B_C_CHANGE = 'bidiContextChange', STYLE = 'style'; _yuitest_coverline("build/editor-bidi/editor-bidi.js", 19); Y.extend(EditorBidi, Y.Base, {@@ -87,7 +87,7 @@ inst = host.getInstance(), sel = new inst.EditorSelection(), node, direction;- + _yuitest_coverline("build/editor-bidi/editor-bidi.js", 44); if (sel.isCollapsed) { _yuitest_coverline("build/editor-bidi/editor-bidi.js", 45);@@ -117,7 +117,7 @@ * @private * @method _afterNodeChange */- _afterNodeChange: function(e) { + _afterNodeChange: function(e) { // If this is the first event ever, or an event that can result in a context change _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "_afterNodeChange", 64); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 66);@@ -134,7 +134,7 @@ * @private * @method _afterMouseUp */- _afterMouseUp: function(e) {+ _afterMouseUp: function() { _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "_afterMouseUp", 77); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 78); this._checkForChange();@@ -148,7 +148,7 @@ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 84); this.firstEvent = true;- + _yuitest_coverline("build/editor-bidi/editor-bidi.js", 86); host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this)); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 87);@@ -175,7 +175,7 @@ /** * More elements may be needed. BODY *must* be in the list to take care of the special case.- * + * * blockParent could be changed to use inst.EditorSelection.BLOCKS * instead, but that would make Y.Plugin.EditorBidi.blockParent * unusable in non-RTE contexts (it being usable is a nice@@ -200,13 +200,13 @@ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "blockParent", 131); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 132); var parent = node, divNode, firstChild;- + _yuitest_coverline("build/editor-bidi/editor-bidi.js", 134); if (!parent) { _yuitest_coverline("build/editor-bidi/editor-bidi.js", 135); parent = Y.one(BODY); }- + _yuitest_coverline("build/editor-bidi/editor-bidi.js", 138); if (!parent.test(EditorBidi.BLOCKS)) { _yuitest_coverline("build/editor-bidi/editor-bidi.js", 139);@@ -218,7 +218,7 @@ // according to spec: we should get to a P before BODY. But // we don't want to set the direction of BODY even if that // happens, so we wrap everything in a DIV.- + // The code is based on YUI3's Y.EditorSelection._wrapBlock function. _yuitest_coverline("build/editor-bidi/editor-bidi.js", 148); divNode = Y.Node.create(EditorBidi.DIV_WRAPPER);@@ -259,10 +259,21 @@ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "addParents", 173); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 174); var i, parent, addParent;+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 175);+tester = function(sibling) {+ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "tester", 175);+_yuitest_coverline("build/editor-bidi/editor-bidi.js", 176);+if (!sibling.getData(EditorBidi._NODE_SELECTED)) {+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 177);+addParent = false;+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 178);+return true; // stop more processing+ }+ }; - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 176);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 182); for (i = 0; i < nodeArray.length; i += 1) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 177);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 183); nodeArray[i].setData(EditorBidi._NODE_SELECTED, true); } @@ -271,46 +282,37 @@ // we haven't discovered some of its siblings yet, thus resulting in // its parent not added, the parent will be added later, since those // siblings will be added to the array and then get processed.- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 185);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 191); for (i = 0; i < nodeArray.length; i += 1) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 186);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 192); parent = nodeArray[i].get('parentNode'); // Don't add the parent if the parent is the BODY element. // We don't want to change the direction of BODY. Also don't // do it if the parent is already in the list.- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 191);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 197); if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 192);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 198); addParent = true;- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 193);-parent.get('children').some(function(sibling) {- _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 3)", 193);-_yuitest_coverline("build/editor-bidi/editor-bidi.js", 194);-if (!sibling.getData(EditorBidi._NODE_SELECTED)) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 195);-addParent = false;- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 196);-return true; // stop more processing- }- }); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 199);+parent.get('children').some(tester);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 200); if (addParent) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 200);-nodeArray.push(parent); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 201);+nodeArray.push(parent);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 202); parent.setData(EditorBidi._NODE_SELECTED, true); } }- } + } - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 206);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 207); for (i = 0; i < nodeArray.length; i += 1) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 207);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 208); nodeArray[i].clearData(EditorBidi._NODE_SELECTED); } - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 210);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 211); return nodeArray; }, @@ -344,29 +346,29 @@ * @method removeTextAlign */ removeTextAlign: function(n) {- _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "removeTextAlign", 242);-_yuitest_coverline("build/editor-bidi/editor-bidi.js", 243);+ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "removeTextAlign", 243);+_yuitest_coverline("build/editor-bidi/editor-bidi.js", 244); if (n) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 244);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 245); if (n.getAttribute(STYLE).match(EditorBidi.RE_TEXT_ALIGN)) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 245);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 246); n.setAttribute(STYLE, n.getAttribute(STYLE).replace(EditorBidi.RE_TEXT_ALIGN, '')); }- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 247);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 248); if (n.hasAttribute('align')) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 248);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 249); n.removeAttribute('align'); } }- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 251);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 252); return n; } });- - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 255);++ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 256); Y.namespace('Plugin');- - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 257);++ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 258); Y.Plugin.EditorBidi = EditorBidi; /**@@ -378,114 +380,114 @@ * @property bidi */ //TODO -- This should not add this command unless the plugin is added to the instance..- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 268);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 269); Y.Plugin.ExecCommand.COMMANDS.bidi = function(cmd, direction) {- _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "bidi", 268);-_yuitest_coverline("build/editor-bidi/editor-bidi.js", 269);+ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "bidi", 269);+_yuitest_coverline("build/editor-bidi/editor-bidi.js", 270); var inst = this.getInstance(), sel = new inst.EditorSelection(), ns = this.get(HOST).get(HOST).editorBidi,- returnValue, block,+ returnValue, block, b, selected, selectedBlocks, dir; - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 275);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 276); if (!ns) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 276);-Y.error('bidi execCommand is not available without the EditorBiDi plugin.'); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 277);+Y.error('bidi execCommand is not available without the EditorBiDi plugin.');+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 278); return; } - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 280);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 281); inst.EditorSelection.filterBlocks(); - _yuitest_coverline("build/editor-bidi/editor-bidi.js", 282);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 283); if (sel.isCollapsed) { // No selection- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 283);-block = EditorBidi.blockParent(sel.anchorNode); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 284);+block = EditorBidi.blockParent(sel.anchorNode);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 285); if (!block) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 285);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 286); block = inst.one('body').one(inst.EditorSelection.BLOCKS); } //Remove text-align attribute if it exists- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 288);-block = EditorBidi.removeTextAlign(block); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 289);+block = EditorBidi.removeTextAlign(block);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 290); if (!direction) { //If no direction is set, auto-detect the proper setting to make it "toggle"- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 291);-dir = block.getAttribute(DIR); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 292);-if (!dir || dir == 'ltr') {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 293);+dir = block.getAttribute(DIR);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 293);+if (!dir || dir === 'ltr') {+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 294); direction = 'rtl'; } else {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 295);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 296); direction = 'ltr'; } }- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 298);-block.setAttribute(DIR, direction); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 299);+block.setAttribute(DIR, direction);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 300); if (Y.UA.ie) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 300);-var b = block.all('br.yui-cursor'); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 301);-if (b.size() === 1 && block.get('childNodes').size() == 1) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 302);+b = block.all('br.yui-cursor');+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 302);+if (b.size() === 1 && block.get('childNodes').size() === 1) {+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 303); b.remove(); } }- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 305);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 306); returnValue = block; } else { // some text is selected- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 307);-selected = sel.getSelected(); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 308);-selectedBlocks = [];+selected = sel.getSelected(); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 309);+selectedBlocks = [];+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 310); selected.each(function(node) {- _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 4)", 309);-_yuitest_coverline("build/editor-bidi/editor-bidi.js", 310);+ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 3)", 310);+_yuitest_coverline("build/editor-bidi/editor-bidi.js", 311); selectedBlocks.push(EditorBidi.blockParent(node)); });- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 312);-selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks)); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 313);+selectedBlocks = inst.all(EditorBidi.addParents(selectedBlocks));+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 314); selectedBlocks.each(function(n) {- _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 5)", 313);-_yuitest_coverline("build/editor-bidi/editor-bidi.js", 314);+ _yuitest_coverfunc("build/editor-bidi/editor-bidi.js", "(anonymous 4)", 314);+_yuitest_coverline("build/editor-bidi/editor-bidi.js", 315); var d = direction; //Remove text-align attribute if it exists- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 316);-n = EditorBidi.removeTextAlign(n); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 317);+n = EditorBidi.removeTextAlign(n);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 318); if (!d) {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 318);-dir = n.getAttribute(DIR); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 319);-if (!dir || dir == 'ltr') {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 320);+dir = n.getAttribute(DIR);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 320);+if (!dir || dir === 'ltr') {+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 321); d = 'rtl'; } else {- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 322);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 323); d = 'ltr'; } }- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 325);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 326); n.setAttribute(DIR, d); });- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 327);+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 328); returnValue = selectedBlocks; }- _yuitest_coverline("build/editor-bidi/editor-bidi.js", 329);-ns._checkForChange(); _yuitest_coverline("build/editor-bidi/editor-bidi.js", 330);+ns._checkForChange();+ _yuitest_coverline("build/editor-bidi/editor-bidi.js", 331); return returnValue; }; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-bidi/editor-bidi-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -20,7 +20,7 @@ var EditorBidi = function() { EditorBidi.superclass.constructor.apply(this, arguments); }, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',- B_C_CHANGE = 'bidiContextChange', FIRST_P = BODY + ' > p', STYLE = 'style';+ B_C_CHANGE = 'bidiContextChange', STYLE = 'style'; Y.extend(EditorBidi, Y.Base, { /**@@ -46,7 +46,7 @@ inst = host.getInstance(), sel = new inst.EditorSelection(), node, direction;- + if (sel.isCollapsed) { node = EditorBidi.blockParent(sel.focusNode); if (node) {@@ -67,7 +67,7 @@ * @private * @method _afterNodeChange */- _afterNodeChange: function(e) { + _afterNodeChange: function(e) { // If this is the first event ever, or an event that can result in a context change if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) { this._checkForChange();@@ -80,7 +80,7 @@ * @private * @method _afterMouseUp */- _afterMouseUp: function(e) {+ _afterMouseUp: function() { this._checkForChange(); this.firstEvent = false; },@@ -88,7 +88,7 @@ var host = this.get(HOST); this.firstEvent = true;- + host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this)); host.after('dom:mouseup', Y.bind(this._afterMouseUp, this)); }@@ -113,7 +113,7 @@ /** * More elements may be needed. BODY *must* be in the list to take care of the special case.- * + * * blockParent could be changed to use inst.EditorSelection.BLOCKS * instead, but that would make Y.Plugin.EditorBidi.blockParent * unusable in non-RTE contexts (it being usable is a nice@@ -136,11 +136,11 @@ */ blockParent: function(node, wrap) { var parent = node, divNode, firstChild;- + if (!parent) { parent = Y.one(BODY); }- + if (!parent.test(EditorBidi.BLOCKS)) { parent = parent.ancestor(EditorBidi.BLOCKS); }@@ -149,7 +149,7 @@ // according to spec: we should get to a P before BODY. But // we don't want to set the direction of BODY even if that // happens, so we wrap everything in a DIV.- + // The code is based on YUI3's Y.EditorSelection._wrapBlock function. divNode = Y.Node.create(EditorBidi.DIV_WRAPPER); parent.get('children').each(function(node, index) {@@ -178,6 +178,12 @@ */ addParents: function(nodeArray) { var i, parent, addParent;+ tester = function(sibling) {+ if (!sibling.getData(EditorBidi._NODE_SELECTED)) {+ addParent = false;+ return true; // stop more processing+ }+ }; for (i = 0; i < nodeArray.length; i += 1) { nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);@@ -196,18 +202,13 @@ // do it if the parent is already in the list. if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) { addParent = true;- parent.get('children').some(function(sibling) {- if (!sibling.getData(EditorBidi._NODE_SELECTED)) {- addParent = false;- return true; // stop more processing- }- });+ parent.get('children').some(tester); if (addParent) { nodeArray.push(parent); parent.setData(EditorBidi._NODE_SELECTED, true); } }- } + } for (i = 0; i < nodeArray.length; i += 1) { nodeArray[i].clearData(EditorBidi._NODE_SELECTED);@@ -257,9 +258,9 @@ return n; } });- + Y.namespace('Plugin');- + Y.Plugin.EditorBidi = EditorBidi; /**@@ -275,7 +276,7 @@ var inst = this.getInstance(), sel = new inst.EditorSelection(), ns = this.get(HOST).get(HOST).editorBidi,- returnValue, block,+ returnValue, block, b, selected, selectedBlocks, dir; if (!ns) {@@ -295,7 +296,7 @@ if (!direction) { //If no direction is set, auto-detect the proper setting to make it "toggle" dir = block.getAttribute(DIR);- if (!dir || dir == 'ltr') {+ if (!dir || dir === 'ltr') { direction = 'rtl'; } else { direction = 'ltr';@@ -303,8 +304,8 @@ } block.setAttribute(DIR, direction); if (Y.UA.ie) {- var b = block.all('br.yui-cursor');- if (b.size() === 1 && block.get('childNodes').size() == 1) {+ b = block.all('br.yui-cursor');+ if (b.size() === 1 && block.get('childNodes').size() === 1) { b.remove(); } }@@ -322,7 +323,7 @@ n = EditorBidi.removeTextAlign(n); if (!d) { dir = n.getAttribute(DIR);- if (!dir || dir == 'ltr') {+ if (!dir || dir === 'ltr') { d = 'rtl'; } else { d = 'ltr';@@ -339,4 +340,4 @@ -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-bidi/editor-bidi-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-bidi",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="dir",s="BODY",o="nodeChange",u="bidiContextChange",a=s+" > p",f="style";e.extend(n,e.Base,{lastDirection:null,firstEvent:null,_checkForChange:function(){var e=this.get(r),t=e.getInstance(),i=new t.EditorSelection,s,o;i.isCollapsed?(s=n.blockParent(i.focusNode),s&&(o=s.getStyle("direction"),o!==this.lastDirection&&(e.fire(u,{changedTo:o}),this.lastDirection=o))):(e.fire(u,{changedTo:"select"}),this.lastDirection=null)},_afterNodeChange:function(e){if(this.firstEvent||n.EVENTS[e.changedType])this._checkForChange(),this.firstEvent=!1},_afterMouseUp:function(e){this._checkForChange(),this.firstEvent=!1},initializer:function(){var t=this.get(r);this.firstEvent=!0,t.after(o,e.bind(this._afterNodeChange,this)),t.after("dom:mouseup",e.bind(this._afterMouseUp,this))}},{EVENTS:{"backspace-up":!0,"pageup-up":!0,"pagedown-down":!0,"end-up":!0,"home-up":!0,"left-up":!0,"up-up":!0,"right-up":!0,"down-up":!0,"delete-up":!0},BLOCKS:e.EditorSelection.BLOCKS,DIV_WRAPPER:"<DIV></DIV>",blockParent:function(t,r){var i=t,o,u;return i||(i=e.one(s)),i.test(n.BLOCKS)||(i=i.ancestor(n.BLOCKS)),r&&i.test(s)&&(o=e.Node.create(n.DIV_WRAPPER),i.get("children").each(function(e,t){t===0?u=e:o.append(e)}),u.replace(o),o.prepend(u),i=o),i},_NODE_SELECTED:"bidiSelected",addParents:function(e){var t,r,i;for(t=0;t<e.length;t+=1)e[t].setData(n._NODE_SELECTED,!0);for(t=0;t<e.length;t+=1)r=e[t].get("parentNode"),!r.test(s)&&!r.getData(n._NODE_SELECTED)&&(i=!0,r.get("children").some(function(e){if(!e.getData(n._NODE_SELECTED))return i=!1,!0}),i&&(e.push(r),r.setData(n._NODE_SELECTED,!0)));for(t=0;t<e.length;t+=1)e[t].clearData(n._NODE_SELECTED);return e},NAME:"editorBidi",NS:"editorBidi",ATTRS:{host:{value:!1}},RE_TEXT_ALIGN:/text-align:\s*\w*\s*;/,removeTextAlign:function(e){return e&&(e.getAttribute(f).match(n.RE_TEXT_ALIGN)&&e.setAttribute(f,e.getAttribute(f).replace(n.RE_TEXT_ALIGN,"")),e.hasAttribute("align")&&e.removeAttribute("align")),e}}),e.namespace("Plugin"),e.Plugin.EditorBidi=n,e.Plugin.ExecCommand.COMMANDS.bidi=function(t,s){var o=this.getInstance(),u=new o.EditorSelection,a=this.get(r).get(r).editorBidi,f,l,c,h,p;if(!a){e.error("bidi execCommand is not available without the EditorBiDi plugin.");return}o.EditorSelection.filterBlocks();if(u.isCollapsed){l=n.blockParent(u.anchorNode),l||(l=o.one("body").one(o.EditorSelection.BLOCKS)),l=n.removeTextAlign(l),s||(p=l.getAttribute(i),!p||p=="ltr"?s="rtl":s="ltr"),l.setAttribute(i,s);if(e.UA.ie){var d=l.all("br.yui-cursor");d.size()===1&&l.get("childNodes").size()==1&&d.remove()}f=l}else c=u.getSelected(),h=[],c.each(function(e){h.push(n.blockParent(e))}),h=o.all(n.addParents(h)),h.each(function(e){var t=s;e=n.removeTextAlign(e),t||(p=e.getAttribute(i),!p||p=="ltr"?t="rtl":t="ltr"),e.setAttribute(i,t)}),f=h;return a._checkForChange(),f}},"3.7.2",{requires:["editor-base"]});+YUI.add("editor-bidi",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="dir",s="BODY",o="nodeChange",u="bidiContextChange",a="style";e.extend(n,e.Base,{lastDirection:null,firstEvent:null,_checkForChange:function(){var e=this.get(r),t=e.getInstance(),i=new t.EditorSelection,s,o;i.isCollapsed?(s=n.blockParent(i.focusNode),s&&(o=s.getStyle("direction"),o!==this.lastDirection&&(e.fire(u,{changedTo:o}),this.lastDirection=o))):(e.fire(u,{changedTo:"select"}),this.lastDirection=null)},_afterNodeChange:function(e){if(this.firstEvent||n.EVENTS[e.changedType])this._checkForChange(),this.firstEvent=!1},_afterMouseUp:function(){this._checkForChange(),this.firstEvent=!1},initializer:function(){var t=this.get(r);this.firstEvent=!0,t.after(o,e.bind(this._afterNodeChange,this)),t.after("dom:mouseup",e.bind(this._afterMouseUp,this))}},{EVENTS:{"backspace-up":!0,"pageup-up":!0,"pagedown-down":!0,"end-up":!0,"home-up":!0,"left-up":!0,"up-up":!0,"right-up":!0,"down-up":!0,"delete-up":!0},BLOCKS:e.EditorSelection.BLOCKS,DIV_WRAPPER:"<DIV></DIV>",blockParent:function(t,r){var i=t,o,u;return i||(i=e.one(s)),i.test(n.BLOCKS)||(i=i.ancestor(n.BLOCKS)),r&&i.test(s)&&(o=e.Node.create(n.DIV_WRAPPER),i.get("children").each(function(e,t){t===0?u=e:o.append(e)}),u.replace(o),o.prepend(u),i=o),i},_NODE_SELECTED:"bidiSelected",addParents:function(e){var t,r,i;tester=function(e){if(!e.getData(n._NODE_SELECTED))return i=!1,!0};for(t=0;t<e.length;t+=1)e[t].setData(n._NODE_SELECTED,!0);for(t=0;t<e.length;t+=1)r=e[t].get("parentNode"),!r.test(s)&&!r.getData(n._NODE_SELECTED)&&(i=!0,r.get("children").some(tester),i&&(e.push(r),r.setData(n._NODE_SELECTED,!0)));for(t=0;t<e.length;t+=1)e[t].clearData(n._NODE_SELECTED);return e},NAME:"editorBidi",NS:"editorBidi",ATTRS:{host:{value:!1}},RE_TEXT_ALIGN:/text-align:\s*\w*\s*;/,removeTextAlign:function(e){return e&&(e.getAttribute(a).match(n.RE_TEXT_ALIGN)&&e.setAttribute(a,e.getAttribute(a).replace(n.RE_TEXT_ALIGN,"")),e.hasAttribute("align")&&e.removeAttribute("align")),e}}),e.namespace("Plugin"),e.Plugin.EditorBidi=n,e.Plugin.ExecCommand.COMMANDS.bidi=function(t,s){var o=this.getInstance(),u=new o.EditorSelection,a=this.get(r).get(r).editorBidi,f,l,c,h,p,d;if(!a){e.error("bidi execCommand is not available without the EditorBiDi plugin.");return}return o.EditorSelection.filterBlocks(),u.isCollapsed?(l=n.blockParent(u.anchorNode),l||(l=o.one("body").one(o.EditorSelection.BLOCKS)),l=n.removeTextAlign(l),s||(d=l.getAttribute(i),!d||d==="ltr"?s="rtl":s="ltr"),l.setAttribute(i,s),e.UA.ie&&(c=l.all("br.yui-cursor"),c.size()===1&&l.get("childNodes").size()===1&&c.remove()),f=l):(h=u.getSelected(),p=[],h.each(function(e){p.push(n.blockParent(e))}),p=o.all(n.addParents(p)),p.each(function(e){var t=s;e=n.removeTextAlign(e),t||(d=e.getAttribute(i),!d||d==="ltr"?t="rtl":t="ltr"),e.setAttribute(i,t)}),f=p),a._checkForChange(),f}},"3.7.3",{requires:["editor-base"]});
bundle/editor-bidi/editor-bidi.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -20,7 +20,7 @@ var EditorBidi = function() { EditorBidi.superclass.constructor.apply(this, arguments); }, HOST = 'host', DIR = 'dir', BODY = 'BODY', NODE_CHANGE = 'nodeChange',- B_C_CHANGE = 'bidiContextChange', FIRST_P = BODY + ' > p', STYLE = 'style';+ B_C_CHANGE = 'bidiContextChange', STYLE = 'style'; Y.extend(EditorBidi, Y.Base, { /**@@ -46,7 +46,7 @@ inst = host.getInstance(), sel = new inst.EditorSelection(), node, direction;- + if (sel.isCollapsed) { node = EditorBidi.blockParent(sel.focusNode); if (node) {@@ -67,7 +67,7 @@ * @private * @method _afterNodeChange */- _afterNodeChange: function(e) { + _afterNodeChange: function(e) { // If this is the first event ever, or an event that can result in a context change if (this.firstEvent || EditorBidi.EVENTS[e.changedType]) { this._checkForChange();@@ -80,7 +80,7 @@ * @private * @method _afterMouseUp */- _afterMouseUp: function(e) {+ _afterMouseUp: function() { this._checkForChange(); this.firstEvent = false; },@@ -88,7 +88,7 @@ var host = this.get(HOST); this.firstEvent = true;- + host.after(NODE_CHANGE, Y.bind(this._afterNodeChange, this)); host.after('dom:mouseup', Y.bind(this._afterMouseUp, this)); }@@ -113,7 +113,7 @@ /** * More elements may be needed. BODY *must* be in the list to take care of the special case.- * + * * blockParent could be changed to use inst.EditorSelection.BLOCKS * instead, but that would make Y.Plugin.EditorBidi.blockParent * unusable in non-RTE contexts (it being usable is a nice@@ -136,11 +136,11 @@ */ blockParent: function(node, wrap) { var parent = node, divNode, firstChild;- + if (!parent) { parent = Y.one(BODY); }- + if (!parent.test(EditorBidi.BLOCKS)) { parent = parent.ancestor(EditorBidi.BLOCKS); }@@ -149,7 +149,7 @@ // according to spec: we should get to a P before BODY. But // we don't want to set the direction of BODY even if that // happens, so we wrap everything in a DIV.- + // The code is based on YUI3's Y.EditorSelection._wrapBlock function. divNode = Y.Node.create(EditorBidi.DIV_WRAPPER); parent.get('children').each(function(node, index) {@@ -178,6 +178,12 @@ */ addParents: function(nodeArray) { var i, parent, addParent;+ tester = function(sibling) {+ if (!sibling.getData(EditorBidi._NODE_SELECTED)) {+ addParent = false;+ return true; // stop more processing+ }+ }; for (i = 0; i < nodeArray.length; i += 1) { nodeArray[i].setData(EditorBidi._NODE_SELECTED, true);@@ -196,18 +202,13 @@ // do it if the parent is already in the list. if (!parent.test(BODY) && !parent.getData(EditorBidi._NODE_SELECTED)) { addParent = true;- parent.get('children').some(function(sibling) {- if (!sibling.getData(EditorBidi._NODE_SELECTED)) {- addParent = false;- return true; // stop more processing- }- });+ parent.get('children').some(tester); if (addParent) { nodeArray.push(parent); parent.setData(EditorBidi._NODE_SELECTED, true); } }- } + } for (i = 0; i < nodeArray.length; i += 1) { nodeArray[i].clearData(EditorBidi._NODE_SELECTED);@@ -257,9 +258,9 @@ return n; } });- + Y.namespace('Plugin');- + Y.Plugin.EditorBidi = EditorBidi; /**@@ -275,7 +276,7 @@ var inst = this.getInstance(), sel = new inst.EditorSelection(), ns = this.get(HOST).get(HOST).editorBidi,- returnValue, block,+ returnValue, block, b, selected, selectedBlocks, dir; if (!ns) {@@ -295,7 +296,7 @@ if (!direction) { //If no direction is set, auto-detect the proper setting to make it "toggle" dir = block.getAttribute(DIR);- if (!dir || dir == 'ltr') {+ if (!dir || dir === 'ltr') { direction = 'rtl'; } else { direction = 'ltr';@@ -303,8 +304,8 @@ } block.setAttribute(DIR, direction); if (Y.UA.ie) {- var b = block.all('br.yui-cursor');- if (b.size() === 1 && block.get('childNodes').size() == 1) {+ b = block.all('br.yui-cursor');+ if (b.size() === 1 && block.get('childNodes').size() === 1) { b.remove(); } }@@ -322,7 +323,7 @@ n = EditorBidi.removeTextAlign(n); if (!d) { dir = n.getAttribute(DIR);- if (!dir || dir == 'ltr') {+ if (!dir || dir === 'ltr') { d = 'rtl'; } else { d = 'ltr';@@ -339,4 +340,4 @@ -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-br/editor-br-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/editor-br/editor-br.js", code: [] };-_yuitest_coverage["build/editor-br/editor-br.js"].code=["YUI.add('editor-br', function (Y, NAME) {","","",""," /**"," * Plugin for Editor to normalize BR's."," * @class Plugin.EditorBR"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-br"," */","",""," var EditorBR = function() {"," EditorBR.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', LI = 'li';","",""," Y.extend(EditorBR, Y.Base, {"," /**"," * Frame keyDown handler that normalizes BR's when pressing ENTER."," * @private"," * @method _onKeyDown"," */"," _onKeyDown: function(e) {"," if (e.stopped) {"," e.halt();"," return;"," }"," if (e.keyCode == 13) {"," var host = this.get(HOST), inst = host.getInstance(),"," sel = new inst.EditorSelection(),"," last = '';",""," if (sel) {"," if (Y.UA.ie) {"," if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {"," var host = this.get(HOST);"," host.execCommand('inserthtml', inst.EditorSelection.CURSOR);"," e.halt();"," }"," }"," if (Y.UA.webkit) {"," if (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI)) {"," host.frame._execCommand('insertlinebreak', null);"," e.halt();"," }"," }"," }"," }"," },"," /**"," * Adds listeners for keydown in IE and Webkit. Also fires insertbeonreturn for supporting browsers."," * @private"," * @method _afterEditorReady"," */"," _afterEditorReady: function() {"," var inst = this.get(HOST).getInstance();"," try {"," inst.config.doc.execCommand('insertbronreturn', null, true);"," } catch (bre) {}",""," if (Y.UA.ie || Y.UA.webkit) {"," inst.on('keydown', Y.bind(this._onKeyDown, this), inst.config.doc);"," }"," },"," /**"," * Adds a nodeChange listener only for FF, in the event of a backspace or delete, it creates an empy textNode"," * inserts it into the DOM after the e.changedNode, then removes it. Causing FF to redraw the content."," * @private"," * @method _onNodeChange"," * @param {Event} e The nodeChange event."," */"," _onNodeChange: function(e) {"," switch (e.changedType) {"," case 'backspace-up':"," case 'backspace-down':"," case 'delete-up':"," /*"," * This forced FF to redraw the content on backspace."," * On some occasions FF will leave a cursor residue after content has been deleted."," * Dropping in the empty textnode and then removing it causes FF to redraw and"," * remove the \"ghost cursors\""," */"," var inst = this.get(HOST).getInstance();"," var d = e.changedNode;"," var t = inst.config.doc.createTextNode(' ');"," d.appendChild(t);"," d.removeChild(t);"," break;"," }"," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorPara) {"," Y.error('Can not plug EditorBR and EditorPara at the same time.');"," return;"," }"," host.after('ready', Y.bind(this._afterEditorReady, this));"," if (Y.UA.gecko) {"," host.on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }"," }, {"," /**"," * editorBR"," * @static"," * @property NAME"," */"," NAME: 'editorBR',"," /**"," * editorBR"," * @static"," * @property NS"," */"," NS: 'editorBR',"," ATTRS: {"," host: {"," value: false"," }"," }"," });"," "," Y.namespace('Plugin');"," "," Y.Plugin.EditorBR = EditorBR;","","","","}, '3.7.2', {\"requires\": [\"editor-base\"]});"];-_yuitest_coverage["build/editor-br/editor-br.js"].lines = {"1":0,"15":0,"16":0,"20":0,"27":0,"28":0,"29":0,"31":0,"32":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"44":0,"45":0,"46":0,"47":0,"59":0,"60":0,"61":0,"64":0,"65":0,"76":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"95":0,"96":0,"97":0,"98":0,"100":0,"101":0,"102":0,"125":0,"127":0};-_yuitest_coverage["build/editor-br/editor-br.js"].functions = {"EditorBR:15":0,"_onKeyDown:26":0,"_afterEditorReady:58":0,"_onNodeChange:75":0,"initializer:94":0,"(anonymous 1):1":0};-_yuitest_coverage["build/editor-br/editor-br.js"].coveredLines = 40;+_yuitest_coverage["build/editor-br/editor-br.js"].code=["YUI.add('editor-br', function (Y, NAME) {","","",""," /**"," * Plugin for Editor to normalize BR's."," * @class Plugin.EditorBR"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-br"," */","",""," var EditorBR = function() {"," EditorBR.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', LI = 'li';","",""," Y.extend(EditorBR, Y.Base, {"," /**"," * Frame keyDown handler that normalizes BR's when pressing ENTER."," * @private"," * @method _onKeyDown"," */"," _onKeyDown: function(e) {"," if (e.stopped) {"," e.halt();"," return;"," }"," if (e.keyCode === 13) {"," var host = this.get(HOST), inst = host.getInstance(),"," sel = new inst.EditorSelection();",""," if (sel) {"," if (Y.UA.ie) {"," if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {"," host.execCommand('inserthtml', inst.EditorSelection.CURSOR);"," e.halt();"," }"," }"," if (Y.UA.webkit) {"," if (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI)) {"," host.frame._execCommand('insertlinebreak', null);"," e.halt();"," }"," }"," }"," }"," },"," /**"," * Adds listeners for keydown in IE and Webkit. Also fires insertbeonreturn for supporting browsers."," * @private"," * @method _afterEditorReady"," */"," _afterEditorReady: function() {"," var inst = this.get(HOST).getInstance();"," try {"," inst.config.doc.execCommand('insertbronreturn', null, true);"," } catch (bre) {}",""," if (Y.UA.ie || Y.UA.webkit) {"," inst.on('keydown', Y.bind(this._onKeyDown, this), inst.config.doc);"," }"," },"," /**"," * Adds a nodeChange listener only for FF, in the event of a backspace or delete, it creates an empy textNode"," * inserts it into the DOM after the e.changedNode, then removes it. Causing FF to redraw the content."," * @private"," * @method _onNodeChange"," * @param {Event} e The nodeChange event."," */"," _onNodeChange: function(e) {"," switch (e.changedType) {"," case 'backspace-up':"," case 'backspace-down':"," case 'delete-up':"," /*"," * This forced FF to redraw the content on backspace."," * On some occasions FF will leave a cursor residue after content has been deleted."," * Dropping in the empty textnode and then removing it causes FF to redraw and"," * remove the \"ghost cursors\""," */"," var inst = this.get(HOST).getInstance(),"," d = e.changedNode,"," t = inst.config.doc.createTextNode(' ');"," d.appendChild(t);"," d.removeChild(t);"," break;"," }"," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorPara) {"," Y.error('Can not plug EditorBR and EditorPara at the same time.');"," return;"," }"," host.after('ready', Y.bind(this._afterEditorReady, this));"," if (Y.UA.gecko) {"," host.on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }"," }, {"," /**"," * editorBR"," * @static"," * @property NAME"," */"," NAME: 'editorBR',"," /**"," * editorBR"," * @static"," * @property NS"," */"," NS: 'editorBR',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorBR = EditorBR;","","","","}, '3.7.3', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/editor-br/editor-br.js"].lines = {"1":0,"15":0,"16":0,"20":0,"27":0,"28":0,"29":0,"31":0,"32":0,"35":0,"36":0,"37":0,"38":0,"39":0,"42":0,"43":0,"44":0,"45":0,"57":0,"58":0,"59":0,"62":0,"63":0,"74":0,"84":0,"87":0,"88":0,"89":0,"93":0,"94":0,"95":0,"96":0,"98":0,"99":0,"100":0,"123":0,"125":0};+_yuitest_coverage["build/editor-br/editor-br.js"].functions = {"EditorBR:15":0,"_onKeyDown:26":0,"_afterEditorReady:56":0,"_onNodeChange:73":0,"initializer:92":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-br/editor-br.js"].coveredLines = 37; _yuitest_coverage["build/editor-br/editor-br.js"].coveredFunctions = 6; _yuitest_coverline("build/editor-br/editor-br.js", 1); YUI.add('editor-br', function (Y, NAME) {@@ -78,33 +78,30 @@ return; } _yuitest_coverline("build/editor-br/editor-br.js", 31);-if (e.keyCode == 13) {+if (e.keyCode === 13) { _yuitest_coverline("build/editor-br/editor-br.js", 32); var host = this.get(HOST), inst = host.getInstance(),- sel = new inst.EditorSelection(),- last = '';+ sel = new inst.EditorSelection(); - _yuitest_coverline("build/editor-br/editor-br.js", 36);+ _yuitest_coverline("build/editor-br/editor-br.js", 35); if (sel) {- _yuitest_coverline("build/editor-br/editor-br.js", 37);+ _yuitest_coverline("build/editor-br/editor-br.js", 36); if (Y.UA.ie) {- _yuitest_coverline("build/editor-br/editor-br.js", 38);+ _yuitest_coverline("build/editor-br/editor-br.js", 37); if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {- _yuitest_coverline("build/editor-br/editor-br.js", 39);-var host = this.get(HOST);- _yuitest_coverline("build/editor-br/editor-br.js", 40);+ _yuitest_coverline("build/editor-br/editor-br.js", 38); host.execCommand('inserthtml', inst.EditorSelection.CURSOR);- _yuitest_coverline("build/editor-br/editor-br.js", 41);+ _yuitest_coverline("build/editor-br/editor-br.js", 39); e.halt(); } }- _yuitest_coverline("build/editor-br/editor-br.js", 44);+ _yuitest_coverline("build/editor-br/editor-br.js", 42); if (Y.UA.webkit) {- _yuitest_coverline("build/editor-br/editor-br.js", 45);+ _yuitest_coverline("build/editor-br/editor-br.js", 43); if (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI)) {- _yuitest_coverline("build/editor-br/editor-br.js", 46);+ _yuitest_coverline("build/editor-br/editor-br.js", 44); host.frame._execCommand('insertlinebreak', null);- _yuitest_coverline("build/editor-br/editor-br.js", 47);+ _yuitest_coverline("build/editor-br/editor-br.js", 45); e.halt(); } }@@ -117,18 +114,18 @@ * @method _afterEditorReady */ _afterEditorReady: function() {- _yuitest_coverfunc("build/editor-br/editor-br.js", "_afterEditorReady", 58);-_yuitest_coverline("build/editor-br/editor-br.js", 59);+ _yuitest_coverfunc("build/editor-br/editor-br.js", "_afterEditorReady", 56);+_yuitest_coverline("build/editor-br/editor-br.js", 57); var inst = this.get(HOST).getInstance();- _yuitest_coverline("build/editor-br/editor-br.js", 60);+ _yuitest_coverline("build/editor-br/editor-br.js", 58); try {- _yuitest_coverline("build/editor-br/editor-br.js", 61);+ _yuitest_coverline("build/editor-br/editor-br.js", 59); inst.config.doc.execCommand('insertbronreturn', null, true); } catch (bre) {} - _yuitest_coverline("build/editor-br/editor-br.js", 64);+ _yuitest_coverline("build/editor-br/editor-br.js", 62); if (Y.UA.ie || Y.UA.webkit) {- _yuitest_coverline("build/editor-br/editor-br.js", 65);+ _yuitest_coverline("build/editor-br/editor-br.js", 63); inst.on('keydown', Y.bind(this._onKeyDown, this), inst.config.doc); } },@@ -140,8 +137,8 @@ * @param {Event} e The nodeChange event. */ _onNodeChange: function(e) {- _yuitest_coverfunc("build/editor-br/editor-br.js", "_onNodeChange", 75);-_yuitest_coverline("build/editor-br/editor-br.js", 76);+ _yuitest_coverfunc("build/editor-br/editor-br.js", "_onNodeChange", 73);+_yuitest_coverline("build/editor-br/editor-br.js", 74); switch (e.changedType) { case 'backspace-up': case 'backspace-down':@@ -152,36 +149,34 @@ * Dropping in the empty textnode and then removing it causes FF to redraw and * remove the "ghost cursors" */- _yuitest_coverline("build/editor-br/editor-br.js", 86);-var inst = this.get(HOST).getInstance();+ _yuitest_coverline("build/editor-br/editor-br.js", 84);+var inst = this.get(HOST).getInstance(),+ d = e.changedNode,+ t = inst.config.doc.createTextNode(' '); _yuitest_coverline("build/editor-br/editor-br.js", 87);-var d = e.changedNode;- _yuitest_coverline("build/editor-br/editor-br.js", 88);-var t = inst.config.doc.createTextNode(' ');- _yuitest_coverline("build/editor-br/editor-br.js", 89); d.appendChild(t);- _yuitest_coverline("build/editor-br/editor-br.js", 90);+ _yuitest_coverline("build/editor-br/editor-br.js", 88); d.removeChild(t);- _yuitest_coverline("build/editor-br/editor-br.js", 91);+ _yuitest_coverline("build/editor-br/editor-br.js", 89); break; } }, initializer: function() {- _yuitest_coverfunc("build/editor-br/editor-br.js", "initializer", 94);-_yuitest_coverline("build/editor-br/editor-br.js", 95);+ _yuitest_coverfunc("build/editor-br/editor-br.js", "initializer", 92);+_yuitest_coverline("build/editor-br/editor-br.js", 93); var host = this.get(HOST);- _yuitest_coverline("build/editor-br/editor-br.js", 96);+ _yuitest_coverline("build/editor-br/editor-br.js", 94); if (host.editorPara) {- _yuitest_coverline("build/editor-br/editor-br.js", 97);+ _yuitest_coverline("build/editor-br/editor-br.js", 95); Y.error('Can not plug EditorBR and EditorPara at the same time.');- _yuitest_coverline("build/editor-br/editor-br.js", 98);+ _yuitest_coverline("build/editor-br/editor-br.js", 96); return; }- _yuitest_coverline("build/editor-br/editor-br.js", 100);+ _yuitest_coverline("build/editor-br/editor-br.js", 98); host.after('ready', Y.bind(this._afterEditorReady, this));- _yuitest_coverline("build/editor-br/editor-br.js", 101);+ _yuitest_coverline("build/editor-br/editor-br.js", 99); if (Y.UA.gecko) {- _yuitest_coverline("build/editor-br/editor-br.js", 102);+ _yuitest_coverline("build/editor-br/editor-br.js", 100); host.on('nodeChange', Y.bind(this._onNodeChange, this)); } }@@ -204,13 +199,13 @@ } } });- - _yuitest_coverline("build/editor-br/editor-br.js", 125);++ _yuitest_coverline("build/editor-br/editor-br.js", 123); Y.namespace('Plugin');- - _yuitest_coverline("build/editor-br/editor-br.js", 127);++ _yuitest_coverline("build/editor-br/editor-br.js", 125); Y.Plugin.EditorBR = EditorBR; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-br/editor-br-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -34,15 +34,13 @@ e.halt(); return; }- if (e.keyCode == 13) {+ if (e.keyCode === 13) { var host = this.get(HOST), inst = host.getInstance(),- sel = new inst.EditorSelection(),- last = '';+ sel = new inst.EditorSelection(); if (sel) { if (Y.UA.ie) { if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {- var host = this.get(HOST); host.execCommand('inserthtml', inst.EditorSelection.CURSOR); e.halt(); }@@ -89,9 +87,9 @@ * Dropping in the empty textnode and then removing it causes FF to redraw and * remove the "ghost cursors" */- var inst = this.get(HOST).getInstance();- var d = e.changedNode;- var t = inst.config.doc.createTextNode(' ');+ var inst = this.get(HOST).getInstance(),+ d = e.changedNode,+ t = inst.config.doc.createTextNode(' '); d.appendChild(t); d.removeChild(t); break;@@ -127,11 +125,11 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorBR = EditorBR; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-br/editor-br-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-br",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="li";e.extend(n,e.Base,{_onKeyDown:function(t){if(t.stopped){t.halt();return}if(t.keyCode==13){var n=this.get(r),s=n.getInstance(),o=new s.EditorSelection,u="";if(o){if(e.UA.ie)if(!o.anchorNode||!o.anchorNode.test(i)&&!o.anchorNode.ancestor(i)){var n=this.get(r);n.execCommand("inserthtml",s.EditorSelection.CURSOR),t.halt()}e.UA.webkit&&!o.anchorNode.test(i)&&!o.anchorNode.ancestor(i)&&(n.frame._execCommand("insertlinebreak",null),t.halt())}}},_afterEditorReady:function(){var t=this.get(r).getInstance();try{t.config.doc.execCommand("insertbronreturn",null,!0)}catch(n){}(e.UA.ie||e.UA.webkit)&&t.on("keydown",e.bind(this._onKeyDown,this),t.config.doc)},_onNodeChange:function(e){switch(e.changedType){case"backspace-up":case"backspace-down":case"delete-up":var t=this.get(r).getInstance(),n=e.changedNode,i=t.config.doc.createTextNode(" ");n.appendChild(i),n.removeChild(i)}},initializer:function(){var t=this.get(r);if(t.editorPara){e.error("Can not plug EditorBR and EditorPara at the same time.");return}t.after("ready",e.bind(this._afterEditorReady,this)),e.UA.gecko&&t.on("nodeChange",e.bind(this._onNodeChange,this))}},{NAME:"editorBR",NS:"editorBR",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorBR=n},"3.7.2",{requires:["editor-base"]});+YUI.add("editor-br",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="li";e.extend(n,e.Base,{_onKeyDown:function(t){if(t.stopped){t.halt();return}if(t.keyCode===13){var n=this.get(r),s=n.getInstance(),o=new s.EditorSelection;o&&(e.UA.ie&&(!o.anchorNode||!o.anchorNode.test(i)&&!o.anchorNode.ancestor(i))&&(n.execCommand("inserthtml",s.EditorSelection.CURSOR),t.halt()),e.UA.webkit&&!o.anchorNode.test(i)&&!o.anchorNode.ancestor(i)&&(n.frame._execCommand("insertlinebreak",null),t.halt()))}},_afterEditorReady:function(){var t=this.get(r).getInstance();try{t.config.doc.execCommand("insertbronreturn",null,!0)}catch(n){}(e.UA.ie||e.UA.webkit)&&t.on("keydown",e.bind(this._onKeyDown,this),t.config.doc)},_onNodeChange:function(e){switch(e.changedType){case"backspace-up":case"backspace-down":case"delete-up":var t=this.get(r).getInstance(),n=e.changedNode,i=t.config.doc.createTextNode(" ");n.appendChild(i),n.removeChild(i)}},initializer:function(){var t=this.get(r);if(t.editorPara){e.error("Can not plug EditorBR and EditorPara at the same time.");return}t.after("ready",e.bind(this._afterEditorReady,this)),e.UA.gecko&&t.on("nodeChange",e.bind(this._onNodeChange,this))}},{NAME:"editorBR",NS:"editorBR",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorBR=n},"3.7.3",{requires:["editor-base"]});
bundle/editor-br/editor-br.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -34,15 +34,13 @@ e.halt(); return; }- if (e.keyCode == 13) {+ if (e.keyCode === 13) { var host = this.get(HOST), inst = host.getInstance(),- sel = new inst.EditorSelection(),- last = '';+ sel = new inst.EditorSelection(); if (sel) { if (Y.UA.ie) { if (!sel.anchorNode || (!sel.anchorNode.test(LI) && !sel.anchorNode.ancestor(LI))) {- var host = this.get(HOST); host.execCommand('inserthtml', inst.EditorSelection.CURSOR); e.halt(); }@@ -89,9 +87,9 @@ * Dropping in the empty textnode and then removing it causes FF to redraw and * remove the "ghost cursors" */- var inst = this.get(HOST).getInstance();- var d = e.changedNode;- var t = inst.config.doc.createTextNode(' ');+ var inst = this.get(HOST).getInstance(),+ d = e.changedNode,+ t = inst.config.doc.createTextNode(' '); d.appendChild(t); d.removeChild(t); break;@@ -127,11 +125,11 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorBR = EditorBR; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-lists/editor-lists-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/editor-lists/editor-lists.js", code: [] };-_yuitest_coverage["build/editor-lists/editor-lists.js"].code=["YUI.add('editor-lists', function (Y, NAME) {","",""," /**"," * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support. Adds overrides for the <a href=\"Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist\">insertorderedlist</a> and <a href=\"Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist\">insertunorderedlist</a> execCommands."," * @class Plugin.EditorLists"," * @constructor"," * @extends Base"," * @module editor"," * @submodule editor-lists"," */"," "," var EditorLists = function() {"," EditorLists.superclass.constructor.apply(this, arguments);"," }, LI = 'li', OL = 'ol', UL = 'ul', HOST = 'host';",""," Y.extend(EditorLists, Y.Base, {"," /**"," * Listener for host's nodeChange event and captures the tabkey interaction only when inside a list node."," * @private"," * @method _onNodeChange"," * @param {Event} e The Event facade passed from the host."," */"," _onNodeChange: function(e) {"," var inst = this.get(HOST).getInstance(), sel, li, "," newLi, newList, sTab, par, moved = false, tag, focusEnd = false;",""," if (e.changedType === 'tab') {"," if (e.changedNode.test(LI + ', ' + LI + ' *')) {"," e.changedEvent.halt();"," e.preventDefault();"," li = e.changedNode;"," sTab = e.changedEvent.shiftKey;"," par = li.ancestor(OL + ',' + UL);"," tag = UL;",""," if (par.get('tagName').toLowerCase() === OL) {"," tag = OL;"," }"," "," if (!li.test(LI)) {"," li = li.ancestor(LI);"," }"," if (sTab) {"," if (li.ancestor(LI)) {"," li.ancestor(LI).insert(li, 'after');"," moved = true;"," focusEnd = true;"," }"," } else {"," //li.setStyle('border', '1px solid red');"," if (li.previous(LI)) {"," newList = inst.Node.create('<' + tag + '></' + tag + '>');"," li.previous(LI).append(newList);"," newList.append(li);"," moved = true;"," }"," }"," }"," if (moved) {"," if (!li.test(LI)) {"," li = li.ancestor(LI);"," }"," li.all(EditorLists.REMOVE).remove();"," if (Y.UA.ie) {"," li = li.append(EditorLists.NON).one(EditorLists.NON_SEL);"," }"," //Selection here.."," (new inst.EditorSelection()).selectNode(li, true, focusEnd);"," }"," }"," },"," initializer: function() {"," this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * The non element placeholder, used for positioning the cursor and filling empty items"," * @property REMOVE"," * @static"," */"," NON: '<span class=\"yui-non\"> </span>',"," /**"," * The selector query to get all non elements"," * @property NONSEL"," * @static"," */"," NON_SEL: 'span.yui-non',"," /**"," * The items to removed from a list when a list item is moved, currently removes BR nodes"," * @property REMOVE"," * @static"," */"," REMOVE: 'br',"," /**"," * editorLists"," * @property NAME"," * @static"," */"," NAME: 'editorLists',"," /**"," * lists"," * @property NS"," * @static"," */"," NS: 'lists',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorLists = EditorLists;","","","","}, '3.7.2', {\"requires\": [\"editor-base\"]});"];-_yuitest_coverage["build/editor-lists/editor-lists.js"].lines = {"1":0,"13":0,"14":0,"17":0,"25":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"37":0,"38":0,"41":0,"42":0,"44":0,"45":0,"46":0,"47":0,"48":0,"52":0,"53":0,"54":0,"55":0,"56":0,"60":0,"61":0,"62":0,"64":0,"65":0,"66":0,"69":0,"74":0,"114":0,"116":0};-_yuitest_coverage["build/editor-lists/editor-lists.js"].functions = {"EditorLists:13":0,"_onNodeChange:24":0,"initializer:73":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-lists/editor-lists.js"].code=["YUI.add('editor-lists', function (Y, NAME) {","",""," /**"," * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support."," * Adds overrides for the <a href=\"Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist\">insertorderedlist</a>"," * and <a href=\"Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist\">insertunorderedlist</a> execCommands."," * @class Plugin.EditorLists"," * @constructor"," * @extends Base"," * @module editor"," * @submodule editor-lists"," */",""," var EditorLists = function() {"," EditorLists.superclass.constructor.apply(this, arguments);"," }, LI = 'li', OL = 'ol', UL = 'ul', HOST = 'host';",""," Y.extend(EditorLists, Y.Base, {"," /**"," * Listener for host's nodeChange event and captures the tabkey interaction only when inside a list node."," * @private"," * @method _onNodeChange"," * @param {Event} e The Event facade passed from the host."," */"," _onNodeChange: function(e) {"," var inst = this.get(HOST).getInstance(), li,"," newList, sTab, par, moved = false, tag, focusEnd = false;",""," if (e.changedType === 'tab') {"," if (e.changedNode.test(LI + ', ' + LI + ' *')) {"," e.changedEvent.halt();"," e.preventDefault();"," li = e.changedNode;"," sTab = e.changedEvent.shiftKey;"," par = li.ancestor(OL + ',' + UL);"," tag = UL;",""," if (par.get('tagName').toLowerCase() === OL) {"," tag = OL;"," }",""," if (!li.test(LI)) {"," li = li.ancestor(LI);"," }"," if (sTab) {"," if (li.ancestor(LI)) {"," li.ancestor(LI).insert(li, 'after');"," moved = true;"," focusEnd = true;"," }"," } else {"," //li.setStyle('border', '1px solid red');"," if (li.previous(LI)) {"," newList = inst.Node.create('<' + tag + '></' + tag + '>');"," li.previous(LI).append(newList);"," newList.append(li);"," moved = true;"," }"," }"," }"," if (moved) {"," if (!li.test(LI)) {"," li = li.ancestor(LI);"," }"," li.all(EditorLists.REMOVE).remove();"," if (Y.UA.ie) {"," li = li.append(EditorLists.NON).one(EditorLists.NON_SEL);"," }"," //Selection here.."," (new inst.EditorSelection()).selectNode(li, true, focusEnd);"," }"," }"," },"," initializer: function() {"," this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * The non element placeholder, used for positioning the cursor and filling empty items"," * @property REMOVE"," * @static"," */"," NON: '<span class=\"yui-non\"> </span>',"," /**"," * The selector query to get all non elements"," * @property NONSEL"," * @static"," */"," NON_SEL: 'span.yui-non',"," /**"," * The items to removed from a list when a list item is moved, currently removes BR nodes"," * @property REMOVE"," * @static"," */"," REMOVE: 'br',"," /**"," * editorLists"," * @property NAME"," * @static"," */"," NAME: 'editorLists',"," /**"," * lists"," * @property NS"," * @static"," */"," NS: 'lists',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorLists = EditorLists;","","","","}, '3.7.3', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/editor-lists/editor-lists.js"].lines = {"1":0,"15":0,"16":0,"19":0,"27":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"39":0,"40":0,"43":0,"44":0,"46":0,"47":0,"48":0,"49":0,"50":0,"54":0,"55":0,"56":0,"57":0,"58":0,"62":0,"63":0,"64":0,"66":0,"67":0,"68":0,"71":0,"76":0,"116":0,"118":0};+_yuitest_coverage["build/editor-lists/editor-lists.js"].functions = {"EditorLists:15":0,"_onNodeChange:26":0,"initializer:75":0,"(anonymous 1):1":0}; _yuitest_coverage["build/editor-lists/editor-lists.js"].coveredLines = 37; _yuitest_coverage["build/editor-lists/editor-lists.js"].coveredFunctions = 4; _yuitest_coverline("build/editor-lists/editor-lists.js", 1);@@ -42,23 +42,25 @@ /**- * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support. Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist">insertorderedlist</a> and <a href="Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist">insertunorderedlist</a> execCommands.+ * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support.+ * Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist">insertorderedlist</a>+ * and <a href="Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist">insertunorderedlist</a> execCommands. * @class Plugin.EditorLists * @constructor * @extends Base * @module editor * @submodule editor-lists */- + _yuitest_coverfunc("build/editor-lists/editor-lists.js", "(anonymous 1)", 1);-_yuitest_coverline("build/editor-lists/editor-lists.js", 13);+_yuitest_coverline("build/editor-lists/editor-lists.js", 15); var EditorLists = function() {- _yuitest_coverfunc("build/editor-lists/editor-lists.js", "EditorLists", 13);-_yuitest_coverline("build/editor-lists/editor-lists.js", 14);+ _yuitest_coverfunc("build/editor-lists/editor-lists.js", "EditorLists", 15);+_yuitest_coverline("build/editor-lists/editor-lists.js", 16); EditorLists.superclass.constructor.apply(this, arguments); }, LI = 'li', OL = 'ol', UL = 'ul', HOST = 'host'; - _yuitest_coverline("build/editor-lists/editor-lists.js", 17);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 19); Y.extend(EditorLists, Y.Base, { /** * Listener for host's nodeChange event and captures the tabkey interaction only when inside a list node.@@ -67,88 +69,88 @@ * @param {Event} e The Event facade passed from the host. */ _onNodeChange: function(e) {- _yuitest_coverfunc("build/editor-lists/editor-lists.js", "_onNodeChange", 24);-_yuitest_coverline("build/editor-lists/editor-lists.js", 25);-var inst = this.get(HOST).getInstance(), sel, li, - newLi, newList, sTab, par, moved = false, tag, focusEnd = false;+ _yuitest_coverfunc("build/editor-lists/editor-lists.js", "_onNodeChange", 26);+_yuitest_coverline("build/editor-lists/editor-lists.js", 27);+var inst = this.get(HOST).getInstance(), li,+ newList, sTab, par, moved = false, tag, focusEnd = false; - _yuitest_coverline("build/editor-lists/editor-lists.js", 28);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 30); if (e.changedType === 'tab') {- _yuitest_coverline("build/editor-lists/editor-lists.js", 29);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 31); if (e.changedNode.test(LI + ', ' + LI + ' *')) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 30);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 32); e.changedEvent.halt();- _yuitest_coverline("build/editor-lists/editor-lists.js", 31);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 33); e.preventDefault();- _yuitest_coverline("build/editor-lists/editor-lists.js", 32);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 34); li = e.changedNode;- _yuitest_coverline("build/editor-lists/editor-lists.js", 33);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 35); sTab = e.changedEvent.shiftKey;- _yuitest_coverline("build/editor-lists/editor-lists.js", 34);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 36); par = li.ancestor(OL + ',' + UL);- _yuitest_coverline("build/editor-lists/editor-lists.js", 35);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 37); tag = UL; - _yuitest_coverline("build/editor-lists/editor-lists.js", 37);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 39); if (par.get('tagName').toLowerCase() === OL) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 38);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 40); tag = OL; }- - _yuitest_coverline("build/editor-lists/editor-lists.js", 41);++ _yuitest_coverline("build/editor-lists/editor-lists.js", 43); if (!li.test(LI)) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 42);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 44); li = li.ancestor(LI); }- _yuitest_coverline("build/editor-lists/editor-lists.js", 44);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 46); if (sTab) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 45);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 47); if (li.ancestor(LI)) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 46);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 48); li.ancestor(LI).insert(li, 'after');- _yuitest_coverline("build/editor-lists/editor-lists.js", 47);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 49); moved = true;- _yuitest_coverline("build/editor-lists/editor-lists.js", 48);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 50); focusEnd = true; } } else { //li.setStyle('border', '1px solid red');- _yuitest_coverline("build/editor-lists/editor-lists.js", 52);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 54); if (li.previous(LI)) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 53);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 55); newList = inst.Node.create('<' + tag + '></' + tag + '>');- _yuitest_coverline("build/editor-lists/editor-lists.js", 54);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 56); li.previous(LI).append(newList);- _yuitest_coverline("build/editor-lists/editor-lists.js", 55);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 57); newList.append(li);- _yuitest_coverline("build/editor-lists/editor-lists.js", 56);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 58); moved = true; } } }- _yuitest_coverline("build/editor-lists/editor-lists.js", 60);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 62); if (moved) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 61);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 63); if (!li.test(LI)) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 62);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 64); li = li.ancestor(LI); }- _yuitest_coverline("build/editor-lists/editor-lists.js", 64);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 66); li.all(EditorLists.REMOVE).remove();- _yuitest_coverline("build/editor-lists/editor-lists.js", 65);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 67); if (Y.UA.ie) {- _yuitest_coverline("build/editor-lists/editor-lists.js", 66);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 68); li = li.append(EditorLists.NON).one(EditorLists.NON_SEL); } //Selection here..- _yuitest_coverline("build/editor-lists/editor-lists.js", 69);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 71); (new inst.EditorSelection()).selectNode(li, true, focusEnd); } } }, initializer: function() {- _yuitest_coverfunc("build/editor-lists/editor-lists.js", "initializer", 73);-_yuitest_coverline("build/editor-lists/editor-lists.js", 74);+ _yuitest_coverfunc("build/editor-lists/editor-lists.js", "initializer", 75);+_yuitest_coverline("build/editor-lists/editor-lists.js", 76); this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this)); } }, {@@ -189,12 +191,12 @@ } }); - _yuitest_coverline("build/editor-lists/editor-lists.js", 114);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 116); Y.namespace('Plugin'); - _yuitest_coverline("build/editor-lists/editor-lists.js", 116);+ _yuitest_coverline("build/editor-lists/editor-lists.js", 118); Y.Plugin.EditorLists = EditorLists; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-lists/editor-lists-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,14 +8,16 @@ /**- * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support. Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist">insertorderedlist</a> and <a href="Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist">insertunorderedlist</a> execCommands.+ * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support.+ * Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist">insertorderedlist</a>+ * and <a href="Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist">insertunorderedlist</a> execCommands. * @class Plugin.EditorLists * @constructor * @extends Base * @module editor * @submodule editor-lists */- + var EditorLists = function() { EditorLists.superclass.constructor.apply(this, arguments); }, LI = 'li', OL = 'ol', UL = 'ul', HOST = 'host';@@ -28,8 +30,8 @@ * @param {Event} e The Event facade passed from the host. */ _onNodeChange: function(e) {- var inst = this.get(HOST).getInstance(), sel, li, - newLi, newList, sTab, par, moved = false, tag, focusEnd = false;+ var inst = this.get(HOST).getInstance(), li,+ newList, sTab, par, moved = false, tag, focusEnd = false; if (e.changedType === 'tab') { if (e.changedNode.test(LI + ', ' + LI + ' *')) {@@ -45,7 +47,7 @@ tag = OL; } Y.log('ShiftKey: ' + sTab, 'info', 'editorLists');- + if (!li.test(LI)) { li = li.ancestor(LI); }@@ -128,4 +130,4 @@ -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-lists/editor-lists-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-lists",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="li",i="ol",s="ul",o="host";e.extend(n,e.Base,{_onNodeChange:function(t){var u=this.get(o).getInstance(),a,f,l,c,h,p,d=!1,v,m=!1;t.changedType==="tab"&&(t.changedNode.test(r+", "+r+" *")&&(t.changedEvent.halt(),t.preventDefault(),f=t.changedNode,h=t.changedEvent.shiftKey,p=f.ancestor(i+","+s),v=s,p.get("tagName").toLowerCase()===i&&(v=i),f.test(r)||(f=f.ancestor(r)),h?f.ancestor(r)&&(f.ancestor(r).insert(f,"after"),d=!0,m=!0):f.previous(r)&&(c=u.Node.create("<"+v+"></"+v+">"),f.previous(r).append(c),c.append(f),d=!0)),d&&(f.test(r)||(f=f.ancestor(r)),f.all(n.REMOVE).remove(),e.UA.ie&&(f=f.append(n.NON).one(n.NON_SEL)),(new u.EditorSelection).selectNode(f,!0,m)))},initializer:function(){this.get(o).on("nodeChange",e.bind(this._onNodeChange,this))}},{NON:'<span class="yui-non"> </span>',NON_SEL:"span.yui-non",REMOVE:"br",NAME:"editorLists",NS:"lists",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorLists=n},"3.7.2",{requires:["editor-base"]});+YUI.add("editor-lists",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="li",i="ol",s="ul",o="host";e.extend(n,e.Base,{_onNodeChange:function(t){var u=this.get(o).getInstance(),a,f,l,c,h=!1,p,d=!1;t.changedType==="tab"&&(t.changedNode.test(r+", "+r+" *")&&(t.changedEvent.halt(),t.preventDefault(),a=t.changedNode,l=t.changedEvent.shiftKey,c=a.ancestor(i+","+s),p=s,c.get("tagName").toLowerCase()===i&&(p=i),a.test(r)||(a=a.ancestor(r)),l?a.ancestor(r)&&(a.ancestor(r).insert(a,"after"),h=!0,d=!0):a.previous(r)&&(f=u.Node.create("<"+p+"></"+p+">"),a.previous(r).append(f),f.append(a),h=!0)),h&&(a.test(r)||(a=a.ancestor(r)),a.all(n.REMOVE).remove(),e.UA.ie&&(a=a.append(n.NON).one(n.NON_SEL)),(new u.EditorSelection).selectNode(a,!0,d)))},initializer:function(){this.get(o).on("nodeChange",e.bind(this._onNodeChange,this))}},{NON:'<span class="yui-non"> </span>',NON_SEL:"span.yui-non",REMOVE:"br",NAME:"editorLists",NS:"lists",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorLists=n},"3.7.3",{requires:["editor-base"]});
bundle/editor-lists/editor-lists.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,14 +8,16 @@ /**- * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support. Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist">insertorderedlist</a> and <a href="Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist">insertunorderedlist</a> execCommands.+ * Handles list manipulation inside the Editor. Adds keyboard manipulation and execCommand support.+ * Adds overrides for the <a href="Plugin.ExecCommand.html#method_COMMANDS.insertorderedlist">insertorderedlist</a>+ * and <a href="Plugin.ExecCommand.html#method_COMMANDS.insertunorderedlist">insertunorderedlist</a> execCommands. * @class Plugin.EditorLists * @constructor * @extends Base * @module editor * @submodule editor-lists */- + var EditorLists = function() { EditorLists.superclass.constructor.apply(this, arguments); }, LI = 'li', OL = 'ol', UL = 'ul', HOST = 'host';@@ -28,8 +30,8 @@ * @param {Event} e The Event facade passed from the host. */ _onNodeChange: function(e) {- var inst = this.get(HOST).getInstance(), sel, li, - newLi, newList, sTab, par, moved = false, tag, focusEnd = false;+ var inst = this.get(HOST).getInstance(), li,+ newList, sTab, par, moved = false, tag, focusEnd = false; if (e.changedType === 'tab') { if (e.changedNode.test(LI + ', ' + LI + ' *')) {@@ -43,7 +45,7 @@ if (par.get('tagName').toLowerCase() === OL) { tag = OL; }- + if (!li.test(LI)) { li = li.ancestor(LI); }@@ -123,4 +125,4 @@ -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-para-base/editor-para-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/editor-para-base/editor-para-base.js", code: [] };-_yuitest_coverage["build/editor-para-base/editor-para-base.js"].code=["YUI.add('editor-para-base', function (Y, NAME) {","",""," /**"," * Base Plugin for Editor to paragraph auto wrapping and correction."," * @class Plugin.EditorParaBase"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-para-base"," */","",""," var EditorParaBase = function() {"," EditorParaBase.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',"," FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';","",""," Y.extend(EditorParaBase, Y.Base, {"," /**"," * Utility method to create an empty paragraph when the document is empty."," * @private"," * @method _fixFirstPara"," */"," _fixFirstPara: function() {"," var host = this.get(HOST), inst = host.getInstance(), sel, n,"," body = inst.config.doc.body,"," html = body.innerHTML,"," col = ((html.length) ? true : false);",""," if (html === BR) {"," html = '';"," col = false;"," }",""," body.innerHTML = '<' + P + '>' + html + inst.EditorSelection.CURSOR + '</' + P + '>';",""," n = inst.one(FIRST_P);"," sel = new inst.EditorSelection();",""," sel.selectNode(n, true, col);"," },"," /**"," * Performs a block element filter when the Editor is first ready"," * @private"," * @method _afterEditorReady"," */"," _afterEditorReady: function() {"," var host = this.get(HOST), inst = host.getInstance(), btag;"," if (inst) {"," inst.EditorSelection.filterBlocks();"," btag = inst.EditorSelection.DEFAULT_BLOCK_TAG;"," FIRST_P = BODY + ' > ' + btag;"," P = btag;"," }"," },"," /**"," * Performs a block element filter when the Editor after an content change"," * @private"," * @method _afterContentChange"," */"," _afterContentChange: function() {"," var host = this.get(HOST), inst = host.getInstance();"," if (inst && inst.EditorSelection) {"," inst.EditorSelection.filterBlocks();"," }"," },"," /**"," * Performs block/paste filtering after paste."," * @private"," * @method _afterPaste"," */"," _afterPaste: function() {"," var host = this.get(HOST), inst = host.getInstance(),"," sel = new inst.EditorSelection();",""," Y.later(50, host, function() {"," inst.EditorSelection.filterBlocks();"," });"," "," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorBR) {"," Y.error('Can not plug EditorPara and EditorBR at the same time.');"," return;"," }",""," host.after('ready', Y.bind(this._afterEditorReady, this));"," host.after('contentChange', Y.bind(this._afterContentChange, this));"," if (Y.Env.webkit) {"," host.after('dom:paste', Y.bind(this._afterPaste, this));"," }"," }"," }, {"," /**"," * editorPara"," * @static"," * @property NAME"," */"," NAME: 'editorParaBase',"," /**"," * editorPara"," * @static"," * @property NS"," */"," NS: 'editorParaBase',"," ATTRS: {"," host: {"," value: false"," }"," }"," });"," "," Y.namespace('Plugin');"," "," Y.Plugin.EditorParaBase = EditorParaBase;","","","","","}, '3.7.2', {\"requires\": [\"editor-base\"]});"];-_yuitest_coverage["build/editor-para-base/editor-para-base.js"].lines = {"1":0,"14":0,"15":0,"20":0,"27":0,"32":0,"33":0,"34":0,"37":0,"39":0,"40":0,"42":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"64":0,"65":0,"66":0,"75":0,"78":0,"79":0,"84":0,"85":0,"86":0,"87":0,"90":0,"91":0,"92":0,"93":0,"116":0,"118":0};-_yuitest_coverage["build/editor-para-base/editor-para-base.js"].functions = {"EditorParaBase:14":0,"_fixFirstPara:26":0,"_afterEditorReady:49":0,"_afterContentChange:63":0,"(anonymous 2):78":0,"_afterPaste:74":0,"initializer:83":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-para-base/editor-para-base.js"].code=["YUI.add('editor-para-base', function (Y, NAME) {","",""," /**"," * Base Plugin for Editor to paragraph auto wrapping and correction."," * @class Plugin.EditorParaBase"," * @extends Base"," * @constructor"," * @module editor"," * @submodule editor-para-base"," */","",""," var EditorParaBase = function() {"," EditorParaBase.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', BODY = 'body',"," FIRST_P = BODY + ' > p', P = 'p', BR = '<br>';","",""," Y.extend(EditorParaBase, Y.Base, {"," /**"," * Utility method to create an empty paragraph when the document is empty."," * @private"," * @method _fixFirstPara"," */"," _fixFirstPara: function() {"," var host = this.get(HOST), inst = host.getInstance(), sel, n,"," body = inst.config.doc.body,"," html = body.innerHTML,"," col = ((html.length) ? true : false);",""," if (html === BR) {"," html = '';"," col = false;"," }",""," body.innerHTML = '<' + P + '>' + html + inst.EditorSelection.CURSOR + '</' + P + '>';",""," n = inst.one(FIRST_P);"," sel = new inst.EditorSelection();",""," sel.selectNode(n, true, col);"," },"," /**"," * Performs a block element filter when the Editor is first ready"," * @private"," * @method _afterEditorReady"," */"," _afterEditorReady: function() {"," var host = this.get(HOST), inst = host.getInstance(), btag;"," if (inst) {"," inst.EditorSelection.filterBlocks();"," btag = inst.EditorSelection.DEFAULT_BLOCK_TAG;"," FIRST_P = BODY + ' > ' + btag;"," P = btag;"," }"," },"," /**"," * Performs a block element filter when the Editor after an content change"," * @private"," * @method _afterContentChange"," */"," _afterContentChange: function() {"," var host = this.get(HOST), inst = host.getInstance();"," if (inst && inst.EditorSelection) {"," inst.EditorSelection.filterBlocks();"," }"," },"," /**"," * Performs block/paste filtering after paste."," * @private"," * @method _afterPaste"," */"," _afterPaste: function() {"," var host = this.get(HOST), inst = host.getInstance();",""," Y.later(50, host, function() {"," inst.EditorSelection.filterBlocks();"," });",""," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorBR) {"," Y.error('Can not plug EditorPara and EditorBR at the same time.');"," return;"," }",""," host.after('ready', Y.bind(this._afterEditorReady, this));"," host.after('contentChange', Y.bind(this._afterContentChange, this));"," if (Y.Env.webkit) {"," host.after('dom:paste', Y.bind(this._afterPaste, this));"," }"," }"," }, {"," /**"," * editorPara"," * @static"," * @property NAME"," */"," NAME: 'editorParaBase',"," /**"," * editorPara"," * @static"," * @property NS"," */"," NS: 'editorParaBase',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorParaBase = EditorParaBase;","","","","","}, '3.7.3', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/editor-para-base/editor-para-base.js"].lines = {"1":0,"14":0,"15":0,"20":0,"27":0,"32":0,"33":0,"34":0,"37":0,"39":0,"40":0,"42":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"64":0,"65":0,"66":0,"75":0,"77":0,"78":0,"83":0,"84":0,"85":0,"86":0,"89":0,"90":0,"91":0,"92":0,"115":0,"117":0};+_yuitest_coverage["build/editor-para-base/editor-para-base.js"].functions = {"EditorParaBase:14":0,"_fixFirstPara:26":0,"_afterEditorReady:49":0,"_afterContentChange:63":0,"(anonymous 2):77":0,"_afterPaste:74":0,"initializer:82":0,"(anonymous 1):1":0}; _yuitest_coverage["build/editor-para-base/editor-para-base.js"].coveredLines = 34; _yuitest_coverage["build/editor-para-base/editor-para-base.js"].coveredFunctions = 8; _yuitest_coverline("build/editor-para-base/editor-para-base.js", 1);@@ -57,8 +57,8 @@ _yuitest_coverfunc("build/editor-para-base/editor-para-base.js", "EditorParaBase", 14); _yuitest_coverline("build/editor-para-base/editor-para-base.js", 15); EditorParaBase.superclass.constructor.apply(this, arguments);- }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',- FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';+ }, HOST = 'host', BODY = 'body',+ FIRST_P = BODY + ' > p', P = 'p', BR = '<br>'; _yuitest_coverline("build/editor-para-base/editor-para-base.js", 20);@@ -139,36 +139,35 @@ _afterPaste: function() { _yuitest_coverfunc("build/editor-para-base/editor-para-base.js", "_afterPaste", 74); _yuitest_coverline("build/editor-para-base/editor-para-base.js", 75);-var host = this.get(HOST), inst = host.getInstance(),- sel = new inst.EditorSelection();+var host = this.get(HOST), inst = host.getInstance(); - _yuitest_coverline("build/editor-para-base/editor-para-base.js", 78);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 77); Y.later(50, host, function() {- _yuitest_coverfunc("build/editor-para-base/editor-para-base.js", "(anonymous 2)", 78);-_yuitest_coverline("build/editor-para-base/editor-para-base.js", 79);+ _yuitest_coverfunc("build/editor-para-base/editor-para-base.js", "(anonymous 2)", 77);+_yuitest_coverline("build/editor-para-base/editor-para-base.js", 78); inst.EditorSelection.filterBlocks(); });- + }, initializer: function() {- _yuitest_coverfunc("build/editor-para-base/editor-para-base.js", "initializer", 83);-_yuitest_coverline("build/editor-para-base/editor-para-base.js", 84);+ _yuitest_coverfunc("build/editor-para-base/editor-para-base.js", "initializer", 82);+_yuitest_coverline("build/editor-para-base/editor-para-base.js", 83); var host = this.get(HOST);- _yuitest_coverline("build/editor-para-base/editor-para-base.js", 85);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 84); if (host.editorBR) {- _yuitest_coverline("build/editor-para-base/editor-para-base.js", 86);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 85); Y.error('Can not plug EditorPara and EditorBR at the same time.');- _yuitest_coverline("build/editor-para-base/editor-para-base.js", 87);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 86); return; } - _yuitest_coverline("build/editor-para-base/editor-para-base.js", 90);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 89); host.after('ready', Y.bind(this._afterEditorReady, this));- _yuitest_coverline("build/editor-para-base/editor-para-base.js", 91);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 90); host.after('contentChange', Y.bind(this._afterContentChange, this));- _yuitest_coverline("build/editor-para-base/editor-para-base.js", 92);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 91); if (Y.Env.webkit) {- _yuitest_coverline("build/editor-para-base/editor-para-base.js", 93);+ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 92); host.after('dom:paste', Y.bind(this._afterPaste, this)); } }@@ -191,14 +190,14 @@ } } });- - _yuitest_coverline("build/editor-para-base/editor-para-base.js", 116);++ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 115); Y.namespace('Plugin');- - _yuitest_coverline("build/editor-para-base/editor-para-base.js", 118);++ _yuitest_coverline("build/editor-para-base/editor-para-base.js", 117); Y.Plugin.EditorParaBase = EditorParaBase; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-para-base/editor-para-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,8 +19,8 @@ var EditorParaBase = function() { EditorParaBase.superclass.constructor.apply(this, arguments);- }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',- FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';+ }, HOST = 'host', BODY = 'body',+ FIRST_P = BODY + ' > p', P = 'p', BR = '<br>'; Y.extend(EditorParaBase, Y.Base, {@@ -79,13 +79,12 @@ * @method _afterPaste */ _afterPaste: function() {- var host = this.get(HOST), inst = host.getInstance(),- sel = new inst.EditorSelection();+ var host = this.get(HOST), inst = host.getInstance(); Y.later(50, host, function() { inst.EditorSelection.filterBlocks(); });- + }, initializer: function() { var host = this.get(HOST);@@ -119,12 +118,12 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorParaBase = EditorParaBase; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-para-base/editor-para-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-para-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s="nodeChange",o="parentNode",u=i+" > p",a="p",f="<br>",l="firstChild",c="li";e.extend(n,e.Base,{_fixFirstPara:function(){var e=this.get(r),t=e.getInstance(),n,i,s=t.config.doc.body,o=s.innerHTML,l=o.length?!0:!1;o===f&&(o="",l=!1),s.innerHTML="<"+a+">"+o+t.EditorSelection.CURSOR+"</"+a+">",i=t.one(u),n=new t.EditorSelection,n.selectNode(i,!0,l)},_afterEditorReady:function(){var e=this.get(r),t=e.getInstance(),n;t&&(t.EditorSelection.filterBlocks(),n=t.EditorSelection.DEFAULT_BLOCK_TAG,u=i+" > "+n,a=n)},_afterContentChange:function(){var e=this.get(r),t=e.getInstance();t&&t.EditorSelection&&t.EditorSelection.filterBlocks()},_afterPaste:function(){var t=this.get(r),n=t.getInstance(),i=new n.EditorSelection;e.later(50,t,function(){n.EditorSelection.filterBlocks()})},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.after("ready",e.bind(this._afterEditorReady,this)),t.after("contentChange",e.bind(this._afterContentChange,this)),e.Env.webkit&&t.after("dom:paste",e.bind(this._afterPaste,this))}},{NAME:"editorParaBase",NS:"editorParaBase",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorParaBase=n},"3.7.2",{requires:["editor-base"]});+YUI.add("editor-para-base",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s=i+" > p",o="p",u="<br>";e.extend(n,e.Base,{_fixFirstPara:function(){var e=this.get(r),t=e.getInstance(),n,i,a=t.config.doc.body,f=a.innerHTML,l=f.length?!0:!1;f===u&&(f="",l=!1),a.innerHTML="<"+o+">"+f+t.EditorSelection.CURSOR+"</"+o+">",i=t.one(s),n=new t.EditorSelection,n.selectNode(i,!0,l)},_afterEditorReady:function(){var e=this.get(r),t=e.getInstance(),n;t&&(t.EditorSelection.filterBlocks(),n=t.EditorSelection.DEFAULT_BLOCK_TAG,s=i+" > "+n,o=n)},_afterContentChange:function(){var e=this.get(r),t=e.getInstance();t&&t.EditorSelection&&t.EditorSelection.filterBlocks()},_afterPaste:function(){var t=this.get(r),n=t.getInstance();e.later(50,t,function(){n.EditorSelection.filterBlocks()})},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.after("ready",e.bind(this._afterEditorReady,this)),t.after("contentChange",e.bind(this._afterContentChange,this)),e.Env.webkit&&t.after("dom:paste",e.bind(this._afterPaste,this))}},{NAME:"editorParaBase",NS:"editorParaBase",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorParaBase=n},"3.7.3",{requires:["editor-base"]});
bundle/editor-para-base/editor-para-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,8 +19,8 @@ var EditorParaBase = function() { EditorParaBase.superclass.constructor.apply(this, arguments);- }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',- FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';+ }, HOST = 'host', BODY = 'body',+ FIRST_P = BODY + ' > p', P = 'p', BR = '<br>'; Y.extend(EditorParaBase, Y.Base, {@@ -78,13 +78,12 @@ * @method _afterPaste */ _afterPaste: function() {- var host = this.get(HOST), inst = host.getInstance(),- sel = new inst.EditorSelection();+ var host = this.get(HOST), inst = host.getInstance(); Y.later(50, host, function() { inst.EditorSelection.filterBlocks(); });- + }, initializer: function() { var host = this.get(HOST);@@ -118,12 +117,12 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorParaBase = EditorParaBase; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-para-ie/editor-para-ie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/editor-para-ie/editor-para-ie.js", code: [] };-_yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].code=["YUI.add('editor-para-ie', function (Y, NAME) {","",""," /**"," * Extends EditorParaBase with IE support"," * @class Plugin.EditorParaIE"," * @extends Plugin.EditorParaBase"," * @constructor"," * @module editor"," * @submodule editor-para-ie"," */","",""," var EditorParaIE = function() {"," EditorParaIE.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',"," FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';","",""," Y.extend(EditorParaIE, Y.Plugin.EditorParaBase, {"," /**"," * nodeChange handler to handle fixing an empty document."," * @private"," * @method _onNodeChange"," */"," _onNodeChange: function(e) {"," var host = this.get(HOST), inst = host.getInstance(),"," html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,"," inHTML, txt2, childs, aNode, index, node2, top, n, sib,"," ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';",""," switch (e.changedType) {"," case 'enter-up':"," var para = ((this._lastPara) ? this._lastPara : e.changedNode),"," b = para.one('br.yui-cursor');",""," if (this._lastPara) {"," delete this._lastPara;"," }",""," if (b) {"," if (b.previous() || b.next()) {"," if (b.ancestor(P)) {"," b.remove();"," }"," }"," }"," if (!para.test(btag)) {"," var para2 = para.ancestor(btag);"," if (para2) {"," para = para2;"," para2 = null;"," }"," }"," if (para.test(btag)) {"," var prev = para.previous(), lc, lc2, found = false;"," if (prev) {"," lc = prev.one(LAST_CHILD);"," while (!found) {"," if (lc) {"," lc2 = lc.one(LAST_CHILD);"," if (lc2) {"," lc = lc2;"," } else {"," found = true;"," }"," } else {"," found = true;"," }"," }"," if (lc) {"," host.copyStyles(lc, para);"," }"," }"," }"," break;"," case 'enter':"," if (e.changedNode.test('br')) {"," e.changedNode.remove();"," } else if (e.changedNode.test('p, span')) {"," var b = e.changedNode.one('br.yui-cursor');"," if (b) {"," b.remove();"," }"," }"," break;"," }"," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorBR) {"," Y.error('Can not plug EditorPara and EditorBR at the same time.');"," return;"," }",""," host.on(NODE_CHANGE, Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * editorPara"," * @static"," * @property NAME"," */"," NAME: 'editorPara',"," /**"," * editorPara"," * @static"," * @property NS"," */"," NS: 'editorPara',"," ATTRS: {"," host: {"," value: false"," }"," }"," });"," "," Y.namespace('Plugin');"," "," Y.Plugin.EditorPara = EditorParaIE;","","","","","}, '3.7.2', {\"requires\": [\"editor-para-base\"]});"];-_yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].lines = {"1":0,"14":0,"15":0,"20":0,"27":0,"32":0,"34":0,"37":0,"38":0,"41":0,"42":0,"43":0,"44":0,"48":0,"49":0,"50":0,"51":0,"52":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"65":0,"68":0,"71":0,"72":0,"76":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"86":0,"90":0,"91":0,"92":0,"93":0,"96":0,"118":0,"120":0};+_yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].code=["YUI.add('editor-para-ie', function (Y, NAME) {","",""," /**"," * Extends EditorParaBase with IE support"," * @class Plugin.EditorParaIE"," * @extends Plugin.EditorParaBase"," * @constructor"," * @module editor"," * @submodule editor-para-ie"," */","",""," var EditorParaIE = function() {"," EditorParaIE.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', NODE_CHANGE = 'nodeChange',"," P = 'p';","",""," Y.extend(EditorParaIE, Y.Plugin.EditorParaBase, {"," /**"," * nodeChange handler to handle fixing an empty document."," * @private"," * @method _onNodeChange"," */"," _onNodeChange: function(e) {"," var host = this.get(HOST), inst = host.getInstance(),"," btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,"," prev, LAST_CHILD = ':last-child', para, b, para2,"," lc, lc2, found = false;",""," switch (e.changedType) {"," case 'enter-up':"," para = ((this._lastPara) ? this._lastPara : e.changedNode);"," b = para.one('br.yui-cursor');",""," if (this._lastPara) {"," delete this._lastPara;"," }",""," if (b) {"," if (b.previous() || b.next()) {"," if (b.ancestor(P)) {"," b.remove();"," }"," }"," }"," if (!para.test(btag)) {"," para2 = para.ancestor(btag);"," if (para2) {"," para = para2;"," para2 = null;"," }"," }"," if (para.test(btag)) {"," prev = para.previous();"," if (prev) {"," lc = prev.one(LAST_CHILD);"," while (!found) {"," if (lc) {"," lc2 = lc.one(LAST_CHILD);"," if (lc2) {"," lc = lc2;"," } else {"," found = true;"," }"," } else {"," found = true;"," }"," }"," if (lc) {"," host.copyStyles(lc, para);"," }"," }"," }"," break;"," case 'enter':"," if (e.changedNode.test('br')) {"," e.changedNode.remove();"," } else if (e.changedNode.test('p, span')) {"," b = e.changedNode.one('br.yui-cursor');"," if (b) {"," b.remove();"," }"," }"," break;"," }"," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorBR) {"," Y.error('Can not plug EditorPara and EditorBR at the same time.');"," return;"," }",""," host.on(NODE_CHANGE, Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * editorPara"," * @static"," * @property NAME"," */"," NAME: 'editorPara',"," /**"," * editorPara"," * @static"," * @property NS"," */"," NS: 'editorPara',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorPara = EditorParaIE;","","","","","}, '3.7.3', {\"requires\": [\"editor-para-base\"]});"];+_yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].lines = {"1":0,"14":0,"15":0,"20":0,"27":0,"32":0,"34":0,"35":0,"37":0,"38":0,"41":0,"42":0,"43":0,"44":0,"48":0,"49":0,"50":0,"51":0,"52":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"65":0,"68":0,"71":0,"72":0,"76":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"86":0,"90":0,"91":0,"92":0,"93":0,"96":0,"118":0,"120":0}; _yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].functions = {"EditorParaIE:14":0,"_onNodeChange:26":0,"initializer:89":0,"(anonymous 1):1":0};-_yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].coveredLines = 46;+_yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].coveredLines = 47; _yuitest_coverage["build/editor-para-ie/editor-para-ie.js"].coveredFunctions = 4; _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 1); YUI.add('editor-para-ie', function (Y, NAME) {@@ -57,8 +57,8 @@ _yuitest_coverfunc("build/editor-para-ie/editor-para-ie.js", "EditorParaIE", 14); _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 15); EditorParaIE.superclass.constructor.apply(this, arguments);- }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',- FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';+ }, HOST = 'host', NODE_CHANGE = 'nodeChange',+ P = 'p'; _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 20);@@ -72,16 +72,17 @@ _yuitest_coverfunc("build/editor-para-ie/editor-para-ie.js", "_onNodeChange", 26); _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 27); var host = this.get(HOST), inst = host.getInstance(),- html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,- inHTML, txt2, childs, aNode, index, node2, top, n, sib,- ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';+ btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,+ prev, LAST_CHILD = ':last-child', para, b, para2,+ lc, lc2, found = false; _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 32); switch (e.changedType) { case 'enter-up': _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 34);-var para = ((this._lastPara) ? this._lastPara : e.changedNode),- b = para.one('br.yui-cursor');+para = ((this._lastPara) ? this._lastPara : e.changedNode);+ _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 35);+b = para.one('br.yui-cursor'); _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 37); if (this._lastPara) {@@ -103,7 +104,7 @@ _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 48); if (!para.test(btag)) { _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 49);-var para2 = para.ancestor(btag);+para2 = para.ancestor(btag); _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 50); if (para2) { _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 51);@@ -115,7 +116,7 @@ _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 55); if (para.test(btag)) { _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 56);-var prev = para.previous(), lc, lc2, found = false;+prev = para.previous(); _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 57); if (prev) { _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 58);@@ -156,7 +157,7 @@ } else {_yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 80); if (e.changedNode.test('p, span')) { _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 81);-var b = e.changedNode.one('br.yui-cursor');+b = e.changedNode.one('br.yui-cursor'); _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 82); if (b) { _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 83);@@ -201,14 +202,14 @@ } } });- + _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 118); Y.namespace('Plugin');- + _yuitest_coverline("build/editor-para-ie/editor-para-ie.js", 120); Y.Plugin.EditorPara = EditorParaIE; -}, '3.7.2', {"requires": ["editor-para-base"]});+}, '3.7.3', {"requires": ["editor-para-base"]});
bundle/editor-para-ie/editor-para-ie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,8 +19,8 @@ var EditorParaIE = function() { EditorParaIE.superclass.constructor.apply(this, arguments);- }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',- FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';+ }, HOST = 'host', NODE_CHANGE = 'nodeChange',+ P = 'p'; Y.extend(EditorParaIE, Y.Plugin.EditorParaBase, {@@ -31,14 +31,14 @@ */ _onNodeChange: function(e) { var host = this.get(HOST), inst = host.getInstance(),- html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,- inHTML, txt2, childs, aNode, index, node2, top, n, sib,- ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';+ btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,+ prev, LAST_CHILD = ':last-child', para, b, para2,+ lc, lc2, found = false; switch (e.changedType) { case 'enter-up':- var para = ((this._lastPara) ? this._lastPara : e.changedNode),- b = para.one('br.yui-cursor');+ para = ((this._lastPara) ? this._lastPara : e.changedNode);+ b = para.one('br.yui-cursor'); if (this._lastPara) { delete this._lastPara;@@ -52,14 +52,14 @@ } } if (!para.test(btag)) {- var para2 = para.ancestor(btag);+ para2 = para.ancestor(btag); if (para2) { para = para2; para2 = null; } } if (para.test(btag)) {- var prev = para.previous(), lc, lc2, found = false;+ prev = para.previous(); if (prev) { lc = prev.one(LAST_CHILD); while (!found) {@@ -84,7 +84,7 @@ if (e.changedNode.test('br')) { e.changedNode.remove(); } else if (e.changedNode.test('p, span')) {- var b = e.changedNode.one('br.yui-cursor');+ b = e.changedNode.one('br.yui-cursor'); if (b) { b.remove(); }@@ -120,12 +120,12 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorPara = EditorParaIE; -}, '3.7.2', {"requires": ["editor-para-base"]});+}, '3.7.3', {"requires": ["editor-para-base"]});
bundle/editor-para-ie/editor-para-ie-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-para-ie",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s="nodeChange",o="parentNode",u=i+" > p",a="p",f="<br>",l="firstChild",c="li";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(e){var t=this.get(r),n=t.getInstance(),i,s,o,u,f,l=n.EditorSelection.DEFAULT_BLOCK_TAG,c,h,p,d,v,m,g,y,b,w,E,S,x,T,N,C=":last-child";switch(e.changedType){case"enter-up":var k=this._lastPara?this._lastPara:e.changedNode,L=k.one("br.yui-cursor");this._lastPara&&delete this._lastPara,L&&(L.previous()||L.next())&&L.ancestor(a)&&L.remove();if(!k.test(l)){var A=k.ancestor(l);A&&(k=A,A=null)}if(k.test(l)){var O=k.previous(),M,_,D=!1;if(O){M=O.one(C);while(!D)M?(_=M.one(C),_?M=_:D=!0):D=!0;M&&t.copyStyles(M,k)}}break;case"enter":if(e.changedNode.test("br"))e.changedNode.remove();else if(e.changedNode.test("p, span")){var L=e.changedNode.one("br.yui-cursor");L&&L.remove()}}},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(s,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.7.2",{requires:["editor-para-base"]});+YUI.add("editor-para-ie",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="nodeChange",s="p";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(e){var t=this.get(r),n=t.getInstance(),i=n.EditorSelection.DEFAULT_BLOCK_TAG,o,u=":last-child",a,f,l,c,h,p=!1;switch(e.changedType){case"enter-up":a=this._lastPara?this._lastPara:e.changedNode,f=a.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,f&&(f.previous()||f.next())&&f.ancestor(s)&&f.remove(),a.test(i)||(l=a.ancestor(i),l&&(a=l,l=null));if(a.test(i)){o=a.previous();if(o){c=o.one(u);while(!p)c?(h=c.one(u),h?c=h:p=!0):p=!0;c&&t.copyStyles(c,a)}}break;case"enter":e.changedNode.test("br")?e.changedNode.remove():e.changedNode.test("p, span")&&(f=e.changedNode.one("br.yui-cursor"),f&&f.remove())}},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(i,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.7.3",{requires:["editor-para-base"]});
bundle/editor-para-ie/editor-para-ie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,8 +19,8 @@ var EditorParaIE = function() { EditorParaIE.superclass.constructor.apply(this, arguments);- }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',- FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';+ }, HOST = 'host', NODE_CHANGE = 'nodeChange',+ P = 'p'; Y.extend(EditorParaIE, Y.Plugin.EditorParaBase, {@@ -31,14 +31,14 @@ */ _onNodeChange: function(e) { var host = this.get(HOST), inst = host.getInstance(),- html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,- inHTML, txt2, childs, aNode, index, node2, top, n, sib,- ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';+ btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,+ prev, LAST_CHILD = ':last-child', para, b, para2,+ lc, lc2, found = false; switch (e.changedType) { case 'enter-up':- var para = ((this._lastPara) ? this._lastPara : e.changedNode),- b = para.one('br.yui-cursor');+ para = ((this._lastPara) ? this._lastPara : e.changedNode);+ b = para.one('br.yui-cursor'); if (this._lastPara) { delete this._lastPara;@@ -52,14 +52,14 @@ } } if (!para.test(btag)) {- var para2 = para.ancestor(btag);+ para2 = para.ancestor(btag); if (para2) { para = para2; para2 = null; } } if (para.test(btag)) {- var prev = para.previous(), lc, lc2, found = false;+ prev = para.previous(); if (prev) { lc = prev.one(LAST_CHILD); while (!found) {@@ -84,7 +84,7 @@ if (e.changedNode.test('br')) { e.changedNode.remove(); } else if (e.changedNode.test('p, span')) {- var b = e.changedNode.one('br.yui-cursor');+ b = e.changedNode.one('br.yui-cursor'); if (b) { b.remove(); }@@ -120,12 +120,12 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorPara = EditorParaIE; -}, '3.7.2', {"requires": ["editor-para-base"]});+}, '3.7.3', {"requires": ["editor-para-base"]});
bundle/editor-para/editor-para-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/editor-para/editor-para.js", code: [] };-_yuitest_coverage["build/editor-para/editor-para.js"].code=["YUI.add('editor-para', function (Y, NAME) {","",""," /**"," * Plugin for Editor to paragraph auto wrapping and correction."," * @class Plugin.EditorPara"," * @extends Plugin.EditorParaBase"," * @constructor"," * @module editor"," * @submodule editor-para"," */","",""," var EditorPara = function() {"," EditorPara.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',"," FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';","",""," Y.extend(EditorPara, Y.Plugin.EditorParaBase, {"," /**"," * nodeChange handler to handle fixing an empty document."," * @private"," * @method _onNodeChange"," */"," _onNodeChange: function(e) {"," var host = this.get(HOST), inst = host.getInstance(),"," html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,"," inHTML, txt2, childs, aNode, index, node2, top, n, sib,"," ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';",""," switch (e.changedType) {"," case 'enter-up':"," var para = ((this._lastPara) ? this._lastPara : e.changedNode),"," b = para.one('br.yui-cursor');",""," if (this._lastPara) {"," delete this._lastPara;"," }",""," if (b) {"," if (b.previous() || b.next()) {"," if (b.ancestor(P)) {"," b.remove();"," }"," }"," }"," if (!para.test(btag)) {"," var para2 = para.ancestor(btag);"," if (para2) {"," para = para2;"," para2 = null;"," }"," }"," if (para.test(btag)) {"," var prev = para.previous(), lc, lc2, found = false;"," if (prev) {"," lc = prev.one(LAST_CHILD);"," while (!found) {"," if (lc) {"," lc2 = lc.one(LAST_CHILD);"," if (lc2) {"," lc = lc2;"," } else {"," found = true;"," }"," } else {"," found = true;"," }"," }"," if (lc) {"," host.copyStyles(lc, para);"," }"," }"," }"," break;"," case 'enter':"," if (Y.UA.webkit) {"," //Webkit doesn't support shift+enter as a BR, this fixes that."," if (e.changedEvent.shiftKey) {"," host.execCommand('insertbr');"," e.changedEvent.preventDefault();"," }"," }"," if (e.changedNode.test('li') && !Y.UA.ie) {"," html = inst.EditorSelection.getText(e.changedNode);"," if (html === '') {"," par = e.changedNode.ancestor('ol,ul');"," var dir = par.getAttribute('dir');"," if (dir !== '') {"," dir = ' dir = \"' + dir + '\"';"," }"," par = e.changedNode.ancestor(inst.EditorSelection.BLOCKS);"," d = inst.Node.create('<p' + dir + '>' + inst.EditorSelection.CURSOR + '</p>');"," par.insert(d, 'after');"," e.changedNode.remove();"," e.changedEvent.halt();",""," sel = new inst.EditorSelection();"," sel.selectNode(d, true, false);"," }"," }"," //TODO Move this to a GECKO MODULE - Can't for the moment, requires no change to metadata (YMAIL)"," if (Y.UA.gecko && host.get('defaultblock') !== 'p') {"," par = e.changedNode;",""," if (!par.test(LI) && !par.ancestor(LI)) {"," if (!par.test(btag)) {"," par = par.ancestor(btag);"," }"," d = inst.Node.create('<' + btag + '></' + btag + '>');"," par.insert(d, 'after');"," sel = new inst.EditorSelection();"," if (sel.anchorOffset) {"," inHTML = sel.anchorNode.get('textContent');",""," txt = inst.one(inst.config.doc.createTextNode(inHTML.substr(0, sel.anchorOffset)));"," txt2 = inst.one(inst.config.doc.createTextNode(inHTML.substr(sel.anchorOffset)));",""," aNode = sel.anchorNode;"," aNode.setContent(''); //I"," node2 = aNode.cloneNode(); //I"," node2.append(txt2); //text"," top = false;"," sib = aNode; //I"," while (!top) {"," sib = sib.get(PARENT_NODE); //B"," if (sib && !sib.test(btag)) {"," n = sib.cloneNode();"," n.set('innerHTML', '');"," n.append(node2);"," "," //Get children.."," childs = sib.get('childNodes');"," var start = false;"," childs.each(function(c) {"," if (start) {"," n.append(c);"," }"," if (c === aNode) {"," start = true;"," }"," });",""," aNode = sib; //Top sibling"," node2 = n;"," } else {"," top = true;"," }"," }"," txt2 = node2;"," sel.anchorNode.append(txt);",""," if (txt2) {"," d.append(txt2);"," }"," }"," if (d.get(FC)) {"," d = d.get(FC);"," }"," d.prepend(inst.EditorSelection.CURSOR);"," sel.focusCursor(true, true);"," html = inst.EditorSelection.getText(d);"," if (html !== '') {"," inst.EditorSelection.cleanCursor();"," }"," e.changedEvent.preventDefault();"," }"," }"," break;"," case 'keyup':"," if (Y.UA.gecko) {"," if (inst.config.doc && inst.config.doc.body && inst.config.doc.body.innerHTML.length < 20) {"," if (!inst.one(FIRST_P)) {"," this._fixFirstPara();"," }"," }"," }"," break;"," case 'backspace-up':"," case 'backspace-down':"," case 'delete-up':"," if (!Y.UA.ie) {"," ps = inst.all(FIRST_P);"," item = inst.one(BODY);"," if (ps.item(0)) {"," item = ps.item(0);"," }"," br = item.one('br');"," if (br) {"," br.removeAttribute('id');"," br.removeAttribute('class');"," }",""," txt = inst.EditorSelection.getText(item);"," txt = txt.replace(/ /g, '').replace(/\\n/g, '');"," imgs = item.all('img');"," "," if (txt.length === 0 && !imgs.size()) {"," //God this is horrible.."," if (!item.test(P)) {"," this._fixFirstPara();"," }"," p = null;"," if (e.changedNode && e.changedNode.test(P)) {"," p = e.changedNode;"," }"," if (!p && host._lastPara && host._lastPara.inDoc()) {"," p = host._lastPara;"," }"," if (p && !p.test(P)) {"," p = p.ancestor(P);"," }"," if (p) {"," if (!p.previous() && p.get(PARENT_NODE) && p.get(PARENT_NODE).test(BODY)) {"," e.changedEvent.frameEvent.halt();"," e.preventDefault();"," }"," }"," }"," if (Y.UA.webkit) {"," if (e.changedNode) {"," //All backspace calls in Webkit need a preventDefault to"," //stop history navigation #2531299"," e.preventDefault();"," item = e.changedNode;"," if (item.test('li') && (!item.previous() && !item.next())) {"," html = item.get('innerHTML').replace(BR, '');"," if (html === '') {"," if (item.get(PARENT_NODE)) {"," item.get(PARENT_NODE).replace(inst.Node.create(BR));"," e.changedEvent.frameEvent.halt();"," inst.EditorSelection.filterBlocks();"," }"," }"," }"," }"," }"," }"," if (Y.UA.gecko) {"," /*"," * This forced FF to redraw the content on backspace."," * On some occasions FF will leave a cursor residue after content has been deleted."," * Dropping in the empty textnode and then removing it causes FF to redraw and"," * remove the \"ghost cursors\""," */"," d = e.changedNode;"," t = inst.config.doc.createTextNode(' ');"," d.appendChild(t);"," d.removeChild(t);"," }"," break;"," }"," if (Y.UA.gecko) {"," if (e.changedNode && !e.changedNode.test(btag)) {"," p = e.changedNode.ancestor(btag);"," if (p) {"," this._lastPara = p;"," }"," }"," }"," "," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorBR) {"," Y.error('Can not plug EditorPara and EditorBR at the same time.');"," return;"," }",""," host.on(NODE_CHANGE, Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * editorPara"," * @static"," * @property NAME"," */"," NAME: 'editorPara',"," /**"," * editorPara"," * @static"," * @property NS"," */"," NS: 'editorPara',"," ATTRS: {"," host: {"," value: false"," }"," }"," });"," "," Y.namespace('Plugin');"," "," Y.Plugin.EditorPara = EditorPara;","","","","}, '3.7.2', {\"requires\": [\"editor-para-base\"]});"];-_yuitest_coverage["build/editor-para/editor-para.js"].lines = {"1":0,"14":0,"15":0,"20":0,"27":0,"32":0,"34":0,"37":0,"38":0,"41":0,"42":0,"43":0,"44":0,"48":0,"49":0,"50":0,"51":0,"52":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"65":0,"68":0,"71":0,"72":0,"76":0,"78":0,"80":0,"81":0,"82":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"93":0,"94":0,"95":0,"96":0,"97":0,"99":0,"100":0,"104":0,"105":0,"107":0,"108":0,"109":0,"111":0,"112":0,"113":0,"114":0,"115":0,"117":0,"118":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"134":0,"135":0,"136":0,"137":0,"138":0,"140":0,"141":0,"145":0,"146":0,"148":0,"151":0,"152":0,"154":0,"155":0,"158":0,"159":0,"161":0,"162":0,"163":0,"164":0,"165":0,"167":0,"170":0,"172":0,"173":0,"174":0,"175":0,"179":0,"183":0,"184":0,"185":0,"186":0,"187":0,"189":0,"190":0,"191":0,"192":0,"195":0,"196":0,"197":0,"199":0,"201":0,"202":0,"204":0,"205":0,"206":0,"208":0,"209":0,"211":0,"212":0,"214":0,"215":0,"216":0,"217":0,"221":0,"222":0,"225":0,"226":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"240":0,"247":0,"248":0,"249":0,"250":0,"252":0,"254":0,"255":0,"256":0,"257":0,"258":0,"265":0,"266":0,"267":0,"268":0,"271":0,"293":0,"295":0};-_yuitest_coverage["build/editor-para/editor-para.js"].functions = {"EditorPara:14":0,"(anonymous 2):136":0,"_onNodeChange:26":0,"initializer:264":0,"(anonymous 1):1":0};-_yuitest_coverage["build/editor-para/editor-para.js"].coveredLines = 157;+_yuitest_coverage["build/editor-para/editor-para.js"].code=["YUI.add('editor-para', function (Y, NAME) {","",""," /**"," * Plugin for Editor to paragraph auto wrapping and correction."," * @class Plugin.EditorPara"," * @extends Plugin.EditorParaBase"," * @constructor"," * @module editor"," * @submodule editor-para"," */","",""," var EditorPara = function() {"," EditorPara.superclass.constructor.apply(this, arguments);"," }, HOST = 'host', BODY = 'body', NODE_CHANGE = 'nodeChange', PARENT_NODE = 'parentNode',"," FIRST_P = BODY + ' > p', P = 'p', BR = '<br>', FC = 'firstChild', LI = 'li';","",""," Y.extend(EditorPara, Y.Plugin.EditorParaBase, {"," /**"," * nodeChange handler to handle fixing an empty document."," * @private"," * @method _onNodeChange"," */"," _onNodeChange: function(e) {"," var host = this.get(HOST), inst = host.getInstance(),"," html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,"," inHTML, txt2, childs, aNode, node2, top, n, sib, para2, prev,"," ps, br, item, p, imgs, t, LAST_CHILD = ':last-child', para, b, dir,"," lc, lc2, found = false, start;",""," switch (e.changedType) {"," case 'enter-up':"," para = ((this._lastPara) ? this._lastPara : e.changedNode);"," b = para.one('br.yui-cursor');",""," if (this._lastPara) {"," delete this._lastPara;"," }",""," if (b) {"," if (b.previous() || b.next()) {"," if (b.ancestor(P)) {"," b.remove();"," }"," }"," }"," if (!para.test(btag)) {"," para2 = para.ancestor(btag);"," if (para2) {"," para = para2;"," para2 = null;"," }"," }"," if (para.test(btag)) {"," prev = para.previous();"," if (prev) {"," lc = prev.one(LAST_CHILD);"," while (!found) {"," if (lc) {"," lc2 = lc.one(LAST_CHILD);"," if (lc2) {"," lc = lc2;"," } else {"," found = true;"," }"," } else {"," found = true;"," }"," }"," if (lc) {"," host.copyStyles(lc, para);"," }"," }"," }"," break;"," case 'enter':"," if (Y.UA.webkit) {"," //Webkit doesn't support shift+enter as a BR, this fixes that."," if (e.changedEvent.shiftKey) {"," host.execCommand('insertbr');"," e.changedEvent.preventDefault();"," }"," }"," if (e.changedNode.test('li') && !Y.UA.ie) {"," html = inst.EditorSelection.getText(e.changedNode);"," if (html === '') {"," par = e.changedNode.ancestor('ol,ul');"," dir = par.getAttribute('dir');"," if (dir !== '') {"," dir = ' dir = \"' + dir + '\"';"," }"," par = e.changedNode.ancestor(inst.EditorSelection.BLOCKS);"," d = inst.Node.create('<p' + dir + '>' + inst.EditorSelection.CURSOR + '</p>');"," par.insert(d, 'after');"," e.changedNode.remove();"," e.changedEvent.halt();",""," sel = new inst.EditorSelection();"," sel.selectNode(d, true, false);"," }"," }"," //TODO Move this to a GECKO MODULE - Can't for the moment, requires no change to metadata (YMAIL)"," if (Y.UA.gecko && host.get('defaultblock') !== 'p') {"," par = e.changedNode;",""," if (!par.test(LI) && !par.ancestor(LI)) {"," if (!par.test(btag)) {"," par = par.ancestor(btag);"," }"," d = inst.Node.create('<' + btag + '></' + btag + '>');"," par.insert(d, 'after');"," sel = new inst.EditorSelection();"," if (sel.anchorOffset) {"," inHTML = sel.anchorNode.get('textContent');",""," txt = inst.one(inst.config.doc.createTextNode(inHTML.substr(0, sel.anchorOffset)));"," txt2 = inst.one(inst.config.doc.createTextNode(inHTML.substr(sel.anchorOffset)));",""," aNode = sel.anchorNode;"," aNode.setContent(''); //I"," node2 = aNode.cloneNode(); //I"," node2.append(txt2); //text"," top = false;"," sib = aNode; //I"," while (!top) {"," sib = sib.get(PARENT_NODE); //B"," if (sib && !sib.test(btag)) {"," n = sib.cloneNode();"," n.set('innerHTML', '');"," n.append(node2);",""," //Get children.."," childs = sib.get('childNodes');"," start = false;"," /*jshint loopfunc: true */"," childs.each(function(c) {"," if (start) {"," n.append(c);"," }"," if (c === aNode) {"," start = true;"," }"," });",""," aNode = sib; //Top sibling"," node2 = n;"," } else {"," top = true;"," }"," }"," txt2 = node2;"," sel.anchorNode.append(txt);",""," if (txt2) {"," d.append(txt2);"," }"," }"," if (d.get(FC)) {"," d = d.get(FC);"," }"," d.prepend(inst.EditorSelection.CURSOR);"," sel.focusCursor(true, true);"," html = inst.EditorSelection.getText(d);"," if (html !== '') {"," inst.EditorSelection.cleanCursor();"," }"," e.changedEvent.preventDefault();"," }"," }"," break;"," case 'keyup':"," if (Y.UA.gecko) {"," if (inst.config.doc && inst.config.doc.body && inst.config.doc.body.innerHTML.length < 20) {"," if (!inst.one(FIRST_P)) {"," this._fixFirstPara();"," }"," }"," }"," break;"," case 'backspace-up':"," case 'backspace-down':"," case 'delete-up':"," if (!Y.UA.ie) {"," ps = inst.all(FIRST_P);"," item = inst.one(BODY);"," if (ps.item(0)) {"," item = ps.item(0);"," }"," br = item.one('br');"," if (br) {"," br.removeAttribute('id');"," br.removeAttribute('class');"," }",""," txt = inst.EditorSelection.getText(item);"," txt = txt.replace(/ /g, '').replace(/\\n/g, '');"," imgs = item.all('img');",""," if (txt.length === 0 && !imgs.size()) {"," //God this is horrible.."," if (!item.test(P)) {"," this._fixFirstPara();"," }"," p = null;"," if (e.changedNode && e.changedNode.test(P)) {"," p = e.changedNode;"," }"," if (!p && host._lastPara && host._lastPara.inDoc()) {"," p = host._lastPara;"," }"," if (p && !p.test(P)) {"," p = p.ancestor(P);"," }"," if (p) {"," if (!p.previous() && p.get(PARENT_NODE) && p.get(PARENT_NODE).test(BODY)) {"," e.changedEvent.frameEvent.halt();"," e.preventDefault();"," }"," }"," }"," if (Y.UA.webkit) {"," if (e.changedNode) {"," //All backspace calls in Webkit need a preventDefault to"," //stop history navigation #2531299"," e.preventDefault();"," item = e.changedNode;"," if (item.test('li') && (!item.previous() && !item.next())) {"," html = item.get('innerHTML').replace(BR, '');"," if (html === '') {"," if (item.get(PARENT_NODE)) {"," item.get(PARENT_NODE).replace(inst.Node.create(BR));"," e.changedEvent.frameEvent.halt();"," inst.EditorSelection.filterBlocks();"," }"," }"," }"," }"," }"," }"," if (Y.UA.gecko) {"," /*"," * This forced FF to redraw the content on backspace."," * On some occasions FF will leave a cursor residue after content has been deleted."," * Dropping in the empty textnode and then removing it causes FF to redraw and"," * remove the \"ghost cursors\""," */"," d = e.changedNode;"," t = inst.config.doc.createTextNode(' ');"," d.appendChild(t);"," d.removeChild(t);"," }"," break;"," }"," if (Y.UA.gecko) {"," if (e.changedNode && !e.changedNode.test(btag)) {"," p = e.changedNode.ancestor(btag);"," if (p) {"," this._lastPara = p;"," }"," }"," }",""," },"," initializer: function() {"," var host = this.get(HOST);"," if (host.editorBR) {"," Y.error('Can not plug EditorPara and EditorBR at the same time.');"," return;"," }",""," host.on(NODE_CHANGE, Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * editorPara"," * @static"," * @property NAME"," */"," NAME: 'editorPara',"," /**"," * editorPara"," * @static"," * @property NS"," */"," NS: 'editorPara',"," ATTRS: {"," host: {"," value: false"," }"," }"," });",""," Y.namespace('Plugin');",""," Y.Plugin.EditorPara = EditorPara;","","","","}, '3.7.3', {\"requires\": [\"editor-para-base\"]});"];+_yuitest_coverage["build/editor-para/editor-para.js"].lines = {"1":0,"14":0,"15":0,"20":0,"27":0,"33":0,"35":0,"36":0,"38":0,"39":0,"42":0,"43":0,"44":0,"45":0,"49":0,"50":0,"51":0,"52":0,"53":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"66":0,"69":0,"72":0,"73":0,"77":0,"79":0,"81":0,"82":0,"83":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"94":0,"95":0,"96":0,"97":0,"98":0,"100":0,"101":0,"105":0,"106":0,"108":0,"109":0,"110":0,"112":0,"113":0,"114":0,"115":0,"116":0,"118":0,"119":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"135":0,"136":0,"138":0,"139":0,"140":0,"142":0,"143":0,"147":0,"148":0,"150":0,"153":0,"154":0,"156":0,"157":0,"160":0,"161":0,"163":0,"164":0,"165":0,"166":0,"167":0,"169":0,"172":0,"174":0,"175":0,"176":0,"177":0,"181":0,"185":0,"186":0,"187":0,"188":0,"189":0,"191":0,"192":0,"193":0,"194":0,"197":0,"198":0,"199":0,"201":0,"203":0,"204":0,"206":0,"207":0,"208":0,"210":0,"211":0,"213":0,"214":0,"216":0,"217":0,"218":0,"219":0,"223":0,"224":0,"227":0,"228":0,"229":0,"230":0,"231":0,"232":0,"233":0,"234":0,"235":0,"242":0,"249":0,"250":0,"251":0,"252":0,"254":0,"256":0,"257":0,"258":0,"259":0,"260":0,"267":0,"268":0,"269":0,"270":0,"273":0,"295":0,"297":0};+_yuitest_coverage["build/editor-para/editor-para.js"].functions = {"EditorPara:14":0,"(anonymous 2):138":0,"_onNodeChange:26":0,"initializer:266":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-para/editor-para.js"].coveredLines = 158; _yuitest_coverage["build/editor-para/editor-para.js"].coveredFunctions = 5; _yuitest_coverline("build/editor-para/editor-para.js", 1); YUI.add('editor-para', function (Y, NAME) {@@ -73,345 +73,348 @@ _yuitest_coverline("build/editor-para/editor-para.js", 27); var host = this.get(HOST), inst = host.getInstance(), html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,- inHTML, txt2, childs, aNode, index, node2, top, n, sib,- ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';+ inHTML, txt2, childs, aNode, node2, top, n, sib, para2, prev,+ ps, br, item, p, imgs, t, LAST_CHILD = ':last-child', para, b, dir,+ lc, lc2, found = false, start; - _yuitest_coverline("build/editor-para/editor-para.js", 32);+ _yuitest_coverline("build/editor-para/editor-para.js", 33); switch (e.changedType) { case 'enter-up':- _yuitest_coverline("build/editor-para/editor-para.js", 34);-var para = ((this._lastPara) ? this._lastPara : e.changedNode),- b = para.one('br.yui-cursor');+ _yuitest_coverline("build/editor-para/editor-para.js", 35);+para = ((this._lastPara) ? this._lastPara : e.changedNode);+ _yuitest_coverline("build/editor-para/editor-para.js", 36);+b = para.one('br.yui-cursor'); - _yuitest_coverline("build/editor-para/editor-para.js", 37);+ _yuitest_coverline("build/editor-para/editor-para.js", 38); if (this._lastPara) {- _yuitest_coverline("build/editor-para/editor-para.js", 38);+ _yuitest_coverline("build/editor-para/editor-para.js", 39); delete this._lastPara; } - _yuitest_coverline("build/editor-para/editor-para.js", 41);+ _yuitest_coverline("build/editor-para/editor-para.js", 42); if (b) {- _yuitest_coverline("build/editor-para/editor-para.js", 42);+ _yuitest_coverline("build/editor-para/editor-para.js", 43); if (b.previous() || b.next()) {- _yuitest_coverline("build/editor-para/editor-para.js", 43);+ _yuitest_coverline("build/editor-para/editor-para.js", 44); if (b.ancestor(P)) {- _yuitest_coverline("build/editor-para/editor-para.js", 44);+ _yuitest_coverline("build/editor-para/editor-para.js", 45); b.remove(); } } }- _yuitest_coverline("build/editor-para/editor-para.js", 48);+ _yuitest_coverline("build/editor-para/editor-para.js", 49); if (!para.test(btag)) {- _yuitest_coverline("build/editor-para/editor-para.js", 49);-var para2 = para.ancestor(btag); _yuitest_coverline("build/editor-para/editor-para.js", 50);+para2 = para.ancestor(btag);+ _yuitest_coverline("build/editor-para/editor-para.js", 51); if (para2) {- _yuitest_coverline("build/editor-para/editor-para.js", 51);-para = para2; _yuitest_coverline("build/editor-para/editor-para.js", 52);+para = para2;+ _yuitest_coverline("build/editor-para/editor-para.js", 53); para2 = null; } }- _yuitest_coverline("build/editor-para/editor-para.js", 55);+ _yuitest_coverline("build/editor-para/editor-para.js", 56); if (para.test(btag)) {- _yuitest_coverline("build/editor-para/editor-para.js", 56);-var prev = para.previous(), lc, lc2, found = false; _yuitest_coverline("build/editor-para/editor-para.js", 57);+prev = para.previous();+ _yuitest_coverline("build/editor-para/editor-para.js", 58); if (prev) {- _yuitest_coverline("build/editor-para/editor-para.js", 58);-lc = prev.one(LAST_CHILD); _yuitest_coverline("build/editor-para/editor-para.js", 59);+lc = prev.one(LAST_CHILD);+ _yuitest_coverline("build/editor-para/editor-para.js", 60); while (!found) {- _yuitest_coverline("build/editor-para/editor-para.js", 60);+ _yuitest_coverline("build/editor-para/editor-para.js", 61); if (lc) {- _yuitest_coverline("build/editor-para/editor-para.js", 61);-lc2 = lc.one(LAST_CHILD); _yuitest_coverline("build/editor-para/editor-para.js", 62);+lc2 = lc.one(LAST_CHILD);+ _yuitest_coverline("build/editor-para/editor-para.js", 63); if (lc2) {- _yuitest_coverline("build/editor-para/editor-para.js", 63);+ _yuitest_coverline("build/editor-para/editor-para.js", 64); lc = lc2; } else {- _yuitest_coverline("build/editor-para/editor-para.js", 65);+ _yuitest_coverline("build/editor-para/editor-para.js", 66); found = true; } } else {- _yuitest_coverline("build/editor-para/editor-para.js", 68);+ _yuitest_coverline("build/editor-para/editor-para.js", 69); found = true; } }- _yuitest_coverline("build/editor-para/editor-para.js", 71);+ _yuitest_coverline("build/editor-para/editor-para.js", 72); if (lc) {- _yuitest_coverline("build/editor-para/editor-para.js", 72);+ _yuitest_coverline("build/editor-para/editor-para.js", 73); host.copyStyles(lc, para); } } }- _yuitest_coverline("build/editor-para/editor-para.js", 76);+ _yuitest_coverline("build/editor-para/editor-para.js", 77); break; case 'enter':- _yuitest_coverline("build/editor-para/editor-para.js", 78);+ _yuitest_coverline("build/editor-para/editor-para.js", 79); if (Y.UA.webkit) { //Webkit doesn't support shift+enter as a BR, this fixes that.- _yuitest_coverline("build/editor-para/editor-para.js", 80);+ _yuitest_coverline("build/editor-para/editor-para.js", 81); if (e.changedEvent.shiftKey) {- _yuitest_coverline("build/editor-para/editor-para.js", 81);-host.execCommand('insertbr'); _yuitest_coverline("build/editor-para/editor-para.js", 82);+host.execCommand('insertbr');+ _yuitest_coverline("build/editor-para/editor-para.js", 83); e.changedEvent.preventDefault(); } }- _yuitest_coverline("build/editor-para/editor-para.js", 85);+ _yuitest_coverline("build/editor-para/editor-para.js", 86); if (e.changedNode.test('li') && !Y.UA.ie) {- _yuitest_coverline("build/editor-para/editor-para.js", 86);-html = inst.EditorSelection.getText(e.changedNode); _yuitest_coverline("build/editor-para/editor-para.js", 87);+html = inst.EditorSelection.getText(e.changedNode);+ _yuitest_coverline("build/editor-para/editor-para.js", 88); if (html === '') {- _yuitest_coverline("build/editor-para/editor-para.js", 88);-par = e.changedNode.ancestor('ol,ul'); _yuitest_coverline("build/editor-para/editor-para.js", 89);-var dir = par.getAttribute('dir');+par = e.changedNode.ancestor('ol,ul'); _yuitest_coverline("build/editor-para/editor-para.js", 90);+dir = par.getAttribute('dir');+ _yuitest_coverline("build/editor-para/editor-para.js", 91); if (dir !== '') {- _yuitest_coverline("build/editor-para/editor-para.js", 91);+ _yuitest_coverline("build/editor-para/editor-para.js", 92); dir = ' dir = "' + dir + '"'; }- _yuitest_coverline("build/editor-para/editor-para.js", 93);-par = e.changedNode.ancestor(inst.EditorSelection.BLOCKS); _yuitest_coverline("build/editor-para/editor-para.js", 94);-d = inst.Node.create('<p' + dir + '>' + inst.EditorSelection.CURSOR + '</p>');+par = e.changedNode.ancestor(inst.EditorSelection.BLOCKS); _yuitest_coverline("build/editor-para/editor-para.js", 95);-par.insert(d, 'after');+d = inst.Node.create('<p' + dir + '>' + inst.EditorSelection.CURSOR + '</p>'); _yuitest_coverline("build/editor-para/editor-para.js", 96);-e.changedNode.remove();+par.insert(d, 'after'); _yuitest_coverline("build/editor-para/editor-para.js", 97);+e.changedNode.remove();+ _yuitest_coverline("build/editor-para/editor-para.js", 98); e.changedEvent.halt(); - _yuitest_coverline("build/editor-para/editor-para.js", 99);-sel = new inst.EditorSelection(); _yuitest_coverline("build/editor-para/editor-para.js", 100);+sel = new inst.EditorSelection();+ _yuitest_coverline("build/editor-para/editor-para.js", 101); sel.selectNode(d, true, false); } } //TODO Move this to a GECKO MODULE - Can't for the moment, requires no change to metadata (YMAIL)- _yuitest_coverline("build/editor-para/editor-para.js", 104);+ _yuitest_coverline("build/editor-para/editor-para.js", 105); if (Y.UA.gecko && host.get('defaultblock') !== 'p') {- _yuitest_coverline("build/editor-para/editor-para.js", 105);+ _yuitest_coverline("build/editor-para/editor-para.js", 106); par = e.changedNode; - _yuitest_coverline("build/editor-para/editor-para.js", 107);+ _yuitest_coverline("build/editor-para/editor-para.js", 108); if (!par.test(LI) && !par.ancestor(LI)) {- _yuitest_coverline("build/editor-para/editor-para.js", 108);+ _yuitest_coverline("build/editor-para/editor-para.js", 109); if (!par.test(btag)) {- _yuitest_coverline("build/editor-para/editor-para.js", 109);+ _yuitest_coverline("build/editor-para/editor-para.js", 110); par = par.ancestor(btag); }- _yuitest_coverline("build/editor-para/editor-para.js", 111);-d = inst.Node.create('<' + btag + '></' + btag + '>'); _yuitest_coverline("build/editor-para/editor-para.js", 112);-par.insert(d, 'after');+d = inst.Node.create('<' + btag + '></' + btag + '>'); _yuitest_coverline("build/editor-para/editor-para.js", 113);-sel = new inst.EditorSelection();+par.insert(d, 'after'); _yuitest_coverline("build/editor-para/editor-para.js", 114);+sel = new inst.EditorSelection();+ _yuitest_coverline("build/editor-para/editor-para.js", 115); if (sel.anchorOffset) {- _yuitest_coverline("build/editor-para/editor-para.js", 115);+ _yuitest_coverline("build/editor-para/editor-para.js", 116); inHTML = sel.anchorNode.get('textContent'); - _yuitest_coverline("build/editor-para/editor-para.js", 117);-txt = inst.one(inst.config.doc.createTextNode(inHTML.substr(0, sel.anchorOffset))); _yuitest_coverline("build/editor-para/editor-para.js", 118);+txt = inst.one(inst.config.doc.createTextNode(inHTML.substr(0, sel.anchorOffset)));+ _yuitest_coverline("build/editor-para/editor-para.js", 119); txt2 = inst.one(inst.config.doc.createTextNode(inHTML.substr(sel.anchorOffset))); - _yuitest_coverline("build/editor-para/editor-para.js", 120);-aNode = sel.anchorNode; _yuitest_coverline("build/editor-para/editor-para.js", 121);-aNode.setContent(''); //I+aNode = sel.anchorNode; _yuitest_coverline("build/editor-para/editor-para.js", 122);-node2 = aNode.cloneNode(); //I+aNode.setContent(''); //I _yuitest_coverline("build/editor-para/editor-para.js", 123);-node2.append(txt2); //text+node2 = aNode.cloneNode(); //I _yuitest_coverline("build/editor-para/editor-para.js", 124);-top = false;+node2.append(txt2); //text _yuitest_coverline("build/editor-para/editor-para.js", 125);-sib = aNode; //I+top = false; _yuitest_coverline("build/editor-para/editor-para.js", 126);+sib = aNode; //I+ _yuitest_coverline("build/editor-para/editor-para.js", 127); while (!top) {- _yuitest_coverline("build/editor-para/editor-para.js", 127);-sib = sib.get(PARENT_NODE); //B _yuitest_coverline("build/editor-para/editor-para.js", 128);+sib = sib.get(PARENT_NODE); //B+ _yuitest_coverline("build/editor-para/editor-para.js", 129); if (sib && !sib.test(btag)) {- _yuitest_coverline("build/editor-para/editor-para.js", 129);-n = sib.cloneNode(); _yuitest_coverline("build/editor-para/editor-para.js", 130);-n.set('innerHTML', '');+n = sib.cloneNode(); _yuitest_coverline("build/editor-para/editor-para.js", 131);+n.set('innerHTML', '');+ _yuitest_coverline("build/editor-para/editor-para.js", 132); n.append(node2);- + //Get children..- _yuitest_coverline("build/editor-para/editor-para.js", 134);-childs = sib.get('childNodes'); _yuitest_coverline("build/editor-para/editor-para.js", 135);-var start = false;+childs = sib.get('childNodes'); _yuitest_coverline("build/editor-para/editor-para.js", 136);+start = false;+ /*jshint loopfunc: true */+ _yuitest_coverline("build/editor-para/editor-para.js", 138); childs.each(function(c) {- _yuitest_coverfunc("build/editor-para/editor-para.js", "(anonymous 2)", 136);-_yuitest_coverline("build/editor-para/editor-para.js", 137);+ _yuitest_coverfunc("build/editor-para/editor-para.js", "(anonymous 2)", 138);+_yuitest_coverline("build/editor-para/editor-para.js", 139); if (start) {- _yuitest_coverline("build/editor-para/editor-para.js", 138);+ _yuitest_coverline("build/editor-para/editor-para.js", 140); n.append(c); }- _yuitest_coverline("build/editor-para/editor-para.js", 140);+ _yuitest_coverline("build/editor-para/editor-para.js", 142); if (c === aNode) {- _yuitest_coverline("build/editor-para/editor-para.js", 141);+ _yuitest_coverline("build/editor-para/editor-para.js", 143); start = true; } }); - _yuitest_coverline("build/editor-para/editor-para.js", 145);+ _yuitest_coverline("build/editor-para/editor-para.js", 147); aNode = sib; //Top sibling- _yuitest_coverline("build/editor-para/editor-para.js", 146);+ _yuitest_coverline("build/editor-para/editor-para.js", 148); node2 = n; } else {- _yuitest_coverline("build/editor-para/editor-para.js", 148);+ _yuitest_coverline("build/editor-para/editor-para.js", 150); top = true; } }- _yuitest_coverline("build/editor-para/editor-para.js", 151);+ _yuitest_coverline("build/editor-para/editor-para.js", 153); txt2 = node2;- _yuitest_coverline("build/editor-para/editor-para.js", 152);+ _yuitest_coverline("build/editor-para/editor-para.js", 154); sel.anchorNode.append(txt); - _yuitest_coverline("build/editor-para/editor-para.js", 154);+ _yuitest_coverline("build/editor-para/editor-para.js", 156); if (txt2) {- _yuitest_coverline("build/editor-para/editor-para.js", 155);+ _yuitest_coverline("build/editor-para/editor-para.js", 157); d.append(txt2); } }- _yuitest_coverline("build/editor-para/editor-para.js", 158);+ _yuitest_coverline("build/editor-para/editor-para.js", 160); if (d.get(FC)) {- _yuitest_coverline("build/editor-para/editor-para.js", 159);+ _yuitest_coverline("build/editor-para/editor-para.js", 161); d = d.get(FC); }- _yuitest_coverline("build/editor-para/editor-para.js", 161);+ _yuitest_coverline("build/editor-para/editor-para.js", 163); d.prepend(inst.EditorSelection.CURSOR);- _yuitest_coverline("build/editor-para/editor-para.js", 162);+ _yuitest_coverline("build/editor-para/editor-para.js", 164); sel.focusCursor(true, true);- _yuitest_coverline("build/editor-para/editor-para.js", 163);+ _yuitest_coverline("build/editor-para/editor-para.js", 165); html = inst.EditorSelection.getText(d);- _yuitest_coverline("build/editor-para/editor-para.js", 164);+ _yuitest_coverline("build/editor-para/editor-para.js", 166); if (html !== '') {- _yuitest_coverline("build/editor-para/editor-para.js", 165);+ _yuitest_coverline("build/editor-para/editor-para.js", 167); inst.EditorSelection.cleanCursor(); }- _yuitest_coverline("build/editor-para/editor-para.js", 167);+ _yuitest_coverline("build/editor-para/editor-para.js", 169); e.changedEvent.preventDefault(); } }- _yuitest_coverline("build/editor-para/editor-para.js", 170);+ _yuitest_coverline("build/editor-para/editor-para.js", 172); break; case 'keyup':- _yuitest_coverline("build/editor-para/editor-para.js", 172);+ _yuitest_coverline("build/editor-para/editor-para.js", 174); if (Y.UA.gecko) {- _yuitest_coverline("build/editor-para/editor-para.js", 173);+ _yuitest_coverline("build/editor-para/editor-para.js", 175); if (inst.config.doc && inst.config.doc.body && inst.config.doc.body.innerHTML.length < 20) {- _yuitest_coverline("build/editor-para/editor-para.js", 174);+ _yuitest_coverline("build/editor-para/editor-para.js", 176); if (!inst.one(FIRST_P)) {- _yuitest_coverline("build/editor-para/editor-para.js", 175);+ _yuitest_coverline("build/editor-para/editor-para.js", 177); this._fixFirstPara(); } } }- _yuitest_coverline("build/editor-para/editor-para.js", 179);+ _yuitest_coverline("build/editor-para/editor-para.js", 181); break; case 'backspace-up': case 'backspace-down': case 'delete-up':- _yuitest_coverline("build/editor-para/editor-para.js", 183);+ _yuitest_coverline("build/editor-para/editor-para.js", 185); if (!Y.UA.ie) {- _yuitest_coverline("build/editor-para/editor-para.js", 184);+ _yuitest_coverline("build/editor-para/editor-para.js", 186); ps = inst.all(FIRST_P);- _yuitest_coverline("build/editor-para/editor-para.js", 185);+ _yuitest_coverline("build/editor-para/editor-para.js", 187); item = inst.one(BODY);- _yuitest_coverline("build/editor-para/editor-para.js", 186);+ _yuitest_coverline("build/editor-para/editor-para.js", 188); if (ps.item(0)) {- _yuitest_coverline("build/editor-para/editor-para.js", 187);+ _yuitest_coverline("build/editor-para/editor-para.js", 189); item = ps.item(0); }- _yuitest_coverline("build/editor-para/editor-para.js", 189);+ _yuitest_coverline("build/editor-para/editor-para.js", 191); br = item.one('br');- _yuitest_coverline("build/editor-para/editor-para.js", 190);+ _yuitest_coverline("build/editor-para/editor-para.js", 192); if (br) {- _yuitest_coverline("build/editor-para/editor-para.js", 191);+ _yuitest_coverline("build/editor-para/editor-para.js", 193); br.removeAttribute('id');- _yuitest_coverline("build/editor-para/editor-para.js", 192);+ _yuitest_coverline("build/editor-para/editor-para.js", 194); br.removeAttribute('class'); } - _yuitest_coverline("build/editor-para/editor-para.js", 195);+ _yuitest_coverline("build/editor-para/editor-para.js", 197); txt = inst.EditorSelection.getText(item);- _yuitest_coverline("build/editor-para/editor-para.js", 196);+ _yuitest_coverline("build/editor-para/editor-para.js", 198); txt = txt.replace(/ /g, '').replace(/\n/g, '');- _yuitest_coverline("build/editor-para/editor-para.js", 197);-imgs = item.all('img');- _yuitest_coverline("build/editor-para/editor-para.js", 199);+imgs = item.all('img');++ _yuitest_coverline("build/editor-para/editor-para.js", 201); if (txt.length === 0 && !imgs.size()) { //God this is horrible..- _yuitest_coverline("build/editor-para/editor-para.js", 201);+ _yuitest_coverline("build/editor-para/editor-para.js", 203); if (!item.test(P)) {- _yuitest_coverline("build/editor-para/editor-para.js", 202);+ _yuitest_coverline("build/editor-para/editor-para.js", 204); this._fixFirstPara(); }- _yuitest_coverline("build/editor-para/editor-para.js", 204);+ _yuitest_coverline("build/editor-para/editor-para.js", 206); p = null;- _yuitest_coverline("build/editor-para/editor-para.js", 205);+ _yuitest_coverline("build/editor-para/editor-para.js", 207); if (e.changedNode && e.changedNode.test(P)) {- _yuitest_coverline("build/editor-para/editor-para.js", 206);+ _yuitest_coverline("build/editor-para/editor-para.js", 208); p = e.changedNode; }- _yuitest_coverline("build/editor-para/editor-para.js", 208);+ _yuitest_coverline("build/editor-para/editor-para.js", 210); if (!p && host._lastPara && host._lastPara.inDoc()) {- _yuitest_coverline("build/editor-para/editor-para.js", 209);+ _yuitest_coverline("build/editor-para/editor-para.js", 211); p = host._lastPara; }- _yuitest_coverline("build/editor-para/editor-para.js", 211);+ _yuitest_coverline("build/editor-para/editor-para.js", 213); if (p && !p.test(P)) {- _yuitest_coverline("build/editor-para/editor-para.js", 212);+ _yuitest_coverline("build/editor-para/editor-para.js", 214); p = p.ancestor(P); }- _yuitest_coverline("build/editor-para/editor-para.js", 214);+ _yuitest_coverline("build/editor-para/editor-para.js", 216); if (p) {- _yuitest_coverline("build/editor-para/editor-para.js", 215);+ _yuitest_coverline("build/editor-para/editor-para.js", 217); if (!p.previous() && p.get(PARENT_NODE) && p.get(PARENT_NODE).test(BODY)) {- _yuitest_coverline("build/editor-para/editor-para.js", 216);+ _yuitest_coverline("build/editor-para/editor-para.js", 218); e.changedEvent.frameEvent.halt();- _yuitest_coverline("build/editor-para/editor-para.js", 217);+ _yuitest_coverline("build/editor-para/editor-para.js", 219); e.preventDefault(); } } }- _yuitest_coverline("build/editor-para/editor-para.js", 221);+ _yuitest_coverline("build/editor-para/editor-para.js", 223); if (Y.UA.webkit) {- _yuitest_coverline("build/editor-para/editor-para.js", 222);+ _yuitest_coverline("build/editor-para/editor-para.js", 224); if (e.changedNode) { //All backspace calls in Webkit need a preventDefault to //stop history navigation #2531299- _yuitest_coverline("build/editor-para/editor-para.js", 225);+ _yuitest_coverline("build/editor-para/editor-para.js", 227); e.preventDefault();- _yuitest_coverline("build/editor-para/editor-para.js", 226);+ _yuitest_coverline("build/editor-para/editor-para.js", 228); item = e.changedNode;- _yuitest_coverline("build/editor-para/editor-para.js", 227);+ _yuitest_coverline("build/editor-para/editor-para.js", 229); if (item.test('li') && (!item.previous() && !item.next())) {- _yuitest_coverline("build/editor-para/editor-para.js", 228);+ _yuitest_coverline("build/editor-para/editor-para.js", 230); html = item.get('innerHTML').replace(BR, '');- _yuitest_coverline("build/editor-para/editor-para.js", 229);+ _yuitest_coverline("build/editor-para/editor-para.js", 231); if (html === '') {- _yuitest_coverline("build/editor-para/editor-para.js", 230);+ _yuitest_coverline("build/editor-para/editor-para.js", 232); if (item.get(PARENT_NODE)) {- _yuitest_coverline("build/editor-para/editor-para.js", 231);+ _yuitest_coverline("build/editor-para/editor-para.js", 233); item.get(PARENT_NODE).replace(inst.Node.create(BR));- _yuitest_coverline("build/editor-para/editor-para.js", 232);+ _yuitest_coverline("build/editor-para/editor-para.js", 234); e.changedEvent.frameEvent.halt();- _yuitest_coverline("build/editor-para/editor-para.js", 233);+ _yuitest_coverline("build/editor-para/editor-para.js", 235); inst.EditorSelection.filterBlocks(); } }@@ -419,7 +422,7 @@ } } }- _yuitest_coverline("build/editor-para/editor-para.js", 240);+ _yuitest_coverline("build/editor-para/editor-para.js", 242); if (Y.UA.gecko) { /* * This forced FF to redraw the content on backspace.@@ -427,46 +430,46 @@ * Dropping in the empty textnode and then removing it causes FF to redraw and * remove the "ghost cursors" */- _yuitest_coverline("build/editor-para/editor-para.js", 247);+ _yuitest_coverline("build/editor-para/editor-para.js", 249); d = e.changedNode;- _yuitest_coverline("build/editor-para/editor-para.js", 248);+ _yuitest_coverline("build/editor-para/editor-para.js", 250); t = inst.config.doc.createTextNode(' ');- _yuitest_coverline("build/editor-para/editor-para.js", 249);+ _yuitest_coverline("build/editor-para/editor-para.js", 251); d.appendChild(t);- _yuitest_coverline("build/editor-para/editor-para.js", 250);+ _yuitest_coverline("build/editor-para/editor-para.js", 252); d.removeChild(t); }- _yuitest_coverline("build/editor-para/editor-para.js", 252);+ _yuitest_coverline("build/editor-para/editor-para.js", 254); break; }- _yuitest_coverline("build/editor-para/editor-para.js", 254);+ _yuitest_coverline("build/editor-para/editor-para.js", 256); if (Y.UA.gecko) {- _yuitest_coverline("build/editor-para/editor-para.js", 255);+ _yuitest_coverline("build/editor-para/editor-para.js", 257); if (e.changedNode && !e.changedNode.test(btag)) {- _yuitest_coverline("build/editor-para/editor-para.js", 256);+ _yuitest_coverline("build/editor-para/editor-para.js", 258); p = e.changedNode.ancestor(btag);- _yuitest_coverline("build/editor-para/editor-para.js", 257);+ _yuitest_coverline("build/editor-para/editor-para.js", 259); if (p) {- _yuitest_coverline("build/editor-para/editor-para.js", 258);+ _yuitest_coverline("build/editor-para/editor-para.js", 260); this._lastPara = p; } } }- + }, initializer: function() {- _yuitest_coverfunc("build/editor-para/editor-para.js", "initializer", 264);-_yuitest_coverline("build/editor-para/editor-para.js", 265);+ _yuitest_coverfunc("build/editor-para/editor-para.js", "initializer", 266);+_yuitest_coverline("build/editor-para/editor-para.js", 267); var host = this.get(HOST);- _yuitest_coverline("build/editor-para/editor-para.js", 266);+ _yuitest_coverline("build/editor-para/editor-para.js", 268); if (host.editorBR) {- _yuitest_coverline("build/editor-para/editor-para.js", 267);+ _yuitest_coverline("build/editor-para/editor-para.js", 269); Y.error('Can not plug EditorPara and EditorBR at the same time.');- _yuitest_coverline("build/editor-para/editor-para.js", 268);+ _yuitest_coverline("build/editor-para/editor-para.js", 270); return; } - _yuitest_coverline("build/editor-para/editor-para.js", 271);+ _yuitest_coverline("build/editor-para/editor-para.js", 273); host.on(NODE_CHANGE, Y.bind(this._onNodeChange, this)); } }, {@@ -488,13 +491,13 @@ } } });- - _yuitest_coverline("build/editor-para/editor-para.js", 293);-Y.namespace('Plugin');- + _yuitest_coverline("build/editor-para/editor-para.js", 295);+Y.namespace('Plugin');++ _yuitest_coverline("build/editor-para/editor-para.js", 297); Y.Plugin.EditorPara = EditorPara; -}, '3.7.2', {"requires": ["editor-para-base"]});+}, '3.7.3', {"requires": ["editor-para-base"]});
bundle/editor-para/editor-para-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,13 +32,14 @@ _onNodeChange: function(e) { var host = this.get(HOST), inst = host.getInstance(), html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,- inHTML, txt2, childs, aNode, index, node2, top, n, sib,- ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';+ inHTML, txt2, childs, aNode, node2, top, n, sib, para2, prev,+ ps, br, item, p, imgs, t, LAST_CHILD = ':last-child', para, b, dir,+ lc, lc2, found = false, start; switch (e.changedType) { case 'enter-up':- var para = ((this._lastPara) ? this._lastPara : e.changedNode),- b = para.one('br.yui-cursor');+ para = ((this._lastPara) ? this._lastPara : e.changedNode);+ b = para.one('br.yui-cursor'); if (this._lastPara) { delete this._lastPara;@@ -52,14 +53,14 @@ } } if (!para.test(btag)) {- var para2 = para.ancestor(btag);+ para2 = para.ancestor(btag); if (para2) { para = para2; para2 = null; } } if (para.test(btag)) {- var prev = para.previous(), lc, lc2, found = false;+ prev = para.previous(); if (prev) { lc = prev.one(LAST_CHILD); while (!found) {@@ -92,7 +93,7 @@ html = inst.EditorSelection.getText(e.changedNode); if (html === '') { par = e.changedNode.ancestor('ol,ul');- var dir = par.getAttribute('dir');+ dir = par.getAttribute('dir'); if (dir !== '') { dir = ' dir = "' + dir + '"'; }@@ -135,10 +136,11 @@ n = sib.cloneNode(); n.set('innerHTML', ''); n.append(node2);- + //Get children.. childs = sib.get('childNodes');- var start = false;+ start = false;+ /*jshint loopfunc: true */ childs.each(function(c) { if (start) { n.append(c);@@ -201,7 +203,7 @@ txt = inst.EditorSelection.getText(item); txt = txt.replace(/ /g, '').replace(/\n/g, ''); imgs = item.all('img');- + if (txt.length === 0 && !imgs.size()) { //God this is horrible.. if (!item.test(P)) {@@ -266,7 +268,7 @@ } } }- + }, initializer: function() { var host = this.get(HOST);@@ -296,11 +298,11 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorPara = EditorPara; -}, '3.7.2', {"requires": ["editor-para-base"]});+}, '3.7.3', {"requires": ["editor-para-base"]});
bundle/editor-para/editor-para-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-para",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s="nodeChange",o="parentNode",u=i+" > p",a="p",f="<br>",l="firstChild",c="li";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(t){var n=this.get(r),s=n.getInstance(),h,p,d,v,m,g=s.EditorSelection.DEFAULT_BLOCK_TAG,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D=":last-child";switch(t.changedType){case"enter-up":var H=this._lastPara?this._lastPara:t.changedNode,B=H.one("br.yui-cursor");this._lastPara&&delete this._lastPara,B&&(B.previous()||B.next())&&B.ancestor(a)&&B.remove();if(!H.test(g)){var j=H.ancestor(g);j&&(H=j,j=null)}if(H.test(g)){var F=H.previous(),I,q,R=!1;if(F){I=F.one(D);while(!R)I?(q=I.one(D),q?I=q:R=!0):R=!0;I&&n.copyStyles(I,H)}}break;case"enter":e.UA.webkit&&t.changedEvent.shiftKey&&(n.execCommand("insertbr"),t.changedEvent.preventDefault());if(t.changedNode.test("li")&&!e.UA.ie){h=s.EditorSelection.getText(t.changedNode);if(h===""){d=t.changedNode.ancestor("ol,ul");var U=d.getAttribute("dir");U!==""&&(U=' dir = "'+U+'"'),d=t.changedNode.ancestor(s.EditorSelection.BLOCKS),v=s.Node.create("<p"+U+">"+s.EditorSelection.CURSOR+"</p>"),d.insert(v,"after"),t.changedNode.remove(),t.changedEvent.halt(),m=new s.EditorSelection,m.selectNode(v,!0,!1)}}if(e.UA.gecko&&n.get("defaultblock")!=="p"){d=t.changedNode;if(!d.test(c)&&!d.ancestor(c)){d.test(g)||(d=d.ancestor(g)),v=s.Node.create("<"+g+"></"+g+">"),d.insert(v,"after"),m=new s.EditorSelection;if(m.anchorOffset){y=m.anchorNode.get("textContent"),p=s.one(s.config.doc.createTextNode(y.substr(0,m.anchorOffset))),b=s.one(s.config.doc.createTextNode(y.substr(m.anchorOffset))),E=m.anchorNode,E.setContent(""),x=E.cloneNode(),x.append(b),T=!1,C=E;while(!T){C=C.get(o);if(C&&!C.test(g)){N=C.cloneNode(),N.set("innerHTML",""),N.append(x),w=C.get("childNodes");var z=!1;w.each(function(e){z&&N.append(e),e===E&&(z=!0)}),E=C,x=N}else T=!0}b=x,m.anchorNode.append(p),b&&v.append(b)}v.get(l)&&(v=v.get(l)),v.prepend(s.EditorSelection.CURSOR),m.focusCursor(!0,!0),h=s.EditorSelection.getText(v),h!==""&&s.EditorSelection.cleanCursor(),t.changedEvent.preventDefault()}}break;case"keyup":e.UA.gecko&&s.config.doc&&s.config.doc.body&&s.config.doc.body.innerHTML.length<20&&(s.one(u)||this._fixFirstPara());break;case"backspace-up":case"backspace-down":case"delete-up":e.UA.ie||(k=s.all(u),A=s.one(i),k.item(0)&&(A=k.item(0)),L=A.one("br"),L&&(L.removeAttribute("id"),L.removeAttribute("class")),p=s.EditorSelection.getText(A),p=p.replace(/ /g,"").replace(/\n/g,""),M=A.all("img"),p.length===0&&!M.size()&&(A.test(a)||this._fixFirstPara(),O=null,t.changedNode&&t.changedNode.test(a)&&(O=t.changedNode),!O&&n._lastPara&&n._lastPara.inDoc()&&(O=n._lastPara),O&&!O.test(a)&&(O=O.ancestor(a)),O&&!O.previous()&&O.get(o)&&O.get(o).test(i)&&(t.changedEvent.frameEvent.halt(),t.preventDefault())),e.UA.webkit&&t.changedNode&&(t.preventDefault(),A=t.changedNode,A.test("li")&&!A.previous()&&!A.next()&&(h=A.get("innerHTML").replace(f,""),h===""&&A.get(o)&&(A.get(o).replace(s.Node.create(f)),t.changedEvent.frameEvent.halt(),s.EditorSelection.filterBlocks())))),e.UA.gecko&&(v=t.changedNode,_=s.config.doc.createTextNode(" "),v.appendChild(_),v.removeChild(_))}e.UA.gecko&&t.changedNode&&!t.changedNode.test(g)&&(O=t.changedNode.ancestor(g),O&&(this._lastPara=O))},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(s,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.7.2",{requires:["editor-para-base"]});+YUI.add("editor-para",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host",i="body",s="nodeChange",o="parentNode",u=i+" > p",a="p",f="<br>",l="firstChild",c="li";e.extend(n,e.Plugin.EditorParaBase,{_onNodeChange:function(t){var n=this.get(r),s=n.getInstance(),h,p,d,v,m,g=s.EditorSelection.DEFAULT_BLOCK_TAG,y,b,w,E,S,x,T,N,C,k,L,A,O,M,_,D,H=":last-child",B,j,F,I,q,R=!1,U;switch(t.changedType){case"enter-up":B=this._lastPara?this._lastPara:t.changedNode,j=B.one("br.yui-cursor"),this._lastPara&&delete this._lastPara,j&&(j.previous()||j.next())&&j.ancestor(a)&&j.remove(),B.test(g)||(C=B.ancestor(g),C&&(B=C,C=null));if(B.test(g)){k=B.previous();if(k){I=k.one(H);while(!R)I?(q=I.one(H),q?I=q:R=!0):R=!0;I&&n.copyStyles(I,B)}}break;case"enter":e.UA.webkit&&t.changedEvent.shiftKey&&(n.execCommand("insertbr"),t.changedEvent.preventDefault()),t.changedNode.test("li")&&!e.UA.ie&&(h=s.EditorSelection.getText(t.changedNode),h===""&&(d=t.changedNode.ancestor("ol,ul"),F=d.getAttribute("dir"),F!==""&&(F=' dir = "'+F+'"'),d=t.changedNode.ancestor(s.EditorSelection.BLOCKS),v=s.Node.create("<p"+F+">"+s.EditorSelection.CURSOR+"</p>"),d.insert(v,"after"),t.changedNode.remove(),t.changedEvent.halt(),m=new s.EditorSelection,m.selectNode(v,!0,!1)));if(e.UA.gecko&&n.get("defaultblock")!=="p"){d=t.changedNode;if(!d.test(c)&&!d.ancestor(c)){d.test(g)||(d=d.ancestor(g)),v=s.Node.create("<"+g+"></"+g+">"),d.insert(v,"after"),m=new s.EditorSelection;if(m.anchorOffset){y=m.anchorNode.get("textContent"),p=s.one(s.config.doc.createTextNode(y.substr(0,m.anchorOffset))),b=s.one(s.config.doc.createTextNode(y.substr(m.anchorOffset))),E=m.anchorNode,E.setContent(""),S=E.cloneNode(),S.append(b),x=!1,N=E;while(!x)N=N.get(o),N&&!N.test(g)?(T=N.cloneNode(),T.set("innerHTML",""),T.append(S),w=N.get("childNodes"),U=!1,w.each(function(e){U&&T.append(e),e===E&&(U=!0)}),E=N,S=T):x=!0;b=S,m.anchorNode.append(p),b&&v.append(b)}v.get(l)&&(v=v.get(l)),v.prepend(s.EditorSelection.CURSOR),m.focusCursor(!0,!0),h=s.EditorSelection.getText(v),h!==""&&s.EditorSelection.cleanCursor(),t.changedEvent.preventDefault()}}break;case"keyup":e.UA.gecko&&s.config.doc&&s.config.doc.body&&s.config.doc.body.innerHTML.length<20&&(s.one(u)||this._fixFirstPara());break;case"backspace-up":case"backspace-down":case"delete-up":e.UA.ie||(L=s.all(u),O=s.one(i),L.item(0)&&(O=L.item(0)),A=O.one("br"),A&&(A.removeAttribute("id"),A.removeAttribute("class")),p=s.EditorSelection.getText(O),p=p.replace(/ /g,"").replace(/\n/g,""),_=O.all("img"),p.length===0&&!_.size()&&(O.test(a)||this._fixFirstPara(),M=null,t.changedNode&&t.changedNode.test(a)&&(M=t.changedNode),!M&&n._lastPara&&n._lastPara.inDoc()&&(M=n._lastPara),M&&!M.test(a)&&(M=M.ancestor(a)),M&&!M.previous()&&M.get(o)&&M.get(o).test(i)&&(t.changedEvent.frameEvent.halt(),t.preventDefault())),e.UA.webkit&&t.changedNode&&(t.preventDefault(),O=t.changedNode,O.test("li")&&!O.previous()&&!O.next()&&(h=O.get("innerHTML").replace(f,""),h===""&&O.get(o)&&(O.get(o).replace(s.Node.create(f)),t.changedEvent.frameEvent.halt(),s.EditorSelection.filterBlocks())))),e.UA.gecko&&(v=t.changedNode,D=s.config.doc.createTextNode(" "),v.appendChild(D),v.removeChild(D))}e.UA.gecko&&t.changedNode&&!t.changedNode.test(g)&&(M=t.changedNode.ancestor(g),M&&(this._lastPara=M))},initializer:function(){var t=this.get(r);if(t.editorBR){e.error("Can not plug EditorPara and EditorBR at the same time.");return}t.on(s,e.bind(this._onNodeChange,this))}},{NAME:"editorPara",NS:"editorPara",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorPara=n},"3.7.3",{requires:["editor-para-base"]});
bundle/editor-para/editor-para.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,13 +32,14 @@ _onNodeChange: function(e) { var host = this.get(HOST), inst = host.getInstance(), html, txt, par , d, sel, btag = inst.EditorSelection.DEFAULT_BLOCK_TAG,- inHTML, txt2, childs, aNode, index, node2, top, n, sib,- ps, br, item, p, imgs, t, LAST_CHILD = ':last-child';+ inHTML, txt2, childs, aNode, node2, top, n, sib, para2, prev,+ ps, br, item, p, imgs, t, LAST_CHILD = ':last-child', para, b, dir,+ lc, lc2, found = false, start; switch (e.changedType) { case 'enter-up':- var para = ((this._lastPara) ? this._lastPara : e.changedNode),- b = para.one('br.yui-cursor');+ para = ((this._lastPara) ? this._lastPara : e.changedNode);+ b = para.one('br.yui-cursor'); if (this._lastPara) { delete this._lastPara;@@ -52,14 +53,14 @@ } } if (!para.test(btag)) {- var para2 = para.ancestor(btag);+ para2 = para.ancestor(btag); if (para2) { para = para2; para2 = null; } } if (para.test(btag)) {- var prev = para.previous(), lc, lc2, found = false;+ prev = para.previous(); if (prev) { lc = prev.one(LAST_CHILD); while (!found) {@@ -92,7 +93,7 @@ html = inst.EditorSelection.getText(e.changedNode); if (html === '') { par = e.changedNode.ancestor('ol,ul');- var dir = par.getAttribute('dir');+ dir = par.getAttribute('dir'); if (dir !== '') { dir = ' dir = "' + dir + '"'; }@@ -135,10 +136,11 @@ n = sib.cloneNode(); n.set('innerHTML', ''); n.append(node2);- + //Get children.. childs = sib.get('childNodes');- var start = false;+ start = false;+ /*jshint loopfunc: true */ childs.each(function(c) { if (start) { n.append(c);@@ -201,7 +203,7 @@ txt = inst.EditorSelection.getText(item); txt = txt.replace(/ /g, '').replace(/\n/g, ''); imgs = item.all('img');- + if (txt.length === 0 && !imgs.size()) { //God this is horrible.. if (!item.test(P)) {@@ -265,7 +267,7 @@ } } }- + }, initializer: function() { var host = this.get(HOST);@@ -295,11 +297,11 @@ } } });- + Y.namespace('Plugin');- + Y.Plugin.EditorPara = EditorPara; -}, '3.7.2', {"requires": ["editor-para-base"]});+}, '3.7.3', {"requires": ["editor-para-base"]});
bundle/editor-selection/editor-selection-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/editor-selection/editor-selection.js", code: [] };-_yuitest_coverage["build/editor-selection/editor-selection.js"].code=["YUI.add('editor-selection', function (Y, NAME) {",""," /**"," * Wraps some common Selection/Range functionality into a simple object"," * @class EditorSelection"," * @constructor"," * @module editor"," * @submodule selection"," */"," "," //TODO This shouldn't be there, Y.Node doesn't normalize getting textnode content."," var textContent = 'textContent',"," INNER_HTML = 'innerHTML',"," FONT_FAMILY = 'fontFamily';",""," if (Y.UA.ie) {"," textContent = 'nodeValue';"," }",""," Y.EditorSelection = function(domEvent) {"," var sel, par, ieNode, nodes, rng, i;",""," if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) {"," sel = Y.config.win.getSelection();"," } else if (Y.config.doc.selection) {"," sel = Y.config.doc.selection.createRange();"," }"," this._selection = sel;",""," if (!sel) {"," return false;"," }",""," if (sel.pasteHTML) {"," this.isCollapsed = (sel.compareEndPoints('StartToEnd', sel)) ? false : true;"," if (this.isCollapsed) {"," this.anchorNode = this.focusNode = Y.one(sel.parentElement());",""," if (domEvent) {"," ieNode = Y.config.doc.elementFromPoint(domEvent.clientX, domEvent.clientY);"," }"," rng = sel.duplicate();"," if (!ieNode) {"," par = sel.parentElement();"," nodes = par.childNodes;",""," for (i = 0; i < nodes.length; i++) {"," //This causes IE to not allow a selection on a doubleclick"," //rng.select(nodes[i]);"," if (rng.inRange(sel)) {"," if (!ieNode) {"," ieNode = nodes[i];"," }"," }"," }"," }",""," this.ieNode = ieNode;"," "," if (ieNode) {"," if (ieNode.nodeType !== 3) {"," if (ieNode.firstChild) {"," ieNode = ieNode.firstChild;"," }"," if (ieNode && ieNode.tagName && ieNode.tagName.toLowerCase() === 'body') {"," if (ieNode.firstChild) {"," ieNode = ieNode.firstChild;"," }"," }"," }"," this.anchorNode = this.focusNode = Y.EditorSelection.resolve(ieNode);"," "," rng.moveToElementText(sel.parentElement());"," var comp = sel.compareEndPoints('StartToStart', rng),"," moved = 0;"," if (comp) {"," //We are not at the beginning of the selection."," //Setting the move to something large, may need to increase it later"," moved = Math.abs(sel.move('character', -9999));"," }"," "," this.anchorOffset = this.focusOffset = moved;"," "," this.anchorTextNode = this.focusTextNode = Y.one(ieNode);"," }"," "," "," } else {"," //This helps IE deal with a selection and nodeChange events"," if (sel.htmlText && sel.htmlText !== '') {"," var n = Y.Node.create(sel.htmlText);"," if (n && n.get('id')) {"," var id = n.get('id');"," this.anchorNode = this.focusNode = Y.one('#' + id);"," } else if (n) {"," n = n.get('childNodes');"," this.anchorNode = this.focusNode = n.item(0);"," }"," }"," }",""," //var self = this;"," //debugger;"," } else {"," this.isCollapsed = sel.isCollapsed;"," this.anchorNode = Y.EditorSelection.resolve(sel.anchorNode);"," this.focusNode = Y.EditorSelection.resolve(sel.focusNode);"," this.anchorOffset = sel.anchorOffset;"," this.focusOffset = sel.focusOffset;"," "," this.anchorTextNode = Y.one(sel.anchorNode);"," this.focusTextNode = Y.one(sel.focusNode);"," }"," if (Y.Lang.isString(sel.text)) {"," this.text = sel.text;"," } else {"," if (sel.toString) {"," this.text = sel.toString();"," } else {"," this.text = '';"," }"," }"," };"," "," /**"," * Utility method to remove dead font-family styles from an element."," * @static"," * @method removeFontFamily"," */"," Y.EditorSelection.removeFontFamily = function(n) {"," n.removeAttribute('face');"," var s = n.getAttribute('style').toLowerCase();"," if (s === '' || (s == 'font-family: ')) {"," n.removeAttribute('style');"," }"," if (s.match(Y.EditorSelection.REG_FONTFAMILY)) {"," s = s.replace(Y.EditorSelection.REG_FONTFAMILY, '');"," n.setAttribute('style', s);"," }"," };",""," /**"," * Performs a prefilter on all nodes in the editor. Looks for nodes with a style: fontFamily or font face"," * It then creates a dynamic class assigns it and removed the property. This is so that we don't lose"," * the fontFamily when selecting nodes."," * @static"," * @method filter"," */"," Y.EditorSelection.filter = function(blocks) {"," var startTime = (new Date()).getTime();",""," var nodes = Y.all(Y.EditorSelection.ALL),"," baseNodes = Y.all('strong,em'),"," doc = Y.config.doc, hrs,"," classNames = {}, cssString = '',"," ls;",""," var startTime1 = (new Date()).getTime();"," nodes.each(function(n) {"," var raw = Y.Node.getDOMNode(n);"," if (raw.style[FONT_FAMILY]) {"," classNames['.' + n._yuid] = raw.style[FONT_FAMILY];"," n.addClass(n._yuid);",""," Y.EditorSelection.removeFontFamily(raw);"," }"," /*"," if (n.getStyle(FONT_FAMILY)) {"," classNames['.' + n._yuid] = n.getStyle(FONT_FAMILY);"," n.addClass(n._yuid);"," n.removeAttribute('face');"," n.setStyle(FONT_FAMILY, '');"," if (n.getAttribute('style') === '') {"," n.removeAttribute('style');"," }"," //This is for IE"," if (n.getAttribute('style').toLowerCase() === 'font-family: ') {"," n.removeAttribute('style');"," }"," }"," */"," });"," var endTime1 = (new Date()).getTime();",""," Y.all('.hr').addClass('yui-skip').addClass('yui-non');"," "," if (Y.UA.ie) {"," hrs = doc.getElementsByTagName('hr');"," Y.each(hrs, function(hr) {"," var el = doc.createElement('div');"," el.className = 'hr yui-non yui-skip';"," "," el.setAttribute('readonly', true);"," el.setAttribute('contenteditable', false); //Keep it from being Edited"," if (hr.parentNode) {"," hr.parentNode.replaceChild(el, hr);"," }"," //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');"," var s = el.style;"," s.border = '1px solid #ccc';"," s.lineHeight = '0';"," s.height = '0';"," s.fontSize = '0';"," s.marginTop = '5px';"," s.marginBottom = '5px';"," s.marginLeft = '0px';"," s.marginRight = '0px';"," s.padding = '0';"," });"," }"," ",""," Y.each(classNames, function(v, k) {"," cssString += k + ' { font-family: ' + v.replace(/\"/gi, '') + '; }';"," });"," Y.StyleSheet(cssString, 'editor');",""," "," //Not sure about this one?"," baseNodes.each(function(n, k) {"," var t = n.get('tagName').toLowerCase(),"," newTag = 'i';"," if (t === 'strong') {"," newTag = 'b';"," }"," Y.EditorSelection.prototype._swap(baseNodes.item(k), newTag);"," });",""," //Filter out all the empty UL/OL's"," ls = Y.all('ol,ul');"," ls.each(function(v, k) {"," var lis = v.all('li');"," if (!lis.size()) {"," v.remove();"," }"," });"," "," if (blocks) {"," Y.EditorSelection.filterBlocks();"," }"," var endTime = (new Date()).getTime();"," };",""," /**"," * Method attempts to replace all \"orphined\" text nodes in the main body by wrapping them with a <p>. Called from filter."," * @static"," * @method filterBlocks"," */"," Y.EditorSelection.filterBlocks = function() {"," var startTime = (new Date()).getTime();"," var childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,"," sel, single, br, divs, spans, c, s;",""," if (childs) {"," for (i = 0; i < childs.length; i++) {"," node = Y.one(childs[i]);"," if (!node.test(Y.EditorSelection.BLOCKS)) {"," doit = true;"," if (childs[i].nodeType == 3) {"," c = childs[i][textContent].match(Y.EditorSelection.REG_CHAR);"," s = childs[i][textContent].match(Y.EditorSelection.REG_NON);"," if (c === null && s) {"," doit = false;"," "," }"," }"," if (doit) {"," if (!wrapped) {"," wrapped = [];"," }"," wrapped.push(childs[i]);"," }"," } else {"," wrapped = Y.EditorSelection._wrapBlock(wrapped);"," }"," }"," wrapped = Y.EditorSelection._wrapBlock(wrapped);"," }",""," single = Y.all(Y.EditorSelection.DEFAULT_BLOCK_TAG);"," if (single.size() === 1) {"," br = single.item(0).all('br');"," if (br.size() === 1) {"," if (!br.item(0).test('.yui-cursor')) {"," br.item(0).remove();"," }"," var html = single.item(0).get('innerHTML');"," if (html === '' || html === ' ') {"," single.set('innerHTML', Y.EditorSelection.CURSOR);"," sel = new Y.EditorSelection();"," sel.focusCursor(true, true);"," }"," if (br.item(0).test('.yui-cursor') && Y.UA.ie) {"," br.item(0).remove();"," }"," }"," } else {"," single.each(function(p) {"," var html = p.get('innerHTML');"," if (html === '') {"," p.remove();"," }"," });"," }"," "," if (!Y.UA.ie) {"," /*"," divs = Y.all('div, p');"," divs.each(function(d) {"," if (d.hasClass('yui-non')) {"," return;"," }"," var html = d.get('innerHTML');"," if (html === '') {"," d.remove();"," } else {"," if (d.get('childNodes').size() == 1) {"," if (d.ancestor('p')) {"," d.replace(d.get('firstChild'));"," }"," }"," }"," });*/",""," /* Removed this, as it was causing Pasting to be funky in Safari"," spans = Y.all('.Apple-style-span, .apple-style-span');"," spans.each(function(s) {"," s.setAttribute('style', '');"," });"," */"," }","",""," var endTime = (new Date()).getTime();"," };",""," /**"," * Regular Expression used to find dead font-family styles"," * @static"," * @property REG_FONTFAMILY"," */ "," Y.EditorSelection.REG_FONTFAMILY = /font-family: ;/;",""," /**"," * Regular Expression to determine if a string has a character in it"," * @static"," * @property REG_CHAR"," */ "," Y.EditorSelection.REG_CHAR = /[a-zA-Z-0-9_!@#\\$%\\^&*\\(\\)-=_+\\[\\]\\\\{}|;':\",.\\/<>\\?]/gi;",""," /**"," * Regular Expression to determine if a string has a non-character in it"," * @static"," * @property REG_NON"," */"," Y.EditorSelection.REG_NON = /[\\s|\\n|\\t]/gi;",""," /**"," * Regular Expression to remove all HTML from a string"," * @static"," * @property REG_NOHTML"," */"," Y.EditorSelection.REG_NOHTML = /<\\S[^><]*>/g;","",""," /**"," * Wraps an array of elements in a Block level tag"," * @static"," * @private"," * @method _wrapBlock"," */"," Y.EditorSelection._wrapBlock = function(wrapped) {"," if (wrapped) {"," var newChild = Y.Node.create('<' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '></' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '>'),"," firstChild = Y.one(wrapped[0]), i;",""," for (i = 1; i < wrapped.length; i++) {"," newChild.append(wrapped[i]);"," }"," firstChild.replace(newChild);"," newChild.prepend(firstChild);"," }"," return false;"," };",""," /**"," * Undoes what filter does enough to return the HTML from the Editor, then re-applies the filter."," * @static"," * @method unfilter"," * @return {String} The filtered HTML"," */"," Y.EditorSelection.unfilter = function() {"," var nodes = Y.all('body [class]'),"," html = '', nons, ids,"," body = Y.one('body');"," "," "," nodes.each(function(n) {"," if (n.hasClass(n._yuid)) {"," //One of ours"," n.setStyle(FONT_FAMILY, n.getStyle(FONT_FAMILY));"," n.removeClass(n._yuid);"," if (n.getAttribute('class') === '') {"," n.removeAttribute('class');"," }"," }"," });",""," nons = Y.all('.yui-non');"," nons.each(function(n) {"," if (!n.hasClass('yui-skip') && n.get('innerHTML') === '') {"," n.remove();"," } else {"," n.removeClass('yui-non').removeClass('yui-skip');"," }"," });",""," ids = Y.all('body [id]');"," ids.each(function(n) {"," if (n.get('id').indexOf('yui_3_') === 0) {"," n.removeAttribute('id');"," n.removeAttribute('_yuid');"," }"," });"," "," if (body) {"," html = body.get('innerHTML');"," }"," "," Y.all('.hr').addClass('yui-skip').addClass('yui-non');"," "," /*"," nodes.each(function(n) {"," n.addClass(n._yuid);"," n.setStyle(FONT_FAMILY, '');"," if (n.getAttribute('style') === '') {"," n.removeAttribute('style');"," }"," });"," */"," "," return html;"," };"," /**"," * Resolve a node from the selection object and return a Node instance"," * @static"," * @method resolve"," * @param {HTMLElement} n The HTMLElement to resolve. Might be a TextNode, gives parentNode."," * @return {Node} The Resolved node"," */"," Y.EditorSelection.resolve = function(n) {"," if (n && n.nodeType === 3) {"," //Adding a try/catch here because in rare occasions IE will"," //Throw a error accessing the parentNode of a stranded text node."," //In the case of Ctrl+Z (Undo)"," try {"," n = n.parentNode;"," } catch (re) {"," n = 'body';"," }"," }"," return Y.one(n);"," };",""," /**"," * Returns the innerHTML of a node with all HTML tags removed."," * @static"," * @method getText"," * @param {Node} node The Node instance to remove the HTML from"," * @return {String} The string of text"," */"," Y.EditorSelection.getText = function(node) {"," var txt = node.get('innerHTML').replace(Y.EditorSelection.REG_NOHTML, '');"," //Clean out the cursor subs to see if the Node is empty"," txt = txt.replace('<span><br></span>', '').replace('<br>', '');"," return txt;"," };",""," //Y.EditorSelection.DEFAULT_BLOCK_TAG = 'div';"," Y.EditorSelection.DEFAULT_BLOCK_TAG = 'p';",""," /**"," * The selector to use when looking for Nodes to cache the value of: [style],font[face]"," * @static"," * @property ALL"," */"," Y.EditorSelection.ALL = '[style],font[face]';",""," /**"," * The selector to use when looking for block level items."," * @static"," * @property BLOCKS"," */"," Y.EditorSelection.BLOCKS = 'p,div,ul,ol,table,style';"," /**"," * The temporary fontname applied to a selection to retrieve their values: yui-tmp"," * @static"," * @property TMP"," */"," Y.EditorSelection.TMP = 'yui-tmp';"," /**"," * The default tag to use when creating elements: span"," * @static"," * @property DEFAULT_TAG"," */"," Y.EditorSelection.DEFAULT_TAG = 'span';",""," /**"," * The id of the outer cursor wrapper"," * @static"," * @property DEFAULT_TAG"," */"," Y.EditorSelection.CURID = 'yui-cursor';",""," /**"," * The id used to wrap the inner space of the cursor position"," * @static"," * @property CUR_WRAPID"," */"," Y.EditorSelection.CUR_WRAPID = 'yui-cursor-wrapper';",""," /**"," * The default HTML used to focus the cursor.."," * @static"," * @property CURSOR"," */"," Y.EditorSelection.CURSOR = '<span><br class=\"yui-cursor\"></span>';",""," Y.EditorSelection.hasCursor = function() {"," var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID);"," return cur.size();"," };",""," /**"," * Called from Editor keydown to remove the \"extra\" space before the cursor."," * @static"," * @method cleanCursor"," */"," Y.EditorSelection.cleanCursor = function() {"," var cur, sel = 'br.yui-cursor';"," cur = Y.all(sel);"," if (cur.size()) {"," cur.each(function(b) {"," var c = b.get('parentNode.parentNode.childNodes'), html;"," if (c.size()) {"," b.remove();"," } else {"," html = Y.EditorSelection.getText(c.item(0));"," if (html !== '') {"," b.remove();"," }"," }"," });"," }"," /*"," var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID);"," if (cur.size()) {"," cur.each(function(c) {"," var html = c.get('innerHTML');"," if (html == ' ' || html == '<br>') {"," if (c.previous() || c.next()) {"," c.remove();"," }"," }"," });"," }"," */"," };",""," Y.EditorSelection.prototype = {"," /**"," * Range text value"," * @property text"," * @type String"," */"," text: null,"," /**"," * Flag to show if the range is collapsed or not"," * @property isCollapsed"," * @type Boolean"," */"," isCollapsed: null,"," /**"," * A Node instance of the parentNode of the anchorNode of the range"," * @property anchorNode"," * @type Node"," */"," anchorNode: null,"," /**"," * The offset from the range object"," * @property anchorOffset"," * @type Number"," */"," anchorOffset: null,"," /**"," * A Node instance of the actual textNode of the range."," * @property anchorTextNode"," * @type Node"," */"," anchorTextNode: null,"," /**"," * A Node instance of the parentNode of the focusNode of the range"," * @property focusNode"," * @type Node"," */"," focusNode: null,"," /**"," * The offset from the range object"," * @property focusOffset"," * @type Number"," */"," focusOffset: null,"," /**"," * A Node instance of the actual textNode of the range."," * @property focusTextNode"," * @type Node"," */"," focusTextNode: null,"," /**"," * The actual Selection/Range object"," * @property _selection"," * @private"," */"," _selection: null,"," /**"," * Wrap an element, with another element "," * @private"," * @method _wrap"," * @param {HTMLElement} n The node to wrap "," * @param {String} tag The tag to use when creating the new element."," * @return {HTMLElement} The wrapped node"," */"," _wrap: function(n, tag) {"," var tmp = Y.Node.create('<' + tag + '></' + tag + '>');"," tmp.set(INNER_HTML, n.get(INNER_HTML));"," n.set(INNER_HTML, '');"," n.append(tmp);"," return Y.Node.getDOMNode(tmp);"," },"," /**"," * Swap an element, with another element "," * @private"," * @method _swap"," * @param {HTMLElement} n The node to swap "," * @param {String} tag The tag to use when creating the new element."," * @return {HTMLElement} The new node"," */"," _swap: function(n, tag) {"," var tmp = Y.Node.create('<' + tag + '></' + tag + '>');"," tmp.set(INNER_HTML, n.get(INNER_HTML));"," n.replace(tmp, n);"," return Y.Node.getDOMNode(tmp);"," },"," /**"," * Get all the nodes in the current selection. This method will actually perform a filter first."," * Then it calls doc.execCommand('fontname', null, 'yui-tmp') to touch all nodes in the selection."," * The it compiles a list of all nodes affected by the execCommand and builds a NodeList to return."," * @method getSelected"," * @return {NodeList} A NodeList of all items in the selection."," */"," getSelected: function() {"," Y.EditorSelection.filter();"," Y.config.doc.execCommand('fontname', null, Y.EditorSelection.TMP);"," var nodes = Y.all(Y.EditorSelection.ALL),"," items = [];"," "," nodes.each(function(n, k) {"," if (n.getStyle(FONT_FAMILY) == Y.EditorSelection.TMP) {"," n.setStyle(FONT_FAMILY, '');"," Y.EditorSelection.removeFontFamily(n);"," if (!n.test('body')) {"," items.push(Y.Node.getDOMNode(nodes.item(k)));"," }"," }"," });"," return Y.all(items);"," },"," /**"," * Insert HTML at the current cursor position and return a Node instance of the newly inserted element."," * @method insertContent"," * @param {String} html The HTML to insert."," * @return {Node} The inserted Node."," */"," insertContent: function(html) {"," return this.insertAtCursor(html, this.anchorTextNode, this.anchorOffset, true);"," },"," /**"," * Insert HTML at the current cursor position, this method gives you control over the text node to insert into and the offset where to put it."," * @method insertAtCursor"," * @param {String} html The HTML to insert."," * @param {Node} node The text node to break when inserting."," * @param {Number} offset The left offset of the text node to break and insert the new content."," * @param {Boolean} collapse Should the range be collapsed after insertion. default: false"," * @return {Node} The inserted Node."," */"," insertAtCursor: function(html, node, offset, collapse) {"," var cur = Y.Node.create('<' + Y.EditorSelection.DEFAULT_TAG + ' class=\"yui-non\"></' + Y.EditorSelection.DEFAULT_TAG + '>'),"," inHTML, txt, txt2, newNode, range = this.createRange(), b;",""," if (node && node.test('body')) {"," b = Y.Node.create('<span></span>');"," node.append(b);"," node = b;"," }",""," "," if (range.pasteHTML) {"," if (offset === 0 && node && !node.previous() && node.get('nodeType') === 3) {"," /*"," * For some strange reason, range.pasteHTML fails if the node is a textNode and"," * the offset is 0. (The cursor is at the beginning of the line)"," * It will always insert the new content at position 1 instead of "," * position 0. Here we test for that case and do it the hard way."," */"," node.insert(html, 'before');"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(node.previous()));"," }"," //Move the cursor after the new node"," range.collapse(false);"," range.select();"," return node.previous();"," } else {"," newNode = Y.Node.create(html);"," try {"," range.pasteHTML('<span id=\"rte-insert\"></span>');"," } catch (e) {}"," inHTML = Y.one('#rte-insert');"," if (inHTML) {"," inHTML.set('id', '');"," inHTML.replace(newNode);"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(newNode));"," }"," range.collapse(false);"," range.select();"," return newNode;"," } else {"," Y.on('available', function() {"," inHTML.set('id', '');"," inHTML.replace(newNode);"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(newNode));"," }"," range.collapse(false);"," range.select();"," }, '#rte-insert');"," }"," }"," } else {"," //TODO using Y.Node.create here throws warnings & strips first white space character"," //txt = Y.one(Y.Node.create(inHTML.substr(0, offset)));"," //txt2 = Y.one(Y.Node.create(inHTML.substr(offset)));"," if (offset > 0) {"," inHTML = node.get(textContent);",""," txt = Y.one(Y.config.doc.createTextNode(inHTML.substr(0, offset)));"," txt2 = Y.one(Y.config.doc.createTextNode(inHTML.substr(offset)));",""," node.replace(txt, node);"," newNode = Y.Node.create(html);"," if (newNode.get('nodeType') === 11) {"," b = Y.Node.create('<span></span>');"," b.append(newNode);"," newNode = b;"," }"," txt.insert(newNode, 'after');"," //if (txt2 && txt2.get('length')) {"," if (txt2) {"," newNode.insert(cur, 'after');"," cur.insert(txt2, 'after');"," this.selectNode(cur, collapse);"," }"," } else {"," if (node.get('nodeType') === 3) {"," node = node.get('parentNode');"," }"," newNode = Y.Node.create(html);"," html = node.get('innerHTML').replace(/\\n/gi, '');"," if (html === '' || html === '<br>') {"," node.append(newNode);"," } else {"," if (newNode.get('parentNode')) {"," node.insert(newNode, 'before');"," } else {"," Y.one('body').prepend(newNode);"," }"," }"," if (node.get('firstChild').test('br')) {"," node.get('firstChild').remove();"," }"," }"," }"," return newNode;"," },"," /**"," * Get all elements inside a selection and wrap them with a new element and return a NodeList of all elements touched."," * @method wrapContent"," * @param {String} tag The tag to wrap all selected items with."," * @return {NodeList} A NodeList of all items in the selection."," */"," wrapContent: function(tag) {"," tag = (tag) ? tag : Y.EditorSelection.DEFAULT_TAG;",""," if (!this.isCollapsed) {"," var items = this.getSelected(),"," changed = [], range, last, first, range2;",""," items.each(function(n, k) {"," var t = n.get('tagName').toLowerCase();"," if (t === 'font') {"," changed.push(this._swap(items.item(k), tag));"," } else {"," changed.push(this._wrap(items.item(k), tag));"," }"," }, this);"," "," range = this.createRange();"," first = changed[0];"," last = changed[changed.length - 1];"," if (this._selection.removeAllRanges) {"," range.setStart(changed[0], 0);"," range.setEnd(last, last.childNodes.length);"," this._selection.removeAllRanges();"," this._selection.addRange(range);"," } else {"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(first));"," range2 = this.createRange();"," range2.moveToElementText(Y.Node.getDOMNode(last));"," range.setEndPoint('EndToEnd', range2);"," }"," range.select();"," }",""," changed = Y.all(changed);"," return changed;","",""," } else {"," return Y.all([]);"," }"," },"," /**"," * Find and replace a string inside a text node and replace it with HTML focusing the node after "," * to allow you to continue to type."," * @method replace"," * @param {String} se The string to search for."," * @param {String} re The string of HTML to replace it with."," * @return {Node} The node inserted."," */"," replace: function(se,re) {"," var range = this.createRange(), node, txt, index, newNode;",""," if (range.getBookmark) {"," index = range.getBookmark();"," txt = this.anchorNode.get('innerHTML').replace(se, re);"," this.anchorNode.set('innerHTML', txt);"," range.moveToBookmark(index);"," newNode = Y.one(range.parentElement());"," } else {"," node = this.anchorTextNode;"," txt = node.get(textContent);"," index = txt.indexOf(se);",""," txt = txt.replace(se, '');"," node.set(textContent, txt);"," newNode = this.insertAtCursor(re, node, index, true);"," }"," return newNode;"," },"," /**"," * Destroy the range."," * @method remove"," * @chainable"," * @return {EditorSelection}"," */"," remove: function() {"," if (this._selection && this._selection.removeAllRanges) {"," this._selection.removeAllRanges();"," }"," return this;"," },"," /**"," * Wrapper for the different range creation methods."," * @method createRange"," * @return {RangeObject}"," */"," createRange: function() {"," if (Y.config.doc.selection) {"," return Y.config.doc.selection.createRange();"," } else {"," return Y.config.doc.createRange();"," }"," },"," /**"," * Select a Node (hilighting it)."," * @method selectNode"," * @param {Node} node The node to select"," * @param {Boolean} collapse Should the range be collapsed after insertion. default: false"," * @chainable"," * @return {EditorSelection}"," */"," selectNode: function(node, collapse, end) {"," if (!node) {"," return;"," }"," end = end || 0;"," node = Y.Node.getDOMNode(node);"," var range = this.createRange();"," if (range.selectNode) {"," range.selectNode(node);"," this._selection.removeAllRanges();"," this._selection.addRange(range);"," if (collapse) {"," try {"," this._selection.collapse(node, end);"," } catch (err) {"," this._selection.collapse(node, 0);"," }"," }"," } else {"," if (node.nodeType === 3) {"," node = node.parentNode;"," }"," try {"," range.moveToElementText(node);"," } catch(e) {}"," if (collapse) {"," range.collapse(((end) ? false : true));"," }"," range.select();"," }"," return this;"," },"," /**"," * Put a placeholder in the DOM at the current cursor position."," * @method setCursor"," * @return {Node}"," */"," setCursor: function() {"," this.removeCursor(false);"," return this.insertContent(Y.EditorSelection.CURSOR);"," },"," /**"," * Get the placeholder in the DOM at the current cursor position."," * @method getCursor"," * @return {Node}"," */"," getCursor: function() {"," return Y.all('#' + Y.EditorSelection.CURID);"," },"," /**"," * Remove the cursor placeholder from the DOM."," * @method removeCursor"," * @param {Boolean} keep Setting this to true will keep the node, but remove the unique parts that make it the cursor."," * @return {Node}"," */"," removeCursor: function(keep) {"," var cur = this.getCursor();"," if (cur) {"," if (keep) {"," cur.removeAttribute('id');"," cur.set('innerHTML', '<br class=\"yui-cursor\">');"," } else {"," cur.remove();"," }"," }"," return cur;"," },"," /**"," * Gets a stored cursor and focuses it for editing, must be called sometime after setCursor"," * @method focusCursor"," * @return {Node}"," */"," focusCursor: function(collapse, end) {"," if (collapse !== false) {"," collapse = true;"," }"," if (end !== false) {"," end = true;"," }"," var cur = this.removeCursor(true);"," if (cur) {"," cur.each(function(c) {"," this.selectNode(c, collapse, end);"," }, this);"," }"," },"," /**"," * Generic toString for logging."," * @method toString"," * @return {String}"," */"," toString: function() {"," return 'EditorSelection Object';"," }"," };",""," //TODO Remove this alias in 3.6.0"," Y.Selection = Y.EditorSelection;","","","","}, '3.7.2', {\"requires\": [\"node\"]});"];-_yuitest_coverage["build/editor-selection/editor-selection.js"].lines = {"1":0,"12":0,"16":0,"17":0,"20":0,"21":0,"23":0,"24":0,"25":0,"26":0,"28":0,"30":0,"31":0,"34":0,"35":0,"36":0,"37":0,"39":0,"40":0,"42":0,"43":0,"44":0,"45":0,"47":0,"50":0,"51":0,"52":0,"58":0,"60":0,"61":0,"62":0,"63":0,"65":0,"66":0,"67":0,"71":0,"73":0,"74":0,"76":0,"79":0,"82":0,"84":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"105":0,"106":0,"107":0,"108":0,"109":0,"111":0,"112":0,"114":0,"115":0,"117":0,"118":0,"120":0,"130":0,"131":0,"132":0,"133":0,"134":0,"136":0,"137":0,"138":0,"149":0,"150":0,"152":0,"158":0,"159":0,"160":0,"161":0,"162":0,"163":0,"165":0,"183":0,"185":0,"187":0,"188":0,"189":0,"190":0,"191":0,"193":0,"194":0,"195":0,"196":0,"199":0,"200":0,"201":0,"202":0,"203":0,"204":0,"205":0,"206":0,"207":0,"208":0,"213":0,"214":0,"216":0,"220":0,"221":0,"223":0,"224":0,"226":0,"230":0,"231":0,"232":0,"233":0,"234":0,"238":0,"239":0,"241":0,"249":0,"250":0,"251":0,"254":0,"255":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"267":0,"268":0,"269":0,"271":0,"274":0,"277":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"287":0,"288":0,"289":0,"290":0,"291":0,"293":0,"294":0,"298":0,"299":0,"300":0,"301":0,"306":0,"334":0,"342":0,"349":0,"356":0,"363":0,"372":0,"373":0,"374":0,"377":0,"378":0,"380":0,"381":0,"383":0,"392":0,"393":0,"398":0,"399":0,"401":0,"402":0,"403":0,"404":0,"409":0,"410":0,"411":0,"412":0,"414":0,"418":0,"419":0,"420":0,"421":0,"422":0,"426":0,"427":0,"430":0,"442":0,"451":0,"452":0,"456":0,"457":0,"459":0,"462":0,"472":0,"473":0,"475":0,"476":0,"480":0,"487":0,"494":0,"500":0,"506":0,"513":0,"520":0,"527":0,"529":0,"530":0,"531":0,"539":0,"540":0,"541":0,"542":0,"543":0,"544":0,"545":0,"546":0,"548":0,"549":0,"550":0,"570":0,"634":0,"635":0,"636":0,"637":0,"638":0,"649":0,"650":0,"651":0,"652":0,"662":0,"663":0,"664":0,"667":0,"668":0,"669":0,"670":0,"671":0,"672":0,"676":0,"685":0,"697":0,"700":0,"701":0,"702":0,"703":0,"707":0,"708":0,"715":0,"716":0,"717":0,"720":0,"721":0,"722":0,"724":0,"725":0,"726":0,"728":0,"729":0,"730":0,"731":0,"732":0,"733":0,"735":0,"736":0,"737":0,"739":0,"740":0,"741":0,"742":0,"743":0,"745":0,"746":0,"754":0,"755":0,"757":0,"758":0,"760":0,"761":0,"762":0,"763":0,"764":0,"765":0,"767":0,"769":0,"770":0,"771":0,"772":0,"775":0,"776":0,"778":0,"779":0,"780":0,"781":0,"783":0,"784":0,"786":0,"789":0,"790":0,"794":0,"803":0,"805":0,"806":0,"809":0,"810":0,"811":0,"812":0,"814":0,"818":0,"819":0,"820":0,"821":0,"822":0,"823":0,"824":0,"825":0,"827":0,"828":0,"829":0,"830":0,"831":0,"833":0,"836":0,"837":0,"841":0,"853":0,"855":0,"856":0,"857":0,"858":0,"859":0,"860":0,"862":0,"863":0,"864":0,"866":0,"867":0,"868":0,"870":0,"879":0,"880":0,"882":0,"890":0,"891":0,"893":0,"905":0,"906":0,"908":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"915":0,"916":0,"917":0,"919":0,"923":0,"924":0,"926":0,"927":0,"929":0,"930":0,"932":0,"934":0,"942":0,"943":0,"951":0,"960":0,"961":0,"962":0,"963":0,"964":0,"966":0,"969":0,"977":0,"978":0,"980":0,"981":0,"983":0,"984":0,"985":0,"986":0,"996":0,"1001":0};-_yuitest_coverage["build/editor-selection/editor-selection.js"].functions = {"EditorSelection:20":0,"removeFontFamily:130":0,"(anonymous 2):159":0,"(anonymous 3):189":0,"(anonymous 4):213":0,"(anonymous 5):220":0,"(anonymous 6):231":0,"filter:149":0,"(anonymous 7):298":0,"filterBlocks:249":0,"_wrapBlock:372":0,"(anonymous 8):398":0,"(anonymous 9):410":0,"(anonymous 10):419":0,"unfilter:392":0,"resolve:451":0,"getText:472":0,"hasCursor:529":0,"(anonymous 11):543":0,"cleanCursor:539":0,"_wrap:633":0,"_swap:648":0,"(anonymous 12):667":0,"getSelected:661":0,"insertContent:684":0,"(anonymous 13):739":0,"insertAtCursor:696":0,"(anonymous 14):809":0,"wrapContent:802":0,"replace:852":0,"remove:878":0,"createRange:889":0,"selectNode:904":0,"setCursor:941":0,"getCursor:950":0,"removeCursor:959":0,"(anonymous 15):985":0,"focusCursor:976":0,"toString:995":0,"(anonymous 1):1":0};-_yuitest_coverage["build/editor-selection/editor-selection.js"].coveredLines = 387;+_yuitest_coverage["build/editor-selection/editor-selection.js"].code=["YUI.add('editor-selection', function (Y, NAME) {",""," /**"," * Wraps some common Selection/Range functionality into a simple object"," * @class EditorSelection"," * @constructor"," * @module editor"," * @submodule selection"," */",""," //TODO This shouldn't be there, Y.Node doesn't normalize getting textnode content."," var textContent = 'textContent',"," INNER_HTML = 'innerHTML',"," FONT_FAMILY = 'fontFamily';",""," if (Y.UA.ie) {"," textContent = 'nodeValue';"," }",""," Y.EditorSelection = function(domEvent) {"," var sel, par, ieNode, nodes, rng, i,"," comp, moved = 0, n, id;",""," if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) {"," sel = Y.config.win.getSelection();"," } else if (Y.config.doc.selection) {"," sel = Y.config.doc.selection.createRange();"," }"," this._selection = sel;",""," if (!sel) {"," return false;"," }",""," if (sel.pasteHTML) {"," this.isCollapsed = (sel.compareEndPoints('StartToEnd', sel)) ? false : true;"," if (this.isCollapsed) {"," this.anchorNode = this.focusNode = Y.one(sel.parentElement());",""," if (domEvent) {"," ieNode = Y.config.doc.elementFromPoint(domEvent.clientX, domEvent.clientY);"," }"," rng = sel.duplicate();"," if (!ieNode) {"," par = sel.parentElement();"," nodes = par.childNodes;",""," for (i = 0; i < nodes.length; i++) {"," //This causes IE to not allow a selection on a doubleclick"," //rng.select(nodes[i]);"," if (rng.inRange(sel)) {"," if (!ieNode) {"," ieNode = nodes[i];"," }"," }"," }"," }",""," this.ieNode = ieNode;",""," if (ieNode) {"," if (ieNode.nodeType !== 3) {"," if (ieNode.firstChild) {"," ieNode = ieNode.firstChild;"," }"," if (ieNode && ieNode.tagName && ieNode.tagName.toLowerCase() === 'body') {"," if (ieNode.firstChild) {"," ieNode = ieNode.firstChild;"," }"," }"," }"," this.anchorNode = this.focusNode = Y.EditorSelection.resolve(ieNode);",""," rng.moveToElementText(sel.parentElement());"," comp = sel.compareEndPoints('StartToStart', rng);"," if (comp) {"," //We are not at the beginning of the selection."," //Setting the move to something large, may need to increase it later"," moved = Math.abs(sel.move('character', -9999));"," }",""," this.anchorOffset = this.focusOffset = moved;",""," this.anchorTextNode = this.focusTextNode = Y.one(ieNode);"," }","",""," } else {"," //This helps IE deal with a selection and nodeChange events"," if (sel.htmlText && sel.htmlText !== '') {"," n = Y.Node.create(sel.htmlText);"," if (n && n.get('id')) {"," id = n.get('id');"," this.anchorNode = this.focusNode = Y.one('#' + id);"," } else if (n) {"," n = n.get('childNodes');"," this.anchorNode = this.focusNode = n.item(0);"," }"," }"," }",""," //var self = this;"," //debugger;"," } else {"," this.isCollapsed = sel.isCollapsed;"," this.anchorNode = Y.EditorSelection.resolve(sel.anchorNode);"," this.focusNode = Y.EditorSelection.resolve(sel.focusNode);"," this.anchorOffset = sel.anchorOffset;"," this.focusOffset = sel.focusOffset;",""," this.anchorTextNode = Y.one(sel.anchorNode);"," this.focusTextNode = Y.one(sel.focusNode);"," }"," if (Y.Lang.isString(sel.text)) {"," this.text = sel.text;"," } else {"," if (sel.toString) {"," this.text = sel.toString();"," } else {"," this.text = '';"," }"," }"," };",""," /**"," * Utility method to remove dead font-family styles from an element."," * @static"," * @method removeFontFamily"," */"," Y.EditorSelection.removeFontFamily = function(n) {"," n.removeAttribute('face');"," var s = n.getAttribute('style').toLowerCase();"," if (s === '' || (s === 'font-family: ')) {"," n.removeAttribute('style');"," }"," if (s.match(Y.EditorSelection.REG_FONTFAMILY)) {"," s = s.replace(Y.EditorSelection.REG_FONTFAMILY, '');"," n.setAttribute('style', s);"," }"," };",""," /**"," * Performs a prefilter on all nodes in the editor. Looks for nodes with a style: fontFamily or font face"," * It then creates a dynamic class assigns it and removed the property. This is so that we don't lose"," * the fontFamily when selecting nodes."," * @static"," * @method filter"," */"," Y.EditorSelection.filter = function(blocks) {",""," var startTime = (new Date()).getTime(),"," endTime,"," nodes = Y.all(Y.EditorSelection.ALL),"," baseNodes = Y.all('strong,em'),"," doc = Y.config.doc, hrs,"," classNames = {}, cssString = '',"," ls, startTime1 = (new Date()).getTime(),"," endTime1;",""," nodes.each(function(n) {"," var raw = Y.Node.getDOMNode(n);"," if (raw.style[FONT_FAMILY]) {"," classNames['.' + n._yuid] = raw.style[FONT_FAMILY];"," n.addClass(n._yuid);",""," Y.EditorSelection.removeFontFamily(raw);"," }"," });"," endTime1 = (new Date()).getTime();",""," Y.all('.hr').addClass('yui-skip').addClass('yui-non');",""," if (Y.UA.ie) {"," hrs = doc.getElementsByTagName('hr');"," Y.each(hrs, function(hr) {"," var el = doc.createElement('div'),"," s = el.style;",""," el.className = 'hr yui-non yui-skip';",""," el.setAttribute('readonly', true);"," el.setAttribute('contenteditable', false); //Keep it from being Edited"," if (hr.parentNode) {"," hr.parentNode.replaceChild(el, hr);"," }"," //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');"," s.border = '1px solid #ccc';"," s.lineHeight = '0';"," s.height = '0';"," s.fontSize = '0';"," s.marginTop = '5px';"," s.marginBottom = '5px';"," s.marginLeft = '0px';"," s.marginRight = '0px';"," s.padding = '0';"," });"," }","",""," Y.each(classNames, function(v, k) {"," cssString += k + ' { font-family: ' + v.replace(/\"/gi, '') + '; }';"," });"," Y.StyleSheet(cssString, 'editor');","",""," //Not sure about this one?"," baseNodes.each(function(n, k) {"," var t = n.get('tagName').toLowerCase(),"," newTag = 'i';"," if (t === 'strong') {"," newTag = 'b';"," }"," Y.EditorSelection.prototype._swap(baseNodes.item(k), newTag);"," });",""," //Filter out all the empty UL/OL's"," ls = Y.all('ol,ul');"," ls.each(function(v) {"," var lis = v.all('li');"," if (!lis.size()) {"," v.remove();"," }"," });",""," if (blocks) {"," Y.EditorSelection.filterBlocks();"," }"," endTime = (new Date()).getTime();"," };",""," /**"," * Method attempts to replace all \"orphined\" text nodes in the main body by wrapping them with a <p>. Called from filter."," * @static"," * @method filterBlocks"," */"," Y.EditorSelection.filterBlocks = function() {"," var startTime = (new Date()).getTime(), endTime,"," childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,"," sel, single, br, c, s, html;",""," if (childs) {"," for (i = 0; i < childs.length; i++) {"," node = Y.one(childs[i]);"," if (!node.test(Y.EditorSelection.BLOCKS)) {"," doit = true;"," if (childs[i].nodeType === 3) {"," c = childs[i][textContent].match(Y.EditorSelection.REG_CHAR);"," s = childs[i][textContent].match(Y.EditorSelection.REG_NON);"," if (c === null && s) {"," doit = false;",""," }"," }"," if (doit) {"," if (!wrapped) {"," wrapped = [];"," }"," wrapped.push(childs[i]);"," }"," } else {"," wrapped = Y.EditorSelection._wrapBlock(wrapped);"," }"," }"," wrapped = Y.EditorSelection._wrapBlock(wrapped);"," }",""," single = Y.all(Y.EditorSelection.DEFAULT_BLOCK_TAG);"," if (single.size() === 1) {"," br = single.item(0).all('br');"," if (br.size() === 1) {"," if (!br.item(0).test('.yui-cursor')) {"," br.item(0).remove();"," }"," html = single.item(0).get('innerHTML');"," if (html === '' || html === ' ') {"," single.set('innerHTML', Y.EditorSelection.CURSOR);"," sel = new Y.EditorSelection();"," sel.focusCursor(true, true);"," }"," if (br.item(0).test('.yui-cursor') && Y.UA.ie) {"," br.item(0).remove();"," }"," }"," } else {"," single.each(function(p) {"," var html = p.get('innerHTML');"," if (html === '') {"," p.remove();"," }"," });"," }",""," endTime = (new Date()).getTime();"," };",""," /**"," * Regular Expression used to find dead font-family styles"," * @static"," * @property REG_FONTFAMILY"," */"," Y.EditorSelection.REG_FONTFAMILY = /font-family:\\s*;/;",""," /**"," * Regular Expression to determine if a string has a character in it"," * @static"," * @property REG_CHAR"," */"," Y.EditorSelection.REG_CHAR = /[a-zA-Z-0-9_!@#\\$%\\^&*\\(\\)-=_+\\[\\]\\\\{}|;':\",.\\/<>\\?]/gi;",""," /**"," * Regular Expression to determine if a string has a non-character in it"," * @static"," * @property REG_NON"," */"," Y.EditorSelection.REG_NON = /[\\s|\\n|\\t]/gi;",""," /**"," * Regular Expression to remove all HTML from a string"," * @static"," * @property REG_NOHTML"," */"," Y.EditorSelection.REG_NOHTML = /<\\S[^><]*>/g;","",""," /**"," * Wraps an array of elements in a Block level tag"," * @static"," * @private"," * @method _wrapBlock"," */"," Y.EditorSelection._wrapBlock = function(wrapped) {"," if (wrapped) {"," var newChild = Y.Node.create('<' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '></' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '>'),"," firstChild = Y.one(wrapped[0]), i;",""," for (i = 1; i < wrapped.length; i++) {"," newChild.append(wrapped[i]);"," }"," firstChild.replace(newChild);"," newChild.prepend(firstChild);"," }"," return false;"," };",""," /**"," * Undoes what filter does enough to return the HTML from the Editor, then re-applies the filter."," * @static"," * @method unfilter"," * @return {String} The filtered HTML"," */"," Y.EditorSelection.unfilter = function() {"," var nodes = Y.all('body [class]'),"," html = '', nons, ids,"," body = Y.one('body');","",""," nodes.each(function(n) {"," if (n.hasClass(n._yuid)) {"," //One of ours"," n.setStyle(FONT_FAMILY, n.getStyle(FONT_FAMILY));"," n.removeClass(n._yuid);"," if (n.getAttribute('class') === '') {"," n.removeAttribute('class');"," }"," }"," });",""," nons = Y.all('.yui-non');"," nons.each(function(n) {"," if (!n.hasClass('yui-skip') && n.get('innerHTML') === '') {"," n.remove();"," } else {"," n.removeClass('yui-non').removeClass('yui-skip');"," }"," });",""," ids = Y.all('body [id]');"," ids.each(function(n) {"," if (n.get('id').indexOf('yui_3_') === 0) {"," n.removeAttribute('id');"," n.removeAttribute('_yuid');"," }"," });",""," if (body) {"," html = body.get('innerHTML');"," }",""," Y.all('.hr').addClass('yui-skip').addClass('yui-non');",""," /*"," nodes.each(function(n) {"," n.addClass(n._yuid);"," n.setStyle(FONT_FAMILY, '');"," if (n.getAttribute('style') === '') {"," n.removeAttribute('style');"," }"," });"," */",""," return html;"," };"," /**"," * Resolve a node from the selection object and return a Node instance"," * @static"," * @method resolve"," * @param {HTMLElement} n The HTMLElement to resolve. Might be a TextNode, gives parentNode."," * @return {Node} The Resolved node"," */"," Y.EditorSelection.resolve = function(n) {"," if (n && n.nodeType === 3) {"," //Adding a try/catch here because in rare occasions IE will"," //Throw a error accessing the parentNode of a stranded text node."," //In the case of Ctrl+Z (Undo)"," try {"," n = n.parentNode;"," } catch (re) {"," n = 'body';"," }"," }"," return Y.one(n);"," };",""," /**"," * Returns the innerHTML of a node with all HTML tags removed."," * @static"," * @method getText"," * @param {Node} node The Node instance to remove the HTML from"," * @return {String} The string of text"," */"," Y.EditorSelection.getText = function(node) {"," var txt = node.get('innerHTML').replace(Y.EditorSelection.REG_NOHTML, '');"," //Clean out the cursor subs to see if the Node is empty"," txt = txt.replace('<span><br></span>', '').replace('<br>', '');"," return txt;"," };",""," //Y.EditorSelection.DEFAULT_BLOCK_TAG = 'div';"," Y.EditorSelection.DEFAULT_BLOCK_TAG = 'p';",""," /**"," * The selector to use when looking for Nodes to cache the value of: [style],font[face]"," * @static"," * @property ALL"," */"," Y.EditorSelection.ALL = '[style],font[face]';",""," /**"," * The selector to use when looking for block level items."," * @static"," * @property BLOCKS"," */"," Y.EditorSelection.BLOCKS = 'p,div,ul,ol,table,style';"," /**"," * The temporary fontname applied to a selection to retrieve their values: yui-tmp"," * @static"," * @property TMP"," */"," Y.EditorSelection.TMP = 'yui-tmp';"," /**"," * The default tag to use when creating elements: span"," * @static"," * @property DEFAULT_TAG"," */"," Y.EditorSelection.DEFAULT_TAG = 'span';",""," /**"," * The id of the outer cursor wrapper"," * @static"," * @property DEFAULT_TAG"," */"," Y.EditorSelection.CURID = 'yui-cursor';",""," /**"," * The id used to wrap the inner space of the cursor position"," * @static"," * @property CUR_WRAPID"," */"," Y.EditorSelection.CUR_WRAPID = 'yui-cursor-wrapper';",""," /**"," * The default HTML used to focus the cursor.."," * @static"," * @property CURSOR"," */"," Y.EditorSelection.CURSOR = '<span><br class=\"yui-cursor\"></span>';",""," Y.EditorSelection.hasCursor = function() {"," var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID);"," return cur.size();"," };",""," /**"," * Called from Editor keydown to remove the \"extra\" space before the cursor."," * @static"," * @method cleanCursor"," */"," Y.EditorSelection.cleanCursor = function() {"," var cur, sel = 'br.yui-cursor';"," cur = Y.all(sel);"," if (cur.size()) {"," cur.each(function(b) {"," var c = b.get('parentNode.parentNode.childNodes'), html;"," if (c.size()) {"," b.remove();"," } else {"," html = Y.EditorSelection.getText(c.item(0));"," if (html !== '') {"," b.remove();"," }"," }"," });"," }"," /*"," var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID);"," if (cur.size()) {"," cur.each(function(c) {"," var html = c.get('innerHTML');"," if (html == ' ' || html == '<br>') {"," if (c.previous() || c.next()) {"," c.remove();"," }"," }"," });"," }"," */"," };",""," Y.EditorSelection.prototype = {"," /**"," * Range text value"," * @property text"," * @type String"," */"," text: null,"," /**"," * Flag to show if the range is collapsed or not"," * @property isCollapsed"," * @type Boolean"," */"," isCollapsed: null,"," /**"," * A Node instance of the parentNode of the anchorNode of the range"," * @property anchorNode"," * @type Node"," */"," anchorNode: null,"," /**"," * The offset from the range object"," * @property anchorOffset"," * @type Number"," */"," anchorOffset: null,"," /**"," * A Node instance of the actual textNode of the range."," * @property anchorTextNode"," * @type Node"," */"," anchorTextNode: null,"," /**"," * A Node instance of the parentNode of the focusNode of the range"," * @property focusNode"," * @type Node"," */"," focusNode: null,"," /**"," * The offset from the range object"," * @property focusOffset"," * @type Number"," */"," focusOffset: null,"," /**"," * A Node instance of the actual textNode of the range."," * @property focusTextNode"," * @type Node"," */"," focusTextNode: null,"," /**"," * The actual Selection/Range object"," * @property _selection"," * @private"," */"," _selection: null,"," /**"," * Wrap an element, with another element"," * @private"," * @method _wrap"," * @param {HTMLElement} n The node to wrap"," * @param {String} tag The tag to use when creating the new element."," * @return {HTMLElement} The wrapped node"," */"," _wrap: function(n, tag) {"," var tmp = Y.Node.create('<' + tag + '></' + tag + '>');"," tmp.set(INNER_HTML, n.get(INNER_HTML));"," n.set(INNER_HTML, '');"," n.append(tmp);"," return Y.Node.getDOMNode(tmp);"," },"," /**"," * Swap an element, with another element"," * @private"," * @method _swap"," * @param {HTMLElement} n The node to swap"," * @param {String} tag The tag to use when creating the new element."," * @return {HTMLElement} The new node"," */"," _swap: function(n, tag) {"," var tmp = Y.Node.create('<' + tag + '></' + tag + '>');"," tmp.set(INNER_HTML, n.get(INNER_HTML));"," n.replace(tmp, n);"," return Y.Node.getDOMNode(tmp);"," },"," /**"," * Get all the nodes in the current selection. This method will actually perform a filter first."," * Then it calls doc.execCommand('fontname', null, 'yui-tmp') to touch all nodes in the selection."," * The it compiles a list of all nodes affected by the execCommand and builds a NodeList to return."," * @method getSelected"," * @return {NodeList} A NodeList of all items in the selection."," */"," getSelected: function() {"," Y.EditorSelection.filter();"," Y.config.doc.execCommand('fontname', null, Y.EditorSelection.TMP);"," var nodes = Y.all(Y.EditorSelection.ALL),"," items = [];",""," nodes.each(function(n, k) {"," if (n.getStyle(FONT_FAMILY) === Y.EditorSelection.TMP) {"," n.setStyle(FONT_FAMILY, '');"," Y.EditorSelection.removeFontFamily(n);"," if (!n.test('body')) {"," items.push(Y.Node.getDOMNode(nodes.item(k)));"," }"," }"," });"," return Y.all(items);"," },"," /**"," * Insert HTML at the current cursor position and return a Node instance of the newly inserted element."," * @method insertContent"," * @param {String} html The HTML to insert."," * @return {Node} The inserted Node."," */"," insertContent: function(html) {"," return this.insertAtCursor(html, this.anchorTextNode, this.anchorOffset, true);"," },"," /**"," * Insert HTML at the current cursor position, this method gives you control over the text node to insert into and the offset where to put it."," * @method insertAtCursor"," * @param {String} html The HTML to insert."," * @param {Node} node The text node to break when inserting."," * @param {Number} offset The left offset of the text node to break and insert the new content."," * @param {Boolean} collapse Should the range be collapsed after insertion. default: false"," * @return {Node} The inserted Node."," */"," insertAtCursor: function(html, node, offset, collapse) {"," var cur = Y.Node.create('<' + Y.EditorSelection.DEFAULT_TAG + ' class=\"yui-non\"></' + Y.EditorSelection.DEFAULT_TAG + '>'),"," inHTML, txt, txt2, newNode, range = this.createRange(), b;",""," if (node && node.test('body')) {"," b = Y.Node.create('<span></span>');"," node.append(b);"," node = b;"," }","",""," if (range.pasteHTML) {"," if (offset === 0 && node && !node.previous() && node.get('nodeType') === 3) {"," /*"," * For some strange reason, range.pasteHTML fails if the node is a textNode and"," * the offset is 0. (The cursor is at the beginning of the line)"," * It will always insert the new content at position 1 instead of"," * position 0. Here we test for that case and do it the hard way."," */"," node.insert(html, 'before');"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(node.previous()));"," }"," //Move the cursor after the new node"," range.collapse(false);"," range.select();"," return node.previous();"," } else {"," newNode = Y.Node.create(html);"," try {"," range.pasteHTML('<span id=\"rte-insert\"></span>');"," } catch (e) {}"," inHTML = Y.one('#rte-insert');"," if (inHTML) {"," inHTML.set('id', '');"," inHTML.replace(newNode);"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(newNode));"," }"," range.collapse(false);"," range.select();"," return newNode;"," } else {"," Y.on('available', function() {"," inHTML.set('id', '');"," inHTML.replace(newNode);"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(newNode));"," }"," range.collapse(false);"," range.select();"," }, '#rte-insert');"," }"," }"," } else {"," //TODO using Y.Node.create here throws warnings & strips first white space character"," //txt = Y.one(Y.Node.create(inHTML.substr(0, offset)));"," //txt2 = Y.one(Y.Node.create(inHTML.substr(offset)));"," if (offset > 0) {"," inHTML = node.get(textContent);",""," txt = Y.one(Y.config.doc.createTextNode(inHTML.substr(0, offset)));"," txt2 = Y.one(Y.config.doc.createTextNode(inHTML.substr(offset)));",""," node.replace(txt, node);"," newNode = Y.Node.create(html);"," if (newNode.get('nodeType') === 11) {"," b = Y.Node.create('<span></span>');"," b.append(newNode);"," newNode = b;"," }"," txt.insert(newNode, 'after');"," //if (txt2 && txt2.get('length')) {"," if (txt2) {"," newNode.insert(cur, 'after');"," cur.insert(txt2, 'after');"," this.selectNode(cur, collapse);"," }"," } else {"," if (node.get('nodeType') === 3) {"," node = node.get('parentNode');"," }"," newNode = Y.Node.create(html);"," html = node.get('innerHTML').replace(/\\n/gi, '');"," if (html === '' || html === '<br>') {"," node.append(newNode);"," } else {"," if (newNode.get('parentNode')) {"," node.insert(newNode, 'before');"," } else {"," Y.one('body').prepend(newNode);"," }"," }"," if (node.get('firstChild').test('br')) {"," node.get('firstChild').remove();"," }"," }"," }"," return newNode;"," },"," /**"," * Get all elements inside a selection and wrap them with a new element and return a NodeList of all elements touched."," * @method wrapContent"," * @param {String} tag The tag to wrap all selected items with."," * @return {NodeList} A NodeList of all items in the selection."," */"," wrapContent: function(tag) {"," tag = (tag) ? tag : Y.EditorSelection.DEFAULT_TAG;",""," if (!this.isCollapsed) {"," var items = this.getSelected(),"," changed = [], range, last, first, range2;",""," items.each(function(n, k) {"," var t = n.get('tagName').toLowerCase();"," if (t === 'font') {"," changed.push(this._swap(items.item(k), tag));"," } else {"," changed.push(this._wrap(items.item(k), tag));"," }"," }, this);",""," range = this.createRange();"," first = changed[0];"," last = changed[changed.length - 1];"," if (this._selection.removeAllRanges) {"," range.setStart(changed[0], 0);"," range.setEnd(last, last.childNodes.length);"," this._selection.removeAllRanges();"," this._selection.addRange(range);"," } else {"," if (range.moveToElementText) {"," range.moveToElementText(Y.Node.getDOMNode(first));"," range2 = this.createRange();"," range2.moveToElementText(Y.Node.getDOMNode(last));"," range.setEndPoint('EndToEnd', range2);"," }"," range.select();"," }",""," changed = Y.all(changed);"," return changed;","",""," } else {"," return Y.all([]);"," }"," },"," /**"," * Find and replace a string inside a text node and replace it with HTML focusing the node after"," * to allow you to continue to type."," * @method replace"," * @param {String} se The string to search for."," * @param {String} re The string of HTML to replace it with."," * @return {Node} The node inserted."," */"," replace: function(se,re) {"," var range = this.createRange(), node, txt, index, newNode;",""," if (range.getBookmark) {"," index = range.getBookmark();"," txt = this.anchorNode.get('innerHTML').replace(se, re);"," this.anchorNode.set('innerHTML', txt);"," range.moveToBookmark(index);"," newNode = Y.one(range.parentElement());"," } else {"," node = this.anchorTextNode;"," txt = node.get(textContent);"," index = txt.indexOf(se);",""," txt = txt.replace(se, '');"," node.set(textContent, txt);"," newNode = this.insertAtCursor(re, node, index, true);"," }"," return newNode;"," },"," /**"," * Destroy the range."," * @method remove"," * @chainable"," * @return {EditorSelection}"," */"," remove: function() {"," if (this._selection && this._selection.removeAllRanges) {"," this._selection.removeAllRanges();"," }"," return this;"," },"," /**"," * Wrapper for the different range creation methods."," * @method createRange"," * @return {RangeObject}"," */"," createRange: function() {"," if (Y.config.doc.selection) {"," return Y.config.doc.selection.createRange();"," } else {"," return Y.config.doc.createRange();"," }"," },"," /**"," * Select a Node (hilighting it)."," * @method selectNode"," * @param {Node} node The node to select"," * @param {Boolean} collapse Should the range be collapsed after insertion. default: false"," * @chainable"," * @return {EditorSelection}"," */"," selectNode: function(node, collapse, end) {"," if (!node) {"," return;"," }"," end = end || 0;"," node = Y.Node.getDOMNode(node);"," var range = this.createRange();"," if (range.selectNode) {"," range.selectNode(node);"," this._selection.removeAllRanges();"," this._selection.addRange(range);"," if (collapse) {"," try {"," this._selection.collapse(node, end);"," } catch (err) {"," this._selection.collapse(node, 0);"," }"," }"," } else {"," if (node.nodeType === 3) {"," node = node.parentNode;"," }"," try {"," range.moveToElementText(node);"," } catch(e) {}"," if (collapse) {"," range.collapse(((end) ? false : true));"," }"," range.select();"," }"," return this;"," },"," /**"," * Put a placeholder in the DOM at the current cursor position."," * @method setCursor"," * @return {Node}"," */"," setCursor: function() {"," this.removeCursor(false);"," return this.insertContent(Y.EditorSelection.CURSOR);"," },"," /**"," * Get the placeholder in the DOM at the current cursor position."," * @method getCursor"," * @return {Node}"," */"," getCursor: function() {"," return Y.all('#' + Y.EditorSelection.CURID);"," },"," /**"," * Remove the cursor placeholder from the DOM."," * @method removeCursor"," * @param {Boolean} keep Setting this to true will keep the node, but remove the unique parts that make it the cursor."," * @return {Node}"," */"," removeCursor: function(keep) {"," var cur = this.getCursor();"," if (cur) {"," if (keep) {"," cur.removeAttribute('id');"," cur.set('innerHTML', '<br class=\"yui-cursor\">');"," } else {"," cur.remove();"," }"," }"," return cur;"," },"," /**"," * Gets a stored cursor and focuses it for editing, must be called sometime after setCursor"," * @method focusCursor"," * @return {Node}"," */"," focusCursor: function(collapse, end) {"," if (collapse !== false) {"," collapse = true;"," }"," if (end !== false) {"," end = true;"," }"," var cur = this.removeCursor(true);"," if (cur) {"," cur.each(function(c) {"," this.selectNode(c, collapse, end);"," }, this);"," }"," },"," /**"," * Generic toString for logging."," * @method toString"," * @return {String}"," */"," toString: function() {"," return 'EditorSelection Object';"," }"," };",""," //TODO Remove this alias in 3.6.0"," Y.Selection = Y.EditorSelection;","","","","}, '3.7.3', {\"requires\": [\"node\"]});"];+_yuitest_coverage["build/editor-selection/editor-selection.js"].lines = {"1":0,"12":0,"16":0,"17":0,"20":0,"21":0,"24":0,"25":0,"26":0,"27":0,"29":0,"31":0,"32":0,"35":0,"36":0,"37":0,"38":0,"40":0,"41":0,"43":0,"44":0,"45":0,"46":0,"48":0,"51":0,"52":0,"53":0,"59":0,"61":0,"62":0,"63":0,"64":0,"66":0,"67":0,"68":0,"72":0,"74":0,"75":0,"76":0,"79":0,"82":0,"84":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"105":0,"106":0,"107":0,"108":0,"109":0,"111":0,"112":0,"114":0,"115":0,"117":0,"118":0,"120":0,"130":0,"131":0,"132":0,"133":0,"134":0,"136":0,"137":0,"138":0,"149":0,"151":0,"160":0,"161":0,"162":0,"163":0,"164":0,"166":0,"169":0,"171":0,"173":0,"174":0,"175":0,"176":0,"179":0,"181":0,"182":0,"183":0,"184":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"200":0,"201":0,"203":0,"207":0,"208":0,"210":0,"211":0,"213":0,"217":0,"218":0,"219":0,"220":0,"221":0,"225":0,"226":0,"228":0,"236":0,"237":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"254":0,"255":0,"256":0,"258":0,"261":0,"264":0,"267":0,"268":0,"269":0,"270":0,"271":0,"272":0,"274":0,"275":0,"276":0,"277":0,"278":0,"280":0,"281":0,"285":0,"286":0,"287":0,"288":0,"293":0,"301":0,"308":0,"315":0,"322":0,"331":0,"332":0,"333":0,"336":0,"337":0,"339":0,"340":0,"342":0,"351":0,"352":0,"357":0,"358":0,"360":0,"361":0,"362":0,"363":0,"368":0,"369":0,"370":0,"371":0,"373":0,"377":0,"378":0,"379":0,"380":0,"381":0,"385":0,"386":0,"389":0,"401":0,"410":0,"411":0,"415":0,"416":0,"418":0,"421":0,"431":0,"432":0,"434":0,"435":0,"439":0,"446":0,"453":0,"459":0,"465":0,"472":0,"479":0,"486":0,"488":0,"489":0,"490":0,"498":0,"499":0,"500":0,"501":0,"502":0,"503":0,"504":0,"505":0,"507":0,"508":0,"509":0,"529":0,"593":0,"594":0,"595":0,"596":0,"597":0,"608":0,"609":0,"610":0,"611":0,"621":0,"622":0,"623":0,"626":0,"627":0,"628":0,"629":0,"630":0,"631":0,"635":0,"644":0,"656":0,"659":0,"660":0,"661":0,"662":0,"666":0,"667":0,"674":0,"675":0,"676":0,"679":0,"680":0,"681":0,"683":0,"684":0,"685":0,"687":0,"688":0,"689":0,"690":0,"691":0,"692":0,"694":0,"695":0,"696":0,"698":0,"699":0,"700":0,"701":0,"702":0,"704":0,"705":0,"713":0,"714":0,"716":0,"717":0,"719":0,"720":0,"721":0,"722":0,"723":0,"724":0,"726":0,"728":0,"729":0,"730":0,"731":0,"734":0,"735":0,"737":0,"738":0,"739":0,"740":0,"742":0,"743":0,"745":0,"748":0,"749":0,"753":0,"762":0,"764":0,"765":0,"768":0,"769":0,"770":0,"771":0,"773":0,"777":0,"778":0,"779":0,"780":0,"781":0,"782":0,"783":0,"784":0,"786":0,"787":0,"788":0,"789":0,"790":0,"792":0,"795":0,"796":0,"800":0,"812":0,"814":0,"815":0,"816":0,"817":0,"818":0,"819":0,"821":0,"822":0,"823":0,"825":0,"826":0,"827":0,"829":0,"838":0,"839":0,"841":0,"849":0,"850":0,"852":0,"864":0,"865":0,"867":0,"868":0,"869":0,"870":0,"871":0,"872":0,"873":0,"874":0,"875":0,"876":0,"878":0,"882":0,"883":0,"885":0,"886":0,"888":0,"889":0,"891":0,"893":0,"901":0,"902":0,"910":0,"919":0,"920":0,"921":0,"922":0,"923":0,"925":0,"928":0,"936":0,"937":0,"939":0,"940":0,"942":0,"943":0,"944":0,"945":0,"955":0,"960":0};+_yuitest_coverage["build/editor-selection/editor-selection.js"].functions = {"EditorSelection:20":0,"removeFontFamily:130":0,"(anonymous 2):160":0,"(anonymous 3):175":0,"(anonymous 4):200":0,"(anonymous 5):207":0,"(anonymous 6):218":0,"filter:149":0,"(anonymous 7):285":0,"filterBlocks:236":0,"_wrapBlock:331":0,"(anonymous 8):357":0,"(anonymous 9):369":0,"(anonymous 10):378":0,"unfilter:351":0,"resolve:410":0,"getText:431":0,"hasCursor:488":0,"(anonymous 11):502":0,"cleanCursor:498":0,"_wrap:592":0,"_swap:607":0,"(anonymous 12):626":0,"getSelected:620":0,"insertContent:643":0,"(anonymous 13):698":0,"insertAtCursor:655":0,"(anonymous 14):768":0,"wrapContent:761":0,"replace:811":0,"remove:837":0,"createRange:848":0,"selectNode:863":0,"setCursor:900":0,"getCursor:909":0,"removeCursor:918":0,"(anonymous 15):944":0,"focusCursor:935":0,"toString:954":0,"(anonymous 1):1":0};+_yuitest_coverage["build/editor-selection/editor-selection.js"].coveredLines = 382; _yuitest_coverage["build/editor-selection/editor-selection.js"].coveredFunctions = 40; _yuitest_coverline("build/editor-selection/editor-selection.js", 1); YUI.add('editor-selection', function (Y, NAME) {@@ -47,7 +47,7 @@ * @module editor * @submodule selection */- + //TODO This shouldn't be there, Y.Node doesn't normalize getting textnode content. _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 1)", 1); _yuitest_coverline("build/editor-selection/editor-selection.js", 12);@@ -65,93 +65,93 @@ Y.EditorSelection = function(domEvent) { _yuitest_coverfunc("build/editor-selection/editor-selection.js", "EditorSelection", 20); _yuitest_coverline("build/editor-selection/editor-selection.js", 21);-var sel, par, ieNode, nodes, rng, i;+var sel, par, ieNode, nodes, rng, i,+ comp, moved = 0, n, id; - _yuitest_coverline("build/editor-selection/editor-selection.js", 23);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 24); if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 24);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 25); sel = Y.config.win.getSelection();- } else {_yuitest_coverline("build/editor-selection/editor-selection.js", 25);+ } else {_yuitest_coverline("build/editor-selection/editor-selection.js", 26); if (Y.config.doc.selection) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 26);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 27); sel = Y.config.doc.selection.createRange(); }}- _yuitest_coverline("build/editor-selection/editor-selection.js", 28);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 29); this._selection = sel; - _yuitest_coverline("build/editor-selection/editor-selection.js", 30);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 31); if (!sel) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 31);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 32); return false; } - _yuitest_coverline("build/editor-selection/editor-selection.js", 34);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 35); if (sel.pasteHTML) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 35);-this.isCollapsed = (sel.compareEndPoints('StartToEnd', sel)) ? false : true; _yuitest_coverline("build/editor-selection/editor-selection.js", 36);+this.isCollapsed = (sel.compareEndPoints('StartToEnd', sel)) ? false : true;+ _yuitest_coverline("build/editor-selection/editor-selection.js", 37); if (this.isCollapsed) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 37);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 38); this.anchorNode = this.focusNode = Y.one(sel.parentElement()); - _yuitest_coverline("build/editor-selection/editor-selection.js", 39);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 40); if (domEvent) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 40);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 41); ieNode = Y.config.doc.elementFromPoint(domEvent.clientX, domEvent.clientY); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 42);-rng = sel.duplicate(); _yuitest_coverline("build/editor-selection/editor-selection.js", 43);+rng = sel.duplicate();+ _yuitest_coverline("build/editor-selection/editor-selection.js", 44); if (!ieNode) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 44);-par = sel.parentElement(); _yuitest_coverline("build/editor-selection/editor-selection.js", 45);+par = sel.parentElement();+ _yuitest_coverline("build/editor-selection/editor-selection.js", 46); nodes = par.childNodes; - _yuitest_coverline("build/editor-selection/editor-selection.js", 47);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 48); for (i = 0; i < nodes.length; i++) { //This causes IE to not allow a selection on a doubleclick //rng.select(nodes[i]);- _yuitest_coverline("build/editor-selection/editor-selection.js", 50);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 51); if (rng.inRange(sel)) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 51);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 52); if (!ieNode) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 52);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 53); ieNode = nodes[i]; } } } } - _yuitest_coverline("build/editor-selection/editor-selection.js", 58);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 59); this.ieNode = ieNode;- - _yuitest_coverline("build/editor-selection/editor-selection.js", 60);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 61); if (ieNode) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 61);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 62); if (ieNode.nodeType !== 3) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 62);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 63); if (ieNode.firstChild) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 63);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 64); ieNode = ieNode.firstChild; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 65);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 66); if (ieNode && ieNode.tagName && ieNode.tagName.toLowerCase() === 'body') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 66);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 67); if (ieNode.firstChild) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 67);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 68); ieNode = ieNode.firstChild; } } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 71);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 72); this.anchorNode = this.focusNode = Y.EditorSelection.resolve(ieNode);- - _yuitest_coverline("build/editor-selection/editor-selection.js", 73);-rng.moveToElementText(sel.parentElement());+ _yuitest_coverline("build/editor-selection/editor-selection.js", 74);-var comp = sel.compareEndPoints('StartToStart', rng),- moved = 0;+rng.moveToElementText(sel.parentElement());+ _yuitest_coverline("build/editor-selection/editor-selection.js", 75);+comp = sel.compareEndPoints('StartToStart', rng); _yuitest_coverline("build/editor-selection/editor-selection.js", 76); if (comp) { //We are not at the beginning of the selection.@@ -159,25 +159,25 @@ _yuitest_coverline("build/editor-selection/editor-selection.js", 79); moved = Math.abs(sel.move('character', -9999)); }- + _yuitest_coverline("build/editor-selection/editor-selection.js", 82); this.anchorOffset = this.focusOffset = moved;- + _yuitest_coverline("build/editor-selection/editor-selection.js", 84); this.anchorTextNode = this.focusTextNode = Y.one(ieNode); }- - ++ } else { //This helps IE deal with a selection and nodeChange events _yuitest_coverline("build/editor-selection/editor-selection.js", 90); if (sel.htmlText && sel.htmlText !== '') { _yuitest_coverline("build/editor-selection/editor-selection.js", 91);-var n = Y.Node.create(sel.htmlText);+n = Y.Node.create(sel.htmlText); _yuitest_coverline("build/editor-selection/editor-selection.js", 92); if (n && n.get('id')) { _yuitest_coverline("build/editor-selection/editor-selection.js", 93);-var id = n.get('id');+id = n.get('id'); _yuitest_coverline("build/editor-selection/editor-selection.js", 94); this.anchorNode = this.focusNode = Y.one('#' + id); } else {_yuitest_coverline("build/editor-selection/editor-selection.js", 95);@@ -203,7 +203,7 @@ this.anchorOffset = sel.anchorOffset; _yuitest_coverline("build/editor-selection/editor-selection.js", 109); this.focusOffset = sel.focusOffset;- + _yuitest_coverline("build/editor-selection/editor-selection.js", 111); this.anchorTextNode = Y.one(sel.anchorNode); _yuitest_coverline("build/editor-selection/editor-selection.js", 112);@@ -224,7 +224,7 @@ } } };- + /** * Utility method to remove dead font-family styles from an element. * @static@@ -238,7 +238,7 @@ _yuitest_coverline("build/editor-selection/editor-selection.js", 132); var s = n.getAttribute('style').toLowerCase(); _yuitest_coverline("build/editor-selection/editor-selection.js", 133);-if (s === '' || (s == 'font-family: ')) {+if (s === '' || (s === 'font-family: ')) { _yuitest_coverline("build/editor-selection/editor-selection.js", 134); n.removeAttribute('style'); }@@ -260,150 +260,134 @@ */ _yuitest_coverline("build/editor-selection/editor-selection.js", 149); Y.EditorSelection.filter = function(blocks) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "filter", 149);-_yuitest_coverline("build/editor-selection/editor-selection.js", 150);-var startTime = (new Date()).getTime(); - _yuitest_coverline("build/editor-selection/editor-selection.js", 152);-var nodes = Y.all(Y.EditorSelection.ALL),+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "filter", 149);+_yuitest_coverline("build/editor-selection/editor-selection.js", 151);+var startTime = (new Date()).getTime(),+ endTime,+ nodes = Y.all(Y.EditorSelection.ALL), baseNodes = Y.all('strong,em'), doc = Y.config.doc, hrs, classNames = {}, cssString = '',- ls;+ ls, startTime1 = (new Date()).getTime(),+ endTime1; - _yuitest_coverline("build/editor-selection/editor-selection.js", 158);-var startTime1 = (new Date()).getTime();- _yuitest_coverline("build/editor-selection/editor-selection.js", 159);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 160); nodes.each(function(n) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 2)", 159);-_yuitest_coverline("build/editor-selection/editor-selection.js", 160);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 2)", 160);+_yuitest_coverline("build/editor-selection/editor-selection.js", 161); var raw = Y.Node.getDOMNode(n);- _yuitest_coverline("build/editor-selection/editor-selection.js", 161);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 162); if (raw.style[FONT_FAMILY]) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 162);-classNames['.' + n._yuid] = raw.style[FONT_FAMILY]; _yuitest_coverline("build/editor-selection/editor-selection.js", 163);+classNames['.' + n._yuid] = raw.style[FONT_FAMILY];+ _yuitest_coverline("build/editor-selection/editor-selection.js", 164); n.addClass(n._yuid); - _yuitest_coverline("build/editor-selection/editor-selection.js", 165);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 166); Y.EditorSelection.removeFontFamily(raw); }- /*- if (n.getStyle(FONT_FAMILY)) {- classNames['.' + n._yuid] = n.getStyle(FONT_FAMILY);- n.addClass(n._yuid);- n.removeAttribute('face');- n.setStyle(FONT_FAMILY, '');- if (n.getAttribute('style') === '') {- n.removeAttribute('style');- }- //This is for IE- if (n.getAttribute('style').toLowerCase() === 'font-family: ') {- n.removeAttribute('style');- }- }- */ });- _yuitest_coverline("build/editor-selection/editor-selection.js", 183);-var endTime1 = (new Date()).getTime();+ _yuitest_coverline("build/editor-selection/editor-selection.js", 169);+endTime1 = (new Date()).getTime(); - _yuitest_coverline("build/editor-selection/editor-selection.js", 185);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 171); Y.all('.hr').addClass('yui-skip').addClass('yui-non');- - _yuitest_coverline("build/editor-selection/editor-selection.js", 187);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 173); if (Y.UA.ie) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 188);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 174); hrs = doc.getElementsByTagName('hr');- _yuitest_coverline("build/editor-selection/editor-selection.js", 189);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 175); Y.each(hrs, function(hr) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 3)", 189);-_yuitest_coverline("build/editor-selection/editor-selection.js", 190);-var el = doc.createElement('div');- _yuitest_coverline("build/editor-selection/editor-selection.js", 191);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 3)", 175);+_yuitest_coverline("build/editor-selection/editor-selection.js", 176);+var el = doc.createElement('div'),+ s = el.style;++ _yuitest_coverline("build/editor-selection/editor-selection.js", 179); el.className = 'hr yui-non yui-skip';- - _yuitest_coverline("build/editor-selection/editor-selection.js", 193);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 181); el.setAttribute('readonly', true);- _yuitest_coverline("build/editor-selection/editor-selection.js", 194);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 182); el.setAttribute('contenteditable', false); //Keep it from being Edited- _yuitest_coverline("build/editor-selection/editor-selection.js", 195);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 183); if (hr.parentNode) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 196);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 184); hr.parentNode.replaceChild(el, hr);- }- //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');- _yuitest_coverline("build/editor-selection/editor-selection.js", 199);-var s = el.style;- _yuitest_coverline("build/editor-selection/editor-selection.js", 200);+ }+ //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');+ _yuitest_coverline("build/editor-selection/editor-selection.js", 187); s.border = '1px solid #ccc';- _yuitest_coverline("build/editor-selection/editor-selection.js", 201);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 188); s.lineHeight = '0';- _yuitest_coverline("build/editor-selection/editor-selection.js", 202);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 189); s.height = '0';- _yuitest_coverline("build/editor-selection/editor-selection.js", 203);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 190); s.fontSize = '0';- _yuitest_coverline("build/editor-selection/editor-selection.js", 204);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 191); s.marginTop = '5px';- _yuitest_coverline("build/editor-selection/editor-selection.js", 205);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 192); s.marginBottom = '5px';- _yuitest_coverline("build/editor-selection/editor-selection.js", 206);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 193); s.marginLeft = '0px';- _yuitest_coverline("build/editor-selection/editor-selection.js", 207);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 194); s.marginRight = '0px';- _yuitest_coverline("build/editor-selection/editor-selection.js", 208);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 195); s.padding = '0'; }); }- - _yuitest_coverline("build/editor-selection/editor-selection.js", 213);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 200); Y.each(classNames, function(v, k) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 4)", 213);-_yuitest_coverline("build/editor-selection/editor-selection.js", 214);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 4)", 200);+_yuitest_coverline("build/editor-selection/editor-selection.js", 201); cssString += k + ' { font-family: ' + v.replace(/"/gi, '') + '; }'; });- _yuitest_coverline("build/editor-selection/editor-selection.js", 216);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 203); Y.StyleSheet(cssString, 'editor'); - + //Not sure about this one?- _yuitest_coverline("build/editor-selection/editor-selection.js", 220);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 207); baseNodes.each(function(n, k) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 5)", 220);-_yuitest_coverline("build/editor-selection/editor-selection.js", 221);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 5)", 207);+_yuitest_coverline("build/editor-selection/editor-selection.js", 208); var t = n.get('tagName').toLowerCase(), newTag = 'i';- _yuitest_coverline("build/editor-selection/editor-selection.js", 223);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 210); if (t === 'strong') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 224);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 211); newTag = 'b'; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 226);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 213); Y.EditorSelection.prototype._swap(baseNodes.item(k), newTag); }); //Filter out all the empty UL/OL's- _yuitest_coverline("build/editor-selection/editor-selection.js", 230);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 217); ls = Y.all('ol,ul');- _yuitest_coverline("build/editor-selection/editor-selection.js", 231);-ls.each(function(v, k) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 6)", 231);-_yuitest_coverline("build/editor-selection/editor-selection.js", 232);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 218);+ls.each(function(v) {+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 6)", 218);+_yuitest_coverline("build/editor-selection/editor-selection.js", 219); var lis = v.all('li');- _yuitest_coverline("build/editor-selection/editor-selection.js", 233);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 220); if (!lis.size()) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 234);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 221); v.remove(); } });- - _yuitest_coverline("build/editor-selection/editor-selection.js", 238);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 225); if (blocks) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 239);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 226); Y.EditorSelection.filterBlocks(); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 241);-var endTime = (new Date()).getTime();+ _yuitest_coverline("build/editor-selection/editor-selection.js", 228);+endTime = (new Date()).getTime(); }; /**@@ -411,148 +395,118 @@ * @static * @method filterBlocks */- _yuitest_coverline("build/editor-selection/editor-selection.js", 249);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 236); Y.EditorSelection.filterBlocks = function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "filterBlocks", 249);-_yuitest_coverline("build/editor-selection/editor-selection.js", 250);-var startTime = (new Date()).getTime();- _yuitest_coverline("build/editor-selection/editor-selection.js", 251);-var childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,- sel, single, br, divs, spans, c, s;+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "filterBlocks", 236);+_yuitest_coverline("build/editor-selection/editor-selection.js", 237);+var startTime = (new Date()).getTime(), endTime,+ childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,+ sel, single, br, c, s, html; - _yuitest_coverline("build/editor-selection/editor-selection.js", 254);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 241); if (childs) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 255);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 242); for (i = 0; i < childs.length; i++) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 256);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 243); node = Y.one(childs[i]);- _yuitest_coverline("build/editor-selection/editor-selection.js", 257);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 244); if (!node.test(Y.EditorSelection.BLOCKS)) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 258);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 245); doit = true;- _yuitest_coverline("build/editor-selection/editor-selection.js", 259);-if (childs[i].nodeType == 3) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 260);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 246);+if (childs[i].nodeType === 3) {+ _yuitest_coverline("build/editor-selection/editor-selection.js", 247); c = childs[i][textContent].match(Y.EditorSelection.REG_CHAR);- _yuitest_coverline("build/editor-selection/editor-selection.js", 261);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 248); s = childs[i][textContent].match(Y.EditorSelection.REG_NON);- _yuitest_coverline("build/editor-selection/editor-selection.js", 262);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 249); if (c === null && s) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 263);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 250); doit = false;- + } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 267);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 254); if (doit) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 268);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 255); if (!wrapped) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 269);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 256); wrapped = []; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 271);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 258); wrapped.push(childs[i]); } } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 274);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 261); wrapped = Y.EditorSelection._wrapBlock(wrapped); } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 277);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 264); wrapped = Y.EditorSelection._wrapBlock(wrapped); } - _yuitest_coverline("build/editor-selection/editor-selection.js", 280);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 267); single = Y.all(Y.EditorSelection.DEFAULT_BLOCK_TAG);- _yuitest_coverline("build/editor-selection/editor-selection.js", 281);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 268); if (single.size() === 1) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 282);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 269); br = single.item(0).all('br');- _yuitest_coverline("build/editor-selection/editor-selection.js", 283);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 270); if (br.size() === 1) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 284);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 271); if (!br.item(0).test('.yui-cursor')) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 285);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 272); br.item(0).remove(); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 287);-var html = single.item(0).get('innerHTML');- _yuitest_coverline("build/editor-selection/editor-selection.js", 288);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 274);+html = single.item(0).get('innerHTML');+ _yuitest_coverline("build/editor-selection/editor-selection.js", 275); if (html === '' || html === ' ') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 289);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 276); single.set('innerHTML', Y.EditorSelection.CURSOR);- _yuitest_coverline("build/editor-selection/editor-selection.js", 290);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 277); sel = new Y.EditorSelection();- _yuitest_coverline("build/editor-selection/editor-selection.js", 291);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 278); sel.focusCursor(true, true); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 293);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 280); if (br.item(0).test('.yui-cursor') && Y.UA.ie) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 294);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 281); br.item(0).remove(); } } } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 298);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 285); single.each(function(p) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 7)", 298);-_yuitest_coverline("build/editor-selection/editor-selection.js", 299);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 7)", 285);+_yuitest_coverline("build/editor-selection/editor-selection.js", 286); var html = p.get('innerHTML');- _yuitest_coverline("build/editor-selection/editor-selection.js", 300);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 287); if (html === '') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 301);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 288); p.remove(); } }); }- - _yuitest_coverline("build/editor-selection/editor-selection.js", 306);-if (!Y.UA.ie) {- /*- divs = Y.all('div, p');- divs.each(function(d) {- if (d.hasClass('yui-non')) {- return;- }- var html = d.get('innerHTML');- if (html === '') {- d.remove();- } else {- if (d.get('childNodes').size() == 1) {- if (d.ancestor('p')) {- d.replace(d.get('firstChild'));- }- }- }- });*/ - /* Removed this, as it was causing Pasting to be funky in Safari- spans = Y.all('.Apple-style-span, .apple-style-span');- spans.each(function(s) {- s.setAttribute('style', '');- });- */- }--- _yuitest_coverline("build/editor-selection/editor-selection.js", 334);-var endTime = (new Date()).getTime();+ _yuitest_coverline("build/editor-selection/editor-selection.js", 293);+endTime = (new Date()).getTime(); }; /** * Regular Expression used to find dead font-family styles * @static * @property REG_FONTFAMILY- */ - _yuitest_coverline("build/editor-selection/editor-selection.js", 342);-Y.EditorSelection.REG_FONTFAMILY = /font-family: ;/;+ */+ _yuitest_coverline("build/editor-selection/editor-selection.js", 301);+Y.EditorSelection.REG_FONTFAMILY = /font-family:\s*;/; /** * Regular Expression to determine if a string has a character in it * @static * @property REG_CHAR- */ - _yuitest_coverline("build/editor-selection/editor-selection.js", 349);+ */+ _yuitest_coverline("build/editor-selection/editor-selection.js", 308); Y.EditorSelection.REG_CHAR = /[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi; /**@@ -560,7 +514,7 @@ * @static * @property REG_NON */- _yuitest_coverline("build/editor-selection/editor-selection.js", 356);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 315); Y.EditorSelection.REG_NON = /[\s|\n|\t]/gi; /**@@ -568,7 +522,7 @@ * @static * @property REG_NOHTML */- _yuitest_coverline("build/editor-selection/editor-selection.js", 363);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 322); Y.EditorSelection.REG_NOHTML = /<\S[^><]*>/g; @@ -578,26 +532,26 @@ * @private * @method _wrapBlock */- _yuitest_coverline("build/editor-selection/editor-selection.js", 372);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 331); Y.EditorSelection._wrapBlock = function(wrapped) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "_wrapBlock", 372);-_yuitest_coverline("build/editor-selection/editor-selection.js", 373);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "_wrapBlock", 331);+_yuitest_coverline("build/editor-selection/editor-selection.js", 332); if (wrapped) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 374);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 333); var newChild = Y.Node.create('<' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '></' + Y.EditorSelection.DEFAULT_BLOCK_TAG + '>'), firstChild = Y.one(wrapped[0]), i; - _yuitest_coverline("build/editor-selection/editor-selection.js", 377);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 336); for (i = 1; i < wrapped.length; i++) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 378);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 337); newChild.append(wrapped[i]); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 380);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 339); firstChild.replace(newChild);- _yuitest_coverline("build/editor-selection/editor-selection.js", 381);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 340); newChild.prepend(firstChild); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 383);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 342); return false; }; @@ -607,71 +561,71 @@ * @method unfilter * @return {String} The filtered HTML */- _yuitest_coverline("build/editor-selection/editor-selection.js", 392);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 351); Y.EditorSelection.unfilter = function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "unfilter", 392);-_yuitest_coverline("build/editor-selection/editor-selection.js", 393);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "unfilter", 351);+_yuitest_coverline("build/editor-selection/editor-selection.js", 352); var nodes = Y.all('body [class]'), html = '', nons, ids, body = Y.one('body');- - - _yuitest_coverline("build/editor-selection/editor-selection.js", 398);+++ _yuitest_coverline("build/editor-selection/editor-selection.js", 357); nodes.each(function(n) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 8)", 398);-_yuitest_coverline("build/editor-selection/editor-selection.js", 399);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 8)", 357);+_yuitest_coverline("build/editor-selection/editor-selection.js", 358); if (n.hasClass(n._yuid)) { //One of ours- _yuitest_coverline("build/editor-selection/editor-selection.js", 401);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 360); n.setStyle(FONT_FAMILY, n.getStyle(FONT_FAMILY));- _yuitest_coverline("build/editor-selection/editor-selection.js", 402);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 361); n.removeClass(n._yuid);- _yuitest_coverline("build/editor-selection/editor-selection.js", 403);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 362); if (n.getAttribute('class') === '') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 404);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 363); n.removeAttribute('class'); } } }); - _yuitest_coverline("build/editor-selection/editor-selection.js", 409);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 368); nons = Y.all('.yui-non');- _yuitest_coverline("build/editor-selection/editor-selection.js", 410);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 369); nons.each(function(n) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 9)", 410);-_yuitest_coverline("build/editor-selection/editor-selection.js", 411);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 9)", 369);+_yuitest_coverline("build/editor-selection/editor-selection.js", 370); if (!n.hasClass('yui-skip') && n.get('innerHTML') === '') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 412);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 371); n.remove(); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 414);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 373); n.removeClass('yui-non').removeClass('yui-skip'); } }); - _yuitest_coverline("build/editor-selection/editor-selection.js", 418);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 377); ids = Y.all('body [id]');- _yuitest_coverline("build/editor-selection/editor-selection.js", 419);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 378); ids.each(function(n) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 10)", 419);-_yuitest_coverline("build/editor-selection/editor-selection.js", 420);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 10)", 378);+_yuitest_coverline("build/editor-selection/editor-selection.js", 379); if (n.get('id').indexOf('yui_3_') === 0) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 421);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 380); n.removeAttribute('id');- _yuitest_coverline("build/editor-selection/editor-selection.js", 422);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 381); n.removeAttribute('_yuid'); } });- - _yuitest_coverline("build/editor-selection/editor-selection.js", 426);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 385); if (body) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 427);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 386); html = body.get('innerHTML'); }- - _yuitest_coverline("build/editor-selection/editor-selection.js", 430);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 389); Y.all('.hr').addClass('yui-skip').addClass('yui-non');- + /* nodes.each(function(n) { n.addClass(n._yuid);@@ -681,8 +635,8 @@ } }); */- - _yuitest_coverline("build/editor-selection/editor-selection.js", 442);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 401); return html; }; /**@@ -692,24 +646,24 @@ * @param {HTMLElement} n The HTMLElement to resolve. Might be a TextNode, gives parentNode. * @return {Node} The Resolved node */- _yuitest_coverline("build/editor-selection/editor-selection.js", 451);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 410); Y.EditorSelection.resolve = function(n) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "resolve", 451);-_yuitest_coverline("build/editor-selection/editor-selection.js", 452);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "resolve", 410);+_yuitest_coverline("build/editor-selection/editor-selection.js", 411); if (n && n.nodeType === 3) { //Adding a try/catch here because in rare occasions IE will //Throw a error accessing the parentNode of a stranded text node. //In the case of Ctrl+Z (Undo)- _yuitest_coverline("build/editor-selection/editor-selection.js", 456);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 415); try {- _yuitest_coverline("build/editor-selection/editor-selection.js", 457);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 416); n = n.parentNode; } catch (re) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 459);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 418); n = 'body'; } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 462);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 421); return Y.one(n); }; @@ -720,20 +674,20 @@ * @param {Node} node The Node instance to remove the HTML from * @return {String} The string of text */- _yuitest_coverline("build/editor-selection/editor-selection.js", 472);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 431); Y.EditorSelection.getText = function(node) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "getText", 472);-_yuitest_coverline("build/editor-selection/editor-selection.js", 473);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "getText", 431);+_yuitest_coverline("build/editor-selection/editor-selection.js", 432); var txt = node.get('innerHTML').replace(Y.EditorSelection.REG_NOHTML, ''); //Clean out the cursor subs to see if the Node is empty- _yuitest_coverline("build/editor-selection/editor-selection.js", 475);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 434); txt = txt.replace('<span><br></span>', '').replace('<br>', '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 476);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 435); return txt; }; //Y.EditorSelection.DEFAULT_BLOCK_TAG = 'div';- _yuitest_coverline("build/editor-selection/editor-selection.js", 480);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 439); Y.EditorSelection.DEFAULT_BLOCK_TAG = 'p'; /**@@ -741,7 +695,7 @@ * @static * @property ALL */- _yuitest_coverline("build/editor-selection/editor-selection.js", 487);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 446); Y.EditorSelection.ALL = '[style],font[face]'; /**@@ -749,21 +703,21 @@ * @static * @property BLOCKS */- _yuitest_coverline("build/editor-selection/editor-selection.js", 494);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 453); Y.EditorSelection.BLOCKS = 'p,div,ul,ol,table,style'; /** * The temporary fontname applied to a selection to retrieve their values: yui-tmp * @static * @property TMP */- _yuitest_coverline("build/editor-selection/editor-selection.js", 500);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 459); Y.EditorSelection.TMP = 'yui-tmp'; /** * The default tag to use when creating elements: span * @static * @property DEFAULT_TAG */- _yuitest_coverline("build/editor-selection/editor-selection.js", 506);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 465); Y.EditorSelection.DEFAULT_TAG = 'span'; /**@@ -771,7 +725,7 @@ * @static * @property DEFAULT_TAG */- _yuitest_coverline("build/editor-selection/editor-selection.js", 513);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 472); Y.EditorSelection.CURID = 'yui-cursor'; /**@@ -779,7 +733,7 @@ * @static * @property CUR_WRAPID */- _yuitest_coverline("build/editor-selection/editor-selection.js", 520);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 479); Y.EditorSelection.CUR_WRAPID = 'yui-cursor-wrapper'; /**@@ -787,15 +741,15 @@ * @static * @property CURSOR */- _yuitest_coverline("build/editor-selection/editor-selection.js", 527);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 486); Y.EditorSelection.CURSOR = '<span><br class="yui-cursor"></span>'; - _yuitest_coverline("build/editor-selection/editor-selection.js", 529);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 488); Y.EditorSelection.hasCursor = function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "hasCursor", 529);-_yuitest_coverline("build/editor-selection/editor-selection.js", 530);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "hasCursor", 488);+_yuitest_coverline("build/editor-selection/editor-selection.js", 489); var cur = Y.all('#' + Y.EditorSelection.CUR_WRAPID);- _yuitest_coverline("build/editor-selection/editor-selection.js", 531);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 490); return cur.size(); }; @@ -804,30 +758,30 @@ * @static * @method cleanCursor */- _yuitest_coverline("build/editor-selection/editor-selection.js", 539);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 498); Y.EditorSelection.cleanCursor = function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "cleanCursor", 539);-_yuitest_coverline("build/editor-selection/editor-selection.js", 540);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "cleanCursor", 498);+_yuitest_coverline("build/editor-selection/editor-selection.js", 499); var cur, sel = 'br.yui-cursor';- _yuitest_coverline("build/editor-selection/editor-selection.js", 541);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 500); cur = Y.all(sel);- _yuitest_coverline("build/editor-selection/editor-selection.js", 542);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 501); if (cur.size()) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 543);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 502); cur.each(function(b) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 11)", 543);-_yuitest_coverline("build/editor-selection/editor-selection.js", 544);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 11)", 502);+_yuitest_coverline("build/editor-selection/editor-selection.js", 503); var c = b.get('parentNode.parentNode.childNodes'), html;- _yuitest_coverline("build/editor-selection/editor-selection.js", 545);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 504); if (c.size()) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 546);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 505); b.remove(); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 548);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 507); html = Y.EditorSelection.getText(c.item(0));- _yuitest_coverline("build/editor-selection/editor-selection.js", 549);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 508); if (html !== '') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 550);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 509); b.remove(); } }@@ -848,7 +802,7 @@ */ }; - _yuitest_coverline("build/editor-selection/editor-selection.js", 570);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 529); Y.EditorSelection.prototype = { /** * Range text value@@ -905,43 +859,43 @@ */ _selection: null, /**- * Wrap an element, with another element + * Wrap an element, with another element * @private * @method _wrap- * @param {HTMLElement} n The node to wrap + * @param {HTMLElement} n The node to wrap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The wrapped node */ _wrap: function(n, tag) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "_wrap", 633);-_yuitest_coverline("build/editor-selection/editor-selection.js", 634);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "_wrap", 592);+_yuitest_coverline("build/editor-selection/editor-selection.js", 593); var tmp = Y.Node.create('<' + tag + '></' + tag + '>');- _yuitest_coverline("build/editor-selection/editor-selection.js", 635);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 594); tmp.set(INNER_HTML, n.get(INNER_HTML));- _yuitest_coverline("build/editor-selection/editor-selection.js", 636);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 595); n.set(INNER_HTML, '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 637);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 596); n.append(tmp);- _yuitest_coverline("build/editor-selection/editor-selection.js", 638);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 597); return Y.Node.getDOMNode(tmp); }, /**- * Swap an element, with another element + * Swap an element, with another element * @private * @method _swap- * @param {HTMLElement} n The node to swap + * @param {HTMLElement} n The node to swap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The new node */ _swap: function(n, tag) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "_swap", 648);-_yuitest_coverline("build/editor-selection/editor-selection.js", 649);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "_swap", 607);+_yuitest_coverline("build/editor-selection/editor-selection.js", 608); var tmp = Y.Node.create('<' + tag + '></' + tag + '>');- _yuitest_coverline("build/editor-selection/editor-selection.js", 650);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 609); tmp.set(INNER_HTML, n.get(INNER_HTML));- _yuitest_coverline("build/editor-selection/editor-selection.js", 651);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 610); n.replace(tmp, n);- _yuitest_coverline("build/editor-selection/editor-selection.js", 652);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 611); return Y.Node.getDOMNode(tmp); }, /**@@ -952,32 +906,32 @@ * @return {NodeList} A NodeList of all items in the selection. */ getSelected: function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "getSelected", 661);-_yuitest_coverline("build/editor-selection/editor-selection.js", 662);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "getSelected", 620);+_yuitest_coverline("build/editor-selection/editor-selection.js", 621); Y.EditorSelection.filter();- _yuitest_coverline("build/editor-selection/editor-selection.js", 663);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 622); Y.config.doc.execCommand('fontname', null, Y.EditorSelection.TMP);- _yuitest_coverline("build/editor-selection/editor-selection.js", 664);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 623); var nodes = Y.all(Y.EditorSelection.ALL), items = [];- - _yuitest_coverline("build/editor-selection/editor-selection.js", 667);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 626); nodes.each(function(n, k) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 12)", 667);-_yuitest_coverline("build/editor-selection/editor-selection.js", 668);-if (n.getStyle(FONT_FAMILY) == Y.EditorSelection.TMP) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 669);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 12)", 626);+_yuitest_coverline("build/editor-selection/editor-selection.js", 627);+if (n.getStyle(FONT_FAMILY) === Y.EditorSelection.TMP) {+ _yuitest_coverline("build/editor-selection/editor-selection.js", 628); n.setStyle(FONT_FAMILY, '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 670);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 629); Y.EditorSelection.removeFontFamily(n);- _yuitest_coverline("build/editor-selection/editor-selection.js", 671);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 630); if (!n.test('body')) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 672);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 631); items.push(Y.Node.getDOMNode(nodes.item(k))); } } });- _yuitest_coverline("build/editor-selection/editor-selection.js", 676);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 635); return Y.all(items); }, /**@@ -987,8 +941,8 @@ * @return {Node} The inserted Node. */ insertContent: function(html) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "insertContent", 684);-_yuitest_coverline("build/editor-selection/editor-selection.js", 685);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "insertContent", 643);+_yuitest_coverline("build/editor-selection/editor-selection.js", 644); return this.insertAtCursor(html, this.anchorTextNode, this.anchorOffset, true); }, /**@@ -1001,89 +955,89 @@ * @return {Node} The inserted Node. */ insertAtCursor: function(html, node, offset, collapse) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "insertAtCursor", 696);-_yuitest_coverline("build/editor-selection/editor-selection.js", 697);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "insertAtCursor", 655);+_yuitest_coverline("build/editor-selection/editor-selection.js", 656); var cur = Y.Node.create('<' + Y.EditorSelection.DEFAULT_TAG + ' class="yui-non"></' + Y.EditorSelection.DEFAULT_TAG + '>'), inHTML, txt, txt2, newNode, range = this.createRange(), b; - _yuitest_coverline("build/editor-selection/editor-selection.js", 700);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 659); if (node && node.test('body')) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 701);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 660); b = Y.Node.create('<span></span>');- _yuitest_coverline("build/editor-selection/editor-selection.js", 702);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 661); node.append(b);- _yuitest_coverline("build/editor-selection/editor-selection.js", 703);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 662); node = b; } - - _yuitest_coverline("build/editor-selection/editor-selection.js", 707);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 666); if (range.pasteHTML) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 708);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 667); if (offset === 0 && node && !node.previous() && node.get('nodeType') === 3) { /* * For some strange reason, range.pasteHTML fails if the node is a textNode and * the offset is 0. (The cursor is at the beginning of the line)- * It will always insert the new content at position 1 instead of + * It will always insert the new content at position 1 instead of * position 0. Here we test for that case and do it the hard way. */- _yuitest_coverline("build/editor-selection/editor-selection.js", 715);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 674); node.insert(html, 'before');- _yuitest_coverline("build/editor-selection/editor-selection.js", 716);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 675); if (range.moveToElementText) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 717);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 676); range.moveToElementText(Y.Node.getDOMNode(node.previous())); } //Move the cursor after the new node- _yuitest_coverline("build/editor-selection/editor-selection.js", 720);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 679); range.collapse(false);- _yuitest_coverline("build/editor-selection/editor-selection.js", 721);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 680); range.select();- _yuitest_coverline("build/editor-selection/editor-selection.js", 722);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 681); return node.previous(); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 724);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 683); newNode = Y.Node.create(html);- _yuitest_coverline("build/editor-selection/editor-selection.js", 725);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 684); try {- _yuitest_coverline("build/editor-selection/editor-selection.js", 726);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 685); range.pasteHTML('<span id="rte-insert"></span>'); } catch (e) {}- _yuitest_coverline("build/editor-selection/editor-selection.js", 728);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 687); inHTML = Y.one('#rte-insert');- _yuitest_coverline("build/editor-selection/editor-selection.js", 729);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 688); if (inHTML) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 730);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 689); inHTML.set('id', '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 731);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 690); inHTML.replace(newNode);- _yuitest_coverline("build/editor-selection/editor-selection.js", 732);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 691); if (range.moveToElementText) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 733);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 692); range.moveToElementText(Y.Node.getDOMNode(newNode)); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 735);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 694); range.collapse(false);- _yuitest_coverline("build/editor-selection/editor-selection.js", 736);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 695); range.select();- _yuitest_coverline("build/editor-selection/editor-selection.js", 737);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 696); return newNode; } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 739);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 698); Y.on('available', function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 13)", 739);-_yuitest_coverline("build/editor-selection/editor-selection.js", 740);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 13)", 698);+_yuitest_coverline("build/editor-selection/editor-selection.js", 699); inHTML.set('id', '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 741);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 700); inHTML.replace(newNode);- _yuitest_coverline("build/editor-selection/editor-selection.js", 742);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 701); if (range.moveToElementText) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 743);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 702); range.moveToElementText(Y.Node.getDOMNode(newNode)); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 745);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 704); range.collapse(false);- _yuitest_coverline("build/editor-selection/editor-selection.js", 746);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 705); range.select(); }, '#rte-insert'); }@@ -1092,73 +1046,73 @@ //TODO using Y.Node.create here throws warnings & strips first white space character //txt = Y.one(Y.Node.create(inHTML.substr(0, offset))); //txt2 = Y.one(Y.Node.create(inHTML.substr(offset)));- _yuitest_coverline("build/editor-selection/editor-selection.js", 754);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 713); if (offset > 0) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 755);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 714); inHTML = node.get(textContent); - _yuitest_coverline("build/editor-selection/editor-selection.js", 757);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 716); txt = Y.one(Y.config.doc.createTextNode(inHTML.substr(0, offset)));- _yuitest_coverline("build/editor-selection/editor-selection.js", 758);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 717); txt2 = Y.one(Y.config.doc.createTextNode(inHTML.substr(offset))); - _yuitest_coverline("build/editor-selection/editor-selection.js", 760);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 719); node.replace(txt, node);- _yuitest_coverline("build/editor-selection/editor-selection.js", 761);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 720); newNode = Y.Node.create(html);- _yuitest_coverline("build/editor-selection/editor-selection.js", 762);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 721); if (newNode.get('nodeType') === 11) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 763);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 722); b = Y.Node.create('<span></span>');- _yuitest_coverline("build/editor-selection/editor-selection.js", 764);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 723); b.append(newNode);- _yuitest_coverline("build/editor-selection/editor-selection.js", 765);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 724); newNode = b; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 767);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 726); txt.insert(newNode, 'after'); //if (txt2 && txt2.get('length')) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 769);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 728); if (txt2) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 770);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 729); newNode.insert(cur, 'after');- _yuitest_coverline("build/editor-selection/editor-selection.js", 771);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 730); cur.insert(txt2, 'after');- _yuitest_coverline("build/editor-selection/editor-selection.js", 772);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 731); this.selectNode(cur, collapse); } } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 775);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 734); if (node.get('nodeType') === 3) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 776);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 735); node = node.get('parentNode'); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 778);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 737); newNode = Y.Node.create(html);- _yuitest_coverline("build/editor-selection/editor-selection.js", 779);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 738); html = node.get('innerHTML').replace(/\n/gi, '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 780);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 739); if (html === '' || html === '<br>') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 781);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 740); node.append(newNode); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 783);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 742); if (newNode.get('parentNode')) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 784);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 743); node.insert(newNode, 'before'); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 786);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 745); Y.one('body').prepend(newNode); } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 789);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 748); if (node.get('firstChild').test('br')) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 790);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 749); node.get('firstChild').remove(); } } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 794);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 753); return newNode; }, /**@@ -1168,76 +1122,76 @@ * @return {NodeList} A NodeList of all items in the selection. */ wrapContent: function(tag) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "wrapContent", 802);-_yuitest_coverline("build/editor-selection/editor-selection.js", 803);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "wrapContent", 761);+_yuitest_coverline("build/editor-selection/editor-selection.js", 762); tag = (tag) ? tag : Y.EditorSelection.DEFAULT_TAG; - _yuitest_coverline("build/editor-selection/editor-selection.js", 805);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 764); if (!this.isCollapsed) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 806);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 765); var items = this.getSelected(), changed = [], range, last, first, range2; - _yuitest_coverline("build/editor-selection/editor-selection.js", 809);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 768); items.each(function(n, k) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 14)", 809);-_yuitest_coverline("build/editor-selection/editor-selection.js", 810);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 14)", 768);+_yuitest_coverline("build/editor-selection/editor-selection.js", 769); var t = n.get('tagName').toLowerCase();- _yuitest_coverline("build/editor-selection/editor-selection.js", 811);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 770); if (t === 'font') {- _yuitest_coverline("build/editor-selection/editor-selection.js", 812);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 771); changed.push(this._swap(items.item(k), tag)); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 814);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 773); changed.push(this._wrap(items.item(k), tag)); } }, this);- - _yuitest_coverline("build/editor-selection/editor-selection.js", 818);++ _yuitest_coverline("build/editor-selection/editor-selection.js", 777); range = this.createRange();- _yuitest_coverline("build/editor-selection/editor-selection.js", 819);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 778); first = changed[0];- _yuitest_coverline("build/editor-selection/editor-selection.js", 820);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 779); last = changed[changed.length - 1];- _yuitest_coverline("build/editor-selection/editor-selection.js", 821);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 780); if (this._selection.removeAllRanges) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 822);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 781); range.setStart(changed[0], 0);- _yuitest_coverline("build/editor-selection/editor-selection.js", 823);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 782); range.setEnd(last, last.childNodes.length);- _yuitest_coverline("build/editor-selection/editor-selection.js", 824);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 783); this._selection.removeAllRanges();- _yuitest_coverline("build/editor-selection/editor-selection.js", 825);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 784); this._selection.addRange(range); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 827);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 786); if (range.moveToElementText) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 828);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 787); range.moveToElementText(Y.Node.getDOMNode(first));- _yuitest_coverline("build/editor-selection/editor-selection.js", 829);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 788); range2 = this.createRange();- _yuitest_coverline("build/editor-selection/editor-selection.js", 830);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 789); range2.moveToElementText(Y.Node.getDOMNode(last));- _yuitest_coverline("build/editor-selection/editor-selection.js", 831);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 790); range.setEndPoint('EndToEnd', range2); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 833);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 792); range.select(); } - _yuitest_coverline("build/editor-selection/editor-selection.js", 836);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 795); changed = Y.all(changed);- _yuitest_coverline("build/editor-selection/editor-selection.js", 837);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 796); return changed; } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 841);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 800); return Y.all([]); } }, /**- * Find and replace a string inside a text node and replace it with HTML focusing the node after + * Find and replace a string inside a text node and replace it with HTML focusing the node after * to allow you to continue to type. * @method replace * @param {String} se The string to search for.@@ -1245,38 +1199,38 @@ * @return {Node} The node inserted. */ replace: function(se,re) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "replace", 852);-_yuitest_coverline("build/editor-selection/editor-selection.js", 853);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "replace", 811);+_yuitest_coverline("build/editor-selection/editor-selection.js", 812); var range = this.createRange(), node, txt, index, newNode; - _yuitest_coverline("build/editor-selection/editor-selection.js", 855);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 814); if (range.getBookmark) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 856);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 815); index = range.getBookmark();- _yuitest_coverline("build/editor-selection/editor-selection.js", 857);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 816); txt = this.anchorNode.get('innerHTML').replace(se, re);- _yuitest_coverline("build/editor-selection/editor-selection.js", 858);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 817); this.anchorNode.set('innerHTML', txt);- _yuitest_coverline("build/editor-selection/editor-selection.js", 859);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 818); range.moveToBookmark(index);- _yuitest_coverline("build/editor-selection/editor-selection.js", 860);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 819); newNode = Y.one(range.parentElement()); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 862);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 821); node = this.anchorTextNode;- _yuitest_coverline("build/editor-selection/editor-selection.js", 863);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 822); txt = node.get(textContent);- _yuitest_coverline("build/editor-selection/editor-selection.js", 864);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 823); index = txt.indexOf(se); - _yuitest_coverline("build/editor-selection/editor-selection.js", 866);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 825); txt = txt.replace(se, '');- _yuitest_coverline("build/editor-selection/editor-selection.js", 867);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 826); node.set(textContent, txt);- _yuitest_coverline("build/editor-selection/editor-selection.js", 868);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 827); newNode = this.insertAtCursor(re, node, index, true); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 870);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 829); return newNode; }, /**@@ -1286,13 +1240,13 @@ * @return {EditorSelection} */ remove: function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "remove", 878);-_yuitest_coverline("build/editor-selection/editor-selection.js", 879);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "remove", 837);+_yuitest_coverline("build/editor-selection/editor-selection.js", 838); if (this._selection && this._selection.removeAllRanges) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 880);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 839); this._selection.removeAllRanges(); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 882);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 841); return this; }, /**@@ -1301,13 +1255,13 @@ * @return {RangeObject} */ createRange: function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "createRange", 889);-_yuitest_coverline("build/editor-selection/editor-selection.js", 890);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "createRange", 848);+_yuitest_coverline("build/editor-selection/editor-selection.js", 849); if (Y.config.doc.selection) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 891);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 850); return Y.config.doc.selection.createRange(); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 893);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 852); return Y.config.doc.createRange(); } },@@ -1320,57 +1274,57 @@ * @return {EditorSelection} */ selectNode: function(node, collapse, end) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "selectNode", 904);-_yuitest_coverline("build/editor-selection/editor-selection.js", 905);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "selectNode", 863);+_yuitest_coverline("build/editor-selection/editor-selection.js", 864); if (!node) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 906);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 865); return; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 908);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 867); end = end || 0;- _yuitest_coverline("build/editor-selection/editor-selection.js", 909);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 868); node = Y.Node.getDOMNode(node);- _yuitest_coverline("build/editor-selection/editor-selection.js", 910);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 869); var range = this.createRange();- _yuitest_coverline("build/editor-selection/editor-selection.js", 911);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 870); if (range.selectNode) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 912);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 871); range.selectNode(node);- _yuitest_coverline("build/editor-selection/editor-selection.js", 913);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 872); this._selection.removeAllRanges();- _yuitest_coverline("build/editor-selection/editor-selection.js", 914);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 873); this._selection.addRange(range);- _yuitest_coverline("build/editor-selection/editor-selection.js", 915);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 874); if (collapse) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 916);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 875); try {- _yuitest_coverline("build/editor-selection/editor-selection.js", 917);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 876); this._selection.collapse(node, end); } catch (err) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 919);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 878); this._selection.collapse(node, 0); } } } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 923);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 882); if (node.nodeType === 3) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 924);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 883); node = node.parentNode; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 926);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 885); try {- _yuitest_coverline("build/editor-selection/editor-selection.js", 927);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 886); range.moveToElementText(node); } catch(e) {}- _yuitest_coverline("build/editor-selection/editor-selection.js", 929);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 888); if (collapse) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 930);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 889); range.collapse(((end) ? false : true)); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 932);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 891); range.select(); }- _yuitest_coverline("build/editor-selection/editor-selection.js", 934);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 893); return this; }, /**@@ -1379,10 +1333,10 @@ * @return {Node} */ setCursor: function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "setCursor", 941);-_yuitest_coverline("build/editor-selection/editor-selection.js", 942);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "setCursor", 900);+_yuitest_coverline("build/editor-selection/editor-selection.js", 901); this.removeCursor(false);- _yuitest_coverline("build/editor-selection/editor-selection.js", 943);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 902); return this.insertContent(Y.EditorSelection.CURSOR); }, /**@@ -1391,8 +1345,8 @@ * @return {Node} */ getCursor: function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "getCursor", 950);-_yuitest_coverline("build/editor-selection/editor-selection.js", 951);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "getCursor", 909);+_yuitest_coverline("build/editor-selection/editor-selection.js", 910); return Y.all('#' + Y.EditorSelection.CURID); }, /**@@ -1402,23 +1356,23 @@ * @return {Node} */ removeCursor: function(keep) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "removeCursor", 959);-_yuitest_coverline("build/editor-selection/editor-selection.js", 960);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "removeCursor", 918);+_yuitest_coverline("build/editor-selection/editor-selection.js", 919); var cur = this.getCursor();- _yuitest_coverline("build/editor-selection/editor-selection.js", 961);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 920); if (cur) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 962);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 921); if (keep) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 963);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 922); cur.removeAttribute('id');- _yuitest_coverline("build/editor-selection/editor-selection.js", 964);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 923); cur.set('innerHTML', '<br class="yui-cursor">'); } else {- _yuitest_coverline("build/editor-selection/editor-selection.js", 966);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 925); cur.remove(); } }- _yuitest_coverline("build/editor-selection/editor-selection.js", 969);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 928); return cur; }, /**@@ -1427,25 +1381,25 @@ * @return {Node} */ focusCursor: function(collapse, end) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "focusCursor", 976);-_yuitest_coverline("build/editor-selection/editor-selection.js", 977);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "focusCursor", 935);+_yuitest_coverline("build/editor-selection/editor-selection.js", 936); if (collapse !== false) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 978);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 937); collapse = true; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 980);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 939); if (end !== false) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 981);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 940); end = true; }- _yuitest_coverline("build/editor-selection/editor-selection.js", 983);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 942); var cur = this.removeCursor(true);- _yuitest_coverline("build/editor-selection/editor-selection.js", 984);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 943); if (cur) {- _yuitest_coverline("build/editor-selection/editor-selection.js", 985);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 944); cur.each(function(c) {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 15)", 985);-_yuitest_coverline("build/editor-selection/editor-selection.js", 986);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "(anonymous 15)", 944);+_yuitest_coverline("build/editor-selection/editor-selection.js", 945); this.selectNode(c, collapse, end); }, this); }@@ -1456,16 +1410,16 @@ * @return {String} */ toString: function() {- _yuitest_coverfunc("build/editor-selection/editor-selection.js", "toString", 995);-_yuitest_coverline("build/editor-selection/editor-selection.js", 996);+ _yuitest_coverfunc("build/editor-selection/editor-selection.js", "toString", 954);+_yuitest_coverline("build/editor-selection/editor-selection.js", 955); return 'EditorSelection Object'; } }; //TODO Remove this alias in 3.6.0- _yuitest_coverline("build/editor-selection/editor-selection.js", 1001);+ _yuitest_coverline("build/editor-selection/editor-selection.js", 960); Y.Selection = Y.EditorSelection; -}, '3.7.2', {"requires": ["node"]});+}, '3.7.3', {"requires": ["node"]});
bundle/editor-selection/editor-selection-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -13,7 +13,7 @@ * @module editor * @submodule selection */- + //TODO This shouldn't be there, Y.Node doesn't normalize getting textnode content. var textContent = 'textContent', INNER_HTML = 'innerHTML',@@ -24,12 +24,13 @@ } Y.EditorSelection = function(domEvent) {- var sel, par, ieNode, nodes, rng, i;+ var sel, par, ieNode, nodes, rng, i,+ comp, moved = 0, n, id; if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) {- sel = Y.config.win.getSelection();+ sel = Y.config.win.getSelection(); } else if (Y.config.doc.selection) {- sel = Y.config.doc.selection.createRange();+ sel = Y.config.doc.selection.createRange(); } this._selection = sel; @@ -62,7 +63,7 @@ } this.ieNode = ieNode;- + if (ieNode) { if (ieNode.nodeType !== 3) { if (ieNode.firstChild) {@@ -75,28 +76,27 @@ } } this.anchorNode = this.focusNode = Y.EditorSelection.resolve(ieNode);- + rng.moveToElementText(sel.parentElement());- var comp = sel.compareEndPoints('StartToStart', rng),- moved = 0;+ comp = sel.compareEndPoints('StartToStart', rng); if (comp) { //We are not at the beginning of the selection. //Setting the move to something large, may need to increase it later moved = Math.abs(sel.move('character', -9999)); }- + this.anchorOffset = this.focusOffset = moved;- + this.anchorTextNode = this.focusTextNode = Y.one(ieNode); }- - ++ } else { //This helps IE deal with a selection and nodeChange events if (sel.htmlText && sel.htmlText !== '') {- var n = Y.Node.create(sel.htmlText);+ n = Y.Node.create(sel.htmlText); if (n && n.get('id')) {- var id = n.get('id');+ id = n.get('id'); this.anchorNode = this.focusNode = Y.one('#' + id); } else if (n) { n = n.get('childNodes');@@ -113,7 +113,7 @@ this.focusNode = Y.EditorSelection.resolve(sel.focusNode); this.anchorOffset = sel.anchorOffset; this.focusOffset = sel.focusOffset;- + this.anchorTextNode = Y.one(sel.anchorNode); this.focusTextNode = Y.one(sel.focusNode); }@@ -127,7 +127,7 @@ } } };- + /** * Utility method to remove dead font-family styles from an element. * @static@@ -136,7 +136,7 @@ Y.EditorSelection.removeFontFamily = function(n) { n.removeAttribute('face'); var s = n.getAttribute('style').toLowerCase();- if (s === '' || (s == 'font-family: ')) {+ if (s === '' || (s === 'font-family: ')) { n.removeAttribute('style'); } if (s.match(Y.EditorSelection.REG_FONTFAMILY)) {@@ -153,16 +153,17 @@ * @method filter */ Y.EditorSelection.filter = function(blocks) {- var startTime = (new Date()).getTime(); Y.log('Filtering nodes', 'info', 'editor-selection'); - var nodes = Y.all(Y.EditorSelection.ALL),+ var startTime = (new Date()).getTime(),+ endTime,+ nodes = Y.all(Y.EditorSelection.ALL), baseNodes = Y.all('strong,em'), doc = Y.config.doc, hrs, classNames = {}, cssString = '',- ls;+ ls, startTime1 = (new Date()).getTime(),+ endTime1; - var startTime1 = (new Date()).getTime(); nodes.each(function(n) { var raw = Y.Node.getDOMNode(n); if (raw.style[FONT_FAMILY]) {@@ -171,59 +172,45 @@ Y.EditorSelection.removeFontFamily(raw); }- /*- if (n.getStyle(FONT_FAMILY)) {- classNames['.' + n._yuid] = n.getStyle(FONT_FAMILY);- n.addClass(n._yuid);- n.removeAttribute('face');- n.setStyle(FONT_FAMILY, '');- if (n.getAttribute('style') === '') {- n.removeAttribute('style');- }- //This is for IE- if (n.getAttribute('style').toLowerCase() === 'font-family: ') {- n.removeAttribute('style');- }- }- */ });- var endTime1 = (new Date()).getTime();+ endTime1 = (new Date()).getTime(); Y.log('Node Filter Timer: ' + (endTime1 - startTime1) + 'ms', 'info', 'editor-selection'); Y.all('.hr').addClass('yui-skip').addClass('yui-non');- + if (Y.UA.ie) { hrs = doc.getElementsByTagName('hr'); Y.each(hrs, function(hr) {- var el = doc.createElement('div');- el.className = 'hr yui-non yui-skip';- - el.setAttribute('readonly', true);- el.setAttribute('contenteditable', false); //Keep it from being Edited- if (hr.parentNode) {- hr.parentNode.replaceChild(el, hr);- }- //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');- var s = el.style;- s.border = '1px solid #ccc';- s.lineHeight = '0';- s.height = '0';- s.fontSize = '0';- s.marginTop = '5px';- s.marginBottom = '5px';- s.marginLeft = '0px';- s.marginRight = '0px';- s.padding = '0';+ var el = doc.createElement('div'),+ s = el.style;++ el.className = 'hr yui-non yui-skip';++ el.setAttribute('readonly', true);+ el.setAttribute('contenteditable', false); //Keep it from being Edited+ if (hr.parentNode) {+ hr.parentNode.replaceChild(el, hr);+ }+ //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');+ s.border = '1px solid #ccc';+ s.lineHeight = '0';+ s.height = '0';+ s.fontSize = '0';+ s.marginTop = '5px';+ s.marginBottom = '5px';+ s.marginLeft = '0px';+ s.marginRight = '0px';+ s.padding = '0'; }); }- + Y.each(classNames, function(v, k) { cssString += k + ' { font-family: ' + v.replace(/"/gi, '') + '; }'; }); Y.StyleSheet(cssString, 'editor'); - + //Not sure about this one? baseNodes.each(function(n, k) { var t = n.get('tagName').toLowerCase(),@@ -236,17 +223,17 @@ //Filter out all the empty UL/OL's ls = Y.all('ol,ul');- ls.each(function(v, k) {+ ls.each(function(v) { var lis = v.all('li'); if (!lis.size()) { v.remove(); } });- + if (blocks) { Y.EditorSelection.filterBlocks(); }- var endTime = (new Date()).getTime();+ endTime = (new Date()).getTime(); Y.log('Filter Timer: ' + (endTime - startTime) + 'ms', 'info', 'editor-selection'); }; @@ -256,22 +243,22 @@ * @method filterBlocks */ Y.EditorSelection.filterBlocks = function() {- var startTime = (new Date()).getTime(); Y.log('RAW filter blocks', 'info', 'editor-selection');- var childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,- sel, single, br, divs, spans, c, s;+ var startTime = (new Date()).getTime(), endTime,+ childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,+ sel, single, br, c, s, html; if (childs) { for (i = 0; i < childs.length; i++) { node = Y.one(childs[i]); if (!node.test(Y.EditorSelection.BLOCKS)) { doit = true;- if (childs[i].nodeType == 3) {+ if (childs[i].nodeType === 3) { c = childs[i][textContent].match(Y.EditorSelection.REG_CHAR); s = childs[i][textContent].match(Y.EditorSelection.REG_NON); if (c === null && s) { doit = false;- + } } if (doit) {@@ -295,7 +282,7 @@ if (!br.item(0).test('.yui-cursor')) { br.item(0).remove(); }- var html = single.item(0).get('innerHTML');+ html = single.item(0).get('innerHTML'); if (html === '' || html === ' ') { Y.log('Paragraph empty, focusing cursor', 'info', 'editor-selection'); single.set('innerHTML', Y.EditorSelection.CURSOR);@@ -315,41 +302,8 @@ } }); }- - if (!Y.UA.ie) {- /*- divs = Y.all('div, p');- divs.each(function(d) {- if (d.hasClass('yui-non')) {- return;- }- var html = d.get('innerHTML');- if (html === '') {- Y.log('Empty DIV/P Tag Found, Removing It', 'info', 'editor-selection');- d.remove();- } else {- Y.log('DIVS/PS Count: ' + d.get('childNodes').size(), 'info', 'editor-selection');- if (d.get('childNodes').size() == 1) {- Y.log('This Div/P only has one Child Node', 'info', 'editor-selection');- if (d.ancestor('p')) {- Y.log('This Div/P is a child of a paragraph, remove it..', 'info', 'editor-selection');- d.replace(d.get('firstChild'));- }- }- }- });*/ - /* Removed this, as it was causing Pasting to be funky in Safari- spans = Y.all('.Apple-style-span, .apple-style-span');- Y.log('Apple Spans found: ' + spans.size(), 'info', 'editor-selection');- spans.each(function(s) {- s.setAttribute('style', '');- });- */- }--- var endTime = (new Date()).getTime();+ endTime = (new Date()).getTime(); Y.log('FilterBlocks Timer: ' + (endTime - startTime) + 'ms', 'info', 'editor-selection'); }; @@ -357,14 +311,14 @@ * Regular Expression used to find dead font-family styles * @static * @property REG_FONTFAMILY- */ - Y.EditorSelection.REG_FONTFAMILY = /font-family: ;/;+ */+ Y.EditorSelection.REG_FONTFAMILY = /font-family:\s*;/; /** * Regular Expression to determine if a string has a character in it * @static * @property REG_CHAR- */ + */ Y.EditorSelection.REG_CHAR = /[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi; /**@@ -412,9 +366,9 @@ var nodes = Y.all('body [class]'), html = '', nons, ids, body = Y.one('body');- + Y.log('UnFiltering nodes', 'info', 'editor-selection');- + nodes.each(function(n) { if (n.hasClass(n._yuid)) { //One of ours@@ -442,13 +396,13 @@ n.removeAttribute('_yuid'); } });- + if (body) { html = body.get('innerHTML'); }- + Y.all('.hr').addClass('yui-skip').addClass('yui-non');- + /* nodes.each(function(n) { n.addClass(n._yuid);@@ -458,7 +412,7 @@ } }); */- + return html; }; /**@@ -645,10 +599,10 @@ */ _selection: null, /**- * Wrap an element, with another element + * Wrap an element, with another element * @private * @method _wrap- * @param {HTMLElement} n The node to wrap + * @param {HTMLElement} n The node to wrap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The wrapped node */@@ -660,10 +614,10 @@ return Y.Node.getDOMNode(tmp); }, /**- * Swap an element, with another element + * Swap an element, with another element * @private * @method _swap- * @param {HTMLElement} n The node to swap + * @param {HTMLElement} n The node to swap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The new node */@@ -685,9 +639,9 @@ Y.config.doc.execCommand('fontname', null, Y.EditorSelection.TMP); var nodes = Y.all(Y.EditorSelection.ALL), items = [];- + nodes.each(function(n, k) {- if (n.getStyle(FONT_FAMILY) == Y.EditorSelection.TMP) {+ if (n.getStyle(FONT_FAMILY) === Y.EditorSelection.TMP) { n.setStyle(FONT_FAMILY, ''); Y.EditorSelection.removeFontFamily(n); if (!n.test('body')) {@@ -725,13 +679,13 @@ node = b; } - + if (range.pasteHTML) { if (offset === 0 && node && !node.previous() && node.get('nodeType') === 3) { /* * For some strange reason, range.pasteHTML fails if the node is a textNode and * the offset is 0. (The cursor is at the beginning of the line)- * It will always insert the new content at position 1 instead of + * It will always insert the new content at position 1 instead of * position 0. Here we test for that case and do it the hard way. */ node.insert(html, 'before');@@ -837,8 +791,8 @@ changed.push(this._wrap(items.item(k), tag)); } }, this);- - range = this.createRange();++ range = this.createRange(); first = changed[0]; last = changed[changed.length - 1]; if (this._selection.removeAllRanges) {@@ -867,7 +821,7 @@ } }, /**- * Find and replace a string inside a text node and replace it with HTML focusing the node after + * Find and replace a string inside a text node and replace it with HTML focusing the node after * to allow you to continue to type. * @method replace * @param {String} se The string to search for.@@ -916,7 +870,7 @@ if (Y.config.doc.selection) { return Y.config.doc.selection.createRange(); } else {- return Y.config.doc.createRange();+ return Y.config.doc.createRange(); } }, /**@@ -934,7 +888,7 @@ } end = end || 0; node = Y.Node.getDOMNode(node);- var range = this.createRange();+ var range = this.createRange(); if (range.selectNode) { range.selectNode(node); this._selection.removeAllRanges();@@ -1029,4 +983,4 @@ -}, '3.7.2', {"requires": ["node"]});+}, '3.7.3', {"requires": ["node"]});
bundle/editor-selection/editor-selection-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-selection",function(e,t){var n="textContent",r="innerHTML",i="fontFamily";e.UA.ie&&(n="nodeValue"),e.EditorSelection=function(t){var n,r,i,s,o,u;e.config.win.getSelection&&(!e.UA.ie||e.UA.ie<9)?n=e.config.win.getSelection():e.config.doc.selection&&(n=e.config.doc.selection.createRange()),this._selection=n;if(!n)return!1;if(n.pasteHTML){this.isCollapsed=n.compareEndPoints("StartToEnd",n)?!1:!0;if(this.isCollapsed){this.anchorNode=this.focusNode=e.one(n.parentElement()),t&&(i=e.config.doc.elementFromPoint(t.clientX,t.clientY)),o=n.duplicate();if(!i){r=n.parentElement(),s=r.childNodes;for(u=0;u<s.length;u++)o.inRange(n)&&(i||(i=s[u]))}this.ieNode=i;if(i){i.nodeType!==3&&(i.firstChild&&(i=i.firstChild),i&&i.tagName&&i.tagName.toLowerCase()==="body"&&i.firstChild&&(i=i.firstChild)),this.anchorNode=this.focusNode=e.EditorSelection.resolve(i),o.moveToElementText(n.parentElement());var a=n.compareEndPoints("StartToStart",o),f=0;a&&(f=Math.abs(n.move("character",-9999))),this.anchorOffset=this.focusOffset=f,this.anchorTextNode=this.focusTextNode=e.one(i)}}else if(n.htmlText&&n.htmlText!==""){var l=e.Node.create(n.htmlText);if(l&&l.get("id")){var c=l.get("id");this.anchorNode=this.focusNode=e.one("#"+c)}else l&&(l=l.get("childNodes"),this.anchorNode=this.focusNode=l.item(0))}}else this.isCollapsed=n.isCollapsed,this.anchorNode=e.EditorSelection.resolve(n.anchorNode),this.focusNode=e.EditorSelection.resolve(n.focusNode),this.anchorOffset=n.anchorOffset,this.focusOffset=n.focusOffset,this.anchorTextNode=e.one(n.anchorNode),this.focusTextNode=e.one(n.focusNode);e.Lang.isString(n.text)?this.text=n.text:n.toString?this.text=n.toString():this.text=""},e.EditorSelection.removeFontFamily=function(t){t.removeAttribute("face");var n=t.getAttribute("style").toLowerCase();(n===""||n=="font-family: ")&&t.removeAttribute("style"),n.match(e.EditorSelection.REG_FONTFAMILY)&&(n=n.replace(e.EditorSelection.REG_FONTFAMILY,""),t.setAttribute("style",n))},e.EditorSelection.filter=function(t){var n=(new Date).getTime(),r=e.all(e.EditorSelection.ALL),s=e.all("strong,em"),o=e.config.doc,u,a={},f="",l,c=(new Date).getTime();r.each(function(t){var n=e.Node.getDOMNode(t);n.style[i]&&(a["."+t._yuid]=n.style[i],t.addClass(t._yuid),e.EditorSelection.removeFontFamily(n))});var h=(new Date).getTime();e.all(".hr").addClass("yui-skip").addClass("yui-non"),e.UA.ie&&(u=o.getElementsByTagName("hr"),e.each(u,function(e){var t=o.createElement("div");t.className="hr yui-non yui-skip",t.setAttribute("readonly",!0),t.setAttribute("contenteditable",!1),e.parentNode&&e.parentNode.replaceChild(t,e);var n=t.style;n.border="1px solid #ccc",n.lineHeight="0",n.height="0",n.fontSize="0",n.marginTop="5px",n.marginBottom="5px",n.marginLeft="0px",n.marginRight="0px",n.padding="0"})),e.each(a,function(e,t){f+=t+" { font-family: "+e.replace(/"/gi,"")+"; }"}),e.StyleSheet(f,"editor"),s.each(function(t,n){var r=t.get("tagName").toLowerCase(),i="i";r==="strong"&&(i="b"),e.EditorSelection.prototype._swap(s.item(n),i)}),l=e.all("ol,ul"),l.each(function(e,t){var n=e.all("li");n.size()||e.remove()}),t&&e.EditorSelection.filterBlocks();var p=(new Date).getTime()},e.EditorSelection.filterBlocks=function(){var t=(new Date).getTime(),r=e.config.doc.body.childNodes,i,s,o=!1,u=!0,a,f,l,c,h,p,d;if(r){for(i=0;i<r.length;i++)s=e.one(r[i]),s.test(e.EditorSelection.BLOCKS)?o=e.EditorSelection._wrapBlock(o):(u=!0,r[i].nodeType==3&&(p=r[i][n].match(e.EditorSelection.REG_CHAR),d=r[i][n].match(e.EditorSelection.REG_NON),p===null&&d&&(u=!1)),u&&(o||(o=[]),o.push(r[i])));o=e.EditorSelection._wrapBlock(o)}f=e.all(e.EditorSelection.DEFAULT_BLOCK_TAG);if(f.size()===1){l=f.item(0).all("br");if(l.size()===1){l.item(0).test(".yui-cursor")||l.item(0).remove();var v=f.item(0).get("innerHTML");if(v===""||v===" ")f.set("innerHTML",e.EditorSelection.CURSOR),a=new e.EditorSelection,a.focusCursor(!0,!0);l.item(0).test(".yui-cursor")&&e.UA.ie&&l.item(0).remove()}}else f.each(function(e){var t=e.get("innerHTML");t===""&&e.remove()});!e.UA.ie;var m=(new Date).getTime()},e.EditorSelection.REG_FONTFAMILY=/font-family: ;/,e.EditorSelection.REG_CHAR=/[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi,e.EditorSelection.REG_NON=/[\s|\n|\t]/gi,e.EditorSelection.REG_NOHTML=/<\S[^><]*>/g,e.EditorSelection._wrapBlock=function(t){if(t){var n=e.Node.create("<"+e.EditorSelection.DEFAULT_BLOCK_TAG+"></"+e.EditorSelection.DEFAULT_BLOCK_TAG+">"),r=e.one(t[0]),i;for(i=1;i<t.length;i++)n.append(t[i]);r.replace(n),n.prepend(r)}return!1},e.EditorSelection.unfilter=function(){var t=e.all("body [class]"),n="",r,s,o=e.one("body");return t.each(function(e){e.hasClass(e._yuid)&&(e.setStyle(i,e.getStyle(i)),e.removeClass(e._yuid),e.getAttribute("class")===""&&e.removeAttribute("class"))}),r=e.all(".yui-non"),r.each(function(e){!e.hasClass("yui-skip")&&e.get("innerHTML")===""?e.remove():e.removeClass("yui-non").removeClass("yui-skip")}),s=e.all("body [id]"),s.each(function(e){e.get("id").indexOf("yui_3_")===0&&(e.removeAttribute("id"),e.removeAttribute("_yuid"))}),o&&(n=o.get("innerHTML")),e.all(".hr").addClass("yui-skip").addClass("yui-non"),n},e.EditorSelection.resolve=function(t){if(t&&t.nodeType===3)try{t=t.parentNode}catch(n){t="body"}return e.one(t)},e.EditorSelection.getText=function(t){var n=t.get("innerHTML").replace(e.EditorSelection.REG_NOHTML,"");return n=n.replace("<span><br></span>","").replace("<br>",""),n},e.EditorSelection.DEFAULT_BLOCK_TAG="p",e.EditorSelection.ALL="[style],font[face]",e.EditorSelection.BLOCKS="p,div,ul,ol,table,style",e.EditorSelection.TMP="yui-tmp",e.EditorSelection.DEFAULT_TAG="span",e.EditorSelection.CURID="yui-cursor",e.EditorSelection.CUR_WRAPID="yui-cursor-wrapper",e.EditorSelection.CURSOR='<span><br class="yui-cursor"></span>',e.EditorSelection.hasCursor=function(){var t=e.all("#"+e.EditorSelection.CUR_WRAPID);return t.size()},e.EditorSelection.cleanCursor=function(){var t,n="br.yui-cursor";t=e.all(n),t.size()&&t.each(function(t){var n=t.get("parentNode.parentNode.childNodes"),r;n.size()?t.remove():(r=e.EditorSelection.getText(n.item(0)),r!==""&&t.remove())})},e.EditorSelection.prototype={text:null,isCollapsed:null,anchorNode:null,anchorOffset:null,anchorTextNode:null,focusNode:null,focusOffset:null,focusTextNode:null,_selection:null,_wrap:function(t,n){var i=e.Node.create("<"+n+"></"+n+">");return i.set(r,t.get(r)),t.set(r,""),t.append(i),e.Node.getDOMNode(i)},_swap:function(t,n){var i=e.Node.create("<"+n+"></"+n+">");return i.set(r,t.get(r)),t.replace(i,t),e.Node.getDOMNode(i)},getSelected:function(){e.EditorSelection.filter(),e.config.doc.execCommand("fontname",null,e.EditorSelection.TMP);var t=e.all(e.EditorSelection.ALL),n=[];return t.each(function(r,s){r.getStyle(i)==e.EditorSelection.TMP&&(r.setStyle(i,""),e.EditorSelection.removeFontFamily(r),r.test("body")||n.push(e.Node.getDOMNode(t.item(s))))}),e.all(n)},insertContent:function(e){return this.insertAtCursor(e,this.anchorTextNode,this.anchorOffset,!0)},insertAtCursor:function(t,r,i,s){var o=e.Node.create("<"+e.EditorSelection.DEFAULT_TAG+' class="yui-non"></'+e.EditorSelection.DEFAULT_TAG+">"),u,a,f,l,c=this.createRange(),h;r&&r.test("body")&&(h=e.Node.create("<span></span>"),r.append(h),r=h);if(c.pasteHTML){if(i===0&&r&&!r.previous()&&r.get("nodeType")===3)return r.insert(t,"before"),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(r.previous())),c.collapse(!1),c.select(),r.previous();l=e.Node.create(t);try{c.pasteHTML('<span id="rte-insert"></span>')}catch(p){}u=e.one("#rte-insert");if(u)return u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select(),l;e.on("available",function(){u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select()},"#rte-insert")}else i>0?(u=r.get(n),a=e.one(e.config.doc.createTextNode(u.substr(0,i))),f=e.one(e.config.doc.createTextNode(u.substr(i))),r.replace(a,r),l=e.Node.create(t),l.get("nodeType")===11&&(h=e.Node.create("<span></span>"),h.append(l),l=h),a.insert(l,"after"),f&&(l.insert(o,"after"),o.insert(f,"after"),this.selectNode(o,s))):(r.get("nodeType")===3&&(r=r.get("parentNode")),l=e.Node.create(t),t=r.get("innerHTML").replace(/\n/gi,""),t===""||t==="<br>"?r.append(l):l.get("parentNode")?r.insert(l,"before"):e.one("body").prepend(l),r.get("firstChild").test("br")&&r.get("firstChild").remove());return l},wrapContent:function(t){t=t?t:e.EditorSelection.DEFAULT_TAG;if(!this.isCollapsed){var n=this.getSelected(),r=[],i,s,o,u;return n.each(function(e,i){var s=e.get("tagName").toLowerCase();s==="font"?r.push(this._swap(n.item(i),t)):r.push(this._wrap(n.item(i),t))},this),i=this.createRange(),o=r[0],s=r[r.length-1],this._selection.removeAllRanges?(i.setStart(r[0],0),i.setEnd(s,s.childNodes.length),this._selection.removeAllRanges(),this._selection.addRange(i)):(i.moveToElementText&&(i.moveToElementText(e.Node.getDOMNode(o)),u=this.createRange(),u.moveToElementText(e.Node.getDOMNode(s)),i.setEndPoint("EndToEnd",u)),i.select()),r=e.all(r),r}return e.all([])},replace:function(t,r){var i=this.createRange(),s,o,u,a;return i.getBookmark?(u=i.getBookmark(),o=this.anchorNode.get("innerHTML").replace(t,r),this.anchorNode.set("innerHTML",o),i.moveToBookmark(u),a=e.one(i.parentElement())):(s=this.anchorTextNode,o=s.get(n),u=o.indexOf(t),o=o.replace(t,""),s.set(n,o),a=this.insertAtCursor(r,s,u,!0)),a},remove:function(){return this._selection&&this._selection.removeAllRanges&&this._selection.removeAllRanges(),this},createRange:function(){return e.config.doc.selection?e.config.doc.selection.createRange():e.config.doc.createRange()},selectNode:function(t,n,r){if(!t)return;r=r||0,t=e.Node.getDOMNode(t);var i=this.createRange();if(i.selectNode){i.selectNode(t),this._selection.removeAllRanges(),this._selection.addRange(i);if(n)try{this._selection.collapse(t,r)}catch(s){this._selection.collapse(t,0)}}else{t.nodeType===3&&(t=t.parentNode);try{i.moveToElementText(t)}catch(o){}n&&i.collapse(r?!1:!0),i.select()}return this},setCursor:function(){return this.removeCursor(!1),this.insertContent(e.EditorSelection.CURSOR)},getCursor:function(){return e.all("#"+e.EditorSelection.CURID)},removeCursor:function(e){var t=this.getCursor();return t&&(e?(t.removeAttribute("id"),t.set("innerHTML",'<br class="yui-cursor">')):t.remove()),t},focusCursor:function(e,t){e!==!1&&(e=!0),t!==!1&&(t=!0);var n=this.removeCursor(!0);n&&n.each(function(n){this.selectNode(n,e,t)},this)},toString:function(){return"EditorSelection Object"}},e.Selection=e.EditorSelection},"3.7.2",{requires:["node"]});+YUI.add("editor-selection",function(e,t){var n="textContent",r="innerHTML",i="fontFamily";e.UA.ie&&(n="nodeValue"),e.EditorSelection=function(t){var n,r,i,s,o,u,a,f=0,l,c;e.config.win.getSelection&&(!e.UA.ie||e.UA.ie<9)?n=e.config.win.getSelection():e.config.doc.selection&&(n=e.config.doc.selection.createRange()),this._selection=n;if(!n)return!1;if(n.pasteHTML){this.isCollapsed=n.compareEndPoints("StartToEnd",n)?!1:!0;if(this.isCollapsed){this.anchorNode=this.focusNode=e.one(n.parentElement()),t&&(i=e.config.doc.elementFromPoint(t.clientX,t.clientY)),o=n.duplicate();if(!i){r=n.parentElement(),s=r.childNodes;for(u=0;u<s.length;u++)o.inRange(n)&&(i||(i=s[u]))}this.ieNode=i,i&&(i.nodeType!==3&&(i.firstChild&&(i=i.firstChild),i&&i.tagName&&i.tagName.toLowerCase()==="body"&&i.firstChild&&(i=i.firstChild)),this.anchorNode=this.focusNode=e.EditorSelection.resolve(i),o.moveToElementText(n.parentElement()),a=n.compareEndPoints("StartToStart",o),a&&(f=Math.abs(n.move("character",-9999))),this.anchorOffset=this.focusOffset=f,this.anchorTextNode=this.focusTextNode=e.one(i))}else n.htmlText&&n.htmlText!==""&&(l=e.Node.create(n.htmlText),l&&l.get("id")?(c=l.get("id"),this.anchorNode=this.focusNode=e.one("#"+c)):l&&(l=l.get("childNodes"),this.anchorNode=this.focusNode=l.item(0)))}else this.isCollapsed=n.isCollapsed,this.anchorNode=e.EditorSelection.resolve(n.anchorNode),this.focusNode=e.EditorSelection.resolve(n.focusNode),this.anchorOffset=n.anchorOffset,this.focusOffset=n.focusOffset,this.anchorTextNode=e.one(n.anchorNode),this.focusTextNode=e.one(n.focusNode);e.Lang.isString(n.text)?this.text=n.text:n.toString?this.text=n.toString():this.text=""},e.EditorSelection.removeFontFamily=function(t){t.removeAttribute("face");var n=t.getAttribute("style").toLowerCase();(n===""||n==="font-family: ")&&t.removeAttribute("style"),n.match(e.EditorSelection.REG_FONTFAMILY)&&(n=n.replace(e.EditorSelection.REG_FONTFAMILY,""),t.setAttribute("style",n))},e.EditorSelection.filter=function(t){var n=(new Date).getTime(),r,s=e.all(e.EditorSelection.ALL),o=e.all("strong,em"),u=e.config.doc,a,f={},l="",c,h=(new Date).getTime(),p;s.each(function(t){var n=e.Node.getDOMNode(t);n.style[i]&&(f["."+t._yuid]=n.style[i],t.addClass(t._yuid),e.EditorSelection.removeFontFamily(n))}),p=(new Date).getTime(),e.all(".hr").addClass("yui-skip").addClass("yui-non"),e.UA.ie&&(a=u.getElementsByTagName("hr"),e.each(a,function(e){var t=u.createElement("div"),n=t.style;t.className="hr yui-non yui-skip",t.setAttribute("readonly",!0),t.setAttribute("contenteditable",!1),e.parentNode&&e.parentNode.replaceChild(t,e),n.border="1px solid #ccc",n.lineHeight="0",n.height="0",n.fontSize="0",n.marginTop="5px",n.marginBottom="5px",n.marginLeft="0px",n.marginRight="0px",n.padding="0"})),e.each(f,function(e,t){l+=t+" { font-family: "+e.replace(/"/gi,"")+"; }"}),e.StyleSheet(l,"editor"),o.each(function(t,n){var r=t.get("tagName").toLowerCase(),i="i";r==="strong"&&(i="b"),e.EditorSelection.prototype._swap(o.item(n),i)}),c=e.all("ol,ul"),c.each(function(e){var t=e.all("li");t.size()||e.remove()}),t&&e.EditorSelection.filterBlocks(),r=(new Date).getTime()},e.EditorSelection.filterBlocks=function(){var t=(new Date).getTime(),r,i=e.config.doc.body.childNodes,s,o,u=!1,a=!0,f,l,c,h,p,d;if(i){for(s=0;s<i.length;s++)o=e.one(i[s]),o.test(e.EditorSelection.BLOCKS)?u=e.EditorSelection._wrapBlock(u):(a=!0,i[s].nodeType===3&&(h=i[s][n].match(e.EditorSelection.REG_CHAR),p=i[s][n].match(e.EditorSelection.REG_NON),h===null&&p&&(a=!1)),a&&(u||(u=[]),u.push(i[s])));u=e.EditorSelection._wrapBlock(u)}l=e.all(e.EditorSelection.DEFAULT_BLOCK_TAG);if(l.size()===1){c=l.item(0).all("br");if(c.size()===1){c.item(0).test(".yui-cursor")||c.item(0).remove(),d=l.item(0).get("innerHTML");if(d===""||d===" ")l.set("innerHTML",e.EditorSelection.CURSOR),f=new e.EditorSelection,f.focusCursor(!0,!0);c.item(0).test(".yui-cursor")&&e.UA.ie&&c.item(0).remove()}}else l.each(function(e){var t=e.get("innerHTML");t===""&&e.remove()});r=(new Date).getTime()},e.EditorSelection.REG_FONTFAMILY=/font-family:\s*;/,e.EditorSelection.REG_CHAR=/[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi,e.EditorSelection.REG_NON=/[\s|\n|\t]/gi,e.EditorSelection.REG_NOHTML=/<\S[^><]*>/g,e.EditorSelection._wrapBlock=function(t){if(t){var n=e.Node.create("<"+e.EditorSelection.DEFAULT_BLOCK_TAG+"></"+e.EditorSelection.DEFAULT_BLOCK_TAG+">"),r=e.one(t[0]),i;for(i=1;i<t.length;i++)n.append(t[i]);r.replace(n),n.prepend(r)}return!1},e.EditorSelection.unfilter=function(){var t=e.all("body [class]"),n="",r,s,o=e.one("body");return t.each(function(e){e.hasClass(e._yuid)&&(e.setStyle(i,e.getStyle(i)),e.removeClass(e._yuid),e.getAttribute("class")===""&&e.removeAttribute("class"))}),r=e.all(".yui-non"),r.each(function(e){!e.hasClass("yui-skip")&&e.get("innerHTML")===""?e.remove():e.removeClass("yui-non").removeClass("yui-skip")}),s=e.all("body [id]"),s.each(function(e){e.get("id").indexOf("yui_3_")===0&&(e.removeAttribute("id"),e.removeAttribute("_yuid"))}),o&&(n=o.get("innerHTML")),e.all(".hr").addClass("yui-skip").addClass("yui-non"),n},e.EditorSelection.resolve=function(t){if(t&&t.nodeType===3)try{t=t.parentNode}catch(n){t="body"}return e.one(t)},e.EditorSelection.getText=function(t){var n=t.get("innerHTML").replace(e.EditorSelection.REG_NOHTML,"");return n=n.replace("<span><br></span>","").replace("<br>",""),n},e.EditorSelection.DEFAULT_BLOCK_TAG="p",e.EditorSelection.ALL="[style],font[face]",e.EditorSelection.BLOCKS="p,div,ul,ol,table,style",e.EditorSelection.TMP="yui-tmp",e.EditorSelection.DEFAULT_TAG="span",e.EditorSelection.CURID="yui-cursor",e.EditorSelection.CUR_WRAPID="yui-cursor-wrapper",e.EditorSelection.CURSOR='<span><br class="yui-cursor"></span>',e.EditorSelection.hasCursor=function(){var t=e.all("#"+e.EditorSelection.CUR_WRAPID);return t.size()},e.EditorSelection.cleanCursor=function(){var t,n="br.yui-cursor";t=e.all(n),t.size()&&t.each(function(t){var n=t.get("parentNode.parentNode.childNodes"),r;n.size()?t.remove():(r=e.EditorSelection.getText(n.item(0)),r!==""&&t.remove())})},e.EditorSelection.prototype={text:null,isCollapsed:null,anchorNode:null,anchorOffset:null,anchorTextNode:null,focusNode:null,focusOffset:null,focusTextNode:null,_selection:null,_wrap:function(t,n){var i=e.Node.create("<"+n+"></"+n+">");return i.set(r,t.get(r)),t.set(r,""),t.append(i),e.Node.getDOMNode(i)},_swap:function(t,n){var i=e.Node.create("<"+n+"></"+n+">");return i.set(r,t.get(r)),t.replace(i,t),e.Node.getDOMNode(i)},getSelected:function(){e.EditorSelection.filter(),e.config.doc.execCommand("fontname",null,e.EditorSelection.TMP);var t=e.all(e.EditorSelection.ALL),n=[];return t.each(function(r,s){r.getStyle(i)===e.EditorSelection.TMP&&(r.setStyle(i,""),e.EditorSelection.removeFontFamily(r),r.test("body")||n.push(e.Node.getDOMNode(t.item(s))))}),e.all(n)},insertContent:function(e){return this.insertAtCursor(e,this.anchorTextNode,this.anchorOffset,!0)},insertAtCursor:function(t,r,i,s){var o=e.Node.create("<"+e.EditorSelection.DEFAULT_TAG+' class="yui-non"></'+e.EditorSelection.DEFAULT_TAG+">"),u,a,f,l,c=this.createRange(),h;r&&r.test("body")&&(h=e.Node.create("<span></span>"),r.append(h),r=h);if(c.pasteHTML){if(i===0&&r&&!r.previous()&&r.get("nodeType")===3)return r.insert(t,"before"),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(r.previous())),c.collapse(!1),c.select(),r.previous();l=e.Node.create(t);try{c.pasteHTML('<span id="rte-insert"></span>')}catch(p){}u=e.one("#rte-insert");if(u)return u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select(),l;e.on("available",function(){u.set("id",""),u.replace(l),c.moveToElementText&&c.moveToElementText(e.Node.getDOMNode(l)),c.collapse(!1),c.select()},"#rte-insert")}else i>0?(u=r.get(n),a=e.one(e.config.doc.createTextNode(u.substr(0,i))),f=e.one(e.config.doc.createTextNode(u.substr(i))),r.replace(a,r),l=e.Node.create(t),l.get("nodeType")===11&&(h=e.Node.create("<span></span>"),h.append(l),l=h),a.insert(l,"after"),f&&(l.insert(o,"after"),o.insert(f,"after"),this.selectNode(o,s))):(r.get("nodeType")===3&&(r=r.get("parentNode")),l=e.Node.create(t),t=r.get("innerHTML").replace(/\n/gi,""),t===""||t==="<br>"?r.append(l):l.get("parentNode")?r.insert(l,"before"):e.one("body").prepend(l),r.get("firstChild").test("br")&&r.get("firstChild").remove());return l},wrapContent:function(t){t=t?t:e.EditorSelection.DEFAULT_TAG;if(!this.isCollapsed){var n=this.getSelected(),r=[],i,s,o,u;return n.each(function(e,i){var s=e.get("tagName").toLowerCase();s==="font"?r.push(this._swap(n.item(i),t)):r.push(this._wrap(n.item(i),t))},this),i=this.createRange(),o=r[0],s=r[r.length-1],this._selection.removeAllRanges?(i.setStart(r[0],0),i.setEnd(s,s.childNodes.length),this._selection.removeAllRanges(),this._selection.addRange(i)):(i.moveToElementText&&(i.moveToElementText(e.Node.getDOMNode(o)),u=this.createRange(),u.moveToElementText(e.Node.getDOMNode(s)),i.setEndPoint("EndToEnd",u)),i.select()),r=e.all(r),r}return e.all([])},replace:function(t,r){var i=this.createRange(),s,o,u,a;return i.getBookmark?(u=i.getBookmark(),o=this.anchorNode.get("innerHTML").replace(t,r),this.anchorNode.set("innerHTML",o),i.moveToBookmark(u),a=e.one(i.parentElement())):(s=this.anchorTextNode,o=s.get(n),u=o.indexOf(t),o=o.replace(t,""),s.set(n,o),a=this.insertAtCursor(r,s,u,!0)),a},remove:function(){return this._selection&&this._selection.removeAllRanges&&this._selection.removeAllRanges(),this},createRange:function(){return e.config.doc.selection?e.config.doc.selection.createRange():e.config.doc.createRange()},selectNode:function(t,n,r){if(!t)return;r=r||0,t=e.Node.getDOMNode(t);var i=this.createRange();if(i.selectNode){i.selectNode(t),this._selection.removeAllRanges(),this._selection.addRange(i);if(n)try{this._selection.collapse(t,r)}catch(s){this._selection.collapse(t,0)}}else{t.nodeType===3&&(t=t.parentNode);try{i.moveToElementText(t)}catch(o){}n&&i.collapse(r?!1:!0),i.select()}return this},setCursor:function(){return this.removeCursor(!1),this.insertContent(e.EditorSelection.CURSOR)},getCursor:function(){return e.all("#"+e.EditorSelection.CURID)},removeCursor:function(e){var t=this.getCursor();return t&&(e?(t.removeAttribute("id"),t.set("innerHTML",'<br class="yui-cursor">')):t.remove()),t},focusCursor:function(e,t){e!==!1&&(e=!0),t!==!1&&(t=!0);var n=this.removeCursor(!0);n&&n.each(function(n){this.selectNode(n,e,t)},this)},toString:function(){return"EditorSelection Object"}},e.Selection=e.EditorSelection},"3.7.3",{requires:["node"]});
bundle/editor-selection/editor-selection.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -13,7 +13,7 @@ * @module editor * @submodule selection */- + //TODO This shouldn't be there, Y.Node doesn't normalize getting textnode content. var textContent = 'textContent', INNER_HTML = 'innerHTML',@@ -24,12 +24,13 @@ } Y.EditorSelection = function(domEvent) {- var sel, par, ieNode, nodes, rng, i;+ var sel, par, ieNode, nodes, rng, i,+ comp, moved = 0, n, id; if (Y.config.win.getSelection && (!Y.UA.ie || Y.UA.ie < 9)) {- sel = Y.config.win.getSelection();+ sel = Y.config.win.getSelection(); } else if (Y.config.doc.selection) {- sel = Y.config.doc.selection.createRange();+ sel = Y.config.doc.selection.createRange(); } this._selection = sel; @@ -62,7 +63,7 @@ } this.ieNode = ieNode;- + if (ieNode) { if (ieNode.nodeType !== 3) { if (ieNode.firstChild) {@@ -75,28 +76,27 @@ } } this.anchorNode = this.focusNode = Y.EditorSelection.resolve(ieNode);- + rng.moveToElementText(sel.parentElement());- var comp = sel.compareEndPoints('StartToStart', rng),- moved = 0;+ comp = sel.compareEndPoints('StartToStart', rng); if (comp) { //We are not at the beginning of the selection. //Setting the move to something large, may need to increase it later moved = Math.abs(sel.move('character', -9999)); }- + this.anchorOffset = this.focusOffset = moved;- + this.anchorTextNode = this.focusTextNode = Y.one(ieNode); }- - ++ } else { //This helps IE deal with a selection and nodeChange events if (sel.htmlText && sel.htmlText !== '') {- var n = Y.Node.create(sel.htmlText);+ n = Y.Node.create(sel.htmlText); if (n && n.get('id')) {- var id = n.get('id');+ id = n.get('id'); this.anchorNode = this.focusNode = Y.one('#' + id); } else if (n) { n = n.get('childNodes');@@ -113,7 +113,7 @@ this.focusNode = Y.EditorSelection.resolve(sel.focusNode); this.anchorOffset = sel.anchorOffset; this.focusOffset = sel.focusOffset;- + this.anchorTextNode = Y.one(sel.anchorNode); this.focusTextNode = Y.one(sel.focusNode); }@@ -127,7 +127,7 @@ } } };- + /** * Utility method to remove dead font-family styles from an element. * @static@@ -136,7 +136,7 @@ Y.EditorSelection.removeFontFamily = function(n) { n.removeAttribute('face'); var s = n.getAttribute('style').toLowerCase();- if (s === '' || (s == 'font-family: ')) {+ if (s === '' || (s === 'font-family: ')) { n.removeAttribute('style'); } if (s.match(Y.EditorSelection.REG_FONTFAMILY)) {@@ -153,15 +153,16 @@ * @method filter */ Y.EditorSelection.filter = function(blocks) {- var startTime = (new Date()).getTime(); - var nodes = Y.all(Y.EditorSelection.ALL),+ var startTime = (new Date()).getTime(),+ endTime,+ nodes = Y.all(Y.EditorSelection.ALL), baseNodes = Y.all('strong,em'), doc = Y.config.doc, hrs, classNames = {}, cssString = '',- ls;+ ls, startTime1 = (new Date()).getTime(),+ endTime1; - var startTime1 = (new Date()).getTime(); nodes.each(function(n) { var raw = Y.Node.getDOMNode(n); if (raw.style[FONT_FAMILY]) {@@ -170,58 +171,44 @@ Y.EditorSelection.removeFontFamily(raw); }- /*- if (n.getStyle(FONT_FAMILY)) {- classNames['.' + n._yuid] = n.getStyle(FONT_FAMILY);- n.addClass(n._yuid);- n.removeAttribute('face');- n.setStyle(FONT_FAMILY, '');- if (n.getAttribute('style') === '') {- n.removeAttribute('style');- }- //This is for IE- if (n.getAttribute('style').toLowerCase() === 'font-family: ') {- n.removeAttribute('style');- }- }- */ });- var endTime1 = (new Date()).getTime();+ endTime1 = (new Date()).getTime(); Y.all('.hr').addClass('yui-skip').addClass('yui-non');- + if (Y.UA.ie) { hrs = doc.getElementsByTagName('hr'); Y.each(hrs, function(hr) {- var el = doc.createElement('div');- el.className = 'hr yui-non yui-skip';- - el.setAttribute('readonly', true);- el.setAttribute('contenteditable', false); //Keep it from being Edited- if (hr.parentNode) {- hr.parentNode.replaceChild(el, hr);- }- //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');- var s = el.style;- s.border = '1px solid #ccc';- s.lineHeight = '0';- s.height = '0';- s.fontSize = '0';- s.marginTop = '5px';- s.marginBottom = '5px';- s.marginLeft = '0px';- s.marginRight = '0px';- s.padding = '0';+ var el = doc.createElement('div'),+ s = el.style;++ el.className = 'hr yui-non yui-skip';++ el.setAttribute('readonly', true);+ el.setAttribute('contenteditable', false); //Keep it from being Edited+ if (hr.parentNode) {+ hr.parentNode.replaceChild(el, hr);+ }+ //Had to move to inline style. writes for ie's < 8. They don't render el.setAttribute('style');+ s.border = '1px solid #ccc';+ s.lineHeight = '0';+ s.height = '0';+ s.fontSize = '0';+ s.marginTop = '5px';+ s.marginBottom = '5px';+ s.marginLeft = '0px';+ s.marginRight = '0px';+ s.padding = '0'; }); }- + Y.each(classNames, function(v, k) { cssString += k + ' { font-family: ' + v.replace(/"/gi, '') + '; }'; }); Y.StyleSheet(cssString, 'editor'); - + //Not sure about this one? baseNodes.each(function(n, k) { var t = n.get('tagName').toLowerCase(),@@ -234,17 +221,17 @@ //Filter out all the empty UL/OL's ls = Y.all('ol,ul');- ls.each(function(v, k) {+ ls.each(function(v) { var lis = v.all('li'); if (!lis.size()) { v.remove(); } });- + if (blocks) { Y.EditorSelection.filterBlocks(); }- var endTime = (new Date()).getTime();+ endTime = (new Date()).getTime(); }; /**@@ -253,21 +240,21 @@ * @method filterBlocks */ Y.EditorSelection.filterBlocks = function() {- var startTime = (new Date()).getTime();- var childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,- sel, single, br, divs, spans, c, s;+ var startTime = (new Date()).getTime(), endTime,+ childs = Y.config.doc.body.childNodes, i, node, wrapped = false, doit = true,+ sel, single, br, c, s, html; if (childs) { for (i = 0; i < childs.length; i++) { node = Y.one(childs[i]); if (!node.test(Y.EditorSelection.BLOCKS)) { doit = true;- if (childs[i].nodeType == 3) {+ if (childs[i].nodeType === 3) { c = childs[i][textContent].match(Y.EditorSelection.REG_CHAR); s = childs[i][textContent].match(Y.EditorSelection.REG_NON); if (c === null && s) { doit = false;- + } } if (doit) {@@ -290,7 +277,7 @@ if (!br.item(0).test('.yui-cursor')) { br.item(0).remove(); }- var html = single.item(0).get('innerHTML');+ html = single.item(0).get('innerHTML'); if (html === '' || html === ' ') { single.set('innerHTML', Y.EditorSelection.CURSOR); sel = new Y.EditorSelection();@@ -308,50 +295,22 @@ } }); }- - if (!Y.UA.ie) {- /*- divs = Y.all('div, p');- divs.each(function(d) {- if (d.hasClass('yui-non')) {- return;- }- var html = d.get('innerHTML');- if (html === '') {- d.remove();- } else {- if (d.get('childNodes').size() == 1) {- if (d.ancestor('p')) {- d.replace(d.get('firstChild'));- }- }- }- });*/ - /* Removed this, as it was causing Pasting to be funky in Safari- spans = Y.all('.Apple-style-span, .apple-style-span');- spans.each(function(s) {- s.setAttribute('style', '');- });- */- }--- var endTime = (new Date()).getTime();+ endTime = (new Date()).getTime(); }; /** * Regular Expression used to find dead font-family styles * @static * @property REG_FONTFAMILY- */ - Y.EditorSelection.REG_FONTFAMILY = /font-family: ;/;+ */+ Y.EditorSelection.REG_FONTFAMILY = /font-family:\s*;/; /** * Regular Expression to determine if a string has a character in it * @static * @property REG_CHAR- */ + */ Y.EditorSelection.REG_CHAR = /[a-zA-Z-0-9_!@#\$%\^&*\(\)-=_+\[\]\\{}|;':",.\/<>\?]/gi; /**@@ -399,8 +358,8 @@ var nodes = Y.all('body [class]'), html = '', nons, ids, body = Y.one('body');- - ++ nodes.each(function(n) { if (n.hasClass(n._yuid)) { //One of ours@@ -428,13 +387,13 @@ n.removeAttribute('_yuid'); } });- + if (body) { html = body.get('innerHTML'); }- + Y.all('.hr').addClass('yui-skip').addClass('yui-non');- + /* nodes.each(function(n) { n.addClass(n._yuid);@@ -444,7 +403,7 @@ } }); */- + return html; }; /**@@ -629,10 +588,10 @@ */ _selection: null, /**- * Wrap an element, with another element + * Wrap an element, with another element * @private * @method _wrap- * @param {HTMLElement} n The node to wrap + * @param {HTMLElement} n The node to wrap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The wrapped node */@@ -644,10 +603,10 @@ return Y.Node.getDOMNode(tmp); }, /**- * Swap an element, with another element + * Swap an element, with another element * @private * @method _swap- * @param {HTMLElement} n The node to swap + * @param {HTMLElement} n The node to swap * @param {String} tag The tag to use when creating the new element. * @return {HTMLElement} The new node */@@ -669,9 +628,9 @@ Y.config.doc.execCommand('fontname', null, Y.EditorSelection.TMP); var nodes = Y.all(Y.EditorSelection.ALL), items = [];- + nodes.each(function(n, k) {- if (n.getStyle(FONT_FAMILY) == Y.EditorSelection.TMP) {+ if (n.getStyle(FONT_FAMILY) === Y.EditorSelection.TMP) { n.setStyle(FONT_FAMILY, ''); Y.EditorSelection.removeFontFamily(n); if (!n.test('body')) {@@ -709,13 +668,13 @@ node = b; } - + if (range.pasteHTML) { if (offset === 0 && node && !node.previous() && node.get('nodeType') === 3) { /* * For some strange reason, range.pasteHTML fails if the node is a textNode and * the offset is 0. (The cursor is at the beginning of the line)- * It will always insert the new content at position 1 instead of + * It will always insert the new content at position 1 instead of * position 0. Here we test for that case and do it the hard way. */ node.insert(html, 'before');@@ -820,8 +779,8 @@ changed.push(this._wrap(items.item(k), tag)); } }, this);- - range = this.createRange();++ range = this.createRange(); first = changed[0]; last = changed[changed.length - 1]; if (this._selection.removeAllRanges) {@@ -848,7 +807,7 @@ } }, /**- * Find and replace a string inside a text node and replace it with HTML focusing the node after + * Find and replace a string inside a text node and replace it with HTML focusing the node after * to allow you to continue to type. * @method replace * @param {String} se The string to search for.@@ -896,7 +855,7 @@ if (Y.config.doc.selection) { return Y.config.doc.selection.createRange(); } else {- return Y.config.doc.createRange();+ return Y.config.doc.createRange(); } }, /**@@ -913,7 +872,7 @@ } end = end || 0; node = Y.Node.getDOMNode(node);- var range = this.createRange();+ var range = this.createRange(); if (range.selectNode) { range.selectNode(node); this._selection.removeAllRanges();@@ -1008,4 +967,4 @@ -}, '3.7.2', {"requires": ["node"]});+}, '3.7.3', {"requires": ["node"]});
bundle/editor-tab/editor-tab-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/editor-tab/editor-tab.js", code: [] };-_yuitest_coverage["build/editor-tab/editor-tab.js"].code=["YUI.add('editor-tab', function (Y, NAME) {","",""," /**"," * Handles tab and shift-tab indent/outdent support."," * @class Plugin.EditorTab"," * @constructor"," * @extends Base"," * @module editor"," * @submodule editor-tab"," */"," "," var EditorTab = function() {"," EditorTab.superclass.constructor.apply(this, arguments);"," }, HOST = 'host';",""," Y.extend(EditorTab, Y.Base, {"," /**"," * Listener for host's nodeChange event and captures the tabkey interaction."," * @private"," * @method _onNodeChange"," * @param {Event} e The Event facade passed from the host."," */"," _onNodeChange: function(e) {"," var action = 'indent';",""," if (e.changedType === 'tab') {"," if (!e.changedNode.test('li, li *')) {"," e.changedEvent.halt();"," e.preventDefault();"," if (e.changedEvent.shiftKey) {"," action = 'outdent';"," }",""," this.get(HOST).execCommand(action, '');"," }"," }"," },"," initializer: function() {"," this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * editorTab"," * @property NAME"," * @static"," */"," NAME: 'editorTab',"," /**"," * tab"," * @property NS"," * @static"," */"," NS: 'tab',"," ATTRS: {"," host: {"," value: false"," }"," }"," });","",""," Y.namespace('Plugin');",""," Y.Plugin.EditorTab = EditorTab;","","","}, '3.7.2', {\"requires\": [\"editor-base\"]});"];+_yuitest_coverage["build/editor-tab/editor-tab.js"].code=["YUI.add('editor-tab', function (Y, NAME) {","",""," /**"," * Handles tab and shift-tab indent/outdent support."," * @class Plugin.EditorTab"," * @constructor"," * @extends Base"," * @module editor"," * @submodule editor-tab"," */",""," var EditorTab = function() {"," EditorTab.superclass.constructor.apply(this, arguments);"," }, HOST = 'host';",""," Y.extend(EditorTab, Y.Base, {"," /**"," * Listener for host's nodeChange event and captures the tabkey interaction."," * @private"," * @method _onNodeChange"," * @param {Event} e The Event facade passed from the host."," */"," _onNodeChange: function(e) {"," var action = 'indent';",""," if (e.changedType === 'tab') {"," if (!e.changedNode.test('li, li *')) {"," e.changedEvent.halt();"," e.preventDefault();"," if (e.changedEvent.shiftKey) {"," action = 'outdent';"," }",""," this.get(HOST).execCommand(action, '');"," }"," }"," },"," initializer: function() {"," this.get(HOST).on('nodeChange', Y.bind(this._onNodeChange, this));"," }"," }, {"," /**"," * editorTab"," * @property NAME"," * @static"," */"," NAME: 'editorTab',"," /**"," * tab"," * @property NS"," * @static"," */"," NS: 'tab',"," ATTRS: {"," host: {"," value: false"," }"," }"," });","",""," Y.namespace('Plugin');",""," Y.Plugin.EditorTab = EditorTab;","","","}, '3.7.3', {\"requires\": [\"editor-base\"]});"]; _yuitest_coverage["build/editor-tab/editor-tab.js"].lines = {"1":0,"13":0,"14":0,"17":0,"25":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"35":0,"40":0,"63":0,"65":0}; _yuitest_coverage["build/editor-tab/editor-tab.js"].functions = {"EditorTab:13":0,"_onNodeChange:24":0,"initializer:39":0,"(anonymous 1):1":0}; _yuitest_coverage["build/editor-tab/editor-tab.js"].coveredLines = 15;@@ -49,7 +49,7 @@ * @module editor * @submodule editor-tab */- + _yuitest_coverfunc("build/editor-tab/editor-tab.js", "(anonymous 1)", 1); _yuitest_coverline("build/editor-tab/editor-tab.js", 13); var EditorTab = function() {@@ -123,4 +123,4 @@ Y.Plugin.EditorTab = EditorTab; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-tab/editor-tab-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,7 +15,7 @@ * @module editor * @submodule editor-tab */- + var EditorTab = function() { EditorTab.superclass.constructor.apply(this, arguments); }, HOST = 'host';@@ -72,4 +72,4 @@ Y.Plugin.EditorTab = EditorTab; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/editor-tab/editor-tab-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("editor-tab",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host";e.extend(n,e.Base,{_onNodeChange:function(e){var t="indent";e.changedType==="tab"&&(e.changedNode.test("li, li *")||(e.changedEvent.halt(),e.preventDefault(),e.changedEvent.shiftKey&&(t="outdent"),this.get(r).execCommand(t,"")))},initializer:function(){this.get(r).on("nodeChange",e.bind(this._onNodeChange,this))}},{NAME:"editorTab",NS:"tab",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorTab=n},"3.7.2",{requires:["editor-base"]});+YUI.add("editor-tab",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="host";e.extend(n,e.Base,{_onNodeChange:function(e){var t="indent";e.changedType==="tab"&&(e.changedNode.test("li, li *")||(e.changedEvent.halt(),e.preventDefault(),e.changedEvent.shiftKey&&(t="outdent"),this.get(r).execCommand(t,"")))},initializer:function(){this.get(r).on("nodeChange",e.bind(this._onNodeChange,this))}},{NAME:"editorTab",NS:"tab",ATTRS:{host:{value:!1}}}),e.namespace("Plugin"),e.Plugin.EditorTab=n},"3.7.3",{requires:["editor-base"]});
bundle/editor-tab/editor-tab.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,7 +15,7 @@ * @module editor * @submodule editor-tab */- + var EditorTab = function() { EditorTab.superclass.constructor.apply(this, arguments); }, HOST = 'host';@@ -71,4 +71,4 @@ Y.Plugin.EditorTab = EditorTab; -}, '3.7.2', {"requires": ["editor-base"]});+}, '3.7.3', {"requires": ["editor-base"]});
bundle/escape/escape-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/escape/escape.js", code: [] };-_yuitest_coverage["build/escape/escape.js"].code=["YUI.add('escape', function (Y, NAME) {","","/**","Provides utility methods for escaping strings.","","@module escape","@class Escape","@static","@since 3.3.0","**/","","var HTML_CHARS = {"," '&': '&',"," '<': '<',"," '>': '>',"," '\"': '"',"," \"'\": ''',"," '/': '/',"," '`': '`'"," },","","Escape = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," Returns a copy of the specified string with special HTML characters"," escaped. The following characters will be converted to their"," corresponding character entities:",""," & < > \" ' / `",""," This implementation is based on the [OWASP HTML escaping"," recommendations][1]. In addition to the characters in the OWASP"," recommendations, we also escape the <code>`</code> character, since IE"," interprets it as an attribute delimiter.",""," If _string_ is not already a string, it will be coerced to a string.",""," [1]: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet",""," @method html"," @param {String} string String to escape."," @return {String} Escaped string."," @static"," **/"," html: function (string) {"," return (string + '').replace(/[&<>\"'\\/`]/g, Escape._htmlReplacer);"," },",""," /**"," Returns a copy of the specified string with special regular expression"," characters escaped, allowing the string to be used safely inside a regex."," The following characters, and all whitespace characters, are escaped:",""," - $ ^ * ( ) + [ ] { } | \\ , . ?",""," If _string_ is not already a string, it will be coerced to a string.",""," @method regex"," @param {String} string String to escape."," @return {String} Escaped string."," @static"," **/"," regex: function (string) {"," // There's no need to escape !, =, and : since they only have meaning"," // when they follow a parenthesized ?, as in (?:...), and we already"," // escape parens and question marks."," return (string + '').replace(/[\\-$\\^*()+\\[\\]{}|\\\\,.?\\s]/g, '\\\\$&');"," },",""," // -- Protected Static Methods ---------------------------------------------",""," /**"," * Regex replacer for HTML escaping."," *"," * @method _htmlReplacer"," * @param {String} match Matched character (must exist in HTML_CHARS)."," * @returns {String} HTML entity."," * @static"," * @protected"," */"," _htmlReplacer: function (match) {"," return HTML_CHARS[match];"," }","};","","Escape.regexp = Escape.regex;","","Y.Escape = Escape;","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/escape/escape.js"].code=["YUI.add('escape', function (Y, NAME) {","","/**","Provides utility methods for escaping strings.","","@module escape","@class Escape","@static","@since 3.3.0","**/","","var HTML_CHARS = {"," '&': '&',"," '<': '<',"," '>': '>',"," '\"': '"',"," \"'\": ''',"," '/': '/',"," '`': '`'"," },","","Escape = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," Returns a copy of the specified string with special HTML characters"," escaped. The following characters will be converted to their"," corresponding character entities:",""," & < > \" ' / `",""," This implementation is based on the [OWASP HTML escaping"," recommendations][1]. In addition to the characters in the OWASP"," recommendations, we also escape the <code>`</code> character, since IE"," interprets it as an attribute delimiter.",""," If _string_ is not already a string, it will be coerced to a string.",""," [1]: http://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet",""," @method html"," @param {String} string String to escape."," @return {String} Escaped string."," @static"," **/"," html: function (string) {"," return (string + '').replace(/[&<>\"'\\/`]/g, Escape._htmlReplacer);"," },",""," /**"," Returns a copy of the specified string with special regular expression"," characters escaped, allowing the string to be used safely inside a regex."," The following characters, and all whitespace characters, are escaped:",""," - $ ^ * ( ) + [ ] { } | \\ , . ?",""," If _string_ is not already a string, it will be coerced to a string.",""," @method regex"," @param {String} string String to escape."," @return {String} Escaped string."," @static"," **/"," regex: function (string) {"," // There's no need to escape !, =, and : since they only have meaning"," // when they follow a parenthesized ?, as in (?:...), and we already"," // escape parens and question marks."," return (string + '').replace(/[\\-$\\^*()+\\[\\]{}|\\\\,.?\\s]/g, '\\\\$&');"," },",""," // -- Protected Static Methods ---------------------------------------------",""," /**"," * Regex replacer for HTML escaping."," *"," * @method _htmlReplacer"," * @param {String} match Matched character (must exist in HTML_CHARS)."," * @returns {String} HTML entity."," * @static"," * @protected"," */"," _htmlReplacer: function (match) {"," return HTML_CHARS[match];"," }","};","","Escape.regexp = Escape.regex;","","Y.Escape = Escape;","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/escape/escape.js"].lines = {"1":0,"12":0,"47":0,"68":0,"83":0,"87":0,"89":0}; _yuitest_coverage["build/escape/escape.js"].functions = {"html:46":0,"regex:64":0,"_htmlReplacer:82":0,"(anonymous 1):1":0}; _yuitest_coverage["build/escape/escape.js"].coveredLines = 7;@@ -139,4 +139,4 @@ Y.Escape = Escape; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/escape/escape-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -95,4 +95,4 @@ Y.Escape = Escape; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/escape/escape-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("escape",function(e,t){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},r={html:function(e){return(e+"").replace(/[&<>"'\/`]/g,r._htmlReplacer)},regex:function(e){return(e+"").replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g,"\\$&")},_htmlReplacer:function(e){return n[e]}};r.regexp=r.regex,e.Escape=r},"3.7.2",{requires:["yui-base"]});+YUI.add("escape",function(e,t){var n={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`"},r={html:function(e){return(e+"").replace(/[&<>"'\/`]/g,r._htmlReplacer)},regex:function(e){return(e+"").replace(/[\-$\^*()+\[\]{}|\\,.?\s]/g,"\\$&")},_htmlReplacer:function(e){return n[e]}};r.regexp=r.regex,e.Escape=r},"3.7.3",{requires:["yui-base"]});
bundle/escape/escape.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -95,4 +95,4 @@ Y.Escape = Escape; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/event-base-ie/event-base-ie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-base-ie/event-base-ie.js", code: [] };-_yuitest_coverage["build/event-base-ie/event-base-ie.js"].code=["(function() {","","var stateChangeListener,"," GLOBAL_ENV = YUI.Env,"," config = YUI.config,"," doc = config.doc,"," docElement = doc && doc.documentElement,"," EVENT_NAME = 'onreadystatechange',"," pollInterval = config.pollInterval || 40;","","if (docElement.doScroll && !GLOBAL_ENV._ieready) {"," GLOBAL_ENV._ieready = function() {"," GLOBAL_ENV._ready();"," };","","/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */","// Internet Explorer: use the doScroll() method on the root element.","// 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 (self !== self.top) {"," stateChangeListener = function() {"," if (doc.readyState == 'complete') {"," GLOBAL_ENV.remove(doc, EVENT_NAME, stateChangeListener);"," GLOBAL_ENV.ieready();"," }"," };"," GLOBAL_ENV.add(doc, EVENT_NAME, stateChangeListener);"," } else {"," GLOBAL_ENV._dri = setInterval(function() {"," try {"," docElement.doScroll('left');"," clearInterval(GLOBAL_ENV._dri);"," GLOBAL_ENV._dri = null;"," GLOBAL_ENV._ieready();"," } catch (domNotReady) { }"," }, pollInterval);"," }","}","","})();","YUI.add('event-base-ie', function (Y, NAME) {","","/*"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event"," * @submodule event-base"," */","","function IEEventFacade() {"," // IEEventFacade.superclass.constructor.apply(this, arguments);"," Y.DOM2EventFacade.apply(this, arguments);","}","","/*"," * (intentially left out of API docs)"," * Alternate Facade implementation that is based on Object.defineProperty, which"," * is partially supported in IE8. Properties that involve setup work are"," * deferred to temporary getters using the static _define method."," */","function IELazyFacade(e) {"," var proxy = Y.config.doc.createEventObject(e),"," proto = IELazyFacade.prototype;",""," // TODO: necessary?"," proxy.hasOwnProperty = function () { return true; };",""," proxy.init = proto.init;"," proxy.halt = proto.halt;"," proxy.preventDefault = proto.preventDefault;"," proxy.stopPropagation = proto.stopPropagation;"," proxy.stopImmediatePropagation = proto.stopImmediatePropagation;",""," Y.DOM2EventFacade.apply(proxy, arguments);",""," return proxy;","}","","","var imp = Y.config.doc && Y.config.doc.implementation,"," useLazyFacade = Y.config.lazyEventFacade,",""," buttonMap = {"," 0: 1, // left click"," 4: 2, // middle click"," 2: 3 // right click"," },"," relatedTargetMap = {"," mouseout: 'toElement',"," mouseover: 'fromElement'"," },",""," resolve = Y.DOM2EventFacade.resolve,",""," proto = {"," init: function() {",""," IEEventFacade.superclass.init.apply(this, arguments);",""," var e = this._event,"," x, y, d, b, de, t;",""," this.target = resolve(e.srcElement);",""," if (('clientX' in e) && (!x) && (0 !== x)) {"," x = e.clientX;"," y = e.clientY;",""," d = Y.config.doc;"," b = d.body;"," de = d.documentElement;",""," x += (de.scrollLeft || (b && b.scrollLeft) || 0);"," y += (de.scrollTop || (b && b.scrollTop) || 0);",""," this.pageX = x;"," this.pageY = y;"," }",""," if (e.type == \"mouseout\") {"," t = e.toElement;"," } else if (e.type == \"mouseover\") {"," t = e.fromElement;"," }",""," // fallback to t.relatedTarget to support simulated events."," // IE doesn't support setting toElement or fromElement on generic"," // events, so Y.Event.simulate sets relatedTarget instead."," this.relatedTarget = resolve(t || e.relatedTarget);",""," // which should contain the unicode key code if this is a key event."," // For click events, which is normalized for which mouse button was"," // clicked."," this.which = // chained assignment"," this.button = e.keyCode || buttonMap[e.button] || e.button;"," },",""," stopPropagation: function() {"," this._event.cancelBubble = true;"," this._wrapper.stopped = 1;"," this.stopped = 1;"," },",""," stopImmediatePropagation: function() {"," this.stopPropagation();"," this._wrapper.stopped = 2;"," this.stopped = 2;"," },",""," preventDefault: function(returnValue) {"," this._event.returnValue = returnValue || false;"," this._wrapper.prevented = 1;"," this.prevented = 1;"," }"," };","","Y.extend(IEEventFacade, Y.DOM2EventFacade, proto);","","Y.extend(IELazyFacade, Y.DOM2EventFacade, proto);","IELazyFacade.prototype.init = function () {"," var e = this._event,"," overrides = this._wrapper.overrides,"," define = IELazyFacade._define,"," lazyProperties = IELazyFacade._lazyProperties,"," prop;",""," this.altKey = e.altKey;"," this.ctrlKey = e.ctrlKey;"," this.metaKey = e.metaKey;"," this.shiftKey = e.shiftKey;"," this.type = (overrides && overrides.type) || e.type;"," this.clientX = e.clientX;"," this.clientY = e.clientY;"," this.keyCode = // chained assignment"," this.charCode = e.keyCode;"," this.which = // chained assignment"," this.button = e.keyCode || buttonMap[e.button] || e.button;",""," for (prop in lazyProperties) {"," if (lazyProperties.hasOwnProperty(prop)) {"," define(this, prop, lazyProperties[prop]);"," }"," }",""," if (this._touch) {"," this._touch(e, this._currentTarget, this._wrapper);"," }","};","","IELazyFacade._lazyProperties = {"," target: function () {"," return resolve(this._event.srcElement);"," },"," relatedTarget: function () {"," var e = this._event,"," targetProp = relatedTargetMap[e.type] || 'relatedTarget';",""," // fallback to t.relatedTarget to support simulated events."," // IE doesn't support setting toElement or fromElement on generic"," // events, so Y.Event.simulate sets relatedTarget instead."," return resolve(e[targetProp] || e.relatedTarget);"," },"," currentTarget: function () {"," return resolve(this._currentTarget);"," },",""," wheelDelta: function () {"," var e = this._event;",""," if (e.type === \"mousewheel\" || e.type === \"DOMMouseScroll\") {"," return (e.detail) ?"," (e.detail * -1) :"," // wheelDelta between -80 and 80 result in -1 or 1"," Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1);"," }"," },",""," pageX: function () {"," var e = this._event,"," val = e.pageX,"," doc, bodyScroll, docScroll;"," "," if (val === undefined) {"," doc = Y.config.doc;"," bodyScroll = doc.body && doc.body.scrollLeft;"," docScroll = doc.documentElement.scrollLeft;",""," val = e.clientX + (docScroll || bodyScroll || 0);"," }",""," return val;"," },"," pageY: function () {"," var e = this._event,"," val = e.pageY,"," doc, bodyScroll, docScroll;"," "," if (val === undefined) {"," doc = Y.config.doc;"," bodyScroll = doc.body && doc.body.scrollTop;"," docScroll = doc.documentElement.scrollTop;",""," val = e.clientY + (docScroll || bodyScroll || 0);"," }",""," return val;"," }","};","","","/**"," * Wrapper function for Object.defineProperty that creates a property whose"," * value will be calulated only when asked for. After calculating the value,"," * the getter wll be removed, so it will behave as a normal property beyond that"," * point. A setter is also assigned so assigning to the property will clear"," * the getter, so foo.prop = 'a'; foo.prop; won't trigger the getter,"," * overwriting value 'a'."," *"," * Used only by the DOMEventFacades used by IE8 when the YUI configuration"," * <code>lazyEventFacade</code> is set to true."," *"," * @method _define"," * @param o {DOMObject} A DOM object to add the property to"," * @param prop {String} The name of the new property"," * @param valueFn {Function} The function that will return the initial, default"," * value for the property."," * @static"," * @private"," */","IELazyFacade._define = function (o, prop, valueFn) {"," function val(v) {"," var ret = (arguments.length) ? v : valueFn.call(this);",""," delete o[prop];"," Object.defineProperty(o, prop, {"," value: ret,"," configurable: true,"," writable: true"," });"," return ret;"," }"," Object.defineProperty(o, prop, {"," get: val,"," set: val,"," configurable: true"," });","};","","if (imp && (!imp.hasFeature('Events', '2.0'))) {"," if (useLazyFacade) {"," // Make sure we can use the lazy facade logic"," try {"," Object.defineProperty(Y.config.doc.createEventObject(), 'z', {});"," } catch (e) {"," useLazyFacade = false;"," }"," }"," "," Y.DOMEventFacade = (useLazyFacade) ? IELazyFacade : IEEventFacade;","}","","","}, '3.7.2', {\"requires\": [\"node-base\"]});"];+_yuitest_coverage["build/event-base-ie/event-base-ie.js"].code=["(function() {","","var stateChangeListener,"," GLOBAL_ENV = YUI.Env,"," config = YUI.config,"," doc = config.doc,"," docElement = doc && doc.documentElement,"," EVENT_NAME = 'onreadystatechange',"," pollInterval = config.pollInterval || 40;","","if (docElement.doScroll && !GLOBAL_ENV._ieready) {"," GLOBAL_ENV._ieready = function() {"," GLOBAL_ENV._ready();"," };","","/*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */","// Internet Explorer: use the doScroll() method on the root element.","// 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 (self !== self.top) {"," stateChangeListener = function() {"," if (doc.readyState == 'complete') {"," GLOBAL_ENV.remove(doc, EVENT_NAME, stateChangeListener);"," GLOBAL_ENV.ieready();"," }"," };"," GLOBAL_ENV.add(doc, EVENT_NAME, stateChangeListener);"," } else {"," GLOBAL_ENV._dri = setInterval(function() {"," try {"," docElement.doScroll('left');"," clearInterval(GLOBAL_ENV._dri);"," GLOBAL_ENV._dri = null;"," GLOBAL_ENV._ieready();"," } catch (domNotReady) { }"," }, pollInterval);"," }","}","","})();","YUI.add('event-base-ie', function (Y, NAME) {","","/*"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event"," * @submodule event-base"," */","","function IEEventFacade() {"," // IEEventFacade.superclass.constructor.apply(this, arguments);"," Y.DOM2EventFacade.apply(this, arguments);","}","","/*"," * (intentially left out of API docs)"," * Alternate Facade implementation that is based on Object.defineProperty, which"," * is partially supported in IE8. Properties that involve setup work are"," * deferred to temporary getters using the static _define method."," */","function IELazyFacade(e) {"," var proxy = Y.config.doc.createEventObject(e),"," proto = IELazyFacade.prototype;",""," // TODO: necessary?"," proxy.hasOwnProperty = function () { return true; };",""," proxy.init = proto.init;"," proxy.halt = proto.halt;"," proxy.preventDefault = proto.preventDefault;"," proxy.stopPropagation = proto.stopPropagation;"," proxy.stopImmediatePropagation = proto.stopImmediatePropagation;",""," Y.DOM2EventFacade.apply(proxy, arguments);",""," return proxy;","}","","","var imp = Y.config.doc && Y.config.doc.implementation,"," useLazyFacade = Y.config.lazyEventFacade,",""," buttonMap = {"," 0: 1, // left click"," 4: 2, // middle click"," 2: 3 // right click"," },"," relatedTargetMap = {"," mouseout: 'toElement',"," mouseover: 'fromElement'"," },",""," resolve = Y.DOM2EventFacade.resolve,",""," proto = {"," init: function() {",""," IEEventFacade.superclass.init.apply(this, arguments);",""," var e = this._event,"," x, y, d, b, de, t;",""," this.target = resolve(e.srcElement);",""," if (('clientX' in e) && (!x) && (0 !== x)) {"," x = e.clientX;"," y = e.clientY;",""," d = Y.config.doc;"," b = d.body;"," de = d.documentElement;",""," x += (de.scrollLeft || (b && b.scrollLeft) || 0);"," y += (de.scrollTop || (b && b.scrollTop) || 0);",""," this.pageX = x;"," this.pageY = y;"," }",""," if (e.type == \"mouseout\") {"," t = e.toElement;"," } else if (e.type == \"mouseover\") {"," t = e.fromElement;"," }",""," // fallback to t.relatedTarget to support simulated events."," // IE doesn't support setting toElement or fromElement on generic"," // events, so Y.Event.simulate sets relatedTarget instead."," this.relatedTarget = resolve(t || e.relatedTarget);",""," // which should contain the unicode key code if this is a key event."," // For click events, which is normalized for which mouse button was"," // clicked."," this.which = // chained assignment"," this.button = e.keyCode || buttonMap[e.button] || e.button;"," },",""," stopPropagation: function() {"," this._event.cancelBubble = true;"," this._wrapper.stopped = 1;"," this.stopped = 1;"," },",""," stopImmediatePropagation: function() {"," this.stopPropagation();"," this._wrapper.stopped = 2;"," this.stopped = 2;"," },",""," preventDefault: function(returnValue) {"," this._event.returnValue = returnValue || false;"," this._wrapper.prevented = 1;"," this.prevented = 1;"," }"," };","","Y.extend(IEEventFacade, Y.DOM2EventFacade, proto);","","Y.extend(IELazyFacade, Y.DOM2EventFacade, proto);","IELazyFacade.prototype.init = function () {"," var e = this._event,"," overrides = this._wrapper.overrides,"," define = IELazyFacade._define,"," lazyProperties = IELazyFacade._lazyProperties,"," prop;",""," this.altKey = e.altKey;"," this.ctrlKey = e.ctrlKey;"," this.metaKey = e.metaKey;"," this.shiftKey = e.shiftKey;"," this.type = (overrides && overrides.type) || e.type;"," this.clientX = e.clientX;"," this.clientY = e.clientY;"," this.keyCode = // chained assignment"," this.charCode = e.keyCode;"," this.which = // chained assignment"," this.button = e.keyCode || buttonMap[e.button] || e.button;",""," for (prop in lazyProperties) {"," if (lazyProperties.hasOwnProperty(prop)) {"," define(this, prop, lazyProperties[prop]);"," }"," }",""," if (this._touch) {"," this._touch(e, this._currentTarget, this._wrapper);"," }","};","","IELazyFacade._lazyProperties = {"," target: function () {"," return resolve(this._event.srcElement);"," },"," relatedTarget: function () {"," var e = this._event,"," targetProp = relatedTargetMap[e.type] || 'relatedTarget';",""," // fallback to t.relatedTarget to support simulated events."," // IE doesn't support setting toElement or fromElement on generic"," // events, so Y.Event.simulate sets relatedTarget instead."," return resolve(e[targetProp] || e.relatedTarget);"," },"," currentTarget: function () {"," return resolve(this._currentTarget);"," },",""," wheelDelta: function () {"," var e = this._event;",""," if (e.type === \"mousewheel\" || e.type === \"DOMMouseScroll\") {"," return (e.detail) ?"," (e.detail * -1) :"," // wheelDelta between -80 and 80 result in -1 or 1"," Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1);"," }"," },",""," pageX: function () {"," var e = this._event,"," val = e.pageX,"," doc, bodyScroll, docScroll;"," "," if (val === undefined) {"," doc = Y.config.doc;"," bodyScroll = doc.body && doc.body.scrollLeft;"," docScroll = doc.documentElement.scrollLeft;",""," val = e.clientX + (docScroll || bodyScroll || 0);"," }",""," return val;"," },"," pageY: function () {"," var e = this._event,"," val = e.pageY,"," doc, bodyScroll, docScroll;"," "," if (val === undefined) {"," doc = Y.config.doc;"," bodyScroll = doc.body && doc.body.scrollTop;"," docScroll = doc.documentElement.scrollTop;",""," val = e.clientY + (docScroll || bodyScroll || 0);"," }",""," return val;"," }","};","","","/**"," * Wrapper function for Object.defineProperty that creates a property whose"," * value will be calulated only when asked for. After calculating the value,"," * the getter wll be removed, so it will behave as a normal property beyond that"," * point. A setter is also assigned so assigning to the property will clear"," * the getter, so foo.prop = 'a'; foo.prop; won't trigger the getter,"," * overwriting value 'a'."," *"," * Used only by the DOMEventFacades used by IE8 when the YUI configuration"," * <code>lazyEventFacade</code> is set to true."," *"," * @method _define"," * @param o {DOMObject} A DOM object to add the property to"," * @param prop {String} The name of the new property"," * @param valueFn {Function} The function that will return the initial, default"," * value for the property."," * @static"," * @private"," */","IELazyFacade._define = function (o, prop, valueFn) {"," function val(v) {"," var ret = (arguments.length) ? v : valueFn.call(this);",""," delete o[prop];"," Object.defineProperty(o, prop, {"," value: ret,"," configurable: true,"," writable: true"," });"," return ret;"," }"," Object.defineProperty(o, prop, {"," get: val,"," set: val,"," configurable: true"," });","};","","if (imp && (!imp.hasFeature('Events', '2.0'))) {"," if (useLazyFacade) {"," // Make sure we can use the lazy facade logic"," try {"," Object.defineProperty(Y.config.doc.createEventObject(), 'z', {});"," } catch (e) {"," useLazyFacade = false;"," }"," }"," "," Y.DOMEventFacade = (useLazyFacade) ? IELazyFacade : IEEventFacade;","}","","","}, '3.7.3', {\"requires\": [\"node-base\"]});"]; _yuitest_coverage["build/event-base-ie/event-base-ie.js"].lines = {"1":0,"3":0,"11":0,"12":0,"13":0,"20":0,"21":0,"22":0,"23":0,"24":0,"27":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"41":0,"50":0,"52":0,"61":0,"62":0,"66":0,"68":0,"69":0,"70":0,"71":0,"72":0,"74":0,"76":0,"80":0,"98":0,"100":0,"103":0,"105":0,"106":0,"107":0,"109":0,"110":0,"111":0,"113":0,"114":0,"116":0,"117":0,"120":0,"121":0,"122":0,"123":0,"129":0,"134":0,"139":0,"140":0,"141":0,"145":0,"146":0,"147":0,"151":0,"152":0,"153":0,"157":0,"159":0,"160":0,"161":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"176":0,"179":0,"180":0,"181":0,"185":0,"186":0,"190":0,"192":0,"195":0,"201":0,"204":0,"208":0,"210":0,"211":0,"219":0,"223":0,"224":0,"225":0,"226":0,"228":0,"231":0,"234":0,"238":0,"239":0,"240":0,"241":0,"243":0,"246":0,"270":0,"271":0,"272":0,"274":0,"275":0,"280":0,"282":0,"289":0,"290":0,"292":0,"293":0,"295":0,"299":0}; _yuitest_coverage["build/event-base-ie/event-base-ie.js"].functions = {"_ieready:12":0,"stateChangeListener:21":0,"(anonymous 2):29":0,"(anonymous 1):1":0,"IEEventFacade:50":0,"hasOwnProperty:66":0,"IELazyFacade:61":0,"init:96":0,"stopPropagation:138":0,"stopImmediatePropagation:144":0,"preventDefault:150":0,"init:160":0,"target:191":0,"relatedTarget:194":0,"currentTarget:203":0,"wheelDelta:207":0,"pageX:218":0,"pageY:233":0,"val:271":0,"_define:270":0,"(anonymous 3):41":0}; _yuitest_coverage["build/event-base-ie/event-base-ie.js"].coveredLines = 112;@@ -472,4 +472,4 @@ } -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-base-ie/event-base-ie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -306,4 +306,4 @@ } -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-base-ie/event-base-ie-min.js view
@@ -1,9 +1,9 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ (function(){var e,t=YUI.Env,n=YUI.config,r=n.doc,i=r&&r.documentElement,s="onreadystatechange",o=n.pollInterval||40;i.doScroll&&!t._ieready&&(t._ieready=function(){t._ready()}, /*! DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller/Diego Perini */-self!==self.top?(e=function(){r.readyState=="complete"&&(t.remove(r,s,e),t.ieready())},t.add(r,s,e)):t._dri=setInterval(function(){try{i.doScroll("left"),clearInterval(t._dri),t._dri=null,t._ieready()}catch(e){}},o))})(),YUI.add("event-base-ie",function(e,t){function n(){e.DOM2EventFacade.apply(this,arguments)}function r(t){var n=e.config.doc.createEventObject(t),i=r.prototype;return n.hasOwnProperty=function(){return!0},n.init=i.init,n.halt=i.halt,n.preventDefault=i.preventDefault,n.stopPropagation=i.stopPropagation,n.stopImmediatePropagation=i.stopImmediatePropagation,e.DOM2EventFacade.apply(n,arguments),n}var i=e.config.doc&&e.config.doc.implementation,s=e.config.lazyEventFacade,o={0:1,4:2,2:3},u={mouseout:"toElement",mouseover:"fromElement"},a=e.DOM2EventFacade.resolve,f={init:function(){n.superclass.init.apply(this,arguments);var t=this._event,r,i,s,u,f,l;this.target=a(t.srcElement),"clientX"in t&&!r&&0!==r&&(r=t.clientX,i=t.clientY,s=e.config.doc,u=s.body,f=s.documentElement,r+=f.scrollLeft||u&&u.scrollLeft||0,i+=f.scrollTop||u&&u.scrollTop||0,this.pageX=r,this.pageY=i),t.type=="mouseout"?l=t.toElement:t.type=="mouseover"&&(l=t.fromElement),this.relatedTarget=a(l||t.relatedTarget),this.which=this.button=t.keyCode||o[t.button]||t.button},stopPropagation:function(){this._event.cancelBubble=!0,this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){this._event.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1}};e.extend(n,e.DOM2EventFacade,f),e.extend(r,e.DOM2EventFacade,f),r.prototype.init=function(){var e=this._event,t=this._wrapper.overrides,n=r._define,i=r._lazyProperties,s;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.keyCode=this.charCode=e.keyCode,this.which=this.button=e.keyCode||o[e.button]||e.button;for(s in i)i.hasOwnProperty(s)&&n(this,s,i[s]);this._touch&&this._touch(e,this._currentTarget,this._wrapper)},r._lazyProperties={target:function(){return a(this._event.srcElement)},relatedTarget:function(){var e=this._event,t=u[e.type]||"relatedTarget";return a(e[t]||e.relatedTarget)},currentTarget:function(){return a(this._currentTarget)},wheelDelta:function(){var e=this._event;if(e.type==="mousewheel"||e.type==="DOMMouseScroll")return e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1)},pageX:function(){var t=this._event,n=t.pageX,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollLeft,s=r.documentElement.scrollLeft,n=t.clientX+(s||i||0)),n},pageY:function(){var t=this._event,n=t.pageY,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollTop,s=r.documentElement.scrollTop,n=t.clientY+(s||i||0)),n}},r._define=function(e,t,n){function r(r){var i=arguments.length?r:n.call(this);return delete e[t],Object.defineProperty(e,t,{value:i,configurable:!0,writable:!0}),i}Object.defineProperty(e,t,{get:r,set:r,configurable:!0})};if(i&&!i.hasFeature("Events","2.0")){if(s)try{Object.defineProperty(e.config.doc.createEventObject(),"z",{})}catch(l){s=!1}e.DOMEventFacade=s?r:n}},"3.7.2",{requires:["node-base"]});+self!==self.top?(e=function(){r.readyState=="complete"&&(t.remove(r,s,e),t.ieready())},t.add(r,s,e)):t._dri=setInterval(function(){try{i.doScroll("left"),clearInterval(t._dri),t._dri=null,t._ieready()}catch(e){}},o))})(),YUI.add("event-base-ie",function(e,t){function n(){e.DOM2EventFacade.apply(this,arguments)}function r(t){var n=e.config.doc.createEventObject(t),i=r.prototype;return n.hasOwnProperty=function(){return!0},n.init=i.init,n.halt=i.halt,n.preventDefault=i.preventDefault,n.stopPropagation=i.stopPropagation,n.stopImmediatePropagation=i.stopImmediatePropagation,e.DOM2EventFacade.apply(n,arguments),n}var i=e.config.doc&&e.config.doc.implementation,s=e.config.lazyEventFacade,o={0:1,4:2,2:3},u={mouseout:"toElement",mouseover:"fromElement"},a=e.DOM2EventFacade.resolve,f={init:function(){n.superclass.init.apply(this,arguments);var t=this._event,r,i,s,u,f,l;this.target=a(t.srcElement),"clientX"in t&&!r&&0!==r&&(r=t.clientX,i=t.clientY,s=e.config.doc,u=s.body,f=s.documentElement,r+=f.scrollLeft||u&&u.scrollLeft||0,i+=f.scrollTop||u&&u.scrollTop||0,this.pageX=r,this.pageY=i),t.type=="mouseout"?l=t.toElement:t.type=="mouseover"&&(l=t.fromElement),this.relatedTarget=a(l||t.relatedTarget),this.which=this.button=t.keyCode||o[t.button]||t.button},stopPropagation:function(){this._event.cancelBubble=!0,this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){this._event.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1}};e.extend(n,e.DOM2EventFacade,f),e.extend(r,e.DOM2EventFacade,f),r.prototype.init=function(){var e=this._event,t=this._wrapper.overrides,n=r._define,i=r._lazyProperties,s;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.keyCode=this.charCode=e.keyCode,this.which=this.button=e.keyCode||o[e.button]||e.button;for(s in i)i.hasOwnProperty(s)&&n(this,s,i[s]);this._touch&&this._touch(e,this._currentTarget,this._wrapper)},r._lazyProperties={target:function(){return a(this._event.srcElement)},relatedTarget:function(){var e=this._event,t=u[e.type]||"relatedTarget";return a(e[t]||e.relatedTarget)},currentTarget:function(){return a(this._currentTarget)},wheelDelta:function(){var e=this._event;if(e.type==="mousewheel"||e.type==="DOMMouseScroll")return e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1)},pageX:function(){var t=this._event,n=t.pageX,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollLeft,s=r.documentElement.scrollLeft,n=t.clientX+(s||i||0)),n},pageY:function(){var t=this._event,n=t.pageY,r,i,s;return n===undefined&&(r=e.config.doc,i=r.body&&r.body.scrollTop,s=r.documentElement.scrollTop,n=t.clientY+(s||i||0)),n}},r._define=function(e,t,n){function r(r){var i=arguments.length?r:n.call(this);return delete e[t],Object.defineProperty(e,t,{value:i,configurable:!0,writable:!0}),i}Object.defineProperty(e,t,{get:r,set:r,configurable:!0})};if(i&&!i.hasFeature("Events","2.0")){if(s)try{Object.defineProperty(e.config.doc.createEventObject(),"z",{})}catch(l){s=!1}e.DOMEventFacade=s?r:n}},"3.7.3",{requires:["node-base"]});
bundle/event-base-ie/event-base-ie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -306,4 +306,4 @@ } -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-base/event-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/event-base/event-base.js", code: [] };-_yuitest_coverage["build/event-base/event-base.js"].code=["(function () {","var GLOBAL_ENV = YUI.Env;","","if (!GLOBAL_ENV._ready) {"," GLOBAL_ENV._ready = function() {"," GLOBAL_ENV.DOMReady = true;"," GLOBAL_ENV.remove(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready);"," };",""," GLOBAL_ENV.add(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready);","}","})();","YUI.add('event-base', function (Y, NAME) {","","/*"," * DOM event listener abstraction layer"," * @module event"," * @submodule event-base"," */","","/**"," * The domready event fires at the moment the browser's DOM is"," * usable. In most cases, this is before images are fully"," * downloaded, allowing you to provide a more responsive user"," * interface."," *"," * In YUI 3, domready subscribers will be notified immediately if"," * that moment has already passed when the subscription is created."," *"," * One exception is if the yui.js file is dynamically injected into"," * the page. If this is done, you must tell the YUI instance that"," * you did this in order for DOMReady (and window load events) to"," * fire normally. That configuration option is 'injected' -- set"," * it to true if the yui.js script is not included inline."," *"," * This method is part of the 'event-ready' module, which is a"," * submodule of 'event'."," *"," * @event domready"," * @for YUI"," */","Y.publish('domready', {"," fireOnce: true,"," async: true","});","","if (YUI.Env.DOMReady) {"," Y.fire('domready');","} else {"," Y.Do.before(function() { Y.fire('domready'); }, YUI.Env, '_ready');","}","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event"," * @submodule event-base"," */","","/**"," * Wraps a DOM event, properties requiring browser abstraction are"," * fixed here. Provids a security layer when required."," * @class DOMEventFacade"," * @param ev {Event} the DOM event"," * @param currentTarget {HTMLElement} the element the listener was attached to"," * @param wrapper {Event.Custom} the custom event wrapper for this DOM event"," */",""," var ua = Y.UA,",""," EMPTY = {},",""," /**"," * webkit key remapping required for Safari < 3.1"," * @property webkitKeymap"," * @private"," */"," 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)"," 63272: 46, // delete"," 63273: 36, // home"," 63275: 35 // end"," },",""," /**"," * Returns a wrapped node. Intended to be used on event targets,"," * so it will return the node's parent if the target is a text"," * node."," *"," * If accessing a property of the node throws an error, this is"," * probably the anonymous div wrapper Gecko adds inside text"," * nodes. This likely will only occur when attempting to access"," * the relatedTarget. In this case, we now return null because"," * the anonymous div is completely useless and we do not know"," * what the related target was because we can't even get to"," * the element's parent node."," *"," * @method resolve"," * @private"," */"," resolve = function(n) {"," if (!n) {"," return n;"," }"," try {"," if (n && 3 == n.nodeType) {"," n = n.parentNode;"," }"," } catch(e) {"," return null;"," }",""," return Y.one(n);"," },",""," DOMEventFacade = function(ev, currentTarget, wrapper) {"," this._event = ev;"," this._currentTarget = currentTarget;"," this._wrapper = wrapper || EMPTY;",""," // if not lazy init"," this.init();"," };","","Y.extend(DOMEventFacade, Object, {",""," init: function() {",""," var e = this._event,"," overrides = this._wrapper.overrides,"," x = e.pageX,"," y = e.pageY,"," c,"," currentTarget = this._currentTarget;",""," this.altKey = e.altKey;"," this.ctrlKey = e.ctrlKey;"," this.metaKey = e.metaKey;"," this.shiftKey = e.shiftKey;"," this.type = (overrides && overrides.type) || e.type;"," this.clientX = e.clientX;"," this.clientY = e.clientY;",""," this.pageX = x;"," this.pageY = y;",""," // charCode is unknown in keyup, keydown. keyCode is unknown in keypress."," // FF 3.6 - 8+? pass 0 for keyCode in keypress events."," // Webkit, FF 3.6-8+?, and IE9+? pass 0 for charCode in keydown, keyup."," // Webkit and IE9+? duplicate charCode in keyCode."," // Opera never sets charCode, always keyCode (though with the charCode)."," // IE6-8 don't set charCode or which."," // All browsers other than IE6-8 set which=keyCode in keydown, keyup, and "," // which=charCode in keypress."," //"," // Moral of the story: (e.which || e.keyCode) will always return the"," // known code for that key event phase. e.keyCode is often different in"," // keypress from keydown and keyup."," c = e.keyCode || e.charCode;",""," if (ua.webkit && (c in webkitKeymap)) {"," c = webkitKeymap[c];"," }",""," this.keyCode = c;"," this.charCode = c;"," // Fill in e.which for IE - implementers should always use this over"," // e.keyCode or e.charCode."," this.which = e.which || e.charCode || c;"," // this.button = e.button;"," this.button = this.which;",""," this.target = resolve(e.target);"," this.currentTarget = resolve(currentTarget);"," this.relatedTarget = resolve(e.relatedTarget);",""," if (e.type == \"mousewheel\" || e.type == \"DOMMouseScroll\") {"," this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1);"," }",""," if (this._touch) {"," this._touch(e, currentTarget, this._wrapper);"," }"," },",""," stopPropagation: function() {"," this._event.stopPropagation();"," this._wrapper.stopped = 1;"," this.stopped = 1;"," },",""," stopImmediatePropagation: function() {"," var e = this._event;"," if (e.stopImmediatePropagation) {"," e.stopImmediatePropagation();"," } else {"," this.stopPropagation();"," }"," this._wrapper.stopped = 2;"," this.stopped = 2;"," },",""," preventDefault: function(returnValue) {"," var e = this._event;"," e.preventDefault();"," e.returnValue = returnValue || false;"," this._wrapper.prevented = 1;"," this.prevented = 1;"," },",""," halt: function(immediate) {"," if (immediate) {"," this.stopImmediatePropagation();"," } else {"," this.stopPropagation();"," }",""," this.preventDefault();"," }","","});","","DOMEventFacade.resolve = resolve;","Y.DOM2EventFacade = DOMEventFacade;","Y.DOMEventFacade = DOMEventFacade;",""," /**"," * The native event"," * @property _event"," * @type {Native DOM Event}"," * @private"," */",""," /**"," The name of the event (e.g. \"click\")",""," @property type"," @type {String}"," **/",""," /**"," `true` if the \"alt\" or \"option\" key is pressed.",""," @property altKey"," @type {Boolean}"," **/",""," /**"," `true` if the shift key is pressed.",""," @property shiftKey"," @type {Boolean}"," **/",""," /**"," `true` if the \"Windows\" key on a Windows keyboard, \"command\" key on an"," Apple keyboard, or \"meta\" key on other keyboards is pressed.",""," @property metaKey"," @type {Boolean}"," **/",""," /**"," `true` if the \"Ctrl\" or \"control\" key is pressed.",""," @property ctrlKey"," @type {Boolean}"," **/",""," /**"," * The X location of the event on the page (including scroll)"," * @property pageX"," * @type {Number}"," */",""," /**"," * The Y location of the event on the page (including scroll)"," * @property pageY"," * @type {Number}"," */",""," /**"," * The X location of the event in the viewport"," * @property clientX"," * @type {Number}"," */",""," /**"," * The Y location of the event in the viewport"," * @property clientY"," * @type {Number}"," */",""," /**"," * The keyCode for key events. Uses charCode if keyCode is not available"," * @property keyCode"," * @type {Number}"," */",""," /**"," * The charCode for key events. Same as keyCode"," * @property charCode"," * @type {Number}"," */",""," /**"," * The button that was pushed. 1 for left click, 2 for middle click, 3 for"," * right click. This is only reliably populated on `mouseup` events."," * @property button"," * @type {Number}"," */",""," /**"," * The button that was pushed. Same as button."," * @property which"," * @type {Number}"," */",""," /**"," * Node reference for the targeted element"," * @property target"," * @type {Node}"," */",""," /**"," * Node reference for the element that the listener was attached to."," * @property currentTarget"," * @type {Node}"," */",""," /**"," * Node reference to the relatedTarget"," * @property relatedTarget"," * @type {Node}"," */",""," /**"," * Number representing the direction and velocity of the movement of the mousewheel."," * Negative is down, the higher the number, the faster. Applies to the mousewheel event."," * @property wheelDelta"," * @type {Number}"," */",""," /**"," * Stops the propagation to the next bubble target"," * @method stopPropagation"," */",""," /**"," * Stops the propagation to the next bubble target and"," * prevents any additional listeners from being exectued"," * on the current target."," * @method stopImmediatePropagation"," */",""," /**"," * Prevents the event's default behavior"," * @method preventDefault"," * @param returnValue {string} sets the returnValue of the event to this value"," * (rather than the default false value). This can be used to add a customized"," * confirmation query to the beforeunload event)."," */",""," /**"," * Stops the event propagation and prevents the default"," * event behavior."," * @method halt"," * @param immediate {boolean} if true additional listeners"," * on the current target will not be executed"," */","(function() {","/**"," * 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."," * @module event"," * @main event"," * @submodule event-base"," */","","/**"," * 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"," */","","Y.Env.evt.dom_wrappers = {};","Y.Env.evt.dom_map = {};","","var _eventenv = Y.Env.evt,"," config = Y.config,"," win = config.win,"," add = YUI.Env.add,"," remove = YUI.Env.remove,",""," onLoad = function() {"," YUI.Env.windowLoaded = true;"," Y.Event._load();"," remove(win, \"load\", onLoad);"," },",""," onUnload = function() {"," Y.Event._unload();"," },",""," EVENT_READY = 'domready',",""," COMPAT_ARG = '~yui|2|compat~',",""," shouldIterate = function(o) {"," try {"," return (o && typeof o !== \"string\" && Y.Lang.isNumber(o.length) &&"," !o.tagName && !o.alert);"," } catch(ex) {"," return false;"," }",""," },",""," // aliases to support DOM event subscription clean up when the last"," // subscriber is detached. deleteAndClean overrides the DOM event's wrapper"," // CustomEvent _delete method."," _ceProtoDelete = Y.CustomEvent.prototype._delete,"," _deleteAndClean = function(s) {"," var ret = _ceProtoDelete.apply(this, arguments);",""," if (!this.hasSubs()) {"," Y.Event._clean(this);"," }",""," return ret;"," },","","Event = function() {",""," /**"," * True after the onload event has fired"," * @property _loadComplete"," * @type boolean"," * @static"," * @private"," */"," var _loadComplete = false,",""," /**"," * 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 _avail"," * @static"," * @private"," */"," _avail = [],",""," /**"," * Custom event wrappers for DOM events. Key is"," * 'event:' + Element uid stamp + event type"," * @property _wrappers"," * @type Y.Event.Custom"," * @static"," * @private"," */"," _wrappers = _eventenv.dom_wrappers,",""," _windowLoadKey = null,",""," /**"," * Custom event wrapper map DOM events. Key is"," * Element uid stamp. Each item is a hash of custom event"," * wrappers as provided in the _wrappers collection. This"," * provides the infrastructure for getListeners."," * @property _el_events"," * @static"," * @private"," */"," _el_events = _eventenv.dom_map;",""," 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 1000@amp;40 ms, so it will poll"," * for 40 seconds or until all outstanding handlers are bound"," * (whichever comes first)."," * @property POLL_RETRYS"," * @type int"," * @static"," * @final"," */"," POLL_RETRYS: 1000,",""," /**"," * The poll interval in milliseconds"," * @property POLL_INTERVAL"," * @type int"," * @static"," * @final"," */"," POLL_INTERVAL: 40,",""," /**"," * 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,","",""," /**"," * poll handle"," * @property _interval"," * @static"," * @private"," */"," _interval: null,",""," /**"," * document readystate poll handle"," * @property _dri"," * @static"," * @private"," */"," _dri: null,",""," /**"," * True when the document is initially usable"," * @property DOMReady"," * @type boolean"," * @static"," */"," DOMReady: false,",""," /**"," * @method startInterval"," * @static"," * @private"," */"," startInterval: function() {"," if (!Event._interval) {","Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL);"," }"," },",""," /**"," * 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."," *"," * <p>The callback is executed with a single parameter:"," * the custom object parameter, if provided.</p>"," *"," * @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} p_obj an optional object to be passed back as"," * a parameter to fn."," * @param {boolean|object} p_override If set to true, fn will execute"," * in the context of p_obj, if set to an object it"," * will execute in the context of that object"," * @param checkContent {boolean} check child node readiness (onContentReady)"," * @static"," * @deprecated Use Y.on(\"available\")"," */"," // @TODO fix arguments"," onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) {",""," var a = Y.Array(id), i, availHandle;","",""," for (i=0; i<a.length; i=i+1) {"," _avail.push({"," id: a[i],"," fn: fn,"," obj: p_obj,"," override: p_override,"," checkReady: checkContent,"," compat: compat"," });"," }"," _retryCount = this.POLL_RETRYS;",""," // We want the first test to be immediate, but async"," setTimeout(Event._poll, 0);",""," availHandle = new Y.EventHandle({",""," _delete: function() {"," // set by the event system for lazy DOM listeners"," if (availHandle.handle) {"," availHandle.handle.detach();"," return;"," }",""," var i, j;",""," // otherwise try to remove the onAvailable listener(s)"," for (i = 0; i < a.length; i++) {"," for (j = 0; j < _avail.length; j++) {"," if (a[i] === _avail[j].id) {"," _avail.splice(j, 1);"," }"," }"," }"," }",""," });",""," return availHandle;"," },",""," /**"," * Works the same way as onAvailable, but additionally checks the"," * state of sibling elements to determine if the content of the"," * available element is safe to modify."," *"," * <p>The callback is executed with a single parameter:"," * the custom object parameter, if provided.</p>"," *"," * @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} override If set to true, fn will execute"," * in the context of p_obj. If an object, fn will"," * exectute in the context of that object"," *"," * @static"," * @deprecated Use Y.on(\"contentready\")"," */"," // @TODO fix arguments"," onContentReady: function(id, fn, obj, override, compat) {"," return Event.onAvailable(id, fn, obj, override, true, compat);"," },",""," /**"," * Adds an event listener"," *"," * @method attach"," *"," * @param {String} type The type of event to append"," * @param {Function} fn The method the event invokes"," * @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 {Object} context optional context object"," * @param {Boolean|object} args 0..n arguments to pass to the callback"," * @return {EventHandle} an object to that can be used to detach the listener"," *"," * @static"," */",""," attach: function(type, fn, el, context) {"," return Event._attach(Y.Array(arguments, 0, true));"," },",""," _createWrapper: function (el, type, capture, compat, facade) {",""," var cewrapper,"," ek = Y.stamp(el),"," key = 'event:' + ek + type;",""," if (false === facade) {"," key += 'native';"," }"," if (capture) {"," key += 'capture';"," }","",""," cewrapper = _wrappers[key];","",""," if (!cewrapper) {"," // create CE wrapper"," cewrapper = Y.publish(key, {"," silent: true,"," bubbles: false,"," contextFn: function() {"," if (compat) {"," return cewrapper.el;"," } else {"," cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el);"," return cewrapper.nodeRef;"," }"," }"," });",""," cewrapper.overrides = {};",""," // for later removeListener calls"," cewrapper.el = el;"," cewrapper.key = key;"," cewrapper.domkey = ek;"," cewrapper.type = type;"," cewrapper.fn = function(e) {"," cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade))));"," };"," cewrapper.capture = capture;",""," if (el == win && type == \"load\") {"," // window load happens once"," cewrapper.fireOnce = true;"," _windowLoadKey = key;"," }"," cewrapper._delete = _deleteAndClean;",""," _wrappers[key] = cewrapper;"," _el_events[ek] = _el_events[ek] || {};"," _el_events[ek][key] = cewrapper;",""," add(el, type, cewrapper.fn, capture);"," }",""," return cewrapper;",""," },",""," _attach: function(args, conf) {",""," var compat,"," handles, oEl, cewrapper, context,"," fireNow = false, ret,"," type = args[0],"," fn = args[1],"," el = args[2] || win,"," facade = conf && conf.facade,"," capture = conf && conf.capture,"," overrides = conf && conf.overrides;",""," if (args[args.length-1] === COMPAT_ARG) {"," compat = true;"," }",""," if (!fn || !fn.call) {","// throw new TypeError(type + \" attach call failed, callback undefined\");"," return false;"," }",""," // The el argument can be an array of elements or element ids."," if (shouldIterate(el)) {",""," handles=[];",""," Y.each(el, function(v, k) {"," args[2] = v;"," handles.push(Event._attach(args.slice(), conf));"," });",""," // return (handles.length === 1) ? handles[0] : handles;"," return new Y.EventHandle(handles);",""," // If the el argument is a string, we assume it is"," // actually the id of the element. If the page is loaded"," // we convert el to the actual element, otherwise we"," // defer attaching the event until the element is"," // ready"," } else if (Y.Lang.isString(el)) {",""," // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el);",""," if (compat) {"," oEl = Y.DOM.byId(el);"," } else {",""," oEl = Y.Selector.query(el);",""," switch (oEl.length) {"," case 0:"," oEl = null;"," break;"," case 1:"," oEl = oEl[0];"," break;"," default:"," args[2] = oEl;"," return Event._attach(args, conf);"," }"," }",""," if (oEl) {",""," el = oEl;",""," // Not found = defer adding the event until the element is available"," } else {",""," ret = Event.onAvailable(el, function() {",""," ret.handle = Event._attach(args, conf);",""," }, Event, true, false, compat);",""," return ret;",""," }"," }",""," // Element should be an html element or node"," if (!el) {"," return false;"," }",""," if (Y.Node && Y.instanceOf(el, Y.Node)) {"," el = Y.Node.getDOMNode(el);"," }",""," cewrapper = Event._createWrapper(el, type, capture, compat, facade);"," if (overrides) {"," Y.mix(cewrapper.overrides, overrides);"," }",""," if (el == win && type == \"load\") {",""," // if the load is complete, fire immediately."," // all subscribers, including the current one"," // will be notified."," if (YUI.Env.windowLoaded) {"," fireNow = true;"," }"," }",""," if (compat) {"," args.pop();"," }",""," context = args[3];",""," // set context to the Node if not specified"," // ret = cewrapper.on.apply(cewrapper, trimmedArgs);"," ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null);",""," if (fireNow) {"," cewrapper.fire();"," }",""," return ret;",""," },",""," /**"," * Removes an event listener. Supports the signature the event was bound"," * with, but the preferred way to remove listeners is using the handle"," * that is returned when using Y.on"," *"," * @method detach"," *"," * @param {String} type the type of event to remove."," * @param {Function} fn the method the event invokes. If fn is"," * undefined, then all event handlers for the type of event are"," * removed."," * @param {String|HTMLElement|Array|NodeList|EventHandle} el An"," * event handle, an id, an element reference, or a collection"," * of ids and/or elements to remove the listener from."," * @return {boolean} true if the unbind was successful, false otherwise."," * @static"," */"," detach: function(type, fn, el, obj) {",""," var args=Y.Array(arguments, 0, true), compat, l, ok, i,"," id, ce;",""," if (args[args.length-1] === COMPAT_ARG) {"," compat = true;"," // args.pop();"," }",""," if (type && type.detach) {"," return type.detach();"," }",""," // The el argument can be a string"," if (typeof el == \"string\") {",""," // el = (compat) ? Y.DOM.byId(el) : Y.all(el);"," if (compat) {"," el = Y.DOM.byId(el);"," } else {"," el = Y.Selector.query(el);"," l = el.length;"," if (l < 1) {"," el = null;"," } else if (l == 1) {"," el = el[0];"," }"," }"," // return Event.detach.apply(Event, args);"," }",""," if (!el) {"," return false;"," }",""," if (el.detach) {"," args.splice(2, 1);"," return el.detach.apply(el, args);"," // The el argument can be an array of elements or element ids."," } else if (shouldIterate(el)) {"," ok = true;"," for (i=0, l=el.length; i<l; ++i) {"," args[2] = el[i];"," ok = ( Y.Event.detach.apply(Y.Event, args) && ok );"," }",""," return ok;"," }",""," if (!type || !fn || !fn.call) {"," return Event.purgeElement(el, false, type);"," }",""," id = 'event:' + Y.stamp(el) + type;"," ce = _wrappers[id];",""," if (ce) {"," return ce.detach(fn);"," } else {"," return 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} el the element the listener was attached to"," * @return {Event} the event"," * @static"," */"," getEvent: function(e, el, noFacade) {"," var ev = e || win.event;",""," return (noFacade) ? ev :"," new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]);"," },",""," /**"," * Generates an unique ID for the element if it does not already"," * have one."," * @method generateId"," * @param el the element to create the id for"," * @return {string} the resulting id of the element"," * @static"," */"," generateId: function(el) {"," return Y.DOM.generateID(el);"," },",""," /**"," * We want to be able to use getElementsByTagName as a collection"," * to attach a group of events to. Unfortunately, different"," * browsers return different types of collections. This function"," * tests to determine if the object is array-like. It will also"," * fail if the object is an array, but is empty."," * @method _isValidCollection"," * @param o the object to test"," * @return {boolean} true if the object is array-like and populated"," * @deprecated was not meant to be used directly"," * @static"," * @private"," */"," _isValidCollection: shouldIterate,",""," /**"," * hook up any deferred listeners"," * @method _load"," * @static"," * @private"," */"," _load: function(e) {"," if (!_loadComplete) {"," _loadComplete = true;",""," // Just in case DOMReady did not go off for some reason"," // E._ready();"," if (Y.fire) {"," Y.fire(EVENT_READY);"," }",""," // Available elements may not have been detected before the"," // window load event fires. Try to find them now so that the"," // the user is more likely to get the onAvailable notifications"," // before the window load notification"," Event._poll();"," }"," },",""," /**"," * Polling function that runs before the onload event fires,"," * attempting to attach to DOM Nodes as soon as they are"," * available"," * @method _poll"," * @static"," * @private"," */"," _poll: function() {"," if (Event.locked) {"," return;"," }",""," if (Y.UA.ie && !YUI.Env.DOMReady) {"," // Hold off if DOMReady has not fired and check current"," // readyState to protect against the IE operation aborted"," // issue."," Event.startInterval();"," return;"," }",""," Event.locked = true;",""," // keep trying until after the page is loaded. We need to"," // check the page load state prior to trying to bind the"," // elements so that we can be certain all elements have been"," // tested appropriately"," var i, len, item, el, notAvail, executeItem,"," tryAgain = !_loadComplete;",""," if (!tryAgain) {"," tryAgain = (_retryCount > 0);"," }",""," // onAvailable"," notAvail = [];",""," executeItem = function (el, item) {"," var context, ov = item.override;"," try {"," if (item.compat) {"," if (item.override) {"," if (ov === true) {"," context = item.obj;"," } else {"," context = ov;"," }"," } else {"," context = el;"," }"," item.fn.call(context, item.obj);"," } else {"," context = item.obj || Y.one(el);"," item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []);"," }"," } catch (e) {"," }"," };",""," // onAvailable"," for (i=0,len=_avail.length; i<len; ++i) {"," item = _avail[i];"," if (item && !item.checkReady) {",""," // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);"," el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);",""," if (el) {"," executeItem(el, item);"," _avail[i] = null;"," } else {"," notAvail.push(item);"," }"," }"," }",""," // onContentReady"," for (i=0,len=_avail.length; i<len; ++i) {"," item = _avail[i];"," if (item && item.checkReady) {",""," // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);"," el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);",""," if (el) {"," // The element is available, but not necessarily ready"," // @todo should we test parentNode.nextSibling?"," if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) {"," executeItem(el, item);"," _avail[i] = null;"," }"," } else {"," notAvail.push(item);"," }"," }"," }",""," _retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1;",""," if (tryAgain) {"," // we may need to strip the nulled out items here"," Event.startInterval();"," } else {"," clearInterval(Event._interval);"," Event._interval = null;"," }",""," Event.locked = false;",""," return;",""," },",""," /**"," * 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} type optional type of listener to purge. If"," * left out, all listeners will be removed"," * @static"," */"," purgeElement: function(el, recurse, type) {"," // var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el,"," var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el,"," lis = Event.getListeners(oEl, type), i, len, children, child;",""," if (recurse && oEl) {"," lis = lis || [];"," children = Y.Selector.query('*', oEl);"," i = 0;"," len = children.length;"," for (; i < len; ++i) {"," child = Event.getListeners(children[i], type);"," if (child) {"," lis = lis.concat(child);"," }"," }"," }",""," if (lis) {"," for (i = 0, len = lis.length; i < len; ++i) {"," lis[i].detachAll();"," }"," }",""," },",""," /**"," * Removes all object references and the DOM proxy subscription for"," * a given event for a DOM node."," *"," * @method _clean"," * @param wrapper {CustomEvent} Custom event proxy for the DOM"," * subscription"," * @private"," * @static"," * @since 3.4.0"," */"," _clean: function (wrapper) {"," var key = wrapper.key,"," domkey = wrapper.domkey;",""," remove(wrapper.el, wrapper.type, wrapper.fn, wrapper.capture);"," delete _wrappers[key];"," delete Y._yuievt.events[key];"," if (_el_events[domkey]) {"," delete _el_events[domkey][key];"," if (!Y.Object.size(_el_events[domkey])) {"," delete _el_events[domkey];"," }"," }"," },",""," /**"," * Returns all listeners attached to the given element via addListener."," * Optionally, you can specify a specific type of event to return."," * @method getListeners"," * @param el {HTMLElement|string} the element or element id to inspect"," * @param type {string} optional type of listener to return. If"," * left out, all listeners will be returned"," * @return {CustomEvent} the custom event wrapper for the DOM event(s)"," * @static"," */"," getListeners: function(el, type) {"," var ek = Y.stamp(el, true), evts = _el_events[ek],"," results=[] , key = (type) ? 'event:' + ek + type : null,"," adapters = _eventenv.plugins;",""," if (!evts) {"," return null;"," }",""," if (key) {"," // look for synthetic events"," if (adapters[type] && adapters[type].eventDef) {"," key += '_synth';"," }",""," if (evts[key]) {"," results.push(evts[key]);"," }",""," // get native events as well"," key += 'native';"," if (evts[key]) {"," results.push(evts[key]);"," }",""," } else {"," Y.each(evts, function(v, k) {"," results.push(v);"," });"," }",""," return (results.length) ? results : null;"," },",""," /**"," * Removes all listeners registered by pe.event. Called"," * automatically during the unload event."," * @method _unload"," * @static"," * @private"," */"," _unload: function(e) {"," Y.each(_wrappers, function(v, k) {"," if (v.type == 'unload') {"," v.fire(e);"," }"," v.detachAll();"," });"," remove(win, \"unload\", onUnload);"," },",""," /**"," * Adds a DOM event directly without the caching, cleanup, context adj, etc"," *"," * @method nativeAdd"," * @param {HTMLElement} el the element to bind the handler to"," * @param {string} type the type of event handler"," * @param {function} fn the callback to invoke"," * @param {boolen} capture capture or bubble phase"," * @static"," * @private"," */"," nativeAdd: add,",""," /**"," * Basic remove listener"," *"," * @method nativeRemove"," * @param {HTMLElement} el the element to bind the handler to"," * @param {string} type the type of event handler"," * @param {function} fn the callback to invoke"," * @param {boolen} capture capture or bubble phase"," * @static"," * @private"," */"," nativeRemove: remove"," };","","}();","","Y.Event = Event;","","if (config.injected || YUI.Env.windowLoaded) {"," onLoad();","} else {"," add(win, \"load\", onLoad);","}","","// Process onAvailable/onContentReady items when when the DOM is ready in IE","if (Y.UA.ie) {"," Y.on(EVENT_READY, Event._poll);","}","","try {"," add(win, \"unload\", onUnload);","} catch(e) {","}","","Event.Custom = Y.CustomEvent;","Event.Subscriber = Y.Subscriber;","Event.Target = Y.EventTarget;","Event.Handle = Y.EventHandle;","Event.Facade = Y.EventFacade;","","Event._poll();","","})();","","/**"," * DOM event listener abstraction layer"," * @module event"," * @submodule event-base"," */","","/**"," * Executes the callback as soon as the specified element"," * is detected in the DOM. This function expects a selector"," * string for the element(s) to detect. If you already have"," * an element reference, you don't need this event."," * @event available"," * @param type {string} 'available'"," * @param fn {function} the callback function to execute."," * @param el {string} an selector for the element(s) to attach"," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.Env.evt.plugins.available = {"," on: function(type, fn, id, o) {"," var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;"," return Y.Event.onAvailable.call(Y.Event, id, fn, o, a);"," }","};","","/**"," * Executes the callback as soon as the specified element"," * is detected in the DOM with a nextSibling property"," * (indicating that the element's children are available)."," * This function expects a selector"," * string for the element(s) to detect. If you already have"," * an element reference, you don't need this event."," * @event contentready"," * @param type {string} 'contentready'"," * @param fn {function} the callback function to execute."," * @param el {string} an selector for the element(s) to attach."," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.Env.evt.plugins.contentready = {"," on: function(type, fn, id, o) {"," var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;"," return Y.Event.onContentReady.call(Y.Event, id, fn, o, a);"," }","};","","","}, '3.7.2', {\"requires\": [\"event-custom-base\"]});"];-_yuitest_coverage["build/event-base/event-base.js"].lines = {"1":0,"2":0,"4":0,"5":0,"6":0,"7":0,"10":0,"13":0,"42":0,"47":0,"48":0,"50":0,"69":0,"109":0,"110":0,"112":0,"113":0,"114":0,"117":0,"120":0,"124":0,"125":0,"126":0,"129":0,"132":0,"136":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"151":0,"152":0,"166":0,"168":0,"169":0,"172":0,"173":0,"176":0,"178":0,"180":0,"181":0,"182":0,"184":0,"185":0,"188":0,"189":0,"194":0,"195":0,"196":0,"200":0,"201":0,"202":0,"204":0,"206":0,"207":0,"211":0,"212":0,"213":0,"214":0,"215":0,"219":0,"220":0,"222":0,"225":0,"230":0,"231":0,"232":0,"378":0,"397":0,"398":0,"400":0,"407":0,"408":0,"409":0,"413":0,"421":0,"422":0,"425":0,"435":0,"437":0,"438":0,"441":0,"453":0,"496":0,"561":0,"562":0,"594":0,"597":0,"598":0,"607":0,"610":0,"612":0,"616":0,"617":0,"618":0,"621":0,"624":0,"625":0,"626":0,"627":0,"635":0,"661":0,"682":0,"687":0,"691":0,"692":0,"694":0,"695":0,"699":0,"702":0,"704":0,"708":0,"709":0,"711":0,"712":0,"717":0,"720":0,"721":0,"722":0,"723":0,"724":0,"725":0,"727":0,"729":0,"731":0,"732":0,"734":0,"736":0,"737":0,"738":0,"740":0,"743":0,"749":0,"759":0,"760":0,"763":0,"765":0,"769":0,"771":0,"773":0,"774":0,"775":0,"779":0,"786":0,"790":0,"791":0,"794":0,"796":0,"798":0,"799":0,"801":0,"802":0,"804":0,"805":0,"809":0,"811":0,"816":0,"818":0,"822":0,"828":0,"829":0,"832":0,"833":0,"836":0,"837":0,"838":0,"841":0,"846":0,"847":0,"851":0,"852":0,"855":0,"859":0,"861":0,"862":0,"865":0,"888":0,"891":0,"892":0,"896":0,"897":0,"901":0,"904":0,"905":0,"907":0,"908":0,"909":0,"910":0,"911":0,"912":0,"918":0,"919":0,"922":0,"923":0,"924":0,"926":0,"927":0,"928":0,"929":0,"930":0,"933":0,"936":0,"937":0,"940":0,"941":0,"943":0,"944":0,"946":0,"964":0,"966":0,"979":0,"1004":0,"1005":0,"1009":0,"1010":0,"1017":0,"1030":0,"1031":0,"1034":0,"1038":0,"1039":0,"1042":0,"1048":0,"1051":0,"1052":0,"1056":0,"1058":0,"1059":0,"1060":0,"1061":0,"1062":0,"1063":0,"1064":0,"1066":0,"1069":0,"1071":0,"1073":0,"1074":0,"1081":0,"1082":0,"1083":0,"1086":0,"1088":0,"1089":0,"1090":0,"1092":0,"1098":0,"1099":0,"1100":0,"1103":0,"1105":0,"1108":0,"1109":0,"1110":0,"1113":0,"1118":0,"1120":0,"1122":0,"1124":0,"1125":0,"1128":0,"1130":0,"1148":0,"1151":0,"1152":0,"1153":0,"1154":0,"1155":0,"1156":0,"1157":0,"1158":0,"1159":0,"1164":0,"1165":0,"1166":0,"1184":0,"1187":0,"1188":0,"1189":0,"1190":0,"1191":0,"1192":0,"1193":0,"1209":0,"1213":0,"1214":0,"1217":0,"1219":0,"1220":0,"1223":0,"1224":0,"1228":0,"1229":0,"1230":0,"1234":0,"1235":0,"1239":0,"1250":0,"1251":0,"1252":0,"1254":0,"1256":0,"1288":0,"1290":0,"1291":0,"1293":0,"1297":0,"1298":0,"1301":0,"1302":0,"1306":0,"1307":0,"1308":0,"1309":0,"1310":0,"1312":0,"1337":0,"1339":0,"1340":0,"1361":0,"1363":0,"1364":0};-_yuitest_coverage["build/event-base/event-base.js"].functions = {"_ready:5":0,"(anonymous 1):1":0,"(anonymous 3):50":0,"resolve:108":0,"DOMEventFacade:123":0,"init:134":0,"stopPropagation:193":0,"stopImmediatePropagation:199":0,"preventDefault:210":0,"halt:218":0,"onLoad:406":0,"onUnload:412":0,"shouldIterate:420":0,"_deleteAndClean:434":0,"startInterval:560":0,"_delete:614":0,"onAvailable:592":0,"onContentReady:660":0,"attach:681":0,"contextFn:707":0,"fn:724":0,"_createWrapper:685":0,"(anonymous 5):773":0,"(anonymous 6):816":0,"_attach:747":0,"detach:886":0,"getEvent:963":0,"generateId:978":0,"_load:1003":0,"executeItem:1058":0,"_poll:1029":0,"purgeElement:1146":0,"_clean:1183":0,"(anonymous 7):1234":0,"getListeners:1208":0,"(anonymous 8):1250":0,"_unload:1249":0,"Event:444":0,"(anonymous 4):378":0,"on:1338":0,"on:1362":0,"(anonymous 2):13":0};-_yuitest_coverage["build/event-base/event-base.js"].coveredLines = 325;+_yuitest_coverage["build/event-base/event-base.js"].code=["(function () {","var GLOBAL_ENV = YUI.Env;","","if (!GLOBAL_ENV._ready) {"," GLOBAL_ENV._ready = function() {"," GLOBAL_ENV.DOMReady = true;"," GLOBAL_ENV.remove(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready);"," };",""," GLOBAL_ENV.add(YUI.config.doc, 'DOMContentLoaded', GLOBAL_ENV._ready);","}","})();","YUI.add('event-base', function (Y, NAME) {","","/*"," * DOM event listener abstraction layer"," * @module event"," * @submodule event-base"," */","","/**"," * The domready event fires at the moment the browser's DOM is"," * usable. In most cases, this is before images are fully"," * downloaded, allowing you to provide a more responsive user"," * interface."," *"," * In YUI 3, domready subscribers will be notified immediately if"," * that moment has already passed when the subscription is created."," *"," * One exception is if the yui.js file is dynamically injected into"," * the page. If this is done, you must tell the YUI instance that"," * you did this in order for DOMReady (and window load events) to"," * fire normally. That configuration option is 'injected' -- set"," * it to true if the yui.js script is not included inline."," *"," * This method is part of the 'event-ready' module, which is a"," * submodule of 'event'."," *"," * @event domready"," * @for YUI"," */","Y.publish('domready', {"," fireOnce: true,"," async: true","});","","if (YUI.Env.DOMReady) {"," Y.fire('domready');","} else {"," Y.Do.before(function() { Y.fire('domready'); }, YUI.Env, '_ready');","}","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event"," * @submodule event-base"," */","","/**"," * Wraps a DOM event, properties requiring browser abstraction are"," * fixed here. Provids a security layer when required."," * @class DOMEventFacade"," * @param ev {Event} the DOM event"," * @param currentTarget {HTMLElement} the element the listener was attached to"," * @param wrapper {Event.Custom} the custom event wrapper for this DOM event"," */",""," var ua = Y.UA,",""," EMPTY = {},",""," /**"," * webkit key remapping required for Safari < 3.1"," * @property webkitKeymap"," * @private"," */"," 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)"," 63272: 46, // delete"," 63273: 36, // home"," 63275: 35 // end"," },",""," /**"," * Returns a wrapped node. Intended to be used on event targets,"," * so it will return the node's parent if the target is a text"," * node."," *"," * If accessing a property of the node throws an error, this is"," * probably the anonymous div wrapper Gecko adds inside text"," * nodes. This likely will only occur when attempting to access"," * the relatedTarget. In this case, we now return null because"," * the anonymous div is completely useless and we do not know"," * what the related target was because we can't even get to"," * the element's parent node."," *"," * @method resolve"," * @private"," */"," resolve = function(n) {"," if (!n) {"," return n;"," }"," try {"," if (n && 3 == n.nodeType) {"," n = n.parentNode;"," }"," } catch(e) {"," return null;"," }",""," return Y.one(n);"," },",""," DOMEventFacade = function(ev, currentTarget, wrapper) {"," this._event = ev;"," this._currentTarget = currentTarget;"," this._wrapper = wrapper || EMPTY;",""," // if not lazy init"," this.init();"," };","","Y.extend(DOMEventFacade, Object, {",""," init: function() {",""," var e = this._event,"," overrides = this._wrapper.overrides,"," x = e.pageX,"," y = e.pageY,"," c,"," currentTarget = this._currentTarget;",""," this.altKey = e.altKey;"," this.ctrlKey = e.ctrlKey;"," this.metaKey = e.metaKey;"," this.shiftKey = e.shiftKey;"," this.type = (overrides && overrides.type) || e.type;"," this.clientX = e.clientX;"," this.clientY = e.clientY;",""," this.pageX = x;"," this.pageY = y;",""," // charCode is unknown in keyup, keydown. keyCode is unknown in keypress."," // FF 3.6 - 8+? pass 0 for keyCode in keypress events."," // Webkit, FF 3.6-8+?, and IE9+? pass 0 for charCode in keydown, keyup."," // Webkit and IE9+? duplicate charCode in keyCode."," // Opera never sets charCode, always keyCode (though with the charCode)."," // IE6-8 don't set charCode or which."," // All browsers other than IE6-8 set which=keyCode in keydown, keyup, and "," // which=charCode in keypress."," //"," // Moral of the story: (e.which || e.keyCode) will always return the"," // known code for that key event phase. e.keyCode is often different in"," // keypress from keydown and keyup."," c = e.keyCode || e.charCode;",""," if (ua.webkit && (c in webkitKeymap)) {"," c = webkitKeymap[c];"," }",""," this.keyCode = c;"," this.charCode = c;"," // Fill in e.which for IE - implementers should always use this over"," // e.keyCode or e.charCode."," this.which = e.which || e.charCode || c;"," // this.button = e.button;"," this.button = this.which;",""," this.target = resolve(e.target);"," this.currentTarget = resolve(currentTarget);"," this.relatedTarget = resolve(e.relatedTarget);",""," if (e.type == \"mousewheel\" || e.type == \"DOMMouseScroll\") {"," this.wheelDelta = (e.detail) ? (e.detail * -1) : Math.round(e.wheelDelta / 80) || ((e.wheelDelta < 0) ? -1 : 1);"," }",""," if (this._touch) {"," this._touch(e, currentTarget, this._wrapper);"," }"," },",""," stopPropagation: function() {"," this._event.stopPropagation();"," this._wrapper.stopped = 1;"," this.stopped = 1;"," },",""," stopImmediatePropagation: function() {"," var e = this._event;"," if (e.stopImmediatePropagation) {"," e.stopImmediatePropagation();"," } else {"," this.stopPropagation();"," }"," this._wrapper.stopped = 2;"," this.stopped = 2;"," },",""," preventDefault: function(returnValue) {"," var e = this._event;"," e.preventDefault();"," e.returnValue = returnValue || false;"," this._wrapper.prevented = 1;"," this.prevented = 1;"," },",""," halt: function(immediate) {"," if (immediate) {"," this.stopImmediatePropagation();"," } else {"," this.stopPropagation();"," }",""," this.preventDefault();"," }","","});","","DOMEventFacade.resolve = resolve;","Y.DOM2EventFacade = DOMEventFacade;","Y.DOMEventFacade = DOMEventFacade;",""," /**"," * The native event"," * @property _event"," * @type {Native DOM Event}"," * @private"," */",""," /**"," The name of the event (e.g. \"click\")",""," @property type"," @type {String}"," **/",""," /**"," `true` if the \"alt\" or \"option\" key is pressed.",""," @property altKey"," @type {Boolean}"," **/",""," /**"," `true` if the shift key is pressed.",""," @property shiftKey"," @type {Boolean}"," **/",""," /**"," `true` if the \"Windows\" key on a Windows keyboard, \"command\" key on an"," Apple keyboard, or \"meta\" key on other keyboards is pressed.",""," @property metaKey"," @type {Boolean}"," **/",""," /**"," `true` if the \"Ctrl\" or \"control\" key is pressed.",""," @property ctrlKey"," @type {Boolean}"," **/",""," /**"," * The X location of the event on the page (including scroll)"," * @property pageX"," * @type {Number}"," */",""," /**"," * The Y location of the event on the page (including scroll)"," * @property pageY"," * @type {Number}"," */",""," /**"," * The X location of the event in the viewport"," * @property clientX"," * @type {Number}"," */",""," /**"," * The Y location of the event in the viewport"," * @property clientY"," * @type {Number}"," */",""," /**"," * The keyCode for key events. Uses charCode if keyCode is not available"," * @property keyCode"," * @type {Number}"," */",""," /**"," * The charCode for key events. Same as keyCode"," * @property charCode"," * @type {Number}"," */",""," /**"," * The button that was pushed. 1 for left click, 2 for middle click, 3 for"," * right click. This is only reliably populated on `mouseup` events."," * @property button"," * @type {Number}"," */",""," /**"," * The button that was pushed. Same as button."," * @property which"," * @type {Number}"," */",""," /**"," * Node reference for the targeted element"," * @property target"," * @type {Node}"," */",""," /**"," * Node reference for the element that the listener was attached to."," * @property currentTarget"," * @type {Node}"," */",""," /**"," * Node reference to the relatedTarget"," * @property relatedTarget"," * @type {Node}"," */",""," /**"," * Number representing the direction and velocity of the movement of the mousewheel."," * Negative is down, the higher the number, the faster. Applies to the mousewheel event."," * @property wheelDelta"," * @type {Number}"," */",""," /**"," * Stops the propagation to the next bubble target"," * @method stopPropagation"," */",""," /**"," * Stops the propagation to the next bubble target and"," * prevents any additional listeners from being exectued"," * on the current target."," * @method stopImmediatePropagation"," */",""," /**"," * Prevents the event's default behavior"," * @method preventDefault"," * @param returnValue {string} sets the returnValue of the event to this value"," * (rather than the default false value). This can be used to add a customized"," * confirmation query to the beforeunload event)."," */",""," /**"," * Stops the event propagation and prevents the default"," * event behavior."," * @method halt"," * @param immediate {boolean} if true additional listeners"," * on the current target will not be executed"," */","(function() {","/**"," * 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."," * @module event"," * @main event"," * @submodule event-base"," */","","/**"," * 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"," */","","Y.Env.evt.dom_wrappers = {};","Y.Env.evt.dom_map = {};","","var YDOM = Y.DOM,"," _eventenv = Y.Env.evt,"," config = Y.config,"," win = config.win,"," add = YUI.Env.add,"," remove = YUI.Env.remove,",""," onLoad = function() {"," YUI.Env.windowLoaded = true;"," Y.Event._load();"," remove(win, \"load\", onLoad);"," },",""," onUnload = function() {"," Y.Event._unload();"," },",""," EVENT_READY = 'domready',",""," COMPAT_ARG = '~yui|2|compat~',",""," shouldIterate = function(o) {"," try {"," // TODO: See if there's a more performant way to return true early on this, for the common case"," return (o && typeof o !== \"string\" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o));"," } catch(ex) {"," return false;"," }"," },",""," // aliases to support DOM event subscription clean up when the last"," // subscriber is detached. deleteAndClean overrides the DOM event's wrapper"," // CustomEvent _delete method."," _ceProtoDelete = Y.CustomEvent.prototype._delete,"," _deleteAndClean = function(s) {"," var ret = _ceProtoDelete.apply(this, arguments);",""," if (!this.hasSubs()) {"," Y.Event._clean(this);"," }",""," return ret;"," },","","Event = function() {",""," /**"," * True after the onload event has fired"," * @property _loadComplete"," * @type boolean"," * @static"," * @private"," */"," var _loadComplete = false,",""," /**"," * 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 _avail"," * @static"," * @private"," */"," _avail = [],",""," /**"," * Custom event wrappers for DOM events. Key is"," * 'event:' + Element uid stamp + event type"," * @property _wrappers"," * @type Y.Event.Custom"," * @static"," * @private"," */"," _wrappers = _eventenv.dom_wrappers,",""," _windowLoadKey = null,",""," /**"," * Custom event wrapper map DOM events. Key is"," * Element uid stamp. Each item is a hash of custom event"," * wrappers as provided in the _wrappers collection. This"," * provides the infrastructure for getListeners."," * @property _el_events"," * @static"," * @private"," */"," _el_events = _eventenv.dom_map;",""," 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 1000@amp;40 ms, so it will poll"," * for 40 seconds or until all outstanding handlers are bound"," * (whichever comes first)."," * @property POLL_RETRYS"," * @type int"," * @static"," * @final"," */"," POLL_RETRYS: 1000,",""," /**"," * The poll interval in milliseconds"," * @property POLL_INTERVAL"," * @type int"," * @static"," * @final"," */"," POLL_INTERVAL: 40,",""," /**"," * 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,","",""," /**"," * poll handle"," * @property _interval"," * @static"," * @private"," */"," _interval: null,",""," /**"," * document readystate poll handle"," * @property _dri"," * @static"," * @private"," */"," _dri: null,",""," /**"," * True when the document is initially usable"," * @property DOMReady"," * @type boolean"," * @static"," */"," DOMReady: false,",""," /**"," * @method startInterval"," * @static"," * @private"," */"," startInterval: function() {"," if (!Event._interval) {","Event._interval = setInterval(Event._poll, Event.POLL_INTERVAL);"," }"," },",""," /**"," * 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."," *"," * <p>The callback is executed with a single parameter:"," * the custom object parameter, if provided.</p>"," *"," * @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} p_obj an optional object to be passed back as"," * a parameter to fn."," * @param {boolean|object} p_override If set to true, fn will execute"," * in the context of p_obj, if set to an object it"," * will execute in the context of that object"," * @param checkContent {boolean} check child node readiness (onContentReady)"," * @static"," * @deprecated Use Y.on(\"available\")"," */"," // @TODO fix arguments"," onAvailable: function(id, fn, p_obj, p_override, checkContent, compat) {",""," var a = Y.Array(id), i, availHandle;","",""," for (i=0; i<a.length; i=i+1) {"," _avail.push({"," id: a[i],"," fn: fn,"," obj: p_obj,"," override: p_override,"," checkReady: checkContent,"," compat: compat"," });"," }"," _retryCount = this.POLL_RETRYS;",""," // We want the first test to be immediate, but async"," setTimeout(Event._poll, 0);",""," availHandle = new Y.EventHandle({",""," _delete: function() {"," // set by the event system for lazy DOM listeners"," if (availHandle.handle) {"," availHandle.handle.detach();"," return;"," }",""," var i, j;",""," // otherwise try to remove the onAvailable listener(s)"," for (i = 0; i < a.length; i++) {"," for (j = 0; j < _avail.length; j++) {"," if (a[i] === _avail[j].id) {"," _avail.splice(j, 1);"," }"," }"," }"," }",""," });",""," return availHandle;"," },",""," /**"," * Works the same way as onAvailable, but additionally checks the"," * state of sibling elements to determine if the content of the"," * available element is safe to modify."," *"," * <p>The callback is executed with a single parameter:"," * the custom object parameter, if provided.</p>"," *"," * @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} override If set to true, fn will execute"," * in the context of p_obj. If an object, fn will"," * exectute in the context of that object"," *"," * @static"," * @deprecated Use Y.on(\"contentready\")"," */"," // @TODO fix arguments"," onContentReady: function(id, fn, obj, override, compat) {"," return Event.onAvailable(id, fn, obj, override, true, compat);"," },",""," /**"," * Adds an event listener"," *"," * @method attach"," *"," * @param {String} type The type of event to append"," * @param {Function} fn The method the event invokes"," * @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 {Object} context optional context object"," * @param {Boolean|object} args 0..n arguments to pass to the callback"," * @return {EventHandle} an object to that can be used to detach the listener"," *"," * @static"," */",""," attach: function(type, fn, el, context) {"," return Event._attach(Y.Array(arguments, 0, true));"," },",""," _createWrapper: function (el, type, capture, compat, facade) {",""," var cewrapper,"," ek = Y.stamp(el),"," key = 'event:' + ek + type;",""," if (false === facade) {"," key += 'native';"," }"," if (capture) {"," key += 'capture';"," }","",""," cewrapper = _wrappers[key];","",""," if (!cewrapper) {"," // create CE wrapper"," cewrapper = Y.publish(key, {"," silent: true,"," bubbles: false,"," contextFn: function() {"," if (compat) {"," return cewrapper.el;"," } else {"," cewrapper.nodeRef = cewrapper.nodeRef || Y.one(cewrapper.el);"," return cewrapper.nodeRef;"," }"," }"," });",""," cewrapper.overrides = {};",""," // for later removeListener calls"," cewrapper.el = el;"," cewrapper.key = key;"," cewrapper.domkey = ek;"," cewrapper.type = type;"," cewrapper.fn = function(e) {"," cewrapper.fire(Event.getEvent(e, el, (compat || (false === facade))));"," };"," cewrapper.capture = capture;",""," if (el == win && type == \"load\") {"," // window load happens once"," cewrapper.fireOnce = true;"," _windowLoadKey = key;"," }"," cewrapper._delete = _deleteAndClean;",""," _wrappers[key] = cewrapper;"," _el_events[ek] = _el_events[ek] || {};"," _el_events[ek][key] = cewrapper;",""," add(el, type, cewrapper.fn, capture);"," }",""," return cewrapper;",""," },",""," _attach: function(args, conf) {",""," var compat,"," handles, oEl, cewrapper, context,"," fireNow = false, ret,"," type = args[0],"," fn = args[1],"," el = args[2] || win,"," facade = conf && conf.facade,"," capture = conf && conf.capture,"," overrides = conf && conf.overrides;",""," if (args[args.length-1] === COMPAT_ARG) {"," compat = true;"," }",""," if (!fn || !fn.call) {","// throw new TypeError(type + \" attach call failed, callback undefined\");"," return false;"," }",""," // The el argument can be an array of elements or element ids."," if (shouldIterate(el)) {",""," handles=[];",""," Y.each(el, function(v, k) {"," args[2] = v;"," handles.push(Event._attach(args.slice(), conf));"," });",""," // return (handles.length === 1) ? handles[0] : handles;"," return new Y.EventHandle(handles);",""," // If the el argument is a string, we assume it is"," // actually the id of the element. If the page is loaded"," // we convert el to the actual element, otherwise we"," // defer attaching the event until the element is"," // ready"," } else if (Y.Lang.isString(el)) {",""," // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el);",""," if (compat) {"," oEl = YDOM.byId(el);"," } else {",""," oEl = Y.Selector.query(el);",""," switch (oEl.length) {"," case 0:"," oEl = null;"," break;"," case 1:"," oEl = oEl[0];"," break;"," default:"," args[2] = oEl;"," return Event._attach(args, conf);"," }"," }",""," if (oEl) {",""," el = oEl;",""," // Not found = defer adding the event until the element is available"," } else {",""," ret = Event.onAvailable(el, function() {",""," ret.handle = Event._attach(args, conf);",""," }, Event, true, false, compat);",""," return ret;",""," }"," }",""," // Element should be an html element or node"," if (!el) {"," return false;"," }",""," if (Y.Node && Y.instanceOf(el, Y.Node)) {"," el = Y.Node.getDOMNode(el);"," }",""," cewrapper = Event._createWrapper(el, type, capture, compat, facade);"," if (overrides) {"," Y.mix(cewrapper.overrides, overrides);"," }",""," if (el == win && type == \"load\") {",""," // if the load is complete, fire immediately."," // all subscribers, including the current one"," // will be notified."," if (YUI.Env.windowLoaded) {"," fireNow = true;"," }"," }",""," if (compat) {"," args.pop();"," }",""," context = args[3];",""," // set context to the Node if not specified"," // ret = cewrapper.on.apply(cewrapper, trimmedArgs);"," ret = cewrapper._on(fn, context, (args.length > 4) ? args.slice(4) : null);",""," if (fireNow) {"," cewrapper.fire();"," }",""," return ret;",""," },",""," /**"," * Removes an event listener. Supports the signature the event was bound"," * with, but the preferred way to remove listeners is using the handle"," * that is returned when using Y.on"," *"," * @method detach"," *"," * @param {String} type the type of event to remove."," * @param {Function} fn the method the event invokes. If fn is"," * undefined, then all event handlers for the type of event are"," * removed."," * @param {String|HTMLElement|Array|NodeList|EventHandle} el An"," * event handle, an id, an element reference, or a collection"," * of ids and/or elements to remove the listener from."," * @return {boolean} true if the unbind was successful, false otherwise."," * @static"," */"," detach: function(type, fn, el, obj) {",""," var args=Y.Array(arguments, 0, true), compat, l, ok, i,"," id, ce;",""," if (args[args.length-1] === COMPAT_ARG) {"," compat = true;"," // args.pop();"," }",""," if (type && type.detach) {"," return type.detach();"," }",""," // The el argument can be a string"," if (typeof el == \"string\") {",""," // el = (compat) ? Y.DOM.byId(el) : Y.all(el);"," if (compat) {"," el = YDOM.byId(el);"," } else {"," el = Y.Selector.query(el);"," l = el.length;"," if (l < 1) {"," el = null;"," } else if (l == 1) {"," el = el[0];"," }"," }"," // return Event.detach.apply(Event, args);"," }",""," if (!el) {"," return false;"," }",""," if (el.detach) {"," args.splice(2, 1);"," return el.detach.apply(el, args);"," // The el argument can be an array of elements or element ids."," } else if (shouldIterate(el)) {"," ok = true;"," for (i=0, l=el.length; i<l; ++i) {"," args[2] = el[i];"," ok = ( Y.Event.detach.apply(Y.Event, args) && ok );"," }",""," return ok;"," }",""," if (!type || !fn || !fn.call) {"," return Event.purgeElement(el, false, type);"," }",""," id = 'event:' + Y.stamp(el) + type;"," ce = _wrappers[id];",""," if (ce) {"," return ce.detach(fn);"," } else {"," return 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} el the element the listener was attached to"," * @return {Event} the event"," * @static"," */"," getEvent: function(e, el, noFacade) {"," var ev = e || win.event;",""," return (noFacade) ? ev :"," new Y.DOMEventFacade(ev, el, _wrappers['event:' + Y.stamp(el) + e.type]);"," },",""," /**"," * Generates an unique ID for the element if it does not already"," * have one."," * @method generateId"," * @param el the element to create the id for"," * @return {string} the resulting id of the element"," * @static"," */"," generateId: function(el) {"," return YDOM.generateID(el);"," },",""," /**"," * We want to be able to use getElementsByTagName as a collection"," * to attach a group of events to. Unfortunately, different"," * browsers return different types of collections. This function"," * tests to determine if the object is array-like. It will also"," * fail if the object is an array, but is empty."," * @method _isValidCollection"," * @param o the object to test"," * @return {boolean} true if the object is array-like and populated"," * @deprecated was not meant to be used directly"," * @static"," * @private"," */"," _isValidCollection: shouldIterate,",""," /**"," * hook up any deferred listeners"," * @method _load"," * @static"," * @private"," */"," _load: function(e) {"," if (!_loadComplete) {"," _loadComplete = true;",""," // Just in case DOMReady did not go off for some reason"," // E._ready();"," if (Y.fire) {"," Y.fire(EVENT_READY);"," }",""," // Available elements may not have been detected before the"," // window load event fires. Try to find them now so that the"," // the user is more likely to get the onAvailable notifications"," // before the window load notification"," Event._poll();"," }"," },",""," /**"," * Polling function that runs before the onload event fires,"," * attempting to attach to DOM Nodes as soon as they are"," * available"," * @method _poll"," * @static"," * @private"," */"," _poll: function() {"," if (Event.locked) {"," return;"," }",""," if (Y.UA.ie && !YUI.Env.DOMReady) {"," // Hold off if DOMReady has not fired and check current"," // readyState to protect against the IE operation aborted"," // issue."," Event.startInterval();"," return;"," }",""," Event.locked = true;",""," // keep trying until after the page is loaded. We need to"," // check the page load state prior to trying to bind the"," // elements so that we can be certain all elements have been"," // tested appropriately"," var i, len, item, el, notAvail, executeItem,"," tryAgain = !_loadComplete;",""," if (!tryAgain) {"," tryAgain = (_retryCount > 0);"," }",""," // onAvailable"," notAvail = [];",""," executeItem = function (el, item) {"," var context, ov = item.override;"," try {"," if (item.compat) {"," if (item.override) {"," if (ov === true) {"," context = item.obj;"," } else {"," context = ov;"," }"," } else {"," context = el;"," }"," item.fn.call(context, item.obj);"," } else {"," context = item.obj || Y.one(el);"," item.fn.apply(context, (Y.Lang.isArray(ov)) ? ov : []);"," }"," } catch (e) {"," }"," };",""," // onAvailable"," for (i=0,len=_avail.length; i<len; ++i) {"," item = _avail[i];"," if (item && !item.checkReady) {",""," // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);"," el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true);",""," if (el) {"," executeItem(el, item);"," _avail[i] = null;"," } else {"," notAvail.push(item);"," }"," }"," }",""," // onContentReady"," for (i=0,len=_avail.length; i<len; ++i) {"," item = _avail[i];"," if (item && item.checkReady) {",""," // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);"," el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true);",""," if (el) {"," // The element is available, but not necessarily ready"," // @todo should we test parentNode.nextSibling?"," if (_loadComplete || (el.get && el.get('nextSibling')) || el.nextSibling) {"," executeItem(el, item);"," _avail[i] = null;"," }"," } else {"," notAvail.push(item);"," }"," }"," }",""," _retryCount = (notAvail.length === 0) ? 0 : _retryCount - 1;",""," if (tryAgain) {"," // we may need to strip the nulled out items here"," Event.startInterval();"," } else {"," clearInterval(Event._interval);"," Event._interval = null;"," }",""," Event.locked = false;",""," return;",""," },",""," /**"," * 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} type optional type of listener to purge. If"," * left out, all listeners will be removed"," * @static"," */"," purgeElement: function(el, recurse, type) {"," // var oEl = (Y.Lang.isString(el)) ? Y.one(el) : el,"," var oEl = (Y.Lang.isString(el)) ? Y.Selector.query(el, null, true) : el,"," lis = Event.getListeners(oEl, type), i, len, children, child;",""," if (recurse && oEl) {"," lis = lis || [];"," children = Y.Selector.query('*', oEl);"," len = children.length;"," for (i = 0; i < len; ++i) {"," child = Event.getListeners(children[i], type);"," if (child) {"," lis = lis.concat(child);"," }"," }"," }",""," if (lis) {"," for (i = 0, len = lis.length; i < len; ++i) {"," lis[i].detachAll();"," }"," }",""," },",""," /**"," * Removes all object references and the DOM proxy subscription for"," * a given event for a DOM node."," *"," * @method _clean"," * @param wrapper {CustomEvent} Custom event proxy for the DOM"," * subscription"," * @private"," * @static"," * @since 3.4.0"," */"," _clean: function (wrapper) {"," var key = wrapper.key,"," domkey = wrapper.domkey;",""," remove(wrapper.el, wrapper.type, wrapper.fn, wrapper.capture);"," delete _wrappers[key];"," delete Y._yuievt.events[key];"," if (_el_events[domkey]) {"," delete _el_events[domkey][key];"," if (!Y.Object.size(_el_events[domkey])) {"," delete _el_events[domkey];"," }"," }"," },",""," /**"," * Returns all listeners attached to the given element via addListener."," * Optionally, you can specify a specific type of event to return."," * @method getListeners"," * @param el {HTMLElement|string} the element or element id to inspect"," * @param type {string} optional type of listener to return. If"," * left out, all listeners will be returned"," * @return {CustomEvent} the custom event wrapper for the DOM event(s)"," * @static"," */"," getListeners: function(el, type) {"," var ek = Y.stamp(el, true), evts = _el_events[ek],"," results=[] , key = (type) ? 'event:' + ek + type : null,"," adapters = _eventenv.plugins;",""," if (!evts) {"," return null;"," }",""," if (key) {"," // look for synthetic events"," if (adapters[type] && adapters[type].eventDef) {"," key += '_synth';"," }",""," if (evts[key]) {"," results.push(evts[key]);"," }",""," // get native events as well"," key += 'native';"," if (evts[key]) {"," results.push(evts[key]);"," }",""," } else {"," Y.each(evts, function(v, k) {"," results.push(v);"," });"," }",""," return (results.length) ? results : null;"," },",""," /**"," * Removes all listeners registered by pe.event. Called"," * automatically during the unload event."," * @method _unload"," * @static"," * @private"," */"," _unload: function(e) {"," Y.each(_wrappers, function(v, k) {"," if (v.type == 'unload') {"," v.fire(e);"," }"," v.detachAll();"," });"," remove(win, \"unload\", onUnload);"," },",""," /**"," * Adds a DOM event directly without the caching, cleanup, context adj, etc"," *"," * @method nativeAdd"," * @param {HTMLElement} el the element to bind the handler to"," * @param {string} type the type of event handler"," * @param {function} fn the callback to invoke"," * @param {boolen} capture capture or bubble phase"," * @static"," * @private"," */"," nativeAdd: add,",""," /**"," * Basic remove listener"," *"," * @method nativeRemove"," * @param {HTMLElement} el the element to bind the handler to"," * @param {string} type the type of event handler"," * @param {function} fn the callback to invoke"," * @param {boolen} capture capture or bubble phase"," * @static"," * @private"," */"," nativeRemove: remove"," };","","}();","","Y.Event = Event;","","if (config.injected || YUI.Env.windowLoaded) {"," onLoad();","} else {"," add(win, \"load\", onLoad);","}","","// Process onAvailable/onContentReady items when when the DOM is ready in IE","if (Y.UA.ie) {"," Y.on(EVENT_READY, Event._poll);","}","","try {"," add(win, \"unload\", onUnload);","} catch(e) {","}","","Event.Custom = Y.CustomEvent;","Event.Subscriber = Y.Subscriber;","Event.Target = Y.EventTarget;","Event.Handle = Y.EventHandle;","Event.Facade = Y.EventFacade;","","Event._poll();","","}());","","/**"," * DOM event listener abstraction layer"," * @module event"," * @submodule event-base"," */","","/**"," * Executes the callback as soon as the specified element"," * is detected in the DOM. This function expects a selector"," * string for the element(s) to detect. If you already have"," * an element reference, you don't need this event."," * @event available"," * @param type {string} 'available'"," * @param fn {function} the callback function to execute."," * @param el {string} an selector for the element(s) to attach"," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.Env.evt.plugins.available = {"," on: function(type, fn, id, o) {"," var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;"," return Y.Event.onAvailable.call(Y.Event, id, fn, o, a);"," }","};","","/**"," * Executes the callback as soon as the specified element"," * is detected in the DOM with a nextSibling property"," * (indicating that the element's children are available)."," * This function expects a selector"," * string for the element(s) to detect. If you already have"," * an element reference, you don't need this event."," * @event contentready"," * @param type {string} 'contentready'"," * @param fn {function} the callback function to execute."," * @param el {string} an selector for the element(s) to attach."," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.Env.evt.plugins.contentready = {"," on: function(type, fn, id, o) {"," var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;"," return Y.Event.onContentReady.call(Y.Event, id, fn, o, a);"," }","};","","","}, '3.7.3', {\"requires\": [\"event-custom-base\"]});"];+_yuitest_coverage["build/event-base/event-base.js"].lines = {"1":0,"2":0,"4":0,"5":0,"6":0,"7":0,"10":0,"13":0,"42":0,"47":0,"48":0,"50":0,"69":0,"109":0,"110":0,"112":0,"113":0,"114":0,"117":0,"120":0,"124":0,"125":0,"126":0,"129":0,"132":0,"136":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"149":0,"151":0,"152":0,"166":0,"168":0,"169":0,"172":0,"173":0,"176":0,"178":0,"180":0,"181":0,"182":0,"184":0,"185":0,"188":0,"189":0,"194":0,"195":0,"196":0,"200":0,"201":0,"202":0,"204":0,"206":0,"207":0,"211":0,"212":0,"213":0,"214":0,"215":0,"219":0,"220":0,"222":0,"225":0,"230":0,"231":0,"232":0,"378":0,"397":0,"398":0,"400":0,"408":0,"409":0,"410":0,"414":0,"422":0,"424":0,"426":0,"435":0,"437":0,"438":0,"441":0,"453":0,"496":0,"561":0,"562":0,"594":0,"597":0,"598":0,"607":0,"610":0,"612":0,"616":0,"617":0,"618":0,"621":0,"624":0,"625":0,"626":0,"627":0,"635":0,"661":0,"682":0,"687":0,"691":0,"692":0,"694":0,"695":0,"699":0,"702":0,"704":0,"708":0,"709":0,"711":0,"712":0,"717":0,"720":0,"721":0,"722":0,"723":0,"724":0,"725":0,"727":0,"729":0,"731":0,"732":0,"734":0,"736":0,"737":0,"738":0,"740":0,"743":0,"749":0,"759":0,"760":0,"763":0,"765":0,"769":0,"771":0,"773":0,"774":0,"775":0,"779":0,"786":0,"790":0,"791":0,"794":0,"796":0,"798":0,"799":0,"801":0,"802":0,"804":0,"805":0,"809":0,"811":0,"816":0,"818":0,"822":0,"828":0,"829":0,"832":0,"833":0,"836":0,"837":0,"838":0,"841":0,"846":0,"847":0,"851":0,"852":0,"855":0,"859":0,"861":0,"862":0,"865":0,"888":0,"891":0,"892":0,"896":0,"897":0,"901":0,"904":0,"905":0,"907":0,"908":0,"909":0,"910":0,"911":0,"912":0,"918":0,"919":0,"922":0,"923":0,"924":0,"926":0,"927":0,"928":0,"929":0,"930":0,"933":0,"936":0,"937":0,"940":0,"941":0,"943":0,"944":0,"946":0,"964":0,"966":0,"979":0,"1004":0,"1005":0,"1009":0,"1010":0,"1017":0,"1030":0,"1031":0,"1034":0,"1038":0,"1039":0,"1042":0,"1048":0,"1051":0,"1052":0,"1056":0,"1058":0,"1059":0,"1060":0,"1061":0,"1062":0,"1063":0,"1064":0,"1066":0,"1069":0,"1071":0,"1073":0,"1074":0,"1081":0,"1082":0,"1083":0,"1086":0,"1088":0,"1089":0,"1090":0,"1092":0,"1098":0,"1099":0,"1100":0,"1103":0,"1105":0,"1108":0,"1109":0,"1110":0,"1113":0,"1118":0,"1120":0,"1122":0,"1124":0,"1125":0,"1128":0,"1130":0,"1148":0,"1151":0,"1152":0,"1153":0,"1154":0,"1155":0,"1156":0,"1157":0,"1158":0,"1163":0,"1164":0,"1165":0,"1183":0,"1186":0,"1187":0,"1188":0,"1189":0,"1190":0,"1191":0,"1192":0,"1208":0,"1212":0,"1213":0,"1216":0,"1218":0,"1219":0,"1222":0,"1223":0,"1227":0,"1228":0,"1229":0,"1233":0,"1234":0,"1238":0,"1249":0,"1250":0,"1251":0,"1253":0,"1255":0,"1287":0,"1289":0,"1290":0,"1292":0,"1296":0,"1297":0,"1300":0,"1301":0,"1305":0,"1306":0,"1307":0,"1308":0,"1309":0,"1311":0,"1336":0,"1338":0,"1339":0,"1360":0,"1362":0,"1363":0};+_yuitest_coverage["build/event-base/event-base.js"].functions = {"_ready:5":0,"(anonymous 1):1":0,"(anonymous 3):50":0,"resolve:108":0,"DOMEventFacade:123":0,"init:134":0,"stopPropagation:193":0,"stopImmediatePropagation:199":0,"preventDefault:210":0,"halt:218":0,"onLoad:407":0,"onUnload:413":0,"shouldIterate:421":0,"_deleteAndClean:434":0,"startInterval:560":0,"_delete:614":0,"onAvailable:592":0,"onContentReady:660":0,"attach:681":0,"contextFn:707":0,"fn:724":0,"_createWrapper:685":0,"(anonymous 5):773":0,"(anonymous 6):816":0,"_attach:747":0,"detach:886":0,"getEvent:963":0,"generateId:978":0,"_load:1003":0,"executeItem:1058":0,"_poll:1029":0,"purgeElement:1146":0,"_clean:1182":0,"(anonymous 7):1233":0,"getListeners:1207":0,"(anonymous 8):1249":0,"_unload:1248":0,"Event:444":0,"(anonymous 4):378":0,"on:1337":0,"on:1361":0,"(anonymous 2):13":0};+_yuitest_coverage["build/event-base/event-base.js"].coveredLines = 324; _yuitest_coverage["build/event-base/event-base.js"].coveredFunctions = 42; _yuitest_coverline("build/event-base/event-base.js", 1); (function () {@@ -522,25 +522,26 @@ Y.Env.evt.dom_map = {}; _yuitest_coverline("build/event-base/event-base.js", 400);-var _eventenv = Y.Env.evt,+var YDOM = Y.DOM,+ _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add, remove = YUI.Env.remove, onLoad = function() {- _yuitest_coverfunc("build/event-base/event-base.js", "onLoad", 406);-_yuitest_coverline("build/event-base/event-base.js", 407);+ _yuitest_coverfunc("build/event-base/event-base.js", "onLoad", 407);+_yuitest_coverline("build/event-base/event-base.js", 408); YUI.Env.windowLoaded = true;- _yuitest_coverline("build/event-base/event-base.js", 408);-Y.Event._load(); _yuitest_coverline("build/event-base/event-base.js", 409);+Y.Event._load();+ _yuitest_coverline("build/event-base/event-base.js", 410); remove(win, "load", onLoad); }, onUnload = function() {- _yuitest_coverfunc("build/event-base/event-base.js", "onUnload", 412);-_yuitest_coverline("build/event-base/event-base.js", 413);+ _yuitest_coverfunc("build/event-base/event-base.js", "onUnload", 413);+_yuitest_coverline("build/event-base/event-base.js", 414); Y.Event._unload(); }, @@ -549,17 +550,16 @@ COMPAT_ARG = '~yui|2|compat~', shouldIterate = function(o) {- _yuitest_coverfunc("build/event-base/event-base.js", "shouldIterate", 420);-_yuitest_coverline("build/event-base/event-base.js", 421);+ _yuitest_coverfunc("build/event-base/event-base.js", "shouldIterate", 421);+_yuitest_coverline("build/event-base/event-base.js", 422); try {- _yuitest_coverline("build/event-base/event-base.js", 422);-return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) &&- !o.tagName && !o.alert);+ // TODO: See if there's a more performant way to return true early on this, for the common case+ _yuitest_coverline("build/event-base/event-base.js", 424);+return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o)); } catch(ex) {- _yuitest_coverline("build/event-base/event-base.js", 425);+ _yuitest_coverline("build/event-base/event-base.js", 426); return false; }- }, // aliases to support DOM event subscription clean up when the last@@ -1003,7 +1003,7 @@ _yuitest_coverline("build/event-base/event-base.js", 790); if (compat) { _yuitest_coverline("build/event-base/event-base.js", 791);-oEl = Y.DOM.byId(el);+oEl = YDOM.byId(el); } else { _yuitest_coverline("build/event-base/event-base.js", 794);@@ -1157,7 +1157,7 @@ _yuitest_coverline("build/event-base/event-base.js", 904); if (compat) { _yuitest_coverline("build/event-base/event-base.js", 905);-el = Y.DOM.byId(el);+el = YDOM.byId(el); } else { _yuitest_coverline("build/event-base/event-base.js", 907); el = Y.Selector.query(el);@@ -1260,7 +1260,7 @@ generateId: function(el) { _yuitest_coverfunc("build/event-base/event-base.js", "generateId", 978); _yuitest_coverline("build/event-base/event-base.js", 979);-return Y.DOM.generateID(el);+return YDOM.generateID(el); }, /**@@ -1401,7 +1401,7 @@ // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); _yuitest_coverline("build/event-base/event-base.js", 1086);-el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); _yuitest_coverline("build/event-base/event-base.js", 1088); if (el) {@@ -1426,7 +1426,7 @@ // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id); _yuitest_coverline("build/event-base/event-base.js", 1103);-el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); _yuitest_coverline("build/event-base/event-base.js", 1105); if (el) {@@ -1495,26 +1495,24 @@ _yuitest_coverline("build/event-base/event-base.js", 1153); children = Y.Selector.query('*', oEl); _yuitest_coverline("build/event-base/event-base.js", 1154);-i = 0;- _yuitest_coverline("build/event-base/event-base.js", 1155); len = children.length;- _yuitest_coverline("build/event-base/event-base.js", 1156);-for (; i < len; ++i) {- _yuitest_coverline("build/event-base/event-base.js", 1157);+ _yuitest_coverline("build/event-base/event-base.js", 1155);+for (i = 0; i < len; ++i) {+ _yuitest_coverline("build/event-base/event-base.js", 1156); child = Event.getListeners(children[i], type);- _yuitest_coverline("build/event-base/event-base.js", 1158);+ _yuitest_coverline("build/event-base/event-base.js", 1157); if (child) {- _yuitest_coverline("build/event-base/event-base.js", 1159);+ _yuitest_coverline("build/event-base/event-base.js", 1158); lis = lis.concat(child); } } } - _yuitest_coverline("build/event-base/event-base.js", 1164);+ _yuitest_coverline("build/event-base/event-base.js", 1163); if (lis) {- _yuitest_coverline("build/event-base/event-base.js", 1165);+ _yuitest_coverline("build/event-base/event-base.js", 1164); for (i = 0, len = lis.length; i < len; ++i) {- _yuitest_coverline("build/event-base/event-base.js", 1166);+ _yuitest_coverline("build/event-base/event-base.js", 1165); lis[i].detachAll(); } }@@ -1533,24 +1531,24 @@ * @since 3.4.0 */ _clean: function (wrapper) {- _yuitest_coverfunc("build/event-base/event-base.js", "_clean", 1183);-_yuitest_coverline("build/event-base/event-base.js", 1184);+ _yuitest_coverfunc("build/event-base/event-base.js", "_clean", 1182);+_yuitest_coverline("build/event-base/event-base.js", 1183); var key = wrapper.key, domkey = wrapper.domkey; - _yuitest_coverline("build/event-base/event-base.js", 1187);+ _yuitest_coverline("build/event-base/event-base.js", 1186); remove(wrapper.el, wrapper.type, wrapper.fn, wrapper.capture);- _yuitest_coverline("build/event-base/event-base.js", 1188);+ _yuitest_coverline("build/event-base/event-base.js", 1187); delete _wrappers[key];- _yuitest_coverline("build/event-base/event-base.js", 1189);+ _yuitest_coverline("build/event-base/event-base.js", 1188); delete Y._yuievt.events[key];- _yuitest_coverline("build/event-base/event-base.js", 1190);+ _yuitest_coverline("build/event-base/event-base.js", 1189); if (_el_events[domkey]) {- _yuitest_coverline("build/event-base/event-base.js", 1191);+ _yuitest_coverline("build/event-base/event-base.js", 1190); delete _el_events[domkey][key];- _yuitest_coverline("build/event-base/event-base.js", 1192);+ _yuitest_coverline("build/event-base/event-base.js", 1191); if (!Y.Object.size(_el_events[domkey])) {- _yuitest_coverline("build/event-base/event-base.js", 1193);+ _yuitest_coverline("build/event-base/event-base.js", 1192); delete _el_events[domkey]; } }@@ -1567,52 +1565,52 @@ * @static */ getListeners: function(el, type) {- _yuitest_coverfunc("build/event-base/event-base.js", "getListeners", 1208);-_yuitest_coverline("build/event-base/event-base.js", 1209);+ _yuitest_coverfunc("build/event-base/event-base.js", "getListeners", 1207);+_yuitest_coverline("build/event-base/event-base.js", 1208); var ek = Y.stamp(el, true), evts = _el_events[ek], results=[] , key = (type) ? 'event:' + ek + type : null, adapters = _eventenv.plugins; - _yuitest_coverline("build/event-base/event-base.js", 1213);+ _yuitest_coverline("build/event-base/event-base.js", 1212); if (!evts) {- _yuitest_coverline("build/event-base/event-base.js", 1214);+ _yuitest_coverline("build/event-base/event-base.js", 1213); return null; } - _yuitest_coverline("build/event-base/event-base.js", 1217);+ _yuitest_coverline("build/event-base/event-base.js", 1216); if (key) { // look for synthetic events- _yuitest_coverline("build/event-base/event-base.js", 1219);+ _yuitest_coverline("build/event-base/event-base.js", 1218); if (adapters[type] && adapters[type].eventDef) {- _yuitest_coverline("build/event-base/event-base.js", 1220);+ _yuitest_coverline("build/event-base/event-base.js", 1219); key += '_synth'; } - _yuitest_coverline("build/event-base/event-base.js", 1223);+ _yuitest_coverline("build/event-base/event-base.js", 1222); if (evts[key]) {- _yuitest_coverline("build/event-base/event-base.js", 1224);+ _yuitest_coverline("build/event-base/event-base.js", 1223); results.push(evts[key]); } // get native events as well- _yuitest_coverline("build/event-base/event-base.js", 1228);+ _yuitest_coverline("build/event-base/event-base.js", 1227); key += 'native';- _yuitest_coverline("build/event-base/event-base.js", 1229);+ _yuitest_coverline("build/event-base/event-base.js", 1228); if (evts[key]) {- _yuitest_coverline("build/event-base/event-base.js", 1230);+ _yuitest_coverline("build/event-base/event-base.js", 1229); results.push(evts[key]); } } else {- _yuitest_coverline("build/event-base/event-base.js", 1234);+ _yuitest_coverline("build/event-base/event-base.js", 1233); Y.each(evts, function(v, k) {- _yuitest_coverfunc("build/event-base/event-base.js", "(anonymous 7)", 1234);-_yuitest_coverline("build/event-base/event-base.js", 1235);+ _yuitest_coverfunc("build/event-base/event-base.js", "(anonymous 7)", 1233);+_yuitest_coverline("build/event-base/event-base.js", 1234); results.push(v); }); } - _yuitest_coverline("build/event-base/event-base.js", 1239);+ _yuitest_coverline("build/event-base/event-base.js", 1238); return (results.length) ? results : null; }, @@ -1624,19 +1622,19 @@ * @private */ _unload: function(e) {- _yuitest_coverfunc("build/event-base/event-base.js", "_unload", 1249);-_yuitest_coverline("build/event-base/event-base.js", 1250);+ _yuitest_coverfunc("build/event-base/event-base.js", "_unload", 1248);+_yuitest_coverline("build/event-base/event-base.js", 1249); Y.each(_wrappers, function(v, k) {- _yuitest_coverfunc("build/event-base/event-base.js", "(anonymous 8)", 1250);-_yuitest_coverline("build/event-base/event-base.js", 1251);+ _yuitest_coverfunc("build/event-base/event-base.js", "(anonymous 8)", 1249);+_yuitest_coverline("build/event-base/event-base.js", 1250); if (v.type == 'unload') {- _yuitest_coverline("build/event-base/event-base.js", 1252);+ _yuitest_coverline("build/event-base/event-base.js", 1251); v.fire(e); }- _yuitest_coverline("build/event-base/event-base.js", 1254);+ _yuitest_coverline("build/event-base/event-base.js", 1253); v.detachAll(); });- _yuitest_coverline("build/event-base/event-base.js", 1256);+ _yuitest_coverline("build/event-base/event-base.js", 1255); remove(win, "unload", onUnload); }, @@ -1669,47 +1667,47 @@ }(); -_yuitest_coverline("build/event-base/event-base.js", 1288);+_yuitest_coverline("build/event-base/event-base.js", 1287); Y.Event = Event; -_yuitest_coverline("build/event-base/event-base.js", 1290);+_yuitest_coverline("build/event-base/event-base.js", 1289); if (config.injected || YUI.Env.windowLoaded) {- _yuitest_coverline("build/event-base/event-base.js", 1291);+ _yuitest_coverline("build/event-base/event-base.js", 1290); onLoad(); } else {- _yuitest_coverline("build/event-base/event-base.js", 1293);+ _yuitest_coverline("build/event-base/event-base.js", 1292); add(win, "load", onLoad); } // Process onAvailable/onContentReady items when when the DOM is ready in IE-_yuitest_coverline("build/event-base/event-base.js", 1297);+_yuitest_coverline("build/event-base/event-base.js", 1296); if (Y.UA.ie) {- _yuitest_coverline("build/event-base/event-base.js", 1298);+ _yuitest_coverline("build/event-base/event-base.js", 1297); Y.on(EVENT_READY, Event._poll); } -_yuitest_coverline("build/event-base/event-base.js", 1301);+_yuitest_coverline("build/event-base/event-base.js", 1300); try {- _yuitest_coverline("build/event-base/event-base.js", 1302);+ _yuitest_coverline("build/event-base/event-base.js", 1301); add(win, "unload", onUnload); } catch(e) { } -_yuitest_coverline("build/event-base/event-base.js", 1306);+_yuitest_coverline("build/event-base/event-base.js", 1305); Event.Custom = Y.CustomEvent;-_yuitest_coverline("build/event-base/event-base.js", 1307);+_yuitest_coverline("build/event-base/event-base.js", 1306); Event.Subscriber = Y.Subscriber;-_yuitest_coverline("build/event-base/event-base.js", 1308);+_yuitest_coverline("build/event-base/event-base.js", 1307); Event.Target = Y.EventTarget;-_yuitest_coverline("build/event-base/event-base.js", 1309);+_yuitest_coverline("build/event-base/event-base.js", 1308); Event.Handle = Y.EventHandle;-_yuitest_coverline("build/event-base/event-base.js", 1310);+_yuitest_coverline("build/event-base/event-base.js", 1309); Event.Facade = Y.EventFacade; -_yuitest_coverline("build/event-base/event-base.js", 1312);+_yuitest_coverline("build/event-base/event-base.js", 1311); Event._poll(); -})();+}()); /** * DOM event listener abstraction layer@@ -1732,13 +1730,13 @@ * @return {EventHandle} the detach handle * @for YUI */-_yuitest_coverline("build/event-base/event-base.js", 1337);+_yuitest_coverline("build/event-base/event-base.js", 1336); Y.Env.evt.plugins.available = { on: function(type, fn, id, o) {- _yuitest_coverfunc("build/event-base/event-base.js", "on", 1338);-_yuitest_coverline("build/event-base/event-base.js", 1339);+ _yuitest_coverfunc("build/event-base/event-base.js", "on", 1337);+_yuitest_coverline("build/event-base/event-base.js", 1338); var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;- _yuitest_coverline("build/event-base/event-base.js", 1340);+ _yuitest_coverline("build/event-base/event-base.js", 1339); return Y.Event.onAvailable.call(Y.Event, id, fn, o, a); } };@@ -1760,16 +1758,16 @@ * @return {EventHandle} the detach handle * @for YUI */-_yuitest_coverline("build/event-base/event-base.js", 1361);+_yuitest_coverline("build/event-base/event-base.js", 1360); Y.Env.evt.plugins.contentready = { on: function(type, fn, id, o) {- _yuitest_coverfunc("build/event-base/event-base.js", "on", 1362);-_yuitest_coverline("build/event-base/event-base.js", 1363);+ _yuitest_coverfunc("build/event-base/event-base.js", "on", 1361);+_yuitest_coverline("build/event-base/event-base.js", 1362); var a = arguments.length > 4 ? Y.Array(arguments, 4, true) : null;- _yuitest_coverline("build/event-base/event-base.js", 1364);+ _yuitest_coverline("build/event-base/event-base.js", 1363); return Y.Event.onContentReady.call(Y.Event, id, fn, o, a); } }; -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]});
bundle/event-base/event-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -403,7 +403,8 @@ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; -var _eventenv = Y.Env.evt,+var YDOM = Y.DOM,+ _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add,@@ -425,13 +426,12 @@ shouldIterate = function(o) { try {- return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) &&- !o.tagName && !o.alert);+ // TODO: See if there's a more performant way to return true early on this, for the common case+ return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o)); } catch(ex) { Y.log("collection check failure", "warn", "event"); return false; }- }, // aliases to support DOM event subscription clean up when the last@@ -797,7 +797,7 @@ // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) {- oEl = Y.DOM.byId(el);+ oEl = YDOM.byId(el); } else { oEl = Y.Selector.query(el);@@ -914,7 +914,7 @@ // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) {- el = Y.DOM.byId(el);+ el = YDOM.byId(el); } else { el = Y.Selector.query(el); l = el.length;@@ -988,7 +988,7 @@ * @static */ generateId: function(el) {- return Y.DOM.generateID(el);+ return YDOM.generateID(el); }, /**@@ -1098,7 +1098,7 @@ if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // Y.log('avail: ' + el);@@ -1117,7 +1117,7 @@ if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready@@ -1168,9 +1168,8 @@ if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl);- i = 0; len = children.length;- for (; i < len; ++i) {+ for (i = 0; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child);@@ -1329,7 +1328,7 @@ Event._poll(); -})();+}()); /** * DOM event listener abstraction layer@@ -1384,4 +1383,4 @@ }; -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]});
bundle/event-base/event-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-(function(){var e=YUI.Env;e._ready||(e._ready=function(){e.DOMReady=!0,e.remove(YUI.config.doc,"DOMContentLoaded",e._ready)},e.add(YUI.config.doc,"DOMContentLoaded",e._ready))})(),YUI.add("event-base",function(e,t){e.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?e.fire("domready"):e.Do.before(function(){e.fire("domready")},YUI.Env,"_ready");var n=e.UA,r={},i={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},s=function(t){if(!t)return t;try{t&&3==t.nodeType&&(t=t.parentNode)}catch(n){return null}return e.one(t)},o=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||r,this.init()};e.extend(o,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,r=e.pageX,o=e.pageY,u,a=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=r,this.pageY=o,u=e.keyCode||e.charCode,n.webkit&&u in i&&(u=i[u]),this.keyCode=u,this.charCode=u,this.which=e.which||e.charCode||u,this.button=this.which,this.target=s(e.target),this.currentTarget=s(a),this.relatedTarget=s(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll")this.wheelDelta=e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1);this._touch&&this._touch(e,a,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),t.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),o.resolve=s,e.DOM2EventFacade=o,e.DOMEventFacade=o,function(){e.Env.evt.dom_wrappers={},e.Env.evt.dom_map={};var t=e.Env.evt,n=e.config,r=n.win,i=YUI.Env.add,s=YUI.Env.remove,o=function(){YUI.Env.windowLoaded=!0,e.Event._load(),s(r,"load",o)},u=function(){e.Event._unload()},a="domready",f="~yui|2|compat~",l=function(t){try{return t&&typeof t!="string"&&e.Lang.isNumber(t.length)&&!t.tagName&&!t.alert}catch(n){return!1}},c=e.CustomEvent.prototype._delete,h=function(t){var n=c.apply(this,arguments);return this.hasSubs()||e.Event._clean(this),n},p=function(){var n=!1,o=0,c=[],d=t.dom_wrappers,v=null,m=t.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){p._interval||(p._interval=setInterval(p._poll,p.POLL_INTERVAL))},onAvailable:function(t,n,r,i,s,u){var a=e.Array(t),f,l;for(f=0;f<a.length;f+=1)c.push({id:a[f],fn:n,obj:r,override:i,checkReady:s,compat:u});return o=this.POLL_RETRYS,setTimeout(p._poll,0),l=new e.EventHandle({_delete:function(){if(l.handle){l.handle.detach();return}var e,t;for(e=0;e<a.length;e++)for(t=0;t<c.length;t++)a[e]===c[t].id&&c.splice(t,1)}}),l},onContentReady:function(e,t,n,r,i){return p.onAvailable(e,t,n,r,!0,i)},attach:function(t,n,r,i){return p._attach(e.Array(arguments,0,!0))},_createWrapper:function(t,n,s,o,u){var a,f=e.stamp(t),l="event:"+f+n;return!1===u&&(l+="native"),s&&(l+="capture"),a=d[l],a||(a=e.publish(l,{silent:!0,bubbles:!1,contextFn:function(){return o?a.el:(a.nodeRef=a.nodeRef||e.one(a.el),a.nodeRef)}}),a.overrides={},a.el=t,a.key=l,a.domkey=f,a.type=n,a.fn=function(e){a.fire(p.getEvent(e,t,o||!1===u))},a.capture=s,t==r&&n=="load"&&(a.fireOnce=!0,v=l),a._delete=h,d[l]=a,m[f]=m[f]||{},m[f][l]=a,i(t,n,a.fn,s)),a},_attach:function(t,n){var i,s,o,u,a,c=!1,h,d=t[0],v=t[1],m=t[2]||r,g=n&&n.facade,y=n&&n.capture,b=n&&n.overrides;t[t.length-1]===f&&(i=!0);if(!v||!v.call)return!1;if(l(m))return s=[],e.each(m,function(e,r){t[2]=e,s.push(p._attach(t.slice(),n))}),new e.EventHandle(s);if(e.Lang.isString(m)){if(i)o=e.DOM.byId(m);else{o=e.Selector.query(m);switch(o.length){case 0:o=null;break;case 1:o=o[0];break;default:return t[2]=o,p._attach(t,n)}}if(!o)return h=p.onAvailable(m,function(){h.handle=p._attach(t,n)},p,!0,!1,i),h;m=o}return m?(e.Node&&e.instanceOf(m,e.Node)&&(m=e.Node.getDOMNode(m)),u=p._createWrapper(m,d,y,i,g),b&&e.mix(u.overrides,b),m==r&&d=="load"&&YUI.Env.windowLoaded&&(c=!0),i&&t.pop(),a=t[3],h=u._on(v,a,t.length>4?t.slice(4):null),c&&u.fire(),h):!1},detach:function(t,n,r,i){var s=e.Array(arguments,0,!0),o,u,a,c,h,v;s[s.length-1]===f&&(o=!0);if(t&&t.detach)return t.detach();typeof r=="string"&&(o?r=e.DOM.byId(r):(r=e.Selector.query(r),u=r.length,u<1?r=null:u==1&&(r=r[0])));if(!r)return!1;if(r.detach)return s.splice(2,1),r.detach.apply(r,s);if(l(r)){a=!0;for(c=0,u=r.length;c<u;++c)s[2]=r[c],a=e.Event.detach.apply(e.Event,s)&&a;return a}return!t||!n||!n.call?p.purgeElement(r,!1,t):(h="event:"+e.stamp(r)+t,v=d[h],v?v.detach(n):!1)},getEvent:function(t,n,i){var s=t||r.event;return i?s:new e.DOMEventFacade(s,n,d["event:"+e.stamp(n)+t.type])},generateId:function(t){return e.DOM.generateID(t)},_isValidCollection:l,_load:function(t){n||(n=!0,e.fire&&e.fire(a),p._poll())},_poll:function(){if(p.locked)return;if(e.UA.ie&&!YUI.Env.DOMReady){p.startInterval();return}p.locked=!0;var t,r,i,s,u,a,f=!n;f||(f=o>0),u=[],a=function(t,n){var r,i=n.override;try{n.compat?(n.override?i===!0?r=n.obj:r=i:r=t,n.fn.call(r,n.obj)):(r=n.obj||e.one(t),n.fn.apply(r,e.Lang.isArray(i)?i:[]))}catch(s){}};for(t=0,r=c.length;t<r;++t)i=c[t],i&&!i.checkReady&&(s=i.compat?e.DOM.byId(i.id):e.Selector.query(i.id,null,!0),s?(a(s,i),c[t]=null):u.push(i));for(t=0,r=c.length;t<r;++t){i=c[t];if(i&&i.checkReady){s=i.compat?e.DOM.byId(i.id):e.Selector.query(i.id,null,!0);if(s){if(n||s.get&&s.get("nextSibling")||s.nextSibling)a(s,i),c[t]=null}else u.push(i)}}o=u.length===0?0:o-1,f?p.startInterval():(clearInterval(p._interval),p._interval=null),p.locked=!1;return},purgeElement:function(t,n,r){var i=e.Lang.isString(t)?e.Selector.query(t,null,!0):t,s=p.getListeners(i,r),o,u,a,f;if(n&&i){s=s||[],a=e.Selector.query("*",i),o=0,u=a.length;for(;o<u;++o)f=p.getListeners(a[o],r),f&&(s=s.concat(f))}if(s)for(o=0,u=s.length;o<u;++o)s[o].detachAll()},_clean:function(t){var n=t.key,r=t.domkey;s(t.el,t.type,t.fn,t.capture),delete d[n],delete e._yuievt.events[n],m[r]&&(delete m[r][n],e.Object.size(m[r])||delete m[r])},getListeners:function(n,r){var i=e.stamp(n,!0),s=m[i],o=[],u=r?"event:"+i+r:null,a=t.plugins;return s?(u?(a[r]&&a[r].eventDef&&(u+="_synth"),s[u]&&o.push(s[u]),u+="native",s[u]&&o.push(s[u])):e.each(s,function(e,t){o.push(e)}),o.length?o:null):null},_unload:function(t){e.each(d,function(e,n){e.type=="unload"&&e.fire(t),e.detachAll()}),s(r,"unload",u)},nativeAdd:i,nativeRemove:s}}();e.Event=p,n.injected||YUI.Env.windowLoaded?o():i(r,"load",o),e.UA.ie&&e.on(a,p._poll);try{i(r,"unload",u)}catch(d){}p.Custom=e.CustomEvent,p.Subscriber=e.Subscriber,p.Target=e.EventTarget,p.Handle=e.EventHandle,p.Facade=e.EventFacade,p._poll()}(),e.Env.evt.plugins.available={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onAvailable.call(e.Event,r,n,i,s)}},e.Env.evt.plugins.contentready={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onContentReady.call(e.Event,r,n,i,s)}}},"3.7.2",{requires:["event-custom-base"]});+(function(){var e=YUI.Env;e._ready||(e._ready=function(){e.DOMReady=!0,e.remove(YUI.config.doc,"DOMContentLoaded",e._ready)},e.add(YUI.config.doc,"DOMContentLoaded",e._ready))})(),YUI.add("event-base",function(e,t){e.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?e.fire("domready"):e.Do.before(function(){e.fire("domready")},YUI.Env,"_ready");var n=e.UA,r={},i={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},s=function(t){if(!t)return t;try{t&&3==t.nodeType&&(t=t.parentNode)}catch(n){return null}return e.one(t)},o=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||r,this.init()};e.extend(o,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,r=e.pageX,o=e.pageY,u,a=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=r,this.pageY=o,u=e.keyCode||e.charCode,n.webkit&&u in i&&(u=i[u]),this.keyCode=u,this.charCode=u,this.which=e.which||e.charCode||u,this.button=this.which,this.target=s(e.target),this.currentTarget=s(a),this.relatedTarget=s(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll")this.wheelDelta=e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1);this._touch&&this._touch(e,a,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),t.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),o.resolve=s,e.DOM2EventFacade=o,e.DOMEventFacade=o,function(){e.Env.evt.dom_wrappers={},e.Env.evt.dom_map={};var t=e.DOM,n=e.Env.evt,r=e.config,i=r.win,s=YUI.Env.add,o=YUI.Env.remove,u=function(){YUI.Env.windowLoaded=!0,e.Event._load(),o(i,"load",u)},a=function(){e.Event._unload()},f="domready",l="~yui|2|compat~",c=function(n){try{return n&&typeof n!="string"&&e.Lang.isNumber(n.length)&&!n.tagName&&!t.isWindow(n)}catch(r){return!1}},h=e.CustomEvent.prototype._delete,p=function(t){var n=h.apply(this,arguments);return this.hasSubs()||e.Event._clean(this),n},d=function(){var r=!1,u=0,h=[],v=n.dom_wrappers,m=null,g=n.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){d._interval||(d._interval=setInterval(d._poll,d.POLL_INTERVAL))},onAvailable:function(t,n,r,i,s,o){var a=e.Array(t),f,l;for(f=0;f<a.length;f+=1)h.push({id:a[f],fn:n,obj:r,override:i,checkReady:s,compat:o});return u=this.POLL_RETRYS,setTimeout(d._poll,0),l=new e.EventHandle({_delete:function(){if(l.handle){l.handle.detach();return}var e,t;for(e=0;e<a.length;e++)for(t=0;t<h.length;t++)a[e]===h[t].id&&h.splice(t,1)}}),l},onContentReady:function(e,t,n,r,i){return d.onAvailable(e,t,n,r,!0,i)},attach:function(t,n,r,i){return d._attach(e.Array(arguments,0,!0))},_createWrapper:function(t,n,r,o,u){var a,f=e.stamp(t),l="event:"+f+n;return!1===u&&(l+="native"),r&&(l+="capture"),a=v[l],a||(a=e.publish(l,{silent:!0,bubbles:!1,contextFn:function(){return o?a.el:(a.nodeRef=a.nodeRef||e.one(a.el),a.nodeRef)}}),a.overrides={},a.el=t,a.key=l,a.domkey=f,a.type=n,a.fn=function(e){a.fire(d.getEvent(e,t,o||!1===u))},a.capture=r,t==i&&n=="load"&&(a.fireOnce=!0,m=l),a._delete=p,v[l]=a,g[f]=g[f]||{},g[f][l]=a,s(t,n,a.fn,r)),a},_attach:function(n,r){var s,o,u,a,f,h=!1,p,v=n[0],m=n[1],g=n[2]||i,y=r&&r.facade,b=r&&r.capture,w=r&&r.overrides;n[n.length-1]===l&&(s=!0);if(!m||!m.call)return!1;if(c(g))return o=[],e.each(g,function(e,t){n[2]=e,o.push(d._attach(n.slice(),r))}),new e.EventHandle(o);if(e.Lang.isString(g)){if(s)u=t.byId(g);else{u=e.Selector.query(g);switch(u.length){case 0:u=null;break;case 1:u=u[0];break;default:return n[2]=u,d._attach(n,r)}}if(!u)return p=d.onAvailable(g,function(){p.handle=d._attach(n,r)},d,!0,!1,s),p;g=u}return g?(e.Node&&e.instanceOf(g,e.Node)&&(g=e.Node.getDOMNode(g)),a=d._createWrapper(g,v,b,s,y),w&&e.mix(a.overrides,w),g==i&&v=="load"&&YUI.Env.windowLoaded&&(h=!0),s&&n.pop(),f=n[3],p=a._on(m,f,n.length>4?n.slice(4):null),h&&a.fire(),p):!1},detach:function(n,r,i,s){var o=e.Array(arguments,0,!0),u,a,f,h,p,m;o[o.length-1]===l&&(u=!0);if(n&&n.detach)return n.detach();typeof i=="string"&&(u?i=t.byId(i):(i=e.Selector.query(i),a=i.length,a<1?i=null:a==1&&(i=i[0])));if(!i)return!1;if(i.detach)return o.splice(2,1),i.detach.apply(i,o);if(c(i)){f=!0;for(h=0,a=i.length;h<a;++h)o[2]=i[h],f=e.Event.detach.apply(e.Event,o)&&f;return f}return!n||!r||!r.call?d.purgeElement(i,!1,n):(p="event:"+e.stamp(i)+n,m=v[p],m?m.detach(r):!1)},getEvent:function(t,n,r){var s=t||i.event;return r?s:new e.DOMEventFacade(s,n,v["event:"+e.stamp(n)+t.type])},generateId:function(e){return t.generateID(e)},_isValidCollection:c,_load:function(t){r||(r=!0,e.fire&&e.fire(f),d._poll())},_poll:function(){if(d.locked)return;if(e.UA.ie&&!YUI.Env.DOMReady){d.startInterval();return}d.locked=!0;var n,i,s,o,a,f,l=!r;l||(l=u>0),a=[],f=function(t,n){var r,i=n.override;try{n.compat?(n.override?i===!0?r=n.obj:r=i:r=t,n.fn.call(r,n.obj)):(r=n.obj||e.one(t),n.fn.apply(r,e.Lang.isArray(i)?i:[]))}catch(s){}};for(n=0,i=h.length;n<i;++n)s=h[n],s&&!s.checkReady&&(o=s.compat?t.byId(s.id):e.Selector.query(s.id,null,!0),o?(f(o,s),h[n]=null):a.push(s));for(n=0,i=h.length;n<i;++n){s=h[n];if(s&&s.checkReady){o=s.compat?t.byId(s.id):e.Selector.query(s.id,null,!0);if(o){if(r||o.get&&o.get("nextSibling")||o.nextSibling)f(o,s),h[n]=null}else a.push(s)}}u=a.length===0?0:u-1,l?d.startInterval():(clearInterval(d._interval),d._interval=null),d.locked=!1;return},purgeElement:function(t,n,r){var i=e.Lang.isString(t)?e.Selector.query(t,null,!0):t,s=d.getListeners(i,r),o,u,a,f;if(n&&i){s=s||[],a=e.Selector.query("*",i),u=a.length;for(o=0;o<u;++o)f=d.getListeners(a[o],r),f&&(s=s.concat(f))}if(s)for(o=0,u=s.length;o<u;++o)s[o].detachAll()},_clean:function(t){var n=t.key,r=t.domkey;o(t.el,t.type,t.fn,t.capture),delete v[n],delete e._yuievt.events[n],g[r]&&(delete g[r][n],e.Object.size(g[r])||delete g[r])},getListeners:function(t,r){var i=e.stamp(t,!0),s=g[i],o=[],u=r?"event:"+i+r:null,a=n.plugins;return s?(u?(a[r]&&a[r].eventDef&&(u+="_synth"),s[u]&&o.push(s[u]),u+="native",s[u]&&o.push(s[u])):e.each(s,function(e,t){o.push(e)}),o.length?o:null):null},_unload:function(t){e.each(v,function(e,n){e.type=="unload"&&e.fire(t),e.detachAll()}),o(i,"unload",a)},nativeAdd:s,nativeRemove:o}}();e.Event=d,r.injected||YUI.Env.windowLoaded?u():s(i,"load",u),e.UA.ie&&e.on(f,d._poll);try{s(i,"unload",a)}catch(v){}d.Custom=e.CustomEvent,d.Subscriber=e.Subscriber,d.Target=e.EventTarget,d.Handle=e.EventHandle,d.Facade=e.EventFacade,d._poll()}(),e.Env.evt.plugins.available={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onAvailable.call(e.Event,r,n,i,s)}},e.Env.evt.plugins.contentready={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onContentReady.call(e.Event,r,n,i,s)}}},"3.7.3",{requires:["event-custom-base"]});
bundle/event-base/event-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -403,7 +403,8 @@ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; -var _eventenv = Y.Env.evt,+var YDOM = Y.DOM,+ _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add,@@ -425,12 +426,11 @@ shouldIterate = function(o) { try {- return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) &&- !o.tagName && !o.alert);+ // TODO: See if there's a more performant way to return true early on this, for the common case+ return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o)); } catch(ex) { return false; }- }, // aliases to support DOM event subscription clean up when the last@@ -794,7 +794,7 @@ // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) {- oEl = Y.DOM.byId(el);+ oEl = YDOM.byId(el); } else { oEl = Y.Selector.query(el);@@ -908,7 +908,7 @@ // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) {- el = Y.DOM.byId(el);+ el = YDOM.byId(el); } else { el = Y.Selector.query(el); l = el.length;@@ -982,7 +982,7 @@ * @static */ generateId: function(el) {- return Y.DOM.generateID(el);+ return YDOM.generateID(el); }, /**@@ -1089,7 +1089,7 @@ if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { executeItem(el, item);@@ -1106,7 +1106,7 @@ if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready@@ -1157,9 +1157,8 @@ if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl);- i = 0; len = children.length;- for (; i < len; ++i) {+ for (i = 0; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child);@@ -1317,7 +1316,7 @@ Event._poll(); -})();+}()); /** * DOM event listener abstraction layer@@ -1372,4 +1371,4 @@ }; -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-contextmenu/event-contextmenu.js", code: [] };-_yuitest_coverage["build/event-contextmenu/event-contextmenu.js"].code=["YUI.add('event-contextmenu', function (Y, NAME) {","","/**"," * Provides extended keyboard support for the \"contextmenu\" event such that:"," * <ul>"," * <li>The browser's default context menu is suppressed regardless of how the event is triggered.</li>"," * <li>On Windows the \"contextmenu\" event is fired consistently regardless of whether the user pressed the Menu key or Shift + F10.</li>"," * <li>When the \"contextmenu\" event is fired via the keyboard, the pageX, pageY, clientX and clientY properties reference the center of the event target. This makes it easy for \"contextmenu\" event listeners to position an overlay in response to the event by not having to worry about special handling of the x and y coordinates based on the device that fired the event.</li>"," * <li>For Webkit and Gecko on the Mac it enables the use of the Shift + Control + Option + M keyboard shortcut to fire the \"contextmenu\" event, which (by default) is only available when VoiceOver (the screen reader on the Mac) is enabled.</li>"," * <li>For Opera on the Mac it ensures the \"contextmenu\" event is fired when the user presses Shift + Command + M (Opera's context menu keyboard shortcut).</li>"," * </ul>"," * @module event-contextmenu"," * @requires event"," */","","var Event = Y.Event,"," DOM = Y.DOM,"," UA = Y.UA,"," OS = Y.UA.os,",""," ie = UA.ie,"," gecko = UA.gecko,"," webkit = UA.webkit,"," opera = UA.opera,",""," isWin = (OS === \"windows\"),"," isMac = (OS === \"macintosh\"),",""," eventData = {},",""," conf = {",""," on: function (node, subscription, notifier, filter) {",""," var handles = [];",""," handles.push(Event._attach([\"contextmenu\", function (e) {",""," // Any developer listening for the \"contextmenu\" event is likely"," // going to call preventDefault() to prevent the display of "," // the browser's context menu. So, you know, save them a step."," e.preventDefault();",""," var id = Y.stamp(node),"," data = eventData[id];",""," if (data) {"," e.clientX = data.clientX;"," e.clientY = data.clientY;"," e.pageX = data.pageX;"," e.pageY = data.pageY;"," delete eventData[id];"," }",""," notifier.fire(e);",""," }, node]));","",""," handles.push(node[filter ? \"delegate\" : \"on\"](\"keydown\", function (e) {",""," var target = this.getDOMNode(),"," shiftKey = e.shiftKey,"," keyCode = e.keyCode,"," shiftF10 = (shiftKey && keyCode == 121),"," menuKey = (isWin && keyCode == 93),"," ctrlKey = e.ctrlKey,"," mKey = (keyCode === 77),"," macWebkitAndGeckoShortcut = (isMac && (webkit || gecko) && ctrlKey && shiftKey && e.altKey && mKey),",""," // Note: The context menu keyboard shortcut for Opera on the Mac is Shift + Cmd (metaKey) + M,"," // but e.metaKey is false for Opera, and Opera sets e.ctrlKey to true instead."," macOperaShortcut = (isMac && opera && ctrlKey && shiftKey && mKey),",""," clientX = 0,"," clientY = 0,"," scrollX,"," scrollY,"," pageX,"," pageY,"," xy,"," x,"," y;","",""," if ((isWin && (shiftF10 || menuKey)) ||"," (macWebkitAndGeckoShortcut || macOperaShortcut)) {",""," // Need to call preventDefault() here b/c:"," // 1) To prevent IE's menubar from gaining focus when the"," // user presses Shift + F10"," // 2) In Firefox and Opera for Win, Shift + F10 will display a"," // context menu, but won't fire the \"contextmenu\" event. So, need"," // to call preventDefault() to prevent the display of the"," // browser's context menu"," // 3) For Opera on the Mac the context menu keyboard shortcut"," // (Shift + Cmd + M) will display a context menu, but like Firefox"," // and Opera on windows, Opera doesn't fire a \"contextmenu\" event,"," // so preventDefault() is just used to supress Opera's"," // default context menu."," if (((ie || (isWin && (gecko || opera))) && shiftF10) || macOperaShortcut) {"," e.preventDefault();"," }",""," xy = DOM.getXY(target);"," x = xy[0];"," y = xy[1];"," scrollX = DOM.docScrollX();"," scrollY = DOM.docScrollY();",""," // Protect against instances where xy and might not be returned,"," // for example if the target is the document."," if (!Y.Lang.isUndefined(x)) {"," clientX = (x + (target.offsetWidth/2)) - scrollX;"," clientY = (y + (target.offsetHeight/2)) - scrollY;"," }",""," pageX = clientX + scrollX;"," pageY = clientY + scrollY;",""," // When the \"contextmenu\" event is fired from the keyboard"," // clientX, clientY, pageX or pageY aren't set to useful"," // values. So, we follow Safari's model here of setting"," // the x & x coords to the center of the event target.",""," if (menuKey || (isWin && webkit && shiftF10)) {"," eventData[Y.stamp(node)] = { "," clientX: clientX,"," clientY: clientY,"," pageX: pageX,"," pageY: pageY"," };"," }",""," // Don't need to call notifier.fire(e) when the Menu key"," // is pressed as it fires the \"contextmenu\" event by default."," //"," // In IE the call to preventDefault() for Shift + F10"," // prevents the \"contextmenu\" event from firing, so we need"," // to call notifier.fire(e)"," //"," // Need to also call notifier.fire(e) for Gecko and Opera since"," // neither Shift + F10 or Shift + Cmd + M fire the \"contextmenu\" event."," //"," // Lastly, also need to call notifier.fire(e) for all Mac browsers"," // since neither Shift + Ctrl + Option + M (Webkit and Gecko) or"," // Shift + Command + M (Opera) fire the \"contextmenu\" event.",""," if (((ie || (isWin && (gecko || opera))) && shiftF10) || isMac) {",""," e.clientX = clientX;"," e.clientY = clientY;"," e.pageX = pageX;"," e.pageY = pageY;",""," notifier.fire(e);"," }",""," }",""," }, filter));",""," subscription._handles = handles;",""," },",""," detach: function (node, subscription, notifier) {",""," Y.each(subscription._handles, function (handle) {"," handle.detach();"," });",""," }",""," };","","","conf.delegate = conf.on;","conf.detachDelegate = conf.detach;","","","Event.define(\"contextmenu\", conf, true);","","","}, '3.7.2', {\"requires\": [\"event-synthetic\", \"dom-screen\"]});"];+_yuitest_coverage["build/event-contextmenu/event-contextmenu.js"].code=["YUI.add('event-contextmenu', function (Y, NAME) {","","/**"," * Provides extended keyboard support for the \"contextmenu\" event such that:"," * <ul>"," * <li>The browser's default context menu is suppressed regardless of how the event is triggered.</li>"," * <li>On Windows the \"contextmenu\" event is fired consistently regardless of whether the user pressed the Menu key or Shift + F10.</li>"," * <li>When the \"contextmenu\" event is fired via the keyboard, the pageX, pageY, clientX and clientY properties reference the center of the event target. This makes it easy for \"contextmenu\" event listeners to position an overlay in response to the event by not having to worry about special handling of the x and y coordinates based on the device that fired the event.</li>"," * <li>For Webkit and Gecko on the Mac it enables the use of the Shift + Control + Option + M keyboard shortcut to fire the \"contextmenu\" event, which (by default) is only available when VoiceOver (the screen reader on the Mac) is enabled.</li>"," * <li>For Opera on the Mac it ensures the \"contextmenu\" event is fired when the user presses Shift + Command + M (Opera's context menu keyboard shortcut).</li>"," * </ul>"," * @module event-contextmenu"," * @requires event"," */","","var Event = Y.Event,"," DOM = Y.DOM,"," UA = Y.UA,"," OS = Y.UA.os,",""," ie = UA.ie,"," gecko = UA.gecko,"," webkit = UA.webkit,"," opera = UA.opera,",""," isWin = (OS === \"windows\"),"," isMac = (OS === \"macintosh\"),",""," eventData = {},",""," conf = {",""," on: function (node, subscription, notifier, filter) {",""," var handles = [];",""," handles.push(Event._attach([\"contextmenu\", function (e) {",""," // Any developer listening for the \"contextmenu\" event is likely"," // going to call preventDefault() to prevent the display of "," // the browser's context menu. So, you know, save them a step."," e.preventDefault();",""," var id = Y.stamp(node),"," data = eventData[id];",""," if (data) {"," e.clientX = data.clientX;"," e.clientY = data.clientY;"," e.pageX = data.pageX;"," e.pageY = data.pageY;"," delete eventData[id];"," }",""," notifier.fire(e);",""," }, node]));","",""," handles.push(node[filter ? \"delegate\" : \"on\"](\"keydown\", function (e) {",""," var target = this.getDOMNode(),"," shiftKey = e.shiftKey,"," keyCode = e.keyCode,"," shiftF10 = (shiftKey && keyCode == 121),"," menuKey = (isWin && keyCode == 93),"," ctrlKey = e.ctrlKey,"," mKey = (keyCode === 77),"," macWebkitAndGeckoShortcut = (isMac && (webkit || gecko) && ctrlKey && shiftKey && e.altKey && mKey),",""," // Note: The context menu keyboard shortcut for Opera on the Mac is Shift + Cmd (metaKey) + M,"," // but e.metaKey is false for Opera, and Opera sets e.ctrlKey to true instead."," macOperaShortcut = (isMac && opera && ctrlKey && shiftKey && mKey),",""," clientX = 0,"," clientY = 0,"," scrollX,"," scrollY,"," pageX,"," pageY,"," xy,"," x,"," y;","",""," if ((isWin && (shiftF10 || menuKey)) ||"," (macWebkitAndGeckoShortcut || macOperaShortcut)) {",""," // Need to call preventDefault() here b/c:"," // 1) To prevent IE's menubar from gaining focus when the"," // user presses Shift + F10"," // 2) In Firefox and Opera for Win, Shift + F10 will display a"," // context menu, but won't fire the \"contextmenu\" event. So, need"," // to call preventDefault() to prevent the display of the"," // browser's context menu"," // 3) For Opera on the Mac the context menu keyboard shortcut"," // (Shift + Cmd + M) will display a context menu, but like Firefox"," // and Opera on windows, Opera doesn't fire a \"contextmenu\" event,"," // so preventDefault() is just used to supress Opera's"," // default context menu."," if (((ie || (isWin && (gecko || opera))) && shiftF10) || macOperaShortcut) {"," e.preventDefault();"," }",""," xy = DOM.getXY(target);"," x = xy[0];"," y = xy[1];"," scrollX = DOM.docScrollX();"," scrollY = DOM.docScrollY();",""," // Protect against instances where xy and might not be returned,"," // for example if the target is the document."," if (!Y.Lang.isUndefined(x)) {"," clientX = (x + (target.offsetWidth/2)) - scrollX;"," clientY = (y + (target.offsetHeight/2)) - scrollY;"," }",""," pageX = clientX + scrollX;"," pageY = clientY + scrollY;",""," // When the \"contextmenu\" event is fired from the keyboard"," // clientX, clientY, pageX or pageY aren't set to useful"," // values. So, we follow Safari's model here of setting"," // the x & x coords to the center of the event target.",""," if (menuKey || (isWin && webkit && shiftF10)) {"," eventData[Y.stamp(node)] = { "," clientX: clientX,"," clientY: clientY,"," pageX: pageX,"," pageY: pageY"," };"," }",""," // Don't need to call notifier.fire(e) when the Menu key"," // is pressed as it fires the \"contextmenu\" event by default."," //"," // In IE the call to preventDefault() for Shift + F10"," // prevents the \"contextmenu\" event from firing, so we need"," // to call notifier.fire(e)"," //"," // Need to also call notifier.fire(e) for Gecko and Opera since"," // neither Shift + F10 or Shift + Cmd + M fire the \"contextmenu\" event."," //"," // Lastly, also need to call notifier.fire(e) for all Mac browsers"," // since neither Shift + Ctrl + Option + M (Webkit and Gecko) or"," // Shift + Command + M (Opera) fire the \"contextmenu\" event.",""," if (((ie || (isWin && (gecko || opera))) && shiftF10) || isMac) {",""," e.clientX = clientX;"," e.clientY = clientY;"," e.pageX = pageX;"," e.pageY = pageY;",""," notifier.fire(e);"," }",""," }",""," }, filter));",""," subscription._handles = handles;",""," },",""," detach: function (node, subscription, notifier) {",""," Y.each(subscription._handles, function (handle) {"," handle.detach();"," });",""," }",""," };","","","conf.delegate = conf.on;","conf.detachDelegate = conf.detach;","","","Event.define(\"contextmenu\", conf, true);","","","}, '3.7.3', {\"requires\": [\"event-synthetic\", \"dom-screen\"]});"]; _yuitest_coverage["build/event-contextmenu/event-contextmenu.js"].lines = {"1":0,"16":0,"35":0,"37":0,"42":0,"44":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"55":0,"60":0,"62":0,"86":0,"101":0,"102":0,"105":0,"106":0,"107":0,"108":0,"109":0,"113":0,"114":0,"115":0,"118":0,"119":0,"126":0,"127":0,"149":0,"151":0,"152":0,"153":0,"154":0,"156":0,"163":0,"169":0,"170":0,"178":0,"179":0,"182":0}; _yuitest_coverage["build/event-contextmenu/event-contextmenu.js"].functions = {"(anonymous 2):37":0,"(anonymous 3):60":0,"on:33":0,"(anonymous 4):169":0,"detach:167":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-contextmenu/event-contextmenu.js"].coveredLines = 42;@@ -269,4 +269,4 @@ Event.define("contextmenu", conf, true); -}, '3.7.2', {"requires": ["event-synthetic", "dom-screen"]});+}, '3.7.3', {"requires": ["event-synthetic", "dom-screen"]});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -188,4 +188,4 @@ Event.define("contextmenu", conf, true); -}, '3.7.2', {"requires": ["event-synthetic", "dom-screen"]});+}, '3.7.3', {"requires": ["event-synthetic", "dom-screen"]});
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-contextmenu",function(e,t){var n=e.Event,r=e.DOM,i=e.UA,s=e.UA.os,o=i.ie,u=i.gecko,a=i.webkit,f=i.opera,l=s==="windows",c=s==="macintosh",h={},p={on:function(t,i,s,p){var d=[];d.push(n._attach(["contextmenu",function(n){n.preventDefault();var r=e.stamp(t),i=h[r];i&&(n.clientX=i.clientX,n.clientY=i.clientY,n.pageX=i.pageX,n.pageY=i.pageY,delete h[r]),s.fire(n)},t])),d.push(t[p?"delegate":"on"]("keydown",function(n){var i=this.getDOMNode(),p=n.shiftKey,d=n.keyCode,v=p&&d==121,m=l&&d==93,g=n.ctrlKey,y=d===77,b=c&&(a||u)&&g&&p&&n.altKey&&y,w=c&&f&&g&&p&&y,E=0,S=0,x,T,N,C,k,L,A;if(l&&(v||m)||b||w){((o||l&&(u||f))&&v||w)&&n.preventDefault(),k=r.getXY(i),L=k[0],A=k[1],x=r.docScrollX(),T=r.docScrollY(),e.Lang.isUndefined(L)||(E=L+i.offsetWidth/2-x,S=A+i.offsetHeight/2-T),N=E+x,C=S+T;if(m||l&&a&&v)h[e.stamp(t)]={clientX:E,clientY:S,pageX:N,pageY:C};if((o||l&&(u||f))&&v||c)n.clientX=E,n.clientY=S,n.pageX=N,n.pageY=C,s.fire(n)}},p)),i._handles=d},detach:function(t,n,r){e.each(n._handles,function(e){e.detach()})}};p.delegate=p.on,p.detachDelegate=p.detach,n.define("contextmenu",p,!0)},"3.7.2",{requires:["event-synthetic","dom-screen"]});+YUI.add("event-contextmenu",function(e,t){var n=e.Event,r=e.DOM,i=e.UA,s=e.UA.os,o=i.ie,u=i.gecko,a=i.webkit,f=i.opera,l=s==="windows",c=s==="macintosh",h={},p={on:function(t,i,s,p){var d=[];d.push(n._attach(["contextmenu",function(n){n.preventDefault();var r=e.stamp(t),i=h[r];i&&(n.clientX=i.clientX,n.clientY=i.clientY,n.pageX=i.pageX,n.pageY=i.pageY,delete h[r]),s.fire(n)},t])),d.push(t[p?"delegate":"on"]("keydown",function(n){var i=this.getDOMNode(),p=n.shiftKey,d=n.keyCode,v=p&&d==121,m=l&&d==93,g=n.ctrlKey,y=d===77,b=c&&(a||u)&&g&&p&&n.altKey&&y,w=c&&f&&g&&p&&y,E=0,S=0,x,T,N,C,k,L,A;if(l&&(v||m)||b||w){((o||l&&(u||f))&&v||w)&&n.preventDefault(),k=r.getXY(i),L=k[0],A=k[1],x=r.docScrollX(),T=r.docScrollY(),e.Lang.isUndefined(L)||(E=L+i.offsetWidth/2-x,S=A+i.offsetHeight/2-T),N=E+x,C=S+T;if(m||l&&a&&v)h[e.stamp(t)]={clientX:E,clientY:S,pageX:N,pageY:C};if((o||l&&(u||f))&&v||c)n.clientX=E,n.clientY=S,n.pageX=N,n.pageY=C,s.fire(n)}},p)),i._handles=d},detach:function(t,n,r){e.each(n._handles,function(e){e.detach()})}};p.delegate=p.on,p.detachDelegate=p.detach,n.define("contextmenu",p,!0)},"3.7.3",{requires:["event-synthetic","dom-screen"]});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -188,4 +188,4 @@ Event.define("contextmenu", conf, true); -}, '3.7.2', {"requires": ["event-synthetic", "dom-screen"]});+}, '3.7.3', {"requires": ["event-synthetic", "dom-screen"]});
bundle/event-custom-base/event-custom-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-custom-base/event-custom-base.js", code: [] };-_yuitest_coverage["build/event-custom-base/event-custom-base.js"].code=["YUI.add('event-custom-base', function (Y, NAME) {","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," */","","Y.Env.evt = {"," handles: {},"," plugins: {}","};","","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","/**"," * Allows for the insertion of methods that are executed before or after"," * a specified method"," * @class Do"," * @static"," */","","var DO_BEFORE = 0,"," DO_AFTER = 1,","","DO = {",""," /**"," * Cache of objects touched by the utility"," * @property objs"," * @static"," * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object "," * replaces the role of this property, but is considered to be private, and "," * is only mentioned to provide a migration path."," * "," * If you have a use case which warrants migration to the _yuiaop property, "," * please file a ticket to let us know what it's used for and we can see if "," * we need to expose hooks for that functionality more formally."," */"," objs: null,",""," /**"," * <p>Execute the supplied method before the specified function. Wrapping"," * function may optionally return an instance of the following classes to"," * further alter runtime behavior:</p>"," * <dl>"," * <dt></code>Y.Do.Halt(message, returnValue)</code></dt>"," * <dd>Immediatly stop execution and return"," * <code>returnValue</code>. No other wrapping functions will be"," * executed.</dd>"," * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt>"," * <dd>Replace the arguments that the original function will be"," * called with.</dd>"," * <dt></code>Y.Do.Prevent(message)</code></dt>"," * <dd>Don't execute the wrapped function. Other before phase"," * wrappers will be executed.</dd>"," * </dl>"," *"," * @method before"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @param arg* {mixed} 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {string} handle for the subscription"," * @static"," */"," before: function(fn, obj, sFn, c) {"," var f = fn, a;"," if (c) {"," a = [fn, c].concat(Y.Array(arguments, 4, true));"," f = Y.rbind.apply(Y, a);"," }",""," return this._inject(DO_BEFORE, f, obj, sFn);"," },",""," /**"," * <p>Execute the supplied method after the specified function. Wrapping"," * function may optionally return an instance of the following classes to"," * further alter runtime behavior:</p>"," * <dl>"," * <dt></code>Y.Do.Halt(message, returnValue)</code></dt>"," * <dd>Immediatly stop execution and return"," * <code>returnValue</code>. No other wrapping functions will be"," * executed.</dd>"," * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt>"," * <dd>Return <code>returnValue</code> instead of the wrapped"," * method's original return value. This can be further altered by"," * other after phase wrappers.</dd>"," * </dl>"," *"," * <p>The static properties <code>Y.Do.originalRetVal</code> and"," * <code>Y.Do.currentRetVal</code> will be populated for reference.</p>"," *"," * @method after"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @param arg* {mixed} 0..n additional arguments to supply to the subscriber"," * @return {string} handle for the subscription"," * @static"," */"," after: function(fn, obj, sFn, c) {"," var f = fn, a;"," if (c) {"," a = [fn, c].concat(Y.Array(arguments, 4, true));"," f = Y.rbind.apply(Y, a);"," }",""," return this._inject(DO_AFTER, f, obj, sFn);"," },",""," /**"," * Execute the supplied method before or after the specified function."," * Used by <code>before</code> and <code>after</code>."," *"," * @method _inject"," * @param when {string} before or after"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @return {string} handle for the subscription"," * @private"," * @static"," */"," _inject: function(when, fn, obj, sFn) {"," // object id"," var id = Y.stamp(obj), o, sid;",""," if (!obj._yuiaop) {"," // create a map entry for the obj if it doesn't exist, to hold overridden methods"," obj._yuiaop = {};"," }",""," o = obj._yuiaop;",""," if (!o[sFn]) {"," // create a map entry for the method if it doesn't exist"," o[sFn] = new Y.Do.Method(obj, sFn);",""," // re-route the method to our wrapper"," obj[sFn] = function() {"," return o[sFn].exec.apply(o[sFn], arguments);"," };"," }",""," // subscriber id"," sid = id + Y.stamp(fn) + sFn;",""," // register the callback"," o[sFn].register(sid, fn, when);",""," return new Y.EventHandle(o[sFn], sid);"," },",""," /**"," * Detach a before or after subscription."," *"," * @method detach"," * @param handle {string} the subscription handle"," * @static"," */"," detach: function(handle) {"," if (handle.detach) {"," handle.detach();"," }"," },",""," _unload: function(e, me) {"," }","};","","Y.Do = DO;","","//////////////////////////////////////////////////////////////////////////","","/**"," * Contains the return value from the wrapped method, accessible"," * by 'after' event listeners."," *"," * @property originalRetVal"," * @static"," * @since 3.2.0"," */","","/**"," * Contains the current state of the return value, consumable by"," * 'after' event listeners, and updated if an after subscriber"," * changes the return value generated by the wrapped function."," *"," * @property currentRetVal"," * @static"," * @since 3.2.0"," */","","//////////////////////////////////////////////////////////////////////////","","/**"," * Wrapper for a displaced method with aop enabled"," * @class Do.Method"," * @constructor"," * @param obj The object to operate on"," * @param sFn The name of the method to displace"," */","DO.Method = function(obj, sFn) {"," this.obj = obj;"," this.methodName = sFn;"," this.method = obj[sFn];"," this.before = {};"," this.after = {};","};","","/**"," * Register a aop subscriber"," * @method register"," * @param sid {string} the subscriber id"," * @param fn {Function} the function to execute"," * @param when {string} when to execute the function"," */","DO.Method.prototype.register = function (sid, fn, when) {"," if (when) {"," this.after[sid] = fn;"," } else {"," this.before[sid] = fn;"," }","};","","/**"," * Unregister a aop subscriber"," * @method delete"," * @param sid {string} the subscriber id"," * @param fn {Function} the function to execute"," * @param when {string} when to execute the function"," */","DO.Method.prototype._delete = function (sid) {"," delete this.before[sid];"," delete this.after[sid];","};","","/**"," * <p>Execute the wrapped method. All arguments are passed into the wrapping"," * functions. If any of the before wrappers return an instance of"," * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped"," * function nor any after phase subscribers will be executed.</p>"," *"," * <p>The return value will be the return value of the wrapped function or one"," * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or"," * <code>Y.Do.AlterReturn</code>."," *"," * @method exec"," * @param arg* {any} Arguments are passed to the wrapping and wrapped functions"," * @return {any} Return value of wrapped function unless overwritten (see above)"," */","DO.Method.prototype.exec = function () {",""," var args = Y.Array(arguments, 0, true),"," i, ret, newRet,"," bf = this.before,"," af = this.after,"," prevented = false;",""," // execute before"," for (i in bf) {"," if (bf.hasOwnProperty(i)) {"," ret = bf[i].apply(this.obj, args);"," if (ret) {"," switch (ret.constructor) {"," case DO.Halt:"," return ret.retVal;"," case DO.AlterArgs:"," args = ret.newArgs;"," break;"," case DO.Prevent:"," prevented = true;"," break;"," default:"," }"," }"," }"," }",""," // execute method"," if (!prevented) {"," ret = this.method.apply(this.obj, args);"," }",""," DO.originalRetVal = ret;"," DO.currentRetVal = ret;",""," // execute after methods."," for (i in af) {"," if (af.hasOwnProperty(i)) {"," newRet = af[i].apply(this.obj, args);"," // Stop processing if a Halt object is returned"," if (newRet && newRet.constructor == DO.Halt) {"," return newRet.retVal;"," // Check for a new return value"," } else if (newRet && newRet.constructor == DO.AlterReturn) {"," ret = newRet.newRetVal;"," // Update the static retval state"," DO.currentRetVal = ret;"," }"," }"," }",""," return ret;","};","","//////////////////////////////////////////////////////////////////////////","","/**"," * Return an AlterArgs object when you want to change the arguments that"," * were passed into the function. Useful for Do.before subscribers. An"," * example would be a service that scrubs out illegal characters prior to"," * executing the core business logic."," * @class Do.AlterArgs"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param newArgs {Array} Call parameters to be used for the original method"," * instead of the arguments originally passed in."," */","DO.AlterArgs = function(msg, newArgs) {"," this.msg = msg;"," this.newArgs = newArgs;","};","","/**"," * Return an AlterReturn object when you want to change the result returned"," * from the core method to the caller. Useful for Do.after subscribers."," * @class Do.AlterReturn"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param newRetVal {any} Return value passed to code that invoked the wrapped"," * function."," */","DO.AlterReturn = function(msg, newRetVal) {"," this.msg = msg;"," this.newRetVal = newRetVal;","};","","/**"," * Return a Halt object when you want to terminate the execution"," * of all subsequent subscribers as well as the wrapped method"," * if it has not exectued yet. Useful for Do.before subscribers."," * @class Do.Halt"," * @constructor"," * @param msg {String} (optional) Explanation of why the termination was done"," * @param retVal {any} Return value passed to code that invoked the wrapped"," * function."," */","DO.Halt = function(msg, retVal) {"," this.msg = msg;"," this.retVal = retVal;","};","","/**"," * Return a Prevent object when you want to prevent the wrapped function"," * from executing, but want the remaining listeners to execute. Useful"," * for Do.before subscribers."," * @class Do.Prevent"," * @constructor"," * @param msg {String} (optional) Explanation of why the termination was done"," */","DO.Prevent = function(msg) {"," this.msg = msg;","};","","/**"," * Return an Error object when you want to terminate the execution"," * of all subsequent method calls."," * @class Do.Error"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param retVal {any} Return value passed to code that invoked the wrapped"," * function."," * @deprecated use Y.Do.Halt or Y.Do.Prevent"," */","DO.Error = DO.Halt;","","","//////////////////////////////////////////////////////////////////////////","","// Y[\"Event\"] && Y.Event.addListener(window, \"unload\", Y.Do._unload, Y.Do);","","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","","// var onsubscribeType = \"_event:onsub\",","var YArray = Y.Array,",""," AFTER = 'after',"," CONFIGS = ["," 'broadcast',"," 'monitored',"," 'bubbles',"," 'context',"," 'contextFn',"," 'currentTarget',"," 'defaultFn',"," 'defaultTargetOnly',"," 'details',"," 'emitFacade',"," 'fireOnce',"," 'async',"," 'host',"," 'preventable',"," 'preventedFn',"," 'queuable',"," 'silent',"," 'stoppedFn',"," 'target',"," 'type'"," ],",""," CONFIGS_HASH = YArray.hash(CONFIGS),",""," nativeSlice = Array.prototype.slice, ",""," YUI3_SIGNATURE = 9,"," YUI_LOG = 'yui:log',",""," mixConfigs = function(r, s, ov) {"," var p;",""," for (p in s) {"," if (CONFIGS_HASH[p] && (ov || !(p in r))) { "," r[p] = s[p];"," }"," }",""," return r;"," };","","/**"," * 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} o configuration object."," * @class CustomEvent"," * @constructor"," */","Y.CustomEvent = function(type, o) {",""," this._kds = Y.CustomEvent.keepDeprecatedSubs;",""," o = o || {};",""," this.id = Y.stamp(this);",""," /**"," * The type of event, returned to subscribers when the event fires"," * @property type"," * @type string"," */"," this.type = type;",""," /**"," * The context the the event will fire from by default. Defaults to the YUI"," * instance."," * @property context"," * @type object"," */"," this.context = Y;",""," /**"," * Monitor when an event is attached or detached."," *"," * @property monitored"," * @type boolean"," */"," // this.monitored = false;",""," this.logSystem = (type == YUI_LOG);",""," /**"," * If 0, this event does not broadcast. If 1, the YUI instance is notified"," * every time this event fires. If 2, the YUI instance and the YUI global"," * (if event is enabled on the global) are notified every time this event"," * fires."," * @property broadcast"," * @type int"," */"," // this.broadcast = 0;",""," /**"," * By default all custom events are logged in the debug build, set silent"," * to true to disable debug outpu for this event."," * @property silent"," * @type boolean"," */"," this.silent = this.logSystem;",""," /**"," * Specifies whether this event should be queued when the host is actively"," * processing an event. This will effect exectution order of the callbacks"," * for the various events."," * @property queuable"," * @type boolean"," * @default false"," */"," // this.queuable = false;",""," /**"," * The subscribers to this event"," * @property subscribers"," * @type Subscriber {}"," * @deprecated"," */"," if (this._kds) {"," this.subscribers = {};"," }",""," /**"," * The subscribers to this event"," * @property _subscribers"," * @type Subscriber []"," * @private"," */"," this._subscribers = [];",""," /**"," * 'After' subscribers"," * @property afters"," * @type Subscriber {}"," */"," if (this._kds) {"," this.afters = {};"," }",""," /**"," * 'After' subscribers"," * @property _afters"," * @type Subscriber []"," * @private"," */"," this._afters = [];",""," /**"," * This event has fired if true"," *"," * @property fired"," * @type boolean"," * @default false;"," */"," // this.fired = false;",""," /**"," * An array containing the arguments the custom event"," * was last fired with."," * @property firedWith"," * @type Array"," */"," // this.firedWith;",""," /**"," * This event should only fire one time if true, and if"," * it has fired, any new subscribers should be notified"," * immediately."," *"," * @property fireOnce"," * @type boolean"," * @default false;"," */"," // this.fireOnce = false;",""," /**"," * fireOnce listeners will fire syncronously unless async"," * is set to true"," * @property async"," * @type boolean"," * @default false"," */"," //this.async = false;",""," /**"," * Flag for stopPropagation that is modified during fire()"," * 1 means to stop propagation to bubble targets. 2 means"," * to also stop additional subscribers on this target."," * @property stopped"," * @type int"," */"," // this.stopped = 0;",""," /**"," * Flag for preventDefault that is modified during fire()."," * if it is not 0, the default behavior for this event"," * @property prevented"," * @type int"," */"," // this.prevented = 0;",""," /**"," * Specifies the host for this custom event. This is used"," * to enable event bubbling"," * @property host"," * @type EventTarget"," */"," // this.host = null;",""," /**"," * The default function to execute after event listeners"," * have fire, but only if the default action was not"," * prevented."," * @property defaultFn"," * @type Function"," */"," // this.defaultFn = null;",""," /**"," * The function to execute if a subscriber calls"," * stopPropagation or stopImmediatePropagation"," * @property stoppedFn"," * @type Function"," */"," // this.stoppedFn = null;",""," /**"," * The function to execute if a subscriber calls"," * preventDefault"," * @property preventedFn"," * @type Function"," */"," // this.preventedFn = null;",""," /**"," * Specifies whether or not this event's default function"," * can be cancelled by a subscriber by executing preventDefault()"," * on the event facade"," * @property preventable"," * @type boolean"," * @default true"," */"," this.preventable = true;",""," /**"," * Specifies whether or not a subscriber can stop the event propagation"," * via stopPropagation(), stopImmediatePropagation(), or halt()"," *"," * Events can only bubble if emitFacade is true."," *"," * @property bubbles"," * @type boolean"," * @default true"," */"," this.bubbles = true;",""," /**"," * Supports multiple options for listener signatures in order to"," * port YUI 2 apps."," * @property signature"," * @type int"," * @default 9"," */"," this.signature = YUI3_SIGNATURE;",""," // this.subCount = 0;"," // this.afterCount = 0;",""," // this.hasSubscribers = false;"," // this.hasAfters = false;",""," /**"," * If set to true, the custom event will deliver an EventFacade object"," * that is similar to a DOM event object."," * @property emitFacade"," * @type boolean"," * @default false"," */"," // this.emitFacade = false;",""," this.applyConfig(o, true);","","","};","","/**"," * Static flag to enable population of the <a href=\"#property_subscribers\">`subscribers`</a>"," * and <a href=\"#property_subscribers\">`afters`</a> properties held on a `CustomEvent` instance."," * "," * These properties were changed to private properties (`_subscribers` and `_afters`), and "," * converted from objects to arrays for performance reasons. "," *"," * Setting this property to true will populate the deprecated `subscribers` and `afters` "," * properties for people who may be using them (which is expected to be rare). There will"," * be a performance hit, compared to the new array based implementation."," *"," * If you are using these deprecated properties for a use case which the public API"," * does not support, please file an enhancement request, and we can provide an alternate "," * public implementation which doesn't have the performance cost required to maintiain the"," * properties as objects."," *"," * @property keepDeprecatedSubs"," * @static"," * @for CustomEvent"," * @type boolean"," * @default false"," * @deprecated"," */","Y.CustomEvent.keepDeprecatedSubs = false;","","Y.CustomEvent.mixConfigs = mixConfigs;","","Y.CustomEvent.prototype = {",""," constructor: Y.CustomEvent,",""," /**"," * Returns the number of subscribers for this event as the sum of the on()"," * subscribers and after() subscribers."," *"," * @method hasSubs"," * @return Number"," */"," hasSubs: function(when) {"," var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;",""," if (sib) {"," s += sib._subscribers.length;"," a += sib._afters.length;"," }",""," if (when) {"," return (when == 'after') ? a : s;"," }",""," return (s + a);"," },",""," /**"," * Monitor the event state for the subscribed event. The first parameter"," * is what should be monitored, the rest are the normal parameters when"," * subscribing to an event."," * @method monitor"," * @param what {string} what to monitor ('detach', 'attach', 'publish')."," * @return {EventHandle} return value from the monitor event subscription."," */"," monitor: function(what) {"," this.monitored = true;"," var type = this.id + '|' + this.type + '_' + what,"," args = nativeSlice.call(arguments, 0);"," args[0] = type;"," return this.host.on.apply(this.host, args);"," },",""," /**"," * Get all of the subscribers to this event and any sibling event"," * @method getSubs"," * @return {Array} first item is the on subscribers, second the after."," */"," getSubs: function() {"," var s = this._subscribers, a = this._afters, sib = this.sibling;",""," s = (sib) ? s.concat(sib._subscribers) : s.concat();"," a = (sib) ? a.concat(sib._afters) : a.concat();",""," return [s, a];"," },",""," /**"," * Apply configuration properties. Only applies the CONFIG whitelist"," * @method applyConfig"," * @param o hash of properties to apply."," * @param force {boolean} if true, properties that exist on the event"," * will be overwritten."," */"," applyConfig: function(o, force) {"," mixConfigs(this, o, force);"," },",""," /**"," * Create the Subscription for subscribing function, context, and bound"," * arguments. If this is a fireOnce event, the subscriber is immediately "," * notified."," *"," * @method _on"," * @param fn {Function} Subscription callback"," * @param [context] {Object} Override `this` in the callback"," * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire()"," * @param [when] {String} \"after\" to slot into after subscribers"," * @return {EventHandle}"," * @protected"," */"," _on: function(fn, context, args, when) {","",""," var s = new Y.Subscriber(fn, context, args, when);",""," if (this.fireOnce && this.fired) {"," if (this.async) {"," setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);"," } else {"," this._notify(s, this.firedWith);"," }"," }",""," if (when == AFTER) {"," this._afters.push(s);"," } else {"," this._subscribers.push(s);"," }",""," if (this._kds) {"," if (when == AFTER) {"," this.afters[s.id] = s;"," } else {"," this.subscribers[s.id] = s;"," }"," }",""," return new Y.EventHandle(this, s);"," },",""," /**"," * Listen for this event"," * @method subscribe"," * @param {Function} fn The function to execute."," * @return {EventHandle} Unsubscribe handle."," * @deprecated use on."," */"," subscribe: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;"," return this._on(fn, context, a, true);"," },"," "," /**"," * Listen for this event"," * @method on"," * @param {Function} fn The function to execute."," * @param {object} context optional execution context."," * @param {mixed} arg* 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {EventHandle} An object with a detach method to detch the handler(s)."," */"," on: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;",""," if (this.monitored && this.host) {"," this.host._monitor('attach', this, {"," args: arguments"," });"," }"," return this._on(fn, context, a, true);"," },",""," /**"," * Listen for this event after the normal subscribers have been notified and"," * the default behavior has been applied. If a normal subscriber prevents the"," * default behavior, it also prevents after listeners from firing."," * @method after"," * @param {Function} fn The function to execute."," * @param {object} context optional execution context."," * @param {mixed} arg* 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {EventHandle} handle Unsubscribe handle."," */"," after: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;"," return this._on(fn, context, a, AFTER);"," },",""," /**"," * Detach listeners."," * @method detach"," * @param {Function} fn The subscribed function to remove, if not supplied"," * all will be removed."," * @param {Object} context The context object passed to subscribe."," * @return {int} returns the number of subscribers unsubscribed."," */"," detach: function(fn, context) {"," // unsubscribe handle"," if (fn && fn.detach) {"," return fn.detach();"," }"," "," var i, s,"," found = 0,"," subs = this._subscribers,"," afters = this._afters;",""," for (i = subs.length; i >= 0; i--) {"," s = subs[i];"," if (s && (!fn || fn === s.fn)) {"," this._delete(s, subs, i);"," found++;"," }"," }",""," for (i = afters.length; i >= 0; i--) {"," s = afters[i];"," if (s && (!fn || fn === s.fn)) {"," this._delete(s, afters, i);"," found++;"," }"," }",""," return found;"," },",""," /**"," * Detach listeners."," * @method unsubscribe"," * @param {Function} fn The subscribed function to remove, if not supplied"," * all will be removed."," * @param {Object} context The context object passed to subscribe."," * @return {int|undefined} returns the number of subscribers unsubscribed."," * @deprecated use detach."," */"," unsubscribe: function() {"," return this.detach.apply(this, arguments);"," },",""," /**"," * Notify a single subscriber"," * @method _notify"," * @param {Subscriber} s the subscriber."," * @param {Array} args the arguments array to apply to the listener."," * @protected"," */"," _notify: function(s, args, ef) {","",""," var ret;",""," ret = s.notify(args, this);",""," if (false === ret || this.stopped > 1) {"," return false;"," }",""," return true;"," },",""," /**"," * Logger abstraction to centralize the application of the silent flag"," * @method log"," * @param {string} msg message to log."," * @param {string} cat log category."," */"," log: function(msg, cat) {"," },",""," /**"," * Notifies the subscribers. The callback functions will be executed"," * from the context specified when the event was created, and with the"," * following parameters:"," * <ul>"," * <li>The type of event</li>"," * <li>All of the arguments fire() was executed with as an array</li>"," * <li>The custom object (if any) that was passed into the subscribe()"," * method</li>"," * </ul>"," * @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() {"," if (this.fireOnce && this.fired) {"," return true;"," } else {",""," var args = nativeSlice.call(arguments, 0);",""," // this doesn't happen if the event isn't published"," // this.host._monitor('fire', this.type, args);",""," this.fired = true;",""," if (this.fireOnce) {"," this.firedWith = args;"," }",""," if (this.emitFacade) {"," return this.fireComplex(args);"," } else {"," return this.fireSimple(args);"," }"," }"," },",""," /**"," * Set up for notifying subscribers of non-emitFacade events."," *"," * @method fireSimple"," * @param args {Array} Arguments passed to fire()"," * @return Boolean false if a subscriber returned false"," * @protected"," */"," fireSimple: function(args) {"," this.stopped = 0;"," this.prevented = 0;"," if (this.hasSubs()) {"," var subs = this.getSubs();"," this._procSubs(subs[0], args);"," this._procSubs(subs[1], args);"," }"," this._broadcast(args);"," return this.stopped ? false : true;"," },",""," // Requires the event-custom-complex module for full funcitonality."," fireComplex: function(args) {"," args[0] = args[0] || {};"," return this.fireSimple(args);"," },",""," /**"," * Notifies a list of subscribers."," *"," * @method _procSubs"," * @param subs {Array} List of subscribers"," * @param args {Array} Arguments passed to fire()"," * @param ef {}"," * @return Boolean false if a subscriber returns false or stops the event"," * propagation via e.stopPropagation(),"," * e.stopImmediatePropagation(), or e.halt()"," * @private"," */"," _procSubs: function(subs, args, ef) {"," var s, i, l;",""," for (i = 0, l = subs.length; i < l; i++) {"," s = subs[i];"," if (s && s.fn) {"," if (false === this._notify(s, args, ef)) {"," this.stopped = 2;"," }"," if (this.stopped == 2) {"," return false;"," }"," }"," }",""," return true;"," },",""," /**"," * Notifies the YUI instance if the event is configured with broadcast = 1,"," * and both the YUI instance and Y.Global if configured with broadcast = 2."," *"," * @method _broadcast"," * @param args {Array} Arguments sent to fire()"," * @private"," */"," _broadcast: function(args) {"," if (!this.stopped && this.broadcast) {",""," var a = args.concat();"," a.unshift(this.type);",""," if (this.host !== Y) {"," Y.fire.apply(Y, a);"," }",""," if (this.broadcast == 2) {"," Y.Global.fire.apply(Y.Global, a);"," }"," }"," },",""," /**"," * Removes all listeners"," * @method unsubscribeAll"," * @return {int} The number of listeners unsubscribed."," * @deprecated use detachAll."," */"," unsubscribeAll: function() {"," return this.detachAll.apply(this, arguments);"," },",""," /**"," * Removes all listeners"," * @method detachAll"," * @return {int} The number of listeners unsubscribed."," */"," detachAll: function() {"," return this.detach();"," },",""," /**"," * Deletes the subscriber from the internal store of on() and after()"," * subscribers."," *"," * @method _delete"," * @param s subscriber object."," * @param subs (optional) on or after subscriber array"," * @param index (optional) The index found."," * @private"," */"," _delete: function(s, subs, i) {"," var when = s._when;",""," if (!subs) {"," subs = (when === AFTER) ? this._afters : this._subscribers; "," i = YArray.indexOf(subs, s, 0);"," }",""," if (s && subs[i] === s) {"," subs.splice(i, 1);"," }",""," if (this._kds) {"," if (when === AFTER) {"," delete this.afters[s.id];"," } else {"," delete this.subscribers[s.id];"," }"," }",""," if (this.monitored && this.host) {"," this.host._monitor('detach', this, {"," ce: this,"," sub: s"," });"," }",""," if (s) {"," s.deleted = true;"," }"," }","};","/**"," * Stores the subscriber information to be used when the event fires."," * @param {Function} fn The wrapped function to execute."," * @param {Object} context The value of the keyword 'this' in the listener."," * @param {Array} args* 0..n additional arguments to supply the listener."," *"," * @class Subscriber"," * @constructor"," */","Y.Subscriber = function(fn, context, args, when) {",""," /**"," * The callback that will be execute when the event fires"," * This is wrapped by Y.rbind if obj was supplied."," * @property fn"," * @type Function"," */"," this.fn = fn;",""," /**"," * Optional 'this' keyword for the listener"," * @property context"," * @type Object"," */"," this.context = context;",""," /**"," * Unique subscriber id"," * @property id"," * @type String"," */"," this.id = Y.stamp(this);",""," /**"," * Additional arguments to propagate to the subscriber"," * @property args"," * @type Array"," */"," this.args = args;",""," this._when = when;",""," /**"," * Custom events for a given fire transaction."," * @property events"," * @type {EventTarget}"," */"," // this.events = null;",""," /**"," * This listener only reacts to the event once"," * @property once"," */"," // this.once = false;","","};","","Y.Subscriber.prototype = {"," constructor: Y.Subscriber,",""," _notify: function(c, args, ce) {"," if (this.deleted && !this.postponed) {"," if (this.postponed) {"," delete this.fn;"," delete this.context;"," } else {"," delete this.postponed;"," return null;"," }"," }"," var a = this.args, ret;"," switch (ce.signature) {"," case 0:"," ret = this.fn.call(c, ce.type, args, c);"," break;"," case 1:"," ret = this.fn.call(c, args[0] || null, c);"," break;"," default:"," if (a || args) {"," args = args || [];"," a = (a) ? args.concat(a) : args;"," ret = this.fn.apply(c, a);"," } else {"," ret = this.fn.call(c);"," }"," }",""," if (this.once) {"," ce._delete(this);"," }",""," return ret;"," },",""," /**"," * Executes the subscriber."," * @method notify"," * @param args {Array} Arguments array for the subscriber."," * @param ce {CustomEvent} The custom event that sent the notification."," */"," notify: function(args, ce) {"," var c = this.context,"," ret = true;",""," if (!c) {"," c = (ce.contextFn) ? ce.contextFn() : ce.context;"," }",""," // only catch errors if we will not re-throw them."," if (Y.config && Y.config.throwFail) {"," ret = this._notify(c, args, ce);"," } else {"," try {"," ret = this._notify(c, args, ce);"," } catch (e) {"," Y.error(this + ' failed: ' + e.message, e);"," }"," }",""," return ret;"," },",""," /**"," * 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} context optional 'this' keyword for the listener."," * @return {boolean} true if the supplied arguments match this"," * subscriber's signature."," */"," contains: function(fn, context) {"," if (context) {"," return ((this.fn == fn) && this.context == context);"," } else {"," return (this.fn == fn);"," }"," },"," "," valueOf : function() {"," return this.id;"," }","","};","/**"," * Return value from all subscribe operations"," * @class EventHandle"," * @constructor"," * @param {CustomEvent} evt the custom event."," * @param {Subscriber} sub the subscriber."," */","Y.EventHandle = function(evt, sub) {",""," /**"," * The custom event"," *"," * @property evt"," * @type CustomEvent"," */"," this.evt = evt;",""," /**"," * The subscriber object"," *"," * @property sub"," * @type Subscriber"," */"," this.sub = sub;","};","","Y.EventHandle.prototype = {"," batch: function(f, c) {"," f.call(c || this, this);"," if (Y.Lang.isArray(this.evt)) {"," Y.Array.each(this.evt, function(h) {"," h.batch.call(c || h, f);"," });"," }"," },",""," /**"," * Detaches this subscriber"," * @method detach"," * @return {int} the number of detached listeners"," */"," detach: function() {"," var evt = this.evt, detached = 0, i;"," if (evt) {"," if (Y.Lang.isArray(evt)) {"," for (i = 0; i < evt.length; i++) {"," detached += evt[i].detach();"," }"," } else {"," evt._delete(this.sub);"," detached = 1;"," }",""," }",""," return detached;"," },",""," /**"," * Monitor the event state for the subscribed event. The first parameter"," * is what should be monitored, the rest are the normal parameters when"," * subscribing to an event."," * @method monitor"," * @param what {string} what to monitor ('attach', 'detach', 'publish')."," * @return {EventHandle} return value from the monitor event subscription."," */"," monitor: function(what) {"," return this.evt.monitor.apply(this.evt, arguments);"," }","};","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","/**"," * EventTarget provides the implementation for any object to"," * publish, subscribe and fire to custom events, and also"," * alows other EventTargets to target the object with events"," * sourced from the other object."," * EventTarget is designed to be used with Y.augment to wrap"," * EventCustom in an interface that allows events to be listened 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 EventTarget"," * @param opts a configuration object"," * @config emitFacade {boolean} if true, all events will emit event"," * facade payloads by default (default false)"," * @config prefix {String} the prefix to apply to non-prefixed event names"," */","","var L = Y.Lang,"," PREFIX_DELIMITER = ':',"," CATEGORY_DELIMITER = '|',"," AFTER_PREFIX = '~AFTER~',"," WILD_TYPE_RE = /(.*?)(:)(.*?)/,",""," _wildType = Y.cached(function(type) {"," return type.replace(WILD_TYPE_RE, \"*$2$3\");"," }),",""," /**"," * If the instance has a prefix attribute and the"," * event type is not prefixed, the instance prefix is"," * applied to the supplied type."," * @method _getType"," * @private"," */"," _getType = Y.cached(function(type, pre) {",""," if (!pre || (typeof type !== \"string\") || type.indexOf(PREFIX_DELIMITER) > -1) {"," return type;"," }",""," return pre + PREFIX_DELIMITER + type;"," }),",""," /**"," * Returns an array with the detach key (if provided),"," * and the prefixed event name from _getType"," * Y.on('detachcategory| menu:click', fn)"," * @method _parseType"," * @private"," */"," _parseType = Y.cached(function(type, pre) {",""," var t = type, detachcategory, after, i;",""," if (!L.isString(t)) {"," return t;"," }",""," i = t.indexOf(AFTER_PREFIX);",""," if (i > -1) {"," after = true;"," t = t.substr(AFTER_PREFIX.length);"," }",""," i = t.indexOf(CATEGORY_DELIMITER);",""," if (i > -1) {"," detachcategory = t.substr(0, (i));"," t = t.substr(i+1);"," if (t == '*') {"," t = null;"," }"," }",""," // detach category, full type with instance prefix, is this an after listener, short type"," return [detachcategory, (pre) ? _getType(t, pre) : t, after, t];"," }),",""," ET = function(opts) {","",""," var o = (L.isObject(opts)) ? opts : {};",""," this._yuievt = this._yuievt || {",""," id: Y.guid(),",""," events: {},",""," targets: {},",""," config: o,",""," chain: ('chain' in o) ? o.chain : Y.config.chain,",""," bubbling: false,",""," defaults: {"," context: o.context || this,"," host: this,"," emitFacade: o.emitFacade,"," fireOnce: o.fireOnce,"," queuable: o.queuable,"," monitored: o.monitored,"," broadcast: o.broadcast,"," defaultTargetOnly: o.defaultTargetOnly,"," bubbles: ('bubbles' in o) ? o.bubbles : true"," }"," };"," };","","","ET.prototype = {"," constructor: ET,",""," /**"," * Listen to a custom event hosted by this object one time."," * This is the equivalent to <code>on</code> except the"," * listener is immediatelly detached when it is executed."," * @method once"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching the"," * subscription"," */"," once: function() {"," var handle = this.on.apply(this, arguments);"," handle.batch(function(hand) {"," if (hand.sub) {"," hand.sub.once = true;"," }"," });"," return handle;"," },",""," /**"," * Listen to a custom event hosted by this object one time."," * This is the equivalent to <code>after</code> except the"," * listener is immediatelly detached when it is executed."," * @method onceAfter"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," */"," onceAfter: function() {"," var handle = this.after.apply(this, arguments);"," handle.batch(function(hand) {"," if (hand.sub) {"," hand.sub.once = true;"," }"," });"," return handle;"," },",""," /**"," * Takes the type parameter passed to 'on' and parses out the"," * various pieces that could be included in the type. If the"," * event type is passed without a prefix, it will be expanded"," * to include the prefix one is supplied or the event target"," * is configured with a default prefix."," * @method parseType"," * @param {String} type the type"," * @param {String} [pre=this._yuievt.config.prefix] the prefix"," * @since 3.3.0"," * @return {Array} an array containing:"," * * the detach category, if supplied,"," * * the prefixed event type,"," * * whether or not this is an after listener,"," * * the supplied event type"," */"," parseType: function(type, pre) {"," return _parseType(type, pre || this._yuievt.config.prefix);"," },",""," /**"," * Subscribe a callback function to a custom event fired by this object or"," * from an object that bubbles its events to this object."," *"," * Callback functions for events published with `emitFacade = true` will"," * receive an `EventFacade` as the first argument (typically named \"e\")."," * These callbacks can then call `e.preventDefault()` to disable the"," * behavior published to that event's `defaultFn`. See the `EventFacade`"," * API for all available properties and methods. Subscribers to"," * non-`emitFacade` events will receive the arguments passed to `fire()`"," * after the event name."," *"," * To subscribe to multiple events at once, pass an object as the first"," * argument, where the key:value pairs correspond to the eventName:callback,"," * or pass an array of event names as the first argument to subscribe to"," * all listed events with the same callback."," *"," * Returning `false` from a callback is supported as an alternative to"," * calling `e.preventDefault(); e.stopPropagation();`. However, it is"," * recommended to use the event methods whenever possible."," *"," * @method on"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," */"," on: function(type, fn, context) {",""," var yuievt = this._yuievt,"," parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce,"," detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype,"," Node = Y.Node, n, domevent, isArr;",""," // full name, args, detachcategory, after"," this._monitor('attach', parts[1], {"," args: arguments,"," category: parts[0],"," after: parts[2]"," });",""," if (L.isObject(type)) {",""," if (L.isFunction(type)) {"," return Y.Do.before.apply(Y.Do, arguments);"," }",""," f = fn;"," c = context;"," args = nativeSlice.call(arguments, 0);"," ret = [];",""," if (L.isArray(type)) {"," isArr = true;"," }",""," after = type._after;"," delete type._after;",""," Y.each(type, function(v, k) {",""," if (L.isObject(v)) {"," f = v.fn || ((L.isFunction(v)) ? v : f);"," c = v.context || c;"," }",""," var nv = (after) ? AFTER_PREFIX : '';",""," args[0] = nv + ((isArr) ? v : k);"," args[1] = f;"," args[2] = c;",""," ret.push(this.on.apply(this, args));",""," }, this);",""," return (yuievt.chain) ? this : new Y.EventHandle(ret);"," }",""," detachcategory = parts[0];"," after = parts[2];"," shorttype = parts[3];",""," // extra redirection so we catch adaptor events too. take a look at this."," if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) {"," args = nativeSlice.call(arguments, 0);"," args.splice(2, 0, Node.getDOMNode(this));"," return Y.on.apply(Y, args);"," }",""," type = parts[1];",""," if (Y.instanceOf(this, YUI)) {",""," adapt = Y.Env.evt.plugins[type];"," args = nativeSlice.call(arguments, 0);"," args[0] = shorttype;",""," if (Node) {"," n = args[2];",""," if (Y.instanceOf(n, Y.NodeList)) {"," n = Y.NodeList.getDOMNodes(n);"," } else if (Y.instanceOf(n, Node)) {"," n = Node.getDOMNode(n);"," }",""," domevent = (shorttype in Node.DOM_EVENTS);",""," // Captures both DOM events and event plugins."," if (domevent) {"," args[2] = n;"," }"," }",""," // check for the existance of an event adaptor"," if (adapt) {"," handle = adapt.on.apply(Y, args);"," } else if ((!type) || domevent) {"," handle = Y.Event._attach(args);"," }",""," }",""," if (!handle) {"," ce = yuievt.events[type] || this.publish(type);"," handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);"," }",""," if (detachcategory) {"," store[detachcategory] = store[detachcategory] || {};"," store[detachcategory][type] = store[detachcategory][type] || [];"," store[detachcategory][type].push(handle);"," }",""," return (yuievt.chain) ? this : handle;",""," },",""," /**"," * subscribe to an event"," * @method subscribe"," * @deprecated use on"," */"," subscribe: function() {"," return this.on.apply(this, arguments);"," },",""," /**"," * Detach one or more listeners the from the specified event"," * @method detach"," * @param type {string|Object} Either the handle to the subscriber or the"," * type of event. If the type"," * is not specified, it will attempt to remove"," * the listener from all hosted events."," * @param fn {Function} The subscribed function to unsubscribe, if not"," * supplied, all subscribers will be removed."," * @param context {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 {EventTarget} the host"," */"," detach: function(type, fn, context) {"," var evts = this._yuievt.events, i,"," Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));",""," // detachAll disabled on the Y instance."," if (!type && (this !== Y)) {"," for (i in evts) {"," if (evts.hasOwnProperty(i)) {"," evts[i].detach(fn, context);"," }"," }"," if (isNode) {"," Y.Event.purgeElement(Node.getDOMNode(this));"," }",""," return this;"," }",""," var parts = _parseType(type, this._yuievt.config.prefix),"," detachcategory = L.isArray(parts) ? parts[0] : null,"," shorttype = (parts) ? parts[3] : null,"," adapt, store = Y.Env.evt.handles, detachhost, cat, args,"," ce,",""," keyDetacher = function(lcat, ltype, host) {"," var handles = lcat[ltype], ce, i;"," if (handles) {"," for (i = handles.length - 1; i >= 0; --i) {"," ce = handles[i].evt;"," if (ce.host === host || ce.el === host) {"," handles[i].detach();"," }"," }"," }"," };",""," if (detachcategory) {",""," cat = store[detachcategory];"," type = parts[1];"," detachhost = (isNode) ? Y.Node.getDOMNode(this) : this;",""," if (cat) {"," if (type) {"," keyDetacher(cat, type, detachhost);"," } else {"," for (i in cat) {"," if (cat.hasOwnProperty(i)) {"," keyDetacher(cat, i, detachhost);"," }"," }"," }",""," return this;"," }",""," // If this is an event handle, use it to detach"," } else if (L.isObject(type) && type.detach) {"," type.detach();"," return this;"," // extra redirection so we catch adaptor events too. take a look at this."," } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) {"," args = nativeSlice.call(arguments, 0);"," args[2] = Node.getDOMNode(this);"," Y.detach.apply(Y, args);"," return this;"," }",""," adapt = Y.Env.evt.plugins[shorttype];",""," // The YUI instance handles DOM events and adaptors"," if (Y.instanceOf(this, YUI)) {"," args = nativeSlice.call(arguments, 0);"," // use the adaptor specific detach code if"," if (adapt && adapt.detach) {"," adapt.detach.apply(Y, args);"," return this;"," // DOM event fork"," } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) {"," args[0] = type;"," Y.Event.detach.apply(Y.Event, args);"," return this;"," }"," }",""," // ce = evts[type];"," ce = evts[parts[1]];"," if (ce) {"," ce.detach(fn, context);"," }",""," return this;"," },",""," /**"," * detach a listener"," * @method unsubscribe"," * @deprecated use detach"," */"," unsubscribe: function() {"," return this.detach.apply(this, arguments);"," },",""," /**"," * 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 detachAll"," * @param type {String} The type, or name of the event"," */"," detachAll: function(type) {"," return this.detach(type);"," },",""," /**"," * 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 type {String} The type, or name of the event"," * @deprecated use detachAll"," */"," unsubscribeAll: function() {"," return this.detachAll.apply(this, arguments);"," },",""," /**"," * 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 publish"," *"," * @param type {String} the type, or name of the event"," * @param opts {object} optional config params. Valid properties are:"," *"," * <ul>"," * <li>"," * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false)"," * </li>"," * <li>"," * 'bubbles': whether or not this event bubbles (true)"," * Events can only bubble if emitFacade is true."," * </li>"," * <li>"," * 'context': the default execution context for the listeners (this)"," * </li>"," * <li>"," * 'defaultFn': the default function to execute when this event fires if preventDefault was not called"," * </li>"," * <li>"," * 'emitFacade': whether or not this event emits a facade (false)"," * </li>"," * <li>"," * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click'"," * </li>"," * <li>"," * 'fireOnce': if an event is configured to fire once, new subscribers after"," * the fire will be notified immediately."," * </li>"," * <li>"," * 'async': fireOnce event listeners will fire synchronously if the event has already"," * fired unless async is true."," * </li>"," * <li>"," * 'preventable': whether or not preventDefault() has an effect (true)"," * </li>"," * <li>"," * 'preventedFn': a function that is executed when preventDefault is called"," * </li>"," * <li>"," * 'queuable': whether or not this event can be queued during bubbling (false)"," * </li>"," * <li>"," * 'silent': if silent is true, debug messages are not provided for this event."," * </li>"," * <li>"," * 'stoppedFn': a function that is executed when stopPropagation is called"," * </li>"," *"," * <li>"," * 'monitored': specifies whether or not this event should send notifications about"," * when the event has been attached, detached, or published."," * </li>"," * <li>"," * 'type': the event type (valid option if not provided as the first parameter to publish)"," * </li>"," * </ul>"," *"," * @return {CustomEvent} the custom event"," *"," */"," publish: function(type, opts) {"," var events, ce, ret, defaults,"," edata = this._yuievt,"," pre = edata.config.prefix;",""," if (L.isObject(type)) {"," ret = {};"," Y.each(type, function(v, k) {"," ret[k] = this.publish(k, v || opts);"," }, this);",""," return ret;"," }",""," type = (pre) ? _getType(type, pre) : type;",""," events = edata.events;"," ce = events[type];",""," this._monitor('publish', type, {"," args: arguments"," });",""," if (ce) {"," // ce.log(\"publish applying new config to published event: '\"+type+\"' exists\", 'info', 'event');"," if (opts) {"," ce.applyConfig(opts, true);"," }"," } else {"," // TODO: Lazy publish goes here."," defaults = edata.defaults;",""," // apply defaults"," ce = new Y.CustomEvent(type, defaults);"," if (opts) {"," ce.applyConfig(opts, true);"," }",""," events[type] = ce;"," }",""," // make sure we turn the broadcast flag off if this"," // event was published as a result of bubbling"," // if (opts instanceof Y.CustomEvent) {"," // events[type].broadcast = false;"," // }",""," return events[type];"," },",""," /**"," * This is the entry point for the event monitoring system."," * You can monitor 'attach', 'detach', 'fire', and 'publish'."," * When configured, these events generate an event. click ->"," * click_attach, click_detach, click_publish -- these can"," * be subscribed to like other events to monitor the event"," * system. Inividual published events can have monitoring"," * turned on or off (publish can't be turned off before it"," * it published) by setting the events 'monitor' config."," *"," * @method _monitor"," * @param what {String} 'attach', 'detach', 'fire', or 'publish'"," * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object."," * @param o {Object} Information about the event interaction, such as"," * fire() args, subscription category, publish config"," * @private"," */"," _monitor: function(what, eventType, o) {"," var monitorevt, ce, type;",""," if (eventType) {"," if (typeof eventType === \"string\") {"," type = eventType;"," ce = this.getEvent(eventType, true);"," } else {"," ce = eventType;"," type = eventType.type;"," }",""," if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {"," monitorevt = type + '_' + what;"," o.monitored = what;"," this.fire.call(this, monitorevt, o);"," }"," }"," },",""," /**"," * Fire a custom event by name. The callback functions will be executed"," * from the context specified when the event was created, and with the"," * following parameters."," *"," * If the custom event object hasn't been created, then the event hasn't"," * been published and it has no subscribers. For performance sake, we"," * immediate exit in this case. This means the event won't bubble, so"," * if the intention is that a bubble target be notified, the event must"," * be published on this object first."," *"," * The first argument is the event type, and any additional arguments are"," * passed to the listeners as parameters. If the first of these is an"," * object literal, and the event is configured to emit an event facade,"," * that object is mixed into the event facade and the facade is provided"," * in place of the original object."," *"," * @method fire"," * @param type {String|Object} The type of the event, or an object that contains"," * a 'type' property."," * @param arguments {Object*} an arbitrary set of parameters to pass to"," * the handler. If the first of these is an object literal and the event is"," * configured to emit an event facade, the event facade will replace that"," * parameter after the properties the object literal contains are copied to"," * the event facade."," * @return {EventTarget} the event host"," */"," fire: function(type) {",""," var typeIncluded = L.isString(type),"," t = (typeIncluded) ? type : (type && type.type),"," yuievt = this._yuievt,"," pre = yuievt.config.prefix, "," ce, ret, "," ce2,"," args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;",""," t = (pre) ? _getType(t, pre) : t;",""," ce = this.getEvent(t, true);"," ce2 = this.getSibling(t, ce);",""," if (ce2 && !ce) {"," ce = this.publish(t);"," }",""," this._monitor('fire', (ce || t), {"," args: args"," });",""," // this event has not been published or subscribed to"," if (!ce) {"," if (yuievt.hasTargets) {"," return this.bubble({ type: t }, args, this);"," }",""," // otherwise there is nothing to be done"," ret = true;"," } else {"," ce.sibling = ce2;"," ret = ce.fire.apply(ce, args);"," }",""," return (yuievt.chain) ? this : ret;"," },",""," getSibling: function(type, ce) {"," var ce2;"," // delegate to *:type events if there are subscribers"," if (type.indexOf(PREFIX_DELIMITER) > -1) {"," type = _wildType(type);"," // console.log(type);"," ce2 = this.getEvent(type, true);"," if (ce2) {"," // console.log(\"GOT ONE: \" + type);"," ce2.applyConfig(ce);"," ce2.bubbles = false;"," ce2.broadcast = 0;"," // ret = ce2.fire.apply(ce2, a);"," }"," }",""," return ce2;"," },",""," /**"," * Returns the custom event of the provided type has been created, a"," * falsy value otherwise"," * @method getEvent"," * @param type {String} the type, or name of the event"," * @param prefixed {String} if true, the type is prefixed already"," * @return {CustomEvent} the custom event or null"," */"," getEvent: function(type, prefixed) {"," var pre, e;"," if (!prefixed) {"," pre = this._yuievt.config.prefix;"," type = (pre) ? _getType(type, pre) : type;"," }"," e = this._yuievt.events;"," return e[type] || null;"," },",""," /**"," * Subscribe to a custom event hosted by this object. The"," * supplied callback will execute after any listeners add"," * via the subscribe method, and after the default function,"," * if configured for the event, has executed."," *"," * @method after"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching the"," * subscription"," */"," after: function(type, fn) {",""," var a = nativeSlice.call(arguments, 0);",""," switch (L.type(type)) {"," case 'function':"," return Y.Do.after.apply(Y.Do, arguments);"," case 'array':"," // YArray.each(a[0], function(v) {"," // v = AFTER_PREFIX + v;"," // });"," // break;"," case 'object':"," a[0]._after = true;"," break;"," default:"," a[0] = AFTER_PREFIX + type;"," }",""," return this.on.apply(this, a);",""," },",""," /**"," * Executes the callback before a DOM event, custom event"," * or method. If the first argument is a function, it"," * is assumed the target is a method. For DOM and custom"," * events, this is an alias for Y.on."," *"," * For DOM and custom events:"," * type, callback, context, 0-n arguments"," *"," * For methods:"," * callback, object (method host), methodName, context, 0-n arguments"," *"," * @method before"," * @return detach handle"," */"," before: function() {"," return this.on.apply(this, arguments);"," }","","};","","Y.EventTarget = ET;","","// make Y an event target","Y.mix(Y, ET.prototype);","ET.call(Y, { bubbles: false });","","YUI.Env.globalEvents = YUI.Env.globalEvents || new ET();","","/**"," * Hosts YUI page level events. This is where events bubble to"," * when the broadcast config is set to 2. This property is"," * only available if the custom event module is loaded."," * @property Global"," * @type EventTarget"," * @for YUI"," */","Y.Global = YUI.Env.globalEvents;","","// @TODO implement a global namespace function on Y.Global?","","/**","`Y.on()` can do many things:","","<ul>"," <li>Subscribe to custom events `publish`ed and `fire`d from Y</li>"," <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and"," `fire`d from any object in the YUI instance sandbox</li>"," <li>Subscribe to DOM events</li>"," <li>Subscribe to the execution of a method on any object, effectively"," treating that method as an event</li>","</ul>","","For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.",""," Y.on('io:complete', function () {"," Y.MyApp.updateStatus('Transaction complete');"," });","","To subscribe to DOM events, pass the name of a DOM event as the first argument","and a CSS selector string as the third argument after the callback function.","Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`,","array, or simply omitted (the default is the `window` object).",""," Y.on('click', function (e) {"," e.preventDefault();",""," // proceed with ajax form submission"," var url = this.get('action');"," ..."," }, '#my-form');","","The `this` object in DOM event callbacks will be the `Node` targeted by the CSS","selector or other identifier.","","`on()` subscribers for DOM events or custom events `publish`ed with a","`defaultFn` can prevent the default behavior with `e.preventDefault()` from the","event object passed as the first parameter to the subscription callback.","","To subscribe to the execution of an object method, pass arguments corresponding to the call signature for ","<a href=\"../classes/Do.html#methods_before\">`Y.Do.before(...)`</a>.","","NOTE: The formal parameter list below is for events, not for function","injection. See `Y.Do.before` for that signature.","","@method on","@param {String} type DOM or custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@see Do.before","@for YUI","**/","","/**","Listen for an event one time. Equivalent to `on()`, except that","the listener is immediately detached when executed.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","@see on","@method once","@param {String} type DOM or custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","/**","Listen for an event one time. Equivalent to `once()`, except, like `after()`,","the subscription callback executes after all `on()` subscribers and the event's","`defaultFn` (if configured) have executed. Like `after()` if any `on()` phase","subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()`","subscribers will execute.","","The listener is immediately detached when executed.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","@see once","@method onceAfter","@param {String} type The custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","/**","Like `on()`, this method creates a subscription to a custom event or to the","execution of a method on an object.","","For events, `after()` subscribers are executed after the event's","`defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","NOTE: The subscription signature shown is for events, not for function","injection. See <a href=\"../classes/Do.html#methods_after\">`Y.Do.after`</a>","for that signature.","","@see on","@see Do.after","@method after","@param {String} type The custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [args*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","","}, '3.7.2', {\"requires\": [\"oop\"]});"];+_yuitest_coverage["build/event-custom-base/event-custom-base.js"].code=["YUI.add('event-custom-base', function (Y, NAME) {","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," */","","Y.Env.evt = {"," handles: {},"," plugins: {}","};","","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","/**"," * Allows for the insertion of methods that are executed before or after"," * a specified method"," * @class Do"," * @static"," */","","var DO_BEFORE = 0,"," DO_AFTER = 1,","","DO = {",""," /**"," * Cache of objects touched by the utility"," * @property objs"," * @static"," * @deprecated Since 3.6.0. The `_yuiaop` property on the AOP'd object "," * replaces the role of this property, but is considered to be private, and "," * is only mentioned to provide a migration path."," * "," * If you have a use case which warrants migration to the _yuiaop property, "," * please file a ticket to let us know what it's used for and we can see if "," * we need to expose hooks for that functionality more formally."," */"," objs: null,",""," /**"," * <p>Execute the supplied method before the specified function. Wrapping"," * function may optionally return an instance of the following classes to"," * further alter runtime behavior:</p>"," * <dl>"," * <dt></code>Y.Do.Halt(message, returnValue)</code></dt>"," * <dd>Immediatly stop execution and return"," * <code>returnValue</code>. No other wrapping functions will be"," * executed.</dd>"," * <dt></code>Y.Do.AlterArgs(message, newArgArray)</code></dt>"," * <dd>Replace the arguments that the original function will be"," * called with.</dd>"," * <dt></code>Y.Do.Prevent(message)</code></dt>"," * <dd>Don't execute the wrapped function. Other before phase"," * wrappers will be executed.</dd>"," * </dl>"," *"," * @method before"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @param arg* {mixed} 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {string} handle for the subscription"," * @static"," */"," before: function(fn, obj, sFn, c) {"," var f = fn, a;"," if (c) {"," a = [fn, c].concat(Y.Array(arguments, 4, true));"," f = Y.rbind.apply(Y, a);"," }",""," return this._inject(DO_BEFORE, f, obj, sFn);"," },",""," /**"," * <p>Execute the supplied method after the specified function. Wrapping"," * function may optionally return an instance of the following classes to"," * further alter runtime behavior:</p>"," * <dl>"," * <dt></code>Y.Do.Halt(message, returnValue)</code></dt>"," * <dd>Immediatly stop execution and return"," * <code>returnValue</code>. No other wrapping functions will be"," * executed.</dd>"," * <dt></code>Y.Do.AlterReturn(message, returnValue)</code></dt>"," * <dd>Return <code>returnValue</code> instead of the wrapped"," * method's original return value. This can be further altered by"," * other after phase wrappers.</dd>"," * </dl>"," *"," * <p>The static properties <code>Y.Do.originalRetVal</code> and"," * <code>Y.Do.currentRetVal</code> will be populated for reference.</p>"," *"," * @method after"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @param arg* {mixed} 0..n additional arguments to supply to the subscriber"," * @return {string} handle for the subscription"," * @static"," */"," after: function(fn, obj, sFn, c) {"," var f = fn, a;"," if (c) {"," a = [fn, c].concat(Y.Array(arguments, 4, true));"," f = Y.rbind.apply(Y, a);"," }",""," return this._inject(DO_AFTER, f, obj, sFn);"," },",""," /**"," * Execute the supplied method before or after the specified function."," * Used by <code>before</code> and <code>after</code>."," *"," * @method _inject"," * @param when {string} before or after"," * @param fn {Function} the function to execute"," * @param obj the object hosting the method to displace"," * @param sFn {string} the name of the method to displace"," * @param c The execution context for fn"," * @return {string} handle for the subscription"," * @private"," * @static"," */"," _inject: function(when, fn, obj, sFn) {"," // object id"," var id = Y.stamp(obj), o, sid;",""," if (!obj._yuiaop) {"," // create a map entry for the obj if it doesn't exist, to hold overridden methods"," obj._yuiaop = {};"," }",""," o = obj._yuiaop;",""," if (!o[sFn]) {"," // create a map entry for the method if it doesn't exist"," o[sFn] = new Y.Do.Method(obj, sFn);",""," // re-route the method to our wrapper"," obj[sFn] = function() {"," return o[sFn].exec.apply(o[sFn], arguments);"," };"," }",""," // subscriber id"," sid = id + Y.stamp(fn) + sFn;",""," // register the callback"," o[sFn].register(sid, fn, when);",""," return new Y.EventHandle(o[sFn], sid);"," },",""," /**"," * Detach a before or after subscription."," *"," * @method detach"," * @param handle {string} the subscription handle"," * @static"," */"," detach: function(handle) {"," if (handle.detach) {"," handle.detach();"," }"," },",""," _unload: function(e, me) {"," }","};","","Y.Do = DO;","","//////////////////////////////////////////////////////////////////////////","","/**"," * Contains the return value from the wrapped method, accessible"," * by 'after' event listeners."," *"," * @property originalRetVal"," * @static"," * @since 3.2.0"," */","","/**"," * Contains the current state of the return value, consumable by"," * 'after' event listeners, and updated if an after subscriber"," * changes the return value generated by the wrapped function."," *"," * @property currentRetVal"," * @static"," * @since 3.2.0"," */","","//////////////////////////////////////////////////////////////////////////","","/**"," * Wrapper for a displaced method with aop enabled"," * @class Do.Method"," * @constructor"," * @param obj The object to operate on"," * @param sFn The name of the method to displace"," */","DO.Method = function(obj, sFn) {"," this.obj = obj;"," this.methodName = sFn;"," this.method = obj[sFn];"," this.before = {};"," this.after = {};","};","","/**"," * Register a aop subscriber"," * @method register"," * @param sid {string} the subscriber id"," * @param fn {Function} the function to execute"," * @param when {string} when to execute the function"," */","DO.Method.prototype.register = function (sid, fn, when) {"," if (when) {"," this.after[sid] = fn;"," } else {"," this.before[sid] = fn;"," }","};","","/**"," * Unregister a aop subscriber"," * @method delete"," * @param sid {string} the subscriber id"," * @param fn {Function} the function to execute"," * @param when {string} when to execute the function"," */","DO.Method.prototype._delete = function (sid) {"," delete this.before[sid];"," delete this.after[sid];","};","","/**"," * <p>Execute the wrapped method. All arguments are passed into the wrapping"," * functions. If any of the before wrappers return an instance of"," * <code>Y.Do.Halt</code> or <code>Y.Do.Prevent</code>, neither the wrapped"," * function nor any after phase subscribers will be executed.</p>"," *"," * <p>The return value will be the return value of the wrapped function or one"," * provided by a wrapper function via an instance of <code>Y.Do.Halt</code> or"," * <code>Y.Do.AlterReturn</code>."," *"," * @method exec"," * @param arg* {any} Arguments are passed to the wrapping and wrapped functions"," * @return {any} Return value of wrapped function unless overwritten (see above)"," */","DO.Method.prototype.exec = function () {",""," var args = Y.Array(arguments, 0, true),"," i, ret, newRet,"," bf = this.before,"," af = this.after,"," prevented = false;",""," // execute before"," for (i in bf) {"," if (bf.hasOwnProperty(i)) {"," ret = bf[i].apply(this.obj, args);"," if (ret) {"," switch (ret.constructor) {"," case DO.Halt:"," return ret.retVal;"," case DO.AlterArgs:"," args = ret.newArgs;"," break;"," case DO.Prevent:"," prevented = true;"," break;"," default:"," }"," }"," }"," }",""," // execute method"," if (!prevented) {"," ret = this.method.apply(this.obj, args);"," }",""," DO.originalRetVal = ret;"," DO.currentRetVal = ret;",""," // execute after methods."," for (i in af) {"," if (af.hasOwnProperty(i)) {"," newRet = af[i].apply(this.obj, args);"," // Stop processing if a Halt object is returned"," if (newRet && newRet.constructor == DO.Halt) {"," return newRet.retVal;"," // Check for a new return value"," } else if (newRet && newRet.constructor == DO.AlterReturn) {"," ret = newRet.newRetVal;"," // Update the static retval state"," DO.currentRetVal = ret;"," }"," }"," }",""," return ret;","};","","//////////////////////////////////////////////////////////////////////////","","/**"," * Return an AlterArgs object when you want to change the arguments that"," * were passed into the function. Useful for Do.before subscribers. An"," * example would be a service that scrubs out illegal characters prior to"," * executing the core business logic."," * @class Do.AlterArgs"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param newArgs {Array} Call parameters to be used for the original method"," * instead of the arguments originally passed in."," */","DO.AlterArgs = function(msg, newArgs) {"," this.msg = msg;"," this.newArgs = newArgs;","};","","/**"," * Return an AlterReturn object when you want to change the result returned"," * from the core method to the caller. Useful for Do.after subscribers."," * @class Do.AlterReturn"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param newRetVal {any} Return value passed to code that invoked the wrapped"," * function."," */","DO.AlterReturn = function(msg, newRetVal) {"," this.msg = msg;"," this.newRetVal = newRetVal;","};","","/**"," * Return a Halt object when you want to terminate the execution"," * of all subsequent subscribers as well as the wrapped method"," * if it has not exectued yet. Useful for Do.before subscribers."," * @class Do.Halt"," * @constructor"," * @param msg {String} (optional) Explanation of why the termination was done"," * @param retVal {any} Return value passed to code that invoked the wrapped"," * function."," */","DO.Halt = function(msg, retVal) {"," this.msg = msg;"," this.retVal = retVal;","};","","/**"," * Return a Prevent object when you want to prevent the wrapped function"," * from executing, but want the remaining listeners to execute. Useful"," * for Do.before subscribers."," * @class Do.Prevent"," * @constructor"," * @param msg {String} (optional) Explanation of why the termination was done"," */","DO.Prevent = function(msg) {"," this.msg = msg;","};","","/**"," * Return an Error object when you want to terminate the execution"," * of all subsequent method calls."," * @class Do.Error"," * @constructor"," * @param msg {String} (optional) Explanation of the altered return value"," * @param retVal {any} Return value passed to code that invoked the wrapped"," * function."," * @deprecated use Y.Do.Halt or Y.Do.Prevent"," */","DO.Error = DO.Halt;","","","//////////////////////////////////////////////////////////////////////////","","// Y[\"Event\"] && Y.Event.addListener(window, \"unload\", Y.Do._unload, Y.Do);","","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","","// var onsubscribeType = \"_event:onsub\",","var YArray = Y.Array,",""," AFTER = 'after',"," CONFIGS = ["," 'broadcast',"," 'monitored',"," 'bubbles',"," 'context',"," 'contextFn',"," 'currentTarget',"," 'defaultFn',"," 'defaultTargetOnly',"," 'details',"," 'emitFacade',"," 'fireOnce',"," 'async',"," 'host',"," 'preventable',"," 'preventedFn',"," 'queuable',"," 'silent',"," 'stoppedFn',"," 'target',"," 'type'"," ],",""," CONFIGS_HASH = YArray.hash(CONFIGS),",""," nativeSlice = Array.prototype.slice, ",""," YUI3_SIGNATURE = 9,"," YUI_LOG = 'yui:log',",""," mixConfigs = function(r, s, ov) {"," var p;",""," for (p in s) {"," if (CONFIGS_HASH[p] && (ov || !(p in r))) { "," r[p] = s[p];"," }"," }",""," return r;"," };","","/**"," * 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} o configuration object."," * @class CustomEvent"," * @constructor"," */","Y.CustomEvent = function(type, o) {",""," this._kds = Y.CustomEvent.keepDeprecatedSubs;",""," o = o || {};",""," this.id = Y.stamp(this);",""," /**"," * The type of event, returned to subscribers when the event fires"," * @property type"," * @type string"," */"," this.type = type;",""," /**"," * The context the the event will fire from by default. Defaults to the YUI"," * instance."," * @property context"," * @type object"," */"," this.context = Y;",""," /**"," * Monitor when an event is attached or detached."," *"," * @property monitored"," * @type boolean"," */"," // this.monitored = false;",""," this.logSystem = (type == YUI_LOG);",""," /**"," * If 0, this event does not broadcast. If 1, the YUI instance is notified"," * every time this event fires. If 2, the YUI instance and the YUI global"," * (if event is enabled on the global) are notified every time this event"," * fires."," * @property broadcast"," * @type int"," */"," // this.broadcast = 0;",""," /**"," * By default all custom events are logged in the debug build, set silent"," * to true to disable debug outpu for this event."," * @property silent"," * @type boolean"," */"," this.silent = this.logSystem;",""," /**"," * Specifies whether this event should be queued when the host is actively"," * processing an event. This will effect exectution order of the callbacks"," * for the various events."," * @property queuable"," * @type boolean"," * @default false"," */"," // this.queuable = false;",""," /**"," * The subscribers to this event"," * @property subscribers"," * @type Subscriber {}"," * @deprecated"," */"," if (this._kds) {"," this.subscribers = {};"," }",""," /**"," * The subscribers to this event"," * @property _subscribers"," * @type Subscriber []"," * @private"," */"," this._subscribers = [];",""," /**"," * 'After' subscribers"," * @property afters"," * @type Subscriber {}"," */"," if (this._kds) {"," this.afters = {};"," }",""," /**"," * 'After' subscribers"," * @property _afters"," * @type Subscriber []"," * @private"," */"," this._afters = [];",""," /**"," * This event has fired if true"," *"," * @property fired"," * @type boolean"," * @default false;"," */"," // this.fired = false;",""," /**"," * An array containing the arguments the custom event"," * was last fired with."," * @property firedWith"," * @type Array"," */"," // this.firedWith;",""," /**"," * This event should only fire one time if true, and if"," * it has fired, any new subscribers should be notified"," * immediately."," *"," * @property fireOnce"," * @type boolean"," * @default false;"," */"," // this.fireOnce = false;",""," /**"," * fireOnce listeners will fire syncronously unless async"," * is set to true"," * @property async"," * @type boolean"," * @default false"," */"," //this.async = false;",""," /**"," * Flag for stopPropagation that is modified during fire()"," * 1 means to stop propagation to bubble targets. 2 means"," * to also stop additional subscribers on this target."," * @property stopped"," * @type int"," */"," // this.stopped = 0;",""," /**"," * Flag for preventDefault that is modified during fire()."," * if it is not 0, the default behavior for this event"," * @property prevented"," * @type int"," */"," // this.prevented = 0;",""," /**"," * Specifies the host for this custom event. This is used"," * to enable event bubbling"," * @property host"," * @type EventTarget"," */"," // this.host = null;",""," /**"," * The default function to execute after event listeners"," * have fire, but only if the default action was not"," * prevented."," * @property defaultFn"," * @type Function"," */"," // this.defaultFn = null;",""," /**"," * The function to execute if a subscriber calls"," * stopPropagation or stopImmediatePropagation"," * @property stoppedFn"," * @type Function"," */"," // this.stoppedFn = null;",""," /**"," * The function to execute if a subscriber calls"," * preventDefault"," * @property preventedFn"," * @type Function"," */"," // this.preventedFn = null;",""," /**"," * Specifies whether or not this event's default function"," * can be cancelled by a subscriber by executing preventDefault()"," * on the event facade"," * @property preventable"," * @type boolean"," * @default true"," */"," this.preventable = true;",""," /**"," * Specifies whether or not a subscriber can stop the event propagation"," * via stopPropagation(), stopImmediatePropagation(), or halt()"," *"," * Events can only bubble if emitFacade is true."," *"," * @property bubbles"," * @type boolean"," * @default true"," */"," this.bubbles = true;",""," /**"," * Supports multiple options for listener signatures in order to"," * port YUI 2 apps."," * @property signature"," * @type int"," * @default 9"," */"," this.signature = YUI3_SIGNATURE;",""," // this.subCount = 0;"," // this.afterCount = 0;",""," // this.hasSubscribers = false;"," // this.hasAfters = false;",""," /**"," * If set to true, the custom event will deliver an EventFacade object"," * that is similar to a DOM event object."," * @property emitFacade"," * @type boolean"," * @default false"," */"," // this.emitFacade = false;",""," this.applyConfig(o, true);","","","};","","/**"," * Static flag to enable population of the <a href=\"#property_subscribers\">`subscribers`</a>"," * and <a href=\"#property_subscribers\">`afters`</a> properties held on a `CustomEvent` instance."," * "," * These properties were changed to private properties (`_subscribers` and `_afters`), and "," * converted from objects to arrays for performance reasons. "," *"," * Setting this property to true will populate the deprecated `subscribers` and `afters` "," * properties for people who may be using them (which is expected to be rare). There will"," * be a performance hit, compared to the new array based implementation."," *"," * If you are using these deprecated properties for a use case which the public API"," * does not support, please file an enhancement request, and we can provide an alternate "," * public implementation which doesn't have the performance cost required to maintiain the"," * properties as objects."," *"," * @property keepDeprecatedSubs"," * @static"," * @for CustomEvent"," * @type boolean"," * @default false"," * @deprecated"," */","Y.CustomEvent.keepDeprecatedSubs = false;","","Y.CustomEvent.mixConfigs = mixConfigs;","","Y.CustomEvent.prototype = {",""," constructor: Y.CustomEvent,",""," /**"," * Returns the number of subscribers for this event as the sum of the on()"," * subscribers and after() subscribers."," *"," * @method hasSubs"," * @return Number"," */"," hasSubs: function(when) {"," var s = this._subscribers.length, a = this._afters.length, sib = this.sibling;",""," if (sib) {"," s += sib._subscribers.length;"," a += sib._afters.length;"," }",""," if (when) {"," return (when == 'after') ? a : s;"," }",""," return (s + a);"," },",""," /**"," * Monitor the event state for the subscribed event. The first parameter"," * is what should be monitored, the rest are the normal parameters when"," * subscribing to an event."," * @method monitor"," * @param what {string} what to monitor ('detach', 'attach', 'publish')."," * @return {EventHandle} return value from the monitor event subscription."," */"," monitor: function(what) {"," this.monitored = true;"," var type = this.id + '|' + this.type + '_' + what,"," args = nativeSlice.call(arguments, 0);"," args[0] = type;"," return this.host.on.apply(this.host, args);"," },",""," /**"," * Get all of the subscribers to this event and any sibling event"," * @method getSubs"," * @return {Array} first item is the on subscribers, second the after."," */"," getSubs: function() {"," var s = this._subscribers, a = this._afters, sib = this.sibling;",""," s = (sib) ? s.concat(sib._subscribers) : s.concat();"," a = (sib) ? a.concat(sib._afters) : a.concat();",""," return [s, a];"," },",""," /**"," * Apply configuration properties. Only applies the CONFIG whitelist"," * @method applyConfig"," * @param o hash of properties to apply."," * @param force {boolean} if true, properties that exist on the event"," * will be overwritten."," */"," applyConfig: function(o, force) {"," mixConfigs(this, o, force);"," },",""," /**"," * Create the Subscription for subscribing function, context, and bound"," * arguments. If this is a fireOnce event, the subscriber is immediately "," * notified."," *"," * @method _on"," * @param fn {Function} Subscription callback"," * @param [context] {Object} Override `this` in the callback"," * @param [args] {Array} bound arguments that will be passed to the callback after the arguments generated by fire()"," * @param [when] {String} \"after\" to slot into after subscribers"," * @return {EventHandle}"," * @protected"," */"," _on: function(fn, context, args, when) {","",""," var s = new Y.Subscriber(fn, context, args, when);",""," if (this.fireOnce && this.fired) {"," if (this.async) {"," setTimeout(Y.bind(this._notify, this, s, this.firedWith), 0);"," } else {"," this._notify(s, this.firedWith);"," }"," }",""," if (when == AFTER) {"," this._afters.push(s);"," } else {"," this._subscribers.push(s);"," }",""," if (this._kds) {"," if (when == AFTER) {"," this.afters[s.id] = s;"," } else {"," this.subscribers[s.id] = s;"," }"," }",""," return new Y.EventHandle(this, s);"," },",""," /**"," * Listen for this event"," * @method subscribe"," * @param {Function} fn The function to execute."," * @return {EventHandle} Unsubscribe handle."," * @deprecated use on."," */"," subscribe: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;"," return this._on(fn, context, a, true);"," },"," "," /**"," * Listen for this event"," * @method on"," * @param {Function} fn The function to execute."," * @param {object} context optional execution context."," * @param {mixed} arg* 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {EventHandle} An object with a detach method to detch the handler(s)."," */"," on: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;",""," if (this.monitored && this.host) {"," this.host._monitor('attach', this, {"," args: arguments"," });"," }"," return this._on(fn, context, a, true);"," },",""," /**"," * Listen for this event after the normal subscribers have been notified and"," * the default behavior has been applied. If a normal subscriber prevents the"," * default behavior, it also prevents after listeners from firing."," * @method after"," * @param {Function} fn The function to execute."," * @param {object} context optional execution context."," * @param {mixed} arg* 0..n additional arguments to supply to the subscriber"," * when the event fires."," * @return {EventHandle} handle Unsubscribe handle."," */"," after: function(fn, context) {"," var a = (arguments.length > 2) ? nativeSlice.call(arguments, 2) : null;"," return this._on(fn, context, a, AFTER);"," },",""," /**"," * Detach listeners."," * @method detach"," * @param {Function} fn The subscribed function to remove, if not supplied"," * all will be removed."," * @param {Object} context The context object passed to subscribe."," * @return {int} returns the number of subscribers unsubscribed."," */"," detach: function(fn, context) {"," // unsubscribe handle"," if (fn && fn.detach) {"," return fn.detach();"," }"," "," var i, s,"," found = 0,"," subs = this._subscribers,"," afters = this._afters;",""," for (i = subs.length; i >= 0; i--) {"," s = subs[i];"," if (s && (!fn || fn === s.fn)) {"," this._delete(s, subs, i);"," found++;"," }"," }",""," for (i = afters.length; i >= 0; i--) {"," s = afters[i];"," if (s && (!fn || fn === s.fn)) {"," this._delete(s, afters, i);"," found++;"," }"," }",""," return found;"," },",""," /**"," * Detach listeners."," * @method unsubscribe"," * @param {Function} fn The subscribed function to remove, if not supplied"," * all will be removed."," * @param {Object} context The context object passed to subscribe."," * @return {int|undefined} returns the number of subscribers unsubscribed."," * @deprecated use detach."," */"," unsubscribe: function() {"," return this.detach.apply(this, arguments);"," },",""," /**"," * Notify a single subscriber"," * @method _notify"," * @param {Subscriber} s the subscriber."," * @param {Array} args the arguments array to apply to the listener."," * @protected"," */"," _notify: function(s, args, ef) {","",""," var ret;",""," ret = s.notify(args, this);",""," if (false === ret || this.stopped > 1) {"," return false;"," }",""," return true;"," },",""," /**"," * Logger abstraction to centralize the application of the silent flag"," * @method log"," * @param {string} msg message to log."," * @param {string} cat log category."," */"," log: function(msg, cat) {"," },",""," /**"," * Notifies the subscribers. The callback functions will be executed"," * from the context specified when the event was created, and with the"," * following parameters:"," * <ul>"," * <li>The type of event</li>"," * <li>All of the arguments fire() was executed with as an array</li>"," * <li>The custom object (if any) that was passed into the subscribe()"," * method</li>"," * </ul>"," * @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() {"," if (this.fireOnce && this.fired) {"," return true;"," } else {",""," var args = nativeSlice.call(arguments, 0);",""," // this doesn't happen if the event isn't published"," // this.host._monitor('fire', this.type, args);",""," this.fired = true;",""," if (this.fireOnce) {"," this.firedWith = args;"," }",""," if (this.emitFacade) {"," return this.fireComplex(args);"," } else {"," return this.fireSimple(args);"," }"," }"," },",""," /**"," * Set up for notifying subscribers of non-emitFacade events."," *"," * @method fireSimple"," * @param args {Array} Arguments passed to fire()"," * @return Boolean false if a subscriber returned false"," * @protected"," */"," fireSimple: function(args) {"," this.stopped = 0;"," this.prevented = 0;"," if (this.hasSubs()) {"," var subs = this.getSubs();"," this._procSubs(subs[0], args);"," this._procSubs(subs[1], args);"," }"," this._broadcast(args);"," return this.stopped ? false : true;"," },",""," // Requires the event-custom-complex module for full funcitonality."," fireComplex: function(args) {"," args[0] = args[0] || {};"," return this.fireSimple(args);"," },",""," /**"," * Notifies a list of subscribers."," *"," * @method _procSubs"," * @param subs {Array} List of subscribers"," * @param args {Array} Arguments passed to fire()"," * @param ef {}"," * @return Boolean false if a subscriber returns false or stops the event"," * propagation via e.stopPropagation(),"," * e.stopImmediatePropagation(), or e.halt()"," * @private"," */"," _procSubs: function(subs, args, ef) {"," var s, i, l;",""," for (i = 0, l = subs.length; i < l; i++) {"," s = subs[i];"," if (s && s.fn) {"," if (false === this._notify(s, args, ef)) {"," this.stopped = 2;"," }"," if (this.stopped == 2) {"," return false;"," }"," }"," }",""," return true;"," },",""," /**"," * Notifies the YUI instance if the event is configured with broadcast = 1,"," * and both the YUI instance and Y.Global if configured with broadcast = 2."," *"," * @method _broadcast"," * @param args {Array} Arguments sent to fire()"," * @private"," */"," _broadcast: function(args) {"," if (!this.stopped && this.broadcast) {",""," var a = args.concat();"," a.unshift(this.type);",""," if (this.host !== Y) {"," Y.fire.apply(Y, a);"," }",""," if (this.broadcast == 2) {"," Y.Global.fire.apply(Y.Global, a);"," }"," }"," },",""," /**"," * Removes all listeners"," * @method unsubscribeAll"," * @return {int} The number of listeners unsubscribed."," * @deprecated use detachAll."," */"," unsubscribeAll: function() {"," return this.detachAll.apply(this, arguments);"," },",""," /**"," * Removes all listeners"," * @method detachAll"," * @return {int} The number of listeners unsubscribed."," */"," detachAll: function() {"," return this.detach();"," },",""," /**"," * Deletes the subscriber from the internal store of on() and after()"," * subscribers."," *"," * @method _delete"," * @param s subscriber object."," * @param subs (optional) on or after subscriber array"," * @param index (optional) The index found."," * @private"," */"," _delete: function(s, subs, i) {"," var when = s._when;",""," if (!subs) {"," subs = (when === AFTER) ? this._afters : this._subscribers; "," i = YArray.indexOf(subs, s, 0);"," }",""," if (s && subs[i] === s) {"," subs.splice(i, 1);"," }",""," if (this._kds) {"," if (when === AFTER) {"," delete this.afters[s.id];"," } else {"," delete this.subscribers[s.id];"," }"," }",""," if (this.monitored && this.host) {"," this.host._monitor('detach', this, {"," ce: this,"," sub: s"," });"," }",""," if (s) {"," s.deleted = true;"," }"," }","};","/**"," * Stores the subscriber information to be used when the event fires."," * @param {Function} fn The wrapped function to execute."," * @param {Object} context The value of the keyword 'this' in the listener."," * @param {Array} args* 0..n additional arguments to supply the listener."," *"," * @class Subscriber"," * @constructor"," */","Y.Subscriber = function(fn, context, args, when) {",""," /**"," * The callback that will be execute when the event fires"," * This is wrapped by Y.rbind if obj was supplied."," * @property fn"," * @type Function"," */"," this.fn = fn;",""," /**"," * Optional 'this' keyword for the listener"," * @property context"," * @type Object"," */"," this.context = context;",""," /**"," * Unique subscriber id"," * @property id"," * @type String"," */"," this.id = Y.stamp(this);",""," /**"," * Additional arguments to propagate to the subscriber"," * @property args"," * @type Array"," */"," this.args = args;",""," this._when = when;",""," /**"," * Custom events for a given fire transaction."," * @property events"," * @type {EventTarget}"," */"," // this.events = null;",""," /**"," * This listener only reacts to the event once"," * @property once"," */"," // this.once = false;","","};","","Y.Subscriber.prototype = {"," constructor: Y.Subscriber,",""," _notify: function(c, args, ce) {"," if (this.deleted && !this.postponed) {"," if (this.postponed) {"," delete this.fn;"," delete this.context;"," } else {"," delete this.postponed;"," return null;"," }"," }"," var a = this.args, ret;"," switch (ce.signature) {"," case 0:"," ret = this.fn.call(c, ce.type, args, c);"," break;"," case 1:"," ret = this.fn.call(c, args[0] || null, c);"," break;"," default:"," if (a || args) {"," args = args || [];"," a = (a) ? args.concat(a) : args;"," ret = this.fn.apply(c, a);"," } else {"," ret = this.fn.call(c);"," }"," }",""," if (this.once) {"," ce._delete(this);"," }",""," return ret;"," },",""," /**"," * Executes the subscriber."," * @method notify"," * @param args {Array} Arguments array for the subscriber."," * @param ce {CustomEvent} The custom event that sent the notification."," */"," notify: function(args, ce) {"," var c = this.context,"," ret = true;",""," if (!c) {"," c = (ce.contextFn) ? ce.contextFn() : ce.context;"," }",""," // only catch errors if we will not re-throw them."," if (Y.config && Y.config.throwFail) {"," ret = this._notify(c, args, ce);"," } else {"," try {"," ret = this._notify(c, args, ce);"," } catch (e) {"," Y.error(this + ' failed: ' + e.message, e);"," }"," }",""," return ret;"," },",""," /**"," * 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} context optional 'this' keyword for the listener."," * @return {boolean} true if the supplied arguments match this"," * subscriber's signature."," */"," contains: function(fn, context) {"," if (context) {"," return ((this.fn == fn) && this.context == context);"," } else {"," return (this.fn == fn);"," }"," },"," "," valueOf : function() {"," return this.id;"," }","","};","/**"," * Return value from all subscribe operations"," * @class EventHandle"," * @constructor"," * @param {CustomEvent} evt the custom event."," * @param {Subscriber} sub the subscriber."," */","Y.EventHandle = function(evt, sub) {",""," /**"," * The custom event"," *"," * @property evt"," * @type CustomEvent"," */"," this.evt = evt;",""," /**"," * The subscriber object"," *"," * @property sub"," * @type Subscriber"," */"," this.sub = sub;","};","","Y.EventHandle.prototype = {"," batch: function(f, c) {"," f.call(c || this, this);"," if (Y.Lang.isArray(this.evt)) {"," Y.Array.each(this.evt, function(h) {"," h.batch.call(c || h, f);"," });"," }"," },",""," /**"," * Detaches this subscriber"," * @method detach"," * @return {int} the number of detached listeners"," */"," detach: function() {"," var evt = this.evt, detached = 0, i;"," if (evt) {"," if (Y.Lang.isArray(evt)) {"," for (i = 0; i < evt.length; i++) {"," detached += evt[i].detach();"," }"," } else {"," evt._delete(this.sub);"," detached = 1;"," }",""," }",""," return detached;"," },",""," /**"," * Monitor the event state for the subscribed event. The first parameter"," * is what should be monitored, the rest are the normal parameters when"," * subscribing to an event."," * @method monitor"," * @param what {string} what to monitor ('attach', 'detach', 'publish')."," * @return {EventHandle} return value from the monitor event subscription."," */"," monitor: function(what) {"," return this.evt.monitor.apply(this.evt, arguments);"," }","};","","/**"," * Custom event engine, DOM event listener abstraction layer, synthetic DOM"," * events."," * @module event-custom"," * @submodule event-custom-base"," */","","/**"," * EventTarget provides the implementation for any object to"," * publish, subscribe and fire to custom events, and also"," * alows other EventTargets to target the object with events"," * sourced from the other object."," * EventTarget is designed to be used with Y.augment to wrap"," * EventCustom in an interface that allows events to be listened 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 EventTarget"," * @param opts a configuration object"," * @config emitFacade {boolean} if true, all events will emit event"," * facade payloads by default (default false)"," * @config prefix {String} the prefix to apply to non-prefixed event names"," */","","var L = Y.Lang,"," PREFIX_DELIMITER = ':',"," CATEGORY_DELIMITER = '|',"," AFTER_PREFIX = '~AFTER~',"," WILD_TYPE_RE = /(.*?)(:)(.*?)/,",""," _wildType = Y.cached(function(type) {"," return type.replace(WILD_TYPE_RE, \"*$2$3\");"," }),",""," /**"," * If the instance has a prefix attribute and the"," * event type is not prefixed, the instance prefix is"," * applied to the supplied type."," * @method _getType"," * @private"," */"," _getType = Y.cached(function(type, pre) {",""," if (!pre || (typeof type !== \"string\") || type.indexOf(PREFIX_DELIMITER) > -1) {"," return type;"," }",""," return pre + PREFIX_DELIMITER + type;"," }),",""," /**"," * Returns an array with the detach key (if provided),"," * and the prefixed event name from _getType"," * Y.on('detachcategory| menu:click', fn)"," * @method _parseType"," * @private"," */"," _parseType = Y.cached(function(type, pre) {",""," var t = type, detachcategory, after, i;",""," if (!L.isString(t)) {"," return t;"," }",""," i = t.indexOf(AFTER_PREFIX);",""," if (i > -1) {"," after = true;"," t = t.substr(AFTER_PREFIX.length);"," }",""," i = t.indexOf(CATEGORY_DELIMITER);",""," if (i > -1) {"," detachcategory = t.substr(0, (i));"," t = t.substr(i+1);"," if (t == '*') {"," t = null;"," }"," }",""," // detach category, full type with instance prefix, is this an after listener, short type"," return [detachcategory, (pre) ? _getType(t, pre) : t, after, t];"," }),",""," ET = function(opts) {","",""," var o = (L.isObject(opts)) ? opts : {};",""," this._yuievt = this._yuievt || {",""," id: Y.guid(),",""," events: {},",""," targets: {},",""," config: o,",""," chain: ('chain' in o) ? o.chain : Y.config.chain,",""," bubbling: false,",""," defaults: {"," context: o.context || this,"," host: this,"," emitFacade: o.emitFacade,"," fireOnce: o.fireOnce,"," queuable: o.queuable,"," monitored: o.monitored,"," broadcast: o.broadcast,"," defaultTargetOnly: o.defaultTargetOnly,"," bubbles: ('bubbles' in o) ? o.bubbles : true"," }"," };"," };","","","ET.prototype = {"," constructor: ET,",""," /**"," * Listen to a custom event hosted by this object one time."," * This is the equivalent to <code>on</code> except the"," * listener is immediatelly detached when it is executed."," * @method once"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching the"," * subscription"," */"," once: function() {"," var handle = this.on.apply(this, arguments);"," handle.batch(function(hand) {"," if (hand.sub) {"," hand.sub.once = true;"," }"," });"," return handle;"," },",""," /**"," * Listen to a custom event hosted by this object one time."," * This is the equivalent to <code>after</code> except the"," * listener is immediatelly detached when it is executed."," * @method onceAfter"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," */"," onceAfter: function() {"," var handle = this.after.apply(this, arguments);"," handle.batch(function(hand) {"," if (hand.sub) {"," hand.sub.once = true;"," }"," });"," return handle;"," },",""," /**"," * Takes the type parameter passed to 'on' and parses out the"," * various pieces that could be included in the type. If the"," * event type is passed without a prefix, it will be expanded"," * to include the prefix one is supplied or the event target"," * is configured with a default prefix."," * @method parseType"," * @param {String} type the type"," * @param {String} [pre=this._yuievt.config.prefix] the prefix"," * @since 3.3.0"," * @return {Array} an array containing:"," * * the detach category, if supplied,"," * * the prefixed event type,"," * * whether or not this is an after listener,"," * * the supplied event type"," */"," parseType: function(type, pre) {"," return _parseType(type, pre || this._yuievt.config.prefix);"," },",""," /**"," * Subscribe a callback function to a custom event fired by this object or"," * from an object that bubbles its events to this object."," *"," * Callback functions for events published with `emitFacade = true` will"," * receive an `EventFacade` as the first argument (typically named \"e\")."," * These callbacks can then call `e.preventDefault()` to disable the"," * behavior published to that event's `defaultFn`. See the `EventFacade`"," * API for all available properties and methods. Subscribers to"," * non-`emitFacade` events will receive the arguments passed to `fire()`"," * after the event name."," *"," * To subscribe to multiple events at once, pass an object as the first"," * argument, where the key:value pairs correspond to the eventName:callback,"," * or pass an array of event names as the first argument to subscribe to"," * all listed events with the same callback."," *"," * Returning `false` from a callback is supported as an alternative to"," * calling `e.preventDefault(); e.stopPropagation();`. However, it is"," * recommended to use the event methods whenever possible."," *"," * @method on"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," */"," on: function(type, fn, context) {",""," var yuievt = this._yuievt,"," parts = _parseType(type, yuievt.config.prefix), f, c, args, ret, ce,"," detachcategory, handle, store = Y.Env.evt.handles, after, adapt, shorttype,"," Node = Y.Node, n, domevent, isArr;",""," // full name, args, detachcategory, after"," this._monitor('attach', parts[1], {"," args: arguments,"," category: parts[0],"," after: parts[2]"," });",""," if (L.isObject(type)) {",""," if (L.isFunction(type)) {"," return Y.Do.before.apply(Y.Do, arguments);"," }",""," f = fn;"," c = context;"," args = nativeSlice.call(arguments, 0);"," ret = [];",""," if (L.isArray(type)) {"," isArr = true;"," }",""," after = type._after;"," delete type._after;",""," Y.each(type, function(v, k) {",""," if (L.isObject(v)) {"," f = v.fn || ((L.isFunction(v)) ? v : f);"," c = v.context || c;"," }",""," var nv = (after) ? AFTER_PREFIX : '';",""," args[0] = nv + ((isArr) ? v : k);"," args[1] = f;"," args[2] = c;",""," ret.push(this.on.apply(this, args));",""," }, this);",""," return (yuievt.chain) ? this : new Y.EventHandle(ret);"," }",""," detachcategory = parts[0];"," after = parts[2];"," shorttype = parts[3];",""," // extra redirection so we catch adaptor events too. take a look at this."," if (Node && Y.instanceOf(this, Node) && (shorttype in Node.DOM_EVENTS)) {"," args = nativeSlice.call(arguments, 0);"," args.splice(2, 0, Node.getDOMNode(this));"," return Y.on.apply(Y, args);"," }",""," type = parts[1];",""," if (Y.instanceOf(this, YUI)) {",""," adapt = Y.Env.evt.plugins[type];"," args = nativeSlice.call(arguments, 0);"," args[0] = shorttype;",""," if (Node) {"," n = args[2];",""," if (Y.instanceOf(n, Y.NodeList)) {"," n = Y.NodeList.getDOMNodes(n);"," } else if (Y.instanceOf(n, Node)) {"," n = Node.getDOMNode(n);"," }",""," domevent = (shorttype in Node.DOM_EVENTS);",""," // Captures both DOM events and event plugins."," if (domevent) {"," args[2] = n;"," }"," }",""," // check for the existance of an event adaptor"," if (adapt) {"," handle = adapt.on.apply(Y, args);"," } else if ((!type) || domevent) {"," handle = Y.Event._attach(args);"," }",""," }",""," if (!handle) {"," ce = yuievt.events[type] || this.publish(type);"," handle = ce._on(fn, context, (arguments.length > 3) ? nativeSlice.call(arguments, 3) : null, (after) ? 'after' : true);"," }",""," if (detachcategory) {"," store[detachcategory] = store[detachcategory] || {};"," store[detachcategory][type] = store[detachcategory][type] || [];"," store[detachcategory][type].push(handle);"," }",""," return (yuievt.chain) ? this : handle;",""," },",""," /**"," * subscribe to an event"," * @method subscribe"," * @deprecated use on"," */"," subscribe: function() {"," return this.on.apply(this, arguments);"," },",""," /**"," * Detach one or more listeners the from the specified event"," * @method detach"," * @param type {string|Object} Either the handle to the subscriber or the"," * type of event. If the type"," * is not specified, it will attempt to remove"," * the listener from all hosted events."," * @param fn {Function} The subscribed function to unsubscribe, if not"," * supplied, all subscribers will be removed."," * @param context {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 {EventTarget} the host"," */"," detach: function(type, fn, context) {"," var evts = this._yuievt.events, i,"," Node = Y.Node, isNode = Node && (Y.instanceOf(this, Node));",""," // detachAll disabled on the Y instance."," if (!type && (this !== Y)) {"," for (i in evts) {"," if (evts.hasOwnProperty(i)) {"," evts[i].detach(fn, context);"," }"," }"," if (isNode) {"," Y.Event.purgeElement(Node.getDOMNode(this));"," }",""," return this;"," }",""," var parts = _parseType(type, this._yuievt.config.prefix),"," detachcategory = L.isArray(parts) ? parts[0] : null,"," shorttype = (parts) ? parts[3] : null,"," adapt, store = Y.Env.evt.handles, detachhost, cat, args,"," ce,",""," keyDetacher = function(lcat, ltype, host) {"," var handles = lcat[ltype], ce, i;"," if (handles) {"," for (i = handles.length - 1; i >= 0; --i) {"," ce = handles[i].evt;"," if (ce.host === host || ce.el === host) {"," handles[i].detach();"," }"," }"," }"," };",""," if (detachcategory) {",""," cat = store[detachcategory];"," type = parts[1];"," detachhost = (isNode) ? Y.Node.getDOMNode(this) : this;",""," if (cat) {"," if (type) {"," keyDetacher(cat, type, detachhost);"," } else {"," for (i in cat) {"," if (cat.hasOwnProperty(i)) {"," keyDetacher(cat, i, detachhost);"," }"," }"," }",""," return this;"," }",""," // If this is an event handle, use it to detach"," } else if (L.isObject(type) && type.detach) {"," type.detach();"," return this;"," // extra redirection so we catch adaptor events too. take a look at this."," } else if (isNode && ((!shorttype) || (shorttype in Node.DOM_EVENTS))) {"," args = nativeSlice.call(arguments, 0);"," args[2] = Node.getDOMNode(this);"," Y.detach.apply(Y, args);"," return this;"," }",""," adapt = Y.Env.evt.plugins[shorttype];",""," // The YUI instance handles DOM events and adaptors"," if (Y.instanceOf(this, YUI)) {"," args = nativeSlice.call(arguments, 0);"," // use the adaptor specific detach code if"," if (adapt && adapt.detach) {"," adapt.detach.apply(Y, args);"," return this;"," // DOM event fork"," } else if (!type || (!adapt && Node && (type in Node.DOM_EVENTS))) {"," args[0] = type;"," Y.Event.detach.apply(Y.Event, args);"," return this;"," }"," }",""," // ce = evts[type];"," ce = evts[parts[1]];"," if (ce) {"," ce.detach(fn, context);"," }",""," return this;"," },",""," /**"," * detach a listener"," * @method unsubscribe"," * @deprecated use detach"," */"," unsubscribe: function() {"," return this.detach.apply(this, arguments);"," },",""," /**"," * 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 detachAll"," * @param type {String} The type, or name of the event"," */"," detachAll: function(type) {"," return this.detach(type);"," },",""," /**"," * 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 type {String} The type, or name of the event"," * @deprecated use detachAll"," */"," unsubscribeAll: function() {"," return this.detachAll.apply(this, arguments);"," },",""," /**"," * 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 publish"," *"," * @param type {String} the type, or name of the event"," * @param opts {object} optional config params. Valid properties are:"," *"," * <ul>"," * <li>"," * 'broadcast': whether or not the YUI instance and YUI global are notified when the event is fired (false)"," * </li>"," * <li>"," * 'bubbles': whether or not this event bubbles (true)"," * Events can only bubble if emitFacade is true."," * </li>"," * <li>"," * 'context': the default execution context for the listeners (this)"," * </li>"," * <li>"," * 'defaultFn': the default function to execute when this event fires if preventDefault was not called"," * </li>"," * <li>"," * 'emitFacade': whether or not this event emits a facade (false)"," * </li>"," * <li>"," * 'prefix': the prefix for this targets events, e.g., 'menu' in 'menu:click'"," * </li>"," * <li>"," * 'fireOnce': if an event is configured to fire once, new subscribers after"," * the fire will be notified immediately."," * </li>"," * <li>"," * 'async': fireOnce event listeners will fire synchronously if the event has already"," * fired unless async is true."," * </li>"," * <li>"," * 'preventable': whether or not preventDefault() has an effect (true)"," * </li>"," * <li>"," * 'preventedFn': a function that is executed when preventDefault is called"," * </li>"," * <li>"," * 'queuable': whether or not this event can be queued during bubbling (false)"," * </li>"," * <li>"," * 'silent': if silent is true, debug messages are not provided for this event."," * </li>"," * <li>"," * 'stoppedFn': a function that is executed when stopPropagation is called"," * </li>"," *"," * <li>"," * 'monitored': specifies whether or not this event should send notifications about"," * when the event has been attached, detached, or published."," * </li>"," * <li>"," * 'type': the event type (valid option if not provided as the first parameter to publish)"," * </li>"," * </ul>"," *"," * @return {CustomEvent} the custom event"," *"," */"," publish: function(type, opts) {"," var events, ce, ret, defaults,"," edata = this._yuievt,"," pre = edata.config.prefix;",""," if (L.isObject(type)) {"," ret = {};"," Y.each(type, function(v, k) {"," ret[k] = this.publish(k, v || opts);"," }, this);",""," return ret;"," }",""," type = (pre) ? _getType(type, pre) : type;",""," events = edata.events;"," ce = events[type];",""," this._monitor('publish', type, {"," args: arguments"," });",""," if (ce) {"," // ce.log(\"publish applying new config to published event: '\"+type+\"' exists\", 'info', 'event');"," if (opts) {"," ce.applyConfig(opts, true);"," }"," } else {"," // TODO: Lazy publish goes here."," defaults = edata.defaults;",""," // apply defaults"," ce = new Y.CustomEvent(type, defaults);"," if (opts) {"," ce.applyConfig(opts, true);"," }",""," events[type] = ce;"," }",""," // make sure we turn the broadcast flag off if this"," // event was published as a result of bubbling"," // if (opts instanceof Y.CustomEvent) {"," // events[type].broadcast = false;"," // }",""," return events[type];"," },",""," /**"," * This is the entry point for the event monitoring system."," * You can monitor 'attach', 'detach', 'fire', and 'publish'."," * When configured, these events generate an event. click ->"," * click_attach, click_detach, click_publish -- these can"," * be subscribed to like other events to monitor the event"," * system. Inividual published events can have monitoring"," * turned on or off (publish can't be turned off before it"," * it published) by setting the events 'monitor' config."," *"," * @method _monitor"," * @param what {String} 'attach', 'detach', 'fire', or 'publish'"," * @param eventType {String|CustomEvent} The prefixed name of the event being monitored, or the CustomEvent object."," * @param o {Object} Information about the event interaction, such as"," * fire() args, subscription category, publish config"," * @private"," */"," _monitor: function(what, eventType, o) {"," var monitorevt, ce, type;",""," if (eventType) {"," if (typeof eventType === \"string\") {"," type = eventType;"," ce = this.getEvent(eventType, true);"," } else {"," ce = eventType;"," type = eventType.type;"," }",""," if ((this._yuievt.config.monitored && (!ce || ce.monitored)) || (ce && ce.monitored)) {"," monitorevt = type + '_' + what;"," o.monitored = what;"," this.fire.call(this, monitorevt, o);"," }"," }"," },",""," /**"," * Fire a custom event by name. The callback functions will be executed"," * from the context specified when the event was created, and with the"," * following parameters."," *"," * If the custom event object hasn't been created, then the event hasn't"," * been published and it has no subscribers. For performance sake, we"," * immediate exit in this case. This means the event won't bubble, so"," * if the intention is that a bubble target be notified, the event must"," * be published on this object first."," *"," * The first argument is the event type, and any additional arguments are"," * passed to the listeners as parameters. If the first of these is an"," * object literal, and the event is configured to emit an event facade,"," * that object is mixed into the event facade and the facade is provided"," * in place of the original object."," *"," * @method fire"," * @param type {String|Object} The type of the event, or an object that contains"," * a 'type' property."," * @param arguments {Object*} an arbitrary set of parameters to pass to"," * the handler. If the first of these is an object literal and the event is"," * configured to emit an event facade, the event facade will replace that"," * parameter after the properties the object literal contains are copied to"," * the event facade."," * @return {EventTarget} the event host"," */"," fire: function(type) {",""," var typeIncluded = L.isString(type),"," t = (typeIncluded) ? type : (type && type.type),"," yuievt = this._yuievt,"," pre = yuievt.config.prefix, "," ce, ret, "," ce2,"," args = (typeIncluded) ? nativeSlice.call(arguments, 1) : arguments;",""," t = (pre) ? _getType(t, pre) : t;",""," ce = this.getEvent(t, true);"," ce2 = this.getSibling(t, ce);",""," if (ce2 && !ce) {"," ce = this.publish(t);"," }",""," this._monitor('fire', (ce || t), {"," args: args"," });",""," // this event has not been published or subscribed to"," if (!ce) {"," if (yuievt.hasTargets) {"," return this.bubble({ type: t }, args, this);"," }",""," // otherwise there is nothing to be done"," ret = true;"," } else {"," ce.sibling = ce2;"," ret = ce.fire.apply(ce, args);"," }",""," return (yuievt.chain) ? this : ret;"," },",""," getSibling: function(type, ce) {"," var ce2;"," // delegate to *:type events if there are subscribers"," if (type.indexOf(PREFIX_DELIMITER) > -1) {"," type = _wildType(type);"," // console.log(type);"," ce2 = this.getEvent(type, true);"," if (ce2) {"," // console.log(\"GOT ONE: \" + type);"," ce2.applyConfig(ce);"," ce2.bubbles = false;"," ce2.broadcast = 0;"," // ret = ce2.fire.apply(ce2, a);"," }"," }",""," return ce2;"," },",""," /**"," * Returns the custom event of the provided type has been created, a"," * falsy value otherwise"," * @method getEvent"," * @param type {String} the type, or name of the event"," * @param prefixed {String} if true, the type is prefixed already"," * @return {CustomEvent} the custom event or null"," */"," getEvent: function(type, prefixed) {"," var pre, e;"," if (!prefixed) {"," pre = this._yuievt.config.prefix;"," type = (pre) ? _getType(type, pre) : type;"," }"," e = this._yuievt.events;"," return e[type] || null;"," },",""," /**"," * Subscribe to a custom event hosted by this object. The"," * supplied callback will execute after any listeners add"," * via the subscribe method, and after the default function,"," * if configured for the event, has executed."," *"," * @method after"," * @param {String} type The name of the event"," * @param {Function} fn The callback to execute in response to the event"," * @param {Object} [context] Override `this` object in callback"," * @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," * @return {EventHandle} A subscription handle capable of detaching the"," * subscription"," */"," after: function(type, fn) {",""," var a = nativeSlice.call(arguments, 0);",""," switch (L.type(type)) {"," case 'function':"," return Y.Do.after.apply(Y.Do, arguments);"," case 'array':"," // YArray.each(a[0], function(v) {"," // v = AFTER_PREFIX + v;"," // });"," // break;"," case 'object':"," a[0]._after = true;"," break;"," default:"," a[0] = AFTER_PREFIX + type;"," }",""," return this.on.apply(this, a);",""," },",""," /**"," * Executes the callback before a DOM event, custom event"," * or method. If the first argument is a function, it"," * is assumed the target is a method. For DOM and custom"," * events, this is an alias for Y.on."," *"," * For DOM and custom events:"," * type, callback, context, 0-n arguments"," *"," * For methods:"," * callback, object (method host), methodName, context, 0-n arguments"," *"," * @method before"," * @return detach handle"," */"," before: function() {"," return this.on.apply(this, arguments);"," }","","};","","Y.EventTarget = ET;","","// make Y an event target","Y.mix(Y, ET.prototype);","ET.call(Y, { bubbles: false });","","YUI.Env.globalEvents = YUI.Env.globalEvents || new ET();","","/**"," * Hosts YUI page level events. This is where events bubble to"," * when the broadcast config is set to 2. This property is"," * only available if the custom event module is loaded."," * @property Global"," * @type EventTarget"," * @for YUI"," */","Y.Global = YUI.Env.globalEvents;","","// @TODO implement a global namespace function on Y.Global?","","/**","`Y.on()` can do many things:","","<ul>"," <li>Subscribe to custom events `publish`ed and `fire`d from Y</li>"," <li>Subscribe to custom events `publish`ed with `broadcast` 1 or 2 and"," `fire`d from any object in the YUI instance sandbox</li>"," <li>Subscribe to DOM events</li>"," <li>Subscribe to the execution of a method on any object, effectively"," treating that method as an event</li>","</ul>","","For custom event subscriptions, pass the custom event name as the first argument and callback as the second. The `this` object in the callback will be `Y` unless an override is passed as the third argument.",""," Y.on('io:complete', function () {"," Y.MyApp.updateStatus('Transaction complete');"," });","","To subscribe to DOM events, pass the name of a DOM event as the first argument","and a CSS selector string as the third argument after the callback function.","Alternately, the third argument can be a `Node`, `NodeList`, `HTMLElement`,","array, or simply omitted (the default is the `window` object).",""," Y.on('click', function (e) {"," e.preventDefault();",""," // proceed with ajax form submission"," var url = this.get('action');"," ..."," }, '#my-form');","","The `this` object in DOM event callbacks will be the `Node` targeted by the CSS","selector or other identifier.","","`on()` subscribers for DOM events or custom events `publish`ed with a","`defaultFn` can prevent the default behavior with `e.preventDefault()` from the","event object passed as the first parameter to the subscription callback.","","To subscribe to the execution of an object method, pass arguments corresponding to the call signature for ","<a href=\"../classes/Do.html#methods_before\">`Y.Do.before(...)`</a>.","","NOTE: The formal parameter list below is for events, not for function","injection. See `Y.Do.before` for that signature.","","@method on","@param {String} type DOM or custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@see Do.before","@for YUI","**/","","/**","Listen for an event one time. Equivalent to `on()`, except that","the listener is immediately detached when executed.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","@see on","@method once","@param {String} type DOM or custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","/**","Listen for an event one time. Equivalent to `once()`, except, like `after()`,","the subscription callback executes after all `on()` subscribers and the event's","`defaultFn` (if configured) have executed. Like `after()` if any `on()` phase","subscriber calls `e.preventDefault()`, neither the `defaultFn` nor the `after()`","subscribers will execute.","","The listener is immediately detached when executed.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","@see once","@method onceAfter","@param {String} type The custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","/**","Like `on()`, this method creates a subscription to a custom event or to the","execution of a method on an object.","","For events, `after()` subscribers are executed after the event's","`defaultFn` unless `e.preventDefault()` was called from an `on()` subscriber.","","See the <a href=\"#methods_on\">`on()` method</a> for additional subscription","options.","","NOTE: The subscription signature shown is for events, not for function","injection. See <a href=\"../classes/Do.html#methods_after\">`Y.Do.after`</a>","for that signature.","","@see on","@see Do.after","@method after","@param {String} type The custom event name","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [args*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching the"," subscription","@for YUI","**/","","","}, '3.7.3', {\"requires\": [\"oop\"]});"]; _yuitest_coverage["build/event-custom-base/event-custom-base.js"].lines = {"1":0,"9":0,"29":0,"76":0,"77":0,"78":0,"79":0,"82":0,"113":0,"114":0,"115":0,"116":0,"119":0,"138":0,"140":0,"142":0,"145":0,"147":0,"149":0,"152":0,"153":0,"158":0,"161":0,"163":0,"174":0,"175":0,"183":0,"215":0,"216":0,"217":0,"218":0,"219":0,"220":0,"230":0,"231":0,"232":0,"234":0,"245":0,"246":0,"247":0,"264":0,"266":0,"273":0,"274":0,"275":0,"276":0,"277":0,"279":0,"281":0,"282":0,"284":0,"285":0,"293":0,"294":0,"297":0,"298":0,"301":0,"302":0,"303":0,"305":0,"306":0,"308":0,"309":0,"311":0,"316":0,"332":0,"333":0,"334":0,"346":0,"347":0,"348":0,"361":0,"362":0,"363":0,"374":0,"375":0,"388":0,"405":0,"439":0,"441":0,"442":0,"443":0,"447":0,"460":0,"462":0,"464":0,"466":0,"473":0,"481":0,"491":0,"509":0,"527":0,"528":0,"537":0,"544":0,"545":0,"554":0,"651":0,"663":0,"672":0,"689":0,"717":0,"719":0,"721":0,"733":0,"735":0,"736":0,"737":0,"740":0,"741":0,"744":0,"756":0,"757":0,"759":0,"760":0,"769":0,"771":0,"772":0,"774":0,"785":0,"804":0,"806":0,"807":0,"808":0,"810":0,"814":0,"815":0,"817":0,"820":0,"821":0,"822":0,"824":0,"828":0,"839":0,"840":0,"853":0,"855":0,"856":0,"860":0,"875":0,"876":0,"889":0,"890":0,"893":0,"898":0,"899":0,"900":0,"901":0,"902":0,"906":0,"907":0,"908":0,"909":0,"910":0,"914":0,"927":0,"940":0,"942":0,"944":0,"945":0,"948":0,"978":0,"979":0,"982":0,"987":0,"989":0,"990":0,"993":0,"994":0,"996":0,"1010":0,"1011":0,"1012":0,"1013":0,"1014":0,"1015":0,"1017":0,"1018":0,"1023":0,"1024":0,"1040":0,"1042":0,"1043":0,"1044":0,"1045":0,"1046":0,"1048":0,"1049":0,"1054":0,"1066":0,"1068":0,"1069":0,"1071":0,"1072":0,"1075":0,"1076":0,"1088":0,"1097":0,"1111":0,"1113":0,"1114":0,"1115":0,"1118":0,"1119":0,"1122":0,"1123":0,"1124":0,"1126":0,"1130":0,"1131":0,"1137":0,"1138":0,"1151":0,"1159":0,"1166":0,"1173":0,"1180":0,"1182":0,"1199":0,"1203":0,"1204":0,"1205":0,"1206":0,"1208":0,"1209":0,"1212":0,"1213":0,"1215":0,"1216":0,"1218":0,"1219":0,"1221":0,"1222":0,"1223":0,"1224":0,"1226":0,"1230":0,"1231":0,"1234":0,"1244":0,"1247":0,"1248":0,"1252":0,"1253":0,"1255":0,"1256":0,"1258":0,"1262":0,"1276":0,"1277":0,"1279":0,"1284":0,"1295":0,"1303":0,"1311":0,"1314":0,"1316":0,"1317":0,"1318":0,"1319":0,"1330":0,"1331":0,"1332":0,"1333":0,"1334":0,"1337":0,"1338":0,"1343":0,"1355":0,"1383":0,"1390":0,"1402":0,"1403":0,"1406":0,"1418":0,"1420":0,"1421":0,"1424":0,"1426":0,"1427":0,"1428":0,"1431":0,"1433":0,"1434":0,"1435":0,"1436":0,"1437":0,"1442":0,"1448":0,"1450":0,"1479":0,"1495":0,"1496":0,"1497":0,"1498":0,"1501":0,"1517":0,"1518":0,"1519":0,"1520":0,"1523":0,"1543":0,"1577":0,"1583":0,"1589":0,"1591":0,"1592":0,"1595":0,"1596":0,"1597":0,"1598":0,"1600":0,"1601":0,"1604":0,"1605":0,"1607":0,"1609":0,"1610":0,"1611":0,"1614":0,"1616":0,"1617":0,"1618":0,"1620":0,"1624":0,"1627":0,"1628":0,"1629":0,"1632":0,"1633":0,"1634":0,"1635":0,"1638":0,"1640":0,"1642":0,"1643":0,"1644":0,"1646":0,"1647":0,"1649":0,"1650":0,"1651":0,"1652":0,"1655":0,"1658":0,"1659":0,"1664":0,"1665":0,"1666":0,"1667":0,"1672":0,"1673":0,"1674":0,"1677":0,"1678":0,"1679":0,"1680":0,"1683":0,"1693":0,"1713":0,"1717":0,"1718":0,"1719":0,"1720":0,"1723":0,"1724":0,"1727":0,"1730":0,"1737":0,"1738":0,"1739":0,"1740":0,"1741":0,"1742":0,"1748":0,"1750":0,"1751":0,"1752":0,"1754":0,"1755":0,"1756":0,"1758":0,"1759":0,"1760":0,"1765":0,"1769":0,"1770":0,"1771":0,"1773":0,"1774":0,"1775":0,"1776":0,"1777":0,"1780":0,"1783":0,"1784":0,"1786":0,"1787":0,"1788":0,"1790":0,"1791":0,"1792":0,"1793":0,"1798":0,"1799":0,"1800":0,"1803":0,"1812":0,"1823":0,"1835":0,"1905":0,"1909":0,"1910":0,"1911":0,"1912":0,"1915":0,"1918":0,"1920":0,"1921":0,"1923":0,"1927":0,"1929":0,"1930":0,"1934":0,"1937":0,"1938":0,"1939":0,"1942":0,"1951":0,"1972":0,"1974":0,"1975":0,"1976":0,"1977":0,"1979":0,"1980":0,"1983":0,"1984":0,"1985":0,"1986":0,"2020":0,"2028":0,"2030":0,"2031":0,"2033":0,"2034":0,"2037":0,"2042":0,"2043":0,"2044":0,"2048":0,"2050":0,"2051":0,"2054":0,"2058":0,"2060":0,"2061":0,"2063":0,"2064":0,"2066":0,"2067":0,"2068":0,"2073":0,"2085":0,"2086":0,"2087":0,"2088":0,"2090":0,"2091":0,"2110":0,"2112":0,"2114":0,"2121":0,"2122":0,"2124":0,"2127":0,"2147":0,"2152":0,"2155":0,"2156":0,"2158":0,"2168":0}; _yuitest_coverage["build/event-custom-base/event-custom-base.js"].functions = {"before:75":0,"after:112":0,"]:152":0,"_inject:136":0,"detach:173":0,"Method:215":0,"register:230":0,"_delete:245":0,"exec:264":0,"AlterArgs:332":0,"AlterReturn:346":0,"Halt:361":0,"Prevent:374":0,"mixConfigs:438":0,"CustomEvent:460":0,"hasSubs:732":0,"monitor:755":0,"getSubs:768":0,"applyConfig:784":0,"_on:801":0,"subscribe:838":0,"on:852":0,"after:874":0,"detach:887":0,"unsubscribe:926":0,"_notify:937":0,"fire:977":0,"fireSimple:1009":0,"fireComplex:1022":0,"_procSubs:1039":0,"_broadcast:1065":0,"unsubscribeAll:1087":0,"detachAll:1096":0,"_delete:1110":0,"Subscriber:1151":0,"_notify:1202":0,"notify:1243":0,"contains:1275":0,"valueOf:1283":0,"EventHandle:1295":0,"(anonymous 2):1318":0,"batch:1315":0,"detach:1329":0,"monitor:1354":0,"(anonymous 3):1389":0,"(anonymous 4):1400":0,"(anonymous 5):1416":0,"ET:1445":0,"(anonymous 6):1496":0,"once:1494":0,"(anonymous 7):1518":0,"onceAfter:1516":0,"parseType:1542":0,"(anonymous 8):1607":0,"on:1575":0,"subscribe:1692":0,"keyDetacher:1736":0,"detach:1712":0,"unsubscribe:1811":0,"detachAll:1822":0,"unsubscribeAll:1834":0,"(anonymous 9):1911":0,"publish:1904":0,"_monitor:1971":0,"fire:2018":0,"getSibling:2057":0,"getEvent:2084":0,"after:2108":0,"before:2146":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-custom-base/event-custom-base.js"].coveredLines = 482;@@ -2883,4 +2883,4 @@ **/ -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/event-custom-base/event-custom-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -2316,4 +2316,4 @@ **/ -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/event-custom-base/event-custom-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-custom-base",function(e,t){e.Env.evt={handles:{},plugins:{}};var n=0,r=1,i={objs:null,before:function(t,r,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(n,o,r,i)},after:function(t,n,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(r,o,n,i)},_inject:function(t,n,r,i){var s=e.stamp(r),o,u;return r._yuiaop||(r._yuiaop={}),o=r._yuiaop,o[i]||(o[i]=new e.Do.Method(r,i),r[i]=function(){return o[i].exec.apply(o[i],arguments)}),u=s+e.stamp(n)+i,o[i].register(u,n,t),new e.EventHandle(o[i],u)},detach:function(e){e.detach&&e.detach()},_unload:function(e,t){}};e.Do=i,i.Method=function(e,t){this.obj=e,this.methodName=t,this.method=e[t],this.before={},this.after={}},i.Method.prototype.register=function(e,t,n){n?this.after[e]=t:this.before[e]=t},i.Method.prototype._delete=function(e){delete this.before[e],delete this.after[e]},i.Method.prototype.exec=function(){var t=e.Array(arguments,0,!0),n,r,s,o=this.before,u=this.after,a=!1;for(n in o)if(o.hasOwnProperty(n)){r=o[n].apply(this.obj,t);if(r)switch(r.constructor){case i.Halt:return r.retVal;case i.AlterArgs:t=r.newArgs;break;case i.Prevent:a=!0;break;default:}}a||(r=this.method.apply(this.obj,t)),i.originalRetVal=r,i.currentRetVal=r;for(n in u)if(u.hasOwnProperty(n)){s=u[n].apply(this.obj,t);if(s&&s.constructor==i.Halt)return s.retVal;s&&s.constructor==i.AlterReturn&&(r=s.newRetVal,i.currentRetVal=r)}return r},i.AlterArgs=function(e,t){this.msg=e,this.newArgs=t},i.AlterReturn=function(e,t){this.msg=e,this.newRetVal=t},i.Halt=function(e,t){this.msg=e,this.retVal=t},i.Prevent=function(e){this.msg=e},i.Error=i.Halt;var s=e.Array,o="after",u=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],a=s.hash(u),f=Array.prototype.slice,l=9,c="yui:log",h=function(e,t,n){var r;for(r in t)a[r]&&(n||!(r in e))&&(e[r]=t[r]);return e};e.CustomEvent=function(t,n){this._kds=e.CustomEvent.keepDeprecatedSubs,n=n||{},this.id=e.stamp(this),this.type=t,this.context=e,this.logSystem=t==c,this.silent=this.logSystem,this._kds&&(this.subscribers={}),this._subscribers=[],this._kds&&(this.afters={}),this._afters=[],this.preventable=!0,this.bubbles=!0,this.signature=l,this.applyConfig(n,!0)},e.CustomEvent.keepDeprecatedSubs=!1,e.CustomEvent.mixConfigs=h,e.CustomEvent.prototype={constructor:e.CustomEvent,hasSubs:function(e){var t=this._subscribers.length,n=this._afters.length,r=this.sibling;return r&&(t+=r._subscribers.length,n+=r._afters.length),e?e=="after"?n:t:t+n},monitor:function(e){this.monitored=!0;var t=this.id+"|"+this.type+"_"+e,n=f.call(arguments,0);return n[0]=t,this.host.on.apply(this.host,n)},getSubs:function(){var e=this._subscribers,t=this._afters,n=this.sibling;return e=n?e.concat(n._subscribers):e.concat(),t=n?t.concat(n._afters):t.concat(),[e,t]},applyConfig:function(e,t){h(this,e,t)},_on:function(t,n,r,i){var s=new e.Subscriber(t,n,r,i);return this.fireOnce&&this.fired&&(this.async?setTimeout(e.bind(this._notify,this,s,this.firedWith),0):this._notify(s,this.firedWith)),i==o?this._afters.push(s):this._subscribers.push(s),this._kds&&(i==o?this.afters[s.id]=s:this.subscribers[s.id]=s),new e.EventHandle(this,s)},subscribe:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,!0)},on:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this.monitored&&this.host&&this.host._monitor("attach",this,{args:arguments}),this._on(e,t,n,!0)},after:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,o)},detach:function(e,t){if(e&&e.detach)return e.detach();var n,r,i=0,s=this._subscribers,o=this._afters;for(n=s.length;n>=0;n--)r=s[n],r&&(!e||e===r.fn)&&(this._delete(r,s,n),i++);for(n=o.length;n>=0;n--)r=o[n],r&&(!e||e===r.fn)&&(this._delete(r,o,n),i++);return i},unsubscribe:function(){return this.detach.apply(this,arguments)},_notify:function(e,t,n){var r;return r=e.notify(t,this),!1===r||this.stopped>1?!1:!0},log:function(e,t){},fire:function(){if(this.fireOnce&&this.fired)return!0;var e=f.call(arguments,0);return this.fired=!0,this.fireOnce&&(this.firedWith=e),this.emitFacade?this.fireComplex(e):this.fireSimple(e)},fireSimple:function(e){this.stopped=0,this.prevented=0;if(this.hasSubs()){var t=this.getSubs();this._procSubs(t[0],e),this._procSubs(t[1],e)}return this._broadcast(e),this.stopped?!1:!0},fireComplex:function(e){return e[0]=e[0]||{},this.fireSimple(e)},_procSubs:function(e,t,n){var r,i,s;for(i=0,s=e.length;i<s;i++){r=e[i];if(r&&r.fn){!1===this._notify(r,t,n)&&(this.stopped=2);if(this.stopped==2)return!1}}return!0},_broadcast:function(t){if(!this.stopped&&this.broadcast){var n=t.concat();n.unshift(this.type),this.host!==e&&e.fire.apply(e,n),this.broadcast==2&&e.Global.fire.apply(e.Global,n)}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},detachAll:function(){return this.detach()},_delete:function(e,t,n){var r=e._when;t||(t=r===o?this._afters:this._subscribers,n=s.indexOf(t,e,0)),e&&t[n]===e&&t.splice(n,1),this._kds&&(r===o?delete this.afters[e.id]:delete this.subscribers[e.id]),this.monitored&&this.host&&this.host._monitor("detach",this,{ce:this,sub:e}),e&&(e.deleted=!0)}},e.Subscriber=function(t,n,r,i){this.fn=t,this.context=n,this.id=e.stamp(this),this.args=r,this._when=i},e.Subscriber.prototype={constructor:e.Subscriber,_notify:function(e,t,n){if(this.deleted&&!this.postponed){if(!this.postponed)return delete this.postponed,null;delete this.fn,delete this.context}var r=this.args,i;switch(n.signature){case 0:i=this.fn.call(e,n.type,t,e);break;case 1:i=this.fn.call(e,t[0]||null,e);break;default:r||t?(t=t||[],r=r?t.concat(r):t,i=this.fn.apply(e,r)):i=this.fn.call(e)}return this.once&&n._delete(this),i},notify:function(t,n){var r=this.context,i=!0;r||(r=n.contextFn?n.contextFn():n.context);if(e.config&&e.config.throwFail)i=this._notify(r,t,n);else try{i=this._notify(r,t,n)}catch(s){e.error(this+" failed: "+s.message,s)}return i},contains:function(e,t){return t?this.fn==e&&this.context==t:this.fn==e},valueOf:function(){return this.id}},e.EventHandle=function(e,t){this.evt=e,this.sub=t},e.EventHandle.prototype={batch:function(t,n){t.call(n||this,this),e.Lang.isArray(this.evt)&&e.Array.each(this.evt,function(e){e.batch.call(n||e,t)})},detach:function(){var t=this.evt,n=0,r;if(t)if(e.Lang.isArray(t))for(r=0;r<t.length;r++)n+=t[r].detach();else t._delete(this.sub),n=1;return n},monitor:function(e){return this.evt.monitor.apply(this.evt,arguments)}};var p=e.Lang,d=":",v="|",m="~AFTER~",g=/(.*?)(:)(.*?)/,y=e.cached(function(e){return e.replace(g,"*$2$3")}),b=e.cached(function(e,t){return!t||typeof e!="string"||e.indexOf(d)>-1?e:t+d+e}),w=e.cached(function(e,t){var n=e,r,i,s;return p.isString(n)?(s=n.indexOf(m),s>-1&&(i=!0,n=n.substr(m.length)),s=n.indexOf(v),s>-1&&(r=n.substr(0,s),n=n.substr(s+1),n=="*"&&(n=null)),[r,t?b(n,t):n,i,n]):n}),E=function(t){var n=p.isObject(t)?t:{};this._yuievt=this._yuievt||{id:e.guid(),events:{},targets:{},config:n,chain:"chain"in n?n.chain:e.config.chain,bubbling:!1,defaults:{context:n.context||this,host:this,emitFacade:n.emitFacade,fireOnce:n.fireOnce,queuable:n.queuable,monitored:n.monitored,broadcast:n.broadcast,defaultTargetOnly:n.defaultTargetOnly,bubbles:"bubbles"in n?n.bubbles:!0}}};E.prototype={constructor:E,once:function(){var e=this.on.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},onceAfter:function(){var e=this.after.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},parseType:function(e,t){return w(e,t||this._yuievt.config.prefix)},on:function(t,n,r){var i=this._yuievt,s=w(t,i.config.prefix),o,u,a,l,c,h,d,v=e.Env.evt.handles,g,y,b,E=e.Node,S,x,T;this._monitor("attach",s[1],{args:arguments,category:s[0],after:s[2]});if(p.isObject(t))return p.isFunction(t)?e.Do.before.apply(e.Do,arguments):(o=n,u=r,a=f.call(arguments,0),l=[],p.isArray(t)&&(T=!0),g=t._after,delete t._after,e.each(t,function(e,t){p.isObject(e)&&(o=e.fn||(p.isFunction(e)?e:o),u=e.context||u);var n=g?m:"";a[0]=n+(T?e:t),a[1]=o,a[2]=u,l.push(this.on.apply(this,a))},this),i.chain?this:new e.EventHandle(l));h=s[0],g=s[2],b=s[3];if(E&&e.instanceOf(this,E)&&b in E.DOM_EVENTS)return a=f.call(arguments,0),a.splice(2,0,E.getDOMNode(this)),e.on.apply(e,a);t=s[1];if(e.instanceOf(this,YUI)){y=e.Env.evt.plugins[t],a=f.call(arguments,0),a[0]=b,E&&(S=a[2],e.instanceOf(S,e.NodeList)?S=e.NodeList.getDOMNodes(S):e.instanceOf(S,E)&&(S=E.getDOMNode(S)),x=b in E.DOM_EVENTS,x&&(a[2]=S));if(y)d=y.on.apply(e,a);else if(!t||x)d=e.Event._attach(a)}return d||(c=i.events[t]||this.publish(t),d=c._on(n,r,arguments.length>3?f.call(arguments,3):null,g?"after":!0)),h&&(v[h]=v[h]||{},v[h][t]=v[h][t]||[],v[h][t].push(d)),i.chain?this:d},subscribe:function(){return this.on.apply(this,arguments)},detach:function(t,n,r){var i=this._yuievt.events,s,o=e.Node,u=o&&e.instanceOf(this,o);if(!t&&this!==e){for(s in i)i.hasOwnProperty(s)&&i[s].detach(n,r);return u&&e.Event.purgeElement(o.getDOMNode(this)),this}var a=w(t,this._yuievt.config.prefix),l=p.isArray(a)?a[0]:null,c=a?a[3]:null,h,d=e.Env.evt.handles,v,m,g,y,b=function(e,t,n){var r=e[t],i,s;if(r)for(s=r.length-1;s>=0;--s)i=r[s].evt,(i.host===n||i.el===n)&&r[s].detach()};if(l){m=d[l],t=a[1],v=u?e.Node.getDOMNode(this):this;if(m){if(t)b(m,t,v);else for(s in m)m.hasOwnProperty(s)&&b(m,s,v);return this}}else{if(p.isObject(t)&&t.detach)return t.detach(),this;if(u&&(!c||c in o.DOM_EVENTS))return g=f.call(arguments,0),g[2]=o.getDOMNode(this),e.detach.apply(e,g),this}h=e.Env.evt.plugins[c];if(e.instanceOf(this,YUI)){g=f.call(arguments,0);if(h&&h.detach)return h.detach.apply(e,g),this;if(!t||!h&&o&&t in o.DOM_EVENTS)return g[0]=t,e.Event.detach.apply(e.Event,g),this}return y=i[a[1]],y&&y.detach(n,r),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(e){return this.detach(e)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(t,n){var r,i,s,o,u=this._yuievt,a=u.config.prefix;return p.isObject(t)?(s={},e.each(t,function(e,t){s[t]=this.publish(t,e||n)},this),s):(t=a?b(t,a):t,r=u.events,i=r[t],this._monitor("publish",t,{args:arguments}),i?n&&i.applyConfig(n,!0):(o=u.defaults,i=new e.CustomEvent(t,o),n&&i.applyConfig(n,!0),r[t]=i),r[t])},_monitor:function(e,t,n){var r,i,s;if(t){typeof t=="string"?(s=t,i=this.getEvent(t,!0)):(i=t,s=t.type);if(this._yuievt.config.monitored&&(!i||i.monitored)||i&&i.monitored)r=s+"_"+e,n.monitored=e,this.fire.call(this,r,n)}},fire:function(e){var t=p.isString(e),n=t?e:e&&e.type,r=this._yuievt,i=r.config.prefix,s,o,u,a=t?f.call(arguments,1):arguments;n=i?b(n,i):n,s=this.getEvent(n,!0),u=this.getSibling(n,s),u&&!s&&(s=this.publish(n)),this._monitor("fire",s||n,{args:a});if(!s){if(r.hasTargets)return this.bubble({type:n},a,this);o=!0}else s.sibling=u,o=s.fire.apply(s,a);return r.chain?this:o},getSibling:function(e,t){var n;return e.indexOf(d)>-1&&(e=y(e),n=this.getEvent(e,!0),n&&(n.applyConfig(t),n.bubbles=!1,n.broadcast=0)),n},getEvent:function(e,t){var n,r;return t||(n=this._yuievt.config.prefix,e=n?b(e,n):e),r=this._yuievt.events,r[e]||null},after:function(t,n){var r=f.call(arguments,0);switch(p.type(t)){case"function":return e.Do.after.apply(e.Do,arguments);case"array":case"object":r[0]._after=!0;break;default:r[0]=m+t}return this.on.apply(this,r)},before:function(){return this.on.apply(this,arguments)}},e.EventTarget=E,e.mix(e,E.prototype),E.call(e,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new E,e.Global=YUI.Env.globalEvents},"3.7.2",{requires:["oop"]});+YUI.add("event-custom-base",function(e,t){e.Env.evt={handles:{},plugins:{}};var n=0,r=1,i={objs:null,before:function(t,r,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(n,o,r,i)},after:function(t,n,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(r,o,n,i)},_inject:function(t,n,r,i){var s=e.stamp(r),o,u;return r._yuiaop||(r._yuiaop={}),o=r._yuiaop,o[i]||(o[i]=new e.Do.Method(r,i),r[i]=function(){return o[i].exec.apply(o[i],arguments)}),u=s+e.stamp(n)+i,o[i].register(u,n,t),new e.EventHandle(o[i],u)},detach:function(e){e.detach&&e.detach()},_unload:function(e,t){}};e.Do=i,i.Method=function(e,t){this.obj=e,this.methodName=t,this.method=e[t],this.before={},this.after={}},i.Method.prototype.register=function(e,t,n){n?this.after[e]=t:this.before[e]=t},i.Method.prototype._delete=function(e){delete this.before[e],delete this.after[e]},i.Method.prototype.exec=function(){var t=e.Array(arguments,0,!0),n,r,s,o=this.before,u=this.after,a=!1;for(n in o)if(o.hasOwnProperty(n)){r=o[n].apply(this.obj,t);if(r)switch(r.constructor){case i.Halt:return r.retVal;case i.AlterArgs:t=r.newArgs;break;case i.Prevent:a=!0;break;default:}}a||(r=this.method.apply(this.obj,t)),i.originalRetVal=r,i.currentRetVal=r;for(n in u)if(u.hasOwnProperty(n)){s=u[n].apply(this.obj,t);if(s&&s.constructor==i.Halt)return s.retVal;s&&s.constructor==i.AlterReturn&&(r=s.newRetVal,i.currentRetVal=r)}return r},i.AlterArgs=function(e,t){this.msg=e,this.newArgs=t},i.AlterReturn=function(e,t){this.msg=e,this.newRetVal=t},i.Halt=function(e,t){this.msg=e,this.retVal=t},i.Prevent=function(e){this.msg=e},i.Error=i.Halt;var s=e.Array,o="after",u=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],a=s.hash(u),f=Array.prototype.slice,l=9,c="yui:log",h=function(e,t,n){var r;for(r in t)a[r]&&(n||!(r in e))&&(e[r]=t[r]);return e};e.CustomEvent=function(t,n){this._kds=e.CustomEvent.keepDeprecatedSubs,n=n||{},this.id=e.stamp(this),this.type=t,this.context=e,this.logSystem=t==c,this.silent=this.logSystem,this._kds&&(this.subscribers={}),this._subscribers=[],this._kds&&(this.afters={}),this._afters=[],this.preventable=!0,this.bubbles=!0,this.signature=l,this.applyConfig(n,!0)},e.CustomEvent.keepDeprecatedSubs=!1,e.CustomEvent.mixConfigs=h,e.CustomEvent.prototype={constructor:e.CustomEvent,hasSubs:function(e){var t=this._subscribers.length,n=this._afters.length,r=this.sibling;return r&&(t+=r._subscribers.length,n+=r._afters.length),e?e=="after"?n:t:t+n},monitor:function(e){this.monitored=!0;var t=this.id+"|"+this.type+"_"+e,n=f.call(arguments,0);return n[0]=t,this.host.on.apply(this.host,n)},getSubs:function(){var e=this._subscribers,t=this._afters,n=this.sibling;return e=n?e.concat(n._subscribers):e.concat(),t=n?t.concat(n._afters):t.concat(),[e,t]},applyConfig:function(e,t){h(this,e,t)},_on:function(t,n,r,i){var s=new e.Subscriber(t,n,r,i);return this.fireOnce&&this.fired&&(this.async?setTimeout(e.bind(this._notify,this,s,this.firedWith),0):this._notify(s,this.firedWith)),i==o?this._afters.push(s):this._subscribers.push(s),this._kds&&(i==o?this.afters[s.id]=s:this.subscribers[s.id]=s),new e.EventHandle(this,s)},subscribe:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,!0)},on:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this.monitored&&this.host&&this.host._monitor("attach",this,{args:arguments}),this._on(e,t,n,!0)},after:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,o)},detach:function(e,t){if(e&&e.detach)return e.detach();var n,r,i=0,s=this._subscribers,o=this._afters;for(n=s.length;n>=0;n--)r=s[n],r&&(!e||e===r.fn)&&(this._delete(r,s,n),i++);for(n=o.length;n>=0;n--)r=o[n],r&&(!e||e===r.fn)&&(this._delete(r,o,n),i++);return i},unsubscribe:function(){return this.detach.apply(this,arguments)},_notify:function(e,t,n){var r;return r=e.notify(t,this),!1===r||this.stopped>1?!1:!0},log:function(e,t){},fire:function(){if(this.fireOnce&&this.fired)return!0;var e=f.call(arguments,0);return this.fired=!0,this.fireOnce&&(this.firedWith=e),this.emitFacade?this.fireComplex(e):this.fireSimple(e)},fireSimple:function(e){this.stopped=0,this.prevented=0;if(this.hasSubs()){var t=this.getSubs();this._procSubs(t[0],e),this._procSubs(t[1],e)}return this._broadcast(e),this.stopped?!1:!0},fireComplex:function(e){return e[0]=e[0]||{},this.fireSimple(e)},_procSubs:function(e,t,n){var r,i,s;for(i=0,s=e.length;i<s;i++){r=e[i];if(r&&r.fn){!1===this._notify(r,t,n)&&(this.stopped=2);if(this.stopped==2)return!1}}return!0},_broadcast:function(t){if(!this.stopped&&this.broadcast){var n=t.concat();n.unshift(this.type),this.host!==e&&e.fire.apply(e,n),this.broadcast==2&&e.Global.fire.apply(e.Global,n)}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},detachAll:function(){return this.detach()},_delete:function(e,t,n){var r=e._when;t||(t=r===o?this._afters:this._subscribers,n=s.indexOf(t,e,0)),e&&t[n]===e&&t.splice(n,1),this._kds&&(r===o?delete this.afters[e.id]:delete this.subscribers[e.id]),this.monitored&&this.host&&this.host._monitor("detach",this,{ce:this,sub:e}),e&&(e.deleted=!0)}},e.Subscriber=function(t,n,r,i){this.fn=t,this.context=n,this.id=e.stamp(this),this.args=r,this._when=i},e.Subscriber.prototype={constructor:e.Subscriber,_notify:function(e,t,n){if(this.deleted&&!this.postponed){if(!this.postponed)return delete this.postponed,null;delete this.fn,delete this.context}var r=this.args,i;switch(n.signature){case 0:i=this.fn.call(e,n.type,t,e);break;case 1:i=this.fn.call(e,t[0]||null,e);break;default:r||t?(t=t||[],r=r?t.concat(r):t,i=this.fn.apply(e,r)):i=this.fn.call(e)}return this.once&&n._delete(this),i},notify:function(t,n){var r=this.context,i=!0;r||(r=n.contextFn?n.contextFn():n.context);if(e.config&&e.config.throwFail)i=this._notify(r,t,n);else try{i=this._notify(r,t,n)}catch(s){e.error(this+" failed: "+s.message,s)}return i},contains:function(e,t){return t?this.fn==e&&this.context==t:this.fn==e},valueOf:function(){return this.id}},e.EventHandle=function(e,t){this.evt=e,this.sub=t},e.EventHandle.prototype={batch:function(t,n){t.call(n||this,this),e.Lang.isArray(this.evt)&&e.Array.each(this.evt,function(e){e.batch.call(n||e,t)})},detach:function(){var t=this.evt,n=0,r;if(t)if(e.Lang.isArray(t))for(r=0;r<t.length;r++)n+=t[r].detach();else t._delete(this.sub),n=1;return n},monitor:function(e){return this.evt.monitor.apply(this.evt,arguments)}};var p=e.Lang,d=":",v="|",m="~AFTER~",g=/(.*?)(:)(.*?)/,y=e.cached(function(e){return e.replace(g,"*$2$3")}),b=e.cached(function(e,t){return!t||typeof e!="string"||e.indexOf(d)>-1?e:t+d+e}),w=e.cached(function(e,t){var n=e,r,i,s;return p.isString(n)?(s=n.indexOf(m),s>-1&&(i=!0,n=n.substr(m.length)),s=n.indexOf(v),s>-1&&(r=n.substr(0,s),n=n.substr(s+1),n=="*"&&(n=null)),[r,t?b(n,t):n,i,n]):n}),E=function(t){var n=p.isObject(t)?t:{};this._yuievt=this._yuievt||{id:e.guid(),events:{},targets:{},config:n,chain:"chain"in n?n.chain:e.config.chain,bubbling:!1,defaults:{context:n.context||this,host:this,emitFacade:n.emitFacade,fireOnce:n.fireOnce,queuable:n.queuable,monitored:n.monitored,broadcast:n.broadcast,defaultTargetOnly:n.defaultTargetOnly,bubbles:"bubbles"in n?n.bubbles:!0}}};E.prototype={constructor:E,once:function(){var e=this.on.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},onceAfter:function(){var e=this.after.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},parseType:function(e,t){return w(e,t||this._yuievt.config.prefix)},on:function(t,n,r){var i=this._yuievt,s=w(t,i.config.prefix),o,u,a,l,c,h,d,v=e.Env.evt.handles,g,y,b,E=e.Node,S,x,T;this._monitor("attach",s[1],{args:arguments,category:s[0],after:s[2]});if(p.isObject(t))return p.isFunction(t)?e.Do.before.apply(e.Do,arguments):(o=n,u=r,a=f.call(arguments,0),l=[],p.isArray(t)&&(T=!0),g=t._after,delete t._after,e.each(t,function(e,t){p.isObject(e)&&(o=e.fn||(p.isFunction(e)?e:o),u=e.context||u);var n=g?m:"";a[0]=n+(T?e:t),a[1]=o,a[2]=u,l.push(this.on.apply(this,a))},this),i.chain?this:new e.EventHandle(l));h=s[0],g=s[2],b=s[3];if(E&&e.instanceOf(this,E)&&b in E.DOM_EVENTS)return a=f.call(arguments,0),a.splice(2,0,E.getDOMNode(this)),e.on.apply(e,a);t=s[1];if(e.instanceOf(this,YUI)){y=e.Env.evt.plugins[t],a=f.call(arguments,0),a[0]=b,E&&(S=a[2],e.instanceOf(S,e.NodeList)?S=e.NodeList.getDOMNodes(S):e.instanceOf(S,E)&&(S=E.getDOMNode(S)),x=b in E.DOM_EVENTS,x&&(a[2]=S));if(y)d=y.on.apply(e,a);else if(!t||x)d=e.Event._attach(a)}return d||(c=i.events[t]||this.publish(t),d=c._on(n,r,arguments.length>3?f.call(arguments,3):null,g?"after":!0)),h&&(v[h]=v[h]||{},v[h][t]=v[h][t]||[],v[h][t].push(d)),i.chain?this:d},subscribe:function(){return this.on.apply(this,arguments)},detach:function(t,n,r){var i=this._yuievt.events,s,o=e.Node,u=o&&e.instanceOf(this,o);if(!t&&this!==e){for(s in i)i.hasOwnProperty(s)&&i[s].detach(n,r);return u&&e.Event.purgeElement(o.getDOMNode(this)),this}var a=w(t,this._yuievt.config.prefix),l=p.isArray(a)?a[0]:null,c=a?a[3]:null,h,d=e.Env.evt.handles,v,m,g,y,b=function(e,t,n){var r=e[t],i,s;if(r)for(s=r.length-1;s>=0;--s)i=r[s].evt,(i.host===n||i.el===n)&&r[s].detach()};if(l){m=d[l],t=a[1],v=u?e.Node.getDOMNode(this):this;if(m){if(t)b(m,t,v);else for(s in m)m.hasOwnProperty(s)&&b(m,s,v);return this}}else{if(p.isObject(t)&&t.detach)return t.detach(),this;if(u&&(!c||c in o.DOM_EVENTS))return g=f.call(arguments,0),g[2]=o.getDOMNode(this),e.detach.apply(e,g),this}h=e.Env.evt.plugins[c];if(e.instanceOf(this,YUI)){g=f.call(arguments,0);if(h&&h.detach)return h.detach.apply(e,g),this;if(!t||!h&&o&&t in o.DOM_EVENTS)return g[0]=t,e.Event.detach.apply(e.Event,g),this}return y=i[a[1]],y&&y.detach(n,r),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(e){return this.detach(e)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(t,n){var r,i,s,o,u=this._yuievt,a=u.config.prefix;return p.isObject(t)?(s={},e.each(t,function(e,t){s[t]=this.publish(t,e||n)},this),s):(t=a?b(t,a):t,r=u.events,i=r[t],this._monitor("publish",t,{args:arguments}),i?n&&i.applyConfig(n,!0):(o=u.defaults,i=new e.CustomEvent(t,o),n&&i.applyConfig(n,!0),r[t]=i),r[t])},_monitor:function(e,t,n){var r,i,s;if(t){typeof t=="string"?(s=t,i=this.getEvent(t,!0)):(i=t,s=t.type);if(this._yuievt.config.monitored&&(!i||i.monitored)||i&&i.monitored)r=s+"_"+e,n.monitored=e,this.fire.call(this,r,n)}},fire:function(e){var t=p.isString(e),n=t?e:e&&e.type,r=this._yuievt,i=r.config.prefix,s,o,u,a=t?f.call(arguments,1):arguments;n=i?b(n,i):n,s=this.getEvent(n,!0),u=this.getSibling(n,s),u&&!s&&(s=this.publish(n)),this._monitor("fire",s||n,{args:a});if(!s){if(r.hasTargets)return this.bubble({type:n},a,this);o=!0}else s.sibling=u,o=s.fire.apply(s,a);return r.chain?this:o},getSibling:function(e,t){var n;return e.indexOf(d)>-1&&(e=y(e),n=this.getEvent(e,!0),n&&(n.applyConfig(t),n.bubbles=!1,n.broadcast=0)),n},getEvent:function(e,t){var n,r;return t||(n=this._yuievt.config.prefix,e=n?b(e,n):e),r=this._yuievt.events,r[e]||null},after:function(t,n){var r=f.call(arguments,0);switch(p.type(t)){case"function":return e.Do.after.apply(e.Do,arguments);case"array":case"object":r[0]._after=!0;break;default:r[0]=m+t}return this.on.apply(this,r)},before:function(){return this.on.apply(this,arguments)}},e.EventTarget=E,e.mix(e,E.prototype),E.call(e,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new E,e.Global=YUI.Env.globalEvents},"3.7.3",{requires:["oop"]});
bundle/event-custom-base/event-custom-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -2298,4 +2298,4 @@ **/ -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]});
bundle/event-custom-complex/event-custom-complex-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-custom-complex/event-custom-complex.js", code: [] };-_yuitest_coverage["build/event-custom-complex/event-custom-complex.js"].code=["YUI.add('event-custom-complex', function (Y, NAME) {","","","/**"," * Adds event facades, preventable default behavior, and bubbling."," * events."," * @module event-custom"," * @submodule event-custom-complex"," */","","var FACADE,"," FACADE_KEYS,"," key,"," EMPTY = {},"," CEProto = Y.CustomEvent.prototype,"," ETProto = Y.EventTarget.prototype, ",""," mixFacadeProps = function(facade, payload) {"," var p;",""," for (p in payload) {"," if (!(FACADE_KEYS.hasOwnProperty(p))) {"," facade[p] = payload[p];"," }"," }"," };","","/**"," * Wraps and protects a custom event for use when emitFacade is set to true."," * Requires the event-custom-complex module"," * @class EventFacade"," * @param e {Event} the custom event"," * @param currentTarget {HTMLElement} the element the listener was attached to"," */","","Y.EventFacade = function(e, currentTarget) {",""," e = e || EMPTY;",""," this._event = e;",""," /**"," * The arguments passed to fire"," * @property details"," * @type Array"," */"," this.details = e.details;",""," /**"," * The event type, this can be overridden by the fire() payload"," * @property type"," * @type string"," */"," this.type = e.type;",""," /**"," * The real event type"," * @property _type"," * @type string"," * @private"," */"," this._type = e.type;",""," //////////////////////////////////////////////////////",""," /**"," * Node reference for the targeted eventtarget"," * @property target"," * @type Node"," */"," this.target = e.target;",""," /**"," * Node reference for the element that the listener was attached to."," * @property currentTarget"," * @type Node"," */"," this.currentTarget = currentTarget;",""," /**"," * Node reference to the relatedTarget"," * @property relatedTarget"," * @type Node"," */"," this.relatedTarget = e.relatedTarget;","","};","","Y.mix(Y.EventFacade.prototype, {",""," /**"," * Stops the propagation to the next bubble target"," * @method stopPropagation"," */"," stopPropagation: function() {"," this._event.stopPropagation();"," this.stopped = 1;"," },",""," /**"," * Stops the propagation to the next bubble target and"," * prevents any additional listeners from being exectued"," * on the current target."," * @method stopImmediatePropagation"," */"," stopImmediatePropagation: function() {"," this._event.stopImmediatePropagation();"," this.stopped = 2;"," },",""," /**"," * Prevents the event's default behavior"," * @method preventDefault"," */"," preventDefault: function() {"," this._event.preventDefault();"," this.prevented = 1;"," },",""," /**"," * Stops the event propagation and prevents the default"," * event behavior."," * @method halt"," * @param immediate {boolean} if true additional listeners"," * on the current target will not be executed"," */"," halt: function(immediate) {"," this._event.halt(immediate);"," this.prevented = 1;"," this.stopped = (immediate) ? 2 : 1;"," }","","});","","CEProto.fireComplex = function(args) {",""," var es, ef, q, queue, ce, ret, events, subs, postponed,"," self = this, host = self.host || self, next, oldbubble;",""," if (self.stack) {"," // queue this event if the current item in the queue bubbles"," if (self.queuable && self.type != self.stack.next.type) {"," self.stack.queue.push([self, args]);"," return true;"," }"," }",""," es = self.stack || {"," // id of the first event in the stack"," id: self.id,"," next: self,"," silent: self.silent,"," stopped: 0,"," prevented: 0,"," bubbling: null,"," type: self.type,"," // defaultFnQueue: new Y.Queue(),"," afterQueue: new Y.Queue(),"," defaultTargetOnly: self.defaultTargetOnly,"," queue: []"," };",""," subs = self.getSubs();",""," self.stopped = (self.type !== es.type) ? 0 : es.stopped;"," self.prevented = (self.type !== es.type) ? 0 : es.prevented;",""," self.target = self.target || host;",""," if (self.stoppedFn) {"," events = new Y.EventTarget({"," fireOnce: true,"," context: host"," });"," "," self.events = events;",""," events.on('stopped', self.stoppedFn);"," }",""," self.currentTarget = host;",""," self.details = args.slice(); // original arguments in the details","",""," self._facade = null; // kill facade to eliminate stale properties",""," ef = self._getFacade(args);",""," if (Y.Lang.isObject(args[0])) {"," args[0] = ef;"," } else {"," args.unshift(ef);"," }",""," if (subs[0]) {"," self._procSubs(subs[0], args, ef);"," }",""," // bubble if this is hosted in an event target and propagation has not been stopped"," if (self.bubbles && host.bubble && !self.stopped) {",""," oldbubble = es.bubbling;",""," es.bubbling = self.type;",""," if (es.type != self.type) {"," es.stopped = 0;"," es.prevented = 0;"," }",""," ret = host.bubble(self, args, null, es);",""," self.stopped = Math.max(self.stopped, es.stopped);"," self.prevented = Math.max(self.prevented, es.prevented);",""," es.bubbling = oldbubble;"," }",""," if (self.prevented) {"," if (self.preventedFn) {"," self.preventedFn.apply(host, args);"," }"," } else if (self.defaultFn &&"," ((!self.defaultTargetOnly && !es.defaultTargetOnly) ||"," host === ef.target)) {"," self.defaultFn.apply(host, args);"," }",""," // broadcast listeners are fired as discreet events on the"," // YUI instance and potentially the YUI global."," self._broadcast(args);",""," // Queue the after"," if (subs[1] && !self.prevented && self.stopped < 2) {"," if (es.id === self.id || self.type != host._yuievt.bubbling) {"," self._procSubs(subs[1], args, ef);"," while ((next = es.afterQueue.last())) {"," next();"," }"," } else {"," postponed = subs[1];"," if (es.execDefaultCnt) {"," postponed = Y.merge(postponed);"," Y.each(postponed, function(s) {"," s.postponed = true;"," });"," }",""," es.afterQueue.add(function() {"," self._procSubs(postponed, args, ef);"," });"," }"," }",""," self.target = null;",""," if (es.id === self.id) {"," queue = es.queue;",""," while (queue.length) {"," q = queue.pop();"," ce = q[0];"," // set up stack to allow the next item to be processed"," es.next = ce;"," ce.fire.apply(ce, q[1]);"," }",""," self.stack = null;"," }",""," ret = !(self.stopped);",""," if (self.type != host._yuievt.bubbling) {"," es.stopped = 0;"," es.prevented = 0;"," self.stopped = 0;"," self.prevented = 0;"," }",""," // Kill the cached facade to free up memory."," // Otherwise we have the facade from the last fire, sitting around forever."," self._facade = null;",""," return ret;","};","","CEProto._getFacade = function() {",""," var ef = this._facade, o,"," args = this.details;",""," if (!ef) {"," ef = new Y.EventFacade(this, this.currentTarget);"," }",""," // if the first argument is an object literal, apply the"," // properties to the event facade"," o = args && args[0];",""," if (Y.Lang.isObject(o, true)) {",""," // protect the event facade properties"," mixFacadeProps(ef, o);",""," // Allow the event type to be faked"," // http://yuilibrary.com/projects/yui3/ticket/2528376"," ef.type = o.type || ef.type;"," }",""," // update the details field with the arguments"," // ef.type = this.type;"," ef.details = this.details;",""," // use the original target when the event bubbled to this target"," ef.target = this.originalTarget || this.target;",""," ef.currentTarget = this.currentTarget;"," ef.stopped = 0;"," ef.prevented = 0;",""," this._facade = ef;",""," return this._facade;","};","","/**"," * Stop propagation to bubble targets"," * @for CustomEvent"," * @method stopPropagation"," */","CEProto.stopPropagation = function() {"," this.stopped = 1;"," if (this.stack) {"," this.stack.stopped = 1;"," }"," if (this.events) {"," this.events.fire('stopped', this);"," }","};","","/**"," * Stops propagation to bubble targets, and prevents any remaining"," * subscribers on the current target from executing."," * @method stopImmediatePropagation"," */","CEProto.stopImmediatePropagation = function() {"," this.stopped = 2;"," if (this.stack) {"," this.stack.stopped = 2;"," }"," if (this.events) {"," this.events.fire('stopped', this);"," }","};","","/**"," * Prevents the execution of this event's defaultFn"," * @method preventDefault"," */","CEProto.preventDefault = function() {"," if (this.preventable) {"," this.prevented = 1;"," if (this.stack) {"," this.stack.prevented = 1;"," }"," }","};","","/**"," * Stops the event propagation and prevents the default"," * event behavior."," * @method halt"," * @param immediate {boolean} if true additional listeners"," * on the current target will not be executed"," */","CEProto.halt = function(immediate) {"," if (immediate) {"," this.stopImmediatePropagation();"," } else {"," this.stopPropagation();"," }"," this.preventDefault();","};","","/**"," * Registers another EventTarget as a bubble target. Bubble order"," * is determined by the order registered. Multiple targets can"," * be specified."," *"," * Events can only bubble if emitFacade is true."," *"," * Included in the event-custom-complex submodule."," *"," * @method addTarget"," * @param o {EventTarget} the target to add"," * @for EventTarget"," */","ETProto.addTarget = function(o) {"," this._yuievt.targets[Y.stamp(o)] = o;"," this._yuievt.hasTargets = true;","};","","/**"," * Returns an array of bubble targets for this object."," * @method getTargets"," * @return EventTarget[]"," */","ETProto.getTargets = function() {"," return Y.Object.values(this._yuievt.targets);","};","","/**"," * Removes a bubble target"," * @method removeTarget"," * @param o {EventTarget} the target to remove"," * @for EventTarget"," */","ETProto.removeTarget = function(o) {"," delete this._yuievt.targets[Y.stamp(o)];","};","","/**"," * Propagate an event. Requires the event-custom-complex module."," * @method bubble"," * @param evt {CustomEvent} the custom event to propagate"," * @return {boolean} the aggregated return value from Event.Custom.fire"," * @for EventTarget"," */","ETProto.bubble = function(evt, args, target, es) {",""," var targs = this._yuievt.targets, ret = true,"," t, type = evt && evt.type, ce, i, bc, ce2,"," originalTarget = target || (evt && evt.target) || this,"," oldbubble;",""," if (!evt || ((!evt.stopped) && targs)) {",""," for (i in targs) {"," if (targs.hasOwnProperty(i)) {"," t = targs[i];"," ce = t.getEvent(type, true);"," ce2 = t.getSibling(type, ce);",""," if (ce2 && !ce) {"," ce = t.publish(type);"," }",""," oldbubble = t._yuievt.bubbling;"," t._yuievt.bubbling = type;",""," // if this event was not published on the bubble target,"," // continue propagating the event."," if (!ce) {"," if (t._yuievt.hasTargets) {"," t.bubble(evt, args, originalTarget, es);"," }"," } else {",""," ce.sibling = ce2;",""," // set the original target to that the target payload on the"," // facade is correct."," ce.target = originalTarget;"," ce.originalTarget = originalTarget;"," ce.currentTarget = t;"," bc = ce.broadcast;"," ce.broadcast = false;",""," // default publish may not have emitFacade true -- that"," // shouldn't be what the implementer meant to do"," ce.emitFacade = true;",""," ce.stack = es;",""," ret = ret && ce.fire.apply(ce, args || evt.details || []);"," ce.broadcast = bc;"," ce.originalTarget = null;",""," // stopPropagation() was called"," if (ce.stopped) {"," break;"," }"," }",""," t._yuievt.bubbling = oldbubble;"," }"," }"," }",""," return ret;","};","","FACADE = new Y.EventFacade();","FACADE_KEYS = {};","","// Flatten whitelist","for (key in FACADE) {"," FACADE_KEYS[key] = true;","}","","}, '3.7.2', {\"requires\": [\"event-custom-base\"]});"];+_yuitest_coverage["build/event-custom-complex/event-custom-complex.js"].code=["YUI.add('event-custom-complex', function (Y, NAME) {","","","/**"," * Adds event facades, preventable default behavior, and bubbling."," * events."," * @module event-custom"," * @submodule event-custom-complex"," */","","var FACADE,"," FACADE_KEYS,"," key,"," EMPTY = {},"," CEProto = Y.CustomEvent.prototype,"," ETProto = Y.EventTarget.prototype, ",""," mixFacadeProps = function(facade, payload) {"," var p;",""," for (p in payload) {"," if (!(FACADE_KEYS.hasOwnProperty(p))) {"," facade[p] = payload[p];"," }"," }"," };","","/**"," * Wraps and protects a custom event for use when emitFacade is set to true."," * Requires the event-custom-complex module"," * @class EventFacade"," * @param e {Event} the custom event"," * @param currentTarget {HTMLElement} the element the listener was attached to"," */","","Y.EventFacade = function(e, currentTarget) {",""," e = e || EMPTY;",""," this._event = e;",""," /**"," * The arguments passed to fire"," * @property details"," * @type Array"," */"," this.details = e.details;",""," /**"," * The event type, this can be overridden by the fire() payload"," * @property type"," * @type string"," */"," this.type = e.type;",""," /**"," * The real event type"," * @property _type"," * @type string"," * @private"," */"," this._type = e.type;",""," //////////////////////////////////////////////////////",""," /**"," * Node reference for the targeted eventtarget"," * @property target"," * @type Node"," */"," this.target = e.target;",""," /**"," * Node reference for the element that the listener was attached to."," * @property currentTarget"," * @type Node"," */"," this.currentTarget = currentTarget;",""," /**"," * Node reference to the relatedTarget"," * @property relatedTarget"," * @type Node"," */"," this.relatedTarget = e.relatedTarget;","","};","","Y.mix(Y.EventFacade.prototype, {",""," /**"," * Stops the propagation to the next bubble target"," * @method stopPropagation"," */"," stopPropagation: function() {"," this._event.stopPropagation();"," this.stopped = 1;"," },",""," /**"," * Stops the propagation to the next bubble target and"," * prevents any additional listeners from being exectued"," * on the current target."," * @method stopImmediatePropagation"," */"," stopImmediatePropagation: function() {"," this._event.stopImmediatePropagation();"," this.stopped = 2;"," },",""," /**"," * Prevents the event's default behavior"," * @method preventDefault"," */"," preventDefault: function() {"," this._event.preventDefault();"," this.prevented = 1;"," },",""," /**"," * Stops the event propagation and prevents the default"," * event behavior."," * @method halt"," * @param immediate {boolean} if true additional listeners"," * on the current target will not be executed"," */"," halt: function(immediate) {"," this._event.halt(immediate);"," this.prevented = 1;"," this.stopped = (immediate) ? 2 : 1;"," }","","});","","CEProto.fireComplex = function(args) {",""," var es, ef, q, queue, ce, ret, events, subs, postponed,"," self = this, host = self.host || self, next, oldbubble;",""," if (self.stack) {"," // queue this event if the current item in the queue bubbles"," if (self.queuable && self.type != self.stack.next.type) {"," self.stack.queue.push([self, args]);"," return true;"," }"," }",""," es = self.stack || {"," // id of the first event in the stack"," id: self.id,"," next: self,"," silent: self.silent,"," stopped: 0,"," prevented: 0,"," bubbling: null,"," type: self.type,"," // defaultFnQueue: new Y.Queue(),"," afterQueue: new Y.Queue(),"," defaultTargetOnly: self.defaultTargetOnly,"," queue: []"," };",""," subs = self.getSubs();",""," self.stopped = (self.type !== es.type) ? 0 : es.stopped;"," self.prevented = (self.type !== es.type) ? 0 : es.prevented;",""," self.target = self.target || host;",""," if (self.stoppedFn) {"," events = new Y.EventTarget({"," fireOnce: true,"," context: host"," });"," "," self.events = events;",""," events.on('stopped', self.stoppedFn);"," }",""," self.currentTarget = host;",""," self.details = args.slice(); // original arguments in the details","",""," self._facade = null; // kill facade to eliminate stale properties",""," ef = self._getFacade(args);",""," if (Y.Lang.isObject(args[0])) {"," args[0] = ef;"," } else {"," args.unshift(ef);"," }",""," if (subs[0]) {"," self._procSubs(subs[0], args, ef);"," }",""," // bubble if this is hosted in an event target and propagation has not been stopped"," if (self.bubbles && host.bubble && !self.stopped) {",""," oldbubble = es.bubbling;",""," es.bubbling = self.type;",""," if (es.type != self.type) {"," es.stopped = 0;"," es.prevented = 0;"," }",""," ret = host.bubble(self, args, null, es);",""," self.stopped = Math.max(self.stopped, es.stopped);"," self.prevented = Math.max(self.prevented, es.prevented);",""," es.bubbling = oldbubble;"," }",""," if (self.prevented) {"," if (self.preventedFn) {"," self.preventedFn.apply(host, args);"," }"," } else if (self.defaultFn &&"," ((!self.defaultTargetOnly && !es.defaultTargetOnly) ||"," host === ef.target)) {"," self.defaultFn.apply(host, args);"," }",""," // broadcast listeners are fired as discreet events on the"," // YUI instance and potentially the YUI global."," self._broadcast(args);",""," // Queue the after"," if (subs[1] && !self.prevented && self.stopped < 2) {"," if (es.id === self.id || self.type != host._yuievt.bubbling) {"," self._procSubs(subs[1], args, ef);"," while ((next = es.afterQueue.last())) {"," next();"," }"," } else {"," postponed = subs[1];"," if (es.execDefaultCnt) {"," postponed = Y.merge(postponed);"," Y.each(postponed, function(s) {"," s.postponed = true;"," });"," }",""," es.afterQueue.add(function() {"," self._procSubs(postponed, args, ef);"," });"," }"," }",""," self.target = null;",""," if (es.id === self.id) {"," queue = es.queue;",""," while (queue.length) {"," q = queue.pop();"," ce = q[0];"," // set up stack to allow the next item to be processed"," es.next = ce;"," ce.fire.apply(ce, q[1]);"," }",""," self.stack = null;"," }",""," ret = !(self.stopped);",""," if (self.type != host._yuievt.bubbling) {"," es.stopped = 0;"," es.prevented = 0;"," self.stopped = 0;"," self.prevented = 0;"," }",""," // Kill the cached facade to free up memory."," // Otherwise we have the facade from the last fire, sitting around forever."," self._facade = null;",""," return ret;","};","","CEProto._getFacade = function() {",""," var ef = this._facade, o,"," args = this.details;",""," if (!ef) {"," ef = new Y.EventFacade(this, this.currentTarget);"," }",""," // if the first argument is an object literal, apply the"," // properties to the event facade"," o = args && args[0];",""," if (Y.Lang.isObject(o, true)) {",""," // protect the event facade properties"," mixFacadeProps(ef, o);",""," // Allow the event type to be faked"," // http://yuilibrary.com/projects/yui3/ticket/2528376"," ef.type = o.type || ef.type;"," }",""," // update the details field with the arguments"," // ef.type = this.type;"," ef.details = this.details;",""," // use the original target when the event bubbled to this target"," ef.target = this.originalTarget || this.target;",""," ef.currentTarget = this.currentTarget;"," ef.stopped = 0;"," ef.prevented = 0;",""," this._facade = ef;",""," return this._facade;","};","","/**"," * Stop propagation to bubble targets"," * @for CustomEvent"," * @method stopPropagation"," */","CEProto.stopPropagation = function() {"," this.stopped = 1;"," if (this.stack) {"," this.stack.stopped = 1;"," }"," if (this.events) {"," this.events.fire('stopped', this);"," }","};","","/**"," * Stops propagation to bubble targets, and prevents any remaining"," * subscribers on the current target from executing."," * @method stopImmediatePropagation"," */","CEProto.stopImmediatePropagation = function() {"," this.stopped = 2;"," if (this.stack) {"," this.stack.stopped = 2;"," }"," if (this.events) {"," this.events.fire('stopped', this);"," }","};","","/**"," * Prevents the execution of this event's defaultFn"," * @method preventDefault"," */","CEProto.preventDefault = function() {"," if (this.preventable) {"," this.prevented = 1;"," if (this.stack) {"," this.stack.prevented = 1;"," }"," }","};","","/**"," * Stops the event propagation and prevents the default"," * event behavior."," * @method halt"," * @param immediate {boolean} if true additional listeners"," * on the current target will not be executed"," */","CEProto.halt = function(immediate) {"," if (immediate) {"," this.stopImmediatePropagation();"," } else {"," this.stopPropagation();"," }"," this.preventDefault();","};","","/**"," * Registers another EventTarget as a bubble target. Bubble order"," * is determined by the order registered. Multiple targets can"," * be specified."," *"," * Events can only bubble if emitFacade is true."," *"," * Included in the event-custom-complex submodule."," *"," * @method addTarget"," * @param o {EventTarget} the target to add"," * @for EventTarget"," */","ETProto.addTarget = function(o) {"," this._yuievt.targets[Y.stamp(o)] = o;"," this._yuievt.hasTargets = true;","};","","/**"," * Returns an array of bubble targets for this object."," * @method getTargets"," * @return EventTarget[]"," */","ETProto.getTargets = function() {"," return Y.Object.values(this._yuievt.targets);","};","","/**"," * Removes a bubble target"," * @method removeTarget"," * @param o {EventTarget} the target to remove"," * @for EventTarget"," */","ETProto.removeTarget = function(o) {"," delete this._yuievt.targets[Y.stamp(o)];","};","","/**"," * Propagate an event. Requires the event-custom-complex module."," * @method bubble"," * @param evt {CustomEvent} the custom event to propagate"," * @return {boolean} the aggregated return value from Event.Custom.fire"," * @for EventTarget"," */","ETProto.bubble = function(evt, args, target, es) {",""," var targs = this._yuievt.targets, ret = true,"," t, type = evt && evt.type, ce, i, bc, ce2,"," originalTarget = target || (evt && evt.target) || this,"," oldbubble;",""," if (!evt || ((!evt.stopped) && targs)) {",""," for (i in targs) {"," if (targs.hasOwnProperty(i)) {"," t = targs[i];"," ce = t.getEvent(type, true);"," ce2 = t.getSibling(type, ce);",""," if (ce2 && !ce) {"," ce = t.publish(type);"," }",""," oldbubble = t._yuievt.bubbling;"," t._yuievt.bubbling = type;",""," // if this event was not published on the bubble target,"," // continue propagating the event."," if (!ce) {"," if (t._yuievt.hasTargets) {"," t.bubble(evt, args, originalTarget, es);"," }"," } else {",""," ce.sibling = ce2;",""," // set the original target to that the target payload on the"," // facade is correct."," ce.target = originalTarget;"," ce.originalTarget = originalTarget;"," ce.currentTarget = t;"," bc = ce.broadcast;"," ce.broadcast = false;",""," // default publish may not have emitFacade true -- that"," // shouldn't be what the implementer meant to do"," ce.emitFacade = true;",""," ce.stack = es;",""," ret = ret && ce.fire.apply(ce, args || evt.details || []);"," ce.broadcast = bc;"," ce.originalTarget = null;",""," // stopPropagation() was called"," if (ce.stopped) {"," break;"," }"," }",""," t._yuievt.bubbling = oldbubble;"," }"," }"," }",""," return ret;","};","","FACADE = new Y.EventFacade();","FACADE_KEYS = {};","","// Flatten whitelist","for (key in FACADE) {"," FACADE_KEYS[key] = true;","}","","}, '3.7.3', {\"requires\": [\"event-custom-base\"]});"]; _yuitest_coverage["build/event-custom-complex/event-custom-complex.js"].lines = {"1":0,"11":0,"19":0,"21":0,"22":0,"23":0,"36":0,"38":0,"40":0,"47":0,"54":0,"62":0,"71":0,"78":0,"85":0,"89":0,"96":0,"97":0,"107":0,"108":0,"116":0,"117":0,"128":0,"129":0,"130":0,"135":0,"137":0,"140":0,"142":0,"143":0,"144":0,"148":0,"163":0,"165":0,"166":0,"168":0,"170":0,"171":0,"176":0,"178":0,"181":0,"183":0,"186":0,"188":0,"190":0,"191":0,"193":0,"196":0,"197":0,"201":0,"203":0,"205":0,"207":0,"208":0,"209":0,"212":0,"214":0,"215":0,"217":0,"220":0,"221":0,"222":0,"224":0,"227":0,"232":0,"235":0,"236":0,"237":0,"238":0,"239":0,"242":0,"243":0,"244":0,"245":0,"246":0,"250":0,"251":0,"256":0,"258":0,"259":0,"261":0,"262":0,"263":0,"265":0,"266":0,"269":0,"272":0,"274":0,"275":0,"276":0,"277":0,"278":0,"283":0,"285":0,"288":0,"290":0,"293":0,"294":0,"299":0,"301":0,"304":0,"308":0,"313":0,"316":0,"318":0,"319":0,"320":0,"322":0,"324":0,"332":0,"333":0,"334":0,"335":0,"337":0,"338":0,"347":0,"348":0,"349":0,"350":0,"352":0,"353":0,"361":0,"362":0,"363":0,"364":0,"365":0,"377":0,"378":0,"379":0,"381":0,"383":0,"399":0,"400":0,"401":0,"409":0,"410":0,"419":0,"420":0,"430":0,"432":0,"437":0,"439":0,"440":0,"441":0,"442":0,"443":0,"445":0,"446":0,"449":0,"450":0,"454":0,"455":0,"456":0,"460":0,"464":0,"465":0,"466":0,"467":0,"468":0,"472":0,"474":0,"476":0,"477":0,"478":0,"481":0,"482":0,"486":0,"491":0,"494":0,"495":0,"498":0,"499":0}; _yuitest_coverage["build/event-custom-complex/event-custom-complex.js"].functions = {"mixFacadeProps:18":0,"EventFacade:36":0,"stopPropagation:95":0,"stopImmediatePropagation:106":0,"preventDefault:115":0,"halt:127":0,"(anonymous 2):245":0,"(anonymous 3):250":0,"fireComplex:135":0,"_getFacade:288":0,"stopPropagation:332":0,"stopImmediatePropagation:347":0,"preventDefault:361":0,"halt:377":0,"addTarget:399":0,"getTargets:409":0,"removeTarget:419":0,"bubble:430":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-custom-complex/event-custom-complex.js"].coveredLines = 172;@@ -729,4 +729,4 @@ FACADE_KEYS[key] = true; } -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]});
bundle/event-custom-complex/event-custom-complex-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -509,4 +509,4 @@ FACADE_KEYS[key] = true; } -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]});
bundle/event-custom-complex/event-custom-complex-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-custom-complex",function(e,t){var n,r,i,s={},o=e.CustomEvent.prototype,u=e.EventTarget.prototype,a=function(e,t){var n;for(n in t)r.hasOwnProperty(n)||(e[n]=t[n])};e.EventFacade=function(e,t){e=e||s,this._event=e,this.details=e.details,this.type=e.type,this._type=e.type,this.target=e.target,this.currentTarget=t,this.relatedTarget=e.relatedTarget},e.mix(e.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(e){this._event.halt(e),this.prevented=1,this.stopped=e?2:1}}),o.fireComplex=function(t){var n,r,i,s,o,u,a,f,l,c=this,h=c.host||c,p,d;if(c.stack&&c.queuable&&c.type!=c.stack.next.type)return c.stack.queue.push([c,t]),!0;n=c.stack||{id:c.id,next:c,silent:c.silent,stopped:0,prevented:0,bubbling:null,type:c.type,afterQueue:new e.Queue,defaultTargetOnly:c.defaultTargetOnly,queue:[]},f=c.getSubs(),c.stopped=c.type!==n.type?0:n.stopped,c.prevented=c.type!==n.type?0:n.prevented,c.target=c.target||h,c.stoppedFn&&(a=new e.EventTarget({fireOnce:!0,context:h}),c.events=a,a.on("stopped",c.stoppedFn)),c.currentTarget=h,c.details=t.slice(),c._facade=null,r=c._getFacade(t),e.Lang.isObject(t[0])?t[0]=r:t.unshift(r),f[0]&&c._procSubs(f[0],t,r),c.bubbles&&h.bubble&&!c.stopped&&(d=n.bubbling,n.bubbling=c.type,n.type!=c.type&&(n.stopped=0,n.prevented=0),u=h.bubble(c,t,null,n),c.stopped=Math.max(c.stopped,n.stopped),c.prevented=Math.max(c.prevented,n.prevented),n.bubbling=d),c.prevented?c.preventedFn&&c.preventedFn.apply(h,t):c.defaultFn&&(!c.defaultTargetOnly&&!n.defaultTargetOnly||h===r.target)&&c.defaultFn.apply(h,t),c._broadcast(t);if(f[1]&&!c.prevented&&c.stopped<2)if(n.id===c.id||c.type!=h._yuievt.bubbling){c._procSubs(f[1],t,r);while(p=n.afterQueue.last())p()}else l=f[1],n.execDefaultCnt&&(l=e.merge(l),e.each(l,function(e){e.postponed=!0})),n.afterQueue.add(function(){c._procSubs(l,t,r)});c.target=null;if(n.id===c.id){s=n.queue;while(s.length)i=s.pop(),o=i[0],n.next=o,o.fire.apply(o,i[1]);c.stack=null}return u=!c.stopped,c.type!=h._yuievt.bubbling&&(n.stopped=0,n.prevented=0,c.stopped=0,c.prevented=0),c._facade=null,u},o._getFacade=function(){var t=this._facade,n,r=this.details;return t||(t=new e.EventFacade(this,this.currentTarget)),n=r&&r[0],e.Lang.isObject(n,!0)&&(a(t,n),t.type=n.type||t.type),t.details=this.details,t.target=this.originalTarget||this.target,t.currentTarget=this.currentTarget,t.stopped=0,t.prevented=0,this._facade=t,this._facade},o.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},o.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},o.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},o.halt=function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},u.addTarget=function(t){this._yuievt.targets[e.stamp(t)]=t,this._yuievt.hasTargets=!0},u.getTargets=function(){return e.Object.values(this._yuievt.targets)},u.removeTarget=function(t){delete this._yuievt.targets[e.stamp(t)]},u.bubble=function(e,t,n,r){var i=this._yuievt.targets,s=!0,o,u=e&&e.type,a,f,l,c,h=n||e&&e.target||this,p;if(!e||!e.stopped&&i)for(f in i)if(i.hasOwnProperty(f)){o=i[f],a=o.getEvent(u,!0),c=o.getSibling(u,a),c&&!a&&(a=o.publish(u)),p=o._yuievt.bubbling,o._yuievt.bubbling=u;if(!a)o._yuievt.hasTargets&&o.bubble(e,t,h,r);else{a.sibling=c,a.target=h,a.originalTarget=h,a.currentTarget=o,l=a.broadcast,a.broadcast=!1,a.emitFacade=!0,a.stack=r,s=s&&a.fire.apply(a,t||e.details||[]),a.broadcast=l,a.originalTarget=null;if(a.stopped)break}o._yuievt.bubbling=p}return s},n=new e.EventFacade,r={};for(i in n)r[i]=!0},"3.7.2",{requires:["event-custom-base"]});+YUI.add("event-custom-complex",function(e,t){var n,r,i,s={},o=e.CustomEvent.prototype,u=e.EventTarget.prototype,a=function(e,t){var n;for(n in t)r.hasOwnProperty(n)||(e[n]=t[n])};e.EventFacade=function(e,t){e=e||s,this._event=e,this.details=e.details,this.type=e.type,this._type=e.type,this.target=e.target,this.currentTarget=t,this.relatedTarget=e.relatedTarget},e.mix(e.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(e){this._event.halt(e),this.prevented=1,this.stopped=e?2:1}}),o.fireComplex=function(t){var n,r,i,s,o,u,a,f,l,c=this,h=c.host||c,p,d;if(c.stack&&c.queuable&&c.type!=c.stack.next.type)return c.stack.queue.push([c,t]),!0;n=c.stack||{id:c.id,next:c,silent:c.silent,stopped:0,prevented:0,bubbling:null,type:c.type,afterQueue:new e.Queue,defaultTargetOnly:c.defaultTargetOnly,queue:[]},f=c.getSubs(),c.stopped=c.type!==n.type?0:n.stopped,c.prevented=c.type!==n.type?0:n.prevented,c.target=c.target||h,c.stoppedFn&&(a=new e.EventTarget({fireOnce:!0,context:h}),c.events=a,a.on("stopped",c.stoppedFn)),c.currentTarget=h,c.details=t.slice(),c._facade=null,r=c._getFacade(t),e.Lang.isObject(t[0])?t[0]=r:t.unshift(r),f[0]&&c._procSubs(f[0],t,r),c.bubbles&&h.bubble&&!c.stopped&&(d=n.bubbling,n.bubbling=c.type,n.type!=c.type&&(n.stopped=0,n.prevented=0),u=h.bubble(c,t,null,n),c.stopped=Math.max(c.stopped,n.stopped),c.prevented=Math.max(c.prevented,n.prevented),n.bubbling=d),c.prevented?c.preventedFn&&c.preventedFn.apply(h,t):c.defaultFn&&(!c.defaultTargetOnly&&!n.defaultTargetOnly||h===r.target)&&c.defaultFn.apply(h,t),c._broadcast(t);if(f[1]&&!c.prevented&&c.stopped<2)if(n.id===c.id||c.type!=h._yuievt.bubbling){c._procSubs(f[1],t,r);while(p=n.afterQueue.last())p()}else l=f[1],n.execDefaultCnt&&(l=e.merge(l),e.each(l,function(e){e.postponed=!0})),n.afterQueue.add(function(){c._procSubs(l,t,r)});c.target=null;if(n.id===c.id){s=n.queue;while(s.length)i=s.pop(),o=i[0],n.next=o,o.fire.apply(o,i[1]);c.stack=null}return u=!c.stopped,c.type!=h._yuievt.bubbling&&(n.stopped=0,n.prevented=0,c.stopped=0,c.prevented=0),c._facade=null,u},o._getFacade=function(){var t=this._facade,n,r=this.details;return t||(t=new e.EventFacade(this,this.currentTarget)),n=r&&r[0],e.Lang.isObject(n,!0)&&(a(t,n),t.type=n.type||t.type),t.details=this.details,t.target=this.originalTarget||this.target,t.currentTarget=this.currentTarget,t.stopped=0,t.prevented=0,this._facade=t,this._facade},o.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},o.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},o.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},o.halt=function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},u.addTarget=function(t){this._yuievt.targets[e.stamp(t)]=t,this._yuievt.hasTargets=!0},u.getTargets=function(){return e.Object.values(this._yuievt.targets)},u.removeTarget=function(t){delete this._yuievt.targets[e.stamp(t)]},u.bubble=function(e,t,n,r){var i=this._yuievt.targets,s=!0,o,u=e&&e.type,a,f,l,c,h=n||e&&e.target||this,p;if(!e||!e.stopped&&i)for(f in i)if(i.hasOwnProperty(f)){o=i[f],a=o.getEvent(u,!0),c=o.getSibling(u,a),c&&!a&&(a=o.publish(u)),p=o._yuievt.bubbling,o._yuievt.bubbling=u;if(!a)o._yuievt.hasTargets&&o.bubble(e,t,h,r);else{a.sibling=c,a.target=h,a.originalTarget=h,a.currentTarget=o,l=a.broadcast,a.broadcast=!1,a.emitFacade=!0,a.stack=r,s=s&&a.fire.apply(a,t||e.details||[]),a.broadcast=l,a.originalTarget=null;if(a.stopped)break}o._yuievt.bubbling=p}return s},n=new e.EventFacade,r={};for(i in n)r[i]=!0},"3.7.3",{requires:["event-custom-base"]});
bundle/event-custom-complex/event-custom-complex.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -505,4 +505,4 @@ FACADE_KEYS[key] = true; } -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]});
bundle/event-delegate/event-delegate-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-delegate/event-delegate.js", code: [] };-_yuitest_coverage["build/event-delegate/event-delegate.js"].code=["YUI.add('event-delegate', function (Y, NAME) {","","/**"," * Adds event delegation support to the library."," *"," * @module event"," * @submodule event-delegate"," */","","var toArray = Y.Array,"," YLang = Y.Lang,"," isString = YLang.isString,"," isObject = YLang.isObject,"," isArray = YLang.isArray,"," selectorTest = Y.Selector.test,"," detachCategories = Y.Env.evt.handles;","","/**"," * <p>Sets up event delegation on a container element. The delegated event"," * will use a supplied selector or filtering function to test if the event"," * references at least one node that should trigger the subscription"," * callback.</p>"," *"," * <p>Selector string filters will trigger the callback if the event originated"," * from a node that matches it or is contained in a node that matches it."," * Function filters are called for each Node up the parent axis to the"," * subscribing container node, and receive at each level the Node and the event"," * object. The function should return true (or a truthy value) if that Node"," * should trigger the subscription callback. Note, it is possible for filters"," * to match multiple Nodes for a single event. In this case, the delegate"," * callback will be executed for each matching Node.</p>"," *"," * <p>For each matching Node, the callback will be executed with its 'this'"," * object set to the Node matched by the filter (unless a specific context was"," * provided during subscription), and the provided event's"," * <code>currentTarget</code> will also be set to the matching Node. The"," * containing Node from which the subscription was originally made can be"," * referenced as <code>e.container</code>."," *"," * @method delegate"," * @param type {String} the event type to delegate"," * @param fn {Function} the callback function to execute. This function"," * will be provided the event object for the delegated event."," * @param el {String|node} the element that is the delegation container"," * @param filter {string|Function} a selector that must match the target of the"," * event or a function to test target and its parents for a match"," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @static"," * @for Event"," */","function delegate(type, fn, el, filter) {"," var args = toArray(arguments, 0, true),"," query = isString(el) ? el : null,"," typeBits, synth, container, categories, cat, i, len, handles, handle;",""," // Support Y.delegate({ click: fnA, key: fnB }, el, filter, ...);"," // and Y.delegate(['click', 'key'], fn, el, filter, ...);"," if (isObject(type)) {"," handles = [];",""," if (isArray(type)) {"," for (i = 0, len = type.length; i < len; ++i) {"," args[0] = type[i];"," handles.push(Y.delegate.apply(Y, args));"," }"," } else {"," // Y.delegate({'click', fn}, el, filter) =>"," // Y.delegate('click', fn, el, filter)"," args.unshift(null); // one arg becomes two; need to make space",""," for (i in type) {"," if (type.hasOwnProperty(i)) {"," args[0] = i;"," args[1] = type[i];"," handles.push(Y.delegate.apply(Y, args));"," }"," }"," }",""," return new Y.EventHandle(handles);"," }",""," typeBits = type.split(/\\|/);",""," if (typeBits.length > 1) {"," cat = typeBits.shift();"," args[0] = type = typeBits.shift();"," }",""," synth = Y.Node.DOM_EVENTS[type];",""," if (isObject(synth) && synth.delegate) {"," handle = synth.delegate.apply(synth, arguments);"," }",""," if (!handle) {"," if (!type || !fn || !el || !filter) {"," return;"," }",""," container = (query) ? Y.Selector.query(query, null, true) : el;",""," if (!container && isString(el)) {"," handle = Y.on('available', function () {"," Y.mix(handle, Y.delegate.apply(Y, args), true);"," }, el);"," }",""," if (!handle && container) {"," args.splice(2, 2, container); // remove the filter",""," handle = Y.Event._attach(args, { facade: false });"," handle.sub.filter = filter;"," handle.sub._notify = delegate.notifySub;"," }"," }",""," if (handle && cat) {"," categories = detachCategories[cat] || (detachCategories[cat] = {});"," categories = categories[type] || (categories[type] = []);"," categories.push(handle);"," }",""," return handle;","}","","/**","Overrides the <code>_notify</code> method on the normal DOM subscription to","inject the filtering logic and only proceed in the case of a match.","","This method is hosted as a private property of the `delegate` method","(e.g. `Y.delegate.notifySub`)","","@method notifySub","@param thisObj {Object} default 'this' object for the callback","@param args {Array} arguments passed to the event's <code>fire()</code>","@param ce {CustomEvent} the custom event managing the DOM subscriptions for"," the subscribed event on the subscribing node.","@return {Boolean} false if the event was stopped","@private","@static","@since 3.2.0","**/","delegate.notifySub = function (thisObj, args, ce) {"," // Preserve args for other subscribers"," args = args.slice();"," if (this.args) {"," args.push.apply(args, this.args);"," }",""," // Only notify subs if the event occurred on a targeted element"," var currentTarget = delegate._applyFilter(this.filter, args, ce),"," //container = e.currentTarget,"," e, i, len, ret;",""," if (currentTarget) {"," // Support multiple matches up the the container subtree"," currentTarget = toArray(currentTarget);",""," // The second arg is the currentTarget, but we'll be reusing this"," // facade, replacing the currentTarget for each use, so it doesn't"," // matter what element we seed it with."," e = args[0] = new Y.DOMEventFacade(args[0], ce.el, ce);",""," e.container = Y.one(ce.el);",""," for (i = 0, len = currentTarget.length; i < len && !e.stopped; ++i) {"," e.currentTarget = Y.one(currentTarget[i]);",""," ret = this.fn.apply(this.context || e.currentTarget, args);",""," if (ret === false) { // stop further notifications"," break;"," }"," }",""," return ret;"," }","};","","/**","Compiles a selector string into a filter function to identify whether","Nodes along the parent axis of an event's target should trigger event","notification.","","This function is memoized, so previously compiled filter functions are","returned if the same selector string is provided.","","This function may be useful when defining synthetic events for delegate","handling.","","Hosted as a property of the `delegate` method (e.g. `Y.delegate.compileFilter`).","","@method compileFilter","@param selector {String} the selector string to base the filtration on","@return {Function}","@since 3.2.0","@static","**/","delegate.compileFilter = Y.cached(function (selector) {"," return function (target, e) {"," return selectorTest(target._node, selector,"," (e.currentTarget === e.target) ? null : e.currentTarget._node);"," };","});","","/**","Walks up the parent axis of an event's target, and tests each element","against a supplied filter function. If any Nodes, including the container,","satisfy the filter, the delegated callback will be triggered for each.","","Hosted as a protected property of the `delegate` method (e.g.","`Y.delegate._applyFilter`).","","@method _applyFilter","@param filter {Function} boolean function to test for inclusion in event"," notification","@param args {Array} the arguments that would be passed to subscribers","@param ce {CustomEvent} the DOM event wrapper","@return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter","@protected","**/","delegate._applyFilter = function (filter, args, ce) {"," var e = args[0],"," container = ce.el, // facadeless events in IE, have no e.currentTarget"," target = e.target || e.srcElement,"," match = [],"," isContainer = false;",""," // Resolve text nodes to their containing element"," if (target.nodeType === 3) {"," target = target.parentNode;"," }",""," // passing target as the first arg rather than leaving well enough alone"," // making 'this' in the filter function refer to the target. This is to"," // support bound filter functions."," args.unshift(target);",""," if (isString(filter)) {"," while (target) {"," isContainer = (target === container);"," if (selectorTest(target, filter, (isContainer ? null: container))) {"," match.push(target);"," }",""," if (isContainer) {"," break;"," }",""," target = target.parentNode;"," }"," } else {"," // filter functions are implementer code and should receive wrappers"," args[0] = Y.one(target);"," args[1] = new Y.DOMEventFacade(e, container, ce);",""," while (target) {"," // filter(target, e, extra args...) - this === target"," if (filter.apply(args[0], args)) {"," match.push(target);"," }",""," if (target === container) {"," break;"," }",""," target = target.parentNode;"," args[0] = Y.one(target);"," }"," args[1] = e; // restore the raw DOM event"," }",""," if (match.length <= 1) {"," match = match[0]; // single match or undefined"," }",""," // remove the target"," args.shift();",""," return match;","};","","/**"," * Sets up event delegation on a container element. The delegated event"," * will use a supplied filter to test if the callback should be executed."," * This filter can be either a selector string or a function that returns"," * a Node to use as the currentTarget for the event."," *"," * The event object for the delegated event is supplied to the callback"," * function. It is modified slightly in order to support all properties"," * that may be needed for event delegation. 'currentTarget' is set to"," * the element that matched the selector string filter or the Node returned"," * from the filter function. 'container' is set to the element that the"," * listener is delegated from (this normally would be the 'currentTarget')."," *"," * Filter functions will be called with the arguments that would be passed to"," * the callback function, including the event object as the first parameter."," * The function should return false (or a falsey value) if the success criteria"," * aren't met, and the Node to use as the event's currentTarget and 'this'"," * object if they are."," *"," * @method delegate"," * @param type {string} the event type to delegate"," * @param fn {function} the callback function to execute. This function"," * will be provided the event object for the delegated event."," * @param el {string|node} the element that is the delegation container"," * @param filter {string|function} a selector that must match the target of the"," * event or a function that returns a Node or false."," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.delegate = Y.Event.delegate = delegate;","","","}, '3.7.2', {\"requires\": [\"node-base\"]});"];+_yuitest_coverage["build/event-delegate/event-delegate.js"].code=["YUI.add('event-delegate', function (Y, NAME) {","","/**"," * Adds event delegation support to the library."," *"," * @module event"," * @submodule event-delegate"," */","","var toArray = Y.Array,"," YLang = Y.Lang,"," isString = YLang.isString,"," isObject = YLang.isObject,"," isArray = YLang.isArray,"," selectorTest = Y.Selector.test,"," detachCategories = Y.Env.evt.handles;","","/**"," * <p>Sets up event delegation on a container element. The delegated event"," * will use a supplied selector or filtering function to test if the event"," * references at least one node that should trigger the subscription"," * callback.</p>"," *"," * <p>Selector string filters will trigger the callback if the event originated"," * from a node that matches it or is contained in a node that matches it."," * Function filters are called for each Node up the parent axis to the"," * subscribing container node, and receive at each level the Node and the event"," * object. The function should return true (or a truthy value) if that Node"," * should trigger the subscription callback. Note, it is possible for filters"," * to match multiple Nodes for a single event. In this case, the delegate"," * callback will be executed for each matching Node.</p>"," *"," * <p>For each matching Node, the callback will be executed with its 'this'"," * object set to the Node matched by the filter (unless a specific context was"," * provided during subscription), and the provided event's"," * <code>currentTarget</code> will also be set to the matching Node. The"," * containing Node from which the subscription was originally made can be"," * referenced as <code>e.container</code>."," *"," * @method delegate"," * @param type {String} the event type to delegate"," * @param fn {Function} the callback function to execute. This function"," * will be provided the event object for the delegated event."," * @param el {String|node} the element that is the delegation container"," * @param filter {string|Function} a selector that must match the target of the"," * event or a function to test target and its parents for a match"," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @static"," * @for Event"," */","function delegate(type, fn, el, filter) {"," var args = toArray(arguments, 0, true),"," query = isString(el) ? el : null,"," typeBits, synth, container, categories, cat, i, len, handles, handle;",""," // Support Y.delegate({ click: fnA, key: fnB }, el, filter, ...);"," // and Y.delegate(['click', 'key'], fn, el, filter, ...);"," if (isObject(type)) {"," handles = [];",""," if (isArray(type)) {"," for (i = 0, len = type.length; i < len; ++i) {"," args[0] = type[i];"," handles.push(Y.delegate.apply(Y, args));"," }"," } else {"," // Y.delegate({'click', fn}, el, filter) =>"," // Y.delegate('click', fn, el, filter)"," args.unshift(null); // one arg becomes two; need to make space",""," for (i in type) {"," if (type.hasOwnProperty(i)) {"," args[0] = i;"," args[1] = type[i];"," handles.push(Y.delegate.apply(Y, args));"," }"," }"," }",""," return new Y.EventHandle(handles);"," }",""," typeBits = type.split(/\\|/);",""," if (typeBits.length > 1) {"," cat = typeBits.shift();"," args[0] = type = typeBits.shift();"," }",""," synth = Y.Node.DOM_EVENTS[type];",""," if (isObject(synth) && synth.delegate) {"," handle = synth.delegate.apply(synth, arguments);"," }",""," if (!handle) {"," if (!type || !fn || !el || !filter) {"," return;"," }",""," container = (query) ? Y.Selector.query(query, null, true) : el;",""," if (!container && isString(el)) {"," handle = Y.on('available', function () {"," Y.mix(handle, Y.delegate.apply(Y, args), true);"," }, el);"," }",""," if (!handle && container) {"," args.splice(2, 2, container); // remove the filter",""," handle = Y.Event._attach(args, { facade: false });"," handle.sub.filter = filter;"," handle.sub._notify = delegate.notifySub;"," }"," }",""," if (handle && cat) {"," categories = detachCategories[cat] || (detachCategories[cat] = {});"," categories = categories[type] || (categories[type] = []);"," categories.push(handle);"," }",""," return handle;","}","","/**","Overrides the <code>_notify</code> method on the normal DOM subscription to","inject the filtering logic and only proceed in the case of a match.","","This method is hosted as a private property of the `delegate` method","(e.g. `Y.delegate.notifySub`)","","@method notifySub","@param thisObj {Object} default 'this' object for the callback","@param args {Array} arguments passed to the event's <code>fire()</code>","@param ce {CustomEvent} the custom event managing the DOM subscriptions for"," the subscribed event on the subscribing node.","@return {Boolean} false if the event was stopped","@private","@static","@since 3.2.0","**/","delegate.notifySub = function (thisObj, args, ce) {"," // Preserve args for other subscribers"," args = args.slice();"," if (this.args) {"," args.push.apply(args, this.args);"," }",""," // Only notify subs if the event occurred on a targeted element"," var currentTarget = delegate._applyFilter(this.filter, args, ce),"," //container = e.currentTarget,"," e, i, len, ret;",""," if (currentTarget) {"," // Support multiple matches up the the container subtree"," currentTarget = toArray(currentTarget);",""," // The second arg is the currentTarget, but we'll be reusing this"," // facade, replacing the currentTarget for each use, so it doesn't"," // matter what element we seed it with."," e = args[0] = new Y.DOMEventFacade(args[0], ce.el, ce);",""," e.container = Y.one(ce.el);",""," for (i = 0, len = currentTarget.length; i < len && !e.stopped; ++i) {"," e.currentTarget = Y.one(currentTarget[i]);",""," ret = this.fn.apply(this.context || e.currentTarget, args);",""," if (ret === false) { // stop further notifications"," break;"," }"," }",""," return ret;"," }","};","","/**","Compiles a selector string into a filter function to identify whether","Nodes along the parent axis of an event's target should trigger event","notification.","","This function is memoized, so previously compiled filter functions are","returned if the same selector string is provided.","","This function may be useful when defining synthetic events for delegate","handling.","","Hosted as a property of the `delegate` method (e.g. `Y.delegate.compileFilter`).","","@method compileFilter","@param selector {String} the selector string to base the filtration on","@return {Function}","@since 3.2.0","@static","**/","delegate.compileFilter = Y.cached(function (selector) {"," return function (target, e) {"," return selectorTest(target._node, selector,"," (e.currentTarget === e.target) ? null : e.currentTarget._node);"," };","});","","/**","Walks up the parent axis of an event's target, and tests each element","against a supplied filter function. If any Nodes, including the container,","satisfy the filter, the delegated callback will be triggered for each.","","Hosted as a protected property of the `delegate` method (e.g.","`Y.delegate._applyFilter`).","","@method _applyFilter","@param filter {Function} boolean function to test for inclusion in event"," notification","@param args {Array} the arguments that would be passed to subscribers","@param ce {CustomEvent} the DOM event wrapper","@return {Node|Node[]|undefined} The Node or Nodes that satisfy the filter","@protected","**/","delegate._applyFilter = function (filter, args, ce) {"," var e = args[0],"," container = ce.el, // facadeless events in IE, have no e.currentTarget"," target = e.target || e.srcElement,"," match = [],"," isContainer = false;",""," // Resolve text nodes to their containing element"," if (target.nodeType === 3) {"," target = target.parentNode;"," }",""," // passing target as the first arg rather than leaving well enough alone"," // making 'this' in the filter function refer to the target. This is to"," // support bound filter functions."," args.unshift(target);",""," if (isString(filter)) {"," while (target) {"," isContainer = (target === container);"," if (selectorTest(target, filter, (isContainer ? null: container))) {"," match.push(target);"," }",""," if (isContainer) {"," break;"," }",""," target = target.parentNode;"," }"," } else {"," // filter functions are implementer code and should receive wrappers"," args[0] = Y.one(target);"," args[1] = new Y.DOMEventFacade(e, container, ce);",""," while (target) {"," // filter(target, e, extra args...) - this === target"," if (filter.apply(args[0], args)) {"," match.push(target);"," }",""," if (target === container) {"," break;"," }",""," target = target.parentNode;"," args[0] = Y.one(target);"," }"," args[1] = e; // restore the raw DOM event"," }",""," if (match.length <= 1) {"," match = match[0]; // single match or undefined"," }",""," // remove the target"," args.shift();",""," return match;","};","","/**"," * Sets up event delegation on a container element. The delegated event"," * will use a supplied filter to test if the callback should be executed."," * This filter can be either a selector string or a function that returns"," * a Node to use as the currentTarget for the event."," *"," * The event object for the delegated event is supplied to the callback"," * function. It is modified slightly in order to support all properties"," * that may be needed for event delegation. 'currentTarget' is set to"," * the element that matched the selector string filter or the Node returned"," * from the filter function. 'container' is set to the element that the"," * listener is delegated from (this normally would be the 'currentTarget')."," *"," * Filter functions will be called with the arguments that would be passed to"," * the callback function, including the event object as the first parameter."," * The function should return false (or a falsey value) if the success criteria"," * aren't met, and the Node to use as the event's currentTarget and 'this'"," * object if they are."," *"," * @method delegate"," * @param type {string} the event type to delegate"," * @param fn {function} the callback function to execute. This function"," * will be provided the event object for the delegated event."," * @param el {string|node} the element that is the delegation container"," * @param filter {string|function} a selector that must match the target of the"," * event or a function that returns a Node or false."," * @param context optional argument that specifies what 'this' refers to."," * @param args* 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.delegate = Y.Event.delegate = delegate;","","","}, '3.7.3', {\"requires\": [\"node-base\"]});"]; _yuitest_coverage["build/event-delegate/event-delegate.js"].lines = {"1":0,"10":0,"54":0,"55":0,"61":0,"62":0,"64":0,"65":0,"66":0,"67":0,"72":0,"74":0,"75":0,"76":0,"77":0,"78":0,"83":0,"86":0,"88":0,"89":0,"90":0,"93":0,"95":0,"96":0,"99":0,"100":0,"101":0,"104":0,"106":0,"107":0,"108":0,"112":0,"113":0,"115":0,"116":0,"117":0,"121":0,"122":0,"123":0,"124":0,"127":0,"147":0,"149":0,"150":0,"151":0,"155":0,"159":0,"161":0,"166":0,"168":0,"170":0,"171":0,"173":0,"175":0,"176":0,"180":0,"203":0,"204":0,"205":0,"226":0,"227":0,"234":0,"235":0,"241":0,"243":0,"244":0,"245":0,"246":0,"247":0,"250":0,"251":0,"254":0,"258":0,"259":0,"261":0,"263":0,"264":0,"267":0,"268":0,"271":0,"272":0,"274":0,"277":0,"278":0,"282":0,"284":0,"319":0}; _yuitest_coverage["build/event-delegate/event-delegate.js"].functions = {"(anonymous 2):107":0,"delegate:54":0,"notifySub:147":0,"(anonymous 4):204":0,"(anonymous 3):203":0,"_applyFilter:226":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-delegate/event-delegate.js"].coveredLines = 87;@@ -452,4 +452,4 @@ Y.delegate = Y.Event.delegate = delegate; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-delegate/event-delegate-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -326,4 +326,4 @@ Y.delegate = Y.Event.delegate = delegate; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-delegate/event-delegate-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-delegate",function(e,t){function f(t,r,u,l){var c=n(arguments,0,!0),h=i(u)?u:null,p,d,v,m,g,y,b,w,E;if(s(t)){w=[];if(o(t))for(y=0,b=t.length;y<b;++y)c[0]=t[y],w.push(e.delegate.apply(e,c));else{c.unshift(null);for(y in t)t.hasOwnProperty(y)&&(c[0]=y,c[1]=t[y],w.push(e.delegate.apply(e,c)))}return new e.EventHandle(w)}p=t.split(/\|/),p.length>1&&(g=p.shift(),c[0]=t=p.shift()),d=e.Node.DOM_EVENTS[t],s(d)&&d.delegate&&(E=d.delegate.apply(d,arguments));if(!E){if(!t||!r||!u||!l)return;v=h?e.Selector.query(h,null,!0):u,!v&&i(u)&&(E=e.on("available",function(){e.mix(E,e.delegate.apply(e,c),!0)},u)),!E&&v&&(c.splice(2,2,v),E=e.Event._attach(c,{facade:!1}),E.sub.filter=l,E.sub._notify=f.notifySub)}return E&&g&&(m=a[g]||(a[g]={}),m=m[t]||(m[t]=[]),m.push(E)),E}var n=e.Array,r=e.Lang,i=r.isString,s=r.isObject,o=r.isArray,u=e.Selector.test,a=e.Env.evt.handles;f.notifySub=function(t,r,i){r=r.slice(),this.args&&r.push.apply(r,this.args);var s=f._applyFilter(this.filter,r,i),o,u,a,l;if(s){s=n(s),o=r[0]=new e.DOMEventFacade(r[0],i.el,i),o.container=e.one(i.el);for(u=0,a=s.length;u<a&&!o.stopped;++u){o.currentTarget=e.one(s[u]),l=this.fn.apply(this.context||o.currentTarget,r);if(l===!1)break}return l}},f.compileFilter=e.cached(function(e){return function(t,n){return u(t._node,e,n.currentTarget===n.target?null:n.currentTarget._node)}}),f._applyFilter=function(t,n,r){var s=n[0],o=r.el,a=s.target||s.srcElement,f=[],l=!1;a.nodeType===3&&(a=a.parentNode),n.unshift(a);if(i(t))while(a){l=a===o,u(a,t,l?null:o)&&f.push(a);if(l)break;a=a.parentNode}else{n[0]=e.one(a),n[1]=new e.DOMEventFacade(s,o,r);while(a){t.apply(n[0],n)&&f.push(a);if(a===o)break;a=a.parentNode,n[0]=e.one(a)}n[1]=s}return f.length<=1&&(f=f[0]),n.shift(),f},e.delegate=e.Event.delegate=f},"3.7.2",{requires:["node-base"]});+YUI.add("event-delegate",function(e,t){function f(t,r,u,l){var c=n(arguments,0,!0),h=i(u)?u:null,p,d,v,m,g,y,b,w,E;if(s(t)){w=[];if(o(t))for(y=0,b=t.length;y<b;++y)c[0]=t[y],w.push(e.delegate.apply(e,c));else{c.unshift(null);for(y in t)t.hasOwnProperty(y)&&(c[0]=y,c[1]=t[y],w.push(e.delegate.apply(e,c)))}return new e.EventHandle(w)}p=t.split(/\|/),p.length>1&&(g=p.shift(),c[0]=t=p.shift()),d=e.Node.DOM_EVENTS[t],s(d)&&d.delegate&&(E=d.delegate.apply(d,arguments));if(!E){if(!t||!r||!u||!l)return;v=h?e.Selector.query(h,null,!0):u,!v&&i(u)&&(E=e.on("available",function(){e.mix(E,e.delegate.apply(e,c),!0)},u)),!E&&v&&(c.splice(2,2,v),E=e.Event._attach(c,{facade:!1}),E.sub.filter=l,E.sub._notify=f.notifySub)}return E&&g&&(m=a[g]||(a[g]={}),m=m[t]||(m[t]=[]),m.push(E)),E}var n=e.Array,r=e.Lang,i=r.isString,s=r.isObject,o=r.isArray,u=e.Selector.test,a=e.Env.evt.handles;f.notifySub=function(t,r,i){r=r.slice(),this.args&&r.push.apply(r,this.args);var s=f._applyFilter(this.filter,r,i),o,u,a,l;if(s){s=n(s),o=r[0]=new e.DOMEventFacade(r[0],i.el,i),o.container=e.one(i.el);for(u=0,a=s.length;u<a&&!o.stopped;++u){o.currentTarget=e.one(s[u]),l=this.fn.apply(this.context||o.currentTarget,r);if(l===!1)break}return l}},f.compileFilter=e.cached(function(e){return function(t,n){return u(t._node,e,n.currentTarget===n.target?null:n.currentTarget._node)}}),f._applyFilter=function(t,n,r){var s=n[0],o=r.el,a=s.target||s.srcElement,f=[],l=!1;a.nodeType===3&&(a=a.parentNode),n.unshift(a);if(i(t))while(a){l=a===o,u(a,t,l?null:o)&&f.push(a);if(l)break;a=a.parentNode}else{n[0]=e.one(a),n[1]=new e.DOMEventFacade(s,o,r);while(a){t.apply(n[0],n)&&f.push(a);if(a===o)break;a=a.parentNode,n[0]=e.one(a)}n[1]=s}return f.length<=1&&(f=f[0]),n.shift(),f},e.delegate=e.Event.delegate=f},"3.7.3",{requires:["node-base"]});
bundle/event-delegate/event-delegate.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -325,4 +325,4 @@ Y.delegate = Y.Event.delegate = delegate; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-flick/event-flick-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/event-flick/event-flick.js", code: [] };-_yuitest_coverage["build/event-flick/event-flick.js"].code=["YUI.add('event-flick', function (Y, NAME) {","","/**"," * The gestures module provides gesture events such as \"flick\", which normalize user interactions"," * across touch and mouse or pointer based input devices. This layer can be used by application developers"," * to build input device agnostic components which behave the same in response to either touch or mouse based "," * interaction."," *"," * <p>Documentation for events added by this module can be found in the event document for the <a href=\"YUI.html#events\">YUI</a> global.</p>"," *"," * @module event-gestures"," */","","/**"," * Adds support for a \"flick\" event, which is fired at the end of a touch or mouse based flick gesture, and provides "," * velocity of the flick, along with distance and time information."," *"," * @module event-gestures"," * @submodule event-flick"," */","var GESTURE_MAP = Y.Event._GESTURE_MAP,"," EVENT = {"," start: GESTURE_MAP.start,"," end: GESTURE_MAP.end,"," move: GESTURE_MAP.move"," },"," START = \"start\","," END = \"end\","," MOVE = \"move\",",""," OWNER_DOCUMENT = \"ownerDocument\","," MIN_VELOCITY = \"minVelocity\","," MIN_DISTANCE = \"minDistance\","," PREVENT_DEFAULT = \"preventDefault\",",""," _FLICK_START = \"_fs\","," _FLICK_START_HANDLE = \"_fsh\","," _FLICK_END_HANDLE = \"_feh\","," _FLICK_MOVE_HANDLE = \"_fmh\",",""," NODE_TYPE = \"nodeType\";","","/**"," * Sets up a \"flick\" event, that is fired whenever the user initiates a flick gesture on the node"," * where the listener is attached. The subscriber can specify a minimum distance or velocity for"," * which the event is to be fired. The subscriber can also specify if there is a particular axis which"," * they are interested in - \"x\" or \"y\". If no axis is specified, the axis along which there was most distance"," * covered is used."," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to \"on\", "," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"flick\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," * @event flick"," * @for YUI"," * @param type {string} \"flick\""," * @param fn {function} The method the event invokes. It receives an event facade with an e.flick object containing the flick related properties: e.flick.time, e.flick.distance, e.flick.velocity and e.flick.axis, e.flick.start."," * @param cfg {Object} Optional. An object which specifies any of the following:"," * <dl>"," * <dt>minDistance (in pixels, defaults to 10)</dt>"," * <dd>The minimum distance between start and end points, which would qualify the gesture as a flick.</dd>"," * <dt>minVelocity (in pixels/ms, defaults to 0)</dt>"," * <dd>The minimum velocity which would qualify the gesture as a flick.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be "," * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it.</dd>"," * <dt>axis (no default)</dt>"," * <dd>Can be set to \"x\" or \"y\" if you want to constrain the flick velocity and distance to a single axis. If not"," * defined, the axis along which the maximum distance was covered is used.</dd>"," * </dl>"," * @return {EventHandle} the detach handle"," */","","Y.Event.define('flick', {",""," on: function (node, subscriber, ce) {",""," var startHandle = node.on(EVENT[START],"," this._onStart,"," this,"," node,"," subscriber, "," ce);"," "," subscriber[_FLICK_START_HANDLE] = startHandle;"," },",""," detach: function (node, subscriber, ce) {",""," var startHandle = subscriber[_FLICK_START_HANDLE],"," endHandle = subscriber[_FLICK_END_HANDLE];",""," if (startHandle) {"," startHandle.detach();"," subscriber[_FLICK_START_HANDLE] = null;"," }",""," if (endHandle) {"," endHandle.detach();"," subscriber[_FLICK_END_HANDLE] = null;"," }"," },",""," processArgs: function(args) {"," var params = (args.length > 3) ? Y.merge(args.splice(3, 1)[0]) : {};",""," if (!(MIN_VELOCITY in params)) {"," params[MIN_VELOCITY] = this.MIN_VELOCITY;"," }",""," if (!(MIN_DISTANCE in params)) {"," params[MIN_DISTANCE] = this.MIN_DISTANCE;"," }",""," if (!(PREVENT_DEFAULT in params)) {"," params[PREVENT_DEFAULT] = this.PREVENT_DEFAULT;"," }",""," return params;"," },",""," _onStart: function(e, node, subscriber, ce) {",""," var start = true, // always true for mouse"," endHandle,"," moveHandle,"," doc,"," preventDefault = subscriber._extra.preventDefault,"," origE = e; ",""," if (e.touches) {"," start = (e.touches.length === 1);"," e = e.touches[0];"," }",""," if (start) {",""," if (preventDefault) {"," // preventDefault is a boolean or function"," if (!preventDefault.call || preventDefault(e)) {"," origE.preventDefault();"," }"," }",""," e.flick = {"," time : new Date().getTime()"," };",""," subscriber[_FLICK_START] = e;",""," endHandle = subscriber[_FLICK_END_HANDLE];",""," doc = (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);"," if (!endHandle) {"," endHandle = doc.on(EVENT[END], Y.bind(this._onEnd, this), null, node, subscriber, ce);"," subscriber[_FLICK_END_HANDLE] = endHandle;"," }",""," subscriber[_FLICK_MOVE_HANDLE] = doc.once(EVENT[MOVE], Y.bind(this._onMove, this), null, node, subscriber, ce);"," }"," },",""," _onMove: function(e, node, subscriber, ce) {"," var start = subscriber[_FLICK_START];",""," // Start timing from first move."," if (start && start.flick) {"," start.flick.time = new Date().getTime();"," }"," },",""," _onEnd: function(e, node, subscriber, ce) {",""," var endTime = new Date().getTime(),"," start = subscriber[_FLICK_START],"," valid = !!start,"," endEvent = e,"," startTime,"," time,"," preventDefault,"," params,"," xyDistance, "," distance,"," velocity,"," axis,"," moveHandle = subscriber[_FLICK_MOVE_HANDLE];",""," if (moveHandle) {"," moveHandle.detach();"," delete subscriber[_FLICK_MOVE_HANDLE];"," }",""," if (valid) {",""," if (e.changedTouches) {"," if (e.changedTouches.length === 1 && e.touches.length === 0) {"," endEvent = e.changedTouches[0];"," } else {"," valid = false;"," }"," }",""," if (valid) {",""," params = subscriber._extra;"," preventDefault = params[PREVENT_DEFAULT];",""," if (preventDefault) {"," // preventDefault is a boolean or function"," if (!preventDefault.call || preventDefault(e)) {"," e.preventDefault();"," }"," }",""," startTime = start.flick.time;"," endTime = new Date().getTime();"," time = endTime - startTime;",""," xyDistance = ["," endEvent.pageX - start.pageX,"," endEvent.pageY - start.pageY"," ];",""," if (params.axis) {"," axis = params.axis;"," } else {"," axis = (Math.abs(xyDistance[0]) >= Math.abs(xyDistance[1])) ? 'x' : 'y';"," }",""," distance = xyDistance[(axis === 'x') ? 0 : 1];"," velocity = (time !== 0) ? distance/time : 0;",""," if (isFinite(velocity) && (Math.abs(distance) >= params[MIN_DISTANCE]) && (Math.abs(velocity) >= params[MIN_VELOCITY])) {",""," e.type = \"flick\";"," e.flick = {"," time:time,"," distance: distance,"," velocity:velocity,"," axis: axis,"," start : start"," };",""," ce.fire(e);",""," }",""," subscriber[_FLICK_START] = null;"," }"," }"," },",""," MIN_VELOCITY : 0,"," MIN_DISTANCE : 0,"," PREVENT_DEFAULT : false","});","","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-touch\", \"event-synthetic\"]});"];-_yuitest_coverage["build/event-flick/event-flick.js"].lines = {"1":0,"21":0,"74":0,"78":0,"85":0,"90":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"105":0,"107":0,"108":0,"111":0,"112":0,"115":0,"116":0,"119":0,"124":0,"131":0,"132":0,"133":0,"136":0,"138":0,"140":0,"141":0,"145":0,"149":0,"151":0,"153":0,"154":0,"155":0,"156":0,"159":0,"164":0,"167":0,"168":0,"174":0,"188":0,"189":0,"190":0,"193":0,"195":0,"196":0,"197":0,"199":0,"203":0,"205":0,"206":0,"208":0,"210":0,"211":0,"215":0,"216":0,"217":0,"219":0,"224":0,"225":0,"227":0,"230":0,"231":0,"233":0,"235":0,"236":0,"244":0,"248":0};-_yuitest_coverage["build/event-flick/event-flick.js"].functions = {"on:76":0,"detach:88":0,"processArgs:104":0,"_onStart:122":0,"_onMove:163":0,"_onEnd:172":0,"(anonymous 1):1":0};+_yuitest_coverage["build/event-flick/event-flick.js"].code=["YUI.add('event-flick', function (Y, NAME) {","","/**"," * The gestures module provides gesture events such as \"flick\", which normalize user interactions"," * across touch and mouse or pointer based input devices. This layer can be used by application developers"," * to build input device agnostic components which behave the same in response to either touch or mouse based"," * interaction."," *"," * <p>Documentation for events added by this module can be found in the event document for the <a href=\"../classes/YUI.html#events\">YUI</a> global.</p>"," *"," *"," @example",""," YUI().use('event-flick', function (Y) {"," Y.one('#myNode').on('flick', function (e) {"," });"," });",""," *"," * @module event-gestures"," */","","/**"," * Adds support for a \"flick\" event, which is fired at the end of a touch or mouse based flick gesture, and provides"," * velocity of the flick, along with distance and time information."," *"," * <p>Documentation for the flick event can be found on the <a href=\"../classes/YUI.html#event_flick\">YUI</a> global,"," * along with the other supported events.</p>"," *"," * @module event-gestures"," * @submodule event-flick"," */","var GESTURE_MAP = Y.Event._GESTURE_MAP,"," EVENT = {"," start: GESTURE_MAP.start,"," end: GESTURE_MAP.end,"," move: GESTURE_MAP.move"," },"," START = \"start\","," END = \"end\","," MOVE = \"move\",",""," OWNER_DOCUMENT = \"ownerDocument\","," MIN_VELOCITY = \"minVelocity\","," MIN_DISTANCE = \"minDistance\","," PREVENT_DEFAULT = \"preventDefault\",",""," _FLICK_START = \"_fs\","," _FLICK_START_HANDLE = \"_fsh\","," _FLICK_END_HANDLE = \"_feh\","," _FLICK_MOVE_HANDLE = \"_fmh\",",""," NODE_TYPE = \"nodeType\";","","/**"," * Sets up a \"flick\" event, that is fired whenever the user initiates a flick gesture on the node"," * where the listener is attached. The subscriber can specify a minimum distance or velocity for"," * which the event is to be fired. The subscriber can also specify if there is a particular axis which"," * they are interested in - \"x\" or \"y\". If no axis is specified, the axis along which there was most distance"," * covered is used."," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to \"on\","," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"flick\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," * @event flick"," * @for YUI"," * @param type {string} \"flick\""," * @param fn {function} The method the event invokes. It receives an event facade with an e.flick object containing the flick related properties: e.flick.time, e.flick.distance, e.flick.velocity and e.flick.axis, e.flick.start."," * @param cfg {Object} Optional. An object which specifies any of the following:"," * <dl>"," * <dt>minDistance (in pixels, defaults to 10)</dt>"," * <dd>The minimum distance between start and end points, which would qualify the gesture as a flick.</dd>"," * <dt>minVelocity (in pixels/ms, defaults to 0)</dt>"," * <dd>The minimum velocity which would qualify the gesture as a flick.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be"," * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it.</dd>"," * <dt>axis (no default)</dt>"," * <dd>Can be set to \"x\" or \"y\" if you want to constrain the flick velocity and distance to a single axis. If not"," * defined, the axis along which the maximum distance was covered is used.</dd>"," * </dl>"," * @return {EventHandle} the detach handle"," */","","Y.Event.define('flick', {",""," on: function (node, subscriber, ce) {",""," var startHandle = node.on(EVENT[START],"," this._onStart,"," this,"," node,"," subscriber,"," ce);",""," subscriber[_FLICK_START_HANDLE] = startHandle;"," },",""," detach: function (node, subscriber, ce) {",""," var startHandle = subscriber[_FLICK_START_HANDLE],"," endHandle = subscriber[_FLICK_END_HANDLE];",""," if (startHandle) {"," startHandle.detach();"," subscriber[_FLICK_START_HANDLE] = null;"," }",""," if (endHandle) {"," endHandle.detach();"," subscriber[_FLICK_END_HANDLE] = null;"," }"," },",""," processArgs: function(args) {"," var params = (args.length > 3) ? Y.merge(args.splice(3, 1)[0]) : {};",""," if (!(MIN_VELOCITY in params)) {"," params[MIN_VELOCITY] = this.MIN_VELOCITY;"," }",""," if (!(MIN_DISTANCE in params)) {"," params[MIN_DISTANCE] = this.MIN_DISTANCE;"," }",""," if (!(PREVENT_DEFAULT in params)) {"," params[PREVENT_DEFAULT] = this.PREVENT_DEFAULT;"," }",""," return params;"," },",""," _onStart: function(e, node, subscriber, ce) {",""," var start = true, // always true for mouse"," endHandle,"," moveHandle,"," doc,"," preventDefault = subscriber._extra.preventDefault,"," origE = e;",""," if (e.touches) {"," start = (e.touches.length === 1);"," e = e.touches[0];"," }",""," if (start) {",""," if (preventDefault) {"," // preventDefault is a boolean or function"," if (!preventDefault.call || preventDefault(e)) {"," origE.preventDefault();"," }"," }",""," e.flick = {"," time : new Date().getTime()"," };",""," subscriber[_FLICK_START] = e;",""," endHandle = subscriber[_FLICK_END_HANDLE];",""," doc = (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);"," if (!endHandle) {"," endHandle = doc.on(EVENT[END], Y.bind(this._onEnd, this), null, node, subscriber, ce);"," subscriber[_FLICK_END_HANDLE] = endHandle;"," }",""," subscriber[_FLICK_MOVE_HANDLE] = doc.once(EVENT[MOVE], Y.bind(this._onMove, this), null, node, subscriber, ce);"," }"," },",""," _onMove: function(e, node, subscriber, ce) {"," var start = subscriber[_FLICK_START];",""," // Start timing from first move."," if (start && start.flick) {"," start.flick.time = new Date().getTime();"," }"," },",""," _onEnd: function(e, node, subscriber, ce) {",""," var endTime = new Date().getTime(),"," start = subscriber[_FLICK_START],"," valid = !!start,"," endEvent = e,"," startTime,"," time,"," preventDefault,"," params,"," xyDistance,"," distance,"," velocity,"," axis,"," moveHandle = subscriber[_FLICK_MOVE_HANDLE];",""," if (moveHandle) {"," moveHandle.detach();"," delete subscriber[_FLICK_MOVE_HANDLE];"," }",""," if (valid) {",""," if (e.changedTouches) {"," if (e.changedTouches.length === 1 && e.touches.length === 0) {"," endEvent = e.changedTouches[0];"," } else {"," valid = false;"," }"," }",""," if (valid) {",""," params = subscriber._extra;"," preventDefault = params[PREVENT_DEFAULT];",""," if (preventDefault) {"," // preventDefault is a boolean or function"," if (!preventDefault.call || preventDefault(e)) {"," e.preventDefault();"," }"," }",""," startTime = start.flick.time;"," endTime = new Date().getTime();"," time = endTime - startTime;",""," xyDistance = ["," endEvent.pageX - start.pageX,"," endEvent.pageY - start.pageY"," ];",""," if (params.axis) {"," axis = params.axis;"," } else {"," axis = (Math.abs(xyDistance[0]) >= Math.abs(xyDistance[1])) ? 'x' : 'y';"," }",""," distance = xyDistance[(axis === 'x') ? 0 : 1];"," velocity = (time !== 0) ? distance/time : 0;",""," if (isFinite(velocity) && (Math.abs(distance) >= params[MIN_DISTANCE]) && (Math.abs(velocity) >= params[MIN_VELOCITY])) {",""," e.type = \"flick\";"," e.flick = {"," time:time,"," distance: distance,"," velocity:velocity,"," axis: axis,"," start : start"," };",""," ce.fire(e);",""," }",""," subscriber[_FLICK_START] = null;"," }"," }"," },",""," MIN_VELOCITY : 0,"," MIN_DISTANCE : 0,"," PREVENT_DEFAULT : false","});","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-touch\", \"event-synthetic\"]});"];+_yuitest_coverage["build/event-flick/event-flick.js"].lines = {"1":0,"33":0,"86":0,"90":0,"97":0,"102":0,"105":0,"106":0,"107":0,"110":0,"111":0,"112":0,"117":0,"119":0,"120":0,"123":0,"124":0,"127":0,"128":0,"131":0,"136":0,"143":0,"144":0,"145":0,"148":0,"150":0,"152":0,"153":0,"157":0,"161":0,"163":0,"165":0,"166":0,"167":0,"168":0,"171":0,"176":0,"179":0,"180":0,"186":0,"200":0,"201":0,"202":0,"205":0,"207":0,"208":0,"209":0,"211":0,"215":0,"217":0,"218":0,"220":0,"222":0,"223":0,"227":0,"228":0,"229":0,"231":0,"236":0,"237":0,"239":0,"242":0,"243":0,"245":0,"247":0,"248":0,"256":0,"260":0};+_yuitest_coverage["build/event-flick/event-flick.js"].functions = {"on:88":0,"detach:100":0,"processArgs:116":0,"_onStart:134":0,"_onMove:175":0,"_onEnd:184":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-flick/event-flick.js"].coveredLines = 68; _yuitest_coverage["build/event-flick/event-flick.js"].coveredFunctions = 7; _yuitest_coverline("build/event-flick/event-flick.js", 1);@@ -43,23 +43,35 @@ /** * The gestures module provides gesture events such as "flick", which normalize user interactions * across touch and mouse or pointer based input devices. This layer can be used by application developers- * to build input device agnostic components which behave the same in response to either touch or mouse based + * to build input device agnostic components which behave the same in response to either touch or mouse based * interaction. *- * <p>Documentation for events added by this module can be found in the event document for the <a href="YUI.html#events">YUI</a> global.</p>+ * <p>Documentation for events added by this module can be found in the event document for the <a href="../classes/YUI.html#events">YUI</a> global.</p> *+ *+ @example++ YUI().use('event-flick', function (Y) {+ Y.one('#myNode').on('flick', function (e) {+ });+ });++ * * @module event-gestures */ /**- * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides + * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides * velocity of the flick, along with distance and time information. *+ * <p>Documentation for the flick event can be found on the <a href="../classes/YUI.html#event_flick">YUI</a> global,+ * along with the other supported events.</p>+ * * @module event-gestures * @submodule event-flick */ _yuitest_coverfunc("build/event-flick/event-flick.js", "(anonymous 1)", 1);-_yuitest_coverline("build/event-flick/event-flick.js", 21);+_yuitest_coverline("build/event-flick/event-flick.js", 33); var GESTURE_MAP = Y.Event._GESTURE_MAP, EVENT = { start: GESTURE_MAP.start,@@ -90,7 +102,7 @@ * covered is used. * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to "on", + * however if you want to pass the context and arguments as additional signature arguments to "on", * you need to provide a null value for the configuration object, e.g: <code>node.on("flick", fn, null, context, arg1, arg2, arg3)</code></p> * * @event flick@@ -104,7 +116,7 @@ * <dt>minVelocity (in pixels/ms, defaults to 0)</dt> * <dd>The minimum velocity which would qualify the gesture as a flick.</dd> * <dt>preventDefault (defaults to false)</dt>- * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be + * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it.</dd> * <dt>axis (no default)</dt> * <dd>Can be set to "x" or "y" if you want to constrain the flick velocity and distance to a single axis. If not@@ -113,150 +125,150 @@ * @return {EventHandle} the detach handle */ -_yuitest_coverline("build/event-flick/event-flick.js", 74);+_yuitest_coverline("build/event-flick/event-flick.js", 86); Y.Event.define('flick', { on: function (node, subscriber, ce) { - _yuitest_coverfunc("build/event-flick/event-flick.js", "on", 76);-_yuitest_coverline("build/event-flick/event-flick.js", 78);+ _yuitest_coverfunc("build/event-flick/event-flick.js", "on", 88);+_yuitest_coverline("build/event-flick/event-flick.js", 90); var startHandle = node.on(EVENT[START], this._onStart, this, node,- subscriber, + subscriber, ce);- - _yuitest_coverline("build/event-flick/event-flick.js", 85);++ _yuitest_coverline("build/event-flick/event-flick.js", 97); subscriber[_FLICK_START_HANDLE] = startHandle; }, detach: function (node, subscriber, ce) { - _yuitest_coverfunc("build/event-flick/event-flick.js", "detach", 88);-_yuitest_coverline("build/event-flick/event-flick.js", 90);+ _yuitest_coverfunc("build/event-flick/event-flick.js", "detach", 100);+_yuitest_coverline("build/event-flick/event-flick.js", 102); var startHandle = subscriber[_FLICK_START_HANDLE], endHandle = subscriber[_FLICK_END_HANDLE]; - _yuitest_coverline("build/event-flick/event-flick.js", 93);+ _yuitest_coverline("build/event-flick/event-flick.js", 105); if (startHandle) {- _yuitest_coverline("build/event-flick/event-flick.js", 94);+ _yuitest_coverline("build/event-flick/event-flick.js", 106); startHandle.detach();- _yuitest_coverline("build/event-flick/event-flick.js", 95);+ _yuitest_coverline("build/event-flick/event-flick.js", 107); subscriber[_FLICK_START_HANDLE] = null; } - _yuitest_coverline("build/event-flick/event-flick.js", 98);+ _yuitest_coverline("build/event-flick/event-flick.js", 110); if (endHandle) {- _yuitest_coverline("build/event-flick/event-flick.js", 99);+ _yuitest_coverline("build/event-flick/event-flick.js", 111); endHandle.detach();- _yuitest_coverline("build/event-flick/event-flick.js", 100);+ _yuitest_coverline("build/event-flick/event-flick.js", 112); subscriber[_FLICK_END_HANDLE] = null; } }, processArgs: function(args) {- _yuitest_coverfunc("build/event-flick/event-flick.js", "processArgs", 104);-_yuitest_coverline("build/event-flick/event-flick.js", 105);+ _yuitest_coverfunc("build/event-flick/event-flick.js", "processArgs", 116);+_yuitest_coverline("build/event-flick/event-flick.js", 117); var params = (args.length > 3) ? Y.merge(args.splice(3, 1)[0]) : {}; - _yuitest_coverline("build/event-flick/event-flick.js", 107);+ _yuitest_coverline("build/event-flick/event-flick.js", 119); if (!(MIN_VELOCITY in params)) {- _yuitest_coverline("build/event-flick/event-flick.js", 108);+ _yuitest_coverline("build/event-flick/event-flick.js", 120); params[MIN_VELOCITY] = this.MIN_VELOCITY; } - _yuitest_coverline("build/event-flick/event-flick.js", 111);+ _yuitest_coverline("build/event-flick/event-flick.js", 123); if (!(MIN_DISTANCE in params)) {- _yuitest_coverline("build/event-flick/event-flick.js", 112);+ _yuitest_coverline("build/event-flick/event-flick.js", 124); params[MIN_DISTANCE] = this.MIN_DISTANCE; } - _yuitest_coverline("build/event-flick/event-flick.js", 115);+ _yuitest_coverline("build/event-flick/event-flick.js", 127); if (!(PREVENT_DEFAULT in params)) {- _yuitest_coverline("build/event-flick/event-flick.js", 116);+ _yuitest_coverline("build/event-flick/event-flick.js", 128); params[PREVENT_DEFAULT] = this.PREVENT_DEFAULT; } - _yuitest_coverline("build/event-flick/event-flick.js", 119);+ _yuitest_coverline("build/event-flick/event-flick.js", 131); return params; }, _onStart: function(e, node, subscriber, ce) { - _yuitest_coverfunc("build/event-flick/event-flick.js", "_onStart", 122);-_yuitest_coverline("build/event-flick/event-flick.js", 124);+ _yuitest_coverfunc("build/event-flick/event-flick.js", "_onStart", 134);+_yuitest_coverline("build/event-flick/event-flick.js", 136); var start = true, // always true for mouse endHandle, moveHandle, doc, preventDefault = subscriber._extra.preventDefault,- origE = e; + origE = e; - _yuitest_coverline("build/event-flick/event-flick.js", 131);+ _yuitest_coverline("build/event-flick/event-flick.js", 143); if (e.touches) {- _yuitest_coverline("build/event-flick/event-flick.js", 132);+ _yuitest_coverline("build/event-flick/event-flick.js", 144); start = (e.touches.length === 1);- _yuitest_coverline("build/event-flick/event-flick.js", 133);+ _yuitest_coverline("build/event-flick/event-flick.js", 145); e = e.touches[0]; } - _yuitest_coverline("build/event-flick/event-flick.js", 136);+ _yuitest_coverline("build/event-flick/event-flick.js", 148); if (start) { - _yuitest_coverline("build/event-flick/event-flick.js", 138);+ _yuitest_coverline("build/event-flick/event-flick.js", 150); if (preventDefault) { // preventDefault is a boolean or function- _yuitest_coverline("build/event-flick/event-flick.js", 140);+ _yuitest_coverline("build/event-flick/event-flick.js", 152); if (!preventDefault.call || preventDefault(e)) {- _yuitest_coverline("build/event-flick/event-flick.js", 141);+ _yuitest_coverline("build/event-flick/event-flick.js", 153); origE.preventDefault(); } } - _yuitest_coverline("build/event-flick/event-flick.js", 145);+ _yuitest_coverline("build/event-flick/event-flick.js", 157); e.flick = { time : new Date().getTime() }; - _yuitest_coverline("build/event-flick/event-flick.js", 149);+ _yuitest_coverline("build/event-flick/event-flick.js", 161); subscriber[_FLICK_START] = e; - _yuitest_coverline("build/event-flick/event-flick.js", 151);+ _yuitest_coverline("build/event-flick/event-flick.js", 163); endHandle = subscriber[_FLICK_END_HANDLE]; - _yuitest_coverline("build/event-flick/event-flick.js", 153);+ _yuitest_coverline("build/event-flick/event-flick.js", 165); doc = (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);- _yuitest_coverline("build/event-flick/event-flick.js", 154);+ _yuitest_coverline("build/event-flick/event-flick.js", 166); if (!endHandle) {- _yuitest_coverline("build/event-flick/event-flick.js", 155);+ _yuitest_coverline("build/event-flick/event-flick.js", 167); endHandle = doc.on(EVENT[END], Y.bind(this._onEnd, this), null, node, subscriber, ce);- _yuitest_coverline("build/event-flick/event-flick.js", 156);+ _yuitest_coverline("build/event-flick/event-flick.js", 168); subscriber[_FLICK_END_HANDLE] = endHandle; } - _yuitest_coverline("build/event-flick/event-flick.js", 159);+ _yuitest_coverline("build/event-flick/event-flick.js", 171); subscriber[_FLICK_MOVE_HANDLE] = doc.once(EVENT[MOVE], Y.bind(this._onMove, this), null, node, subscriber, ce); } }, _onMove: function(e, node, subscriber, ce) {- _yuitest_coverfunc("build/event-flick/event-flick.js", "_onMove", 163);-_yuitest_coverline("build/event-flick/event-flick.js", 164);+ _yuitest_coverfunc("build/event-flick/event-flick.js", "_onMove", 175);+_yuitest_coverline("build/event-flick/event-flick.js", 176); var start = subscriber[_FLICK_START]; // Start timing from first move.- _yuitest_coverline("build/event-flick/event-flick.js", 167);+ _yuitest_coverline("build/event-flick/event-flick.js", 179); if (start && start.flick) {- _yuitest_coverline("build/event-flick/event-flick.js", 168);+ _yuitest_coverline("build/event-flick/event-flick.js", 180); start.flick.time = new Date().getTime(); } }, _onEnd: function(e, node, subscriber, ce) { - _yuitest_coverfunc("build/event-flick/event-flick.js", "_onEnd", 172);-_yuitest_coverline("build/event-flick/event-flick.js", 174);+ _yuitest_coverfunc("build/event-flick/event-flick.js", "_onEnd", 184);+_yuitest_coverline("build/event-flick/event-flick.js", 186); var endTime = new Date().getTime(), start = subscriber[_FLICK_START], valid = !!start,@@ -265,86 +277,86 @@ time, preventDefault, params,- xyDistance, + xyDistance, distance, velocity, axis, moveHandle = subscriber[_FLICK_MOVE_HANDLE]; - _yuitest_coverline("build/event-flick/event-flick.js", 188);+ _yuitest_coverline("build/event-flick/event-flick.js", 200); if (moveHandle) {- _yuitest_coverline("build/event-flick/event-flick.js", 189);+ _yuitest_coverline("build/event-flick/event-flick.js", 201); moveHandle.detach();- _yuitest_coverline("build/event-flick/event-flick.js", 190);+ _yuitest_coverline("build/event-flick/event-flick.js", 202); delete subscriber[_FLICK_MOVE_HANDLE]; } - _yuitest_coverline("build/event-flick/event-flick.js", 193);+ _yuitest_coverline("build/event-flick/event-flick.js", 205); if (valid) { - _yuitest_coverline("build/event-flick/event-flick.js", 195);+ _yuitest_coverline("build/event-flick/event-flick.js", 207); if (e.changedTouches) {- _yuitest_coverline("build/event-flick/event-flick.js", 196);+ _yuitest_coverline("build/event-flick/event-flick.js", 208); if (e.changedTouches.length === 1 && e.touches.length === 0) {- _yuitest_coverline("build/event-flick/event-flick.js", 197);+ _yuitest_coverline("build/event-flick/event-flick.js", 209); endEvent = e.changedTouches[0]; } else {- _yuitest_coverline("build/event-flick/event-flick.js", 199);+ _yuitest_coverline("build/event-flick/event-flick.js", 211); valid = false; } } - _yuitest_coverline("build/event-flick/event-flick.js", 203);+ _yuitest_coverline("build/event-flick/event-flick.js", 215); if (valid) { - _yuitest_coverline("build/event-flick/event-flick.js", 205);+ _yuitest_coverline("build/event-flick/event-flick.js", 217); params = subscriber._extra;- _yuitest_coverline("build/event-flick/event-flick.js", 206);+ _yuitest_coverline("build/event-flick/event-flick.js", 218); preventDefault = params[PREVENT_DEFAULT]; - _yuitest_coverline("build/event-flick/event-flick.js", 208);+ _yuitest_coverline("build/event-flick/event-flick.js", 220); if (preventDefault) { // preventDefault is a boolean or function- _yuitest_coverline("build/event-flick/event-flick.js", 210);+ _yuitest_coverline("build/event-flick/event-flick.js", 222); if (!preventDefault.call || preventDefault(e)) {- _yuitest_coverline("build/event-flick/event-flick.js", 211);+ _yuitest_coverline("build/event-flick/event-flick.js", 223); e.preventDefault(); } } - _yuitest_coverline("build/event-flick/event-flick.js", 215);+ _yuitest_coverline("build/event-flick/event-flick.js", 227); startTime = start.flick.time;- _yuitest_coverline("build/event-flick/event-flick.js", 216);+ _yuitest_coverline("build/event-flick/event-flick.js", 228); endTime = new Date().getTime();- _yuitest_coverline("build/event-flick/event-flick.js", 217);+ _yuitest_coverline("build/event-flick/event-flick.js", 229); time = endTime - startTime; - _yuitest_coverline("build/event-flick/event-flick.js", 219);+ _yuitest_coverline("build/event-flick/event-flick.js", 231); xyDistance = [ endEvent.pageX - start.pageX, endEvent.pageY - start.pageY ]; - _yuitest_coverline("build/event-flick/event-flick.js", 224);+ _yuitest_coverline("build/event-flick/event-flick.js", 236); if (params.axis) {- _yuitest_coverline("build/event-flick/event-flick.js", 225);+ _yuitest_coverline("build/event-flick/event-flick.js", 237); axis = params.axis; } else {- _yuitest_coverline("build/event-flick/event-flick.js", 227);+ _yuitest_coverline("build/event-flick/event-flick.js", 239); axis = (Math.abs(xyDistance[0]) >= Math.abs(xyDistance[1])) ? 'x' : 'y'; } - _yuitest_coverline("build/event-flick/event-flick.js", 230);+ _yuitest_coverline("build/event-flick/event-flick.js", 242); distance = xyDistance[(axis === 'x') ? 0 : 1];- _yuitest_coverline("build/event-flick/event-flick.js", 231);+ _yuitest_coverline("build/event-flick/event-flick.js", 243); velocity = (time !== 0) ? distance/time : 0; - _yuitest_coverline("build/event-flick/event-flick.js", 233);+ _yuitest_coverline("build/event-flick/event-flick.js", 245); if (isFinite(velocity) && (Math.abs(distance) >= params[MIN_DISTANCE]) && (Math.abs(velocity) >= params[MIN_VELOCITY])) { - _yuitest_coverline("build/event-flick/event-flick.js", 235);+ _yuitest_coverline("build/event-flick/event-flick.js", 247); e.type = "flick";- _yuitest_coverline("build/event-flick/event-flick.js", 236);+ _yuitest_coverline("build/event-flick/event-flick.js", 248); e.flick = { time:time, distance: distance,@@ -353,12 +365,12 @@ start : start }; - _yuitest_coverline("build/event-flick/event-flick.js", 244);+ _yuitest_coverline("build/event-flick/event-flick.js", 256); ce.fire(e); } - _yuitest_coverline("build/event-flick/event-flick.js", 248);+ _yuitest_coverline("build/event-flick/event-flick.js", 260); subscriber[_FLICK_START] = null; } }@@ -370,4 +382,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-touch", "event-synthetic"]});
bundle/event-flick/event-flick-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,18 +9,31 @@ /** * The gestures module provides gesture events such as "flick", which normalize user interactions * across touch and mouse or pointer based input devices. This layer can be used by application developers- * to build input device agnostic components which behave the same in response to either touch or mouse based + * to build input device agnostic components which behave the same in response to either touch or mouse based * interaction. *- * <p>Documentation for events added by this module can be found in the event document for the <a href="YUI.html#events">YUI</a> global.</p>+ * <p>Documentation for events added by this module can be found in the event document for the <a href="../classes/YUI.html#events">YUI</a> global.</p> *+ *+ @example++ YUI().use('event-flick', function (Y) {+ Y.one('#myNode').on('flick', function (e) {+ Y.log('flick event fired. The event payload has goodies.');+ });+ });++ * * @module event-gestures */ /**- * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides + * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides * velocity of the flick, along with distance and time information. *+ * <p>Documentation for the flick event can be found on the <a href="../classes/YUI.html#event_flick">YUI</a> global,+ * along with the other supported events.</p>+ * * @module event-gestures * @submodule event-flick */@@ -54,7 +67,7 @@ * covered is used. * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to "on", + * however if you want to pass the context and arguments as additional signature arguments to "on", * you need to provide a null value for the configuration object, e.g: <code>node.on("flick", fn, null, context, arg1, arg2, arg3)</code></p> * * @event flick@@ -68,7 +81,7 @@ * <dt>minVelocity (in pixels/ms, defaults to 0)</dt> * <dd>The minimum velocity which would qualify the gesture as a flick.</dd> * <dt>preventDefault (defaults to false)</dt>- * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be + * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it.</dd> * <dt>axis (no default)</dt> * <dd>Can be set to "x" or "y" if you want to constrain the flick velocity and distance to a single axis. If not@@ -85,9 +98,9 @@ this._onStart, this, node,- subscriber, + subscriber, ce);- + subscriber[_FLICK_START_HANDLE] = startHandle; }, @@ -132,7 +145,7 @@ moveHandle, doc, preventDefault = subscriber._extra.preventDefault,- origE = e; + origE = e; if (e.touches) { start = (e.touches.length === 1);@@ -185,7 +198,7 @@ time, preventDefault, params,- xyDistance, + xyDistance, distance, velocity, axis,@@ -262,4 +275,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-touch", "event-synthetic"]});
bundle/event-flick/event-flick-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-flick",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="end",o="move",u="ownerDocument",a="minVelocity",f="minDistance",l="preventDefault",c="_fs",h="_fsh",p="_feh",d="_fmh",v="nodeType";e.Event.define("flick",{on:function(e,t,n){var s=e.on(r[i],this._onStart,this,e,t,n);t[h]=s},detach:function(e,t,n){var r=t[h],i=t[p];r&&(r.detach(),t[h]=null),i&&(i.detach(),t[p]=null)},processArgs:function(t){var n=t.length>3?e.merge(t.splice(3,1)[0]):{};return a in n||(n[a]=this.MIN_VELOCITY),f in n||(n[f]=this.MIN_DISTANCE),l in n||(n[l]=this.PREVENT_DEFAULT),n},_onStart:function(t,n,i,a){var f=!0,l,h,m,g=i._extra.preventDefault,y=t;t.touches&&(f=t.touches.length===1,t=t.touches[0]),f&&(g&&(!g.call||g(t))&&y.preventDefault(),t.flick={time:(new Date).getTime()},i[c]=t,l=i[p],m=n.get(v)===9?n:n.get(u),l||(l=m.on(r[s],e.bind(this._onEnd,this),null,n,i,a),i[p]=l),i[d]=m.once(r[o],e.bind(this._onMove,this),null,n,i,a))},_onMove:function(e,t,n,r){var i=n[c];i&&i.flick&&(i.flick.time=(new Date).getTime())},_onEnd:function(e,t,n,r){var i=(new Date).getTime(),s=n[c],o=!!s,u=e,h,p,v,m,g,y,b,w,E=n[d];E&&(E.detach(),delete n[d]),o&&(e.changedTouches&&(e.changedTouches.length===1&&e.touches.length===0?u=e.changedTouches[0]:o=!1),o&&(m=n._extra,v=m[l],v&&(!v.call||v(e))&&e.preventDefault(),h=s.flick.time,i=(new Date).getTime(),p=i-h,g=[u.pageX-s.pageX,u.pageY-s.pageY],m.axis?w=m.axis:w=Math.abs(g[0])>=Math.abs(g[1])?"x":"y",y=g[w==="x"?0:1],b=p!==0?y/p:0,isFinite(b)&&Math.abs(y)>=m[f]&&Math.abs(b)>=m[a]&&(e.type="flick",e.flick={time:p,distance:y,velocity:b,axis:w,start:s},r.fire(e)),n[c]=null))},MIN_VELOCITY:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1})},"3.7.2",{requires:["node-base","event-touch","event-synthetic"]});+YUI.add("event-flick",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="end",o="move",u="ownerDocument",a="minVelocity",f="minDistance",l="preventDefault",c="_fs",h="_fsh",p="_feh",d="_fmh",v="nodeType";e.Event.define("flick",{on:function(e,t,n){var s=e.on(r[i],this._onStart,this,e,t,n);t[h]=s},detach:function(e,t,n){var r=t[h],i=t[p];r&&(r.detach(),t[h]=null),i&&(i.detach(),t[p]=null)},processArgs:function(t){var n=t.length>3?e.merge(t.splice(3,1)[0]):{};return a in n||(n[a]=this.MIN_VELOCITY),f in n||(n[f]=this.MIN_DISTANCE),l in n||(n[l]=this.PREVENT_DEFAULT),n},_onStart:function(t,n,i,a){var f=!0,l,h,m,g=i._extra.preventDefault,y=t;t.touches&&(f=t.touches.length===1,t=t.touches[0]),f&&(g&&(!g.call||g(t))&&y.preventDefault(),t.flick={time:(new Date).getTime()},i[c]=t,l=i[p],m=n.get(v)===9?n:n.get(u),l||(l=m.on(r[s],e.bind(this._onEnd,this),null,n,i,a),i[p]=l),i[d]=m.once(r[o],e.bind(this._onMove,this),null,n,i,a))},_onMove:function(e,t,n,r){var i=n[c];i&&i.flick&&(i.flick.time=(new Date).getTime())},_onEnd:function(e,t,n,r){var i=(new Date).getTime(),s=n[c],o=!!s,u=e,h,p,v,m,g,y,b,w,E=n[d];E&&(E.detach(),delete n[d]),o&&(e.changedTouches&&(e.changedTouches.length===1&&e.touches.length===0?u=e.changedTouches[0]:o=!1),o&&(m=n._extra,v=m[l],v&&(!v.call||v(e))&&e.preventDefault(),h=s.flick.time,i=(new Date).getTime(),p=i-h,g=[u.pageX-s.pageX,u.pageY-s.pageY],m.axis?w=m.axis:w=Math.abs(g[0])>=Math.abs(g[1])?"x":"y",y=g[w==="x"?0:1],b=p!==0?y/p:0,isFinite(b)&&Math.abs(y)>=m[f]&&Math.abs(b)>=m[a]&&(e.type="flick",e.flick={time:p,distance:y,velocity:b,axis:w,start:s},r.fire(e)),n[c]=null))},MIN_VELOCITY:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1})},"3.7.3",{requires:["node-base","event-touch","event-synthetic"]});
bundle/event-flick/event-flick.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,18 +9,30 @@ /** * The gestures module provides gesture events such as "flick", which normalize user interactions * across touch and mouse or pointer based input devices. This layer can be used by application developers- * to build input device agnostic components which behave the same in response to either touch or mouse based + * to build input device agnostic components which behave the same in response to either touch or mouse based * interaction. *- * <p>Documentation for events added by this module can be found in the event document for the <a href="YUI.html#events">YUI</a> global.</p>+ * <p>Documentation for events added by this module can be found in the event document for the <a href="../classes/YUI.html#events">YUI</a> global.</p> *+ *+ @example++ YUI().use('event-flick', function (Y) {+ Y.one('#myNode').on('flick', function (e) {+ });+ });++ * * @module event-gestures */ /**- * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides + * Adds support for a "flick" event, which is fired at the end of a touch or mouse based flick gesture, and provides * velocity of the flick, along with distance and time information. *+ * <p>Documentation for the flick event can be found on the <a href="../classes/YUI.html#event_flick">YUI</a> global,+ * along with the other supported events.</p>+ * * @module event-gestures * @submodule event-flick */@@ -54,7 +66,7 @@ * covered is used. * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to "on", + * however if you want to pass the context and arguments as additional signature arguments to "on", * you need to provide a null value for the configuration object, e.g: <code>node.on("flick", fn, null, context, arg1, arg2, arg3)</code></p> * * @event flick@@ -68,7 +80,7 @@ * <dt>minVelocity (in pixels/ms, defaults to 0)</dt> * <dd>The minimum velocity which would qualify the gesture as a flick.</dd> * <dt>preventDefault (defaults to false)</dt>- * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be + * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart/touchend or mousedown/mouseup is received so that things like scrolling or text selection can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it.</dd> * <dt>axis (no default)</dt> * <dd>Can be set to "x" or "y" if you want to constrain the flick velocity and distance to a single axis. If not@@ -85,9 +97,9 @@ this._onStart, this, node,- subscriber, + subscriber, ce);- + subscriber[_FLICK_START_HANDLE] = startHandle; }, @@ -132,7 +144,7 @@ moveHandle, doc, preventDefault = subscriber._extra.preventDefault,- origE = e; + origE = e; if (e.touches) { start = (e.touches.length === 1);@@ -185,7 +197,7 @@ time, preventDefault, params,- xyDistance, + xyDistance, distance, velocity, axis,@@ -262,4 +274,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-touch", "event-synthetic"]});
bundle/event-focus/event-focus-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/event-focus/event-focus.js", code: [] };-_yuitest_coverage["build/event-focus/event-focus.js"].code=["YUI.add('event-focus', function (Y, NAME) {","","/**"," * Adds bubbling and delegation support to DOM events focus and blur."," * "," * @module event"," * @submodule event-focus"," */","var Event = Y.Event,"," YLang = Y.Lang,"," isString = YLang.isString,"," arrayIndex = Y.Array.indexOf,"," useActivate = YLang.isFunction("," Y.DOM.create('<p onbeforeactivate=\";\"/>').onbeforeactivate);","","function define(type, proxy, directEvent) {"," var nodeDataKey = '_' + type + 'Notifiers';",""," Y.Event.define(type, {",""," _attach: function (el, notifier, delegate) {"," if (Y.DOM.isWindow(el)) {"," return Event._attach([type, function (e) {"," notifier.fire(e);"," }, el]);"," } else {"," return Event._attach("," [proxy, this._proxy, el, this, notifier, delegate],"," { capture: true });"," }"," },",""," _proxy: function (e, notifier, delegate) {"," var target = e.target,"," currentTarget = e.currentTarget,"," notifiers = target.getData(nodeDataKey),"," yuid = Y.stamp(currentTarget._node),"," defer = (useActivate || target !== currentTarget),"," directSub;"," "," notifier.currentTarget = (delegate) ? target : currentTarget;"," notifier.container = (delegate) ? currentTarget : null;",""," // Maintain a list to handle subscriptions from nested"," // containers div#a>div#b>input #a.on(focus..) #b.on(focus..),"," // use one focus or blur subscription that fires notifiers from"," // #b then #a to emulate bubble sequence."," if (!notifiers) {"," notifiers = {};"," target.setData(nodeDataKey, notifiers);",""," // only subscribe to the element's focus if the target is"," // not the current target ("," if (defer) {"," directSub = Event._attach("," [directEvent, this._notify, target._node]).sub;"," directSub.once = true;"," }"," } else {"," // In old IE, defer is always true. In capture-phase browsers,"," // The delegate subscriptions will be encountered first, which"," // will establish the notifiers data and direct subscription"," // on the node. If there is also a direct subscription to the"," // node's focus/blur, it should not call _notify because the"," // direct subscription from the delegate sub(s) exists, which"," // will call _notify. So this avoids _notify being called"," // twice, unnecessarily."," defer = true;"," }",""," if (!notifiers[yuid]) {"," notifiers[yuid] = [];"," }",""," notifiers[yuid].push(notifier);",""," if (!defer) {"," this._notify(e);"," }"," },",""," _notify: function (e, container) {"," var currentTarget = e.currentTarget,"," notifierData = currentTarget.getData(nodeDataKey),"," axisNodes = currentTarget.ancestors(),"," doc = currentTarget.get('ownerDocument'),"," delegates = [],"," // Used to escape loops when there are no more"," // notifiers to consider"," count = notifierData ?"," Y.Object.keys(notifierData).length :"," 0,"," target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret;",""," // clear the notifications list (mainly for delegation)"," currentTarget.clearData(nodeDataKey);",""," // Order the delegate subs by their placement in the parent axis"," axisNodes.push(currentTarget);"," // document.get('ownerDocument') returns null"," // which we'll use to prevent having duplicate Nodes in the list"," if (doc) {"," axisNodes.unshift(doc);"," }",""," // ancestors() returns the Nodes from top to bottom"," axisNodes._nodes.reverse();",""," if (count) {"," // Store the count for step 2"," tmp = count;"," axisNodes.some(function (node) {"," var yuid = Y.stamp(node),"," notifiers = notifierData[yuid],"," i, len;",""," if (notifiers) {"," count--;"," for (i = 0, len = notifiers.length; i < len; ++i) {"," if (notifiers[i].handle.sub.filter) {"," delegates.push(notifiers[i]);"," }"," }"," }",""," return !count;"," });"," count = tmp;"," }",""," // Walk up the parent axis, notifying direct subscriptions and"," // testing delegate filters."," while (count && (target = axisNodes.shift())) {"," yuid = Y.stamp(target);",""," notifiers = notifierData[yuid];",""," if (notifiers) {"," for (i = 0, len = notifiers.length; i < len; ++i) {"," notifier = notifiers[i];"," sub = notifier.handle.sub;"," match = true;",""," e.currentTarget = target;",""," if (sub.filter) {"," match = sub.filter.apply(target,"," [target, e].concat(sub.args || []));",""," // No longer necessary to test against this"," // delegate subscription for the nodes along"," // the parent axis."," delegates.splice("," arrayIndex(delegates, notifier), 1);"," }",""," if (match) {"," // undefined for direct subs"," e.container = notifier.container;"," ret = notifier.fire(e);"," }",""," if (ret === false || e.stopped === 2) {"," break;"," }"," }"," "," delete notifiers[yuid];"," count--;"," }",""," if (e.stopped !== 2) {"," // delegates come after subs targeting this specific node"," // because they would not normally report until they'd"," // bubbled to the container node."," for (i = 0, len = delegates.length; i < len; ++i) {"," notifier = delegates[i];"," sub = notifier.handle.sub;",""," if (sub.filter.apply(target,"," [target, e].concat(sub.args || []))) {",""," e.container = notifier.container;"," e.currentTarget = target;"," ret = notifier.fire(e);"," }",""," if (ret === false || e.stopped === 2) {"," break;"," }"," }"," }",""," if (e.stopped) {"," break;"," }"," }"," },",""," on: function (node, sub, notifier) {"," sub.handle = this._attach(node._node, notifier);"," },",""," detach: function (node, sub) {"," sub.handle.detach();"," },",""," delegate: function (node, sub, notifier, filter) {"," if (isString(filter)) {"," sub.filter = function (target) {"," return Y.Selector.test(target._node, filter,"," node === target ? null : node._node);"," };"," }",""," sub.handle = this._attach(node._node, notifier, true);"," },",""," detachDelegate: function (node, sub) {"," sub.handle.detach();"," }"," }, true);","}","","// For IE, we need to defer to focusin rather than focus because","// `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate,","// el.onfocusin, doSomething, then el.onfocus. All others support capture","// phase focus, which executes before doSomething. To guarantee consistent","// behavior for this use case, IE's direct subscriptions are made against","// focusin so subscribers will be notified before js following el.focus() is","// executed.","if (useActivate) {"," // name capture phase direct subscription"," define(\"focus\", \"beforeactivate\", \"focusin\");"," define(\"blur\", \"beforedeactivate\", \"focusout\");","} else {"," define(\"focus\", \"focus\", \"focus\");"," define(\"blur\", \"blur\", \"blur\");","}","","","}, '3.7.2', {\"requires\": [\"event-synthetic\"]});"];-_yuitest_coverage["build/event-focus/event-focus.js"].lines = {"1":0,"9":0,"16":0,"17":0,"19":0,"22":0,"23":0,"24":0,"27":0,"34":0,"41":0,"42":0,"48":0,"49":0,"50":0,"54":0,"55":0,"57":0,"68":0,"71":0,"72":0,"75":0,"77":0,"78":0,"83":0,"96":0,"99":0,"102":0,"103":0,"107":0,"109":0,"111":0,"112":0,"113":0,"117":0,"118":0,"119":0,"120":0,"121":0,"126":0,"128":0,"133":0,"134":0,"136":0,"138":0,"139":0,"140":0,"141":0,"142":0,"144":0,"146":0,"147":0,"153":0,"157":0,"159":0,"160":0,"163":0,"164":0,"168":0,"169":0,"172":0,"176":0,"177":0,"178":0,"180":0,"183":0,"184":0,"185":0,"188":0,"189":0,"194":0,"195":0,"201":0,"205":0,"209":0,"210":0,"211":0,"216":0,"220":0,"232":0,"234":0,"235":0,"237":0,"238":0};-_yuitest_coverage["build/event-focus/event-focus.js"].functions = {"(anonymous 2):23":0,"_attach:21":0,"_proxy:33":0,"(anonymous 3):112":0,"_notify:82":0,"on:200":0,"detach:204":0,"filter:210":0,"delegate:208":0,"detachDelegate:219":0,"define:16":0,"(anonymous 1):1":0};-_yuitest_coverage["build/event-focus/event-focus.js"].coveredLines = 84;-_yuitest_coverage["build/event-focus/event-focus.js"].coveredFunctions = 12;+_yuitest_coverage["build/event-focus/event-focus.js"].code=["YUI.add('event-focus', function (Y, NAME) {","","/**"," * Adds bubbling and delegation support to DOM events focus and blur."," * "," * @module event"," * @submodule event-focus"," */","var Event = Y.Event,",""," YLang = Y.Lang,",""," isString = YLang.isString,",""," arrayIndex = Y.Array.indexOf,",""," useActivate = (function() {",""," // Changing the structure of this test, so that it doesn't use inline JS in HTML,"," // which throws an exception in Win8 packaged apps, due to additional security restrictions:"," // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences",""," var p = Y.config.doc.createElement(\"p\"),"," listener;",""," p.setAttribute(\"onbeforeactivate\", \";\");"," listener = p.onbeforeactivate;",""," // listener is a function in IE8+."," // listener is a string in IE6,7 (unfortunate, but that's not going to change. Otherwise we could have just checked for function)."," // listener is a function in IE10, in a Win8 App environment (no exception running the test).",""," // listener is undefined in Webkit/Gecko."," // listener is a function in Webkit/Gecko if it's a supported event (e.g. onclick).",""," return (listener !== undefined);"," }());","","function define(type, proxy, directEvent) {"," var nodeDataKey = '_' + type + 'Notifiers';",""," Y.Event.define(type, {",""," _useActivate : useActivate,",""," _attach: function (el, notifier, delegate) {"," if (Y.DOM.isWindow(el)) {"," return Event._attach([type, function (e) {"," notifier.fire(e);"," }, el]);"," } else {"," return Event._attach("," [proxy, this._proxy, el, this, notifier, delegate],"," { capture: true });"," }"," },",""," _proxy: function (e, notifier, delegate) {"," var target = e.target,"," currentTarget = e.currentTarget,"," notifiers = target.getData(nodeDataKey),"," yuid = Y.stamp(currentTarget._node),"," defer = (useActivate || target !== currentTarget),"," directSub;"," "," notifier.currentTarget = (delegate) ? target : currentTarget;"," notifier.container = (delegate) ? currentTarget : null;",""," // Maintain a list to handle subscriptions from nested"," // containers div#a>div#b>input #a.on(focus..) #b.on(focus..),"," // use one focus or blur subscription that fires notifiers from"," // #b then #a to emulate bubble sequence."," if (!notifiers) {"," notifiers = {};"," target.setData(nodeDataKey, notifiers);",""," // only subscribe to the element's focus if the target is"," // not the current target ("," if (defer) {"," directSub = Event._attach("," [directEvent, this._notify, target._node]).sub;"," directSub.once = true;"," }"," } else {"," // In old IE, defer is always true. In capture-phase browsers,"," // The delegate subscriptions will be encountered first, which"," // will establish the notifiers data and direct subscription"," // on the node. If there is also a direct subscription to the"," // node's focus/blur, it should not call _notify because the"," // direct subscription from the delegate sub(s) exists, which"," // will call _notify. So this avoids _notify being called"," // twice, unnecessarily."," defer = true;"," }",""," if (!notifiers[yuid]) {"," notifiers[yuid] = [];"," }",""," notifiers[yuid].push(notifier);",""," if (!defer) {"," this._notify(e);"," }"," },",""," _notify: function (e, container) {"," var currentTarget = e.currentTarget,"," notifierData = currentTarget.getData(nodeDataKey),"," axisNodes = currentTarget.ancestors(),"," doc = currentTarget.get('ownerDocument'),"," delegates = [],"," // Used to escape loops when there are no more"," // notifiers to consider"," count = notifierData ?"," Y.Object.keys(notifierData).length :"," 0,"," target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret;",""," // clear the notifications list (mainly for delegation)"," currentTarget.clearData(nodeDataKey);",""," // Order the delegate subs by their placement in the parent axis"," axisNodes.push(currentTarget);"," // document.get('ownerDocument') returns null"," // which we'll use to prevent having duplicate Nodes in the list"," if (doc) {"," axisNodes.unshift(doc);"," }",""," // ancestors() returns the Nodes from top to bottom"," axisNodes._nodes.reverse();",""," if (count) {"," // Store the count for step 2"," tmp = count;"," axisNodes.some(function (node) {"," var yuid = Y.stamp(node),"," notifiers = notifierData[yuid],"," i, len;",""," if (notifiers) {"," count--;"," for (i = 0, len = notifiers.length; i < len; ++i) {"," if (notifiers[i].handle.sub.filter) {"," delegates.push(notifiers[i]);"," }"," }"," }",""," return !count;"," });"," count = tmp;"," }",""," // Walk up the parent axis, notifying direct subscriptions and"," // testing delegate filters."," while (count && (target = axisNodes.shift())) {"," yuid = Y.stamp(target);",""," notifiers = notifierData[yuid];",""," if (notifiers) {"," for (i = 0, len = notifiers.length; i < len; ++i) {"," notifier = notifiers[i];"," sub = notifier.handle.sub;"," match = true;",""," e.currentTarget = target;",""," if (sub.filter) {"," match = sub.filter.apply(target,"," [target, e].concat(sub.args || []));",""," // No longer necessary to test against this"," // delegate subscription for the nodes along"," // the parent axis."," delegates.splice("," arrayIndex(delegates, notifier), 1);"," }",""," if (match) {"," // undefined for direct subs"," e.container = notifier.container;"," ret = notifier.fire(e);"," }",""," if (ret === false || e.stopped === 2) {"," break;"," }"," }"," "," delete notifiers[yuid];"," count--;"," }",""," if (e.stopped !== 2) {"," // delegates come after subs targeting this specific node"," // because they would not normally report until they'd"," // bubbled to the container node."," for (i = 0, len = delegates.length; i < len; ++i) {"," notifier = delegates[i];"," sub = notifier.handle.sub;",""," if (sub.filter.apply(target,"," [target, e].concat(sub.args || []))) {",""," e.container = notifier.container;"," e.currentTarget = target;"," ret = notifier.fire(e);"," }",""," if (ret === false || e.stopped === 2) {"," break;"," }"," }"," }",""," if (e.stopped) {"," break;"," }"," }"," },",""," on: function (node, sub, notifier) {"," sub.handle = this._attach(node._node, notifier);"," },",""," detach: function (node, sub) {"," sub.handle.detach();"," },",""," delegate: function (node, sub, notifier, filter) {"," if (isString(filter)) {"," sub.filter = function (target) {"," return Y.Selector.test(target._node, filter,"," node === target ? null : node._node);"," };"," }",""," sub.handle = this._attach(node._node, notifier, true);"," },",""," detachDelegate: function (node, sub) {"," sub.handle.detach();"," }"," }, true);","}","","// For IE, we need to defer to focusin rather than focus because","// `el.focus(); doSomething();` executes el.onbeforeactivate, el.onactivate,","// el.onfocusin, doSomething, then el.onfocus. All others support capture","// phase focus, which executes before doSomething. To guarantee consistent","// behavior for this use case, IE's direct subscriptions are made against","// focusin so subscribers will be notified before js following el.focus() is","// executed.","if (useActivate) {"," // name capture phase direct subscription"," define(\"focus\", \"beforeactivate\", \"focusin\");"," define(\"blur\", \"beforedeactivate\", \"focusout\");","} else {"," define(\"focus\", \"focus\", \"focus\");"," define(\"blur\", \"blur\", \"blur\");","}","","","}, '3.7.3', {\"requires\": [\"event-synthetic\"]});"];+_yuitest_coverage["build/event-focus/event-focus.js"].lines = {"1":0,"9":0,"23":0,"26":0,"27":0,"36":0,"39":0,"40":0,"42":0,"47":0,"48":0,"49":0,"52":0,"59":0,"66":0,"67":0,"73":0,"74":0,"75":0,"79":0,"80":0,"82":0,"93":0,"96":0,"97":0,"100":0,"102":0,"103":0,"108":0,"121":0,"124":0,"127":0,"128":0,"132":0,"134":0,"136":0,"137":0,"138":0,"142":0,"143":0,"144":0,"145":0,"146":0,"151":0,"153":0,"158":0,"159":0,"161":0,"163":0,"164":0,"165":0,"166":0,"167":0,"169":0,"171":0,"172":0,"178":0,"182":0,"184":0,"185":0,"188":0,"189":0,"193":0,"194":0,"197":0,"201":0,"202":0,"203":0,"205":0,"208":0,"209":0,"210":0,"213":0,"214":0,"219":0,"220":0,"226":0,"230":0,"234":0,"235":0,"236":0,"241":0,"245":0,"257":0,"259":0,"260":0,"262":0,"263":0};+_yuitest_coverage["build/event-focus/event-focus.js"].functions = {"(anonymous 2):17":0,"(anonymous 3):48":0,"_attach:46":0,"_proxy:58":0,"(anonymous 4):137":0,"_notify:107":0,"on:225":0,"detach:229":0,"filter:235":0,"delegate:233":0,"detachDelegate:244":0,"define:39":0,"(anonymous 1):1":0};+_yuitest_coverage["build/event-focus/event-focus.js"].coveredLines = 88;+_yuitest_coverage["build/event-focus/event-focus.js"].coveredFunctions = 13; _yuitest_coverline("build/event-focus/event-focus.js", 1); YUI.add('event-focus', function (Y, NAME) { @@ -49,33 +49,63 @@ _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 1)", 1); _yuitest_coverline("build/event-focus/event-focus.js", 9); var Event = Y.Event,+ YLang = Y.Lang,+ isString = YLang.isString,+ arrayIndex = Y.Array.indexOf,- useActivate = YLang.isFunction(- Y.DOM.create('<p onbeforeactivate=";"/>').onbeforeactivate); -_yuitest_coverline("build/event-focus/event-focus.js", 16);+ useActivate = (function() {++ // Changing the structure of this test, so that it doesn't use inline JS in HTML,+ // which throws an exception in Win8 packaged apps, due to additional security restrictions:+ // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences++ _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 2)", 17);+_yuitest_coverline("build/event-focus/event-focus.js", 23);+var p = Y.config.doc.createElement("p"),+ listener;++ _yuitest_coverline("build/event-focus/event-focus.js", 26);+p.setAttribute("onbeforeactivate", ";");+ _yuitest_coverline("build/event-focus/event-focus.js", 27);+listener = p.onbeforeactivate;++ // listener is a function in IE8+.+ // listener is a string in IE6,7 (unfortunate, but that's not going to change. Otherwise we could have just checked for function).+ // listener is a function in IE10, in a Win8 App environment (no exception running the test).++ // listener is undefined in Webkit/Gecko.+ // listener is a function in Webkit/Gecko if it's a supported event (e.g. onclick).++ _yuitest_coverline("build/event-focus/event-focus.js", 36);+return (listener !== undefined);+ }());++_yuitest_coverline("build/event-focus/event-focus.js", 39); function define(type, proxy, directEvent) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "define", 16);-_yuitest_coverline("build/event-focus/event-focus.js", 17);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "define", 39);+_yuitest_coverline("build/event-focus/event-focus.js", 40); var nodeDataKey = '_' + type + 'Notifiers'; - _yuitest_coverline("build/event-focus/event-focus.js", 19);+ _yuitest_coverline("build/event-focus/event-focus.js", 42); Y.Event.define(type, { + _useActivate : useActivate,+ _attach: function (el, notifier, delegate) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "_attach", 21);-_yuitest_coverline("build/event-focus/event-focus.js", 22);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "_attach", 46);+_yuitest_coverline("build/event-focus/event-focus.js", 47); if (Y.DOM.isWindow(el)) {- _yuitest_coverline("build/event-focus/event-focus.js", 23);+ _yuitest_coverline("build/event-focus/event-focus.js", 48); return Event._attach([type, function (e) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 2)", 23);-_yuitest_coverline("build/event-focus/event-focus.js", 24);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 3)", 48);+_yuitest_coverline("build/event-focus/event-focus.js", 49); notifier.fire(e); }, el]); } else {- _yuitest_coverline("build/event-focus/event-focus.js", 27);+ _yuitest_coverline("build/event-focus/event-focus.js", 52); return Event._attach( [proxy, this._proxy, el, this, notifier, delegate], { capture: true });@@ -83,8 +113,8 @@ }, _proxy: function (e, notifier, delegate) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "_proxy", 33);-_yuitest_coverline("build/event-focus/event-focus.js", 34);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "_proxy", 58);+_yuitest_coverline("build/event-focus/event-focus.js", 59); var target = e.target, currentTarget = e.currentTarget, notifiers = target.getData(nodeDataKey),@@ -92,30 +122,30 @@ defer = (useActivate || target !== currentTarget), directSub; - _yuitest_coverline("build/event-focus/event-focus.js", 41);+ _yuitest_coverline("build/event-focus/event-focus.js", 66); notifier.currentTarget = (delegate) ? target : currentTarget;- _yuitest_coverline("build/event-focus/event-focus.js", 42);+ _yuitest_coverline("build/event-focus/event-focus.js", 67); notifier.container = (delegate) ? currentTarget : null; // Maintain a list to handle subscriptions from nested // containers div#a>div#b>input #a.on(focus..) #b.on(focus..), // use one focus or blur subscription that fires notifiers from // #b then #a to emulate bubble sequence.- _yuitest_coverline("build/event-focus/event-focus.js", 48);+ _yuitest_coverline("build/event-focus/event-focus.js", 73); if (!notifiers) {- _yuitest_coverline("build/event-focus/event-focus.js", 49);+ _yuitest_coverline("build/event-focus/event-focus.js", 74); notifiers = {};- _yuitest_coverline("build/event-focus/event-focus.js", 50);+ _yuitest_coverline("build/event-focus/event-focus.js", 75); target.setData(nodeDataKey, notifiers); // only subscribe to the element's focus if the target is // not the current target (- _yuitest_coverline("build/event-focus/event-focus.js", 54);+ _yuitest_coverline("build/event-focus/event-focus.js", 79); if (defer) {- _yuitest_coverline("build/event-focus/event-focus.js", 55);+ _yuitest_coverline("build/event-focus/event-focus.js", 80); directSub = Event._attach( [directEvent, this._notify, target._node]).sub;- _yuitest_coverline("build/event-focus/event-focus.js", 57);+ _yuitest_coverline("build/event-focus/event-focus.js", 82); directSub.once = true; } } else {@@ -127,29 +157,29 @@ // direct subscription from the delegate sub(s) exists, which // will call _notify. So this avoids _notify being called // twice, unnecessarily.- _yuitest_coverline("build/event-focus/event-focus.js", 68);+ _yuitest_coverline("build/event-focus/event-focus.js", 93); defer = true; } - _yuitest_coverline("build/event-focus/event-focus.js", 71);+ _yuitest_coverline("build/event-focus/event-focus.js", 96); if (!notifiers[yuid]) {- _yuitest_coverline("build/event-focus/event-focus.js", 72);+ _yuitest_coverline("build/event-focus/event-focus.js", 97); notifiers[yuid] = []; } - _yuitest_coverline("build/event-focus/event-focus.js", 75);+ _yuitest_coverline("build/event-focus/event-focus.js", 100); notifiers[yuid].push(notifier); - _yuitest_coverline("build/event-focus/event-focus.js", 77);+ _yuitest_coverline("build/event-focus/event-focus.js", 102); if (!defer) {- _yuitest_coverline("build/event-focus/event-focus.js", 78);+ _yuitest_coverline("build/event-focus/event-focus.js", 103); this._notify(e); } }, _notify: function (e, container) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "_notify", 82);-_yuitest_coverline("build/event-focus/event-focus.js", 83);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "_notify", 107);+_yuitest_coverline("build/event-focus/event-focus.js", 108); var currentTarget = e.currentTarget, notifierData = currentTarget.getData(nodeDataKey), axisNodes = currentTarget.ancestors(),@@ -163,190 +193,190 @@ target, notifiers, notifier, yuid, match, tmp, i, len, sub, ret; // clear the notifications list (mainly for delegation)- _yuitest_coverline("build/event-focus/event-focus.js", 96);+ _yuitest_coverline("build/event-focus/event-focus.js", 121); currentTarget.clearData(nodeDataKey); // Order the delegate subs by their placement in the parent axis- _yuitest_coverline("build/event-focus/event-focus.js", 99);+ _yuitest_coverline("build/event-focus/event-focus.js", 124); axisNodes.push(currentTarget); // document.get('ownerDocument') returns null // which we'll use to prevent having duplicate Nodes in the list- _yuitest_coverline("build/event-focus/event-focus.js", 102);+ _yuitest_coverline("build/event-focus/event-focus.js", 127); if (doc) {- _yuitest_coverline("build/event-focus/event-focus.js", 103);+ _yuitest_coverline("build/event-focus/event-focus.js", 128); axisNodes.unshift(doc); } // ancestors() returns the Nodes from top to bottom- _yuitest_coverline("build/event-focus/event-focus.js", 107);+ _yuitest_coverline("build/event-focus/event-focus.js", 132); axisNodes._nodes.reverse(); - _yuitest_coverline("build/event-focus/event-focus.js", 109);+ _yuitest_coverline("build/event-focus/event-focus.js", 134); if (count) { // Store the count for step 2- _yuitest_coverline("build/event-focus/event-focus.js", 111);+ _yuitest_coverline("build/event-focus/event-focus.js", 136); tmp = count;- _yuitest_coverline("build/event-focus/event-focus.js", 112);+ _yuitest_coverline("build/event-focus/event-focus.js", 137); axisNodes.some(function (node) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 3)", 112);-_yuitest_coverline("build/event-focus/event-focus.js", 113);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "(anonymous 4)", 137);+_yuitest_coverline("build/event-focus/event-focus.js", 138); var yuid = Y.stamp(node), notifiers = notifierData[yuid], i, len; - _yuitest_coverline("build/event-focus/event-focus.js", 117);+ _yuitest_coverline("build/event-focus/event-focus.js", 142); if (notifiers) {- _yuitest_coverline("build/event-focus/event-focus.js", 118);+ _yuitest_coverline("build/event-focus/event-focus.js", 143); count--;- _yuitest_coverline("build/event-focus/event-focus.js", 119);+ _yuitest_coverline("build/event-focus/event-focus.js", 144); for (i = 0, len = notifiers.length; i < len; ++i) {- _yuitest_coverline("build/event-focus/event-focus.js", 120);+ _yuitest_coverline("build/event-focus/event-focus.js", 145); if (notifiers[i].handle.sub.filter) {- _yuitest_coverline("build/event-focus/event-focus.js", 121);+ _yuitest_coverline("build/event-focus/event-focus.js", 146); delegates.push(notifiers[i]); } } } - _yuitest_coverline("build/event-focus/event-focus.js", 126);+ _yuitest_coverline("build/event-focus/event-focus.js", 151); return !count; });- _yuitest_coverline("build/event-focus/event-focus.js", 128);+ _yuitest_coverline("build/event-focus/event-focus.js", 153); count = tmp; } // Walk up the parent axis, notifying direct subscriptions and // testing delegate filters.- _yuitest_coverline("build/event-focus/event-focus.js", 133);+ _yuitest_coverline("build/event-focus/event-focus.js", 158); while (count && (target = axisNodes.shift())) {- _yuitest_coverline("build/event-focus/event-focus.js", 134);+ _yuitest_coverline("build/event-focus/event-focus.js", 159); yuid = Y.stamp(target); - _yuitest_coverline("build/event-focus/event-focus.js", 136);+ _yuitest_coverline("build/event-focus/event-focus.js", 161); notifiers = notifierData[yuid]; - _yuitest_coverline("build/event-focus/event-focus.js", 138);+ _yuitest_coverline("build/event-focus/event-focus.js", 163); if (notifiers) {- _yuitest_coverline("build/event-focus/event-focus.js", 139);+ _yuitest_coverline("build/event-focus/event-focus.js", 164); for (i = 0, len = notifiers.length; i < len; ++i) {- _yuitest_coverline("build/event-focus/event-focus.js", 140);+ _yuitest_coverline("build/event-focus/event-focus.js", 165); notifier = notifiers[i];- _yuitest_coverline("build/event-focus/event-focus.js", 141);+ _yuitest_coverline("build/event-focus/event-focus.js", 166); sub = notifier.handle.sub;- _yuitest_coverline("build/event-focus/event-focus.js", 142);+ _yuitest_coverline("build/event-focus/event-focus.js", 167); match = true; - _yuitest_coverline("build/event-focus/event-focus.js", 144);+ _yuitest_coverline("build/event-focus/event-focus.js", 169); e.currentTarget = target; - _yuitest_coverline("build/event-focus/event-focus.js", 146);+ _yuitest_coverline("build/event-focus/event-focus.js", 171); if (sub.filter) {- _yuitest_coverline("build/event-focus/event-focus.js", 147);+ _yuitest_coverline("build/event-focus/event-focus.js", 172); match = sub.filter.apply(target, [target, e].concat(sub.args || [])); // No longer necessary to test against this // delegate subscription for the nodes along // the parent axis.- _yuitest_coverline("build/event-focus/event-focus.js", 153);+ _yuitest_coverline("build/event-focus/event-focus.js", 178); delegates.splice( arrayIndex(delegates, notifier), 1); } - _yuitest_coverline("build/event-focus/event-focus.js", 157);+ _yuitest_coverline("build/event-focus/event-focus.js", 182); if (match) { // undefined for direct subs- _yuitest_coverline("build/event-focus/event-focus.js", 159);+ _yuitest_coverline("build/event-focus/event-focus.js", 184); e.container = notifier.container;- _yuitest_coverline("build/event-focus/event-focus.js", 160);+ _yuitest_coverline("build/event-focus/event-focus.js", 185); ret = notifier.fire(e); } - _yuitest_coverline("build/event-focus/event-focus.js", 163);+ _yuitest_coverline("build/event-focus/event-focus.js", 188); if (ret === false || e.stopped === 2) {- _yuitest_coverline("build/event-focus/event-focus.js", 164);+ _yuitest_coverline("build/event-focus/event-focus.js", 189); break; } } - _yuitest_coverline("build/event-focus/event-focus.js", 168);+ _yuitest_coverline("build/event-focus/event-focus.js", 193); delete notifiers[yuid];- _yuitest_coverline("build/event-focus/event-focus.js", 169);+ _yuitest_coverline("build/event-focus/event-focus.js", 194); count--; } - _yuitest_coverline("build/event-focus/event-focus.js", 172);+ _yuitest_coverline("build/event-focus/event-focus.js", 197); if (e.stopped !== 2) { // delegates come after subs targeting this specific node // because they would not normally report until they'd // bubbled to the container node.- _yuitest_coverline("build/event-focus/event-focus.js", 176);+ _yuitest_coverline("build/event-focus/event-focus.js", 201); for (i = 0, len = delegates.length; i < len; ++i) {- _yuitest_coverline("build/event-focus/event-focus.js", 177);+ _yuitest_coverline("build/event-focus/event-focus.js", 202); notifier = delegates[i];- _yuitest_coverline("build/event-focus/event-focus.js", 178);+ _yuitest_coverline("build/event-focus/event-focus.js", 203); sub = notifier.handle.sub; - _yuitest_coverline("build/event-focus/event-focus.js", 180);+ _yuitest_coverline("build/event-focus/event-focus.js", 205); if (sub.filter.apply(target, [target, e].concat(sub.args || []))) { - _yuitest_coverline("build/event-focus/event-focus.js", 183);+ _yuitest_coverline("build/event-focus/event-focus.js", 208); e.container = notifier.container;- _yuitest_coverline("build/event-focus/event-focus.js", 184);+ _yuitest_coverline("build/event-focus/event-focus.js", 209); e.currentTarget = target;- _yuitest_coverline("build/event-focus/event-focus.js", 185);+ _yuitest_coverline("build/event-focus/event-focus.js", 210); ret = notifier.fire(e); } - _yuitest_coverline("build/event-focus/event-focus.js", 188);+ _yuitest_coverline("build/event-focus/event-focus.js", 213); if (ret === false || e.stopped === 2) {- _yuitest_coverline("build/event-focus/event-focus.js", 189);+ _yuitest_coverline("build/event-focus/event-focus.js", 214); break; } } } - _yuitest_coverline("build/event-focus/event-focus.js", 194);+ _yuitest_coverline("build/event-focus/event-focus.js", 219); if (e.stopped) {- _yuitest_coverline("build/event-focus/event-focus.js", 195);+ _yuitest_coverline("build/event-focus/event-focus.js", 220); break; } } }, on: function (node, sub, notifier) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "on", 200);-_yuitest_coverline("build/event-focus/event-focus.js", 201);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "on", 225);+_yuitest_coverline("build/event-focus/event-focus.js", 226); sub.handle = this._attach(node._node, notifier); }, detach: function (node, sub) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "detach", 204);-_yuitest_coverline("build/event-focus/event-focus.js", 205);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "detach", 229);+_yuitest_coverline("build/event-focus/event-focus.js", 230); sub.handle.detach(); }, delegate: function (node, sub, notifier, filter) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "delegate", 208);-_yuitest_coverline("build/event-focus/event-focus.js", 209);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "delegate", 233);+_yuitest_coverline("build/event-focus/event-focus.js", 234); if (isString(filter)) {- _yuitest_coverline("build/event-focus/event-focus.js", 210);+ _yuitest_coverline("build/event-focus/event-focus.js", 235); sub.filter = function (target) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "filter", 210);-_yuitest_coverline("build/event-focus/event-focus.js", 211);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "filter", 235);+_yuitest_coverline("build/event-focus/event-focus.js", 236); return Y.Selector.test(target._node, filter, node === target ? null : node._node); }; } - _yuitest_coverline("build/event-focus/event-focus.js", 216);+ _yuitest_coverline("build/event-focus/event-focus.js", 241); sub.handle = this._attach(node._node, notifier, true); }, detachDelegate: function (node, sub) {- _yuitest_coverfunc("build/event-focus/event-focus.js", "detachDelegate", 219);-_yuitest_coverline("build/event-focus/event-focus.js", 220);+ _yuitest_coverfunc("build/event-focus/event-focus.js", "detachDelegate", 244);+_yuitest_coverline("build/event-focus/event-focus.js", 245); sub.handle.detach(); } }, true);@@ -359,19 +389,19 @@ // behavior for this use case, IE's direct subscriptions are made against // focusin so subscribers will be notified before js following el.focus() is // executed.-_yuitest_coverline("build/event-focus/event-focus.js", 232);+_yuitest_coverline("build/event-focus/event-focus.js", 257); if (useActivate) { // name capture phase direct subscription- _yuitest_coverline("build/event-focus/event-focus.js", 234);+ _yuitest_coverline("build/event-focus/event-focus.js", 259); define("focus", "beforeactivate", "focusin");- _yuitest_coverline("build/event-focus/event-focus.js", 235);+ _yuitest_coverline("build/event-focus/event-focus.js", 260); define("blur", "beforedeactivate", "focusout"); } else {- _yuitest_coverline("build/event-focus/event-focus.js", 237);+ _yuitest_coverline("build/event-focus/event-focus.js", 262); define("focus", "focus", "focus");- _yuitest_coverline("build/event-focus/event-focus.js", 238);+ _yuitest_coverline("build/event-focus/event-focus.js", 263); define("blur", "blur", "blur"); } -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-focus/event-focus-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -13,17 +13,42 @@ * @submodule event-focus */ var Event = Y.Event,+ YLang = Y.Lang,+ isString = YLang.isString,+ arrayIndex = Y.Array.indexOf,- useActivate = YLang.isFunction(- Y.DOM.create('<p onbeforeactivate=";"/>').onbeforeactivate); + useActivate = (function() {++ // Changing the structure of this test, so that it doesn't use inline JS in HTML,+ // which throws an exception in Win8 packaged apps, due to additional security restrictions:+ // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences++ var p = Y.config.doc.createElement("p"),+ listener;++ p.setAttribute("onbeforeactivate", ";");+ listener = p.onbeforeactivate;++ // listener is a function in IE8+.+ // listener is a string in IE6,7 (unfortunate, but that's not going to change. Otherwise we could have just checked for function).+ // listener is a function in IE10, in a Win8 App environment (no exception running the test).++ // listener is undefined in Webkit/Gecko.+ // listener is a function in Webkit/Gecko if it's a supported event (e.g. onclick).++ return (listener !== undefined);+ }());+ function define(type, proxy, directEvent) { var nodeDataKey = '_' + type + 'Notifiers'; Y.Event.define(type, { + _useActivate : useActivate,+ _attach: function (el, notifier, delegate) { if (Y.DOM.isWindow(el)) { return Event._attach([type, function (e) {@@ -245,4 +270,4 @@ } -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-focus/event-focus-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-focus",function(e,t){function u(t,r,u){var a="_"+t+"Notifiers";e.Event.define(t,{_attach:function(i,s,o){return e.DOM.isWindow(i)?n._attach([t,function(e){s.fire(e)},i]):n._attach([r,this._proxy,i,this,s,o],{capture:!0})},_proxy:function(t,r,i){var s=t.target,f=t.currentTarget,l=s.getData(a),c=e.stamp(f._node),h=o||s!==f,p;r.currentTarget=i?s:f,r.container=i?f:null,l?h=!0:(l={},s.setData(a,l),h&&(p=n._attach([u,this._notify,s._node]).sub,p.once=!0)),l[c]||(l[c]=[]),l[c].push(r),h||this._notify(t)},_notify:function(t,n){var r=t.currentTarget,i=r.getData(a),o=r.ancestors(),u=r.get("ownerDocument"),f=[],l=i?e.Object.keys(i).length:0,c,h,p,d,v,m,g,y,b,w;r.clearData(a),o.push(r),u&&o.unshift(u),o._nodes.reverse(),l&&(m=l,o.some(function(t){var n=e.stamp(t),r=i[n],s,o;if(r){l--;for(s=0,o=r.length;s<o;++s)r[s].handle.sub.filter&&f.push(r[s])}return!l}),l=m);while(l&&(c=o.shift())){d=e.stamp(c),h=i[d];if(h){for(g=0,y=h.length;g<y;++g){p=h[g],b=p.handle.sub,v=!0,t.currentTarget=c,b.filter&&(v=b.filter.apply(c,[c,t].concat(b.args||[])),f.splice(s(f,p),1)),v&&(t.container=p.container,w=p.fire(t));if(w===!1||t.stopped===2)break}delete h[d],l--}if(t.stopped!==2)for(g=0,y=f.length;g<y;++g){p=f[g],b=p.handle.sub,b.filter.apply(c,[c,t].concat(b.args||[]))&&(t.container=p.container,t.currentTarget=c,w=p.fire(t));if(w===!1||t.stopped===2)break}if(t.stopped)break}},on:function(e,t,n){t.handle=this._attach(e._node,n)},detach:function(e,t){t.handle.detach()},delegate:function(t,n,r,s){i(s)&&(n.filter=function(n){return e.Selector.test(n._node,s,t===n?null:t._node)}),n.handle=this._attach(t._node,r,!0)},detachDelegate:function(e,t){t.handle.detach()}},!0)}var n=e.Event,r=e.Lang,i=r.isString,s=e.Array.indexOf,o=r.isFunction(e.DOM.create('<p onbeforeactivate=";"/>').onbeforeactivate);o?(u("focus","beforeactivate","focusin"),u("blur","beforedeactivate","focusout")):(u("focus","focus","focus"),u("blur","blur","blur"))},"3.7.2",{requires:["event-synthetic"]});+YUI.add("event-focus",function(e,t){function u(t,r,u){var a="_"+t+"Notifiers";e.Event.define(t,{_useActivate:o,_attach:function(i,s,o){return e.DOM.isWindow(i)?n._attach([t,function(e){s.fire(e)},i]):n._attach([r,this._proxy,i,this,s,o],{capture:!0})},_proxy:function(t,r,i){var s=t.target,f=t.currentTarget,l=s.getData(a),c=e.stamp(f._node),h=o||s!==f,p;r.currentTarget=i?s:f,r.container=i?f:null,l?h=!0:(l={},s.setData(a,l),h&&(p=n._attach([u,this._notify,s._node]).sub,p.once=!0)),l[c]||(l[c]=[]),l[c].push(r),h||this._notify(t)},_notify:function(t,n){var r=t.currentTarget,i=r.getData(a),o=r.ancestors(),u=r.get("ownerDocument"),f=[],l=i?e.Object.keys(i).length:0,c,h,p,d,v,m,g,y,b,w;r.clearData(a),o.push(r),u&&o.unshift(u),o._nodes.reverse(),l&&(m=l,o.some(function(t){var n=e.stamp(t),r=i[n],s,o;if(r){l--;for(s=0,o=r.length;s<o;++s)r[s].handle.sub.filter&&f.push(r[s])}return!l}),l=m);while(l&&(c=o.shift())){d=e.stamp(c),h=i[d];if(h){for(g=0,y=h.length;g<y;++g){p=h[g],b=p.handle.sub,v=!0,t.currentTarget=c,b.filter&&(v=b.filter.apply(c,[c,t].concat(b.args||[])),f.splice(s(f,p),1)),v&&(t.container=p.container,w=p.fire(t));if(w===!1||t.stopped===2)break}delete h[d],l--}if(t.stopped!==2)for(g=0,y=f.length;g<y;++g){p=f[g],b=p.handle.sub,b.filter.apply(c,[c,t].concat(b.args||[]))&&(t.container=p.container,t.currentTarget=c,w=p.fire(t));if(w===!1||t.stopped===2)break}if(t.stopped)break}},on:function(e,t,n){t.handle=this._attach(e._node,n)},detach:function(e,t){t.handle.detach()},delegate:function(t,n,r,s){i(s)&&(n.filter=function(n){return e.Selector.test(n._node,s,t===n?null:t._node)}),n.handle=this._attach(t._node,r,!0)},detachDelegate:function(e,t){t.handle.detach()}},!0)}var n=e.Event,r=e.Lang,i=r.isString,s=e.Array.indexOf,o=function(){var t=e.config.doc.createElement("p"),n;return t.setAttribute("onbeforeactivate",";"),n=t.onbeforeactivate,n!==undefined}();o?(u("focus","beforeactivate","focusin"),u("blur","beforedeactivate","focusout")):(u("focus","focus","focus"),u("blur","blur","blur"))},"3.7.3",{requires:["event-synthetic"]});
bundle/event-focus/event-focus.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -13,17 +13,42 @@ * @submodule event-focus */ var Event = Y.Event,+ YLang = Y.Lang,+ isString = YLang.isString,+ arrayIndex = Y.Array.indexOf,- useActivate = YLang.isFunction(- Y.DOM.create('<p onbeforeactivate=";"/>').onbeforeactivate); + useActivate = (function() {++ // Changing the structure of this test, so that it doesn't use inline JS in HTML,+ // which throws an exception in Win8 packaged apps, due to additional security restrictions:+ // http://msdn.microsoft.com/en-us/library/windows/apps/hh465380.aspx#differences++ var p = Y.config.doc.createElement("p"),+ listener;++ p.setAttribute("onbeforeactivate", ";");+ listener = p.onbeforeactivate;++ // listener is a function in IE8+.+ // listener is a string in IE6,7 (unfortunate, but that's not going to change. Otherwise we could have just checked for function).+ // listener is a function in IE10, in a Win8 App environment (no exception running the test).++ // listener is undefined in Webkit/Gecko.+ // listener is a function in Webkit/Gecko if it's a supported event (e.g. onclick).++ return (listener !== undefined);+ }());+ function define(type, proxy, directEvent) { var nodeDataKey = '_' + type + 'Notifiers'; Y.Event.define(type, { + _useActivate : useActivate,+ _attach: function (el, notifier, delegate) { if (Y.DOM.isWindow(el)) { return Event._attach([type, function (e) {@@ -245,4 +270,4 @@ } -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-hover/event-hover-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-hover/event-hover.js", code: [] };-_yuitest_coverage["build/event-hover/event-hover.js"].code=["YUI.add('event-hover', function (Y, NAME) {","","/**"," * Adds support for a \"hover\" event. The event provides a convenience wrapper"," * for subscribing separately to mouseenter and mouseleave. The signature for"," * subscribing to the event is</p>"," *"," * <pre><code>node.on(\"hover\", overFn, outFn);"," * node.delegate(\"hover\", overFn, outFn, \".filterSelector\");"," * Y.on(\"hover\", overFn, outFn, \".targetSelector\");"," * Y.delegate(\"hover\", overFn, outFn, \"#container\", \".filterSelector\");"," * </code></pre>"," *"," * <p>Additionally, for compatibility with a more typical subscription"," * signature, the following are also supported:</p>"," *"," * <pre><code>Y.on(\"hover\", overFn, \".targetSelector\", outFn);"," * Y.delegate(\"hover\", overFn, \"#container\", outFn, \".filterSelector\");"," * </code></pre>"," *"," * @module event"," * @submodule event-hover"," */","var isFunction = Y.Lang.isFunction,"," noop = function () {},"," conf = {"," processArgs: function (args) {"," // Y.delegate('hover', over, out, '#container', '.filter')"," // comes in as ['hover', over, out, '#container', '.filter'], but"," // node.delegate('hover', over, out, '.filter')"," // comes in as ['hover', over, containerEl, out, '.filter']"," var i = isFunction(args[2]) ? 2 : 3;",""," return (isFunction(args[i])) ? args.splice(i,1)[0] : noop;"," },",""," on: function (node, sub, notifier, filter) {"," var args = (sub.args) ? sub.args.slice() : [];",""," args.unshift(null);",""," sub._detach = node[(filter) ? \"delegate\" : \"on\"]({"," mouseenter: function (e) {"," e.phase = 'over';"," notifier.fire(e);"," },"," mouseleave: function (e) {"," var thisObj = sub.context || this;",""," args[0] = e;",""," e.type = 'hover';"," e.phase = 'out';"," sub._extra.apply(thisObj, args);"," }"," }, filter);"," },",""," detach: function (node, sub, notifier) {"," sub._detach.detach();"," }"," };","","conf.delegate = conf.on;","conf.detachDelegate = conf.detach;","","Y.Event.define(\"hover\", conf);","","","}, '3.7.2', {\"requires\": [\"event-mouseenter\"]});"];+_yuitest_coverage["build/event-hover/event-hover.js"].code=["YUI.add('event-hover', function (Y, NAME) {","","/**"," * Adds support for a \"hover\" event. The event provides a convenience wrapper"," * for subscribing separately to mouseenter and mouseleave. The signature for"," * subscribing to the event is</p>"," *"," * <pre><code>node.on(\"hover\", overFn, outFn);"," * node.delegate(\"hover\", overFn, outFn, \".filterSelector\");"," * Y.on(\"hover\", overFn, outFn, \".targetSelector\");"," * Y.delegate(\"hover\", overFn, outFn, \"#container\", \".filterSelector\");"," * </code></pre>"," *"," * <p>Additionally, for compatibility with a more typical subscription"," * signature, the following are also supported:</p>"," *"," * <pre><code>Y.on(\"hover\", overFn, \".targetSelector\", outFn);"," * Y.delegate(\"hover\", overFn, \"#container\", outFn, \".filterSelector\");"," * </code></pre>"," *"," * @module event"," * @submodule event-hover"," */","var isFunction = Y.Lang.isFunction,"," noop = function () {},"," conf = {"," processArgs: function (args) {"," // Y.delegate('hover', over, out, '#container', '.filter')"," // comes in as ['hover', over, out, '#container', '.filter'], but"," // node.delegate('hover', over, out, '.filter')"," // comes in as ['hover', over, containerEl, out, '.filter']"," var i = isFunction(args[2]) ? 2 : 3;",""," return (isFunction(args[i])) ? args.splice(i,1)[0] : noop;"," },",""," on: function (node, sub, notifier, filter) {"," var args = (sub.args) ? sub.args.slice() : [];",""," args.unshift(null);",""," sub._detach = node[(filter) ? \"delegate\" : \"on\"]({"," mouseenter: function (e) {"," e.phase = 'over';"," notifier.fire(e);"," },"," mouseleave: function (e) {"," var thisObj = sub.context || this;",""," args[0] = e;",""," e.type = 'hover';"," e.phase = 'out';"," sub._extra.apply(thisObj, args);"," }"," }, filter);"," },",""," detach: function (node, sub, notifier) {"," sub._detach.detach();"," }"," };","","conf.delegate = conf.on;","conf.detachDelegate = conf.detach;","","Y.Event.define(\"hover\", conf);","","","}, '3.7.3', {\"requires\": [\"event-mouseenter\"]});"]; _yuitest_coverage["build/event-hover/event-hover.js"].lines = {"1":0,"24":0,"32":0,"34":0,"38":0,"40":0,"42":0,"44":0,"45":0,"48":0,"50":0,"52":0,"53":0,"54":0,"60":0,"64":0,"65":0,"67":0}; _yuitest_coverage["build/event-hover/event-hover.js"].functions = {"processArgs:27":0,"mouseenter:43":0,"mouseleave:47":0,"on:37":0,"detach:59":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-hover/event-hover.js"].coveredLines = 18;@@ -130,4 +130,4 @@ Y.Event.define("hover", conf); -}, '3.7.2', {"requires": ["event-mouseenter"]});+}, '3.7.3', {"requires": ["event-mouseenter"]});
bundle/event-hover/event-hover-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -73,4 +73,4 @@ Y.Event.define("hover", conf); -}, '3.7.2', {"requires": ["event-mouseenter"]});+}, '3.7.3', {"requires": ["event-mouseenter"]});
bundle/event-hover/event-hover-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-hover",function(e,t){var n=e.Lang.isFunction,r=function(){},i={processArgs:function(e){var t=n(e[2])?2:3;return n(e[t])?e.splice(t,1)[0]:r},on:function(e,t,n,r){var i=t.args?t.args.slice():[];i.unshift(null),t._detach=e[r?"delegate":"on"]({mouseenter:function(e){e.phase="over",n.fire(e)},mouseleave:function(e){var n=t.context||this;i[0]=e,e.type="hover",e.phase="out",t._extra.apply(n,i)}},r)},detach:function(e,t,n){t._detach.detach()}};i.delegate=i.on,i.detachDelegate=i.detach,e.Event.define("hover",i)},"3.7.2",{requires:["event-mouseenter"]});+YUI.add("event-hover",function(e,t){var n=e.Lang.isFunction,r=function(){},i={processArgs:function(e){var t=n(e[2])?2:3;return n(e[t])?e.splice(t,1)[0]:r},on:function(e,t,n,r){var i=t.args?t.args.slice():[];i.unshift(null),t._detach=e[r?"delegate":"on"]({mouseenter:function(e){e.phase="over",n.fire(e)},mouseleave:function(e){var n=t.context||this;i[0]=e,e.type="hover",e.phase="out",t._extra.apply(n,i)}},r)},detach:function(e,t,n){t._detach.detach()}};i.delegate=i.on,i.detachDelegate=i.detach,e.Event.define("hover",i)},"3.7.3",{requires:["event-mouseenter"]});
bundle/event-hover/event-hover.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -73,4 +73,4 @@ Y.Event.define("hover", conf); -}, '3.7.2', {"requires": ["event-mouseenter"]});+}, '3.7.3', {"requires": ["event-mouseenter"]});
bundle/event-key/event-key-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-key/event-key.js", code: [] };-_yuitest_coverage["build/event-key/event-key.js"].code=["YUI.add('event-key', function (Y, NAME) {","","/**"," * Functionality to listen for one or more specific key combinations."," * @module event"," * @submodule event-key"," */","","var ALT = \"+alt\","," CTRL = \"+ctrl\","," META = \"+meta\","," SHIFT = \"+shift\",",""," trim = Y.Lang.trim,",""," eventDef = {"," KEY_MAP: {"," enter : 13,"," esc : 27,"," backspace: 8,"," tab : 9,"," pageup : 33,"," pagedown : 34"," },",""," _typeRE: /^(up|down|press):/,"," _keysRE: /^(?:up|down|press):|\\+(alt|ctrl|meta|shift)/g,",""," processArgs: function (args) {"," var spec = args.splice(3,1)[0],"," mods = Y.Array.hash(spec.match(/\\+(?:alt|ctrl|meta|shift)\\b/g) || []),"," config = {"," type: this._typeRE.test(spec) ? RegExp.$1 : null,"," mods: mods,"," keys: null"," },"," // strip type and modifiers from spec, leaving only keyCodes"," bits = spec.replace(this._keysRE, ''),"," chr, uc, lc, i;",""," if (bits) {"," bits = bits.split(',');",""," config.keys = {};",""," // FIXME: need to support '65,esc' => keypress, keydown"," for (i = bits.length - 1; i >= 0; --i) {"," chr = trim(bits[i]);",""," // catch sloppy filters, trailing commas, etc 'a,,'"," if (!chr) {"," continue;"," }",""," // non-numerics are single characters or key names"," if (+chr == chr) {"," config.keys[chr] = mods;"," } else {"," lc = chr.toLowerCase();",""," if (this.KEY_MAP[lc]) {"," config.keys[this.KEY_MAP[lc]] = mods;"," // FIXME: '65,enter' defaults keydown for both"," if (!config.type) {"," config.type = \"down\"; // safest"," }"," } else {"," // FIXME: Character mapping only works for keypress"," // events. Otherwise, it uses String.fromCharCode()"," // from the keyCode, which is wrong."," chr = chr.charAt(0);"," uc = chr.toUpperCase();",""," if (mods[\"+shift\"]) {"," chr = uc;"," }",""," // FIXME: stupid assumption that"," // the keycode of the lower case == the"," // charCode of the upper case"," // a (key:65,char:97), A (key:65,char:65)"," config.keys[chr.charCodeAt(0)] ="," (chr === uc) ?"," // upper case chars get +shift free"," Y.merge(mods, { \"+shift\": true }) :"," mods;"," }"," }"," }"," }",""," if (!config.type) {"," config.type = \"press\";"," }",""," return config;"," },",""," on: function (node, sub, notifier, filter) {"," var spec = sub._extra,"," type = \"key\" + spec.type,"," keys = spec.keys,"," method = (filter) ? \"delegate\" : \"on\";",""," // Note: without specifying any keyCodes, this becomes a"," // horribly inefficient alias for 'keydown' (et al), but I"," // can't abort this subscription for a simple"," // Y.on('keypress', ...);"," // Please use keyCodes or just subscribe directly to keydown,"," // keyup, or keypress"," sub._detach = node[method](type, function (e) {"," var key = keys ? keys[e.which] : spec.mods;",""," if (key &&"," (!key[ALT] || (key[ALT] && e.altKey)) &&"," (!key[CTRL] || (key[CTRL] && e.ctrlKey)) &&"," (!key[META] || (key[META] && e.metaKey)) &&"," (!key[SHIFT] || (key[SHIFT] && e.shiftKey)))"," {"," notifier.fire(e);"," }"," }, filter);"," },",""," detach: function (node, sub, notifier) {"," sub._detach.detach();"," }"," };","","eventDef.delegate = eventDef.on;","eventDef.detachDelegate = eventDef.detach;","","/**"," * <p>Add a key listener. The listener will only be notified if the"," * keystroke detected meets the supplied specification. The"," * specification is a string that is defined as:</p>"," * "," * <dl>"," * <dt>spec</dt>"," * <dd><code>[{type}:]{code}[,{code}]*</code></dd>"," * <dt>type</dt>"," * <dd><code>\"down\", \"up\", or \"press\"</code></dd>"," * <dt>code</dt>"," * <dd><code>{keyCode|character|keyName}[+{modifier}]*</code></dd>"," * <dt>modifier</dt>"," * <dd><code>\"shift\", \"ctrl\", \"alt\", or \"meta\"</code></dd>"," * <dt>keyName</dt>"," * <dd><code>\"enter\", \"backspace\", \"esc\", \"tab\", \"pageup\", or \"pagedown\"</code></dd>"," * </dl>"," *"," * <p>Examples:</p>"," * <ul>"," * <li><code>Y.on(\"key\", callback, \"press:12,65+shift+ctrl\", \"#my-input\");</code></li>"," * <li><code>Y.delegate(\"key\", preventSubmit, \"enter\", \"#forms\", \"input[type=text]\");</code></li>"," * <li><code>Y.one(\"doc\").on(\"key\", viNav, \"j,k,l,;\");</code></li>"," * </ul>"," * "," * @event key"," * @for YUI"," * @param type {string} 'key'"," * @param fn {function} the function to execute"," * @param id {string|HTMLElement|collection} the element(s) to bind"," * @param spec {string} the keyCode and modifier specification"," * @param o optional context object"," * @param args 0..n additional arguments to provide to the listener."," * @return {Event.Handle} the detach handle"," */","Y.Event.define('key', eventDef, true);","","","}, '3.7.2', {\"requires\": [\"event-synthetic\"]});"];+_yuitest_coverage["build/event-key/event-key.js"].code=["YUI.add('event-key', function (Y, NAME) {","","/**"," * Functionality to listen for one or more specific key combinations."," * @module event"," * @submodule event-key"," */","","var ALT = \"+alt\","," CTRL = \"+ctrl\","," META = \"+meta\","," SHIFT = \"+shift\",",""," trim = Y.Lang.trim,",""," eventDef = {"," KEY_MAP: {"," enter : 13,"," esc : 27,"," backspace: 8,"," tab : 9,"," pageup : 33,"," pagedown : 34"," },",""," _typeRE: /^(up|down|press):/,"," _keysRE: /^(?:up|down|press):|\\+(alt|ctrl|meta|shift)/g,",""," processArgs: function (args) {"," var spec = args.splice(3,1)[0],"," mods = Y.Array.hash(spec.match(/\\+(?:alt|ctrl|meta|shift)\\b/g) || []),"," config = {"," type: this._typeRE.test(spec) ? RegExp.$1 : null,"," mods: mods,"," keys: null"," },"," // strip type and modifiers from spec, leaving only keyCodes"," bits = spec.replace(this._keysRE, ''),"," chr, uc, lc, i;",""," if (bits) {"," bits = bits.split(',');",""," config.keys = {};",""," // FIXME: need to support '65,esc' => keypress, keydown"," for (i = bits.length - 1; i >= 0; --i) {"," chr = trim(bits[i]);",""," // catch sloppy filters, trailing commas, etc 'a,,'"," if (!chr) {"," continue;"," }",""," // non-numerics are single characters or key names"," if (+chr == chr) {"," config.keys[chr] = mods;"," } else {"," lc = chr.toLowerCase();",""," if (this.KEY_MAP[lc]) {"," config.keys[this.KEY_MAP[lc]] = mods;"," // FIXME: '65,enter' defaults keydown for both"," if (!config.type) {"," config.type = \"down\"; // safest"," }"," } else {"," // FIXME: Character mapping only works for keypress"," // events. Otherwise, it uses String.fromCharCode()"," // from the keyCode, which is wrong."," chr = chr.charAt(0);"," uc = chr.toUpperCase();",""," if (mods[\"+shift\"]) {"," chr = uc;"," }",""," // FIXME: stupid assumption that"," // the keycode of the lower case == the"," // charCode of the upper case"," // a (key:65,char:97), A (key:65,char:65)"," config.keys[chr.charCodeAt(0)] ="," (chr === uc) ?"," // upper case chars get +shift free"," Y.merge(mods, { \"+shift\": true }) :"," mods;"," }"," }"," }"," }",""," if (!config.type) {"," config.type = \"press\";"," }",""," return config;"," },",""," on: function (node, sub, notifier, filter) {"," var spec = sub._extra,"," type = \"key\" + spec.type,"," keys = spec.keys,"," method = (filter) ? \"delegate\" : \"on\";",""," // Note: without specifying any keyCodes, this becomes a"," // horribly inefficient alias for 'keydown' (et al), but I"," // can't abort this subscription for a simple"," // Y.on('keypress', ...);"," // Please use keyCodes or just subscribe directly to keydown,"," // keyup, or keypress"," sub._detach = node[method](type, function (e) {"," var key = keys ? keys[e.which] : spec.mods;",""," if (key &&"," (!key[ALT] || (key[ALT] && e.altKey)) &&"," (!key[CTRL] || (key[CTRL] && e.ctrlKey)) &&"," (!key[META] || (key[META] && e.metaKey)) &&"," (!key[SHIFT] || (key[SHIFT] && e.shiftKey)))"," {"," notifier.fire(e);"," }"," }, filter);"," },",""," detach: function (node, sub, notifier) {"," sub._detach.detach();"," }"," };","","eventDef.delegate = eventDef.on;","eventDef.detachDelegate = eventDef.detach;","","/**"," * <p>Add a key listener. The listener will only be notified if the"," * keystroke detected meets the supplied specification. The"," * specification is a string that is defined as:</p>"," * "," * <dl>"," * <dt>spec</dt>"," * <dd><code>[{type}:]{code}[,{code}]*</code></dd>"," * <dt>type</dt>"," * <dd><code>\"down\", \"up\", or \"press\"</code></dd>"," * <dt>code</dt>"," * <dd><code>{keyCode|character|keyName}[+{modifier}]*</code></dd>"," * <dt>modifier</dt>"," * <dd><code>\"shift\", \"ctrl\", \"alt\", or \"meta\"</code></dd>"," * <dt>keyName</dt>"," * <dd><code>\"enter\", \"backspace\", \"esc\", \"tab\", \"pageup\", or \"pagedown\"</code></dd>"," * </dl>"," *"," * <p>Examples:</p>"," * <ul>"," * <li><code>Y.on(\"key\", callback, \"press:12,65+shift+ctrl\", \"#my-input\");</code></li>"," * <li><code>Y.delegate(\"key\", preventSubmit, \"enter\", \"#forms\", \"input[type=text]\");</code></li>"," * <li><code>Y.one(\"doc\").on(\"key\", viNav, \"j,k,l,;\");</code></li>"," * </ul>"," * "," * @event key"," * @for YUI"," * @param type {string} 'key'"," * @param fn {function} the function to execute"," * @param id {string|HTMLElement|collection} the element(s) to bind"," * @param spec {string} the keyCode and modifier specification"," * @param o optional context object"," * @param args 0..n additional arguments to provide to the listener."," * @return {Event.Handle} the detach handle"," */","Y.Event.define('key', eventDef, true);","","","}, '3.7.3', {\"requires\": [\"event-synthetic\"]});"]; _yuitest_coverage["build/event-key/event-key.js"].lines = {"1":0,"9":0,"30":0,"41":0,"42":0,"44":0,"47":0,"48":0,"51":0,"52":0,"56":0,"57":0,"59":0,"61":0,"62":0,"64":0,"65":0,"71":0,"72":0,"74":0,"75":0,"82":0,"92":0,"93":0,"96":0,"100":0,"111":0,"112":0,"114":0,"120":0,"126":0,"130":0,"131":0,"168":0}; _yuitest_coverage["build/event-key/event-key.js"].functions = {"processArgs:29":0,"(anonymous 2):111":0,"on:99":0,"detach:125":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-key/event-key.js"].coveredLines = 34;@@ -246,4 +246,4 @@ Y.Event.define('key', eventDef, true); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-key/event-key-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -174,4 +174,4 @@ Y.Event.define('key', eventDef, true); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-key/event-key-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-key",function(e,t){var n="+alt",r="+ctrl",i="+meta",s="+shift",o=e.Lang.trim,u={KEY_MAP:{enter:13,esc:27,backspace:8,tab:9,pageup:33,pagedown:34},_typeRE:/^(up|down|press):/,_keysRE:/^(?:up|down|press):|\+(alt|ctrl|meta|shift)/g,processArgs:function(t){var n=t.splice(3,1)[0],r=e.Array.hash(n.match(/\+(?:alt|ctrl|meta|shift)\b/g)||[]),i={type:this._typeRE.test(n)?RegExp.$1:null,mods:r,keys:null},s=n.replace(this._keysRE,""),u,a,f,l;if(s){s=s.split(","),i.keys={};for(l=s.length-1;l>=0;--l){u=o(s[l]);if(!u)continue;+u==u?i.keys[u]=r:(f=u.toLowerCase(),this.KEY_MAP[f]?(i.keys[this.KEY_MAP[f]]=r,i.type||(i.type="down")):(u=u.charAt(0),a=u.toUpperCase(),r["+shift"]&&(u=a),i.keys[u.charCodeAt(0)]=u===a?e.merge(r,{"+shift":!0}):r))}}return i.type||(i.type="press"),i},on:function(e,t,o,u){var a=t._extra,f="key"+a.type,l=a.keys,c=u?"delegate":"on";t._detach=e[c](f,function(e){var t=l?l[e.which]:a.mods;t&&(!t[n]||t[n]&&e.altKey)&&(!t[r]||t[r]&&e.ctrlKey)&&(!t[i]||t[i]&&e.metaKey)&&(!t[s]||t[s]&&e.shiftKey)&&o.fire(e)},u)},detach:function(e,t,n){t._detach.detach()}};u.delegate=u.on,u.detachDelegate=u.detach,e.Event.define("key",u,!0)},"3.7.2",{requires:["event-synthetic"]});+YUI.add("event-key",function(e,t){var n="+alt",r="+ctrl",i="+meta",s="+shift",o=e.Lang.trim,u={KEY_MAP:{enter:13,esc:27,backspace:8,tab:9,pageup:33,pagedown:34},_typeRE:/^(up|down|press):/,_keysRE:/^(?:up|down|press):|\+(alt|ctrl|meta|shift)/g,processArgs:function(t){var n=t.splice(3,1)[0],r=e.Array.hash(n.match(/\+(?:alt|ctrl|meta|shift)\b/g)||[]),i={type:this._typeRE.test(n)?RegExp.$1:null,mods:r,keys:null},s=n.replace(this._keysRE,""),u,a,f,l;if(s){s=s.split(","),i.keys={};for(l=s.length-1;l>=0;--l){u=o(s[l]);if(!u)continue;+u==u?i.keys[u]=r:(f=u.toLowerCase(),this.KEY_MAP[f]?(i.keys[this.KEY_MAP[f]]=r,i.type||(i.type="down")):(u=u.charAt(0),a=u.toUpperCase(),r["+shift"]&&(u=a),i.keys[u.charCodeAt(0)]=u===a?e.merge(r,{"+shift":!0}):r))}}return i.type||(i.type="press"),i},on:function(e,t,o,u){var a=t._extra,f="key"+a.type,l=a.keys,c=u?"delegate":"on";t._detach=e[c](f,function(e){var t=l?l[e.which]:a.mods;t&&(!t[n]||t[n]&&e.altKey)&&(!t[r]||t[r]&&e.ctrlKey)&&(!t[i]||t[i]&&e.metaKey)&&(!t[s]||t[s]&&e.shiftKey)&&o.fire(e)},u)},detach:function(e,t,n){t._detach.detach()}};u.delegate=u.on,u.detachDelegate=u.detach,e.Event.define("key",u,!0)},"3.7.3",{requires:["event-synthetic"]});
bundle/event-key/event-key.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -174,4 +174,4 @@ Y.Event.define('key', eventDef, true); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-mouseenter/event-mouseenter-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-mouseenter/event-mouseenter.js", code: [] };-_yuitest_coverage["build/event-mouseenter/event-mouseenter.js"].code=["YUI.add('event-mouseenter', function (Y, NAME) {","","/**"," * <p>Adds subscription and delegation support for mouseenter and mouseleave"," * events. Unlike mouseover and mouseout, these events aren't fired from child"," * elements of a subscribed node.</p>"," *"," * <p>This avoids receiving three mouseover notifications from a setup like</p>"," *"," * <pre><code>div#container > p > a[href]</code></pre>"," *"," * <p>where</p>"," *"," * <pre><code>Y.one('#container').on('mouseover', callback)</code></pre>"," *"," * <p>When the mouse moves over the link, one mouseover event is fired from"," * #container, then when the mouse moves over the p, another mouseover event is"," * fired and bubbles to #container, causing a second notification, and finally"," * when the mouse moves over the link, a third mouseover event is fired and"," * bubbles to #container for a third notification.</p>"," *"," * <p>By contrast, using mouseenter instead of mouseover, the callback would be"," * executed only once when the mouse moves over #container.</p>"," *"," * @module event"," * @submodule event-mouseenter"," */","","var domEventProxies = Y.Env.evt.dom_wrappers,"," contains = Y.DOM.contains,"," toArray = Y.Array,"," noop = function () {},",""," config = {"," proxyType: \"mouseover\","," relProperty: \"fromElement\",",""," _notify: function (e, property, notifier) {"," var el = this._node,"," related = e.relatedTarget || e[property];",""," if (el !== related && !contains(el, related)) {"," notifier.fire(new Y.DOMEventFacade(e, el,"," domEventProxies['event:' + Y.stamp(el) + e.type]));"," }"," },",""," on: function (node, sub, notifier) {"," var el = Y.Node.getDOMNode(node),"," args = ["," this.proxyType,"," this._notify,"," el,"," null,"," this.relProperty,"," notifier];",""," sub.handle = Y.Event._attach(args, { facade: false });"," // node.on(this.proxyType, notify, null, notifier);"," },",""," detach: function (node, sub) {"," sub.handle.detach();"," },",""," delegate: function (node, sub, notifier, filter) {"," var el = Y.Node.getDOMNode(node),"," args = ["," this.proxyType,"," noop,"," el,"," null,"," notifier"," ];",""," sub.handle = Y.Event._attach(args, { facade: false });"," sub.handle.sub.filter = filter;"," sub.handle.sub.relProperty = this.relProperty;"," sub.handle.sub._notify = this._filterNotify;"," },",""," _filterNotify: function (thisObj, args, ce) {"," args = args.slice();"," if (this.args) {"," args.push.apply(args, this.args);"," }",""," var currentTarget = Y.delegate._applyFilter(this.filter, args, ce),"," related = args[0].relatedTarget || args[0][this.relProperty],"," e, i, len, ret, ct;",""," if (currentTarget) {"," currentTarget = toArray(currentTarget);"," "," for (i = 0, len = currentTarget.length && (!e || !e.stopped); i < len; ++i) {"," ct = currentTarget[0];"," if (!contains(ct, related)) {"," if (!e) {"," e = new Y.DOMEventFacade(args[0], ct, ce);"," e.container = Y.one(ce.el);"," }"," e.currentTarget = Y.one(ct);",""," // TODO: where is notifier? args? this.notifier?"," ret = args[1].fire(e);",""," if (ret === false) {"," break;"," }"," }"," }"," }",""," return ret;"," },",""," detachDelegate: function (node, sub) {"," sub.handle.detach();"," }"," };","","Y.Event.define(\"mouseenter\", config, true);","Y.Event.define(\"mouseleave\", Y.merge(config, {"," proxyType: \"mouseout\","," relProperty: \"toElement\"","}), true);","","","}, '3.7.2', {\"requires\": [\"event-synthetic\"]});"];+_yuitest_coverage["build/event-mouseenter/event-mouseenter.js"].code=["YUI.add('event-mouseenter', function (Y, NAME) {","","/**"," * <p>Adds subscription and delegation support for mouseenter and mouseleave"," * events. Unlike mouseover and mouseout, these events aren't fired from child"," * elements of a subscribed node.</p>"," *"," * <p>This avoids receiving three mouseover notifications from a setup like</p>"," *"," * <pre><code>div#container > p > a[href]</code></pre>"," *"," * <p>where</p>"," *"," * <pre><code>Y.one('#container').on('mouseover', callback)</code></pre>"," *"," * <p>When the mouse moves over the link, one mouseover event is fired from"," * #container, then when the mouse moves over the p, another mouseover event is"," * fired and bubbles to #container, causing a second notification, and finally"," * when the mouse moves over the link, a third mouseover event is fired and"," * bubbles to #container for a third notification.</p>"," *"," * <p>By contrast, using mouseenter instead of mouseover, the callback would be"," * executed only once when the mouse moves over #container.</p>"," *"," * @module event"," * @submodule event-mouseenter"," */","","var domEventProxies = Y.Env.evt.dom_wrappers,"," contains = Y.DOM.contains,"," toArray = Y.Array,"," noop = function () {},",""," config = {"," proxyType: \"mouseover\","," relProperty: \"fromElement\",",""," _notify: function (e, property, notifier) {"," var el = this._node,"," related = e.relatedTarget || e[property];",""," if (el !== related && !contains(el, related)) {"," notifier.fire(new Y.DOMEventFacade(e, el,"," domEventProxies['event:' + Y.stamp(el) + e.type]));"," }"," },",""," on: function (node, sub, notifier) {"," var el = Y.Node.getDOMNode(node),"," args = ["," this.proxyType,"," this._notify,"," el,"," null,"," this.relProperty,"," notifier];",""," sub.handle = Y.Event._attach(args, { facade: false });"," // node.on(this.proxyType, notify, null, notifier);"," },",""," detach: function (node, sub) {"," sub.handle.detach();"," },",""," delegate: function (node, sub, notifier, filter) {"," var el = Y.Node.getDOMNode(node),"," args = ["," this.proxyType,"," noop,"," el,"," null,"," notifier"," ];",""," sub.handle = Y.Event._attach(args, { facade: false });"," sub.handle.sub.filter = filter;"," sub.handle.sub.relProperty = this.relProperty;"," sub.handle.sub._notify = this._filterNotify;"," },",""," _filterNotify: function (thisObj, args, ce) {"," args = args.slice();"," if (this.args) {"," args.push.apply(args, this.args);"," }",""," var currentTarget = Y.delegate._applyFilter(this.filter, args, ce),"," related = args[0].relatedTarget || args[0][this.relProperty],"," e, i, len, ret, ct;",""," if (currentTarget) {"," currentTarget = toArray(currentTarget);"," "," for (i = 0, len = currentTarget.length && (!e || !e.stopped); i < len; ++i) {"," ct = currentTarget[0];"," if (!contains(ct, related)) {"," if (!e) {"," e = new Y.DOMEventFacade(args[0], ct, ce);"," e.container = Y.one(ce.el);"," }"," e.currentTarget = Y.one(ct);",""," // TODO: where is notifier? args? this.notifier?"," ret = args[1].fire(e);",""," if (ret === false) {"," break;"," }"," }"," }"," }",""," return ret;"," },",""," detachDelegate: function (node, sub) {"," sub.handle.detach();"," }"," };","","Y.Event.define(\"mouseenter\", config, true);","Y.Event.define(\"mouseleave\", Y.merge(config, {"," proxyType: \"mouseout\","," relProperty: \"toElement\"","}), true);","","","}, '3.7.3', {\"requires\": [\"event-synthetic\"]});"]; _yuitest_coverage["build/event-mouseenter/event-mouseenter.js"].lines = {"1":0,"29":0,"39":0,"42":0,"43":0,"49":0,"58":0,"63":0,"67":0,"76":0,"77":0,"78":0,"79":0,"83":0,"84":0,"85":0,"88":0,"92":0,"93":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"102":0,"105":0,"107":0,"108":0,"114":0,"118":0,"122":0,"123":0}; _yuitest_coverage["build/event-mouseenter/event-mouseenter.js"].functions = {"_notify:38":0,"on:48":0,"detach:62":0,"delegate:66":0,"_filterNotify:82":0,"detachDelegate:117":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-mouseenter/event-mouseenter.js"].coveredLines = 33;@@ -205,4 +205,4 @@ }), true); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-mouseenter/event-mouseenter-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -132,4 +132,4 @@ }), true); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-mouseenter/event-mouseenter-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-mouseenter",function(e,t){var n=e.Env.evt.dom_wrappers,r=e.DOM.contains,i=e.Array,s=function(){},o={proxyType:"mouseover",relProperty:"fromElement",_notify:function(t,i,s){var o=this._node,u=t.relatedTarget||t[i];o!==u&&!r(o,u)&&s.fire(new e.DOMEventFacade(t,o,n["event:"+e.stamp(o)+t.type]))},on:function(t,n,r){var i=e.Node.getDOMNode(t),s=[this.proxyType,this._notify,i,null,this.relProperty,r];n.handle=e.Event._attach(s,{facade:!1})},detach:function(e,t){t.handle.detach()},delegate:function(t,n,r,i){var o=e.Node.getDOMNode(t),u=[this.proxyType,s,o,null,r];n.handle=e.Event._attach(u,{facade:!1}),n.handle.sub.filter=i,n.handle.sub.relProperty=this.relProperty,n.handle.sub._notify=this._filterNotify},_filterNotify:function(t,n,s){n=n.slice(),this.args&&n.push.apply(n,this.args);var o=e.delegate._applyFilter(this.filter,n,s),u=n[0].relatedTarget||n[0][this.relProperty],a,f,l,c,h;if(o){o=i(o);for(f=0,l=o.length&&(!a||!a.stopped);f<l;++f){h=o[0];if(!r(h,u)){a||(a=new e.DOMEventFacade(n[0],h,s),a.container=e.one(s.el)),a.currentTarget=e.one(h),c=n[1].fire(a);if(c===!1)break}}}return c},detachDelegate:function(e,t){t.handle.detach()}};e.Event.define("mouseenter",o,!0),e.Event.define("mouseleave",e.merge(o,{proxyType:"mouseout",relProperty:"toElement"}),!0)},"3.7.2",{requires:["event-synthetic"]});+YUI.add("event-mouseenter",function(e,t){var n=e.Env.evt.dom_wrappers,r=e.DOM.contains,i=e.Array,s=function(){},o={proxyType:"mouseover",relProperty:"fromElement",_notify:function(t,i,s){var o=this._node,u=t.relatedTarget||t[i];o!==u&&!r(o,u)&&s.fire(new e.DOMEventFacade(t,o,n["event:"+e.stamp(o)+t.type]))},on:function(t,n,r){var i=e.Node.getDOMNode(t),s=[this.proxyType,this._notify,i,null,this.relProperty,r];n.handle=e.Event._attach(s,{facade:!1})},detach:function(e,t){t.handle.detach()},delegate:function(t,n,r,i){var o=e.Node.getDOMNode(t),u=[this.proxyType,s,o,null,r];n.handle=e.Event._attach(u,{facade:!1}),n.handle.sub.filter=i,n.handle.sub.relProperty=this.relProperty,n.handle.sub._notify=this._filterNotify},_filterNotify:function(t,n,s){n=n.slice(),this.args&&n.push.apply(n,this.args);var o=e.delegate._applyFilter(this.filter,n,s),u=n[0].relatedTarget||n[0][this.relProperty],a,f,l,c,h;if(o){o=i(o);for(f=0,l=o.length&&(!a||!a.stopped);f<l;++f){h=o[0];if(!r(h,u)){a||(a=new e.DOMEventFacade(n[0],h,s),a.container=e.one(s.el)),a.currentTarget=e.one(h),c=n[1].fire(a);if(c===!1)break}}}return c},detachDelegate:function(e,t){t.handle.detach()}};e.Event.define("mouseenter",o,!0),e.Event.define("mouseleave",e.merge(o,{proxyType:"mouseout",relProperty:"toElement"}),!0)},"3.7.3",{requires:["event-synthetic"]});
bundle/event-mouseenter/event-mouseenter.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -132,4 +132,4 @@ }), true); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-mousewheel/event-mousewheel-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-mousewheel/event-mousewheel.js", code: [] };-_yuitest_coverage["build/event-mousewheel/event-mousewheel.js"].code=["YUI.add('event-mousewheel', function (Y, NAME) {","","/**"," * Adds mousewheel event support"," * @module event"," * @submodule event-mousewheel"," */","var DOM_MOUSE_SCROLL = 'DOMMouseScroll',"," fixArgs = function(args) {"," var a = Y.Array(args, 0, true), target;"," if (Y.UA.gecko) {"," a[0] = DOM_MOUSE_SCROLL;"," target = Y.config.win;"," } else {"," target = Y.config.doc;"," }",""," if (a.length < 3) {"," a[2] = target;"," } else {"," a.splice(2, 0, target);"," }",""," return a;"," };","","/**"," * Mousewheel event. This listener is automatically attached to the"," * correct target, so one should not be supplied. Mouse wheel "," * direction and velocity is stored in the 'wheelDelta' field."," * @event mousewheel"," * @param type {string} 'mousewheel'"," * @param fn {function} the callback to execute"," * @param context optional context object"," * @param args 0..n additional arguments to provide to the listener."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.Env.evt.plugins.mousewheel = {"," on: function() {"," return Y.Event._attach(fixArgs(arguments));"," },",""," detach: function() {"," return Y.Event.detach.apply(Y.Event, fixArgs(arguments));"," }","};","","","}, '3.7.2', {\"requires\": [\"node-base\"]});"];+_yuitest_coverage["build/event-mousewheel/event-mousewheel.js"].code=["YUI.add('event-mousewheel', function (Y, NAME) {","","/**"," * Adds mousewheel event support"," * @module event"," * @submodule event-mousewheel"," */","var DOM_MOUSE_SCROLL = 'DOMMouseScroll',"," fixArgs = function(args) {"," var a = Y.Array(args, 0, true), target;"," if (Y.UA.gecko) {"," a[0] = DOM_MOUSE_SCROLL;"," target = Y.config.win;"," } else {"," target = Y.config.doc;"," }",""," if (a.length < 3) {"," a[2] = target;"," } else {"," a.splice(2, 0, target);"," }",""," return a;"," };","","/**"," * Mousewheel event. This listener is automatically attached to the"," * correct target, so one should not be supplied. Mouse wheel "," * direction and velocity is stored in the 'wheelDelta' field."," * @event mousewheel"," * @param type {string} 'mousewheel'"," * @param fn {function} the callback to execute"," * @param context optional context object"," * @param args 0..n additional arguments to provide to the listener."," * @return {EventHandle} the detach handle"," * @for YUI"," */","Y.Env.evt.plugins.mousewheel = {"," on: function() {"," return Y.Event._attach(fixArgs(arguments));"," },",""," detach: function() {"," return Y.Event.detach.apply(Y.Event, fixArgs(arguments));"," }","};","","","}, '3.7.3', {\"requires\": [\"node-base\"]});"]; _yuitest_coverage["build/event-mousewheel/event-mousewheel.js"].lines = {"1":0,"8":0,"10":0,"11":0,"12":0,"13":0,"15":0,"18":0,"19":0,"21":0,"24":0,"39":0,"41":0,"45":0}; _yuitest_coverage["build/event-mousewheel/event-mousewheel.js"].functions = {"fixArgs:9":0,"on:40":0,"detach:44":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-mousewheel/event-mousewheel.js"].coveredLines = 14;@@ -104,4 +104,4 @@ }; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-mousewheel/event-mousewheel-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -53,4 +53,4 @@ }; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-mousewheel/event-mousewheel-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-mousewheel",function(e,t){var n="DOMMouseScroll",r=function(t){var r=e.Array(t,0,!0),i;return e.UA.gecko?(r[0]=n,i=e.config.win):i=e.config.doc,r.length<3?r[2]=i:r.splice(2,0,i),r};e.Env.evt.plugins.mousewheel={on:function(){return e.Event._attach(r(arguments))},detach:function(){return e.Event.detach.apply(e.Event,r(arguments))}}},"3.7.2",{requires:["node-base"]});+YUI.add("event-mousewheel",function(e,t){var n="DOMMouseScroll",r=function(t){var r=e.Array(t,0,!0),i;return e.UA.gecko?(r[0]=n,i=e.config.win):i=e.config.doc,r.length<3?r[2]=i:r.splice(2,0,i),r};e.Env.evt.plugins.mousewheel={on:function(){return e.Event._attach(r(arguments))},detach:function(){return e.Event.detach.apply(e.Event,r(arguments))}}},"3.7.3",{requires:["node-base"]});
bundle/event-mousewheel/event-mousewheel.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -53,4 +53,4 @@ }; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-move/event-move-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/event-move/event-move.js", code: [] };-_yuitest_coverage["build/event-move/event-move.js"].code=["YUI.add('event-move', function (Y, NAME) {","","/**"," * Adds lower level support for \"gesturemovestart\", \"gesturemove\" and \"gesturemoveend\" events, which can be used to create drag/drop"," * interactions which work across touch and mouse input devices. They correspond to \"touchstart\", \"touchmove\" and \"touchend\" on a touch input"," * device, and \"mousedown\", \"mousemove\", \"mouseup\" on a mouse based input device."," *"," * @module event-gestures"," * @submodule event-move"," */",""," var GESTURE_MAP = Y.Event._GESTURE_MAP,"," EVENT = {"," start: GESTURE_MAP.start,"," end: GESTURE_MAP.end,"," move: GESTURE_MAP.move"," },"," START = \"start\","," MOVE = \"move\","," END = \"end\",",""," GESTURE_MOVE = \"gesture\" + MOVE,"," GESTURE_MOVE_END = GESTURE_MOVE + END,"," GESTURE_MOVE_START = GESTURE_MOVE + START,",""," _MOVE_START_HANDLE = \"_msh\","," _MOVE_HANDLE = \"_mh\","," _MOVE_END_HANDLE = \"_meh\",",""," _DEL_MOVE_START_HANDLE = \"_dmsh\","," _DEL_MOVE_HANDLE = \"_dmh\","," _DEL_MOVE_END_HANDLE = \"_dmeh\",",""," _MOVE_START = \"_ms\","," _MOVE = \"_m\",",""," MIN_TIME = \"minTime\","," MIN_DISTANCE = \"minDistance\","," PREVENT_DEFAULT = \"preventDefault\","," BUTTON = \"button\","," OWNER_DOCUMENT = \"ownerDocument\",",""," CURRENT_TARGET = \"currentTarget\","," TARGET = \"target\",",""," NODE_TYPE = \"nodeType\",",""," _defArgsProcessor = function(se, args, delegate) {"," var iConfig = (delegate) ? 4 : 3, "," config = (args.length > iConfig) ? Y.merge(args.splice(iConfig,1)[0]) : {};",""," if (!(PREVENT_DEFAULT in config)) {"," config[PREVENT_DEFAULT] = se.PREVENT_DEFAULT;"," }",""," return config;"," },",""," _getRoot = function(node, subscriber) {"," return subscriber._extra.root || (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);"," },",""," _normTouchFacade = function(touchFacade, touch, params) {"," touchFacade.pageX = touch.pageX;"," touchFacade.pageY = touch.pageY;"," touchFacade.screenX = touch.screenX;"," touchFacade.screenY = touch.screenY;"," touchFacade.clientX = touch.clientX;"," touchFacade.clientY = touch.clientY;"," touchFacade[TARGET] = touchFacade[TARGET] || touch[TARGET];"," touchFacade[CURRENT_TARGET] = touchFacade[CURRENT_TARGET] || touch[CURRENT_TARGET];",""," touchFacade[BUTTON] = (params && params[BUTTON]) || 1; // default to left (left as per vendors, not W3C which is 0)"," },",""," _prevent = function(e, preventDefault) {"," if (preventDefault) {"," // preventDefault is a boolean or a function"," if (!preventDefault.call || preventDefault(e)) {"," e.preventDefault();"," }"," }"," },",""," define = Y.Event.define;","","/**"," * Sets up a \"gesturemovestart\" event, that is fired on touch devices in response to a single finger \"touchstart\","," * and on mouse based devices in response to a \"mousedown\". The subscriber can specify the minimum time"," * and distance thresholds which should be crossed before the \"gesturemovestart\" is fired and for the mouse,"," * which button should initiate a \"gesturemovestart\". This event can also be listened for using node.delegate()."," * "," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to on/delegate, "," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"gesturemovestart\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," * @event gesturemovestart"," * @for YUI"," * @param type {string} \"gesturemovestart\""," * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mousedown or touchstart.touches[0]) which contains position co-ordinates."," * @param cfg {Object} Optional. An object which specifies:"," *"," * <dl>"," * <dt>minDistance (defaults to 0)</dt>"," * <dd>The minimum distance threshold which should be crossed before the gesturemovestart is fired</dd>"," * <dt>minTime (defaults to 0)</dt>"," * <dd>The minimum time threshold for which the finger/mouse should be help down before the gesturemovestart is fired</dd>"," * <dt>button (no default)</dt>"," * <dd>In the case of a mouse input device, if the event should only be fired for a specific mouse button.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be "," * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it (for example, DragDrop can determine if the target is a valid handle or not before preventing default).</dd>"," * </dl>"," *"," * @return {EventHandle} the detach handle"," */","","define(GESTURE_MOVE_START, {",""," on: function (node, subscriber, ce) {",""," subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], "," this._onStart,"," this,"," node,"," subscriber,"," ce);"," },",""," delegate : function(node, subscriber, ce, filter) {",""," var se = this;",""," subscriber[_DEL_MOVE_START_HANDLE] = node.delegate(EVENT[START],"," function(e) {"," se._onStart(e, node, subscriber, ce, true);"," },"," filter);"," },",""," detachDelegate : function(node, subscriber, ce, filter) {"," var handle = subscriber[_DEL_MOVE_START_HANDLE];",""," if (handle) {"," handle.detach();"," subscriber[_DEL_MOVE_START_HANDLE] = null;"," }"," },",""," detach: function (node, subscriber, ce) {"," var startHandle = subscriber[_MOVE_START_HANDLE];",""," if (startHandle) {"," startHandle.detach();"," subscriber[_MOVE_START_HANDLE] = null;"," }"," },",""," processArgs : function(args, delegate) {"," var params = _defArgsProcessor(this, args, delegate);",""," if (!(MIN_TIME in params)) {"," params[MIN_TIME] = this.MIN_TIME;"," }",""," if (!(MIN_DISTANCE in params)) {"," params[MIN_DISTANCE] = this.MIN_DISTANCE;"," }",""," return params;"," },",""," _onStart : function(e, node, subscriber, ce, delegate) {",""," if (delegate) {"," node = e[CURRENT_TARGET];"," }",""," var params = subscriber._extra,"," fireStart = true,"," minTime = params[MIN_TIME],"," minDistance = params[MIN_DISTANCE],"," button = params.button,"," preventDefault = params[PREVENT_DEFAULT],"," root = _getRoot(node, subscriber),"," startXY;",""," if (e.touches) {"," if (e.touches.length === 1) {"," _normTouchFacade(e, e.touches[0], params);"," } else {"," fireStart = false;"," }"," } else {"," fireStart = (button === undefined) || (button === e.button);"," }","",""," if (fireStart) {",""," _prevent(e, preventDefault);",""," if (minTime === 0 || minDistance === 0) {"," this._start(e, node, ce, params);",""," } else {",""," startXY = [e.pageX, e.pageY];",""," if (minTime > 0) {","",""," params._ht = Y.later(minTime, this, this._start, [e, node, ce, params]);",""," params._hme = root.on(EVENT[END], Y.bind(function() {"," this._cancel(params);"," }, this));"," }",""," if (minDistance > 0) {","",""," params._hm = root.on(EVENT[MOVE], Y.bind(function(em) {"," if (Math.abs(em.pageX - startXY[0]) > minDistance || Math.abs(em.pageY - startXY[1]) > minDistance) {"," this._start(e, node, ce, params);"," }"," }, this));"," } "," }"," }"," },",""," _cancel : function(params) {"," if (params._ht) {"," params._ht.cancel();"," params._ht = null;"," }"," if (params._hme) {"," params._hme.detach();"," params._hme = null;"," }"," if (params._hm) {"," params._hm.detach();"," params._hm = null;"," }"," },",""," _start : function(e, node, ce, params) {",""," if (params) {"," this._cancel(params);"," }",""," e.type = GESTURE_MOVE_START;","",""," node.setData(_MOVE_START, e);"," ce.fire(e);"," },",""," MIN_TIME : 0,"," MIN_DISTANCE : 0,"," PREVENT_DEFAULT : false","});","","/**"," * Sets up a \"gesturemove\" event, that is fired on touch devices in response to a single finger \"touchmove\","," * and on mouse based devices in response to a \"mousemove\"."," * "," * <p>By default this event is only fired when the same node"," * has received a \"gesturemovestart\" event. The subscriber can set standAlone to true, in the configuration properties,"," * if they want to listen for this event without an initial \"gesturemovestart\".</p>"," * "," * <p>By default this event sets up it's internal \"touchmove\" and \"mousemove\" DOM listeners on the document element. The subscriber"," * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> "," *"," * <p>This event can also be listened for using node.delegate().</p>"," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to on/delegate, "," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"gesturemove\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," * @event gesturemove"," * @for YUI"," * @param type {string} \"gesturemove\""," * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mousemove or touchmove.touches[0]) which contains position co-ordinates."," * @param cfg {Object} Optional. An object which specifies:"," * <dl>"," * <dt>standAlone (defaults to false)</dt>"," * <dd>true, if the subscriber should be notified even if a \"gesturemovestart\" has not occured on the same node.</dd>"," * <dt>root (defaults to document)</dt>"," * <dd>The node to which the internal DOM listeners should be attached.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchmove or mousemove is received. As with gesturemovestart, can also be set to function which returns true/false based on the event facade passed to it.</dd>"," * </dl>"," *"," * @return {EventHandle} the detach handle"," */","define(GESTURE_MOVE, {",""," on : function (node, subscriber, ce) {",""," var root = _getRoot(node, subscriber),",""," moveHandle = root.on(EVENT[MOVE], "," this._onMove,"," this,"," node,"," subscriber,"," ce);",""," subscriber[_MOVE_HANDLE] = moveHandle;"," },",""," delegate : function(node, subscriber, ce, filter) {",""," var se = this;",""," subscriber[_DEL_MOVE_HANDLE] = node.delegate(EVENT[MOVE],"," function(e) {"," se._onMove(e, node, subscriber, ce, true);"," },"," filter);"," },",""," detach : function (node, subscriber, ce) {"," var moveHandle = subscriber[_MOVE_HANDLE];",""," if (moveHandle) {"," moveHandle.detach();"," subscriber[_MOVE_HANDLE] = null;"," }"," },"," "," detachDelegate : function(node, subscriber, ce, filter) {"," var handle = subscriber[_DEL_MOVE_HANDLE];",""," if (handle) {"," handle.detach();"," subscriber[_DEL_MOVE_HANDLE] = null;"," }",""," },",""," processArgs : function(args, delegate) {"," return _defArgsProcessor(this, args, delegate);"," },",""," _onMove : function(e, node, subscriber, ce, delegate) {",""," if (delegate) {"," node = e[CURRENT_TARGET];"," }",""," var fireMove = subscriber._extra.standAlone || node.getData(_MOVE_START),"," preventDefault = subscriber._extra.preventDefault;","",""," if (fireMove) {",""," if (e.touches) {"," if (e.touches.length === 1) {"," _normTouchFacade(e, e.touches[0]); "," } else {"," fireMove = false;"," }"," }",""," if (fireMove) {",""," _prevent(e, preventDefault);","",""," e.type = GESTURE_MOVE;"," ce.fire(e);"," }"," }"," },"," "," PREVENT_DEFAULT : false","});","","/**"," * Sets up a \"gesturemoveend\" event, that is fired on touch devices in response to a single finger \"touchend\","," * and on mouse based devices in response to a \"mouseup\"."," * "," * <p>By default this event is only fired when the same node"," * has received a \"gesturemove\" or \"gesturemovestart\" event. The subscriber can set standAlone to true, in the configuration properties,"," * if they want to listen for this event without a preceding \"gesturemovestart\" or \"gesturemove\".</p>"," *"," * <p>By default this event sets up it's internal \"touchend\" and \"mouseup\" DOM listeners on the document element. The subscriber"," * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> "," *"," * <p>This event can also be listened for using node.delegate().</p>"," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to on/delegate, "," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"gesturemoveend\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," *"," * @event gesturemoveend"," * @for YUI"," * @param type {string} \"gesturemoveend\""," * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mouseup or touchend.changedTouches[0])."," * @param cfg {Object} Optional. An object which specifies:"," * <dl>"," * <dt>standAlone (defaults to false)</dt>"," * <dd>true, if the subscriber should be notified even if a \"gesturemovestart\" or \"gesturemove\" has not occured on the same node.</dd>"," * <dt>root (defaults to document)</dt>"," * <dd>The node to which the internal DOM listeners should be attached.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchend or mouseup is received. As with gesturemovestart, can also be set to function which returns true/false based on the event facade passed to it.</dd>"," * </dl>"," *"," * @return {EventHandle} the detach handle"," */","define(GESTURE_MOVE_END, {",""," on : function (node, subscriber, ce) {",""," var root = _getRoot(node, subscriber),",""," endHandle = root.on(EVENT[END], "," this._onEnd, "," this,"," node,"," subscriber, "," ce);",""," subscriber[_MOVE_END_HANDLE] = endHandle;"," },",""," delegate : function(node, subscriber, ce, filter) {",""," var se = this;",""," subscriber[_DEL_MOVE_END_HANDLE] = node.delegate(EVENT[END],"," function(e) {"," se._onEnd(e, node, subscriber, ce, true);"," },"," filter);"," },",""," detachDelegate : function(node, subscriber, ce, filter) {"," var handle = subscriber[_DEL_MOVE_END_HANDLE];",""," if (handle) {"," handle.detach();"," subscriber[_DEL_MOVE_END_HANDLE] = null;"," }",""," },",""," detach : function (node, subscriber, ce) {"," var endHandle = subscriber[_MOVE_END_HANDLE];"," "," if (endHandle) {"," endHandle.detach();"," subscriber[_MOVE_END_HANDLE] = null;"," }"," },",""," processArgs : function(args, delegate) {"," return _defArgsProcessor(this, args, delegate);"," },",""," _onEnd : function(e, node, subscriber, ce, delegate) {",""," if (delegate) {"," node = e[CURRENT_TARGET];"," }",""," var fireMoveEnd = subscriber._extra.standAlone || node.getData(_MOVE) || node.getData(_MOVE_START),"," preventDefault = subscriber._extra.preventDefault;",""," if (fireMoveEnd) {",""," if (e.changedTouches) {"," if (e.changedTouches.length === 1) {"," _normTouchFacade(e, e.changedTouches[0]); "," } else {"," fireMoveEnd = false;"," }"," }",""," if (fireMoveEnd) {",""," _prevent(e, preventDefault);",""," e.type = GESTURE_MOVE_END;"," ce.fire(e);",""," node.clearData(_MOVE_START);"," node.clearData(_MOVE);"," }"," }"," },",""," PREVENT_DEFAULT : false","});","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-touch\", \"event-synthetic\"]});"];-_yuitest_coverage["build/event-move/event-move.js"].lines = {"1":0,"12":0,"49":0,"52":0,"53":0,"56":0,"60":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"73":0,"77":0,"79":0,"80":0,"118":0,"122":0,"132":0,"134":0,"136":0,"142":0,"144":0,"145":0,"146":0,"151":0,"153":0,"154":0,"155":0,"160":0,"162":0,"163":0,"166":0,"167":0,"170":0,"175":0,"176":0,"179":0,"188":0,"189":0,"190":0,"192":0,"195":0,"199":0,"201":0,"203":0,"204":0,"208":0,"210":0,"213":0,"215":0,"216":0,"220":0,"223":0,"224":0,"225":0,"234":0,"235":0,"236":0,"238":0,"239":0,"240":0,"242":0,"243":0,"244":0,"250":0,"251":0,"254":0,"257":0,"258":0,"299":0,"303":0,"312":0,"317":0,"319":0,"321":0,"327":0,"329":0,"330":0,"331":0,"336":0,"338":0,"339":0,"340":0,"346":0,"351":0,"352":0,"355":0,"359":0,"361":0,"362":0,"363":0,"365":0,"369":0,"371":0,"374":0,"375":0,"417":0,"421":0,"430":0,"435":0,"437":0,"439":0,"445":0,"447":0,"448":0,"449":0,"455":0,"457":0,"458":0,"459":0,"464":0,"469":0,"470":0,"473":0,"476":0,"478":0,"479":0,"480":0,"482":0,"486":0,"488":0,"490":0,"491":0,"493":0,"494":0};-_yuitest_coverage["build/event-move/event-move.js"].functions = {"_defArgsProcessor:48":0,"_getRoot:59":0,"_normTouchFacade:63":0,"_prevent:76":0,"on:120":0,"(anonymous 2):135":0,"delegate:130":0,"detachDelegate:141":0,"detach:150":0,"processArgs:159":0,"(anonymous 3):215":0,"(anonymous 4):223":0,"_onStart:173":0,"_cancel:233":0,"_start:248":0,"on:301":0,"(anonymous 5):320":0,"delegate:315":0,"detach:326":0,"detachDelegate:335":0,"processArgs:345":0,"_onMove:349":0,"on:419":0,"(anonymous 6):438":0,"delegate:433":0,"detachDelegate:444":0,"detach:454":0,"processArgs:463":0,"_onEnd:467":0,"(anonymous 1):1":0};-_yuitest_coverage["build/event-move/event-move.js"].coveredLines = 129;-_yuitest_coverage["build/event-move/event-move.js"].coveredFunctions = 30;+_yuitest_coverage["build/event-move/event-move.js"].code=["YUI.add('event-move', function (Y, NAME) {","","/**"," * Adds lower level support for \"gesturemovestart\", \"gesturemove\" and \"gesturemoveend\" events, which can be used to create drag/drop"," * interactions which work across touch and mouse input devices. They correspond to \"touchstart\", \"touchmove\" and \"touchend\" on a touch input"," * device, and \"mousedown\", \"mousemove\", \"mouseup\" on a mouse based input device."," *"," * <p>Documentation for the gesturemove triplet of events can be found on the <a href=\"../classes/YUI.html#event_gesturemove\">YUI</a> global,"," * along with the other supported events.</p>",""," @example",""," YUI().use('event-move', function (Y) {"," Y.one('#myNode').on('gesturemovestart', function (e) {"," });"," Y.one('#myNode').on('gesturemove', function (e) {"," });"," Y.one('#myNode').on('gesturemoveend', function (e) {"," });"," });",""," * @module event-gestures"," * @submodule event-move"," */","",""," var GESTURE_MAP = Y.Event._GESTURE_MAP,"," EVENT = {"," start: GESTURE_MAP.start,"," end: GESTURE_MAP.end,"," move: GESTURE_MAP.move"," },"," START = \"start\","," MOVE = \"move\","," END = \"end\",",""," GESTURE_MOVE = \"gesture\" + MOVE,"," GESTURE_MOVE_END = GESTURE_MOVE + END,"," GESTURE_MOVE_START = GESTURE_MOVE + START,",""," _MOVE_START_HANDLE = \"_msh\","," _MOVE_HANDLE = \"_mh\","," _MOVE_END_HANDLE = \"_meh\",",""," _DEL_MOVE_START_HANDLE = \"_dmsh\","," _DEL_MOVE_HANDLE = \"_dmh\","," _DEL_MOVE_END_HANDLE = \"_dmeh\",",""," _MOVE_START = \"_ms\","," _MOVE = \"_m\",",""," MIN_TIME = \"minTime\","," MIN_DISTANCE = \"minDistance\","," PREVENT_DEFAULT = \"preventDefault\","," BUTTON = \"button\","," OWNER_DOCUMENT = \"ownerDocument\",",""," CURRENT_TARGET = \"currentTarget\","," TARGET = \"target\",",""," NODE_TYPE = \"nodeType\","," SUPPORTS_POINTER = Y.config.win && (\"msPointerEnabled\" in Y.config.win.navigator),"," MS_TOUCH_ACTION_COUNT = 'msTouchActionCount',"," MS_INIT_TOUCH_ACTION = 'msInitTouchAction',",""," _defArgsProcessor = function(se, args, delegate) {"," var iConfig = (delegate) ? 4 : 3,"," config = (args.length > iConfig) ? Y.merge(args.splice(iConfig,1)[0]) : {};",""," if (!(PREVENT_DEFAULT in config)) {"," config[PREVENT_DEFAULT] = se.PREVENT_DEFAULT;"," }",""," return config;"," },",""," _getRoot = function(node, subscriber) {"," return subscriber._extra.root || (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT);"," },",""," //Checks to see if the node is the document, and if it is, returns the documentElement."," _checkDocumentElem = function(node) {"," var elem = node.getDOMNode();"," if (node.compareTo(Y.config.doc) && elem.documentElement) {"," return elem.documentElement;"," }"," else {"," return false;"," }"," },",""," _normTouchFacade = function(touchFacade, touch, params) {"," touchFacade.pageX = touch.pageX;"," touchFacade.pageY = touch.pageY;"," touchFacade.screenX = touch.screenX;"," touchFacade.screenY = touch.screenY;"," touchFacade.clientX = touch.clientX;"," touchFacade.clientY = touch.clientY;"," touchFacade[TARGET] = touchFacade[TARGET] || touch[TARGET];"," touchFacade[CURRENT_TARGET] = touchFacade[CURRENT_TARGET] || touch[CURRENT_TARGET];",""," touchFacade[BUTTON] = (params && params[BUTTON]) || 1; // default to left (left as per vendors, not W3C which is 0)"," },",""," /*"," In IE10 touch mode, gestures will not work properly unless the -ms-touch-action CSS property is set to something other than 'auto'. Read http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx for more info. To get around this, we set -ms-touch-action: none which is the same as e.preventDefault() on touch environments. This tells the browser to fire DOM events for all touch events, and not perform any default behavior.",""," The user can over-ride this by setting a more lenient -ms-touch-action property on a node (such as pan-x, pan-y, etc.) via CSS when subscribing to the 'gesturemovestart' event."," */"," _setTouchActions = function (node) {"," var elem = _checkDocumentElem(node) || node.getDOMNode(),"," num = node.getData(MS_TOUCH_ACTION_COUNT);",""," //Checks to see if msTouchAction is supported."," if (SUPPORTS_POINTER) {"," if (!num) {"," num = 0;"," node.setData(MS_INIT_TOUCH_ACTION, elem.style.msTouchAction);"," }"," elem.style.msTouchAction = Y.Event._DEFAULT_TOUCH_ACTION;"," num++;"," node.setData(MS_TOUCH_ACTION_COUNT, num);"," }"," },",""," /*"," Resets the element's -ms-touch-action property back to the original value, This is called on detach() and detachDelegate()."," */"," _unsetTouchActions = function (node) {"," var elem = _checkDocumentElem(node) || node.getDOMNode(),"," num = node.getData(MS_TOUCH_ACTION_COUNT),"," initTouchAction = node.getData(MS_INIT_TOUCH_ACTION);",""," if (SUPPORTS_POINTER) {"," num--;"," node.setData(MS_TOUCH_ACTION_COUNT, num);"," if (num === 0 && elem.style.msTouchAction !== initTouchAction) {"," elem.style.msTouchAction = initTouchAction;"," }"," }"," },",""," _prevent = function(e, preventDefault) {"," if (preventDefault) {"," // preventDefault is a boolean or a function"," if (!preventDefault.call || preventDefault(e)) {"," e.preventDefault();"," }"," }"," },",""," define = Y.Event.define;"," Y.Event._DEFAULT_TOUCH_ACTION = 'none';","","/**"," * Sets up a \"gesturemovestart\" event, that is fired on touch devices in response to a single finger \"touchstart\","," * and on mouse based devices in response to a \"mousedown\". The subscriber can specify the minimum time"," * and distance thresholds which should be crossed before the \"gesturemovestart\" is fired and for the mouse,"," * which button should initiate a \"gesturemovestart\". This event can also be listened for using node.delegate()."," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to on/delegate,"," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"gesturemovestart\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," * @event gesturemovestart"," * @for YUI"," * @param type {string} \"gesturemovestart\""," * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mousedown or touchstart.touches[0]) which contains position co-ordinates."," * @param cfg {Object} Optional. An object which specifies:"," *"," * <dl>"," * <dt>minDistance (defaults to 0)</dt>"," * <dd>The minimum distance threshold which should be crossed before the gesturemovestart is fired</dd>"," * <dt>minTime (defaults to 0)</dt>"," * <dd>The minimum time threshold for which the finger/mouse should be help down before the gesturemovestart is fired</dd>"," * <dt>button (no default)</dt>"," * <dd>In the case of a mouse input device, if the event should only be fired for a specific mouse button.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be"," * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it (for example, DragDrop can determine if the target is a valid handle or not before preventing default).</dd>"," * </dl>"," *"," * @return {EventHandle} the detach handle"," */","","define(GESTURE_MOVE_START, {",""," on: function (node, subscriber, ce) {",""," //Set -ms-touch-action on IE10 and set preventDefault to true"," _setTouchActions(node);",""," subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START],"," this._onStart,"," this,"," node,"," subscriber,"," ce);"," },",""," delegate : function(node, subscriber, ce, filter) {",""," var se = this;",""," subscriber[_DEL_MOVE_START_HANDLE] = node.delegate(EVENT[START],"," function(e) {"," se._onStart(e, node, subscriber, ce, true);"," },"," filter);"," },",""," detachDelegate : function(node, subscriber, ce, filter) {"," var handle = subscriber[_DEL_MOVE_START_HANDLE];",""," if (handle) {"," handle.detach();"," subscriber[_DEL_MOVE_START_HANDLE] = null;"," }",""," _unsetTouchActions(node);"," },",""," detach: function (node, subscriber, ce) {"," var startHandle = subscriber[_MOVE_START_HANDLE];",""," if (startHandle) {"," startHandle.detach();"," subscriber[_MOVE_START_HANDLE] = null;"," }",""," _unsetTouchActions(node);"," },",""," processArgs : function(args, delegate) {"," var params = _defArgsProcessor(this, args, delegate);",""," if (!(MIN_TIME in params)) {"," params[MIN_TIME] = this.MIN_TIME;"," }",""," if (!(MIN_DISTANCE in params)) {"," params[MIN_DISTANCE] = this.MIN_DISTANCE;"," }",""," return params;"," },",""," _onStart : function(e, node, subscriber, ce, delegate) {",""," if (delegate) {"," node = e[CURRENT_TARGET];"," }",""," var params = subscriber._extra,"," fireStart = true,"," minTime = params[MIN_TIME],"," minDistance = params[MIN_DISTANCE],"," button = params.button,"," preventDefault = params[PREVENT_DEFAULT],"," root = _getRoot(node, subscriber),"," startXY;",""," if (e.touches) {"," if (e.touches.length === 1) {"," _normTouchFacade(e, e.touches[0], params);"," } else {"," fireStart = false;"," }"," } else {"," fireStart = (button === undefined) || (button === e.button);"," }","",""," if (fireStart) {",""," _prevent(e, preventDefault);",""," if (minTime === 0 || minDistance === 0) {"," this._start(e, node, ce, params);",""," } else {",""," startXY = [e.pageX, e.pageY];",""," if (minTime > 0) {","",""," params._ht = Y.later(minTime, this, this._start, [e, node, ce, params]);",""," params._hme = root.on(EVENT[END], Y.bind(function() {"," this._cancel(params);"," }, this));"," }",""," if (minDistance > 0) {","",""," params._hm = root.on(EVENT[MOVE], Y.bind(function(em) {"," if (Math.abs(em.pageX - startXY[0]) > minDistance || Math.abs(em.pageY - startXY[1]) > minDistance) {"," this._start(e, node, ce, params);"," }"," }, this));"," }"," }"," }"," },",""," _cancel : function(params) {"," if (params._ht) {"," params._ht.cancel();"," params._ht = null;"," }"," if (params._hme) {"," params._hme.detach();"," params._hme = null;"," }"," if (params._hm) {"," params._hm.detach();"," params._hm = null;"," }"," },",""," _start : function(e, node, ce, params) {",""," if (params) {"," this._cancel(params);"," }",""," e.type = GESTURE_MOVE_START;","",""," node.setData(_MOVE_START, e);"," ce.fire(e);"," },",""," MIN_TIME : 0,"," MIN_DISTANCE : 0,"," PREVENT_DEFAULT : false","});","","/**"," * Sets up a \"gesturemove\" event, that is fired on touch devices in response to a single finger \"touchmove\","," * and on mouse based devices in response to a \"mousemove\"."," *"," * <p>By default this event is only fired when the same node"," * has received a \"gesturemovestart\" event. The subscriber can set standAlone to true, in the configuration properties,"," * if they want to listen for this event without an initial \"gesturemovestart\".</p>"," *"," * <p>By default this event sets up it's internal \"touchmove\" and \"mousemove\" DOM listeners on the document element. The subscriber"," * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p>"," *"," * <p>This event can also be listened for using node.delegate().</p>"," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to on/delegate,"," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"gesturemove\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," * @event gesturemove"," * @for YUI"," * @param type {string} \"gesturemove\""," * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mousemove or touchmove.touches[0]) which contains position co-ordinates."," * @param cfg {Object} Optional. An object which specifies:"," * <dl>"," * <dt>standAlone (defaults to false)</dt>"," * <dd>true, if the subscriber should be notified even if a \"gesturemovestart\" has not occured on the same node.</dd>"," * <dt>root (defaults to document)</dt>"," * <dd>The node to which the internal DOM listeners should be attached.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchmove or mousemove is received. As with gesturemovestart, can also be set to function which returns true/false based on the event facade passed to it.</dd>"," * </dl>"," *"," * @return {EventHandle} the detach handle"," */","define(GESTURE_MOVE, {",""," on : function (node, subscriber, ce) {",""," _setTouchActions(node);"," var root = _getRoot(node, subscriber, EVENT[MOVE]),",""," moveHandle = root.on(EVENT[MOVE],"," this._onMove,"," this,"," node,"," subscriber,"," ce);",""," subscriber[_MOVE_HANDLE] = moveHandle;",""," },",""," delegate : function(node, subscriber, ce, filter) {",""," var se = this;",""," subscriber[_DEL_MOVE_HANDLE] = node.delegate(EVENT[MOVE],"," function(e) {"," se._onMove(e, node, subscriber, ce, true);"," },"," filter);"," },",""," detach : function (node, subscriber, ce) {"," var moveHandle = subscriber[_MOVE_HANDLE];",""," if (moveHandle) {"," moveHandle.detach();"," subscriber[_MOVE_HANDLE] = null;"," }",""," _unsetTouchActions(node);"," },",""," detachDelegate : function(node, subscriber, ce, filter) {"," var handle = subscriber[_DEL_MOVE_HANDLE];",""," if (handle) {"," handle.detach();"," subscriber[_DEL_MOVE_HANDLE] = null;"," }",""," _unsetTouchActions(node);",""," },",""," processArgs : function(args, delegate) {"," return _defArgsProcessor(this, args, delegate);"," },",""," _onMove : function(e, node, subscriber, ce, delegate) {",""," if (delegate) {"," node = e[CURRENT_TARGET];"," }",""," var fireMove = subscriber._extra.standAlone || node.getData(_MOVE_START),"," preventDefault = subscriber._extra.preventDefault;","",""," if (fireMove) {",""," if (e.touches) {"," if (e.touches.length === 1) {"," _normTouchFacade(e, e.touches[0]);"," } else {"," fireMove = false;"," }"," }",""," if (fireMove) {",""," _prevent(e, preventDefault);","",""," e.type = GESTURE_MOVE;"," ce.fire(e);"," }"," }"," },",""," PREVENT_DEFAULT : false","});","","/**"," * Sets up a \"gesturemoveend\" event, that is fired on touch devices in response to a single finger \"touchend\","," * and on mouse based devices in response to a \"mouseup\"."," *"," * <p>By default this event is only fired when the same node"," * has received a \"gesturemove\" or \"gesturemovestart\" event. The subscriber can set standAlone to true, in the configuration properties,"," * if they want to listen for this event without a preceding \"gesturemovestart\" or \"gesturemove\".</p>"," *"," * <p>By default this event sets up it's internal \"touchend\" and \"mouseup\" DOM listeners on the document element. The subscriber"," * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p>"," *"," * <p>This event can also be listened for using node.delegate().</p>"," *"," * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,"," * however if you want to pass the context and arguments as additional signature arguments to on/delegate,"," * you need to provide a null value for the configuration object, e.g: <code>node.on(\"gesturemoveend\", fn, null, context, arg1, arg2, arg3)</code></p>"," *"," *"," * @event gesturemoveend"," * @for YUI"," * @param type {string} \"gesturemoveend\""," * @param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event (mouseup or touchend.changedTouches[0])."," * @param cfg {Object} Optional. An object which specifies:"," * <dl>"," * <dt>standAlone (defaults to false)</dt>"," * <dd>true, if the subscriber should be notified even if a \"gesturemovestart\" or \"gesturemove\" has not occured on the same node.</dd>"," * <dt>root (defaults to document)</dt>"," * <dd>The node to which the internal DOM listeners should be attached.</dd>"," * <dt>preventDefault (defaults to false)</dt>"," * <dd>Can be set to true/false to prevent default behavior as soon as the touchend or mouseup is received. As with gesturemovestart, can also be set to function which returns true/false based on the event facade passed to it.</dd>"," * </dl>"," *"," * @return {EventHandle} the detach handle"," */","define(GESTURE_MOVE_END, {",""," on : function (node, subscriber, ce) {"," _setTouchActions(node);"," var root = _getRoot(node, subscriber),",""," endHandle = root.on(EVENT[END],"," this._onEnd,"," this,"," node,"," subscriber,"," ce);",""," subscriber[_MOVE_END_HANDLE] = endHandle;"," },",""," delegate : function(node, subscriber, ce, filter) {",""," var se = this;",""," subscriber[_DEL_MOVE_END_HANDLE] = node.delegate(EVENT[END],"," function(e) {"," se._onEnd(e, node, subscriber, ce, true);"," },"," filter);"," },",""," detachDelegate : function(node, subscriber, ce, filter) {"," var handle = subscriber[_DEL_MOVE_END_HANDLE];",""," if (handle) {"," handle.detach();"," subscriber[_DEL_MOVE_END_HANDLE] = null;"," }",""," _unsetTouchActions(node);",""," },",""," detach : function (node, subscriber, ce) {"," var endHandle = subscriber[_MOVE_END_HANDLE];",""," if (endHandle) {"," endHandle.detach();"," subscriber[_MOVE_END_HANDLE] = null;"," }",""," _unsetTouchActions(node);"," },",""," processArgs : function(args, delegate) {"," return _defArgsProcessor(this, args, delegate);"," },",""," _onEnd : function(e, node, subscriber, ce, delegate) {",""," if (delegate) {"," node = e[CURRENT_TARGET];"," }",""," var fireMoveEnd = subscriber._extra.standAlone || node.getData(_MOVE) || node.getData(_MOVE_START),"," preventDefault = subscriber._extra.preventDefault;",""," if (fireMoveEnd) {",""," if (e.changedTouches) {"," if (e.changedTouches.length === 1) {"," _normTouchFacade(e, e.changedTouches[0]);"," } else {"," fireMoveEnd = false;"," }"," }",""," if (fireMoveEnd) {",""," _prevent(e, preventDefault);",""," e.type = GESTURE_MOVE_END;"," ce.fire(e);",""," node.clearData(_MOVE_START);"," node.clearData(_MOVE);"," }"," }"," },",""," PREVENT_DEFAULT : false","});","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-touch\", \"event-synthetic\"]});"];+_yuitest_coverage["build/event-move/event-move.js"].lines = {"1":0,"27":0,"67":0,"70":0,"71":0,"74":0,"78":0,"83":0,"84":0,"85":0,"88":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"102":0,"111":0,"115":0,"116":0,"117":0,"118":0,"120":0,"121":0,"122":0,"130":0,"134":0,"135":0,"136":0,"137":0,"138":0,"144":0,"146":0,"147":0,"153":0,"186":0,"191":0,"193":0,"203":0,"205":0,"207":0,"213":0,"215":0,"216":0,"217":0,"220":0,"224":0,"226":0,"227":0,"228":0,"231":0,"235":0,"237":0,"238":0,"241":0,"242":0,"245":0,"250":0,"251":0,"254":0,"263":0,"264":0,"265":0,"267":0,"270":0,"274":0,"276":0,"278":0,"279":0,"283":0,"285":0,"288":0,"290":0,"291":0,"295":0,"298":0,"299":0,"300":0,"309":0,"310":0,"311":0,"313":0,"314":0,"315":0,"317":0,"318":0,"319":0,"325":0,"326":0,"329":0,"332":0,"333":0,"374":0,"378":0,"379":0,"388":0,"394":0,"396":0,"398":0,"404":0,"406":0,"407":0,"408":0,"411":0,"415":0,"417":0,"418":0,"419":0,"422":0,"427":0,"432":0,"433":0,"436":0,"440":0,"442":0,"443":0,"444":0,"446":0,"450":0,"452":0,"455":0,"456":0,"498":0,"501":0,"502":0,"511":0,"516":0,"518":0,"520":0,"526":0,"528":0,"529":0,"530":0,"533":0,"538":0,"540":0,"541":0,"542":0,"545":0,"549":0,"554":0,"555":0,"558":0,"561":0,"563":0,"564":0,"565":0,"567":0,"571":0,"573":0,"575":0,"576":0,"578":0,"579":0};+_yuitest_coverage["build/event-move/event-move.js"].functions = {"_defArgsProcessor:66":0,"_getRoot:77":0,"_checkDocumentElem:82":0,"_normTouchFacade:92":0,"_setTouchActions:110":0,"_unsetTouchActions:129":0,"_prevent:143":0,"on:188":0,"(anonymous 2):206":0,"delegate:201":0,"detachDelegate:212":0,"detach:223":0,"processArgs:234":0,"(anonymous 3):290":0,"(anonymous 4):298":0,"_onStart:248":0,"_cancel:308":0,"_start:323":0,"on:376":0,"(anonymous 5):397":0,"delegate:392":0,"detach:403":0,"detachDelegate:414":0,"processArgs:426":0,"_onMove:430":0,"on:500":0,"(anonymous 6):519":0,"delegate:514":0,"detachDelegate:525":0,"detach:537":0,"processArgs:548":0,"_onEnd:552":0,"(anonymous 1):1":0};+_yuitest_coverage["build/event-move/event-move.js"].coveredLines = 157;+_yuitest_coverage["build/event-move/event-move.js"].coveredFunctions = 33; _yuitest_coverline("build/event-move/event-move.js", 1); YUI.add('event-move', function (Y, NAME) { @@ -45,12 +45,27 @@ * interactions which work across touch and mouse input devices. They correspond to "touchstart", "touchmove" and "touchend" on a touch input * device, and "mousedown", "mousemove", "mouseup" on a mouse based input device. *+ * <p>Documentation for the gesturemove triplet of events can be found on the <a href="../classes/YUI.html#event_gesturemove">YUI</a> global,+ * along with the other supported events.</p>++ @example++ YUI().use('event-move', function (Y) {+ Y.one('#myNode').on('gesturemovestart', function (e) {+ });+ Y.one('#myNode').on('gesturemove', function (e) {+ });+ Y.one('#myNode').on('gesturemoveend', function (e) {+ });+ });+ * @module event-gestures * @submodule event-move */ + _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 1)", 1);-_yuitest_coverline("build/event-move/event-move.js", 12);+_yuitest_coverline("build/event-move/event-move.js", 27); var GESTURE_MAP = Y.Event._GESTURE_MAP, EVENT = { start: GESTURE_MAP.start,@@ -86,75 +101,150 @@ TARGET = "target", NODE_TYPE = "nodeType",+ SUPPORTS_POINTER = Y.config.win && ("msPointerEnabled" in Y.config.win.navigator),+ MS_TOUCH_ACTION_COUNT = 'msTouchActionCount',+ MS_INIT_TOUCH_ACTION = 'msInitTouchAction', _defArgsProcessor = function(se, args, delegate) {- _yuitest_coverfunc("build/event-move/event-move.js", "_defArgsProcessor", 48);-_yuitest_coverline("build/event-move/event-move.js", 49);-var iConfig = (delegate) ? 4 : 3, + _yuitest_coverfunc("build/event-move/event-move.js", "_defArgsProcessor", 66);+_yuitest_coverline("build/event-move/event-move.js", 67);+var iConfig = (delegate) ? 4 : 3, config = (args.length > iConfig) ? Y.merge(args.splice(iConfig,1)[0]) : {}; - _yuitest_coverline("build/event-move/event-move.js", 52);+ _yuitest_coverline("build/event-move/event-move.js", 70); if (!(PREVENT_DEFAULT in config)) {- _yuitest_coverline("build/event-move/event-move.js", 53);+ _yuitest_coverline("build/event-move/event-move.js", 71); config[PREVENT_DEFAULT] = se.PREVENT_DEFAULT; } - _yuitest_coverline("build/event-move/event-move.js", 56);+ _yuitest_coverline("build/event-move/event-move.js", 74); return config; }, _getRoot = function(node, subscriber) {- _yuitest_coverfunc("build/event-move/event-move.js", "_getRoot", 59);-_yuitest_coverline("build/event-move/event-move.js", 60);+ _yuitest_coverfunc("build/event-move/event-move.js", "_getRoot", 77);+_yuitest_coverline("build/event-move/event-move.js", 78); return subscriber._extra.root || (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT); }, + //Checks to see if the node is the document, and if it is, returns the documentElement.+ _checkDocumentElem = function(node) {+ _yuitest_coverfunc("build/event-move/event-move.js", "_checkDocumentElem", 82);+_yuitest_coverline("build/event-move/event-move.js", 83);+var elem = node.getDOMNode();+ _yuitest_coverline("build/event-move/event-move.js", 84);+if (node.compareTo(Y.config.doc) && elem.documentElement) {+ _yuitest_coverline("build/event-move/event-move.js", 85);+return elem.documentElement;+ }+ else {+ _yuitest_coverline("build/event-move/event-move.js", 88);+return false;+ }+ },+ _normTouchFacade = function(touchFacade, touch, params) {- _yuitest_coverfunc("build/event-move/event-move.js", "_normTouchFacade", 63);-_yuitest_coverline("build/event-move/event-move.js", 64);+ _yuitest_coverfunc("build/event-move/event-move.js", "_normTouchFacade", 92);+_yuitest_coverline("build/event-move/event-move.js", 93); touchFacade.pageX = touch.pageX;- _yuitest_coverline("build/event-move/event-move.js", 65);+ _yuitest_coverline("build/event-move/event-move.js", 94); touchFacade.pageY = touch.pageY;- _yuitest_coverline("build/event-move/event-move.js", 66);+ _yuitest_coverline("build/event-move/event-move.js", 95); touchFacade.screenX = touch.screenX;- _yuitest_coverline("build/event-move/event-move.js", 67);+ _yuitest_coverline("build/event-move/event-move.js", 96); touchFacade.screenY = touch.screenY;- _yuitest_coverline("build/event-move/event-move.js", 68);+ _yuitest_coverline("build/event-move/event-move.js", 97); touchFacade.clientX = touch.clientX;- _yuitest_coverline("build/event-move/event-move.js", 69);+ _yuitest_coverline("build/event-move/event-move.js", 98); touchFacade.clientY = touch.clientY;- _yuitest_coverline("build/event-move/event-move.js", 70);+ _yuitest_coverline("build/event-move/event-move.js", 99); touchFacade[TARGET] = touchFacade[TARGET] || touch[TARGET];- _yuitest_coverline("build/event-move/event-move.js", 71);+ _yuitest_coverline("build/event-move/event-move.js", 100); touchFacade[CURRENT_TARGET] = touchFacade[CURRENT_TARGET] || touch[CURRENT_TARGET]; - _yuitest_coverline("build/event-move/event-move.js", 73);+ _yuitest_coverline("build/event-move/event-move.js", 102); touchFacade[BUTTON] = (params && params[BUTTON]) || 1; // default to left (left as per vendors, not W3C which is 0) }, + /*+ In IE10 touch mode, gestures will not work properly unless the -ms-touch-action CSS property is set to something other than 'auto'. Read http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx for more info. To get around this, we set -ms-touch-action: none which is the same as e.preventDefault() on touch environments. This tells the browser to fire DOM events for all touch events, and not perform any default behavior.++ The user can over-ride this by setting a more lenient -ms-touch-action property on a node (such as pan-x, pan-y, etc.) via CSS when subscribing to the 'gesturemovestart' event.+ */+ _setTouchActions = function (node) {+ _yuitest_coverfunc("build/event-move/event-move.js", "_setTouchActions", 110);+_yuitest_coverline("build/event-move/event-move.js", 111);+var elem = _checkDocumentElem(node) || node.getDOMNode(),+ num = node.getData(MS_TOUCH_ACTION_COUNT);++ //Checks to see if msTouchAction is supported.+ _yuitest_coverline("build/event-move/event-move.js", 115);+if (SUPPORTS_POINTER) {+ _yuitest_coverline("build/event-move/event-move.js", 116);+if (!num) {+ _yuitest_coverline("build/event-move/event-move.js", 117);+num = 0;+ _yuitest_coverline("build/event-move/event-move.js", 118);+node.setData(MS_INIT_TOUCH_ACTION, elem.style.msTouchAction);+ }+ _yuitest_coverline("build/event-move/event-move.js", 120);+elem.style.msTouchAction = Y.Event._DEFAULT_TOUCH_ACTION;+ _yuitest_coverline("build/event-move/event-move.js", 121);+num++;+ _yuitest_coverline("build/event-move/event-move.js", 122);+node.setData(MS_TOUCH_ACTION_COUNT, num);+ }+ },++ /*+ Resets the element's -ms-touch-action property back to the original value, This is called on detach() and detachDelegate().+ */+ _unsetTouchActions = function (node) {+ _yuitest_coverfunc("build/event-move/event-move.js", "_unsetTouchActions", 129);+_yuitest_coverline("build/event-move/event-move.js", 130);+var elem = _checkDocumentElem(node) || node.getDOMNode(),+ num = node.getData(MS_TOUCH_ACTION_COUNT),+ initTouchAction = node.getData(MS_INIT_TOUCH_ACTION);++ _yuitest_coverline("build/event-move/event-move.js", 134);+if (SUPPORTS_POINTER) {+ _yuitest_coverline("build/event-move/event-move.js", 135);+num--;+ _yuitest_coverline("build/event-move/event-move.js", 136);+node.setData(MS_TOUCH_ACTION_COUNT, num);+ _yuitest_coverline("build/event-move/event-move.js", 137);+if (num === 0 && elem.style.msTouchAction !== initTouchAction) {+ _yuitest_coverline("build/event-move/event-move.js", 138);+elem.style.msTouchAction = initTouchAction;+ }+ }+ },+ _prevent = function(e, preventDefault) {- _yuitest_coverfunc("build/event-move/event-move.js", "_prevent", 76);-_yuitest_coverline("build/event-move/event-move.js", 77);+ _yuitest_coverfunc("build/event-move/event-move.js", "_prevent", 143);+_yuitest_coverline("build/event-move/event-move.js", 144); if (preventDefault) { // preventDefault is a boolean or a function- _yuitest_coverline("build/event-move/event-move.js", 79);+ _yuitest_coverline("build/event-move/event-move.js", 146); if (!preventDefault.call || preventDefault(e)) {- _yuitest_coverline("build/event-move/event-move.js", 80);+ _yuitest_coverline("build/event-move/event-move.js", 147); e.preventDefault(); } } }, define = Y.Event.define;+ _yuitest_coverline("build/event-move/event-move.js", 153);+Y.Event._DEFAULT_TOUCH_ACTION = 'none'; /** * Sets up a "gesturemovestart" event, that is fired on touch devices in response to a single finger "touchstart", * and on mouse based devices in response to a "mousedown". The subscriber can specify the minimum time * and distance thresholds which should be crossed before the "gesturemovestart" is fired and for the mouse, * which button should initiate a "gesturemovestart". This event can also be listened for using node.delegate().- * + * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemovestart", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemovestart@@ -171,21 +261,25 @@ * <dt>button (no default)</dt> * <dd>In the case of a mouse input device, if the event should only be fired for a specific mouse button.</dd> * <dt>preventDefault (defaults to false)</dt>- * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be + * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it (for example, DragDrop can determine if the target is a valid handle or not before preventing default).</dd> * </dl> * * @return {EventHandle} the detach handle */ -_yuitest_coverline("build/event-move/event-move.js", 118);+_yuitest_coverline("build/event-move/event-move.js", 186); define(GESTURE_MOVE_START, { on: function (node, subscriber, ce) { - _yuitest_coverfunc("build/event-move/event-move.js", "on", 120);-_yuitest_coverline("build/event-move/event-move.js", 122);-subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], + //Set -ms-touch-action on IE10 and set preventDefault to true+ _yuitest_coverfunc("build/event-move/event-move.js", "on", 188);+_yuitest_coverline("build/event-move/event-move.js", 191);+_setTouchActions(node);++ _yuitest_coverline("build/event-move/event-move.js", 193);+subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], this._onStart, this, node,@@ -195,79 +289,85 @@ delegate : function(node, subscriber, ce, filter) { - _yuitest_coverfunc("build/event-move/event-move.js", "delegate", 130);-_yuitest_coverline("build/event-move/event-move.js", 132);+ _yuitest_coverfunc("build/event-move/event-move.js", "delegate", 201);+_yuitest_coverline("build/event-move/event-move.js", 203); var se = this; - _yuitest_coverline("build/event-move/event-move.js", 134);+ _yuitest_coverline("build/event-move/event-move.js", 205); subscriber[_DEL_MOVE_START_HANDLE] = node.delegate(EVENT[START], function(e) {- _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 2)", 135);-_yuitest_coverline("build/event-move/event-move.js", 136);+ _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 2)", 206);+_yuitest_coverline("build/event-move/event-move.js", 207); se._onStart(e, node, subscriber, ce, true); }, filter); }, detachDelegate : function(node, subscriber, ce, filter) {- _yuitest_coverfunc("build/event-move/event-move.js", "detachDelegate", 141);-_yuitest_coverline("build/event-move/event-move.js", 142);+ _yuitest_coverfunc("build/event-move/event-move.js", "detachDelegate", 212);+_yuitest_coverline("build/event-move/event-move.js", 213); var handle = subscriber[_DEL_MOVE_START_HANDLE]; - _yuitest_coverline("build/event-move/event-move.js", 144);+ _yuitest_coverline("build/event-move/event-move.js", 215); if (handle) {- _yuitest_coverline("build/event-move/event-move.js", 145);+ _yuitest_coverline("build/event-move/event-move.js", 216); handle.detach();- _yuitest_coverline("build/event-move/event-move.js", 146);+ _yuitest_coverline("build/event-move/event-move.js", 217); subscriber[_DEL_MOVE_START_HANDLE] = null; }++ _yuitest_coverline("build/event-move/event-move.js", 220);+_unsetTouchActions(node); }, detach: function (node, subscriber, ce) {- _yuitest_coverfunc("build/event-move/event-move.js", "detach", 150);-_yuitest_coverline("build/event-move/event-move.js", 151);+ _yuitest_coverfunc("build/event-move/event-move.js", "detach", 223);+_yuitest_coverline("build/event-move/event-move.js", 224); var startHandle = subscriber[_MOVE_START_HANDLE]; - _yuitest_coverline("build/event-move/event-move.js", 153);+ _yuitest_coverline("build/event-move/event-move.js", 226); if (startHandle) {- _yuitest_coverline("build/event-move/event-move.js", 154);+ _yuitest_coverline("build/event-move/event-move.js", 227); startHandle.detach();- _yuitest_coverline("build/event-move/event-move.js", 155);+ _yuitest_coverline("build/event-move/event-move.js", 228); subscriber[_MOVE_START_HANDLE] = null; }++ _yuitest_coverline("build/event-move/event-move.js", 231);+_unsetTouchActions(node); }, processArgs : function(args, delegate) {- _yuitest_coverfunc("build/event-move/event-move.js", "processArgs", 159);-_yuitest_coverline("build/event-move/event-move.js", 160);+ _yuitest_coverfunc("build/event-move/event-move.js", "processArgs", 234);+_yuitest_coverline("build/event-move/event-move.js", 235); var params = _defArgsProcessor(this, args, delegate); - _yuitest_coverline("build/event-move/event-move.js", 162);+ _yuitest_coverline("build/event-move/event-move.js", 237); if (!(MIN_TIME in params)) {- _yuitest_coverline("build/event-move/event-move.js", 163);+ _yuitest_coverline("build/event-move/event-move.js", 238); params[MIN_TIME] = this.MIN_TIME; } - _yuitest_coverline("build/event-move/event-move.js", 166);+ _yuitest_coverline("build/event-move/event-move.js", 241); if (!(MIN_DISTANCE in params)) {- _yuitest_coverline("build/event-move/event-move.js", 167);+ _yuitest_coverline("build/event-move/event-move.js", 242); params[MIN_DISTANCE] = this.MIN_DISTANCE; } - _yuitest_coverline("build/event-move/event-move.js", 170);+ _yuitest_coverline("build/event-move/event-move.js", 245); return params; }, _onStart : function(e, node, subscriber, ce, delegate) { - _yuitest_coverfunc("build/event-move/event-move.js", "_onStart", 173);-_yuitest_coverline("build/event-move/event-move.js", 175);+ _yuitest_coverfunc("build/event-move/event-move.js", "_onStart", 248);+_yuitest_coverline("build/event-move/event-move.js", 250); if (delegate) {- _yuitest_coverline("build/event-move/event-move.js", 176);+ _yuitest_coverline("build/event-move/event-move.js", 251); node = e[CURRENT_TARGET]; } - _yuitest_coverline("build/event-move/event-move.js", 179);+ _yuitest_coverline("build/event-move/event-move.js", 254); var params = subscriber._extra, fireStart = true, minTime = params[MIN_TIME],@@ -277,112 +377,112 @@ root = _getRoot(node, subscriber), startXY; - _yuitest_coverline("build/event-move/event-move.js", 188);+ _yuitest_coverline("build/event-move/event-move.js", 263); if (e.touches) {- _yuitest_coverline("build/event-move/event-move.js", 189);+ _yuitest_coverline("build/event-move/event-move.js", 264); if (e.touches.length === 1) {- _yuitest_coverline("build/event-move/event-move.js", 190);+ _yuitest_coverline("build/event-move/event-move.js", 265); _normTouchFacade(e, e.touches[0], params); } else {- _yuitest_coverline("build/event-move/event-move.js", 192);+ _yuitest_coverline("build/event-move/event-move.js", 267); fireStart = false; } } else {- _yuitest_coverline("build/event-move/event-move.js", 195);+ _yuitest_coverline("build/event-move/event-move.js", 270); fireStart = (button === undefined) || (button === e.button); } - _yuitest_coverline("build/event-move/event-move.js", 199);+ _yuitest_coverline("build/event-move/event-move.js", 274); if (fireStart) { - _yuitest_coverline("build/event-move/event-move.js", 201);+ _yuitest_coverline("build/event-move/event-move.js", 276); _prevent(e, preventDefault); - _yuitest_coverline("build/event-move/event-move.js", 203);+ _yuitest_coverline("build/event-move/event-move.js", 278); if (minTime === 0 || minDistance === 0) {- _yuitest_coverline("build/event-move/event-move.js", 204);+ _yuitest_coverline("build/event-move/event-move.js", 279); this._start(e, node, ce, params); } else { - _yuitest_coverline("build/event-move/event-move.js", 208);+ _yuitest_coverline("build/event-move/event-move.js", 283); startXY = [e.pageX, e.pageY]; - _yuitest_coverline("build/event-move/event-move.js", 210);+ _yuitest_coverline("build/event-move/event-move.js", 285); if (minTime > 0) { - _yuitest_coverline("build/event-move/event-move.js", 213);+ _yuitest_coverline("build/event-move/event-move.js", 288); params._ht = Y.later(minTime, this, this._start, [e, node, ce, params]); - _yuitest_coverline("build/event-move/event-move.js", 215);+ _yuitest_coverline("build/event-move/event-move.js", 290); params._hme = root.on(EVENT[END], Y.bind(function() {- _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 3)", 215);-_yuitest_coverline("build/event-move/event-move.js", 216);+ _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 3)", 290);+_yuitest_coverline("build/event-move/event-move.js", 291); this._cancel(params); }, this)); } - _yuitest_coverline("build/event-move/event-move.js", 220);+ _yuitest_coverline("build/event-move/event-move.js", 295); if (minDistance > 0) { - _yuitest_coverline("build/event-move/event-move.js", 223);+ _yuitest_coverline("build/event-move/event-move.js", 298); params._hm = root.on(EVENT[MOVE], Y.bind(function(em) {- _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 4)", 223);-_yuitest_coverline("build/event-move/event-move.js", 224);+ _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 4)", 298);+_yuitest_coverline("build/event-move/event-move.js", 299); if (Math.abs(em.pageX - startXY[0]) > minDistance || Math.abs(em.pageY - startXY[1]) > minDistance) {- _yuitest_coverline("build/event-move/event-move.js", 225);+ _yuitest_coverline("build/event-move/event-move.js", 300); this._start(e, node, ce, params); } }, this));- } + } } } }, _cancel : function(params) {- _yuitest_coverfunc("build/event-move/event-move.js", "_cancel", 233);-_yuitest_coverline("build/event-move/event-move.js", 234);+ _yuitest_coverfunc("build/event-move/event-move.js", "_cancel", 308);+_yuitest_coverline("build/event-move/event-move.js", 309); if (params._ht) {- _yuitest_coverline("build/event-move/event-move.js", 235);+ _yuitest_coverline("build/event-move/event-move.js", 310); params._ht.cancel();- _yuitest_coverline("build/event-move/event-move.js", 236);+ _yuitest_coverline("build/event-move/event-move.js", 311); params._ht = null; }- _yuitest_coverline("build/event-move/event-move.js", 238);+ _yuitest_coverline("build/event-move/event-move.js", 313); if (params._hme) {- _yuitest_coverline("build/event-move/event-move.js", 239);+ _yuitest_coverline("build/event-move/event-move.js", 314); params._hme.detach();- _yuitest_coverline("build/event-move/event-move.js", 240);+ _yuitest_coverline("build/event-move/event-move.js", 315); params._hme = null; }- _yuitest_coverline("build/event-move/event-move.js", 242);+ _yuitest_coverline("build/event-move/event-move.js", 317); if (params._hm) {- _yuitest_coverline("build/event-move/event-move.js", 243);+ _yuitest_coverline("build/event-move/event-move.js", 318); params._hm.detach();- _yuitest_coverline("build/event-move/event-move.js", 244);+ _yuitest_coverline("build/event-move/event-move.js", 319); params._hm = null; } }, _start : function(e, node, ce, params) { - _yuitest_coverfunc("build/event-move/event-move.js", "_start", 248);-_yuitest_coverline("build/event-move/event-move.js", 250);+ _yuitest_coverfunc("build/event-move/event-move.js", "_start", 323);+_yuitest_coverline("build/event-move/event-move.js", 325); if (params) {- _yuitest_coverline("build/event-move/event-move.js", 251);+ _yuitest_coverline("build/event-move/event-move.js", 326); this._cancel(params); } - _yuitest_coverline("build/event-move/event-move.js", 254);+ _yuitest_coverline("build/event-move/event-move.js", 329); e.type = GESTURE_MOVE_START; - _yuitest_coverline("build/event-move/event-move.js", 257);+ _yuitest_coverline("build/event-move/event-move.js", 332); node.setData(_MOVE_START, e);- _yuitest_coverline("build/event-move/event-move.js", 258);+ _yuitest_coverline("build/event-move/event-move.js", 333); ce.fire(e); }, @@ -394,18 +494,18 @@ /** * Sets up a "gesturemove" event, that is fired on touch devices in response to a single finger "touchmove", * and on mouse based devices in response to a "mousemove".- * + * * <p>By default this event is only fired when the same node * has received a "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without an initial "gesturemovestart".</p>- * + * * <p>By default this event sets up it's internal "touchmove" and "mousemove" DOM listeners on the document element. The subscriber- * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> + * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemove", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemove@@ -424,139 +524,148 @@ * * @return {EventHandle} the detach handle */-_yuitest_coverline("build/event-move/event-move.js", 299);+_yuitest_coverline("build/event-move/event-move.js", 374); define(GESTURE_MOVE, { on : function (node, subscriber, ce) { - _yuitest_coverfunc("build/event-move/event-move.js", "on", 301);-_yuitest_coverline("build/event-move/event-move.js", 303);-var root = _getRoot(node, subscriber),+ _yuitest_coverfunc("build/event-move/event-move.js", "on", 376);+_yuitest_coverline("build/event-move/event-move.js", 378);+_setTouchActions(node);+ _yuitest_coverline("build/event-move/event-move.js", 379);+var root = _getRoot(node, subscriber, EVENT[MOVE]), - moveHandle = root.on(EVENT[MOVE], + moveHandle = root.on(EVENT[MOVE], this._onMove, this, node, subscriber, ce); - _yuitest_coverline("build/event-move/event-move.js", 312);+ _yuitest_coverline("build/event-move/event-move.js", 388); subscriber[_MOVE_HANDLE] = moveHandle;+ }, delegate : function(node, subscriber, ce, filter) { - _yuitest_coverfunc("build/event-move/event-move.js", "delegate", 315);-_yuitest_coverline("build/event-move/event-move.js", 317);+ _yuitest_coverfunc("build/event-move/event-move.js", "delegate", 392);+_yuitest_coverline("build/event-move/event-move.js", 394); var se = this; - _yuitest_coverline("build/event-move/event-move.js", 319);+ _yuitest_coverline("build/event-move/event-move.js", 396); subscriber[_DEL_MOVE_HANDLE] = node.delegate(EVENT[MOVE], function(e) {- _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 5)", 320);-_yuitest_coverline("build/event-move/event-move.js", 321);+ _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 5)", 397);+_yuitest_coverline("build/event-move/event-move.js", 398); se._onMove(e, node, subscriber, ce, true); }, filter); }, detach : function (node, subscriber, ce) {- _yuitest_coverfunc("build/event-move/event-move.js", "detach", 326);-_yuitest_coverline("build/event-move/event-move.js", 327);+ _yuitest_coverfunc("build/event-move/event-move.js", "detach", 403);+_yuitest_coverline("build/event-move/event-move.js", 404); var moveHandle = subscriber[_MOVE_HANDLE]; - _yuitest_coverline("build/event-move/event-move.js", 329);+ _yuitest_coverline("build/event-move/event-move.js", 406); if (moveHandle) {- _yuitest_coverline("build/event-move/event-move.js", 330);+ _yuitest_coverline("build/event-move/event-move.js", 407); moveHandle.detach();- _yuitest_coverline("build/event-move/event-move.js", 331);+ _yuitest_coverline("build/event-move/event-move.js", 408); subscriber[_MOVE_HANDLE] = null; }++ _yuitest_coverline("build/event-move/event-move.js", 411);+_unsetTouchActions(node); },- + detachDelegate : function(node, subscriber, ce, filter) {- _yuitest_coverfunc("build/event-move/event-move.js", "detachDelegate", 335);-_yuitest_coverline("build/event-move/event-move.js", 336);+ _yuitest_coverfunc("build/event-move/event-move.js", "detachDelegate", 414);+_yuitest_coverline("build/event-move/event-move.js", 415); var handle = subscriber[_DEL_MOVE_HANDLE]; - _yuitest_coverline("build/event-move/event-move.js", 338);+ _yuitest_coverline("build/event-move/event-move.js", 417); if (handle) {- _yuitest_coverline("build/event-move/event-move.js", 339);+ _yuitest_coverline("build/event-move/event-move.js", 418); handle.detach();- _yuitest_coverline("build/event-move/event-move.js", 340);+ _yuitest_coverline("build/event-move/event-move.js", 419); subscriber[_DEL_MOVE_HANDLE] = null; } + _yuitest_coverline("build/event-move/event-move.js", 422);+_unsetTouchActions(node);+ }, processArgs : function(args, delegate) {- _yuitest_coverfunc("build/event-move/event-move.js", "processArgs", 345);-_yuitest_coverline("build/event-move/event-move.js", 346);+ _yuitest_coverfunc("build/event-move/event-move.js", "processArgs", 426);+_yuitest_coverline("build/event-move/event-move.js", 427); return _defArgsProcessor(this, args, delegate); }, _onMove : function(e, node, subscriber, ce, delegate) { - _yuitest_coverfunc("build/event-move/event-move.js", "_onMove", 349);-_yuitest_coverline("build/event-move/event-move.js", 351);+ _yuitest_coverfunc("build/event-move/event-move.js", "_onMove", 430);+_yuitest_coverline("build/event-move/event-move.js", 432); if (delegate) {- _yuitest_coverline("build/event-move/event-move.js", 352);+ _yuitest_coverline("build/event-move/event-move.js", 433); node = e[CURRENT_TARGET]; } - _yuitest_coverline("build/event-move/event-move.js", 355);+ _yuitest_coverline("build/event-move/event-move.js", 436); var fireMove = subscriber._extra.standAlone || node.getData(_MOVE_START), preventDefault = subscriber._extra.preventDefault; - _yuitest_coverline("build/event-move/event-move.js", 359);+ _yuitest_coverline("build/event-move/event-move.js", 440); if (fireMove) { - _yuitest_coverline("build/event-move/event-move.js", 361);+ _yuitest_coverline("build/event-move/event-move.js", 442); if (e.touches) {- _yuitest_coverline("build/event-move/event-move.js", 362);+ _yuitest_coverline("build/event-move/event-move.js", 443); if (e.touches.length === 1) {- _yuitest_coverline("build/event-move/event-move.js", 363);-_normTouchFacade(e, e.touches[0]); + _yuitest_coverline("build/event-move/event-move.js", 444);+_normTouchFacade(e, e.touches[0]); } else {- _yuitest_coverline("build/event-move/event-move.js", 365);+ _yuitest_coverline("build/event-move/event-move.js", 446); fireMove = false; } } - _yuitest_coverline("build/event-move/event-move.js", 369);+ _yuitest_coverline("build/event-move/event-move.js", 450); if (fireMove) { - _yuitest_coverline("build/event-move/event-move.js", 371);+ _yuitest_coverline("build/event-move/event-move.js", 452); _prevent(e, preventDefault); - _yuitest_coverline("build/event-move/event-move.js", 374);+ _yuitest_coverline("build/event-move/event-move.js", 455); e.type = GESTURE_MOVE;- _yuitest_coverline("build/event-move/event-move.js", 375);+ _yuitest_coverline("build/event-move/event-move.js", 456); ce.fire(e); } } },- + PREVENT_DEFAULT : false }); /** * Sets up a "gesturemoveend" event, that is fired on touch devices in response to a single finger "touchend", * and on mouse based devices in response to a "mouseup".- * + * * <p>By default this event is only fired when the same node * has received a "gesturemove" or "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without a preceding "gesturemovestart" or "gesturemove".</p> * * <p>By default this event sets up it's internal "touchend" and "mouseup" DOM listeners on the document element. The subscriber- * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> + * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemoveend", fn, null, context, arg1, arg2, arg3)</code></p> * *@@ -576,119 +685,126 @@ * * @return {EventHandle} the detach handle */-_yuitest_coverline("build/event-move/event-move.js", 417);+_yuitest_coverline("build/event-move/event-move.js", 498); define(GESTURE_MOVE_END, { on : function (node, subscriber, ce) {-- _yuitest_coverfunc("build/event-move/event-move.js", "on", 419);-_yuitest_coverline("build/event-move/event-move.js", 421);+ _yuitest_coverfunc("build/event-move/event-move.js", "on", 500);+_yuitest_coverline("build/event-move/event-move.js", 501);+_setTouchActions(node);+ _yuitest_coverline("build/event-move/event-move.js", 502); var root = _getRoot(node, subscriber), - endHandle = root.on(EVENT[END], - this._onEnd, + endHandle = root.on(EVENT[END],+ this._onEnd, this, node,- subscriber, + subscriber, ce); - _yuitest_coverline("build/event-move/event-move.js", 430);+ _yuitest_coverline("build/event-move/event-move.js", 511); subscriber[_MOVE_END_HANDLE] = endHandle; }, delegate : function(node, subscriber, ce, filter) { - _yuitest_coverfunc("build/event-move/event-move.js", "delegate", 433);-_yuitest_coverline("build/event-move/event-move.js", 435);+ _yuitest_coverfunc("build/event-move/event-move.js", "delegate", 514);+_yuitest_coverline("build/event-move/event-move.js", 516); var se = this; - _yuitest_coverline("build/event-move/event-move.js", 437);+ _yuitest_coverline("build/event-move/event-move.js", 518); subscriber[_DEL_MOVE_END_HANDLE] = node.delegate(EVENT[END], function(e) {- _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 6)", 438);-_yuitest_coverline("build/event-move/event-move.js", 439);+ _yuitest_coverfunc("build/event-move/event-move.js", "(anonymous 6)", 519);+_yuitest_coverline("build/event-move/event-move.js", 520); se._onEnd(e, node, subscriber, ce, true); }, filter); }, detachDelegate : function(node, subscriber, ce, filter) {- _yuitest_coverfunc("build/event-move/event-move.js", "detachDelegate", 444);-_yuitest_coverline("build/event-move/event-move.js", 445);+ _yuitest_coverfunc("build/event-move/event-move.js", "detachDelegate", 525);+_yuitest_coverline("build/event-move/event-move.js", 526); var handle = subscriber[_DEL_MOVE_END_HANDLE]; - _yuitest_coverline("build/event-move/event-move.js", 447);+ _yuitest_coverline("build/event-move/event-move.js", 528); if (handle) {- _yuitest_coverline("build/event-move/event-move.js", 448);+ _yuitest_coverline("build/event-move/event-move.js", 529); handle.detach();- _yuitest_coverline("build/event-move/event-move.js", 449);+ _yuitest_coverline("build/event-move/event-move.js", 530); subscriber[_DEL_MOVE_END_HANDLE] = null; } + _yuitest_coverline("build/event-move/event-move.js", 533);+_unsetTouchActions(node);+ }, detach : function (node, subscriber, ce) {- _yuitest_coverfunc("build/event-move/event-move.js", "detach", 454);-_yuitest_coverline("build/event-move/event-move.js", 455);+ _yuitest_coverfunc("build/event-move/event-move.js", "detach", 537);+_yuitest_coverline("build/event-move/event-move.js", 538); var endHandle = subscriber[_MOVE_END_HANDLE];- - _yuitest_coverline("build/event-move/event-move.js", 457);++ _yuitest_coverline("build/event-move/event-move.js", 540); if (endHandle) {- _yuitest_coverline("build/event-move/event-move.js", 458);+ _yuitest_coverline("build/event-move/event-move.js", 541); endHandle.detach();- _yuitest_coverline("build/event-move/event-move.js", 459);+ _yuitest_coverline("build/event-move/event-move.js", 542); subscriber[_MOVE_END_HANDLE] = null; }++ _yuitest_coverline("build/event-move/event-move.js", 545);+_unsetTouchActions(node); }, processArgs : function(args, delegate) {- _yuitest_coverfunc("build/event-move/event-move.js", "processArgs", 463);-_yuitest_coverline("build/event-move/event-move.js", 464);+ _yuitest_coverfunc("build/event-move/event-move.js", "processArgs", 548);+_yuitest_coverline("build/event-move/event-move.js", 549); return _defArgsProcessor(this, args, delegate); }, _onEnd : function(e, node, subscriber, ce, delegate) { - _yuitest_coverfunc("build/event-move/event-move.js", "_onEnd", 467);-_yuitest_coverline("build/event-move/event-move.js", 469);+ _yuitest_coverfunc("build/event-move/event-move.js", "_onEnd", 552);+_yuitest_coverline("build/event-move/event-move.js", 554); if (delegate) {- _yuitest_coverline("build/event-move/event-move.js", 470);+ _yuitest_coverline("build/event-move/event-move.js", 555); node = e[CURRENT_TARGET]; } - _yuitest_coverline("build/event-move/event-move.js", 473);+ _yuitest_coverline("build/event-move/event-move.js", 558); var fireMoveEnd = subscriber._extra.standAlone || node.getData(_MOVE) || node.getData(_MOVE_START), preventDefault = subscriber._extra.preventDefault; - _yuitest_coverline("build/event-move/event-move.js", 476);+ _yuitest_coverline("build/event-move/event-move.js", 561); if (fireMoveEnd) { - _yuitest_coverline("build/event-move/event-move.js", 478);+ _yuitest_coverline("build/event-move/event-move.js", 563); if (e.changedTouches) {- _yuitest_coverline("build/event-move/event-move.js", 479);+ _yuitest_coverline("build/event-move/event-move.js", 564); if (e.changedTouches.length === 1) {- _yuitest_coverline("build/event-move/event-move.js", 480);-_normTouchFacade(e, e.changedTouches[0]); + _yuitest_coverline("build/event-move/event-move.js", 565);+_normTouchFacade(e, e.changedTouches[0]); } else {- _yuitest_coverline("build/event-move/event-move.js", 482);+ _yuitest_coverline("build/event-move/event-move.js", 567); fireMoveEnd = false; } } - _yuitest_coverline("build/event-move/event-move.js", 486);+ _yuitest_coverline("build/event-move/event-move.js", 571); if (fireMoveEnd) { - _yuitest_coverline("build/event-move/event-move.js", 488);+ _yuitest_coverline("build/event-move/event-move.js", 573); _prevent(e, preventDefault); - _yuitest_coverline("build/event-move/event-move.js", 490);+ _yuitest_coverline("build/event-move/event-move.js", 575); e.type = GESTURE_MOVE_END;- _yuitest_coverline("build/event-move/event-move.js", 491);+ _yuitest_coverline("build/event-move/event-move.js", 576); ce.fire(e); - _yuitest_coverline("build/event-move/event-move.js", 493);+ _yuitest_coverline("build/event-move/event-move.js", 578); node.clearData(_MOVE_START);- _yuitest_coverline("build/event-move/event-move.js", 494);+ _yuitest_coverline("build/event-move/event-move.js", 579); node.clearData(_MOVE); } }@@ -697,4 +813,5 @@ PREVENT_DEFAULT : false }); -}, '3.7.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});++}, '3.7.3', {"requires": ["node-base", "event-touch", "event-synthetic"]});
bundle/event-move/event-move-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,10 +11,28 @@ * interactions which work across touch and mouse input devices. They correspond to "touchstart", "touchmove" and "touchend" on a touch input * device, and "mousedown", "mousemove", "mouseup" on a mouse based input device. *+ * <p>Documentation for the gesturemove triplet of events can be found on the <a href="../classes/YUI.html#event_gesturemove">YUI</a> global,+ * along with the other supported events.</p>++ @example++ YUI().use('event-move', function (Y) {+ Y.one('#myNode').on('gesturemovestart', function (e) {+ Y.log('gesturemovestart Fired.');+ });+ Y.one('#myNode').on('gesturemove', function (e) {+ Y.log('gesturemove Fired.');+ });+ Y.one('#myNode').on('gesturemoveend', function (e) {+ Y.log('gesturemoveend Fired.');+ });+ });+ * @module event-gestures * @submodule event-move */ + var GESTURE_MAP = Y.Event._GESTURE_MAP, EVENT = { start: GESTURE_MAP.start,@@ -50,9 +68,12 @@ TARGET = "target", NODE_TYPE = "nodeType",+ SUPPORTS_POINTER = Y.config.win && ("msPointerEnabled" in Y.config.win.navigator),+ MS_TOUCH_ACTION_COUNT = 'msTouchActionCount',+ MS_INIT_TOUCH_ACTION = 'msInitTouchAction', _defArgsProcessor = function(se, args, delegate) {- var iConfig = (delegate) ? 4 : 3, + var iConfig = (delegate) ? 4 : 3, config = (args.length > iConfig) ? Y.merge(args.splice(iConfig,1)[0]) : {}; if (!(PREVENT_DEFAULT in config)) {@@ -66,6 +87,17 @@ return subscriber._extra.root || (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT); }, + //Checks to see if the node is the document, and if it is, returns the documentElement.+ _checkDocumentElem = function(node) {+ var elem = node.getDOMNode();+ if (node.compareTo(Y.config.doc) && elem.documentElement) {+ return elem.documentElement;+ }+ else {+ return false;+ }+ },+ _normTouchFacade = function(touchFacade, touch, params) { touchFacade.pageX = touch.pageX; touchFacade.pageY = touch.pageY;@@ -79,6 +111,44 @@ touchFacade[BUTTON] = (params && params[BUTTON]) || 1; // default to left (left as per vendors, not W3C which is 0) }, + /*+ In IE10 touch mode, gestures will not work properly unless the -ms-touch-action CSS property is set to something other than 'auto'. Read http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx for more info. To get around this, we set -ms-touch-action: none which is the same as e.preventDefault() on touch environments. This tells the browser to fire DOM events for all touch events, and not perform any default behavior.++ The user can over-ride this by setting a more lenient -ms-touch-action property on a node (such as pan-x, pan-y, etc.) via CSS when subscribing to the 'gesturemovestart' event.+ */+ _setTouchActions = function (node) {+ var elem = _checkDocumentElem(node) || node.getDOMNode(),+ num = node.getData(MS_TOUCH_ACTION_COUNT);++ //Checks to see if msTouchAction is supported.+ if (SUPPORTS_POINTER) {+ if (!num) {+ num = 0;+ node.setData(MS_INIT_TOUCH_ACTION, elem.style.msTouchAction);+ }+ elem.style.msTouchAction = Y.Event._DEFAULT_TOUCH_ACTION;+ num++;+ node.setData(MS_TOUCH_ACTION_COUNT, num);+ }+ },++ /*+ Resets the element's -ms-touch-action property back to the original value, This is called on detach() and detachDelegate().+ */+ _unsetTouchActions = function (node) {+ var elem = _checkDocumentElem(node) || node.getDOMNode(),+ num = node.getData(MS_TOUCH_ACTION_COUNT),+ initTouchAction = node.getData(MS_INIT_TOUCH_ACTION);++ if (SUPPORTS_POINTER) {+ num--;+ node.setData(MS_TOUCH_ACTION_COUNT, num);+ if (num === 0 && elem.style.msTouchAction !== initTouchAction) {+ elem.style.msTouchAction = initTouchAction;+ }+ }+ },+ _prevent = function(e, preventDefault) { if (preventDefault) { // preventDefault is a boolean or a function@@ -89,15 +159,16 @@ }, define = Y.Event.define;+ Y.Event._DEFAULT_TOUCH_ACTION = 'none'; /** * Sets up a "gesturemovestart" event, that is fired on touch devices in response to a single finger "touchstart", * and on mouse based devices in response to a "mousedown". The subscriber can specify the minimum time * and distance thresholds which should be crossed before the "gesturemovestart" is fired and for the mouse, * which button should initiate a "gesturemovestart". This event can also be listened for using node.delegate().- * + * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemovestart", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemovestart@@ -114,7 +185,7 @@ * <dt>button (no default)</dt> * <dd>In the case of a mouse input device, if the event should only be fired for a specific mouse button.</dd> * <dt>preventDefault (defaults to false)</dt>- * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be + * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it (for example, DragDrop can determine if the target is a valid handle or not before preventing default).</dd> * </dl> *@@ -125,7 +196,10 @@ on: function (node, subscriber, ce) { - subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], + //Set -ms-touch-action on IE10 and set preventDefault to true+ _setTouchActions(node);++ subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], this._onStart, this, node,@@ -151,6 +225,8 @@ handle.detach(); subscriber[_DEL_MOVE_START_HANDLE] = null; }++ _unsetTouchActions(node); }, detach: function (node, subscriber, ce) {@@ -160,6 +236,8 @@ startHandle.detach(); subscriber[_MOVE_START_HANDLE] = null; }++ _unsetTouchActions(node); }, processArgs : function(args, delegate) {@@ -238,7 +316,7 @@ this._start(e, node, ce, params); } }, this));- } + } } } },@@ -280,18 +358,18 @@ /** * Sets up a "gesturemove" event, that is fired on touch devices in response to a single finger "touchmove", * and on mouse based devices in response to a "mousemove".- * + * * <p>By default this event is only fired when the same node * has received a "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without an initial "gesturemovestart".</p>- * + * * <p>By default this event sets up it's internal "touchmove" and "mousemove" DOM listeners on the document element. The subscriber- * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> + * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemove", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemove@@ -314,9 +392,10 @@ on : function (node, subscriber, ce) { - var root = _getRoot(node, subscriber),+ _setTouchActions(node);+ var root = _getRoot(node, subscriber, EVENT[MOVE]), - moveHandle = root.on(EVENT[MOVE], + moveHandle = root.on(EVENT[MOVE], this._onMove, this, node,@@ -324,6 +403,7 @@ ce); subscriber[_MOVE_HANDLE] = moveHandle;+ }, delegate : function(node, subscriber, ce, filter) {@@ -344,8 +424,10 @@ moveHandle.detach(); subscriber[_MOVE_HANDLE] = null; }++ _unsetTouchActions(node); },- + detachDelegate : function(node, subscriber, ce, filter) { var handle = subscriber[_DEL_MOVE_HANDLE]; @@ -354,6 +436,8 @@ subscriber[_DEL_MOVE_HANDLE] = null; } + _unsetTouchActions(node);+ }, processArgs : function(args, delegate) {@@ -375,7 +459,7 @@ if (e.touches) { if (e.touches.length === 1) {- _normTouchFacade(e, e.touches[0]); + _normTouchFacade(e, e.touches[0]); } else { fireMove = false; }@@ -392,25 +476,25 @@ } } },- + PREVENT_DEFAULT : false }); /** * Sets up a "gesturemoveend" event, that is fired on touch devices in response to a single finger "touchend", * and on mouse based devices in response to a "mouseup".- * + * * <p>By default this event is only fired when the same node * has received a "gesturemove" or "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without a preceding "gesturemovestart" or "gesturemove".</p> * * <p>By default this event sets up it's internal "touchend" and "mouseup" DOM listeners on the document element. The subscriber- * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> + * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemoveend", fn, null, context, arg1, arg2, arg3)</code></p> * *@@ -433,14 +517,14 @@ define(GESTURE_MOVE_END, { on : function (node, subscriber, ce) {-+ _setTouchActions(node); var root = _getRoot(node, subscriber), - endHandle = root.on(EVENT[END], - this._onEnd, + endHandle = root.on(EVENT[END],+ this._onEnd, this, node,- subscriber, + subscriber, ce); subscriber[_MOVE_END_HANDLE] = endHandle;@@ -465,15 +549,19 @@ subscriber[_DEL_MOVE_END_HANDLE] = null; } + _unsetTouchActions(node);+ }, detach : function (node, subscriber, ce) { var endHandle = subscriber[_MOVE_END_HANDLE];- + if (endHandle) { endHandle.detach(); subscriber[_MOVE_END_HANDLE] = null; }++ _unsetTouchActions(node); }, processArgs : function(args, delegate) {@@ -493,7 +581,7 @@ if (e.changedTouches) { if (e.changedTouches.length === 1) {- _normTouchFacade(e, e.changedTouches[0]); + _normTouchFacade(e, e.changedTouches[0]); } else { fireMoveEnd = false; }@@ -515,4 +603,5 @@ PREVENT_DEFAULT : false }); -}, '3.7.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});++}, '3.7.3', {"requires": ["node-base", "event-touch", "event-synthetic"]});
bundle/event-move/event-move-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-move",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="move",o="end",u="gesture"+s,a=u+o,f=u+i,l="_msh",c="_mh",h="_meh",p="_dmsh",d="_dmh",v="_dmeh",m="_ms",g="_m",y="minTime",b="minDistance",w="preventDefault",E="button",S="ownerDocument",x="currentTarget",T="target",N="nodeType",C=function(t,n,r){var i=r?4:3,s=n.length>i?e.merge(n.splice(i,1)[0]):{};return w in s||(s[w]=t.PREVENT_DEFAULT),s},k=function(e,t){return t._extra.root||e.get(N)===9?e:e.get(S)},L=function(e,t,n){e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY,e[T]=e[T]||t[T],e[x]=e[x]||t[x],e[E]=n&&n[E]||1},A=function(e,t){t&&(!t.call||t(e))&&e.preventDefault()},O=e.Event.define;O(f,{on:function(e,t,n){t[l]=e.on(r[i],this._onStart,this,e,t,n)},delegate:function(e,t,n,s){var o=this;t[p]=e.delegate(r[i],function(r){o._onStart(r,e,t,n,!0)},s)},detachDelegate:function(e,t,n,r){var i=t[p];i&&(i.detach(),t[p]=null)},detach:function(e,t,n){var r=t[l];r&&(r.detach(),t[l]=null)},processArgs:function(e,t){var n=C(this,e,t);return y in n||(n[y]=this.MIN_TIME),b in n||(n[b]=this.MIN_DISTANCE),n},_onStart:function(t,n,i,u,a){a&&(n=t[x]);var f=i._extra,l=!0,c=f[y],h=f[b],p=f.button,d=f[w],v=k(n,i),m;t.touches?t.touches.length===1?L(t,t.touches[0],f):l=!1:l=p===undefined||p===t.button,l&&(A(t,d),c===0||h===0?this._start(t,n,u,f):(m=[t.pageX,t.pageY],c>0&&(f._ht=e.later(c,this,this._start,[t,n,u,f]),f._hme=v.on(r[o],e.bind(function(){this._cancel(f)},this))),h>0&&(f._hm=v.on(r[s],e.bind(function(e){(Math.abs(e.pageX-m[0])>h||Math.abs(e.pageY-m[1])>h)&&this._start(t,n,u,f)},this)))))},_cancel:function(e){e._ht&&(e._ht.cancel(),e._ht=null),e._hme&&(e._hme.detach(),e._hme=null),e._hm&&(e._hm.detach(),e._hm=null)},_start:function(e,t,n,r){r&&this._cancel(r),e.type=f,t.setData(m,e),n.fire(e)},MIN_TIME:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1}),O(u,{on:function(e,t,n){var i=k(e,t),o=i.on(r[s],this._onMove,this,e,t,n);t[c]=o},delegate:function(e,t,n,i){var o=this;t[d]=e.delegate(r[s],function(r){o._onMove(r,e,t,n,!0)},i)},detach:function(e,t,n){var r=t[c];r&&(r.detach(),t[c]=null)},detachDelegate:function(e,t,n,r){var i=t[d];i&&(i.detach(),t[d]=null)},processArgs:function(e,t){return C(this,e,t)},_onMove:function(e,t,n,r,i){i&&(t=e[x]);var s=n._extra.standAlone||t.getData(m),o=n._extra.preventDefault;s&&(e.touches&&(e.touches.length===1?L(e,e.touches[0]):s=!1),s&&(A(e,o),e.type=u,r.fire(e)))},PREVENT_DEFAULT:!1}),O(a,{on:function(e,t,n){var i=k(e,t),s=i.on(r[o],this._onEnd,this,e,t,n);t[h]=s},delegate:function(e,t,n,i){var s=this;t[v]=e.delegate(r[o],function(r){s._onEnd(r,e,t,n,!0)},i)},detachDelegate:function(e,t,n,r){var i=t[v];i&&(i.detach(),t[v]=null)},detach:function(e,t,n){var r=t[h];r&&(r.detach(),t[h]=null)},processArgs:function(e,t){return C(this,e,t)},_onEnd:function(e,t,n,r,i){i&&(t=e[x]);var s=n._extra.standAlone||t.getData(g)||t.getData(m),o=n._extra.preventDefault;s&&(e.changedTouches&&(e.changedTouches.length===1?L(e,e.changedTouches[0]):s=!1),s&&(A(e,o),e.type=a,r.fire(e),t.clearData(m),t.clearData(g)))},PREVENT_DEFAULT:!1})},"3.7.2",{requires:["node-base","event-touch","event-synthetic"]});+YUI.add("event-move",function(e,t){var n=e.Event._GESTURE_MAP,r={start:n.start,end:n.end,move:n.move},i="start",s="move",o="end",u="gesture"+s,a=u+o,f=u+i,l="_msh",c="_mh",h="_meh",p="_dmsh",d="_dmh",v="_dmeh",m="_ms",g="_m",y="minTime",b="minDistance",w="preventDefault",E="button",S="ownerDocument",x="currentTarget",T="target",N="nodeType",C=e.config.win&&"msPointerEnabled"in e.config.win.navigator,k="msTouchActionCount",L="msInitTouchAction",A=function(t,n,r){var i=r?4:3,s=n.length>i?e.merge(n.splice(i,1)[0]):{};return w in s||(s[w]=t.PREVENT_DEFAULT),s},O=function(e,t){return t._extra.root||e.get(N)===9?e:e.get(S)},M=function(t){var n=t.getDOMNode();return t.compareTo(e.config.doc)&&n.documentElement?n.documentElement:!1},_=function(e,t,n){e.pageX=t.pageX,e.pageY=t.pageY,e.screenX=t.screenX,e.screenY=t.screenY,e.clientX=t.clientX,e.clientY=t.clientY,e[T]=e[T]||t[T],e[x]=e[x]||t[x],e[E]=n&&n[E]||1},D=function(t){var n=M(t)||t.getDOMNode(),r=t.getData(k);C&&(r||(r=0,t.setData(L,n.style.msTouchAction)),n.style.msTouchAction=e.Event._DEFAULT_TOUCH_ACTION,r++,t.setData(k,r))},P=function(e){var t=M(e)||e.getDOMNode(),n=e.getData(k),r=e.getData(L);C&&(n--,e.setData(k,n),n===0&&t.style.msTouchAction!==r&&(t.style.msTouchAction=r))},H=function(e,t){t&&(!t.call||t(e))&&e.preventDefault()},B=e.Event.define;e.Event._DEFAULT_TOUCH_ACTION="none",B(f,{on:function(e,t,n){D(e),t[l]=e.on(r[i],this._onStart,this,e,t,n)},delegate:function(e,t,n,s){var o=this;t[p]=e.delegate(r[i],function(r){o._onStart(r,e,t,n,!0)},s)},detachDelegate:function(e,t,n,r){var i=t[p];i&&(i.detach(),t[p]=null),P(e)},detach:function(e,t,n){var r=t[l];r&&(r.detach(),t[l]=null),P(e)},processArgs:function(e,t){var n=A(this,e,t);return y in n||(n[y]=this.MIN_TIME),b in n||(n[b]=this.MIN_DISTANCE),n},_onStart:function(t,n,i,u,a){a&&(n=t[x]);var f=i._extra,l=!0,c=f[y],h=f[b],p=f.button,d=f[w],v=O(n,i),m;t.touches?t.touches.length===1?_(t,t.touches[0],f):l=!1:l=p===undefined||p===t.button,l&&(H(t,d),c===0||h===0?this._start(t,n,u,f):(m=[t.pageX,t.pageY],c>0&&(f._ht=e.later(c,this,this._start,[t,n,u,f]),f._hme=v.on(r[o],e.bind(function(){this._cancel(f)},this))),h>0&&(f._hm=v.on(r[s],e.bind(function(e){(Math.abs(e.pageX-m[0])>h||Math.abs(e.pageY-m[1])>h)&&this._start(t,n,u,f)},this)))))},_cancel:function(e){e._ht&&(e._ht.cancel(),e._ht=null),e._hme&&(e._hme.detach(),e._hme=null),e._hm&&(e._hm.detach(),e._hm=null)},_start:function(e,t,n,r){r&&this._cancel(r),e.type=f,t.setData(m,e),n.fire(e)},MIN_TIME:0,MIN_DISTANCE:0,PREVENT_DEFAULT:!1}),B(u,{on:function(e,t,n){D(e);var i=O(e,t,r[s]),o=i.on(r[s],this._onMove,this,e,t,n);t[c]=o},delegate:function(e,t,n,i){var o=this;t[d]=e.delegate(r[s],function(r){o._onMove(r,e,t,n,!0)},i)},detach:function(e,t,n){var r=t[c];r&&(r.detach(),t[c]=null),P(e)},detachDelegate:function(e,t,n,r){var i=t[d];i&&(i.detach(),t[d]=null),P(e)},processArgs:function(e,t){return A(this,e,t)},_onMove:function(e,t,n,r,i){i&&(t=e[x]);var s=n._extra.standAlone||t.getData(m),o=n._extra.preventDefault;s&&(e.touches&&(e.touches.length===1?_(e,e.touches[0]):s=!1),s&&(H(e,o),e.type=u,r.fire(e)))},PREVENT_DEFAULT:!1}),B(a,{on:function(e,t,n){D(e);var i=O(e,t),s=i.on(r[o],this._onEnd,this,e,t,n);t[h]=s},delegate:function(e,t,n,i){var s=this;t[v]=e.delegate(r[o],function(r){s._onEnd(r,e,t,n,!0)},i)},detachDelegate:function(e,t,n,r){var i=t[v];i&&(i.detach(),t[v]=null),P(e)},detach:function(e,t,n){var r=t[h];r&&(r.detach(),t[h]=null),P(e)},processArgs:function(e,t){return A(this,e,t)},_onEnd:function(e,t,n,r,i){i&&(t=e[x]);var s=n._extra.standAlone||t.getData(g)||t.getData(m),o=n._extra.preventDefault;s&&(e.changedTouches&&(e.changedTouches.length===1?_(e,e.changedTouches[0]):s=!1),s&&(H(e,o),e.type=a,r.fire(e),t.clearData(m),t.clearData(g)))},PREVENT_DEFAULT:!1})},"3.7.3",{requires:["node-base","event-touch","event-synthetic"]});
bundle/event-move/event-move.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -11,10 +11,25 @@ * interactions which work across touch and mouse input devices. They correspond to "touchstart", "touchmove" and "touchend" on a touch input * device, and "mousedown", "mousemove", "mouseup" on a mouse based input device. *+ * <p>Documentation for the gesturemove triplet of events can be found on the <a href="../classes/YUI.html#event_gesturemove">YUI</a> global,+ * along with the other supported events.</p>++ @example++ YUI().use('event-move', function (Y) {+ Y.one('#myNode').on('gesturemovestart', function (e) {+ });+ Y.one('#myNode').on('gesturemove', function (e) {+ });+ Y.one('#myNode').on('gesturemoveend', function (e) {+ });+ });+ * @module event-gestures * @submodule event-move */ + var GESTURE_MAP = Y.Event._GESTURE_MAP, EVENT = { start: GESTURE_MAP.start,@@ -50,9 +65,12 @@ TARGET = "target", NODE_TYPE = "nodeType",+ SUPPORTS_POINTER = Y.config.win && ("msPointerEnabled" in Y.config.win.navigator),+ MS_TOUCH_ACTION_COUNT = 'msTouchActionCount',+ MS_INIT_TOUCH_ACTION = 'msInitTouchAction', _defArgsProcessor = function(se, args, delegate) {- var iConfig = (delegate) ? 4 : 3, + var iConfig = (delegate) ? 4 : 3, config = (args.length > iConfig) ? Y.merge(args.splice(iConfig,1)[0]) : {}; if (!(PREVENT_DEFAULT in config)) {@@ -66,6 +84,17 @@ return subscriber._extra.root || (node.get(NODE_TYPE) === 9) ? node : node.get(OWNER_DOCUMENT); }, + //Checks to see if the node is the document, and if it is, returns the documentElement.+ _checkDocumentElem = function(node) {+ var elem = node.getDOMNode();+ if (node.compareTo(Y.config.doc) && elem.documentElement) {+ return elem.documentElement;+ }+ else {+ return false;+ }+ },+ _normTouchFacade = function(touchFacade, touch, params) { touchFacade.pageX = touch.pageX; touchFacade.pageY = touch.pageY;@@ -79,6 +108,44 @@ touchFacade[BUTTON] = (params && params[BUTTON]) || 1; // default to left (left as per vendors, not W3C which is 0) }, + /*+ In IE10 touch mode, gestures will not work properly unless the -ms-touch-action CSS property is set to something other than 'auto'. Read http://msdn.microsoft.com/en-us/library/windows/apps/hh767313.aspx for more info. To get around this, we set -ms-touch-action: none which is the same as e.preventDefault() on touch environments. This tells the browser to fire DOM events for all touch events, and not perform any default behavior.++ The user can over-ride this by setting a more lenient -ms-touch-action property on a node (such as pan-x, pan-y, etc.) via CSS when subscribing to the 'gesturemovestart' event.+ */+ _setTouchActions = function (node) {+ var elem = _checkDocumentElem(node) || node.getDOMNode(),+ num = node.getData(MS_TOUCH_ACTION_COUNT);++ //Checks to see if msTouchAction is supported.+ if (SUPPORTS_POINTER) {+ if (!num) {+ num = 0;+ node.setData(MS_INIT_TOUCH_ACTION, elem.style.msTouchAction);+ }+ elem.style.msTouchAction = Y.Event._DEFAULT_TOUCH_ACTION;+ num++;+ node.setData(MS_TOUCH_ACTION_COUNT, num);+ }+ },++ /*+ Resets the element's -ms-touch-action property back to the original value, This is called on detach() and detachDelegate().+ */+ _unsetTouchActions = function (node) {+ var elem = _checkDocumentElem(node) || node.getDOMNode(),+ num = node.getData(MS_TOUCH_ACTION_COUNT),+ initTouchAction = node.getData(MS_INIT_TOUCH_ACTION);++ if (SUPPORTS_POINTER) {+ num--;+ node.setData(MS_TOUCH_ACTION_COUNT, num);+ if (num === 0 && elem.style.msTouchAction !== initTouchAction) {+ elem.style.msTouchAction = initTouchAction;+ }+ }+ },+ _prevent = function(e, preventDefault) { if (preventDefault) { // preventDefault is a boolean or a function@@ -89,15 +156,16 @@ }, define = Y.Event.define;+ Y.Event._DEFAULT_TOUCH_ACTION = 'none'; /** * Sets up a "gesturemovestart" event, that is fired on touch devices in response to a single finger "touchstart", * and on mouse based devices in response to a "mousedown". The subscriber can specify the minimum time * and distance thresholds which should be crossed before the "gesturemovestart" is fired and for the mouse, * which button should initiate a "gesturemovestart". This event can also be listened for using node.delegate().- * + * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemovestart", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemovestart@@ -114,7 +182,7 @@ * <dt>button (no default)</dt> * <dd>In the case of a mouse input device, if the event should only be fired for a specific mouse button.</dd> * <dt>preventDefault (defaults to false)</dt>- * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be + * <dd>Can be set to true/false to prevent default behavior as soon as the touchstart or mousedown is received (that is before minTime or minDistance thresholds are crossed, and so before the gesturemovestart listener is notified) so that things like text selection and context popups (on touch devices) can be * prevented. This property can also be set to a function, which returns true or false, based on the event facade passed to it (for example, DragDrop can determine if the target is a valid handle or not before preventing default).</dd> * </dl> *@@ -125,7 +193,10 @@ on: function (node, subscriber, ce) { - subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], + //Set -ms-touch-action on IE10 and set preventDefault to true+ _setTouchActions(node);++ subscriber[_MOVE_START_HANDLE] = node.on(EVENT[START], this._onStart, this, node,@@ -151,6 +222,8 @@ handle.detach(); subscriber[_DEL_MOVE_START_HANDLE] = null; }++ _unsetTouchActions(node); }, detach: function (node, subscriber, ce) {@@ -160,6 +233,8 @@ startHandle.detach(); subscriber[_MOVE_START_HANDLE] = null; }++ _unsetTouchActions(node); }, processArgs : function(args, delegate) {@@ -231,7 +306,7 @@ this._start(e, node, ce, params); } }, this));- } + } } } },@@ -272,18 +347,18 @@ /** * Sets up a "gesturemove" event, that is fired on touch devices in response to a single finger "touchmove", * and on mouse based devices in response to a "mousemove".- * + * * <p>By default this event is only fired when the same node * has received a "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without an initial "gesturemovestart".</p>- * + * * <p>By default this event sets up it's internal "touchmove" and "mousemove" DOM listeners on the document element. The subscriber- * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> + * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemove", fn, null, context, arg1, arg2, arg3)</code></p> * * @event gesturemove@@ -306,9 +381,10 @@ on : function (node, subscriber, ce) { - var root = _getRoot(node, subscriber),+ _setTouchActions(node);+ var root = _getRoot(node, subscriber, EVENT[MOVE]), - moveHandle = root.on(EVENT[MOVE], + moveHandle = root.on(EVENT[MOVE], this._onMove, this, node,@@ -316,6 +392,7 @@ ce); subscriber[_MOVE_HANDLE] = moveHandle;+ }, delegate : function(node, subscriber, ce, filter) {@@ -336,8 +413,10 @@ moveHandle.detach(); subscriber[_MOVE_HANDLE] = null; }++ _unsetTouchActions(node); },- + detachDelegate : function(node, subscriber, ce, filter) { var handle = subscriber[_DEL_MOVE_HANDLE]; @@ -346,6 +425,8 @@ subscriber[_DEL_MOVE_HANDLE] = null; } + _unsetTouchActions(node);+ }, processArgs : function(args, delegate) {@@ -366,7 +447,7 @@ if (e.touches) { if (e.touches.length === 1) {- _normTouchFacade(e, e.touches[0]); + _normTouchFacade(e, e.touches[0]); } else { fireMove = false; }@@ -382,25 +463,25 @@ } } },- + PREVENT_DEFAULT : false }); /** * Sets up a "gesturemoveend" event, that is fired on touch devices in response to a single finger "touchend", * and on mouse based devices in response to a "mouseup".- * + * * <p>By default this event is only fired when the same node * has received a "gesturemove" or "gesturemovestart" event. The subscriber can set standAlone to true, in the configuration properties, * if they want to listen for this event without a preceding "gesturemovestart" or "gesturemove".</p> * * <p>By default this event sets up it's internal "touchend" and "mouseup" DOM listeners on the document element. The subscriber- * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> + * can set the root configuration property, to specify which node to attach DOM listeners to, if different from the document.</p> * * <p>This event can also be listened for using node.delegate().</p> * * <p>It is recommended that you use Y.bind to set up context and additional arguments for your event handler,- * however if you want to pass the context and arguments as additional signature arguments to on/delegate, + * however if you want to pass the context and arguments as additional signature arguments to on/delegate, * you need to provide a null value for the configuration object, e.g: <code>node.on("gesturemoveend", fn, null, context, arg1, arg2, arg3)</code></p> * *@@ -423,14 +504,14 @@ define(GESTURE_MOVE_END, { on : function (node, subscriber, ce) {-+ _setTouchActions(node); var root = _getRoot(node, subscriber), - endHandle = root.on(EVENT[END], - this._onEnd, + endHandle = root.on(EVENT[END],+ this._onEnd, this, node,- subscriber, + subscriber, ce); subscriber[_MOVE_END_HANDLE] = endHandle;@@ -455,15 +536,19 @@ subscriber[_DEL_MOVE_END_HANDLE] = null; } + _unsetTouchActions(node);+ }, detach : function (node, subscriber, ce) { var endHandle = subscriber[_MOVE_END_HANDLE];- + if (endHandle) { endHandle.detach(); subscriber[_MOVE_END_HANDLE] = null; }++ _unsetTouchActions(node); }, processArgs : function(args, delegate) {@@ -483,7 +568,7 @@ if (e.changedTouches) { if (e.changedTouches.length === 1) {- _normTouchFacade(e, e.changedTouches[0]); + _normTouchFacade(e, e.changedTouches[0]); } else { fireMoveEnd = false; }@@ -505,4 +590,5 @@ PREVENT_DEFAULT : false }); -}, '3.7.2', {"requires": ["node-base", "event-touch", "event-synthetic"]});++}, '3.7.3', {"requires": ["node-base", "event-touch", "event-synthetic"]});
bundle/event-outside/event-outside-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-outside/event-outside.js", code: [] };-_yuitest_coverage["build/event-outside/event-outside.js"].code=["YUI.add('event-outside', function (Y, NAME) {","","/**"," * Outside events are synthetic DOM events that fire when a corresponding native"," * or synthetic DOM event occurs outside a bound element."," *"," * The following outside events are pre-defined by this module:"," * <ul>"," * <li>blur</li>"," * <li>change</li>"," * <li>click</li>"," * <li>dblclick</li>"," * <li>focus</li>"," * <li>keydown</li>"," * <li>keypress</li>"," * <li>keyup</li>"," * <li>mousedown</li>"," * <li>mousemove</li>"," * <li>mouseout</li>"," * <li>mouseover</li>"," * <li>mouseup</li>"," * <li>select</li>"," * <li>submit</li>"," * </ul>"," *"," * Define new outside events with"," * <code>Y.Event.defineOutside(eventType);</code>."," * By default, the created synthetic event name will be the name of the event"," * with \"outside\" appended (e.g. \"click\" becomes \"clickoutside\"). If you want"," * a different name for the created Event, pass it as a second argument like so:"," * <code>Y.Event.defineOutside(eventType, \"yonderclick\")</code>."," *"," * This module was contributed by Brett Stimmerman, promoted from his"," * gallery-outside-events module at"," * http://yuilibrary.com/gallery/show/outside-events"," *"," * @module event"," * @submodule event-outside"," * @author brettstimmerman"," * @since 3.4.0"," */","","// Outside events are pre-defined for each of these native DOM events","var nativeEvents = ["," 'blur', 'change', 'click', 'dblclick', 'focus', 'keydown', 'keypress',"," 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup',"," 'select', 'submit'"," ];","","/**"," * Defines a new outside event to correspond with the given DOM event."," *"," * By default, the created synthetic event name will be the name of the event"," * with \"outside\" appended (e.g. \"click\" becomes \"clickoutside\"). If you want"," * a different name for the created Event, pass it as a second argument like so:"," * <code>Y.Event.defineOutside(eventType, \"yonderclick\")</code>."," *"," * @method defineOutside"," * @param {String} event DOM event"," * @param {String} name (optional) custom outside event name"," * @static"," * @for Event"," */","Y.Event.defineOutside = function (event, name) {"," name = name || (event + 'outside');",""," var config = {"," "," on: function (node, sub, notifier) {"," sub.handle = Y.one('doc').on(event, function(e) {"," if (this.isOutside(node, e.target)) {"," e.currentTarget = node;"," notifier.fire(e);"," }"," }, this);"," },"," "," detach: function (node, sub, notifier) {"," sub.handle.detach();"," },"," "," delegate: function (node, sub, notifier, filter) {"," sub.handle = Y.one('doc').delegate(event, function (e) {"," if (this.isOutside(node, e.target)) {"," notifier.fire(e);"," }"," }, filter, this);"," },"," "," isOutside: function (node, target) {"," return target !== node && !target.ancestor(function (p) {"," return p === node;"," });"," }"," };"," config.detachDelegate = config.detach;",""," Y.Event.define(name, config);","};","","// Define outside events for some common native DOM events","Y.Array.each(nativeEvents, function (event) {"," Y.Event.defineOutside(event);","});","","","}, '3.7.2', {\"requires\": [\"event-synthetic\"]});"];+_yuitest_coverage["build/event-outside/event-outside.js"].code=["YUI.add('event-outside', function (Y, NAME) {","","/**"," * Outside events are synthetic DOM events that fire when a corresponding native"," * or synthetic DOM event occurs outside a bound element."," *"," * The following outside events are pre-defined by this module:"," * <ul>"," * <li>blur</li>"," * <li>change</li>"," * <li>click</li>"," * <li>dblclick</li>"," * <li>focus</li>"," * <li>keydown</li>"," * <li>keypress</li>"," * <li>keyup</li>"," * <li>mousedown</li>"," * <li>mousemove</li>"," * <li>mouseout</li>"," * <li>mouseover</li>"," * <li>mouseup</li>"," * <li>select</li>"," * <li>submit</li>"," * </ul>"," *"," * Define new outside events with"," * <code>Y.Event.defineOutside(eventType);</code>."," * By default, the created synthetic event name will be the name of the event"," * with \"outside\" appended (e.g. \"click\" becomes \"clickoutside\"). If you want"," * a different name for the created Event, pass it as a second argument like so:"," * <code>Y.Event.defineOutside(eventType, \"yonderclick\")</code>."," *"," * This module was contributed by Brett Stimmerman, promoted from his"," * gallery-outside-events module at"," * http://yuilibrary.com/gallery/show/outside-events"," *"," * @module event"," * @submodule event-outside"," * @author brettstimmerman"," * @since 3.4.0"," */","","// Outside events are pre-defined for each of these native DOM events","var nativeEvents = ["," 'blur', 'change', 'click', 'dblclick', 'focus', 'keydown', 'keypress',"," 'keyup', 'mousedown', 'mousemove', 'mouseout', 'mouseover', 'mouseup',"," 'select', 'submit'"," ];","","/**"," * Defines a new outside event to correspond with the given DOM event."," *"," * By default, the created synthetic event name will be the name of the event"," * with \"outside\" appended (e.g. \"click\" becomes \"clickoutside\"). If you want"," * a different name for the created Event, pass it as a second argument like so:"," * <code>Y.Event.defineOutside(eventType, \"yonderclick\")</code>."," *"," * @method defineOutside"," * @param {String} event DOM event"," * @param {String} name (optional) custom outside event name"," * @static"," * @for Event"," */","Y.Event.defineOutside = function (event, name) {"," name = name || (event + 'outside');",""," var config = {"," "," on: function (node, sub, notifier) {"," sub.handle = Y.one('doc').on(event, function(e) {"," if (this.isOutside(node, e.target)) {"," e.currentTarget = node;"," notifier.fire(e);"," }"," }, this);"," },"," "," detach: function (node, sub, notifier) {"," sub.handle.detach();"," },"," "," delegate: function (node, sub, notifier, filter) {"," sub.handle = Y.one('doc').delegate(event, function (e) {"," if (this.isOutside(node, e.target)) {"," notifier.fire(e);"," }"," }, filter, this);"," },"," "," isOutside: function (node, target) {"," return target !== node && !target.ancestor(function (p) {"," return p === node;"," });"," }"," };"," config.detachDelegate = config.detach;",""," Y.Event.define(name, config);","};","","// Define outside events for some common native DOM events","Y.Array.each(nativeEvents, function (event) {"," Y.Event.defineOutside(event);","});","","","}, '3.7.3', {\"requires\": [\"event-synthetic\"]});"]; _yuitest_coverage["build/event-outside/event-outside.js"].lines = {"1":0,"44":0,"64":0,"65":0,"67":0,"70":0,"71":0,"72":0,"73":0,"79":0,"83":0,"84":0,"85":0,"91":0,"92":0,"96":0,"98":0,"102":0,"103":0}; _yuitest_coverage["build/event-outside/event-outside.js"].functions = {"(anonymous 2):70":0,"on:69":0,"detach:78":0,"(anonymous 3):83":0,"delegate:82":0,"(anonymous 4):91":0,"isOutside:90":0,"defineOutside:64":0,"(anonymous 5):102":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-outside/event-outside.js"].coveredLines = 19;@@ -172,4 +172,4 @@ }); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-outside/event-outside-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -110,4 +110,4 @@ }); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-outside/event-outside-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-outside",function(e,t){var n=["blur","change","click","dblclick","focus","keydown","keypress","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","select","submit"];e.Event.defineOutside=function(t,n){n=n||t+"outside";var r={on:function(n,r,i){r.handle=e.one("doc").on(t,function(e){this.isOutside(n,e.target)&&(e.currentTarget=n,i.fire(e))},this)},detach:function(e,t,n){t.handle.detach()},delegate:function(n,r,i,s){r.handle=e.one("doc").delegate(t,function(e){this.isOutside(n,e.target)&&i.fire(e)},s,this)},isOutside:function(e,t){return t!==e&&!t.ancestor(function(t){return t===e})}};r.detachDelegate=r.detach,e.Event.define(n,r)},e.Array.each(n,function(t){e.Event.defineOutside(t)})},"3.7.2",{requires:["event-synthetic"]});+YUI.add("event-outside",function(e,t){var n=["blur","change","click","dblclick","focus","keydown","keypress","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","select","submit"];e.Event.defineOutside=function(t,n){n=n||t+"outside";var r={on:function(n,r,i){r.handle=e.one("doc").on(t,function(e){this.isOutside(n,e.target)&&(e.currentTarget=n,i.fire(e))},this)},detach:function(e,t,n){t.handle.detach()},delegate:function(n,r,i,s){r.handle=e.one("doc").delegate(t,function(e){this.isOutside(n,e.target)&&i.fire(e)},s,this)},isOutside:function(e,t){return t!==e&&!t.ancestor(function(t){return t===e})}};r.detachDelegate=r.detach,e.Event.define(n,r)},e.Array.each(n,function(t){e.Event.defineOutside(t)})},"3.7.3",{requires:["event-synthetic"]});
bundle/event-outside/event-outside.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -110,4 +110,4 @@ }); -}, '3.7.2', {"requires": ["event-synthetic"]});+}, '3.7.3', {"requires": ["event-synthetic"]});
bundle/event-resize/event-resize-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-resize/event-resize.js", code: [] };-_yuitest_coverage["build/event-resize/event-resize.js"].code=["YUI.add('event-resize', function (Y, NAME) {","","/**"," * Adds a window resize event that has its behavior normalized to fire at the"," * end of the resize rather than constantly during the resize."," * @module event"," * @submodule event-resize"," */","","","/**"," * Old firefox fires the window resize event once when the resize action"," * finishes, other browsers fire the event periodically during the"," * resize. This code uses timeout logic to simulate the Firefox "," * behavior in other browsers."," * @event windowresize"," * @for YUI"," */","Y.Event.define('windowresize', {",""," on: (Y.UA.gecko && Y.UA.gecko < 1.91) ?"," function (node, sub, notifier) {"," sub._handle = Y.Event.attach('resize', function (e) {"," notifier.fire(e);"," });"," } :"," function (node, sub, notifier) {"," // interval bumped from 40 to 100ms as of 3.4.1"," var delay = Y.config.windowResizeDelay || 100;",""," sub._handle = Y.Event.attach('resize', function (e) {"," if (sub._timer) {"," sub._timer.cancel();"," }",""," sub._timer = Y.later(delay, Y, function () {"," notifier.fire(e);"," });"," });"," },",""," detach: function (node, sub) {"," if (sub._timer) {"," sub._timer.cancel();"," }"," sub._handle.detach();"," }"," // delegate methods not defined because this only works for window"," // subscriptions, so...yeah.","});","","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-synthetic\"]});"];+_yuitest_coverage["build/event-resize/event-resize.js"].code=["YUI.add('event-resize', function (Y, NAME) {","","/**"," * Adds a window resize event that has its behavior normalized to fire at the"," * end of the resize rather than constantly during the resize."," * @module event"," * @submodule event-resize"," */","","","/**"," * Old firefox fires the window resize event once when the resize action"," * finishes, other browsers fire the event periodically during the"," * resize. This code uses timeout logic to simulate the Firefox "," * behavior in other browsers."," * @event windowresize"," * @for YUI"," */","Y.Event.define('windowresize', {",""," on: (Y.UA.gecko && Y.UA.gecko < 1.91) ?"," function (node, sub, notifier) {"," sub._handle = Y.Event.attach('resize', function (e) {"," notifier.fire(e);"," });"," } :"," function (node, sub, notifier) {"," // interval bumped from 40 to 100ms as of 3.4.1"," var delay = Y.config.windowResizeDelay || 100;",""," sub._handle = Y.Event.attach('resize', function (e) {"," if (sub._timer) {"," sub._timer.cancel();"," }",""," sub._timer = Y.later(delay, Y, function () {"," notifier.fire(e);"," });"," });"," },",""," detach: function (node, sub) {"," if (sub._timer) {"," sub._timer.cancel();"," }"," sub._handle.detach();"," }"," // delegate methods not defined because this only works for window"," // subscriptions, so...yeah.","});","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-synthetic\"]});"]; _yuitest_coverage["build/event-resize/event-resize.js"].lines = {"1":0,"19":0,"23":0,"24":0,"29":0,"31":0,"32":0,"33":0,"36":0,"37":0,"43":0,"44":0,"46":0}; _yuitest_coverage["build/event-resize/event-resize.js"].functions = {"(anonymous 3):23":0,"(anonymous 2):22":0,"(anonymous 5):36":0,"(anonymous 4):31":0,"}:27":0,"detach:42":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-resize/event-resize.js"].coveredLines = 13;@@ -109,4 +109,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-synthetic"]});
bundle/event-resize/event-resize-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-synthetic"]});
bundle/event-resize/event-resize-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-resize",function(e,t){e.Event.define("windowresize",{on:e.UA.gecko&&e.UA.gecko<1.91?function(t,n,r){n._handle=e.Event.attach("resize",function(e){r.fire(e)})}:function(t,n,r){var i=e.config.windowResizeDelay||100;n._handle=e.Event.attach("resize",function(t){n._timer&&n._timer.cancel(),n._timer=e.later(i,e,function(){r.fire(t)})})},detach:function(e,t){t._timer&&t._timer.cancel(),t._handle.detach()}})},"3.7.2",{requires:["node-base","event-synthetic"]});+YUI.add("event-resize",function(e,t){e.Event.define("windowresize",{on:e.UA.gecko&&e.UA.gecko<1.91?function(t,n,r){n._handle=e.Event.attach("resize",function(e){r.fire(e)})}:function(t,n,r){var i=e.config.windowResizeDelay||100;n._handle=e.Event.attach("resize",function(t){n._timer&&n._timer.cancel(),n._timer=e.later(i,e,function(){r.fire(t)})})},detach:function(e,t){t._timer&&t._timer.cancel(),t._handle.detach()}})},"3.7.3",{requires:["node-base","event-synthetic"]});
bundle/event-resize/event-resize.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-synthetic"]});
bundle/event-simulate/event-simulate-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-simulate/event-simulate.js", code: [] };-_yuitest_coverage["build/event-simulate/event-simulate.js"].code=["YUI.add('event-simulate', function (Y, NAME) {","","(function() {","/**"," * Simulate user interaction by generating native DOM events."," *"," * @module event-simulate"," * @requires event"," */","","//shortcuts","var L = Y.Lang,"," isFunction = L.isFunction,"," isString = L.isString,"," isBoolean = L.isBoolean,"," isObject = L.isObject,"," isNumber = L.isNumber,",""," //mouse events supported"," mouseEvents = {"," click: 1,"," dblclick: 1,"," mouseover: 1,"," mouseout: 1,"," mousedown: 1,"," mouseup: 1,"," mousemove: 1,"," contextmenu:1"," },",""," //key events supported"," keyEvents = {"," keydown: 1,"," keyup: 1,"," keypress: 1"," },",""," //HTML events supported"," uiEvents = {"," submit: 1,"," blur: 1,"," change: 1,"," focus: 1,"," resize: 1,"," scroll: 1,"," select: 1"," },",""," //events that bubble by default"," bubbleEvents = {"," scroll: 1,"," resize: 1,"," reset: 1,"," submit: 1,"," change: 1,"," select: 1,"," error: 1,"," abort: 1"," },"," "," //touch events supported"," touchEvents = {"," touchstart: 1,"," touchmove: 1,"," touchend: 1, "," touchcancel: 1"," },"," "," gestureEvents = {"," gesturestart: 1,"," gesturechange: 1,"," gestureend: 1"," };","","//all key, mouse and touch events bubble","Y.mix(bubbleEvents, mouseEvents);","Y.mix(bubbleEvents, keyEvents);","Y.mix(bubbleEvents, touchEvents);","","/*"," * Note: Intentionally not for YUIDoc generation."," * 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."," */","function simulateKeyEvent(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"," if (!target){"," Y.error(\"simulateKeyEvent(): Invalid target.\");"," }",""," //check event type"," if (isString(type)){"," type = type.toLowerCase();"," switch(type){"," case \"textevent\": //DOM Level 3"," type = \"keypress\";"," break;"," case \"keyup\":"," case \"keydown\":"," case \"keypress\":"," break;"," default:"," Y.error(\"simulateKeyEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateKeyEvent(): Event type must be a string.\");"," }",""," //setup default values"," if (!isBoolean(bubbles)){"," bubbles = true; //all key events bubble"," }"," if (!isBoolean(cancelable)){"," cancelable = true; //all key events can be cancelled"," }"," if (!isObject(view)){"," view = Y.config.win; //view is typically window"," }"," if (!isBoolean(ctrlKey)){"," ctrlKey = false;"," }"," if (!isBoolean(altKey)){"," altKey = false;"," }"," if (!isBoolean(shiftKey)){"," shiftKey = false;"," }"," if (!isBoolean(metaKey)){"," metaKey = false;"," }"," if (!isNumber(keyCode)){"," keyCode = 0;"," }"," if (!isNumber(charCode)){"," charCode = 0;"," }",""," //try to create a mouse event"," var customEvent /*:MouseEvent*/ = null;",""," //check for DOM-compliant browsers first"," if (isFunction(Y.config.doc.createEvent)){",""," try {",""," //try to create key event"," customEvent = Y.config.doc.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 = Y.config.doc.createEvent(\"Events\");",""," } catch (uierror /*:Error*/){",""," //the above failed, so create a UIEvent for Safari 2.x"," customEvent = Y.config.doc.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 (isObject(Y.config.doc.createEventObject)){ //IE",""," //create an IE event object"," customEvent = Y.config.doc.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 {"," Y.error(\"simulateKeyEvent(): No event simulation framework present.\");"," }","}","","/*"," * Note: Intentionally not for YUIDoc generation."," * 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."," */","function simulateMouseEvent(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"," if (!target){"," Y.error(\"simulateMouseEvent(): Invalid target.\");"," }",""," //check event type"," if (isString(type)){"," type = type.toLowerCase();",""," //make sure it's a supported mouse event"," if (!mouseEvents[type]){"," Y.error(\"simulateMouseEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateMouseEvent(): Event type must be a string.\");"," }",""," //setup default values"," if (!isBoolean(bubbles)){"," bubbles = true; //all mouse events bubble"," }"," if (!isBoolean(cancelable)){"," cancelable = (type != \"mousemove\"); //mousemove is the only one that can't be cancelled"," }"," if (!isObject(view)){"," view = Y.config.win; //view is typically window"," }"," if (!isNumber(detail)){"," detail = 1; //number of mouse clicks must be at least one"," }"," if (!isNumber(screenX)){"," screenX = 0;"," }"," if (!isNumber(screenY)){"," screenY = 0;"," }"," if (!isNumber(clientX)){"," clientX = 0;"," }"," if (!isNumber(clientY)){"," clientY = 0;"," }"," if (!isBoolean(ctrlKey)){"," ctrlKey = false;"," }"," if (!isBoolean(altKey)){"," altKey = false;"," }"," if (!isBoolean(shiftKey)){"," shiftKey = false;"," }"," if (!isBoolean(metaKey)){"," metaKey = false;"," }"," if (!isNumber(button)){"," button = 0;"," }",""," relatedTarget = relatedTarget || null;",""," //try to create a mouse event"," var customEvent /*:MouseEvent*/ = null;",""," //check for DOM-compliant browsers first"," if (isFunction(Y.config.doc.createEvent)){",""," customEvent = Y.config.doc.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 = Y.config.doc.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 (isObject(Y.config.doc.createEventObject)){ //IE",""," //create an IE event object"," customEvent = Y.config.doc.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 {"," Y.error(\"simulateMouseEvent(): No event simulation framework present.\");"," }","}","","/*"," * Note: Intentionally not for YUIDoc generation."," * Simulates a UI 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 simulateHTMLEvent"," * @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."," */","function simulateUIEvent(target /*:HTMLElement*/, type /*:String*/,"," bubbles /*:Boolean*/, cancelable /*:Boolean*/,"," view /*:Window*/, detail /*:int*/) /*:Void*/","{",""," //check target"," if (!target){"," Y.error(\"simulateUIEvent(): Invalid target.\");"," }",""," //check event type"," if (isString(type)){"," type = type.toLowerCase();",""," //make sure it's a supported mouse event"," if (!uiEvents[type]){"," Y.error(\"simulateUIEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateUIEvent(): Event type must be a string.\");"," }",""," //try to create a mouse event"," var customEvent = null;","",""," //setup default values"," if (!isBoolean(bubbles)){"," bubbles = (type in bubbleEvents); //not all events bubble"," }"," if (!isBoolean(cancelable)){"," cancelable = (type == \"submit\"); //submit is the only one that can be cancelled"," }"," if (!isObject(view)){"," view = Y.config.win; //view is typically window"," }"," if (!isNumber(detail)){"," detail = 1; //usually not used but defaulted to this"," }",""," //check for DOM-compliant browsers first"," if (isFunction(Y.config.doc.createEvent)){",""," //just a generic UI Event object is needed"," customEvent = Y.config.doc.createEvent(\"UIEvents\");"," customEvent.initUIEvent(type, bubbles, cancelable, view, detail);",""," //fire the event"," target.dispatchEvent(customEvent);",""," } else if (isObject(Y.config.doc.createEventObject)){ //IE",""," //create an IE event object"," customEvent = Y.config.doc.createEventObject();",""," //assign available properties"," customEvent.bubbles = bubbles;"," customEvent.cancelable = cancelable;"," customEvent.view = view;"," customEvent.detail = detail;",""," //fire the event"," target.fireEvent(\"on\" + type, customEvent);",""," } else {"," Y.error(\"simulateUIEvent(): No event simulation framework present.\");"," }","}","","/*"," * (iOS only) This is for creating native DOM gesture events which only iOS"," * v2.0+ is supporting."," * "," * @method simulateGestureEvent"," * @private"," * @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: touchstart, touchmove, touchend, touchcancel."," * @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"," * touch events except touchcancel can be cancelled. The default"," * is true for all events except touchcancel, 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) Specifies some detail information about "," * the event depending on the type of event."," * @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 {float} scale (iOS v2+ only) The distance between two fingers "," * since the start of an event as a multiplier of the initial distance. "," * The default value is 1.0."," * @param {float} rotation (iOS v2+ only) The delta rotation since the start "," * of an event, in degrees, where clockwise is positive and "," * counter-clockwise is negative. The default value is 0.0. "," */","function simulateGestureEvent(target, type,"," bubbles, // boolean"," cancelable, // boolean"," view, // DOMWindow"," detail, // long"," screenX, screenY, // long"," clientX, clientY, // long"," ctrlKey, altKey, shiftKey, metaKey, // boolean"," scale, // float"," rotation // float",") {"," var customEvent;",""," if(!Y.UA.ios || Y.UA.ios<2.0) {"," Y.error(\"simulateGestureEvent(): Native gesture DOM eventframe is not available in this platform.\");"," }",""," // check taget "," if (!target){"," Y.error(\"simulateGestureEvent(): Invalid target.\");"," }",""," //check event type"," if (Y.Lang.isString(type)) {"," type = type.toLowerCase();",""," //make sure it's a supported touch event"," if (!gestureEvents[type]){"," Y.error(\"simulateTouchEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateGestureEvent(): Event type must be a string.\");"," }",""," // setup default values"," if (!Y.Lang.isBoolean(bubbles)) { bubbles = true; } // bubble by default"," if (!Y.Lang.isBoolean(cancelable)) { cancelable = true; } "," if (!Y.Lang.isObject(view)) { view = Y.config.win; }"," if (!Y.Lang.isNumber(detail)) { detail = 2; } // usually not used."," if (!Y.Lang.isNumber(screenX)) { screenX = 0; }"," if (!Y.Lang.isNumber(screenY)) { screenY = 0; }"," if (!Y.Lang.isNumber(clientX)) { clientX = 0; }"," if (!Y.Lang.isNumber(clientY)) { clientY = 0; }"," if (!Y.Lang.isBoolean(ctrlKey)) { ctrlKey = false; }"," if (!Y.Lang.isBoolean(altKey)) { altKey = false; }"," if (!Y.Lang.isBoolean(shiftKey)){ shiftKey = false; }"," if (!Y.Lang.isBoolean(metaKey)) { metaKey = false; }",""," if (!Y.Lang.isNumber(scale)){ scale = 1.0; }"," if (!Y.Lang.isNumber(rotation)){ rotation = 0.0; }",""," customEvent = Y.config.doc.createEvent(\"GestureEvent\");",""," customEvent.initGestureEvent(type, bubbles, cancelable, view, detail,"," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey,"," target, scale, rotation);",""," target.dispatchEvent(customEvent);","}","","","/*"," * @method simulateTouchEvent"," * @private"," * @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: touchstart, touchmove, touchend, touchcancel."," * @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"," * touch events except touchcancel can be cancelled. The default"," * is true for all events except touchcancel, 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) Specifies some detail information about "," * the event depending on the type of event."," * @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 {TouchList} touches A collection of Touch objects representing "," * all touches associated with this event."," * @param {TouchList} targetTouches A collection of Touch objects "," * representing all touches associated with this target."," * @param {TouchList} changedTouches A collection of Touch objects "," * representing all touches that changed in this event."," * @param {float} scale (iOS v2+ only) The distance between two fingers "," * since the start of an event as a multiplier of the initial distance. "," * The default value is 1.0."," * @param {float} rotation (iOS v2+ only) The delta rotation since the start "," * of an event, in degrees, where clockwise is positive and "," * counter-clockwise is negative. The default value is 0.0. "," */","function simulateTouchEvent(target, type,"," bubbles, // boolean"," cancelable, // boolean"," view, // DOMWindow"," detail, // long"," screenX, screenY, // long"," clientX, clientY, // long"," ctrlKey, altKey, shiftKey, metaKey, // boolean"," touches, // TouchList"," targetTouches, // TouchList"," changedTouches, // TouchList"," scale, // float"," rotation // float",") {",""," var customEvent;",""," // check taget "," if (!target){"," Y.error(\"simulateTouchEvent(): Invalid target.\");"," }",""," //check event type"," if (Y.Lang.isString(type)) {"," type = type.toLowerCase();",""," //make sure it's a supported touch event"," if (!touchEvents[type]){"," Y.error(\"simulateTouchEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateTouchEvent(): Event type must be a string.\");"," }",""," // note that the caller is responsible to pass appropriate touch objects."," // check touch objects"," // Android(even 4.0) doesn't define TouchList yet"," /*if(type === 'touchstart' || type === 'touchmove') {"," if(!touches instanceof TouchList) {"," Y.error('simulateTouchEvent(): Invalid touches. It must be a TouchList');"," } else {"," if(touches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object found.');"," }"," }"," } else if(type === 'touchend') {"," if(!changedTouches instanceof TouchList) {"," Y.error('simulateTouchEvent(): Invalid touches. It must be a TouchList');"," } else {"," if(changedTouches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object found.');"," }"," }"," }*/",""," if(type === 'touchstart' || type === 'touchmove') {"," if(touches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object in touches');"," }"," } else if(type === 'touchend') {"," if(changedTouches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object in changedTouches');"," }"," }",""," // setup default values"," if (!Y.Lang.isBoolean(bubbles)) { bubbles = true; } // bubble by default."," if (!Y.Lang.isBoolean(cancelable)) { "," cancelable = (type != \"touchcancel\"); // touchcancel is not cancelled "," } "," if (!Y.Lang.isObject(view)) { view = Y.config.win; }"," if (!Y.Lang.isNumber(detail)) { detail = 1; } // usually not used. defaulted to # of touch objects."," if (!Y.Lang.isNumber(screenX)) { screenX = 0; }"," if (!Y.Lang.isNumber(screenY)) { screenY = 0; }"," if (!Y.Lang.isNumber(clientX)) { clientX = 0; }"," if (!Y.Lang.isNumber(clientY)) { clientY = 0; }"," if (!Y.Lang.isBoolean(ctrlKey)) { ctrlKey = false; }"," if (!Y.Lang.isBoolean(altKey)) { altKey = false; }"," if (!Y.Lang.isBoolean(shiftKey)){ shiftKey = false; }"," if (!Y.Lang.isBoolean(metaKey)) { metaKey = false; }"," if (!Y.Lang.isNumber(scale)) { scale = 1.0; }"," if (!Y.Lang.isNumber(rotation)) { rotation = 0.0; }","",""," //check for DOM-compliant browsers first"," if (Y.Lang.isFunction(Y.config.doc.createEvent)) {"," if (Y.UA.android) {"," /**"," * Couldn't find android start version that supports touch event. "," * Assumed supported(btw APIs broken till icecream sandwitch) "," * from the beginning."," */"," if(Y.UA.android < 4.0) {"," /**"," * Touch APIs are broken in androids older than 4.0. We will use "," * simulated touch apis for these versions. "," * App developer still can listen for touch events. This events"," * will be dispatched with touch event types."," * "," * (Note) Used target for the relatedTarget. Need to verify if"," * it has a side effect."," */"," customEvent = Y.config.doc.createEvent(\"MouseEvents\");"," customEvent.initMouseEvent(type, bubbles, cancelable, view, detail, "," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey,"," 0, target);",""," customEvent.touches = touches;"," customEvent.targetTouches = targetTouches;"," customEvent.changedTouches = changedTouches;"," } else {"," customEvent = Y.config.doc.createEvent(\"TouchEvent\");",""," // Andoroid isn't compliant W3C initTouchEvent method signature."," customEvent.initTouchEvent(touches, targetTouches, changedTouches,"," type, view,"," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey);"," }"," } else if (Y.UA.ios) {"," if(Y.UA.ios >= 2.0) {"," customEvent = Y.config.doc.createEvent(\"TouchEvent\");",""," // Available iOS 2.0 and later"," customEvent.initTouchEvent(type, bubbles, cancelable, view, detail,"," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey,"," touches, targetTouches, changedTouches,"," scale, rotation);"," } else {"," Y.error('simulateTouchEvent(): No touch event simulation framework present for iOS, '+Y.UA.ios+'.');"," }"," } else {"," Y.error('simulateTouchEvent(): Not supported agent yet, '+Y.UA.userAgent);"," }",""," //fire the event"," target.dispatchEvent(customEvent);"," //} else if (Y.Lang.isObject(doc.createEventObject)){ // Windows Mobile/IE, support later "," } else {"," Y.error('simulateTouchEvent(): No event simulation framework present.');"," }","}","","/**"," * Simulates the event or gesture with the given name on a target."," * @param {HTMLElement} target The DOM element that's the target of the event."," * @param {String} type The type of event or name of the supported gesture to simulate "," * (i.e., \"click\", \"doubletap\", \"flick\")."," * @param {Object} options (Optional) Extra options to copy onto the event object. "," * For gestures, options are used to refine the gesture behavior."," * @return {void}"," * @for Event"," * @method simulate"," * @static"," */","Y.Event.simulate = function(target, type, options){",""," options = options || {};",""," if (mouseEvents[type]){"," 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);"," } else if (keyEvents[type]){"," simulateKeyEvent(target, type, options.bubbles,"," options.cancelable, options.view, options.ctrlKey,"," options.altKey, options.shiftKey, options.metaKey,"," options.keyCode, options.charCode);"," } else if (uiEvents[type]){"," simulateUIEvent(target, type, options.bubbles,"," options.cancelable, options.view, options.detail);"," "," // touch low-level event simulation "," } else if (touchEvents[type]) {"," if((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.phantomjs) && !(Y.UA.chrome && Y.UA.chrome < 6)) {"," simulateTouchEvent(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.touches, options.targetTouches, options.changedTouches,"," options.scale, options.rotation);"," } else {"," Y.error(\"simulate(): Event '\" + type + \"' can't be simulated. Use gesture-simulate module instead.\");"," }",""," // ios gesture low-level event simulation (iOS v2+ only) "," } else if(Y.UA.ios && Y.UA.ios >= 2.0 && gestureEvents[type]) {"," simulateGestureEvent(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.scale, options.rotation);"," "," // anything else"," } else {"," Y.error(\"simulate(): Event '\" + type + \"' can't be simulated.\");"," }","};","","","})();","","","","}, '3.7.2', {\"requires\": [\"event-base\"]});"];+_yuitest_coverage["build/event-simulate/event-simulate.js"].code=["YUI.add('event-simulate', function (Y, NAME) {","","(function() {","/**"," * Simulate user interaction by generating native DOM events."," *"," * @module event-simulate"," * @requires event"," */","","//shortcuts","var L = Y.Lang,"," isFunction = L.isFunction,"," isString = L.isString,"," isBoolean = L.isBoolean,"," isObject = L.isObject,"," isNumber = L.isNumber,",""," //mouse events supported"," mouseEvents = {"," click: 1,"," dblclick: 1,"," mouseover: 1,"," mouseout: 1,"," mousedown: 1,"," mouseup: 1,"," mousemove: 1,"," contextmenu:1"," },",""," //key events supported"," keyEvents = {"," keydown: 1,"," keyup: 1,"," keypress: 1"," },",""," //HTML events supported"," uiEvents = {"," submit: 1,"," blur: 1,"," change: 1,"," focus: 1,"," resize: 1,"," scroll: 1,"," select: 1"," },",""," //events that bubble by default"," bubbleEvents = {"," scroll: 1,"," resize: 1,"," reset: 1,"," submit: 1,"," change: 1,"," select: 1,"," error: 1,"," abort: 1"," },"," "," //touch events supported"," touchEvents = {"," touchstart: 1,"," touchmove: 1,"," touchend: 1, "," touchcancel: 1"," },"," "," gestureEvents = {"," gesturestart: 1,"," gesturechange: 1,"," gestureend: 1"," };","","//all key, mouse and touch events bubble","Y.mix(bubbleEvents, mouseEvents);","Y.mix(bubbleEvents, keyEvents);","Y.mix(bubbleEvents, touchEvents);","","/*"," * Note: Intentionally not for YUIDoc generation."," * 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."," */","function simulateKeyEvent(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"," if (!target){"," Y.error(\"simulateKeyEvent(): Invalid target.\");"," }",""," //check event type"," if (isString(type)){"," type = type.toLowerCase();"," switch(type){"," case \"textevent\": //DOM Level 3"," type = \"keypress\";"," break;"," case \"keyup\":"," case \"keydown\":"," case \"keypress\":"," break;"," default:"," Y.error(\"simulateKeyEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateKeyEvent(): Event type must be a string.\");"," }",""," //setup default values"," if (!isBoolean(bubbles)){"," bubbles = true; //all key events bubble"," }"," if (!isBoolean(cancelable)){"," cancelable = true; //all key events can be cancelled"," }"," if (!isObject(view)){"," view = Y.config.win; //view is typically window"," }"," if (!isBoolean(ctrlKey)){"," ctrlKey = false;"," }"," if (!isBoolean(altKey)){"," altKey = false;"," }"," if (!isBoolean(shiftKey)){"," shiftKey = false;"," }"," if (!isBoolean(metaKey)){"," metaKey = false;"," }"," if (!isNumber(keyCode)){"," keyCode = 0;"," }"," if (!isNumber(charCode)){"," charCode = 0;"," }",""," //try to create a mouse event"," var customEvent /*:MouseEvent*/ = null;",""," //check for DOM-compliant browsers first"," if (isFunction(Y.config.doc.createEvent)){",""," try {",""," //try to create key event"," customEvent = Y.config.doc.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 = Y.config.doc.createEvent(\"Events\");",""," } catch (uierror /*:Error*/){",""," //the above failed, so create a UIEvent for Safari 2.x"," customEvent = Y.config.doc.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 (isObject(Y.config.doc.createEventObject)){ //IE",""," //create an IE event object"," customEvent = Y.config.doc.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 {"," Y.error(\"simulateKeyEvent(): No event simulation framework present.\");"," }","}","","/*"," * Note: Intentionally not for YUIDoc generation."," * 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."," */","function simulateMouseEvent(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"," if (!target){"," Y.error(\"simulateMouseEvent(): Invalid target.\");"," }",""," //check event type"," if (isString(type)){"," type = type.toLowerCase();",""," //make sure it's a supported mouse event"," if (!mouseEvents[type]){"," Y.error(\"simulateMouseEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateMouseEvent(): Event type must be a string.\");"," }",""," //setup default values"," if (!isBoolean(bubbles)){"," bubbles = true; //all mouse events bubble"," }"," if (!isBoolean(cancelable)){"," cancelable = (type != \"mousemove\"); //mousemove is the only one that can't be cancelled"," }"," if (!isObject(view)){"," view = Y.config.win; //view is typically window"," }"," if (!isNumber(detail)){"," detail = 1; //number of mouse clicks must be at least one"," }"," if (!isNumber(screenX)){"," screenX = 0;"," }"," if (!isNumber(screenY)){"," screenY = 0;"," }"," if (!isNumber(clientX)){"," clientX = 0;"," }"," if (!isNumber(clientY)){"," clientY = 0;"," }"," if (!isBoolean(ctrlKey)){"," ctrlKey = false;"," }"," if (!isBoolean(altKey)){"," altKey = false;"," }"," if (!isBoolean(shiftKey)){"," shiftKey = false;"," }"," if (!isBoolean(metaKey)){"," metaKey = false;"," }"," if (!isNumber(button)){"," button = 0;"," }",""," relatedTarget = relatedTarget || null;",""," //try to create a mouse event"," var customEvent /*:MouseEvent*/ = null;",""," //check for DOM-compliant browsers first"," if (isFunction(Y.config.doc.createEvent)){",""," customEvent = Y.config.doc.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 = Y.config.doc.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 (isObject(Y.config.doc.createEventObject)){ //IE",""," //create an IE event object"," customEvent = Y.config.doc.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 {"," Y.error(\"simulateMouseEvent(): No event simulation framework present.\");"," }","}","","/*"," * Note: Intentionally not for YUIDoc generation."," * Simulates a UI 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 simulateHTMLEvent"," * @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."," */","function simulateUIEvent(target /*:HTMLElement*/, type /*:String*/,"," bubbles /*:Boolean*/, cancelable /*:Boolean*/,"," view /*:Window*/, detail /*:int*/) /*:Void*/","{",""," //check target"," if (!target){"," Y.error(\"simulateUIEvent(): Invalid target.\");"," }",""," //check event type"," if (isString(type)){"," type = type.toLowerCase();",""," //make sure it's a supported mouse event"," if (!uiEvents[type]){"," Y.error(\"simulateUIEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateUIEvent(): Event type must be a string.\");"," }",""," //try to create a mouse event"," var customEvent = null;","",""," //setup default values"," if (!isBoolean(bubbles)){"," bubbles = (type in bubbleEvents); //not all events bubble"," }"," if (!isBoolean(cancelable)){"," cancelable = (type == \"submit\"); //submit is the only one that can be cancelled"," }"," if (!isObject(view)){"," view = Y.config.win; //view is typically window"," }"," if (!isNumber(detail)){"," detail = 1; //usually not used but defaulted to this"," }",""," //check for DOM-compliant browsers first"," if (isFunction(Y.config.doc.createEvent)){",""," //just a generic UI Event object is needed"," customEvent = Y.config.doc.createEvent(\"UIEvents\");"," customEvent.initUIEvent(type, bubbles, cancelable, view, detail);",""," //fire the event"," target.dispatchEvent(customEvent);",""," } else if (isObject(Y.config.doc.createEventObject)){ //IE",""," //create an IE event object"," customEvent = Y.config.doc.createEventObject();",""," //assign available properties"," customEvent.bubbles = bubbles;"," customEvent.cancelable = cancelable;"," customEvent.view = view;"," customEvent.detail = detail;",""," //fire the event"," target.fireEvent(\"on\" + type, customEvent);",""," } else {"," Y.error(\"simulateUIEvent(): No event simulation framework present.\");"," }","}","","/*"," * (iOS only) This is for creating native DOM gesture events which only iOS"," * v2.0+ is supporting."," * "," * @method simulateGestureEvent"," * @private"," * @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: touchstart, touchmove, touchend, touchcancel."," * @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"," * touch events except touchcancel can be cancelled. The default"," * is true for all events except touchcancel, 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) Specifies some detail information about "," * the event depending on the type of event."," * @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 {float} scale (iOS v2+ only) The distance between two fingers "," * since the start of an event as a multiplier of the initial distance. "," * The default value is 1.0."," * @param {float} rotation (iOS v2+ only) The delta rotation since the start "," * of an event, in degrees, where clockwise is positive and "," * counter-clockwise is negative. The default value is 0.0. "," */","function simulateGestureEvent(target, type,"," bubbles, // boolean"," cancelable, // boolean"," view, // DOMWindow"," detail, // long"," screenX, screenY, // long"," clientX, clientY, // long"," ctrlKey, altKey, shiftKey, metaKey, // boolean"," scale, // float"," rotation // float",") {"," var customEvent;",""," if(!Y.UA.ios || Y.UA.ios<2.0) {"," Y.error(\"simulateGestureEvent(): Native gesture DOM eventframe is not available in this platform.\");"," }",""," // check taget "," if (!target){"," Y.error(\"simulateGestureEvent(): Invalid target.\");"," }",""," //check event type"," if (Y.Lang.isString(type)) {"," type = type.toLowerCase();",""," //make sure it's a supported touch event"," if (!gestureEvents[type]){"," Y.error(\"simulateTouchEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateGestureEvent(): Event type must be a string.\");"," }",""," // setup default values"," if (!Y.Lang.isBoolean(bubbles)) { bubbles = true; } // bubble by default"," if (!Y.Lang.isBoolean(cancelable)) { cancelable = true; } "," if (!Y.Lang.isObject(view)) { view = Y.config.win; }"," if (!Y.Lang.isNumber(detail)) { detail = 2; } // usually not used."," if (!Y.Lang.isNumber(screenX)) { screenX = 0; }"," if (!Y.Lang.isNumber(screenY)) { screenY = 0; }"," if (!Y.Lang.isNumber(clientX)) { clientX = 0; }"," if (!Y.Lang.isNumber(clientY)) { clientY = 0; }"," if (!Y.Lang.isBoolean(ctrlKey)) { ctrlKey = false; }"," if (!Y.Lang.isBoolean(altKey)) { altKey = false; }"," if (!Y.Lang.isBoolean(shiftKey)){ shiftKey = false; }"," if (!Y.Lang.isBoolean(metaKey)) { metaKey = false; }",""," if (!Y.Lang.isNumber(scale)){ scale = 1.0; }"," if (!Y.Lang.isNumber(rotation)){ rotation = 0.0; }",""," customEvent = Y.config.doc.createEvent(\"GestureEvent\");",""," customEvent.initGestureEvent(type, bubbles, cancelable, view, detail,"," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey,"," target, scale, rotation);",""," target.dispatchEvent(customEvent);","}","","","/*"," * @method simulateTouchEvent"," * @private"," * @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: touchstart, touchmove, touchend, touchcancel."," * @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"," * touch events except touchcancel can be cancelled. The default"," * is true for all events except touchcancel, 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) Specifies some detail information about "," * the event depending on the type of event."," * @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 {TouchList} touches A collection of Touch objects representing "," * all touches associated with this event."," * @param {TouchList} targetTouches A collection of Touch objects "," * representing all touches associated with this target."," * @param {TouchList} changedTouches A collection of Touch objects "," * representing all touches that changed in this event."," * @param {float} scale (iOS v2+ only) The distance between two fingers "," * since the start of an event as a multiplier of the initial distance. "," * The default value is 1.0."," * @param {float} rotation (iOS v2+ only) The delta rotation since the start "," * of an event, in degrees, where clockwise is positive and "," * counter-clockwise is negative. The default value is 0.0. "," */","function simulateTouchEvent(target, type,"," bubbles, // boolean"," cancelable, // boolean"," view, // DOMWindow"," detail, // long"," screenX, screenY, // long"," clientX, clientY, // long"," ctrlKey, altKey, shiftKey, metaKey, // boolean"," touches, // TouchList"," targetTouches, // TouchList"," changedTouches, // TouchList"," scale, // float"," rotation // float",") {",""," var customEvent;",""," // check taget "," if (!target){"," Y.error(\"simulateTouchEvent(): Invalid target.\");"," }",""," //check event type"," if (Y.Lang.isString(type)) {"," type = type.toLowerCase();",""," //make sure it's a supported touch event"," if (!touchEvents[type]){"," Y.error(\"simulateTouchEvent(): Event type '\" + type + \"' not supported.\");"," }"," } else {"," Y.error(\"simulateTouchEvent(): Event type must be a string.\");"," }",""," // note that the caller is responsible to pass appropriate touch objects."," // check touch objects"," // Android(even 4.0) doesn't define TouchList yet"," /*if(type === 'touchstart' || type === 'touchmove') {"," if(!touches instanceof TouchList) {"," Y.error('simulateTouchEvent(): Invalid touches. It must be a TouchList');"," } else {"," if(touches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object found.');"," }"," }"," } else if(type === 'touchend') {"," if(!changedTouches instanceof TouchList) {"," Y.error('simulateTouchEvent(): Invalid touches. It must be a TouchList');"," } else {"," if(changedTouches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object found.');"," }"," }"," }*/",""," if(type === 'touchstart' || type === 'touchmove') {"," if(touches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object in touches');"," }"," } else if(type === 'touchend') {"," if(changedTouches.length === 0) {"," Y.error('simulateTouchEvent(): No touch object in changedTouches');"," }"," }",""," // setup default values"," if (!Y.Lang.isBoolean(bubbles)) { bubbles = true; } // bubble by default."," if (!Y.Lang.isBoolean(cancelable)) { "," cancelable = (type != \"touchcancel\"); // touchcancel is not cancelled "," } "," if (!Y.Lang.isObject(view)) { view = Y.config.win; }"," if (!Y.Lang.isNumber(detail)) { detail = 1; } // usually not used. defaulted to # of touch objects."," if (!Y.Lang.isNumber(screenX)) { screenX = 0; }"," if (!Y.Lang.isNumber(screenY)) { screenY = 0; }"," if (!Y.Lang.isNumber(clientX)) { clientX = 0; }"," if (!Y.Lang.isNumber(clientY)) { clientY = 0; }"," if (!Y.Lang.isBoolean(ctrlKey)) { ctrlKey = false; }"," if (!Y.Lang.isBoolean(altKey)) { altKey = false; }"," if (!Y.Lang.isBoolean(shiftKey)){ shiftKey = false; }"," if (!Y.Lang.isBoolean(metaKey)) { metaKey = false; }"," if (!Y.Lang.isNumber(scale)) { scale = 1.0; }"," if (!Y.Lang.isNumber(rotation)) { rotation = 0.0; }","",""," //check for DOM-compliant browsers first"," if (Y.Lang.isFunction(Y.config.doc.createEvent)) {"," if (Y.UA.android) {"," /**"," * Couldn't find android start version that supports touch event. "," * Assumed supported(btw APIs broken till icecream sandwitch) "," * from the beginning."," */"," if(Y.UA.android < 4.0) {"," /**"," * Touch APIs are broken in androids older than 4.0. We will use "," * simulated touch apis for these versions. "," * App developer still can listen for touch events. This events"," * will be dispatched with touch event types."," * "," * (Note) Used target for the relatedTarget. Need to verify if"," * it has a side effect."," */"," customEvent = Y.config.doc.createEvent(\"MouseEvents\");"," customEvent.initMouseEvent(type, bubbles, cancelable, view, detail, "," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey,"," 0, target);",""," customEvent.touches = touches;"," customEvent.targetTouches = targetTouches;"," customEvent.changedTouches = changedTouches;"," } else {"," customEvent = Y.config.doc.createEvent(\"TouchEvent\");",""," // Andoroid isn't compliant W3C initTouchEvent method signature."," customEvent.initTouchEvent(touches, targetTouches, changedTouches,"," type, view,"," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey);"," }"," } else if (Y.UA.ios) {"," if(Y.UA.ios >= 2.0) {"," customEvent = Y.config.doc.createEvent(\"TouchEvent\");",""," // Available iOS 2.0 and later"," customEvent.initTouchEvent(type, bubbles, cancelable, view, detail,"," screenX, screenY, clientX, clientY,"," ctrlKey, altKey, shiftKey, metaKey,"," touches, targetTouches, changedTouches,"," scale, rotation);"," } else {"," Y.error('simulateTouchEvent(): No touch event simulation framework present for iOS, '+Y.UA.ios+'.');"," }"," } else {"," Y.error('simulateTouchEvent(): Not supported agent yet, '+Y.UA.userAgent);"," }",""," //fire the event"," target.dispatchEvent(customEvent);"," //} else if (Y.Lang.isObject(doc.createEventObject)){ // Windows Mobile/IE, support later "," } else {"," Y.error('simulateTouchEvent(): No event simulation framework present.');"," }","}","","/**"," * Simulates the event or gesture with the given name on a target."," * @param {HTMLElement} target The DOM element that's the target of the event."," * @param {String} type The type of event or name of the supported gesture to simulate "," * (i.e., \"click\", \"doubletap\", \"flick\")."," * @param {Object} options (Optional) Extra options to copy onto the event object. "," * For gestures, options are used to refine the gesture behavior."," * @return {void}"," * @for Event"," * @method simulate"," * @static"," */","Y.Event.simulate = function(target, type, options){",""," options = options || {};",""," if (mouseEvents[type]){"," 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);"," } else if (keyEvents[type]){"," simulateKeyEvent(target, type, options.bubbles,"," options.cancelable, options.view, options.ctrlKey,"," options.altKey, options.shiftKey, options.metaKey,"," options.keyCode, options.charCode);"," } else if (uiEvents[type]){"," simulateUIEvent(target, type, options.bubbles,"," options.cancelable, options.view, options.detail);"," "," // touch low-level event simulation "," } else if (touchEvents[type]) {"," if((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.phantomjs) && !(Y.UA.chrome && Y.UA.chrome < 6)) {"," simulateTouchEvent(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.touches, options.targetTouches, options.changedTouches,"," options.scale, options.rotation);"," } else {"," Y.error(\"simulate(): Event '\" + type + \"' can't be simulated. Use gesture-simulate module instead.\");"," }",""," // ios gesture low-level event simulation (iOS v2+ only) "," } else if(Y.UA.ios && Y.UA.ios >= 2.0 && gestureEvents[type]) {"," simulateGestureEvent(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.scale, options.rotation);"," "," // anything else"," } else {"," Y.error(\"simulate(): Event '\" + type + \"' can't be simulated.\");"," }","};","","","})();","","","","}, '3.7.3', {\"requires\": [\"event-base\"]});"]; _yuitest_coverage["build/event-simulate/event-simulate.js"].lines = {"1":0,"3":0,"12":0,"76":0,"77":0,"78":0,"115":0,"123":0,"124":0,"128":0,"129":0,"130":0,"132":0,"133":0,"137":0,"139":0,"142":0,"146":0,"147":0,"149":0,"150":0,"152":0,"153":0,"155":0,"156":0,"158":0,"159":0,"161":0,"162":0,"164":0,"165":0,"167":0,"168":0,"170":0,"171":0,"175":0,"178":0,"180":0,"183":0,"194":0,"208":0,"211":0,"216":0,"220":0,"223":0,"224":0,"225":0,"226":0,"227":0,"228":0,"229":0,"236":0,"238":0,"241":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"257":0,"260":0,"263":0,"318":0,"329":0,"330":0,"334":0,"335":0,"338":0,"339":0,"342":0,"346":0,"347":0,"349":0,"350":0,"352":0,"353":0,"355":0,"356":0,"358":0,"359":0,"361":0,"362":0,"364":0,"365":0,"367":0,"368":0,"370":0,"371":0,"373":0,"374":0,"376":0,"377":0,"379":0,"380":0,"382":0,"383":0,"386":0,"389":0,"392":0,"394":0,"397":0,"398":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"415":0,"416":0,"417":0,"418":0,"430":0,"431":0,"432":0,"433":0,"434":0,"439":0,"441":0,"444":0,"447":0,"448":0,"449":0,"450":0,"451":0,"452":0,"453":0,"454":0,"455":0,"456":0,"457":0,"458":0,"461":0,"463":0,"464":0,"466":0,"467":0,"470":0,"472":0,"480":0,"483":0,"486":0,"516":0,"522":0,"523":0,"527":0,"528":0,"531":0,"532":0,"535":0,"539":0,"543":0,"544":0,"546":0,"547":0,"549":0,"550":0,"552":0,"553":0,"557":0,"560":0,"561":0,"564":0,"566":0,"569":0,"572":0,"573":0,"574":0,"575":0,"578":0,"581":0,"629":0,"640":0,"642":0,"643":0,"647":0,"648":0,"652":0,"653":0,"656":0,"657":0,"660":0,"664":0,"665":0,"666":0,"667":0,"668":0,"669":0,"670":0,"671":0,"672":0,"673":0,"674":0,"675":0,"677":0,"678":0,"680":0,"682":0,"687":0,"738":0,"753":0,"756":0,"757":0,"761":0,"762":0,"765":0,"766":0,"769":0,"793":0,"794":0,"795":0,"797":0,"798":0,"799":0,"804":0,"805":0,"806":0,"808":0,"809":0,"810":0,"811":0,"812":0,"813":0,"814":0,"815":0,"816":0,"817":0,"818":0,"819":0,"823":0,"824":0,"830":0,"840":0,"841":0,"846":0,"847":0,"848":0,"850":0,"853":0,"858":0,"859":0,"860":0,"863":0,"869":0,"872":0,"876":0,"879":0,"895":0,"897":0,"899":0,"900":0,"905":0,"906":0,"910":0,"911":0,"915":0,"916":0,"917":0,"924":0,"928":0,"929":0,"937":0}; _yuitest_coverage["build/event-simulate/event-simulate.js"].functions = {"simulateKeyEvent:115":0,"simulateMouseEvent:318":0,"simulateUIEvent:516":0,"simulateGestureEvent:629":0,"simulateTouchEvent:738":0,"simulate:895":0,"(anonymous 2):3":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-simulate/event-simulate.js"].coveredLines = 268;@@ -1258,4 +1258,4 @@ -}, '3.7.2', {"requires": ["event-base"]});+}, '3.7.3', {"requires": ["event-base"]});
bundle/event-simulate/event-simulate-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -949,4 +949,4 @@ -}, '3.7.2', {"requires": ["event-base"]});+}, '3.7.3', {"requires": ["event-base"]});
bundle/event-simulate/event-simulate-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-simulate",function(e,t){(function(){function p(t,u,a,f,l,c,h,p,d,v,m){t||e.error("simulateKeyEvent(): Invalid target.");if(r(u)){u=u.toLowerCase();switch(u){case"textevent":u="keypress";break;case"keyup":case"keydown":case"keypress":break;default:e.error("simulateKeyEvent(): Event type '"+u+"' not supported.")}}else e.error("simulateKeyEvent(): Event type must be a string.");i(a)||(a=!0),i(f)||(f=!0),s(l)||(l=e.config.win),i(c)||(c=!1),i(h)||(h=!1),i(p)||(p=!1),i(d)||(d=!1),o(v)||(v=0),o(m)||(m=0);var g=null;if(n(e.config.doc.createEvent)){try{g=e.config.doc.createEvent("KeyEvents"),g.initKeyEvent(u,a,f,l,c,h,p,d,v,m)}catch(y){try{g=e.config.doc.createEvent("Events")}catch(b){g=e.config.doc.createEvent("UIEvents")}finally{g.initEvent(u,a,f),g.view=l,g.altKey=h,g.ctrlKey=c,g.shiftKey=p,g.metaKey=d,g.keyCode=v,g.charCode=m}}t.dispatchEvent(g)}else s(e.config.doc.createEventObject)?(g=e.config.doc.createEventObject(),g.bubbles=a,g.cancelable=f,g.view=l,g.ctrlKey=c,g.altKey=h,g.shiftKey=p,g.metaKey=d,g.keyCode=m>0?m:v,t.fireEvent("on"+u,g)):e.error("simulateKeyEvent(): No event simulation framework present.")}function d(t,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S){t||e.error("simulateMouseEvent(): Invalid target."),r(a)?(a=a.toLowerCase(),u[a]||e.error("simulateMouseEvent(): Event type '"+a+"' not supported.")):e.error("simulateMouseEvent(): Event type must be a string."),i(f)||(f=!0),i(l)||(l=a!="mousemove"),s(c)||(c=e.config.win),o(h)||(h=1),o(p)||(p=0),o(d)||(d=0),o(v)||(v=0),o(m)||(m=0),i(g)||(g=!1),i(y)||(y=!1),i(b)||(b=!1),i(w)||(w=!1),o(E)||(E=0),S=S||null;var x=null;if(n(e.config.doc.createEvent))x=e.config.doc.createEvent("MouseEvents"),x.initMouseEvent?x.initMouseEvent(a,f,l,c,h,p,d,v,m,g,y,b,w,E,S):(x=e.config.doc.createEvent("UIEvents"),x.initEvent(a,f,l),x.view=c,x.detail=h,x.screenX=p,x.screenY=d,x.clientX=v,x.clientY=m,x.ctrlKey=g,x.altKey=y,x.metaKey=w,x.shiftKey=b,x.button=E,x.relatedTarget=S),S&&!x.relatedTarget&&(a=="mouseout"?x.toElement=S:a=="mouseover"&&(x.fromElement=S)),t.dispatchEvent(x);else if(s(e.config.doc.createEventObject)){x=e.config.doc.createEventObject(),x.bubbles=f,x.cancelable=l,x.view=c,x.detail=h,x.screenX=p,x.screenY=d,x.clientX=v,x.clientY=m,x.ctrlKey=g,x.altKey=y,x.metaKey=w,x.shiftKey=b;switch(E){case 0:x.button=1;break;case 1:x.button=4;break;case 2:break;default:x.button=0}x.relatedTarget=S,t.fireEvent("on"+a,x)}else e.error("simulateMouseEvent(): No event simulation framework present.")}function v(t,u,a,c,h,p){t||e.error("simulateUIEvent(): Invalid target."),r(u)?(u=u.toLowerCase(),f[u]||e.error("simulateUIEvent(): Event type '"+u+"' not supported.")):e.error("simulateUIEvent(): Event type must be a string.");var d=null;i(a)||(a=u in l),i(c)||(c=u=="submit"),s(h)||(h=e.config.win),o(p)||(p=1),n(e.config.doc.createEvent)?(d=e.config.doc.createEvent("UIEvents"),d.initUIEvent(u,a,c,h,p),t.dispatchEvent(d)):s(e.config.doc.createEventObject)?(d=e.config.doc.createEventObject(),d.bubbles=a,d.cancelable=c,d.view=h,d.detail=p,t.fireEvent("on"+u,d)):e.error("simulateUIEvent(): No event simulation framework present.")}function m(t,n,r,i,s,o,u,a,f,l,c,p,d,v,m,g){var y;(!e.UA.ios||e.UA.ios<2)&&e.error("simulateGestureEvent(): Native gesture DOM eventframe is not available in this platform."),t||e.error("simulateGestureEvent(): Invalid target."),e.Lang.isString(n)?(n=n.toLowerCase(),h[n]||e.error("simulateTouchEvent(): Event type '"+n+"' not supported.")):e.error("simulateGestureEvent(): Event type must be a string."),e.Lang.isBoolean(r)||(r=!0),e.Lang.isBoolean(i)||(i=!0),e.Lang.isObject(s)||(s=e.config.win),e.Lang.isNumber(o)||(o=2),e.Lang.isNumber(u)||(u=0),e.Lang.isNumber(a)||(a=0),e.Lang.isNumber(f)||(f=0),e.Lang.isNumber(l)||(l=0),e.Lang.isBoolean(c)||(c=!1),e.Lang.isBoolean(p)||(p=!1),e.Lang.isBoolean(d)||(d=!1),e.Lang.isBoolean(v)||(v=!1),e.Lang.isNumber(m)||(m=1),e.Lang.isNumber(g)||(g=0),y=e.config.doc.createEvent("GestureEvent"),y.initGestureEvent(n,r,i,s,o,u,a,f,l,c,p,d,v,t,m,g),t.dispatchEvent(y)}function g(t,n,r,i,s,o,u,a,f,l,h,p,d,v,m,g,y,b,w){var E;t||e.error("simulateTouchEvent(): Invalid target."),e.Lang.isString(n)?(n=n.toLowerCase(),c[n]||e.error("simulateTouchEvent(): Event type '"+n+"' not supported.")):e.error("simulateTouchEvent(): Event type must be a string."),n==="touchstart"||n==="touchmove"?m.length===0&&e.error("simulateTouchEvent(): No touch object in touches"):n==="touchend"&&y.length===0&&e.error("simulateTouchEvent(): No touch object in changedTouches"),e.Lang.isBoolean(r)||(r=!0),e.Lang.isBoolean(i)||(i=n!="touchcancel"),e.Lang.isObject(s)||(s=e.config.win),e.Lang.isNumber(o)||(o=1),e.Lang.isNumber(u)||(u=0),e.Lang.isNumber(a)||(a=0),e.Lang.isNumber(f)||(f=0),e.Lang.isNumber(l)||(l=0),e.Lang.isBoolean(h)||(h=!1),e.Lang.isBoolean(p)||(p=!1),e.Lang.isBoolean(d)||(d=!1),e.Lang.isBoolean(v)||(v=!1),e.Lang.isNumber(b)||(b=1),e.Lang.isNumber(w)||(w=0),e.Lang.isFunction(e.config.doc.createEvent)?(e.UA.android?e.UA.android<4?(E=e.config.doc.createEvent("MouseEvents"),E.initMouseEvent(n,r,i,s,o,u,a,f,l,h,p,d,v,0,t),E.touches=m,E.targetTouches=g,E.changedTouches=y):(E=e.config.doc.createEvent("TouchEvent"),E.initTouchEvent(m,g,y,n,s,u,a,f,l,h,p,d,v)):e.UA.ios?e.UA.ios>=2?(E=e.config.doc.createEvent("TouchEvent"),E.initTouchEvent(n,r,i,s,o,u,a,f,l,h,p,d,v,m,g,y,b,w)):e.error("simulateTouchEvent(): No touch event simulation framework present for iOS, "+e.UA.ios+"."):e.error("simulateTouchEvent(): Not supported agent yet, "+e.UA.userAgent),t.dispatchEvent(E)):e.error("simulateTouchEvent(): No event simulation framework present.")}var t=e.Lang,n=t.isFunction,r=t.isString,i=t.isBoolean,s=t.isObject,o=t.isNumber,u={click:1,dblclick:1,mouseover:1,mouseout:1,mousedown:1,mouseup:1,mousemove:1,contextmenu:1},a={keydown:1,keyup:1,keypress:1},f={submit:1,blur:1,change:1,focus:1,resize:1,scroll:1,select:1},l={scroll:1,resize:1,reset:1,submit:1,change:1,select:1,error:1,abort:1},c={touchstart:1,touchmove:1,touchend:1,touchcancel:1},h={gesturestart:1,gesturechange:1,gestureend:1};e.mix(l,u),e.mix(l,a),e.mix(l,c),e.Event.simulate=function(t,n,r){r=r||{},u[n]?d(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget):a[n]?p(t,n,r.bubbles,r.cancelable,r.view,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode):f[n]?v(t,n,r.bubbles,r.cancelable,r.view,r.detail):c[n]?e.config.win&&"ontouchstart"in e.config.win&&!e.UA.phantomjs&&!(e.UA.chrome&&e.UA.chrome<6)?g(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.touches,r.targetTouches,r.changedTouches,r.scale,r.rotation):e.error("simulate(): Event '"+n+"' can't be simulated. Use gesture-simulate module instead."):e.UA.ios&&e.UA.ios>=2&&h[n]?m(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.scale,r.rotation):e.error("simulate(): Event '"+n+"' can't be simulated.")}})()},"3.7.2",{requires:["event-base"]});+YUI.add("event-simulate",function(e,t){(function(){function p(t,u,a,f,l,c,h,p,d,v,m){t||e.error("simulateKeyEvent(): Invalid target.");if(r(u)){u=u.toLowerCase();switch(u){case"textevent":u="keypress";break;case"keyup":case"keydown":case"keypress":break;default:e.error("simulateKeyEvent(): Event type '"+u+"' not supported.")}}else e.error("simulateKeyEvent(): Event type must be a string.");i(a)||(a=!0),i(f)||(f=!0),s(l)||(l=e.config.win),i(c)||(c=!1),i(h)||(h=!1),i(p)||(p=!1),i(d)||(d=!1),o(v)||(v=0),o(m)||(m=0);var g=null;if(n(e.config.doc.createEvent)){try{g=e.config.doc.createEvent("KeyEvents"),g.initKeyEvent(u,a,f,l,c,h,p,d,v,m)}catch(y){try{g=e.config.doc.createEvent("Events")}catch(b){g=e.config.doc.createEvent("UIEvents")}finally{g.initEvent(u,a,f),g.view=l,g.altKey=h,g.ctrlKey=c,g.shiftKey=p,g.metaKey=d,g.keyCode=v,g.charCode=m}}t.dispatchEvent(g)}else s(e.config.doc.createEventObject)?(g=e.config.doc.createEventObject(),g.bubbles=a,g.cancelable=f,g.view=l,g.ctrlKey=c,g.altKey=h,g.shiftKey=p,g.metaKey=d,g.keyCode=m>0?m:v,t.fireEvent("on"+u,g)):e.error("simulateKeyEvent(): No event simulation framework present.")}function d(t,a,f,l,c,h,p,d,v,m,g,y,b,w,E,S){t||e.error("simulateMouseEvent(): Invalid target."),r(a)?(a=a.toLowerCase(),u[a]||e.error("simulateMouseEvent(): Event type '"+a+"' not supported.")):e.error("simulateMouseEvent(): Event type must be a string."),i(f)||(f=!0),i(l)||(l=a!="mousemove"),s(c)||(c=e.config.win),o(h)||(h=1),o(p)||(p=0),o(d)||(d=0),o(v)||(v=0),o(m)||(m=0),i(g)||(g=!1),i(y)||(y=!1),i(b)||(b=!1),i(w)||(w=!1),o(E)||(E=0),S=S||null;var x=null;if(n(e.config.doc.createEvent))x=e.config.doc.createEvent("MouseEvents"),x.initMouseEvent?x.initMouseEvent(a,f,l,c,h,p,d,v,m,g,y,b,w,E,S):(x=e.config.doc.createEvent("UIEvents"),x.initEvent(a,f,l),x.view=c,x.detail=h,x.screenX=p,x.screenY=d,x.clientX=v,x.clientY=m,x.ctrlKey=g,x.altKey=y,x.metaKey=w,x.shiftKey=b,x.button=E,x.relatedTarget=S),S&&!x.relatedTarget&&(a=="mouseout"?x.toElement=S:a=="mouseover"&&(x.fromElement=S)),t.dispatchEvent(x);else if(s(e.config.doc.createEventObject)){x=e.config.doc.createEventObject(),x.bubbles=f,x.cancelable=l,x.view=c,x.detail=h,x.screenX=p,x.screenY=d,x.clientX=v,x.clientY=m,x.ctrlKey=g,x.altKey=y,x.metaKey=w,x.shiftKey=b;switch(E){case 0:x.button=1;break;case 1:x.button=4;break;case 2:break;default:x.button=0}x.relatedTarget=S,t.fireEvent("on"+a,x)}else e.error("simulateMouseEvent(): No event simulation framework present.")}function v(t,u,a,c,h,p){t||e.error("simulateUIEvent(): Invalid target."),r(u)?(u=u.toLowerCase(),f[u]||e.error("simulateUIEvent(): Event type '"+u+"' not supported.")):e.error("simulateUIEvent(): Event type must be a string.");var d=null;i(a)||(a=u in l),i(c)||(c=u=="submit"),s(h)||(h=e.config.win),o(p)||(p=1),n(e.config.doc.createEvent)?(d=e.config.doc.createEvent("UIEvents"),d.initUIEvent(u,a,c,h,p),t.dispatchEvent(d)):s(e.config.doc.createEventObject)?(d=e.config.doc.createEventObject(),d.bubbles=a,d.cancelable=c,d.view=h,d.detail=p,t.fireEvent("on"+u,d)):e.error("simulateUIEvent(): No event simulation framework present.")}function m(t,n,r,i,s,o,u,a,f,l,c,p,d,v,m,g){var y;(!e.UA.ios||e.UA.ios<2)&&e.error("simulateGestureEvent(): Native gesture DOM eventframe is not available in this platform."),t||e.error("simulateGestureEvent(): Invalid target."),e.Lang.isString(n)?(n=n.toLowerCase(),h[n]||e.error("simulateTouchEvent(): Event type '"+n+"' not supported.")):e.error("simulateGestureEvent(): Event type must be a string."),e.Lang.isBoolean(r)||(r=!0),e.Lang.isBoolean(i)||(i=!0),e.Lang.isObject(s)||(s=e.config.win),e.Lang.isNumber(o)||(o=2),e.Lang.isNumber(u)||(u=0),e.Lang.isNumber(a)||(a=0),e.Lang.isNumber(f)||(f=0),e.Lang.isNumber(l)||(l=0),e.Lang.isBoolean(c)||(c=!1),e.Lang.isBoolean(p)||(p=!1),e.Lang.isBoolean(d)||(d=!1),e.Lang.isBoolean(v)||(v=!1),e.Lang.isNumber(m)||(m=1),e.Lang.isNumber(g)||(g=0),y=e.config.doc.createEvent("GestureEvent"),y.initGestureEvent(n,r,i,s,o,u,a,f,l,c,p,d,v,t,m,g),t.dispatchEvent(y)}function g(t,n,r,i,s,o,u,a,f,l,h,p,d,v,m,g,y,b,w){var E;t||e.error("simulateTouchEvent(): Invalid target."),e.Lang.isString(n)?(n=n.toLowerCase(),c[n]||e.error("simulateTouchEvent(): Event type '"+n+"' not supported.")):e.error("simulateTouchEvent(): Event type must be a string."),n==="touchstart"||n==="touchmove"?m.length===0&&e.error("simulateTouchEvent(): No touch object in touches"):n==="touchend"&&y.length===0&&e.error("simulateTouchEvent(): No touch object in changedTouches"),e.Lang.isBoolean(r)||(r=!0),e.Lang.isBoolean(i)||(i=n!="touchcancel"),e.Lang.isObject(s)||(s=e.config.win),e.Lang.isNumber(o)||(o=1),e.Lang.isNumber(u)||(u=0),e.Lang.isNumber(a)||(a=0),e.Lang.isNumber(f)||(f=0),e.Lang.isNumber(l)||(l=0),e.Lang.isBoolean(h)||(h=!1),e.Lang.isBoolean(p)||(p=!1),e.Lang.isBoolean(d)||(d=!1),e.Lang.isBoolean(v)||(v=!1),e.Lang.isNumber(b)||(b=1),e.Lang.isNumber(w)||(w=0),e.Lang.isFunction(e.config.doc.createEvent)?(e.UA.android?e.UA.android<4?(E=e.config.doc.createEvent("MouseEvents"),E.initMouseEvent(n,r,i,s,o,u,a,f,l,h,p,d,v,0,t),E.touches=m,E.targetTouches=g,E.changedTouches=y):(E=e.config.doc.createEvent("TouchEvent"),E.initTouchEvent(m,g,y,n,s,u,a,f,l,h,p,d,v)):e.UA.ios?e.UA.ios>=2?(E=e.config.doc.createEvent("TouchEvent"),E.initTouchEvent(n,r,i,s,o,u,a,f,l,h,p,d,v,m,g,y,b,w)):e.error("simulateTouchEvent(): No touch event simulation framework present for iOS, "+e.UA.ios+"."):e.error("simulateTouchEvent(): Not supported agent yet, "+e.UA.userAgent),t.dispatchEvent(E)):e.error("simulateTouchEvent(): No event simulation framework present.")}var t=e.Lang,n=t.isFunction,r=t.isString,i=t.isBoolean,s=t.isObject,o=t.isNumber,u={click:1,dblclick:1,mouseover:1,mouseout:1,mousedown:1,mouseup:1,mousemove:1,contextmenu:1},a={keydown:1,keyup:1,keypress:1},f={submit:1,blur:1,change:1,focus:1,resize:1,scroll:1,select:1},l={scroll:1,resize:1,reset:1,submit:1,change:1,select:1,error:1,abort:1},c={touchstart:1,touchmove:1,touchend:1,touchcancel:1},h={gesturestart:1,gesturechange:1,gestureend:1};e.mix(l,u),e.mix(l,a),e.mix(l,c),e.Event.simulate=function(t,n,r){r=r||{},u[n]?d(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget):a[n]?p(t,n,r.bubbles,r.cancelable,r.view,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.keyCode,r.charCode):f[n]?v(t,n,r.bubbles,r.cancelable,r.view,r.detail):c[n]?e.config.win&&"ontouchstart"in e.config.win&&!e.UA.phantomjs&&!(e.UA.chrome&&e.UA.chrome<6)?g(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.touches,r.targetTouches,r.changedTouches,r.scale,r.rotation):e.error("simulate(): Event '"+n+"' can't be simulated. Use gesture-simulate module instead."):e.UA.ios&&e.UA.ios>=2&&h[n]?m(t,n,r.bubbles,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.scale,r.rotation):e.error("simulate(): Event '"+n+"' can't be simulated.")}})()},"3.7.3",{requires:["event-base"]});
bundle/event-simulate/event-simulate.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -949,4 +949,4 @@ -}, '3.7.2', {"requires": ["event-base"]});+}, '3.7.3', {"requires": ["event-base"]});
bundle/event-synthetic/event-synthetic-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-synthetic/event-synthetic.js", code: [] };-_yuitest_coverage["build/event-synthetic/event-synthetic.js"].code=["YUI.add('event-synthetic', function (Y, NAME) {","","/**"," * Define new DOM events that can be subscribed to from Nodes."," *"," * @module event"," * @submodule event-synthetic"," */","var CustomEvent = Y.CustomEvent,"," DOMMap = Y.Env.evt.dom_map,"," toArray = Y.Array,"," YLang = Y.Lang,"," isObject = YLang.isObject,"," isString = YLang.isString,"," isArray = YLang.isArray,"," query = Y.Selector.query,"," noop = function () {};","","/**"," * <p>The triggering mechanism used by SyntheticEvents.</p>"," *"," * <p>Implementers should not instantiate these directly. Use the Notifier"," * provided to the event's implemented <code>on(node, sub, notifier)</code> or"," * <code>delegate(node, sub, notifier, filter)</code> methods.</p>"," *"," * @class SyntheticEvent.Notifier"," * @constructor"," * @param handle {EventHandle} the detach handle for the subscription to an"," * internal custom event used to execute the callback passed to"," * on(..) or delegate(..)"," * @param emitFacade {Boolean} take steps to ensure the first arg received by"," * the subscription callback is an event facade"," * @private"," * @since 3.2.0"," */","function Notifier(handle, emitFacade) {"," this.handle = handle;"," this.emitFacade = emitFacade;","}","","/**"," * <p>Executes the subscription callback, passing the firing arguments as the"," * first parameters to that callback. For events that are configured with"," * emitFacade=true, it is common practice to pass the triggering DOMEventFacade"," * as the first parameter. Barring a proper DOMEventFacade or EventFacade"," * (from a CustomEvent), a new EventFacade will be generated. In that case, if"," * fire() is called with a simple object, it will be mixed into the facade."," * Otherwise, the facade will be prepended to the callback parameters.</p>"," *"," * <p>For notifiers provided to delegate logic, the first argument should be an"," * object with a "currentTarget" property to identify what object to"," * default as 'this' in the callback. Typically this is gleaned from the"," * DOMEventFacade or EventFacade, but if configured with emitFacade=false, an"," * object must be provided. In that case, the object will be removed from the"," * callback parameters.</p>"," *"," * <p>Additional arguments passed during event subscription will be"," * automatically added after those passed to fire().</p>"," *"," * @method fire"," * @param e {EventFacade|DOMEventFacade|Object|any} (see description)"," * @param arg* {any} additional arguments received by all subscriptions"," * @private"," */","Notifier.prototype.fire = function (e) {"," // first arg to delegate notifier should be an object with currentTarget"," var args = toArray(arguments, 0, true),"," handle = this.handle,"," ce = handle.evt,"," sub = handle.sub,"," thisObj = sub.context,"," delegate = sub.filter,"," event = e || {},"," ret;",""," if (this.emitFacade) {"," if (!e || !e.preventDefault) {"," event = ce._getFacade();",""," if (isObject(e) && !e.preventDefault) {"," Y.mix(event, e, true);"," args[0] = event;"," } else {"," args.unshift(event);"," }"," }",""," event.type = ce.type;"," event.details = args.slice();",""," if (delegate) {"," event.container = ce.host;"," }"," } else if (delegate && isObject(e) && e.currentTarget) {"," args.shift();"," }",""," sub.context = thisObj || event.currentTarget || ce.host;"," ret = ce.fire.apply(ce, args);"," sub.context = thisObj; // reset for future firing",""," // to capture callbacks that return false to stopPropagation."," // Useful for delegate implementations"," return ret;","};","","/**"," * Manager object for synthetic event subscriptions to aggregate multiple synths on the same node without colliding with actual DOM subscription entries in the global map of DOM subscriptions. Also facilitates proper cleanup on page unload."," *"," * @class SynthRegistry"," * @constructor"," * @param el {HTMLElement} the DOM element"," * @param yuid {String} the yuid stamp for the element"," * @param key {String} the generated id token used to identify an event type +"," * element in the global DOM subscription map."," * @private"," */","function SynthRegistry(el, yuid, key) {"," this.handles = [];"," this.el = el;"," this.key = key;"," this.domkey = yuid;","}","","SynthRegistry.prototype = {"," constructor: SynthRegistry,",""," // A few object properties to fake the CustomEvent interface for page"," // unload cleanup. DON'T TOUCH!"," type : '_synth',"," fn : noop,"," capture : false,",""," /**"," * Adds a subscription from the Notifier registry."," *"," * @method register"," * @param handle {EventHandle} the subscription"," * @since 3.4.0"," */"," register: function (handle) {"," handle.evt.registry = this;"," this.handles.push(handle);"," },",""," /**"," * Removes the subscription from the Notifier registry."," *"," * @method _unregisterSub"," * @param sub {Subscription} the subscription"," * @since 3.4.0"," */"," unregister: function (sub) {"," var handles = this.handles,"," events = DOMMap[this.domkey],"," i;",""," for (i = handles.length - 1; i >= 0; --i) {"," if (handles[i].sub === sub) {"," handles.splice(i, 1);"," break;"," }"," }",""," // Clean up left over objects when there are no more subscribers."," if (!handles.length) {"," delete events[this.key];"," if (!Y.Object.size(events)) {"," delete DOMMap[this.domkey];"," }"," }"," },",""," /**"," * Used by the event system's unload cleanup process. When navigating"," * away from the page, the event system iterates the global map of element"," * subscriptions and detaches everything using detachAll(). Normally,"," * the map is populated with custom events, so this object needs to"," * at least support the detachAll method to duck type its way to"," * cleanliness."," *"," * @method detachAll"," * @private"," * @since 3.4.0"," */"," detachAll : function () {"," var handles = this.handles,"," i = handles.length;",""," while (--i >= 0) {"," handles[i].detach();"," }"," }","};","","/**"," * <p>Wrapper class for the integration of new events into the YUI event"," * infrastructure. Don't instantiate this object directly, use"," * <code>Y.Event.define(type, config)</code>. See that method for details.</p>"," *"," * <p>Properties that MAY or SHOULD be specified in the configuration are noted"," * below and in the description of <code>Y.Event.define</code>.</p>"," *"," * @class SyntheticEvent"," * @constructor"," * @param cfg {Object} Implementation pieces and configuration"," * @since 3.1.0"," * @in event-synthetic"," */","function SyntheticEvent() {"," this._init.apply(this, arguments);","}","","Y.mix(SyntheticEvent, {"," Notifier: Notifier,"," SynthRegistry: SynthRegistry,",""," /**"," * Returns the array of subscription handles for a node for the given event"," * type. Passing true as the third argument will create a registry entry"," * in the event system's DOM map to host the array if one doesn't yet exist."," *"," * @method getRegistry"," * @param node {Node} the node"," * @param type {String} the event"," * @param create {Boolean} create a registration entry to host a new array"," * if one doesn't exist."," * @return {Array}"," * @static"," * @protected"," * @since 3.2.0"," */"," getRegistry: function (node, type, create) {"," var el = node._node,"," yuid = Y.stamp(el),"," key = 'event:' + yuid + type + '_synth',"," events = DOMMap[yuid];"," "," if (create) {"," if (!events) {"," events = DOMMap[yuid] = {};"," }"," if (!events[key]) {"," events[key] = new SynthRegistry(el, yuid, key);"," }"," }",""," return (events && events[key]) || null;"," },",""," /**"," * Alternate <code>_delete()</code> method for the CustomEvent object"," * created to manage SyntheticEvent subscriptions."," *"," * @method _deleteSub"," * @param sub {Subscription} the subscription to clean up"," * @private"," * @since 3.2.0"," */"," _deleteSub: function (sub) {"," if (sub && sub.fn) {"," var synth = this.eventDef,"," method = (sub.filter) ? 'detachDelegate' : 'detach';",""," this._subscribers = [];",""," if (CustomEvent.keepDeprecatedSubs) {"," this.subscribers = {};"," }",""," synth[method](sub.node, sub, this.notifier, sub.filter);"," this.registry.unregister(sub);",""," delete sub.fn;"," delete sub.node;"," delete sub.context;"," }"," },",""," prototype: {"," constructor: SyntheticEvent,",""," /**"," * Construction logic for the event."," *"," * @method _init"," * @protected"," */"," _init: function () {"," var config = this.publishConfig || (this.publishConfig = {});",""," // The notification mechanism handles facade creation"," this.emitFacade = ('emitFacade' in config) ?"," config.emitFacade :"," true;"," config.emitFacade = false;"," },",""," /**"," * <p>Implementers MAY provide this method definition.</p>"," *"," * <p>Implement this function if the event supports a different"," * subscription signature. This function is used by both"," * <code>on()</code> and <code>delegate()</code>. The second parameter"," * indicates that the event is being subscribed via"," * <code>delegate()</code>.</p>"," *"," * <p>Implementations must remove extra arguments from the args list"," * before returning. The required args for <code>on()</code>"," * subscriptions are</p>"," * <pre><code>[type, callback, target, context, argN...]</code></pre>"," *"," * <p>The required args for <code>delegate()</code>"," * subscriptions are</p>"," *"," * <pre><code>[type, callback, target, filter, context, argN...]</code></pre>"," *"," * <p>The return value from this function will be stored on the"," * subscription in the '_extra' property for reference elsewhere.</p>"," *"," * @method processArgs"," * @param args {Array} parmeters passed to Y.on(..) or Y.delegate(..)"," * @param delegate {Boolean} true if the subscription is from Y.delegate"," * @return {any}"," */"," processArgs: noop,",""," /**"," * <p>Implementers MAY override this property.</p>"," *"," * <p>Whether to prevent multiple subscriptions to this event that are"," * classified as being the same. By default, this means the subscribed"," * callback is the same function. See the <code>subMatch</code>"," * method. Setting this to true will impact performance for high volume"," * events.</p>"," *"," * @property preventDups"," * @type {Boolean}"," * @default false"," */"," //preventDups : false,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * Implementation logic for subscriptions done via <code>node.on(type,"," * fn)</code> or <code>Y.on(type, fn, target)</code>. This"," * function should set up the monitor(s) that will eventually fire the"," * event. Typically this involves subscribing to at least one DOM"," * event. It is recommended to store detach handles from any DOM"," * subscriptions to make for easy cleanup in the <code>detach</code>"," * method. Typically these handles are added to the <code>sub</code>"," * object. Also for SyntheticEvents that leverage a single DOM"," * subscription under the hood, it is recommended to pass the DOM event"," * object to <code>notifier.fire(e)</code>. (The event name on the"," * object will be updated)."," *"," * @method on"," * @param node {Node} the node the subscription is being applied to"," * @param sub {Subscription} the object to track this subscription"," * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to"," * trigger the execution of the subscribers"," */"," on: noop,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * <p>Implementation logic for detaching subscriptions done via"," * <code>node.on(type, fn)</code>. This function should clean up any"," * subscriptions made in the <code>on()</code> phase.</p>"," *"," * @method detach"," * @param node {Node} the node the subscription was applied to"," * @param sub {Subscription} the object tracking this subscription"," * @param notifier {SyntheticEvent.Notifier} the Notifier used to"," * trigger the execution of the subscribers"," */"," detach: noop,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * <p>Implementation logic for subscriptions done via"," * <code>node.delegate(type, fn, filter)</code> or"," * <code>Y.delegate(type, fn, container, filter)</code>. Like with"," * <code>on()</code> above, this function should monitor the environment"," * for the event being fired, and trigger subscription execution by"," * calling <code>notifier.fire(e)</code>.</p>"," *"," * <p>This function receives a fourth argument, which is the filter"," * used to identify which Node's are of interest to the subscription."," * The filter will be either a boolean function that accepts a target"," * Node for each hierarchy level as the event bubbles, or a selector"," * string. To translate selector strings into filter functions, use"," * <code>Y.delegate.compileFilter(filter)</code>.</p>"," *"," * @method delegate"," * @param node {Node} the node the subscription is being applied to"," * @param sub {Subscription} the object to track this subscription"," * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to"," * trigger the execution of the subscribers"," * @param filter {String|Function} Selector string or function that"," * accepts an event object and returns null, a Node, or an"," * array of Nodes matching the criteria for processing."," * @since 3.2.0"," */"," delegate : noop,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * <p>Implementation logic for detaching subscriptions done via"," * <code>node.delegate(type, fn, filter)</code> or"," * <code>Y.delegate(type, fn, container, filter)</code>. This function"," * should clean up any subscriptions made in the"," * <code>delegate()</code> phase.</p>"," *"," * @method detachDelegate"," * @param node {Node} the node the subscription was applied to"," * @param sub {Subscription} the object tracking this subscription"," * @param notifier {SyntheticEvent.Notifier} the Notifier used to"," * trigger the execution of the subscribers"," * @param filter {String|Function} Selector string or function that"," * accepts an event object and returns null, a Node, or an"," * array of Nodes matching the criteria for processing."," * @since 3.2.0"," */"," detachDelegate : noop,",""," /**"," * Sets up the boilerplate for detaching the event and facilitating the"," * execution of subscriber callbacks."," *"," * @method _on"," * @param args {Array} array of arguments passed to"," * <code>Y.on(...)</code> or <code>Y.delegate(...)</code>"," * @param delegate {Boolean} true if called from"," * <code>Y.delegate(...)</code>"," * @return {EventHandle} the detach handle for this subscription"," * @private"," * since 3.2.0"," */"," _on: function (args, delegate) {"," var handles = [],"," originalArgs = args.slice(),"," extra = this.processArgs(args, delegate),"," selector = args[2],"," method = delegate ? 'delegate' : 'on',"," nodes, handle;",""," // Can't just use Y.all because it doesn't support window (yet?)"," nodes = (isString(selector)) ?"," query(selector) :"," toArray(selector || Y.one(Y.config.win));",""," if (!nodes.length && isString(selector)) {"," handle = Y.on('available', function () {"," Y.mix(handle, Y[method].apply(Y, originalArgs), true);"," }, selector);",""," return handle;"," }",""," Y.Array.each(nodes, function (node) {"," var subArgs = args.slice(),"," filter;",""," node = Y.one(node);",""," if (node) {"," if (delegate) {"," filter = subArgs.splice(3, 1)[0];"," }",""," // (type, fn, el, thisObj, ...) => (fn, thisObj, ...)"," subArgs.splice(0, 4, subArgs[1], subArgs[3]);",""," if (!this.preventDups ||"," !this.getSubs(node, args, null, true))"," {"," handles.push(this._subscribe(node, method, subArgs, extra, filter));"," }"," }"," }, this);",""," return (handles.length === 1) ?"," handles[0] :"," new Y.EventHandle(handles);"," },",""," /**"," * Creates a new Notifier object for use by this event's"," * <code>on(...)</code> or <code>delegate(...)</code> implementation"," * and register the custom event proxy in the DOM system for cleanup."," *"," * @method _subscribe"," * @param node {Node} the Node hosting the event"," * @param method {String} \"on\" or \"delegate\""," * @param args {Array} the subscription arguments passed to either"," * <code>Y.on(...)</code> or <code>Y.delegate(...)</code>"," * after running through <code>processArgs(args)</code> to"," * normalize the argument signature"," * @param extra {any} Extra data parsed from"," * <code>processArgs(args)</code>"," * @param filter {String|Function} the selector string or function"," * filter passed to <code>Y.delegate(...)</code> (not"," * present when called from <code>Y.on(...)</code>)"," * @return {EventHandle}"," * @private"," * @since 3.2.0"," */"," _subscribe: function (node, method, args, extra, filter) {"," var dispatcher = new Y.CustomEvent(this.type, this.publishConfig),"," handle = dispatcher.on.apply(dispatcher, args),"," notifier = new Notifier(handle, this.emitFacade),"," registry = SyntheticEvent.getRegistry(node, this.type, true),"," sub = handle.sub;",""," sub.node = node;"," sub.filter = filter;"," if (extra) {"," this.applyArgExtras(extra, sub);"," }",""," Y.mix(dispatcher, {"," eventDef : this,"," notifier : notifier,"," host : node, // I forget what this is for"," currentTarget: node, // for generating facades"," target : node, // for generating facades"," el : node._node, // For category detach",""," _delete : SyntheticEvent._deleteSub"," }, true);",""," handle.notifier = notifier;",""," registry.register(handle);",""," // Call the implementation's \"on\" or \"delegate\" method"," this[method](node, sub, notifier, filter);",""," return handle;"," },",""," /**"," * <p>Implementers MAY provide this method definition.</p>"," *"," * <p>Implement this function if you want extra data extracted during"," * processArgs to be propagated to subscriptions on a per-node basis."," * That is to say, if you call <code>Y.on('xyz', fn, xtra, 'div')</code>"," * the data returned from processArgs will be shared"," * across the subscription objects for all the divs. If you want each"," * subscription to receive unique information, do that processing"," * here.</p>"," *"," * <p>The default implementation adds the data extracted by processArgs"," * to the subscription object as <code>sub._extra</code>.</p>"," *"," * @method applyArgExtras"," * @param extra {any} Any extra data extracted from processArgs"," * @param sub {Subscription} the individual subscription"," */"," applyArgExtras: function (extra, sub) {"," sub._extra = extra;"," },",""," /**"," * Removes the subscription(s) from the internal subscription dispatch"," * mechanism. See <code>SyntheticEvent._deleteSub</code>."," *"," * @method _detach"," * @param args {Array} The arguments passed to"," * <code>node.detach(...)</code>"," * @private"," * @since 3.2.0"," */"," _detach: function (args) {"," // Can't use Y.all because it doesn't support window (yet?)"," // TODO: Does Y.all support window now?"," var target = args[2],"," els = (isString(target)) ?"," query(target) : toArray(target),"," node, i, len, handles, j;",""," // (type, fn, el, context, filter?) => (type, fn, context, filter?)"," args.splice(2, 1);",""," for (i = 0, len = els.length; i < len; ++i) {"," node = Y.one(els[i]);",""," if (node) {"," handles = this.getSubs(node, args);",""," if (handles) {"," for (j = handles.length - 1; j >= 0; --j) {"," handles[j].detach();"," }"," }"," }"," }"," },",""," /**"," * Returns the detach handles of subscriptions on a node that satisfy a"," * search/filter function. By default, the filter used is the"," * <code>subMatch</code> method."," *"," * @method getSubs"," * @param node {Node} the node hosting the event"," * @param args {Array} the array of original subscription args passed"," * to <code>Y.on(...)</code> (before"," * <code>processArgs</code>"," * @param filter {Function} function used to identify a subscription"," * for inclusion in the returned array"," * @param first {Boolean} stop after the first match (used to check for"," * duplicate subscriptions)"," * @return {EventHandle[]} detach handles for the matching subscriptions"," */"," getSubs: function (node, args, filter, first) {"," var registry = SyntheticEvent.getRegistry(node, this.type),"," handles = [],"," allHandles, i, len, handle;",""," if (registry) {"," allHandles = registry.handles;",""," if (!filter) {"," filter = this.subMatch;"," }",""," for (i = 0, len = allHandles.length; i < len; ++i) {"," handle = allHandles[i];"," if (filter.call(this, handle.sub, args)) {"," if (first) {"," return handle;"," } else {"," handles.push(allHandles[i]);"," }"," }"," }"," }",""," return handles.length && handles;"," },",""," /**"," * <p>Implementers MAY override this to define what constitutes a"," * "same" subscription. Override implementations should"," * consider the lack of a comparator as a match, so calling"," * <code>getSubs()</code> with no arguments will return all subs.</p>"," *"," * <p>Compares a set of subscription arguments against a Subscription"," * object to determine if they match. The default implementation"," * compares the callback function against the second argument passed to"," * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p>"," *"," * @method subMatch"," * @param sub {Subscription} the existing subscription"," * @param args {Array} the calling arguments passed to"," * <code>Y.on(...)</code> etc."," * @return {Boolean} true if the sub can be described by the args"," * present"," * @since 3.2.0"," */"," subMatch: function (sub, args) {"," // Default detach cares only about the callback matching"," return !args[1] || sub.fn === args[1];"," }"," }","}, true);","","Y.SyntheticEvent = SyntheticEvent;","","/**"," * <p>Defines a new event in the DOM event system. Implementers are"," * responsible for monitoring for a scenario whereby the event is fired. A"," * notifier object is provided to the functions identified below. When the"," * criteria defining the event are met, call notifier.fire( [args] ); to"," * execute event subscribers.</p>"," *"," * <p>The first parameter is the name of the event. The second parameter is a"," * configuration object which define the behavior of the event system when the"," * new event is subscribed to or detached from. The methods that should be"," * defined in this configuration object are <code>on</code>,"," * <code>detach</code>, <code>delegate</code>, and <code>detachDelegate</code>."," * You are free to define any other methods or properties needed to define your"," * event. Be aware, however, that since the object is used to subclass"," * SyntheticEvent, you should avoid method names used by SyntheticEvent unless"," * your intention is to override the default behavior.</p>"," *"," * <p>This is a list of properties and methods that you can or should specify"," * in the configuration object:</p>"," *"," * <dl>"," * <dt><code>on</code></dt>"," * <dd><code>function (node, subscription, notifier)</code> The"," * implementation logic for subscription. Any special setup you need to"," * do to create the environment for the event being fired--E.g. native"," * DOM event subscriptions. Store subscription related objects and"," * state on the <code>subscription</code> object. When the"," * criteria have been met to fire the synthetic event, call"," * <code>notifier.fire(e)</code>. See Notifier's <code>fire()</code>"," * method for details about what to pass as parameters.</dd>"," *"," * <dt><code>detach</code></dt>"," * <dd><code>function (node, subscription, notifier)</code> The"," * implementation logic for cleaning up a detached subscription. E.g."," * detach any DOM subscriptions added in <code>on</code>.</dd>"," *"," * <dt><code>delegate</code></dt>"," * <dd><code>function (node, subscription, notifier, filter)</code> The"," * implementation logic for subscription via <code>Y.delegate</code> or"," * <code>node.delegate</code>. The filter is typically either a selector"," * string or a function. You can use"," * <code>Y.delegate.compileFilter(selectorString)</code> to create a"," * filter function from a selector string if needed. The filter function"," * expects an event object as input and should output either null, a"," * matching Node, or an array of matching Nodes. Otherwise, this acts"," * like <code>on</code> DOM event subscriptions. Store subscription"," * related objects and information on the <code>subscription</code>"," * object. When the criteria have been met to fire the synthetic event,"," * call <code>notifier.fire(e)</code> as noted above.</dd>"," *"," * <dt><code>detachDelegate</code></dt>"," * <dd><code>function (node, subscription, notifier)</code> The"," * implementation logic for cleaning up a detached delegate subscription."," * E.g. detach any DOM delegate subscriptions added in"," * <code>delegate</code>.</dd>"," *"," * <dt><code>publishConfig</code></dt>"," * <dd>(Object) The configuration object that will be used to instantiate"," * the underlying CustomEvent. See Notifier's <code>fire</code> method"," * for details.</dd>"," *"," * <dt><code>processArgs</code></dt"," * <dd>"," * <p><code>function (argArray, fromDelegate)</code> Optional method"," * to extract any additional arguments from the subscription"," * signature. Using this allows <code>on</code> or"," * <code>delegate</code> signatures like"," * <code>node.on("hover", overCallback,"," * outCallback)</code>.</p>"," * <p>When processing an atypical argument signature, make sure the"," * args array is returned to the normal signature before returning"," * from the function. For example, in the "hover" example"," * above, the <code>outCallback</code> needs to be <code>splice</code>d"," * out of the array. The expected signature of the args array for"," * <code>on()</code> subscriptions is:</p>"," * <pre>"," * <code>[type, callback, target, contextOverride, argN...]</code>"," * </pre>"," * <p>And for <code>delegate()</code>:</p>"," * <pre>"," * <code>[type, callback, target, filter, contextOverride, argN...]</code>"," * </pre>"," * <p>where <code>target</code> is the node the event is being"," * subscribed for. You can see these signatures documented for"," * <code>Y.on()</code> and <code>Y.delegate()</code> respectively.</p>"," * <p>Whatever gets returned from the function will be stored on the"," * <code>subscription</code> object under"," * <code>subscription._extra</code>.</p></dd>"," * <dt><code>subMatch</code></dt>"," * <dd>"," * <p><code>function (sub, args)</code> Compares a set of"," * subscription arguments against a Subscription object to determine"," * if they match. The default implementation compares the callback"," * function against the second argument passed to"," * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p>"," * </dd>"," * </dl>"," *"," * @method define"," * @param type {String} the name of the event"," * @param config {Object} the prototype definition for the new event (see above)"," * @param force {Boolean} override an existing event (use with caution)"," * @return {SyntheticEvent} the subclass implementation instance created to"," * handle event subscriptions of this type"," * @static"," * @for Event"," * @since 3.1.0"," * @in event-synthetic"," */","Y.Event.define = function (type, config, force) {"," var eventDef, Impl, synth;",""," if (type && type.type) {"," eventDef = type;"," force = config;"," } else if (config) {"," eventDef = Y.merge({ type: type }, config);"," }",""," if (eventDef) {"," if (force || !Y.Node.DOM_EVENTS[eventDef.type]) {"," Impl = function () {"," SyntheticEvent.apply(this, arguments);"," };"," Y.extend(Impl, SyntheticEvent, eventDef);"," synth = new Impl();",""," type = synth.type;",""," Y.Node.DOM_EVENTS[type] = Y.Env.evt.plugins[type] = {"," eventDef: synth,",""," on: function () {"," return synth._on(toArray(arguments));"," },",""," delegate: function () {"," return synth._on(toArray(arguments), true);"," },",""," detach: function () {"," return synth._detach(toArray(arguments));"," }"," };",""," }"," } else if (isString(type) || isArray(type)) {"," Y.Array.each(toArray(type), function (t) {"," Y.Node.DOM_EVENTS[t] = 1;"," });"," }",""," return synth;","};","","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-custom-complex\"]});"];+_yuitest_coverage["build/event-synthetic/event-synthetic.js"].code=["YUI.add('event-synthetic', function (Y, NAME) {","","/**"," * Define new DOM events that can be subscribed to from Nodes."," *"," * @module event"," * @submodule event-synthetic"," */","var CustomEvent = Y.CustomEvent,"," DOMMap = Y.Env.evt.dom_map,"," toArray = Y.Array,"," YLang = Y.Lang,"," isObject = YLang.isObject,"," isString = YLang.isString,"," isArray = YLang.isArray,"," query = Y.Selector.query,"," noop = function () {};","","/**"," * <p>The triggering mechanism used by SyntheticEvents.</p>"," *"," * <p>Implementers should not instantiate these directly. Use the Notifier"," * provided to the event's implemented <code>on(node, sub, notifier)</code> or"," * <code>delegate(node, sub, notifier, filter)</code> methods.</p>"," *"," * @class SyntheticEvent.Notifier"," * @constructor"," * @param handle {EventHandle} the detach handle for the subscription to an"," * internal custom event used to execute the callback passed to"," * on(..) or delegate(..)"," * @param emitFacade {Boolean} take steps to ensure the first arg received by"," * the subscription callback is an event facade"," * @private"," * @since 3.2.0"," */","function Notifier(handle, emitFacade) {"," this.handle = handle;"," this.emitFacade = emitFacade;","}","","/**"," * <p>Executes the subscription callback, passing the firing arguments as the"," * first parameters to that callback. For events that are configured with"," * emitFacade=true, it is common practice to pass the triggering DOMEventFacade"," * as the first parameter. Barring a proper DOMEventFacade or EventFacade"," * (from a CustomEvent), a new EventFacade will be generated. In that case, if"," * fire() is called with a simple object, it will be mixed into the facade."," * Otherwise, the facade will be prepended to the callback parameters.</p>"," *"," * <p>For notifiers provided to delegate logic, the first argument should be an"," * object with a "currentTarget" property to identify what object to"," * default as 'this' in the callback. Typically this is gleaned from the"," * DOMEventFacade or EventFacade, but if configured with emitFacade=false, an"," * object must be provided. In that case, the object will be removed from the"," * callback parameters.</p>"," *"," * <p>Additional arguments passed during event subscription will be"," * automatically added after those passed to fire().</p>"," *"," * @method fire"," * @param e {EventFacade|DOMEventFacade|Object|any} (see description)"," * @param arg* {any} additional arguments received by all subscriptions"," * @private"," */","Notifier.prototype.fire = function (e) {"," // first arg to delegate notifier should be an object with currentTarget"," var args = toArray(arguments, 0, true),"," handle = this.handle,"," ce = handle.evt,"," sub = handle.sub,"," thisObj = sub.context,"," delegate = sub.filter,"," event = e || {},"," ret;",""," if (this.emitFacade) {"," if (!e || !e.preventDefault) {"," event = ce._getFacade();",""," if (isObject(e) && !e.preventDefault) {"," Y.mix(event, e, true);"," args[0] = event;"," } else {"," args.unshift(event);"," }"," }",""," event.type = ce.type;"," event.details = args.slice();",""," if (delegate) {"," event.container = ce.host;"," }"," } else if (delegate && isObject(e) && e.currentTarget) {"," args.shift();"," }",""," sub.context = thisObj || event.currentTarget || ce.host;"," ret = ce.fire.apply(ce, args);"," sub.context = thisObj; // reset for future firing",""," // to capture callbacks that return false to stopPropagation."," // Useful for delegate implementations"," return ret;","};","","/**"," * Manager object for synthetic event subscriptions to aggregate multiple synths on the same node without colliding with actual DOM subscription entries in the global map of DOM subscriptions. Also facilitates proper cleanup on page unload."," *"," * @class SynthRegistry"," * @constructor"," * @param el {HTMLElement} the DOM element"," * @param yuid {String} the yuid stamp for the element"," * @param key {String} the generated id token used to identify an event type +"," * element in the global DOM subscription map."," * @private"," */","function SynthRegistry(el, yuid, key) {"," this.handles = [];"," this.el = el;"," this.key = key;"," this.domkey = yuid;","}","","SynthRegistry.prototype = {"," constructor: SynthRegistry,",""," // A few object properties to fake the CustomEvent interface for page"," // unload cleanup. DON'T TOUCH!"," type : '_synth',"," fn : noop,"," capture : false,",""," /**"," * Adds a subscription from the Notifier registry."," *"," * @method register"," * @param handle {EventHandle} the subscription"," * @since 3.4.0"," */"," register: function (handle) {"," handle.evt.registry = this;"," this.handles.push(handle);"," },",""," /**"," * Removes the subscription from the Notifier registry."," *"," * @method _unregisterSub"," * @param sub {Subscription} the subscription"," * @since 3.4.0"," */"," unregister: function (sub) {"," var handles = this.handles,"," events = DOMMap[this.domkey],"," i;",""," for (i = handles.length - 1; i >= 0; --i) {"," if (handles[i].sub === sub) {"," handles.splice(i, 1);"," break;"," }"," }",""," // Clean up left over objects when there are no more subscribers."," if (!handles.length) {"," delete events[this.key];"," if (!Y.Object.size(events)) {"," delete DOMMap[this.domkey];"," }"," }"," },",""," /**"," * Used by the event system's unload cleanup process. When navigating"," * away from the page, the event system iterates the global map of element"," * subscriptions and detaches everything using detachAll(). Normally,"," * the map is populated with custom events, so this object needs to"," * at least support the detachAll method to duck type its way to"," * cleanliness."," *"," * @method detachAll"," * @private"," * @since 3.4.0"," */"," detachAll : function () {"," var handles = this.handles,"," i = handles.length;",""," while (--i >= 0) {"," handles[i].detach();"," }"," }","};","","/**"," * <p>Wrapper class for the integration of new events into the YUI event"," * infrastructure. Don't instantiate this object directly, use"," * <code>Y.Event.define(type, config)</code>. See that method for details.</p>"," *"," * <p>Properties that MAY or SHOULD be specified in the configuration are noted"," * below and in the description of <code>Y.Event.define</code>.</p>"," *"," * @class SyntheticEvent"," * @constructor"," * @param cfg {Object} Implementation pieces and configuration"," * @since 3.1.0"," * @in event-synthetic"," */","function SyntheticEvent() {"," this._init.apply(this, arguments);","}","","Y.mix(SyntheticEvent, {"," Notifier: Notifier,"," SynthRegistry: SynthRegistry,",""," /**"," * Returns the array of subscription handles for a node for the given event"," * type. Passing true as the third argument will create a registry entry"," * in the event system's DOM map to host the array if one doesn't yet exist."," *"," * @method getRegistry"," * @param node {Node} the node"," * @param type {String} the event"," * @param create {Boolean} create a registration entry to host a new array"," * if one doesn't exist."," * @return {Array}"," * @static"," * @protected"," * @since 3.2.0"," */"," getRegistry: function (node, type, create) {"," var el = node._node,"," yuid = Y.stamp(el),"," key = 'event:' + yuid + type + '_synth',"," events = DOMMap[yuid];"," "," if (create) {"," if (!events) {"," events = DOMMap[yuid] = {};"," }"," if (!events[key]) {"," events[key] = new SynthRegistry(el, yuid, key);"," }"," }",""," return (events && events[key]) || null;"," },",""," /**"," * Alternate <code>_delete()</code> method for the CustomEvent object"," * created to manage SyntheticEvent subscriptions."," *"," * @method _deleteSub"," * @param sub {Subscription} the subscription to clean up"," * @private"," * @since 3.2.0"," */"," _deleteSub: function (sub) {"," if (sub && sub.fn) {"," var synth = this.eventDef,"," method = (sub.filter) ? 'detachDelegate' : 'detach';",""," this._subscribers = [];",""," if (CustomEvent.keepDeprecatedSubs) {"," this.subscribers = {};"," }",""," synth[method](sub.node, sub, this.notifier, sub.filter);"," this.registry.unregister(sub);",""," delete sub.fn;"," delete sub.node;"," delete sub.context;"," }"," },",""," prototype: {"," constructor: SyntheticEvent,",""," /**"," * Construction logic for the event."," *"," * @method _init"," * @protected"," */"," _init: function () {"," var config = this.publishConfig || (this.publishConfig = {});",""," // The notification mechanism handles facade creation"," this.emitFacade = ('emitFacade' in config) ?"," config.emitFacade :"," true;"," config.emitFacade = false;"," },",""," /**"," * <p>Implementers MAY provide this method definition.</p>"," *"," * <p>Implement this function if the event supports a different"," * subscription signature. This function is used by both"," * <code>on()</code> and <code>delegate()</code>. The second parameter"," * indicates that the event is being subscribed via"," * <code>delegate()</code>.</p>"," *"," * <p>Implementations must remove extra arguments from the args list"," * before returning. The required args for <code>on()</code>"," * subscriptions are</p>"," * <pre><code>[type, callback, target, context, argN...]</code></pre>"," *"," * <p>The required args for <code>delegate()</code>"," * subscriptions are</p>"," *"," * <pre><code>[type, callback, target, filter, context, argN...]</code></pre>"," *"," * <p>The return value from this function will be stored on the"," * subscription in the '_extra' property for reference elsewhere.</p>"," *"," * @method processArgs"," * @param args {Array} parmeters passed to Y.on(..) or Y.delegate(..)"," * @param delegate {Boolean} true if the subscription is from Y.delegate"," * @return {any}"," */"," processArgs: noop,",""," /**"," * <p>Implementers MAY override this property.</p>"," *"," * <p>Whether to prevent multiple subscriptions to this event that are"," * classified as being the same. By default, this means the subscribed"," * callback is the same function. See the <code>subMatch</code>"," * method. Setting this to true will impact performance for high volume"," * events.</p>"," *"," * @property preventDups"," * @type {Boolean}"," * @default false"," */"," //preventDups : false,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * Implementation logic for subscriptions done via <code>node.on(type,"," * fn)</code> or <code>Y.on(type, fn, target)</code>. This"," * function should set up the monitor(s) that will eventually fire the"," * event. Typically this involves subscribing to at least one DOM"," * event. It is recommended to store detach handles from any DOM"," * subscriptions to make for easy cleanup in the <code>detach</code>"," * method. Typically these handles are added to the <code>sub</code>"," * object. Also for SyntheticEvents that leverage a single DOM"," * subscription under the hood, it is recommended to pass the DOM event"," * object to <code>notifier.fire(e)</code>. (The event name on the"," * object will be updated)."," *"," * @method on"," * @param node {Node} the node the subscription is being applied to"," * @param sub {Subscription} the object to track this subscription"," * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to"," * trigger the execution of the subscribers"," */"," on: noop,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * <p>Implementation logic for detaching subscriptions done via"," * <code>node.on(type, fn)</code>. This function should clean up any"," * subscriptions made in the <code>on()</code> phase.</p>"," *"," * @method detach"," * @param node {Node} the node the subscription was applied to"," * @param sub {Subscription} the object tracking this subscription"," * @param notifier {SyntheticEvent.Notifier} the Notifier used to"," * trigger the execution of the subscribers"," */"," detach: noop,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * <p>Implementation logic for subscriptions done via"," * <code>node.delegate(type, fn, filter)</code> or"," * <code>Y.delegate(type, fn, container, filter)</code>. Like with"," * <code>on()</code> above, this function should monitor the environment"," * for the event being fired, and trigger subscription execution by"," * calling <code>notifier.fire(e)</code>.</p>"," *"," * <p>This function receives a fourth argument, which is the filter"," * used to identify which Node's are of interest to the subscription."," * The filter will be either a boolean function that accepts a target"," * Node for each hierarchy level as the event bubbles, or a selector"," * string. To translate selector strings into filter functions, use"," * <code>Y.delegate.compileFilter(filter)</code>.</p>"," *"," * @method delegate"," * @param node {Node} the node the subscription is being applied to"," * @param sub {Subscription} the object to track this subscription"," * @param notifier {SyntheticEvent.Notifier} call notifier.fire(..) to"," * trigger the execution of the subscribers"," * @param filter {String|Function} Selector string or function that"," * accepts an event object and returns null, a Node, or an"," * array of Nodes matching the criteria for processing."," * @since 3.2.0"," */"," delegate : noop,",""," /**"," * <p>Implementers SHOULD provide this method definition.</p>"," *"," * <p>Implementation logic for detaching subscriptions done via"," * <code>node.delegate(type, fn, filter)</code> or"," * <code>Y.delegate(type, fn, container, filter)</code>. This function"," * should clean up any subscriptions made in the"," * <code>delegate()</code> phase.</p>"," *"," * @method detachDelegate"," * @param node {Node} the node the subscription was applied to"," * @param sub {Subscription} the object tracking this subscription"," * @param notifier {SyntheticEvent.Notifier} the Notifier used to"," * trigger the execution of the subscribers"," * @param filter {String|Function} Selector string or function that"," * accepts an event object and returns null, a Node, or an"," * array of Nodes matching the criteria for processing."," * @since 3.2.0"," */"," detachDelegate : noop,",""," /**"," * Sets up the boilerplate for detaching the event and facilitating the"," * execution of subscriber callbacks."," *"," * @method _on"," * @param args {Array} array of arguments passed to"," * <code>Y.on(...)</code> or <code>Y.delegate(...)</code>"," * @param delegate {Boolean} true if called from"," * <code>Y.delegate(...)</code>"," * @return {EventHandle} the detach handle for this subscription"," * @private"," * since 3.2.0"," */"," _on: function (args, delegate) {"," var handles = [],"," originalArgs = args.slice(),"," extra = this.processArgs(args, delegate),"," selector = args[2],"," method = delegate ? 'delegate' : 'on',"," nodes, handle;",""," // Can't just use Y.all because it doesn't support window (yet?)"," nodes = (isString(selector)) ?"," query(selector) :"," toArray(selector || Y.one(Y.config.win));",""," if (!nodes.length && isString(selector)) {"," handle = Y.on('available', function () {"," Y.mix(handle, Y[method].apply(Y, originalArgs), true);"," }, selector);",""," return handle;"," }",""," Y.Array.each(nodes, function (node) {"," var subArgs = args.slice(),"," filter;",""," node = Y.one(node);",""," if (node) {"," if (delegate) {"," filter = subArgs.splice(3, 1)[0];"," }",""," // (type, fn, el, thisObj, ...) => (fn, thisObj, ...)"," subArgs.splice(0, 4, subArgs[1], subArgs[3]);",""," if (!this.preventDups ||"," !this.getSubs(node, args, null, true))"," {"," handles.push(this._subscribe(node, method, subArgs, extra, filter));"," }"," }"," }, this);",""," return (handles.length === 1) ?"," handles[0] :"," new Y.EventHandle(handles);"," },",""," /**"," * Creates a new Notifier object for use by this event's"," * <code>on(...)</code> or <code>delegate(...)</code> implementation"," * and register the custom event proxy in the DOM system for cleanup."," *"," * @method _subscribe"," * @param node {Node} the Node hosting the event"," * @param method {String} \"on\" or \"delegate\""," * @param args {Array} the subscription arguments passed to either"," * <code>Y.on(...)</code> or <code>Y.delegate(...)</code>"," * after running through <code>processArgs(args)</code> to"," * normalize the argument signature"," * @param extra {any} Extra data parsed from"," * <code>processArgs(args)</code>"," * @param filter {String|Function} the selector string or function"," * filter passed to <code>Y.delegate(...)</code> (not"," * present when called from <code>Y.on(...)</code>)"," * @return {EventHandle}"," * @private"," * @since 3.2.0"," */"," _subscribe: function (node, method, args, extra, filter) {"," var dispatcher = new Y.CustomEvent(this.type, this.publishConfig),"," handle = dispatcher.on.apply(dispatcher, args),"," notifier = new Notifier(handle, this.emitFacade),"," registry = SyntheticEvent.getRegistry(node, this.type, true),"," sub = handle.sub;",""," sub.node = node;"," sub.filter = filter;"," if (extra) {"," this.applyArgExtras(extra, sub);"," }",""," Y.mix(dispatcher, {"," eventDef : this,"," notifier : notifier,"," host : node, // I forget what this is for"," currentTarget: node, // for generating facades"," target : node, // for generating facades"," el : node._node, // For category detach",""," _delete : SyntheticEvent._deleteSub"," }, true);",""," handle.notifier = notifier;",""," registry.register(handle);",""," // Call the implementation's \"on\" or \"delegate\" method"," this[method](node, sub, notifier, filter);",""," return handle;"," },",""," /**"," * <p>Implementers MAY provide this method definition.</p>"," *"," * <p>Implement this function if you want extra data extracted during"," * processArgs to be propagated to subscriptions on a per-node basis."," * That is to say, if you call <code>Y.on('xyz', fn, xtra, 'div')</code>"," * the data returned from processArgs will be shared"," * across the subscription objects for all the divs. If you want each"," * subscription to receive unique information, do that processing"," * here.</p>"," *"," * <p>The default implementation adds the data extracted by processArgs"," * to the subscription object as <code>sub._extra</code>.</p>"," *"," * @method applyArgExtras"," * @param extra {any} Any extra data extracted from processArgs"," * @param sub {Subscription} the individual subscription"," */"," applyArgExtras: function (extra, sub) {"," sub._extra = extra;"," },",""," /**"," * Removes the subscription(s) from the internal subscription dispatch"," * mechanism. See <code>SyntheticEvent._deleteSub</code>."," *"," * @method _detach"," * @param args {Array} The arguments passed to"," * <code>node.detach(...)</code>"," * @private"," * @since 3.2.0"," */"," _detach: function (args) {"," // Can't use Y.all because it doesn't support window (yet?)"," // TODO: Does Y.all support window now?"," var target = args[2],"," els = (isString(target)) ?"," query(target) : toArray(target),"," node, i, len, handles, j;",""," // (type, fn, el, context, filter?) => (type, fn, context, filter?)"," args.splice(2, 1);",""," for (i = 0, len = els.length; i < len; ++i) {"," node = Y.one(els[i]);",""," if (node) {"," handles = this.getSubs(node, args);",""," if (handles) {"," for (j = handles.length - 1; j >= 0; --j) {"," handles[j].detach();"," }"," }"," }"," }"," },",""," /**"," * Returns the detach handles of subscriptions on a node that satisfy a"," * search/filter function. By default, the filter used is the"," * <code>subMatch</code> method."," *"," * @method getSubs"," * @param node {Node} the node hosting the event"," * @param args {Array} the array of original subscription args passed"," * to <code>Y.on(...)</code> (before"," * <code>processArgs</code>"," * @param filter {Function} function used to identify a subscription"," * for inclusion in the returned array"," * @param first {Boolean} stop after the first match (used to check for"," * duplicate subscriptions)"," * @return {EventHandle[]} detach handles for the matching subscriptions"," */"," getSubs: function (node, args, filter, first) {"," var registry = SyntheticEvent.getRegistry(node, this.type),"," handles = [],"," allHandles, i, len, handle;",""," if (registry) {"," allHandles = registry.handles;",""," if (!filter) {"," filter = this.subMatch;"," }",""," for (i = 0, len = allHandles.length; i < len; ++i) {"," handle = allHandles[i];"," if (filter.call(this, handle.sub, args)) {"," if (first) {"," return handle;"," } else {"," handles.push(allHandles[i]);"," }"," }"," }"," }",""," return handles.length && handles;"," },",""," /**"," * <p>Implementers MAY override this to define what constitutes a"," * "same" subscription. Override implementations should"," * consider the lack of a comparator as a match, so calling"," * <code>getSubs()</code> with no arguments will return all subs.</p>"," *"," * <p>Compares a set of subscription arguments against a Subscription"," * object to determine if they match. The default implementation"," * compares the callback function against the second argument passed to"," * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p>"," *"," * @method subMatch"," * @param sub {Subscription} the existing subscription"," * @param args {Array} the calling arguments passed to"," * <code>Y.on(...)</code> etc."," * @return {Boolean} true if the sub can be described by the args"," * present"," * @since 3.2.0"," */"," subMatch: function (sub, args) {"," // Default detach cares only about the callback matching"," return !args[1] || sub.fn === args[1];"," }"," }","}, true);","","Y.SyntheticEvent = SyntheticEvent;","","/**"," * <p>Defines a new event in the DOM event system. Implementers are"," * responsible for monitoring for a scenario whereby the event is fired. A"," * notifier object is provided to the functions identified below. When the"," * criteria defining the event are met, call notifier.fire( [args] ); to"," * execute event subscribers.</p>"," *"," * <p>The first parameter is the name of the event. The second parameter is a"," * configuration object which define the behavior of the event system when the"," * new event is subscribed to or detached from. The methods that should be"," * defined in this configuration object are <code>on</code>,"," * <code>detach</code>, <code>delegate</code>, and <code>detachDelegate</code>."," * You are free to define any other methods or properties needed to define your"," * event. Be aware, however, that since the object is used to subclass"," * SyntheticEvent, you should avoid method names used by SyntheticEvent unless"," * your intention is to override the default behavior.</p>"," *"," * <p>This is a list of properties and methods that you can or should specify"," * in the configuration object:</p>"," *"," * <dl>"," * <dt><code>on</code></dt>"," * <dd><code>function (node, subscription, notifier)</code> The"," * implementation logic for subscription. Any special setup you need to"," * do to create the environment for the event being fired--E.g. native"," * DOM event subscriptions. Store subscription related objects and"," * state on the <code>subscription</code> object. When the"," * criteria have been met to fire the synthetic event, call"," * <code>notifier.fire(e)</code>. See Notifier's <code>fire()</code>"," * method for details about what to pass as parameters.</dd>"," *"," * <dt><code>detach</code></dt>"," * <dd><code>function (node, subscription, notifier)</code> The"," * implementation logic for cleaning up a detached subscription. E.g."," * detach any DOM subscriptions added in <code>on</code>.</dd>"," *"," * <dt><code>delegate</code></dt>"," * <dd><code>function (node, subscription, notifier, filter)</code> The"," * implementation logic for subscription via <code>Y.delegate</code> or"," * <code>node.delegate</code>. The filter is typically either a selector"," * string or a function. You can use"," * <code>Y.delegate.compileFilter(selectorString)</code> to create a"," * filter function from a selector string if needed. The filter function"," * expects an event object as input and should output either null, a"," * matching Node, or an array of matching Nodes. Otherwise, this acts"," * like <code>on</code> DOM event subscriptions. Store subscription"," * related objects and information on the <code>subscription</code>"," * object. When the criteria have been met to fire the synthetic event,"," * call <code>notifier.fire(e)</code> as noted above.</dd>"," *"," * <dt><code>detachDelegate</code></dt>"," * <dd><code>function (node, subscription, notifier)</code> The"," * implementation logic for cleaning up a detached delegate subscription."," * E.g. detach any DOM delegate subscriptions added in"," * <code>delegate</code>.</dd>"," *"," * <dt><code>publishConfig</code></dt>"," * <dd>(Object) The configuration object that will be used to instantiate"," * the underlying CustomEvent. See Notifier's <code>fire</code> method"," * for details.</dd>"," *"," * <dt><code>processArgs</code></dt"," * <dd>"," * <p><code>function (argArray, fromDelegate)</code> Optional method"," * to extract any additional arguments from the subscription"," * signature. Using this allows <code>on</code> or"," * <code>delegate</code> signatures like"," * <code>node.on("hover", overCallback,"," * outCallback)</code>.</p>"," * <p>When processing an atypical argument signature, make sure the"," * args array is returned to the normal signature before returning"," * from the function. For example, in the "hover" example"," * above, the <code>outCallback</code> needs to be <code>splice</code>d"," * out of the array. The expected signature of the args array for"," * <code>on()</code> subscriptions is:</p>"," * <pre>"," * <code>[type, callback, target, contextOverride, argN...]</code>"," * </pre>"," * <p>And for <code>delegate()</code>:</p>"," * <pre>"," * <code>[type, callback, target, filter, contextOverride, argN...]</code>"," * </pre>"," * <p>where <code>target</code> is the node the event is being"," * subscribed for. You can see these signatures documented for"," * <code>Y.on()</code> and <code>Y.delegate()</code> respectively.</p>"," * <p>Whatever gets returned from the function will be stored on the"," * <code>subscription</code> object under"," * <code>subscription._extra</code>.</p></dd>"," * <dt><code>subMatch</code></dt>"," * <dd>"," * <p><code>function (sub, args)</code> Compares a set of"," * subscription arguments against a Subscription object to determine"," * if they match. The default implementation compares the callback"," * function against the second argument passed to"," * <code>Y.on(...)</code> or <code>node.detach(...)</code> etc.</p>"," * </dd>"," * </dl>"," *"," * @method define"," * @param type {String} the name of the event"," * @param config {Object} the prototype definition for the new event (see above)"," * @param force {Boolean} override an existing event (use with caution)"," * @return {SyntheticEvent} the subclass implementation instance created to"," * handle event subscriptions of this type"," * @static"," * @for Event"," * @since 3.1.0"," * @in event-synthetic"," */","Y.Event.define = function (type, config, force) {"," var eventDef, Impl, synth;",""," if (type && type.type) {"," eventDef = type;"," force = config;"," } else if (config) {"," eventDef = Y.merge({ type: type }, config);"," }",""," if (eventDef) {"," if (force || !Y.Node.DOM_EVENTS[eventDef.type]) {"," Impl = function () {"," SyntheticEvent.apply(this, arguments);"," };"," Y.extend(Impl, SyntheticEvent, eventDef);"," synth = new Impl();",""," type = synth.type;",""," Y.Node.DOM_EVENTS[type] = Y.Env.evt.plugins[type] = {"," eventDef: synth,",""," on: function () {"," return synth._on(toArray(arguments));"," },",""," delegate: function () {"," return synth._on(toArray(arguments), true);"," },",""," detach: function () {"," return synth._detach(toArray(arguments));"," }"," };",""," }"," } else if (isString(type) || isArray(type)) {"," Y.Array.each(toArray(type), function (t) {"," Y.Node.DOM_EVENTS[t] = 1;"," });"," }",""," return synth;","};","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-custom-complex\"]});"]; _yuitest_coverage["build/event-synthetic/event-synthetic.js"].lines = {"1":0,"9":0,"36":0,"37":0,"38":0,"65":0,"67":0,"76":0,"77":0,"78":0,"80":0,"81":0,"82":0,"84":0,"88":0,"89":0,"91":0,"92":0,"94":0,"95":0,"98":0,"99":0,"100":0,"104":0,"118":0,"119":0,"120":0,"121":0,"122":0,"125":0,"142":0,"143":0,"154":0,"158":0,"159":0,"160":0,"161":0,"166":0,"167":0,"168":0,"169":0,"187":0,"190":0,"191":0,"210":0,"211":0,"214":0,"234":0,"239":0,"240":0,"241":0,"243":0,"244":0,"248":0,"261":0,"262":0,"265":0,"267":0,"268":0,"271":0,"272":0,"274":0,"275":0,"276":0,"290":0,"293":0,"296":0,"445":0,"453":0,"457":0,"458":0,"459":0,"462":0,"465":0,"466":0,"469":0,"471":0,"472":0,"473":0,"477":0,"479":0,"482":0,"487":0,"514":0,"520":0,"521":0,"522":0,"523":0,"526":0,"537":0,"539":0,"542":0,"544":0,"566":0,"582":0,"588":0,"590":0,"591":0,"593":0,"594":0,"596":0,"597":0,"598":0,"622":0,"626":0,"627":0,"629":0,"630":0,"633":0,"634":0,"635":0,"636":0,"637":0,"639":0,"645":0,"669":0,"674":0,"785":0,"786":0,"788":0,"789":0,"790":0,"791":0,"792":0,"795":0,"796":0,"797":0,"798":0,"800":0,"801":0,"803":0,"805":0,"809":0,"813":0,"817":0,"822":0,"823":0,"824":0,"828":0}; _yuitest_coverage["build/event-synthetic/event-synthetic.js"].functions = {"Notifier:36":0,"fire:65":0,"SynthRegistry:118":0,"register:141":0,"unregister:153":0,"detachAll:186":0,"SyntheticEvent:210":0,"getRegistry:233":0,"_deleteSub:260":0,"_init:289":0,"(anonymous 2):458":0,"(anonymous 3):465":0,"_on:444":0,"_subscribe:513":0,"applyArgExtras:565":0,"_detach:579":0,"getSubs:621":0,"subMatch:667":0,"Impl:797":0,"on:808":0,"delegate:812":0,"detach:816":0,"(anonymous 4):823":0,"define:785":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-synthetic/event-synthetic.js"].coveredLines = 139;@@ -1032,4 +1032,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-custom-complex"]});+}, '3.7.3', {"requires": ["node-base", "event-custom-complex"]});
bundle/event-synthetic/event-synthetic-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -835,4 +835,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-custom-complex"]});+}, '3.7.3', {"requires": ["node-base", "event-custom-complex"]});
bundle/event-synthetic/event-synthetic-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-synthetic",function(e,t){function c(e,t){this.handle=e,this.emitFacade=t}function h(e,t,n){this.handles=[],this.el=e,this.key=n,this.domkey=t}function p(){this._init.apply(this,arguments)}var n=e.CustomEvent,r=e.Env.evt.dom_map,i=e.Array,s=e.Lang,o=s.isObject,u=s.isString,a=s.isArray,f=e.Selector.query,l=function(){};c.prototype.fire=function(t){var n=i(arguments,0,!0),r=this.handle,s=r.evt,u=r.sub,a=u.context,f=u.filter,l=t||{},c;if(this.emitFacade){if(!t||!t.preventDefault)l=s._getFacade(),o(t)&&!t.preventDefault?(e.mix(l,t,!0),n[0]=l):n.unshift(l);l.type=s.type,l.details=n.slice(),f&&(l.container=s.host)}else f&&o(t)&&t.currentTarget&&n.shift();return u.context=a||l.currentTarget||s.host,c=s.fire.apply(s,n),u.context=a,c},h.prototype={constructor:h,type:"_synth",fn:l,capture:!1,register:function(e){e.evt.registry=this,this.handles.push(e)},unregister:function(t){var n=this.handles,i=r[this.domkey],s;for(s=n.length-1;s>=0;--s)if(n[s].sub===t){n.splice(s,1);break}n.length||(delete i[this.key],e.Object.size(i)||delete r[this.domkey])},detachAll:function(){var e=this.handles,t=e.length;while(--t>=0)e[t].detach()}},e.mix(p,{Notifier:c,SynthRegistry:h,getRegistry:function(t,n,i){var s=t._node,o=e.stamp(s),u="event:"+o+n+"_synth",a=r[o];return i&&(a||(a=r[o]={}),a[u]||(a[u]=new h(s,o,u))),a&&a[u]||null},_deleteSub:function(e){if(e&&e.fn){var t=this.eventDef,r=e.filter?"detachDelegate":"detach";this._subscribers=[],n.keepDeprecatedSubs&&(this.subscribers={}),t[r](e.node,e,this.notifier,e.filter),this.registry.unregister(e),delete e.fn,delete e.node,delete e.context}},prototype:{constructor:p,_init:function(){var e=this.publishConfig||(this.publishConfig={});this.emitFacade="emitFacade"in e?e.emitFacade:!0,e.emitFacade=!1},processArgs:l,on:l,detach:l,delegate:l,detachDelegate:l,_on:function(t,n){var r=[],s=t.slice(),o=this.processArgs(t,n),a=t[2],l=n?"delegate":"on",c,h;return c=u(a)?f(a):i(a||e.one(e.config.win)),!c.length&&u(a)?(h=e.on("available",function(){e.mix(h,e[l].apply(e,s),!0)},a),h):(e.Array.each(c,function(i){var s=t.slice(),u;i=e.one(i),i&&(n&&(u=s.splice(3,1)[0]),s.splice(0,4,s[1],s[3]),(!this.preventDups||!this.getSubs(i,t,null,!0))&&r.push(this._subscribe(i,l,s,o,u)))},this),r.length===1?r[0]:new e.EventHandle(r))},_subscribe:function(t,n,r,i,s){var o=new e.CustomEvent(this.type,this.publishConfig),u=o.on.apply(o,r),a=new c(u,this.emitFacade),f=p.getRegistry(t,this.type,!0),l=u.sub;return l.node=t,l.filter=s,i&&this.applyArgExtras(i,l),e.mix(o,{eventDef:this,notifier:a,host:t,currentTarget:t,target:t,el:t._node,_delete:p._deleteSub},!0),u.notifier=a,f.register(u),this[n](t,l,a,s),u},applyArgExtras:function(e,t){t._extra=e},_detach:function(t){var n=t[2],r=u(n)?f(n):i(n),s,o,a,l,c;t.splice(2,1);for(o=0,a=r.length;o<a;++o){s=e.one(r[o]);if(s){l=this.getSubs(s,t);if(l)for(c=l.length-1;c>=0;--c)l[c].detach()}}},getSubs:function(e,t,n,r){var i=p.getRegistry(e,this.type),s=[],o,u,a,f;if(i){o=i.handles,n||(n=this.subMatch);for(u=0,a=o.length;u<a;++u){f=o[u];if(n.call(this,f.sub,t)){if(r)return f;s.push(o[u])}}}return s.length&&s},subMatch:function(e,t){return!t[1]||e.fn===t[1]}}},!0),e.SyntheticEvent=p,e.Event.define=function(t,n,r){var s,o,f;t&&t.type?(s=t,r=n):n&&(s=e.merge({type:t},n));if(s){if(r||!e.Node.DOM_EVENTS[s.type])o=function(){p.apply(this,arguments)},e.extend(o,p,s),f=new o,t=f.type,e.Node.DOM_EVENTS[t]=e.Env.evt.plugins[t]={eventDef:f,on:function(){return f._on(i(arguments))},delegate:function(){return f._on(i(arguments),!0)},detach:function(){return f._detach(i(arguments))}}}else(u(t)||a(t))&&e.Array.each(i(t),function(t){e.Node.DOM_EVENTS[t]=1});return f}},"3.7.2",{requires:["node-base","event-custom-complex"]});+YUI.add("event-synthetic",function(e,t){function c(e,t){this.handle=e,this.emitFacade=t}function h(e,t,n){this.handles=[],this.el=e,this.key=n,this.domkey=t}function p(){this._init.apply(this,arguments)}var n=e.CustomEvent,r=e.Env.evt.dom_map,i=e.Array,s=e.Lang,o=s.isObject,u=s.isString,a=s.isArray,f=e.Selector.query,l=function(){};c.prototype.fire=function(t){var n=i(arguments,0,!0),r=this.handle,s=r.evt,u=r.sub,a=u.context,f=u.filter,l=t||{},c;if(this.emitFacade){if(!t||!t.preventDefault)l=s._getFacade(),o(t)&&!t.preventDefault?(e.mix(l,t,!0),n[0]=l):n.unshift(l);l.type=s.type,l.details=n.slice(),f&&(l.container=s.host)}else f&&o(t)&&t.currentTarget&&n.shift();return u.context=a||l.currentTarget||s.host,c=s.fire.apply(s,n),u.context=a,c},h.prototype={constructor:h,type:"_synth",fn:l,capture:!1,register:function(e){e.evt.registry=this,this.handles.push(e)},unregister:function(t){var n=this.handles,i=r[this.domkey],s;for(s=n.length-1;s>=0;--s)if(n[s].sub===t){n.splice(s,1);break}n.length||(delete i[this.key],e.Object.size(i)||delete r[this.domkey])},detachAll:function(){var e=this.handles,t=e.length;while(--t>=0)e[t].detach()}},e.mix(p,{Notifier:c,SynthRegistry:h,getRegistry:function(t,n,i){var s=t._node,o=e.stamp(s),u="event:"+o+n+"_synth",a=r[o];return i&&(a||(a=r[o]={}),a[u]||(a[u]=new h(s,o,u))),a&&a[u]||null},_deleteSub:function(e){if(e&&e.fn){var t=this.eventDef,r=e.filter?"detachDelegate":"detach";this._subscribers=[],n.keepDeprecatedSubs&&(this.subscribers={}),t[r](e.node,e,this.notifier,e.filter),this.registry.unregister(e),delete e.fn,delete e.node,delete e.context}},prototype:{constructor:p,_init:function(){var e=this.publishConfig||(this.publishConfig={});this.emitFacade="emitFacade"in e?e.emitFacade:!0,e.emitFacade=!1},processArgs:l,on:l,detach:l,delegate:l,detachDelegate:l,_on:function(t,n){var r=[],s=t.slice(),o=this.processArgs(t,n),a=t[2],l=n?"delegate":"on",c,h;return c=u(a)?f(a):i(a||e.one(e.config.win)),!c.length&&u(a)?(h=e.on("available",function(){e.mix(h,e[l].apply(e,s),!0)},a),h):(e.Array.each(c,function(i){var s=t.slice(),u;i=e.one(i),i&&(n&&(u=s.splice(3,1)[0]),s.splice(0,4,s[1],s[3]),(!this.preventDups||!this.getSubs(i,t,null,!0))&&r.push(this._subscribe(i,l,s,o,u)))},this),r.length===1?r[0]:new e.EventHandle(r))},_subscribe:function(t,n,r,i,s){var o=new e.CustomEvent(this.type,this.publishConfig),u=o.on.apply(o,r),a=new c(u,this.emitFacade),f=p.getRegistry(t,this.type,!0),l=u.sub;return l.node=t,l.filter=s,i&&this.applyArgExtras(i,l),e.mix(o,{eventDef:this,notifier:a,host:t,currentTarget:t,target:t,el:t._node,_delete:p._deleteSub},!0),u.notifier=a,f.register(u),this[n](t,l,a,s),u},applyArgExtras:function(e,t){t._extra=e},_detach:function(t){var n=t[2],r=u(n)?f(n):i(n),s,o,a,l,c;t.splice(2,1);for(o=0,a=r.length;o<a;++o){s=e.one(r[o]);if(s){l=this.getSubs(s,t);if(l)for(c=l.length-1;c>=0;--c)l[c].detach()}}},getSubs:function(e,t,n,r){var i=p.getRegistry(e,this.type),s=[],o,u,a,f;if(i){o=i.handles,n||(n=this.subMatch);for(u=0,a=o.length;u<a;++u){f=o[u];if(n.call(this,f.sub,t)){if(r)return f;s.push(o[u])}}}return s.length&&s},subMatch:function(e,t){return!t[1]||e.fn===t[1]}}},!0),e.SyntheticEvent=p,e.Event.define=function(t,n,r){var s,o,f;t&&t.type?(s=t,r=n):n&&(s=e.merge({type:t},n));if(s){if(r||!e.Node.DOM_EVENTS[s.type])o=function(){p.apply(this,arguments)},e.extend(o,p,s),f=new o,t=f.type,e.Node.DOM_EVENTS[t]=e.Env.evt.plugins[t]={eventDef:f,on:function(){return f._on(i(arguments))},delegate:function(){return f._on(i(arguments),!0)},detach:function(){return f._detach(i(arguments))}}}else(u(t)||a(t))&&e.Array.each(i(t),function(t){e.Node.DOM_EVENTS[t]=1});return f}},"3.7.3",{requires:["node-base","event-custom-complex"]});
bundle/event-synthetic/event-synthetic.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -835,4 +835,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-custom-complex"]});+}, '3.7.3', {"requires": ["node-base", "event-custom-complex"]});
bundle/event-tap/event-tap-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-tap/event-tap.js", code: [] };-_yuitest_coverage["build/event-tap/event-tap.js"].code=["YUI.add('event-tap', function (Y, NAME) {","","/**","The tap module provides a gesture events, \"tap\", which normalizes user interactions","across touch and mouse or pointer based input devices. This can be used by application developers","to build input device agnostic components which behave the same in response to either touch or mouse based","interaction.","","'tap' is like a touchscreen 'click', only it requires much less finger-down time since it listens to touch events,","but reverts to mouse events if touch is not supported. ","","@example",""," YUI().use('event-tap', function (Y) {"," Y.one('#my-button').on('tap', function (e) {"," });"," });","","@module event","@submodule event-tap","@author Andres Garza, matuzak and tilo mitra","@since 3.7.0 ","","*/","var doc = Y.config.doc,"," SUPPORTS_TOUCHES = !!(doc && doc.createTouch),"," EVT_START = SUPPORTS_TOUCHES ? 'touchstart' : 'mousedown',"," EVT_MOVE = SUPPORTS_TOUCHES ? 'touchmove' : 'mousemove',"," EVT_END = SUPPORTS_TOUCHES ? 'touchend' : 'mouseup',"," EVT_CANCEL = SUPPORTS_TOUCHES ? 'touchcancel' : 'mousecancel',"," EVT_TAP = 'tap',",""," HANDLES = {"," START: 'Y_TAP_ON_START_HANDLE',"," MOVE: 'Y_TAP_ON_MOVE_HANDLE',"," END: 'Y_TAP_ON_END_HANDLE',"," CANCEL: 'Y_TAP_ON_CANCEL_HANDLE'"," };","","function detachHelper(subscription, handles, subset, context) {",""," handles = subset ? handles : [ handles.START, handles.MOVE, handles.END, handles.CANCEL ];",""," Y.Array.each(handles, function (item, index, array) {"," var handle = subscription[item];"," if (handle) {"," handle.detach();"," subscription[item] = null;"," }"," });","","}","","","/**","Sets up a \"tap\" event, that is fired on touch devices in response to a tap event (finger down, finder up).","This event can be used instead of listening for click events which have a 500ms delay on most touch devices.","This event can also be listened for using node.delegate().","","@event tap","@param type {string} \"tap\"","@param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event.","@for Event","@return {EventHandle} the detach handle","*/","Y.Event.define(EVT_TAP, {",""," /**"," This function should set up the node that will eventually fire the event.",""," Usage: ",""," node.on('tap', function (e) {"," });",""," @method on"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," on: function (node, subscription, notifier) {"," subscription[HANDLES.START] = node.on(EVT_START, this.touchStart, this, node, subscription, notifier);"," },",""," /**"," Detaches all event subscriptions set up by the event-tap module",""," @method detach"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," detach: function (node, subscription, notifier) {"," detachHelper(subscription, HANDLES);"," },",""," /**"," Event delegation for the 'tap' event. The delegated event will use a "," supplied selector or filtering function to test if the event references at least one "," node that should trigger the subscription callback.",""," Usage: ",""," node.delegate('tap', function (e) {"," }, 'li a');",""," @method delegate"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {String | Function} filter"," @public"," @static"," **/"," delegate: function (node, subscription, notifier, filter) {"," subscription[HANDLES.START] = node.delegate(EVT_START, function (e) {"," this.touchStart(e, node, subscription, notifier, true);"," }, filter, this);"," },",""," /**"," Detaches the delegated event subscriptions set up by the event-tap module."," Only used if you use node.delegate(...) instead of node.on(...);",""," @method detachDelegate"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," detachDelegate: function (node, subscription, notifier) {"," detachHelper(subscription, HANDLES);"," },","",""," /**"," Called when the monitor(s) are tapped on, either through touchstart or mousedown.",""," @method touchStart"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @protected"," @static"," **/"," touchStart: function (event, node, subscription, notifier, delegate) {",""," var context = {"," canceled: false"," };"," //move ways to quit early to the top.",""," // no right clicks"," if (event.button && event.button === 3) {"," return;"," }",""," // for now just support a 1 finger count (later enhance via config)"," if (event.touches && event.touches.length !== 1) {"," return;"," }",""," context.node = delegate ? event.currentTarget : node;",""," //There is a double check in here to support event simulation tests, in which"," //event.touches can be undefined when simulating 'touchstart' on touch devices."," if (SUPPORTS_TOUCHES && event.touches) {"," context.startXY = [ event.touches[0].pageX, event.touches[0].pageY ];"," }"," else {"," context.startXY = [ event.pageX, event.pageY ];"," }",""," //Possibly outdated issue: something is off with the move that it attaches it but never triggers the handler"," subscription[HANDLES.MOVE] = node.once(EVT_MOVE, this.touchMove, this, node, subscription, notifier, delegate, context);"," subscription[HANDLES.END] = node.once(EVT_END, this.touchEnd, this, node, subscription, notifier, delegate, context);"," subscription[HANDLES.CANCEL] = node.once(EVT_CANCEL, this.touchMove, this, node, subscription, notifier, delegate, context);"," },",""," /**"," Called when the monitor(s) fires a touchmove or touchcancel event (or the mouse equivalent)."," This method detaches event handlers so that 'tap' is not fired.",""," @method touchMove"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @param {Object} context"," @protected"," @static"," **/"," touchMove: function (event, node, subscription, notifier, delegate, context) {"," detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);"," context.cancelled = true;",""," },",""," /**"," Called when the monitor(s) fires a touchend event (or the mouse equivalent)."," This method fires the 'tap' event if certain requirements are met.",""," @method touchEnd"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @param {Object} context"," @protected"," @static"," **/"," touchEnd: function (event, node, subscription, notifier, delegate, context) {"," var startXY = context.startXY,"," endXY,"," clientXY;",""," //There is a double check in here to support event simulation tests, in which"," //event.touches can be undefined when simulating 'touchstart' on touch devices."," if (SUPPORTS_TOUCHES && event.changedTouches) {"," endXY = [ event.changedTouches[0].pageX, event.changedTouches[0].pageY ];"," clientXY = [event.changedTouches[0].clientX, event.changedTouches[0].clientY];"," }"," else {"," endXY = [ event.pageX, event.pageY ];"," clientXY = [event.clientX, event.clientY];"," }",""," detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);",""," // make sure mouse didn't move"," if (Math.abs(endXY[0] - startXY[0]) === 0 && Math.abs(endXY[1] - startXY[1]) === 0) {",""," event.type = EVT_TAP;"," event.pageX = endXY[0];"," event.pageY = endXY[1];"," event.clientX = clientXY[0];"," event.clientY = clientXY[1];"," event.currentTarget = context.node;",""," notifier.fire(event);"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-base\", \"event-touch\", \"event-synthetic\"]});"];+_yuitest_coverage["build/event-tap/event-tap.js"].code=["YUI.add('event-tap', function (Y, NAME) {","","/**","The tap module provides a gesture events, \"tap\", which normalizes user interactions","across touch and mouse or pointer based input devices. This can be used by application developers","to build input device agnostic components which behave the same in response to either touch or mouse based","interaction.","","'tap' is like a touchscreen 'click', only it requires much less finger-down time since it listens to touch events,","but reverts to mouse events if touch is not supported. ","","@example",""," YUI().use('event-tap', function (Y) {"," Y.one('#my-button').on('tap', function (e) {"," });"," });","","@module event","@submodule event-tap","@author Andres Garza, matuzak and tilo mitra","@since 3.7.0 ","","*/","var doc = Y.config.doc,"," SUPPORTS_TOUCHES = !!(doc && doc.createTouch),"," EVT_START = SUPPORTS_TOUCHES ? 'touchstart' : 'mousedown',"," EVT_MOVE = SUPPORTS_TOUCHES ? 'touchmove' : 'mousemove',"," EVT_END = SUPPORTS_TOUCHES ? 'touchend' : 'mouseup',"," EVT_CANCEL = SUPPORTS_TOUCHES ? 'touchcancel' : 'mousecancel',"," EVT_TAP = 'tap',",""," HANDLES = {"," START: 'Y_TAP_ON_START_HANDLE',"," MOVE: 'Y_TAP_ON_MOVE_HANDLE',"," END: 'Y_TAP_ON_END_HANDLE',"," CANCEL: 'Y_TAP_ON_CANCEL_HANDLE'"," };","","function detachHelper(subscription, handles, subset, context) {",""," handles = subset ? handles : [ handles.START, handles.MOVE, handles.END, handles.CANCEL ];",""," Y.Array.each(handles, function (item, index, array) {"," var handle = subscription[item];"," if (handle) {"," handle.detach();"," subscription[item] = null;"," }"," });","","}","","","/**","Sets up a \"tap\" event, that is fired on touch devices in response to a tap event (finger down, finder up).","This event can be used instead of listening for click events which have a 500ms delay on most touch devices.","This event can also be listened for using node.delegate().","","@event tap","@param type {string} \"tap\"","@param fn {function} The method the event invokes. It receives the event facade of the underlying DOM event.","@for Event","@return {EventHandle} the detach handle","*/","Y.Event.define(EVT_TAP, {",""," /**"," This function should set up the node that will eventually fire the event.",""," Usage: ",""," node.on('tap', function (e) {"," });",""," @method on"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," on: function (node, subscription, notifier) {"," subscription[HANDLES.START] = node.on(EVT_START, this.touchStart, this, node, subscription, notifier);"," },",""," /**"," Detaches all event subscriptions set up by the event-tap module",""," @method detach"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," detach: function (node, subscription, notifier) {"," detachHelper(subscription, HANDLES);"," },",""," /**"," Event delegation for the 'tap' event. The delegated event will use a "," supplied selector or filtering function to test if the event references at least one "," node that should trigger the subscription callback.",""," Usage: ",""," node.delegate('tap', function (e) {"," }, 'li a');",""," @method delegate"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {String | Function} filter"," @public"," @static"," **/"," delegate: function (node, subscription, notifier, filter) {"," subscription[HANDLES.START] = node.delegate(EVT_START, function (e) {"," this.touchStart(e, node, subscription, notifier, true);"," }, filter, this);"," },",""," /**"," Detaches the delegated event subscriptions set up by the event-tap module."," Only used if you use node.delegate(...) instead of node.on(...);",""," @method detachDelegate"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @public"," @static"," **/"," detachDelegate: function (node, subscription, notifier) {"," detachHelper(subscription, HANDLES);"," },","",""," /**"," Called when the monitor(s) are tapped on, either through touchstart or mousedown.",""," @method touchStart"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @protected"," @static"," **/"," touchStart: function (event, node, subscription, notifier, delegate) {",""," var context = {"," canceled: false"," };"," //move ways to quit early to the top.",""," // no right clicks"," if (event.button && event.button === 3) {"," return;"," }",""," // for now just support a 1 finger count (later enhance via config)"," if (event.touches && event.touches.length !== 1) {"," return;"," }",""," context.node = delegate ? event.currentTarget : node;",""," //There is a double check in here to support event simulation tests, in which"," //event.touches can be undefined when simulating 'touchstart' on touch devices."," if (SUPPORTS_TOUCHES && event.touches) {"," context.startXY = [ event.touches[0].pageX, event.touches[0].pageY ];"," }"," else {"," context.startXY = [ event.pageX, event.pageY ];"," }",""," //Possibly outdated issue: something is off with the move that it attaches it but never triggers the handler"," subscription[HANDLES.MOVE] = node.once(EVT_MOVE, this.touchMove, this, node, subscription, notifier, delegate, context);"," subscription[HANDLES.END] = node.once(EVT_END, this.touchEnd, this, node, subscription, notifier, delegate, context);"," subscription[HANDLES.CANCEL] = node.once(EVT_CANCEL, this.touchMove, this, node, subscription, notifier, delegate, context);"," },",""," /**"," Called when the monitor(s) fires a touchmove or touchcancel event (or the mouse equivalent)."," This method detaches event handlers so that 'tap' is not fired.",""," @method touchMove"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @param {Object} context"," @protected"," @static"," **/"," touchMove: function (event, node, subscription, notifier, delegate, context) {"," detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);"," context.cancelled = true;",""," },",""," /**"," Called when the monitor(s) fires a touchend event (or the mouse equivalent)."," This method fires the 'tap' event if certain requirements are met.",""," @method touchEnd"," @param {DOMEventFacade} event"," @param {Y.Node} node"," @param {Array} subscription"," @param {Boolean} notifier"," @param {Boolean} delegate"," @param {Object} context"," @protected"," @static"," **/"," touchEnd: function (event, node, subscription, notifier, delegate, context) {"," var startXY = context.startXY,"," endXY,"," clientXY;",""," //There is a double check in here to support event simulation tests, in which"," //event.touches can be undefined when simulating 'touchstart' on touch devices."," if (SUPPORTS_TOUCHES && event.changedTouches) {"," endXY = [ event.changedTouches[0].pageX, event.changedTouches[0].pageY ];"," clientXY = [event.changedTouches[0].clientX, event.changedTouches[0].clientY];"," }"," else {"," endXY = [ event.pageX, event.pageY ];"," clientXY = [event.clientX, event.clientY];"," }",""," detachHelper(subscription, [ HANDLES.MOVE, HANDLES.END, HANDLES.CANCEL ], true, context);",""," // make sure mouse didn't move"," if (Math.abs(endXY[0] - startXY[0]) === 0 && Math.abs(endXY[1] - startXY[1]) === 0) {",""," event.type = EVT_TAP;"," event.pageX = endXY[0];"," event.pageY = endXY[1];"," event.clientX = clientXY[0];"," event.clientY = clientXY[1];"," event.currentTarget = context.node;",""," notifier.fire(event);"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-base\", \"event-touch\", \"event-synthetic\"]});"]; _yuitest_coverage["build/event-tap/event-tap.js"].lines = {"1":0,"25":0,"40":0,"42":0,"44":0,"45":0,"46":0,"47":0,"48":0,"66":0,"84":0,"98":0,"120":0,"121":0,"137":0,"155":0,"161":0,"162":0,"166":0,"167":0,"170":0,"174":0,"175":0,"178":0,"182":0,"183":0,"184":0,"202":0,"203":0,"222":0,"228":0,"229":0,"230":0,"233":0,"234":0,"237":0,"240":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"249":0}; _yuitest_coverage["build/event-tap/event-tap.js"].functions = {"(anonymous 2):44":0,"detachHelper:40":0,"on:83":0,"detach:97":0,"(anonymous 3):120":0,"delegate:119":0,"detachDelegate:136":0,"touchStart:153":0,"touchMove:201":0,"touchEnd:221":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-tap/event-tap.js"].coveredLines = 44;@@ -346,4 +346,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});
bundle/event-tap/event-tap-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -261,4 +261,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});
bundle/event-tap/event-tap-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-tap",function(e,t){function l(t,n,r,i){n=r?n:[n.START,n.MOVE,n.END,n.CANCEL],e.Array.each(n,function(e,n,r){var i=t[e];i&&(i.detach(),t[e]=null)})}var n=e.config.doc,r=!!n&&!!n.createTouch,i=r?"touchstart":"mousedown",s=r?"touchmove":"mousemove",o=r?"touchend":"mouseup",u=r?"touchcancel":"mousecancel",a="tap",f={START:"Y_TAP_ON_START_HANDLE",MOVE:"Y_TAP_ON_MOVE_HANDLE",END:"Y_TAP_ON_END_HANDLE",CANCEL:"Y_TAP_ON_CANCEL_HANDLE"};e.Event.define(a,{on:function(e,t,n){t[f.START]=e.on(i,this.touchStart,this,e,t,n)},detach:function(e,t,n){l(t,f)},delegate:function(e,t,n,r){t[f.START]=e.delegate(i,function(r){this.touchStart(r,e,t,n,!0)},r,this)},detachDelegate:function(e,t,n){l(t,f)},touchStart:function(e,t,n,i,a){var l={canceled:!1};if(e.button&&e.button===3)return;if(e.touches&&e.touches.length!==1)return;l.node=a?e.currentTarget:t,r&&e.touches?l.startXY=[e.touches[0].pageX,e.touches[0].pageY]:l.startXY=[e.pageX,e.pageY],n[f.MOVE]=t.once(s,this.touchMove,this,t,n,i,a,l),n[f.END]=t.once(o,this.touchEnd,this,t,n,i,a,l),n[f.CANCEL]=t.once(u,this.touchMove,this,t,n,i,a,l)},touchMove:function(e,t,n,r,i,s){l(n,[f.MOVE,f.END,f.CANCEL],!0,s),s.cancelled=!0},touchEnd:function(e,t,n,i,s,o){var u=o.startXY,c,h;r&&e.changedTouches?(c=[e.changedTouches[0].pageX,e.changedTouches[0].pageY],h=[e.changedTouches[0].clientX,e.changedTouches[0].clientY]):(c=[e.pageX,e.pageY],h=[e.clientX,e.clientY]),l(n,[f.MOVE,f.END,f.CANCEL],!0,o),Math.abs(c[0]-u[0])===0&&Math.abs(c[1]-u[1])===0&&(e.type=a,e.pageX=c[0],e.pageY=c[1],e.clientX=h[0],e.clientY=h[1],e.currentTarget=o.node,i.fire(e))}})},"3.7.2",{requires:["node-base","event-base","event-touch","event-synthetic"]});+YUI.add("event-tap",function(e,t){function l(t,n,r,i){n=r?n:[n.START,n.MOVE,n.END,n.CANCEL],e.Array.each(n,function(e,n,r){var i=t[e];i&&(i.detach(),t[e]=null)})}var n=e.config.doc,r=!!n&&!!n.createTouch,i=r?"touchstart":"mousedown",s=r?"touchmove":"mousemove",o=r?"touchend":"mouseup",u=r?"touchcancel":"mousecancel",a="tap",f={START:"Y_TAP_ON_START_HANDLE",MOVE:"Y_TAP_ON_MOVE_HANDLE",END:"Y_TAP_ON_END_HANDLE",CANCEL:"Y_TAP_ON_CANCEL_HANDLE"};e.Event.define(a,{on:function(e,t,n){t[f.START]=e.on(i,this.touchStart,this,e,t,n)},detach:function(e,t,n){l(t,f)},delegate:function(e,t,n,r){t[f.START]=e.delegate(i,function(r){this.touchStart(r,e,t,n,!0)},r,this)},detachDelegate:function(e,t,n){l(t,f)},touchStart:function(e,t,n,i,a){var l={canceled:!1};if(e.button&&e.button===3)return;if(e.touches&&e.touches.length!==1)return;l.node=a?e.currentTarget:t,r&&e.touches?l.startXY=[e.touches[0].pageX,e.touches[0].pageY]:l.startXY=[e.pageX,e.pageY],n[f.MOVE]=t.once(s,this.touchMove,this,t,n,i,a,l),n[f.END]=t.once(o,this.touchEnd,this,t,n,i,a,l),n[f.CANCEL]=t.once(u,this.touchMove,this,t,n,i,a,l)},touchMove:function(e,t,n,r,i,s){l(n,[f.MOVE,f.END,f.CANCEL],!0,s),s.cancelled=!0},touchEnd:function(e,t,n,i,s,o){var u=o.startXY,c,h;r&&e.changedTouches?(c=[e.changedTouches[0].pageX,e.changedTouches[0].pageY],h=[e.changedTouches[0].clientX,e.changedTouches[0].clientY]):(c=[e.pageX,e.pageY],h=[e.clientX,e.clientY]),l(n,[f.MOVE,f.END,f.CANCEL],!0,o),Math.abs(c[0]-u[0])===0&&Math.abs(c[1]-u[1])===0&&(e.type=a,e.pageX=c[0],e.pageY=c[1],e.clientX=h[0],e.clientY=h[1],e.currentTarget=o.node,i.fire(e))}})},"3.7.3",{requires:["node-base","event-base","event-touch","event-synthetic"]});
bundle/event-tap/event-tap.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -258,4 +258,4 @@ }); -}, '3.7.2', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});+}, '3.7.3', {"requires": ["node-base", "event-base", "event-touch", "event-synthetic"]});
bundle/event-touch/event-touch-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-touch/event-touch.js", code: [] };-_yuitest_coverage["build/event-touch/event-touch.js"].code=["YUI.add('event-touch', function (Y, NAME) {","","/**","Adds touch event facade normalization properties (touches, changedTouches, targetTouches etc.) to the DOM event facade. Adds","touch events to the DOM events whitelist. ","","@example"," YUI().use('event-touch', function (Y) {"," Y.one('#myDiv').on('touchstart', function(e) {"," ..."," });"," });","@module event","@submodule event-touch"," */","var SCALE = \"scale\","," ROTATION = \"rotation\","," IDENTIFIER = \"identifier\","," win = Y.config.win,"," GESTURE_MAP = {};","","/**"," * Adds touch event facade normalization properties to the DOM event facade"," *"," * @method _touch"," * @for DOMEventFacade"," * @private"," * @param ev {Event} the DOM event"," * @param currentTarget {HTMLElement} the element the listener was attached to"," * @param wrapper {Event.Custom} the custom event wrapper for this DOM event"," */","Y.DOMEventFacade.prototype._touch = function(e, currentTarget, wrapper) {",""," var i,l, etCached, et,touchCache;","",""," if (e.touches) {",""," /**"," * Array of individual touch events for touch points that are still in"," * contact with the touch surface."," *"," * @property touches"," * @type {DOMEventFacade[]}"," */"," this.touches = [];"," touchCache = {};",""," for (i = 0, l = e.touches.length; i < l; ++i) {"," et = e.touches[i];"," touchCache[Y.stamp(et)] = this.touches[i] = new Y.DOMEventFacade(et, currentTarget, wrapper);"," }"," }",""," if (e.targetTouches) {",""," /**"," * Array of individual touch events still in contact with the touch"," * surface and whose `touchstart` event occurred inside the same taregt"," * element as the current target element."," *"," * @property targetTouches"," * @type {DOMEventFacade[]}"," */"," this.targetTouches = [];",""," for (i = 0, l = e.targetTouches.length; i < l; ++i) {"," et = e.targetTouches[i];"," etCached = touchCache && touchCache[Y.stamp(et, true)];",""," this.targetTouches[i] = etCached || new Y.DOMEventFacade(et, currentTarget, wrapper);"," "," }"," }",""," if (e.changedTouches) {",""," /**"," An array of event-specific touch events.",""," For `touchstart`, the touch points that became active with the current"," event.",""," For `touchmove`, the touch points that have changed since the last"," event."," "," For `touchend`, the touch points that have been removed from the touch"," surface.",""," @property changedTouches"," @type {DOMEventFacade[]}"," **/"," this.changedTouches = [];",""," for (i = 0, l = e.changedTouches.length; i < l; ++i) {"," et = e.changedTouches[i];"," etCached = touchCache && touchCache[Y.stamp(et, true)];",""," this.changedTouches[i] = etCached || new Y.DOMEventFacade(et, currentTarget, wrapper);"," "," }"," }",""," if (SCALE in e) {"," this[SCALE] = e[SCALE];"," }",""," if (ROTATION in e) {"," this[ROTATION] = e[ROTATION];"," }",""," if (IDENTIFIER in e) {"," this[IDENTIFIER] = e[IDENTIFIER];"," }","};","","//Adding MSPointer events to whitelisted DOM Events. MSPointer event payloads","//have the same properties as mouse events.","if (Y.Node.DOM_EVENTS) {"," Y.mix(Y.Node.DOM_EVENTS, {"," touchstart:1,"," touchmove:1,"," touchend:1,"," touchcancel:1,"," gesturestart:1,"," gesturechange:1,"," gestureend:1,"," MSPointerDown:1, "," MSPointerUp:1,"," MSPointerMove:1"," });","}","","//Add properties to Y.EVENT.GESTURE_MAP based on feature detection.","if ((win && (\"ontouchstart\" in win)) && !(Y.UA.chrome && Y.UA.chrome < 6)) {"," GESTURE_MAP.start = \"touchstart\";"," GESTURE_MAP.end = \"touchend\";"," GESTURE_MAP.move = \"touchmove\";","}","","","","else if (win && (\"msPointerEnabled\" in win.navigator)) {"," GESTURE_MAP.start = \"MSPointerDown\";"," GESTURE_MAP.end = \"MSPointerUp\";"," GESTURE_MAP.move = \"MSPointerMove\";","}","","else {"," GESTURE_MAP.start = \"mousedown\";"," GESTURE_MAP.end = \"mouseup\";"," GESTURE_MAP.move = \"mousemove\";","}","","/**"," * A object literal with keys \"start\", \"end\", and \"move\". The value for each key is a"," * string representing the event for that environment. For touch environments, the respective"," * values are \"touchstart\", \"touchend\" and \"touchmove\". Mouse and MSPointer environments are also"," * supported via feature detection."," *"," * @property _GESTURE_MAP"," * @type Object"," * @static"," */","Y.Event._GESTURE_MAP = GESTURE_MAP;","","","}, '3.7.2', {\"requires\": [\"node-base\"]});"];+_yuitest_coverage["build/event-touch/event-touch.js"].code=["YUI.add('event-touch', function (Y, NAME) {","","/**","Adds touch event facade normalization properties (touches, changedTouches, targetTouches etc.) to the DOM event facade. Adds","touch events to the DOM events whitelist. ","","@example"," YUI().use('event-touch', function (Y) {"," Y.one('#myDiv').on('touchstart', function(e) {"," ..."," });"," });","@module event","@submodule event-touch"," */","var SCALE = \"scale\","," ROTATION = \"rotation\","," IDENTIFIER = \"identifier\","," win = Y.config.win,"," GESTURE_MAP = {};","","/**"," * Adds touch event facade normalization properties to the DOM event facade"," *"," * @method _touch"," * @for DOMEventFacade"," * @private"," * @param ev {Event} the DOM event"," * @param currentTarget {HTMLElement} the element the listener was attached to"," * @param wrapper {Event.Custom} the custom event wrapper for this DOM event"," */","Y.DOMEventFacade.prototype._touch = function(e, currentTarget, wrapper) {",""," var i,l, etCached, et,touchCache;","",""," if (e.touches) {",""," /**"," * Array of individual touch events for touch points that are still in"," * contact with the touch surface."," *"," * @property touches"," * @type {DOMEventFacade[]}"," */"," this.touches = [];"," touchCache = {};",""," for (i = 0, l = e.touches.length; i < l; ++i) {"," et = e.touches[i];"," touchCache[Y.stamp(et)] = this.touches[i] = new Y.DOMEventFacade(et, currentTarget, wrapper);"," }"," }",""," if (e.targetTouches) {",""," /**"," * Array of individual touch events still in contact with the touch"," * surface and whose `touchstart` event occurred inside the same taregt"," * element as the current target element."," *"," * @property targetTouches"," * @type {DOMEventFacade[]}"," */"," this.targetTouches = [];",""," for (i = 0, l = e.targetTouches.length; i < l; ++i) {"," et = e.targetTouches[i];"," etCached = touchCache && touchCache[Y.stamp(et, true)];",""," this.targetTouches[i] = etCached || new Y.DOMEventFacade(et, currentTarget, wrapper);"," "," }"," }",""," if (e.changedTouches) {",""," /**"," An array of event-specific touch events.",""," For `touchstart`, the touch points that became active with the current"," event.",""," For `touchmove`, the touch points that have changed since the last"," event."," "," For `touchend`, the touch points that have been removed from the touch"," surface.",""," @property changedTouches"," @type {DOMEventFacade[]}"," **/"," this.changedTouches = [];",""," for (i = 0, l = e.changedTouches.length; i < l; ++i) {"," et = e.changedTouches[i];"," etCached = touchCache && touchCache[Y.stamp(et, true)];",""," this.changedTouches[i] = etCached || new Y.DOMEventFacade(et, currentTarget, wrapper);"," "," }"," }",""," if (SCALE in e) {"," this[SCALE] = e[SCALE];"," }",""," if (ROTATION in e) {"," this[ROTATION] = e[ROTATION];"," }",""," if (IDENTIFIER in e) {"," this[IDENTIFIER] = e[IDENTIFIER];"," }","};","","//Adding MSPointer events to whitelisted DOM Events. MSPointer event payloads","//have the same properties as mouse events.","if (Y.Node.DOM_EVENTS) {"," Y.mix(Y.Node.DOM_EVENTS, {"," touchstart:1,"," touchmove:1,"," touchend:1,"," touchcancel:1,"," gesturestart:1,"," gesturechange:1,"," gestureend:1,"," MSPointerDown:1, "," MSPointerUp:1,"," MSPointerMove:1"," });","}","","//Add properties to Y.EVENT.GESTURE_MAP based on feature detection.","if ((win && (\"ontouchstart\" in win)) && !(Y.UA.chrome && Y.UA.chrome < 6)) {"," GESTURE_MAP.start = \"touchstart\";"," GESTURE_MAP.end = \"touchend\";"," GESTURE_MAP.move = \"touchmove\";","}","","","","else if (win && (\"msPointerEnabled\" in win.navigator)) {"," GESTURE_MAP.start = \"MSPointerDown\";"," GESTURE_MAP.end = \"MSPointerUp\";"," GESTURE_MAP.move = \"MSPointerMove\";","}","","else {"," GESTURE_MAP.start = \"mousedown\";"," GESTURE_MAP.end = \"mouseup\";"," GESTURE_MAP.move = \"mousemove\";","}","","/**"," * A object literal with keys \"start\", \"end\", and \"move\". The value for each key is a"," * string representing the event for that environment. For touch environments, the respective"," * values are \"touchstart\", \"touchend\" and \"touchmove\". Mouse and MSPointer environments are also"," * supported via feature detection."," *"," * @property _GESTURE_MAP"," * @type Object"," * @static"," */","Y.Event._GESTURE_MAP = GESTURE_MAP;","","","}, '3.7.3', {\"requires\": [\"node-base\"]});"]; _yuitest_coverage["build/event-touch/event-touch.js"].lines = {"1":0,"16":0,"32":0,"34":0,"37":0,"46":0,"47":0,"49":0,"50":0,"51":0,"55":0,"65":0,"67":0,"68":0,"69":0,"71":0,"76":0,"93":0,"95":0,"96":0,"97":0,"99":0,"104":0,"105":0,"108":0,"109":0,"112":0,"113":0,"119":0,"120":0,"135":0,"136":0,"137":0,"138":0,"143":0,"144":0,"145":0,"146":0,"150":0,"151":0,"152":0,"165":0}; _yuitest_coverage["build/event-touch/event-touch.js"].functions = {"_touch:32":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-touch/event-touch.js"].coveredLines = 42;@@ -248,4 +248,4 @@ Y.Event._GESTURE_MAP = GESTURE_MAP; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-touch/event-touch-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -177,4 +177,4 @@ Y.Event._GESTURE_MAP = GESTURE_MAP; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-touch/event-touch-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-touch",function(e,t){var n="scale",r="rotation",i="identifier",s=e.config.win,o={};e.DOMEventFacade.prototype._touch=function(t,s,o){var u,a,f,l,c;if(t.touches){this.touches=[],c={};for(u=0,a=t.touches.length;u<a;++u)l=t.touches[u],c[e.stamp(l)]=this.touches[u]=new e.DOMEventFacade(l,s,o)}if(t.targetTouches){this.targetTouches=[];for(u=0,a=t.targetTouches.length;u<a;++u)l=t.targetTouches[u],f=c&&c[e.stamp(l,!0)],this.targetTouches[u]=f||new e.DOMEventFacade(l,s,o)}if(t.changedTouches){this.changedTouches=[];for(u=0,a=t.changedTouches.length;u<a;++u)l=t.changedTouches[u],f=c&&c[e.stamp(l,!0)],this.changedTouches[u]=f||new e.DOMEventFacade(l,s,o)}n in t&&(this[n]=t[n]),r in t&&(this[r]=t[r]),i in t&&(this[i]=t[i])},e.Node.DOM_EVENTS&&e.mix(e.Node.DOM_EVENTS,{touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,MSPointerDown:1,MSPointerUp:1,MSPointerMove:1}),s&&"ontouchstart"in s&&!(e.UA.chrome&&e.UA.chrome<6)?(o.start="touchstart",o.end="touchend",o.move="touchmove"):s&&"msPointerEnabled"in s.navigator?(o.start="MSPointerDown",o.end="MSPointerUp",o.move="MSPointerMove"):(o.start="mousedown",o.end="mouseup",o.move="mousemove"),e.Event._GESTURE_MAP=o},"3.7.2",{requires:["node-base"]});+YUI.add("event-touch",function(e,t){var n="scale",r="rotation",i="identifier",s=e.config.win,o={};e.DOMEventFacade.prototype._touch=function(t,s,o){var u,a,f,l,c;if(t.touches){this.touches=[],c={};for(u=0,a=t.touches.length;u<a;++u)l=t.touches[u],c[e.stamp(l)]=this.touches[u]=new e.DOMEventFacade(l,s,o)}if(t.targetTouches){this.targetTouches=[];for(u=0,a=t.targetTouches.length;u<a;++u)l=t.targetTouches[u],f=c&&c[e.stamp(l,!0)],this.targetTouches[u]=f||new e.DOMEventFacade(l,s,o)}if(t.changedTouches){this.changedTouches=[];for(u=0,a=t.changedTouches.length;u<a;++u)l=t.changedTouches[u],f=c&&c[e.stamp(l,!0)],this.changedTouches[u]=f||new e.DOMEventFacade(l,s,o)}n in t&&(this[n]=t[n]),r in t&&(this[r]=t[r]),i in t&&(this[i]=t[i])},e.Node.DOM_EVENTS&&e.mix(e.Node.DOM_EVENTS,{touchstart:1,touchmove:1,touchend:1,touchcancel:1,gesturestart:1,gesturechange:1,gestureend:1,MSPointerDown:1,MSPointerUp:1,MSPointerMove:1}),s&&"ontouchstart"in s&&!(e.UA.chrome&&e.UA.chrome<6)?(o.start="touchstart",o.end="touchend",o.move="touchmove"):s&&"msPointerEnabled"in s.navigator?(o.start="MSPointerDown",o.end="MSPointerUp",o.move="MSPointerMove"):(o.start="mousedown",o.end="mouseup",o.move="mousemove"),e.Event._GESTURE_MAP=o},"3.7.3",{requires:["node-base"]});
bundle/event-touch/event-touch.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -171,4 +171,4 @@ Y.Event._GESTURE_MAP = GESTURE_MAP; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/event-valuechange/event-valuechange-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/event-valuechange/event-valuechange.js", code: [] };-_yuitest_coverage["build/event-valuechange/event-valuechange.js"].code=["YUI.add('event-valuechange', function (Y, NAME) {","","/**","Adds a synthetic `valuechange` event that fires when the `value` property of an","`<input>` or `<textarea>` node changes as a result of a keystroke, mouse","operation, or input method editor (IME) input event.","","Usage:",""," YUI().use('event-valuechange', function (Y) {"," Y.one('#my-input').on('valuechange', function (e) {"," });"," });","","@module event-valuechange","**/","","/**","Provides the implementation for the synthetic `valuechange` event. This class","isn't meant to be used directly, but is public to make monkeypatching possible.","","Usage:",""," YUI().use('event-valuechange', function (Y) {"," Y.one('#my-input').on('valuechange', function (e) {"," });"," });","","@class ValueChange","@static","*/","","var DATA_KEY = '_valuechange',"," VALUE = 'value',",""," config, // defined at the end of this file","","// Just a simple namespace to make methods overridable.","VC = {"," // -- Static Constants -----------------------------------------------------",""," /**"," Interval (in milliseconds) at which to poll for changes to the value of an"," element with one or more `valuechange` subscribers when the user is likely"," to be interacting with it.",""," @property POLL_INTERVAL"," @type Number"," @default 50"," @static"," **/"," POLL_INTERVAL: 50,",""," /**"," Timeout (in milliseconds) after which to stop polling when there hasn't been"," any new activity (keypresses, mouse clicks, etc.) on an element.",""," @property TIMEOUT"," @type Number"," @default 10000"," @static"," **/"," TIMEOUT: 10000,",""," // -- Protected Static Methods ---------------------------------------------",""," /**"," Called at an interval to poll for changes to the value of the specified"," node.",""," @method _poll"," @param {Node} node Node to poll.",""," @param {Object} options Options object."," @param {EventFacade} [options.e] Event facade of the event that"," initiated the polling.",""," @protected"," @static"," **/"," _poll: function (node, options) {"," var domNode = node._node, // performance cheat; getValue() is a big hit when polling"," event = options.e,"," newVal = domNode && domNode.value,"," vcData = node._data && node._data[DATA_KEY], // another perf cheat"," facade, prevVal;",""," if (!domNode || !vcData) {"," VC._stopPolling(node);"," return;"," }",""," prevVal = vcData.prevVal;",""," if (newVal !== prevVal) {"," vcData.prevVal = newVal;",""," facade = {"," _event : event,"," currentTarget: (event && event.currentTarget) || node,"," newVal : newVal,"," prevVal : prevVal,"," target : (event && event.target) || node"," };",""," Y.Object.each(vcData.notifiers, function (notifier) {"," notifier.fire(facade);"," });",""," VC._refreshTimeout(node);"," }"," },",""," /**"," Restarts the inactivity timeout for the specified node.",""," @method _refreshTimeout"," @param {Node} node Node to refresh."," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _refreshTimeout: function (node, notifier) {"," // The node may have been destroyed, so check that it still exists"," // before trying to get its data. Otherwise an error will occur."," if (!node._node) {"," return;"," }",""," var vcData = node.getData(DATA_KEY);",""," VC._stopTimeout(node); // avoid dupes",""," // If we don't see any changes within the timeout period (10 seconds by"," // default), stop polling."," vcData.timeout = setTimeout(function () {"," VC._stopPolling(node, notifier);"," }, VC.TIMEOUT);",""," },",""," /**"," Begins polling for changes to the `value` property of the specified node. If"," polling is already underway for the specified node, it will not be restarted"," unless the `force` option is `true`",""," @method _startPolling"," @param {Node} node Node to watch."," @param {SyntheticEvent.Notifier} notifier",""," @param {Object} options Options object."," @param {EventFacade} [options.e] Event facade of the event that"," initiated the polling."," @param {Boolean} [options.force=false] If `true`, polling will be"," restarted even if we're already polling this node.",""," @protected"," @static"," **/"," _startPolling: function (node, notifier, options) {"," if (!node.test('input,textarea')) {"," return;"," }",""," var vcData = node.getData(DATA_KEY);",""," if (!vcData) {"," vcData = {prevVal: node.get(VALUE)};"," node.setData(DATA_KEY, vcData);"," }",""," vcData.notifiers || (vcData.notifiers = {});",""," // Don't bother continuing if we're already polling this node, unless"," // `options.force` is true."," if (vcData.interval) {"," if (options.force) {"," VC._stopPolling(node, notifier); // restart polling, but avoid dupe polls"," } else {"," vcData.notifiers[Y.stamp(notifier)] = notifier;"," return;"," }"," }",""," // Poll for changes to the node's value. We can't rely on keyboard"," // events for this, since the value may change due to a mouse-initiated"," // paste event, an IME input event, or for some other reason that"," // doesn't trigger a key event."," vcData.notifiers[Y.stamp(notifier)] = notifier;",""," vcData.interval = setInterval(function () {"," VC._poll(node, vcData, options);"," }, VC.POLL_INTERVAL);","",""," VC._refreshTimeout(node, notifier);"," },",""," /**"," Stops polling for changes to the specified node's `value` attribute.",""," @method _stopPolling"," @param {Node} node Node to stop polling on."," @param {SyntheticEvent.Notifier} [notifier] Notifier to remove from the"," node. If not specified, all notifiers will be removed."," @protected"," @static"," **/"," _stopPolling: function (node, notifier) {"," // The node may have been destroyed, so check that it still exists"," // before trying to get its data. Otherwise an error will occur."," if (!node._node) {"," return;"," }",""," var vcData = node.getData(DATA_KEY) || {};",""," clearInterval(vcData.interval);"," delete vcData.interval;",""," VC._stopTimeout(node);",""," if (notifier) {"," vcData.notifiers && delete vcData.notifiers[Y.stamp(notifier)];"," } else {"," vcData.notifiers = {};"," }",""," },",""," /**"," Clears the inactivity timeout for the specified node, if any.",""," @method _stopTimeout"," @param {Node} node"," @protected"," @static"," **/"," _stopTimeout: function (node) {"," var vcData = node.getData(DATA_KEY) || {};",""," clearTimeout(vcData.timeout);"," delete vcData.timeout;"," },",""," // -- Protected Static Event Handlers --------------------------------------",""," /**"," Stops polling when a node's blur event fires.",""," @method _onBlur"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onBlur: function (e, notifier) {"," VC._stopPolling(e.currentTarget, notifier);"," },",""," /**"," Resets a node's history and starts polling when a focus event occurs.",""," @method _onFocus"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onFocus: function (e, notifier) {"," var node = e.currentTarget,"," vcData = node.getData(DATA_KEY);",""," if (!vcData) {"," vcData = {};"," node.setData(DATA_KEY, vcData);"," }",""," vcData.prevVal = node.get(VALUE);",""," VC._startPolling(node, notifier, {e: e});"," },",""," /**"," Starts polling when a node receives a keyDown event.",""," @method _onKeyDown"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onKeyDown: function (e, notifier) {"," VC._startPolling(e.currentTarget, notifier, {e: e});"," },",""," /**"," Starts polling when an IME-related keyUp event occurs on a node.",""," @method _onKeyUp"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onKeyUp: function (e, notifier) {"," // These charCodes indicate that an IME has started. We'll restart"," // polling and give the IME up to 10 seconds (by default) to finish."," if (e.charCode === 229 || e.charCode === 197) {"," VC._startPolling(e.currentTarget, notifier, {"," e : e,"," force: true"," });"," }"," },",""," /**"," Starts polling when a node receives a mouseDown event.",""," @method _onMouseDown"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onMouseDown: function (e, notifier) {"," VC._startPolling(e.currentTarget, notifier, {e: e});"," },",""," /**"," Called when the `valuechange` event receives a new subscriber.",""," @method _onSubscribe"," @param {Node} node"," @param {Subscription} sub"," @param {SyntheticEvent.Notifier} notifier"," @param {Function|String} [filter] Filter function or selector string. Only"," provided for delegate subscriptions."," @protected"," @static"," **/"," _onSubscribe: function (node, sub, notifier, filter) {"," var _valuechange, callbacks, nodes;",""," callbacks = {"," blur : VC._onBlur,"," focus : VC._onFocus,"," keydown : VC._onKeyDown,"," keyup : VC._onKeyUp,"," mousedown: VC._onMouseDown"," };",""," // Store a utility object on the notifier to hold stuff that needs to be"," // passed around to trigger event handlers, polling handlers, etc."," _valuechange = notifier._valuechange = {};",""," if (filter) {"," // If a filter is provided, then this is a delegated subscription."," _valuechange.delegated = true;",""," // Add a function to the notifier that we can use to find all"," // nodes that pass the delegate filter."," _valuechange.getNodes = function () {"," return node.all('input,textarea').filter(filter);"," };",""," // Store the initial values for each descendant of the container"," // node that passes the delegate filter."," _valuechange.getNodes().each(function (child) {"," if (!child.getData(DATA_KEY)) {"," child.setData(DATA_KEY, {prevVal: child.get(VALUE)});"," }"," });",""," notifier._handles = Y.delegate(callbacks, node, filter, null,"," notifier);"," } else {"," // This is a normal (non-delegated) event subscription.",""," if (!node.test('input,textarea')) {"," return;"," }",""," if (!node.getData(DATA_KEY)) {"," node.setData(DATA_KEY, {prevVal: node.get(VALUE)});"," }",""," notifier._handles = node.on(callbacks, null, null, notifier);"," }"," },",""," /**"," Called when the `valuechange` event loses a subscriber.",""," @method _onUnsubscribe"," @param {Node} node"," @param {Subscription} subscription"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onUnsubscribe: function (node, subscription, notifier) {"," var _valuechange = notifier._valuechange;",""," notifier._handles && notifier._handles.detach();",""," if (_valuechange.delegated) {"," _valuechange.getNodes().each(function (child) {"," VC._stopPolling(child, notifier);"," });"," } else {"," VC._stopPolling(node, notifier);"," }"," }","};","","/**","Synthetic event that fires when the `value` property of an `<input>` or","`<textarea>` node changes as a result of a user-initiated keystroke, mouse","operation, or input method editor (IME) input event.","","Unlike the `onchange` event, this event fires when the value actually changes","and not when the element loses focus. This event also reports IME and","multi-stroke input more reliably than `oninput` or the various key events across","browsers.","","For performance reasons, only focused nodes are monitored for changes, so","programmatic value changes on nodes that don't have focus won't be detected.","","@example",""," YUI().use('event-valuechange', function (Y) {"," Y.one('#my-input').on('valuechange', function (e) {"," });"," });","","@event valuechange","@param {String} prevVal Previous value prior to the latest change.","@param {String} newVal New value after the latest change.","@for YUI","**/","","config = {"," detach: VC._onUnsubscribe,"," on : VC._onSubscribe,",""," delegate : VC._onSubscribe,"," detachDelegate: VC._onUnsubscribe,",""," publishConfig: {"," emitFacade: true"," }","};","","Y.Event.define('valuechange', config);","Y.Event.define('valueChange', config); // deprecated, but supported for backcompat","","Y.ValueChange = VC;","","","}, '3.7.2', {\"requires\": [\"event-focus\", \"event-synthetic\"]});"];+_yuitest_coverage["build/event-valuechange/event-valuechange.js"].code=["YUI.add('event-valuechange', function (Y, NAME) {","","/**","Adds a synthetic `valuechange` event that fires when the `value` property of an","`<input>` or `<textarea>` node changes as a result of a keystroke, mouse","operation, or input method editor (IME) input event.","","Usage:",""," YUI().use('event-valuechange', function (Y) {"," Y.one('#my-input').on('valuechange', function (e) {"," });"," });","","@module event-valuechange","**/","","/**","Provides the implementation for the synthetic `valuechange` event. This class","isn't meant to be used directly, but is public to make monkeypatching possible.","","Usage:",""," YUI().use('event-valuechange', function (Y) {"," Y.one('#my-input').on('valuechange', function (e) {"," });"," });","","@class ValueChange","@static","*/","","var DATA_KEY = '_valuechange',"," VALUE = 'value',",""," config, // defined at the end of this file","","// Just a simple namespace to make methods overridable.","VC = {"," // -- Static Constants -----------------------------------------------------",""," /**"," Interval (in milliseconds) at which to poll for changes to the value of an"," element with one or more `valuechange` subscribers when the user is likely"," to be interacting with it.",""," @property POLL_INTERVAL"," @type Number"," @default 50"," @static"," **/"," POLL_INTERVAL: 50,",""," /**"," Timeout (in milliseconds) after which to stop polling when there hasn't been"," any new activity (keypresses, mouse clicks, etc.) on an element.",""," @property TIMEOUT"," @type Number"," @default 10000"," @static"," **/"," TIMEOUT: 10000,",""," // -- Protected Static Methods ---------------------------------------------",""," /**"," Called at an interval to poll for changes to the value of the specified"," node.",""," @method _poll"," @param {Node} node Node to poll.",""," @param {Object} options Options object."," @param {EventFacade} [options.e] Event facade of the event that"," initiated the polling.",""," @protected"," @static"," **/"," _poll: function (node, options) {"," var domNode = node._node, // performance cheat; getValue() is a big hit when polling"," event = options.e,"," newVal = domNode && domNode.value,"," vcData = node._data && node._data[DATA_KEY], // another perf cheat"," facade, prevVal;",""," if (!domNode || !vcData) {"," VC._stopPolling(node);"," return;"," }",""," prevVal = vcData.prevVal;",""," if (newVal !== prevVal) {"," vcData.prevVal = newVal;",""," facade = {"," _event : event,"," currentTarget: (event && event.currentTarget) || node,"," newVal : newVal,"," prevVal : prevVal,"," target : (event && event.target) || node"," };",""," Y.Object.each(vcData.notifiers, function (notifier) {"," notifier.fire(facade);"," });",""," VC._refreshTimeout(node);"," }"," },",""," /**"," Restarts the inactivity timeout for the specified node.",""," @method _refreshTimeout"," @param {Node} node Node to refresh."," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _refreshTimeout: function (node, notifier) {"," // The node may have been destroyed, so check that it still exists"," // before trying to get its data. Otherwise an error will occur."," if (!node._node) {"," return;"," }",""," var vcData = node.getData(DATA_KEY);",""," VC._stopTimeout(node); // avoid dupes",""," // If we don't see any changes within the timeout period (10 seconds by"," // default), stop polling."," vcData.timeout = setTimeout(function () {"," VC._stopPolling(node, notifier);"," }, VC.TIMEOUT);",""," },",""," /**"," Begins polling for changes to the `value` property of the specified node. If"," polling is already underway for the specified node, it will not be restarted"," unless the `force` option is `true`",""," @method _startPolling"," @param {Node} node Node to watch."," @param {SyntheticEvent.Notifier} notifier",""," @param {Object} options Options object."," @param {EventFacade} [options.e] Event facade of the event that"," initiated the polling."," @param {Boolean} [options.force=false] If `true`, polling will be"," restarted even if we're already polling this node.",""," @protected"," @static"," **/"," _startPolling: function (node, notifier, options) {"," if (!node.test('input,textarea')) {"," return;"," }",""," var vcData = node.getData(DATA_KEY);",""," if (!vcData) {"," vcData = {prevVal: node.get(VALUE)};"," node.setData(DATA_KEY, vcData);"," }",""," vcData.notifiers || (vcData.notifiers = {});",""," // Don't bother continuing if we're already polling this node, unless"," // `options.force` is true."," if (vcData.interval) {"," if (options.force) {"," VC._stopPolling(node, notifier); // restart polling, but avoid dupe polls"," } else {"," vcData.notifiers[Y.stamp(notifier)] = notifier;"," return;"," }"," }",""," // Poll for changes to the node's value. We can't rely on keyboard"," // events for this, since the value may change due to a mouse-initiated"," // paste event, an IME input event, or for some other reason that"," // doesn't trigger a key event."," vcData.notifiers[Y.stamp(notifier)] = notifier;",""," vcData.interval = setInterval(function () {"," VC._poll(node, vcData, options);"," }, VC.POLL_INTERVAL);","",""," VC._refreshTimeout(node, notifier);"," },",""," /**"," Stops polling for changes to the specified node's `value` attribute.",""," @method _stopPolling"," @param {Node} node Node to stop polling on."," @param {SyntheticEvent.Notifier} [notifier] Notifier to remove from the"," node. If not specified, all notifiers will be removed."," @protected"," @static"," **/"," _stopPolling: function (node, notifier) {"," // The node may have been destroyed, so check that it still exists"," // before trying to get its data. Otherwise an error will occur."," if (!node._node) {"," return;"," }",""," var vcData = node.getData(DATA_KEY) || {};",""," clearInterval(vcData.interval);"," delete vcData.interval;",""," VC._stopTimeout(node);",""," if (notifier) {"," vcData.notifiers && delete vcData.notifiers[Y.stamp(notifier)];"," } else {"," vcData.notifiers = {};"," }",""," },",""," /**"," Clears the inactivity timeout for the specified node, if any.",""," @method _stopTimeout"," @param {Node} node"," @protected"," @static"," **/"," _stopTimeout: function (node) {"," var vcData = node.getData(DATA_KEY) || {};",""," clearTimeout(vcData.timeout);"," delete vcData.timeout;"," },",""," // -- Protected Static Event Handlers --------------------------------------",""," /**"," Stops polling when a node's blur event fires.",""," @method _onBlur"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onBlur: function (e, notifier) {"," VC._stopPolling(e.currentTarget, notifier);"," },",""," /**"," Resets a node's history and starts polling when a focus event occurs.",""," @method _onFocus"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onFocus: function (e, notifier) {"," var node = e.currentTarget,"," vcData = node.getData(DATA_KEY);",""," if (!vcData) {"," vcData = {};"," node.setData(DATA_KEY, vcData);"," }",""," vcData.prevVal = node.get(VALUE);",""," VC._startPolling(node, notifier, {e: e});"," },",""," /**"," Starts polling when a node receives a keyDown event.",""," @method _onKeyDown"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onKeyDown: function (e, notifier) {"," VC._startPolling(e.currentTarget, notifier, {e: e});"," },",""," /**"," Starts polling when an IME-related keyUp event occurs on a node.",""," @method _onKeyUp"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onKeyUp: function (e, notifier) {"," // These charCodes indicate that an IME has started. We'll restart"," // polling and give the IME up to 10 seconds (by default) to finish."," if (e.charCode === 229 || e.charCode === 197) {"," VC._startPolling(e.currentTarget, notifier, {"," e : e,"," force: true"," });"," }"," },",""," /**"," Starts polling when a node receives a mouseDown event.",""," @method _onMouseDown"," @param {EventFacade} e"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onMouseDown: function (e, notifier) {"," VC._startPolling(e.currentTarget, notifier, {e: e});"," },",""," /**"," Called when the `valuechange` event receives a new subscriber.",""," @method _onSubscribe"," @param {Node} node"," @param {Subscription} sub"," @param {SyntheticEvent.Notifier} notifier"," @param {Function|String} [filter] Filter function or selector string. Only"," provided for delegate subscriptions."," @protected"," @static"," **/"," _onSubscribe: function (node, sub, notifier, filter) {"," var _valuechange, callbacks, nodes;",""," callbacks = {"," blur : VC._onBlur,"," focus : VC._onFocus,"," keydown : VC._onKeyDown,"," keyup : VC._onKeyUp,"," mousedown: VC._onMouseDown"," };",""," // Store a utility object on the notifier to hold stuff that needs to be"," // passed around to trigger event handlers, polling handlers, etc."," _valuechange = notifier._valuechange = {};",""," if (filter) {"," // If a filter is provided, then this is a delegated subscription."," _valuechange.delegated = true;",""," // Add a function to the notifier that we can use to find all"," // nodes that pass the delegate filter."," _valuechange.getNodes = function () {"," return node.all('input,textarea').filter(filter);"," };",""," // Store the initial values for each descendant of the container"," // node that passes the delegate filter."," _valuechange.getNodes().each(function (child) {"," if (!child.getData(DATA_KEY)) {"," child.setData(DATA_KEY, {prevVal: child.get(VALUE)});"," }"," });",""," notifier._handles = Y.delegate(callbacks, node, filter, null,"," notifier);"," } else {"," // This is a normal (non-delegated) event subscription.",""," if (!node.test('input,textarea')) {"," return;"," }",""," if (!node.getData(DATA_KEY)) {"," node.setData(DATA_KEY, {prevVal: node.get(VALUE)});"," }",""," notifier._handles = node.on(callbacks, null, null, notifier);"," }"," },",""," /**"," Called when the `valuechange` event loses a subscriber.",""," @method _onUnsubscribe"," @param {Node} node"," @param {Subscription} subscription"," @param {SyntheticEvent.Notifier} notifier"," @protected"," @static"," **/"," _onUnsubscribe: function (node, subscription, notifier) {"," var _valuechange = notifier._valuechange;",""," notifier._handles && notifier._handles.detach();",""," if (_valuechange.delegated) {"," _valuechange.getNodes().each(function (child) {"," VC._stopPolling(child, notifier);"," });"," } else {"," VC._stopPolling(node, notifier);"," }"," }","};","","/**","Synthetic event that fires when the `value` property of an `<input>` or","`<textarea>` node changes as a result of a user-initiated keystroke, mouse","operation, or input method editor (IME) input event.","","Unlike the `onchange` event, this event fires when the value actually changes","and not when the element loses focus. This event also reports IME and","multi-stroke input more reliably than `oninput` or the various key events across","browsers.","","For performance reasons, only focused nodes are monitored for changes, so","programmatic value changes on nodes that don't have focus won't be detected.","","@example",""," YUI().use('event-valuechange', function (Y) {"," Y.one('#my-input').on('valuechange', function (e) {"," });"," });","","@event valuechange","@param {String} prevVal Previous value prior to the latest change.","@param {String} newVal New value after the latest change.","@for YUI","**/","","config = {"," detach: VC._onUnsubscribe,"," on : VC._onSubscribe,",""," delegate : VC._onSubscribe,"," detachDelegate: VC._onUnsubscribe,",""," publishConfig: {"," emitFacade: true"," }","};","","Y.Event.define('valuechange', config);","Y.Event.define('valueChange', config); // deprecated, but supported for backcompat","","Y.ValueChange = VC;","","","}, '3.7.3', {\"requires\": [\"event-focus\", \"event-synthetic\"]});"]; _yuitest_coverage["build/event-valuechange/event-valuechange.js"].lines = {"1":0,"33":0,"82":0,"88":0,"89":0,"90":0,"93":0,"95":0,"96":0,"98":0,"106":0,"107":0,"110":0,"126":0,"127":0,"130":0,"132":0,"136":0,"137":0,"161":0,"162":0,"165":0,"167":0,"168":0,"169":0,"172":0,"176":0,"177":0,"178":0,"180":0,"181":0,"189":0,"191":0,"192":0,"196":0,"212":0,"213":0,"216":0,"218":0,"219":0,"221":0,"223":0,"224":0,"226":0,"240":0,"242":0,"243":0,"258":0,"271":0,"274":0,"275":0,"276":0,"279":0,"281":0,"294":0,"309":0,"310":0,"327":0,"343":0,"345":0,"355":0,"357":0,"359":0,"363":0,"364":0,"369":0,"370":0,"371":0,"375":0,"380":0,"381":0,"384":0,"385":0,"388":0,"403":0,"405":0,"407":0,"408":0,"409":0,"412":0,"443":0,"455":0,"456":0,"458":0}; _yuitest_coverage["build/event-valuechange/event-valuechange.js"].functions = {"(anonymous 2):106":0,"_poll:81":0,"(anonymous 3):136":0,"_refreshTimeout:123":0,"(anonymous 4):191":0,"_startPolling:160":0,"_stopPolling:209":0,"_stopTimeout:239":0,"_onBlur:257":0,"_onFocus:270":0,"_onKeyDown:293":0,"_onKeyUp:306":0,"_onMouseDown:326":0,"getNodes:363":0,"(anonymous 5):369":0,"_onSubscribe:342":0,"(anonymous 6):408":0,"_onUnsubscribe:402":0,"(anonymous 1):1":0}; _yuitest_coverage["build/event-valuechange/event-valuechange.js"].coveredLines = 84;@@ -600,4 +600,4 @@ Y.ValueChange = VC; -}, '3.7.2', {"requires": ["event-focus", "event-synthetic"]});+}, '3.7.3', {"requires": ["event-focus", "event-synthetic"]});
bundle/event-valuechange/event-valuechange-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -478,4 +478,4 @@ Y.ValueChange = VC; -}, '3.7.2', {"requires": ["event-focus", "event-synthetic"]});+}, '3.7.3', {"requires": ["event-focus", "event-synthetic"]});
bundle/event-valuechange/event-valuechange-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("event-valuechange",function(e,t){var n="_valuechange",r="value",i,s={POLL_INTERVAL:50,TIMEOUT:1e4,_poll:function(t,r){var i=t._node,o=r.e,u=i&&i.value,a=t._data&&t._data[n],f,l;if(!i||!a){s._stopPolling(t);return}l=a.prevVal,u!==l&&(a.prevVal=u,f={_event:o,currentTarget:o&&o.currentTarget||t,newVal:u,prevVal:l,target:o&&o.target||t},e.Object.each(a.notifiers,function(e){e.fire(f)}),s._refreshTimeout(t))},_refreshTimeout:function(e,t){if(!e._node)return;var r=e.getData(n);s._stopTimeout(e),r.timeout=setTimeout(function(){s._stopPolling(e,t)},s.TIMEOUT)},_startPolling:function(t,i,o){if(!t.test("input,textarea"))return;var u=t.getData(n);u||(u={prevVal:t.get(r)},t.setData(n,u)),u.notifiers||(u.notifiers={});if(u.interval){if(!o.force){u.notifiers[e.stamp(i)]=i;return}s._stopPolling(t,i)}u.notifiers[e.stamp(i)]=i,u.interval=setInterval(function(){s._poll(t,u,o)},s.POLL_INTERVAL),s._refreshTimeout(t,i)},_stopPolling:function(t,r){if(!t._node)return;var i=t.getData(n)||{};clearInterval(i.interval),delete i.interval,s._stopTimeout(t),r?i.notifiers&&delete i.notifiers[e.stamp(r)]:i.notifiers={}},_stopTimeout:function(e){var t=e.getData(n)||{};clearTimeout(t.timeout),delete t.timeout},_onBlur:function(e,t){s._stopPolling(e.currentTarget,t)},_onFocus:function(e,t){var i=e.currentTarget,o=i.getData(n);o||(o={},i.setData(n,o)),o.prevVal=i.get(r),s._startPolling(i,t,{e:e})},_onKeyDown:function(e,t){s._startPolling(e.currentTarget,t,{e:e})},_onKeyUp:function(e,t){(e.charCode===229||e.charCode===197)&&s._startPolling(e.currentTarget,t,{e:e,force:!0})},_onMouseDown:function(e,t){s._startPolling(e.currentTarget,t,{e:e})},_onSubscribe:function(t,i,o,u){var a,f,l;f={blur:s._onBlur,focus:s._onFocus,keydown:s._onKeyDown,keyup:s._onKeyUp,mousedown:s._onMouseDown},a=o._valuechange={};if(u)a.delegated=!0,a.getNodes=function(){return t.all("input,textarea").filter(u)},a.getNodes().each(function(e){e.getData(n)||e.setData(n,{prevVal:e.get(r)})}),o._handles=e.delegate(f,t,u,null,o);else{if(!t.test("input,textarea"))return;t.getData(n)||t.setData(n,{prevVal:t.get(r)}),o._handles=t.on(f,null,null,o)}},_onUnsubscribe:function(e,t,n){var r=n._valuechange;n._handles&&n._handles.detach(),r.delegated?r.getNodes().each(function(e){s._stopPolling(e,n)}):s._stopPolling(e,n)}};i={detach:s._onUnsubscribe,on:s._onSubscribe,delegate:s._onSubscribe,detachDelegate:s._onUnsubscribe,publishConfig:{emitFacade:!0}},e.Event.define("valuechange",i),e.Event.define("valueChange",i),e.ValueChange=s},"3.7.2",{requires:["event-focus","event-synthetic"]});+YUI.add("event-valuechange",function(e,t){var n="_valuechange",r="value",i,s={POLL_INTERVAL:50,TIMEOUT:1e4,_poll:function(t,r){var i=t._node,o=r.e,u=i&&i.value,a=t._data&&t._data[n],f,l;if(!i||!a){s._stopPolling(t);return}l=a.prevVal,u!==l&&(a.prevVal=u,f={_event:o,currentTarget:o&&o.currentTarget||t,newVal:u,prevVal:l,target:o&&o.target||t},e.Object.each(a.notifiers,function(e){e.fire(f)}),s._refreshTimeout(t))},_refreshTimeout:function(e,t){if(!e._node)return;var r=e.getData(n);s._stopTimeout(e),r.timeout=setTimeout(function(){s._stopPolling(e,t)},s.TIMEOUT)},_startPolling:function(t,i,o){if(!t.test("input,textarea"))return;var u=t.getData(n);u||(u={prevVal:t.get(r)},t.setData(n,u)),u.notifiers||(u.notifiers={});if(u.interval){if(!o.force){u.notifiers[e.stamp(i)]=i;return}s._stopPolling(t,i)}u.notifiers[e.stamp(i)]=i,u.interval=setInterval(function(){s._poll(t,u,o)},s.POLL_INTERVAL),s._refreshTimeout(t,i)},_stopPolling:function(t,r){if(!t._node)return;var i=t.getData(n)||{};clearInterval(i.interval),delete i.interval,s._stopTimeout(t),r?i.notifiers&&delete i.notifiers[e.stamp(r)]:i.notifiers={}},_stopTimeout:function(e){var t=e.getData(n)||{};clearTimeout(t.timeout),delete t.timeout},_onBlur:function(e,t){s._stopPolling(e.currentTarget,t)},_onFocus:function(e,t){var i=e.currentTarget,o=i.getData(n);o||(o={},i.setData(n,o)),o.prevVal=i.get(r),s._startPolling(i,t,{e:e})},_onKeyDown:function(e,t){s._startPolling(e.currentTarget,t,{e:e})},_onKeyUp:function(e,t){(e.charCode===229||e.charCode===197)&&s._startPolling(e.currentTarget,t,{e:e,force:!0})},_onMouseDown:function(e,t){s._startPolling(e.currentTarget,t,{e:e})},_onSubscribe:function(t,i,o,u){var a,f,l;f={blur:s._onBlur,focus:s._onFocus,keydown:s._onKeyDown,keyup:s._onKeyUp,mousedown:s._onMouseDown},a=o._valuechange={};if(u)a.delegated=!0,a.getNodes=function(){return t.all("input,textarea").filter(u)},a.getNodes().each(function(e){e.getData(n)||e.setData(n,{prevVal:e.get(r)})}),o._handles=e.delegate(f,t,u,null,o);else{if(!t.test("input,textarea"))return;t.getData(n)||t.setData(n,{prevVal:t.get(r)}),o._handles=t.on(f,null,null,o)}},_onUnsubscribe:function(e,t,n){var r=n._valuechange;n._handles&&n._handles.detach(),r.delegated?r.getNodes().each(function(e){s._stopPolling(e,n)}):s._stopPolling(e,n)}};i={detach:s._onUnsubscribe,on:s._onSubscribe,delegate:s._onSubscribe,detachDelegate:s._onUnsubscribe,publishConfig:{emitFacade:!0}},e.Event.define("valuechange",i),e.Event.define("valueChange",i),e.ValueChange=s},"3.7.3",{requires:["event-focus","event-synthetic"]});
bundle/event-valuechange/event-valuechange.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -464,4 +464,4 @@ Y.ValueChange = VC; -}, '3.7.2', {"requires": ["event-focus", "event-synthetic"]});+}, '3.7.3', {"requires": ["event-focus", "event-synthetic"]});
bundle/exec-command/exec-command-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/exec-command/exec-command.js", code: [] };-_yuitest_coverage["build/exec-command/exec-command.js"].code=["YUI.add('exec-command', function (Y, NAME) {","",""," /**"," * Plugin for the frame module to handle execCommands for Editor"," * @class Plugin.ExecCommand"," * @extends Base"," * @constructor"," * @module editor"," * @submodule exec-command"," */"," var ExecCommand = function() {"," ExecCommand.superclass.constructor.apply(this, arguments);"," };",""," Y.extend(ExecCommand, Y.Base, {"," /**"," * An internal reference to the keyCode of the last key that was pressed."," * @private"," * @property _lastKey"," */"," _lastKey: null,"," /**"," * An internal reference to the instance of the frame plugged into."," * @private"," * @property _inst"," */"," _inst: null,"," /**"," * Execute a command on the frame's document."," * @method command"," * @param {String} action The action to perform (bold, italic, fontname)"," * @param {String} value The optional value (helvetica)"," * @return {Node/NodeList} Should return the Node/Nodelist affected"," */"," command: function(action, value) {"," var fn = ExecCommand.COMMANDS[action];"," "," if (fn) {"," return fn.call(this, action, value);"," } else {"," return this._command(action, value);"," }"," },"," /**"," * The private version of execCommand that doesn't filter for overrides."," * @private"," * @method _command"," * @param {String} action The action to perform (bold, italic, fontname)"," * @param {String} value The optional value (helvetica)"," */"," _command: function(action, value) {"," var inst = this.getInstance();"," try {"," try {"," inst.config.doc.execCommand('styleWithCSS', null, 1);"," } catch (e1) {"," try {"," inst.config.doc.execCommand('useCSS', null, 0);"," } catch (e2) {"," }"," }"," inst.config.doc.execCommand(action, null, value);"," } catch (e) {"," }"," },"," /**"," * Get's the instance of YUI bound to the parent frame"," * @method getInstance"," * @return {YUI} The YUI instance bound to the parent frame"," */"," getInstance: function() {"," if (!this._inst) {"," this._inst = this.get('host').getInstance();"," }"," return this._inst;"," },"," initializer: function() {"," Y.mix(this.get('host'), {"," execCommand: function(action, value) {"," return this.exec.command(action, value);"," },"," _execCommand: function(action, value) {"," return this.exec._command(action, value);"," }"," });",""," this.get('host').on('dom:keypress', Y.bind(function(e) {"," this._lastKey = e.keyCode;"," }, this));"," },"," _wrapContent: function(str, override) {"," var useP = (this.getInstance().host.editorPara && !override ? true : false);"," "," if (useP) {"," str = '<p>' + str + '</p>';"," } else {"," str = str + '<br>';"," }"," return str;"," }"," }, {"," /**"," * execCommand"," * @property NAME"," * @static"," */"," NAME: 'execCommand',"," /**"," * exec"," * @property NS"," * @static"," */"," NS: 'exec',"," ATTRS: {"," host: {"," value: false"," }"," },"," /**"," * Static object literal of execCommand overrides"," * @property COMMANDS"," * @static"," */"," COMMANDS: {"," /**"," * Wraps the content with a new element of type (tag)"," * @method COMMANDS.wrap"," * @static"," * @param {String} cmd The command executed: wrap"," * @param {String} tag The tag to wrap the selection with"," * @return {NodeList} NodeList of the items touched by this command."," */"," wrap: function(cmd, tag) {"," var inst = this.getInstance();"," return (new inst.EditorSelection()).wrapContent(tag);"," },"," /**"," * Inserts the provided HTML at the cursor, should be a single element."," * @method COMMANDS.inserthtml"," * @static"," * @param {String} cmd The command executed: inserthtml"," * @param {String} html The html to insert"," * @return {Node} Node instance of the item touched by this command."," */"," inserthtml: function(cmd, html) {"," var inst = this.getInstance();"," if (inst.EditorSelection.hasCursor() || Y.UA.ie) {"," return (new inst.EditorSelection()).insertContent(html);"," } else {"," this._command('inserthtml', html);"," }"," },"," /**"," * Inserts the provided HTML at the cursor, and focuses the cursor afterwards."," * @method COMMANDS.insertandfocus"," * @static"," * @param {String} cmd The command executed: insertandfocus"," * @param {String} html The html to insert"," * @return {Node} Node instance of the item touched by this command."," */"," insertandfocus: function(cmd, html) {"," var inst = this.getInstance(), out, sel;"," if (inst.EditorSelection.hasCursor()) {"," html += inst.EditorSelection.CURSOR;"," out = this.command('inserthtml', html);"," sel = new inst.EditorSelection();"," sel.focusCursor(true, true);"," } else {"," this.command('inserthtml', html);"," }"," return out;"," },"," /**"," * Inserts a BR at the current cursor position"," * @method COMMANDS.insertbr"," * @static"," * @param {String} cmd The command executed: insertbr"," */"," insertbr: function(cmd) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," html = '<var>|</var>', last = null,"," q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var';",""," if (sel._selection.pasteHTML) {"," sel._selection.pasteHTML(html);"," } else {"," this._command('inserthtml', html);"," }",""," var insert = function(n) {"," var c = inst.Node.create('<br>');"," n.insert(c, 'before');"," return c;"," };",""," inst.all(q).each(function(n) {"," var g = true; "," if (Y.UA.webkit) {"," g = false;"," if (n.get('innerHTML') === '|') {"," g = true;"," }"," }"," if (g) {"," last = insert(n);"," if ((!last.previous() || !last.previous().test('br')) && Y.UA.gecko) {"," var s = last.cloneNode();"," last.insert(s, 'after');"," last = s;"," }"," n.remove();"," }"," });"," if (Y.UA.webkit && last) {"," insert(last);"," sel.selectNode(last);"," }"," },"," /**"," * Inserts an image at the cursor position"," * @method COMMANDS.insertimage"," * @static"," * @param {String} cmd The command executed: insertimage"," * @param {String} img The url of the image to be inserted"," * @return {Node} Node instance of the item touched by this command."," */"," insertimage: function(cmd, img) {"," return this.command('inserthtml', '<img src=\"' + img + '\">');"," },"," /**"," * Add a class to all of the elements in the selection"," * @method COMMANDS.addclass"," * @static"," * @param {String} cmd The command executed: addclass"," * @param {String} cls The className to add"," * @return {NodeList} NodeList of the items touched by this command."," */"," addclass: function(cmd, cls) {"," var inst = this.getInstance();"," return (new inst.EditorSelection()).getSelected().addClass(cls);"," },"," /**"," * Remove a class from all of the elements in the selection"," * @method COMMANDS.removeclass"," * @static"," * @param {String} cmd The command executed: removeclass"," * @param {String} cls The className to remove"," * @return {NodeList} NodeList of the items touched by this command."," */"," removeclass: function(cmd, cls) {"," var inst = this.getInstance();"," return (new inst.EditorSelection()).getSelected().removeClass(cls);"," },"," /**"," * Adds a forecolor to the current selection, or creates a new element and applies it"," * @method COMMANDS.forecolor"," * @static"," * @param {String} cmd The command executed: forecolor"," * @param {String} val The color value to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," forecolor: function(cmd, val) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(), n;",""," if (!Y.UA.ie) {"," this._command('useCSS', false);"," }"," if (inst.EditorSelection.hasCursor()) {"," if (sel.isCollapsed) {"," if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === ' ')) {"," sel.anchorNode.setStyle('color', val);"," n = sel.anchorNode;"," } else {"," n = this.command('inserthtml', '<span style=\"color: ' + val + '\">' + inst.EditorSelection.CURSOR + '</span>');"," sel.focusCursor(true, true);"," }"," return n;"," } else {"," return this._command(cmd, val);"," }"," } else {"," this._command(cmd, val);"," }"," },"," /**"," * Adds a background color to the current selection, or creates a new element and applies it"," * @method COMMANDS.backcolor"," * @static"," * @param {String} cmd The command executed: backcolor"," * @param {String} val The color value to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," backcolor: function(cmd, val) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(), n;"," "," if (Y.UA.gecko || Y.UA.opera) {"," cmd = 'hilitecolor';"," }"," if (!Y.UA.ie) {"," this._command('useCSS', false);"," }"," if (inst.EditorSelection.hasCursor()) {"," if (sel.isCollapsed) {"," if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === ' ')) {"," sel.anchorNode.setStyle('backgroundColor', val);"," n = sel.anchorNode;"," } else {"," n = this.command('inserthtml', '<span style=\"background-color: ' + val + '\">' + inst.EditorSelection.CURSOR + '</span>');"," sel.focusCursor(true, true);"," }"," return n;"," } else {"," return this._command(cmd, val);"," }"," } else {"," this._command(cmd, val);"," }"," },"," /**"," * Sugar method, calles backcolor"," * @method COMMANDS.hilitecolor"," * @static"," * @param {String} cmd The command executed: backcolor"," * @param {String} val The color value to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," hilitecolor: function() {"," return ExecCommand.COMMANDS.backcolor.apply(this, arguments);"," },"," /**"," * Adds a font name to the current selection, or creates a new element and applies it"," * @method COMMANDS.fontname2"," * @deprecated"," * @static"," * @param {String} cmd The command executed: fontname"," * @param {String} val The font name to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," fontname2: function(cmd, val) {"," this._command('fontname', val);"," var inst = this.getInstance(),"," sel = new inst.EditorSelection();"," "," if (sel.isCollapsed && (this._lastKey != 32)) {"," if (sel.anchorNode.test('font')) {"," sel.anchorNode.set('face', val);"," }"," }"," },"," /**"," * Adds a fontsize to the current selection, or creates a new element and applies it"," * @method COMMANDS.fontsize2"," * @deprecated"," * @static"," * @param {String} cmd The command executed: fontsize"," * @param {String} val The font size to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," fontsize2: function(cmd, val) {"," this._command('fontsize', val);",""," var inst = this.getInstance(),"," sel = new inst.EditorSelection();"," "," if (sel.isCollapsed && sel.anchorNode && (this._lastKey != 32)) {"," if (Y.UA.webkit) {"," if (sel.anchorNode.getStyle('lineHeight')) {"," sel.anchorNode.setStyle('lineHeight', '');"," }"," }"," if (sel.anchorNode.test('font')) {"," sel.anchorNode.set('size', val);"," } else if (Y.UA.gecko) {"," var p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG);"," if (p) {"," p.setStyle('fontSize', '');"," }"," }"," }"," },"," /**"," * Overload for COMMANDS.list"," * @method COMMANDS.insertorderedlist"," * @static"," * @param {String} cmd The command executed: list, ul"," */"," insertunorderedlist: function(cmd) {"," this.command('list', 'ul');"," },"," /**"," * Overload for COMMANDS.list"," * @method COMMANDS.insertunorderedlist"," * @static"," * @param {String} cmd The command executed: list, ol"," */"," insertorderedlist: function(cmd) {"," this.command('list', 'ol');"," },"," /**"," * Noramlizes lists creation/destruction for IE. All others pass through to native calls"," * @method COMMANDS.list"," * @static"," * @param {String} cmd The command executed: list (not used)"," * @param {String} tag The tag to deal with"," */"," list: function(cmd, tag) {"," var inst = this.getInstance(), html, self = this,"," /*"," The yui3- class name below is not a skinnable class,"," it's a utility class used internally by editor and "," stripped when completed, calling getClassName on this"," is a waste of resources."," */"," DIR = 'dir', cls = 'yui3-touched',"," dir, range, div, elm, n, str, s, par, list, lis,"," useP = (inst.host.editorPara ? true : false),"," sel = new inst.EditorSelection();",""," cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';"," "," if (Y.UA.ie && !sel.isCollapsed) {"," range = sel._selection;"," html = range.htmlText;"," div = inst.Node.create(html) || inst.one('body');",""," if (div.test('li') || div.one('li')) {"," this._command(cmd, null);"," return;"," }"," if (div.test(tag)) {"," elm = range.item ? range.item(0) : range.parentElement();"," n = inst.one(elm);"," lis = n.all('li');",""," str = '<div>';"," lis.each(function(l) {"," str = self._wrapContent(l.get('innerHTML'));"," });"," str += '</div>';"," s = inst.Node.create(str);"," if (n.get('parentNode').test('div')) {"," n = n.get('parentNode');"," }"," if (n && n.hasAttribute(DIR)) {"," if (useP) {"," s.all('p').setAttribute(DIR, n.getAttribute(DIR));"," } else {"," s.setAttribute(DIR, n.getAttribute(DIR));"," }"," }"," if (useP) {"," n.replace(s.get('innerHTML'));"," } else {"," n.replace(s);"," }"," if (range.moveToElementText) {"," range.moveToElementText(s._node);"," }"," range.select();"," } else {"," par = Y.one(range.parentElement());"," if (!par.test(inst.EditorSelection.BLOCKS)) {"," par = par.ancestor(inst.EditorSelection.BLOCKS);"," }"," if (par) {"," if (par.hasAttribute(DIR)) {"," dir = par.getAttribute(DIR);"," }"," }"," if (html.indexOf('<br>') > -1) {"," html = html.split(/<br>/i);"," } else {"," var tmp = inst.Node.create(html),"," ps = tmp ? tmp.all('p') : null;",""," if (ps && ps.size()) {"," html = [];"," ps.each(function(n) {"," html.push(n.get('innerHTML'));"," });"," } else {"," html = [html];"," }"," }"," list = '<' + tag + ' id=\"ie-list\">';"," Y.each(html, function(v) {"," var a = inst.Node.create(v);"," if (a && a.test('p')) {"," if (a.hasAttribute(DIR)) {"," dir = a.getAttribute(DIR);"," }"," v = a.get('innerHTML');"," }"," list += '<li>' + v + '</li>';"," });"," list += '</' + tag + '>';"," range.pasteHTML(list);"," elm = inst.config.doc.getElementById('ie-list');"," elm.id = '';"," if (dir) {"," elm.setAttribute(DIR, dir);"," }"," if (range.moveToElementText) {"," range.moveToElementText(elm);"," }"," range.select();"," }"," } else if (Y.UA.ie) {"," par = inst.one(sel._selection.parentElement());"," if (par.test('p')) {"," if (par && par.hasAttribute(DIR)) {"," dir = par.getAttribute(DIR);"," }"," html = Y.EditorSelection.getText(par);"," if (html === '') {"," var sdir = '';"," if (dir) {"," sdir = ' dir=\"' + dir + '\"';"," }"," list = inst.Node.create(Y.Lang.sub('<{tag}{dir}><li></li></{tag}>', { tag: tag, dir: sdir }));"," par.replace(list);"," sel.selectNode(list.one('li'));"," } else {"," this._command(cmd, null);"," }"," } else {"," this._command(cmd, null);"," }"," } else {"," inst.all(tag).addClass(cls);"," if (sel.anchorNode.test(inst.EditorSelection.BLOCKS)) {"," par = sel.anchorNode;"," } else {"," par = sel.anchorNode.ancestor(inst.EditorSelection.BLOCKS);"," }"," if (!par) { //No parent, find the first block under the anchorNode"," par = sel.anchorNode.one(inst.EditorSelection.BLOCKS);"," }",""," if (par && par.hasAttribute(DIR)) {"," dir = par.getAttribute(DIR);"," }"," if (par && par.test(tag)) {"," var hasPParent = par.ancestor('p');"," html = inst.Node.create('<div/>');"," elm = par.all('li');"," elm.each(function(h) {"," html.append(self._wrapContent(h.get('innerHTML'), hasPParent));"," });"," if (dir) {"," if (useP) {"," html.all('p').setAttribute(DIR, dir);"," } else {"," html.setAttribute(DIR, dir);"," }"," }"," if (useP) {"," html = inst.Node.create(html.get('innerHTML'));"," }"," var fc = html.get('firstChild');"," par.replace(html);"," sel.selectNode(fc);"," } else {"," this._command(cmd, null);"," }"," list = inst.all(tag);"," if (dir) {"," if (list.size()) {"," //Changed to a List"," list.each(function(n) {"," if (!n.hasClass(cls)) {"," n.setAttribute(DIR, dir);"," }"," });"," }"," }",""," list.removeClass(cls);"," }"," },"," /**"," * Noramlizes alignment for Webkit Browsers"," * @method COMMANDS.justify"," * @static"," * @param {String} cmd The command executed: justify (not used)"," * @param {String} val The actual command from the justify{center,all,left,right} stubs"," */"," justify: function(cmd, val) {"," if (Y.UA.webkit) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," aNode = sel.anchorNode;",""," var bgColor = aNode.getStyle('backgroundColor');"," this._command(val);"," sel = new inst.EditorSelection();"," if (sel.anchorNode.test('div')) {"," var html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';"," sel.anchorNode.set('innerHTML', html);"," sel.anchorNode.one('span').setStyle('backgroundColor', bgColor);"," sel.selectNode(sel.anchorNode.one('span'));"," }"," } else {"," this._command(val);"," }"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifycenter"," * @static"," */"," justifycenter: function(cmd) {"," this.command('justify', 'justifycenter');"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifyleft"," * @static"," */"," justifyleft: function(cmd) {"," this.command('justify', 'justifyleft');"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifyright"," * @static"," */"," justifyright: function(cmd) {"," this.command('justify', 'justifyright');"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifyfull"," * @static"," */"," justifyfull: function(cmd) {"," this.command('justify', 'justifyfull');"," }"," }"," });"," "," /**"," * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling."," * @method fixIETags"," * @protected"," * @param {String} cmd The command to execute"," * @param {String} tag The tag to create"," * @param {String} rule The rule that we are looking for."," */"," var fixIETags = function(cmd, tag, rule) {"," var inst = this.getInstance(),"," doc = inst.config.doc,"," sel = doc.selection.createRange(),"," o = doc.queryCommandValue(cmd),"," html, reg, m, p, d, s, c;",""," if (o) {"," html = sel.htmlText;"," reg = new RegExp(rule, 'g');"," m = html.match(reg);",""," if (m) {"," html = html.replace(rule + ';', '').replace(rule, '');",""," sel.pasteHTML('<var id=\"yui-ie-bs\">');",""," p = doc.getElementById('yui-ie-bs');"," d = doc.createElement('div');"," s = doc.createElement(tag);"," "," d.innerHTML = html;"," if (p.parentNode !== inst.config.doc.body) {"," p = p.parentNode;"," }",""," c = d.childNodes;",""," p.parentNode.replaceChild(s, p);",""," Y.each(c, function(f) {"," s.appendChild(f);"," });"," sel.collapse();"," if (sel.moveToElementText) {"," sel.moveToElementText(s);"," }"," sel.select();"," }"," }"," this._command(cmd);"," };",""," if (Y.UA.ie) {"," ExecCommand.COMMANDS.bold = function() {"," fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold');"," };"," ExecCommand.COMMANDS.italic = function() {"," fixIETags.call(this, 'italic', 'i', 'FONT-STYLE: italic');"," };"," ExecCommand.COMMANDS.underline = function() {"," fixIETags.call(this, 'underline', 'u', 'TEXT-DECORATION: underline');"," };"," }",""," Y.namespace('Plugin');"," Y.Plugin.ExecCommand = ExecCommand;","","","","}, '3.7.2', {\"requires\": [\"frame\"]});"];-_yuitest_coverage["build/exec-command/exec-command.js"].lines = {"1":0,"12":0,"13":0,"16":0,"37":0,"39":0,"40":0,"42":0,"53":0,"54":0,"55":0,"56":0,"58":0,"59":0,"63":0,"73":0,"74":0,"76":0,"79":0,"81":0,"84":0,"88":0,"89":0,"93":0,"95":0,"96":0,"98":0,"100":0,"135":0,"136":0,"147":0,"148":0,"149":0,"151":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"170":0,"172":0,"181":0,"186":0,"187":0,"189":0,"192":0,"193":0,"194":0,"195":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"206":0,"207":0,"208":0,"209":0,"210":0,"211":0,"213":0,"216":0,"217":0,"218":0,"230":0,"241":0,"242":0,"253":0,"254":0,"265":0,"268":0,"269":0,"271":0,"272":0,"273":0,"274":0,"275":0,"277":0,"278":0,"280":0,"282":0,"285":0,"297":0,"300":0,"301":0,"303":0,"304":0,"306":0,"307":0,"308":0,"309":0,"310":0,"312":0,"313":0,"315":0,"317":0,"320":0,"332":0,"344":0,"345":0,"348":0,"349":0,"350":0,"364":0,"366":0,"369":0,"370":0,"371":0,"372":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"392":0,"401":0,"411":0,"423":0,"425":0,"426":0,"427":0,"428":0,"430":0,"431":0,"432":0,"434":0,"435":0,"436":0,"437":0,"439":0,"440":0,"441":0,"443":0,"444":0,"445":0,"446":0,"448":0,"449":0,"450":0,"452":0,"455":0,"456":0,"458":0,"460":0,"461":0,"463":0,"465":0,"466":0,"467":0,"469":0,"470":0,"471":0,"474":0,"475":0,"477":0,"480":0,"481":0,"482":0,"483":0,"486":0,"489":0,"490":0,"491":0,"492":0,"493":0,"494":0,"496":0,"498":0,"500":0,"501":0,"502":0,"503":0,"504":0,"505":0,"507":0,"508":0,"510":0,"512":0,"513":0,"514":0,"515":0,"516":0,"518":0,"519":0,"520":0,"521":0,"522":0,"524":0,"525":0,"526":0,"528":0,"531":0,"534":0,"535":0,"536":0,"538":0,"540":0,"541":0,"544":0,"545":0,"547":0,"548":0,"549":0,"550":0,"551":0,"552":0,"554":0,"555":0,"556":0,"558":0,"561":0,"562":0,"564":0,"565":0,"566":0,"568":0,"570":0,"571":0,"572":0,"574":0,"575":0,"576":0,"582":0,"593":0,"594":0,"598":0,"599":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"608":0,"617":0,"625":0,"633":0,"641":0,"654":0,"655":0,"661":0,"662":0,"663":0,"664":0,"666":0,"667":0,"669":0,"671":0,"672":0,"673":0,"675":0,"676":0,"677":0,"680":0,"682":0,"684":0,"685":0,"687":0,"688":0,"689":0,"691":0,"694":0,"697":0,"698":0,"699":0,"701":0,"702":0,"704":0,"705":0,"709":0,"710":0};-_yuitest_coverage["build/exec-command/exec-command.js"].functions = {"ExecCommand:12":0,"command:36":0,"_command:52":0,"getInstance:72":0,"execCommand:80":0,"_execCommand:83":0,"(anonymous 2):88":0,"initializer:78":0,"_wrapContent:92":0,"wrap:134":0,"inserthtml:146":0,"insertandfocus:162":0,"insert:192":0,"(anonymous 3):198":0,"insertbr:180":0,"insertimage:229":0,"addclass:240":0,"removeclass:252":0,"forecolor:264":0,"backcolor:296":0,"hilitecolor:331":0,"fontname2:343":0,"fontsize2:363":0,"insertunorderedlist:391":0,"insertorderedlist:400":0,"(anonymous 4):440":0,"(anonymous 5):482":0,"(anonymous 6):490":0,"(anonymous 7):551":0,"(anonymous 8):574":0,"list:410":0,"justify:592":0,"justifycenter:616":0,"justifyleft:624":0,"justifyright:632":0,"justifyfull:640":0,"(anonymous 9):684":0,"fixIETags:654":0,"bold:698":0,"italic:701":0,"underline:704":0,"(anonymous 1):1":0};-_yuitest_coverage["build/exec-command/exec-command.js"].coveredLines = 274;+_yuitest_coverage["build/exec-command/exec-command.js"].code=["YUI.add('exec-command', function (Y, NAME) {","",""," /**"," * Plugin for the frame module to handle execCommands for Editor"," * @class Plugin.ExecCommand"," * @extends Base"," * @constructor"," * @module editor"," * @submodule exec-command"," */"," var ExecCommand = function() {"," ExecCommand.superclass.constructor.apply(this, arguments);"," },"," /**"," * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling."," * @method fixIETags"," * @protected"," * @param {String} cmd The command to execute"," * @param {String} tag The tag to create"," * @param {String} rule The rule that we are looking for."," */"," fixIETags = function(cmd, tag, rule) {"," var inst = this.getInstance(),"," doc = inst.config.doc,"," sel = doc.selection.createRange(),"," o = doc.queryCommandValue(cmd),"," html, reg, m, p, d, s, c;",""," if (o) {"," html = sel.htmlText;"," reg = new RegExp(rule, 'g');"," m = html.match(reg);",""," if (m) {"," html = html.replace(rule + ';', '').replace(rule, '');",""," sel.pasteHTML('<var id=\"yui-ie-bs\">');",""," p = doc.getElementById('yui-ie-bs');"," d = doc.createElement('div');"," s = doc.createElement(tag);",""," d.innerHTML = html;"," if (p.parentNode !== inst.config.doc.body) {"," p = p.parentNode;"," }",""," c = d.childNodes;",""," p.parentNode.replaceChild(s, p);",""," Y.each(c, function(f) {"," s.appendChild(f);"," });"," sel.collapse();"," if (sel.moveToElementText) {"," sel.moveToElementText(s);"," }"," sel.select();"," }"," }"," this._command(cmd);"," };",""," Y.extend(ExecCommand, Y.Base, {"," /**"," * An internal reference to the keyCode of the last key that was pressed."," * @private"," * @property _lastKey"," */"," _lastKey: null,"," /**"," * An internal reference to the instance of the frame plugged into."," * @private"," * @property _inst"," */"," _inst: null,"," /**"," * Execute a command on the frame's document."," * @method command"," * @param {String} action The action to perform (bold, italic, fontname)"," * @param {String} value The optional value (helvetica)"," * @return {Node/NodeList} Should return the Node/Nodelist affected"," */"," command: function(action, value) {"," var fn = ExecCommand.COMMANDS[action];",""," if (fn) {"," return fn.call(this, action, value);"," } else {"," return this._command(action, value);"," }"," },"," /**"," * The private version of execCommand that doesn't filter for overrides."," * @private"," * @method _command"," * @param {String} action The action to perform (bold, italic, fontname)"," * @param {String} value The optional value (helvetica)"," */"," _command: function(action, value) {"," var inst = this.getInstance();"," try {"," try {"," inst.config.doc.execCommand('styleWithCSS', null, 1);"," } catch (e1) {"," try {"," inst.config.doc.execCommand('useCSS', null, 0);"," } catch (e2) {"," }"," }"," inst.config.doc.execCommand(action, null, value);"," } catch (e) {"," }"," },"," /**"," * Get's the instance of YUI bound to the parent frame"," * @method getInstance"," * @return {YUI} The YUI instance bound to the parent frame"," */"," getInstance: function() {"," if (!this._inst) {"," this._inst = this.get('host').getInstance();"," }"," return this._inst;"," },"," initializer: function() {"," Y.mix(this.get('host'), {"," execCommand: function(action, value) {"," return this.exec.command(action, value);"," },"," _execCommand: function(action, value) {"," return this.exec._command(action, value);"," }"," });",""," this.get('host').on('dom:keypress', Y.bind(function(e) {"," this._lastKey = e.keyCode;"," }, this));"," },"," _wrapContent: function(str, override) {"," var useP = (this.getInstance().host.editorPara && !override ? true : false);",""," if (useP) {"," str = '<p>' + str + '</p>';"," } else {"," str = str + '<br>';"," }"," return str;"," }"," }, {"," /**"," * execCommand"," * @property NAME"," * @static"," */"," NAME: 'execCommand',"," /**"," * exec"," * @property NS"," * @static"," */"," NS: 'exec',"," ATTRS: {"," host: {"," value: false"," }"," },"," /**"," * Static object literal of execCommand overrides"," * @property COMMANDS"," * @static"," */"," COMMANDS: {"," /**"," * Wraps the content with a new element of type (tag)"," * @method COMMANDS.wrap"," * @static"," * @param {String} cmd The command executed: wrap"," * @param {String} tag The tag to wrap the selection with"," * @return {NodeList} NodeList of the items touched by this command."," */"," wrap: function(cmd, tag) {"," var inst = this.getInstance();"," return (new inst.EditorSelection()).wrapContent(tag);"," },"," /**"," * Inserts the provided HTML at the cursor, should be a single element."," * @method COMMANDS.inserthtml"," * @static"," * @param {String} cmd The command executed: inserthtml"," * @param {String} html The html to insert"," * @return {Node} Node instance of the item touched by this command."," */"," inserthtml: function(cmd, html) {"," var inst = this.getInstance();"," if (inst.EditorSelection.hasCursor() || Y.UA.ie) {"," return (new inst.EditorSelection()).insertContent(html);"," } else {"," this._command('inserthtml', html);"," }"," },"," /**"," * Inserts the provided HTML at the cursor, and focuses the cursor afterwards."," * @method COMMANDS.insertandfocus"," * @static"," * @param {String} cmd The command executed: insertandfocus"," * @param {String} html The html to insert"," * @return {Node} Node instance of the item touched by this command."," */"," insertandfocus: function(cmd, html) {"," var inst = this.getInstance(), out, sel;"," if (inst.EditorSelection.hasCursor()) {"," html += inst.EditorSelection.CURSOR;"," out = this.command('inserthtml', html);"," sel = new inst.EditorSelection();"," sel.focusCursor(true, true);"," } else {"," this.command('inserthtml', html);"," }"," return out;"," },"," /**"," * Inserts a BR at the current cursor position"," * @method COMMANDS.insertbr"," * @static"," * @param {String} cmd The command executed: insertbr"," */"," insertbr: function() {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," html = '<var>|</var>', last = null,"," q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var',"," insert = function(n) {"," var c = inst.Node.create('<br>');"," n.insert(c, 'before');"," return c;"," };",""," if (sel._selection.pasteHTML) {"," sel._selection.pasteHTML(html);"," } else {"," this._command('inserthtml', html);"," }","",""," inst.all(q).each(function(n) {"," var g = true, s;"," if (Y.UA.webkit) {"," g = false;"," if (n.get('innerHTML') === '|') {"," g = true;"," }"," }"," if (g) {"," last = insert(n);"," if ((!last.previous() || !last.previous().test('br')) && Y.UA.gecko) {"," s = last.cloneNode();"," last.insert(s, 'after');"," last = s;"," }"," n.remove();"," }"," });"," if (Y.UA.webkit && last) {"," insert(last);"," sel.selectNode(last);"," }"," },"," /**"," * Inserts an image at the cursor position"," * @method COMMANDS.insertimage"," * @static"," * @param {String} cmd The command executed: insertimage"," * @param {String} img The url of the image to be inserted"," * @return {Node} Node instance of the item touched by this command."," */"," insertimage: function(cmd, img) {"," return this.command('inserthtml', '<img src=\"' + img + '\">');"," },"," /**"," * Add a class to all of the elements in the selection"," * @method COMMANDS.addclass"," * @static"," * @param {String} cmd The command executed: addclass"," * @param {String} cls The className to add"," * @return {NodeList} NodeList of the items touched by this command."," */"," addclass: function(cmd, cls) {"," var inst = this.getInstance();"," return (new inst.EditorSelection()).getSelected().addClass(cls);"," },"," /**"," * Remove a class from all of the elements in the selection"," * @method COMMANDS.removeclass"," * @static"," * @param {String} cmd The command executed: removeclass"," * @param {String} cls The className to remove"," * @return {NodeList} NodeList of the items touched by this command."," */"," removeclass: function(cmd, cls) {"," var inst = this.getInstance();"," return (new inst.EditorSelection()).getSelected().removeClass(cls);"," },"," /**"," * Adds a forecolor to the current selection, or creates a new element and applies it"," * @method COMMANDS.forecolor"," * @static"," * @param {String} cmd The command executed: forecolor"," * @param {String} val The color value to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," forecolor: function(cmd, val) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(), n;",""," if (!Y.UA.ie) {"," this._command('useCSS', false);"," }"," if (inst.EditorSelection.hasCursor()) {"," if (sel.isCollapsed) {"," if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === ' ')) {"," sel.anchorNode.setStyle('color', val);"," n = sel.anchorNode;"," } else {"," n = this.command('inserthtml', '<span style=\"color: ' + val + '\">' + inst.EditorSelection.CURSOR + '</span>');"," sel.focusCursor(true, true);"," }"," return n;"," } else {"," return this._command(cmd, val);"," }"," } else {"," this._command(cmd, val);"," }"," },"," /**"," * Adds a background color to the current selection, or creates a new element and applies it"," * @method COMMANDS.backcolor"," * @static"," * @param {String} cmd The command executed: backcolor"," * @param {String} val The color value to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," backcolor: function(cmd, val) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(), n;",""," if (Y.UA.gecko || Y.UA.opera) {"," cmd = 'hilitecolor';"," }"," if (!Y.UA.ie) {"," this._command('useCSS', false);"," }"," if (inst.EditorSelection.hasCursor()) {"," if (sel.isCollapsed) {"," if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === ' ')) {"," sel.anchorNode.setStyle('backgroundColor', val);"," n = sel.anchorNode;"," } else {"," n = this.command('inserthtml',"," '<span style=\"background-color: ' + val + '\">' + inst.EditorSelection.CURSOR + '</span>');"," sel.focusCursor(true, true);"," }"," return n;"," } else {"," return this._command(cmd, val);"," }"," } else {"," this._command(cmd, val);"," }"," },"," /**"," * Sugar method, calles backcolor"," * @method COMMANDS.hilitecolor"," * @static"," * @param {String} cmd The command executed: backcolor"," * @param {String} val The color value to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," hilitecolor: function() {"," return ExecCommand.COMMANDS.backcolor.apply(this, arguments);"," },"," /**"," * Adds a font name to the current selection, or creates a new element and applies it"," * @method COMMANDS.fontname2"," * @deprecated"," * @static"," * @param {String} cmd The command executed: fontname"," * @param {String} val The font name to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," fontname2: function(cmd, val) {"," this._command('fontname', val);"," var inst = this.getInstance(),"," sel = new inst.EditorSelection();",""," if (sel.isCollapsed && (this._lastKey !== 32)) {"," if (sel.anchorNode.test('font')) {"," sel.anchorNode.set('face', val);"," }"," }"," },"," /**"," * Adds a fontsize to the current selection, or creates a new element and applies it"," * @method COMMANDS.fontsize2"," * @deprecated"," * @static"," * @param {String} cmd The command executed: fontsize"," * @param {String} val The font size to apply"," * @return {NodeList} NodeList of the items touched by this command."," */"," fontsize2: function(cmd, val) {"," this._command('fontsize', val);",""," var inst = this.getInstance(),"," sel = new inst.EditorSelection(), p;",""," if (sel.isCollapsed && sel.anchorNode && (this._lastKey !== 32)) {"," if (Y.UA.webkit) {"," if (sel.anchorNode.getStyle('lineHeight')) {"," sel.anchorNode.setStyle('lineHeight', '');"," }"," }"," if (sel.anchorNode.test('font')) {"," sel.anchorNode.set('size', val);"," } else if (Y.UA.gecko) {"," p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG);"," if (p) {"," p.setStyle('fontSize', '');"," }"," }"," }"," },"," /**"," * Overload for COMMANDS.list"," * @method COMMANDS.insertorderedlist"," * @static"," * @param {String} cmd The command executed: list, ul"," */"," insertunorderedlist: function() {"," this.command('list', 'ul');"," },"," /**"," * Overload for COMMANDS.list"," * @method COMMANDS.insertunorderedlist"," * @static"," * @param {String} cmd The command executed: list, ol"," */"," insertorderedlist: function() {"," this.command('list', 'ol');"," },"," /**"," * Noramlizes lists creation/destruction for IE. All others pass through to native calls"," * @method COMMANDS.list"," * @static"," * @param {String} cmd The command executed: list (not used)"," * @param {String} tag The tag to deal with"," */"," list: function(cmd, tag) {"," var inst = this.getInstance(), html, self = this,"," /*"," The yui3- class name below is not a skinnable class,"," it's a utility class used internally by editor and"," stripped when completed, calling getClassName on this"," is a waste of resources."," */"," DIR = 'dir', cls = 'yui3-touched',"," dir, range, div, elm, n, str, s, par, list, lis,"," useP = (inst.host.editorPara ? true : false), tmp,"," sdir, hasPParent, fc,"," sel = new inst.EditorSelection();",""," cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';",""," if (Y.UA.ie && !sel.isCollapsed) {"," range = sel._selection;"," html = range.htmlText;"," div = inst.Node.create(html) || inst.one('body');",""," if (div.test('li') || div.one('li')) {"," this._command(cmd, null);"," return;"," }"," if (div.test(tag)) {"," elm = range.item ? range.item(0) : range.parentElement();"," n = inst.one(elm);"," lis = n.all('li');",""," str = '<div>';"," lis.each(function(l) {"," str = self._wrapContent(l.get('innerHTML'));"," });"," str += '</div>';"," s = inst.Node.create(str);"," if (n.get('parentNode').test('div')) {"," n = n.get('parentNode');"," }"," if (n && n.hasAttribute(DIR)) {"," if (useP) {"," s.all('p').setAttribute(DIR, n.getAttribute(DIR));"," } else {"," s.setAttribute(DIR, n.getAttribute(DIR));"," }"," }"," if (useP) {"," n.replace(s.get('innerHTML'));"," } else {"," n.replace(s);"," }"," if (range.moveToElementText) {"," range.moveToElementText(s._node);"," }"," range.select();"," } else {"," par = Y.one(range.parentElement());"," if (!par.test(inst.EditorSelection.BLOCKS)) {"," par = par.ancestor(inst.EditorSelection.BLOCKS);"," }"," if (par) {"," if (par.hasAttribute(DIR)) {"," dir = par.getAttribute(DIR);"," }"," }"," if (html.indexOf('<br>') > -1) {"," html = html.split(/<br>/i);"," } else {"," tmp = inst.Node.create(html),"," ps = tmp ? tmp.all('p') : null;",""," if (ps && ps.size()) {"," html = [];"," ps.each(function(n) {"," html.push(n.get('innerHTML'));"," });"," } else {"," html = [html];"," }"," }"," list = '<' + tag + ' id=\"ie-list\">';"," Y.each(html, function(v) {"," var a = inst.Node.create(v);"," if (a && a.test('p')) {"," if (a.hasAttribute(DIR)) {"," dir = a.getAttribute(DIR);"," }"," v = a.get('innerHTML');"," }"," list += '<li>' + v + '</li>';"," });"," list += '</' + tag + '>';"," range.pasteHTML(list);"," elm = inst.config.doc.getElementById('ie-list');"," elm.id = '';"," if (dir) {"," elm.setAttribute(DIR, dir);"," }"," if (range.moveToElementText) {"," range.moveToElementText(elm);"," }"," range.select();"," }"," } else if (Y.UA.ie) {"," par = inst.one(sel._selection.parentElement());"," if (par.test('p')) {"," if (par && par.hasAttribute(DIR)) {"," dir = par.getAttribute(DIR);"," }"," html = Y.EditorSelection.getText(par);"," if (html === '') {"," sdir = '';"," if (dir) {"," sdir = ' dir=\"' + dir + '\"';"," }"," list = inst.Node.create(Y.Lang.sub('<{tag}{dir}><li></li></{tag}>', { tag: tag, dir: sdir }));"," par.replace(list);"," sel.selectNode(list.one('li'));"," } else {"," this._command(cmd, null);"," }"," } else {"," this._command(cmd, null);"," }"," } else {"," inst.all(tag).addClass(cls);"," if (sel.anchorNode.test(inst.EditorSelection.BLOCKS)) {"," par = sel.anchorNode;"," } else {"," par = sel.anchorNode.ancestor(inst.EditorSelection.BLOCKS);"," }"," if (!par) { //No parent, find the first block under the anchorNode"," par = sel.anchorNode.one(inst.EditorSelection.BLOCKS);"," }",""," if (par && par.hasAttribute(DIR)) {"," dir = par.getAttribute(DIR);"," }"," if (par && par.test(tag)) {"," hasPParent = par.ancestor('p');"," html = inst.Node.create('<div/>');"," elm = par.all('li');"," elm.each(function(h) {"," html.append(self._wrapContent(h.get('innerHTML'), hasPParent));"," });"," if (dir) {"," if (useP) {"," html.all('p').setAttribute(DIR, dir);"," } else {"," html.setAttribute(DIR, dir);"," }"," }"," if (useP) {"," html = inst.Node.create(html.get('innerHTML'));"," }"," fc = html.get('firstChild');"," par.replace(html);"," sel.selectNode(fc);"," } else {"," this._command(cmd, null);"," }"," list = inst.all(tag);"," if (dir) {"," if (list.size()) {"," //Changed to a List"," list.each(function(n) {"," if (!n.hasClass(cls)) {"," n.setAttribute(DIR, dir);"," }"," });"," }"," }",""," list.removeClass(cls);"," }"," },"," /**"," * Noramlizes alignment for Webkit Browsers"," * @method COMMANDS.justify"," * @static"," * @param {String} cmd The command executed: justify (not used)"," * @param {String} val The actual command from the justify{center,all,left,right} stubs"," */"," justify: function(cmd, val) {"," if (Y.UA.webkit) {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," aNode = sel.anchorNode, html,"," bgColor = aNode.getStyle('backgroundColor');",""," this._command(val);"," sel = new inst.EditorSelection();"," if (sel.anchorNode.test('div')) {"," html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';"," sel.anchorNode.set('innerHTML', html);"," sel.anchorNode.one('span').setStyle('backgroundColor', bgColor);"," sel.selectNode(sel.anchorNode.one('span'));"," }"," } else {"," this._command(val);"," }"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifycenter"," * @static"," */"," justifycenter: function() {"," this.command('justify', 'justifycenter');"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifyleft"," * @static"," */"," justifyleft: function() {"," this.command('justify', 'justifyleft');"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifyright"," * @static"," */"," justifyright: function() {"," this.command('justify', 'justifyright');"," },"," /**"," * Override method for COMMANDS.justify"," * @method COMMANDS.justifyfull"," * @static"," */"," justifyfull: function() {"," this.command('justify', 'justifyfull');"," }"," }"," });",""," if (Y.UA.ie) {"," ExecCommand.COMMANDS.bold = function() {"," fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold');"," };"," ExecCommand.COMMANDS.italic = function() {"," fixIETags.call(this, 'italic', 'i', 'FONT-STYLE: italic');"," };"," ExecCommand.COMMANDS.underline = function() {"," fixIETags.call(this, 'underline', 'u', 'TEXT-DECORATION: underline');"," };"," }",""," Y.namespace('Plugin');"," Y.Plugin.ExecCommand = ExecCommand;","","","","}, '3.7.3', {\"requires\": [\"frame\"]});"];+_yuitest_coverage["build/exec-command/exec-command.js"].lines = {"1":0,"12":0,"13":0,"24":0,"30":0,"31":0,"32":0,"33":0,"35":0,"36":0,"38":0,"40":0,"41":0,"42":0,"44":0,"45":0,"46":0,"49":0,"51":0,"53":0,"54":0,"56":0,"57":0,"58":0,"60":0,"63":0,"66":0,"87":0,"89":0,"90":0,"92":0,"103":0,"104":0,"105":0,"106":0,"108":0,"109":0,"113":0,"123":0,"124":0,"126":0,"129":0,"131":0,"134":0,"138":0,"139":0,"143":0,"145":0,"146":0,"148":0,"150":0,"185":0,"186":0,"197":0,"198":0,"199":0,"201":0,"213":0,"214":0,"215":0,"216":0,"217":0,"218":0,"220":0,"222":0,"231":0,"236":0,"237":0,"238":0,"241":0,"242":0,"244":0,"248":0,"249":0,"250":0,"251":0,"252":0,"253":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"263":0,"266":0,"267":0,"268":0,"280":0,"291":0,"292":0,"303":0,"304":0,"315":0,"318":0,"319":0,"321":0,"322":0,"323":0,"324":0,"325":0,"327":0,"328":0,"330":0,"332":0,"335":0,"347":0,"350":0,"351":0,"353":0,"354":0,"356":0,"357":0,"358":0,"359":0,"360":0,"362":0,"364":0,"366":0,"368":0,"371":0,"383":0,"395":0,"396":0,"399":0,"400":0,"401":0,"415":0,"417":0,"420":0,"421":0,"422":0,"423":0,"426":0,"427":0,"428":0,"429":0,"430":0,"431":0,"443":0,"452":0,"462":0,"475":0,"477":0,"478":0,"479":0,"480":0,"482":0,"483":0,"484":0,"486":0,"487":0,"488":0,"489":0,"491":0,"492":0,"493":0,"495":0,"496":0,"497":0,"498":0,"500":0,"501":0,"502":0,"504":0,"507":0,"508":0,"510":0,"512":0,"513":0,"515":0,"517":0,"518":0,"519":0,"521":0,"522":0,"523":0,"526":0,"527":0,"529":0,"532":0,"533":0,"534":0,"535":0,"538":0,"541":0,"542":0,"543":0,"544":0,"545":0,"546":0,"548":0,"550":0,"552":0,"553":0,"554":0,"555":0,"556":0,"557":0,"559":0,"560":0,"562":0,"564":0,"565":0,"566":0,"567":0,"568":0,"570":0,"571":0,"572":0,"573":0,"574":0,"576":0,"577":0,"578":0,"580":0,"583":0,"586":0,"587":0,"588":0,"590":0,"592":0,"593":0,"596":0,"597":0,"599":0,"600":0,"601":0,"602":0,"603":0,"604":0,"606":0,"607":0,"608":0,"610":0,"613":0,"614":0,"616":0,"617":0,"618":0,"620":0,"622":0,"623":0,"624":0,"626":0,"627":0,"628":0,"634":0,"645":0,"646":0,"651":0,"652":0,"653":0,"654":0,"655":0,"656":0,"657":0,"660":0,"669":0,"677":0,"685":0,"693":0,"698":0,"699":0,"700":0,"702":0,"703":0,"705":0,"706":0,"710":0,"711":0};+_yuitest_coverage["build/exec-command/exec-command.js"].functions = {"ExecCommand:12":0,"(anonymous 2):53":0,"fixIETags:23":0,"command:86":0,"_command:102":0,"getInstance:122":0,"execCommand:130":0,"_execCommand:133":0,"(anonymous 3):138":0,"initializer:128":0,"_wrapContent:142":0,"wrap:184":0,"inserthtml:196":0,"insertandfocus:212":0,"insert:235":0,"(anonymous 4):248":0,"insertbr:230":0,"insertimage:279":0,"addclass:290":0,"removeclass:302":0,"forecolor:314":0,"backcolor:346":0,"hilitecolor:382":0,"fontname2:394":0,"fontsize2:414":0,"insertunorderedlist:442":0,"insertorderedlist:451":0,"(anonymous 5):492":0,"(anonymous 6):534":0,"(anonymous 7):542":0,"(anonymous 8):603":0,"(anonymous 9):626":0,"list:461":0,"justify:644":0,"justifycenter:668":0,"justifyleft:676":0,"justifyright:684":0,"justifyfull:692":0,"bold:699":0,"italic:702":0,"underline:705":0,"(anonymous 1):1":0};+_yuitest_coverage["build/exec-command/exec-command.js"].coveredLines = 271; _yuitest_coverage["build/exec-command/exec-command.js"].coveredFunctions = 42; _yuitest_coverline("build/exec-command/exec-command.js", 1); YUI.add('exec-command', function (Y, NAME) {@@ -55,9 +55,84 @@ _yuitest_coverfunc("build/exec-command/exec-command.js", "ExecCommand", 12); _yuitest_coverline("build/exec-command/exec-command.js", 13); ExecCommand.superclass.constructor.apply(this, arguments);+ },+ /**+ * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.+ * @method fixIETags+ * @protected+ * @param {String} cmd The command to execute+ * @param {String} tag The tag to create+ * @param {String} rule The rule that we are looking for.+ */+ fixIETags = function(cmd, tag, rule) {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "fixIETags", 23);+_yuitest_coverline("build/exec-command/exec-command.js", 24);+var inst = this.getInstance(),+ doc = inst.config.doc,+ sel = doc.selection.createRange(),+ o = doc.queryCommandValue(cmd),+ html, reg, m, p, d, s, c;++ _yuitest_coverline("build/exec-command/exec-command.js", 30);+if (o) {+ _yuitest_coverline("build/exec-command/exec-command.js", 31);+html = sel.htmlText;+ _yuitest_coverline("build/exec-command/exec-command.js", 32);+reg = new RegExp(rule, 'g');+ _yuitest_coverline("build/exec-command/exec-command.js", 33);+m = html.match(reg);++ _yuitest_coverline("build/exec-command/exec-command.js", 35);+if (m) {+ _yuitest_coverline("build/exec-command/exec-command.js", 36);+html = html.replace(rule + ';', '').replace(rule, '');++ _yuitest_coverline("build/exec-command/exec-command.js", 38);+sel.pasteHTML('<var id="yui-ie-bs">');++ _yuitest_coverline("build/exec-command/exec-command.js", 40);+p = doc.getElementById('yui-ie-bs');+ _yuitest_coverline("build/exec-command/exec-command.js", 41);+d = doc.createElement('div');+ _yuitest_coverline("build/exec-command/exec-command.js", 42);+s = doc.createElement(tag);++ _yuitest_coverline("build/exec-command/exec-command.js", 44);+d.innerHTML = html;+ _yuitest_coverline("build/exec-command/exec-command.js", 45);+if (p.parentNode !== inst.config.doc.body) {+ _yuitest_coverline("build/exec-command/exec-command.js", 46);+p = p.parentNode;+ }++ _yuitest_coverline("build/exec-command/exec-command.js", 49);+c = d.childNodes;++ _yuitest_coverline("build/exec-command/exec-command.js", 51);+p.parentNode.replaceChild(s, p);++ _yuitest_coverline("build/exec-command/exec-command.js", 53);+Y.each(c, function(f) {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 2)", 53);+_yuitest_coverline("build/exec-command/exec-command.js", 54);+s.appendChild(f);+ });+ _yuitest_coverline("build/exec-command/exec-command.js", 56);+sel.collapse();+ _yuitest_coverline("build/exec-command/exec-command.js", 57);+if (sel.moveToElementText) {+ _yuitest_coverline("build/exec-command/exec-command.js", 58);+sel.moveToElementText(s);+ }+ _yuitest_coverline("build/exec-command/exec-command.js", 60);+sel.select();+ }+ }+ _yuitest_coverline("build/exec-command/exec-command.js", 63);+this._command(cmd); }; - _yuitest_coverline("build/exec-command/exec-command.js", 16);+ _yuitest_coverline("build/exec-command/exec-command.js", 66); Y.extend(ExecCommand, Y.Base, { /** * An internal reference to the keyCode of the last key that was pressed.@@ -79,16 +154,16 @@ * @return {Node/NodeList} Should return the Node/Nodelist affected */ command: function(action, value) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "command", 36);-_yuitest_coverline("build/exec-command/exec-command.js", 37);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "command", 86);+_yuitest_coverline("build/exec-command/exec-command.js", 87); var fn = ExecCommand.COMMANDS[action];- - _yuitest_coverline("build/exec-command/exec-command.js", 39);++ _yuitest_coverline("build/exec-command/exec-command.js", 89); if (fn) {- _yuitest_coverline("build/exec-command/exec-command.js", 40);+ _yuitest_coverline("build/exec-command/exec-command.js", 90); return fn.call(this, action, value); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 42);+ _yuitest_coverline("build/exec-command/exec-command.js", 92); return this._command(action, value); } },@@ -100,24 +175,24 @@ * @param {String} value The optional value (helvetica) */ _command: function(action, value) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "_command", 52);-_yuitest_coverline("build/exec-command/exec-command.js", 53);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "_command", 102);+_yuitest_coverline("build/exec-command/exec-command.js", 103); var inst = this.getInstance();- _yuitest_coverline("build/exec-command/exec-command.js", 54);+ _yuitest_coverline("build/exec-command/exec-command.js", 104); try {- _yuitest_coverline("build/exec-command/exec-command.js", 55);+ _yuitest_coverline("build/exec-command/exec-command.js", 105); try {- _yuitest_coverline("build/exec-command/exec-command.js", 56);+ _yuitest_coverline("build/exec-command/exec-command.js", 106); inst.config.doc.execCommand('styleWithCSS', null, 1); } catch (e1) {- _yuitest_coverline("build/exec-command/exec-command.js", 58);+ _yuitest_coverline("build/exec-command/exec-command.js", 108); try {- _yuitest_coverline("build/exec-command/exec-command.js", 59);+ _yuitest_coverline("build/exec-command/exec-command.js", 109); inst.config.doc.execCommand('useCSS', null, 0); } catch (e2) { } }- _yuitest_coverline("build/exec-command/exec-command.js", 63);+ _yuitest_coverline("build/exec-command/exec-command.js", 113); inst.config.doc.execCommand(action, null, value); } catch (e) { }@@ -128,52 +203,52 @@ * @return {YUI} The YUI instance bound to the parent frame */ getInstance: function() {- _yuitest_coverfunc("build/exec-command/exec-command.js", "getInstance", 72);-_yuitest_coverline("build/exec-command/exec-command.js", 73);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "getInstance", 122);+_yuitest_coverline("build/exec-command/exec-command.js", 123); if (!this._inst) {- _yuitest_coverline("build/exec-command/exec-command.js", 74);+ _yuitest_coverline("build/exec-command/exec-command.js", 124); this._inst = this.get('host').getInstance(); }- _yuitest_coverline("build/exec-command/exec-command.js", 76);+ _yuitest_coverline("build/exec-command/exec-command.js", 126); return this._inst; }, initializer: function() {- _yuitest_coverfunc("build/exec-command/exec-command.js", "initializer", 78);-_yuitest_coverline("build/exec-command/exec-command.js", 79);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "initializer", 128);+_yuitest_coverline("build/exec-command/exec-command.js", 129); Y.mix(this.get('host'), { execCommand: function(action, value) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "execCommand", 80);-_yuitest_coverline("build/exec-command/exec-command.js", 81);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "execCommand", 130);+_yuitest_coverline("build/exec-command/exec-command.js", 131); return this.exec.command(action, value); }, _execCommand: function(action, value) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "_execCommand", 83);-_yuitest_coverline("build/exec-command/exec-command.js", 84);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "_execCommand", 133);+_yuitest_coverline("build/exec-command/exec-command.js", 134); return this.exec._command(action, value); } }); - _yuitest_coverline("build/exec-command/exec-command.js", 88);+ _yuitest_coverline("build/exec-command/exec-command.js", 138); this.get('host').on('dom:keypress', Y.bind(function(e) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 2)", 88);-_yuitest_coverline("build/exec-command/exec-command.js", 89);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 3)", 138);+_yuitest_coverline("build/exec-command/exec-command.js", 139); this._lastKey = e.keyCode; }, this)); }, _wrapContent: function(str, override) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "_wrapContent", 92);-_yuitest_coverline("build/exec-command/exec-command.js", 93);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "_wrapContent", 142);+_yuitest_coverline("build/exec-command/exec-command.js", 143); var useP = (this.getInstance().host.editorPara && !override ? true : false);- - _yuitest_coverline("build/exec-command/exec-command.js", 95);++ _yuitest_coverline("build/exec-command/exec-command.js", 145); if (useP) {- _yuitest_coverline("build/exec-command/exec-command.js", 96);+ _yuitest_coverline("build/exec-command/exec-command.js", 146); str = '<p>' + str + '</p>'; } else {- _yuitest_coverline("build/exec-command/exec-command.js", 98);+ _yuitest_coverline("build/exec-command/exec-command.js", 148); str = str + '<br>'; }- _yuitest_coverline("build/exec-command/exec-command.js", 100);+ _yuitest_coverline("build/exec-command/exec-command.js", 150); return str; } }, {@@ -209,10 +284,10 @@ * @return {NodeList} NodeList of the items touched by this command. */ wrap: function(cmd, tag) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "wrap", 134);-_yuitest_coverline("build/exec-command/exec-command.js", 135);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "wrap", 184);+_yuitest_coverline("build/exec-command/exec-command.js", 185); var inst = this.getInstance();- _yuitest_coverline("build/exec-command/exec-command.js", 136);+ _yuitest_coverline("build/exec-command/exec-command.js", 186); return (new inst.EditorSelection()).wrapContent(tag); }, /**@@ -224,15 +299,15 @@ * @return {Node} Node instance of the item touched by this command. */ inserthtml: function(cmd, html) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "inserthtml", 146);-_yuitest_coverline("build/exec-command/exec-command.js", 147);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "inserthtml", 196);+_yuitest_coverline("build/exec-command/exec-command.js", 197); var inst = this.getInstance();- _yuitest_coverline("build/exec-command/exec-command.js", 148);+ _yuitest_coverline("build/exec-command/exec-command.js", 198); if (inst.EditorSelection.hasCursor() || Y.UA.ie) {- _yuitest_coverline("build/exec-command/exec-command.js", 149);+ _yuitest_coverline("build/exec-command/exec-command.js", 199); return (new inst.EditorSelection()).insertContent(html); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 151);+ _yuitest_coverline("build/exec-command/exec-command.js", 201); this._command('inserthtml', html); } },@@ -245,24 +320,24 @@ * @return {Node} Node instance of the item touched by this command. */ insertandfocus: function(cmd, html) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "insertandfocus", 162);-_yuitest_coverline("build/exec-command/exec-command.js", 163);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "insertandfocus", 212);+_yuitest_coverline("build/exec-command/exec-command.js", 213); var inst = this.getInstance(), out, sel;- _yuitest_coverline("build/exec-command/exec-command.js", 164);+ _yuitest_coverline("build/exec-command/exec-command.js", 214); if (inst.EditorSelection.hasCursor()) {- _yuitest_coverline("build/exec-command/exec-command.js", 165);+ _yuitest_coverline("build/exec-command/exec-command.js", 215); html += inst.EditorSelection.CURSOR;- _yuitest_coverline("build/exec-command/exec-command.js", 166);+ _yuitest_coverline("build/exec-command/exec-command.js", 216); out = this.command('inserthtml', html);- _yuitest_coverline("build/exec-command/exec-command.js", 167);+ _yuitest_coverline("build/exec-command/exec-command.js", 217); sel = new inst.EditorSelection();- _yuitest_coverline("build/exec-command/exec-command.js", 168);+ _yuitest_coverline("build/exec-command/exec-command.js", 218); sel.focusCursor(true, true); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 170);+ _yuitest_coverline("build/exec-command/exec-command.js", 220); this.command('inserthtml', html); }- _yuitest_coverline("build/exec-command/exec-command.js", 172);+ _yuitest_coverline("build/exec-command/exec-command.js", 222); return out; }, /**@@ -271,71 +346,70 @@ * @static * @param {String} cmd The command executed: insertbr */- insertbr: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "insertbr", 180);-_yuitest_coverline("build/exec-command/exec-command.js", 181);+ insertbr: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "insertbr", 230);+_yuitest_coverline("build/exec-command/exec-command.js", 231); var inst = this.getInstance(), sel = new inst.EditorSelection(), html = '<var>|</var>', last = null,- q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var';+ q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var',+ insert = function(n) {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "insert", 235);+_yuitest_coverline("build/exec-command/exec-command.js", 236);+var c = inst.Node.create('<br>');+ _yuitest_coverline("build/exec-command/exec-command.js", 237);+n.insert(c, 'before');+ _yuitest_coverline("build/exec-command/exec-command.js", 238);+return c;+ }; - _yuitest_coverline("build/exec-command/exec-command.js", 186);+ _yuitest_coverline("build/exec-command/exec-command.js", 241); if (sel._selection.pasteHTML) {- _yuitest_coverline("build/exec-command/exec-command.js", 187);+ _yuitest_coverline("build/exec-command/exec-command.js", 242); sel._selection.pasteHTML(html); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 189);+ _yuitest_coverline("build/exec-command/exec-command.js", 244); this._command('inserthtml', html); } - _yuitest_coverline("build/exec-command/exec-command.js", 192);-var insert = function(n) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "insert", 192);-_yuitest_coverline("build/exec-command/exec-command.js", 193);-var c = inst.Node.create('<br>');- _yuitest_coverline("build/exec-command/exec-command.js", 194);-n.insert(c, 'before');- _yuitest_coverline("build/exec-command/exec-command.js", 195);-return c;- }; - _yuitest_coverline("build/exec-command/exec-command.js", 198);+ _yuitest_coverline("build/exec-command/exec-command.js", 248); inst.all(q).each(function(n) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 3)", 198);-_yuitest_coverline("build/exec-command/exec-command.js", 199);-var g = true; - _yuitest_coverline("build/exec-command/exec-command.js", 200);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 4)", 248);+_yuitest_coverline("build/exec-command/exec-command.js", 249);+var g = true, s;+ _yuitest_coverline("build/exec-command/exec-command.js", 250); if (Y.UA.webkit) {- _yuitest_coverline("build/exec-command/exec-command.js", 201);+ _yuitest_coverline("build/exec-command/exec-command.js", 251); g = false;- _yuitest_coverline("build/exec-command/exec-command.js", 202);+ _yuitest_coverline("build/exec-command/exec-command.js", 252); if (n.get('innerHTML') === '|') {- _yuitest_coverline("build/exec-command/exec-command.js", 203);+ _yuitest_coverline("build/exec-command/exec-command.js", 253); g = true; } }- _yuitest_coverline("build/exec-command/exec-command.js", 206);+ _yuitest_coverline("build/exec-command/exec-command.js", 256); if (g) {- _yuitest_coverline("build/exec-command/exec-command.js", 207);+ _yuitest_coverline("build/exec-command/exec-command.js", 257); last = insert(n);- _yuitest_coverline("build/exec-command/exec-command.js", 208);+ _yuitest_coverline("build/exec-command/exec-command.js", 258); if ((!last.previous() || !last.previous().test('br')) && Y.UA.gecko) {- _yuitest_coverline("build/exec-command/exec-command.js", 209);-var s = last.cloneNode();- _yuitest_coverline("build/exec-command/exec-command.js", 210);+ _yuitest_coverline("build/exec-command/exec-command.js", 259);+s = last.cloneNode();+ _yuitest_coverline("build/exec-command/exec-command.js", 260); last.insert(s, 'after');- _yuitest_coverline("build/exec-command/exec-command.js", 211);+ _yuitest_coverline("build/exec-command/exec-command.js", 261); last = s; }- _yuitest_coverline("build/exec-command/exec-command.js", 213);+ _yuitest_coverline("build/exec-command/exec-command.js", 263); n.remove(); } });- _yuitest_coverline("build/exec-command/exec-command.js", 216);+ _yuitest_coverline("build/exec-command/exec-command.js", 266); if (Y.UA.webkit && last) {- _yuitest_coverline("build/exec-command/exec-command.js", 217);+ _yuitest_coverline("build/exec-command/exec-command.js", 267); insert(last);- _yuitest_coverline("build/exec-command/exec-command.js", 218);+ _yuitest_coverline("build/exec-command/exec-command.js", 268); sel.selectNode(last); } },@@ -348,8 +422,8 @@ * @return {Node} Node instance of the item touched by this command. */ insertimage: function(cmd, img) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "insertimage", 229);-_yuitest_coverline("build/exec-command/exec-command.js", 230);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "insertimage", 279);+_yuitest_coverline("build/exec-command/exec-command.js", 280); return this.command('inserthtml', '<img src="' + img + '">'); }, /**@@ -361,10 +435,10 @@ * @return {NodeList} NodeList of the items touched by this command. */ addclass: function(cmd, cls) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "addclass", 240);-_yuitest_coverline("build/exec-command/exec-command.js", 241);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "addclass", 290);+_yuitest_coverline("build/exec-command/exec-command.js", 291); var inst = this.getInstance();- _yuitest_coverline("build/exec-command/exec-command.js", 242);+ _yuitest_coverline("build/exec-command/exec-command.js", 292); return (new inst.EditorSelection()).getSelected().addClass(cls); }, /**@@ -376,10 +450,10 @@ * @return {NodeList} NodeList of the items touched by this command. */ removeclass: function(cmd, cls) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "removeclass", 252);-_yuitest_coverline("build/exec-command/exec-command.js", 253);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "removeclass", 302);+_yuitest_coverline("build/exec-command/exec-command.js", 303); var inst = this.getInstance();- _yuitest_coverline("build/exec-command/exec-command.js", 254);+ _yuitest_coverline("build/exec-command/exec-command.js", 304); return (new inst.EditorSelection()).getSelected().removeClass(cls); }, /**@@ -391,40 +465,40 @@ * @return {NodeList} NodeList of the items touched by this command. */ forecolor: function(cmd, val) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "forecolor", 264);-_yuitest_coverline("build/exec-command/exec-command.js", 265);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "forecolor", 314);+_yuitest_coverline("build/exec-command/exec-command.js", 315); var inst = this.getInstance(), sel = new inst.EditorSelection(), n; - _yuitest_coverline("build/exec-command/exec-command.js", 268);+ _yuitest_coverline("build/exec-command/exec-command.js", 318); if (!Y.UA.ie) {- _yuitest_coverline("build/exec-command/exec-command.js", 269);+ _yuitest_coverline("build/exec-command/exec-command.js", 319); this._command('useCSS', false); }- _yuitest_coverline("build/exec-command/exec-command.js", 271);+ _yuitest_coverline("build/exec-command/exec-command.js", 321); if (inst.EditorSelection.hasCursor()) {- _yuitest_coverline("build/exec-command/exec-command.js", 272);+ _yuitest_coverline("build/exec-command/exec-command.js", 322); if (sel.isCollapsed) {- _yuitest_coverline("build/exec-command/exec-command.js", 273);+ _yuitest_coverline("build/exec-command/exec-command.js", 323); if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === ' ')) {- _yuitest_coverline("build/exec-command/exec-command.js", 274);+ _yuitest_coverline("build/exec-command/exec-command.js", 324); sel.anchorNode.setStyle('color', val);- _yuitest_coverline("build/exec-command/exec-command.js", 275);+ _yuitest_coverline("build/exec-command/exec-command.js", 325); n = sel.anchorNode; } else {- _yuitest_coverline("build/exec-command/exec-command.js", 277);+ _yuitest_coverline("build/exec-command/exec-command.js", 327); n = this.command('inserthtml', '<span style="color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>');- _yuitest_coverline("build/exec-command/exec-command.js", 278);+ _yuitest_coverline("build/exec-command/exec-command.js", 328); sel.focusCursor(true, true); }- _yuitest_coverline("build/exec-command/exec-command.js", 280);+ _yuitest_coverline("build/exec-command/exec-command.js", 330); return n; } else {- _yuitest_coverline("build/exec-command/exec-command.js", 282);+ _yuitest_coverline("build/exec-command/exec-command.js", 332); return this._command(cmd, val); } } else {- _yuitest_coverline("build/exec-command/exec-command.js", 285);+ _yuitest_coverline("build/exec-command/exec-command.js", 335); this._command(cmd, val); } },@@ -437,45 +511,46 @@ * @return {NodeList} NodeList of the items touched by this command. */ backcolor: function(cmd, val) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "backcolor", 296);-_yuitest_coverline("build/exec-command/exec-command.js", 297);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "backcolor", 346);+_yuitest_coverline("build/exec-command/exec-command.js", 347); var inst = this.getInstance(), sel = new inst.EditorSelection(), n;- - _yuitest_coverline("build/exec-command/exec-command.js", 300);++ _yuitest_coverline("build/exec-command/exec-command.js", 350); if (Y.UA.gecko || Y.UA.opera) {- _yuitest_coverline("build/exec-command/exec-command.js", 301);+ _yuitest_coverline("build/exec-command/exec-command.js", 351); cmd = 'hilitecolor'; }- _yuitest_coverline("build/exec-command/exec-command.js", 303);+ _yuitest_coverline("build/exec-command/exec-command.js", 353); if (!Y.UA.ie) {- _yuitest_coverline("build/exec-command/exec-command.js", 304);+ _yuitest_coverline("build/exec-command/exec-command.js", 354); this._command('useCSS', false); }- _yuitest_coverline("build/exec-command/exec-command.js", 306);+ _yuitest_coverline("build/exec-command/exec-command.js", 356); if (inst.EditorSelection.hasCursor()) {- _yuitest_coverline("build/exec-command/exec-command.js", 307);+ _yuitest_coverline("build/exec-command/exec-command.js", 357); if (sel.isCollapsed) {- _yuitest_coverline("build/exec-command/exec-command.js", 308);+ _yuitest_coverline("build/exec-command/exec-command.js", 358); if (sel.anchorNode && (sel.anchorNode.get('innerHTML') === ' ')) {- _yuitest_coverline("build/exec-command/exec-command.js", 309);+ _yuitest_coverline("build/exec-command/exec-command.js", 359); sel.anchorNode.setStyle('backgroundColor', val);- _yuitest_coverline("build/exec-command/exec-command.js", 310);+ _yuitest_coverline("build/exec-command/exec-command.js", 360); n = sel.anchorNode; } else {- _yuitest_coverline("build/exec-command/exec-command.js", 312);-n = this.command('inserthtml', '<span style="background-color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>');- _yuitest_coverline("build/exec-command/exec-command.js", 313);+ _yuitest_coverline("build/exec-command/exec-command.js", 362);+n = this.command('inserthtml',+ '<span style="background-color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>');+ _yuitest_coverline("build/exec-command/exec-command.js", 364); sel.focusCursor(true, true); }- _yuitest_coverline("build/exec-command/exec-command.js", 315);+ _yuitest_coverline("build/exec-command/exec-command.js", 366); return n; } else {- _yuitest_coverline("build/exec-command/exec-command.js", 317);+ _yuitest_coverline("build/exec-command/exec-command.js", 368); return this._command(cmd, val); } } else {- _yuitest_coverline("build/exec-command/exec-command.js", 320);+ _yuitest_coverline("build/exec-command/exec-command.js", 371); this._command(cmd, val); } },@@ -488,8 +563,8 @@ * @return {NodeList} NodeList of the items touched by this command. */ hilitecolor: function() {- _yuitest_coverfunc("build/exec-command/exec-command.js", "hilitecolor", 331);-_yuitest_coverline("build/exec-command/exec-command.js", 332);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "hilitecolor", 382);+_yuitest_coverline("build/exec-command/exec-command.js", 383); return ExecCommand.COMMANDS.backcolor.apply(this, arguments); }, /**@@ -502,18 +577,18 @@ * @return {NodeList} NodeList of the items touched by this command. */ fontname2: function(cmd, val) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "fontname2", 343);-_yuitest_coverline("build/exec-command/exec-command.js", 344);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "fontname2", 394);+_yuitest_coverline("build/exec-command/exec-command.js", 395); this._command('fontname', val);- _yuitest_coverline("build/exec-command/exec-command.js", 345);+ _yuitest_coverline("build/exec-command/exec-command.js", 396); var inst = this.getInstance(), sel = new inst.EditorSelection();- - _yuitest_coverline("build/exec-command/exec-command.js", 348);-if (sel.isCollapsed && (this._lastKey != 32)) {- _yuitest_coverline("build/exec-command/exec-command.js", 349);++ _yuitest_coverline("build/exec-command/exec-command.js", 399);+if (sel.isCollapsed && (this._lastKey !== 32)) {+ _yuitest_coverline("build/exec-command/exec-command.js", 400); if (sel.anchorNode.test('font')) {- _yuitest_coverline("build/exec-command/exec-command.js", 350);+ _yuitest_coverline("build/exec-command/exec-command.js", 401); sel.anchorNode.set('face', val); } }@@ -528,35 +603,35 @@ * @return {NodeList} NodeList of the items touched by this command. */ fontsize2: function(cmd, val) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "fontsize2", 363);-_yuitest_coverline("build/exec-command/exec-command.js", 364);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "fontsize2", 414);+_yuitest_coverline("build/exec-command/exec-command.js", 415); this._command('fontsize', val); - _yuitest_coverline("build/exec-command/exec-command.js", 366);+ _yuitest_coverline("build/exec-command/exec-command.js", 417); var inst = this.getInstance(),- sel = new inst.EditorSelection();- - _yuitest_coverline("build/exec-command/exec-command.js", 369);-if (sel.isCollapsed && sel.anchorNode && (this._lastKey != 32)) {- _yuitest_coverline("build/exec-command/exec-command.js", 370);+ sel = new inst.EditorSelection(), p;++ _yuitest_coverline("build/exec-command/exec-command.js", 420);+if (sel.isCollapsed && sel.anchorNode && (this._lastKey !== 32)) {+ _yuitest_coverline("build/exec-command/exec-command.js", 421); if (Y.UA.webkit) {- _yuitest_coverline("build/exec-command/exec-command.js", 371);+ _yuitest_coverline("build/exec-command/exec-command.js", 422); if (sel.anchorNode.getStyle('lineHeight')) {- _yuitest_coverline("build/exec-command/exec-command.js", 372);+ _yuitest_coverline("build/exec-command/exec-command.js", 423); sel.anchorNode.setStyle('lineHeight', ''); } }- _yuitest_coverline("build/exec-command/exec-command.js", 375);+ _yuitest_coverline("build/exec-command/exec-command.js", 426); if (sel.anchorNode.test('font')) {- _yuitest_coverline("build/exec-command/exec-command.js", 376);+ _yuitest_coverline("build/exec-command/exec-command.js", 427); sel.anchorNode.set('size', val);- } else {_yuitest_coverline("build/exec-command/exec-command.js", 377);+ } else {_yuitest_coverline("build/exec-command/exec-command.js", 428); if (Y.UA.gecko) {- _yuitest_coverline("build/exec-command/exec-command.js", 378);-var p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG);- _yuitest_coverline("build/exec-command/exec-command.js", 379);+ _yuitest_coverline("build/exec-command/exec-command.js", 429);+p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG);+ _yuitest_coverline("build/exec-command/exec-command.js", 430); if (p) {- _yuitest_coverline("build/exec-command/exec-command.js", 380);+ _yuitest_coverline("build/exec-command/exec-command.js", 431); p.setStyle('fontSize', ''); } }}@@ -568,9 +643,9 @@ * @static * @param {String} cmd The command executed: list, ul */- insertunorderedlist: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "insertunorderedlist", 391);-_yuitest_coverline("build/exec-command/exec-command.js", 392);+ insertunorderedlist: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "insertunorderedlist", 442);+_yuitest_coverline("build/exec-command/exec-command.js", 443); this.command('list', 'ul'); }, /**@@ -579,9 +654,9 @@ * @static * @param {String} cmd The command executed: list, ol */- insertorderedlist: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "insertorderedlist", 400);-_yuitest_coverline("build/exec-command/exec-command.js", 401);+ insertorderedlist: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "insertorderedlist", 451);+_yuitest_coverline("build/exec-command/exec-command.js", 452); this.command('list', 'ol'); }, /**@@ -592,290 +667,291 @@ * @param {String} tag The tag to deal with */ list: function(cmd, tag) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "list", 410);-_yuitest_coverline("build/exec-command/exec-command.js", 411);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "list", 461);+_yuitest_coverline("build/exec-command/exec-command.js", 462); var inst = this.getInstance(), html, self = this, /* The yui3- class name below is not a skinnable class,- it's a utility class used internally by editor and + it's a utility class used internally by editor and stripped when completed, calling getClassName on this is a waste of resources. */ DIR = 'dir', cls = 'yui3-touched', dir, range, div, elm, n, str, s, par, list, lis,- useP = (inst.host.editorPara ? true : false),+ useP = (inst.host.editorPara ? true : false), tmp,+ sdir, hasPParent, fc, sel = new inst.EditorSelection(); - _yuitest_coverline("build/exec-command/exec-command.js", 423);+ _yuitest_coverline("build/exec-command/exec-command.js", 475); cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';- - _yuitest_coverline("build/exec-command/exec-command.js", 425);++ _yuitest_coverline("build/exec-command/exec-command.js", 477); if (Y.UA.ie && !sel.isCollapsed) {- _yuitest_coverline("build/exec-command/exec-command.js", 426);+ _yuitest_coverline("build/exec-command/exec-command.js", 478); range = sel._selection;- _yuitest_coverline("build/exec-command/exec-command.js", 427);+ _yuitest_coverline("build/exec-command/exec-command.js", 479); html = range.htmlText;- _yuitest_coverline("build/exec-command/exec-command.js", 428);+ _yuitest_coverline("build/exec-command/exec-command.js", 480); div = inst.Node.create(html) || inst.one('body'); - _yuitest_coverline("build/exec-command/exec-command.js", 430);+ _yuitest_coverline("build/exec-command/exec-command.js", 482); if (div.test('li') || div.one('li')) {- _yuitest_coverline("build/exec-command/exec-command.js", 431);+ _yuitest_coverline("build/exec-command/exec-command.js", 483); this._command(cmd, null);- _yuitest_coverline("build/exec-command/exec-command.js", 432);+ _yuitest_coverline("build/exec-command/exec-command.js", 484); return; }- _yuitest_coverline("build/exec-command/exec-command.js", 434);+ _yuitest_coverline("build/exec-command/exec-command.js", 486); if (div.test(tag)) {- _yuitest_coverline("build/exec-command/exec-command.js", 435);+ _yuitest_coverline("build/exec-command/exec-command.js", 487); elm = range.item ? range.item(0) : range.parentElement();- _yuitest_coverline("build/exec-command/exec-command.js", 436);+ _yuitest_coverline("build/exec-command/exec-command.js", 488); n = inst.one(elm);- _yuitest_coverline("build/exec-command/exec-command.js", 437);+ _yuitest_coverline("build/exec-command/exec-command.js", 489); lis = n.all('li'); - _yuitest_coverline("build/exec-command/exec-command.js", 439);+ _yuitest_coverline("build/exec-command/exec-command.js", 491); str = '<div>';- _yuitest_coverline("build/exec-command/exec-command.js", 440);+ _yuitest_coverline("build/exec-command/exec-command.js", 492); lis.each(function(l) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 4)", 440);-_yuitest_coverline("build/exec-command/exec-command.js", 441);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 5)", 492);+_yuitest_coverline("build/exec-command/exec-command.js", 493); str = self._wrapContent(l.get('innerHTML')); });- _yuitest_coverline("build/exec-command/exec-command.js", 443);+ _yuitest_coverline("build/exec-command/exec-command.js", 495); str += '</div>';- _yuitest_coverline("build/exec-command/exec-command.js", 444);+ _yuitest_coverline("build/exec-command/exec-command.js", 496); s = inst.Node.create(str);- _yuitest_coverline("build/exec-command/exec-command.js", 445);+ _yuitest_coverline("build/exec-command/exec-command.js", 497); if (n.get('parentNode').test('div')) {- _yuitest_coverline("build/exec-command/exec-command.js", 446);+ _yuitest_coverline("build/exec-command/exec-command.js", 498); n = n.get('parentNode'); }- _yuitest_coverline("build/exec-command/exec-command.js", 448);+ _yuitest_coverline("build/exec-command/exec-command.js", 500); if (n && n.hasAttribute(DIR)) {- _yuitest_coverline("build/exec-command/exec-command.js", 449);+ _yuitest_coverline("build/exec-command/exec-command.js", 501); if (useP) {- _yuitest_coverline("build/exec-command/exec-command.js", 450);+ _yuitest_coverline("build/exec-command/exec-command.js", 502); s.all('p').setAttribute(DIR, n.getAttribute(DIR)); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 452);+ _yuitest_coverline("build/exec-command/exec-command.js", 504); s.setAttribute(DIR, n.getAttribute(DIR)); } }- _yuitest_coverline("build/exec-command/exec-command.js", 455);+ _yuitest_coverline("build/exec-command/exec-command.js", 507); if (useP) {- _yuitest_coverline("build/exec-command/exec-command.js", 456);+ _yuitest_coverline("build/exec-command/exec-command.js", 508); n.replace(s.get('innerHTML')); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 458);+ _yuitest_coverline("build/exec-command/exec-command.js", 510); n.replace(s); }- _yuitest_coverline("build/exec-command/exec-command.js", 460);+ _yuitest_coverline("build/exec-command/exec-command.js", 512); if (range.moveToElementText) {- _yuitest_coverline("build/exec-command/exec-command.js", 461);+ _yuitest_coverline("build/exec-command/exec-command.js", 513); range.moveToElementText(s._node); }- _yuitest_coverline("build/exec-command/exec-command.js", 463);+ _yuitest_coverline("build/exec-command/exec-command.js", 515); range.select(); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 465);+ _yuitest_coverline("build/exec-command/exec-command.js", 517); par = Y.one(range.parentElement());- _yuitest_coverline("build/exec-command/exec-command.js", 466);+ _yuitest_coverline("build/exec-command/exec-command.js", 518); if (!par.test(inst.EditorSelection.BLOCKS)) {- _yuitest_coverline("build/exec-command/exec-command.js", 467);+ _yuitest_coverline("build/exec-command/exec-command.js", 519); par = par.ancestor(inst.EditorSelection.BLOCKS); }- _yuitest_coverline("build/exec-command/exec-command.js", 469);+ _yuitest_coverline("build/exec-command/exec-command.js", 521); if (par) {- _yuitest_coverline("build/exec-command/exec-command.js", 470);+ _yuitest_coverline("build/exec-command/exec-command.js", 522); if (par.hasAttribute(DIR)) {- _yuitest_coverline("build/exec-command/exec-command.js", 471);+ _yuitest_coverline("build/exec-command/exec-command.js", 523); dir = par.getAttribute(DIR); } }- _yuitest_coverline("build/exec-command/exec-command.js", 474);+ _yuitest_coverline("build/exec-command/exec-command.js", 526); if (html.indexOf('<br>') > -1) {- _yuitest_coverline("build/exec-command/exec-command.js", 475);+ _yuitest_coverline("build/exec-command/exec-command.js", 527); html = html.split(/<br>/i); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 477);-var tmp = inst.Node.create(html),+ _yuitest_coverline("build/exec-command/exec-command.js", 529);+tmp = inst.Node.create(html), ps = tmp ? tmp.all('p') : null; - _yuitest_coverline("build/exec-command/exec-command.js", 480);+ _yuitest_coverline("build/exec-command/exec-command.js", 532); if (ps && ps.size()) {- _yuitest_coverline("build/exec-command/exec-command.js", 481);+ _yuitest_coverline("build/exec-command/exec-command.js", 533); html = [];- _yuitest_coverline("build/exec-command/exec-command.js", 482);+ _yuitest_coverline("build/exec-command/exec-command.js", 534); ps.each(function(n) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 5)", 482);-_yuitest_coverline("build/exec-command/exec-command.js", 483);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 6)", 534);+_yuitest_coverline("build/exec-command/exec-command.js", 535); html.push(n.get('innerHTML')); }); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 486);+ _yuitest_coverline("build/exec-command/exec-command.js", 538); html = [html]; } }- _yuitest_coverline("build/exec-command/exec-command.js", 489);+ _yuitest_coverline("build/exec-command/exec-command.js", 541); list = '<' + tag + ' id="ie-list">';- _yuitest_coverline("build/exec-command/exec-command.js", 490);+ _yuitest_coverline("build/exec-command/exec-command.js", 542); Y.each(html, function(v) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 6)", 490);-_yuitest_coverline("build/exec-command/exec-command.js", 491);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 7)", 542);+_yuitest_coverline("build/exec-command/exec-command.js", 543); var a = inst.Node.create(v);- _yuitest_coverline("build/exec-command/exec-command.js", 492);+ _yuitest_coverline("build/exec-command/exec-command.js", 544); if (a && a.test('p')) {- _yuitest_coverline("build/exec-command/exec-command.js", 493);+ _yuitest_coverline("build/exec-command/exec-command.js", 545); if (a.hasAttribute(DIR)) {- _yuitest_coverline("build/exec-command/exec-command.js", 494);+ _yuitest_coverline("build/exec-command/exec-command.js", 546); dir = a.getAttribute(DIR); }- _yuitest_coverline("build/exec-command/exec-command.js", 496);+ _yuitest_coverline("build/exec-command/exec-command.js", 548); v = a.get('innerHTML'); }- _yuitest_coverline("build/exec-command/exec-command.js", 498);+ _yuitest_coverline("build/exec-command/exec-command.js", 550); list += '<li>' + v + '</li>'; });- _yuitest_coverline("build/exec-command/exec-command.js", 500);+ _yuitest_coverline("build/exec-command/exec-command.js", 552); list += '</' + tag + '>';- _yuitest_coverline("build/exec-command/exec-command.js", 501);+ _yuitest_coverline("build/exec-command/exec-command.js", 553); range.pasteHTML(list);- _yuitest_coverline("build/exec-command/exec-command.js", 502);+ _yuitest_coverline("build/exec-command/exec-command.js", 554); elm = inst.config.doc.getElementById('ie-list');- _yuitest_coverline("build/exec-command/exec-command.js", 503);+ _yuitest_coverline("build/exec-command/exec-command.js", 555); elm.id = '';- _yuitest_coverline("build/exec-command/exec-command.js", 504);+ _yuitest_coverline("build/exec-command/exec-command.js", 556); if (dir) {- _yuitest_coverline("build/exec-command/exec-command.js", 505);+ _yuitest_coverline("build/exec-command/exec-command.js", 557); elm.setAttribute(DIR, dir); }- _yuitest_coverline("build/exec-command/exec-command.js", 507);+ _yuitest_coverline("build/exec-command/exec-command.js", 559); if (range.moveToElementText) {- _yuitest_coverline("build/exec-command/exec-command.js", 508);+ _yuitest_coverline("build/exec-command/exec-command.js", 560); range.moveToElementText(elm); }- _yuitest_coverline("build/exec-command/exec-command.js", 510);+ _yuitest_coverline("build/exec-command/exec-command.js", 562); range.select(); }- } else {_yuitest_coverline("build/exec-command/exec-command.js", 512);+ } else {_yuitest_coverline("build/exec-command/exec-command.js", 564); if (Y.UA.ie) {- _yuitest_coverline("build/exec-command/exec-command.js", 513);+ _yuitest_coverline("build/exec-command/exec-command.js", 565); par = inst.one(sel._selection.parentElement());- _yuitest_coverline("build/exec-command/exec-command.js", 514);+ _yuitest_coverline("build/exec-command/exec-command.js", 566); if (par.test('p')) {- _yuitest_coverline("build/exec-command/exec-command.js", 515);+ _yuitest_coverline("build/exec-command/exec-command.js", 567); if (par && par.hasAttribute(DIR)) {- _yuitest_coverline("build/exec-command/exec-command.js", 516);+ _yuitest_coverline("build/exec-command/exec-command.js", 568); dir = par.getAttribute(DIR); }- _yuitest_coverline("build/exec-command/exec-command.js", 518);+ _yuitest_coverline("build/exec-command/exec-command.js", 570); html = Y.EditorSelection.getText(par);- _yuitest_coverline("build/exec-command/exec-command.js", 519);+ _yuitest_coverline("build/exec-command/exec-command.js", 571); if (html === '') {- _yuitest_coverline("build/exec-command/exec-command.js", 520);-var sdir = '';- _yuitest_coverline("build/exec-command/exec-command.js", 521);+ _yuitest_coverline("build/exec-command/exec-command.js", 572);+sdir = '';+ _yuitest_coverline("build/exec-command/exec-command.js", 573); if (dir) {- _yuitest_coverline("build/exec-command/exec-command.js", 522);+ _yuitest_coverline("build/exec-command/exec-command.js", 574); sdir = ' dir="' + dir + '"'; }- _yuitest_coverline("build/exec-command/exec-command.js", 524);+ _yuitest_coverline("build/exec-command/exec-command.js", 576); list = inst.Node.create(Y.Lang.sub('<{tag}{dir}><li></li></{tag}>', { tag: tag, dir: sdir }));- _yuitest_coverline("build/exec-command/exec-command.js", 525);+ _yuitest_coverline("build/exec-command/exec-command.js", 577); par.replace(list);- _yuitest_coverline("build/exec-command/exec-command.js", 526);+ _yuitest_coverline("build/exec-command/exec-command.js", 578); sel.selectNode(list.one('li')); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 528);+ _yuitest_coverline("build/exec-command/exec-command.js", 580); this._command(cmd, null); } } else {- _yuitest_coverline("build/exec-command/exec-command.js", 531);+ _yuitest_coverline("build/exec-command/exec-command.js", 583); this._command(cmd, null); } } else {- _yuitest_coverline("build/exec-command/exec-command.js", 534);+ _yuitest_coverline("build/exec-command/exec-command.js", 586); inst.all(tag).addClass(cls);- _yuitest_coverline("build/exec-command/exec-command.js", 535);+ _yuitest_coverline("build/exec-command/exec-command.js", 587); if (sel.anchorNode.test(inst.EditorSelection.BLOCKS)) {- _yuitest_coverline("build/exec-command/exec-command.js", 536);+ _yuitest_coverline("build/exec-command/exec-command.js", 588); par = sel.anchorNode; } else {- _yuitest_coverline("build/exec-command/exec-command.js", 538);+ _yuitest_coverline("build/exec-command/exec-command.js", 590); par = sel.anchorNode.ancestor(inst.EditorSelection.BLOCKS); }- _yuitest_coverline("build/exec-command/exec-command.js", 540);+ _yuitest_coverline("build/exec-command/exec-command.js", 592); if (!par) { //No parent, find the first block under the anchorNode- _yuitest_coverline("build/exec-command/exec-command.js", 541);+ _yuitest_coverline("build/exec-command/exec-command.js", 593); par = sel.anchorNode.one(inst.EditorSelection.BLOCKS); } - _yuitest_coverline("build/exec-command/exec-command.js", 544);+ _yuitest_coverline("build/exec-command/exec-command.js", 596); if (par && par.hasAttribute(DIR)) {- _yuitest_coverline("build/exec-command/exec-command.js", 545);+ _yuitest_coverline("build/exec-command/exec-command.js", 597); dir = par.getAttribute(DIR); }- _yuitest_coverline("build/exec-command/exec-command.js", 547);+ _yuitest_coverline("build/exec-command/exec-command.js", 599); if (par && par.test(tag)) {- _yuitest_coverline("build/exec-command/exec-command.js", 548);-var hasPParent = par.ancestor('p');- _yuitest_coverline("build/exec-command/exec-command.js", 549);+ _yuitest_coverline("build/exec-command/exec-command.js", 600);+hasPParent = par.ancestor('p');+ _yuitest_coverline("build/exec-command/exec-command.js", 601); html = inst.Node.create('<div/>');- _yuitest_coverline("build/exec-command/exec-command.js", 550);+ _yuitest_coverline("build/exec-command/exec-command.js", 602); elm = par.all('li');- _yuitest_coverline("build/exec-command/exec-command.js", 551);+ _yuitest_coverline("build/exec-command/exec-command.js", 603); elm.each(function(h) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 7)", 551);-_yuitest_coverline("build/exec-command/exec-command.js", 552);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 8)", 603);+_yuitest_coverline("build/exec-command/exec-command.js", 604); html.append(self._wrapContent(h.get('innerHTML'), hasPParent)); });- _yuitest_coverline("build/exec-command/exec-command.js", 554);+ _yuitest_coverline("build/exec-command/exec-command.js", 606); if (dir) {- _yuitest_coverline("build/exec-command/exec-command.js", 555);+ _yuitest_coverline("build/exec-command/exec-command.js", 607); if (useP) {- _yuitest_coverline("build/exec-command/exec-command.js", 556);+ _yuitest_coverline("build/exec-command/exec-command.js", 608); html.all('p').setAttribute(DIR, dir); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 558);+ _yuitest_coverline("build/exec-command/exec-command.js", 610); html.setAttribute(DIR, dir); } }- _yuitest_coverline("build/exec-command/exec-command.js", 561);+ _yuitest_coverline("build/exec-command/exec-command.js", 613); if (useP) {- _yuitest_coverline("build/exec-command/exec-command.js", 562);+ _yuitest_coverline("build/exec-command/exec-command.js", 614); html = inst.Node.create(html.get('innerHTML')); }- _yuitest_coverline("build/exec-command/exec-command.js", 564);-var fc = html.get('firstChild');- _yuitest_coverline("build/exec-command/exec-command.js", 565);+ _yuitest_coverline("build/exec-command/exec-command.js", 616);+fc = html.get('firstChild');+ _yuitest_coverline("build/exec-command/exec-command.js", 617); par.replace(html);- _yuitest_coverline("build/exec-command/exec-command.js", 566);+ _yuitest_coverline("build/exec-command/exec-command.js", 618); sel.selectNode(fc); } else {- _yuitest_coverline("build/exec-command/exec-command.js", 568);+ _yuitest_coverline("build/exec-command/exec-command.js", 620); this._command(cmd, null); }- _yuitest_coverline("build/exec-command/exec-command.js", 570);+ _yuitest_coverline("build/exec-command/exec-command.js", 622); list = inst.all(tag);- _yuitest_coverline("build/exec-command/exec-command.js", 571);+ _yuitest_coverline("build/exec-command/exec-command.js", 623); if (dir) {- _yuitest_coverline("build/exec-command/exec-command.js", 572);+ _yuitest_coverline("build/exec-command/exec-command.js", 624); if (list.size()) { //Changed to a List- _yuitest_coverline("build/exec-command/exec-command.js", 574);+ _yuitest_coverline("build/exec-command/exec-command.js", 626); list.each(function(n) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 8)", 574);-_yuitest_coverline("build/exec-command/exec-command.js", 575);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 9)", 626);+_yuitest_coverline("build/exec-command/exec-command.js", 627); if (!n.hasClass(cls)) {- _yuitest_coverline("build/exec-command/exec-command.js", 576);+ _yuitest_coverline("build/exec-command/exec-command.js", 628); n.setAttribute(DIR, dir); } }); } } - _yuitest_coverline("build/exec-command/exec-command.js", 582);+ _yuitest_coverline("build/exec-command/exec-command.js", 634); list.removeClass(cls); }} },@@ -887,33 +963,32 @@ * @param {String} val The actual command from the justify{center,all,left,right} stubs */ justify: function(cmd, val) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "justify", 592);-_yuitest_coverline("build/exec-command/exec-command.js", 593);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "justify", 644);+_yuitest_coverline("build/exec-command/exec-command.js", 645); if (Y.UA.webkit) {- _yuitest_coverline("build/exec-command/exec-command.js", 594);+ _yuitest_coverline("build/exec-command/exec-command.js", 646); var inst = this.getInstance(), sel = new inst.EditorSelection(),- aNode = sel.anchorNode;+ aNode = sel.anchorNode, html,+ bgColor = aNode.getStyle('backgroundColor'); - _yuitest_coverline("build/exec-command/exec-command.js", 598);-var bgColor = aNode.getStyle('backgroundColor');- _yuitest_coverline("build/exec-command/exec-command.js", 599);+ _yuitest_coverline("build/exec-command/exec-command.js", 651); this._command(val);- _yuitest_coverline("build/exec-command/exec-command.js", 600);+ _yuitest_coverline("build/exec-command/exec-command.js", 652); sel = new inst.EditorSelection();- _yuitest_coverline("build/exec-command/exec-command.js", 601);+ _yuitest_coverline("build/exec-command/exec-command.js", 653); if (sel.anchorNode.test('div')) {- _yuitest_coverline("build/exec-command/exec-command.js", 602);-var html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';- _yuitest_coverline("build/exec-command/exec-command.js", 603);+ _yuitest_coverline("build/exec-command/exec-command.js", 654);+html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';+ _yuitest_coverline("build/exec-command/exec-command.js", 655); sel.anchorNode.set('innerHTML', html);- _yuitest_coverline("build/exec-command/exec-command.js", 604);+ _yuitest_coverline("build/exec-command/exec-command.js", 656); sel.anchorNode.one('span').setStyle('backgroundColor', bgColor);- _yuitest_coverline("build/exec-command/exec-command.js", 605);+ _yuitest_coverline("build/exec-command/exec-command.js", 657); sel.selectNode(sel.anchorNode.one('span')); } } else {- _yuitest_coverline("build/exec-command/exec-command.js", 608);+ _yuitest_coverline("build/exec-command/exec-command.js", 660); this._command(val); } },@@ -922,9 +997,9 @@ * @method COMMANDS.justifycenter * @static */- justifycenter: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "justifycenter", 616);-_yuitest_coverline("build/exec-command/exec-command.js", 617);+ justifycenter: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "justifycenter", 668);+_yuitest_coverline("build/exec-command/exec-command.js", 669); this.command('justify', 'justifycenter'); }, /**@@ -932,9 +1007,9 @@ * @method COMMANDS.justifyleft * @static */- justifyleft: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "justifyleft", 624);-_yuitest_coverline("build/exec-command/exec-command.js", 625);+ justifyleft: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "justifyleft", 676);+_yuitest_coverline("build/exec-command/exec-command.js", 677); this.command('justify', 'justifyleft'); }, /**@@ -942,9 +1017,9 @@ * @method COMMANDS.justifyright * @static */- justifyright: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "justifyright", 632);-_yuitest_coverline("build/exec-command/exec-command.js", 633);+ justifyright: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "justifyright", 684);+_yuitest_coverline("build/exec-command/exec-command.js", 685); this.command('justify', 'justifyright'); }, /**@@ -952,118 +1027,41 @@ * @method COMMANDS.justifyfull * @static */- justifyfull: function(cmd) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "justifyfull", 640);-_yuitest_coverline("build/exec-command/exec-command.js", 641);+ justifyfull: function() {+ _yuitest_coverfunc("build/exec-command/exec-command.js", "justifyfull", 692);+_yuitest_coverline("build/exec-command/exec-command.js", 693); this.command('justify', 'justifyfull'); } } });- - /**- * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.- * @method fixIETags- * @protected- * @param {String} cmd The command to execute- * @param {String} tag The tag to create- * @param {String} rule The rule that we are looking for.- */- _yuitest_coverline("build/exec-command/exec-command.js", 654);-var fixIETags = function(cmd, tag, rule) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "fixIETags", 654);-_yuitest_coverline("build/exec-command/exec-command.js", 655);-var inst = this.getInstance(),- doc = inst.config.doc,- sel = doc.selection.createRange(),- o = doc.queryCommandValue(cmd),- html, reg, m, p, d, s, c; - _yuitest_coverline("build/exec-command/exec-command.js", 661);-if (o) {- _yuitest_coverline("build/exec-command/exec-command.js", 662);-html = sel.htmlText;- _yuitest_coverline("build/exec-command/exec-command.js", 663);-reg = new RegExp(rule, 'g');- _yuitest_coverline("build/exec-command/exec-command.js", 664);-m = html.match(reg);-- _yuitest_coverline("build/exec-command/exec-command.js", 666);-if (m) {- _yuitest_coverline("build/exec-command/exec-command.js", 667);-html = html.replace(rule + ';', '').replace(rule, '');-- _yuitest_coverline("build/exec-command/exec-command.js", 669);-sel.pasteHTML('<var id="yui-ie-bs">');-- _yuitest_coverline("build/exec-command/exec-command.js", 671);-p = doc.getElementById('yui-ie-bs');- _yuitest_coverline("build/exec-command/exec-command.js", 672);-d = doc.createElement('div');- _yuitest_coverline("build/exec-command/exec-command.js", 673);-s = doc.createElement(tag);- - _yuitest_coverline("build/exec-command/exec-command.js", 675);-d.innerHTML = html;- _yuitest_coverline("build/exec-command/exec-command.js", 676);-if (p.parentNode !== inst.config.doc.body) {- _yuitest_coverline("build/exec-command/exec-command.js", 677);-p = p.parentNode;- }-- _yuitest_coverline("build/exec-command/exec-command.js", 680);-c = d.childNodes;-- _yuitest_coverline("build/exec-command/exec-command.js", 682);-p.parentNode.replaceChild(s, p);-- _yuitest_coverline("build/exec-command/exec-command.js", 684);-Y.each(c, function(f) {- _yuitest_coverfunc("build/exec-command/exec-command.js", "(anonymous 9)", 684);-_yuitest_coverline("build/exec-command/exec-command.js", 685);-s.appendChild(f);- });- _yuitest_coverline("build/exec-command/exec-command.js", 687);-sel.collapse();- _yuitest_coverline("build/exec-command/exec-command.js", 688);-if (sel.moveToElementText) {- _yuitest_coverline("build/exec-command/exec-command.js", 689);-sel.moveToElementText(s);- }- _yuitest_coverline("build/exec-command/exec-command.js", 691);-sel.select();- }- }- _yuitest_coverline("build/exec-command/exec-command.js", 694);-this._command(cmd);- };-- _yuitest_coverline("build/exec-command/exec-command.js", 697);+ _yuitest_coverline("build/exec-command/exec-command.js", 698); if (Y.UA.ie) {- _yuitest_coverline("build/exec-command/exec-command.js", 698);+ _yuitest_coverline("build/exec-command/exec-command.js", 699); ExecCommand.COMMANDS.bold = function() {- _yuitest_coverfunc("build/exec-command/exec-command.js", "bold", 698);-_yuitest_coverline("build/exec-command/exec-command.js", 699);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "bold", 699);+_yuitest_coverline("build/exec-command/exec-command.js", 700); fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold'); };- _yuitest_coverline("build/exec-command/exec-command.js", 701);+ _yuitest_coverline("build/exec-command/exec-command.js", 702); ExecCommand.COMMANDS.italic = function() {- _yuitest_coverfunc("build/exec-command/exec-command.js", "italic", 701);-_yuitest_coverline("build/exec-command/exec-command.js", 702);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "italic", 702);+_yuitest_coverline("build/exec-command/exec-command.js", 703); fixIETags.call(this, 'italic', 'i', 'FONT-STYLE: italic'); };- _yuitest_coverline("build/exec-command/exec-command.js", 704);+ _yuitest_coverline("build/exec-command/exec-command.js", 705); ExecCommand.COMMANDS.underline = function() {- _yuitest_coverfunc("build/exec-command/exec-command.js", "underline", 704);-_yuitest_coverline("build/exec-command/exec-command.js", 705);+ _yuitest_coverfunc("build/exec-command/exec-command.js", "underline", 705);+_yuitest_coverline("build/exec-command/exec-command.js", 706); fixIETags.call(this, 'underline', 'u', 'TEXT-DECORATION: underline'); }; } - _yuitest_coverline("build/exec-command/exec-command.js", 709);-Y.namespace('Plugin'); _yuitest_coverline("build/exec-command/exec-command.js", 710);+Y.namespace('Plugin');+ _yuitest_coverline("build/exec-command/exec-command.js", 711); Y.Plugin.ExecCommand = ExecCommand; -}, '3.7.2', {"requires": ["frame"]});+}, '3.7.3', {"requires": ["frame"]});
bundle/exec-command/exec-command-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,6 +17,56 @@ */ var ExecCommand = function() { ExecCommand.superclass.constructor.apply(this, arguments);+ },+ /**+ * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.+ * @method fixIETags+ * @protected+ * @param {String} cmd The command to execute+ * @param {String} tag The tag to create+ * @param {String} rule The rule that we are looking for.+ */+ fixIETags = function(cmd, tag, rule) {+ var inst = this.getInstance(),+ doc = inst.config.doc,+ sel = doc.selection.createRange(),+ o = doc.queryCommandValue(cmd),+ html, reg, m, p, d, s, c;++ if (o) {+ html = sel.htmlText;+ reg = new RegExp(rule, 'g');+ m = html.match(reg);++ if (m) {+ html = html.replace(rule + ';', '').replace(rule, '');++ sel.pasteHTML('<var id="yui-ie-bs">');++ p = doc.getElementById('yui-ie-bs');+ d = doc.createElement('div');+ s = doc.createElement(tag);++ d.innerHTML = html;+ if (p.parentNode !== inst.config.doc.body) {+ p = p.parentNode;+ }++ c = d.childNodes;++ p.parentNode.replaceChild(s, p);++ Y.each(c, function(f) {+ s.appendChild(f);+ });+ sel.collapse();+ if (sel.moveToElementText) {+ sel.moveToElementText(s);+ }+ sel.select();+ }+ }+ this._command(cmd); }; Y.extend(ExecCommand, Y.Base, {@@ -41,7 +91,7 @@ */ command: function(action, value) { var fn = ExecCommand.COMMANDS[action];- + Y.log('execCommand(' + action + '): "' + value + '"', 'info', 'exec-command'); if (fn) { Y.log('OVERIDE execCommand(' + action + '): "' + value + '"', 'info', 'exec-command');@@ -101,7 +151,7 @@ }, _wrapContent: function(str, override) { var useP = (this.getInstance().host.editorPara && !override ? true : false);- + if (useP) { str = '<p>' + str + '</p>'; } else {@@ -187,11 +237,16 @@ * @static * @param {String} cmd The command executed: insertbr */- insertbr: function(cmd) {+ insertbr: function() { var inst = this.getInstance(), sel = new inst.EditorSelection(), html = '<var>|</var>', last = null,- q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var';+ q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var',+ insert = function(n) {+ var c = inst.Node.create('<br>');+ n.insert(c, 'before');+ return c;+ }; if (sel._selection.pasteHTML) { sel._selection.pasteHTML(html);@@ -199,14 +254,9 @@ this._command('inserthtml', html); } - var insert = function(n) {- var c = inst.Node.create('<br>');- n.insert(c, 'before');- return c;- }; inst.all(q).each(function(n) {- var g = true; + var g = true, s; if (Y.UA.webkit) { g = false; if (n.get('innerHTML') === '|') {@@ -216,7 +266,7 @@ if (g) { last = insert(n); if ((!last.previous() || !last.previous().test('br')) && Y.UA.gecko) {- var s = last.cloneNode();+ s = last.cloneNode(); last.insert(s, 'after'); last = s; }@@ -306,7 +356,7 @@ backcolor: function(cmd, val) { var inst = this.getInstance(), sel = new inst.EditorSelection(), n;- + if (Y.UA.gecko || Y.UA.opera) { cmd = 'hilitecolor'; }@@ -319,7 +369,8 @@ sel.anchorNode.setStyle('backgroundColor', val); n = sel.anchorNode; } else {- n = this.command('inserthtml', '<span style="background-color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>');+ n = this.command('inserthtml',+ '<span style="background-color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>'); sel.focusCursor(true, true); } return n;@@ -354,8 +405,8 @@ this._command('fontname', val); var inst = this.getInstance(), sel = new inst.EditorSelection();- - if (sel.isCollapsed && (this._lastKey != 32)) {++ if (sel.isCollapsed && (this._lastKey !== 32)) { if (sel.anchorNode.test('font')) { sel.anchorNode.set('face', val); }@@ -374,9 +425,9 @@ this._command('fontsize', val); var inst = this.getInstance(),- sel = new inst.EditorSelection();- - if (sel.isCollapsed && sel.anchorNode && (this._lastKey != 32)) {+ sel = new inst.EditorSelection(), p;++ if (sel.isCollapsed && sel.anchorNode && (this._lastKey !== 32)) { if (Y.UA.webkit) { if (sel.anchorNode.getStyle('lineHeight')) { sel.anchorNode.setStyle('lineHeight', '');@@ -385,7 +436,7 @@ if (sel.anchorNode.test('font')) { sel.anchorNode.set('size', val); } else if (Y.UA.gecko) {- var p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG);+ p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG); if (p) { p.setStyle('fontSize', ''); }@@ -398,7 +449,7 @@ * @static * @param {String} cmd The command executed: list, ul */- insertunorderedlist: function(cmd) {+ insertunorderedlist: function() { this.command('list', 'ul'); }, /**@@ -407,7 +458,7 @@ * @static * @param {String} cmd The command executed: list, ol */- insertorderedlist: function(cmd) {+ insertorderedlist: function() { this.command('list', 'ol'); }, /**@@ -421,17 +472,18 @@ var inst = this.getInstance(), html, self = this, /* The yui3- class name below is not a skinnable class,- it's a utility class used internally by editor and + it's a utility class used internally by editor and stripped when completed, calling getClassName on this is a waste of resources. */ DIR = 'dir', cls = 'yui3-touched', dir, range, div, elm, n, str, s, par, list, lis,- useP = (inst.host.editorPara ? true : false),+ useP = (inst.host.editorPara ? true : false), tmp,+ sdir, hasPParent, fc, sel = new inst.EditorSelection(); cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';- + if (Y.UA.ie && !sel.isCollapsed) { range = sel._selection; html = range.htmlText;@@ -484,7 +536,7 @@ if (html.indexOf('<br>') > -1) { html = html.split(/<br>/i); } else {- var tmp = inst.Node.create(html),+ tmp = inst.Node.create(html), ps = tmp ? tmp.all('p') : null; if (ps && ps.size()) {@@ -527,7 +579,7 @@ } html = Y.EditorSelection.getText(par); if (html === '') {- var sdir = '';+ sdir = ''; if (dir) { sdir = ' dir="' + dir + '"'; }@@ -555,7 +607,7 @@ dir = par.getAttribute(DIR); } if (par && par.test(tag)) {- var hasPParent = par.ancestor('p');+ hasPParent = par.ancestor('p'); html = inst.Node.create('<div/>'); elm = par.all('li'); elm.each(function(h) {@@ -571,7 +623,7 @@ if (useP) { html = inst.Node.create(html.get('innerHTML')); }- var fc = html.get('firstChild');+ fc = html.get('firstChild'); par.replace(html); sel.selectNode(fc); } else {@@ -603,13 +655,13 @@ if (Y.UA.webkit) { var inst = this.getInstance(), sel = new inst.EditorSelection(),- aNode = sel.anchorNode;+ aNode = sel.anchorNode, html,+ bgColor = aNode.getStyle('backgroundColor'); - var bgColor = aNode.getStyle('backgroundColor'); this._command(val); sel = new inst.EditorSelection(); if (sel.anchorNode.test('div')) {- var html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';+ html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>'; sel.anchorNode.set('innerHTML', html); sel.anchorNode.one('span').setStyle('backgroundColor', bgColor); sel.selectNode(sel.anchorNode.one('span'));@@ -623,7 +675,7 @@ * @method COMMANDS.justifycenter * @static */- justifycenter: function(cmd) {+ justifycenter: function() { this.command('justify', 'justifycenter'); }, /**@@ -631,7 +683,7 @@ * @method COMMANDS.justifyleft * @static */- justifyleft: function(cmd) {+ justifyleft: function() { this.command('justify', 'justifyleft'); }, /**@@ -639,7 +691,7 @@ * @method COMMANDS.justifyright * @static */- justifyright: function(cmd) {+ justifyright: function() { this.command('justify', 'justifyright'); }, /**@@ -647,63 +699,12 @@ * @method COMMANDS.justifyfull * @static */- justifyfull: function(cmd) {+ justifyfull: function() { this.command('justify', 'justifyfull'); } } });- - /**- * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.- * @method fixIETags- * @protected- * @param {String} cmd The command to execute- * @param {String} tag The tag to create- * @param {String} rule The rule that we are looking for.- */- var fixIETags = function(cmd, tag, rule) {- var inst = this.getInstance(),- doc = inst.config.doc,- sel = doc.selection.createRange(),- o = doc.queryCommandValue(cmd),- html, reg, m, p, d, s, c; - if (o) {- html = sel.htmlText;- reg = new RegExp(rule, 'g');- m = html.match(reg);-- if (m) {- html = html.replace(rule + ';', '').replace(rule, '');-- sel.pasteHTML('<var id="yui-ie-bs">');-- p = doc.getElementById('yui-ie-bs');- d = doc.createElement('div');- s = doc.createElement(tag);- - d.innerHTML = html;- if (p.parentNode !== inst.config.doc.body) {- p = p.parentNode;- }-- c = d.childNodes;-- p.parentNode.replaceChild(s, p);-- Y.each(c, function(f) {- s.appendChild(f);- });- sel.collapse();- if (sel.moveToElementText) {- sel.moveToElementText(s);- }- sel.select();- }- }- this._command(cmd);- };- if (Y.UA.ie) { ExecCommand.COMMANDS.bold = function() { fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold');@@ -721,4 +722,4 @@ -}, '3.7.2', {"requires": ["frame"]});+}, '3.7.3', {"requires": ["frame"]});
bundle/exec-command/exec-command-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("exec-command",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{_lastKey:null,_inst:null,command:function(e,t){var r=n.COMMANDS[e];return r?r.call(this,e,t):this._command(e,t)},_command:function(e,t){var n=this.getInstance();try{try{n.config.doc.execCommand("styleWithCSS",null,1)}catch(r){try{n.config.doc.execCommand("useCSS",null,0)}catch(i){}}n.config.doc.execCommand(e,null,t)}catch(s){}},getInstance:function(){return this._inst||(this._inst=this.get("host").getInstance()),this._inst},initializer:function(){e.mix(this.get("host"),{execCommand:function(e,t){return this.exec.command(e,t)},_execCommand:function(e,t){return this.exec._command(e,t)}}),this.get("host").on("dom:keypress",e.bind(function(e){this._lastKey=e.keyCode},this))},_wrapContent:function(e,t){var n=this.getInstance().host.editorPara&&!t?!0:!1;return n?e="<p>"+e+"</p>":e+="<br>",e}},{NAME:"execCommand",NS:"exec",ATTRS:{host:{value:!1}},COMMANDS:{wrap:function(e,t){var n=this.getInstance();return(new n.EditorSelection).wrapContent(t)},inserthtml:function(t,n){var r=this.getInstance();if(r.EditorSelection.hasCursor()||e.UA.ie)return(new r.EditorSelection).insertContent(n);this._command("inserthtml",n)},insertandfocus:function(e,t){var n=this.getInstance(),r,i;return n.EditorSelection.hasCursor()?(t+=n.EditorSelection.CURSOR,r=this.command("inserthtml",t),i=new n.EditorSelection,i.focusCursor(!0,!0)):this.command("inserthtml",t),r},insertbr:function(t){var n=this.getInstance(),r=new n.EditorSelection,i="<var>|</var>",s=null,o=e.UA.webkit?"span.Apple-style-span,var":"var";r._selection.pasteHTML?r._selection.pasteHTML(i):this._command("inserthtml",i);var u=function(e){var t=n.Node.create("<br>");return e.insert(t,"before"),t};n.all(o).each(function(t){var n=!0;e.UA.webkit&&(n=!1,t.get("innerHTML")==="|"&&(n=!0));if(n){s=u(t);if((!s.previous()||!s.previous().test("br"))&&e.UA.gecko){var r=s.cloneNode();s.insert(r,"after"),s=r}t.remove()}}),e.UA.webkit&&s&&(u(s),r.selectNode(s))},insertimage:function(e,t){return this.command("inserthtml",'<img src="'+t+'">')},addclass:function(e,t){var n=this.getInstance();return(new n.EditorSelection).getSelected().addClass(t)},removeclass:function(e,t){var n=this.getInstance();return(new n.EditorSelection).getSelected().removeClass(t)},forecolor:function(t,n){var r=this.getInstance(),i=new r.EditorSelection,s;e.UA.ie||this._command("useCSS",!1);if(r.EditorSelection.hasCursor())return i.isCollapsed?(i.anchorNode&&i.anchorNode.get("innerHTML")===" "?(i.anchorNode.setStyle("color",n),s=i.anchorNode):(s=this.command("inserthtml",'<span style="color: '+n+'">'+r.EditorSelection.CURSOR+"</span>"),i.focusCursor(!0,!0)),s):this._command(t,n);this._command(t,n)},backcolor:function(t,n){var r=this.getInstance(),i=new r.EditorSelection,s;if(e.UA.gecko||e.UA.opera)t="hilitecolor";e.UA.ie||this._command("useCSS",!1);if(r.EditorSelection.hasCursor())return i.isCollapsed?(i.anchorNode&&i.anchorNode.get("innerHTML")===" "?(i.anchorNode.setStyle("backgroundColor",n),s=i.anchorNode):(s=this.command("inserthtml",'<span style="background-color: '+n+'">'+r.EditorSelection.CURSOR+"</span>"),i.focusCursor(!0,!0)),s):this._command(t,n);this._command(t,n)},hilitecolor:function(){return n.COMMANDS.backcolor.apply(this,arguments)},fontname2:function(e,t){this._command("fontname",t);var n=this.getInstance(),r=new n.EditorSelection;r.isCollapsed&&this._lastKey!=32&&r.anchorNode.test("font")&&r.anchorNode.set("face",t)},fontsize2:function(t,n){this._command("fontsize",n);var r=this.getInstance(),i=new r.EditorSelection;if(i.isCollapsed&&i.anchorNode&&this._lastKey!=32){e.UA.webkit&&i.anchorNode.getStyle("lineHeight")&&i.anchorNode.setStyle("lineHeight","");if(i.anchorNode.test("font"))i.anchorNode.set("size",n);else if(e.UA.gecko){var s=i.anchorNode.ancestor(r.EditorSelection.DEFAULT_BLOCK_TAG);s&&s.setStyle("fontSize","")}}},insertunorderedlist:function(e){this.command("list","ul")},insertorderedlist:function(e){this.command("list","ol")},list:function(t,n){var r=this.getInstance(),i,s=this,o="dir",u="yui3-touched",a,f,l,c,h,p,d,v,m,g,y=r.host.editorPara?!0:!1,b=new r.EditorSelection;t="insert"+(n==="ul"?"un":"")+"orderedlist";if(e.UA.ie&&!b.isCollapsed){f=b._selection,i=f.htmlText,l=r.Node.create(i)||r.one("body");if(l.test("li")||l.one("li")){this._command(t,null);return}if(l.test(n))c=f.item?f.item(0):f.parentElement(),h=r.one(c),g=h.all("li"),p="<div>",g.each(function(e){p=s._wrapContent(e.get("innerHTML"))}),p+="</div>",d=r.Node.create(p),h.get("parentNode").test("div")&&(h=h.get("parentNode")),h&&h.hasAttribute(o)&&(y?d.all("p").setAttribute(o,h.getAttribute(o)):d.setAttribute(o,h.getAttribute(o))),y?h.replace(d.get("innerHTML")):h.replace(d),f.moveToElementText&&f.moveToElementText(d._node),f.select();else{v=e.one(f.parentElement()),v.test(r.EditorSelection.BLOCKS)||(v=v.ancestor(r.EditorSelection.BLOCKS)),v&&v.hasAttribute(o)&&(a=v.getAttribute(o));if(i.indexOf("<br>")>-1)i=i.split(/<br>/i);else{var w=r.Node.create(i),E=w?w.all("p"):null;E&&E.size()?(i=[],E.each(function(e){i.push(e.get("innerHTML"))})):i=[i]}m="<"+n+' id="ie-list">',e.each(i,function(e){var t=r.Node.create(e);t&&t.test("p")&&(t.hasAttribute(o)&&(a=t.getAttribute(o)),e=t.get("innerHTML")),m+="<li>"+e+"</li>"}),m+="</"+n+">",f.pasteHTML(m),c=r.config.doc.getElementById("ie-list"),c.id="",a&&c.setAttribute(o,a),f.moveToElementText&&f.moveToElementText(c),f.select()}}else if(e.UA.ie){v=r.one(b._selection.parentElement());if(v.test("p")){v&&v.hasAttribute(o)&&(a=v.getAttribute(o)),i=e.EditorSelection.getText(v);if(i===""){var S="";a&&(S=' dir="'+a+'"'),m=r.Node.create(e.Lang.sub("<{tag}{dir}><li></li></{tag}>",{tag:n,dir:S})),v.replace(m),b.selectNode(m.one("li"))}else this._command(t,null)}else this._command(t,null)}else{r.all(n).addClass(u),b.anchorNode.test(r.EditorSelection.BLOCKS)?v=b.anchorNode:v=b.anchorNode.ancestor(r.EditorSelection.BLOCKS),v||(v=b.anchorNode.one(r.EditorSelection.BLOCKS)),v&&v.hasAttribute(o)&&(a=v.getAttribute(o));if(v&&v.test(n)){var x=v.ancestor("p");i=r.Node.create("<div/>"),c=v.all("li"),c.each(function(e){i.append(s._wrapContent(e.get("innerHTML"),x))}),a&&(y?i.all("p").setAttribute(o,a):i.setAttribute(o,a)),y&&(i=r.Node.create(i.get("innerHTML")));var T=i.get("firstChild");v.replace(i),b.selectNode(T)}else this._command(t,null);m=r.all(n),a&&m.size()&&m.each(function(e){e.hasClass(u)||e.setAttribute(o,a)}),m.removeClass(u)}},justify:function(t,n){if(e.UA.webkit){var r=this.getInstance(),i=new r.EditorSelection,s=i.anchorNode,o=s.getStyle("backgroundColor");this._command(n),i=new r.EditorSelection;if(i.anchorNode.test("div")){var u="<span>"+i.anchorNode.get("innerHTML")+"</span>";i.anchorNode.set("innerHTML",u),i.anchorNode.one("span").setStyle("backgroundColor",o),i.selectNode(i.anchorNode.one("span"))}}else this._command(n)},justifycenter:function(e){this.command("justify","justifycenter")},justifyleft:function(e){this.command("justify","justifyleft")},justifyright:function(e){this.command("justify","justifyright")},justifyfull:function(e){this.command("justify","justifyfull")}}});var r=function(t,n,r){var i=this.getInstance(),s=i.config.doc,o=s.selection.createRange(),u=s.queryCommandValue(t),a,f,l,c,h,p,d;u&&(a=o.htmlText,f=new RegExp(r,"g"),l=a.match(f),l&&(a=a.replace(r+";","").replace(r,""),o.pasteHTML('<var id="yui-ie-bs">'),c=s.getElementById("yui-ie-bs"),h=s.createElement("div"),p=s.createElement(n),h.innerHTML=a,c.parentNode!==i.config.doc.body&&(c=c.parentNode),d=h.childNodes,c.parentNode.replaceChild(p,c),e.each(d,function(e){p.appendChild(e)}),o.collapse(),o.moveToElementText&&o.moveToElementText(p),o.select())),this._command(t)};e.UA.ie&&(n.COMMANDS.bold=function(){r.call(this,"bold","b","FONT-WEIGHT: bold")},n.COMMANDS.italic=function(){r.call(this,"italic","i","FONT-STYLE: italic")},n.COMMANDS.underline=function(){r.call(this,"underline","u","TEXT-DECORATION: underline")}),e.namespace("Plugin"),e.Plugin.ExecCommand=n},"3.7.2",{requires:["frame"]});+YUI.add("exec-command",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r=function(t,n,r){var i=this.getInstance(),s=i.config.doc,o=s.selection.createRange(),u=s.queryCommandValue(t),a,f,l,c,h,p,d;u&&(a=o.htmlText,f=new RegExp(r,"g"),l=a.match(f),l&&(a=a.replace(r+";","").replace(r,""),o.pasteHTML('<var id="yui-ie-bs">'),c=s.getElementById("yui-ie-bs"),h=s.createElement("div"),p=s.createElement(n),h.innerHTML=a,c.parentNode!==i.config.doc.body&&(c=c.parentNode),d=h.childNodes,c.parentNode.replaceChild(p,c),e.each(d,function(e){p.appendChild(e)}),o.collapse(),o.moveToElementText&&o.moveToElementText(p),o.select())),this._command(t)};e.extend(n,e.Base,{_lastKey:null,_inst:null,command:function(e,t){var r=n.COMMANDS[e];return r?r.call(this,e,t):this._command(e,t)},_command:function(e,t){var n=this.getInstance();try{try{n.config.doc.execCommand("styleWithCSS",null,1)}catch(r){try{n.config.doc.execCommand("useCSS",null,0)}catch(i){}}n.config.doc.execCommand(e,null,t)}catch(s){}},getInstance:function(){return this._inst||(this._inst=this.get("host").getInstance()),this._inst},initializer:function(){e.mix(this.get("host"),{execCommand:function(e,t){return this.exec.command(e,t)},_execCommand:function(e,t){return this.exec._command(e,t)}}),this.get("host").on("dom:keypress",e.bind(function(e){this._lastKey=e.keyCode},this))},_wrapContent:function(e,t){var n=this.getInstance().host.editorPara&&!t?!0:!1;return n?e="<p>"+e+"</p>":e+="<br>",e}},{NAME:"execCommand",NS:"exec",ATTRS:{host:{value:!1}},COMMANDS:{wrap:function(e,t){var n=this.getInstance();return(new n.EditorSelection).wrapContent(t)},inserthtml:function(t,n){var r=this.getInstance();if(r.EditorSelection.hasCursor()||e.UA.ie)return(new r.EditorSelection).insertContent(n);this._command("inserthtml",n)},insertandfocus:function(e,t){var n=this.getInstance(),r,i;return n.EditorSelection.hasCursor()?(t+=n.EditorSelection.CURSOR,r=this.command("inserthtml",t),i=new n.EditorSelection,i.focusCursor(!0,!0)):this.command("inserthtml",t),r},insertbr:function(){var t=this.getInstance(),n=new t.EditorSelection,r="<var>|</var>",i=null,s=e.UA.webkit?"span.Apple-style-span,var":"var",o=function(e){var n=t.Node.create("<br>");return e.insert(n,"before"),n};n._selection.pasteHTML?n._selection.pasteHTML(r):this._command("inserthtml",r),t.all(s).each(function(t){var n=!0,r;e.UA.webkit&&(n=!1,t.get("innerHTML")==="|"&&(n=!0)),n&&(i=o(t),(!i.previous()||!i.previous().test("br"))&&e.UA.gecko&&(r=i.cloneNode(),i.insert(r,"after"),i=r),t.remove())}),e.UA.webkit&&i&&(o(i),n.selectNode(i))},insertimage:function(e,t){return this.command("inserthtml",'<img src="'+t+'">')},addclass:function(e,t){var n=this.getInstance();return(new n.EditorSelection).getSelected().addClass(t)},removeclass:function(e,t){var n=this.getInstance();return(new n.EditorSelection).getSelected().removeClass(t)},forecolor:function(t,n){var r=this.getInstance(),i=new r.EditorSelection,s;e.UA.ie||this._command("useCSS",!1);if(r.EditorSelection.hasCursor())return i.isCollapsed?(i.anchorNode&&i.anchorNode.get("innerHTML")===" "?(i.anchorNode.setStyle("color",n),s=i.anchorNode):(s=this.command("inserthtml",'<span style="color: '+n+'">'+r.EditorSelection.CURSOR+"</span>"),i.focusCursor(!0,!0)),s):this._command(t,n);this._command(t,n)},backcolor:function(t,n){var r=this.getInstance(),i=new r.EditorSelection,s;if(e.UA.gecko||e.UA.opera)t="hilitecolor";e.UA.ie||this._command("useCSS",!1);if(r.EditorSelection.hasCursor())return i.isCollapsed?(i.anchorNode&&i.anchorNode.get("innerHTML")===" "?(i.anchorNode.setStyle("backgroundColor",n),s=i.anchorNode):(s=this.command("inserthtml",'<span style="background-color: '+n+'">'+r.EditorSelection.CURSOR+"</span>"),i.focusCursor(!0,!0)),s):this._command(t,n);this._command(t,n)},hilitecolor:function(){return n.COMMANDS.backcolor.apply(this,arguments)},fontname2:function(e,t){this._command("fontname",t);var n=this.getInstance(),r=new n.EditorSelection;r.isCollapsed&&this._lastKey!==32&&r.anchorNode.test("font")&&r.anchorNode.set("face",t)},fontsize2:function(t,n){this._command("fontsize",n);var r=this.getInstance(),i=new r.EditorSelection,s;i.isCollapsed&&i.anchorNode&&this._lastKey!==32&&(e.UA.webkit&&i.anchorNode.getStyle("lineHeight")&&i.anchorNode.setStyle("lineHeight",""),i.anchorNode.test("font")?i.anchorNode.set("size",n):e.UA.gecko&&(s=i.anchorNode.ancestor(r.EditorSelection.DEFAULT_BLOCK_TAG),s&&s.setStyle("fontSize","")))},insertunorderedlist:function(){this.command("list","ul")},insertorderedlist:function(){this.command("list","ol")},list:function(t,n){var r=this.getInstance(),i,s=this,o="dir",u="yui3-touched",a,f,l,c,h,p,d,v,m,g,y=r.host.editorPara?!0:!1,b,w,E,S,x=new r.EditorSelection;t="insert"+(n==="ul"?"un":"")+"orderedlist";if(e.UA.ie&&!x.isCollapsed){f=x._selection,i=f.htmlText,l=r.Node.create(i)||r.one("body");if(l.test("li")||l.one("li")){this._command(t,null);return}l.test(n)?(c=f.item?f.item(0):f.parentElement(),h=r.one(c),g=h.all("li"),p="<div>",g.each(function(e){p=s._wrapContent(e.get("innerHTML"))}),p+="</div>",d=r.Node.create(p),h.get("parentNode").test("div")&&(h=h.get("parentNode")),h&&h.hasAttribute(o)&&(y?d.all("p").setAttribute(o,h.getAttribute(o)):d.setAttribute(o,h.getAttribute(o))),y?h.replace(d.get("innerHTML")):h.replace(d),f.moveToElementText&&f.moveToElementText(d._node),f.select()):(v=e.one(f.parentElement()),v.test(r.EditorSelection.BLOCKS)||(v=v.ancestor(r.EditorSelection.BLOCKS)),v&&v.hasAttribute(o)&&(a=v.getAttribute(o)),i.indexOf("<br>")>-1?i=i.split(/<br>/i):(b=r.Node.create(i),ps=b?b.all("p"):null,ps&&ps.size()?(i=[],ps.each(function(e){i.push(e.get("innerHTML"))})):i=[i]),m="<"+n+' id="ie-list">',e.each(i,function(e){var t=r.Node.create(e);t&&t.test("p")&&(t.hasAttribute(o)&&(a=t.getAttribute(o)),e=t.get("innerHTML")),m+="<li>"+e+"</li>"}),m+="</"+n+">",f.pasteHTML(m),c=r.config.doc.getElementById("ie-list"),c.id="",a&&c.setAttribute(o,a),f.moveToElementText&&f.moveToElementText(c),f.select())}else e.UA.ie?(v=r.one(x._selection.parentElement()),v.test("p")?(v&&v.hasAttribute(o)&&(a=v.getAttribute(o)),i=e.EditorSelection.getText(v),i===""?(w="",a&&(w=' dir="'+a+'"'),m=r.Node.create(e.Lang.sub("<{tag}{dir}><li></li></{tag}>",{tag:n,dir:w})),v.replace(m),x.selectNode(m.one("li"))):this._command(t,null)):this._command(t,null)):(r.all(n).addClass(u),x.anchorNode.test(r.EditorSelection.BLOCKS)?v=x.anchorNode:v=x.anchorNode.ancestor(r.EditorSelection.BLOCKS),v||(v=x.anchorNode.one(r.EditorSelection.BLOCKS)),v&&v.hasAttribute(o)&&(a=v.getAttribute(o)),v&&v.test(n)?(E=v.ancestor("p"),i=r.Node.create("<div/>"),c=v.all("li"),c.each(function(e){i.append(s._wrapContent(e.get("innerHTML"),E))}),a&&(y?i.all("p").setAttribute(o,a):i.setAttribute(o,a)),y&&(i=r.Node.create(i.get("innerHTML"))),S=i.get("firstChild"),v.replace(i),x.selectNode(S)):this._command(t,null),m=r.all(n),a&&m.size()&&m.each(function(e){e.hasClass(u)||e.setAttribute(o,a)}),m.removeClass(u))},justify:function(t,n){if(e.UA.webkit){var r=this.getInstance(),i=new r.EditorSelection,s=i.anchorNode,o,u=s.getStyle("backgroundColor");this._command(n),i=new r.EditorSelection,i.anchorNode.test("div")&&(o="<span>"+i.anchorNode.get("innerHTML")+"</span>",i.anchorNode.set("innerHTML",o),i.anchorNode.one("span").setStyle("backgroundColor",u),i.selectNode(i.anchorNode.one("span")))}else this._command(n)},justifycenter:function(){this.command("justify","justifycenter")},justifyleft:function(){this.command("justify","justifyleft")},justifyright:function(){this.command("justify","justifyright")},justifyfull:function(){this.command("justify","justifyfull")}}}),e.UA.ie&&(n.COMMANDS.bold=function(){r.call(this,"bold","b","FONT-WEIGHT: bold")},n.COMMANDS.italic=function(){r.call(this,"italic","i","FONT-STYLE: italic")},n.COMMANDS.underline=function(){r.call(this,"underline","u","TEXT-DECORATION: underline")}),e.namespace("Plugin"),e.Plugin.ExecCommand=n},"3.7.3",{requires:["frame"]});
bundle/exec-command/exec-command.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,6 +17,56 @@ */ var ExecCommand = function() { ExecCommand.superclass.constructor.apply(this, arguments);+ },+ /**+ * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.+ * @method fixIETags+ * @protected+ * @param {String} cmd The command to execute+ * @param {String} tag The tag to create+ * @param {String} rule The rule that we are looking for.+ */+ fixIETags = function(cmd, tag, rule) {+ var inst = this.getInstance(),+ doc = inst.config.doc,+ sel = doc.selection.createRange(),+ o = doc.queryCommandValue(cmd),+ html, reg, m, p, d, s, c;++ if (o) {+ html = sel.htmlText;+ reg = new RegExp(rule, 'g');+ m = html.match(reg);++ if (m) {+ html = html.replace(rule + ';', '').replace(rule, '');++ sel.pasteHTML('<var id="yui-ie-bs">');++ p = doc.getElementById('yui-ie-bs');+ d = doc.createElement('div');+ s = doc.createElement(tag);++ d.innerHTML = html;+ if (p.parentNode !== inst.config.doc.body) {+ p = p.parentNode;+ }++ c = d.childNodes;++ p.parentNode.replaceChild(s, p);++ Y.each(c, function(f) {+ s.appendChild(f);+ });+ sel.collapse();+ if (sel.moveToElementText) {+ sel.moveToElementText(s);+ }+ sel.select();+ }+ }+ this._command(cmd); }; Y.extend(ExecCommand, Y.Base, {@@ -41,7 +91,7 @@ */ command: function(action, value) { var fn = ExecCommand.COMMANDS[action];- + if (fn) { return fn.call(this, action, value); } else {@@ -97,7 +147,7 @@ }, _wrapContent: function(str, override) { var useP = (this.getInstance().host.editorPara && !override ? true : false);- + if (useP) { str = '<p>' + str + '</p>'; } else {@@ -183,11 +233,16 @@ * @static * @param {String} cmd The command executed: insertbr */- insertbr: function(cmd) {+ insertbr: function() { var inst = this.getInstance(), sel = new inst.EditorSelection(), html = '<var>|</var>', last = null,- q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var';+ q = (Y.UA.webkit) ? 'span.Apple-style-span,var' : 'var',+ insert = function(n) {+ var c = inst.Node.create('<br>');+ n.insert(c, 'before');+ return c;+ }; if (sel._selection.pasteHTML) { sel._selection.pasteHTML(html);@@ -195,14 +250,9 @@ this._command('inserthtml', html); } - var insert = function(n) {- var c = inst.Node.create('<br>');- n.insert(c, 'before');- return c;- }; inst.all(q).each(function(n) {- var g = true; + var g = true, s; if (Y.UA.webkit) { g = false; if (n.get('innerHTML') === '|') {@@ -212,7 +262,7 @@ if (g) { last = insert(n); if ((!last.previous() || !last.previous().test('br')) && Y.UA.gecko) {- var s = last.cloneNode();+ s = last.cloneNode(); last.insert(s, 'after'); last = s; }@@ -302,7 +352,7 @@ backcolor: function(cmd, val) { var inst = this.getInstance(), sel = new inst.EditorSelection(), n;- + if (Y.UA.gecko || Y.UA.opera) { cmd = 'hilitecolor'; }@@ -315,7 +365,8 @@ sel.anchorNode.setStyle('backgroundColor', val); n = sel.anchorNode; } else {- n = this.command('inserthtml', '<span style="background-color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>');+ n = this.command('inserthtml',+ '<span style="background-color: ' + val + '">' + inst.EditorSelection.CURSOR + '</span>'); sel.focusCursor(true, true); } return n;@@ -350,8 +401,8 @@ this._command('fontname', val); var inst = this.getInstance(), sel = new inst.EditorSelection();- - if (sel.isCollapsed && (this._lastKey != 32)) {++ if (sel.isCollapsed && (this._lastKey !== 32)) { if (sel.anchorNode.test('font')) { sel.anchorNode.set('face', val); }@@ -370,9 +421,9 @@ this._command('fontsize', val); var inst = this.getInstance(),- sel = new inst.EditorSelection();- - if (sel.isCollapsed && sel.anchorNode && (this._lastKey != 32)) {+ sel = new inst.EditorSelection(), p;++ if (sel.isCollapsed && sel.anchorNode && (this._lastKey !== 32)) { if (Y.UA.webkit) { if (sel.anchorNode.getStyle('lineHeight')) { sel.anchorNode.setStyle('lineHeight', '');@@ -381,7 +432,7 @@ if (sel.anchorNode.test('font')) { sel.anchorNode.set('size', val); } else if (Y.UA.gecko) {- var p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG);+ p = sel.anchorNode.ancestor(inst.EditorSelection.DEFAULT_BLOCK_TAG); if (p) { p.setStyle('fontSize', ''); }@@ -394,7 +445,7 @@ * @static * @param {String} cmd The command executed: list, ul */- insertunorderedlist: function(cmd) {+ insertunorderedlist: function() { this.command('list', 'ul'); }, /**@@ -403,7 +454,7 @@ * @static * @param {String} cmd The command executed: list, ol */- insertorderedlist: function(cmd) {+ insertorderedlist: function() { this.command('list', 'ol'); }, /**@@ -417,17 +468,18 @@ var inst = this.getInstance(), html, self = this, /* The yui3- class name below is not a skinnable class,- it's a utility class used internally by editor and + it's a utility class used internally by editor and stripped when completed, calling getClassName on this is a waste of resources. */ DIR = 'dir', cls = 'yui3-touched', dir, range, div, elm, n, str, s, par, list, lis,- useP = (inst.host.editorPara ? true : false),+ useP = (inst.host.editorPara ? true : false), tmp,+ sdir, hasPParent, fc, sel = new inst.EditorSelection(); cmd = 'insert' + ((tag === 'ul') ? 'un' : '') + 'orderedlist';- + if (Y.UA.ie && !sel.isCollapsed) { range = sel._selection; html = range.htmlText;@@ -480,7 +532,7 @@ if (html.indexOf('<br>') > -1) { html = html.split(/<br>/i); } else {- var tmp = inst.Node.create(html),+ tmp = inst.Node.create(html), ps = tmp ? tmp.all('p') : null; if (ps && ps.size()) {@@ -523,7 +575,7 @@ } html = Y.EditorSelection.getText(par); if (html === '') {- var sdir = '';+ sdir = ''; if (dir) { sdir = ' dir="' + dir + '"'; }@@ -551,7 +603,7 @@ dir = par.getAttribute(DIR); } if (par && par.test(tag)) {- var hasPParent = par.ancestor('p');+ hasPParent = par.ancestor('p'); html = inst.Node.create('<div/>'); elm = par.all('li'); elm.each(function(h) {@@ -567,7 +619,7 @@ if (useP) { html = inst.Node.create(html.get('innerHTML')); }- var fc = html.get('firstChild');+ fc = html.get('firstChild'); par.replace(html); sel.selectNode(fc); } else {@@ -599,13 +651,13 @@ if (Y.UA.webkit) { var inst = this.getInstance(), sel = new inst.EditorSelection(),- aNode = sel.anchorNode;+ aNode = sel.anchorNode, html,+ bgColor = aNode.getStyle('backgroundColor'); - var bgColor = aNode.getStyle('backgroundColor'); this._command(val); sel = new inst.EditorSelection(); if (sel.anchorNode.test('div')) {- var html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>';+ html = '<span>' + sel.anchorNode.get('innerHTML') + '</span>'; sel.anchorNode.set('innerHTML', html); sel.anchorNode.one('span').setStyle('backgroundColor', bgColor); sel.selectNode(sel.anchorNode.one('span'));@@ -619,7 +671,7 @@ * @method COMMANDS.justifycenter * @static */- justifycenter: function(cmd) {+ justifycenter: function() { this.command('justify', 'justifycenter'); }, /**@@ -627,7 +679,7 @@ * @method COMMANDS.justifyleft * @static */- justifyleft: function(cmd) {+ justifyleft: function() { this.command('justify', 'justifyleft'); }, /**@@ -635,7 +687,7 @@ * @method COMMANDS.justifyright * @static */- justifyright: function(cmd) {+ justifyright: function() { this.command('justify', 'justifyright'); }, /**@@ -643,63 +695,12 @@ * @method COMMANDS.justifyfull * @static */- justifyfull: function(cmd) {+ justifyfull: function() { this.command('justify', 'justifyfull'); } } });- - /**- * This method is meant to normalize IE's in ability to exec the proper command on elements with CSS styling.- * @method fixIETags- * @protected- * @param {String} cmd The command to execute- * @param {String} tag The tag to create- * @param {String} rule The rule that we are looking for.- */- var fixIETags = function(cmd, tag, rule) {- var inst = this.getInstance(),- doc = inst.config.doc,- sel = doc.selection.createRange(),- o = doc.queryCommandValue(cmd),- html, reg, m, p, d, s, c; - if (o) {- html = sel.htmlText;- reg = new RegExp(rule, 'g');- m = html.match(reg);-- if (m) {- html = html.replace(rule + ';', '').replace(rule, '');-- sel.pasteHTML('<var id="yui-ie-bs">');-- p = doc.getElementById('yui-ie-bs');- d = doc.createElement('div');- s = doc.createElement(tag);- - d.innerHTML = html;- if (p.parentNode !== inst.config.doc.body) {- p = p.parentNode;- }-- c = d.childNodes;-- p.parentNode.replaceChild(s, p);-- Y.each(c, function(f) {- s.appendChild(f);- });- sel.collapse();- if (sel.moveToElementText) {- sel.moveToElementText(s);- }- sel.select();- }- }- this._command(cmd);- };- if (Y.UA.ie) { ExecCommand.COMMANDS.bold = function() { fixIETags.call(this, 'bold', 'b', 'FONT-WEIGHT: bold');@@ -717,4 +718,4 @@ -}, '3.7.2', {"requires": ["frame"]});+}, '3.7.3', {"requires": ["frame"]});
bundle/features/features-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/features/features.js", code: [] };-_yuitest_coverage["build/features/features.js"].code=["YUI.add('features', function (Y, NAME) {","","var feature_tests = {};","","/**","Contains the core of YUI's feature test architecture.","@module features","*/","","/**","* Feature detection","* @class Features","* @static","*/","","Y.mix(Y.namespace('Features'), {"," "," /**"," * Object hash of all registered feature tests"," * @property tests"," * @type Object"," */"," tests: feature_tests,"," "," /**"," * Add a test to the system"," * "," * ```"," * Y.Features.add(\"load\", \"1\", {});"," * ```"," * "," * @method add"," * @param {String} cat The category, right now only 'load' is supported"," * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3"," * @param {Object} o Object containing test properties"," * @param {String} o.name The name of the test"," * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance"," * @param {String} o.trigger The module that triggers this test."," */"," add: function(cat, name, o) {"," feature_tests[cat] = feature_tests[cat] || {};"," feature_tests[cat][name] = o;"," },"," /**"," * Execute all tests of a given category and return the serialized results"," *"," * ```"," * caps=1:1;2:1;3:0"," * ```"," * @method all"," * @param {String} cat The category to execute"," * @param {Array} args The arguments to pass to the test function"," * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0"," */"," all: function(cat, args) {"," var cat_o = feature_tests[cat],"," // results = {};"," result = [];"," if (cat_o) {"," Y.Object.each(cat_o, function(v, k) {"," result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));"," });"," }",""," return (result.length) ? result.join(';') : '';"," },"," /**"," * Run a sepecific test and return a Boolean response."," *"," * ```"," * Y.Features.test(\"load\", \"1\");"," * ```"," *"," * @method test"," * @param {String} cat The category of the test to run"," * @param {String} name The name of the test to run"," * @param {Array} args The arguments to pass to the test function"," * @return {Boolean} True or false if the test passed/failed."," */"," test: function(cat, name, args) {"," args = args || [];"," var result, ua, test,"," cat_o = feature_tests[cat],"," feature = cat_o && cat_o[name];",""," if (!feature) {"," } else {",""," result = feature.result;",""," if (Y.Lang.isUndefined(result)) {",""," ua = feature.ua;"," if (ua) {"," result = (Y.UA[ua]);"," }",""," test = feature.test;"," if (test && ((!ua) || result)) {"," result = test.apply(Y, args);"," }",""," feature.result = result;"," }"," }",""," return result;"," }","});","","// Y.Features.add(\"load\", \"1\", {});","// Y.Features.test(\"load\", \"1\");","// caps=1:1;2:0;3:1;","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","var add = Y.Features.add;","// app-transitions-native","add('load', '0', {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\"","});","// autocomplete-list-keys","add('load', '1', {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\"","});","// dd-gestures","add('load', '2', {"," \"name\": \"dd-gestures\","," \"test\": function(Y) {"," return ((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));","},"," \"trigger\": \"dd-drag\"","});","// dom-style-ie","add('load', '3', {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\"","});","// editor-para-ie","add('load', '4', {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\"","});","// event-base-ie","add('load', '5', {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\"","});","// graphics-canvas","add('load', '6', {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-canvas-default","add('load', '7', {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-svg","add('load', '8', {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-svg-default","add('load', '9', {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-vml","add('load', '10', {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// graphics-vml-default","add('load', '11', {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// history-hash-ie","add('load', '12', {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\"","});","// io-nodejs","add('load', '13', {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\"","});","// scrollview-base-ie","add('load', '14', {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\"","});","// selector-css2","add('load', '15', {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\"","});","// transition-timer","add('load', '16', {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);"," } ",""," return ret;","},"," \"trigger\": \"transition\"","});","// widget-base-ie","add('load', '17', {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\"","});","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];-_yuitest_coverage["build/features/features.js"].lines = {"1":0,"3":0,"16":0,"41":0,"42":0,"56":0,"59":0,"60":0,"61":0,"65":0,"81":0,"82":0,"86":0,"89":0,"91":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"103":0,"107":0,"116":0,"118":0,"121":0,"124":0,"125":0,"128":0,"133":0,"147":0,"152":0,"155":0,"160":0,"164":0,"171":0,"173":0,"177":0,"179":0,"183":0,"186":0,"191":0,"198":0,"201":0,"202":0,"207":0,"210":0,"214":0,"219":0,"222":0,"226":0,"231":0,"234":0,"239":0,"244":0,"247":0,"252":0,"257":0,"260":0,"262":0,"267":0,"270":0,"272":0,"277":0,"280":0,"282":0,"288":0,"294":0,"300":0,"303":0,"306":0,"311":0,"314":0,"318":0,"319":0,"322":0,"327":0};-_yuitest_coverage["build/features/features.js"].functions = {"add:40":0,"(anonymous 2):60":0,"all:55":0,"test:80":0,"\"test\":120":0,"\"test\":135":0,"\"test\":154":0,"test:172":0,"test:178":0,"\"test\":162":0,"\"test\":200":0,"\"test\":209":0,"\"test\":221":0,"\"test\":233":0,"\"test\":246":0,"\"test\":259":0,"\"test\":269":0,"\"test\":279":0,"\"test\":302":0,"\"test\":313":0,"(anonymous 1):1":0};-_yuitest_coverage["build/features/features.js"].coveredLines = 77;-_yuitest_coverage["build/features/features.js"].coveredFunctions = 21;+_yuitest_coverage["build/features/features.js"].code=["YUI.add('features', function (Y, NAME) {","","var feature_tests = {};","","/**","Contains the core of YUI's feature test architecture.","@module features","*/","","/**","* Feature detection","* @class Features","* @static","*/","","Y.mix(Y.namespace('Features'), {"," "," /**"," * Object hash of all registered feature tests"," * @property tests"," * @type Object"," */"," tests: feature_tests,"," "," /**"," * Add a test to the system"," * "," * ```"," * Y.Features.add(\"load\", \"1\", {});"," * ```"," * "," * @method add"," * @param {String} cat The category, right now only 'load' is supported"," * @param {String} name The number sequence of the test, how it's reported in the URL or config: 1, 2, 3"," * @param {Object} o Object containing test properties"," * @param {String} o.name The name of the test"," * @param {Function} o.test The test function to execute, the only argument to the function is the `Y` instance"," * @param {String} o.trigger The module that triggers this test."," */"," add: function(cat, name, o) {"," feature_tests[cat] = feature_tests[cat] || {};"," feature_tests[cat][name] = o;"," },"," /**"," * Execute all tests of a given category and return the serialized results"," *"," * ```"," * caps=1:1;2:1;3:0"," * ```"," * @method all"," * @param {String} cat The category to execute"," * @param {Array} args The arguments to pass to the test function"," * @return {String} A semi-colon separated string of tests and their success/failure: 1:1;2:1;3:0"," */"," all: function(cat, args) {"," var cat_o = feature_tests[cat],"," // results = {};"," result = [];"," if (cat_o) {"," Y.Object.each(cat_o, function(v, k) {"," result.push(k + ':' + (Y.Features.test(cat, k, args) ? 1 : 0));"," });"," }",""," return (result.length) ? result.join(';') : '';"," },"," /**"," * Run a sepecific test and return a Boolean response."," *"," * ```"," * Y.Features.test(\"load\", \"1\");"," * ```"," *"," * @method test"," * @param {String} cat The category of the test to run"," * @param {String} name The name of the test to run"," * @param {Array} args The arguments to pass to the test function"," * @return {Boolean} True or false if the test passed/failed."," */"," test: function(cat, name, args) {"," args = args || [];"," var result, ua, test,"," cat_o = feature_tests[cat],"," feature = cat_o && cat_o[name];",""," if (!feature) {"," } else {",""," result = feature.result;",""," if (Y.Lang.isUndefined(result)) {",""," ua = feature.ua;"," if (ua) {"," result = (Y.UA[ua]);"," }",""," test = feature.test;"," if (test && ((!ua) || result)) {"," result = test.apply(Y, args);"," }",""," feature.result = result;"," }"," }",""," return result;"," }","});","","// Y.Features.add(\"load\", \"1\", {});","// Y.Features.test(\"load\", \"1\");","// caps=1:1;2:0;3:1;","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","var add = Y.Features.add;","// app-transitions-native","add('load', '0', {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\"","});","// autocomplete-list-keys","add('load', '1', {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\"","});","// dd-gestures","add('load', '2', {"," \"name\": \"dd-gestures\","," \"trigger\": \"dd-drag\","," \"ua\": \"touchEnabled\"","});","// dom-style-ie","add('load', '3', {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\"","});","// editor-para-ie","add('load', '4', {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\"","});","// event-base-ie","add('load', '5', {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\"","});","// graphics-canvas","add('load', '6', {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-canvas-default","add('load', '7', {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\"","});","// graphics-svg","add('load', '8', {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-svg-default","add('load', '9', {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\"","});","// graphics-vml","add('load', '10', {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// graphics-vml-default","add('load', '11', {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\"","});","// history-hash-ie","add('load', '12', {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\"","});","// io-nodejs","add('load', '13', {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\"","});","// scrollview-base-ie","add('load', '14', {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\"","});","// selector-css2","add('load', '15', {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\"","});","// transition-timer","add('load', '16', {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return ret;","},"," \"trigger\": \"transition\"","});","// widget-base-ie","add('load', '17', {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\"","});","// yql-nodejs","add('load', '18', {"," \"name\": \"yql-nodejs\","," \"trigger\": \"yql\","," \"ua\": \"nodejs\","," \"when\": \"after\"","});","// yql-winjs","add('load', '19', {"," \"name\": \"yql-winjs\","," \"trigger\": \"yql\","," \"ua\": \"winjs\","," \"when\": \"after\"","});","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/features/features.js"].lines = {"1":0,"3":0,"16":0,"41":0,"42":0,"56":0,"59":0,"60":0,"61":0,"65":0,"81":0,"82":0,"86":0,"89":0,"91":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"103":0,"107":0,"116":0,"118":0,"121":0,"124":0,"125":0,"128":0,"133":0,"147":0,"152":0,"158":0,"162":0,"169":0,"171":0,"175":0,"177":0,"181":0,"184":0,"189":0,"196":0,"199":0,"200":0,"205":0,"208":0,"212":0,"217":0,"220":0,"224":0,"229":0,"232":0,"237":0,"242":0,"245":0,"250":0,"255":0,"258":0,"260":0,"265":0,"268":0,"270":0,"275":0,"278":0,"280":0,"286":0,"292":0,"298":0,"301":0,"304":0,"309":0,"312":0,"316":0,"317":0,"320":0,"325":0,"331":0,"338":0};+_yuitest_coverage["build/features/features.js"].functions = {"add:40":0,"(anonymous 2):60":0,"all:55":0,"test:80":0,"\"test\":120":0,"\"test\":135":0,"test:170":0,"test:176":0,"\"test\":160":0,"\"test\":198":0,"\"test\":207":0,"\"test\":219":0,"\"test\":231":0,"\"test\":244":0,"\"test\":257":0,"\"test\":267":0,"\"test\":277":0,"\"test\":300":0,"\"test\":311":0,"(anonymous 1):1":0};+_yuitest_coverage["build/features/features.js"].coveredLines = 78;+_yuitest_coverage["build/features/features.js"].coveredFunctions = 20; _yuitest_coverline("build/features/features.js", 1); YUI.add('features', function (Y, NAME) { @@ -195,7 +195,7 @@ _yuitest_coverline("build/features/features.js", 124); if (node && node.style) { _yuitest_coverline("build/features/features.js", 125);-return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } _yuitest_coverline("build/features/features.js", 128);@@ -229,21 +229,17 @@ _yuitest_coverline("build/features/features.js", 152); add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 154);-_yuitest_coverline("build/features/features.js", 155);-return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie-_yuitest_coverline("build/features/features.js", 160);+_yuitest_coverline("build/features/features.js", 158); add('load', '3', { "name": "dom-style-ie", "test": function (Y) { - _yuitest_coverfunc("build/features/features.js", "\"test\"", 162);-_yuitest_coverline("build/features/features.js", 164);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 160);+_yuitest_coverline("build/features/features.js", 162); var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win,@@ -251,35 +247,35 @@ DOCUMENT_ELEMENT = 'documentElement', ret = false; - _yuitest_coverline("build/features/features.js", 171);+ _yuitest_coverline("build/features/features.js", 169); addFeature('style', 'computedStyle', { test: function() {- _yuitest_coverfunc("build/features/features.js", "test", 172);-_yuitest_coverline("build/features/features.js", 173);+ _yuitest_coverfunc("build/features/features.js", "test", 170);+_yuitest_coverline("build/features/features.js", 171); return WINDOW && 'getComputedStyle' in WINDOW; } }); - _yuitest_coverline("build/features/features.js", 177);+ _yuitest_coverline("build/features/features.js", 175); addFeature('style', 'opacity', { test: function() {- _yuitest_coverfunc("build/features/features.js", "test", 178);-_yuitest_coverline("build/features/features.js", 179);+ _yuitest_coverfunc("build/features/features.js", "test", 176);+_yuitest_coverline("build/features/features.js", 177); return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); - _yuitest_coverline("build/features/features.js", 183);+ _yuitest_coverline("build/features/features.js", 181); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); - _yuitest_coverline("build/features/features.js", 186);+ _yuitest_coverline("build/features/features.js", 184); return ret; }, "trigger": "dom-style" }); // editor-para-ie-_yuitest_coverline("build/features/features.js", 191);+_yuitest_coverline("build/features/features.js", 189); add('load', '4', { "name": "editor-para-ie", "trigger": "editor-para",@@ -287,184 +283,200 @@ "when": "instead" }); // event-base-ie-_yuitest_coverline("build/features/features.js", 198);+_yuitest_coverline("build/features/features.js", 196); add('load', '5', { "name": "event-base-ie", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 200);-_yuitest_coverline("build/features/features.js", 201);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 198);+_yuitest_coverline("build/features/features.js", 199); var imp = Y.config.doc && Y.config.doc.implementation;- _yuitest_coverline("build/features/features.js", 202);+ _yuitest_coverline("build/features/features.js", 200); return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base" }); // graphics-canvas-_yuitest_coverline("build/features/features.js", 207);+_yuitest_coverline("build/features/features.js", 205); add('load', '6', { "name": "graphics-canvas", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 209);-_yuitest_coverline("build/features/features.js", 210);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 207);+_yuitest_coverline("build/features/features.js", 208); var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));- _yuitest_coverline("build/features/features.js", 214);+ _yuitest_coverline("build/features/features.js", 212); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-canvas-default-_yuitest_coverline("build/features/features.js", 219);+_yuitest_coverline("build/features/features.js", 217); add('load', '7', { "name": "graphics-canvas-default", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 221);-_yuitest_coverline("build/features/features.js", 222);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 219);+_yuitest_coverline("build/features/features.js", 220); var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));- _yuitest_coverline("build/features/features.js", 226);+ _yuitest_coverline("build/features/features.js", 224); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics" }); // graphics-svg-_yuitest_coverline("build/features/features.js", 231);+_yuitest_coverline("build/features/features.js", 229); add('load', '8', { "name": "graphics-svg", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 233);-_yuitest_coverline("build/features/features.js", 234);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 231);+_yuitest_coverline("build/features/features.js", 232); var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); - _yuitest_coverline("build/features/features.js", 239);+ _yuitest_coverline("build/features/features.js", 237); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // graphics-svg-default-_yuitest_coverline("build/features/features.js", 244);+_yuitest_coverline("build/features/features.js", 242); add('load', '9', { "name": "graphics-svg-default", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 246);-_yuitest_coverline("build/features/features.js", 247);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 244);+_yuitest_coverline("build/features/features.js", 245); var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); - _yuitest_coverline("build/features/features.js", 252);+ _yuitest_coverline("build/features/features.js", 250); return svg && (useSVG || !canvas); }, "trigger": "graphics" }); // graphics-vml-_yuitest_coverline("build/features/features.js", 257);+_yuitest_coverline("build/features/features.js", 255); add('load', '10', { "name": "graphics-vml", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 259);-_yuitest_coverline("build/features/features.js", 260);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 257);+_yuitest_coverline("build/features/features.js", 258); var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas");- _yuitest_coverline("build/features/features.js", 262);+ _yuitest_coverline("build/features/features.js", 260); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // graphics-vml-default-_yuitest_coverline("build/features/features.js", 267);+_yuitest_coverline("build/features/features.js", 265); add('load', '11', { "name": "graphics-vml-default", "test": function(Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 269);-_yuitest_coverline("build/features/features.js", 270);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 267);+_yuitest_coverline("build/features/features.js", 268); var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas");- _yuitest_coverline("build/features/features.js", 272);+ _yuitest_coverline("build/features/features.js", 270); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics" }); // history-hash-ie-_yuitest_coverline("build/features/features.js", 277);+_yuitest_coverline("build/features/features.js", 275); add('load', '12', { "name": "history-hash-ie", "test": function (Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 279);-_yuitest_coverline("build/features/features.js", 280);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 277);+_yuitest_coverline("build/features/features.js", 278); var docMode = Y.config.doc && Y.config.doc.documentMode; - _yuitest_coverline("build/features/features.js", 282);+ _yuitest_coverline("build/features/features.js", 280); return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); }, "trigger": "history-hash" }); // io-nodejs-_yuitest_coverline("build/features/features.js", 288);+_yuitest_coverline("build/features/features.js", 286); add('load', '13', { "name": "io-nodejs", "trigger": "io-base", "ua": "nodejs" }); // scrollview-base-ie-_yuitest_coverline("build/features/features.js", 294);+_yuitest_coverline("build/features/features.js", 292); add('load', '14', { "name": "scrollview-base-ie", "trigger": "scrollview-base", "ua": "ie" }); // selector-css2-_yuitest_coverline("build/features/features.js", 300);+_yuitest_coverline("build/features/features.js", 298); add('load', '15', { "name": "selector-css2", "test": function (Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 302);-_yuitest_coverline("build/features/features.js", 303);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 300);+_yuitest_coverline("build/features/features.js", 301); var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); - _yuitest_coverline("build/features/features.js", 306);+ _yuitest_coverline("build/features/features.js", 304); return ret; }, "trigger": "selector" }); // transition-timer-_yuitest_coverline("build/features/features.js", 311);+_yuitest_coverline("build/features/features.js", 309); add('load', '16', { "name": "transition-timer", "test": function (Y) {- _yuitest_coverfunc("build/features/features.js", "\"test\"", 313);-_yuitest_coverline("build/features/features.js", 314);+ _yuitest_coverfunc("build/features/features.js", "\"test\"", 311);+_yuitest_coverline("build/features/features.js", 312); var DOCUMENT = Y.config.doc, node = (DOCUMENT) ? DOCUMENT.documentElement: null, ret = true; - _yuitest_coverline("build/features/features.js", 318);+ _yuitest_coverline("build/features/features.js", 316); if (node && node.style) {- _yuitest_coverline("build/features/features.js", 319);-ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + _yuitest_coverline("build/features/features.js", 317);+ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } - _yuitest_coverline("build/features/features.js", 322);+ _yuitest_coverline("build/features/features.js", 320); return ret; }, "trigger": "transition" }); // widget-base-ie-_yuitest_coverline("build/features/features.js", 327);+_yuitest_coverline("build/features/features.js", 325); add('load', '17', { "name": "widget-base-ie", "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+_yuitest_coverline("build/features/features.js", 331);+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+_yuitest_coverline("build/features/features.js", 338);+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/features/features-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -129,7 +129,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -158,10 +158,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -323,8 +321,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -336,5 +334,19 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/features/features-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"})},"3.7.2",{requires:["yui-base"]});+YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","18",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","19",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.7.3",{requires:["yui-base"]});
bundle/features/features.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -128,7 +128,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -157,10 +157,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -322,8 +320,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -335,5 +333,19 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/file-flash/file-flash-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/file-flash/file-flash.js", code: [] };-_yuitest_coverage["build/file-flash/file-flash.js"].code=["YUI.add('file-flash', function (Y, NAME) {",""," /**"," * The FileFlash class provides a wrapper for a file pointer stored in Flash. The File wrapper "," * also implements the mechanics for uploading a file and tracking its progress."," * @module file-flash"," */ "," /**"," * The class provides a wrapper for a file pointer in Flash."," * @class FileFlash"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object."," */",""," var FileFlash = function(o) {"," FileFlash.superclass.constructor.apply(this, arguments); "," };",""," Y.extend(FileFlash, Y.Base, {",""," /**"," * Construction logic executed during FileFlash instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {"," if (!this.get(\"id\")) {"," this._set(\"id\", Y.guid(\"file\"));"," }"," },",""," /**"," * Handler of events dispatched by the Flash player."," *"," * @method _swfEventHandler"," * @param {Event} event The event object received from the Flash player."," * @protected"," */ "," _swfEventHandler: function (event) {"," if (event.id === this.get(\"id\")) {"," switch (event.type) {"," /**"," * Signals that this file's upload has started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart` with the"," * following payload:"," * <dl>"," * <dt>uploader</dt>"," * <dd>The Y.SWF instance of Flash uploader that's handling the upload.</dd>"," * </dl>"," */"," case \"uploadstart\":"," this.fire(\"uploadstart\", {uploader: this.get(\"uploader\")});"," break;"," case \"uploadprogress\":",""," /**"," * Signals that progress has been made on the upload of this file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash uploader instance.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file (the file size)</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100.</dd>"," * </dl>"," */"," this.fire(\"uploadprogress\", {originEvent: event,"," bytesLoaded: event.bytesLoaded, "," bytesTotal: event.bytesTotal, "," percentLoaded: Math.min(100, Math.round(10000*event.bytesLoaded/event.bytesTotal)/100)"," });"," this._set(\"bytesUploaded\", event.bytesLoaded);"," break;"," case \"uploadcomplete\":",""," /**"," * Signals that this file's upload has completed, but data has not yet been received from the server. "," *"," * @event uploadfinished"," * @param event {Event} The event object for the `uploadfinished` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * </dl>"," */"," this.fire(\"uploadfinished\", {originEvent: event});"," break;"," case \"uploadcompletedata\":"," /**"," * Signals that this file's upload has completed and data has been received from the server."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * <dt>data</dt>"," * <dd>The data returned by the server.</dd>"," * </dl>"," */"," this.fire(\"uploadcomplete\", {originEvent: event,"," data: event.data}); "," break;"," case \"uploadcancel\":",""," /**"," * Signals that this file's upload has been cancelled. "," *"," * @event uploadcancel"," * @param event {Event} The event object for the `uploadcancel` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * </dl>"," */"," this.fire(\"uploadcancel\", {originEvent: event});"," break;"," case \"uploaderror\":",""," /**"," * Signals that this file's upload has encountered an error. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * <dt>status</dt>"," * <dd>The status code reported by the Flash Player. If it's an HTTP error,"," * then this corresponds to the HTTP status code received by the uploader.</dd>"," * <dt>statusText</dt>"," * <dd>The text of the error event reported by the Flash Player.</dd>"," * <dt>source</dt>"," * <dd>Either \"http\" (if it's an HTTP error), or \"io\" (if it's a network transmission "," * error.)</dd>"," * </dl>"," */"," this.fire(\"uploaderror\", {originEvent: event, status: event.status, statusText: event.message, source: event.source}); ",""," }"," }"," },",""," /**"," * Starts the upload of a specific file."," *"," * @method startUpload"," * @param url {String} The URL to upload the file to."," * @param parameters {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param fileFieldName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," */"," startUpload: function(url, parameters, fileFieldName) {"," "," if (this.get(\"uploader\")) {",""," var myUploader = this.get(\"uploader\"),"," fileField = fileFieldName || \"Filedata\","," id = this.get(\"id\"),"," params = parameters || null;",""," this._set(\"bytesUploaded\", 0);"," "," myUploader.on(\"uploadstart\", this._swfEventHandler, this);"," myUploader.on(\"uploadprogress\", this._swfEventHandler, this);"," myUploader.on(\"uploadcomplete\", this._swfEventHandler, this);"," myUploader.on(\"uploadcompletedata\", this._swfEventHandler, this);"," myUploader.on(\"uploaderror\", this._swfEventHandler, this);",""," myUploader.callSWF(\"upload\", [id, url, params, fileField]);"," }",""," },",""," /**"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancelUpload"," */ "," cancelUpload: function () {"," if (this.get(\"uploader\")) {"," this.get(\"uploader\").callSWF(\"cancel\", [this.get(\"id\")]);"," this.fire(\"uploadcancel\");"," }"," }",""," }, {",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'file'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'file',",""," /**"," * The type of transport."," *"," * @property TYPE"," * @type String"," * @default 'flash'"," * @readOnly"," * @protected"," * @static"," */"," TYPE: \"flash\",",""," /**"," * Static property used to define the default attribute configuration of"," * the File."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A String containing the unique id of the file wrapped by the FileFlash instance."," * The id is supplied by the Flash player uploader."," *"," * @attribute id"," * @type {String}"," * @initOnly"," */"," id: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The size of the file wrapped by FileFlash. This value is supplied by the Flash player uploader."," *"," * @attribute size"," * @type {Number}"," * @initOnly"," */"," size: {"," writeOnce: \"initOnly\","," value: 0"," },",""," /**"," * The name of the file wrapped by FileFlash. This value is supplied by the Flash player uploader."," *"," * @attribute name"," * @type {String}"," * @initOnly"," */"," name: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileFlash was created on. This value is supplied by the Flash player uploader."," *"," * @attribute dateCreated"," * @type {Date}"," * @initOnly"," */"," dateCreated: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileFlash was last modified on. This value is supplied by the Flash player uploader."," *"," * @attribute dateModified"," * @type {Date}"," * @initOnly"," */"," dateModified: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The number of bytes of the file that has been uploaded to the server. This value is"," * non-zero only while a file is being uploaded."," *"," * @attribute bytesUploaded"," * @type {Date}"," * @readOnly"," */"," bytesUploaded: {"," readOnly: true,"," value: 0"," },",""," /**"," * The type of the file wrapped by FileFlash. This value is provided by the Flash player"," * uploader."," *"," * @attribute type"," * @type {String}"," * @initOnly"," */"," type: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The instance of Y.SWF wrapping the Flash player uploader associated with this file."," *"," * @attribute uploder"," * @type {SWF}"," * @initOnly"," */"," uploader: {"," writeOnce: \"initOnly\","," value: null"," }"," }"," });",""," Y.FileFlash = FileFlash;","","}, '3.7.2', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/file-flash/file-flash.js"].code=["YUI.add('file-flash', function (Y, NAME) {",""," /**"," * The FileFlash class provides a wrapper for a file pointer stored in Flash. The File wrapper "," * also implements the mechanics for uploading a file and tracking its progress."," * @module file-flash"," */ "," /**"," * The class provides a wrapper for a file pointer in Flash."," * @class FileFlash"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object."," */",""," var FileFlash = function(o) {"," FileFlash.superclass.constructor.apply(this, arguments); "," };",""," Y.extend(FileFlash, Y.Base, {",""," /**"," * Construction logic executed during FileFlash instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {"," if (!this.get(\"id\")) {"," this._set(\"id\", Y.guid(\"file\"));"," }"," },",""," /**"," * Handler of events dispatched by the Flash player."," *"," * @method _swfEventHandler"," * @param {Event} event The event object received from the Flash player."," * @protected"," */ "," _swfEventHandler: function (event) {"," if (event.id === this.get(\"id\")) {"," switch (event.type) {"," /**"," * Signals that this file's upload has started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart` with the"," * following payload:"," * <dl>"," * <dt>uploader</dt>"," * <dd>The Y.SWF instance of Flash uploader that's handling the upload.</dd>"," * </dl>"," */"," case \"uploadstart\":"," this.fire(\"uploadstart\", {uploader: this.get(\"uploader\")});"," break;"," case \"uploadprogress\":",""," /**"," * Signals that progress has been made on the upload of this file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash uploader instance.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file (the file size)</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100.</dd>"," * </dl>"," */"," this.fire(\"uploadprogress\", {originEvent: event,"," bytesLoaded: event.bytesLoaded, "," bytesTotal: event.bytesTotal, "," percentLoaded: Math.min(100, Math.round(10000*event.bytesLoaded/event.bytesTotal)/100)"," });"," this._set(\"bytesUploaded\", event.bytesLoaded);"," break;"," case \"uploadcomplete\":",""," /**"," * Signals that this file's upload has completed, but data has not yet been received from the server. "," *"," * @event uploadfinished"," * @param event {Event} The event object for the `uploadfinished` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * </dl>"," */"," this.fire(\"uploadfinished\", {originEvent: event});"," break;"," case \"uploadcompletedata\":"," /**"," * Signals that this file's upload has completed and data has been received from the server."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * <dt>data</dt>"," * <dd>The data returned by the server.</dd>"," * </dl>"," */"," this.fire(\"uploadcomplete\", {originEvent: event,"," data: event.data}); "," break;"," case \"uploadcancel\":",""," /**"," * Signals that this file's upload has been cancelled. "," *"," * @event uploadcancel"," * @param event {Event} The event object for the `uploadcancel` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * </dl>"," */"," this.fire(\"uploadcancel\", {originEvent: event});"," break;"," case \"uploaderror\":",""," /**"," * Signals that this file's upload has encountered an error. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the Flash player instance.</dd>"," * <dt>status</dt>"," * <dd>The status code reported by the Flash Player. If it's an HTTP error,"," * then this corresponds to the HTTP status code received by the uploader.</dd>"," * <dt>statusText</dt>"," * <dd>The text of the error event reported by the Flash Player.</dd>"," * <dt>source</dt>"," * <dd>Either \"http\" (if it's an HTTP error), or \"io\" (if it's a network transmission "," * error.)</dd>"," * </dl>"," */"," this.fire(\"uploaderror\", {originEvent: event, status: event.status, statusText: event.message, source: event.source}); ",""," }"," }"," },",""," /**"," * Starts the upload of a specific file."," *"," * @method startUpload"," * @param url {String} The URL to upload the file to."," * @param parameters {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param fileFieldName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," */"," startUpload: function(url, parameters, fileFieldName) {"," "," if (this.get(\"uploader\")) {",""," var myUploader = this.get(\"uploader\"),"," fileField = fileFieldName || \"Filedata\","," id = this.get(\"id\"),"," params = parameters || null;",""," this._set(\"bytesUploaded\", 0);"," "," myUploader.on(\"uploadstart\", this._swfEventHandler, this);"," myUploader.on(\"uploadprogress\", this._swfEventHandler, this);"," myUploader.on(\"uploadcomplete\", this._swfEventHandler, this);"," myUploader.on(\"uploadcompletedata\", this._swfEventHandler, this);"," myUploader.on(\"uploaderror\", this._swfEventHandler, this);",""," myUploader.callSWF(\"upload\", [id, url, params, fileField]);"," }",""," },",""," /**"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancelUpload"," */ "," cancelUpload: function () {"," if (this.get(\"uploader\")) {"," this.get(\"uploader\").callSWF(\"cancel\", [this.get(\"id\")]);"," this.fire(\"uploadcancel\");"," }"," }",""," }, {",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'file'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'file',",""," /**"," * The type of transport."," *"," * @property TYPE"," * @type String"," * @default 'flash'"," * @readOnly"," * @protected"," * @static"," */"," TYPE: \"flash\",",""," /**"," * Static property used to define the default attribute configuration of"," * the File."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A String containing the unique id of the file wrapped by the FileFlash instance."," * The id is supplied by the Flash player uploader."," *"," * @attribute id"," * @type {String}"," * @initOnly"," */"," id: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The size of the file wrapped by FileFlash. This value is supplied by the Flash player uploader."," *"," * @attribute size"," * @type {Number}"," * @initOnly"," */"," size: {"," writeOnce: \"initOnly\","," value: 0"," },",""," /**"," * The name of the file wrapped by FileFlash. This value is supplied by the Flash player uploader."," *"," * @attribute name"," * @type {String}"," * @initOnly"," */"," name: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileFlash was created on. This value is supplied by the Flash player uploader."," *"," * @attribute dateCreated"," * @type {Date}"," * @initOnly"," */"," dateCreated: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileFlash was last modified on. This value is supplied by the Flash player uploader."," *"," * @attribute dateModified"," * @type {Date}"," * @initOnly"," */"," dateModified: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The number of bytes of the file that has been uploaded to the server. This value is"," * non-zero only while a file is being uploaded."," *"," * @attribute bytesUploaded"," * @type {Date}"," * @readOnly"," */"," bytesUploaded: {"," readOnly: true,"," value: 0"," },",""," /**"," * The type of the file wrapped by FileFlash. This value is provided by the Flash player"," * uploader."," *"," * @attribute type"," * @type {String}"," * @initOnly"," */"," type: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The instance of Y.SWF wrapping the Flash player uploader associated with this file."," *"," * @attribute uploder"," * @type {SWF}"," * @initOnly"," */"," uploader: {"," writeOnce: \"initOnly\","," value: null"," }"," }"," });",""," Y.FileFlash = FileFlash;","","}, '3.7.3', {\"requires\": [\"base\"]});"]; _yuitest_coverage["build/file-flash/file-flash.js"].lines = {"1":0,"16":0,"17":0,"20":0,"29":0,"30":0,"42":0,"43":0,"56":0,"57":0,"77":0,"82":0,"83":0,"97":0,"98":0,"113":0,"115":0,"129":0,"130":0,"152":0,"168":0,"170":0,"175":0,"177":0,"178":0,"179":0,"180":0,"181":0,"183":0,"194":0,"195":0,"196":0,"338":0}; _yuitest_coverage["build/file-flash/file-flash.js"].functions = {"FileFlash:16":0,"initializer:28":0,"_swfEventHandler:41":0,"startUpload:166":0,"cancelUpload:193":0,"(anonymous 1):1":0}; _yuitest_coverage["build/file-flash/file-flash.js"].coveredLines = 33;@@ -415,4 +415,4 @@ _yuitest_coverline("build/file-flash/file-flash.js", 338); Y.FileFlash = FileFlash; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/file-flash/file-flash-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -343,4 +343,4 @@ Y.FileFlash = FileFlash; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/file-flash/file-flash-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("file-flash",function(e,t){var n=function(e){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(t){this.get("id")||this._set("id",e.guid("file"))},_swfEventHandler:function(e){if(e.id===this.get("id"))switch(e.type){case"uploadstart":this.fire("uploadstart",{uploader:this.get("uploader")});break;case"uploadprogress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,percentLoaded:Math.min(100,Math.round(1e4*e.bytesLoaded/e.bytesTotal)/100)}),this._set("bytesUploaded",e.bytesLoaded);break;case"uploadcomplete":this.fire("uploadfinished",{originEvent:e});break;case"uploadcompletedata":this.fire("uploadcomplete",{originEvent:e,data:e.data});break;case"uploadcancel":this.fire("uploadcancel",{originEvent:e});break;case"uploaderror":this.fire("uploaderror",{originEvent:e,status:e.status,statusText:e.message,source:e.source})}},startUpload:function(e,t,n){if(this.get("uploader")){var r=this.get("uploader"),i=n||"Filedata",s=this.get("id"),o=t||null;this._set("bytesUploaded",0),r.on("uploadstart",this._swfEventHandler,this),r.on("uploadprogress",this._swfEventHandler,this),r.on("uploadcomplete",this._swfEventHandler,this),r.on("uploadcompletedata",this._swfEventHandler,this),r.on("uploaderror",this._swfEventHandler,this),r.callSWF("upload",[s,e,o,i])}},cancelUpload:function(){this.get("uploader")&&(this.get("uploader").callSWF("cancel",[this.get("id")]),this.fire("uploadcancel"))}},{NAME:"file",TYPE:"flash",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},uploader:{writeOnce:"initOnly",value:null}}}),e.FileFlash=n},"3.7.2",{requires:["base"]});+YUI.add("file-flash",function(e,t){var n=function(e){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(t){this.get("id")||this._set("id",e.guid("file"))},_swfEventHandler:function(e){if(e.id===this.get("id"))switch(e.type){case"uploadstart":this.fire("uploadstart",{uploader:this.get("uploader")});break;case"uploadprogress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,percentLoaded:Math.min(100,Math.round(1e4*e.bytesLoaded/e.bytesTotal)/100)}),this._set("bytesUploaded",e.bytesLoaded);break;case"uploadcomplete":this.fire("uploadfinished",{originEvent:e});break;case"uploadcompletedata":this.fire("uploadcomplete",{originEvent:e,data:e.data});break;case"uploadcancel":this.fire("uploadcancel",{originEvent:e});break;case"uploaderror":this.fire("uploaderror",{originEvent:e,status:e.status,statusText:e.message,source:e.source})}},startUpload:function(e,t,n){if(this.get("uploader")){var r=this.get("uploader"),i=n||"Filedata",s=this.get("id"),o=t||null;this._set("bytesUploaded",0),r.on("uploadstart",this._swfEventHandler,this),r.on("uploadprogress",this._swfEventHandler,this),r.on("uploadcomplete",this._swfEventHandler,this),r.on("uploadcompletedata",this._swfEventHandler,this),r.on("uploaderror",this._swfEventHandler,this),r.callSWF("upload",[s,e,o,i])}},cancelUpload:function(){this.get("uploader")&&(this.get("uploader").callSWF("cancel",[this.get("id")]),this.fire("uploadcancel"))}},{NAME:"file",TYPE:"flash",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},uploader:{writeOnce:"initOnly",value:null}}}),e.FileFlash=n},"3.7.3",{requires:["base"]});
bundle/file-flash/file-flash.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -343,4 +343,4 @@ Y.FileFlash = FileFlash; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/file-html5/file-html5-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/file-html5/file-html5.js", code: [] };-_yuitest_coverage["build/file-html5/file-html5.js"].code=["YUI.add('file-html5', function (Y, NAME) {",""," /**"," * The FileHTML5 class provides a wrapper for a file pointer in an HTML5 The File wrapper "," * also implements the mechanics for uploading a file and tracking its progress."," * @module file-html5"," */ "," "," /**"," * The class provides a wrapper for a file pointer."," * @class FileHTML5"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object."," */"," var Lang = Y.Lang,"," Bind = Y.bind,"," Win = Y.config.win;",""," var FileHTML5 = function(o) {"," "," var file = null;",""," if (FileHTML5.isValidFile(o)) {"," file = o;"," }"," else if (FileHTML5.isValidFile(o.file)) {"," file = o.file;"," }"," else {"," file = false;"," }",""," FileHTML5.superclass.constructor.apply(this, arguments); "," "," if (file && FileHTML5.canUpload()) {"," if (!this.get(\"file\")) {"," this._set(\"file\", file);"," }",""," if (!this.get(\"name\")) {"," this._set(\"name\", file.name || file.fileName);"," }",""," if (this.get(\"size\") != (file.size || file.fileSize)) {"," this._set(\"size\", file.size || file.fileSize);"," }",""," if (!this.get(\"type\")) {"," this._set(\"type\", file.type);"," }",""," if (file.hasOwnProperty(\"lastModifiedDate\") && !this.get(\"dateModified\")) {"," this._set(\"dateModified\", file.lastModifiedDate);"," }"," }"," };","",""," Y.extend(FileHTML5, Y.Base, {",""," /**"," * Construction logic executed during FileHTML5 instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {"," if (!this.get(\"id\")) {"," this._set(\"id\", Y.guid(\"file\"));"," }"," },",""," /**"," * Handler of events dispatched by the XMLHTTPRequest."," *"," * @method _uploadEventHandler"," * @param {Event} event The event object received from the XMLHTTPRequest."," * @protected"," */ "," _uploadEventHandler: function (event) {"," var xhr = this.get(\"xhr\");",""," switch (event.type) {"," case \"progress\":"," /**"," * Signals that progress has been made on the upload of this file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file (the file size)</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100.</dd>"," * </dl>"," */"," this.fire(\"uploadprogress\", {originEvent: event,"," bytesLoaded: event.loaded, "," bytesTotal: this.get(\"size\"), "," percentLoaded: Math.min(100, Math.round(10000*event.loaded/this.get(\"size\"))/100)"," });"," this._set(\"bytesUploaded\", event.loaded);"," break;",""," case \"load\":"," /**"," * Signals that this file's upload has completed and data has been received from the server."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * <dt>data</dt>"," * <dd>The data returned by the server.</dd>"," * </dl>"," */",""," if (xhr.status >= 200 && xhr.status <= 299) {"," this.fire(\"uploadcomplete\", {originEvent: event,"," data: event.target.responseText});"," var xhrupload = xhr.upload,"," boundEventHandler = this.get(\"boundEventHandler\");"," "," xhrupload.removeEventListener (\"progress\", boundEventHandler);"," xhrupload.removeEventListener (\"error\", boundEventHandler);"," xhrupload.removeEventListener (\"abort\", boundEventHandler);"," xhr.removeEventListener (\"load\", boundEventHandler); "," xhr.removeEventListener (\"error\", boundEventHandler);"," xhr.removeEventListener (\"readystatechange\", boundEventHandler);"," "," this._set(\"xhr\", null);"," }"," else {"," this.fire(\"uploaderror\", {originEvent: event,"," status: xhr.status,"," statusText: xhr.statusText,"," source: \"http\"});"," } "," break;",""," case \"error\":"," /**"," * Signals that this file's upload has encountered an error. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * <dt>status</dt>"," * <dd>The status code reported by the XMLHttpRequest. If it's an HTTP error,"," then this corresponds to the HTTP status code received by the uploader.</dd>"," * <dt>statusText</dt>"," * <dd>The text of the error event reported by the XMLHttpRequest instance</dd>"," * <dt>source</dt>"," * <dd>Either \"http\" (if it's an HTTP error), or \"io\" (if it's a network transmission "," * error.)</dd>"," *"," * </dl>"," */"," this.fire(\"uploaderror\", {originEvent: event,"," status: xhr.status,"," statusText: xhr.statusText,"," source: \"io\"});"," break;",""," case \"abort\":",""," /**"," * Signals that this file's upload has been cancelled. "," *"," * @event uploadcancel"," * @param event {Event} The event object for the `uploadcancel` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * </dl>"," */"," this.fire(\"uploadcancel\", {originEvent: event});"," break;",""," case \"readystatechange\":",""," /**"," * Signals that XMLHttpRequest has fired a readystatechange event. "," *"," * @event readystatechange"," * @param event {Event} The event object for the `readystatechange` with the"," * following payload:"," * <dl>"," * <dt>readyState</dt>"," * <dd>The readyState code reported by the XMLHttpRequest instance.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * </dl>"," */"," this.fire(\"readystatechange\", {readyState: event.target.readyState,"," originEvent: event});"," break;"," }"," },",""," /**"," * Starts the upload of a specific file."," *"," * @method startUpload"," * @param url {String} The URL to upload the file to."," * @param parameters {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param fileFieldName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," */"," startUpload: function(url, parameters, fileFieldName) {"," "," this._set(\"bytesUploaded\", 0);"," "," this._set(\"xhr\", new XMLHttpRequest());"," this._set(\"boundEventHandler\", Bind(this._uploadEventHandler, this));"," "," var uploadData = new FormData(),"," fileField = fileFieldName || \"Filedata\","," xhr = this.get(\"xhr\"),"," xhrupload = this.get(\"xhr\").upload,"," boundEventHandler = this.get(\"boundEventHandler\");",""," Y.each(parameters, function (value, key) {uploadData.append(key, value);});"," uploadData.append(fileField, this.get(\"file\"));","","","",""," xhr.addEventListener (\"loadstart\", boundEventHandler, false);"," xhrupload.addEventListener (\"progress\", boundEventHandler, false);"," xhr.addEventListener (\"load\", boundEventHandler, false);"," xhr.addEventListener (\"error\", boundEventHandler, false);"," xhrupload.addEventListener (\"error\", boundEventHandler, false);"," xhrupload.addEventListener (\"abort\", boundEventHandler, false);"," xhr.addEventListener (\"abort\", boundEventHandler, false);"," xhr.addEventListener (\"loadend\", boundEventHandler, false); "," xhr.addEventListener (\"readystatechange\", boundEventHandler, false);",""," xhr.open(\"POST\", url, true);",""," xhr.withCredentials = this.get(\"xhrWithCredentials\");",""," Y.each(this.get(\"xhrHeaders\"), function (value, key) {"," xhr.setRequestHeader(key, value);"," });",""," xhr.send(uploadData);"," "," /**"," * Signals that this file's upload has started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart` with the"," * following payload:"," * <dl>"," * <dt>xhr</dt>"," * <dd>The XMLHttpRequest instance handling the file upload.</dd>"," * </dl>"," */"," this.fire(\"uploadstart\", {xhr: xhr});",""," },",""," /**"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancelUpload"," */ "," cancelUpload: function () {"," this.get('xhr').abort();"," }","",""," }, {",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'file'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'file',",""," /**"," * The type of transport."," *"," * @property TYPE"," * @type String"," * @default 'html5'"," * @readOnly"," * @protected"," * @static"," */"," TYPE: 'html5',",""," /**"," * Static property used to define the default attribute configuration of"," * the File."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A String containing the unique id of the file wrapped by the FileFlash instance."," * The id is supplied by the Flash player uploader."," *"," * @attribute id"," * @type {String}"," * @initOnly"," */"," id: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The size of the file wrapped by FileHTML5. This value is supplied by the instance of File()."," *"," * @attribute size"," * @type {Number}"," * @initOnly"," */"," size: {"," writeOnce: \"initOnly\","," value: 0"," },",""," /**"," * The name of the file wrapped by FileHTML5. This value is supplied by the instance of File()."," *"," * @attribute name"," * @type {String}"," * @initOnly"," */"," name: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileHTML5 was created on. This value is supplied by the instance of File()."," *"," * @attribute dateCreated"," * @type {Date}"," * @initOnly"," * @default null"," */"," dateCreated: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileHTML5 was last modified on. This value is supplied by the instance of File()."," *"," * @attribute dateModified"," * @type {Date}"," * @initOnly"," */"," dateModified: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The number of bytes of the file that has been uploaded to the server. This value is"," * non-zero only while a file is being uploaded."," *"," * @attribute bytesUploaded"," * @type {Date}"," * @readOnly"," */"," bytesUploaded: {"," readOnly: true,"," value: 0"," },",""," /**"," * The type of the file wrapped by FileHTML. This value is provided by the instance of File()"," *"," * @attribute type"," * @type {String}"," * @initOnly"," */"," type: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The pointer to the instance of File() wrapped by FileHTML5."," *"," * @attribute file"," * @type {File}"," * @initOnly"," */"," file: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The pointer to the instance of XMLHttpRequest used by FileHTML5 to upload the file."," *"," * @attribute xhr"," * @type {XMLHttpRequest}"," * @initOnly"," */"," xhr: {"," readOnly: true,"," value: null"," },",""," /**"," * The dictionary of headers that should be set on the XMLHttpRequest object before"," * sending it."," *"," * @attribute xhrHeaders"," * @type {Object}"," * @initOnly"," */"," xhrHeaders: {"," value: {}"," },",""," /**"," * A Boolean indicating whether the XMLHttpRequest should be sent with user credentials."," * This does not affect same-site requests. "," *"," * @attribute xhrWithCredentials"," * @type {Boolean}"," * @initOnly"," */"," xhrWithCredentials: {"," value: true"," },",""," /**"," * The bound event handler used to handle events from XMLHttpRequest."," *"," * @attribute boundEventHandler"," * @type {Function}"," * @initOnly"," */"," boundEventHandler: {"," readOnly: true,"," value: null"," }"," },",""," /**"," * Checks whether a specific native file instance is valid"," *"," * @method isValidFile"," * @param file {File} A native File() instance."," * @static"," */"," isValidFile: function (file) {"," return (Win && Win.File && file instanceof File);"," },",""," /**"," * Checks whether the browser has a native upload capability"," * via XMLHttpRequest Level 2."," *"," * @method canUpload"," * @static"," */"," canUpload: function () {"," return (Win && Win.FormData && Win.XMLHttpRequest);"," }"," });",""," Y.FileHTML5 = FileHTML5;","","}, '3.7.2', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/file-html5/file-html5.js"].code=["YUI.add('file-html5', function (Y, NAME) {",""," /**"," * The FileHTML5 class provides a wrapper for a file pointer in an HTML5 The File wrapper "," * also implements the mechanics for uploading a file and tracking its progress."," * @module file-html5"," */ "," "," /**"," * The class provides a wrapper for a file pointer."," * @class FileHTML5"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object."," */"," var Lang = Y.Lang,"," Bind = Y.bind,"," Win = Y.config.win;",""," var FileHTML5 = function(o) {"," "," var file = null;",""," if (FileHTML5.isValidFile(o)) {"," file = o;"," }"," else if (FileHTML5.isValidFile(o.file)) {"," file = o.file;"," }"," else {"," file = false;"," }",""," FileHTML5.superclass.constructor.apply(this, arguments); "," "," if (file && FileHTML5.canUpload()) {"," if (!this.get(\"file\")) {"," this._set(\"file\", file);"," }",""," if (!this.get(\"name\")) {"," this._set(\"name\", file.name || file.fileName);"," }",""," if (this.get(\"size\") != (file.size || file.fileSize)) {"," this._set(\"size\", file.size || file.fileSize);"," }",""," if (!this.get(\"type\")) {"," this._set(\"type\", file.type);"," }",""," if (file.hasOwnProperty(\"lastModifiedDate\") && !this.get(\"dateModified\")) {"," this._set(\"dateModified\", file.lastModifiedDate);"," }"," }"," };","",""," Y.extend(FileHTML5, Y.Base, {",""," /**"," * Construction logic executed during FileHTML5 instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {"," if (!this.get(\"id\")) {"," this._set(\"id\", Y.guid(\"file\"));"," }"," },",""," /**"," * Handler of events dispatched by the XMLHTTPRequest."," *"," * @method _uploadEventHandler"," * @param {Event} event The event object received from the XMLHTTPRequest."," * @protected"," */ "," _uploadEventHandler: function (event) {"," var xhr = this.get(\"xhr\");",""," switch (event.type) {"," case \"progress\":"," /**"," * Signals that progress has been made on the upload of this file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file (the file size)</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100.</dd>"," * </dl>"," */"," this.fire(\"uploadprogress\", {originEvent: event,"," bytesLoaded: event.loaded, "," bytesTotal: this.get(\"size\"), "," percentLoaded: Math.min(100, Math.round(10000*event.loaded/this.get(\"size\"))/100)"," });"," this._set(\"bytesUploaded\", event.loaded);"," break;",""," case \"load\":"," /**"," * Signals that this file's upload has completed and data has been received from the server."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * <dt>data</dt>"," * <dd>The data returned by the server.</dd>"," * </dl>"," */",""," if (xhr.status >= 200 && xhr.status <= 299) {"," this.fire(\"uploadcomplete\", {originEvent: event,"," data: event.target.responseText});"," var xhrupload = xhr.upload,"," boundEventHandler = this.get(\"boundEventHandler\");"," "," xhrupload.removeEventListener (\"progress\", boundEventHandler);"," xhrupload.removeEventListener (\"error\", boundEventHandler);"," xhrupload.removeEventListener (\"abort\", boundEventHandler);"," xhr.removeEventListener (\"load\", boundEventHandler); "," xhr.removeEventListener (\"error\", boundEventHandler);"," xhr.removeEventListener (\"readystatechange\", boundEventHandler);"," "," this._set(\"xhr\", null);"," }"," else {"," this.fire(\"uploaderror\", {originEvent: event,"," status: xhr.status,"," statusText: xhr.statusText,"," source: \"http\"});"," } "," break;",""," case \"error\":"," /**"," * Signals that this file's upload has encountered an error. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * <dt>status</dt>"," * <dd>The status code reported by the XMLHttpRequest. If it's an HTTP error,"," then this corresponds to the HTTP status code received by the uploader.</dd>"," * <dt>statusText</dt>"," * <dd>The text of the error event reported by the XMLHttpRequest instance</dd>"," * <dt>source</dt>"," * <dd>Either \"http\" (if it's an HTTP error), or \"io\" (if it's a network transmission "," * error.)</dd>"," *"," * </dl>"," */"," this.fire(\"uploaderror\", {originEvent: event,"," status: xhr.status,"," statusText: xhr.statusText,"," source: \"io\"});"," break;",""," case \"abort\":",""," /**"," * Signals that this file's upload has been cancelled. "," *"," * @event uploadcancel"," * @param event {Event} The event object for the `uploadcancel` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * </dl>"," */"," this.fire(\"uploadcancel\", {originEvent: event});"," break;",""," case \"readystatechange\":",""," /**"," * Signals that XMLHttpRequest has fired a readystatechange event. "," *"," * @event readystatechange"," * @param event {Event} The event object for the `readystatechange` with the"," * following payload:"," * <dl>"," * <dt>readyState</dt>"," * <dd>The readyState code reported by the XMLHttpRequest instance.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the XMLHttpRequest instance.</dd>"," * </dl>"," */"," this.fire(\"readystatechange\", {readyState: event.target.readyState,"," originEvent: event});"," break;"," }"," },",""," /**"," * Starts the upload of a specific file."," *"," * @method startUpload"," * @param url {String} The URL to upload the file to."," * @param parameters {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param fileFieldName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," */"," startUpload: function(url, parameters, fileFieldName) {"," "," this._set(\"bytesUploaded\", 0);"," "," this._set(\"xhr\", new XMLHttpRequest());"," this._set(\"boundEventHandler\", Bind(this._uploadEventHandler, this));"," "," var uploadData = new FormData(),"," fileField = fileFieldName || \"Filedata\","," xhr = this.get(\"xhr\"),"," xhrupload = this.get(\"xhr\").upload,"," boundEventHandler = this.get(\"boundEventHandler\");",""," Y.each(parameters, function (value, key) {uploadData.append(key, value);});"," uploadData.append(fileField, this.get(\"file\"));","","","",""," xhr.addEventListener (\"loadstart\", boundEventHandler, false);"," xhrupload.addEventListener (\"progress\", boundEventHandler, false);"," xhr.addEventListener (\"load\", boundEventHandler, false);"," xhr.addEventListener (\"error\", boundEventHandler, false);"," xhrupload.addEventListener (\"error\", boundEventHandler, false);"," xhrupload.addEventListener (\"abort\", boundEventHandler, false);"," xhr.addEventListener (\"abort\", boundEventHandler, false);"," xhr.addEventListener (\"loadend\", boundEventHandler, false); "," xhr.addEventListener (\"readystatechange\", boundEventHandler, false);",""," xhr.open(\"POST\", url, true);",""," xhr.withCredentials = this.get(\"xhrWithCredentials\");",""," Y.each(this.get(\"xhrHeaders\"), function (value, key) {"," xhr.setRequestHeader(key, value);"," });",""," xhr.send(uploadData);"," "," /**"," * Signals that this file's upload has started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart` with the"," * following payload:"," * <dl>"," * <dt>xhr</dt>"," * <dd>The XMLHttpRequest instance handling the file upload.</dd>"," * </dl>"," */"," this.fire(\"uploadstart\", {xhr: xhr});",""," },",""," /**"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancelUpload"," */ "," cancelUpload: function () {"," this.get('xhr').abort();"," }","",""," }, {",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'file'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'file',",""," /**"," * The type of transport."," *"," * @property TYPE"," * @type String"," * @default 'html5'"," * @readOnly"," * @protected"," * @static"," */"," TYPE: 'html5',",""," /**"," * Static property used to define the default attribute configuration of"," * the File."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A String containing the unique id of the file wrapped by the FileFlash instance."," * The id is supplied by the Flash player uploader."," *"," * @attribute id"," * @type {String}"," * @initOnly"," */"," id: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The size of the file wrapped by FileHTML5. This value is supplied by the instance of File()."," *"," * @attribute size"," * @type {Number}"," * @initOnly"," */"," size: {"," writeOnce: \"initOnly\","," value: 0"," },",""," /**"," * The name of the file wrapped by FileHTML5. This value is supplied by the instance of File()."," *"," * @attribute name"," * @type {String}"," * @initOnly"," */"," name: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileHTML5 was created on. This value is supplied by the instance of File()."," *"," * @attribute dateCreated"," * @type {Date}"," * @initOnly"," * @default null"," */"," dateCreated: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The date that the file wrapped by FileHTML5 was last modified on. This value is supplied by the instance of File()."," *"," * @attribute dateModified"," * @type {Date}"," * @initOnly"," */"," dateModified: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The number of bytes of the file that has been uploaded to the server. This value is"," * non-zero only while a file is being uploaded."," *"," * @attribute bytesUploaded"," * @type {Date}"," * @readOnly"," */"," bytesUploaded: {"," readOnly: true,"," value: 0"," },",""," /**"," * The type of the file wrapped by FileHTML. This value is provided by the instance of File()"," *"," * @attribute type"," * @type {String}"," * @initOnly"," */"," type: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The pointer to the instance of File() wrapped by FileHTML5."," *"," * @attribute file"," * @type {File}"," * @initOnly"," */"," file: {"," writeOnce: \"initOnly\","," value: null"," },",""," /**"," * The pointer to the instance of XMLHttpRequest used by FileHTML5 to upload the file."," *"," * @attribute xhr"," * @type {XMLHttpRequest}"," * @initOnly"," */"," xhr: {"," readOnly: true,"," value: null"," },",""," /**"," * The dictionary of headers that should be set on the XMLHttpRequest object before"," * sending it."," *"," * @attribute xhrHeaders"," * @type {Object}"," * @initOnly"," */"," xhrHeaders: {"," value: {}"," },",""," /**"," * A Boolean indicating whether the XMLHttpRequest should be sent with user credentials."," * This does not affect same-site requests. "," *"," * @attribute xhrWithCredentials"," * @type {Boolean}"," * @initOnly"," */"," xhrWithCredentials: {"," value: true"," },",""," /**"," * The bound event handler used to handle events from XMLHttpRequest."," *"," * @attribute boundEventHandler"," * @type {Function}"," * @initOnly"," */"," boundEventHandler: {"," readOnly: true,"," value: null"," }"," },",""," /**"," * Checks whether a specific native file instance is valid"," *"," * @method isValidFile"," * @param file {File} A native File() instance."," * @static"," */"," isValidFile: function (file) {"," return (Win && Win.File && file instanceof File);"," },",""," /**"," * Checks whether the browser has a native upload capability"," * via XMLHttpRequest Level 2."," *"," * @method canUpload"," * @static"," */"," canUpload: function () {"," return (Win && Win.FormData && Win.XMLHttpRequest);"," }"," });",""," Y.FileHTML5 = FileHTML5;","","}, '3.7.3', {\"requires\": [\"base\"]});"]; _yuitest_coverage["build/file-html5/file-html5.js"].lines = {"1":0,"16":0,"20":0,"22":0,"24":0,"25":0,"27":0,"28":0,"31":0,"34":0,"36":0,"37":0,"38":0,"41":0,"42":0,"45":0,"46":0,"49":0,"50":0,"53":0,"54":0,"60":0,"69":0,"70":0,"82":0,"84":0,"103":0,"108":0,"109":0,"126":0,"127":0,"129":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"139":0,"142":0,"147":0,"170":0,"174":0,"189":0,"190":0,"207":0,"209":0,"223":0,"225":0,"226":0,"228":0,"234":0,"235":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"250":0,"252":0,"254":0,"255":0,"258":0,"271":0,"281":0,"478":0,"489":0,"493":0}; _yuitest_coverage["build/file-html5/file-html5.js"].functions = {"FileHTML5:20":0,"initializer:68":0,"_uploadEventHandler:81":0,"(anonymous 2):234":0,"(anonymous 3):254":0,"startUpload:221":0,"cancelUpload:280":0,"isValidFile:477":0,"canUpload:488":0,"(anonymous 1):1":0}; _yuitest_coverage["build/file-html5/file-html5.js"].coveredLines = 72;@@ -613,4 +613,4 @@ _yuitest_coverline("build/file-html5/file-html5.js", 493); Y.FileHTML5 = FileHTML5; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/file-html5/file-html5-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -498,4 +498,4 @@ Y.FileHTML5 = FileHTML5; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/file-html5/file-html5-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("file-html5",function(e,t){var n=e.Lang,r=e.bind,i=e.config.win,s=function(e){var t=null;s.isValidFile(e)?t=e:s.isValidFile(e.file)?t=e.file:t=!1,s.superclass.constructor.apply(this,arguments),t&&s.canUpload()&&(this.get("file")||this._set("file",t),this.get("name")||this._set("name",t.name||t.fileName),this.get("size")!=(t.size||t.fileSize)&&this._set("size",t.size||t.fileSize),this.get("type")||this._set("type",t.type),t.hasOwnProperty("lastModifiedDate")&&!this.get("dateModified")&&this._set("dateModified",t.lastModifiedDate))};e.extend(s,e.Base,{initializer:function(t){this.get("id")||this._set("id",e.guid("file"))},_uploadEventHandler:function(e){var t=this.get("xhr");switch(e.type){case"progress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.loaded,bytesTotal:this.get("size"),percentLoaded:Math.min(100,Math.round(1e4*e.loaded/this.get("size"))/100)}),this._set("bytesUploaded",e.loaded);break;case"load":if(t.status>=200&&t.status<=299){this.fire("uploadcomplete",{originEvent:e,data:e.target.responseText});var n=t.upload,r=this.get("boundEventHandler");n.removeEventListener("progress",r),n.removeEventListener("error",r),n.removeEventListener("abort",r),t.removeEventListener("load",r),t.removeEventListener("error",r),t.removeEventListener("readystatechange",r),this._set("xhr",null)}else this.fire("uploaderror",{originEvent:e,status:t.status,statusText:t.statusText,source:"http"});break;case"error":this.fire("uploaderror",{originEvent:e,status:t.status,statusText:t.statusText,source:"io"});break;case"abort":this.fire("uploadcancel",{originEvent:e});break;case"readystatechange":this.fire("readystatechange",{readyState:e.target.readyState,originEvent:e})}},startUpload:function(t,n,i){this._set("bytesUploaded",0),this._set("xhr",new XMLHttpRequest),this._set("boundEventHandler",r(this._uploadEventHandler,this));var s=new FormData,o=i||"Filedata",u=this.get("xhr"),a=this.get("xhr").upload,f=this.get("boundEventHandler");e.each(n,function(e,t){s.append(t,e)}),s.append(o,this.get("file")),u.addEventListener("loadstart",f,!1),a.addEventListener("progress",f,!1),u.addEventListener("load",f,!1),u.addEventListener("error",f,!1),a.addEventListener("error",f,!1),a.addEventListener("abort",f,!1),u.addEventListener("abort",f,!1),u.addEventListener("loadend",f,!1),u.addEventListener("readystatechange",f,!1),u.open("POST",t,!0),u.withCredentials=this.get("xhrWithCredentials"),e.each(this.get("xhrHeaders"),function(e,t){u.setRequestHeader(t,e)}),u.send(s),this.fire("uploadstart",{xhr:u})},cancelUpload:function(){this.get("xhr").abort()}},{NAME:"file",TYPE:"html5",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},file:{writeOnce:"initOnly",value:null},xhr:{readOnly:!0,value:null},xhrHeaders:{value:{}},xhrWithCredentials:{value:!0},boundEventHandler:{readOnly:!0,value:null}},isValidFile:function(e){return i&&i.File&&e instanceof File},canUpload:function(){return i&&i.FormData&&i.XMLHttpRequest}}),e.FileHTML5=s},"3.7.2",{requires:["base"]});+YUI.add("file-html5",function(e,t){var n=e.Lang,r=e.bind,i=e.config.win,s=function(e){var t=null;s.isValidFile(e)?t=e:s.isValidFile(e.file)?t=e.file:t=!1,s.superclass.constructor.apply(this,arguments),t&&s.canUpload()&&(this.get("file")||this._set("file",t),this.get("name")||this._set("name",t.name||t.fileName),this.get("size")!=(t.size||t.fileSize)&&this._set("size",t.size||t.fileSize),this.get("type")||this._set("type",t.type),t.hasOwnProperty("lastModifiedDate")&&!this.get("dateModified")&&this._set("dateModified",t.lastModifiedDate))};e.extend(s,e.Base,{initializer:function(t){this.get("id")||this._set("id",e.guid("file"))},_uploadEventHandler:function(e){var t=this.get("xhr");switch(e.type){case"progress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.loaded,bytesTotal:this.get("size"),percentLoaded:Math.min(100,Math.round(1e4*e.loaded/this.get("size"))/100)}),this._set("bytesUploaded",e.loaded);break;case"load":if(t.status>=200&&t.status<=299){this.fire("uploadcomplete",{originEvent:e,data:e.target.responseText});var n=t.upload,r=this.get("boundEventHandler");n.removeEventListener("progress",r),n.removeEventListener("error",r),n.removeEventListener("abort",r),t.removeEventListener("load",r),t.removeEventListener("error",r),t.removeEventListener("readystatechange",r),this._set("xhr",null)}else this.fire("uploaderror",{originEvent:e,status:t.status,statusText:t.statusText,source:"http"});break;case"error":this.fire("uploaderror",{originEvent:e,status:t.status,statusText:t.statusText,source:"io"});break;case"abort":this.fire("uploadcancel",{originEvent:e});break;case"readystatechange":this.fire("readystatechange",{readyState:e.target.readyState,originEvent:e})}},startUpload:function(t,n,i){this._set("bytesUploaded",0),this._set("xhr",new XMLHttpRequest),this._set("boundEventHandler",r(this._uploadEventHandler,this));var s=new FormData,o=i||"Filedata",u=this.get("xhr"),a=this.get("xhr").upload,f=this.get("boundEventHandler");e.each(n,function(e,t){s.append(t,e)}),s.append(o,this.get("file")),u.addEventListener("loadstart",f,!1),a.addEventListener("progress",f,!1),u.addEventListener("load",f,!1),u.addEventListener("error",f,!1),a.addEventListener("error",f,!1),a.addEventListener("abort",f,!1),u.addEventListener("abort",f,!1),u.addEventListener("loadend",f,!1),u.addEventListener("readystatechange",f,!1),u.open("POST",t,!0),u.withCredentials=this.get("xhrWithCredentials"),e.each(this.get("xhrHeaders"),function(e,t){u.setRequestHeader(t,e)}),u.send(s),this.fire("uploadstart",{xhr:u})},cancelUpload:function(){this.get("xhr").abort()}},{NAME:"file",TYPE:"html5",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},file:{writeOnce:"initOnly",value:null},xhr:{readOnly:!0,value:null},xhrHeaders:{value:{}},xhrWithCredentials:{value:!0},boundEventHandler:{readOnly:!0,value:null}},isValidFile:function(e){return i&&i.File&&e instanceof File},canUpload:function(){return i&&i.FormData&&i.XMLHttpRequest}}),e.FileHTML5=s},"3.7.3",{requires:["base"]});
bundle/file-html5/file-html5.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -498,4 +498,4 @@ Y.FileHTML5 = FileHTML5; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/file/file-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/file/file.js", code: [] };-_yuitest_coverage["build/file/file.js"].code=["YUI.add('file', function (Y, NAME) {",""," /**"," * The File class provides a wrapper for a file pointer, either through an HTML5 "," * implementation or as a reference to a file pointer stored in Flash. The File wrapper "," * also implements the mechanics for uploading a file and tracking its progress."," * @module file"," * @main file"," * @since 3.5.0"," */ ",""," /**"," * `Y.File` serves as an alias for either <a href=\"FileFlash.html\">`Y.FileFlash`</a>"," * or <a href=\"FileHTML5.html\">`Y.FileHTML5`</a>, depending on the feature set available"," * in a specific browser."," *"," * @class File"," */",""," var Win = Y.config.win;",""," if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {"," Y.File = Y.FileHTML5;"," }",""," else {"," Y.File = Y.FileFlash;"," }","","}, '3.7.2', {\"requires\": [\"file-flash\", \"file-html5\"]});"];+_yuitest_coverage["build/file/file.js"].code=["YUI.add('file', function (Y, NAME) {",""," /**"," * The File class provides a wrapper for a file pointer, either through an HTML5 "," * implementation or as a reference to a file pointer stored in Flash. The File wrapper "," * also implements the mechanics for uploading a file and tracking its progress."," * @module file"," * @main file"," * @since 3.5.0"," */ ",""," /**"," * `Y.File` serves as an alias for either <a href=\"FileFlash.html\">`Y.FileFlash`</a>"," * or <a href=\"FileHTML5.html\">`Y.FileHTML5`</a>, depending on the feature set available"," * in a specific browser."," *"," * @class File"," */",""," var Win = Y.config.win;",""," if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {"," Y.File = Y.FileHTML5;"," }",""," else {"," Y.File = Y.FileFlash;"," }","","}, '3.7.3', {\"requires\": [\"file-flash\", \"file-html5\"]});"]; _yuitest_coverage["build/file/file.js"].lines = {"1":0,"20":0,"22":0,"23":0,"27":0}; _yuitest_coverage["build/file/file.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/file/file.js"].coveredLines = 5;@@ -72,4 +72,4 @@ Y.File = Y.FileFlash; } -}, '3.7.2', {"requires": ["file-flash", "file-html5"]});+}, '3.7.3', {"requires": ["file-flash", "file-html5"]});
bundle/file/file-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -33,4 +33,4 @@ Y.File = Y.FileFlash; } -}, '3.7.2', {"requires": ["file-flash", "file-html5"]});+}, '3.7.3', {"requires": ["file-flash", "file-html5"]});
bundle/file/file-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("file",function(e,t){var n=e.config.win;n&&n.File&&n.FormData&&n.XMLHttpRequest?e.File=e.FileHTML5:e.File=e.FileFlash},"3.7.2",{requires:["file-flash","file-html5"]});+YUI.add("file",function(e,t){var n=e.config.win;n&&n.File&&n.FormData&&n.XMLHttpRequest?e.File=e.FileHTML5:e.File=e.FileFlash},"3.7.3",{requires:["file-flash","file-html5"]});
bundle/file/file.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -33,4 +33,4 @@ Y.File = Y.FileFlash; } -}, '3.7.2', {"requires": ["file-flash", "file-html5"]});+}, '3.7.3', {"requires": ["file-flash", "file-html5"]});
bundle/frame/frame-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,15 +32,15 @@ path: "build/frame/frame.js", code: [] };-_yuitest_coverage["build/frame/frame.js"].code=["YUI.add('frame', function (Y, NAME) {","",""," /**"," * Creates a wrapper around an iframe. It loads the content either from a local"," * file or from script and creates a local YUI instance bound to that new window and document."," * @class Frame"," * @for Frame"," * @extends Base"," * @constructor"," * @module editor"," * @submodule frame"," */",""," var Frame = function() {"," Frame.superclass.constructor.apply(this, arguments);"," }, LAST_CHILD = ':last-child', BODY = 'body';"," ",""," Y.extend(Frame, Y.Base, {"," /**"," * @private"," * @property _ready"," * @description Internal reference set when the content is ready."," * @type Boolean"," */"," _ready: null,"," /**"," * @private"," * @property _rendered"," * @description Internal reference set when render is called."," * @type Boolean"," */"," _rendered: null,"," /**"," * @private"," * @property _iframe"," * @description Internal Node reference to the iFrame or the window"," * @type Node"," */"," _iframe: null,"," /**"," * @private"," * @property _instance"," * @description Internal reference to the YUI instance bound to the iFrame or window"," * @type YUI"," */"," _instance: null,"," /**"," * @private"," * @method _create"," * @description Create the iframe or Window and get references to the Document & Window"," * @return {Object} Hash table containing references to the new Document & Window"," */"," _create: function(cb) {"," var win, doc, res, node, html = '',"," extra_css = ((this.get('extracss')) ? '<style id=\"extra_css\">' + this.get('extracss') + '</style>' : '');"," "," this._iframe = Y.Node.create(Frame.HTML);"," this._iframe.setStyle('visibility', 'hidden');"," this._iframe.set('src', this.get('src'));"," this.get('container').append(this._iframe);",""," //if the src attr is different than the default, don't create the document"," var create = (this.get('src') === Frame.ATTRS.src.value);",""," this._iframe.set('height', '99%');",""," if (create) {"," html = Y.Lang.sub(Frame.PAGE_HTML, {"," DIR: this.get('dir'),"," LANG: this.get('lang'),"," TITLE: this.get('title'),"," META: Frame.META,"," LINKED_CSS: this.get('linkedcss'),"," CONTENT: this.get('content'),"," BASE_HREF: this.get('basehref'),"," DEFAULT_CSS: Frame.DEFAULT_CSS,"," EXTRA_CSS: extra_css"," });"," if (Y.config.doc.compatMode != 'BackCompat') {"," "," //html = Frame.DOC_TYPE + \"\\n\" + html;"," html = Frame.getDocType() + \"\\n\" + html;"," } else {"," }",""," }",""," res = this._resolveWinDoc();",""," if (html) {"," res.doc.open();"," res.doc.write(html);"," res.doc.close();"," }",""," if (!res.doc.documentElement) {"," var timer = Y.later(1, this, function() {"," if (res.doc && res.doc.documentElement) {"," cb(res);"," timer.cancel();"," }"," }, null, true);"," } else {"," cb(res);"," }",""," },"," /**"," * @private"," * @method _resolveWinDoc"," * @description Resolves the document and window from an iframe or window instance"," * @param {Object} c The YUI Config to add the window and document to"," * @return {Object} Object hash of window and document references, if a YUI config was passed, it is returned."," */"," _resolveWinDoc: function(c) {"," var config = (c) ? c : {};"," config.win = Y.Node.getDOMNode(this._iframe.get('contentWindow'));"," config.doc = Y.Node.getDOMNode(this._iframe.get('contentWindow.document'));"," if (!config.doc) {"," config.doc = Y.config.doc;"," }"," if (!config.win) {"," config.win = Y.config.win;"," }"," return config;"," },"," /**"," * @private"," * @method _onDomEvent"," * @description Generic handler for all DOM events fired by the iframe or window. This handler"," * takes the current EventFacade and augments it to fire on the Frame host. It adds two new properties"," * to the EventFacade called frameX and frameY which adds the scroll and xy position of the iframe"," * to the original pageX and pageY of the event so external nodes can be positioned over the frame."," * @param {Event.Facade} e"," */"," _onDomEvent: function(e) {"," var xy, node;"," "," if (!Y.Node.getDOMNode(this._iframe)) {"," //The iframe is null for some reason, bail on sending events."," return;"," }",""," e.frameX = e.frameY = 0;",""," if (e.pageX > 0 || e.pageY > 0) {"," if (e.type.substring(0, 3) !== 'key') {"," node = this._instance.one('win');"," xy = this._iframe.getXY();"," e.frameX = xy[0] + e.pageX - node.get('scrollLeft');"," e.frameY = xy[1] + e.pageY - node.get('scrollTop');"," }"," }",""," e.frameTarget = e.target;"," e.frameCurrentTarget = e.currentTarget;"," e.frameEvent = e;",""," this.fire('dom:' + e.type, e);"," },"," initializer: function() {"," this.publish('ready', {"," emitFacade: true,"," defaultFn: this._defReadyFn"," });"," },"," destructor: function() {"," var inst = this.getInstance();",""," inst.one('doc').detachAll();"," inst = null;"," this._iframe.remove();"," },"," /**"," * @private"," * @method _DOMPaste"," * @description Simple pass thru handler for the paste event so we can do content cleanup"," * @param {Event.Facade} e"," */"," _DOMPaste: function(e) {"," var inst = this.getInstance(),"," data = '', win = inst.config.win;",""," if (e._event.originalTarget) {"," data = e._event.originalTarget;"," }"," if (e._event.clipboardData) {"," data = e._event.clipboardData.getData('Text');"," }"," "," if (win.clipboardData) {"," data = win.clipboardData.getData('Text');"," if (data === '') { // Could be empty, or failed"," // Verify failure"," if (!win.clipboardData.setData('Text', data)) {"," data = null;"," }"," }"," }"," ",""," e.frameTarget = e.target;"," e.frameCurrentTarget = e.currentTarget;"," e.frameEvent = e;"," "," if (data) {"," e.clipboardData = {"," data: data,"," getData: function() {"," return data;"," }"," };"," } else {"," e.clipboardData = null;"," }",""," this.fire('dom:paste', e);"," },"," /**"," * @private"," * @method _defReadyFn"," * @description Binds DOM events, sets the iframe to visible and fires the ready event"," */"," _defReadyFn: function() {"," var inst = this.getInstance();",""," Y.each(Frame.DOM_EVENTS, function(v, k) {"," var fn = Y.bind(this._onDomEvent, this),"," kfn = ((Y.UA.ie && Frame.THROTTLE_TIME > 0) ? Y.throttle(fn, Frame.THROTTLE_TIME) : fn);",""," if (!inst.Node.DOM_EVENTS[k]) {"," inst.Node.DOM_EVENTS[k] = 1;"," }"," if (v === 1) {"," if (k !== 'focus' && k !== 'blur' && k !== 'paste') {"," if (k.substring(0, 3) === 'key') {"," //Throttle key events in IE"," inst.on(k, kfn, inst.config.doc);"," } else {"," inst.on(k, fn, inst.config.doc);"," }"," }"," }"," }, this);",""," inst.Node.DOM_EVENTS.paste = 1;"," "," inst.on('paste', Y.bind(this._DOMPaste, this), inst.one('body'));",""," //Adding focus/blur to the window object"," inst.on('focus', Y.bind(this._onDomEvent, this), inst.config.win);"," inst.on('blur', Y.bind(this._onDomEvent, this), inst.config.win);",""," inst.__use = inst.use;"," inst.use = Y.bind(this.use, this);"," this._iframe.setStyles({"," visibility: 'inherit'"," });"," inst.one('body').setStyle('display', 'block');"," if (Y.UA.ie) {"," //this._fixIECursors();"," }"," },"," /**"," * It appears that having a BR tag anywhere in the source \"below\" a table with a percentage width (in IE 7 & 8)"," * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally "," * spike. This method finds all <BR>'s below the sourceIndex of the first table. Does some checks to see if they"," * can be modified and replaces then with a <WBR> so the layout will remain in tact, but the flickering will"," * no longer happen."," * @method _fixIECursors"," * @private"," */"," _fixIECursors: function() {"," var inst = this.getInstance(),"," tables = inst.all('table'),"," brs = inst.all('br'), si;",""," if (tables.size() && brs.size()) {"," //First Table"," si = tables.item(0).get('sourceIndex');"," brs.each(function(n) {"," var p = n.get('parentNode'),"," c = p.get('children'), b = p.all('>br');"," "," if (p.test('div')) {"," if (c.size() > 2) {"," n.replace(inst.Node.create('<wbr>'));"," } else {"," if (n.get('sourceIndex') > si) {"," if (b.size()) {"," n.replace(inst.Node.create('<wbr>'));"," }"," } else {"," if (b.size() > 1) {"," n.replace(inst.Node.create('<wbr>'));"," }"," }"," }"," }"," "," });"," }"," },"," /**"," * @private"," * @method _onContentReady"," * @description Called once the content is available in the frame/window and calls the final use call"," * on the internal instance so that the modules are loaded properly."," */"," _onContentReady: function(e) {"," if (!this._ready) {"," this._ready = true;"," var inst = this.getInstance(),"," args = Y.clone(this.get('use'));"," "," this.fire('contentready');",""," if (e) {"," inst.config.doc = Y.Node.getDOMNode(e.target);"," }"," //TODO Circle around and deal with CSS loading..."," args.push(Y.bind(function() {"," if (inst.EditorSelection) {"," inst.EditorSelection.DEFAULT_BLOCK_TAG = this.get('defaultblock');"," }"," //Moved to here so that the iframe is ready before allowing editing.."," if (this.get('designMode')) {"," if(Y.UA.ie) {"," inst.config.doc.body.contentEditable = 'true';"," this._ieSetBodyHeight();"," inst.on('keyup', Y.bind(this._ieSetBodyHeight, this), inst.config.doc);"," } else {"," inst.config.doc.designMode = 'on';"," }"," }"," this.fire('ready');"," }, this));"," inst.use.apply(inst, args);",""," inst.one('doc').get('documentElement').addClass('yui-js-enabled');"," }"," },"," _ieHeightCounter: null,"," /**"," * Internal method to set the height of the body to the height of the document in IE."," * With contenteditable being set, the document becomes unresponsive to clicks, this "," * method expands the body to be the height of the document so that doesn't happen."," * @private"," * @method _ieSetBodyHeight"," */"," _ieSetBodyHeight: function(e) {"," if (!this._ieHeightCounter) {"," this._ieHeightCounter = 0;"," }"," this._ieHeightCounter++;"," var run = false;"," if (!e) {"," run = true;"," }"," if (e) {"," switch (e.keyCode) {"," case 8:"," case 13:"," run = true;"," break;"," }"," if (e.ctrlKey || e.shiftKey) {"," run = true;"," }"," }"," if (run) {"," try {"," var inst = this.getInstance();"," var h = this._iframe.get('offsetHeight');"," var bh = inst.config.doc.body.scrollHeight;"," if (h > bh) {"," h = (h - 15) + 'px';"," inst.config.doc.body.style.height = h;"," } else {"," inst.config.doc.body.style.height = 'auto';"," }"," } catch (e) {"," if (this._ieHeightCounter < 100) {"," Y.later(200, this, this._ieSetBodyHeight);"," } else {"," }"," }"," }"," },"," /**"," * @private"," * @method _resolveBaseHref"," * @description Resolves the basehref of the page the frame is created on. Only applies to dynamic content."," * @param {String} href The new value to use, if empty it will be resolved from the current url."," * @return {String}"," */"," _resolveBaseHref: function(href) {"," if (!href || href === '') {"," href = Y.config.doc.location.href;"," if (href.indexOf('?') !== -1) { //Remove the query string"," href = href.substring(0, href.indexOf('?'));"," }"," href = href.substring(0, href.lastIndexOf('/')) + '/';"," }"," return href;"," },"," /**"," * @private"," * @method _getHTML"," * @description Get the content from the iframe"," * @param {String} html The raw HTML from the body of the iframe."," * @return {String}"," */"," _getHTML: function(html) {"," if (this._ready) {"," var inst = this.getInstance();"," html = inst.one('body').get('innerHTML');"," }"," return html;"," },"," /**"," * @private"," * @method _setHTML"," * @description Set the content of the iframe"," * @param {String} html The raw HTML to set the body of the iframe to."," * @return {String}"," */"," _setHTML: function(html) {"," if (this._ready) {"," var inst = this.getInstance();"," inst.one('body').set('innerHTML', html);"," } else {"," //This needs to be wrapped in a contentready callback for the !_ready state"," this.on('contentready', Y.bind(function(html, e) {"," var inst = this.getInstance();"," inst.one('body').set('innerHTML', html);"," }, this, html));"," }"," return html;"," },"," /**"," * @private"," * @method _setLinkedCSS"," * @description Set's the linked CSS on the instance.."," */"," _getLinkedCSS: function(urls) {"," if (!Y.Lang.isArray(urls)) {"," urls = [urls];"," }"," var str = '';"," if (!this._ready) {"," Y.each(urls, function(v) {"," if (v !== '') {"," str += '<link rel=\"stylesheet\" href=\"' + v + '\" type=\"text/css\">';"," }"," });"," } else {"," str = urls;"," }"," return str;"," },"," /**"," * @private"," * @method _setLinkedCSS"," * @description Set's the linked CSS on the instance.."," */"," _setLinkedCSS: function(css) {"," if (this._ready) {"," var inst = this.getInstance();"," inst.Get.css(css);"," }"," return css;"," },"," /**"," * @private"," * @method _setExtraCSS"," * @description Set's the extra CSS on the instance.."," */"," _setExtraCSS: function(css) {"," if (this._ready) {"," var inst = this.getInstance(),"," node = inst.one('#extra_css');"," "," node.remove();"," inst.one('head').append('<style id=\"extra_css\">' + css + '</style>');"," }"," return css;"," },"," /**"," * @private"," * @method _instanceLoaded"," * @description Called from the first YUI instance that sets up the internal instance."," * This loads the content into the window/frame and attaches the contentready event."," * @param {YUI} inst The internal YUI instance bound to the frame/window"," */"," _instanceLoaded: function(inst) {"," this._instance = inst;"," this._onContentReady();"," "," var doc = this._instance.config.doc;",""," if (this.get('designMode')) {"," if (!Y.UA.ie) {"," try {"," //Force other browsers into non CSS styling"," doc.execCommand('styleWithCSS', false, false);"," doc.execCommand('insertbronreturn', false, false);"," } catch (err) {}"," }"," }"," },"," //BEGIN PUBLIC METHODS"," /**"," * @method use"," * @description This is a scoped version of the normal YUI.use method & is bound to this frame/window."," * At setup, the inst.use method is mapped to this method."," */"," use: function() {"," var inst = this.getInstance(),"," args = Y.Array(arguments),"," cb = false;",""," if (Y.Lang.isFunction(args[args.length - 1])) {"," cb = args.pop();"," }"," if (cb) {"," args.push(function() {"," cb.apply(inst, arguments);",""," });"," }"," inst.__use.apply(inst, args);"," },"," /**"," * @method delegate"," * @description A delegate method passed to the instance's delegate method"," * @param {String} type The type of event to listen for"," * @param {Function} fn The method to attach"," * @param {String} cont The container to act as a delegate, if no \"sel\" passed, the body is assumed as the container."," * @param {String} sel The selector to match in the event (optional)"," * @return {EventHandle} The Event handle returned from Y.delegate"," */"," delegate: function(type, fn, cont, sel) {"," var inst = this.getInstance();"," if (!inst) {"," return false;"," }"," if (!sel) {"," sel = cont;"," cont = 'body';"," }"," return inst.delegate(type, fn, cont, sel);"," },"," /**"," * @method getInstance"," * @description Get a reference to the internal YUI instance."," * @return {YUI} The internal YUI instance"," */"," getInstance: function() {"," return this._instance;"," },"," /**"," * @method render"," * @description Render the iframe into the container config option or open the window."," * @param {String/HTMLElement/Node} node The node to render to"," * @return {Frame}"," * @chainable"," */"," render: function(node) {"," if (this._rendered) {"," return this;"," }"," this._rendered = true;"," if (node) {"," this.set('container', node);"," }",""," this._create(Y.bind(function(res) {",""," var inst, timer,"," cb = Y.bind(function(i) {"," this._instanceLoaded(i);"," }, this),"," args = Y.clone(this.get('use')),"," config = {"," debug: false,"," win: res.win,"," doc: res.doc"," },"," fn = Y.bind(function() {"," config = this._resolveWinDoc(config);"," inst = YUI(config);"," inst.host = this.get('host'); //Cross reference to Editor",""," try {"," inst.use('node-base', cb);"," if (timer) {"," clearInterval(timer);"," }"," } catch (e) {"," timer = setInterval(function() {"," fn();"," }, 350);"," }"," }, this);",""," args.push(fn);",""," Y.use.apply(Y, args);",""," }, this));",""," return this;"," },"," /**"," * @private"," * @method _handleFocus"," * @description Does some tricks on focus to set the proper cursor position."," */"," _handleFocus: function() {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection();",""," if (sel.anchorNode) {"," var n = sel.anchorNode, c;"," "," if (n.test('p') && n.get('innerHTML') === '') {"," n = n.get('parentNode');"," }"," c = n.get('childNodes');"," "," if (c.size()) {"," if (c.item(0).test('br')) {"," sel.selectNode(n, true, false);"," } else if (c.item(0).test('p')) {"," n = c.item(0).one('br.yui-cursor');"," if (n) {"," n = n.get('parentNode');"," }"," if (!n) {"," n = c.item(0).get('firstChild');"," }"," if (!n) {"," n = c.item(0);"," }"," if (n) {"," sel.selectNode(n, true, false);"," }"," } else {"," var b = inst.one('br.yui-cursor');"," if (b) {"," var par = b.get('parentNode');"," if (par) {"," sel.selectNode(par, true, false);"," }"," }"," }"," }"," }"," },"," /**"," * @method focus"," * @description Set the focus to the iframe"," * @param {Function} fn Callback function to execute after focus happens "," * @return {Frame}"," * @chainable "," */"," focus: function(fn) {"," if (Y.UA.ie && Y.UA.ie < 9) {"," try {"," Y.one('win').focus();"," if (this.getInstance()) {"," if (this.getInstance().one('win')) {"," this.getInstance().one('win').focus();"," }"," }"," } catch (ierr) {"," }"," if (fn === true) {"," this._handleFocus();"," }"," if (Y.Lang.isFunction(fn)) {"," fn();"," }"," } else {"," try {"," Y.one('win').focus();"," Y.later(100, this, function() {"," if (this.getInstance()) {"," if (this.getInstance().one('win')) {"," this.getInstance().one('win').focus();"," }"," }"," if (fn === true) {"," this._handleFocus();"," }"," if (Y.Lang.isFunction(fn)) {"," fn();"," }"," });"," } catch (ferr) {"," }"," }"," return this;"," },"," /**"," * @method show"," * @description Show the iframe instance"," * @return {Frame}"," * @chainable "," */"," show: function() {"," this._iframe.setStyles({"," position: 'static',"," left: ''"," });"," if (Y.UA.gecko) {"," try {"," if (this.getInstance()) {"," this.getInstance().config.doc.designMode = 'on';"," }"," } catch (e) { }"," this.focus();"," } "," return this;"," },"," /**"," * @method hide"," * @description Hide the iframe instance"," * @return {Frame}"," * @chainable "," */"," hide: function() {"," this._iframe.setStyles({"," position: 'absolute',"," left: '-999999px'"," });"," return this;"," }"," }, {"," /**"," * @static"," * @property THROTTLE_TIME"," * @description The throttle time for key events in IE"," * @type Number"," * @default 100"," */"," THROTTLE_TIME: 100,"," /**"," * @static"," * @property DOM_EVENTS"," * @description The DomEvents that the frame automatically attaches and bubbles"," * @type Object"," */"," DOM_EVENTS: {"," dblclick: 1,"," click: 1,"," paste: 1,"," mouseup: 1,"," mousedown: 1,"," keyup: 1,"," keydown: 1,"," keypress: 1,"," activate: 1,"," deactivate: 1,"," beforedeactivate: 1,"," focusin: 1,"," focusout: 1"," },",""," /**"," * @static"," * @property DEFAULT_CSS"," * @description The default css used when creating the document."," * @type String"," */"," //DEFAULT_CSS: '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; } img { cursor: pointer !important; border: none; }',"," DEFAULT_CSS: 'body { 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; } img { cursor: pointer !important; border: none; }',"," /**"," * @static"," * @property HTML"," * @description The template string used to create the iframe"," * @type String"," */"," //HTML: '<iframe border=\"0\" frameBorder=\"0\" marginWidth=\"0\" marginHeight=\"0\" leftMargin=\"0\" topMargin=\"0\" allowTransparency=\"true\" width=\"100%\" height=\"99%\"></iframe>',"," HTML: '<iframe border=\"0\" frameBorder=\"0\" marginWidth=\"0\" marginHeight=\"0\" leftMargin=\"0\" topMargin=\"0\" allowTransparency=\"true\" width=\"100%\" height=\"99%\"></iframe>',"," /**"," * @static"," * @property PAGE_HTML"," * @description The template used to create the page when created dynamically."," * @type String"," */"," PAGE_HTML: '<html dir=\"{DIR}\" lang=\"{LANG}\"><head><title>{TITLE}</title>{META}<base href=\"{BASE_HREF}\"/>{LINKED_CSS}<style id=\"editor_css\">{DEFAULT_CSS}</style>{EXTRA_CSS}</head><body>{CONTENT}</body></html>',",""," /**"," * @static"," * @method getDocType"," * @description Parses document.doctype and generates a DocType to match the parent page, if supported."," * For IE8, it grabs document.all[0].nodeValue and uses that. For IE < 8, it falls back to Frame.DOC_TYPE."," * @return {String} The normalized DocType to apply to the iframe"," */"," getDocType: function() {"," var dt = Y.config.doc.doctype,"," str = Frame.DOC_TYPE;",""," if (dt) {"," str = '<!DOCTYPE ' + dt.name + ((dt.publicId) ? ' ' + dt.publicId : '') + ((dt.systemId) ? ' ' + dt.systemId : '') + '>';"," } else {"," if (Y.config.doc.all) {"," dt = Y.config.doc.all[0];"," if (dt.nodeType) {"," if (dt.nodeType === 8) {"," if (dt.nodeValue) {"," if (dt.nodeValue.toLowerCase().indexOf('doctype') !== -1) {"," str = '<!' + dt.nodeValue + '>';"," }"," }"," }"," }"," }"," }"," return str;"," },"," /**"," * @static"," * @property DOC_TYPE"," * @description The DOCTYPE to prepend to the new document when created. Should match the one on the page being served."," * @type String"," */"," DOC_TYPE: '<!DOCTYPE HTML PUBLIC \"-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN\" \"http:/'+'/www.w3.org/TR/html4/strict.dtd\">',"," /**"," * @static"," * @property META"," * @description The meta-tag for Content-Type to add to the dynamic document"," * @type String"," */"," META: '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/><meta http-equiv=\"X-UA-Compatible\" content=\"IE=7\">',"," //META: '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>',"," /**"," * @static"," * @property NAME"," * @description The name of the class (frame)"," * @type String"," */"," NAME: 'frame',"," ATTRS: {"," /**"," * @attribute title"," * @description The title to give the blank page."," * @type String"," */"," title: {"," value: 'Blank Page'"," },"," /**"," * @attribute dir"," * @description The default text direction for this new frame. Default: ltr"," * @type String"," */"," dir: {"," value: 'ltr'"," },"," /**"," * @attribute lang"," * @description The default language. Default: en-US"," * @type String"," */"," lang: {"," value: 'en-US'"," },"," /**"," * @attribute src"," * @description The src of the iframe/window. Defaults to javascript:;"," * @type String"," */"," src: {"," //Hackish, IE needs the false in the Javascript URL"," value: 'javascript' + ((Y.UA.ie) ? ':false' : ':') + ';'"," },"," /**"," * @attribute designMode"," * @description Should designMode be turned on after creation."," * @writeonce"," * @type Boolean"," */"," designMode: {"," writeOnce: true,"," value: false"," },"," /**"," * @attribute content"," * @description The string to inject into the body of the new frame/window."," * @type String"," */"," content: {"," value: '<br>',"," setter: '_setHTML',"," getter: '_getHTML'"," },"," /**"," * @attribute basehref"," * @description The base href to use in the iframe."," * @type String"," */"," basehref: {"," value: false,"," getter: '_resolveBaseHref'"," },"," /**"," * @attribute use"," * @description Array of modules to include in the scoped YUI instance at render time. Default: ['none', 'selector-css2']"," * @writeonce"," * @type Array"," */"," use: {"," writeOnce: true,"," value: ['node', 'node-style', 'selector-css3']"," },"," /**"," * @attribute container"," * @description The container to append the iFrame to on render."," * @type String/HTMLElement/Node"," */"," container: {"," value: 'body',"," setter: function(n) {"," return Y.one(n);"," }"," },"," /**"," * @attribute node"," * @description The Node instance of the iframe."," * @type Node"," */"," node: {"," readOnly: true,"," value: null,"," getter: function() {"," return this._iframe;"," }"," },"," /**"," * @attribute id"," * @description Set the id of the new Node. (optional)"," * @type String"," * @writeonce"," */"," id: {"," writeOnce: true,"," getter: function(id) {"," if (!id) {"," id = 'iframe-' + Y.guid();"," }"," return id;"," }"," },"," /**"," * @attribute linkedcss"," * @description An array of url's to external linked style sheets"," * @type String"," */"," linkedcss: {"," value: '',"," getter: '_getLinkedCSS',"," setter: '_setLinkedCSS'"," },"," /**"," * @attribute extracss"," * @description A string of CSS to add to the Head of the Editor"," * @type String"," */"," extracss: {"," value: '',"," setter: '_setExtraCSS'"," },"," /**"," * @attribute host"," * @description A reference to the Editor instance "," * @type Object"," */"," host: {"," value: false"," },"," /**"," * @attribute defaultblock"," * @description The default tag to use for block level items, defaults to: p"," * @type String"," */ "," defaultblock: {"," value: 'p'"," }"," }"," });","",""," Y.Frame = Frame;","","","","}, '3.7.2', {\"requires\": [\"base\", \"node\", \"selector-css3\", \"yui-throttle\"]});"];-_yuitest_coverage["build/frame/frame.js"].lines = {"1":0,"15":0,"16":0,"20":0,"56":0,"59":0,"60":0,"61":0,"62":0,"65":0,"67":0,"69":0,"70":0,"81":0,"84":0,"90":0,"92":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"101":0,"102":0,"106":0,"118":0,"119":0,"120":0,"121":0,"122":0,"124":0,"125":0,"127":0,"139":0,"141":0,"143":0,"146":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"157":0,"158":0,"159":0,"161":0,"164":0,"170":0,"172":0,"173":0,"174":0,"183":0,"186":0,"187":0,"189":0,"190":0,"193":0,"194":0,"195":0,"197":0,"198":0,"204":0,"205":0,"206":0,"208":0,"209":0,"212":0,"216":0,"219":0,"227":0,"229":0,"230":0,"233":0,"234":0,"236":0,"237":0,"238":0,"240":0,"242":0,"248":0,"250":0,"253":0,"254":0,"256":0,"257":0,"258":0,"261":0,"262":0,"276":0,"280":0,"282":0,"283":0,"284":0,"287":0,"288":0,"289":0,"291":0,"292":0,"293":0,"296":0,"297":0,"313":0,"314":0,"315":0,"318":0,"320":0,"321":0,"324":0,"325":0,"326":0,"329":0,"330":0,"331":0,"332":0,"333":0,"335":0,"338":0,"340":0,"342":0,"354":0,"355":0,"357":0,"358":0,"359":0,"360":0,"362":0,"363":0,"366":0,"367":0,"369":0,"370":0,"373":0,"374":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"382":0,"385":0,"386":0,"400":0,"401":0,"402":0,"403":0,"405":0,"407":0,"417":0,"418":0,"419":0,"421":0,"431":0,"432":0,"433":0,"436":0,"437":0,"438":0,"441":0,"449":0,"450":0,"452":0,"453":0,"454":0,"455":0,"456":0,"460":0,"462":0,"470":0,"471":0,"472":0,"474":0,"482":0,"483":0,"486":0,"487":0,"489":0,"499":0,"500":0,"502":0,"504":0,"505":0,"506":0,"508":0,"509":0,"521":0,"525":0,"526":0,"528":0,"529":0,"530":0,"534":0,"546":0,"547":0,"548":0,"550":0,"551":0,"552":0,"554":0,"562":0,"572":0,"573":0,"575":0,"576":0,"577":0,"580":0,"582":0,"584":0,"593":0,"594":0,"595":0,"597":0,"598":0,"599":0,"600":0,"603":0,"604":0,"609":0,"611":0,"615":0,"623":0,"626":0,"627":0,"629":0,"630":0,"632":0,"634":0,"635":0,"636":0,"637":0,"638":0,"639":0,"640":0,"642":0,"643":0,"645":0,"646":0,"648":0,"649":0,"652":0,"653":0,"654":0,"655":0,"656":0,"671":0,"672":0,"673":0,"674":0,"675":0,"676":0,"681":0,"682":0,"684":0,"685":0,"688":0,"689":0,"690":0,"691":0,"692":0,"693":0,"696":0,"697":0,"699":0,"700":0,"706":0,"715":0,"719":0,"720":0,"721":0,"722":0,"725":0,"727":0,"736":0,"740":0,"805":0,"808":0,"809":0,"811":0,"812":0,"813":0,"814":0,"815":0,"816":0,"817":0,"824":0,"929":0,"941":0,"953":0,"954":0,"956":0,"998":0};-_yuitest_coverage["build/frame/frame.js"].functions = {"Frame:15":0,"(anonymous 2):99":0,"_create:55":0,"_resolveWinDoc:117":0,"_onDomEvent:138":0,"initializer:163":0,"destructor:169":0,"getData:211":0,"_DOMPaste:182":0,"(anonymous 3):229":0,"_defReadyFn:226":0,"(anonymous 4):283":0,"_fixIECursors:275":0,"(anonymous 5):324":0,"_onContentReady:312":0,"_ieSetBodyHeight:353":0,"_resolveBaseHref:399":0,"_getHTML:416":0,"(anonymous 6):436":0,"_setHTML:430":0,"(anonymous 7):454":0,"_getLinkedCSS:448":0,"_setLinkedCSS:469":0,"_setExtraCSS:481":0,"_instanceLoaded:498":0,"(anonymous 8):529":0,"use:520":0,"delegate:545":0,"getInstance:561":0,"(anonymous 10):583":0,"(anonymous 12):603":0,"(anonymous 11):592":0,"(anonymous 9):580":0,"render:571":0,"_handleFocus:622":0,"(anonymous 13):690":0,"focus:670":0,"show:714":0,"hide:735":0,"getDocType:804":0,"setter:928":0,"getter:940":0,"getter:952":0,"(anonymous 1):1":0};-_yuitest_coverage["build/frame/frame.js"].coveredLines = 293;+_yuitest_coverage["build/frame/frame.js"].code=["YUI.add('frame', function (Y, NAME) {",""," /*jshint maxlen: 500 */"," /**"," * Creates a wrapper around an iframe. It loads the content either from a local"," * file or from script and creates a local YUI instance bound to that new window and document."," * @class Frame"," * @for Frame"," * @extends Base"," * @constructor"," * @module editor"," * @submodule frame"," */",""," var Frame = function() {"," Frame.superclass.constructor.apply(this, arguments);"," };","",""," Y.extend(Frame, Y.Base, {"," /**"," * @private"," * @property _ready"," * @description Internal reference set when the content is ready."," * @type Boolean"," */"," _ready: null,"," /**"," * @private"," * @property _rendered"," * @description Internal reference set when render is called."," * @type Boolean"," */"," _rendered: null,"," /**"," * @private"," * @property _iframe"," * @description Internal Node reference to the iFrame or the window"," * @type Node"," */"," _iframe: null,"," /**"," * @private"," * @property _instance"," * @description Internal reference to the YUI instance bound to the iFrame or window"," * @type YUI"," */"," _instance: null,"," /**"," * @private"," * @method _create"," * @description Create the iframe or Window and get references to the Document & Window"," * @return {Object} Hash table containing references to the new Document & Window"," */"," _create: function(cb) {"," var res, html = '', timer,"," //if the src attr is different than the default, don't create the document"," create = (this.get('src') === Frame.ATTRS.src.value),"," extra_css = ((this.get('extracss')) ? '<style id=\"extra_css\">' + this.get('extracss') + '</style>' : '');"," "," this._iframe = Y.one(Y.config.doc.createElement('iframe'));"," this._iframe.setAttrs(Frame.IFRAME_ATTRS);",""," this._iframe.setStyle('visibility', 'hidden');"," this._iframe.set('src', this.get('src'));"," this.get('container').append(this._iframe);"," this._iframe.set('height', '99%');",""," if (create) {"," html = Y.Lang.sub(Frame.PAGE_HTML, {"," DIR: this.get('dir'),"," LANG: this.get('lang'),"," TITLE: this.get('title'),"," META: Frame.META,"," LINKED_CSS: this.get('linkedcss'),"," CONTENT: this.get('content'),"," BASE_HREF: this.get('basehref'),"," DEFAULT_CSS: Frame.DEFAULT_CSS,"," EXTRA_CSS: extra_css"," });"," if (Y.config.doc.compatMode !== 'BackCompat') {",""," //html = Frame.DOC_TYPE + \"\\n\" + html;"," html = Frame.getDocType() + \"\\n\" + html;"," } else {"," }",""," }",""," res = this._resolveWinDoc();",""," if (html) {"," res.doc.open();"," res.doc.write(html);"," res.doc.close();"," }",""," if (!res.doc.documentElement) {"," timer = Y.later(1, this, function() {"," if (res.doc && res.doc.documentElement) {"," cb(res);"," timer.cancel();"," }"," }, null, true);"," } else {"," cb(res);"," }",""," },"," /**"," * @private"," * @method _resolveWinDoc"," * @description Resolves the document and window from an iframe or window instance"," * @param {Object} c The YUI Config to add the window and document to"," * @return {Object} Object hash of window and document references, if a YUI config was passed, it is returned."," */"," _resolveWinDoc: function(c) {"," var config = (c) ? c : {};"," config.win = Y.Node.getDOMNode(this._iframe.get('contentWindow'));"," config.doc = Y.Node.getDOMNode(this._iframe.get('contentWindow.document'));"," if (!config.doc) {"," config.doc = Y.config.doc;"," }"," if (!config.win) {"," config.win = Y.config.win;"," }"," return config;"," },"," /**"," * @private"," * @method _onDomEvent"," * @description Generic handler for all DOM events fired by the iframe or window. This handler"," * takes the current EventFacade and augments it to fire on the Frame host. It adds two new properties"," * to the EventFacade called frameX and frameY which adds the scroll and xy position of the iframe"," * to the original pageX and pageY of the event so external nodes can be positioned over the frame."," * @param {Event.Facade} e"," */"," _onDomEvent: function(e) {"," var xy, node;",""," if (!Y.Node.getDOMNode(this._iframe)) {"," //The iframe is null for some reason, bail on sending events."," return;"," }",""," e.frameX = e.frameY = 0;",""," if (e.pageX > 0 || e.pageY > 0) {"," if (e.type.substring(0, 3) !== 'key') {"," node = this._instance.one('win');"," xy = this._iframe.getXY();"," e.frameX = xy[0] + e.pageX - node.get('scrollLeft');"," e.frameY = xy[1] + e.pageY - node.get('scrollTop');"," }"," }",""," e.frameTarget = e.target;"," e.frameCurrentTarget = e.currentTarget;"," e.frameEvent = e;",""," this.fire('dom:' + e.type, e);"," },"," initializer: function() {"," this.publish('ready', {"," emitFacade: true,"," defaultFn: this._defReadyFn"," });"," },"," destructor: function() {"," var inst = this.getInstance();",""," inst.one('doc').detachAll();"," inst = null;"," this._iframe.remove();"," },"," /**"," * @private"," * @method _DOMPaste"," * @description Simple pass thru handler for the paste event so we can do content cleanup"," * @param {Event.Facade} e"," */"," _DOMPaste: function(e) {"," var inst = this.getInstance(),"," data = '', win = inst.config.win;",""," if (e._event.originalTarget) {"," data = e._event.originalTarget;"," }"," if (e._event.clipboardData) {"," data = e._event.clipboardData.getData('Text');"," }",""," if (win.clipboardData) {"," data = win.clipboardData.getData('Text');"," if (data === '') { // Could be empty, or failed"," // Verify failure"," if (!win.clipboardData.setData('Text', data)) {"," data = null;"," }"," }"," }","",""," e.frameTarget = e.target;"," e.frameCurrentTarget = e.currentTarget;"," e.frameEvent = e;",""," if (data) {"," e.clipboardData = {"," data: data,"," getData: function() {"," return data;"," }"," };"," } else {"," e.clipboardData = null;"," }",""," this.fire('dom:paste', e);"," },"," /**"," * @private"," * @method _defReadyFn"," * @description Binds DOM events, sets the iframe to visible and fires the ready event"," */"," _defReadyFn: function() {"," var inst = this.getInstance();",""," Y.each(Frame.DOM_EVENTS, function(v, k) {"," var fn = Y.bind(this._onDomEvent, this),"," kfn = ((Y.UA.ie && Frame.THROTTLE_TIME > 0) ? Y.throttle(fn, Frame.THROTTLE_TIME) : fn);",""," if (!inst.Node.DOM_EVENTS[k]) {"," inst.Node.DOM_EVENTS[k] = 1;"," }"," if (v === 1) {"," if (k !== 'focus' && k !== 'blur' && k !== 'paste') {"," if (k.substring(0, 3) === 'key') {"," //Throttle key events in IE"," inst.on(k, kfn, inst.config.doc);"," } else {"," inst.on(k, fn, inst.config.doc);"," }"," }"," }"," }, this);",""," inst.Node.DOM_EVENTS.paste = 1;",""," inst.on('paste', Y.bind(this._DOMPaste, this), inst.one('body'));",""," //Adding focus/blur to the window object"," inst.on('focus', Y.bind(this._onDomEvent, this), inst.config.win);"," inst.on('blur', Y.bind(this._onDomEvent, this), inst.config.win);",""," inst.__use = inst.use;"," inst.use = Y.bind(this.use, this);"," this._iframe.setStyles({"," visibility: 'inherit'"," });"," inst.one('body').setStyle('display', 'block');"," },"," /**"," * It appears that having a BR tag anywhere in the source \"below\" a table with a percentage width (in IE 7 & 8)"," * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally"," * spike. This method finds all <BR>'s below the sourceIndex of the first table. Does some checks to see if they"," * can be modified and replaces then with a <WBR> so the layout will remain in tact, but the flickering will"," * no longer happen."," * @method _fixIECursors"," * @private"," */"," _fixIECursors: function() {"," var inst = this.getInstance(),"," tables = inst.all('table'),"," brs = inst.all('br'), si;",""," if (tables.size() && brs.size()) {"," //First Table"," si = tables.item(0).get('sourceIndex');"," brs.each(function(n) {"," var p = n.get('parentNode'),"," c = p.get('children'), b = p.all('>br');",""," if (p.test('div')) {"," if (c.size() > 2) {"," n.replace(inst.Node.create('<wbr>'));"," } else {"," if (n.get('sourceIndex') > si) {"," if (b.size()) {"," n.replace(inst.Node.create('<wbr>'));"," }"," } else {"," if (b.size() > 1) {"," n.replace(inst.Node.create('<wbr>'));"," }"," }"," }"," }",""," });"," }"," },"," /**"," * @private"," * @method _onContentReady"," * @description Called once the content is available in the frame/window and calls the final use call"," * on the internal instance so that the modules are loaded properly."," */"," _onContentReady: function(e) {"," if (!this._ready) {"," this._ready = true;"," var inst = this.getInstance(),"," args = Y.clone(this.get('use'));",""," this.fire('contentready');",""," if (e) {"," inst.config.doc = Y.Node.getDOMNode(e.target);"," }"," //TODO Circle around and deal with CSS loading..."," args.push(Y.bind(function() {"," if (inst.EditorSelection) {"," inst.EditorSelection.DEFAULT_BLOCK_TAG = this.get('defaultblock');"," }"," //Moved to here so that the iframe is ready before allowing editing.."," if (this.get('designMode')) {"," if(Y.UA.ie) {"," inst.config.doc.body.contentEditable = 'true';"," this._ieSetBodyHeight();"," inst.on('keyup', Y.bind(this._ieSetBodyHeight, this), inst.config.doc);"," } else {"," inst.config.doc.designMode = 'on';"," }"," }"," this.fire('ready');"," }, this));"," inst.use.apply(inst, args);",""," inst.one('doc').get('documentElement').addClass('yui-js-enabled');"," }"," },"," _ieHeightCounter: null,"," /**"," * Internal method to set the height of the body to the height of the document in IE."," * With contenteditable being set, the document becomes unresponsive to clicks, this"," * method expands the body to be the height of the document so that doesn't happen."," * @private"," * @method _ieSetBodyHeight"," */"," _ieSetBodyHeight: function(e) {"," if (!this._ieHeightCounter) {"," this._ieHeightCounter = 0;"," }"," this._ieHeightCounter++;"," var run = false, inst, h, bh;"," if (!e) {"," run = true;"," }"," if (e) {"," switch (e.keyCode) {"," case 8:"," case 13:"," run = true;"," break;"," }"," if (e.ctrlKey || e.shiftKey) {"," run = true;"," }"," }"," if (run) {"," try {"," inst = this.getInstance();"," h = this._iframe.get('offsetHeight');"," bh = inst.config.doc.body.scrollHeight;"," if (h > bh) {"," h = (h - 15) + 'px';"," inst.config.doc.body.style.height = h;"," } else {"," inst.config.doc.body.style.height = 'auto';"," }"," } catch (e) {"," if (this._ieHeightCounter < 100) {"," Y.later(200, this, this._ieSetBodyHeight);"," } else {"," }"," }"," }"," },"," /**"," * @private"," * @method _resolveBaseHref"," * @description Resolves the basehref of the page the frame is created on. Only applies to dynamic content."," * @param {String} href The new value to use, if empty it will be resolved from the current url."," * @return {String}"," */"," _resolveBaseHref: function(href) {"," if (!href || href === '') {"," href = Y.config.doc.location.href;"," if (href.indexOf('?') !== -1) { //Remove the query string"," href = href.substring(0, href.indexOf('?'));"," }"," href = href.substring(0, href.lastIndexOf('/')) + '/';"," }"," return href;"," },"," /**"," * @private"," * @method _getHTML"," * @description Get the content from the iframe"," * @param {String} html The raw HTML from the body of the iframe."," * @return {String}"," */"," _getHTML: function(html) {"," if (this._ready) {"," var inst = this.getInstance();"," html = inst.one('body').get('innerHTML');"," }"," return html;"," },"," /**"," * @private"," * @method _setHTML"," * @description Set the content of the iframe"," * @param {String} html The raw HTML to set the body of the iframe to."," * @return {String}"," */"," _setHTML: function(html) {"," if (this._ready) {"," var inst = this.getInstance();"," inst.one('body').set('innerHTML', html);"," } else {"," //This needs to be wrapped in a contentready callback for the !_ready state"," this.on('contentready', Y.bind(function(html) {"," var inst = this.getInstance();"," inst.one('body').set('innerHTML', html);"," }, this, html));"," }"," return html;"," },"," /**"," * @private"," * @method _setLinkedCSS"," * @description Set's the linked CSS on the instance.."," */"," _getLinkedCSS: function(urls) {"," if (!Y.Lang.isArray(urls)) {"," urls = [urls];"," }"," var str = '';"," if (!this._ready) {"," Y.each(urls, function(v) {"," if (v !== '') {"," str += '<link rel=\"stylesheet\" href=\"' + v + '\" type=\"text/css\">';"," }"," });"," } else {"," str = urls;"," }"," return str;"," },"," /**"," * @private"," * @method _setLinkedCSS"," * @description Set's the linked CSS on the instance.."," */"," _setLinkedCSS: function(css) {"," if (this._ready) {"," var inst = this.getInstance();"," inst.Get.css(css);"," }"," return css;"," },"," /**"," * @private"," * @method _setExtraCSS"," * @description Set's the extra CSS on the instance.."," */"," _setExtraCSS: function(css) {"," if (this._ready) {"," var inst = this.getInstance(),"," node = inst.one('#extra_css');",""," node.remove();"," inst.one('head').append('<style id=\"extra_css\">' + css + '</style>');"," }"," return css;"," },"," /**"," * @private"," * @method _instanceLoaded"," * @description Called from the first YUI instance that sets up the internal instance."," * This loads the content into the window/frame and attaches the contentready event."," * @param {YUI} inst The internal YUI instance bound to the frame/window"," */"," _instanceLoaded: function(inst) {"," this._instance = inst;"," this._onContentReady();",""," var doc = this._instance.config.doc;",""," if (this.get('designMode')) {"," if (!Y.UA.ie) {"," try {"," //Force other browsers into non CSS styling"," doc.execCommand('styleWithCSS', false, false);"," doc.execCommand('insertbronreturn', false, false);"," } catch (err) {}"," }"," }"," },"," //BEGIN PUBLIC METHODS"," /**"," * @method use"," * @description This is a scoped version of the normal YUI.use method & is bound to this frame/window."," * At setup, the inst.use method is mapped to this method."," */"," use: function() {"," var inst = this.getInstance(),"," args = Y.Array(arguments),"," cb = false;",""," if (Y.Lang.isFunction(args[args.length - 1])) {"," cb = args.pop();"," }"," if (cb) {"," args.push(function() {"," cb.apply(inst, arguments);",""," });"," }"," inst.__use.apply(inst, args);"," },"," /**"," * @method delegate"," * @description A delegate method passed to the instance's delegate method"," * @param {String} type The type of event to listen for"," * @param {Function} fn The method to attach"," * @param {String} cont The container to act as a delegate, if no \"sel\" passed, the body is assumed as the container."," * @param {String} sel The selector to match in the event (optional)"," * @return {EventHandle} The Event handle returned from Y.delegate"," */"," delegate: function(type, fn, cont, sel) {"," var inst = this.getInstance();"," if (!inst) {"," return false;"," }"," if (!sel) {"," sel = cont;"," cont = 'body';"," }"," return inst.delegate(type, fn, cont, sel);"," },"," /**"," * @method getInstance"," * @description Get a reference to the internal YUI instance."," * @return {YUI} The internal YUI instance"," */"," getInstance: function() {"," return this._instance;"," },"," /**"," * @method render"," * @description Render the iframe into the container config option or open the window."," * @param {String/HTMLElement/Node} node The node to render to"," * @return {Frame}"," * @chainable"," */"," render: function(node) {"," if (this._rendered) {"," return this;"," }"," this._rendered = true;"," if (node) {"," this.set('container', node);"," }",""," this._create(Y.bind(function(res) {",""," var inst, timer,"," cb = Y.bind(function(i) {"," this._instanceLoaded(i);"," }, this),"," args = Y.clone(this.get('use')),"," config = {"," debug: false,"," win: res.win,"," doc: res.doc"," },"," fn = Y.bind(function() {"," config = this._resolveWinDoc(config);"," inst = YUI(config);"," inst.host = this.get('host'); //Cross reference to Editor",""," try {"," inst.use('node-base', cb);"," if (timer) {"," clearInterval(timer);"," }"," } catch (e) {"," timer = setInterval(function() {"," fn();"," }, 350);"," }"," }, this);",""," args.push(fn);",""," Y.use.apply(Y, args);",""," }, this));",""," return this;"," },"," /**"," * @private"," * @method _handleFocus"," * @description Does some tricks on focus to set the proper cursor position."," */"," _handleFocus: function() {"," var inst = this.getInstance(),"," sel = new inst.EditorSelection(),"," n, c, b, par;",""," if (sel.anchorNode) {"," n = sel.anchorNode;",""," if (n.test('p') && n.get('innerHTML') === '') {"," n = n.get('parentNode');"," }"," c = n.get('childNodes');",""," if (c.size()) {"," if (c.item(0).test('br')) {"," sel.selectNode(n, true, false);"," } else if (c.item(0).test('p')) {"," n = c.item(0).one('br.yui-cursor');"," if (n) {"," n = n.get('parentNode');"," }"," if (!n) {"," n = c.item(0).get('firstChild');"," }"," if (!n) {"," n = c.item(0);"," }"," if (n) {"," sel.selectNode(n, true, false);"," }"," } else {"," b = inst.one('br.yui-cursor');"," if (b) {"," par = b.get('parentNode');"," if (par) {"," sel.selectNode(par, true, false);"," }"," }"," }"," }"," }"," },"," /**"," * @method focus"," * @description Set the focus to the iframe"," * @param {Function} fn Callback function to execute after focus happens"," * @return {Frame}"," * @chainable"," */"," focus: function(fn) {"," if (Y.UA.ie && Y.UA.ie < 9) {"," try {"," Y.one('win').focus();"," if (this.getInstance()) {"," if (this.getInstance().one('win')) {"," this.getInstance().one('win').focus();"," }"," }"," } catch (ierr) {"," }"," if (fn === true) {"," this._handleFocus();"," }"," if (Y.Lang.isFunction(fn)) {"," fn();"," }"," } else {"," try {"," Y.one('win').focus();"," Y.later(100, this, function() {"," if (this.getInstance()) {"," if (this.getInstance().one('win')) {"," this.getInstance().one('win').focus();"," }"," }"," if (fn === true) {"," this._handleFocus();"," }"," if (Y.Lang.isFunction(fn)) {"," fn();"," }"," });"," } catch (ferr) {"," }"," }"," return this;"," },"," /**"," * @method show"," * @description Show the iframe instance"," * @return {Frame}"," * @chainable"," */"," show: function() {"," this._iframe.setStyles({"," position: 'static',"," left: ''"," });"," if (Y.UA.gecko) {"," try {"," if (this.getInstance()) {"," this.getInstance().config.doc.designMode = 'on';"," }"," } catch (e) { }"," this.focus();"," }"," return this;"," },"," /**"," * @method hide"," * @description Hide the iframe instance"," * @return {Frame}"," * @chainable"," */"," hide: function() {"," this._iframe.setStyles({"," position: 'absolute',"," left: '-999999px'"," });"," return this;"," }"," }, {"," /**"," * @static"," * @property THROTTLE_TIME"," * @description The throttle time for key events in IE"," * @type Number"," * @default 100"," */"," THROTTLE_TIME: 100,"," /**"," * @static"," * @property DOM_EVENTS"," * @description The DomEvents that the frame automatically attaches and bubbles"," * @type Object"," */"," DOM_EVENTS: {"," dblclick: 1,"," click: 1,"," paste: 1,"," mouseup: 1,"," mousedown: 1,"," keyup: 1,"," keydown: 1,"," keypress: 1,"," activate: 1,"," deactivate: 1,"," beforedeactivate: 1,"," focusin: 1,"," focusout: 1"," },",""," /**"," * @static"," * @property DEFAULT_CSS"," * @description The default css used when creating the document."," * @type String"," */"," DEFAULT_CSS: 'body { 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; } img { cursor: pointer !important; border: none; }',"," /**"," * The template string used to create the iframe, deprecated to use DOM instead of innerHTML"," * @static"," * @property HTML"," * @type String"," * @deprecated"," */"," //HTML: '<iframe border=\"0\" frameBorder=\"0\" marginWidth=\"0\" marginHeight=\"0\" leftMargin=\"0\" topMargin=\"0\" allowTransparency=\"true\" width=\"100%\" height=\"99%\"></iframe>',"," /**"," * Attributes to auto add to the dynamic iframe under the hood"," * @static"," * @property IFRAME_ATTRS"," * @type Object"," */"," IFRAME_ATTRS: {"," border: '0',"," frameBorder: '0',"," marginWidth: '0',"," marginHeight: '0',"," leftMargin: '0',"," topMargin: '0',"," allowTransparency: 'true',"," width: \"100%\","," height: \"99%\""," },"," /**"," * @static"," * @property PAGE_HTML"," * @description The template used to create the page when created dynamically."," * @type String"," */"," PAGE_HTML: '<html dir=\"{DIR}\" lang=\"{LANG}\"><head><title>{TITLE}</title>{META}<base href=\"{BASE_HREF}\"/>{LINKED_CSS}<style id=\"editor_css\">{DEFAULT_CSS}</style>{EXTRA_CSS}</head><body>{CONTENT}</body></html>',",""," /**"," * @static"," * @method getDocType"," * @description Parses document.doctype and generates a DocType to match the parent page, if supported."," * For IE8, it grabs document.all[0].nodeValue and uses that. For IE < 8, it falls back to Frame.DOC_TYPE."," * @return {String} The normalized DocType to apply to the iframe"," */"," getDocType: function() {"," var dt = Y.config.doc.doctype,"," str = Frame.DOC_TYPE;",""," if (dt) {"," str = '<!DOCTYPE ' + dt.name + ((dt.publicId) ? ' ' + dt.publicId : '') + ((dt.systemId) ? ' ' + dt.systemId : '') + '>';"," } else {"," if (Y.config.doc.all) {"," dt = Y.config.doc.all[0];"," if (dt.nodeType) {"," if (dt.nodeType === 8) {"," if (dt.nodeValue) {"," if (dt.nodeValue.toLowerCase().indexOf('doctype') !== -1) {"," str = '<!' + dt.nodeValue + '>';"," }"," }"," }"," }"," }"," }"," return str;"," },"," /**"," * @static"," * @property DOC_TYPE"," * @description The DOCTYPE to prepend to the new document when created. Should match the one on the page being served."," * @type String"," */"," DOC_TYPE: '<!DOCTYPE HTML PUBLIC \"-/'+'/W3C/'+'/DTD HTML 4.01/'+'/EN\" \"http:/'+'/www.w3.org/TR/html4/strict.dtd\">',"," /**"," * @static"," * @property META"," * @description The meta-tag for Content-Type to add to the dynamic document"," * @type String"," */"," META: '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/><meta http-equiv=\"X-UA-Compatible\" content=\"IE=7\">',"," //META: '<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/>',"," /**"," * @static"," * @property NAME"," * @description The name of the class (frame)"," * @type String"," */"," NAME: 'frame',"," ATTRS: {"," /**"," * @attribute title"," * @description The title to give the blank page."," * @type String"," */"," title: {"," value: 'Blank Page'"," },"," /**"," * @attribute dir"," * @description The default text direction for this new frame. Default: ltr"," * @type String"," */"," dir: {"," value: 'ltr'"," },"," /**"," * @attribute lang"," * @description The default language. Default: en-US"," * @type String"," */"," lang: {"," value: 'en-US'"," },"," /**"," * @attribute src"," * @description The src of the iframe/window. Defaults to javascript:;"," * @type String"," */"," src: {"," //Hackish, IE needs the false in the Javascript URL"," value: 'javascript' + ((Y.UA.ie) ? ':false' : ':') + ';'"," },"," /**"," * @attribute designMode"," * @description Should designMode be turned on after creation."," * @writeonce"," * @type Boolean"," */"," designMode: {"," writeOnce: true,"," value: false"," },"," /**"," * @attribute content"," * @description The string to inject into the body of the new frame/window."," * @type String"," */"," content: {"," value: '<br>',"," setter: '_setHTML',"," getter: '_getHTML'"," },"," /**"," * @attribute basehref"," * @description The base href to use in the iframe."," * @type String"," */"," basehref: {"," value: false,"," getter: '_resolveBaseHref'"," },"," /**"," * @attribute use"," * @description Array of modules to include in the scoped YUI instance at render time. Default: ['none', 'selector-css2']"," * @writeonce"," * @type Array"," */"," use: {"," writeOnce: true,"," value: ['node', 'node-style', 'selector-css3']"," },"," /**"," * @attribute container"," * @description The container to append the iFrame to on render."," * @type String/HTMLElement/Node"," */"," container: {"," value: 'body',"," setter: function(n) {"," return Y.one(n);"," }"," },"," /**"," * @attribute node"," * @description The Node instance of the iframe."," * @type Node"," */"," node: {"," readOnly: true,"," value: null,"," getter: function() {"," return this._iframe;"," }"," },"," /**"," * @attribute id"," * @description Set the id of the new Node. (optional)"," * @type String"," * @writeonce"," */"," id: {"," writeOnce: true,"," getter: function(id) {"," if (!id) {"," id = 'iframe-' + Y.guid();"," }"," return id;"," }"," },"," /**"," * @attribute linkedcss"," * @description An array of url's to external linked style sheets"," * @type String"," */"," linkedcss: {"," value: '',"," getter: '_getLinkedCSS',"," setter: '_setLinkedCSS'"," },"," /**"," * @attribute extracss"," * @description A string of CSS to add to the Head of the Editor"," * @type String"," */"," extracss: {"," value: '',"," setter: '_setExtraCSS'"," },"," /**"," * @attribute host"," * @description A reference to the Editor instance"," * @type Object"," */"," host: {"," value: false"," },"," /**"," * @attribute defaultblock"," * @description The default tag to use for block level items, defaults to: p"," * @type String"," */"," defaultblock: {"," value: 'p'"," }"," }"," });","",""," Y.Frame = Frame;","","","","}, '3.7.3', {\"requires\": [\"base\", \"node\", \"selector-css3\", \"yui-throttle\"]});"];+_yuitest_coverage["build/frame/frame.js"].lines = {"1":0,"15":0,"16":0,"20":0,"56":0,"61":0,"62":0,"64":0,"65":0,"66":0,"67":0,"69":0,"70":0,"81":0,"84":0,"90":0,"92":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"101":0,"102":0,"106":0,"118":0,"119":0,"120":0,"121":0,"122":0,"124":0,"125":0,"127":0,"139":0,"141":0,"143":0,"146":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0,"157":0,"158":0,"159":0,"161":0,"164":0,"170":0,"172":0,"173":0,"174":0,"183":0,"186":0,"187":0,"189":0,"190":0,"193":0,"194":0,"195":0,"197":0,"198":0,"204":0,"205":0,"206":0,"208":0,"209":0,"212":0,"216":0,"219":0,"227":0,"229":0,"230":0,"233":0,"234":0,"236":0,"237":0,"238":0,"240":0,"242":0,"248":0,"250":0,"253":0,"254":0,"256":0,"257":0,"258":0,"261":0,"273":0,"277":0,"279":0,"280":0,"281":0,"284":0,"285":0,"286":0,"288":0,"289":0,"290":0,"293":0,"294":0,"310":0,"311":0,"312":0,"315":0,"317":0,"318":0,"321":0,"322":0,"323":0,"326":0,"327":0,"328":0,"329":0,"330":0,"332":0,"335":0,"337":0,"339":0,"351":0,"352":0,"354":0,"355":0,"356":0,"357":0,"359":0,"360":0,"363":0,"364":0,"366":0,"367":0,"370":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"377":0,"379":0,"382":0,"383":0,"397":0,"398":0,"399":0,"400":0,"402":0,"404":0,"414":0,"415":0,"416":0,"418":0,"428":0,"429":0,"430":0,"433":0,"434":0,"435":0,"438":0,"446":0,"447":0,"449":0,"450":0,"451":0,"452":0,"453":0,"457":0,"459":0,"467":0,"468":0,"469":0,"471":0,"479":0,"480":0,"483":0,"484":0,"486":0,"496":0,"497":0,"499":0,"501":0,"502":0,"503":0,"505":0,"506":0,"518":0,"522":0,"523":0,"525":0,"526":0,"527":0,"531":0,"543":0,"544":0,"545":0,"547":0,"548":0,"549":0,"551":0,"559":0,"569":0,"570":0,"572":0,"573":0,"574":0,"577":0,"579":0,"581":0,"590":0,"591":0,"592":0,"594":0,"595":0,"596":0,"597":0,"600":0,"601":0,"606":0,"608":0,"612":0,"620":0,"624":0,"625":0,"627":0,"628":0,"630":0,"632":0,"633":0,"634":0,"635":0,"636":0,"637":0,"638":0,"640":0,"641":0,"643":0,"644":0,"646":0,"647":0,"650":0,"651":0,"652":0,"653":0,"654":0,"669":0,"670":0,"671":0,"672":0,"673":0,"674":0,"679":0,"680":0,"682":0,"683":0,"686":0,"687":0,"688":0,"689":0,"690":0,"691":0,"694":0,"695":0,"697":0,"698":0,"704":0,"713":0,"717":0,"718":0,"719":0,"720":0,"723":0,"725":0,"734":0,"738":0,"819":0,"822":0,"823":0,"825":0,"826":0,"827":0,"828":0,"829":0,"830":0,"831":0,"838":0,"943":0,"955":0,"967":0,"968":0,"970":0,"1012":0};+_yuitest_coverage["build/frame/frame.js"].functions = {"Frame:15":0,"(anonymous 2):99":0,"_create:55":0,"_resolveWinDoc:117":0,"_onDomEvent:138":0,"initializer:163":0,"destructor:169":0,"getData:211":0,"_DOMPaste:182":0,"(anonymous 3):229":0,"_defReadyFn:226":0,"(anonymous 4):280":0,"_fixIECursors:272":0,"(anonymous 5):321":0,"_onContentReady:309":0,"_ieSetBodyHeight:350":0,"_resolveBaseHref:396":0,"_getHTML:413":0,"(anonymous 6):433":0,"_setHTML:427":0,"(anonymous 7):451":0,"_getLinkedCSS:445":0,"_setLinkedCSS:466":0,"_setExtraCSS:478":0,"_instanceLoaded:495":0,"(anonymous 8):526":0,"use:517":0,"delegate:542":0,"getInstance:558":0,"(anonymous 10):580":0,"(anonymous 12):600":0,"(anonymous 11):589":0,"(anonymous 9):577":0,"render:568":0,"_handleFocus:619":0,"(anonymous 13):688":0,"focus:668":0,"show:712":0,"hide:733":0,"getDocType:818":0,"setter:942":0,"getter:954":0,"getter:966":0,"(anonymous 1):1":0};+_yuitest_coverage["build/frame/frame.js"].coveredLines = 292; _yuitest_coverage["build/frame/frame.js"].coveredFunctions = 44; _yuitest_coverline("build/frame/frame.js", 1); YUI.add('frame', function (Y, NAME) { -+ /*jshint maxlen: 500 */ /** * Creates a wrapper around an iframe. It loads the content either from a local * file or from script and creates a local YUI instance bound to that new window and document.@@ -58,9 +58,9 @@ _yuitest_coverfunc("build/frame/frame.js", "Frame", 15); _yuitest_coverline("build/frame/frame.js", 16); Frame.superclass.constructor.apply(this, arguments);- }, LAST_CHILD = ':last-child', BODY = 'body';- + }; + _yuitest_coverline("build/frame/frame.js", 20); Y.extend(Frame, Y.Base, { /**@@ -100,22 +100,22 @@ _create: function(cb) { _yuitest_coverfunc("build/frame/frame.js", "_create", 55); _yuitest_coverline("build/frame/frame.js", 56);-var win, doc, res, node, html = '',+var res, html = '', timer,+ //if the src attr is different than the default, don't create the document+ create = (this.get('src') === Frame.ATTRS.src.value), extra_css = ((this.get('extracss')) ? '<style id="extra_css">' + this.get('extracss') + '</style>' : ''); - _yuitest_coverline("build/frame/frame.js", 59);-this._iframe = Y.Node.create(Frame.HTML);- _yuitest_coverline("build/frame/frame.js", 60);-this._iframe.setStyle('visibility', 'hidden'); _yuitest_coverline("build/frame/frame.js", 61);-this._iframe.set('src', this.get('src'));+this._iframe = Y.one(Y.config.doc.createElement('iframe')); _yuitest_coverline("build/frame/frame.js", 62);-this.get('container').append(this._iframe);+this._iframe.setAttrs(Frame.IFRAME_ATTRS); - //if the src attr is different than the default, don't create the document+ _yuitest_coverline("build/frame/frame.js", 64);+this._iframe.setStyle('visibility', 'hidden'); _yuitest_coverline("build/frame/frame.js", 65);-var create = (this.get('src') === Frame.ATTRS.src.value);-+this._iframe.set('src', this.get('src'));+ _yuitest_coverline("build/frame/frame.js", 66);+this.get('container').append(this._iframe); _yuitest_coverline("build/frame/frame.js", 67); this._iframe.set('height', '99%'); @@ -134,8 +134,8 @@ EXTRA_CSS: extra_css }); _yuitest_coverline("build/frame/frame.js", 81);-if (Y.config.doc.compatMode != 'BackCompat') {- +if (Y.config.doc.compatMode !== 'BackCompat') {+ //html = Frame.DOC_TYPE + "\n" + html; _yuitest_coverline("build/frame/frame.js", 84); html = Frame.getDocType() + "\n" + html;@@ -160,7 +160,7 @@ _yuitest_coverline("build/frame/frame.js", 98); if (!res.doc.documentElement) { _yuitest_coverline("build/frame/frame.js", 99);-var timer = Y.later(1, this, function() {+timer = Y.later(1, this, function() { _yuitest_coverfunc("build/frame/frame.js", "(anonymous 2)", 99); _yuitest_coverline("build/frame/frame.js", 100); if (res.doc && res.doc.documentElement) {@@ -217,7 +217,7 @@ _yuitest_coverfunc("build/frame/frame.js", "_onDomEvent", 138); _yuitest_coverline("build/frame/frame.js", 139); var xy, node;- + _yuitest_coverline("build/frame/frame.js", 141); if (!Y.Node.getDOMNode(this._iframe)) { //The iframe is null for some reason, bail on sending events.@@ -295,7 +295,7 @@ _yuitest_coverline("build/frame/frame.js", 190); data = e._event.clipboardData.getData('Text'); }- + _yuitest_coverline("build/frame/frame.js", 193); if (win.clipboardData) { _yuitest_coverline("build/frame/frame.js", 194);@@ -310,15 +310,15 @@ } } }- + _yuitest_coverline("build/frame/frame.js", 204); e.frameTarget = e.target; _yuitest_coverline("build/frame/frame.js", 205); e.frameCurrentTarget = e.currentTarget; _yuitest_coverline("build/frame/frame.js", 206); e.frameEvent = e;- + _yuitest_coverline("build/frame/frame.js", 208); if (data) { _yuitest_coverline("build/frame/frame.js", 209);@@ -379,7 +379,7 @@ _yuitest_coverline("build/frame/frame.js", 248); inst.Node.DOM_EVENTS.paste = 1;- + _yuitest_coverline("build/frame/frame.js", 250); inst.on('paste', Y.bind(this._DOMPaste, this), inst.one('body')); @@ -399,14 +399,10 @@ }); _yuitest_coverline("build/frame/frame.js", 261); inst.one('body').setStyle('display', 'block');- _yuitest_coverline("build/frame/frame.js", 262);-if (Y.UA.ie) {- //this._fixIECursors();- } }, /** * It appears that having a BR tag anywhere in the source "below" a table with a percentage width (in IE 7 & 8)- * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally + * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally * spike. This method finds all <BR>'s below the sourceIndex of the first table. Does some checks to see if they * can be modified and replaces then with a <WBR> so the layout will remain in tact, but the flickering will * no longer happen.@@ -414,48 +410,48 @@ * @private */ _fixIECursors: function() {- _yuitest_coverfunc("build/frame/frame.js", "_fixIECursors", 275);-_yuitest_coverline("build/frame/frame.js", 276);+ _yuitest_coverfunc("build/frame/frame.js", "_fixIECursors", 272);+_yuitest_coverline("build/frame/frame.js", 273); var inst = this.getInstance(), tables = inst.all('table'), brs = inst.all('br'), si; - _yuitest_coverline("build/frame/frame.js", 280);+ _yuitest_coverline("build/frame/frame.js", 277); if (tables.size() && brs.size()) { //First Table- _yuitest_coverline("build/frame/frame.js", 282);+ _yuitest_coverline("build/frame/frame.js", 279); si = tables.item(0).get('sourceIndex');- _yuitest_coverline("build/frame/frame.js", 283);+ _yuitest_coverline("build/frame/frame.js", 280); brs.each(function(n) {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 4)", 283);-_yuitest_coverline("build/frame/frame.js", 284);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 4)", 280);+_yuitest_coverline("build/frame/frame.js", 281); var p = n.get('parentNode'), c = p.get('children'), b = p.all('>br');- - _yuitest_coverline("build/frame/frame.js", 287);++ _yuitest_coverline("build/frame/frame.js", 284); if (p.test('div')) {- _yuitest_coverline("build/frame/frame.js", 288);+ _yuitest_coverline("build/frame/frame.js", 285); if (c.size() > 2) {- _yuitest_coverline("build/frame/frame.js", 289);+ _yuitest_coverline("build/frame/frame.js", 286); n.replace(inst.Node.create('<wbr>')); } else {- _yuitest_coverline("build/frame/frame.js", 291);+ _yuitest_coverline("build/frame/frame.js", 288); if (n.get('sourceIndex') > si) {- _yuitest_coverline("build/frame/frame.js", 292);+ _yuitest_coverline("build/frame/frame.js", 289); if (b.size()) {- _yuitest_coverline("build/frame/frame.js", 293);+ _yuitest_coverline("build/frame/frame.js", 290); n.replace(inst.Node.create('<wbr>')); } } else {- _yuitest_coverline("build/frame/frame.js", 296);+ _yuitest_coverline("build/frame/frame.js", 293); if (b.size() > 1) {- _yuitest_coverline("build/frame/frame.js", 297);+ _yuitest_coverline("build/frame/frame.js", 294); n.replace(inst.Node.create('<wbr>')); } } } }- + }); } },@@ -466,123 +462,123 @@ * on the internal instance so that the modules are loaded properly. */ _onContentReady: function(e) {- _yuitest_coverfunc("build/frame/frame.js", "_onContentReady", 312);-_yuitest_coverline("build/frame/frame.js", 313);+ _yuitest_coverfunc("build/frame/frame.js", "_onContentReady", 309);+_yuitest_coverline("build/frame/frame.js", 310); if (!this._ready) {- _yuitest_coverline("build/frame/frame.js", 314);+ _yuitest_coverline("build/frame/frame.js", 311); this._ready = true;- _yuitest_coverline("build/frame/frame.js", 315);+ _yuitest_coverline("build/frame/frame.js", 312); var inst = this.getInstance(), args = Y.clone(this.get('use'));- - _yuitest_coverline("build/frame/frame.js", 318);++ _yuitest_coverline("build/frame/frame.js", 315); this.fire('contentready'); - _yuitest_coverline("build/frame/frame.js", 320);+ _yuitest_coverline("build/frame/frame.js", 317); if (e) {- _yuitest_coverline("build/frame/frame.js", 321);+ _yuitest_coverline("build/frame/frame.js", 318); inst.config.doc = Y.Node.getDOMNode(e.target); } //TODO Circle around and deal with CSS loading...- _yuitest_coverline("build/frame/frame.js", 324);+ _yuitest_coverline("build/frame/frame.js", 321); args.push(Y.bind(function() {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 5)", 324);-_yuitest_coverline("build/frame/frame.js", 325);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 5)", 321);+_yuitest_coverline("build/frame/frame.js", 322); if (inst.EditorSelection) {- _yuitest_coverline("build/frame/frame.js", 326);+ _yuitest_coverline("build/frame/frame.js", 323); inst.EditorSelection.DEFAULT_BLOCK_TAG = this.get('defaultblock'); } //Moved to here so that the iframe is ready before allowing editing..- _yuitest_coverline("build/frame/frame.js", 329);+ _yuitest_coverline("build/frame/frame.js", 326); if (this.get('designMode')) {- _yuitest_coverline("build/frame/frame.js", 330);+ _yuitest_coverline("build/frame/frame.js", 327); if(Y.UA.ie) {- _yuitest_coverline("build/frame/frame.js", 331);+ _yuitest_coverline("build/frame/frame.js", 328); inst.config.doc.body.contentEditable = 'true';- _yuitest_coverline("build/frame/frame.js", 332);+ _yuitest_coverline("build/frame/frame.js", 329); this._ieSetBodyHeight();- _yuitest_coverline("build/frame/frame.js", 333);+ _yuitest_coverline("build/frame/frame.js", 330); inst.on('keyup', Y.bind(this._ieSetBodyHeight, this), inst.config.doc); } else {- _yuitest_coverline("build/frame/frame.js", 335);+ _yuitest_coverline("build/frame/frame.js", 332); inst.config.doc.designMode = 'on'; } }- _yuitest_coverline("build/frame/frame.js", 338);+ _yuitest_coverline("build/frame/frame.js", 335); this.fire('ready'); }, this));- _yuitest_coverline("build/frame/frame.js", 340);+ _yuitest_coverline("build/frame/frame.js", 337); inst.use.apply(inst, args); - _yuitest_coverline("build/frame/frame.js", 342);+ _yuitest_coverline("build/frame/frame.js", 339); inst.one('doc').get('documentElement').addClass('yui-js-enabled'); } }, _ieHeightCounter: null, /** * Internal method to set the height of the body to the height of the document in IE.- * With contenteditable being set, the document becomes unresponsive to clicks, this + * With contenteditable being set, the document becomes unresponsive to clicks, this * method expands the body to be the height of the document so that doesn't happen. * @private * @method _ieSetBodyHeight */ _ieSetBodyHeight: function(e) {- _yuitest_coverfunc("build/frame/frame.js", "_ieSetBodyHeight", 353);-_yuitest_coverline("build/frame/frame.js", 354);+ _yuitest_coverfunc("build/frame/frame.js", "_ieSetBodyHeight", 350);+_yuitest_coverline("build/frame/frame.js", 351); if (!this._ieHeightCounter) {- _yuitest_coverline("build/frame/frame.js", 355);+ _yuitest_coverline("build/frame/frame.js", 352); this._ieHeightCounter = 0; }- _yuitest_coverline("build/frame/frame.js", 357);+ _yuitest_coverline("build/frame/frame.js", 354); this._ieHeightCounter++;- _yuitest_coverline("build/frame/frame.js", 358);-var run = false;- _yuitest_coverline("build/frame/frame.js", 359);+ _yuitest_coverline("build/frame/frame.js", 355);+var run = false, inst, h, bh;+ _yuitest_coverline("build/frame/frame.js", 356); if (!e) {- _yuitest_coverline("build/frame/frame.js", 360);+ _yuitest_coverline("build/frame/frame.js", 357); run = true; }- _yuitest_coverline("build/frame/frame.js", 362);+ _yuitest_coverline("build/frame/frame.js", 359); if (e) {- _yuitest_coverline("build/frame/frame.js", 363);+ _yuitest_coverline("build/frame/frame.js", 360); switch (e.keyCode) { case 8: case 13:- _yuitest_coverline("build/frame/frame.js", 366);+ _yuitest_coverline("build/frame/frame.js", 363); run = true;- _yuitest_coverline("build/frame/frame.js", 367);+ _yuitest_coverline("build/frame/frame.js", 364); break; }- _yuitest_coverline("build/frame/frame.js", 369);+ _yuitest_coverline("build/frame/frame.js", 366); if (e.ctrlKey || e.shiftKey) {- _yuitest_coverline("build/frame/frame.js", 370);+ _yuitest_coverline("build/frame/frame.js", 367); run = true; } }- _yuitest_coverline("build/frame/frame.js", 373);+ _yuitest_coverline("build/frame/frame.js", 370); if (run) {- _yuitest_coverline("build/frame/frame.js", 374);+ _yuitest_coverline("build/frame/frame.js", 371); try {+ _yuitest_coverline("build/frame/frame.js", 372);+inst = this.getInstance();+ _yuitest_coverline("build/frame/frame.js", 373);+h = this._iframe.get('offsetHeight');+ _yuitest_coverline("build/frame/frame.js", 374);+bh = inst.config.doc.body.scrollHeight; _yuitest_coverline("build/frame/frame.js", 375);-var inst = this.getInstance();- _yuitest_coverline("build/frame/frame.js", 376);-var h = this._iframe.get('offsetHeight');- _yuitest_coverline("build/frame/frame.js", 377);-var bh = inst.config.doc.body.scrollHeight;- _yuitest_coverline("build/frame/frame.js", 378); if (h > bh) {- _yuitest_coverline("build/frame/frame.js", 379);+ _yuitest_coverline("build/frame/frame.js", 376); h = (h - 15) + 'px';- _yuitest_coverline("build/frame/frame.js", 380);+ _yuitest_coverline("build/frame/frame.js", 377); inst.config.doc.body.style.height = h; } else {- _yuitest_coverline("build/frame/frame.js", 382);+ _yuitest_coverline("build/frame/frame.js", 379); inst.config.doc.body.style.height = 'auto'; } } catch (e) {- _yuitest_coverline("build/frame/frame.js", 385);+ _yuitest_coverline("build/frame/frame.js", 382); if (this._ieHeightCounter < 100) {- _yuitest_coverline("build/frame/frame.js", 386);+ _yuitest_coverline("build/frame/frame.js", 383); Y.later(200, this, this._ieSetBodyHeight); } else { }@@ -597,20 +593,20 @@ * @return {String} */ _resolveBaseHref: function(href) {- _yuitest_coverfunc("build/frame/frame.js", "_resolveBaseHref", 399);-_yuitest_coverline("build/frame/frame.js", 400);+ _yuitest_coverfunc("build/frame/frame.js", "_resolveBaseHref", 396);+_yuitest_coverline("build/frame/frame.js", 397); if (!href || href === '') {- _yuitest_coverline("build/frame/frame.js", 401);+ _yuitest_coverline("build/frame/frame.js", 398); href = Y.config.doc.location.href;- _yuitest_coverline("build/frame/frame.js", 402);+ _yuitest_coverline("build/frame/frame.js", 399); if (href.indexOf('?') !== -1) { //Remove the query string- _yuitest_coverline("build/frame/frame.js", 403);+ _yuitest_coverline("build/frame/frame.js", 400); href = href.substring(0, href.indexOf('?')); }- _yuitest_coverline("build/frame/frame.js", 405);+ _yuitest_coverline("build/frame/frame.js", 402); href = href.substring(0, href.lastIndexOf('/')) + '/'; }- _yuitest_coverline("build/frame/frame.js", 407);+ _yuitest_coverline("build/frame/frame.js", 404); return href; }, /**@@ -621,15 +617,15 @@ * @return {String} */ _getHTML: function(html) {- _yuitest_coverfunc("build/frame/frame.js", "_getHTML", 416);-_yuitest_coverline("build/frame/frame.js", 417);+ _yuitest_coverfunc("build/frame/frame.js", "_getHTML", 413);+_yuitest_coverline("build/frame/frame.js", 414); if (this._ready) {- _yuitest_coverline("build/frame/frame.js", 418);+ _yuitest_coverline("build/frame/frame.js", 415); var inst = this.getInstance();- _yuitest_coverline("build/frame/frame.js", 419);+ _yuitest_coverline("build/frame/frame.js", 416); html = inst.one('body').get('innerHTML'); }- _yuitest_coverline("build/frame/frame.js", 421);+ _yuitest_coverline("build/frame/frame.js", 418); return html; }, /**@@ -640,25 +636,25 @@ * @return {String} */ _setHTML: function(html) {- _yuitest_coverfunc("build/frame/frame.js", "_setHTML", 430);-_yuitest_coverline("build/frame/frame.js", 431);+ _yuitest_coverfunc("build/frame/frame.js", "_setHTML", 427);+_yuitest_coverline("build/frame/frame.js", 428); if (this._ready) {- _yuitest_coverline("build/frame/frame.js", 432);+ _yuitest_coverline("build/frame/frame.js", 429); var inst = this.getInstance();- _yuitest_coverline("build/frame/frame.js", 433);+ _yuitest_coverline("build/frame/frame.js", 430); inst.one('body').set('innerHTML', html); } else { //This needs to be wrapped in a contentready callback for the !_ready state- _yuitest_coverline("build/frame/frame.js", 436);-this.on('contentready', Y.bind(function(html, e) {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 6)", 436);-_yuitest_coverline("build/frame/frame.js", 437);+ _yuitest_coverline("build/frame/frame.js", 433);+this.on('contentready', Y.bind(function(html) {+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 6)", 433);+_yuitest_coverline("build/frame/frame.js", 434); var inst = this.getInstance();- _yuitest_coverline("build/frame/frame.js", 438);+ _yuitest_coverline("build/frame/frame.js", 435); inst.one('body').set('innerHTML', html); }, this, html)); }- _yuitest_coverline("build/frame/frame.js", 441);+ _yuitest_coverline("build/frame/frame.js", 438); return html; }, /**@@ -667,30 +663,30 @@ * @description Set's the linked CSS on the instance.. */ _getLinkedCSS: function(urls) {- _yuitest_coverfunc("build/frame/frame.js", "_getLinkedCSS", 448);-_yuitest_coverline("build/frame/frame.js", 449);+ _yuitest_coverfunc("build/frame/frame.js", "_getLinkedCSS", 445);+_yuitest_coverline("build/frame/frame.js", 446); if (!Y.Lang.isArray(urls)) {- _yuitest_coverline("build/frame/frame.js", 450);+ _yuitest_coverline("build/frame/frame.js", 447); urls = [urls]; }- _yuitest_coverline("build/frame/frame.js", 452);+ _yuitest_coverline("build/frame/frame.js", 449); var str = '';- _yuitest_coverline("build/frame/frame.js", 453);+ _yuitest_coverline("build/frame/frame.js", 450); if (!this._ready) {- _yuitest_coverline("build/frame/frame.js", 454);+ _yuitest_coverline("build/frame/frame.js", 451); Y.each(urls, function(v) {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 7)", 454);-_yuitest_coverline("build/frame/frame.js", 455);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 7)", 451);+_yuitest_coverline("build/frame/frame.js", 452); if (v !== '') {- _yuitest_coverline("build/frame/frame.js", 456);+ _yuitest_coverline("build/frame/frame.js", 453); str += '<link rel="stylesheet" href="' + v + '" type="text/css">'; } }); } else {- _yuitest_coverline("build/frame/frame.js", 460);+ _yuitest_coverline("build/frame/frame.js", 457); str = urls; }- _yuitest_coverline("build/frame/frame.js", 462);+ _yuitest_coverline("build/frame/frame.js", 459); return str; }, /**@@ -699,15 +695,15 @@ * @description Set's the linked CSS on the instance.. */ _setLinkedCSS: function(css) {- _yuitest_coverfunc("build/frame/frame.js", "_setLinkedCSS", 469);-_yuitest_coverline("build/frame/frame.js", 470);+ _yuitest_coverfunc("build/frame/frame.js", "_setLinkedCSS", 466);+_yuitest_coverline("build/frame/frame.js", 467); if (this._ready) {- _yuitest_coverline("build/frame/frame.js", 471);+ _yuitest_coverline("build/frame/frame.js", 468); var inst = this.getInstance();- _yuitest_coverline("build/frame/frame.js", 472);+ _yuitest_coverline("build/frame/frame.js", 469); inst.Get.css(css); }- _yuitest_coverline("build/frame/frame.js", 474);+ _yuitest_coverline("build/frame/frame.js", 471); return css; }, /**@@ -716,19 +712,19 @@ * @description Set's the extra CSS on the instance.. */ _setExtraCSS: function(css) {- _yuitest_coverfunc("build/frame/frame.js", "_setExtraCSS", 481);-_yuitest_coverline("build/frame/frame.js", 482);+ _yuitest_coverfunc("build/frame/frame.js", "_setExtraCSS", 478);+_yuitest_coverline("build/frame/frame.js", 479); if (this._ready) {- _yuitest_coverline("build/frame/frame.js", 483);+ _yuitest_coverline("build/frame/frame.js", 480); var inst = this.getInstance(), node = inst.one('#extra_css');- - _yuitest_coverline("build/frame/frame.js", 486);++ _yuitest_coverline("build/frame/frame.js", 483); node.remove();- _yuitest_coverline("build/frame/frame.js", 487);+ _yuitest_coverline("build/frame/frame.js", 484); inst.one('head').append('<style id="extra_css">' + css + '</style>'); }- _yuitest_coverline("build/frame/frame.js", 489);+ _yuitest_coverline("build/frame/frame.js", 486); return css; }, /**@@ -739,25 +735,25 @@ * @param {YUI} inst The internal YUI instance bound to the frame/window */ _instanceLoaded: function(inst) {- _yuitest_coverfunc("build/frame/frame.js", "_instanceLoaded", 498);-_yuitest_coverline("build/frame/frame.js", 499);+ _yuitest_coverfunc("build/frame/frame.js", "_instanceLoaded", 495);+_yuitest_coverline("build/frame/frame.js", 496); this._instance = inst;- _yuitest_coverline("build/frame/frame.js", 500);+ _yuitest_coverline("build/frame/frame.js", 497); this._onContentReady();- - _yuitest_coverline("build/frame/frame.js", 502);++ _yuitest_coverline("build/frame/frame.js", 499); var doc = this._instance.config.doc; - _yuitest_coverline("build/frame/frame.js", 504);+ _yuitest_coverline("build/frame/frame.js", 501); if (this.get('designMode')) {- _yuitest_coverline("build/frame/frame.js", 505);+ _yuitest_coverline("build/frame/frame.js", 502); if (!Y.UA.ie) {- _yuitest_coverline("build/frame/frame.js", 506);+ _yuitest_coverline("build/frame/frame.js", 503); try { //Force other browsers into non CSS styling- _yuitest_coverline("build/frame/frame.js", 508);+ _yuitest_coverline("build/frame/frame.js", 505); doc.execCommand('styleWithCSS', false, false);- _yuitest_coverline("build/frame/frame.js", 509);+ _yuitest_coverline("build/frame/frame.js", 506); doc.execCommand('insertbronreturn', false, false); } catch (err) {} }@@ -770,28 +766,28 @@ * At setup, the inst.use method is mapped to this method. */ use: function() {- _yuitest_coverfunc("build/frame/frame.js", "use", 520);-_yuitest_coverline("build/frame/frame.js", 521);+ _yuitest_coverfunc("build/frame/frame.js", "use", 517);+_yuitest_coverline("build/frame/frame.js", 518); var inst = this.getInstance(), args = Y.Array(arguments), cb = false; - _yuitest_coverline("build/frame/frame.js", 525);+ _yuitest_coverline("build/frame/frame.js", 522); if (Y.Lang.isFunction(args[args.length - 1])) {- _yuitest_coverline("build/frame/frame.js", 526);+ _yuitest_coverline("build/frame/frame.js", 523); cb = args.pop(); }- _yuitest_coverline("build/frame/frame.js", 528);+ _yuitest_coverline("build/frame/frame.js", 525); if (cb) {- _yuitest_coverline("build/frame/frame.js", 529);+ _yuitest_coverline("build/frame/frame.js", 526); args.push(function() {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 8)", 529);-_yuitest_coverline("build/frame/frame.js", 530);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 8)", 526);+_yuitest_coverline("build/frame/frame.js", 527); cb.apply(inst, arguments); }); }- _yuitest_coverline("build/frame/frame.js", 534);+ _yuitest_coverline("build/frame/frame.js", 531); inst.__use.apply(inst, args); }, /**@@ -804,22 +800,22 @@ * @return {EventHandle} The Event handle returned from Y.delegate */ delegate: function(type, fn, cont, sel) {- _yuitest_coverfunc("build/frame/frame.js", "delegate", 545);-_yuitest_coverline("build/frame/frame.js", 546);+ _yuitest_coverfunc("build/frame/frame.js", "delegate", 542);+_yuitest_coverline("build/frame/frame.js", 543); var inst = this.getInstance();- _yuitest_coverline("build/frame/frame.js", 547);+ _yuitest_coverline("build/frame/frame.js", 544); if (!inst) {- _yuitest_coverline("build/frame/frame.js", 548);+ _yuitest_coverline("build/frame/frame.js", 545); return false; }- _yuitest_coverline("build/frame/frame.js", 550);+ _yuitest_coverline("build/frame/frame.js", 547); if (!sel) {- _yuitest_coverline("build/frame/frame.js", 551);+ _yuitest_coverline("build/frame/frame.js", 548); sel = cont;- _yuitest_coverline("build/frame/frame.js", 552);+ _yuitest_coverline("build/frame/frame.js", 549); cont = 'body'; }- _yuitest_coverline("build/frame/frame.js", 554);+ _yuitest_coverline("build/frame/frame.js", 551); return inst.delegate(type, fn, cont, sel); }, /**@@ -828,8 +824,8 @@ * @return {YUI} The internal YUI instance */ getInstance: function() {- _yuitest_coverfunc("build/frame/frame.js", "getInstance", 561);-_yuitest_coverline("build/frame/frame.js", 562);+ _yuitest_coverfunc("build/frame/frame.js", "getInstance", 558);+_yuitest_coverline("build/frame/frame.js", 559); return this._instance; }, /**@@ -840,29 +836,29 @@ * @chainable */ render: function(node) {- _yuitest_coverfunc("build/frame/frame.js", "render", 571);-_yuitest_coverline("build/frame/frame.js", 572);+ _yuitest_coverfunc("build/frame/frame.js", "render", 568);+_yuitest_coverline("build/frame/frame.js", 569); if (this._rendered) {- _yuitest_coverline("build/frame/frame.js", 573);+ _yuitest_coverline("build/frame/frame.js", 570); return this; }- _yuitest_coverline("build/frame/frame.js", 575);+ _yuitest_coverline("build/frame/frame.js", 572); this._rendered = true;- _yuitest_coverline("build/frame/frame.js", 576);+ _yuitest_coverline("build/frame/frame.js", 573); if (node) {- _yuitest_coverline("build/frame/frame.js", 577);+ _yuitest_coverline("build/frame/frame.js", 574); this.set('container', node); } - _yuitest_coverline("build/frame/frame.js", 580);+ _yuitest_coverline("build/frame/frame.js", 577); this._create(Y.bind(function(res) { - _yuitest_coverfunc("build/frame/frame.js", "(anonymous 9)", 580);-_yuitest_coverline("build/frame/frame.js", 582);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 9)", 577);+_yuitest_coverline("build/frame/frame.js", 579); var inst, timer, cb = Y.bind(function(i) {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 10)", 583);-_yuitest_coverline("build/frame/frame.js", 584);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 10)", 580);+_yuitest_coverline("build/frame/frame.js", 581); this._instanceLoaded(i); }, this), args = Y.clone(this.get('use')),@@ -872,42 +868,42 @@ doc: res.doc }, fn = Y.bind(function() {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 11)", 592);-_yuitest_coverline("build/frame/frame.js", 593);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 11)", 589);+_yuitest_coverline("build/frame/frame.js", 590); config = this._resolveWinDoc(config);- _yuitest_coverline("build/frame/frame.js", 594);+ _yuitest_coverline("build/frame/frame.js", 591); inst = YUI(config);- _yuitest_coverline("build/frame/frame.js", 595);+ _yuitest_coverline("build/frame/frame.js", 592); inst.host = this.get('host'); //Cross reference to Editor - _yuitest_coverline("build/frame/frame.js", 597);+ _yuitest_coverline("build/frame/frame.js", 594); try {- _yuitest_coverline("build/frame/frame.js", 598);+ _yuitest_coverline("build/frame/frame.js", 595); inst.use('node-base', cb);- _yuitest_coverline("build/frame/frame.js", 599);+ _yuitest_coverline("build/frame/frame.js", 596); if (timer) {- _yuitest_coverline("build/frame/frame.js", 600);+ _yuitest_coverline("build/frame/frame.js", 597); clearInterval(timer); } } catch (e) {- _yuitest_coverline("build/frame/frame.js", 603);+ _yuitest_coverline("build/frame/frame.js", 600); timer = setInterval(function() {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 12)", 603);-_yuitest_coverline("build/frame/frame.js", 604);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 12)", 600);+_yuitest_coverline("build/frame/frame.js", 601); fn(); }, 350); } }, this); - _yuitest_coverline("build/frame/frame.js", 609);+ _yuitest_coverline("build/frame/frame.js", 606); args.push(fn); - _yuitest_coverline("build/frame/frame.js", 611);+ _yuitest_coverline("build/frame/frame.js", 608); Y.use.apply(Y, args); }, this)); - _yuitest_coverline("build/frame/frame.js", 615);+ _yuitest_coverline("build/frame/frame.js", 612); return this; }, /**@@ -916,64 +912,65 @@ * @description Does some tricks on focus to set the proper cursor position. */ _handleFocus: function() {- _yuitest_coverfunc("build/frame/frame.js", "_handleFocus", 622);-_yuitest_coverline("build/frame/frame.js", 623);+ _yuitest_coverfunc("build/frame/frame.js", "_handleFocus", 619);+_yuitest_coverline("build/frame/frame.js", 620); var inst = this.getInstance(),- sel = new inst.EditorSelection();+ sel = new inst.EditorSelection(),+ n, c, b, par; - _yuitest_coverline("build/frame/frame.js", 626);+ _yuitest_coverline("build/frame/frame.js", 624); if (sel.anchorNode) {+ _yuitest_coverline("build/frame/frame.js", 625);+n = sel.anchorNode;+ _yuitest_coverline("build/frame/frame.js", 627);-var n = sel.anchorNode, c;- - _yuitest_coverline("build/frame/frame.js", 629); if (n.test('p') && n.get('innerHTML') === '') {- _yuitest_coverline("build/frame/frame.js", 630);+ _yuitest_coverline("build/frame/frame.js", 628); n = n.get('parentNode'); }- _yuitest_coverline("build/frame/frame.js", 632);+ _yuitest_coverline("build/frame/frame.js", 630); c = n.get('childNodes');- - _yuitest_coverline("build/frame/frame.js", 634);++ _yuitest_coverline("build/frame/frame.js", 632); if (c.size()) {- _yuitest_coverline("build/frame/frame.js", 635);+ _yuitest_coverline("build/frame/frame.js", 633); if (c.item(0).test('br')) {- _yuitest_coverline("build/frame/frame.js", 636);+ _yuitest_coverline("build/frame/frame.js", 634); sel.selectNode(n, true, false);- } else {_yuitest_coverline("build/frame/frame.js", 637);+ } else {_yuitest_coverline("build/frame/frame.js", 635); if (c.item(0).test('p')) {- _yuitest_coverline("build/frame/frame.js", 638);+ _yuitest_coverline("build/frame/frame.js", 636); n = c.item(0).one('br.yui-cursor');- _yuitest_coverline("build/frame/frame.js", 639);+ _yuitest_coverline("build/frame/frame.js", 637); if (n) {- _yuitest_coverline("build/frame/frame.js", 640);+ _yuitest_coverline("build/frame/frame.js", 638); n = n.get('parentNode'); }- _yuitest_coverline("build/frame/frame.js", 642);+ _yuitest_coverline("build/frame/frame.js", 640); if (!n) {- _yuitest_coverline("build/frame/frame.js", 643);+ _yuitest_coverline("build/frame/frame.js", 641); n = c.item(0).get('firstChild'); }- _yuitest_coverline("build/frame/frame.js", 645);+ _yuitest_coverline("build/frame/frame.js", 643); if (!n) {- _yuitest_coverline("build/frame/frame.js", 646);+ _yuitest_coverline("build/frame/frame.js", 644); n = c.item(0); }- _yuitest_coverline("build/frame/frame.js", 648);+ _yuitest_coverline("build/frame/frame.js", 646); if (n) {- _yuitest_coverline("build/frame/frame.js", 649);+ _yuitest_coverline("build/frame/frame.js", 647); sel.selectNode(n, true, false); } } else {- _yuitest_coverline("build/frame/frame.js", 652);-var b = inst.one('br.yui-cursor');- _yuitest_coverline("build/frame/frame.js", 653);+ _yuitest_coverline("build/frame/frame.js", 650);+b = inst.one('br.yui-cursor');+ _yuitest_coverline("build/frame/frame.js", 651); if (b) {- _yuitest_coverline("build/frame/frame.js", 654);-var par = b.get('parentNode');- _yuitest_coverline("build/frame/frame.js", 655);+ _yuitest_coverline("build/frame/frame.js", 652);+par = b.get('parentNode');+ _yuitest_coverline("build/frame/frame.js", 653); if (par) {- _yuitest_coverline("build/frame/frame.js", 656);+ _yuitest_coverline("build/frame/frame.js", 654); sel.selectNode(par, true, false); } }@@ -984,114 +981,114 @@ /** * @method focus * @description Set the focus to the iframe- * @param {Function} fn Callback function to execute after focus happens + * @param {Function} fn Callback function to execute after focus happens * @return {Frame}- * @chainable + * @chainable */ focus: function(fn) {- _yuitest_coverfunc("build/frame/frame.js", "focus", 670);-_yuitest_coverline("build/frame/frame.js", 671);+ _yuitest_coverfunc("build/frame/frame.js", "focus", 668);+_yuitest_coverline("build/frame/frame.js", 669); if (Y.UA.ie && Y.UA.ie < 9) {- _yuitest_coverline("build/frame/frame.js", 672);+ _yuitest_coverline("build/frame/frame.js", 670); try {- _yuitest_coverline("build/frame/frame.js", 673);+ _yuitest_coverline("build/frame/frame.js", 671); Y.one('win').focus();- _yuitest_coverline("build/frame/frame.js", 674);+ _yuitest_coverline("build/frame/frame.js", 672); if (this.getInstance()) {- _yuitest_coverline("build/frame/frame.js", 675);+ _yuitest_coverline("build/frame/frame.js", 673); if (this.getInstance().one('win')) {- _yuitest_coverline("build/frame/frame.js", 676);+ _yuitest_coverline("build/frame/frame.js", 674); this.getInstance().one('win').focus(); } } } catch (ierr) { }- _yuitest_coverline("build/frame/frame.js", 681);+ _yuitest_coverline("build/frame/frame.js", 679); if (fn === true) {- _yuitest_coverline("build/frame/frame.js", 682);+ _yuitest_coverline("build/frame/frame.js", 680); this._handleFocus(); }- _yuitest_coverline("build/frame/frame.js", 684);+ _yuitest_coverline("build/frame/frame.js", 682); if (Y.Lang.isFunction(fn)) {- _yuitest_coverline("build/frame/frame.js", 685);+ _yuitest_coverline("build/frame/frame.js", 683); fn(); } } else {- _yuitest_coverline("build/frame/frame.js", 688);+ _yuitest_coverline("build/frame/frame.js", 686); try {- _yuitest_coverline("build/frame/frame.js", 689);+ _yuitest_coverline("build/frame/frame.js", 687); Y.one('win').focus();- _yuitest_coverline("build/frame/frame.js", 690);+ _yuitest_coverline("build/frame/frame.js", 688); Y.later(100, this, function() {- _yuitest_coverfunc("build/frame/frame.js", "(anonymous 13)", 690);-_yuitest_coverline("build/frame/frame.js", 691);+ _yuitest_coverfunc("build/frame/frame.js", "(anonymous 13)", 688);+_yuitest_coverline("build/frame/frame.js", 689); if (this.getInstance()) {- _yuitest_coverline("build/frame/frame.js", 692);+ _yuitest_coverline("build/frame/frame.js", 690); if (this.getInstance().one('win')) {- _yuitest_coverline("build/frame/frame.js", 693);+ _yuitest_coverline("build/frame/frame.js", 691); this.getInstance().one('win').focus(); } }- _yuitest_coverline("build/frame/frame.js", 696);+ _yuitest_coverline("build/frame/frame.js", 694); if (fn === true) {- _yuitest_coverline("build/frame/frame.js", 697);+ _yuitest_coverline("build/frame/frame.js", 695); this._handleFocus(); }- _yuitest_coverline("build/frame/frame.js", 699);+ _yuitest_coverline("build/frame/frame.js", 697); if (Y.Lang.isFunction(fn)) {- _yuitest_coverline("build/frame/frame.js", 700);+ _yuitest_coverline("build/frame/frame.js", 698); fn(); } }); } catch (ferr) { } }- _yuitest_coverline("build/frame/frame.js", 706);+ _yuitest_coverline("build/frame/frame.js", 704); return this; }, /** * @method show * @description Show the iframe instance * @return {Frame}- * @chainable + * @chainable */ show: function() {- _yuitest_coverfunc("build/frame/frame.js", "show", 714);-_yuitest_coverline("build/frame/frame.js", 715);+ _yuitest_coverfunc("build/frame/frame.js", "show", 712);+_yuitest_coverline("build/frame/frame.js", 713); this._iframe.setStyles({ position: 'static', left: '' });- _yuitest_coverline("build/frame/frame.js", 719);+ _yuitest_coverline("build/frame/frame.js", 717); if (Y.UA.gecko) {- _yuitest_coverline("build/frame/frame.js", 720);+ _yuitest_coverline("build/frame/frame.js", 718); try {- _yuitest_coverline("build/frame/frame.js", 721);+ _yuitest_coverline("build/frame/frame.js", 719); if (this.getInstance()) {- _yuitest_coverline("build/frame/frame.js", 722);+ _yuitest_coverline("build/frame/frame.js", 720); this.getInstance().config.doc.designMode = 'on'; } } catch (e) { }- _yuitest_coverline("build/frame/frame.js", 725);+ _yuitest_coverline("build/frame/frame.js", 723); this.focus();- } - _yuitest_coverline("build/frame/frame.js", 727);+ }+ _yuitest_coverline("build/frame/frame.js", 725); return this; }, /** * @method hide * @description Hide the iframe instance * @return {Frame}- * @chainable + * @chainable */ hide: function() {- _yuitest_coverfunc("build/frame/frame.js", "hide", 735);-_yuitest_coverline("build/frame/frame.js", 736);+ _yuitest_coverfunc("build/frame/frame.js", "hide", 733);+_yuitest_coverline("build/frame/frame.js", 734); this._iframe.setStyles({ position: 'absolute', left: '-999999px' });- _yuitest_coverline("build/frame/frame.js", 740);+ _yuitest_coverline("build/frame/frame.js", 738); return this; } }, {@@ -1131,18 +1128,34 @@ * @description The default css used when creating the document. * @type String */- //DEFAULT_CSS: '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; } img { cursor: pointer !important; border: none; }', DEFAULT_CSS: 'body { 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; } img { cursor: pointer !important; border: none; }', /**+ * The template string used to create the iframe, deprecated to use DOM instead of innerHTML * @static * @property HTML- * @description The template string used to create the iframe * @type String+ * @deprecated */ //HTML: '<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>',- HTML: '<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>', /**+ * Attributes to auto add to the dynamic iframe under the hood * @static+ * @property IFRAME_ATTRS+ * @type Object+ */+ IFRAME_ATTRS: {+ border: '0',+ frameBorder: '0',+ marginWidth: '0',+ marginHeight: '0',+ leftMargin: '0',+ topMargin: '0',+ allowTransparency: 'true',+ width: "100%",+ height: "99%"+ },+ /**+ * @static * @property PAGE_HTML * @description The template used to create the page when created dynamically. * @type String@@ -1157,29 +1170,29 @@ * @return {String} The normalized DocType to apply to the iframe */ getDocType: function() {- _yuitest_coverfunc("build/frame/frame.js", "getDocType", 804);-_yuitest_coverline("build/frame/frame.js", 805);+ _yuitest_coverfunc("build/frame/frame.js", "getDocType", 818);+_yuitest_coverline("build/frame/frame.js", 819); var dt = Y.config.doc.doctype, str = Frame.DOC_TYPE; - _yuitest_coverline("build/frame/frame.js", 808);+ _yuitest_coverline("build/frame/frame.js", 822); if (dt) {- _yuitest_coverline("build/frame/frame.js", 809);+ _yuitest_coverline("build/frame/frame.js", 823); str = '<!DOCTYPE ' + dt.name + ((dt.publicId) ? ' ' + dt.publicId : '') + ((dt.systemId) ? ' ' + dt.systemId : '') + '>'; } else {- _yuitest_coverline("build/frame/frame.js", 811);+ _yuitest_coverline("build/frame/frame.js", 825); if (Y.config.doc.all) {- _yuitest_coverline("build/frame/frame.js", 812);+ _yuitest_coverline("build/frame/frame.js", 826); dt = Y.config.doc.all[0];- _yuitest_coverline("build/frame/frame.js", 813);+ _yuitest_coverline("build/frame/frame.js", 827); if (dt.nodeType) {- _yuitest_coverline("build/frame/frame.js", 814);+ _yuitest_coverline("build/frame/frame.js", 828); if (dt.nodeType === 8) {- _yuitest_coverline("build/frame/frame.js", 815);+ _yuitest_coverline("build/frame/frame.js", 829); if (dt.nodeValue) {- _yuitest_coverline("build/frame/frame.js", 816);+ _yuitest_coverline("build/frame/frame.js", 830); if (dt.nodeValue.toLowerCase().indexOf('doctype') !== -1) {- _yuitest_coverline("build/frame/frame.js", 817);+ _yuitest_coverline("build/frame/frame.js", 831); str = '<!' + dt.nodeValue + '>'; } }@@ -1187,7 +1200,7 @@ } } }- _yuitest_coverline("build/frame/frame.js", 824);+ _yuitest_coverline("build/frame/frame.js", 838); return str; }, /**@@ -1293,8 +1306,8 @@ container: { value: 'body', setter: function(n) {- _yuitest_coverfunc("build/frame/frame.js", "setter", 928);-_yuitest_coverline("build/frame/frame.js", 929);+ _yuitest_coverfunc("build/frame/frame.js", "setter", 942);+_yuitest_coverline("build/frame/frame.js", 943); return Y.one(n); } },@@ -1307,8 +1320,8 @@ readOnly: true, value: null, getter: function() {- _yuitest_coverfunc("build/frame/frame.js", "getter", 940);-_yuitest_coverline("build/frame/frame.js", 941);+ _yuitest_coverfunc("build/frame/frame.js", "getter", 954);+_yuitest_coverline("build/frame/frame.js", 955); return this._iframe; } },@@ -1321,13 +1334,13 @@ id: { writeOnce: true, getter: function(id) {- _yuitest_coverfunc("build/frame/frame.js", "getter", 952);-_yuitest_coverline("build/frame/frame.js", 953);+ _yuitest_coverfunc("build/frame/frame.js", "getter", 966);+_yuitest_coverline("build/frame/frame.js", 967); if (!id) {- _yuitest_coverline("build/frame/frame.js", 954);+ _yuitest_coverline("build/frame/frame.js", 968); id = 'iframe-' + Y.guid(); }- _yuitest_coverline("build/frame/frame.js", 956);+ _yuitest_coverline("build/frame/frame.js", 970); return id; } },@@ -1352,7 +1365,7 @@ }, /** * @attribute host- * @description A reference to the Editor instance + * @description A reference to the Editor instance * @type Object */ host: {@@ -1362,7 +1375,7 @@ * @attribute defaultblock * @description The default tag to use for block level items, defaults to: p * @type String- */ + */ defaultblock: { value: 'p' }@@ -1370,9 +1383,9 @@ }); - _yuitest_coverline("build/frame/frame.js", 998);+ _yuitest_coverline("build/frame/frame.js", 1012); Y.Frame = Frame; -}, '3.7.2', {"requires": ["base", "node", "selector-css3", "yui-throttle"]});+}, '3.7.3', {"requires": ["base", "node", "selector-css3", "yui-throttle"]});
bundle/frame/frame-debug.js view
@@ -1,12 +1,12 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('frame', function (Y, NAME) { -+ /*jshint maxlen: 500 */ /** * Creates a wrapper around an iframe. It loads the content either from a local * file or from script and creates a local YUI instance bound to that new window and document.@@ -20,9 +20,9 @@ var Frame = function() { Frame.superclass.constructor.apply(this, arguments);- }, LAST_CHILD = ':last-child', BODY = 'body';- + }; + Y.extend(Frame, Y.Base, { /** * @private@@ -59,17 +59,17 @@ * @return {Object} Hash table containing references to the new Document & Window */ _create: function(cb) {- var win, doc, res, node, html = '',+ var res, html = '', timer,+ //if the src attr is different than the default, don't create the document+ create = (this.get('src') === Frame.ATTRS.src.value), extra_css = ((this.get('extracss')) ? '<style id="extra_css">' + this.get('extracss') + '</style>' : ''); - this._iframe = Y.Node.create(Frame.HTML);+ this._iframe = Y.one(Y.config.doc.createElement('iframe'));+ this._iframe.setAttrs(Frame.IFRAME_ATTRS);+ this._iframe.setStyle('visibility', 'hidden'); this._iframe.set('src', this.get('src')); this.get('container').append(this._iframe);-- //if the src attr is different than the default, don't create the document- var create = (this.get('src') === Frame.ATTRS.src.value);- this._iframe.set('height', '99%'); if (create) {@@ -85,9 +85,9 @@ DEFAULT_CSS: Frame.DEFAULT_CSS, EXTRA_CSS: extra_css });- if (Y.config.doc.compatMode != 'BackCompat') {+ if (Y.config.doc.compatMode !== 'BackCompat') { Y.log('Adding Doctype to frame: ' + Frame.getDocType(), 'info', 'frame');- + //html = Frame.DOC_TYPE + "\n" + html; html = Frame.getDocType() + "\n" + html; } else {@@ -108,7 +108,7 @@ if (!res.doc.documentElement) { Y.log('document.documentElement was not found, running timer', 'warn', 'frame');- var timer = Y.later(1, this, function() {+ timer = Y.later(1, this, function() { if (res.doc && res.doc.documentElement) { Y.log('document.documentElement found inside timer', 'info', 'frame'); cb(res);@@ -151,7 +151,7 @@ */ _onDomEvent: function(e) { var xy, node;- + if (!Y.Node.getDOMNode(this._iframe)) { //The iframe is null for some reason, bail on sending events. return;@@ -204,7 +204,7 @@ if (e._event.clipboardData) { data = e._event.clipboardData.getData('Text'); }- + if (win.clipboardData) { data = win.clipboardData.getData('Text'); if (data === '') { // Could be empty, or failed@@ -214,12 +214,12 @@ } } }- + e.frameTarget = e.target; e.frameCurrentTarget = e.currentTarget; e.frameEvent = e;- + if (data) { e.clipboardData = { data: data,@@ -263,7 +263,7 @@ }, this); inst.Node.DOM_EVENTS.paste = 1;- + inst.on('paste', Y.bind(this._DOMPaste, this), inst.one('body')); //Adding focus/blur to the window object@@ -276,13 +276,10 @@ visibility: 'inherit' }); inst.one('body').setStyle('display', 'block');- if (Y.UA.ie) {- //this._fixIECursors();- } }, /** * It appears that having a BR tag anywhere in the source "below" a table with a percentage width (in IE 7 & 8)- * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally + * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally * spike. This method finds all <BR>'s below the sourceIndex of the first table. Does some checks to see if they * can be modified and replaces then with a <WBR> so the layout will remain in tact, but the flickering will * no longer happen.@@ -300,7 +297,7 @@ brs.each(function(n) { var p = n.get('parentNode'), c = p.get('children'), b = p.all('>br');- + if (p.test('div')) { if (c.size() > 2) { n.replace(inst.Node.create('<wbr>'));@@ -316,7 +313,7 @@ } } }- + }); } },@@ -331,7 +328,7 @@ this._ready = true; var inst = this.getInstance(), args = Y.clone(this.get('use'));- + this.fire('contentready'); Y.log('On available for body of iframe', 'info', 'frame');@@ -365,7 +362,7 @@ _ieHeightCounter: null, /** * Internal method to set the height of the body to the height of the document in IE.- * With contenteditable being set, the document becomes unresponsive to clicks, this + * With contenteditable being set, the document becomes unresponsive to clicks, this * method expands the body to be the height of the document so that doesn't happen. * @private * @method _ieSetBodyHeight@@ -375,7 +372,7 @@ this._ieHeightCounter = 0; } this._ieHeightCounter++;- var run = false;+ var run = false, inst, h, bh; if (!e) { run = true; }@@ -392,9 +389,9 @@ } if (run) { try {- var inst = this.getInstance();- var h = this._iframe.get('offsetHeight');- var bh = inst.config.doc.body.scrollHeight;+ inst = this.getInstance();+ h = this._iframe.get('offsetHeight');+ bh = inst.config.doc.body.scrollHeight; if (h > bh) { h = (h - 15) + 'px'; inst.config.doc.body.style.height = h;@@ -454,7 +451,7 @@ inst.one('body').set('innerHTML', html); } else { //This needs to be wrapped in a contentready callback for the !_ready state- this.on('contentready', Y.bind(function(html, e) {+ this.on('contentready', Y.bind(function(html) { var inst = this.getInstance(); inst.one('body').set('innerHTML', html); }, this, html));@@ -503,7 +500,7 @@ if (this._ready) { var inst = this.getInstance(), node = inst.one('#extra_css');- + node.remove(); inst.one('head').append('<style id="extra_css">' + css + '</style>'); }@@ -519,7 +516,7 @@ _instanceLoaded: function(inst) { this._instance = inst; this._onContentReady();- + var doc = this._instance.config.doc; if (this.get('designMode')) {@@ -653,17 +650,18 @@ */ _handleFocus: function() { var inst = this.getInstance(),- sel = new inst.EditorSelection();+ sel = new inst.EditorSelection(),+ n, c, b, par; if (sel.anchorNode) { Y.log('_handleFocus being called..', 'info', 'frame');- var n = sel.anchorNode, c;- + n = sel.anchorNode;+ if (n.test('p') && n.get('innerHTML') === '') { n = n.get('parentNode'); } c = n.get('childNodes');- + if (c.size()) { if (c.item(0).test('br')) { sel.selectNode(n, true, false);@@ -682,9 +680,9 @@ sel.selectNode(n, true, false); } } else {- var b = inst.one('br.yui-cursor');+ b = inst.one('br.yui-cursor'); if (b) {- var par = b.get('parentNode');+ par = b.get('parentNode'); if (par) { sel.selectNode(par, true, false); }@@ -696,9 +694,9 @@ /** * @method focus * @description Set the focus to the iframe- * @param {Function} fn Callback function to execute after focus happens + * @param {Function} fn Callback function to execute after focus happens * @return {Frame}- * @chainable + * @chainable */ focus: function(fn) { if (Y.UA.ie && Y.UA.ie < 9) {@@ -744,7 +742,7 @@ * @method show * @description Show the iframe instance * @return {Frame}- * @chainable + * @chainable */ show: function() { this._iframe.setStyles({@@ -758,14 +756,14 @@ } } catch (e) { } this.focus();- } + } return this; }, /** * @method hide * @description Hide the iframe instance * @return {Frame}- * @chainable + * @chainable */ hide: function() { this._iframe.setStyles({@@ -811,18 +809,34 @@ * @description The default css used when creating the document. * @type String */- //DEFAULT_CSS: '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; } img { cursor: pointer !important; border: none; }', DEFAULT_CSS: 'body { 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; } img { cursor: pointer !important; border: none; }', /**+ * The template string used to create the iframe, deprecated to use DOM instead of innerHTML * @static * @property HTML- * @description The template string used to create the iframe * @type String+ * @deprecated */ //HTML: '<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>',- HTML: '<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>', /**+ * Attributes to auto add to the dynamic iframe under the hood * @static+ * @property IFRAME_ATTRS+ * @type Object+ */+ IFRAME_ATTRS: {+ border: '0',+ frameBorder: '0',+ marginWidth: '0',+ marginHeight: '0',+ leftMargin: '0',+ topMargin: '0',+ allowTransparency: 'true',+ width: "100%",+ height: "99%"+ },+ /**+ * @static * @property PAGE_HTML * @description The template used to create the page when created dynamically. * @type String@@ -1012,7 +1026,7 @@ }, /** * @attribute host- * @description A reference to the Editor instance + * @description A reference to the Editor instance * @type Object */ host: {@@ -1022,7 +1036,7 @@ * @attribute defaultblock * @description The default tag to use for block level items, defaults to: p * @type String- */ + */ defaultblock: { value: 'p' }@@ -1034,4 +1048,4 @@ -}, '3.7.2', {"requires": ["base", "node", "selector-css3", "yui-throttle"]});+}, '3.7.3', {"requires": ["base", "node", "selector-css3", "yui-throttle"]});
bundle/frame/frame-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("frame",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r=":last-child",i="body";e.extend(n,e.Base,{_ready:null,_rendered:null,_iframe:null,_instance:null,_create:function(t){var r,i,s,o,u="",a=this.get("extracss")?'<style id="extra_css">'+this.get("extracss")+"</style>":"";this._iframe=e.Node.create(n.HTML),this._iframe.setStyle("visibility","hidden"),this._iframe.set("src",this.get("src")),this.get("container").append(this._iframe);var f=this.get("src")===n.ATTRS.src.value;this._iframe.set("height","99%"),f&&(u=e.Lang.sub(n.PAGE_HTML,{DIR:this.get("dir"),LANG:this.get("lang"),TITLE:this.get("title"),META:n.META,LINKED_CSS:this.get("linkedcss"),CONTENT:this.get("content"),BASE_HREF:this.get("basehref"),DEFAULT_CSS:n.DEFAULT_CSS,EXTRA_CSS:a}),e.config.doc.compatMode!="BackCompat"&&(u=n.getDocType()+"\n"+u)),s=this._resolveWinDoc(),u&&(s.doc.open(),s.doc.write(u),s.doc.close());if(!s.doc.documentElement)var l=e.later(1,this,function(){s.doc&&s.doc.documentElement&&(t(s),l.cancel())},null,!0);else t(s)},_resolveWinDoc:function(t){var n=t?t:{};return n.win=e.Node.getDOMNode(this._iframe.get("contentWindow")),n.doc=e.Node.getDOMNode(this._iframe.get("contentWindow.document")),n.doc||(n.doc=e.config.doc),n.win||(n.win=e.config.win),n},_onDomEvent:function(t){var n,r;if(!e.Node.getDOMNode(this._iframe))return;t.frameX=t.frameY=0,(t.pageX>0||t.pageY>0)&&t.type.substring(0,3)!=="key"&&(r=this._instance.one("win"),n=this._iframe.getXY(),t.frameX=n[0]+t.pageX-r.get("scrollLeft"),t.frameY=n[1]+t.pageY-r.get("scrollTop")),t.frameTarget=t.target,t.frameCurrentTarget=t.currentTarget,t.frameEvent=t,this.fire("dom:"+t.type,t)},initializer:function(){this.publish("ready",{emitFacade:!0,defaultFn:this._defReadyFn})},destructor:function(){var e=this.getInstance();e.one("doc").detachAll(),e=null,this._iframe.remove()},_DOMPaste:function(e){var t=this.getInstance(),n="",r=t.config.win;e._event.originalTarget&&(n=e._event.originalTarget),e._event.clipboardData&&(n=e._event.clipboardData.getData("Text")),r.clipboardData&&(n=r.clipboardData.getData("Text"),n===""&&(r.clipboardData.setData("Text",n)||(n=null))),e.frameTarget=e.target,e.frameCurrentTarget=e.currentTarget,e.frameEvent=e,n?e.clipboardData={data:n,getData:function(){return n}}:e.clipboardData=null,this.fire("dom:paste",e)},_defReadyFn:function(){var t=this.getInstance();e.each(n.DOM_EVENTS,function(r,i){var s=e.bind(this._onDomEvent,this),o=e.UA.ie&&n.THROTTLE_TIME>0?e.throttle(s,n.THROTTLE_TIME):s;t.Node.DOM_EVENTS[i]||(t.Node.DOM_EVENTS[i]=1),r===1&&i!=="focus"&&i!=="blur"&&i!=="paste"&&(i.substring(0,3)==="key"?t.on(i,o,t.config.doc):t.on(i,s,t.config.doc))},this),t.Node.DOM_EVENTS.paste=1,t.on("paste",e.bind(this._DOMPaste,this),t.one("body")),t.on("focus",e.bind(this._onDomEvent,this),t.config.win),t.on("blur",e.bind(this._onDomEvent,this),t.config.win),t.__use=t.use,t.use=e.bind(this.use,this),this._iframe.setStyles({visibility:"inherit"}),t.one("body").setStyle("display","block"),e.UA.ie},_fixIECursors:function(){var e=this.getInstance(),t=e.all("table"),n=e.all("br"),r;t.size()&&n.size()&&(r=t.item(0).get("sourceIndex"),n.each(function(t){var n=t.get("parentNode"),i=n.get("children"),s=n.all(">br");n.test("div")&&(i.size()>2?t.replace(e.Node.create("<wbr>")):t.get("sourceIndex")>r?s.size()&&t.replace(e.Node.create("<wbr>")):s.size()>1&&t.replace(e.Node.create("<wbr>")))}))},_onContentReady:function(t){if(!this._ready){this._ready=!0;var n=this.getInstance(),r=e.clone(this.get("use"));this.fire("contentready"),t&&(n.config.doc=e.Node.getDOMNode(t.target)),r.push(e.bind(function(){n.EditorSelection&&(n.EditorSelection.DEFAULT_BLOCK_TAG=this.get("defaultblock")),this.get("designMode")&&(e.UA.ie?(n.config.doc.body.contentEditable="true",this._ieSetBodyHeight(),n.on("keyup",e.bind(this._ieSetBodyHeight,this),n.config.doc)):n.config.doc.designMode="on"),this.fire("ready")},this)),n.use.apply(n,r),n.one("doc").get("documentElement").addClass("yui-js-enabled")}},_ieHeightCounter:null,_ieSetBodyHeight:function(t){this._ieHeightCounter||(this._ieHeightCounter=0),this._ieHeightCounter++;var n=!1;t||(n=!0);if(t){switch(t.keyCode){case 8:case 13:n=!0}if(t.ctrlKey||t.shiftKey)n=!0}if(n)try{var r=this.getInstance(),i=this._iframe.get("offsetHeight"),s=r.config.doc.body.scrollHeight;i>s?(i=i-15+"px",r.config.doc.body.style.height=i):r.config.doc.body.style.height="auto"}catch(t){this._ieHeightCounter<100&&e.later(200,this,this._ieSetBodyHeight)}},_resolveBaseHref:function(t){if(!t||t==="")t=e.config.doc.location.href,t.indexOf("?")!==-1&&(t=t.substring(0,t.indexOf("?"))),t=t.substring(0,t.lastIndexOf("/"))+"/";return t},_getHTML:function(e){if(this._ready){var t=this.getInstance();e=t.one("body").get("innerHTML")}return e},_setHTML:function(t){if(this._ready){var n=this.getInstance();n.one("body").set("innerHTML",t)}else this.on("contentready",e.bind(function(e,t){var n=this.getInstance();n.one("body").set("innerHTML",e)},this,t));return t},_getLinkedCSS:function(t){e.Lang.isArray(t)||(t=[t]);var n="";return this._ready?n=t:e.each(t,function(e){e!==""&&(n+='<link rel="stylesheet" href="'+e+'" type="text/css">')}),n},_setLinkedCSS:function(e){if(this._ready){var t=this.getInstance();t.Get.css(e)}return e},_setExtraCSS:function(e){if(this._ready){var t=this.getInstance(),n=t.one("#extra_css");n.remove(),t.one("head").append('<style id="extra_css">'+e+"</style>")}return e},_instanceLoaded:function(t){this._instance=t,this._onContentReady();var n=this._instance.config.doc;if(this.get("designMode")&&!e.UA.ie)try{n.execCommand("styleWithCSS",!1,!1),n.execCommand("insertbronreturn",!1,!1)}catch(r){}},use:function(){var t=this.getInstance(),n=e.Array(arguments),r=!1;e.Lang.isFunction(n[n.length-1])&&(r=n.pop()),r&&n.push(function(){r.apply(t,arguments)}),t.__use.apply(t,n)},delegate:function(e,t,n,r){var i=this.getInstance();return i?(r||(r=n,n="body"),i.delegate(e,t,n,r)):!1},getInstance:function(){return this._instance},render:function(t){return this._rendered?this:(this._rendered=!0,t&&this.set("container",t),this._create(e.bind(function(t){var n,r,i=e.bind(function(e){this._instanceLoaded(e)},this),s=e.clone(this.get("use")),o={debug:!1,win:t.win,doc:t.doc},u=e.bind(function(){o=this._resolveWinDoc(o),n=YUI(o),n.host=this.get("host");try{n.use("node-base",i),r&&clearInterval(r)}catch(e){r=setInterval(function(){u()},350)}},this);s.push(u),e.use.apply(e,s)},this)),this)},_handleFocus:function(){var e=this.getInstance(),t=new e.EditorSelection;if(t.anchorNode){var n=t.anchorNode,r;n.test("p")&&n.get("innerHTML")===""&&(n=n.get("parentNode")),r=n.get("childNodes");if(r.size())if(r.item(0).test("br"))t.selectNode(n,!0,!1);else if(r.item(0).test("p"))n=r.item(0).one("br.yui-cursor"),n&&(n=n.get("parentNode")),n||(n=r.item(0).get("firstChild")),n||(n=r.item(0)),n&&t.selectNode(n,!0,!1);else{var i=e.one("br.yui-cursor");if(i){var s=i.get("parentNode");s&&t.selectNode(s,!0,!1)}}}},focus:function(t){if(e.UA.ie&&e.UA.ie<9){try{e.one("win").focus(),this.getInstance()&&this.getInstance().one("win")&&this.getInstance().one("win").focus()}catch(n){}t===!0&&this._handleFocus(),e.Lang.isFunction(t)&&t()}else try{e.one("win").focus(),e.later(100,this,function(){this.getInstance()&&this.getInstance().one("win")&&this.getInstance().one("win").focus(),t===!0&&this._handleFocus(),e.Lang.isFunction(t)&&t()})}catch(r){}return this},show:function(){this._iframe.setStyles({position:"static",left:""});if(e.UA.gecko){try{this.getInstance()&&(this.getInstance().config.doc.designMode="on")}catch(t){}this.focus()}return this},hide:function(){return this._iframe.setStyles({position:"absolute",left:"-999999px"}),this}},{THROTTLE_TIME:100,DOM_EVENTS:{dblclick:1,click:1,paste:1,mouseup:1,mousedown:1,keyup:1,keydown:1,keypress:1,activate:1,deactivate:1,beforedeactivate:1,focusin:1,focusout:1},DEFAULT_CSS:"body { 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; } img { cursor: pointer !important; border: none; }",HTML:'<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>',PAGE_HTML:'<html dir="{DIR}" lang="{LANG}"><head><title>{TITLE}</title>{META}<base href="{BASE_HREF}"/>{LINKED_CSS}<style id="editor_css">{DEFAULT_CSS}</style>{EXTRA_CSS}</head><body>{CONTENT}</body></html>',getDocType:function(){var t=e.config.doc.doctype,r=n.DOC_TYPE;return t?r="<!DOCTYPE "+t.name+(t.publicId?" "+t.publicId:"")+(t.systemId?" "+t.systemId:"")+">":e.config.doc.all&&(t=e.config.doc.all[0],t.nodeType&&t.nodeType===8&&t.nodeValue&&t.nodeValue.toLowerCase().indexOf("doctype")!==-1&&(r="<!"+t.nodeValue+">")),r},DOC_TYPE:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',META:'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=7">',NAME:"frame",ATTRS:{title:{value:"Blank Page"},dir:{value:"ltr"},lang:{value:"en-US"},src:{value:"javascript"+(e.UA.ie?":false":":")+";"},designMode:{writeOnce:!0,value:!1},content:{value:"<br>",setter:"_setHTML",getter:"_getHTML"},basehref:{value:!1,getter:"_resolveBaseHref"},use:{writeOnce:!0,value:["node","node-style","selector-css3"]},container:{value:"body",setter:function(t){return e.one(t)}},node:{readOnly:!0,value:null,getter:function(){return this._iframe}},id:{writeOnce:!0,getter:function(t){return t||(t="iframe-"+e.guid()),t}},linkedcss:{value:"",getter:"_getLinkedCSS",setter:"_setLinkedCSS"},extracss:{value:"",setter:"_setExtraCSS"},host:{value:!1},defaultblock:{value:"p"}}}),e.Frame=n},"3.7.2",{requires:["base","node","selector-css3","yui-throttle"]});+YUI.add("frame",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{_ready:null,_rendered:null,_iframe:null,_instance:null,_create:function(t){var r,i="",s,o=this.get("src")===n.ATTRS.src.value,u=this.get("extracss")?'<style id="extra_css">'+this.get("extracss")+"</style>":"";this._iframe=e.one(e.config.doc.createElement("iframe")),this._iframe.setAttrs(n.IFRAME_ATTRS),this._iframe.setStyle("visibility","hidden"),this._iframe.set("src",this.get("src")),this.get("container").append(this._iframe),this._iframe.set("height","99%"),o&&(i=e.Lang.sub(n.PAGE_HTML,{DIR:this.get("dir"),LANG:this.get("lang"),TITLE:this.get("title"),META:n.META,LINKED_CSS:this.get("linkedcss"),CONTENT:this.get("content"),BASE_HREF:this.get("basehref"),DEFAULT_CSS:n.DEFAULT_CSS,EXTRA_CSS:u}),e.config.doc.compatMode!=="BackCompat"&&(i=n.getDocType()+"\n"+i)),r=this._resolveWinDoc(),i&&(r.doc.open(),r.doc.write(i),r.doc.close()),r.doc.documentElement?t(r):s=e.later(1,this,function(){r.doc&&r.doc.documentElement&&(t(r),s.cancel())},null,!0)},_resolveWinDoc:function(t){var n=t?t:{};return n.win=e.Node.getDOMNode(this._iframe.get("contentWindow")),n.doc=e.Node.getDOMNode(this._iframe.get("contentWindow.document")),n.doc||(n.doc=e.config.doc),n.win||(n.win=e.config.win),n},_onDomEvent:function(t){var n,r;if(!e.Node.getDOMNode(this._iframe))return;t.frameX=t.frameY=0,(t.pageX>0||t.pageY>0)&&t.type.substring(0,3)!=="key"&&(r=this._instance.one("win"),n=this._iframe.getXY(),t.frameX=n[0]+t.pageX-r.get("scrollLeft"),t.frameY=n[1]+t.pageY-r.get("scrollTop")),t.frameTarget=t.target,t.frameCurrentTarget=t.currentTarget,t.frameEvent=t,this.fire("dom:"+t.type,t)},initializer:function(){this.publish("ready",{emitFacade:!0,defaultFn:this._defReadyFn})},destructor:function(){var e=this.getInstance();e.one("doc").detachAll(),e=null,this._iframe.remove()},_DOMPaste:function(e){var t=this.getInstance(),n="",r=t.config.win;e._event.originalTarget&&(n=e._event.originalTarget),e._event.clipboardData&&(n=e._event.clipboardData.getData("Text")),r.clipboardData&&(n=r.clipboardData.getData("Text"),n===""&&(r.clipboardData.setData("Text",n)||(n=null))),e.frameTarget=e.target,e.frameCurrentTarget=e.currentTarget,e.frameEvent=e,n?e.clipboardData={data:n,getData:function(){return n}}:e.clipboardData=null,this.fire("dom:paste",e)},_defReadyFn:function(){var t=this.getInstance();e.each(n.DOM_EVENTS,function(r,i){var s=e.bind(this._onDomEvent,this),o=e.UA.ie&&n.THROTTLE_TIME>0?e.throttle(s,n.THROTTLE_TIME):s;t.Node.DOM_EVENTS[i]||(t.Node.DOM_EVENTS[i]=1),r===1&&i!=="focus"&&i!=="blur"&&i!=="paste"&&(i.substring(0,3)==="key"?t.on(i,o,t.config.doc):t.on(i,s,t.config.doc))},this),t.Node.DOM_EVENTS.paste=1,t.on("paste",e.bind(this._DOMPaste,this),t.one("body")),t.on("focus",e.bind(this._onDomEvent,this),t.config.win),t.on("blur",e.bind(this._onDomEvent,this),t.config.win),t.__use=t.use,t.use=e.bind(this.use,this),this._iframe.setStyles({visibility:"inherit"}),t.one("body").setStyle("display","block")},_fixIECursors:function(){var e=this.getInstance(),t=e.all("table"),n=e.all("br"),r;t.size()&&n.size()&&(r=t.item(0).get("sourceIndex"),n.each(function(t){var n=t.get("parentNode"),i=n.get("children"),s=n.all(">br");n.test("div")&&(i.size()>2?t.replace(e.Node.create("<wbr>")):t.get("sourceIndex")>r?s.size()&&t.replace(e.Node.create("<wbr>")):s.size()>1&&t.replace(e.Node.create("<wbr>")))}))},_onContentReady:function(t){if(!this._ready){this._ready=!0;var n=this.getInstance(),r=e.clone(this.get("use"));this.fire("contentready"),t&&(n.config.doc=e.Node.getDOMNode(t.target)),r.push(e.bind(function(){n.EditorSelection&&(n.EditorSelection.DEFAULT_BLOCK_TAG=this.get("defaultblock")),this.get("designMode")&&(e.UA.ie?(n.config.doc.body.contentEditable="true",this._ieSetBodyHeight(),n.on("keyup",e.bind(this._ieSetBodyHeight,this),n.config.doc)):n.config.doc.designMode="on"),this.fire("ready")},this)),n.use.apply(n,r),n.one("doc").get("documentElement").addClass("yui-js-enabled")}},_ieHeightCounter:null,_ieSetBodyHeight:function(t){this._ieHeightCounter||(this._ieHeightCounter=0),this._ieHeightCounter++;var n=!1,r,i,s;t||(n=!0);if(t){switch(t.keyCode){case 8:case 13:n=!0}if(t.ctrlKey||t.shiftKey)n=!0}if(n)try{r=this.getInstance(),i=this._iframe.get("offsetHeight"),s=r.config.doc.body.scrollHeight,i>s?(i=i-15+"px",r.config.doc.body.style.height=i):r.config.doc.body.style.height="auto"}catch(t){this._ieHeightCounter<100&&e.later(200,this,this._ieSetBodyHeight)}},_resolveBaseHref:function(t){if(!t||t==="")t=e.config.doc.location.href,t.indexOf("?")!==-1&&(t=t.substring(0,t.indexOf("?"))),t=t.substring(0,t.lastIndexOf("/"))+"/";return t},_getHTML:function(e){if(this._ready){var t=this.getInstance();e=t.one("body").get("innerHTML")}return e},_setHTML:function(t){if(this._ready){var n=this.getInstance();n.one("body").set("innerHTML",t)}else this.on("contentready",e.bind(function(e){var t=this.getInstance();t.one("body").set("innerHTML",e)},this,t));return t},_getLinkedCSS:function(t){e.Lang.isArray(t)||(t=[t]);var n="";return this._ready?n=t:e.each(t,function(e){e!==""&&(n+='<link rel="stylesheet" href="'+e+'" type="text/css">')}),n},_setLinkedCSS:function(e){if(this._ready){var t=this.getInstance();t.Get.css(e)}return e},_setExtraCSS:function(e){if(this._ready){var t=this.getInstance(),n=t.one("#extra_css");n.remove(),t.one("head").append('<style id="extra_css">'+e+"</style>")}return e},_instanceLoaded:function(t){this._instance=t,this._onContentReady();var n=this._instance.config.doc;if(this.get("designMode")&&!e.UA.ie)try{n.execCommand("styleWithCSS",!1,!1),n.execCommand("insertbronreturn",!1,!1)}catch(r){}},use:function(){var t=this.getInstance(),n=e.Array(arguments),r=!1;e.Lang.isFunction(n[n.length-1])&&(r=n.pop()),r&&n.push(function(){r.apply(t,arguments)}),t.__use.apply(t,n)},delegate:function(e,t,n,r){var i=this.getInstance();return i?(r||(r=n,n="body"),i.delegate(e,t,n,r)):!1},getInstance:function(){return this._instance},render:function(t){return this._rendered?this:(this._rendered=!0,t&&this.set("container",t),this._create(e.bind(function(t){var n,r,i=e.bind(function(e){this._instanceLoaded(e)},this),s=e.clone(this.get("use")),o={debug:!1,win:t.win,doc:t.doc},u=e.bind(function(){o=this._resolveWinDoc(o),n=YUI(o),n.host=this.get("host");try{n.use("node-base",i),r&&clearInterval(r)}catch(e){r=setInterval(function(){u()},350)}},this);s.push(u),e.use.apply(e,s)},this)),this)},_handleFocus:function(){var e=this.getInstance(),t=new e.EditorSelection,n,r,i,s;t.anchorNode&&(n=t.anchorNode,n.test("p")&&n.get("innerHTML")===""&&(n=n.get("parentNode")),r=n.get("childNodes"),r.size()&&(r.item(0).test("br")?t.selectNode(n,!0,!1):r.item(0).test("p")?(n=r.item(0).one("br.yui-cursor"),n&&(n=n.get("parentNode")),n||(n=r.item(0).get("firstChild")),n||(n=r.item(0)),n&&t.selectNode(n,!0,!1)):(i=e.one("br.yui-cursor"),i&&(s=i.get("parentNode"),s&&t.selectNode(s,!0,!1)))))},focus:function(t){if(e.UA.ie&&e.UA.ie<9){try{e.one("win").focus(),this.getInstance()&&this.getInstance().one("win")&&this.getInstance().one("win").focus()}catch(n){}t===!0&&this._handleFocus(),e.Lang.isFunction(t)&&t()}else try{e.one("win").focus(),e.later(100,this,function(){this.getInstance()&&this.getInstance().one("win")&&this.getInstance().one("win").focus(),t===!0&&this._handleFocus(),e.Lang.isFunction(t)&&t()})}catch(r){}return this},show:function(){this._iframe.setStyles({position:"static",left:""});if(e.UA.gecko){try{this.getInstance()&&(this.getInstance().config.doc.designMode="on")}catch(t){}this.focus()}return this},hide:function(){return this._iframe.setStyles({position:"absolute",left:"-999999px"}),this}},{THROTTLE_TIME:100,DOM_EVENTS:{dblclick:1,click:1,paste:1,mouseup:1,mousedown:1,keyup:1,keydown:1,keypress:1,activate:1,deactivate:1,beforedeactivate:1,focusin:1,focusout:1},DEFAULT_CSS:"body { 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; } img { cursor: pointer !important; border: none; }",IFRAME_ATTRS:{border:"0",frameBorder:"0",marginWidth:"0",marginHeight:"0",leftMargin:"0",topMargin:"0",allowTransparency:"true",width:"100%",height:"99%"},PAGE_HTML:'<html dir="{DIR}" lang="{LANG}"><head><title>{TITLE}</title>{META}<base href="{BASE_HREF}"/>{LINKED_CSS}<style id="editor_css">{DEFAULT_CSS}</style>{EXTRA_CSS}</head><body>{CONTENT}</body></html>',getDocType:function(){var t=e.config.doc.doctype,r=n.DOC_TYPE;return t?r="<!DOCTYPE "+t.name+(t.publicId?" "+t.publicId:"")+(t.systemId?" "+t.systemId:"")+">":e.config.doc.all&&(t=e.config.doc.all[0],t.nodeType&&t.nodeType===8&&t.nodeValue&&t.nodeValue.toLowerCase().indexOf("doctype")!==-1&&(r="<!"+t.nodeValue+">")),r},DOC_TYPE:'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',META:'<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta http-equiv="X-UA-Compatible" content="IE=7">',NAME:"frame",ATTRS:{title:{value:"Blank Page"},dir:{value:"ltr"},lang:{value:"en-US"},src:{value:"javascript"+(e.UA.ie?":false":":")+";"},designMode:{writeOnce:!0,value:!1},content:{value:"<br>",setter:"_setHTML",getter:"_getHTML"},basehref:{value:!1,getter:"_resolveBaseHref"},use:{writeOnce:!0,value:["node","node-style","selector-css3"]},container:{value:"body",setter:function(t){return e.one(t)}},node:{readOnly:!0,value:null,getter:function(){return this._iframe}},id:{writeOnce:!0,getter:function(t){return t||(t="iframe-"+e.guid()),t}},linkedcss:{value:"",getter:"_getLinkedCSS",setter:"_setLinkedCSS"},extracss:{value:"",setter:"_setExtraCSS"},host:{value:!1},defaultblock:{value:"p"}}}),e.Frame=n},"3.7.3",{requires:["base","node","selector-css3","yui-throttle"]});
bundle/frame/frame.js view
@@ -1,12 +1,12 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('frame', function (Y, NAME) { -+ /*jshint maxlen: 500 */ /** * Creates a wrapper around an iframe. It loads the content either from a local * file or from script and creates a local YUI instance bound to that new window and document.@@ -20,9 +20,9 @@ var Frame = function() { Frame.superclass.constructor.apply(this, arguments);- }, LAST_CHILD = ':last-child', BODY = 'body';- + }; + Y.extend(Frame, Y.Base, { /** * @private@@ -59,17 +59,17 @@ * @return {Object} Hash table containing references to the new Document & Window */ _create: function(cb) {- var win, doc, res, node, html = '',+ var res, html = '', timer,+ //if the src attr is different than the default, don't create the document+ create = (this.get('src') === Frame.ATTRS.src.value), extra_css = ((this.get('extracss')) ? '<style id="extra_css">' + this.get('extracss') + '</style>' : ''); - this._iframe = Y.Node.create(Frame.HTML);+ this._iframe = Y.one(Y.config.doc.createElement('iframe'));+ this._iframe.setAttrs(Frame.IFRAME_ATTRS);+ this._iframe.setStyle('visibility', 'hidden'); this._iframe.set('src', this.get('src')); this.get('container').append(this._iframe);-- //if the src attr is different than the default, don't create the document- var create = (this.get('src') === Frame.ATTRS.src.value);- this._iframe.set('height', '99%'); if (create) {@@ -84,8 +84,8 @@ DEFAULT_CSS: Frame.DEFAULT_CSS, EXTRA_CSS: extra_css });- if (Y.config.doc.compatMode != 'BackCompat') {- + if (Y.config.doc.compatMode !== 'BackCompat') {+ //html = Frame.DOC_TYPE + "\n" + html; html = Frame.getDocType() + "\n" + html; } else {@@ -102,7 +102,7 @@ } if (!res.doc.documentElement) {- var timer = Y.later(1, this, function() {+ timer = Y.later(1, this, function() { if (res.doc && res.doc.documentElement) { cb(res); timer.cancel();@@ -143,7 +143,7 @@ */ _onDomEvent: function(e) { var xy, node;- + if (!Y.Node.getDOMNode(this._iframe)) { //The iframe is null for some reason, bail on sending events. return;@@ -195,7 +195,7 @@ if (e._event.clipboardData) { data = e._event.clipboardData.getData('Text'); }- + if (win.clipboardData) { data = win.clipboardData.getData('Text'); if (data === '') { // Could be empty, or failed@@ -205,12 +205,12 @@ } } }- + e.frameTarget = e.target; e.frameCurrentTarget = e.currentTarget; e.frameEvent = e;- + if (data) { e.clipboardData = { data: data,@@ -252,7 +252,7 @@ }, this); inst.Node.DOM_EVENTS.paste = 1;- + inst.on('paste', Y.bind(this._DOMPaste, this), inst.one('body')); //Adding focus/blur to the window object@@ -265,13 +265,10 @@ visibility: 'inherit' }); inst.one('body').setStyle('display', 'block');- if (Y.UA.ie) {- //this._fixIECursors();- } }, /** * It appears that having a BR tag anywhere in the source "below" a table with a percentage width (in IE 7 & 8)- * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally + * if there is any TEXTINPUT's outside the iframe, the cursor will rapidly flickr and the CPU would occasionally * spike. This method finds all <BR>'s below the sourceIndex of the first table. Does some checks to see if they * can be modified and replaces then with a <WBR> so the layout will remain in tact, but the flickering will * no longer happen.@@ -289,7 +286,7 @@ brs.each(function(n) { var p = n.get('parentNode'), c = p.get('children'), b = p.all('>br');- + if (p.test('div')) { if (c.size() > 2) { n.replace(inst.Node.create('<wbr>'));@@ -305,7 +302,7 @@ } } }- + }); } },@@ -320,7 +317,7 @@ this._ready = true; var inst = this.getInstance(), args = Y.clone(this.get('use'));- + this.fire('contentready'); if (e) {@@ -351,7 +348,7 @@ _ieHeightCounter: null, /** * Internal method to set the height of the body to the height of the document in IE.- * With contenteditable being set, the document becomes unresponsive to clicks, this + * With contenteditable being set, the document becomes unresponsive to clicks, this * method expands the body to be the height of the document so that doesn't happen. * @private * @method _ieSetBodyHeight@@ -361,7 +358,7 @@ this._ieHeightCounter = 0; } this._ieHeightCounter++;- var run = false;+ var run = false, inst, h, bh; if (!e) { run = true; }@@ -378,9 +375,9 @@ } if (run) { try {- var inst = this.getInstance();- var h = this._iframe.get('offsetHeight');- var bh = inst.config.doc.body.scrollHeight;+ inst = this.getInstance();+ h = this._iframe.get('offsetHeight');+ bh = inst.config.doc.body.scrollHeight; if (h > bh) { h = (h - 15) + 'px'; inst.config.doc.body.style.height = h;@@ -439,7 +436,7 @@ inst.one('body').set('innerHTML', html); } else { //This needs to be wrapped in a contentready callback for the !_ready state- this.on('contentready', Y.bind(function(html, e) {+ this.on('contentready', Y.bind(function(html) { var inst = this.getInstance(); inst.one('body').set('innerHTML', html); }, this, html));@@ -488,7 +485,7 @@ if (this._ready) { var inst = this.getInstance(), node = inst.one('#extra_css');- + node.remove(); inst.one('head').append('<style id="extra_css">' + css + '</style>'); }@@ -504,7 +501,7 @@ _instanceLoaded: function(inst) { this._instance = inst; this._onContentReady();- + var doc = this._instance.config.doc; if (this.get('designMode')) {@@ -627,16 +624,17 @@ */ _handleFocus: function() { var inst = this.getInstance(),- sel = new inst.EditorSelection();+ sel = new inst.EditorSelection(),+ n, c, b, par; if (sel.anchorNode) {- var n = sel.anchorNode, c;- + n = sel.anchorNode;+ if (n.test('p') && n.get('innerHTML') === '') { n = n.get('parentNode'); } c = n.get('childNodes');- + if (c.size()) { if (c.item(0).test('br')) { sel.selectNode(n, true, false);@@ -655,9 +653,9 @@ sel.selectNode(n, true, false); } } else {- var b = inst.one('br.yui-cursor');+ b = inst.one('br.yui-cursor'); if (b) {- var par = b.get('parentNode');+ par = b.get('parentNode'); if (par) { sel.selectNode(par, true, false); }@@ -669,9 +667,9 @@ /** * @method focus * @description Set the focus to the iframe- * @param {Function} fn Callback function to execute after focus happens + * @param {Function} fn Callback function to execute after focus happens * @return {Frame}- * @chainable + * @chainable */ focus: function(fn) { if (Y.UA.ie && Y.UA.ie < 9) {@@ -715,7 +713,7 @@ * @method show * @description Show the iframe instance * @return {Frame}- * @chainable + * @chainable */ show: function() { this._iframe.setStyles({@@ -729,14 +727,14 @@ } } catch (e) { } this.focus();- } + } return this; }, /** * @method hide * @description Hide the iframe instance * @return {Frame}- * @chainable + * @chainable */ hide: function() { this._iframe.setStyles({@@ -782,18 +780,34 @@ * @description The default css used when creating the document. * @type String */- //DEFAULT_CSS: '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; } img { cursor: pointer !important; border: none; }', DEFAULT_CSS: 'body { 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; } img { cursor: pointer !important; border: none; }', /**+ * The template string used to create the iframe, deprecated to use DOM instead of innerHTML * @static * @property HTML- * @description The template string used to create the iframe * @type String+ * @deprecated */ //HTML: '<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>',- HTML: '<iframe border="0" frameBorder="0" marginWidth="0" marginHeight="0" leftMargin="0" topMargin="0" allowTransparency="true" width="100%" height="99%"></iframe>', /**+ * Attributes to auto add to the dynamic iframe under the hood * @static+ * @property IFRAME_ATTRS+ * @type Object+ */+ IFRAME_ATTRS: {+ border: '0',+ frameBorder: '0',+ marginWidth: '0',+ marginHeight: '0',+ leftMargin: '0',+ topMargin: '0',+ allowTransparency: 'true',+ width: "100%",+ height: "99%"+ },+ /**+ * @static * @property PAGE_HTML * @description The template used to create the page when created dynamically. * @type String@@ -983,7 +997,7 @@ }, /** * @attribute host- * @description A reference to the Editor instance + * @description A reference to the Editor instance * @type Object */ host: {@@ -993,7 +1007,7 @@ * @attribute defaultblock * @description The default tag to use for block level items, defaults to: p * @type String- */ + */ defaultblock: { value: 'p' }@@ -1005,4 +1019,4 @@ -}, '3.7.2', {"requires": ["base", "node", "selector-css3", "yui-throttle"]});+}, '3.7.3', {"requires": ["base", "node", "selector-css3", "yui-throttle"]});
bundle/gesture-simulate/gesture-simulate-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/gesture-simulate/gesture-simulate.js", code: [] };-_yuitest_coverage["build/gesture-simulate/gesture-simulate.js"].code=["YUI.add('gesture-simulate', function (Y, NAME) {","","/**"," * Simulate high-level user gestures by generating a set of native DOM events."," *"," * @module gesture-simulate"," * @requires event-simulate, async-queue, node-screen"," */","","var NAME = \"gesture-simulate\",",""," // phantomjs check may be temporary, until we determine if it really support touch all the way through, like it claims to (http://code.google.com/p/phantomjs/issues/detail?id=375)"," SUPPORTS_TOUCH = ((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.phantomjs) && !(Y.UA.chrome && Y.UA.chrome < 6)),",""," gestureNames = {"," tap: 1,"," doubletap: 1,"," press: 1,"," move: 1,"," flick: 1,"," pinch: 1,"," rotate: 1"," },",""," touchEvents = {"," touchstart: 1,"," touchmove: 1,"," touchend: 1,"," touchcancel: 1"," },",""," document = Y.config.doc,"," emptyTouchList,",""," EVENT_INTERVAL = 20, // 20ms"," START_PAGEX, // will be adjusted to the node element center"," START_PAGEY, // will be adjusted to the node element center",""," // defaults that user can override."," DEFAULTS = {"," // tap gestures"," HOLD_TAP: 10, // 10ms"," DELAY_TAP: 10, // 10ms",""," // press gesture"," HOLD_PRESS: 3000, // 3sec"," MIN_HOLD_PRESS: 1000, // 1sec"," MAX_HOLD_PRESS: 60000, // 1min",""," // move gesture"," DISTANCE_MOVE: 200, // 200 pixels"," DURATION_MOVE: 1000, // 1sec"," MAX_DURATION_MOVE: 5000,// 5sec",""," // flick gesture"," MIN_VELOCITY_FLICK: 1.3,"," DISTANCE_FLICK: 200, // 200 pixels"," DURATION_FLICK: 1000, // 1sec"," MAX_DURATION_FLICK: 5000,// 5sec",""," // pinch/rotation"," DURATION_PINCH: 1000 // 1sec"," },",""," TOUCH_START = 'touchstart',"," TOUCH_MOVE = 'touchmove',"," TOUCH_END = 'touchend',",""," GESTURE_START = 'gesturestart',"," GESTURE_CHANGE = 'gesturechange',"," GESTURE_END = 'gestureend',",""," MOUSE_UP = 'mouseup',"," MOUSE_MOVE = 'mousemove',"," MOUSE_DOWN = 'mousedown',"," MOUSE_CLICK = 'click',"," MOUSE_DBLCLICK = 'dblclick',",""," X_AXIS = 'x',"," Y_AXIS = 'y';","","/**"," *"," */","function Simulations(node) {"," if(!node) {"," Y.error(NAME+': invalid target node');"," }"," this.node = node;"," this.target = Y.Node.getDOMNode(node);",""," var startXY = this.node.getXY(),"," dims = this._getDims();",""," START_PAGEX = startXY[0] + (dims[0])/2;"," START_PAGEY = startXY[1] + (dims[1])/2;","}","","Simulations.prototype = {",""," /**"," * Helper method to convert a degree to a radian."," * "," * @method _toRadian"," * @private"," * @param {Number} deg A degree to be converted to a radian."," * @return {Number} The degree in radian. "," */"," _toRadian: function(deg) {"," return deg * (Math.PI/180);"," },",""," /**"," * Helper method to get height/width while accounting for "," * rotation/scale transforms where possible by using the "," * bounding client rectangle height/width instead of the "," * offsetWidth/Height which region uses."," * @method _getDims"," * @private"," * @return {Array} Array with [height, width]"," */"," _getDims : function() {"," var region,"," width,"," height;",""," // Ideally, this should be in DOM somewhere."," if (this.target.getBoundingClientRect) {"," region = this.target.getBoundingClientRect();",""," if (\"height\" in region) {"," height = region.height;"," } else {"," // IE7,8 has getBCR, but no height."," height = Math.abs(region.bottom - region.top);"," }",""," if (\"width\" in region) {"," width = region.width;"," } else {"," // IE7,8 has getBCR, but no width."," width = Math.abs(region.right - region.left);"," }"," } else {"," region = this.node.get(\"region\");"," width = region.width;"," height = region.height;"," }",""," return [width, height];"," },",""," /**"," * Helper method to convert a point relative to the node element into "," * the point in the page coordination."," * "," * @method _calculateDefaultPoint"," * @private"," * @param {Array} point A point relative to the node element."," * @return {Array} The same point in the page coordination. "," */"," _calculateDefaultPoint: function(point) {",""," var height;",""," if(!Y.Lang.isArray(point) || point.length === 0) {"," point = [START_PAGEX, START_PAGEY];"," } else {"," if(point.length == 1) {"," height = this._getDims[1];"," point[1] = height/2;"," }"," // convert to page(viewport) coordination"," point[0] = this.node.getX() + point[0];"," point[1] = this.node.getY() + point[1];"," }",""," return point;"," },",""," /**"," * The \"rotate\" and \"pinch\" methods are essencially same with the exact same "," * arguments. Only difference is the required parameters. The rotate method "," * requires \"rotation\" parameter while the pinch method requires \"startRadius\" "," * and \"endRadius\" parameters."," *"," * @method rotate"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} center A center point where the pinch gesture of two fingers"," * should happen. It is relative to the top left corner of the target "," * node element."," * @param {Number} startRadius A radius of start circle where 2 fingers are "," * on when the gesture starts. This is optional. The default is a fourth of "," * either target node width or height whichever is smaller."," * @param {Number} endRadius A radius of end circle where 2 fingers will be on when"," * the pinch or spread gestures are completed. This is optional. "," * The default is a fourth of either target node width or height whichever is less."," * @param {Number} duration A duration of the gesture in millisecond."," * @param {Number} start A start angle(0 degree at 12 o'clock) where the "," * gesture should start. Default is 0. "," * @param {Number} rotation A rotation in degree. It is required."," */"," rotate: function(cb, center, startRadius, endRadius, duration, start, rotation) {"," var radius,"," r1 = startRadius, // optional"," r2 = endRadius; // optional",""," if(!Y.Lang.isNumber(r1) || !Y.Lang.isNumber(r2) || r1<0 || r2<0) {"," radius = (this.target.offsetWidth < this.target.offsetHeight)? "," this.target.offsetWidth/4 : this.target.offsetHeight/4;"," r1 = radius;"," r2 = radius;"," }",""," // required"," if(!Y.Lang.isNumber(rotation)) {"," Y.error(NAME+'Invalid rotation detected.');"," }",""," this.pinch(cb, center, r1, r2, duration, start, rotation);"," },",""," /**"," * The \"rotate\" and \"pinch\" methods are essencially same with the exact same "," * arguments. Only difference is the required parameters. The rotate method "," * requires \"rotation\" parameter while the pinch method requires \"startRadius\" "," * and \"endRadius\" parameters."," *"," * The \"pinch\" gesture can simulate various 2 finger gestures such as pinch, "," * spread and/or rotation. The \"startRadius\" and \"endRadius\" are required."," * If endRadius is larger than startRadius, it becomes a spread gesture "," * otherwise a pinch gesture. "," *"," * @method pinch"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} center A center point where the pinch gesture of two fingers"," * should happen. It is relative to the top left corner of the target "," * node element."," * @param {Number} startRadius A radius of start circle where 2 fingers are "," * on when the gesture starts. This paramenter is required."," * @param {Number} endRadius A radius of end circle where 2 fingers will be on when"," * the pinch or spread gestures are completed. This parameter is required."," * @param {Number} duration A duration of the gesture in millisecond."," * @param {Number} start A start angle(0 degree at 12 o'clock) where the "," * gesture should start. Default is 0. "," * @param {Number} rotation If rotation is desired during the pinch or "," * spread gestures, this parameter can be used. Default is 0 degree. "," */"," pinch: function(cb, center, startRadius, endRadius, duration, start, rotation) {"," var eventQueue,"," i,"," interval = EVENT_INTERVAL,"," touches,"," id = 0,"," r1 = startRadius, // required"," r2 = endRadius, // required"," radiusPerStep,"," centerX, centerY,"," startScale, endScale, scalePerStep,"," startRot, endRot, rotPerStep,"," path1 = {start: [], end: []}, // paths for 1st and 2nd fingers. "," path2 = {start: [], end: []},"," steps,"," touchMove;",""," center = this._calculateDefaultPoint(center);",""," if(!Y.Lang.isNumber(r1) || !Y.Lang.isNumber(r2) || r1<0 || r2<0) {"," Y.error(NAME+'Invalid startRadius and endRadius detected.');"," }",""," if(!Y.Lang.isNumber(duration) || duration <= 0) {"," duration = DEFAULTS.DURATION_PINCH;"," }",""," if(!Y.Lang.isNumber(start)) {"," start = 0.0;"," } else {"," start = start%360;"," while(start < 0) {"," start += 360;"," }"," }",""," if(!Y.Lang.isNumber(rotation)) {"," rotation = 0.0;"," }",""," Y.AsyncQueue.defaults.timeout = interval;"," eventQueue = new Y.AsyncQueue();",""," // range determination"," centerX = center[0];"," centerY = center[1];",""," startRot = start;"," endRot = start + rotation;",""," // 1st finger path"," path1.start = ["," centerX + r1*Math.sin(this._toRadian(startRot)), "," centerY - r1*Math.cos(this._toRadian(startRot))"," ];"," path1.end = ["," centerX + r2*Math.sin(this._toRadian(endRot)), "," centerY - r2*Math.cos(this._toRadian(endRot))"," ];"," "," // 2nd finger path"," path2.start = ["," centerX - r1*Math.sin(this._toRadian(startRot)), "," centerY + r1*Math.cos(this._toRadian(startRot))"," ];"," path2.end = ["," centerX - r2*Math.sin(this._toRadian(endRot)), "," centerY + r2*Math.cos(this._toRadian(endRot))"," ];",""," startScale = 1.0;"," endScale = endRadius/startRadius;",""," // touch/gesture start"," eventQueue.add({"," fn: function() {"," var coord1, coord2, coord, touches;",""," // coordinate for each touch object."," coord1 = {"," pageX: path1.start[0], "," pageY: path1.start[1],"," clientX: path1.start[0], "," clientY: path1.start[1]"," };"," coord2 = {"," pageX: path2.start[0], "," pageY: path2.start[1],"," clientX: path2.start[0], "," clientY: path2.start[1]"," };"," touches = this._createTouchList([Y.merge({"," identifier: (id++) "," }, coord1), Y.merge({"," identifier: (id++)"," }, coord2)]);",""," // coordinate for top level event"," coord = {"," pageX: (path1.start[0] + path2.start[0])/2,"," pageY: (path1.start[0] + path2.start[1])/2,"," clientX: (path1.start[0] + path2.start[0])/2,"," clientY: (path1.start[0] + path2.start[1])/2"," };",""," this._simulateEvent(this.target, TOUCH_START, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches,"," scale: startScale,"," rotation: startRot"," }, coord));",""," if(Y.UA.ios >= 2.0) {"," /* gesture starts when the 2nd finger touch starts."," * The implementation will fire 1 touch start event for both fingers,"," * simulating 2 fingers touched on the screen at the same time."," */"," this._simulateEvent(this.target, GESTURE_START, Y.merge({"," scale: startScale,"," rotation: startRot"," }, coord));"," }"," },"," timeout: 0,"," context: this"," });",""," // gesture change"," steps = Math.floor(duration/interval);"," radiusPerStep = (r2 - r1)/steps;"," scalePerStep = (endScale - startScale)/steps;"," rotPerStep = (endRot - startRot)/steps;"," "," touchMove = function(step) {"," var radius = r1 + (radiusPerStep)*step,"," px1 = centerX + radius*Math.sin(this._toRadian(startRot + rotPerStep*step)),"," py1 = centerY - radius*Math.cos(this._toRadian(startRot + rotPerStep*step)),"," px2 = centerX - radius*Math.sin(this._toRadian(startRot + rotPerStep*step)),"," py2 = centerY + radius*Math.cos(this._toRadian(startRot + rotPerStep*step)),"," px = (px1+px2)/2,"," py = (py1+py2)/2,"," coord1, coord2, coord, touches;",""," // coordinate for each touch object. "," coord1 = {"," pageX: px1,"," pageY: py1,"," clientX: px1,"," clientY: py1"," };"," coord2 = {"," pageX: px2,"," pageY: py2,"," clientX: px2,"," clientY: py2"," };"," touches = this._createTouchList([Y.merge({"," identifier: (id++) "," }, coord1), Y.merge({"," identifier: (id++)"," }, coord2)]);",""," // coordinate for top level event"," coord = {"," pageX: px,"," pageY: py,"," clientX: px,"," clientY: py"," };",""," this._simulateEvent(this.target, TOUCH_MOVE, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches,"," scale: startScale + scalePerStep*step,"," rotation: startRot + rotPerStep*step"," }, coord));",""," if(Y.UA.ios >= 2.0) {"," this._simulateEvent(this.target, GESTURE_CHANGE, Y.merge({"," scale: startScale + scalePerStep*step,"," rotation: startRot + rotPerStep*step"," }, coord));"," }"," };",""," for (i=0; i < steps; i++) {"," eventQueue.add({"," fn: touchMove,"," args: [i],"," context: this"," });"," }",""," // gesture end"," eventQueue.add({"," fn: function() {"," var emptyTouchList = this._getEmptyTouchList(),"," coord1, coord2, coord, touches;",""," // coordinate for each touch object."," coord1 = {"," pageX: path1.end[0], "," pageY: path1.end[1],"," clientX: path1.end[0], "," clientY: path1.end[1]"," };"," coord2 = {"," pageX: path2.end[0], "," pageY: path2.end[1],"," clientX: path2.end[0], "," clientY: path2.end[1]"," };"," touches = this._createTouchList([Y.merge({"," identifier: (id++) "," }, coord1), Y.merge({"," identifier: (id++)"," }, coord2)]);",""," // coordinate for top level event"," coord = {"," pageX: (path1.end[0] + path2.end[0])/2,"," pageY: (path1.end[0] + path2.end[1])/2,"," clientX: (path1.end[0] + path2.end[0])/2,"," clientY: (path1.end[0] + path2.end[1])/2"," }; ",""," if(Y.UA.ios >= 2.0) {"," this._simulateEvent(this.target, GESTURE_END, Y.merge({"," scale: endScale,"," rotation: endRot"," }, coord));"," }",""," this._simulateEvent(this.target, TOUCH_END, Y.merge({"," touches: emptyTouchList,"," targetTouches: emptyTouchList,"," changedTouches: touches,"," scale: endScale,"," rotation: endRot"," }, coord));"," },"," context: this"," });",""," if(cb && Y.Lang.isFunction(cb)) {"," eventQueue.add({"," fn: cb,",""," // by default, the callback runs the node context where "," // simulateGesture method is called."," context: this.node",""," //TODO: Use args to pass error object as 1st param if there is an error."," //args: "," });"," }",""," eventQueue.run();"," },",""," /**"," * The \"tap\" gesture can be used for various single touch point gestures "," * such as single tap, N number of taps, long press. The default is a single "," * tap."," * "," * @method tap"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} point A point(relative to the top left corner of the "," * target node element) where the tap gesture should start. The default "," * is the center of the taget node."," * @param {Number} times The number of taps. Default is 1."," * @param {Number} hold The hold time in milliseconds between \"touchstart\" and"," * \"touchend\" event generation. Default is 10ms."," * @param {Number} delay The time gap in millisecond between taps if this"," * gesture has more than 1 tap. Default is 10ms."," */"," tap: function(cb, point, times, hold, delay) { "," var eventQueue = new Y.AsyncQueue(),"," emptyTouchList = this._getEmptyTouchList(),"," touches,"," coord,"," i,"," touchStart,"," touchEnd;",""," point = this._calculateDefaultPoint(point);",""," if(!Y.Lang.isNumber(times) || times < 1) {"," times = 1;"," }",""," if(!Y.Lang.isNumber(hold)) {"," hold = DEFAULTS.HOLD_TAP;"," }",""," if(!Y.Lang.isNumber(delay)) {"," delay = DEFAULTS.DELAY_TAP;"," }",""," coord = {"," pageX: point[0], "," pageY: point[1],"," clientX: point[0], "," clientY: point[1]"," };",""," touches = this._createTouchList([Y.merge({identifier: 0}, coord)]);",""," touchStart = function() {"," this._simulateEvent(this.target, TOUCH_START, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," };"," "," touchEnd = function() {"," this._simulateEvent(this.target, TOUCH_END, Y.merge({"," touches: emptyTouchList,"," targetTouches: emptyTouchList,"," changedTouches: touches"," }, coord));"," };"," "," for (i=0; i < times; i++) {"," eventQueue.add({"," fn: touchStart,"," context: this,"," timeout: (i === 0)? 0 : delay"," });",""," eventQueue.add({"," fn: touchEnd,"," context: this,"," timeout: hold"," });"," }",""," if(times > 1 && !SUPPORTS_TOUCH) {"," eventQueue.add({"," fn: function() {"," this._simulateEvent(this.target, MOUSE_DBLCLICK, coord);"," },"," context: this"," });"," }",""," if(cb && Y.Lang.isFunction(cb)) {"," eventQueue.add({"," fn: cb,",""," // by default, the callback runs the node context where "," // simulateGesture method is called."," context: this.node",""," //TODO: Use args to pass error object as 1st param if there is an error."," //args: "," });"," }",""," eventQueue.run();"," },",""," /**"," * The \"flick\" gesture is a specialized \"move\" that has some velocity "," * and the movement always runs either x or y axis. The velocity is calculated"," * with \"distance\" and \"duration\" arguments. If the calculated velocity is "," * below than the minimum velocity, the given duration will be ignored and "," * new duration will be created to make a valid flick gesture."," * "," * @method flick"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} point A point(relative to the top left corner of the "," * target node element) where the flick gesture should start. The default "," * is the center of the taget node."," * @param {String} axis Either \"x\" or \"y\"."," * @param {Number} distance A distance in pixels to flick."," * @param {Number} duration A duration of the gesture in millisecond."," * "," */"," flick: function(cb, point, axis, distance, duration) {"," var path;",""," point = this._calculateDefaultPoint(point);",""," if(!Y.Lang.isString(axis)) {"," axis = X_AXIS;"," } else {"," axis = axis.toLowerCase();"," if(axis !== X_AXIS && axis !== Y_AXIS) {"," Y.error(NAME+'(flick): Only x or y axis allowed');"," }"," }",""," if(!Y.Lang.isNumber(distance)) { "," distance = DEFAULTS.DISTANCE_FLICK; "," }",""," if(!Y.Lang.isNumber(duration)){"," duration = DEFAULTS.DURATION_FLICK; // ms"," } else {"," if(duration > DEFAULTS.MAX_DURATION_FLICK) {"," duration = DEFAULTS.MAX_DURATION_FLICK;"," }"," }",""," /**"," * Check if too slow for a flick."," * Adjust duration if the calculated velocity is less than "," * the minimum velcocity to be claimed as a flick."," */"," if(Math.abs(distance)/duration < DEFAULTS.MIN_VELOCITY_FLICK) {"," duration = Math.abs(distance)/DEFAULTS.MIN_VELOCITY_FLICK;"," }",""," path = {"," start: Y.clone(point),"," end: ["," (axis === X_AXIS) ? point[0]+distance : point[0],"," (axis === Y_AXIS) ? point[1]+distance : point[1]"," ]"," };",""," this._move(cb, path, duration);"," },",""," /**"," * The \"move\" gesture simulate the movement of any direction between "," * the straight line of start and end point for the given duration."," * The path argument is an object with \"point\", \"xdist\" and \"ydist\" properties."," * The \"point\" property is an array with x and y coordinations(relative to the"," * top left corner of the target node element) while \"xdist\" and \"ydist\" "," * properties are used for the distance along the x and y axis. A negative "," * distance number can be used to drag either left or up direction. "," * "," * If no arguments are given, it will simulate the default move, which"," * is moving 200 pixels from the center of the element to the positive X-axis "," * direction for 1 sec."," * "," * @method move"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Object} path An object with \"point\", \"xdist\" and \"ydist\"."," * @param {Number} duration A duration of the gesture in millisecond."," */"," move: function(cb, path, duration) {"," var convertedPath;",""," if(!Y.Lang.isObject(path)) {"," path = {"," point: this._calculateDefaultPoint([]),"," xdist: DEFAULTS.DISTANCE_MOVE,"," ydist: 0"," };"," } else {"," // convert to the page coordination"," if(!Y.Lang.isArray(path.point)) {"," path.point = this._calculateDefaultPoint([]);"," } else {"," path.point = this._calculateDefaultPoint(path.point);"," }",""," if(!Y.Lang.isNumber(path.xdist)) {"," path.xdist = DEFAULTS.DISTANCE_MOVE;"," }",""," if(!Y.Lang.isNumber(path.ydist)) {"," path.ydist = 0;"," }"," }",""," if(!Y.Lang.isNumber(duration)){"," duration = DEFAULTS.DURATION_MOVE; // ms"," } else {"," if(duration > DEFAULTS.MAX_DURATION_MOVE) {"," duration = DEFAULTS.MAX_DURATION_MOVE;"," }"," }",""," convertedPath = {"," start: Y.clone(path.point),"," end: [path.point[0]+path.xdist, path.point[1]+path.ydist]"," };",""," this._move(cb, convertedPath, duration);"," },",""," /**"," * A base method on top of \"move\" and \"flick\" methods. The method takes"," * the path with start/end properties and duration to generate a set of "," * touch events for the movement gesture. "," *"," * @method _move"," * @private"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Object} path An object with \"start\" and \"end\" properties. Each "," * property should be an array with x and y coordination (e.g. start: [100, 50])"," * @param {Number} duration A duration of the gesture in millisecond. "," */"," _move: function(cb, path, duration) {"," var eventQueue,"," i,"," interval = EVENT_INTERVAL,"," steps, stepX, stepY,"," id = 0,"," touchMove;",""," if(!Y.Lang.isNumber(duration)){"," duration = DEFAULTS.DURATION_MOVE; // ms"," } else {"," if(duration > DEFAULTS.MAX_DURATION_MOVE) {"," duration = DEFAULTS.MAX_DURATION_MOVE;"," }"," }",""," if(!Y.Lang.isObject(path)) {"," path = {"," start: ["," START_PAGEX, "," START_PAGEY"," ], "," end: ["," START_PAGEX + DEFAULTS.DISTANCE_MOVE, "," START_PAGEY"," ]"," };"," } else {"," if(!Y.Lang.isArray(path.start)) {"," path.start = ["," START_PAGEX, "," START_PAGEY"," ];"," }"," if(!Y.Lang.isArray(path.end)) {"," path.end = ["," START_PAGEX + DEFAULTS.DISTANCE_MOVE, "," START_PAGEY"," ];"," }"," }",""," Y.AsyncQueue.defaults.timeout = interval;"," eventQueue = new Y.AsyncQueue();",""," // start"," eventQueue.add({"," fn: function() {"," var coord = {"," pageX: path.start[0], "," pageY: path.start[1],"," clientX: path.start[0], "," clientY: path.start[1]"," }, "," touches = this._createTouchList(["," Y.merge({identifier: (id++)}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_START, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," },"," timeout: 0,"," context: this"," });",""," // move"," steps = Math.floor(duration/interval);"," stepX = (path.end[0] - path.start[0])/steps;"," stepY = (path.end[1] - path.start[1])/steps;",""," touchMove = function(step) {"," var px = path.start[0]+(stepX * step),"," py = path.start[1]+(stepY * step), "," coord = {"," pageX: px, "," pageY: py,"," clientX: px,"," clientY: py"," }, "," touches = this._createTouchList(["," Y.merge({identifier: (id++)}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_MOVE, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," };",""," for (i=0; i < steps; i++) {"," eventQueue.add({"," fn: touchMove,"," args: [i],"," context: this"," });"," }",""," // last move"," eventQueue.add({"," fn: function() {"," var coord = {"," pageX: path.end[0], "," pageY: path.end[1],"," clientX: path.end[0], "," clientY: path.end[1]"," },"," touches = this._createTouchList(["," Y.merge({identifier: id}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_MOVE, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," },"," timeout: 0,"," context: this"," });",""," // end"," eventQueue.add({"," fn: function() {"," var coord = {"," pageX: path.end[0], "," pageY: path.end[1],"," clientX: path.end[0], "," clientY: path.end[1]"," },"," emptyTouchList = this._getEmptyTouchList(),"," touches = this._createTouchList(["," Y.merge({identifier: id}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_END, Y.merge({"," touches: emptyTouchList,"," targetTouches: emptyTouchList,"," changedTouches: touches"," }, coord));"," },"," context: this"," });"," "," if(cb && Y.Lang.isFunction(cb)) {"," eventQueue.add({"," fn: cb,",""," // by default, the callback runs the node context where "," // simulateGesture method is called."," context: this.node",""," //TODO: Use args to pass error object as 1st param if there is an error."," //args: "," });"," }"," "," eventQueue.run();"," },",""," /**"," * Helper method to return a singleton instance of empty touch list."," * "," * @method _getEmptyTouchList"," * @private"," * @return {TouchList | Array} An empty touch list object."," */"," _getEmptyTouchList: function() {"," if(!emptyTouchList) {"," emptyTouchList = this._createTouchList([]);"," }",""," return emptyTouchList;"," },",""," /**"," * Helper method to convert an array with touch points to TouchList object as"," * defined in http://www.w3.org/TR/touch-events/"," * "," * @method _createTouchList"," * @private"," * @param {Array} touchPoints "," * @return {TouchList | Array} If underlaying platform support creating touch list"," * a TouchList object will be returned otherwise a fake Array object "," * will be returned."," */"," _createTouchList: function(touchPoints) {"," /*"," * Android 4.0.3 emulator:"," * Native touch api supported starting in version 4.0 (Ice Cream Sandwich)."," * However the support seems limited. In Android 4.0.3 emulator, I got"," * \"TouchList is not defined\"."," */"," var touches = [],"," touchList,"," self = this;",""," if(!!touchPoints && Y.Lang.isArray(touchPoints)) {"," if(Y.UA.android && Y.UA.android >= 4.0 || Y.UA.ios && Y.UA.ios >= 2.0) {"," Y.each(touchPoints, function(point) {"," if(!point.identifier) {point.identifier = 0;}"," if(!point.pageX) {point.pageX = 0;}"," if(!point.pageY) {point.pageY = 0;}"," if(!point.screenX) {point.screenX = 0;}"," if(!point.screenY) {point.screenY = 0;}",""," touches.push(document.createTouch(Y.config.win, "," self.target,"," point.identifier, "," point.pageX, point.pageY, "," point.screenX, point.screenY));"," });",""," touchList = document.createTouchList.apply(document, touches);"," } else if(Y.UA.ios && Y.UA.ios < 2.0) { "," Y.error(NAME+': No touch event simulation framework present.');"," } else {"," // this will inclide android(Y.UA.android && Y.UA.android < 4.0) "," // and desktops among all others. ",""," /**"," * Touch APIs are broken in androids older than 4.0. We will use "," * simulated touch apis for these versions. "," */"," touchList = [];"," Y.each(touchPoints, function(point) {"," if(!point.identifier) {point.identifier = 0;}"," if(!point.clientX) {point.clientX = 0;}"," if(!point.clientY) {point.clientY = 0;}"," if(!point.pageX) {point.pageX = 0;}"," if(!point.pageY) {point.pageY = 0;}"," if(!point.screenX) {point.screenX = 0;}"," if(!point.screenY) {point.screenY = 0;}",""," touchList.push({"," target: self.target,"," identifier: point.identifier,"," clientX: point.clientX,"," clientY: point.clientY,"," pageX: point.pageX,"," pageY: point.pageY,"," screenX: point.screenX,"," screenY: point.screenY"," });"," });",""," touchList.item = function(i) {"," return touchList[i];"," };"," }"," } else {"," Y.error(NAME+': Invalid touchPoints passed');"," }",""," return touchList;"," },",""," /**"," * @method _simulateEvent"," * @private"," * @param {HTMLElement} target The DOM element that's the target of the event."," * @param {String} type The type of event or name of the supported gesture to simulate "," * (i.e., \"click\", \"doubletap\", \"flick\")."," * @param {Object} options (Optional) Extra options to copy onto the event object. "," * For gestures, options are used to refine the gesture behavior."," * @return {void}"," */"," _simulateEvent: function(target, type, options) {"," var touches;",""," if (touchEvents[type]) {"," if(SUPPORTS_TOUCH) {"," Y.Event.simulate(target, type, options);"," } else {"," // simulate using mouse events if touch is not applicable on this platform."," // but only single touch event can be simulated."," if(this._isSingleTouch(options.touches, options.targetTouches, options.changedTouches)) {"," type = {"," touchstart: MOUSE_DOWN,"," touchmove: MOUSE_MOVE,"," touchend: MOUSE_UP"," }[type];",""," options.button = 0;"," options.relatedTarget = null; // since we are not using mouseover event.",""," // touchend has none in options.touches."," touches = (type === MOUSE_UP)? options.changedTouches : options.touches;",""," options = Y.mix(options, {"," screenX: touches.item(0).screenX,"," screenY: touches.item(0).screenY,"," clientX: touches.item(0).clientX,"," clientY: touches.item(0).clientY"," }, true);",""," Y.Event.simulate(target, type, options);",""," if(type == MOUSE_UP) {"," Y.Event.simulate(target, MOUSE_CLICK, options);"," }"," } else {"," Y.error(\"_simulateEvent(): Event '\" + type + \"' has multi touch objects that can't be simulated in your platform.\");"," }"," }"," } else {"," // pass thru for all non touch events"," Y.Event.simulate(target, type, options);"," }"," },",""," /**"," * Helper method to check the single touch."," * @method _isSingleTouch"," * @private"," * @param {TouchList} touches"," * @param {TouchList} targetTouches"," * @param {TouchList} changedTouches"," */"," _isSingleTouch: function(touches, targetTouches, changedTouches) {"," return (touches && (touches.length <= 1)) && "," (targetTouches && (targetTouches.length <= 1)) &&"," (changedTouches && (changedTouches.length <= 1));"," }","};","","/**"," * A gesture simulation class."," */","Y.GestureSimulation = Simulations;","","/**"," * Various simulation default behavior properties. If user override "," * Y.GestureSimulation.defaults, overriden values will be used and this "," * should be done before the gesture simulation. "," */","Y.GestureSimulation.defaults = DEFAULTS;","","/**"," * The high level gesture names that YUI knows how to simulate."," */","Y.GestureSimulation.GESTURES = gestureNames;","","/**"," * Simulates the higher user level gesture of the given name on a target. "," * This method generates a set of low level touch events(Apple specific gesture "," * events as well for the iOS platforms) asynchronously. Note that gesture "," * simulation is relying on `Y.Event.simulate()` method to generate "," * the touch events under the hood. The `Y.Event.simulate()` method"," * itself is a synchronous method."," * "," * Users are suggested to use `Node.simulateGesture()` method which "," * basically calls this method internally. Supported gestures are `tap`, "," * `doubletap`, `press`, `move`, `flick`, `pinch` and `rotate`."," * "," * The `pinch` gesture is used to simulate the pinching and spreading of two"," * fingers. During a pinch simulation, rotation is also possible. Essentially"," * `pinch` and `rotate` simulations share the same base implementation to allow"," * both pinching and rotation at the same time. The only difference is `pinch`"," * requires `start` and `end` option properties while `rotate` requires `rotation` "," * option property."," * "," * The `pinch` and `rotate` gestures can be described as placing 2 fingers along a"," * circle. Pinching and spreading can be described by start and end circles while "," * rotation occurs on a single circle. If the radius of the start circle is greater "," * than the end circle, the gesture becomes a pinch, otherwise it is a spread spread."," * "," * @example"," *"," * var node = Y.one(\"#target\");"," * "," * // double tap example"," * node.simulateGesture(\"doubletap\", function() {"," * // my callback function"," * });"," * "," * // flick example from the center of the node, move 50 pixels down for 50ms)"," * node.simulateGesture(\"flick\", {"," * axis: y,"," * distance: -100"," * duration: 50"," * }, function() {"," * // my callback function"," * });"," * "," * // simulate rotating a node 75 degrees counter-clockwise "," * node.simulateGesture(\"rotate\", {"," * rotation: -75"," * });"," *"," * // simulate a pinch and a rotation at the same time. "," * // fingers start on a circle of radius 100 px, placed at top/bottom"," * // fingers end on a circle of radius 50px, placed at right/left "," * node.simulateGesture(\"pinch\", {"," * r1: 100,"," * r2: 50,"," * start: 0"," * rotation: 90"," * });"," * "," * @method simulateGesture"," * @param {HTMLElement|Node} node The YUI node or HTML element that's the target "," * of the event."," * @param {String} name The name of the supported gesture to simulate. The "," * supported gesture name is one of \"tap\", \"doubletap\", \"press\", \"move\", "," * \"flick\", \"pinch\" and \"rotate\". "," * @param {Object} [options] Extra options used to define the gesture behavior:"," * "," * Valid options properties for the `tap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the tap should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=10] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation."," * @param {Number} [options.times=1] (Optional) Indicates the number of taps."," * @param {Number} [options.delay=10] (Optional) The number of milliseconds "," * before the next tap simulation happens. This is valid only when `times` "," * is more than 1. "," * "," * Valid options properties for the `doubletap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the doubletap should be simulated. Default is the center of the "," * node element."," * "," * Valid options properties for the `press` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the press should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=3000] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation. "," * Default is 3000ms (3 seconds)."," * "," * Valid options properties for the `move` gesture:"," * "," * @param {Object} [options.path] (Optional) Indicates the path of the finger "," * movement. It's an object with three optional properties: `point`, "," * `xdist` and `ydist`."," * @param {Array} [options.path.point] A starting point of the gesture."," * Default is the center of the node element."," * @param {Number} [options.path.xdist=200] A distance to move in pixels "," * along the X axis. A negative distance value indicates moving left."," * @param {Number} [options.path.ydist=0] A distance to move in pixels "," * along the Y axis. A negative distance value indicates moving up."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * "," * Valid options properties for the `flick` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x, y] coordinates "," * where the flick should be simulated. Default is the center of the "," * node element."," * @param {String} [options.axis='x'] (Optional) Valid values are either "," * \"x\" or \"y\". Indicates axis to move along. The flick can move to one of "," * 4 directions(left, right, up and down)."," * @param {Number} [options.distance=200] (Optional) Distance to move in pixels"," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds. User given value could be automatically "," * adjusted by the framework if it is below the minimum velocity to be "," * a flick gesture."," * "," * Valid options properties for the `pinch` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Required) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element."," * @param {Number} [options.r2] (Required) Pixel radius of the end circle "," * when this gesture ends."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation=0] (Optional) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * Valid options properties for the `rotate` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Optional) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element. Default is a fourth of the node "," * element width or height, whichever is smaller."," * @param {Number} [options.r2] (Optional) Pixel radius of the end circle "," * when this gesture ends. Default is a fourth of the node element width or "," * height, whichever is smaller."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation] (Required) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * @param {Function} [cb] The callback to execute when the asynchronouse gesture "," * simulation is completed. "," * @param {Error} cb.err An error object if the simulation is failed. "," * @return {void}"," * @for Event"," * @static"," */","Y.Event.simulateGesture = function(node, name, options, cb) {",""," node = Y.one(node); ",""," var sim = new Y.GestureSimulation(node);"," name = name.toLowerCase();",""," if(!cb && Y.Lang.isFunction(options)) {"," cb = options;"," options = {};"," }",""," options = options || {};",""," if (gestureNames[name]) {"," switch(name) {"," // single-touch: point gestures "," case 'tap':"," sim.tap(cb, options.point, options.times, options.hold, options.delay);"," break;"," case 'doubletap':"," sim.tap(cb, options.point, 2);"," break;"," case 'press':"," if(!Y.Lang.isNumber(options.hold)) {"," options.hold = DEFAULTS.HOLD_PRESS;"," } else if(options.hold < DEFAULTS.MIN_HOLD_PRESS) {"," options.hold = DEFAULTS.MIN_HOLD_PRESS;"," } else if(options.hold > DEFAULTS.MAX_HOLD_PRESS) {"," options.hold = DEFAULTS.MAX_HOLD_PRESS;"," }"," sim.tap(cb, options.point, 1, options.hold);"," break;",""," // single-touch: move gestures "," case 'move':"," sim.move(cb, options.path, options.duration);"," break;"," case 'flick':"," sim.flick(cb, options.point, options.axis, options.distance, "," options.duration);"," break;",""," // multi-touch: pinch/rotation gestures"," case 'pinch':"," sim.pinch(cb, options.center, options.r1, options.r2, "," options.duration, options.start, options.rotation);"," break; "," case 'rotate':"," sim.rotate(cb, options.center, options.r1, options.r2, "," options.duration, options.start, options.rotation);"," break;"," }"," } else {"," Y.error(NAME+': Not a supported gesture simulation: '+name);"," }","};","","","}, '3.7.2', {\"requires\": [\"async-queue\", \"event-simulate\", \"node-screen\"]});"];+_yuitest_coverage["build/gesture-simulate/gesture-simulate.js"].code=["YUI.add('gesture-simulate', function (Y, NAME) {","","/**"," * Simulate high-level user gestures by generating a set of native DOM events."," *"," * @module gesture-simulate"," * @requires event-simulate, async-queue, node-screen"," */","","var NAME = \"gesture-simulate\",",""," // phantomjs check may be temporary, until we determine if it really support touch all the way through, like it claims to (http://code.google.com/p/phantomjs/issues/detail?id=375)"," SUPPORTS_TOUCH = ((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.phantomjs) && !(Y.UA.chrome && Y.UA.chrome < 6)),",""," gestureNames = {"," tap: 1,"," doubletap: 1,"," press: 1,"," move: 1,"," flick: 1,"," pinch: 1,"," rotate: 1"," },",""," touchEvents = {"," touchstart: 1,"," touchmove: 1,"," touchend: 1,"," touchcancel: 1"," },",""," document = Y.config.doc,"," emptyTouchList,",""," EVENT_INTERVAL = 20, // 20ms"," START_PAGEX, // will be adjusted to the node element center"," START_PAGEY, // will be adjusted to the node element center",""," // defaults that user can override."," DEFAULTS = {"," // tap gestures"," HOLD_TAP: 10, // 10ms"," DELAY_TAP: 10, // 10ms",""," // press gesture"," HOLD_PRESS: 3000, // 3sec"," MIN_HOLD_PRESS: 1000, // 1sec"," MAX_HOLD_PRESS: 60000, // 1min",""," // move gesture"," DISTANCE_MOVE: 200, // 200 pixels"," DURATION_MOVE: 1000, // 1sec"," MAX_DURATION_MOVE: 5000,// 5sec",""," // flick gesture"," MIN_VELOCITY_FLICK: 1.3,"," DISTANCE_FLICK: 200, // 200 pixels"," DURATION_FLICK: 1000, // 1sec"," MAX_DURATION_FLICK: 5000,// 5sec",""," // pinch/rotation"," DURATION_PINCH: 1000 // 1sec"," },",""," TOUCH_START = 'touchstart',"," TOUCH_MOVE = 'touchmove',"," TOUCH_END = 'touchend',",""," GESTURE_START = 'gesturestart',"," GESTURE_CHANGE = 'gesturechange',"," GESTURE_END = 'gestureend',",""," MOUSE_UP = 'mouseup',"," MOUSE_MOVE = 'mousemove',"," MOUSE_DOWN = 'mousedown',"," MOUSE_CLICK = 'click',"," MOUSE_DBLCLICK = 'dblclick',",""," X_AXIS = 'x',"," Y_AXIS = 'y';","","/**"," *"," */","function Simulations(node) {"," if(!node) {"," Y.error(NAME+': invalid target node');"," }"," this.node = node;"," this.target = Y.Node.getDOMNode(node);",""," var startXY = this.node.getXY(),"," dims = this._getDims();",""," START_PAGEX = startXY[0] + (dims[0])/2;"," START_PAGEY = startXY[1] + (dims[1])/2;","}","","Simulations.prototype = {",""," /**"," * Helper method to convert a degree to a radian."," * "," * @method _toRadian"," * @private"," * @param {Number} deg A degree to be converted to a radian."," * @return {Number} The degree in radian. "," */"," _toRadian: function(deg) {"," return deg * (Math.PI/180);"," },",""," /**"," * Helper method to get height/width while accounting for "," * rotation/scale transforms where possible by using the "," * bounding client rectangle height/width instead of the "," * offsetWidth/Height which region uses."," * @method _getDims"," * @private"," * @return {Array} Array with [height, width]"," */"," _getDims : function() {"," var region,"," width,"," height;",""," // Ideally, this should be in DOM somewhere."," if (this.target.getBoundingClientRect) {"," region = this.target.getBoundingClientRect();",""," if (\"height\" in region) {"," height = region.height;"," } else {"," // IE7,8 has getBCR, but no height."," height = Math.abs(region.bottom - region.top);"," }",""," if (\"width\" in region) {"," width = region.width;"," } else {"," // IE7,8 has getBCR, but no width."," width = Math.abs(region.right - region.left);"," }"," } else {"," region = this.node.get(\"region\");"," width = region.width;"," height = region.height;"," }",""," return [width, height];"," },",""," /**"," * Helper method to convert a point relative to the node element into "," * the point in the page coordination."," * "," * @method _calculateDefaultPoint"," * @private"," * @param {Array} point A point relative to the node element."," * @return {Array} The same point in the page coordination. "," */"," _calculateDefaultPoint: function(point) {",""," var height;",""," if(!Y.Lang.isArray(point) || point.length === 0) {"," point = [START_PAGEX, START_PAGEY];"," } else {"," if(point.length == 1) {"," height = this._getDims[1];"," point[1] = height/2;"," }"," // convert to page(viewport) coordination"," point[0] = this.node.getX() + point[0];"," point[1] = this.node.getY() + point[1];"," }",""," return point;"," },",""," /**"," * The \"rotate\" and \"pinch\" methods are essencially same with the exact same "," * arguments. Only difference is the required parameters. The rotate method "," * requires \"rotation\" parameter while the pinch method requires \"startRadius\" "," * and \"endRadius\" parameters."," *"," * @method rotate"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} center A center point where the pinch gesture of two fingers"," * should happen. It is relative to the top left corner of the target "," * node element."," * @param {Number} startRadius A radius of start circle where 2 fingers are "," * on when the gesture starts. This is optional. The default is a fourth of "," * either target node width or height whichever is smaller."," * @param {Number} endRadius A radius of end circle where 2 fingers will be on when"," * the pinch or spread gestures are completed. This is optional. "," * The default is a fourth of either target node width or height whichever is less."," * @param {Number} duration A duration of the gesture in millisecond."," * @param {Number} start A start angle(0 degree at 12 o'clock) where the "," * gesture should start. Default is 0. "," * @param {Number} rotation A rotation in degree. It is required."," */"," rotate: function(cb, center, startRadius, endRadius, duration, start, rotation) {"," var radius,"," r1 = startRadius, // optional"," r2 = endRadius; // optional",""," if(!Y.Lang.isNumber(r1) || !Y.Lang.isNumber(r2) || r1<0 || r2<0) {"," radius = (this.target.offsetWidth < this.target.offsetHeight)? "," this.target.offsetWidth/4 : this.target.offsetHeight/4;"," r1 = radius;"," r2 = radius;"," }",""," // required"," if(!Y.Lang.isNumber(rotation)) {"," Y.error(NAME+'Invalid rotation detected.');"," }",""," this.pinch(cb, center, r1, r2, duration, start, rotation);"," },",""," /**"," * The \"rotate\" and \"pinch\" methods are essencially same with the exact same "," * arguments. Only difference is the required parameters. The rotate method "," * requires \"rotation\" parameter while the pinch method requires \"startRadius\" "," * and \"endRadius\" parameters."," *"," * The \"pinch\" gesture can simulate various 2 finger gestures such as pinch, "," * spread and/or rotation. The \"startRadius\" and \"endRadius\" are required."," * If endRadius is larger than startRadius, it becomes a spread gesture "," * otherwise a pinch gesture. "," *"," * @method pinch"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} center A center point where the pinch gesture of two fingers"," * should happen. It is relative to the top left corner of the target "," * node element."," * @param {Number} startRadius A radius of start circle where 2 fingers are "," * on when the gesture starts. This paramenter is required."," * @param {Number} endRadius A radius of end circle where 2 fingers will be on when"," * the pinch or spread gestures are completed. This parameter is required."," * @param {Number} duration A duration of the gesture in millisecond."," * @param {Number} start A start angle(0 degree at 12 o'clock) where the "," * gesture should start. Default is 0. "," * @param {Number} rotation If rotation is desired during the pinch or "," * spread gestures, this parameter can be used. Default is 0 degree. "," */"," pinch: function(cb, center, startRadius, endRadius, duration, start, rotation) {"," var eventQueue,"," i,"," interval = EVENT_INTERVAL,"," touches,"," id = 0,"," r1 = startRadius, // required"," r2 = endRadius, // required"," radiusPerStep,"," centerX, centerY,"," startScale, endScale, scalePerStep,"," startRot, endRot, rotPerStep,"," path1 = {start: [], end: []}, // paths for 1st and 2nd fingers. "," path2 = {start: [], end: []},"," steps,"," touchMove;",""," center = this._calculateDefaultPoint(center);",""," if(!Y.Lang.isNumber(r1) || !Y.Lang.isNumber(r2) || r1<0 || r2<0) {"," Y.error(NAME+'Invalid startRadius and endRadius detected.');"," }",""," if(!Y.Lang.isNumber(duration) || duration <= 0) {"," duration = DEFAULTS.DURATION_PINCH;"," }",""," if(!Y.Lang.isNumber(start)) {"," start = 0.0;"," } else {"," start = start%360;"," while(start < 0) {"," start += 360;"," }"," }",""," if(!Y.Lang.isNumber(rotation)) {"," rotation = 0.0;"," }",""," Y.AsyncQueue.defaults.timeout = interval;"," eventQueue = new Y.AsyncQueue();",""," // range determination"," centerX = center[0];"," centerY = center[1];",""," startRot = start;"," endRot = start + rotation;",""," // 1st finger path"," path1.start = ["," centerX + r1*Math.sin(this._toRadian(startRot)), "," centerY - r1*Math.cos(this._toRadian(startRot))"," ];"," path1.end = ["," centerX + r2*Math.sin(this._toRadian(endRot)), "," centerY - r2*Math.cos(this._toRadian(endRot))"," ];"," "," // 2nd finger path"," path2.start = ["," centerX - r1*Math.sin(this._toRadian(startRot)), "," centerY + r1*Math.cos(this._toRadian(startRot))"," ];"," path2.end = ["," centerX - r2*Math.sin(this._toRadian(endRot)), "," centerY + r2*Math.cos(this._toRadian(endRot))"," ];",""," startScale = 1.0;"," endScale = endRadius/startRadius;",""," // touch/gesture start"," eventQueue.add({"," fn: function() {"," var coord1, coord2, coord, touches;",""," // coordinate for each touch object."," coord1 = {"," pageX: path1.start[0], "," pageY: path1.start[1],"," clientX: path1.start[0], "," clientY: path1.start[1]"," };"," coord2 = {"," pageX: path2.start[0], "," pageY: path2.start[1],"," clientX: path2.start[0], "," clientY: path2.start[1]"," };"," touches = this._createTouchList([Y.merge({"," identifier: (id++) "," }, coord1), Y.merge({"," identifier: (id++)"," }, coord2)]);",""," // coordinate for top level event"," coord = {"," pageX: (path1.start[0] + path2.start[0])/2,"," pageY: (path1.start[0] + path2.start[1])/2,"," clientX: (path1.start[0] + path2.start[0])/2,"," clientY: (path1.start[0] + path2.start[1])/2"," };",""," this._simulateEvent(this.target, TOUCH_START, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches,"," scale: startScale,"," rotation: startRot"," }, coord));",""," if(Y.UA.ios >= 2.0) {"," /* gesture starts when the 2nd finger touch starts."," * The implementation will fire 1 touch start event for both fingers,"," * simulating 2 fingers touched on the screen at the same time."," */"," this._simulateEvent(this.target, GESTURE_START, Y.merge({"," scale: startScale,"," rotation: startRot"," }, coord));"," }"," },"," timeout: 0,"," context: this"," });",""," // gesture change"," steps = Math.floor(duration/interval);"," radiusPerStep = (r2 - r1)/steps;"," scalePerStep = (endScale - startScale)/steps;"," rotPerStep = (endRot - startRot)/steps;"," "," touchMove = function(step) {"," var radius = r1 + (radiusPerStep)*step,"," px1 = centerX + radius*Math.sin(this._toRadian(startRot + rotPerStep*step)),"," py1 = centerY - radius*Math.cos(this._toRadian(startRot + rotPerStep*step)),"," px2 = centerX - radius*Math.sin(this._toRadian(startRot + rotPerStep*step)),"," py2 = centerY + radius*Math.cos(this._toRadian(startRot + rotPerStep*step)),"," px = (px1+px2)/2,"," py = (py1+py2)/2,"," coord1, coord2, coord, touches;",""," // coordinate for each touch object. "," coord1 = {"," pageX: px1,"," pageY: py1,"," clientX: px1,"," clientY: py1"," };"," coord2 = {"," pageX: px2,"," pageY: py2,"," clientX: px2,"," clientY: py2"," };"," touches = this._createTouchList([Y.merge({"," identifier: (id++) "," }, coord1), Y.merge({"," identifier: (id++)"," }, coord2)]);",""," // coordinate for top level event"," coord = {"," pageX: px,"," pageY: py,"," clientX: px,"," clientY: py"," };",""," this._simulateEvent(this.target, TOUCH_MOVE, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches,"," scale: startScale + scalePerStep*step,"," rotation: startRot + rotPerStep*step"," }, coord));",""," if(Y.UA.ios >= 2.0) {"," this._simulateEvent(this.target, GESTURE_CHANGE, Y.merge({"," scale: startScale + scalePerStep*step,"," rotation: startRot + rotPerStep*step"," }, coord));"," }"," };",""," for (i=0; i < steps; i++) {"," eventQueue.add({"," fn: touchMove,"," args: [i],"," context: this"," });"," }",""," // gesture end"," eventQueue.add({"," fn: function() {"," var emptyTouchList = this._getEmptyTouchList(),"," coord1, coord2, coord, touches;",""," // coordinate for each touch object."," coord1 = {"," pageX: path1.end[0], "," pageY: path1.end[1],"," clientX: path1.end[0], "," clientY: path1.end[1]"," };"," coord2 = {"," pageX: path2.end[0], "," pageY: path2.end[1],"," clientX: path2.end[0], "," clientY: path2.end[1]"," };"," touches = this._createTouchList([Y.merge({"," identifier: (id++) "," }, coord1), Y.merge({"," identifier: (id++)"," }, coord2)]);",""," // coordinate for top level event"," coord = {"," pageX: (path1.end[0] + path2.end[0])/2,"," pageY: (path1.end[0] + path2.end[1])/2,"," clientX: (path1.end[0] + path2.end[0])/2,"," clientY: (path1.end[0] + path2.end[1])/2"," }; ",""," if(Y.UA.ios >= 2.0) {"," this._simulateEvent(this.target, GESTURE_END, Y.merge({"," scale: endScale,"," rotation: endRot"," }, coord));"," }",""," this._simulateEvent(this.target, TOUCH_END, Y.merge({"," touches: emptyTouchList,"," targetTouches: emptyTouchList,"," changedTouches: touches,"," scale: endScale,"," rotation: endRot"," }, coord));"," },"," context: this"," });",""," if(cb && Y.Lang.isFunction(cb)) {"," eventQueue.add({"," fn: cb,",""," // by default, the callback runs the node context where "," // simulateGesture method is called."," context: this.node",""," //TODO: Use args to pass error object as 1st param if there is an error."," //args: "," });"," }",""," eventQueue.run();"," },",""," /**"," * The \"tap\" gesture can be used for various single touch point gestures "," * such as single tap, N number of taps, long press. The default is a single "," * tap."," * "," * @method tap"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} point A point(relative to the top left corner of the "," * target node element) where the tap gesture should start. The default "," * is the center of the taget node."," * @param {Number} times The number of taps. Default is 1."," * @param {Number} hold The hold time in milliseconds between \"touchstart\" and"," * \"touchend\" event generation. Default is 10ms."," * @param {Number} delay The time gap in millisecond between taps if this"," * gesture has more than 1 tap. Default is 10ms."," */"," tap: function(cb, point, times, hold, delay) { "," var eventQueue = new Y.AsyncQueue(),"," emptyTouchList = this._getEmptyTouchList(),"," touches,"," coord,"," i,"," touchStart,"," touchEnd;",""," point = this._calculateDefaultPoint(point);",""," if(!Y.Lang.isNumber(times) || times < 1) {"," times = 1;"," }",""," if(!Y.Lang.isNumber(hold)) {"," hold = DEFAULTS.HOLD_TAP;"," }",""," if(!Y.Lang.isNumber(delay)) {"," delay = DEFAULTS.DELAY_TAP;"," }",""," coord = {"," pageX: point[0], "," pageY: point[1],"," clientX: point[0], "," clientY: point[1]"," };",""," touches = this._createTouchList([Y.merge({identifier: 0}, coord)]);",""," touchStart = function() {"," this._simulateEvent(this.target, TOUCH_START, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," };"," "," touchEnd = function() {"," this._simulateEvent(this.target, TOUCH_END, Y.merge({"," touches: emptyTouchList,"," targetTouches: emptyTouchList,"," changedTouches: touches"," }, coord));"," };"," "," for (i=0; i < times; i++) {"," eventQueue.add({"," fn: touchStart,"," context: this,"," timeout: (i === 0)? 0 : delay"," });",""," eventQueue.add({"," fn: touchEnd,"," context: this,"," timeout: hold"," });"," }",""," if(times > 1 && !SUPPORTS_TOUCH) {"," eventQueue.add({"," fn: function() {"," this._simulateEvent(this.target, MOUSE_DBLCLICK, coord);"," },"," context: this"," });"," }",""," if(cb && Y.Lang.isFunction(cb)) {"," eventQueue.add({"," fn: cb,",""," // by default, the callback runs the node context where "," // simulateGesture method is called."," context: this.node",""," //TODO: Use args to pass error object as 1st param if there is an error."," //args: "," });"," }",""," eventQueue.run();"," },",""," /**"," * The \"flick\" gesture is a specialized \"move\" that has some velocity "," * and the movement always runs either x or y axis. The velocity is calculated"," * with \"distance\" and \"duration\" arguments. If the calculated velocity is "," * below than the minimum velocity, the given duration will be ignored and "," * new duration will be created to make a valid flick gesture."," * "," * @method flick"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Array} point A point(relative to the top left corner of the "," * target node element) where the flick gesture should start. The default "," * is the center of the taget node."," * @param {String} axis Either \"x\" or \"y\"."," * @param {Number} distance A distance in pixels to flick."," * @param {Number} duration A duration of the gesture in millisecond."," * "," */"," flick: function(cb, point, axis, distance, duration) {"," var path;",""," point = this._calculateDefaultPoint(point);",""," if(!Y.Lang.isString(axis)) {"," axis = X_AXIS;"," } else {"," axis = axis.toLowerCase();"," if(axis !== X_AXIS && axis !== Y_AXIS) {"," Y.error(NAME+'(flick): Only x or y axis allowed');"," }"," }",""," if(!Y.Lang.isNumber(distance)) { "," distance = DEFAULTS.DISTANCE_FLICK; "," }",""," if(!Y.Lang.isNumber(duration)){"," duration = DEFAULTS.DURATION_FLICK; // ms"," } else {"," if(duration > DEFAULTS.MAX_DURATION_FLICK) {"," duration = DEFAULTS.MAX_DURATION_FLICK;"," }"," }",""," /**"," * Check if too slow for a flick."," * Adjust duration if the calculated velocity is less than "," * the minimum velcocity to be claimed as a flick."," */"," if(Math.abs(distance)/duration < DEFAULTS.MIN_VELOCITY_FLICK) {"," duration = Math.abs(distance)/DEFAULTS.MIN_VELOCITY_FLICK;"," }",""," path = {"," start: Y.clone(point),"," end: ["," (axis === X_AXIS) ? point[0]+distance : point[0],"," (axis === Y_AXIS) ? point[1]+distance : point[1]"," ]"," };",""," this._move(cb, path, duration);"," },",""," /**"," * The \"move\" gesture simulate the movement of any direction between "," * the straight line of start and end point for the given duration."," * The path argument is an object with \"point\", \"xdist\" and \"ydist\" properties."," * The \"point\" property is an array with x and y coordinations(relative to the"," * top left corner of the target node element) while \"xdist\" and \"ydist\" "," * properties are used for the distance along the x and y axis. A negative "," * distance number can be used to drag either left or up direction. "," * "," * If no arguments are given, it will simulate the default move, which"," * is moving 200 pixels from the center of the element to the positive X-axis "," * direction for 1 sec."," * "," * @method move"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Object} path An object with \"point\", \"xdist\" and \"ydist\"."," * @param {Number} duration A duration of the gesture in millisecond."," */"," move: function(cb, path, duration) {"," var convertedPath;",""," if(!Y.Lang.isObject(path)) {"," path = {"," point: this._calculateDefaultPoint([]),"," xdist: DEFAULTS.DISTANCE_MOVE,"," ydist: 0"," };"," } else {"," // convert to the page coordination"," if(!Y.Lang.isArray(path.point)) {"," path.point = this._calculateDefaultPoint([]);"," } else {"," path.point = this._calculateDefaultPoint(path.point);"," }",""," if(!Y.Lang.isNumber(path.xdist)) {"," path.xdist = DEFAULTS.DISTANCE_MOVE;"," }",""," if(!Y.Lang.isNumber(path.ydist)) {"," path.ydist = 0;"," }"," }",""," if(!Y.Lang.isNumber(duration)){"," duration = DEFAULTS.DURATION_MOVE; // ms"," } else {"," if(duration > DEFAULTS.MAX_DURATION_MOVE) {"," duration = DEFAULTS.MAX_DURATION_MOVE;"," }"," }",""," convertedPath = {"," start: Y.clone(path.point),"," end: [path.point[0]+path.xdist, path.point[1]+path.ydist]"," };",""," this._move(cb, convertedPath, duration);"," },",""," /**"," * A base method on top of \"move\" and \"flick\" methods. The method takes"," * the path with start/end properties and duration to generate a set of "," * touch events for the movement gesture. "," *"," * @method _move"," * @private"," * @param {Function} cb The callback to execute when the gesture simulation "," * is completed."," * @param {Object} path An object with \"start\" and \"end\" properties. Each "," * property should be an array with x and y coordination (e.g. start: [100, 50])"," * @param {Number} duration A duration of the gesture in millisecond. "," */"," _move: function(cb, path, duration) {"," var eventQueue,"," i,"," interval = EVENT_INTERVAL,"," steps, stepX, stepY,"," id = 0,"," touchMove;",""," if(!Y.Lang.isNumber(duration)){"," duration = DEFAULTS.DURATION_MOVE; // ms"," } else {"," if(duration > DEFAULTS.MAX_DURATION_MOVE) {"," duration = DEFAULTS.MAX_DURATION_MOVE;"," }"," }",""," if(!Y.Lang.isObject(path)) {"," path = {"," start: ["," START_PAGEX, "," START_PAGEY"," ], "," end: ["," START_PAGEX + DEFAULTS.DISTANCE_MOVE, "," START_PAGEY"," ]"," };"," } else {"," if(!Y.Lang.isArray(path.start)) {"," path.start = ["," START_PAGEX, "," START_PAGEY"," ];"," }"," if(!Y.Lang.isArray(path.end)) {"," path.end = ["," START_PAGEX + DEFAULTS.DISTANCE_MOVE, "," START_PAGEY"," ];"," }"," }",""," Y.AsyncQueue.defaults.timeout = interval;"," eventQueue = new Y.AsyncQueue();",""," // start"," eventQueue.add({"," fn: function() {"," var coord = {"," pageX: path.start[0], "," pageY: path.start[1],"," clientX: path.start[0], "," clientY: path.start[1]"," }, "," touches = this._createTouchList(["," Y.merge({identifier: (id++)}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_START, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," },"," timeout: 0,"," context: this"," });",""," // move"," steps = Math.floor(duration/interval);"," stepX = (path.end[0] - path.start[0])/steps;"," stepY = (path.end[1] - path.start[1])/steps;",""," touchMove = function(step) {"," var px = path.start[0]+(stepX * step),"," py = path.start[1]+(stepY * step), "," coord = {"," pageX: px, "," pageY: py,"," clientX: px,"," clientY: py"," }, "," touches = this._createTouchList(["," Y.merge({identifier: (id++)}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_MOVE, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," };",""," for (i=0; i < steps; i++) {"," eventQueue.add({"," fn: touchMove,"," args: [i],"," context: this"," });"," }",""," // last move"," eventQueue.add({"," fn: function() {"," var coord = {"," pageX: path.end[0], "," pageY: path.end[1],"," clientX: path.end[0], "," clientY: path.end[1]"," },"," touches = this._createTouchList(["," Y.merge({identifier: id}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_MOVE, Y.merge({"," touches: touches,"," targetTouches: touches,"," changedTouches: touches"," }, coord));"," },"," timeout: 0,"," context: this"," });",""," // end"," eventQueue.add({"," fn: function() {"," var coord = {"," pageX: path.end[0], "," pageY: path.end[1],"," clientX: path.end[0], "," clientY: path.end[1]"," },"," emptyTouchList = this._getEmptyTouchList(),"," touches = this._createTouchList(["," Y.merge({identifier: id}, coord)"," ]);",""," this._simulateEvent(this.target, TOUCH_END, Y.merge({"," touches: emptyTouchList,"," targetTouches: emptyTouchList,"," changedTouches: touches"," }, coord));"," },"," context: this"," });"," "," if(cb && Y.Lang.isFunction(cb)) {"," eventQueue.add({"," fn: cb,",""," // by default, the callback runs the node context where "," // simulateGesture method is called."," context: this.node",""," //TODO: Use args to pass error object as 1st param if there is an error."," //args: "," });"," }"," "," eventQueue.run();"," },",""," /**"," * Helper method to return a singleton instance of empty touch list."," * "," * @method _getEmptyTouchList"," * @private"," * @return {TouchList | Array} An empty touch list object."," */"," _getEmptyTouchList: function() {"," if(!emptyTouchList) {"," emptyTouchList = this._createTouchList([]);"," }",""," return emptyTouchList;"," },",""," /**"," * Helper method to convert an array with touch points to TouchList object as"," * defined in http://www.w3.org/TR/touch-events/"," * "," * @method _createTouchList"," * @private"," * @param {Array} touchPoints "," * @return {TouchList | Array} If underlaying platform support creating touch list"," * a TouchList object will be returned otherwise a fake Array object "," * will be returned."," */"," _createTouchList: function(touchPoints) {"," /*"," * Android 4.0.3 emulator:"," * Native touch api supported starting in version 4.0 (Ice Cream Sandwich)."," * However the support seems limited. In Android 4.0.3 emulator, I got"," * \"TouchList is not defined\"."," */"," var touches = [],"," touchList,"," self = this;",""," if(!!touchPoints && Y.Lang.isArray(touchPoints)) {"," if(Y.UA.android && Y.UA.android >= 4.0 || Y.UA.ios && Y.UA.ios >= 2.0) {"," Y.each(touchPoints, function(point) {"," if(!point.identifier) {point.identifier = 0;}"," if(!point.pageX) {point.pageX = 0;}"," if(!point.pageY) {point.pageY = 0;}"," if(!point.screenX) {point.screenX = 0;}"," if(!point.screenY) {point.screenY = 0;}",""," touches.push(document.createTouch(Y.config.win, "," self.target,"," point.identifier, "," point.pageX, point.pageY, "," point.screenX, point.screenY));"," });",""," touchList = document.createTouchList.apply(document, touches);"," } else if(Y.UA.ios && Y.UA.ios < 2.0) { "," Y.error(NAME+': No touch event simulation framework present.');"," } else {"," // this will inclide android(Y.UA.android && Y.UA.android < 4.0) "," // and desktops among all others. ",""," /**"," * Touch APIs are broken in androids older than 4.0. We will use "," * simulated touch apis for these versions. "," */"," touchList = [];"," Y.each(touchPoints, function(point) {"," if(!point.identifier) {point.identifier = 0;}"," if(!point.clientX) {point.clientX = 0;}"," if(!point.clientY) {point.clientY = 0;}"," if(!point.pageX) {point.pageX = 0;}"," if(!point.pageY) {point.pageY = 0;}"," if(!point.screenX) {point.screenX = 0;}"," if(!point.screenY) {point.screenY = 0;}",""," touchList.push({"," target: self.target,"," identifier: point.identifier,"," clientX: point.clientX,"," clientY: point.clientY,"," pageX: point.pageX,"," pageY: point.pageY,"," screenX: point.screenX,"," screenY: point.screenY"," });"," });",""," touchList.item = function(i) {"," return touchList[i];"," };"," }"," } else {"," Y.error(NAME+': Invalid touchPoints passed');"," }",""," return touchList;"," },",""," /**"," * @method _simulateEvent"," * @private"," * @param {HTMLElement} target The DOM element that's the target of the event."," * @param {String} type The type of event or name of the supported gesture to simulate "," * (i.e., \"click\", \"doubletap\", \"flick\")."," * @param {Object} options (Optional) Extra options to copy onto the event object. "," * For gestures, options are used to refine the gesture behavior."," * @return {void}"," */"," _simulateEvent: function(target, type, options) {"," var touches;",""," if (touchEvents[type]) {"," if(SUPPORTS_TOUCH) {"," Y.Event.simulate(target, type, options);"," } else {"," // simulate using mouse events if touch is not applicable on this platform."," // but only single touch event can be simulated."," if(this._isSingleTouch(options.touches, options.targetTouches, options.changedTouches)) {"," type = {"," touchstart: MOUSE_DOWN,"," touchmove: MOUSE_MOVE,"," touchend: MOUSE_UP"," }[type];",""," options.button = 0;"," options.relatedTarget = null; // since we are not using mouseover event.",""," // touchend has none in options.touches."," touches = (type === MOUSE_UP)? options.changedTouches : options.touches;",""," options = Y.mix(options, {"," screenX: touches.item(0).screenX,"," screenY: touches.item(0).screenY,"," clientX: touches.item(0).clientX,"," clientY: touches.item(0).clientY"," }, true);",""," Y.Event.simulate(target, type, options);",""," if(type == MOUSE_UP) {"," Y.Event.simulate(target, MOUSE_CLICK, options);"," }"," } else {"," Y.error(\"_simulateEvent(): Event '\" + type + \"' has multi touch objects that can't be simulated in your platform.\");"," }"," }"," } else {"," // pass thru for all non touch events"," Y.Event.simulate(target, type, options);"," }"," },",""," /**"," * Helper method to check the single touch."," * @method _isSingleTouch"," * @private"," * @param {TouchList} touches"," * @param {TouchList} targetTouches"," * @param {TouchList} changedTouches"," */"," _isSingleTouch: function(touches, targetTouches, changedTouches) {"," return (touches && (touches.length <= 1)) && "," (targetTouches && (targetTouches.length <= 1)) &&"," (changedTouches && (changedTouches.length <= 1));"," }","};","","/**"," * A gesture simulation class."," */","Y.GestureSimulation = Simulations;","","/**"," * Various simulation default behavior properties. If user override "," * Y.GestureSimulation.defaults, overriden values will be used and this "," * should be done before the gesture simulation. "," */","Y.GestureSimulation.defaults = DEFAULTS;","","/**"," * The high level gesture names that YUI knows how to simulate."," */","Y.GestureSimulation.GESTURES = gestureNames;","","/**"," * Simulates the higher user level gesture of the given name on a target. "," * This method generates a set of low level touch events(Apple specific gesture "," * events as well for the iOS platforms) asynchronously. Note that gesture "," * simulation is relying on `Y.Event.simulate()` method to generate "," * the touch events under the hood. The `Y.Event.simulate()` method"," * itself is a synchronous method."," * "," * Users are suggested to use `Node.simulateGesture()` method which "," * basically calls this method internally. Supported gestures are `tap`, "," * `doubletap`, `press`, `move`, `flick`, `pinch` and `rotate`."," * "," * The `pinch` gesture is used to simulate the pinching and spreading of two"," * fingers. During a pinch simulation, rotation is also possible. Essentially"," * `pinch` and `rotate` simulations share the same base implementation to allow"," * both pinching and rotation at the same time. The only difference is `pinch`"," * requires `start` and `end` option properties while `rotate` requires `rotation` "," * option property."," * "," * The `pinch` and `rotate` gestures can be described as placing 2 fingers along a"," * circle. Pinching and spreading can be described by start and end circles while "," * rotation occurs on a single circle. If the radius of the start circle is greater "," * than the end circle, the gesture becomes a pinch, otherwise it is a spread spread."," * "," * @example"," *"," * var node = Y.one(\"#target\");"," * "," * // double tap example"," * node.simulateGesture(\"doubletap\", function() {"," * // my callback function"," * });"," * "," * // flick example from the center of the node, move 50 pixels down for 50ms)"," * node.simulateGesture(\"flick\", {"," * axis: y,"," * distance: -100"," * duration: 50"," * }, function() {"," * // my callback function"," * });"," * "," * // simulate rotating a node 75 degrees counter-clockwise "," * node.simulateGesture(\"rotate\", {"," * rotation: -75"," * });"," *"," * // simulate a pinch and a rotation at the same time. "," * // fingers start on a circle of radius 100 px, placed at top/bottom"," * // fingers end on a circle of radius 50px, placed at right/left "," * node.simulateGesture(\"pinch\", {"," * r1: 100,"," * r2: 50,"," * start: 0"," * rotation: 90"," * });"," * "," * @method simulateGesture"," * @param {HTMLElement|Node} node The YUI node or HTML element that's the target "," * of the event."," * @param {String} name The name of the supported gesture to simulate. The "," * supported gesture name is one of \"tap\", \"doubletap\", \"press\", \"move\", "," * \"flick\", \"pinch\" and \"rotate\". "," * @param {Object} [options] Extra options used to define the gesture behavior:"," * "," * Valid options properties for the `tap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the tap should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=10] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation."," * @param {Number} [options.times=1] (Optional) Indicates the number of taps."," * @param {Number} [options.delay=10] (Optional) The number of milliseconds "," * before the next tap simulation happens. This is valid only when `times` "," * is more than 1. "," * "," * Valid options properties for the `doubletap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the doubletap should be simulated. Default is the center of the "," * node element."," * "," * Valid options properties for the `press` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the press should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=3000] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation. "," * Default is 3000ms (3 seconds)."," * "," * Valid options properties for the `move` gesture:"," * "," * @param {Object} [options.path] (Optional) Indicates the path of the finger "," * movement. It's an object with three optional properties: `point`, "," * `xdist` and `ydist`."," * @param {Array} [options.path.point] A starting point of the gesture."," * Default is the center of the node element."," * @param {Number} [options.path.xdist=200] A distance to move in pixels "," * along the X axis. A negative distance value indicates moving left."," * @param {Number} [options.path.ydist=0] A distance to move in pixels "," * along the Y axis. A negative distance value indicates moving up."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * "," * Valid options properties for the `flick` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x, y] coordinates "," * where the flick should be simulated. Default is the center of the "," * node element."," * @param {String} [options.axis='x'] (Optional) Valid values are either "," * \"x\" or \"y\". Indicates axis to move along. The flick can move to one of "," * 4 directions(left, right, up and down)."," * @param {Number} [options.distance=200] (Optional) Distance to move in pixels"," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds. User given value could be automatically "," * adjusted by the framework if it is below the minimum velocity to be "," * a flick gesture."," * "," * Valid options properties for the `pinch` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Required) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element."," * @param {Number} [options.r2] (Required) Pixel radius of the end circle "," * when this gesture ends."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation=0] (Optional) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * Valid options properties for the `rotate` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Optional) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element. Default is a fourth of the node "," * element width or height, whichever is smaller."," * @param {Number} [options.r2] (Optional) Pixel radius of the end circle "," * when this gesture ends. Default is a fourth of the node element width or "," * height, whichever is smaller."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation] (Required) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * @param {Function} [cb] The callback to execute when the asynchronouse gesture "," * simulation is completed. "," * @param {Error} cb.err An error object if the simulation is failed. "," * @return {void}"," * @for Event"," * @static"," */","Y.Event.simulateGesture = function(node, name, options, cb) {",""," node = Y.one(node); ",""," var sim = new Y.GestureSimulation(node);"," name = name.toLowerCase();",""," if(!cb && Y.Lang.isFunction(options)) {"," cb = options;"," options = {};"," }",""," options = options || {};",""," if (gestureNames[name]) {"," switch(name) {"," // single-touch: point gestures "," case 'tap':"," sim.tap(cb, options.point, options.times, options.hold, options.delay);"," break;"," case 'doubletap':"," sim.tap(cb, options.point, 2);"," break;"," case 'press':"," if(!Y.Lang.isNumber(options.hold)) {"," options.hold = DEFAULTS.HOLD_PRESS;"," } else if(options.hold < DEFAULTS.MIN_HOLD_PRESS) {"," options.hold = DEFAULTS.MIN_HOLD_PRESS;"," } else if(options.hold > DEFAULTS.MAX_HOLD_PRESS) {"," options.hold = DEFAULTS.MAX_HOLD_PRESS;"," }"," sim.tap(cb, options.point, 1, options.hold);"," break;",""," // single-touch: move gestures "," case 'move':"," sim.move(cb, options.path, options.duration);"," break;"," case 'flick':"," sim.flick(cb, options.point, options.axis, options.distance, "," options.duration);"," break;",""," // multi-touch: pinch/rotation gestures"," case 'pinch':"," sim.pinch(cb, options.center, options.r1, options.r2, "," options.duration, options.start, options.rotation);"," break; "," case 'rotate':"," sim.rotate(cb, options.center, options.r1, options.r2, "," options.duration, options.start, options.rotation);"," break;"," }"," } else {"," Y.error(NAME+': Not a supported gesture simulation: '+name);"," }","};","","","}, '3.7.3', {\"requires\": [\"async-queue\", \"event-simulate\", \"node-screen\"]});"]; _yuitest_coverage["build/gesture-simulate/gesture-simulate.js"].lines = {"1":0,"10":0,"85":0,"86":0,"87":0,"89":0,"90":0,"92":0,"95":0,"96":0,"99":0,"110":0,"123":0,"128":0,"129":0,"131":0,"132":0,"135":0,"138":0,"139":0,"142":0,"145":0,"146":0,"147":0,"150":0,"164":0,"166":0,"167":0,"169":0,"170":0,"171":0,"174":0,"175":0,"178":0,"205":0,"209":0,"210":0,"212":0,"213":0,"217":0,"218":0,"221":0,"252":0,"268":0,"270":0,"271":0,"274":0,"275":0,"278":0,"279":0,"281":0,"282":0,"283":0,"287":0,"288":0,"291":0,"292":0,"295":0,"296":0,"298":0,"299":0,"302":0,"306":0,"312":0,"316":0,"321":0,"322":0,"325":0,"327":0,"330":0,"336":0,"342":0,"349":0,"356":0,"364":0,"369":0,"380":0,"381":0,"382":0,"383":0,"385":0,"386":0,"396":0,"402":0,"408":0,"415":0,"422":0,"430":0,"431":0,"438":0,"439":0,"447":0,"449":0,"453":0,"459":0,"465":0,"472":0,"479":0,"480":0,"486":0,"497":0,"498":0,"510":0,"531":0,"539":0,"541":0,"542":0,"545":0,"546":0,"549":0,"550":0,"553":0,"560":0,"562":0,"563":0,"570":0,"571":0,"578":0,"579":0,"585":0,"592":0,"593":0,"595":0,"601":0,"602":0,"614":0,"636":0,"638":0,"640":0,"641":0,"643":0,"644":0,"645":0,"649":0,"650":0,"653":0,"654":0,"656":0,"657":0,"666":0,"667":0,"670":0,"678":0,"701":0,"703":0,"704":0,"711":0,"712":0,"714":0,"717":0,"718":0,"721":0,"722":0,"726":0,"727":0,"729":0,"730":0,"734":0,"739":0,"756":0,"763":0,"764":0,"766":0,"767":0,"771":0,"772":0,"783":0,"784":0,"789":0,"790":0,"797":0,"798":0,"801":0,"803":0,"813":0,"824":0,"825":0,"826":0,"828":0,"829":0,"841":0,"848":0,"849":0,"857":0,"859":0,"869":0,"880":0,"882":0,"893":0,"902":0,"903":0,"915":0,"926":0,"927":0,"930":0,"951":0,"955":0,"956":0,"957":0,"958":0,"959":0,"960":0,"961":0,"962":0,"964":0,"971":0,"972":0,"973":0,"982":0,"983":0,"984":0,"985":0,"986":0,"987":0,"988":0,"989":0,"990":0,"992":0,"1004":0,"1005":0,"1009":0,"1012":0,"1026":0,"1028":0,"1029":0,"1030":0,"1034":0,"1035":0,"1041":0,"1042":0,"1045":0,"1047":0,"1054":0,"1056":0,"1057":0,"1060":0,"1065":0,"1078":0,"1087":0,"1094":0,"1099":0,"1266":0,"1268":0,"1270":0,"1271":0,"1273":0,"1274":0,"1275":0,"1278":0,"1280":0,"1281":0,"1284":0,"1285":0,"1287":0,"1288":0,"1290":0,"1291":0,"1292":0,"1293":0,"1294":0,"1295":0,"1297":0,"1298":0,"1302":0,"1303":0,"1305":0,"1307":0,"1311":0,"1313":0,"1315":0,"1317":0,"1320":0}; _yuitest_coverage["build/gesture-simulate/gesture-simulate.js"].functions = {"Simulations:85":0,"_toRadian:109":0,"_getDims:122":0,"_calculateDefaultPoint:162":0,"rotate:204":0,"fn:326":0,"touchMove:385":0,"fn:448":0,"pinch:251":0,"touchStart:562":0,"touchEnd:570":0,"fn:594":0,"tap:530":0,"flick:635":0,"move:700":0,"fn:802":0,"touchMove:828":0,"fn:858":0,"fn:881":0,"_move:755":0,"_getEmptyTouchList:925":0,"(anonymous 2):957":0,"(anonymous 3):983":0,"item:1004":0,"_createTouchList:944":0,"_simulateEvent:1025":0,"_isSingleTouch:1077":0,"simulateGesture:1266":0,"(anonymous 1):1":0}; _yuitest_coverage["build/gesture-simulate/gesture-simulate.js"].coveredLines = 272;@@ -1662,4 +1662,4 @@ }; -}, '3.7.2', {"requires": ["async-queue", "event-simulate", "node-screen"]});+}, '3.7.3', {"requires": ["async-queue", "event-simulate", "node-screen"]});
bundle/gesture-simulate/gesture-simulate-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1328,4 +1328,4 @@ }; -}, '3.7.2', {"requires": ["async-queue", "event-simulate", "node-screen"]});+}, '3.7.3', {"requires": ["async-queue", "event-simulate", "node-screen"]});
bundle/gesture-simulate/gesture-simulate-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("gesture-simulate",function(e,t){function T(n){n||e.error(t+": invalid target node"),this.node=n,this.target=e.Node.getDOMNode(n);var r=this.node.getXY(),i=this._getDims();a=r[0]+i[0]/2,f=r[1]+i[1]/2}var t="gesture-simulate",n=e.config.win&&"ontouchstart"in e.config.win&&!e.UA.phantomjs&&!(e.UA.chrome&&e.UA.chrome<6),r={tap:1,doubletap:1,press:1,move:1,flick:1,pinch:1,rotate:1},i={touchstart:1,touchmove:1,touchend:1,touchcancel:1},s=e.config.doc,o,u=20,a,f,l={HOLD_TAP:10,DELAY_TAP:10,HOLD_PRESS:3e3,MIN_HOLD_PRESS:1e3,MAX_HOLD_PRESS:6e4,DISTANCE_MOVE:200,DURATION_MOVE:1e3,MAX_DURATION_MOVE:5e3,MIN_VELOCITY_FLICK:1.3,DISTANCE_FLICK:200,DURATION_FLICK:1e3,MAX_DURATION_FLICK:5e3,DURATION_PINCH:1e3},c="touchstart",h="touchmove",p="touchend",d="gesturestart",v="gesturechange",m="gestureend",g="mouseup",y="mousemove",b="mousedown",w="click",E="dblclick",S="x",x="y";T.prototype={_toRadian:function(e){return e*(Math.PI/180)},_getDims:function(){var e,t,n;return this.target.getBoundingClientRect?(e=this.target.getBoundingClientRect(),"height"in e?n=e.height:n=Math.abs(e.bottom-e.top),"width"in e?t=e.width:t=Math.abs(e.right-e.left)):(e=this.node.get("region"),t=e.width,n=e.height),[t,n]},_calculateDefaultPoint:function(t){var n;return!e.Lang.isArray(t)||t.length===0?t=[a,f]:(t.length==1&&(n=this._getDims[1],t[1]=n/2),t[0]=this.node.getX()+t[0],t[1]=this.node.getY()+t[1]),t},rotate:function(n,r,i,s,o,u,a){var f,l=i,c=s;if(!e.Lang.isNumber(l)||!e.Lang.isNumber(c)||l<0||c<0)f=this.target.offsetWidth<this.target.offsetHeight?this.target.offsetWidth/4:this.target.offsetHeight/4,l=f,c=f;e.Lang.isNumber(a)||e.error(t+"Invalid rotation detected."),this.pinch(n,r,l,c,o,u,a)},pinch:function(n,r,i,s,o,a,f){var g,y,b=u,w,E=0,S=i,x=s,T,N,C,k,L,A,O,M,_,D={start:[],end:[]},P={start:[],end:[]},H,B;r=this._calculateDefaultPoint(r),(!e.Lang.isNumber(S)||!e.Lang.isNumber(x)||S<0||x<0)&&e.error(t+"Invalid startRadius and endRadius detected.");if(!e.Lang.isNumber(o)||o<=0)o=l.DURATION_PINCH;if(!e.Lang.isNumber(a))a=0;else{a%=360;while(a<0)a+=360}e.Lang.isNumber(f)||(f=0),e.AsyncQueue.defaults.timeout=b,g=new e.AsyncQueue,N=r[0],C=r[1],O=a,M=a+f,D.start=[N+S*Math.sin(this._toRadian(O)),C-S*Math.cos(this._toRadian(O))],D.end=[N+x*Math.sin(this._toRadian(M)),C-x*Math.cos(this._toRadian(M))],P.start=[N-S*Math.sin(this._toRadian(O)),C+S*Math.cos(this._toRadian(O))],P.end=[N-x*Math.sin(this._toRadian(M)),C+x*Math.cos(this._toRadian(M))],k=1,L=s/i,g.add({fn:function(){var t,n,r,i;t={pageX:D.start[0],pageY:D.start[1],clientX:D.start[0],clientY:D.start[1]},n={pageX:P.start[0],pageY:P.start[1],clientX:P.start[0],clientY:P.start[1]},i=this._createTouchList([e.merge({identifier:E++},t),e.merge({identifier:E++},n)]),r={pageX:(D.start[0]+P.start[0])/2,pageY:(D.start[0]+P.start[1])/2,clientX:(D.start[0]+P.start[0])/2,clientY:(D.start[0]+P.start[1])/2},this._simulateEvent(this.target,c,e.merge({touches:i,targetTouches:i,changedTouches:i,scale:k,rotation:O},r)),e.UA.ios>=2&&this._simulateEvent(this.target,d,e.merge({scale:k,rotation:O},r))},timeout:0,context:this}),H=Math.floor(o/b),T=(x-S)/H,A=(L-k)/H,_=(M-O)/H,B=function(t){var n=S+T*t,r=N+n*Math.sin(this._toRadian(O+_*t)),i=C-n*Math.cos(this._toRadian(O+_*t)),s=N-n*Math.sin(this._toRadian(O+_*t)),o=C+n*Math.cos(this._toRadian(O+_*t)),u=(r+s)/2,a=(i+o)/2,f,l,c,p;f={pageX:r,pageY:i,clientX:r,clientY:i},l={pageX:s,pageY:o,clientX:s,clientY:o},p=this._createTouchList([e.merge({identifier:E++},f),e.merge({identifier:E++},l)]),c={pageX:u,pageY:a,clientX:u,clientY:a},this._simulateEvent(this.target,h,e.merge({touches:p,targetTouches:p,changedTouches:p,scale:k+A*t,rotation:O+_*t},c)),e.UA.ios>=2&&this._simulateEvent(this.target,v,e.merge({scale:k+A*t,rotation:O+_*t},c))};for(y=0;y<H;y++)g.add({fn:B,args:[y],context:this});g.add({fn:function(){var t=this._getEmptyTouchList(),n,r,i,s;n={pageX:D.end[0],pageY:D.end[1],clientX:D.end[0],clientY:D.end[1]},r={pageX:P.end[0],pageY:P.end[1],clientX:P.end[0],clientY:P.end[1]},s=this._createTouchList([e.merge({identifier:E++},n),e.merge({identifier:E++},r)]),i={pageX:(D.end[0]+P.end[0])/2,pageY:(D.end[0]+P.end[1])/2,clientX:(D.end[0]+P.end[0])/2,clientY:(D.end[0]+P.end[1])/2},e.UA.ios>=2&&this._simulateEvent(this.target,m,e.merge({scale:L,rotation:M},i)),this._simulateEvent(this.target,p,e.merge({touches:t,targetTouches:t,changedTouches:s,scale:L,rotation:M},i))},context:this}),n&&e.Lang.isFunction(n)&&g.add({fn:n,context:this.node}),g.run()},tap:function(t,r,i,s,o){var u=new e.AsyncQueue,a=this._getEmptyTouchList(),f,h,d,v,m;r=this._calculateDefaultPoint(r);if(!e.Lang.isNumber(i)||i<1)i=1;e.Lang.isNumber(s)||(s=l.HOLD_TAP),e.Lang.isNumber(o)||(o=l.DELAY_TAP),h={pageX:r[0],pageY:r[1],clientX:r[0],clientY:r[1]},f=this._createTouchList([e.merge({identifier:0},h)]),v=function(){this._simulateEvent(this.target,c,e.merge({touches:f,targetTouches:f,changedTouches:f},h))},m=function(){this._simulateEvent(this.target,p,e.merge({touches:a,targetTouches:a,changedTouches:f},h))};for(d=0;d<i;d++)u.add({fn:v,context:this,timeout:d===0?0:o}),u.add({fn:m,context:this,timeout:s});i>1&&!n&&u.add({fn:function(){this._simulateEvent(this.target,E,h)},context:this}),t&&e.Lang.isFunction(t)&&u.add({fn:t,context:this.node}),u.run()},flick:function(n,r,i,s,o){var u;r=this._calculateDefaultPoint(r),e.Lang.isString(i)?(i=i.toLowerCase(),i!==S&&i!==x&&e.error(t+"(flick): Only x or y axis allowed")):i=S,e.Lang.isNumber(s)||(s=l.DISTANCE_FLICK),e.Lang.isNumber(o)?o>l.MAX_DURATION_FLICK&&(o=l.MAX_DURATION_FLICK):o=l.DURATION_FLICK,Math.abs(s)/o<l.MIN_VELOCITY_FLICK&&(o=Math.abs(s)/l.MIN_VELOCITY_FLICK),u={start:e.clone(r),end:[i===S?r[0]+s:r[0],i===x?r[1]+s:r[1]]},this._move(n,u,o)},move:function(t,n,r){var i;e.Lang.isObject(n)?(e.Lang.isArray(n.point)?n.point=this._calculateDefaultPoint(n.point):n.point=this._calculateDefaultPoint([]),e.Lang.isNumber(n.xdist)||(n.xdist=l.DISTANCE_MOVE),e.Lang.isNumber(n.ydist)||(n.ydist=0)):n={point:this._calculateDefaultPoint([]),xdist:l.DISTANCE_MOVE,ydist:0},e.Lang.isNumber(r)?r>l.MAX_DURATION_MOVE&&(r=l.MAX_DURATION_MOVE):r=l.DURATION_MOVE,i={start:e.clone(n.point),end:[n.point[0]+n.xdist,n.point[1]+n.ydist]},this._move(t,i,r)},_move:function(t,n,r){var i,s,o=u,d,v,m,g=0,y;e.Lang.isNumber(r)?r>l.MAX_DURATION_MOVE&&(r=l.MAX_DURATION_MOVE):r=l.DURATION_MOVE,e.Lang.isObject(n)?(e.Lang.isArray(n.start)||(n.start=[a,f]),e.Lang.isArray(n.end)||(n.end=[a+l.DISTANCE_MOVE,f])):n={start:[a,f],end:[a+l.DISTANCE_MOVE,f]},e.AsyncQueue.defaults.timeout=o,i=new e.AsyncQueue,i.add({fn:function(){var t={pageX:n.start[0],pageY:n.start[1],clientX:n.start[0],clientY:n.start[1]},r=this._createTouchList([e.merge({identifier:g++},t)]);this._simulateEvent(this.target,c,e.merge({touches:r,targetTouches:r,changedTouches:r},t))},timeout:0,context:this}),d=Math.floor(r/o),v=(n.end[0]-n.start[0])/d,m=(n.end[1]-n.start[1])/d,y=function(t){var r=n.start[0]+v*t,i=n.start[1]+m*t,s={pageX:r,pageY:i,clientX:r,clientY:i},o=this._createTouchList([e.merge({identifier:g++},s)]);this._simulateEvent(this.target,h,e.merge({touches:o,targetTouches:o,changedTouches:o},s))};for(s=0;s<d;s++)i.add({fn:y,args:[s],context:this});i.add({fn:function(){var t={pageX:n.end[0],pageY:n.end[1],clientX:n.end[0],clientY:n.end[1]},r=this._createTouchList([e.merge({identifier:g},t)]);this._simulateEvent(this.target,h,e.merge({touches:r,targetTouches:r,changedTouches:r},t))},timeout:0,context:this}),i.add({fn:function(){var t={pageX:n.end[0],pageY:n.end[1],clientX:n.end[0],clientY:n.end[1]},r=this._getEmptyTouchList(),i=this._createTouchList([e.merge({identifier:g},t)]);this._simulateEvent(this.target,p,e.merge({touches:r,targetTouches:r,changedTouches:i},t))},context:this}),t&&e.Lang.isFunction(t)&&i.add({fn:t,context:this.node}),i.run()},_getEmptyTouchList:function(){return o||(o=this._createTouchList([])),o},_createTouchList:function(n){var r=[],i,o=this;return!!n&&e.Lang.isArray(n)?e.UA.android&&e.UA.android>=4||e.UA.ios&&e.UA.ios>=2?(e.each(n,function(t){t.identifier||(t.identifier=0),t.pageX||(t.pageX=0),t.pageY||(t.pageY=0),t.screenX||(t.screenX=0),t.screenY||(t.screenY=0),r.push(s.createTouch(e.config.win,o.target,t.identifier,t.pageX,t.pageY,t.screenX,t.screenY))}),i=s.createTouchList.apply(s,r)):e.UA.ios&&e.UA.ios<2?e.error(t+": No touch event simulation framework present."):(i=[],e.each(n,function(e){e.identifier||(e.identifier=0),e.clientX||(e.clientX=0),e.clientY||(e.clientY=0),e.pageX||(e.pageX=0),e.pageY||(e.pageY=0),e.screenX||(e.screenX=0),e.screenY||(e.screenY=0),i.push({target:o.target,identifier:e.identifier,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}),i.item=function(e){return i[e]}):e.error(t+": Invalid touchPoints passed"),i},_simulateEvent:function(t,r,s){var o;i[r]?n?e.Event.simulate(t,r,s):this._isSingleTouch(s.touches,s.targetTouches,s.changedTouches)?(r={touchstart:b,touchmove:y,touchend:g}[r],s.button=0,s.relatedTarget=null,o=r===g?s.changedTouches:s.touches,s=e.mix(s,{screenX:o.item(0).screenX,screenY:o.item(0).screenY,clientX:o.item(0).clientX,clientY:o.item(0).clientY},!0),e.Event.simulate(t,r,s),r==g&&e.Event.simulate(t,w,s)):e.error("_simulateEvent(): Event '"+r+"' has multi touch objects that can't be simulated in your platform."):e.Event.simulate(t,r,s)},_isSingleTouch:function(e,t,n){return e&&e.length<=1&&t&&t.length<=1&&n&&n.length<=1}},e.GestureSimulation=T,e.GestureSimulation.defaults=l,e.GestureSimulation.GESTURES=r,e.Event.simulateGesture=function(n,i,s,o){n=e.one(n);var u=new e.GestureSimulation(n);i=i.toLowerCase(),!o&&e.Lang.isFunction(s)&&(o=s,s={}),s=s||{};if(r[i])switch(i){case"tap":u.tap(o,s.point,s.times,s.hold,s.delay);break;case"doubletap":u.tap(o,s.point,2);break;case"press":e.Lang.isNumber(s.hold)?s.hold<l.MIN_HOLD_PRESS?s.hold=l.MIN_HOLD_PRESS:s.hold>l.MAX_HOLD_PRESS&&(s.hold=l.MAX_HOLD_PRESS):s.hold=l.HOLD_PRESS,u.tap(o,s.point,1,s.hold);break;case"move":u.move(o,s.path,s.duration);break;case"flick":u.flick(o,s.point,s.axis,s.distance,s.duration);break;case"pinch":u.pinch(o,s.center,s.r1,s.r2,s.duration,s.start,s.rotation);break;case"rotate":u.rotate(o,s.center,s.r1,s.r2,s.duration,s.start,s.rotation)}else e.error(t+": Not a supported gesture simulation: "+i)}},"3.7.2",{requires:["async-queue","event-simulate","node-screen"]});+YUI.add("gesture-simulate",function(e,t){function T(n){n||e.error(t+": invalid target node"),this.node=n,this.target=e.Node.getDOMNode(n);var r=this.node.getXY(),i=this._getDims();a=r[0]+i[0]/2,f=r[1]+i[1]/2}var t="gesture-simulate",n=e.config.win&&"ontouchstart"in e.config.win&&!e.UA.phantomjs&&!(e.UA.chrome&&e.UA.chrome<6),r={tap:1,doubletap:1,press:1,move:1,flick:1,pinch:1,rotate:1},i={touchstart:1,touchmove:1,touchend:1,touchcancel:1},s=e.config.doc,o,u=20,a,f,l={HOLD_TAP:10,DELAY_TAP:10,HOLD_PRESS:3e3,MIN_HOLD_PRESS:1e3,MAX_HOLD_PRESS:6e4,DISTANCE_MOVE:200,DURATION_MOVE:1e3,MAX_DURATION_MOVE:5e3,MIN_VELOCITY_FLICK:1.3,DISTANCE_FLICK:200,DURATION_FLICK:1e3,MAX_DURATION_FLICK:5e3,DURATION_PINCH:1e3},c="touchstart",h="touchmove",p="touchend",d="gesturestart",v="gesturechange",m="gestureend",g="mouseup",y="mousemove",b="mousedown",w="click",E="dblclick",S="x",x="y";T.prototype={_toRadian:function(e){return e*(Math.PI/180)},_getDims:function(){var e,t,n;return this.target.getBoundingClientRect?(e=this.target.getBoundingClientRect(),"height"in e?n=e.height:n=Math.abs(e.bottom-e.top),"width"in e?t=e.width:t=Math.abs(e.right-e.left)):(e=this.node.get("region"),t=e.width,n=e.height),[t,n]},_calculateDefaultPoint:function(t){var n;return!e.Lang.isArray(t)||t.length===0?t=[a,f]:(t.length==1&&(n=this._getDims[1],t[1]=n/2),t[0]=this.node.getX()+t[0],t[1]=this.node.getY()+t[1]),t},rotate:function(n,r,i,s,o,u,a){var f,l=i,c=s;if(!e.Lang.isNumber(l)||!e.Lang.isNumber(c)||l<0||c<0)f=this.target.offsetWidth<this.target.offsetHeight?this.target.offsetWidth/4:this.target.offsetHeight/4,l=f,c=f;e.Lang.isNumber(a)||e.error(t+"Invalid rotation detected."),this.pinch(n,r,l,c,o,u,a)},pinch:function(n,r,i,s,o,a,f){var g,y,b=u,w,E=0,S=i,x=s,T,N,C,k,L,A,O,M,_,D={start:[],end:[]},P={start:[],end:[]},H,B;r=this._calculateDefaultPoint(r),(!e.Lang.isNumber(S)||!e.Lang.isNumber(x)||S<0||x<0)&&e.error(t+"Invalid startRadius and endRadius detected.");if(!e.Lang.isNumber(o)||o<=0)o=l.DURATION_PINCH;if(!e.Lang.isNumber(a))a=0;else{a%=360;while(a<0)a+=360}e.Lang.isNumber(f)||(f=0),e.AsyncQueue.defaults.timeout=b,g=new e.AsyncQueue,N=r[0],C=r[1],O=a,M=a+f,D.start=[N+S*Math.sin(this._toRadian(O)),C-S*Math.cos(this._toRadian(O))],D.end=[N+x*Math.sin(this._toRadian(M)),C-x*Math.cos(this._toRadian(M))],P.start=[N-S*Math.sin(this._toRadian(O)),C+S*Math.cos(this._toRadian(O))],P.end=[N-x*Math.sin(this._toRadian(M)),C+x*Math.cos(this._toRadian(M))],k=1,L=s/i,g.add({fn:function(){var t,n,r,i;t={pageX:D.start[0],pageY:D.start[1],clientX:D.start[0],clientY:D.start[1]},n={pageX:P.start[0],pageY:P.start[1],clientX:P.start[0],clientY:P.start[1]},i=this._createTouchList([e.merge({identifier:E++},t),e.merge({identifier:E++},n)]),r={pageX:(D.start[0]+P.start[0])/2,pageY:(D.start[0]+P.start[1])/2,clientX:(D.start[0]+P.start[0])/2,clientY:(D.start[0]+P.start[1])/2},this._simulateEvent(this.target,c,e.merge({touches:i,targetTouches:i,changedTouches:i,scale:k,rotation:O},r)),e.UA.ios>=2&&this._simulateEvent(this.target,d,e.merge({scale:k,rotation:O},r))},timeout:0,context:this}),H=Math.floor(o/b),T=(x-S)/H,A=(L-k)/H,_=(M-O)/H,B=function(t){var n=S+T*t,r=N+n*Math.sin(this._toRadian(O+_*t)),i=C-n*Math.cos(this._toRadian(O+_*t)),s=N-n*Math.sin(this._toRadian(O+_*t)),o=C+n*Math.cos(this._toRadian(O+_*t)),u=(r+s)/2,a=(i+o)/2,f,l,c,p;f={pageX:r,pageY:i,clientX:r,clientY:i},l={pageX:s,pageY:o,clientX:s,clientY:o},p=this._createTouchList([e.merge({identifier:E++},f),e.merge({identifier:E++},l)]),c={pageX:u,pageY:a,clientX:u,clientY:a},this._simulateEvent(this.target,h,e.merge({touches:p,targetTouches:p,changedTouches:p,scale:k+A*t,rotation:O+_*t},c)),e.UA.ios>=2&&this._simulateEvent(this.target,v,e.merge({scale:k+A*t,rotation:O+_*t},c))};for(y=0;y<H;y++)g.add({fn:B,args:[y],context:this});g.add({fn:function(){var t=this._getEmptyTouchList(),n,r,i,s;n={pageX:D.end[0],pageY:D.end[1],clientX:D.end[0],clientY:D.end[1]},r={pageX:P.end[0],pageY:P.end[1],clientX:P.end[0],clientY:P.end[1]},s=this._createTouchList([e.merge({identifier:E++},n),e.merge({identifier:E++},r)]),i={pageX:(D.end[0]+P.end[0])/2,pageY:(D.end[0]+P.end[1])/2,clientX:(D.end[0]+P.end[0])/2,clientY:(D.end[0]+P.end[1])/2},e.UA.ios>=2&&this._simulateEvent(this.target,m,e.merge({scale:L,rotation:M},i)),this._simulateEvent(this.target,p,e.merge({touches:t,targetTouches:t,changedTouches:s,scale:L,rotation:M},i))},context:this}),n&&e.Lang.isFunction(n)&&g.add({fn:n,context:this.node}),g.run()},tap:function(t,r,i,s,o){var u=new e.AsyncQueue,a=this._getEmptyTouchList(),f,h,d,v,m;r=this._calculateDefaultPoint(r);if(!e.Lang.isNumber(i)||i<1)i=1;e.Lang.isNumber(s)||(s=l.HOLD_TAP),e.Lang.isNumber(o)||(o=l.DELAY_TAP),h={pageX:r[0],pageY:r[1],clientX:r[0],clientY:r[1]},f=this._createTouchList([e.merge({identifier:0},h)]),v=function(){this._simulateEvent(this.target,c,e.merge({touches:f,targetTouches:f,changedTouches:f},h))},m=function(){this._simulateEvent(this.target,p,e.merge({touches:a,targetTouches:a,changedTouches:f},h))};for(d=0;d<i;d++)u.add({fn:v,context:this,timeout:d===0?0:o}),u.add({fn:m,context:this,timeout:s});i>1&&!n&&u.add({fn:function(){this._simulateEvent(this.target,E,h)},context:this}),t&&e.Lang.isFunction(t)&&u.add({fn:t,context:this.node}),u.run()},flick:function(n,r,i,s,o){var u;r=this._calculateDefaultPoint(r),e.Lang.isString(i)?(i=i.toLowerCase(),i!==S&&i!==x&&e.error(t+"(flick): Only x or y axis allowed")):i=S,e.Lang.isNumber(s)||(s=l.DISTANCE_FLICK),e.Lang.isNumber(o)?o>l.MAX_DURATION_FLICK&&(o=l.MAX_DURATION_FLICK):o=l.DURATION_FLICK,Math.abs(s)/o<l.MIN_VELOCITY_FLICK&&(o=Math.abs(s)/l.MIN_VELOCITY_FLICK),u={start:e.clone(r),end:[i===S?r[0]+s:r[0],i===x?r[1]+s:r[1]]},this._move(n,u,o)},move:function(t,n,r){var i;e.Lang.isObject(n)?(e.Lang.isArray(n.point)?n.point=this._calculateDefaultPoint(n.point):n.point=this._calculateDefaultPoint([]),e.Lang.isNumber(n.xdist)||(n.xdist=l.DISTANCE_MOVE),e.Lang.isNumber(n.ydist)||(n.ydist=0)):n={point:this._calculateDefaultPoint([]),xdist:l.DISTANCE_MOVE,ydist:0},e.Lang.isNumber(r)?r>l.MAX_DURATION_MOVE&&(r=l.MAX_DURATION_MOVE):r=l.DURATION_MOVE,i={start:e.clone(n.point),end:[n.point[0]+n.xdist,n.point[1]+n.ydist]},this._move(t,i,r)},_move:function(t,n,r){var i,s,o=u,d,v,m,g=0,y;e.Lang.isNumber(r)?r>l.MAX_DURATION_MOVE&&(r=l.MAX_DURATION_MOVE):r=l.DURATION_MOVE,e.Lang.isObject(n)?(e.Lang.isArray(n.start)||(n.start=[a,f]),e.Lang.isArray(n.end)||(n.end=[a+l.DISTANCE_MOVE,f])):n={start:[a,f],end:[a+l.DISTANCE_MOVE,f]},e.AsyncQueue.defaults.timeout=o,i=new e.AsyncQueue,i.add({fn:function(){var t={pageX:n.start[0],pageY:n.start[1],clientX:n.start[0],clientY:n.start[1]},r=this._createTouchList([e.merge({identifier:g++},t)]);this._simulateEvent(this.target,c,e.merge({touches:r,targetTouches:r,changedTouches:r},t))},timeout:0,context:this}),d=Math.floor(r/o),v=(n.end[0]-n.start[0])/d,m=(n.end[1]-n.start[1])/d,y=function(t){var r=n.start[0]+v*t,i=n.start[1]+m*t,s={pageX:r,pageY:i,clientX:r,clientY:i},o=this._createTouchList([e.merge({identifier:g++},s)]);this._simulateEvent(this.target,h,e.merge({touches:o,targetTouches:o,changedTouches:o},s))};for(s=0;s<d;s++)i.add({fn:y,args:[s],context:this});i.add({fn:function(){var t={pageX:n.end[0],pageY:n.end[1],clientX:n.end[0],clientY:n.end[1]},r=this._createTouchList([e.merge({identifier:g},t)]);this._simulateEvent(this.target,h,e.merge({touches:r,targetTouches:r,changedTouches:r},t))},timeout:0,context:this}),i.add({fn:function(){var t={pageX:n.end[0],pageY:n.end[1],clientX:n.end[0],clientY:n.end[1]},r=this._getEmptyTouchList(),i=this._createTouchList([e.merge({identifier:g},t)]);this._simulateEvent(this.target,p,e.merge({touches:r,targetTouches:r,changedTouches:i},t))},context:this}),t&&e.Lang.isFunction(t)&&i.add({fn:t,context:this.node}),i.run()},_getEmptyTouchList:function(){return o||(o=this._createTouchList([])),o},_createTouchList:function(n){var r=[],i,o=this;return!!n&&e.Lang.isArray(n)?e.UA.android&&e.UA.android>=4||e.UA.ios&&e.UA.ios>=2?(e.each(n,function(t){t.identifier||(t.identifier=0),t.pageX||(t.pageX=0),t.pageY||(t.pageY=0),t.screenX||(t.screenX=0),t.screenY||(t.screenY=0),r.push(s.createTouch(e.config.win,o.target,t.identifier,t.pageX,t.pageY,t.screenX,t.screenY))}),i=s.createTouchList.apply(s,r)):e.UA.ios&&e.UA.ios<2?e.error(t+": No touch event simulation framework present."):(i=[],e.each(n,function(e){e.identifier||(e.identifier=0),e.clientX||(e.clientX=0),e.clientY||(e.clientY=0),e.pageX||(e.pageX=0),e.pageY||(e.pageY=0),e.screenX||(e.screenX=0),e.screenY||(e.screenY=0),i.push({target:o.target,identifier:e.identifier,clientX:e.clientX,clientY:e.clientY,pageX:e.pageX,pageY:e.pageY,screenX:e.screenX,screenY:e.screenY})}),i.item=function(e){return i[e]}):e.error(t+": Invalid touchPoints passed"),i},_simulateEvent:function(t,r,s){var o;i[r]?n?e.Event.simulate(t,r,s):this._isSingleTouch(s.touches,s.targetTouches,s.changedTouches)?(r={touchstart:b,touchmove:y,touchend:g}[r],s.button=0,s.relatedTarget=null,o=r===g?s.changedTouches:s.touches,s=e.mix(s,{screenX:o.item(0).screenX,screenY:o.item(0).screenY,clientX:o.item(0).clientX,clientY:o.item(0).clientY},!0),e.Event.simulate(t,r,s),r==g&&e.Event.simulate(t,w,s)):e.error("_simulateEvent(): Event '"+r+"' has multi touch objects that can't be simulated in your platform."):e.Event.simulate(t,r,s)},_isSingleTouch:function(e,t,n){return e&&e.length<=1&&t&&t.length<=1&&n&&n.length<=1}},e.GestureSimulation=T,e.GestureSimulation.defaults=l,e.GestureSimulation.GESTURES=r,e.Event.simulateGesture=function(n,i,s,o){n=e.one(n);var u=new e.GestureSimulation(n);i=i.toLowerCase(),!o&&e.Lang.isFunction(s)&&(o=s,s={}),s=s||{};if(r[i])switch(i){case"tap":u.tap(o,s.point,s.times,s.hold,s.delay);break;case"doubletap":u.tap(o,s.point,2);break;case"press":e.Lang.isNumber(s.hold)?s.hold<l.MIN_HOLD_PRESS?s.hold=l.MIN_HOLD_PRESS:s.hold>l.MAX_HOLD_PRESS&&(s.hold=l.MAX_HOLD_PRESS):s.hold=l.HOLD_PRESS,u.tap(o,s.point,1,s.hold);break;case"move":u.move(o,s.path,s.duration);break;case"flick":u.flick(o,s.point,s.axis,s.distance,s.duration);break;case"pinch":u.pinch(o,s.center,s.r1,s.r2,s.duration,s.start,s.rotation);break;case"rotate":u.rotate(o,s.center,s.r1,s.r2,s.duration,s.start,s.rotation)}else e.error(t+": Not a supported gesture simulation: "+i)}},"3.7.3",{requires:["async-queue","event-simulate","node-screen"]});
bundle/gesture-simulate/gesture-simulate.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1328,4 +1328,4 @@ }; -}, '3.7.2', {"requires": ["async-queue", "event-simulate", "node-screen"]});+}, '3.7.3', {"requires": ["async-queue", "event-simulate", "node-screen"]});
bundle/get-nodejs/get-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/get/get.js", code: [] };-_yuitest_coverage["/build/get/get.js"].code=["YUI.add('get', function(Y) {",""," /**"," * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed."," * @module get-nodejs"," * @class GetNodeJS"," */"," "," var path = require('path'),"," vm = require('vm'),"," fs = require('fs'),"," request = require('request'),"," existsSync = fs.existsSync || path.existsSync;","",""," Y.Get = function() {"," };",""," //Setup the default config base path"," Y.config.base = path.join(__dirname, '../');",""," YUI.require = require;"," YUI.process = process;"," "," /**"," * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`"," * @method escapeWinPath"," * @protected"," * @param {String} p The path to modify"," * @return {String} The encoded path"," */"," var escapeWinPath = function(p) {"," return p.replace(/\\\\/g, '\\\\\\\\');"," };",""," /**"," * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded"," * into the YUI object"," * @method _exec"," * @private"," * @param {String} data The JS to execute"," * @param {String} url The path to the file that was parsed"," * @param {Callback} cb The callback to execute when this is completed"," * @param {Error} cb.err=null Error object"," * @param {String} cb.url The URL that was just parsed"," */",""," Y.Get._exec = function(data, url, cb) {"," var dirName = escapeWinPath(path.dirname(url));"," var fileName = escapeWinPath(url);",""," if (dirName.match(/^https?:\\/\\//)) {"," dirName = '.';"," fileName = 'remoteResource';"," }",""," var mod = \"(function(YUI) { var __dirname = '\" + dirName + \"'; \"+"," \"var __filename = '\" + fileName + \"'; \" +"," \"var process = YUI.process;\" +"," \"var require = function(file) {\" +"," \" if (file.indexOf('./') === 0) {\" +"," \" file = __dirname + file.replace('./', '/'); }\" +"," \" return YUI.require(file); }; \" +"," data + \" ;return YUI; })\";"," "," //var mod = \"(function(YUI) { \" + data + \";return YUI; })\";"," var script = vm.createScript(mod, url);"," var fn = script.runInThisContext(mod);"," YUI = fn(YUI);"," cb(null, url);"," };"," "," /**"," * Fetches the content from a remote URL or a file from disc and passes the content"," * off to `_exec` for parsing"," * @method _include"," * @private"," * @param {String} url The URL/File path to fetch the content from"," * @param {Callback} cb The callback to fire once the content has been executed via `_exec`"," */"," Y.Get._include = function(url, cb) {"," var self = this;",""," if (url.match(/^https?:\\/\\//)) {"," var cfg = {"," url: url,"," timeout: self.timeout"," };"," request(cfg, function (err, response, body) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(body, url, cb);"," }"," });"," } else {"," if (Y.config.useSync) {"," //Needs to be in useSync"," if (existsSync(url)) {"," var mod = fs.readFileSync(url,'utf8');"," Y.Get._exec(mod, url, cb);"," } else {"," cb('Path does not exist: ' + url, url);"," }"," } else {"," fs.readFile(url, 'utf8', function(err, mod) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(mod, url, cb);"," }"," });"," }"," }"," "," };","",""," var end = function(cb, msg, result) {"," if (Y.Lang.isFunction(cb.onEnd)) {"," cb.onEnd.call(Y, msg, result);"," }"," }, pass = function(cb) {"," if (Y.Lang.isFunction(cb.onSuccess)) {"," cb.onSuccess.call(Y, cb);"," }"," end(cb, 'success', 'success');"," }, fail = function(cb, er) {"," er.errors = [er];"," if (Y.Lang.isFunction(cb.onFailure)) {"," cb.onFailure.call(Y, er, cb);"," }"," end(cb, er, 'fail');"," };","",""," /**"," * Override for Get.script for loading local or remote YUI modules."," * @method js"," * @param {Array|String} s The URL's to load into this context"," * @param {Object} options Transaction options"," */"," Y.Get.js = function(s, options) {"," var A = Y.Array,"," self = this,"," urls = A(s), url, i, l = urls.length, c= 0,"," check = function() {"," if (c === l) {"," pass(options);"," }"," };","","",""," for (i=0; i<l; i++) {"," url = urls[i];"," if (Y.Lang.isObject(url)) {"," url = url.url;"," }",""," url = url.replace(/'/g, '%27');"," Y.Get._include(url, function(err, url) {"," if (!Y.config) {"," Y.config = {"," debug: true"," };"," }"," if (options.onProgress) {"," options.onProgress.call(options.context || Y, url);"," }"," if (err) {"," fail(options, err);"," } else {"," c++;"," check();"," }"," });"," }"," };"," "," /**"," * Alias for `Y.Get.js`"," * @method script"," */"," Y.Get.script = Y.Get.js;"," "," //Place holder for SS Dom access"," Y.Get.css = function(s, cb) {"," pass(cb);"," };","","","","}, '3.7.2' ,{requires:['yui-base']});"];+_yuitest_coverage["/build/get/get.js"].code=["YUI.add('get', function(Y) {",""," /**"," * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed."," * @module get-nodejs"," * @class GetNodeJS"," */"," "," var path = require('path'),"," vm = require('vm'),"," fs = require('fs'),"," request = require('request'),"," existsSync = fs.existsSync || path.existsSync;","",""," Y.Get = function() {"," };",""," //Setup the default config base path"," Y.config.base = path.join(__dirname, '../');",""," YUI.require = require;"," YUI.process = process;"," "," /**"," * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`"," * @method escapeWinPath"," * @protected"," * @param {String} p The path to modify"," * @return {String} The encoded path"," */"," var escapeWinPath = function(p) {"," return p.replace(/\\\\/g, '\\\\\\\\');"," };",""," /**"," * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded"," * into the YUI object"," * @method _exec"," * @private"," * @param {String} data The JS to execute"," * @param {String} url The path to the file that was parsed"," * @param {Callback} cb The callback to execute when this is completed"," * @param {Error} cb.err=null Error object"," * @param {String} cb.url The URL that was just parsed"," */",""," Y.Get._exec = function(data, url, cb) {"," var dirName = escapeWinPath(path.dirname(url));"," var fileName = escapeWinPath(url);",""," if (dirName.match(/^https?:\\/\\//)) {"," dirName = '.';"," fileName = 'remoteResource';"," }",""," var mod = \"(function(YUI) { var __dirname = '\" + dirName + \"'; \"+"," \"var __filename = '\" + fileName + \"'; \" +"," \"var process = YUI.process;\" +"," \"var require = function(file) {\" +"," \" if (file.indexOf('./') === 0) {\" +"," \" file = __dirname + file.replace('./', '/'); }\" +"," \" return YUI.require(file); }; \" +"," data + \" ;return YUI; })\";"," "," //var mod = \"(function(YUI) { \" + data + \";return YUI; })\";"," var script = vm.createScript(mod, url);"," var fn = script.runInThisContext(mod);"," YUI = fn(YUI);"," cb(null, url);"," };"," "," /**"," * Fetches the content from a remote URL or a file from disc and passes the content"," * off to `_exec` for parsing"," * @method _include"," * @private"," * @param {String} url The URL/File path to fetch the content from"," * @param {Callback} cb The callback to fire once the content has been executed via `_exec`"," */"," Y.Get._include = function(url, cb) {"," var self = this;",""," if (url.match(/^https?:\\/\\//)) {"," var cfg = {"," url: url,"," timeout: self.timeout"," };"," request(cfg, function (err, response, body) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(body, url, cb);"," }"," });"," } else {"," if (Y.config.useSync) {"," //Needs to be in useSync"," if (existsSync(url)) {"," var mod = fs.readFileSync(url,'utf8');"," Y.Get._exec(mod, url, cb);"," } else {"," cb('Path does not exist: ' + url, url);"," }"," } else {"," fs.readFile(url, 'utf8', function(err, mod) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(mod, url, cb);"," }"," });"," }"," }"," "," };","",""," var end = function(cb, msg, result) {"," if (Y.Lang.isFunction(cb.onEnd)) {"," cb.onEnd.call(Y, msg, result);"," }"," }, pass = function(cb) {"," if (Y.Lang.isFunction(cb.onSuccess)) {"," cb.onSuccess.call(Y, cb);"," }"," end(cb, 'success', 'success');"," }, fail = function(cb, er) {"," er.errors = [er];"," if (Y.Lang.isFunction(cb.onFailure)) {"," cb.onFailure.call(Y, er, cb);"," }"," end(cb, er, 'fail');"," };","",""," /**"," * Override for Get.script for loading local or remote YUI modules."," * @method js"," * @param {Array|String} s The URL's to load into this context"," * @param {Object} options Transaction options"," */"," Y.Get.js = function(s, options) {"," var A = Y.Array,"," self = this,"," urls = A(s), url, i, l = urls.length, c= 0,"," check = function() {"," if (c === l) {"," pass(options);"," }"," };","","",""," for (i=0; i<l; i++) {"," url = urls[i];"," if (Y.Lang.isObject(url)) {"," url = url.url;"," }",""," url = url.replace(/'/g, '%27');"," Y.Get._include(url, function(err, url) {"," if (!Y.config) {"," Y.config = {"," debug: true"," };"," }"," if (options.onProgress) {"," options.onProgress.call(options.context || Y, url);"," }"," if (err) {"," fail(options, err);"," } else {"," c++;"," check();"," }"," });"," }"," };"," "," /**"," * Alias for `Y.Get.js`"," * @method script"," */"," Y.Get.script = Y.Get.js;"," "," //Place holder for SS Dom access"," Y.Get.css = function(s, cb) {"," pass(cb);"," };","","","","}, '3.7.3' ,{requires:['yui-base']});"]; _yuitest_coverage["/build/get/get.js"].lines = {"1":0,"9":0,"16":0,"20":0,"22":0,"23":0,"32":0,"33":0,"48":0,"49":0,"50":0,"52":0,"53":0,"54":0,"57":0,"67":0,"68":0,"69":0,"70":0,"81":0,"82":0,"84":0,"85":0,"89":0,"90":0,"91":0,"93":0,"97":0,"99":0,"100":0,"101":0,"103":0,"106":0,"107":0,"108":0,"110":0,"119":0,"120":0,"121":0,"124":0,"125":0,"127":0,"129":0,"130":0,"131":0,"133":0,"143":0,"144":0,"148":0,"149":0,"155":0,"156":0,"157":0,"158":0,"161":0,"162":0,"163":0,"164":0,"168":0,"169":0,"171":0,"172":0,"174":0,"175":0,"185":0,"188":0,"189":0}; _yuitest_coverage["/build/get/get.js"].functions = {"escapeWinPath:32":0,"_exec:48":0,"(anonymous 2):89":0,"(anonymous 3):106":0,"_include:81":0,"end:119":0,"pass:123":0,"fail:128":0,"check:147":0,"(anonymous 4):162":0,"js:143":0,"css:188":0,"(anonymous 1):1":0}; _yuitest_coverage["/build/get/get.js"].coveredLines = 67;@@ -310,4 +310,4 @@ -}, '3.7.2' ,{requires:['yui-base']});+}, '3.7.3' ,{requires:['yui-base']});
bundle/get-nodejs/get-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -207,4 +207,4 @@ -}, '3.7.2' ,{requires:['yui-base']});+}, '3.7.3' ,{requires:['yui-base']});
bundle/get-nodejs/get-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("get",function(a){var j=require("path"),b=require("vm"),f=require("fs"),e=require("request"),g=f.existsSync||j.existsSync;a.Get=function(){};a.config.base=j.join(__dirname,"../");YUI.require=require;YUI.process=process;var i=function(k){return k.replace(/\\/g,"\\\\");};a.Get._exec=function(q,m,k){var p=i(j.dirname(m));var r=i(m);if(p.match(/^https?:\/\//)){p=".";r="remoteResource";}var n="(function(YUI) { var __dirname = '"+p+"'; "+"var __filename = '"+r+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+q+" ;return YUI; })";var l=b.createScript(n,m);var o=l.runInThisContext(n);YUI=o(YUI);k(null,m);};a.Get._include=function(n,k){var m=this;if(n.match(/^https?:\/\//)){var l={url:n,timeout:m.timeout};e(l,function(r,q,p){if(r){k(r,n);}else{a.Get._exec(p,n,k);}});}else{if(a.config.useSync){if(g(n)){var o=f.readFileSync(n,"utf8");a.Get._exec(o,n,k);}else{k("Path does not exist: "+n,n);}}else{f.readFile(n,"utf8",function(q,p){if(q){k(q,n);}else{a.Get._exec(p,n,k);}});}}};var d=function(l,m,k){if(a.Lang.isFunction(l.onEnd)){l.onEnd.call(a,m,k);}},h=function(k){if(a.Lang.isFunction(k.onSuccess)){k.onSuccess.call(a,k);}d(k,"success","success");},c=function(k,l){l.errors=[l];if(a.Lang.isFunction(k.onFailure)){k.onFailure.call(a,l,k);}d(k,l,"fail");};a.Get.js=function(u,v){var n=a.Array,t=this,r=n(u),k,p,o=r.length,q=0,m=function(){if(q===o){h(v);}};for(p=0;p<o;p++){k=r[p];if(a.Lang.isObject(k)){k=k.url;}k=k.replace(/'/g,"%27");a.Get._include(k,function(s,l){if(!a.config){a.config={debug:true};}if(v.onProgress){v.onProgress.call(v.context||a,l);}if(s){c(v,s);}else{q++;m();}});}};a.Get.script=a.Get.js;a.Get.css=function(l,k){h(k);};},"3.7.2",{requires:["yui-base"]});+YUI.add("get",function(a){var j=require("path"),b=require("vm"),f=require("fs"),e=require("request"),g=f.existsSync||j.existsSync;a.Get=function(){};a.config.base=j.join(__dirname,"../");YUI.require=require;YUI.process=process;var i=function(k){return k.replace(/\\/g,"\\\\");};a.Get._exec=function(q,m,k){var p=i(j.dirname(m));var r=i(m);if(p.match(/^https?:\/\//)){p=".";r="remoteResource";}var n="(function(YUI) { var __dirname = '"+p+"'; "+"var __filename = '"+r+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+q+" ;return YUI; })";var l=b.createScript(n,m);var o=l.runInThisContext(n);YUI=o(YUI);k(null,m);};a.Get._include=function(n,k){var m=this;if(n.match(/^https?:\/\//)){var l={url:n,timeout:m.timeout};e(l,function(r,q,p){if(r){k(r,n);}else{a.Get._exec(p,n,k);}});}else{if(a.config.useSync){if(g(n)){var o=f.readFileSync(n,"utf8");a.Get._exec(o,n,k);}else{k("Path does not exist: "+n,n);}}else{f.readFile(n,"utf8",function(q,p){if(q){k(q,n);}else{a.Get._exec(p,n,k);}});}}};var d=function(l,m,k){if(a.Lang.isFunction(l.onEnd)){l.onEnd.call(a,m,k);}},h=function(k){if(a.Lang.isFunction(k.onSuccess)){k.onSuccess.call(a,k);}d(k,"success","success");},c=function(k,l){l.errors=[l];if(a.Lang.isFunction(k.onFailure)){k.onFailure.call(a,l,k);}d(k,l,"fail");};a.Get.js=function(u,v){var n=a.Array,t=this,r=n(u),k,p,o=r.length,q=0,m=function(){if(q===o){h(v);}};for(p=0;p<o;p++){k=r[p];if(a.Lang.isObject(k)){k=k.url;}k=k.replace(/'/g,"%27");a.Get._include(k,function(s,l){if(!a.config){a.config={debug:true};}if(v.onProgress){v.onProgress.call(v.context||a,l);}if(s){c(v,s);}else{q++;m();}});}};a.Get.script=a.Get.js;a.Get.css=function(l,k){h(k);};},"3.7.3",{requires:["yui-base"]});
bundle/get-nodejs/get-nodejs-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/get-nodejs/get-nodejs.js", code: [] };-_yuitest_coverage["build/get-nodejs/get-nodejs.js"].code=["YUI.add('get', function (Y, NAME) {",""," /**"," * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed."," * @module get-nodejs"," * @class GetNodeJS"," */"," "," var path = require('path'),"," vm = require('vm'),"," fs = require('fs'),"," request = require('request'),"," existsSync = fs.existsSync || path.existsSync;","",""," Y.Get = function() {"," };",""," //Setup the default config base path"," Y.config.base = path.join(__dirname, '../');",""," YUI.require = require;"," YUI.process = process;"," "," /**"," * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`"," * @method escapeWinPath"," * @protected"," * @param {String} p The path to modify"," * @return {String} The encoded path"," */"," var escapeWinPath = function(p) {"," return p.replace(/\\\\/g, '\\\\\\\\');"," };",""," /**"," * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded"," * into the YUI object"," * @method _exec"," * @private"," * @param {String} data The JS to execute"," * @param {String} url The path to the file that was parsed"," * @param {Callback} cb The callback to execute when this is completed"," * @param {Error} cb.err=null Error object"," * @param {String} cb.url The URL that was just parsed"," */",""," Y.Get._exec = function(data, url, cb) {"," var dirName = escapeWinPath(path.dirname(url));"," var fileName = escapeWinPath(url);",""," if (dirName.match(/^https?:\\/\\//)) {"," dirName = '.';"," fileName = 'remoteResource';"," }",""," var mod = \"(function(YUI) { var __dirname = '\" + dirName + \"'; \"+"," \"var __filename = '\" + fileName + \"'; \" +"," \"var process = YUI.process;\" +"," \"var require = function(file) {\" +"," \" if (file.indexOf('./') === 0) {\" +"," \" file = __dirname + file.replace('./', '/'); }\" +"," \" return YUI.require(file); }; \" +"," data + \" ;return YUI; })\";"," "," //var mod = \"(function(YUI) { \" + data + \";return YUI; })\";"," var script = vm.createScript(mod, url);"," var fn = script.runInThisContext(mod);"," YUI = fn(YUI);"," cb(null, url);"," };"," "," /**"," * Fetches the content from a remote URL or a file from disc and passes the content"," * off to `_exec` for parsing"," * @method _include"," * @private"," * @param {String} url The URL/File path to fetch the content from"," * @param {Callback} cb The callback to fire once the content has been executed via `_exec`"," */"," Y.Get._include = function(url, cb) {"," var self = this;",""," if (url.match(/^https?:\\/\\//)) {"," var cfg = {"," url: url,"," timeout: self.timeout"," };"," request(cfg, function (err, response, body) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(body, url, cb);"," }"," });"," } else {"," if (Y.config.useSync) {"," //Needs to be in useSync"," if (existsSync(url)) {"," var mod = fs.readFileSync(url,'utf8');"," Y.Get._exec(mod, url, cb);"," } else {"," cb('Path does not exist: ' + url, url);"," }"," } else {"," fs.readFile(url, 'utf8', function(err, mod) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(mod, url, cb);"," }"," });"," }"," }"," "," };","",""," var end = function(cb, msg, result) {"," if (Y.Lang.isFunction(cb.onEnd)) {"," cb.onEnd.call(Y, msg, result);"," }"," }, pass = function(cb) {"," if (Y.Lang.isFunction(cb.onSuccess)) {"," cb.onSuccess.call(Y, cb);"," }"," end(cb, 'success', 'success');"," }, fail = function(cb, er) {"," er.errors = [er];"," if (Y.Lang.isFunction(cb.onFailure)) {"," cb.onFailure.call(Y, er, cb);"," }"," end(cb, er, 'fail');"," };","",""," /**"," * Override for Get.script for loading local or remote YUI modules."," * @method js"," * @param {Array|String} s The URL's to load into this context"," * @param {Object} options Transaction options"," */"," Y.Get.js = function(s, options) {"," var A = Y.Array,"," self = this,"," urls = A(s), url, i, l = urls.length, c= 0,"," check = function() {"," if (c === l) {"," pass(options);"," }"," };","","",""," for (i=0; i<l; i++) {"," url = urls[i];"," if (Y.Lang.isObject(url)) {"," url = url.url;"," }",""," url = url.replace(/'/g, '%27');"," Y.Get._include(url, function(err, url) {"," if (!Y.config) {"," Y.config = {"," debug: true"," };"," }"," if (options.onProgress) {"," options.onProgress.call(options.context || Y, url);"," }"," if (err) {"," fail(options, err);"," } else {"," c++;"," check();"," }"," });"," }"," };"," "," /**"," * Alias for `Y.Get.js`"," * @method script"," */"," Y.Get.script = Y.Get.js;"," "," //Place holder for SS Dom access"," Y.Get.css = function(s, cb) {"," pass(cb);"," };","","","","}, '3.7.2');"];+_yuitest_coverage["build/get-nodejs/get-nodejs.js"].code=["YUI.add('get', function (Y, NAME) {",""," /**"," * NodeJS specific Get module used to load remote resources. It contains the same signature as the default Get module so there is no code change needed."," * @module get-nodejs"," * @class GetNodeJS"," */"," "," var path = require('path'),"," vm = require('vm'),"," fs = require('fs'),"," request = require('request'),"," existsSync = fs.existsSync || path.existsSync;","",""," Y.Get = function() {"," };",""," //Setup the default config base path"," Y.config.base = path.join(__dirname, '../');",""," YUI.require = require;"," YUI.process = process;"," "," /**"," * Escape the path for Windows, they need to be double encoded when used as `__dirname` or `__filename`"," * @method escapeWinPath"," * @protected"," * @param {String} p The path to modify"," * @return {String} The encoded path"," */"," var escapeWinPath = function(p) {"," return p.replace(/\\\\/g, '\\\\\\\\');"," };",""," /**"," * Takes the raw JS files and wraps them to be executed in the YUI context so they can be loaded"," * into the YUI object"," * @method _exec"," * @private"," * @param {String} data The JS to execute"," * @param {String} url The path to the file that was parsed"," * @param {Callback} cb The callback to execute when this is completed"," * @param {Error} cb.err=null Error object"," * @param {String} cb.url The URL that was just parsed"," */",""," Y.Get._exec = function(data, url, cb) {"," var dirName = escapeWinPath(path.dirname(url));"," var fileName = escapeWinPath(url);",""," if (dirName.match(/^https?:\\/\\//)) {"," dirName = '.';"," fileName = 'remoteResource';"," }",""," var mod = \"(function(YUI) { var __dirname = '\" + dirName + \"'; \"+"," \"var __filename = '\" + fileName + \"'; \" +"," \"var process = YUI.process;\" +"," \"var require = function(file) {\" +"," \" if (file.indexOf('./') === 0) {\" +"," \" file = __dirname + file.replace('./', '/'); }\" +"," \" return YUI.require(file); }; \" +"," data + \" ;return YUI; })\";"," "," //var mod = \"(function(YUI) { \" + data + \";return YUI; })\";"," var script = vm.createScript(mod, url);"," var fn = script.runInThisContext(mod);"," YUI = fn(YUI);"," cb(null, url);"," };"," "," /**"," * Fetches the content from a remote URL or a file from disc and passes the content"," * off to `_exec` for parsing"," * @method _include"," * @private"," * @param {String} url The URL/File path to fetch the content from"," * @param {Callback} cb The callback to fire once the content has been executed via `_exec`"," */"," Y.Get._include = function(url, cb) {"," var self = this;",""," if (url.match(/^https?:\\/\\//)) {"," var cfg = {"," url: url,"," timeout: self.timeout"," };"," request(cfg, function (err, response, body) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(body, url, cb);"," }"," });"," } else {"," if (Y.config.useSync) {"," //Needs to be in useSync"," if (existsSync(url)) {"," var mod = fs.readFileSync(url,'utf8');"," Y.Get._exec(mod, url, cb);"," } else {"," cb('Path does not exist: ' + url, url);"," }"," } else {"," fs.readFile(url, 'utf8', function(err, mod) {"," if (err) {"," cb(err, url);"," } else {"," Y.Get._exec(mod, url, cb);"," }"," });"," }"," }"," "," };","",""," var end = function(cb, msg, result) {"," if (Y.Lang.isFunction(cb.onEnd)) {"," cb.onEnd.call(Y, msg, result);"," }"," }, pass = function(cb) {"," if (Y.Lang.isFunction(cb.onSuccess)) {"," cb.onSuccess.call(Y, cb);"," }"," end(cb, 'success', 'success');"," }, fail = function(cb, er) {"," er.errors = [er];"," if (Y.Lang.isFunction(cb.onFailure)) {"," cb.onFailure.call(Y, er, cb);"," }"," end(cb, er, 'fail');"," };","",""," /**"," * Override for Get.script for loading local or remote YUI modules."," * @method js"," * @param {Array|String} s The URL's to load into this context"," * @param {Object} options Transaction options"," */"," Y.Get.js = function(s, options) {"," var A = Y.Array,"," self = this,"," urls = A(s), url, i, l = urls.length, c= 0,"," check = function() {"," if (c === l) {"," pass(options);"," }"," };","","",""," for (i=0; i<l; i++) {"," url = urls[i];"," if (Y.Lang.isObject(url)) {"," url = url.url;"," }",""," url = url.replace(/'/g, '%27');"," Y.Get._include(url, function(err, url) {"," if (!Y.config) {"," Y.config = {"," debug: true"," };"," }"," if (options.onProgress) {"," options.onProgress.call(options.context || Y, url);"," }"," if (err) {"," fail(options, err);"," } else {"," c++;"," check();"," }"," });"," }"," };"," "," /**"," * Alias for `Y.Get.js`"," * @method script"," */"," Y.Get.script = Y.Get.js;"," "," //Place holder for SS Dom access"," Y.Get.css = function(s, cb) {"," pass(cb);"," };","","","","}, '3.7.3');"]; _yuitest_coverage["build/get-nodejs/get-nodejs.js"].lines = {"1":0,"9":0,"16":0,"20":0,"22":0,"23":0,"32":0,"33":0,"48":0,"49":0,"50":0,"52":0,"53":0,"54":0,"57":0,"67":0,"68":0,"69":0,"70":0,"81":0,"82":0,"84":0,"85":0,"89":0,"90":0,"91":0,"93":0,"97":0,"99":0,"100":0,"101":0,"103":0,"106":0,"107":0,"108":0,"110":0,"119":0,"120":0,"121":0,"124":0,"125":0,"127":0,"129":0,"130":0,"131":0,"133":0,"143":0,"144":0,"148":0,"149":0,"155":0,"156":0,"157":0,"158":0,"161":0,"162":0,"163":0,"164":0,"168":0,"169":0,"171":0,"172":0,"174":0,"175":0,"185":0,"188":0,"189":0}; _yuitest_coverage["build/get-nodejs/get-nodejs.js"].functions = {"escapeWinPath:32":0,"_exec:48":0,"(anonymous 2):89":0,"(anonymous 3):106":0,"_include:81":0,"end:119":0,"pass:123":0,"fail:128":0,"check:147":0,"(anonymous 4):162":0,"js:143":0,"css:188":0,"(anonymous 1):1":0}; _yuitest_coverage["build/get-nodejs/get-nodejs.js"].coveredLines = 67;@@ -310,4 +310,4 @@ -}, '3.7.2');+}, '3.7.3');
bundle/get-nodejs/get-nodejs-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -207,4 +207,4 @@ -}, '3.7.2');+}, '3.7.3');
bundle/get-nodejs/get-nodejs-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("get",function(e,t){var n=require("path"),r=require("vm"),i=require("fs"),s=require("request"),o=i.existsSync||n.existsSync;e.Get=function(){},e.config.base=n.join(__dirname,"../"),YUI.require=require,YUI.process=process;var u=function(e){return e.replace(/\\/g,"\\\\")};e.Get._exec=function(e,t,i){var s=u(n.dirname(t)),o=u(t);s.match(/^https?:\/\//)&&(s=".",o="remoteResource");var a="(function(YUI) { var __dirname = '"+s+"'; "+"var __filename = '"+o+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+e+" ;return YUI; })",f=r.createScript(a,t),l=f.runInThisContext(a);YUI=l(YUI),i(null,t)},e.Get._include=function(t,n){var r=this;if(t.match(/^https?:\/\//)){var u={url:t,timeout:r.timeout};s(u,function(r,i,s){r?n(r,t):e.Get._exec(s,t,n)})}else if(e.config.useSync)if(o(t)){var a=i.readFileSync(t,"utf8");e.Get._exec(a,t,n)}else n("Path does not exist: "+t,t);else i.readFile(t,"utf8",function(r,i){r?n(r,t):e.Get._exec(i,t,n)})};var a=function(t,n,r){e.Lang.isFunction(t.onEnd)&&t.onEnd.call(e,n,r)},f=function(t){e.Lang.isFunction(t.onSuccess)&&t.onSuccess.call(e,t),a(t,"success","success")},l=function(t,n){n.errors=[n],e.Lang.isFunction(t.onFailure)&&t.onFailure.call(e,n,t),a(t,n,"fail")};e.Get.js=function(t,n){var r=e.Array,i=this,s=r(t),o,u,a=s.length,c=0,h=function(){c===a&&f(n)};for(u=0;u<a;u++)o=s[u],e.Lang.isObject(o)&&(o=o.url),o=o.replace(/'/g,"%27"),e.Get._include(o,function(t,r){e.config||(e.config={debug:!0}),n.onProgress&&n.onProgress.call(n.context||e,r),t?l(n,t):(c++,h())})},e.Get.script=e.Get.js,e.Get.css=function(e,t){f(t)}},"3.7.2");+YUI.add("get",function(e,t){var n=require("path"),r=require("vm"),i=require("fs"),s=require("request"),o=i.existsSync||n.existsSync;e.Get=function(){},e.config.base=n.join(__dirname,"../"),YUI.require=require,YUI.process=process;var u=function(e){return e.replace(/\\/g,"\\\\")};e.Get._exec=function(e,t,i){var s=u(n.dirname(t)),o=u(t);s.match(/^https?:\/\//)&&(s=".",o="remoteResource");var a="(function(YUI) { var __dirname = '"+s+"'; "+"var __filename = '"+o+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+e+" ;return YUI; })",f=r.createScript(a,t),l=f.runInThisContext(a);YUI=l(YUI),i(null,t)},e.Get._include=function(t,n){var r=this;if(t.match(/^https?:\/\//)){var u={url:t,timeout:r.timeout};s(u,function(r,i,s){r?n(r,t):e.Get._exec(s,t,n)})}else if(e.config.useSync)if(o(t)){var a=i.readFileSync(t,"utf8");e.Get._exec(a,t,n)}else n("Path does not exist: "+t,t);else i.readFile(t,"utf8",function(r,i){r?n(r,t):e.Get._exec(i,t,n)})};var a=function(t,n,r){e.Lang.isFunction(t.onEnd)&&t.onEnd.call(e,n,r)},f=function(t){e.Lang.isFunction(t.onSuccess)&&t.onSuccess.call(e,t),a(t,"success","success")},l=function(t,n){n.errors=[n],e.Lang.isFunction(t.onFailure)&&t.onFailure.call(e,n,t),a(t,n,"fail")};e.Get.js=function(t,n){var r=e.Array,i=this,s=r(t),o,u,a=s.length,c=0,h=function(){c===a&&f(n)};for(u=0;u<a;u++)o=s[u],e.Lang.isObject(o)&&(o=o.url),o=o.replace(/'/g,"%27"),e.Get._include(o,function(t,r){e.config||(e.config={debug:!0}),n.onProgress&&n.onProgress.call(n.context||e,r),t?l(n,t):(c++,h())})},e.Get.script=e.Get.js,e.Get.css=function(e,t){f(t)}},"3.7.3");
bundle/get-nodejs/get-nodejs.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -197,4 +197,4 @@ -}, '3.7.2');+}, '3.7.3');
bundle/get-nodejs/get.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -197,4 +197,4 @@ -}, '3.7.2' ,{requires:['yui-base']});+}, '3.7.3' ,{requires:['yui-base']});
bundle/get/get-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/get/get.js", code: [] };-_yuitest_coverage["build/get/get.js"].code=["YUI.add('get', function (Y, NAME) {","","/*jslint boss:true, expr:true, laxbreak: true */","","/**","Provides dynamic loading of remote JavaScript and CSS resources.","","@module get","@class Get","@static","**/","","var Lang = Y.Lang,",""," CUSTOM_ATTRS, // defined lazily in Y.Get.Transaction._createNode()",""," Get, Transaction;","","Y.Get = Get = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Default options for CSS requests. Options specified here will override"," global defaults for CSS requests.",""," See the `options` property for all available options.",""," @property cssOptions"," @type Object"," @static"," @since 3.5.0"," **/"," cssOptions: {"," attributes: {"," rel: 'stylesheet'"," },",""," doc : Y.config.linkDoc || Y.config.doc,"," pollInterval: 50"," },",""," /**"," Default options for JS requests. Options specified here will override global"," defaults for JS requests.",""," See the `options` property for all available options.",""," @property jsOptions"," @type Object"," @static"," @since 3.5.0"," **/"," jsOptions: {"," autopurge: true,"," doc : Y.config.scriptDoc || Y.config.doc"," },",""," /**"," Default options to use for all requests.",""," Note that while all available options are documented here for ease of"," discovery, some options (like callback functions) only make sense at the"," transaction level.",""," Callback functions specified via the options object or the `options`"," parameter of the `css()`, `js()`, or `load()` methods will receive the"," transaction object as a parameter. See `Y.Get.Transaction` for details on"," the properties and methods available on transactions.",""," @static"," @since 3.5.0"," @property {Object} options",""," @property {Boolean} [options.async=false] Whether or not to load scripts"," asynchronously, meaning they're requested in parallel and execution"," order is not guaranteed. Has no effect on CSS, since CSS is always"," loaded asynchronously.",""," @property {Object} [options.attributes] HTML attribute name/value pairs that"," should be added to inserted nodes. By default, the `charset` attribute"," will be set to \"utf-8\" and nodes will be given an auto-generated `id`"," attribute, but you can override these with your own values if desired.",""," @property {Boolean} [options.autopurge] Whether or not to automatically"," purge inserted nodes after the purge threshold is reached. This is"," `true` by default for JavaScript, but `false` for CSS since purging a"," CSS node will also remove any styling applied by the referenced file.",""," @property {Object} [options.context] `this` object to use when calling"," callback functions. Defaults to the transaction object.",""," @property {Mixed} [options.data] Arbitrary data object to pass to \"on*\""," callbacks.",""," @property {Document} [options.doc] Document into which nodes should be"," inserted. By default, the current document is used.",""," @property {HTMLElement|String} [options.insertBefore] HTML element or id"," string of an element before which all generated nodes should be"," inserted. If not specified, Get will automatically determine the best"," place to insert nodes for maximum compatibility.",""," @property {Function} [options.onEnd] Callback to execute after a transaction"," is complete, regardless of whether it succeeded or failed.",""," @property {Function} [options.onFailure] Callback to execute after a"," transaction fails, times out, or is aborted.",""," @property {Function} [options.onProgress] Callback to execute after each"," individual request in a transaction either succeeds or fails.",""," @property {Function} [options.onSuccess] Callback to execute after a"," transaction completes successfully with no errors. Note that in browsers"," that don't support the `error` event on CSS `<link>` nodes, a failed CSS"," request may still be reported as a success because in these browsers"," it can be difficult or impossible to distinguish between success and"," failure for CSS resources.",""," @property {Function} [options.onTimeout] Callback to execute after a"," transaction times out.",""," @property {Number} [options.pollInterval=50] Polling interval (in"," milliseconds) for detecting CSS load completion in browsers that don't"," support the `load` event on `<link>` nodes. This isn't used for"," JavaScript.",""," @property {Number} [options.purgethreshold=20] Number of nodes to insert"," before triggering an automatic purge when `autopurge` is `true`.",""," @property {Number} [options.timeout] Number of milliseconds to wait before"," aborting a transaction. When a timeout occurs, the `onTimeout` callback"," is called, followed by `onFailure` and finally `onEnd`. By default,"," there is no timeout.",""," @property {String} [options.type] Resource type (\"css\" or \"js\"). This option"," is set automatically by the `css()` and `js()` functions and will be"," ignored there, but may be useful when using the `load()` function. If"," not specified, the type will be inferred from the URL, defaulting to"," \"js\" if the URL doesn't contain a recognizable file extension."," **/"," options: {"," attributes: {"," charset: 'utf-8'"," },",""," purgethreshold: 20"," },",""," // -- Protected Properties -------------------------------------------------",""," /**"," Regex that matches a CSS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_CSS"," @type RegExp"," @final"," @protected"," @static"," @since 3.5.0"," **/"," REGEX_CSS: /\\.css(?:[?;].*)?$/i,",""," /**"," Regex that matches a JS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_JS"," @type RegExp"," @final"," @protected"," @static"," @since 3.5.0"," **/"," REGEX_JS : /\\.js(?:[?;].*)?$/i,",""," /**"," Contains information about the current environment, such as what script and"," link injection features it supports.",""," This object is created and populated the first time the `_getEnv()` method"," is called.",""," @property _env"," @type Object"," @protected"," @static"," @since 3.5.0"," **/",""," /**"," Mapping of document _yuid strings to <head> or <base> node references so we"," don't have to look the node up each time we want to insert a request node.",""," @property _insertCache"," @type Object"," @protected"," @static"," @since 3.5.0"," **/"," _insertCache: {},",""," /**"," Information about the currently pending transaction, if any.",""," This is actually an object with two properties: `callback`, containing the"," optional callback passed to `css()`, `load()`, or `js()`; and `transaction`,"," containing the actual transaction instance.",""," @property _pending"," @type Object"," @protected"," @static"," @since 3.5.0"," **/"," _pending: null,",""," /**"," HTML nodes eligible to be purged next time autopurge is triggered.",""," @property _purgeNodes"," @type HTMLElement[]"," @protected"," @static"," @since 3.5.0"," **/"," _purgeNodes: [],",""," /**"," Queued transactions and associated callbacks.",""," @property _queue"," @type Object[]"," @protected"," @static"," @since 3.5.0"," **/"," _queue: [],",""," // -- Public Methods -------------------------------------------------------",""," /**"," Aborts the specified transaction.",""," This will cause the transaction's `onFailure` callback to be called and"," will prevent any new script and link nodes from being added to the document,"," but any resources that have already been requested will continue loading"," (there's no safe way to prevent this, unfortunately).",""," *Note:* This method is deprecated as of 3.5.0, and will be removed in a"," future version of YUI. Use the transaction-level `abort()` method instead.",""," @method abort"," @param {Get.Transaction} transaction Transaction to abort."," @deprecated Use the `abort()` method on the transaction instead."," @static"," **/"," abort: function (transaction) {"," var i, id, item, len, pending;","",""," if (!transaction.abort) {"," id = transaction;"," pending = this._pending;"," transaction = null;",""," if (pending && pending.transaction.id === id) {"," transaction = pending.transaction;"," this._pending = null;"," } else {"," for (i = 0, len = this._queue.length; i < len; ++i) {"," item = this._queue[i].transaction;",""," if (item.id === id) {"," transaction = item;"," this._queue.splice(i, 1);"," break;"," }"," }"," }"," }",""," transaction && transaction.abort();"," },",""," /**"," Loads one or more CSS files.",""," The _urls_ parameter may be provided as a URL string, a request object,"," or an array of URL strings and/or request objects.",""," A request object is just an object that contains a `url` property and zero"," or more options that should apply specifically to that request."," Request-specific options take priority over transaction-level options and"," default options.",""," URLs may be relative or absolute, and do not have to have the same origin"," as the current page.",""," The `options` parameter may be omitted completely and a callback passed in"," its place, if desired.",""," @example",""," // Load a single CSS file and log a message on completion."," Y.Get.css('foo.css', function (err) {"," if (err) {"," } else {"," }"," });",""," // Load multiple CSS files and log a message when all have finished"," // loading."," var urls = ['foo.css', 'http://example.com/bar.css', 'baz/quux.css'];",""," Y.Get.css(urls, function (err) {"," if (err) {"," } else {"," }"," });",""," // Specify transaction-level options, which will apply to all requests"," // within the transaction."," Y.Get.css(urls, {"," attributes: {'class': 'my-css'},"," timeout : 5000"," });",""," // Specify per-request options, which override transaction-level and"," // default options."," Y.Get.css(["," {url: 'foo.css', attributes: {id: 'foo'}},"," {url: 'bar.css', attributes: {id: 'bar', charset: 'iso-8859-1'}}"," ]);",""," @method css"," @param {String|Object|Array} urls URL string, request object, or array"," of URLs and/or request objects to load."," @param {Object} [options] Options for this transaction. See the"," `Y.Get.options` property for a complete list of available options."," @param {Function} [callback] Callback function to be called on completion."," This is a general callback and will be called before any more granular"," callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`"," object.",""," @param {Array|null} callback.err Array of errors that occurred during"," the transaction, or `null` on success."," @param {Get.Transaction} callback.transaction Transaction object.",""," @return {Get.Transaction} Transaction object."," @static"," **/"," css: function (urls, options, callback) {"," return this._load('css', urls, options, callback);"," },",""," /**"," Loads one or more JavaScript resources.",""," The _urls_ parameter may be provided as a URL string, a request object,"," or an array of URL strings and/or request objects.",""," A request object is just an object that contains a `url` property and zero"," or more options that should apply specifically to that request."," Request-specific options take priority over transaction-level options and"," default options.",""," URLs may be relative or absolute, and do not have to have the same origin"," as the current page.",""," The `options` parameter may be omitted completely and a callback passed in"," its place, if desired.",""," Scripts will be executed in the order they're specified unless the `async`"," option is `true`, in which case they'll be loaded in parallel and executed"," in whatever order they finish loading.",""," @example",""," // Load a single JS file and log a message on completion."," Y.Get.js('foo.js', function (err) {"," if (err) {"," } else {"," }"," });",""," // Load multiple JS files, execute them in order, and log a message when"," // all have finished loading."," var urls = ['foo.js', 'http://example.com/bar.js', 'baz/quux.js'];",""," Y.Get.js(urls, function (err) {"," if (err) {"," } else {"," }"," });",""," // Specify transaction-level options, which will apply to all requests"," // within the transaction."," Y.Get.js(urls, {"," attributes: {'class': 'my-js'},"," timeout : 5000"," });",""," // Specify per-request options, which override transaction-level and"," // default options."," Y.Get.js(["," {url: 'foo.js', attributes: {id: 'foo'}},"," {url: 'bar.js', attributes: {id: 'bar', charset: 'iso-8859-1'}}"," ]);",""," @method js"," @param {String|Object|Array} urls URL string, request object, or array"," of URLs and/or request objects to load."," @param {Object} [options] Options for this transaction. See the"," `Y.Get.options` property for a complete list of available options."," @param {Function} [callback] Callback function to be called on completion."," This is a general callback and will be called before any more granular"," callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`"," object.",""," @param {Array|null} callback.err Array of errors that occurred during"," the transaction, or `null` on success."," @param {Get.Transaction} callback.transaction Transaction object.",""," @return {Get.Transaction} Transaction object."," @since 3.5.0"," @static"," **/"," js: function (urls, options, callback) {"," return this._load('js', urls, options, callback);"," },",""," /**"," Loads one or more CSS and/or JavaScript resources in the same transaction.",""," Use this method when you want to load both CSS and JavaScript in a single"," transaction and be notified when all requested URLs have finished loading,"," regardless of type.",""," Behavior and options are the same as for the `css()` and `js()` methods. If"," a resource type isn't specified in per-request options or transaction-level"," options, Get will guess the file type based on the URL's extension (`.css`"," or `.js`, with or without a following query string). If the file type can't"," be guessed from the URL, a warning will be logged and Get will assume the"," URL is a JavaScript resource.",""," @example",""," // Load both CSS and JS files in a single transaction, and log a message"," // when all files have finished loading."," Y.Get.load(['foo.css', 'bar.js', 'baz.css'], function (err) {"," if (err) {"," } else {"," }"," });",""," @method load"," @param {String|Object|Array} urls URL string, request object, or array"," of URLs and/or request objects to load."," @param {Object} [options] Options for this transaction. See the"," `Y.Get.options` property for a complete list of available options."," @param {Function} [callback] Callback function to be called on completion."," This is a general callback and will be called before any more granular"," callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`"," object.",""," @param {Array|null} err Array of errors that occurred during the"," transaction, or `null` on success."," @param {Get.Transaction} Transaction object.",""," @return {Get.Transaction} Transaction object."," @since 3.5.0"," @static"," **/"," load: function (urls, options, callback) {"," return this._load(null, urls, options, callback);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Triggers an automatic purge if the purge threshold has been reached.",""," @method _autoPurge"," @param {Number} threshold Purge threshold to use, in milliseconds."," @protected"," @since 3.5.0"," @static"," **/"," _autoPurge: function (threshold) {"," if (threshold && this._purgeNodes.length >= threshold) {"," this._purge(this._purgeNodes);"," }"," },",""," /**"," Populates the `_env` property with information about the current"," environment.",""," @method _getEnv"," @return {Object} Environment information."," @protected"," @since 3.5.0"," @static"," **/"," _getEnv: function () {"," var doc = Y.config.doc,"," ua = Y.UA;",""," // Note: some of these checks require browser sniffs since it's not"," // feasible to load test files on every pageview just to perform a"," // feature test. I'm sorry if this makes you sad."," return (this._env = {"," // True if this is a browser that supports disabling async mode on"," // dynamically created script nodes. See"," // https://developer.mozilla.org/En/HTML/Element/Script#Attributes"," async: doc && doc.createElement('script').async === true,",""," // True if this browser fires an event when a dynamically injected"," // link node fails to load. This is currently true for Firefox 9+"," // and WebKit 535.24+."," cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0,",""," // True if this browser fires an event when a dynamically injected"," // link node finishes loading. This is currently true for IE, Opera,"," // Firefox 9+, and WebKit 535.24+. Note that IE versions <9 fire the"," // DOM 0 \"onload\" event, but not \"load\". All versions of IE fire"," // \"onload\"."," // davglass: Seems that Chrome on Android needs this to be false."," cssLoad: ("," (!ua.gecko && !ua.webkit) || ua.gecko >= 9 ||"," ua.compareVersions(ua.webkit, 535.24) >= 0"," ) && !(ua.chrome && ua.chrome <= 18),",""," // True if this browser preserves script execution order while"," // loading scripts in parallel as long as the script node's `async`"," // attribute is set to false to explicitly disable async execution."," preservesScriptOrder: !!(ua.gecko || ua.opera)"," });"," },",""," _getTransaction: function (urls, options) {"," var requests = [],"," i, len, req, url;",""," if (!Lang.isArray(urls)) {"," urls = [urls];"," }",""," options = Y.merge(this.options, options);",""," // Clone the attributes object so we don't end up modifying it by ref."," options.attributes = Y.merge(this.options.attributes,"," options.attributes);",""," for (i = 0, len = urls.length; i < len; ++i) {"," url = urls[i];"," req = {attributes: {}};",""," // If `url` is a string, we create a URL object for it, then mix in"," // global options and request-specific options. If it's an object"," // with a \"url\" property, we assume it's a request object containing"," // URL-specific options."," if (typeof url === 'string') {"," req.url = url;"," } else if (url.url) {"," // URL-specific options override both global defaults and"," // request-specific options."," Y.mix(req, url, false, null, 0, true);"," url = url.url; // Make url a string so we can use it later."," } else {"," continue;"," }",""," Y.mix(req, options, false, null, 0, true);",""," // If we didn't get an explicit type for this URL either in the"," // request options or the URL-specific options, try to determine"," // one from the file extension."," if (!req.type) {"," if (this.REGEX_CSS.test(url)) {"," req.type = 'css';"," } else {"," if (!this.REGEX_JS.test(url)) {"," }",""," req.type = 'js';"," }"," }",""," // Mix in type-specific default options, but don't overwrite any"," // options that have already been set."," Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions,"," false, null, 0, true);",""," // Give the node an id attribute if it doesn't already have one."," req.attributes.id || (req.attributes.id = Y.guid());",""," // Backcompat for <3.5.0 behavior."," if (req.win) {"," req.doc = req.win.document;"," } else {"," req.win = req.doc.defaultView || req.doc.parentWindow;"," }",""," if (req.charset) {"," req.attributes.charset = req.charset;"," }",""," requests.push(req);"," }",""," return new Transaction(requests, options);"," },",""," _load: function (type, urls, options, callback) {"," var transaction;",""," // Allow callback as third param."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});"," options.type = type;",""," if (!this._env) {"," this._getEnv();"," }",""," transaction = this._getTransaction(urls, options);",""," this._queue.push({"," callback : callback,"," transaction: transaction"," });",""," this._next();",""," return transaction;"," },",""," _next: function () {"," var item;",""," if (this._pending) {"," return;"," }",""," item = this._queue.shift();",""," if (item) {"," this._pending = item;",""," item.transaction.execute(function () {"," item.callback && item.callback.apply(this, arguments);",""," Get._pending = null;"," Get._next();"," });"," }"," },",""," _purge: function (nodes) {"," var purgeNodes = this._purgeNodes,"," isTransaction = nodes !== purgeNodes,"," index, node;",""," while (node = nodes.pop()) { // assignment"," // Don't purge nodes that haven't finished loading (or errored out),"," // since this can hang the transaction."," if (!node._yuiget_finished) {"," continue;"," }",""," node.parentNode && node.parentNode.removeChild(node);",""," // If this is a transaction-level purge and this node also exists in"," // the Get-level _purgeNodes array, we need to remove it from"," // _purgeNodes to avoid creating a memory leak. The indexOf lookup"," // sucks, but until we get WeakMaps, this is the least troublesome"," // way to do this (we can't just hold onto node ids because they may"," // not be in the same document)."," if (isTransaction) {"," index = Y.Array.indexOf(purgeNodes, node);",""," if (index > -1) {"," purgeNodes.splice(index, 1);"," }"," }"," }"," }","};","","/**","Alias for `js()`.","","@method script","@static","**/","Get.script = Get.js;","","/**","Represents a Get transaction, which may contain requests for one or more JS or","CSS files.","","This class should not be instantiated manually. Instances will be created and","returned as needed by Y.Get's `css()`, `js()`, and `load()` methods.","","@class Get.Transaction","@constructor","@since 3.5.0","**/","Get.Transaction = Transaction = function (requests, options) {"," var self = this;",""," self.id = Transaction._lastId += 1;"," self.data = options.data;"," self.errors = [];"," self.nodes = [];"," self.options = options;"," self.requests = requests;",""," self._callbacks = []; // callbacks to call after execution finishes"," self._queue = [];"," self._waiting = 0;",""," // Deprecated pre-3.5.0 properties."," self.tId = self.id; // Use `id` instead."," self.win = options.win || Y.config.win;","};","","/**","Arbitrary data object associated with this transaction.","","This object comes from the options passed to `Get.css()`, `Get.js()`, or","`Get.load()`, and will be `undefined` if no data object was specified.","","@property {Object} data","**/","","/**","Array of errors that have occurred during this transaction, if any.","","@since 3.5.0","@property {Object[]} errors","@property {String} errors.error Error message.","@property {Object} errors.request Request object related to the error.","**/","","/**","Numeric id for this transaction, unique among all transactions within the same","YUI sandbox in the current pageview.","","@property {Number} id","@since 3.5.0","**/","","/**","HTMLElement nodes (native ones, not YUI Node instances) that have been inserted","during the current transaction.","","@property {HTMLElement[]} nodes","**/","","/**","Options associated with this transaction.","","See `Get.options` for the full list of available options.","","@property {Object} options","@since 3.5.0","**/","","/**","Request objects contained in this transaction. Each request object represents","one CSS or JS URL that will be (or has been) requested and loaded into the page.","","@property {Object} requests","@since 3.5.0","**/","","/**","Id of the most recent transaction.","","@property _lastId","@type Number","@protected","@static","**/","Transaction._lastId = 0;","","Transaction.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Current state of this transaction. One of \"new\", \"executing\", or \"done\".",""," @property _state"," @type String"," @protected"," **/"," _state: 'new', // \"new\", \"executing\", or \"done\"",""," // -- Public Methods -------------------------------------------------------",""," /**"," Aborts this transaction.",""," This will cause the transaction's `onFailure` callback to be called and"," will prevent any new script and link nodes from being added to the document,"," but any resources that have already been requested will continue loading"," (there's no safe way to prevent this, unfortunately).",""," @method abort"," @param {String} [msg=\"Aborted.\"] Optional message to use in the `errors`"," array describing why the transaction was aborted."," **/"," abort: function (msg) {"," this._pending = null;"," this._pendingCSS = null;"," this._pollTimer = clearTimeout(this._pollTimer);"," this._queue = [];"," this._waiting = 0;",""," this.errors.push({error: msg || 'Aborted'});"," this._finish();"," },",""," /**"," Begins execting the transaction.",""," There's usually no reason to call this manually, since Get will call it"," automatically when other pending transactions have finished. If you really"," want to execute your transaction before Get does, you can, but be aware that"," this transaction's scripts may end up executing before the scripts in other"," pending transactions.",""," If the transaction is already executing, the specified callback (if any)"," will be queued and called after execution finishes. If the transaction has"," already finished, the callback will be called immediately (the transaction"," will not be executed again).",""," @method execute"," @param {Function} callback Callback function to execute after all requests"," in the transaction are complete, or after the transaction is aborted."," **/"," execute: function (callback) {"," var self = this,"," requests = self.requests,"," state = self._state,"," i, len, queue, req;",""," if (state === 'done') {"," callback && callback(self.errors.length ? self.errors : null, self);"," return;"," } else {"," callback && self._callbacks.push(callback);",""," if (state === 'executing') {"," return;"," }"," }",""," self._state = 'executing';"," self._queue = queue = [];",""," if (self.options.timeout) {"," self._timeout = setTimeout(function () {"," self.abort('Timeout');"," }, self.options.timeout);"," }",""," for (i = 0, len = requests.length; i < len; ++i) {"," req = self.requests[i];",""," if (req.async || req.type === 'css') {"," // No need to queue CSS or fully async JS."," self._insert(req);"," } else {"," queue.push(req);"," }"," }",""," self._next();"," },",""," /**"," Manually purges any `<script>` or `<link>` nodes this transaction has"," created.",""," Be careful when purging a transaction that contains CSS requests, since"," removing `<link>` nodes will also remove any styles they applied.",""," @method purge"," **/"," purge: function () {"," Get._purge(this.nodes);"," },",""," // -- Protected Methods ----------------------------------------------------"," _createNode: function (name, attrs, doc) {"," var node = doc.createElement(name),"," attr, testEl;",""," if (!CUSTOM_ATTRS) {"," // IE6 and IE7 expect property names rather than attribute names for"," // certain attributes. Rather than sniffing, we do a quick feature"," // test the first time _createNode() runs to determine whether we"," // need to provide a workaround."," testEl = doc.createElement('div');"," testEl.setAttribute('class', 'a');",""," CUSTOM_ATTRS = testEl.className === 'a' ? {} : {"," 'for' : 'htmlFor',"," 'class': 'className'"," };"," }",""," for (attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {"," node.setAttribute(CUSTOM_ATTRS[attr] || attr, attrs[attr]);"," }"," }",""," return node;"," },",""," _finish: function () {"," var errors = this.errors.length ? this.errors : null,"," options = this.options,"," thisObj = options.context || this,"," data, i, len;",""," if (this._state === 'done') {"," return;"," }",""," this._state = 'done';",""," for (i = 0, len = this._callbacks.length; i < len; ++i) {"," this._callbacks[i].call(thisObj, errors, this);"," }",""," data = this._getEventData();",""," if (errors) {"," if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') {"," options.onTimeout.call(thisObj, data);"," }",""," if (options.onFailure) {"," options.onFailure.call(thisObj, data);"," }"," } else if (options.onSuccess) {"," options.onSuccess.call(thisObj, data);"," }",""," if (options.onEnd) {"," options.onEnd.call(thisObj, data);"," }"," },",""," _getEventData: function (req) {"," if (req) {"," // This merge is necessary for backcompat. I hate it."," return Y.merge(this, {"," abort : this.abort, // have to copy these because the prototype isn't preserved"," purge : this.purge,"," request: req,"," url : req.url,"," win : req.win"," });"," } else {"," return this;"," }"," },",""," _getInsertBefore: function (req) {"," var doc = req.doc,"," el = req.insertBefore,"," cache, cachedNode, docStamp;",""," if (el) {"," return typeof el === 'string' ? doc.getElementById(el) : el;"," }",""," cache = Get._insertCache;"," docStamp = Y.stamp(doc);",""," if ((el = cache[docStamp])) { // assignment"," return el;"," }",""," // Inserting before a <base> tag apparently works around an IE bug"," // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what"," // bug that is, exactly. Better safe than sorry?"," if ((el = doc.getElementsByTagName('base')[0])) { // assignment"," return (cache[docStamp] = el);"," }",""," // Look for a <head> element."," el = doc.head || doc.getElementsByTagName('head')[0];",""," if (el) {"," // Create a marker node at the end of <head> to use as an insertion"," // point. Inserting before this node will ensure that all our CSS"," // gets inserted in the correct order, to maintain style precedence."," el.appendChild(doc.createTextNode(''));"," return (cache[docStamp] = el.lastChild);"," }",""," // If all else fails, just insert before the first script node on the"," // page, which is virtually guaranteed to exist."," return (cache[docStamp] = doc.getElementsByTagName('script')[0]);"," },",""," _insert: function (req) {"," var env = Get._env,"," insertBefore = this._getInsertBefore(req),"," isScript = req.type === 'js',"," node = req.node,"," self = this,"," ua = Y.UA,"," cssTimeout, nodeType;",""," if (!node) {"," if (isScript) {"," nodeType = 'script';"," } else if (!env.cssLoad && ua.gecko) {"," nodeType = 'style';"," } else {"," nodeType = 'link';"," }",""," node = req.node = this._createNode(nodeType, req.attributes,"," req.doc);"," }",""," function onError() {"," self._progress('Failed to load ' + req.url, req);"," }",""," function onLoad() {"," if (cssTimeout) {"," clearTimeout(cssTimeout);"," }",""," self._progress(null, req);"," }","",""," // Deal with script asynchronicity."," if (isScript) {"," node.setAttribute('src', req.url);",""," if (req.async) {"," // Explicitly indicate that we want the browser to execute this"," // script asynchronously. This is necessary for older browsers"," // like Firefox <4."," node.async = true;"," } else {"," if (env.async) {"," // This browser treats injected scripts as async by default"," // (standard HTML5 behavior) but asynchronous loading isn't"," // desired, so tell the browser not to mark this script as"," // async."," node.async = false;"," }",""," // If this browser doesn't preserve script execution order based"," // on insertion order, we'll need to avoid inserting other"," // scripts until this one finishes loading."," if (!env.preservesScriptOrder) {"," this._pending = req;"," }"," }"," } else {"," if (!env.cssLoad && ua.gecko) {"," // In Firefox <9, we can import the requested URL into a <style>"," // node and poll for the existence of node.sheet.cssRules. This"," // gives us a reliable way to determine CSS load completion that"," // also works for cross-domain stylesheets."," //"," // Props to Zach Leatherman for calling my attention to this"," // technique."," node.innerHTML = (req.attributes.charset ?"," '@charset \"' + req.attributes.charset + '\";' : '') +"," '@import \"' + req.url + '\";';"," } else {"," node.setAttribute('href', req.url);"," }"," }",""," // Inject the node."," if (isScript && ua.ie && (ua.ie < 9 || (document.documentMode && document.documentMode < 9))) {"," // Script on IE < 9, and IE 9+ when in IE 8 or older modes, including quirks mode."," node.onreadystatechange = function () {"," if (/loaded|complete/.test(node.readyState)) {"," node.onreadystatechange = null;"," onLoad();"," }"," };"," } else if (!isScript && !env.cssLoad) {"," // CSS on Firefox <9 or WebKit."," this._poll(req);"," } else {"," // Script or CSS on everything else. Using DOM 0 events because that"," // evens the playing field with older IEs."," node.onerror = onError;"," node.onload = onLoad;",""," // If this browser doesn't fire an event when CSS fails to load,"," // fail after a timeout to avoid blocking the transaction queue."," if (!env.cssFail && !isScript) {"," cssTimeout = setTimeout(onError, req.timeout || 3000);"," }"," }",""," this._waiting += 1;",""," this.nodes.push(node);"," insertBefore.parentNode.insertBefore(node, insertBefore);"," },",""," _next: function () {"," if (this._pending) {"," return;"," }",""," // If there are requests in the queue, insert the next queued request."," // Otherwise, if we're waiting on already-inserted requests to finish,"," // wait longer. If there are no queued requests and we're not waiting"," // for anything to load, then we're done!"," if (this._queue.length) {"," this._insert(this._queue.shift());"," } else if (!this._waiting) {"," this._finish();"," }"," },",""," _poll: function (newReq) {"," var self = this,"," pendingCSS = self._pendingCSS,"," isWebKit = Y.UA.webkit,"," i, hasRules, j, nodeHref, req, sheets;",""," if (newReq) {"," pendingCSS || (pendingCSS = self._pendingCSS = []);"," pendingCSS.push(newReq);",""," if (self._pollTimer) {"," // A poll timeout is already pending, so no need to create a"," // new one."," return;"," }"," }",""," self._pollTimer = null;",""," // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s"," // will still be treated as a success. There's no good workaround for"," // this.",""," for (i = 0; i < pendingCSS.length; ++i) {"," req = pendingCSS[i];",""," if (isWebKit) {"," // Look for a stylesheet matching the pending URL."," sheets = req.doc.styleSheets;"," j = sheets.length;"," nodeHref = req.node.href;",""," while (--j >= 0) {"," if (sheets[j].href === nodeHref) {"," pendingCSS.splice(i, 1);"," i -= 1;"," self._progress(null, req);"," break;"," }"," }"," } else {"," // Many thanks to Zach Leatherman for calling my attention to"," // the @import-based cross-domain technique used here, and to"," // Oleg Slobodskoi for an earlier same-domain implementation."," //"," // See Zach's blog for more details:"," // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/"," try {"," // We don't really need to store this value since we never"," // use it again, but if we don't store it, Closure Compiler"," // assumes the code is useless and removes it."," hasRules = !!req.node.sheet.cssRules;",""," // If we get here, the stylesheet has loaded."," pendingCSS.splice(i, 1);"," i -= 1;"," self._progress(null, req);"," } catch (ex) {"," // An exception means the stylesheet is still loading."," }"," }"," }",""," if (pendingCSS.length) {"," self._pollTimer = setTimeout(function () {"," self._poll.call(self);"," }, self.options.pollInterval);"," }"," },",""," _progress: function (err, req) {"," var options = this.options;",""," if (err) {"," req.error = err;",""," this.errors.push({"," error : err,"," request: req"," });",""," }",""," req.node._yuiget_finished = req.finished = true;",""," if (options.onProgress) {"," options.onProgress.call(options.context || this,"," this._getEventData(req));"," }",""," if (req.autopurge) {"," // Pre-3.5.0 Get always excludes the most recent node from an"," // autopurge. I find this odd, but I'm keeping that behavior for"," // the sake of backcompat."," Get._autoPurge(this.options.purgethreshold);"," Get._purgeNodes.push(req.node);"," }",""," if (this._pending === req) {"," this._pending = null;"," }",""," this._waiting -= 1;"," this._next();"," }","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];-_yuitest_coverage["build/get/get.js"].lines = {"1":0,"13":0,"19":0,"259":0,"262":0,"263":0,"264":0,"265":0,"267":0,"268":0,"269":0,"271":0,"272":0,"274":0,"275":0,"276":0,"277":0,"283":0,"354":0,"430":0,"476":0,"491":0,"492":0,"507":0,"513":0,"543":0,"546":0,"547":0,"550":0,"553":0,"556":0,"557":0,"558":0,"564":0,"565":0,"566":0,"569":0,"570":0,"572":0,"575":0,"580":0,"581":0,"582":0,"584":0,"587":0,"593":0,"597":0,"600":0,"601":0,"603":0,"606":0,"607":0,"610":0,"613":0,"617":0,"620":0,"621":0,"622":0,"625":0,"626":0,"628":0,"629":0,"632":0,"634":0,"639":0,"641":0,"645":0,"647":0,"648":0,"651":0,"653":0,"654":0,"656":0,"657":0,"659":0,"660":0,"666":0,"670":0,"673":0,"674":0,"677":0,"685":0,"686":0,"688":0,"689":0,"702":0,"715":0,"716":0,"718":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"726":0,"727":0,"730":0,"731":0,"792":0,"794":0,"821":0,"822":0,"823":0,"824":0,"825":0,"827":0,"828":0,"850":0,"855":0,"856":0,"857":0,"859":0,"861":0,"862":0,"866":0,"867":0,"869":0,"870":0,"871":0,"875":0,"876":0,"878":0,"880":0,"882":0,"886":0,"899":0,"904":0,"907":0,"912":0,"913":0,"915":0,"921":0,"922":0,"923":0,"927":0,"931":0,"936":0,"937":0,"940":0,"942":0,"943":0,"946":0,"948":0,"949":0,"950":0,"953":0,"954":0,"956":0,"957":0,"960":0,"961":0,"966":0,"968":0,"976":0,"981":0,"985":0,"986":0,"989":0,"990":0,"992":0,"993":0,"999":0,"1000":0,"1004":0,"1006":0,"1010":0,"1011":0,"1016":0,"1020":0,"1028":0,"1029":0,"1030":0,"1031":0,"1032":0,"1034":0,"1037":0,"1041":0,"1042":0,"1045":0,"1046":0,"1047":0,"1050":0,"1055":0,"1056":0,"1058":0,"1062":0,"1064":0,"1069":0,"1075":0,"1076":0,"1080":0,"1088":0,"1092":0,"1097":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1111":0,"1112":0,"1116":0,"1117":0,"1121":0,"1123":0,"1124":0,"1128":0,"1129":0,"1136":0,"1137":0,"1138":0,"1139":0,"1144":0,"1149":0,"1150":0,"1151":0,"1153":0,"1156":0,"1160":0,"1166":0,"1167":0,"1169":0,"1171":0,"1172":0,"1173":0,"1175":0,"1176":0,"1177":0,"1178":0,"1179":0,"1180":0,"1190":0,"1194":0,"1197":0,"1198":0,"1199":0,"1206":0,"1207":0,"1208":0,"1214":0,"1216":0,"1217":0,"1219":0,"1226":0,"1228":0,"1229":0,"1233":0,"1237":0,"1238":0,"1241":0,"1242":0,"1245":0,"1246":0};-_yuitest_coverage["build/get/get.js"].functions = {"abort:258":0,"css:353":0,"js:429":0,"load:475":0,"_autoPurge:490":0,"_getEnv:506":0,"_getTransaction:542":0,"_load:616":0,"(anonymous 2):656":0,"_next:644":0,"_purge:665":0,"Transaction:715":0,"abort:820":0,"(anonymous 3):870":0,"execute:849":0,"purge:898":0,"_createNode:903":0,"_finish:930":0,"_getEventData:965":0,"_getInsertBefore:980":0,"onError:1041":0,"onLoad:1045":0,"onreadystatechange:1099":0,"_insert:1019":0,"_next:1127":0,"(anonymous 4):1207":0,"_poll:1143":0,"_progress:1213":0,"(anonymous 1):1":0};-_yuitest_coverage["build/get/get.js"].coveredLines = 255;-_yuitest_coverage["build/get/get.js"].coveredFunctions = 29;+_yuitest_coverage["build/get/get.js"].code=["YUI.add('get', function (Y, NAME) {","","/*jslint boss:true, expr:true, laxbreak: true */","","/**","Provides dynamic loading of remote JavaScript and CSS resources.","","@module get","@class Get","@static","**/","","var Lang = Y.Lang,",""," CUSTOM_ATTRS, // defined lazily in Y.Get.Transaction._createNode()",""," Get, Transaction;","","Y.Get = Get = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Default options for CSS requests. Options specified here will override"," global defaults for CSS requests.",""," See the `options` property for all available options.",""," @property cssOptions"," @type Object"," @static"," @since 3.5.0"," **/"," cssOptions: {"," attributes: {"," rel: 'stylesheet'"," },",""," doc : Y.config.linkDoc || Y.config.doc,"," pollInterval: 50"," },",""," /**"," Default options for JS requests. Options specified here will override global"," defaults for JS requests.",""," See the `options` property for all available options.",""," @property jsOptions"," @type Object"," @static"," @since 3.5.0"," **/"," jsOptions: {"," autopurge: true,"," doc : Y.config.scriptDoc || Y.config.doc"," },",""," /**"," Default options to use for all requests.",""," Note that while all available options are documented here for ease of"," discovery, some options (like callback functions) only make sense at the"," transaction level.",""," Callback functions specified via the options object or the `options`"," parameter of the `css()`, `js()`, or `load()` methods will receive the"," transaction object as a parameter. See `Y.Get.Transaction` for details on"," the properties and methods available on transactions.",""," @static"," @since 3.5.0"," @property {Object} options",""," @property {Boolean} [options.async=false] Whether or not to load scripts"," asynchronously, meaning they're requested in parallel and execution"," order is not guaranteed. Has no effect on CSS, since CSS is always"," loaded asynchronously.",""," @property {Object} [options.attributes] HTML attribute name/value pairs that"," should be added to inserted nodes. By default, the `charset` attribute"," will be set to \"utf-8\" and nodes will be given an auto-generated `id`"," attribute, but you can override these with your own values if desired.",""," @property {Boolean} [options.autopurge] Whether or not to automatically"," purge inserted nodes after the purge threshold is reached. This is"," `true` by default for JavaScript, but `false` for CSS since purging a"," CSS node will also remove any styling applied by the referenced file.",""," @property {Object} [options.context] `this` object to use when calling"," callback functions. Defaults to the transaction object.",""," @property {Mixed} [options.data] Arbitrary data object to pass to \"on*\""," callbacks.",""," @property {Document} [options.doc] Document into which nodes should be"," inserted. By default, the current document is used.",""," @property {HTMLElement|String} [options.insertBefore] HTML element or id"," string of an element before which all generated nodes should be"," inserted. If not specified, Get will automatically determine the best"," place to insert nodes for maximum compatibility.",""," @property {Function} [options.onEnd] Callback to execute after a transaction"," is complete, regardless of whether it succeeded or failed.",""," @property {Function} [options.onFailure] Callback to execute after a"," transaction fails, times out, or is aborted.",""," @property {Function} [options.onProgress] Callback to execute after each"," individual request in a transaction either succeeds or fails.",""," @property {Function} [options.onSuccess] Callback to execute after a"," transaction completes successfully with no errors. Note that in browsers"," that don't support the `error` event on CSS `<link>` nodes, a failed CSS"," request may still be reported as a success because in these browsers"," it can be difficult or impossible to distinguish between success and"," failure for CSS resources.",""," @property {Function} [options.onTimeout] Callback to execute after a"," transaction times out.",""," @property {Number} [options.pollInterval=50] Polling interval (in"," milliseconds) for detecting CSS load completion in browsers that don't"," support the `load` event on `<link>` nodes. This isn't used for"," JavaScript.",""," @property {Number} [options.purgethreshold=20] Number of nodes to insert"," before triggering an automatic purge when `autopurge` is `true`.",""," @property {Number} [options.timeout] Number of milliseconds to wait before"," aborting a transaction. When a timeout occurs, the `onTimeout` callback"," is called, followed by `onFailure` and finally `onEnd`. By default,"," there is no timeout.",""," @property {String} [options.type] Resource type (\"css\" or \"js\"). This option"," is set automatically by the `css()` and `js()` functions and will be"," ignored there, but may be useful when using the `load()` function. If"," not specified, the type will be inferred from the URL, defaulting to"," \"js\" if the URL doesn't contain a recognizable file extension."," **/"," options: {"," attributes: {"," charset: 'utf-8'"," },",""," purgethreshold: 20"," },",""," // -- Protected Properties -------------------------------------------------",""," /**"," Regex that matches a CSS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_CSS"," @type RegExp"," @final"," @protected"," @static"," @since 3.5.0"," **/"," REGEX_CSS: /\\.css(?:[?;].*)?$/i,",""," /**"," Regex that matches a JS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_JS"," @type RegExp"," @final"," @protected"," @static"," @since 3.5.0"," **/"," REGEX_JS : /\\.js(?:[?;].*)?$/i,",""," /**"," Contains information about the current environment, such as what script and"," link injection features it supports.",""," This object is created and populated the first time the `_getEnv()` method"," is called.",""," @property _env"," @type Object"," @protected"," @static"," @since 3.5.0"," **/",""," /**"," Mapping of document _yuid strings to <head> or <base> node references so we"," don't have to look the node up each time we want to insert a request node.",""," @property _insertCache"," @type Object"," @protected"," @static"," @since 3.5.0"," **/"," _insertCache: {},",""," /**"," Information about the currently pending transaction, if any.",""," This is actually an object with two properties: `callback`, containing the"," optional callback passed to `css()`, `load()`, or `js()`; and `transaction`,"," containing the actual transaction instance.",""," @property _pending"," @type Object"," @protected"," @static"," @since 3.5.0"," **/"," _pending: null,",""," /**"," HTML nodes eligible to be purged next time autopurge is triggered.",""," @property _purgeNodes"," @type HTMLElement[]"," @protected"," @static"," @since 3.5.0"," **/"," _purgeNodes: [],",""," /**"," Queued transactions and associated callbacks.",""," @property _queue"," @type Object[]"," @protected"," @static"," @since 3.5.0"," **/"," _queue: [],",""," // -- Public Methods -------------------------------------------------------",""," /**"," Aborts the specified transaction.",""," This will cause the transaction's `onFailure` callback to be called and"," will prevent any new script and link nodes from being added to the document,"," but any resources that have already been requested will continue loading"," (there's no safe way to prevent this, unfortunately).",""," *Note:* This method is deprecated as of 3.5.0, and will be removed in a"," future version of YUI. Use the transaction-level `abort()` method instead.",""," @method abort"," @param {Get.Transaction} transaction Transaction to abort."," @deprecated Use the `abort()` method on the transaction instead."," @static"," **/"," abort: function (transaction) {"," var i, id, item, len, pending;","",""," if (!transaction.abort) {"," id = transaction;"," pending = this._pending;"," transaction = null;",""," if (pending && pending.transaction.id === id) {"," transaction = pending.transaction;"," this._pending = null;"," } else {"," for (i = 0, len = this._queue.length; i < len; ++i) {"," item = this._queue[i].transaction;",""," if (item.id === id) {"," transaction = item;"," this._queue.splice(i, 1);"," break;"," }"," }"," }"," }",""," transaction && transaction.abort();"," },",""," /**"," Loads one or more CSS files.",""," The _urls_ parameter may be provided as a URL string, a request object,"," or an array of URL strings and/or request objects.",""," A request object is just an object that contains a `url` property and zero"," or more options that should apply specifically to that request."," Request-specific options take priority over transaction-level options and"," default options.",""," URLs may be relative or absolute, and do not have to have the same origin"," as the current page.",""," The `options` parameter may be omitted completely and a callback passed in"," its place, if desired.",""," @example",""," // Load a single CSS file and log a message on completion."," Y.Get.css('foo.css', function (err) {"," if (err) {"," } else {"," }"," });",""," // Load multiple CSS files and log a message when all have finished"," // loading."," var urls = ['foo.css', 'http://example.com/bar.css', 'baz/quux.css'];",""," Y.Get.css(urls, function (err) {"," if (err) {"," } else {"," }"," });",""," // Specify transaction-level options, which will apply to all requests"," // within the transaction."," Y.Get.css(urls, {"," attributes: {'class': 'my-css'},"," timeout : 5000"," });",""," // Specify per-request options, which override transaction-level and"," // default options."," Y.Get.css(["," {url: 'foo.css', attributes: {id: 'foo'}},"," {url: 'bar.css', attributes: {id: 'bar', charset: 'iso-8859-1'}}"," ]);",""," @method css"," @param {String|Object|Array} urls URL string, request object, or array"," of URLs and/or request objects to load."," @param {Object} [options] Options for this transaction. See the"," `Y.Get.options` property for a complete list of available options."," @param {Function} [callback] Callback function to be called on completion."," This is a general callback and will be called before any more granular"," callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`"," object.",""," @param {Array|null} callback.err Array of errors that occurred during"," the transaction, or `null` on success."," @param {Get.Transaction} callback.transaction Transaction object.",""," @return {Get.Transaction} Transaction object."," @static"," **/"," css: function (urls, options, callback) {"," return this._load('css', urls, options, callback);"," },",""," /**"," Loads one or more JavaScript resources.",""," The _urls_ parameter may be provided as a URL string, a request object,"," or an array of URL strings and/or request objects.",""," A request object is just an object that contains a `url` property and zero"," or more options that should apply specifically to that request."," Request-specific options take priority over transaction-level options and"," default options.",""," URLs may be relative or absolute, and do not have to have the same origin"," as the current page.",""," The `options` parameter may be omitted completely and a callback passed in"," its place, if desired.",""," Scripts will be executed in the order they're specified unless the `async`"," option is `true`, in which case they'll be loaded in parallel and executed"," in whatever order they finish loading.",""," @example",""," // Load a single JS file and log a message on completion."," Y.Get.js('foo.js', function (err) {"," if (err) {"," } else {"," }"," });",""," // Load multiple JS files, execute them in order, and log a message when"," // all have finished loading."," var urls = ['foo.js', 'http://example.com/bar.js', 'baz/quux.js'];",""," Y.Get.js(urls, function (err) {"," if (err) {"," } else {"," }"," });",""," // Specify transaction-level options, which will apply to all requests"," // within the transaction."," Y.Get.js(urls, {"," attributes: {'class': 'my-js'},"," timeout : 5000"," });",""," // Specify per-request options, which override transaction-level and"," // default options."," Y.Get.js(["," {url: 'foo.js', attributes: {id: 'foo'}},"," {url: 'bar.js', attributes: {id: 'bar', charset: 'iso-8859-1'}}"," ]);",""," @method js"," @param {String|Object|Array} urls URL string, request object, or array"," of URLs and/or request objects to load."," @param {Object} [options] Options for this transaction. See the"," `Y.Get.options` property for a complete list of available options."," @param {Function} [callback] Callback function to be called on completion."," This is a general callback and will be called before any more granular"," callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`"," object.",""," @param {Array|null} callback.err Array of errors that occurred during"," the transaction, or `null` on success."," @param {Get.Transaction} callback.transaction Transaction object.",""," @return {Get.Transaction} Transaction object."," @since 3.5.0"," @static"," **/"," js: function (urls, options, callback) {"," return this._load('js', urls, options, callback);"," },",""," /**"," Loads one or more CSS and/or JavaScript resources in the same transaction.",""," Use this method when you want to load both CSS and JavaScript in a single"," transaction and be notified when all requested URLs have finished loading,"," regardless of type.",""," Behavior and options are the same as for the `css()` and `js()` methods. If"," a resource type isn't specified in per-request options or transaction-level"," options, Get will guess the file type based on the URL's extension (`.css`"," or `.js`, with or without a following query string). If the file type can't"," be guessed from the URL, a warning will be logged and Get will assume the"," URL is a JavaScript resource.",""," @example",""," // Load both CSS and JS files in a single transaction, and log a message"," // when all files have finished loading."," Y.Get.load(['foo.css', 'bar.js', 'baz.css'], function (err) {"," if (err) {"," } else {"," }"," });",""," @method load"," @param {String|Object|Array} urls URL string, request object, or array"," of URLs and/or request objects to load."," @param {Object} [options] Options for this transaction. See the"," `Y.Get.options` property for a complete list of available options."," @param {Function} [callback] Callback function to be called on completion."," This is a general callback and will be called before any more granular"," callbacks (`onSuccess`, `onFailure`, etc.) specified in the `options`"," object.",""," @param {Array|null} err Array of errors that occurred during the"," transaction, or `null` on success."," @param {Get.Transaction} Transaction object.",""," @return {Get.Transaction} Transaction object."," @since 3.5.0"," @static"," **/"," load: function (urls, options, callback) {"," return this._load(null, urls, options, callback);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Triggers an automatic purge if the purge threshold has been reached.",""," @method _autoPurge"," @param {Number} threshold Purge threshold to use, in milliseconds."," @protected"," @since 3.5.0"," @static"," **/"," _autoPurge: function (threshold) {"," if (threshold && this._purgeNodes.length >= threshold) {"," this._purge(this._purgeNodes);"," }"," },",""," /**"," Populates the `_env` property with information about the current"," environment.",""," @method _getEnv"," @return {Object} Environment information."," @protected"," @since 3.5.0"," @static"," **/"," _getEnv: function () {"," var doc = Y.config.doc,"," ua = Y.UA;",""," // Note: some of these checks require browser sniffs since it's not"," // feasible to load test files on every pageview just to perform a"," // feature test. I'm sorry if this makes you sad."," return (this._env = {",""," // True if this is a browser that supports disabling async mode on"," // dynamically created script nodes. See"," // https://developer.mozilla.org/En/HTML/Element/Script#Attributes",""," // IE10 doesn't return true for the MDN feature test, so setting it explicitly,"," // because it is async by default, and allows you to disable async by setting it to false"," async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),",""," // True if this browser fires an event when a dynamically injected"," // link node fails to load. This is currently true for Firefox 9+"," // and WebKit 535.24+"," cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0,",""," // True if this browser fires an event when a dynamically injected"," // link node finishes loading. This is currently true for IE, Opera,"," // Firefox 9+, and WebKit 535.24+. Note that IE versions <9 fire the"," // DOM 0 \"onload\" event, but not \"load\". All versions of IE fire"," // \"onload\"."," // davglass: Seems that Chrome on Android needs this to be false."," cssLoad: ("," (!ua.gecko && !ua.webkit) || ua.gecko >= 9 ||"," ua.compareVersions(ua.webkit, 535.24) >= 0"," ) && !(ua.chrome && ua.chrome <= 18),",""," // True if this browser preserves script execution order while"," // loading scripts in parallel as long as the script node's `async`"," // attribute is set to false to explicitly disable async execution."," preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10))"," });"," },",""," _getTransaction: function (urls, options) {"," var requests = [],"," i, len, req, url;",""," if (!Lang.isArray(urls)) {"," urls = [urls];"," }",""," options = Y.merge(this.options, options);",""," // Clone the attributes object so we don't end up modifying it by ref."," options.attributes = Y.merge(this.options.attributes,"," options.attributes);",""," for (i = 0, len = urls.length; i < len; ++i) {"," url = urls[i];"," req = {attributes: {}};",""," // If `url` is a string, we create a URL object for it, then mix in"," // global options and request-specific options. If it's an object"," // with a \"url\" property, we assume it's a request object containing"," // URL-specific options."," if (typeof url === 'string') {"," req.url = url;"," } else if (url.url) {"," // URL-specific options override both global defaults and"," // request-specific options."," Y.mix(req, url, false, null, 0, true);"," url = url.url; // Make url a string so we can use it later."," } else {"," continue;"," }",""," Y.mix(req, options, false, null, 0, true);",""," // If we didn't get an explicit type for this URL either in the"," // request options or the URL-specific options, try to determine"," // one from the file extension."," if (!req.type) {"," if (this.REGEX_CSS.test(url)) {"," req.type = 'css';"," } else {"," if (!this.REGEX_JS.test(url)) {"," }",""," req.type = 'js';"," }"," }",""," // Mix in type-specific default options, but don't overwrite any"," // options that have already been set."," Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions,"," false, null, 0, true);",""," // Give the node an id attribute if it doesn't already have one."," req.attributes.id || (req.attributes.id = Y.guid());",""," // Backcompat for <3.5.0 behavior."," if (req.win) {"," req.doc = req.win.document;"," } else {"," req.win = req.doc.defaultView || req.doc.parentWindow;"," }",""," if (req.charset) {"," req.attributes.charset = req.charset;"," }",""," requests.push(req);"," }",""," return new Transaction(requests, options);"," },",""," _load: function (type, urls, options, callback) {"," var transaction;",""," // Allow callback as third param."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});"," options.type = type;",""," options._onFinish = Get._onTransactionFinish;",""," if (!this._env) {"," this._getEnv();"," }",""," transaction = this._getTransaction(urls, options);",""," this._queue.push({"," callback : callback,"," transaction: transaction"," });",""," this._next();",""," return transaction;"," },",""," _onTransactionFinish : function() {"," Get._pending = null;"," Get._next();"," },",""," _next: function () {"," var item;",""," if (this._pending) {"," return;"," }",""," item = this._queue.shift();",""," if (item) {"," this._pending = item;"," item.transaction.execute(item.callback);"," }"," },",""," _purge: function (nodes) {"," var purgeNodes = this._purgeNodes,"," isTransaction = nodes !== purgeNodes,"," index, node;",""," while (node = nodes.pop()) { // assignment"," // Don't purge nodes that haven't finished loading (or errored out),"," // since this can hang the transaction."," if (!node._yuiget_finished) {"," continue;"," }",""," node.parentNode && node.parentNode.removeChild(node);",""," // If this is a transaction-level purge and this node also exists in"," // the Get-level _purgeNodes array, we need to remove it from"," // _purgeNodes to avoid creating a memory leak. The indexOf lookup"," // sucks, but until we get WeakMaps, this is the least troublesome"," // way to do this (we can't just hold onto node ids because they may"," // not be in the same document)."," if (isTransaction) {"," index = Y.Array.indexOf(purgeNodes, node);",""," if (index > -1) {"," purgeNodes.splice(index, 1);"," }"," }"," }"," }","};","","/**","Alias for `js()`.","","@method script","@static","**/","Get.script = Get.js;","","/**","Represents a Get transaction, which may contain requests for one or more JS or","CSS files.","","This class should not be instantiated manually. Instances will be created and","returned as needed by Y.Get's `css()`, `js()`, and `load()` methods.","","@class Get.Transaction","@constructor","@since 3.5.0","**/","Get.Transaction = Transaction = function (requests, options) {"," var self = this;",""," self.id = Transaction._lastId += 1;"," self.data = options.data;"," self.errors = [];"," self.nodes = [];"," self.options = options;"," self.requests = requests;",""," self._callbacks = []; // callbacks to call after execution finishes"," self._queue = [];"," self._reqsWaiting = 0;",""," // Deprecated pre-3.5.0 properties."," self.tId = self.id; // Use `id` instead."," self.win = options.win || Y.config.win;","};","","/**","Arbitrary data object associated with this transaction.","","This object comes from the options passed to `Get.css()`, `Get.js()`, or","`Get.load()`, and will be `undefined` if no data object was specified.","","@property {Object} data","**/","","/**","Array of errors that have occurred during this transaction, if any.","","@since 3.5.0","@property {Object[]} errors","@property {String} errors.error Error message.","@property {Object} errors.request Request object related to the error.","**/","","/**","Numeric id for this transaction, unique among all transactions within the same","YUI sandbox in the current pageview.","","@property {Number} id","@since 3.5.0","**/","","/**","HTMLElement nodes (native ones, not YUI Node instances) that have been inserted","during the current transaction.","","@property {HTMLElement[]} nodes","**/","","/**","Options associated with this transaction.","","See `Get.options` for the full list of available options.","","@property {Object} options","@since 3.5.0","**/","","/**","Request objects contained in this transaction. Each request object represents","one CSS or JS URL that will be (or has been) requested and loaded into the page.","","@property {Object} requests","@since 3.5.0","**/","","/**","Id of the most recent transaction.","","@property _lastId","@type Number","@protected","@static","**/","Transaction._lastId = 0;","","Transaction.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Current state of this transaction. One of \"new\", \"executing\", or \"done\".",""," @property _state"," @type String"," @protected"," **/"," _state: 'new', // \"new\", \"executing\", or \"done\"",""," // -- Public Methods -------------------------------------------------------",""," /**"," Aborts this transaction.",""," This will cause the transaction's `onFailure` callback to be called and"," will prevent any new script and link nodes from being added to the document,"," but any resources that have already been requested will continue loading"," (there's no safe way to prevent this, unfortunately).",""," @method abort"," @param {String} [msg=\"Aborted.\"] Optional message to use in the `errors`"," array describing why the transaction was aborted."," **/"," abort: function (msg) {"," this._pending = null;"," this._pendingCSS = null;"," this._pollTimer = clearTimeout(this._pollTimer);"," this._queue = [];"," this._reqsWaiting = 0;",""," this.errors.push({error: msg || 'Aborted'});"," this._finish();"," },",""," /**"," Begins execting the transaction.",""," There's usually no reason to call this manually, since Get will call it"," automatically when other pending transactions have finished. If you really"," want to execute your transaction before Get does, you can, but be aware that"," this transaction's scripts may end up executing before the scripts in other"," pending transactions.",""," If the transaction is already executing, the specified callback (if any)"," will be queued and called after execution finishes. If the transaction has"," already finished, the callback will be called immediately (the transaction"," will not be executed again).",""," @method execute"," @param {Function} callback Callback function to execute after all requests"," in the transaction are complete, or after the transaction is aborted."," **/"," execute: function (callback) {"," var self = this,"," requests = self.requests,"," state = self._state,"," i, len, queue, req;",""," if (state === 'done') {"," callback && callback(self.errors.length ? self.errors : null, self);"," return;"," } else {"," callback && self._callbacks.push(callback);",""," if (state === 'executing') {"," return;"," }"," }",""," self._state = 'executing';"," self._queue = queue = [];",""," if (self.options.timeout) {"," self._timeout = setTimeout(function () {"," self.abort('Timeout');"," }, self.options.timeout);"," }",""," self._reqsWaiting = requests.length;",""," for (i = 0, len = requests.length; i < len; ++i) {"," req = requests[i];",""," if (req.async || req.type === 'css') {"," // No need to queue CSS or fully async JS."," self._insert(req);"," } else {"," queue.push(req);"," }"," }",""," self._next();"," },",""," /**"," Manually purges any `<script>` or `<link>` nodes this transaction has"," created.",""," Be careful when purging a transaction that contains CSS requests, since"," removing `<link>` nodes will also remove any styles they applied.",""," @method purge"," **/"," purge: function () {"," Get._purge(this.nodes);"," },",""," // -- Protected Methods ----------------------------------------------------"," _createNode: function (name, attrs, doc) {"," var node = doc.createElement(name),"," attr, testEl;",""," if (!CUSTOM_ATTRS) {"," // IE6 and IE7 expect property names rather than attribute names for"," // certain attributes. Rather than sniffing, we do a quick feature"," // test the first time _createNode() runs to determine whether we"," // need to provide a workaround."," testEl = doc.createElement('div');"," testEl.setAttribute('class', 'a');",""," CUSTOM_ATTRS = testEl.className === 'a' ? {} : {"," 'for' : 'htmlFor',"," 'class': 'className'"," };"," }",""," for (attr in attrs) {"," if (attrs.hasOwnProperty(attr)) {"," node.setAttribute(CUSTOM_ATTRS[attr] || attr, attrs[attr]);"," }"," }",""," return node;"," },",""," _finish: function () {"," var errors = this.errors.length ? this.errors : null,"," options = this.options,"," thisObj = options.context || this,"," data, i, len;",""," if (this._state === 'done') {"," return;"," }",""," this._state = 'done';",""," for (i = 0, len = this._callbacks.length; i < len; ++i) {"," this._callbacks[i].call(thisObj, errors, this);"," }",""," data = this._getEventData();",""," if (errors) {"," if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') {"," options.onTimeout.call(thisObj, data);"," }",""," if (options.onFailure) {"," options.onFailure.call(thisObj, data);"," }"," } else if (options.onSuccess) {"," options.onSuccess.call(thisObj, data);"," }",""," if (options.onEnd) {"," options.onEnd.call(thisObj, data);"," }",""," if (options._onFinish) {"," options._onFinish();"," }"," },",""," _getEventData: function (req) {"," if (req) {"," // This merge is necessary for backcompat. I hate it."," return Y.merge(this, {"," abort : this.abort, // have to copy these because the prototype isn't preserved"," purge : this.purge,"," request: req,"," url : req.url,"," win : req.win"," });"," } else {"," return this;"," }"," },",""," _getInsertBefore: function (req) {"," var doc = req.doc,"," el = req.insertBefore,"," cache, cachedNode, docStamp;",""," if (el) {"," return typeof el === 'string' ? doc.getElementById(el) : el;"," }",""," cache = Get._insertCache;"," docStamp = Y.stamp(doc);",""," if ((el = cache[docStamp])) { // assignment"," return el;"," }",""," // Inserting before a <base> tag apparently works around an IE bug"," // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what"," // bug that is, exactly. Better safe than sorry?"," if ((el = doc.getElementsByTagName('base')[0])) { // assignment"," return (cache[docStamp] = el);"," }",""," // Look for a <head> element."," el = doc.head || doc.getElementsByTagName('head')[0];",""," if (el) {"," // Create a marker node at the end of <head> to use as an insertion"," // point. Inserting before this node will ensure that all our CSS"," // gets inserted in the correct order, to maintain style precedence."," el.appendChild(doc.createTextNode(''));"," return (cache[docStamp] = el.lastChild);"," }",""," // If all else fails, just insert before the first script node on the"," // page, which is virtually guaranteed to exist."," return (cache[docStamp] = doc.getElementsByTagName('script')[0]);"," },",""," _insert: function (req) {"," var env = Get._env,"," insertBefore = this._getInsertBefore(req),"," isScript = req.type === 'js',"," node = req.node,"," self = this,"," ua = Y.UA,"," cssTimeout, nodeType;",""," if (!node) {"," if (isScript) {"," nodeType = 'script';"," } else if (!env.cssLoad && ua.gecko) {"," nodeType = 'style';"," } else {"," nodeType = 'link';"," }",""," node = req.node = this._createNode(nodeType, req.attributes,"," req.doc);"," }",""," function onError() {"," self._progress('Failed to load ' + req.url, req);"," }",""," function onLoad() {"," if (cssTimeout) {"," clearTimeout(cssTimeout);"," }",""," self._progress(null, req);"," }",""," // Deal with script asynchronicity."," if (isScript) {"," node.setAttribute('src', req.url);",""," if (req.async) {"," // Explicitly indicate that we want the browser to execute this"," // script asynchronously. This is necessary for older browsers"," // like Firefox <4."," node.async = true;"," } else {"," if (env.async) {"," // This browser treats injected scripts as async by default"," // (standard HTML5 behavior) but asynchronous loading isn't"," // desired, so tell the browser not to mark this script as"," // async."," node.async = false;"," }",""," // If this browser doesn't preserve script execution order based"," // on insertion order, we'll need to avoid inserting other"," // scripts until this one finishes loading."," if (!env.preservesScriptOrder) {"," this._pending = req;"," }"," }"," } else {"," if (!env.cssLoad && ua.gecko) {"," // In Firefox <9, we can import the requested URL into a <style>"," // node and poll for the existence of node.sheet.cssRules. This"," // gives us a reliable way to determine CSS load completion that"," // also works for cross-domain stylesheets."," //"," // Props to Zach Leatherman for calling my attention to this"," // technique."," node.innerHTML = (req.attributes.charset ?"," '@charset \"' + req.attributes.charset + '\";' : '') +"," '@import \"' + req.url + '\";';"," } else {"," node.setAttribute('href', req.url);"," }"," }",""," // Inject the node."," if (isScript && ua.ie && (ua.ie < 9 || (document.documentMode && document.documentMode < 9))) {"," // Script on IE < 9, and IE 9+ when in IE 8 or older modes, including quirks mode."," node.onreadystatechange = function () {"," if (/loaded|complete/.test(node.readyState)) {"," node.onreadystatechange = null;"," onLoad();"," }"," };"," } else if (!isScript && !env.cssLoad) {"," // CSS on Firefox <9 or WebKit."," this._poll(req);"," } else {"," // Script or CSS on everything else. Using DOM 0 events because that"," // evens the playing field with older IEs.",""," if (ua.ie >= 10) {",""," // We currently need to introduce a timeout for IE10, since it "," // calls onerror/onload synchronously for 304s - messing up existing"," // program flow. ",""," // Remove this block if the following bug gets fixed by GA"," // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload"," node.onerror = function() { setTimeout(onError, 0); };"," node.onload = function() { setTimeout(onLoad, 0); };"," } else {"," node.onerror = onError;"," node.onload = onLoad;"," }",""," // If this browser doesn't fire an event when CSS fails to load,"," // fail after a timeout to avoid blocking the transaction queue."," if (!env.cssFail && !isScript) {"," cssTimeout = setTimeout(onError, req.timeout || 3000);"," }"," }",""," this.nodes.push(node);"," insertBefore.parentNode.insertBefore(node, insertBefore);"," },",""," _next: function () {"," if (this._pending) {"," return;"," }",""," // If there are requests in the queue, insert the next queued request."," // Otherwise, if we're waiting on already-inserted requests to finish,"," // wait longer. If there are no queued requests and we're not waiting"," // for anything to load, then we're done!"," if (this._queue.length) {"," this._insert(this._queue.shift());"," } else if (!this._reqsWaiting) {"," this._finish();"," }"," },",""," _poll: function (newReq) {"," var self = this,"," pendingCSS = self._pendingCSS,"," isWebKit = Y.UA.webkit,"," i, hasRules, j, nodeHref, req, sheets;",""," if (newReq) {"," pendingCSS || (pendingCSS = self._pendingCSS = []);"," pendingCSS.push(newReq);",""," if (self._pollTimer) {"," // A poll timeout is already pending, so no need to create a"," // new one."," return;"," }"," }",""," self._pollTimer = null;",""," // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s"," // will still be treated as a success. There's no good workaround for"," // this.",""," for (i = 0; i < pendingCSS.length; ++i) {"," req = pendingCSS[i];",""," if (isWebKit) {"," // Look for a stylesheet matching the pending URL."," sheets = req.doc.styleSheets;"," j = sheets.length;"," nodeHref = req.node.href;",""," while (--j >= 0) {"," if (sheets[j].href === nodeHref) {"," pendingCSS.splice(i, 1);"," i -= 1;"," self._progress(null, req);"," break;"," }"," }"," } else {"," // Many thanks to Zach Leatherman for calling my attention to"," // the @import-based cross-domain technique used here, and to"," // Oleg Slobodskoi for an earlier same-domain implementation."," //"," // See Zach's blog for more details:"," // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/"," try {"," // We don't really need to store this value since we never"," // use it again, but if we don't store it, Closure Compiler"," // assumes the code is useless and removes it."," hasRules = !!req.node.sheet.cssRules;",""," // If we get here, the stylesheet has loaded."," pendingCSS.splice(i, 1);"," i -= 1;"," self._progress(null, req);"," } catch (ex) {"," // An exception means the stylesheet is still loading."," }"," }"," }",""," if (pendingCSS.length) {"," self._pollTimer = setTimeout(function () {"," self._poll.call(self);"," }, self.options.pollInterval);"," }"," },",""," _progress: function (err, req) {"," var options = this.options;",""," if (err) {"," req.error = err;",""," this.errors.push({"," error : err,"," request: req"," });",""," }",""," req.node._yuiget_finished = req.finished = true;",""," if (options.onProgress) {"," options.onProgress.call(options.context || this,"," this._getEventData(req));"," }",""," if (req.autopurge) {"," // Pre-3.5.0 Get always excludes the most recent node from an"," // autopurge. I find this odd, but I'm keeping that behavior for"," // the sake of backcompat."," Get._autoPurge(this.options.purgethreshold);"," Get._purgeNodes.push(req.node);"," }",""," if (this._pending === req) {"," this._pending = null;"," }",""," this._reqsWaiting -= 1;",""," this._next();"," }","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/get/get.js"].lines = {"1":0,"13":0,"19":0,"259":0,"262":0,"263":0,"264":0,"265":0,"267":0,"268":0,"269":0,"271":0,"272":0,"274":0,"275":0,"276":0,"277":0,"283":0,"354":0,"430":0,"476":0,"491":0,"492":0,"507":0,"513":0,"547":0,"550":0,"551":0,"554":0,"557":0,"560":0,"561":0,"562":0,"568":0,"569":0,"570":0,"573":0,"574":0,"576":0,"579":0,"584":0,"585":0,"586":0,"588":0,"591":0,"597":0,"601":0,"604":0,"605":0,"607":0,"610":0,"611":0,"614":0,"617":0,"621":0,"624":0,"625":0,"626":0,"629":0,"630":0,"632":0,"634":0,"635":0,"638":0,"640":0,"645":0,"647":0,"651":0,"652":0,"656":0,"658":0,"659":0,"662":0,"664":0,"665":0,"666":0,"671":0,"675":0,"678":0,"679":0,"682":0,"690":0,"691":0,"693":0,"694":0,"707":0,"720":0,"721":0,"723":0,"724":0,"725":0,"726":0,"727":0,"728":0,"730":0,"731":0,"732":0,"735":0,"736":0,"797":0,"799":0,"826":0,"827":0,"828":0,"829":0,"830":0,"832":0,"833":0,"855":0,"860":0,"861":0,"862":0,"864":0,"866":0,"867":0,"871":0,"872":0,"874":0,"875":0,"876":0,"880":0,"882":0,"883":0,"885":0,"887":0,"889":0,"893":0,"906":0,"911":0,"914":0,"919":0,"920":0,"922":0,"928":0,"929":0,"930":0,"934":0,"938":0,"943":0,"944":0,"947":0,"949":0,"950":0,"953":0,"955":0,"956":0,"957":0,"960":0,"961":0,"963":0,"964":0,"967":0,"968":0,"971":0,"972":0,"977":0,"979":0,"987":0,"992":0,"996":0,"997":0,"1000":0,"1001":0,"1003":0,"1004":0,"1010":0,"1011":0,"1015":0,"1017":0,"1021":0,"1022":0,"1027":0,"1031":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1048":0,"1052":0,"1053":0,"1056":0,"1057":0,"1058":0,"1061":0,"1065":0,"1066":0,"1068":0,"1072":0,"1074":0,"1079":0,"1085":0,"1086":0,"1090":0,"1098":0,"1102":0,"1107":0,"1109":0,"1110":0,"1111":0,"1112":0,"1115":0,"1117":0,"1122":0,"1130":0,"1131":0,"1133":0,"1134":0,"1139":0,"1140":0,"1144":0,"1145":0,"1149":0,"1150":0,"1157":0,"1158":0,"1159":0,"1160":0,"1165":0,"1170":0,"1171":0,"1172":0,"1174":0,"1177":0,"1181":0,"1187":0,"1188":0,"1190":0,"1192":0,"1193":0,"1194":0,"1196":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1211":0,"1215":0,"1218":0,"1219":0,"1220":0,"1227":0,"1228":0,"1229":0,"1235":0,"1237":0,"1238":0,"1240":0,"1247":0,"1249":0,"1250":0,"1254":0,"1258":0,"1259":0,"1262":0,"1263":0,"1266":0,"1268":0};+_yuitest_coverage["build/get/get.js"].functions = {"abort:258":0,"css:353":0,"js:429":0,"load:475":0,"_autoPurge:490":0,"_getEnv:506":0,"_getTransaction:546":0,"_load:620":0,"_onTransactionFinish:650":0,"_next:655":0,"_purge:670":0,"Transaction:720":0,"abort:825":0,"(anonymous 2):875":0,"execute:854":0,"purge:905":0,"_createNode:910":0,"_finish:937":0,"_getEventData:976":0,"_getInsertBefore:991":0,"onError:1052":0,"onLoad:1056":0,"onreadystatechange:1109":0,"onerror:1130":0,"onload:1131":0,"_insert:1030":0,"_next:1148":0,"(anonymous 3):1228":0,"_poll:1164":0,"_progress:1234":0,"(anonymous 1):1":0};+_yuitest_coverage["build/get/get.js"].coveredLines = 260;+_yuitest_coverage["build/get/get.js"].coveredFunctions = 31; _yuitest_coverline("build/get/get.js", 1); YUI.add('get', function (Y, NAME) { @@ -582,14 +582,18 @@ // feature test. I'm sorry if this makes you sad. _yuitest_coverline("build/get/get.js", 513); return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -606,206 +610,207 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, _getTransaction: function (urls, options) {- _yuitest_coverfunc("build/get/get.js", "_getTransaction", 542);-_yuitest_coverline("build/get/get.js", 543);+ _yuitest_coverfunc("build/get/get.js", "_getTransaction", 546);+_yuitest_coverline("build/get/get.js", 547); var requests = [], i, len, req, url; - _yuitest_coverline("build/get/get.js", 546);+ _yuitest_coverline("build/get/get.js", 550); if (!Lang.isArray(urls)) {- _yuitest_coverline("build/get/get.js", 547);+ _yuitest_coverline("build/get/get.js", 551); urls = [urls]; } - _yuitest_coverline("build/get/get.js", 550);+ _yuitest_coverline("build/get/get.js", 554); options = Y.merge(this.options, options); // Clone the attributes object so we don't end up modifying it by ref.- _yuitest_coverline("build/get/get.js", 553);+ _yuitest_coverline("build/get/get.js", 557); options.attributes = Y.merge(this.options.attributes, options.attributes); - _yuitest_coverline("build/get/get.js", 556);+ _yuitest_coverline("build/get/get.js", 560); for (i = 0, len = urls.length; i < len; ++i) {- _yuitest_coverline("build/get/get.js", 557);+ _yuitest_coverline("build/get/get.js", 561); url = urls[i];- _yuitest_coverline("build/get/get.js", 558);+ _yuitest_coverline("build/get/get.js", 562); req = {attributes: {}}; // If `url` is a string, we create a URL object for it, then mix in // global options and request-specific options. If it's an object // with a "url" property, we assume it's a request object containing // URL-specific options.- _yuitest_coverline("build/get/get.js", 564);+ _yuitest_coverline("build/get/get.js", 568); if (typeof url === 'string') {- _yuitest_coverline("build/get/get.js", 565);+ _yuitest_coverline("build/get/get.js", 569); req.url = url;- } else {_yuitest_coverline("build/get/get.js", 566);+ } else {_yuitest_coverline("build/get/get.js", 570); if (url.url) { // URL-specific options override both global defaults and // request-specific options.- _yuitest_coverline("build/get/get.js", 569);+ _yuitest_coverline("build/get/get.js", 573); Y.mix(req, url, false, null, 0, true);- _yuitest_coverline("build/get/get.js", 570);+ _yuitest_coverline("build/get/get.js", 574); url = url.url; // Make url a string so we can use it later. } else {- _yuitest_coverline("build/get/get.js", 572);+ _yuitest_coverline("build/get/get.js", 576); continue; }} - _yuitest_coverline("build/get/get.js", 575);+ _yuitest_coverline("build/get/get.js", 579); Y.mix(req, options, false, null, 0, true); // If we didn't get an explicit type for this URL either in the // request options or the URL-specific options, try to determine // one from the file extension.- _yuitest_coverline("build/get/get.js", 580);+ _yuitest_coverline("build/get/get.js", 584); if (!req.type) {- _yuitest_coverline("build/get/get.js", 581);+ _yuitest_coverline("build/get/get.js", 585); if (this.REGEX_CSS.test(url)) {- _yuitest_coverline("build/get/get.js", 582);+ _yuitest_coverline("build/get/get.js", 586); req.type = 'css'; } else {- _yuitest_coverline("build/get/get.js", 584);+ _yuitest_coverline("build/get/get.js", 588); if (!this.REGEX_JS.test(url)) { } - _yuitest_coverline("build/get/get.js", 587);+ _yuitest_coverline("build/get/get.js", 591); req.type = 'js'; } } // Mix in type-specific default options, but don't overwrite any // options that have already been set.- _yuitest_coverline("build/get/get.js", 593);+ _yuitest_coverline("build/get/get.js", 597); Y.mix(req, req.type === 'js' ? this.jsOptions : this.cssOptions, false, null, 0, true); // Give the node an id attribute if it doesn't already have one.- _yuitest_coverline("build/get/get.js", 597);+ _yuitest_coverline("build/get/get.js", 601); req.attributes.id || (req.attributes.id = Y.guid()); // Backcompat for <3.5.0 behavior.- _yuitest_coverline("build/get/get.js", 600);+ _yuitest_coverline("build/get/get.js", 604); if (req.win) {- _yuitest_coverline("build/get/get.js", 601);+ _yuitest_coverline("build/get/get.js", 605); req.doc = req.win.document; } else {- _yuitest_coverline("build/get/get.js", 603);+ _yuitest_coverline("build/get/get.js", 607); req.win = req.doc.defaultView || req.doc.parentWindow; } - _yuitest_coverline("build/get/get.js", 606);+ _yuitest_coverline("build/get/get.js", 610); if (req.charset) {- _yuitest_coverline("build/get/get.js", 607);+ _yuitest_coverline("build/get/get.js", 611); req.attributes.charset = req.charset; } - _yuitest_coverline("build/get/get.js", 610);+ _yuitest_coverline("build/get/get.js", 614); requests.push(req); } - _yuitest_coverline("build/get/get.js", 613);+ _yuitest_coverline("build/get/get.js", 617); return new Transaction(requests, options); }, _load: function (type, urls, options, callback) {- _yuitest_coverfunc("build/get/get.js", "_load", 616);-_yuitest_coverline("build/get/get.js", 617);+ _yuitest_coverfunc("build/get/get.js", "_load", 620);+_yuitest_coverline("build/get/get.js", 621); var transaction; // Allow callback as third param.- _yuitest_coverline("build/get/get.js", 620);+ _yuitest_coverline("build/get/get.js", 624); if (typeof options === 'function') {- _yuitest_coverline("build/get/get.js", 621);+ _yuitest_coverline("build/get/get.js", 625); callback = options;- _yuitest_coverline("build/get/get.js", 622);+ _yuitest_coverline("build/get/get.js", 626); options = {}; } - _yuitest_coverline("build/get/get.js", 625);+ _yuitest_coverline("build/get/get.js", 629); options || (options = {});- _yuitest_coverline("build/get/get.js", 626);+ _yuitest_coverline("build/get/get.js", 630); options.type = type; - _yuitest_coverline("build/get/get.js", 628);+ _yuitest_coverline("build/get/get.js", 632);+options._onFinish = Get._onTransactionFinish;++ _yuitest_coverline("build/get/get.js", 634); if (!this._env) {- _yuitest_coverline("build/get/get.js", 629);+ _yuitest_coverline("build/get/get.js", 635); this._getEnv(); } - _yuitest_coverline("build/get/get.js", 632);+ _yuitest_coverline("build/get/get.js", 638); transaction = this._getTransaction(urls, options); - _yuitest_coverline("build/get/get.js", 634);+ _yuitest_coverline("build/get/get.js", 640); this._queue.push({ callback : callback, transaction: transaction }); - _yuitest_coverline("build/get/get.js", 639);+ _yuitest_coverline("build/get/get.js", 645); this._next(); - _yuitest_coverline("build/get/get.js", 641);+ _yuitest_coverline("build/get/get.js", 647); return transaction; }, + _onTransactionFinish : function() {+ _yuitest_coverfunc("build/get/get.js", "_onTransactionFinish", 650);+_yuitest_coverline("build/get/get.js", 651);+Get._pending = null;+ _yuitest_coverline("build/get/get.js", 652);+Get._next();+ },+ _next: function () {- _yuitest_coverfunc("build/get/get.js", "_next", 644);-_yuitest_coverline("build/get/get.js", 645);+ _yuitest_coverfunc("build/get/get.js", "_next", 655);+_yuitest_coverline("build/get/get.js", 656); var item; - _yuitest_coverline("build/get/get.js", 647);+ _yuitest_coverline("build/get/get.js", 658); if (this._pending) {- _yuitest_coverline("build/get/get.js", 648);+ _yuitest_coverline("build/get/get.js", 659); return; } - _yuitest_coverline("build/get/get.js", 651);+ _yuitest_coverline("build/get/get.js", 662); item = this._queue.shift(); - _yuitest_coverline("build/get/get.js", 653);+ _yuitest_coverline("build/get/get.js", 664); if (item) {- _yuitest_coverline("build/get/get.js", 654);+ _yuitest_coverline("build/get/get.js", 665); this._pending = item;-- _yuitest_coverline("build/get/get.js", 656);-item.transaction.execute(function () {- _yuitest_coverfunc("build/get/get.js", "(anonymous 2)", 656);-_yuitest_coverline("build/get/get.js", 657);-item.callback && item.callback.apply(this, arguments);-- _yuitest_coverline("build/get/get.js", 659);-Get._pending = null;- _yuitest_coverline("build/get/get.js", 660);-Get._next();- });+ _yuitest_coverline("build/get/get.js", 666);+item.transaction.execute(item.callback); } }, _purge: function (nodes) {- _yuitest_coverfunc("build/get/get.js", "_purge", 665);-_yuitest_coverline("build/get/get.js", 666);+ _yuitest_coverfunc("build/get/get.js", "_purge", 670);+_yuitest_coverline("build/get/get.js", 671); var purgeNodes = this._purgeNodes, isTransaction = nodes !== purgeNodes, index, node; - _yuitest_coverline("build/get/get.js", 670);+ _yuitest_coverline("build/get/get.js", 675); while (node = nodes.pop()) { // assignment // Don't purge nodes that haven't finished loading (or errored out), // since this can hang the transaction.- _yuitest_coverline("build/get/get.js", 673);+ _yuitest_coverline("build/get/get.js", 678); if (!node._yuiget_finished) {- _yuitest_coverline("build/get/get.js", 674);+ _yuitest_coverline("build/get/get.js", 679); continue; } - _yuitest_coverline("build/get/get.js", 677);+ _yuitest_coverline("build/get/get.js", 682); node.parentNode && node.parentNode.removeChild(node); // If this is a transaction-level purge and this node also exists in@@ -814,14 +819,14 @@ // sucks, but until we get WeakMaps, this is the least troublesome // way to do this (we can't just hold onto node ids because they may // not be in the same document).- _yuitest_coverline("build/get/get.js", 685);+ _yuitest_coverline("build/get/get.js", 690); if (isTransaction) {- _yuitest_coverline("build/get/get.js", 686);+ _yuitest_coverline("build/get/get.js", 691); index = Y.Array.indexOf(purgeNodes, node); - _yuitest_coverline("build/get/get.js", 688);+ _yuitest_coverline("build/get/get.js", 693); if (index > -1) {- _yuitest_coverline("build/get/get.js", 689);+ _yuitest_coverline("build/get/get.js", 694); purgeNodes.splice(index, 1); } }@@ -835,7 +840,7 @@ @method script @static **/-_yuitest_coverline("build/get/get.js", 702);+_yuitest_coverline("build/get/get.js", 707); Get.script = Get.js; /**@@ -849,36 +854,36 @@ @constructor @since 3.5.0 **/-_yuitest_coverline("build/get/get.js", 715);+_yuitest_coverline("build/get/get.js", 720); Get.Transaction = Transaction = function (requests, options) {- _yuitest_coverfunc("build/get/get.js", "Transaction", 715);-_yuitest_coverline("build/get/get.js", 716);+ _yuitest_coverfunc("build/get/get.js", "Transaction", 720);+_yuitest_coverline("build/get/get.js", 721); var self = this; - _yuitest_coverline("build/get/get.js", 718);+ _yuitest_coverline("build/get/get.js", 723); self.id = Transaction._lastId += 1;- _yuitest_coverline("build/get/get.js", 719);+ _yuitest_coverline("build/get/get.js", 724); self.data = options.data;- _yuitest_coverline("build/get/get.js", 720);+ _yuitest_coverline("build/get/get.js", 725); self.errors = [];- _yuitest_coverline("build/get/get.js", 721);+ _yuitest_coverline("build/get/get.js", 726); self.nodes = [];- _yuitest_coverline("build/get/get.js", 722);+ _yuitest_coverline("build/get/get.js", 727); self.options = options;- _yuitest_coverline("build/get/get.js", 723);+ _yuitest_coverline("build/get/get.js", 728); self.requests = requests; - _yuitest_coverline("build/get/get.js", 725);+ _yuitest_coverline("build/get/get.js", 730); self._callbacks = []; // callbacks to call after execution finishes- _yuitest_coverline("build/get/get.js", 726);+ _yuitest_coverline("build/get/get.js", 731); self._queue = [];- _yuitest_coverline("build/get/get.js", 727);-self._waiting = 0;+ _yuitest_coverline("build/get/get.js", 732);+self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties.- _yuitest_coverline("build/get/get.js", 730);+ _yuitest_coverline("build/get/get.js", 735); self.tId = self.id; // Use `id` instead.- _yuitest_coverline("build/get/get.js", 731);+ _yuitest_coverline("build/get/get.js", 736); self.win = options.win || Y.config.win; }; @@ -940,10 +945,10 @@ @protected @static **/-_yuitest_coverline("build/get/get.js", 792);+_yuitest_coverline("build/get/get.js", 797); Transaction._lastId = 0; -_yuitest_coverline("build/get/get.js", 794);+_yuitest_coverline("build/get/get.js", 799); Transaction.prototype = { // -- Public Properties ---------------------------------------------------- @@ -971,21 +976,21 @@ array describing why the transaction was aborted. **/ abort: function (msg) {- _yuitest_coverfunc("build/get/get.js", "abort", 820);-_yuitest_coverline("build/get/get.js", 821);+ _yuitest_coverfunc("build/get/get.js", "abort", 825);+_yuitest_coverline("build/get/get.js", 826); this._pending = null;- _yuitest_coverline("build/get/get.js", 822);+ _yuitest_coverline("build/get/get.js", 827); this._pendingCSS = null;- _yuitest_coverline("build/get/get.js", 823);+ _yuitest_coverline("build/get/get.js", 828); this._pollTimer = clearTimeout(this._pollTimer);- _yuitest_coverline("build/get/get.js", 824);+ _yuitest_coverline("build/get/get.js", 829); this._queue = [];- _yuitest_coverline("build/get/get.js", 825);-this._waiting = 0;+ _yuitest_coverline("build/get/get.js", 830);+this._reqsWaiting = 0; - _yuitest_coverline("build/get/get.js", 827);+ _yuitest_coverline("build/get/get.js", 832); this.errors.push({error: msg || 'Aborted'});- _yuitest_coverline("build/get/get.js", 828);+ _yuitest_coverline("build/get/get.js", 833); this._finish(); }, @@ -1008,62 +1013,65 @@ in the transaction are complete, or after the transaction is aborted. **/ execute: function (callback) {- _yuitest_coverfunc("build/get/get.js", "execute", 849);-_yuitest_coverline("build/get/get.js", 850);+ _yuitest_coverfunc("build/get/get.js", "execute", 854);+_yuitest_coverline("build/get/get.js", 855); var self = this, requests = self.requests, state = self._state, i, len, queue, req; - _yuitest_coverline("build/get/get.js", 855);+ _yuitest_coverline("build/get/get.js", 860); if (state === 'done') {- _yuitest_coverline("build/get/get.js", 856);+ _yuitest_coverline("build/get/get.js", 861); callback && callback(self.errors.length ? self.errors : null, self);- _yuitest_coverline("build/get/get.js", 857);+ _yuitest_coverline("build/get/get.js", 862); return; } else {- _yuitest_coverline("build/get/get.js", 859);+ _yuitest_coverline("build/get/get.js", 864); callback && self._callbacks.push(callback); - _yuitest_coverline("build/get/get.js", 861);+ _yuitest_coverline("build/get/get.js", 866); if (state === 'executing') {- _yuitest_coverline("build/get/get.js", 862);+ _yuitest_coverline("build/get/get.js", 867); return; } } - _yuitest_coverline("build/get/get.js", 866);+ _yuitest_coverline("build/get/get.js", 871); self._state = 'executing';- _yuitest_coverline("build/get/get.js", 867);+ _yuitest_coverline("build/get/get.js", 872); self._queue = queue = []; - _yuitest_coverline("build/get/get.js", 869);+ _yuitest_coverline("build/get/get.js", 874); if (self.options.timeout) {- _yuitest_coverline("build/get/get.js", 870);+ _yuitest_coverline("build/get/get.js", 875); self._timeout = setTimeout(function () {- _yuitest_coverfunc("build/get/get.js", "(anonymous 3)", 870);-_yuitest_coverline("build/get/get.js", 871);+ _yuitest_coverfunc("build/get/get.js", "(anonymous 2)", 875);+_yuitest_coverline("build/get/get.js", 876); self.abort('Timeout'); }, self.options.timeout); } - _yuitest_coverline("build/get/get.js", 875);+ _yuitest_coverline("build/get/get.js", 880);+self._reqsWaiting = requests.length;++ _yuitest_coverline("build/get/get.js", 882); for (i = 0, len = requests.length; i < len; ++i) {- _yuitest_coverline("build/get/get.js", 876);-req = self.requests[i];+ _yuitest_coverline("build/get/get.js", 883);+req = requests[i]; - _yuitest_coverline("build/get/get.js", 878);+ _yuitest_coverline("build/get/get.js", 885); if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.- _yuitest_coverline("build/get/get.js", 880);+ _yuitest_coverline("build/get/get.js", 887); self._insert(req); } else {- _yuitest_coverline("build/get/get.js", 882);+ _yuitest_coverline("build/get/get.js", 889); queue.push(req); } } - _yuitest_coverline("build/get/get.js", 886);+ _yuitest_coverline("build/get/get.js", 893); self._next(); }, @@ -1077,107 +1085,113 @@ @method purge **/ purge: function () {- _yuitest_coverfunc("build/get/get.js", "purge", 898);-_yuitest_coverline("build/get/get.js", 899);+ _yuitest_coverfunc("build/get/get.js", "purge", 905);+_yuitest_coverline("build/get/get.js", 906); Get._purge(this.nodes); }, // -- Protected Methods ---------------------------------------------------- _createNode: function (name, attrs, doc) {- _yuitest_coverfunc("build/get/get.js", "_createNode", 903);-_yuitest_coverline("build/get/get.js", 904);+ _yuitest_coverfunc("build/get/get.js", "_createNode", 910);+_yuitest_coverline("build/get/get.js", 911); var node = doc.createElement(name), attr, testEl; - _yuitest_coverline("build/get/get.js", 907);+ _yuitest_coverline("build/get/get.js", 914); if (!CUSTOM_ATTRS) { // IE6 and IE7 expect property names rather than attribute names for // certain attributes. Rather than sniffing, we do a quick feature // test the first time _createNode() runs to determine whether we // need to provide a workaround.- _yuitest_coverline("build/get/get.js", 912);+ _yuitest_coverline("build/get/get.js", 919); testEl = doc.createElement('div');- _yuitest_coverline("build/get/get.js", 913);+ _yuitest_coverline("build/get/get.js", 920); testEl.setAttribute('class', 'a'); - _yuitest_coverline("build/get/get.js", 915);+ _yuitest_coverline("build/get/get.js", 922); CUSTOM_ATTRS = testEl.className === 'a' ? {} : { 'for' : 'htmlFor', 'class': 'className' }; } - _yuitest_coverline("build/get/get.js", 921);+ _yuitest_coverline("build/get/get.js", 928); for (attr in attrs) {- _yuitest_coverline("build/get/get.js", 922);+ _yuitest_coverline("build/get/get.js", 929); if (attrs.hasOwnProperty(attr)) {- _yuitest_coverline("build/get/get.js", 923);+ _yuitest_coverline("build/get/get.js", 930); node.setAttribute(CUSTOM_ATTRS[attr] || attr, attrs[attr]); } } - _yuitest_coverline("build/get/get.js", 927);+ _yuitest_coverline("build/get/get.js", 934); return node; }, _finish: function () {- _yuitest_coverfunc("build/get/get.js", "_finish", 930);-_yuitest_coverline("build/get/get.js", 931);+ _yuitest_coverfunc("build/get/get.js", "_finish", 937);+_yuitest_coverline("build/get/get.js", 938); var errors = this.errors.length ? this.errors : null, options = this.options, thisObj = options.context || this, data, i, len; - _yuitest_coverline("build/get/get.js", 936);+ _yuitest_coverline("build/get/get.js", 943); if (this._state === 'done') {- _yuitest_coverline("build/get/get.js", 937);+ _yuitest_coverline("build/get/get.js", 944); return; } - _yuitest_coverline("build/get/get.js", 940);+ _yuitest_coverline("build/get/get.js", 947); this._state = 'done'; - _yuitest_coverline("build/get/get.js", 942);+ _yuitest_coverline("build/get/get.js", 949); for (i = 0, len = this._callbacks.length; i < len; ++i) {- _yuitest_coverline("build/get/get.js", 943);+ _yuitest_coverline("build/get/get.js", 950); this._callbacks[i].call(thisObj, errors, this); } - _yuitest_coverline("build/get/get.js", 946);+ _yuitest_coverline("build/get/get.js", 953); data = this._getEventData(); - _yuitest_coverline("build/get/get.js", 948);+ _yuitest_coverline("build/get/get.js", 955); if (errors) {- _yuitest_coverline("build/get/get.js", 949);+ _yuitest_coverline("build/get/get.js", 956); if (options.onTimeout && errors[errors.length - 1].error === 'Timeout') {- _yuitest_coverline("build/get/get.js", 950);+ _yuitest_coverline("build/get/get.js", 957); options.onTimeout.call(thisObj, data); } - _yuitest_coverline("build/get/get.js", 953);+ _yuitest_coverline("build/get/get.js", 960); if (options.onFailure) {- _yuitest_coverline("build/get/get.js", 954);+ _yuitest_coverline("build/get/get.js", 961); options.onFailure.call(thisObj, data); }- } else {_yuitest_coverline("build/get/get.js", 956);+ } else {_yuitest_coverline("build/get/get.js", 963); if (options.onSuccess) {- _yuitest_coverline("build/get/get.js", 957);+ _yuitest_coverline("build/get/get.js", 964); options.onSuccess.call(thisObj, data); }} - _yuitest_coverline("build/get/get.js", 960);+ _yuitest_coverline("build/get/get.js", 967); if (options.onEnd) {- _yuitest_coverline("build/get/get.js", 961);+ _yuitest_coverline("build/get/get.js", 968); options.onEnd.call(thisObj, data); }++ _yuitest_coverline("build/get/get.js", 971);+if (options._onFinish) {+ _yuitest_coverline("build/get/get.js", 972);+options._onFinish();+ } }, _getEventData: function (req) {- _yuitest_coverfunc("build/get/get.js", "_getEventData", 965);-_yuitest_coverline("build/get/get.js", 966);+ _yuitest_coverfunc("build/get/get.js", "_getEventData", 976);+_yuitest_coverline("build/get/get.js", 977); if (req) { // This merge is necessary for backcompat. I hate it.- _yuitest_coverline("build/get/get.js", 968);+ _yuitest_coverline("build/get/get.js", 979); return Y.merge(this, { abort : this.abort, // have to copy these because the prototype isn't preserved purge : this.purge,@@ -1186,68 +1200,68 @@ win : req.win }); } else {- _yuitest_coverline("build/get/get.js", 976);+ _yuitest_coverline("build/get/get.js", 987); return this; } }, _getInsertBefore: function (req) {- _yuitest_coverfunc("build/get/get.js", "_getInsertBefore", 980);-_yuitest_coverline("build/get/get.js", 981);+ _yuitest_coverfunc("build/get/get.js", "_getInsertBefore", 991);+_yuitest_coverline("build/get/get.js", 992); var doc = req.doc, el = req.insertBefore, cache, cachedNode, docStamp; - _yuitest_coverline("build/get/get.js", 985);+ _yuitest_coverline("build/get/get.js", 996); if (el) {- _yuitest_coverline("build/get/get.js", 986);+ _yuitest_coverline("build/get/get.js", 997); return typeof el === 'string' ? doc.getElementById(el) : el; } - _yuitest_coverline("build/get/get.js", 989);+ _yuitest_coverline("build/get/get.js", 1000); cache = Get._insertCache;- _yuitest_coverline("build/get/get.js", 990);+ _yuitest_coverline("build/get/get.js", 1001); docStamp = Y.stamp(doc); - _yuitest_coverline("build/get/get.js", 992);+ _yuitest_coverline("build/get/get.js", 1003); if ((el = cache[docStamp])) { // assignment- _yuitest_coverline("build/get/get.js", 993);+ _yuitest_coverline("build/get/get.js", 1004); return el; } // Inserting before a <base> tag apparently works around an IE bug // (according to a comment from pre-3.5.0 Y.Get), but I'm not sure what // bug that is, exactly. Better safe than sorry?- _yuitest_coverline("build/get/get.js", 999);+ _yuitest_coverline("build/get/get.js", 1010); if ((el = doc.getElementsByTagName('base')[0])) { // assignment- _yuitest_coverline("build/get/get.js", 1000);+ _yuitest_coverline("build/get/get.js", 1011); return (cache[docStamp] = el); } // Look for a <head> element.- _yuitest_coverline("build/get/get.js", 1004);+ _yuitest_coverline("build/get/get.js", 1015); el = doc.head || doc.getElementsByTagName('head')[0]; - _yuitest_coverline("build/get/get.js", 1006);+ _yuitest_coverline("build/get/get.js", 1017); if (el) { // Create a marker node at the end of <head> to use as an insertion // point. Inserting before this node will ensure that all our CSS // gets inserted in the correct order, to maintain style precedence.- _yuitest_coverline("build/get/get.js", 1010);+ _yuitest_coverline("build/get/get.js", 1021); el.appendChild(doc.createTextNode(''));- _yuitest_coverline("build/get/get.js", 1011);+ _yuitest_coverline("build/get/get.js", 1022); return (cache[docStamp] = el.lastChild); } // If all else fails, just insert before the first script node on the // page, which is virtually guaranteed to exist.- _yuitest_coverline("build/get/get.js", 1016);+ _yuitest_coverline("build/get/get.js", 1027); return (cache[docStamp] = doc.getElementsByTagName('script')[0]); }, _insert: function (req) {- _yuitest_coverfunc("build/get/get.js", "_insert", 1019);-_yuitest_coverline("build/get/get.js", 1020);+ _yuitest_coverfunc("build/get/get.js", "_insert", 1030);+_yuitest_coverline("build/get/get.js", 1031); var env = Get._env, insertBefore = this._getInsertBefore(req), isScript = req.type === 'js',@@ -1256,82 +1270,81 @@ ua = Y.UA, cssTimeout, nodeType; - _yuitest_coverline("build/get/get.js", 1028);+ _yuitest_coverline("build/get/get.js", 1039); if (!node) {- _yuitest_coverline("build/get/get.js", 1029);+ _yuitest_coverline("build/get/get.js", 1040); if (isScript) {- _yuitest_coverline("build/get/get.js", 1030);+ _yuitest_coverline("build/get/get.js", 1041); nodeType = 'script';- } else {_yuitest_coverline("build/get/get.js", 1031);+ } else {_yuitest_coverline("build/get/get.js", 1042); if (!env.cssLoad && ua.gecko) {- _yuitest_coverline("build/get/get.js", 1032);+ _yuitest_coverline("build/get/get.js", 1043); nodeType = 'style'; } else {- _yuitest_coverline("build/get/get.js", 1034);+ _yuitest_coverline("build/get/get.js", 1045); nodeType = 'link'; }} - _yuitest_coverline("build/get/get.js", 1037);+ _yuitest_coverline("build/get/get.js", 1048); node = req.node = this._createNode(nodeType, req.attributes, req.doc); } - _yuitest_coverline("build/get/get.js", 1041);+ _yuitest_coverline("build/get/get.js", 1052); function onError() {- _yuitest_coverfunc("build/get/get.js", "onError", 1041);-_yuitest_coverline("build/get/get.js", 1042);+ _yuitest_coverfunc("build/get/get.js", "onError", 1052);+_yuitest_coverline("build/get/get.js", 1053); self._progress('Failed to load ' + req.url, req); } - _yuitest_coverline("build/get/get.js", 1045);+ _yuitest_coverline("build/get/get.js", 1056); function onLoad() {- _yuitest_coverfunc("build/get/get.js", "onLoad", 1045);-_yuitest_coverline("build/get/get.js", 1046);+ _yuitest_coverfunc("build/get/get.js", "onLoad", 1056);+_yuitest_coverline("build/get/get.js", 1057); if (cssTimeout) {- _yuitest_coverline("build/get/get.js", 1047);+ _yuitest_coverline("build/get/get.js", 1058); clearTimeout(cssTimeout); } - _yuitest_coverline("build/get/get.js", 1050);+ _yuitest_coverline("build/get/get.js", 1061); self._progress(null, req); } - // Deal with script asynchronicity.- _yuitest_coverline("build/get/get.js", 1055);+ _yuitest_coverline("build/get/get.js", 1065); if (isScript) {- _yuitest_coverline("build/get/get.js", 1056);+ _yuitest_coverline("build/get/get.js", 1066); node.setAttribute('src', req.url); - _yuitest_coverline("build/get/get.js", 1058);+ _yuitest_coverline("build/get/get.js", 1068); if (req.async) { // Explicitly indicate that we want the browser to execute this // script asynchronously. This is necessary for older browsers // like Firefox <4.- _yuitest_coverline("build/get/get.js", 1062);+ _yuitest_coverline("build/get/get.js", 1072); node.async = true; } else {- _yuitest_coverline("build/get/get.js", 1064);+ _yuitest_coverline("build/get/get.js", 1074); if (env.async) { // This browser treats injected scripts as async by default // (standard HTML5 behavior) but asynchronous loading isn't // desired, so tell the browser not to mark this script as // async.- _yuitest_coverline("build/get/get.js", 1069);+ _yuitest_coverline("build/get/get.js", 1079); node.async = false; } // If this browser doesn't preserve script execution order based // on insertion order, we'll need to avoid inserting other // scripts until this one finishes loading.- _yuitest_coverline("build/get/get.js", 1075);+ _yuitest_coverline("build/get/get.js", 1085); if (!env.preservesScriptOrder) {- _yuitest_coverline("build/get/get.js", 1076);+ _yuitest_coverline("build/get/get.js", 1086); this._pending = req; } } } else {- _yuitest_coverline("build/get/get.js", 1080);+ _yuitest_coverline("build/get/get.js", 1090); if (!env.cssLoad && ua.gecko) { // In Firefox <9, we can import the requested URL into a <style> // node and poll for the existence of node.sheet.cssRules. This@@ -1340,67 +1353,82 @@ // // Props to Zach Leatherman for calling my attention to this // technique.- _yuitest_coverline("build/get/get.js", 1088);+ _yuitest_coverline("build/get/get.js", 1098); node.innerHTML = (req.attributes.charset ? '@charset "' + req.attributes.charset + '";' : '') + '@import "' + req.url + '";'; } else {- _yuitest_coverline("build/get/get.js", 1092);+ _yuitest_coverline("build/get/get.js", 1102); node.setAttribute('href', req.url); } } // Inject the node.- _yuitest_coverline("build/get/get.js", 1097);+ _yuitest_coverline("build/get/get.js", 1107); if (isScript && ua.ie && (ua.ie < 9 || (document.documentMode && document.documentMode < 9))) { // Script on IE < 9, and IE 9+ when in IE 8 or older modes, including quirks mode.- _yuitest_coverline("build/get/get.js", 1099);+ _yuitest_coverline("build/get/get.js", 1109); node.onreadystatechange = function () {- _yuitest_coverfunc("build/get/get.js", "onreadystatechange", 1099);-_yuitest_coverline("build/get/get.js", 1100);+ _yuitest_coverfunc("build/get/get.js", "onreadystatechange", 1109);+_yuitest_coverline("build/get/get.js", 1110); if (/loaded|complete/.test(node.readyState)) {- _yuitest_coverline("build/get/get.js", 1101);+ _yuitest_coverline("build/get/get.js", 1111); node.onreadystatechange = null;- _yuitest_coverline("build/get/get.js", 1102);+ _yuitest_coverline("build/get/get.js", 1112); onLoad(); } };- } else {_yuitest_coverline("build/get/get.js", 1105);+ } else {_yuitest_coverline("build/get/get.js", 1115); if (!isScript && !env.cssLoad) { // CSS on Firefox <9 or WebKit.- _yuitest_coverline("build/get/get.js", 1107);+ _yuitest_coverline("build/get/get.js", 1117); this._poll(req); } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- _yuitest_coverline("build/get/get.js", 1111);++ _yuitest_coverline("build/get/get.js", 1122);+if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ _yuitest_coverline("build/get/get.js", 1130);+node.onerror = function() { _yuitest_coverfunc("build/get/get.js", "onerror", 1130);+setTimeout(onError, 0); };+ _yuitest_coverline("build/get/get.js", 1131);+node.onload = function() { _yuitest_coverfunc("build/get/get.js", "onload", 1131);+setTimeout(onLoad, 0); };+ } else {+ _yuitest_coverline("build/get/get.js", 1133); node.onerror = onError;- _yuitest_coverline("build/get/get.js", 1112);+ _yuitest_coverline("build/get/get.js", 1134); node.onload = onLoad;+ } // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue.- _yuitest_coverline("build/get/get.js", 1116);+ _yuitest_coverline("build/get/get.js", 1139); if (!env.cssFail && !isScript) {- _yuitest_coverline("build/get/get.js", 1117);+ _yuitest_coverline("build/get/get.js", 1140); cssTimeout = setTimeout(onError, req.timeout || 3000); } }} - _yuitest_coverline("build/get/get.js", 1121);-this._waiting += 1;-- _yuitest_coverline("build/get/get.js", 1123);+ _yuitest_coverline("build/get/get.js", 1144); this.nodes.push(node);- _yuitest_coverline("build/get/get.js", 1124);+ _yuitest_coverline("build/get/get.js", 1145); insertBefore.parentNode.insertBefore(node, insertBefore); }, _next: function () {- _yuitest_coverfunc("build/get/get.js", "_next", 1127);-_yuitest_coverline("build/get/get.js", 1128);+ _yuitest_coverfunc("build/get/get.js", "_next", 1148);+_yuitest_coverline("build/get/get.js", 1149); if (this._pending) {- _yuitest_coverline("build/get/get.js", 1129);+ _yuitest_coverline("build/get/get.js", 1150); return; } @@ -1408,74 +1436,74 @@ // Otherwise, if we're waiting on already-inserted requests to finish, // wait longer. If there are no queued requests and we're not waiting // for anything to load, then we're done!- _yuitest_coverline("build/get/get.js", 1136);+ _yuitest_coverline("build/get/get.js", 1157); if (this._queue.length) {- _yuitest_coverline("build/get/get.js", 1137);+ _yuitest_coverline("build/get/get.js", 1158); this._insert(this._queue.shift());- } else {_yuitest_coverline("build/get/get.js", 1138);-if (!this._waiting) {- _yuitest_coverline("build/get/get.js", 1139);+ } else {_yuitest_coverline("build/get/get.js", 1159);+if (!this._reqsWaiting) {+ _yuitest_coverline("build/get/get.js", 1160); this._finish(); }} }, _poll: function (newReq) {- _yuitest_coverfunc("build/get/get.js", "_poll", 1143);-_yuitest_coverline("build/get/get.js", 1144);+ _yuitest_coverfunc("build/get/get.js", "_poll", 1164);+_yuitest_coverline("build/get/get.js", 1165); var self = this, pendingCSS = self._pendingCSS, isWebKit = Y.UA.webkit, i, hasRules, j, nodeHref, req, sheets; - _yuitest_coverline("build/get/get.js", 1149);+ _yuitest_coverline("build/get/get.js", 1170); if (newReq) {- _yuitest_coverline("build/get/get.js", 1150);+ _yuitest_coverline("build/get/get.js", 1171); pendingCSS || (pendingCSS = self._pendingCSS = []);- _yuitest_coverline("build/get/get.js", 1151);+ _yuitest_coverline("build/get/get.js", 1172); pendingCSS.push(newReq); - _yuitest_coverline("build/get/get.js", 1153);+ _yuitest_coverline("build/get/get.js", 1174); if (self._pollTimer) { // A poll timeout is already pending, so no need to create a // new one.- _yuitest_coverline("build/get/get.js", 1156);+ _yuitest_coverline("build/get/get.js", 1177); return; } } - _yuitest_coverline("build/get/get.js", 1160);+ _yuitest_coverline("build/get/get.js", 1181); self._pollTimer = null; // Note: in both the WebKit and Gecko hacks below, a CSS URL that 404s // will still be treated as a success. There's no good workaround for // this. - _yuitest_coverline("build/get/get.js", 1166);+ _yuitest_coverline("build/get/get.js", 1187); for (i = 0; i < pendingCSS.length; ++i) {- _yuitest_coverline("build/get/get.js", 1167);+ _yuitest_coverline("build/get/get.js", 1188); req = pendingCSS[i]; - _yuitest_coverline("build/get/get.js", 1169);+ _yuitest_coverline("build/get/get.js", 1190); if (isWebKit) { // Look for a stylesheet matching the pending URL.- _yuitest_coverline("build/get/get.js", 1171);+ _yuitest_coverline("build/get/get.js", 1192); sheets = req.doc.styleSheets;- _yuitest_coverline("build/get/get.js", 1172);+ _yuitest_coverline("build/get/get.js", 1193); j = sheets.length;- _yuitest_coverline("build/get/get.js", 1173);+ _yuitest_coverline("build/get/get.js", 1194); nodeHref = req.node.href; - _yuitest_coverline("build/get/get.js", 1175);+ _yuitest_coverline("build/get/get.js", 1196); while (--j >= 0) {- _yuitest_coverline("build/get/get.js", 1176);+ _yuitest_coverline("build/get/get.js", 1197); if (sheets[j].href === nodeHref) {- _yuitest_coverline("build/get/get.js", 1177);+ _yuitest_coverline("build/get/get.js", 1198); pendingCSS.splice(i, 1);- _yuitest_coverline("build/get/get.js", 1178);+ _yuitest_coverline("build/get/get.js", 1199); i -= 1;- _yuitest_coverline("build/get/get.js", 1179);+ _yuitest_coverline("build/get/get.js", 1200); self._progress(null, req);- _yuitest_coverline("build/get/get.js", 1180);+ _yuitest_coverline("build/get/get.js", 1201); break; } }@@ -1486,20 +1514,20 @@ // // See Zach's blog for more details: // http://www.zachleat.com/web/2010/07/29/load-css-dynamically/- _yuitest_coverline("build/get/get.js", 1190);+ _yuitest_coverline("build/get/get.js", 1211); try { // We don't really need to store this value since we never // use it again, but if we don't store it, Closure Compiler // assumes the code is useless and removes it.- _yuitest_coverline("build/get/get.js", 1194);+ _yuitest_coverline("build/get/get.js", 1215); hasRules = !!req.node.sheet.cssRules; // If we get here, the stylesheet has loaded.- _yuitest_coverline("build/get/get.js", 1197);+ _yuitest_coverline("build/get/get.js", 1218); pendingCSS.splice(i, 1);- _yuitest_coverline("build/get/get.js", 1198);+ _yuitest_coverline("build/get/get.js", 1219); i -= 1;- _yuitest_coverline("build/get/get.js", 1199);+ _yuitest_coverline("build/get/get.js", 1220); self._progress(null, req); } catch (ex) { // An exception means the stylesheet is still loading.@@ -1507,28 +1535,28 @@ } } - _yuitest_coverline("build/get/get.js", 1206);+ _yuitest_coverline("build/get/get.js", 1227); if (pendingCSS.length) {- _yuitest_coverline("build/get/get.js", 1207);+ _yuitest_coverline("build/get/get.js", 1228); self._pollTimer = setTimeout(function () {- _yuitest_coverfunc("build/get/get.js", "(anonymous 4)", 1207);-_yuitest_coverline("build/get/get.js", 1208);+ _yuitest_coverfunc("build/get/get.js", "(anonymous 3)", 1228);+_yuitest_coverline("build/get/get.js", 1229); self._poll.call(self); }, self.options.pollInterval); } }, _progress: function (err, req) {- _yuitest_coverfunc("build/get/get.js", "_progress", 1213);-_yuitest_coverline("build/get/get.js", 1214);+ _yuitest_coverfunc("build/get/get.js", "_progress", 1234);+_yuitest_coverline("build/get/get.js", 1235); var options = this.options; - _yuitest_coverline("build/get/get.js", 1216);+ _yuitest_coverline("build/get/get.js", 1237); if (err) {- _yuitest_coverline("build/get/get.js", 1217);+ _yuitest_coverline("build/get/get.js", 1238); req.error = err; - _yuitest_coverline("build/get/get.js", 1219);+ _yuitest_coverline("build/get/get.js", 1240); this.errors.push({ error : err, request: req@@ -1536,39 +1564,40 @@ } - _yuitest_coverline("build/get/get.js", 1226);+ _yuitest_coverline("build/get/get.js", 1247); req.node._yuiget_finished = req.finished = true; - _yuitest_coverline("build/get/get.js", 1228);+ _yuitest_coverline("build/get/get.js", 1249); if (options.onProgress) {- _yuitest_coverline("build/get/get.js", 1229);+ _yuitest_coverline("build/get/get.js", 1250); options.onProgress.call(options.context || this, this._getEventData(req)); } - _yuitest_coverline("build/get/get.js", 1233);+ _yuitest_coverline("build/get/get.js", 1254); if (req.autopurge) { // Pre-3.5.0 Get always excludes the most recent node from an // autopurge. I find this odd, but I'm keeping that behavior for // the sake of backcompat.- _yuitest_coverline("build/get/get.js", 1237);+ _yuitest_coverline("build/get/get.js", 1258); Get._autoPurge(this.options.purgethreshold);- _yuitest_coverline("build/get/get.js", 1238);+ _yuitest_coverline("build/get/get.js", 1259); Get._purgeNodes.push(req.node); } - _yuitest_coverline("build/get/get.js", 1241);+ _yuitest_coverline("build/get/get.js", 1262); if (this._pending === req) {- _yuitest_coverline("build/get/get.js", 1242);+ _yuitest_coverline("build/get/get.js", 1263); this._pending = null; } - _yuitest_coverline("build/get/get.js", 1245);-this._waiting -= 1;- _yuitest_coverline("build/get/get.js", 1246);+ _yuitest_coverline("build/get/get.js", 1266);+this._reqsWaiting -= 1;++ _yuitest_coverline("build/get/get.js", 1268); this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/get/get-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -529,14 +529,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -553,7 +557,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -647,6 +651,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -663,6 +669,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -674,13 +685,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -746,7 +751,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -844,7 +849,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -894,8 +899,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -982,6 +989,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -1072,7 +1083,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -1130,9 +1140,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -1140,8 +1163,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -1157,7 +1178,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -1265,10 +1286,11 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/get/get-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!n.gecko||!!n.opera}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var i;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,this._env||this._getEnv(),i=this._getTransaction(t,n),this._queue.push({callback:r,transaction:i}),this._next(),i},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(function(){e.callback&&e.callback.apply(this,arguments),i._pending=null,i._next()}))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._waiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._waiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout));for(i=0,s=n.length;i<s;++i)u=t.requests[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r)},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(o.onerror=c,o.onload=h,!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this._waiting+=1,this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._waiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._waiting-=1,this._next()}}},"3.7.2",{requires:["yui-base"]});+YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.7.3",{requires:["yui-base"]});
bundle/get/get.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -517,14 +517,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -541,7 +545,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -631,6 +635,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -647,6 +653,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -658,13 +669,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -730,7 +735,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -828,7 +833,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -878,8 +883,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -966,6 +973,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -1056,7 +1067,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -1114,9 +1124,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -1124,8 +1147,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -1141,7 +1162,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -1248,10 +1269,11 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/graphics-canvas-default/graphics-canvas-default-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics-canvas-default/graphics-canvas-default.js", code: [] };-_yuitest_coverage["build/graphics-canvas-default/graphics-canvas-default.js"].code=["YUI.add('graphics-canvas-default', function (Y, NAME) {","","Y.Graphic = Y.CanvasGraphic;","Y.Shape = Y.CanvasShape;","Y.Circle = Y.CanvasCircle;","Y.Rect = Y.CanvasRect;","Y.Ellipse = Y.CanvasEllipse;","Y.Path = Y.CanvasPath;","Y.Drawing = Y.CanvasDrawing;","","","}, '3.7.2');"];+_yuitest_coverage["build/graphics-canvas-default/graphics-canvas-default.js"].code=["YUI.add('graphics-canvas-default', function (Y, NAME) {","","Y.Graphic = Y.CanvasGraphic;","Y.Shape = Y.CanvasShape;","Y.Circle = Y.CanvasCircle;","Y.Rect = Y.CanvasRect;","Y.Ellipse = Y.CanvasEllipse;","Y.Path = Y.CanvasPath;","Y.Drawing = Y.CanvasDrawing;","","","}, '3.7.3');"]; _yuitest_coverage["build/graphics-canvas-default/graphics-canvas-default.js"].lines = {"1":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0}; _yuitest_coverage["build/graphics-canvas-default/graphics-canvas-default.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/graphics-canvas-default/graphics-canvas-default.js"].coveredLines = 8;@@ -57,4 +57,4 @@ Y.Drawing = Y.CanvasDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-canvas-default/graphics-canvas-default-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,4 +15,4 @@ Y.Drawing = Y.CanvasDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-canvas-default/graphics-canvas-default-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics-canvas-default",function(e,t){e.Graphic=e.CanvasGraphic,e.Shape=e.CanvasShape,e.Circle=e.CanvasCircle,e.Rect=e.CanvasRect,e.Ellipse=e.CanvasEllipse,e.Path=e.CanvasPath,e.Drawing=e.CanvasDrawing},"3.7.2");+YUI.add("graphics-canvas-default",function(e,t){e.Graphic=e.CanvasGraphic,e.Shape=e.CanvasShape,e.Circle=e.CanvasCircle,e.Rect=e.CanvasRect,e.Ellipse=e.CanvasEllipse,e.Path=e.CanvasPath,e.Drawing=e.CanvasDrawing},"3.7.3");
bundle/graphics-canvas-default/graphics-canvas-default.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,4 +15,4 @@ Y.Drawing = Y.CanvasDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-canvas/graphics-canvas-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics-canvas/graphics-canvas.js", code: [] };-_yuitest_coverage["build/graphics-canvas/graphics-canvas.js"].code=["YUI.add('graphics-canvas', function (Y, NAME) {","","var IMPLEMENTATION = \"canvas\","," SHAPE = \"shape\","," SPLITPATHPATTERN = /[a-z][^a-z]*/ig,"," SPLITARGSPATTERN = /[-]?[0-9]*[0-9|\\.][0-9]*/g,"," DOCUMENT = Y.config.doc,"," Y_LANG = Y.Lang,"," AttributeLite = Y.AttributeLite,"," CanvasShape,"," CanvasPath,"," CanvasRect,"," CanvasEllipse,"," CanvasCircle,"," CanvasPieSlice,"," Y_DOM = Y.DOM,"," Y_Color = Y.Color,"," PARSE_INT = parseInt,"," PARSE_FLOAT = parseFloat,"," IS_NUMBER = Y_LANG.isNumber,"," RE = RegExp,"," TORGB = Y_Color.toRGB,"," TOHEX = Y_Color.toHex,"," _getClassName = Y.ClassNameManager.getClassName;","","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Drawing.html\">`Drawing`</a> class. "," * `CanvasDrawing` is not intended to be used directly. Instead, use the <a href=\"Drawing.html\">`Drawing`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Drawing.html\">`Drawing`</a> "," * class will point to the `CanvasDrawing` class."," *"," * @module graphics"," * @class CanvasDrawing"," * @constructor"," */","function CanvasDrawing()","{","}","","CanvasDrawing.prototype = {"," /**"," * Maps path to methods"," *"," * @property _pathSymbolToMethod"," * @type Object"," * @private"," */"," _pathSymbolToMethod: {"," M: \"moveTo\","," m: \"relativeMoveTo\","," L: \"lineTo\","," l: \"relativeLineTo\","," C: \"curveTo\","," c: \"relativeCurveTo\","," Q: \"quadraticCurveTo\","," q: \"relativeQuadraticCurveTo\","," z: \"closePath\","," Z: \"closePath\""," },",""," /**"," * Current x position of the drawing."," *"," * @property _currentX"," * @type Number"," * @private"," */"," _currentX: 0,",""," /**"," * Current y position of the drqwing."," *"," * @property _currentY"," * @type Number"," * @private"," */"," _currentY: 0,"," "," /**"," * Parses hex color string and alpha value to rgba"," *"," * @method _toRGBA"," * @param {Object} val Color value to parse. Can be hex string, rgb or name."," * @param {Number} alpha Numeric value between 0 and 1 representing the alpha level."," * @private"," */"," _toRGBA: function(val, alpha) {"," alpha = (alpha !== undefined) ? alpha : 1;"," if (!Y_Color.re_RGB.test(val)) {"," val = TOHEX(val);"," }",""," if(Y_Color.re_hex.exec(val)) {"," val = 'rgba(' + ["," PARSE_INT(RE.$1, 16),"," PARSE_INT(RE.$2, 16),"," PARSE_INT(RE.$3, 16)"," ].join(',') + ',' + alpha + ')';"," }"," return val;"," },",""," /**"," * Converts color to rgb format"," *"," * @method _toRGB"," * @param val Color value to convert."," * @private "," */"," _toRGB: function(val) {"," return TORGB(val);"," },",""," /**"," * Sets the size of the graphics object."," * "," * @method setSize"," * @param w {Number} width to set for the instance."," * @param h {Number} height to set for the instance."," * @private"," */"," setSize: function(w, h) {"," if(this.get(\"autoSize\"))"," {"," if(w > this.node.getAttribute(\"width\"))"," {"," this.node.style.width = w + \"px\";"," this.node.setAttribute(\"width\", w);"," }"," if(h > this.node.getAttribute(\"height\"))"," {"," this.node.style.height = h + \"px\";"," this.node.setAttribute(\"height\", h);"," }"," }"," },"," "," /**"," * Tracks coordinates. Used to calculate the start point of dashed lines. "," *"," * @method _updateCoords"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @private"," */"," _updateCoords: function(x, y)"," {"," this._xcoords.push(x);"," this._ycoords.push(y);"," this._currentX = x;"," this._currentY = y;"," },",""," /**"," * Clears the coordinate arrays. Called at the end of a drawing operation. "," * "," * @method _clearAndUpdateCoords"," * @private"," */"," _clearAndUpdateCoords: function()"," {"," var x = this._xcoords.pop() || 0,"," y = this._ycoords.pop() || 0;"," this._updateCoords(x, y);"," },",""," /**"," * Moves the shape's dom node."," *"," * @method _updateNodePosition"," * @private"," */"," _updateNodePosition: function()"," {"," var node = this.get(\"node\"),"," x = this.get(\"x\"),"," y = this.get(\"y\"); "," node.style.position = \"absolute\";"," node.style.left = (x + this._left) + \"px\";"," node.style.top = (y + this._top) + \"px\";"," },"," "," /**"," * Queues up a method to be executed when a shape redraws."," *"," * @method _updateDrawingQueue"," * @param {Array} val An array containing data that can be parsed into a method and arguments. The value at zero-index of the array is a string reference of"," * the drawing method that will be called. All subsequent indices are argument for that method. For example, `lineTo(10, 100)` would be structured as:"," * `[\"lineTo\", 10, 100]`."," * @private"," */"," _updateDrawingQueue: function(val)"," {"," this._methods.push(val);"," },"," "," /**"," * Draws a line segment from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," lineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a line segment from the current drawing position to the relative x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," relativeLineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements lineTo methods."," *"," * @method _lineTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _lineTo: function(args, relative) "," {"," var point1 = args[0], "," i, "," len,"," x,"," y,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," if(!this._lineToMethods)"," {"," this._lineToMethods = [];"," }"," len = args.length - 1;"," if (typeof point1 === 'string' || typeof point1 === 'number') {"," for (i = 0; i < len; i = i + 2) {"," x = parseFloat(args[i]);"," y = parseFloat(args[i + 1]);"," x = x + relativeX;"," y = y + relativeY;"," this._updateDrawingQueue([\"lineTo\", x, y]);"," this._trackSize(x - wt, y - wt);"," this._trackSize(x + wt, y + wt);"," this._updateCoords(x, y);"," }"," }"," else"," {"," for (i = 0; i < len; i = i + 1) "," {"," x = parseFloat(args[i][0]);"," y = parseFloat(args[i][1]);"," this._updateDrawingQueue([\"lineTo\", x, y]);"," this._lineToMethods[this._lineToMethods.length] = this._methods[this._methods.length - 1];"," this._trackSize(x - wt, y - wt);"," this._trackSize(x + wt, y + wt);"," this._updateCoords(x, y);"," }"," }"," this._drawingComplete = false;"," return this;"," },",""," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," moveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Moves the current drawing position relative to specified x and y coordinates."," *"," * @method relativeMoveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeMoveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements moveTo methods."," *"," * @method _moveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _moveTo: function(args, relative) {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0,"," x = parseFloat(args[0]) + relativeX,"," y = parseFloat(args[1]) + relativeY;"," this._updateDrawingQueue([\"moveTo\", x, y]);"," this._trackSize(x - wt, y - wt);"," this._trackSize(x + wt, y + wt);"," this._updateCoords(x, y);"," this._drawingComplete = false;"," return this;"," },"," "," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," curveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a bezier curve relative to the current coordinates."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeCurveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), true]);"," },"," "," /**"," * Implements curveTo methods."," *"," * @method _curveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _curveTo: function(args, relative) {"," var w,"," h,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," x,"," y,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," len = args.length - 5;"," for(i = 0; i < len; i = i + 6)"," {"," cp1x = parseFloat(args[i]) + relativeX;"," cp1y = parseFloat(args[i + 1]) + relativeY;"," cp2x = parseFloat(args[i + 2]) + relativeX;"," cp2y = parseFloat(args[i + 3]) + relativeY;"," x = parseFloat(args[i + 4]) + relativeX;"," y = parseFloat(args[i + 5]) + relativeY;"," this._updateDrawingQueue([\"bezierCurveTo\", cp1x, cp1y, cp2x, cp2y, x, y]);"," this._drawingComplete = false;"," right = Math.max(x, Math.max(cp1x, cp2x));"," bottom = Math.max(y, Math.max(cp1y, cp2y));"," left = Math.min(x, Math.min(cp1x, cp2x));"," top = Math.min(y, Math.min(cp1y, cp2y));"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cp1x, cp1y], [cp2x, cp2y], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," },",""," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," quadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a quadratic bezier curve relative to the current position."," *"," * @method relativeQuadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeQuadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements quadraticCurveTo methods."," *"," * @method _quadraticCurveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _quadraticCurveTo: function(args, relative) {"," var cpx, "," cpy, "," x, "," y,"," w,"," h,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len = args.length - 3,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," for(i = 0; i < len; i = i + 4)"," {"," cpx = parseFloat(args[i]) + relativeX;"," cpy = parseFloat(args[i + 1]) + relativeY;"," x = parseFloat(args[i + 2]) + relativeX;"," y = parseFloat(args[i + 3]) + relativeY;"," this._drawingComplete = false;"," right = Math.max(x, cpx);"," bottom = Math.max(y, cpy);"," left = Math.min(x, cpx);"," top = Math.min(y, cpy);"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cpx, cpy], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._updateDrawingQueue([\"quadraticCurveTo\", cpx, cpy, x, y]);"," this._updateCoords(x, y);"," }"," return this;"," },",""," /**"," * Draws a circle. Used internally by `CanvasCircle` class."," *"," * @method drawCircle"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} r radius"," * @protected"," */"," drawCircle: function(x, y, radius) {"," var startAngle = 0,"," endAngle = 2 * Math.PI,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," circum = radius * 2;"," circum += wt;"," this._drawingComplete = false;"," this._trackSize(x + circum, y + circum);"," this._trackSize(x - wt, y - wt);"," this._updateCoords(x, y);"," this._updateDrawingQueue([\"arc\", x + radius, y + radius, radius, startAngle, endAngle, false]);"," return this;"," },",""," /**"," * Draws a diamond. "," * "," * @method drawDiamond"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} width width"," * @param {Number} height height"," * @protected"," */"," drawDiamond: function(x, y, width, height)"," {"," var midWidth = width * 0.5,"," midHeight = height * 0.5;"," this.moveTo(x + midWidth, y);"," this.lineTo(x + width, y + midHeight);"," this.lineTo(x + midWidth, y + height);"," this.lineTo(x, y + midHeight);"," this.lineTo(x + midWidth, y);"," return this;"," },",""," /**"," * Draws an ellipse. Used internally by `CanvasEllipse` class."," *"," * @method drawEllipse"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @protected"," */"," drawEllipse: function(x, y, w, h) {"," var l = 8,"," theta = -(45/180) * Math.PI,"," angle = 0,"," angleMid,"," radius = w/2,"," yRadius = h/2,"," i,"," centerX = x + radius,"," centerY = y + yRadius,"," ax, ay, bx, by, cx, cy,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0;",""," ax = centerX + Math.cos(0) * radius;"," ay = centerY + Math.sin(0) * yRadius;"," this.moveTo(ax, ay);"," for(i = 0; i < l; i++)"," {"," angle += theta;"," angleMid = angle - (theta / 2);"," bx = centerX + Math.cos(angle) * radius;"," by = centerY + Math.sin(angle) * yRadius;"," cx = centerX + Math.cos(angleMid) * (radius / Math.cos(theta / 2));"," cy = centerY + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));"," this._updateDrawingQueue([\"quadraticCurveTo\", cx, cy, bx, by]);"," }"," this._trackSize(x + w + wt, y + h + wt);"," this._trackSize(x - wt, y - wt);"," this._updateCoords(x, y);"," return this;"," },",""," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," drawRect: function(x, y, w, h) {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0;"," this._drawingComplete = false;"," this.moveTo(x, y);"," this.lineTo(x + w, y);"," this.lineTo(x + w, y + h);"," this.lineTo(x, y + h);"," this.lineTo(x, y);"," return this;"," },",""," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," drawRoundRect: function(x, y, w, h, ew, eh) {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0;"," this._drawingComplete = false;"," this.moveTo( x, y + eh);"," this.lineTo(x, y + h - eh);"," this.quadraticCurveTo(x, y + h, x + ew, y + h);"," this.lineTo(x + w - ew, y + h);"," this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);"," this.lineTo(x + w, y + eh);"," this.quadraticCurveTo(x + w, y, x + w - ew, y);"," this.lineTo(x + ew, y);"," this.quadraticCurveTo(x, y, x, y + eh);"," return this;"," },"," "," /**"," * Draws a wedge."," *"," * @method drawWedge"," * @param {Number} x x-coordinate of the wedge's center point"," * @param {Number} y y-coordinate of the wedge's center point"," * @param {Number} startAngle starting angle in degrees"," * @param {Number} arc sweep of the wedge. Negative values draw clockwise."," * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius."," * @param {Number} yRadius [optional] y radius for wedge."," * @private"," */"," drawWedge: function(x, y, startAngle, arc, radius, yRadius)"," {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," segs,"," segAngle,"," theta,"," angle,"," angleMid,"," ax,"," ay,"," bx,"," by,"," cx,"," cy,"," i = 0;"," yRadius = yRadius || radius;",""," this._drawingComplete = false;"," // move to x,y position"," this._updateDrawingQueue([\"moveTo\", x, y]);"," "," yRadius = yRadius || radius;"," "," // limit sweep to reasonable numbers"," if(Math.abs(arc) > 360)"," {"," arc = 360;"," }"," "," // First we calculate how many segments are needed"," // for a smooth arc."," segs = Math.ceil(Math.abs(arc) / 45);"," "," // Now calculate the sweep of each segment."," segAngle = arc / segs;"," "," // The math requires radians rather than degrees. To convert from degrees"," // use the formula (degrees/180)*Math.PI to get radians."," theta = -(segAngle / 180) * Math.PI;"," "," // convert angle startAngle to radians"," angle = (startAngle / 180) * Math.PI;"," "," // draw the curve in segments no larger than 45 degrees."," if(segs > 0)"," {"," // draw a line from the center to the start of the curve"," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius;"," ay = y + Math.sin(startAngle / 180 * Math.PI) * yRadius;"," this.lineTo(ax, ay);"," // Loop for drawing curve segments"," for(i = 0; i < segs; ++i)"," {"," angle += theta;"," angleMid = angle - (theta / 2);"," bx = x + Math.cos(angle) * radius;"," by = y + Math.sin(angle) * yRadius;"," cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));"," cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));"," this._updateDrawingQueue([\"quadraticCurveTo\", cx, cy, bx, by]);"," }"," // close the wedge by drawing a line to the center"," this._updateDrawingQueue([\"lineTo\", x, y]);"," }"," this._trackSize(-wt , -wt);"," this._trackSize((radius * 2) + wt, (radius * 2) + wt);"," return this;"," },"," "," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function() {"," this._closePath();"," return this;"," },",""," /**"," * Ends a fill and stroke"," *"," * @method closePath"," */"," closePath: function()"," {"," this._updateDrawingQueue([\"closePath\"]);"," this._updateDrawingQueue([\"beginPath\"]);"," },",""," /**"," * Clears the graphics object."," *"," * @method clear"," */"," "," /**"," * Returns a linear gradient fill"," *"," * @method _getLinearGradient"," * @return CanvasGradient"," * @private"," */"," _getLinearGradient: function() {"," var isNumber = Y.Lang.isNumber,"," fill = this.get(\"fill\"),"," stops = fill.stops,"," opacity,"," color,"," stop,"," i,"," len = stops.length,"," gradient,"," x = 0,"," y = 0,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," r = fill.rotation || 0,"," x1, x2, y1, y2,"," cx = x + w/2,"," cy = y + h/2,"," offset,"," radCon = Math.PI/180,"," tanRadians = parseFloat(parseFloat(Math.tan(r * radCon)).toFixed(8));"," if(Math.abs(tanRadians) * w/2 >= h/2)"," {"," if(r < 180)"," {"," y1 = y;"," y2 = y + h;"," }"," else"," {"," y1 = y + h;"," y2 = y;"," }"," x1 = cx - ((cy - y1)/tanRadians);"," x2 = cx - ((cy - y2)/tanRadians); "," }"," else"," {"," if(r > 90 && r < 270)"," {"," x1 = x + w;"," x2 = x;"," }"," else"," {"," x1 = x;"," x2 = x + w;"," }"," y1 = ((tanRadians * (cx - x1)) - cy) * -1;"," y2 = ((tanRadians * (cx - x2)) - cy) * -1;"," }"," gradient = this._context.createLinearGradient(x1, y1, x2, y2);"," for(i = 0; i < len; ++i)"," {"," stop = stops[i];"," opacity = stop.opacity;"," color = stop.color;"," offset = stop.offset;"," if(isNumber(opacity))"," {"," opacity = Math.max(0, Math.min(1, opacity));"," color = this._toRGBA(color, opacity);"," }"," else"," {"," color = TORGB(color);"," }"," offset = stop.offset || i/(len - 1);"," gradient.addColorStop(offset, color);"," }"," return gradient;"," },",""," /**"," * Returns a radial gradient fill"," *"," * @method _getRadialGradient"," * @return CanvasGradient"," * @private"," */"," _getRadialGradient: function() {"," var isNumber = Y.Lang.isNumber,"," fill = this.get(\"fill\"),"," r = fill.r,"," fx = fill.fx,"," fy = fill.fy,"," stops = fill.stops,"," opacity,"," color,"," stop,"," i,"," len = stops.length,"," gradient,"," x = 0,"," y = 0,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x1, x2, y1, y2, r2, "," xc, yc, xn, yn, d, "," offset,"," ratio,"," stopMultiplier;"," xc = x + w/2;"," yc = y + h/2;"," x1 = w * fx;"," y1 = h * fy;"," x2 = x + w/2;"," y2 = y + h/2;"," r2 = w * r;"," d = Math.sqrt( Math.pow(Math.abs(xc - x1), 2) + Math.pow(Math.abs(yc - y1), 2) );"," if(d >= r2)"," {"," ratio = d/r2;"," //hack. gradient won't show if it is exactly on the edge of the arc"," if(ratio === 1)"," {"," ratio = 1.01;"," }"," xn = (x1 - xc)/ratio;"," yn = (y1 - yc)/ratio;"," xn = xn > 0 ? Math.floor(xn) : Math.ceil(xn);"," yn = yn > 0 ? Math.floor(yn) : Math.ceil(yn);"," x1 = xc + xn;"," y1 = yc + yn;"," }"," "," //If the gradient radius is greater than the circle's, adjusting the radius stretches the gradient properly."," //If the gradient radius is less than the circle's, adjusting the radius of the gradient will not work. "," //Instead, adjust the color stops to reflect the smaller radius."," if(r >= 0.5)"," {"," gradient = this._context.createRadialGradient(x1, y1, r, x2, y2, r * w);"," stopMultiplier = 1;"," }"," else"," {"," gradient = this._context.createRadialGradient(x1, y1, r, x2, y2, w/2);"," stopMultiplier = r * 2;"," }"," for(i = 0; i < len; ++i)"," {"," stop = stops[i];"," opacity = stop.opacity;"," color = stop.color;"," offset = stop.offset;"," if(isNumber(opacity))"," {"," opacity = Math.max(0, Math.min(1, opacity));"," color = this._toRGBA(color, opacity);"," }"," else"," {"," color = TORGB(color);"," }"," offset = stop.offset || i/(len - 1);"," offset *= stopMultiplier;"," if(offset <= 1)"," {"," gradient.addColorStop(offset, color);"," }"," }"," return gradient;"," },","",""," /**"," * Clears all values"," *"," * @method _initProps"," * @private"," */"," _initProps: function() {"," this._methods = [];"," this._lineToMethods = [];"," this._xcoords = [0];"," this._ycoords = [0];"," this._width = 0;"," this._height = 0;"," this._left = 0;"," this._top = 0;"," this._right = 0;"," this._bottom = 0;"," this._currentX = 0;"," this._currentY = 0;"," },"," "," /**"," * Indicates a drawing has completed."," *"," * @property _drawingComplete"," * @type Boolean"," * @private"," */"," _drawingComplete: false,",""," /**"," * Creates canvas element"," *"," * @method _createGraphic"," * @return HTMLCanvasElement"," * @private"," */"," _createGraphic: function(config) {"," var graphic = Y.config.doc.createElement('canvas');"," return graphic;"," },"," "," /**"," * Returns the points on a curve"," *"," * @method getBezierData"," * @param Array points Array containing the begin, end and control points of a curve."," * @param Number t The value for incrementing the next set of points."," * @return Array"," * @private"," */"," getBezierData: function(points, t) { "," var n = points.length,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }"," return [ tmp[0][0], tmp[0][1] ]; "," },"," "," /**"," * Calculates the bounding box for a curve"," *"," * @method _setCurveBoundingBox"," * @param Array pts Array containing points for start, end and control points of a curve."," * @param Number w Width used to calculate the number of points to describe the curve."," * @param Number h Height used to calculate the number of points to describe the curve."," * @private"," */"," _setCurveBoundingBox: function(pts, w, h)"," {"," var i = 0,"," left = this._currentX,"," right = left,"," top = this._currentY,"," bottom = top,"," len = Math.round(Math.sqrt((w * w) + (h * h))),"," t = 1/len,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," xy;"," for(i = 0; i < len; ++i)"," {"," xy = this.getBezierData(pts, t * i);"," left = isNaN(left) ? xy[0] : Math.min(xy[0], left);"," right = isNaN(right) ? xy[0] : Math.max(xy[0], right);"," top = isNaN(top) ? xy[1] : Math.min(xy[1], top);"," bottom = isNaN(bottom) ? xy[1] : Math.max(xy[1], bottom);"," }"," left = Math.round(left * 10)/10;"," right = Math.round(right * 10)/10;"," top = Math.round(top * 10)/10;"," bottom = Math.round(bottom * 10)/10;"," this._trackSize(right + wt, bottom + wt);"," this._trackSize(left - wt, top - wt);"," },",""," /**"," * Updates the size of the graphics object"," *"," * @method _trackSize"," * @param {Number} w width"," * @param {Number} h height"," * @private"," */"," _trackSize: function(w, h) {"," if (w > this._right) {"," this._right = w;"," }"," if(w < this._left)"," {"," this._left = w; "," }"," if (h < this._top)"," {"," this._top = h;"," }"," if (h > this._bottom) "," {"," this._bottom = h;"," }"," this._width = this._right - this._left;"," this._height = this._bottom - this._top;"," }","};","Y.CanvasDrawing = CanvasDrawing;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Shape.html\">`Shape`</a> class. "," * `CanvasShape` is not intended to be used directly. Instead, use the <a href=\"Shape.html\">`Shape`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Shape.html\">`Shape`</a> "," * class will point to the `CanvasShape` class."," *"," * @module graphics"," * @class CanvasShape"," * @constructor"," */","CanvasShape = function(cfg)","{"," this._transforms = [];"," this.matrix = new Y.Matrix();"," CanvasShape.superclass.constructor.apply(this, arguments);","};","","CanvasShape.NAME = \"shape\";","","Y.extend(CanvasShape, Y.GraphicBase, Y.mix({"," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," init: function()"," {"," this.initializer.apply(this, arguments);"," },",""," /**"," * Initializes the shape"," *"," * @private"," * @method _initialize"," */"," initializer: function(cfg)"," {"," var host = this,"," graphic = cfg.graphic,"," data = this.get(\"data\");"," host._initProps();"," host.createNode(); "," host._xcoords = [0];"," host._ycoords = [0];"," if(graphic)"," {"," this._setGraphic(graphic);"," }"," if(data)"," {"," host._parsePathData(data);"," }"," host._updateHandler();"," },"," "," /**"," * Set the Graphic instance for the shape."," *"," * @method _setGraphic"," * @param {Graphic | Node | HTMLElement | String} render This param is used to determine the graphic instance. If it is a `Graphic` instance, it will be assigned"," * to the `graphic` attribute. Otherwise, a new Graphic instance will be created and rendered into the dom element that the render represents."," * @private"," */"," _setGraphic: function(render)"," {"," var graphic;"," if(render instanceof Y.CanvasGraphic)"," {"," this._graphic = render;"," }"," else"," {"," render = Y.one(render);"," graphic = new Y.CanvasGraphic({"," render: render"," });"," graphic._appendShape(this);"," this._graphic = graphic;"," }"," },"," "," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," addClass: function(className)"," {"," var node = Y.one(this.get(\"node\"));"," node.addClass(className);"," },"," "," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," removeClass: function(className)"," {"," var node = Y.one(this.get(\"node\"));"," node.removeClass(className);"," },",""," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var graphic = this.get(\"graphic\"),"," parentXY = graphic.getXY(),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," return [parentXY[0] + x, parentXY[1] + y];"," },",""," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains X & Y values for new position (coordinates are page-based)"," */"," setXY: function(xy)"," {"," var graphic = this.get(\"graphic\"),"," parentXY = graphic.getXY(),"," x = xy[0] - parentXY[0],"," y = xy[1] - parentXY[1];"," this._set(\"x\", x);"," this._set(\"y\", y);"," this._updateNodePosition(x, y);"," },",""," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {CanvasShape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," contains: function(needle)"," {"," return needle === Y.one(this.node);"," },",""," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," test: function(selector)"," {"," return Y.one(this.get(\"node\")).test(selector);"," //return Y.Selector.test(this.node, selector);"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this.node;"," return node === refNode;"," },",""," /**"," * Value function for fill attribute"," *"," * @method _getDefaultFill"," * @return Object"," * @private"," */"," _getDefaultFill: function() {"," return {"," type: \"solid\","," opacity: 1,"," cx: 0.5,"," cy: 0.5,"," fx: 0.5,"," fy: 0.5,"," r: 0.5"," };"," },",""," /**"," * Value function for stroke attribute"," *"," * @method _getDefaultStroke"," * @return Object"," * @private"," */"," _getDefaultStroke: function() "," {"," return {"," weight: 1,"," dashstyle: \"none\","," color: \"#000\","," opacity: 1.0"," };"," },",""," /**"," * Left edge of the path"," *"," * @property _left"," * @type Number"," * @private"," */"," _left: 0,",""," /**"," * Right edge of the path"," *"," * @property _right"," * @type Number"," * @private"," */"," _right: 0,"," "," /**"," * Top edge of the path"," *"," * @property _top"," * @type Number"," * @private"," */"," _top: 0, "," "," /**"," * Bottom edge of the path"," *"," * @property _bottom"," * @type Number"," * @private"," */"," _bottom: 0,",""," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var host = this,"," node = Y.config.doc.createElement('canvas'),"," id = host.get(\"id\"),"," concat = host._camelCaseConcat,"," name = host.name;"," host._context = node.getContext('2d');"," node.setAttribute(\"overflow\", \"visible\");"," node.style.overflow = \"visible\";"," if(!host.get(\"visible\"))"," {"," node.style.visibility = \"hidden\";"," }"," node.setAttribute(\"id\", id);"," id = \"#\" + id;"," host.node = node;"," host.addClass(_getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name))); "," },"," "," /**"," * Overrides default `on` method. Checks to see if its a dom interaction event. If so, "," * return an event attached to the `node` element. If not, return the normal functionality."," *"," * @method on"," * @param {String} type event type"," * @param {Object} callback function"," * @private"," */"," on: function(type, fn)"," {"," if(Y.Node.DOM_EVENTS[type])"," {"," return Y.one(\"#\" + this.get(\"id\")).on(type, fn);"," }"," return Y.on.apply(this, arguments);"," },"," "," /**"," * Adds a stroke to the shape node."," *"," * @method _strokeChangeHandler"," * @param {Object} stroke Properties of the `stroke` attribute."," * @private"," */"," _setStrokeProps: function(stroke)"," {"," var color,"," weight,"," opacity,"," linejoin,"," linecap,"," dashstyle;"," if(stroke)"," {"," color = stroke.color;"," weight = PARSE_FLOAT(stroke.weight);"," opacity = PARSE_FLOAT(stroke.opacity);"," linejoin = stroke.linejoin || \"round\";"," linecap = stroke.linecap || \"butt\";"," dashstyle = stroke.dashstyle;"," this._miterlimit = null;"," this._dashstyle = (dashstyle && Y.Lang.isArray(dashstyle) && dashstyle.length > 1) ? dashstyle : null;"," this._strokeWeight = weight;",""," if (IS_NUMBER(weight) && weight > 0) "," {"," this._stroke = 1;"," } "," else "," {"," this._stroke = 0;"," }"," if (IS_NUMBER(opacity)) {"," this._strokeStyle = this._toRGBA(color, opacity);"," }"," else"," {"," this._strokeStyle = color;"," }"," this._linecap = linecap;"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," this._linejoin = linejoin;"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(IS_NUMBER(linejoin))"," {"," this._miterlimit = Math.max(linejoin, 1);"," this._linejoin = \"miter\";"," }"," }"," }"," else"," {"," this._stroke = 0;"," }"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function() "," {"," var host = this,"," val = arguments[0];"," AttributeLite.prototype.set.apply(host, arguments);"," if(host.initialized)"," {"," host._updateHandler();"," }"," },"," "," /**"," * Adds a fill to the shape node."," *"," * @method _setFillProps "," * @param {Object} fill Properties of the `fill` attribute."," * @private"," */"," _setFillProps: function(fill)"," {"," var isNumber = IS_NUMBER,"," color,"," opacity,"," type;"," if(fill)"," {"," color = fill.color;"," type = fill.type;"," if(type == \"linear\" || type == \"radial\")"," {"," this._fillType = type;"," }"," else if(color)"," {"," opacity = fill.opacity;"," if (isNumber(opacity)) "," {"," opacity = Math.max(0, Math.min(1, opacity));"," color = this._toRGBA(color, opacity);"," } "," else "," {"," color = TORGB(color);"," }",""," this._fillColor = color;"," this._fillType = 'solid';"," }"," else"," {"," this._fillColor = null;"," }"," }"," else"," {"," this._fillType = null;"," this._fillColor = null;"," }"," },",""," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y)"," {"," this._translateX += x;"," this._translateY += y;"," this._addTransform(\"translate\", arguments);"," },",""," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," translateX: function(x)"," {"," this._translateX += x;"," this._addTransform(\"translateX\", arguments);"," },",""," /**"," * Performs a translate on the y-coordinate. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," translateY: function(y)"," {"," this._translateY += y;"," this._addTransform(\"translateY\", arguments);"," },",""," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y)"," {"," this._addTransform(\"skew\", arguments);"," },",""," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x)"," {"," this._addTransform(\"skewX\", arguments);"," },",""," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y)"," {"," this._addTransform(\"skewY\", arguments);"," },",""," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg)"," {"," this._rotation = deg;"," this._addTransform(\"rotate\", arguments);"," },",""," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y)"," {"," this._addTransform(\"scale\", arguments);"," },"," "," /**"," * Storage for `rotation` atribute."," *"," * @property _rotation"," * @type Number"," * @private"," */"," _rotation: 0,"," "," /**"," * Storage for the transform attribute."," *"," * @property _transform"," * @type String"," * @private"," */"," _transform: \"\",",""," /**"," * Adds a transform to the shape."," *"," * @method _addTransform"," * @param {String} type The transform being applied."," * @param {Array} args The arguments for the transform."," * @private"," */"," _addTransform: function(type, args)"," {"," args = Y.Array(args);"," this._transform = Y_LANG.trim(this._transform + \" \" + type + \"(\" + args.join(\", \") + \")\");"," args.unshift(type);"," this._transforms.push(args);"," if(this.initialized)"," {"," this._updateTransform();"," }"," },",""," /**"," * Applies all transforms."," *"," * @method _updateTransform"," * @private"," */"," _updateTransform: function()"," {"," var node = this.node,"," key,"," transform,"," transformOrigin = this.get(\"transformOrigin\"),"," matrix = this.matrix,"," i,"," len = this._transforms.length;"," "," if(this._transforms && this._transforms.length > 0)"," {"," for(i = 0; i < len; ++i)"," {"," key = this._transforms[i].shift();"," if(key)"," {"," matrix[key].apply(matrix, this._transforms[i]); "," }"," }"," transform = matrix.toCSSText();"," }"," "," this._graphic.addToRedrawQueue(this); "," transformOrigin = (100 * transformOrigin[0]) + \"% \" + (100 * transformOrigin[1]) + \"%\";"," Y_DOM.setStyle(node, \"transformOrigin\", transformOrigin);"," if(transform)"," {"," Y_DOM.setStyle(node, \"transform\", transform);"," }"," this._transforms = [];"," },",""," /**"," * Updates `Shape` based on attribute changes."," *"," * @method _updateHandler"," * @private"," */"," _updateHandler: function()"," {"," this._draw();"," this._updateTransform();"," },"," "," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node;"," this.clear();"," this._closePath();"," node.style.left = this.get(\"x\") + \"px\";"," node.style.top = this.get(\"y\") + \"px\";"," },",""," /**"," * Completes a shape or drawing"," *"," * @method _closePath"," * @private"," */"," _closePath: function()"," {"," if(!this._methods)"," {"," return;"," }"," var node = this.get(\"node\"),"," w = this._right - this._left,"," h = this._bottom - this._top,"," context = this._context,"," methods = [],"," cachedMethods = this._methods.concat(),"," i,"," j,"," method,"," args,"," argsLen,"," len = 0;"," this._context.clearRect(0, 0, node.width, node.height);"," if(this._methods)"," {"," len = cachedMethods.length;"," if(!len || len < 1)"," {"," return;"," }"," for(i = 0; i < len; ++i)"," {"," methods[i] = cachedMethods[i].concat();"," args = methods[i];"," argsLen = (args[0] == \"quadraticCurveTo\" || args[0] == \"bezierCurveTo\") ? args.length : 3;"," for(j = 1; j < argsLen; ++j)"," {"," if(j % 2 === 0)"," {"," args[j] = args[j] - this._top;"," }"," else"," {"," args[j] = args[j] - this._left;"," }"," }"," }"," node.setAttribute(\"width\", Math.min(w, 2000));"," node.setAttribute(\"height\", Math.min(2000, h));"," context.beginPath();"," for(i = 0; i < len; ++i)"," {"," args = methods[i].concat();"," if(args && args.length > 0)"," {"," method = args.shift();"," if(method)"," {"," if(method == \"closePath\")"," {"," context.closePath();"," this._strokeAndFill(context);"," }"," else if(method && method == \"lineTo\" && this._dashstyle)"," {"," args.unshift(this._xcoords[i] - this._left, this._ycoords[i] - this._top);"," this._drawDashedLine.apply(this, args);"," }"," else"," {"," context[method].apply(context, args); "," }"," }"," }"," }",""," this._strokeAndFill(context);"," this._drawingComplete = true;"," this._clearAndUpdateCoords();"," this._updateNodePosition();"," this._methods = cachedMethods;"," }"," },",""," /**"," * Completes a stroke and/or fill operation on the context."," *"," * @method _strokeAndFill"," * @param {Context} Reference to the context element of the canvas instance."," * @private"," */"," _strokeAndFill: function(context)"," {"," if (this._fillType) "," {"," if(this._fillType == \"linear\")"," {"," context.fillStyle = this._getLinearGradient();"," }"," else if(this._fillType == \"radial\")"," {"," context.fillStyle = this._getRadialGradient();"," }"," else"," {"," context.fillStyle = this._fillColor;"," }"," context.closePath();"," context.fill();"," }",""," if (this._stroke) {"," if(this._strokeWeight)"," {"," context.lineWidth = this._strokeWeight;"," }"," context.lineCap = this._linecap;"," context.lineJoin = this._linejoin;"," if(this._miterlimit)"," {"," context.miterLimit = this._miterlimit;"," }"," context.strokeStyle = this._strokeStyle;"," context.stroke();"," }"," },",""," /**"," * Draws a dashed line between two points."," * "," * @method _drawDashedLine"," * @param {Number} xStart The x position of the start of the line"," * @param {Number} yStart The y position of the start of the line"," * @param {Number} xEnd The x position of the end of the line"," * @param {Number} yEnd The y position of the end of the line"," * @private"," */"," _drawDashedLine: function(xStart, yStart, xEnd, yEnd)"," {"," var context = this._context,"," dashsize = this._dashstyle[0],"," gapsize = this._dashstyle[1],"," segmentLength = dashsize + gapsize,"," xDelta = xEnd - xStart,"," yDelta = yEnd - yStart,"," delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),"," segmentCount = Math.floor(Math.abs(delta / segmentLength)),"," radians = Math.atan2(yDelta, xDelta),"," xCurrent = xStart,"," yCurrent = yStart,"," i;"," xDelta = Math.cos(radians) * segmentLength;"," yDelta = Math.sin(radians) * segmentLength;"," "," for(i = 0; i < segmentCount; ++i)"," {"," context.moveTo(xCurrent, yCurrent);"," context.lineTo(xCurrent + Math.cos(radians) * dashsize, yCurrent + Math.sin(radians) * dashsize);"," xCurrent += xDelta;"," yCurrent += yDelta;"," }"," "," context.moveTo(xCurrent, yCurrent);"," delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));"," "," if(delta > dashsize)"," {"," context.lineTo(xCurrent + Math.cos(radians) * dashsize, yCurrent + Math.sin(radians) * dashsize);"," }"," else if(delta > 0)"," {"," context.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);"," }"," "," context.moveTo(xEnd, yEnd);"," },",""," //This should move to CanvasDrawing class. "," //Currently docmented in CanvasDrawing class."," clear: function() {"," this._initProps();"," if(this.node) "," {"," this._context.clearRect(0, 0, this.node.width, this.node.height);"," }"," return this;"," },"," "," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," getBounds: function()"," {"," var type = this._type,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," if(type == \"path\")"," {"," x = x + this._left;"," y = y + this._top;"," w = this._right - this._left;"," h = this._bottom - this._top;"," }"," return this._getContentRect(w, h, x, y);"," },",""," /**"," * Calculates the bounding box for the shape."," *"," * @method _getContentRect"," * @param {Number} w width of the shape"," * @param {Number} h height of the shape"," * @param {Number} x x-coordinate of the shape"," * @param {Number} y y-coordinate of the shape"," * @private"," */"," _getContentRect: function(w, h, x, y)"," {"," var transformOrigin = this.get(\"transformOrigin\"),"," transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h,"," transforms = this.matrix.getTransformArray(this.get(\"transform\")),"," matrix = new Y.Matrix(),"," i,"," len = transforms.length,"," transform,"," key,"," contentRect;"," if(this._type == \"path\")"," {"," transformX = transformX + x;"," transformY = transformY + y;"," }"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," for(i = 0; i < len; i = i + 1)"," {"," transform = transforms[i];"," key = transform.shift();"," if(key)"," {"," matrix[key].apply(matrix, transform); "," }"," }"," matrix.translate(-transformX, -transformY);"," contentRect = matrix.getContentRect(w, h, x, y);"," return contentRect;"," },",""," /**"," * Places the shape above all other shapes."," *"," * @method toFront"," */"," toFront: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toFront(this);"," }"," },",""," /**"," * Places the shape underneath all other shapes."," *"," * @method toFront"," */"," toBack: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toBack(this);"," }"," },",""," /**"," * Parses path data string and call mapped methods."," *"," * @method _parsePathData"," * @param {String} val The path data"," * @private"," */"," _parsePathData: function(val)"," {"," var method,"," methodSymbol,"," args,"," commandArray = Y.Lang.trim(val.match(SPLITPATHPATTERN)),"," i,"," len, "," str,"," symbolToMethod = this._pathSymbolToMethod;"," if(commandArray)"," {"," this.clear();"," len = commandArray.length || 0;"," for(i = 0; i < len; i = i + 1)"," {"," str = commandArray[i];"," methodSymbol = str.substr(0, 1);"," args = str.substr(1).match(SPLITARGSPATTERN);"," method = symbolToMethod[methodSymbol];"," if(method)"," {"," if(args)"," {"," this[method].apply(this, args);"," }"," else"," {"," this[method].apply(this);"," }"," }"," }"," this.end();"," }"," },"," "," /**"," * Destroys the shape instance."," *"," * @method destroy"," */"," destroy: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic.removeShape(this);"," }"," else"," {"," this._destroy();"," }"," },",""," /**"," * Implementation for shape destruction"," *"," * @method destroy"," * @protected"," */"," _destroy: function()"," {"," if(this.node)"," {"," Y.one(this.node).remove(true);"," this._context = null;"," this.node = null;"," }"," }","}, Y.CanvasDrawing.prototype));","","CanvasShape.ATTRS = {"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," transformOrigin: {"," valueFn: function()"," {"," return [0.5, 0.5];"," }"," },"," "," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd> "," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," transform: {"," setter: function(val)"," {"," this.matrix.init(); "," this._transforms = this.matrix.getTransformArray(val);"," this._transform = val;"," return val;"," },",""," getter: function()"," {"," return this._transform;"," }"," },",""," /**"," * Dom node for the shape"," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this.node;"," }"," },",""," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," value: 0"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," value: 0"," },",""," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," x: {"," value: 0"," },",""," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," y: {"," value: 0"," },",""," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val){"," var node = this.get(\"node\"),"," visibility = val ? \"visible\" : \"hidden\";"," if(node)"," {"," node.style.visibility = visibility;"," }"," return val;"," }"," },",""," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * </dl>"," * <p>The corresponding `SVGShape` class implements the following additional properties.</p>"," * <dl>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * </dl>"," * <p>These properties are not currently implemented in `CanvasShape` or `VMLShape`.</p> "," *"," * @config fill"," * @type Object "," */"," fill: {"," valueFn: \"_getDefaultFill\","," "," setter: function(val)"," {"," var fill,"," tmpl = this.get(\"fill\") || this._getDefaultFill();"," fill = (val) ? Y.merge(tmpl, val) : null;"," if(fill && fill.color)"," {"," if(fill.color === undefined || fill.color == \"none\")"," {"," fill.color = null;"," }"," }"," this._setFillProps(fill);"," return fill;"," }"," },",""," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," stroke: {"," valueFn: \"_getDefaultStroke\",",""," setter: function(val)"," {"," var tmpl = this.get(\"stroke\") || this._getDefaultStroke(),"," wt;"," if(val && val.hasOwnProperty(\"weight\"))"," {"," wt = parseInt(val.weight, 10);"," if(!isNaN(wt))"," {"," val.weight = wt;"," }"," }"," val = (val) ? Y.merge(tmpl, val) : null;"," this._setStrokeProps(val);"," return val;"," }"," },"," "," //Not used. Remove in future."," autoSize: {"," value: false"," },",""," // Only implemented in SVG"," // Determines whether the instance will receive mouse events."," // "," // @config pointerEvents"," // @type string"," //"," pointerEvents: {"," value: \"visiblePainted\""," },",""," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," data: {"," setter: function(val)"," {"," if(this.get(\"node\"))"," {"," this._parsePathData(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the container Graphic."," *"," * @config graphic"," * @type Graphic"," */"," graphic: {"," readOnly: true,",""," getter: function()"," {"," return this._graphic;"," }"," }","};","Y.CanvasShape = CanvasShape;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Path.html\">`Path`</a> class. "," * `CanvasPath` is not intended to be used directly. Instead, use the <a href=\"Path.html\">`Path`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Path.html\">`Path`</a> "," * class will point to the `CanvasPath` class."," *"," * @module graphics"," * @class CanvasPath"," * @extends CanvasShape"," */","CanvasPath = function(cfg)","{"," CanvasPath.superclass.constructor.apply(this, arguments);","};","CanvasPath.NAME = \"path\";","Y.extend(CanvasPath, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," this._closePath();"," this._updateTransform();"," },",""," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var host = this,"," node = Y.config.doc.createElement('canvas'),"," name = host.name,"," concat = host._camelCaseConcat,"," id = host.get(\"id\");"," host._context = node.getContext('2d');"," node.setAttribute(\"overflow\", \"visible\");"," node.setAttribute(\"pointer-events\", \"none\");"," node.style.pointerEvents = \"none\";"," node.style.overflow = \"visible\";"," node.setAttribute(\"id\", id);"," id = \"#\" + id;"," host.node = node;"," host.addClass(_getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name))); "," },",""," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function()"," {"," this._draw();"," }","});","","CanvasPath.ATTRS = Y.merge(Y.CanvasShape.ATTRS, {"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," getter: function()"," {"," var offset = this._stroke && this._strokeWeight ? (this._strokeWeight * 2) : 0;"," return this._width - offset;"," },",""," setter: function(val)"," {"," this._width = val;"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," getter: function()"," {"," var offset = this._stroke && this._strokeWeight ? (this._strokeWeight * 2) : 0;"," return this._height - offset;"," },",""," setter: function(val)"," {"," this._height = val;"," return val;"," }"," },"," "," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," return this._path;"," }"," }","});","Y.CanvasPath = CanvasPath;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Rect.html\">`Rect`</a> class. "," * `CanvasRect` is not intended to be used directly. Instead, use the <a href=\"Rect.html\">`Rect`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Rect.html\">`Rect`</a> "," * class will point to the `CanvasRect` class."," *"," * @module graphics"," * @class CanvasRect"," * @constructor"," */","CanvasRect = function()","{"," CanvasRect.superclass.constructor.apply(this, arguments);","};","CanvasRect.NAME = \"rect\";","Y.extend(CanvasRect, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"rect\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," this.clear();"," this.drawRect(0, 0, w, h);"," this._closePath();"," }","});","CanvasRect.ATTRS = Y.CanvasShape.ATTRS;","Y.CanvasRect = CanvasRect;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * `CanvasEllipse` is not intended to be used directly. Instead, use the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Ellipse.html\">`Ellipse`</a> "," * class will point to the `CanvasEllipse` class."," *"," * @module graphics"," * @class CanvasEllipse"," * @constructor"," */","CanvasEllipse = function(cfg)","{"," CanvasEllipse.superclass.constructor.apply(this, arguments);","};","","CanvasEllipse.NAME = \"ellipse\";","","Y.extend(CanvasEllipse, CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"ellipse\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," this.clear();"," this.drawEllipse(0, 0, w, h);"," this._closePath();"," }","});","CanvasEllipse.ATTRS = Y.merge(CanvasShape.ATTRS, {"," /**"," * Horizontal radius for the ellipse. "," *"," * @config xRadius"," * @type Number"," */"," xRadius: {"," setter: function(val)"," {"," this.set(\"width\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"width\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," },",""," /**"," * Vertical radius for the ellipse. "," *"," * @config yRadius"," * @type Number"," * @readOnly"," */"," yRadius: {"," setter: function(val)"," {"," this.set(\"height\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"height\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," }","});","Y.CanvasEllipse = CanvasEllipse;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Circle.html\">`Circle`</a> class. "," * `CanvasCircle` is not intended to be used directly. Instead, use the <a href=\"Circle.html\">`Circle`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Circle.html\">`Circle`</a> "," * class will point to the `CanvasCircle` class."," *"," * @module graphics"," * @class CanvasCircle"," * @constructor"," */","CanvasCircle = function(cfg)","{"," CanvasCircle.superclass.constructor.apply(this, arguments);","};"," ","CanvasCircle.NAME = \"circle\";","","Y.extend(CanvasCircle, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"circle\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var radius = this.get(\"radius\");"," if(radius)"," {"," this.clear();"," this.drawCircle(0, 0, radius);"," this._closePath();"," }"," }","});","","CanvasCircle.ATTRS = Y.merge(Y.CanvasShape.ATTRS, {"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */"," radius: {"," lazyAdd: false"," }","});","Y.CanvasCircle = CanvasCircle;","/**"," * Draws pie slices"," *"," * @module graphics"," * @class CanvasPieSlice"," * @constructor"," */","CanvasPieSlice = function()","{"," CanvasPieSlice.superclass.constructor.apply(this, arguments);","};","CanvasPieSlice.NAME = \"canvasPieSlice\";","Y.extend(CanvasPieSlice, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Change event listener"," *"," * @private"," * @method _updateHandler"," */"," _draw: function(e)"," {"," var x = this.get(\"cx\"),"," y = this.get(\"cy\"),"," startAngle = this.get(\"startAngle\"),"," arc = this.get(\"arc\"),"," radius = this.get(\"radius\");"," this.clear();"," this._left = x;"," this._right = radius;"," this._top = y;"," this._bottom = radius;"," this.drawWedge(x, y, startAngle, arc, radius);"," this.end();"," }"," });","CanvasPieSlice.ATTRS = Y.mix({"," cx: {"," value: 0"," },",""," cy: {"," value: 0"," },"," /**"," * Starting angle in relation to a circle in which to begin the pie slice drawing."," *"," * @config startAngle"," * @type Number"," */"," startAngle: {"," value: 0"," },",""," /**"," * Arc of the slice."," *"," * @config arc"," * @type Number"," */"," arc: {"," value: 0"," },",""," /**"," * Radius of the circle in which the pie slice is drawn"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","}, Y.CanvasShape.ATTRS);","Y.CanvasPieSlice = CanvasPieSlice;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the `Graphic` class. "," * `CanvasGraphic` is not intended to be used directly. Instead, use the <a href=\"Graphic.html\">`Graphic`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Graphic.html\">`Graphic`</a> "," * class will point to the `CanvasGraphic` class."," *"," * @module graphics"," * @class CanvasGraphic"," * @constructor"," */","function CanvasGraphic(config) {"," "," CanvasGraphic.superclass.constructor.apply(this, arguments);","}","","CanvasGraphic.NAME = \"canvasGraphic\";","","CanvasGraphic.ATTRS = {"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," render: {},"," "," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this._node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," shapes: {"," readOnly: true,",""," getter: function()"," {"," return this._shapes;"," }"," },",""," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the graphic instance's position."," *"," * @config contentBounds "," * @type Object"," * @readOnly"," */"," contentBounds: {"," readOnly: true,",""," getter: function()"," {"," return this._contentBounds;"," }"," },",""," /**"," * The outermost html element of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this._node;"," }"," },",""," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.width = val + \"px\"; "," }"," return val;"," }"," },",""," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," height: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.height = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," autoSize: {"," value: false"," },",""," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," preserveAspectRatio: {"," value: \"xMidYMid\""," },",""," /**"," * The contentBounds will resize to greater values but not smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," resizeDown: {"," value: false"," },",""," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," this._x = val;"," if(this._node)"," {"," this._node.style.left = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," this._y = val;"," if(this._node)"," {"," this._node.style.top = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," autoDraw: {"," value: true"," },",""," /**"," * Indicates whether the `Graphic` and its children are visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val)"," {"," this._toggleVisible(val);"," return val;"," }"," }","};","","Y.extend(CanvasGraphic, Y.GraphicBase, {"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, value) "," {"," var host = this,"," redrawAttrs = {"," autoDraw: true,"," autoSize: true,"," preserveAspectRatio: true,"," resizeDown: true"," },"," key,"," forceRedraw = false;"," AttributeLite.prototype.set.apply(host, arguments); "," if(host._state.autoDraw === true && Y.Object.size(this._shapes) > 0)"," {"," if(Y_LANG.isString && redrawAttrs[attr])"," {"," forceRedraw = true;"," }"," else if(Y_LANG.isObject(attr))"," {"," for(key in redrawAttrs)"," {"," if(redrawAttrs.hasOwnProperty(key) && attr[key])"," {"," forceRedraw = true;"," break;"," }"," }"," }"," }"," if(forceRedraw)"," {"," host._redraw();"," }"," },",""," /**"," * Storage for `x` attribute."," *"," * @property _x"," * @type Number"," * @private"," */"," _x: 0,",""," /**"," * Storage for `y` attribute."," *"," * @property _y"," * @type Number"," * @private"," */"," _y: 0,",""," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var node = Y.one(this._node),"," xy;"," if(node)"," {"," xy = node.getXY();"," }"," return xy;"," },"," "," /**"," * Initializes the class."," *"," * @method initializer"," * @param {Object} config Optional attributes "," * @private"," */"," initializer: function(config) {"," var render = this.get(\"render\"),"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\","," w = this.get(\"width\") || 0,"," h = this.get(\"height\") || 0;"," this._shapes = {};"," this._redrawQueue = {};"," this._contentBounds = {"," left: 0,"," top: 0,"," right: 0,"," bottom: 0"," };"," this._node = DOCUMENT.createElement('div');"," this._node.style.position = \"absolute\";"," this._node.style.visibility = visibility;"," this.set(\"width\", w);"," this.set(\"height\", h);"," if(render)"," {"," this.render(render);"," }"," },",""," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {HTMLElement} parentNode node in which to render the graphics node into."," */"," render: function(render) {"," var parentNode = Y.one(render),"," node = this._node,"," w = this.get(\"width\") || parseInt(parentNode.getComputedStyle(\"width\"), 10),"," h = this.get(\"height\") || parseInt(parentNode.getComputedStyle(\"height\"), 10);"," parentNode = parentNode || DOCUMENT.body;"," parentNode.appendChild(node);"," node.style.display = \"block\";"," node.style.position = \"absolute\";"," node.style.left = \"0px\";"," node.style.top = \"0px\";"," this.set(\"width\", w);"," this.set(\"height\", h);"," this.parentNode = parentNode;"," return this;"," },",""," /**"," * Removes all nodes."," *"," * @method destroy"," */"," destroy: function()"," {"," this.removeAllShapes();"," if(this._node)"," {"," this._removeChildren(this._node);"," Y.one(this._node).destroy();"," }"," },",""," /**"," * Generates a shape instance by type."," *"," * @method addShape"," * @param {Object} cfg attributes for the shape"," * @return Shape"," */"," addShape: function(cfg)"," {"," cfg.graphic = this;"," if(!this.get(\"visible\"))"," {"," cfg.visible = false;"," }"," var shapeClass = this._getShapeClass(cfg.type),"," shape = new shapeClass(cfg);"," this._appendShape(shape);"," return shape;"," },",""," /**"," * Adds a shape instance to the graphic instance."," *"," * @method _appendShape"," * @param {Shape} shape The shape instance to be added to the graphic."," * @private"," */"," _appendShape: function(shape)"," {"," var node = shape.node,"," parentNode = this._frag || this._node;"," if(this.get(\"autoDraw\")) "," {"," parentNode.appendChild(node);"," }"," else"," {"," this._getDocFrag().appendChild(node);"," }"," },",""," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," removeShape: function(shape)"," {"," if(!(shape instanceof CanvasShape))"," {"," if(Y_LANG.isString(shape))"," {"," shape = this._shapes[shape];"," }"," }"," if(shape && shape instanceof CanvasShape)"," {"," shape._destroy();"," delete this._shapes[shape.get(\"id\")];"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," return shape;"," },",""," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," removeAllShapes: function()"," {"," var shapes = this._shapes,"," i;"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].destroy();"," }"," }"," this._shapes = {};"," },"," "," /**"," * Clears the graphics object."," *"," * @method clear"," */"," clear: function() {"," this.removeAllShapes();"," },",""," /**"," * Removes all child nodes."," *"," * @method _removeChildren"," * @param {HTMLElement} node"," * @private"," */"," _removeChildren: function(node)"," {"," if(node && node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} val indicates visibilitye"," * @private"," */"," _toggleVisible: function(val)"," {"," var i,"," shapes = this._shapes,"," visibility = val ? \"visible\" : \"hidden\";"," if(shapes)"," {"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].set(\"visible\", val);"," }"," }"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," },",""," /**"," * Returns a shape class. Used by `addShape`. "," *"," * @method _getShapeClass"," * @param {Shape | String} val Indicates which shape class. "," * @return Function "," * @private"," */"," _getShapeClass: function(val)"," {"," var shape = this._shapeClass[val];"," if(shape)"," {"," return shape;"," }"," return val;"," },"," "," /**"," * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation."," *"," * @property _shapeClass"," * @type Object"," * @private"," */"," _shapeClass: {"," circle: Y.CanvasCircle,"," rect: Y.CanvasRect,"," path: Y.CanvasPath,"," ellipse: Y.CanvasEllipse,"," pieslice: Y.CanvasPieSlice"," },"," "," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," getShapeById: function(id)"," {"," var shape = this._shapes[id];"," return shape;"," },",""," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */"," batch: function(method)"," {"," var autoDraw = this.get(\"autoDraw\");"," this.set(\"autoDraw\", false);"," method();"," this.set(\"autoDraw\", autoDraw);"," },",""," /**"," * Returns a document fragment to for attaching shapes."," *"," * @method _getDocFrag"," * @return DocumentFragment"," * @private"," */"," _getDocFrag: function()"," {"," if(!this._frag)"," {"," this._frag = DOCUMENT.createDocumentFragment();"," }"," return this._frag;"," },"," "," /**"," * Redraws all shapes."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var autoSize = this.get(\"autoSize\"),"," preserveAspectRatio = this.get(\"preserveAspectRatio\"),"," box = this.get(\"resizeDown\") ? this._getUpdatedContentBounds() : this._contentBounds,"," contentWidth,"," contentHeight,"," w,"," h,"," xScale,"," yScale,"," translateX = 0,"," translateY = 0,"," matrix,"," node = this.get(\"node\");"," if(autoSize)"," {"," if(autoSize == \"sizeContentToGraphic\")"," {"," contentWidth = box.right - box.left;"," contentHeight = box.bottom - box.top;"," w = parseFloat(Y_DOM.getComputedStyle(node, \"width\"));"," h = parseFloat(Y_DOM.getComputedStyle(node, \"height\"));"," matrix = new Y.Matrix();"," if(preserveAspectRatio == \"none\")"," {"," xScale = w/contentWidth;"," yScale = h/contentHeight;"," }"," else"," {"," if(contentWidth/contentHeight !== w/h) "," {"," if(contentWidth * h/contentHeight > w)"," {"," xScale = yScale = w/contentWidth;"," translateY = this._calculateTranslate(preserveAspectRatio.slice(5).toLowerCase(), contentHeight * w/contentWidth, h);"," }"," else"," {"," xScale = yScale = h/contentHeight;"," translateX = this._calculateTranslate(preserveAspectRatio.slice(1, 4).toLowerCase(), contentWidth * h/contentHeight, w);"," }"," }"," }"," Y_DOM.setStyle(node, \"transformOrigin\", \"0% 0%\");"," translateX = translateX - (box.left * xScale);"," translateY = translateY - (box.top * yScale);"," matrix.translate(translateX, translateY);"," matrix.scale(xScale, yScale);"," Y_DOM.setStyle(node, \"transform\", matrix.toCSSText());"," }"," else"," {"," this.set(\"width\", box.right);"," this.set(\"height\", box.bottom);"," }"," }"," if(this._frag)"," {"," this._node.appendChild(this._frag);"," this._frag = null;"," }"," },"," "," /**"," * Determines the value for either an x or y value to be used for the <code>translate</code> of the Graphic."," *"," * @method _calculateTranslate"," * @param {String} position The position for placement. Possible values are min, mid and max."," * @param {Number} contentSize The total size of the content."," * @param {Number} boundsSize The total size of the Graphic."," * @return Number"," * @private"," */"," _calculateTranslate: function(position, contentSize, boundsSize)"," {"," var ratio = boundsSize - contentSize,"," coord;"," switch(position)"," {"," case \"mid\" :"," coord = ratio * 0.5;"," break;"," case \"max\" :"," coord = ratio;"," break;"," default :"," coord = 0;"," break;"," }"," return coord;"," },"," "," /**"," * Adds a shape to the redraw queue and calculates the contentBounds. Used internally "," * by `Shape` instances."," *"," * @method addToRedrawQueue"," * @param Shape shape The shape instance to add to the queue"," * @protected"," */"," addToRedrawQueue: function(shape)"," {"," var shapeBox,"," box;"," this._shapes[shape.get(\"id\")] = shape;"," if(!this.get(\"resizeDown\"))"," {"," shapeBox = shape.getBounds();"," box = this._contentBounds;"," box.left = box.left < shapeBox.left ? box.left : shapeBox.left;"," box.top = box.top < shapeBox.top ? box.top : shapeBox.top;"," box.right = box.right > shapeBox.right ? box.right : shapeBox.right;"," box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;"," this._contentBounds = box;"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," },",""," /**"," * Recalculates and returns the `contentBounds` for the `Graphic` instance."," *"," * @method _getUpdatedContentBounds"," * @return {Object} "," * @private"," */"," _getUpdatedContentBounds: function()"," {"," var bounds,"," i,"," shape,"," queue = this._shapes,"," box = {};"," for(i in queue)"," {"," if(queue.hasOwnProperty(i))"," {"," shape = queue[i];"," bounds = shape.getBounds();"," box.left = Y_LANG.isNumber(box.left) ? Math.min(box.left, bounds.left) : bounds.left;"," box.top = Y_LANG.isNumber(box.top) ? Math.min(box.top, bounds.top) : bounds.top;"," box.right = Y_LANG.isNumber(box.right) ? Math.max(box.right, bounds.right) : bounds.right;"," box.bottom = Y_LANG.isNumber(box.bottom) ? Math.max(box.bottom, bounds.bottom) : bounds.bottom;"," }"," }"," box.left = Y_LANG.isNumber(box.left) ? box.left : 0;"," box.top = Y_LANG.isNumber(box.top) ? box.top : 0;"," box.right = Y_LANG.isNumber(box.right) ? box.right : 0;"," box.bottom = Y_LANG.isNumber(box.bottom) ? box.bottom : 0;"," this._contentBounds = box;"," return box;"," },",""," /**"," * Inserts shape on the top of the tree."," *"," * @method _toFront"," * @param {CanvasShape} Shape to add."," * @private"," */"," _toFront: function(shape)"," {"," var contentNode = this.get(\"node\");"," if(shape instanceof Y.CanvasShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," contentNode.appendChild(shape);"," }"," },",""," /**"," * Inserts shape as the first child of the content node."," *"," * @method _toBack"," * @param {CanvasShape} Shape to add."," * @private"," */"," _toBack: function(shape)"," {"," var contentNode = this.get(\"node\"),"," targetNode;"," if(shape instanceof Y.CanvasShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," targetNode = contentNode.firstChild;"," if(targetNode)"," {"," contentNode.insertBefore(shape, targetNode);"," }"," else"," {"," contentNode.appendChild(shape);"," }"," }"," }","});","","Y.CanvasGraphic = CanvasGraphic;","","","}, '3.7.2', {\"requires\": [\"graphics\"]});"];+_yuitest_coverage["build/graphics-canvas/graphics-canvas.js"].code=["YUI.add('graphics-canvas', function (Y, NAME) {","","var IMPLEMENTATION = \"canvas\","," SHAPE = \"shape\","," SPLITPATHPATTERN = /[a-z][^a-z]*/ig,"," SPLITARGSPATTERN = /[-]?[0-9]*[0-9|\\.][0-9]*/g,"," DOCUMENT = Y.config.doc,"," Y_LANG = Y.Lang,"," AttributeLite = Y.AttributeLite,"," CanvasShape,"," CanvasPath,"," CanvasRect,"," CanvasEllipse,"," CanvasCircle,"," CanvasPieSlice,"," Y_DOM = Y.DOM,"," Y_Color = Y.Color,"," PARSE_INT = parseInt,"," PARSE_FLOAT = parseFloat,"," IS_NUMBER = Y_LANG.isNumber,"," RE = RegExp,"," TORGB = Y_Color.toRGB,"," TOHEX = Y_Color.toHex,"," _getClassName = Y.ClassNameManager.getClassName;","","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Drawing.html\">`Drawing`</a> class. "," * `CanvasDrawing` is not intended to be used directly. Instead, use the <a href=\"Drawing.html\">`Drawing`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Drawing.html\">`Drawing`</a> "," * class will point to the `CanvasDrawing` class."," *"," * @module graphics"," * @class CanvasDrawing"," * @constructor"," */","function CanvasDrawing()","{","}","","CanvasDrawing.prototype = {"," /**"," * Maps path to methods"," *"," * @property _pathSymbolToMethod"," * @type Object"," * @private"," */"," _pathSymbolToMethod: {"," M: \"moveTo\","," m: \"relativeMoveTo\","," L: \"lineTo\","," l: \"relativeLineTo\","," C: \"curveTo\","," c: \"relativeCurveTo\","," Q: \"quadraticCurveTo\","," q: \"relativeQuadraticCurveTo\","," z: \"closePath\","," Z: \"closePath\""," },",""," /**"," * Current x position of the drawing."," *"," * @property _currentX"," * @type Number"," * @private"," */"," _currentX: 0,",""," /**"," * Current y position of the drqwing."," *"," * @property _currentY"," * @type Number"," * @private"," */"," _currentY: 0,"," "," /**"," * Parses hex color string and alpha value to rgba"," *"," * @method _toRGBA"," * @param {Object} val Color value to parse. Can be hex string, rgb or name."," * @param {Number} alpha Numeric value between 0 and 1 representing the alpha level."," * @private"," */"," _toRGBA: function(val, alpha) {"," alpha = (alpha !== undefined) ? alpha : 1;"," if (!Y_Color.re_RGB.test(val)) {"," val = TOHEX(val);"," }",""," if(Y_Color.re_hex.exec(val)) {"," val = 'rgba(' + ["," PARSE_INT(RE.$1, 16),"," PARSE_INT(RE.$2, 16),"," PARSE_INT(RE.$3, 16)"," ].join(',') + ',' + alpha + ')';"," }"," return val;"," },",""," /**"," * Converts color to rgb format"," *"," * @method _toRGB"," * @param val Color value to convert."," * @private "," */"," _toRGB: function(val) {"," return TORGB(val);"," },",""," /**"," * Sets the size of the graphics object."," * "," * @method setSize"," * @param w {Number} width to set for the instance."," * @param h {Number} height to set for the instance."," * @private"," */"," setSize: function(w, h) {"," if(this.get(\"autoSize\"))"," {"," if(w > this.node.getAttribute(\"width\"))"," {"," this.node.style.width = w + \"px\";"," this.node.setAttribute(\"width\", w);"," }"," if(h > this.node.getAttribute(\"height\"))"," {"," this.node.style.height = h + \"px\";"," this.node.setAttribute(\"height\", h);"," }"," }"," },"," "," /**"," * Tracks coordinates. Used to calculate the start point of dashed lines. "," *"," * @method _updateCoords"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @private"," */"," _updateCoords: function(x, y)"," {"," this._xcoords.push(x);"," this._ycoords.push(y);"," this._currentX = x;"," this._currentY = y;"," },",""," /**"," * Clears the coordinate arrays. Called at the end of a drawing operation. "," * "," * @method _clearAndUpdateCoords"," * @private"," */"," _clearAndUpdateCoords: function()"," {"," var x = this._xcoords.pop() || 0,"," y = this._ycoords.pop() || 0;"," this._updateCoords(x, y);"," },",""," /**"," * Moves the shape's dom node."," *"," * @method _updateNodePosition"," * @private"," */"," _updateNodePosition: function()"," {"," var node = this.get(\"node\"),"," x = this.get(\"x\"),"," y = this.get(\"y\"); "," node.style.position = \"absolute\";"," node.style.left = (x + this._left) + \"px\";"," node.style.top = (y + this._top) + \"px\";"," },"," "," /**"," * Queues up a method to be executed when a shape redraws."," *"," * @method _updateDrawingQueue"," * @param {Array} val An array containing data that can be parsed into a method and arguments. The value at zero-index of the array is a string reference of"," * the drawing method that will be called. All subsequent indices are argument for that method. For example, `lineTo(10, 100)` would be structured as:"," * `[\"lineTo\", 10, 100]`."," * @private"," */"," _updateDrawingQueue: function(val)"," {"," this._methods.push(val);"," },"," "," /**"," * Draws a line segment from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," lineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a line segment from the current drawing position to the relative x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," relativeLineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements lineTo methods."," *"," * @method _lineTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _lineTo: function(args, relative) "," {"," var point1 = args[0], "," i, "," len,"," x,"," y,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," if(!this._lineToMethods)"," {"," this._lineToMethods = [];"," }"," len = args.length - 1;"," if (typeof point1 === 'string' || typeof point1 === 'number') {"," for (i = 0; i < len; i = i + 2) {"," x = parseFloat(args[i]);"," y = parseFloat(args[i + 1]);"," x = x + relativeX;"," y = y + relativeY;"," this._updateDrawingQueue([\"lineTo\", x, y]);"," this._trackSize(x - wt, y - wt);"," this._trackSize(x + wt, y + wt);"," this._updateCoords(x, y);"," }"," }"," else"," {"," for (i = 0; i < len; i = i + 1) "," {"," x = parseFloat(args[i][0]);"," y = parseFloat(args[i][1]);"," this._updateDrawingQueue([\"lineTo\", x, y]);"," this._lineToMethods[this._lineToMethods.length] = this._methods[this._methods.length - 1];"," this._trackSize(x - wt, y - wt);"," this._trackSize(x + wt, y + wt);"," this._updateCoords(x, y);"," }"," }"," this._drawingComplete = false;"," return this;"," },",""," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," moveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Moves the current drawing position relative to specified x and y coordinates."," *"," * @method relativeMoveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeMoveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements moveTo methods."," *"," * @method _moveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _moveTo: function(args, relative) {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0,"," x = parseFloat(args[0]) + relativeX,"," y = parseFloat(args[1]) + relativeY;"," this._updateDrawingQueue([\"moveTo\", x, y]);"," this._trackSize(x - wt, y - wt);"," this._trackSize(x + wt, y + wt);"," this._updateCoords(x, y);"," this._drawingComplete = false;"," return this;"," },"," "," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," curveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a bezier curve relative to the current coordinates."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeCurveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), true]);"," },"," "," /**"," * Implements curveTo methods."," *"," * @method _curveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _curveTo: function(args, relative) {"," var w,"," h,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," x,"," y,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," len = args.length - 5;"," for(i = 0; i < len; i = i + 6)"," {"," cp1x = parseFloat(args[i]) + relativeX;"," cp1y = parseFloat(args[i + 1]) + relativeY;"," cp2x = parseFloat(args[i + 2]) + relativeX;"," cp2y = parseFloat(args[i + 3]) + relativeY;"," x = parseFloat(args[i + 4]) + relativeX;"," y = parseFloat(args[i + 5]) + relativeY;"," this._updateDrawingQueue([\"bezierCurveTo\", cp1x, cp1y, cp2x, cp2y, x, y]);"," this._drawingComplete = false;"," right = Math.max(x, Math.max(cp1x, cp2x));"," bottom = Math.max(y, Math.max(cp1y, cp2y));"," left = Math.min(x, Math.min(cp1x, cp2x));"," top = Math.min(y, Math.min(cp1y, cp2y));"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cp1x, cp1y], [cp2x, cp2y], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," },",""," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," quadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a quadratic bezier curve relative to the current position."," *"," * @method relativeQuadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeQuadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements quadraticCurveTo methods."," *"," * @method _quadraticCurveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _quadraticCurveTo: function(args, relative) {"," var cpx, "," cpy, "," x, "," y,"," w,"," h,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len = args.length - 3,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," for(i = 0; i < len; i = i + 4)"," {"," cpx = parseFloat(args[i]) + relativeX;"," cpy = parseFloat(args[i + 1]) + relativeY;"," x = parseFloat(args[i + 2]) + relativeX;"," y = parseFloat(args[i + 3]) + relativeY;"," this._drawingComplete = false;"," right = Math.max(x, cpx);"," bottom = Math.max(y, cpy);"," left = Math.min(x, cpx);"," top = Math.min(y, cpy);"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cpx, cpy], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._updateDrawingQueue([\"quadraticCurveTo\", cpx, cpy, x, y]);"," this._updateCoords(x, y);"," }"," return this;"," },",""," /**"," * Draws a circle. Used internally by `CanvasCircle` class."," *"," * @method drawCircle"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} r radius"," * @protected"," */"," drawCircle: function(x, y, radius) {"," var startAngle = 0,"," endAngle = 2 * Math.PI,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," circum = radius * 2;"," circum += wt;"," this._drawingComplete = false;"," this._trackSize(x + circum, y + circum);"," this._trackSize(x - wt, y - wt);"," this._updateCoords(x, y);"," this._updateDrawingQueue([\"arc\", x + radius, y + radius, radius, startAngle, endAngle, false]);"," return this;"," },",""," /**"," * Draws a diamond. "," * "," * @method drawDiamond"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} width width"," * @param {Number} height height"," * @protected"," */"," drawDiamond: function(x, y, width, height)"," {"," var midWidth = width * 0.5,"," midHeight = height * 0.5;"," this.moveTo(x + midWidth, y);"," this.lineTo(x + width, y + midHeight);"," this.lineTo(x + midWidth, y + height);"," this.lineTo(x, y + midHeight);"," this.lineTo(x + midWidth, y);"," return this;"," },",""," /**"," * Draws an ellipse. Used internally by `CanvasEllipse` class."," *"," * @method drawEllipse"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @protected"," */"," drawEllipse: function(x, y, w, h) {"," var l = 8,"," theta = -(45/180) * Math.PI,"," angle = 0,"," angleMid,"," radius = w/2,"," yRadius = h/2,"," i,"," centerX = x + radius,"," centerY = y + yRadius,"," ax, ay, bx, by, cx, cy,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0;",""," ax = centerX + Math.cos(0) * radius;"," ay = centerY + Math.sin(0) * yRadius;"," this.moveTo(ax, ay);"," for(i = 0; i < l; i++)"," {"," angle += theta;"," angleMid = angle - (theta / 2);"," bx = centerX + Math.cos(angle) * radius;"," by = centerY + Math.sin(angle) * yRadius;"," cx = centerX + Math.cos(angleMid) * (radius / Math.cos(theta / 2));"," cy = centerY + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));"," this._updateDrawingQueue([\"quadraticCurveTo\", cx, cy, bx, by]);"," }"," this._trackSize(x + w + wt, y + h + wt);"," this._trackSize(x - wt, y - wt);"," this._updateCoords(x, y);"," return this;"," },",""," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," drawRect: function(x, y, w, h) {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0;"," this._drawingComplete = false;"," this.moveTo(x, y);"," this.lineTo(x + w, y);"," this.lineTo(x + w, y + h);"," this.lineTo(x, y + h);"," this.lineTo(x, y);"," return this;"," },",""," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," drawRoundRect: function(x, y, w, h, ew, eh) {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0;"," this._drawingComplete = false;"," this.moveTo( x, y + eh);"," this.lineTo(x, y + h - eh);"," this.quadraticCurveTo(x, y + h, x + ew, y + h);"," this.lineTo(x + w - ew, y + h);"," this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);"," this.lineTo(x + w, y + eh);"," this.quadraticCurveTo(x + w, y, x + w - ew, y);"," this.lineTo(x + ew, y);"," this.quadraticCurveTo(x, y, x, y + eh);"," return this;"," },"," "," /**"," * Draws a wedge."," *"," * @method drawWedge"," * @param {Number} x x-coordinate of the wedge's center point"," * @param {Number} y y-coordinate of the wedge's center point"," * @param {Number} startAngle starting angle in degrees"," * @param {Number} arc sweep of the wedge. Negative values draw clockwise."," * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius."," * @param {Number} yRadius [optional] y radius for wedge."," * @private"," */"," drawWedge: function(x, y, startAngle, arc, radius, yRadius)"," {"," var wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," segs,"," segAngle,"," theta,"," angle,"," angleMid,"," ax,"," ay,"," bx,"," by,"," cx,"," cy,"," i = 0;"," yRadius = yRadius || radius;",""," this._drawingComplete = false;"," // move to x,y position"," this._updateDrawingQueue([\"moveTo\", x, y]);"," "," yRadius = yRadius || radius;"," "," // limit sweep to reasonable numbers"," if(Math.abs(arc) > 360)"," {"," arc = 360;"," }"," "," // First we calculate how many segments are needed"," // for a smooth arc."," segs = Math.ceil(Math.abs(arc) / 45);"," "," // Now calculate the sweep of each segment."," segAngle = arc / segs;"," "," // The math requires radians rather than degrees. To convert from degrees"," // use the formula (degrees/180)*Math.PI to get radians."," theta = -(segAngle / 180) * Math.PI;"," "," // convert angle startAngle to radians"," angle = (startAngle / 180) * Math.PI;"," "," // draw the curve in segments no larger than 45 degrees."," if(segs > 0)"," {"," // draw a line from the center to the start of the curve"," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius;"," ay = y + Math.sin(startAngle / 180 * Math.PI) * yRadius;"," this.lineTo(ax, ay);"," // Loop for drawing curve segments"," for(i = 0; i < segs; ++i)"," {"," angle += theta;"," angleMid = angle - (theta / 2);"," bx = x + Math.cos(angle) * radius;"," by = y + Math.sin(angle) * yRadius;"," cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));"," cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));"," this._updateDrawingQueue([\"quadraticCurveTo\", cx, cy, bx, by]);"," }"," // close the wedge by drawing a line to the center"," this._updateDrawingQueue([\"lineTo\", x, y]);"," }"," this._trackSize(-wt , -wt);"," this._trackSize((radius * 2) + wt, (radius * 2) + wt);"," return this;"," },"," "," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function() {"," this._closePath();"," return this;"," },",""," /**"," * Ends a fill and stroke"," *"," * @method closePath"," */"," closePath: function()"," {"," this._updateDrawingQueue([\"closePath\"]);"," this._updateDrawingQueue([\"beginPath\"]);"," },",""," /**"," * Clears the graphics object."," *"," * @method clear"," */"," "," /**"," * Returns a linear gradient fill"," *"," * @method _getLinearGradient"," * @return CanvasGradient"," * @private"," */"," _getLinearGradient: function() {"," var isNumber = Y.Lang.isNumber,"," fill = this.get(\"fill\"),"," stops = fill.stops,"," opacity,"," color,"," stop,"," i,"," len = stops.length,"," gradient,"," x = 0,"," y = 0,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," r = fill.rotation || 0,"," x1, x2, y1, y2,"," cx = x + w/2,"," cy = y + h/2,"," offset,"," radCon = Math.PI/180,"," tanRadians = parseFloat(parseFloat(Math.tan(r * radCon)).toFixed(8));"," if(Math.abs(tanRadians) * w/2 >= h/2)"," {"," if(r < 180)"," {"," y1 = y;"," y2 = y + h;"," }"," else"," {"," y1 = y + h;"," y2 = y;"," }"," x1 = cx - ((cy - y1)/tanRadians);"," x2 = cx - ((cy - y2)/tanRadians); "," }"," else"," {"," if(r > 90 && r < 270)"," {"," x1 = x + w;"," x2 = x;"," }"," else"," {"," x1 = x;"," x2 = x + w;"," }"," y1 = ((tanRadians * (cx - x1)) - cy) * -1;"," y2 = ((tanRadians * (cx - x2)) - cy) * -1;"," }"," gradient = this._context.createLinearGradient(x1, y1, x2, y2);"," for(i = 0; i < len; ++i)"," {"," stop = stops[i];"," opacity = stop.opacity;"," color = stop.color;"," offset = stop.offset;"," if(isNumber(opacity))"," {"," opacity = Math.max(0, Math.min(1, opacity));"," color = this._toRGBA(color, opacity);"," }"," else"," {"," color = TORGB(color);"," }"," offset = stop.offset || i/(len - 1);"," gradient.addColorStop(offset, color);"," }"," return gradient;"," },",""," /**"," * Returns a radial gradient fill"," *"," * @method _getRadialGradient"," * @return CanvasGradient"," * @private"," */"," _getRadialGradient: function() {"," var isNumber = Y.Lang.isNumber,"," fill = this.get(\"fill\"),"," r = fill.r,"," fx = fill.fx,"," fy = fill.fy,"," stops = fill.stops,"," opacity,"," color,"," stop,"," i,"," len = stops.length,"," gradient,"," x = 0,"," y = 0,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x1, x2, y1, y2, r2, "," xc, yc, xn, yn, d, "," offset,"," ratio,"," stopMultiplier;"," xc = x + w/2;"," yc = y + h/2;"," x1 = w * fx;"," y1 = h * fy;"," x2 = x + w/2;"," y2 = y + h/2;"," r2 = w * r;"," d = Math.sqrt( Math.pow(Math.abs(xc - x1), 2) + Math.pow(Math.abs(yc - y1), 2) );"," if(d >= r2)"," {"," ratio = d/r2;"," //hack. gradient won't show if it is exactly on the edge of the arc"," if(ratio === 1)"," {"," ratio = 1.01;"," }"," xn = (x1 - xc)/ratio;"," yn = (y1 - yc)/ratio;"," xn = xn > 0 ? Math.floor(xn) : Math.ceil(xn);"," yn = yn > 0 ? Math.floor(yn) : Math.ceil(yn);"," x1 = xc + xn;"," y1 = yc + yn;"," }"," "," //If the gradient radius is greater than the circle's, adjusting the radius stretches the gradient properly."," //If the gradient radius is less than the circle's, adjusting the radius of the gradient will not work. "," //Instead, adjust the color stops to reflect the smaller radius."," if(r >= 0.5)"," {"," gradient = this._context.createRadialGradient(x1, y1, r, x2, y2, r * w);"," stopMultiplier = 1;"," }"," else"," {"," gradient = this._context.createRadialGradient(x1, y1, r, x2, y2, w/2);"," stopMultiplier = r * 2;"," }"," for(i = 0; i < len; ++i)"," {"," stop = stops[i];"," opacity = stop.opacity;"," color = stop.color;"," offset = stop.offset;"," if(isNumber(opacity))"," {"," opacity = Math.max(0, Math.min(1, opacity));"," color = this._toRGBA(color, opacity);"," }"," else"," {"," color = TORGB(color);"," }"," offset = stop.offset || i/(len - 1);"," offset *= stopMultiplier;"," if(offset <= 1)"," {"," gradient.addColorStop(offset, color);"," }"," }"," return gradient;"," },","",""," /**"," * Clears all values"," *"," * @method _initProps"," * @private"," */"," _initProps: function() {"," this._methods = [];"," this._lineToMethods = [];"," this._xcoords = [0];"," this._ycoords = [0];"," this._width = 0;"," this._height = 0;"," this._left = 0;"," this._top = 0;"," this._right = 0;"," this._bottom = 0;"," this._currentX = 0;"," this._currentY = 0;"," },"," "," /**"," * Indicates a drawing has completed."," *"," * @property _drawingComplete"," * @type Boolean"," * @private"," */"," _drawingComplete: false,",""," /**"," * Creates canvas element"," *"," * @method _createGraphic"," * @return HTMLCanvasElement"," * @private"," */"," _createGraphic: function(config) {"," var graphic = Y.config.doc.createElement('canvas');"," return graphic;"," },"," "," /**"," * Returns the points on a curve"," *"," * @method getBezierData"," * @param Array points Array containing the begin, end and control points of a curve."," * @param Number t The value for incrementing the next set of points."," * @return Array"," * @private"," */"," getBezierData: function(points, t) { "," var n = points.length,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }"," return [ tmp[0][0], tmp[0][1] ]; "," },"," "," /**"," * Calculates the bounding box for a curve"," *"," * @method _setCurveBoundingBox"," * @param Array pts Array containing points for start, end and control points of a curve."," * @param Number w Width used to calculate the number of points to describe the curve."," * @param Number h Height used to calculate the number of points to describe the curve."," * @private"," */"," _setCurveBoundingBox: function(pts, w, h)"," {"," var i = 0,"," left = this._currentX,"," right = left,"," top = this._currentY,"," bottom = top,"," len = Math.round(Math.sqrt((w * w) + (h * h))),"," t = 1/len,"," wt = this._stroke && this._strokeWeight ? this._strokeWeight : 0,"," xy;"," for(i = 0; i < len; ++i)"," {"," xy = this.getBezierData(pts, t * i);"," left = isNaN(left) ? xy[0] : Math.min(xy[0], left);"," right = isNaN(right) ? xy[0] : Math.max(xy[0], right);"," top = isNaN(top) ? xy[1] : Math.min(xy[1], top);"," bottom = isNaN(bottom) ? xy[1] : Math.max(xy[1], bottom);"," }"," left = Math.round(left * 10)/10;"," right = Math.round(right * 10)/10;"," top = Math.round(top * 10)/10;"," bottom = Math.round(bottom * 10)/10;"," this._trackSize(right + wt, bottom + wt);"," this._trackSize(left - wt, top - wt);"," },",""," /**"," * Updates the size of the graphics object"," *"," * @method _trackSize"," * @param {Number} w width"," * @param {Number} h height"," * @private"," */"," _trackSize: function(w, h) {"," if (w > this._right) {"," this._right = w;"," }"," if(w < this._left)"," {"," this._left = w; "," }"," if (h < this._top)"," {"," this._top = h;"," }"," if (h > this._bottom) "," {"," this._bottom = h;"," }"," this._width = this._right - this._left;"," this._height = this._bottom - this._top;"," }","};","Y.CanvasDrawing = CanvasDrawing;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Shape.html\">`Shape`</a> class. "," * `CanvasShape` is not intended to be used directly. Instead, use the <a href=\"Shape.html\">`Shape`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Shape.html\">`Shape`</a> "," * class will point to the `CanvasShape` class."," *"," * @module graphics"," * @class CanvasShape"," * @constructor"," */","CanvasShape = function(cfg)","{"," this._transforms = [];"," this.matrix = new Y.Matrix();"," CanvasShape.superclass.constructor.apply(this, arguments);","};","","CanvasShape.NAME = \"shape\";","","Y.extend(CanvasShape, Y.GraphicBase, Y.mix({"," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," init: function()"," {"," this.initializer.apply(this, arguments);"," },",""," /**"," * Initializes the shape"," *"," * @private"," * @method _initialize"," */"," initializer: function(cfg)"," {"," var host = this,"," graphic = cfg.graphic,"," data = this.get(\"data\");"," host._initProps();"," host.createNode(); "," host._xcoords = [0];"," host._ycoords = [0];"," if(graphic)"," {"," this._setGraphic(graphic);"," }"," if(data)"," {"," host._parsePathData(data);"," }"," host._updateHandler();"," },"," "," /**"," * Set the Graphic instance for the shape."," *"," * @method _setGraphic"," * @param {Graphic | Node | HTMLElement | String} render This param is used to determine the graphic instance. If it is a `Graphic` instance, it will be assigned"," * to the `graphic` attribute. Otherwise, a new Graphic instance will be created and rendered into the dom element that the render represents."," * @private"," */"," _setGraphic: function(render)"," {"," var graphic;"," if(render instanceof Y.CanvasGraphic)"," {"," this._graphic = render;"," }"," else"," {"," render = Y.one(render);"," graphic = new Y.CanvasGraphic({"," render: render"," });"," graphic._appendShape(this);"," this._graphic = graphic;"," }"," },"," "," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," addClass: function(className)"," {"," var node = Y.one(this.get(\"node\"));"," node.addClass(className);"," },"," "," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," removeClass: function(className)"," {"," var node = Y.one(this.get(\"node\"));"," node.removeClass(className);"," },",""," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var graphic = this.get(\"graphic\"),"," parentXY = graphic.getXY(),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," return [parentXY[0] + x, parentXY[1] + y];"," },",""," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains X & Y values for new position (coordinates are page-based)"," */"," setXY: function(xy)"," {"," var graphic = this.get(\"graphic\"),"," parentXY = graphic.getXY(),"," x = xy[0] - parentXY[0],"," y = xy[1] - parentXY[1];"," this._set(\"x\", x);"," this._set(\"y\", y);"," this._updateNodePosition(x, y);"," },",""," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {CanvasShape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," contains: function(needle)"," {"," return needle === Y.one(this.node);"," },",""," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," test: function(selector)"," {"," return Y.one(this.get(\"node\")).test(selector);"," //return Y.Selector.test(this.node, selector);"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this.node;"," return node === refNode;"," },",""," /**"," * Value function for fill attribute"," *"," * @method _getDefaultFill"," * @return Object"," * @private"," */"," _getDefaultFill: function() {"," return {"," type: \"solid\","," opacity: 1,"," cx: 0.5,"," cy: 0.5,"," fx: 0.5,"," fy: 0.5,"," r: 0.5"," };"," },",""," /**"," * Value function for stroke attribute"," *"," * @method _getDefaultStroke"," * @return Object"," * @private"," */"," _getDefaultStroke: function() "," {"," return {"," weight: 1,"," dashstyle: \"none\","," color: \"#000\","," opacity: 1.0"," };"," },",""," /**"," * Left edge of the path"," *"," * @property _left"," * @type Number"," * @private"," */"," _left: 0,",""," /**"," * Right edge of the path"," *"," * @property _right"," * @type Number"," * @private"," */"," _right: 0,"," "," /**"," * Top edge of the path"," *"," * @property _top"," * @type Number"," * @private"," */"," _top: 0, "," "," /**"," * Bottom edge of the path"," *"," * @property _bottom"," * @type Number"," * @private"," */"," _bottom: 0,",""," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var host = this,"," node = Y.config.doc.createElement('canvas'),"," id = host.get(\"id\"),"," concat = host._camelCaseConcat,"," name = host.name;"," host._context = node.getContext('2d');"," node.setAttribute(\"overflow\", \"visible\");"," node.style.overflow = \"visible\";"," if(!host.get(\"visible\"))"," {"," node.style.visibility = \"hidden\";"," }"," node.setAttribute(\"id\", id);"," id = \"#\" + id;"," host.node = node;"," host.addClass(_getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name))); "," },"," "," /**"," * Overrides default `on` method. Checks to see if its a dom interaction event. If so, "," * return an event attached to the `node` element. If not, return the normal functionality."," *"," * @method on"," * @param {String} type event type"," * @param {Object} callback function"," * @private"," */"," on: function(type, fn)"," {"," if(Y.Node.DOM_EVENTS[type])"," {"," return Y.one(\"#\" + this.get(\"id\")).on(type, fn);"," }"," return Y.on.apply(this, arguments);"," },"," "," /**"," * Adds a stroke to the shape node."," *"," * @method _strokeChangeHandler"," * @param {Object} stroke Properties of the `stroke` attribute."," * @private"," */"," _setStrokeProps: function(stroke)"," {"," var color,"," weight,"," opacity,"," linejoin,"," linecap,"," dashstyle;"," if(stroke)"," {"," color = stroke.color;"," weight = PARSE_FLOAT(stroke.weight);"," opacity = PARSE_FLOAT(stroke.opacity);"," linejoin = stroke.linejoin || \"round\";"," linecap = stroke.linecap || \"butt\";"," dashstyle = stroke.dashstyle;"," this._miterlimit = null;"," this._dashstyle = (dashstyle && Y.Lang.isArray(dashstyle) && dashstyle.length > 1) ? dashstyle : null;"," this._strokeWeight = weight;",""," if (IS_NUMBER(weight) && weight > 0) "," {"," this._stroke = 1;"," } "," else "," {"," this._stroke = 0;"," }"," if (IS_NUMBER(opacity)) {"," this._strokeStyle = this._toRGBA(color, opacity);"," }"," else"," {"," this._strokeStyle = color;"," }"," this._linecap = linecap;"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," this._linejoin = linejoin;"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(IS_NUMBER(linejoin))"," {"," this._miterlimit = Math.max(linejoin, 1);"," this._linejoin = \"miter\";"," }"," }"," }"," else"," {"," this._stroke = 0;"," }"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function() "," {"," var host = this,"," val = arguments[0];"," AttributeLite.prototype.set.apply(host, arguments);"," if(host.initialized)"," {"," host._updateHandler();"," }"," },"," "," /**"," * Adds a fill to the shape node."," *"," * @method _setFillProps "," * @param {Object} fill Properties of the `fill` attribute."," * @private"," */"," _setFillProps: function(fill)"," {"," var isNumber = IS_NUMBER,"," color,"," opacity,"," type;"," if(fill)"," {"," color = fill.color;"," type = fill.type;"," if(type == \"linear\" || type == \"radial\")"," {"," this._fillType = type;"," }"," else if(color)"," {"," opacity = fill.opacity;"," if (isNumber(opacity)) "," {"," opacity = Math.max(0, Math.min(1, opacity));"," color = this._toRGBA(color, opacity);"," } "," else "," {"," color = TORGB(color);"," }",""," this._fillColor = color;"," this._fillType = 'solid';"," }"," else"," {"," this._fillColor = null;"," }"," }"," else"," {"," this._fillType = null;"," this._fillColor = null;"," }"," },",""," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y)"," {"," this._translateX += x;"," this._translateY += y;"," this._addTransform(\"translate\", arguments);"," },",""," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," translateX: function(x)"," {"," this._translateX += x;"," this._addTransform(\"translateX\", arguments);"," },",""," /**"," * Performs a translate on the y-coordinate. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," translateY: function(y)"," {"," this._translateY += y;"," this._addTransform(\"translateY\", arguments);"," },",""," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y)"," {"," this._addTransform(\"skew\", arguments);"," },",""," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x)"," {"," this._addTransform(\"skewX\", arguments);"," },",""," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y)"," {"," this._addTransform(\"skewY\", arguments);"," },",""," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg)"," {"," this._rotation = deg;"," this._addTransform(\"rotate\", arguments);"," },",""," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y)"," {"," this._addTransform(\"scale\", arguments);"," },"," "," /**"," * Storage for `rotation` atribute."," *"," * @property _rotation"," * @type Number"," * @private"," */"," _rotation: 0,"," "," /**"," * Storage for the transform attribute."," *"," * @property _transform"," * @type String"," * @private"," */"," _transform: \"\",",""," /**"," * Adds a transform to the shape."," *"," * @method _addTransform"," * @param {String} type The transform being applied."," * @param {Array} args The arguments for the transform."," * @private"," */"," _addTransform: function(type, args)"," {"," args = Y.Array(args);"," this._transform = Y_LANG.trim(this._transform + \" \" + type + \"(\" + args.join(\", \") + \")\");"," args.unshift(type);"," this._transforms.push(args);"," if(this.initialized)"," {"," this._updateTransform();"," }"," },",""," /**"," * Applies all transforms."," *"," * @method _updateTransform"," * @private"," */"," _updateTransform: function()"," {"," var node = this.node,"," key,"," transform,"," transformOrigin = this.get(\"transformOrigin\"),"," matrix = this.matrix,"," i,"," len = this._transforms.length;"," "," if(this._transforms && this._transforms.length > 0)"," {"," for(i = 0; i < len; ++i)"," {"," key = this._transforms[i].shift();"," if(key)"," {"," matrix[key].apply(matrix, this._transforms[i]); "," }"," }"," transform = matrix.toCSSText();"," }"," "," this._graphic.addToRedrawQueue(this); "," transformOrigin = (100 * transformOrigin[0]) + \"% \" + (100 * transformOrigin[1]) + \"%\";"," Y_DOM.setStyle(node, \"transformOrigin\", transformOrigin);"," if(transform)"," {"," Y_DOM.setStyle(node, \"transform\", transform);"," }"," this._transforms = [];"," },",""," /**"," * Updates `Shape` based on attribute changes."," *"," * @method _updateHandler"," * @private"," */"," _updateHandler: function()"," {"," this._draw();"," this._updateTransform();"," },"," "," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node;"," this.clear();"," this._closePath();"," node.style.left = this.get(\"x\") + \"px\";"," node.style.top = this.get(\"y\") + \"px\";"," },",""," /**"," * Completes a shape or drawing"," *"," * @method _closePath"," * @private"," */"," _closePath: function()"," {"," if(!this._methods)"," {"," return;"," }"," var node = this.get(\"node\"),"," w = this._right - this._left,"," h = this._bottom - this._top,"," context = this._context,"," methods = [],"," cachedMethods = this._methods.concat(),"," i,"," j,"," method,"," args,"," argsLen,"," len = 0;"," this._context.clearRect(0, 0, node.width, node.height);"," if(this._methods)"," {"," len = cachedMethods.length;"," if(!len || len < 1)"," {"," return;"," }"," for(i = 0; i < len; ++i)"," {"," methods[i] = cachedMethods[i].concat();"," args = methods[i];"," argsLen = (args[0] == \"quadraticCurveTo\" || args[0] == \"bezierCurveTo\") ? args.length : 3;"," for(j = 1; j < argsLen; ++j)"," {"," if(j % 2 === 0)"," {"," args[j] = args[j] - this._top;"," }"," else"," {"," args[j] = args[j] - this._left;"," }"," }"," }"," node.setAttribute(\"width\", Math.min(w, 2000));"," node.setAttribute(\"height\", Math.min(2000, h));"," context.beginPath();"," for(i = 0; i < len; ++i)"," {"," args = methods[i].concat();"," if(args && args.length > 0)"," {"," method = args.shift();"," if(method)"," {"," if(method == \"closePath\")"," {"," context.closePath();"," this._strokeAndFill(context);"," }"," else if(method && method == \"lineTo\" && this._dashstyle)"," {"," args.unshift(this._xcoords[i] - this._left, this._ycoords[i] - this._top);"," this._drawDashedLine.apply(this, args);"," }"," else"," {"," context[method].apply(context, args); "," }"," }"," }"," }",""," this._strokeAndFill(context);"," this._drawingComplete = true;"," this._clearAndUpdateCoords();"," this._updateNodePosition();"," this._methods = cachedMethods;"," }"," },",""," /**"," * Completes a stroke and/or fill operation on the context."," *"," * @method _strokeAndFill"," * @param {Context} Reference to the context element of the canvas instance."," * @private"," */"," _strokeAndFill: function(context)"," {"," if (this._fillType) "," {"," if(this._fillType == \"linear\")"," {"," context.fillStyle = this._getLinearGradient();"," }"," else if(this._fillType == \"radial\")"," {"," context.fillStyle = this._getRadialGradient();"," }"," else"," {"," context.fillStyle = this._fillColor;"," }"," context.closePath();"," context.fill();"," }",""," if (this._stroke) {"," if(this._strokeWeight)"," {"," context.lineWidth = this._strokeWeight;"," }"," context.lineCap = this._linecap;"," context.lineJoin = this._linejoin;"," if(this._miterlimit)"," {"," context.miterLimit = this._miterlimit;"," }"," context.strokeStyle = this._strokeStyle;"," context.stroke();"," }"," },",""," /**"," * Draws a dashed line between two points."," * "," * @method _drawDashedLine"," * @param {Number} xStart The x position of the start of the line"," * @param {Number} yStart The y position of the start of the line"," * @param {Number} xEnd The x position of the end of the line"," * @param {Number} yEnd The y position of the end of the line"," * @private"," */"," _drawDashedLine: function(xStart, yStart, xEnd, yEnd)"," {"," var context = this._context,"," dashsize = this._dashstyle[0],"," gapsize = this._dashstyle[1],"," segmentLength = dashsize + gapsize,"," xDelta = xEnd - xStart,"," yDelta = yEnd - yStart,"," delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),"," segmentCount = Math.floor(Math.abs(delta / segmentLength)),"," radians = Math.atan2(yDelta, xDelta),"," xCurrent = xStart,"," yCurrent = yStart,"," i;"," xDelta = Math.cos(radians) * segmentLength;"," yDelta = Math.sin(radians) * segmentLength;"," "," for(i = 0; i < segmentCount; ++i)"," {"," context.moveTo(xCurrent, yCurrent);"," context.lineTo(xCurrent + Math.cos(radians) * dashsize, yCurrent + Math.sin(radians) * dashsize);"," xCurrent += xDelta;"," yCurrent += yDelta;"," }"," "," context.moveTo(xCurrent, yCurrent);"," delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));"," "," if(delta > dashsize)"," {"," context.lineTo(xCurrent + Math.cos(radians) * dashsize, yCurrent + Math.sin(radians) * dashsize);"," }"," else if(delta > 0)"," {"," context.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);"," }"," "," context.moveTo(xEnd, yEnd);"," },",""," //This should move to CanvasDrawing class. "," //Currently docmented in CanvasDrawing class."," clear: function() {"," this._initProps();"," if(this.node) "," {"," this._context.clearRect(0, 0, this.node.width, this.node.height);"," }"," return this;"," },"," "," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," getBounds: function()"," {"," var type = this._type,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," if(type == \"path\")"," {"," x = x + this._left;"," y = y + this._top;"," w = this._right - this._left;"," h = this._bottom - this._top;"," }"," return this._getContentRect(w, h, x, y);"," },",""," /**"," * Calculates the bounding box for the shape."," *"," * @method _getContentRect"," * @param {Number} w width of the shape"," * @param {Number} h height of the shape"," * @param {Number} x x-coordinate of the shape"," * @param {Number} y y-coordinate of the shape"," * @private"," */"," _getContentRect: function(w, h, x, y)"," {"," var transformOrigin = this.get(\"transformOrigin\"),"," transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h,"," transforms = this.matrix.getTransformArray(this.get(\"transform\")),"," matrix = new Y.Matrix(),"," i,"," len = transforms.length,"," transform,"," key,"," contentRect;"," if(this._type == \"path\")"," {"," transformX = transformX + x;"," transformY = transformY + y;"," }"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," for(i = 0; i < len; i = i + 1)"," {"," transform = transforms[i];"," key = transform.shift();"," if(key)"," {"," matrix[key].apply(matrix, transform); "," }"," }"," matrix.translate(-transformX, -transformY);"," contentRect = matrix.getContentRect(w, h, x, y);"," return contentRect;"," },",""," /**"," * Places the shape above all other shapes."," *"," * @method toFront"," */"," toFront: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toFront(this);"," }"," },",""," /**"," * Places the shape underneath all other shapes."," *"," * @method toFront"," */"," toBack: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toBack(this);"," }"," },",""," /**"," * Parses path data string and call mapped methods."," *"," * @method _parsePathData"," * @param {String} val The path data"," * @private"," */"," _parsePathData: function(val)"," {"," var method,"," methodSymbol,"," args,"," commandArray = Y.Lang.trim(val.match(SPLITPATHPATTERN)),"," i,"," len, "," str,"," symbolToMethod = this._pathSymbolToMethod;"," if(commandArray)"," {"," this.clear();"," len = commandArray.length || 0;"," for(i = 0; i < len; i = i + 1)"," {"," str = commandArray[i];"," methodSymbol = str.substr(0, 1);"," args = str.substr(1).match(SPLITARGSPATTERN);"," method = symbolToMethod[methodSymbol];"," if(method)"," {"," if(args)"," {"," this[method].apply(this, args);"," }"," else"," {"," this[method].apply(this);"," }"," }"," }"," this.end();"," }"," },"," "," /**"," * Destroys the shape instance."," *"," * @method destroy"," */"," destroy: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic.removeShape(this);"," }"," else"," {"," this._destroy();"," }"," },",""," /**"," * Implementation for shape destruction"," *"," * @method destroy"," * @protected"," */"," _destroy: function()"," {"," if(this.node)"," {"," Y.one(this.node).remove(true);"," this._context = null;"," this.node = null;"," }"," }","}, Y.CanvasDrawing.prototype));","","CanvasShape.ATTRS = {"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," transformOrigin: {"," valueFn: function()"," {"," return [0.5, 0.5];"," }"," },"," "," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd> "," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," transform: {"," setter: function(val)"," {"," this.matrix.init(); "," this._transforms = this.matrix.getTransformArray(val);"," this._transform = val;"," return val;"," },",""," getter: function()"," {"," return this._transform;"," }"," },",""," /**"," * Dom node for the shape"," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this.node;"," }"," },",""," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," value: 0"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," value: 0"," },",""," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," x: {"," value: 0"," },",""," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," y: {"," value: 0"," },",""," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val){"," var node = this.get(\"node\"),"," visibility = val ? \"visible\" : \"hidden\";"," if(node)"," {"," node.style.visibility = visibility;"," }"," return val;"," }"," },",""," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * </dl>"," * <p>The corresponding `SVGShape` class implements the following additional properties.</p>"," * <dl>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * </dl>"," * <p>These properties are not currently implemented in `CanvasShape` or `VMLShape`.</p> "," *"," * @config fill"," * @type Object "," */"," fill: {"," valueFn: \"_getDefaultFill\","," "," setter: function(val)"," {"," var fill,"," tmpl = this.get(\"fill\") || this._getDefaultFill();"," fill = (val) ? Y.merge(tmpl, val) : null;"," if(fill && fill.color)"," {"," if(fill.color === undefined || fill.color == \"none\")"," {"," fill.color = null;"," }"," }"," this._setFillProps(fill);"," return fill;"," }"," },",""," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," stroke: {"," valueFn: \"_getDefaultStroke\",",""," setter: function(val)"," {"," var tmpl = this.get(\"stroke\") || this._getDefaultStroke(),"," wt;"," if(val && val.hasOwnProperty(\"weight\"))"," {"," wt = parseInt(val.weight, 10);"," if(!isNaN(wt))"," {"," val.weight = wt;"," }"," }"," val = (val) ? Y.merge(tmpl, val) : null;"," this._setStrokeProps(val);"," return val;"," }"," },"," "," //Not used. Remove in future."," autoSize: {"," value: false"," },",""," // Only implemented in SVG"," // Determines whether the instance will receive mouse events."," // "," // @config pointerEvents"," // @type string"," //"," pointerEvents: {"," value: \"visiblePainted\""," },",""," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," data: {"," setter: function(val)"," {"," if(this.get(\"node\"))"," {"," this._parsePathData(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the container Graphic."," *"," * @config graphic"," * @type Graphic"," */"," graphic: {"," readOnly: true,",""," getter: function()"," {"," return this._graphic;"," }"," }","};","Y.CanvasShape = CanvasShape;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Path.html\">`Path`</a> class. "," * `CanvasPath` is not intended to be used directly. Instead, use the <a href=\"Path.html\">`Path`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Path.html\">`Path`</a> "," * class will point to the `CanvasPath` class."," *"," * @module graphics"," * @class CanvasPath"," * @extends CanvasShape"," */","CanvasPath = function(cfg)","{"," CanvasPath.superclass.constructor.apply(this, arguments);","};","CanvasPath.NAME = \"path\";","Y.extend(CanvasPath, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," this._closePath();"," this._updateTransform();"," },",""," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var host = this,"," node = Y.config.doc.createElement('canvas'),"," name = host.name,"," concat = host._camelCaseConcat,"," id = host.get(\"id\");"," host._context = node.getContext('2d');"," node.setAttribute(\"overflow\", \"visible\");"," node.setAttribute(\"pointer-events\", \"none\");"," node.style.pointerEvents = \"none\";"," node.style.overflow = \"visible\";"," node.setAttribute(\"id\", id);"," id = \"#\" + id;"," host.node = node;"," host.addClass(_getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name))); "," },",""," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function()"," {"," this._draw();"," }","});","","CanvasPath.ATTRS = Y.merge(Y.CanvasShape.ATTRS, {"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," getter: function()"," {"," var offset = this._stroke && this._strokeWeight ? (this._strokeWeight * 2) : 0;"," return this._width - offset;"," },",""," setter: function(val)"," {"," this._width = val;"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," getter: function()"," {"," var offset = this._stroke && this._strokeWeight ? (this._strokeWeight * 2) : 0;"," return this._height - offset;"," },",""," setter: function(val)"," {"," this._height = val;"," return val;"," }"," },"," "," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," return this._path;"," }"," }","});","Y.CanvasPath = CanvasPath;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Rect.html\">`Rect`</a> class. "," * `CanvasRect` is not intended to be used directly. Instead, use the <a href=\"Rect.html\">`Rect`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Rect.html\">`Rect`</a> "," * class will point to the `CanvasRect` class."," *"," * @module graphics"," * @class CanvasRect"," * @constructor"," */","CanvasRect = function()","{"," CanvasRect.superclass.constructor.apply(this, arguments);","};","CanvasRect.NAME = \"rect\";","Y.extend(CanvasRect, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"rect\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," this.clear();"," this.drawRect(0, 0, w, h);"," this._closePath();"," }","});","CanvasRect.ATTRS = Y.CanvasShape.ATTRS;","Y.CanvasRect = CanvasRect;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * `CanvasEllipse` is not intended to be used directly. Instead, use the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Ellipse.html\">`Ellipse`</a> "," * class will point to the `CanvasEllipse` class."," *"," * @module graphics"," * @class CanvasEllipse"," * @constructor"," */","CanvasEllipse = function(cfg)","{"," CanvasEllipse.superclass.constructor.apply(this, arguments);","};","","CanvasEllipse.NAME = \"ellipse\";","","Y.extend(CanvasEllipse, CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"ellipse\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var w = this.get(\"width\"),"," h = this.get(\"height\");"," this.clear();"," this.drawEllipse(0, 0, w, h);"," this._closePath();"," }","});","CanvasEllipse.ATTRS = Y.merge(CanvasShape.ATTRS, {"," /**"," * Horizontal radius for the ellipse. "," *"," * @config xRadius"," * @type Number"," */"," xRadius: {"," setter: function(val)"," {"," this.set(\"width\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"width\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," },",""," /**"," * Vertical radius for the ellipse. "," *"," * @config yRadius"," * @type Number"," * @readOnly"," */"," yRadius: {"," setter: function(val)"," {"," this.set(\"height\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"height\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," }","});","Y.CanvasEllipse = CanvasEllipse;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the <a href=\"Circle.html\">`Circle`</a> class. "," * `CanvasCircle` is not intended to be used directly. Instead, use the <a href=\"Circle.html\">`Circle`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Circle.html\">`Circle`</a> "," * class will point to the `CanvasCircle` class."," *"," * @module graphics"," * @class CanvasCircle"," * @constructor"," */","CanvasCircle = function(cfg)","{"," CanvasCircle.superclass.constructor.apply(this, arguments);","};"," ","CanvasCircle.NAME = \"circle\";","","Y.extend(CanvasCircle, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"circle\",",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var radius = this.get(\"radius\");"," if(radius)"," {"," this.clear();"," this.drawCircle(0, 0, radius);"," this._closePath();"," }"," }","});","","CanvasCircle.ATTRS = Y.merge(Y.CanvasShape.ATTRS, {"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */"," radius: {"," lazyAdd: false"," }","});","Y.CanvasCircle = CanvasCircle;","/**"," * Draws pie slices"," *"," * @module graphics"," * @class CanvasPieSlice"," * @constructor"," */","CanvasPieSlice = function()","{"," CanvasPieSlice.superclass.constructor.apply(this, arguments);","};","CanvasPieSlice.NAME = \"canvasPieSlice\";","Y.extend(CanvasPieSlice, Y.CanvasShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Change event listener"," *"," * @private"," * @method _updateHandler"," */"," _draw: function(e)"," {"," var x = this.get(\"cx\"),"," y = this.get(\"cy\"),"," startAngle = this.get(\"startAngle\"),"," arc = this.get(\"arc\"),"," radius = this.get(\"radius\");"," this.clear();"," this._left = x;"," this._right = radius;"," this._top = y;"," this._bottom = radius;"," this.drawWedge(x, y, startAngle, arc, radius);"," this.end();"," }"," });","CanvasPieSlice.ATTRS = Y.mix({"," cx: {"," value: 0"," },",""," cy: {"," value: 0"," },"," /**"," * Starting angle in relation to a circle in which to begin the pie slice drawing."," *"," * @config startAngle"," * @type Number"," */"," startAngle: {"," value: 0"," },",""," /**"," * Arc of the slice."," *"," * @config arc"," * @type Number"," */"," arc: {"," value: 0"," },",""," /**"," * Radius of the circle in which the pie slice is drawn"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","}, Y.CanvasShape.ATTRS);","Y.CanvasPieSlice = CanvasPieSlice;","/**"," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> implementation of the `Graphic` class. "," * `CanvasGraphic` is not intended to be used directly. Instead, use the <a href=\"Graphic.html\">`Graphic`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities but has "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> capabilities, the <a href=\"Graphic.html\">`Graphic`</a> "," * class will point to the `CanvasGraphic` class."," *"," * @module graphics"," * @class CanvasGraphic"," * @constructor"," */","function CanvasGraphic(config) {"," "," CanvasGraphic.superclass.constructor.apply(this, arguments);","}","","CanvasGraphic.NAME = \"canvasGraphic\";","","CanvasGraphic.ATTRS = {"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," render: {},"," "," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this._node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," shapes: {"," readOnly: true,",""," getter: function()"," {"," return this._shapes;"," }"," },",""," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the graphic instance's position."," *"," * @config contentBounds "," * @type Object"," * @readOnly"," */"," contentBounds: {"," readOnly: true,",""," getter: function()"," {"," return this._contentBounds;"," }"," },",""," /**"," * The outermost html element of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this._node;"," }"," },",""," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.width = val + \"px\"; "," }"," return val;"," }"," },",""," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," height: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.height = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," autoSize: {"," value: false"," },",""," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," preserveAspectRatio: {"," value: \"xMidYMid\""," },",""," /**"," * The contentBounds will resize to greater values but not smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," resizeDown: {"," value: false"," },",""," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," this._x = val;"," if(this._node)"," {"," this._node.style.left = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," this._y = val;"," if(this._node)"," {"," this._node.style.top = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," autoDraw: {"," value: true"," },",""," /**"," * Indicates whether the `Graphic` and its children are visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val)"," {"," this._toggleVisible(val);"," return val;"," }"," }","};","","Y.extend(CanvasGraphic, Y.GraphicBase, {"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, value) "," {"," var host = this,"," redrawAttrs = {"," autoDraw: true,"," autoSize: true,"," preserveAspectRatio: true,"," resizeDown: true"," },"," key,"," forceRedraw = false;"," AttributeLite.prototype.set.apply(host, arguments); "," if(host._state.autoDraw === true && Y.Object.size(this._shapes) > 0)"," {"," if(Y_LANG.isString && redrawAttrs[attr])"," {"," forceRedraw = true;"," }"," else if(Y_LANG.isObject(attr))"," {"," for(key in redrawAttrs)"," {"," if(redrawAttrs.hasOwnProperty(key) && attr[key])"," {"," forceRedraw = true;"," break;"," }"," }"," }"," }"," if(forceRedraw)"," {"," host._redraw();"," }"," },",""," /**"," * Storage for `x` attribute."," *"," * @property _x"," * @type Number"," * @private"," */"," _x: 0,",""," /**"," * Storage for `y` attribute."," *"," * @property _y"," * @type Number"," * @private"," */"," _y: 0,",""," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var node = Y.one(this._node),"," xy;"," if(node)"," {"," xy = node.getXY();"," }"," return xy;"," },"," "," /**"," * Initializes the class."," *"," * @method initializer"," * @param {Object} config Optional attributes "," * @private"," */"," initializer: function(config) {"," var render = this.get(\"render\"),"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\","," w = this.get(\"width\") || 0,"," h = this.get(\"height\") || 0;"," this._shapes = {};"," this._redrawQueue = {};"," this._contentBounds = {"," left: 0,"," top: 0,"," right: 0,"," bottom: 0"," };"," this._node = DOCUMENT.createElement('div');"," this._node.style.position = \"absolute\";"," this._node.style.visibility = visibility;"," this.set(\"width\", w);"," this.set(\"height\", h);"," if(render)"," {"," this.render(render);"," }"," },",""," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {HTMLElement} parentNode node in which to render the graphics node into."," */"," render: function(render) {"," var parentNode = Y.one(render),"," node = this._node,"," w = this.get(\"width\") || parseInt(parentNode.getComputedStyle(\"width\"), 10),"," h = this.get(\"height\") || parseInt(parentNode.getComputedStyle(\"height\"), 10);"," parentNode = parentNode || DOCUMENT.body;"," parentNode.appendChild(node);"," node.style.display = \"block\";"," node.style.position = \"absolute\";"," node.style.left = \"0px\";"," node.style.top = \"0px\";"," this.set(\"width\", w);"," this.set(\"height\", h);"," this.parentNode = parentNode;"," return this;"," },",""," /**"," * Removes all nodes."," *"," * @method destroy"," */"," destroy: function()"," {"," this.removeAllShapes();"," if(this._node)"," {"," this._removeChildren(this._node);"," Y.one(this._node).destroy();"," }"," },",""," /**"," * Generates a shape instance by type."," *"," * @method addShape"," * @param {Object} cfg attributes for the shape"," * @return Shape"," */"," addShape: function(cfg)"," {"," cfg.graphic = this;"," if(!this.get(\"visible\"))"," {"," cfg.visible = false;"," }"," var shapeClass = this._getShapeClass(cfg.type),"," shape = new shapeClass(cfg);"," this._appendShape(shape);"," return shape;"," },",""," /**"," * Adds a shape instance to the graphic instance."," *"," * @method _appendShape"," * @param {Shape} shape The shape instance to be added to the graphic."," * @private"," */"," _appendShape: function(shape)"," {"," var node = shape.node,"," parentNode = this._frag || this._node;"," if(this.get(\"autoDraw\")) "," {"," parentNode.appendChild(node);"," }"," else"," {"," this._getDocFrag().appendChild(node);"," }"," },",""," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," removeShape: function(shape)"," {"," if(!(shape instanceof CanvasShape))"," {"," if(Y_LANG.isString(shape))"," {"," shape = this._shapes[shape];"," }"," }"," if(shape && shape instanceof CanvasShape)"," {"," shape._destroy();"," delete this._shapes[shape.get(\"id\")];"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," return shape;"," },",""," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," removeAllShapes: function()"," {"," var shapes = this._shapes,"," i;"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].destroy();"," }"," }"," this._shapes = {};"," },"," "," /**"," * Clears the graphics object."," *"," * @method clear"," */"," clear: function() {"," this.removeAllShapes();"," },",""," /**"," * Removes all child nodes."," *"," * @method _removeChildren"," * @param {HTMLElement} node"," * @private"," */"," _removeChildren: function(node)"," {"," if(node && node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },"," "," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} val indicates visibilitye"," * @private"," */"," _toggleVisible: function(val)"," {"," var i,"," shapes = this._shapes,"," visibility = val ? \"visible\" : \"hidden\";"," if(shapes)"," {"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].set(\"visible\", val);"," }"," }"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," },",""," /**"," * Returns a shape class. Used by `addShape`. "," *"," * @method _getShapeClass"," * @param {Shape | String} val Indicates which shape class. "," * @return Function "," * @private"," */"," _getShapeClass: function(val)"," {"," var shape = this._shapeClass[val];"," if(shape)"," {"," return shape;"," }"," return val;"," },"," "," /**"," * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation."," *"," * @property _shapeClass"," * @type Object"," * @private"," */"," _shapeClass: {"," circle: Y.CanvasCircle,"," rect: Y.CanvasRect,"," path: Y.CanvasPath,"," ellipse: Y.CanvasEllipse,"," pieslice: Y.CanvasPieSlice"," },"," "," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," getShapeById: function(id)"," {"," var shape = this._shapes[id];"," return shape;"," },",""," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */"," batch: function(method)"," {"," var autoDraw = this.get(\"autoDraw\");"," this.set(\"autoDraw\", false);"," method();"," this.set(\"autoDraw\", autoDraw);"," },",""," /**"," * Returns a document fragment to for attaching shapes."," *"," * @method _getDocFrag"," * @return DocumentFragment"," * @private"," */"," _getDocFrag: function()"," {"," if(!this._frag)"," {"," this._frag = DOCUMENT.createDocumentFragment();"," }"," return this._frag;"," },"," "," /**"," * Redraws all shapes."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var autoSize = this.get(\"autoSize\"),"," preserveAspectRatio = this.get(\"preserveAspectRatio\"),"," box = this.get(\"resizeDown\") ? this._getUpdatedContentBounds() : this._contentBounds,"," contentWidth,"," contentHeight,"," w,"," h,"," xScale,"," yScale,"," translateX = 0,"," translateY = 0,"," matrix,"," node = this.get(\"node\");"," if(autoSize)"," {"," if(autoSize == \"sizeContentToGraphic\")"," {"," contentWidth = box.right - box.left;"," contentHeight = box.bottom - box.top;"," w = parseFloat(Y_DOM.getComputedStyle(node, \"width\"));"," h = parseFloat(Y_DOM.getComputedStyle(node, \"height\"));"," matrix = new Y.Matrix();"," if(preserveAspectRatio == \"none\")"," {"," xScale = w/contentWidth;"," yScale = h/contentHeight;"," }"," else"," {"," if(contentWidth/contentHeight !== w/h) "," {"," if(contentWidth * h/contentHeight > w)"," {"," xScale = yScale = w/contentWidth;"," translateY = this._calculateTranslate(preserveAspectRatio.slice(5).toLowerCase(), contentHeight * w/contentWidth, h);"," }"," else"," {"," xScale = yScale = h/contentHeight;"," translateX = this._calculateTranslate(preserveAspectRatio.slice(1, 4).toLowerCase(), contentWidth * h/contentHeight, w);"," }"," }"," }"," Y_DOM.setStyle(node, \"transformOrigin\", \"0% 0%\");"," translateX = translateX - (box.left * xScale);"," translateY = translateY - (box.top * yScale);"," matrix.translate(translateX, translateY);"," matrix.scale(xScale, yScale);"," Y_DOM.setStyle(node, \"transform\", matrix.toCSSText());"," }"," else"," {"," this.set(\"width\", box.right);"," this.set(\"height\", box.bottom);"," }"," }"," if(this._frag)"," {"," this._node.appendChild(this._frag);"," this._frag = null;"," }"," },"," "," /**"," * Determines the value for either an x or y value to be used for the <code>translate</code> of the Graphic."," *"," * @method _calculateTranslate"," * @param {String} position The position for placement. Possible values are min, mid and max."," * @param {Number} contentSize The total size of the content."," * @param {Number} boundsSize The total size of the Graphic."," * @return Number"," * @private"," */"," _calculateTranslate: function(position, contentSize, boundsSize)"," {"," var ratio = boundsSize - contentSize,"," coord;"," switch(position)"," {"," case \"mid\" :"," coord = ratio * 0.5;"," break;"," case \"max\" :"," coord = ratio;"," break;"," default :"," coord = 0;"," break;"," }"," return coord;"," },"," "," /**"," * Adds a shape to the redraw queue and calculates the contentBounds. Used internally "," * by `Shape` instances."," *"," * @method addToRedrawQueue"," * @param Shape shape The shape instance to add to the queue"," * @protected"," */"," addToRedrawQueue: function(shape)"," {"," var shapeBox,"," box;"," this._shapes[shape.get(\"id\")] = shape;"," if(!this.get(\"resizeDown\"))"," {"," shapeBox = shape.getBounds();"," box = this._contentBounds;"," box.left = box.left < shapeBox.left ? box.left : shapeBox.left;"," box.top = box.top < shapeBox.top ? box.top : shapeBox.top;"," box.right = box.right > shapeBox.right ? box.right : shapeBox.right;"," box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;"," this._contentBounds = box;"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," },",""," /**"," * Recalculates and returns the `contentBounds` for the `Graphic` instance."," *"," * @method _getUpdatedContentBounds"," * @return {Object} "," * @private"," */"," _getUpdatedContentBounds: function()"," {"," var bounds,"," i,"," shape,"," queue = this._shapes,"," box = {};"," for(i in queue)"," {"," if(queue.hasOwnProperty(i))"," {"," shape = queue[i];"," bounds = shape.getBounds();"," box.left = Y_LANG.isNumber(box.left) ? Math.min(box.left, bounds.left) : bounds.left;"," box.top = Y_LANG.isNumber(box.top) ? Math.min(box.top, bounds.top) : bounds.top;"," box.right = Y_LANG.isNumber(box.right) ? Math.max(box.right, bounds.right) : bounds.right;"," box.bottom = Y_LANG.isNumber(box.bottom) ? Math.max(box.bottom, bounds.bottom) : bounds.bottom;"," }"," }"," box.left = Y_LANG.isNumber(box.left) ? box.left : 0;"," box.top = Y_LANG.isNumber(box.top) ? box.top : 0;"," box.right = Y_LANG.isNumber(box.right) ? box.right : 0;"," box.bottom = Y_LANG.isNumber(box.bottom) ? box.bottom : 0;"," this._contentBounds = box;"," return box;"," },",""," /**"," * Inserts shape on the top of the tree."," *"," * @method _toFront"," * @param {CanvasShape} Shape to add."," * @private"," */"," _toFront: function(shape)"," {"," var contentNode = this.get(\"node\");"," if(shape instanceof Y.CanvasShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," contentNode.appendChild(shape);"," }"," },",""," /**"," * Inserts shape as the first child of the content node."," *"," * @method _toBack"," * @param {CanvasShape} Shape to add."," * @private"," */"," _toBack: function(shape)"," {"," var contentNode = this.get(\"node\"),"," targetNode;"," if(shape instanceof Y.CanvasShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," targetNode = contentNode.firstChild;"," if(targetNode)"," {"," contentNode.insertBefore(shape, targetNode);"," }"," else"," {"," contentNode.appendChild(shape);"," }"," }"," }","});","","Y.CanvasGraphic = CanvasGraphic;","","","}, '3.7.3', {\"requires\": [\"graphics\"]});"]; _yuitest_coverage["build/graphics-canvas/graphics-canvas.js"].lines = {"1":0,"3":0,"37":0,"41":0,"89":0,"90":0,"91":0,"94":0,"95":0,"101":0,"112":0,"124":0,"126":0,"128":0,"129":0,"131":0,"133":0,"134":0,"149":0,"150":0,"151":0,"152":0,"163":0,"165":0,"176":0,"179":0,"180":0,"181":0,"195":0,"207":0,"219":0,"232":0,"240":0,"242":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"251":0,"252":0,"253":0,"254":0,"259":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"267":0,"270":0,"271":0,"283":0,"295":0,"307":0,"312":0,"313":0,"314":0,"315":0,"316":0,"317":0,"332":0,"347":0,"359":0,"376":0,"377":0,"379":0,"380":0,"381":0,"382":0,"383":0,"384":0,"385":0,"386":0,"387":0,"388":0,"389":0,"390":0,"391":0,"392":0,"393":0,"394":0,"395":0,"396":0,"410":0,"423":0,"435":0,"451":0,"453":0,"454":0,"455":0,"456":0,"457":0,"458":0,"459":0,"460":0,"461":0,"462":0,"463":0,"464":0,"465":0,"466":0,"467":0,"469":0,"482":0,"486":0,"487":0,"488":0,"489":0,"490":0,"491":0,"492":0,"507":0,"509":0,"510":0,"511":0,"512":0,"513":0,"514":0,"528":0,"540":0,"541":0,"542":0,"543":0,"545":0,"546":0,"547":0,"548":0,"549":0,"550":0,"551":0,"553":0,"554":0,"555":0,"556":0,"569":0,"570":0,"571":0,"572":0,"573":0,"574":0,"575":0,"576":0,"591":0,"592":0,"593":0,"594":0,"595":0,"596":0,"597":0,"598":0,"599":0,"600":0,"601":0,"602":0,"619":0,"632":0,"634":0,"636":0,"638":0,"641":0,"643":0,"648":0,"651":0,"655":0,"658":0,"661":0,"664":0,"665":0,"666":0,"668":0,"670":0,"671":0,"672":0,"673":0,"674":0,"675":0,"676":0,"679":0,"681":0,"682":0,"683":0,"692":0,"693":0,"703":0,"704":0,"721":0,"741":0,"743":0,"745":0,"746":0,"750":0,"751":0,"753":0,"754":0,"758":0,"760":0,"761":0,"765":0,"766":0,"768":0,"769":0,"771":0,"772":0,"774":0,"775":0,"776":0,"777":0,"778":0,"780":0,"781":0,"785":0,"787":0,"788":0,"790":0,"801":0,"822":0,"823":0,"824":0,"825":0,"826":0,"827":0,"828":0,"829":0,"830":0,"832":0,"834":0,"836":0,"838":0,"839":0,"840":0,"841":0,"842":0,"843":0,"849":0,"851":0,"852":0,"856":0,"857":0,"859":0,"861":0,"862":0,"863":0,"864":0,"865":0,"867":0,"868":0,"872":0,"874":0,"875":0,"876":0,"878":0,"881":0,"892":0,"893":0,"894":0,"895":0,"896":0,"897":0,"898":0,"899":0,"900":0,"901":0,"902":0,"903":0,"923":0,"924":0,"937":0,"942":0,"943":0,"946":0,"947":0,"948":0,"949":0,"952":0,"966":0,"975":0,"977":0,"978":0,"979":0,"980":0,"981":0,"983":0,"984":0,"985":0,"986":0,"987":0,"988":0,"1000":0,"1001":0,"1003":0,"1005":0,"1007":0,"1009":0,"1011":0,"1013":0,"1015":0,"1016":0,"1019":0,"1031":0,"1033":0,"1034":0,"1035":0,"1038":0,"1040":0,"1050":0,"1061":0,"1064":0,"1065":0,"1066":0,"1067":0,"1068":0,"1070":0,"1072":0,"1074":0,"1076":0,"1089":0,"1090":0,"1092":0,"1096":0,"1097":0,"1100":0,"1101":0,"1113":0,"1114":0,"1125":0,"1126":0,"1137":0,"1141":0,"1152":0,"1156":0,"1157":0,"1158":0,"1170":0,"1182":0,"1194":0,"1195":0,"1206":0,"1226":0,"1279":0,"1284":0,"1285":0,"1286":0,"1287":0,"1289":0,"1291":0,"1292":0,"1293":0,"1294":0,"1308":0,"1310":0,"1312":0,"1324":0,"1330":0,"1332":0,"1333":0,"1334":0,"1335":0,"1336":0,"1337":0,"1338":0,"1339":0,"1340":0,"1342":0,"1344":0,"1348":0,"1350":0,"1351":0,"1355":0,"1357":0,"1358":0,"1360":0,"1364":0,"1365":0,"1367":0,"1368":0,"1374":0,"1389":0,"1391":0,"1392":0,"1394":0,"1407":0,"1411":0,"1413":0,"1414":0,"1415":0,"1417":0,"1419":0,"1421":0,"1422":0,"1424":0,"1425":0,"1429":0,"1432":0,"1433":0,"1437":0,"1442":0,"1443":0,"1456":0,"1457":0,"1458":0,"1470":0,"1471":0,"1483":0,"1484":0,"1496":0,"1507":0,"1518":0,"1529":0,"1530":0,"1541":0,"1572":0,"1573":0,"1574":0,"1575":0,"1576":0,"1578":0,"1590":0,"1598":0,"1600":0,"1602":0,"1603":0,"1605":0,"1608":0,"1611":0,"1612":0,"1613":0,"1614":0,"1616":0,"1618":0,"1629":0,"1630":0,"1641":0,"1642":0,"1643":0,"1644":0,"1645":0,"1656":0,"1658":0,"1660":0,"1672":0,"1673":0,"1675":0,"1676":0,"1678":0,"1680":0,"1682":0,"1683":0,"1684":0,"1685":0,"1687":0,"1689":0,"1693":0,"1697":0,"1698":0,"1699":0,"1700":0,"1702":0,"1703":0,"1705":0,"1706":0,"1708":0,"1710":0,"1711":0,"1713":0,"1715":0,"1716":0,"1720":0,"1726":0,"1727":0,"1728":0,"1729":0,"1730":0,"1743":0,"1745":0,"1747":0,"1749":0,"1751":0,"1755":0,"1757":0,"1758":0,"1761":0,"1762":0,"1764":0,"1766":0,"1767":0,"1768":0,"1770":0,"1772":0,"1773":0,"1789":0,"1801":0,"1802":0,"1804":0,"1806":0,"1807":0,"1808":0,"1809":0,"1812":0,"1813":0,"1815":0,"1817":0,"1819":0,"1821":0,"1824":0,"1830":0,"1831":0,"1833":0,"1835":0,"1849":0,"1854":0,"1856":0,"1857":0,"1858":0,"1859":0,"1861":0,"1876":0,"1886":0,"1888":0,"1889":0,"1891":0,"1892":0,"1893":0,"1894":0,"1896":0,"1897":0,"1898":0,"1900":0,"1903":0,"1904":0,"1905":0,"1915":0,"1916":0,"1918":0,"1929":0,"1930":0,"1932":0,"1945":0,"1953":0,"1955":0,"1956":0,"1957":0,"1959":0,"1960":0,"1961":0,"1962":0,"1963":0,"1965":0,"1967":0,"1971":0,"1975":0,"1986":0,"1987":0,"1989":0,"1993":0,"2005":0,"2007":0,"2008":0,"2009":0,"2014":0,"2025":0,"2061":0,"2062":0,"2063":0,"2064":0,"2069":0,"2085":0,"2098":0,"2103":0,"2104":0,"2106":0,"2108":0,"2162":0,"2164":0,"2166":0,"2168":0,"2220":0,"2222":0,"2223":0,"2225":0,"2227":0,"2230":0,"2231":0,"2268":0,"2270":0,"2272":0,"2273":0,"2275":0,"2278":0,"2279":0,"2280":0,"2310":0,"2312":0,"2314":0,"2329":0,"2333":0,"2345":0,"2347":0,"2349":0,"2350":0,"2368":0,"2369":0,"2381":0,"2386":0,"2387":0,"2388":0,"2389":0,"2390":0,"2391":0,"2392":0,"2393":0,"2394":0,"2404":0,"2408":0,"2418":0,"2419":0,"2424":0,"2425":0,"2438":0,"2439":0,"2444":0,"2445":0,"2461":0,"2465":0,"2477":0,"2479":0,"2481":0,"2482":0,"2500":0,"2502":0,"2503":0,"2504":0,"2507":0,"2508":0,"2520":0,"2522":0,"2525":0,"2527":0,"2545":0,"2547":0,"2548":0,"2549":0,"2552":0,"2562":0,"2567":0,"2568":0,"2570":0,"2572":0,"2586":0,"2591":0,"2592":0,"2594":0,"2596":0,"2600":0,"2612":0,"2614":0,"2617":0,"2619":0,"2637":0,"2638":0,"2640":0,"2641":0,"2642":0,"2647":0,"2657":0,"2658":0,"2663":0,"2676":0,"2677":0,"2682":0,"2696":0,"2704":0,"2706":0,"2708":0,"2709":0,"2727":0,"2732":0,"2733":0,"2734":0,"2735":0,"2736":0,"2737":0,"2738":0,"2741":0,"2779":0,"2791":0,"2793":0,"2796":0,"2798":0,"2816":0,"2821":0,"2822":0,"2824":0,"2826":0,"2842":0,"2858":0,"2874":0,"2887":0,"2889":0,"2891":0,"2904":0,"2906":0,"2908":0,"2978":0,"2983":0,"2984":0,"2986":0,"2988":0,"3001":0,"3006":0,"3007":0,"3009":0,"3011":0,"3039":0,"3040":0,"3045":0,"3057":0,"3066":0,"3067":0,"3069":0,"3071":0,"3073":0,"3075":0,"3077":0,"3079":0,"3080":0,"3085":0,"3087":0,"3117":0,"3119":0,"3121":0,"3123":0,"3134":0,"3138":0,"3139":0,"3140":0,"3146":0,"3147":0,"3148":0,"3149":0,"3150":0,"3151":0,"3153":0,"3164":0,"3168":0,"3169":0,"3170":0,"3171":0,"3172":0,"3173":0,"3174":0,"3175":0,"3176":0,"3177":0,"3187":0,"3188":0,"3190":0,"3191":0,"3204":0,"3205":0,"3207":0,"3209":0,"3211":0,"3212":0,"3224":0,"3226":0,"3228":0,"3232":0,"3244":0,"3246":0,"3248":0,"3251":0,"3253":0,"3254":0,"3256":0,"3258":0,"3260":0,"3270":0,"3272":0,"3274":0,"3276":0,"3279":0,"3288":0,"3300":0,"3302":0,"3303":0,"3305":0,"3306":0,"3307":0,"3321":0,"3324":0,"3326":0,"3328":0,"3330":0,"3334":0,"3336":0,"3350":0,"3351":0,"3353":0,"3355":0,"3382":0,"3383":0,"3394":0,"3395":0,"3396":0,"3397":0,"3409":0,"3411":0,"3413":0,"3424":0,"3437":0,"3439":0,"3441":0,"3442":0,"3443":0,"3444":0,"3445":0,"3446":0,"3448":0,"3449":0,"3453":0,"3455":0,"3457":0,"3458":0,"3462":0,"3463":0,"3467":0,"3468":0,"3469":0,"3470":0,"3471":0,"3472":0,"3476":0,"3477":0,"3480":0,"3482":0,"3483":0,"3499":0,"3501":0,"3504":0,"3505":0,"3507":0,"3508":0,"3510":0,"3511":0,"3513":0,"3526":0,"3528":0,"3529":0,"3531":0,"3532":0,"3533":0,"3534":0,"3535":0,"3536":0,"3537":0,"3539":0,"3541":0,"3554":0,"3559":0,"3561":0,"3563":0,"3564":0,"3565":0,"3566":0,"3567":0,"3568":0,"3571":0,"3572":0,"3573":0,"3574":0,"3575":0,"3576":0,"3588":0,"3589":0,"3591":0,"3593":0,"3595":0,"3608":0,"3610":0,"3612":0,"3614":0,"3616":0,"3617":0,"3619":0,"3623":0,"3629":0}; _yuitest_coverage["build/graphics-canvas/graphics-canvas.js"].functions = {"CanvasDrawing:37":0,"_toRGBA:88":0,"_toRGB:111":0,"setSize:123":0,"_updateCoords:147":0,"_clearAndUpdateCoords:161":0,"_updateNodePosition:174":0,"_updateDrawingQueue:193":0,"lineTo:205":0,"relativeLineTo:217":0,"_lineTo:230":0,"moveTo:281":0,"relativeMoveTo:293":0,"_moveTo:306":0,"curveTo:331":0,"relativeCurveTo:346":0,"_curveTo:358":0,"quadraticCurveTo:409":0,"relativeQuadraticCurveTo:422":0,"_quadraticCurveTo:434":0,"drawCircle:481":0,"drawDiamond:505":0,"drawEllipse:527":0,"drawRect:568":0,"drawRoundRect:590":0,"drawWedge:617":0,"end:691":0,"closePath:701":0,"_getLinearGradient:720":0,"_getRadialGradient:800":0,"_initProps:891":0,"_createGraphic:922":0,"getBezierData:936":0,"_setCurveBoundingBox:964":0,"_trackSize:999":0,"CanvasShape:1031":0,"init:1048":0,"initializer:1059":0,"_setGraphic:1087":0,"addClass:1111":0,"removeClass:1123":0,"getXY:1135":0,"setXY:1150":0,"contains:1168":0,"test:1180":0,"compareTo:1193":0,"_getDefaultFill:1205":0,"_getDefaultStroke:1224":0,"createNode:1277":0,"on:1306":0,"_setStrokeProps:1322":0,"set:1387":0,"_setFillProps:1405":0,"translate:1454":0,"translateX:1468":0,"translateY:1481":0,"skew:1494":0,"skewX:1505":0,"skewY:1516":0,"rotate:1527":0,"scale:1539":0,"_addTransform:1570":0,"_updateTransform:1588":0,"_updateHandler:1627":0,"_draw:1639":0,"_closePath:1654":0,"_strokeAndFill:1741":0,"_drawDashedLine:1787":0,"clear:1829":0,"getBounds:1847":0,"_getContentRect:1874":0,"toFront:1913":0,"toBack:1927":0,"_parsePathData:1943":0,"destroy:1984":0,"_destroy:2003":0,"valueFn:2023":0,"setter:2059":0,"getter:2067":0,"getter:2083":0,"valueFn:2096":0,"setter:2101":0,"setter:2161":0,"setter:2218":0,"setter:2266":0,"setter:2308":0,"getter:2327":0,"CanvasPath:2345":0,"_draw:2366":0,"createNode:2379":0,"end:2402":0,"getter:2416":0,"setter:2422":0,"getter:2436":0,"setter:2442":0,"getter:2459":0,"CanvasRect:2477":0,"_draw:2498":0,"CanvasEllipse:2520":0,"_draw:2543":0,"setter:2560":0,"getter:2565":0,"setter:2584":0,"getter:2589":0,"CanvasCircle:2612":0,"_draw:2635":0,"setter:2655":0,"getter:2661":0,"setter:2674":0,"getter:2680":0,"CanvasPieSlice:2704":0,"_draw:2725":0,"CanvasGraphic:2791":0,"valueFn:2814":0,"setter:2819":0,"getter:2840":0,"getter:2856":0,"getter:2872":0,"setter:2885":0,"setter:2902":0,"getter:2976":0,"setter:2981":0,"getter:2999":0,"setter:3004":0,"setter:3037":0,"set:3055":0,"getXY:3115":0,"initializer:3133":0,"render:3163":0,"destroy:3185":0,"addShape:3202":0,"_appendShape:3222":0,"removeShape:3242":0,"removeAllShapes:3268":0,"clear:3287":0,"_removeChildren:3298":0,"_toggleVisible:3319":0,"_getShapeClass:3348":0,"getShapeById:3380":0,"batch:3392":0,"_getDocFrag:3407":0,"_redraw:3422":0,"_calculateTranslate:3497":0,"addToRedrawQueue:3524":0,"_getUpdatedContentBounds:3552":0,"_toFront:3586":0,"_toBack:3606":0,"(anonymous 1):1":0}; _yuitest_coverage["build/graphics-canvas/graphics-canvas.js"].coveredLines = 890;@@ -4705,4 +4705,4 @@ Y.CanvasGraphic = CanvasGraphic; -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-canvas/graphics-canvas-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -3635,4 +3635,4 @@ Y.CanvasGraphic = CanvasGraphic; -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-canvas/graphics-canvas-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics-canvas",function(e,t){function T(){}function N(e){N.superclass.constructor.apply(this,arguments)}var n="canvas",r="shape",i=/[a-z][^a-z]*/ig,s=/[-]?[0-9]*[0-9|\.][0-9]*/g,o=e.config.doc,u=e.Lang,a=e.AttributeLite,f,l,c,h,p,d,v=e.DOM,m=e.Color,g=parseInt,y=parseFloat,b=u.isNumber,w=RegExp,E=m.toRGB,S=m.toHex,x=e.ClassNameManager.getClassName;T.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_currentX:0,_currentY:0,_toRGBA:function(e,t){return t=t!==undefined?t:1,m.re_RGB.test(e)||(e=S(e)),m.re_hex.exec(e)&&(e="rgba("+[g(w.$1,16),g(w.$2,16),g(w.$3,16)].join(",")+","+t+")"),e},_toRGB:function(e){return E(e)},setSize:function(e,t){this.get("autoSize")&&(e>this.node.getAttribute("width")&&(this.node.style.width=e+"px",this.node.setAttribute("width",e)),t>this.node.getAttribute("height")&&(this.node.style.height=t+"px",this.node.setAttribute("height",t)))},_updateCoords:function(e,t){this._xcoords.push(e),this._ycoords.push(t),this._currentX=e,this._currentY=t},_clearAndUpdateCoords:function(){var e=this._xcoords.pop()||0,t=this._ycoords.pop()||0;this._updateCoords(e,t)},_updateNodePosition:function(){var e=this.get("node"),t=this.get("x"),n=this.get("y");e.style.position="absolute",e.style.left=t+this._left+"px",e.style.top=n+this._top+"px"},_updateDrawingQueue:function(e){this._methods.push(e)},lineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!1])},relativeLineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!0])},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=this._stroke&&this._strokeWeight?this._strokeWeight:0,a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;this._lineToMethods||(this._lineToMethods=[]),i=e.length-1;if(typeof n=="string"||typeof n=="number")for(r=0;r<i;r+=2)s=parseFloat(e[r]),o=parseFloat(e[r+1]),s+=a,o+=f,this._updateDrawingQueue(["lineTo",s,o]),this._trackSize(s-u,o-u),this._trackSize(s+u,o+u),this._updateCoords(s,o);else for(r=0;r<i;r+=1)s=parseFloat(e[r][0]),o=parseFloat(e[r][1]),this._updateDrawingQueue(["lineTo",s,o]),this._lineToMethods[this._lineToMethods.length]=this._methods[this._methods.length-1],this._trackSize(s-u,o-u),this._trackSize(s+u,o+u),this._updateCoords(s,o);return this._drawingComplete=!1,this},moveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!1])},relativeMoveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!0])},_moveTo:function(e,t){var n=this._stroke&&this._strokeWeight?this._strokeWeight:0,r=t?parseFloat(this._currentX):0,i=t?parseFloat(this._currentY):0,s=parseFloat(e[0])+r,o=parseFloat(e[1])+i;return this._updateDrawingQueue(["moveTo",s,o]),this._trackSize(s-n,o-n),this._trackSize(s+n,o+n),this._updateCoords(s,o),this._drawingComplete=!1,this},curveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!1])},relativeCurveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!0])},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g=t?parseFloat(this._currentX):0,y=t?parseFloat(this._currentY):0;m=e.length-5;for(v=0;v<m;v+=6)i=parseFloat(e[v])+g,s=parseFloat(e[v+1])+y,o=parseFloat(e[v+2])+g,u=parseFloat(e[v+3])+y,a=parseFloat(e[v+4])+g,f=parseFloat(e[v+5])+y,this._updateDrawingQueue(["bezierCurveTo",i,s,o,u,a,f]),this._drawingComplete=!1,c=Math.max(a,Math.max(i,o)),p=Math.max(f,Math.max(s,u)),h=Math.min(a,Math.min(i,o)),d=Math.min(f,Math.min(s,u)),n=Math.abs(c-h),r=Math.abs(p-d),l=[[this._currentX,this._currentY],[i,s],[o,u],[a,f]],this._setCurveBoundingBox(l,n,r),this._currentX=a,this._currentY=f},quadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!1])},relativeQuadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!0])},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d=e.length-3,v=this._stroke&&this._strokeWeight?this._strokeWeight:0,m=t?parseFloat(this._currentX):0,g=t?parseFloat(this._currentY):0;for(p=0;p<d;p+=4)n=parseFloat(e[p])+m,r=parseFloat(e[p+1])+g,i=parseFloat(e[p+2])+m,s=parseFloat(e[p+3])+g,this._drawingComplete=!1,f=Math.max(i,n),c=Math.max(s,r),l=Math.min(i,n),h=Math.min(s,r),o=Math.abs(f-l),u=Math.abs(c-h),a=[[this._currentX,this._currentY],[n,r],[i,s]],this._setCurveBoundingBox(a,o,u),this._updateDrawingQueue(["quadraticCurveTo",n,r,i,s]),this._updateCoords(i,s);return this},drawCircle:function(e,t,n){var r=0,i=2*Math.PI,s=this._stroke&&this._strokeWeight?this._strokeWeight:0,o=n*2;return o+=s,this._drawingComplete=!1,this._trackSize(e+o,t+o),this._trackSize(e-s,t-s),this._updateCoords(e,t),this._updateDrawingQueue(["arc",e+n,t+n,n,r,i,!1]),this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawEllipse:function(e,t,n,r){var i=8,s=-0.25*Math.PI,o=0,u,a=n/2,f=r/2,l,c=e+a,h=t+f,p,d,v,m,g,y,b=this._stroke&&this._strokeWeight?this._strokeWeight:0;p=c+Math.cos(0)*a,d=h+Math.sin(0)*f,this.moveTo(p,d);for(l=0;l<i;l++)o+=s,u=o-s/2,v=c+Math.cos(o)*a,m=h+Math.sin(o)*f,g=c+Math.cos(u)*(a/Math.cos(s/2)),y=h+Math.sin(u)*(f/Math.cos(s/2)),this._updateDrawingQueue(["quadraticCurveTo",g,y,v,m]);return this._trackSize(e+n+b,t+r+b),this._trackSize(e-b,t-b),this._updateCoords(e,t),this},drawRect:function(e,t,n,r){var i=this._stroke&&this._strokeWeight?this._strokeWeight:0;return this._drawingComplete=!1,this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this},drawRoundRect:function(e,t,n,r,i,s){var o=this._stroke&&this._strokeWeight?this._strokeWeight:0;return this._drawingComplete=!1,this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s),this},drawWedge:function(e,t,n,r,i,s){var o=this._stroke&&this._strokeWeight?this._strokeWeight:0,u,a,f,l,c,h,p,d,v,m,g,y=0;s=s||i,this._drawingComplete=!1,this._updateDrawingQueue(["moveTo",e,t]),s=s||i,Math.abs(r)>360&&(r=360),u=Math.ceil(Math.abs(r)/45),a=r/u,f=-(a/180)*Math.PI,l=n/180*Math.PI;if(u>0){h=e+Math.cos(n/180*Math.PI)*i,p=t+Math.sin(n/180*Math.PI)*s,this.lineTo(h,p);for(y=0;y<u;++y)l+=f,c=l-f/2,d=e+Math.cos(l)*i,v=t+Math.sin(l)*s,m=e+Math.cos(c)*(i/Math.cos(f/2)),g=t+Math.sin(c)*(s/Math.cos(f/2)),this._updateDrawingQueue(["quadraticCurveTo",m,g,d,v]);this._updateDrawingQueue(["lineTo",e,t])}return this._trackSize(-o,-o),this._trackSize(i*2+o,i*2+o),this},end:function(){return this._closePath(),this},closePath:function(){this._updateDrawingQueue(["closePath"]),this._updateDrawingQueue(["beginPath"])},_getLinearGradient:function(){var t=e.Lang.isNumber,n=this.get("fill"),r=n.stops,i,s,o,u,a=r.length,f,l=0,c=0,h=this.get("width"),p=this.get("height"),d=n.rotation||0,v,m,g,y,b=l+h/2,w=c+p/2,S,x=Math.PI/180,T=parseFloat(parseFloat(Math.tan(d*x)).toFixed(8));Math.abs(T)*h/2>=p/2?(d<180?(g=c,y=c+p):(g=c+p,y=c),v=b-(w-g)/T,m=b-(w-y)/T):(d>90&&d<270?(v=l+h,m=l):(v=l,m=l+h),g=(T*(b-v)-w)*-1,y=(T*(b-m)-w)*-1),f=this._context.createLinearGradient(v,g,m,y);for(u=0;u<a;++u)o=r[u],i=o.opacity,s=o.color,S=o.offset,t(i)?(i=Math.max(0,Math.min(1,i)),s=this._toRGBA(s,i)):s=E(s),S=o.offset||u/(a-1),f.addColorStop(S,s);return f},_getRadialGradient:function(){var t=e.Lang.isNumber,n=this.get("fill"),r=n.r,i=n.fx,s=n.fy,o=n.stops,u,a,f,l,c=o.length,h,p=0,d=0,v=this.get("width"),m=this.get("height"),g,y,b,w,S,x,T,N,C,k,L,A,O;x=p+v/2,T=d+m/2,g=v*i,b=m*s,y=p+v/2,w=d+m/2,S=v*r,k=Math.sqrt(Math.pow(Math.abs(x-g),2)+Math.pow(Math.abs(T-b),2)),k>=S&&(A=k/S,A===1&&(A=1.01),N=(g-x)/A,C=(b-T)/A,N=N>0?Math.floor(N):Math.ceil(N),C=C>0?Math.floor(C):Math.ceil(C),g=x+N,b=T+C),r>=.5?(h=this._context.createRadialGradient(g,b,r,y,w,r*v),O=1):(h=this._context.createRadialGradient(g,b,r,y,w,v/2),O=r*2);for(l=0;l<c;++l)f=o[l],u=f.opacity,a=f.color,L=f.offset,t(u)?(u=Math.max(0,Math.min(1,u)),a=this._toRGBA(a,u)):a=E(a),L=f.offset||l/(c-1),L*=O,L<=1&&h.addColorStop(L,a);return h},_initProps:function(){this._methods=[],this._lineToMethods=[],this._xcoords=[0],this._ycoords=[0],this._width=0,this._height=0,this._left=0,this._top=0,this._right=0,this._bottom=0,this._currentX=0,this._currentY=0},_drawingComplete:!1,_createGraphic:function(t){var n=e.config.doc.createElement("canvas");return n},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r=0,i=this._currentX,s=i,o=this._currentY,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l=this._stroke&&this._strokeWeight?this._strokeWeight:0,c;for(r=0;r<a;++r)c=this.getBezierData(e,f*r),i=isNaN(i)?c[0]:Math.min(c[0],i),s=isNaN(s)?c[0]:Math.max(c[0],s),o=isNaN(o)?c[1]:Math.min(c[1],o),u=isNaN(u)?c[1]:Math.max(c[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s+l,u+l),this._trackSize(i-l,o-l)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top}},e.CanvasDrawing=T,f=function(t){this._transforms=[],this.matrix=new e.Matrix,f.superclass.constructor.apply(this,arguments)},f.NAME="shape",e.extend(f,e.GraphicBase,e.mix({init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t._initProps(),t.createNode(),t._xcoords=[0],t._ycoords=[0],n&&this._setGraphic(n),r&&t._parsePathData(r),t._updateHandler()},_setGraphic:function(t){var n;t instanceof e.CanvasGraphic?this._graphic=t:(t=e.one(t),n=new e.CanvasGraphic({render:t}),n._appendShape(this),this._graphic=n)},addClass:function(t){var n=e.one(this.get("node"));n.addClass(t)},removeClass:function(t){var n=e.one(this.get("node"));n.removeClass(t)},getXY:function(){var e=this.get("graphic"),t=e.getXY(),n=this.get("x"),r=this.get("y");return[t[0]+n,t[1]+r]},setXY:function(e){var t=this.get("graphic"),n=t.getXY(),r=e[0]-n[0],i=e[1]-n[1];this._set("x",r),this._set("y",i),this._updateNodePosition(r,i)},contains:function(t){return t===e.one(this.node)},test:function(t){return e.one(this.get("node")).test(t)},compareTo:function(e){var t=this.node;return t===e},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},_left:0,_right:0,_top:0,_bottom:0,createNode:function(){var t=this,i=e.config.doc.createElement("canvas"),s=t.get("id"),o=t._camelCaseConcat,u=t.name;t._context=i.getContext("2d"),i.setAttribute("overflow","visible"),i.style.overflow="visible",t.get("visible")||(i.style.visibility="hidden"),i.setAttribute("id",s),s="#"+s,t.node=i,t.addClass(x(r)+" "+x(o(n,r))+" "+x(u)+" "+x(o(n,u)))},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.one("#"+this.get("id")).on(t,n):e.on.apply(this,arguments)},_setStrokeProps:function(t){var n,r,i,s,o,u;t?(n=t.color,r=y(t.weight),i=y(t.opacity),s=t.linejoin||"round",o=t.linecap||"butt",u=t.dashstyle,this._miterlimit=null,this._dashstyle=u&&e.Lang.isArray(u)&&u.length>1?u:null,this._strokeWeight=r,b(r)&&r>0?this._stroke=1:this._stroke=0,b(i)?this._strokeStyle=this._toRGBA(n,i):this._strokeStyle=n,this._linecap=o,s=="round"||s=="bevel"?this._linejoin=s:(s=parseInt(s,10),b(s)&&(this._miterlimit=Math.max(s,1),this._linejoin="miter"))):this._stroke=0},set:function(){var e=this,t=arguments[0];a.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},_setFillProps:function(e){var t=b,n,r,i;e?(n=e.color,i=e.type,i=="linear"||i=="radial"?this._fillType=i:n?(r=e.opacity,t(r)?(r=Math.max(0,Math.min(1,r)),n=this._toRGBA(n,r)):n=E(n),this._fillColor=n,this._fillType="solid"):this._fillColor=null):(this._fillType=null,this._fillColor=null)},translate:function(e,t){this._translateX+=e,this._translateY+=t,this._addTransform("translate",arguments)},translateX:function(e){this._translateX+=e,this._addTransform("translateX",arguments)},translateY:function(e){this._translateY+=e,this._addTransform("translateY",arguments)},skew:function(e,t){this._addTransform("skew",arguments)},skewX:function(e){this._addTransform("skewX",arguments)},skewY:function(e){this._addTransform("skewY",arguments)},rotate:function(e){this._rotation=e,this._addTransform("rotate",arguments)},scale:function(e,t){this._addTransform("scale",arguments)},_rotation:0,_transform:"",_addTransform:function(t,n){n=e.Array(n),this._transform=u.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var e=this.node,t,n,r=this.get("transformOrigin"),i=this.matrix,s,o=this._transforms.length;if(this._transforms&&this._transforms.length>0){for(s=0;s<o;++s)t=this._transforms[s].shift(),t&&i[t].apply(i,this._transforms[s]);n=i.toCSSText()}this._graphic.addToRedrawQueue(this),r=100*r[0]+"% "+100*r[1]+"%",v.setStyle(e,"transformOrigin",r),n&&v.setStyle(e,"transform",n),this._transforms=[]},_updateHandler:function(){this._draw(),this._updateTransform()},_draw:function(){var e=this.node;this.clear(),this._closePath(),e.style.left=this.get("x")+"px",e.style.top=this.get("y")+"px"},_closePath:function(){if(!this._methods)return;var e=this.get("node"),t=this._right-this._left,n=this._bottom-this._top,r=this._context,i=[],s=this._methods.concat(),o,u,a,f,l,c=0;this._context.clearRect(0,0,e.width,e.height);if(this._methods){c=s.length;if(!c||c<1)return;for(o=0;o<c;++o){i[o]=s[o].concat(),f=i[o],l=f[0]=="quadraticCurveTo"||f[0]=="bezierCurveTo"?f.length:3;for(u=1;u<l;++u)u%2===0?f[u]=f[u]-this._top:f[u]=f[u]-this._left}e.setAttribute("width",Math.min(t,2e3)),e.setAttribute("height",Math.min(2e3,n)),r.beginPath();for(o=0;o<c;++o)f=i[o].concat(),f&&f.length>0&&(a=f.shift(),a&&(a=="closePath"?(r.closePath(),this._strokeAndFill(r)):a&&a=="lineTo"&&this._dashstyle?(f.unshift(this._xcoords[o]-this._left,this._ycoords[o]-this._top),this._drawDashedLine.apply(this,f)):r[a].apply(r,f)));this._strokeAndFill(r),this._drawingComplete=!0,this._clearAndUpdateCoords(),this._updateNodePosition(),this._methods=s}},_strokeAndFill:function(e){this._fillType&&(this._fillType=="linear"?e.fillStyle=this._getLinearGradient():this._fillType=="radial"?e.fillStyle=this._getRadialGradient():e.fillStyle=this._fillColor,e.closePath(),e.fill()),this._stroke&&(this._strokeWeight&&(e.lineWidth=this._strokeWeight),e.lineCap=this._linecap,e.lineJoin=this._linejoin,this._miterlimit&&(e.miterLimit=this._miterlimit),e.strokeStyle=this._strokeStyle,e.stroke())},_drawDashedLine:function(e,t,n,r){var i=this._context,s=this._dashstyle[0],o=this._dashstyle[1],u=s+o,a=n-e,f=r-t,l=Math.sqrt(Math.pow(a,2)+Math.pow(f,2)),c=Math.floor(Math.abs(l/u)),h=Math.atan2(f,a),p=e,d=t,v;a=Math.cos(h)*u,f=Math.sin(h)*u;for(v=0;v<c;++v)i.moveTo(p,d),i.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s),p+=a,d+=f;i.moveTo(p,d),l=Math.sqrt((n-p)*(n-p)+(r-d)*(r-d)),l>s?i.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&i.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),i.moveTo(n,r)},clear:function(){return this._initProps(),this.node&&this._context.clearRect(0,0,this.node.width,this.node.height),this},getBounds:function(){var e=this._type,t=this.get("width"),n=this.get("height"),r=this.get("x"),i=this.get("y");return e=="path"&&(r+=this._left,i+=this._top,t=this._right-this._left,n=this._bottom-this._top),this._getContentRect(t,n,r,i)},_getContentRect:function(t,n,r,i){var s=this.get("transformOrigin"),o=s[0]*t,u=s[1]*n,a=this.matrix.getTransformArray(this.get("transform")),f=new e.Matrix,l,c=a.length,h,p,d;this._type=="path"&&(o+=r,u+=i),o=isNaN(o)?0:o,u=isNaN(u)?0:u,f.translate(o,u);for(l=0;l<c;l+=1)h=a[l],p=h.shift(),p&&f[p].apply(f,h);return f.translate(-o,-u),d=f.getContentRect(t,n,r,i),d},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(e.one(this.node).remove(!0),this._context=null,this.node=null)}},e.CanvasDrawing.prototype)),f.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){return this.matrix.init(),this._transforms=this.matrix.getTransformArray(e),this._transform=e,e},getter:function(){return this._transform}},node:{readOnly:!0,getter:function(){return this.node}},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}},width:{value:0},height:{value:0},x:{value:0},y:{value:0},visible:{value:!0,setter:function(e){var t=this.get("node"),n=e?"visible":"hidden";return t&&(t.style.visibility=n),e}},fill:{valueFn:"_getDefaultFill",setter:function(t){var n,r=this.get("fill")||this._getDefaultFill();return n=t?e.merge(r,t):null,n&&n.color&&(n.color===undefined||n.color=="none")&&(n.color=null),this._setFillProps(n),n}},stroke:{valueFn:"_getDefaultStroke",setter:function(t){var n=this.get("stroke")||this._getDefaultStroke(),r;return t&&t.hasOwnProperty("weight")&&(r=parseInt(t.weight,10),isNaN(r)||(t.weight=r)),t=t?e.merge(n,t):null,this._setStrokeProps(t),t}},autoSize:{value:!1},pointerEvents:{value:"visiblePainted"},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.CanvasShape=f,l=function(e){l.superclass.constructor.apply(this,arguments)},l.NAME="path",e.extend(l,e.CanvasShape,{_type:"path",_draw:function(){this._closePath(),this._updateTransform()},createNode:function(){var t=this,i=e.config.doc.createElement("canvas"),s=t.name,o=t._camelCaseConcat,u=t.get("id");t._context=i.getContext("2d"),i.setAttribute("overflow","visible"),i.setAttribute("pointer-events","none"),i.style.pointerEvents="none",i.style.overflow="visible",i.setAttribute("id",u),u="#"+u,t.node=i,t.addClass(x(r)+" "+x(o(n,r))+" "+x(s)+" "+x(o(n,s)))},end:function(){this._draw()}}),l.ATTRS=e.merge(e.CanvasShape.ATTRS,{width:{getter:function(){var e=this._stroke&&this._strokeWeight?this._strokeWeight*2:0;return this._width-e},setter:function(e){return this._width=e,e}},height:{getter:function(){var e=this._stroke&&this._strokeWeight?this._strokeWeight*2:0;return this._height-e},setter:function(e){return this._height=e,e}},path:{readOnly:!0,getter:function(){return this._path}}}),e.CanvasPath=l,c=function(){c.superclass.constructor.apply(this,arguments)},c.NAME="rect",e.extend(c,e.CanvasShape,{_type:"rect",_draw:function(){var e=this.get("width"),t=this.get("height");this.clear(),this.drawRect(0,0,e,t),this._closePath()}}),c.ATTRS=e.CanvasShape.ATTRS,e.CanvasRect=c,h=function(e){h.superclass.constructor.apply(this,arguments)},h.NAME="ellipse",e.extend(h,f,{_type:"ellipse",_draw:function(){var e=this.get("width"),t=this.get("height");this.clear(),this.drawEllipse(0,0,e,t),this._closePath()}}),h.ATTRS=e.merge(f.ATTRS,{xRadius:{setter:function(e){this.set("width",e*2)},getter:function(){var e=this.get("width");return e&&(e*=.5),e}},yRadius:{setter:function(e){this.set("height",e*2)},getter:function(){var e=this.get("height");return e&&(e*=.5),e}}}),e.CanvasEllipse=h,p=function(e){p.superclass.constructor.apply(this,arguments)},p.NAME="circle",e.extend(p,e.CanvasShape,{_type:"circle",_draw:function(){var e=this.get("radius");e&&(this.clear(),this.drawCircle(0,0,e),this._closePath())}}),p.ATTRS=e.merge(e.CanvasShape.ATTRS,{width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},radius:{lazyAdd:!1}}),e.CanvasCircle=p,d=function(){d.superclass.constructor.apply(this,arguments)},d.NAME="canvasPieSlice",e.extend(d,e.CanvasShape,{_type:"path",_draw:function(e){var t=this.get("cx"),n=this.get("cy"),r=this.get("startAngle"),i=this.get("arc"),s=this.get("radius");this.clear(),this._left=t,this._right=s,this._top=n,this._bottom=s,this.drawWedge(t,n,r,i,s),this.end()}}),d.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.CanvasShape.ATTRS),e.CanvasPieSlice=d,N.NAME="canvasGraphic",N.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{value:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}}},e.extend(N,e.GraphicBase,{set:function(t,n){var r=this,i={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},s,o=!1;a.prototype.set.apply(r,arguments);if(r._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(u.isString&&i[t])o=!0;else if(u.isObject(t))for(s in i)if(i.hasOwnProperty(s)&&t[s]){o=!0;break}o&&r._redraw()},_x:0,_y:0,getXY:function(){var t=e.one(this._node),n;return t&&(n=t.getXY()),n},initializer:function(e){var t=this.get("render"),n=this.get("visible")?"visible":"hidden",r=this.get("width")||0,i=this.get("height")||0;this._shapes={},this._redrawQueue={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._node=o.createElement("div"),this._node.style.position="absolute",this._node.style.visibility=n,this.set("width",r),this.set("height",i),t&&this.render(t)},render:function(t){var n=e.one(t),r=this._node,i=this.get("width")||parseInt(n.getComputedStyle("width"),10),s=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||o.body,n.appendChild(r),r.style.display="block",r.style.position="absolute",r.style.left="0px",r.style.top="0px",this.set("width",i),this.set("height",s),this.parentNode=n,this},destroy:function(){this.removeAllShapes(),this._node&&(this._removeChildren(this._node),e.one(this._node).destroy())},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n},_appendShape:function(e){var t=e.node,n=this._frag||this._node;this.get("autoDraw")?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){return e instanceof f||u.isString(e)&&(e=this._shapes[e]),e&&e instanceof f&&(e._destroy(),delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw(),e},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shapes={}},clear:function(){this.removeAllShapes()},_removeChildren:function(e){if(e&&e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._node&&(this._node.style.visibility=r)},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.CanvasCircle,rect:e.CanvasRect,path:e.CanvasPath,ellipse:e.CanvasEllipse,pieslice:e.CanvasPieSlice},getShapeById:function(e){var t=this._shapes[e];return t},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=o.createDocumentFragment()),this._frag},_redraw:function(){var t=this.get("autoSize"),n=this.get("preserveAspectRatio"),r=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,i,s,o,u,a,f,l=0,c=0,h,p=this.get("node");t&&(t=="sizeContentToGraphic"?(i=r.right-r.left,s=r.bottom-r.top,o=parseFloat(v.getComputedStyle(p,"width")),u=parseFloat(v.getComputedStyle(p,"height")),h=new e.Matrix,n=="none"?(a=o/i,f=u/s):i/s!==o/u&&(i*u/s>o?(a=f=o/i,c=this._calculateTranslate(n.slice(5).toLowerCase(),s*o/i,u)):(a=f=u/s,l=this._calculateTranslate(n.slice(1,4).toLowerCase(),i*u/s,o))),v.setStyle(p,"transformOrigin","0% 0%"),l-=r.left*a,c-=r.top*f,h.translate(l,c),h.scale(a,f),v.setStyle(p,"transform",h.toCSSText())):(this.set("width",r.right),this.set("height",r.bottom))),this._frag&&(this._node.appendChild(this._frag),this._frag=null)},_calculateTranslate:function(e,t,n){var r=n-t,i;switch(e){case"mid":i=r*.5;break;case"max":i=r;break;default:i=0}return i},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=u.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=u.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=u.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=u.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=u.isNumber(i.left)?i.left:0,i.top=u.isNumber(i.top)?i.top:0,i.right=u.isNumber(i.right)?i.right:0,i.bottom=u.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_toFront:function(t){var n=this.get("node");t instanceof e.CanvasShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this.get("node"),r;t instanceof e.CanvasShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.CanvasGraphic=N},"3.7.2",{requires:["graphics"]});+YUI.add("graphics-canvas",function(e,t){function T(){}function N(e){N.superclass.constructor.apply(this,arguments)}var n="canvas",r="shape",i=/[a-z][^a-z]*/ig,s=/[-]?[0-9]*[0-9|\.][0-9]*/g,o=e.config.doc,u=e.Lang,a=e.AttributeLite,f,l,c,h,p,d,v=e.DOM,m=e.Color,g=parseInt,y=parseFloat,b=u.isNumber,w=RegExp,E=m.toRGB,S=m.toHex,x=e.ClassNameManager.getClassName;T.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_currentX:0,_currentY:0,_toRGBA:function(e,t){return t=t!==undefined?t:1,m.re_RGB.test(e)||(e=S(e)),m.re_hex.exec(e)&&(e="rgba("+[g(w.$1,16),g(w.$2,16),g(w.$3,16)].join(",")+","+t+")"),e},_toRGB:function(e){return E(e)},setSize:function(e,t){this.get("autoSize")&&(e>this.node.getAttribute("width")&&(this.node.style.width=e+"px",this.node.setAttribute("width",e)),t>this.node.getAttribute("height")&&(this.node.style.height=t+"px",this.node.setAttribute("height",t)))},_updateCoords:function(e,t){this._xcoords.push(e),this._ycoords.push(t),this._currentX=e,this._currentY=t},_clearAndUpdateCoords:function(){var e=this._xcoords.pop()||0,t=this._ycoords.pop()||0;this._updateCoords(e,t)},_updateNodePosition:function(){var e=this.get("node"),t=this.get("x"),n=this.get("y");e.style.position="absolute",e.style.left=t+this._left+"px",e.style.top=n+this._top+"px"},_updateDrawingQueue:function(e){this._methods.push(e)},lineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!1])},relativeLineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!0])},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=this._stroke&&this._strokeWeight?this._strokeWeight:0,a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;this._lineToMethods||(this._lineToMethods=[]),i=e.length-1;if(typeof n=="string"||typeof n=="number")for(r=0;r<i;r+=2)s=parseFloat(e[r]),o=parseFloat(e[r+1]),s+=a,o+=f,this._updateDrawingQueue(["lineTo",s,o]),this._trackSize(s-u,o-u),this._trackSize(s+u,o+u),this._updateCoords(s,o);else for(r=0;r<i;r+=1)s=parseFloat(e[r][0]),o=parseFloat(e[r][1]),this._updateDrawingQueue(["lineTo",s,o]),this._lineToMethods[this._lineToMethods.length]=this._methods[this._methods.length-1],this._trackSize(s-u,o-u),this._trackSize(s+u,o+u),this._updateCoords(s,o);return this._drawingComplete=!1,this},moveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!1])},relativeMoveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!0])},_moveTo:function(e,t){var n=this._stroke&&this._strokeWeight?this._strokeWeight:0,r=t?parseFloat(this._currentX):0,i=t?parseFloat(this._currentY):0,s=parseFloat(e[0])+r,o=parseFloat(e[1])+i;return this._updateDrawingQueue(["moveTo",s,o]),this._trackSize(s-n,o-n),this._trackSize(s+n,o+n),this._updateCoords(s,o),this._drawingComplete=!1,this},curveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!1])},relativeCurveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!0])},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g=t?parseFloat(this._currentX):0,y=t?parseFloat(this._currentY):0;m=e.length-5;for(v=0;v<m;v+=6)i=parseFloat(e[v])+g,s=parseFloat(e[v+1])+y,o=parseFloat(e[v+2])+g,u=parseFloat(e[v+3])+y,a=parseFloat(e[v+4])+g,f=parseFloat(e[v+5])+y,this._updateDrawingQueue(["bezierCurveTo",i,s,o,u,a,f]),this._drawingComplete=!1,c=Math.max(a,Math.max(i,o)),p=Math.max(f,Math.max(s,u)),h=Math.min(a,Math.min(i,o)),d=Math.min(f,Math.min(s,u)),n=Math.abs(c-h),r=Math.abs(p-d),l=[[this._currentX,this._currentY],[i,s],[o,u],[a,f]],this._setCurveBoundingBox(l,n,r),this._currentX=a,this._currentY=f},quadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!1])},relativeQuadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!0])},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d=e.length-3,v=this._stroke&&this._strokeWeight?this._strokeWeight:0,m=t?parseFloat(this._currentX):0,g=t?parseFloat(this._currentY):0;for(p=0;p<d;p+=4)n=parseFloat(e[p])+m,r=parseFloat(e[p+1])+g,i=parseFloat(e[p+2])+m,s=parseFloat(e[p+3])+g,this._drawingComplete=!1,f=Math.max(i,n),c=Math.max(s,r),l=Math.min(i,n),h=Math.min(s,r),o=Math.abs(f-l),u=Math.abs(c-h),a=[[this._currentX,this._currentY],[n,r],[i,s]],this._setCurveBoundingBox(a,o,u),this._updateDrawingQueue(["quadraticCurveTo",n,r,i,s]),this._updateCoords(i,s);return this},drawCircle:function(e,t,n){var r=0,i=2*Math.PI,s=this._stroke&&this._strokeWeight?this._strokeWeight:0,o=n*2;return o+=s,this._drawingComplete=!1,this._trackSize(e+o,t+o),this._trackSize(e-s,t-s),this._updateCoords(e,t),this._updateDrawingQueue(["arc",e+n,t+n,n,r,i,!1]),this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawEllipse:function(e,t,n,r){var i=8,s=-0.25*Math.PI,o=0,u,a=n/2,f=r/2,l,c=e+a,h=t+f,p,d,v,m,g,y,b=this._stroke&&this._strokeWeight?this._strokeWeight:0;p=c+Math.cos(0)*a,d=h+Math.sin(0)*f,this.moveTo(p,d);for(l=0;l<i;l++)o+=s,u=o-s/2,v=c+Math.cos(o)*a,m=h+Math.sin(o)*f,g=c+Math.cos(u)*(a/Math.cos(s/2)),y=h+Math.sin(u)*(f/Math.cos(s/2)),this._updateDrawingQueue(["quadraticCurveTo",g,y,v,m]);return this._trackSize(e+n+b,t+r+b),this._trackSize(e-b,t-b),this._updateCoords(e,t),this},drawRect:function(e,t,n,r){var i=this._stroke&&this._strokeWeight?this._strokeWeight:0;return this._drawingComplete=!1,this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this},drawRoundRect:function(e,t,n,r,i,s){var o=this._stroke&&this._strokeWeight?this._strokeWeight:0;return this._drawingComplete=!1,this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s),this},drawWedge:function(e,t,n,r,i,s){var o=this._stroke&&this._strokeWeight?this._strokeWeight:0,u,a,f,l,c,h,p,d,v,m,g,y=0;s=s||i,this._drawingComplete=!1,this._updateDrawingQueue(["moveTo",e,t]),s=s||i,Math.abs(r)>360&&(r=360),u=Math.ceil(Math.abs(r)/45),a=r/u,f=-(a/180)*Math.PI,l=n/180*Math.PI;if(u>0){h=e+Math.cos(n/180*Math.PI)*i,p=t+Math.sin(n/180*Math.PI)*s,this.lineTo(h,p);for(y=0;y<u;++y)l+=f,c=l-f/2,d=e+Math.cos(l)*i,v=t+Math.sin(l)*s,m=e+Math.cos(c)*(i/Math.cos(f/2)),g=t+Math.sin(c)*(s/Math.cos(f/2)),this._updateDrawingQueue(["quadraticCurveTo",m,g,d,v]);this._updateDrawingQueue(["lineTo",e,t])}return this._trackSize(-o,-o),this._trackSize(i*2+o,i*2+o),this},end:function(){return this._closePath(),this},closePath:function(){this._updateDrawingQueue(["closePath"]),this._updateDrawingQueue(["beginPath"])},_getLinearGradient:function(){var t=e.Lang.isNumber,n=this.get("fill"),r=n.stops,i,s,o,u,a=r.length,f,l=0,c=0,h=this.get("width"),p=this.get("height"),d=n.rotation||0,v,m,g,y,b=l+h/2,w=c+p/2,S,x=Math.PI/180,T=parseFloat(parseFloat(Math.tan(d*x)).toFixed(8));Math.abs(T)*h/2>=p/2?(d<180?(g=c,y=c+p):(g=c+p,y=c),v=b-(w-g)/T,m=b-(w-y)/T):(d>90&&d<270?(v=l+h,m=l):(v=l,m=l+h),g=(T*(b-v)-w)*-1,y=(T*(b-m)-w)*-1),f=this._context.createLinearGradient(v,g,m,y);for(u=0;u<a;++u)o=r[u],i=o.opacity,s=o.color,S=o.offset,t(i)?(i=Math.max(0,Math.min(1,i)),s=this._toRGBA(s,i)):s=E(s),S=o.offset||u/(a-1),f.addColorStop(S,s);return f},_getRadialGradient:function(){var t=e.Lang.isNumber,n=this.get("fill"),r=n.r,i=n.fx,s=n.fy,o=n.stops,u,a,f,l,c=o.length,h,p=0,d=0,v=this.get("width"),m=this.get("height"),g,y,b,w,S,x,T,N,C,k,L,A,O;x=p+v/2,T=d+m/2,g=v*i,b=m*s,y=p+v/2,w=d+m/2,S=v*r,k=Math.sqrt(Math.pow(Math.abs(x-g),2)+Math.pow(Math.abs(T-b),2)),k>=S&&(A=k/S,A===1&&(A=1.01),N=(g-x)/A,C=(b-T)/A,N=N>0?Math.floor(N):Math.ceil(N),C=C>0?Math.floor(C):Math.ceil(C),g=x+N,b=T+C),r>=.5?(h=this._context.createRadialGradient(g,b,r,y,w,r*v),O=1):(h=this._context.createRadialGradient(g,b,r,y,w,v/2),O=r*2);for(l=0;l<c;++l)f=o[l],u=f.opacity,a=f.color,L=f.offset,t(u)?(u=Math.max(0,Math.min(1,u)),a=this._toRGBA(a,u)):a=E(a),L=f.offset||l/(c-1),L*=O,L<=1&&h.addColorStop(L,a);return h},_initProps:function(){this._methods=[],this._lineToMethods=[],this._xcoords=[0],this._ycoords=[0],this._width=0,this._height=0,this._left=0,this._top=0,this._right=0,this._bottom=0,this._currentX=0,this._currentY=0},_drawingComplete:!1,_createGraphic:function(t){var n=e.config.doc.createElement("canvas");return n},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r=0,i=this._currentX,s=i,o=this._currentY,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l=this._stroke&&this._strokeWeight?this._strokeWeight:0,c;for(r=0;r<a;++r)c=this.getBezierData(e,f*r),i=isNaN(i)?c[0]:Math.min(c[0],i),s=isNaN(s)?c[0]:Math.max(c[0],s),o=isNaN(o)?c[1]:Math.min(c[1],o),u=isNaN(u)?c[1]:Math.max(c[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s+l,u+l),this._trackSize(i-l,o-l)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top}},e.CanvasDrawing=T,f=function(t){this._transforms=[],this.matrix=new e.Matrix,f.superclass.constructor.apply(this,arguments)},f.NAME="shape",e.extend(f,e.GraphicBase,e.mix({init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t._initProps(),t.createNode(),t._xcoords=[0],t._ycoords=[0],n&&this._setGraphic(n),r&&t._parsePathData(r),t._updateHandler()},_setGraphic:function(t){var n;t instanceof e.CanvasGraphic?this._graphic=t:(t=e.one(t),n=new e.CanvasGraphic({render:t}),n._appendShape(this),this._graphic=n)},addClass:function(t){var n=e.one(this.get("node"));n.addClass(t)},removeClass:function(t){var n=e.one(this.get("node"));n.removeClass(t)},getXY:function(){var e=this.get("graphic"),t=e.getXY(),n=this.get("x"),r=this.get("y");return[t[0]+n,t[1]+r]},setXY:function(e){var t=this.get("graphic"),n=t.getXY(),r=e[0]-n[0],i=e[1]-n[1];this._set("x",r),this._set("y",i),this._updateNodePosition(r,i)},contains:function(t){return t===e.one(this.node)},test:function(t){return e.one(this.get("node")).test(t)},compareTo:function(e){var t=this.node;return t===e},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},_left:0,_right:0,_top:0,_bottom:0,createNode:function(){var t=this,i=e.config.doc.createElement("canvas"),s=t.get("id"),o=t._camelCaseConcat,u=t.name;t._context=i.getContext("2d"),i.setAttribute("overflow","visible"),i.style.overflow="visible",t.get("visible")||(i.style.visibility="hidden"),i.setAttribute("id",s),s="#"+s,t.node=i,t.addClass(x(r)+" "+x(o(n,r))+" "+x(u)+" "+x(o(n,u)))},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.one("#"+this.get("id")).on(t,n):e.on.apply(this,arguments)},_setStrokeProps:function(t){var n,r,i,s,o,u;t?(n=t.color,r=y(t.weight),i=y(t.opacity),s=t.linejoin||"round",o=t.linecap||"butt",u=t.dashstyle,this._miterlimit=null,this._dashstyle=u&&e.Lang.isArray(u)&&u.length>1?u:null,this._strokeWeight=r,b(r)&&r>0?this._stroke=1:this._stroke=0,b(i)?this._strokeStyle=this._toRGBA(n,i):this._strokeStyle=n,this._linecap=o,s=="round"||s=="bevel"?this._linejoin=s:(s=parseInt(s,10),b(s)&&(this._miterlimit=Math.max(s,1),this._linejoin="miter"))):this._stroke=0},set:function(){var e=this,t=arguments[0];a.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},_setFillProps:function(e){var t=b,n,r,i;e?(n=e.color,i=e.type,i=="linear"||i=="radial"?this._fillType=i:n?(r=e.opacity,t(r)?(r=Math.max(0,Math.min(1,r)),n=this._toRGBA(n,r)):n=E(n),this._fillColor=n,this._fillType="solid"):this._fillColor=null):(this._fillType=null,this._fillColor=null)},translate:function(e,t){this._translateX+=e,this._translateY+=t,this._addTransform("translate",arguments)},translateX:function(e){this._translateX+=e,this._addTransform("translateX",arguments)},translateY:function(e){this._translateY+=e,this._addTransform("translateY",arguments)},skew:function(e,t){this._addTransform("skew",arguments)},skewX:function(e){this._addTransform("skewX",arguments)},skewY:function(e){this._addTransform("skewY",arguments)},rotate:function(e){this._rotation=e,this._addTransform("rotate",arguments)},scale:function(e,t){this._addTransform("scale",arguments)},_rotation:0,_transform:"",_addTransform:function(t,n){n=e.Array(n),this._transform=u.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var e=this.node,t,n,r=this.get("transformOrigin"),i=this.matrix,s,o=this._transforms.length;if(this._transforms&&this._transforms.length>0){for(s=0;s<o;++s)t=this._transforms[s].shift(),t&&i[t].apply(i,this._transforms[s]);n=i.toCSSText()}this._graphic.addToRedrawQueue(this),r=100*r[0]+"% "+100*r[1]+"%",v.setStyle(e,"transformOrigin",r),n&&v.setStyle(e,"transform",n),this._transforms=[]},_updateHandler:function(){this._draw(),this._updateTransform()},_draw:function(){var e=this.node;this.clear(),this._closePath(),e.style.left=this.get("x")+"px",e.style.top=this.get("y")+"px"},_closePath:function(){if(!this._methods)return;var e=this.get("node"),t=this._right-this._left,n=this._bottom-this._top,r=this._context,i=[],s=this._methods.concat(),o,u,a,f,l,c=0;this._context.clearRect(0,0,e.width,e.height);if(this._methods){c=s.length;if(!c||c<1)return;for(o=0;o<c;++o){i[o]=s[o].concat(),f=i[o],l=f[0]=="quadraticCurveTo"||f[0]=="bezierCurveTo"?f.length:3;for(u=1;u<l;++u)u%2===0?f[u]=f[u]-this._top:f[u]=f[u]-this._left}e.setAttribute("width",Math.min(t,2e3)),e.setAttribute("height",Math.min(2e3,n)),r.beginPath();for(o=0;o<c;++o)f=i[o].concat(),f&&f.length>0&&(a=f.shift(),a&&(a=="closePath"?(r.closePath(),this._strokeAndFill(r)):a&&a=="lineTo"&&this._dashstyle?(f.unshift(this._xcoords[o]-this._left,this._ycoords[o]-this._top),this._drawDashedLine.apply(this,f)):r[a].apply(r,f)));this._strokeAndFill(r),this._drawingComplete=!0,this._clearAndUpdateCoords(),this._updateNodePosition(),this._methods=s}},_strokeAndFill:function(e){this._fillType&&(this._fillType=="linear"?e.fillStyle=this._getLinearGradient():this._fillType=="radial"?e.fillStyle=this._getRadialGradient():e.fillStyle=this._fillColor,e.closePath(),e.fill()),this._stroke&&(this._strokeWeight&&(e.lineWidth=this._strokeWeight),e.lineCap=this._linecap,e.lineJoin=this._linejoin,this._miterlimit&&(e.miterLimit=this._miterlimit),e.strokeStyle=this._strokeStyle,e.stroke())},_drawDashedLine:function(e,t,n,r){var i=this._context,s=this._dashstyle[0],o=this._dashstyle[1],u=s+o,a=n-e,f=r-t,l=Math.sqrt(Math.pow(a,2)+Math.pow(f,2)),c=Math.floor(Math.abs(l/u)),h=Math.atan2(f,a),p=e,d=t,v;a=Math.cos(h)*u,f=Math.sin(h)*u;for(v=0;v<c;++v)i.moveTo(p,d),i.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s),p+=a,d+=f;i.moveTo(p,d),l=Math.sqrt((n-p)*(n-p)+(r-d)*(r-d)),l>s?i.lineTo(p+Math.cos(h)*s,d+Math.sin(h)*s):l>0&&i.lineTo(p+Math.cos(h)*l,d+Math.sin(h)*l),i.moveTo(n,r)},clear:function(){return this._initProps(),this.node&&this._context.clearRect(0,0,this.node.width,this.node.height),this},getBounds:function(){var e=this._type,t=this.get("width"),n=this.get("height"),r=this.get("x"),i=this.get("y");return e=="path"&&(r+=this._left,i+=this._top,t=this._right-this._left,n=this._bottom-this._top),this._getContentRect(t,n,r,i)},_getContentRect:function(t,n,r,i){var s=this.get("transformOrigin"),o=s[0]*t,u=s[1]*n,a=this.matrix.getTransformArray(this.get("transform")),f=new e.Matrix,l,c=a.length,h,p,d;this._type=="path"&&(o+=r,u+=i),o=isNaN(o)?0:o,u=isNaN(u)?0:u,f.translate(o,u);for(l=0;l<c;l+=1)h=a[l],p=h.shift(),p&&f[p].apply(f,h);return f.translate(-o,-u),d=f.getContentRect(t,n,r,i),d},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(e.one(this.node).remove(!0),this._context=null,this.node=null)}},e.CanvasDrawing.prototype)),f.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){return this.matrix.init(),this._transforms=this.matrix.getTransformArray(e),this._transform=e,e},getter:function(){return this._transform}},node:{readOnly:!0,getter:function(){return this.node}},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}},width:{value:0},height:{value:0},x:{value:0},y:{value:0},visible:{value:!0,setter:function(e){var t=this.get("node"),n=e?"visible":"hidden";return t&&(t.style.visibility=n),e}},fill:{valueFn:"_getDefaultFill",setter:function(t){var n,r=this.get("fill")||this._getDefaultFill();return n=t?e.merge(r,t):null,n&&n.color&&(n.color===undefined||n.color=="none")&&(n.color=null),this._setFillProps(n),n}},stroke:{valueFn:"_getDefaultStroke",setter:function(t){var n=this.get("stroke")||this._getDefaultStroke(),r;return t&&t.hasOwnProperty("weight")&&(r=parseInt(t.weight,10),isNaN(r)||(t.weight=r)),t=t?e.merge(n,t):null,this._setStrokeProps(t),t}},autoSize:{value:!1},pointerEvents:{value:"visiblePainted"},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.CanvasShape=f,l=function(e){l.superclass.constructor.apply(this,arguments)},l.NAME="path",e.extend(l,e.CanvasShape,{_type:"path",_draw:function(){this._closePath(),this._updateTransform()},createNode:function(){var t=this,i=e.config.doc.createElement("canvas"),s=t.name,o=t._camelCaseConcat,u=t.get("id");t._context=i.getContext("2d"),i.setAttribute("overflow","visible"),i.setAttribute("pointer-events","none"),i.style.pointerEvents="none",i.style.overflow="visible",i.setAttribute("id",u),u="#"+u,t.node=i,t.addClass(x(r)+" "+x(o(n,r))+" "+x(s)+" "+x(o(n,s)))},end:function(){this._draw()}}),l.ATTRS=e.merge(e.CanvasShape.ATTRS,{width:{getter:function(){var e=this._stroke&&this._strokeWeight?this._strokeWeight*2:0;return this._width-e},setter:function(e){return this._width=e,e}},height:{getter:function(){var e=this._stroke&&this._strokeWeight?this._strokeWeight*2:0;return this._height-e},setter:function(e){return this._height=e,e}},path:{readOnly:!0,getter:function(){return this._path}}}),e.CanvasPath=l,c=function(){c.superclass.constructor.apply(this,arguments)},c.NAME="rect",e.extend(c,e.CanvasShape,{_type:"rect",_draw:function(){var e=this.get("width"),t=this.get("height");this.clear(),this.drawRect(0,0,e,t),this._closePath()}}),c.ATTRS=e.CanvasShape.ATTRS,e.CanvasRect=c,h=function(e){h.superclass.constructor.apply(this,arguments)},h.NAME="ellipse",e.extend(h,f,{_type:"ellipse",_draw:function(){var e=this.get("width"),t=this.get("height");this.clear(),this.drawEllipse(0,0,e,t),this._closePath()}}),h.ATTRS=e.merge(f.ATTRS,{xRadius:{setter:function(e){this.set("width",e*2)},getter:function(){var e=this.get("width");return e&&(e*=.5),e}},yRadius:{setter:function(e){this.set("height",e*2)},getter:function(){var e=this.get("height");return e&&(e*=.5),e}}}),e.CanvasEllipse=h,p=function(e){p.superclass.constructor.apply(this,arguments)},p.NAME="circle",e.extend(p,e.CanvasShape,{_type:"circle",_draw:function(){var e=this.get("radius");e&&(this.clear(),this.drawCircle(0,0,e),this._closePath())}}),p.ATTRS=e.merge(e.CanvasShape.ATTRS,{width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},radius:{lazyAdd:!1}}),e.CanvasCircle=p,d=function(){d.superclass.constructor.apply(this,arguments)},d.NAME="canvasPieSlice",e.extend(d,e.CanvasShape,{_type:"path",_draw:function(e){var t=this.get("cx"),n=this.get("cy"),r=this.get("startAngle"),i=this.get("arc"),s=this.get("radius");this.clear(),this._left=t,this._right=s,this._top=n,this._bottom=s,this.drawWedge(t,n,r,i,s),this.end()}}),d.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.CanvasShape.ATTRS),e.CanvasPieSlice=d,N.NAME="canvasGraphic",N.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{value:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}}},e.extend(N,e.GraphicBase,{set:function(t,n){var r=this,i={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},s,o=!1;a.prototype.set.apply(r,arguments);if(r._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(u.isString&&i[t])o=!0;else if(u.isObject(t))for(s in i)if(i.hasOwnProperty(s)&&t[s]){o=!0;break}o&&r._redraw()},_x:0,_y:0,getXY:function(){var t=e.one(this._node),n;return t&&(n=t.getXY()),n},initializer:function(e){var t=this.get("render"),n=this.get("visible")?"visible":"hidden",r=this.get("width")||0,i=this.get("height")||0;this._shapes={},this._redrawQueue={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._node=o.createElement("div"),this._node.style.position="absolute",this._node.style.visibility=n,this.set("width",r),this.set("height",i),t&&this.render(t)},render:function(t){var n=e.one(t),r=this._node,i=this.get("width")||parseInt(n.getComputedStyle("width"),10),s=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||o.body,n.appendChild(r),r.style.display="block",r.style.position="absolute",r.style.left="0px",r.style.top="0px",this.set("width",i),this.set("height",s),this.parentNode=n,this},destroy:function(){this.removeAllShapes(),this._node&&(this._removeChildren(this._node),e.one(this._node).destroy())},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n},_appendShape:function(e){var t=e.node,n=this._frag||this._node;this.get("autoDraw")?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){return e instanceof f||u.isString(e)&&(e=this._shapes[e]),e&&e instanceof f&&(e._destroy(),delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw(),e},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shapes={}},clear:function(){this.removeAllShapes()},_removeChildren:function(e){if(e&&e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._node&&(this._node.style.visibility=r)},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.CanvasCircle,rect:e.CanvasRect,path:e.CanvasPath,ellipse:e.CanvasEllipse,pieslice:e.CanvasPieSlice},getShapeById:function(e){var t=this._shapes[e];return t},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=o.createDocumentFragment()),this._frag},_redraw:function(){var t=this.get("autoSize"),n=this.get("preserveAspectRatio"),r=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,i,s,o,u,a,f,l=0,c=0,h,p=this.get("node");t&&(t=="sizeContentToGraphic"?(i=r.right-r.left,s=r.bottom-r.top,o=parseFloat(v.getComputedStyle(p,"width")),u=parseFloat(v.getComputedStyle(p,"height")),h=new e.Matrix,n=="none"?(a=o/i,f=u/s):i/s!==o/u&&(i*u/s>o?(a=f=o/i,c=this._calculateTranslate(n.slice(5).toLowerCase(),s*o/i,u)):(a=f=u/s,l=this._calculateTranslate(n.slice(1,4).toLowerCase(),i*u/s,o))),v.setStyle(p,"transformOrigin","0% 0%"),l-=r.left*a,c-=r.top*f,h.translate(l,c),h.scale(a,f),v.setStyle(p,"transform",h.toCSSText())):(this.set("width",r.right),this.set("height",r.bottom))),this._frag&&(this._node.appendChild(this._frag),this._frag=null)},_calculateTranslate:function(e,t,n){var r=n-t,i;switch(e){case"mid":i=r*.5;break;case"max":i=r;break;default:i=0}return i},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=u.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=u.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=u.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=u.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=u.isNumber(i.left)?i.left:0,i.top=u.isNumber(i.top)?i.top:0,i.right=u.isNumber(i.right)?i.right:0,i.bottom=u.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_toFront:function(t){var n=this.get("node");t instanceof e.CanvasShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this.get("node"),r;t instanceof e.CanvasShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.CanvasGraphic=N},"3.7.3",{requires:["graphics"]});
bundle/graphics-canvas/graphics-canvas.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -3635,4 +3635,4 @@ Y.CanvasGraphic = CanvasGraphic; -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-svg-default/graphics-svg-default-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics-svg-default/graphics-svg-default.js", code: [] };-_yuitest_coverage["build/graphics-svg-default/graphics-svg-default.js"].code=["YUI.add('graphics-svg-default', function (Y, NAME) {","","Y.Graphic = Y.SVGGraphic;","Y.Shape = Y.SVGShape;","Y.Circle = Y.SVGCircle;","Y.Rect = Y.SVGRect;","Y.Ellipse = Y.SVGEllipse;","Y.Path = Y.SVGPath;","Y.Drawing = Y.SVGDrawing;","","","}, '3.7.2');"];+_yuitest_coverage["build/graphics-svg-default/graphics-svg-default.js"].code=["YUI.add('graphics-svg-default', function (Y, NAME) {","","Y.Graphic = Y.SVGGraphic;","Y.Shape = Y.SVGShape;","Y.Circle = Y.SVGCircle;","Y.Rect = Y.SVGRect;","Y.Ellipse = Y.SVGEllipse;","Y.Path = Y.SVGPath;","Y.Drawing = Y.SVGDrawing;","","","}, '3.7.3');"]; _yuitest_coverage["build/graphics-svg-default/graphics-svg-default.js"].lines = {"1":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0}; _yuitest_coverage["build/graphics-svg-default/graphics-svg-default.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/graphics-svg-default/graphics-svg-default.js"].coveredLines = 8;@@ -57,4 +57,4 @@ Y.Drawing = Y.SVGDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-svg-default/graphics-svg-default-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,4 +15,4 @@ Y.Drawing = Y.SVGDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-svg-default/graphics-svg-default-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics-svg-default",function(e,t){e.Graphic=e.SVGGraphic,e.Shape=e.SVGShape,e.Circle=e.SVGCircle,e.Rect=e.SVGRect,e.Ellipse=e.SVGEllipse,e.Path=e.SVGPath,e.Drawing=e.SVGDrawing},"3.7.2");+YUI.add("graphics-svg-default",function(e,t){e.Graphic=e.SVGGraphic,e.Shape=e.SVGShape,e.Circle=e.SVGCircle,e.Rect=e.SVGRect,e.Ellipse=e.SVGEllipse,e.Path=e.SVGPath,e.Drawing=e.SVGDrawing},"3.7.3");
bundle/graphics-svg-default/graphics-svg-default.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,4 +15,4 @@ Y.Drawing = Y.SVGDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-svg/graphics-svg-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics-svg/graphics-svg.js", code: [] };-_yuitest_coverage["build/graphics-svg/graphics-svg.js"].code=["YUI.add('graphics-svg', function (Y, NAME) {","","var IMPLEMENTATION = \"svg\","," SHAPE = \"shape\","," SPLITPATHPATTERN = /[a-z][^a-z]*/ig,"," SPLITARGSPATTERN = /[-]?[0-9]*[0-9|\\.][0-9]*/g,"," Y_LANG = Y.Lang,"," AttributeLite = Y.AttributeLite,"," SVGGraphic,"," SVGShape,"," SVGCircle,"," SVGRect,"," SVGPath,"," SVGEllipse,"," SVGPieSlice,"," DOCUMENT = Y.config.doc,"," _getClassName = Y.ClassNameManager.getClassName;","","function SVGDrawing(){}","","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Drawing.html\">`Drawing`</a> class. "," * `SVGDrawing` is not intended to be used directly. Instead, use the <a href=\"Drawing.html\">`Drawing`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Drawing.html\">`Drawing`</a> "," * class will point to the `SVGDrawing` class."," *"," * @module graphics"," * @class SVGDrawing"," * @constructor"," */","SVGDrawing.prototype = {"," /**"," * Maps path to methods"," *"," * @property _pathSymbolToMethod"," * @type Object"," * @private"," */"," _pathSymbolToMethod: {"," M: \"moveTo\","," m: \"relativeMoveTo\","," L: \"lineTo\","," l: \"relativeLineTo\","," C: \"curveTo\","," c: \"relativeCurveTo\","," Q: \"quadraticCurveTo\","," q: \"relativeQuadraticCurveTo\","," z: \"closePath\","," Z: \"closePath\""," },",""," /**"," * Current x position of the drawing."," *"," * @property _currentX"," * @type Number"," * @private"," */"," _currentX: 0,",""," /**"," * Current y position of the drqwing."," *"," * @property _currentY"," * @type Number"," * @private"," */"," _currentY: 0,"," "," /**"," * Indicates the type of shape"," *"," * @private"," * @property _type"," * @readOnly"," * @type String"," */"," _type: \"path\","," "," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," curveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a bezier curve relative to the current coordinates."," *"," * @method relativeCurveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeCurveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements curveTo methods."," *"," * @method _curveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _curveTo: function(args, relative) {"," var w,"," h,"," pts,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," x,"," y,"," right,"," left,"," bottom,"," top,"," i,"," len,"," pathArrayLen,"," currentArray,"," command = relative ? \"c\" : \"C\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._pathArray = this._pathArray || [];"," if(this._pathType !== command)"," {"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];"," if(!currentArray)"," {"," currentArray = [];"," this._pathArray.push(currentArray);"," }"," }"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat(args);"," len = args.length - 5;"," for(i = 0; i < len; i = i + 6)"," {"," cp1x = parseFloat(args[i]) + relativeX;"," cp1y = parseFloat(args[i + 1]) + relativeY;"," cp2x = parseFloat(args[i + 2]) + relativeX;"," cp2y = parseFloat(args[i + 3]) + relativeY;"," x = parseFloat(args[i + 4]) + relativeX;"," y = parseFloat(args[i + 5]) + relativeY;"," right = Math.max(x, Math.max(cp1x, cp2x));"," bottom = Math.max(y, Math.max(cp1y, cp2y));"," left = Math.min(x, Math.min(cp1x, cp2x));"," top = Math.min(y, Math.min(cp1y, cp2y));"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cp1x, cp1y], [cp2x, cp2y], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," },",""," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," quadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a quadratic bezier curve relative to the current position."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeQuadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), true]);"," },"," "," /**"," * Implements quadraticCurveTo methods."," *"," * @method _quadraticCurveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _quadraticCurveTo: function(args, relative) {"," var cpx, "," cpy, "," x, "," y,"," pathArrayLen,"," currentArray,"," w,"," h,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len,"," command = relative ? \"q\" : \"Q\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," if(this._pathType !== command)"," {"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];"," if(!currentArray)"," {"," currentArray = [];"," this._pathArray.push(currentArray);"," }"," }"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat(args);"," len = args.length - 3;"," for(i = 0; i < len; i = i + 4)"," {"," cpx = parseFloat(args[i]) + relativeX;"," cpy = parseFloat(args[i + 1]) + relativeY;"," x = parseFloat(args[i + 2]) + relativeX;"," y = parseFloat(args[i + 3]) + relativeY;"," right = Math.max(x, cpx);"," bottom = Math.max(y, cpy);"," left = Math.min(x, cpx);"," top = Math.min(y, cpy);"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cpx, cpy], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," },",""," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," drawRect: function(x, y, w, h) {"," this.moveTo(x, y);"," this.lineTo(x + w, y);"," this.lineTo(x + w, y + h);"," this.lineTo(x, y + h);"," this.lineTo(x, y);"," },",""," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," drawRoundRect: function(x, y, w, h, ew, eh) {"," this.moveTo(x, y + eh);"," this.lineTo(x, y + h - eh);"," this.quadraticCurveTo(x, y + h, x + ew, y + h);"," this.lineTo(x + w - ew, y + h);"," this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);"," this.lineTo(x + w, y + eh);"," this.quadraticCurveTo(x + w, y, x + w - ew, y);"," this.lineTo(x + ew, y);"," this.quadraticCurveTo(x, y, x, y + eh);"," },",""," /**"," * Draws a circle. "," * "," * @method drawCircle"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} r radius"," * @protected"," */"," drawCircle: function(x, y, radius) {"," var circum = radius * 2;"," this._drawingComplete = false;"," this._trackSize(x, y);"," this._trackSize(x + circum, y + circum);"," this._pathArray = this._pathArray || [];"," this._pathArray.push([\"M\", x + radius, y]);"," this._pathArray.push([\"A\", radius, radius, 0, 1, 0, x + radius, y + circum]);"," this._pathArray.push([\"A\", radius, radius, 0, 1, 0, x + radius, y]);"," this._currentX = x;"," this._currentY = y;"," return this;"," },"," "," /**"," * Draws an ellipse."," *"," * @method drawEllipse"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @protected"," */"," drawEllipse: function(x, y, w, h) {"," var radius = w * 0.5,"," yRadius = h * 0.5;"," this._drawingComplete = false;"," this._trackSize(x, y);"," this._trackSize(x + w, y + h);"," this._pathArray = this._pathArray || [];"," this._pathArray.push([\"M\", x + radius, y]);"," this._pathArray.push([\"A\", radius, yRadius, 0, 1, 0, x + radius, y + h]);"," this._pathArray.push([\"A\", radius, yRadius, 0, 1, 0, x + radius, y]);"," this._currentX = x;"," this._currentY = y;"," return this;"," },",""," /**"," * Draws a diamond. "," * "," * @method drawDiamond"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} width width"," * @param {Number} height height"," * @protected"," */"," drawDiamond: function(x, y, width, height)"," {"," var midWidth = width * 0.5,"," midHeight = height * 0.5;"," this.moveTo(x + midWidth, y);"," this.lineTo(x + width, y + midHeight);"," this.lineTo(x + midWidth, y + height);"," this.lineTo(x, y + midHeight);"," this.lineTo(x + midWidth, y);"," return this;"," },",""," /**"," * Draws a wedge."," *"," * @method drawWedge"," * @param {Number} x x-coordinate of the wedge's center point"," * @param {Number} y y-coordinate of the wedge's center point"," * @param {Number} startAngle starting angle in degrees"," * @param {Number} arc sweep of the wedge. Negative values draw clockwise."," * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius."," * @param {Number} yRadius [optional] y radius for wedge."," * @private"," */"," drawWedge: function(x, y, startAngle, arc, radius, yRadius)"," {"," var segs,"," segAngle,"," theta,"," angle,"," angleMid,"," ax,"," ay,"," bx,"," by,"," cx,"," cy,"," i,"," diameter = radius * 2,"," currentArray,"," pathArrayLen;"," yRadius = yRadius || radius;"," if(this._pathType != \"M\")"," {"," this._pathType = \"M\";"," currentArray = [\"M\"];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._getCurrentArray(); "," }"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen].push(x); "," this._pathArray[pathArrayLen].push(x); "," "," // limit sweep to reasonable numbers"," if(Math.abs(arc) > 360)"," {"," arc = 360;"," }"," "," // First we calculate how many segments are needed"," // for a smooth arc."," segs = Math.ceil(Math.abs(arc) / 45);"," "," // Now calculate the sweep of each segment."," segAngle = arc / segs;"," "," // The math requires radians rather than degrees. To convert from degrees"," // use the formula (degrees/180)*Math.PI to get radians."," theta = -(segAngle / 180) * Math.PI;"," "," // convert angle startAngle to radians"," angle = (startAngle / 180) * Math.PI;"," if(segs > 0)"," {"," // draw a line from the center to the start of the curve"," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius;"," ay = y + Math.sin(startAngle / 180 * Math.PI) * yRadius;"," this._pathType = \"L\";"," pathArrayLen++;"," this._pathArray[pathArrayLen] = [\"L\"];"," this._pathArray[pathArrayLen].push(Math.round(ax));"," this._pathArray[pathArrayLen].push(Math.round(ay));"," pathArrayLen++; "," this._pathType = \"Q\";"," this._pathArray[pathArrayLen] = [\"Q\"];"," for(i = 0; i < segs; ++i)"," {"," angle += theta;"," angleMid = angle - (theta / 2);"," bx = x + Math.cos(angle) * radius;"," by = y + Math.sin(angle) * yRadius;"," cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));"," cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));"," this._pathArray[pathArrayLen].push(Math.round(cx));"," this._pathArray[pathArrayLen].push(Math.round(cy));"," this._pathArray[pathArrayLen].push(Math.round(bx));"," this._pathArray[pathArrayLen].push(Math.round(by));"," }"," }"," this._currentX = x;"," this._currentY = y;"," this._trackSize(diameter, diameter); "," return this;"," },",""," /**"," * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," lineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a line segment using the current line style from the current drawing position to the relative x and y coordinates."," * "," * @method relativeLineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," relativeLineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements lineTo methods."," *"," * @method _lineTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _lineTo: function(args, relative) {"," var point1 = args[0],"," i,"," len,"," pathArrayLen,"," currentArray,"," x,"," y,"," command = relative ? \"l\" : \"L\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._pathArray = this._pathArray || [];"," this._shapeType = \"path\";"," len = args.length;"," if(this._pathType !== command)"," {"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._getCurrentArray();"," }"," pathArrayLen = this._pathArray.length - 1;"," if (typeof point1 === 'string' || typeof point1 === 'number') {"," for (i = 0; i < len; i = i + 2) {"," x = parseFloat(args[i]);"," y = parseFloat(args[i + 1]);"," this._pathArray[pathArrayLen].push(x);"," this._pathArray[pathArrayLen].push(y);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize.apply(this, [x, y]);"," }"," }"," else"," {"," for (i = 0; i < len; ++i) {"," x = parseFloat(args[i][0]);"," y = parseFloat(args[i][1]);"," this._pathArray[pathArrayLen].push(x);"," this._pathArray[pathArrayLen].push(y);"," this._currentX = x;"," this._currentY = y;"," x = x + relativeX;"," y = y + relativeY;"," this._trackSize.apply(this, [x, y]);"," }"," }"," },",""," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," moveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Moves the current drawing position relative to specified x and y coordinates."," *"," * @method relativeMoveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeMoveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements moveTo methods."," *"," * @method _moveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _moveTo: function(args, relative) {"," var pathArrayLen,"," currentArray,"," x = parseFloat(args[0]),"," y = parseFloat(args[1]),"," command = relative ? \"m\" : \"M\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._pathArray = this._pathArray || [];"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([x, y]);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize(x, y);"," },"," "," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function()"," {"," this._closePath();"," },",""," /**"," * Clears the path."," *"," * @method clear"," */"," clear: function()"," {"," this._currentX = 0;"," this._currentY = 0;"," this._width = 0;"," this._height = 0;"," this._left = 0;"," this._right = 0;"," this._top = 0;"," this._bottom = 0;"," this._pathArray = [];"," this._path = \"\";"," },",""," /**"," * Draws the path."," *"," * @method _closePath"," * @private"," */"," _closePath: function()"," {"," var pathArray,"," segmentArray,"," pathType,"," len,"," val,"," val2,"," i,"," path = \"\","," node = this.node,"," left = parseFloat(this._left),"," top = parseFloat(this._top),"," fill = this.get(\"fill\");"," if(this._pathArray)"," {"," pathArray = this._pathArray.concat();"," while(pathArray && pathArray.length > 0)"," {"," segmentArray = pathArray.shift();"," len = segmentArray.length;"," pathType = segmentArray[0];"," if(pathType === \"A\")"," {"," path += pathType + segmentArray[1] + \",\" + segmentArray[2];"," }"," else if(pathType == \"z\" || pathType == \"Z\")"," {"," path += \" z \";"," }"," else if(pathType == \"C\" || pathType == \"c\")"," {"," path += pathType + (segmentArray[1] - left)+ \",\" + (segmentArray[2] - top);"," }"," else"," {"," path += \" \" + pathType + parseFloat(segmentArray[1] - left);"," }"," switch(pathType)"," {"," case \"L\" :"," case \"l\" :"," case \"M\" :"," case \"Q\" :"," case \"q\" :"," for(i = 2; i < len; ++i)"," {"," val = (i % 2 === 0) ? top : left;"," val = segmentArray[i] - val;"," path += \", \" + parseFloat(val);"," }"," break;"," case \"A\" :"," val = \" \" + parseFloat(segmentArray[3]) + \" \" + parseFloat(segmentArray[4]);"," val += \",\" + parseFloat(segmentArray[5]) + \" \" + parseFloat(segmentArray[6] - left);"," val += \",\" + parseFloat(segmentArray[7] - top);"," path += \" \" + val;"," break;"," case \"C\" :"," case \"c\" :"," for(i = 3; i < len - 1; i = i + 2)"," {"," val = parseFloat(segmentArray[i] - left);"," val = val + \", \";"," val = val + parseFloat(segmentArray[i + 1] - top);"," path += \" \" + val;"," }"," break;"," }"," }"," if(fill && fill.color)"," {"," path += 'z';"," }"," Y.Lang.trim(path);"," if(path)"," {"," node.setAttribute(\"d\", path);"," }"," "," this._path = path;"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," }"," },",""," /**"," * Ends a fill and stroke"," *"," * @method closePath"," */"," closePath: function()"," {"," this._pathArray.push([\"z\"]);"," },",""," /**"," * Returns the current array of drawing commands."," *"," * @method _getCurrentArray"," * @return Array"," * @private"," */"," _getCurrentArray: function()"," {"," var currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];"," if(!currentArray)"," {"," currentArray = [];"," this._pathArray.push(currentArray);"," }"," return currentArray;"," },"," "," /**"," * Returns the points on a curve"," *"," * @method getBezierData"," * @param Array points Array containing the begin, end and control points of a curve."," * @param Number t The value for incrementing the next set of points."," * @return Array"," * @private"," */"," getBezierData: function(points, t) { "," var n = points.length,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }"," return [ tmp[0][0], tmp[0][1] ]; "," },"," "," /**"," * Calculates the bounding box for a curve"," *"," * @method _setCurveBoundingBox"," * @param Array pts Array containing points for start, end and control points of a curve."," * @param Number w Width used to calculate the number of points to describe the curve."," * @param Number h Height used to calculate the number of points to describe the curve."," * @private"," */"," _setCurveBoundingBox: function(pts, w, h)"," {"," var i,"," left = this._currentX,"," right = left,"," top = this._currentY,"," bottom = top,"," len = Math.round(Math.sqrt((w * w) + (h * h))),"," t = 1/len,"," xy;"," for(i = 0; i < len; ++i)"," {"," xy = this.getBezierData(pts, t * i);"," left = isNaN(left) ? xy[0] : Math.min(xy[0], left);"," right = isNaN(right) ? xy[0] : Math.max(xy[0], right);"," top = isNaN(top) ? xy[1] : Math.min(xy[1], top);"," bottom = isNaN(bottom) ? xy[1] : Math.max(xy[1], bottom);"," }"," left = Math.round(left * 10)/10;"," right = Math.round(right * 10)/10;"," top = Math.round(top * 10)/10;"," bottom = Math.round(bottom * 10)/10;"," this._trackSize(right, bottom);"," this._trackSize(left, top);"," },"," "," /**"," * Updates the size of the graphics object"," *"," * @method _trackSize"," * @param {Number} w width"," * @param {Number} h height"," * @private"," */"," _trackSize: function(w, h) {"," if (w > this._right) {"," this._right = w;"," }"," if(w < this._left)"," {"," this._left = w; "," }"," if (h < this._top)"," {"," this._top = h;"," }"," if (h > this._bottom) "," {"," this._bottom = h;"," }"," this._width = this._right - this._left;"," this._height = this._bottom - this._top;"," }","};","Y.SVGDrawing = SVGDrawing;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Shape.html\">`Shape`</a> class. "," * `SVGShape` is not intended to be used directly. Instead, use the <a href=\"Shape.html\">`Shape`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Shape.html\">`Shape`</a> "," * class will point to the `SVGShape` class."," *"," * @module graphics"," * @class SVGShape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */","SVGShape = function(cfg)","{"," this._transforms = [];"," this.matrix = new Y.Matrix();"," this._normalizedMatrix = new Y.Matrix();"," SVGShape.superclass.constructor.apply(this, arguments);","};","","SVGShape.NAME = \"shape\";","","Y.extend(SVGShape, Y.GraphicBase, Y.mix({"," /**"," * Storage for x attribute."," *"," * @property _x"," * @protected"," */"," _x: 0,",""," /**"," * Storage for y attribute."," *"," * @property _y"," * @protected"," */"," _y: 0,"," "," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," init: function()"," {"," this.initializer.apply(this, arguments);"," },",""," /**"," * Initializes the shape"," *"," * @private"," * @method initializer"," */"," initializer: function(cfg)"," {"," var host = this,"," graphic = cfg.graphic,"," data = this.get(\"data\");"," host.createNode(); "," if(graphic)"," {"," host._setGraphic(graphic);"," }"," if(data)"," {"," host._parsePathData(data);"," }"," host._updateHandler();"," },"," "," /**"," * Set the Graphic instance for the shape."," *"," * @method _setGraphic"," * @param {Graphic | Node | HTMLElement | String} render This param is used to determine the graphic instance. If it is a `Graphic` instance, it will be assigned"," * to the `graphic` attribute. Otherwise, a new Graphic instance will be created and rendered into the dom element that the render represents."," * @private"," */"," _setGraphic: function(render)"," {"," var graphic;"," if(render instanceof Y.SVGGraphic)"," {"," this._graphic = render;"," }"," else"," {"," render = Y.one(render);"," graphic = new Y.SVGGraphic({"," render: render"," });"," graphic._appendShape(this);"," this._graphic = graphic;"," }"," },",""," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," addClass: function(className)"," {"," var node = this.node;"," node.className.baseVal = Y_LANG.trim([node.className.baseVal, className].join(' '));"," },",""," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," removeClass: function(className)"," {"," var node = this.node,"," classString = node.className.baseVal;"," classString = classString.replace(new RegExp(className + ' '), className).replace(new RegExp(className), '');"," node.className.baseVal = classString;"," },",""," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY(),"," x = this._x,"," y = this._y;"," return [parentXY[0] + x, parentXY[1] + y];"," },",""," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," */"," setXY: function(xy)"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY();"," this._x = xy[0] - parentXY[0];"," this._y = xy[1] - parentXY[1];"," this.set(\"transform\", this.get(\"transform\"));"," },",""," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {SVGShape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," contains: function(needle)"," {"," return needle === Y.one(this.node);"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this.node;",""," return node === refNode;"," },",""," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," test: function(selector)"," {"," return Y.Selector.test(this.node, selector);"," },"," "," /**"," * Value function for fill attribute"," *"," * @private"," * @method _getDefaultFill"," * @return Object"," */"," _getDefaultFill: function() {"," return {"," type: \"solid\","," opacity: 1,"," cx: 0.5,"," cy: 0.5,"," fx: 0.5,"," fy: 0.5,"," r: 0.5"," };"," },"," "," /**"," * Value function for stroke attribute"," *"," * @private"," * @method _getDefaultStroke"," * @return Object"," */"," _getDefaultStroke: function() "," {"," return {"," weight: 1,"," dashstyle: \"none\","," color: \"#000\","," opacity: 1.0"," };"," },",""," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var host = this,"," node = DOCUMENT.createElementNS(\"http://www.w3.org/2000/svg\", \"svg:\" + this._type),"," id = host.get(\"id\"),"," name = host.name,"," concat = host._camelCaseConcat,"," pointerEvents = host.get(\"pointerEvents\");"," host.node = node;"," host.addClass(_getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name))); "," if(id)"," {"," node.setAttribute(\"id\", id);"," }"," if(pointerEvents)"," {"," node.setAttribute(\"pointer-events\", pointerEvents);"," }"," if(!host.get(\"visible\"))"," {"," Y.one(node).setStyle(\"visibility\", \"hidden\");"," }"," },"," ",""," /**"," * Overrides default `on` method. Checks to see if its a dom interaction event. If so, "," * return an event attached to the `node` element. If not, return the normal functionality."," *"," * @method on"," * @param {String} type event type"," * @param {Object} callback function"," * @private"," */"," on: function(type, fn)"," {"," if(Y.Node.DOM_EVENTS[type])"," {"," return Y.one(\"#\" + this.get(\"id\")).on(type, fn);"," }"," return Y.on.apply(this, arguments);"," },",""," /**"," * Adds a stroke to the shape node."," *"," * @method _strokeChangeHandler"," * @private"," */"," _strokeChangeHandler: function(e)"," {"," var node = this.node,"," stroke = this.get(\"stroke\"),"," strokeOpacity,"," dashstyle,"," dash,"," linejoin;"," if(stroke && stroke.weight && stroke.weight > 0)"," {"," linejoin = stroke.linejoin || \"round\";"," strokeOpacity = parseFloat(stroke.opacity);"," dashstyle = stroke.dashstyle || \"none\";"," dash = Y_LANG.isArray(dashstyle) ? dashstyle.toString() : dashstyle;"," stroke.color = stroke.color || \"#000000\";"," stroke.weight = stroke.weight || 1;"," stroke.opacity = Y_LANG.isNumber(strokeOpacity) ? strokeOpacity : 1;"," stroke.linecap = stroke.linecap || \"butt\";"," node.setAttribute(\"stroke-dasharray\", dash);"," node.setAttribute(\"stroke\", stroke.color);"," node.setAttribute(\"stroke-linecap\", stroke.linecap);"," node.setAttribute(\"stroke-width\", stroke.weight);"," node.setAttribute(\"stroke-opacity\", stroke.opacity);"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," node.setAttribute(\"stroke-linejoin\", linejoin);"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(Y_LANG.isNumber(linejoin))"," {"," node.setAttribute(\"stroke-miterlimit\", Math.max(linejoin, 1));"," node.setAttribute(\"stroke-linejoin\", \"miter\");"," }"," }"," }"," else"," {"," node.setAttribute(\"stroke\", \"none\");"," }"," },"," "," /**"," * Adds a fill to the shape node."," *"," * @method _fillChangeHandler"," * @private"," */"," _fillChangeHandler: function(e)"," {"," var node = this.node,"," fill = this.get(\"fill\"),"," fillOpacity,"," type;"," if(fill)"," {"," type = fill.type;"," if(type == \"linear\" || type == \"radial\")"," {"," this._setGradientFill(fill);"," node.setAttribute(\"fill\", \"url(#grad\" + this.get(\"id\") + \")\");"," }"," else if(!fill.color)"," {"," node.setAttribute(\"fill\", \"none\");"," }"," else"," {"," fillOpacity = parseFloat(fill.opacity);"," fillOpacity = Y_LANG.isNumber(fillOpacity) ? fillOpacity : 1;"," node.setAttribute(\"fill\", fill.color);"," node.setAttribute(\"fill-opacity\", fillOpacity);"," }"," }"," else"," {"," node.setAttribute(\"fill\", \"none\");"," }"," },",""," /**"," * Creates a gradient fill"," *"," * @method _setGradientFill"," * @param {String} type gradient type"," * @private"," */"," _setGradientFill: function(fill) {"," var offset,"," opacity,"," color,"," stopNode,"," newStop,"," isNumber = Y_LANG.isNumber,"," graphic = this._graphic,"," type = fill.type, "," gradientNode = graphic.getGradientNode(\"grad\" + this.get(\"id\"), type),"," stops = fill.stops,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," rotation = fill.rotation || 0,"," radCon = Math.PI/180,"," tanRadians = parseFloat(parseFloat(Math.tan(rotation * radCon)).toFixed(8)),"," i,"," len,"," def,"," stop,"," x1 = \"0%\", "," x2 = \"100%\", "," y1 = \"0%\", "," y2 = \"0%\","," cx = fill.cx,"," cy = fill.cy,"," fx = fill.fx,"," fy = fill.fy,"," r = fill.r,"," stopNodes = [];"," if(type == \"linear\")"," {"," cx = w/2;"," cy = h/2;"," if(Math.abs(tanRadians) * w/2 >= h/2)"," {"," if(rotation < 180)"," {"," y1 = 0;"," y2 = h;"," }"," else"," {"," y1 = h;"," y2 = 0;"," }"," x1 = cx - ((cy - y1)/tanRadians);"," x2 = cx - ((cy - y2)/tanRadians); "," }"," else"," {"," if(rotation > 90 && rotation < 270)"," {"," x1 = w;"," x2 = 0;"," }"," else"," {"," x1 = 0;"," x2 = w;"," }"," y1 = ((tanRadians * (cx - x1)) - cy) * -1;"," y2 = ((tanRadians * (cx - x2)) - cy) * -1;"," }",""," x1 = Math.round(100 * x1/w);"," x2 = Math.round(100 * x2/w);"," y1 = Math.round(100 * y1/h);"," y2 = Math.round(100 * y2/h);"," "," //Set default value if not valid "," x1 = isNumber(x1) ? x1 : 0;"," x2 = isNumber(x2) ? x2 : 100;"," y1 = isNumber(y1) ? y1 : 0;"," y2 = isNumber(y2) ? y2 : 0;"," "," gradientNode.setAttribute(\"spreadMethod\", \"pad\");"," gradientNode.setAttribute(\"width\", w);"," gradientNode.setAttribute(\"height\", h);"," gradientNode.setAttribute(\"x1\", x1 + \"%\");"," gradientNode.setAttribute(\"x2\", x2 + \"%\");"," gradientNode.setAttribute(\"y1\", y1 + \"%\");"," gradientNode.setAttribute(\"y2\", y2 + \"%\");"," }"," else"," {"," gradientNode.setAttribute(\"cx\", (cx * 100) + \"%\");"," gradientNode.setAttribute(\"cy\", (cy * 100) + \"%\");"," gradientNode.setAttribute(\"fx\", (fx * 100) + \"%\");"," gradientNode.setAttribute(\"fy\", (fy * 100) + \"%\");"," gradientNode.setAttribute(\"r\", (r * 100) + \"%\");"," }"," "," len = stops.length;"," def = 0;"," for(i = 0; i < len; ++i)"," {"," if(this._stops && this._stops.length > 0)"," {"," stopNode = this._stops.shift();"," newStop = false;"," }"," else"," {"," stopNode = graphic._createGraphicNode(\"stop\");"," newStop = true;"," }"," stop = stops[i];"," opacity = stop.opacity;"," color = stop.color;"," offset = stop.offset || i/(len - 1);"," offset = Math.round(offset * 100) + \"%\";"," opacity = isNumber(opacity) ? opacity : 1;"," opacity = Math.max(0, Math.min(1, opacity));"," def = (i + 1) / len;"," stopNode.setAttribute(\"offset\", offset);"," stopNode.setAttribute(\"stop-color\", color);"," stopNode.setAttribute(\"stop-opacity\", opacity);"," if(newStop)"," {"," gradientNode.appendChild(stopNode);"," }"," stopNodes.push(stopNode);"," }"," while(this._stops && this._stops.length > 0)"," {"," gradientNode.removeChild(this._stops.shift());"," }"," this._stops = stopNodes;"," },",""," _stops: null,",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function() "," {"," var host = this;"," AttributeLite.prototype.set.apply(host, arguments);"," if(host.initialized)"," {"," host._updateHandler();"," }"," },",""," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y)"," {"," this._addTransform(\"translate\", arguments);"," },",""," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," translateX: function(x)"," {"," this._addTransform(\"translateX\", arguments);"," },",""," /**"," * Translates the shape along the y-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," translateY: function(y)"," {"," this._addTransform(\"translateY\", arguments);"," },",""," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y)"," {"," this._addTransform(\"skew\", arguments);"," },",""," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x)"," {"," this._addTransform(\"skewX\", arguments);"," },",""," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y)"," {"," this._addTransform(\"skewY\", arguments);"," },",""," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg)"," {"," this._addTransform(\"rotate\", arguments);"," },",""," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y)"," {"," this._addTransform(\"scale\", arguments);"," },",""," /**"," * Adds a transform to the shape."," *"," * @method _addTransform"," * @param {String} type The transform being applied."," * @param {Array} args The arguments for the transform."," * @private"," */"," _addTransform: function(type, args)"," {"," args = Y.Array(args);"," this._transform = Y_LANG.trim(this._transform + \" \" + type + \"(\" + args.join(\", \") + \")\");"," args.unshift(type);"," this._transforms.push(args);"," if(this.initialized)"," {"," this._updateTransform();"," }"," },",""," /**"," * Applies all transforms."," *"," * @method _updateTransform"," * @private"," */"," _updateTransform: function()"," {"," var isPath = this._type == \"path\","," node = this.node,"," key,"," transform,"," transformOrigin,"," x,"," y,"," tx,"," ty,"," matrix = this.matrix,"," normalizedMatrix = this._normalizedMatrix,"," i,"," len = this._transforms.length;",""," if(isPath || (this._transforms && this._transforms.length > 0))"," {"," x = this._x;"," y = this._y;"," transformOrigin = this.get(\"transformOrigin\");"," tx = x + (transformOrigin[0] * this.get(\"width\"));"," ty = y + (transformOrigin[1] * this.get(\"height\")); "," //need to use translate for x/y coords"," if(isPath)"," {"," //adjust origin for custom shapes "," if(!(this instanceof Y.SVGPath))"," {"," tx = this._left + (transformOrigin[0] * this.get(\"width\"));"," ty = this._top + (transformOrigin[1] * this.get(\"height\"));"," }"," normalizedMatrix.init({dx: x + this._left, dy: y + this._top});"," }"," normalizedMatrix.translate(tx, ty);"," for(i = 0; i < len; ++i)"," {"," key = this._transforms[i].shift();"," if(key)"," {"," normalizedMatrix[key].apply(normalizedMatrix, this._transforms[i]);"," matrix[key].apply(matrix, this._transforms[i]); "," }"," if(isPath)"," {"," this._transforms[i].unshift(key);"," }"," }"," normalizedMatrix.translate(-tx, -ty);"," transform = \"matrix(\" + normalizedMatrix.a + \",\" + "," normalizedMatrix.b + \",\" + "," normalizedMatrix.c + \",\" + "," normalizedMatrix.d + \",\" + "," normalizedMatrix.dx + \",\" +"," normalizedMatrix.dy + \")\";"," }"," this._graphic.addToRedrawQueue(this); "," if(transform)"," {"," node.setAttribute(\"transform\", transform);"," }"," if(!isPath)"," {"," this._transforms = [];"," }"," },",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node;"," node.setAttribute(\"width\", this.get(\"width\"));"," node.setAttribute(\"height\", this.get(\"height\"));"," node.setAttribute(\"x\", this._x);"," node.setAttribute(\"y\", this._y);"," node.style.left = this._x + \"px\";"," node.style.top = this._y + \"px\";"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," },",""," /**"," * Updates `Shape` based on attribute changes."," *"," * @method _updateHandler"," * @private"," */"," _updateHandler: function(e)"," {"," this._draw();"," },"," "," /**"," * Storage for the transform attribute."," *"," * @property _transform"," * @type String"," * @private"," */"," _transform: \"\",",""," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," getBounds: function()"," {"," var type = this._type,"," stroke = this.get(\"stroke\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = type == \"path\" ? 0 : this._x,"," y = type == \"path\" ? 0 : this._y,"," wt = 0;"," if(type != \"path\")"," {"," if(stroke && stroke.weight)"," {"," wt = stroke.weight;"," }"," w = (x + w + wt) - (x - wt); "," h = (y + h + wt) - (y - wt);"," x -= wt;"," y -= wt;"," }"," return this._normalizedMatrix.getContentRect(w, h, x, y);"," },",""," /**"," * Places the shape above all other shapes."," *"," * @method toFront"," */"," toFront: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toFront(this);"," }"," },",""," /**"," * Places the shape underneath all other shapes."," *"," * @method toFront"," */"," toBack: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toBack(this);"," }"," },",""," /**"," * Parses path data string and call mapped methods."," *"," * @method _parsePathData"," * @param {String} val The path data"," * @private"," */"," _parsePathData: function(val)"," {"," var method,"," methodSymbol,"," args,"," commandArray = Y.Lang.trim(val.match(SPLITPATHPATTERN)),"," i,"," len, "," str,"," symbolToMethod = this._pathSymbolToMethod;"," if(commandArray)"," {"," this.clear();"," len = commandArray.length || 0;"," for(i = 0; i < len; i = i + 1)"," {"," str = commandArray[i];"," methodSymbol = str.substr(0, 1);"," args = str.substr(1).match(SPLITARGSPATTERN);"," method = symbolToMethod[methodSymbol];"," if(method)"," {"," if(args)"," {"," this[method].apply(this, args);"," }"," else"," {"," this[method].apply(this);"," }"," }"," }"," this.end();"," }"," },",""," /**"," * Destroys the shape instance."," *"," * @method destroy"," */"," destroy: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic.removeShape(this);"," }"," else"," {"," this._destroy();"," }"," },",""," /**"," * Implementation for shape destruction"," *"," * @method destroy"," * @protected"," */"," _destroy: function()"," {"," if(this.node)"," {"," Y.Event.purgeElement(this.node, true);"," if(this.node.parentNode)"," {"," this.node.parentNode.removeChild(this.node);"," }"," this.node = null;"," }"," }"," }, Y.SVGDrawing.prototype));"," ","SVGShape.ATTRS = {"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," transformOrigin: {"," valueFn: function()"," {"," return [0.5, 0.5];"," }"," },"," "," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd> "," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," transform: {"," setter: function(val)"," {"," this.matrix.init(); "," this._normalizedMatrix.init();"," this._transforms = this.matrix.getTransformArray(val);"," this._transform = val;"," return val;"," },",""," getter: function()"," {"," return this._transform;"," }"," },",""," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," var transform = this.get(\"transform\");"," this._x = val;"," if(transform) "," {"," this.set(\"transform\", transform);"," }"," }"," },",""," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," var transform = this.get(\"transform\");"," this._y = val;"," if(transform) "," {"," this.set(\"transform\", transform);"," }"," }"," },",""," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," value: 0"," },",""," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," height: {"," value: 0"," },",""," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val){"," var visibility = val ? \"visible\" : \"hidden\";"," if(this.node)"," {"," this.node.style.visibility = visibility;"," }"," return val;"," }"," },",""," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * </dl>"," *"," * @config fill"," * @type Object "," */"," fill: {"," valueFn: \"_getDefaultFill\","," "," setter: function(val)"," {"," var fill,"," tmpl = this.get(\"fill\") || this._getDefaultFill();"," fill = (val) ? Y.merge(tmpl, val) : null;"," if(fill && fill.color)"," {"," if(fill.color === undefined || fill.color == \"none\")"," {"," fill.color = null;"," }"," }"," return fill;"," }"," },",""," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," stroke: {"," valueFn: \"_getDefaultStroke\",",""," setter: function(val)"," {"," var tmpl = this.get(\"stroke\") || this._getDefaultStroke(),"," wt;"," if(val && val.hasOwnProperty(\"weight\"))"," {"," wt = parseInt(val.weight, 10);"," if(!isNaN(wt))"," {"," val.weight = wt;"," }"," }"," return (val) ? Y.merge(tmpl, val) : null;"," }"," },"," "," // Only implemented in SVG"," // Determines whether the instance will receive mouse events."," // "," // @config pointerEvents"," // @type string"," //"," pointerEvents: {"," valueFn: function() "," {"," var val = \"visiblePainted\","," node = this.node;"," if(node)"," {"," node.setAttribute(\"pointer-events\", val);"," }"," return val;"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"pointer-events\", val);"," }"," return val;"," }"," },",""," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this.node;"," }"," },",""," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," data: {"," setter: function(val)"," {"," if(this.get(\"node\"))"," {"," this._parsePathData(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the parent graphic instance"," *"," * @config graphic"," * @type SVGGraphic"," * @readOnly"," */"," graphic: {"," readOnly: true,",""," getter: function()"," {"," return this._graphic;"," }"," }","};","Y.SVGShape = SVGShape;","","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Path.html\">`Path`</a> class. "," * `SVGPath` is not intended to be used directly. Instead, use the <a href=\"Path.html\">`Path`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Path.html\">`Path`</a> "," * class will point to the `SVGPath` class."," *"," * @module graphics"," * @class SVGPath"," * @extends SVGShape"," * @constructor"," */","SVGPath = function(cfg)","{"," SVGPath.superclass.constructor.apply(this, arguments);","};","SVGPath.NAME = \"path\";","Y.extend(SVGPath, Y.SVGShape, {"," /**"," * Left edge of the path"," *"," * @property _left"," * @type Number"," * @private"," */"," _left: 0,",""," /**"," * Right edge of the path"," *"," * @property _right"," * @type Number"," * @private"," */"," _right: 0,"," "," /**"," * Top edge of the path"," *"," * @property _top"," * @type Number"," * @private"," */"," _top: 0, "," "," /**"," * Bottom edge of the path"," *"," * @property _bottom"," * @type Number"," * @private"," */"," _bottom: 0,",""," /**"," * Indicates the type of shape"," *"," * @property _type"," * @readOnly"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Storage for path"," *"," * @property _path"," * @type String"," * @private"," */"," _path: \"\"","});","","SVGPath.ATTRS = Y.merge(Y.SVGShape.ATTRS, {"," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," return this._path;"," }"," },",""," /**"," * Indicates the width of the shape"," * "," * @config width"," * @type Number"," */"," width: {"," getter: function()"," {"," var val = Math.max(this._right - this._left, 0);"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," height: {"," getter: function()"," {"," return Math.max(this._bottom - this._top, 0);"," }"," }","});","Y.SVGPath = SVGPath;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Rect.html\">`Rect`</a> class. "," * `SVGRect` is not intended to be used directly. Instead, use the <a href=\"Rect.html\">`Rect`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Rect.html\">`Rect`</a> "," * class will point to the `SVGRect` class."," *"," * @module graphics"," * @class SVGRect"," * @constructor"," */","SVGRect = function()","{"," SVGRect.superclass.constructor.apply(this, arguments);","};","SVGRect.NAME = \"rect\";","Y.extend(SVGRect, Y.SVGShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"rect\""," });","SVGRect.ATTRS = Y.SVGShape.ATTRS;","Y.SVGRect = SVGRect;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * `SVGEllipse` is not intended to be used directly. Instead, use the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Ellipse.html\">`Ellipse`</a> "," * class will point to the `SVGEllipse` class."," *"," * @module graphics"," * @class SVGEllipse"," * @constructor"," */","SVGEllipse = function(cfg)","{"," SVGEllipse.superclass.constructor.apply(this, arguments);","};","","SVGEllipse.NAME = \"ellipse\";","","Y.extend(SVGEllipse, SVGShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"ellipse\",",""," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," xRadius = w * 0.5,"," yRadius = h * 0.5,"," cx = x + xRadius,"," cy = y + yRadius;"," node.setAttribute(\"rx\", xRadius);"," node.setAttribute(\"ry\", yRadius);"," node.setAttribute(\"cx\", cx);"," node.setAttribute(\"cy\", cy);"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," }","});","","SVGEllipse.ATTRS = Y.merge(SVGShape.ATTRS, {"," /**"," * Horizontal radius for the ellipse. "," *"," * @config xRadius"," * @type Number"," */"," xRadius: {"," setter: function(val)"," {"," this.set(\"width\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"width\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," },",""," /**"," * Vertical radius for the ellipse. "," *"," * @config yRadius"," * @type Number"," * @readOnly"," */"," yRadius: {"," setter: function(val)"," {"," this.set(\"height\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"height\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," }","});","Y.SVGEllipse = SVGEllipse;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Circle.html\">`Circle`</a> class. "," * `SVGCircle` is not intended to be used directly. Instead, use the <a href=\"Circle.html\">`Circle`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Circle.html\">`Circle`</a> "," * class will point to the `SVGCircle` class."," *"," * @module graphics"," * @class SVGCircle"," * @constructor"," */"," SVGCircle = function(cfg)"," {"," SVGCircle.superclass.constructor.apply(this, arguments);"," };"," "," SVGCircle.NAME = \"circle\";",""," Y.extend(SVGCircle, Y.SVGShape, { "," "," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"circle\",",""," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," radius = this.get(\"radius\"),"," cx = x + radius,"," cy = y + radius;"," node.setAttribute(\"r\", radius);"," node.setAttribute(\"cx\", cx);"," node.setAttribute(\"cy\", cy);"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," }"," });"," ","SVGCircle.ATTRS = Y.merge(Y.SVGShape.ATTRS, {"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","});","Y.SVGCircle = SVGCircle;","/**"," * Draws pie slices"," *"," * @module graphics"," * @class SVGPieSlice"," * @constructor"," */","SVGPieSlice = function()","{"," SVGPieSlice.superclass.constructor.apply(this, arguments);","};","SVGPieSlice.NAME = \"svgPieSlice\";","Y.extend(SVGPieSlice, Y.SVGShape, Y.mix({"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Change event listener"," *"," * @private"," * @method _updateHandler"," */"," _draw: function(e)"," {"," var x = this.get(\"cx\"),"," y = this.get(\"cy\"),"," startAngle = this.get(\"startAngle\"),"," arc = this.get(\"arc\"),"," radius = this.get(\"radius\");"," this.clear();"," this.drawWedge(x, y, startAngle, arc, radius);"," this.end();"," }"," }, Y.SVGDrawing.prototype));","SVGPieSlice.ATTRS = Y.mix({"," cx: {"," value: 0"," },",""," cy: {"," value: 0"," },"," /**"," * Starting angle in relation to a circle in which to begin the pie slice drawing."," *"," * @config startAngle"," * @type Number"," */"," startAngle: {"," value: 0"," },",""," /**"," * Arc of the slice."," *"," * @config arc"," * @type Number"," */"," arc: {"," value: 0"," },",""," /**"," * Radius of the circle in which the pie slice is drawn"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","}, Y.SVGShape.ATTRS);","Y.SVGPieSlice = SVGPieSlice;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * `SVGGraphic` is not intended to be used directly. Instead, use the <a href=\"Graphic.html\">`Graphic`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Graphic.html\">`Graphic`</a> "," * class will point to the `SVGGraphic` class."," *"," * @module graphics"," * @class SVGGraphic"," * @constructor"," */","SVGGraphic = function(cfg) {"," SVGGraphic.superclass.constructor.apply(this, arguments);","};","","SVGGraphic.NAME = \"svgGraphic\";","","SVGGraphic.ATTRS = {"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," render: {},"," "," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this._node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," shapes: {"," readOnly: true,",""," getter: function()"," {"," return this._shapes;"," }"," },",""," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object "," * @readOnly"," */"," contentBounds: {"," readOnly: true,",""," getter: function()"," {"," return this._contentBounds;"," }"," },",""," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this._node;"," }"," },"," "," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.width = val + \"px\";"," }"," return val; "," }"," },",""," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," height: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.height = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," autoSize: {"," value: false"," },"," "," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," preserveAspectRatio: {"," value: \"xMidYMid\""," },"," "," /**"," * The contentBounds will resize to greater values but not to smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," resizeDown: {"," value: false"," },",""," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," this._x = val;"," if(this._node)"," {"," this._node.style.left = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," this._y = val;"," if(this._node)"," {"," this._node.style.top = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," autoDraw: {"," value: true"," },"," "," visible: {"," value: true,",""," setter: function(val)"," {"," this._toggleVisible(val);"," return val;"," }"," },",""," //"," // Indicates the pointer-events setting for the svg:svg element."," //"," // @config pointerEvents"," // @type String"," //"," pointerEvents: {"," value: \"none\""," }","};","","Y.extend(SVGGraphic, Y.GraphicBase, {"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, value) "," {"," var host = this,"," redrawAttrs = {"," autoDraw: true,"," autoSize: true,"," preserveAspectRatio: true,"," resizeDown: true"," },"," key,"," forceRedraw = false;"," AttributeLite.prototype.set.apply(host, arguments); "," if(host._state.autoDraw === true && Y.Object.size(this._shapes) > 0)"," {"," if(Y_LANG.isString && redrawAttrs[attr])"," {"," forceRedraw = true;"," }"," else if(Y_LANG.isObject(attr))"," {"," for(key in redrawAttrs)"," {"," if(redrawAttrs.hasOwnProperty(key) && attr[key])"," {"," forceRedraw = true;"," break;"," }"," }"," }"," }"," if(forceRedraw)"," {"," host._redraw();"," }"," },",""," /**"," * Storage for `x` attribute."," *"," * @property _x"," * @type Number"," * @private"," */"," _x: 0,",""," /**"," * Storage for `y` attribute."," *"," * @property _y"," * @type Number"," * @private"," */"," _y: 0,",""," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var node = Y.one(this._node),"," xy;"," if(node)"," {"," xy = node.getXY();"," }"," return xy;"," },",""," /**"," * Initializes the class."," *"," * @method initializer"," * @private"," */"," initializer: function() {"," var render = this.get(\"render\"),"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\";"," this._shapes = {};"," this._contentBounds = {"," left: 0,"," top: 0,"," right: 0,"," bottom: 0"," };"," this._gradients = {};"," this._node = DOCUMENT.createElement('div');"," this._node.style.position = \"absolute\";"," this._node.style.left = this.get(\"x\") + \"px\";"," this._node.style.top = this.get(\"y\") + \"px\";"," this._node.style.visibility = visibility;"," this._contentNode = this._createGraphics();"," this._contentNode.style.visibility = visibility;"," this._contentNode.setAttribute(\"id\", this.get(\"id\"));"," this._node.appendChild(this._contentNode);"," if(render)"," {"," this.render(render);"," }"," },",""," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {HTMLElement} parentNode node in which to render the graphics node into."," */"," render: function(render) {"," var parentNode = Y.one(render),"," w = this.get(\"width\") || parseInt(parentNode.getComputedStyle(\"width\"), 10),"," h = this.get(\"height\") || parseInt(parentNode.getComputedStyle(\"height\"), 10);"," parentNode = parentNode || Y.one(DOCUMENT.body);"," parentNode.append(this._node);"," this.parentNode = parentNode;"," this.set(\"width\", w);"," this.set(\"height\", h);"," return this;"," },",""," /**"," * Removes all nodes."," *"," * @method destroy"," */"," destroy: function()"," {"," this.removeAllShapes();"," if(this._contentNode)"," {"," this._removeChildren(this._contentNode);"," if(this._contentNode.parentNode)"," {"," this._contentNode.parentNode.removeChild(this._contentNode);"," }"," this._contentNode = null;"," }"," if(this._node)"," {"," this._removeChildren(this._node);"," Y.one(this._node).remove(true);"," this._node = null;"," }"," },",""," /**"," * Generates a shape instance by type."," *"," * @method addShape"," * @param {Object} cfg attributes for the shape"," * @return Shape"," */"," addShape: function(cfg)"," {"," cfg.graphic = this;"," if(!this.get(\"visible\"))"," {"," cfg.visible = false;"," }"," var shapeClass = this._getShapeClass(cfg.type),"," shape = new shapeClass(cfg);"," this._appendShape(shape);"," return shape;"," },",""," /**"," * Adds a shape instance to the graphic instance."," *"," * @method _appendShape"," * @param {Shape} shape The shape instance to be added to the graphic."," * @private"," */"," _appendShape: function(shape)"," {"," var node = shape.node,"," parentNode = this._frag || this._contentNode;"," if(this.get(\"autoDraw\")) "," {"," parentNode.appendChild(node);"," }"," else"," {"," this._getDocFrag().appendChild(node);"," }"," },",""," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," removeShape: function(shape)"," {"," if(!(shape instanceof SVGShape))"," {"," if(Y_LANG.isString(shape))"," {"," shape = this._shapes[shape];"," }"," }"," if(shape && shape instanceof SVGShape)"," {"," shape._destroy();"," delete this._shapes[shape.get(\"id\")];"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," return shape;"," },",""," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," removeAllShapes: function()"," {"," var shapes = this._shapes,"," i;"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i]._destroy();"," }"," }"," this._shapes = {};"," },"," "," /**"," * Removes all child nodes."," *"," * @method _removeChildren"," * @param {HTMLElement} node"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },",""," /**"," * Clears the graphics object."," *"," * @method clear"," */"," clear: function() {"," this.removeAllShapes();"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} val indicates visibilitye"," * @private"," */"," _toggleVisible: function(val)"," {"," var i,"," shapes = this._shapes,"," visibility = val ? \"visible\" : \"hidden\";"," if(shapes)"," {"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].set(\"visible\", val);"," }"," }"," }"," if(this._contentNode)"," {"," this._contentNode.style.visibility = visibility;"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," },",""," /**"," * Returns a shape class. Used by `addShape`. "," *"," * @method _getShapeClass"," * @param {Shape | String} val Indicates which shape class. "," * @return Function "," * @private"," */"," _getShapeClass: function(val)"," {"," var shape = this._shapeClass[val];"," if(shape)"," {"," return shape;"," }"," return val;"," },",""," /**"," * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation."," *"," * @property _shapeClass"," * @type Object"," * @private"," */"," _shapeClass: {"," circle: Y.SVGCircle,"," rect: Y.SVGRect,"," path: Y.SVGPath,"," ellipse: Y.SVGEllipse,"," pieslice: Y.SVGPieSlice"," },"," "," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," getShapeById: function(id)"," {"," var shape = this._shapes[id];"," return shape;"," },",""," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */"," batch: function(method)"," {"," var autoDraw = this.get(\"autoDraw\");"," this.set(\"autoDraw\", false);"," method();"," this.set(\"autoDraw\", autoDraw);"," },"," "," /**"," * Returns a document fragment to for attaching shapes."," *"," * @method _getDocFrag"," * @return DocumentFragment"," * @private"," */"," _getDocFrag: function()"," {"," if(!this._frag)"," {"," this._frag = DOCUMENT.createDocumentFragment();"," }"," return this._frag;"," },",""," /**"," * Redraws all shapes."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var autoSize = this.get(\"autoSize\"),"," preserveAspectRatio = this.get(\"preserveAspectRatio\"),"," box = this.get(\"resizeDown\") ? this._getUpdatedContentBounds() : this._contentBounds,"," left = box.left,"," right = box.right,"," top = box.top,"," bottom = box.bottom,"," width = right - left,"," height = bottom - top,"," computedWidth,"," computedHeight,"," computedLeft,"," computedTop,"," node;"," if(autoSize)"," {"," if(autoSize == \"sizeContentToGraphic\")"," {"," node = Y.one(this._node);"," computedWidth = parseFloat(node.getComputedStyle(\"width\"));"," computedHeight = parseFloat(node.getComputedStyle(\"height\"));"," computedLeft = computedTop = 0;"," this._contentNode.setAttribute(\"preserveAspectRatio\", preserveAspectRatio);"," }"," else "," {"," computedWidth = width;"," computedHeight = height;"," computedLeft = left;"," computedTop = top;"," this._state.width = width;"," this._state.height = height;"," if(this._node)"," {"," this._node.style.width = width + \"px\";"," this._node.style.height = height + \"px\";"," }"," }"," }"," else"," {"," computedWidth = width;"," computedHeight = height;"," computedLeft = left;"," computedTop = top;"," }"," if(this._contentNode)"," {"," this._contentNode.style.left = computedLeft + \"px\";"," this._contentNode.style.top = computedTop + \"px\";"," this._contentNode.setAttribute(\"width\", computedWidth);"," this._contentNode.setAttribute(\"height\", computedHeight);"," this._contentNode.style.width = computedWidth + \"px\";"," this._contentNode.style.height = computedHeight + \"px\";"," this._contentNode.setAttribute(\"viewBox\", \"\" + left + \" \" + top + \" \" + width + \" \" + height + \"\");"," }"," if(this._frag)"," {"," if(this._contentNode)"," {"," this._contentNode.appendChild(this._frag);"," }"," this._frag = null;"," } "," },"," "," /**"," * Adds a shape to the redraw queue and calculates the contentBounds. Used internally "," * by `Shape` instances."," *"," * @method addToRedrawQueue"," * @param shape {SVGShape}"," * @protected"," */"," addToRedrawQueue: function(shape)"," {"," var shapeBox,"," box;"," this._shapes[shape.get(\"id\")] = shape;"," if(!this.get(\"resizeDown\"))"," {"," shapeBox = shape.getBounds();"," box = this._contentBounds;"," box.left = box.left < shapeBox.left ? box.left : shapeBox.left;"," box.top = box.top < shapeBox.top ? box.top : shapeBox.top;"," box.right = box.right > shapeBox.right ? box.right : shapeBox.right;"," box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;"," box.width = box.right - box.left;"," box.height = box.bottom - box.top;"," this._contentBounds = box;"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," },",""," /**"," * Recalculates and returns the `contentBounds` for the `Graphic` instance."," *"," * @method _getUpdatedContentBounds"," * @return {Object} "," * @private"," */"," _getUpdatedContentBounds: function()"," {"," var bounds,"," i,"," shape,"," queue = this._shapes,"," box = {};"," for(i in queue)"," {"," if(queue.hasOwnProperty(i))"," {"," shape = queue[i];"," bounds = shape.getBounds();"," box.left = Y_LANG.isNumber(box.left) ? Math.min(box.left, bounds.left) : bounds.left;"," box.top = Y_LANG.isNumber(box.top) ? Math.min(box.top, bounds.top) : bounds.top;"," box.right = Y_LANG.isNumber(box.right) ? Math.max(box.right, bounds.right) : bounds.right;"," box.bottom = Y_LANG.isNumber(box.bottom) ? Math.max(box.bottom, bounds.bottom) : bounds.bottom;"," }"," }"," box.left = Y_LANG.isNumber(box.left) ? box.left : 0;"," box.top = Y_LANG.isNumber(box.top) ? box.top : 0;"," box.right = Y_LANG.isNumber(box.right) ? box.right : 0;"," box.bottom = Y_LANG.isNumber(box.bottom) ? box.bottom : 0;"," this._contentBounds = box;"," return box;"," },",""," /**"," * Creates a contentNode element"," *"," * @method _createGraphics"," * @private"," */"," _createGraphics: function() {"," var contentNode = this._createGraphicNode(\"svg\"),"," pointerEvents = this.get(\"pointerEvents\");"," contentNode.style.position = \"absolute\";"," contentNode.style.top = \"0px\";"," contentNode.style.left = \"0px\";"," contentNode.style.overflow = \"auto\";"," contentNode.setAttribute(\"overflow\", \"auto\");"," contentNode.setAttribute(\"pointer-events\", pointerEvents);"," return contentNode;"," },",""," /**"," * Creates a graphic node"," *"," * @method _createGraphicNode"," * @param {String} type node type to create"," * @param {String} pe specified pointer-events value"," * @return HTMLElement"," * @private"," */"," _createGraphicNode: function(type, pe)"," {"," var node = DOCUMENT.createElementNS(\"http://www.w3.org/2000/svg\", \"svg:\" + type),"," v = pe || \"none\";"," if(type !== \"defs\" && type !== \"stop\" && type !== \"linearGradient\" && type != \"radialGradient\")"," {"," node.setAttribute(\"pointer-events\", v);"," }"," return node;"," },",""," /**"," * Returns a reference to a gradient definition based on an id and type."," *"," * @method getGradientNode"," * @param {String} key id that references the gradient definition"," * @param {String} type description of the gradient type"," * @return HTMLElement"," * @protected"," */"," getGradientNode: function(key, type)"," {"," var gradients = this._gradients,"," gradient,"," nodeType = type + \"Gradient\";"," if(gradients.hasOwnProperty(key) && gradients[key].tagName.indexOf(type) > -1)"," {"," gradient = this._gradients[key];"," }"," else"," {"," gradient = this._createGraphicNode(nodeType);"," if(!this._defs)"," {"," this._defs = this._createGraphicNode(\"defs\");"," this._contentNode.appendChild(this._defs);"," }"," this._defs.appendChild(gradient);"," key = key || \"gradient\" + Math.round(100000 * Math.random());"," gradient.setAttribute(\"id\", key);"," if(gradients.hasOwnProperty(key))"," {"," this._defs.removeChild(gradients[key]);"," }"," gradients[key] = gradient;"," }"," return gradient;"," },",""," /**"," * Inserts shape on the top of the tree."," *"," * @method _toFront"," * @param {SVGShape} Shape to add."," * @private"," */"," _toFront: function(shape)"," {"," var contentNode = this._contentNode;"," if(shape instanceof Y.SVGShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," contentNode.appendChild(shape);"," }"," },",""," /**"," * Inserts shape as the first child of the content node."," *"," * @method _toBack"," * @param {SVGShape} Shape to add."," * @private"," */"," _toBack: function(shape)"," {"," var contentNode = this._contentNode,"," targetNode;"," if(shape instanceof Y.SVGShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," targetNode = contentNode.firstChild;"," if(targetNode)"," {"," contentNode.insertBefore(shape, targetNode);"," }"," else"," {"," contentNode.appendChild(shape);"," }"," }"," }","});","","Y.SVGGraphic = SVGGraphic;","","","","}, '3.7.2', {\"requires\": [\"graphics\"]});"];+_yuitest_coverage["build/graphics-svg/graphics-svg.js"].code=["YUI.add('graphics-svg', function (Y, NAME) {","","var IMPLEMENTATION = \"svg\","," SHAPE = \"shape\","," SPLITPATHPATTERN = /[a-z][^a-z]*/ig,"," SPLITARGSPATTERN = /[-]?[0-9]*[0-9|\\.][0-9]*/g,"," Y_LANG = Y.Lang,"," AttributeLite = Y.AttributeLite,"," SVGGraphic,"," SVGShape,"," SVGCircle,"," SVGRect,"," SVGPath,"," SVGEllipse,"," SVGPieSlice,"," DOCUMENT = Y.config.doc,"," _getClassName = Y.ClassNameManager.getClassName;","","function SVGDrawing(){}","","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Drawing.html\">`Drawing`</a> class. "," * `SVGDrawing` is not intended to be used directly. Instead, use the <a href=\"Drawing.html\">`Drawing`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Drawing.html\">`Drawing`</a> "," * class will point to the `SVGDrawing` class."," *"," * @module graphics"," * @class SVGDrawing"," * @constructor"," */","SVGDrawing.prototype = {"," /**"," * Maps path to methods"," *"," * @property _pathSymbolToMethod"," * @type Object"," * @private"," */"," _pathSymbolToMethod: {"," M: \"moveTo\","," m: \"relativeMoveTo\","," L: \"lineTo\","," l: \"relativeLineTo\","," C: \"curveTo\","," c: \"relativeCurveTo\","," Q: \"quadraticCurveTo\","," q: \"relativeQuadraticCurveTo\","," z: \"closePath\","," Z: \"closePath\""," },",""," /**"," * Current x position of the drawing."," *"," * @property _currentX"," * @type Number"," * @private"," */"," _currentX: 0,",""," /**"," * Current y position of the drqwing."," *"," * @property _currentY"," * @type Number"," * @private"," */"," _currentY: 0,"," "," /**"," * Indicates the type of shape"," *"," * @private"," * @property _type"," * @readOnly"," * @type String"," */"," _type: \"path\","," "," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," curveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a bezier curve relative to the current coordinates."," *"," * @method relativeCurveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeCurveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements curveTo methods."," *"," * @method _curveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _curveTo: function(args, relative) {"," var w,"," h,"," pts,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," x,"," y,"," right,"," left,"," bottom,"," top,"," i,"," len,"," pathArrayLen,"," currentArray,"," command = relative ? \"c\" : \"C\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._pathArray = this._pathArray || [];"," if(this._pathType !== command)"," {"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];"," if(!currentArray)"," {"," currentArray = [];"," this._pathArray.push(currentArray);"," }"," }"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat(args);"," len = args.length - 5;"," for(i = 0; i < len; i = i + 6)"," {"," cp1x = parseFloat(args[i]) + relativeX;"," cp1y = parseFloat(args[i + 1]) + relativeY;"," cp2x = parseFloat(args[i + 2]) + relativeX;"," cp2y = parseFloat(args[i + 3]) + relativeY;"," x = parseFloat(args[i + 4]) + relativeX;"," y = parseFloat(args[i + 5]) + relativeY;"," right = Math.max(x, Math.max(cp1x, cp2x));"," bottom = Math.max(y, Math.max(cp1y, cp2y));"," left = Math.min(x, Math.min(cp1x, cp2x));"," top = Math.min(y, Math.min(cp1y, cp2y));"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cp1x, cp1y], [cp2x, cp2y], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," },",""," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," quadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a quadratic bezier curve relative to the current position."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeQuadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), true]);"," },"," "," /**"," * Implements quadraticCurveTo methods."," *"," * @method _quadraticCurveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _quadraticCurveTo: function(args, relative) {"," var cpx, "," cpy, "," x, "," y,"," pathArrayLen,"," currentArray,"," w,"," h,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len,"," command = relative ? \"q\" : \"Q\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," if(this._pathType !== command)"," {"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];"," if(!currentArray)"," {"," currentArray = [];"," this._pathArray.push(currentArray);"," }"," }"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat(args);"," len = args.length - 3;"," for(i = 0; i < len; i = i + 4)"," {"," cpx = parseFloat(args[i]) + relativeX;"," cpy = parseFloat(args[i + 1]) + relativeY;"," x = parseFloat(args[i + 2]) + relativeX;"," y = parseFloat(args[i + 3]) + relativeY;"," right = Math.max(x, cpx);"," bottom = Math.max(y, cpy);"," left = Math.min(x, cpx);"," top = Math.min(y, cpy);"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cpx, cpy], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," },",""," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," drawRect: function(x, y, w, h) {"," this.moveTo(x, y);"," this.lineTo(x + w, y);"," this.lineTo(x + w, y + h);"," this.lineTo(x, y + h);"," this.lineTo(x, y);"," },",""," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," drawRoundRect: function(x, y, w, h, ew, eh) {"," this.moveTo(x, y + eh);"," this.lineTo(x, y + h - eh);"," this.quadraticCurveTo(x, y + h, x + ew, y + h);"," this.lineTo(x + w - ew, y + h);"," this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);"," this.lineTo(x + w, y + eh);"," this.quadraticCurveTo(x + w, y, x + w - ew, y);"," this.lineTo(x + ew, y);"," this.quadraticCurveTo(x, y, x, y + eh);"," },",""," /**"," * Draws a circle. "," * "," * @method drawCircle"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} r radius"," * @protected"," */"," drawCircle: function(x, y, radius) {"," var circum = radius * 2;"," this._drawingComplete = false;"," this._trackSize(x, y);"," this._trackSize(x + circum, y + circum);"," this._pathArray = this._pathArray || [];"," this._pathArray.push([\"M\", x + radius, y]);"," this._pathArray.push([\"A\", radius, radius, 0, 1, 0, x + radius, y + circum]);"," this._pathArray.push([\"A\", radius, radius, 0, 1, 0, x + radius, y]);"," this._currentX = x;"," this._currentY = y;"," return this;"," },"," "," /**"," * Draws an ellipse."," *"," * @method drawEllipse"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @protected"," */"," drawEllipse: function(x, y, w, h) {"," var radius = w * 0.5,"," yRadius = h * 0.5;"," this._drawingComplete = false;"," this._trackSize(x, y);"," this._trackSize(x + w, y + h);"," this._pathArray = this._pathArray || [];"," this._pathArray.push([\"M\", x + radius, y]);"," this._pathArray.push([\"A\", radius, yRadius, 0, 1, 0, x + radius, y + h]);"," this._pathArray.push([\"A\", radius, yRadius, 0, 1, 0, x + radius, y]);"," this._currentX = x;"," this._currentY = y;"," return this;"," },",""," /**"," * Draws a diamond. "," * "," * @method drawDiamond"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} width width"," * @param {Number} height height"," * @protected"," */"," drawDiamond: function(x, y, width, height)"," {"," var midWidth = width * 0.5,"," midHeight = height * 0.5;"," this.moveTo(x + midWidth, y);"," this.lineTo(x + width, y + midHeight);"," this.lineTo(x + midWidth, y + height);"," this.lineTo(x, y + midHeight);"," this.lineTo(x + midWidth, y);"," return this;"," },",""," /**"," * Draws a wedge."," *"," * @method drawWedge"," * @param {Number} x x-coordinate of the wedge's center point"," * @param {Number} y y-coordinate of the wedge's center point"," * @param {Number} startAngle starting angle in degrees"," * @param {Number} arc sweep of the wedge. Negative values draw clockwise."," * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius."," * @param {Number} yRadius [optional] y radius for wedge."," * @private"," */"," drawWedge: function(x, y, startAngle, arc, radius, yRadius)"," {"," var segs,"," segAngle,"," theta,"," angle,"," angleMid,"," ax,"," ay,"," bx,"," by,"," cx,"," cy,"," i,"," diameter = radius * 2,"," currentArray,"," pathArrayLen;"," yRadius = yRadius || radius;"," if(this._pathType != \"M\")"," {"," this._pathType = \"M\";"," currentArray = [\"M\"];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._getCurrentArray(); "," }"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen].push(x); "," this._pathArray[pathArrayLen].push(x); "," "," // limit sweep to reasonable numbers"," if(Math.abs(arc) > 360)"," {"," arc = 360;"," }"," "," // First we calculate how many segments are needed"," // for a smooth arc."," segs = Math.ceil(Math.abs(arc) / 45);"," "," // Now calculate the sweep of each segment."," segAngle = arc / segs;"," "," // The math requires radians rather than degrees. To convert from degrees"," // use the formula (degrees/180)*Math.PI to get radians."," theta = -(segAngle / 180) * Math.PI;"," "," // convert angle startAngle to radians"," angle = (startAngle / 180) * Math.PI;"," if(segs > 0)"," {"," // draw a line from the center to the start of the curve"," ax = x + Math.cos(startAngle / 180 * Math.PI) * radius;"," ay = y + Math.sin(startAngle / 180 * Math.PI) * yRadius;"," this._pathType = \"L\";"," pathArrayLen++;"," this._pathArray[pathArrayLen] = [\"L\"];"," this._pathArray[pathArrayLen].push(Math.round(ax));"," this._pathArray[pathArrayLen].push(Math.round(ay));"," pathArrayLen++; "," this._pathType = \"Q\";"," this._pathArray[pathArrayLen] = [\"Q\"];"," for(i = 0; i < segs; ++i)"," {"," angle += theta;"," angleMid = angle - (theta / 2);"," bx = x + Math.cos(angle) * radius;"," by = y + Math.sin(angle) * yRadius;"," cx = x + Math.cos(angleMid) * (radius / Math.cos(theta / 2));"," cy = y + Math.sin(angleMid) * (yRadius / Math.cos(theta / 2));"," this._pathArray[pathArrayLen].push(Math.round(cx));"," this._pathArray[pathArrayLen].push(Math.round(cy));"," this._pathArray[pathArrayLen].push(Math.round(bx));"," this._pathArray[pathArrayLen].push(Math.round(by));"," }"," }"," this._currentX = x;"," this._currentY = y;"," this._trackSize(diameter, diameter); "," return this;"," },",""," /**"," * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," lineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a line segment using the current line style from the current drawing position to the relative x and y coordinates."," * "," * @method relativeLineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," relativeLineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements lineTo methods."," *"," * @method _lineTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _lineTo: function(args, relative) {"," var point1 = args[0],"," i,"," len,"," pathArrayLen,"," currentArray,"," x,"," y,"," command = relative ? \"l\" : \"L\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._pathArray = this._pathArray || [];"," this._shapeType = \"path\";"," len = args.length;"," if(this._pathType !== command)"," {"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," }"," else"," {"," currentArray = this._getCurrentArray();"," }"," pathArrayLen = this._pathArray.length - 1;"," if (typeof point1 === 'string' || typeof point1 === 'number') {"," for (i = 0; i < len; i = i + 2) {"," x = parseFloat(args[i]);"," y = parseFloat(args[i + 1]);"," this._pathArray[pathArrayLen].push(x);"," this._pathArray[pathArrayLen].push(y);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize.apply(this, [x, y]);"," }"," }"," else"," {"," for (i = 0; i < len; ++i) {"," x = parseFloat(args[i][0]);"," y = parseFloat(args[i][1]);"," this._pathArray[pathArrayLen].push(x);"," this._pathArray[pathArrayLen].push(y);"," this._currentX = x;"," this._currentY = y;"," x = x + relativeX;"," y = y + relativeY;"," this._trackSize.apply(this, [x, y]);"," }"," }"," },",""," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," moveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Moves the current drawing position relative to specified x and y coordinates."," *"," * @method relativeMoveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeMoveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements moveTo methods."," *"," * @method _moveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _moveTo: function(args, relative) {"," var pathArrayLen,"," currentArray,"," x = parseFloat(args[0]),"," y = parseFloat(args[1]),"," command = relative ? \"m\" : \"M\","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._pathArray = this._pathArray || [];"," this._pathType = command;"," currentArray = [command];"," this._pathArray.push(currentArray);"," pathArrayLen = this._pathArray.length - 1;"," this._pathArray[pathArrayLen] = this._pathArray[pathArrayLen].concat([x, y]);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize(x, y);"," },"," "," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function()"," {"," this._closePath();"," },",""," /**"," * Clears the path."," *"," * @method clear"," */"," clear: function()"," {"," this._currentX = 0;"," this._currentY = 0;"," this._width = 0;"," this._height = 0;"," this._left = 0;"," this._right = 0;"," this._top = 0;"," this._bottom = 0;"," this._pathArray = [];"," this._path = \"\";"," },",""," /**"," * Draws the path."," *"," * @method _closePath"," * @private"," */"," _closePath: function()"," {"," var pathArray,"," segmentArray,"," pathType,"," len,"," val,"," val2,"," i,"," path = \"\","," node = this.node,"," left = parseFloat(this._left),"," top = parseFloat(this._top),"," fill = this.get(\"fill\");"," if(this._pathArray)"," {"," pathArray = this._pathArray.concat();"," while(pathArray && pathArray.length > 0)"," {"," segmentArray = pathArray.shift();"," len = segmentArray.length;"," pathType = segmentArray[0];"," if(pathType === \"A\")"," {"," path += pathType + segmentArray[1] + \",\" + segmentArray[2];"," }"," else if(pathType == \"z\" || pathType == \"Z\")"," {"," path += \" z \";"," }"," else if(pathType == \"C\" || pathType == \"c\")"," {"," path += pathType + (segmentArray[1] - left)+ \",\" + (segmentArray[2] - top);"," }"," else"," {"," path += \" \" + pathType + parseFloat(segmentArray[1] - left);"," }"," switch(pathType)"," {"," case \"L\" :"," case \"l\" :"," case \"M\" :"," case \"Q\" :"," case \"q\" :"," for(i = 2; i < len; ++i)"," {"," val = (i % 2 === 0) ? top : left;"," val = segmentArray[i] - val;"," path += \", \" + parseFloat(val);"," }"," break;"," case \"A\" :"," val = \" \" + parseFloat(segmentArray[3]) + \" \" + parseFloat(segmentArray[4]);"," val += \",\" + parseFloat(segmentArray[5]) + \" \" + parseFloat(segmentArray[6] - left);"," val += \",\" + parseFloat(segmentArray[7] - top);"," path += \" \" + val;"," break;"," case \"C\" :"," case \"c\" :"," for(i = 3; i < len - 1; i = i + 2)"," {"," val = parseFloat(segmentArray[i] - left);"," val = val + \", \";"," val = val + parseFloat(segmentArray[i + 1] - top);"," path += \" \" + val;"," }"," break;"," }"," }"," if(fill && fill.color)"," {"," path += 'z';"," }"," Y.Lang.trim(path);"," if(path)"," {"," node.setAttribute(\"d\", path);"," }"," "," this._path = path;"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," }"," },",""," /**"," * Ends a fill and stroke"," *"," * @method closePath"," */"," closePath: function()"," {"," this._pathArray.push([\"z\"]);"," },",""," /**"," * Returns the current array of drawing commands."," *"," * @method _getCurrentArray"," * @return Array"," * @private"," */"," _getCurrentArray: function()"," {"," var currentArray = this._pathArray[Math.max(0, this._pathArray.length - 1)];"," if(!currentArray)"," {"," currentArray = [];"," this._pathArray.push(currentArray);"," }"," return currentArray;"," },"," "," /**"," * Returns the points on a curve"," *"," * @method getBezierData"," * @param Array points Array containing the begin, end and control points of a curve."," * @param Number t The value for incrementing the next set of points."," * @return Array"," * @private"," */"," getBezierData: function(points, t) { "," var n = points.length,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }"," return [ tmp[0][0], tmp[0][1] ]; "," },"," "," /**"," * Calculates the bounding box for a curve"," *"," * @method _setCurveBoundingBox"," * @param Array pts Array containing points for start, end and control points of a curve."," * @param Number w Width used to calculate the number of points to describe the curve."," * @param Number h Height used to calculate the number of points to describe the curve."," * @private"," */"," _setCurveBoundingBox: function(pts, w, h)"," {"," var i,"," left = this._currentX,"," right = left,"," top = this._currentY,"," bottom = top,"," len = Math.round(Math.sqrt((w * w) + (h * h))),"," t = 1/len,"," xy;"," for(i = 0; i < len; ++i)"," {"," xy = this.getBezierData(pts, t * i);"," left = isNaN(left) ? xy[0] : Math.min(xy[0], left);"," right = isNaN(right) ? xy[0] : Math.max(xy[0], right);"," top = isNaN(top) ? xy[1] : Math.min(xy[1], top);"," bottom = isNaN(bottom) ? xy[1] : Math.max(xy[1], bottom);"," }"," left = Math.round(left * 10)/10;"," right = Math.round(right * 10)/10;"," top = Math.round(top * 10)/10;"," bottom = Math.round(bottom * 10)/10;"," this._trackSize(right, bottom);"," this._trackSize(left, top);"," },"," "," /**"," * Updates the size of the graphics object"," *"," * @method _trackSize"," * @param {Number} w width"," * @param {Number} h height"," * @private"," */"," _trackSize: function(w, h) {"," if (w > this._right) {"," this._right = w;"," }"," if(w < this._left)"," {"," this._left = w; "," }"," if (h < this._top)"," {"," this._top = h;"," }"," if (h > this._bottom) "," {"," this._bottom = h;"," }"," this._width = this._right - this._left;"," this._height = this._bottom - this._top;"," }","};","Y.SVGDrawing = SVGDrawing;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Shape.html\">`Shape`</a> class. "," * `SVGShape` is not intended to be used directly. Instead, use the <a href=\"Shape.html\">`Shape`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Shape.html\">`Shape`</a> "," * class will point to the `SVGShape` class."," *"," * @module graphics"," * @class SVGShape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */","SVGShape = function(cfg)","{"," this._transforms = [];"," this.matrix = new Y.Matrix();"," this._normalizedMatrix = new Y.Matrix();"," SVGShape.superclass.constructor.apply(this, arguments);","};","","SVGShape.NAME = \"shape\";","","Y.extend(SVGShape, Y.GraphicBase, Y.mix({"," /**"," * Storage for x attribute."," *"," * @property _x"," * @protected"," */"," _x: 0,",""," /**"," * Storage for y attribute."," *"," * @property _y"," * @protected"," */"," _y: 0,"," "," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," init: function()"," {"," this.initializer.apply(this, arguments);"," },",""," /**"," * Initializes the shape"," *"," * @private"," * @method initializer"," */"," initializer: function(cfg)"," {"," var host = this,"," graphic = cfg.graphic,"," data = this.get(\"data\");"," host.createNode(); "," if(graphic)"," {"," host._setGraphic(graphic);"," }"," if(data)"," {"," host._parsePathData(data);"," }"," host._updateHandler();"," },"," "," /**"," * Set the Graphic instance for the shape."," *"," * @method _setGraphic"," * @param {Graphic | Node | HTMLElement | String} render This param is used to determine the graphic instance. If it is a `Graphic` instance, it will be assigned"," * to the `graphic` attribute. Otherwise, a new Graphic instance will be created and rendered into the dom element that the render represents."," * @private"," */"," _setGraphic: function(render)"," {"," var graphic;"," if(render instanceof Y.SVGGraphic)"," {"," this._graphic = render;"," }"," else"," {"," render = Y.one(render);"," graphic = new Y.SVGGraphic({"," render: render"," });"," graphic._appendShape(this);"," this._graphic = graphic;"," }"," },",""," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," addClass: function(className)"," {"," var node = this.node;"," node.className.baseVal = Y_LANG.trim([node.className.baseVal, className].join(' '));"," },",""," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," removeClass: function(className)"," {"," var node = this.node,"," classString = node.className.baseVal;"," classString = classString.replace(new RegExp(className + ' '), className).replace(new RegExp(className), '');"," node.className.baseVal = classString;"," },",""," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY(),"," x = this._x,"," y = this._y;"," return [parentXY[0] + x, parentXY[1] + y];"," },",""," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," */"," setXY: function(xy)"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY();"," this._x = xy[0] - parentXY[0];"," this._y = xy[1] - parentXY[1];"," this.set(\"transform\", this.get(\"transform\"));"," },",""," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {SVGShape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," contains: function(needle)"," {"," return needle === Y.one(this.node);"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this.node;",""," return node === refNode;"," },",""," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," test: function(selector)"," {"," return Y.Selector.test(this.node, selector);"," },"," "," /**"," * Value function for fill attribute"," *"," * @private"," * @method _getDefaultFill"," * @return Object"," */"," _getDefaultFill: function() {"," return {"," type: \"solid\","," opacity: 1,"," cx: 0.5,"," cy: 0.5,"," fx: 0.5,"," fy: 0.5,"," r: 0.5"," };"," },"," "," /**"," * Value function for stroke attribute"," *"," * @private"," * @method _getDefaultStroke"," * @return Object"," */"," _getDefaultStroke: function() "," {"," return {"," weight: 1,"," dashstyle: \"none\","," color: \"#000\","," opacity: 1.0"," };"," },",""," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var host = this,"," node = DOCUMENT.createElementNS(\"http://www.w3.org/2000/svg\", \"svg:\" + this._type),"," id = host.get(\"id\"),"," name = host.name,"," concat = host._camelCaseConcat,"," pointerEvents = host.get(\"pointerEvents\");"," host.node = node;"," host.addClass(_getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name))); "," if(id)"," {"," node.setAttribute(\"id\", id);"," }"," if(pointerEvents)"," {"," node.setAttribute(\"pointer-events\", pointerEvents);"," }"," if(!host.get(\"visible\"))"," {"," Y.one(node).setStyle(\"visibility\", \"hidden\");"," }"," },"," ",""," /**"," * Overrides default `on` method. Checks to see if its a dom interaction event. If so, "," * return an event attached to the `node` element. If not, return the normal functionality."," *"," * @method on"," * @param {String} type event type"," * @param {Object} callback function"," * @private"," */"," on: function(type, fn)"," {"," if(Y.Node.DOM_EVENTS[type])"," {"," return Y.one(\"#\" + this.get(\"id\")).on(type, fn);"," }"," return Y.on.apply(this, arguments);"," },",""," /**"," * Adds a stroke to the shape node."," *"," * @method _strokeChangeHandler"," * @private"," */"," _strokeChangeHandler: function(e)"," {"," var node = this.node,"," stroke = this.get(\"stroke\"),"," strokeOpacity,"," dashstyle,"," dash,"," linejoin;"," if(stroke && stroke.weight && stroke.weight > 0)"," {"," linejoin = stroke.linejoin || \"round\";"," strokeOpacity = parseFloat(stroke.opacity);"," dashstyle = stroke.dashstyle || \"none\";"," dash = Y_LANG.isArray(dashstyle) ? dashstyle.toString() : dashstyle;"," stroke.color = stroke.color || \"#000000\";"," stroke.weight = stroke.weight || 1;"," stroke.opacity = Y_LANG.isNumber(strokeOpacity) ? strokeOpacity : 1;"," stroke.linecap = stroke.linecap || \"butt\";"," node.setAttribute(\"stroke-dasharray\", dash);"," node.setAttribute(\"stroke\", stroke.color);"," node.setAttribute(\"stroke-linecap\", stroke.linecap);"," node.setAttribute(\"stroke-width\", stroke.weight);"," node.setAttribute(\"stroke-opacity\", stroke.opacity);"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," node.setAttribute(\"stroke-linejoin\", linejoin);"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(Y_LANG.isNumber(linejoin))"," {"," node.setAttribute(\"stroke-miterlimit\", Math.max(linejoin, 1));"," node.setAttribute(\"stroke-linejoin\", \"miter\");"," }"," }"," }"," else"," {"," node.setAttribute(\"stroke\", \"none\");"," }"," },"," "," /**"," * Adds a fill to the shape node."," *"," * @method _fillChangeHandler"," * @private"," */"," _fillChangeHandler: function(e)"," {"," var node = this.node,"," fill = this.get(\"fill\"),"," fillOpacity,"," type;"," if(fill)"," {"," type = fill.type;"," if(type == \"linear\" || type == \"radial\")"," {"," this._setGradientFill(fill);"," node.setAttribute(\"fill\", \"url(#grad\" + this.get(\"id\") + \")\");"," }"," else if(!fill.color)"," {"," node.setAttribute(\"fill\", \"none\");"," }"," else"," {"," fillOpacity = parseFloat(fill.opacity);"," fillOpacity = Y_LANG.isNumber(fillOpacity) ? fillOpacity : 1;"," node.setAttribute(\"fill\", fill.color);"," node.setAttribute(\"fill-opacity\", fillOpacity);"," }"," }"," else"," {"," node.setAttribute(\"fill\", \"none\");"," }"," },",""," /**"," * Creates a gradient fill"," *"," * @method _setGradientFill"," * @param {String} type gradient type"," * @private"," */"," _setGradientFill: function(fill) {"," var offset,"," opacity,"," color,"," stopNode,"," newStop,"," isNumber = Y_LANG.isNumber,"," graphic = this._graphic,"," type = fill.type, "," gradientNode = graphic.getGradientNode(\"grad\" + this.get(\"id\"), type),"," stops = fill.stops,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," rotation = fill.rotation || 0,"," radCon = Math.PI/180,"," tanRadians = parseFloat(parseFloat(Math.tan(rotation * radCon)).toFixed(8)),"," i,"," len,"," def,"," stop,"," x1 = \"0%\", "," x2 = \"100%\", "," y1 = \"0%\", "," y2 = \"0%\","," cx = fill.cx,"," cy = fill.cy,"," fx = fill.fx,"," fy = fill.fy,"," r = fill.r,"," stopNodes = [];"," if(type == \"linear\")"," {"," cx = w/2;"," cy = h/2;"," if(Math.abs(tanRadians) * w/2 >= h/2)"," {"," if(rotation < 180)"," {"," y1 = 0;"," y2 = h;"," }"," else"," {"," y1 = h;"," y2 = 0;"," }"," x1 = cx - ((cy - y1)/tanRadians);"," x2 = cx - ((cy - y2)/tanRadians); "," }"," else"," {"," if(rotation > 90 && rotation < 270)"," {"," x1 = w;"," x2 = 0;"," }"," else"," {"," x1 = 0;"," x2 = w;"," }"," y1 = ((tanRadians * (cx - x1)) - cy) * -1;"," y2 = ((tanRadians * (cx - x2)) - cy) * -1;"," }",""," x1 = Math.round(100 * x1/w);"," x2 = Math.round(100 * x2/w);"," y1 = Math.round(100 * y1/h);"," y2 = Math.round(100 * y2/h);"," "," //Set default value if not valid "," x1 = isNumber(x1) ? x1 : 0;"," x2 = isNumber(x2) ? x2 : 100;"," y1 = isNumber(y1) ? y1 : 0;"," y2 = isNumber(y2) ? y2 : 0;"," "," gradientNode.setAttribute(\"spreadMethod\", \"pad\");"," gradientNode.setAttribute(\"width\", w);"," gradientNode.setAttribute(\"height\", h);"," gradientNode.setAttribute(\"x1\", x1 + \"%\");"," gradientNode.setAttribute(\"x2\", x2 + \"%\");"," gradientNode.setAttribute(\"y1\", y1 + \"%\");"," gradientNode.setAttribute(\"y2\", y2 + \"%\");"," }"," else"," {"," gradientNode.setAttribute(\"cx\", (cx * 100) + \"%\");"," gradientNode.setAttribute(\"cy\", (cy * 100) + \"%\");"," gradientNode.setAttribute(\"fx\", (fx * 100) + \"%\");"," gradientNode.setAttribute(\"fy\", (fy * 100) + \"%\");"," gradientNode.setAttribute(\"r\", (r * 100) + \"%\");"," }"," "," len = stops.length;"," def = 0;"," for(i = 0; i < len; ++i)"," {"," if(this._stops && this._stops.length > 0)"," {"," stopNode = this._stops.shift();"," newStop = false;"," }"," else"," {"," stopNode = graphic._createGraphicNode(\"stop\");"," newStop = true;"," }"," stop = stops[i];"," opacity = stop.opacity;"," color = stop.color;"," offset = stop.offset || i/(len - 1);"," offset = Math.round(offset * 100) + \"%\";"," opacity = isNumber(opacity) ? opacity : 1;"," opacity = Math.max(0, Math.min(1, opacity));"," def = (i + 1) / len;"," stopNode.setAttribute(\"offset\", offset);"," stopNode.setAttribute(\"stop-color\", color);"," stopNode.setAttribute(\"stop-opacity\", opacity);"," if(newStop)"," {"," gradientNode.appendChild(stopNode);"," }"," stopNodes.push(stopNode);"," }"," while(this._stops && this._stops.length > 0)"," {"," gradientNode.removeChild(this._stops.shift());"," }"," this._stops = stopNodes;"," },",""," _stops: null,",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function() "," {"," var host = this;"," AttributeLite.prototype.set.apply(host, arguments);"," if(host.initialized)"," {"," host._updateHandler();"," }"," },",""," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y)"," {"," this._addTransform(\"translate\", arguments);"," },",""," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," translateX: function(x)"," {"," this._addTransform(\"translateX\", arguments);"," },",""," /**"," * Translates the shape along the y-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," translateY: function(y)"," {"," this._addTransform(\"translateY\", arguments);"," },",""," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y)"," {"," this._addTransform(\"skew\", arguments);"," },",""," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x)"," {"," this._addTransform(\"skewX\", arguments);"," },",""," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y)"," {"," this._addTransform(\"skewY\", arguments);"," },",""," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg)"," {"," this._addTransform(\"rotate\", arguments);"," },",""," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y)"," {"," this._addTransform(\"scale\", arguments);"," },",""," /**"," * Adds a transform to the shape."," *"," * @method _addTransform"," * @param {String} type The transform being applied."," * @param {Array} args The arguments for the transform."," * @private"," */"," _addTransform: function(type, args)"," {"," args = Y.Array(args);"," this._transform = Y_LANG.trim(this._transform + \" \" + type + \"(\" + args.join(\", \") + \")\");"," args.unshift(type);"," this._transforms.push(args);"," if(this.initialized)"," {"," this._updateTransform();"," }"," },",""," /**"," * Applies all transforms."," *"," * @method _updateTransform"," * @private"," */"," _updateTransform: function()"," {"," var isPath = this._type == \"path\","," node = this.node,"," key,"," transform,"," transformOrigin,"," x,"," y,"," tx,"," ty,"," matrix = this.matrix,"," normalizedMatrix = this._normalizedMatrix,"," i,"," len = this._transforms.length;",""," if(isPath || (this._transforms && this._transforms.length > 0))"," {"," x = this._x;"," y = this._y;"," transformOrigin = this.get(\"transformOrigin\");"," tx = x + (transformOrigin[0] * this.get(\"width\"));"," ty = y + (transformOrigin[1] * this.get(\"height\")); "," //need to use translate for x/y coords"," if(isPath)"," {"," //adjust origin for custom shapes "," if(!(this instanceof Y.SVGPath))"," {"," tx = this._left + (transformOrigin[0] * this.get(\"width\"));"," ty = this._top + (transformOrigin[1] * this.get(\"height\"));"," }"," normalizedMatrix.init({dx: x + this._left, dy: y + this._top});"," }"," normalizedMatrix.translate(tx, ty);"," for(i = 0; i < len; ++i)"," {"," key = this._transforms[i].shift();"," if(key)"," {"," normalizedMatrix[key].apply(normalizedMatrix, this._transforms[i]);"," matrix[key].apply(matrix, this._transforms[i]); "," }"," if(isPath)"," {"," this._transforms[i].unshift(key);"," }"," }"," normalizedMatrix.translate(-tx, -ty);"," transform = \"matrix(\" + normalizedMatrix.a + \",\" + "," normalizedMatrix.b + \",\" + "," normalizedMatrix.c + \",\" + "," normalizedMatrix.d + \",\" + "," normalizedMatrix.dx + \",\" +"," normalizedMatrix.dy + \")\";"," }"," this._graphic.addToRedrawQueue(this); "," if(transform)"," {"," node.setAttribute(\"transform\", transform);"," }"," if(!isPath)"," {"," this._transforms = [];"," }"," },",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node;"," node.setAttribute(\"width\", this.get(\"width\"));"," node.setAttribute(\"height\", this.get(\"height\"));"," node.setAttribute(\"x\", this._x);"," node.setAttribute(\"y\", this._y);"," node.style.left = this._x + \"px\";"," node.style.top = this._y + \"px\";"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," },",""," /**"," * Updates `Shape` based on attribute changes."," *"," * @method _updateHandler"," * @private"," */"," _updateHandler: function(e)"," {"," this._draw();"," },"," "," /**"," * Storage for the transform attribute."," *"," * @property _transform"," * @type String"," * @private"," */"," _transform: \"\",",""," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," getBounds: function()"," {"," var type = this._type,"," stroke = this.get(\"stroke\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = type == \"path\" ? 0 : this._x,"," y = type == \"path\" ? 0 : this._y,"," wt = 0;"," if(type != \"path\")"," {"," if(stroke && stroke.weight)"," {"," wt = stroke.weight;"," }"," w = (x + w + wt) - (x - wt); "," h = (y + h + wt) - (y - wt);"," x -= wt;"," y -= wt;"," }"," return this._normalizedMatrix.getContentRect(w, h, x, y);"," },",""," /**"," * Places the shape above all other shapes."," *"," * @method toFront"," */"," toFront: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toFront(this);"," }"," },",""," /**"," * Places the shape underneath all other shapes."," *"," * @method toFront"," */"," toBack: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toBack(this);"," }"," },",""," /**"," * Parses path data string and call mapped methods."," *"," * @method _parsePathData"," * @param {String} val The path data"," * @private"," */"," _parsePathData: function(val)"," {"," var method,"," methodSymbol,"," args,"," commandArray = Y.Lang.trim(val.match(SPLITPATHPATTERN)),"," i,"," len, "," str,"," symbolToMethod = this._pathSymbolToMethod;"," if(commandArray)"," {"," this.clear();"," len = commandArray.length || 0;"," for(i = 0; i < len; i = i + 1)"," {"," str = commandArray[i];"," methodSymbol = str.substr(0, 1);"," args = str.substr(1).match(SPLITARGSPATTERN);"," method = symbolToMethod[methodSymbol];"," if(method)"," {"," if(args)"," {"," this[method].apply(this, args);"," }"," else"," {"," this[method].apply(this);"," }"," }"," }"," this.end();"," }"," },",""," /**"," * Destroys the shape instance."," *"," * @method destroy"," */"," destroy: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic.removeShape(this);"," }"," else"," {"," this._destroy();"," }"," },",""," /**"," * Implementation for shape destruction"," *"," * @method destroy"," * @protected"," */"," _destroy: function()"," {"," if(this.node)"," {"," Y.Event.purgeElement(this.node, true);"," if(this.node.parentNode)"," {"," this.node.parentNode.removeChild(this.node);"," }"," this.node = null;"," }"," }"," }, Y.SVGDrawing.prototype));"," ","SVGShape.ATTRS = {"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," transformOrigin: {"," valueFn: function()"," {"," return [0.5, 0.5];"," }"," },"," "," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd> "," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," transform: {"," setter: function(val)"," {"," this.matrix.init(); "," this._normalizedMatrix.init();"," this._transforms = this.matrix.getTransformArray(val);"," this._transform = val;"," return val;"," },",""," getter: function()"," {"," return this._transform;"," }"," },",""," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," var transform = this.get(\"transform\");"," this._x = val;"," if(transform) "," {"," this.set(\"transform\", transform);"," }"," }"," },",""," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," var transform = this.get(\"transform\");"," this._y = val;"," if(transform) "," {"," this.set(\"transform\", transform);"," }"," }"," },",""," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," value: 0"," },",""," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," height: {"," value: 0"," },",""," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val){"," var visibility = val ? \"visible\" : \"hidden\";"," if(this.node)"," {"," this.node.style.visibility = visibility;"," }"," return val;"," }"," },",""," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * </dl>"," *"," * @config fill"," * @type Object "," */"," fill: {"," valueFn: \"_getDefaultFill\","," "," setter: function(val)"," {"," var fill,"," tmpl = this.get(\"fill\") || this._getDefaultFill();"," fill = (val) ? Y.merge(tmpl, val) : null;"," if(fill && fill.color)"," {"," if(fill.color === undefined || fill.color == \"none\")"," {"," fill.color = null;"," }"," }"," return fill;"," }"," },",""," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," stroke: {"," valueFn: \"_getDefaultStroke\",",""," setter: function(val)"," {"," var tmpl = this.get(\"stroke\") || this._getDefaultStroke(),"," wt;"," if(val && val.hasOwnProperty(\"weight\"))"," {"," wt = parseInt(val.weight, 10);"," if(!isNaN(wt))"," {"," val.weight = wt;"," }"," }"," return (val) ? Y.merge(tmpl, val) : null;"," }"," },"," "," // Only implemented in SVG"," // Determines whether the instance will receive mouse events."," // "," // @config pointerEvents"," // @type string"," //"," pointerEvents: {"," valueFn: function() "," {"," var val = \"visiblePainted\","," node = this.node;"," if(node)"," {"," node.setAttribute(\"pointer-events\", val);"," }"," return val;"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"pointer-events\", val);"," }"," return val;"," }"," },",""," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this.node;"," }"," },",""," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," data: {"," setter: function(val)"," {"," if(this.get(\"node\"))"," {"," this._parsePathData(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the parent graphic instance"," *"," * @config graphic"," * @type SVGGraphic"," * @readOnly"," */"," graphic: {"," readOnly: true,",""," getter: function()"," {"," return this._graphic;"," }"," }","};","Y.SVGShape = SVGShape;","","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Path.html\">`Path`</a> class. "," * `SVGPath` is not intended to be used directly. Instead, use the <a href=\"Path.html\">`Path`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Path.html\">`Path`</a> "," * class will point to the `SVGPath` class."," *"," * @module graphics"," * @class SVGPath"," * @extends SVGShape"," * @constructor"," */","SVGPath = function(cfg)","{"," SVGPath.superclass.constructor.apply(this, arguments);","};","SVGPath.NAME = \"path\";","Y.extend(SVGPath, Y.SVGShape, {"," /**"," * Left edge of the path"," *"," * @property _left"," * @type Number"," * @private"," */"," _left: 0,",""," /**"," * Right edge of the path"," *"," * @property _right"," * @type Number"," * @private"," */"," _right: 0,"," "," /**"," * Top edge of the path"," *"," * @property _top"," * @type Number"," * @private"," */"," _top: 0, "," "," /**"," * Bottom edge of the path"," *"," * @property _bottom"," * @type Number"," * @private"," */"," _bottom: 0,",""," /**"," * Indicates the type of shape"," *"," * @property _type"," * @readOnly"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Storage for path"," *"," * @property _path"," * @type String"," * @private"," */"," _path: \"\"","});","","SVGPath.ATTRS = Y.merge(Y.SVGShape.ATTRS, {"," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," return this._path;"," }"," },",""," /**"," * Indicates the width of the shape"," * "," * @config width"," * @type Number"," */"," width: {"," getter: function()"," {"," var val = Math.max(this._right - this._left, 0);"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," height: {"," getter: function()"," {"," return Math.max(this._bottom - this._top, 0);"," }"," }","});","Y.SVGPath = SVGPath;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Rect.html\">`Rect`</a> class. "," * `SVGRect` is not intended to be used directly. Instead, use the <a href=\"Rect.html\">`Rect`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Rect.html\">`Rect`</a> "," * class will point to the `SVGRect` class."," *"," * @module graphics"," * @class SVGRect"," * @constructor"," */","SVGRect = function()","{"," SVGRect.superclass.constructor.apply(this, arguments);","};","SVGRect.NAME = \"rect\";","Y.extend(SVGRect, Y.SVGShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"rect\""," });","SVGRect.ATTRS = Y.SVGShape.ATTRS;","Y.SVGRect = SVGRect;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * `SVGEllipse` is not intended to be used directly. Instead, use the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Ellipse.html\">`Ellipse`</a> "," * class will point to the `SVGEllipse` class."," *"," * @module graphics"," * @class SVGEllipse"," * @constructor"," */","SVGEllipse = function(cfg)","{"," SVGEllipse.superclass.constructor.apply(this, arguments);","};","","SVGEllipse.NAME = \"ellipse\";","","Y.extend(SVGEllipse, SVGShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"ellipse\",",""," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," xRadius = w * 0.5,"," yRadius = h * 0.5,"," cx = x + xRadius,"," cy = y + yRadius;"," node.setAttribute(\"rx\", xRadius);"," node.setAttribute(\"ry\", yRadius);"," node.setAttribute(\"cx\", cx);"," node.setAttribute(\"cy\", cy);"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," }","});","","SVGEllipse.ATTRS = Y.merge(SVGShape.ATTRS, {"," /**"," * Horizontal radius for the ellipse. "," *"," * @config xRadius"," * @type Number"," */"," xRadius: {"," setter: function(val)"," {"," this.set(\"width\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"width\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," },",""," /**"," * Vertical radius for the ellipse. "," *"," * @config yRadius"," * @type Number"," * @readOnly"," */"," yRadius: {"," setter: function(val)"," {"," this.set(\"height\", val * 2);"," },",""," getter: function()"," {"," var val = this.get(\"height\");"," if(val) "," {"," val *= 0.5;"," }"," return val;"," }"," }","});","Y.SVGEllipse = SVGEllipse;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Circle.html\">`Circle`</a> class. "," * `SVGCircle` is not intended to be used directly. Instead, use the <a href=\"Circle.html\">`Circle`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Circle.html\">`Circle`</a> "," * class will point to the `SVGCircle` class."," *"," * @module graphics"," * @class SVGCircle"," * @constructor"," */"," SVGCircle = function(cfg)"," {"," SVGCircle.superclass.constructor.apply(this, arguments);"," };"," "," SVGCircle.NAME = \"circle\";",""," Y.extend(SVGCircle, Y.SVGShape, { "," "," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"circle\",",""," /**"," * Updates the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," var node = this.node,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," radius = this.get(\"radius\"),"," cx = x + radius,"," cy = y + radius;"," node.setAttribute(\"r\", radius);"," node.setAttribute(\"cx\", cx);"," node.setAttribute(\"cy\", cy);"," this._fillChangeHandler();"," this._strokeChangeHandler();"," this._updateTransform();"," }"," });"," ","SVGCircle.ATTRS = Y.merge(Y.SVGShape.ATTRS, {"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," {"," return this.get(\"radius\") * 2;"," }"," },",""," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","});","Y.SVGCircle = SVGCircle;","/**"," * Draws pie slices"," *"," * @module graphics"," * @class SVGPieSlice"," * @constructor"," */","SVGPieSlice = function()","{"," SVGPieSlice.superclass.constructor.apply(this, arguments);","};","SVGPieSlice.NAME = \"svgPieSlice\";","Y.extend(SVGPieSlice, Y.SVGShape, Y.mix({"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"path\",",""," /**"," * Change event listener"," *"," * @private"," * @method _updateHandler"," */"," _draw: function(e)"," {"," var x = this.get(\"cx\"),"," y = this.get(\"cy\"),"," startAngle = this.get(\"startAngle\"),"," arc = this.get(\"arc\"),"," radius = this.get(\"radius\");"," this.clear();"," this.drawWedge(x, y, startAngle, arc, radius);"," this.end();"," }"," }, Y.SVGDrawing.prototype));","SVGPieSlice.ATTRS = Y.mix({"," cx: {"," value: 0"," },",""," cy: {"," value: 0"," },"," /**"," * Starting angle in relation to a circle in which to begin the pie slice drawing."," *"," * @config startAngle"," * @type Number"," */"," startAngle: {"," value: 0"," },",""," /**"," * Arc of the slice."," *"," * @config arc"," * @type Number"," */"," arc: {"," value: 0"," },",""," /**"," * Radius of the circle in which the pie slice is drawn"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","}, Y.SVGShape.ATTRS);","Y.SVGPieSlice = SVGPieSlice;","/**"," * <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> implementation of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * `SVGGraphic` is not intended to be used directly. Instead, use the <a href=\"Graphic.html\">`Graphic`</a> class. "," * If the browser has <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> capabilities, the <a href=\"Graphic.html\">`Graphic`</a> "," * class will point to the `SVGGraphic` class."," *"," * @module graphics"," * @class SVGGraphic"," * @constructor"," */","SVGGraphic = function(cfg) {"," SVGGraphic.superclass.constructor.apply(this, arguments);","};","","SVGGraphic.NAME = \"svgGraphic\";","","SVGGraphic.ATTRS = {"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," render: {},"," "," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this._node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," shapes: {"," readOnly: true,",""," getter: function()"," {"," return this._shapes;"," }"," },",""," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object "," * @readOnly"," */"," contentBounds: {"," readOnly: true,",""," getter: function()"," {"," return this._contentBounds;"," }"," },",""," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this._node;"," }"," },"," "," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.width = val + \"px\";"," }"," return val; "," }"," },",""," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," height: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.height = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," autoSize: {"," value: false"," },"," "," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," preserveAspectRatio: {"," value: \"xMidYMid\""," },"," "," /**"," * The contentBounds will resize to greater values but not to smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," resizeDown: {"," value: false"," },",""," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," this._x = val;"," if(this._node)"," {"," this._node.style.left = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," this._y = val;"," if(this._node)"," {"," this._node.style.top = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," autoDraw: {"," value: true"," },"," "," visible: {"," value: true,",""," setter: function(val)"," {"," this._toggleVisible(val);"," return val;"," }"," },",""," //"," // Indicates the pointer-events setting for the svg:svg element."," //"," // @config pointerEvents"," // @type String"," //"," pointerEvents: {"," value: \"none\""," }","};","","Y.extend(SVGGraphic, Y.GraphicBase, {"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, value) "," {"," var host = this,"," redrawAttrs = {"," autoDraw: true,"," autoSize: true,"," preserveAspectRatio: true,"," resizeDown: true"," },"," key,"," forceRedraw = false;"," AttributeLite.prototype.set.apply(host, arguments); "," if(host._state.autoDraw === true && Y.Object.size(this._shapes) > 0)"," {"," if(Y_LANG.isString && redrawAttrs[attr])"," {"," forceRedraw = true;"," }"," else if(Y_LANG.isObject(attr))"," {"," for(key in redrawAttrs)"," {"," if(redrawAttrs.hasOwnProperty(key) && attr[key])"," {"," forceRedraw = true;"," break;"," }"," }"," }"," }"," if(forceRedraw)"," {"," host._redraw();"," }"," },",""," /**"," * Storage for `x` attribute."," *"," * @property _x"," * @type Number"," * @private"," */"," _x: 0,",""," /**"," * Storage for `y` attribute."," *"," * @property _y"," * @type Number"," * @private"," */"," _y: 0,",""," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var node = Y.one(this._node),"," xy;"," if(node)"," {"," xy = node.getXY();"," }"," return xy;"," },",""," /**"," * Initializes the class."," *"," * @method initializer"," * @private"," */"," initializer: function() {"," var render = this.get(\"render\"),"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\";"," this._shapes = {};"," this._contentBounds = {"," left: 0,"," top: 0,"," right: 0,"," bottom: 0"," };"," this._gradients = {};"," this._node = DOCUMENT.createElement('div');"," this._node.style.position = \"absolute\";"," this._node.style.left = this.get(\"x\") + \"px\";"," this._node.style.top = this.get(\"y\") + \"px\";"," this._node.style.visibility = visibility;"," this._contentNode = this._createGraphics();"," this._contentNode.style.visibility = visibility;"," this._contentNode.setAttribute(\"id\", this.get(\"id\"));"," this._node.appendChild(this._contentNode);"," if(render)"," {"," this.render(render);"," }"," },",""," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {HTMLElement} parentNode node in which to render the graphics node into."," */"," render: function(render) {"," var parentNode = Y.one(render),"," w = this.get(\"width\") || parseInt(parentNode.getComputedStyle(\"width\"), 10),"," h = this.get(\"height\") || parseInt(parentNode.getComputedStyle(\"height\"), 10);"," parentNode = parentNode || Y.one(DOCUMENT.body);"," parentNode.append(this._node);"," this.parentNode = parentNode;"," this.set(\"width\", w);"," this.set(\"height\", h);"," return this;"," },",""," /**"," * Removes all nodes."," *"," * @method destroy"," */"," destroy: function()"," {"," this.removeAllShapes();"," if(this._contentNode)"," {"," this._removeChildren(this._contentNode);"," if(this._contentNode.parentNode)"," {"," this._contentNode.parentNode.removeChild(this._contentNode);"," }"," this._contentNode = null;"," }"," if(this._node)"," {"," this._removeChildren(this._node);"," Y.one(this._node).remove(true);"," this._node = null;"," }"," },",""," /**"," * Generates a shape instance by type."," *"," * @method addShape"," * @param {Object} cfg attributes for the shape"," * @return Shape"," */"," addShape: function(cfg)"," {"," cfg.graphic = this;"," if(!this.get(\"visible\"))"," {"," cfg.visible = false;"," }"," var shapeClass = this._getShapeClass(cfg.type),"," shape = new shapeClass(cfg);"," this._appendShape(shape);"," return shape;"," },",""," /**"," * Adds a shape instance to the graphic instance."," *"," * @method _appendShape"," * @param {Shape} shape The shape instance to be added to the graphic."," * @private"," */"," _appendShape: function(shape)"," {"," var node = shape.node,"," parentNode = this._frag || this._contentNode;"," if(this.get(\"autoDraw\")) "," {"," parentNode.appendChild(node);"," }"," else"," {"," this._getDocFrag().appendChild(node);"," }"," },",""," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," removeShape: function(shape)"," {"," if(!(shape instanceof SVGShape))"," {"," if(Y_LANG.isString(shape))"," {"," shape = this._shapes[shape];"," }"," }"," if(shape && shape instanceof SVGShape)"," {"," shape._destroy();"," delete this._shapes[shape.get(\"id\")];"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," return shape;"," },",""," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," removeAllShapes: function()"," {"," var shapes = this._shapes,"," i;"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i]._destroy();"," }"," }"," this._shapes = {};"," },"," "," /**"," * Removes all child nodes."," *"," * @method _removeChildren"," * @param {HTMLElement} node"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },",""," /**"," * Clears the graphics object."," *"," * @method clear"," */"," clear: function() {"," this.removeAllShapes();"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} val indicates visibilitye"," * @private"," */"," _toggleVisible: function(val)"," {"," var i,"," shapes = this._shapes,"," visibility = val ? \"visible\" : \"hidden\";"," if(shapes)"," {"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].set(\"visible\", val);"," }"," }"," }"," if(this._contentNode)"," {"," this._contentNode.style.visibility = visibility;"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," },",""," /**"," * Returns a shape class. Used by `addShape`. "," *"," * @method _getShapeClass"," * @param {Shape | String} val Indicates which shape class. "," * @return Function "," * @private"," */"," _getShapeClass: function(val)"," {"," var shape = this._shapeClass[val];"," if(shape)"," {"," return shape;"," }"," return val;"," },",""," /**"," * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation."," *"," * @property _shapeClass"," * @type Object"," * @private"," */"," _shapeClass: {"," circle: Y.SVGCircle,"," rect: Y.SVGRect,"," path: Y.SVGPath,"," ellipse: Y.SVGEllipse,"," pieslice: Y.SVGPieSlice"," },"," "," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," getShapeById: function(id)"," {"," var shape = this._shapes[id];"," return shape;"," },",""," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */"," batch: function(method)"," {"," var autoDraw = this.get(\"autoDraw\");"," this.set(\"autoDraw\", false);"," method();"," this.set(\"autoDraw\", autoDraw);"," },"," "," /**"," * Returns a document fragment to for attaching shapes."," *"," * @method _getDocFrag"," * @return DocumentFragment"," * @private"," */"," _getDocFrag: function()"," {"," if(!this._frag)"," {"," this._frag = DOCUMENT.createDocumentFragment();"," }"," return this._frag;"," },",""," /**"," * Redraws all shapes."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var autoSize = this.get(\"autoSize\"),"," preserveAspectRatio = this.get(\"preserveAspectRatio\"),"," box = this.get(\"resizeDown\") ? this._getUpdatedContentBounds() : this._contentBounds,"," left = box.left,"," right = box.right,"," top = box.top,"," bottom = box.bottom,"," width = right - left,"," height = bottom - top,"," computedWidth,"," computedHeight,"," computedLeft,"," computedTop,"," node;"," if(autoSize)"," {"," if(autoSize == \"sizeContentToGraphic\")"," {"," node = Y.one(this._node);"," computedWidth = parseFloat(node.getComputedStyle(\"width\"));"," computedHeight = parseFloat(node.getComputedStyle(\"height\"));"," computedLeft = computedTop = 0;"," this._contentNode.setAttribute(\"preserveAspectRatio\", preserveAspectRatio);"," }"," else "," {"," computedWidth = width;"," computedHeight = height;"," computedLeft = left;"," computedTop = top;"," this._state.width = width;"," this._state.height = height;"," if(this._node)"," {"," this._node.style.width = width + \"px\";"," this._node.style.height = height + \"px\";"," }"," }"," }"," else"," {"," computedWidth = width;"," computedHeight = height;"," computedLeft = left;"," computedTop = top;"," }"," if(this._contentNode)"," {"," this._contentNode.style.left = computedLeft + \"px\";"," this._contentNode.style.top = computedTop + \"px\";"," this._contentNode.setAttribute(\"width\", computedWidth);"," this._contentNode.setAttribute(\"height\", computedHeight);"," this._contentNode.style.width = computedWidth + \"px\";"," this._contentNode.style.height = computedHeight + \"px\";"," this._contentNode.setAttribute(\"viewBox\", \"\" + left + \" \" + top + \" \" + width + \" \" + height + \"\");"," }"," if(this._frag)"," {"," if(this._contentNode)"," {"," this._contentNode.appendChild(this._frag);"," }"," this._frag = null;"," } "," },"," "," /**"," * Adds a shape to the redraw queue and calculates the contentBounds. Used internally "," * by `Shape` instances."," *"," * @method addToRedrawQueue"," * @param shape {SVGShape}"," * @protected"," */"," addToRedrawQueue: function(shape)"," {"," var shapeBox,"," box;"," this._shapes[shape.get(\"id\")] = shape;"," if(!this.get(\"resizeDown\"))"," {"," shapeBox = shape.getBounds();"," box = this._contentBounds;"," box.left = box.left < shapeBox.left ? box.left : shapeBox.left;"," box.top = box.top < shapeBox.top ? box.top : shapeBox.top;"," box.right = box.right > shapeBox.right ? box.right : shapeBox.right;"," box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;"," box.width = box.right - box.left;"," box.height = box.bottom - box.top;"," this._contentBounds = box;"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," },",""," /**"," * Recalculates and returns the `contentBounds` for the `Graphic` instance."," *"," * @method _getUpdatedContentBounds"," * @return {Object} "," * @private"," */"," _getUpdatedContentBounds: function()"," {"," var bounds,"," i,"," shape,"," queue = this._shapes,"," box = {};"," for(i in queue)"," {"," if(queue.hasOwnProperty(i))"," {"," shape = queue[i];"," bounds = shape.getBounds();"," box.left = Y_LANG.isNumber(box.left) ? Math.min(box.left, bounds.left) : bounds.left;"," box.top = Y_LANG.isNumber(box.top) ? Math.min(box.top, bounds.top) : bounds.top;"," box.right = Y_LANG.isNumber(box.right) ? Math.max(box.right, bounds.right) : bounds.right;"," box.bottom = Y_LANG.isNumber(box.bottom) ? Math.max(box.bottom, bounds.bottom) : bounds.bottom;"," }"," }"," box.left = Y_LANG.isNumber(box.left) ? box.left : 0;"," box.top = Y_LANG.isNumber(box.top) ? box.top : 0;"," box.right = Y_LANG.isNumber(box.right) ? box.right : 0;"," box.bottom = Y_LANG.isNumber(box.bottom) ? box.bottom : 0;"," this._contentBounds = box;"," return box;"," },",""," /**"," * Creates a contentNode element"," *"," * @method _createGraphics"," * @private"," */"," _createGraphics: function() {"," var contentNode = this._createGraphicNode(\"svg\"),"," pointerEvents = this.get(\"pointerEvents\");"," contentNode.style.position = \"absolute\";"," contentNode.style.top = \"0px\";"," contentNode.style.left = \"0px\";"," contentNode.style.overflow = \"auto\";"," contentNode.setAttribute(\"overflow\", \"auto\");"," contentNode.setAttribute(\"pointer-events\", pointerEvents);"," return contentNode;"," },",""," /**"," * Creates a graphic node"," *"," * @method _createGraphicNode"," * @param {String} type node type to create"," * @param {String} pe specified pointer-events value"," * @return HTMLElement"," * @private"," */"," _createGraphicNode: function(type, pe)"," {"," var node = DOCUMENT.createElementNS(\"http://www.w3.org/2000/svg\", \"svg:\" + type),"," v = pe || \"none\";"," if(type !== \"defs\" && type !== \"stop\" && type !== \"linearGradient\" && type != \"radialGradient\")"," {"," node.setAttribute(\"pointer-events\", v);"," }"," return node;"," },",""," /**"," * Returns a reference to a gradient definition based on an id and type."," *"," * @method getGradientNode"," * @param {String} key id that references the gradient definition"," * @param {String} type description of the gradient type"," * @return HTMLElement"," * @protected"," */"," getGradientNode: function(key, type)"," {"," var gradients = this._gradients,"," gradient,"," nodeType = type + \"Gradient\";"," if(gradients.hasOwnProperty(key) && gradients[key].tagName.indexOf(type) > -1)"," {"," gradient = this._gradients[key];"," }"," else"," {"," gradient = this._createGraphicNode(nodeType);"," if(!this._defs)"," {"," this._defs = this._createGraphicNode(\"defs\");"," this._contentNode.appendChild(this._defs);"," }"," this._defs.appendChild(gradient);"," key = key || \"gradient\" + Math.round(100000 * Math.random());"," gradient.setAttribute(\"id\", key);"," if(gradients.hasOwnProperty(key))"," {"," this._defs.removeChild(gradients[key]);"," }"," gradients[key] = gradient;"," }"," return gradient;"," },",""," /**"," * Inserts shape on the top of the tree."," *"," * @method _toFront"," * @param {SVGShape} Shape to add."," * @private"," */"," _toFront: function(shape)"," {"," var contentNode = this._contentNode;"," if(shape instanceof Y.SVGShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," contentNode.appendChild(shape);"," }"," },",""," /**"," * Inserts shape as the first child of the content node."," *"," * @method _toBack"," * @param {SVGShape} Shape to add."," * @private"," */"," _toBack: function(shape)"," {"," var contentNode = this._contentNode,"," targetNode;"," if(shape instanceof Y.SVGShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," targetNode = contentNode.firstChild;"," if(targetNode)"," {"," contentNode.insertBefore(shape, targetNode);"," }"," else"," {"," contentNode.appendChild(shape);"," }"," }"," }","});","","Y.SVGGraphic = SVGGraphic;","","","","}, '3.7.3', {\"requires\": [\"graphics\"]});"]; _yuitest_coverage["build/graphics-svg/graphics-svg.js"].lines = {"1":0,"3":0,"19":0,"31":0,"92":0,"107":0,"119":0,"139":0,"140":0,"142":0,"143":0,"144":0,"148":0,"149":0,"151":0,"152":0,"155":0,"156":0,"157":0,"158":0,"160":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"170":0,"171":0,"172":0,"173":0,"174":0,"175":0,"189":0,"202":0,"214":0,"232":0,"234":0,"235":0,"236":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"249":0,"250":0,"252":0,"253":0,"254":0,"255":0,"256":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"264":0,"265":0,"279":0,"280":0,"281":0,"282":0,"283":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"306":0,"319":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"343":0,"345":0,"346":0,"347":0,"348":0,"349":0,"350":0,"351":0,"352":0,"353":0,"354":0,"369":0,"371":0,"372":0,"373":0,"374":0,"375":0,"376":0,"393":0,"408":0,"409":0,"411":0,"412":0,"413":0,"417":0,"419":0,"420":0,"421":0,"424":0,"426":0,"431":0,"434":0,"438":0,"441":0,"442":0,"445":0,"446":0,"447":0,"448":0,"449":0,"450":0,"451":0,"452":0,"453":0,"454":0,"455":0,"457":0,"458":0,"459":0,"460":0,"461":0,"462":0,"463":0,"464":0,"465":0,"466":0,"469":0,"470":0,"471":0,"472":0,"484":0,"496":0,"508":0,"518":0,"519":0,"520":0,"521":0,"523":0,"524":0,"525":0,"529":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"539":0,"540":0,"541":0,"542":0,"547":0,"548":0,"549":0,"550":0,"551":0,"552":0,"553":0,"554":0,"555":0,"556":0,"570":0,"582":0,"594":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"609":0,"610":0,"611":0,"621":0,"631":0,"632":0,"633":0,"634":0,"635":0,"636":0,"637":0,"638":0,"639":0,"640":0,"651":0,"663":0,"665":0,"666":0,"668":0,"669":0,"670":0,"671":0,"673":0,"675":0,"677":0,"679":0,"681":0,"685":0,"687":0,"694":0,"696":0,"697":0,"698":0,"700":0,"702":0,"703":0,"704":0,"705":0,"706":0,"709":0,"711":0,"712":0,"713":0,"714":0,"716":0,"719":0,"721":0,"723":0,"724":0,"726":0,"729":0,"730":0,"731":0,"732":0,"743":0,"755":0,"756":0,"758":0,"759":0,"761":0,"774":0,"779":0,"780":0,"783":0,"784":0,"785":0,"786":0,"789":0,"803":0,"811":0,"813":0,"814":0,"815":0,"816":0,"817":0,"819":0,"820":0,"821":0,"822":0,"823":0,"824":0,"836":0,"837":0,"839":0,"841":0,"843":0,"845":0,"847":0,"849":0,"851":0,"852":0,"855":0,"867":0,"869":0,"870":0,"871":0,"872":0,"875":0,"877":0,"903":0,"914":0,"917":0,"918":0,"920":0,"922":0,"924":0,"926":0,"939":0,"940":0,"942":0,"946":0,"947":0,"950":0,"951":0,"963":0,"964":0,"975":0,"977":0,"978":0,"989":0,"993":0,"1004":0,"1006":0,"1007":0,"1008":0,"1020":0,"1031":0,"1033":0,"1045":0,"1056":0,"1076":0,"1093":0,"1099":0,"1100":0,"1101":0,"1103":0,"1105":0,"1107":0,"1109":0,"1111":0,"1127":0,"1129":0,"1131":0,"1142":0,"1148":0,"1150":0,"1151":0,"1152":0,"1153":0,"1154":0,"1155":0,"1156":0,"1157":0,"1158":0,"1159":0,"1160":0,"1161":0,"1162":0,"1163":0,"1165":0,"1169":0,"1170":0,"1172":0,"1173":0,"1179":0,"1191":0,"1195":0,"1197":0,"1198":0,"1200":0,"1201":0,"1203":0,"1205":0,"1209":0,"1210":0,"1211":0,"1212":0,"1217":0,"1229":0,"1258":0,"1260":0,"1261":0,"1262":0,"1264":0,"1266":0,"1267":0,"1271":0,"1272":0,"1274":0,"1275":0,"1279":0,"1281":0,"1282":0,"1286":0,"1287":0,"1289":0,"1290":0,"1293":0,"1294":0,"1295":0,"1296":0,"1299":0,"1300":0,"1301":0,"1302":0,"1304":0,"1305":0,"1306":0,"1307":0,"1308":0,"1309":0,"1310":0,"1314":0,"1315":0,"1316":0,"1317":0,"1318":0,"1321":0,"1322":0,"1323":0,"1325":0,"1327":0,"1328":0,"1332":0,"1333":0,"1335":0,"1336":0,"1337":0,"1338":0,"1339":0,"1340":0,"1341":0,"1342":0,"1343":0,"1344":0,"1345":0,"1346":0,"1348":0,"1350":0,"1352":0,"1354":0,"1356":0,"1372":0,"1373":0,"1374":0,"1376":0,"1389":0,"1401":0,"1413":0,"1425":0,"1436":0,"1447":0,"1458":0,"1469":0,"1482":0,"1483":0,"1484":0,"1485":0,"1486":0,"1488":0,"1500":0,"1514":0,"1516":0,"1517":0,"1518":0,"1519":0,"1520":0,"1522":0,"1525":0,"1527":0,"1528":0,"1530":0,"1532":0,"1533":0,"1535":0,"1536":0,"1538":0,"1539":0,"1541":0,"1543":0,"1546":0,"1547":0,"1554":0,"1555":0,"1557":0,"1559":0,"1561":0,"1573":0,"1574":0,"1575":0,"1576":0,"1577":0,"1578":0,"1579":0,"1580":0,"1581":0,"1582":0,"1593":0,"1616":0,"1623":0,"1625":0,"1627":0,"1629":0,"1630":0,"1631":0,"1632":0,"1634":0,"1644":0,"1645":0,"1647":0,"1658":0,"1659":0,"1661":0,"1674":0,"1682":0,"1684":0,"1685":0,"1686":0,"1688":0,"1689":0,"1690":0,"1691":0,"1692":0,"1694":0,"1696":0,"1700":0,"1704":0,"1715":0,"1716":0,"1718":0,"1722":0,"1734":0,"1736":0,"1737":0,"1739":0,"1741":0,"1746":0,"1757":0,"1793":0,"1794":0,"1795":0,"1796":0,"1797":0,"1802":0,"1815":0,"1820":0,"1821":0,"1823":0,"1825":0,"1838":0,"1843":0,"1844":0,"1845":0,"1847":0,"1861":0,"1866":0,"1867":0,"1868":0,"1870":0,"1905":0,"1906":0,"1908":0,"1910":0,"1960":0,"1962":0,"1963":0,"1965":0,"1967":0,"1970":0,"2007":0,"2009":0,"2011":0,"2012":0,"2014":0,"2017":0,"2030":0,"2032":0,"2034":0,"2036":0,"2041":0,"2042":0,"2044":0,"2046":0,"2062":0,"2077":0,"2079":0,"2081":0,"2097":0,"2101":0,"2114":0,"2116":0,"2118":0,"2119":0,"2176":0,"2189":0,"2202":0,"2203":0,"2216":0,"2220":0,"2231":0,"2233":0,"2235":0,"2236":0,"2246":0,"2247":0,"2258":0,"2260":0,"2263":0,"2265":0,"2283":0,"2292":0,"2293":0,"2294":0,"2295":0,"2296":0,"2297":0,"2298":0,"2302":0,"2312":0,"2317":0,"2318":0,"2320":0,"2322":0,"2336":0,"2341":0,"2342":0,"2344":0,"2346":0,"2350":0,"2361":0,"2363":0,"2366":0,"2368":0,"2387":0,"2393":0,"2394":0,"2395":0,"2396":0,"2397":0,"2398":0,"2402":0,"2412":0,"2413":0,"2418":0,"2431":0,"2432":0,"2437":0,"2451":0,"2459":0,"2461":0,"2463":0,"2464":0,"2482":0,"2487":0,"2488":0,"2489":0,"2492":0,"2530":0,"2541":0,"2542":0,"2545":0,"2547":0,"2565":0,"2570":0,"2571":0,"2573":0,"2575":0,"2591":0,"2607":0,"2623":0,"2636":0,"2638":0,"2640":0,"2653":0,"2655":0,"2657":0,"2727":0,"2732":0,"2733":0,"2735":0,"2737":0,"2750":0,"2755":0,"2756":0,"2758":0,"2760":0,"2782":0,"2783":0,"2798":0,"2810":0,"2819":0,"2820":0,"2822":0,"2824":0,"2826":0,"2828":0,"2830":0,"2832":0,"2833":0,"2838":0,"2840":0,"2870":0,"2872":0,"2874":0,"2876":0,"2886":0,"2888":0,"2889":0,"2895":0,"2896":0,"2897":0,"2898":0,"2899":0,"2900":0,"2901":0,"2902":0,"2903":0,"2904":0,"2905":0,"2907":0,"2918":0,"2921":0,"2922":0,"2923":0,"2924":0,"2925":0,"2926":0,"2936":0,"2937":0,"2939":0,"2940":0,"2942":0,"2944":0,"2946":0,"2948":0,"2949":0,"2950":0,"2963":0,"2964":0,"2966":0,"2968":0,"2970":0,"2971":0,"2983":0,"2985":0,"2987":0,"2991":0,"3003":0,"3005":0,"3007":0,"3010":0,"3012":0,"3013":0,"3015":0,"3017":0,"3019":0,"3029":0,"3031":0,"3033":0,"3035":0,"3038":0,"3050":0,"3052":0,"3053":0,"3055":0,"3056":0,"3057":0,"3068":0,"3080":0,"3083":0,"3085":0,"3087":0,"3089":0,"3093":0,"3095":0,"3097":0,"3099":0,"3113":0,"3114":0,"3116":0,"3118":0,"3145":0,"3146":0,"3157":0,"3158":0,"3159":0,"3160":0,"3172":0,"3174":0,"3176":0,"3187":0,"3201":0,"3203":0,"3205":0,"3206":0,"3207":0,"3208":0,"3209":0,"3213":0,"3214":0,"3215":0,"3216":0,"3217":0,"3218":0,"3219":0,"3221":0,"3222":0,"3228":0,"3229":0,"3230":0,"3231":0,"3233":0,"3235":0,"3236":0,"3237":0,"3238":0,"3239":0,"3240":0,"3241":0,"3243":0,"3245":0,"3247":0,"3249":0,"3263":0,"3265":0,"3266":0,"3268":0,"3269":0,"3270":0,"3271":0,"3272":0,"3273":0,"3274":0,"3275":0,"3276":0,"3278":0,"3280":0,"3293":0,"3298":0,"3300":0,"3302":0,"3303":0,"3304":0,"3305":0,"3306":0,"3307":0,"3310":0,"3311":0,"3312":0,"3313":0,"3314":0,"3315":0,"3325":0,"3327":0,"3328":0,"3329":0,"3330":0,"3331":0,"3332":0,"3333":0,"3347":0,"3349":0,"3351":0,"3353":0,"3367":0,"3370":0,"3372":0,"3376":0,"3377":0,"3379":0,"3380":0,"3382":0,"3383":0,"3384":0,"3385":0,"3387":0,"3389":0,"3391":0,"3403":0,"3404":0,"3406":0,"3408":0,"3410":0,"3423":0,"3425":0,"3427":0,"3429":0,"3431":0,"3432":0,"3434":0,"3438":0,"3444":0}; _yuitest_coverage["build/graphics-svg/graphics-svg.js"].functions = {"SVGDrawing:19":0,"curveTo:91":0,"relativeCurveTo:106":0,"_curveTo:118":0,"quadraticCurveTo:188":0,"relativeQuadraticCurveTo:201":0,"_quadraticCurveTo:213":0,"drawRect:278":0,"drawRoundRect:297":0,"drawCircle:318":0,"drawEllipse:342":0,"drawDiamond:367":0,"drawWedge:391":0,"lineTo:482":0,"relativeLineTo:494":0,"_lineTo:507":0,"moveTo:568":0,"relativeMoveTo:580":0,"_moveTo:593":0,"end:619":0,"clear:629":0,"_closePath:649":0,"closePath:741":0,"_getCurrentArray:753":0,"getBezierData:773":0,"_setCurveBoundingBox:801":0,"_trackSize:835":0,"SVGShape:867":0,"init:901":0,"initializer:912":0,"_setGraphic:937":0,"addClass:961":0,"removeClass:973":0,"getXY:987":0,"setXY:1002":0,"contains:1018":0,"compareTo:1030":0,"test:1043":0,"_getDefaultFill:1055":0,"_getDefaultStroke:1074":0,"createNode:1091":0,"on:1125":0,"_strokeChangeHandler:1140":0,"_fillChangeHandler:1189":0,"_setGradientFill:1228":0,"set:1370":0,"translate:1387":0,"translateX:1399":0,"translateY:1411":0,"skew:1423":0,"skewX:1434":0,"skewY:1445":0,"rotate:1456":0,"scale:1467":0,"_addTransform:1480":0,"_updateTransform:1498":0,"_draw:1571":0,"_updateHandler:1591":0,"getBounds:1614":0,"toFront:1642":0,"toBack:1656":0,"_parsePathData:1672":0,"destroy:1713":0,"_destroy:1732":0,"valueFn:1755":0,"setter:1791":0,"getter:1800":0,"valueFn:1813":0,"setter:1818":0,"getter:1836":0,"setter:1841":0,"getter:1859":0,"setter:1864":0,"setter:1904":0,"setter:1958":0,"setter:2005":0,"valueFn:2028":0,"setter:2039":0,"getter:2060":0,"setter:2075":0,"getter:2095":0,"SVGPath:2114":0,"getter:2187":0,"getter:2200":0,"getter:2214":0,"SVGRect:2231":0,"SVGEllipse:2258":0,"_draw:2281":0,"setter:2310":0,"getter:2315":0,"setter:2334":0,"getter:2339":0,"SVGCircle:2361":0,"_draw:2385":0,"setter:2410":0,"getter:2416":0,"setter:2429":0,"getter:2435":0,"SVGPieSlice:2459":0,"_draw:2480":0,"SVGGraphic:2541":0,"valueFn:2563":0,"setter:2568":0,"getter:2589":0,"getter:2605":0,"getter:2621":0,"setter:2634":0,"setter:2651":0,"getter:2725":0,"setter:2730":0,"getter:2748":0,"setter:2753":0,"setter:2780":0,"set:2808":0,"getXY:2868":0,"initializer:2885":0,"render:2917":0,"destroy:2934":0,"addShape:2961":0,"_appendShape:2981":0,"removeShape:3001":0,"removeAllShapes:3027":0,"_removeChildren:3048":0,"clear:3067":0,"_toggleVisible:3078":0,"_getShapeClass:3111":0,"getShapeById:3143":0,"batch:3155":0,"_getDocFrag:3170":0,"_redraw:3185":0,"addToRedrawQueue:3261":0,"_getUpdatedContentBounds:3291":0,"_createGraphics:3324":0,"_createGraphicNode:3345":0,"getGradientNode:3365":0,"_toFront:3401":0,"_toBack:3421":0,"(anonymous 1):1":0}; _yuitest_coverage["build/graphics-svg/graphics-svg.js"].coveredLines = 886;@@ -4507,4 +4507,4 @@ -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-svg/graphics-svg-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -3451,4 +3451,4 @@ -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-svg/graphics-svg-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics-svg",function(e,t){function g(){}var n="svg",r="shape",i=/[a-z][^a-z]*/ig,s=/[-]?[0-9]*[0-9|\.][0-9]*/g,o=e.Lang,u=e.AttributeLite,a,f,l,c,h,p,d,v=e.config.doc,m=e.ClassNameManager.getClassName;g.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_currentX:0,_currentY:0,_type:"path",curveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!1])},relativeCurveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!0])},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b=t?"c":"C",w=t?parseFloat(this._currentX):0,E=t?parseFloat(this._currentY):0;this._pathArray=this._pathArray||[],this._pathType!==b?(this._pathType=b,y=[b],this._pathArray.push(y)):(y=this._pathArray[Math.max(0,this._pathArray.length-1)],y||(y=[],this._pathArray.push(y))),g=this._pathArray.length-1,this._pathArray[g]=this._pathArray[g].concat(e),m=e.length-5;for(v=0;v<m;v+=6)s=parseFloat(e[v])+w,o=parseFloat(e[v+1])+E,u=parseFloat(e[v+2])+w,a=parseFloat(e[v+3])+E,f=parseFloat(e[v+4])+w,l=parseFloat(e[v+5])+E,c=Math.max(f,Math.max(s,u)),p=Math.max(l,Math.max(o,a)),h=Math.min(f,Math.min(s,u)),d=Math.min(l,Math.min(o,a)),n=Math.abs(c-h),r=Math.abs(p-d),i=[[this._currentX,this._currentY],[s,o],[u,a],[f,l]],this._setCurveBoundingBox(i,n,r),this._currentX=f,this._currentY=l},quadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!1])},relativeQuadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!0])},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g=t?"q":"Q",y=t?parseFloat(this._currentX):0,b=t?parseFloat(this._currentY):0;this._pathType!==g?(this._pathType=g,u=[g],this._pathArray.push(u)):(u=this._pathArray[Math.max(0,this._pathArray.length-1)],u||(u=[],this._pathArray.push(u))),o=this._pathArray.length-1,this._pathArray[o]=this._pathArray[o].concat(e),m=e.length-3;for(v=0;v<m;v+=4)n=parseFloat(e[v])+y,r=parseFloat(e[v+1])+b,i=parseFloat(e[v+2])+y,s=parseFloat(e[v+3])+b,c=Math.max(i,n),p=Math.max(s,r),h=Math.min(i,n),d=Math.min(s,r),a=Math.abs(c-h),f=Math.abs(p-d),l=[[this._currentX,this._currentY],[n,r],[i,s]],this._setCurveBoundingBox(l,a,f),this._currentX=i,this._currentY=s},drawRect:function(e,t,n,r){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t)},drawRoundRect:function(e,t,n,r,i,s){this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s)},drawCircle:function(e,t,n){var r=n*2;return this._drawingComplete=!1,this._trackSize(e,t),this._trackSize(e+r,t+r),this._pathArray=this._pathArray||[],this._pathArray.push(["M",e+n,t]),this._pathArray.push(["A",n,n,0,1,0,e+n,t+r]),this._pathArray.push(["A",n,n,0,1,0,e+n,t]),this._currentX=e,this._currentY=t,this},drawEllipse:function(e,t,n,r){var i=n*.5,s=r*.5;return this._drawingComplete=!1,this._trackSize(e,t),this._trackSize(e+n,t+r),this._pathArray=this._pathArray||[],this._pathArray.push(["M",e+i,t]),this._pathArray.push(["A",i,s,0,1,0,e+i,t+r]),this._pathArray.push(["A",i,s,0,1,0,e+i,t]),this._currentX=e,this._currentY=t,this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawWedge:function(e,t,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g,y=i*2,b,w;s=s||i,this._pathType!="M"?(this._pathType="M",b=["M"],this._pathArray.push(b)):b=this._getCurrentArray(),w=this._pathArray.length-1,this._pathArray[w].push(e),this._pathArray[w].push(e),Math.abs(r)>360&&(r=360),o=Math.ceil(Math.abs(r)/45),u=r/o,a=-(u/180)*Math.PI,f=n/180*Math.PI;if(o>0){c=e+Math.cos(n/180*Math.PI)*i,h=t+Math.sin(n/180*Math.PI)*s,this._pathType="L",w++,this._pathArray[w]=["L"],this._pathArray[w].push(Math.round(c)),this._pathArray[w].push(Math.round(h)),w++,this._pathType="Q",this._pathArray[w]=["Q"];for(g=0;g<o;++g)f+=a,l=f-a/2,p=e+Math.cos(f)*i,d=t+Math.sin(f)*s,v=e+Math.cos(l)*(i/Math.cos(a/2)),m=t+Math.sin(l)*(s/Math.cos(a/2)),this._pathArray[w].push(Math.round(v)),this._pathArray[w].push(Math.round(m)),this._pathArray[w].push(Math.round(p)),this._pathArray[w].push(Math.round(d))}return this._currentX=e,this._currentY=t,this._trackSize(y,y),this},lineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!1])},relativeLineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!0])},_lineTo:function(e,t){var n=e[0],r,i,s,o,u,a,f=t?"l":"L",l=t?parseFloat(this._currentX):0,c=t?parseFloat(this._currentY):0;this._pathArray=this._pathArray||[],this._shapeType="path",i=e.length,this._pathType!==f?(this._pathType=f,o=[f],this._pathArray.push(o)):o=this._getCurrentArray(),s=this._pathArray.length-1;if(typeof n=="string"||typeof n=="number")for(r=0;r<i;r+=2)u=parseFloat(e[r]),a=parseFloat(e[r+1]),this._pathArray[s].push(u),this._pathArray[s].push(a),u+=l,a+=c,this._currentX=u,this._currentY=a,this._trackSize.apply(this,[u,a]);else for(r=0;r<i;++r)u=parseFloat(e[r][0]),a=parseFloat(e[r][1]),this._pathArray[s].push(u),this._pathArray[s].push(a),this._currentX=u,this._currentY=a,u+=l,a+=c,this._trackSize.apply(this,[u,a])},moveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!1])},relativeMoveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!0])},_moveTo:function(e,t){var n,r,i=parseFloat(e[0]),s=parseFloat(e[1]),o=t?"m":"M",u=t?parseFloat(this._currentX):0,a=t?parseFloat(this._currentY):0;this._pathArray=this._pathArray||[],this._pathType=o,r=[o],this._pathArray.push(r),n=this._pathArray.length-1,this._pathArray[n]=this._pathArray[n].concat([i,s]),i+=u,s+=a,this._currentX=i,this._currentY=s,this._trackSize(i,s)},end:function(){this._closePath()},clear:function(){this._currentX=0,this._currentY=0,this._width=0,this._height=0,this._left=0,this._right=0,this._top=0,this._bottom=0,this._pathArray=[],this._path=""},_closePath:function(){var t,n,r,i,s,o,u,a="",f=this.node,l=parseFloat(this._left),c=parseFloat(this._top),h=this.get("fill");if(this._pathArray){t=this._pathArray.concat();while(t&&t.length>0){n=t.shift(),i=n.length,r=n[0],r==="A"?a+=r+n[1]+","+n[2]:r=="z"||r=="Z"?a+=" z ":r=="C"||r=="c"?a+=r+(n[1]-l)+","+(n[2]-c):a+=" "+r+parseFloat(n[1]-l);switch(r){case"L":case"l":case"M":case"Q":case"q":for(u=2;u<i;++u)s=u%2===0?c:l,s=n[u]-s,a+=", "+parseFloat(s);break;case"A":s=" "+parseFloat(n[3])+" "+parseFloat(n[4]),s+=","+parseFloat(n[5])+" "+parseFloat(n[6]-l),s+=","+parseFloat(n[7]-c),a+=" "+s;break;case"C":case"c":for(u=3;u<i-1;u+=2)s=parseFloat(n[u]-l),s+=", ",s+=parseFloat(n[u+1]-c),a+=" "+s}}h&&h.color&&(a+="z"),e.Lang.trim(a),a&&f.setAttribute("d",a),this._path=a,this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()}},closePath:function(){this._pathArray.push(["z"])},_getCurrentArray:function(){var e=this._pathArray[Math.max(0,this._pathArray.length-1)];return e||(e=[],this._pathArray.push(e)),e},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r,i=this._currentX,s=i,o=this._currentY,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l;for(r=0;r<a;++r)l=this.getBezierData(e,f*r),i=isNaN(i)?l[0]:Math.min(l[0],i),s=isNaN(s)?l[0]:Math.max(l[0],s),o=isNaN(o)?l[1]:Math.min(l[1],o),u=isNaN(u)?l[1]:Math.max(l[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s,u),this._trackSize(i,o)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top}},e.SVGDrawing=g,f=function(t){this._transforms=[],this.matrix=new e.Matrix,this._normalizedMatrix=new e.Matrix,f.superclass.constructor.apply(this,arguments)},f.NAME="shape",e.extend(f,e.GraphicBase,e.mix({_x:0,_y:0,init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t.createNode(),n&&t._setGraphic(n),r&&t._parsePathData(r),t._updateHandler()},_setGraphic:function(t){var n;t instanceof e.SVGGraphic?this._graphic=t:(t=e.one(t),n=new e.SVGGraphic({render:t}),n._appendShape(this),this._graphic=n)},addClass:function(e){var t=this.node;t.className.baseVal=o.trim([t.className.baseVal,e].join(" "))},removeClass:function(e){var t=this.node,n=t.className.baseVal;n=n.replace(new RegExp(e+" "),e).replace(new RegExp(e),""),t.className.baseVal=n},getXY:function(){var e=this._graphic,t=e.getXY(),n=this._x,r=this._y;return[t[0]+n,t[1]+r]},setXY:function(e){var t=this._graphic,n=t.getXY();this._x=e[0]-n[0],this._y=e[1]-n[1],this.set("transform",this.get("transform"))},contains:function(t){return t===e.one(this.node)},compareTo:function(e){var t=this.node;return t===e},test:function(t){return e.Selector.test(this.node,t)},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},createNode:function(){var t=this,i=v.createElementNS("http://www.w3.org/2000/svg","svg:"+this._type),s=t.get("id"),o=t.name,u=t._camelCaseConcat,a=t.get("pointerEvents");t.node=i,t.addClass(m(r)+" "+m(u(n,r))+" "+m(o)+" "+m(u(n,o))),s&&i.setAttribute("id",s),a&&i.setAttribute("pointer-events",a),t.get("visible")||e.one(i).setStyle("visibility","hidden")},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.one("#"+this.get("id")).on(t,n):e.on.apply(this,arguments)},_strokeChangeHandler:function(e){var t=this.node,n=this.get("stroke"),r,i,s,u;n&&n.weight&&n.weight>0?(u=n.linejoin||"round",r=parseFloat(n.opacity),i=n.dashstyle||"none",s=o.isArray(i)?i.toString():i,n.color=n.color||"#000000",n.weight=n.weight||1,n.opacity=o.isNumber(r)?r:1,n.linecap=n.linecap||"butt",t.setAttribute("stroke-dasharray",s),t.setAttribute("stroke",n.color),t.setAttribute("stroke-linecap",n.linecap),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-opacity",n.opacity),u=="round"||u=="bevel"?t.setAttribute("stroke-linejoin",u):(u=parseInt(u,10),o.isNumber(u)&&(t.setAttribute("stroke-miterlimit",Math.max(u,1)),t.setAttribute("stroke-linejoin","miter")))):t.setAttribute("stroke","none")},_fillChangeHandler:function(e){var t=this.node,n=this.get("fill"),r,i;n?(i=n.type,i=="linear"||i=="radial"?(this._setGradientFill(n),t.setAttribute("fill","url(#grad"+this.get("id")+")")):n.color?(r=parseFloat(n.opacity),r=o.isNumber(r)?r:1,t.setAttribute("fill",n.color),t.setAttribute("fill-opacity",r)):t.setAttribute("fill","none")):t.setAttribute("fill","none")},_setGradientFill:function(e){var t,n,r,i,s,u=o.isNumber,a=this._graphic,f=e.type,l=a.getGradientNode("grad"+this.get("id"),f),c=e.stops,h=this.get("width"),p=this.get("height"),d=e.rotation||0,v=Math.PI/180,m=parseFloat(parseFloat(Math.tan(d*v)).toFixed(8)),g,y,b,w,E="0%",S="100%",x="0%",T="0%",N=e.cx,C=e.cy,k=e.fx,L=e.fy,A=e.r,O=[];f=="linear"?(N=h/2,C=p/2,Math.abs(m)*h/2>=p/2?(d<180?(x=0,T=p):(x=p,T=0),E=N-(C-x)/m,S=N-(C-T)/m):(d>90&&d<270?(E=h,S=0):(E=0,S=h),x=(m*(N-E)-C)*-1,T=(m*(N-S)-C)*-1),E=Math.round(100*E/h),S=Math.round(100*S/h),x=Math.round(100*x/p),T=Math.round(100*T/p),E=u(E)?E:0,S=u(S)?S:100,x=u(x)?x:0,T=u(T)?T:0,l.setAttribute("spreadMethod","pad"),l.setAttribute("width",h),l.setAttribute("height",p),l.setAttribute("x1",E+"%"),l.setAttribute("x2",S+"%"),l.setAttribute("y1",x+"%"),l.setAttribute("y2",T+"%")):(l.setAttribute("cx",N*100+"%"),l.setAttribute("cy",C*100+"%"),l.setAttribute("fx",k*100+"%"),l.setAttribute("fy",L*100+"%"),l.setAttribute("r",A*100+"%")),y=c.length,b=0;for(g=0;g<y;++g)this._stops&&this._stops.length>0?(i=this._stops.shift(),s=!1):(i=a._createGraphicNode("stop"),s=!0),w=c[g],n=w.opacity,r=w.color,t=w.offset||g/(y-1),t=Math.round(t*100)+"%",n=u(n)?n:1,n=Math.max(0,Math.min(1,n)),b=(g+1)/y,i.setAttribute("offset",t),i.setAttribute("stop-color",r),i.setAttribute("stop-opacity",n),s&&l.appendChild(i),O.push(i);while(this._stops&&this._stops.length>0)l.removeChild(this._stops.shift());this._stops=O},_stops:null,set:function(){var e=this;u.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},translate:function(e,t){this._addTransform("translate",arguments)},translateX:function(e){this._addTransform("translateX",arguments)},translateY:function(e){this._addTransform("translateY",arguments)},skew:function(e,t){this._addTransform("skew",arguments)},skewX:function(e){this._addTransform("skewX",arguments)},skewY:function(e){this._addTransform("skewY",arguments)},rotate:function(e){this._addTransform("rotate",arguments)},scale:function(e,t){this._addTransform("scale",arguments)},_addTransform:function(t,n){n=e.Array(n),this._transform=o.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var t=this._type=="path",n=this.node,r,i,s,o,u,a,f,l=this.matrix,c=this._normalizedMatrix,h,p=this._transforms.length;if(t||this._transforms&&this._transforms.length>0){o=this._x,u=this._y,s=this.get("transformOrigin"),a=o+s[0]*this.get("width"),f=u+s[1]*this.get("height"),t&&(this instanceof e.SVGPath||(a=this._left+s[0]*this.get("width"),f=this._top+s[1]*this.get("height")),c.init({dx:o+this._left,dy:u+this._top})),c.translate(a,f);for(h=0;h<p;++h)r=this._transforms[h].shift(),r&&(c[r].apply(c,this._transforms[h]),l[r].apply(l,this._transforms[h])),t&&this._transforms[h].unshift(r);c.translate(-a,-f),i="matrix("+c.a+","+c.b+","+c.c+","+c.d+","+c.dx+","+c.dy+")"}this._graphic.addToRedrawQueue(this),i&&n.setAttribute("transform",i),t||(this._transforms=[])},_draw:function(){var e=this.node;e.setAttribute("width",this.get("width")),e.setAttribute("height",this.get("height")),e.setAttribute("x",this._x),e.setAttribute("y",this._y),e.style.left=this._x+"px",e.style.top=this._y+"px",this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()},_updateHandler:function(e){this._draw()},_transform:"",getBounds:function(){var e=this._type,t=this.get("stroke"),n=this.get("width"),r=this.get("height"),i=e=="path"?0:this._x,s=e=="path"?0:this._y,o=0;return e!="path"&&(t&&t.weight&&(o=t.weight),n=i+n+o-(i-o),r=s+r+o-(s-o),i-=o,s-=o),this._normalizedMatrix.getContentRect(n,r,i,s)},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(e.Event.purgeElement(this.node,!0),this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null)}},e.SVGDrawing.prototype)),f.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){return this.matrix.init(),this._normalizedMatrix.init(),this._transforms=this.matrix.getTransformArray(e),this._transform=e,e},getter:function(){return this._transform}},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}},x:{getter:function(){return this._x},setter:function(e){var t=this.get("transform");this._x=e,t&&this.set("transform",t)}},y:{getter:function(){return this._y},setter:function(e){var t=this.get("transform");this._y=e,t&&this.set("transform",t)}},width:{value:0},height:{value:0},visible:{value:!0,setter:function(e){var t=e?"visible":"hidden";return this.node&&(this.node.style.visibility=t),e}},fill:{valueFn:"_getDefaultFill",setter:function(t){var n,r=this.get("fill")||this._getDefaultFill();return n=t?e.merge(r,t):null,n&&n.color&&(n.color===undefined||n.color=="none")&&(n.color=null),n}},stroke:{valueFn:"_getDefaultStroke",setter:function(t){var n=this.get("stroke")||this._getDefaultStroke(),r;return t&&t.hasOwnProperty("weight")&&(r=parseInt(t.weight,10),isNaN(r)||(t.weight=r)),t?e.merge(n,t):null}},pointerEvents:{valueFn:function(){var e="visiblePainted",t=this.node;return t&&t.setAttribute("pointer-events",e),e},setter:function(e){var t=this.node;return t&&t.setAttribute("pointer-events",e),e}},node:{readOnly:!0,getter:function(){return this.node}},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.SVGShape=f,h=function(e){h.superclass.constructor.apply(this,arguments)},h.NAME="path",e.extend(h,e.SVGShape,{_left:0,_right:0,_top:0,_bottom:0,_type:"path",_path:""}),h.ATTRS=e.merge(e.SVGShape.ATTRS,{path:{readOnly:!0,getter:function(){return this._path}},width:{getter:function(){var e=Math.max(this._right-this._left,0);return e}},height:{getter:function(){return Math.max(this._bottom-this._top,0)}}}),e.SVGPath=h,c=function(){c.superclass.constructor.apply(this,arguments)},c.NAME="rect",e.extend(c,e.SVGShape,{_type:"rect"}),c.ATTRS=e.SVGShape.ATTRS,e.SVGRect=c,p=function(e){p.superclass.constructor.apply(this,arguments)},p.NAME="ellipse",e.extend(p,f,{_type:"ellipse",_draw:function(){var e=this.node,t=this.get("width"),n=this.get("height"),r=this.get("x"),i=this.get("y"),s=t*.5,o=n*.5,u=r+s,a=i+o;e.setAttribute("rx",s),e.setAttribute("ry",o),e.setAttribute("cx",u),e.setAttribute("cy",a),this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()}}),p.ATTRS=e.merge(f.ATTRS,{xRadius:{setter:function(e){this.set("width",e*2)},getter:function(){var e=this.get("width");return e&&(e*=.5),e}},yRadius:{setter:function(e){this.set("height",e*2)},getter:function(){var e=this.get("height");return e&&(e*=.5),e}}}),e.SVGEllipse=p,l=function(e){l.superclass.constructor.apply(this,arguments)},l.NAME="circle",e.extend(l,e.SVGShape,{_type:"circle",_draw:function(){var e=this.node,t=this.get("x"),n=this.get("y"),r=this.get("radius"),i=t+r,s=n+r;e.setAttribute("r",r),e.setAttribute("cx",i),e.setAttribute("cy",s),this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()}}),l.ATTRS=e.merge(e.SVGShape.ATTRS,{width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},radius:{value:0}}),e.SVGCircle=l,d=function(){d.superclass.constructor.apply(this,arguments)},d.NAME="svgPieSlice",e.extend(d,e.SVGShape,e.mix({_type:"path",_draw:function(e){var t=this.get("cx"),n=this.get("cy"),r=this.get("startAngle"),i=this.get("arc"),s=this.get("radius");this.clear(),this.drawWedge(t,n,r,i,s),this.end()}},e.SVGDrawing.prototype)),d.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.SVGShape.ATTRS),e.SVGPieSlice=d,a=function(e){a.superclass.constructor.apply(this,arguments)},a.NAME="svgGraphic",a.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{value:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}},pointerEvents:{value:"none"}},e.extend(a,e.GraphicBase,{set:function(t,n){var r=this,i={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},s,a=!1;u.prototype.set.apply(r,arguments);if(r._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(o.isString&&i[t])a=!0;else if(o.isObject(t))for(s in i)if(i.hasOwnProperty(s)&&t[s]){a=!0;break}a&&r._redraw()},_x:0,_y:0,getXY:function(){var t=e.one(this._node),n;return t&&(n=t.getXY()),n},initializer:function(){var e=this.get("render"),t=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._gradients={},this._node=v.createElement("div"),this._node.style.position="absolute",this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=t,this._contentNode=this._createGraphics(),this._contentNode.style.visibility=t,this._contentNode.setAttribute("id",this.get("id")),this._node.appendChild(this._contentNode),e&&this.render(e)},render:function(t){var n=e.one(t),r=this.get("width")||parseInt(n.getComputedStyle("width"),10),i=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||e.one(v.body),n.append(this._node),this.parentNode=n,this.set("width",r),this.set("height",i),this},destroy:function(){this.removeAllShapes(),this._contentNode&&(this._removeChildren(this._contentNode),this._contentNode.parentNode&&this._contentNode.parentNode.removeChild(this._contentNode),this._contentNode=null),this._node&&(this._removeChildren(this._node),e.one(this._node).remove(!0),this._node=null)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n},_appendShape:function(e){var t=e.node,n=this._frag||this._contentNode;this.get("autoDraw")?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){return e instanceof f||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof f&&(e._destroy(),delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw(),e},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t]._destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes()},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._contentNode&&(this._contentNode.style.visibility=r),this._node&&(this._node.style.visibility=r)},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.SVGCircle,rect:e.SVGRect,path:e.SVGPath,ellipse:e.SVGEllipse,pieslice:e.SVGPieSlice},getShapeById:function(e){var t=this._shapes[e];return t},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=v.createDocumentFragment()),this._frag},_redraw:function(){var t=this.get("autoSize"),n=this.get("preserveAspectRatio"),r=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,i=r.left,s=r.right,o=r.top,u=r.bottom,a=s-i,f=u-o,l,c,h,p,d;t?t=="sizeContentToGraphic"?(d=e.one(this._node),l=parseFloat(d.getComputedStyle("width")),c=parseFloat(d.getComputedStyle("height")),h=p=0,this._contentNode.setAttribute("preserveAspectRatio",n)):(l=a,c=f,h=i,p=o,this._state.width=a,this._state.height=f,this._node&&(this._node.style.width=a+"px",this._node.style.height=f+"px")):(l=a,c=f,h=i,p=o),this._contentNode&&(this._contentNode.style.left=h+"px",this._contentNode.style.top=p+"px",this._contentNode.setAttribute("width",l),this._contentNode.setAttribute("height",c),this._contentNode.style.width=l+"px",this._contentNode.style.height=c+"px",this._contentNode.setAttribute("viewBox",""+i+" "+o+" "+a+" "+f+"")),this._frag&&(this._contentNode&&this._contentNode.appendChild(this._frag),this._frag=null)},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,n.width=n.right-n.left,n.height=n.bottom-n.top,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=o.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=o.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=o.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=o.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=o.isNumber(i.left)?i.left:0,i.top=o.isNumber(i.top)?i.top:0,i.right=o.isNumber(i.right)?i.right:0,i.bottom=o.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_createGraphics:function(){var e=this._createGraphicNode("svg"),t=this.get("pointerEvents");return e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.overflow="auto",e.setAttribute("overflow","auto"),e.setAttribute("pointer-events",t),e},_createGraphicNode:function(e,t){var n=v.createElementNS("http://www.w3.org/2000/svg","svg:"+e),r=t||"none";return e!=="defs"&&e!=="stop"&&e!=="linearGradient"&&e!="radialGradient"&&n.setAttribute("pointer-events",r),n},getGradientNode:function(e,t){var n=this._gradients,r,i=t+"Gradient";return n.hasOwnProperty(e)&&n[e].tagName.indexOf(t)>-1?r=this._gradients[e]:(r=this._createGraphicNode(i),this._defs||(this._defs=this._createGraphicNode("defs"),this._contentNode.appendChild(this._defs)),this._defs.appendChild(r),e=e||"gradient"+Math.round(1e5*Math.random()),r.setAttribute("id",e),n.hasOwnProperty(e)&&this._defs.removeChild(n[e]),n[e]=r),r},_toFront:function(t){var n=this._contentNode;t instanceof e.SVGShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this._contentNode,r;t instanceof e.SVGShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.SVGGraphic=a},"3.7.2",{requires:["graphics"]});+YUI.add("graphics-svg",function(e,t){function g(){}var n="svg",r="shape",i=/[a-z][^a-z]*/ig,s=/[-]?[0-9]*[0-9|\.][0-9]*/g,o=e.Lang,u=e.AttributeLite,a,f,l,c,h,p,d,v=e.config.doc,m=e.ClassNameManager.getClassName;g.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_currentX:0,_currentY:0,_type:"path",curveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!1])},relativeCurveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!0])},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y,b=t?"c":"C",w=t?parseFloat(this._currentX):0,E=t?parseFloat(this._currentY):0;this._pathArray=this._pathArray||[],this._pathType!==b?(this._pathType=b,y=[b],this._pathArray.push(y)):(y=this._pathArray[Math.max(0,this._pathArray.length-1)],y||(y=[],this._pathArray.push(y))),g=this._pathArray.length-1,this._pathArray[g]=this._pathArray[g].concat(e),m=e.length-5;for(v=0;v<m;v+=6)s=parseFloat(e[v])+w,o=parseFloat(e[v+1])+E,u=parseFloat(e[v+2])+w,a=parseFloat(e[v+3])+E,f=parseFloat(e[v+4])+w,l=parseFloat(e[v+5])+E,c=Math.max(f,Math.max(s,u)),p=Math.max(l,Math.max(o,a)),h=Math.min(f,Math.min(s,u)),d=Math.min(l,Math.min(o,a)),n=Math.abs(c-h),r=Math.abs(p-d),i=[[this._currentX,this._currentY],[s,o],[u,a],[f,l]],this._setCurveBoundingBox(i,n,r),this._currentX=f,this._currentY=l},quadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!1])},relativeQuadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!0])},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g=t?"q":"Q",y=t?parseFloat(this._currentX):0,b=t?parseFloat(this._currentY):0;this._pathType!==g?(this._pathType=g,u=[g],this._pathArray.push(u)):(u=this._pathArray[Math.max(0,this._pathArray.length-1)],u||(u=[],this._pathArray.push(u))),o=this._pathArray.length-1,this._pathArray[o]=this._pathArray[o].concat(e),m=e.length-3;for(v=0;v<m;v+=4)n=parseFloat(e[v])+y,r=parseFloat(e[v+1])+b,i=parseFloat(e[v+2])+y,s=parseFloat(e[v+3])+b,c=Math.max(i,n),p=Math.max(s,r),h=Math.min(i,n),d=Math.min(s,r),a=Math.abs(c-h),f=Math.abs(p-d),l=[[this._currentX,this._currentY],[n,r],[i,s]],this._setCurveBoundingBox(l,a,f),this._currentX=i,this._currentY=s},drawRect:function(e,t,n,r){this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t)},drawRoundRect:function(e,t,n,r,i,s){this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s)},drawCircle:function(e,t,n){var r=n*2;return this._drawingComplete=!1,this._trackSize(e,t),this._trackSize(e+r,t+r),this._pathArray=this._pathArray||[],this._pathArray.push(["M",e+n,t]),this._pathArray.push(["A",n,n,0,1,0,e+n,t+r]),this._pathArray.push(["A",n,n,0,1,0,e+n,t]),this._currentX=e,this._currentY=t,this},drawEllipse:function(e,t,n,r){var i=n*.5,s=r*.5;return this._drawingComplete=!1,this._trackSize(e,t),this._trackSize(e+n,t+r),this._pathArray=this._pathArray||[],this._pathArray.push(["M",e+i,t]),this._pathArray.push(["A",i,s,0,1,0,e+i,t+r]),this._pathArray.push(["A",i,s,0,1,0,e+i,t]),this._currentX=e,this._currentY=t,this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawWedge:function(e,t,n,r,i,s){var o,u,a,f,l,c,h,p,d,v,m,g,y=i*2,b,w;s=s||i,this._pathType!="M"?(this._pathType="M",b=["M"],this._pathArray.push(b)):b=this._getCurrentArray(),w=this._pathArray.length-1,this._pathArray[w].push(e),this._pathArray[w].push(e),Math.abs(r)>360&&(r=360),o=Math.ceil(Math.abs(r)/45),u=r/o,a=-(u/180)*Math.PI,f=n/180*Math.PI;if(o>0){c=e+Math.cos(n/180*Math.PI)*i,h=t+Math.sin(n/180*Math.PI)*s,this._pathType="L",w++,this._pathArray[w]=["L"],this._pathArray[w].push(Math.round(c)),this._pathArray[w].push(Math.round(h)),w++,this._pathType="Q",this._pathArray[w]=["Q"];for(g=0;g<o;++g)f+=a,l=f-a/2,p=e+Math.cos(f)*i,d=t+Math.sin(f)*s,v=e+Math.cos(l)*(i/Math.cos(a/2)),m=t+Math.sin(l)*(s/Math.cos(a/2)),this._pathArray[w].push(Math.round(v)),this._pathArray[w].push(Math.round(m)),this._pathArray[w].push(Math.round(p)),this._pathArray[w].push(Math.round(d))}return this._currentX=e,this._currentY=t,this._trackSize(y,y),this},lineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!1])},relativeLineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!0])},_lineTo:function(e,t){var n=e[0],r,i,s,o,u,a,f=t?"l":"L",l=t?parseFloat(this._currentX):0,c=t?parseFloat(this._currentY):0;this._pathArray=this._pathArray||[],this._shapeType="path",i=e.length,this._pathType!==f?(this._pathType=f,o=[f],this._pathArray.push(o)):o=this._getCurrentArray(),s=this._pathArray.length-1;if(typeof n=="string"||typeof n=="number")for(r=0;r<i;r+=2)u=parseFloat(e[r]),a=parseFloat(e[r+1]),this._pathArray[s].push(u),this._pathArray[s].push(a),u+=l,a+=c,this._currentX=u,this._currentY=a,this._trackSize.apply(this,[u,a]);else for(r=0;r<i;++r)u=parseFloat(e[r][0]),a=parseFloat(e[r][1]),this._pathArray[s].push(u),this._pathArray[s].push(a),this._currentX=u,this._currentY=a,u+=l,a+=c,this._trackSize.apply(this,[u,a])},moveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!1])},relativeMoveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!0])},_moveTo:function(e,t){var n,r,i=parseFloat(e[0]),s=parseFloat(e[1]),o=t?"m":"M",u=t?parseFloat(this._currentX):0,a=t?parseFloat(this._currentY):0;this._pathArray=this._pathArray||[],this._pathType=o,r=[o],this._pathArray.push(r),n=this._pathArray.length-1,this._pathArray[n]=this._pathArray[n].concat([i,s]),i+=u,s+=a,this._currentX=i,this._currentY=s,this._trackSize(i,s)},end:function(){this._closePath()},clear:function(){this._currentX=0,this._currentY=0,this._width=0,this._height=0,this._left=0,this._right=0,this._top=0,this._bottom=0,this._pathArray=[],this._path=""},_closePath:function(){var t,n,r,i,s,o,u,a="",f=this.node,l=parseFloat(this._left),c=parseFloat(this._top),h=this.get("fill");if(this._pathArray){t=this._pathArray.concat();while(t&&t.length>0){n=t.shift(),i=n.length,r=n[0],r==="A"?a+=r+n[1]+","+n[2]:r=="z"||r=="Z"?a+=" z ":r=="C"||r=="c"?a+=r+(n[1]-l)+","+(n[2]-c):a+=" "+r+parseFloat(n[1]-l);switch(r){case"L":case"l":case"M":case"Q":case"q":for(u=2;u<i;++u)s=u%2===0?c:l,s=n[u]-s,a+=", "+parseFloat(s);break;case"A":s=" "+parseFloat(n[3])+" "+parseFloat(n[4]),s+=","+parseFloat(n[5])+" "+parseFloat(n[6]-l),s+=","+parseFloat(n[7]-c),a+=" "+s;break;case"C":case"c":for(u=3;u<i-1;u+=2)s=parseFloat(n[u]-l),s+=", ",s+=parseFloat(n[u+1]-c),a+=" "+s}}h&&h.color&&(a+="z"),e.Lang.trim(a),a&&f.setAttribute("d",a),this._path=a,this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()}},closePath:function(){this._pathArray.push(["z"])},_getCurrentArray:function(){var e=this._pathArray[Math.max(0,this._pathArray.length-1)];return e||(e=[],this._pathArray.push(e)),e},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r,i=this._currentX,s=i,o=this._currentY,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l;for(r=0;r<a;++r)l=this.getBezierData(e,f*r),i=isNaN(i)?l[0]:Math.min(l[0],i),s=isNaN(s)?l[0]:Math.max(l[0],s),o=isNaN(o)?l[1]:Math.min(l[1],o),u=isNaN(u)?l[1]:Math.max(l[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s,u),this._trackSize(i,o)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top}},e.SVGDrawing=g,f=function(t){this._transforms=[],this.matrix=new e.Matrix,this._normalizedMatrix=new e.Matrix,f.superclass.constructor.apply(this,arguments)},f.NAME="shape",e.extend(f,e.GraphicBase,e.mix({_x:0,_y:0,init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t.createNode(),n&&t._setGraphic(n),r&&t._parsePathData(r),t._updateHandler()},_setGraphic:function(t){var n;t instanceof e.SVGGraphic?this._graphic=t:(t=e.one(t),n=new e.SVGGraphic({render:t}),n._appendShape(this),this._graphic=n)},addClass:function(e){var t=this.node;t.className.baseVal=o.trim([t.className.baseVal,e].join(" "))},removeClass:function(e){var t=this.node,n=t.className.baseVal;n=n.replace(new RegExp(e+" "),e).replace(new RegExp(e),""),t.className.baseVal=n},getXY:function(){var e=this._graphic,t=e.getXY(),n=this._x,r=this._y;return[t[0]+n,t[1]+r]},setXY:function(e){var t=this._graphic,n=t.getXY();this._x=e[0]-n[0],this._y=e[1]-n[1],this.set("transform",this.get("transform"))},contains:function(t){return t===e.one(this.node)},compareTo:function(e){var t=this.node;return t===e},test:function(t){return e.Selector.test(this.node,t)},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},createNode:function(){var t=this,i=v.createElementNS("http://www.w3.org/2000/svg","svg:"+this._type),s=t.get("id"),o=t.name,u=t._camelCaseConcat,a=t.get("pointerEvents");t.node=i,t.addClass(m(r)+" "+m(u(n,r))+" "+m(o)+" "+m(u(n,o))),s&&i.setAttribute("id",s),a&&i.setAttribute("pointer-events",a),t.get("visible")||e.one(i).setStyle("visibility","hidden")},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.one("#"+this.get("id")).on(t,n):e.on.apply(this,arguments)},_strokeChangeHandler:function(e){var t=this.node,n=this.get("stroke"),r,i,s,u;n&&n.weight&&n.weight>0?(u=n.linejoin||"round",r=parseFloat(n.opacity),i=n.dashstyle||"none",s=o.isArray(i)?i.toString():i,n.color=n.color||"#000000",n.weight=n.weight||1,n.opacity=o.isNumber(r)?r:1,n.linecap=n.linecap||"butt",t.setAttribute("stroke-dasharray",s),t.setAttribute("stroke",n.color),t.setAttribute("stroke-linecap",n.linecap),t.setAttribute("stroke-width",n.weight),t.setAttribute("stroke-opacity",n.opacity),u=="round"||u=="bevel"?t.setAttribute("stroke-linejoin",u):(u=parseInt(u,10),o.isNumber(u)&&(t.setAttribute("stroke-miterlimit",Math.max(u,1)),t.setAttribute("stroke-linejoin","miter")))):t.setAttribute("stroke","none")},_fillChangeHandler:function(e){var t=this.node,n=this.get("fill"),r,i;n?(i=n.type,i=="linear"||i=="radial"?(this._setGradientFill(n),t.setAttribute("fill","url(#grad"+this.get("id")+")")):n.color?(r=parseFloat(n.opacity),r=o.isNumber(r)?r:1,t.setAttribute("fill",n.color),t.setAttribute("fill-opacity",r)):t.setAttribute("fill","none")):t.setAttribute("fill","none")},_setGradientFill:function(e){var t,n,r,i,s,u=o.isNumber,a=this._graphic,f=e.type,l=a.getGradientNode("grad"+this.get("id"),f),c=e.stops,h=this.get("width"),p=this.get("height"),d=e.rotation||0,v=Math.PI/180,m=parseFloat(parseFloat(Math.tan(d*v)).toFixed(8)),g,y,b,w,E="0%",S="100%",x="0%",T="0%",N=e.cx,C=e.cy,k=e.fx,L=e.fy,A=e.r,O=[];f=="linear"?(N=h/2,C=p/2,Math.abs(m)*h/2>=p/2?(d<180?(x=0,T=p):(x=p,T=0),E=N-(C-x)/m,S=N-(C-T)/m):(d>90&&d<270?(E=h,S=0):(E=0,S=h),x=(m*(N-E)-C)*-1,T=(m*(N-S)-C)*-1),E=Math.round(100*E/h),S=Math.round(100*S/h),x=Math.round(100*x/p),T=Math.round(100*T/p),E=u(E)?E:0,S=u(S)?S:100,x=u(x)?x:0,T=u(T)?T:0,l.setAttribute("spreadMethod","pad"),l.setAttribute("width",h),l.setAttribute("height",p),l.setAttribute("x1",E+"%"),l.setAttribute("x2",S+"%"),l.setAttribute("y1",x+"%"),l.setAttribute("y2",T+"%")):(l.setAttribute("cx",N*100+"%"),l.setAttribute("cy",C*100+"%"),l.setAttribute("fx",k*100+"%"),l.setAttribute("fy",L*100+"%"),l.setAttribute("r",A*100+"%")),y=c.length,b=0;for(g=0;g<y;++g)this._stops&&this._stops.length>0?(i=this._stops.shift(),s=!1):(i=a._createGraphicNode("stop"),s=!0),w=c[g],n=w.opacity,r=w.color,t=w.offset||g/(y-1),t=Math.round(t*100)+"%",n=u(n)?n:1,n=Math.max(0,Math.min(1,n)),b=(g+1)/y,i.setAttribute("offset",t),i.setAttribute("stop-color",r),i.setAttribute("stop-opacity",n),s&&l.appendChild(i),O.push(i);while(this._stops&&this._stops.length>0)l.removeChild(this._stops.shift());this._stops=O},_stops:null,set:function(){var e=this;u.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},translate:function(e,t){this._addTransform("translate",arguments)},translateX:function(e){this._addTransform("translateX",arguments)},translateY:function(e){this._addTransform("translateY",arguments)},skew:function(e,t){this._addTransform("skew",arguments)},skewX:function(e){this._addTransform("skewX",arguments)},skewY:function(e){this._addTransform("skewY",arguments)},rotate:function(e){this._addTransform("rotate",arguments)},scale:function(e,t){this._addTransform("scale",arguments)},_addTransform:function(t,n){n=e.Array(n),this._transform=o.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var t=this._type=="path",n=this.node,r,i,s,o,u,a,f,l=this.matrix,c=this._normalizedMatrix,h,p=this._transforms.length;if(t||this._transforms&&this._transforms.length>0){o=this._x,u=this._y,s=this.get("transformOrigin"),a=o+s[0]*this.get("width"),f=u+s[1]*this.get("height"),t&&(this instanceof e.SVGPath||(a=this._left+s[0]*this.get("width"),f=this._top+s[1]*this.get("height")),c.init({dx:o+this._left,dy:u+this._top})),c.translate(a,f);for(h=0;h<p;++h)r=this._transforms[h].shift(),r&&(c[r].apply(c,this._transforms[h]),l[r].apply(l,this._transforms[h])),t&&this._transforms[h].unshift(r);c.translate(-a,-f),i="matrix("+c.a+","+c.b+","+c.c+","+c.d+","+c.dx+","+c.dy+")"}this._graphic.addToRedrawQueue(this),i&&n.setAttribute("transform",i),t||(this._transforms=[])},_draw:function(){var e=this.node;e.setAttribute("width",this.get("width")),e.setAttribute("height",this.get("height")),e.setAttribute("x",this._x),e.setAttribute("y",this._y),e.style.left=this._x+"px",e.style.top=this._y+"px",this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()},_updateHandler:function(e){this._draw()},_transform:"",getBounds:function(){var e=this._type,t=this.get("stroke"),n=this.get("width"),r=this.get("height"),i=e=="path"?0:this._x,s=e=="path"?0:this._y,o=0;return e!="path"&&(t&&t.weight&&(o=t.weight),n=i+n+o-(i-o),r=s+r+o-(s-o),i-=o,s-=o),this._normalizedMatrix.getContentRect(n,r,i,s)},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(e.Event.purgeElement(this.node,!0),this.node.parentNode&&this.node.parentNode.removeChild(this.node),this.node=null)}},e.SVGDrawing.prototype)),f.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){return this.matrix.init(),this._normalizedMatrix.init(),this._transforms=this.matrix.getTransformArray(e),this._transform=e,e},getter:function(){return this._transform}},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}},x:{getter:function(){return this._x},setter:function(e){var t=this.get("transform");this._x=e,t&&this.set("transform",t)}},y:{getter:function(){return this._y},setter:function(e){var t=this.get("transform");this._y=e,t&&this.set("transform",t)}},width:{value:0},height:{value:0},visible:{value:!0,setter:function(e){var t=e?"visible":"hidden";return this.node&&(this.node.style.visibility=t),e}},fill:{valueFn:"_getDefaultFill",setter:function(t){var n,r=this.get("fill")||this._getDefaultFill();return n=t?e.merge(r,t):null,n&&n.color&&(n.color===undefined||n.color=="none")&&(n.color=null),n}},stroke:{valueFn:"_getDefaultStroke",setter:function(t){var n=this.get("stroke")||this._getDefaultStroke(),r;return t&&t.hasOwnProperty("weight")&&(r=parseInt(t.weight,10),isNaN(r)||(t.weight=r)),t?e.merge(n,t):null}},pointerEvents:{valueFn:function(){var e="visiblePainted",t=this.node;return t&&t.setAttribute("pointer-events",e),e},setter:function(e){var t=this.node;return t&&t.setAttribute("pointer-events",e),e}},node:{readOnly:!0,getter:function(){return this.node}},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.SVGShape=f,h=function(e){h.superclass.constructor.apply(this,arguments)},h.NAME="path",e.extend(h,e.SVGShape,{_left:0,_right:0,_top:0,_bottom:0,_type:"path",_path:""}),h.ATTRS=e.merge(e.SVGShape.ATTRS,{path:{readOnly:!0,getter:function(){return this._path}},width:{getter:function(){var e=Math.max(this._right-this._left,0);return e}},height:{getter:function(){return Math.max(this._bottom-this._top,0)}}}),e.SVGPath=h,c=function(){c.superclass.constructor.apply(this,arguments)},c.NAME="rect",e.extend(c,e.SVGShape,{_type:"rect"}),c.ATTRS=e.SVGShape.ATTRS,e.SVGRect=c,p=function(e){p.superclass.constructor.apply(this,arguments)},p.NAME="ellipse",e.extend(p,f,{_type:"ellipse",_draw:function(){var e=this.node,t=this.get("width"),n=this.get("height"),r=this.get("x"),i=this.get("y"),s=t*.5,o=n*.5,u=r+s,a=i+o;e.setAttribute("rx",s),e.setAttribute("ry",o),e.setAttribute("cx",u),e.setAttribute("cy",a),this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()}}),p.ATTRS=e.merge(f.ATTRS,{xRadius:{setter:function(e){this.set("width",e*2)},getter:function(){var e=this.get("width");return e&&(e*=.5),e}},yRadius:{setter:function(e){this.set("height",e*2)},getter:function(){var e=this.get("height");return e&&(e*=.5),e}}}),e.SVGEllipse=p,l=function(e){l.superclass.constructor.apply(this,arguments)},l.NAME="circle",e.extend(l,e.SVGShape,{_type:"circle",_draw:function(){var e=this.node,t=this.get("x"),n=this.get("y"),r=this.get("radius"),i=t+r,s=n+r;e.setAttribute("r",r),e.setAttribute("cx",i),e.setAttribute("cy",s),this._fillChangeHandler(),this._strokeChangeHandler(),this._updateTransform()}}),l.ATTRS=e.merge(e.SVGShape.ATTRS,{width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){return this.get("radius")*2}},radius:{value:0}}),e.SVGCircle=l,d=function(){d.superclass.constructor.apply(this,arguments)},d.NAME="svgPieSlice",e.extend(d,e.SVGShape,e.mix({_type:"path",_draw:function(e){var t=this.get("cx"),n=this.get("cy"),r=this.get("startAngle"),i=this.get("arc"),s=this.get("radius");this.clear(),this.drawWedge(t,n,r,i,s),this.end()}},e.SVGDrawing.prototype)),d.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.SVGShape.ATTRS),e.SVGPieSlice=d,a=function(e){a.superclass.constructor.apply(this,arguments)},a.NAME="svgGraphic",a.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{value:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}},pointerEvents:{value:"none"}},e.extend(a,e.GraphicBase,{set:function(t,n){var r=this,i={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},s,a=!1;u.prototype.set.apply(r,arguments);if(r._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(o.isString&&i[t])a=!0;else if(o.isObject(t))for(s in i)if(i.hasOwnProperty(s)&&t[s]){a=!0;break}a&&r._redraw()},_x:0,_y:0,getXY:function(){var t=e.one(this._node),n;return t&&(n=t.getXY()),n},initializer:function(){var e=this.get("render"),t=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._gradients={},this._node=v.createElement("div"),this._node.style.position="absolute",this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=t,this._contentNode=this._createGraphics(),this._contentNode.style.visibility=t,this._contentNode.setAttribute("id",this.get("id")),this._node.appendChild(this._contentNode),e&&this.render(e)},render:function(t){var n=e.one(t),r=this.get("width")||parseInt(n.getComputedStyle("width"),10),i=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||e.one(v.body),n.append(this._node),this.parentNode=n,this.set("width",r),this.set("height",i),this},destroy:function(){this.removeAllShapes(),this._contentNode&&(this._removeChildren(this._contentNode),this._contentNode.parentNode&&this._contentNode.parentNode.removeChild(this._contentNode),this._contentNode=null),this._node&&(this._removeChildren(this._node),e.one(this._node).remove(!0),this._node=null)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n},_appendShape:function(e){var t=e.node,n=this._frag||this._contentNode;this.get("autoDraw")?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){return e instanceof f||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof f&&(e._destroy(),delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw(),e},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t]._destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes()},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._contentNode&&(this._contentNode.style.visibility=r),this._node&&(this._node.style.visibility=r)},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.SVGCircle,rect:e.SVGRect,path:e.SVGPath,ellipse:e.SVGEllipse,pieslice:e.SVGPieSlice},getShapeById:function(e){var t=this._shapes[e];return t},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=v.createDocumentFragment()),this._frag},_redraw:function(){var t=this.get("autoSize"),n=this.get("preserveAspectRatio"),r=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,i=r.left,s=r.right,o=r.top,u=r.bottom,a=s-i,f=u-o,l,c,h,p,d;t?t=="sizeContentToGraphic"?(d=e.one(this._node),l=parseFloat(d.getComputedStyle("width")),c=parseFloat(d.getComputedStyle("height")),h=p=0,this._contentNode.setAttribute("preserveAspectRatio",n)):(l=a,c=f,h=i,p=o,this._state.width=a,this._state.height=f,this._node&&(this._node.style.width=a+"px",this._node.style.height=f+"px")):(l=a,c=f,h=i,p=o),this._contentNode&&(this._contentNode.style.left=h+"px",this._contentNode.style.top=p+"px",this._contentNode.setAttribute("width",l),this._contentNode.setAttribute("height",c),this._contentNode.style.width=l+"px",this._contentNode.style.height=c+"px",this._contentNode.setAttribute("viewBox",""+i+" "+o+" "+a+" "+f+"")),this._frag&&(this._contentNode&&this._contentNode.appendChild(this._frag),this._frag=null)},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,n.width=n.right-n.left,n.height=n.bottom-n.top,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=o.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=o.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=o.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=o.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=o.isNumber(i.left)?i.left:0,i.top=o.isNumber(i.top)?i.top:0,i.right=o.isNumber(i.right)?i.right:0,i.bottom=o.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_createGraphics:function(){var e=this._createGraphicNode("svg"),t=this.get("pointerEvents");return e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.overflow="auto",e.setAttribute("overflow","auto"),e.setAttribute("pointer-events",t),e},_createGraphicNode:function(e,t){var n=v.createElementNS("http://www.w3.org/2000/svg","svg:"+e),r=t||"none";return e!=="defs"&&e!=="stop"&&e!=="linearGradient"&&e!="radialGradient"&&n.setAttribute("pointer-events",r),n},getGradientNode:function(e,t){var n=this._gradients,r,i=t+"Gradient";return n.hasOwnProperty(e)&&n[e].tagName.indexOf(t)>-1?r=this._gradients[e]:(r=this._createGraphicNode(i),this._defs||(this._defs=this._createGraphicNode("defs"),this._contentNode.appendChild(this._defs)),this._defs.appendChild(r),e=e||"gradient"+Math.round(1e5*Math.random()),r.setAttribute("id",e),n.hasOwnProperty(e)&&this._defs.removeChild(n[e]),n[e]=r),r},_toFront:function(t){var n=this._contentNode;t instanceof e.SVGShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this._contentNode,r;t instanceof e.SVGShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.SVGGraphic=a},"3.7.3",{requires:["graphics"]});
bundle/graphics-svg/graphics-svg.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -3451,4 +3451,4 @@ -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-vml-default/graphics-vml-default-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics-vml-default/graphics-vml-default.js", code: [] };-_yuitest_coverage["build/graphics-vml-default/graphics-vml-default.js"].code=["YUI.add('graphics-vml-default', function (Y, NAME) {","","Y.Graphic = Y.VMLGraphic;","Y.Shape = Y.VMLShape;","Y.Circle = Y.VMLCircle;","Y.Rect = Y.VMLRect;","Y.Ellipse = Y.VMLEllipse;","Y.Path = Y.VMLPath;","Y.Drawing = Y.VMLDrawing;","","","}, '3.7.2');"];+_yuitest_coverage["build/graphics-vml-default/graphics-vml-default.js"].code=["YUI.add('graphics-vml-default', function (Y, NAME) {","","Y.Graphic = Y.VMLGraphic;","Y.Shape = Y.VMLShape;","Y.Circle = Y.VMLCircle;","Y.Rect = Y.VMLRect;","Y.Ellipse = Y.VMLEllipse;","Y.Path = Y.VMLPath;","Y.Drawing = Y.VMLDrawing;","","","}, '3.7.3');"]; _yuitest_coverage["build/graphics-vml-default/graphics-vml-default.js"].lines = {"1":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0}; _yuitest_coverage["build/graphics-vml-default/graphics-vml-default.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/graphics-vml-default/graphics-vml-default.js"].coveredLines = 8;@@ -57,4 +57,4 @@ Y.Drawing = Y.VMLDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-vml-default/graphics-vml-default-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,4 +15,4 @@ Y.Drawing = Y.VMLDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-vml-default/graphics-vml-default-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics-vml-default",function(e,t){e.Graphic=e.VMLGraphic,e.Shape=e.VMLShape,e.Circle=e.VMLCircle,e.Rect=e.VMLRect,e.Ellipse=e.VMLEllipse,e.Path=e.VMLPath,e.Drawing=e.VMLDrawing},"3.7.2");+YUI.add("graphics-vml-default",function(e,t){e.Graphic=e.VMLGraphic,e.Shape=e.VMLShape,e.Circle=e.VMLCircle,e.Rect=e.VMLRect,e.Ellipse=e.VMLEllipse,e.Path=e.VMLPath,e.Drawing=e.VMLDrawing},"3.7.3");
bundle/graphics-vml-default/graphics-vml-default.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -15,4 +15,4 @@ Y.Drawing = Y.VMLDrawing; -}, '3.7.2');+}, '3.7.3');
bundle/graphics-vml/graphics-vml-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics-vml/graphics-vml.js", code: [] };-_yuitest_coverage["build/graphics-vml/graphics-vml.js"].code=["YUI.add('graphics-vml', function (Y, NAME) {","","var IMPLEMENTATION = \"vml\","," SHAPE = \"shape\","," SPLITPATHPATTERN = /[a-z][^a-z]*/ig,"," SPLITARGSPATTERN = /[-]?[0-9]*[0-9|\\.][0-9]*/g,"," Y_LANG = Y.Lang,"," IS_NUM = Y_LANG.isNumber,"," IS_ARRAY = Y_LANG.isArray,"," IS_STRING = Y_LANG.isString,"," Y_DOM = Y.DOM,"," Y_SELECTOR = Y.Selector,"," DOCUMENT = Y.config.doc,"," AttributeLite = Y.AttributeLite,"," VMLShape,"," VMLCircle,"," VMLPath,"," VMLRect,"," VMLEllipse,"," VMLGraphic,"," VMLPieSlice,"," _getClassName = Y.ClassNameManager.getClassName;","","function VMLDrawing() {}","","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Drawing.html\">`Drawing`</a> class. "," * `VMLDrawing` is not intended to be used directly. Instead, use the <a href=\"Drawing.html\">`Drawing`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Drawing.html\">`Drawing`</a> class will point to the `VMLDrawing` class."," *"," * @module graphics"," * @class VMLDrawing"," * @constructor"," */","VMLDrawing.prototype = {"," /**"," * Maps path to methods"," *"," * @property _pathSymbolToMethod"," * @type Object"," * @private"," */"," _pathSymbolToMethod: {"," M: \"moveTo\","," m: \"relativeMoveTo\","," L: \"lineTo\","," l: \"relativeLineTo\","," C: \"curveTo\","," c: \"relativeCurveTo\","," Q: \"quadraticCurveTo\","," q: \"relativeQuadraticCurveTo\","," z: \"closePath\","," Z: \"closePath\""," },",""," /**"," * Value for rounding up to coordsize"," *"," * @property _coordSpaceMultiplier"," * @type Number"," * @private"," */"," _coordSpaceMultiplier: 100,",""," /**"," * Rounds dimensions and position values based on the coordinate space."," *"," * @method _round"," * @param {Number} The value for rounding"," * @return Number"," * @private"," */"," _round:function(val)"," {"," return Math.round(val * this._coordSpaceMultiplier);"," },",""," /**"," * Concatanates the path."," *"," * @method _addToPath"," * @param {String} val The value to add to the path string."," * @private"," */"," _addToPath: function(val)"," {"," this._path = this._path || \"\";"," if(this._movePath)"," {"," this._path += this._movePath;"," this._movePath = null;"," }"," this._path += val;"," },",""," /**"," * Current x position of the drawing."," *"," * @property _currentX"," * @type Number"," * @private"," */"," _currentX: 0,",""," /**"," * Current y position of the drqwing."," *"," * @property _currentY"," * @type Number"," * @private"," */"," _currentY: 0,"," "," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," curveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a bezier curve."," *"," * @method relativeCurveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeCurveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), true]);"," },"," "," /**"," * Implements curveTo methods."," *"," * @method _curveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _curveTo: function(args, relative) {"," var w,"," h,"," x,"," y,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len,"," path,"," command = relative ? \" v \" : \" c \","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," len = args.length - 5;"," path = command; "," for(i = 0; i < len; i = i + 6)"," {"," cp1x = parseFloat(args[i]);"," cp1y = parseFloat(args[i + 1]);"," cp2x = parseFloat(args[i + 2]);"," cp2y = parseFloat(args[i + 3]);"," x = parseFloat(args[i + 4]);"," y = parseFloat(args[i + 5]);"," if(i > 0)"," {"," path = path + \", \";"," }"," path = path + this._round(cp1x) + \", \" + this._round(cp1y) + \", \" + this._round(cp2x) + \", \" + this._round(cp2y) + \", \" + this._round(x) + \", \" + this._round(y); "," cp1x = cp1x + relativeX;"," cp1y = cp1y + relativeY;"," cp2x = cp2x + relativeX;"," cp2y = cp2y + relativeY;"," x = x + relativeX;"," y = y + relativeY;"," right = Math.max(x, Math.max(cp1x, cp2x));"," bottom = Math.max(y, Math.max(cp1y, cp2y));"," left = Math.min(x, Math.min(cp1x, cp2x));"," top = Math.min(y, Math.min(cp1y, cp2y));"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cp1x, cp1y], [cp2x, cp2y], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," this._addToPath(path);"," },",""," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," quadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a quadratic bezier curve relative to the current position."," *"," * @method relativeQuadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeQuadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements quadraticCurveTo methods."," *"," * @method _quadraticCurveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _quadraticCurveTo: function(args, relative) {"," var cpx, "," cpy,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," x, "," y,"," currentX = this._currentX,"," currentY = this._currentY,"," i,"," len = args.length - 3,"," bezierArgs = [],"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," for(i = 0; i < len; i = i + 4)"," {"," cpx = parseFloat(args[i]) + relativeX;"," cpy = parseFloat(args[i + 1]) + relativeY;"," x = parseFloat(args[i + 2]) + relativeX;"," y = parseFloat(args[i + 3]) + relativeY;"," cp1x = currentX + 0.67*(cpx - currentX);"," cp1y = currentY + 0.67*(cpy - currentY);"," cp2x = cp1x + (x - currentX) * 0.34;"," cp2y = cp1y + (y - currentY) * 0.34;"," bezierArgs.push(cp1x);"," bezierArgs.push(cp1y);"," bezierArgs.push(cp2x);"," bezierArgs.push(cp2y);"," bezierArgs.push(x);"," bezierArgs.push(y);"," }"," this._curveTo.apply(this, [bezierArgs, false]);"," },",""," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," drawRect: function(x, y, w, h) {"," this.moveTo(x, y);"," this.lineTo(x + w, y);"," this.lineTo(x + w, y + h);"," this.lineTo(x, y + h);"," this.lineTo(x, y);"," this._currentX = x;"," this._currentY = y;"," return this;"," },",""," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," drawRoundRect: function(x, y, w, h, ew, eh) {"," this.moveTo(x, y + eh);"," this.lineTo(x, y + h - eh);"," this.quadraticCurveTo(x, y + h, x + ew, y + h);"," this.lineTo(x + w - ew, y + h);"," this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);"," this.lineTo(x + w, y + eh);"," this.quadraticCurveTo(x + w, y, x + w - ew, y);"," this.lineTo(x + ew, y);"," this.quadraticCurveTo(x, y, x, y + eh);"," return this;"," },",""," /**"," * Draws a circle. Used internally by `CanvasCircle` class."," *"," * @method drawCircle"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} r radius"," * @protected"," */"," drawCircle: function(x, y, radius) {"," var startAngle = 0,"," endAngle = 360,"," circum = radius * 2;",""," endAngle *= 65535;"," this._drawingComplete = false;"," this._trackSize(x + circum, y + circum);"," this.moveTo((x + circum), (y + radius));"," this._addToPath(\" ae \" + this._round(x + radius) + \", \" + this._round(y + radius) + \", \" + this._round(radius) + \", \" + this._round(radius) + \", \" + startAngle + \", \" + endAngle);"," return this;"," },"," "," /**"," * Draws an ellipse."," *"," * @method drawEllipse"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @protected"," */"," drawEllipse: function(x, y, w, h) {"," var startAngle = 0,"," endAngle = 360,"," radius = w * 0.5,"," yRadius = h * 0.5;"," endAngle *= 65535;"," this._drawingComplete = false;"," this._trackSize(x + w, y + h);"," this.moveTo((x + w), (y + yRadius));"," this._addToPath(\" ae \" + this._round(x + radius) + \", \" + this._round(x + radius) + \", \" + this._round(y + yRadius) + \", \" + this._round(radius) + \", \" + this._round(yRadius) + \", \" + startAngle + \", \" + endAngle);"," return this;"," },"," "," /**"," * Draws a diamond. "," * "," * @method drawDiamond"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} width width"," * @param {Number} height height"," * @protected"," */"," drawDiamond: function(x, y, width, height)"," {"," var midWidth = width * 0.5,"," midHeight = height * 0.5;"," this.moveTo(x + midWidth, y);"," this.lineTo(x + width, y + midHeight);"," this.lineTo(x + midWidth, y + height);"," this.lineTo(x, y + midHeight);"," this.lineTo(x + midWidth, y);"," return this;"," },",""," /**"," * Draws a wedge."," *"," * @method drawWedge"," * @param {Number} x x-coordinate of the wedge's center point"," * @param {Number} y y-coordinate of the wedge's center point"," * @param {Number} startAngle starting angle in degrees"," * @param {Number} arc sweep of the wedge. Negative values draw clockwise."," * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius."," * @param {Number} yRadius [optional] y radius for wedge."," * @private"," */"," drawWedge: function(x, y, startAngle, arc, radius)"," {"," var diameter = radius * 2;"," if(Math.abs(arc) > 360)"," {"," arc = 360;"," }"," this._currentX = x;"," this._currentY = y;"," startAngle *= -65535;"," arc *= 65536;"," startAngle = Math.round(startAngle);"," arc = Math.round(arc);"," this.moveTo(x, y);"," this._addToPath(\" ae \" + this._round(x) + \", \" + this._round(y) + \", \" + this._round(radius) + \" \" + this._round(radius) + \", \" + startAngle + \", \" + arc);"," this._trackSize(diameter, diameter); "," return this;"," },",""," /**"," * Draws a line segment from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," lineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a line segment using the current line style from the current drawing position to the relative x and y coordinates."," * "," * @method relativeLineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," relativeLineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements lineTo methods."," *"," * @method _lineTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _lineTo: function(args, relative) {"," var point1 = args[0],"," i,"," len,"," x,"," y,"," path = relative ? \" r \" : \" l \","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," if (typeof point1 == \"string\" || typeof point1 == \"number\") {"," len = args.length - 1;"," for (i = 0; i < len; i = i + 2) {"," x = parseFloat(args[i]);"," y = parseFloat(args[i + 1]);"," path += ' ' + this._round(x) + ', ' + this._round(y);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize.apply(this, [x, y]);"," }"," }"," else"," {"," len = args.length;"," for (i = 0; i < len; i = i + 1) {"," x = parseFloat(args[i][0]);"," y = parseFloat(args[i][1]);"," path += ' ' + this._round(x) + ', ' + this._round(y);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize.apply(this, [x, y]);"," }"," }"," this._addToPath(path);"," return this;"," },"," "," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," moveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Moves the current drawing position relative to specified x and y coordinates."," *"," * @method relativeMoveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeMoveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements moveTo methods."," *"," * @method _moveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _moveTo: function(args, relative) {"," var x = parseFloat(args[0]),"," y = parseFloat(args[1]),"," command = relative ? \" t \" : \" m \","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._movePath = command + this._round(x) + \", \" + this._round(y);"," x = x + relativeX;"," y = y + relativeY;"," this._trackSize(x, y);"," this._currentX = x;"," this._currentY = y;"," },",""," /**"," * Draws the graphic."," *"," * @method _draw"," * @private"," */"," _closePath: function()"," {"," var fill = this.get(\"fill\"),"," stroke = this.get(\"stroke\"),"," node = this.node,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," path = this._path,"," pathEnd = \"\","," multiplier = this._coordSpaceMultiplier;"," this._fillChangeHandler();"," this._strokeChangeHandler();"," if(path)"," {"," if(fill && fill.color)"," {"," pathEnd += ' x';"," }"," if(stroke)"," {"," pathEnd += ' e';"," }"," }"," if(path)"," {"," node.path = path + pathEnd;"," }"," if(!isNaN(w) && !isNaN(h))"," {"," node.coordOrigin = this._left + \", \" + this._top;"," node.coordSize = (w * multiplier) + \", \" + (h * multiplier);"," node.style.position = \"absolute\";"," node.style.width = w + \"px\";"," node.style.height = h + \"px\";"," }"," this._path = path;"," this._movePath = null;"," this._updateTransform();"," },",""," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function()"," {"," this._closePath();"," },",""," /**"," * Ends a fill and stroke"," *"," * @method closePath"," */"," closePath: function()"," {"," this._addToPath(\" x e\");"," },",""," /**"," * Clears the path."," *"," * @method clear"," */"," clear: function()"," {"," this._right = 0;"," this._bottom = 0;"," this._width = 0;"," this._height = 0;"," this._left = 0;"," this._top = 0;"," this._path = \"\";"," this._movePath = null;"," },"," "," /**"," * Returns the points on a curve"," *"," * @method getBezierData"," * @param Array points Array containing the begin, end and control points of a curve."," * @param Number t The value for incrementing the next set of points."," * @return Array"," * @private"," */"," getBezierData: function(points, t) { "," var n = points.length,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }"," return [ tmp[0][0], tmp[0][1] ]; "," },"," "," /**"," * Calculates the bounding box for a curve"," *"," * @method _setCurveBoundingBox"," * @param Array pts Array containing points for start, end and control points of a curve."," * @param Number w Width used to calculate the number of points to describe the curve."," * @param Number h Height used to calculate the number of points to describe the curve."," * @private"," */"," _setCurveBoundingBox: function(pts, w, h)"," {"," var i,"," left = this._currentX,"," right = left,"," top = this._currentY,"," bottom = top,"," len = Math.round(Math.sqrt((w * w) + (h * h))),"," t = 1/len,"," xy;"," for(i = 0; i < len; ++i)"," {"," xy = this.getBezierData(pts, t * i);"," left = isNaN(left) ? xy[0] : Math.min(xy[0], left);"," right = isNaN(right) ? xy[0] : Math.max(xy[0], right);"," top = isNaN(top) ? xy[1] : Math.min(xy[1], top);"," bottom = isNaN(bottom) ? xy[1] : Math.max(xy[1], bottom);"," }"," left = Math.round(left * 10)/10;"," right = Math.round(right * 10)/10;"," top = Math.round(top * 10)/10;"," bottom = Math.round(bottom * 10)/10;"," this._trackSize(right, bottom);"," this._trackSize(left, top);"," },",""," /**"," * Updates the size of the graphics object"," *"," * @method _trackSize"," * @param {Number} w width"," * @param {Number} h height"," * @private"," */"," _trackSize: function(w, h) {"," if (w > this._right) {"," this._right = w;"," }"," if(w < this._left)"," {"," this._left = w; "," }"," if (h < this._top)"," {"," this._top = h;"," }"," if (h > this._bottom) "," {"," this._bottom = h;"," }"," this._width = this._right - this._left;"," this._height = this._bottom - this._top;"," },",""," _left: 0,",""," _right: 0,",""," _top: 0,",""," _bottom: 0,",""," _width: 0,",""," _height: 0","};","Y.VMLDrawing = VMLDrawing;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Shape.html\">`Shape`</a> class. "," * `VMLShape` is not intended to be used directly. Instead, use the <a href=\"Shape.html\">`Shape`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Shape.html\">`Shape`</a> class will point to the `VMLShape` class."," *"," * @module graphics"," * @class VMLShape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */","VMLShape = function() ","{"," this._transforms = [];"," this.matrix = new Y.Matrix();"," this._normalizedMatrix = new Y.Matrix();"," VMLShape.superclass.constructor.apply(this, arguments);","};","","VMLShape.NAME = \"shape\";","","Y.extend(VMLShape, Y.GraphicBase, Y.mix({"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"shape\","," "," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," init: function()"," {"," this.initializer.apply(this, arguments);"," },",""," /**"," * Initializes the shape"," *"," * @private"," * @method _initialize"," */"," initializer: function(cfg)"," {"," var host = this,"," graphic = cfg.graphic,"," data = this.get(\"data\");"," host.createNode();"," if(graphic)"," {"," this._setGraphic(graphic);"," }"," if(data)"," {"," host._parsePathData(data);"," }"," this._updateHandler();"," },"," "," /**"," * Set the Graphic instance for the shape."," *"," * @method _setGraphic"," * @param {Graphic | Node | HTMLElement | String} render This param is used to determine the graphic instance. If it is a `Graphic` instance, it will be assigned"," * to the `graphic` attribute. Otherwise, a new Graphic instance will be created and rendered into the dom element that the render represents."," * @private"," */"," _setGraphic: function(render)"," {"," var graphic;"," if(render instanceof Y.VMLGraphic)"," {"," this._graphic = render;"," }"," else"," {"," render = Y.one(render);"," graphic = new Y.VMLGraphic({"," render: render"," });"," graphic._appendShape(this);"," this._graphic = graphic;"," this._appendStrokeAndFill();"," }"," },"," "," /**"," * Appends fill and stroke nodes to the shape."," *"," * @method _appendStrokeAndFill"," * @private"," */"," _appendStrokeAndFill: function()"," {"," if(this._strokeNode)"," {"," this.node.appendChild(this._strokeNode);"," }"," if(this._fillNode)"," {"," this.node.appendChild(this._fillNode);"," }"," },"," "," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var node,"," concat = this._camelCaseConcat,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," id,"," type,"," name = this.name,"," nodestring,"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\","," strokestring,"," classString,"," stroke,"," endcap,"," opacity,"," joinstyle,"," miterlimit,"," dashstyle,"," fill,"," fillstring;"," id = this.get(\"id\");"," type = this._type == \"path\" ? \"shape\" : this._type;"," classString = _getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name)) + \" \" + IMPLEMENTATION + type; "," stroke = this._getStrokeProps();"," fill = this._getFillProps();"," "," nodestring = '<' + type + ' xmlns=\"urn:schemas-microsft.com:vml\" id=\"' + id + '\" class=\"' + classString + '\" style=\"behavior:url(#default#VML);display:inline-block;position:absolute;left:' + x + 'px;top:' + y + 'px;width:' + w + 'px;height:' + h + 'px;visibility:' + visibility + '\"';",""," if(stroke && stroke.weight && stroke.weight > 0)"," {"," endcap = stroke.endcap;"," opacity = parseFloat(stroke.opacity);"," joinstyle = stroke.joinstyle;"," miterlimit = stroke.miterlimit;"," dashstyle = stroke.dashstyle;"," nodestring += ' stroked=\"t\" strokecolor=\"' + stroke.color + '\" strokeWeight=\"' + stroke.weight + 'px\"';"," "," strokestring = '<stroke class=\"vmlstroke\" xmlns=\"urn:schemas-microsft.com:vml\" on=\"t\" style=\"behavior:url(#default#VML);display:inline-block;\"';"," strokestring += ' opacity=\"' + opacity + '\"';"," if(endcap)"," {"," strokestring += ' endcap=\"' + endcap + '\"';"," }"," if(joinstyle)"," {"," strokestring += ' joinstyle=\"' + joinstyle + '\"';"," }"," if(miterlimit)"," {"," strokestring += ' miterlimit=\"' + miterlimit + '\"';"," }"," if(dashstyle)"," {"," strokestring += ' dashstyle=\"' + dashstyle + '\"';"," }"," strokestring += '></stroke>';"," this._strokeNode = DOCUMENT.createElement(strokestring);"," nodestring += ' stroked=\"t\"';"," }"," else"," {"," nodestring += ' stroked=\"f\"';"," }"," if(fill)"," {"," if(fill.node)"," {"," fillstring = fill.node;"," this._fillNode = DOCUMENT.createElement(fillstring);"," }"," if(fill.color)"," {"," nodestring += ' fillcolor=\"' + fill.color + '\"';"," }"," nodestring += ' filled=\"' + fill.filled + '\"';"," }"," "," "," nodestring += '>';"," nodestring += '</' + type + '>';"," "," node = DOCUMENT.createElement(nodestring);",""," this.node = node;"," this._strokeFlag = false;"," this._fillFlag = false;"," },",""," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," addClass: function(className)"," {"," var node = this.node;"," Y_DOM.addClass(node, className);"," },",""," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," removeClass: function(className)"," {"," var node = this.node;"," Y_DOM.removeClass(node, className);"," },",""," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY(),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," return [parentXY[0] + x, parentXY[1] + y];"," },",""," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," *"," */"," setXY: function(xy)"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY();"," this.set(\"x\", xy[0] - parentXY[0]);"," this.set(\"y\", xy[1] - parentXY[1]);"," },",""," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {VMLShape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," contains: function(needle)"," {"," return needle === Y.one(this.node);"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this.node;",""," return node === refNode;"," },",""," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," test: function(selector)"," {"," return Y_SELECTOR.test(this.node, selector);"," },",""," /**"," * Calculates and returns properties for setting an initial stroke."," *"," * @method _getStrokeProps"," * @return Object"," *"," * @private"," */"," _getStrokeProps: function()"," {"," var props,"," stroke = this.get(\"stroke\"),"," strokeOpacity,"," dashstyle,"," dash = \"\","," val,"," i = 0,"," len,"," linecap,"," linejoin;"," if(stroke && stroke.weight && stroke.weight > 0)"," {"," props = {};"," linecap = stroke.linecap || \"flat\";"," linejoin = stroke.linejoin || \"round\";"," if(linecap != \"round\" && linecap != \"square\")"," {"," linecap = \"flat\";"," }"," strokeOpacity = parseFloat(stroke.opacity);"," dashstyle = stroke.dashstyle || \"none\";"," stroke.color = stroke.color || \"#000000\";"," stroke.weight = stroke.weight || 1;"," stroke.opacity = IS_NUM(strokeOpacity) ? strokeOpacity : 1;"," props.stroked = true;"," props.color = stroke.color;"," props.weight = stroke.weight;"," props.endcap = linecap;"," props.opacity = stroke.opacity;"," if(IS_ARRAY(dashstyle))"," {"," dash = [];"," len = dashstyle.length;"," for(i = 0; i < len; ++i)"," {"," val = dashstyle[i];"," dash[i] = val / stroke.weight;"," }"," }"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," props.joinstyle = linejoin;"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(IS_NUM(linejoin))"," {"," props.miterlimit = Math.max(linejoin, 1);"," props.joinstyle = \"miter\";"," }"," }"," props.dashstyle = dash;"," }"," return props;"," },",""," /**"," * Adds a stroke to the shape node."," *"," * @method _strokeChangeHandler"," * @private"," */"," _strokeChangeHandler: function(e)"," {"," if(!this._strokeFlag)"," {"," return;"," }"," var node = this.node,"," stroke = this.get(\"stroke\"),"," strokeOpacity,"," dashstyle,"," dash = \"\","," val,"," i = 0,"," len,"," linecap,"," linejoin;"," if(stroke && stroke.weight && stroke.weight > 0)"," {"," linecap = stroke.linecap || \"flat\";"," linejoin = stroke.linejoin || \"round\";"," if(linecap != \"round\" && linecap != \"square\")"," {"," linecap = \"flat\";"," }"," strokeOpacity = parseFloat(stroke.opacity);"," dashstyle = stroke.dashstyle || \"none\";"," stroke.color = stroke.color || \"#000000\";"," stroke.weight = stroke.weight || 1;"," stroke.opacity = IS_NUM(strokeOpacity) ? strokeOpacity : 1;"," node.stroked = true;"," node.strokeColor = stroke.color;"," node.strokeWeight = stroke.weight + \"px\";"," if(!this._strokeNode)"," {"," this._strokeNode = this._createGraphicNode(\"stroke\");"," node.appendChild(this._strokeNode);"," }"," this._strokeNode.endcap = linecap;"," this._strokeNode.opacity = stroke.opacity;"," if(IS_ARRAY(dashstyle))"," {"," dash = [];"," len = dashstyle.length;"," for(i = 0; i < len; ++i)"," {"," val = dashstyle[i];"," dash[i] = val / stroke.weight;"," }"," }"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," this._strokeNode.joinstyle = linejoin;"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(IS_NUM(linejoin))"," {"," this._strokeNode.miterlimit = Math.max(linejoin, 1);"," this._strokeNode.joinstyle = \"miter\";"," }"," }"," this._strokeNode.dashstyle = dash;"," this._strokeNode.on = true;"," }"," else"," {"," if(this._strokeNode)"," {"," this._strokeNode.on = false;"," }"," node.stroked = false;"," }"," this._strokeFlag = false;"," },",""," /**"," * Calculates and returns properties for setting an initial fill."," *"," * @method _getFillProps"," * @return Object"," *"," * @private"," */"," _getFillProps: function()"," {"," var fill = this.get(\"fill\"),"," fillOpacity,"," props,"," gradient,"," i,"," fillstring,"," filled = false;"," if(fill)"," {"," props = {};"," "," if(fill.type == \"radial\" || fill.type == \"linear\")"," {"," fillOpacity = parseFloat(fill.opacity);"," fillOpacity = IS_NUM(fillOpacity) ? fillOpacity : 1;"," filled = true;"," gradient = this._getGradientFill(fill);"," fillstring = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\" opacity=\"' + fillOpacity + '\"';"," for(i in gradient)"," {"," if(gradient.hasOwnProperty(i))"," {"," fillstring += ' ' + i + '=\"' + gradient[i] + '\"';"," }"," }"," fillstring += ' />';"," props.node = fillstring;"," }"," else if(fill.color)"," {"," fillOpacity = parseFloat(fill.opacity);"," filled = true;"," props.color = fill.color;"," if(IS_NUM(fillOpacity))"," {"," fillOpacity = Math.max(Math.min(fillOpacity, 1), 0);"," props.opacity = fillOpacity; "," if(fillOpacity < 1)"," {"," props.node = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\" type=\"solid\" opacity=\"' + fillOpacity + '\"/>';"," }"," }"," }"," props.filled = filled;"," }"," return props;"," },",""," /**"," * Adds a fill to the shape node."," *"," * @method _fillChangeHandler"," * @private"," */"," _fillChangeHandler: function(e)"," {"," if(!this._fillFlag)"," {"," return;"," }"," var node = this.node,"," fill = this.get(\"fill\"),"," fillOpacity,"," fillstring,"," filled = false,"," i,"," gradient;"," if(fill)"," {"," if(fill.type == \"radial\" || fill.type == \"linear\")"," {"," filled = true;"," gradient = this._getGradientFill(fill);"," if(this._fillNode)"," {"," for(i in gradient)"," {"," if(gradient.hasOwnProperty(i))"," {"," if(i == \"colors\")"," {"," this._fillNode.colors.value = gradient[i];"," }"," else"," {"," this._fillNode[i] = gradient[i];"," }"," }"," }"," }"," else"," {"," fillstring = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\"';"," for(i in gradient)"," {"," if(gradient.hasOwnProperty(i))"," {"," fillstring += ' ' + i + '=\"' + gradient[i] + '\"';"," }"," }"," fillstring += ' />';"," this._fillNode = DOCUMENT.createElement(fillstring);"," node.appendChild(this._fillNode);"," }"," }"," else if(fill.color)"," {"," node.fillcolor = fill.color;"," fillOpacity = parseFloat(fill.opacity);"," filled = true;"," if(IS_NUM(fillOpacity) && fillOpacity < 1)"," {"," fill.opacity = fillOpacity;"," if(this._fillNode)"," {"," if(this._fillNode.getAttribute(\"type\") != \"solid\")"," {"," this._fillNode.type = \"solid\";"," }"," this._fillNode.opacity = fillOpacity;"," }"," else"," { "," fillstring = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\" type=\"solid\" opacity=\"' + fillOpacity + '\"/>';"," this._fillNode = DOCUMENT.createElement(fillstring);"," node.appendChild(this._fillNode);"," }"," }"," else if(this._fillNode)"," { "," this._fillNode.opacity = 1;"," this._fillNode.type = \"solid\";"," }"," }"," }"," node.filled = filled;"," this._fillFlag = false;"," },",""," //not used. remove next release."," _updateFillNode: function(node)"," {"," if(!this._fillNode)"," {"," this._fillNode = this._createGraphicNode(\"fill\");"," node.appendChild(this._fillNode);"," }"," },",""," /**"," * Calculates and returns an object containing gradient properties for a fill node. "," *"," * @method _getGradientFill"," * @param {Object} fill Object containing fill properties."," * @return Object"," * @private"," */"," _getGradientFill: function(fill)"," {"," var gradientProps = {},"," gradientBoxWidth,"," gradientBoxHeight,"," type = fill.type,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," isNumber = IS_NUM,"," stop,"," stops = fill.stops,"," len = stops.length,"," opacity,"," color,"," i,"," oi,"," colorstring = \"\","," cx = fill.cx,"," cy = fill.cy,"," fx = fill.fx,"," fy = fill.fy,"," r = fill.r,"," pct,"," rotation = fill.rotation || 0;"," if(type === \"linear\")"," {"," if(rotation <= 270)"," {"," rotation = Math.abs(rotation - 270);"," }"," else if(rotation < 360)"," {"," rotation = 270 + (360 - rotation);"," }"," else"," {"," rotation = 270;"," }"," gradientProps.type = \"gradient\";//\"gradientunscaled\";"," gradientProps.angle = rotation;"," }"," else if(type === \"radial\")"," {"," gradientBoxWidth = w * (r * 2);"," gradientBoxHeight = h * (r * 2);"," fx = r * 2 * (fx - 0.5);"," fy = r * 2 * (fy - 0.5);"," fx += cx;"," fy += cy;"," gradientProps.focussize = (gradientBoxWidth/w)/10 + \"% \" + (gradientBoxHeight/h)/10 + \"%\";"," gradientProps.alignshape = false;"," gradientProps.type = \"gradientradial\";"," gradientProps.focus = \"100%\";"," gradientProps.focusposition = Math.round(fx * 100) + \"% \" + Math.round(fy * 100) + \"%\";"," }"," for(i = 0;i < len; ++i) {"," stop = stops[i];"," color = stop.color;"," opacity = stop.opacity;"," opacity = isNumber(opacity) ? opacity : 1;"," pct = stop.offset || i/(len-1);"," pct *= (r * 2);"," pct = Math.round(100 * pct) + \"%\";"," oi = i > 0 ? i + 1 : \"\";"," gradientProps[\"opacity\" + oi] = opacity + \"\";"," colorstring += \", \" + pct + \" \" + color;"," }"," if(parseFloat(pct) < 100)"," {"," colorstring += \", 100% \" + color;"," }"," gradientProps.colors = colorstring.substr(2);"," return gradientProps;"," },",""," /**"," * Adds a transform to the shape."," *"," * @method _addTransform"," * @param {String} type The transform being applied."," * @param {Array} args The arguments for the transform."," * @private"," */"," _addTransform: function(type, args)"," {"," args = Y.Array(args);"," this._transform = Y_LANG.trim(this._transform + \" \" + type + \"(\" + args.join(\", \") + \")\");"," args.unshift(type);"," this._transforms.push(args);"," if(this.initialized)"," {"," this._updateTransform();"," }"," },"," "," /**"," * Applies all transforms."," *"," * @method _updateTransform"," * @private"," */"," _updateTransform: function()"," {"," var node = this.node,"," key,"," transform,"," transformOrigin,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," tx,"," ty,"," matrix = this.matrix,"," normalizedMatrix = this._normalizedMatrix,"," isPathShape = this instanceof Y.VMLPath,"," i,"," len = this._transforms.length;"," if(this._transforms && this._transforms.length > 0)"," {"," transformOrigin = this.get(\"transformOrigin\");"," "," if(isPathShape)"," {"," normalizedMatrix.translate(this._left, this._top);"," }"," //vml skew matrix transformOrigin ranges from -0.5 to 0.5."," //subtract 0.5 from values"," tx = transformOrigin[0] - 0.5;"," ty = transformOrigin[1] - 0.5;"," "," //ensure the values are within the appropriate range to avoid errors"," tx = Math.max(-0.5, Math.min(0.5, tx));"," ty = Math.max(-0.5, Math.min(0.5, ty));"," for(i = 0; i < len; ++i)"," {"," key = this._transforms[i].shift();"," if(key)"," {"," normalizedMatrix[key].apply(normalizedMatrix, this._transforms[i]); "," matrix[key].apply(matrix, this._transforms[i]); "," }"," }"," if(isPathShape)"," {"," normalizedMatrix.translate(-this._left, -this._top);"," }"," transform = normalizedMatrix.a + \",\" + "," normalizedMatrix.c + \",\" + "," normalizedMatrix.b + \",\" + "," normalizedMatrix.d + \",\" + "," 0 + \",\" +"," 0;"," }"," this._graphic.addToRedrawQueue(this); "," if(transform)"," {"," if(!this._skew)"," {"," this._skew = DOCUMENT.createElement( '<skew class=\"vmlskew\" xmlns=\"urn:schemas-microsft.com:vml\" on=\"false\" style=\"behavior:url(#default#VML);display:inline-block;\" />');"," this.node.appendChild(this._skew); "," }"," this._skew.matrix = transform;"," this._skew.on = true;"," //this._skew.offset = this._getSkewOffsetValue(normalizedMatrix.dx) + \"px, \" + this._getSkewOffsetValue(normalizedMatrix.dy) + \"px\";"," this._skew.origin = tx + \", \" + ty;"," }"," if(this._type != \"path\")"," {"," this._transforms = [];"," }"," //add the translate to the x and y coordinates"," node.style.left = (x + this._getSkewOffsetValue(normalizedMatrix.dx)) + \"px\";"," node.style.top = (y + this._getSkewOffsetValue(normalizedMatrix.dy)) + \"px\";"," },"," "," /**"," * Normalizes the skew offset values between -32767 and 32767."," *"," * @method _getSkewOffsetValue"," * @param {Number} val The value to normalize"," * @return Number"," * @private"," */"," _getSkewOffsetValue: function(val)"," {"," var sign = Y.MatrixUtil.sign(val),"," absVal = Math.abs(val);"," val = Math.min(absVal, 32767) * sign;"," return val;"," },"," "," /**"," * Storage for translateX"," *"," * @property _translateX"," * @type Number"," * @private"," */"," _translateX: 0,",""," /**"," * Storage for translateY"," *"," * @property _translateY"," * @type Number"," * @private"," */"," _translateY: 0,"," "," /**"," * Storage for the transform attribute."," *"," * @property _transform"," * @type String"," * @private"," */"," _transform: \"\","," "," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to translate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y)"," {"," this._translateX += x;"," this._translateY += y;"," this._addTransform(\"translate\", arguments);"," },",""," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," translateX: function(x)"," {"," this._translateX += x;"," this._addTransform(\"translateX\", arguments);"," },",""," /**"," * Performs a translate on the y-coordinate. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," translateY: function(y)"," {"," this._translateY += y;"," this._addTransform(\"translateY\", arguments);"," },",""," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y)"," {"," this._addTransform(\"skew\", arguments);"," },",""," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x)"," {"," this._addTransform(\"skewX\", arguments);"," },",""," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y)"," {"," this._addTransform(\"skewY\", arguments);"," },",""," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg)"," {"," this._addTransform(\"rotate\", arguments);"," },",""," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y)"," {"," this._addTransform(\"scale\", arguments);"," },",""," /**"," * Overrides default `on` method. Checks to see if its a dom interaction event. If so, "," * return an event attached to the `node` element. If not, return the normal functionality."," *"," * @method on"," * @param {String} type event type"," * @param {Object} callback function"," * @private"," */"," on: function(type, fn)"," {"," if(Y.Node.DOM_EVENTS[type])"," {"," return Y.one(\"#\" + this.get(\"id\")).on(type, fn);"," }"," return Y.on.apply(this, arguments);"," },",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," },",""," /**"," * Updates `Shape` based on attribute changes."," *"," * @method _updateHandler"," * @private"," */"," _updateHandler: function(e)"," {"," var host = this,"," node = host.node;"," host._fillChangeHandler();"," host._strokeChangeHandler();"," node.style.width = this.get(\"width\") + \"px\";"," node.style.height = this.get(\"height\") + \"px\"; "," this._draw();"," host._updateTransform();"," },",""," /**"," * Creates a graphic node"," *"," * @method _createGraphicNode"," * @param {String} type node type to create"," * @return HTMLElement"," * @private"," */"," _createGraphicNode: function(type)"," {"," type = type || this._type;"," return DOCUMENT.createElement('<' + type + ' xmlns=\"urn:schemas-microsft.com:vml\" style=\"behavior:url(#default#VML);display:inline-block;\" class=\"vml' + type + '\"/>');"," },",""," /**"," * Value function for fill attribute"," *"," * @private"," * @method _getDefaultFill"," * @return Object"," */"," _getDefaultFill: function() {"," return {"," type: \"solid\","," opacity: 1,"," cx: 0.5,"," cy: 0.5,"," fx: 0.5,"," fy: 0.5,"," r: 0.5"," };"," },",""," /**"," * Value function for stroke attribute"," *"," * @private"," * @method _getDefaultStroke"," * @return Object"," */"," _getDefaultStroke: function() "," {"," return {"," weight: 1,"," dashstyle: \"none\","," color: \"#000\","," opacity: 1.0"," };"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function() "," {"," var host = this;"," AttributeLite.prototype.set.apply(host, arguments);"," if(host.initialized)"," {"," host._updateHandler();"," }"," },",""," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," getBounds: function()"," {"," var isPathShape = this instanceof Y.VMLPath,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," if(isPathShape)"," {"," x = x + this._left;"," y = y + this._top;"," w = this._right - this._left;"," h = this._bottom - this._top;"," }"," return this._getContentRect(w, h, x, y);"," },",""," /**"," * Calculates the bounding box for the shape."," *"," * @method _getContentRect"," * @param {Number} w width of the shape"," * @param {Number} h height of the shape"," * @param {Number} x x-coordinate of the shape"," * @param {Number} y y-coordinate of the shape"," * @private"," */"," _getContentRect: function(w, h, x, y)"," {"," var transformOrigin = this.get(\"transformOrigin\"),"," transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h,"," transforms = this.matrix.getTransformArray(this.get(\"transform\")),"," matrix = new Y.Matrix(),"," i,"," len = transforms.length,"," transform,"," key,"," contentRect,"," isPathShape = this instanceof Y.VMLPath;"," if(isPathShape)"," {"," matrix.translate(this._left, this._top);"," }"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," for(i = 0; i < len; i = i + 1)"," {"," transform = transforms[i];"," key = transform.shift();"," if(key)"," {"," matrix[key].apply(matrix, transform); "," }"," }"," matrix.translate(-transformX, -transformY);"," if(isPathShape)"," {"," matrix.translate(-this._left, -this._top);"," }"," contentRect = matrix.getContentRect(w, h, x, y);"," return contentRect;"," },",""," /**"," * Places the shape above all other shapes."," *"," * @method toFront"," */"," toFront: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toFront(this);"," }"," },",""," /**"," * Places the shape underneath all other shapes."," *"," * @method toFront"," */"," toBack: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toBack(this);"," }"," },",""," /**"," * Parses path data string and call mapped methods."," *"," * @method _parsePathData"," * @param {String} val The path data"," * @private"," */"," _parsePathData: function(val)"," {"," var method,"," methodSymbol,"," args,"," commandArray = Y.Lang.trim(val.match(SPLITPATHPATTERN)),"," i,"," len, "," str,"," symbolToMethod = this._pathSymbolToMethod;"," if(commandArray)"," {"," this.clear();"," len = commandArray.length || 0;"," for(i = 0; i < len; i = i + 1)"," {"," str = commandArray[i];"," methodSymbol = str.substr(0, 1);"," args = str.substr(1).match(SPLITARGSPATTERN);"," method = symbolToMethod[methodSymbol];"," if(method)"," {"," if(args)"," {"," this[method].apply(this, args);"," }"," else"," {"," this[method].apply(this);"," }"," }"," }"," this.end();"," }"," },"," "," /**"," * Destroys shape"," *"," * @method destroy"," */"," destroy: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic.removeShape(this);"," }"," else"," {"," this._destroy();"," }"," },",""," /**"," * Implementation for shape destruction"," *"," * @method destroy"," * @protected"," */"," _destroy: function()"," {"," if(this.node)"," { "," if(this._fillNode)"," {"," this.node.removeChild(this._fillNode);"," this._fillNode = null;"," }"," if(this._strokeNode)"," {"," this.node.removeChild(this._strokeNode);"," this._strokeNode = null;"," }"," Y.one(this.node).remove(true);"," }"," }","}, Y.VMLDrawing.prototype));","","VMLShape.ATTRS = {"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," transformOrigin: {"," valueFn: function()"," {"," return [0.5, 0.5];"," }"," },"," "," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd> "," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," transform: {"," setter: function(val)"," {"," var i,"," len,"," transform;"," this.matrix.init(); "," this._normalizedMatrix.init(); "," this._transforms = this.matrix.getTransformArray(val);"," len = this._transforms.length;"," for(i = 0;i < len; ++i)"," {"," transform = this._transforms[i];"," }"," this._transform = val;"," return val;"," },",""," getter: function()"," {"," return this._transform;"," }"," },",""," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," x: {"," value: 0"," },",""," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," y: {"," value: 0"," },",""," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },"," "," /**"," * "," * @config width"," */"," width: {"," value: 0"," },",""," /**"," * "," * @config height"," */"," height: {"," value: 0"," },",""," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val){"," var node = this.node,"," visibility = val ? \"visible\" : \"hidden\";"," if(node)"," {"," node.style.visibility = visibility;"," }"," return val;"," }"," },",""," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * </dl>"," * <p>The corresponding `SVGShape` class implements the following additional properties.</p>"," * <dl>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * </dl>"," * <p>These properties are not currently implemented in `CanvasShape` or `VMLShape`.</p> "," *"," * @config fill"," * @type Object "," */"," fill: {"," valueFn: \"_getDefaultFill\","," "," setter: function(val)"," {"," var i,"," fill,"," tmpl = this.get(\"fill\") || this._getDefaultFill();"," "," if(val)"," {"," //ensure, fill type is solid if color is explicitly passed."," if(val.hasOwnProperty(\"color\"))"," {"," val.type = \"solid\";"," }"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," { "," tmpl[i] = val[i];"," }"," }"," }"," fill = tmpl;"," if(fill && fill.color)"," {"," if(fill.color === undefined || fill.color == \"none\")"," {"," fill.color = null;"," }"," }"," this._fillFlag = true;"," return fill;"," }"," },",""," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," stroke: {"," valueFn: \"_getDefaultStroke\","," "," setter: function(val)"," {"," var i,"," stroke,"," wt,"," tmpl = this.get(\"stroke\") || this._getDefaultStroke();"," if(val)"," {"," if(val.hasOwnProperty(\"weight\"))"," {"," wt = parseInt(val.weight, 10);"," if(!isNaN(wt))"," {"," val.weight = wt;"," }"," }"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," { "," tmpl[i] = val[i];"," }"," }"," }"," stroke = tmpl;"," this._strokeFlag = true;"," return stroke;"," }"," },"," "," //Not used. Remove in future."," autoSize: {"," value: false"," },",""," // Only implemented in SVG"," // Determines whether the instance will receive mouse events."," // "," // @config pointerEvents"," // @type string"," //"," pointerEvents: {"," value: \"visiblePainted\""," },",""," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this.node;"," }"," },",""," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," data: {"," setter: function(val)"," {"," if(this.get(\"node\"))"," {"," this._parsePathData(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the container Graphic."," *"," * @config graphic"," * @type Graphic"," */"," graphic: {"," readOnly: true,",""," getter: function()"," {"," return this._graphic;"," }"," }","};","Y.VMLShape = VMLShape;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Path.html\">`Path`</a> class. "," * `VMLPath` is not intended to be used directly. Instead, use the <a href=\"Path.html\">`Path`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Path.html\">`Path`</a> class will point to the `VMLPath` class."," *"," * @module graphics"," * @class VMLPath"," * @extends VMLShape"," */","VMLPath = function()","{"," VMLPath.superclass.constructor.apply(this, arguments);","};","","VMLPath.NAME = \"path\";","Y.extend(VMLPath, Y.VMLShape);","VMLPath.ATTRS = Y.merge(Y.VMLShape.ATTRS, {"," /**"," * Indicates the width of the shape"," * "," * @config width"," * @type Number"," */"," width: {"," getter: function()"," {"," var val = Math.max(this._right - this._left, 0);"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," height: {"," getter: function()"," {"," return Math.max(this._bottom - this._top, 0);"," }"," },"," "," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," return this._path;"," }"," }","});","Y.VMLPath = VMLPath;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Rect.html\">`Rect`</a> class. "," * `VMLRect` is not intended to be used directly. Instead, use the <a href=\"Rect.html\">`Rect`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Rect.html\">`Rect`</a> class will point to the `VMLRect` class."," *"," * @module graphics"," * @class VMLRect"," * @constructor"," */","VMLRect = function()","{"," VMLRect.superclass.constructor.apply(this, arguments);","};","VMLRect.NAME = \"rect\"; ","Y.extend(VMLRect, Y.VMLShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"rect\"","});","VMLRect.ATTRS = Y.VMLShape.ATTRS;","Y.VMLRect = VMLRect;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * `VMLEllipse` is not intended to be used directly. Instead, use the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Ellipse.html\">`Ellipse`</a> class will point to the `VMLEllipse` class."," *"," * @module graphics"," * @class VMLEllipse"," * @constructor"," */","VMLEllipse = function()","{"," VMLEllipse.superclass.constructor.apply(this, arguments);","};","","VMLEllipse.NAME = \"ellipse\";","","Y.extend(VMLEllipse, Y.VMLShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"oval\"","});","VMLEllipse.ATTRS = Y.merge(Y.VMLShape.ATTRS, {"," /**"," * Horizontal radius for the ellipse. "," *"," * @config xRadius"," * @type Number"," */"," xRadius: {"," lazyAdd: false,",""," getter: function()"," {"," var val = this.get(\"width\");"," val = Math.round((val/2) * 100)/100;"," return val;"," },"," "," setter: function(val)"," {"," var w = val * 2; "," this.set(\"width\", w);"," return val;"," }"," },",""," /**"," * Vertical radius for the ellipse. "," *"," * @config yRadius"," * @type Number"," * @readOnly"," */"," yRadius: {"," lazyAdd: false,"," "," getter: function()"," {"," var val = this.get(\"height\");"," val = Math.round((val/2) * 100)/100;"," return val;"," },",""," setter: function(val)"," {"," var h = val * 2;"," this.set(\"height\", h);"," return val;"," }"," }","});","Y.VMLEllipse = VMLEllipse;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Circle.html\">`Circle`</a> class. "," * `VMLCircle` is not intended to be used directly. Instead, use the <a href=\"Circle.html\">`Circle`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Circle.html\">`Circle`</a> class will point to the `VMLCircle` class."," *"," * @module graphics"," * @class VMLCircle"," * @constructor"," */","VMLCircle = function(cfg)","{"," VMLCircle.superclass.constructor.apply(this, arguments);","};","","VMLCircle.NAME = \"circle\";","","Y.extend(VMLCircle, VMLShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"oval\"","});","","VMLCircle.ATTRS = Y.merge(VMLShape.ATTRS, {"," /**"," * Radius for the circle."," *"," * @config radius"," * @type Number"," */"," radius: {"," lazyAdd: false,",""," value: 0"," },",""," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," { "," var radius = this.get(\"radius\"),"," val = radius && radius > 0 ? radius * 2 : 0;"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," { "," var radius = this.get(\"radius\"),"," val = radius && radius > 0 ? radius * 2 : 0;"," return val;"," }"," }","});","Y.VMLCircle = VMLCircle;","/**"," * Draws pie slices"," *"," * @module graphics"," * @class VMLPieSlice"," * @constructor"," */","VMLPieSlice = function()","{"," VMLPieSlice.superclass.constructor.apply(this, arguments);","};","VMLPieSlice.NAME = \"vmlPieSlice\";","Y.extend(VMLPieSlice, Y.VMLShape, Y.mix({"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"shape\",",""," /**"," * Change event listener"," *"," * @private"," * @method _updateHandler"," */"," _draw: function(e)"," {"," var x = this.get(\"cx\"),"," y = this.get(\"cy\"),"," startAngle = this.get(\"startAngle\"),"," arc = this.get(\"arc\"),"," radius = this.get(\"radius\");"," this.clear();"," this.drawWedge(x, y, startAngle, arc, radius);"," this.end();"," }"," }, Y.VMLDrawing.prototype));","VMLPieSlice.ATTRS = Y.mix({"," cx: {"," value: 0"," },",""," cy: {"," value: 0"," },"," /**"," * Starting angle in relation to a circle in which to begin the pie slice drawing."," *"," * @config startAngle"," * @type Number"," */"," startAngle: {"," value: 0"," },",""," /**"," * Arc of the slice."," *"," * @config arc"," * @type Number"," */"," arc: {"," value: 0"," },",""," /**"," * Radius of the circle in which the pie slice is drawn"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","}, Y.VMLShape.ATTRS);","Y.VMLPieSlice = VMLPieSlice;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * `VMLGraphic` is not intended to be used directly. Instead, use the <a href=\"Graphic.html\">`Graphic`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Graphic.html\">`Graphic`</a> class will point to the `VMLGraphic` class."," *"," * @module graphics"," * @class VMLGraphic"," * @constructor"," */","VMLGraphic = function() {"," VMLGraphic.superclass.constructor.apply(this, arguments); ","};","","VMLGraphic.NAME = \"vmlGraphic\";","","VMLGraphic.ATTRS = {"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," render: {},"," "," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this._node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," shapes: {"," readOnly: true,",""," getter: function()"," {"," return this._shapes;"," }"," },",""," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object"," */"," contentBounds: {"," readOnly: true,",""," getter: function()"," {"," return this._contentBounds;"," }"," },",""," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this._node;"," }"," },",""," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.width = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," height: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.height = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," autoSize: {"," value: false"," },",""," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," preserveAspectRatio: {"," value: \"xMidYMid\""," },",""," /**"," * The contentBounds will resize to greater values but not values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," resizeDown: {"," resizeDown: false"," },",""," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," this._x = val;"," if(this._node)"," {"," this._node.style.left = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," this._y = val;"," if(this._node)"," {"," this._node.style.top = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," autoDraw: {"," value: true"," },",""," visible: {"," value: true,",""," setter: function(val)"," {"," this._toggleVisible(val);"," return val;"," }"," }","};","","Y.extend(VMLGraphic, Y.GraphicBase, {"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, value) "," {"," var host = this,"," redrawAttrs = {"," autoDraw: true,"," autoSize: true,"," preserveAspectRatio: true,"," resizeDown: true"," },"," key,"," forceRedraw = false;"," AttributeLite.prototype.set.apply(host, arguments); "," if(host._state.autoDraw === true && Y.Object.size(this._shapes) > 0)"," {"," if(Y_LANG.isString && redrawAttrs[attr])"," {"," forceRedraw = true;"," }"," else if(Y_LANG.isObject(attr))"," {"," for(key in redrawAttrs)"," {"," if(redrawAttrs.hasOwnProperty(key) && attr[key])"," {"," forceRedraw = true;"," break;"," }"," }"," }"," }"," if(forceRedraw)"," {"," host._redraw();"," }"," },",""," /**"," * Storage for `x` attribute."," *"," * @property _x"," * @type Number"," * @private"," */"," _x: 0,",""," /**"," * Storage for `y` attribute."," *"," * @property _y"," * @type Number"," * @private"," */"," _y: 0,",""," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var node = this.parentNode,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," xy;"," if(node)"," {"," xy = Y.one(node).getXY();"," xy[0] += x;"," xy[1] += y;"," }"," else"," {"," xy = Y.DOM._getOffset(this._node);"," }"," return xy;"," },",""," /**"," * Initializes the class."," *"," * @method initializer"," * @private"," */"," initializer: function(config) {"," var render = this.get(\"render\"),"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\";"," this._shapes = {};"," this._contentBounds = {"," left: 0,"," top: 0,"," right: 0,"," bottom: 0"," };"," this._node = this._createGraphic();"," this._node.style.left = this.get(\"x\") + \"px\";"," this._node.style.top = this.get(\"y\") + \"px\";"," this._node.style.visibility = visibility;"," this._node.setAttribute(\"id\", this.get(\"id\"));"," if(render)"," {"," this.render(render);"," }"," },"," "," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {HTMLElement} parentNode node in which to render the graphics node into."," */"," render: function(render) {"," var parentNode = Y.one(render),"," w = this.get(\"width\") || parseInt(parentNode.getComputedStyle(\"width\"), 10),"," h = this.get(\"height\") || parseInt(parentNode.getComputedStyle(\"height\"), 10);"," parentNode = parentNode || DOCUMENT.body;"," parentNode.appendChild(this._node);"," this.parentNode = parentNode;"," this.set(\"width\", w);"," this.set(\"height\", h);"," return this;"," },",""," /**"," * Removes all nodes."," *"," * @method destroy"," */"," destroy: function()"," {"," this.clear();"," Y.one(this._node).remove(true);"," },",""," /**"," * Generates a shape instance by type."," *"," * @method addShape"," * @param {Object} cfg attributes for the shape"," * @return Shape"," */"," addShape: function(cfg)"," {"," cfg.graphic = this;"," if(!this.get(\"visible\"))"," {"," cfg.visible = false;"," }"," var shapeClass = this._getShapeClass(cfg.type),"," shape = new shapeClass(cfg);"," this._appendShape(shape);"," shape._appendStrokeAndFill();"," return shape;"," },",""," /**"," * Adds a shape instance to the graphic instance."," *"," * @method _appendShape"," * @param {Shape} shape The shape instance to be added to the graphic."," * @private"," */"," _appendShape: function(shape)"," {"," var node = shape.node,"," parentNode = this._frag || this._node;"," if(this.get(\"autoDraw\") || this.get(\"autoSize\") == \"sizeContentToGraphic\") "," {"," parentNode.appendChild(node);"," }"," else"," {"," this._getDocFrag().appendChild(node);"," }"," },",""," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," removeShape: function(shape)"," {"," if(!(shape instanceof VMLShape))"," {"," if(Y_LANG.isString(shape))"," {"," shape = this._shapes[shape];"," }"," }"," if(shape && (shape instanceof VMLShape))"," {"," shape._destroy();"," this._shapes[shape.get(\"id\")] = null;"," delete this._shapes[shape.get(\"id\")];"," }"," if(this.get(\"autoDraw\"))"," {"," this._redraw();"," }"," },",""," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," removeAllShapes: function()"," {"," var shapes = this._shapes,"," i;"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].destroy();"," }"," }"," this._shapes = {};"," },",""," /**"," * Removes all child nodes."," *"," * @method _removeChildren"," * @param node"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },",""," /**"," * Clears the graphics object."," *"," * @method clear"," */"," clear: function() {"," this.removeAllShapes();"," this._removeChildren(this._node);"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} val indicates visibilitye"," * @private"," */"," _toggleVisible: function(val)"," {"," var i,"," shapes = this._shapes,"," visibility = val ? \"visible\" : \"hidden\";"," if(shapes)"," {"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].set(\"visible\", val);"," }"," }"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," },",""," /**"," * Sets the size of the graphics object."," * "," * @method setSize"," * @param w {Number} width to set for the instance."," * @param h {Number} height to set for the instance."," */"," setSize: function(w, h) {"," w = Math.round(w);"," h = Math.round(h);"," this._node.style.width = w + 'px';"," this._node.style.height = h + 'px';"," },",""," /**"," * Sets the positon of the graphics object."," *"," * @method setPosition"," * @param {Number} x x-coordinate for the object."," * @param {Number} y y-coordinate for the object."," */"," setPosition: function(x, y)"," {"," x = Math.round(x);"," y = Math.round(y);"," this._node.style.left = x + \"px\";"," this._node.style.top = y + \"px\";"," },",""," /**"," * Creates a group element"," *"," * @method _createGraphic"," * @private"," */"," _createGraphic: function() {"," var group = DOCUMENT.createElement('<group xmlns=\"urn:schemas-microsft.com:vml\" style=\"behavior:url(#default#VML);padding:0px 0px 0px 0px;display:block;position:absolute;top:0px;left:0px;zoom:1;\" />');"," return group;"," },",""," /**"," * Creates a graphic node"," *"," * @method _createGraphicNode"," * @param {String} type node type to create"," * @param {String} pe specified pointer-events value"," * @return HTMLElement"," * @private"," */"," _createGraphicNode: function(type)"," {"," return DOCUMENT.createElement('<' + type + ' xmlns=\"urn:schemas-microsft.com:vml\" style=\"behavior:url(#default#VML);display:inline-block;zoom:1;\" />');"," "," },",""," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," getShapeById: function(id)"," {"," return this._shapes[id];"," },",""," /**"," * Returns a shape class. Used by `addShape`. "," *"," * @method _getShapeClass"," * @param {Shape | String} val Indicates which shape class. "," * @return Function "," * @private"," */"," _getShapeClass: function(val)"," {"," var shape = this._shapeClass[val];"," if(shape)"," {"," return shape;"," }"," return val;"," },",""," /**"," * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation."," *"," * @property _shapeClass"," * @type Object"," * @private"," */"," _shapeClass: {"," circle: Y.VMLCircle,"," rect: Y.VMLRect,"," path: Y.VMLPath,"," ellipse: Y.VMLEllipse,"," pieslice: Y.VMLPieSlice"," },",""," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */"," batch: function(method)"," {"," var autoDraw = this.get(\"autoDraw\");"," this.set(\"autoDraw\", false);"," method.apply();"," this.set(\"autoDraw\", autoDraw);"," },"," "," /**"," * Returns a document fragment to for attaching shapes."," *"," * @method _getDocFrag"," * @return DocumentFragment"," * @private"," */"," _getDocFrag: function()"," {"," if(!this._frag)"," {"," this._frag = DOCUMENT.createDocumentFragment();"," }"," return this._frag;"," },",""," /**"," * Adds a shape to the redraw queue and calculates the contentBounds. "," *"," * @method addToRedrawQueue"," * @param shape {VMLShape}"," * @protected"," */"," addToRedrawQueue: function(shape)"," {"," var shapeBox,"," box;"," this._shapes[shape.get(\"id\")] = shape;"," if(!this.get(\"resizeDown\"))"," {"," shapeBox = shape.getBounds();"," box = this._contentBounds;"," box.left = box.left < shapeBox.left ? box.left : shapeBox.left;"," box.top = box.top < shapeBox.top ? box.top : shapeBox.top;"," box.right = box.right > shapeBox.right ? box.right : shapeBox.right;"," box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;"," box.width = box.right - box.left;"," box.height = box.bottom - box.top;"," this._contentBounds = box;"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," },",""," /**"," * Redraws all shapes."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var autoSize = this.get(\"autoSize\"),"," preserveAspectRatio,"," node = this.parentNode,"," nodeWidth = parseFloat(node.getComputedStyle(\"width\")),"," nodeHeight = parseFloat(node.getComputedStyle(\"height\")),"," xCoordOrigin = 0,"," yCoordOrigin = 0,"," box = this.get(\"resizeDown\") ? this._getUpdatedContentBounds() : this._contentBounds,"," left = box.left,"," right = box.right,"," top = box.top,"," bottom = box.bottom,"," contentWidth = right - left,"," contentHeight = bottom - top,"," aspectRatio,"," xCoordSize,"," yCoordSize,"," scaledWidth,"," scaledHeight,"," visible = this.get(\"visible\");"," this._node.style.visibility = \"hidden\";"," if(autoSize)"," {"," if(autoSize == \"sizeContentToGraphic\")"," {"," preserveAspectRatio = this.get(\"preserveAspectRatio\");"," if(preserveAspectRatio == \"none\" || contentWidth/contentHeight === nodeWidth/nodeHeight)"," {"," xCoordOrigin = left;"," yCoordOrigin = top;"," xCoordSize = contentWidth;"," yCoordSize = contentHeight;"," }"," else "," {"," if(contentWidth * nodeHeight/contentHeight > nodeWidth)"," {"," aspectRatio = nodeHeight/nodeWidth;"," xCoordSize = contentWidth;"," yCoordSize = contentWidth * aspectRatio;"," scaledHeight = (nodeWidth * (contentHeight/contentWidth)) * (yCoordSize/nodeHeight);"," yCoordOrigin = this._calculateCoordOrigin(preserveAspectRatio.slice(5).toLowerCase(), scaledHeight, yCoordSize);"," yCoordOrigin = top + yCoordOrigin;"," xCoordOrigin = left;"," }"," else"," {"," aspectRatio = nodeWidth/nodeHeight;"," xCoordSize = contentHeight * aspectRatio;"," yCoordSize = contentHeight;"," scaledWidth = (nodeHeight * (contentWidth/contentHeight)) * (xCoordSize/nodeWidth);"," xCoordOrigin = this._calculateCoordOrigin(preserveAspectRatio.slice(1, 4).toLowerCase(), scaledWidth, xCoordSize);"," xCoordOrigin = xCoordOrigin + left;"," yCoordOrigin = top;"," }"," }"," this._node.style.width = nodeWidth + \"px\";"," this._node.style.height = nodeHeight + \"px\";"," this._node.coordOrigin = xCoordOrigin + \", \" + yCoordOrigin;"," }"," else "," {"," xCoordSize = contentWidth;"," yCoordSize = contentHeight;"," this._node.style.width = contentWidth + \"px\";"," this._node.style.height = contentHeight + \"px\";"," this._state.width = contentWidth;"," this._state.height = contentHeight;",""," }"," this._node.coordSize = xCoordSize + \", \" + yCoordSize;"," }"," else"," {"," this._node.style.width = nodeWidth + \"px\";"," this._node.style.height = nodeHeight + \"px\";"," this._node.coordSize = nodeWidth + \", \" + nodeHeight;"," }"," if(this._frag)"," {"," this._node.appendChild(this._frag);"," this._frag = null;"," }"," if(visible)"," {"," this._node.style.visibility = \"visible\";"," }"," },"," "," /**"," * Determines the value for either an x or y coordinate to be used for the <code>coordOrigin</code> of the Graphic."," *"," * @method _calculateCoordOrigin"," * @param {String} position The position for placement. Possible values are min, mid and max."," * @param {Number} size The total scaled size of the content."," * @param {Number} coordsSize The coordsSize for the Graphic."," * @return Number"," * @private"," */"," _calculateCoordOrigin: function(position, size, coordsSize)"," {"," var coord;"," switch(position)"," {"," case \"min\" :"," coord = 0;"," break;"," case \"mid\" :"," coord = (size - coordsSize)/2;"," break;"," case \"max\" :"," coord = (size - coordsSize);"," break;"," }"," return coord;"," },",""," /**"," * Recalculates and returns the `contentBounds` for the `Graphic` instance."," *"," * @method _getUpdatedContentBounds"," * @return {Object} "," * @private"," */"," _getUpdatedContentBounds: function()"," {"," var bounds,"," i,"," shape,"," queue = this._shapes,"," box = {};"," for(i in queue)"," {"," if(queue.hasOwnProperty(i))"," {"," shape = queue[i];"," bounds = shape.getBounds();"," box.left = Y_LANG.isNumber(box.left) ? Math.min(box.left, bounds.left) : bounds.left;"," box.top = Y_LANG.isNumber(box.top) ? Math.min(box.top, bounds.top) : bounds.top;"," box.right = Y_LANG.isNumber(box.right) ? Math.max(box.right, bounds.right) : bounds.right;"," box.bottom = Y_LANG.isNumber(box.bottom) ? Math.max(box.bottom, bounds.bottom) : bounds.bottom;"," }"," }"," box.left = Y_LANG.isNumber(box.left) ? box.left : 0;"," box.top = Y_LANG.isNumber(box.top) ? box.top : 0;"," box.right = Y_LANG.isNumber(box.right) ? box.right : 0;"," box.bottom = Y_LANG.isNumber(box.bottom) ? box.bottom : 0;"," this._contentBounds = box;"," return box;"," },",""," /**"," * Inserts shape on the top of the tree."," *"," * @method _toFront"," * @param {VMLShape} Shape to add."," * @private"," */"," _toFront: function(shape)"," {"," var contentNode = this._node;"," if(shape instanceof Y.VMLShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," contentNode.appendChild(shape);"," }"," },",""," /**"," * Inserts shape as the first child of the content node."," *"," * @method _toBack"," * @param {VMLShape} Shape to add."," * @private"," */"," _toBack: function(shape)"," {"," var contentNode = this._node,"," targetNode;"," if(shape instanceof Y.VMLShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," targetNode = contentNode.firstChild;"," if(targetNode)"," {"," contentNode.insertBefore(shape, targetNode);"," }"," else"," {"," contentNode.appendChild(shape);"," }"," }"," }","});","Y.VMLGraphic = VMLGraphic;","","","","}, '3.7.2', {\"requires\": [\"graphics\"]});"];+_yuitest_coverage["build/graphics-vml/graphics-vml.js"].code=["YUI.add('graphics-vml', function (Y, NAME) {","","var IMPLEMENTATION = \"vml\","," SHAPE = \"shape\","," SPLITPATHPATTERN = /[a-z][^a-z]*/ig,"," SPLITARGSPATTERN = /[-]?[0-9]*[0-9|\\.][0-9]*/g,"," Y_LANG = Y.Lang,"," IS_NUM = Y_LANG.isNumber,"," IS_ARRAY = Y_LANG.isArray,"," IS_STRING = Y_LANG.isString,"," Y_DOM = Y.DOM,"," Y_SELECTOR = Y.Selector,"," DOCUMENT = Y.config.doc,"," AttributeLite = Y.AttributeLite,"," VMLShape,"," VMLCircle,"," VMLPath,"," VMLRect,"," VMLEllipse,"," VMLGraphic,"," VMLPieSlice,"," _getClassName = Y.ClassNameManager.getClassName;","","function VMLDrawing() {}","","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Drawing.html\">`Drawing`</a> class. "," * `VMLDrawing` is not intended to be used directly. Instead, use the <a href=\"Drawing.html\">`Drawing`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Drawing.html\">`Drawing`</a> class will point to the `VMLDrawing` class."," *"," * @module graphics"," * @class VMLDrawing"," * @constructor"," */","VMLDrawing.prototype = {"," /**"," * Maps path to methods"," *"," * @property _pathSymbolToMethod"," * @type Object"," * @private"," */"," _pathSymbolToMethod: {"," M: \"moveTo\","," m: \"relativeMoveTo\","," L: \"lineTo\","," l: \"relativeLineTo\","," C: \"curveTo\","," c: \"relativeCurveTo\","," Q: \"quadraticCurveTo\","," q: \"relativeQuadraticCurveTo\","," z: \"closePath\","," Z: \"closePath\""," },",""," /**"," * Value for rounding up to coordsize"," *"," * @property _coordSpaceMultiplier"," * @type Number"," * @private"," */"," _coordSpaceMultiplier: 100,",""," /**"," * Rounds dimensions and position values based on the coordinate space."," *"," * @method _round"," * @param {Number} The value for rounding"," * @return Number"," * @private"," */"," _round:function(val)"," {"," return Math.round(val * this._coordSpaceMultiplier);"," },",""," /**"," * Concatanates the path."," *"," * @method _addToPath"," * @param {String} val The value to add to the path string."," * @private"," */"," _addToPath: function(val)"," {"," this._path = this._path || \"\";"," if(this._movePath)"," {"," this._path += this._movePath;"," this._movePath = null;"," }"," this._path += val;"," },",""," /**"," * Current x position of the drawing."," *"," * @property _currentX"," * @type Number"," * @private"," */"," _currentX: 0,",""," /**"," * Current y position of the drqwing."," *"," * @property _currentY"," * @type Number"," * @private"," */"," _currentY: 0,"," "," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," curveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a bezier curve."," *"," * @method relativeCurveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeCurveTo: function() {"," this._curveTo.apply(this, [Y.Array(arguments), true]);"," },"," "," /**"," * Implements curveTo methods."," *"," * @method _curveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _curveTo: function(args, relative) {"," var w,"," h,"," x,"," y,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," pts,"," right,"," left,"," bottom,"," top,"," i,"," len,"," path,"," command = relative ? \" v \" : \" c \","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," len = args.length - 5;"," path = command; "," for(i = 0; i < len; i = i + 6)"," {"," cp1x = parseFloat(args[i]);"," cp1y = parseFloat(args[i + 1]);"," cp2x = parseFloat(args[i + 2]);"," cp2y = parseFloat(args[i + 3]);"," x = parseFloat(args[i + 4]);"," y = parseFloat(args[i + 5]);"," if(i > 0)"," {"," path = path + \", \";"," }"," path = path + this._round(cp1x) + \", \" + this._round(cp1y) + \", \" + this._round(cp2x) + \", \" + this._round(cp2y) + \", \" + this._round(x) + \", \" + this._round(y); "," cp1x = cp1x + relativeX;"," cp1y = cp1y + relativeY;"," cp2x = cp2x + relativeX;"," cp2y = cp2y + relativeY;"," x = x + relativeX;"," y = y + relativeY;"," right = Math.max(x, Math.max(cp1x, cp2x));"," bottom = Math.max(y, Math.max(cp1y, cp2y));"," left = Math.min(x, Math.min(cp1x, cp2x));"," top = Math.min(y, Math.min(cp1y, cp2y));"," w = Math.abs(right - left);"," h = Math.abs(bottom - top);"," pts = [[this._currentX, this._currentY] , [cp1x, cp1y], [cp2x, cp2y], [x, y]]; "," this._setCurveBoundingBox(pts, w, h);"," this._currentX = x;"," this._currentY = y;"," }"," this._addToPath(path);"," },",""," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," quadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a quadratic bezier curve relative to the current position."," *"," * @method relativeQuadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeQuadraticCurveTo: function() {"," this._quadraticCurveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements quadraticCurveTo methods."," *"," * @method _quadraticCurveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _quadraticCurveTo: function(args, relative) {"," var cpx, "," cpy,"," cp1x,"," cp1y,"," cp2x,"," cp2y,"," x, "," y,"," currentX = this._currentX,"," currentY = this._currentY,"," i,"," len = args.length - 3,"," bezierArgs = [],"," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," for(i = 0; i < len; i = i + 4)"," {"," cpx = parseFloat(args[i]) + relativeX;"," cpy = parseFloat(args[i + 1]) + relativeY;"," x = parseFloat(args[i + 2]) + relativeX;"," y = parseFloat(args[i + 3]) + relativeY;"," cp1x = currentX + 0.67*(cpx - currentX);"," cp1y = currentY + 0.67*(cpy - currentY);"," cp2x = cp1x + (x - currentX) * 0.34;"," cp2y = cp1y + (y - currentY) * 0.34;"," bezierArgs.push(cp1x);"," bezierArgs.push(cp1y);"," bezierArgs.push(cp2x);"," bezierArgs.push(cp2y);"," bezierArgs.push(x);"," bezierArgs.push(y);"," }"," this._curveTo.apply(this, [bezierArgs, false]);"," },",""," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," drawRect: function(x, y, w, h) {"," this.moveTo(x, y);"," this.lineTo(x + w, y);"," this.lineTo(x + w, y + h);"," this.lineTo(x, y + h);"," this.lineTo(x, y);"," this._currentX = x;"," this._currentY = y;"," return this;"," },",""," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," drawRoundRect: function(x, y, w, h, ew, eh) {"," this.moveTo(x, y + eh);"," this.lineTo(x, y + h - eh);"," this.quadraticCurveTo(x, y + h, x + ew, y + h);"," this.lineTo(x + w - ew, y + h);"," this.quadraticCurveTo(x + w, y + h, x + w, y + h - eh);"," this.lineTo(x + w, y + eh);"," this.quadraticCurveTo(x + w, y, x + w - ew, y);"," this.lineTo(x + ew, y);"," this.quadraticCurveTo(x, y, x, y + eh);"," return this;"," },",""," /**"," * Draws a circle. Used internally by `CanvasCircle` class."," *"," * @method drawCircle"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} r radius"," * @protected"," */"," drawCircle: function(x, y, radius) {"," var startAngle = 0,"," endAngle = 360,"," circum = radius * 2;",""," endAngle *= 65535;"," this._drawingComplete = false;"," this._trackSize(x + circum, y + circum);"," this.moveTo((x + circum), (y + radius));"," this._addToPath(\" ae \" + this._round(x + radius) + \", \" + this._round(y + radius) + \", \" + this._round(radius) + \", \" + this._round(radius) + \", \" + startAngle + \", \" + endAngle);"," return this;"," },"," "," /**"," * Draws an ellipse."," *"," * @method drawEllipse"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @protected"," */"," drawEllipse: function(x, y, w, h) {"," var startAngle = 0,"," endAngle = 360,"," radius = w * 0.5,"," yRadius = h * 0.5;"," endAngle *= 65535;"," this._drawingComplete = false;"," this._trackSize(x + w, y + h);"," this.moveTo((x + w), (y + yRadius));"," this._addToPath(\" ae \" + this._round(x + radius) + \", \" + this._round(x + radius) + \", \" + this._round(y + yRadius) + \", \" + this._round(radius) + \", \" + this._round(yRadius) + \", \" + startAngle + \", \" + endAngle);"," return this;"," },"," "," /**"," * Draws a diamond. "," * "," * @method drawDiamond"," * @param {Number} x y-coordinate"," * @param {Number} y x-coordinate"," * @param {Number} width width"," * @param {Number} height height"," * @protected"," */"," drawDiamond: function(x, y, width, height)"," {"," var midWidth = width * 0.5,"," midHeight = height * 0.5;"," this.moveTo(x + midWidth, y);"," this.lineTo(x + width, y + midHeight);"," this.lineTo(x + midWidth, y + height);"," this.lineTo(x, y + midHeight);"," this.lineTo(x + midWidth, y);"," return this;"," },",""," /**"," * Draws a wedge."," *"," * @method drawWedge"," * @param {Number} x x-coordinate of the wedge's center point"," * @param {Number} y y-coordinate of the wedge's center point"," * @param {Number} startAngle starting angle in degrees"," * @param {Number} arc sweep of the wedge. Negative values draw clockwise."," * @param {Number} radius radius of wedge. If [optional] yRadius is defined, then radius is the x radius."," * @param {Number} yRadius [optional] y radius for wedge."," * @private"," */"," drawWedge: function(x, y, startAngle, arc, radius)"," {"," var diameter = radius * 2;"," if(Math.abs(arc) > 360)"," {"," arc = 360;"," }"," this._currentX = x;"," this._currentY = y;"," startAngle *= -65535;"," arc *= 65536;"," startAngle = Math.round(startAngle);"," arc = Math.round(arc);"," this.moveTo(x, y);"," this._addToPath(\" ae \" + this._round(x) + \", \" + this._round(y) + \", \" + this._round(radius) + \" \" + this._round(radius) + \", \" + startAngle + \", \" + arc);"," this._trackSize(diameter, diameter); "," return this;"," },",""," /**"," * Draws a line segment from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," lineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Draws a line segment using the current line style from the current drawing position to the relative x and y coordinates."," * "," * @method relativeLineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," relativeLineTo: function()"," {"," this._lineTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements lineTo methods."," *"," * @method _lineTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _lineTo: function(args, relative) {"," var point1 = args[0],"," i,"," len,"," x,"," y,"," path = relative ? \" r \" : \" l \","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," if (typeof point1 == \"string\" || typeof point1 == \"number\") {"," len = args.length - 1;"," for (i = 0; i < len; i = i + 2) {"," x = parseFloat(args[i]);"," y = parseFloat(args[i + 1]);"," path += ' ' + this._round(x) + ', ' + this._round(y);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize.apply(this, [x, y]);"," }"," }"," else"," {"," len = args.length;"," for (i = 0; i < len; i = i + 1) {"," x = parseFloat(args[i][0]);"," y = parseFloat(args[i][1]);"," path += ' ' + this._round(x) + ', ' + this._round(y);"," x = x + relativeX;"," y = y + relativeY;"," this._currentX = x;"," this._currentY = y;"," this._trackSize.apply(this, [x, y]);"," }"," }"," this._addToPath(path);"," return this;"," },"," "," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," moveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), false]);"," },",""," /**"," * Moves the current drawing position relative to specified x and y coordinates."," *"," * @method relativeMoveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," relativeMoveTo: function()"," {"," this._moveTo.apply(this, [Y.Array(arguments), true]);"," },",""," /**"," * Implements moveTo methods."," *"," * @method _moveTo"," * @param {Array} args The arguments to be used."," * @param {Boolean} relative Indicates whether or not to use relative coordinates."," * @private"," */"," _moveTo: function(args, relative) {"," var x = parseFloat(args[0]),"," y = parseFloat(args[1]),"," command = relative ? \" t \" : \" m \","," relativeX = relative ? parseFloat(this._currentX) : 0,"," relativeY = relative ? parseFloat(this._currentY) : 0;"," this._movePath = command + this._round(x) + \", \" + this._round(y);"," x = x + relativeX;"," y = y + relativeY;"," this._trackSize(x, y);"," this._currentX = x;"," this._currentY = y;"," },",""," /**"," * Draws the graphic."," *"," * @method _draw"," * @private"," */"," _closePath: function()"," {"," var fill = this.get(\"fill\"),"," stroke = this.get(\"stroke\"),"," node = this.node,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," path = this._path,"," pathEnd = \"\","," multiplier = this._coordSpaceMultiplier;"," this._fillChangeHandler();"," this._strokeChangeHandler();"," if(path)"," {"," if(fill && fill.color)"," {"," pathEnd += ' x';"," }"," if(stroke)"," {"," pathEnd += ' e';"," }"," }"," if(path)"," {"," node.path = path + pathEnd;"," }"," if(!isNaN(w) && !isNaN(h))"," {"," node.coordOrigin = this._left + \", \" + this._top;"," node.coordSize = (w * multiplier) + \", \" + (h * multiplier);"," node.style.position = \"absolute\";"," node.style.width = w + \"px\";"," node.style.height = h + \"px\";"," }"," this._path = path;"," this._movePath = null;"," this._updateTransform();"," },",""," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," end: function()"," {"," this._closePath();"," },",""," /**"," * Ends a fill and stroke"," *"," * @method closePath"," */"," closePath: function()"," {"," this._addToPath(\" x e\");"," },",""," /**"," * Clears the path."," *"," * @method clear"," */"," clear: function()"," {"," this._right = 0;"," this._bottom = 0;"," this._width = 0;"," this._height = 0;"," this._left = 0;"," this._top = 0;"," this._path = \"\";"," this._movePath = null;"," },"," "," /**"," * Returns the points on a curve"," *"," * @method getBezierData"," * @param Array points Array containing the begin, end and control points of a curve."," * @param Number t The value for incrementing the next set of points."," * @return Array"," * @private"," */"," getBezierData: function(points, t) { "," var n = points.length,"," tmp = [],"," i,"," j;",""," for (i = 0; i < n; ++i){"," tmp[i] = [points[i][0], points[i][1]]; // save input"," }"," "," for (j = 1; j < n; ++j) {"," for (i = 0; i < n - j; ++i) {"," tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];"," tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; "," }"," }"," return [ tmp[0][0], tmp[0][1] ]; "," },"," "," /**"," * Calculates the bounding box for a curve"," *"," * @method _setCurveBoundingBox"," * @param Array pts Array containing points for start, end and control points of a curve."," * @param Number w Width used to calculate the number of points to describe the curve."," * @param Number h Height used to calculate the number of points to describe the curve."," * @private"," */"," _setCurveBoundingBox: function(pts, w, h)"," {"," var i,"," left = this._currentX,"," right = left,"," top = this._currentY,"," bottom = top,"," len = Math.round(Math.sqrt((w * w) + (h * h))),"," t = 1/len,"," xy;"," for(i = 0; i < len; ++i)"," {"," xy = this.getBezierData(pts, t * i);"," left = isNaN(left) ? xy[0] : Math.min(xy[0], left);"," right = isNaN(right) ? xy[0] : Math.max(xy[0], right);"," top = isNaN(top) ? xy[1] : Math.min(xy[1], top);"," bottom = isNaN(bottom) ? xy[1] : Math.max(xy[1], bottom);"," }"," left = Math.round(left * 10)/10;"," right = Math.round(right * 10)/10;"," top = Math.round(top * 10)/10;"," bottom = Math.round(bottom * 10)/10;"," this._trackSize(right, bottom);"," this._trackSize(left, top);"," },",""," /**"," * Updates the size of the graphics object"," *"," * @method _trackSize"," * @param {Number} w width"," * @param {Number} h height"," * @private"," */"," _trackSize: function(w, h) {"," if (w > this._right) {"," this._right = w;"," }"," if(w < this._left)"," {"," this._left = w; "," }"," if (h < this._top)"," {"," this._top = h;"," }"," if (h > this._bottom) "," {"," this._bottom = h;"," }"," this._width = this._right - this._left;"," this._height = this._bottom - this._top;"," },",""," _left: 0,",""," _right: 0,",""," _top: 0,",""," _bottom: 0,",""," _width: 0,",""," _height: 0","};","Y.VMLDrawing = VMLDrawing;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Shape.html\">`Shape`</a> class. "," * `VMLShape` is not intended to be used directly. Instead, use the <a href=\"Shape.html\">`Shape`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Shape.html\">`Shape`</a> class will point to the `VMLShape` class."," *"," * @module graphics"," * @class VMLShape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */","VMLShape = function() ","{"," this._transforms = [];"," this.matrix = new Y.Matrix();"," this._normalizedMatrix = new Y.Matrix();"," VMLShape.superclass.constructor.apply(this, arguments);","};","","VMLShape.NAME = \"shape\";","","Y.extend(VMLShape, Y.GraphicBase, Y.mix({"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"shape\","," "," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," init: function()"," {"," this.initializer.apply(this, arguments);"," },",""," /**"," * Initializes the shape"," *"," * @private"," * @method _initialize"," */"," initializer: function(cfg)"," {"," var host = this,"," graphic = cfg.graphic,"," data = this.get(\"data\");"," host.createNode();"," if(graphic)"," {"," this._setGraphic(graphic);"," }"," if(data)"," {"," host._parsePathData(data);"," }"," this._updateHandler();"," },"," "," /**"," * Set the Graphic instance for the shape."," *"," * @method _setGraphic"," * @param {Graphic | Node | HTMLElement | String} render This param is used to determine the graphic instance. If it is a `Graphic` instance, it will be assigned"," * to the `graphic` attribute. Otherwise, a new Graphic instance will be created and rendered into the dom element that the render represents."," * @private"," */"," _setGraphic: function(render)"," {"," var graphic;"," if(render instanceof Y.VMLGraphic)"," {"," this._graphic = render;"," }"," else"," {"," render = Y.one(render);"," graphic = new Y.VMLGraphic({"," render: render"," });"," graphic._appendShape(this);"," this._graphic = graphic;"," this._appendStrokeAndFill();"," }"," },"," "," /**"," * Appends fill and stroke nodes to the shape."," *"," * @method _appendStrokeAndFill"," * @private"," */"," _appendStrokeAndFill: function()"," {"," if(this._strokeNode)"," {"," this.node.appendChild(this._strokeNode);"," }"," if(this._fillNode)"," {"," this.node.appendChild(this._fillNode);"," }"," },"," "," /**"," * Creates the dom node for the shape."," *"," * @method createNode"," * @return HTMLElement"," * @private"," */"," createNode: function()"," {"," var node,"," concat = this._camelCaseConcat,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," id,"," type,"," name = this.name,"," nodestring,"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\","," strokestring,"," classString,"," stroke,"," endcap,"," opacity,"," joinstyle,"," miterlimit,"," dashstyle,"," fill,"," fillstring;"," id = this.get(\"id\");"," type = this._type == \"path\" ? \"shape\" : this._type;"," classString = _getClassName(SHAPE) + \" \" + _getClassName(concat(IMPLEMENTATION, SHAPE)) + \" \" + _getClassName(name) + \" \" + _getClassName(concat(IMPLEMENTATION, name)) + \" \" + IMPLEMENTATION + type; "," stroke = this._getStrokeProps();"," fill = this._getFillProps();"," "," nodestring = '<' + type + ' xmlns=\"urn:schemas-microsft.com:vml\" id=\"' + id + '\" class=\"' + classString + '\" style=\"behavior:url(#default#VML);display:inline-block;position:absolute;left:' + x + 'px;top:' + y + 'px;width:' + w + 'px;height:' + h + 'px;visibility:' + visibility + '\"';",""," if(stroke && stroke.weight && stroke.weight > 0)"," {"," endcap = stroke.endcap;"," opacity = parseFloat(stroke.opacity);"," joinstyle = stroke.joinstyle;"," miterlimit = stroke.miterlimit;"," dashstyle = stroke.dashstyle;"," nodestring += ' stroked=\"t\" strokecolor=\"' + stroke.color + '\" strokeWeight=\"' + stroke.weight + 'px\"';"," "," strokestring = '<stroke class=\"vmlstroke\" xmlns=\"urn:schemas-microsft.com:vml\" on=\"t\" style=\"behavior:url(#default#VML);display:inline-block;\"';"," strokestring += ' opacity=\"' + opacity + '\"';"," if(endcap)"," {"," strokestring += ' endcap=\"' + endcap + '\"';"," }"," if(joinstyle)"," {"," strokestring += ' joinstyle=\"' + joinstyle + '\"';"," }"," if(miterlimit)"," {"," strokestring += ' miterlimit=\"' + miterlimit + '\"';"," }"," if(dashstyle)"," {"," strokestring += ' dashstyle=\"' + dashstyle + '\"';"," }"," strokestring += '></stroke>';"," this._strokeNode = DOCUMENT.createElement(strokestring);"," nodestring += ' stroked=\"t\"';"," }"," else"," {"," nodestring += ' stroked=\"f\"';"," }"," if(fill)"," {"," if(fill.node)"," {"," fillstring = fill.node;"," this._fillNode = DOCUMENT.createElement(fillstring);"," }"," if(fill.color)"," {"," nodestring += ' fillcolor=\"' + fill.color + '\"';"," }"," nodestring += ' filled=\"' + fill.filled + '\"';"," }"," "," "," nodestring += '>';"," nodestring += '</' + type + '>';"," "," node = DOCUMENT.createElement(nodestring);",""," this.node = node;"," this._strokeFlag = false;"," this._fillFlag = false;"," },",""," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," addClass: function(className)"," {"," var node = this.node;"," Y_DOM.addClass(node, className);"," },",""," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," removeClass: function(className)"," {"," var node = this.node;"," Y_DOM.removeClass(node, className);"," },",""," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY(),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," return [parentXY[0] + x, parentXY[1] + y];"," },",""," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," *"," */"," setXY: function(xy)"," {"," var graphic = this._graphic,"," parentXY = graphic.getXY();"," this.set(\"x\", xy[0] - parentXY[0]);"," this.set(\"y\", xy[1] - parentXY[1]);"," },",""," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {VMLShape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," contains: function(needle)"," {"," return needle === Y.one(this.node);"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this.node;",""," return node === refNode;"," },",""," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," test: function(selector)"," {"," return Y_SELECTOR.test(this.node, selector);"," },",""," /**"," * Calculates and returns properties for setting an initial stroke."," *"," * @method _getStrokeProps"," * @return Object"," *"," * @private"," */"," _getStrokeProps: function()"," {"," var props,"," stroke = this.get(\"stroke\"),"," strokeOpacity,"," dashstyle,"," dash = \"\","," val,"," i = 0,"," len,"," linecap,"," linejoin;"," if(stroke && stroke.weight && stroke.weight > 0)"," {"," props = {};"," linecap = stroke.linecap || \"flat\";"," linejoin = stroke.linejoin || \"round\";"," if(linecap != \"round\" && linecap != \"square\")"," {"," linecap = \"flat\";"," }"," strokeOpacity = parseFloat(stroke.opacity);"," dashstyle = stroke.dashstyle || \"none\";"," stroke.color = stroke.color || \"#000000\";"," stroke.weight = stroke.weight || 1;"," stroke.opacity = IS_NUM(strokeOpacity) ? strokeOpacity : 1;"," props.stroked = true;"," props.color = stroke.color;"," props.weight = stroke.weight;"," props.endcap = linecap;"," props.opacity = stroke.opacity;"," if(IS_ARRAY(dashstyle))"," {"," dash = [];"," len = dashstyle.length;"," for(i = 0; i < len; ++i)"," {"," val = dashstyle[i];"," dash[i] = val / stroke.weight;"," }"," }"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," props.joinstyle = linejoin;"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(IS_NUM(linejoin))"," {"," props.miterlimit = Math.max(linejoin, 1);"," props.joinstyle = \"miter\";"," }"," }"," props.dashstyle = dash;"," }"," return props;"," },",""," /**"," * Adds a stroke to the shape node."," *"," * @method _strokeChangeHandler"," * @private"," */"," _strokeChangeHandler: function(e)"," {"," if(!this._strokeFlag)"," {"," return;"," }"," var node = this.node,"," stroke = this.get(\"stroke\"),"," strokeOpacity,"," dashstyle,"," dash = \"\","," val,"," i = 0,"," len,"," linecap,"," linejoin;"," if(stroke && stroke.weight && stroke.weight > 0)"," {"," linecap = stroke.linecap || \"flat\";"," linejoin = stroke.linejoin || \"round\";"," if(linecap != \"round\" && linecap != \"square\")"," {"," linecap = \"flat\";"," }"," strokeOpacity = parseFloat(stroke.opacity);"," dashstyle = stroke.dashstyle || \"none\";"," stroke.color = stroke.color || \"#000000\";"," stroke.weight = stroke.weight || 1;"," stroke.opacity = IS_NUM(strokeOpacity) ? strokeOpacity : 1;"," node.stroked = true;"," node.strokeColor = stroke.color;"," node.strokeWeight = stroke.weight + \"px\";"," if(!this._strokeNode)"," {"," this._strokeNode = this._createGraphicNode(\"stroke\");"," node.appendChild(this._strokeNode);"," }"," this._strokeNode.endcap = linecap;"," this._strokeNode.opacity = stroke.opacity;"," if(IS_ARRAY(dashstyle))"," {"," dash = [];"," len = dashstyle.length;"," for(i = 0; i < len; ++i)"," {"," val = dashstyle[i];"," dash[i] = val / stroke.weight;"," }"," }"," if(linejoin == \"round\" || linejoin == \"bevel\")"," {"," this._strokeNode.joinstyle = linejoin;"," }"," else"," {"," linejoin = parseInt(linejoin, 10);"," if(IS_NUM(linejoin))"," {"," this._strokeNode.miterlimit = Math.max(linejoin, 1);"," this._strokeNode.joinstyle = \"miter\";"," }"," }"," this._strokeNode.dashstyle = dash;"," this._strokeNode.on = true;"," }"," else"," {"," if(this._strokeNode)"," {"," this._strokeNode.on = false;"," }"," node.stroked = false;"," }"," this._strokeFlag = false;"," },",""," /**"," * Calculates and returns properties for setting an initial fill."," *"," * @method _getFillProps"," * @return Object"," *"," * @private"," */"," _getFillProps: function()"," {"," var fill = this.get(\"fill\"),"," fillOpacity,"," props,"," gradient,"," i,"," fillstring,"," filled = false;"," if(fill)"," {"," props = {};"," "," if(fill.type == \"radial\" || fill.type == \"linear\")"," {"," fillOpacity = parseFloat(fill.opacity);"," fillOpacity = IS_NUM(fillOpacity) ? fillOpacity : 1;"," filled = true;"," gradient = this._getGradientFill(fill);"," fillstring = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\" opacity=\"' + fillOpacity + '\"';"," for(i in gradient)"," {"," if(gradient.hasOwnProperty(i))"," {"," fillstring += ' ' + i + '=\"' + gradient[i] + '\"';"," }"," }"," fillstring += ' />';"," props.node = fillstring;"," }"," else if(fill.color)"," {"," fillOpacity = parseFloat(fill.opacity);"," filled = true;"," props.color = fill.color;"," if(IS_NUM(fillOpacity))"," {"," fillOpacity = Math.max(Math.min(fillOpacity, 1), 0);"," props.opacity = fillOpacity; "," if(fillOpacity < 1)"," {"," props.node = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\" type=\"solid\" opacity=\"' + fillOpacity + '\"/>';"," }"," }"," }"," props.filled = filled;"," }"," return props;"," },",""," /**"," * Adds a fill to the shape node."," *"," * @method _fillChangeHandler"," * @private"," */"," _fillChangeHandler: function(e)"," {"," if(!this._fillFlag)"," {"," return;"," }"," var node = this.node,"," fill = this.get(\"fill\"),"," fillOpacity,"," fillstring,"," filled = false,"," i,"," gradient;"," if(fill)"," {"," if(fill.type == \"radial\" || fill.type == \"linear\")"," {"," filled = true;"," gradient = this._getGradientFill(fill);"," if(this._fillNode)"," {"," for(i in gradient)"," {"," if(gradient.hasOwnProperty(i))"," {"," if(i == \"colors\")"," {"," this._fillNode.colors.value = gradient[i];"," }"," else"," {"," this._fillNode[i] = gradient[i];"," }"," }"," }"," }"," else"," {"," fillstring = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\"';"," for(i in gradient)"," {"," if(gradient.hasOwnProperty(i))"," {"," fillstring += ' ' + i + '=\"' + gradient[i] + '\"';"," }"," }"," fillstring += ' />';"," this._fillNode = DOCUMENT.createElement(fillstring);"," node.appendChild(this._fillNode);"," }"," }"," else if(fill.color)"," {"," node.fillcolor = fill.color;"," fillOpacity = parseFloat(fill.opacity);"," filled = true;"," if(IS_NUM(fillOpacity) && fillOpacity < 1)"," {"," fill.opacity = fillOpacity;"," if(this._fillNode)"," {"," if(this._fillNode.getAttribute(\"type\") != \"solid\")"," {"," this._fillNode.type = \"solid\";"," }"," this._fillNode.opacity = fillOpacity;"," }"," else"," { "," fillstring = '<fill xmlns=\"urn:schemas-microsft.com:vml\" class=\"vmlfill\" style=\"behavior:url(#default#VML);display:inline-block;\" type=\"solid\" opacity=\"' + fillOpacity + '\"/>';"," this._fillNode = DOCUMENT.createElement(fillstring);"," node.appendChild(this._fillNode);"," }"," }"," else if(this._fillNode)"," { "," this._fillNode.opacity = 1;"," this._fillNode.type = \"solid\";"," }"," }"," }"," node.filled = filled;"," this._fillFlag = false;"," },",""," //not used. remove next release."," _updateFillNode: function(node)"," {"," if(!this._fillNode)"," {"," this._fillNode = this._createGraphicNode(\"fill\");"," node.appendChild(this._fillNode);"," }"," },",""," /**"," * Calculates and returns an object containing gradient properties for a fill node. "," *"," * @method _getGradientFill"," * @param {Object} fill Object containing fill properties."," * @return Object"," * @private"," */"," _getGradientFill: function(fill)"," {"," var gradientProps = {},"," gradientBoxWidth,"," gradientBoxHeight,"," type = fill.type,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," isNumber = IS_NUM,"," stop,"," stops = fill.stops,"," len = stops.length,"," opacity,"," color,"," i,"," oi,"," colorstring = \"\","," cx = fill.cx,"," cy = fill.cy,"," fx = fill.fx,"," fy = fill.fy,"," r = fill.r,"," pct,"," rotation = fill.rotation || 0;"," if(type === \"linear\")"," {"," if(rotation <= 270)"," {"," rotation = Math.abs(rotation - 270);"," }"," else if(rotation < 360)"," {"," rotation = 270 + (360 - rotation);"," }"," else"," {"," rotation = 270;"," }"," gradientProps.type = \"gradient\";//\"gradientunscaled\";"," gradientProps.angle = rotation;"," }"," else if(type === \"radial\")"," {"," gradientBoxWidth = w * (r * 2);"," gradientBoxHeight = h * (r * 2);"," fx = r * 2 * (fx - 0.5);"," fy = r * 2 * (fy - 0.5);"," fx += cx;"," fy += cy;"," gradientProps.focussize = (gradientBoxWidth/w)/10 + \"% \" + (gradientBoxHeight/h)/10 + \"%\";"," gradientProps.alignshape = false;"," gradientProps.type = \"gradientradial\";"," gradientProps.focus = \"100%\";"," gradientProps.focusposition = Math.round(fx * 100) + \"% \" + Math.round(fy * 100) + \"%\";"," }"," for(i = 0;i < len; ++i) {"," stop = stops[i];"," color = stop.color;"," opacity = stop.opacity;"," opacity = isNumber(opacity) ? opacity : 1;"," pct = stop.offset || i/(len-1);"," pct *= (r * 2);"," pct = Math.round(100 * pct) + \"%\";"," oi = i > 0 ? i + 1 : \"\";"," gradientProps[\"opacity\" + oi] = opacity + \"\";"," colorstring += \", \" + pct + \" \" + color;"," }"," if(parseFloat(pct) < 100)"," {"," colorstring += \", 100% \" + color;"," }"," gradientProps.colors = colorstring.substr(2);"," return gradientProps;"," },",""," /**"," * Adds a transform to the shape."," *"," * @method _addTransform"," * @param {String} type The transform being applied."," * @param {Array} args The arguments for the transform."," * @private"," */"," _addTransform: function(type, args)"," {"," args = Y.Array(args);"," this._transform = Y_LANG.trim(this._transform + \" \" + type + \"(\" + args.join(\", \") + \")\");"," args.unshift(type);"," this._transforms.push(args);"," if(this.initialized)"," {"," this._updateTransform();"," }"," },"," "," /**"," * Applies all transforms."," *"," * @method _updateTransform"," * @private"," */"," _updateTransform: function()"," {"," var node = this.node,"," key,"," transform,"," transformOrigin,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," tx,"," ty,"," matrix = this.matrix,"," normalizedMatrix = this._normalizedMatrix,"," isPathShape = this instanceof Y.VMLPath,"," i,"," len = this._transforms.length;"," if(this._transforms && this._transforms.length > 0)"," {"," transformOrigin = this.get(\"transformOrigin\");"," "," if(isPathShape)"," {"," normalizedMatrix.translate(this._left, this._top);"," }"," //vml skew matrix transformOrigin ranges from -0.5 to 0.5."," //subtract 0.5 from values"," tx = transformOrigin[0] - 0.5;"," ty = transformOrigin[1] - 0.5;"," "," //ensure the values are within the appropriate range to avoid errors"," tx = Math.max(-0.5, Math.min(0.5, tx));"," ty = Math.max(-0.5, Math.min(0.5, ty));"," for(i = 0; i < len; ++i)"," {"," key = this._transforms[i].shift();"," if(key)"," {"," normalizedMatrix[key].apply(normalizedMatrix, this._transforms[i]); "," matrix[key].apply(matrix, this._transforms[i]); "," }"," }"," if(isPathShape)"," {"," normalizedMatrix.translate(-this._left, -this._top);"," }"," transform = normalizedMatrix.a + \",\" + "," normalizedMatrix.c + \",\" + "," normalizedMatrix.b + \",\" + "," normalizedMatrix.d + \",\" + "," 0 + \",\" +"," 0;"," }"," this._graphic.addToRedrawQueue(this); "," if(transform)"," {"," if(!this._skew)"," {"," this._skew = DOCUMENT.createElement( '<skew class=\"vmlskew\" xmlns=\"urn:schemas-microsft.com:vml\" on=\"false\" style=\"behavior:url(#default#VML);display:inline-block;\" />');"," this.node.appendChild(this._skew); "," }"," this._skew.matrix = transform;"," this._skew.on = true;"," //this._skew.offset = this._getSkewOffsetValue(normalizedMatrix.dx) + \"px, \" + this._getSkewOffsetValue(normalizedMatrix.dy) + \"px\";"," this._skew.origin = tx + \", \" + ty;"," }"," if(this._type != \"path\")"," {"," this._transforms = [];"," }"," //add the translate to the x and y coordinates"," node.style.left = (x + this._getSkewOffsetValue(normalizedMatrix.dx)) + \"px\";"," node.style.top = (y + this._getSkewOffsetValue(normalizedMatrix.dy)) + \"px\";"," },"," "," /**"," * Normalizes the skew offset values between -32767 and 32767."," *"," * @method _getSkewOffsetValue"," * @param {Number} val The value to normalize"," * @return Number"," * @private"," */"," _getSkewOffsetValue: function(val)"," {"," var sign = Y.MatrixUtil.sign(val),"," absVal = Math.abs(val);"," val = Math.min(absVal, 32767) * sign;"," return val;"," },"," "," /**"," * Storage for translateX"," *"," * @property _translateX"," * @type Number"," * @private"," */"," _translateX: 0,",""," /**"," * Storage for translateY"," *"," * @property _translateY"," * @type Number"," * @private"," */"," _translateY: 0,"," "," /**"," * Storage for the transform attribute."," *"," * @property _transform"," * @type String"," * @private"," */"," _transform: \"\","," "," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to translate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y)"," {"," this._translateX += x;"," this._translateY += y;"," this._addTransform(\"translate\", arguments);"," },",""," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," translateX: function(x)"," {"," this._translateX += x;"," this._addTransform(\"translateX\", arguments);"," },",""," /**"," * Performs a translate on the y-coordinate. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," translateY: function(y)"," {"," this._translateY += y;"," this._addTransform(\"translateY\", arguments);"," },",""," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y)"," {"," this._addTransform(\"skew\", arguments);"," },",""," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x)"," {"," this._addTransform(\"skewX\", arguments);"," },",""," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y)"," {"," this._addTransform(\"skewY\", arguments);"," },",""," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg)"," {"," this._addTransform(\"rotate\", arguments);"," },",""," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y)"," {"," this._addTransform(\"scale\", arguments);"," },",""," /**"," * Overrides default `on` method. Checks to see if its a dom interaction event. If so, "," * return an event attached to the `node` element. If not, return the normal functionality."," *"," * @method on"," * @param {String} type event type"," * @param {Object} callback function"," * @private"," */"," on: function(type, fn)"," {"," if(Y.Node.DOM_EVENTS[type])"," {"," return Y.one(\"#\" + this.get(\"id\")).on(type, fn);"," }"," return Y.on.apply(this, arguments);"," },",""," /**"," * Draws the shape."," *"," * @method _draw"," * @private"," */"," _draw: function()"," {"," },",""," /**"," * Updates `Shape` based on attribute changes."," *"," * @method _updateHandler"," * @private"," */"," _updateHandler: function(e)"," {"," var host = this,"," node = host.node;"," host._fillChangeHandler();"," host._strokeChangeHandler();"," node.style.width = this.get(\"width\") + \"px\";"," node.style.height = this.get(\"height\") + \"px\"; "," this._draw();"," host._updateTransform();"," },",""," /**"," * Creates a graphic node"," *"," * @method _createGraphicNode"," * @param {String} type node type to create"," * @return HTMLElement"," * @private"," */"," _createGraphicNode: function(type)"," {"," type = type || this._type;"," return DOCUMENT.createElement('<' + type + ' xmlns=\"urn:schemas-microsft.com:vml\" style=\"behavior:url(#default#VML);display:inline-block;\" class=\"vml' + type + '\"/>');"," },",""," /**"," * Value function for fill attribute"," *"," * @private"," * @method _getDefaultFill"," * @return Object"," */"," _getDefaultFill: function() {"," return {"," type: \"solid\","," opacity: 1,"," cx: 0.5,"," cy: 0.5,"," fx: 0.5,"," fy: 0.5,"," r: 0.5"," };"," },",""," /**"," * Value function for stroke attribute"," *"," * @private"," * @method _getDefaultStroke"," * @return Object"," */"," _getDefaultStroke: function() "," {"," return {"," weight: 1,"," dashstyle: \"none\","," color: \"#000\","," opacity: 1.0"," };"," },",""," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function() "," {"," var host = this;"," AttributeLite.prototype.set.apply(host, arguments);"," if(host.initialized)"," {"," host._updateHandler();"," }"," },",""," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," getBounds: function()"," {"," var isPathShape = this instanceof Y.VMLPath,"," w = this.get(\"width\"),"," h = this.get(\"height\"),"," x = this.get(\"x\"),"," y = this.get(\"y\");"," if(isPathShape)"," {"," x = x + this._left;"," y = y + this._top;"," w = this._right - this._left;"," h = this._bottom - this._top;"," }"," return this._getContentRect(w, h, x, y);"," },",""," /**"," * Calculates the bounding box for the shape."," *"," * @method _getContentRect"," * @param {Number} w width of the shape"," * @param {Number} h height of the shape"," * @param {Number} x x-coordinate of the shape"," * @param {Number} y y-coordinate of the shape"," * @private"," */"," _getContentRect: function(w, h, x, y)"," {"," var transformOrigin = this.get(\"transformOrigin\"),"," transformX = transformOrigin[0] * w,"," transformY = transformOrigin[1] * h,"," transforms = this.matrix.getTransformArray(this.get(\"transform\")),"," matrix = new Y.Matrix(),"," i,"," len = transforms.length,"," transform,"," key,"," contentRect,"," isPathShape = this instanceof Y.VMLPath;"," if(isPathShape)"," {"," matrix.translate(this._left, this._top);"," }"," transformX = !isNaN(transformX) ? transformX : 0;"," transformY = !isNaN(transformY) ? transformY : 0;"," matrix.translate(transformX, transformY);"," for(i = 0; i < len; i = i + 1)"," {"," transform = transforms[i];"," key = transform.shift();"," if(key)"," {"," matrix[key].apply(matrix, transform); "," }"," }"," matrix.translate(-transformX, -transformY);"," if(isPathShape)"," {"," matrix.translate(-this._left, -this._top);"," }"," contentRect = matrix.getContentRect(w, h, x, y);"," return contentRect;"," },",""," /**"," * Places the shape above all other shapes."," *"," * @method toFront"," */"," toFront: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toFront(this);"," }"," },",""," /**"," * Places the shape underneath all other shapes."," *"," * @method toFront"," */"," toBack: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic._toBack(this);"," }"," },",""," /**"," * Parses path data string and call mapped methods."," *"," * @method _parsePathData"," * @param {String} val The path data"," * @private"," */"," _parsePathData: function(val)"," {"," var method,"," methodSymbol,"," args,"," commandArray = Y.Lang.trim(val.match(SPLITPATHPATTERN)),"," i,"," len, "," str,"," symbolToMethod = this._pathSymbolToMethod;"," if(commandArray)"," {"," this.clear();"," len = commandArray.length || 0;"," for(i = 0; i < len; i = i + 1)"," {"," str = commandArray[i];"," methodSymbol = str.substr(0, 1);"," args = str.substr(1).match(SPLITARGSPATTERN);"," method = symbolToMethod[methodSymbol];"," if(method)"," {"," if(args)"," {"," this[method].apply(this, args);"," }"," else"," {"," this[method].apply(this);"," }"," }"," }"," this.end();"," }"," },"," "," /**"," * Destroys shape"," *"," * @method destroy"," */"," destroy: function()"," {"," var graphic = this.get(\"graphic\");"," if(graphic)"," {"," graphic.removeShape(this);"," }"," else"," {"," this._destroy();"," }"," },",""," /**"," * Implementation for shape destruction"," *"," * @method destroy"," * @protected"," */"," _destroy: function()"," {"," if(this.node)"," { "," if(this._fillNode)"," {"," this.node.removeChild(this._fillNode);"," this._fillNode = null;"," }"," if(this._strokeNode)"," {"," this.node.removeChild(this._strokeNode);"," this._strokeNode = null;"," }"," Y.one(this.node).remove(true);"," }"," }","}, Y.VMLDrawing.prototype));","","VMLShape.ATTRS = {"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," transformOrigin: {"," valueFn: function()"," {"," return [0.5, 0.5];"," }"," },"," "," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * <dt>matrix</dt><dd>Specifies a 2D transformation matrix comprised of the specified six values.</dd> "," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," transform: {"," setter: function(val)"," {"," var i,"," len,"," transform;"," this.matrix.init(); "," this._normalizedMatrix.init(); "," this._transforms = this.matrix.getTransformArray(val);"," len = this._transforms.length;"," for(i = 0;i < len; ++i)"," {"," transform = this._transforms[i];"," }"," this._transform = val;"," return val;"," },",""," getter: function()"," {"," return this._transform;"," }"," },",""," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," x: {"," value: 0"," },",""," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," y: {"," value: 0"," },",""," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this.node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },"," "," /**"," * "," * @config width"," */"," width: {"," value: 0"," },",""," /**"," * "," * @config height"," */"," height: {"," value: 0"," },",""," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," visible: {"," value: true,",""," setter: function(val){"," var node = this.node,"," visibility = val ? \"visible\" : \"hidden\";"," if(node)"," {"," node.style.visibility = visibility;"," }"," return val;"," }"," },",""," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * </dl>"," * <p>The corresponding `SVGShape` class implements the following additional properties.</p>"," * <dl>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * </dd>"," * </dl>"," * <p>These properties are not currently implemented in `CanvasShape` or `VMLShape`.</p> "," *"," * @config fill"," * @type Object "," */"," fill: {"," valueFn: \"_getDefaultFill\","," "," setter: function(val)"," {"," var i,"," fill,"," tmpl = this.get(\"fill\") || this._getDefaultFill();"," "," if(val)"," {"," //ensure, fill type is solid if color is explicitly passed."," if(val.hasOwnProperty(\"color\"))"," {"," val.type = \"solid\";"," }"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," { "," tmpl[i] = val[i];"," }"," }"," }"," fill = tmpl;"," if(fill && fill.color)"," {"," if(fill.color === undefined || fill.color == \"none\")"," {"," fill.color = null;"," }"," }"," this._fillFlag = true;"," return fill;"," }"," },",""," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," stroke: {"," valueFn: \"_getDefaultStroke\","," "," setter: function(val)"," {"," var i,"," stroke,"," wt,"," tmpl = this.get(\"stroke\") || this._getDefaultStroke();"," if(val)"," {"," if(val.hasOwnProperty(\"weight\"))"," {"," wt = parseInt(val.weight, 10);"," if(!isNaN(wt))"," {"," val.weight = wt;"," }"," }"," for(i in val)"," {"," if(val.hasOwnProperty(i))"," { "," tmpl[i] = val[i];"," }"," }"," }"," stroke = tmpl;"," this._strokeFlag = true;"," return stroke;"," }"," },"," "," //Not used. Remove in future."," autoSize: {"," value: false"," },",""," // Only implemented in SVG"," // Determines whether the instance will receive mouse events."," // "," // @config pointerEvents"," // @type string"," //"," pointerEvents: {"," value: \"visiblePainted\""," },",""," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this.node;"," }"," },",""," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," data: {"," setter: function(val)"," {"," if(this.get(\"node\"))"," {"," this._parsePathData(val);"," }"," return val;"," }"," },",""," /**"," * Reference to the container Graphic."," *"," * @config graphic"," * @type Graphic"," */"," graphic: {"," readOnly: true,",""," getter: function()"," {"," return this._graphic;"," }"," }","};","Y.VMLShape = VMLShape;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Path.html\">`Path`</a> class. "," * `VMLPath` is not intended to be used directly. Instead, use the <a href=\"Path.html\">`Path`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Path.html\">`Path`</a> class will point to the `VMLPath` class."," *"," * @module graphics"," * @class VMLPath"," * @extends VMLShape"," */","VMLPath = function()","{"," VMLPath.superclass.constructor.apply(this, arguments);","};","","VMLPath.NAME = \"path\";","Y.extend(VMLPath, Y.VMLShape);","VMLPath.ATTRS = Y.merge(Y.VMLShape.ATTRS, {"," /**"," * Indicates the width of the shape"," * "," * @config width"," * @type Number"," */"," width: {"," getter: function()"," {"," var val = Math.max(this._right - this._left, 0);"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," height: {"," getter: function()"," {"," return Math.max(this._bottom - this._top, 0);"," }"," },"," "," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */"," path: {"," readOnly: true,",""," getter: function()"," {"," return this._path;"," }"," }","});","Y.VMLPath = VMLPath;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Rect.html\">`Rect`</a> class. "," * `VMLRect` is not intended to be used directly. Instead, use the <a href=\"Rect.html\">`Rect`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Rect.html\">`Rect`</a> class will point to the `VMLRect` class."," *"," * @module graphics"," * @class VMLRect"," * @constructor"," */","VMLRect = function()","{"," VMLRect.superclass.constructor.apply(this, arguments);","};","VMLRect.NAME = \"rect\"; ","Y.extend(VMLRect, Y.VMLShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"rect\"","});","VMLRect.ATTRS = Y.VMLShape.ATTRS;","Y.VMLRect = VMLRect;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * `VMLEllipse` is not intended to be used directly. Instead, use the <a href=\"Ellipse.html\">`Ellipse`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Ellipse.html\">`Ellipse`</a> class will point to the `VMLEllipse` class."," *"," * @module graphics"," * @class VMLEllipse"," * @constructor"," */","VMLEllipse = function()","{"," VMLEllipse.superclass.constructor.apply(this, arguments);","};","","VMLEllipse.NAME = \"ellipse\";","","Y.extend(VMLEllipse, Y.VMLShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"oval\"","});","VMLEllipse.ATTRS = Y.merge(Y.VMLShape.ATTRS, {"," /**"," * Horizontal radius for the ellipse. "," *"," * @config xRadius"," * @type Number"," */"," xRadius: {"," lazyAdd: false,",""," getter: function()"," {"," var val = this.get(\"width\");"," val = Math.round((val/2) * 100)/100;"," return val;"," },"," "," setter: function(val)"," {"," var w = val * 2; "," this.set(\"width\", w);"," return val;"," }"," },",""," /**"," * Vertical radius for the ellipse. "," *"," * @config yRadius"," * @type Number"," * @readOnly"," */"," yRadius: {"," lazyAdd: false,"," "," getter: function()"," {"," var val = this.get(\"height\");"," val = Math.round((val/2) * 100)/100;"," return val;"," },",""," setter: function(val)"," {"," var h = val * 2;"," this.set(\"height\", h);"," return val;"," }"," }","});","Y.VMLEllipse = VMLEllipse;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Circle.html\">`Circle`</a> class. "," * `VMLCircle` is not intended to be used directly. Instead, use the <a href=\"Circle.html\">`Circle`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Circle.html\">`Circle`</a> class will point to the `VMLCircle` class."," *"," * @module graphics"," * @class VMLCircle"," * @constructor"," */","VMLCircle = function(cfg)","{"," VMLCircle.superclass.constructor.apply(this, arguments);","};","","VMLCircle.NAME = \"circle\";","","Y.extend(VMLCircle, VMLShape, {"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"oval\"","});","","VMLCircle.ATTRS = Y.merge(VMLShape.ATTRS, {"," /**"," * Radius for the circle."," *"," * @config radius"," * @type Number"," */"," radius: {"," lazyAdd: false,",""," value: 0"," },",""," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," { "," var radius = this.get(\"radius\"),"," val = radius && radius > 0 ? radius * 2 : 0;"," return val;"," }"," },",""," /**"," * Indicates the height of the shape"," *"," * @config height"," * @type Number"," */"," height: {"," setter: function(val)"," {"," this.set(\"radius\", val/2);"," return val;"," },",""," getter: function()"," { "," var radius = this.get(\"radius\"),"," val = radius && radius > 0 ? radius * 2 : 0;"," return val;"," }"," }","});","Y.VMLCircle = VMLCircle;","/**"," * Draws pie slices"," *"," * @module graphics"," * @class VMLPieSlice"," * @constructor"," */","VMLPieSlice = function()","{"," VMLPieSlice.superclass.constructor.apply(this, arguments);","};","VMLPieSlice.NAME = \"vmlPieSlice\";","Y.extend(VMLPieSlice, Y.VMLShape, Y.mix({"," /**"," * Indicates the type of shape"," *"," * @property _type"," * @type String"," * @private"," */"," _type: \"shape\",",""," /**"," * Change event listener"," *"," * @private"," * @method _updateHandler"," */"," _draw: function(e)"," {"," var x = this.get(\"cx\"),"," y = this.get(\"cy\"),"," startAngle = this.get(\"startAngle\"),"," arc = this.get(\"arc\"),"," radius = this.get(\"radius\");"," this.clear();"," this.drawWedge(x, y, startAngle, arc, radius);"," this.end();"," }"," }, Y.VMLDrawing.prototype));","VMLPieSlice.ATTRS = Y.mix({"," cx: {"," value: 0"," },",""," cy: {"," value: 0"," },"," /**"," * Starting angle in relation to a circle in which to begin the pie slice drawing."," *"," * @config startAngle"," * @type Number"," */"," startAngle: {"," value: 0"," },",""," /**"," * Arc of the slice."," *"," * @config arc"," * @type Number"," */"," arc: {"," value: 0"," },",""," /**"," * Radius of the circle in which the pie slice is drawn"," *"," * @config radius"," * @type Number"," */"," radius: {"," value: 0"," }","}, Y.VMLShape.ATTRS);","Y.VMLPieSlice = VMLPieSlice;","/**"," * <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> implementation of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * `VMLGraphic` is not intended to be used directly. Instead, use the <a href=\"Graphic.html\">`Graphic`</a> class. "," * If the browser lacks <a href=\"http://www.w3.org/TR/SVG/\">SVG</a> and <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> "," * capabilities, the <a href=\"Graphic.html\">`Graphic`</a> class will point to the `VMLGraphic` class."," *"," * @module graphics"," * @class VMLGraphic"," * @constructor"," */","VMLGraphic = function() {"," VMLGraphic.superclass.constructor.apply(this, arguments); ","};","","VMLGraphic.NAME = \"vmlGraphic\";","","VMLGraphic.ATTRS = {"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," render: {},"," "," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," id: {"," valueFn: function()"," {"," return Y.guid();"," },",""," setter: function(val)"," {"," var node = this._node;"," if(node)"," {"," node.setAttribute(\"id\", val);"," }"," return val;"," }"," },",""," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," shapes: {"," readOnly: true,",""," getter: function()"," {"," return this._shapes;"," }"," },",""," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object"," */"," contentBounds: {"," readOnly: true,",""," getter: function()"," {"," return this._contentBounds;"," }"," },",""," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," */"," node: {"," readOnly: true,",""," getter: function()"," {"," return this._node;"," }"," },",""," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," width: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.width = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," height: {"," setter: function(val)"," {"," if(this._node)"," {"," this._node.style.height = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," autoSize: {"," value: false"," },",""," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," preserveAspectRatio: {"," value: \"xMidYMid\""," },",""," /**"," * The contentBounds will resize to greater values but not values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," resizeDown: {"," resizeDown: false"," },",""," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," x: {"," getter: function()"," {"," return this._x;"," },",""," setter: function(val)"," {"," this._x = val;"," if(this._node)"," {"," this._node.style.left = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," y: {"," getter: function()"," {"," return this._y;"," },",""," setter: function(val)"," {"," this._y = val;"," if(this._node)"," {"," this._node.style.top = val + \"px\";"," }"," return val;"," }"," },",""," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," autoDraw: {"," value: true"," },",""," visible: {"," value: true,",""," setter: function(val)"," {"," this._toggleVisible(val);"," return val;"," }"," }","};","","Y.extend(VMLGraphic, Y.GraphicBase, {"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, value) "," {"," var host = this,"," redrawAttrs = {"," autoDraw: true,"," autoSize: true,"," preserveAspectRatio: true,"," resizeDown: true"," },"," key,"," forceRedraw = false;"," AttributeLite.prototype.set.apply(host, arguments); "," if(host._state.autoDraw === true && Y.Object.size(this._shapes) > 0)"," {"," if(Y_LANG.isString && redrawAttrs[attr])"," {"," forceRedraw = true;"," }"," else if(Y_LANG.isObject(attr))"," {"," for(key in redrawAttrs)"," {"," if(redrawAttrs.hasOwnProperty(key) && attr[key])"," {"," forceRedraw = true;"," break;"," }"," }"," }"," }"," if(forceRedraw)"," {"," host._redraw();"," }"," },",""," /**"," * Storage for `x` attribute."," *"," * @property _x"," * @type Number"," * @private"," */"," _x: 0,",""," /**"," * Storage for `y` attribute."," *"," * @property _y"," * @type Number"," * @private"," */"," _y: 0,",""," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," getXY: function()"," {"," var node = this.parentNode,"," x = this.get(\"x\"),"," y = this.get(\"y\"),"," xy;"," if(node)"," {"," xy = Y.one(node).getXY();"," xy[0] += x;"," xy[1] += y;"," }"," else"," {"," xy = Y.DOM._getOffset(this._node);"," }"," return xy;"," },",""," /**"," * Initializes the class."," *"," * @method initializer"," * @private"," */"," initializer: function(config) {"," var render = this.get(\"render\"),"," visibility = this.get(\"visible\") ? \"visible\" : \"hidden\";"," this._shapes = {};"," this._contentBounds = {"," left: 0,"," top: 0,"," right: 0,"," bottom: 0"," };"," this._node = this._createGraphic();"," this._node.style.left = this.get(\"x\") + \"px\";"," this._node.style.top = this.get(\"y\") + \"px\";"," this._node.style.visibility = visibility;"," this._node.setAttribute(\"id\", this.get(\"id\"));"," if(render)"," {"," this.render(render);"," }"," },"," "," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {HTMLElement} parentNode node in which to render the graphics node into."," */"," render: function(render) {"," var parentNode = Y.one(render),"," w = this.get(\"width\") || parseInt(parentNode.getComputedStyle(\"width\"), 10),"," h = this.get(\"height\") || parseInt(parentNode.getComputedStyle(\"height\"), 10);"," parentNode = parentNode || DOCUMENT.body;"," parentNode.appendChild(this._node);"," this.parentNode = parentNode;"," this.set(\"width\", w);"," this.set(\"height\", h);"," return this;"," },",""," /**"," * Removes all nodes."," *"," * @method destroy"," */"," destroy: function()"," {"," this.clear();"," Y.one(this._node).remove(true);"," },",""," /**"," * Generates a shape instance by type."," *"," * @method addShape"," * @param {Object} cfg attributes for the shape"," * @return Shape"," */"," addShape: function(cfg)"," {"," cfg.graphic = this;"," if(!this.get(\"visible\"))"," {"," cfg.visible = false;"," }"," var shapeClass = this._getShapeClass(cfg.type),"," shape = new shapeClass(cfg);"," this._appendShape(shape);"," shape._appendStrokeAndFill();"," return shape;"," },",""," /**"," * Adds a shape instance to the graphic instance."," *"," * @method _appendShape"," * @param {Shape} shape The shape instance to be added to the graphic."," * @private"," */"," _appendShape: function(shape)"," {"," var node = shape.node,"," parentNode = this._frag || this._node;"," if(this.get(\"autoDraw\") || this.get(\"autoSize\") == \"sizeContentToGraphic\") "," {"," parentNode.appendChild(node);"," }"," else"," {"," this._getDocFrag().appendChild(node);"," }"," },",""," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," removeShape: function(shape)"," {"," if(!(shape instanceof VMLShape))"," {"," if(Y_LANG.isString(shape))"," {"," shape = this._shapes[shape];"," }"," }"," if(shape && (shape instanceof VMLShape))"," {"," shape._destroy();"," this._shapes[shape.get(\"id\")] = null;"," delete this._shapes[shape.get(\"id\")];"," }"," if(this.get(\"autoDraw\"))"," {"," this._redraw();"," }"," },",""," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," removeAllShapes: function()"," {"," var shapes = this._shapes,"," i;"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].destroy();"," }"," }"," this._shapes = {};"," },",""," /**"," * Removes all child nodes."," *"," * @method _removeChildren"," * @param node"," * @private"," */"," _removeChildren: function(node)"," {"," if(node.hasChildNodes())"," {"," var child;"," while(node.firstChild)"," {"," child = node.firstChild;"," this._removeChildren(child);"," node.removeChild(child);"," }"," }"," },",""," /**"," * Clears the graphics object."," *"," * @method clear"," */"," clear: function() {"," this.removeAllShapes();"," this._removeChildren(this._node);"," },",""," /**"," * Toggles visibility"," *"," * @method _toggleVisible"," * @param {Boolean} val indicates visibilitye"," * @private"," */"," _toggleVisible: function(val)"," {"," var i,"," shapes = this._shapes,"," visibility = val ? \"visible\" : \"hidden\";"," if(shapes)"," {"," for(i in shapes)"," {"," if(shapes.hasOwnProperty(i))"," {"," shapes[i].set(\"visible\", val);"," }"," }"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," if(this._node)"," {"," this._node.style.visibility = visibility;"," }"," },",""," /**"," * Sets the size of the graphics object."," * "," * @method setSize"," * @param w {Number} width to set for the instance."," * @param h {Number} height to set for the instance."," */"," setSize: function(w, h) {"," w = Math.round(w);"," h = Math.round(h);"," this._node.style.width = w + 'px';"," this._node.style.height = h + 'px';"," },",""," /**"," * Sets the positon of the graphics object."," *"," * @method setPosition"," * @param {Number} x x-coordinate for the object."," * @param {Number} y y-coordinate for the object."," */"," setPosition: function(x, y)"," {"," x = Math.round(x);"," y = Math.round(y);"," this._node.style.left = x + \"px\";"," this._node.style.top = y + \"px\";"," },",""," /**"," * Creates a group element"," *"," * @method _createGraphic"," * @private"," */"," _createGraphic: function() {"," var group = DOCUMENT.createElement('<group xmlns=\"urn:schemas-microsft.com:vml\" style=\"behavior:url(#default#VML);padding:0px 0px 0px 0px;display:block;position:absolute;top:0px;left:0px;zoom:1;\" />');"," return group;"," },",""," /**"," * Creates a graphic node"," *"," * @method _createGraphicNode"," * @param {String} type node type to create"," * @param {String} pe specified pointer-events value"," * @return HTMLElement"," * @private"," */"," _createGraphicNode: function(type)"," {"," return DOCUMENT.createElement('<' + type + ' xmlns=\"urn:schemas-microsft.com:vml\" style=\"behavior:url(#default#VML);display:inline-block;zoom:1;\" />');"," "," },",""," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," getShapeById: function(id)"," {"," return this._shapes[id];"," },",""," /**"," * Returns a shape class. Used by `addShape`. "," *"," * @method _getShapeClass"," * @param {Shape | String} val Indicates which shape class. "," * @return Function "," * @private"," */"," _getShapeClass: function(val)"," {"," var shape = this._shapeClass[val];"," if(shape)"," {"," return shape;"," }"," return val;"," },",""," /**"," * Look up for shape classes. Used by `addShape` to retrieve a class for instantiation."," *"," * @property _shapeClass"," * @type Object"," * @private"," */"," _shapeClass: {"," circle: Y.VMLCircle,"," rect: Y.VMLRect,"," path: Y.VMLPath,"," ellipse: Y.VMLEllipse,"," pieslice: Y.VMLPieSlice"," },",""," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */"," batch: function(method)"," {"," var autoDraw = this.get(\"autoDraw\");"," this.set(\"autoDraw\", false);"," method.apply();"," this.set(\"autoDraw\", autoDraw);"," },"," "," /**"," * Returns a document fragment to for attaching shapes."," *"," * @method _getDocFrag"," * @return DocumentFragment"," * @private"," */"," _getDocFrag: function()"," {"," if(!this._frag)"," {"," this._frag = DOCUMENT.createDocumentFragment();"," }"," return this._frag;"," },",""," /**"," * Adds a shape to the redraw queue and calculates the contentBounds. "," *"," * @method addToRedrawQueue"," * @param shape {VMLShape}"," * @protected"," */"," addToRedrawQueue: function(shape)"," {"," var shapeBox,"," box;"," this._shapes[shape.get(\"id\")] = shape;"," if(!this.get(\"resizeDown\"))"," {"," shapeBox = shape.getBounds();"," box = this._contentBounds;"," box.left = box.left < shapeBox.left ? box.left : shapeBox.left;"," box.top = box.top < shapeBox.top ? box.top : shapeBox.top;"," box.right = box.right > shapeBox.right ? box.right : shapeBox.right;"," box.bottom = box.bottom > shapeBox.bottom ? box.bottom : shapeBox.bottom;"," box.width = box.right - box.left;"," box.height = box.bottom - box.top;"," this._contentBounds = box;"," }"," if(this.get(\"autoDraw\")) "," {"," this._redraw();"," }"," },",""," /**"," * Redraws all shapes."," *"," * @method _redraw"," * @private"," */"," _redraw: function()"," {"," var autoSize = this.get(\"autoSize\"),"," preserveAspectRatio,"," node = this.parentNode,"," nodeWidth = parseFloat(node.getComputedStyle(\"width\")),"," nodeHeight = parseFloat(node.getComputedStyle(\"height\")),"," xCoordOrigin = 0,"," yCoordOrigin = 0,"," box = this.get(\"resizeDown\") ? this._getUpdatedContentBounds() : this._contentBounds,"," left = box.left,"," right = box.right,"," top = box.top,"," bottom = box.bottom,"," contentWidth = right - left,"," contentHeight = bottom - top,"," aspectRatio,"," xCoordSize,"," yCoordSize,"," scaledWidth,"," scaledHeight,"," visible = this.get(\"visible\");"," this._node.style.visibility = \"hidden\";"," if(autoSize)"," {"," if(autoSize == \"sizeContentToGraphic\")"," {"," preserveAspectRatio = this.get(\"preserveAspectRatio\");"," if(preserveAspectRatio == \"none\" || contentWidth/contentHeight === nodeWidth/nodeHeight)"," {"," xCoordOrigin = left;"," yCoordOrigin = top;"," xCoordSize = contentWidth;"," yCoordSize = contentHeight;"," }"," else "," {"," if(contentWidth * nodeHeight/contentHeight > nodeWidth)"," {"," aspectRatio = nodeHeight/nodeWidth;"," xCoordSize = contentWidth;"," yCoordSize = contentWidth * aspectRatio;"," scaledHeight = (nodeWidth * (contentHeight/contentWidth)) * (yCoordSize/nodeHeight);"," yCoordOrigin = this._calculateCoordOrigin(preserveAspectRatio.slice(5).toLowerCase(), scaledHeight, yCoordSize);"," yCoordOrigin = top + yCoordOrigin;"," xCoordOrigin = left;"," }"," else"," {"," aspectRatio = nodeWidth/nodeHeight;"," xCoordSize = contentHeight * aspectRatio;"," yCoordSize = contentHeight;"," scaledWidth = (nodeHeight * (contentWidth/contentHeight)) * (xCoordSize/nodeWidth);"," xCoordOrigin = this._calculateCoordOrigin(preserveAspectRatio.slice(1, 4).toLowerCase(), scaledWidth, xCoordSize);"," xCoordOrigin = xCoordOrigin + left;"," yCoordOrigin = top;"," }"," }"," this._node.style.width = nodeWidth + \"px\";"," this._node.style.height = nodeHeight + \"px\";"," this._node.coordOrigin = xCoordOrigin + \", \" + yCoordOrigin;"," }"," else "," {"," xCoordSize = contentWidth;"," yCoordSize = contentHeight;"," this._node.style.width = contentWidth + \"px\";"," this._node.style.height = contentHeight + \"px\";"," this._state.width = contentWidth;"," this._state.height = contentHeight;",""," }"," this._node.coordSize = xCoordSize + \", \" + yCoordSize;"," }"," else"," {"," this._node.style.width = nodeWidth + \"px\";"," this._node.style.height = nodeHeight + \"px\";"," this._node.coordSize = nodeWidth + \", \" + nodeHeight;"," }"," if(this._frag)"," {"," this._node.appendChild(this._frag);"," this._frag = null;"," }"," if(visible)"," {"," this._node.style.visibility = \"visible\";"," }"," },"," "," /**"," * Determines the value for either an x or y coordinate to be used for the <code>coordOrigin</code> of the Graphic."," *"," * @method _calculateCoordOrigin"," * @param {String} position The position for placement. Possible values are min, mid and max."," * @param {Number} size The total scaled size of the content."," * @param {Number} coordsSize The coordsSize for the Graphic."," * @return Number"," * @private"," */"," _calculateCoordOrigin: function(position, size, coordsSize)"," {"," var coord;"," switch(position)"," {"," case \"min\" :"," coord = 0;"," break;"," case \"mid\" :"," coord = (size - coordsSize)/2;"," break;"," case \"max\" :"," coord = (size - coordsSize);"," break;"," }"," return coord;"," },",""," /**"," * Recalculates and returns the `contentBounds` for the `Graphic` instance."," *"," * @method _getUpdatedContentBounds"," * @return {Object} "," * @private"," */"," _getUpdatedContentBounds: function()"," {"," var bounds,"," i,"," shape,"," queue = this._shapes,"," box = {};"," for(i in queue)"," {"," if(queue.hasOwnProperty(i))"," {"," shape = queue[i];"," bounds = shape.getBounds();"," box.left = Y_LANG.isNumber(box.left) ? Math.min(box.left, bounds.left) : bounds.left;"," box.top = Y_LANG.isNumber(box.top) ? Math.min(box.top, bounds.top) : bounds.top;"," box.right = Y_LANG.isNumber(box.right) ? Math.max(box.right, bounds.right) : bounds.right;"," box.bottom = Y_LANG.isNumber(box.bottom) ? Math.max(box.bottom, bounds.bottom) : bounds.bottom;"," }"," }"," box.left = Y_LANG.isNumber(box.left) ? box.left : 0;"," box.top = Y_LANG.isNumber(box.top) ? box.top : 0;"," box.right = Y_LANG.isNumber(box.right) ? box.right : 0;"," box.bottom = Y_LANG.isNumber(box.bottom) ? box.bottom : 0;"," this._contentBounds = box;"," return box;"," },",""," /**"," * Inserts shape on the top of the tree."," *"," * @method _toFront"," * @param {VMLShape} Shape to add."," * @private"," */"," _toFront: function(shape)"," {"," var contentNode = this._node;"," if(shape instanceof Y.VMLShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," contentNode.appendChild(shape);"," }"," },",""," /**"," * Inserts shape as the first child of the content node."," *"," * @method _toBack"," * @param {VMLShape} Shape to add."," * @private"," */"," _toBack: function(shape)"," {"," var contentNode = this._node,"," targetNode;"," if(shape instanceof Y.VMLShape)"," {"," shape = shape.get(\"node\");"," }"," if(contentNode && shape)"," {"," targetNode = contentNode.firstChild;"," if(targetNode)"," {"," contentNode.insertBefore(shape, targetNode);"," }"," else"," {"," contentNode.appendChild(shape);"," }"," }"," }","});","Y.VMLGraphic = VMLGraphic;","","","","}, '3.7.3', {\"requires\": [\"graphics\"]});"]; _yuitest_coverage["build/graphics-vml/graphics-vml.js"].lines = {"1":0,"3":0,"24":0,"36":0,"76":0,"88":0,"89":0,"91":0,"92":0,"94":0,"127":0,"142":0,"154":0,"173":0,"174":0,"175":0,"177":0,"178":0,"179":0,"180":0,"181":0,"182":0,"183":0,"185":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"193":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"203":0,"205":0,"218":0,"231":0,"243":0,"258":0,"260":0,"261":0,"262":0,"263":0,"264":0,"265":0,"266":0,"267":0,"268":0,"269":0,"270":0,"271":0,"272":0,"273":0,"275":0,"288":0,"289":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0,"310":0,"311":0,"312":0,"313":0,"314":0,"315":0,"316":0,"317":0,"318":0,"319":0,"332":0,"336":0,"337":0,"338":0,"339":0,"340":0,"341":0,"355":0,"359":0,"360":0,"361":0,"362":0,"363":0,"364":0,"379":0,"381":0,"382":0,"383":0,"384":0,"385":0,"386":0,"403":0,"404":0,"406":0,"408":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"415":0,"416":0,"417":0,"429":0,"441":0,"453":0,"461":0,"462":0,"463":0,"464":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"471":0,"476":0,"477":0,"478":0,"479":0,"480":0,"481":0,"482":0,"483":0,"484":0,"485":0,"488":0,"489":0,"501":0,"513":0,"525":0,"530":0,"531":0,"532":0,"533":0,"534":0,"535":0,"546":0,"554":0,"555":0,"556":0,"558":0,"560":0,"562":0,"564":0,"567":0,"569":0,"571":0,"573":0,"574":0,"575":0,"576":0,"577":0,"579":0,"580":0,"581":0,"591":0,"601":0,"611":0,"612":0,"613":0,"614":0,"615":0,"616":0,"617":0,"618":0,"631":0,"636":0,"637":0,"640":0,"641":0,"642":0,"643":0,"646":0,"660":0,"668":0,"670":0,"671":0,"672":0,"673":0,"674":0,"676":0,"677":0,"678":0,"679":0,"680":0,"681":0,"693":0,"694":0,"696":0,"698":0,"700":0,"702":0,"704":0,"706":0,"708":0,"709":0,"724":0,"736":0,"738":0,"739":0,"740":0,"741":0,"744":0,"746":0,"765":0,"776":0,"779":0,"780":0,"782":0,"784":0,"786":0,"788":0,"801":0,"802":0,"804":0,"808":0,"809":0,"812":0,"813":0,"814":0,"826":0,"828":0,"830":0,"832":0,"845":0,"866":0,"867":0,"868":0,"869":0,"870":0,"872":0,"874":0,"876":0,"877":0,"878":0,"879":0,"880":0,"881":0,"883":0,"884":0,"885":0,"887":0,"889":0,"891":0,"893":0,"895":0,"897":0,"899":0,"901":0,"902":0,"903":0,"907":0,"909":0,"911":0,"913":0,"914":0,"916":0,"918":0,"920":0,"924":0,"925":0,"927":0,"929":0,"930":0,"931":0,"942":0,"943":0,"954":0,"955":0,"966":0,"970":0,"982":0,"984":0,"985":0,"997":0,"1008":0,"1010":0,"1022":0,"1035":0,"1045":0,"1047":0,"1048":0,"1049":0,"1050":0,"1052":0,"1054":0,"1055":0,"1056":0,"1057":0,"1058":0,"1059":0,"1060":0,"1061":0,"1062":0,"1063":0,"1064":0,"1066":0,"1067":0,"1068":0,"1070":0,"1071":0,"1074":0,"1076":0,"1080":0,"1081":0,"1083":0,"1084":0,"1087":0,"1089":0,"1100":0,"1102":0,"1104":0,"1114":0,"1116":0,"1117":0,"1118":0,"1120":0,"1122":0,"1123":0,"1124":0,"1125":0,"1126":0,"1127":0,"1128":0,"1129":0,"1130":0,"1132":0,"1133":0,"1135":0,"1136":0,"1137":0,"1139":0,"1140":0,"1141":0,"1143":0,"1144":0,"1147":0,"1149":0,"1153":0,"1154":0,"1156":0,"1157":0,"1160":0,"1161":0,"1165":0,"1167":0,"1169":0,"1171":0,"1184":0,"1191":0,"1193":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1204":0,"1206":0,"1209":0,"1210":0,"1212":0,"1214":0,"1215":0,"1216":0,"1217":0,"1219":0,"1220":0,"1221":0,"1223":0,"1227":0,"1229":0,"1240":0,"1242":0,"1244":0,"1251":0,"1253":0,"1255":0,"1256":0,"1257":0,"1259":0,"1261":0,"1263":0,"1265":0,"1269":0,"1276":0,"1277":0,"1279":0,"1281":0,"1284":0,"1285":0,"1286":0,"1289":0,"1291":0,"1292":0,"1293":0,"1294":0,"1296":0,"1297":0,"1299":0,"1301":0,"1303":0,"1307":0,"1308":0,"1309":0,"1312":0,"1314":0,"1315":0,"1319":0,"1320":0,"1326":0,"1328":0,"1329":0,"1343":0,"1365":0,"1367":0,"1369":0,"1371":0,"1373":0,"1377":0,"1379":0,"1380":0,"1382":0,"1384":0,"1385":0,"1386":0,"1387":0,"1388":0,"1389":0,"1390":0,"1391":0,"1392":0,"1393":0,"1394":0,"1396":0,"1397":0,"1398":0,"1399":0,"1400":0,"1401":0,"1402":0,"1403":0,"1404":0,"1405":0,"1406":0,"1408":0,"1410":0,"1412":0,"1413":0,"1426":0,"1427":0,"1428":0,"1429":0,"1430":0,"1432":0,"1444":0,"1457":0,"1459":0,"1461":0,"1463":0,"1467":0,"1468":0,"1471":0,"1472":0,"1473":0,"1475":0,"1476":0,"1478":0,"1479":0,"1482":0,"1484":0,"1486":0,"1493":0,"1494":0,"1496":0,"1498":0,"1499":0,"1501":0,"1502":0,"1504":0,"1506":0,"1508":0,"1511":0,"1512":0,"1525":0,"1527":0,"1528":0,"1567":0,"1568":0,"1569":0,"1581":0,"1582":0,"1594":0,"1595":0,"1607":0,"1618":0,"1629":0,"1640":0,"1651":0,"1665":0,"1667":0,"1669":0,"1690":0,"1692":0,"1693":0,"1694":0,"1695":0,"1696":0,"1697":0,"1710":0,"1711":0,"1722":0,"1742":0,"1761":0,"1762":0,"1763":0,"1765":0,"1780":0,"1785":0,"1787":0,"1788":0,"1789":0,"1790":0,"1792":0,"1807":0,"1818":0,"1820":0,"1822":0,"1823":0,"1824":0,"1825":0,"1827":0,"1828":0,"1829":0,"1831":0,"1834":0,"1835":0,"1837":0,"1839":0,"1840":0,"1850":0,"1851":0,"1853":0,"1864":0,"1865":0,"1867":0,"1880":0,"1888":0,"1890":0,"1891":0,"1892":0,"1894":0,"1895":0,"1896":0,"1897":0,"1898":0,"1900":0,"1902":0,"1906":0,"1910":0,"1921":0,"1922":0,"1924":0,"1928":0,"1940":0,"1942":0,"1944":0,"1945":0,"1947":0,"1949":0,"1950":0,"1952":0,"1957":0,"1968":0,"2004":0,"2007":0,"2008":0,"2009":0,"2010":0,"2011":0,"2013":0,"2015":0,"2016":0,"2021":0,"2054":0,"2059":0,"2060":0,"2062":0,"2064":0,"2094":0,"2096":0,"2098":0,"2100":0,"2152":0,"2156":0,"2159":0,"2161":0,"2163":0,"2165":0,"2167":0,"2171":0,"2172":0,"2174":0,"2176":0,"2179":0,"2180":0,"2217":0,"2221":0,"2223":0,"2225":0,"2226":0,"2228":0,"2231":0,"2233":0,"2235":0,"2239":0,"2240":0,"2241":0,"2272":0,"2287":0,"2289":0,"2291":0,"2306":0,"2310":0,"2321":0,"2323":0,"2326":0,"2327":0,"2328":0,"2338":0,"2339":0,"2352":0,"2368":0,"2372":0,"2383":0,"2385":0,"2387":0,"2388":0,"2398":0,"2399":0,"2410":0,"2412":0,"2415":0,"2417":0,"2427":0,"2439":0,"2440":0,"2441":0,"2446":0,"2447":0,"2448":0,"2464":0,"2465":0,"2466":0,"2471":0,"2472":0,"2473":0,"2477":0,"2488":0,"2490":0,"2493":0,"2495":0,"2506":0,"2528":0,"2529":0,"2534":0,"2536":0,"2549":0,"2550":0,"2555":0,"2557":0,"2561":0,"2569":0,"2571":0,"2573":0,"2574":0,"2592":0,"2597":0,"2598":0,"2599":0,"2602":0,"2640":0,"2651":0,"2652":0,"2655":0,"2657":0,"2675":0,"2680":0,"2681":0,"2683":0,"2685":0,"2701":0,"2716":0,"2731":0,"2744":0,"2746":0,"2748":0,"2761":0,"2763":0,"2765":0,"2835":0,"2840":0,"2841":0,"2843":0,"2845":0,"2858":0,"2863":0,"2864":0,"2866":0,"2868":0,"2890":0,"2891":0,"2896":0,"2908":0,"2917":0,"2918":0,"2920":0,"2922":0,"2924":0,"2926":0,"2928":0,"2930":0,"2931":0,"2936":0,"2938":0,"2968":0,"2972":0,"2974":0,"2975":0,"2976":0,"2980":0,"2982":0,"2992":0,"2994":0,"2995":0,"3001":0,"3002":0,"3003":0,"3004":0,"3005":0,"3006":0,"3008":0,"3019":0,"3022":0,"3023":0,"3024":0,"3025":0,"3026":0,"3027":0,"3037":0,"3038":0,"3050":0,"3051":0,"3053":0,"3055":0,"3057":0,"3058":0,"3059":0,"3071":0,"3073":0,"3075":0,"3079":0,"3091":0,"3093":0,"3095":0,"3098":0,"3100":0,"3101":0,"3102":0,"3104":0,"3106":0,"3117":0,"3119":0,"3121":0,"3123":0,"3126":0,"3138":0,"3140":0,"3141":0,"3143":0,"3144":0,"3145":0,"3156":0,"3157":0,"3169":0,"3172":0,"3174":0,"3176":0,"3178":0,"3182":0,"3184":0,"3186":0,"3188":0,"3200":0,"3201":0,"3202":0,"3203":0,"3215":0,"3216":0,"3217":0,"3218":0,"3228":0,"3229":0,"3243":0,"3256":0,"3269":0,"3270":0,"3272":0,"3274":0,"3300":0,"3301":0,"3302":0,"3303":0,"3315":0,"3317":0,"3319":0,"3331":0,"3333":0,"3334":0,"3336":0,"3337":0,"3338":0,"3339":0,"3340":0,"3341":0,"3342":0,"3343":0,"3344":0,"3346":0,"3348":0,"3360":0,"3380":0,"3381":0,"3383":0,"3385":0,"3386":0,"3388":0,"3389":0,"3390":0,"3391":0,"3395":0,"3397":0,"3398":0,"3399":0,"3400":0,"3401":0,"3402":0,"3403":0,"3407":0,"3408":0,"3409":0,"3410":0,"3411":0,"3412":0,"3413":0,"3416":0,"3417":0,"3418":0,"3422":0,"3423":0,"3424":0,"3425":0,"3426":0,"3427":0,"3430":0,"3434":0,"3435":0,"3436":0,"3438":0,"3440":0,"3441":0,"3443":0,"3445":0,"3461":0,"3462":0,"3465":0,"3466":0,"3468":0,"3469":0,"3471":0,"3472":0,"3474":0,"3486":0,"3491":0,"3493":0,"3495":0,"3496":0,"3497":0,"3498":0,"3499":0,"3500":0,"3503":0,"3504":0,"3505":0,"3506":0,"3507":0,"3508":0,"3520":0,"3521":0,"3523":0,"3525":0,"3527":0,"3540":0,"3542":0,"3544":0,"3546":0,"3548":0,"3549":0,"3551":0,"3555":0,"3560":0}; _yuitest_coverage["build/graphics-vml/graphics-vml.js"].functions = {"VMLDrawing:24":0,"_round:74":0,"_addToPath:86":0,"curveTo:126":0,"relativeCurveTo:141":0,"_curveTo:153":0,"quadraticCurveTo:217":0,"relativeQuadraticCurveTo:230":0,"_quadraticCurveTo:242":0,"drawRect:287":0,"drawRoundRect:309":0,"drawCircle:331":0,"drawEllipse:354":0,"drawDiamond:377":0,"drawWedge:401":0,"lineTo:427":0,"relativeLineTo:439":0,"_lineTo:452":0,"moveTo:499":0,"relativeMoveTo:511":0,"_moveTo:524":0,"_closePath:544":0,"end:589":0,"closePath:599":0,"clear:609":0,"getBezierData:630":0,"_setCurveBoundingBox:658":0,"_trackSize:692":0,"VMLShape:736":0,"init:763":0,"initializer:774":0,"_setGraphic:799":0,"_appendStrokeAndFill:824":0,"createNode:843":0,"addClass:940":0,"removeClass:952":0,"getXY:964":0,"setXY:980":0,"contains:995":0,"compareTo:1007":0,"test:1020":0,"_getStrokeProps:1033":0,"_strokeChangeHandler:1098":0,"_getFillProps:1182":0,"_fillChangeHandler:1238":0,"_updateFillNode:1324":0,"_getGradientFill:1341":0,"_addTransform:1424":0,"_updateTransform:1442":0,"_getSkewOffsetValue:1523":0,"translate:1565":0,"translateX:1579":0,"translateY:1592":0,"skew:1605":0,"skewX:1616":0,"skewY:1627":0,"rotate:1638":0,"scale:1649":0,"on:1663":0,"_updateHandler:1688":0,"_createGraphicNode:1708":0,"_getDefaultFill:1721":0,"_getDefaultStroke:1740":0,"set:1759":0,"getBounds:1778":0,"_getContentRect:1805":0,"toFront:1848":0,"toBack:1862":0,"_parsePathData:1878":0,"destroy:1919":0,"_destroy:1938":0,"valueFn:1966":0,"setter:2002":0,"getter:2019":0,"valueFn:2052":0,"setter:2057":0,"setter:2093":0,"setter:2150":0,"setter:2215":0,"getter:2270":0,"setter:2285":0,"getter:2304":0,"VMLPath:2321":0,"getter:2336":0,"getter:2350":0,"getter:2366":0,"VMLRect:2383":0,"VMLEllipse:2410":0,"getter:2437":0,"setter:2444":0,"getter:2462":0,"setter:2469":0,"VMLCircle:2488":0,"setter:2526":0,"getter:2532":0,"setter:2547":0,"getter:2553":0,"VMLPieSlice:2569":0,"_draw:2590":0,"VMLGraphic:2651":0,"valueFn:2673":0,"setter:2678":0,"getter:2699":0,"getter:2714":0,"getter:2729":0,"setter:2742":0,"setter:2759":0,"getter:2833":0,"setter:2838":0,"getter:2856":0,"setter:2861":0,"setter:2888":0,"set:2906":0,"getXY:2966":0,"initializer:2991":0,"render:3018":0,"destroy:3035":0,"addShape:3048":0,"_appendShape:3069":0,"removeShape:3089":0,"removeAllShapes:3115":0,"_removeChildren:3136":0,"clear:3155":0,"_toggleVisible:3167":0,"setSize:3199":0,"setPosition:3213":0,"_createGraphic:3227":0,"_createGraphicNode:3241":0,"getShapeById:3254":0,"_getShapeClass:3267":0,"batch:3298":0,"_getDocFrag:3313":0,"addToRedrawQueue:3329":0,"_redraw:3358":0,"_calculateCoordOrigin:3459":0,"_getUpdatedContentBounds:3484":0,"_toFront:3518":0,"_toBack:3538":0,"(anonymous 1):1":0}; _yuitest_coverage["build/graphics-vml/graphics-vml.js"].coveredLines = 924;@@ -4662,4 +4662,4 @@ -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-vml/graphics-vml-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -3567,4 +3567,4 @@ -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics-vml/graphics-vml-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics-vml",function(e,t){function S(){}var n="vml",r="shape",i=/[a-z][^a-z]*/ig,s=/[-]?[0-9]*[0-9|\.][0-9]*/g,o=e.Lang,u=o.isNumber,a=o.isArray,f=o.isString,l=e.DOM,c=e.Selector,h=e.config.doc,p=e.AttributeLite,d,v,m,g,y,b,w,E=e.ClassNameManager.getClassName;S.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_coordSpaceMultiplier:100,_round:function(e){return Math.round(e*this._coordSpaceMultiplier)},_addToPath:function(e){this._path=this._path||"",this._movePath&&(this._path+=this._movePath,this._movePath=null),this._path+=e},_currentX:0,_currentY:0,curveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!1])},relativeCurveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!0])},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y=t?" v ":" c ",b=t?parseFloat(this._currentX):0,w=t?parseFloat(this._currentY):0;m=e.length-5,g=y;for(v=0;v<m;v+=6)o=parseFloat(e[v]),u=parseFloat(e[v+1]),a=parseFloat(e[v+2]),f=parseFloat(e[v+3]),i=parseFloat(e[v+4]),s=parseFloat(e[v+5]),v>0&&(g+=", "),g=g+this._round(o)+", "+this._round(u)+", "+this._round(a)+", "+this._round(f)+", "+this._round(i)+", "+this._round(s),o+=b,u+=w,a+=b,f+=w,i+=b,s+=w,c=Math.max(i,Math.max(o,a)),p=Math.max(s,Math.max(u,f)),h=Math.min(i,Math.min(o,a)),d=Math.min(s,Math.min(u,f)),n=Math.abs(c-h),r=Math.abs(p-d),l=[[this._currentX,this._currentY],[o,u],[a,f],[i,s]],this._setCurveBoundingBox(l,n,r),this._currentX=i,this._currentY=s;this._addToPath(g)},quadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!1])},relativeQuadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!0])},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l=this._currentX,c=this._currentY,h,p=e.length-3,d=[],v=t?parseFloat(this._currentX):0,m=t?parseFloat(this._currentY):0;for(h=0;h<p;h+=4)n=parseFloat(e[h])+v,r=parseFloat(e[h+1])+m,a=parseFloat(e[h+2])+v,f=parseFloat(e[h+3])+m,i=l+.67*(n-l),s=c+.67*(r-c),o=i+(a-l)*.34,u=s+(f-c)*.34,d.push(i),d.push(s),d.push(o),d.push(u),d.push(a),d.push(f);this._curveTo.apply(this,[d,!1])},drawRect:function(e,t,n,r){return this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this._currentX=e,this._currentY=t,this},drawRoundRect:function(e,t,n,r,i,s){return this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s),this},drawCircle:function(e,t,n){var r=0,i=360,s=n*2;return i*=65535,this._drawingComplete=!1,this._trackSize(e+s,t+s),this.moveTo(e+s,t+n),this._addToPath(" ae "+this._round(e+n)+", "+this._round(t+n)+", "+this._round(n)+", "+this._round(n)+", "+r+", "+i),this},drawEllipse:function(e,t,n,r){var i=0,s=360,o=n*.5,u=r*.5;return s*=65535,this._drawingComplete=!1,this._trackSize(e+n,t+r),this.moveTo(e+n,t+u),this._addToPath(" ae "+this._round(e+o)+", "+this._round(e+o)+", "+this._round(t+u)+", "+this._round(o)+", "+this._round(u)+", "+i+", "+s),this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawWedge:function(e,t,n,r,i){var s=i*2;return Math.abs(r)>360&&(r=360),this._currentX=e,this._currentY=t,n*=-65535,r*=65536,n=Math.round(n),r=Math.round(r),this.moveTo(e,t),this._addToPath(" ae "+this._round(e)+", "+this._round(t)+", "+this._round(i)+" "+this._round(i)+", "+n+", "+r),this._trackSize(s,s),this},lineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!1])},relativeLineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!0])},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=t?" r ":" l ",a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;if(typeof n=="string"||typeof n=="number"){i=e.length-1;for(r=0;r<i;r+=2)s=parseFloat(e[r]),o=parseFloat(e[r+1]),u+=" "+this._round(s)+", "+this._round(o),s+=a,o+=f,this._currentX=s,this._currentY=o,this._trackSize.apply(this,[s,o])}else{i=e.length;for(r=0;r<i;r+=1)s=parseFloat(e[r][0]),o=parseFloat(e[r][1]),u+=" "+this._round(s)+", "+this._round(o),s+=a,o+=f,this._currentX=s,this._currentY=o,this._trackSize.apply(this,[s,o])}return this._addToPath(u),this},moveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!1])},relativeMoveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!0])},_moveTo:function(e,t){var n=parseFloat(e[0]),r=parseFloat(e[1]),i=t?" t ":" m ",s=t?parseFloat(this._currentX):0,o=t?parseFloat(this._currentY):0;this._movePath=i+this._round(n)+", "+this._round(r),n+=s,r+=o,this._trackSize(n,r),this._currentX=n,this._currentY=r},_closePath:function(){var e=this.get("fill"),t=this.get("stroke"),n=this.node,r=this.get("width"),i=this.get("height"),s=this._path,o="",u=this._coordSpaceMultiplier;this._fillChangeHandler(),this._strokeChangeHandler(),s&&(e&&e.color&&(o+=" x"),t&&(o+=" e")),s&&(n.path=s+o),!isNaN(r)&&!isNaN(i)&&(n.coordOrigin=this._left+", "+this._top,n.coordSize=r*u+", "+i*u,n.style.position="absolute",n.style.width=r+"px",n.style.height=i+"px"),this._path=s,this._movePath=null,this._updateTransform()},end:function(){this._closePath()},closePath:function(){this._addToPath(" x e")},clear:function(){this._right=0,this._bottom=0,this._width=0,this._height=0,this._left=0,this._top=0,this._path="",this._movePath=null},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r,i=this._currentX,s=i,o=this._currentY,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l;for(r=0;r<a;++r)l=this.getBezierData(e,f*r),i=isNaN(i)?l[0]:Math.min(l[0],i),s=isNaN(s)?l[0]:Math.max(l[0],s),o=isNaN(o)?l[1]:Math.min(l[1],o),u=isNaN(u)?l[1]:Math.max(l[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s,u),this._trackSize(i,o)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top},_left:0,_right:0,_top:0,_bottom:0,_width:0,_height:0},e.VMLDrawing=S,d=function(){this._transforms=[],this.matrix=new e.Matrix,this._normalizedMatrix=new e.Matrix,d.superclass.constructor.apply(this,arguments)},d.NAME="shape",e.extend(d,e.GraphicBase,e.mix({_type:"shape",init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t.createNode(),n&&this._setGraphic(n),r&&t._parsePathData(r),this._updateHandler()},_setGraphic:function(t){var n;t instanceof e.VMLGraphic?this._graphic=t:(t=e.one(t),n=new e.VMLGraphic({render:t}),n._appendShape(this),this._graphic=n,this._appendStrokeAndFill())},_appendStrokeAndFill:function(){this._strokeNode&&this.node.appendChild(this._strokeNode),this._fillNode&&this.node.appendChild(this._fillNode)},createNode:function(){var e,t=this._camelCaseConcat,i=this.get("x"),s=this.get("y"),o=this.get("width"),u=this.get("height"),a,f,l=this.name,c,p=this.get("visible")?"visible":"hidden",d,v,m,g,y,b,w,S,x,T;a=this.get("id"),f=this._type=="path"?"shape":this._type,v=E(r)+" "+E(t(n,r))+" "+E(l)+" "+E(t(n,l))+" "+n+f,m=this._getStrokeProps(),x=this._getFillProps(),c="<"+f+' xmlns="urn:schemas-microsft.com:vml" id="'+a+'" class="'+v+'" style="behavior:url(#default#VML);display:inline-block;position:absolute;left:'+i+"px;top:"+s+"px;width:"+o+"px;height:"+u+"px;visibility:"+p+'"',m&&m.weight&&m.weight>0?(g=m.endcap,y=parseFloat(m.opacity),b=m.joinstyle,w=m.miterlimit,S=m.dashstyle,c+=' stroked="t" strokecolor="'+m.color+'" strokeWeight="'+m.weight+'px"',d='<stroke class="vmlstroke" xmlns="urn:schemas-microsft.com:vml" on="t" style="behavior:url(#default#VML);display:inline-block;"',d+=' opacity="'+y+'"',g&&(d+=' endcap="'+g+'"'),b&&(d+=' joinstyle="'+b+'"'),w&&(d+=' miterlimit="'+w+'"'),S&&(d+=' dashstyle="'+S+'"'),d+="></stroke>",this._strokeNode=h.createElement(d),c+=' stroked="t"'):c+=' stroked="f"',x&&(x.node&&(T=x.node,this._fillNode=h.createElement(T)),x.color&&(c+=' fillcolor="'+x.color+'"'),c+=' filled="'+x.filled+'"'),c+=">",c+="</"+f+">",e=h.createElement(c),this.node=e,this._strokeFlag=!1,this._fillFlag=!1},addClass:function(e){var t=this.node;l.addClass(t,e)},removeClass:function(e){var t=this.node;l.removeClass(t,e)},getXY:function(){var e=this._graphic,t=e.getXY(),n=this.get("x"),r=this.get("y");return[t[0]+n,t[1]+r]},setXY:function(e){var t=this._graphic,n=t.getXY();this.set("x",e[0]-n[0]),this.set("y",e[1]-n[1])},contains:function(t){return t===e.one(this.node)},compareTo:function(e){var t=this.node;return t===e},test:function(e){return c.test(this.node,e)},_getStrokeProps:function(){var e,t=this.get("stroke"),n,r,i="",s,o=0,f,l,c;if(t&&t.weight&&t.weight>0){e={},l=t.linecap||"flat",c=t.linejoin||"round",l!="round"&&l!="square"&&(l="flat"),n=parseFloat(t.opacity),r=t.dashstyle||"none",t.color=t.color||"#000000",t.weight=t.weight||1,t.opacity=u(n)?n:1,e.stroked=!0,e.color=t.color,e.weight=t.weight,e.endcap=l,e.opacity=t.opacity;if(a(r)){i=[],f=r.length;for(o=0;o<f;++o)s=r[o],i[o]=s/t.weight}c=="round"||c=="bevel"?e.joinstyle=c:(c=parseInt(c,10),u(c)&&(e.miterlimit=Math.max(c,1),e.joinstyle="miter")),e.dashstyle=i}return e},_strokeChangeHandler:function(e){if(!this._strokeFlag)return;var t=this.node,n=this.get("stroke"),r,i,s="",o,f=0,l,c,h;if(n&&n.weight&&n.weight>0){c=n.linecap||"flat",h=n.linejoin||"round",c!="round"&&c!="square"&&(c="flat"),r=parseFloat(n.opacity),i=n.dashstyle||"none",n.color=n.color||"#000000",n.weight=n.weight||1,n.opacity=u(r)?r:1,t.stroked=!0,t.strokeColor=n.color,t.strokeWeight=n.weight+"px",this._strokeNode||(this._strokeNode=this._createGraphicNode("stroke"),t.appendChild(this._strokeNode)),this._strokeNode.endcap=c,this._strokeNode.opacity=n.opacity;if(a(i)){s=[],l=i.length;for(f=0;f<l;++f)o=i[f],s[f]=o/n.weight}h=="round"||h=="bevel"?this._strokeNode.joinstyle=h:(h=parseInt(h,10),u(h)&&(this._strokeNode.miterlimit=Math.max(h,1),this._strokeNode.joinstyle="miter")),this._strokeNode.dashstyle=s,this._strokeNode.on=!0}else this._strokeNode&&(this._strokeNode.on=!1),t.stroked=!1;this._strokeFlag=!1},_getFillProps:function(){var e=this.get("fill"),t,n,r,i,s,o=!1;if(e){n={};if(e.type=="radial"||e.type=="linear"){t=parseFloat(e.opacity),t=u(t)?t:1,o=!0,r=this._getGradientFill(e),s='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" opacity="'+t+'"';for(i in r)r.hasOwnProperty(i)&&(s+=" "+i+'="'+r[i]+'"');s+=" />",n.node=s}else e.color&&(t=parseFloat(e.opacity),o=!0,n.color=e.color,u(t)&&(t=Math.max(Math.min(t,1),0),n.opacity=t,t<1&&(n.node='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" type="solid" opacity="'+t+'"/>')));n.filled=o}return n},_fillChangeHandler:function(e){if(!this._fillFlag)return;var t=this.node,n=this.get("fill"),r,i,s=!1,o,a;if(n)if(n.type=="radial"||n.type=="linear"){s=!0,a=this._getGradientFill(n);if(this._fillNode)for(o in a)a.hasOwnProperty(o)&&(o=="colors"?this._fillNode.colors.value=a[o]:this._fillNode[o]=a[o]);else{i='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;"';for(o in a)a.hasOwnProperty(o)&&(i+=" "+o+'="'+a[o]+'"');i+=" />",this._fillNode=h.createElement(i),t.appendChild(this._fillNode)}}else n.color&&(t.fillcolor=n.color,r=parseFloat(n.opacity),s=!0,u(r)&&r<1?(n.opacity=r,this._fillNode?(this._fillNode.getAttribute("type")!="solid"&&(this._fillNode.type="solid"),this._fillNode.opacity=r):(i='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" type="solid" opacity="'+r+'"/>',this._fillNode=h.createElement(i),t.appendChild(this._fillNode))):this._fillNode&&(this._fillNode.opacity=1,this._fillNode.type="solid"));t.filled=s,this._fillFlag=!1},_updateFillNode:function(e){this._fillNode||(this._fillNode=this._createGraphicNode("fill"),e.appendChild(this._fillNode))},_getGradientFill:function(e){var t={},n,r,i=e.type,s=this.get("width"),o=this.get("height"),a=u,f,l=e.stops,c=l.length,h,p,d,v,m="",g=e.cx,y=e.cy,b=e.fx,w=e.fy,E=e.r,S,x=e.rotation||0;i==="linear"?(x<=270?x=Math.abs(x-270):x<360?x=270+(360-x):x=270,t.type="gradient",t.angle=x):i==="radial"&&(n=s*E*2,r=o*E*2,b=E*2*(b-.5),w=E*2*(w-.5),b+=g,w+=y,t.focussize=n/s/10+"% "+r/o/10+"%",t.alignshape=!1,t.type="gradientradial",t.focus="100%",t.focusposition=Math.round(b*100)+"% "+Math.round(w*100)+"%");for(d=0;d<c;++d)f=l[d],p=f.color,h=f.opacity,h=a(h)?h:1,S=f.offset||d/(c-1),S*=E*2,S=Math.round(100*S)+"%",v=d>0?d+1:"",t["opacity"+v]=h+"",m+=", "+S+" "+p;return parseFloat(S)<100&&(m+=", 100% "+p),t.colors=m.substr(2),t},_addTransform:function(t,n){n=e.Array(n),this._transform=o.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var t=this.node,n,r,i,s=this.get("x"),o=this.get("y"),u,a,f=this.matrix,l=this._normalizedMatrix,c=this instanceof e.VMLPath,p,d=this._transforms.length;if(this._transforms&&this._transforms.length>0){i=this.get("transformOrigin"),c&&l.translate(this._left,this._top),u=i[0]-.5,a=i[1]-.5,u=Math.max(-0.5,Math.min(.5,u)),a=Math.max(-0.5,Math.min(.5,a));for(p=0;p<d;++p)n=this._transforms[p].shift(),n&&(l[n].apply(l,this._transforms[p]),f[n].apply(f,this._transforms[p]));c&&l.translate(-this._left,-this._top),r=l.a+","+l.c+","+l.b+","+l.d+","+0+","+0}this._graphic.addToRedrawQueue(this),r&&(this._skew||(this._skew=h.createElement('<skew class="vmlskew" xmlns="urn:schemas-microsft.com:vml" on="false" style="behavior:url(#default#VML);display:inline-block;" />'),this.node.appendChild(this._skew)),this._skew.matrix=r,this._skew.on=!0,this._skew.origin=u+", "+a),this._type!="path"&&(this._transforms=[]),t.style.left=s+this._getSkewOffsetValue(l.dx)+"px",t.style.top=o+this._getSkewOffsetValue(l.dy)+"px"},_getSkewOffsetValue:function(t){var n=e.MatrixUtil.sign(t),r=Math.abs(t);return t=Math.min(r,32767)*n,t},_translateX:0,_translateY:0,_transform:"",translate:function(e,t){this._translateX+=e,this._translateY+=t,this._addTransform("translate",arguments)},translateX:function(e){this._translateX+=e,this._addTransform("translateX",arguments)},translateY:function(e){this._translateY+=e,this._addTransform("translateY",arguments)},skew:function(e,t){this._addTransform("skew",arguments)},skewX:function(e){this._addTransform("skewX",arguments)},skewY:function(e){this._addTransform("skewY",arguments)},rotate:function(e){this._addTransform("rotate",arguments)},scale:function(e,t){this._addTransform("scale",arguments)},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.one("#"+this.get("id")).on(t,n):e.on.apply(this,arguments)},_draw:function(){},_updateHandler:function(e){var t=this,n=t.node;t._fillChangeHandler(),t._strokeChangeHandler(),n.style.width=this.get("width")+"px",n.style.height=this.get("height")+"px",this._draw(),t._updateTransform()},_createGraphicNode:function(e){return e=e||this._type,h.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);display:inline-block;" class="vml'+e+'"/>')},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},set:function(){var e=this;p.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},getBounds:function(){var t=this instanceof e.VMLPath,n=this.get("width"),r=this.get("height"),i=this.get("x"),s=this.get("y");return t&&(i+=this._left,s+=this._top,n=this._right-this._left,r=this._bottom-this._top),this._getContentRect(n,r,i,s)},_getContentRect:function(t,n,r,i){var s=this.get("transformOrigin"),o=s[0]*t,u=s[1]*n,a=this.matrix.getTransformArray(this.get("transform")),f=new e.Matrix,l,c=a.length,h,p,d,v=this instanceof e.VMLPath;v&&f.translate(this._left,this._top),o=isNaN(o)?0:o,u=isNaN(u)?0:u,f.translate(o,u);for(l=0;l<c;l+=1)h=a[l],p=h.shift(),p&&f[p].apply(f,h);return f.translate(-o,-u),v&&f.translate(-this._left,-this._top),d=f.getContentRect(t,n,r,i),d},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(this._fillNode&&(this.node.removeChild(this._fillNode),this._fillNode=null),this._strokeNode&&(this.node.removeChild(this._strokeNode),this._strokeNode=null),e.one(this.node).remove(!0))}},e.VMLDrawing.prototype)),d.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){var t,n,r;this.matrix.init(),this._normalizedMatrix.init(),this._transforms=this.matrix.getTransformArray(e),n=this._transforms.length;for(t=0;t<n;++t)r=this._transforms[t];return this._transform=e,e},getter:function(){return this._transform}},x:{value:0},y:{value:0},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}},width:{value:0},height:{value:0},visible:{value:!0,setter:function(e){var t=this.node,n=e?"visible":"hidden";return t&&(t.style.visibility=n),e}},fill:{valueFn:"_getDefaultFill",setter:function(e){var t,n,r=this.get("fill")||this._getDefaultFill();if(e){e.hasOwnProperty("color")&&(e.type="solid");for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t])}return n=r,n&&n.color&&(n.color===undefined||n.color=="none")&&(n.color=null),this._fillFlag=!0,n}},stroke:{valueFn:"_getDefaultStroke",setter:function(e){var t,n,r,i=this.get("stroke")||this._getDefaultStroke();if(e){e.hasOwnProperty("weight")&&(r=parseInt(e.weight,10),isNaN(r)||(e.weight=r));for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t])}return n=i,this._strokeFlag=!0,n}},autoSize:{value:!1},pointerEvents:{value:"visiblePainted"},node:{readOnly:!0,getter:function(){return this.node}},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.VMLShape=d,m=function(){m.superclass.constructor.apply(this,arguments)},m.NAME="path",e.extend(m,e.VMLShape),m.ATTRS=e.merge(e.VMLShape.ATTRS,{width:{getter:function(){var e=Math.max(this._right-this._left,0);return e}},height:{getter:function(){return Math.max(this._bottom-this._top,0)}},path:{readOnly:!0,getter:function(){return this._path}}}),e.VMLPath=m,g=function(){g.superclass.constructor.apply(this,arguments)},g.NAME="rect",e.extend(g,e.VMLShape,{_type:"rect"}),g.ATTRS=e.VMLShape.ATTRS,e.VMLRect=g,y=function(){y.superclass.constructor.apply(this,arguments)},y.NAME="ellipse",e.extend(y,e.VMLShape,{_type:"oval"}),y.ATTRS=e.merge(e.VMLShape.ATTRS,{xRadius:{lazyAdd:!1,getter:function(){var e=this.get("width");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("width",t),e}},yRadius:{lazyAdd:!1,getter:function(){var e=this.get("height");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("height",t),e}}}),e.VMLEllipse=y,v=function(e){v.superclass.constructor.apply(this,arguments)},v.NAME="circle",e.extend(v,d,{_type:"oval"}),v.ATTRS=e.merge(d.ATTRS,{radius:{lazyAdd:!1,value:0},width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}}}),e.VMLCircle=v,w=function(){w.superclass.constructor.apply(this,arguments)},w.NAME="vmlPieSlice",e.extend(w,e.VMLShape,e.mix({_type:"shape",_draw:function(e){var t=this.get("cx"),n=this.get("cy"),r=this.get("startAngle"),i=this.get("arc"),s=this.get("radius");this.clear(),this.drawWedge(t,n,r,i,s),this.end()}},e.VMLDrawing.prototype)),w.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.VMLShape.ATTRS),e.VMLPieSlice=w,b=function(){b.superclass.constructor.apply(this,arguments)},b.NAME="vmlGraphic",b.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{resizeDown:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}}},e.extend(b,e.GraphicBase,{set:function(t,n){var r=this,i={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},s,u=!1;p.prototype.set.apply(r,arguments);if(r._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(o.isString&&i[t])u=!0;else if(o.isObject(t))for(s in i)if(i.hasOwnProperty(s)&&t[s]){u=!0;break}u&&r._redraw()},_x:0,_y:0,getXY:function(){var t=this.parentNode,n=this.get("x"),r=this.get("y"),i;return t?(i=e.one(t).getXY(),i[0]+=n,i[1]+=r):i=e.DOM._getOffset(this._node),i},initializer:function(e){var t=this.get("render"),n=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._node=this._createGraphic(),this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=n,this._node.setAttribute("id",this.get("id")),t&&this.render(t)},render:function(t){var n=e.one(t),r=this.get("width")||parseInt(n.getComputedStyle("width"),10),i=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||h.body,n.appendChild(this._node),this.parentNode=n,this.set("width",r),this.set("height",i),this},destroy:function(){this.clear(),e.one(this._node).remove(!0)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n._appendStrokeAndFill(),n},_appendShape:function(e){var t=e.node,n=this._frag||this._node;this.get("autoDraw")||this.get("autoSize")=="sizeContentToGraphic"?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){e instanceof d||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof d&&(e._destroy(),this._shapes[e.get("id")]=null,delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw()},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes(),this._removeChildren(this._node)},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._node&&(this._node.style.visibility=r),this._node&&(this._node.style.visibility=r)},setSize:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.width=e+"px",this._node.style.height=t+"px"},setPosition:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.left=e+"px",this._node.style.top=t+"px"},_createGraphic:function(){var e=h.createElement('<group xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);padding:0px 0px 0px 0px;display:block;position:absolute;top:0px;left:0px;zoom:1;" />');return e},_createGraphicNode:function(e){return h.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);display:inline-block;zoom:1;" />')},getShapeById:function(e){return this._shapes[e]},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.VMLCircle,rect:e.VMLRect,path:e.VMLPath,ellipse:e.VMLEllipse,pieslice:e.VMLPieSlice},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e.apply(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=h.createDocumentFragment()),this._frag},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,n.width=n.right-n.left,n.height=n.bottom-n.top,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_redraw:function(){var e=this.get("autoSize"),t,n=this.parentNode,r=parseFloat(n.getComputedStyle("width")),i=parseFloat(n.getComputedStyle("height")),s=0,o=0,u=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,a=u.left,f=u.right,l=u.top,c=u.bottom,h=f-a,p=c-l,d,v,m,g,y,b=this.get("visible");this._node.style.visibility="hidden",e?(e=="sizeContentToGraphic"?(t=this.get("preserveAspectRatio"),t=="none"||h/p===r/i?(s=a,o=l,v=h,m=p):h*i/p>r?(d=i/r,v=h,m=h*d,y=r*(p/h)*(m/i),o=this._calculateCoordOrigin(t.slice(5).toLowerCase(),y,m),o=l+o,s=a):(d=r/i,v=p*d,m=p,g=i*(h/p)*(v/r),s=this._calculateCoordOrigin(t.slice(1,4).toLowerCase(),g,v),s+=a,o=l),this._node.style.width=r+"px",this._node.style.height=i+"px",this._node.coordOrigin=s+", "+o):(v=h,m=p,this._node.style.width=h+"px",this._node.style.height=p+"px",this._state.width=h,this._state.height=p),this._node.coordSize=v+", "+m):(this._node.style.width=r+"px",this._node.style.height=i+"px",this._node.coordSize=r+", "+i),this._frag&&(this._node.appendChild(this._frag),this._frag=null),b&&(this._node.style.visibility="visible")},_calculateCoordOrigin:function(e,t,n){var r;switch(e){case"min":r=0;break;case"mid":r=(t-n)/2;break;case"max":r=t-n}return r},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=o.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=o.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=o.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=o.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=o.isNumber(i.left)?i.left:0,i.top=o.isNumber(i.top)?i.top:0,i.right=o.isNumber(i.right)?i.right:0,i.bottom=o.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_toFront:function(t){var n=this._node;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this._node,r;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.VMLGraphic=b},"3.7.2",{requires:["graphics"]});+YUI.add("graphics-vml",function(e,t){function S(){}var n="vml",r="shape",i=/[a-z][^a-z]*/ig,s=/[-]?[0-9]*[0-9|\.][0-9]*/g,o=e.Lang,u=o.isNumber,a=o.isArray,f=o.isString,l=e.DOM,c=e.Selector,h=e.config.doc,p=e.AttributeLite,d,v,m,g,y,b,w,E=e.ClassNameManager.getClassName;S.prototype={_pathSymbolToMethod:{M:"moveTo",m:"relativeMoveTo",L:"lineTo",l:"relativeLineTo",C:"curveTo",c:"relativeCurveTo",Q:"quadraticCurveTo",q:"relativeQuadraticCurveTo",z:"closePath",Z:"closePath"},_coordSpaceMultiplier:100,_round:function(e){return Math.round(e*this._coordSpaceMultiplier)},_addToPath:function(e){this._path=this._path||"",this._movePath&&(this._path+=this._movePath,this._movePath=null),this._path+=e},_currentX:0,_currentY:0,curveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!1])},relativeCurveTo:function(){this._curveTo.apply(this,[e.Array(arguments),!0])},_curveTo:function(e,t){var n,r,i,s,o,u,a,f,l,c,h,p,d,v,m,g,y=t?" v ":" c ",b=t?parseFloat(this._currentX):0,w=t?parseFloat(this._currentY):0;m=e.length-5,g=y;for(v=0;v<m;v+=6)o=parseFloat(e[v]),u=parseFloat(e[v+1]),a=parseFloat(e[v+2]),f=parseFloat(e[v+3]),i=parseFloat(e[v+4]),s=parseFloat(e[v+5]),v>0&&(g+=", "),g=g+this._round(o)+", "+this._round(u)+", "+this._round(a)+", "+this._round(f)+", "+this._round(i)+", "+this._round(s),o+=b,u+=w,a+=b,f+=w,i+=b,s+=w,c=Math.max(i,Math.max(o,a)),p=Math.max(s,Math.max(u,f)),h=Math.min(i,Math.min(o,a)),d=Math.min(s,Math.min(u,f)),n=Math.abs(c-h),r=Math.abs(p-d),l=[[this._currentX,this._currentY],[o,u],[a,f],[i,s]],this._setCurveBoundingBox(l,n,r),this._currentX=i,this._currentY=s;this._addToPath(g)},quadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!1])},relativeQuadraticCurveTo:function(){this._quadraticCurveTo.apply(this,[e.Array(arguments),!0])},_quadraticCurveTo:function(e,t){var n,r,i,s,o,u,a,f,l=this._currentX,c=this._currentY,h,p=e.length-3,d=[],v=t?parseFloat(this._currentX):0,m=t?parseFloat(this._currentY):0;for(h=0;h<p;h+=4)n=parseFloat(e[h])+v,r=parseFloat(e[h+1])+m,a=parseFloat(e[h+2])+v,f=parseFloat(e[h+3])+m,i=l+.67*(n-l),s=c+.67*(r-c),o=i+(a-l)*.34,u=s+(f-c)*.34,d.push(i),d.push(s),d.push(o),d.push(u),d.push(a),d.push(f);this._curveTo.apply(this,[d,!1])},drawRect:function(e,t,n,r){return this.moveTo(e,t),this.lineTo(e+n,t),this.lineTo(e+n,t+r),this.lineTo(e,t+r),this.lineTo(e,t),this._currentX=e,this._currentY=t,this},drawRoundRect:function(e,t,n,r,i,s){return this.moveTo(e,t+s),this.lineTo(e,t+r-s),this.quadraticCurveTo(e,t+r,e+i,t+r),this.lineTo(e+n-i,t+r),this.quadraticCurveTo(e+n,t+r,e+n,t+r-s),this.lineTo(e+n,t+s),this.quadraticCurveTo(e+n,t,e+n-i,t),this.lineTo(e+i,t),this.quadraticCurveTo(e,t,e,t+s),this},drawCircle:function(e,t,n){var r=0,i=360,s=n*2;return i*=65535,this._drawingComplete=!1,this._trackSize(e+s,t+s),this.moveTo(e+s,t+n),this._addToPath(" ae "+this._round(e+n)+", "+this._round(t+n)+", "+this._round(n)+", "+this._round(n)+", "+r+", "+i),this},drawEllipse:function(e,t,n,r){var i=0,s=360,o=n*.5,u=r*.5;return s*=65535,this._drawingComplete=!1,this._trackSize(e+n,t+r),this.moveTo(e+n,t+u),this._addToPath(" ae "+this._round(e+o)+", "+this._round(e+o)+", "+this._round(t+u)+", "+this._round(o)+", "+this._round(u)+", "+i+", "+s),this},drawDiamond:function(e,t,n,r){var i=n*.5,s=r*.5;return this.moveTo(e+i,t),this.lineTo(e+n,t+s),this.lineTo(e+i,t+r),this.lineTo(e,t+s),this.lineTo(e+i,t),this},drawWedge:function(e,t,n,r,i){var s=i*2;return Math.abs(r)>360&&(r=360),this._currentX=e,this._currentY=t,n*=-65535,r*=65536,n=Math.round(n),r=Math.round(r),this.moveTo(e,t),this._addToPath(" ae "+this._round(e)+", "+this._round(t)+", "+this._round(i)+" "+this._round(i)+", "+n+", "+r),this._trackSize(s,s),this},lineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!1])},relativeLineTo:function(){this._lineTo.apply(this,[e.Array(arguments),!0])},_lineTo:function(e,t){var n=e[0],r,i,s,o,u=t?" r ":" l ",a=t?parseFloat(this._currentX):0,f=t?parseFloat(this._currentY):0;if(typeof n=="string"||typeof n=="number"){i=e.length-1;for(r=0;r<i;r+=2)s=parseFloat(e[r]),o=parseFloat(e[r+1]),u+=" "+this._round(s)+", "+this._round(o),s+=a,o+=f,this._currentX=s,this._currentY=o,this._trackSize.apply(this,[s,o])}else{i=e.length;for(r=0;r<i;r+=1)s=parseFloat(e[r][0]),o=parseFloat(e[r][1]),u+=" "+this._round(s)+", "+this._round(o),s+=a,o+=f,this._currentX=s,this._currentY=o,this._trackSize.apply(this,[s,o])}return this._addToPath(u),this},moveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!1])},relativeMoveTo:function(){this._moveTo.apply(this,[e.Array(arguments),!0])},_moveTo:function(e,t){var n=parseFloat(e[0]),r=parseFloat(e[1]),i=t?" t ":" m ",s=t?parseFloat(this._currentX):0,o=t?parseFloat(this._currentY):0;this._movePath=i+this._round(n)+", "+this._round(r),n+=s,r+=o,this._trackSize(n,r),this._currentX=n,this._currentY=r},_closePath:function(){var e=this.get("fill"),t=this.get("stroke"),n=this.node,r=this.get("width"),i=this.get("height"),s=this._path,o="",u=this._coordSpaceMultiplier;this._fillChangeHandler(),this._strokeChangeHandler(),s&&(e&&e.color&&(o+=" x"),t&&(o+=" e")),s&&(n.path=s+o),!isNaN(r)&&!isNaN(i)&&(n.coordOrigin=this._left+", "+this._top,n.coordSize=r*u+", "+i*u,n.style.position="absolute",n.style.width=r+"px",n.style.height=i+"px"),this._path=s,this._movePath=null,this._updateTransform()},end:function(){this._closePath()},closePath:function(){this._addToPath(" x e")},clear:function(){this._right=0,this._bottom=0,this._width=0,this._height=0,this._left=0,this._top=0,this._path="",this._movePath=null},getBezierData:function(e,t){var n=e.length,r=[],i,s;for(i=0;i<n;++i)r[i]=[e[i][0],e[i][1]];for(s=1;s<n;++s)for(i=0;i<n-s;++i)r[i][0]=(1-t)*r[i][0]+t*r[parseInt(i+1,10)][0],r[i][1]=(1-t)*r[i][1]+t*r[parseInt(i+1,10)][1];return[r[0][0],r[0][1]]},_setCurveBoundingBox:function(e,t,n){var r,i=this._currentX,s=i,o=this._currentY,u=o,a=Math.round(Math.sqrt(t*t+n*n)),f=1/a,l;for(r=0;r<a;++r)l=this.getBezierData(e,f*r),i=isNaN(i)?l[0]:Math.min(l[0],i),s=isNaN(s)?l[0]:Math.max(l[0],s),o=isNaN(o)?l[1]:Math.min(l[1],o),u=isNaN(u)?l[1]:Math.max(l[1],u);i=Math.round(i*10)/10,s=Math.round(s*10)/10,o=Math.round(o*10)/10,u=Math.round(u*10)/10,this._trackSize(s,u),this._trackSize(i,o)},_trackSize:function(e,t){e>this._right&&(this._right=e),e<this._left&&(this._left=e),t<this._top&&(this._top=t),t>this._bottom&&(this._bottom=t),this._width=this._right-this._left,this._height=this._bottom-this._top},_left:0,_right:0,_top:0,_bottom:0,_width:0,_height:0},e.VMLDrawing=S,d=function(){this._transforms=[],this.matrix=new e.Matrix,this._normalizedMatrix=new e.Matrix,d.superclass.constructor.apply(this,arguments)},d.NAME="shape",e.extend(d,e.GraphicBase,e.mix({_type:"shape",init:function(){this.initializer.apply(this,arguments)},initializer:function(e){var t=this,n=e.graphic,r=this.get("data");t.createNode(),n&&this._setGraphic(n),r&&t._parsePathData(r),this._updateHandler()},_setGraphic:function(t){var n;t instanceof e.VMLGraphic?this._graphic=t:(t=e.one(t),n=new e.VMLGraphic({render:t}),n._appendShape(this),this._graphic=n,this._appendStrokeAndFill())},_appendStrokeAndFill:function(){this._strokeNode&&this.node.appendChild(this._strokeNode),this._fillNode&&this.node.appendChild(this._fillNode)},createNode:function(){var e,t=this._camelCaseConcat,i=this.get("x"),s=this.get("y"),o=this.get("width"),u=this.get("height"),a,f,l=this.name,c,p=this.get("visible")?"visible":"hidden",d,v,m,g,y,b,w,S,x,T;a=this.get("id"),f=this._type=="path"?"shape":this._type,v=E(r)+" "+E(t(n,r))+" "+E(l)+" "+E(t(n,l))+" "+n+f,m=this._getStrokeProps(),x=this._getFillProps(),c="<"+f+' xmlns="urn:schemas-microsft.com:vml" id="'+a+'" class="'+v+'" style="behavior:url(#default#VML);display:inline-block;position:absolute;left:'+i+"px;top:"+s+"px;width:"+o+"px;height:"+u+"px;visibility:"+p+'"',m&&m.weight&&m.weight>0?(g=m.endcap,y=parseFloat(m.opacity),b=m.joinstyle,w=m.miterlimit,S=m.dashstyle,c+=' stroked="t" strokecolor="'+m.color+'" strokeWeight="'+m.weight+'px"',d='<stroke class="vmlstroke" xmlns="urn:schemas-microsft.com:vml" on="t" style="behavior:url(#default#VML);display:inline-block;"',d+=' opacity="'+y+'"',g&&(d+=' endcap="'+g+'"'),b&&(d+=' joinstyle="'+b+'"'),w&&(d+=' miterlimit="'+w+'"'),S&&(d+=' dashstyle="'+S+'"'),d+="></stroke>",this._strokeNode=h.createElement(d),c+=' stroked="t"'):c+=' stroked="f"',x&&(x.node&&(T=x.node,this._fillNode=h.createElement(T)),x.color&&(c+=' fillcolor="'+x.color+'"'),c+=' filled="'+x.filled+'"'),c+=">",c+="</"+f+">",e=h.createElement(c),this.node=e,this._strokeFlag=!1,this._fillFlag=!1},addClass:function(e){var t=this.node;l.addClass(t,e)},removeClass:function(e){var t=this.node;l.removeClass(t,e)},getXY:function(){var e=this._graphic,t=e.getXY(),n=this.get("x"),r=this.get("y");return[t[0]+n,t[1]+r]},setXY:function(e){var t=this._graphic,n=t.getXY();this.set("x",e[0]-n[0]),this.set("y",e[1]-n[1])},contains:function(t){return t===e.one(this.node)},compareTo:function(e){var t=this.node;return t===e},test:function(e){return c.test(this.node,e)},_getStrokeProps:function(){var e,t=this.get("stroke"),n,r,i="",s,o=0,f,l,c;if(t&&t.weight&&t.weight>0){e={},l=t.linecap||"flat",c=t.linejoin||"round",l!="round"&&l!="square"&&(l="flat"),n=parseFloat(t.opacity),r=t.dashstyle||"none",t.color=t.color||"#000000",t.weight=t.weight||1,t.opacity=u(n)?n:1,e.stroked=!0,e.color=t.color,e.weight=t.weight,e.endcap=l,e.opacity=t.opacity;if(a(r)){i=[],f=r.length;for(o=0;o<f;++o)s=r[o],i[o]=s/t.weight}c=="round"||c=="bevel"?e.joinstyle=c:(c=parseInt(c,10),u(c)&&(e.miterlimit=Math.max(c,1),e.joinstyle="miter")),e.dashstyle=i}return e},_strokeChangeHandler:function(e){if(!this._strokeFlag)return;var t=this.node,n=this.get("stroke"),r,i,s="",o,f=0,l,c,h;if(n&&n.weight&&n.weight>0){c=n.linecap||"flat",h=n.linejoin||"round",c!="round"&&c!="square"&&(c="flat"),r=parseFloat(n.opacity),i=n.dashstyle||"none",n.color=n.color||"#000000",n.weight=n.weight||1,n.opacity=u(r)?r:1,t.stroked=!0,t.strokeColor=n.color,t.strokeWeight=n.weight+"px",this._strokeNode||(this._strokeNode=this._createGraphicNode("stroke"),t.appendChild(this._strokeNode)),this._strokeNode.endcap=c,this._strokeNode.opacity=n.opacity;if(a(i)){s=[],l=i.length;for(f=0;f<l;++f)o=i[f],s[f]=o/n.weight}h=="round"||h=="bevel"?this._strokeNode.joinstyle=h:(h=parseInt(h,10),u(h)&&(this._strokeNode.miterlimit=Math.max(h,1),this._strokeNode.joinstyle="miter")),this._strokeNode.dashstyle=s,this._strokeNode.on=!0}else this._strokeNode&&(this._strokeNode.on=!1),t.stroked=!1;this._strokeFlag=!1},_getFillProps:function(){var e=this.get("fill"),t,n,r,i,s,o=!1;if(e){n={};if(e.type=="radial"||e.type=="linear"){t=parseFloat(e.opacity),t=u(t)?t:1,o=!0,r=this._getGradientFill(e),s='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" opacity="'+t+'"';for(i in r)r.hasOwnProperty(i)&&(s+=" "+i+'="'+r[i]+'"');s+=" />",n.node=s}else e.color&&(t=parseFloat(e.opacity),o=!0,n.color=e.color,u(t)&&(t=Math.max(Math.min(t,1),0),n.opacity=t,t<1&&(n.node='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" type="solid" opacity="'+t+'"/>')));n.filled=o}return n},_fillChangeHandler:function(e){if(!this._fillFlag)return;var t=this.node,n=this.get("fill"),r,i,s=!1,o,a;if(n)if(n.type=="radial"||n.type=="linear"){s=!0,a=this._getGradientFill(n);if(this._fillNode)for(o in a)a.hasOwnProperty(o)&&(o=="colors"?this._fillNode.colors.value=a[o]:this._fillNode[o]=a[o]);else{i='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;"';for(o in a)a.hasOwnProperty(o)&&(i+=" "+o+'="'+a[o]+'"');i+=" />",this._fillNode=h.createElement(i),t.appendChild(this._fillNode)}}else n.color&&(t.fillcolor=n.color,r=parseFloat(n.opacity),s=!0,u(r)&&r<1?(n.opacity=r,this._fillNode?(this._fillNode.getAttribute("type")!="solid"&&(this._fillNode.type="solid"),this._fillNode.opacity=r):(i='<fill xmlns="urn:schemas-microsft.com:vml" class="vmlfill" style="behavior:url(#default#VML);display:inline-block;" type="solid" opacity="'+r+'"/>',this._fillNode=h.createElement(i),t.appendChild(this._fillNode))):this._fillNode&&(this._fillNode.opacity=1,this._fillNode.type="solid"));t.filled=s,this._fillFlag=!1},_updateFillNode:function(e){this._fillNode||(this._fillNode=this._createGraphicNode("fill"),e.appendChild(this._fillNode))},_getGradientFill:function(e){var t={},n,r,i=e.type,s=this.get("width"),o=this.get("height"),a=u,f,l=e.stops,c=l.length,h,p,d,v,m="",g=e.cx,y=e.cy,b=e.fx,w=e.fy,E=e.r,S,x=e.rotation||0;i==="linear"?(x<=270?x=Math.abs(x-270):x<360?x=270+(360-x):x=270,t.type="gradient",t.angle=x):i==="radial"&&(n=s*E*2,r=o*E*2,b=E*2*(b-.5),w=E*2*(w-.5),b+=g,w+=y,t.focussize=n/s/10+"% "+r/o/10+"%",t.alignshape=!1,t.type="gradientradial",t.focus="100%",t.focusposition=Math.round(b*100)+"% "+Math.round(w*100)+"%");for(d=0;d<c;++d)f=l[d],p=f.color,h=f.opacity,h=a(h)?h:1,S=f.offset||d/(c-1),S*=E*2,S=Math.round(100*S)+"%",v=d>0?d+1:"",t["opacity"+v]=h+"",m+=", "+S+" "+p;return parseFloat(S)<100&&(m+=", 100% "+p),t.colors=m.substr(2),t},_addTransform:function(t,n){n=e.Array(n),this._transform=o.trim(this._transform+" "+t+"("+n.join(", ")+")"),n.unshift(t),this._transforms.push(n),this.initialized&&this._updateTransform()},_updateTransform:function(){var t=this.node,n,r,i,s=this.get("x"),o=this.get("y"),u,a,f=this.matrix,l=this._normalizedMatrix,c=this instanceof e.VMLPath,p,d=this._transforms.length;if(this._transforms&&this._transforms.length>0){i=this.get("transformOrigin"),c&&l.translate(this._left,this._top),u=i[0]-.5,a=i[1]-.5,u=Math.max(-0.5,Math.min(.5,u)),a=Math.max(-0.5,Math.min(.5,a));for(p=0;p<d;++p)n=this._transforms[p].shift(),n&&(l[n].apply(l,this._transforms[p]),f[n].apply(f,this._transforms[p]));c&&l.translate(-this._left,-this._top),r=l.a+","+l.c+","+l.b+","+l.d+","+0+","+0}this._graphic.addToRedrawQueue(this),r&&(this._skew||(this._skew=h.createElement('<skew class="vmlskew" xmlns="urn:schemas-microsft.com:vml" on="false" style="behavior:url(#default#VML);display:inline-block;" />'),this.node.appendChild(this._skew)),this._skew.matrix=r,this._skew.on=!0,this._skew.origin=u+", "+a),this._type!="path"&&(this._transforms=[]),t.style.left=s+this._getSkewOffsetValue(l.dx)+"px",t.style.top=o+this._getSkewOffsetValue(l.dy)+"px"},_getSkewOffsetValue:function(t){var n=e.MatrixUtil.sign(t),r=Math.abs(t);return t=Math.min(r,32767)*n,t},_translateX:0,_translateY:0,_transform:"",translate:function(e,t){this._translateX+=e,this._translateY+=t,this._addTransform("translate",arguments)},translateX:function(e){this._translateX+=e,this._addTransform("translateX",arguments)},translateY:function(e){this._translateY+=e,this._addTransform("translateY",arguments)},skew:function(e,t){this._addTransform("skew",arguments)},skewX:function(e){this._addTransform("skewX",arguments)},skewY:function(e){this._addTransform("skewY",arguments)},rotate:function(e){this._addTransform("rotate",arguments)},scale:function(e,t){this._addTransform("scale",arguments)},on:function(t,n){return e.Node.DOM_EVENTS[t]?e.one("#"+this.get("id")).on(t,n):e.on.apply(this,arguments)},_draw:function(){},_updateHandler:function(e){var t=this,n=t.node;t._fillChangeHandler(),t._strokeChangeHandler(),n.style.width=this.get("width")+"px",n.style.height=this.get("height")+"px",this._draw(),t._updateTransform()},_createGraphicNode:function(e){return e=e||this._type,h.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);display:inline-block;" class="vml'+e+'"/>')},_getDefaultFill:function(){return{type:"solid",opacity:1,cx:.5,cy:.5,fx:.5,fy:.5,r:.5}},_getDefaultStroke:function(){return{weight:1,dashstyle:"none",color:"#000",opacity:1}},set:function(){var e=this;p.prototype.set.apply(e,arguments),e.initialized&&e._updateHandler()},getBounds:function(){var t=this instanceof e.VMLPath,n=this.get("width"),r=this.get("height"),i=this.get("x"),s=this.get("y");return t&&(i+=this._left,s+=this._top,n=this._right-this._left,r=this._bottom-this._top),this._getContentRect(n,r,i,s)},_getContentRect:function(t,n,r,i){var s=this.get("transformOrigin"),o=s[0]*t,u=s[1]*n,a=this.matrix.getTransformArray(this.get("transform")),f=new e.Matrix,l,c=a.length,h,p,d,v=this instanceof e.VMLPath;v&&f.translate(this._left,this._top),o=isNaN(o)?0:o,u=isNaN(u)?0:u,f.translate(o,u);for(l=0;l<c;l+=1)h=a[l],p=h.shift(),p&&f[p].apply(f,h);return f.translate(-o,-u),v&&f.translate(-this._left,-this._top),d=f.getContentRect(t,n,r,i),d},toFront:function(){var e=this.get("graphic");e&&e._toFront(this)},toBack:function(){var e=this.get("graphic");e&&e._toBack(this)},_parsePathData:function(t){var n,r,o,u=e.Lang.trim(t.match(i)),a,f,l,c=this._pathSymbolToMethod;if(u){this.clear(),f=u.length||0;for(a=0;a<f;a+=1)l=u[a],r=l.substr(0,1),o=l.substr(1).match(s),n=c[r],n&&(o?this[n].apply(this,o):this[n].apply(this));this.end()}},destroy:function(){var e=this.get("graphic");e?e.removeShape(this):this._destroy()},_destroy:function(){this.node&&(this._fillNode&&(this.node.removeChild(this._fillNode),this._fillNode=null),this._strokeNode&&(this.node.removeChild(this._strokeNode),this._strokeNode=null),e.one(this.node).remove(!0))}},e.VMLDrawing.prototype)),d.ATTRS={transformOrigin:{valueFn:function(){return[.5,.5]}},transform:{setter:function(e){var t,n,r;this.matrix.init(),this._normalizedMatrix.init(),this._transforms=this.matrix.getTransformArray(e),n=this._transforms.length;for(t=0;t<n;++t)r=this._transforms[t];return this._transform=e,e},getter:function(){return this._transform}},x:{value:0},y:{value:0},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this.node;return t&&t.setAttribute("id",e),e}},width:{value:0},height:{value:0},visible:{value:!0,setter:function(e){var t=this.node,n=e?"visible":"hidden";return t&&(t.style.visibility=n),e}},fill:{valueFn:"_getDefaultFill",setter:function(e){var t,n,r=this.get("fill")||this._getDefaultFill();if(e){e.hasOwnProperty("color")&&(e.type="solid");for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t])}return n=r,n&&n.color&&(n.color===undefined||n.color=="none")&&(n.color=null),this._fillFlag=!0,n}},stroke:{valueFn:"_getDefaultStroke",setter:function(e){var t,n,r,i=this.get("stroke")||this._getDefaultStroke();if(e){e.hasOwnProperty("weight")&&(r=parseInt(e.weight,10),isNaN(r)||(e.weight=r));for(t in e)e.hasOwnProperty(t)&&(i[t]=e[t])}return n=i,this._strokeFlag=!0,n}},autoSize:{value:!1},pointerEvents:{value:"visiblePainted"},node:{readOnly:!0,getter:function(){return this.node}},data:{setter:function(e){return this.get("node")&&this._parsePathData(e),e}},graphic:{readOnly:!0,getter:function(){return this._graphic}}},e.VMLShape=d,m=function(){m.superclass.constructor.apply(this,arguments)},m.NAME="path",e.extend(m,e.VMLShape),m.ATTRS=e.merge(e.VMLShape.ATTRS,{width:{getter:function(){var e=Math.max(this._right-this._left,0);return e}},height:{getter:function(){return Math.max(this._bottom-this._top,0)}},path:{readOnly:!0,getter:function(){return this._path}}}),e.VMLPath=m,g=function(){g.superclass.constructor.apply(this,arguments)},g.NAME="rect",e.extend(g,e.VMLShape,{_type:"rect"}),g.ATTRS=e.VMLShape.ATTRS,e.VMLRect=g,y=function(){y.superclass.constructor.apply(this,arguments)},y.NAME="ellipse",e.extend(y,e.VMLShape,{_type:"oval"}),y.ATTRS=e.merge(e.VMLShape.ATTRS,{xRadius:{lazyAdd:!1,getter:function(){var e=this.get("width");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("width",t),e}},yRadius:{lazyAdd:!1,getter:function(){var e=this.get("height");return e=Math.round(e/2*100)/100,e},setter:function(e){var t=e*2;return this.set("height",t),e}}}),e.VMLEllipse=y,v=function(e){v.superclass.constructor.apply(this,arguments)},v.NAME="circle",e.extend(v,d,{_type:"oval"}),v.ATTRS=e.merge(d.ATTRS,{radius:{lazyAdd:!1,value:0},width:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}},height:{setter:function(e){return this.set("radius",e/2),e},getter:function(){var e=this.get("radius"),t=e&&e>0?e*2:0;return t}}}),e.VMLCircle=v,w=function(){w.superclass.constructor.apply(this,arguments)},w.NAME="vmlPieSlice",e.extend(w,e.VMLShape,e.mix({_type:"shape",_draw:function(e){var t=this.get("cx"),n=this.get("cy"),r=this.get("startAngle"),i=this.get("arc"),s=this.get("radius");this.clear(),this.drawWedge(t,n,r,i,s),this.end()}},e.VMLDrawing.prototype)),w.ATTRS=e.mix({cx:{value:0},cy:{value:0},startAngle:{value:0},arc:{value:0},radius:{value:0}},e.VMLShape.ATTRS),e.VMLPieSlice=w,b=function(){b.superclass.constructor.apply(this,arguments)},b.NAME="vmlGraphic",b.ATTRS={render:{},id:{valueFn:function(){return e.guid()},setter:function(e){var t=this._node;return t&&t.setAttribute("id",e),e}},shapes:{readOnly:!0,getter:function(){return this._shapes}},contentBounds:{readOnly:!0,getter:function(){return this._contentBounds}},node:{readOnly:!0,getter:function(){return this._node}},width:{setter:function(e){return this._node&&(this._node.style.width=e+"px"),e}},height:{setter:function(e){return this._node&&(this._node.style.height=e+"px"),e}},autoSize:{value:!1},preserveAspectRatio:{value:"xMidYMid"},resizeDown:{resizeDown:!1},x:{getter:function(){return this._x},setter:function(e){return this._x=e,this._node&&(this._node.style.left=e+"px"),e}},y:{getter:function(){return this._y},setter:function(e){return this._y=e,this._node&&(this._node.style.top=e+"px"),e}},autoDraw:{value:!0},visible:{value:!0,setter:function(e){return this._toggleVisible(e),e}}},e.extend(b,e.GraphicBase,{set:function(t,n){var r=this,i={autoDraw:!0,autoSize:!0,preserveAspectRatio:!0,resizeDown:!0},s,u=!1;p.prototype.set.apply(r,arguments);if(r._state.autoDraw===!0&&e.Object.size(this._shapes)>0)if(o.isString&&i[t])u=!0;else if(o.isObject(t))for(s in i)if(i.hasOwnProperty(s)&&t[s]){u=!0;break}u&&r._redraw()},_x:0,_y:0,getXY:function(){var t=this.parentNode,n=this.get("x"),r=this.get("y"),i;return t?(i=e.one(t).getXY(),i[0]+=n,i[1]+=r):i=e.DOM._getOffset(this._node),i},initializer:function(e){var t=this.get("render"),n=this.get("visible")?"visible":"hidden";this._shapes={},this._contentBounds={left:0,top:0,right:0,bottom:0},this._node=this._createGraphic(),this._node.style.left=this.get("x")+"px",this._node.style.top=this.get("y")+"px",this._node.style.visibility=n,this._node.setAttribute("id",this.get("id")),t&&this.render(t)},render:function(t){var n=e.one(t),r=this.get("width")||parseInt(n.getComputedStyle("width"),10),i=this.get("height")||parseInt(n.getComputedStyle("height"),10);return n=n||h.body,n.appendChild(this._node),this.parentNode=n,this.set("width",r),this.set("height",i),this},destroy:function(){this.clear(),e.one(this._node).remove(!0)},addShape:function(e){e.graphic=this,this.get("visible")||(e.visible=!1);var t=this._getShapeClass(e.type),n=new t(e);return this._appendShape(n),n._appendStrokeAndFill(),n},_appendShape:function(e){var t=e.node,n=this._frag||this._node;this.get("autoDraw")||this.get("autoSize")=="sizeContentToGraphic"?n.appendChild(t):this._getDocFrag().appendChild(t)},removeShape:function(e){e instanceof d||o.isString(e)&&(e=this._shapes[e]),e&&e instanceof d&&(e._destroy(),this._shapes[e.get("id")]=null,delete this._shapes[e.get("id")]),this.get("autoDraw")&&this._redraw()},removeAllShapes:function(){var e=this._shapes,t;for(t in e)e.hasOwnProperty(t)&&e[t].destroy();this._shapes={}},_removeChildren:function(e){if(e.hasChildNodes()){var t;while(e.firstChild)t=e.firstChild,this._removeChildren(t),e.removeChild(t)}},clear:function(){this.removeAllShapes(),this._removeChildren(this._node)},_toggleVisible:function(e){var t,n=this._shapes,r=e?"visible":"hidden";if(n)for(t in n)n.hasOwnProperty(t)&&n[t].set("visible",e);this._node&&(this._node.style.visibility=r),this._node&&(this._node.style.visibility=r)},setSize:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.width=e+"px",this._node.style.height=t+"px"},setPosition:function(e,t){e=Math.round(e),t=Math.round(t),this._node.style.left=e+"px",this._node.style.top=t+"px"},_createGraphic:function(){var e=h.createElement('<group xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);padding:0px 0px 0px 0px;display:block;position:absolute;top:0px;left:0px;zoom:1;" />');return e},_createGraphicNode:function(e){return h.createElement("<"+e+' xmlns="urn:schemas-microsft.com:vml" style="behavior:url(#default#VML);display:inline-block;zoom:1;" />')},getShapeById:function(e){return this._shapes[e]},_getShapeClass:function(e){var t=this._shapeClass[e];return t?t:e},_shapeClass:{circle:e.VMLCircle,rect:e.VMLRect,path:e.VMLPath,ellipse:e.VMLEllipse,pieslice:e.VMLPieSlice},batch:function(e){var t=this.get("autoDraw");this.set("autoDraw",!1),e.apply(),this.set("autoDraw",t)},_getDocFrag:function(){return this._frag||(this._frag=h.createDocumentFragment()),this._frag},addToRedrawQueue:function(e){var t,n;this._shapes[e.get("id")]=e,this.get("resizeDown")||(t=e.getBounds(),n=this._contentBounds,n.left=n.left<t.left?n.left:t.left,n.top=n.top<t.top?n.top:t.top,n.right=n.right>t.right?n.right:t.right,n.bottom=n.bottom>t.bottom?n.bottom:t.bottom,n.width=n.right-n.left,n.height=n.bottom-n.top,this._contentBounds=n),this.get("autoDraw")&&this._redraw()},_redraw:function(){var e=this.get("autoSize"),t,n=this.parentNode,r=parseFloat(n.getComputedStyle("width")),i=parseFloat(n.getComputedStyle("height")),s=0,o=0,u=this.get("resizeDown")?this._getUpdatedContentBounds():this._contentBounds,a=u.left,f=u.right,l=u.top,c=u.bottom,h=f-a,p=c-l,d,v,m,g,y,b=this.get("visible");this._node.style.visibility="hidden",e?(e=="sizeContentToGraphic"?(t=this.get("preserveAspectRatio"),t=="none"||h/p===r/i?(s=a,o=l,v=h,m=p):h*i/p>r?(d=i/r,v=h,m=h*d,y=r*(p/h)*(m/i),o=this._calculateCoordOrigin(t.slice(5).toLowerCase(),y,m),o=l+o,s=a):(d=r/i,v=p*d,m=p,g=i*(h/p)*(v/r),s=this._calculateCoordOrigin(t.slice(1,4).toLowerCase(),g,v),s+=a,o=l),this._node.style.width=r+"px",this._node.style.height=i+"px",this._node.coordOrigin=s+", "+o):(v=h,m=p,this._node.style.width=h+"px",this._node.style.height=p+"px",this._state.width=h,this._state.height=p),this._node.coordSize=v+", "+m):(this._node.style.width=r+"px",this._node.style.height=i+"px",this._node.coordSize=r+", "+i),this._frag&&(this._node.appendChild(this._frag),this._frag=null),b&&(this._node.style.visibility="visible")},_calculateCoordOrigin:function(e,t,n){var r;switch(e){case"min":r=0;break;case"mid":r=(t-n)/2;break;case"max":r=t-n}return r},_getUpdatedContentBounds:function(){var e,t,n,r=this._shapes,i={};for(t in r)r.hasOwnProperty(t)&&(n=r[t],e=n.getBounds(),i.left=o.isNumber(i.left)?Math.min(i.left,e.left):e.left,i.top=o.isNumber(i.top)?Math.min(i.top,e.top):e.top,i.right=o.isNumber(i.right)?Math.max(i.right,e.right):e.right,i.bottom=o.isNumber(i.bottom)?Math.max(i.bottom,e.bottom):e.bottom);return i.left=o.isNumber(i.left)?i.left:0,i.top=o.isNumber(i.top)?i.top:0,i.right=o.isNumber(i.right)?i.right:0,i.bottom=o.isNumber(i.bottom)?i.bottom:0,this._contentBounds=i,i},_toFront:function(t){var n=this._node;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&n.appendChild(t)},_toBack:function(t){var n=this._node,r;t instanceof e.VMLShape&&(t=t.get("node")),n&&t&&(r=n.firstChild,r?n.insertBefore(t,r):n.appendChild(t))}}),e.VMLGraphic=b},"3.7.3",{requires:["graphics"]});
bundle/graphics-vml/graphics-vml.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -3567,4 +3567,4 @@ -}, '3.7.2', {"requires": ["graphics"]});+}, '3.7.3', {"requires": ["graphics"]});
bundle/graphics/graphics-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/graphics/graphics.js", code: [] };-_yuitest_coverage["build/graphics/graphics.js"].code=["YUI.add('graphics', function (Y, NAME) {","","/**"," * "," * <p>The `Graphics` module provides a JavaScript API for creating shapes in a variety of formats across "," * a <a href=\"http://developer.yahoo.com/yui/articles/gbs\">browser test baseline</a>. "," * Based on device and browser capabilities, `Graphics` leverages <a href=\"http://www.w3.org/TR/SVG/\">SVG</a>, "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> and <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> "," * to render its graphical elements.</p>"," *"," * <p>The `Graphics` module features a <a href=\"../classes/Graphic.html\">`Graphic`</a> class that allows you to easily create and manage shapes. "," * Currently, a <a href=\"../classes/Graphic.html\">`Graphic`</a> instance can be used to create predifined shapes and free-form polygons with fill "," * and stroke properties.</p> "," *"," * <p>The `Graphics` module normalizes an API through the use of alias and implementation classes that share"," * interfaces. Each alias class points to an appropriate implementation class dependent on the browser's "," * capabilities. There should rarely, if ever, be a need to interact directly with an implementation class.</p>"," *"," * <p>Below is a list of available classes. "," * <ul>"," * <li><a href=\"../classes/Graphic.html\">`Graphic`</a>"," * <li><a href=\"../classes/Shape.html\">`Shape`</a>"," * <li><a href=\"../classes/Circle.html\">`Circle`</a>"," * <li><a href=\"../classes/Ellipse.html\">`Ellipse`</a>"," * <li><a href=\"../classes/Rect.html\">`Rect`</a>"," * <li><a href=\"../classes/Path.html\">`Path`</a>"," * </ul>"," * You can also extend the `Shape` class to create your own custom shape classes.</p>"," * @module graphics"," * @main graphics"," */","var SETTER = \"setter\","," PluginHost = Y.Plugin.Host,"," VALUE = \"value\","," VALUEFN = \"valueFn\","," READONLY = \"readOnly\","," Y_LANG = Y.Lang,"," STR = \"string\","," WRITE_ONCE = \"writeOnce\","," GraphicBase,"," AttributeLite;"," "," /**"," * AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module. It provides a get/set API without the event infastructure."," * This class is temporary and a work in progress."," *"," * @class AttributeLite"," * @constructor"," */"," AttributeLite = function()"," {"," var host = this; // help compression"," "," // Perf tweak - avoid creating event literals if not required."," host._ATTR_E_FACADE = {};"," "," Y.EventTarget.call(this, {emitFacade:true});"," host._state = {};"," host.prototype = Y.mix(AttributeLite.prototype, host.prototype);"," };",""," AttributeLite.prototype = {"," /**"," * Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host, "," * the initial values will be overwritten."," *"," * @method addAttrs"," * @param {Object} cfg Optional object containing attributes key value pairs to be set."," */"," addAttrs: function(cfg)"," {"," var host = this,"," attrConfig = this.constructor.ATTRS, "," attr,"," i,"," fn,"," state = host._state;"," for(i in attrConfig)"," {"," if(attrConfig.hasOwnProperty(i))"," {"," attr = attrConfig[i];"," if(attr.hasOwnProperty(VALUE))"," {"," state[i] = attr.value;"," }"," else if(attr.hasOwnProperty(VALUEFN))"," {"," fn = attr.valueFn;"," if(Y_LANG.isString(fn))"," {"," state[i] = host[fn].apply(host);"," }"," else"," {"," state[i] = fn.apply(host);"," }"," }"," }"," }"," host._state = state;"," for(i in attrConfig)"," {"," if(attrConfig.hasOwnProperty(i))"," {"," attr = attrConfig[i];"," if(attr.hasOwnProperty(READONLY) && attr.readOnly)"," {"," continue;"," }",""," if(attr.hasOwnProperty(WRITE_ONCE) && attr.writeOnce)"," {"," attr.readOnly = true;"," }",""," if(cfg && cfg.hasOwnProperty(i))"," {"," if(attr.hasOwnProperty(SETTER))"," {"," host._state[i] = attr.setter.apply(host, [cfg[i]]);"," }"," else"," {"," host._state[i] = cfg[i];"," }"," }"," }"," }"," },",""," /**"," * For a given item, returns the value of the property requested, or undefined if not found."," *"," * @method get"," * @param name {String} The name of the item"," * @return {Any} The value of the supplied property."," */"," get: function(attr)"," {"," var host = this,"," getter,"," attrConfig = host.constructor.ATTRS;"," if(attrConfig && attrConfig[attr])"," {"," getter = attrConfig[attr].getter;"," if(getter)"," {"," if(typeof getter == STR)"," {"," return host[getter].apply(host);"," }"," return attrConfig[attr].getter.apply(host);"," }",""," return host._state[attr];"," }"," return null;"," },"," "," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, val)"," {"," var i;"," if(Y_LANG.isObject(attr))"," {"," for(i in attr)"," {"," if(attr.hasOwnProperty(i))"," {"," this._set(i, attr[i]);"," }"," }"," }"," else"," {"," this._set.apply(this, arguments);"," }"," },",""," /**"," * Provides setter logic. Used by `set`."," *"," * @method _set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," * @protected"," */"," _set: function(attr, val)"," {"," var host = this,"," setter,"," args,"," attrConfig = host.constructor.ATTRS;"," if(attrConfig && attrConfig.hasOwnProperty(attr))"," {"," setter = attrConfig[attr].setter;"," if(setter)"," {"," args = [val];"," if(typeof setter == STR)"," {"," val = host[setter].apply(host, args);"," }"," else"," {"," val = attrConfig[attr].setter.apply(host, args);"," }"," }"," host._state[attr] = val;"," }"," }"," };"," Y.mix(AttributeLite, Y.EventTarget, false, null, 1);"," Y.AttributeLite = AttributeLite;",""," /**"," * GraphicBase serves as the base class for the graphic layer. It serves the same purpose as"," * Base but uses a lightweight getter/setter class instead of Attribute."," * This class is temporary and a work in progress."," *"," * @class GraphicBase"," * @constructor"," * @param {Object} cfg Key value pairs for attributes"," */"," GraphicBase = function(cfg)"," {"," var host = this,"," PluginHost = Y.Plugin && Y.Plugin.Host; "," if (host._initPlugins && PluginHost) {"," PluginHost.call(host);"," }"," "," host.name = host.constructor.NAME;"," host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;"," AttributeLite.call(host);"," host.addAttrs(cfg);"," host.init.apply(this, arguments);"," if (host._initPlugins) {"," // Need to initPlugins manually, to handle constructor parsing, static Plug parsing"," host._initPlugins(cfg);"," }"," host.initialized = true;"," };",""," GraphicBase.NAME = \"baseGraphic\";",""," GraphicBase.prototype = {"," /**"," * Init method, invoked during construction."," * Fires an init event after calling `initializer` on implementers."," *"," * @method init"," * @protected "," */"," init: function()"," {"," this.publish(\"init\", {"," fireOnce:true"," });"," this.initializer.apply(this, arguments);"," this.fire(\"init\", {cfg: arguments[0]});"," },",""," /**"," * Camel case concatanates two strings."," *"," * @method _camelCaseConcat"," * @param {String} prefix The first string"," * @param {String} name The second string"," * @return String"," * @private"," */"," _camelCaseConcat: function(prefix, name)"," {"," return prefix + name.charAt(0).toUpperCase() + name.slice(1);"," }"," };","//Straightup augment, no wrapper functions","Y.mix(GraphicBase, Y.AttributeLite, false, null, 1);","Y.mix(GraphicBase, PluginHost, false, null, 1);","GraphicBase.prototype.constructor = GraphicBase;","GraphicBase.plug = PluginHost.plug;","GraphicBase.unplug = PluginHost.unplug;","Y.GraphicBase = GraphicBase;","","","/**"," * `Drawing` provides a set of drawing methods used by `Path` and custom shape classes. "," * `Drawing` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGDrawing.html\">`SVGDrawing`</a></li>"," * <li><a href=\"VMLDrawing.html\">`VMLDrawing`</a></li>"," * <li><a href=\"CanvasDrawing.html\">`CanvasDrawing`</a></li>"," * </ul>"," *"," * @class Drawing"," * @constructor"," */"," /**"," * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRoundRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," /**"," * Clears the path."," *"," * @method clear"," */","/**"," * <p>Base class for creating shapes.</p>"," * <p>`Shape` is an abstract class and is not meant to be used directly. The following classes extend"," * `Shape`."," *"," * <ul>"," * <li><a href=\"Circle.html\">`Circle`</a></li>"," * <li><a href=\"Ellipse.html\">`Ellipse`</a></li>"," * <li><a href=\"Rect.html\">`Rect`</a></li>"," * <li><a href=\"Path.html\">`Path`</a></li>"," * </ul>"," *"," * `Shape` can also be extended to create custom shape classes.</p>"," *"," * `Shape` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGShape.html\">`SVGShape`</a></li>"," * <li><a href=\"VMLShape.html\">`VMLShape`</a></li>"," * <li><a href=\"CanvasShape.html\">`CanvasShape`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Shape` will point to the appropriate implemention.</p>"," *"," * @class Shape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */"," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," /**"," * Initializes the shape"," *"," * @private"," * @method initializer"," */"," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," */"," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {Shape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," /**"," * Translates the shape along the y-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," /**"," * Destroys the instance."," *"," * @method destroy"," */"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * </dl>"," *"," * @config fill"," * @type Object "," */"," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," /**"," * Reference to the parent graphic instance"," *"," * @config graphic"," * @type Graphic"," * @readOnly"," */","","/**"," * <p>Creates circle shape with editable attributes.</p> "," * <p>`Circle` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * The method's `cfg` argument contains a `type` attribute. Assigning \"circle\" or `Y.Circle` to this attribute will create a `Circle` instance. Required attributes"," * for instantiating a `Circle` are `type` and `radius`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," * "," * The below code creates a circle by defining the `type` attribute as \"circle\":</p>",""," var myCircle = myGraphic.addShape({"," type: \"circle\","," radius: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, this same circle is created by defining the `type` attribute with a class reference:"," *"," var myCircle = myGraphic.addShape({"," type: Y.Circle,"," radius: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," * "," * <p>`Circle` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGCircle.html\">`SVGCircle`</a></li>"," * <li><a href=\"VMLCircle.html\">`VMLCircle`</a></li>"," * <li><a href=\"CanvasCircle.html\">`CanvasCircle`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Circle` will point to the appropriate implemention.</p>"," *"," * @class Circle"," * @extends Shape"," * @constructor"," */"," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */","/**"," * <p>Creates an ellipse shape with editable attributes.</p>"," * <p>`Ellipse` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * The method's `cfg` argument contains a `type` attribute. Assigning \"ellipse\" or `Y.Ellipse` to this attribute will create a `Ellipse` instance. Required attributes"," * for instantiating a `Ellipse` are `type`, `width` and `height`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," * "," * The below code creates an ellipse by defining the `type` attribute as \"ellipse\":</p>",""," var myEllipse = myGraphic.addShape({"," type: \"ellipse\","," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, the same ellipse is created by defining the `type` attribute with a class reference:"," *"," var myEllipse = myGraphic.addShape({"," type: Y.Ellipse,"," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," * "," * <p>`Ellipse` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGEllipse.html\">`SVGEllipse`</a></li>"," * <li><a href=\"VMLEllipse.html\">`VMLEllipse`</a></li>"," * <li><a href=\"CanvasEllipse.html\">`CanvasEllipse`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Ellipse` will point to the appropriate implemention.</p>"," *"," * @class Ellipse"," * @extends Shape"," * @constructor"," */","/**"," * <p>Creates an rectangle shape with editable attributes.</p>"," * <p>`Rect` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> "," * class. The method's `cfg` argument contains a `type` attribute. Assigning \"rect\" or `Y.Rect` to this attribute will create a `Rect` instance. "," * Required attributes for instantiating a `Rect` are `type`, `width` and `height`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," *"," * The below code creates a rectangle by defining the `type` attribute as \"rect\":</p>",""," var myRect = myGraphic.addShape({"," type: \"rect\","," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, the same rectangle is created by defining the `type` attribute with a class reference:"," *"," var myRect = myGraphic.addShape({"," type: Y.Rect,"," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * <p>`Rect` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGRect.html\">`SVGRect`</a></li>"," * <li><a href=\"VMLRect.html\">`VMLRect`</a></li>"," * <li><a href=\"CanvasRect.html\">`CanvasRect`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Rect` will point to the appropriate implemention.</p>"," *"," * @class Rect"," * @extends Shape"," * @constructor"," */","/**"," * <p>The `Path` class creates a shape through the use of drawing methods. The `Path` class has the following drawing methods available:</p>"," * <ul>"," * <li><a href=\"#method_clear\">`clear`</a></li>"," * <li><a href=\"#method_curveTo\">`curveTo`</a></li>"," * <li><a href=\"#method_drawRect\">`drawRect`</a></li>"," * <li><a href=\"#method_drawRoundRect\">`drawRoundRect`</a></li>"," * <li><a href=\"#method_end\">`end`</a></li>"," * <li><a href=\"#method_lineTo\">`lineTo`</a></li>"," * <li><a href=\"#method_moveTo\">`moveTo`</a></li>"," * <li><a href=\"#method_quadraticCurveTo\">`quadraticCurveTo`</a></li>"," * </ul>"," *"," * <p>Like other shapes, `Path` elements are created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> "," * class. The method's `cfg` argument contains a `type` attribute. Assigning \"path\" or `Y.Path` to this attribute will create a `Path` instance."," * After instantiation, a series of drawing operations must be performed in order to render a shape. The below code instantiates a path element by defining the `type` "," * attribute as \"path\":</p>",""," var myPath = myGraphic.addShape({"," type: \"path\","," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below a `Path` element with the same properties is instantiated by defining the `type` attribute with a class reference:"," *"," var myPath = myGraphic.addShape({"," type: Y.Path,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * After instantiation, a shape or segment needs to be drawn for an element to render. After all draw operations are performed, the <a href=\"#method_end\">`end`</a>"," * method will render the shape. The code below will draw a triangle:"," "," myPath.moveTo(35, 5);"," myPath.lineTo(65, 65);"," myPath.lineTo(5, 65);"," myPath.lineTo(35, 5);"," myPath.end();"," *"," * <p>`Path` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGPath.html\">`SVGPath`</a></li>"," * <li><a href=\"VMLPath.html\">`VMLPath`</a></li>"," * <li><a href=\"CanvasPath.html\">`CanvasPath`</a></li>"," * </ul> "," * It is not necessary to interact with these classes directly. `Path` will point to the appropriate implemention.</p>"," *"," * @class Path"," * @extends Shape"," * @uses Drawing"," * @constructor"," */"," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */","/**"," * `Graphic` acts a factory and container for shapes. You need at least one `Graphic` instance to create shapes for your application. "," * <p>The code block below creates a `Graphic` instance and appends it to an HTMLElement with the id 'mygraphiccontainer'.</p>"," "," var myGraphic = new Y.Graphic({render:\"#mygraphiccontainer\"});",""," * <p>Alternatively, you can add a `Graphic` instance to the DOM using the <a href=\"#method_render\">`render`</a> method.</p>"," var myGraphic = new Y.Graphic();"," myGraphic.render(\"#mygraphiccontainer\");",""," * `Graphic` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGGraphic.html\">`SVGGraphic`</a></li>"," * <li><a href=\"VMLGraphic.html\">`VMLGraphic`</a></li>"," * <li><a href=\"CanvasGraphic.html\">`CanvasGraphic`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Graphic` will point to the appropriate implemention.</p>"," *"," * @class Graphic"," * @constructor"," */"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object "," * @readOnly"," */"," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," /**"," * The contentBounds will resize to greater values but not to smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," /**"," * Indicates whether the `Graphic` and its children are visible."," *"," * @config visible"," * @type Boolean"," */"," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {Node|String} parentNode node in which to render the graphics node into."," */"," /**"," * Removes all nodes."," *"," * @method destroy"," */"," /**"," * <p>Generates a shape instance by type. The method accepts an object that contain's the shape's"," * type and attributes to be customized. For example, the code below would create a rectangle:</p>"," *"," var myRect = myGraphic.addShape({"," type: \"rect\","," width: 40,"," height: 30,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * <p>The `Graphics` module includes a few basic shapes. More information on their creation "," * can be found in each shape's documentation:"," *"," * <ul>"," * <li><a href=\"Circle.html\">`Circle`</a></li>"," * <li><a href=\"Ellipse.html\">`Ellipse`</a></li>"," * <li><a href=\"Rect.html\">`Rect`</a></li>"," * <li><a href=\"Path.html\">`Path`</a></li>"," * </ul>"," *"," * The `Graphics` module also allows for the creation of custom shapes. If a custom shape"," * has been created, it can be instantiated with the `addShape` method as well. The attributes,"," * required and optional, would need to be defined in the custom shape."," *"," var myCustomShape = myGraphic.addShape({"," type: Y.MyCustomShape,"," width: 50,"," height: 50,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * @method addShape"," * @param {Object} cfg Object containing the shape's type and attributes. "," * @return Shape"," */"," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */","","","}, '3.7.2', {\"requires\": [\"node\", \"event-custom\", \"pluginhost\", \"matrix\", \"classnamemanager\"]});"];+_yuitest_coverage["build/graphics/graphics.js"].code=["YUI.add('graphics', function (Y, NAME) {","","/**"," * "," * <p>The `Graphics` module provides a JavaScript API for creating shapes in a variety of formats across "," * a <a href=\"http://developer.yahoo.com/yui/articles/gbs\">browser test baseline</a>. "," * Based on device and browser capabilities, `Graphics` leverages <a href=\"http://www.w3.org/TR/SVG/\">SVG</a>, "," * <a href=\"http://www.w3.org/TR/html5/the-canvas-element.html\">Canvas</a> and <a href=\"http://www.w3.org/TR/NOTE-VML\">VML</a> "," * to render its graphical elements.</p>"," *"," * <p>The `Graphics` module features a <a href=\"../classes/Graphic.html\">`Graphic`</a> class that allows you to easily create and manage shapes. "," * Currently, a <a href=\"../classes/Graphic.html\">`Graphic`</a> instance can be used to create predifined shapes and free-form polygons with fill "," * and stroke properties.</p> "," *"," * <p>The `Graphics` module normalizes an API through the use of alias and implementation classes that share"," * interfaces. Each alias class points to an appropriate implementation class dependent on the browser's "," * capabilities. There should rarely, if ever, be a need to interact directly with an implementation class.</p>"," *"," * <p>Below is a list of available classes. "," * <ul>"," * <li><a href=\"../classes/Graphic.html\">`Graphic`</a>"," * <li><a href=\"../classes/Shape.html\">`Shape`</a>"," * <li><a href=\"../classes/Circle.html\">`Circle`</a>"," * <li><a href=\"../classes/Ellipse.html\">`Ellipse`</a>"," * <li><a href=\"../classes/Rect.html\">`Rect`</a>"," * <li><a href=\"../classes/Path.html\">`Path`</a>"," * </ul>"," * You can also extend the `Shape` class to create your own custom shape classes.</p>"," * @module graphics"," * @main graphics"," */","var SETTER = \"setter\","," PluginHost = Y.Plugin.Host,"," VALUE = \"value\","," VALUEFN = \"valueFn\","," READONLY = \"readOnly\","," Y_LANG = Y.Lang,"," STR = \"string\","," WRITE_ONCE = \"writeOnce\","," GraphicBase,"," AttributeLite;"," "," /**"," * AttributeLite provides Attribute-like getters and setters for shape classes in the Graphics module. It provides a get/set API without the event infastructure."," * This class is temporary and a work in progress."," *"," * @class AttributeLite"," * @constructor"," */"," AttributeLite = function()"," {"," var host = this; // help compression"," "," // Perf tweak - avoid creating event literals if not required."," host._ATTR_E_FACADE = {};"," "," Y.EventTarget.call(this, {emitFacade:true});"," host._state = {};"," host.prototype = Y.mix(AttributeLite.prototype, host.prototype);"," };",""," AttributeLite.prototype = {"," /**"," * Initializes the attributes for a shape. If an attribute config is passed into the constructor of the host, "," * the initial values will be overwritten."," *"," * @method addAttrs"," * @param {Object} cfg Optional object containing attributes key value pairs to be set."," */"," addAttrs: function(cfg)"," {"," var host = this,"," attrConfig = this.constructor.ATTRS, "," attr,"," i,"," fn,"," state = host._state;"," for(i in attrConfig)"," {"," if(attrConfig.hasOwnProperty(i))"," {"," attr = attrConfig[i];"," if(attr.hasOwnProperty(VALUE))"," {"," state[i] = attr.value;"," }"," else if(attr.hasOwnProperty(VALUEFN))"," {"," fn = attr.valueFn;"," if(Y_LANG.isString(fn))"," {"," state[i] = host[fn].apply(host);"," }"," else"," {"," state[i] = fn.apply(host);"," }"," }"," }"," }"," host._state = state;"," for(i in attrConfig)"," {"," if(attrConfig.hasOwnProperty(i))"," {"," attr = attrConfig[i];"," if(attr.hasOwnProperty(READONLY) && attr.readOnly)"," {"," continue;"," }",""," if(attr.hasOwnProperty(WRITE_ONCE) && attr.writeOnce)"," {"," attr.readOnly = true;"," }",""," if(cfg && cfg.hasOwnProperty(i))"," {"," if(attr.hasOwnProperty(SETTER))"," {"," host._state[i] = attr.setter.apply(host, [cfg[i]]);"," }"," else"," {"," host._state[i] = cfg[i];"," }"," }"," }"," }"," },",""," /**"," * For a given item, returns the value of the property requested, or undefined if not found."," *"," * @method get"," * @param name {String} The name of the item"," * @return {Any} The value of the supplied property."," */"," get: function(attr)"," {"," var host = this,"," getter,"," attrConfig = host.constructor.ATTRS;"," if(attrConfig && attrConfig[attr])"," {"," getter = attrConfig[attr].getter;"," if(getter)"," {"," if(typeof getter == STR)"," {"," return host[getter].apply(host);"," }"," return attrConfig[attr].getter.apply(host);"," }",""," return host._state[attr];"," }"," return null;"," },"," "," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," set: function(attr, val)"," {"," var i;"," if(Y_LANG.isObject(attr))"," {"," for(i in attr)"," {"," if(attr.hasOwnProperty(i))"," {"," this._set(i, attr[i]);"," }"," }"," }"," else"," {"," this._set.apply(this, arguments);"," }"," },",""," /**"," * Provides setter logic. Used by `set`."," *"," * @method _set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," * @protected"," */"," _set: function(attr, val)"," {"," var host = this,"," setter,"," args,"," attrConfig = host.constructor.ATTRS;"," if(attrConfig && attrConfig.hasOwnProperty(attr))"," {"," setter = attrConfig[attr].setter;"," if(setter)"," {"," args = [val];"," if(typeof setter == STR)"," {"," val = host[setter].apply(host, args);"," }"," else"," {"," val = attrConfig[attr].setter.apply(host, args);"," }"," }"," host._state[attr] = val;"," }"," }"," };"," Y.mix(AttributeLite, Y.EventTarget, false, null, 1);"," Y.AttributeLite = AttributeLite;",""," /**"," * GraphicBase serves as the base class for the graphic layer. It serves the same purpose as"," * Base but uses a lightweight getter/setter class instead of Attribute."," * This class is temporary and a work in progress."," *"," * @class GraphicBase"," * @constructor"," * @param {Object} cfg Key value pairs for attributes"," */"," GraphicBase = function(cfg)"," {"," var host = this,"," PluginHost = Y.Plugin && Y.Plugin.Host; "," if (host._initPlugins && PluginHost) {"," PluginHost.call(host);"," }"," "," host.name = host.constructor.NAME;"," host._eventPrefix = host.constructor.EVENT_PREFIX || host.constructor.NAME;"," AttributeLite.call(host);"," host.addAttrs(cfg);"," host.init.apply(this, arguments);"," if (host._initPlugins) {"," // Need to initPlugins manually, to handle constructor parsing, static Plug parsing"," host._initPlugins(cfg);"," }"," host.initialized = true;"," };",""," GraphicBase.NAME = \"baseGraphic\";",""," GraphicBase.prototype = {"," /**"," * Init method, invoked during construction."," * Fires an init event after calling `initializer` on implementers."," *"," * @method init"," * @protected "," */"," init: function()"," {"," this.publish(\"init\", {"," fireOnce:true"," });"," this.initializer.apply(this, arguments);"," this.fire(\"init\", {cfg: arguments[0]});"," },",""," /**"," * Camel case concatanates two strings."," *"," * @method _camelCaseConcat"," * @param {String} prefix The first string"," * @param {String} name The second string"," * @return String"," * @private"," */"," _camelCaseConcat: function(prefix, name)"," {"," return prefix + name.charAt(0).toUpperCase() + name.slice(1);"," }"," };","//Straightup augment, no wrapper functions","Y.mix(GraphicBase, Y.AttributeLite, false, null, 1);","Y.mix(GraphicBase, PluginHost, false, null, 1);","GraphicBase.prototype.constructor = GraphicBase;","GraphicBase.plug = PluginHost.plug;","GraphicBase.unplug = PluginHost.unplug;","Y.GraphicBase = GraphicBase;","","","/**"," * `Drawing` provides a set of drawing methods used by `Path` and custom shape classes. "," * `Drawing` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGDrawing.html\">`SVGDrawing`</a></li>"," * <li><a href=\"VMLDrawing.html\">`VMLDrawing`</a></li>"," * <li><a href=\"CanvasDrawing.html\">`CanvasDrawing`</a></li>"," * </ul>"," *"," * @class Drawing"," * @constructor"," */"," /**"," * Draws a line segment using the current line style from the current drawing position to the specified x and y coordinates."," * "," * @method lineTo"," * @param {Number} point1 x-coordinate for the end point."," * @param {Number} point2 y-coordinate for the end point."," */"," /**"," * Moves the current drawing position to specified x and y coordinates."," *"," * @method moveTo"," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a bezier curve."," *"," * @method curveTo"," * @param {Number} cp1x x-coordinate for the first control point."," * @param {Number} cp1y y-coordinate for the first control point."," * @param {Number} cp2x x-coordinate for the second control point."," * @param {Number} cp2y y-coordinate for the second control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a quadratic bezier curve."," *"," * @method quadraticCurveTo"," * @param {Number} cpx x-coordinate for the control point."," * @param {Number} cpy y-coordinate for the control point."," * @param {Number} x x-coordinate for the end point."," * @param {Number} y y-coordinate for the end point."," */"," /**"," * Draws a rectangle."," *"," * @method drawRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," */"," /**"," * Draws a rectangle with rounded corners."," * "," * @method drawRoundRect"," * @param {Number} x x-coordinate"," * @param {Number} y y-coordinate"," * @param {Number} w width"," * @param {Number} h height"," * @param {Number} ew width of the ellipse used to draw the rounded corners"," * @param {Number} eh height of the ellipse used to draw the rounded corners"," */"," /**"," * Completes a drawing operation. "," *"," * @method end"," */"," /**"," * Clears the path."," *"," * @method clear"," */","/**"," * <p>Base class for creating shapes.</p>"," * <p>`Shape` is an abstract class and is not meant to be used directly. The following classes extend"," * `Shape`."," *"," * <ul>"," * <li><a href=\"Circle.html\">`Circle`</a></li>"," * <li><a href=\"Ellipse.html\">`Ellipse`</a></li>"," * <li><a href=\"Rect.html\">`Rect`</a></li>"," * <li><a href=\"Path.html\">`Path`</a></li>"," * </ul>"," *"," * `Shape` can also be extended to create custom shape classes.</p>"," *"," * `Shape` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGShape.html\">`SVGShape`</a></li>"," * <li><a href=\"VMLShape.html\">`VMLShape`</a></li>"," * <li><a href=\"CanvasShape.html\">`CanvasShape`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Shape` will point to the appropriate implemention.</p>"," *"," * @class Shape"," * @constructor"," * @param {Object} cfg (optional) Attribute configs"," */"," /**"," * Init method, invoked during construction."," * Calls `initializer` method."," *"," * @method init"," * @protected"," */"," /**"," * Initializes the shape"," *"," * @private"," * @method initializer"," */"," /**"," * Add a class name to each node."," *"," * @method addClass"," * @param {String} className the class name to add to the node's class attribute "," */"," /**"," * Removes a class name from each node."," *"," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," */"," /**"," * Gets the current position of the node in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," /**"," * Set the position of the shape in page coordinates, regardless of how the node is positioned."," *"," * @method setXY"," * @param {Array} Contains x & y values for new position (coordinates are page-based)"," */"," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy. "," *"," * @method contains"," * @param {Shape | HTMLElement} needle The possible node or descendent"," * @return Boolean Whether or not this shape is the needle or its ancestor."," */"," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," /**"," * Test if the supplied node matches the supplied selector."," *"," * @method test"," * @param {String} selector The CSS selector to test against."," * @return Boolean Wheter or not the shape matches the selector."," */"," /**"," * Sets the value of an attribute."," *"," * @method set"," * @param {String|Object} name The name of the attribute. Alternatively, an object of key value pairs can "," * be passed in to set multiple attributes at once."," * @param {Any} value The value to set the attribute to. This value is ignored if an object is received as "," * the name param."," */"," /**"," * Specifies a 2d translation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," /**"," * Translates the shape along the x-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateX"," * @param {Number} x The value to translate."," */"," /**"," * Translates the shape along the y-axis. When translating x and y coordinates,"," * use the `translate` method."," *"," * @method translateY"," * @param {Number} y The value to translate."," */"," /**"," * Skews the shape around the x-axis and y-axis."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," /**"," * Skews the shape around the x-axis."," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," /**"," * Skews the shape around the y-axis."," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," /**"," * Rotates the shape clockwise around it transformOrigin."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," /**"," * Specifies a 2d scaling operation."," *"," * @method scale"," * @param {Number} val"," */"," /**"," * Returns the bounds for a shape."," *"," * Calculates the a new bounding box from the original corner coordinates (base on size and position) and the transform matrix."," * The calculated bounding box is used by the graphic instance to calculate its viewBox. "," *"," * @method getBounds"," * @return Object"," */"," /**"," * Destroys the instance."," *"," * @method destroy"," */"," /**"," * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a "," * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5]."," *"," * @config transformOrigin"," * @type Array"," */"," /**"," * <p>A string containing, in order, transform operations applied to the shape instance. The `transform` string can contain the following values:"," * "," * <dl>"," * <dt>rotate</dt><dd>Rotates the shape clockwise around it transformOrigin.</dd>"," * <dt>translate</dt><dd>Specifies a 2d translation.</dd>"," * <dt>skew</dt><dd>Skews the shape around the x-axis and y-axis.</dd>"," * <dt>scale</dt><dd>Specifies a 2d scaling operation.</dd>"," * <dt>translateX</dt><dd>Translates the shape along the x-axis.</dd>"," * <dt>translateY</dt><dd>Translates the shape along the y-axis.</dd>"," * <dt>skewX</dt><dd>Skews the shape around the x-axis.</dd>"," * <dt>skewY</dt><dd>Skews the shape around the y-axis.</dd>"," * </dl>"," * </p>"," * <p>Applying transforms through the transform attribute will reset the transform matrix and apply a new transform. The shape class also contains corresponding methods for each transform"," * that will apply the transform to the current matrix. The below code illustrates how you might use the `transform` attribute to instantiate a recangle with a rotation of 45 degrees.</p>"," var myRect = new Y.Rect({"," type:\"rect\","," width: 50,"," height: 40,"," transform: \"rotate(45)\""," };"," * <p>The code below would apply `translate` and `rotate` to an existing shape.</p>"," "," myRect.set(\"transform\", \"translate(40, 50) rotate(45)\");"," * @config transform"," * @type String "," */"," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," /**"," * Indicates the x position of shape."," *"," * @config x"," * @type Number"," */"," /**"," * Indicates the y position of shape."," *"," * @config y"," * @type Number"," */"," /**"," * Indicates the width of the shape"," *"," * @config width"," * @type Number"," */"," /**"," * Indicates the height of the shape"," * "," * @config height"," * @type Number"," */"," /**"," * Indicates whether the shape is visible."," *"," * @config visible"," * @type Boolean"," */"," /**"," * Contains information about the fill of the shape. "," * <dl>"," * <dt>color</dt><dd>The color of the fill.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>"," * <dt>type</dt><dd>Type of fill."," * <dl>"," * <dt>solid</dt><dd>Solid single color fill. (default)</dd>"," * <dt>linear</dt><dd>Linear gradient fill.</dd>"," * <dt>radial</dt><dd>Radial gradient fill.</dd>"," * </dl>"," * </dd>"," * </dl>"," * <p>If a `linear` or `radial` is specified as the fill type. The following additional property is used:"," * <dl>"," * <dt>stops</dt><dd>An array of objects containing the following properties:"," * <dl>"," * <dt>color</dt><dd>The color of the stop.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE 6 - 8</dd>"," * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd> "," * </dl>"," * </dd>"," * <p>Linear gradients also have the following property:</p>"," * <dt>rotation</dt><dd>Linear gradients flow left to right by default. The rotation property allows you to change the flow by rotation. (e.g. A rotation of 180 would make the gradient pain from right to left.)</dd>"," * <p>Radial gradients have the following additional properties:</p>"," * <dt>r</dt><dd>Radius of the gradient circle.</dd>"," * <dt>fx</dt><dd>Focal point x-coordinate of the gradient.</dd>"," * <dt>fy</dt><dd>Focal point y-coordinate of the gradient.</dd>"," * <dt>cx</dt><dd>"," * <p>The x-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * <dt>cy</dt><dd>"," * <p>The y-coordinate of the center of the gradient circle. Determines where the color stop begins. The default value 0.5.</p>"," * <p><strong>Note: </strong>Currently, this property is not implemented for corresponding `CanvasShape` and `VMLShape` classes which are used on Android or IE 6 - 8.</p>"," * </dd>"," * </dl>"," *"," * @config fill"," * @type Object "," */"," /**"," * Contains information about the stroke of the shape."," * <dl>"," * <dt>color</dt><dd>The color of the stroke.</dd>"," * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>"," * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>"," * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to \"none\", a solid stroke is drawn. When set to an array, the first index indicates the"," * length of the dash. The second index indicates the length of gap."," * <dt>linecap</dt><dd>Specifies the linecap for the stroke. The following values can be specified:"," * <dl>"," * <dt>butt (default)</dt><dd>Specifies a butt linecap.</dd>"," * <dt>square</dt><dd>Specifies a sqare linecap.</dd>"," * <dt>round</dt><dd>Specifies a round linecap.</dd>"," * </dl>"," * </dd>"," * <dt>linejoin</dt><dd>Specifies a linejoin for the stroke. The following values can be specified:"," * <dl>"," * <dt>round (default)</dt><dd>Specifies that the linejoin will be round.</dd>"," * <dt>bevel</dt><dd>Specifies a bevel for the linejoin.</dd>"," * <dt>miter limit</dt><dd>An integer specifying the miter limit of a miter linejoin. If you want to specify a linejoin of miter, you simply specify the limit as opposed to having"," * separate miter and miter limit values.</dd>"," * </dl>"," * </dd>"," * </dl>"," *"," * @config stroke"," * @type Object"," */"," /**"," * Dom node for the shape."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," /**"," * Represents an SVG Path string. This will be parsed and added to shape's API to represent the SVG data across all implementations. Note that when using VML or SVG "," * implementations, part of this content will be added to the DOM using respective VML/SVG attributes. If your content comes from an untrusted source, you will need "," * to ensure that no malicious code is included in that content. "," *"," * @config data"," * @type String"," */"," /**"," * Reference to the parent graphic instance"," *"," * @config graphic"," * @type Graphic"," * @readOnly"," */","","/**"," * <p>Creates circle shape with editable attributes.</p> "," * <p>`Circle` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * The method's `cfg` argument contains a `type` attribute. Assigning \"circle\" or `Y.Circle` to this attribute will create a `Circle` instance. Required attributes"," * for instantiating a `Circle` are `type` and `radius`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," * "," * The below code creates a circle by defining the `type` attribute as \"circle\":</p>",""," var myCircle = myGraphic.addShape({"," type: \"circle\","," radius: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, this same circle is created by defining the `type` attribute with a class reference:"," *"," var myCircle = myGraphic.addShape({"," type: Y.Circle,"," radius: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," * "," * <p>`Circle` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGCircle.html\">`SVGCircle`</a></li>"," * <li><a href=\"VMLCircle.html\">`VMLCircle`</a></li>"," * <li><a href=\"CanvasCircle.html\">`CanvasCircle`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Circle` will point to the appropriate implemention.</p>"," *"," * @class Circle"," * @extends Shape"," * @constructor"," */"," /**"," * Radius of the circle"," *"," * @config radius"," * @type Number"," */","/**"," * <p>Creates an ellipse shape with editable attributes.</p>"," * <p>`Ellipse` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> class. "," * The method's `cfg` argument contains a `type` attribute. Assigning \"ellipse\" or `Y.Ellipse` to this attribute will create a `Ellipse` instance. Required attributes"," * for instantiating a `Ellipse` are `type`, `width` and `height`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," * "," * The below code creates an ellipse by defining the `type` attribute as \"ellipse\":</p>",""," var myEllipse = myGraphic.addShape({"," type: \"ellipse\","," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, the same ellipse is created by defining the `type` attribute with a class reference:"," *"," var myEllipse = myGraphic.addShape({"," type: Y.Ellipse,"," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," * "," * <p>`Ellipse` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGEllipse.html\">`SVGEllipse`</a></li>"," * <li><a href=\"VMLEllipse.html\">`VMLEllipse`</a></li>"," * <li><a href=\"CanvasEllipse.html\">`CanvasEllipse`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Ellipse` will point to the appropriate implemention.</p>"," *"," * @class Ellipse"," * @extends Shape"," * @constructor"," */","/**"," * <p>Creates an rectangle shape with editable attributes.</p>"," * <p>`Rect` instances can be created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> "," * class. The method's `cfg` argument contains a `type` attribute. Assigning \"rect\" or `Y.Rect` to this attribute will create a `Rect` instance. "," * Required attributes for instantiating a `Rect` are `type`, `width` and `height`. Optional attributes include:"," * <ul>"," * <li><a href=\"#attr_fill\">fill</a></li>"," * <li><a href=\"#attr_id\">id</a></li>"," * <li><a href=\"#attr_stroke\">stroke</a></li>"," * <li><a href=\"#attr_transform\">transform</a></li>"," * <li><a href=\"#attr_transformOrigin\">transformOrigin</a></li>"," * <li><a href=\"#attr_visible\">visible</a></li>"," * <li><a href=\"#attr_x\">x</a></li>"," * <li><a href=\"#attr_y\">y</a></li>"," * </ul>"," *"," * The below code creates a rectangle by defining the `type` attribute as \"rect\":</p>",""," var myRect = myGraphic.addShape({"," type: \"rect\","," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below, the same rectangle is created by defining the `type` attribute with a class reference:"," *"," var myRect = myGraphic.addShape({"," type: Y.Rect,"," width: 20,"," height: 10,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * <p>`Rect` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGRect.html\">`SVGRect`</a></li>"," * <li><a href=\"VMLRect.html\">`VMLRect`</a></li>"," * <li><a href=\"CanvasRect.html\">`CanvasRect`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Rect` will point to the appropriate implemention.</p>"," *"," * @class Rect"," * @extends Shape"," * @constructor"," */","/**"," * <p>The `Path` class creates a shape through the use of drawing methods. The `Path` class has the following drawing methods available:</p>"," * <ul>"," * <li><a href=\"#method_clear\">`clear`</a></li>"," * <li><a href=\"#method_curveTo\">`curveTo`</a></li>"," * <li><a href=\"#method_drawRect\">`drawRect`</a></li>"," * <li><a href=\"#method_drawRoundRect\">`drawRoundRect`</a></li>"," * <li><a href=\"#method_end\">`end`</a></li>"," * <li><a href=\"#method_lineTo\">`lineTo`</a></li>"," * <li><a href=\"#method_moveTo\">`moveTo`</a></li>"," * <li><a href=\"#method_quadraticCurveTo\">`quadraticCurveTo`</a></li>"," * </ul>"," *"," * <p>Like other shapes, `Path` elements are created using the <a href=\"Graphic.html#method_addShape\">`addShape`</a> method of the <a href=\"Graphic.html\">`Graphic`</a> "," * class. The method's `cfg` argument contains a `type` attribute. Assigning \"path\" or `Y.Path` to this attribute will create a `Path` instance."," * After instantiation, a series of drawing operations must be performed in order to render a shape. The below code instantiates a path element by defining the `type` "," * attribute as \"path\":</p>",""," var myPath = myGraphic.addShape({"," type: \"path\","," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * Below a `Path` element with the same properties is instantiated by defining the `type` attribute with a class reference:"," *"," var myPath = myGraphic.addShape({"," type: Y.Path,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });",""," * After instantiation, a shape or segment needs to be drawn for an element to render. After all draw operations are performed, the <a href=\"#method_end\">`end`</a>"," * method will render the shape. The code below will draw a triangle:"," "," myPath.moveTo(35, 5);"," myPath.lineTo(65, 65);"," myPath.lineTo(5, 65);"," myPath.lineTo(35, 5);"," myPath.end();"," *"," * <p>`Path` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGPath.html\">`SVGPath`</a></li>"," * <li><a href=\"VMLPath.html\">`VMLPath`</a></li>"," * <li><a href=\"CanvasPath.html\">`CanvasPath`</a></li>"," * </ul> "," * It is not necessary to interact with these classes directly. `Path` will point to the appropriate implemention.</p>"," *"," * @class Path"," * @extends Shape"," * @uses Drawing"," * @constructor"," */"," /**"," * Indicates the path used for the node."," *"," * @config path"," * @type String"," * @readOnly"," */","/**"," * `Graphic` acts a factory and container for shapes. You need at least one `Graphic` instance to create shapes for your application. "," * <p>The code block below creates a `Graphic` instance and appends it to an HTMLElement with the id 'mygraphiccontainer'.</p>"," "," var myGraphic = new Y.Graphic({render:\"#mygraphiccontainer\"});",""," * <p>Alternatively, you can add a `Graphic` instance to the DOM using the <a href=\"#method_render\">`render`</a> method.</p>"," var myGraphic = new Y.Graphic();"," myGraphic.render(\"#mygraphiccontainer\");",""," * `Graphic` has the following implementations based on browser capability."," * <ul>"," * <li><a href=\"SVGGraphic.html\">`SVGGraphic`</a></li>"," * <li><a href=\"VMLGraphic.html\">`VMLGraphic`</a></li>"," * <li><a href=\"CanvasGraphic.html\">`CanvasGraphic`</a></li>"," * </ul>"," *"," * It is not necessary to interact with these classes directly. `Graphic` will point to the appropriate implemention.</p>"," *"," * @class Graphic"," * @constructor"," */"," /**"," * Whether or not to render the `Graphic` automatically after to a specified parent node after init. This can be a Node instance or a CSS selector string."," * "," * @config render"," * @type Node | String "," */"," /**"," * Unique id for class instance."," *"," * @config id"," * @type String"," */"," /**"," * Key value pairs in which a shape instance is associated with its id."," *"," * @config shapes"," * @type Object"," * @readOnly"," */"," /**"," * Object containing size and coordinate data for the content of a Graphic in relation to the coordSpace node."," *"," * @config contentBounds"," * @type Object "," * @readOnly"," */"," /**"," * The html element that represents to coordinate system of the Graphic instance."," *"," * @config node"," * @type HTMLElement"," * @readOnly"," */"," /**"," * Indicates the width of the `Graphic`. "," *"," * @config width"," * @type Number"," */"," /**"," * Indicates the height of the `Graphic`. "," *"," * @config height "," * @type Number"," */"," /**"," * Determines the sizing of the Graphic. "," *"," * <dl>"," * <dt>sizeContentToGraphic</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The content contained in the Graphic will be sized to fit with in the Graphic instance's "," * dimensions. When using this setting, the <code>preserveAspectRatio</code> attribute will determine how the contents are sized.</dd>"," * <dt>sizeGraphicToContent</dt><dd>(Also accepts a value of true) The Graphic's width and height are determined by the size and positioning of the content.</dd>"," * <dt>false</dt><dd>The Graphic's width and height attributes are, either explicitly set through the <code>width</code> and <code>height</code>"," * attributes or are determined by the dimensions of the parent element. The contents of the Graphic instance are not affected by this setting.</dd>"," * </dl>"," *"," *"," * @config autoSize"," * @type Boolean | String"," * @default false"," */"," /**"," * Determines how content is sized when <code>autoSize</code> is set to <code>sizeContentToGraphic</code>."," *"," * <dl>"," * <dt>none<dt><dd>Do not force uniform scaling. Scale the graphic content of the given element non-uniformly if necessary "," * such that the element's bounding box exactly matches the viewport rectangle.</dd>"," * <dt>xMinYMin</dt><dd>Force uniform scaling position along the top left of the Graphic's node.</dd>"," * <dt>xMidYMin</dt><dd>Force uniform scaling horizontally centered and positioned at the top of the Graphic's node.<dd>"," * <dt>xMaxYMin</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the top.</dd>"," * <dt>xMinYMid</dt>Force uniform scaling positioned horizontally from the left and vertically centered.</dd>"," * <dt>xMidYMid (the default)</dt><dd>Force uniform scaling with the content centered.</dd>"," * <dt>xMaxYMid</dt><dd>Force uniform scaling positioned horizontally from the right and vertically centered.</dd>"," * <dt>xMinYMax</dt><dd>Force uniform scaling positioned horizontally from the left and vertically from the bottom.</dd>"," * <dt>xMidYMax</dt><dd>Force uniform scaling horizontally centered and position vertically from the bottom.</dd>"," * <dt>xMaxYMax</dt><dd>Force uniform scaling positioned horizontally from the right and vertically from the bottom.</dd>"," * </dl>"," * "," * @config preserveAspectRatio"," * @type String"," * @default xMidYMid"," */"," /**"," * The contentBounds will resize to greater values but not to smaller values. (for performance)"," * When resizing the contentBounds down is desirable, set the resizeDown value to true."," *"," * @config resizeDown "," * @type Boolean"," */"," /**"," * Indicates the x-coordinate for the instance."," *"," * @config x"," * @type Number"," */"," /**"," * Indicates the y-coordinate for the instance."," *"," * @config y"," * @type Number"," */"," /**"," * Indicates whether or not the instance will automatically redraw after a change is made to a shape."," * This property will get set to false when batching operations."," *"," * @config autoDraw"," * @type Boolean"," * @default true"," * @private"," */"," /**"," * Indicates whether the `Graphic` and its children are visible."," *"," * @config visible"," * @type Boolean"," */"," /**"," * Gets the current position of the graphic instance in page coordinates."," *"," * @method getXY"," * @return Array The XY position of the shape."," */"," /**"," * Adds the graphics node to the dom."," * "," * @method render"," * @param {Node|String} parentNode node in which to render the graphics node into."," */"," /**"," * Removes all nodes."," *"," * @method destroy"," */"," /**"," * <p>Generates a shape instance by type. The method accepts an object that contain's the shape's"," * type and attributes to be customized. For example, the code below would create a rectangle:</p>"," *"," var myRect = myGraphic.addShape({"," type: \"rect\","," width: 40,"," height: 30,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * <p>The `Graphics` module includes a few basic shapes. More information on their creation "," * can be found in each shape's documentation:"," *"," * <ul>"," * <li><a href=\"Circle.html\">`Circle`</a></li>"," * <li><a href=\"Ellipse.html\">`Ellipse`</a></li>"," * <li><a href=\"Rect.html\">`Rect`</a></li>"," * <li><a href=\"Path.html\">`Path`</a></li>"," * </ul>"," *"," * The `Graphics` module also allows for the creation of custom shapes. If a custom shape"," * has been created, it can be instantiated with the `addShape` method as well. The attributes,"," * required and optional, would need to be defined in the custom shape."," *"," var myCustomShape = myGraphic.addShape({"," type: Y.MyCustomShape,"," width: 50,"," height: 50,"," fill: {"," color: \"#9aa\""," },"," stroke: {"," weight: 1,"," color: \"#000\""," }"," });"," *"," * @method addShape"," * @param {Object} cfg Object containing the shape's type and attributes. "," * @return Shape"," */"," /**"," * Removes a shape instance from from the graphic instance."," *"," * @method removeShape"," * @param {Shape|String} shape The instance or id of the shape to be removed."," */"," /**"," * Removes all shape instances from the dom."," *"," * @method removeAllShapes"," */"," /**"," * Returns a shape based on the id of its dom node."," *"," * @method getShapeById"," * @param {String} id Dom id of the shape's node attribute."," * @return Shape"," */"," /**"," * Allows for creating multiple shapes in order to batch appending and redraw operations."," *"," * @method batch"," * @param {Function} method Method to execute."," */","","","}, '3.7.3', {\"requires\": [\"node\", \"event-custom\", \"pluginhost\", \"matrix\", \"classnamemanager\"]});"]; _yuitest_coverage["build/graphics/graphics.js"].lines = {"1":0,"32":0,"50":0,"52":0,"55":0,"57":0,"58":0,"59":0,"62":0,"72":0,"78":0,"80":0,"82":0,"83":0,"85":0,"87":0,"89":0,"90":0,"92":0,"96":0,"101":0,"102":0,"104":0,"106":0,"107":0,"109":0,"112":0,"114":0,"117":0,"119":0,"121":0,"125":0,"141":0,"144":0,"146":0,"147":0,"149":0,"151":0,"153":0,"156":0,"158":0,"172":0,"173":0,"175":0,"177":0,"179":0,"185":0,"201":0,"205":0,"207":0,"208":0,"210":0,"211":0,"213":0,"217":0,"220":0,"224":0,"225":0,"236":0,"238":0,"240":0,"241":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"251":0,"253":0,"256":0,"258":0,"268":0,"271":0,"272":0,"286":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0}; _yuitest_coverage["build/graphics/graphics.js"].functions = {"AttributeLite:50":0,"addAttrs:70":0,"get:139":0,"set:170":0,"_set:199":0,"GraphicBase:236":0,"init:266":0,"_camelCaseConcat:284":0,"(anonymous 1):1":0}; _yuitest_coverage["build/graphics/graphics.js"].coveredLines = 82;@@ -1306,4 +1306,4 @@ */ -}, '3.7.2', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});+}, '3.7.3', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});
bundle/graphics/graphics-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1182,4 +1182,4 @@ */ -}, '3.7.2', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});+}, '3.7.3', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});
bundle/graphics/graphics-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("graphics",function(e,t){var n="setter",r=e.Plugin.Host,i="value",s="valueFn",o="readOnly",u=e.Lang,a="string",f="writeOnce",l,c;c=function(){var t=this;t._ATTR_E_FACADE={},e.EventTarget.call(this,{emitFacade:!0}),t._state={},t.prototype=e.mix(c.prototype,t.prototype)},c.prototype={addAttrs:function(e){var t=this,r=this.constructor.ATTRS,a,l,c,h=t._state;for(l in r)r.hasOwnProperty(l)&&(a=r[l],a.hasOwnProperty(i)?h[l]=a.value:a.hasOwnProperty(s)&&(c=a.valueFn,u.isString(c)?h[l]=t[c].apply(t):h[l]=c.apply(t)));t._state=h;for(l in r)if(r.hasOwnProperty(l)){a=r[l];if(a.hasOwnProperty(o)&&a.readOnly)continue;a.hasOwnProperty(f)&&a.writeOnce&&(a.readOnly=!0),e&&e.hasOwnProperty(l)&&(a.hasOwnProperty(n)?t._state[l]=a.setter.apply(t,[e[l]]):t._state[l]=e[l])}},get:function(e){var t=this,n,r=t.constructor.ATTRS;if(r&&r[e])return n=r[e].getter,n?typeof n==a?t[n].apply(t):r[e].getter.apply(t):t._state[e];return null},set:function(e,t){var n;if(u.isObject(e))for(n in e)e.hasOwnProperty(n)&&this._set(n,e[n]);else this._set.apply(this,arguments)},_set:function(e,t){var n=this,r,i,s=n.constructor.ATTRS;s&&s.hasOwnProperty(e)&&(r=s[e].setter,r&&(i=[t],typeof r==a?t=n[r].apply(n,i):t=s[e].setter.apply(n,i)),n._state[e]=t)}},e.mix(c,e.EventTarget,!1,null,1),e.AttributeLite=c,l=function(t){var n=this,r=e.Plugin&&e.Plugin.Host;n._initPlugins&&r&&r.call(n),n.name=n.constructor.NAME,n._eventPrefix=n.constructor.EVENT_PREFIX||n.constructor.NAME,c.call(n),n.addAttrs(t),n.init.apply(this,arguments),n._initPlugins&&n._initPlugins(t),n.initialized=!0},l.NAME="baseGraphic",l.prototype={init:function(){this.publish("init",{fireOnce:!0}),this.initializer.apply(this,arguments),this.fire("init",{cfg:arguments[0]})},_camelCaseConcat:function(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}},e.mix(l,e.AttributeLite,!1,null,1),e.mix(l,r,!1,null,1),l.prototype.constructor=l,l.plug=r.plug,l.unplug=r.unplug,e.GraphicBase=l},"3.7.2",{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]});+YUI.add("graphics",function(e,t){var n="setter",r=e.Plugin.Host,i="value",s="valueFn",o="readOnly",u=e.Lang,a="string",f="writeOnce",l,c;c=function(){var t=this;t._ATTR_E_FACADE={},e.EventTarget.call(this,{emitFacade:!0}),t._state={},t.prototype=e.mix(c.prototype,t.prototype)},c.prototype={addAttrs:function(e){var t=this,r=this.constructor.ATTRS,a,l,c,h=t._state;for(l in r)r.hasOwnProperty(l)&&(a=r[l],a.hasOwnProperty(i)?h[l]=a.value:a.hasOwnProperty(s)&&(c=a.valueFn,u.isString(c)?h[l]=t[c].apply(t):h[l]=c.apply(t)));t._state=h;for(l in r)if(r.hasOwnProperty(l)){a=r[l];if(a.hasOwnProperty(o)&&a.readOnly)continue;a.hasOwnProperty(f)&&a.writeOnce&&(a.readOnly=!0),e&&e.hasOwnProperty(l)&&(a.hasOwnProperty(n)?t._state[l]=a.setter.apply(t,[e[l]]):t._state[l]=e[l])}},get:function(e){var t=this,n,r=t.constructor.ATTRS;if(r&&r[e])return n=r[e].getter,n?typeof n==a?t[n].apply(t):r[e].getter.apply(t):t._state[e];return null},set:function(e,t){var n;if(u.isObject(e))for(n in e)e.hasOwnProperty(n)&&this._set(n,e[n]);else this._set.apply(this,arguments)},_set:function(e,t){var n=this,r,i,s=n.constructor.ATTRS;s&&s.hasOwnProperty(e)&&(r=s[e].setter,r&&(i=[t],typeof r==a?t=n[r].apply(n,i):t=s[e].setter.apply(n,i)),n._state[e]=t)}},e.mix(c,e.EventTarget,!1,null,1),e.AttributeLite=c,l=function(t){var n=this,r=e.Plugin&&e.Plugin.Host;n._initPlugins&&r&&r.call(n),n.name=n.constructor.NAME,n._eventPrefix=n.constructor.EVENT_PREFIX||n.constructor.NAME,c.call(n),n.addAttrs(t),n.init.apply(this,arguments),n._initPlugins&&n._initPlugins(t),n.initialized=!0},l.NAME="baseGraphic",l.prototype={init:function(){this.publish("init",{fireOnce:!0}),this.initializer.apply(this,arguments),this.fire("init",{cfg:arguments[0]})},_camelCaseConcat:function(e,t){return e+t.charAt(0).toUpperCase()+t.slice(1)}},e.mix(l,e.AttributeLite,!1,null,1),e.mix(l,r,!1,null,1),l.prototype.constructor=l,l.plug=r.plug,l.unplug=r.unplug,e.GraphicBase=l},"3.7.3",{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]});
bundle/graphics/graphics.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1182,4 +1182,4 @@ */ -}, '3.7.2', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});+}, '3.7.3', {"requires": ["node", "event-custom", "pluginhost", "matrix", "classnamemanager"]});
bundle/handlebars-base/handlebars-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/handlebars-base/handlebars-base.js", code: [] };-_yuitest_coverage["build/handlebars-base/handlebars-base.js"].code=["YUI.add('handlebars-base', function (Y, NAME) {","","/*!","Handlebars.js - Copyright (C) 2011 Yehuda Katz","https://raw.github.com/wycats/handlebars.js/master/LICENSE","*/","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","","/*jshint eqnull:true*/","var Handlebars = {};","","Handlebars.VERSION = \"1.0.beta.5\";","","Handlebars.helpers = {};","Handlebars.partials = {};","","Handlebars.registerHelper = function(name, fn, inverse) {"," if(inverse) { fn.not = inverse; }"," this.helpers[name] = fn;","};","","Handlebars.registerPartial = function(name, str) {"," this.partials[name] = str;","};","","Handlebars.registerHelper('helperMissing', function(arg) {"," if(arguments.length === 2) {"," return undefined;"," } else {"," throw new Error(\"Could not find property '\" + arg + \"'\");"," }","});","","var toString = Object.prototype.toString, functionType = \"[object Function]\";","","Handlebars.registerHelper('blockHelperMissing', function(context, options) {"," var inverse = options.inverse || function() {}, fn = options.fn;","",""," var ret = \"\";"," var type = toString.call(context);",""," if(type === functionType) { context = context.call(this); }",""," if(context === true) {"," return fn(this);"," } else if(context === false || context == null) {"," return inverse(this);"," } else if(type === \"[object Array]\") {"," if(context.length > 0) {"," for(var i=0, j=context.length; i<j; i++) {"," ret = ret + fn(context[i]);"," }"," } else {"," ret = inverse(this);"," }"," return ret;"," } else {"," return fn(context);"," }","});","","Handlebars.registerHelper('each', function(context, options) {"," var fn = options.fn, inverse = options.inverse;"," var ret = \"\";",""," if(context && context.length > 0) {"," for(var i=0, j=context.length; i<j; i++) {"," ret = ret + fn(context[i]);"," }"," } else {"," ret = inverse(this);"," }"," return ret;","});","","Handlebars.registerHelper('if', function(context, options) {"," var type = toString.call(context);"," if(type === functionType) { context = context.call(this); }",""," if(!context || Handlebars.Utils.isEmpty(context)) {"," return options.inverse(this);"," } else {"," return options.fn(this);"," }","});","","Handlebars.registerHelper('unless', function(context, options) {"," var fn = options.fn, inverse = options.inverse;"," options.fn = inverse;"," options.inverse = fn;",""," return Handlebars.helpers['if'].call(this, context, options);","});","","Handlebars.registerHelper('with', function(context, options) {"," return options.fn(context);","});","","Handlebars.registerHelper('log', function(context) {"," Handlebars.log(context);","});","","// END(BROWSER)","// This file provides a YUI-specific implementation of Handlebars' lib/utils.js","// file. Handlebars unfortunately creates enclosed references to its utils, so","// we have to maintain a complete fork of this file rather than just overriding","// specific parts.","","var Lang = Y.Lang;","","Handlebars.Exception = function (message) {"," var error = Error.prototype.constructor.apply(this, arguments),"," key;",""," for (key in error) {"," if (error.hasOwnProperty(key)) {"," this[key] = error[key];"," }"," }",""," this.message = error.message;","};","","Handlebars.Exception.prototype = new Error();","","Handlebars.SafeString = function (string) {"," this.string = string;","};","","Handlebars.SafeString.prototype.toString = function () {"," return this.string.toString();","};","","Handlebars.Utils = {"," escapeExpression: function (string) {"," // Skip escaping for empty strings."," if (string === '') {"," return string;"," }",""," // Don't escape SafeStrings, since they're already (presumed to be)"," // safe."," if (string instanceof Handlebars.SafeString) {"," return string.toString();"," } else if (string === false || !Lang.isValue(string)) {"," return '';"," }",""," // Unlike Handlebars' escaping implementation, Y.Escape.html() will"," // double-escape existing & entities. This seems much less"," // surprising than avoiding double-escaping, especially since"," // a lack of double-escaping would make it impossible to use Handlebars"," // for things like displaying escaped code snippets."," return Y.Escape.html(string);"," },",""," isEmpty: function (value) {"," if (value === false"," || !Lang.isValue(value)"," || (Lang.isArray(value) && !value.length)) {",""," return true;"," }",""," return false;"," }","};","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","Handlebars.VM = {"," template: function(templateSpec) {"," // Just add water"," var container = {"," escapeExpression: Handlebars.Utils.escapeExpression,"," invokePartial: Handlebars.VM.invokePartial,"," programs: [],"," program: function(i, fn, data) {"," var programWrapper = this.programs[i];"," if(data) {"," return Handlebars.VM.program(fn, data);"," } else if(programWrapper) {"," return programWrapper;"," } else {"," programWrapper = this.programs[i] = Handlebars.VM.program(fn);"," return programWrapper;"," }"," },"," programWithDepth: Handlebars.VM.programWithDepth,"," noop: Handlebars.VM.noop"," };",""," return function(context, options) {"," options = options || {};"," return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);"," };"," },",""," programWithDepth: function(fn, data, $depth) {"," var args = Array.prototype.slice.call(arguments, 2);",""," return function(context, options) {"," options = options || {};",""," return fn.apply(this, [context, options.data || data].concat(args));"," };"," },"," program: function(fn, data) {"," return function(context, options) {"," options = options || {};",""," return fn(context, options.data || data);"," };"," },"," noop: function() { return \"\"; },"," invokePartial: function(partial, name, context, helpers, partials, data) {"," var options = { helpers: helpers, partials: partials, data: data };",""," if(partial === undefined) {"," throw new Handlebars.Exception(\"The partial \" + name + \" could not be found\");"," } else if(partial instanceof Function) {"," return partial(context, options);"," } else if (!Handlebars.compile) {"," throw new Handlebars.Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");"," } else {"," partials[name] = Handlebars.compile(partial);"," return partials[name](context, options);"," }"," }","};","","Handlebars.template = Handlebars.VM.template;","","// END(BROWSER)","// This file contains YUI-specific wrapper code and overrides for the","// handlebars-base module.","","/**","Handlebars is a simple template language inspired by Mustache.","","This is a YUI port of the original Handlebars project, which can be found at","<https://github.com/wycats/handlebars.js>.","","@module handlebars","@main handlebars","@since 3.5.0","*/","","/**","Provides basic Handlebars template rendering functionality. Use this module when","you only need to render pre-compiled templates.","","@module handlebars","@submodule handlebars-base","*/","","/**","Handlebars is a simple template language inspired by Mustache.","","This is a YUI port of the original Handlebars project, which can be found at","<https://github.com/wycats/handlebars.js>.","","@class Handlebars","@since 3.5.0","*/","Y.Handlebars = Handlebars;","","Handlebars.VERSION += '-yui';","","// The rest of this file is just API docs for methods defined in Handlebars","// itself.","","/**","Registers a helper function that will be made available to all templates.","","Helper functions receive the current template context as the `this` object, and","can also receive arguments passed by the template.","","@example",""," Y.Handlebars.registerHelper('linkify', function () {"," return '<a href=\"' + Y.Escape.html(this.url) + '\">' +"," Y.Escape.html(this.text) + '</a>';"," });",""," var source = '<ul>{{#links}}<li>{{{linkify}}}</li>{{/links}}</ul>';",""," Y.Handlebars.render(source, {"," links: ["," {url: '/foo', text: 'Foo'},"," {url: '/bar', text: 'Bar'},"," {url: '/baz', text: 'Baz'}"," ]"," });","","@method registerHelper","@param {String} name Name of this helper.","@param {Function} fn Helper function.","@param {Boolean} [inverse=false] If `true`, this helper will be considered an"," \"inverse\" helper, like \"unless\". This means it will only be called if the"," expression given in the template evaluates to a false or empty value.","*/","","/**","Registers a partial that will be made available to all templates.","","A partial is another template that can be used to render part of a larger","template. For example, a website with a common header and footer across all its","pages might use a template for each page, which would call shared partials to","render the headers and footers.","","Partials may be specified as uncompiled template strings or as compiled template","functions.","","@example",""," Y.Handlebars.registerPartial('header', '<h1>{{title}}</h1>');"," Y.Handlebars.registerPartial('footer', 'Copyright (c) 2011 by Me.');",""," var source = '{{> header}} <p>Mustaches are awesome!</p> {{> footer}}';",""," Y.Handlebars.render(source, {title: 'My Page About Mustaches'});","","@method registerPartial","@param {String} name Name of this partial.","@param {Function|String} partial Template string or compiled template function.","*/","","/**","Converts a precompiled template into a renderable template function.","","@example",""," <script src=\"precompiled-template.js\"></script>"," <script>"," YUI().use('handlebars-base', function (Y) {"," // Convert the precompiled template function into a renderable template"," // function."," var template = Y.Handlebars.template(precompiledTemplate);",""," // Render it."," template({pie: 'Pumpkin'});"," });"," </script>","","@method template","@param {Function} template Precompiled Handlebars template function.","@return {Function} Compiled template function.","*/","","","}, '3.7.2', {\"requires\": [\"escape\"]});"];+_yuitest_coverage["build/handlebars-base/handlebars-base.js"].code=["YUI.add('handlebars-base', function (Y, NAME) {","","/*!","Handlebars.js - Copyright (C) 2011 Yehuda Katz","https://raw.github.com/wycats/handlebars.js/master/LICENSE","*/","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","","/*jshint eqnull:true*/","var Handlebars = {};","","Handlebars.VERSION = \"1.0.beta.5\";","","Handlebars.helpers = {};","Handlebars.partials = {};","","Handlebars.registerHelper = function(name, fn, inverse) {"," if(inverse) { fn.not = inverse; }"," this.helpers[name] = fn;","};","","Handlebars.registerPartial = function(name, str) {"," this.partials[name] = str;","};","","Handlebars.registerHelper('helperMissing', function(arg) {"," if(arguments.length === 2) {"," return undefined;"," } else {"," throw new Error(\"Could not find property '\" + arg + \"'\");"," }","});","","var toString = Object.prototype.toString, functionType = \"[object Function]\";","","Handlebars.registerHelper('blockHelperMissing', function(context, options) {"," var inverse = options.inverse || function() {}, fn = options.fn;","",""," var ret = \"\";"," var type = toString.call(context);",""," if(type === functionType) { context = context.call(this); }",""," if(context === true) {"," return fn(this);"," } else if(context === false || context == null) {"," return inverse(this);"," } else if(type === \"[object Array]\") {"," if(context.length > 0) {"," for(var i=0, j=context.length; i<j; i++) {"," ret = ret + fn(context[i]);"," }"," } else {"," ret = inverse(this);"," }"," return ret;"," } else {"," return fn(context);"," }","});","","Handlebars.registerHelper('each', function(context, options) {"," var fn = options.fn, inverse = options.inverse;"," var ret = \"\";",""," if(context && context.length > 0) {"," for(var i=0, j=context.length; i<j; i++) {"," ret = ret + fn(context[i]);"," }"," } else {"," ret = inverse(this);"," }"," return ret;","});","","Handlebars.registerHelper('if', function(context, options) {"," var type = toString.call(context);"," if(type === functionType) { context = context.call(this); }",""," if(!context || Handlebars.Utils.isEmpty(context)) {"," return options.inverse(this);"," } else {"," return options.fn(this);"," }","});","","Handlebars.registerHelper('unless', function(context, options) {"," var fn = options.fn, inverse = options.inverse;"," options.fn = inverse;"," options.inverse = fn;",""," return Handlebars.helpers['if'].call(this, context, options);","});","","Handlebars.registerHelper('with', function(context, options) {"," return options.fn(context);","});","","Handlebars.registerHelper('log', function(context) {"," Handlebars.log(context);","});","","// END(BROWSER)","// This file provides a YUI-specific implementation of Handlebars' lib/utils.js","// file. Handlebars unfortunately creates enclosed references to its utils, so","// we have to maintain a complete fork of this file rather than just overriding","// specific parts.","","var Lang = Y.Lang;","","Handlebars.Exception = function (message) {"," var error = Error.prototype.constructor.apply(this, arguments),"," key;",""," for (key in error) {"," if (error.hasOwnProperty(key)) {"," this[key] = error[key];"," }"," }",""," this.message = error.message;","};","","Handlebars.Exception.prototype = new Error();","","Handlebars.SafeString = function (string) {"," this.string = string;","};","","Handlebars.SafeString.prototype.toString = function () {"," return this.string.toString();","};","","Handlebars.Utils = {"," escapeExpression: function (string) {"," // Skip escaping for empty strings."," if (string === '') {"," return string;"," }",""," // Don't escape SafeStrings, since they're already (presumed to be)"," // safe."," if (string instanceof Handlebars.SafeString) {"," return string.toString();"," } else if (string === false || !Lang.isValue(string)) {"," return '';"," }",""," // Unlike Handlebars' escaping implementation, Y.Escape.html() will"," // double-escape existing & entities. This seems much less"," // surprising than avoiding double-escaping, especially since"," // a lack of double-escaping would make it impossible to use Handlebars"," // for things like displaying escaped code snippets."," return Y.Escape.html(string);"," },",""," isEmpty: function (value) {"," if (value === false"," || !Lang.isValue(value)"," || (Lang.isArray(value) && !value.length)) {",""," return true;"," }",""," return false;"," }","};","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","Handlebars.VM = {"," template: function(templateSpec) {"," // Just add water"," var container = {"," escapeExpression: Handlebars.Utils.escapeExpression,"," invokePartial: Handlebars.VM.invokePartial,"," programs: [],"," program: function(i, fn, data) {"," var programWrapper = this.programs[i];"," if(data) {"," return Handlebars.VM.program(fn, data);"," } else if(programWrapper) {"," return programWrapper;"," } else {"," programWrapper = this.programs[i] = Handlebars.VM.program(fn);"," return programWrapper;"," }"," },"," programWithDepth: Handlebars.VM.programWithDepth,"," noop: Handlebars.VM.noop"," };",""," return function(context, options) {"," options = options || {};"," return templateSpec.call(container, Handlebars, context, options.helpers, options.partials, options.data);"," };"," },",""," programWithDepth: function(fn, data, $depth) {"," var args = Array.prototype.slice.call(arguments, 2);",""," return function(context, options) {"," options = options || {};",""," return fn.apply(this, [context, options.data || data].concat(args));"," };"," },"," program: function(fn, data) {"," return function(context, options) {"," options = options || {};",""," return fn(context, options.data || data);"," };"," },"," noop: function() { return \"\"; },"," invokePartial: function(partial, name, context, helpers, partials, data) {"," var options = { helpers: helpers, partials: partials, data: data };",""," if(partial === undefined) {"," throw new Handlebars.Exception(\"The partial \" + name + \" could not be found\");"," } else if(partial instanceof Function) {"," return partial(context, options);"," } else if (!Handlebars.compile) {"," throw new Handlebars.Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");"," } else {"," partials[name] = Handlebars.compile(partial);"," return partials[name](context, options);"," }"," }","};","","Handlebars.template = Handlebars.VM.template;","","// END(BROWSER)","// This file contains YUI-specific wrapper code and overrides for the","// handlebars-base module.","","/**","Handlebars is a simple template language inspired by Mustache.","","This is a YUI port of the original Handlebars project, which can be found at","<https://github.com/wycats/handlebars.js>.","","@module handlebars","@main handlebars","@since 3.5.0","*/","","/**","Provides basic Handlebars template rendering functionality. Use this module when","you only need to render pre-compiled templates.","","@module handlebars","@submodule handlebars-base","*/","","/**","Handlebars is a simple template language inspired by Mustache.","","This is a YUI port of the original Handlebars project, which can be found at","<https://github.com/wycats/handlebars.js>.","","@class Handlebars","@since 3.5.0","*/","Y.Handlebars = Handlebars;","","Handlebars.VERSION += '-yui';","","// The rest of this file is just API docs for methods defined in Handlebars","// itself.","","/**","Registers a helper function that will be made available to all templates.","","Helper functions receive the current template context as the `this` object, and","can also receive arguments passed by the template.","","@example",""," Y.Handlebars.registerHelper('linkify', function () {"," return '<a href=\"' + Y.Escape.html(this.url) + '\">' +"," Y.Escape.html(this.text) + '</a>';"," });",""," var source = '<ul>{{#links}}<li>{{{linkify}}}</li>{{/links}}</ul>';",""," Y.Handlebars.render(source, {"," links: ["," {url: '/foo', text: 'Foo'},"," {url: '/bar', text: 'Bar'},"," {url: '/baz', text: 'Baz'}"," ]"," });","","@method registerHelper","@param {String} name Name of this helper.","@param {Function} fn Helper function.","@param {Boolean} [inverse=false] If `true`, this helper will be considered an"," \"inverse\" helper, like \"unless\". This means it will only be called if the"," expression given in the template evaluates to a false or empty value.","*/","","/**","Registers a partial that will be made available to all templates.","","A partial is another template that can be used to render part of a larger","template. For example, a website with a common header and footer across all its","pages might use a template for each page, which would call shared partials to","render the headers and footers.","","Partials may be specified as uncompiled template strings or as compiled template","functions.","","@example",""," Y.Handlebars.registerPartial('header', '<h1>{{title}}</h1>');"," Y.Handlebars.registerPartial('footer', 'Copyright (c) 2011 by Me.');",""," var source = '{{> header}} <p>Mustaches are awesome!</p> {{> footer}}';",""," Y.Handlebars.render(source, {title: 'My Page About Mustaches'});","","@method registerPartial","@param {String} name Name of this partial.","@param {Function|String} partial Template string or compiled template function.","*/","","/**","Converts a precompiled template into a renderable template function.","","@example",""," <script src=\"precompiled-template.js\"></script>"," <script>"," YUI().use('handlebars-base', function (Y) {"," // Convert the precompiled template function into a renderable template"," // function."," var template = Y.Handlebars.template(precompiledTemplate);",""," // Render it."," template({pie: 'Pumpkin'});"," });"," </script>","","@method template","@param {Function} template Precompiled Handlebars template function.","@return {Function} Compiled template function.","*/","","","}, '3.7.3', {\"requires\": [\"escape\"]});"]; _yuitest_coverage["build/handlebars-base/handlebars-base.js"].lines = {"1":0,"12":0,"14":0,"16":0,"17":0,"19":0,"20":0,"21":0,"24":0,"25":0,"28":0,"29":0,"30":0,"32":0,"36":0,"38":0,"39":0,"42":0,"43":0,"45":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"57":0,"59":0,"61":0,"65":0,"66":0,"67":0,"69":0,"70":0,"71":0,"74":0,"76":0,"79":0,"80":0,"81":0,"83":0,"84":0,"86":0,"90":0,"91":0,"92":0,"93":0,"95":0,"98":0,"99":0,"102":0,"103":0,"112":0,"114":0,"115":0,"118":0,"119":0,"120":0,"124":0,"127":0,"129":0,"130":0,"133":0,"134":0,"137":0,"140":0,"141":0,"146":0,"147":0,"148":0,"149":0,"157":0,"161":0,"165":0,"168":0,"174":0,"177":0,"182":0,"183":0,"184":0,"185":0,"186":0,"188":0,"189":0,"196":0,"197":0,"198":0,"203":0,"205":0,"206":0,"208":0,"212":0,"213":0,"215":0,"218":0,"220":0,"222":0,"223":0,"224":0,"225":0,"226":0,"227":0,"229":0,"230":0,"235":0,"269":0,"271":0}; _yuitest_coverage["build/handlebars-base/handlebars-base.js"].functions = {"registerHelper:19":0,"registerPartial:24":0,"(anonymous 2):28":0,"(anonymous 3):38":0,"(anonymous 5):65":0,"(anonymous 6):79":0,"(anonymous 7):90":0,"(anonymous 8):98":0,"(anonymous 9):102":0,"Exception:114":0,"SafeString:129":0,"toString:133":0,"escapeExpression:138":0,"isEmpty:160":0,"program:181":0,"(anonymous 10):196":0,"template:175":0,"(anonymous 11):205":0,"programWithDepth:202":0,"(anonymous 12):212":0,"program:211":0,"noop:218":0,"invokePartial:219":0,"(anonymous 1):1":0}; _yuitest_coverage["build/handlebars-base/handlebars-base.js"].coveredLines = 109;@@ -524,4 +524,4 @@ */ -}, '3.7.2', {"requires": ["escape"]});+}, '3.7.3', {"requires": ["escape"]});
bundle/handlebars-base/handlebars-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -358,4 +358,4 @@ */ -}, '3.7.2', {"requires": ["escape"]});+}, '3.7.3', {"requires": ["escape"]});
bundle/handlebars-base/handlebars-base-min.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,4 +9,4 @@ Handlebars.js - Copyright (C) 2011 Yehuda Katz https://raw.github.com/wycats/handlebars.js/master/LICENSE */-;var n={};n.VERSION="1.0.beta.5",n.helpers={},n.partials={},n.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},n.registerPartial=function(e,t){this.partials[e]=t},n.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var r=Object.prototype.toString,i="[object Function]";n.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse||function(){},s=t.fn,o="",u=r.call(e);u===i&&(e=e.call(this));if(e===!0)return s(this);if(e===!1||e==null)return n(this);if(u==="[object Array]"){if(e.length>0)for(var a=0,f=e.length;a<f;a++)o+=s(e[a]);else o=n(this);return o}return s(e)}),n.registerHelper("each",function(e,t){var n=t.fn,r=t.inverse,i="";if(e&&e.length>0)for(var s=0,o=e.length;s<o;s++)i+=n(e[s]);else i=r(this);return i}),n.registerHelper("if",function(e,t){var s=r.call(e);return s===i&&(e=e.call(this)),!e||n.Utils.isEmpty(e)?t.inverse(this):t.fn(this)}),n.registerHelper("unless",function(e,t){var r=t.fn,i=t.inverse;return t.fn=i,t.inverse=r,n.helpers["if"].call(this,e,t)}),n.registerHelper("with",function(e,t){return t.fn(e)}),n.registerHelper("log",function(e){n.log(e)});var s=e.Lang;n.Exception=function(e){var t=Error.prototype.constructor.apply(this,arguments),n;for(n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);this.message=t.message},n.Exception.prototype=new Error,n.SafeString=function(e){this.string=e},n.SafeString.prototype.toString=function(){return this.string.toString()},n.Utils={escapeExpression:function(t){return t===""?t:t instanceof n.SafeString?t.toString():t===!1||!s.isValue(t)?"":e.Escape.html(t)},isEmpty:function(e){return e===!1||!s.isValue(e)||s.isArray(e)&&!e.length?!0:!1}},n.VM={template:function(e){var t={escapeExpression:n.Utils.escapeExpression,invokePartial:n.VM.invokePartial,programs:[],program:function(e,t,r){var i=this.programs[e];return r?n.VM.program(t,r):i?i:(i=this.programs[e]=n.VM.program(t),i)},programWithDepth:n.VM.programWithDepth,noop:n.VM.noop};return function(r,i){return i=i||{},e.call(t,n,r,i.helpers,i.partials,i.data)}},programWithDepth:function(e,t,n){var r=Array.prototype.slice.call(arguments,2);return function(n,i){return i=i||{},e.apply(this,[n,i.data||t].concat(r))}},program:function(e,t){return function(n,r){return r=r||{},e(n,r.data||t)}},noop:function(){return""},invokePartial:function(e,t,r,i,s,o){var u={helpers:i,partials:s,data:o};if(e===undefined)throw new n.Exception("The partial "+t+" could not be found");if(e instanceof Function)return e(r,u);if(!n.compile)throw new n.Exception("The partial "+t+" could not be compiled when running in runtime-only mode");return s[t]=n.compile(e),s[t](r,u)}},n.template=n.VM.template,e.Handlebars=n,n.VERSION+="-yui"},"3.7.2",{requires:["escape"]});+;var n={};n.VERSION="1.0.beta.5",n.helpers={},n.partials={},n.registerHelper=function(e,t,n){n&&(t.not=n),this.helpers[e]=t},n.registerPartial=function(e,t){this.partials[e]=t},n.registerHelper("helperMissing",function(e){if(arguments.length===2)return undefined;throw new Error("Could not find property '"+e+"'")});var r=Object.prototype.toString,i="[object Function]";n.registerHelper("blockHelperMissing",function(e,t){var n=t.inverse||function(){},s=t.fn,o="",u=r.call(e);u===i&&(e=e.call(this));if(e===!0)return s(this);if(e===!1||e==null)return n(this);if(u==="[object Array]"){if(e.length>0)for(var a=0,f=e.length;a<f;a++)o+=s(e[a]);else o=n(this);return o}return s(e)}),n.registerHelper("each",function(e,t){var n=t.fn,r=t.inverse,i="";if(e&&e.length>0)for(var s=0,o=e.length;s<o;s++)i+=n(e[s]);else i=r(this);return i}),n.registerHelper("if",function(e,t){var s=r.call(e);return s===i&&(e=e.call(this)),!e||n.Utils.isEmpty(e)?t.inverse(this):t.fn(this)}),n.registerHelper("unless",function(e,t){var r=t.fn,i=t.inverse;return t.fn=i,t.inverse=r,n.helpers["if"].call(this,e,t)}),n.registerHelper("with",function(e,t){return t.fn(e)}),n.registerHelper("log",function(e){n.log(e)});var s=e.Lang;n.Exception=function(e){var t=Error.prototype.constructor.apply(this,arguments),n;for(n in t)t.hasOwnProperty(n)&&(this[n]=t[n]);this.message=t.message},n.Exception.prototype=new Error,n.SafeString=function(e){this.string=e},n.SafeString.prototype.toString=function(){return this.string.toString()},n.Utils={escapeExpression:function(t){return t===""?t:t instanceof n.SafeString?t.toString():t===!1||!s.isValue(t)?"":e.Escape.html(t)},isEmpty:function(e){return e===!1||!s.isValue(e)||s.isArray(e)&&!e.length?!0:!1}},n.VM={template:function(e){var t={escapeExpression:n.Utils.escapeExpression,invokePartial:n.VM.invokePartial,programs:[],program:function(e,t,r){var i=this.programs[e];return r?n.VM.program(t,r):i?i:(i=this.programs[e]=n.VM.program(t),i)},programWithDepth:n.VM.programWithDepth,noop:n.VM.noop};return function(r,i){return i=i||{},e.call(t,n,r,i.helpers,i.partials,i.data)}},programWithDepth:function(e,t,n){var r=Array.prototype.slice.call(arguments,2);return function(n,i){return i=i||{},e.apply(this,[n,i.data||t].concat(r))}},program:function(e,t){return function(n,r){return r=r||{},e(n,r.data||t)}},noop:function(){return""},invokePartial:function(e,t,r,i,s,o){var u={helpers:i,partials:s,data:o};if(e===undefined)throw new n.Exception("The partial "+t+" could not be found");if(e instanceof Function)return e(r,u);if(!n.compile)throw new n.Exception("The partial "+t+" could not be compiled when running in runtime-only mode");return s[t]=n.compile(e),s[t](r,u)}},n.template=n.VM.template,e.Handlebars=n,n.VERSION+="-yui"},"3.7.3",{requires:["escape"]});
bundle/handlebars-base/handlebars-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -358,4 +358,4 @@ */ -}, '3.7.2', {"requires": ["escape"]});+}, '3.7.3', {"requires": ["escape"]});
bundle/handlebars-compiler/handlebars-compiler-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/handlebars-compiler/handlebars-compiler.js", code: [] };-_yuitest_coverage["build/handlebars-compiler/handlebars-compiler.js"].code=["YUI.add('handlebars-compiler', function (Y, NAME) {","","/*!","Handlebars.js - Copyright (C) 2011 Yehuda Katz","https://raw.github.com/wycats/handlebars.js/master/LICENSE","*/","// This file contains code that will be inserted at the beginning of the","// handlebars-compiler module.","","// This is necessary because the Y.Handlebars object is created in the","// handlebars-base module, but the native Handlebars code expects to use a local","// Handlebars reference.","var Handlebars = Y.Handlebars;","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","/* Jison generated parser */","var handlebars = (function(){","var parser = {trace: function trace() { },","yy: {},","symbols_: {\"error\":2,\"root\":3,\"program\":4,\"EOF\":5,\"statements\":6,\"simpleInverse\":7,\"statement\":8,\"openInverse\":9,\"closeBlock\":10,\"openBlock\":11,\"mustache\":12,\"partial\":13,\"CONTENT\":14,\"COMMENT\":15,\"OPEN_BLOCK\":16,\"inMustache\":17,\"CLOSE\":18,\"OPEN_INVERSE\":19,\"OPEN_ENDBLOCK\":20,\"path\":21,\"OPEN\":22,\"OPEN_UNESCAPED\":23,\"OPEN_PARTIAL\":24,\"params\":25,\"hash\":26,\"param\":27,\"STRING\":28,\"INTEGER\":29,\"BOOLEAN\":30,\"hashSegments\":31,\"hashSegment\":32,\"ID\":33,\"EQUALS\":34,\"pathSegments\":35,\"SEP\":36,\"$accept\":0,\"$end\":1},","terminals_: {2:\"error\",5:\"EOF\",14:\"CONTENT\",15:\"COMMENT\",16:\"OPEN_BLOCK\",18:\"CLOSE\",19:\"OPEN_INVERSE\",20:\"OPEN_ENDBLOCK\",22:\"OPEN\",23:\"OPEN_UNESCAPED\",24:\"OPEN_PARTIAL\",28:\"STRING\",29:\"INTEGER\",30:\"BOOLEAN\",33:\"ID\",34:\"EQUALS\",36:\"SEP\"},","productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],","performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {","","var $0 = $$.length - 1;","switch (yystate) {","case 1: return $$[$0-1]; ","break;","case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]); ","break;","case 3: this.$ = new yy.ProgramNode($$[$0]); ","break;","case 4: this.$ = new yy.ProgramNode([]); ","break;","case 5: this.$ = [$$[$0]]; ","break;","case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; ","break;","case 7: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]); ","break;","case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]); ","break;","case 9: this.$ = $$[$0]; ","break;","case 10: this.$ = $$[$0]; ","break;","case 11: this.$ = new yy.ContentNode($$[$0]); ","break;","case 12: this.$ = new yy.CommentNode($$[$0]); ","break;","case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); ","break;","case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); ","break;","case 15: this.$ = $$[$0-1]; ","break;","case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); ","break;","case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true); ","break;","case 18: this.$ = new yy.PartialNode($$[$0-1]); ","break;","case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]); ","break;","case 20: ","break;","case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]; ","break;","case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]; ","break;","case 23: this.$ = [[$$[$0-1]], $$[$0]]; ","break;","case 24: this.$ = [[$$[$0]], null]; ","break;","case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; ","break;","case 26: this.$ = [$$[$0]]; ","break;","case 27: this.$ = $$[$0]; ","break;","case 28: this.$ = new yy.StringNode($$[$0]); ","break;","case 29: this.$ = new yy.IntegerNode($$[$0]); ","break;","case 30: this.$ = new yy.BooleanNode($$[$0]); ","break;","case 31: this.$ = new yy.HashNode($$[$0]); ","break;","case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; ","break;","case 33: this.$ = [$$[$0]]; ","break;","case 34: this.$ = [$$[$0-2], $$[$0]]; ","break;","case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]; ","break;","case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]; ","break;","case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]; ","break;","case 38: this.$ = new yy.IdNode($$[$0]); ","break;","case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2]; ","break;","case 40: this.$ = [$$[$0]]; ","break;","}","},","table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],","defaultActions: {16:[2,1],37:[2,23],53:[2,21]},","parseError: function parseError(str, hash) {"," throw new Error(str);","},","parse: function parse(input) {"," var self = this,"," stack = [0],"," vstack = [null], // semantic value stack"," lstack = [], // location stack"," table = this.table,"," yytext = '',"," yylineno = 0,"," yyleng = 0,"," recovering = 0,"," TERROR = 2,"," EOF = 1;",""," //this.reductionCount = this.shiftCount = 0;",""," this.lexer.setInput(input);"," this.lexer.yy = this.yy;"," this.yy.lexer = this.lexer;"," this.yy.parser = this;"," if (typeof this.lexer.yylloc == 'undefined')"," this.lexer.yylloc = {};"," var yyloc = this.lexer.yylloc;"," lstack.push(yyloc);",""," if (typeof this.yy.parseError === 'function')"," this.parseError = this.yy.parseError;",""," function popStack (n) {"," stack.length = stack.length - 2*n;"," vstack.length = vstack.length - n;"," lstack.length = lstack.length - n;"," }",""," function lex() {"," var token;"," token = self.lexer.lex() || 1; // $end = 1"," // if token isn't its numeric value, convert"," if (typeof token !== 'number') {"," token = self.symbols_[token] || token;"," }"," return token;"," }",""," var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;"," while (true) {"," // retreive state number from top of stack"," state = stack[stack.length-1];",""," // use default actions if available"," if (this.defaultActions[state]) {"," action = this.defaultActions[state];"," } else {"," if (symbol === null || typeof symbol == 'undefined') {"," symbol = lex();"," }"," // read action for current state and first input"," action = table[state] && table[state][symbol];"," }",""," // handle parse error"," _handle_error:"," if (typeof action === 'undefined' || !action.length || !action[0]) {",""," var errStr = '';"," if (!recovering) {"," // Report error"," expected = [];"," for (p in table[state]) if (this.terminals_[p] && p > 2) {"," expected.push(\"'\"+this.terminals_[p]+\"'\");"," }"," if (this.lexer.showPosition) {"," errStr = 'Parse error on line '+(yylineno+1)+\":\\n\"+this.lexer.showPosition()+\"\\nExpecting \"+expected.join(', ') + \", got '\" + (this.terminals_[symbol] || symbol)+ \"'\";"," } else {"," errStr = 'Parse error on line '+(yylineno+1)+\": Unexpected \" +"," (symbol == 1 /*EOF*/ ? \"end of input\" :"," (\"'\"+(this.terminals_[symbol] || symbol)+\"'\"));"," }"," this.parseError(errStr,"," {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});"," }",""," // just recovered from another error"," if (recovering == 3) {"," if (symbol == EOF) {"," throw new Error(errStr || 'Parsing halted.');"," }",""," // discard current lookahead and grab another"," yyleng = this.lexer.yyleng;"," yytext = this.lexer.yytext;"," yylineno = this.lexer.yylineno;"," yyloc = this.lexer.yylloc;"," symbol = lex();"," }",""," // try to recover from error"," while (1) {"," // check for error recovery rule in this state"," if ((TERROR.toString()) in table[state]) {"," break;"," }"," if (state === 0) {"," throw new Error(errStr || 'Parsing halted.');"," }"," popStack(1);"," state = stack[stack.length-1];"," }",""," preErrorSymbol = symbol == 2 ? null : symbol; // save the lookahead token"," symbol = TERROR; // insert generic error symbol as new lookahead"," state = stack[stack.length-1];"," action = table[state] && table[state][TERROR];"," recovering = 3; // allow 3 real symbols to be shifted before reporting a new error"," }",""," // this shouldn't happen, unless resolve defaults are off"," if (action[0] instanceof Array && action.length > 1) {"," throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);"," }",""," switch (action[0]) {",""," case 1: // shift"," //this.shiftCount++;",""," stack.push(symbol);"," vstack.push(this.lexer.yytext);"," lstack.push(this.lexer.yylloc);"," stack.push(action[1]); // push state"," symbol = null;"," if (!preErrorSymbol) { // normal execution/no error"," yyleng = this.lexer.yyleng;"," yytext = this.lexer.yytext;"," yylineno = this.lexer.yylineno;"," yyloc = this.lexer.yylloc;"," if (recovering > 0)"," recovering--;"," } else { // error just occurred, resume old lookahead f/ before error"," symbol = preErrorSymbol;"," preErrorSymbol = null;"," }"," break;",""," case 2: // reduce"," //this.reductionCount++;",""," len = this.productions_[action[1]][1];",""," // perform semantic action"," yyval.$ = vstack[vstack.length-len]; // default to $$ = $1"," // default location, uses first token for firsts, last for lasts"," yyval._$ = {"," first_line: lstack[lstack.length-(len||1)].first_line,"," last_line: lstack[lstack.length-1].last_line,"," first_column: lstack[lstack.length-(len||1)].first_column,"," last_column: lstack[lstack.length-1].last_column"," };"," r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);",""," if (typeof r !== 'undefined') {"," return r;"," }",""," // pop off stack"," if (len) {"," stack = stack.slice(0,-1*len*2);"," vstack = vstack.slice(0, -1*len);"," lstack = lstack.slice(0, -1*len);"," }",""," stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)"," vstack.push(yyval.$);"," lstack.push(yyval._$);"," // goto new state = table[STATE][NONTERMINAL]"," newState = table[stack[stack.length-2]][stack[stack.length-1]];"," stack.push(newState);"," break;",""," case 3: // accept"," return true;"," }",""," }",""," return true;","}};","/* Jison generated lexer */","var lexer = (function(){","var lexer = ({EOF:1,","parseError:function parseError(str, hash) {"," if (this.yy.parser) {"," this.yy.parser.parseError(str, hash);"," } else {"," throw new Error(str);"," }"," },","setInput:function (input) {"," this._input = input;"," this._more = this._less = this.done = false;"," this.yylineno = this.yyleng = 0;"," this.yytext = this.matched = this.match = '';"," this.conditionStack = ['INITIAL'];"," this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};"," return this;"," },","input:function () {"," var ch = this._input[0];"," this.yytext+=ch;"," this.yyleng++;"," this.match+=ch;"," this.matched+=ch;"," var lines = ch.match(/\\n/);"," if (lines) this.yylineno++;"," this._input = this._input.slice(1);"," return ch;"," },","unput:function (ch) {"," this._input = ch + this._input;"," return this;"," },","more:function () {"," this._more = true;"," return this;"," },","less:function (n) {"," this._input = this.match.slice(n) + this._input;"," },","pastInput:function () {"," var past = this.matched.substr(0, this.matched.length - this.match.length);"," return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");"," },","upcomingInput:function () {"," var next = this.match;"," if (next.length < 20) {"," next += this._input.substr(0, 20-next.length);"," }"," return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\\n/g, \"\");"," },","showPosition:function () {"," var pre = this.pastInput();"," var c = new Array(pre.length + 1).join(\"-\");"," return pre + this.upcomingInput() + \"\\n\" + c+\"^\";"," },","next:function () {"," if (this.done) {"," return this.EOF;"," }"," if (!this._input) this.done = true;",""," var token,"," match,"," tempMatch,"," index,"," col,"," lines;"," if (!this._more) {"," this.yytext = '';"," this.match = '';"," }"," var rules = this._currentRules();"," for (var i=0;i < rules.length; i++) {"," tempMatch = this._input.match(this.rules[rules[i]]);"," if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {"," match = tempMatch;"," index = i;"," if (!this.options.flex) break;"," }"," }"," if (match) {"," lines = match[0].match(/\\n.*/g);"," if (lines) this.yylineno += lines.length;"," this.yylloc = {first_line: this.yylloc.last_line,"," last_line: this.yylineno+1,"," first_column: this.yylloc.last_column,"," last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length};"," this.yytext += match[0];"," this.match += match[0];"," this.yyleng = this.yytext.length;"," this._more = false;"," this._input = this._input.slice(match[0].length);"," this.matched += match[0];"," token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);"," if (this.done && this._input) this.done = false;"," if (token) return token;"," else return;"," }"," if (this._input === \"\") {"," return this.EOF;"," } else {"," return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\\n'+this.showPosition(),"," {text: \"\", token: null, line: this.yylineno});"," }"," },","lex:function lex() {"," var r = this.next();"," if (typeof r !== 'undefined') {"," return r;"," } else {"," return this.lex();"," }"," },","begin:function begin(condition) {"," this.conditionStack.push(condition);"," },","popState:function popState() {"," return this.conditionStack.pop();"," },","_currentRules:function _currentRules() {"," return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;"," },","topState:function () {"," return this.conditionStack[this.conditionStack.length-2];"," },","pushState:function begin(condition) {"," this.begin(condition);"," }});","lexer.options = {};","lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {","","var YYSTATE=YY_START","switch($avoiding_name_collisions) {","case 0:"," if(yy_.yytext.slice(-1) !== \"\\\\\") this.begin(\"mu\");"," if(yy_.yytext.slice(-1) === \"\\\\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin(\"emu\");"," if(yy_.yytext) return 14;"," ","break;","case 1: return 14; ","break;","case 2: this.popState(); return 14; ","break;","case 3: return 24; ","break;","case 4: return 16; ","break;","case 5: return 20; ","break;","case 6: return 19; ","break;","case 7: return 19; ","break;","case 8: return 23; ","break;","case 9: return 23; ","break;","case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; ","break;","case 11: return 22; ","break;","case 12: return 34; ","break;","case 13: return 33; ","break;","case 14: return 33; ","break;","case 15: return 36; ","break;","case 16: /*ignore whitespace*/ ","break;","case 17: this.popState(); return 18; ","break;","case 18: this.popState(); return 18; ","break;","case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\\\\"/g,'\"'); return 28; ","break;","case 20: return 30; ","break;","case 21: return 30; ","break;","case 22: return 29; ","break;","case 23: return 33; ","break;","case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33; ","break;","case 25: return 'INVALID'; ","break;","case 26: return 5; ","break;","}","};","lexer.rules = [/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{)))/,/^(?:\\{\\{>)/,/^(?:\\{\\{#)/,/^(?:\\{\\{\\/)/,/^(?:\\{\\{\\^)/,/^(?:\\{\\{\\s*else\\b)/,/^(?:\\{\\{\\{)/,/^(?:\\{\\{&)/,/^(?:\\{\\{![\\s\\S]*?\\}\\})/,/^(?:\\{\\{)/,/^(?:=)/,/^(?:\\.(?=[} ]))/,/^(?:\\.\\.)/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}\\}\\})/,/^(?:\\}\\})/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:true(?=[}\\s]))/,/^(?:false(?=[}\\s]))/,/^(?:[0-9]+(?=[}\\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\\s\\/.]))/,/^(?:\\[[^\\]]*\\])/,/^(?:.)/,/^(?:$)/];","lexer.conditions = {\"mu\":{\"rules\":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],\"inclusive\":false},\"emu\":{\"rules\":[2],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,26],\"inclusive\":true}};","return lexer;})()","parser.lexer = lexer;function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;","return new Parser;","})();","if (typeof require !== 'undefined' && typeof exports !== 'undefined') {","exports.parser = handlebars;","exports.Parser = handlebars.Parser;","exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }","exports.main = function commonjsMain(args) {"," if (!args[1])"," throw new Error('Usage: '+args[0]+' FILE');"," var source, cwd;"," if (typeof process !== 'undefined') {"," source = require('fs').readFileSync(require('path').resolve(args[1]), \"utf8\");"," } else {"," source = require(\"file\").path(require(\"file\").cwd()).join(args[1]).read({charset: \"utf-8\"});"," }"," return exports.parser.parse(source);","}","if (typeof module !== 'undefined' && require.main === module) {"," exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require(\"system\").args);","}","};","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","Handlebars.Parser = handlebars;","","Handlebars.parse = function(string) {"," Handlebars.Parser.yy = Handlebars.AST;"," return Handlebars.Parser.parse(string);","};","","Handlebars.print = function(ast) {"," return new Handlebars.PrintVisitor().accept(ast);","};","","Handlebars.logger = {"," DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,",""," // override in the host environment"," log: function(level, str) {}","};","","Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };","","// END(BROWSER)","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","(function() {",""," Handlebars.AST = {};",""," Handlebars.AST.ProgramNode = function(statements, inverse) {"," this.type = \"program\";"," this.statements = statements;"," if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }"," };",""," Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {"," this.type = \"mustache\";"," this.escaped = !unescaped;"," this.hash = hash;",""," var id = this.id = rawParams[0];"," var params = this.params = rawParams.slice(1);",""," // a mustache is an eligible helper if:"," // * its id is simple (a single part, not `this` or `..`)"," var eligibleHelper = this.eligibleHelper = id.isSimple;",""," // a mustache is definitely a helper if:"," // * it is an eligible helper, and"," // * it has at least one parameter or hash segment"," this.isHelper = eligibleHelper && (params.length || hash);",""," // if a mustache is an eligible helper but not a definite"," // helper, it is ambiguous, and will be resolved in a later"," // pass or at runtime."," };",""," Handlebars.AST.PartialNode = function(id, context) {"," this.type = \"partial\";",""," // TODO: disallow complex IDs",""," this.id = id;"," this.context = context;"," };",""," var verifyMatch = function(open, close) {"," if(open.original !== close.original) {"," throw new Handlebars.Exception(open.original + \" doesn't match \" + close.original);"," }"," };",""," Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {"," verifyMatch(mustache.id, close);"," this.type = \"block\";"," this.mustache = mustache;"," this.program = program;"," this.inverse = inverse;",""," if (this.inverse && !this.program) {"," this.isInverse = true;"," }"," };",""," Handlebars.AST.ContentNode = function(string) {"," this.type = \"content\";"," this.string = string;"," };",""," Handlebars.AST.HashNode = function(pairs) {"," this.type = \"hash\";"," this.pairs = pairs;"," };",""," Handlebars.AST.IdNode = function(parts) {"," this.type = \"ID\";"," this.original = parts.join(\".\");",""," var dig = [], depth = 0;",""," for(var i=0,l=parts.length; i<l; i++) {"," var part = parts[i];",""," if(part === \"..\") { depth++; }"," else if(part === \".\" || part === \"this\") { this.isScoped = true; }"," else { dig.push(part); }"," }",""," this.parts = dig;"," this.string = dig.join('.');"," this.depth = depth;",""," // an ID is simple if it only has one part, and that part is not"," // `..` or `this`."," this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;"," };",""," Handlebars.AST.StringNode = function(string) {"," this.type = \"STRING\";"," this.string = string;"," };",""," Handlebars.AST.IntegerNode = function(integer) {"," this.type = \"INTEGER\";"," this.integer = integer;"," };",""," Handlebars.AST.BooleanNode = function(bool) {"," this.type = \"BOOLEAN\";"," this.bool = bool;"," };",""," Handlebars.AST.CommentNode = function(comment) {"," this.type = \"comment\";"," this.comment = comment;"," };","","})();","// END(BROWSER)","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","","/*jshint eqnull:true*/","Handlebars.Compiler = function() {};","Handlebars.JavaScriptCompiler = function() {};","","(function(Compiler, JavaScriptCompiler) {"," // the foundHelper register will disambiguate helper lookup from finding a"," // function in a context. This is necessary for mustache compatibility, which"," // requires that context functions in blocks are evaluated by blockHelperMissing,"," // and then proceed as if the resulting value was provided to blockHelperMissing.",""," Compiler.prototype = {"," compiler: Compiler,",""," disassemble: function() {"," var opcodes = this.opcodes, opcode, out = [], params, param;",""," for (var i=0, l=opcodes.length; i<l; i++) {"," opcode = opcodes[i];",""," if (opcode.opcode === 'DECLARE') {"," out.push(\"DECLARE \" + opcode.name + \"=\" + opcode.value);"," } else {"," params = [];"," for (var j=0; j<opcode.args.length; j++) {"," param = opcode.args[j];"," if (typeof param === \"string\") {"," param = \"\\\"\" + param.replace(\"\\n\", \"\\\\n\") + \"\\\"\";"," }"," params.push(param);"," }"," out.push(opcode.opcode + \" \" + params.join(\" \"));"," }"," }",""," return out.join(\"\\n\");"," },",""," guid: 0,",""," compile: function(program, options) {"," this.children = [];"," this.depths = {list: []};"," this.options = options;",""," // These changes will propagate to the other compiler components"," var knownHelpers = this.options.knownHelpers;"," this.options.knownHelpers = {"," 'helperMissing': true,"," 'blockHelperMissing': true,"," 'each': true,"," 'if': true,"," 'unless': true,"," 'with': true,"," 'log': true"," };"," if (knownHelpers) {"," for (var name in knownHelpers) {"," this.options.knownHelpers[name] = knownHelpers[name];"," }"," }",""," return this.program(program);"," },",""," accept: function(node) {"," return this[node.type](node);"," },",""," program: function(program) {"," var statements = program.statements, statement;"," this.opcodes = [];",""," for(var i=0, l=statements.length; i<l; i++) {"," statement = statements[i];"," this[statement.type](statement);"," }"," this.isSimple = l === 1;",""," this.depths.list = this.depths.list.sort(function(a, b) {"," return a - b;"," });",""," return this;"," },",""," compileProgram: function(program) {"," var result = new this.compiler().compile(program, this.options);"," var guid = this.guid++, depth;",""," this.usePartial = this.usePartial || result.usePartial;",""," this.children[guid] = result;",""," for(var i=0, l=result.depths.list.length; i<l; i++) {"," depth = result.depths.list[i];",""," if(depth < 2) { continue; }"," else { this.addDepth(depth - 1); }"," }",""," return guid;"," },",""," block: function(block) {"," var mustache = block.mustache,"," program = block.program,"," inverse = block.inverse;",""," if (program) {"," program = this.compileProgram(program);"," }",""," if (inverse) {"," inverse = this.compileProgram(inverse);"," }",""," var type = this.classifyMustache(mustache);",""," if (type === \"helper\") {"," this.helperMustache(mustache, program, inverse);"," } else if (type === \"simple\") {"," this.simpleMustache(mustache);",""," // now that the simple mustache is resolved, we need to"," // evaluate it by executing `blockHelperMissing`"," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);"," this.opcode('pushLiteral', '{}');"," this.opcode('blockValue');"," } else {"," this.ambiguousMustache(mustache, program, inverse);",""," // now that the simple mustache is resolved, we need to"," // evaluate it by executing `blockHelperMissing`"," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);"," this.opcode('pushLiteral', '{}');"," this.opcode('ambiguousBlockValue');"," }",""," this.opcode('append');"," },",""," hash: function(hash) {"," var pairs = hash.pairs, pair, val;",""," this.opcode('push', '{}');",""," for(var i=0, l=pairs.length; i<l; i++) {"," pair = pairs[i];"," val = pair[1];",""," this.accept(val);"," this.opcode('assignToHash', pair[0]);"," }"," },",""," partial: function(partial) {"," var id = partial.id;"," this.usePartial = true;",""," if(partial.context) {"," this.ID(partial.context);"," } else {"," this.opcode('push', 'depth0');"," }",""," this.opcode('invokePartial', id.original);"," this.opcode('append');"," },",""," content: function(content) {"," this.opcode('appendContent', content.string);"," },",""," mustache: function(mustache) {"," var options = this.options;"," var type = this.classifyMustache(mustache);",""," if (type === \"simple\") {"," this.simpleMustache(mustache);"," } else if (type === \"helper\") {"," this.helperMustache(mustache);"," } else {"," this.ambiguousMustache(mustache);"," }",""," if(mustache.escaped && !options.noEscape) {"," this.opcode('appendEscaped');"," } else {"," this.opcode('append');"," }"," },",""," ambiguousMustache: function(mustache, program, inverse) {"," var id = mustache.id, name = id.parts[0];",""," this.opcode('getContext', id.depth);",""," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);",""," this.opcode('invokeAmbiguous', name);"," },",""," simpleMustache: function(mustache, program, inverse) {"," var id = mustache.id;",""," this.addDepth(id.depth);"," this.opcode('getContext', id.depth);",""," if (id.parts.length) {"," this.opcode('lookupOnContext', id.parts[0]);"," for(var i=1, l=id.parts.length; i<l; i++) {"," this.opcode('lookup', id.parts[i]);"," }"," } else {"," this.opcode('pushContext');"," }"," this.opcode('resolvePossibleLambda');"," },",""," helperMustache: function(mustache, program, inverse) {"," var params = this.setupFullMustacheParams(mustache, program, inverse),"," name = mustache.id.parts[0];",""," if (this.options.knownHelpers[name]) {"," this.opcode('invokeKnownHelper', params.length, name);"," } else if (this.knownHelpersOnly) {"," throw new Error(\"You specified knownHelpersOnly, but used the unknown helper \" + name);"," } else {"," this.opcode('invokeHelper', params.length, name);"," }"," },",""," ID: function(id) {"," this.addDepth(id.depth);"," this.opcode('getContext', id.depth);"," this.opcode('lookupOnContext', id.parts[0]);",""," for(var i=1, l=id.parts.length; i<l; i++) {"," this.opcode('lookup', id.parts[i]);"," }"," },",""," STRING: function(string) {"," this.opcode('pushString', string.string);"," },",""," INTEGER: function(integer) {"," this.opcode('pushLiteral', integer.integer);"," },",""," BOOLEAN: function(bool) {"," this.opcode('pushLiteral', bool.bool);"," },",""," comment: function() {},",""," // HELPERS"," opcode: function(name) {"," this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });"," },",""," declare: function(name, value) {"," this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });"," },",""," addDepth: function(depth) {"," if(depth === 0) { return; }",""," if(!this.depths[depth]) {"," this.depths[depth] = true;"," this.depths.list.push(depth);"," }"," },",""," classifyMustache: function(mustache) {"," var isHelper = mustache.isHelper;"," var isEligible = mustache.eligibleHelper;"," var options = this.options;",""," // if ambiguous, we can possibly resolve the ambiguity now"," if (isEligible && !isHelper) {"," var name = mustache.id.parts[0];",""," if (options.knownHelpers[name]) {"," isHelper = true;"," } else if (options.knownHelpersOnly) {"," isEligible = false;"," }"," }",""," if (isHelper) { return \"helper\"; }"," else if (isEligible) { return \"ambiguous\"; }"," else { return \"simple\"; }"," },",""," pushParams: function(params) {"," var i = params.length, param;",""," while(i--) {"," param = params[i];",""," if(this.options.stringParams) {"," if(param.depth) {"," this.addDepth(param.depth);"," }",""," this.opcode('getContext', param.depth || 0);"," this.opcode('pushStringParam', param.string);"," } else {"," this[param.type](param);"," }"," }"," },",""," setupMustacheParams: function(mustache) {"," var params = mustache.params;"," this.pushParams(params);",""," if(mustache.hash) {"," this.hash(mustache.hash);"," } else {"," this.opcode('pushLiteral', '{}');"," }",""," return params;"," },",""," // this will replace setupMustacheParams when we're done"," setupFullMustacheParams: function(mustache, program, inverse) {"," var params = mustache.params;"," this.pushParams(params);",""," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);",""," if(mustache.hash) {"," this.hash(mustache.hash);"," } else {"," this.opcode('pushLiteral', '{}');"," }",""," return params;"," }"," };",""," var Literal = function(value) {"," this.value = value;"," };",""," JavaScriptCompiler.prototype = {"," // PUBLIC API: You can override these methods in a subclass to provide"," // alternative compiled forms for name lookup and buffering semantics"," nameLookup: function(parent, name, type) {"," if (/^[0-9]+$/.test(name)) {"," return parent + \"[\" + name + \"]\";"," } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {"," return parent + \".\" + name;"," }"," else {"," return parent + \"['\" + name + \"']\";"," }"," },",""," appendToBuffer: function(string) {"," if (this.environment.isSimple) {"," return \"return \" + string + \";\";"," } else {"," return \"buffer += \" + string + \";\";"," }"," },",""," initializeBuffer: function() {"," return this.quotedString(\"\");"," },",""," namespace: \"Handlebars\","," // END PUBLIC API",""," compile: function(environment, options, context, asObject) {"," this.environment = environment;"," this.options = options || {};",""," Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + \"\\n\\n\");",""," this.name = this.environment.name;"," this.isChild = !!context;"," this.context = context || {"," programs: [],"," aliases: { }"," };",""," this.preamble();",""," this.stackSlot = 0;"," this.stackVars = [];"," this.registers = { list: [] };"," this.compileStack = [];",""," this.compileChildren(environment, options);",""," var opcodes = environment.opcodes, opcode;",""," this.i = 0;",""," for(l=opcodes.length; this.i<l; this.i++) {"," opcode = opcodes[this.i];",""," if(opcode.opcode === 'DECLARE') {"," this[opcode.name] = opcode.value;"," } else {"," this[opcode.opcode].apply(this, opcode.args);"," }"," }",""," return this.createFunctionContext(asObject);"," },",""," nextOpcode: function() {"," var opcodes = this.environment.opcodes, opcode = opcodes[this.i + 1];"," return opcodes[this.i + 1];"," },",""," eat: function(opcode) {"," this.i = this.i + 1;"," },",""," preamble: function() {"," var out = [];",""," if (!this.isChild) {"," var namespace = this.namespace;"," var copies = \"helpers = helpers || \" + namespace + \".helpers;\";"," if(this.environment.usePartial) { copies = copies + \" partials = partials || \" + namespace + \".partials;\"; }"," out.push(copies);"," } else {"," out.push('');"," }",""," if (!this.environment.isSimple) {"," out.push(\", buffer = \" + this.initializeBuffer());"," } else {"," out.push(\"\");"," }",""," // track the last context pushed into place to allow skipping the"," // getContext opcode when it would be a noop"," this.lastContext = 0;"," this.source = out;"," },",""," createFunctionContext: function(asObject) {"," var locals = this.stackVars.concat(this.registers.list);",""," if(locals.length > 0) {"," this.source[1] = this.source[1] + \", \" + locals.join(\", \");"," }",""," // Generate minimizer alias mappings"," if (!this.isChild) {"," var aliases = [];"," for (var alias in this.context.aliases) {"," this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];"," }"," }",""," if (this.source[1]) {"," this.source[1] = \"var \" + this.source[1].substring(2) + \";\";"," }",""," // Merge children"," if (!this.isChild) {"," this.source[1] += '\\n' + this.context.programs.join('\\n') + '\\n';"," }",""," if (!this.environment.isSimple) {"," this.source.push(\"return buffer;\");"," }",""," var params = this.isChild ? [\"depth0\", \"data\"] : [\"Handlebars\", \"depth0\", \"helpers\", \"partials\", \"data\"];",""," for(var i=0, l=this.environment.depths.list.length; i<l; i++) {"," params.push(\"depth\" + this.environment.depths.list[i]);"," }",""," if (asObject) {"," params.push(this.source.join(\"\\n \"));",""," return Function.apply(this, params);"," } else {"," var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\\n ' + this.source.join(\"\\n \") + '}';"," Handlebars.log(Handlebars.logger.DEBUG, functionSource + \"\\n\\n\");"," return functionSource;"," }"," },",""," // [blockValue]"," //"," // On stack, before: hash, inverse, program, value"," // On stack, after: return value of blockHelperMissing"," //"," // The purpose of this opcode is to take a block of the form"," // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and"," // replace it on the stack with the result of properly"," // invoking blockHelperMissing."," blockValue: function() {"," this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';",""," var params = [\"depth0\"];"," this.setupParams(0, params);",""," this.replaceStack(function(current) {"," params.splice(1, 0, current);"," return current + \" = blockHelperMissing.call(\" + params.join(\", \") + \")\";"," });"," },",""," // [ambiguousBlockValue]"," //"," // On stack, before: hash, inverse, program, value"," // Compiler value, before: lastHelper=value of last found helper, if any"," // On stack, after, if no lastHelper: same as [blockValue]"," // On stack, after, if lastHelper: value"," ambiguousBlockValue: function() {"," this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';",""," var params = [\"depth0\"];"," this.setupParams(0, params);",""," var current = this.topStack();"," params.splice(1, 0, current);",""," this.source.push(\"if (!\" + this.lastHelper + \") { \" + current + \" = blockHelperMissing.call(\" + params.join(\", \") + \"); }\");"," },",""," // [appendContent]"," //"," // On stack, before: ..."," // On stack, after: ..."," //"," // Appends the string value of `content` to the current buffer"," appendContent: function(content) {"," this.source.push(this.appendToBuffer(this.quotedString(content)));"," },",""," // [append]"," //"," // On stack, before: value, ..."," // On stack, after: ..."," //"," // Coerces `value` to a String and appends it to the current buffer."," //"," // If `value` is truthy, or 0, it is coerced into a string and appended"," // Otherwise, the empty string is appended"," append: function() {"," var local = this.popStack();"," this.source.push(\"if(\" + local + \" || \" + local + \" === 0) { \" + this.appendToBuffer(local) + \" }\");"," if (this.environment.isSimple) {"," this.source.push(\"else { \" + this.appendToBuffer(\"''\") + \" }\");"," }"," },",""," // [appendEscaped]"," //"," // On stack, before: value, ..."," // On stack, after: ..."," //"," // Escape `value` and append it to the buffer"," appendEscaped: function() {"," var opcode = this.nextOpcode(), extra = \"\";"," this.context.aliases.escapeExpression = 'this.escapeExpression';",""," if(opcode && opcode.opcode === 'appendContent') {"," extra = \" + \" + this.quotedString(opcode.args[0]);"," this.eat(opcode);"," }",""," this.source.push(this.appendToBuffer(\"escapeExpression(\" + this.popStack() + \")\" + extra));"," },",""," // [getContext]"," //"," // On stack, before: ..."," // On stack, after: ..."," // Compiler value, after: lastContext=depth"," //"," // Set the value of the `lastContext` compiler value to the depth"," getContext: function(depth) {"," if(this.lastContext !== depth) {"," this.lastContext = depth;"," }"," },",""," // [lookupOnContext]"," //"," // On stack, before: ..."," // On stack, after: currentContext[name], ..."," //"," // Looks up the value of `name` on the current context and pushes"," // it onto the stack."," lookupOnContext: function(name) {"," this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));"," },",""," // [pushContext]"," //"," // On stack, before: ..."," // On stack, after: currentContext, ..."," //"," // Pushes the value of the current context onto the stack."," pushContext: function() {"," this.pushStackLiteral('depth' + this.lastContext);"," },",""," // [resolvePossibleLambda]"," //"," // On stack, before: value, ..."," // On stack, after: resolved value, ..."," //"," // If the `value` is a lambda, replace it on the stack by"," // the return value of the lambda"," resolvePossibleLambda: function() {"," this.context.aliases.functionType = '\"function\"';",""," this.replaceStack(function(current) {"," return \"typeof \" + current + \" === functionType ? \" + current + \"() : \" + current;"," });"," },",""," // [lookup]"," //"," // On stack, before: value, ..."," // On stack, after: value[name], ..."," //"," // Replace the value on the stack with the result of looking"," // up `name` on `value`"," lookup: function(name) {"," this.replaceStack(function(current) {"," return current + \" == null || \" + current + \" === false ? \" + current + \" : \" + this.nameLookup(current, name, 'context');"," });"," },",""," // [pushStringParam]"," //"," // On stack, before: ..."," // On stack, after: string, currentContext, ..."," //"," // This opcode is designed for use in string mode, which"," // provides the string value of a parameter along with its"," // depth rather than resolving it immediately."," pushStringParam: function(string) {"," this.pushStackLiteral('depth' + this.lastContext);"," this.pushString(string);"," },",""," // [pushString]"," //"," // On stack, before: ..."," // On stack, after: quotedString(string), ..."," //"," // Push a quoted version of `string` onto the stack"," pushString: function(string) {"," this.pushStackLiteral(this.quotedString(string));"," },",""," // [push]"," //"," // On stack, before: ..."," // On stack, after: expr, ..."," //"," // Push an expression onto the stack"," push: function(expr) {"," this.pushStack(expr);"," },",""," // [pushLiteral]"," //"," // On stack, before: ..."," // On stack, after: value, ..."," //"," // Pushes a value onto the stack. This operation prevents"," // the compiler from creating a temporary variable to hold"," // it."," pushLiteral: function(value) {"," this.pushStackLiteral(value);"," },",""," // [pushProgram]"," //"," // On stack, before: ..."," // On stack, after: program(guid), ..."," //"," // Push a program expression onto the stack. This takes"," // a compile-time guid and converts it into a runtime-accessible"," // expression."," pushProgram: function(guid) {"," if (guid != null) {"," this.pushStackLiteral(this.programExpression(guid));"," } else {"," this.pushStackLiteral(null);"," }"," },",""," // [invokeHelper]"," //"," // On stack, before: hash, inverse, program, params..., ..."," // On stack, after: result of helper invocation"," //"," // Pops off the helper's parameters, invokes the helper,"," // and pushes the helper's return value onto the stack."," //"," // If the helper is not found, `helperMissing` is called."," invokeHelper: function(paramSize, name) {"," this.context.aliases.helperMissing = 'helpers.helperMissing';",""," var helper = this.lastHelper = this.setupHelper(paramSize, name);"," this.register('foundHelper', helper.name);",""," this.pushStack(\"foundHelper ? foundHelper.call(\" +"," helper.callParams + \") \" + \": helperMissing.call(\" +"," helper.helperMissingParams + \")\");"," },",""," // [invokeKnownHelper]"," //"," // On stack, before: hash, inverse, program, params..., ..."," // On stack, after: result of helper invocation"," //"," // This operation is used when the helper is known to exist,"," // so a `helperMissing` fallback is not required."," invokeKnownHelper: function(paramSize, name) {"," var helper = this.setupHelper(paramSize, name);"," this.pushStack(helper.name + \".call(\" + helper.callParams + \")\");"," },",""," // [invokeAmbiguous]"," //"," // On stack, before: hash, inverse, program, params..., ..."," // On stack, after: result of disambiguation"," //"," // This operation is used when an expression like `{{foo}}`"," // is provided, but we don't know at compile-time whether it"," // is a helper or a path."," //"," // This operation emits more code than the other options,"," // and can be avoided by passing the `knownHelpers` and"," // `knownHelpersOnly` flags at compile-time."," invokeAmbiguous: function(name) {"," this.context.aliases.functionType = '\"function\"';",""," this.pushStackLiteral('{}');"," var helper = this.setupHelper(0, name);",""," var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');"," this.register('foundHelper', helperName);",""," var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');"," var nextStack = this.nextStack();",""," this.source.push('if (foundHelper) { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');"," this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '() : ' + nextStack + '; }');"," },",""," // [invokePartial]"," //"," // On stack, before: context, ..."," // On stack after: result of partial invocation"," //"," // This operation pops off a context, invokes a partial with that context,"," // and pushes the result of the invocation back."," invokePartial: function(name) {"," var params = [this.nameLookup('partials', name, 'partial'), \"'\" + name + \"'\", this.popStack(), \"helpers\", \"partials\"];",""," if (this.options.data) {"," params.push(\"data\");"," }",""," this.context.aliases.self = \"this\";"," this.pushStack(\"self.invokePartial(\" + params.join(\", \") + \");\");"," },",""," // [assignToHash]"," //"," // On stack, before: value, hash, ..."," // On stack, after: hash, ..."," //"," // Pops a value and hash off the stack, assigns `hash[key] = value`"," // and pushes the hash back onto the stack."," assignToHash: function(key) {"," var value = this.popStack();"," var hash = this.topStack();",""," this.source.push(hash + \"['\" + key + \"'] = \" + value + \";\");"," },",""," // HELPERS",""," compiler: JavaScriptCompiler,",""," compileChildren: function(environment, options) {"," var children = environment.children, child, compiler;",""," for(var i=0, l=children.length; i<l; i++) {"," child = children[i];"," compiler = new this.compiler();",""," this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children"," var index = this.context.programs.length;"," child.index = index;"," child.name = 'program' + index;"," this.context.programs[index] = compiler.compile(child, options, this.context);"," }"," },",""," programExpression: function(guid) {"," this.context.aliases.self = \"this\";",""," if(guid == null) {"," return \"self.noop\";"," }",""," var child = this.environment.children[guid],"," depths = child.depths.list, depth;",""," var programParams = [child.index, child.name, \"data\"];",""," for(var i=0, l = depths.length; i<l; i++) {"," depth = depths[i];",""," if(depth === 1) { programParams.push(\"depth0\"); }"," else { programParams.push(\"depth\" + (depth - 1)); }"," }",""," if(depths.length === 0) {"," return \"self.program(\" + programParams.join(\", \") + \")\";"," } else {"," programParams.shift();"," return \"self.programWithDepth(\" + programParams.join(\", \") + \")\";"," }"," },",""," register: function(name, val) {"," this.useRegister(name);"," this.source.push(name + \" = \" + val + \";\");"," },",""," useRegister: function(name) {"," if(!this.registers[name]) {"," this.registers[name] = true;"," this.registers.list.push(name);"," }"," },",""," pushStackLiteral: function(item) {"," this.compileStack.push(new Literal(item));"," return item;"," },",""," pushStack: function(item) {"," this.source.push(this.incrStack() + \" = \" + item + \";\");"," this.compileStack.push(\"stack\" + this.stackSlot);"," return \"stack\" + this.stackSlot;"," },",""," replaceStack: function(callback) {"," var item = callback.call(this, this.topStack());",""," this.source.push(this.topStack() + \" = \" + item + \";\");"," return \"stack\" + this.stackSlot;"," },",""," nextStack: function(skipCompileStack) {"," var name = this.incrStack();"," this.compileStack.push(\"stack\" + this.stackSlot);"," return name;"," },",""," incrStack: function() {"," this.stackSlot++;"," if(this.stackSlot > this.stackVars.length) { this.stackVars.push(\"stack\" + this.stackSlot); }"," return \"stack\" + this.stackSlot;"," },",""," popStack: function() {"," var item = this.compileStack.pop();",""," if (item instanceof Literal) {"," return item.value;"," } else {"," this.stackSlot--;"," return item;"," }"," },",""," topStack: function() {"," var item = this.compileStack[this.compileStack.length - 1];",""," if (item instanceof Literal) {"," return item.value;"," } else {"," return item;"," }"," },",""," quotedString: function(str) {"," return '\"' + str"," .replace(/\\\\/g, '\\\\\\\\')"," .replace(/\"/g, '\\\\\"')"," .replace(/\\n/g, '\\\\n')"," .replace(/\\r/g, '\\\\r') + '\"';"," },",""," setupHelper: function(paramSize, name) {"," var params = [];"," this.setupParams(paramSize, params);"," var foundHelper = this.nameLookup('helpers', name, 'helper');",""," return {"," params: params,"," name: foundHelper,"," callParams: [\"depth0\"].concat(params).join(\", \"),"," helperMissingParams: [\"depth0\", this.quotedString(name)].concat(params).join(\", \")"," };"," },",""," // the params and contexts arguments are passed in arrays"," // to fill in"," setupParams: function(paramSize, params) {"," var options = [], contexts = [], param, inverse, program;",""," options.push(\"hash:\" + this.popStack());",""," inverse = this.popStack();"," program = this.popStack();",""," // Avoid setting fn and inverse if neither are set. This allows"," // helpers to do a check for `if (options.fn)`"," if (program || inverse) {"," if (!program) {"," this.context.aliases.self = \"this\";"," program = \"self.noop\";"," }",""," if (!inverse) {"," this.context.aliases.self = \"this\";"," inverse = \"self.noop\";"," }",""," options.push(\"inverse:\" + inverse);"," options.push(\"fn:\" + program);"," }",""," for(var i=0; i<paramSize; i++) {"," param = this.popStack();"," params.push(param);",""," if(this.options.stringParams) {"," contexts.push(this.popStack());"," }"," }",""," if (this.options.stringParams) {"," options.push(\"contexts:[\" + contexts.join(\",\") + \"]\");"," }",""," if(this.options.data) {"," options.push(\"data:data\");"," }",""," params.push(\"{\" + options.join(\",\") + \"}\");"," return params.join(\", \");"," }"," };",""," var reservedWords = ("," \"break else new var\" +"," \" case finally return void\" +"," \" catch for switch while\" +"," \" continue function this with\" +"," \" default if throw\" +"," \" delete in try\" +"," \" do instanceof typeof\" +"," \" abstract enum int short\" +"," \" boolean export interface static\" +"," \" byte extends long super\" +"," \" char final native synchronized\" +"," \" class float package throws\" +"," \" const goto private transient\" +"," \" debugger implements protected volatile\" +"," \" double import public let yield\""," ).split(\" \");",""," var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};",""," for(var i=0, l=reservedWords.length; i<l; i++) {"," compilerWords[reservedWords[i]] = true;"," }",""," JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {"," if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {"," return true;"," }"," return false;"," };","","})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);","","Handlebars.precompile = function(string, options) {"," options = options || {};",""," var ast = Handlebars.parse(string);"," var environment = new Handlebars.Compiler().compile(ast, options);"," return new Handlebars.JavaScriptCompiler().compile(environment, options);","};","","Handlebars.compile = function(string, options) {"," options = options || {};",""," var compiled;"," function compile() {"," var ast = Handlebars.parse(string);"," var environment = new Handlebars.Compiler().compile(ast, options);"," var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);"," return Handlebars.template(templateSpec);"," }",""," // Template is only compiled on first use and cached after that point."," return function(context, options) {"," if (!compiled) {"," compiled = compile();"," }"," return compiled.call(this, context, options);"," };","};","","// END(BROWSER)","// This file contains YUI-specific wrapper code and overrides for the","// handlebars-compiler module.","","/**","Handlebars parser and compiler. Use this module when you need to compile","Handlebars templates.","","@module handlebars","@submodule handlebars-compiler","*/","","var levels = ['debug', 'info', 'warn', 'error'];","","/**","Logs a debugging message. Note that messages will only be logged when the","handlebars module is loaded in \"debug\" mode.","","@method log","@param {String} level Log level for this message. Supported levels are \"debug\","," \"info\", \"warn\", and \"error\".","@param {String} message Message to log.","@for Handlebars","*/","Handlebars.logger.log = function (level, message) {","","};","","/**","Compiles and renders a Handlebars template string in a single step.","","If you'll be using a template more than once, it's more efficient to compile it","into a function once using `compile()`, and then render it whenever you need to","by simply executing the compiled function. However, if you only need to compile","and render a template once, `render()` is a handy shortcut for doing both in a","single step.","","@example",""," Y.Handlebars.render('The pie of the day is {{pie}}!', {"," pie: 'Maple Custard'"," });"," // => \"The pie of the day is Maple Custard!\"","","@method render","@param {String} string Handlebars template string to render.","@param {Object} context Context object to pass to the template.","@param {Object} [options] Compile/render options."," @param {Object} [options.helpers] Helper functions."," @param {Object} [options.partials] Partials."," @param {Object} [options.data] Data.","@return {String} Rendered template string.","*/","Handlebars.render = function (string, context, options) {"," return Handlebars.compile(string)(context, options);","};","","// The rest of this file is just API docs for methods defined in Handlebars","// itself.","","/**","Compiles a Handlebars template string into a function. To render the template,","call the function and pass in a context object.","","@example",""," var template = Y.Handlebars.compile('The pie of the day is {{pie}}!.');"," template({pie: 'Pecan'});"," // => \"The pie of the day is Pecan!\"","","@method compile","@param {String} string Handlebars template string to compile.","@param {Object} [options] Compiler options.","@return {Function} Compiled template function.","*/","","/**","Precompiles a Handlebars template string into a string of JavaScript code. This","can be used to precompile a template at build time or on the server, and the","resulting template can then be rendered at runtime or on the client without","needing to go through a compile step.","","To render a precompiled template, evaluate the code and then pass the resulting","function to `Y.Handlebars.template()` to get back an executable template","function.","","@method precompile","@param {String} string Handlebars template string to compile.","@param {Object} [options] Compiler options.","@return {String} Precompiled template code.","*/","","","}, '3.7.2', {\"requires\": [\"handlebars-base\"]});"];+_yuitest_coverage["build/handlebars-compiler/handlebars-compiler.js"].code=["YUI.add('handlebars-compiler', function (Y, NAME) {","","/*!","Handlebars.js - Copyright (C) 2011 Yehuda Katz","https://raw.github.com/wycats/handlebars.js/master/LICENSE","*/","// This file contains code that will be inserted at the beginning of the","// handlebars-compiler module.","","// This is necessary because the Y.Handlebars object is created in the","// handlebars-base module, but the native Handlebars code expects to use a local","// Handlebars reference.","var Handlebars = Y.Handlebars;","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","/* Jison generated parser */","var handlebars = (function(){","var parser = {trace: function trace() { },","yy: {},","symbols_: {\"error\":2,\"root\":3,\"program\":4,\"EOF\":5,\"statements\":6,\"simpleInverse\":7,\"statement\":8,\"openInverse\":9,\"closeBlock\":10,\"openBlock\":11,\"mustache\":12,\"partial\":13,\"CONTENT\":14,\"COMMENT\":15,\"OPEN_BLOCK\":16,\"inMustache\":17,\"CLOSE\":18,\"OPEN_INVERSE\":19,\"OPEN_ENDBLOCK\":20,\"path\":21,\"OPEN\":22,\"OPEN_UNESCAPED\":23,\"OPEN_PARTIAL\":24,\"params\":25,\"hash\":26,\"param\":27,\"STRING\":28,\"INTEGER\":29,\"BOOLEAN\":30,\"hashSegments\":31,\"hashSegment\":32,\"ID\":33,\"EQUALS\":34,\"pathSegments\":35,\"SEP\":36,\"$accept\":0,\"$end\":1},","terminals_: {2:\"error\",5:\"EOF\",14:\"CONTENT\",15:\"COMMENT\",16:\"OPEN_BLOCK\",18:\"CLOSE\",19:\"OPEN_INVERSE\",20:\"OPEN_ENDBLOCK\",22:\"OPEN\",23:\"OPEN_UNESCAPED\",24:\"OPEN_PARTIAL\",28:\"STRING\",29:\"INTEGER\",30:\"BOOLEAN\",33:\"ID\",34:\"EQUALS\",36:\"SEP\"},","productions_: [0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],","performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {","","var $0 = $$.length - 1;","switch (yystate) {","case 1: return $$[$0-1]; ","break;","case 2: this.$ = new yy.ProgramNode($$[$0-2], $$[$0]); ","break;","case 3: this.$ = new yy.ProgramNode($$[$0]); ","break;","case 4: this.$ = new yy.ProgramNode([]); ","break;","case 5: this.$ = [$$[$0]]; ","break;","case 6: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; ","break;","case 7: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1].inverse, $$[$0-1], $$[$0]); ","break;","case 8: this.$ = new yy.BlockNode($$[$0-2], $$[$0-1], $$[$0-1].inverse, $$[$0]); ","break;","case 9: this.$ = $$[$0]; ","break;","case 10: this.$ = $$[$0]; ","break;","case 11: this.$ = new yy.ContentNode($$[$0]); ","break;","case 12: this.$ = new yy.CommentNode($$[$0]); ","break;","case 13: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); ","break;","case 14: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); ","break;","case 15: this.$ = $$[$0-1]; ","break;","case 16: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1]); ","break;","case 17: this.$ = new yy.MustacheNode($$[$0-1][0], $$[$0-1][1], true); ","break;","case 18: this.$ = new yy.PartialNode($$[$0-1]); ","break;","case 19: this.$ = new yy.PartialNode($$[$0-2], $$[$0-1]); ","break;","case 20: ","break;","case 21: this.$ = [[$$[$0-2]].concat($$[$0-1]), $$[$0]]; ","break;","case 22: this.$ = [[$$[$0-1]].concat($$[$0]), null]; ","break;","case 23: this.$ = [[$$[$0-1]], $$[$0]]; ","break;","case 24: this.$ = [[$$[$0]], null]; ","break;","case 25: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; ","break;","case 26: this.$ = [$$[$0]]; ","break;","case 27: this.$ = $$[$0]; ","break;","case 28: this.$ = new yy.StringNode($$[$0]); ","break;","case 29: this.$ = new yy.IntegerNode($$[$0]); ","break;","case 30: this.$ = new yy.BooleanNode($$[$0]); ","break;","case 31: this.$ = new yy.HashNode($$[$0]); ","break;","case 32: $$[$0-1].push($$[$0]); this.$ = $$[$0-1]; ","break;","case 33: this.$ = [$$[$0]]; ","break;","case 34: this.$ = [$$[$0-2], $$[$0]]; ","break;","case 35: this.$ = [$$[$0-2], new yy.StringNode($$[$0])]; ","break;","case 36: this.$ = [$$[$0-2], new yy.IntegerNode($$[$0])]; ","break;","case 37: this.$ = [$$[$0-2], new yy.BooleanNode($$[$0])]; ","break;","case 38: this.$ = new yy.IdNode($$[$0]); ","break;","case 39: $$[$0-2].push($$[$0]); this.$ = $$[$0-2]; ","break;","case 40: this.$ = [$$[$0]]; ","break;","}","},","table: [{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],","defaultActions: {16:[2,1],37:[2,23],53:[2,21]},","parseError: function parseError(str, hash) {"," throw new Error(str);","},","parse: function parse(input) {"," var self = this,"," stack = [0],"," vstack = [null], // semantic value stack"," lstack = [], // location stack"," table = this.table,"," yytext = '',"," yylineno = 0,"," yyleng = 0,"," recovering = 0,"," TERROR = 2,"," EOF = 1;",""," //this.reductionCount = this.shiftCount = 0;",""," this.lexer.setInput(input);"," this.lexer.yy = this.yy;"," this.yy.lexer = this.lexer;"," this.yy.parser = this;"," if (typeof this.lexer.yylloc == 'undefined')"," this.lexer.yylloc = {};"," var yyloc = this.lexer.yylloc;"," lstack.push(yyloc);",""," if (typeof this.yy.parseError === 'function')"," this.parseError = this.yy.parseError;",""," function popStack (n) {"," stack.length = stack.length - 2*n;"," vstack.length = vstack.length - n;"," lstack.length = lstack.length - n;"," }",""," function lex() {"," var token;"," token = self.lexer.lex() || 1; // $end = 1"," // if token isn't its numeric value, convert"," if (typeof token !== 'number') {"," token = self.symbols_[token] || token;"," }"," return token;"," }",""," var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected;"," while (true) {"," // retreive state number from top of stack"," state = stack[stack.length-1];",""," // use default actions if available"," if (this.defaultActions[state]) {"," action = this.defaultActions[state];"," } else {"," if (symbol === null || typeof symbol == 'undefined') {"," symbol = lex();"," }"," // read action for current state and first input"," action = table[state] && table[state][symbol];"," }",""," // handle parse error"," _handle_error:"," if (typeof action === 'undefined' || !action.length || !action[0]) {",""," var errStr = '';"," if (!recovering) {"," // Report error"," expected = [];"," for (p in table[state]) if (this.terminals_[p] && p > 2) {"," expected.push(\"'\"+this.terminals_[p]+\"'\");"," }"," if (this.lexer.showPosition) {"," errStr = 'Parse error on line '+(yylineno+1)+\":\\n\"+this.lexer.showPosition()+\"\\nExpecting \"+expected.join(', ') + \", got '\" + (this.terminals_[symbol] || symbol)+ \"'\";"," } else {"," errStr = 'Parse error on line '+(yylineno+1)+\": Unexpected \" +"," (symbol == 1 /*EOF*/ ? \"end of input\" :"," (\"'\"+(this.terminals_[symbol] || symbol)+\"'\"));"," }"," this.parseError(errStr,"," {text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected});"," }",""," // just recovered from another error"," if (recovering == 3) {"," if (symbol == EOF) {"," throw new Error(errStr || 'Parsing halted.');"," }",""," // discard current lookahead and grab another"," yyleng = this.lexer.yyleng;"," yytext = this.lexer.yytext;"," yylineno = this.lexer.yylineno;"," yyloc = this.lexer.yylloc;"," symbol = lex();"," }",""," // try to recover from error"," while (1) {"," // check for error recovery rule in this state"," if ((TERROR.toString()) in table[state]) {"," break;"," }"," if (state === 0) {"," throw new Error(errStr || 'Parsing halted.');"," }"," popStack(1);"," state = stack[stack.length-1];"," }",""," preErrorSymbol = symbol == 2 ? null : symbol; // save the lookahead token"," symbol = TERROR; // insert generic error symbol as new lookahead"," state = stack[stack.length-1];"," action = table[state] && table[state][TERROR];"," recovering = 3; // allow 3 real symbols to be shifted before reporting a new error"," }",""," // this shouldn't happen, unless resolve defaults are off"," if (action[0] instanceof Array && action.length > 1) {"," throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol);"," }",""," switch (action[0]) {",""," case 1: // shift"," //this.shiftCount++;",""," stack.push(symbol);"," vstack.push(this.lexer.yytext);"," lstack.push(this.lexer.yylloc);"," stack.push(action[1]); // push state"," symbol = null;"," if (!preErrorSymbol) { // normal execution/no error"," yyleng = this.lexer.yyleng;"," yytext = this.lexer.yytext;"," yylineno = this.lexer.yylineno;"," yyloc = this.lexer.yylloc;"," if (recovering > 0)"," recovering--;"," } else { // error just occurred, resume old lookahead f/ before error"," symbol = preErrorSymbol;"," preErrorSymbol = null;"," }"," break;",""," case 2: // reduce"," //this.reductionCount++;",""," len = this.productions_[action[1]][1];",""," // perform semantic action"," yyval.$ = vstack[vstack.length-len]; // default to $$ = $1"," // default location, uses first token for firsts, last for lasts"," yyval._$ = {"," first_line: lstack[lstack.length-(len||1)].first_line,"," last_line: lstack[lstack.length-1].last_line,"," first_column: lstack[lstack.length-(len||1)].first_column,"," last_column: lstack[lstack.length-1].last_column"," };"," r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack);",""," if (typeof r !== 'undefined') {"," return r;"," }",""," // pop off stack"," if (len) {"," stack = stack.slice(0,-1*len*2);"," vstack = vstack.slice(0, -1*len);"," lstack = lstack.slice(0, -1*len);"," }",""," stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce)"," vstack.push(yyval.$);"," lstack.push(yyval._$);"," // goto new state = table[STATE][NONTERMINAL]"," newState = table[stack[stack.length-2]][stack[stack.length-1]];"," stack.push(newState);"," break;",""," case 3: // accept"," return true;"," }",""," }",""," return true;","}};","/* Jison generated lexer */","var lexer = (function(){","var lexer = ({EOF:1,","parseError:function parseError(str, hash) {"," if (this.yy.parser) {"," this.yy.parser.parseError(str, hash);"," } else {"," throw new Error(str);"," }"," },","setInput:function (input) {"," this._input = input;"," this._more = this._less = this.done = false;"," this.yylineno = this.yyleng = 0;"," this.yytext = this.matched = this.match = '';"," this.conditionStack = ['INITIAL'];"," this.yylloc = {first_line:1,first_column:0,last_line:1,last_column:0};"," return this;"," },","input:function () {"," var ch = this._input[0];"," this.yytext+=ch;"," this.yyleng++;"," this.match+=ch;"," this.matched+=ch;"," var lines = ch.match(/\\n/);"," if (lines) this.yylineno++;"," this._input = this._input.slice(1);"," return ch;"," },","unput:function (ch) {"," this._input = ch + this._input;"," return this;"," },","more:function () {"," this._more = true;"," return this;"," },","less:function (n) {"," this._input = this.match.slice(n) + this._input;"," },","pastInput:function () {"," var past = this.matched.substr(0, this.matched.length - this.match.length);"," return (past.length > 20 ? '...':'') + past.substr(-20).replace(/\\n/g, \"\");"," },","upcomingInput:function () {"," var next = this.match;"," if (next.length < 20) {"," next += this._input.substr(0, 20-next.length);"," }"," return (next.substr(0,20)+(next.length > 20 ? '...':'')).replace(/\\n/g, \"\");"," },","showPosition:function () {"," var pre = this.pastInput();"," var c = new Array(pre.length + 1).join(\"-\");"," return pre + this.upcomingInput() + \"\\n\" + c+\"^\";"," },","next:function () {"," if (this.done) {"," return this.EOF;"," }"," if (!this._input) this.done = true;",""," var token,"," match,"," tempMatch,"," index,"," col,"," lines;"," if (!this._more) {"," this.yytext = '';"," this.match = '';"," }"," var rules = this._currentRules();"," for (var i=0;i < rules.length; i++) {"," tempMatch = this._input.match(this.rules[rules[i]]);"," if (tempMatch && (!match || tempMatch[0].length > match[0].length)) {"," match = tempMatch;"," index = i;"," if (!this.options.flex) break;"," }"," }"," if (match) {"," lines = match[0].match(/\\n.*/g);"," if (lines) this.yylineno += lines.length;"," this.yylloc = {first_line: this.yylloc.last_line,"," last_line: this.yylineno+1,"," first_column: this.yylloc.last_column,"," last_column: lines ? lines[lines.length-1].length-1 : this.yylloc.last_column + match[0].length};"," this.yytext += match[0];"," this.match += match[0];"," this.yyleng = this.yytext.length;"," this._more = false;"," this._input = this._input.slice(match[0].length);"," this.matched += match[0];"," token = this.performAction.call(this, this.yy, this, rules[index],this.conditionStack[this.conditionStack.length-1]);"," if (this.done && this._input) this.done = false;"," if (token) return token;"," else return;"," }"," if (this._input === \"\") {"," return this.EOF;"," } else {"," return this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\\n'+this.showPosition(),"," {text: \"\", token: null, line: this.yylineno});"," }"," },","lex:function lex() {"," var r = this.next();"," if (typeof r !== 'undefined') {"," return r;"," } else {"," return this.lex();"," }"," },","begin:function begin(condition) {"," this.conditionStack.push(condition);"," },","popState:function popState() {"," return this.conditionStack.pop();"," },","_currentRules:function _currentRules() {"," return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules;"," },","topState:function () {"," return this.conditionStack[this.conditionStack.length-2];"," },","pushState:function begin(condition) {"," this.begin(condition);"," }});","lexer.options = {};","lexer.performAction = function anonymous(yy,yy_,$avoiding_name_collisions,YY_START) {","","var YYSTATE=YY_START","switch($avoiding_name_collisions) {","case 0:"," if(yy_.yytext.slice(-1) !== \"\\\\\") this.begin(\"mu\");"," if(yy_.yytext.slice(-1) === \"\\\\\") yy_.yytext = yy_.yytext.substr(0,yy_.yyleng-1), this.begin(\"emu\");"," if(yy_.yytext) return 14;"," ","break;","case 1: return 14; ","break;","case 2: this.popState(); return 14; ","break;","case 3: return 24; ","break;","case 4: return 16; ","break;","case 5: return 20; ","break;","case 6: return 19; ","break;","case 7: return 19; ","break;","case 8: return 23; ","break;","case 9: return 23; ","break;","case 10: yy_.yytext = yy_.yytext.substr(3,yy_.yyleng-5); this.popState(); return 15; ","break;","case 11: return 22; ","break;","case 12: return 34; ","break;","case 13: return 33; ","break;","case 14: return 33; ","break;","case 15: return 36; ","break;","case 16: /*ignore whitespace*/ ","break;","case 17: this.popState(); return 18; ","break;","case 18: this.popState(); return 18; ","break;","case 19: yy_.yytext = yy_.yytext.substr(1,yy_.yyleng-2).replace(/\\\\\"/g,'\"'); return 28; ","break;","case 20: return 30; ","break;","case 21: return 30; ","break;","case 22: return 29; ","break;","case 23: return 33; ","break;","case 24: yy_.yytext = yy_.yytext.substr(1, yy_.yyleng-2); return 33; ","break;","case 25: return 'INVALID'; ","break;","case 26: return 5; ","break;","}","};","lexer.rules = [/^(?:[^\\x00]*?(?=(\\{\\{)))/,/^(?:[^\\x00]+)/,/^(?:[^\\x00]{2,}?(?=(\\{\\{)))/,/^(?:\\{\\{>)/,/^(?:\\{\\{#)/,/^(?:\\{\\{\\/)/,/^(?:\\{\\{\\^)/,/^(?:\\{\\{\\s*else\\b)/,/^(?:\\{\\{\\{)/,/^(?:\\{\\{&)/,/^(?:\\{\\{![\\s\\S]*?\\}\\})/,/^(?:\\{\\{)/,/^(?:=)/,/^(?:\\.(?=[} ]))/,/^(?:\\.\\.)/,/^(?:[\\/.])/,/^(?:\\s+)/,/^(?:\\}\\}\\})/,/^(?:\\}\\})/,/^(?:\"(\\\\[\"]|[^\"])*\")/,/^(?:true(?=[}\\s]))/,/^(?:false(?=[}\\s]))/,/^(?:[0-9]+(?=[}\\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\\s\\/.]))/,/^(?:\\[[^\\]]*\\])/,/^(?:.)/,/^(?:$)/];","lexer.conditions = {\"mu\":{\"rules\":[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],\"inclusive\":false},\"emu\":{\"rules\":[2],\"inclusive\":false},\"INITIAL\":{\"rules\":[0,1,26],\"inclusive\":true}};","return lexer;})()","parser.lexer = lexer;function Parser () { this.yy = {}; }Parser.prototype = parser;parser.Parser = Parser;","return new Parser;","})();","if (typeof require !== 'undefined' && typeof exports !== 'undefined') {","exports.parser = handlebars;","exports.Parser = handlebars.Parser;","exports.parse = function () { return handlebars.parse.apply(handlebars, arguments); }","exports.main = function commonjsMain(args) {"," if (!args[1])"," throw new Error('Usage: '+args[0]+' FILE');"," var source, cwd;"," if (typeof process !== 'undefined') {"," source = require('fs').readFileSync(require('path').resolve(args[1]), \"utf8\");"," } else {"," source = require(\"file\").path(require(\"file\").cwd()).join(args[1]).read({charset: \"utf-8\"});"," }"," return exports.parser.parse(source);","}","if (typeof module !== 'undefined' && require.main === module) {"," exports.main(typeof process !== 'undefined' ? process.argv.slice(1) : require(\"system\").args);","}","};","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","Handlebars.Parser = handlebars;","","Handlebars.parse = function(string) {"," Handlebars.Parser.yy = Handlebars.AST;"," return Handlebars.Parser.parse(string);","};","","Handlebars.print = function(ast) {"," return new Handlebars.PrintVisitor().accept(ast);","};","","Handlebars.logger = {"," DEBUG: 0, INFO: 1, WARN: 2, ERROR: 3, level: 3,",""," // override in the host environment"," log: function(level, str) {}","};","","Handlebars.log = function(level, str) { Handlebars.logger.log(level, str); };","","// END(BROWSER)","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","(function() {",""," Handlebars.AST = {};",""," Handlebars.AST.ProgramNode = function(statements, inverse) {"," this.type = \"program\";"," this.statements = statements;"," if(inverse) { this.inverse = new Handlebars.AST.ProgramNode(inverse); }"," };",""," Handlebars.AST.MustacheNode = function(rawParams, hash, unescaped) {"," this.type = \"mustache\";"," this.escaped = !unescaped;"," this.hash = hash;",""," var id = this.id = rawParams[0];"," var params = this.params = rawParams.slice(1);",""," // a mustache is an eligible helper if:"," // * its id is simple (a single part, not `this` or `..`)"," var eligibleHelper = this.eligibleHelper = id.isSimple;",""," // a mustache is definitely a helper if:"," // * it is an eligible helper, and"," // * it has at least one parameter or hash segment"," this.isHelper = eligibleHelper && (params.length || hash);",""," // if a mustache is an eligible helper but not a definite"," // helper, it is ambiguous, and will be resolved in a later"," // pass or at runtime."," };",""," Handlebars.AST.PartialNode = function(id, context) {"," this.type = \"partial\";",""," // TODO: disallow complex IDs",""," this.id = id;"," this.context = context;"," };",""," var verifyMatch = function(open, close) {"," if(open.original !== close.original) {"," throw new Handlebars.Exception(open.original + \" doesn't match \" + close.original);"," }"," };",""," Handlebars.AST.BlockNode = function(mustache, program, inverse, close) {"," verifyMatch(mustache.id, close);"," this.type = \"block\";"," this.mustache = mustache;"," this.program = program;"," this.inverse = inverse;",""," if (this.inverse && !this.program) {"," this.isInverse = true;"," }"," };",""," Handlebars.AST.ContentNode = function(string) {"," this.type = \"content\";"," this.string = string;"," };",""," Handlebars.AST.HashNode = function(pairs) {"," this.type = \"hash\";"," this.pairs = pairs;"," };",""," Handlebars.AST.IdNode = function(parts) {"," this.type = \"ID\";"," this.original = parts.join(\".\");",""," var dig = [], depth = 0;",""," for(var i=0,l=parts.length; i<l; i++) {"," var part = parts[i];",""," if(part === \"..\") { depth++; }"," else if(part === \".\" || part === \"this\") { this.isScoped = true; }"," else { dig.push(part); }"," }",""," this.parts = dig;"," this.string = dig.join('.');"," this.depth = depth;",""," // an ID is simple if it only has one part, and that part is not"," // `..` or `this`."," this.isSimple = parts.length === 1 && !this.isScoped && depth === 0;"," };",""," Handlebars.AST.StringNode = function(string) {"," this.type = \"STRING\";"," this.string = string;"," };",""," Handlebars.AST.IntegerNode = function(integer) {"," this.type = \"INTEGER\";"," this.integer = integer;"," };",""," Handlebars.AST.BooleanNode = function(bool) {"," this.type = \"BOOLEAN\";"," this.bool = bool;"," };",""," Handlebars.AST.CommentNode = function(comment) {"," this.type = \"comment\";"," this.comment = comment;"," };","","})();","// END(BROWSER)","/* THIS FILE IS GENERATED BY A BUILD SCRIPT - DO NOT EDIT! */","","// BEGIN(BROWSER)","","/*jshint eqnull:true*/","Handlebars.Compiler = function() {};","Handlebars.JavaScriptCompiler = function() {};","","(function(Compiler, JavaScriptCompiler) {"," // the foundHelper register will disambiguate helper lookup from finding a"," // function in a context. This is necessary for mustache compatibility, which"," // requires that context functions in blocks are evaluated by blockHelperMissing,"," // and then proceed as if the resulting value was provided to blockHelperMissing.",""," Compiler.prototype = {"," compiler: Compiler,",""," disassemble: function() {"," var opcodes = this.opcodes, opcode, out = [], params, param;",""," for (var i=0, l=opcodes.length; i<l; i++) {"," opcode = opcodes[i];",""," if (opcode.opcode === 'DECLARE') {"," out.push(\"DECLARE \" + opcode.name + \"=\" + opcode.value);"," } else {"," params = [];"," for (var j=0; j<opcode.args.length; j++) {"," param = opcode.args[j];"," if (typeof param === \"string\") {"," param = \"\\\"\" + param.replace(\"\\n\", \"\\\\n\") + \"\\\"\";"," }"," params.push(param);"," }"," out.push(opcode.opcode + \" \" + params.join(\" \"));"," }"," }",""," return out.join(\"\\n\");"," },",""," guid: 0,",""," compile: function(program, options) {"," this.children = [];"," this.depths = {list: []};"," this.options = options;",""," // These changes will propagate to the other compiler components"," var knownHelpers = this.options.knownHelpers;"," this.options.knownHelpers = {"," 'helperMissing': true,"," 'blockHelperMissing': true,"," 'each': true,"," 'if': true,"," 'unless': true,"," 'with': true,"," 'log': true"," };"," if (knownHelpers) {"," for (var name in knownHelpers) {"," this.options.knownHelpers[name] = knownHelpers[name];"," }"," }",""," return this.program(program);"," },",""," accept: function(node) {"," return this[node.type](node);"," },",""," program: function(program) {"," var statements = program.statements, statement;"," this.opcodes = [];",""," for(var i=0, l=statements.length; i<l; i++) {"," statement = statements[i];"," this[statement.type](statement);"," }"," this.isSimple = l === 1;",""," this.depths.list = this.depths.list.sort(function(a, b) {"," return a - b;"," });",""," return this;"," },",""," compileProgram: function(program) {"," var result = new this.compiler().compile(program, this.options);"," var guid = this.guid++, depth;",""," this.usePartial = this.usePartial || result.usePartial;",""," this.children[guid] = result;",""," for(var i=0, l=result.depths.list.length; i<l; i++) {"," depth = result.depths.list[i];",""," if(depth < 2) { continue; }"," else { this.addDepth(depth - 1); }"," }",""," return guid;"," },",""," block: function(block) {"," var mustache = block.mustache,"," program = block.program,"," inverse = block.inverse;",""," if (program) {"," program = this.compileProgram(program);"," }",""," if (inverse) {"," inverse = this.compileProgram(inverse);"," }",""," var type = this.classifyMustache(mustache);",""," if (type === \"helper\") {"," this.helperMustache(mustache, program, inverse);"," } else if (type === \"simple\") {"," this.simpleMustache(mustache);",""," // now that the simple mustache is resolved, we need to"," // evaluate it by executing `blockHelperMissing`"," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);"," this.opcode('pushLiteral', '{}');"," this.opcode('blockValue');"," } else {"," this.ambiguousMustache(mustache, program, inverse);",""," // now that the simple mustache is resolved, we need to"," // evaluate it by executing `blockHelperMissing`"," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);"," this.opcode('pushLiteral', '{}');"," this.opcode('ambiguousBlockValue');"," }",""," this.opcode('append');"," },",""," hash: function(hash) {"," var pairs = hash.pairs, pair, val;",""," this.opcode('push', '{}');",""," for(var i=0, l=pairs.length; i<l; i++) {"," pair = pairs[i];"," val = pair[1];",""," this.accept(val);"," this.opcode('assignToHash', pair[0]);"," }"," },",""," partial: function(partial) {"," var id = partial.id;"," this.usePartial = true;",""," if(partial.context) {"," this.ID(partial.context);"," } else {"," this.opcode('push', 'depth0');"," }",""," this.opcode('invokePartial', id.original);"," this.opcode('append');"," },",""," content: function(content) {"," this.opcode('appendContent', content.string);"," },",""," mustache: function(mustache) {"," var options = this.options;"," var type = this.classifyMustache(mustache);",""," if (type === \"simple\") {"," this.simpleMustache(mustache);"," } else if (type === \"helper\") {"," this.helperMustache(mustache);"," } else {"," this.ambiguousMustache(mustache);"," }",""," if(mustache.escaped && !options.noEscape) {"," this.opcode('appendEscaped');"," } else {"," this.opcode('append');"," }"," },",""," ambiguousMustache: function(mustache, program, inverse) {"," var id = mustache.id, name = id.parts[0];",""," this.opcode('getContext', id.depth);",""," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);",""," this.opcode('invokeAmbiguous', name);"," },",""," simpleMustache: function(mustache, program, inverse) {"," var id = mustache.id;",""," this.addDepth(id.depth);"," this.opcode('getContext', id.depth);",""," if (id.parts.length) {"," this.opcode('lookupOnContext', id.parts[0]);"," for(var i=1, l=id.parts.length; i<l; i++) {"," this.opcode('lookup', id.parts[i]);"," }"," } else {"," this.opcode('pushContext');"," }"," this.opcode('resolvePossibleLambda');"," },",""," helperMustache: function(mustache, program, inverse) {"," var params = this.setupFullMustacheParams(mustache, program, inverse),"," name = mustache.id.parts[0];",""," if (this.options.knownHelpers[name]) {"," this.opcode('invokeKnownHelper', params.length, name);"," } else if (this.knownHelpersOnly) {"," throw new Error(\"You specified knownHelpersOnly, but used the unknown helper \" + name);"," } else {"," this.opcode('invokeHelper', params.length, name);"," }"," },",""," ID: function(id) {"," this.addDepth(id.depth);"," this.opcode('getContext', id.depth);"," this.opcode('lookupOnContext', id.parts[0]);",""," for(var i=1, l=id.parts.length; i<l; i++) {"," this.opcode('lookup', id.parts[i]);"," }"," },",""," STRING: function(string) {"," this.opcode('pushString', string.string);"," },",""," INTEGER: function(integer) {"," this.opcode('pushLiteral', integer.integer);"," },",""," BOOLEAN: function(bool) {"," this.opcode('pushLiteral', bool.bool);"," },",""," comment: function() {},",""," // HELPERS"," opcode: function(name) {"," this.opcodes.push({ opcode: name, args: [].slice.call(arguments, 1) });"," },",""," declare: function(name, value) {"," this.opcodes.push({ opcode: 'DECLARE', name: name, value: value });"," },",""," addDepth: function(depth) {"," if(depth === 0) { return; }",""," if(!this.depths[depth]) {"," this.depths[depth] = true;"," this.depths.list.push(depth);"," }"," },",""," classifyMustache: function(mustache) {"," var isHelper = mustache.isHelper;"," var isEligible = mustache.eligibleHelper;"," var options = this.options;",""," // if ambiguous, we can possibly resolve the ambiguity now"," if (isEligible && !isHelper) {"," var name = mustache.id.parts[0];",""," if (options.knownHelpers[name]) {"," isHelper = true;"," } else if (options.knownHelpersOnly) {"," isEligible = false;"," }"," }",""," if (isHelper) { return \"helper\"; }"," else if (isEligible) { return \"ambiguous\"; }"," else { return \"simple\"; }"," },",""," pushParams: function(params) {"," var i = params.length, param;",""," while(i--) {"," param = params[i];",""," if(this.options.stringParams) {"," if(param.depth) {"," this.addDepth(param.depth);"," }",""," this.opcode('getContext', param.depth || 0);"," this.opcode('pushStringParam', param.string);"," } else {"," this[param.type](param);"," }"," }"," },",""," setupMustacheParams: function(mustache) {"," var params = mustache.params;"," this.pushParams(params);",""," if(mustache.hash) {"," this.hash(mustache.hash);"," } else {"," this.opcode('pushLiteral', '{}');"," }",""," return params;"," },",""," // this will replace setupMustacheParams when we're done"," setupFullMustacheParams: function(mustache, program, inverse) {"," var params = mustache.params;"," this.pushParams(params);",""," this.opcode('pushProgram', program);"," this.opcode('pushProgram', inverse);",""," if(mustache.hash) {"," this.hash(mustache.hash);"," } else {"," this.opcode('pushLiteral', '{}');"," }",""," return params;"," }"," };",""," var Literal = function(value) {"," this.value = value;"," };",""," JavaScriptCompiler.prototype = {"," // PUBLIC API: You can override these methods in a subclass to provide"," // alternative compiled forms for name lookup and buffering semantics"," nameLookup: function(parent, name, type) {"," if (/^[0-9]+$/.test(name)) {"," return parent + \"[\" + name + \"]\";"," } else if (JavaScriptCompiler.isValidJavaScriptVariableName(name)) {"," return parent + \".\" + name;"," }"," else {"," return parent + \"['\" + name + \"']\";"," }"," },",""," appendToBuffer: function(string) {"," if (this.environment.isSimple) {"," return \"return \" + string + \";\";"," } else {"," return \"buffer += \" + string + \";\";"," }"," },",""," initializeBuffer: function() {"," return this.quotedString(\"\");"," },",""," namespace: \"Handlebars\","," // END PUBLIC API",""," compile: function(environment, options, context, asObject) {"," this.environment = environment;"," this.options = options || {};",""," Handlebars.log(Handlebars.logger.DEBUG, this.environment.disassemble() + \"\\n\\n\");",""," this.name = this.environment.name;"," this.isChild = !!context;"," this.context = context || {"," programs: [],"," aliases: { }"," };",""," this.preamble();",""," this.stackSlot = 0;"," this.stackVars = [];"," this.registers = { list: [] };"," this.compileStack = [];",""," this.compileChildren(environment, options);",""," var opcodes = environment.opcodes, opcode;",""," this.i = 0;",""," for(l=opcodes.length; this.i<l; this.i++) {"," opcode = opcodes[this.i];",""," if(opcode.opcode === 'DECLARE') {"," this[opcode.name] = opcode.value;"," } else {"," this[opcode.opcode].apply(this, opcode.args);"," }"," }",""," return this.createFunctionContext(asObject);"," },",""," nextOpcode: function() {"," var opcodes = this.environment.opcodes, opcode = opcodes[this.i + 1];"," return opcodes[this.i + 1];"," },",""," eat: function(opcode) {"," this.i = this.i + 1;"," },",""," preamble: function() {"," var out = [];",""," if (!this.isChild) {"," var namespace = this.namespace;"," var copies = \"helpers = helpers || \" + namespace + \".helpers;\";"," if(this.environment.usePartial) { copies = copies + \" partials = partials || \" + namespace + \".partials;\"; }"," out.push(copies);"," } else {"," out.push('');"," }",""," if (!this.environment.isSimple) {"," out.push(\", buffer = \" + this.initializeBuffer());"," } else {"," out.push(\"\");"," }",""," // track the last context pushed into place to allow skipping the"," // getContext opcode when it would be a noop"," this.lastContext = 0;"," this.source = out;"," },",""," createFunctionContext: function(asObject) {"," var locals = this.stackVars.concat(this.registers.list);",""," if(locals.length > 0) {"," this.source[1] = this.source[1] + \", \" + locals.join(\", \");"," }",""," // Generate minimizer alias mappings"," if (!this.isChild) {"," var aliases = [];"," for (var alias in this.context.aliases) {"," this.source[1] = this.source[1] + ', ' + alias + '=' + this.context.aliases[alias];"," }"," }",""," if (this.source[1]) {"," this.source[1] = \"var \" + this.source[1].substring(2) + \";\";"," }",""," // Merge children"," if (!this.isChild) {"," this.source[1] += '\\n' + this.context.programs.join('\\n') + '\\n';"," }",""," if (!this.environment.isSimple) {"," this.source.push(\"return buffer;\");"," }",""," var params = this.isChild ? [\"depth0\", \"data\"] : [\"Handlebars\", \"depth0\", \"helpers\", \"partials\", \"data\"];",""," for(var i=0, l=this.environment.depths.list.length; i<l; i++) {"," params.push(\"depth\" + this.environment.depths.list[i]);"," }",""," if (asObject) {"," params.push(this.source.join(\"\\n \"));",""," return Function.apply(this, params);"," } else {"," var functionSource = 'function ' + (this.name || '') + '(' + params.join(',') + ') {\\n ' + this.source.join(\"\\n \") + '}';"," Handlebars.log(Handlebars.logger.DEBUG, functionSource + \"\\n\\n\");"," return functionSource;"," }"," },",""," // [blockValue]"," //"," // On stack, before: hash, inverse, program, value"," // On stack, after: return value of blockHelperMissing"," //"," // The purpose of this opcode is to take a block of the form"," // `{{#foo}}...{{/foo}}`, resolve the value of `foo`, and"," // replace it on the stack with the result of properly"," // invoking blockHelperMissing."," blockValue: function() {"," this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';",""," var params = [\"depth0\"];"," this.setupParams(0, params);",""," this.replaceStack(function(current) {"," params.splice(1, 0, current);"," return current + \" = blockHelperMissing.call(\" + params.join(\", \") + \")\";"," });"," },",""," // [ambiguousBlockValue]"," //"," // On stack, before: hash, inverse, program, value"," // Compiler value, before: lastHelper=value of last found helper, if any"," // On stack, after, if no lastHelper: same as [blockValue]"," // On stack, after, if lastHelper: value"," ambiguousBlockValue: function() {"," this.context.aliases.blockHelperMissing = 'helpers.blockHelperMissing';",""," var params = [\"depth0\"];"," this.setupParams(0, params);",""," var current = this.topStack();"," params.splice(1, 0, current);",""," this.source.push(\"if (!\" + this.lastHelper + \") { \" + current + \" = blockHelperMissing.call(\" + params.join(\", \") + \"); }\");"," },",""," // [appendContent]"," //"," // On stack, before: ..."," // On stack, after: ..."," //"," // Appends the string value of `content` to the current buffer"," appendContent: function(content) {"," this.source.push(this.appendToBuffer(this.quotedString(content)));"," },",""," // [append]"," //"," // On stack, before: value, ..."," // On stack, after: ..."," //"," // Coerces `value` to a String and appends it to the current buffer."," //"," // If `value` is truthy, or 0, it is coerced into a string and appended"," // Otherwise, the empty string is appended"," append: function() {"," var local = this.popStack();"," this.source.push(\"if(\" + local + \" || \" + local + \" === 0) { \" + this.appendToBuffer(local) + \" }\");"," if (this.environment.isSimple) {"," this.source.push(\"else { \" + this.appendToBuffer(\"''\") + \" }\");"," }"," },",""," // [appendEscaped]"," //"," // On stack, before: value, ..."," // On stack, after: ..."," //"," // Escape `value` and append it to the buffer"," appendEscaped: function() {"," var opcode = this.nextOpcode(), extra = \"\";"," this.context.aliases.escapeExpression = 'this.escapeExpression';",""," if(opcode && opcode.opcode === 'appendContent') {"," extra = \" + \" + this.quotedString(opcode.args[0]);"," this.eat(opcode);"," }",""," this.source.push(this.appendToBuffer(\"escapeExpression(\" + this.popStack() + \")\" + extra));"," },",""," // [getContext]"," //"," // On stack, before: ..."," // On stack, after: ..."," // Compiler value, after: lastContext=depth"," //"," // Set the value of the `lastContext` compiler value to the depth"," getContext: function(depth) {"," if(this.lastContext !== depth) {"," this.lastContext = depth;"," }"," },",""," // [lookupOnContext]"," //"," // On stack, before: ..."," // On stack, after: currentContext[name], ..."," //"," // Looks up the value of `name` on the current context and pushes"," // it onto the stack."," lookupOnContext: function(name) {"," this.pushStack(this.nameLookup('depth' + this.lastContext, name, 'context'));"," },",""," // [pushContext]"," //"," // On stack, before: ..."," // On stack, after: currentContext, ..."," //"," // Pushes the value of the current context onto the stack."," pushContext: function() {"," this.pushStackLiteral('depth' + this.lastContext);"," },",""," // [resolvePossibleLambda]"," //"," // On stack, before: value, ..."," // On stack, after: resolved value, ..."," //"," // If the `value` is a lambda, replace it on the stack by"," // the return value of the lambda"," resolvePossibleLambda: function() {"," this.context.aliases.functionType = '\"function\"';",""," this.replaceStack(function(current) {"," return \"typeof \" + current + \" === functionType ? \" + current + \"() : \" + current;"," });"," },",""," // [lookup]"," //"," // On stack, before: value, ..."," // On stack, after: value[name], ..."," //"," // Replace the value on the stack with the result of looking"," // up `name` on `value`"," lookup: function(name) {"," this.replaceStack(function(current) {"," return current + \" == null || \" + current + \" === false ? \" + current + \" : \" + this.nameLookup(current, name, 'context');"," });"," },",""," // [pushStringParam]"," //"," // On stack, before: ..."," // On stack, after: string, currentContext, ..."," //"," // This opcode is designed for use in string mode, which"," // provides the string value of a parameter along with its"," // depth rather than resolving it immediately."," pushStringParam: function(string) {"," this.pushStackLiteral('depth' + this.lastContext);"," this.pushString(string);"," },",""," // [pushString]"," //"," // On stack, before: ..."," // On stack, after: quotedString(string), ..."," //"," // Push a quoted version of `string` onto the stack"," pushString: function(string) {"," this.pushStackLiteral(this.quotedString(string));"," },",""," // [push]"," //"," // On stack, before: ..."," // On stack, after: expr, ..."," //"," // Push an expression onto the stack"," push: function(expr) {"," this.pushStack(expr);"," },",""," // [pushLiteral]"," //"," // On stack, before: ..."," // On stack, after: value, ..."," //"," // Pushes a value onto the stack. This operation prevents"," // the compiler from creating a temporary variable to hold"," // it."," pushLiteral: function(value) {"," this.pushStackLiteral(value);"," },",""," // [pushProgram]"," //"," // On stack, before: ..."," // On stack, after: program(guid), ..."," //"," // Push a program expression onto the stack. This takes"," // a compile-time guid and converts it into a runtime-accessible"," // expression."," pushProgram: function(guid) {"," if (guid != null) {"," this.pushStackLiteral(this.programExpression(guid));"," } else {"," this.pushStackLiteral(null);"," }"," },",""," // [invokeHelper]"," //"," // On stack, before: hash, inverse, program, params..., ..."," // On stack, after: result of helper invocation"," //"," // Pops off the helper's parameters, invokes the helper,"," // and pushes the helper's return value onto the stack."," //"," // If the helper is not found, `helperMissing` is called."," invokeHelper: function(paramSize, name) {"," this.context.aliases.helperMissing = 'helpers.helperMissing';",""," var helper = this.lastHelper = this.setupHelper(paramSize, name);"," this.register('foundHelper', helper.name);",""," this.pushStack(\"foundHelper ? foundHelper.call(\" +"," helper.callParams + \") \" + \": helperMissing.call(\" +"," helper.helperMissingParams + \")\");"," },",""," // [invokeKnownHelper]"," //"," // On stack, before: hash, inverse, program, params..., ..."," // On stack, after: result of helper invocation"," //"," // This operation is used when the helper is known to exist,"," // so a `helperMissing` fallback is not required."," invokeKnownHelper: function(paramSize, name) {"," var helper = this.setupHelper(paramSize, name);"," this.pushStack(helper.name + \".call(\" + helper.callParams + \")\");"," },",""," // [invokeAmbiguous]"," //"," // On stack, before: hash, inverse, program, params..., ..."," // On stack, after: result of disambiguation"," //"," // This operation is used when an expression like `{{foo}}`"," // is provided, but we don't know at compile-time whether it"," // is a helper or a path."," //"," // This operation emits more code than the other options,"," // and can be avoided by passing the `knownHelpers` and"," // `knownHelpersOnly` flags at compile-time."," invokeAmbiguous: function(name) {"," this.context.aliases.functionType = '\"function\"';",""," this.pushStackLiteral('{}');"," var helper = this.setupHelper(0, name);",""," var helperName = this.lastHelper = this.nameLookup('helpers', name, 'helper');"," this.register('foundHelper', helperName);",""," var nonHelper = this.nameLookup('depth' + this.lastContext, name, 'context');"," var nextStack = this.nextStack();",""," this.source.push('if (foundHelper) { ' + nextStack + ' = foundHelper.call(' + helper.callParams + '); }');"," this.source.push('else { ' + nextStack + ' = ' + nonHelper + '; ' + nextStack + ' = typeof ' + nextStack + ' === functionType ? ' + nextStack + '() : ' + nextStack + '; }');"," },",""," // [invokePartial]"," //"," // On stack, before: context, ..."," // On stack after: result of partial invocation"," //"," // This operation pops off a context, invokes a partial with that context,"," // and pushes the result of the invocation back."," invokePartial: function(name) {"," var params = [this.nameLookup('partials', name, 'partial'), \"'\" + name + \"'\", this.popStack(), \"helpers\", \"partials\"];",""," if (this.options.data) {"," params.push(\"data\");"," }",""," this.context.aliases.self = \"this\";"," this.pushStack(\"self.invokePartial(\" + params.join(\", \") + \");\");"," },",""," // [assignToHash]"," //"," // On stack, before: value, hash, ..."," // On stack, after: hash, ..."," //"," // Pops a value and hash off the stack, assigns `hash[key] = value`"," // and pushes the hash back onto the stack."," assignToHash: function(key) {"," var value = this.popStack();"," var hash = this.topStack();",""," this.source.push(hash + \"['\" + key + \"'] = \" + value + \";\");"," },",""," // HELPERS",""," compiler: JavaScriptCompiler,",""," compileChildren: function(environment, options) {"," var children = environment.children, child, compiler;",""," for(var i=0, l=children.length; i<l; i++) {"," child = children[i];"," compiler = new this.compiler();",""," this.context.programs.push(''); // Placeholder to prevent name conflicts for nested children"," var index = this.context.programs.length;"," child.index = index;"," child.name = 'program' + index;"," this.context.programs[index] = compiler.compile(child, options, this.context);"," }"," },",""," programExpression: function(guid) {"," this.context.aliases.self = \"this\";",""," if(guid == null) {"," return \"self.noop\";"," }",""," var child = this.environment.children[guid],"," depths = child.depths.list, depth;",""," var programParams = [child.index, child.name, \"data\"];",""," for(var i=0, l = depths.length; i<l; i++) {"," depth = depths[i];",""," if(depth === 1) { programParams.push(\"depth0\"); }"," else { programParams.push(\"depth\" + (depth - 1)); }"," }",""," if(depths.length === 0) {"," return \"self.program(\" + programParams.join(\", \") + \")\";"," } else {"," programParams.shift();"," return \"self.programWithDepth(\" + programParams.join(\", \") + \")\";"," }"," },",""," register: function(name, val) {"," this.useRegister(name);"," this.source.push(name + \" = \" + val + \";\");"," },",""," useRegister: function(name) {"," if(!this.registers[name]) {"," this.registers[name] = true;"," this.registers.list.push(name);"," }"," },",""," pushStackLiteral: function(item) {"," this.compileStack.push(new Literal(item));"," return item;"," },",""," pushStack: function(item) {"," this.source.push(this.incrStack() + \" = \" + item + \";\");"," this.compileStack.push(\"stack\" + this.stackSlot);"," return \"stack\" + this.stackSlot;"," },",""," replaceStack: function(callback) {"," var item = callback.call(this, this.topStack());",""," this.source.push(this.topStack() + \" = \" + item + \";\");"," return \"stack\" + this.stackSlot;"," },",""," nextStack: function(skipCompileStack) {"," var name = this.incrStack();"," this.compileStack.push(\"stack\" + this.stackSlot);"," return name;"," },",""," incrStack: function() {"," this.stackSlot++;"," if(this.stackSlot > this.stackVars.length) { this.stackVars.push(\"stack\" + this.stackSlot); }"," return \"stack\" + this.stackSlot;"," },",""," popStack: function() {"," var item = this.compileStack.pop();",""," if (item instanceof Literal) {"," return item.value;"," } else {"," this.stackSlot--;"," return item;"," }"," },",""," topStack: function() {"," var item = this.compileStack[this.compileStack.length - 1];",""," if (item instanceof Literal) {"," return item.value;"," } else {"," return item;"," }"," },",""," quotedString: function(str) {"," return '\"' + str"," .replace(/\\\\/g, '\\\\\\\\')"," .replace(/\"/g, '\\\\\"')"," .replace(/\\n/g, '\\\\n')"," .replace(/\\r/g, '\\\\r') + '\"';"," },",""," setupHelper: function(paramSize, name) {"," var params = [];"," this.setupParams(paramSize, params);"," var foundHelper = this.nameLookup('helpers', name, 'helper');",""," return {"," params: params,"," name: foundHelper,"," callParams: [\"depth0\"].concat(params).join(\", \"),"," helperMissingParams: [\"depth0\", this.quotedString(name)].concat(params).join(\", \")"," };"," },",""," // the params and contexts arguments are passed in arrays"," // to fill in"," setupParams: function(paramSize, params) {"," var options = [], contexts = [], param, inverse, program;",""," options.push(\"hash:\" + this.popStack());",""," inverse = this.popStack();"," program = this.popStack();",""," // Avoid setting fn and inverse if neither are set. This allows"," // helpers to do a check for `if (options.fn)`"," if (program || inverse) {"," if (!program) {"," this.context.aliases.self = \"this\";"," program = \"self.noop\";"," }",""," if (!inverse) {"," this.context.aliases.self = \"this\";"," inverse = \"self.noop\";"," }",""," options.push(\"inverse:\" + inverse);"," options.push(\"fn:\" + program);"," }",""," for(var i=0; i<paramSize; i++) {"," param = this.popStack();"," params.push(param);",""," if(this.options.stringParams) {"," contexts.push(this.popStack());"," }"," }",""," if (this.options.stringParams) {"," options.push(\"contexts:[\" + contexts.join(\",\") + \"]\");"," }",""," if(this.options.data) {"," options.push(\"data:data\");"," }",""," params.push(\"{\" + options.join(\",\") + \"}\");"," return params.join(\", \");"," }"," };",""," var reservedWords = ("," \"break else new var\" +"," \" case finally return void\" +"," \" catch for switch while\" +"," \" continue function this with\" +"," \" default if throw\" +"," \" delete in try\" +"," \" do instanceof typeof\" +"," \" abstract enum int short\" +"," \" boolean export interface static\" +"," \" byte extends long super\" +"," \" char final native synchronized\" +"," \" class float package throws\" +"," \" const goto private transient\" +"," \" debugger implements protected volatile\" +"," \" double import public let yield\""," ).split(\" \");",""," var compilerWords = JavaScriptCompiler.RESERVED_WORDS = {};",""," for(var i=0, l=reservedWords.length; i<l; i++) {"," compilerWords[reservedWords[i]] = true;"," }",""," JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {"," if(!JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name)) {"," return true;"," }"," return false;"," };","","})(Handlebars.Compiler, Handlebars.JavaScriptCompiler);","","Handlebars.precompile = function(string, options) {"," options = options || {};",""," var ast = Handlebars.parse(string);"," var environment = new Handlebars.Compiler().compile(ast, options);"," return new Handlebars.JavaScriptCompiler().compile(environment, options);","};","","Handlebars.compile = function(string, options) {"," options = options || {};",""," var compiled;"," function compile() {"," var ast = Handlebars.parse(string);"," var environment = new Handlebars.Compiler().compile(ast, options);"," var templateSpec = new Handlebars.JavaScriptCompiler().compile(environment, options, undefined, true);"," return Handlebars.template(templateSpec);"," }",""," // Template is only compiled on first use and cached after that point."," return function(context, options) {"," if (!compiled) {"," compiled = compile();"," }"," return compiled.call(this, context, options);"," };","};","","// END(BROWSER)","// This file contains YUI-specific wrapper code and overrides for the","// handlebars-compiler module.","","/**","Handlebars parser and compiler. Use this module when you need to compile","Handlebars templates.","","@module handlebars","@submodule handlebars-compiler","*/","","var levels = ['debug', 'info', 'warn', 'error'];","","/**","Logs a debugging message. Note that messages will only be logged when the","handlebars module is loaded in \"debug\" mode.","","@method log","@param {String} level Log level for this message. Supported levels are \"debug\","," \"info\", \"warn\", and \"error\".","@param {String} message Message to log.","@for Handlebars","*/","Handlebars.logger.log = function (level, message) {","","};","","/**","Compiles and renders a Handlebars template string in a single step.","","If you'll be using a template more than once, it's more efficient to compile it","into a function once using `compile()`, and then render it whenever you need to","by simply executing the compiled function. However, if you only need to compile","and render a template once, `render()` is a handy shortcut for doing both in a","single step.","","@example",""," Y.Handlebars.render('The pie of the day is {{pie}}!', {"," pie: 'Maple Custard'"," });"," // => \"The pie of the day is Maple Custard!\"","","@method render","@param {String} string Handlebars template string to render.","@param {Object} context Context object to pass to the template.","@param {Object} [options] Compile/render options."," @param {Object} [options.helpers] Helper functions."," @param {Object} [options.partials] Partials."," @param {Object} [options.data] Data.","@return {String} Rendered template string.","*/","Handlebars.render = function (string, context, options) {"," return Handlebars.compile(string)(context, options);","};","","// The rest of this file is just API docs for methods defined in Handlebars","// itself.","","/**","Compiles a Handlebars template string into a function. To render the template,","call the function and pass in a context object.","","@example",""," var template = Y.Handlebars.compile('The pie of the day is {{pie}}!.');"," template({pie: 'Pecan'});"," // => \"The pie of the day is Pecan!\"","","@method compile","@param {String} string Handlebars template string to compile.","@param {Object} [options] Compiler options.","@return {Function} Compiled template function.","*/","","/**","Precompiles a Handlebars template string into a string of JavaScript code. This","can be used to precompile a template at build time or on the server, and the","resulting template can then be rendered at runtime or on the client without","needing to go through a compile step.","","To render a precompiled template, evaluate the code and then pass the resulting","function to `Y.Handlebars.template()` to get back an executable template","function.","","@method precompile","@param {String} string Handlebars template string to compile.","@param {Object} [options] Compiler options.","@return {String} Precompiled template code.","*/","","","}, '3.7.3', {\"requires\": [\"handlebars-base\"]});"]; _yuitest_coverage["build/handlebars-compiler/handlebars-compiler.js"].lines = {"1":0,"13":0,"17":0,"18":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"112":0,"115":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"138":0,"139":0,"141":0,"142":0,"143":0,"144":0,"147":0,"148":0,"149":0,"151":0,"152":0,"154":0,"157":0,"158":0,"160":0,"163":0,"164":0,"166":0,"167":0,"170":0,"174":0,"175":0,"177":0,"178":0,"180":0,"181":0,"182":0,"184":0,"185":0,"187":0,"191":0,"196":0,"197":0,"198":0,"202":0,"203":0,"204":0,"205":0,"206":0,"210":0,"212":0,"213":0,"215":0,"216":0,"218":0,"219":0,"222":0,"223":0,"224":0,"225":0,"226":0,"230":0,"231":0,"234":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"245":0,"246":0,"247":0,"248":0,"249":0,"250":0,"252":0,"253":0,"255":0,"260":0,"263":0,"265":0,"271":0,"273":0,"274":0,"278":0,"279":0,"280":0,"281":0,"284":0,"285":0,"286":0,"288":0,"289":0,"290":0,"293":0,"298":0,"301":0,"302":0,"304":0,"305":0,"307":0,"311":0,"312":0,"313":0,"314":0,"315":0,"316":0,"317":0,"320":0,"321":0,"322":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"331":0,"332":0,"335":0,"336":0,"339":0,"342":0,"343":0,"346":0,"347":0,"348":0,"350":0,"353":0,"354":0,"355":0,"358":0,"359":0,"361":0,"363":0,"369":0,"370":0,"371":0,"373":0,"374":0,"375":0,"376":0,"377":0,"378":0,"379":0,"382":0,"383":0,"384":0,"385":0,"389":0,"390":0,"391":0,"392":0,"393":0,"394":0,"395":0,"396":0,"397":0,"398":0,"400":0,"401":0,"403":0,"408":0,"409":0,"410":0,"412":0,"416":0,"419":0,"422":0,"425":0,"428":0,"430":0,"431":0,"433":0,"434":0,"436":0,"437":0,"438":0,"440":0,"441":0,"442":0,"443":0,"444":0,"445":0,"446":0,"447":0,"448":0,"449":0,"450":0,"451":0,"452":0,"453":0,"454":0,"455":0,"456":0,"457":0,"458":0,"459":0,"460":0,"461":0,"462":0,"463":0,"464":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"473":0,"474":0,"475":0,"476":0,"477":0,"478":0,"479":0,"480":0,"481":0,"482":0,"483":0,"484":0,"485":0,"486":0,"487":0,"488":0,"489":0,"490":0,"491":0,"492":0,"495":0,"496":0,"497":0,"498":0,"499":0,"501":0,"502":0,"503":0,"504":0,"505":0,"506":0,"507":0,"508":0,"509":0,"510":0,"512":0,"514":0,"516":0,"517":0,"519":0,"523":0,"525":0,"526":0,"527":0,"530":0,"531":0,"534":0,"541":0,"547":0,"549":0,"551":0,"552":0,"553":0,"554":0,"557":0,"558":0,"559":0,"560":0,"562":0,"563":0,"567":0,"572":0,"579":0,"580":0,"584":0,"585":0,"588":0,"589":0,"590":0,"594":0,"595":0,"596":0,"597":0,"598":0,"599":0,"601":0,"602":0,"606":0,"607":0,"608":0,"611":0,"612":0,"613":0,"616":0,"617":0,"618":0,"620":0,"622":0,"623":0,"625":0,"626":0,"630":0,"631":0,"632":0,"636":0,"639":0,"640":0,"641":0,"644":0,"645":0,"646":0,"649":0,"650":0,"651":0,"654":0,"655":0,"656":0,"666":0,"667":0,"669":0,"675":0,"679":0,"681":0,"682":0,"684":0,"685":0,"687":0,"688":0,"689":0,"690":0,"691":0,"693":0,"695":0,"699":0,"705":0,"706":0,"707":0,"710":0,"711":0,"720":0,"721":0,"722":0,"726":0,"730":0,"734":0,"735":0,"737":0,"738":0,"739":0,"741":0,"743":0,"744":0,"747":0,"751":0,"752":0,"754":0,"756":0,"758":0,"759":0,"761":0,"765":0,"769":0,"773":0,"774":0,"777":0,"778":0,"781":0,"783":0,"784":0,"785":0,"786":0,"790":0,"791":0,"792":0,"793":0,"795":0,"799":0,"800":0,"801":0,"802":0,"805":0,"809":0,"811":0,"813":0,"814":0,"815":0,"817":0,"818":0,"823":0,"824":0,"826":0,"827":0,"829":0,"832":0,"833":0,"837":0,"841":0,"842":0,"844":0,"845":0,"846":0,"847":0,"849":0,"852":0,"853":0,"855":0,"860":0,"862":0,"864":0,"865":0,"867":0,"871":0,"873":0,"874":0,"876":0,"877":0,"878":0,"879":0,"882":0,"884":0,"888":0,"891":0,"892":0,"893":0,"894":0,"896":0,"901":0,"902":0,"903":0,"905":0,"906":0,"911":0,"915":0,"919":0,"926":0,"930":0,"934":0,"936":0,"937":0,"938":0,"943":0,"944":0,"945":0,"948":0,"949":0,"951":0,"952":0,"953":0,"954":0,"958":0,"959":0,"964":0,"966":0,"967":0,"969":0,"970":0,"971":0,"974":0,"975":0,"977":0,"983":0,"984":0,"986":0,"987":0,"989":0,"992":0,"997":0,"998":0,"1000":0,"1001":0,"1003":0,"1004":0,"1006":0,"1009":0,"1013":0,"1014":0,"1017":0,"1021":0,"1022":0,"1023":0,"1024":0,"1027":0,"1032":0,"1033":0,"1035":0,"1040":0,"1047":0,"1048":0,"1050":0,"1052":0,"1053":0,"1054":0,"1059":0,"1061":0,"1062":0,"1063":0,"1064":0,"1066":0,"1068":0,"1070":0,"1072":0,"1073":0,"1075":0,"1076":0,"1078":0,"1082":0,"1086":0,"1087":0,"1091":0,"1095":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1103":0,"1106":0,"1107":0,"1109":0,"1114":0,"1115":0,"1119":0,"1121":0,"1122":0,"1126":0,"1127":0,"1128":0,"1129":0,"1133":0,"1134":0,"1138":0,"1139":0,"1142":0,"1143":0,"1146":0,"1148":0,"1149":0,"1152":0,"1153":0,"1155":0,"1157":0,"1158":0,"1159":0,"1173":0,"1175":0,"1176":0,"1178":0,"1179":0,"1180":0,"1191":0,"1193":0,"1194":0,"1196":0,"1197":0,"1199":0,"1209":0,"1222":0,"1223":0,"1224":0,"1225":0,"1236":0,"1237":0,"1239":0,"1240":0,"1241":0,"1244":0,"1255":0,"1256":0,"1268":0,"1278":0,"1289":0,"1291":0,"1292":0,"1304":0,"1305":0,"1318":0,"1319":0,"1329":0,"1339":0,"1351":0,"1363":0,"1364":0,"1366":0,"1380":0,"1382":0,"1383":0,"1385":0,"1398":0,"1399":0,"1415":0,"1417":0,"1418":0,"1420":0,"1421":0,"1423":0,"1424":0,"1426":0,"1427":0,"1438":0,"1440":0,"1441":0,"1444":0,"1445":0,"1456":0,"1457":0,"1459":0,"1467":0,"1469":0,"1470":0,"1471":0,"1473":0,"1474":0,"1475":0,"1476":0,"1477":0,"1482":0,"1484":0,"1485":0,"1488":0,"1491":0,"1493":0,"1494":0,"1496":0,"1500":0,"1501":0,"1503":0,"1504":0,"1509":0,"1510":0,"1514":0,"1515":0,"1516":0,"1521":0,"1522":0,"1526":0,"1527":0,"1528":0,"1532":0,"1534":0,"1535":0,"1539":0,"1540":0,"1541":0,"1545":0,"1546":0,"1547":0,"1551":0,"1553":0,"1554":0,"1556":0,"1557":0,"1562":0,"1564":0,"1565":0,"1567":0,"1572":0,"1580":0,"1581":0,"1582":0,"1584":0,"1595":0,"1597":0,"1599":0,"1600":0,"1604":0,"1605":0,"1606":0,"1607":0,"1610":0,"1611":0,"1612":0,"1615":0,"1616":0,"1619":0,"1620":0,"1621":0,"1623":0,"1624":0,"1628":0,"1629":0,"1632":0,"1633":0,"1636":0,"1637":0,"1641":0,"1659":0,"1661":0,"1662":0,"1665":0,"1666":0,"1667":0,"1669":0,"1674":0,"1675":0,"1677":0,"1678":0,"1679":0,"1682":0,"1683":0,"1685":0,"1686":0,"1687":0,"1688":0,"1689":0,"1690":0,"1694":0,"1695":0,"1696":0,"1698":0,"1714":0,"1726":0,"1755":0,"1756":0}; _yuitest_coverage["build/handlebars-compiler/handlebars-compiler.js"].functions = {"anonymous:23":0,"parseError:111":0,"popStack:141":0,"lex:147":0,"parse:114":0,"parseError:303":0,"setInput:310":0,"input:319":0,"unput:330":0,"more:334":0,"less:338":0,"pastInput:341":0,"upcomingInput:345":0,"showPosition:352":0,"next:357":0,"lex:407":0,"begin:415":0,"popState:418":0,"_currentRules:421":0,"topState:424":0,"begin:427":0,"anonymous:431":0,"(anonymous 3):301":0,"Parser:498":0,"(anonymous 2):17":0,"parse:504":0,"commonjsMain:505":0,"parse:525":0,"print:530":0,"log:541":0,"ProgramNode:551":0,"MustacheNode:557":0,"PartialNode:579":0,"verifyMatch:588":0,"BlockNode:594":0,"ContentNode:606":0,"HashNode:611":0,"IdNode:616":0,"StringNode:639":0,"IntegerNode:644":0,"BooleanNode:649":0,"CommentNode:654":0,"(anonymous 4):547":0,"disassemble:678":0,"compile:704":0,"accept:729":0,"(anonymous 6):743":0,"program:733":0,"compileProgram:750":0,"block:768":0,"hash:808":0,"partial:822":0,"content:836":0,"mustache:840":0,"ambiguousMustache:859":0,"simpleMustache:870":0,"helperMustache:887":0,"ID:900":0,"STRING:910":0,"INTEGER:914":0,"BOOLEAN:918":0,"opcode:925":0,"declare:929":0,"addDepth:933":0,"classifyMustache:942":0,"pushParams:963":0,"setupMustacheParams:982":0,"setupFullMustacheParams:996":0,"Literal:1013":0,"nameLookup:1020":0,"appendToBuffer:1031":0,"initializeBuffer:1039":0,"compile:1046":0,"nextOpcode:1085":0,"eat:1090":0,"preamble:1094":0,"createFunctionContext:1118":0,"(anonymous 7):1178":0,"blockValue:1172":0,"ambiguousBlockValue:1190":0,"appendContent:1208":0,"append:1221":0,"appendEscaped:1235":0,"getContext:1254":0,"lookupOnContext:1267":0,"pushContext:1277":0,"(anonymous 8):1291":0,"resolvePossibleLambda:1288":0,"(anonymous 9):1304":0,"lookup:1303":0,"pushStringParam:1317":0,"pushString:1328":0,"push:1338":0,"pushLiteral:1350":0,"pushProgram:1362":0,"invokeHelper:1379":0,"invokeKnownHelper:1397":0,"invokeAmbiguous:1414":0,"invokePartial:1437":0,"assignToHash:1455":0,"compileChildren:1466":0,"programExpression:1481":0,"register:1508":0,"useRegister:1513":0,"pushStackLiteral:1520":0,"pushStack:1525":0,"replaceStack:1531":0,"nextStack:1538":0,"incrStack:1544":0,"popStack:1550":0,"topStack:1561":0,"quotedString:1571":0,"setupHelper:1579":0,"setupParams:1594":0,"isValidJavaScriptVariableName:1665":0,"(anonymous 5):669":0,"precompile:1674":0,"compile:1686":0,"(anonymous 10):1694":0,"compile:1682":0,"render:1755":0,"(anonymous 1):1":0}; _yuitest_coverage["build/handlebars-compiler/handlebars-compiler.js"].coveredLines = 799;@@ -2752,4 +2752,4 @@ */ -}, '3.7.2', {"requires": ["handlebars-base"]});+}, '3.7.3', {"requires": ["handlebars-base"]});
bundle/handlebars-compiler/handlebars-compiler-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1798,4 +1798,4 @@ */ -}, '3.7.2', {"requires": ["handlebars-base"]});+}, '3.7.3', {"requires": ["handlebars-base"]});
bundle/handlebars-compiler/handlebars-compiler-min.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -9,4 +9,4 @@ Handlebars.js - Copyright (C) 2011 Yehuda Katz https://raw.github.com/wycats/handlebars.js/master/LICENSE */-;var n=e.Handlebars,r=function(){function n(){this.yy={}}var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function(t,n,r,i,s,o,u){var a=o.length-1;switch(s){case 1:return o[a-1];case 2:this.$=new i.ProgramNode(o[a-2],o[a]);break;case 3:this.$=new i.ProgramNode(o[a]);break;case 4:this.$=new i.ProgramNode([]);break;case 5:this.$=[o[a]];break;case 6:o[a-1].push(o[a]),this.$=o[a-1];break;case 7:this.$=new i.BlockNode(o[a-2],o[a-1].inverse,o[a-1],o[a]);break;case 8:this.$=new i.BlockNode(o[a-2],o[a-1],o[a-1].inverse,o[a]);break;case 9:this.$=o[a];break;case 10:this.$=o[a];break;case 11:this.$=new i.ContentNode(o[a]);break;case 12:this.$=new i.CommentNode(o[a]);break;case 13:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 14:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 15:this.$=o[a-1];break;case 16:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 17:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1],!0);break;case 18:this.$=new i.PartialNode(o[a-1]);break;case 19:this.$=new i.PartialNode(o[a-2],o[a-1]);break;case 20:break;case 21:this.$=[[o[a-2]].concat(o[a-1]),o[a]];break;case 22:this.$=[[o[a-1]].concat(o[a]),null];break;case 23:this.$=[[o[a-1]],o[a]];break;case 24:this.$=[[o[a]],null];break;case 25:o[a-1].push(o[a]),this.$=o[a-1];break;case 26:this.$=[o[a]];break;case 27:this.$=o[a];break;case 28:this.$=new i.StringNode(o[a]);break;case 29:this.$=new i.IntegerNode(o[a]);break;case 30:this.$=new i.BooleanNode(o[a]);break;case 31:this.$=new i.HashNode(o[a]);break;case 32:o[a-1].push(o[a]),this.$=o[a-1];break;case 33:this.$=[o[a]];break;case 34:this.$=[o[a-2],o[a]];break;case 35:this.$=[o[a-2],new i.StringNode(o[a])];break;case 36:this.$=[o[a-2],new i.IntegerNode(o[a])];break;case 37:this.$=[o[a-2],new i.BooleanNode(o[a])];break;case 38:this.$=new i.IdNode(o[a]);break;case 39:o[a-2].push(o[a]),this.$=o[a-2];break;case 40:this.$=[o[a]]}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function(t,n){throw new Error(t)},parse:function(t){function d(e){r.length=r.length-2*e,i.length=i.length-e,s.length=s.length-e}function v(){var e;return e=n.lexer.lex()||1,typeof e!="number"&&(e=n.symbols_[e]||e),e}var n=this,r=[0],i=[null],s=[],o=this.table,u="",a=0,f=0,l=0,c=2,h=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var p=this.lexer.yylloc;s.push(p),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var m,g,y,b,w,E,S={},x,T,N,C;for(;;){y=r[r.length-1];if(this.defaultActions[y])b=this.defaultActions[y];else{if(m===null||typeof m=="undefined")m=v();b=o[y]&&o[y][m]}if(typeof b=="undefined"||!b.length||!b[0]){var k="";if(!l){C=[];for(x in o[y])this.terminals_[x]&&x>2&&C.push("'"+this.terminals_[x]+"'");this.lexer.showPosition?k="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[m]||m)+"'":k="Parse error on line "+(a+1)+": Unexpected "+(m==1?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:p,expected:C})}if(l==3){if(m==h)throw new Error(k||"Parsing halted.");f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,m=v()}for(;;){if(c.toString()in o[y])break;if(y===0)throw new Error(k||"Parsing halted.");d(1),y=r[r.length-1]}g=m==2?null:m,m=c,y=r[r.length-1],b=o[y]&&o[y][c],l=3}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+m);switch(b[0]){case 1:r.push(m),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(b[1]),m=null,g?(m=g,g=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:T=this.productions_[b[1]][1],S.$=i[i.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},E=this.performAction.call(S,u,f,a,this.yy,b[1],i,s);if(typeof E!="undefined")return E;T&&(r=r.slice(0,-1*T*2),i=i.slice(0,-1*T),s=s.slice(0,-1*T)),r.push(this.productions_[b[1]][0]),i.push(S.$),s.push(S._$),N=o[r[r.length-2]][r[r.length-1]],r.push(N);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r,i,s;this._more||(this.yytext="",this.match="");var o=this._currentRules();for(var u=0;u<o.length;u++){n=this._input.match(this.rules[o[u]]);if(n&&(!t||n[0].length>t[0].length)){t=n,r=u;if(!this.options.flex)break}}if(t){s=t[0].match(/\n.*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1);if(e)return e;return}return this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.options={},e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return 24;case 4:return 16;case 5:return 20;case 6:return 19;case 7:return 19;case 8:return 23;case 9:return 23;case 10:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 11:return 22;case 12:return 34;case 13:return 33;case 14:return 33;case 15:return 36;case 16:break;case 17:return this.popState(),18;case 18:return this.popState(),18;case 19:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),28;case 20:return 30;case 21:return 30;case 22:return 29;case 23:return 33;case 24:return n.yytext=n.yytext.substr(1,n.yyleng-2),33;case 25:return"INVALID";case 26:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],e.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:!1},emu:{rules:[2],inclusive:!1},INITIAL:{rules:[0,1,26],inclusive:!0}},e}();return e.lexer=t,n.prototype=e,e.Parser=n,new n}();typeof require!="undefined"&&typeof exports!="undefined"&&(exports.parser=r,exports.Parser=r.Parser,exports.parse=function(){return r.parse.apply(r,arguments)},exports.main=function(t){if(!t[1])throw new Error("Usage: "+t[0]+" FILE");var n,r;return typeof process!="undefined"?n=require("fs").readFileSync(require("path").resolve(t[1]),"utf8"):n=require("file").path(require("file").cwd()).join(t[1]).read({charset:"utf-8"}),exports.parser.parse(n)},typeof module!="undefined"&&require.main===module&&exports.main(typeof process!="undefined"?process.argv.slice(1):require("system").args)),n.Parser=r,n.parse=function(e){return n.Parser.yy=n.AST,n.Parser.parse(e)},n.print=function(e){return(new n.PrintVisitor).accept(e)},n.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){}},n.log=function(e,t){n.logger.log(e,t)},function(){n.AST={},n.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new n.AST.ProgramNode(t))},n.AST.MustacheNode=function(e,t,n){this.type="mustache",this.escaped=!n,this.hash=t;var r=this.id=e[0],i=this.params=e.slice(1),s=this.eligibleHelper=r.isSimple;this.isHelper=s&&(i.length||t)},n.AST.PartialNode=function(e,t){this.type="partial",this.id=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new n.Exception(e.original+" doesn't match "+t.original)};n.AST.BlockNode=function(t,n,r,i){e(t.id,i),this.type="block",this.mustache=t,this.program=n,this.inverse=r,this.inverse&&!this.program&&(this.isInverse=!0)},n.AST.ContentNode=function(e){this.type="content",this.string=e},n.AST.HashNode=function(e){this.type="hash",this.pairs=e},n.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r<i;r++){var s=e[r];s===".."?n++:s==="."||s==="this"?this.isScoped=!0:t.push(s)}this.parts=t,this.string=t.join("."),this.depth=n,this.isSimple=e.length===1&&!this.isScoped&&n===0},n.AST.StringNode=function(e){this.type="STRING",this.string=e},n.AST.IntegerNode=function(e){this.type="INTEGER",this.integer=e},n.AST.BooleanNode=function(e){this.type="BOOLEAN",this.bool=e},n.AST.CommentNode=function(e){this.type="comment",this.comment=e}}(),n.Compiler=function(){},n.JavaScriptCompiler=function(){},function(e,t){e.prototype={compiler:e,disassemble:function(){var e=this.opcodes,t,n=[],r,i;for(var s=0,o=e.length;s<o;s++){t=e[s];if(t.opcode==="DECLARE")n.push("DECLARE "+t.name+"="+t.value);else{r=[];for(var u=0;u<t.args.length;u++)i=t.args[u],typeof i=="string"&&(i='"'+i.replace("\n","\\n")+'"'),r.push(i);n.push(t.opcode+" "+r.join(" "))}}return n.join("\n")},guid:0,compile:function(e,t){this.children=[],this.depths={list:[]},this.options=t;var n=this.options.knownHelpers;this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0};if(n)for(var r in n)this.options.knownHelpers[r]=n[r];return this.program(e)},accept:function(e){return this[e.type](e)},program:function(e){var t=e.statements,n;this.opcodes=[];for(var r=0,i=t.length;r<i;r++)n=t[r],this[n.type](n);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(e,t){return e-t}),this},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),n=this.guid++,r;this.usePartial=this.usePartial||t.usePartial,this.children[n]=t;for(var i=0,s=t.depths.list.length;i<s;i++){r=t.depths.list[i];if(r<2)continue;this.addDepth(r-1)}return n},block:function(e){var t=e.mustache,n=e.program,r=e.inverse;n&&(n=this.compileProgram(n)),r&&(r=this.compileProgram(r));var i=this.classifyMustache(t);i==="helper"?this.helperMustache(t,n,r):i==="simple"?(this.simpleMustache(t),this.opcode("pushProgram",n),this.opcode("pushProgram",r),this.opcode("pushLiteral","{}"),this.opcode("blockValue")):(this.ambiguousMustache(t,n,r),this.opcode("pushProgram",n),this.opcode("pushProgram",r),this.opcode("pushLiteral","{}"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(e){var t=e.pairs,n,r;this.opcode("push","{}");for(var i=0,s=t.length;i<s;i++)n=t[i],r=n[1],this.accept(r),this.opcode("assignToHash",n[0])},partial:function(e){var t=e.id;this.usePartial=!0,e.context?this.ID(e.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.original),this.opcode("append")},content:function(e){this.opcode("appendContent",e.string)},mustache:function(e){var t=this.options,n=this.classifyMustache(e);n==="simple"?this.simpleMustache(e):n==="helper"?this.helperMustache(e):this.ambiguousMustache(e),e.escaped&&!t.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousMustache:function(e,t,n){var r=e.id,i=r.parts[0];this.opcode("getContext",r.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",n),this.opcode("invokeAmbiguous",i)},simpleMustache:function(e,t,n){var r=e.id;this.addDepth(r.depth),this.opcode("getContext",r.depth);if(r.parts.length){this.opcode("lookupOnContext",r.parts[0]);for(var i=1,s=r.parts.length;i<s;i++)this.opcode("lookup",r.parts[i])}else this.opcode("pushContext");this.opcode("resolvePossibleLambda")},helperMustache:function(e,t,n){var r=this.setupFullMustacheParams(e,t,n),i=e.id.parts[0];if(this.options.knownHelpers[i])this.opcode("invokeKnownHelper",r.length,i);else{if(this.knownHelpersOnly)throw new Error("You specified knownHelpersOnly, but used the unknown helper "+i);this.opcode("invokeHelper",r.length,i)}},ID:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth),this.opcode("lookupOnContext",e.parts[0]);for(var t=1,n=e.parts.length;t<n;t++)this.opcode("lookup",e.parts[t])},STRING:function(e){this.opcode("pushString",e.string)},INTEGER:function(e){this.opcode("pushLiteral",e.integer)},BOOLEAN:function(e){this.opcode("pushLiteral",e.bool)},comment:function(){},opcode:function(e){this.opcodes.push({opcode:e,args:[].slice.call(arguments,1)})},declare:function(e,t){this.opcodes.push({opcode:"DECLARE",name:e,value:t})},addDepth:function(e){if(e===0)return;this.depths[e]||(this.depths[e]=!0,this.depths.list.push(e))},classifyMustache:function(e){var t=e.isHelper,n=e.eligibleHelper,r=this.options;if(n&&!t){var i=e.id.parts[0];r.knownHelpers[i]?t=!0:r.knownHelpersOnly&&(n=!1)}return t?"helper":n?"ambiguous":"simple"},pushParams:function(e){var t=e.length,n;while(t--)n=e[t],this.options.stringParams?(n.depth&&this.addDepth(n.depth),this.opcode("getContext",n.depth||0),this.opcode("pushStringParam",n.string)):this[n.type](n)},setupMustacheParams:function(e){var t=e.params;return this.pushParams(t),e.hash?this.hash(e.hash):this.opcode("pushLiteral","{}"),t},setupFullMustacheParams:function(e,t,n){var r=e.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",n),e.hash?this.hash(e.hash):this.opcode("pushLiteral","{}"),r}};var r=function(e){this.value=e};t.prototype={nameLookup:function(e,n,r){return/^[0-9]+$/.test(n)?e+"["+n+"]":t.isValidJavaScriptVariableName(n)?e+"."+n:e+"['"+n+"']"},appendToBuffer:function(e){return this.environment.isSimple?"return "+e+";":"buffer += "+e+";"},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(e,t,r,i){this.environment=e,this.options=t||{},n.log(n.logger.DEBUG,this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!r,this.context=r||{programs:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.compileStack=[],this.compileChildren(e,t);var s=e.opcodes,o;this.i=0;for(u=s.length;this.i<u;this.i++)o=s[this.i],o.opcode==="DECLARE"?this[o.name]=o.value:this[o.opcode].apply(this,o.args);return this.createFunctionContext(i)},nextOpcode:function(){var e=this.environment.opcodes,t=e[this.i+1];return e[this.i+1]},eat:function(e){this.i=this.i+1},preamble:function(){var e=[];if(!this.isChild){var t=this.namespace,n="helpers = helpers || "+t+".helpers;";this.environment.usePartial&&(n=n+" partials = partials || "+t+".partials;"),e.push(n)}else e.push("");this.environment.isSimple?e.push(""):e.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=e},createFunctionContext:function(e){var t=this.stackVars.concat(this.registers.list);t.length>0&&(this.source[1]=this.source[1]+", "+t.join(", "));if(!this.isChild){var r=[];for(var i in this.context.aliases)this.source[1]=this.source[1]+", "+i+"="+this.context.aliases[i]}this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.source.push("return buffer;");var s=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var o=0,u=this.environment.depths.list.length;o<u;o++)s.push("depth"+this.environment.depths.list[o]);if(e)return s.push(this.source.join("\n ")),Function.apply(this,s);var a="function "+(this.name||"")+"("+s.join(",")+") {\n "+this.source.join("\n ")+"}";return n.log(n.logger.DEBUG,a+"\n\n"),a},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var e=["depth0"];this.setupParams(0,e),this.replaceStack(function(t){return e.splice(1,0,t),t+" = blockHelperMissing.call("+e.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var e=["depth0"];this.setupParams(0,e);var t=this.topStack();e.splice(1,0,t),this.source.push("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+e.join(", ")+"); }")},appendContent:function(e){this.source.push(this.appendToBuffer(this.quotedString(e)))},append:function(){var e=this.popStack();this.source.push("if("+e+" || "+e+" === 0) { "+this.appendToBuffer(e)+" }"),this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){var e=this.nextOpcode(),t="";this.context.aliases.escapeExpression="this.escapeExpression",e&&e.opcode==="appendContent"&&(t=" + "+this.quotedString(e.args[0]),this.eat(e)),this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+t))},getContext:function(e){this.lastContext!==e&&(this.lastContext=e)},lookupOnContext:function(e){this.pushStack(this.nameLookup("depth"+this.lastContext,e,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(e){return"typeof "+e+" === functionType ? "+e+"() : "+e})},lookup:function(e){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,e,"context")})},pushStringParam:function(e){this.pushStackLiteral("depth"+this.lastContext),this.pushString(e)},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},push:function(e){this.pushStack(e)},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},invokeHelper:function(e,t){this.context.aliases.helperMissing="helpers.helperMissing";var n=this.lastHelper=this.setupHelper(e,t);this.register("foundHelper",n.name),this.pushStack("foundHelper ? foundHelper.call("+n.callParams+") "+": helperMissing.call("+n.helperMissingParams+")")},invokeKnownHelper:function(e,t){var n=this.setupHelper(e,t);this.pushStack(n.name+".call("+n.callParams+")")},invokeAmbiguous:function(e){this.context.aliases.functionType='"function"',this.pushStackLiteral("{}");var t=this.setupHelper(0,e),n=this.lastHelper=this.nameLookup("helpers",e,"helper");this.register("foundHelper",n);var r=this.nameLookup("depth"+this.lastContext,e,"context"),i=this.nextStack();this.source.push("if (foundHelper) { "+i+" = foundHelper.call("+t.callParams+"); }"),this.source.push("else { "+i+" = "+r+"; "+i+" = typeof "+i+" === functionType ? "+i+"() : "+i+"; }")},invokePartial:function(e){var t=[this.nameLookup("partials",e,"partial"),"'"+e+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data"),this.context.aliases.self="this",this.pushStack("self.invokePartial("+t.join(", ")+");")},assignToHash:function(e){var t=this.popStack(),n=this.topStack();this.source.push(n+"['"+e+"'] = "+t+";")},compiler:t,compileChildren:function(e,t){var n=e.children,r,i;for(var s=0,o=n.length;s<o;s++){r=n[s],i=new this.compiler,this.context.programs.push("");var u=this.context.programs.length;r.index=u,r.name="program"+u,this.context.programs[u]=i.compile(r,t,this.context)}},programExpression:function(e){this.context.aliases.self="this";if(e==null)return"self.noop";var t=this.environment.children[e],n=t.depths.list,r,i=[t.index,t.name,"data"];for(var s=0,o=n.length;s<o;s++)r=n[s],r===1?i.push("depth0"):i.push("depth"+(r-1));return n.length===0?"self.program("+i.join(", ")+")":(i.shift(),"self.programWithDepth("+i.join(", ")+")")},register:function(e,t){this.useRegister(e),this.source.push(e+" = "+t+";")},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},pushStackLiteral:function(e){return this.compileStack.push(new r(e)),e},pushStack:function(e){return this.source.push(this.incrStack()+" = "+e+";"),this.compileStack.push("stack"+this.stackSlot),"stack"+this.stackSlot},replaceStack:function(e){var t=e.call(this,this.topStack());return this.source.push(this.topStack()+" = "+t+";"),"stack"+this.stackSlot},nextStack:function(e){var t=this.incrStack();return this.compileStack.push("stack"+this.stackSlot),t},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){var e=this.compileStack.pop();return e instanceof r?e.value:(this.stackSlot--,e)},topStack:function(){var e=this.compileStack[this.compileStack.length-1];return e instanceof r?e.value:e},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'},setupHelper:function(e,t){var n=[];this.setupParams(e,n);var r=this.nameLookup("helpers",t,"helper");return{params:n,name:r,callParams:["depth0"].concat(n).join(", "),helperMissingParams:["depth0",this.quotedString(t)].concat(n).join(", ")}},setupParams:function(e,t){var n=[],r=[],i,s,o;n.push("hash:"+this.popStack()),s=this.popStack(),o=this.popStack();if(o||s)o||(this.context.aliases.self="this",o="self.noop"),s||(this.context.aliases.self="this",s="self.noop"),n.push("inverse:"+s),n.push("fn:"+o);for(var u=0;u<e;u++)i=this.popStack(),t.push(i),this.options.stringParams&&r.push(this.popStack());return this.options.stringParams&&n.push("contexts:["+r.join(",")+"]"),this.options.data&&n.push("data:data"),t.push("{"+n.join(",")+"}"),t.join(", ")}};var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=t.RESERVED_WORDS={};for(var o=0,u=i.length;o<u;o++)s[i[o]]=!0;t.isValidJavaScriptVariableName=function(e){return!t.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e)?!0:!1}}(n.Compiler,n.JavaScriptCompiler),n.precompile=function(e,t){t=t||{};var r=n.parse(e),i=(new n.Compiler).compile(r,t);return(new n.JavaScriptCompiler).compile(i,t)},n.compile=function(e,t){function i(){var r=n.parse(e),i=(new n.Compiler).compile(r,t),s=(new n.JavaScriptCompiler).compile(i,t,undefined,!0);return n.template(s)}t=t||{};var r;return function(e,t){return r||(r=i()),r.call(this,e,t)}};var i=["debug","info","warn","error"];n.logger.log=function(e,t){},n.render=function(e,t,r){return n.compile(e)(t,r)}},"3.7.2",{requires:["handlebars-base"]});+;var n=e.Handlebars,r=function(){function n(){this.yy={}}var e={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,statements:6,simpleInverse:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,OPEN_PARTIAL:24,params:25,hash:26,param:27,STRING:28,INTEGER:29,BOOLEAN:30,hashSegments:31,hashSegment:32,ID:33,EQUALS:34,pathSegments:35,SEP:36,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"OPEN_PARTIAL",28:"STRING",29:"INTEGER",30:"BOOLEAN",33:"ID",34:"EQUALS",36:"SEP"},productions_:[0,[3,2],[4,3],[4,1],[4,0],[6,1],[6,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[7,2],[17,3],[17,2],[17,2],[17,1],[25,2],[25,1],[27,1],[27,1],[27,1],[27,1],[26,1],[31,2],[31,1],[32,3],[32,3],[32,3],[32,3],[21,1],[35,3],[35,1]],performAction:function(t,n,r,i,s,o,u){var a=o.length-1;switch(s){case 1:return o[a-1];case 2:this.$=new i.ProgramNode(o[a-2],o[a]);break;case 3:this.$=new i.ProgramNode(o[a]);break;case 4:this.$=new i.ProgramNode([]);break;case 5:this.$=[o[a]];break;case 6:o[a-1].push(o[a]),this.$=o[a-1];break;case 7:this.$=new i.BlockNode(o[a-2],o[a-1].inverse,o[a-1],o[a]);break;case 8:this.$=new i.BlockNode(o[a-2],o[a-1],o[a-1].inverse,o[a]);break;case 9:this.$=o[a];break;case 10:this.$=o[a];break;case 11:this.$=new i.ContentNode(o[a]);break;case 12:this.$=new i.CommentNode(o[a]);break;case 13:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 14:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 15:this.$=o[a-1];break;case 16:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1]);break;case 17:this.$=new i.MustacheNode(o[a-1][0],o[a-1][1],!0);break;case 18:this.$=new i.PartialNode(o[a-1]);break;case 19:this.$=new i.PartialNode(o[a-2],o[a-1]);break;case 20:break;case 21:this.$=[[o[a-2]].concat(o[a-1]),o[a]];break;case 22:this.$=[[o[a-1]].concat(o[a]),null];break;case 23:this.$=[[o[a-1]],o[a]];break;case 24:this.$=[[o[a]],null];break;case 25:o[a-1].push(o[a]),this.$=o[a-1];break;case 26:this.$=[o[a]];break;case 27:this.$=o[a];break;case 28:this.$=new i.StringNode(o[a]);break;case 29:this.$=new i.IntegerNode(o[a]);break;case 30:this.$=new i.BooleanNode(o[a]);break;case 31:this.$=new i.HashNode(o[a]);break;case 32:o[a-1].push(o[a]),this.$=o[a-1];break;case 33:this.$=[o[a]];break;case 34:this.$=[o[a-2],o[a]];break;case 35:this.$=[o[a-2],new i.StringNode(o[a])];break;case 36:this.$=[o[a-2],new i.IntegerNode(o[a])];break;case 37:this.$=[o[a-2],new i.BooleanNode(o[a])];break;case 38:this.$=new i.IdNode(o[a]);break;case 39:o[a-2].push(o[a]),this.$=o[a-2];break;case 40:this.$=[o[a]]}},table:[{3:1,4:2,5:[2,4],6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{1:[3]},{5:[1,16]},{5:[2,3],7:17,8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,19],20:[2,3],22:[1,13],23:[1,14],24:[1,15]},{5:[2,5],14:[2,5],15:[2,5],16:[2,5],19:[2,5],20:[2,5],22:[2,5],23:[2,5],24:[2,5]},{4:20,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{4:21,6:3,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,4],22:[1,13],23:[1,14],24:[1,15]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],24:[2,9]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],24:[2,10]},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],24:[2,11]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],24:[2,12]},{17:22,21:23,33:[1,25],35:24},{17:26,21:23,33:[1,25],35:24},{17:27,21:23,33:[1,25],35:24},{17:28,21:23,33:[1,25],35:24},{21:29,33:[1,25],35:24},{1:[2,1]},{6:30,8:4,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],22:[1,13],23:[1,14],24:[1,15]},{5:[2,6],14:[2,6],15:[2,6],16:[2,6],19:[2,6],20:[2,6],22:[2,6],23:[2,6],24:[2,6]},{17:22,18:[1,31],21:23,33:[1,25],35:24},{10:32,20:[1,33]},{10:34,20:[1,33]},{18:[1,35]},{18:[2,24],21:40,25:36,26:37,27:38,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,38],28:[2,38],29:[2,38],30:[2,38],33:[2,38],36:[1,46]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],36:[2,40]},{18:[1,47]},{18:[1,48]},{18:[1,49]},{18:[1,50],21:51,33:[1,25],35:24},{5:[2,2],8:18,9:5,11:6,12:7,13:8,14:[1,9],15:[1,10],16:[1,12],19:[1,11],20:[2,2],22:[1,13],23:[1,14],24:[1,15]},{14:[2,20],15:[2,20],16:[2,20],19:[2,20],22:[2,20],23:[2,20],24:[2,20]},{5:[2,7],14:[2,7],15:[2,7],16:[2,7],19:[2,7],20:[2,7],22:[2,7],23:[2,7],24:[2,7]},{21:52,33:[1,25],35:24},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],24:[2,8]},{14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],24:[2,14]},{18:[2,22],21:40,26:53,27:54,28:[1,41],29:[1,42],30:[1,43],31:39,32:44,33:[1,45],35:24},{18:[2,23]},{18:[2,26],28:[2,26],29:[2,26],30:[2,26],33:[2,26]},{18:[2,31],32:55,33:[1,56]},{18:[2,27],28:[2,27],29:[2,27],30:[2,27],33:[2,27]},{18:[2,28],28:[2,28],29:[2,28],30:[2,28],33:[2,28]},{18:[2,29],28:[2,29],29:[2,29],30:[2,29],33:[2,29]},{18:[2,30],28:[2,30],29:[2,30],30:[2,30],33:[2,30]},{18:[2,33],33:[2,33]},{18:[2,40],28:[2,40],29:[2,40],30:[2,40],33:[2,40],34:[1,57],36:[2,40]},{33:[1,58]},{14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],24:[2,13]},{5:[2,16],14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],24:[2,16]},{5:[2,17],14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],24:[2,17]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],24:[2,18]},{18:[1,59]},{18:[1,60]},{18:[2,21]},{18:[2,25],28:[2,25],29:[2,25],30:[2,25],33:[2,25]},{18:[2,32],33:[2,32]},{34:[1,57]},{21:61,28:[1,62],29:[1,63],30:[1,64],33:[1,25],35:24},{18:[2,39],28:[2,39],29:[2,39],30:[2,39],33:[2,39],36:[2,39]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],24:[2,19]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],24:[2,15]},{18:[2,34],33:[2,34]},{18:[2,35],33:[2,35]},{18:[2,36],33:[2,36]},{18:[2,37],33:[2,37]}],defaultActions:{16:[2,1],37:[2,23],53:[2,21]},parseError:function(t,n){throw new Error(t)},parse:function(t){function d(e){r.length=r.length-2*e,i.length=i.length-e,s.length=s.length-e}function v(){var e;return e=n.lexer.lex()||1,typeof e!="number"&&(e=n.symbols_[e]||e),e}var n=this,r=[0],i=[null],s=[],o=this.table,u="",a=0,f=0,l=0,c=2,h=1;this.lexer.setInput(t),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={});var p=this.lexer.yylloc;s.push(p),typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError);var m,g,y,b,w,E,S={},x,T,N,C;for(;;){y=r[r.length-1];if(this.defaultActions[y])b=this.defaultActions[y];else{if(m===null||typeof m=="undefined")m=v();b=o[y]&&o[y][m]}if(typeof b=="undefined"||!b.length||!b[0]){var k="";if(!l){C=[];for(x in o[y])this.terminals_[x]&&x>2&&C.push("'"+this.terminals_[x]+"'");this.lexer.showPosition?k="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[m]||m)+"'":k="Parse error on line "+(a+1)+": Unexpected "+(m==1?"end of input":"'"+(this.terminals_[m]||m)+"'"),this.parseError(k,{text:this.lexer.match,token:this.terminals_[m]||m,line:this.lexer.yylineno,loc:p,expected:C})}if(l==3){if(m==h)throw new Error(k||"Parsing halted.");f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,m=v()}for(;;){if(c.toString()in o[y])break;if(y===0)throw new Error(k||"Parsing halted.");d(1),y=r[r.length-1]}g=m==2?null:m,m=c,y=r[r.length-1],b=o[y]&&o[y][c],l=3}if(b[0]instanceof Array&&b.length>1)throw new Error("Parse Error: multiple actions possible at state: "+y+", token: "+m);switch(b[0]){case 1:r.push(m),i.push(this.lexer.yytext),s.push(this.lexer.yylloc),r.push(b[1]),m=null,g?(m=g,g=null):(f=this.lexer.yyleng,u=this.lexer.yytext,a=this.lexer.yylineno,p=this.lexer.yylloc,l>0&&l--);break;case 2:T=this.productions_[b[1]][1],S.$=i[i.length-T],S._$={first_line:s[s.length-(T||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(T||1)].first_column,last_column:s[s.length-1].last_column},E=this.performAction.call(S,u,f,a,this.yy,b[1],i,s);if(typeof E!="undefined")return E;T&&(r=r.slice(0,-1*T*2),i=i.slice(0,-1*T),s=s.slice(0,-1*T)),r.push(this.productions_[b[1]][0]),i.push(S.$),s.push(S._$),N=o[r[r.length-2]][r[r.length-1]],r.push(N);break;case 3:return!0}}return!0}},t=function(){var e={EOF:1,parseError:function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.match+=e,this.matched+=e;var t=e.match(/\n/);return t&&this.yylineno++,this._input=this._input.slice(1),e},unput:function(e){return this._input=e+this._input,this},more:function(){return this._more=!0,this},less:function(e){this._input=this.match.slice(e)+this._input},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=(new Array(e.length+1)).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,r,i,s;this._more||(this.yytext="",this.match="");var o=this._currentRules();for(var u=0;u<o.length;u++){n=this._input.match(this.rules[o[u]]);if(n&&(!t||n[0].length>t[0].length)){t=n,r=u;if(!this.options.flex)break}}if(t){s=t[0].match(/\n.*/g),s&&(this.yylineno+=s.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-1:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.yyleng=this.yytext.length,this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,o[r],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1);if(e)return e;return}return this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return typeof t!="undefined"?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(t){this.begin(t)}};return e.options={},e.performAction=function(t,n,r,i){var s=i;switch(r){case 0:n.yytext.slice(-1)!=="\\"&&this.begin("mu"),n.yytext.slice(-1)==="\\"&&(n.yytext=n.yytext.substr(0,n.yyleng-1),this.begin("emu"));if(n.yytext)return 14;break;case 1:return 14;case 2:return this.popState(),14;case 3:return 24;case 4:return 16;case 5:return 20;case 6:return 19;case 7:return 19;case 8:return 23;case 9:return 23;case 10:return n.yytext=n.yytext.substr(3,n.yyleng-5),this.popState(),15;case 11:return 22;case 12:return 34;case 13:return 33;case 14:return 33;case 15:return 36;case 16:break;case 17:return this.popState(),18;case 18:return this.popState(),18;case 19:return n.yytext=n.yytext.substr(1,n.yyleng-2).replace(/\\"/g,'"'),28;case 20:return 30;case 21:return 30;case 22:return 29;case 23:return 33;case 24:return n.yytext=n.yytext.substr(1,n.yyleng-2),33;case 25:return"INVALID";case 26:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{)))/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[} ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:[0-9]+(?=[}\s]))/,/^(?:[a-zA-Z0-9_$-]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],e.conditions={mu:{rules:[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26],inclusive:!1},emu:{rules:[2],inclusive:!1},INITIAL:{rules:[0,1,26],inclusive:!0}},e}();return e.lexer=t,n.prototype=e,e.Parser=n,new n}();typeof require!="undefined"&&typeof exports!="undefined"&&(exports.parser=r,exports.Parser=r.Parser,exports.parse=function(){return r.parse.apply(r,arguments)},exports.main=function(t){if(!t[1])throw new Error("Usage: "+t[0]+" FILE");var n,r;return typeof process!="undefined"?n=require("fs").readFileSync(require("path").resolve(t[1]),"utf8"):n=require("file").path(require("file").cwd()).join(t[1]).read({charset:"utf-8"}),exports.parser.parse(n)},typeof module!="undefined"&&require.main===module&&exports.main(typeof process!="undefined"?process.argv.slice(1):require("system").args)),n.Parser=r,n.parse=function(e){return n.Parser.yy=n.AST,n.Parser.parse(e)},n.print=function(e){return(new n.PrintVisitor).accept(e)},n.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){}},n.log=function(e,t){n.logger.log(e,t)},function(){n.AST={},n.AST.ProgramNode=function(e,t){this.type="program",this.statements=e,t&&(this.inverse=new n.AST.ProgramNode(t))},n.AST.MustacheNode=function(e,t,n){this.type="mustache",this.escaped=!n,this.hash=t;var r=this.id=e[0],i=this.params=e.slice(1),s=this.eligibleHelper=r.isSimple;this.isHelper=s&&(i.length||t)},n.AST.PartialNode=function(e,t){this.type="partial",this.id=e,this.context=t};var e=function(e,t){if(e.original!==t.original)throw new n.Exception(e.original+" doesn't match "+t.original)};n.AST.BlockNode=function(t,n,r,i){e(t.id,i),this.type="block",this.mustache=t,this.program=n,this.inverse=r,this.inverse&&!this.program&&(this.isInverse=!0)},n.AST.ContentNode=function(e){this.type="content",this.string=e},n.AST.HashNode=function(e){this.type="hash",this.pairs=e},n.AST.IdNode=function(e){this.type="ID",this.original=e.join(".");var t=[],n=0;for(var r=0,i=e.length;r<i;r++){var s=e[r];s===".."?n++:s==="."||s==="this"?this.isScoped=!0:t.push(s)}this.parts=t,this.string=t.join("."),this.depth=n,this.isSimple=e.length===1&&!this.isScoped&&n===0},n.AST.StringNode=function(e){this.type="STRING",this.string=e},n.AST.IntegerNode=function(e){this.type="INTEGER",this.integer=e},n.AST.BooleanNode=function(e){this.type="BOOLEAN",this.bool=e},n.AST.CommentNode=function(e){this.type="comment",this.comment=e}}(),n.Compiler=function(){},n.JavaScriptCompiler=function(){},function(e,t){e.prototype={compiler:e,disassemble:function(){var e=this.opcodes,t,n=[],r,i;for(var s=0,o=e.length;s<o;s++){t=e[s];if(t.opcode==="DECLARE")n.push("DECLARE "+t.name+"="+t.value);else{r=[];for(var u=0;u<t.args.length;u++)i=t.args[u],typeof i=="string"&&(i='"'+i.replace("\n","\\n")+'"'),r.push(i);n.push(t.opcode+" "+r.join(" "))}}return n.join("\n")},guid:0,compile:function(e,t){this.children=[],this.depths={list:[]},this.options=t;var n=this.options.knownHelpers;this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0};if(n)for(var r in n)this.options.knownHelpers[r]=n[r];return this.program(e)},accept:function(e){return this[e.type](e)},program:function(e){var t=e.statements,n;this.opcodes=[];for(var r=0,i=t.length;r<i;r++)n=t[r],this[n.type](n);return this.isSimple=i===1,this.depths.list=this.depths.list.sort(function(e,t){return e-t}),this},compileProgram:function(e){var t=(new this.compiler).compile(e,this.options),n=this.guid++,r;this.usePartial=this.usePartial||t.usePartial,this.children[n]=t;for(var i=0,s=t.depths.list.length;i<s;i++){r=t.depths.list[i];if(r<2)continue;this.addDepth(r-1)}return n},block:function(e){var t=e.mustache,n=e.program,r=e.inverse;n&&(n=this.compileProgram(n)),r&&(r=this.compileProgram(r));var i=this.classifyMustache(t);i==="helper"?this.helperMustache(t,n,r):i==="simple"?(this.simpleMustache(t),this.opcode("pushProgram",n),this.opcode("pushProgram",r),this.opcode("pushLiteral","{}"),this.opcode("blockValue")):(this.ambiguousMustache(t,n,r),this.opcode("pushProgram",n),this.opcode("pushProgram",r),this.opcode("pushLiteral","{}"),this.opcode("ambiguousBlockValue")),this.opcode("append")},hash:function(e){var t=e.pairs,n,r;this.opcode("push","{}");for(var i=0,s=t.length;i<s;i++)n=t[i],r=n[1],this.accept(r),this.opcode("assignToHash",n[0])},partial:function(e){var t=e.id;this.usePartial=!0,e.context?this.ID(e.context):this.opcode("push","depth0"),this.opcode("invokePartial",t.original),this.opcode("append")},content:function(e){this.opcode("appendContent",e.string)},mustache:function(e){var t=this.options,n=this.classifyMustache(e);n==="simple"?this.simpleMustache(e):n==="helper"?this.helperMustache(e):this.ambiguousMustache(e),e.escaped&&!t.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousMustache:function(e,t,n){var r=e.id,i=r.parts[0];this.opcode("getContext",r.depth),this.opcode("pushProgram",t),this.opcode("pushProgram",n),this.opcode("invokeAmbiguous",i)},simpleMustache:function(e,t,n){var r=e.id;this.addDepth(r.depth),this.opcode("getContext",r.depth);if(r.parts.length){this.opcode("lookupOnContext",r.parts[0]);for(var i=1,s=r.parts.length;i<s;i++)this.opcode("lookup",r.parts[i])}else this.opcode("pushContext");this.opcode("resolvePossibleLambda")},helperMustache:function(e,t,n){var r=this.setupFullMustacheParams(e,t,n),i=e.id.parts[0];if(this.options.knownHelpers[i])this.opcode("invokeKnownHelper",r.length,i);else{if(this.knownHelpersOnly)throw new Error("You specified knownHelpersOnly, but used the unknown helper "+i);this.opcode("invokeHelper",r.length,i)}},ID:function(e){this.addDepth(e.depth),this.opcode("getContext",e.depth),this.opcode("lookupOnContext",e.parts[0]);for(var t=1,n=e.parts.length;t<n;t++)this.opcode("lookup",e.parts[t])},STRING:function(e){this.opcode("pushString",e.string)},INTEGER:function(e){this.opcode("pushLiteral",e.integer)},BOOLEAN:function(e){this.opcode("pushLiteral",e.bool)},comment:function(){},opcode:function(e){this.opcodes.push({opcode:e,args:[].slice.call(arguments,1)})},declare:function(e,t){this.opcodes.push({opcode:"DECLARE",name:e,value:t})},addDepth:function(e){if(e===0)return;this.depths[e]||(this.depths[e]=!0,this.depths.list.push(e))},classifyMustache:function(e){var t=e.isHelper,n=e.eligibleHelper,r=this.options;if(n&&!t){var i=e.id.parts[0];r.knownHelpers[i]?t=!0:r.knownHelpersOnly&&(n=!1)}return t?"helper":n?"ambiguous":"simple"},pushParams:function(e){var t=e.length,n;while(t--)n=e[t],this.options.stringParams?(n.depth&&this.addDepth(n.depth),this.opcode("getContext",n.depth||0),this.opcode("pushStringParam",n.string)):this[n.type](n)},setupMustacheParams:function(e){var t=e.params;return this.pushParams(t),e.hash?this.hash(e.hash):this.opcode("pushLiteral","{}"),t},setupFullMustacheParams:function(e,t,n){var r=e.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",n),e.hash?this.hash(e.hash):this.opcode("pushLiteral","{}"),r}};var r=function(e){this.value=e};t.prototype={nameLookup:function(e,n,r){return/^[0-9]+$/.test(n)?e+"["+n+"]":t.isValidJavaScriptVariableName(n)?e+"."+n:e+"['"+n+"']"},appendToBuffer:function(e){return this.environment.isSimple?"return "+e+";":"buffer += "+e+";"},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(e,t,r,i){this.environment=e,this.options=t||{},n.log(n.logger.DEBUG,this.environment.disassemble()+"\n\n"),this.name=this.environment.name,this.isChild=!!r,this.context=r||{programs:[],aliases:{}},this.preamble(),this.stackSlot=0,this.stackVars=[],this.registers={list:[]},this.compileStack=[],this.compileChildren(e,t);var s=e.opcodes,o;this.i=0;for(u=s.length;this.i<u;this.i++)o=s[this.i],o.opcode==="DECLARE"?this[o.name]=o.value:this[o.opcode].apply(this,o.args);return this.createFunctionContext(i)},nextOpcode:function(){var e=this.environment.opcodes,t=e[this.i+1];return e[this.i+1]},eat:function(e){this.i=this.i+1},preamble:function(){var e=[];if(!this.isChild){var t=this.namespace,n="helpers = helpers || "+t+".helpers;";this.environment.usePartial&&(n=n+" partials = partials || "+t+".partials;"),e.push(n)}else e.push("");this.environment.isSimple?e.push(""):e.push(", buffer = "+this.initializeBuffer()),this.lastContext=0,this.source=e},createFunctionContext:function(e){var t=this.stackVars.concat(this.registers.list);t.length>0&&(this.source[1]=this.source[1]+", "+t.join(", "));if(!this.isChild){var r=[];for(var i in this.context.aliases)this.source[1]=this.source[1]+", "+i+"="+this.context.aliases[i]}this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.source.push("return buffer;");var s=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];for(var o=0,u=this.environment.depths.list.length;o<u;o++)s.push("depth"+this.environment.depths.list[o]);if(e)return s.push(this.source.join("\n ")),Function.apply(this,s);var a="function "+(this.name||"")+"("+s.join(",")+") {\n "+this.source.join("\n ")+"}";return n.log(n.logger.DEBUG,a+"\n\n"),a},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var e=["depth0"];this.setupParams(0,e),this.replaceStack(function(t){return e.splice(1,0,t),t+" = blockHelperMissing.call("+e.join(", ")+")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var e=["depth0"];this.setupParams(0,e);var t=this.topStack();e.splice(1,0,t),this.source.push("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+e.join(", ")+"); }")},appendContent:function(e){this.source.push(this.appendToBuffer(this.quotedString(e)))},append:function(){var e=this.popStack();this.source.push("if("+e+" || "+e+" === 0) { "+this.appendToBuffer(e)+" }"),this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){var e=this.nextOpcode(),t="";this.context.aliases.escapeExpression="this.escapeExpression",e&&e.opcode==="appendContent"&&(t=" + "+this.quotedString(e.args[0]),this.eat(e)),this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"+t))},getContext:function(e){this.lastContext!==e&&(this.lastContext=e)},lookupOnContext:function(e){this.pushStack(this.nameLookup("depth"+this.lastContext,e,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"',this.replaceStack(function(e){return"typeof "+e+" === functionType ? "+e+"() : "+e})},lookup:function(e){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,e,"context")})},pushStringParam:function(e){this.pushStackLiteral("depth"+this.lastContext),this.pushString(e)},pushString:function(e){this.pushStackLiteral(this.quotedString(e))},push:function(e){this.pushStack(e)},pushLiteral:function(e){this.pushStackLiteral(e)},pushProgram:function(e){e!=null?this.pushStackLiteral(this.programExpression(e)):this.pushStackLiteral(null)},invokeHelper:function(e,t){this.context.aliases.helperMissing="helpers.helperMissing";var n=this.lastHelper=this.setupHelper(e,t);this.register("foundHelper",n.name),this.pushStack("foundHelper ? foundHelper.call("+n.callParams+") "+": helperMissing.call("+n.helperMissingParams+")")},invokeKnownHelper:function(e,t){var n=this.setupHelper(e,t);this.pushStack(n.name+".call("+n.callParams+")")},invokeAmbiguous:function(e){this.context.aliases.functionType='"function"',this.pushStackLiteral("{}");var t=this.setupHelper(0,e),n=this.lastHelper=this.nameLookup("helpers",e,"helper");this.register("foundHelper",n);var r=this.nameLookup("depth"+this.lastContext,e,"context"),i=this.nextStack();this.source.push("if (foundHelper) { "+i+" = foundHelper.call("+t.callParams+"); }"),this.source.push("else { "+i+" = "+r+"; "+i+" = typeof "+i+" === functionType ? "+i+"() : "+i+"; }")},invokePartial:function(e){var t=[this.nameLookup("partials",e,"partial"),"'"+e+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data"),this.context.aliases.self="this",this.pushStack("self.invokePartial("+t.join(", ")+");")},assignToHash:function(e){var t=this.popStack(),n=this.topStack();this.source.push(n+"['"+e+"'] = "+t+";")},compiler:t,compileChildren:function(e,t){var n=e.children,r,i;for(var s=0,o=n.length;s<o;s++){r=n[s],i=new this.compiler,this.context.programs.push("");var u=this.context.programs.length;r.index=u,r.name="program"+u,this.context.programs[u]=i.compile(r,t,this.context)}},programExpression:function(e){this.context.aliases.self="this";if(e==null)return"self.noop";var t=this.environment.children[e],n=t.depths.list,r,i=[t.index,t.name,"data"];for(var s=0,o=n.length;s<o;s++)r=n[s],r===1?i.push("depth0"):i.push("depth"+(r-1));return n.length===0?"self.program("+i.join(", ")+")":(i.shift(),"self.programWithDepth("+i.join(", ")+")")},register:function(e,t){this.useRegister(e),this.source.push(e+" = "+t+";")},useRegister:function(e){this.registers[e]||(this.registers[e]=!0,this.registers.list.push(e))},pushStackLiteral:function(e){return this.compileStack.push(new r(e)),e},pushStack:function(e){return this.source.push(this.incrStack()+" = "+e+";"),this.compileStack.push("stack"+this.stackSlot),"stack"+this.stackSlot},replaceStack:function(e){var t=e.call(this,this.topStack());return this.source.push(this.topStack()+" = "+t+";"),"stack"+this.stackSlot},nextStack:function(e){var t=this.incrStack();return this.compileStack.push("stack"+this.stackSlot),t},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),"stack"+this.stackSlot},popStack:function(){var e=this.compileStack.pop();return e instanceof r?e.value:(this.stackSlot--,e)},topStack:function(){var e=this.compileStack[this.compileStack.length-1];return e instanceof r?e.value:e},quotedString:function(e){return'"'+e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'},setupHelper:function(e,t){var n=[];this.setupParams(e,n);var r=this.nameLookup("helpers",t,"helper");return{params:n,name:r,callParams:["depth0"].concat(n).join(", "),helperMissingParams:["depth0",this.quotedString(t)].concat(n).join(", ")}},setupParams:function(e,t){var n=[],r=[],i,s,o;n.push("hash:"+this.popStack()),s=this.popStack(),o=this.popStack();if(o||s)o||(this.context.aliases.self="this",o="self.noop"),s||(this.context.aliases.self="this",s="self.noop"),n.push("inverse:"+s),n.push("fn:"+o);for(var u=0;u<e;u++)i=this.popStack(),t.push(i),this.options.stringParams&&r.push(this.popStack());return this.options.stringParams&&n.push("contexts:["+r.join(",")+"]"),this.options.data&&n.push("data:data"),t.push("{"+n.join(",")+"}"),t.join(", ")}};var i="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),s=t.RESERVED_WORDS={};for(var o=0,u=i.length;o<u;o++)s[i[o]]=!0;t.isValidJavaScriptVariableName=function(e){return!t.RESERVED_WORDS[e]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(e)?!0:!1}}(n.Compiler,n.JavaScriptCompiler),n.precompile=function(e,t){t=t||{};var r=n.parse(e),i=(new n.Compiler).compile(r,t);return(new n.JavaScriptCompiler).compile(i,t)},n.compile=function(e,t){function i(){var r=n.parse(e),i=(new n.Compiler).compile(r,t),s=(new n.JavaScriptCompiler).compile(i,t,undefined,!0);return n.template(s)}t=t||{};var r;return function(e,t){return r||(r=i()),r.call(this,e,t)}};var i=["debug","info","warn","error"];n.logger.log=function(e,t){},n.render=function(e,t,r){return n.compile(e)(t,r)}},"3.7.3",{requires:["handlebars-base"]});
bundle/handlebars-compiler/handlebars-compiler.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1798,4 +1798,4 @@ */ -}, '3.7.2', {"requires": ["handlebars-base"]});+}, '3.7.3', {"requires": ["handlebars-base"]});
bundle/highlight-accentfold/highlight-accentfold-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/highlight-accentfold/highlight-accentfold.js", code: [] };-_yuitest_coverage["build/highlight-accentfold/highlight-accentfold.js"].code=["YUI.add('highlight-accentfold', function (Y, NAME) {","","/**","Adds accent-folding highlighters to `Y.Highlight`.","","@module highlight","@submodule highlight-accentfold","**/","","/**","@class Highlight","@static","**/","","var AccentFold = Y.Text.AccentFold,"," Escape = Y.Escape,",""," EMPTY_OBJECT = {},","","Highlight = Y.mix(Y.Highlight, {"," // -- Public Static Methods ------------------------------------------------",""," /**"," Accent-folding version of `all()`.",""," @method allFold"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object."," @param {Boolean} [options.startsWith=false] If `true`, matches must be"," anchored to the beginning of the string."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," allFold: function (haystack, needles, options) {"," var template = Highlight._TEMPLATE,"," results = [],"," startPos = 0,"," chunk, i, len, match, result;",""," options = Y.merge({"," // This tells Highlight.all() not to escape HTML, in order to ensure"," // usable match offsets. The output of all() is discarded, and we"," // perform our own escaping before returning the highlighted string."," escapeHTML: false,",""," // While the highlight regex operates on the accent-folded strings,"," // this replacer will highlight the matched positions in the"," // original string."," //"," // Note: this implementation doesn't handle multi-character folds,"," // like \"æ\" -> \"ae\". Doing so correctly would be prohibitively"," // expensive both in terms of code size and runtime performance, so"," // I've chosen to take the pragmatic route and just not do it at"," // all. This is one of many reasons why accent folding is best done"," // on the server."," replacer: function (match, p1, foldedNeedle, pos) {"," var len;",""," // Ignore matches inside HTML entities."," if (p1 && !(/\\s/).test(foldedNeedle)) {"," return match;"," }",""," len = foldedNeedle.length;",""," results.push(["," haystack.substring(startPos, pos), // substring between previous match and this match"," haystack.substr(pos, len) // match to be highlighted"," ]);",""," startPos = pos + len;"," }"," }, options || EMPTY_OBJECT);",""," // Run the highlighter on the folded strings. We don't care about the"," // output; our replacer function will build the canonical highlighted"," // string, with original accented characters."," Highlight.all(AccentFold.fold(haystack), AccentFold.fold(needles), options);",""," // Tack on the remainder of the haystack that wasn't highlighted, if"," // any."," if (startPos < haystack.length) {"," results.push([haystack.substr(startPos)]);"," }",""," // Highlight and escape the string."," for (i = 0, len = results.length; i < len; ++i) {"," chunk = Escape.html(results[i][0]);",""," if ((match = results[i][1])) {"," chunk += template.replace(/\\{s\\}/g, Escape.html(match));"," }",""," results[i] = chunk;"," }",""," return results.join('');"," },",""," /**"," Accent-folding version of `start()`.",""," @method startFold"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," startFold: function (haystack, needles) {"," return Highlight.allFold(haystack, needles, {startsWith: true});"," },",""," /**"," Accent-folding version of `words()`.",""," @method wordsFold"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings containing words"," that should be highlighted. If a string is passed, it will be split"," into words; if an array is passed, it is assumed to have already been"," split."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," wordsFold: function (haystack, needles) {"," var template = Highlight._TEMPLATE;",""," return Highlight.words(haystack, AccentFold.fold(needles), {"," mapper: function (word, needles) {"," if (needles.hasOwnProperty(AccentFold.fold(word))) {"," return template.replace(/\\{s\\}/g, Escape.html(word));"," }",""," return Escape.html(word);"," }"," });"," }","});","","","}, '3.7.2', {\"requires\": [\"highlight-base\", \"text-accentfold\"]});"];+_yuitest_coverage["build/highlight-accentfold/highlight-accentfold.js"].code=["YUI.add('highlight-accentfold', function (Y, NAME) {","","/**","Adds accent-folding highlighters to `Y.Highlight`.","","@module highlight","@submodule highlight-accentfold","**/","","/**","@class Highlight","@static","**/","","var AccentFold = Y.Text.AccentFold,"," Escape = Y.Escape,",""," EMPTY_OBJECT = {},","","Highlight = Y.mix(Y.Highlight, {"," // -- Public Static Methods ------------------------------------------------",""," /**"," Accent-folding version of `all()`.",""," @method allFold"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object."," @param {Boolean} [options.startsWith=false] If `true`, matches must be"," anchored to the beginning of the string."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," allFold: function (haystack, needles, options) {"," var template = Highlight._TEMPLATE,"," results = [],"," startPos = 0,"," chunk, i, len, match, result;",""," options = Y.merge({"," // This tells Highlight.all() not to escape HTML, in order to ensure"," // usable match offsets. The output of all() is discarded, and we"," // perform our own escaping before returning the highlighted string."," escapeHTML: false,",""," // While the highlight regex operates on the accent-folded strings,"," // this replacer will highlight the matched positions in the"," // original string."," //"," // Note: this implementation doesn't handle multi-character folds,"," // like \"æ\" -> \"ae\". Doing so correctly would be prohibitively"," // expensive both in terms of code size and runtime performance, so"," // I've chosen to take the pragmatic route and just not do it at"," // all. This is one of many reasons why accent folding is best done"," // on the server."," replacer: function (match, p1, foldedNeedle, pos) {"," var len;",""," // Ignore matches inside HTML entities."," if (p1 && !(/\\s/).test(foldedNeedle)) {"," return match;"," }",""," len = foldedNeedle.length;",""," results.push(["," haystack.substring(startPos, pos), // substring between previous match and this match"," haystack.substr(pos, len) // match to be highlighted"," ]);",""," startPos = pos + len;"," }"," }, options || EMPTY_OBJECT);",""," // Run the highlighter on the folded strings. We don't care about the"," // output; our replacer function will build the canonical highlighted"," // string, with original accented characters."," Highlight.all(AccentFold.fold(haystack), AccentFold.fold(needles), options);",""," // Tack on the remainder of the haystack that wasn't highlighted, if"," // any."," if (startPos < haystack.length) {"," results.push([haystack.substr(startPos)]);"," }",""," // Highlight and escape the string."," for (i = 0, len = results.length; i < len; ++i) {"," chunk = Escape.html(results[i][0]);",""," if ((match = results[i][1])) {"," chunk += template.replace(/\\{s\\}/g, Escape.html(match));"," }",""," results[i] = chunk;"," }",""," return results.join('');"," },",""," /**"," Accent-folding version of `start()`.",""," @method startFold"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," startFold: function (haystack, needles) {"," return Highlight.allFold(haystack, needles, {startsWith: true});"," },",""," /**"," Accent-folding version of `words()`.",""," @method wordsFold"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings containing words"," that should be highlighted. If a string is passed, it will be split"," into words; if an array is passed, it is assumed to have already been"," split."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," wordsFold: function (haystack, needles) {"," var template = Highlight._TEMPLATE;",""," return Highlight.words(haystack, AccentFold.fold(needles), {"," mapper: function (word, needles) {"," if (needles.hasOwnProperty(AccentFold.fold(word))) {"," return template.replace(/\\{s\\}/g, Escape.html(word));"," }",""," return Escape.html(word);"," }"," });"," }","});","","","}, '3.7.3', {\"requires\": [\"highlight-base\", \"text-accentfold\"]});"]; _yuitest_coverage["build/highlight-accentfold/highlight-accentfold.js"].lines = {"1":0,"15":0,"37":0,"42":0,"59":0,"62":0,"63":0,"66":0,"68":0,"73":0,"80":0,"84":0,"85":0,"89":0,"90":0,"92":0,"93":0,"96":0,"99":0,"113":0,"129":0,"131":0,"133":0,"134":0,"137":0}; _yuitest_coverage["build/highlight-accentfold/highlight-accentfold.js"].functions = {"replacer:58":0,"allFold:36":0,"startFold:112":0,"mapper:132":0,"wordsFold:128":0,"(anonymous 1):1":0}; _yuitest_coverage["build/highlight-accentfold/highlight-accentfold.js"].coveredLines = 25;@@ -211,4 +211,4 @@ }); -}, '3.7.2', {"requires": ["highlight-base", "text-accentfold"]});+}, '3.7.3', {"requires": ["highlight-base", "text-accentfold"]});
bundle/highlight-accentfold/highlight-accentfold-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -147,4 +147,4 @@ }); -}, '3.7.2', {"requires": ["highlight-base", "text-accentfold"]});+}, '3.7.3', {"requires": ["highlight-base", "text-accentfold"]});
bundle/highlight-accentfold/highlight-accentfold-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("highlight-accentfold",function(e,t){var n=e.Text.AccentFold,r=e.Escape,i={},s=e.mix(e.Highlight,{allFold:function(t,o,u){var a=s._TEMPLATE,f=[],l=0,c,h,p,d,v;u=e.merge({escapeHTML:!1,replacer:function(e,n,r,i){var s;if(n&&!/\s/.test(r))return e;s=r.length,f.push([t.substring(l,i),t.substr(i,s)]),l=i+s}},u||i),s.all(n.fold(t),n.fold(o),u),l<t.length&&f.push([t.substr(l)]);for(h=0,p=f.length;h<p;++h){c=r.html(f[h][0]);if(d=f[h][1])c+=a.replace(/\{s\}/g,r.html(d));f[h]=c}return f.join("")},startFold:function(e,t){return s.allFold(e,t,{startsWith:!0})},wordsFold:function(e,t){var i=s._TEMPLATE;return s.words(e,n.fold(t),{mapper:function(e,t){return t.hasOwnProperty(n.fold(e))?i.replace(/\{s\}/g,r.html(e)):r.html(e)}})}})},"3.7.2",{requires:["highlight-base","text-accentfold"]});+YUI.add("highlight-accentfold",function(e,t){var n=e.Text.AccentFold,r=e.Escape,i={},s=e.mix(e.Highlight,{allFold:function(t,o,u){var a=s._TEMPLATE,f=[],l=0,c,h,p,d,v;u=e.merge({escapeHTML:!1,replacer:function(e,n,r,i){var s;if(n&&!/\s/.test(r))return e;s=r.length,f.push([t.substring(l,i),t.substr(i,s)]),l=i+s}},u||i),s.all(n.fold(t),n.fold(o),u),l<t.length&&f.push([t.substr(l)]);for(h=0,p=f.length;h<p;++h){c=r.html(f[h][0]);if(d=f[h][1])c+=a.replace(/\{s\}/g,r.html(d));f[h]=c}return f.join("")},startFold:function(e,t){return s.allFold(e,t,{startsWith:!0})},wordsFold:function(e,t){var i=s._TEMPLATE;return s.words(e,n.fold(t),{mapper:function(e,t){return t.hasOwnProperty(n.fold(e))?i.replace(/\{s\}/g,r.html(e)):r.html(e)}})}})},"3.7.3",{requires:["highlight-base","text-accentfold"]});
bundle/highlight-accentfold/highlight-accentfold.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -147,4 +147,4 @@ }); -}, '3.7.2', {"requires": ["highlight-base", "text-accentfold"]});+}, '3.7.3', {"requires": ["highlight-base", "text-accentfold"]});
bundle/highlight-base/highlight-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/highlight-base/highlight-base.js", code: [] };-_yuitest_coverage["build/highlight-base/highlight-base.js"].code=["YUI.add('highlight-base', function (Y, NAME) {","","/**","Provides methods for highlighting strings within other strings by wrapping","them in HTML.","","@module highlight","@submodule highlight-base","@main","@since 3.3.0","**/","","/**","Provides methods for highlighting strings within other strings by wrapping","them in HTML.","","The highlight methods first escape any special HTML characters in the input","strings and then highlight the appropriate substrings by wrapping them in a","`<b class=\"yui3-highlight\"></b>` element. The `<b>` element is used rather than","`<strong>` in accordance with HTML5's definition of `<b>` as being purely","presentational, which is exactly what highlighting is.","","@class Highlight","@static","**/","","var YArray = Y.Array,"," Escape = Y.Escape,"," WordBreak = Y.Text.WordBreak,",""," isArray = Y.Lang.isArray,",""," EMPTY_OBJECT = {},",""," // Regex string that captures zero or one unclosed HTML entities. Used in"," // the static regex template properties below. The entity matching is"," // intentionally loose here, since there's a world of complexity involved in"," // doing strict matching for this use case."," UNCLOSED_ENTITY = '(&[^;\\\\s]*)?',","","Highlight = {"," // -- Protected Static Properties ------------------------------------------",""," /**"," Regular expression template for highlighting a match that occurs anywhere"," in a string. The placeholder `%needles` will be replaced with a list of"," needles to match, joined by `|` characters.",""," This regex should have two capturing subpatterns:",""," 1. Zero or one unclosed HTML entity (e.g. \"&\" without a \";\" at the"," end)."," 2. The `%needles` placeholder.",""," The first subpattern match is used to emulate a negative lookbehind"," assertion in order to prevent highlighting inside HTML entities.",""," @property _REGEX"," @type String"," @protected"," @static"," @final"," **/"," _REGEX: UNCLOSED_ENTITY + '(%needles)',",""," /**"," Regex replacer function or string for normal matches.",""," @property _REPLACER"," @type Function|String"," @protected"," @static"," @final"," **/"," _REPLACER: function (match, p1, p2) {"," // Mimicking a negative lookbehind assertion to prevent matches inside"," // HTML entities. Hat tip to Steven Levithan for the technique:"," // http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript"," return p1 && !(/\\s/).test(p2) ? match :"," Highlight._TEMPLATE.replace(/\\{s\\}/g, p2);"," },",""," /**"," Regular expression template for highlighting start-of-string matches"," (i.e., only matches that occur at the beginning of a string). The"," placeholder `%needles` will be replaced with a list of needles to match,"," joined by `|` characters.",""," See `_REGEX` for a description of the capturing subpatterns this regex"," string should contain.",""," @property _START_REGEX"," @type String"," @protected"," @static"," @final"," */"," _START_REGEX: '^' + UNCLOSED_ENTITY + '(%needles)',",""," /**"," Highlight template which will be used as a replacement for matched"," substrings. The placeholder `{s}` will be replaced with the matched"," substring.",""," @property _TEMPLATE"," @type String"," @default '<b class=\"yui3-highlight\">{s}</b>'"," @protected"," @static"," @final"," **/"," _TEMPLATE: '<b class=\"' + Y.ClassNameManager.getClassName('highlight') + '\">{s}</b>',",""," // -- Public Static Methods ------------------------------------------------",""," /**"," Highlights all occurrences in the _haystack_ string of the items in the"," _needles_ array, regardless of where they occur. The returned string will"," have all HTML characters escaped except for the highlighting markup.",""," @method all"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object."," @param {Boolean} [options.caseSensitive=false] If `true`, matching will"," be case-sensitive."," @param {Boolean} [options.startsWith=false] If `true`, matches must be"," anchored to the beginning of the string."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," all: function (haystack, needles, options) {"," var validNeedles = [],"," esc, i, len, needle, regex, replacer;",""," if (!options) {"," options = EMPTY_OBJECT;"," }",""," // TODO: document options.replacer"," esc = options.escapeHTML !== false;"," regex = options.startsWith ? Highlight._START_REGEX : Highlight._REGEX;"," replacer = options.replacer || Highlight._REPLACER;"," needles = isArray(needles) ? needles : [needles];",""," // Escape HTML characters and special regular expression characters in"," // the needles so they can be used in a regex and matched against the"," // escaped haystack."," for (i = 0, len = needles.length; i < len; ++i) {"," needle = needles[i];",""," if (needle) {"," validNeedles.push(Escape.regex(esc ? Escape.html(needle) : needle));"," }"," }",""," // Escape HTML characters in the haystack to prevent HTML injection."," if (esc) {"," haystack = Escape.html(haystack);"," }",""," // No point continuing if there are no needles."," if (!validNeedles.length) {"," return haystack;"," }",""," return haystack.replace("," new RegExp("," regex.replace('%needles', validNeedles.join('|')),"," options.caseSensitive ? 'g' : 'gi'"," ),"," replacer"," );"," },",""," /**"," Same as `all()`, but case-sensitive by default.",""," @method allCase"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object. See `all()` for details."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," allCase: function (haystack, needles, options) {"," return Highlight.all(haystack, needles,"," Y.merge(options || EMPTY_OBJECT, {caseSensitive: true}));"," },",""," /**"," Highlights _needles_ that occur at the start of _haystack_. The returned"," string will have all HTML characters escaped except for the highlighting"," markup.",""," @method start"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object."," @param {Boolean} [options.caseSensitive=false] If `true`, matching will"," be case-sensitive."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," start: function (haystack, needles, options) {"," return Highlight.all(haystack, needles,"," Y.merge(options || EMPTY_OBJECT, {startsWith: true}));"," },",""," /**"," Same as `start()`, but case-sensitive by default.",""," @method startCase"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," startCase: function (haystack, needles) {"," // No options passthru for now, since it would be redundant. If start()"," // ever supports more options than caseSensitive, then we'll start"," // passing the options through."," return Highlight.start(haystack, needles, {caseSensitive: true});"," },",""," /**"," Highlights complete words in the _haystack_ string that are also in the"," _needles_ array. The returned string will have all HTML characters escaped"," except for the highlighting markup.",""," @method words"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings containing words"," that should be highlighted. If a string is passed, it will be split"," into words; if an array is passed, it is assumed to have already been"," split."," @param {Object} [options] Options object."," @param {Boolean} [options.caseSensitive=false] If `true`, matching will"," be case-sensitive."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," words: function (haystack, needles, options) {"," var caseSensitive,"," mapper,"," template = Highlight._TEMPLATE,"," words;",""," if (!options) {"," options = EMPTY_OBJECT;"," }",""," caseSensitive = !!options.caseSensitive;",""," // Convert needles to a hash for faster lookups."," needles = YArray.hash("," isArray(needles) ? needles : WordBreak.getUniqueWords(needles, {"," ignoreCase: !caseSensitive"," })"," );",""," // The default word mapping function can be overridden with a custom"," // one. This is used to implement accent-folded highlighting in the"," // highlight-accentfold module."," mapper = options.mapper || function (word, needles) {"," if (needles.hasOwnProperty(caseSensitive ? word : word.toLowerCase())) {"," return template.replace(/\\{s\\}/g, Escape.html(word));"," }",""," return Escape.html(word);"," };",""," // Split the haystack into an array of words, including punctuation and"," // whitespace so we can rebuild the string later."," words = WordBreak.getWords(haystack, {"," includePunctuation: true,"," includeWhitespace : true"," });",""," return YArray.map(words, function (word) {"," return mapper(word, needles);"," }).join('');"," },",""," /**"," Same as `words()`, but case-sensitive by default.",""," @method wordsCase"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings containing words"," that should be highlighted. If a string is passed, it will be split"," into words; if an array is passed, it is assumed to have already been"," split."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," wordsCase: function (haystack, needles) {"," // No options passthru for now, since it would be redundant. If words()"," // ever supports more options than caseSensitive, then we'll start"," // passing the options through."," return Highlight.words(haystack, needles, {caseSensitive: true});"," }","};","","Y.Highlight = Highlight;","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"classnamemanager\", \"escape\", \"text-wordbreak\"]});"];+_yuitest_coverage["build/highlight-base/highlight-base.js"].code=["YUI.add('highlight-base', function (Y, NAME) {","","/**","Provides methods for highlighting strings within other strings by wrapping","them in HTML.","","@module highlight","@submodule highlight-base","@main","@since 3.3.0","**/","","/**","Provides methods for highlighting strings within other strings by wrapping","them in HTML.","","The highlight methods first escape any special HTML characters in the input","strings and then highlight the appropriate substrings by wrapping them in a","`<b class=\"yui3-highlight\"></b>` element. The `<b>` element is used rather than","`<strong>` in accordance with HTML5's definition of `<b>` as being purely","presentational, which is exactly what highlighting is.","","@class Highlight","@static","**/","","var YArray = Y.Array,"," Escape = Y.Escape,"," WordBreak = Y.Text.WordBreak,",""," isArray = Y.Lang.isArray,",""," EMPTY_OBJECT = {},",""," // Regex string that captures zero or one unclosed HTML entities. Used in"," // the static regex template properties below. The entity matching is"," // intentionally loose here, since there's a world of complexity involved in"," // doing strict matching for this use case."," UNCLOSED_ENTITY = '(&[^;\\\\s]*)?',","","Highlight = {"," // -- Protected Static Properties ------------------------------------------",""," /**"," Regular expression template for highlighting a match that occurs anywhere"," in a string. The placeholder `%needles` will be replaced with a list of"," needles to match, joined by `|` characters.",""," This regex should have two capturing subpatterns:",""," 1. Zero or one unclosed HTML entity (e.g. \"&\" without a \";\" at the"," end)."," 2. The `%needles` placeholder.",""," The first subpattern match is used to emulate a negative lookbehind"," assertion in order to prevent highlighting inside HTML entities.",""," @property _REGEX"," @type String"," @protected"," @static"," @final"," **/"," _REGEX: UNCLOSED_ENTITY + '(%needles)',",""," /**"," Regex replacer function or string for normal matches.",""," @property _REPLACER"," @type Function|String"," @protected"," @static"," @final"," **/"," _REPLACER: function (match, p1, p2) {"," // Mimicking a negative lookbehind assertion to prevent matches inside"," // HTML entities. Hat tip to Steven Levithan for the technique:"," // http://blog.stevenlevithan.com/archives/mimic-lookbehind-javascript"," return p1 && !(/\\s/).test(p2) ? match :"," Highlight._TEMPLATE.replace(/\\{s\\}/g, p2);"," },",""," /**"," Regular expression template for highlighting start-of-string matches"," (i.e., only matches that occur at the beginning of a string). The"," placeholder `%needles` will be replaced with a list of needles to match,"," joined by `|` characters.",""," See `_REGEX` for a description of the capturing subpatterns this regex"," string should contain.",""," @property _START_REGEX"," @type String"," @protected"," @static"," @final"," */"," _START_REGEX: '^' + UNCLOSED_ENTITY + '(%needles)',",""," /**"," Highlight template which will be used as a replacement for matched"," substrings. The placeholder `{s}` will be replaced with the matched"," substring.",""," @property _TEMPLATE"," @type String"," @default '<b class=\"yui3-highlight\">{s}</b>'"," @protected"," @static"," @final"," **/"," _TEMPLATE: '<b class=\"' + Y.ClassNameManager.getClassName('highlight') + '\">{s}</b>',",""," // -- Public Static Methods ------------------------------------------------",""," /**"," Highlights all occurrences in the _haystack_ string of the items in the"," _needles_ array, regardless of where they occur. The returned string will"," have all HTML characters escaped except for the highlighting markup.",""," @method all"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object."," @param {Boolean} [options.caseSensitive=false] If `true`, matching will"," be case-sensitive."," @param {Boolean} [options.startsWith=false] If `true`, matches must be"," anchored to the beginning of the string."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," all: function (haystack, needles, options) {"," var validNeedles = [],"," esc, i, len, needle, regex, replacer;",""," if (!options) {"," options = EMPTY_OBJECT;"," }",""," // TODO: document options.replacer"," esc = options.escapeHTML !== false;"," regex = options.startsWith ? Highlight._START_REGEX : Highlight._REGEX;"," replacer = options.replacer || Highlight._REPLACER;"," needles = isArray(needles) ? needles : [needles];",""," // Escape HTML characters and special regular expression characters in"," // the needles so they can be used in a regex and matched against the"," // escaped haystack."," for (i = 0, len = needles.length; i < len; ++i) {"," needle = needles[i];",""," if (needle) {"," validNeedles.push(Escape.regex(esc ? Escape.html(needle) : needle));"," }"," }",""," // Escape HTML characters in the haystack to prevent HTML injection."," if (esc) {"," haystack = Escape.html(haystack);"," }",""," // No point continuing if there are no needles."," if (!validNeedles.length) {"," return haystack;"," }",""," return haystack.replace("," new RegExp("," regex.replace('%needles', validNeedles.join('|')),"," options.caseSensitive ? 'g' : 'gi'"," ),"," replacer"," );"," },",""," /**"," Same as `all()`, but case-sensitive by default.",""," @method allCase"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object. See `all()` for details."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," allCase: function (haystack, needles, options) {"," return Highlight.all(haystack, needles,"," Y.merge(options || EMPTY_OBJECT, {caseSensitive: true}));"," },",""," /**"," Highlights _needles_ that occur at the start of _haystack_. The returned"," string will have all HTML characters escaped except for the highlighting"," markup.",""," @method start"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @param {Object} [options] Options object."," @param {Boolean} [options.caseSensitive=false] If `true`, matching will"," be case-sensitive."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," start: function (haystack, needles, options) {"," return Highlight.all(haystack, needles,"," Y.merge(options || EMPTY_OBJECT, {startsWith: true}));"," },",""," /**"," Same as `start()`, but case-sensitive by default.",""," @method startCase"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings that should be"," highlighted."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," startCase: function (haystack, needles) {"," // No options passthru for now, since it would be redundant. If start()"," // ever supports more options than caseSensitive, then we'll start"," // passing the options through."," return Highlight.start(haystack, needles, {caseSensitive: true});"," },",""," /**"," Highlights complete words in the _haystack_ string that are also in the"," _needles_ array. The returned string will have all HTML characters escaped"," except for the highlighting markup.",""," @method words"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings containing words"," that should be highlighted. If a string is passed, it will be split"," into words; if an array is passed, it is assumed to have already been"," split."," @param {Object} [options] Options object."," @param {Boolean} [options.caseSensitive=false] If `true`, matching will"," be case-sensitive."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," words: function (haystack, needles, options) {"," var caseSensitive,"," mapper,"," template = Highlight._TEMPLATE,"," words;",""," if (!options) {"," options = EMPTY_OBJECT;"," }",""," caseSensitive = !!options.caseSensitive;",""," // Convert needles to a hash for faster lookups."," needles = YArray.hash("," isArray(needles) ? needles : WordBreak.getUniqueWords(needles, {"," ignoreCase: !caseSensitive"," })"," );",""," // The default word mapping function can be overridden with a custom"," // one. This is used to implement accent-folded highlighting in the"," // highlight-accentfold module."," mapper = options.mapper || function (word, needles) {"," if (needles.hasOwnProperty(caseSensitive ? word : word.toLowerCase())) {"," return template.replace(/\\{s\\}/g, Escape.html(word));"," }",""," return Escape.html(word);"," };",""," // Split the haystack into an array of words, including punctuation and"," // whitespace so we can rebuild the string later."," words = WordBreak.getWords(haystack, {"," includePunctuation: true,"," includeWhitespace : true"," });",""," return YArray.map(words, function (word) {"," return mapper(word, needles);"," }).join('');"," },",""," /**"," Same as `words()`, but case-sensitive by default.",""," @method wordsCase"," @param {String} haystack String to apply highlighting to."," @param {String|String[]} needles String or array of strings containing words"," that should be highlighted. If a string is passed, it will be split"," into words; if an array is passed, it is assumed to have already been"," split."," @return {String} Escaped and highlighted copy of _haystack_."," @static"," **/"," wordsCase: function (haystack, needles) {"," // No options passthru for now, since it would be redundant. If words()"," // ever supports more options than caseSensitive, then we'll start"," // passing the options through."," return Highlight.words(haystack, needles, {caseSensitive: true});"," }","};","","Y.Highlight = Highlight;","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"classnamemanager\", \"escape\", \"text-wordbreak\"]});"]; _yuitest_coverage["build/highlight-base/highlight-base.js"].lines = {"1":0,"27":0,"79":0,"134":0,"137":0,"138":0,"142":0,"143":0,"144":0,"145":0,"150":0,"151":0,"153":0,"154":0,"159":0,"160":0,"164":0,"165":0,"168":0,"189":0,"209":0,"227":0,"248":0,"253":0,"254":0,"257":0,"260":0,"269":0,"270":0,"271":0,"274":0,"279":0,"284":0,"285":0,"305":0,"309":0}; _yuitest_coverage["build/highlight-base/highlight-base.js"].functions = {"_REPLACER:75":0,"all:133":0,"allCase:188":0,"start:208":0,"startCase:223":0,"(anonymous 2):269":0,"(anonymous 3):284":0,"words:247":0,"wordsCase:301":0,"(anonymous 1):1":0}; _yuitest_coverage["build/highlight-base/highlight-base.js"].coveredLines = 36;@@ -394,4 +394,4 @@ Y.Highlight = Highlight; -}, '3.7.2', {"requires": ["array-extras", "classnamemanager", "escape", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "classnamemanager", "escape", "text-wordbreak"]});
bundle/highlight-base/highlight-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -315,4 +315,4 @@ Y.Highlight = Highlight; -}, '3.7.2', {"requires": ["array-extras", "classnamemanager", "escape", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "classnamemanager", "escape", "text-wordbreak"]});
bundle/highlight-base/highlight-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("highlight-base",function(e,t){var n=e.Array,r=e.Escape,i=e.Text.WordBreak,s=e.Lang.isArray,o={},u="(&[^;\\s]*)?",a={_REGEX:u+"(%needles)",_REPLACER:function(e,t,n){return t&&!/\s/.test(n)?e:a._TEMPLATE.replace(/\{s\}/g,n)},_START_REGEX:"^"+u+"(%needles)",_TEMPLATE:'<b class="'+e.ClassNameManager.getClassName("highlight")+'">{s}</b>',all:function(e,t,n){var i=[],u,f,l,c,h,p;n||(n=o),u=n.escapeHTML!==!1,h=n.startsWith?a._START_REGEX:a._REGEX,p=n.replacer||a._REPLACER,t=s(t)?t:[t];for(f=0,l=t.length;f<l;++f)c=t[f],c&&i.push(r.regex(u?r.html(c):c));return u&&(e=r.html(e)),i.length?e.replace(new RegExp(h.replace("%needles",i.join("|")),n.caseSensitive?"g":"gi"),p):e},allCase:function(t,n,r){return a.all(t,n,e.merge(r||o,{caseSensitive:!0}))},start:function(t,n,r){return a.all(t,n,e.merge(r||o,{startsWith:!0}))},startCase:function(e,t){return a.start(e,t,{caseSensitive:!0})},words:function(e,t,u){var f,l,c=a._TEMPLATE,h;return u||(u=o),f=!!u.caseSensitive,t=n.hash(s(t)?t:i.getUniqueWords(t,{ignoreCase:!f})),l=u.mapper||function(e,t){return t.hasOwnProperty(f?e:e.toLowerCase())?c.replace(/\{s\}/g,r.html(e)):r.html(e)},h=i.getWords(e,{includePunctuation:!0,includeWhitespace:!0}),n.map(h,function(e){return l(e,t)}).join("")},wordsCase:function(e,t){return a.words(e,t,{caseSensitive:!0})}};e.Highlight=a},"3.7.2",{requires:["array-extras","classnamemanager","escape","text-wordbreak"]});+YUI.add("highlight-base",function(e,t){var n=e.Array,r=e.Escape,i=e.Text.WordBreak,s=e.Lang.isArray,o={},u="(&[^;\\s]*)?",a={_REGEX:u+"(%needles)",_REPLACER:function(e,t,n){return t&&!/\s/.test(n)?e:a._TEMPLATE.replace(/\{s\}/g,n)},_START_REGEX:"^"+u+"(%needles)",_TEMPLATE:'<b class="'+e.ClassNameManager.getClassName("highlight")+'">{s}</b>',all:function(e,t,n){var i=[],u,f,l,c,h,p;n||(n=o),u=n.escapeHTML!==!1,h=n.startsWith?a._START_REGEX:a._REGEX,p=n.replacer||a._REPLACER,t=s(t)?t:[t];for(f=0,l=t.length;f<l;++f)c=t[f],c&&i.push(r.regex(u?r.html(c):c));return u&&(e=r.html(e)),i.length?e.replace(new RegExp(h.replace("%needles",i.join("|")),n.caseSensitive?"g":"gi"),p):e},allCase:function(t,n,r){return a.all(t,n,e.merge(r||o,{caseSensitive:!0}))},start:function(t,n,r){return a.all(t,n,e.merge(r||o,{startsWith:!0}))},startCase:function(e,t){return a.start(e,t,{caseSensitive:!0})},words:function(e,t,u){var f,l,c=a._TEMPLATE,h;return u||(u=o),f=!!u.caseSensitive,t=n.hash(s(t)?t:i.getUniqueWords(t,{ignoreCase:!f})),l=u.mapper||function(e,t){return t.hasOwnProperty(f?e:e.toLowerCase())?c.replace(/\{s\}/g,r.html(e)):r.html(e)},h=i.getWords(e,{includePunctuation:!0,includeWhitespace:!0}),n.map(h,function(e){return l(e,t)}).join("")},wordsCase:function(e,t){return a.words(e,t,{caseSensitive:!0})}};e.Highlight=a},"3.7.3",{requires:["array-extras","classnamemanager","escape","text-wordbreak"]});
bundle/highlight-base/highlight-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -315,4 +315,4 @@ Y.Highlight = Highlight; -}, '3.7.2', {"requires": ["array-extras", "classnamemanager", "escape", "text-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "classnamemanager", "escape", "text-wordbreak"]});
bundle/history-base/history-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/history-base/history-base.js", code: [] };-_yuitest_coverage["build/history-base/history-base.js"].code=["YUI.add('history-base', function (Y, NAME) {","","/**"," * Provides browser history management functionality using a simple"," * add/replace/get paradigm. This can be used to ensure that the browser's back"," * and forward buttons work as the user expects and to provide bookmarkable URLs"," * that return the user to the current application state, even in an Ajax"," * application that doesn't perform full-page refreshes."," *"," * @module history"," * @main history"," * @since 3.2.0"," */","","/**"," * Provides global state management backed by an object, but with no browser"," * history integration. For actual browser history integration and back/forward"," * support, use the history-html5 or history-hash modules."," *"," * @module history"," * @submodule history-base"," * @class HistoryBase"," * @uses EventTarget"," * @constructor"," * @param {Object} config (optional) configuration object, which may contain"," * zero or more of the following properties:"," *"," * <dl>"," * <dt>force (Boolean)</dt>"," * <dd>"," * If `true`, a `history:change` event will be fired whenever the URL"," * changes, even if there is no associated state change. Default is `false`."," * </dd>"," *"," * <dt>initialState (Object)</dt>"," * <dd>"," * Initial state to set, as an object hash of key/value pairs. This will be"," * merged into the current global state."," * </dd>"," * </dl>"," */","","var Lang = Y.Lang,"," Obj = Y.Object,"," GlobalEnv = YUI.namespace('Env.History'),"," YArray = Y.Array,",""," doc = Y.config.doc,"," docMode = doc.documentMode,"," win = Y.config.win,",""," DEFAULT_OPTIONS = {merge: true},"," EVT_CHANGE = 'change',"," SRC_ADD = 'add',"," SRC_REPLACE = 'replace';","","function HistoryBase() {"," this._init.apply(this, arguments);","}","","Y.augment(HistoryBase, Y.EventTarget, null, null, {"," emitFacade : true,"," prefix : 'history',"," preventable: false,"," queueable : true","});","","if (!GlobalEnv._state) {"," GlobalEnv._state = {};","}","","// -- Private Methods ----------------------------------------------------------","","/**"," * Returns <code>true</code> if <i>value</i> is a simple object and not a"," * function or an array."," *"," * @method _isSimpleObject"," * @param {mixed} value"," * @return {Boolean}"," * @private"," */","function _isSimpleObject(value) {"," return Lang.type(value) === 'object';","}","","// -- Public Static Properties -------------------------------------------------","","/**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */","HistoryBase.NAME = 'historyBase';","","/**"," * Constant used to identify state changes originating from the"," * <code>add()</code> method."," *"," * @property SRC_ADD"," * @type String"," * @static"," * @final"," */","HistoryBase.SRC_ADD = SRC_ADD;","","/**"," * Constant used to identify state changes originating from the"," * <code>replace()</code> method."," *"," * @property SRC_REPLACE"," * @type String"," * @static"," * @final"," */","HistoryBase.SRC_REPLACE = SRC_REPLACE;","","/**"," * Whether or not this browser supports the HTML5 History API."," *"," * @property html5"," * @type Boolean"," * @static"," */","","// All HTML5-capable browsers except Gecko 2+ (Firefox 4+) correctly return","// true for 'onpopstate' in win. In order to support Gecko 2, we fall back to a","// UA sniff for now. (current as of Firefox 4.0b2)","HistoryBase.html5 = !!(win.history && win.history.pushState &&"," win.history.replaceState && ('onpopstate' in win || Y.UA.gecko >= 2) &&"," (!Y.UA.android || Y.UA.android >= 2.4));","","/**"," * Whether or not this browser supports the <code>window.onhashchange</code>"," * event natively. Note that even if this is <code>true</code>, you may"," * still want to use HistoryHash's synthetic <code>hashchange</code> event"," * since it normalizes implementation differences and fixes spec violations"," * across various browsers."," *"," * @property nativeHashChange"," * @type Boolean"," * @static"," */","","// Most browsers that support hashchange expose it on the window. Opera 10.6+","// exposes it on the document (but you can still attach to it on the window).","//","// IE8 supports the hashchange event, but only in IE8 Standards","// Mode. However, IE8 in IE7 compatibility mode still defines the","// event but never fires it, so we can't just detect the event. We also can't","// just UA sniff for IE8, since other browsers support this event as well.","HistoryBase.nativeHashChange = ('onhashchange' in win || 'onhashchange' in doc) &&"," (!docMode || docMode > 7);","","Y.mix(HistoryBase.prototype, {"," // -- Initialization -------------------------------------------------------",""," /**"," * Initializes this HistoryBase instance. This method is called by the"," * constructor."," *"," * @method _init"," * @param {Object} config configuration object"," * @protected"," */"," _init: function (config) {"," var initialState;",""," /**"," * Configuration object provided by the user on instantiation, or an"," * empty object if one wasn't provided."," *"," * @property _config"," * @type Object"," * @default {}"," * @protected"," */"," config = this._config = config || {};",""," /**"," * If `true`, a `history:change` event will be fired whenever the URL"," * changes, even if there is no associated state change."," *"," * @property force"," * @type Boolean"," * @default false"," */"," this.force = !!config.force;",""," /**"," * Resolved initial state: a merge of the user-supplied initial state"," * (if any) and any initial state provided by a subclass. This may"," * differ from <code>_config.initialState</code>. If neither the config"," * nor a subclass supplies an initial state, this property will be"," * <code>null</code>."," *"," * @property _initialState"," * @type Object|null"," * @default {}"," * @protected"," */"," initialState = this._initialState = this._initialState ||"," config.initialState || null;",""," /**"," * Fired when the state changes. To be notified of all state changes"," * regardless of the History or YUI instance that generated them,"," * subscribe to this event on <code>Y.Global</code>. If you would rather"," * be notified only about changes generated by this specific History"," * instance, subscribe to this event on the instance."," *"," * @event history:change"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," *"," * <dl>"," * <dt>changed (Object)</dt>"," * <dd>"," * Object hash of state items that have been added or changed. The"," * key is the item key, and the value is an object containing"," * <code>newVal</code> and <code>prevVal</code> properties"," * representing the values of the item both before and after the"," * change. If the item was newly added, <code>prevVal</code> will be"," * <code>undefined</code>."," * </dd>"," *"," * <dt>newVal (Object)</dt>"," * <dd>"," * Object hash of key/value pairs of all state items after the"," * change."," * </dd>"," *"," * <dt>prevVal (Object)</dt>"," * <dd>"," * Object hash of key/value pairs of all state items before the"," * change."," * </dd>"," *"," * <dt>removed (Object)</dt>"," * <dd>"," * Object hash of key/value pairs of state items that have been"," * removed. Values are the old values prior to removal."," * </dd>"," *"," * <dt>src (String)</dt>"," * <dd>"," * The source of the event. This can be used to selectively ignore"," * events generated by certain sources."," * </dd>"," * </dl>"," */"," this.publish(EVT_CHANGE, {"," broadcast: 2,"," defaultFn: this._defChangeFn"," });",""," // If initialState was provided, merge it into the current state."," if (initialState) {"," this.replace(initialState);"," }"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," * Adds a state entry with new values for the specified keys. By default,"," * the new state will be merged into the existing state, and new values will"," * override existing values. Specifying a <code>null</code> or"," * <code>undefined</code> value will cause that key to be removed from the"," * new state entry."," *"," * @method add"," * @param {Object} state Object hash of key/value pairs."," * @param {Object} options (optional) Zero or more of the following options:"," * <dl>"," * <dt>merge (Boolean)</dt>"," * <dd>"," * <p>"," * If <code>true</code> (the default), the new state will be merged"," * into the existing state. New values will override existing values,"," * and <code>null</code> or <code>undefined</code> values will be"," * removed from the state."," * </p>"," *"," * <p>"," * If <code>false</code>, the existing state will be discarded as a"," * whole and the new state will take its place."," * </p>"," * </dd>"," * </dl>"," * @chainable"," */"," add: function () {"," var args = YArray(arguments, 0, true);"," args.unshift(SRC_ADD);"," return this._change.apply(this, args);"," },",""," /**"," * Adds a state entry with a new value for a single key. By default, the new"," * value will be merged into the existing state values, and will override an"," * existing value with the same key if there is one. Specifying a"," * <code>null</code> or <code>undefined</code> value will cause the key to"," * be removed from the new state entry."," *"," * @method addValue"," * @param {String} key State parameter key."," * @param {String} value New value."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @chainable"," */"," addValue: function (key, value, options) {"," var state = {};"," state[key] = value;"," return this._change(SRC_ADD, state, options);"," },",""," /**"," * Returns the current value of the state parameter specified by <i>key</i>,"," * or an object hash of key/value pairs for all current state parameters if"," * no key is specified."," *"," * @method get"," * @param {String} key (optional) State parameter key."," * @return {Object|String} Value of the specified state parameter, or an"," * object hash of key/value pairs for all current state parameters."," */"," get: function (key) {"," var state = GlobalEnv._state,"," isObject = _isSimpleObject(state);",""," if (key) {"," return isObject && Obj.owns(state, key) ? state[key] : undefined;"," } else {"," return isObject ? Y.mix({}, state, true) : state; // mix provides a fast shallow clone."," }"," },",""," /**"," * Same as <code>add()</code> except that a new browser history entry will"," * not be created. Instead, the current history entry will be replaced with"," * the new state."," *"," * @method replace"," * @param {Object} state Object hash of key/value pairs."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @chainable"," */"," replace: function () {"," var args = YArray(arguments, 0, true);"," args.unshift(SRC_REPLACE);"," return this._change.apply(this, args);"," },",""," /**"," * Same as <code>addValue()</code> except that a new browser history entry"," * will not be created. Instead, the current history entry will be replaced"," * with the new state."," *"," * @method replaceValue"," * @param {String} key State parameter key."," * @param {String} value New value."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @chainable"," */"," replaceValue: function (key, value, options) {"," var state = {};"," state[key] = value;"," return this._change(SRC_REPLACE, state, options);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," * Changes the state. This method provides a common implementation shared by"," * the public methods for changing state."," *"," * @method _change"," * @param {String} src Source of the change, for inclusion in event facades"," * to facilitate filtering."," * @param {Object} state Object hash of key/value pairs."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @protected"," * @chainable"," */"," _change: function (src, state, options) {"," options = options ? Y.merge(DEFAULT_OPTIONS, options) : DEFAULT_OPTIONS;",""," if (options.merge && _isSimpleObject(state) &&"," _isSimpleObject(GlobalEnv._state)) {"," state = Y.merge(GlobalEnv._state, state);"," }",""," this._resolveChanges(src, state, options);"," return this;"," },",""," /**"," * Called by _resolveChanges() when the state has changed. This method takes"," * care of actually firing the necessary events."," *"," * @method _fireEvents"," * @param {String} src Source of the changes, for inclusion in event facades"," * to facilitate filtering."," * @param {Object} changes Resolved changes."," * @param {Object} options Zero or more options. See <code>add()</code> for"," * a list of supported options."," * @protected"," */"," _fireEvents: function (src, changes, options) {"," // Fire the global change event."," this.fire(EVT_CHANGE, {"," _options: options,"," changed : changes.changed,"," newVal : changes.newState,"," prevVal : changes.prevState,"," removed : changes.removed,"," src : src"," });",""," // Fire change/remove events for individual items."," Obj.each(changes.changed, function (value, key) {"," this._fireChangeEvent(src, key, value);"," }, this);",""," Obj.each(changes.removed, function (value, key) {"," this._fireRemoveEvent(src, key, value);"," }, this);"," },",""," /**"," * Fires a dynamic \"[key]Change\" event."," *"," * @method _fireChangeEvent"," * @param {String} src source of the change, for inclusion in event facades"," * to facilitate filtering"," * @param {String} key key of the item that was changed"," * @param {Object} value object hash containing <i>newVal</i> and"," * <i>prevVal</i> properties for the changed item"," * @protected"," */"," _fireChangeEvent: function (src, key, value) {"," /**"," * <p>"," * Dynamic event fired when an individual history item is added or"," * changed. The name of this event depends on the name of the key that"," * changed. To listen to change events for a key named \"foo\", subscribe"," * to the <code>fooChange</code> event; for a key named \"bar\", subscribe"," * to <code>barChange</code>, etc."," * </p>"," *"," * <p>"," * Key-specific events are only fired for instance-level changes; that"," * is, changes that were made via the same History instance on which the"," * event is subscribed. To be notified of changes made by other History"," * instances, subscribe to the global <code>history:change</code> event."," * </p>"," *"," * @event [key]Change"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," *"," * <dl>"," * <dt>newVal (mixed)</dt>"," * <dd>"," * The new value of the item after the change."," * </dd>"," *"," * <dt>prevVal (mixed)</dt>"," * <dd>"," * The previous value of the item before the change, or"," * <code>undefined</code> if the item was just added and has no"," * previous value."," * </dd>"," *"," * <dt>src (String)</dt>"," * <dd>"," * The source of the event. This can be used to selectively ignore"," * events generated by certain sources."," * </dd>"," * </dl>"," */"," this.fire(key + 'Change', {"," newVal : value.newVal,"," prevVal: value.prevVal,"," src : src"," });"," },",""," /**"," * Fires a dynamic \"[key]Remove\" event."," *"," * @method _fireRemoveEvent"," * @param {String} src source of the change, for inclusion in event facades"," * to facilitate filtering"," * @param {String} key key of the item that was removed"," * @param {mixed} value value of the item prior to its removal"," * @protected"," */"," _fireRemoveEvent: function (src, key, value) {"," /**"," * <p>"," * Dynamic event fired when an individual history item is removed. The"," * name of this event depends on the name of the key that was removed."," * To listen to remove events for a key named \"foo\", subscribe to the"," * <code>fooRemove</code> event; for a key named \"bar\", subscribe to"," * <code>barRemove</code>, etc."," * </p>"," *"," * <p>"," * Key-specific events are only fired for instance-level changes; that"," * is, changes that were made via the same History instance on which the"," * event is subscribed. To be notified of changes made by other History"," * instances, subscribe to the global <code>history:change</code> event."," * </p>"," *"," * @event [key]Remove"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," *"," * <dl>"," * <dt>prevVal (mixed)</dt>"," * <dd>"," * The value of the item before it was removed."," * </dd>"," *"," * <dt>src (String)</dt>"," * <dd>"," * The source of the event. This can be used to selectively ignore"," * events generated by certain sources."," * </dd>"," * </dl>"," */"," this.fire(key + 'Remove', {"," prevVal: value,"," src : src"," });"," },",""," /**"," * Resolves the changes (if any) between <i>newState</i> and the current"," * state and fires appropriate events if things have changed."," *"," * @method _resolveChanges"," * @param {String} src source of the changes, for inclusion in event facades"," * to facilitate filtering"," * @param {Object} newState object hash of key/value pairs representing the"," * new state"," * @param {Object} options Zero or more options. See <code>add()</code> for"," * a list of supported options."," * @protected"," */"," _resolveChanges: function (src, newState, options) {"," var changed = {},"," isChanged,"," prevState = GlobalEnv._state,"," removed = {};",""," newState || (newState = {});"," options || (options = {});",""," if (_isSimpleObject(newState) && _isSimpleObject(prevState)) {"," // Figure out what was added or changed."," Obj.each(newState, function (newVal, key) {"," var prevVal = prevState[key];",""," if (newVal !== prevVal) {"," changed[key] = {"," newVal : newVal,"," prevVal: prevVal"," };",""," isChanged = true;"," }"," }, this);",""," // Figure out what was removed."," Obj.each(prevState, function (prevVal, key) {"," if (!Obj.owns(newState, key) || newState[key] === null) {"," delete newState[key];"," removed[key] = prevVal;"," isChanged = true;"," }"," }, this);"," } else {"," isChanged = newState !== prevState;"," }",""," if (isChanged || this.force) {"," this._fireEvents(src, {"," changed : changed,"," newState : newState,"," prevState: prevState,"," removed : removed"," }, options);"," }"," },",""," /**"," * Stores the specified state. Don't call this method directly; go through"," * _resolveChanges() to ensure that changes are resolved and all events are"," * fired properly."," *"," * @method _storeState"," * @param {String} src source of the changes"," * @param {Object} newState new state to store"," * @param {Object} options Zero or more options. See <code>add()</code> for"," * a list of supported options."," * @protected"," */"," _storeState: function (src, newState) {"," // Note: the src and options params aren't used here, but they are used"," // by subclasses."," GlobalEnv._state = newState || {};"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," * Default <code>history:change</code> event handler."," *"," * @method _defChangeFn"," * @param {EventFacade} e state change event facade"," * @protected"," */"," _defChangeFn: function (e) {"," this._storeState(e.src, e.newVal, e._options);"," }","}, true);","","Y.HistoryBase = HistoryBase;","","","}, '3.7.2', {\"requires\": [\"event-custom-complex\"]});"];+_yuitest_coverage["build/history-base/history-base.js"].code=["YUI.add('history-base', function (Y, NAME) {","","/**"," * Provides browser history management functionality using a simple"," * add/replace/get paradigm. This can be used to ensure that the browser's back"," * and forward buttons work as the user expects and to provide bookmarkable URLs"," * that return the user to the current application state, even in an Ajax"," * application that doesn't perform full-page refreshes."," *"," * @module history"," * @main history"," * @since 3.2.0"," */","","/**"," * Provides global state management backed by an object, but with no browser"," * history integration. For actual browser history integration and back/forward"," * support, use the history-html5 or history-hash modules."," *"," * @module history"," * @submodule history-base"," * @class HistoryBase"," * @uses EventTarget"," * @constructor"," * @param {Object} config (optional) configuration object, which may contain"," * zero or more of the following properties:"," *"," * <dl>"," * <dt>force (Boolean)</dt>"," * <dd>"," * If `true`, a `history:change` event will be fired whenever the URL"," * changes, even if there is no associated state change. Default is `false`."," * </dd>"," *"," * <dt>initialState (Object)</dt>"," * <dd>"," * Initial state to set, as an object hash of key/value pairs. This will be"," * merged into the current global state."," * </dd>"," * </dl>"," */","","var Lang = Y.Lang,"," Obj = Y.Object,"," GlobalEnv = YUI.namespace('Env.History'),"," YArray = Y.Array,",""," doc = Y.config.doc,"," docMode = doc.documentMode,"," win = Y.config.win,",""," DEFAULT_OPTIONS = {merge: true},"," EVT_CHANGE = 'change',"," SRC_ADD = 'add',"," SRC_REPLACE = 'replace';","","function HistoryBase() {"," this._init.apply(this, arguments);","}","","Y.augment(HistoryBase, Y.EventTarget, null, null, {"," emitFacade : true,"," prefix : 'history',"," preventable: false,"," queueable : true","});","","if (!GlobalEnv._state) {"," GlobalEnv._state = {};","}","","// -- Private Methods ----------------------------------------------------------","","/**"," * Returns <code>true</code> if <i>value</i> is a simple object and not a"," * function or an array."," *"," * @method _isSimpleObject"," * @param {mixed} value"," * @return {Boolean}"," * @private"," */","function _isSimpleObject(value) {"," return Lang.type(value) === 'object';","}","","// -- Public Static Properties -------------------------------------------------","","/**"," * Name of this component."," *"," * @property NAME"," * @type String"," * @static"," */","HistoryBase.NAME = 'historyBase';","","/**"," * Constant used to identify state changes originating from the"," * <code>add()</code> method."," *"," * @property SRC_ADD"," * @type String"," * @static"," * @final"," */","HistoryBase.SRC_ADD = SRC_ADD;","","/**"," * Constant used to identify state changes originating from the"," * <code>replace()</code> method."," *"," * @property SRC_REPLACE"," * @type String"," * @static"," * @final"," */","HistoryBase.SRC_REPLACE = SRC_REPLACE;","","/**"," * Whether or not this browser supports the HTML5 History API."," *"," * @property html5"," * @type Boolean"," * @static"," */","","// All HTML5-capable browsers except Gecko 2+ (Firefox 4+) correctly return","// true for 'onpopstate' in win. In order to support Gecko 2, we fall back to a","// UA sniff for now. (current as of Firefox 4.0b2)","HistoryBase.html5 = !!(win.history && win.history.pushState &&"," win.history.replaceState && ('onpopstate' in win || Y.UA.gecko >= 2) &&"," (!Y.UA.android || Y.UA.android >= 2.4));","","/**"," * Whether or not this browser supports the <code>window.onhashchange</code>"," * event natively. Note that even if this is <code>true</code>, you may"," * still want to use HistoryHash's synthetic <code>hashchange</code> event"," * since it normalizes implementation differences and fixes spec violations"," * across various browsers."," *"," * @property nativeHashChange"," * @type Boolean"," * @static"," */","","// Most browsers that support hashchange expose it on the window. Opera 10.6+","// exposes it on the document (but you can still attach to it on the window).","//","// IE8 supports the hashchange event, but only in IE8 Standards","// Mode. However, IE8 in IE7 compatibility mode still defines the","// event but never fires it, so we can't just detect the event. We also can't","// just UA sniff for IE8, since other browsers support this event as well.","HistoryBase.nativeHashChange = ('onhashchange' in win || 'onhashchange' in doc) &&"," (!docMode || docMode > 7);","","Y.mix(HistoryBase.prototype, {"," // -- Initialization -------------------------------------------------------",""," /**"," * Initializes this HistoryBase instance. This method is called by the"," * constructor."," *"," * @method _init"," * @param {Object} config configuration object"," * @protected"," */"," _init: function (config) {"," var initialState;",""," /**"," * Configuration object provided by the user on instantiation, or an"," * empty object if one wasn't provided."," *"," * @property _config"," * @type Object"," * @default {}"," * @protected"," */"," config = this._config = config || {};",""," /**"," * If `true`, a `history:change` event will be fired whenever the URL"," * changes, even if there is no associated state change."," *"," * @property force"," * @type Boolean"," * @default false"," */"," this.force = !!config.force;",""," /**"," * Resolved initial state: a merge of the user-supplied initial state"," * (if any) and any initial state provided by a subclass. This may"," * differ from <code>_config.initialState</code>. If neither the config"," * nor a subclass supplies an initial state, this property will be"," * <code>null</code>."," *"," * @property _initialState"," * @type Object|null"," * @default {}"," * @protected"," */"," initialState = this._initialState = this._initialState ||"," config.initialState || null;",""," /**"," * Fired when the state changes. To be notified of all state changes"," * regardless of the History or YUI instance that generated them,"," * subscribe to this event on <code>Y.Global</code>. If you would rather"," * be notified only about changes generated by this specific History"," * instance, subscribe to this event on the instance."," *"," * @event history:change"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," *"," * <dl>"," * <dt>changed (Object)</dt>"," * <dd>"," * Object hash of state items that have been added or changed. The"," * key is the item key, and the value is an object containing"," * <code>newVal</code> and <code>prevVal</code> properties"," * representing the values of the item both before and after the"," * change. If the item was newly added, <code>prevVal</code> will be"," * <code>undefined</code>."," * </dd>"," *"," * <dt>newVal (Object)</dt>"," * <dd>"," * Object hash of key/value pairs of all state items after the"," * change."," * </dd>"," *"," * <dt>prevVal (Object)</dt>"," * <dd>"," * Object hash of key/value pairs of all state items before the"," * change."," * </dd>"," *"," * <dt>removed (Object)</dt>"," * <dd>"," * Object hash of key/value pairs of state items that have been"," * removed. Values are the old values prior to removal."," * </dd>"," *"," * <dt>src (String)</dt>"," * <dd>"," * The source of the event. This can be used to selectively ignore"," * events generated by certain sources."," * </dd>"," * </dl>"," */"," this.publish(EVT_CHANGE, {"," broadcast: 2,"," defaultFn: this._defChangeFn"," });",""," // If initialState was provided, merge it into the current state."," if (initialState) {"," this.replace(initialState);"," }"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," * Adds a state entry with new values for the specified keys. By default,"," * the new state will be merged into the existing state, and new values will"," * override existing values. Specifying a <code>null</code> or"," * <code>undefined</code> value will cause that key to be removed from the"," * new state entry."," *"," * @method add"," * @param {Object} state Object hash of key/value pairs."," * @param {Object} options (optional) Zero or more of the following options:"," * <dl>"," * <dt>merge (Boolean)</dt>"," * <dd>"," * <p>"," * If <code>true</code> (the default), the new state will be merged"," * into the existing state. New values will override existing values,"," * and <code>null</code> or <code>undefined</code> values will be"," * removed from the state."," * </p>"," *"," * <p>"," * If <code>false</code>, the existing state will be discarded as a"," * whole and the new state will take its place."," * </p>"," * </dd>"," * </dl>"," * @chainable"," */"," add: function () {"," var args = YArray(arguments, 0, true);"," args.unshift(SRC_ADD);"," return this._change.apply(this, args);"," },",""," /**"," * Adds a state entry with a new value for a single key. By default, the new"," * value will be merged into the existing state values, and will override an"," * existing value with the same key if there is one. Specifying a"," * <code>null</code> or <code>undefined</code> value will cause the key to"," * be removed from the new state entry."," *"," * @method addValue"," * @param {String} key State parameter key."," * @param {String} value New value."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @chainable"," */"," addValue: function (key, value, options) {"," var state = {};"," state[key] = value;"," return this._change(SRC_ADD, state, options);"," },",""," /**"," * Returns the current value of the state parameter specified by <i>key</i>,"," * or an object hash of key/value pairs for all current state parameters if"," * no key is specified."," *"," * @method get"," * @param {String} key (optional) State parameter key."," * @return {Object|String} Value of the specified state parameter, or an"," * object hash of key/value pairs for all current state parameters."," */"," get: function (key) {"," var state = GlobalEnv._state,"," isObject = _isSimpleObject(state);",""," if (key) {"," return isObject && Obj.owns(state, key) ? state[key] : undefined;"," } else {"," return isObject ? Y.mix({}, state, true) : state; // mix provides a fast shallow clone."," }"," },",""," /**"," * Same as <code>add()</code> except that a new browser history entry will"," * not be created. Instead, the current history entry will be replaced with"," * the new state."," *"," * @method replace"," * @param {Object} state Object hash of key/value pairs."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @chainable"," */"," replace: function () {"," var args = YArray(arguments, 0, true);"," args.unshift(SRC_REPLACE);"," return this._change.apply(this, args);"," },",""," /**"," * Same as <code>addValue()</code> except that a new browser history entry"," * will not be created. Instead, the current history entry will be replaced"," * with the new state."," *"," * @method replaceValue"," * @param {String} key State parameter key."," * @param {String} value New value."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @chainable"," */"," replaceValue: function (key, value, options) {"," var state = {};"," state[key] = value;"," return this._change(SRC_REPLACE, state, options);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," * Changes the state. This method provides a common implementation shared by"," * the public methods for changing state."," *"," * @method _change"," * @param {String} src Source of the change, for inclusion in event facades"," * to facilitate filtering."," * @param {Object} state Object hash of key/value pairs."," * @param {Object} options (optional) Zero or more options. See"," * <code>add()</code> for a list of supported options."," * @protected"," * @chainable"," */"," _change: function (src, state, options) {"," options = options ? Y.merge(DEFAULT_OPTIONS, options) : DEFAULT_OPTIONS;",""," if (options.merge && _isSimpleObject(state) &&"," _isSimpleObject(GlobalEnv._state)) {"," state = Y.merge(GlobalEnv._state, state);"," }",""," this._resolveChanges(src, state, options);"," return this;"," },",""," /**"," * Called by _resolveChanges() when the state has changed. This method takes"," * care of actually firing the necessary events."," *"," * @method _fireEvents"," * @param {String} src Source of the changes, for inclusion in event facades"," * to facilitate filtering."," * @param {Object} changes Resolved changes."," * @param {Object} options Zero or more options. See <code>add()</code> for"," * a list of supported options."," * @protected"," */"," _fireEvents: function (src, changes, options) {"," // Fire the global change event."," this.fire(EVT_CHANGE, {"," _options: options,"," changed : changes.changed,"," newVal : changes.newState,"," prevVal : changes.prevState,"," removed : changes.removed,"," src : src"," });",""," // Fire change/remove events for individual items."," Obj.each(changes.changed, function (value, key) {"," this._fireChangeEvent(src, key, value);"," }, this);",""," Obj.each(changes.removed, function (value, key) {"," this._fireRemoveEvent(src, key, value);"," }, this);"," },",""," /**"," * Fires a dynamic \"[key]Change\" event."," *"," * @method _fireChangeEvent"," * @param {String} src source of the change, for inclusion in event facades"," * to facilitate filtering"," * @param {String} key key of the item that was changed"," * @param {Object} value object hash containing <i>newVal</i> and"," * <i>prevVal</i> properties for the changed item"," * @protected"," */"," _fireChangeEvent: function (src, key, value) {"," /**"," * <p>"," * Dynamic event fired when an individual history item is added or"," * changed. The name of this event depends on the name of the key that"," * changed. To listen to change events for a key named \"foo\", subscribe"," * to the <code>fooChange</code> event; for a key named \"bar\", subscribe"," * to <code>barChange</code>, etc."," * </p>"," *"," * <p>"," * Key-specific events are only fired for instance-level changes; that"," * is, changes that were made via the same History instance on which the"," * event is subscribed. To be notified of changes made by other History"," * instances, subscribe to the global <code>history:change</code> event."," * </p>"," *"," * @event [key]Change"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," *"," * <dl>"," * <dt>newVal (mixed)</dt>"," * <dd>"," * The new value of the item after the change."," * </dd>"," *"," * <dt>prevVal (mixed)</dt>"," * <dd>"," * The previous value of the item before the change, or"," * <code>undefined</code> if the item was just added and has no"," * previous value."," * </dd>"," *"," * <dt>src (String)</dt>"," * <dd>"," * The source of the event. This can be used to selectively ignore"," * events generated by certain sources."," * </dd>"," * </dl>"," */"," this.fire(key + 'Change', {"," newVal : value.newVal,"," prevVal: value.prevVal,"," src : src"," });"," },",""," /**"," * Fires a dynamic \"[key]Remove\" event."," *"," * @method _fireRemoveEvent"," * @param {String} src source of the change, for inclusion in event facades"," * to facilitate filtering"," * @param {String} key key of the item that was removed"," * @param {mixed} value value of the item prior to its removal"," * @protected"," */"," _fireRemoveEvent: function (src, key, value) {"," /**"," * <p>"," * Dynamic event fired when an individual history item is removed. The"," * name of this event depends on the name of the key that was removed."," * To listen to remove events for a key named \"foo\", subscribe to the"," * <code>fooRemove</code> event; for a key named \"bar\", subscribe to"," * <code>barRemove</code>, etc."," * </p>"," *"," * <p>"," * Key-specific events are only fired for instance-level changes; that"," * is, changes that were made via the same History instance on which the"," * event is subscribed. To be notified of changes made by other History"," * instances, subscribe to the global <code>history:change</code> event."," * </p>"," *"," * @event [key]Remove"," * @param {EventFacade} e Event facade with the following additional"," * properties:"," *"," * <dl>"," * <dt>prevVal (mixed)</dt>"," * <dd>"," * The value of the item before it was removed."," * </dd>"," *"," * <dt>src (String)</dt>"," * <dd>"," * The source of the event. This can be used to selectively ignore"," * events generated by certain sources."," * </dd>"," * </dl>"," */"," this.fire(key + 'Remove', {"," prevVal: value,"," src : src"," });"," },",""," /**"," * Resolves the changes (if any) between <i>newState</i> and the current"," * state and fires appropriate events if things have changed."," *"," * @method _resolveChanges"," * @param {String} src source of the changes, for inclusion in event facades"," * to facilitate filtering"," * @param {Object} newState object hash of key/value pairs representing the"," * new state"," * @param {Object} options Zero or more options. See <code>add()</code> for"," * a list of supported options."," * @protected"," */"," _resolveChanges: function (src, newState, options) {"," var changed = {},"," isChanged,"," prevState = GlobalEnv._state,"," removed = {};",""," newState || (newState = {});"," options || (options = {});",""," if (_isSimpleObject(newState) && _isSimpleObject(prevState)) {"," // Figure out what was added or changed."," Obj.each(newState, function (newVal, key) {"," var prevVal = prevState[key];",""," if (newVal !== prevVal) {"," changed[key] = {"," newVal : newVal,"," prevVal: prevVal"," };",""," isChanged = true;"," }"," }, this);",""," // Figure out what was removed."," Obj.each(prevState, function (prevVal, key) {"," if (!Obj.owns(newState, key) || newState[key] === null) {"," delete newState[key];"," removed[key] = prevVal;"," isChanged = true;"," }"," }, this);"," } else {"," isChanged = newState !== prevState;"," }",""," if (isChanged || this.force) {"," this._fireEvents(src, {"," changed : changed,"," newState : newState,"," prevState: prevState,"," removed : removed"," }, options);"," }"," },",""," /**"," * Stores the specified state. Don't call this method directly; go through"," * _resolveChanges() to ensure that changes are resolved and all events are"," * fired properly."," *"," * @method _storeState"," * @param {String} src source of the changes"," * @param {Object} newState new state to store"," * @param {Object} options Zero or more options. See <code>add()</code> for"," * a list of supported options."," * @protected"," */"," _storeState: function (src, newState) {"," // Note: the src and options params aren't used here, but they are used"," // by subclasses."," GlobalEnv._state = newState || {};"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," * Default <code>history:change</code> event handler."," *"," * @method _defChangeFn"," * @param {EventFacade} e state change event facade"," * @protected"," */"," _defChangeFn: function (e) {"," this._storeState(e.src, e.newVal, e._options);"," }","}, true);","","Y.HistoryBase = HistoryBase;","","","}, '3.7.3', {\"requires\": [\"event-custom-complex\"]});"]; _yuitest_coverage["build/history-base/history-base.js"].lines = {"1":0,"43":0,"57":0,"58":0,"61":0,"68":0,"69":0,"83":0,"84":0,"96":0,"107":0,"118":0,"131":0,"154":0,"157":0,"169":0,"180":0,"190":0,"204":0,"254":0,"260":0,"261":0,"296":0,"297":0,"298":0,"316":0,"317":0,"318":0,"332":0,"335":0,"336":0,"338":0,"354":0,"355":0,"356":0,"372":0,"373":0,"374":0,"393":0,"395":0,"397":0,"400":0,"401":0,"418":0,"428":0,"429":0,"432":0,"433":0,"489":0,"540":0,"560":0,"565":0,"566":0,"568":0,"570":0,"571":0,"573":0,"574":0,"579":0,"584":0,"585":0,"586":0,"587":0,"588":0,"592":0,"595":0,"596":0,"620":0,"633":0,"637":0}; _yuitest_coverage["build/history-base/history-base.js"].functions = {"HistoryBase:57":0,"_isSimpleObject:83":0,"_init:168":0,"add:295":0,"addValue:315":0,"get:331":0,"replace:353":0,"replaceValue:371":0,"_change:392":0,"(anonymous 2):428":0,"(anonymous 3):432":0,"_fireEvents:416":0,"_fireChangeEvent:448":0,"_fireRemoveEvent:506":0,"(anonymous 4):570":0,"(anonymous 5):584":0,"_resolveChanges:559":0,"_storeState:617":0,"_defChangeFn:632":0,"(anonymous 1):1":0}; _yuitest_coverage["build/history-base/history-base.js"].coveredLines = 70;@@ -766,4 +766,4 @@ Y.HistoryBase = HistoryBase; -}, '3.7.2', {"requires": ["event-custom-complex"]});+}, '3.7.3', {"requires": ["event-custom-complex"]});
bundle/history-base/history-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -643,4 +643,4 @@ Y.HistoryBase = HistoryBase; -}, '3.7.2', {"requires": ["event-custom-complex"]});+}, '3.7.3', {"requires": ["event-custom-complex"]});
bundle/history-base/history-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("history-base",function(e,t){function p(){this._init.apply(this,arguments)}function d(e){return n.type(e)==="object"}var n=e.Lang,r=e.Object,i=YUI.namespace("Env.History"),s=e.Array,o=e.config.doc,u=o.documentMode,a=e.config.win,f={merge:!0},l="change",c="add",h="replace";e.augment(p,e.EventTarget,null,null,{emitFacade:!0,prefix:"history",preventable:!1,queueable:!0}),i._state||(i._state={}),p.NAME="historyBase",p.SRC_ADD=c,p.SRC_REPLACE=h,p.html5=!!(a.history&&a.history.pushState&&a.history.replaceState&&("onpopstate"in a||e.UA.gecko>=2)&&(!e.UA.android||e.UA.android>=2.4)),p.nativeHashChange=("onhashchange"in a||"onhashchange"in o)&&(!u||u>7),e.mix(p.prototype,{_init:function(e){var t;e=this._config=e||{},this.force=!!e.force,t=this._initialState=this._initialState||e.initialState||null,this.publish(l,{broadcast:2,defaultFn:this._defChangeFn}),t&&this.replace(t)},add:function(){var e=s(arguments,0,!0);return e.unshift(c),this._change.apply(this,e)},addValue:function(e,t,n){var r={};return r[e]=t,this._change(c,r,n)},get:function(t){var n=i._state,s=d(n);return t?s&&r.owns(n,t)?n[t]:undefined:s?e.mix({},n,!0):n},replace:function(){var e=s(arguments,0,!0);return e.unshift(h),this._change.apply(this,e)},replaceValue:function(e,t,n){var r={};return r[e]=t,this._change(h,r,n)},_change:function(t,n,r){return r=r?e.merge(f,r):f,r.merge&&d(n)&&d(i._state)&&(n=e.merge(i._state,n)),this._resolveChanges(t,n,r),this},_fireEvents:function(e,t,n){this.fire(l,{_options:n,changed:t.changed,newVal:t.newState,prevVal:t.prevState,removed:t.removed,src:e}),r.each(t.changed,function(t,n){this._fireChangeEvent(e,n,t)},this),r.each(t.removed,function(t,n){this._fireRemoveEvent(e,n,t)},this)},_fireChangeEvent:function(e,t,n){this.fire(t+"Change",{newVal:n.newVal,prevVal:n.prevVal,src:e})},_fireRemoveEvent:function(e,t,n){this.fire(t+"Remove",{prevVal:n,src:e})},_resolveChanges:function(e,t,n){var s={},o,u=i._state,a={};t||(t={}),n||(n={}),d(t)&&d(u)?(r.each(t,function(e,t){var n=u[t];e!==n&&(s[t]={newVal:e,prevVal:n},o=!0)},this),r.each(u,function(e,n){if(!r.owns(t,n)||t[n]===null)delete t[n],a[n]=e,o=!0},this)):o=t!==u,(o||this.force)&&this._fireEvents(e,{changed:s,newState:t,prevState:u,removed:a},n)},_storeState:function(e,t){i._state=t||{}},_defChangeFn:function(e){this._storeState(e.src,e.newVal,e._options)}},!0),e.HistoryBase=p},"3.7.2",{requires:["event-custom-complex"]});+YUI.add("history-base",function(e,t){function p(){this._init.apply(this,arguments)}function d(e){return n.type(e)==="object"}var n=e.Lang,r=e.Object,i=YUI.namespace("Env.History"),s=e.Array,o=e.config.doc,u=o.documentMode,a=e.config.win,f={merge:!0},l="change",c="add",h="replace";e.augment(p,e.EventTarget,null,null,{emitFacade:!0,prefix:"history",preventable:!1,queueable:!0}),i._state||(i._state={}),p.NAME="historyBase",p.SRC_ADD=c,p.SRC_REPLACE=h,p.html5=!!(a.history&&a.history.pushState&&a.history.replaceState&&("onpopstate"in a||e.UA.gecko>=2)&&(!e.UA.android||e.UA.android>=2.4)),p.nativeHashChange=("onhashchange"in a||"onhashchange"in o)&&(!u||u>7),e.mix(p.prototype,{_init:function(e){var t;e=this._config=e||{},this.force=!!e.force,t=this._initialState=this._initialState||e.initialState||null,this.publish(l,{broadcast:2,defaultFn:this._defChangeFn}),t&&this.replace(t)},add:function(){var e=s(arguments,0,!0);return e.unshift(c),this._change.apply(this,e)},addValue:function(e,t,n){var r={};return r[e]=t,this._change(c,r,n)},get:function(t){var n=i._state,s=d(n);return t?s&&r.owns(n,t)?n[t]:undefined:s?e.mix({},n,!0):n},replace:function(){var e=s(arguments,0,!0);return e.unshift(h),this._change.apply(this,e)},replaceValue:function(e,t,n){var r={};return r[e]=t,this._change(h,r,n)},_change:function(t,n,r){return r=r?e.merge(f,r):f,r.merge&&d(n)&&d(i._state)&&(n=e.merge(i._state,n)),this._resolveChanges(t,n,r),this},_fireEvents:function(e,t,n){this.fire(l,{_options:n,changed:t.changed,newVal:t.newState,prevVal:t.prevState,removed:t.removed,src:e}),r.each(t.changed,function(t,n){this._fireChangeEvent(e,n,t)},this),r.each(t.removed,function(t,n){this._fireRemoveEvent(e,n,t)},this)},_fireChangeEvent:function(e,t,n){this.fire(t+"Change",{newVal:n.newVal,prevVal:n.prevVal,src:e})},_fireRemoveEvent:function(e,t,n){this.fire(t+"Remove",{prevVal:n,src:e})},_resolveChanges:function(e,t,n){var s={},o,u=i._state,a={};t||(t={}),n||(n={}),d(t)&&d(u)?(r.each(t,function(e,t){var n=u[t];e!==n&&(s[t]={newVal:e,prevVal:n},o=!0)},this),r.each(u,function(e,n){if(!r.owns(t,n)||t[n]===null)delete t[n],a[n]=e,o=!0},this)):o=t!==u,(o||this.force)&&this._fireEvents(e,{changed:s,newState:t,prevState:u,removed:a},n)},_storeState:function(e,t){i._state=t||{}},_defChangeFn:function(e){this._storeState(e.src,e.newVal,e._options)}},!0),e.HistoryBase=p},"3.7.3",{requires:["event-custom-complex"]});
bundle/history-base/history-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -643,4 +643,4 @@ Y.HistoryBase = HistoryBase; -}, '3.7.2', {"requires": ["event-custom-complex"]});+}, '3.7.3', {"requires": ["event-custom-complex"]});
bundle/history-hash-ie/history-hash-ie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/history-hash-ie/history-hash-ie.js", code: [] };-_yuitest_coverage["build/history-hash-ie/history-hash-ie.js"].code=["YUI.add('history-hash-ie', function (Y, NAME) {","","/**"," * Improves IE6/7 support in history-hash by using a hidden iframe to create"," * entries in IE's browser history. This module is only needed if IE6/7 support"," * is necessary; it's not needed for any other browser."," *"," * @module history"," * @submodule history-hash-ie"," * @since 3.2.0"," */","","// Combination of a UA sniff to ensure this is IE (or a browser that wants us to","// treat it like IE) and feature detection for native hashchange support (false","// for IE < 8 or IE8/9 in IE7 mode).","if (Y.UA.ie && !Y.HistoryBase.nativeHashChange) {"," var Do = Y.Do,"," GlobalEnv = YUI.namespace('Env.HistoryHash'),"," HistoryHash = Y.HistoryHash,",""," iframe = GlobalEnv._iframe,"," win = Y.config.win;",""," /**"," * Gets the raw (not decoded) current location hash from the IE iframe,"," * minus the preceding '#' character and the hashPrefix (if one is set)."," *"," * @method getIframeHash"," * @return {String} current iframe hash"," * @static"," */"," HistoryHash.getIframeHash = function () {"," if (!iframe || !iframe.contentWindow) {"," return '';"," }",""," var prefix = HistoryHash.hashPrefix,"," hash = iframe.contentWindow.location.hash.substr(1);",""," return prefix && hash.indexOf(prefix) === 0 ?"," hash.replace(prefix, '') : hash;"," };",""," /**"," * Updates the history iframe with the specified hash."," *"," * @method _updateIframe"," * @param {String} hash location hash"," * @param {Boolean} replace (optional) if <code>true</code>, the current"," * history state will be replaced without adding a new history entry"," * @protected"," * @static"," * @for HistoryHash"," */"," HistoryHash._updateIframe = function (hash, replace) {"," var iframeDoc = iframe && iframe.contentWindow && iframe.contentWindow.document,"," iframeLocation = iframeDoc && iframeDoc.location;",""," if (!iframeDoc || !iframeLocation) {"," return;"," }","",""," if (replace) {"," iframeLocation.replace(hash.charAt(0) === '#' ? hash : '#' + hash);"," } else {"," iframeDoc.open().close();"," iframeLocation.hash = hash;"," }"," };",""," Do.before(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true);",""," if (!iframe) {"," Y.on('domready', function () {"," var lastUrlHash = HistoryHash.getHash();",""," // Create a hidden iframe to store history state, following the"," // iframe-hiding recommendations from"," // http://www.paciellogroup.com/blog/?p=604."," //"," // This iframe will allow history navigation within the current page"," // context. After navigating to another page, all but the most"," // recent history state will be lost."," //"," // Earlier versions of the YUI History Utility attempted to work"," // around this limitation by having the iframe load a static"," // resource. This workaround was extremely fragile and tended to"," // break frequently (and silently) since it was entirely dependent"," // on IE's inconsistent handling of iframe history."," //"," // Since this workaround didn't work much of the time anyway and"," // added significant complexity, it has been removed, and IE6 and 7"," // now get slightly degraded history support.",""," iframe = GlobalEnv._iframe = Y.Node.getDOMNode(Y.Node.create("," '<iframe src=\"javascript:0\" style=\"display:none\" height=\"0\" width=\"0\" tabindex=\"-1\" title=\"empty\"/>'"," ));",""," // Append the iframe to the documentElement rather than the body."," // Keeping it outside the body prevents scrolling on the initial"," // page load (hat tip to Ben Alman and jQuery BBQ for this"," // technique)."," Y.config.doc.documentElement.appendChild(iframe);",""," // Update the iframe with the initial location hash, if any. This"," // will create an initial history entry that the user can return to"," // after the state has changed."," HistoryHash._updateIframe(lastUrlHash || '#');",""," // Listen for hashchange events and keep the iframe's hash in sync"," // with the parent frame's hash."," Y.on('hashchange', function (e) {"," lastUrlHash = e.newHash;",""," if (HistoryHash.getIframeHash() !== lastUrlHash) {"," HistoryHash._updateIframe(lastUrlHash);"," }"," }, win);",""," // Watch the iframe hash in order to detect back/forward navigation."," Y.later(50, null, function () {"," var iframeHash = HistoryHash.getIframeHash();",""," if (iframeHash !== lastUrlHash) {"," HistoryHash.setHash(iframeHash);"," }"," }, null, true);"," });"," }","}","","","}, '3.7.2', {\"requires\": [\"history-hash\", \"node-base\"]});"];+_yuitest_coverage["build/history-hash-ie/history-hash-ie.js"].code=["YUI.add('history-hash-ie', function (Y, NAME) {","","/**"," * Improves IE6/7 support in history-hash by using a hidden iframe to create"," * entries in IE's browser history. This module is only needed if IE6/7 support"," * is necessary; it's not needed for any other browser."," *"," * @module history"," * @submodule history-hash-ie"," * @since 3.2.0"," */","","// Combination of a UA sniff to ensure this is IE (or a browser that wants us to","// treat it like IE) and feature detection for native hashchange support (false","// for IE < 8 or IE8/9 in IE7 mode).","if (Y.UA.ie && !Y.HistoryBase.nativeHashChange) {"," var Do = Y.Do,"," GlobalEnv = YUI.namespace('Env.HistoryHash'),"," HistoryHash = Y.HistoryHash,",""," iframe = GlobalEnv._iframe,"," win = Y.config.win;",""," /**"," * Gets the raw (not decoded) current location hash from the IE iframe,"," * minus the preceding '#' character and the hashPrefix (if one is set)."," *"," * @method getIframeHash"," * @return {String} current iframe hash"," * @static"," */"," HistoryHash.getIframeHash = function () {"," if (!iframe || !iframe.contentWindow) {"," return '';"," }",""," var prefix = HistoryHash.hashPrefix,"," hash = iframe.contentWindow.location.hash.substr(1);",""," return prefix && hash.indexOf(prefix) === 0 ?"," hash.replace(prefix, '') : hash;"," };",""," /**"," * Updates the history iframe with the specified hash."," *"," * @method _updateIframe"," * @param {String} hash location hash"," * @param {Boolean} replace (optional) if <code>true</code>, the current"," * history state will be replaced without adding a new history entry"," * @protected"," * @static"," * @for HistoryHash"," */"," HistoryHash._updateIframe = function (hash, replace) {"," var iframeDoc = iframe && iframe.contentWindow && iframe.contentWindow.document,"," iframeLocation = iframeDoc && iframeDoc.location;",""," if (!iframeDoc || !iframeLocation) {"," return;"," }","",""," if (replace) {"," iframeLocation.replace(hash.charAt(0) === '#' ? hash : '#' + hash);"," } else {"," iframeDoc.open().close();"," iframeLocation.hash = hash;"," }"," };",""," Do.before(HistoryHash._updateIframe, HistoryHash, 'replaceHash', HistoryHash, true);",""," if (!iframe) {"," Y.on('domready', function () {"," var lastUrlHash = HistoryHash.getHash();",""," // Create a hidden iframe to store history state, following the"," // iframe-hiding recommendations from"," // http://www.paciellogroup.com/blog/?p=604."," //"," // This iframe will allow history navigation within the current page"," // context. After navigating to another page, all but the most"," // recent history state will be lost."," //"," // Earlier versions of the YUI History Utility attempted to work"," // around this limitation by having the iframe load a static"," // resource. This workaround was extremely fragile and tended to"," // break frequently (and silently) since it was entirely dependent"," // on IE's inconsistent handling of iframe history."," //"," // Since this workaround didn't work much of the time anyway and"," // added significant complexity, it has been removed, and IE6 and 7"," // now get slightly degraded history support.",""," iframe = GlobalEnv._iframe = Y.Node.getDOMNode(Y.Node.create("," '<iframe src=\"javascript:0\" style=\"display:none\" height=\"0\" width=\"0\" tabindex=\"-1\" title=\"empty\"/>'"," ));",""," // Append the iframe to the documentElement rather than the body."," // Keeping it outside the body prevents scrolling on the initial"," // page load (hat tip to Ben Alman and jQuery BBQ for this"," // technique)."," Y.config.doc.documentElement.appendChild(iframe);",""," // Update the iframe with the initial location hash, if any. This"," // will create an initial history entry that the user can return to"," // after the state has changed."," HistoryHash._updateIframe(lastUrlHash || '#');",""," // Listen for hashchange events and keep the iframe's hash in sync"," // with the parent frame's hash."," Y.on('hashchange', function (e) {"," lastUrlHash = e.newHash;",""," if (HistoryHash.getIframeHash() !== lastUrlHash) {"," HistoryHash._updateIframe(lastUrlHash);"," }"," }, win);",""," // Watch the iframe hash in order to detect back/forward navigation."," Y.later(50, null, function () {"," var iframeHash = HistoryHash.getIframeHash();",""," if (iframeHash !== lastUrlHash) {"," HistoryHash.setHash(iframeHash);"," }"," }, null, true);"," });"," }","}","","","}, '3.7.3', {\"requires\": [\"history-hash\", \"node-base\"]});"]; _yuitest_coverage["build/history-hash-ie/history-hash-ie.js"].lines = {"1":0,"16":0,"17":0,"32":0,"33":0,"34":0,"37":0,"40":0,"55":0,"56":0,"59":0,"60":0,"64":0,"65":0,"67":0,"68":0,"72":0,"74":0,"75":0,"76":0,"96":0,"104":0,"109":0,"113":0,"114":0,"116":0,"117":0,"122":0,"123":0,"125":0,"126":0}; _yuitest_coverage["build/history-hash-ie/history-hash-ie.js"].functions = {"getIframeHash:32":0,"_updateIframe:55":0,"(anonymous 3):113":0,"(anonymous 4):122":0,"(anonymous 2):75":0,"(anonymous 1):1":0}; _yuitest_coverage["build/history-hash-ie/history-hash-ie.js"].coveredLines = 31;@@ -207,4 +207,4 @@ } -}, '3.7.2', {"requires": ["history-hash", "node-base"]});+}, '3.7.3', {"requires": ["history-hash", "node-base"]});
bundle/history-hash-ie/history-hash-ie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -141,4 +141,4 @@ } -}, '3.7.2', {"requires": ["history-hash", "node-base"]});+}, '3.7.3', {"requires": ["history-hash", "node-base"]});
bundle/history-hash-ie/history-hash-ie-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("history-hash-ie",function(e,t){if(e.UA.ie&&!e.HistoryBase.nativeHashChange){var n=e.Do,r=YUI.namespace("Env.HistoryHash"),i=e.HistoryHash,s=r._iframe,o=e.config.win;i.getIframeHash=function(){if(!s||!s.contentWindow)return"";var e=i.hashPrefix,t=s.contentWindow.location.hash.substr(1);return e&&t.indexOf(e)===0?t.replace(e,""):t},i._updateIframe=function(e,t){var n=s&&s.contentWindow&&s.contentWindow.document,r=n&&n.location;if(!n||!r)return;t?r.replace(e.charAt(0)==="#"?e:"#"+e):(n.open().close(),r.hash=e)},n.before(i._updateIframe,i,"replaceHash",i,!0),s||e.on("domready",function(){var t=i.getHash();s=r._iframe=e.Node.getDOMNode(e.Node.create('<iframe src="javascript:0" style="display:none" height="0" width="0" tabindex="-1" title="empty"/>')),e.config.doc.documentElement.appendChild(s),i._updateIframe(t||"#"),e.on("hashchange",function(e){t=e.newHash,i.getIframeHash()!==t&&i._updateIframe(t)},o),e.later(50,null,function(){var e=i.getIframeHash();e!==t&&i.setHash(e)},null,!0)})}},"3.7.2",{requires:["history-hash","node-base"]});+YUI.add("history-hash-ie",function(e,t){if(e.UA.ie&&!e.HistoryBase.nativeHashChange){var n=e.Do,r=YUI.namespace("Env.HistoryHash"),i=e.HistoryHash,s=r._iframe,o=e.config.win;i.getIframeHash=function(){if(!s||!s.contentWindow)return"";var e=i.hashPrefix,t=s.contentWindow.location.hash.substr(1);return e&&t.indexOf(e)===0?t.replace(e,""):t},i._updateIframe=function(e,t){var n=s&&s.contentWindow&&s.contentWindow.document,r=n&&n.location;if(!n||!r)return;t?r.replace(e.charAt(0)==="#"?e:"#"+e):(n.open().close(),r.hash=e)},n.before(i._updateIframe,i,"replaceHash",i,!0),s||e.on("domready",function(){var t=i.getHash();s=r._iframe=e.Node.getDOMNode(e.Node.create('<iframe src="javascript:0" style="display:none" height="0" width="0" tabindex="-1" title="empty"/>')),e.config.doc.documentElement.appendChild(s),i._updateIframe(t||"#"),e.on("hashchange",function(e){t=e.newHash,i.getIframeHash()!==t&&i._updateIframe(t)},o),e.later(50,null,function(){var e=i.getIframeHash();e!==t&&i.setHash(e)},null,!0)})}},"3.7.3",{requires:["history-hash","node-base"]});
bundle/history-hash-ie/history-hash-ie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -137,4 +137,4 @@ } -}, '3.7.2', {"requires": ["history-hash", "node-base"]});+}, '3.7.3', {"requires": ["history-hash", "node-base"]});
bundle/history-hash/history-hash-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/history-hash/history-hash.js", code: [] };-_yuitest_coverage["build/history-hash/history-hash.js"].code=["YUI.add('history-hash', function (Y, NAME) {","","/**"," * Provides browser history management backed by"," * <code>window.location.hash</code>, as well as convenience methods for working"," * with the location hash and a synthetic <code>hashchange</code> event that"," * normalizes differences across browsers."," *"," * @module history"," * @submodule history-hash"," * @since 3.2.0"," * @class HistoryHash"," * @extends HistoryBase"," * @constructor"," * @param {Object} config (optional) Configuration object. See the HistoryBase"," * documentation for details."," */","","var HistoryBase = Y.HistoryBase,"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,"," GlobalEnv = YUI.namespace('Env.HistoryHash'),",""," SRC_HASH = 'hash',",""," hashNotifiers,"," oldHash,"," oldUrl,"," win = Y.config.win,"," useHistoryHTML5 = Y.config.useHistoryHTML5;","","function HistoryHash() {"," HistoryHash.superclass.constructor.apply(this, arguments);","}","","Y.extend(HistoryHash, HistoryBase, {"," // -- Initialization -------------------------------------------------------"," _init: function (config) {"," var bookmarkedState = HistoryHash.parseHash();",""," // If an initialState was provided, merge the bookmarked state into it"," // (the bookmarked state wins)."," config = config || {};",""," this._initialState = config.initialState ?"," Y.merge(config.initialState, bookmarkedState) : bookmarkedState;",""," // Subscribe to the synthetic hashchange event (defined below) to handle"," // changes."," Y.after('hashchange', Y.bind(this._afterHashChange, this), win);",""," HistoryHash.superclass._init.apply(this, arguments);"," },",""," // -- Protected Methods ----------------------------------------------------"," _change: function (src, state, options) {"," // Stringify all values to ensure that comparisons don't fail after"," // they're coerced to strings in the location hash."," YObject.each(state, function (value, key) {"," if (Lang.isValue(value)) {"," state[key] = value.toString();"," }"," });",""," return HistoryHash.superclass._change.call(this, src, state, options);"," },",""," _storeState: function (src, newState) {"," var decode = HistoryHash.decode,"," newHash = HistoryHash.createHash(newState);",""," HistoryHash.superclass._storeState.apply(this, arguments);",""," // Update the location hash with the changes, but only if the new hash"," // actually differs from the current hash (this avoids creating multiple"," // history entries for a single state)."," //"," // We always compare decoded hashes, since it's possible that the hash"," // could be set incorrectly to a non-encoded value outside of"," // HistoryHash."," if (src !== SRC_HASH && decode(HistoryHash.getHash()) !== decode(newHash)) {"," HistoryHash[src === HistoryBase.SRC_REPLACE ? 'replaceHash' : 'setHash'](newHash);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," * Handler for hashchange events."," *"," * @method _afterHashChange"," * @param {Event} e"," * @protected"," */"," _afterHashChange: function (e) {"," this._resolveChanges(SRC_HASH, HistoryHash.parseHash(e.newHash), {});"," }","}, {"," // -- Public Static Properties ---------------------------------------------"," NAME: 'historyHash',",""," /**"," * Constant used to identify state changes originating from"," * <code>hashchange</code> events."," *"," * @property SRC_HASH"," * @type String"," * @static"," * @final"," */"," SRC_HASH: SRC_HASH,",""," /**"," * <p>"," * Prefix to prepend when setting the hash fragment. For example, if the"," * prefix is <code>!</code> and the hash fragment is set to"," * <code>#foo=bar&baz=quux</code>, the final hash fragment in the URL will"," * become <code>#!foo=bar&baz=quux</code>. This can be used to help make an"," * Ajax application crawlable in accordance with Google's guidelines at"," * <a href=\"http://code.google.com/web/ajaxcrawling/\">http://code.google.com/web/ajaxcrawling/</a>."," * </p>"," *"," * <p>"," * Note that this prefix applies to all HistoryHash instances. It's not"," * possible for individual instances to use their own prefixes since they"," * all operate on the same URL."," * </p>"," *"," * @property hashPrefix"," * @type String"," * @default ''"," * @static"," */"," hashPrefix: '',",""," // -- Protected Static Properties ------------------------------------------",""," /**"," * Regular expression used to parse location hash/query strings."," *"," * @property _REGEX_HASH"," * @type RegExp"," * @protected"," * @static"," * @final"," */"," _REGEX_HASH: /([^\\?#&]+)=([^&]+)/g,",""," // -- Public Static Methods ------------------------------------------------",""," /**"," * Creates a location hash string from the specified object of key/value"," * pairs."," *"," * @method createHash"," * @param {Object} params object of key/value parameter pairs"," * @return {String} location hash string"," * @static"," */"," createHash: function (params) {"," var encode = HistoryHash.encode,"," hash = [];",""," YObject.each(params, function (value, key) {"," if (Lang.isValue(value)) {"," hash.push(encode(key) + '=' + encode(value));"," }"," });",""," return hash.join('&');"," },",""," /**"," * Wrapper around <code>decodeURIComponent()</code> that also converts +"," * chars into spaces."," *"," * @method decode"," * @param {String} string string to decode"," * @return {String} decoded string"," * @static"," */"," decode: function (string) {"," return decodeURIComponent(string.replace(/\\+/g, ' '));"," },",""," /**"," * Wrapper around <code>encodeURIComponent()</code> that converts spaces to"," * + chars."," *"," * @method encode"," * @param {String} string string to encode"," * @return {String} encoded string"," * @static"," */"," encode: function (string) {"," return encodeURIComponent(string).replace(/%20/g, '+');"," },",""," /**"," * Gets the raw (not decoded) current location hash, minus the preceding '#'"," * character and the hashPrefix (if one is set)."," *"," * @method getHash"," * @return {String} current location hash"," * @static"," */"," getHash: (Y.UA.gecko ? function () {"," // Gecko's window.location.hash returns a decoded string and we want all"," // encoding untouched, so we need to get the hash value from"," // window.location.href instead. We have to use UA sniffing rather than"," // feature detection, since the only way to detect this would be to"," // actually change the hash."," var location = Y.getLocation(),"," matches = /#(.*)$/.exec(location.href),"," hash = matches && matches[1] || '',"," prefix = HistoryHash.hashPrefix;",""," return prefix && hash.indexOf(prefix) === 0 ?"," hash.replace(prefix, '') : hash;"," } : function () {"," var location = Y.getLocation(),"," hash = location.hash.substring(1),"," prefix = HistoryHash.hashPrefix;",""," // Slight code duplication here, but execution speed is of the essence"," // since getHash() is called every 50ms to poll for changes in browsers"," // that don't support native onhashchange. An additional function call"," // would add unnecessary overhead."," return prefix && hash.indexOf(prefix) === 0 ?"," hash.replace(prefix, '') : hash;"," }),",""," /**"," * Gets the current bookmarkable URL."," *"," * @method getUrl"," * @return {String} current bookmarkable URL"," * @static"," */"," getUrl: function () {"," return location.href;"," },",""," /**"," * Parses a location hash string into an object of key/value parameter"," * pairs. If <i>hash</i> is not specified, the current location hash will"," * be used."," *"," * @method parseHash"," * @param {String} hash (optional) location hash string"," * @return {Object} object of parsed key/value parameter pairs"," * @static"," */"," parseHash: function (hash) {"," var decode = HistoryHash.decode,"," i,"," len,"," matches,"," param,"," params = {},"," prefix = HistoryHash.hashPrefix,"," prefixIndex;",""," hash = Lang.isValue(hash) ? hash : HistoryHash.getHash();",""," if (prefix) {"," prefixIndex = hash.indexOf(prefix);",""," if (prefixIndex === 0 || (prefixIndex === 1 && hash.charAt(0) === '#')) {"," hash = hash.replace(prefix, '');"," }"," }",""," matches = hash.match(HistoryHash._REGEX_HASH) || [];",""," for (i = 0, len = matches.length; i < len; ++i) {"," param = matches[i].split('=');"," params[decode(param[0])] = decode(param[1]);"," }",""," return params;"," },",""," /**"," * Replaces the browser's current location hash with the specified hash"," * and removes all forward navigation states, without creating a new browser"," * history entry. Automatically prepends the <code>hashPrefix</code> if one"," * is set."," *"," * @method replaceHash"," * @param {String} hash new location hash"," * @static"," */"," replaceHash: function (hash) {"," var location = Y.getLocation(),"," base = location.href.replace(/#.*$/, '');",""," if (hash.charAt(0) === '#') {"," hash = hash.substring(1);"," }",""," location.replace(base + '#' + (HistoryHash.hashPrefix || '') + hash);"," },",""," /**"," * Sets the browser's location hash to the specified string. Automatically"," * prepends the <code>hashPrefix</code> if one is set."," *"," * @method setHash"," * @param {String} hash new location hash"," * @static"," */"," setHash: function (hash) {"," var location = Y.getLocation();",""," if (hash.charAt(0) === '#') {"," hash = hash.substring(1);"," }",""," location.hash = (HistoryHash.hashPrefix || '') + hash;"," }","});","","// -- Synthetic hashchange Event -----------------------------------------------","","// TODO: YUIDoc currently doesn't provide a good way to document synthetic DOM","// events. For now, we're just documenting the hashchange event on the YUI","// object, which is about the best we can do until enhancements are made to","// YUIDoc.","","/**","Synthetic <code>window.onhashchange</code> event that normalizes differences","across browsers and provides support for browsers that don't natively support","<code>onhashchange</code>.","","This event is provided by the <code>history-hash</code> module.","","@example",""," YUI().use('history-hash', function (Y) {"," Y.on('hashchange', function (e) {"," // Handle hashchange events on the current window."," }, Y.config.win);"," });","","@event hashchange","@param {EventFacade} e Event facade with the following additional"," properties:","","<dl>"," <dt>oldHash</dt>"," <dd>"," Previous hash fragment value before the change."," </dd>",""," <dt>oldUrl</dt>"," <dd>"," Previous URL (including the hash fragment) before the change."," </dd>",""," <dt>newHash</dt>"," <dd>"," New hash fragment value after the change."," </dd>",""," <dt>newUrl</dt>"," <dd>"," New URL (including the hash fragment) after the change."," </dd>","</dl>","@for YUI","@since 3.2.0","**/","","hashNotifiers = GlobalEnv._notifiers;","","if (!hashNotifiers) {"," hashNotifiers = GlobalEnv._notifiers = [];","}","","Y.Event.define('hashchange', {"," on: function (node, subscriber, notifier) {"," // Ignore this subscription if the node is anything other than the"," // window or document body, since those are the only elements that"," // should support the hashchange event. Note that the body could also be"," // a frameset, but that's okay since framesets support hashchange too."," if (node.compareTo(win) || node.compareTo(Y.config.doc.body)) {"," hashNotifiers.push(notifier);"," }"," },",""," detach: function (node, subscriber, notifier) {"," var index = YArray.indexOf(hashNotifiers, notifier);",""," if (index !== -1) {"," hashNotifiers.splice(index, 1);"," }"," }","});","","oldHash = HistoryHash.getHash();","oldUrl = HistoryHash.getUrl();","","if (HistoryBase.nativeHashChange) {"," // Wrap the browser's native hashchange event if there's not already a"," // global listener."," if (!GlobalEnv._hashHandle) {"," GlobalEnv._hashHandle = Y.Event.attach('hashchange', function (e) {"," var newHash = HistoryHash.getHash(),"," newUrl = HistoryHash.getUrl();",""," // Iterate over a copy of the hashNotifiers array since a subscriber"," // could detach during iteration and cause the array to be re-indexed."," YArray.each(hashNotifiers.concat(), function (notifier) {"," notifier.fire({"," _event : e,"," oldHash: oldHash,"," oldUrl : oldUrl,"," newHash: newHash,"," newUrl : newUrl"," });"," });",""," oldHash = newHash;"," oldUrl = newUrl;"," }, win);"," }","} else {"," // Begin polling for location hash changes if there's not already a global"," // poll running."," if (!GlobalEnv._hashPoll) {"," GlobalEnv._hashPoll = Y.later(50, null, function () {"," var newHash = HistoryHash.getHash(),"," facade, newUrl;",""," if (oldHash !== newHash) {"," newUrl = HistoryHash.getUrl();",""," facade = {"," oldHash: oldHash,"," oldUrl : oldUrl,"," newHash: newHash,"," newUrl : newUrl"," };",""," oldHash = newHash;"," oldUrl = newUrl;",""," YArray.each(hashNotifiers.concat(), function (notifier) {"," notifier.fire(facade);"," });"," }"," }, null, true);"," }","}","","Y.HistoryHash = HistoryHash;","","// HistoryHash will never win over HistoryHTML5 unless useHistoryHTML5 is false.","if (useHistoryHTML5 === false || (!Y.History && useHistoryHTML5 !== true &&"," (!HistoryBase.html5 || !Y.HistoryHTML5))) {"," Y.History = HistoryHash;","}","","","}, '3.7.2', {\"requires\": [\"event-synthetic\", \"history-base\", \"yui-later\"]});"];+_yuitest_coverage["build/history-hash/history-hash.js"].code=["YUI.add('history-hash', function (Y, NAME) {","","/**"," * Provides browser history management backed by"," * <code>window.location.hash</code>, as well as convenience methods for working"," * with the location hash and a synthetic <code>hashchange</code> event that"," * normalizes differences across browsers."," *"," * @module history"," * @submodule history-hash"," * @since 3.2.0"," * @class HistoryHash"," * @extends HistoryBase"," * @constructor"," * @param {Object} config (optional) Configuration object. See the HistoryBase"," * documentation for details."," */","","var HistoryBase = Y.HistoryBase,"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,"," GlobalEnv = YUI.namespace('Env.HistoryHash'),",""," SRC_HASH = 'hash',",""," hashNotifiers,"," oldHash,"," oldUrl,"," win = Y.config.win,"," useHistoryHTML5 = Y.config.useHistoryHTML5;","","function HistoryHash() {"," HistoryHash.superclass.constructor.apply(this, arguments);","}","","Y.extend(HistoryHash, HistoryBase, {"," // -- Initialization -------------------------------------------------------"," _init: function (config) {"," var bookmarkedState = HistoryHash.parseHash();",""," // If an initialState was provided, merge the bookmarked state into it"," // (the bookmarked state wins)."," config = config || {};",""," this._initialState = config.initialState ?"," Y.merge(config.initialState, bookmarkedState) : bookmarkedState;",""," // Subscribe to the synthetic hashchange event (defined below) to handle"," // changes."," Y.after('hashchange', Y.bind(this._afterHashChange, this), win);",""," HistoryHash.superclass._init.apply(this, arguments);"," },",""," // -- Protected Methods ----------------------------------------------------"," _change: function (src, state, options) {"," // Stringify all values to ensure that comparisons don't fail after"," // they're coerced to strings in the location hash."," YObject.each(state, function (value, key) {"," if (Lang.isValue(value)) {"," state[key] = value.toString();"," }"," });",""," return HistoryHash.superclass._change.call(this, src, state, options);"," },",""," _storeState: function (src, newState) {"," var decode = HistoryHash.decode,"," newHash = HistoryHash.createHash(newState);",""," HistoryHash.superclass._storeState.apply(this, arguments);",""," // Update the location hash with the changes, but only if the new hash"," // actually differs from the current hash (this avoids creating multiple"," // history entries for a single state)."," //"," // We always compare decoded hashes, since it's possible that the hash"," // could be set incorrectly to a non-encoded value outside of"," // HistoryHash."," if (src !== SRC_HASH && decode(HistoryHash.getHash()) !== decode(newHash)) {"," HistoryHash[src === HistoryBase.SRC_REPLACE ? 'replaceHash' : 'setHash'](newHash);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," * Handler for hashchange events."," *"," * @method _afterHashChange"," * @param {Event} e"," * @protected"," */"," _afterHashChange: function (e) {"," this._resolveChanges(SRC_HASH, HistoryHash.parseHash(e.newHash), {});"," }","}, {"," // -- Public Static Properties ---------------------------------------------"," NAME: 'historyHash',",""," /**"," * Constant used to identify state changes originating from"," * <code>hashchange</code> events."," *"," * @property SRC_HASH"," * @type String"," * @static"," * @final"," */"," SRC_HASH: SRC_HASH,",""," /**"," * <p>"," * Prefix to prepend when setting the hash fragment. For example, if the"," * prefix is <code>!</code> and the hash fragment is set to"," * <code>#foo=bar&baz=quux</code>, the final hash fragment in the URL will"," * become <code>#!foo=bar&baz=quux</code>. This can be used to help make an"," * Ajax application crawlable in accordance with Google's guidelines at"," * <a href=\"http://code.google.com/web/ajaxcrawling/\">http://code.google.com/web/ajaxcrawling/</a>."," * </p>"," *"," * <p>"," * Note that this prefix applies to all HistoryHash instances. It's not"," * possible for individual instances to use their own prefixes since they"," * all operate on the same URL."," * </p>"," *"," * @property hashPrefix"," * @type String"," * @default ''"," * @static"," */"," hashPrefix: '',",""," // -- Protected Static Properties ------------------------------------------",""," /**"," * Regular expression used to parse location hash/query strings."," *"," * @property _REGEX_HASH"," * @type RegExp"," * @protected"," * @static"," * @final"," */"," _REGEX_HASH: /([^\\?#&]+)=([^&]+)/g,",""," // -- Public Static Methods ------------------------------------------------",""," /**"," * Creates a location hash string from the specified object of key/value"," * pairs."," *"," * @method createHash"," * @param {Object} params object of key/value parameter pairs"," * @return {String} location hash string"," * @static"," */"," createHash: function (params) {"," var encode = HistoryHash.encode,"," hash = [];",""," YObject.each(params, function (value, key) {"," if (Lang.isValue(value)) {"," hash.push(encode(key) + '=' + encode(value));"," }"," });",""," return hash.join('&');"," },",""," /**"," * Wrapper around <code>decodeURIComponent()</code> that also converts +"," * chars into spaces."," *"," * @method decode"," * @param {String} string string to decode"," * @return {String} decoded string"," * @static"," */"," decode: function (string) {"," return decodeURIComponent(string.replace(/\\+/g, ' '));"," },",""," /**"," * Wrapper around <code>encodeURIComponent()</code> that converts spaces to"," * + chars."," *"," * @method encode"," * @param {String} string string to encode"," * @return {String} encoded string"," * @static"," */"," encode: function (string) {"," return encodeURIComponent(string).replace(/%20/g, '+');"," },",""," /**"," * Gets the raw (not decoded) current location hash, minus the preceding '#'"," * character and the hashPrefix (if one is set)."," *"," * @method getHash"," * @return {String} current location hash"," * @static"," */"," getHash: (Y.UA.gecko ? function () {"," // Gecko's window.location.hash returns a decoded string and we want all"," // encoding untouched, so we need to get the hash value from"," // window.location.href instead. We have to use UA sniffing rather than"," // feature detection, since the only way to detect this would be to"," // actually change the hash."," var location = Y.getLocation(),"," matches = /#(.*)$/.exec(location.href),"," hash = matches && matches[1] || '',"," prefix = HistoryHash.hashPrefix;",""," return prefix && hash.indexOf(prefix) === 0 ?"," hash.replace(prefix, '') : hash;"," } : function () {"," var location = Y.getLocation(),"," hash = location.hash.substring(1),"," prefix = HistoryHash.hashPrefix;",""," // Slight code duplication here, but execution speed is of the essence"," // since getHash() is called every 50ms to poll for changes in browsers"," // that don't support native onhashchange. An additional function call"," // would add unnecessary overhead."," return prefix && hash.indexOf(prefix) === 0 ?"," hash.replace(prefix, '') : hash;"," }),",""," /**"," * Gets the current bookmarkable URL."," *"," * @method getUrl"," * @return {String} current bookmarkable URL"," * @static"," */"," getUrl: function () {"," return location.href;"," },",""," /**"," * Parses a location hash string into an object of key/value parameter"," * pairs. If <i>hash</i> is not specified, the current location hash will"," * be used."," *"," * @method parseHash"," * @param {String} hash (optional) location hash string"," * @return {Object} object of parsed key/value parameter pairs"," * @static"," */"," parseHash: function (hash) {"," var decode = HistoryHash.decode,"," i,"," len,"," matches,"," param,"," params = {},"," prefix = HistoryHash.hashPrefix,"," prefixIndex;",""," hash = Lang.isValue(hash) ? hash : HistoryHash.getHash();",""," if (prefix) {"," prefixIndex = hash.indexOf(prefix);",""," if (prefixIndex === 0 || (prefixIndex === 1 && hash.charAt(0) === '#')) {"," hash = hash.replace(prefix, '');"," }"," }",""," matches = hash.match(HistoryHash._REGEX_HASH) || [];",""," for (i = 0, len = matches.length; i < len; ++i) {"," param = matches[i].split('=');"," params[decode(param[0])] = decode(param[1]);"," }",""," return params;"," },",""," /**"," * Replaces the browser's current location hash with the specified hash"," * and removes all forward navigation states, without creating a new browser"," * history entry. Automatically prepends the <code>hashPrefix</code> if one"," * is set."," *"," * @method replaceHash"," * @param {String} hash new location hash"," * @static"," */"," replaceHash: function (hash) {"," var location = Y.getLocation(),"," base = location.href.replace(/#.*$/, '');",""," if (hash.charAt(0) === '#') {"," hash = hash.substring(1);"," }",""," location.replace(base + '#' + (HistoryHash.hashPrefix || '') + hash);"," },",""," /**"," * Sets the browser's location hash to the specified string. Automatically"," * prepends the <code>hashPrefix</code> if one is set."," *"," * @method setHash"," * @param {String} hash new location hash"," * @static"," */"," setHash: function (hash) {"," var location = Y.getLocation();",""," if (hash.charAt(0) === '#') {"," hash = hash.substring(1);"," }",""," location.hash = (HistoryHash.hashPrefix || '') + hash;"," }","});","","// -- Synthetic hashchange Event -----------------------------------------------","","// TODO: YUIDoc currently doesn't provide a good way to document synthetic DOM","// events. For now, we're just documenting the hashchange event on the YUI","// object, which is about the best we can do until enhancements are made to","// YUIDoc.","","/**","Synthetic <code>window.onhashchange</code> event that normalizes differences","across browsers and provides support for browsers that don't natively support","<code>onhashchange</code>.","","This event is provided by the <code>history-hash</code> module.","","@example",""," YUI().use('history-hash', function (Y) {"," Y.on('hashchange', function (e) {"," // Handle hashchange events on the current window."," }, Y.config.win);"," });","","@event hashchange","@param {EventFacade} e Event facade with the following additional"," properties:","","<dl>"," <dt>oldHash</dt>"," <dd>"," Previous hash fragment value before the change."," </dd>",""," <dt>oldUrl</dt>"," <dd>"," Previous URL (including the hash fragment) before the change."," </dd>",""," <dt>newHash</dt>"," <dd>"," New hash fragment value after the change."," </dd>",""," <dt>newUrl</dt>"," <dd>"," New URL (including the hash fragment) after the change."," </dd>","</dl>","@for YUI","@since 3.2.0","**/","","hashNotifiers = GlobalEnv._notifiers;","","if (!hashNotifiers) {"," hashNotifiers = GlobalEnv._notifiers = [];","}","","Y.Event.define('hashchange', {"," on: function (node, subscriber, notifier) {"," // Ignore this subscription if the node is anything other than the"," // window or document body, since those are the only elements that"," // should support the hashchange event. Note that the body could also be"," // a frameset, but that's okay since framesets support hashchange too."," if (node.compareTo(win) || node.compareTo(Y.config.doc.body)) {"," hashNotifiers.push(notifier);"," }"," },",""," detach: function (node, subscriber, notifier) {"," var index = YArray.indexOf(hashNotifiers, notifier);",""," if (index !== -1) {"," hashNotifiers.splice(index, 1);"," }"," }","});","","oldHash = HistoryHash.getHash();","oldUrl = HistoryHash.getUrl();","","if (HistoryBase.nativeHashChange) {"," // Wrap the browser's native hashchange event if there's not already a"," // global listener."," if (!GlobalEnv._hashHandle) {"," GlobalEnv._hashHandle = Y.Event.attach('hashchange', function (e) {"," var newHash = HistoryHash.getHash(),"," newUrl = HistoryHash.getUrl();",""," // Iterate over a copy of the hashNotifiers array since a subscriber"," // could detach during iteration and cause the array to be re-indexed."," YArray.each(hashNotifiers.concat(), function (notifier) {"," notifier.fire({"," _event : e,"," oldHash: oldHash,"," oldUrl : oldUrl,"," newHash: newHash,"," newUrl : newUrl"," });"," });",""," oldHash = newHash;"," oldUrl = newUrl;"," }, win);"," }","} else {"," // Begin polling for location hash changes if there's not already a global"," // poll running."," if (!GlobalEnv._hashPoll) {"," GlobalEnv._hashPoll = Y.later(50, null, function () {"," var newHash = HistoryHash.getHash(),"," facade, newUrl;",""," if (oldHash !== newHash) {"," newUrl = HistoryHash.getUrl();",""," facade = {"," oldHash: oldHash,"," oldUrl : oldUrl,"," newHash: newHash,"," newUrl : newUrl"," };",""," oldHash = newHash;"," oldUrl = newUrl;",""," YArray.each(hashNotifiers.concat(), function (notifier) {"," notifier.fire(facade);"," });"," }"," }, null, true);"," }","}","","Y.HistoryHash = HistoryHash;","","// HistoryHash will never win over HistoryHTML5 unless useHistoryHTML5 is false.","if (useHistoryHTML5 === false || (!Y.History && useHistoryHTML5 !== true &&"," (!HistoryBase.html5 || !Y.HistoryHTML5))) {"," Y.History = HistoryHash;","}","","","}, '3.7.3', {\"requires\": [\"event-synthetic\", \"history-base\", \"yui-later\"]});"]; _yuitest_coverage["build/history-hash/history-hash.js"].lines = {"1":0,"19":0,"33":0,"34":0,"37":0,"40":0,"44":0,"46":0,"51":0,"53":0,"60":0,"61":0,"62":0,"66":0,"70":0,"73":0,"82":0,"83":0,"97":0,"162":0,"165":0,"166":0,"167":0,"171":0,"184":0,"197":0,"214":0,"219":0,"222":0,"230":0,"242":0,"256":0,"265":0,"267":0,"268":0,"270":0,"271":0,"275":0,"277":0,"278":0,"279":0,"282":0,"296":0,"299":0,"300":0,"303":0,"315":0,"317":0,"318":0,"321":0,"376":0,"378":0,"379":0,"382":0,"388":0,"389":0,"394":0,"396":0,"397":0,"402":0,"403":0,"405":0,"408":0,"409":0,"410":0,"415":0,"416":0,"425":0,"426":0,"432":0,"433":0,"434":0,"437":0,"438":0,"440":0,"447":0,"448":0,"450":0,"451":0,"458":0,"461":0,"463":0}; _yuitest_coverage["build/history-hash/history-hash.js"].functions = {"HistoryHash:33":0,"_init:39":0,"(anonymous 2):60":0,"_change:57":0,"_storeState:69":0,"_afterHashChange:96":0,"(anonymous 3):165":0,"createHash:161":0,"decode:183":0,"encode:196":0,"(anonymous 4):208":0,"}:221":0,"getUrl:241":0,"parseHash:255":0,"replaceHash:295":0,"setHash:314":0,"on:383":0,"detach:393":0,"(anonymous 6):415":0,"(anonymous 5):409":0,"(anonymous 8):450":0,"(anonymous 7):433":0,"(anonymous 1):1":0}; _yuitest_coverage["build/history-hash/history-hash.js"].coveredLines = 82;@@ -608,4 +608,4 @@ } -}, '3.7.2', {"requires": ["event-synthetic", "history-base", "yui-later"]});+}, '3.7.3', {"requires": ["event-synthetic", "history-base", "yui-later"]});
bundle/history-hash/history-hash-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -470,4 +470,4 @@ } -}, '3.7.2', {"requires": ["event-synthetic", "history-base", "yui-later"]});+}, '3.7.3', {"requires": ["event-synthetic", "history-base", "yui-later"]});
bundle/history-hash/history-hash-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("history-hash",function(e,t){function p(){p.superclass.constructor.apply(this,arguments)}var n=e.HistoryBase,r=e.Lang,i=e.Array,s=e.Object,o=YUI.namespace("Env.HistoryHash"),u="hash",a,f,l,c=e.config.win,h=e.config.useHistoryHTML5;e.extend(p,n,{_init:function(t){var n=p.parseHash();t=t||{},this._initialState=t.initialState?e.merge(t.initialState,n):n,e.after("hashchange",e.bind(this._afterHashChange,this),c),p.superclass._init.apply(this,arguments)},_change:function(e,t,n){return s.each(t,function(e,n){r.isValue(e)&&(t[n]=e.toString())}),p.superclass._change.call(this,e,t,n)},_storeState:function(e,t){var r=p.decode,i=p.createHash(t);p.superclass._storeState.apply(this,arguments),e!==u&&r(p.getHash())!==r(i)&&p[e===n.SRC_REPLACE?"replaceHash":"setHash"](i)},_afterHashChange:function(e){this._resolveChanges(u,p.parseHash(e.newHash),{})}},{NAME:"historyHash",SRC_HASH:u,hashPrefix:"",_REGEX_HASH:/([^\?#&]+)=([^&]+)/g,createHash:function(e){var t=p.encode,n=[];return s.each(e,function(e,i){r.isValue(e)&&n.push(t(i)+"="+t(e))}),n.join("&")},decode:function(e){return decodeURIComponent(e.replace(/\+/g," "))},encode:function(e){return encodeURIComponent(e).replace(/%20/g,"+")},getHash:e.UA.gecko?function(){var t=e.getLocation(),n=/#(.*)$/.exec(t.href),r=n&&n[1]||"",i=p.hashPrefix;return i&&r.indexOf(i)===0?r.replace(i,""):r}:function(){var t=e.getLocation(),n=t.hash.substring(1),r=p.hashPrefix;return r&&n.indexOf(r)===0?n.replace(r,""):n},getUrl:function(){return location.href},parseHash:function(e){var t=p.decode,n,i,s,o,u={},a=p.hashPrefix,f;e=r.isValue(e)?e:p.getHash();if(a){f=e.indexOf(a);if(f===0||f===1&&e.charAt(0)==="#")e=e.replace(a,"")}s=e.match(p._REGEX_HASH)||[];for(n=0,i=s.length;n<i;++n)o=s[n].split("="),u[t(o[0])]=t(o[1]);return u},replaceHash:function(t){var n=e.getLocation(),r=n.href.replace(/#.*$/,"");t.charAt(0)==="#"&&(t=t.substring(1)),n.replace(r+"#"+(p.hashPrefix||"")+t)},setHash:function(t){var n=e.getLocation();t.charAt(0)==="#"&&(t=t.substring(1)),n.hash=(p.hashPrefix||"")+t}}),a=o._notifiers,a||(a=o._notifiers=[]),e.Event.define("hashchange",{on:function(t,n,r){(t.compareTo(c)||t.compareTo(e.config.doc.body))&&a.push(r)},detach:function(e,t,n){var r=i.indexOf(a,n);r!==-1&&a.splice(r,1)}}),f=p.getHash(),l=p.getUrl(),n.nativeHashChange?o._hashHandle||(o._hashHandle=e.Event.attach("hashchange",function(e){var t=p.getHash(),n=p.getUrl();i.each(a.concat(),function(r){r.fire({_event:e,oldHash:f,oldUrl:l,newHash:t,newUrl:n})}),f=t,l=n},c)):o._hashPoll||(o._hashPoll=e.later(50,null,function(){var e=p.getHash(),t,n;f!==e&&(n=p.getUrl(),t={oldHash:f,oldUrl:l,newHash:e,newUrl:n},f=e,l=n,i.each(a.concat(),function(e){e.fire(t)}))},null,!0)),e.HistoryHash=p;if(h===!1||!e.History&&h!==!0&&(!n.html5||!e.HistoryHTML5))e.History=p},"3.7.2",{requires:["event-synthetic","history-base","yui-later"]});+YUI.add("history-hash",function(e,t){function p(){p.superclass.constructor.apply(this,arguments)}var n=e.HistoryBase,r=e.Lang,i=e.Array,s=e.Object,o=YUI.namespace("Env.HistoryHash"),u="hash",a,f,l,c=e.config.win,h=e.config.useHistoryHTML5;e.extend(p,n,{_init:function(t){var n=p.parseHash();t=t||{},this._initialState=t.initialState?e.merge(t.initialState,n):n,e.after("hashchange",e.bind(this._afterHashChange,this),c),p.superclass._init.apply(this,arguments)},_change:function(e,t,n){return s.each(t,function(e,n){r.isValue(e)&&(t[n]=e.toString())}),p.superclass._change.call(this,e,t,n)},_storeState:function(e,t){var r=p.decode,i=p.createHash(t);p.superclass._storeState.apply(this,arguments),e!==u&&r(p.getHash())!==r(i)&&p[e===n.SRC_REPLACE?"replaceHash":"setHash"](i)},_afterHashChange:function(e){this._resolveChanges(u,p.parseHash(e.newHash),{})}},{NAME:"historyHash",SRC_HASH:u,hashPrefix:"",_REGEX_HASH:/([^\?#&]+)=([^&]+)/g,createHash:function(e){var t=p.encode,n=[];return s.each(e,function(e,i){r.isValue(e)&&n.push(t(i)+"="+t(e))}),n.join("&")},decode:function(e){return decodeURIComponent(e.replace(/\+/g," "))},encode:function(e){return encodeURIComponent(e).replace(/%20/g,"+")},getHash:e.UA.gecko?function(){var t=e.getLocation(),n=/#(.*)$/.exec(t.href),r=n&&n[1]||"",i=p.hashPrefix;return i&&r.indexOf(i)===0?r.replace(i,""):r}:function(){var t=e.getLocation(),n=t.hash.substring(1),r=p.hashPrefix;return r&&n.indexOf(r)===0?n.replace(r,""):n},getUrl:function(){return location.href},parseHash:function(e){var t=p.decode,n,i,s,o,u={},a=p.hashPrefix,f;e=r.isValue(e)?e:p.getHash();if(a){f=e.indexOf(a);if(f===0||f===1&&e.charAt(0)==="#")e=e.replace(a,"")}s=e.match(p._REGEX_HASH)||[];for(n=0,i=s.length;n<i;++n)o=s[n].split("="),u[t(o[0])]=t(o[1]);return u},replaceHash:function(t){var n=e.getLocation(),r=n.href.replace(/#.*$/,"");t.charAt(0)==="#"&&(t=t.substring(1)),n.replace(r+"#"+(p.hashPrefix||"")+t)},setHash:function(t){var n=e.getLocation();t.charAt(0)==="#"&&(t=t.substring(1)),n.hash=(p.hashPrefix||"")+t}}),a=o._notifiers,a||(a=o._notifiers=[]),e.Event.define("hashchange",{on:function(t,n,r){(t.compareTo(c)||t.compareTo(e.config.doc.body))&&a.push(r)},detach:function(e,t,n){var r=i.indexOf(a,n);r!==-1&&a.splice(r,1)}}),f=p.getHash(),l=p.getUrl(),n.nativeHashChange?o._hashHandle||(o._hashHandle=e.Event.attach("hashchange",function(e){var t=p.getHash(),n=p.getUrl();i.each(a.concat(),function(r){r.fire({_event:e,oldHash:f,oldUrl:l,newHash:t,newUrl:n})}),f=t,l=n},c)):o._hashPoll||(o._hashPoll=e.later(50,null,function(){var e=p.getHash(),t,n;f!==e&&(n=p.getUrl(),t={oldHash:f,oldUrl:l,newHash:e,newUrl:n},f=e,l=n,i.each(a.concat(),function(e){e.fire(t)}))},null,!0)),e.HistoryHash=p;if(h===!1||!e.History&&h!==!0&&(!n.html5||!e.HistoryHTML5))e.History=p},"3.7.3",{requires:["event-synthetic","history-base","yui-later"]});
bundle/history-hash/history-hash.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -470,4 +470,4 @@ } -}, '3.7.2', {"requires": ["event-synthetic", "history-base", "yui-later"]});+}, '3.7.3', {"requires": ["event-synthetic", "history-base", "yui-later"]});
bundle/history-html5/history-html5-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/history-html5/history-html5.js", code: [] };-_yuitest_coverage["build/history-html5/history-html5.js"].code=["YUI.add('history-html5', function (Y, NAME) {","","/**"," * Provides browser history management using the HTML5 history API."," *"," * @module history"," * @submodule history-html5"," * @since 3.2.0"," */","","/**"," * <p>"," * Provides browser history management using the HTML5 history API."," * </p>"," *"," * <p>"," * When calling the <code>add()</code>, <code>addValue()</code>,"," * <code>replace()</code>, or <code>replaceValue()</code> methods on"," * <code>HistoryHTML5</code>, the following additional options are supported:"," * </p>"," *"," * <dl>"," * <dt><strong>title (String)</strong></dt>"," * <dd>"," * Title to use for the new history entry. Browsers will typically display"," * this title to the user in the detailed history window or in a dropdown"," * menu attached to the back/forward buttons. If not specified, the title"," * of the current document will be used."," * </dd>"," *"," * <dt><strong>url (String)</strong></dt>"," * <dd>"," * URL to display to the user for the new history entry. This URL will be"," * visible in the browser's address bar and will be the bookmarked URL if"," * the user bookmarks the page. It may be a relative path (\"foo/bar\"), an"," * absolute path (\"/foo/bar\"), or a full URL (\"http://example.com/foo/bar\")."," * If you specify a full URL, the origin <i>must</i> be the same as the"," * origin of the current page, or an error will occur. If no URL is"," * specified, the current URL will not be changed."," * </dd>"," * </dl>"," *"," * @class HistoryHTML5"," * @extends HistoryBase"," * @constructor"," * @param {Object} config (optional) Configuration object."," */","","var HistoryBase = Y.HistoryBase,"," Lang = Y.Lang,"," win = Y.config.win,"," useHistoryHTML5 = Y.config.useHistoryHTML5,",""," SRC_POPSTATE = 'popstate',"," SRC_REPLACE = HistoryBase.SRC_REPLACE;","","function HistoryHTML5() {"," HistoryHTML5.superclass.constructor.apply(this, arguments);","}","","Y.extend(HistoryHTML5, HistoryBase, {"," // -- Initialization -------------------------------------------------------"," _init: function (config) {"," var bookmarkedState = win.history.state;",""," // Treat empty state objects as `null` so they're not processed further."," if (Y.Object.isEmpty(bookmarkedState)) {"," bookmarkedState = null;"," }",""," config || (config = {});",""," // If both the initial state and the bookmarked state are objects, merge"," // them (bookmarked state wins)."," if (config.initialState"," && Lang.type(config.initialState) === 'object'"," && Lang.type(bookmarkedState) === 'object') {",""," this._initialState = Y.merge(config.initialState, bookmarkedState);"," } else {"," // Otherwise, the bookmarked state always wins if there is one. If"," // there isn't a bookmarked state, history-base will take care of"," // falling back to config.initialState or null."," this._initialState = bookmarkedState;"," }",""," Y.on('popstate', this._onPopState, win, this);",""," HistoryHTML5.superclass._init.apply(this, arguments);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," * Overrides HistoryBase's <code>_storeState()</code> and pushes or replaces"," * a history entry using the HTML5 history API when necessary."," *"," * @method _storeState"," * @param {String} src Source of the changes."," * @param {Object} newState New state to store."," * @param {Object} options Zero or more options."," * @protected"," */"," _storeState: function (src, newState, options) {"," if (src !== SRC_POPSTATE) {"," win.history[src === SRC_REPLACE ? 'replaceState' : 'pushState']("," newState,"," options.title || Y.config.doc.title || '',"," options.url || null"," );"," }",""," HistoryHTML5.superclass._storeState.apply(this, arguments);"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," * Handler for popstate events."," *"," * @method _onPopState"," * @param {Event} e"," * @protected"," */"," _onPopState: function (e) {"," this._resolveChanges(SRC_POPSTATE, e._event.state || null);"," }","}, {"," // -- Public Static Properties ---------------------------------------------"," NAME: 'historyhtml5',",""," /**"," * Constant used to identify state changes originating from"," * <code>popstate</code> events."," *"," * @property SRC_POPSTATE"," * @type String"," * @static"," * @final"," */"," SRC_POPSTATE: SRC_POPSTATE","});","","if (!Y.Node.DOM_EVENTS.popstate) {"," Y.Node.DOM_EVENTS.popstate = 1;","}","","Y.HistoryHTML5 = HistoryHTML5;","","/**"," * <p>"," * If <code>true</code>, the <code>Y.History</code> alias will always point to"," * <code>Y.HistoryHTML5</code> when the history-html5 module is loaded, even if"," * the current browser doesn't support HTML5 history."," * </p>"," *"," * <p>"," * If <code>false</code>, the <code>Y.History</code> alias will always point to"," * <code>Y.HistoryHash</code> when the history-hash module is loaded, even if"," * the current browser supports HTML5 history."," * </p>"," *"," * <p>"," * If neither <code>true</code> nor <code>false</code>, the"," * <code>Y.History</code> alias will point to the best available history adapter"," * that the browser supports. This is the default behavior."," * </p>"," *"," * @property useHistoryHTML5"," * @type boolean"," * @for config"," * @since 3.2.0"," */","","// HistoryHTML5 will always win over HistoryHash unless useHistoryHTML5 is false","// or HTML5 history is not supported.","if (useHistoryHTML5 === true || (useHistoryHTML5 !== false &&"," HistoryBase.html5)) {"," Y.History = HistoryHTML5;","}","","","}, '3.7.2', {\"optional\": [\"json\"], \"requires\": [\"event-base\", \"history-base\", \"node-base\"]});"];+_yuitest_coverage["build/history-html5/history-html5.js"].code=["YUI.add('history-html5', function (Y, NAME) {","","/**"," * Provides browser history management using the HTML5 history API."," *"," * @module history"," * @submodule history-html5"," * @since 3.2.0"," */","","/**"," * <p>"," * Provides browser history management using the HTML5 history API."," * </p>"," *"," * <p>"," * When calling the <code>add()</code>, <code>addValue()</code>,"," * <code>replace()</code>, or <code>replaceValue()</code> methods on"," * <code>HistoryHTML5</code>, the following additional options are supported:"," * </p>"," *"," * <dl>"," * <dt><strong>title (String)</strong></dt>"," * <dd>"," * Title to use for the new history entry. Browsers will typically display"," * this title to the user in the detailed history window or in a dropdown"," * menu attached to the back/forward buttons. If not specified, the title"," * of the current document will be used."," * </dd>"," *"," * <dt><strong>url (String)</strong></dt>"," * <dd>"," * URL to display to the user for the new history entry. This URL will be"," * visible in the browser's address bar and will be the bookmarked URL if"," * the user bookmarks the page. It may be a relative path (\"foo/bar\"), an"," * absolute path (\"/foo/bar\"), or a full URL (\"http://example.com/foo/bar\")."," * If you specify a full URL, the origin <i>must</i> be the same as the"," * origin of the current page, or an error will occur. If no URL is"," * specified, the current URL will not be changed."," * </dd>"," * </dl>"," *"," * @class HistoryHTML5"," * @extends HistoryBase"," * @constructor"," * @param {Object} config (optional) Configuration object."," */","","var HistoryBase = Y.HistoryBase,"," Lang = Y.Lang,"," win = Y.config.win,"," useHistoryHTML5 = Y.config.useHistoryHTML5,",""," SRC_POPSTATE = 'popstate',"," SRC_REPLACE = HistoryBase.SRC_REPLACE;","","function HistoryHTML5() {"," HistoryHTML5.superclass.constructor.apply(this, arguments);","}","","Y.extend(HistoryHTML5, HistoryBase, {"," // -- Initialization -------------------------------------------------------"," _init: function (config) {"," var bookmarkedState = win.history.state;",""," // Treat empty state objects as `null` so they're not processed further."," if (Y.Object.isEmpty(bookmarkedState)) {"," bookmarkedState = null;"," }",""," config || (config = {});",""," // If both the initial state and the bookmarked state are objects, merge"," // them (bookmarked state wins)."," if (config.initialState"," && Lang.type(config.initialState) === 'object'"," && Lang.type(bookmarkedState) === 'object') {",""," this._initialState = Y.merge(config.initialState, bookmarkedState);"," } else {"," // Otherwise, the bookmarked state always wins if there is one. If"," // there isn't a bookmarked state, history-base will take care of"," // falling back to config.initialState or null."," this._initialState = bookmarkedState;"," }",""," Y.on('popstate', this._onPopState, win, this);",""," HistoryHTML5.superclass._init.apply(this, arguments);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," * Overrides HistoryBase's <code>_storeState()</code> and pushes or replaces"," * a history entry using the HTML5 history API when necessary."," *"," * @method _storeState"," * @param {String} src Source of the changes."," * @param {Object} newState New state to store."," * @param {Object} options Zero or more options."," * @protected"," */"," _storeState: function (src, newState, options) {"," if (src !== SRC_POPSTATE) {"," win.history[src === SRC_REPLACE ? 'replaceState' : 'pushState']("," newState,"," options.title || Y.config.doc.title || '',"," options.url || null"," );"," }",""," HistoryHTML5.superclass._storeState.apply(this, arguments);"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," * Handler for popstate events."," *"," * @method _onPopState"," * @param {Event} e"," * @protected"," */"," _onPopState: function (e) {"," this._resolveChanges(SRC_POPSTATE, e._event.state || null);"," }","}, {"," // -- Public Static Properties ---------------------------------------------"," NAME: 'historyhtml5',",""," /**"," * Constant used to identify state changes originating from"," * <code>popstate</code> events."," *"," * @property SRC_POPSTATE"," * @type String"," * @static"," * @final"," */"," SRC_POPSTATE: SRC_POPSTATE","});","","if (!Y.Node.DOM_EVENTS.popstate) {"," Y.Node.DOM_EVENTS.popstate = 1;","}","","Y.HistoryHTML5 = HistoryHTML5;","","/**"," * <p>"," * If <code>true</code>, the <code>Y.History</code> alias will always point to"," * <code>Y.HistoryHTML5</code> when the history-html5 module is loaded, even if"," * the current browser doesn't support HTML5 history."," * </p>"," *"," * <p>"," * If <code>false</code>, the <code>Y.History</code> alias will always point to"," * <code>Y.HistoryHash</code> when the history-hash module is loaded, even if"," * the current browser supports HTML5 history."," * </p>"," *"," * <p>"," * If neither <code>true</code> nor <code>false</code>, the"," * <code>Y.History</code> alias will point to the best available history adapter"," * that the browser supports. This is the default behavior."," * </p>"," *"," * @property useHistoryHTML5"," * @type boolean"," * @for config"," * @since 3.2.0"," */","","// HistoryHTML5 will always win over HistoryHash unless useHistoryHTML5 is false","// or HTML5 history is not supported.","if (useHistoryHTML5 === true || (useHistoryHTML5 !== false &&"," HistoryBase.html5)) {"," Y.History = HistoryHTML5;","}","","","}, '3.7.3', {\"optional\": [\"json\"], \"requires\": [\"event-base\", \"history-base\", \"node-base\"]});"]; _yuitest_coverage["build/history-html5/history-html5.js"].lines = {"1":0,"49":0,"57":0,"58":0,"61":0,"64":0,"67":0,"68":0,"71":0,"75":0,"79":0,"84":0,"87":0,"89":0,"105":0,"106":0,"113":0,"126":0,"144":0,"145":0,"148":0,"177":0,"179":0}; _yuitest_coverage["build/history-html5/history-html5.js"].functions = {"HistoryHTML5:57":0,"_init:63":0,"_storeState:104":0,"_onPopState:125":0,"(anonymous 1):1":0}; _yuitest_coverage["build/history-html5/history-html5.js"].coveredLines = 23;@@ -247,4 +247,4 @@ } -}, '3.7.2', {"optional": ["json"], "requires": ["event-base", "history-base", "node-base"]});+}, '3.7.3', {"optional": ["json"], "requires": ["event-base", "history-base", "node-base"]});
bundle/history-html5/history-html5-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -186,4 +186,4 @@ } -}, '3.7.2', {"optional": ["json"], "requires": ["event-base", "history-base", "node-base"]});+}, '3.7.3', {"optional": ["json"], "requires": ["event-base", "history-base", "node-base"]});
bundle/history-html5/history-html5-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("history-html5",function(e,t){function a(){a.superclass.constructor.apply(this,arguments)}var n=e.HistoryBase,r=e.Lang,i=e.config.win,s=e.config.useHistoryHTML5,o="popstate",u=n.SRC_REPLACE;e.extend(a,n,{_init:function(t){var n=i.history.state;e.Object.isEmpty(n)&&(n=null),t||(t={}),t.initialState&&r.type(t.initialState)==="object"&&r.type(n)==="object"?this._initialState=e.merge(t.initialState,n):this._initialState=n,e.on("popstate",this._onPopState,i,this),a.superclass._init.apply(this,arguments)},_storeState:function(t,n,r){t!==o&&i.history[t===u?"replaceState":"pushState"](n,r.title||e.config.doc.title||"",r.url||null),a.superclass._storeState.apply(this,arguments)},_onPopState:function(e){this._resolveChanges(o,e._event.state||null)}},{NAME:"historyhtml5",SRC_POPSTATE:o}),e.Node.DOM_EVENTS.popstate||(e.Node.DOM_EVENTS.popstate=1),e.HistoryHTML5=a;if(s===!0||s!==!1&&n.html5)e.History=a},"3.7.2",{optional:["json"],requires:["event-base","history-base","node-base"]});+YUI.add("history-html5",function(e,t){function a(){a.superclass.constructor.apply(this,arguments)}var n=e.HistoryBase,r=e.Lang,i=e.config.win,s=e.config.useHistoryHTML5,o="popstate",u=n.SRC_REPLACE;e.extend(a,n,{_init:function(t){var n=i.history.state;e.Object.isEmpty(n)&&(n=null),t||(t={}),t.initialState&&r.type(t.initialState)==="object"&&r.type(n)==="object"?this._initialState=e.merge(t.initialState,n):this._initialState=n,e.on("popstate",this._onPopState,i,this),a.superclass._init.apply(this,arguments)},_storeState:function(t,n,r){t!==o&&i.history[t===u?"replaceState":"pushState"](n,r.title||e.config.doc.title||"",r.url||null),a.superclass._storeState.apply(this,arguments)},_onPopState:function(e){this._resolveChanges(o,e._event.state||null)}},{NAME:"historyhtml5",SRC_POPSTATE:o}),e.Node.DOM_EVENTS.popstate||(e.Node.DOM_EVENTS.popstate=1),e.HistoryHTML5=a;if(s===!0||s!==!1&&n.html5)e.History=a},"3.7.3",{optional:["json"],requires:["event-base","history-base","node-base"]});
bundle/history-html5/history-html5.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -186,4 +186,4 @@ } -}, '3.7.2', {"optional": ["json"], "requires": ["event-base", "history-base", "node-base"]});+}, '3.7.3', {"optional": ["json"], "requires": ["event-base", "history-base", "node-base"]});
bundle/imageloader/imageloader-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/imageloader/imageloader.js", code: [] };-_yuitest_coverage["build/imageloader/imageloader.js"].code=["YUI.add('imageloader', function (Y, NAME) {","","/**"," * 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"," */","",""," /**"," * 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 ImgLoadGroup"," * @extends Base"," * @constructor"," */"," Y.ImgLoadGroup = function() {"," // call init first, because it sets up local vars for storing attribute-related info"," this._init();"," Y.ImgLoadGroup.superclass.constructor.apply(this, arguments);"," };",""," Y.ImgLoadGroup.NAME = 'imgLoadGroup';",""," Y.ImgLoadGroup.ATTRS = {"," "," /**"," * Name for the group. Only used to identify the group in logging statements."," * @attribute name"," * @type String"," */"," name: {"," value: ''"," },",""," /**"," * Time limit, in seconds, after which images are fetched regardless of trigger events."," * @attribute timeLimit"," * @type Number"," */"," timeLimit: {"," value: null"," },",""," /**"," * Distance below the fold for which images are loaded. Images are not loaded until they are at most this distance away from (or above) the fold."," * This check is performed at page load (domready) and after any window scroll or window resize event (until all images are loaded)."," * @attribute foldDistance"," * @type Number"," */"," foldDistance: {"," validator: Y.Lang.isNumber,"," setter: function(val) { this._setFoldTriggers(); return val; },"," lazyAdd: 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, \"<code>background:none !important;</code>\"."," * @attribute className"," * @type String"," */"," className: {"," value: null,"," setter: function(name) { this._className = name; return name; },"," lazyAdd: false"," }, "," "," /**"," * Determines how to act when className is used as the way to delay load images. The \"default\" action is to just"," * remove the class name. The \"enhanced\" action is to remove the class name and also set the src attribute if"," * the element is an img."," * @attribute classNameAction"," * @type String"," */"," classNameAction: {"," value: \"default\""," }",""," };",""," var groupProto = {",""," /**"," * Initialize all private members needed for the group."," * @method _init"," * @private"," */"," _init: function() {",""," /**"," * Collection of triggers for this group."," * Keeps track of each trigger's event handle, as returned from <code>Y.on</code>."," * @property _triggers"," * @private"," * @type Array"," */"," this._triggers = [];",""," /**"," * Collection of images (<code>Y.ImgLoadImgObj</code> objects) registered with this group, keyed by DOM id."," * @property _imgObjs"," * @private"," * @type Object"," */"," this._imgObjs = {};",""," /**"," * Timeout object to keep a handle on the time limit."," * @property _timeout"," * @private"," * @type Object"," */"," this._timeout = null;",""," /**"," * DOM elements having the class name that is associated with this group."," * Elements are stored during the <code>_foldCheck</code> function and reused later during any subsequent <code>_foldCheck</code> calls - gives a slight performance improvement when the page fold is repeatedly checked."," * @property _classImageEls"," * @private"," * @type Array"," */"," this._classImageEls = null;",""," /**"," * Keep the CSS class name in a member variable for ease and speed."," * @property _className"," * @private"," * @type String"," */"," this._className = null;",""," /**"," * Boolean tracking whether the window scroll and window resize triggers have been set if this is a fold group."," * @property _areFoldTriggersSet"," * @private"," * @type Boolean"," */"," this._areFoldTriggersSet = false;",""," /**"," * The maximum pixel height of the document that has been made visible."," * During fold checks, if the user scrolls up then there's no need to check for newly exposed images."," * @property _maxKnownHLimit"," * @private"," * @type Int"," */"," this._maxKnownHLimit = 0;",""," // add a listener to domready that will start the time limit"," Y.on('domready', this._onloadTasks, this);"," },",""," /**"," * Adds a trigger to the group. Arguments are passed to <code>Y.on</code>."," * @method addTrigger"," * @chainable"," * @param {Object} obj The DOM object to attach the trigger event to"," * @param {String} type The event type"," */"," addTrigger: function(obj, type) {"," if (! obj || ! type) {"," return this;"," }","",""," /* 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 detach call finds the first window-scroll event with Y.ILG.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( Y.on(type, wrappedFetch, obj, this) );",""," return this;"," },",""," /**"," * Adds a custom event trigger to the group."," * @method addCustomTrigger"," * @chainable"," * @param {String} name The name of the event"," * @param {Object} obj The object on which to attach the event. <code>obj</code> is optional - by default the event is attached to the <code>Y</code> instance"," */"," addCustomTrigger: function(name, obj) {"," if (! name) {"," return this;"," }","",""," // see comment in addTrigger()"," var wrappedFetch = function() {"," this.fetch();"," };"," if (Y.Lang.isUndefined(obj)) {"," this._triggers.push( Y.on(name, wrappedFetch, this) );"," }"," else {"," this._triggers.push( obj.on(name, wrappedFetch, this) );"," }",""," return this;"," },",""," /**"," * Sets the window scroll and window resize triggers for any group that is fold-conditional (i.e., has a fold distance set)."," * @method _setFoldTriggers"," * @private"," */"," _setFoldTriggers: function() {"," if (this._areFoldTriggersSet) {"," return;"," }","",""," var wrappedFoldCheck = function() {"," this._foldCheck();"," };"," this._triggers.push( Y.on('scroll', wrappedFoldCheck, window, this) );"," this._triggers.push( Y.on('resize', wrappedFoldCheck, window, this) );"," this._areFoldTriggersSet = true;"," },",""," /**"," * Performs necessary setup at domready time."," * Initiates time limit for group; executes the fold check for the images."," * @method _onloadTasks"," * @private"," */"," _onloadTasks: function() {"," var timeLim = this.get('timeLimit');"," if (timeLim && timeLim > 0) {"," this._timeout = setTimeout(this._getFetchTimeout(), timeLim * 1000);"," }",""," if (! Y.Lang.isUndefined(this.get('foldDistance'))) {"," this._foldCheck();"," }"," },",""," /**"," * Returns the group's <code>fetch</code> method, with the proper closure, for use with <code>setTimeout</code>."," * @method _getFetchTimeout"," * @return {Function} group's <code>fetch</code> method"," * @private"," */"," _getFetchTimeout: function() {"," var self = this;"," return function() { self.fetch(); };"," },",""," /**"," * Registers an image with the group."," * Arguments are passed through to a <code>Y.ImgLoadImgObj</code> constructor; see that class' attribute documentation for detailed information. \"<code>domId</code>\" is a required attribute."," * @method registerImage"," * @param {Object} * A configuration object literal with attribute name/value pairs (passed through to a <code>Y.ImgLoadImgObj</code> constructor)"," * @return {Object} <code>Y.ImgLoadImgObj</code> that was registered"," */"," registerImage: function() {"," var domId = arguments[0].domId;"," if (! domId) {"," return null;"," }","",""," this._imgObjs[domId] = new Y.ImgLoadImgObj(arguments[0]);"," return this._imgObjs[domId];"," },",""," /**"," * Displays the images in the group."," * This method is called when a trigger fires or the time limit expires; it shouldn't be called externally, but is not private in the rare event that it needs to be called immediately."," * @method fetch"," */"," fetch: function() {",""," // done with the triggers"," this._clearTriggers();",""," // fetch whatever we need to by className"," this._fetchByClass();",""," // fetch registered images"," for (var id in this._imgObjs) {"," if (this._imgObjs.hasOwnProperty(id)) {"," this._imgObjs[id].fetch();"," }"," }"," },",""," /**"," * Clears the timeout and all triggers associated with the group."," * @method _clearTriggers"," * @private"," */"," _clearTriggers: function() {"," clearTimeout(this._timeout);"," // detach all listeners"," for (var i=0, len = this._triggers.length; i < len; i++) {"," this._triggers[i].detach();"," }"," },",""," /**"," * Checks the position of each image in the group. If any part of the image is within the specified distance (<code>foldDistance</code>) of the client viewport, the image is fetched immediately."," * @method _foldCheck"," * @private"," */"," _foldCheck: function() {",""," var allFetched = true,"," viewReg = Y.DOM.viewportRegion(),"," hLimit = viewReg.bottom + this.get('foldDistance'),"," id, imgFetched, els, i, len;",""," // unless we've uncovered new frontiers, there's no need to continue"," if (hLimit <= this._maxKnownHLimit) {"," return;"," }"," this._maxKnownHLimit = hLimit;",""," for (id in this._imgObjs) {"," if (this._imgObjs.hasOwnProperty(id)) {"," imgFetched = this._imgObjs[id].fetch(hLimit);"," allFetched = allFetched && imgFetched;"," }"," }",""," // and by class"," if (this._className) {"," if (this._classImageEls === null) {"," // get all the relevant elements and store them"," this._classImageEls = [];"," els = Y.all('.' + this._className);"," els.each( function(node) { this._classImageEls.push( { el: node, y: node.getY(), fetched: false } ); }, this);"," }"," els = this._classImageEls;"," for (i=0, len = els.length; i < len; i++) {"," if (els[i].fetched) {"," continue;"," }"," if (els[i].y && els[i].y <= hLimit) {"," //els[i].el.removeClass(this._className);"," this._updateNodeClassName(els[i].el);"," els[i].fetched = true;"," }"," else {"," allFetched = false;"," }"," }"," }"," "," // if allFetched, remove listeners"," if (allFetched) {"," this._clearTriggers();"," }"," },"," "," /**"," * Updates a given node, removing the ImageLoader class name. If the"," * node is an img and the classNameAction is \"enhanced\", then node"," * class name is removed and also the src attribute is set to the "," * image URL as well as clearing the style background image."," * @method _updateNodeClassName"," * @param node {Node} The node to act on."," * @private"," */"," _updateNodeClassName: function(node){"," var url;"," "," if (this.get(\"classNameAction\") == \"enhanced\"){"," "," if (node.get(\"tagName\").toLowerCase() == \"img\"){"," url = node.getStyle(\"backgroundImage\");"," /url\\([\"']?(.*?)[\"']?\\)/.test(url);"," url = RegExp.$1;"," node.set(\"src\", url);"," node.setStyle(\"backgroundImage\", \"\");"," }"," }"," "," node.removeClass(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"," */"," _fetchByClass: function() {"," if (! this._className) {"," return;"," }","",""," Y.all('.' + this._className).each(Y.bind(this._updateNodeClassName, this));"," }",""," };","",""," Y.extend(Y.ImgLoadGroup, Y.Base, groupProto);","",""," //------------------------------------------------","",""," /**"," * Image objects to be registered with the groups"," * @class ImgLoadImgObj"," * @extends Base"," * @constructor"," */"," Y.ImgLoadImgObj = function() {"," Y.ImgLoadImgObj.superclass.constructor.apply(this, arguments);"," this._init();"," };"," "," Y.ImgLoadImgObj.NAME = 'imgLoadImgObj';",""," Y.ImgLoadImgObj.ATTRS = {"," /**"," * HTML DOM id of the image element."," * @attribute domId"," * @type String"," */"," domId: {"," value: null,"," writeOnce: true"," },",""," /**"," * Background URL for the image."," * For an image whose URL is specified by \"<code>background-image</code>\" in the element's style."," * @attribute bgUrl"," * @type String"," */"," bgUrl: {"," value: null"," },",""," /**"," * Source URL for the image."," * For an image whose URL is specified by a \"<code>src</code>\" attribute in the DOM element."," * @attribute srcUrl"," * @type String"," */"," srcUrl: {"," value: null"," },",""," /**"," * Pixel width of the image. Will be set as a <code>width</code> attribute on the DOM element after the image is fetched."," * Defaults to the natural width of the image (no <code>width</code> attribute will be set)."," * Usually only used with src images."," * @attribute width"," * @type Int"," */"," width: {"," value: null"," },",""," /**"," * Pixel height of the image. Will be set as a <code>height</code> attribute on the DOM element after the image is fetched."," * Defaults to the natural height of the image (no <code>height</code> attribute will be set)."," * Usually only used with src images."," * @attribute height"," * @type Int"," */"," height: {"," value: null"," },",""," /**"," * Whether the image's <code>style.visibility</code> should be set to <code>visible</code> after the image is fetched."," * Used when setting images as <code>visibility:hidden</code> prior to image fetching."," * @attribute setVisible"," * @type Boolean"," */"," setVisible: {"," value: false"," },",""," /**"," * Whether the image is a PNG."," * PNG images get special treatment in that the URL is specified through AlphaImageLoader for IE, versions 6 and earlier."," * Only used with background images."," * @attribute isPng"," * @type Boolean"," */"," isPng: {"," value: false"," },",""," /**"," * AlphaImageLoader <code>sizingMethod</code> property to be set for the image."," * Only set if <code>isPng</code> value for this image is set to <code>true</code>."," * Defaults to <code>scale</code>."," * @attribute sizingMethod"," * @type String"," */"," sizingMethod: {"," value: 'scale'"," },",""," /**"," * AlphaImageLoader <code>enabled</code> property to be set for the image."," * Only set if <code>isPng</code> value for this image is set to <code>true</code>."," * Defaults to <code>true</code>."," * @attribute enabled"," * @type String"," */"," enabled: {"," value: 'true'"," }",""," };",""," var imgProto = {",""," /**"," * Initialize all private members needed for the group."," * @method _init"," * @private"," */"," _init: function() {",""," /**"," * Whether this image has already been fetched."," * In the case of fold-conditional groups, images won't be fetched twice."," * @property _fetched"," * @private"," * @type Boolean"," */"," this._fetched = false;",""," /**"," * The Node object returned from <code>Y.one</code>, to avoid repeat calls to access the DOM."," * @property _imgEl"," * @private"," * @type Object"," */"," this._imgEl = null;",""," /**"," * The vertical position returned from <code>getY</code>, to avoid repeat calls to access the DOM."," * The Y position is checked only for images registered with fold-conditional groups. The position is checked first at page load (domready)"," * and this caching enhancement assumes that the image's vertical position won't change after that first check."," * @property _yPos"," * @private"," * @type Int"," */"," this._yPos = null;"," },",""," /**"," * Displays the image; puts the URL into the DOM."," * This method shouldn't be called externally, but is not private in the rare event that it needs to be called immediately."," * @method fetch"," * @param {Int} withinY The pixel distance from the top of the page, for which if the image lies within, it will be fetched. Undefined indicates that no check should be made, and the image should always be fetched"," * @return {Boolean} Whether the image has been fetched (either during this execution or previously)"," */"," fetch: function(withinY) {"," if (this._fetched) {"," return true;"," }",""," var el = this._getImgEl(),"," yPos;"," if (! el) {"," return false;"," }",""," if (withinY) {"," // need a distance check"," yPos = this._getYPos();"," if (! yPos || yPos > withinY) {"," return false;"," }"," }","",""," // apply url"," if (this.get('bgUrl') !== null) {"," // bg url"," if (this.get('isPng') && Y.UA.ie && Y.UA.ie <= 6) {"," // png for which to apply AlphaImageLoader"," el.setStyle('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"' + this.get('bgUrl') + '\", sizingMethod=\"' + this.get('sizingMethod') + '\", enabled=\"' + this.get('enabled') + '\")');"," }"," else {"," // regular bg image"," el.setStyle('backgroundImage', \"url('\" + this.get('bgUrl') + \"')\");"," }"," }"," else if (this.get('srcUrl') !== null) {"," // regular src image"," el.setAttribute('src', this.get('srcUrl'));"," }",""," // apply attributes"," if (this.get('setVisible')) {"," el.setStyle('visibility', 'visible');"," }"," if (this.get('width')) {"," el.setAttribute('width', this.get('width'));"," }"," if (this.get('height')) {"," el.setAttribute('height', this.get('height'));"," }",""," this._fetched = true;",""," return true;"," },",""," /**"," * Gets the object (as a <code>Y.Node</code>) of the DOM element indicated by \"<code>domId</code>\"."," * @method _getImgEl"," * @returns {Object} DOM element of the image as a <code>Y.Node</code> object"," * @private"," */"," _getImgEl: function() {"," if (this._imgEl === null) {"," this._imgEl = Y.one('#' + this.get('domId'));"," }"," return this._imgEl;"," },",""," /**"," * Gets the Y position of the node in page coordinates."," * Expects that the page-coordinate position of the image won't change."," * @method _getYPos"," * @returns {Object} The Y position of the image"," * @private"," */"," _getYPos: function() {"," if (this._yPos === null) {"," this._yPos = this._getImgEl().getY();"," }"," return this._yPos;"," }",""," };","",""," Y.extend(Y.ImgLoadImgObj, Y.Base, imgProto);","","","","","}, '3.7.2', {\"requires\": [\"base-base\", \"node-style\", \"node-screen\"]});"];+_yuitest_coverage["build/imageloader/imageloader.js"].code=["YUI.add('imageloader', function (Y, NAME) {","","/**"," * 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"," */","",""," /**"," * 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 ImgLoadGroup"," * @extends Base"," * @constructor"," */"," Y.ImgLoadGroup = function() {"," // call init first, because it sets up local vars for storing attribute-related info"," this._init();"," Y.ImgLoadGroup.superclass.constructor.apply(this, arguments);"," };",""," Y.ImgLoadGroup.NAME = 'imgLoadGroup';",""," Y.ImgLoadGroup.ATTRS = {"," "," /**"," * Name for the group. Only used to identify the group in logging statements."," * @attribute name"," * @type String"," */"," name: {"," value: ''"," },",""," /**"," * Time limit, in seconds, after which images are fetched regardless of trigger events."," * @attribute timeLimit"," * @type Number"," */"," timeLimit: {"," value: null"," },",""," /**"," * Distance below the fold for which images are loaded. Images are not loaded until they are at most this distance away from (or above) the fold."," * This check is performed at page load (domready) and after any window scroll or window resize event (until all images are loaded)."," * @attribute foldDistance"," * @type Number"," */"," foldDistance: {"," validator: Y.Lang.isNumber,"," setter: function(val) { this._setFoldTriggers(); return val; },"," lazyAdd: 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, \"<code>background:none !important;</code>\"."," * @attribute className"," * @type String"," */"," className: {"," value: null,"," setter: function(name) { this._className = name; return name; },"," lazyAdd: false"," }, "," "," /**"," * Determines how to act when className is used as the way to delay load images. The \"default\" action is to just"," * remove the class name. The \"enhanced\" action is to remove the class name and also set the src attribute if"," * the element is an img."," * @attribute classNameAction"," * @type String"," */"," classNameAction: {"," value: \"default\""," }",""," };",""," var groupProto = {",""," /**"," * Initialize all private members needed for the group."," * @method _init"," * @private"," */"," _init: function() {",""," /**"," * Collection of triggers for this group."," * Keeps track of each trigger's event handle, as returned from <code>Y.on</code>."," * @property _triggers"," * @private"," * @type Array"," */"," this._triggers = [];",""," /**"," * Collection of images (<code>Y.ImgLoadImgObj</code> objects) registered with this group, keyed by DOM id."," * @property _imgObjs"," * @private"," * @type Object"," */"," this._imgObjs = {};",""," /**"," * Timeout object to keep a handle on the time limit."," * @property _timeout"," * @private"," * @type Object"," */"," this._timeout = null;",""," /**"," * DOM elements having the class name that is associated with this group."," * Elements are stored during the <code>_foldCheck</code> function and reused later during any subsequent <code>_foldCheck</code> calls - gives a slight performance improvement when the page fold is repeatedly checked."," * @property _classImageEls"," * @private"," * @type Array"," */"," this._classImageEls = null;",""," /**"," * Keep the CSS class name in a member variable for ease and speed."," * @property _className"," * @private"," * @type String"," */"," this._className = null;",""," /**"," * Boolean tracking whether the window scroll and window resize triggers have been set if this is a fold group."," * @property _areFoldTriggersSet"," * @private"," * @type Boolean"," */"," this._areFoldTriggersSet = false;",""," /**"," * The maximum pixel height of the document that has been made visible."," * During fold checks, if the user scrolls up then there's no need to check for newly exposed images."," * @property _maxKnownHLimit"," * @private"," * @type Int"," */"," this._maxKnownHLimit = 0;",""," // add a listener to domready that will start the time limit"," Y.on('domready', this._onloadTasks, this);"," },",""," /**"," * Adds a trigger to the group. Arguments are passed to <code>Y.on</code>."," * @method addTrigger"," * @chainable"," * @param {Object} obj The DOM object to attach the trigger event to"," * @param {String} type The event type"," */"," addTrigger: function(obj, type) {"," if (! obj || ! type) {"," return this;"," }","",""," /* 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 detach call finds the first window-scroll event with Y.ILG.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( Y.on(type, wrappedFetch, obj, this) );",""," return this;"," },",""," /**"," * Adds a custom event trigger to the group."," * @method addCustomTrigger"," * @chainable"," * @param {String} name The name of the event"," * @param {Object} obj The object on which to attach the event. <code>obj</code> is optional - by default the event is attached to the <code>Y</code> instance"," */"," addCustomTrigger: function(name, obj) {"," if (! name) {"," return this;"," }","",""," // see comment in addTrigger()"," var wrappedFetch = function() {"," this.fetch();"," };"," if (Y.Lang.isUndefined(obj)) {"," this._triggers.push( Y.on(name, wrappedFetch, this) );"," }"," else {"," this._triggers.push( obj.on(name, wrappedFetch, this) );"," }",""," return this;"," },",""," /**"," * Sets the window scroll and window resize triggers for any group that is fold-conditional (i.e., has a fold distance set)."," * @method _setFoldTriggers"," * @private"," */"," _setFoldTriggers: function() {"," if (this._areFoldTriggersSet) {"," return;"," }","",""," var wrappedFoldCheck = function() {"," this._foldCheck();"," };"," this._triggers.push( Y.on('scroll', wrappedFoldCheck, window, this) );"," this._triggers.push( Y.on('resize', wrappedFoldCheck, window, this) );"," this._areFoldTriggersSet = true;"," },",""," /**"," * Performs necessary setup at domready time."," * Initiates time limit for group; executes the fold check for the images."," * @method _onloadTasks"," * @private"," */"," _onloadTasks: function() {"," var timeLim = this.get('timeLimit');"," if (timeLim && timeLim > 0) {"," this._timeout = setTimeout(this._getFetchTimeout(), timeLim * 1000);"," }",""," if (! Y.Lang.isUndefined(this.get('foldDistance'))) {"," this._foldCheck();"," }"," },",""," /**"," * Returns the group's <code>fetch</code> method, with the proper closure, for use with <code>setTimeout</code>."," * @method _getFetchTimeout"," * @return {Function} group's <code>fetch</code> method"," * @private"," */"," _getFetchTimeout: function() {"," var self = this;"," return function() { self.fetch(); };"," },",""," /**"," * Registers an image with the group."," * Arguments are passed through to a <code>Y.ImgLoadImgObj</code> constructor; see that class' attribute documentation for detailed information. \"<code>domId</code>\" is a required attribute."," * @method registerImage"," * @param {Object} * A configuration object literal with attribute name/value pairs (passed through to a <code>Y.ImgLoadImgObj</code> constructor)"," * @return {Object} <code>Y.ImgLoadImgObj</code> that was registered"," */"," registerImage: function() {"," var domId = arguments[0].domId;"," if (! domId) {"," return null;"," }","",""," this._imgObjs[domId] = new Y.ImgLoadImgObj(arguments[0]);"," return this._imgObjs[domId];"," },",""," /**"," * Displays the images in the group."," * This method is called when a trigger fires or the time limit expires; it shouldn't be called externally, but is not private in the rare event that it needs to be called immediately."," * @method fetch"," */"," fetch: function() {",""," // done with the triggers"," this._clearTriggers();",""," // fetch whatever we need to by className"," this._fetchByClass();",""," // fetch registered images"," for (var id in this._imgObjs) {"," if (this._imgObjs.hasOwnProperty(id)) {"," this._imgObjs[id].fetch();"," }"," }"," },",""," /**"," * Clears the timeout and all triggers associated with the group."," * @method _clearTriggers"," * @private"," */"," _clearTriggers: function() {"," clearTimeout(this._timeout);"," // detach all listeners"," for (var i=0, len = this._triggers.length; i < len; i++) {"," this._triggers[i].detach();"," }"," },",""," /**"," * Checks the position of each image in the group. If any part of the image is within the specified distance (<code>foldDistance</code>) of the client viewport, the image is fetched immediately."," * @method _foldCheck"," * @private"," */"," _foldCheck: function() {",""," var allFetched = true,"," viewReg = Y.DOM.viewportRegion(),"," hLimit = viewReg.bottom + this.get('foldDistance'),"," id, imgFetched, els, i, len;",""," // unless we've uncovered new frontiers, there's no need to continue"," if (hLimit <= this._maxKnownHLimit) {"," return;"," }"," this._maxKnownHLimit = hLimit;",""," for (id in this._imgObjs) {"," if (this._imgObjs.hasOwnProperty(id)) {"," imgFetched = this._imgObjs[id].fetch(hLimit);"," allFetched = allFetched && imgFetched;"," }"," }",""," // and by class"," if (this._className) {"," if (this._classImageEls === null) {"," // get all the relevant elements and store them"," this._classImageEls = [];"," els = Y.all('.' + this._className);"," els.each( function(node) { this._classImageEls.push( { el: node, y: node.getY(), fetched: false } ); }, this);"," }"," els = this._classImageEls;"," for (i=0, len = els.length; i < len; i++) {"," if (els[i].fetched) {"," continue;"," }"," if (els[i].y && els[i].y <= hLimit) {"," //els[i].el.removeClass(this._className);"," this._updateNodeClassName(els[i].el);"," els[i].fetched = true;"," }"," else {"," allFetched = false;"," }"," }"," }"," "," // if allFetched, remove listeners"," if (allFetched) {"," this._clearTriggers();"," }"," },"," "," /**"," * Updates a given node, removing the ImageLoader class name. If the"," * node is an img and the classNameAction is \"enhanced\", then node"," * class name is removed and also the src attribute is set to the "," * image URL as well as clearing the style background image."," * @method _updateNodeClassName"," * @param node {Node} The node to act on."," * @private"," */"," _updateNodeClassName: function(node){"," var url;"," "," if (this.get(\"classNameAction\") == \"enhanced\"){"," "," if (node.get(\"tagName\").toLowerCase() == \"img\"){"," url = node.getStyle(\"backgroundImage\");"," /url\\([\"']?(.*?)[\"']?\\)/.test(url);"," url = RegExp.$1;"," node.set(\"src\", url);"," node.setStyle(\"backgroundImage\", \"\");"," }"," }"," "," node.removeClass(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"," */"," _fetchByClass: function() {"," if (! this._className) {"," return;"," }","",""," Y.all('.' + this._className).each(Y.bind(this._updateNodeClassName, this));"," }",""," };","",""," Y.extend(Y.ImgLoadGroup, Y.Base, groupProto);","",""," //------------------------------------------------","",""," /**"," * Image objects to be registered with the groups"," * @class ImgLoadImgObj"," * @extends Base"," * @constructor"," */"," Y.ImgLoadImgObj = function() {"," Y.ImgLoadImgObj.superclass.constructor.apply(this, arguments);"," this._init();"," };"," "," Y.ImgLoadImgObj.NAME = 'imgLoadImgObj';",""," Y.ImgLoadImgObj.ATTRS = {"," /**"," * HTML DOM id of the image element."," * @attribute domId"," * @type String"," */"," domId: {"," value: null,"," writeOnce: true"," },",""," /**"," * Background URL for the image."," * For an image whose URL is specified by \"<code>background-image</code>\" in the element's style."," * @attribute bgUrl"," * @type String"," */"," bgUrl: {"," value: null"," },",""," /**"," * Source URL for the image."," * For an image whose URL is specified by a \"<code>src</code>\" attribute in the DOM element."," * @attribute srcUrl"," * @type String"," */"," srcUrl: {"," value: null"," },",""," /**"," * Pixel width of the image. Will be set as a <code>width</code> attribute on the DOM element after the image is fetched."," * Defaults to the natural width of the image (no <code>width</code> attribute will be set)."," * Usually only used with src images."," * @attribute width"," * @type Int"," */"," width: {"," value: null"," },",""," /**"," * Pixel height of the image. Will be set as a <code>height</code> attribute on the DOM element after the image is fetched."," * Defaults to the natural height of the image (no <code>height</code> attribute will be set)."," * Usually only used with src images."," * @attribute height"," * @type Int"," */"," height: {"," value: null"," },",""," /**"," * Whether the image's <code>style.visibility</code> should be set to <code>visible</code> after the image is fetched."," * Used when setting images as <code>visibility:hidden</code> prior to image fetching."," * @attribute setVisible"," * @type Boolean"," */"," setVisible: {"," value: false"," },",""," /**"," * Whether the image is a PNG."," * PNG images get special treatment in that the URL is specified through AlphaImageLoader for IE, versions 6 and earlier."," * Only used with background images."," * @attribute isPng"," * @type Boolean"," */"," isPng: {"," value: false"," },",""," /**"," * AlphaImageLoader <code>sizingMethod</code> property to be set for the image."," * Only set if <code>isPng</code> value for this image is set to <code>true</code>."," * Defaults to <code>scale</code>."," * @attribute sizingMethod"," * @type String"," */"," sizingMethod: {"," value: 'scale'"," },",""," /**"," * AlphaImageLoader <code>enabled</code> property to be set for the image."," * Only set if <code>isPng</code> value for this image is set to <code>true</code>."," * Defaults to <code>true</code>."," * @attribute enabled"," * @type String"," */"," enabled: {"," value: 'true'"," }",""," };",""," var imgProto = {",""," /**"," * Initialize all private members needed for the group."," * @method _init"," * @private"," */"," _init: function() {",""," /**"," * Whether this image has already been fetched."," * In the case of fold-conditional groups, images won't be fetched twice."," * @property _fetched"," * @private"," * @type Boolean"," */"," this._fetched = false;",""," /**"," * The Node object returned from <code>Y.one</code>, to avoid repeat calls to access the DOM."," * @property _imgEl"," * @private"," * @type Object"," */"," this._imgEl = null;",""," /**"," * The vertical position returned from <code>getY</code>, to avoid repeat calls to access the DOM."," * The Y position is checked only for images registered with fold-conditional groups. The position is checked first at page load (domready)"," * and this caching enhancement assumes that the image's vertical position won't change after that first check."," * @property _yPos"," * @private"," * @type Int"," */"," this._yPos = null;"," },",""," /**"," * Displays the image; puts the URL into the DOM."," * This method shouldn't be called externally, but is not private in the rare event that it needs to be called immediately."," * @method fetch"," * @param {Int} withinY The pixel distance from the top of the page, for which if the image lies within, it will be fetched. Undefined indicates that no check should be made, and the image should always be fetched"," * @return {Boolean} Whether the image has been fetched (either during this execution or previously)"," */"," fetch: function(withinY) {"," if (this._fetched) {"," return true;"," }",""," var el = this._getImgEl(),"," yPos;"," if (! el) {"," return false;"," }",""," if (withinY) {"," // need a distance check"," yPos = this._getYPos();"," if (! yPos || yPos > withinY) {"," return false;"," }"," }","",""," // apply url"," if (this.get('bgUrl') !== null) {"," // bg url"," if (this.get('isPng') && Y.UA.ie && Y.UA.ie <= 6) {"," // png for which to apply AlphaImageLoader"," el.setStyle('filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\"' + this.get('bgUrl') + '\", sizingMethod=\"' + this.get('sizingMethod') + '\", enabled=\"' + this.get('enabled') + '\")');"," }"," else {"," // regular bg image"," el.setStyle('backgroundImage', \"url('\" + this.get('bgUrl') + \"')\");"," }"," }"," else if (this.get('srcUrl') !== null) {"," // regular src image"," el.setAttribute('src', this.get('srcUrl'));"," }",""," // apply attributes"," if (this.get('setVisible')) {"," el.setStyle('visibility', 'visible');"," }"," if (this.get('width')) {"," el.setAttribute('width', this.get('width'));"," }"," if (this.get('height')) {"," el.setAttribute('height', this.get('height'));"," }",""," this._fetched = true;",""," return true;"," },",""," /**"," * Gets the object (as a <code>Y.Node</code>) of the DOM element indicated by \"<code>domId</code>\"."," * @method _getImgEl"," * @returns {Object} DOM element of the image as a <code>Y.Node</code> object"," * @private"," */"," _getImgEl: function() {"," if (this._imgEl === null) {"," this._imgEl = Y.one('#' + this.get('domId'));"," }"," return this._imgEl;"," },",""," /**"," * Gets the Y position of the node in page coordinates."," * Expects that the page-coordinate position of the image won't change."," * @method _getYPos"," * @returns {Object} The Y position of the image"," * @private"," */"," _getYPos: function() {"," if (this._yPos === null) {"," this._yPos = this._getImgEl().getY();"," }"," return this._yPos;"," }",""," };","",""," Y.extend(Y.ImgLoadImgObj, Y.Base, imgProto);","","","","","}, '3.7.3', {\"requires\": [\"base-base\", \"node-style\", \"node-screen\"]});"]; _yuitest_coverage["build/imageloader/imageloader.js"].lines = {"1":0,"17":0,"19":0,"20":0,"23":0,"25":0,"53":0,"65":0,"82":0,"98":0,"106":0,"114":0,"123":0,"131":0,"139":0,"148":0,"151":0,"162":0,"163":0,"172":0,"173":0,"175":0,"177":0,"188":0,"189":0,"194":0,"195":0,"197":0,"198":0,"201":0,"204":0,"213":0,"214":0,"218":0,"219":0,"221":0,"222":0,"223":0,"233":0,"234":0,"235":0,"238":0,"239":0,"250":0,"251":0,"262":0,"263":0,"264":0,"268":0,"269":0,"280":0,"283":0,"286":0,"287":0,"288":0,"299":0,"301":0,"302":0,"313":0,"319":0,"320":0,"322":0,"324":0,"325":0,"326":0,"327":0,"332":0,"333":0,"335":0,"336":0,"337":0,"339":0,"340":0,"341":0,"342":0,"344":0,"346":0,"347":0,"350":0,"356":0,"357":0,"371":0,"373":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"384":0,"393":0,"394":0,"398":0,"404":0,"416":0,"417":0,"418":0,"421":0,"423":0,"521":0,"537":0,"545":0,"555":0,"566":0,"567":0,"570":0,"572":0,"573":0,"576":0,"578":0,"579":0,"580":0,"586":0,"588":0,"590":0,"594":0,"597":0,"599":0,"603":0,"604":0,"606":0,"607":0,"609":0,"610":0,"613":0,"615":0,"625":0,"626":0,"628":0,"639":0,"640":0,"642":0,"648":0}; _yuitest_coverage["build/imageloader/imageloader.js"].functions = {"ImgLoadGroup:17":0,"setter:53":0,"setter:65":0,"_init:89":0,"wrappedFetch:172":0,"addTrigger:161":0,"wrappedFetch:194":0,"addCustomTrigger:187":0,"wrappedFoldCheck:218":0,"_setFoldTriggers:212":0,"_onloadTasks:232":0,"(anonymous 2):251":0,"_getFetchTimeout:249":0,"registerImage:261":0,"fetch:277":0,"_clearTriggers:298":0,"(anonymous 3):337":0,"_foldCheck:311":0,"_updateNodeClassName:370":0,"_fetchByClass:392":0,"ImgLoadImgObj:416":0,"_init:528":0,"fetch:565":0,"_getImgEl:624":0,"_getYPos:638":0,"(anonymous 1):1":0}; _yuitest_coverage["build/imageloader/imageloader.js"].coveredLines = 133;@@ -848,4 +848,4 @@ -}, '3.7.2', {"requires": ["base-base", "node-style", "node-screen"]});+}, '3.7.3', {"requires": ["base-base", "node-style", "node-screen"]});
bundle/imageloader/imageloader-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -668,4 +668,4 @@ -}, '3.7.2', {"requires": ["base-base", "node-style", "node-screen"]});+}, '3.7.3', {"requires": ["base-base", "node-style", "node-screen"]});
bundle/imageloader/imageloader-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("imageloader",function(e,t){e.ImgLoadGroup=function(){this._init(),e.ImgLoadGroup.superclass.constructor.apply(this,arguments)},e.ImgLoadGroup.NAME="imgLoadGroup",e.ImgLoadGroup.ATTRS={name:{value:""},timeLimit:{value:null},foldDistance:{validator:e.Lang.isNumber,setter:function(e){return this._setFoldTriggers(),e},lazyAdd:!1},className:{value:null,setter:function(e){return this._className=e,e},lazyAdd:!1},classNameAction:{value:"default"}};var n={_init:function(){this._triggers=[],this._imgObjs={},this._timeout=null,this._classImageEls=null,this._className=null,this._areFoldTriggersSet=!1,this._maxKnownHLimit=0,e.on("domready",this._onloadTasks,this)},addTrigger:function(t,n){if(!t||!n)return this;var r=function(){this.fetch()};return this._triggers.push(e.on(n,r,t,this)),this},addCustomTrigger:function(t,n){if(!t)return this;var r=function(){this.fetch()};return e.Lang.isUndefined(n)?this._triggers.push(e.on(t,r,this)):this._triggers.push(n.on(t,r,this)),this},_setFoldTriggers:function(){if(this._areFoldTriggersSet)return;var t=function(){this._foldCheck()};this._triggers.push(e.on("scroll",t,window,this)),this._triggers.push(e.on("resize",t,window,this)),this._areFoldTriggersSet=!0},_onloadTasks:function(){var t=this.get("timeLimit");t&&t>0&&(this._timeout=setTimeout(this._getFetchTimeout(),t*1e3)),e.Lang.isUndefined(this.get("foldDistance"))||this._foldCheck()},_getFetchTimeout:function(){var e=this;return function(){e.fetch()}},registerImage:function(){var t=arguments[0].domId;return t?(this._imgObjs[t]=new e.ImgLoadImgObj(arguments[0]),this._imgObjs[t]):null},fetch:function(){this._clearTriggers(),this._fetchByClass();for(var e in this._imgObjs)this._imgObjs.hasOwnProperty(e)&&this._imgObjs[e].fetch()},_clearTriggers:function(){clearTimeout(this._timeout);for(var e=0,t=this._triggers.length;e<t;e++)this._triggers[e].detach()},_foldCheck:function(){var t=!0,n=e.DOM.viewportRegion(),r=n.bottom+this.get("foldDistance"),i,s,o,u,a;if(r<=this._maxKnownHLimit)return;this._maxKnownHLimit=r;for(i in this._imgObjs)this._imgObjs.hasOwnProperty(i)&&(s=this._imgObjs[i].fetch(r),t=t&&s);if(this._className){this._classImageEls===null&&(this._classImageEls=[],o=e.all("."+this._className),o.each(function(e){this._classImageEls.push({el:e,y:e.getY(),fetched:!1})},this)),o=this._classImageEls;for(u=0,a=o.length;u<a;u++){if(o[u].fetched)continue;o[u].y&&o[u].y<=r?(this._updateNodeClassName(o[u].el),o[u].fetched=!0):t=!1}}t&&this._clearTriggers()},_updateNodeClassName:function(e){var t;this.get("classNameAction")=="enhanced"&&e.get("tagName").toLowerCase()=="img"&&(t=e.getStyle("backgroundImage"),/url\(["']?(.*?)["']?\)/.test(t),t=RegExp.$1,e.set("src",t),e.setStyle("backgroundImage","")),e.removeClass(this._className)},_fetchByClass:function(){if(!this._className)return;e.all("."+this._className).each(e.bind(this._updateNodeClassName,this))}};e.extend(e.ImgLoadGroup,e.Base,n),e.ImgLoadImgObj=function(){e.ImgLoadImgObj.superclass.constructor.apply(this,arguments),this._init()},e.ImgLoadImgObj.NAME="imgLoadImgObj",e.ImgLoadImgObj.ATTRS={domId:{value:null,writeOnce:!0},bgUrl:{value:null},srcUrl:{value:null},width:{value:null},height:{value:null},setVisible:{value:!1},isPng:{value:!1},sizingMethod:{value:"scale"},enabled:{value:"true"}};var r={_init:function(){this._fetched=!1,this._imgEl=null,this._yPos=null},fetch:function(t){if(this._fetched)return!0;var n=this._getImgEl(),r;if(!n)return!1;if(t){r=this._getYPos();if(!r||r>t)return!1}return this.get("bgUrl")!==null?this.get("isPng")&&e.UA.ie&&e.UA.ie<=6?n.setStyle("filter",'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.get("bgUrl")+'", sizingMethod="'+this.get("sizingMethod")+'", enabled="'+this.get("enabled")+'")'):n.setStyle("backgroundImage","url('"+this.get("bgUrl")+"')"):this.get("srcUrl")!==null&&n.setAttribute("src",this.get("srcUrl")),this.get("setVisible")&&n.setStyle("visibility","visible"),this.get("width")&&n.setAttribute("width",this.get("width")),this.get("height")&&n.setAttribute("height",this.get("height")),this._fetched=!0,!0},_getImgEl:function(){return this._imgEl===null&&(this._imgEl=e.one("#"+this.get("domId"))),this._imgEl},_getYPos:function(){return this._yPos===null&&(this._yPos=this._getImgEl().getY()),this._yPos}};e.extend(e.ImgLoadImgObj,e.Base,r)},"3.7.2",{requires:["base-base","node-style","node-screen"]});+YUI.add("imageloader",function(e,t){e.ImgLoadGroup=function(){this._init(),e.ImgLoadGroup.superclass.constructor.apply(this,arguments)},e.ImgLoadGroup.NAME="imgLoadGroup",e.ImgLoadGroup.ATTRS={name:{value:""},timeLimit:{value:null},foldDistance:{validator:e.Lang.isNumber,setter:function(e){return this._setFoldTriggers(),e},lazyAdd:!1},className:{value:null,setter:function(e){return this._className=e,e},lazyAdd:!1},classNameAction:{value:"default"}};var n={_init:function(){this._triggers=[],this._imgObjs={},this._timeout=null,this._classImageEls=null,this._className=null,this._areFoldTriggersSet=!1,this._maxKnownHLimit=0,e.on("domready",this._onloadTasks,this)},addTrigger:function(t,n){if(!t||!n)return this;var r=function(){this.fetch()};return this._triggers.push(e.on(n,r,t,this)),this},addCustomTrigger:function(t,n){if(!t)return this;var r=function(){this.fetch()};return e.Lang.isUndefined(n)?this._triggers.push(e.on(t,r,this)):this._triggers.push(n.on(t,r,this)),this},_setFoldTriggers:function(){if(this._areFoldTriggersSet)return;var t=function(){this._foldCheck()};this._triggers.push(e.on("scroll",t,window,this)),this._triggers.push(e.on("resize",t,window,this)),this._areFoldTriggersSet=!0},_onloadTasks:function(){var t=this.get("timeLimit");t&&t>0&&(this._timeout=setTimeout(this._getFetchTimeout(),t*1e3)),e.Lang.isUndefined(this.get("foldDistance"))||this._foldCheck()},_getFetchTimeout:function(){var e=this;return function(){e.fetch()}},registerImage:function(){var t=arguments[0].domId;return t?(this._imgObjs[t]=new e.ImgLoadImgObj(arguments[0]),this._imgObjs[t]):null},fetch:function(){this._clearTriggers(),this._fetchByClass();for(var e in this._imgObjs)this._imgObjs.hasOwnProperty(e)&&this._imgObjs[e].fetch()},_clearTriggers:function(){clearTimeout(this._timeout);for(var e=0,t=this._triggers.length;e<t;e++)this._triggers[e].detach()},_foldCheck:function(){var t=!0,n=e.DOM.viewportRegion(),r=n.bottom+this.get("foldDistance"),i,s,o,u,a;if(r<=this._maxKnownHLimit)return;this._maxKnownHLimit=r;for(i in this._imgObjs)this._imgObjs.hasOwnProperty(i)&&(s=this._imgObjs[i].fetch(r),t=t&&s);if(this._className){this._classImageEls===null&&(this._classImageEls=[],o=e.all("."+this._className),o.each(function(e){this._classImageEls.push({el:e,y:e.getY(),fetched:!1})},this)),o=this._classImageEls;for(u=0,a=o.length;u<a;u++){if(o[u].fetched)continue;o[u].y&&o[u].y<=r?(this._updateNodeClassName(o[u].el),o[u].fetched=!0):t=!1}}t&&this._clearTriggers()},_updateNodeClassName:function(e){var t;this.get("classNameAction")=="enhanced"&&e.get("tagName").toLowerCase()=="img"&&(t=e.getStyle("backgroundImage"),/url\(["']?(.*?)["']?\)/.test(t),t=RegExp.$1,e.set("src",t),e.setStyle("backgroundImage","")),e.removeClass(this._className)},_fetchByClass:function(){if(!this._className)return;e.all("."+this._className).each(e.bind(this._updateNodeClassName,this))}};e.extend(e.ImgLoadGroup,e.Base,n),e.ImgLoadImgObj=function(){e.ImgLoadImgObj.superclass.constructor.apply(this,arguments),this._init()},e.ImgLoadImgObj.NAME="imgLoadImgObj",e.ImgLoadImgObj.ATTRS={domId:{value:null,writeOnce:!0},bgUrl:{value:null},srcUrl:{value:null},width:{value:null},height:{value:null},setVisible:{value:!1},isPng:{value:!1},sizingMethod:{value:"scale"},enabled:{value:"true"}};var r={_init:function(){this._fetched=!1,this._imgEl=null,this._yPos=null},fetch:function(t){if(this._fetched)return!0;var n=this._getImgEl(),r;if(!n)return!1;if(t){r=this._getYPos();if(!r||r>t)return!1}return this.get("bgUrl")!==null?this.get("isPng")&&e.UA.ie&&e.UA.ie<=6?n.setStyle("filter",'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+this.get("bgUrl")+'", sizingMethod="'+this.get("sizingMethod")+'", enabled="'+this.get("enabled")+'")'):n.setStyle("backgroundImage","url('"+this.get("bgUrl")+"')"):this.get("srcUrl")!==null&&n.setAttribute("src",this.get("srcUrl")),this.get("setVisible")&&n.setStyle("visibility","visible"),this.get("width")&&n.setAttribute("width",this.get("width")),this.get("height")&&n.setAttribute("height",this.get("height")),this._fetched=!0,!0},_getImgEl:function(){return this._imgEl===null&&(this._imgEl=e.one("#"+this.get("domId"))),this._imgEl},_getYPos:function(){return this._yPos===null&&(this._yPos=this._getImgEl().getY()),this._yPos}};e.extend(e.ImgLoadImgObj,e.Base,r)},"3.7.3",{requires:["base-base","node-style","node-screen"]});
bundle/imageloader/imageloader.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -656,4 +656,4 @@ -}, '3.7.2', {"requires": ["base-base", "node-style", "node-screen"]});+}, '3.7.3', {"requires": ["base-base", "node-style", "node-screen"]});
bundle/intl-base/intl-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/intl-base/intl-base.js", code: [] };-_yuitest_coverage["build/intl-base/intl-base.js"].code=["YUI.add('intl-base', function (Y, NAME) {","","/**"," * The Intl utility provides a central location for managing sets of"," * localized resources (strings and formatting patterns)."," *"," * @class Intl"," * @uses EventTarget"," * @static"," */","","var SPLIT_REGEX = /[, ]/;","","Y.mix(Y.namespace('Intl'), {",""," /**"," * Returns the language among those available that"," * best matches the preferred language list, using the Lookup"," * algorithm of BCP 47."," * If none of the available languages meets the user's preferences,"," * then \"\" is returned."," * Extended language ranges are not supported."," *"," * @method lookupBestLang"," * @param {String[] | String} preferredLanguages The list of preferred"," * languages in descending preference order, represented as BCP 47"," * language tags. A string array or a comma-separated list."," * @param {String[]} availableLanguages The list of languages"," * that the application supports, represented as BCP 47 language"," * tags."," *"," * @return {String} The available language that best matches the"," * preferred language list, or \"\"."," * @since 3.1.0"," */"," lookupBestLang: function(preferredLanguages, availableLanguages) {",""," var i, language, result, index;",""," // check whether the list of available languages contains language;"," // if so return it"," function scan(language) {"," var i;"," for (i = 0; i < availableLanguages.length; i += 1) {"," if (language.toLowerCase() ==="," availableLanguages[i].toLowerCase()) {"," return availableLanguages[i];"," }"," }"," }",""," if (Y.Lang.isString(preferredLanguages)) {"," preferredLanguages = preferredLanguages.split(SPLIT_REGEX);"," }",""," for (i = 0; i < preferredLanguages.length; i += 1) {"," language = preferredLanguages[i];"," if (!language || language === '*') {"," continue;"," }"," // check the fallback sequence for one language"," while (language.length > 0) {"," result = scan(language);"," if (result) {"," return result;"," } else {"," index = language.lastIndexOf('-');"," if (index >= 0) {"," language = language.substring(0, index);"," // one-character subtags get cut along with the"," // following subtag"," if (index >= 2 && language.charAt(index - 2) === '-') {"," language = language.substring(0, index - 2);"," }"," } else {"," // nothing available for this language"," break;"," }"," }"," }"," }",""," return '';"," }","});","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/intl-base/intl-base.js"].code=["YUI.add('intl-base', function (Y, NAME) {","","/**"," * The Intl utility provides a central location for managing sets of"," * localized resources (strings and formatting patterns)."," *"," * @class Intl"," * @uses EventTarget"," * @static"," */","","var SPLIT_REGEX = /[, ]/;","","Y.mix(Y.namespace('Intl'), {",""," /**"," * Returns the language among those available that"," * best matches the preferred language list, using the Lookup"," * algorithm of BCP 47."," * If none of the available languages meets the user's preferences,"," * then \"\" is returned."," * Extended language ranges are not supported."," *"," * @method lookupBestLang"," * @param {String[] | String} preferredLanguages The list of preferred"," * languages in descending preference order, represented as BCP 47"," * language tags. A string array or a comma-separated list."," * @param {String[]} availableLanguages The list of languages"," * that the application supports, represented as BCP 47 language"," * tags."," *"," * @return {String} The available language that best matches the"," * preferred language list, or \"\"."," * @since 3.1.0"," */"," lookupBestLang: function(preferredLanguages, availableLanguages) {",""," var i, language, result, index;",""," // check whether the list of available languages contains language;"," // if so return it"," function scan(language) {"," var i;"," for (i = 0; i < availableLanguages.length; i += 1) {"," if (language.toLowerCase() ==="," availableLanguages[i].toLowerCase()) {"," return availableLanguages[i];"," }"," }"," }",""," if (Y.Lang.isString(preferredLanguages)) {"," preferredLanguages = preferredLanguages.split(SPLIT_REGEX);"," }",""," for (i = 0; i < preferredLanguages.length; i += 1) {"," language = preferredLanguages[i];"," if (!language || language === '*') {"," continue;"," }"," // check the fallback sequence for one language"," while (language.length > 0) {"," result = scan(language);"," if (result) {"," return result;"," } else {"," index = language.lastIndexOf('-');"," if (index >= 0) {"," language = language.substring(0, index);"," // one-character subtags get cut along with the"," // following subtag"," if (index >= 2 && language.charAt(index - 2) === '-') {"," language = language.substring(0, index - 2);"," }"," } else {"," // nothing available for this language"," break;"," }"," }"," }"," }",""," return '';"," }","});","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/intl-base/intl-base.js"].lines = {"1":0,"12":0,"14":0,"38":0,"42":0,"43":0,"44":0,"45":0,"47":0,"52":0,"53":0,"56":0,"57":0,"58":0,"59":0,"62":0,"63":0,"64":0,"65":0,"67":0,"68":0,"69":0,"72":0,"73":0,"77":0,"83":0}; _yuitest_coverage["build/intl-base/intl-base.js"].functions = {"scan:42":0,"lookupBestLang:36":0,"(anonymous 1):1":0}; _yuitest_coverage["build/intl-base/intl-base.js"].coveredLines = 26;@@ -153,4 +153,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/intl-base/intl-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -91,4 +91,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/intl-base/intl-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.2",{requires:["yui-base"]});+YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.3",{requires:["yui-base"]});
bundle/intl-base/intl-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -91,4 +91,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/intl/intl-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/intl/intl.js", code: [] };-_yuitest_coverage["build/intl/intl.js"].code=["YUI.add('intl', function (Y, NAME) {","","var _mods = {},",""," ROOT_LANG = \"yuiRootLang\","," ACTIVE_LANG = \"yuiActiveLang\","," NONE = [];","","/**"," * Provides utilities to support the management of localized resources (strings and formatting patterns)."," *"," * @module intl"," */","","/**"," * The Intl utility provides a central location for managing sets of localized resources (strings and formatting patterns)."," *"," * @class Intl"," * @uses EventTarget"," * @static"," */","Y.mix(Y.namespace(\"Intl\"), {",""," /**"," * Private method to retrieve the language hash for a given module."," *"," * @method _mod"," * @private"," *"," * @param {String} module The name of the module"," * @return {Object} The hash of localized resources for the module, keyed by BCP language tag"," */"," _mod : function(module) {"," if (!_mods[module]) {"," _mods[module] = {};"," }"," return _mods[module];"," },",""," /**"," * Sets the active language for the given module."," *"," * Returns false on failure, which would happen if the language had not been registered through the <a href=\"#method_add\">add()</a> method."," *"," * @method setLang"," *"," * @param {String} module The module name."," * @param {String} lang The BCP 47 language tag."," * @return boolean true if successful, false if not."," */"," setLang : function(module, lang) {"," var langs = this._mod(module),"," currLang = langs[ACTIVE_LANG],"," exists = !!langs[lang];",""," if (exists && lang !== currLang) {"," langs[ACTIVE_LANG] = lang;"," this.fire(\"intl:langChange\", {module: module, prevVal: currLang, newVal: (lang === ROOT_LANG) ? \"\" : lang});"," }",""," return exists;"," },",""," /**"," * Get the currently active language for the given module."," *"," * @method getLang"," *"," * @param {String} module The module name."," * @return {String} The BCP 47 language tag."," */"," getLang : function(module) {"," var lang = this._mod(module)[ACTIVE_LANG];"," return (lang === ROOT_LANG) ? \"\" : lang;"," },",""," /**"," * Register a hash of localized resources for the given module and language"," *"," * @method add"," *"," * @param {String} module The module name."," * @param {String} lang The BCP 47 language tag."," * @param {Object} strings The hash of localized values, keyed by the string name."," */"," add : function(module, lang, strings) {"," lang = lang || ROOT_LANG;"," this._mod(module)[lang] = strings;"," this.setLang(module, lang);"," },",""," /**"," * Gets the module's localized resources for the currently active language (as provided by the <a href=\"#method_getLang\">getLang</a> method)."," * <p>"," * Optionally, the localized resources for alternate languages which have been added to Intl (see the <a href=\"#method_add\">add</a> method) can"," * be retrieved by providing the BCP 47 language tag as the lang parameter."," * </p>"," * @method get"," *"," * @param {String} module The module name."," * @param {String} key Optional. A single resource key. If not provided, returns a copy (shallow clone) of all resources."," * @param {String} lang Optional. The BCP 47 language tag. If not provided, the module's currently active language is used."," * @return String | Object A copy of the module's localized resources, or a single value if key is provided."," */"," get : function(module, key, lang) {"," var mod = this._mod(module),"," strs;",""," lang = lang || mod[ACTIVE_LANG];"," strs = mod[lang] || {};",""," return (key) ? strs[key] : Y.merge(strs);"," },",""," /**"," * Gets the list of languages for which localized resources are available for a given module, based on the module"," * meta-data (part of loader). If loader is not on the page, returns an empty array."," *"," * @method getAvailableLangs"," * @param {String} module The name of the module"," * @return {Array} The array of languages available."," */"," getAvailableLangs : function(module) {"," var loader = Y.Env._loader,"," mod = loader && loader.moduleInfo[module],"," langs = mod && mod.lang;"," return (langs) ? langs.concat() : NONE;",""," }","});","","Y.augment(Y.Intl, Y.EventTarget);","","/**"," * Notification event to indicate when the lang for a module has changed. There is no default behavior associated with this event,"," * so the on and after moments are equivalent."," *"," * @event intl:langChange"," * @param {EventFacade} e The event facade"," * <p>The event facade contains:</p>"," * <dl>"," * <dt>module</dt><dd>The name of the module for which the language changed</dd>"," * <dt>newVal</dt><dd>The new language tag</dd>"," * <dt>prevVal</dt><dd>The current language tag</dd>"," * </dl>"," */","Y.Intl.publish(\"intl:langChange\", {emitFacade:true});","","","}, '3.7.2', {\"requires\": [\"intl-base\", \"event-custom\"]});"];+_yuitest_coverage["build/intl/intl.js"].code=["YUI.add('intl', function (Y, NAME) {","","var _mods = {},",""," ROOT_LANG = \"yuiRootLang\","," ACTIVE_LANG = \"yuiActiveLang\","," NONE = [];","","/**"," * Provides utilities to support the management of localized resources (strings and formatting patterns)."," *"," * @module intl"," */","","/**"," * The Intl utility provides a central location for managing sets of localized resources (strings and formatting patterns)."," *"," * @class Intl"," * @uses EventTarget"," * @static"," */","Y.mix(Y.namespace(\"Intl\"), {",""," /**"," * Private method to retrieve the language hash for a given module."," *"," * @method _mod"," * @private"," *"," * @param {String} module The name of the module"," * @return {Object} The hash of localized resources for the module, keyed by BCP language tag"," */"," _mod : function(module) {"," if (!_mods[module]) {"," _mods[module] = {};"," }"," return _mods[module];"," },",""," /**"," * Sets the active language for the given module."," *"," * Returns false on failure, which would happen if the language had not been registered through the <a href=\"#method_add\">add()</a> method."," *"," * @method setLang"," *"," * @param {String} module The module name."," * @param {String} lang The BCP 47 language tag."," * @return boolean true if successful, false if not."," */"," setLang : function(module, lang) {"," var langs = this._mod(module),"," currLang = langs[ACTIVE_LANG],"," exists = !!langs[lang];",""," if (exists && lang !== currLang) {"," langs[ACTIVE_LANG] = lang;"," this.fire(\"intl:langChange\", {module: module, prevVal: currLang, newVal: (lang === ROOT_LANG) ? \"\" : lang});"," }",""," return exists;"," },",""," /**"," * Get the currently active language for the given module."," *"," * @method getLang"," *"," * @param {String} module The module name."," * @return {String} The BCP 47 language tag."," */"," getLang : function(module) {"," var lang = this._mod(module)[ACTIVE_LANG];"," return (lang === ROOT_LANG) ? \"\" : lang;"," },",""," /**"," * Register a hash of localized resources for the given module and language"," *"," * @method add"," *"," * @param {String} module The module name."," * @param {String} lang The BCP 47 language tag."," * @param {Object} strings The hash of localized values, keyed by the string name."," */"," add : function(module, lang, strings) {"," lang = lang || ROOT_LANG;"," this._mod(module)[lang] = strings;"," this.setLang(module, lang);"," },",""," /**"," * Gets the module's localized resources for the currently active language (as provided by the <a href=\"#method_getLang\">getLang</a> method)."," * <p>"," * Optionally, the localized resources for alternate languages which have been added to Intl (see the <a href=\"#method_add\">add</a> method) can"," * be retrieved by providing the BCP 47 language tag as the lang parameter."," * </p>"," * @method get"," *"," * @param {String} module The module name."," * @param {String} key Optional. A single resource key. If not provided, returns a copy (shallow clone) of all resources."," * @param {String} lang Optional. The BCP 47 language tag. If not provided, the module's currently active language is used."," * @return String | Object A copy of the module's localized resources, or a single value if key is provided."," */"," get : function(module, key, lang) {"," var mod = this._mod(module),"," strs;",""," lang = lang || mod[ACTIVE_LANG];"," strs = mod[lang] || {};",""," return (key) ? strs[key] : Y.merge(strs);"," },",""," /**"," * Gets the list of languages for which localized resources are available for a given module, based on the module"," * meta-data (part of loader). If loader is not on the page, returns an empty array."," *"," * @method getAvailableLangs"," * @param {String} module The name of the module"," * @return {Array} The array of languages available."," */"," getAvailableLangs : function(module) {"," var loader = Y.Env._loader,"," mod = loader && loader.moduleInfo[module],"," langs = mod && mod.lang;"," return (langs) ? langs.concat() : NONE;",""," }","});","","Y.augment(Y.Intl, Y.EventTarget);","","/**"," * Notification event to indicate when the lang for a module has changed. There is no default behavior associated with this event,"," * so the on and after moments are equivalent."," *"," * @event intl:langChange"," * @param {EventFacade} e The event facade"," * <p>The event facade contains:</p>"," * <dl>"," * <dt>module</dt><dd>The name of the module for which the language changed</dd>"," * <dt>newVal</dt><dd>The new language tag</dd>"," * <dt>prevVal</dt><dd>The current language tag</dd>"," * </dl>"," */","Y.Intl.publish(\"intl:langChange\", {emitFacade:true});","","","}, '3.7.3', {\"requires\": [\"intl-base\", \"event-custom\"]});"]; _yuitest_coverage["build/intl/intl.js"].lines = {"1":0,"3":0,"22":0,"34":0,"35":0,"37":0,"52":0,"56":0,"57":0,"58":0,"61":0,"73":0,"74":0,"87":0,"88":0,"89":0,"106":0,"109":0,"110":0,"112":0,"124":0,"127":0,"132":0,"147":0}; _yuitest_coverage["build/intl/intl.js"].functions = {"_mod:33":0,"setLang:51":0,"getLang:72":0,"add:86":0,"get:105":0,"getAvailableLangs:123":0,"(anonymous 1):1":0}; _yuitest_coverage["build/intl/intl.js"].coveredLines = 24;@@ -217,4 +217,4 @@ Y.Intl.publish("intl:langChange", {emitFacade:true}); -}, '3.7.2', {"requires": ["intl-base", "event-custom"]});+}, '3.7.3', {"requires": ["intl-base", "event-custom"]});
bundle/intl/intl-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -153,4 +153,4 @@ Y.Intl.publish("intl:langChange", {emitFacade:true}); -}, '3.7.2', {"requires": ["intl-base", "event-custom"]});+}, '3.7.3', {"requires": ["intl-base", "event-custom"]});
bundle/intl/intl-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("intl",function(e,t){var n={},r="yuiRootLang",i="yuiActiveLang",s=[];e.mix(e.namespace("Intl"),{_mod:function(e){return n[e]||(n[e]={}),n[e]},setLang:function(e,t){var n=this._mod(e),s=n[i],o=!!n[t];return o&&t!==s&&(n[i]=t,this.fire("intl:langChange",{module:e,prevVal:s,newVal:t===r?"":t})),o},getLang:function(e){var t=this._mod(e)[i];return t===r?"":t},add:function(e,t,n){t=t||r,this._mod(e)[t]=n,this.setLang(e,t)},get:function(t,n,r){var s=this._mod(t),o;return r=r||s[i],o=s[r]||{},n?o[n]:e.merge(o)},getAvailableLangs:function(t){var n=e.Env._loader,r=n&&n.moduleInfo[t],i=r&&r.lang;return i?i.concat():s}}),e.augment(e.Intl,e.EventTarget),e.Intl.publish("intl:langChange",{emitFacade:!0})},"3.7.2",{requires:["intl-base","event-custom"]});+YUI.add("intl",function(e,t){var n={},r="yuiRootLang",i="yuiActiveLang",s=[];e.mix(e.namespace("Intl"),{_mod:function(e){return n[e]||(n[e]={}),n[e]},setLang:function(e,t){var n=this._mod(e),s=n[i],o=!!n[t];return o&&t!==s&&(n[i]=t,this.fire("intl:langChange",{module:e,prevVal:s,newVal:t===r?"":t})),o},getLang:function(e){var t=this._mod(e)[i];return t===r?"":t},add:function(e,t,n){t=t||r,this._mod(e)[t]=n,this.setLang(e,t)},get:function(t,n,r){var s=this._mod(t),o;return r=r||s[i],o=s[r]||{},n?o[n]:e.merge(o)},getAvailableLangs:function(t){var n=e.Env._loader,r=n&&n.moduleInfo[t],i=r&&r.lang;return i?i.concat():s}}),e.augment(e.Intl,e.EventTarget),e.Intl.publish("intl:langChange",{emitFacade:!0})},"3.7.3",{requires:["intl-base","event-custom"]});
bundle/intl/intl.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -153,4 +153,4 @@ Y.Intl.publish("intl:langChange", {emitFacade:true}); -}, '3.7.2', {"requires": ["intl-base", "event-custom"]});+}, '3.7.3', {"requires": ["intl-base", "event-custom"]});
bundle/io-base/io-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/io-base/io-base.js", code: [] };-_yuitest_coverage["build/io-base/io-base.js"].code=["YUI.add('io-base', function (Y, NAME) {","","/**","Base IO functionality. Provides basic XHR transport support.","","@module io","@submodule io-base","@for IO","**/","","var // List of events that comprise the IO event lifecycle."," EVENTS = ['start', 'complete', 'end', 'success', 'failure', 'progress'],",""," // Whitelist of used XHR response object properties."," XHR_PROPS = ['status', 'statusText', 'responseText', 'responseXML'],",""," win = Y.config.win,"," uid = 0;","","/**","The IO class is a utility that brokers HTTP requests through a simplified","interface. Specifically, it allows JavaScript to make HTTP requests to","a resource without a page reload. The underlying transport for making","same-domain requests is the XMLHttpRequest object. IO can also use","Flash, if specified as a transport, for cross-domain requests.","","@class IO","@constructor","@param {Object} config Object of EventTarget's publish method configurations"," used to configure IO's events.","**/","function IO (config) {"," var io = this;",""," io._uid = 'io:' + uid++;"," io._init(config);"," Y.io._map[io._uid] = io;","}","","IO.prototype = {"," //--------------------------------------"," // Properties"," //--------------------------------------",""," /**"," * A counter that increments for each transaction."," *"," * @property _id"," * @private"," * @type {Number}"," */"," _id: 0,",""," /**"," * Object of IO HTTP headers sent with each transaction."," *"," * @property _headers"," * @private"," * @type {Object}"," */"," _headers: {"," 'X-Requested-With' : 'XMLHttpRequest'"," },",""," /**"," * Object that stores timeout values for any transaction with a defined"," * \"timeout\" configuration property."," *"," * @property _timeout"," * @private"," * @type {Object}"," */"," _timeout: {},",""," //--------------------------------------"," // Methods"," //--------------------------------------",""," _init: function(config) {"," var io = this, i, len;",""," io.cfg = config || {};",""," Y.augment(io, Y.EventTarget);"," for (i = 0, len = EVENTS.length; i < len; ++i) {"," // Publish IO global events with configurations, if any."," // IO global events are set to broadcast by default."," // These events use the \"io:\" namespace."," io.publish('io:' + EVENTS[i], Y.merge({ broadcast: 1 }, config));"," // Publish IO transaction events with configurations, if"," // any. These events use the \"io-trn:\" namespace."," io.publish('io-trn:' + EVENTS[i], config);"," }"," },",""," /**"," * Method that creates a unique transaction object for each request."," *"," * @method _create"," * @private"," * @param {Object} cfg Configuration object subset to determine if"," * the transaction is an XDR or file upload,"," * requiring an alternate transport."," * @param {Number} id Transaction id"," * @return {Object} The transaction object"," */"," _create: function(config, id) {"," var io = this,"," transaction = {"," id : Y.Lang.isNumber(id) ? id : io._id++,"," uid: io._uid"," },"," alt = config.xdr ? config.xdr.use : null,"," form = config.form && config.form.upload ? 'iframe' : null,"," use;",""," if (alt === 'native') {"," // Non-IE can use XHR level 2 and not rely on an"," // external transport."," alt = Y.UA.ie ? 'xdr' : null;",""," // Prevent \"pre-flight\" OPTIONS request by removing the"," // `X-Requested-With` HTTP header from CORS requests. This header"," // can be added back on a per-request basis, if desired."," io.setHeader('X-Requested-With');"," }",""," use = alt || form;"," transaction = use ? Y.merge(Y.IO.customTransport(use), transaction) :"," Y.merge(Y.IO.defaultTransport(), transaction);",""," if (transaction.notify) {"," config.notify = function (e, t, c) { io.notify(e, t, c); };"," }",""," if (!use) {"," if (win && win.FormData && config.data instanceof win.FormData) {"," transaction.c.upload.onprogress = function (e) {"," io.progress(transaction, e, config);"," };"," transaction.c.onload = function (e) {"," io.load(transaction, e, config);"," };"," transaction.c.onerror = function (e) {"," io.error(transaction, e, config);"," };"," transaction.upload = true;"," }"," }",""," return transaction;"," },",""," _destroy: function(transaction) {"," if (win && !transaction.notify && !transaction.xdr) {"," if (XHR && !transaction.upload) {"," transaction.c.onreadystatechange = null;"," } else if (transaction.upload) {"," transaction.c.upload.onprogress = null;"," transaction.c.onload = null;"," transaction.c.onerror = null;"," } else if (Y.UA.ie && !transaction.e) {"," // IE, when using XMLHttpRequest as an ActiveX Object, will throw"," // a \"Type Mismatch\" error if the event handler is set to \"null\"."," transaction.c.abort();"," }"," }",""," transaction = transaction.c = null;"," },",""," /**"," * Method for creating and firing events."," *"," * @method _evt"," * @private"," * @param {String} eventName Event to be published."," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration data subset for event subscription."," */"," _evt: function(eventName, transaction, config) {"," var io = this, params,"," args = config['arguments'],"," emitFacade = io.cfg.emitFacade,"," globalEvent = \"io:\" + eventName,"," trnEvent = \"io-trn:\" + eventName;",""," // Workaround for #2532107"," this.detach(trnEvent);",""," if (transaction.e) {"," transaction.c = { status: 0, statusText: transaction.e };"," }",""," // Fire event with parameters or an Event Facade."," params = [ emitFacade ?"," {"," id: transaction.id,"," data: transaction.c,"," cfg: config,"," 'arguments': args"," } :"," transaction.id"," ];",""," if (!emitFacade) {"," if (eventName === EVENTS[0] || eventName === EVENTS[2]) {"," if (args) {"," params.push(args);"," }"," } else {"," if (transaction.evt) {"," params.push(transaction.evt);"," } else {"," params.push(transaction.c);"," }"," if (args) {"," params.push(args);"," }"," }"," }",""," params.unshift(globalEvent);"," // Fire global events."," io.fire.apply(io, params);"," // Fire transaction events, if receivers are defined."," if (config.on) {"," params[0] = trnEvent;"," io.once(trnEvent, config.on[eventName], config.context || Y);"," io.fire.apply(io, params);"," }"," },",""," /**"," * Fires event \"io:start\" and creates, fires a transaction-specific"," * start event, if `config.on.start` is defined."," *"," * @method start"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," start: function(transaction, config) {"," /**"," * Signals the start of an IO request."," * @event io:start"," */"," this._evt(EVENTS[0], transaction, config);"," },",""," /**"," * Fires event \"io:complete\" and creates, fires a"," * transaction-specific \"complete\" event, if config.on.complete is"," * defined."," *"," * @method complete"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," complete: function(transaction, config) {"," /**"," * Signals the completion of the request-response phase of a"," * transaction. Response status and data are accessible, if"," * available, in this event."," * @event io:complete"," */"," this._evt(EVENTS[1], transaction, config);"," },",""," /**"," * Fires event \"io:end\" and creates, fires a transaction-specific \"end\""," * event, if config.on.end is defined."," *"," * @method end"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," end: function(transaction, config) {"," /**"," * Signals the end of the transaction lifecycle."," * @event io:end"," */"," this._evt(EVENTS[2], transaction, config);"," this._destroy(transaction);"," },",""," /**"," * Fires event \"io:success\" and creates, fires a transaction-specific"," * \"success\" event, if config.on.success is defined."," *"," * @method success"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," success: function(transaction, config) {"," /**"," * Signals an HTTP response with status in the 2xx range."," * Fires after io:complete."," * @event io:success"," */"," this._evt(EVENTS[3], transaction, config);"," this.end(transaction, config);"," },",""," /**"," * Fires event \"io:failure\" and creates, fires a transaction-specific"," * \"failure\" event, if config.on.failure is defined."," *"," * @method failure"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," failure: function(transaction, config) {"," /**"," * Signals an HTTP response with status outside of the 2xx range."," * Fires after io:complete."," * @event io:failure"," */"," this._evt(EVENTS[4], transaction, config);"," this.end(transaction, config);"," },",""," /**"," * Fires event \"io:progress\" and creates, fires a transaction-specific"," * \"progress\" event -- for XMLHttpRequest file upload -- if"," * config.on.progress is defined."," *"," * @method progress"," * @param {Object} transaction Transaction object."," * @param {Object} progress event."," * @param {Object} config Configuration object for the transaction."," */"," progress: function(transaction, e, config) {"," /**"," * Signals the interactive state during a file upload transaction."," * This event fires after io:start and before io:complete."," * @event io:progress"," */"," transaction.evt = e;"," this._evt(EVENTS[5], transaction, config);"," },",""," /**"," * Fires event \"io:complete\" and creates, fires a transaction-specific"," * \"complete\" event -- for XMLHttpRequest file upload -- if"," * config.on.complete is defined."," *"," * @method load"," * @param {Object} transaction Transaction object."," * @param {Object} load event."," * @param {Object} config Configuration object for the transaction."," */"," load: function (transaction, e, config) {"," transaction.evt = e.target;"," this._evt(EVENTS[1], transaction, config);"," },",""," /**"," * Fires event \"io:failure\" and creates, fires a transaction-specific"," * \"failure\" event -- for XMLHttpRequest file upload -- if"," * config.on.failure is defined."," *"," * @method error"," * @param {Object} transaction Transaction object."," * @param {Object} error event."," * @param {Object} config Configuration object for the transaction."," */"," error: function (transaction, e, config) {"," transaction.evt = e;"," this._evt(EVENTS[4], transaction, config);"," },",""," /**"," * Retry an XDR transaction, using the Flash tranport, if the native"," * transport fails."," *"," * @method _retry"," * @private"," * @param {Object} transaction Transaction object."," * @param {String} uri Qualified path to transaction resource."," * @param {Object} config Configuration object for the transaction."," */"," _retry: function(transaction, uri, config) {"," this._destroy(transaction);"," config.xdr.use = 'flash';"," return this.send(uri, config, transaction.id);"," },",""," /**"," * Method that concatenates string data for HTTP GET transactions."," *"," * @method _concat"," * @private"," * @param {String} uri URI or root data."," * @param {String} data Data to be concatenated onto URI."," * @return {String}"," */"," _concat: function(uri, data) {"," uri += (uri.indexOf('?') === -1 ? '?' : '&') + data;"," return uri;"," },",""," /**"," * Stores default client headers for all transactions. If a label is"," * passed with no value argument, the header will be deleted."," *"," * @method setHeader"," * @param {String} name HTTP header"," * @param {String} value HTTP header value"," */"," setHeader: function(name, value) {"," if (value) {"," this._headers[name] = value;"," } else {"," delete this._headers[name];"," }"," },",""," /**"," * Method that sets all HTTP headers to be sent in a transaction."," *"," * @method _setHeaders"," * @private"," * @param {Object} transaction - XHR instance for the specific transaction."," * @param {Object} headers - HTTP headers for the specific transaction, as"," * defined in the configuration object passed to YUI.io()."," */"," _setHeaders: function(transaction, headers) {"," headers = Y.merge(this._headers, headers);"," Y.Object.each(headers, function(value, name) {"," if (value !== 'disable') {"," transaction.setRequestHeader(name, headers[name]);"," }"," });"," },",""," /**"," * Starts timeout count if the configuration object has a defined"," * timeout property."," *"," * @method _startTimeout"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} timeout Timeout in milliseconds."," */"," _startTimeout: function(transaction, timeout) {"," var io = this;",""," io._timeout[transaction.id] = setTimeout(function() {"," io._abort(transaction, 'timeout');"," }, timeout);"," },",""," /**"," * Clears the timeout interval started by _startTimeout()."," *"," * @method _clearTimeout"," * @private"," * @param {Number} id - Transaction id."," */"," _clearTimeout: function(id) {"," clearTimeout(this._timeout[id]);"," delete this._timeout[id];"," },",""," /**"," * Method that determines if a transaction response qualifies as success"," * or failure, based on the response HTTP status code, and fires the"," * appropriate success or failure events."," *"," * @method _result"," * @private"," * @static"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} config Configuration object passed to io()."," */"," _result: function(transaction, config) {"," var status;"," // Firefox will throw an exception if attempting to access"," // an XHR object's status property, after a request is aborted."," try {"," status = transaction.c.status;"," } catch(e) {"," status = 0;"," }",""," // IE reports HTTP 204 as HTTP 1223."," if (status >= 200 && status < 300 || status === 304 || status === 1223) {"," this.success(transaction, config);"," } else {"," this.failure(transaction, config);"," }"," },",""," /**"," * Event handler bound to onreadystatechange."," *"," * @method _rS"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} config Configuration object passed to YUI.io()."," */"," _rS: function(transaction, config) {"," var io = this;",""," if (transaction.c.readyState === 4) {"," if (config.timeout) {"," io._clearTimeout(transaction.id);"," }",""," // Yield in the event of request timeout or abort."," setTimeout(function() {"," io.complete(transaction, config);"," io._result(transaction, config);"," }, 0);"," }"," },",""," /**"," * Terminates a transaction due to an explicit abort or timeout."," *"," * @method _abort"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {String} type Identifies timed out or aborted transaction."," */"," _abort: function(transaction, type) {"," if (transaction && transaction.c) {"," transaction.e = type;"," transaction.c.abort();"," }"," },",""," /**"," * Requests a transaction. `send()` is implemented as `Y.io()`. Each"," * transaction may include a configuration object. Its properties are:"," *"," * <dl>"," * <dt>method</dt>"," * <dd>HTTP method verb (e.g., GET or POST). If this property is not"," * not defined, the default value will be GET.</dd>"," *"," * <dt>data</dt>"," * <dd>This is the name-value string that will be sent as the"," * transaction data. If the request is HTTP GET, the data become"," * part of querystring. If HTTP POST, the data are sent in the"," * message body.</dd>"," *"," * <dt>xdr</dt>"," * <dd>Defines the transport to be used for cross-domain requests."," * By setting this property, the transaction will use the specified"," * transport instead of XMLHttpRequest. The properties of the"," * transport object are:"," * <dl>"," * <dt>use</dt>"," * <dd>The transport to be used: 'flash' or 'native'</dd>"," * <dt>dataType</dt>"," * <dd>Set the value to 'XML' if that is the expected response"," * content type.</dd>"," * </dl></dd>"," *"," * <dt>form</dt>"," * <dd>Form serialization configuration object. Its properties are:"," * <dl>"," * <dt>id</dt>"," * <dd>Node object or id of HTML form</dd>"," * <dt>useDisabled</dt>"," * <dd>`true` to also serialize disabled form field values"," * (defaults to `false`)</dd>"," * </dl></dd>"," *"," * <dt>on</dt>"," * <dd>Assigns transaction event subscriptions. Available events are:"," * <dl>"," * <dt>start</dt>"," * <dd>Fires when a request is sent to a resource.</dd>"," * <dt>complete</dt>"," * <dd>Fires when the transaction is complete.</dd>"," * <dt>success</dt>"," * <dd>Fires when the HTTP response status is within the 2xx"," * range.</dd>"," * <dt>failure</dt>"," * <dd>Fires when the HTTP response status is outside the 2xx"," * range, if an exception occurs, if the transation is aborted,"," * or if the transaction exceeds a configured `timeout`.</dd>"," * <dt>end</dt>"," * <dd>Fires at the conclusion of the transaction"," * lifecycle, after `success` or `failure`.</dd>"," * </dl>"," *"," * <p>Callback functions for `start` and `end` receive the id of the"," * transaction as a first argument. For `complete`, `success`, and"," * `failure`, callbacks receive the id and the response object"," * (usually the XMLHttpRequest instance). If the `arguments`"," * property was included in the configuration object passed to"," * `Y.io()`, the configured data will be passed to all callbacks as"," * the last argument.</p>"," * </dd>"," *"," * <dt>sync</dt>"," * <dd>Pass `true` to make a same-domain transaction synchronous."," * <strong>CAVEAT</strong>: This will negatively impact the user"," * experience. Have a <em>very</em> good reason if you intend to use"," * this.</dd>"," *"," * <dt>context</dt>"," * <dd>The \"`this'\" object for all configured event handlers. If a"," * specific context is needed for individual callbacks, bind the"," * callback to a context using `Y.bind()`.</dd>"," *"," * <dt>headers</dt>"," * <dd>Object map of transaction headers to send to the server. The"," * object keys are the header names and the values are the header"," * values.</dd>"," *"," * <dt>timeout</dt>"," * <dd>Millisecond threshold for the transaction before being"," * automatically aborted.</dd>"," *"," * <dt>arguments</dt>"," * <dd>User-defined data passed to all registered event handlers."," * This value is available as the second argument in the \"start\" and"," * \"end\" event handlers. It is the third argument in the \"complete\","," * \"success\", and \"failure\" event handlers. <strong>Be sure to quote"," * this property name in the transaction configuration as"," * \"arguments\" is a reserved word in JavaScript</strong> (e.g."," * `Y.io({ ..., \"arguments\": stuff })`).</dd>"," * </dl>"," *"," * @method send"," * @public"," * @param {String} uri Qualified path to transaction resource."," * @param {Object} config Configuration object for the transaction."," * @param {Number} id Transaction id, if already set."," * @return {Object}"," */"," send: function(uri, config, id) {"," var transaction, method, i, len, sync, data,"," io = this,"," u = uri,"," response = {};",""," config = config ? Y.Object(config) : {};"," transaction = io._create(config, id);"," method = config.method ? config.method.toUpperCase() : 'GET';"," sync = config.sync;"," data = config.data;",""," // Serialize an map object into a key-value string using"," // querystring-stringify-simple."," if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) {"," data = Y.QueryString.stringify(data);"," }",""," if (config.form) {"," if (config.form.upload) {"," // This is a file upload transaction, calling"," // upload() in io-upload-iframe."," return io.upload(transaction, uri, config);"," } else {"," // Serialize HTML form data into a key-value string."," data = io._serialize(config.form, data);"," }"," }",""," if (data) {"," switch (method) {"," case 'GET':"," case 'HEAD':"," case 'DELETE':"," u = io._concat(u, data);"," data = '';"," break;"," case 'POST':"," case 'PUT':"," // If Content-Type is defined in the configuration object, or"," // or as a default header, it will be used instead of"," // 'application/x-www-form-urlencoded; charset=UTF-8'"," config.headers = Y.merge({"," 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'"," }, config.headers);"," break;"," }"," }",""," if (transaction.xdr) {"," // Route data to io-xdr module for flash and XDomainRequest."," return io.xdr(u, transaction, config);"," }"," else if (transaction.notify) {"," // Route data to custom transport"," return transaction.c.send(transaction, uri, config);"," }",""," if (!sync && !transaction.upload) {"," transaction.c.onreadystatechange = function() {"," io._rS(transaction, config);"," };"," }",""," try {"," // Determine if request is to be set as"," // synchronous or asynchronous."," transaction.c.open(method, u, !sync, config.username || null, config.password || null);"," io._setHeaders(transaction.c, config.headers || {});"," io.start(transaction, config);",""," // Will work only in browsers that implement the"," // Cross-Origin Resource Sharing draft."," if (config.xdr && config.xdr.credentials) {"," if (!Y.UA.ie) {"," transaction.c.withCredentials = true;"," }"," }",""," // Using \"null\" with HTTP POST will result in a request"," // with no Content-Length header defined."," transaction.c.send(data);",""," if (sync) {"," // Create a response object for synchronous transactions,"," // mixing id and arguments properties with the xhr"," // properties whitelist."," for (i = 0, len = XHR_PROPS.length; i < len; ++i) {"," response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]];"," }",""," response.getAllResponseHeaders = function() {"," return transaction.c.getAllResponseHeaders();"," };",""," response.getResponseHeader = function(name) {"," return transaction.c.getResponseHeader(name);"," };",""," io.complete(transaction, config);"," io._result(transaction, config);",""," return response;"," }"," } catch(e) {"," if (transaction.xdr) {"," // This exception is usually thrown by browsers"," // that do not support XMLHttpRequest Level 2."," // Retry the request with the XDR transport set"," // to 'flash'. If the Flash transport is not"," // initialized or available, the transaction"," // will resolve to a transport error."," return io._retry(transaction, uri, config);"," } else {"," io.complete(transaction, config);"," io._result(transaction, config);"," }"," }",""," // If config.timeout is defined, and the request is standard XHR,"," // initialize timeout polling."," if (config.timeout) {"," io._startTimeout(transaction, config.timeout);"," }",""," return {"," id: transaction.id,"," abort: function() {"," return transaction.c ? io._abort(transaction, 'abort') : false;"," },"," isInProgress: function() {"," return transaction.c ? (transaction.c.readyState % 4) : false;"," },"," io: io"," };"," }","};","","/**","Method for initiating an ajax call. The first argument is the url end","point for the call. The second argument is an object to configure the","transaction and attach event subscriptions. The configuration object","supports the following properties:","","<dl>"," <dt>method</dt>"," <dd>HTTP method verb (e.g., GET or POST). If this property is not"," not defined, the default value will be GET.</dd>",""," <dt>data</dt>"," <dd>This is the name-value string that will be sent as the"," transaction data. If the request is HTTP GET, the data become"," part of querystring. If HTTP POST, the data are sent in the"," message body.</dd>",""," <dt>xdr</dt>"," <dd>Defines the transport to be used for cross-domain requests."," By setting this property, the transaction will use the specified"," transport instead of XMLHttpRequest. The properties of the"," transport object are:"," <dl>"," <dt>use</dt>"," <dd>The transport to be used: 'flash' or 'native'</dd>"," <dt>dataType</dt>"," <dd>Set the value to 'XML' if that is the expected response"," content type.</dd>"," </dl></dd>",""," <dt>form</dt>"," <dd>Form serialization configuration object. Its properties are:"," <dl>"," <dt>id</dt>"," <dd>Node object or id of HTML form</dd>"," <dt>useDisabled</dt>"," <dd>`true` to also serialize disabled form field values"," (defaults to `false`)</dd>"," </dl></dd>",""," <dt>on</dt>"," <dd>Assigns transaction event subscriptions. Available events are:"," <dl>"," <dt>start</dt>"," <dd>Fires when a request is sent to a resource.</dd>"," <dt>complete</dt>"," <dd>Fires when the transaction is complete.</dd>"," <dt>success</dt>"," <dd>Fires when the HTTP response status is within the 2xx"," range.</dd>"," <dt>failure</dt>"," <dd>Fires when the HTTP response status is outside the 2xx"," range, if an exception occurs, if the transation is aborted,"," or if the transaction exceeds a configured `timeout`.</dd>"," <dt>end</dt>"," <dd>Fires at the conclusion of the transaction"," lifecycle, after `success` or `failure`.</dd>"," </dl>",""," <p>Callback functions for `start` and `end` receive the id of the"," transaction as a first argument. For `complete`, `success`, and"," `failure`, callbacks receive the id and the response object"," (usually the XMLHttpRequest instance). If the `arguments`"," property was included in the configuration object passed to"," `Y.io()`, the configured data will be passed to all callbacks as"," the last argument.</p>"," </dd>",""," <dt>sync</dt>"," <dd>Pass `true` to make a same-domain transaction synchronous."," <strong>CAVEAT</strong>: This will negatively impact the user"," experience. Have a <em>very</em> good reason if you intend to use"," this.</dd>",""," <dt>context</dt>"," <dd>The \"`this'\" object for all configured event handlers. If a"," specific context is needed for individual callbacks, bind the"," callback to a context using `Y.bind()`.</dd>",""," <dt>headers</dt>"," <dd>Object map of transaction headers to send to the server. The"," object keys are the header names and the values are the header"," values.</dd>",""," <dt>timeout</dt>"," <dd>Millisecond threshold for the transaction before being"," automatically aborted.</dd>",""," <dt>arguments</dt>"," <dd>User-defined data passed to all registered event handlers."," This value is available as the second argument in the \"start\" and"," \"end\" event handlers. It is the third argument in the \"complete\","," \"success\", and \"failure\" event handlers. <strong>Be sure to quote"," this property name in the transaction configuration as"," \"arguments\" is a reserved word in JavaScript</strong> (e.g."," `Y.io({ ..., \"arguments\": stuff })`).</dd>","</dl>","","@method io","@static","@param {String} url qualified path to transaction resource.","@param {Object} config configuration object for the transaction.","@return {Object}","@for YUI","**/","Y.io = function(url, config) {"," // Calling IO through the static interface will use and reuse"," // an instance of IO."," var transaction = Y.io._map['io:0'] || new IO();"," return transaction.send.apply(transaction, [url, config]);","};","","/**","Method for setting and deleting IO HTTP headers to be sent with every","request.","","Hosted as a property on the `io` function (e.g. `Y.io.header`).","","@method header","@param {String} name HTTP header","@param {String} value HTTP header value","@static","**/","Y.io.header = function(name, value) {"," // Calling IO through the static interface will use and reuse"," // an instance of IO."," var transaction = Y.io._map['io:0'] || new IO();"," transaction.setHeader(name, value);","};","","Y.IO = IO;","// Map of all IO instances created.","Y.io._map = {};","var XHR = win && win.XMLHttpRequest,"," XDR = win && win.XDomainRequest,"," AX = win && win.ActiveXObject;","","","Y.mix(Y.IO, {"," /**"," * The ID of the default IO transport, defaults to `xhr`"," * @property _default"," * @type {String}"," * @static"," */"," _default: 'xhr',"," /**"," *"," * @method defaultTransport"," * @static"," * @param {String} [id] The transport to set as the default, if empty a new transport is created."," * @return {Object} The transport object with a `send` method"," */"," defaultTransport: function(id) {"," if (id) {"," Y.IO._default = id;"," } else {"," var o = {"," c: Y.IO.transports[Y.IO._default](),"," notify: Y.IO._default === 'xhr' ? false : true"," };"," return o;"," }"," },"," /**"," * An object hash of custom transports available to IO"," * @property transports"," * @type {Object}"," * @static"," */"," transports: {"," xhr: function () {"," return XHR ? new XMLHttpRequest() :"," AX ? new ActiveXObject('Microsoft.XMLHTTP') : null;"," },"," xdr: function () {"," return XDR ? new XDomainRequest() : null;"," },"," iframe: function () { return {}; },"," flash: null,"," nodejs: null"," },"," /**"," * Create a custom transport of type and return it's object"," * @method customTransport"," * @param {String} id The id of the transport to create."," * @static"," */"," customTransport: function(id) {"," var o = { c: Y.IO.transports[id]() };",""," o[(id === 'xdr' || id === 'flash') ? 'xdr' : 'notify'] = true;"," return o;"," }","});","","Y.mix(Y.IO.prototype, {"," /**"," * Fired from the notify method of the transport which in turn fires"," * the event on the IO object."," * @method notify"," * @param {String} event The name of the event"," * @param {Object} transaction The transaction object"," * @param {Object} config The configuration object for this transaction"," */"," notify: function(event, transaction, config) {"," var io = this;",""," switch (event) {"," case 'timeout':"," case 'abort':"," case 'transport error':"," transaction.c = { status: 0, statusText: event };"," event = 'failure';"," default:"," io[event].apply(io, [transaction, config]);"," }"," }","});","","","","","}, '3.7.2', {\"requires\": [\"event-custom-base\", \"querystring-stringify-simple\"]});"];-_yuitest_coverage["build/io-base/io-base.js"].lines = {"1":0,"11":0,"32":0,"33":0,"35":0,"36":0,"37":0,"40":0,"80":0,"82":0,"84":0,"85":0,"89":0,"92":0,"108":0,"117":0,"120":0,"125":0,"128":0,"129":0,"132":0,"133":0,"136":0,"137":0,"138":0,"139":0,"141":0,"142":0,"144":0,"145":0,"147":0,"151":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"165":0,"169":0,"182":0,"189":0,"191":0,"192":0,"196":0,"206":0,"207":0,"208":0,"209":0,"212":0,"213":0,"215":0,"217":0,"218":0,"223":0,"225":0,"227":0,"228":0,"229":0,"230":0,"247":0,"266":0,"282":0,"283":0,"300":0,"301":0,"318":0,"319":0,"338":0,"339":0,"353":0,"354":0,"368":0,"369":0,"383":0,"384":0,"385":0,"398":0,"399":0,"411":0,"412":0,"414":0,"428":0,"429":0,"430":0,"431":0,"446":0,"448":0,"449":0,"461":0,"462":0,"477":0,"480":0,"481":0,"483":0,"487":0,"488":0,"490":0,"503":0,"505":0,"506":0,"507":0,"511":0,"512":0,"513":0,"527":0,"528":0,"529":0,"637":0,"642":0,"643":0,"644":0,"645":0,"646":0,"650":0,"651":0,"654":0,"655":0,"658":0,"661":0,"665":0,"666":0,"670":0,"671":0,"672":0,"678":0,"681":0,"685":0,"687":0,"689":0,"691":0,"694":0,"695":0,"696":0,"700":0,"703":0,"704":0,"705":0,"709":0,"710":0,"711":0,"717":0,"719":0,"723":0,"724":0,"727":0,"728":0,"731":0,"732":0,"735":0,"736":0,"738":0,"741":0,"748":0,"750":0,"751":0,"757":0,"758":0,"761":0,"764":0,"767":0,"879":0,"882":0,"883":0,"897":0,"900":0,"901":0,"904":0,"906":0,"907":0,"912":0,"928":0,"929":0,"931":0,"935":0,"946":0,"950":0,"952":0,"963":0,"965":0,"966":0,"970":0,"980":0,"982":0,"986":0,"987":0,"989":0};-_yuitest_coverage["build/io-base/io-base.js"].functions = {"IO:32":0,"_init:79":0,"notify:133":0,"onprogress:138":0,"onload:141":0,"onerror:144":0,"_create:107":0,"_destroy:154":0,"_evt:181":0,"start:242":0,"complete:259":0,"end:277":0,"success:294":0,"failure:312":0,"progress:332":0,"load:352":0,"error:367":0,"_retry:382":0,"_concat:397":0,"setHeader:410":0,"(anonymous 2):429":0,"_setHeaders:427":0,"(anonymous 3):448":0,"_startTimeout:445":0,"_clearTimeout:460":0,"_result:476":0,"(anonymous 4):511":0,"_rS:502":0,"_abort:526":0,"onreadystatechange:695":0,"getAllResponseHeaders:727":0,"getResponseHeader:731":0,"abort:763":0,"isInProgress:766":0,"send:636":0,"io:879":0,"header:897":0,"defaultTransport:927":0,"xhr:945":0,"xdr:949":0,"iframe:952":0,"customTransport:962":0,"notify:979":0,"(anonymous 1):1":0};-_yuitest_coverage["build/io-base/io-base.js"].coveredLines = 189;+_yuitest_coverage["build/io-base/io-base.js"].code=["YUI.add('io-base', function (Y, NAME) {","","/**","Base IO functionality. Provides basic XHR transport support.","","@module io","@submodule io-base","@for IO","**/","","var // List of events that comprise the IO event lifecycle."," EVENTS = ['start', 'complete', 'end', 'success', 'failure', 'progress'],",""," // Whitelist of used XHR response object properties."," XHR_PROPS = ['status', 'statusText', 'responseText', 'responseXML'],",""," win = Y.config.win,"," uid = 0;","","/**","The IO class is a utility that brokers HTTP requests through a simplified","interface. Specifically, it allows JavaScript to make HTTP requests to","a resource without a page reload. The underlying transport for making","same-domain requests is the XMLHttpRequest object. IO can also use","Flash, if specified as a transport, for cross-domain requests.","","@class IO","@constructor","@param {Object} config Object of EventTarget's publish method configurations"," used to configure IO's events.","**/","function IO (config) {"," var io = this;",""," io._uid = 'io:' + uid++;"," io._init(config);"," Y.io._map[io._uid] = io;","}","","IO.prototype = {"," //--------------------------------------"," // Properties"," //--------------------------------------",""," /**"," * A counter that increments for each transaction."," *"," * @property _id"," * @private"," * @type {Number}"," */"," _id: 0,",""," /**"," * Object of IO HTTP headers sent with each transaction."," *"," * @property _headers"," * @private"," * @type {Object}"," */"," _headers: {"," 'X-Requested-With' : 'XMLHttpRequest'"," },",""," /**"," * Object that stores timeout values for any transaction with a defined"," * \"timeout\" configuration property."," *"," * @property _timeout"," * @private"," * @type {Object}"," */"," _timeout: {},",""," //--------------------------------------"," // Methods"," //--------------------------------------",""," _init: function(config) {"," var io = this, i, len;",""," io.cfg = config || {};",""," Y.augment(io, Y.EventTarget);"," for (i = 0, len = EVENTS.length; i < len; ++i) {"," // Publish IO global events with configurations, if any."," // IO global events are set to broadcast by default."," // These events use the \"io:\" namespace."," io.publish('io:' + EVENTS[i], Y.merge({ broadcast: 1 }, config));"," // Publish IO transaction events with configurations, if"," // any. These events use the \"io-trn:\" namespace."," io.publish('io-trn:' + EVENTS[i], config);"," }"," },",""," /**"," * Method that creates a unique transaction object for each request."," *"," * @method _create"," * @private"," * @param {Object} cfg Configuration object subset to determine if"," * the transaction is an XDR or file upload,"," * requiring an alternate transport."," * @param {Number} id Transaction id"," * @return {Object} The transaction object"," */"," _create: function(config, id) {"," var io = this,"," transaction = {"," id : Y.Lang.isNumber(id) ? id : io._id++,"," uid: io._uid"," },"," alt = config.xdr ? config.xdr.use : null,"," form = config.form && config.form.upload ? 'iframe' : null,"," use;",""," if (alt === 'native') {"," // Non-IE and IE >= 10 can use XHR level 2 and not rely on an"," // external transport."," alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null;",""," // Prevent \"pre-flight\" OPTIONS request by removing the"," // `X-Requested-With` HTTP header from CORS requests. This header"," // can be added back on a per-request basis, if desired."," io.setHeader('X-Requested-With');"," }",""," use = alt || form;"," transaction = use ? Y.merge(Y.IO.customTransport(use), transaction) :"," Y.merge(Y.IO.defaultTransport(), transaction);",""," if (transaction.notify) {"," config.notify = function (e, t, c) { io.notify(e, t, c); };"," }",""," if (!use) {"," if (win && win.FormData && config.data instanceof win.FormData) {"," transaction.c.upload.onprogress = function (e) {"," io.progress(transaction, e, config);"," };"," transaction.c.onload = function (e) {"," io.load(transaction, e, config);"," };"," transaction.c.onerror = function (e) {"," io.error(transaction, e, config);"," };"," transaction.upload = true;"," }"," }",""," return transaction;"," },",""," _destroy: function(transaction) {"," if (win && !transaction.notify && !transaction.xdr) {"," if (XHR && !transaction.upload) {"," transaction.c.onreadystatechange = null;"," } else if (transaction.upload) {"," transaction.c.upload.onprogress = null;"," transaction.c.onload = null;"," transaction.c.onerror = null;"," } else if (Y.UA.ie && !transaction.e) {"," // IE, when using XMLHttpRequest as an ActiveX Object, will throw"," // a \"Type Mismatch\" error if the event handler is set to \"null\"."," transaction.c.abort();"," }"," }",""," transaction = transaction.c = null;"," },",""," /**"," * Method for creating and firing events."," *"," * @method _evt"," * @private"," * @param {String} eventName Event to be published."," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration data subset for event subscription."," */"," _evt: function(eventName, transaction, config) {"," var io = this, params,"," args = config['arguments'],"," emitFacade = io.cfg.emitFacade,"," globalEvent = \"io:\" + eventName,"," trnEvent = \"io-trn:\" + eventName;",""," // Workaround for #2532107"," this.detach(trnEvent);",""," if (transaction.e) {"," transaction.c = { status: 0, statusText: transaction.e };"," }",""," // Fire event with parameters or an Event Facade."," params = [ emitFacade ?"," {"," id: transaction.id,"," data: transaction.c,"," cfg: config,"," 'arguments': args"," } :"," transaction.id"," ];",""," if (!emitFacade) {"," if (eventName === EVENTS[0] || eventName === EVENTS[2]) {"," if (args) {"," params.push(args);"," }"," } else {"," if (transaction.evt) {"," params.push(transaction.evt);"," } else {"," params.push(transaction.c);"," }"," if (args) {"," params.push(args);"," }"," }"," }",""," params.unshift(globalEvent);"," // Fire global events."," io.fire.apply(io, params);"," // Fire transaction events, if receivers are defined."," if (config.on) {"," params[0] = trnEvent;"," io.once(trnEvent, config.on[eventName], config.context || Y);"," io.fire.apply(io, params);"," }"," },",""," /**"," * Fires event \"io:start\" and creates, fires a transaction-specific"," * start event, if `config.on.start` is defined."," *"," * @method start"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," start: function(transaction, config) {"," /**"," * Signals the start of an IO request."," * @event io:start"," */"," this._evt(EVENTS[0], transaction, config);"," },",""," /**"," * Fires event \"io:complete\" and creates, fires a"," * transaction-specific \"complete\" event, if config.on.complete is"," * defined."," *"," * @method complete"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," complete: function(transaction, config) {"," /**"," * Signals the completion of the request-response phase of a"," * transaction. Response status and data are accessible, if"," * available, in this event."," * @event io:complete"," */"," this._evt(EVENTS[1], transaction, config);"," },",""," /**"," * Fires event \"io:end\" and creates, fires a transaction-specific \"end\""," * event, if config.on.end is defined."," *"," * @method end"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," end: function(transaction, config) {"," /**"," * Signals the end of the transaction lifecycle."," * @event io:end"," */"," this._evt(EVENTS[2], transaction, config);"," this._destroy(transaction);"," },",""," /**"," * Fires event \"io:success\" and creates, fires a transaction-specific"," * \"success\" event, if config.on.success is defined."," *"," * @method success"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," success: function(transaction, config) {"," /**"," * Signals an HTTP response with status in the 2xx range."," * Fires after io:complete."," * @event io:success"," */"," this._evt(EVENTS[3], transaction, config);"," this.end(transaction, config);"," },",""," /**"," * Fires event \"io:failure\" and creates, fires a transaction-specific"," * \"failure\" event, if config.on.failure is defined."," *"," * @method failure"," * @param {Object} transaction Transaction object."," * @param {Object} config Configuration object for the transaction."," */"," failure: function(transaction, config) {"," /**"," * Signals an HTTP response with status outside of the 2xx range."," * Fires after io:complete."," * @event io:failure"," */"," this._evt(EVENTS[4], transaction, config);"," this.end(transaction, config);"," },",""," /**"," * Fires event \"io:progress\" and creates, fires a transaction-specific"," * \"progress\" event -- for XMLHttpRequest file upload -- if"," * config.on.progress is defined."," *"," * @method progress"," * @param {Object} transaction Transaction object."," * @param {Object} progress event."," * @param {Object} config Configuration object for the transaction."," */"," progress: function(transaction, e, config) {"," /**"," * Signals the interactive state during a file upload transaction."," * This event fires after io:start and before io:complete."," * @event io:progress"," */"," transaction.evt = e;"," this._evt(EVENTS[5], transaction, config);"," },",""," /**"," * Fires event \"io:complete\" and creates, fires a transaction-specific"," * \"complete\" event -- for XMLHttpRequest file upload -- if"," * config.on.complete is defined."," *"," * @method load"," * @param {Object} transaction Transaction object."," * @param {Object} load event."," * @param {Object} config Configuration object for the transaction."," */"," load: function (transaction, e, config) {"," transaction.evt = e.target;"," this._evt(EVENTS[1], transaction, config);"," },",""," /**"," * Fires event \"io:failure\" and creates, fires a transaction-specific"," * \"failure\" event -- for XMLHttpRequest file upload -- if"," * config.on.failure is defined."," *"," * @method error"," * @param {Object} transaction Transaction object."," * @param {Object} error event."," * @param {Object} config Configuration object for the transaction."," */"," error: function (transaction, e, config) {"," transaction.evt = e;"," this._evt(EVENTS[4], transaction, config);"," },",""," /**"," * Retry an XDR transaction, using the Flash tranport, if the native"," * transport fails."," *"," * @method _retry"," * @private"," * @param {Object} transaction Transaction object."," * @param {String} uri Qualified path to transaction resource."," * @param {Object} config Configuration object for the transaction."," */"," _retry: function(transaction, uri, config) {"," this._destroy(transaction);"," config.xdr.use = 'flash';"," return this.send(uri, config, transaction.id);"," },",""," /**"," * Method that concatenates string data for HTTP GET transactions."," *"," * @method _concat"," * @private"," * @param {String} uri URI or root data."," * @param {String} data Data to be concatenated onto URI."," * @return {String}"," */"," _concat: function(uri, data) {"," uri += (uri.indexOf('?') === -1 ? '?' : '&') + data;"," return uri;"," },",""," /**"," * Stores default client headers for all transactions. If a label is"," * passed with no value argument, the header will be deleted."," *"," * @method setHeader"," * @param {String} name HTTP header"," * @param {String} value HTTP header value"," */"," setHeader: function(name, value) {"," if (value) {"," this._headers[name] = value;"," } else {"," delete this._headers[name];"," }"," },",""," /**"," * Method that sets all HTTP headers to be sent in a transaction."," *"," * @method _setHeaders"," * @private"," * @param {Object} transaction - XHR instance for the specific transaction."," * @param {Object} headers - HTTP headers for the specific transaction, as"," * defined in the configuration object passed to YUI.io()."," */"," _setHeaders: function(transaction, headers) {"," headers = Y.merge(this._headers, headers);"," Y.Object.each(headers, function(value, name) {"," if (value !== 'disable') {"," transaction.setRequestHeader(name, headers[name]);"," }"," });"," },",""," /**"," * Starts timeout count if the configuration object has a defined"," * timeout property."," *"," * @method _startTimeout"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} timeout Timeout in milliseconds."," */"," _startTimeout: function(transaction, timeout) {"," var io = this;",""," io._timeout[transaction.id] = setTimeout(function() {"," io._abort(transaction, 'timeout');"," }, timeout);"," },",""," /**"," * Clears the timeout interval started by _startTimeout()."," *"," * @method _clearTimeout"," * @private"," * @param {Number} id - Transaction id."," */"," _clearTimeout: function(id) {"," clearTimeout(this._timeout[id]);"," delete this._timeout[id];"," },",""," /**"," * Method that determines if a transaction response qualifies as success"," * or failure, based on the response HTTP status code, and fires the"," * appropriate success or failure events."," *"," * @method _result"," * @private"," * @static"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} config Configuration object passed to io()."," */"," _result: function(transaction, config) {"," var status;"," // Firefox will throw an exception if attempting to access"," // an XHR object's status property, after a request is aborted."," try {"," status = transaction.c.status;"," } catch(e) {"," status = 0;"," }",""," // IE reports HTTP 204 as HTTP 1223."," if (status >= 200 && status < 300 || status === 304 || status === 1223) {"," this.success(transaction, config);"," } else {"," this.failure(transaction, config);"," }"," },",""," /**"," * Event handler bound to onreadystatechange."," *"," * @method _rS"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {Object} config Configuration object passed to YUI.io()."," */"," _rS: function(transaction, config) {"," var io = this;",""," if (transaction.c.readyState === 4) {"," if (config.timeout) {"," io._clearTimeout(transaction.id);"," }",""," // Yield in the event of request timeout or abort."," setTimeout(function() {"," io.complete(transaction, config);"," io._result(transaction, config);"," }, 0);"," }"," },",""," /**"," * Terminates a transaction due to an explicit abort or timeout."," *"," * @method _abort"," * @private"," * @param {Object} transaction Transaction object generated by _create()."," * @param {String} type Identifies timed out or aborted transaction."," */"," _abort: function(transaction, type) {"," if (transaction && transaction.c) {"," transaction.e = type;"," transaction.c.abort();"," }"," },",""," /**"," * Requests a transaction. `send()` is implemented as `Y.io()`. Each"," * transaction may include a configuration object. Its properties are:"," *"," * <dl>"," * <dt>method</dt>"," * <dd>HTTP method verb (e.g., GET or POST). If this property is not"," * not defined, the default value will be GET.</dd>"," *"," * <dt>data</dt>"," * <dd>This is the name-value string that will be sent as the"," * transaction data. If the request is HTTP GET, the data become"," * part of querystring. If HTTP POST, the data are sent in the"," * message body.</dd>"," *"," * <dt>xdr</dt>"," * <dd>Defines the transport to be used for cross-domain requests."," * By setting this property, the transaction will use the specified"," * transport instead of XMLHttpRequest. The properties of the"," * transport object are:"," * <dl>"," * <dt>use</dt>"," * <dd>The transport to be used: 'flash' or 'native'</dd>"," * <dt>dataType</dt>"," * <dd>Set the value to 'XML' if that is the expected response"," * content type.</dd>"," * </dl></dd>"," *"," * <dt>form</dt>"," * <dd>Form serialization configuration object. Its properties are:"," * <dl>"," * <dt>id</dt>"," * <dd>Node object or id of HTML form</dd>"," * <dt>useDisabled</dt>"," * <dd>`true` to also serialize disabled form field values"," * (defaults to `false`)</dd>"," * </dl></dd>"," *"," * <dt>on</dt>"," * <dd>Assigns transaction event subscriptions. Available events are:"," * <dl>"," * <dt>start</dt>"," * <dd>Fires when a request is sent to a resource.</dd>"," * <dt>complete</dt>"," * <dd>Fires when the transaction is complete.</dd>"," * <dt>success</dt>"," * <dd>Fires when the HTTP response status is within the 2xx"," * range.</dd>"," * <dt>failure</dt>"," * <dd>Fires when the HTTP response status is outside the 2xx"," * range, if an exception occurs, if the transation is aborted,"," * or if the transaction exceeds a configured `timeout`.</dd>"," * <dt>end</dt>"," * <dd>Fires at the conclusion of the transaction"," * lifecycle, after `success` or `failure`.</dd>"," * </dl>"," *"," * <p>Callback functions for `start` and `end` receive the id of the"," * transaction as a first argument. For `complete`, `success`, and"," * `failure`, callbacks receive the id and the response object"," * (usually the XMLHttpRequest instance). If the `arguments`"," * property was included in the configuration object passed to"," * `Y.io()`, the configured data will be passed to all callbacks as"," * the last argument.</p>"," * </dd>"," *"," * <dt>sync</dt>"," * <dd>Pass `true` to make a same-domain transaction synchronous."," * <strong>CAVEAT</strong>: This will negatively impact the user"," * experience. Have a <em>very</em> good reason if you intend to use"," * this.</dd>"," *"," * <dt>context</dt>"," * <dd>The \"`this'\" object for all configured event handlers. If a"," * specific context is needed for individual callbacks, bind the"," * callback to a context using `Y.bind()`.</dd>"," *"," * <dt>headers</dt>"," * <dd>Object map of transaction headers to send to the server. The"," * object keys are the header names and the values are the header"," * values.</dd>"," *"," * <dt>timeout</dt>"," * <dd>Millisecond threshold for the transaction before being"," * automatically aborted.</dd>"," *"," * <dt>arguments</dt>"," * <dd>User-defined data passed to all registered event handlers."," * This value is available as the second argument in the \"start\" and"," * \"end\" event handlers. It is the third argument in the \"complete\","," * \"success\", and \"failure\" event handlers. <strong>Be sure to quote"," * this property name in the transaction configuration as"," * \"arguments\" is a reserved word in JavaScript</strong> (e.g."," * `Y.io({ ..., \"arguments\": stuff })`).</dd>"," * </dl>"," *"," * @method send"," * @public"," * @param {String} uri Qualified path to transaction resource."," * @param {Object} config Configuration object for the transaction."," * @param {Number} id Transaction id, if already set."," * @return {Object}"," */"," send: function(uri, config, id) {"," var transaction, method, i, len, sync, data,"," io = this,"," u = uri,"," response = {};",""," config = config ? Y.Object(config) : {};"," transaction = io._create(config, id);"," method = config.method ? config.method.toUpperCase() : 'GET';"," sync = config.sync;"," data = config.data;",""," // Serialize an map object into a key-value string using"," // querystring-stringify-simple."," if ((Y.Lang.isObject(data) && !data.nodeType) && !transaction.upload) {"," data = Y.QueryString.stringify(data);"," }",""," if (config.form) {"," if (config.form.upload) {"," // This is a file upload transaction, calling"," // upload() in io-upload-iframe."," return io.upload(transaction, uri, config);"," } else {"," // Serialize HTML form data into a key-value string."," data = io._serialize(config.form, data);"," }"," }",""," if (data) {"," switch (method) {"," case 'GET':"," case 'HEAD':"," case 'DELETE':"," u = io._concat(u, data);"," data = '';"," break;"," case 'POST':"," case 'PUT':"," // If Content-Type is defined in the configuration object, or"," // or as a default header, it will be used instead of"," // 'application/x-www-form-urlencoded; charset=UTF-8'"," config.headers = Y.merge({"," 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'"," }, config.headers);"," break;"," }"," }",""," if (transaction.xdr) {"," // Route data to io-xdr module for flash and XDomainRequest."," return io.xdr(u, transaction, config);"," }"," else if (transaction.notify) {"," // Route data to custom transport"," return transaction.c.send(transaction, uri, config);"," }",""," if (!sync && !transaction.upload) {"," transaction.c.onreadystatechange = function() {"," io._rS(transaction, config);"," };"," }",""," try {"," // Determine if request is to be set as"," // synchronous or asynchronous."," transaction.c.open(method, u, !sync, config.username || null, config.password || null);"," io._setHeaders(transaction.c, config.headers || {});"," io.start(transaction, config);",""," // Will work only in browsers that implement the"," // Cross-Origin Resource Sharing draft."," if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) {"," transaction.c.withCredentials = true;"," }",""," // Using \"null\" with HTTP POST will result in a request"," // with no Content-Length header defined."," transaction.c.send(data);",""," if (sync) {"," // Create a response object for synchronous transactions,"," // mixing id and arguments properties with the xhr"," // properties whitelist."," for (i = 0, len = XHR_PROPS.length; i < len; ++i) {"," response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]];"," }",""," response.getAllResponseHeaders = function() {"," return transaction.c.getAllResponseHeaders();"," };",""," response.getResponseHeader = function(name) {"," return transaction.c.getResponseHeader(name);"," };",""," io.complete(transaction, config);"," io._result(transaction, config);",""," return response;"," }"," } catch(e) {"," if (transaction.xdr) {"," // This exception is usually thrown by browsers"," // that do not support XMLHttpRequest Level 2."," // Retry the request with the XDR transport set"," // to 'flash'. If the Flash transport is not"," // initialized or available, the transaction"," // will resolve to a transport error."," return io._retry(transaction, uri, config);"," } else {"," io.complete(transaction, config);"," io._result(transaction, config);"," }"," }",""," // If config.timeout is defined, and the request is standard XHR,"," // initialize timeout polling."," if (config.timeout) {"," io._startTimeout(transaction, config.timeout);"," }",""," return {"," id: transaction.id,"," abort: function() {"," return transaction.c ? io._abort(transaction, 'abort') : false;"," },"," isInProgress: function() {"," return transaction.c ? (transaction.c.readyState % 4) : false;"," },"," io: io"," };"," }","};","","/**","Method for initiating an ajax call. The first argument is the url end","point for the call. The second argument is an object to configure the","transaction and attach event subscriptions. The configuration object","supports the following properties:","","<dl>"," <dt>method</dt>"," <dd>HTTP method verb (e.g., GET or POST). If this property is not"," not defined, the default value will be GET.</dd>",""," <dt>data</dt>"," <dd>This is the name-value string that will be sent as the"," transaction data. If the request is HTTP GET, the data become"," part of querystring. If HTTP POST, the data are sent in the"," message body.</dd>",""," <dt>xdr</dt>"," <dd>Defines the transport to be used for cross-domain requests."," By setting this property, the transaction will use the specified"," transport instead of XMLHttpRequest. The properties of the"," transport object are:"," <dl>"," <dt>use</dt>"," <dd>The transport to be used: 'flash' or 'native'</dd>"," <dt>dataType</dt>"," <dd>Set the value to 'XML' if that is the expected response"," content type.</dd>"," </dl></dd>",""," <dt>form</dt>"," <dd>Form serialization configuration object. Its properties are:"," <dl>"," <dt>id</dt>"," <dd>Node object or id of HTML form</dd>"," <dt>useDisabled</dt>"," <dd>`true` to also serialize disabled form field values"," (defaults to `false`)</dd>"," </dl></dd>",""," <dt>on</dt>"," <dd>Assigns transaction event subscriptions. Available events are:"," <dl>"," <dt>start</dt>"," <dd>Fires when a request is sent to a resource.</dd>"," <dt>complete</dt>"," <dd>Fires when the transaction is complete.</dd>"," <dt>success</dt>"," <dd>Fires when the HTTP response status is within the 2xx"," range.</dd>"," <dt>failure</dt>"," <dd>Fires when the HTTP response status is outside the 2xx"," range, if an exception occurs, if the transation is aborted,"," or if the transaction exceeds a configured `timeout`.</dd>"," <dt>end</dt>"," <dd>Fires at the conclusion of the transaction"," lifecycle, after `success` or `failure`.</dd>"," </dl>",""," <p>Callback functions for `start` and `end` receive the id of the"," transaction as a first argument. For `complete`, `success`, and"," `failure`, callbacks receive the id and the response object"," (usually the XMLHttpRequest instance). If the `arguments`"," property was included in the configuration object passed to"," `Y.io()`, the configured data will be passed to all callbacks as"," the last argument.</p>"," </dd>",""," <dt>sync</dt>"," <dd>Pass `true` to make a same-domain transaction synchronous."," <strong>CAVEAT</strong>: This will negatively impact the user"," experience. Have a <em>very</em> good reason if you intend to use"," this.</dd>",""," <dt>context</dt>"," <dd>The \"`this'\" object for all configured event handlers. If a"," specific context is needed for individual callbacks, bind the"," callback to a context using `Y.bind()`.</dd>",""," <dt>headers</dt>"," <dd>Object map of transaction headers to send to the server. The"," object keys are the header names and the values are the header"," values.</dd>",""," <dt>timeout</dt>"," <dd>Millisecond threshold for the transaction before being"," automatically aborted.</dd>",""," <dt>arguments</dt>"," <dd>User-defined data passed to all registered event handlers."," This value is available as the second argument in the \"start\" and"," \"end\" event handlers. It is the third argument in the \"complete\","," \"success\", and \"failure\" event handlers. <strong>Be sure to quote"," this property name in the transaction configuration as"," \"arguments\" is a reserved word in JavaScript</strong> (e.g."," `Y.io({ ..., \"arguments\": stuff })`).</dd>","</dl>","","@method io","@static","@param {String} url qualified path to transaction resource.","@param {Object} config configuration object for the transaction.","@return {Object}","@for YUI","**/","Y.io = function(url, config) {"," // Calling IO through the static interface will use and reuse"," // an instance of IO."," var transaction = Y.io._map['io:0'] || new IO();"," return transaction.send.apply(transaction, [url, config]);","};","","/**","Method for setting and deleting IO HTTP headers to be sent with every","request.","","Hosted as a property on the `io` function (e.g. `Y.io.header`).","","@method header","@param {String} name HTTP header","@param {String} value HTTP header value","@static","**/","Y.io.header = function(name, value) {"," // Calling IO through the static interface will use and reuse"," // an instance of IO."," var transaction = Y.io._map['io:0'] || new IO();"," transaction.setHeader(name, value);","};","","Y.IO = IO;","// Map of all IO instances created.","Y.io._map = {};","var XHR = win && win.XMLHttpRequest,"," XDR = win && win.XDomainRequest,"," AX = win && win.ActiveXObject,",""," // Checks for the presence of the `withCredentials` in an XHR instance"," // object, which will be present if the environment supports CORS."," SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest());","","","Y.mix(Y.IO, {"," /**"," * The ID of the default IO transport, defaults to `xhr`"," * @property _default"," * @type {String}"," * @static"," */"," _default: 'xhr',"," /**"," *"," * @method defaultTransport"," * @static"," * @param {String} [id] The transport to set as the default, if empty a new transport is created."," * @return {Object} The transport object with a `send` method"," */"," defaultTransport: function(id) {"," if (id) {"," Y.IO._default = id;"," } else {"," var o = {"," c: Y.IO.transports[Y.IO._default](),"," notify: Y.IO._default === 'xhr' ? false : true"," };"," return o;"," }"," },"," /**"," * An object hash of custom transports available to IO"," * @property transports"," * @type {Object}"," * @static"," */"," transports: {"," xhr: function () {"," return XHR ? new XMLHttpRequest() :"," AX ? new ActiveXObject('Microsoft.XMLHTTP') : null;"," },"," xdr: function () {"," return XDR ? new XDomainRequest() : null;"," },"," iframe: function () { return {}; },"," flash: null,"," nodejs: null"," },"," /**"," * Create a custom transport of type and return it's object"," * @method customTransport"," * @param {String} id The id of the transport to create."," * @static"," */"," customTransport: function(id) {"," var o = { c: Y.IO.transports[id]() };",""," o[(id === 'xdr' || id === 'flash') ? 'xdr' : 'notify'] = true;"," return o;"," }","});","","Y.mix(Y.IO.prototype, {"," /**"," * Fired from the notify method of the transport which in turn fires"," * the event on the IO object."," * @method notify"," * @param {String} event The name of the event"," * @param {Object} transaction The transaction object"," * @param {Object} config The configuration object for this transaction"," */"," notify: function(event, transaction, config) {"," var io = this;",""," switch (event) {"," case 'timeout':"," case 'abort':"," case 'transport error':"," transaction.c = { status: 0, statusText: event };"," event = 'failure';"," default:"," io[event].apply(io, [transaction, config]);"," }"," }","});","","","","","}, '3.7.3', {\"requires\": [\"event-custom-base\", \"querystring-stringify-simple\"]});"];+_yuitest_coverage["build/io-base/io-base.js"].lines = {"1":0,"11":0,"32":0,"33":0,"35":0,"36":0,"37":0,"40":0,"80":0,"82":0,"84":0,"85":0,"89":0,"92":0,"108":0,"117":0,"120":0,"125":0,"128":0,"129":0,"132":0,"133":0,"136":0,"137":0,"138":0,"139":0,"141":0,"142":0,"144":0,"145":0,"147":0,"151":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"161":0,"162":0,"165":0,"169":0,"182":0,"189":0,"191":0,"192":0,"196":0,"206":0,"207":0,"208":0,"209":0,"212":0,"213":0,"215":0,"217":0,"218":0,"223":0,"225":0,"227":0,"228":0,"229":0,"230":0,"247":0,"266":0,"282":0,"283":0,"300":0,"301":0,"318":0,"319":0,"338":0,"339":0,"353":0,"354":0,"368":0,"369":0,"383":0,"384":0,"385":0,"398":0,"399":0,"411":0,"412":0,"414":0,"428":0,"429":0,"430":0,"431":0,"446":0,"448":0,"449":0,"461":0,"462":0,"477":0,"480":0,"481":0,"483":0,"487":0,"488":0,"490":0,"503":0,"505":0,"506":0,"507":0,"511":0,"512":0,"513":0,"527":0,"528":0,"529":0,"637":0,"642":0,"643":0,"644":0,"645":0,"646":0,"650":0,"651":0,"654":0,"655":0,"658":0,"661":0,"665":0,"666":0,"670":0,"671":0,"672":0,"678":0,"681":0,"685":0,"687":0,"689":0,"691":0,"694":0,"695":0,"696":0,"700":0,"703":0,"704":0,"705":0,"709":0,"710":0,"715":0,"717":0,"721":0,"722":0,"725":0,"726":0,"729":0,"730":0,"733":0,"734":0,"736":0,"739":0,"746":0,"748":0,"749":0,"755":0,"756":0,"759":0,"762":0,"765":0,"877":0,"880":0,"881":0,"895":0,"898":0,"899":0,"902":0,"904":0,"905":0,"914":0,"930":0,"931":0,"933":0,"937":0,"948":0,"952":0,"954":0,"965":0,"967":0,"968":0,"972":0,"982":0,"984":0,"988":0,"989":0,"991":0};+_yuitest_coverage["build/io-base/io-base.js"].functions = {"IO:32":0,"_init:79":0,"notify:133":0,"onprogress:138":0,"onload:141":0,"onerror:144":0,"_create:107":0,"_destroy:154":0,"_evt:181":0,"start:242":0,"complete:259":0,"end:277":0,"success:294":0,"failure:312":0,"progress:332":0,"load:352":0,"error:367":0,"_retry:382":0,"_concat:397":0,"setHeader:410":0,"(anonymous 2):429":0,"_setHeaders:427":0,"(anonymous 3):448":0,"_startTimeout:445":0,"_clearTimeout:460":0,"_result:476":0,"(anonymous 4):511":0,"_rS:502":0,"_abort:526":0,"onreadystatechange:695":0,"getAllResponseHeaders:725":0,"getResponseHeader:729":0,"abort:761":0,"isInProgress:764":0,"send:636":0,"io:877":0,"header:895":0,"defaultTransport:929":0,"xhr:947":0,"xdr:951":0,"iframe:954":0,"customTransport:964":0,"notify:981":0,"(anonymous 1):1":0};+_yuitest_coverage["build/io-base/io-base.js"].coveredLines = 188; _yuitest_coverage["build/io-base/io-base.js"].coveredFunctions = 44; _yuitest_coverline("build/io-base/io-base.js", 1); YUI.add('io-base', function (Y, NAME) {@@ -174,10 +174,10 @@ _yuitest_coverline("build/io-base/io-base.js", 117); if (alt === 'native') {- // Non-IE can use XHR level 2 and not rely on an+ // Non-IE and IE >= 10 can use XHR level 2 and not rely on an // external transport. _yuitest_coverline("build/io-base/io-base.js", 120);-alt = Y.UA.ie ? 'xdr' : null;+alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null; // Prevent "pre-flight" OPTIONS request by removing the // `X-Requested-With` HTTP header from CORS requests. This header@@ -918,54 +918,51 @@ // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft. _yuitest_coverline("build/io-base/io-base.js", 709);-if (config.xdr && config.xdr.credentials) {+if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) { _yuitest_coverline("build/io-base/io-base.js", 710);-if (!Y.UA.ie) {- _yuitest_coverline("build/io-base/io-base.js", 711); transaction.c.withCredentials = true;- } } // Using "null" with HTTP POST will result in a request // with no Content-Length header defined.- _yuitest_coverline("build/io-base/io-base.js", 717);+ _yuitest_coverline("build/io-base/io-base.js", 715); transaction.c.send(data); - _yuitest_coverline("build/io-base/io-base.js", 719);+ _yuitest_coverline("build/io-base/io-base.js", 717); if (sync) { // Create a response object for synchronous transactions, // mixing id and arguments properties with the xhr // properties whitelist.- _yuitest_coverline("build/io-base/io-base.js", 723);+ _yuitest_coverline("build/io-base/io-base.js", 721); for (i = 0, len = XHR_PROPS.length; i < len; ++i) {- _yuitest_coverline("build/io-base/io-base.js", 724);+ _yuitest_coverline("build/io-base/io-base.js", 722); response[XHR_PROPS[i]] = transaction.c[XHR_PROPS[i]]; } - _yuitest_coverline("build/io-base/io-base.js", 727);+ _yuitest_coverline("build/io-base/io-base.js", 725); response.getAllResponseHeaders = function() {- _yuitest_coverfunc("build/io-base/io-base.js", "getAllResponseHeaders", 727);-_yuitest_coverline("build/io-base/io-base.js", 728);+ _yuitest_coverfunc("build/io-base/io-base.js", "getAllResponseHeaders", 725);+_yuitest_coverline("build/io-base/io-base.js", 726); return transaction.c.getAllResponseHeaders(); }; - _yuitest_coverline("build/io-base/io-base.js", 731);+ _yuitest_coverline("build/io-base/io-base.js", 729); response.getResponseHeader = function(name) {- _yuitest_coverfunc("build/io-base/io-base.js", "getResponseHeader", 731);-_yuitest_coverline("build/io-base/io-base.js", 732);+ _yuitest_coverfunc("build/io-base/io-base.js", "getResponseHeader", 729);+_yuitest_coverline("build/io-base/io-base.js", 730); return transaction.c.getResponseHeader(name); }; - _yuitest_coverline("build/io-base/io-base.js", 735);+ _yuitest_coverline("build/io-base/io-base.js", 733); io.complete(transaction, config);- _yuitest_coverline("build/io-base/io-base.js", 736);+ _yuitest_coverline("build/io-base/io-base.js", 734); io._result(transaction, config); - _yuitest_coverline("build/io-base/io-base.js", 738);+ _yuitest_coverline("build/io-base/io-base.js", 736); return response; } } catch(e) {- _yuitest_coverline("build/io-base/io-base.js", 741);+ _yuitest_coverline("build/io-base/io-base.js", 739); if (transaction.xdr) { // This exception is usually thrown by browsers // that do not support XMLHttpRequest Level 2.@@ -973,35 +970,35 @@ // to 'flash'. If the Flash transport is not // initialized or available, the transaction // will resolve to a transport error.- _yuitest_coverline("build/io-base/io-base.js", 748);+ _yuitest_coverline("build/io-base/io-base.js", 746); return io._retry(transaction, uri, config); } else {- _yuitest_coverline("build/io-base/io-base.js", 750);+ _yuitest_coverline("build/io-base/io-base.js", 748); io.complete(transaction, config);- _yuitest_coverline("build/io-base/io-base.js", 751);+ _yuitest_coverline("build/io-base/io-base.js", 749); io._result(transaction, config); } } // If config.timeout is defined, and the request is standard XHR, // initialize timeout polling.- _yuitest_coverline("build/io-base/io-base.js", 757);+ _yuitest_coverline("build/io-base/io-base.js", 755); if (config.timeout) {- _yuitest_coverline("build/io-base/io-base.js", 758);+ _yuitest_coverline("build/io-base/io-base.js", 756); io._startTimeout(transaction, config.timeout); } - _yuitest_coverline("build/io-base/io-base.js", 761);+ _yuitest_coverline("build/io-base/io-base.js", 759); return { id: transaction.id, abort: function() {- _yuitest_coverfunc("build/io-base/io-base.js", "abort", 763);-_yuitest_coverline("build/io-base/io-base.js", 764);+ _yuitest_coverfunc("build/io-base/io-base.js", "abort", 761);+_yuitest_coverline("build/io-base/io-base.js", 762); return transaction.c ? io._abort(transaction, 'abort') : false; }, isInProgress: function() {- _yuitest_coverfunc("build/io-base/io-base.js", "isInProgress", 766);-_yuitest_coverline("build/io-base/io-base.js", 767);+ _yuitest_coverfunc("build/io-base/io-base.js", "isInProgress", 764);+_yuitest_coverline("build/io-base/io-base.js", 765); return transaction.c ? (transaction.c.readyState % 4) : false; }, io: io@@ -1114,14 +1111,14 @@ @return {Object} @for YUI **/-_yuitest_coverline("build/io-base/io-base.js", 879);+_yuitest_coverline("build/io-base/io-base.js", 877); Y.io = function(url, config) { // Calling IO through the static interface will use and reuse // an instance of IO.- _yuitest_coverfunc("build/io-base/io-base.js", "io", 879);-_yuitest_coverline("build/io-base/io-base.js", 882);+ _yuitest_coverfunc("build/io-base/io-base.js", "io", 877);+_yuitest_coverline("build/io-base/io-base.js", 880); var transaction = Y.io._map['io:0'] || new IO();- _yuitest_coverline("build/io-base/io-base.js", 883);+ _yuitest_coverline("build/io-base/io-base.js", 881); return transaction.send.apply(transaction, [url, config]); }; @@ -1136,29 +1133,33 @@ @param {String} value HTTP header value @static **/-_yuitest_coverline("build/io-base/io-base.js", 897);+_yuitest_coverline("build/io-base/io-base.js", 895); Y.io.header = function(name, value) { // Calling IO through the static interface will use and reuse // an instance of IO.- _yuitest_coverfunc("build/io-base/io-base.js", "header", 897);-_yuitest_coverline("build/io-base/io-base.js", 900);+ _yuitest_coverfunc("build/io-base/io-base.js", "header", 895);+_yuitest_coverline("build/io-base/io-base.js", 898); var transaction = Y.io._map['io:0'] || new IO();- _yuitest_coverline("build/io-base/io-base.js", 901);+ _yuitest_coverline("build/io-base/io-base.js", 899); transaction.setHeader(name, value); }; -_yuitest_coverline("build/io-base/io-base.js", 904);+_yuitest_coverline("build/io-base/io-base.js", 902); Y.IO = IO; // Map of all IO instances created.-_yuitest_coverline("build/io-base/io-base.js", 906);+_yuitest_coverline("build/io-base/io-base.js", 904); Y.io._map = {};-_yuitest_coverline("build/io-base/io-base.js", 907);+_yuitest_coverline("build/io-base/io-base.js", 905); var XHR = win && win.XMLHttpRequest, XDR = win && win.XDomainRequest,- AX = win && win.ActiveXObject;+ AX = win && win.ActiveXObject, + // Checks for the presence of the `withCredentials` in an XHR instance+ // object, which will be present if the environment supports CORS.+ SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest()); -_yuitest_coverline("build/io-base/io-base.js", 912);++_yuitest_coverline("build/io-base/io-base.js", 914); Y.mix(Y.IO, { /** * The ID of the default IO transport, defaults to `xhr`@@ -1175,18 +1176,18 @@ * @return {Object} The transport object with a `send` method */ defaultTransport: function(id) {- _yuitest_coverfunc("build/io-base/io-base.js", "defaultTransport", 927);-_yuitest_coverline("build/io-base/io-base.js", 928);+ _yuitest_coverfunc("build/io-base/io-base.js", "defaultTransport", 929);+_yuitest_coverline("build/io-base/io-base.js", 930); if (id) {- _yuitest_coverline("build/io-base/io-base.js", 929);+ _yuitest_coverline("build/io-base/io-base.js", 931); Y.IO._default = id; } else {- _yuitest_coverline("build/io-base/io-base.js", 931);+ _yuitest_coverline("build/io-base/io-base.js", 933); var o = { c: Y.IO.transports[Y.IO._default](), notify: Y.IO._default === 'xhr' ? false : true };- _yuitest_coverline("build/io-base/io-base.js", 935);+ _yuitest_coverline("build/io-base/io-base.js", 937); return o; } },@@ -1198,18 +1199,18 @@ */ transports: { xhr: function () {- _yuitest_coverfunc("build/io-base/io-base.js", "xhr", 945);-_yuitest_coverline("build/io-base/io-base.js", 946);+ _yuitest_coverfunc("build/io-base/io-base.js", "xhr", 947);+_yuitest_coverline("build/io-base/io-base.js", 948); return XHR ? new XMLHttpRequest() : AX ? new ActiveXObject('Microsoft.XMLHTTP') : null; }, xdr: function () {- _yuitest_coverfunc("build/io-base/io-base.js", "xdr", 949);-_yuitest_coverline("build/io-base/io-base.js", 950);+ _yuitest_coverfunc("build/io-base/io-base.js", "xdr", 951);+_yuitest_coverline("build/io-base/io-base.js", 952); return XDR ? new XDomainRequest() : null; },- iframe: function () { _yuitest_coverfunc("build/io-base/io-base.js", "iframe", 952);-_yuitest_coverline("build/io-base/io-base.js", 952);+ iframe: function () { _yuitest_coverfunc("build/io-base/io-base.js", "iframe", 954);+_yuitest_coverline("build/io-base/io-base.js", 954); return {}; }, flash: null, nodejs: null@@ -1221,18 +1222,18 @@ * @static */ customTransport: function(id) {- _yuitest_coverfunc("build/io-base/io-base.js", "customTransport", 962);-_yuitest_coverline("build/io-base/io-base.js", 963);+ _yuitest_coverfunc("build/io-base/io-base.js", "customTransport", 964);+_yuitest_coverline("build/io-base/io-base.js", 965); var o = { c: Y.IO.transports[id]() }; - _yuitest_coverline("build/io-base/io-base.js", 965);+ _yuitest_coverline("build/io-base/io-base.js", 967); o[(id === 'xdr' || id === 'flash') ? 'xdr' : 'notify'] = true;- _yuitest_coverline("build/io-base/io-base.js", 966);+ _yuitest_coverline("build/io-base/io-base.js", 968); return o; } }); -_yuitest_coverline("build/io-base/io-base.js", 970);+_yuitest_coverline("build/io-base/io-base.js", 972); Y.mix(Y.IO.prototype, { /** * Fired from the notify method of the transport which in turn fires@@ -1243,21 +1244,21 @@ * @param {Object} config The configuration object for this transaction */ notify: function(event, transaction, config) {- _yuitest_coverfunc("build/io-base/io-base.js", "notify", 979);-_yuitest_coverline("build/io-base/io-base.js", 980);+ _yuitest_coverfunc("build/io-base/io-base.js", "notify", 981);+_yuitest_coverline("build/io-base/io-base.js", 982); var io = this; - _yuitest_coverline("build/io-base/io-base.js", 982);+ _yuitest_coverline("build/io-base/io-base.js", 984); switch (event) { case 'timeout': case 'abort': case 'transport error':- _yuitest_coverline("build/io-base/io-base.js", 986);+ _yuitest_coverline("build/io-base/io-base.js", 988); transaction.c = { status: 0, statusText: event };- _yuitest_coverline("build/io-base/io-base.js", 987);+ _yuitest_coverline("build/io-base/io-base.js", 989); event = 'failure'; default:- _yuitest_coverline("build/io-base/io-base.js", 989);+ _yuitest_coverline("build/io-base/io-base.js", 991); io[event].apply(io, [transaction, config]); } }@@ -1266,4 +1267,4 @@ -}, '3.7.2', {"requires": ["event-custom-base", "querystring-stringify-simple"]});+}, '3.7.3', {"requires": ["event-custom-base", "querystring-stringify-simple"]});
bundle/io-base/io-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -121,9 +121,9 @@ use; if (alt === 'native') {- // Non-IE can use XHR level 2 and not rely on an+ // Non-IE and IE >= 10 can use XHR level 2 and not rely on an // external transport.- alt = Y.UA.ie ? 'xdr' : null;+ alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null; // Prevent "pre-flight" OPTIONS request by removing the // `X-Requested-With` HTTP header from CORS requests. This header@@ -713,10 +713,8 @@ // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft.- if (config.xdr && config.xdr.credentials) {- if (!Y.UA.ie) {- transaction.c.withCredentials = true;- }+ if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) {+ transaction.c.withCredentials = true; } // Using "null" with HTTP POST will result in a request@@ -914,9 +912,13 @@ Y.io._map = {}; var XHR = win && win.XMLHttpRequest, XDR = win && win.XDomainRequest,- AX = win && win.ActiveXObject;+ AX = win && win.ActiveXObject, + // Checks for the presence of the `withCredentials` in an XHR instance+ // object, which will be present if the environment supports CORS.+ SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest()); + Y.mix(Y.IO, { /** * The ID of the default IO transport, defaults to `xhr`@@ -1004,4 +1006,4 @@ -}, '3.7.2', {"requires": ["event-custom-base", "querystring-stringify-simple"]});+}, '3.7.3', {"requires": ["event-custom-base", "querystring-stringify-simple"]});
bundle/io-base/io-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("io-base",function(e,t){function o(t){var n=this;n._uid="io:"+s++,n._init(t),e.io._map[n._uid]=n}var n=["start","complete","end","success","failure","progress"],r=["status","statusText","responseText","responseXML"],i=e.config.win,s=0;o.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(t){var r=this,i,s;r.cfg=t||{},e.augment(r,e.EventTarget);for(i=0,s=n.length;i<s;++i)r.publish("io:"+n[i],e.merge({broadcast:1},t)),r.publish("io-trn:"+n[i],t)},_create:function(t,n){var r=this,s={id:e.Lang.isNumber(n)?n:r._id++,uid:r._uid},o=t.xdr?t.xdr.use:null,u=t.form&&t.form.upload?"iframe":null,a;return o==="native"&&(o=e.UA.ie?"xdr":null,r.setHeader("X-Requested-With")),a=o||u,s=a?e.merge(e.IO.customTransport(a),s):e.merge(e.IO.defaultTransport(),s),s.notify&&(t.notify=function(e,t,n){r.notify(e,t,n)}),a||i&&i.FormData&&t.data instanceof i.FormData&&(s.c.upload.onprogress=function(e){r.progress(s,e,t)},s.c.onload=function(e){r.load(s,e,t)},s.c.onerror=function(e){r.error(s,e,t)},s.upload=!0),s},_destroy:function(t){i&&!t.notify&&!t.xdr&&(u&&!t.upload?t.c.onreadystatechange=null:t.upload?(t.c.upload.onprogress=null,t.c.onload=null,t.c.onerror=null):e.UA.ie&&!t.e&&t.c.abort()),t=t.c=null},_evt:function(t,r,i){var s=this,o,u=i.arguments,a=s.cfg.emitFacade,f="io:"+t,l="io-trn:"+t;this.detach(l),r.e&&(r.c={status:0,statusText:r.e}),o=[a?{id:r.id,data:r.c,cfg:i,arguments:u}:r.id],a||(t===n[0]||t===n[2]?u&&o.push(u):(r.evt?o.push(r.evt):o.push(r.c),u&&o.push(u))),o.unshift(f),s.fire.apply(s,o),i.on&&(o[0]=l,s.once(l,i.on[t],i.context||e),s.fire.apply(s,o))},start:function(e,t){this._evt(n[0],e,t)},complete:function(e,t){this._evt(n[1],e,t)},end:function(e,t){this._evt(n[2],e,t),this._destroy(e)},success:function(e,t){this._evt(n[3],e,t),this.end(e,t)},failure:function(e,t){this._evt(n[4],e,t),this.end(e,t)},progress:function(e,t,r){e.evt=t,this._evt(n[5],e,r)},load:function(e,t,r){e.evt=t.target,this._evt(n[1],e,r)},error:function(e,t,r){e.evt=t,this._evt(n[4],e,r)},_retry:function(e,t,n){return this._destroy(e),n.xdr.use="flash",this.send(t,n,e.id)},_concat:function(e,t){return e+=(e.indexOf("?")===-1?"?":"&")+t,e},setHeader:function(e,t){t?this._headers[e]=t:delete this._headers[e]},_setHeaders:function(t,n){n=e.merge(this._headers,n),e.Object.each(n,function(e,r){e!=="disable"&&t.setRequestHeader(r,n[r])})},_startTimeout:function(e,t){var n=this;n._timeout[e.id]=setTimeout(function(){n._abort(e,"timeout")},t)},_clearTimeout:function(e){clearTimeout(this._timeout[e]),delete this._timeout[e]},_result:function(e,t){var n;try{n=e.c.status}catch(r){n=0}n>=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,l,c=this,h=t,p={};n=n?e.Object(n):{},s=c._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,l=n.data,e.Lang.isObject(l)&&!l.nodeType&&!s.upload&&(l=e.QueryString.stringify(l));if(n.form){if(n.form.upload)return c.upload(s,t,n);l=c._serialize(n.form,l)}if(l)switch(o){case"GET":case"HEAD":case"DELETE":h=c._concat(h,l),l="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return c.xdr(h,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){c._rS(s,n)});try{s.c.open(o,h,!f,n.username||null,n.password||null),c._setHeaders(s.c,n.headers||{}),c.start(s,n),n.xdr&&n.xdr.credentials&&(e.UA.ie||(s.c.withCredentials=!0)),s.c.send(l);if(f){for(u=0,a=r.length;u<a;++u)p[r[u]]=s.c[r[u]];return p.getAllResponseHeaders=function(){return s.c.getAllResponseHeaders()},p.getResponseHeader=function(e){return s.c.getResponseHeader(e)},c.complete(s,n),c._result(s,n),p}}catch(d){if(s.xdr)return c._retry(s,t,n);c.complete(s,n),c._result(s,n)}return n.timeout&&c._startTimeout(s,n.timeout),{id:s.id,abort:function(){return s.c?c._abort(s,"abort"):!1},isInProgress:function(){return s.c?s.c.readyState%4:!1},io:c}}},e.io=function(t,n){var r=e.io._map["io:0"]||new o;return r.send.apply(r,[t,n])},e.io.header=function(t,n){var r=e.io._map["io:0"]||new o;r.setHeader(t,n)},e.IO=o,e.io._map={};var u=i&&i.XMLHttpRequest,a=i&&i.XDomainRequest,f=i&&i.ActiveXObject;e.mix(e.IO,{_default:"xhr",defaultTransport:function(t){if(!t){var n={c:e.IO.transports[e.IO._default](),notify:e.IO._default==="xhr"?!1:!0};return n}e.IO._default=t},transports:{xhr:function(){return u?new XMLHttpRequest:f?new ActiveXObject("Microsoft.XMLHTTP"):null},xdr:function(){return a?new XDomainRequest:null},iframe:function(){return{}},flash:null,nodejs:null},customTransport:function(t){var n={c:e.IO.transports[t]()};return n[t==="xdr"||t==="flash"?"xdr":"notify"]=!0,n}}),e.mix(e.IO.prototype,{notify:function(e,t,n){var r=this;switch(e){case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e},e="failure";default:r[e].apply(r,[t,n])}}})},"3.7.2",{requires:["event-custom-base","querystring-stringify-simple"]});+YUI.add("io-base",function(e,t){function o(t){var n=this;n._uid="io:"+s++,n._init(t),e.io._map[n._uid]=n}var n=["start","complete","end","success","failure","progress"],r=["status","statusText","responseText","responseXML"],i=e.config.win,s=0;o.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(t){var r=this,i,s;r.cfg=t||{},e.augment(r,e.EventTarget);for(i=0,s=n.length;i<s;++i)r.publish("io:"+n[i],e.merge({broadcast:1},t)),r.publish("io-trn:"+n[i],t)},_create:function(t,n){var r=this,s={id:e.Lang.isNumber(n)?n:r._id++,uid:r._uid},o=t.xdr?t.xdr.use:null,u=t.form&&t.form.upload?"iframe":null,a;return o==="native"&&(o=e.UA.ie&&!l?"xdr":null,r.setHeader("X-Requested-With")),a=o||u,s=a?e.merge(e.IO.customTransport(a),s):e.merge(e.IO.defaultTransport(),s),s.notify&&(t.notify=function(e,t,n){r.notify(e,t,n)}),a||i&&i.FormData&&t.data instanceof i.FormData&&(s.c.upload.onprogress=function(e){r.progress(s,e,t)},s.c.onload=function(e){r.load(s,e,t)},s.c.onerror=function(e){r.error(s,e,t)},s.upload=!0),s},_destroy:function(t){i&&!t.notify&&!t.xdr&&(u&&!t.upload?t.c.onreadystatechange=null:t.upload?(t.c.upload.onprogress=null,t.c.onload=null,t.c.onerror=null):e.UA.ie&&!t.e&&t.c.abort()),t=t.c=null},_evt:function(t,r,i){var s=this,o,u=i.arguments,a=s.cfg.emitFacade,f="io:"+t,l="io-trn:"+t;this.detach(l),r.e&&(r.c={status:0,statusText:r.e}),o=[a?{id:r.id,data:r.c,cfg:i,arguments:u}:r.id],a||(t===n[0]||t===n[2]?u&&o.push(u):(r.evt?o.push(r.evt):o.push(r.c),u&&o.push(u))),o.unshift(f),s.fire.apply(s,o),i.on&&(o[0]=l,s.once(l,i.on[t],i.context||e),s.fire.apply(s,o))},start:function(e,t){this._evt(n[0],e,t)},complete:function(e,t){this._evt(n[1],e,t)},end:function(e,t){this._evt(n[2],e,t),this._destroy(e)},success:function(e,t){this._evt(n[3],e,t),this.end(e,t)},failure:function(e,t){this._evt(n[4],e,t),this.end(e,t)},progress:function(e,t,r){e.evt=t,this._evt(n[5],e,r)},load:function(e,t,r){e.evt=t.target,this._evt(n[1],e,r)},error:function(e,t,r){e.evt=t,this._evt(n[4],e,r)},_retry:function(e,t,n){return this._destroy(e),n.xdr.use="flash",this.send(t,n,e.id)},_concat:function(e,t){return e+=(e.indexOf("?")===-1?"?":"&")+t,e},setHeader:function(e,t){t?this._headers[e]=t:delete this._headers[e]},_setHeaders:function(t,n){n=e.merge(this._headers,n),e.Object.each(n,function(e,r){e!=="disable"&&t.setRequestHeader(r,n[r])})},_startTimeout:function(e,t){var n=this;n._timeout[e.id]=setTimeout(function(){n._abort(e,"timeout")},t)},_clearTimeout:function(e){clearTimeout(this._timeout[e]),delete this._timeout[e]},_result:function(e,t){var n;try{n=e.c.status}catch(r){n=0}n>=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,c,h=this,p=t,d={};n=n?e.Object(n):{},s=h._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,c=n.data,e.Lang.isObject(c)&&!c.nodeType&&!s.upload&&(c=e.QueryString.stringify(c));if(n.form){if(n.form.upload)return h.upload(s,t,n);c=h._serialize(n.form,c)}if(c)switch(o){case"GET":case"HEAD":case"DELETE":p=h._concat(p,c),c="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return h.xdr(p,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){h._rS(s,n)});try{s.c.open(o,p,!f,n.username||null,n.password||null),h._setHeaders(s.c,n.headers||{}),h.start(s,n),n.xdr&&n.xdr.credentials&&l&&(s.c.withCredentials=!0),s.c.send(c);if(f){for(u=0,a=r.length;u<a;++u)d[r[u]]=s.c[r[u]];return d.getAllResponseHeaders=function(){return s.c.getAllResponseHeaders()},d.getResponseHeader=function(e){return s.c.getResponseHeader(e)},h.complete(s,n),h._result(s,n),d}}catch(v){if(s.xdr)return h._retry(s,t,n);h.complete(s,n),h._result(s,n)}return n.timeout&&h._startTimeout(s,n.timeout),{id:s.id,abort:function(){return s.c?h._abort(s,"abort"):!1},isInProgress:function(){return s.c?s.c.readyState%4:!1},io:h}}},e.io=function(t,n){var r=e.io._map["io:0"]||new o;return r.send.apply(r,[t,n])},e.io.header=function(t,n){var r=e.io._map["io:0"]||new o;r.setHeader(t,n)},e.IO=o,e.io._map={};var u=i&&i.XMLHttpRequest,a=i&&i.XDomainRequest,f=i&&i.ActiveXObject,l=u&&"withCredentials"in new XMLHttpRequest;e.mix(e.IO,{_default:"xhr",defaultTransport:function(t){if(!t){var n={c:e.IO.transports[e.IO._default](),notify:e.IO._default==="xhr"?!1:!0};return n}e.IO._default=t},transports:{xhr:function(){return u?new XMLHttpRequest:f?new ActiveXObject("Microsoft.XMLHTTP"):null},xdr:function(){return a?new XDomainRequest:null},iframe:function(){return{}},flash:null,nodejs:null},customTransport:function(t){var n={c:e.IO.transports[t]()};return n[t==="xdr"||t==="flash"?"xdr":"notify"]=!0,n}}),e.mix(e.IO.prototype,{notify:function(e,t,n){var r=this;switch(e){case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e},e="failure";default:r[e].apply(r,[t,n])}}})},"3.7.3",{requires:["event-custom-base","querystring-stringify-simple"]});
bundle/io-base/io-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -121,9 +121,9 @@ use; if (alt === 'native') {- // Non-IE can use XHR level 2 and not rely on an+ // Non-IE and IE >= 10 can use XHR level 2 and not rely on an // external transport.- alt = Y.UA.ie ? 'xdr' : null;+ alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null; // Prevent "pre-flight" OPTIONS request by removing the // `X-Requested-With` HTTP header from CORS requests. This header@@ -712,10 +712,8 @@ // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft.- if (config.xdr && config.xdr.credentials) {- if (!Y.UA.ie) {- transaction.c.withCredentials = true;- }+ if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) {+ transaction.c.withCredentials = true; } // Using "null" with HTTP POST will result in a request@@ -912,9 +910,13 @@ Y.io._map = {}; var XHR = win && win.XMLHttpRequest, XDR = win && win.XDomainRequest,- AX = win && win.ActiveXObject;+ AX = win && win.ActiveXObject, + // Checks for the presence of the `withCredentials` in an XHR instance+ // object, which will be present if the environment supports CORS.+ SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest()); + Y.mix(Y.IO, { /** * The ID of the default IO transport, defaults to `xhr`@@ -1000,4 +1002,4 @@ -}, '3.7.2', {"requires": ["event-custom-base", "querystring-stringify-simple"]});+}, '3.7.3', {"requires": ["event-custom-base", "querystring-stringify-simple"]});
bundle/io-form/io-form-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/io-form/io-form.js", code: [] };-_yuitest_coverage["build/io-form/io-form.js"].code=["YUI.add('io-form', function (Y, NAME) {","","/**","* Extends IO to enable HTML form data serialization, when specified","* in the transaction's configuration object.","* @module io","* @submodule io-form","* @for IO","*/","","var eUC = encodeURIComponent;","","Y.mix(Y.IO.prototype, {"," /**"," * Method to enumerate through an HTML form's elements collection"," * and return a string comprised of key-value pairs."," *"," * @method _serialize"," * @private"," * @static"," * @param {Object} c - YUI form node or HTML form id."," * @param {String} s - Key-value data defined in the configuration object."," * @return {String}"," */"," _serialize: function(c, s) {"," var data = [],"," df = c.useDisabled || false,"," item = 0,"," id = (typeof c.id === 'string') ? c.id : c.id.getAttribute('id'),"," e, f, n, v, d, i, il, j, jl, o;",""," if (!id) {"," id = Y.guid('io:');"," c.id.setAttribute('id', id);"," }",""," f = Y.config.doc.getElementById(id);",""," // Iterate over the form elements collection to construct the"," // label-value pairs."," for (i = 0, il = f.elements.length; i < il; ++i) {"," e = f.elements[i];"," d = e.disabled;"," n = e.name;",""," if (df ? n : n && !d) {"," n = eUC(n) + '=';"," v = eUC(e.value);",""," switch (e.type) {"," // Safari, Opera, FF all default options.value from .text if"," // value attribute not specified in markup"," case 'select-one':"," if (e.selectedIndex > -1) {"," o = e.options[e.selectedIndex];"," data[item++] = n + eUC(o.attributes.value && o.attributes.value.specified ? o.value : o.text);"," }"," break;"," case 'select-multiple':"," if (e.selectedIndex > -1) {"," for (j = e.selectedIndex, jl = e.options.length; j < jl; ++j) {"," o = e.options[j];"," if (o.selected) {"," data[item++] = n + eUC(o.attributes.value && o.attributes.value.specified ? o.value : o.text);"," }"," }"," }"," break;"," case 'radio':"," case 'checkbox':"," if (e.checked) {"," data[item++] = n + v;"," }"," break;"," case 'file':"," // stub case as XMLHttpRequest will only send the file path as a string."," case undefined:"," // stub case for fieldset element which returns undefined."," case 'reset':"," // stub case for input type reset button."," case 'button':"," // stub case for input type button elements."," break;"," case 'submit':"," default:"," data[item++] = n + v;"," }"," }"," }"," return s ? data.join('&') + \"&\" + s : data.join('&');"," }","}, true);","","","}, '3.7.2', {\"requires\": [\"io-base\", \"node-base\"]});"];+_yuitest_coverage["build/io-form/io-form.js"].code=["YUI.add('io-form', function (Y, NAME) {","","/**","* Extends IO to enable HTML form data serialization, when specified","* in the transaction's configuration object.","* @module io","* @submodule io-form","* @for IO","*/","","var eUC = encodeURIComponent;","","Y.mix(Y.IO.prototype, {"," /**"," * Method to enumerate through an HTML form's elements collection"," * and return a string comprised of key-value pairs."," *"," * @method _serialize"," * @private"," * @static"," * @param {Object} c - YUI form node or HTML form id."," * @param {String} s - Key-value data defined in the configuration object."," * @return {String}"," */"," _serialize: function(c, s) {"," var data = [],"," df = c.useDisabled || false,"," item = 0,"," id = (typeof c.id === 'string') ? c.id : c.id.getAttribute('id'),"," e, f, n, v, d, i, il, j, jl, o;",""," if (!id) {"," id = Y.guid('io:');"," c.id.setAttribute('id', id);"," }",""," f = Y.config.doc.getElementById(id);",""," // Iterate over the form elements collection to construct the"," // label-value pairs."," for (i = 0, il = f.elements.length; i < il; ++i) {"," e = f.elements[i];"," d = e.disabled;"," n = e.name;",""," if (df ? n : n && !d) {"," n = eUC(n) + '=';"," v = eUC(e.value);",""," switch (e.type) {"," // Safari, Opera, FF all default options.value from .text if"," // value attribute not specified in markup"," case 'select-one':"," if (e.selectedIndex > -1) {"," o = e.options[e.selectedIndex];"," data[item++] = n + eUC(o.attributes.value && o.attributes.value.specified ? o.value : o.text);"," }"," break;"," case 'select-multiple':"," if (e.selectedIndex > -1) {"," for (j = e.selectedIndex, jl = e.options.length; j < jl; ++j) {"," o = e.options[j];"," if (o.selected) {"," data[item++] = n + eUC(o.attributes.value && o.attributes.value.specified ? o.value : o.text);"," }"," }"," }"," break;"," case 'radio':"," case 'checkbox':"," if (e.checked) {"," data[item++] = n + v;"," }"," break;"," case 'file':"," // stub case as XMLHttpRequest will only send the file path as a string."," case undefined:"," // stub case for fieldset element which returns undefined."," case 'reset':"," // stub case for input type reset button."," case 'button':"," // stub case for input type button elements."," break;"," case 'submit':"," default:"," data[item++] = n + v;"," }"," }"," }"," return s ? data.join('&') + \"&\" + s : data.join('&');"," }","}, true);","","","}, '3.7.3', {\"requires\": [\"io-base\", \"node-base\"]});"]; _yuitest_coverage["build/io-form/io-form.js"].lines = {"1":0,"11":0,"13":0,"26":0,"32":0,"33":0,"34":0,"37":0,"41":0,"42":0,"43":0,"44":0,"46":0,"47":0,"48":0,"50":0,"54":0,"55":0,"56":0,"58":0,"60":0,"61":0,"62":0,"63":0,"64":0,"68":0,"71":0,"72":0,"74":0,"83":0,"86":0,"90":0}; _yuitest_coverage["build/io-form/io-form.js"].functions = {"_serialize:25":0,"(anonymous 1):1":0}; _yuitest_coverage["build/io-form/io-form.js"].coveredLines = 32;@@ -165,4 +165,4 @@ }, true); -}, '3.7.2', {"requires": ["io-base", "node-base"]});+}, '3.7.3', {"requires": ["io-base", "node-base"]});
bundle/io-form/io-form-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -99,4 +99,4 @@ }, true); -}, '3.7.2', {"requires": ["io-base", "node-base"]});+}, '3.7.3', {"requires": ["io-base", "node-base"]});
bundle/io-form/io-form-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("io-form",function(e,t){var n=encodeURIComponent;e.mix(e.IO.prototype,{_serialize:function(t,r){var i=[],s=t.useDisabled||!1,o=0,u=typeof t.id=="string"?t.id:t.id.getAttribute("id"),a,f,l,c,h,p,d,v,m,g;u||(u=e.guid("io:"),t.id.setAttribute("id",u)),f=e.config.doc.getElementById(u);for(p=0,d=f.elements.length;p<d;++p){a=f.elements[p],h=a.disabled,l=a.name;if(s?l:l&&!h){l=n(l)+"=",c=n(a.value);switch(a.type){case"select-one":a.selectedIndex>-1&&(g=a.options[a.selectedIndex],i[o++]=l+n(g.attributes.value&&g.attributes.value.specified?g.value:g.text));break;case"select-multiple":if(a.selectedIndex>-1)for(v=a.selectedIndex,m=a.options.length;v<m;++v)g=a.options[v],g.selected&&(i[o++]=l+n(g.attributes.value&&g.attributes.value.specified?g.value:g.text));break;case"radio":case"checkbox":a.checked&&(i[o++]=l+c);break;case"file":case undefined:case"reset":case"button":break;case"submit":default:i[o++]=l+c}}}return r?i.join("&")+"&"+r:i.join("&")}},!0)},"3.7.2",{requires:["io-base","node-base"]});+YUI.add("io-form",function(e,t){var n=encodeURIComponent;e.mix(e.IO.prototype,{_serialize:function(t,r){var i=[],s=t.useDisabled||!1,o=0,u=typeof t.id=="string"?t.id:t.id.getAttribute("id"),a,f,l,c,h,p,d,v,m,g;u||(u=e.guid("io:"),t.id.setAttribute("id",u)),f=e.config.doc.getElementById(u);for(p=0,d=f.elements.length;p<d;++p){a=f.elements[p],h=a.disabled,l=a.name;if(s?l:l&&!h){l=n(l)+"=",c=n(a.value);switch(a.type){case"select-one":a.selectedIndex>-1&&(g=a.options[a.selectedIndex],i[o++]=l+n(g.attributes.value&&g.attributes.value.specified?g.value:g.text));break;case"select-multiple":if(a.selectedIndex>-1)for(v=a.selectedIndex,m=a.options.length;v<m;++v)g=a.options[v],g.selected&&(i[o++]=l+n(g.attributes.value&&g.attributes.value.specified?g.value:g.text));break;case"radio":case"checkbox":a.checked&&(i[o++]=l+c);break;case"file":case undefined:case"reset":case"button":break;case"submit":default:i[o++]=l+c}}}return r?i.join("&")+"&"+r:i.join("&")}},!0)},"3.7.3",{requires:["io-base","node-base"]});
bundle/io-form/io-form.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -98,4 +98,4 @@ }, true); -}, '3.7.2', {"requires": ["io-base", "node-base"]});+}, '3.7.3', {"requires": ["io-base", "node-base"]});
bundle/io-nodejs/io-nodejs-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/io-nodejs/io-nodejs.js", code: [] };-_yuitest_coverage["build/io-nodejs/io-nodejs.js"].code=["YUI.add('io-nodejs', function (Y, NAME) {","","/*global Y: false, Buffer: false, clearInterval: false, clearTimeout: false, console: false, exports: false, global: false, module: false, process: false, querystring: false, require: false, setInterval: false, setTimeout: false, __filename: false, __dirname: false */"," /**"," * Node.js override for IO, methods are mixed into `Y.IO`"," * @module io-nodejs"," * @main io-nodejs"," */"," /**"," * Passthru to the NodeJS <a href=\"https://github.com/mikeal/request\">request</a> module."," * This method is return of `require('request')` so you can use it inside NodeJS without"," * the IO abstraction."," * @method request"," * @static"," * @for IO"," */"," if (!Y.IO.request) {"," // Default Request's cookie jar to `false`. This way cookies will not be"," // maintained across requests."," Y.IO.request = require('request').defaults({jar: false});"," }",""," var codes = require('http').STATUS_CODES;",""," /**"," Flatten headers object"," @method flatten"," @protected"," @for IO"," @param {Object} o The headers object"," @return {String} The flattened headers object"," */"," var flatten = function(o) {"," var str = [];"," Object.keys(o).forEach(function(name) {"," str.push(name + ': ' + o[name]);"," });"," return str.join('\\n');"," };","",""," /**"," NodeJS IO transport, uses the NodeJS <a href=\"https://github.com/mikeal/request\">request</a>"," module under the hood to perform all network IO."," @method transports.nodejs"," @for IO"," @static"," @returns {Object} This object contains only a `send` method that accepts a"," `transaction object`, `uri` and the `config object`."," @example",""," Y.io('https://somedomain.com/url', {"," method: 'PUT',"," data: '?foo=bar',"," //Extra request module config options."," request: {"," maxRedirects: 100,"," strictSSL: true,"," multipart: ["," {"," 'content-type': 'application/json',"," body: JSON.stringify({"," foo: 'bar',"," _attachments: {"," 'message.txt': {"," follows: true,"," length: 18,"," 'content_type': 'text/plain'"," }"," }"," })"," },"," {"," body: 'I am an attachment'"," }"," ]"," },"," on: {"," success: function(id, e) {"," }"," }"," });"," */",""," Y.IO.transports.nodejs = function() {"," return {"," send: function (transaction, uri, config) {",""," config.notify('start', transaction, config);"," config.method = config.method || 'GET';"," config.method = config.method.toUpperCase();",""," var rconf = {"," method: config.method,"," uri: uri"," };",""," if (config.data) {"," if (Y.Lang.isObject(config.data)) {"," if (Y.QueryString && Y.QueryString.stringify) {"," rconf.body = Y.QueryString.stringify(config.data);"," } else {"," }"," } else if (Y.Lang.isString(config.data)) {"," rconf.body = config.data;"," }"," if (rconf.method === 'GET') {"," rconf.uri += (rconf.uri.indexOf('?') > -1 ? '&' : '?') + rconf.body;"," rconf.body = '';"," }"," }"," if (config.headers) {"," rconf.headers = config.headers;"," }"," if (config.timeout) {"," rconf.timeout = config.timeout;"," }"," if (config.request) {"," Y.mix(rconf, config.request);"," }"," Y.IO.request(rconf, function(err, data) {",""," if (err) {"," transaction.c = err;"," config.notify(((err.code === 'ETIMEDOUT') ? 'timeout' : 'failure'), transaction, config);"," return;"," }"," if (data) {"," transaction.c = {"," status: data.statusCode,"," statusCode: data.statusCode,"," statusText: codes[data.statusCode],"," headers: data.headers,"," responseText: data.body,"," responseXML: null,"," getResponseHeader: function(name) {"," return this.headers[name];"," },"," getAllResponseHeaders: function() {"," return flatten(this.headers);"," }"," };"," }",""," config.notify('complete', transaction, config);"," config.notify(((data && (data.statusCode >= 200 && data.statusCode <= 299)) ? 'success' : 'failure'), transaction, config);"," });",""," var ret = {"," io: transaction"," };"," return ret;"," }"," };"," };",""," Y.IO.defaultTransport('nodejs');","","","","}, '3.7.2', {\"requires\": [\"io-base\"]});"];+_yuitest_coverage["build/io-nodejs/io-nodejs.js"].code=["YUI.add('io-nodejs', function (Y, NAME) {","","/*global Y: false, Buffer: false, clearInterval: false, clearTimeout: false, console: false, exports: false, global: false, module: false, process: false, querystring: false, require: false, setInterval: false, setTimeout: false, __filename: false, __dirname: false */"," /**"," * Node.js override for IO, methods are mixed into `Y.IO`"," * @module io-nodejs"," * @main io-nodejs"," */"," /**"," * Passthru to the NodeJS <a href=\"https://github.com/mikeal/request\">request</a> module."," * This method is return of `require('request')` so you can use it inside NodeJS without"," * the IO abstraction."," * @method request"," * @static"," * @for IO"," */"," if (!Y.IO.request) {"," // Default Request's cookie jar to `false`. This way cookies will not be"," // maintained across requests."," Y.IO.request = require('request').defaults({jar: false});"," }",""," var codes = require('http').STATUS_CODES;",""," /**"," Flatten headers object"," @method flatten"," @protected"," @for IO"," @param {Object} o The headers object"," @return {String} The flattened headers object"," */"," var flatten = function(o) {"," var str = [];"," Object.keys(o).forEach(function(name) {"," str.push(name + ': ' + o[name]);"," });"," return str.join('\\n');"," };","",""," /**"," NodeJS IO transport, uses the NodeJS <a href=\"https://github.com/mikeal/request\">request</a>"," module under the hood to perform all network IO."," @method transports.nodejs"," @for IO"," @static"," @return {Object} This object contains only a `send` method that accepts a"," `transaction object`, `uri` and the `config object`."," @example",""," Y.io('https://somedomain.com/url', {"," method: 'PUT',"," data: '?foo=bar',"," //Extra request module config options."," request: {"," maxRedirects: 100,"," strictSSL: true,"," multipart: ["," {"," 'content-type': 'application/json',"," body: JSON.stringify({"," foo: 'bar',"," _attachments: {"," 'message.txt': {"," follows: true,"," length: 18,"," 'content_type': 'text/plain'"," }"," }"," })"," },"," {"," body: 'I am an attachment'"," }"," ]"," },"," on: {"," success: function(id, e) {"," }"," }"," });"," */",""," Y.IO.transports.nodejs = function() {"," return {"," send: function (transaction, uri, config) {",""," config.notify('start', transaction, config);"," config.method = config.method || 'GET';"," config.method = config.method.toUpperCase();",""," var rconf = {"," method: config.method,"," uri: uri"," };",""," if (config.data) {"," if (Y.Lang.isObject(config.data)) {"," if (Y.QueryString && Y.QueryString.stringify) {"," rconf.body = Y.QueryString.stringify(config.data);"," } else {"," }"," } else if (Y.Lang.isString(config.data)) {"," rconf.body = config.data;"," }"," if (rconf.method === 'GET') {"," rconf.uri += (rconf.uri.indexOf('?') > -1 ? '&' : '?') + rconf.body;"," rconf.body = '';"," }"," }"," if (config.headers) {"," rconf.headers = config.headers;"," }"," if (config.timeout) {"," rconf.timeout = config.timeout;"," }"," if (config.request) {"," Y.mix(rconf, config.request);"," }"," Y.IO.request(rconf, function(err, data) {",""," if (err) {"," transaction.c = err;"," config.notify(((err.code === 'ETIMEDOUT') ? 'timeout' : 'failure'), transaction, config);"," return;"," }"," if (data) {"," transaction.c = {"," status: data.statusCode,"," statusCode: data.statusCode,"," statusText: codes[data.statusCode],"," headers: data.headers,"," responseText: data.body,"," responseXML: null,"," getResponseHeader: function(name) {"," return this.headers[name];"," },"," getAllResponseHeaders: function() {"," return flatten(this.headers);"," }"," };"," }",""," config.notify('complete', transaction, config);"," config.notify(((data && (data.statusCode >= 200 && data.statusCode <= 299)) ? 'success' : 'failure'), transaction, config);"," });",""," var ret = {"," io: transaction"," };"," return ret;"," }"," };"," };",""," Y.IO.defaultTransport('nodejs');","","","","}, '3.7.3', {\"requires\": [\"io-base\"]});"]; _yuitest_coverage["build/io-nodejs/io-nodejs.js"].lines = {"1":0,"17":0,"20":0,"23":0,"33":0,"34":0,"35":0,"36":0,"38":0,"85":0,"86":0,"89":0,"90":0,"91":0,"93":0,"98":0,"99":0,"100":0,"101":0,"104":0,"105":0,"107":0,"108":0,"109":0,"112":0,"113":0,"115":0,"116":0,"118":0,"119":0,"121":0,"123":0,"124":0,"125":0,"126":0,"128":0,"129":0,"137":0,"140":0,"145":0,"146":0,"149":0,"152":0,"157":0}; _yuitest_coverage["build/io-nodejs/io-nodejs.js"].functions = {"(anonymous 2):35":0,"flatten:33":0,"getResponseHeader:136":0,"getAllResponseHeaders:139":0,"(anonymous 3):121":0,"send:87":0,"nodejs:85":0,"(anonymous 1):1":0}; _yuitest_coverage["build/io-nodejs/io-nodejs.js"].coveredLines = 44;@@ -96,7 +96,7 @@ @method transports.nodejs @for IO @static- @returns {Object} This object contains only a `send` method that accepts a+ @return {Object} This object contains only a `send` method that accepts a `transaction object`, `uri` and the `config object`. @example @@ -249,4 +249,4 @@ -}, '3.7.2', {"requires": ["io-base"]});+}, '3.7.3', {"requires": ["io-base"]});
bundle/io-nodejs/io-nodejs-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -52,7 +52,7 @@ @method transports.nodejs @for IO @static- @returns {Object} This object contains only a `send` method that accepts a+ @return {Object} This object contains only a `send` method that accepts a `transaction object`, `uri` and the `config object`. @example @@ -173,4 +173,4 @@ -}, '3.7.2', {"requires": ["io-base"]});+}, '3.7.3', {"requires": ["io-base"]});
bundle/io-nodejs/io-nodejs-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("io-nodejs",function(e,t){e.IO.request||(e.IO.request=require("request").defaults({jar:!1}));var n=require("http").STATUS_CODES,r=function(e){var t=[];return Object.keys(e).forEach(function(n){t.push(n+": "+e[n])}),t.join("\n")};e.IO.transports.nodejs=function(){return{send:function(t,i,s){s.notify("start",t,s),s.method=s.method||"GET",s.method=s.method.toUpperCase();var o={method:s.method,uri:i};s.data&&(e.Lang.isObject(s.data)?e.QueryString&&e.QueryString.stringify&&(o.body=e.QueryString.stringify(s.data)):e.Lang.isString(s.data)&&(o.body=s.data),o.method==="GET"&&(o.uri+=(o.uri.indexOf("?")>-1?"&":"?")+o.body,o.body="")),s.headers&&(o.headers=s.headers),s.timeout&&(o.timeout=s.timeout),s.request&&e.mix(o,s.request),e.IO.request(o,function(e,i){if(e){t.c=e,s.notify(e.code==="ETIMEDOUT"?"timeout":"failure",t,s);return}i&&(t.c={status:i.statusCode,statusCode:i.statusCode,statusText:n[i.statusCode],headers:i.headers,responseText:i.body,responseXML:null,getResponseHeader:function(e){return this.headers[e]},getAllResponseHeaders:function(){return r(this.headers)}}),s.notify("complete",t,s),s.notify(i&&i.statusCode>=200&&i.statusCode<=299?"success":"failure",t,s)});var u={io:t};return u}}},e.IO.defaultTransport("nodejs")},"3.7.2",{requires:["io-base"]});+YUI.add("io-nodejs",function(e,t){e.IO.request||(e.IO.request=require("request").defaults({jar:!1}));var n=require("http").STATUS_CODES,r=function(e){var t=[];return Object.keys(e).forEach(function(n){t.push(n+": "+e[n])}),t.join("\n")};e.IO.transports.nodejs=function(){return{send:function(t,i,s){s.notify("start",t,s),s.method=s.method||"GET",s.method=s.method.toUpperCase();var o={method:s.method,uri:i};s.data&&(e.Lang.isObject(s.data)?e.QueryString&&e.QueryString.stringify&&(o.body=e.QueryString.stringify(s.data)):e.Lang.isString(s.data)&&(o.body=s.data),o.method==="GET"&&(o.uri+=(o.uri.indexOf("?")>-1?"&":"?")+o.body,o.body="")),s.headers&&(o.headers=s.headers),s.timeout&&(o.timeout=s.timeout),s.request&&e.mix(o,s.request),e.IO.request(o,function(e,i){if(e){t.c=e,s.notify(e.code==="ETIMEDOUT"?"timeout":"failure",t,s);return}i&&(t.c={status:i.statusCode,statusCode:i.statusCode,statusText:n[i.statusCode],headers:i.headers,responseText:i.body,responseXML:null,getResponseHeader:function(e){return this.headers[e]},getAllResponseHeaders:function(){return r(this.headers)}}),s.notify("complete",t,s),s.notify(i&&i.statusCode>=200&&i.statusCode<=299?"success":"failure",t,s)});var u={io:t};return u}}},e.IO.defaultTransport("nodejs")},"3.7.3",{requires:["io-base"]});
bundle/io-nodejs/io-nodejs.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -51,7 +51,7 @@ @method transports.nodejs @for IO @static- @returns {Object} This object contains only a `send` method that accepts a+ @return {Object} This object contains only a `send` method that accepts a `transaction object`, `uri` and the `config object`. @example @@ -164,4 +164,4 @@ -}, '3.7.2', {"requires": ["io-base"]});+}, '3.7.3', {"requires": ["io-base"]});
bundle/io-queue/io-queue-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/io-queue/io-queue.js", code: [] };-_yuitest_coverage["build/io-queue/io-queue.js"].code=["YUI.add('io-queue', function (Y, NAME) {","","/**","Extends IO to implement Queue for synchronous","transaction processing.","@module io","@submodule io-queue","@for IO","**/","var io = Y.io._map['io:0'] || new Y.IO();","","Y.mix(Y.IO.prototype, {"," /**"," * Array of transactions queued for processing"," *"," * @property _q"," * @private"," * @static"," * @type {Object}"," */"," _q: new Y.Queue(),"," _qActiveId: null,"," _qInit: false,"," /**"," * Property to determine whether the queue is set to"," * 1 (active) or 0 (inactive). When inactive, transactions"," * will be stored in the queue until the queue is set to active."," *"," * @property _qState"," * @private"," * @static"," * @type {Number}"," */"," _qState: 1,",""," /**"," * Method Process the first transaction from the"," * queue in FIFO order."," *"," * @method _qShift"," * @private"," * @static"," */"," _qShift: function() {"," var io = this,"," o = io._q.next();",""," io._qActiveId = o.id;"," io._qState = 0;"," io.send(o.uri, o.cfg, o.id);"," },",""," /**"," * Method for queueing a transaction before the request is sent to the"," * resource, to ensure sequential processing."," *"," * @method queue"," * @static"," * @return {Object}"," */"," queue: function(uri, c) {"," var io = this,"," o = { uri: uri, cfg:c, id: this._id++ };",""," if(!io._qInit) {"," Y.on('io:complete', function(id, o) { io._qNext(id); }, io);"," io._qInit = true;"," }",""," io._q.add(o);"," if (io._qState === 1) {"," io._qShift();"," }",""," return o;"," },",""," _qNext: function(id) {"," var io = this;"," io._qState = 1;"," if (io._qActiveId === id && io._q.size() > 0) {"," io._qShift();"," }"," },",""," /**"," * Method for promoting a transaction to the top of the queue."," *"," * @method promote"," * @static"," */"," qPromote: function(o) {"," this._q.promote(o);"," },",""," /**"," * Method for removing a specific, pending transaction from"," * the queue."," *"," * @method remove"," * @private"," * @static"," */"," qRemove: function(o) {"," this._q.remove(o);"," },",""," qStart: function() {"," var io = this;"," io._qState = 1;",""," if (io._q.size() > 0) {"," io._qShift();"," }"," },",""," /**"," * Method for setting queue processing to inactive."," * Transaction requests to YUI.io.queue() will be stored in the queue, but"," * not processed until the queue is reset to \"active\"."," *"," * @method _stop"," * @private"," * @static"," */"," qStop: function() {"," this._qState = 0;"," },",""," /**"," * Method to query the current size of the queue."," *"," * @method _size"," * @private"," * @static"," * @return {Number}"," */"," qSize: function() {"," return this._q.size();"," }","","}, true);","","function _queue(u, c) {"," return io.queue.apply(io, [u, c]);","}","","_queue.start = function () { io.qStart(); };","_queue.stop = function () { io.qStop(); };","_queue.promote = function (o) { io.qPromote(o); };","_queue.remove = function (o) { io.qRemove(o); };","_queue.size = function () { io.qSize(); };","Y.io.queue = _queue;","","","}, '3.7.2', {\"requires\": [\"io-base\", \"queue-promote\"]});"];-_yuitest_coverage["build/io-queue/io-queue.js"].lines = {"1":0,"10":0,"12":0,"45":0,"48":0,"49":0,"50":0,"62":0,"65":0,"66":0,"67":0,"70":0,"71":0,"72":0,"75":0,"79":0,"80":0,"81":0,"82":0,"93":0,"105":0,"109":0,"110":0,"112":0,"113":0,"127":0,"139":0,"144":0,"145":0,"148":0,"149":0,"150":0,"151":0,"152":0,"153":0};-_yuitest_coverage["build/io-queue/io-queue.js"].functions = {"_qShift:44":0,"(anonymous 2):66":0,"queue:61":0,"_qNext:78":0,"qPromote:92":0,"qRemove:104":0,"qStart:108":0,"qStop:126":0,"qSize:138":0,"_queue:144":0,"start:148":0,"stop:149":0,"promote:150":0,"remove:151":0,"size:152":0,"(anonymous 1):1":0};-_yuitest_coverage["build/io-queue/io-queue.js"].coveredLines = 35;-_yuitest_coverage["build/io-queue/io-queue.js"].coveredFunctions = 16;+_yuitest_coverage["build/io-queue/io-queue.js"].code=["YUI.add('io-queue', function (Y, NAME) {","","/**","Extends IO to implement Queue for synchronous","transaction processing.","@module io","@submodule io-queue","@for IO","**/","var io = Y.io._map['io:0'] || new Y.IO();","","Y.mix(Y.IO.prototype, {"," /**"," * Array of transactions queued for processing"," *"," * @property _q"," * @private"," * @static"," * @type {Object}"," */"," _q: new Y.Queue(),"," _qActiveId: null,"," _qInit: false,",""," /**"," * Property to determine whether the queue is set to"," * 1 (active) or 0 (inactive). When inactive, transactions"," * will be stored in the queue until the queue is set to active."," *"," * @property _qState"," * @private"," * @static"," * @type {Number}"," */"," _qState: 1,",""," /**"," * Method Process the first transaction from the"," * queue in FIFO order."," *"," * @method _qShift"," * @private"," * @static"," */"," _qShift: function() {"," var io = this,"," o = io._q.next();",""," io._qActiveId = o.id;"," io._qState = 0;"," io.send(o.uri, o.cfg, o.id);"," },",""," /**"," * Method for queueing a transaction before the request is sent to the"," * resource, to ensure sequential processing."," *"," * @method queue"," * @static"," * @return {Object}"," */"," queue: function(uri, c) {"," var io = this,"," o = { uri: uri, cfg:c, id: this._id++ };",""," if(!io._qInit) {"," Y.on('io:complete', function(id, o) { io._qNext(id); }, io);"," io._qInit = true;"," }",""," io._q.add(o);"," if (io._qState === 1) {"," io._qShift();"," }",""," return o;"," },",""," _qNext: function(id) {"," var io = this;"," io._qState = 1;"," if (io._qActiveId === id && io._q.size() > 0) {"," io._qShift();"," }"," },",""," /**"," * Method for promoting a transaction to the top of the queue."," *"," * @method promote"," * @static"," */"," qPromote: function(o) {"," this._q.promote(o);"," },",""," /**"," * Method for removing a specific, pending transaction from"," * the queue."," *"," * @method remove"," * @private"," * @static"," */"," qRemove: function(o) {"," this._q.remove(o);"," },",""," /**"," * Method for cancel all pending transaction from"," * the queue."," *"," * @method empty"," * @static"," * @since 3.7.3"," */"," qEmpty: function() {"," this._q = new Y.Queue();"," },",""," qStart: function() {"," var io = this;"," io._qState = 1;",""," if (io._q.size() > 0) {"," io._qShift();"," }"," },",""," /**"," * Method for setting queue processing to inactive."," * Transaction requests to YUI.io.queue() will be stored in the queue, but"," * not processed until the queue is reset to \"active\"."," *"," * @method _stop"," * @private"," * @static"," */"," qStop: function() {"," this._qState = 0;"," },",""," /**"," * Method to query the current size of the queue."," *"," * @method _size"," * @private"," * @static"," * @return {Number}"," */"," qSize: function() {"," return this._q.size();"," }","","}, true);","","function _queue(u, c) {"," return io.queue.apply(io, [u, c]);","}","","_queue.start = function () { io.qStart(); };","_queue.stop = function () { io.qStop(); };","_queue.promote = function (o) { io.qPromote(o); };","_queue.remove = function (o) { io.qRemove(o); };","_queue.size = function () { io.qSize(); };","_queue.empty = function () { io.qEmpty(); };","Y.io.queue = _queue;","","","}, '3.7.3', {\"requires\": [\"io-base\", \"queue-promote\"]});"];+_yuitest_coverage["build/io-queue/io-queue.js"].lines = {"1":0,"10":0,"12":0,"46":0,"49":0,"50":0,"51":0,"63":0,"66":0,"67":0,"68":0,"71":0,"72":0,"73":0,"76":0,"80":0,"81":0,"82":0,"83":0,"94":0,"106":0,"118":0,"122":0,"123":0,"125":0,"126":0,"140":0,"152":0,"157":0,"158":0,"161":0,"162":0,"163":0,"164":0,"165":0,"166":0,"167":0};+_yuitest_coverage["build/io-queue/io-queue.js"].functions = {"_qShift:45":0,"(anonymous 2):67":0,"queue:62":0,"_qNext:79":0,"qPromote:93":0,"qRemove:105":0,"qEmpty:117":0,"qStart:121":0,"qStop:139":0,"qSize:151":0,"_queue:157":0,"start:161":0,"stop:162":0,"promote:163":0,"remove:164":0,"size:165":0,"empty:166":0,"(anonymous 1):1":0};+_yuitest_coverage["build/io-queue/io-queue.js"].coveredLines = 37;+_yuitest_coverage["build/io-queue/io-queue.js"].coveredFunctions = 18; _yuitest_coverline("build/io-queue/io-queue.js", 1); YUI.add('io-queue', function (Y, NAME) { @@ -64,6 +64,7 @@ _q: new Y.Queue(), _qActiveId: null, _qInit: false,+ /** * Property to determine whether the queue is set to * 1 (active) or 0 (inactive). When inactive, transactions@@ -85,16 +86,16 @@ * @static */ _qShift: function() {- _yuitest_coverfunc("build/io-queue/io-queue.js", "_qShift", 44);-_yuitest_coverline("build/io-queue/io-queue.js", 45);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "_qShift", 45);+_yuitest_coverline("build/io-queue/io-queue.js", 46); var io = this, o = io._q.next(); - _yuitest_coverline("build/io-queue/io-queue.js", 48);-io._qActiveId = o.id; _yuitest_coverline("build/io-queue/io-queue.js", 49);-io._qState = 0;+io._qActiveId = o.id; _yuitest_coverline("build/io-queue/io-queue.js", 50);+io._qState = 0;+ _yuitest_coverline("build/io-queue/io-queue.js", 51); io.send(o.uri, o.cfg, o.id); }, @@ -107,41 +108,41 @@ * @return {Object} */ queue: function(uri, c) {- _yuitest_coverfunc("build/io-queue/io-queue.js", "queue", 61);-_yuitest_coverline("build/io-queue/io-queue.js", 62);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "queue", 62);+_yuitest_coverline("build/io-queue/io-queue.js", 63); var io = this, o = { uri: uri, cfg:c, id: this._id++ }; - _yuitest_coverline("build/io-queue/io-queue.js", 65);+ _yuitest_coverline("build/io-queue/io-queue.js", 66); if(!io._qInit) {- _yuitest_coverline("build/io-queue/io-queue.js", 66);-Y.on('io:complete', function(id, o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "(anonymous 2)", 66);-io._qNext(id); }, io); _yuitest_coverline("build/io-queue/io-queue.js", 67);+Y.on('io:complete', function(id, o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "(anonymous 2)", 67);+io._qNext(id); }, io);+ _yuitest_coverline("build/io-queue/io-queue.js", 68); io._qInit = true; } - _yuitest_coverline("build/io-queue/io-queue.js", 70);-io._q.add(o); _yuitest_coverline("build/io-queue/io-queue.js", 71);+io._q.add(o);+ _yuitest_coverline("build/io-queue/io-queue.js", 72); if (io._qState === 1) {- _yuitest_coverline("build/io-queue/io-queue.js", 72);+ _yuitest_coverline("build/io-queue/io-queue.js", 73); io._qShift(); } - _yuitest_coverline("build/io-queue/io-queue.js", 75);+ _yuitest_coverline("build/io-queue/io-queue.js", 76); return o; }, _qNext: function(id) {- _yuitest_coverfunc("build/io-queue/io-queue.js", "_qNext", 78);-_yuitest_coverline("build/io-queue/io-queue.js", 79);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "_qNext", 79);+_yuitest_coverline("build/io-queue/io-queue.js", 80); var io = this;- _yuitest_coverline("build/io-queue/io-queue.js", 80);-io._qState = 1; _yuitest_coverline("build/io-queue/io-queue.js", 81);+io._qState = 1;+ _yuitest_coverline("build/io-queue/io-queue.js", 82); if (io._qActiveId === id && io._q.size() > 0) {- _yuitest_coverline("build/io-queue/io-queue.js", 82);+ _yuitest_coverline("build/io-queue/io-queue.js", 83); io._qShift(); } },@@ -153,8 +154,8 @@ * @static */ qPromote: function(o) {- _yuitest_coverfunc("build/io-queue/io-queue.js", "qPromote", 92);-_yuitest_coverline("build/io-queue/io-queue.js", 93);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "qPromote", 93);+_yuitest_coverline("build/io-queue/io-queue.js", 94); this._q.promote(o); }, @@ -167,21 +168,35 @@ * @static */ qRemove: function(o) {- _yuitest_coverfunc("build/io-queue/io-queue.js", "qRemove", 104);-_yuitest_coverline("build/io-queue/io-queue.js", 105);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "qRemove", 105);+_yuitest_coverline("build/io-queue/io-queue.js", 106); this._q.remove(o); }, + /**+ * Method for cancel all pending transaction from+ * the queue.+ *+ * @method empty+ * @static+ * @since 3.7.3+ */+ qEmpty: function() {+ _yuitest_coverfunc("build/io-queue/io-queue.js", "qEmpty", 117);+_yuitest_coverline("build/io-queue/io-queue.js", 118);+this._q = new Y.Queue();+ },+ qStart: function() {- _yuitest_coverfunc("build/io-queue/io-queue.js", "qStart", 108);-_yuitest_coverline("build/io-queue/io-queue.js", 109);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "qStart", 121);+_yuitest_coverline("build/io-queue/io-queue.js", 122); var io = this;- _yuitest_coverline("build/io-queue/io-queue.js", 110);+ _yuitest_coverline("build/io-queue/io-queue.js", 123); io._qState = 1; - _yuitest_coverline("build/io-queue/io-queue.js", 112);+ _yuitest_coverline("build/io-queue/io-queue.js", 125); if (io._q.size() > 0) {- _yuitest_coverline("build/io-queue/io-queue.js", 113);+ _yuitest_coverline("build/io-queue/io-queue.js", 126); io._qShift(); } },@@ -196,8 +211,8 @@ * @static */ qStop: function() {- _yuitest_coverfunc("build/io-queue/io-queue.js", "qStop", 126);-_yuitest_coverline("build/io-queue/io-queue.js", 127);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "qStop", 139);+_yuitest_coverline("build/io-queue/io-queue.js", 140); this._qState = 0; }, @@ -210,37 +225,40 @@ * @return {Number} */ qSize: function() {- _yuitest_coverfunc("build/io-queue/io-queue.js", "qSize", 138);-_yuitest_coverline("build/io-queue/io-queue.js", 139);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "qSize", 151);+_yuitest_coverline("build/io-queue/io-queue.js", 152); return this._q.size(); } }, true); -_yuitest_coverline("build/io-queue/io-queue.js", 144);+_yuitest_coverline("build/io-queue/io-queue.js", 157); function _queue(u, c) {- _yuitest_coverfunc("build/io-queue/io-queue.js", "_queue", 144);-_yuitest_coverline("build/io-queue/io-queue.js", 145);+ _yuitest_coverfunc("build/io-queue/io-queue.js", "_queue", 157);+_yuitest_coverline("build/io-queue/io-queue.js", 158); return io.queue.apply(io, [u, c]); } -_yuitest_coverline("build/io-queue/io-queue.js", 148);-_queue.start = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "start", 148);+_yuitest_coverline("build/io-queue/io-queue.js", 161);+_queue.start = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "start", 161); io.qStart(); };-_yuitest_coverline("build/io-queue/io-queue.js", 149);-_queue.stop = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "stop", 149);+_yuitest_coverline("build/io-queue/io-queue.js", 162);+_queue.stop = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "stop", 162); io.qStop(); };-_yuitest_coverline("build/io-queue/io-queue.js", 150);-_queue.promote = function (o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "promote", 150);+_yuitest_coverline("build/io-queue/io-queue.js", 163);+_queue.promote = function (o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "promote", 163); io.qPromote(o); };-_yuitest_coverline("build/io-queue/io-queue.js", 151);-_queue.remove = function (o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "remove", 151);+_yuitest_coverline("build/io-queue/io-queue.js", 164);+_queue.remove = function (o) { _yuitest_coverfunc("build/io-queue/io-queue.js", "remove", 164); io.qRemove(o); };-_yuitest_coverline("build/io-queue/io-queue.js", 152);-_queue.size = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "size", 152);+_yuitest_coverline("build/io-queue/io-queue.js", 165);+_queue.size = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "size", 165); io.qSize(); };-_yuitest_coverline("build/io-queue/io-queue.js", 153);+_yuitest_coverline("build/io-queue/io-queue.js", 166);+_queue.empty = function () { _yuitest_coverfunc("build/io-queue/io-queue.js", "empty", 166);+io.qEmpty(); };+_yuitest_coverline("build/io-queue/io-queue.js", 167); Y.io.queue = _queue; -}, '3.7.2', {"requires": ["io-base", "queue-promote"]});+}, '3.7.3', {"requires": ["io-base", "queue-promote"]});
bundle/io-queue/io-queue-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -27,6 +27,7 @@ _q: new Y.Queue(), _qActiveId: null, _qInit: false,+ /** * Property to determine whether the queue is set to * 1 (active) or 0 (inactive). When inactive, transactions@@ -112,6 +113,18 @@ this._q.remove(o); }, + /**+ * Method for cancel all pending transaction from+ * the queue.+ *+ * @method empty+ * @static+ * @since 3.7.3+ */+ qEmpty: function() {+ this._q = new Y.Queue();+ },+ qStart: function() { var io = this; io._qState = 1;@@ -159,7 +172,8 @@ _queue.promote = function (o) { io.qPromote(o); }; _queue.remove = function (o) { io.qRemove(o); }; _queue.size = function () { io.qSize(); };+_queue.empty = function () { io.qEmpty(); }; Y.io.queue = _queue; -}, '3.7.2', {"requires": ["io-base", "queue-promote"]});+}, '3.7.3', {"requires": ["io-base", "queue-promote"]});
bundle/io-queue/io-queue-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("io-queue",function(e,t){function r(e,t){return n.queue.apply(n,[e,t])}var n=e.io._map["io:0"]||new e.IO;e.mix(e.IO.prototype,{_q:new e.Queue,_qActiveId:null,_qInit:!1,_qState:1,_qShift:function(){var e=this,t=e._q.next();e._qActiveId=t.id,e._qState=0,e.send(t.uri,t.cfg,t.id)},queue:function(t,n){var r=this,i={uri:t,cfg:n,id:this._id++};return r._qInit||(e.on("io:complete",function(e,t){r._qNext(e)},r),r._qInit=!0),r._q.add(i),r._qState===1&&r._qShift(),i},_qNext:function(e){var t=this;t._qState=1,t._qActiveId===e&&t._q.size()>0&&t._qShift()},qPromote:function(e){this._q.promote(e)},qRemove:function(e){this._q.remove(e)},qStart:function(){var e=this;e._qState=1,e._q.size()>0&&e._qShift()},qStop:function(){this._qState=0},qSize:function(){return this._q.size()}},!0),r.start=function(){n.qStart()},r.stop=function(){n.qStop()},r.promote=function(e){n.qPromote(e)},r.remove=function(e){n.qRemove(e)},r.size=function(){n.qSize()},e.io.queue=r},"3.7.2",{requires:["io-base","queue-promote"]});+YUI.add("io-queue",function(e,t){function r(e,t){return n.queue.apply(n,[e,t])}var n=e.io._map["io:0"]||new e.IO;e.mix(e.IO.prototype,{_q:new e.Queue,_qActiveId:null,_qInit:!1,_qState:1,_qShift:function(){var e=this,t=e._q.next();e._qActiveId=t.id,e._qState=0,e.send(t.uri,t.cfg,t.id)},queue:function(t,n){var r=this,i={uri:t,cfg:n,id:this._id++};return r._qInit||(e.on("io:complete",function(e,t){r._qNext(e)},r),r._qInit=!0),r._q.add(i),r._qState===1&&r._qShift(),i},_qNext:function(e){var t=this;t._qState=1,t._qActiveId===e&&t._q.size()>0&&t._qShift()},qPromote:function(e){this._q.promote(e)},qRemove:function(e){this._q.remove(e)},qEmpty:function(){this._q=new e.Queue},qStart:function(){var e=this;e._qState=1,e._q.size()>0&&e._qShift()},qStop:function(){this._qState=0},qSize:function(){return this._q.size()}},!0),r.start=function(){n.qStart()},r.stop=function(){n.qStop()},r.promote=function(e){n.qPromote(e)},r.remove=function(e){n.qRemove(e)},r.size=function(){n.qSize()},r.empty=function(){n.qEmpty()},e.io.queue=r},"3.7.3",{requires:["io-base","queue-promote"]});
bundle/io-queue/io-queue.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -27,6 +27,7 @@ _q: new Y.Queue(), _qActiveId: null, _qInit: false,+ /** * Property to determine whether the queue is set to * 1 (active) or 0 (inactive). When inactive, transactions@@ -111,6 +112,18 @@ this._q.remove(o); }, + /**+ * Method for cancel all pending transaction from+ * the queue.+ *+ * @method empty+ * @static+ * @since 3.7.3+ */+ qEmpty: function() {+ this._q = new Y.Queue();+ },+ qStart: function() { var io = this; io._qState = 1;@@ -156,7 +169,8 @@ _queue.promote = function (o) { io.qPromote(o); }; _queue.remove = function (o) { io.qRemove(o); }; _queue.size = function () { io.qSize(); };+_queue.empty = function () { io.qEmpty(); }; Y.io.queue = _queue; -}, '3.7.2', {"requires": ["io-base", "queue-promote"]});+}, '3.7.3', {"requires": ["io-base", "queue-promote"]});
bundle/io-upload-iframe/io-upload-iframe-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,16 +32,16 @@ path: "build/io-upload-iframe/io-upload-iframe.js", code: [] };-_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].code=["YUI.add('io-upload-iframe', function (Y, NAME) {","","/**","Extends the IO to enable file uploads, with HTML forms ","using an iframe as the transport medium.","@module io","@submodule io-upload-iframe","@for IO","**/","","var w = Y.config.win,"," d = Y.config.doc,"," _std = (d.documentMode && d.documentMode >= 8),"," _d = decodeURIComponent;","","/**"," * Creates the iframe transported used in file upload"," * transactions, and binds the response event handler."," *"," * @method _cFrame"," * @private"," * @param {Object} o Transaction object generated by _create()."," * @param {Object} c Configuration object passed to YUI.io()."," * @param {Object} io"," */","function _cFrame(o, c, io) {"," var i = Y.Node.create('<iframe src=\"#\" id=\"io_iframe' + o.id + '\" name=\"io_iframe' + o.id + '\" />');"," i._node.style.position = 'absolute';"," i._node.style.top = '-1000px';"," i._node.style.left = '-1000px';"," Y.one('body').appendChild(i);"," // Bind the onload handler to the iframe to detect the file upload response."," Y.on(\"load\", function() { io._uploadComplete(o, c); }, '#io_iframe' + o.id);","}","","/**"," * Removes the iframe transport used in the file upload "," * transaction."," *"," * @method _dFrame"," * @private"," * @param {Number} id The transaction ID used in the iframe's creation."," */","function _dFrame(id) {"," Y.Event.purgeElement('#io_iframe' + id, false);"," Y.one('body').removeChild(Y.one('#io_iframe' + id));","}","","Y.mix(Y.IO.prototype, {"," /**"," * Parses the POST data object and creates hidden form elements"," * for each key-value, and appends them to the HTML form object."," * @method appendData"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {String} s The key-value POST data."," * @return {Array} o Array of created fields."," */"," _addData: function(f, s) {"," // Serialize an object into a key-value string using"," // querystring-stringify-simple."," if (Y.Lang.isObject(s)) {"," s = Y.QueryString.stringify(s);"," }",""," var o = [],"," m = s.split('='),"," i, l;",""," for (i = 0, l = m.length - 1; i < l; i++) {"," o[i] = d.createElement('input');"," o[i].type = 'hidden';"," o[i].name = _d(m[i].substring(m[i].lastIndexOf('&') + 1));"," o[i].value = (i + 1 === l) ? _d(m[i + 1]) : _d(m[i + 1].substring(0, (m[i + 1].lastIndexOf('&'))));"," f.appendChild(o[i]);"," }",""," return o;"," },",""," /**"," * Removes the custom fields created to pass additional POST"," * data, along with the HTML form fields."," * @method _removeData"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} o HTML form fields created from configuration.data."," */"," _removeData: function(f, o) {"," var i, l;",""," for (i = 0, l = o.length; i < l; i++) {"," f.removeChild(o[i]);"," }"," },",""," /**"," * Sets the appropriate attributes and values to the HTML"," * form, in preparation of a file upload transaction."," * @method _setAttrs"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} id The Transaction ID."," * @param {Object} uri Qualified path to transaction resource."," */"," _setAttrs: function(f, id, uri) {"," f.setAttribute('action', uri);"," f.setAttribute('method', 'POST');"," f.setAttribute('target', 'io_iframe' + id );"," f.setAttribute(Y.UA.ie && !_std ? 'encoding' : 'enctype', 'multipart/form-data');"," },",""," /**"," * Reset the HTML form attributes to their original values."," * @method _resetAttrs"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} a Object of original attributes."," */"," _resetAttrs: function(f, a) {"," Y.Object.each(a, function(v, p) {"," if (v) {"," f.setAttribute(p, v);"," }"," else {"," f.removeAttribute(p);"," }"," });"," },",""," /**"," * Starts timeout count if the configuration object"," * has a defined timeout property."," *"," * @method _startUploadTimeout"," * @private"," * @static"," * @param {Object} o Transaction object generated by _create()."," * @param {Object} c Configuration object passed to YUI.io()."," */"," _startUploadTimeout: function(o, c) {"," var io = this;",""," io._timeout[o.id] = w.setTimeout("," function() {"," o.status = 0;"," o.statusText = 'timeout';"," io.complete(o, c);"," io.end(o, c);"," }, c.timeout);"," },",""," /**"," * Clears the timeout interval started by _startUploadTimeout()."," * @method _clearUploadTimeout"," * @private"," * @static"," * @param {Number} id - Transaction ID."," */"," _clearUploadTimeout: function(id) {"," var io = this;",""," w.clearTimeout(io._timeout[id]);"," delete io._timeout[id];"," },",""," /**"," * Bound to the iframe's Load event and processes"," * the response data."," * @method _uploadComplete"," * @private"," * @static"," * @param {Object} o The transaction object"," * @param {Object} c Configuration object for the transaction."," */"," _uploadComplete: function(o, c) {"," var io = this,"," d = Y.one('#io_iframe' + o.id).get('contentWindow.document'),"," b = d.one('body'),"," p;",""," if (c.timeout) {"," io._clearUploadTimeout(o.id);"," }",""," try {"," if (b) {"," // When a response Content-Type of \"text/plain\" is used, Firefox and Safari"," // will wrap the response string with <pre></pre>."," p = b.one('pre:first-child');"," o.c.responseText = p ? p.get('text') : b.get('text');"," }"," else {"," o.c.responseXML = d._node;"," }"," }"," catch (e) {"," o.e = \"upload failure\";"," }",""," io.complete(o, c);"," io.end(o, c);"," // The transaction is complete, so call _dFrame to remove"," // the event listener bound to the iframe transport, and then"," // destroy the iframe."," w.setTimeout( function() { _dFrame(o.id); }, 0);"," },",""," /**"," * Uploads HTML form data, inclusive of files/attachments,"," * using the iframe created in _create to facilitate the transaction."," * @method _upload"," * @private"," * @static"," * @param {Object} o The transaction object"," * @param {Object} uri Qualified path to transaction resource."," * @param {Object} c Configuration object for the transaction."," */"," _upload: function(o, uri, c) {"," var io = this,"," f = (typeof c.form.id === 'string') ? d.getElementById(c.form.id) : c.form.id,"," // Track original HTML form attribute values."," attr = {"," action: f.getAttribute('action'),"," target: f.getAttribute('target')"," },"," fields;",""," // Initialize the HTML form properties in case they are"," // not defined in the HTML form."," io._setAttrs(f, o.id, uri);"," if (c.data) {"," fields = io._addData(f, c.data);"," }",""," // Start polling if a callback is present and the timeout"," // property has been defined."," if (c.timeout) {"," io._startUploadTimeout(o, c);"," }",""," // Start file upload."," f.submit();"," io.start(o, c);"," if (c.data) {"," io._removeData(f, fields);"," }"," // Restore HTML form attributes to their original values."," io._resetAttrs(f, attr);",""," return {"," id: o.id,"," abort: function() {"," o.status = 0;"," o.statusText = 'abort';"," if (Y.one('#io_iframe' + o.id)) {"," _dFrame(o.id);"," io.complete(o, c);"," io.end(o, c);"," }"," else {"," return false;"," }"," },"," isInProgress: function() {"," return Y.one('#io_iframe' + o.id) ? true : false;"," },"," io: io"," };"," },",""," upload: function(o, uri, c) {"," _cFrame(o, c, this);"," return this._upload(o, uri, c);"," }","});","","","}, '3.7.2', {\"requires\": [\"io-base\", \"node-base\"]});"];-_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].lines = {"1":0,"11":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"33":0,"44":0,"45":0,"46":0,"49":0,"63":0,"64":0,"67":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"79":0,"92":0,"94":0,"95":0,"110":0,"111":0,"112":0,"113":0,"125":0,"126":0,"127":0,"130":0,"146":0,"148":0,"150":0,"151":0,"152":0,"153":0,"165":0,"167":0,"168":0,"181":0,"186":0,"187":0,"190":0,"191":0,"194":0,"195":0,"198":0,"202":0,"205":0,"206":0,"210":0,"224":0,"235":0,"236":0,"237":0,"242":0,"243":0,"247":0,"248":0,"249":0,"250":0,"253":0,"255":0,"258":0,"259":0,"260":0,"261":0,"262":0,"263":0,"266":0,"270":0,"277":0,"278":0};-_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].functions = {"(anonymous 2):33":0,"_cFrame:26":0,"_dFrame:44":0,"_addData:60":0,"_removeData:91":0,"_setAttrs:109":0,"(anonymous 3):125":0,"_resetAttrs:124":0,"(anonymous 4):149":0,"_startUploadTimeout:145":0,"_clearUploadTimeout:164":0,"(anonymous 5):210":0,"_uploadComplete:180":0,"abort:257":0,"isInProgress:269":0,"_upload:223":0,"upload:276":0,"(anonymous 1):1":0};-_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].coveredLines = 77;-_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].coveredFunctions = 18;+_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].code=["YUI.add('io-upload-iframe', function (Y, NAME) {","","/**","Extends the IO to enable file uploads, with HTML forms","using an iframe as the transport medium.","@module io","@submodule io-upload-iframe","@for IO","**/","","var w = Y.config.win,"," d = Y.config.doc,"," _std = (d.documentMode && d.documentMode >= 8),"," _d = decodeURIComponent,"," _end = Y.IO.prototype.end;","","/**"," * Creates the iframe transported used in file upload"," * transactions, and binds the response event handler."," *"," * @method _cFrame"," * @private"," * @param {Object} o Transaction object generated by _create()."," * @param {Object} c Configuration object passed to YUI.io()."," * @param {Object} io"," */","function _cFrame(o, c, io) {"," var i = Y.Node.create('<iframe src=\"#\" id=\"io_iframe' + o.id + '\" name=\"io_iframe' + o.id + '\" />');"," i._node.style.position = 'absolute';"," i._node.style.top = '-1000px';"," i._node.style.left = '-1000px';"," Y.one('body').appendChild(i);"," // Bind the onload handler to the iframe to detect the file upload response."," Y.on(\"load\", function() { io._uploadComplete(o, c); }, '#io_iframe' + o.id);","}","","/**"," * Removes the iframe transport used in the file upload"," * transaction."," *"," * @method _dFrame"," * @private"," * @param {Number} id The transaction ID used in the iframe's creation."," */","function _dFrame(id) {"," Y.Event.purgeElement('#io_iframe' + id, false);"," Y.one('body').removeChild(Y.one('#io_iframe' + id));","}","","Y.mix(Y.IO.prototype, {"," /**"," * Parses the POST data object and creates hidden form elements"," * for each key-value, and appends them to the HTML form object."," * @method appendData"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {String} s The key-value POST data."," * @return {Array} o Array of created fields."," */"," _addData: function(f, s) {"," // Serialize an object into a key-value string using"," // querystring-stringify-simple."," if (Y.Lang.isObject(s)) {"," s = Y.QueryString.stringify(s);"," }",""," var o = [],"," m = s.split('='),"," i, l;",""," for (i = 0, l = m.length - 1; i < l; i++) {"," o[i] = d.createElement('input');"," o[i].type = 'hidden';"," o[i].name = _d(m[i].substring(m[i].lastIndexOf('&') + 1));"," o[i].value = (i + 1 === l) ? _d(m[i + 1]) : _d(m[i + 1].substring(0, (m[i + 1].lastIndexOf('&'))));"," f.appendChild(o[i]);"," }",""," return o;"," },",""," /**"," * Removes the custom fields created to pass additional POST"," * data, along with the HTML form fields."," * @method _removeData"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} o HTML form fields created from configuration.data."," */"," _removeData: function(f, o) {"," var i, l;",""," for (i = 0, l = o.length; i < l; i++) {"," f.removeChild(o[i]);"," }"," },",""," /**"," * Sets the appropriate attributes and values to the HTML"," * form, in preparation of a file upload transaction."," * @method _setAttrs"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} id The Transaction ID."," * @param {Object} uri Qualified path to transaction resource."," */"," _setAttrs: function(f, id, uri) {"," f.setAttribute('action', uri);"," f.setAttribute('method', 'POST');"," f.setAttribute('target', 'io_iframe' + id );"," f.setAttribute(Y.UA.ie && !_std ? 'encoding' : 'enctype', 'multipart/form-data');"," },",""," /**"," * Reset the HTML form attributes to their original values."," * @method _resetAttrs"," * @private"," * @static"," * @param {Object} f HTML form object."," * @param {Object} a Object of original attributes."," */"," _resetAttrs: function(f, a) {"," Y.Object.each(a, function(v, p) {"," if (v) {"," f.setAttribute(p, v);"," }"," else {"," f.removeAttribute(p);"," }"," });"," },",""," /**"," * Starts timeout count if the configuration object"," * has a defined timeout property."," *"," * @method _startUploadTimeout"," * @private"," * @static"," * @param {Object} o Transaction object generated by _create()."," * @param {Object} c Configuration object passed to YUI.io()."," */"," _startUploadTimeout: function(o, c) {"," var io = this;",""," io._timeout[o.id] = w.setTimeout("," function() {"," o.status = 0;"," o.statusText = 'timeout';"," io.complete(o, c);"," io.end(o, c);"," }, c.timeout);"," },",""," /**"," * Clears the timeout interval started by _startUploadTimeout()."," * @method _clearUploadTimeout"," * @private"," * @static"," * @param {Number} id - Transaction ID."," */"," _clearUploadTimeout: function(id) {"," var io = this;",""," w.clearTimeout(io._timeout[id]);"," delete io._timeout[id];"," },",""," /**"," * Bound to the iframe's Load event and processes"," * the response data."," * @method _uploadComplete"," * @private"," * @static"," * @param {Object} o The transaction object"," * @param {Object} c Configuration object for the transaction."," */"," _uploadComplete: function(o, c) {"," var io = this,"," d = Y.one('#io_iframe' + o.id).get('contentWindow.document'),"," b = d.one('body'),"," p;",""," if (c.timeout) {"," io._clearUploadTimeout(o.id);"," }",""," try {"," if (b) {"," // When a response Content-Type of \"text/plain\" is used, Firefox and Safari"," // will wrap the response string with <pre></pre>."," p = b.one('pre:first-child');"," o.c.responseText = p ? p.get('text') : b.get('text');"," }"," else {"," o.c.responseXML = d._node;"," }"," }"," catch (e) {"," o.e = \"upload failure\";"," }",""," io.complete(o, c);"," io.end(o, c);"," // The transaction is complete, so call _dFrame to remove"," // the event listener bound to the iframe transport, and then"," // destroy the iframe."," w.setTimeout( function() { _dFrame(o.id); }, 0);"," },",""," /**"," * Uploads HTML form data, inclusive of files/attachments,"," * using the iframe created in _create to facilitate the transaction."," * @method _upload"," * @private"," * @static"," * @param {Object} o The transaction object"," * @param {Object} uri Qualified path to transaction resource."," * @param {Object} c Configuration object for the transaction."," */"," _upload: function(o, uri, c) {"," var io = this,"," f = (typeof c.form.id === 'string') ? d.getElementById(c.form.id) : c.form.id,"," // Track original HTML form attribute values."," attr = {"," action: f.getAttribute('action'),"," target: f.getAttribute('target')"," },"," fields;",""," // Initialize the HTML form properties in case they are"," // not defined in the HTML form."," io._setAttrs(f, o.id, uri);"," if (c.data) {"," fields = io._addData(f, c.data);"," }",""," // Start polling if a callback is present and the timeout"," // property has been defined."," if (c.timeout) {"," io._startUploadTimeout(o, c);"," }",""," // Start file upload."," f.submit();"," io.start(o, c);"," if (c.data) {"," io._removeData(f, fields);"," }",""," return {"," id: o.id,"," abort: function() {"," o.status = 0;"," o.statusText = 'abort';"," if (Y.one('#io_iframe' + o.id)) {"," _dFrame(o.id);"," io.complete(o, c);"," io.end(o, c, attr);"," }"," else {"," return false;"," }"," },"," isInProgress: function() {"," return Y.one('#io_iframe' + o.id) ? true : false;"," },"," io: io"," };"," },",""," upload: function(o, uri, c) {"," _cFrame(o, c, this);"," return this._upload(o, uri, c);"," },",""," end: function(transaction, config, attr) {"," if (config && config.form && config.form.upload) {"," var io = this;"," // Restore HTML form attributes to their original values."," io._resetAttrs(f, attr);"," }",""," return _end.call(this, transaction, config);"," }","});","","","}, '3.7.3', {\"requires\": [\"io-base\", \"node-base\"]});"];+_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].lines = {"1":0,"11":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"34":0,"45":0,"46":0,"47":0,"50":0,"64":0,"65":0,"68":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"80":0,"93":0,"95":0,"96":0,"111":0,"112":0,"113":0,"114":0,"126":0,"127":0,"128":0,"131":0,"147":0,"149":0,"151":0,"152":0,"153":0,"154":0,"166":0,"168":0,"169":0,"182":0,"187":0,"188":0,"191":0,"192":0,"195":0,"196":0,"199":0,"203":0,"206":0,"207":0,"211":0,"225":0,"236":0,"237":0,"238":0,"243":0,"244":0,"248":0,"249":0,"250":0,"251":0,"254":0,"257":0,"258":0,"259":0,"260":0,"261":0,"262":0,"265":0,"269":0,"276":0,"277":0,"281":0,"282":0,"284":0,"287":0};+_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].functions = {"(anonymous 2):34":0,"_cFrame:27":0,"_dFrame:45":0,"_addData:61":0,"_removeData:92":0,"_setAttrs:110":0,"(anonymous 3):126":0,"_resetAttrs:125":0,"(anonymous 4):150":0,"_startUploadTimeout:146":0,"_clearUploadTimeout:165":0,"(anonymous 5):211":0,"_uploadComplete:181":0,"abort:256":0,"isInProgress:268":0,"_upload:224":0,"upload:275":0,"end:280":0,"(anonymous 1):1":0};+_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].coveredLines = 80;+_yuitest_coverage["build/io-upload-iframe/io-upload-iframe.js"].coveredFunctions = 19; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 1); YUI.add('io-upload-iframe', function (Y, NAME) { /**-Extends the IO to enable file uploads, with HTML forms +Extends the IO to enable file uploads, with HTML forms using an iframe as the transport medium. @module io @submodule io-upload-iframe@@ -53,7 +53,8 @@ var w = Y.config.win, d = Y.config.doc, _std = (d.documentMode && d.documentMode >= 8),- _d = decodeURIComponent;+ _d = decodeURIComponent,+ _end = Y.IO.prototype.end; /** * Creates the iframe transported used in file upload@@ -65,43 +66,43 @@ * @param {Object} c Configuration object passed to YUI.io(). * @param {Object} io */-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 26);-function _cFrame(o, c, io) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_cFrame", 26); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 27);+function _cFrame(o, c, io) {+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_cFrame", 27);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 28); var i = Y.Node.create('<iframe src="#" id="io_iframe' + o.id + '" name="io_iframe' + o.id + '" />');- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 28);-i._node.style.position = 'absolute'; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 29);-i._node.style.top = '-1000px';+i._node.style.position = 'absolute'; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 30);-i._node.style.left = '-1000px';+i._node.style.top = '-1000px'; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 31);+i._node.style.left = '-1000px';+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 32); Y.one('body').appendChild(i); // Bind the onload handler to the iframe to detect the file upload response.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 33);-Y.on("load", function() { _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 2)", 33);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 34);+Y.on("load", function() { _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 2)", 34); io._uploadComplete(o, c); }, '#io_iframe' + o.id); } /**- * Removes the iframe transport used in the file upload + * Removes the iframe transport used in the file upload * transaction. * * @method _dFrame * @private * @param {Number} id The transaction ID used in the iframe's creation. */-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 44);-function _dFrame(id) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_dFrame", 44); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 45);+function _dFrame(id) {+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_dFrame", 45);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 46); Y.Event.purgeElement('#io_iframe' + id, false);- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 46);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 47); Y.one('body').removeChild(Y.one('#io_iframe' + id)); } -_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 49);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 50); Y.mix(Y.IO.prototype, { /** * Parses the POST data object and creates hidden form elements@@ -116,33 +117,33 @@ _addData: function(f, s) { // Serialize an object into a key-value string using // querystring-stringify-simple.- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_addData", 60);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 63);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_addData", 61);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 64); if (Y.Lang.isObject(s)) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 64);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 65); s = Y.QueryString.stringify(s); } - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 67);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 68); var o = [], m = s.split('='), i, l; - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 71);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 72); for (i = 0, l = m.length - 1; i < l; i++) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 72);-o[i] = d.createElement('input'); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 73);-o[i].type = 'hidden';+o[i] = d.createElement('input'); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 74);-o[i].name = _d(m[i].substring(m[i].lastIndexOf('&') + 1));+o[i].type = 'hidden'; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 75);-o[i].value = (i + 1 === l) ? _d(m[i + 1]) : _d(m[i + 1].substring(0, (m[i + 1].lastIndexOf('&'))));+o[i].name = _d(m[i].substring(m[i].lastIndexOf('&') + 1)); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 76);+o[i].value = (i + 1 === l) ? _d(m[i + 1]) : _d(m[i + 1].substring(0, (m[i + 1].lastIndexOf('&'))));+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 77); f.appendChild(o[i]); } - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 79);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 80); return o; }, @@ -156,13 +157,13 @@ * @param {Object} o HTML form fields created from configuration.data. */ _removeData: function(f, o) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_removeData", 91);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 92);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_removeData", 92);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 93); var i, l; - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 94);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 95); for (i = 0, l = o.length; i < l; i++) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 95);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 96); f.removeChild(o[i]); } },@@ -178,14 +179,14 @@ * @param {Object} uri Qualified path to transaction resource. */ _setAttrs: function(f, id, uri) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_setAttrs", 109);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 110);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_setAttrs", 110);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 111); f.setAttribute('action', uri);- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 111);-f.setAttribute('method', 'POST'); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 112);-f.setAttribute('target', 'io_iframe' + id );+f.setAttribute('method', 'POST'); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 113);+f.setAttribute('target', 'io_iframe' + id );+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 114); f.setAttribute(Y.UA.ie && !_std ? 'encoding' : 'enctype', 'multipart/form-data'); }, @@ -198,17 +199,17 @@ * @param {Object} a Object of original attributes. */ _resetAttrs: function(f, a) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_resetAttrs", 124);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 125);-Y.Object.each(a, function(v, p) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 3)", 125);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_resetAttrs", 125); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 126);+Y.Object.each(a, function(v, p) {+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 3)", 126);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 127); if (v) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 127);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 128); f.setAttribute(p, v); } else {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 130);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 131); f.removeAttribute(p); } });@@ -225,21 +226,21 @@ * @param {Object} c Configuration object passed to YUI.io(). */ _startUploadTimeout: function(o, c) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_startUploadTimeout", 145);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 146);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_startUploadTimeout", 146);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 147); var io = this; - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 148);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 149); io._timeout[o.id] = w.setTimeout( function() {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 4)", 149);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 150);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 4)", 150);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 151); o.status = 0;- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 151);-o.statusText = 'timeout'; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 152);-io.complete(o, c);+o.statusText = 'timeout'; _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 153);+io.complete(o, c);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 154); io.end(o, c); }, c.timeout); },@@ -252,13 +253,13 @@ * @param {Number} id - Transaction ID. */ _clearUploadTimeout: function(id) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_clearUploadTimeout", 164);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 165);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_clearUploadTimeout", 165);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 166); var io = this; - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 167);-w.clearTimeout(io._timeout[id]); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 168);+w.clearTimeout(io._timeout[id]);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 169); delete io._timeout[id]; }, @@ -272,49 +273,49 @@ * @param {Object} c Configuration object for the transaction. */ _uploadComplete: function(o, c) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_uploadComplete", 180);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 181);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_uploadComplete", 181);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 182); var io = this, d = Y.one('#io_iframe' + o.id).get('contentWindow.document'), b = d.one('body'), p; - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 186);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 187); if (c.timeout) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 187);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 188); io._clearUploadTimeout(o.id); } - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 190);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 191); try {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 191);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 192); if (b) { // When a response Content-Type of "text/plain" is used, Firefox and Safari // will wrap the response string with <pre></pre>.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 194);-p = b.one('pre:first-child'); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 195);+p = b.one('pre:first-child');+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 196); o.c.responseText = p ? p.get('text') : b.get('text'); } else {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 198);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 199); o.c.responseXML = d._node; } } catch (e) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 202);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 203); o.e = "upload failure"; } - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 205);-io.complete(o, c); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 206);+io.complete(o, c);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 207); io.end(o, c); // The transaction is complete, so call _dFrame to remove // the event listener bound to the iframe transport, and then // destroy the iframe.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 210);-w.setTimeout( function() { _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 5)", 210);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 211);+w.setTimeout( function() { _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "(anonymous 5)", 211); _dFrame(o.id); }, 0); }, @@ -329,8 +330,8 @@ * @param {Object} c Configuration object for the transaction. */ _upload: function(o, uri, c) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_upload", 223);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 224);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "_upload", 224);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 225); var io = this, f = (typeof c.form.id === 'string') ? d.getElementById(c.form.id) : c.form.id, // Track original HTML form attribute values.@@ -342,62 +343,59 @@ // Initialize the HTML form properties in case they are // not defined in the HTML form.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 235);-io._setAttrs(f, o.id, uri); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 236);+io._setAttrs(f, o.id, uri);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 237); if (c.data) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 237);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 238); fields = io._addData(f, c.data); } // Start polling if a callback is present and the timeout // property has been defined.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 242);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 243); if (c.timeout) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 243);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 244); io._startUploadTimeout(o, c); } // Start file upload.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 247);-f.submit(); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 248);-io.start(o, c);+f.submit(); _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 249);+io.start(o, c);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 250); if (c.data) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 250);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 251); io._removeData(f, fields); }- // Restore HTML form attributes to their original values.- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 253);-io._resetAttrs(f, attr); - _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 255);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 254); return { id: o.id, abort: function() {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "abort", 257);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 258);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "abort", 256);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 257); o.status = 0;- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 259);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 258); o.statusText = 'abort';- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 260);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 259); if (Y.one('#io_iframe' + o.id)) {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 261);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 260); _dFrame(o.id);- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 262);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 261); io.complete(o, c);- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 263);-io.end(o, c);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 262);+io.end(o, c, attr); } else {- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 266);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 265); return false; } }, isInProgress: function() {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "isInProgress", 269);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 270);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "isInProgress", 268);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 269); return Y.one('#io_iframe' + o.id) ? true : false; }, io: io@@ -405,13 +403,28 @@ }, upload: function(o, uri, c) {- _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "upload", 276);-_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 277);+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "upload", 275);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 276); _cFrame(o, c, this);- _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 278);+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 277); return this._upload(o, uri, c);+ },++ end: function(transaction, config, attr) {+ _yuitest_coverfunc("build/io-upload-iframe/io-upload-iframe.js", "end", 280);+_yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 281);+if (config && config.form && config.form.upload) {+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 282);+var io = this;+ // Restore HTML form attributes to their original values.+ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 284);+io._resetAttrs(f, attr);+ }++ _yuitest_coverline("build/io-upload-iframe/io-upload-iframe.js", 287);+return _end.call(this, transaction, config); } }); -}, '3.7.2', {"requires": ["io-base", "node-base"]});+}, '3.7.3', {"requires": ["io-base", "node-base"]});
bundle/io-upload-iframe/io-upload-iframe-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -7,7 +7,7 @@ YUI.add('io-upload-iframe', function (Y, NAME) { /**-Extends the IO to enable file uploads, with HTML forms +Extends the IO to enable file uploads, with HTML forms using an iframe as the transport medium. @module io @submodule io-upload-iframe@@ -17,7 +17,8 @@ var w = Y.config.win, d = Y.config.doc, _std = (d.documentMode && d.documentMode >= 8),- _d = decodeURIComponent;+ _d = decodeURIComponent,+ _end = Y.IO.prototype.end; /** * Creates the iframe transported used in file upload@@ -40,7 +41,7 @@ } /**- * Removes the iframe transport used in the file upload + * Removes the iframe transport used in the file upload * transaction. * * @method _dFrame@@ -261,8 +262,6 @@ if (c.data) { io._removeData(f, fields); }- // Restore HTML form attributes to their original values.- io._resetAttrs(f, attr); return { id: o.id,@@ -272,7 +271,7 @@ if (Y.one('#io_iframe' + o.id)) { _dFrame(o.id); io.complete(o, c);- io.end(o, c);+ io.end(o, c, attr); Y.log('Transaction ' + o.id + ' aborted.', 'info', 'io'); } else {@@ -290,8 +289,18 @@ upload: function(o, uri, c) { _cFrame(o, c, this); return this._upload(o, uri, c);+ },++ end: function(transaction, config, attr) {+ if (config && config.form && config.form.upload) {+ var io = this;+ // Restore HTML form attributes to their original values.+ io._resetAttrs(f, attr);+ }++ return _end.call(this, transaction, config); } }); -}, '3.7.2', {"requires": ["io-base", "node-base"]});+}, '3.7.3', {"requires": ["io-base", "node-base"]});
bundle/io-upload-iframe/io-upload-iframe-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("io-upload-iframe",function(e,t){function o(t,n,r){var i=e.Node.create('<iframe src="#" id="io_iframe'+t.id+'" name="io_iframe'+t.id+'" />');i._node.style.position="absolute",i._node.style.top="-1000px",i._node.style.left="-1000px",e.one("body").appendChild(i),e.on("load",function(){r._uploadComplete(t,n)},"#io_iframe"+t.id)}function u(t){e.Event.purgeElement("#io_iframe"+t,!1),e.one("body").removeChild(e.one("#io_iframe"+t))}var n=e.config.win,r=e.config.doc,i=r.documentMode&&r.documentMode>=8,s=decodeURIComponent;e.mix(e.IO.prototype,{_addData:function(t,n){e.Lang.isObject(n)&&(n=e.QueryString.stringify(n));var i=[],o=n.split("="),u,a;for(u=0,a=o.length-1;u<a;u++)i[u]=r.createElement("input"),i[u].type="hidden",i[u].name=s(o[u].substring(o[u].lastIndexOf("&")+1)),i[u].value=u+1===a?s(o[u+1]):s(o[u+1].substring(0,o[u+1].lastIndexOf("&"))),t.appendChild(i[u]);return i},_removeData:function(e,t){var n,r;for(n=0,r=t.length;n<r;n++)e.removeChild(t[n])},_setAttrs:function(t,n,r){t.setAttribute("action",r),t.setAttribute("method","POST"),t.setAttribute("target","io_iframe"+n),t.setAttribute(e.UA.ie&&!i?"encoding":"enctype","multipart/form-data")},_resetAttrs:function(t,n){e.Object.each(n,function(e,n){e?t.setAttribute(n,e):t.removeAttribute(n)})},_startUploadTimeout:function(e,t){var r=this;r._timeout[e.id]=n.setTimeout(function(){e.status=0,e.statusText="timeout",r.complete(e,t),r.end(e,t)},t.timeout)},_clearUploadTimeout:function(e){var t=this;n.clearTimeout(t._timeout[e]),delete t._timeout[e]},_uploadComplete:function(t,r){var i=this,s=e.one("#io_iframe"+t.id).get("contentWindow.document"),o=s.one("body"),a;r.timeout&&i._clearUploadTimeout(t.id);try{o?(a=o.one("pre:first-child"),t.c.responseText=a?a.get("text"):o.get("text")):t.c.responseXML=s._node}catch(f){t.e="upload failure"}i.complete(t,r),i.end(t,r),n.setTimeout(function(){u(t.id)},0)},_upload:function(t,n,i){var s=this,o=typeof i.form.id=="string"?r.getElementById(i.form.id):i.form.id,a={action:o.getAttribute("action"),target:o.getAttribute("target")},f;return s._setAttrs(o,t.id,n),i.data&&(f=s._addData(o,i.data)),i.timeout&&s._startUploadTimeout(t,i),o.submit(),s.start(t,i),i.data&&s._removeData(o,f),s._resetAttrs(o,a),{id:t.id,abort:function(){t.status=0,t.statusText="abort";if(!e.one("#io_iframe"+t.id))return!1;u(t.id),s.complete(t,i),s.end(t,i)},isInProgress:function(){return e.one("#io_iframe"+t.id)?!0:!1},io:s}},upload:function(e,t,n){return o(e,n,this),this._upload(e,t,n)}})},"3.7.2",{requires:["io-base","node-base"]});+YUI.add("io-upload-iframe",function(e,t){function u(t,n,r){var i=e.Node.create('<iframe src="#" id="io_iframe'+t.id+'" name="io_iframe'+t.id+'" />');i._node.style.position="absolute",i._node.style.top="-1000px",i._node.style.left="-1000px",e.one("body").appendChild(i),e.on("load",function(){r._uploadComplete(t,n)},"#io_iframe"+t.id)}function a(t){e.Event.purgeElement("#io_iframe"+t,!1),e.one("body").removeChild(e.one("#io_iframe"+t))}var n=e.config.win,r=e.config.doc,i=r.documentMode&&r.documentMode>=8,s=decodeURIComponent,o=e.IO.prototype.end;e.mix(e.IO.prototype,{_addData:function(t,n){e.Lang.isObject(n)&&(n=e.QueryString.stringify(n));var i=[],o=n.split("="),u,a;for(u=0,a=o.length-1;u<a;u++)i[u]=r.createElement("input"),i[u].type="hidden",i[u].name=s(o[u].substring(o[u].lastIndexOf("&")+1)),i[u].value=u+1===a?s(o[u+1]):s(o[u+1].substring(0,o[u+1].lastIndexOf("&"))),t.appendChild(i[u]);return i},_removeData:function(e,t){var n,r;for(n=0,r=t.length;n<r;n++)e.removeChild(t[n])},_setAttrs:function(t,n,r){t.setAttribute("action",r),t.setAttribute("method","POST"),t.setAttribute("target","io_iframe"+n),t.setAttribute(e.UA.ie&&!i?"encoding":"enctype","multipart/form-data")},_resetAttrs:function(t,n){e.Object.each(n,function(e,n){e?t.setAttribute(n,e):t.removeAttribute(n)})},_startUploadTimeout:function(e,t){var r=this;r._timeout[e.id]=n.setTimeout(function(){e.status=0,e.statusText="timeout",r.complete(e,t),r.end(e,t)},t.timeout)},_clearUploadTimeout:function(e){var t=this;n.clearTimeout(t._timeout[e]),delete t._timeout[e]},_uploadComplete:function(t,r){var i=this,s=e.one("#io_iframe"+t.id).get("contentWindow.document"),o=s.one("body"),u;r.timeout&&i._clearUploadTimeout(t.id);try{o?(u=o.one("pre:first-child"),t.c.responseText=u?u.get("text"):o.get("text")):t.c.responseXML=s._node}catch(f){t.e="upload failure"}i.complete(t,r),i.end(t,r),n.setTimeout(function(){a(t.id)},0)},_upload:function(t,n,i){var s=this,o=typeof i.form.id=="string"?r.getElementById(i.form.id):i.form.id,u={action:o.getAttribute("action"),target:o.getAttribute("target")},f;return s._setAttrs(o,t.id,n),i.data&&(f=s._addData(o,i.data)),i.timeout&&s._startUploadTimeout(t,i),o.submit(),s.start(t,i),i.data&&s._removeData(o,f),{id:t.id,abort:function(){t.status=0,t.statusText="abort";if(!e.one("#io_iframe"+t.id))return!1;a(t.id),s.complete(t,i),s.end(t,i,u)},isInProgress:function(){return e.one("#io_iframe"+t.id)?!0:!1},io:s}},upload:function(e,t,n){return u(e,n,this),this._upload(e,t,n)},end:function(e,t,n){if(t&&t.form&&t.form.upload){var r=this;r._resetAttrs(f,n)}return o.call(this,e,t)}})},"3.7.3",{requires:["io-base","node-base"]});
bundle/io-upload-iframe/io-upload-iframe.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -7,7 +7,7 @@ YUI.add('io-upload-iframe', function (Y, NAME) { /**-Extends the IO to enable file uploads, with HTML forms +Extends the IO to enable file uploads, with HTML forms using an iframe as the transport medium. @module io @submodule io-upload-iframe@@ -17,7 +17,8 @@ var w = Y.config.win, d = Y.config.doc, _std = (d.documentMode && d.documentMode >= 8),- _d = decodeURIComponent;+ _d = decodeURIComponent,+ _end = Y.IO.prototype.end; /** * Creates the iframe transported used in file upload@@ -40,7 +41,7 @@ } /**- * Removes the iframe transport used in the file upload + * Removes the iframe transport used in the file upload * transaction. * * @method _dFrame@@ -255,8 +256,6 @@ if (c.data) { io._removeData(f, fields); }- // Restore HTML form attributes to their original values.- io._resetAttrs(f, attr); return { id: o.id,@@ -266,7 +265,7 @@ if (Y.one('#io_iframe' + o.id)) { _dFrame(o.id); io.complete(o, c);- io.end(o, c);+ io.end(o, c, attr); } else { return false;@@ -282,8 +281,18 @@ upload: function(o, uri, c) { _cFrame(o, c, this); return this._upload(o, uri, c);+ },++ end: function(transaction, config, attr) {+ if (config && config.form && config.form.upload) {+ var io = this;+ // Restore HTML form attributes to their original values.+ io._resetAttrs(f, attr);+ }++ return _end.call(this, transaction, config); } }); -}, '3.7.2', {"requires": ["io-base", "node-base"]});+}, '3.7.3', {"requires": ["io-base", "node-base"]});
bundle/io-xdr/io-xdr-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/io-xdr/io-xdr.js", code: [] };-_yuitest_coverage["build/io-xdr/io-xdr.js"].code=["YUI.add('io-xdr', function (Y, NAME) {","","/**","Extends IO to provide an alternate, Flash transport, for making","cross-domain requests.","@module io","@submodule io-xdr","@for IO","**/","","/**","Fires when the XDR transport is ready for use.","@event io:xdrReady","**/","var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),","","/**","Map of stored configuration objects when using","Flash as the transport for cross-domain requests.","","@property _cB","@private","@type {Object}","**/","_cB = {},","","/**","Map of transaction simulated readyState values","when XDomainRequest is the transport.","","@property _rS","@private","@type {Object}","**/","_rS = {},","","// Document reference","d = Y.config.doc,","// Window reference","w = Y.config.win,","// XDomainRequest cross-origin request detection","xdr = w && w.XDomainRequest;","","/**","Method that creates the Flash transport swf.","","@method _swf","@private","@param {String} uri - location of io.swf.","@param {String} yid - YUI sandbox id.","@param {String} yid - IO instance id.","**/","function _swf(uri, yid, uid) {"," var o = '<object id=\"io_swf\" type=\"application/x-shockwave-flash\" data=\"' +"," uri + '\" width=\"0\" height=\"0\">' +"," '<param name=\"movie\" value=\"' + uri + '\">' +"," '<param name=\"FlashVars\" value=\"yid=' + yid + '&uid=' + uid + '\">' +"," '<param name=\"allowScriptAccess\" value=\"always\">' +"," '</object>',"," c = d.createElement('div');",""," d.body.appendChild(c);"," c.innerHTML = o;","}","","/**","Creates a response object for XDR transactions, for success","and failure cases.","","@method _data","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Boolean} u - Configuration xdr.use.","@param {Boolean} d - Configuration xdr.dataType.","","@return {Object}","**/","function _data(o, u, d) {"," if (u === 'flash') {"," o.c.responseText = decodeURI(o.c.responseText);"," }"," if (d === 'xml') {"," o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);"," }",""," return o;","}","","/**","Method for intiating an XDR transaction abort.","","@method _abort","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Object} c - configuration object for the transaction.","**/","function _abort(o, c) {"," return o.c.abort(o.id, c);","}","","/**","Method for determining if an XDR transaction has completed","and all data are received.","","@method _isInProgress","@private","@param {Object} o - Transaction object generated by _create() in io-base.","**/","function _isInProgress(o) {"," return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);","}","","Y.mix(Y.IO.prototype, {",""," /**"," Map of io transports.",""," @property _transport"," @private"," @type {Object}"," **/"," _transport: {},",""," /**"," Sets event handlers for XDomainRequest transactions.",""," @method _ieEvt"," @private"," @static"," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," _ieEvt: function(o, c) {"," var io = this,"," i = o.id,"," t = 'timeout';",""," o.c.onprogress = function() { _rS[i] = 3; };"," o.c.onload = function() {"," _rS[i] = 4;"," io.xdrResponse('success', o, c);"," };"," o.c.onerror = function() {"," _rS[i] = 4;"," io.xdrResponse('failure', o, c);"," };"," if (c[t]) {"," o.c.ontimeout = function() {"," _rS[i] = 4;"," io.xdrResponse(t, o, c);"," };"," o.c[t] = c[t];"," }"," },",""," /**"," Method for accessing the transport's interface for making a"," cross-domain transaction.",""," @method xdr"," @param {String} uri - qualified path to transaction resource."," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," xdr: function(uri, o, c) {"," var io = this;",""," if (c.xdr.use === 'flash') {"," // The configuration object cannot be serialized safely"," // across Flash's ExternalInterface."," _cB[o.id] = c;"," w.setTimeout(function() {"," try {"," o.c.send(uri, { id: o.id,"," uid: o.uid,"," method: c.method,"," data: c.data,"," headers: c.headers });"," }"," catch(e) {"," io.xdrResponse('transport error', o, c);"," delete _cB[o.id];"," }"," }, Y.io.xdr.delay);"," }"," else if (xdr) {"," io._ieEvt(o, c);"," o.c.open(c.method || 'GET', uri);"," o.c.send(c.data);"," }"," else {"," o.c.send(uri, o, c);"," }",""," return {"," id: o.id,"," abort: function() {"," return o.c ? _abort(o, c) : false;"," },"," isInProgress: function() {"," return o.c ? _isInProgress(o.id) : false;"," },"," io: io"," };"," },",""," /**"," Response controller for cross-domain requests when using the"," Flash transport or IE8's XDomainRequest object.",""," @method xdrResponse"," @param {String} e Event name"," @param {Object} o Transaction object generated by _create() in io-base."," @param {Object} c Configuration object for the transaction."," @return {Object}"," **/"," xdrResponse: function(e, o, c) {"," c = _cB[o.id] ? _cB[o.id] : c;"," var io = this,"," m = xdr ? _rS : _cB,"," u = c.xdr.use,"," d = c.xdr.dataType;",""," switch (e) {"," case 'start':"," io.start(o, c);"," break;"," //case 'complete':"," //This case is not used by Flash or XDomainRequest."," //io.complete(o, c);"," //break;"," case 'success':"," io.success(_data(o, u, d), c);"," delete m[o.id];"," break;"," case 'timeout':"," case 'abort':"," case 'transport error':"," o.c = { status: 0, statusText: e };"," case 'failure':"," io.failure(_data(o, u, d), c);"," delete m[o.id];"," break;"," }"," },",""," /**"," Fires event \"io:xdrReady\"",""," @method _xdrReady"," @private"," @param {Number} yid - YUI sandbox id."," @param {Number} uid - IO instance id."," **/"," _xdrReady: function(yid, uid) {"," Y.fire(E_XDR_READY, yid, uid);"," },",""," /**"," Initializes the desired transport.",""," @method transport"," @param {Object} o - object of transport configurations."," **/"," transport: function(c) {"," if (c.id === 'flash') {"," _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);"," Y.IO.transports.flash = function() { return d.getElementById('io_swf'); };"," }"," }","});","","/**","Fires event \"io:xdrReady\"","","@method xdrReady","@protected","@static","@param {Number} yid - YUI sandbox id.","@param {Number} uid - IO instance id.","**/","Y.io.xdrReady = function(yid, uid){"," var io = Y.io._map[uid];"," Y.io.xdr.delay = 0;"," io._xdrReady.apply(io, [yid, uid]);","};","","Y.io.xdrResponse = function(e, o, c){"," var io = Y.io._map[o.uid];"," io.xdrResponse.apply(io, [e, o, c]);","};","","Y.io.transport = function(c){"," var io = Y.io._map['io:0'] || new Y.IO();"," c.uid = io._uid;"," io.transport.apply(io, [c]);","};","","/**","Delay value to calling the Flash transport, in the","event io.swf has not finished loading. Once the E_XDR_READY","event is fired, this value will be set to 0.","","@property delay","@static","@type {Number}","**/","Y.io.xdr = { delay : 100 };","","","}, '3.7.2', {\"requires\": [\"io-base\", \"datatype-xml-parse\"]});"];+_yuitest_coverage["build/io-xdr/io-xdr.js"].code=["YUI.add('io-xdr', function (Y, NAME) {","","/**","Extends IO to provide an alternate, Flash transport, for making","cross-domain requests.","@module io","@submodule io-xdr","@for IO","**/","","/**","Fires when the XDR transport is ready for use.","@event io:xdrReady","**/","var E_XDR_READY = Y.publish('io:xdrReady', { fireOnce: true }),","","/**","Map of stored configuration objects when using","Flash as the transport for cross-domain requests.","","@property _cB","@private","@type {Object}","**/","_cB = {},","","/**","Map of transaction simulated readyState values","when XDomainRequest is the transport.","","@property _rS","@private","@type {Object}","**/","_rS = {},","","// Document reference","d = Y.config.doc,","// Window reference","w = Y.config.win,","// XDomainRequest cross-origin request detection","xdr = w && w.XDomainRequest;","","/**","Method that creates the Flash transport swf.","","@method _swf","@private","@param {String} uri - location of io.swf.","@param {String} yid - YUI sandbox id.","@param {String} yid - IO instance id.","**/","function _swf(uri, yid, uid) {"," var o = '<object id=\"io_swf\" type=\"application/x-shockwave-flash\" data=\"' +"," uri + '\" width=\"0\" height=\"0\">' +"," '<param name=\"movie\" value=\"' + uri + '\">' +"," '<param name=\"FlashVars\" value=\"yid=' + yid + '&uid=' + uid + '\">' +"," '<param name=\"allowScriptAccess\" value=\"always\">' +"," '</object>',"," c = d.createElement('div');",""," d.body.appendChild(c);"," c.innerHTML = o;","}","","/**","Creates a response object for XDR transactions, for success","and failure cases.","","@method _data","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Boolean} u - Configuration xdr.use.","@param {Boolean} d - Configuration xdr.dataType.","","@return {Object}","**/","function _data(o, u, d) {"," if (u === 'flash') {"," o.c.responseText = decodeURI(o.c.responseText);"," }"," if (d === 'xml') {"," o.c.responseXML = Y.DataType.XML.parse(o.c.responseText);"," }",""," return o;","}","","/**","Method for intiating an XDR transaction abort.","","@method _abort","@private","@param {Object} o - Transaction object generated by _create() in io-base.","@param {Object} c - configuration object for the transaction.","**/","function _abort(o, c) {"," return o.c.abort(o.id, c);","}","","/**","Method for determining if an XDR transaction has completed","and all data are received.","","@method _isInProgress","@private","@param {Object} o - Transaction object generated by _create() in io-base.","**/","function _isInProgress(o) {"," return xdr ? _rS[o.id] !== 4 : o.c.isInProgress(o.id);","}","","Y.mix(Y.IO.prototype, {",""," /**"," Map of io transports.",""," @property _transport"," @private"," @type {Object}"," **/"," _transport: {},",""," /**"," Sets event handlers for XDomainRequest transactions.",""," @method _ieEvt"," @private"," @static"," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," _ieEvt: function(o, c) {"," var io = this,"," i = o.id,"," t = 'timeout';",""," o.c.onprogress = function() { _rS[i] = 3; };"," o.c.onload = function() {"," _rS[i] = 4;"," io.xdrResponse('success', o, c);"," };"," o.c.onerror = function() {"," _rS[i] = 4;"," io.xdrResponse('failure', o, c);"," };"," if (c[t]) {"," o.c.ontimeout = function() {"," _rS[i] = 4;"," io.xdrResponse(t, o, c);"," };"," o.c[t] = c[t];"," }"," },",""," /**"," Method for accessing the transport's interface for making a"," cross-domain transaction.",""," @method xdr"," @param {String} uri - qualified path to transaction resource."," @param {Object} o - Transaction object generated by _create() in io-base."," @param {Object} c - configuration object for the transaction."," **/"," xdr: function(uri, o, c) {"," var io = this;",""," if (c.xdr.use === 'flash') {"," // The configuration object cannot be serialized safely"," // across Flash's ExternalInterface."," _cB[o.id] = c;"," w.setTimeout(function() {"," try {"," o.c.send(uri, { id: o.id,"," uid: o.uid,"," method: c.method,"," data: c.data,"," headers: c.headers });"," }"," catch(e) {"," io.xdrResponse('transport error', o, c);"," delete _cB[o.id];"," }"," }, Y.io.xdr.delay);"," }"," else if (xdr) {"," io._ieEvt(o, c);"," o.c.open(c.method || 'GET', uri);"," o.c.send(c.data);"," }"," else {"," o.c.send(uri, o, c);"," }",""," return {"," id: o.id,"," abort: function() {"," return o.c ? _abort(o, c) : false;"," },"," isInProgress: function() {"," return o.c ? _isInProgress(o.id) : false;"," },"," io: io"," };"," },",""," /**"," Response controller for cross-domain requests when using the"," Flash transport or IE8's XDomainRequest object.",""," @method xdrResponse"," @param {String} e Event name"," @param {Object} o Transaction object generated by _create() in io-base."," @param {Object} c Configuration object for the transaction."," @return {Object}"," **/"," xdrResponse: function(e, o, c) {"," c = _cB[o.id] ? _cB[o.id] : c;"," var io = this,"," m = xdr ? _rS : _cB,"," u = c.xdr.use,"," d = c.xdr.dataType;",""," switch (e) {"," case 'start':"," io.start(o, c);"," break;"," //case 'complete':"," //This case is not used by Flash or XDomainRequest."," //io.complete(o, c);"," //break;"," case 'success':"," io.success(_data(o, u, d), c);"," delete m[o.id];"," break;"," case 'timeout':"," case 'abort':"," case 'transport error':"," o.c = { status: 0, statusText: e };"," case 'failure':"," io.failure(_data(o, u, d), c);"," delete m[o.id];"," break;"," }"," },",""," /**"," Fires event \"io:xdrReady\"",""," @method _xdrReady"," @private"," @param {Number} yid - YUI sandbox id."," @param {Number} uid - IO instance id."," **/"," _xdrReady: function(yid, uid) {"," Y.fire(E_XDR_READY, yid, uid);"," },",""," /**"," Initializes the desired transport.",""," @method transport"," @param {Object} o - object of transport configurations."," **/"," transport: function(c) {"," if (c.id === 'flash') {"," _swf(Y.UA.ie ? c.src + '?d=' + new Date().valueOf().toString() : c.src, Y.id, c.uid);"," Y.IO.transports.flash = function() { return d.getElementById('io_swf'); };"," }"," }","});","","/**","Fires event \"io:xdrReady\"","","@method xdrReady","@protected","@static","@param {Number} yid - YUI sandbox id.","@param {Number} uid - IO instance id.","**/","Y.io.xdrReady = function(yid, uid){"," var io = Y.io._map[uid];"," Y.io.xdr.delay = 0;"," io._xdrReady.apply(io, [yid, uid]);","};","","Y.io.xdrResponse = function(e, o, c){"," var io = Y.io._map[o.uid];"," io.xdrResponse.apply(io, [e, o, c]);","};","","Y.io.transport = function(c){"," var io = Y.io._map['io:0'] || new Y.IO();"," c.uid = io._uid;"," io.transport.apply(io, [c]);","};","","/**","Delay value to calling the Flash transport, in the","event io.swf has not finished loading. Once the E_XDR_READY","event is fired, this value will be set to 0.","","@property delay","@static","@type {Number}","**/","Y.io.xdr = { delay : 100 };","","","}, '3.7.3', {\"requires\": [\"io-base\", \"datatype-xml-parse\"]});"]; _yuitest_coverage["build/io-xdr/io-xdr.js"].lines = {"1":0,"15":0,"53":0,"54":0,"62":0,"63":0,"78":0,"79":0,"80":0,"82":0,"83":0,"86":0,"97":0,"98":0,"109":0,"110":0,"113":0,"134":0,"138":0,"139":0,"140":0,"141":0,"143":0,"144":0,"145":0,"147":0,"148":0,"149":0,"150":0,"152":0,"166":0,"168":0,"171":0,"172":0,"173":0,"174":0,"181":0,"182":0,"186":0,"187":0,"188":0,"189":0,"192":0,"195":0,"198":0,"201":0,"218":0,"219":0,"224":0,"226":0,"227":0,"233":0,"234":0,"235":0,"239":0,"241":0,"242":0,"243":0,"256":0,"266":0,"267":0,"268":0,"282":0,"283":0,"284":0,"285":0,"288":0,"289":0,"290":0,"293":0,"294":0,"295":0,"296":0,"308":0}; _yuitest_coverage["build/io-xdr/io-xdr.js"].functions = {"_swf:53":0,"_data:78":0,"_abort:97":0,"_isInProgress:109":0,"onprogress:138":0,"onload:139":0,"onerror:143":0,"ontimeout:148":0,"_ieEvt:133":0,"(anonymous 2):172":0,"abort:197":0,"isInProgress:200":0,"xdr:165":0,"xdrResponse:217":0,"_xdrReady:255":0,"flash:268":0,"transport:265":0,"xdrReady:282":0,"xdrResponse:288":0,"transport:293":0,"(anonymous 1):1":0}; _yuitest_coverage["build/io-xdr/io-xdr.js"].coveredLines = 74;@@ -442,4 +442,4 @@ Y.io.xdr = { delay : 100 }; -}, '3.7.2', {"requires": ["io-base", "datatype-xml-parse"]});+}, '3.7.3', {"requires": ["io-base", "datatype-xml-parse"]});
bundle/io-xdr/io-xdr-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -314,4 +314,4 @@ Y.io.xdr = { delay : 100 }; -}, '3.7.2', {"requires": ["io-base", "datatype-xml-parse"]});+}, '3.7.3', {"requires": ["io-base", "datatype-xml-parse"]});
bundle/io-xdr/io-xdr-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("io-xdr",function(e,t){function a(e,t,n){var r='<object id="io_swf" type="application/x-shockwave-flash" data="'+e+'" width="0" height="0">'+'<param name="movie" value="'+e+'">'+'<param name="FlashVars" value="yid='+t+"&uid="+n+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",i=s.createElement("div");s.body.appendChild(i),i.innerHTML=r}function f(t,n,r){return n==="flash"&&(t.c.responseText=decodeURI(t.c.responseText)),r==="xml"&&(t.c.responseXML=e.DataType.XML.parse(t.c.responseText)),t}function l(e,t){return e.c.abort(e.id,t)}function c(e){return u?i[e.id]!==4:e.c.isInProgress(e.id)}var n=e.publish("io:xdrReady",{fireOnce:!0}),r={},i={},s=e.config.doc,o=e.config.win,u=o&&o.XDomainRequest;e.mix(e.IO.prototype,{_transport:{},_ieEvt:function(e,t){var n=this,r=e.id,s="timeout";e.c.onprogress=function(){i[r]=3},e.c.onload=function(){i[r]=4,n.xdrResponse("success",e,t)},e.c.onerror=function(){i[r]=4,n.xdrResponse("failure",e,t)},t[s]&&(e.c.ontimeout=function(){i[r]=4,n.xdrResponse(s,e,t)},e.c[s]=t[s])},xdr:function(t,n,i){var s=this;return i.xdr.use==="flash"?(r[n.id]=i,o.setTimeout(function(){try{n.c.send(t,{id:n.id,uid:n.uid,method:i.method,data:i.data,headers:i.headers})}catch(e){s.xdrResponse("transport error",n,i),delete r[n.id]}},e.io.xdr.delay)):u?(s._ieEvt(n,i),n.c.open(i.method||"GET",t),n.c.send(i.data)):n.c.send(t,n,i),{id:n.id,abort:function(){return n.c?l(n,i):!1},isInProgress:function(){return n.c?c(n.id):!1},io:s}},xdrResponse:function(e,t,n){n=r[t.id]?r[t.id]:n;var s=this,o=u?i:r,a=n.xdr.use,l=n.xdr.dataType;switch(e){case"start":s.start(t,n);break;case"success":s.success(f(t,a,l),n),delete o[t.id];break;case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e};case"failure":s.failure(f(t,a,l),n),delete o[t.id]}},_xdrReady:function(t,r){e.fire(n,t,r)},transport:function(t){t.id==="flash"&&(a(e.UA.ie?t.src+"?d="+(new Date).valueOf().toString():t.src,e.id,t.uid),e.IO.transports.flash=function(){return s.getElementById("io_swf")})}}),e.io.xdrReady=function(t,n){var r=e.io._map[n];e.io.xdr.delay=0,r._xdrReady.apply(r,[t,n])},e.io.xdrResponse=function(t,n,r){var i=e.io._map[n.uid];i.xdrResponse.apply(i,[t,n,r])},e.io.transport=function(t){var n=e.io._map["io:0"]||new e.IO;t.uid=n._uid,n.transport.apply(n,[t])},e.io.xdr={delay:100}},"3.7.2",{requires:["io-base","datatype-xml-parse"]});+YUI.add("io-xdr",function(e,t){function a(e,t,n){var r='<object id="io_swf" type="application/x-shockwave-flash" data="'+e+'" width="0" height="0">'+'<param name="movie" value="'+e+'">'+'<param name="FlashVars" value="yid='+t+"&uid="+n+'">'+'<param name="allowScriptAccess" value="always">'+"</object>",i=s.createElement("div");s.body.appendChild(i),i.innerHTML=r}function f(t,n,r){return n==="flash"&&(t.c.responseText=decodeURI(t.c.responseText)),r==="xml"&&(t.c.responseXML=e.DataType.XML.parse(t.c.responseText)),t}function l(e,t){return e.c.abort(e.id,t)}function c(e){return u?i[e.id]!==4:e.c.isInProgress(e.id)}var n=e.publish("io:xdrReady",{fireOnce:!0}),r={},i={},s=e.config.doc,o=e.config.win,u=o&&o.XDomainRequest;e.mix(e.IO.prototype,{_transport:{},_ieEvt:function(e,t){var n=this,r=e.id,s="timeout";e.c.onprogress=function(){i[r]=3},e.c.onload=function(){i[r]=4,n.xdrResponse("success",e,t)},e.c.onerror=function(){i[r]=4,n.xdrResponse("failure",e,t)},t[s]&&(e.c.ontimeout=function(){i[r]=4,n.xdrResponse(s,e,t)},e.c[s]=t[s])},xdr:function(t,n,i){var s=this;return i.xdr.use==="flash"?(r[n.id]=i,o.setTimeout(function(){try{n.c.send(t,{id:n.id,uid:n.uid,method:i.method,data:i.data,headers:i.headers})}catch(e){s.xdrResponse("transport error",n,i),delete r[n.id]}},e.io.xdr.delay)):u?(s._ieEvt(n,i),n.c.open(i.method||"GET",t),n.c.send(i.data)):n.c.send(t,n,i),{id:n.id,abort:function(){return n.c?l(n,i):!1},isInProgress:function(){return n.c?c(n.id):!1},io:s}},xdrResponse:function(e,t,n){n=r[t.id]?r[t.id]:n;var s=this,o=u?i:r,a=n.xdr.use,l=n.xdr.dataType;switch(e){case"start":s.start(t,n);break;case"success":s.success(f(t,a,l),n),delete o[t.id];break;case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e};case"failure":s.failure(f(t,a,l),n),delete o[t.id]}},_xdrReady:function(t,r){e.fire(n,t,r)},transport:function(t){t.id==="flash"&&(a(e.UA.ie?t.src+"?d="+(new Date).valueOf().toString():t.src,e.id,t.uid),e.IO.transports.flash=function(){return s.getElementById("io_swf")})}}),e.io.xdrReady=function(t,n){var r=e.io._map[n];e.io.xdr.delay=0,r._xdrReady.apply(r,[t,n])},e.io.xdrResponse=function(t,n,r){var i=e.io._map[n.uid];i.xdrResponse.apply(i,[t,n,r])},e.io.transport=function(t){var n=e.io._map["io:0"]||new e.IO;t.uid=n._uid,n.transport.apply(n,[t])},e.io.xdr={delay:100}},"3.7.3",{requires:["io-base","datatype-xml-parse"]});
bundle/io-xdr/io-xdr.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -314,4 +314,4 @@ Y.io.xdr = { delay : 100 }; -}, '3.7.2', {"requires": ["io-base", "datatype-xml-parse"]});+}, '3.7.3', {"requires": ["io-base", "datatype-xml-parse"]});
bundle/json-parse/json-parse-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/json-parse/json-parse.js", code: [] };-_yuitest_coverage["build/json-parse/json-parse.js"].code=["YUI.add('json-parse', function (Y, NAME) {","","/**"," * <p>The JSON module adds support for serializing JavaScript objects into"," * JSON strings and parsing JavaScript objects from strings in JSON format.</p>"," *"," * <p>The JSON namespace is added to your YUI instance including static methods"," * Y.JSON.parse(..) and Y.JSON.stringify(..).</p>"," *"," * <p>The functionality and method signatures follow the ECMAScript 5"," * specification. In browsers with native JSON support, the native"," * implementation is used.</p>"," *"," * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and"," * <code>json-stringify</code>.</p>"," * "," * <p>As their names suggest, <code>json-parse</code> adds support for parsing"," * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing"," * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to"," * include either of the submodules individually if you don't need the"," * complementary functionality, or include the rollup for both.</p>"," *"," * @module json"," * @main json"," * @class JSON"," * @static"," */","","/**"," * Provides Y.JSON.parse method to accept JSON strings and return native"," * JavaScript objects."," *"," * @module json"," * @submodule json-parse"," * @for JSON"," * @static"," */","","","// All internals kept private for security reasons","function fromGlobal(ref) {"," return (Y.config.win || this || {})[ref];","}","",""," /**"," * Alias to native browser implementation of the JSON object if available."," *"," * @property Native"," * @type {Object}"," * @private"," */","var _JSON = fromGlobal('JSON'),",""," Native = (Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON),"," useNative = !!Native,",""," /**"," * Replace certain Unicode characters that JavaScript may handle incorrectly"," * during eval--either by deleting them or treating them as line"," * endings--with escape sequences."," * IMPORTANT NOTE: This regex will be used to modify the input if a match is"," * found."," *"," * @property _UNICODE_EXCEPTIONS"," * @type {RegExp}"," * @private"," */"," _UNICODE_EXCEPTIONS = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,","",""," /**"," * First step in the safety evaluation. Regex used to replace all escape"," * sequences (i.e. \"\\\\\", etc) with '@' characters (a non-JSON character)."," *"," * @property _ESCAPES"," * @type {RegExp}"," * @private"," */"," _ESCAPES = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g,",""," /**"," * Second step in the safety evaluation. Regex used to replace all simple"," * values with ']' characters."," *"," * @property _VALUES"," * @type {RegExp}"," * @private"," */"," _VALUES = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,",""," /**"," * Third step in the safety evaluation. Regex used to remove all open"," * square brackets following a colon, comma, or at the beginning of the"," * string."," *"," * @property _BRACKETS"," * @type {RegExp}"," * @private"," */"," _BRACKETS = /(?:^|:|,)(?:\\s*\\[)+/g,",""," /**"," * Final step in the safety evaluation. Regex used to test the string left"," * after all previous replacements for invalid characters."," *"," * @property _UNSAFE"," * @type {RegExp}"," * @private"," */"," _UNSAFE = /[^\\],:{}\\s]/,"," "," /**"," * Replaces specific unicode characters with their appropriate \\unnnn"," * format. Some browsers ignore certain characters during eval."," *"," * @method escapeException"," * @param c {String} Unicode character"," * @return {String} the \\unnnn escapement of the character"," * @private"," */"," _escapeException = function (c) {"," return '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);"," },",""," /**"," * Traverses nested objects, applying a reviver function to each (key,value)"," * from the scope if the key:value's containing object. The value returned"," * from the function will replace the original value in the key:value pair."," * If the value returned is undefined, the key will be omitted from the"," * returned object."," *"," * @method _revive"," * @param data {MIXED} Any JavaScript data"," * @param reviver {Function} filter or mutation function"," * @return {MIXED} The results of the filtered data"," * @private"," */"," _revive = function (data, reviver) {"," var walk = function (o,key) {"," var k,v,value = o[key];"," if (value && typeof value === 'object') {"," for (k in value) {"," if (value.hasOwnProperty(k)) {"," v = walk(value, k);"," if (v === undefined) {"," delete value[k];"," } else {"," value[k] = v;"," }"," }"," }"," }"," return reviver.call(o,key,value);"," };",""," return typeof reviver === 'function' ? walk({'':data},'') : data;"," },",""," /**"," * Parse a JSON string, returning the native JavaScript representation."," *"," * @param s {string} JSON string data"," * @param reviver {function} (optional) function(k,v) passed each key value"," * pair of object literals, allowing pruning or altering values"," * @return {MIXED} the native JavaScript representation of the JSON string"," * @throws SyntaxError"," * @method parse"," * @static"," */"," // JavaScript implementation in lieu of native browser support. Based on"," // the json2.js library from http://json.org"," _parse = function (s,reviver) {"," // Replace certain Unicode characters that are otherwise handled"," // incorrectly by some browser implementations."," // NOTE: This modifies the input if such characters are found!"," s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);"," "," // Test for any remaining invalid characters"," if (!_UNSAFE.test(s.replace(_ESCAPES,'@')."," replace(_VALUES,']')."," replace(_BRACKETS,''))) {",""," // Eval the text into a JavaScript data structure, apply any"," // reviver function, and return"," return _revive( eval('(' + s + ')'), reviver );"," }",""," throw new SyntaxError('JSON.parse');"," };"," ","Y.namespace('JSON').parse = function (s,reviver) {"," if (typeof s !== 'string') {"," s += '';"," }",""," return Native && Y.JSON.useNativeParse ?"," Native.parse(s,reviver) : _parse(s,reviver);","};","","function workingNative( k, v ) {"," return k === \"ok\" ? true : v;","}","","// Double check basic functionality. This is mainly to catch early broken","// implementations of the JSON API in Firefox 3.1 beta1 and beta2","if ( Native ) {"," try {"," useNative = ( Native.parse( '{\"ok\":false}', workingNative ) ).ok;"," }"," catch ( e ) {"," useNative = false;"," }","}","","/**"," * Leverage native JSON parse if the browser has a native implementation."," * In general, this is a good idea. See the Known Issues section in the"," * JSON user guide for caveats. The default value is true for browsers with"," * native JSON support."," *"," * @property useNativeParse"," * @type Boolean"," * @default true"," * @static"," */","Y.JSON.useNativeParse = useNative;","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];-_yuitest_coverage["build/json-parse/json-parse.js"].lines = {"1":0,"41":0,"42":0,"53":0,"123":0,"140":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"149":0,"154":0,"157":0,"177":0,"180":0,"186":0,"189":0,"192":0,"193":0,"194":0,"197":0,"201":0,"202":0,"207":0,"208":0,"209":0,"212":0,"227":0};-_yuitest_coverage["build/json-parse/json-parse.js"].functions = {"fromGlobal:41":0,"_escapeException:122":0,"walk:140":0,"_revive:139":0,"_parse:173":0,"parse:192":0,"workingNative:201":0,"(anonymous 1):1":0};-_yuitest_coverage["build/json-parse/json-parse.js"].coveredLines = 31;+_yuitest_coverage["build/json-parse/json-parse.js"].code=["YUI.add('json-parse', function (Y, NAME) {","","/**"," * <p>The JSON module adds support for serializing JavaScript objects into"," * JSON strings and parsing JavaScript objects from strings in JSON format.</p>"," *"," * <p>The JSON namespace is added to your YUI instance including static methods"," * Y.JSON.parse(..) and Y.JSON.stringify(..).</p>"," *"," * <p>The functionality and method signatures follow the ECMAScript 5"," * specification. In browsers with native JSON support, the native"," * implementation is used.</p>"," *"," * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and"," * <code>json-stringify</code>.</p>"," *"," * <p>As their names suggest, <code>json-parse</code> adds support for parsing"," * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing"," * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to"," * include either of the submodules individually if you don't need the"," * complementary functionality, or include the rollup for both.</p>"," *"," * @module json"," * @main json"," * @class JSON"," * @static"," */","","/**"," * Provides Y.JSON.parse method to accept JSON strings and return native"," * JavaScript objects."," *"," * @module json"," * @submodule json-parse"," * @for JSON"," * @static"," */","","","// All internals kept private for security reasons","function fromGlobal(ref) {"," var g = ((typeof global === 'object') ? global : undefined);"," return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];","}","",""," /**"," * Alias to native browser implementation of the JSON object if available."," *"," * @property Native"," * @type {Object}"," * @private"," */","var _JSON = fromGlobal('JSON'),",""," Native = (Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON),"," useNative = !!Native,",""," /**"," * Replace certain Unicode characters that JavaScript may handle incorrectly"," * during eval--either by deleting them or treating them as line"," * endings--with escape sequences."," * IMPORTANT NOTE: This regex will be used to modify the input if a match is"," * found."," *"," * @property _UNICODE_EXCEPTIONS"," * @type {RegExp}"," * @private"," */"," _UNICODE_EXCEPTIONS = /[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,","",""," /**"," * First step in the safety evaluation. Regex used to replace all escape"," * sequences (i.e. \"\\\\\", etc) with '@' characters (a non-JSON character)."," *"," * @property _ESCAPES"," * @type {RegExp}"," * @private"," */"," _ESCAPES = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g,",""," /**"," * Second step in the safety evaluation. Regex used to replace all simple"," * values with ']' characters."," *"," * @property _VALUES"," * @type {RegExp}"," * @private"," */"," _VALUES = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g,",""," /**"," * Third step in the safety evaluation. Regex used to remove all open"," * square brackets following a colon, comma, or at the beginning of the"," * string."," *"," * @property _BRACKETS"," * @type {RegExp}"," * @private"," */"," _BRACKETS = /(?:^|:|,)(?:\\s*\\[)+/g,",""," /**"," * Final step in the safety evaluation. Regex used to test the string left"," * after all previous replacements for invalid characters."," *"," * @property _UNSAFE"," * @type {RegExp}"," * @private"," */"," _UNSAFE = /[^\\],:{}\\s]/,",""," /**"," * Replaces specific unicode characters with their appropriate \\unnnn"," * format. Some browsers ignore certain characters during eval."," *"," * @method escapeException"," * @param c {String} Unicode character"," * @return {String} the \\unnnn escapement of the character"," * @private"," */"," _escapeException = function (c) {"," return '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);"," },",""," /**"," * Traverses nested objects, applying a reviver function to each (key,value)"," * from the scope if the key:value's containing object. The value returned"," * from the function will replace the original value in the key:value pair."," * If the value returned is undefined, the key will be omitted from the"," * returned object."," *"," * @method _revive"," * @param data {MIXED} Any JavaScript data"," * @param reviver {Function} filter or mutation function"," * @return {MIXED} The results of the filtered data"," * @private"," */"," _revive = function (data, reviver) {"," var walk = function (o,key) {"," var k,v,value = o[key];"," if (value && typeof value === 'object') {"," for (k in value) {"," if (value.hasOwnProperty(k)) {"," v = walk(value, k);"," if (v === undefined) {"," delete value[k];"," } else {"," value[k] = v;"," }"," }"," }"," }"," return reviver.call(o,key,value);"," };",""," return typeof reviver === 'function' ? walk({'':data},'') : data;"," },",""," /**"," * Parse a JSON string, returning the native JavaScript representation."," *"," * @param s {string} JSON string data"," * @param reviver {function} (optional) function(k,v) passed each key value"," * pair of object literals, allowing pruning or altering values"," * @return {MIXED} the native JavaScript representation of the JSON string"," * @throws SyntaxError"," * @method parse"," * @static"," */"," // JavaScript implementation in lieu of native browser support. Based on"," // the json2.js library from http://json.org"," _parse = function (s,reviver) {"," // Replace certain Unicode characters that are otherwise handled"," // incorrectly by some browser implementations."," // NOTE: This modifies the input if such characters are found!"," s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);",""," // Test for any remaining invalid characters"," if (!_UNSAFE.test(s.replace(_ESCAPES,'@')."," replace(_VALUES,']')."," replace(_BRACKETS,''))) {",""," // Eval the text into a JavaScript data structure, apply any"," // reviver function, and return"," return _revive( eval('(' + s + ')'), reviver );"," }",""," throw new SyntaxError('JSON.parse');"," };","","Y.namespace('JSON').parse = function (s,reviver) {"," if (typeof s !== 'string') {"," s += '';"," }",""," return Native && Y.JSON.useNativeParse ?"," Native.parse(s,reviver) : _parse(s,reviver);","};","","function workingNative( k, v ) {"," return k === \"ok\" ? true : v;","}","","// Double check basic functionality. This is mainly to catch early broken","// implementations of the JSON API in Firefox 3.1 beta1 and beta2","if ( Native ) {"," try {"," useNative = ( Native.parse( '{\"ok\":false}', workingNative ) ).ok;"," }"," catch ( e ) {"," useNative = false;"," }","}","","/**"," * Leverage native JSON parse if the browser has a native implementation."," * In general, this is a good idea. See the Known Issues section in the"," * JSON user guide for caveats. The default value is true for browsers with"," * native JSON support."," *"," * @property useNativeParse"," * @type Boolean"," * @default true"," * @static"," */","Y.JSON.useNativeParse = useNative;","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/json-parse/json-parse.js"].lines = {"1":0,"41":0,"42":0,"43":0,"54":0,"124":0,"141":0,"142":0,"143":0,"144":0,"145":0,"146":0,"147":0,"148":0,"150":0,"155":0,"158":0,"178":0,"181":0,"187":0,"190":0,"193":0,"194":0,"195":0,"198":0,"202":0,"203":0,"208":0,"209":0,"210":0,"213":0,"228":0};+_yuitest_coverage["build/json-parse/json-parse.js"].functions = {"fromGlobal:41":0,"_escapeException:123":0,"walk:141":0,"_revive:140":0,"_parse:174":0,"parse:193":0,"workingNative:202":0,"(anonymous 1):1":0};+_yuitest_coverage["build/json-parse/json-parse.js"].coveredLines = 32; _yuitest_coverage["build/json-parse/json-parse.js"].coveredFunctions = 8; _yuitest_coverline("build/json-parse/json-parse.js", 1); YUI.add('json-parse', function (Y, NAME) {@@ -53,7 +53,7 @@ * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p>- * + * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to@@ -83,7 +83,9 @@ function fromGlobal(ref) { _yuitest_coverfunc("build/json-parse/json-parse.js", "fromGlobal", 41); _yuitest_coverline("build/json-parse/json-parse.js", 42);-return (Y.config.win || this || {})[ref];+var g = ((typeof global === 'object') ? global : undefined);+ _yuitest_coverline("build/json-parse/json-parse.js", 43);+return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref]; } @@ -94,7 +96,7 @@ * @type {Object} * @private */-_yuitest_coverline("build/json-parse/json-parse.js", 53);+_yuitest_coverline("build/json-parse/json-parse.js", 54); var _JSON = fromGlobal('JSON'), Native = (Object.prototype.toString.call(_JSON) === '[object JSON]' && _JSON),@@ -154,7 +156,7 @@ * @private */ _UNSAFE = /[^\],:{}\s]/,- + /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval.@@ -165,8 +167,8 @@ * @private */ _escapeException = function (c) {- _yuitest_coverfunc("build/json-parse/json-parse.js", "_escapeException", 122);-_yuitest_coverline("build/json-parse/json-parse.js", 123);+ _yuitest_coverfunc("build/json-parse/json-parse.js", "_escapeException", 123);+_yuitest_coverline("build/json-parse/json-parse.js", 124); return '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4); }, @@ -184,36 +186,36 @@ * @private */ _revive = function (data, reviver) {- _yuitest_coverfunc("build/json-parse/json-parse.js", "_revive", 139);-_yuitest_coverline("build/json-parse/json-parse.js", 140);-var walk = function (o,key) {- _yuitest_coverfunc("build/json-parse/json-parse.js", "walk", 140);+ _yuitest_coverfunc("build/json-parse/json-parse.js", "_revive", 140); _yuitest_coverline("build/json-parse/json-parse.js", 141);+var walk = function (o,key) {+ _yuitest_coverfunc("build/json-parse/json-parse.js", "walk", 141);+_yuitest_coverline("build/json-parse/json-parse.js", 142); var k,v,value = o[key];- _yuitest_coverline("build/json-parse/json-parse.js", 142);+ _yuitest_coverline("build/json-parse/json-parse.js", 143); if (value && typeof value === 'object') {- _yuitest_coverline("build/json-parse/json-parse.js", 143);+ _yuitest_coverline("build/json-parse/json-parse.js", 144); for (k in value) {- _yuitest_coverline("build/json-parse/json-parse.js", 144);+ _yuitest_coverline("build/json-parse/json-parse.js", 145); if (value.hasOwnProperty(k)) {- _yuitest_coverline("build/json-parse/json-parse.js", 145);-v = walk(value, k); _yuitest_coverline("build/json-parse/json-parse.js", 146);+v = walk(value, k);+ _yuitest_coverline("build/json-parse/json-parse.js", 147); if (v === undefined) {- _yuitest_coverline("build/json-parse/json-parse.js", 147);+ _yuitest_coverline("build/json-parse/json-parse.js", 148); delete value[k]; } else {- _yuitest_coverline("build/json-parse/json-parse.js", 149);+ _yuitest_coverline("build/json-parse/json-parse.js", 150); value[k] = v; } } } }- _yuitest_coverline("build/json-parse/json-parse.js", 154);+ _yuitest_coverline("build/json-parse/json-parse.js", 155); return reviver.call(o,key,value); }; - _yuitest_coverline("build/json-parse/json-parse.js", 157);+ _yuitest_coverline("build/json-parse/json-parse.js", 158); return typeof reviver === 'function' ? walk({'':data},'') : data; }, @@ -234,58 +236,58 @@ // Replace certain Unicode characters that are otherwise handled // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found!- _yuitest_coverfunc("build/json-parse/json-parse.js", "_parse", 173);-_yuitest_coverline("build/json-parse/json-parse.js", 177);+ _yuitest_coverfunc("build/json-parse/json-parse.js", "_parse", 174);+_yuitest_coverline("build/json-parse/json-parse.js", 178); s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);- + // Test for any remaining invalid characters- _yuitest_coverline("build/json-parse/json-parse.js", 180);+ _yuitest_coverline("build/json-parse/json-parse.js", 181); if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']'). replace(_BRACKETS,''))) { // Eval the text into a JavaScript data structure, apply any // reviver function, and return- _yuitest_coverline("build/json-parse/json-parse.js", 186);+ _yuitest_coverline("build/json-parse/json-parse.js", 187); return _revive( eval('(' + s + ')'), reviver ); } - _yuitest_coverline("build/json-parse/json-parse.js", 189);+ _yuitest_coverline("build/json-parse/json-parse.js", 190); throw new SyntaxError('JSON.parse'); };- -_yuitest_coverline("build/json-parse/json-parse.js", 192);-Y.namespace('JSON').parse = function (s,reviver) {- _yuitest_coverfunc("build/json-parse/json-parse.js", "parse", 192);+ _yuitest_coverline("build/json-parse/json-parse.js", 193);+Y.namespace('JSON').parse = function (s,reviver) {+ _yuitest_coverfunc("build/json-parse/json-parse.js", "parse", 193);+_yuitest_coverline("build/json-parse/json-parse.js", 194); if (typeof s !== 'string') {- _yuitest_coverline("build/json-parse/json-parse.js", 194);+ _yuitest_coverline("build/json-parse/json-parse.js", 195); s += ''; } - _yuitest_coverline("build/json-parse/json-parse.js", 197);+ _yuitest_coverline("build/json-parse/json-parse.js", 198); return Native && Y.JSON.useNativeParse ? Native.parse(s,reviver) : _parse(s,reviver); }; -_yuitest_coverline("build/json-parse/json-parse.js", 201);-function workingNative( k, v ) {- _yuitest_coverfunc("build/json-parse/json-parse.js", "workingNative", 201); _yuitest_coverline("build/json-parse/json-parse.js", 202);+function workingNative( k, v ) {+ _yuitest_coverfunc("build/json-parse/json-parse.js", "workingNative", 202);+_yuitest_coverline("build/json-parse/json-parse.js", 203); return k === "ok" ? true : v; } // Double check basic functionality. This is mainly to catch early broken // implementations of the JSON API in Firefox 3.1 beta1 and beta2-_yuitest_coverline("build/json-parse/json-parse.js", 207);+_yuitest_coverline("build/json-parse/json-parse.js", 208); if ( Native ) {- _yuitest_coverline("build/json-parse/json-parse.js", 208);+ _yuitest_coverline("build/json-parse/json-parse.js", 209); try {- _yuitest_coverline("build/json-parse/json-parse.js", 209);+ _yuitest_coverline("build/json-parse/json-parse.js", 210); useNative = ( Native.parse( '{"ok":false}', workingNative ) ).ok; } catch ( e ) {- _yuitest_coverline("build/json-parse/json-parse.js", 212);+ _yuitest_coverline("build/json-parse/json-parse.js", 213); useNative = false; } }@@ -301,8 +303,8 @@ * @default true * @static */-_yuitest_coverline("build/json-parse/json-parse.js", 227);+_yuitest_coverline("build/json-parse/json-parse.js", 228); Y.JSON.useNativeParse = useNative; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/json-parse/json-parse-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p>- * + * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to@@ -45,7 +45,8 @@ // All internals kept private for security reasons function fromGlobal(ref) {- return (Y.config.win || this || {})[ref];+ var g = ((typeof global === 'object') ? global : undefined);+ return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref]; } @@ -115,7 +116,7 @@ * @private */ _UNSAFE = /[^\],:{}\s]/,- + /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval.@@ -181,7 +182,7 @@ // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);- + // Test for any remaining invalid characters if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']').@@ -194,7 +195,7 @@ throw new SyntaxError('JSON.parse'); };- + Y.namespace('JSON').parse = function (s,reviver) { if (typeof s !== 'string') { s += '';@@ -233,4 +234,4 @@ Y.JSON.useNativeParse = useNative; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/json-parse/json-parse-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("json-parse",function(e,t){function n(t){return(e.config.win||this||{})[t]}function d(e,t){return e==="ok"?!0:t}var r=n("JSON"),i=Object.prototype.toString.call(r)==="[object JSON]"&&r,s=!!i,o=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,a=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,f=/(?:^|:|,)(?:\s*\[)+/g,l=/[^\],:{}\s]/,c=function(e){return"\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4)},h=function(e,t){var n=function(e,r){var i,s,o=e[r];if(o&&typeof o=="object")for(i in o)o.hasOwnProperty(i)&&(s=n(o,i),s===undefined?delete o[i]:o[i]=s);return t.call(e,r,o)};return typeof t=="function"?n({"":e},""):e},p=function(e,t){e=e.replace(o,c);if(!l.test(e.replace(u,"@").replace(a,"]").replace(f,"")))return h(eval("("+e+")"),t);throw new SyntaxError("JSON.parse")};e.namespace("JSON").parse=function(t,n){return typeof t!="string"&&(t+=""),i&&e.JSON.useNativeParse?i.parse(t,n):p(t,n)};if(i)try{s=i.parse('{"ok":false}',d).ok}catch(v){s=!1}e.JSON.useNativeParse=s},"3.7.2",{requires:["yui-base"]});+YUI.add("json-parse",function(e,t){function n(t){var n=typeof global=="object"?global:undefined;return(e.UA.nodejs&&n?n:e.config.win||{})[t]}function d(e,t){return e==="ok"?!0:t}var r=n("JSON"),i=Object.prototype.toString.call(r)==="[object JSON]"&&r,s=!!i,o=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,u=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,a=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,f=/(?:^|:|,)(?:\s*\[)+/g,l=/[^\],:{}\s]/,c=function(e){return"\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4)},h=function(e,t){var n=function(e,r){var i,s,o=e[r];if(o&&typeof o=="object")for(i in o)o.hasOwnProperty(i)&&(s=n(o,i),s===undefined?delete o[i]:o[i]=s);return t.call(e,r,o)};return typeof t=="function"?n({"":e},""):e},p=function(e,t){e=e.replace(o,c);if(!l.test(e.replace(u,"@").replace(a,"]").replace(f,"")))return h(eval("("+e+")"),t);throw new SyntaxError("JSON.parse")};e.namespace("JSON").parse=function(t,n){return typeof t!="string"&&(t+=""),i&&e.JSON.useNativeParse?i.parse(t,n):p(t,n)};if(i)try{s=i.parse('{"ok":false}',d).ok}catch(v){s=!1}e.JSON.useNativeParse=s},"3.7.3",{requires:["yui-base"]});
bundle/json-parse/json-parse.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p>- * + * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to@@ -45,7 +45,8 @@ // All internals kept private for security reasons function fromGlobal(ref) {- return (Y.config.win || this || {})[ref];+ var g = ((typeof global === 'object') ? global : undefined);+ return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref]; } @@ -115,7 +116,7 @@ * @private */ _UNSAFE = /[^\],:{}\s]/,- + /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval.@@ -181,7 +182,7 @@ // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);- + // Test for any remaining invalid characters if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']').@@ -194,7 +195,7 @@ throw new SyntaxError('JSON.parse'); };- + Y.namespace('JSON').parse = function (s,reviver) { if (typeof s !== 'string') { s += '';@@ -233,4 +234,4 @@ Y.JSON.useNativeParse = useNative; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/json-stringify/json-stringify-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/json-stringify/json-stringify.js", code: [] };-_yuitest_coverage["build/json-stringify/json-stringify.js"].code=["YUI.add('json-stringify', function (Y, NAME) {","","/**"," * Provides Y.JSON.stringify method for converting objects to JSON strings."," *"," * @module json"," * @submodule json-stringify"," * @for JSON"," * @static"," */","var _JSON = (Y.config.win || {}).JSON,"," Lang = Y.Lang,"," isFunction= Lang.isFunction,"," isObject = Lang.isObject,"," isArray = Lang.isArray,"," _toStr = Object.prototype.toString,"," Native = (_toStr.call(_JSON) === '[object JSON]' && _JSON),"," useNative = !!Native,"," UNDEFINED = 'undefined',"," OBJECT = 'object',"," NULL = 'null',"," STRING = 'string',"," NUMBER = 'number',"," BOOLEAN = 'boolean',"," DATE = 'date',"," _allowable= {"," 'undefined' : UNDEFINED,"," 'string' : STRING,"," '[object String]' : STRING,"," 'number' : NUMBER,"," '[object Number]' : NUMBER,"," 'boolean' : BOOLEAN,"," '[object Boolean]' : BOOLEAN,"," '[object Date]' : DATE,"," '[object RegExp]' : OBJECT"," },"," EMPTY = '',"," OPEN_O = '{',"," CLOSE_O = '}',"," OPEN_A = '[',"," CLOSE_A = ']',"," COMMA = ',',"," COMMA_CR = \",\\n\","," CR = \"\\n\","," COLON = ':',"," COLON_SP = ': ',"," QUOTE = '\"',",""," // Regex used to capture characters that need escaping before enclosing"," // their containing string in quotes."," _SPECIAL = /[\\x00-\\x07\\x0b\\x0e-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,",""," // Character substitution map for common escapes and special characters."," _COMMON = ["," [/\\\\/g, '\\\\\\\\'],"," [/\\\"/g, '\\\\\"'],"," [/\\x08/g, '\\\\b'],"," [/\\x09/g, '\\\\t'],"," [/\\x0a/g, '\\\\n'],"," [/\\x0c/g, '\\\\f'],"," [/\\x0d/g, '\\\\r']"," ],"," _COMMON_LENGTH = _COMMON.length,",""," // In-process optimization for special character escapes that haven't yet"," // been promoted to _COMMON"," _CHAR = {},",""," // Per-char counter to determine if it's worth fast tracking a special"," // character escape sequence."," _CHAR_COUNT, _CACHE_THRESHOLD;","","// Utility function used to determine how to serialize a variable.","function _type(o) {"," var t = typeof o;"," return _allowable[t] || // number, string, boolean, undefined"," _allowable[_toStr.call(o)] || // Number, String, Boolean, Date"," (t === OBJECT ?"," (o ? OBJECT : NULL) : // object, array, null, misc natives"," UNDEFINED); // function, unknown","}","","// Escapes a special character to a safe Unicode representation","function _char(c) {"," if (!_CHAR[c]) {"," _CHAR[c] = '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);"," _CHAR_COUNT[c] = 0;"," }",""," // === to avoid this conditional for the remainder of the current operation"," if (++_CHAR_COUNT[c] === _CACHE_THRESHOLD) {"," _COMMON.push([new RegExp(c, 'g'), _CHAR[c]]);"," _COMMON_LENGTH = _COMMON.length;"," }",""," return _CHAR[c];","}","","// Enclose escaped strings in quotes","function _string(s) {"," var i, chr;",""," // Preprocess the string against common characters to avoid function"," // overhead associated with replacement via function."," for (i = 0; i < _COMMON_LENGTH; i++) {"," chr = _COMMON[i];"," s = s.replace(chr[0], chr[1]);"," }"," "," // original function replace for the not-as-common set of chars"," return QUOTE + s.replace(_SPECIAL, _char) + QUOTE;","}","","// Adds the provided space to the beginning of every line in the input string","function _indent(s,space) {"," return s.replace(/^/gm, space);","}","","// JavaScript implementation of stringify (see API declaration of stringify)","function _stringify(o,w,space) {"," if (o === undefined) {"," return undefined;"," }",""," var replacer = isFunction(w) ? w : null,"," format = _toStr.call(space).match(/String|Number/) || [],"," _date = Y.JSON.dateToString,"," stack = [],"," tmp,i,len;",""," _CHAR_COUNT = {};"," _CACHE_THRESHOLD = Y.JSON.charCacheThreshold;",""," if (replacer || !isArray(w)) {"," w = undefined;"," }",""," // Ensure whitelist keys are unique (bug 2110391)"," if (w) {"," tmp = {};"," for (i = 0, len = w.length; i < len; ++i) {"," tmp[w[i]] = true;"," }"," w = tmp;"," }",""," // Per the spec, strings are truncated to 10 characters and numbers"," // are converted to that number of spaces (max 10)"," space = format[0] === 'Number' ?"," new Array(Math.min(Math.max(0,space),10)+1).join(\" \") :"," (space || EMPTY).slice(0,10);",""," function _serialize(h,key) {"," var value = h[key],"," t = _type(value),"," a = [],"," colon = space ? COLON_SP : COLON,"," arr, i, keys, k, v;",""," // Per the ECMA 5 spec, toJSON is applied before the replacer is"," // called. Also per the spec, Date.prototype.toJSON has been added, so"," // Date instances should be serialized prior to exposure to the"," // replacer. I disagree with this decision, but the spec is the spec."," if (isObject(value) && isFunction(value.toJSON)) {"," value = value.toJSON(key);"," } else if (t === DATE) {"," value = _date(value);"," }",""," if (isFunction(replacer)) {"," value = replacer.call(h,key,value);"," }",""," if (value !== h[key]) {"," t = _type(value);"," }",""," switch (t) {"," case DATE : // intentional fallthrough. Pre-replacer Dates are"," // serialized in the toJSON stage. Dates here would"," // have been produced by the replacer."," case OBJECT : break;"," case STRING : return _string(value);"," case NUMBER : return isFinite(value) ? value+EMPTY : NULL;"," case BOOLEAN : return value+EMPTY;"," case NULL : return NULL;"," default : return undefined;"," }",""," // Check for cyclical references in nested objects"," for (i = stack.length - 1; i >= 0; --i) {"," if (stack[i] === value) {"," throw new Error(\"JSON.stringify. Cyclical reference\");"," }"," }",""," arr = isArray(value);",""," // Add the object to the processing stack"," stack.push(value);",""," if (arr) { // Array"," for (i = value.length - 1; i >= 0; --i) {"," a[i] = _serialize(value, i) || NULL;"," }"," } else { // Object"," // If whitelist provided, take only those keys"," keys = w || value;"," i = 0;",""," for (k in keys) {"," if (keys.hasOwnProperty(k)) {"," v = _serialize(value, k);"," if (v) {"," a[i++] = _string(k) + colon + v;"," }"," }"," }"," }",""," // remove the array from the stack"," stack.pop();",""," if (space && a.length) {"," return arr ?"," OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A :"," OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O;"," } else {"," return arr ?"," OPEN_A + a.join(COMMA) + CLOSE_A :"," OPEN_O + a.join(COMMA) + CLOSE_O;"," }"," }",""," // process the input"," return _serialize({'':o},'');","}","","// Double check basic native functionality. This is primarily to catch broken","// early JSON API implementations in Firefox 3.1 beta1 and beta2.","if ( Native ) {"," try {"," useNative = ( '0' === Native.stringify(0) );"," } catch ( e ) {"," useNative = false;"," }","}","","Y.mix(Y.namespace('JSON'),{"," /**"," * Leverage native JSON stringify if the browser has a native"," * implementation. In general, this is a good idea. See the Known Issues"," * section in the JSON user guide for caveats. The default value is true"," * for browsers with native JSON support."," *"," * @property useNativeStringify"," * @type Boolean"," * @default true"," * @static"," */"," useNativeStringify : useNative,",""," /**"," * Serializes a Date instance as a UTC date string. Used internally by"," * stringify. Override this method if you need Dates serialized in a"," * different format."," *"," * @method dateToString"," * @param d {Date} The Date to serialize"," * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ"," * @deprecated Use a replacer function"," * @static"," */"," dateToString : function (d) {"," function _zeroPad(v) {"," return v < 10 ? '0' + v : v;"," }",""," return d.getUTCFullYear() + '-' +"," _zeroPad(d.getUTCMonth() + 1) + '-' +"," _zeroPad(d.getUTCDate()) + 'T' +"," _zeroPad(d.getUTCHours()) + COLON +"," _zeroPad(d.getUTCMinutes()) + COLON +"," _zeroPad(d.getUTCSeconds()) + 'Z';"," },",""," /**"," * <p>Converts an arbitrary value to a JSON string representation.</p>"," *"," * <p>Objects with cyclical references will trigger an exception.</p>"," *"," * <p>If a whitelist is provided, only matching object keys will be"," * included. Alternately, a replacer function may be passed as the"," * second parameter. This function is executed on every value in the"," * input, and its return value will be used in place of the original value."," * This is useful to serialize specialized objects or class instances.</p>"," *"," * <p>If a positive integer or non-empty string is passed as the third"," * parameter, the output will be formatted with carriage returns and"," * indentation for readability. If a String is passed (such as \"\\t\") it"," * will be used once for each indentation level. If a number is passed,"," * that number of spaces will be used.</p>"," *"," * @method stringify"," * @param o {MIXED} any arbitrary value to convert to JSON string"," * @param w {Array|Function} (optional) whitelist of acceptable object"," * keys to include, or a replacer function to modify the"," * raw value before serialization"," * @param ind {Number|String} (optional) indentation character or depth of"," * spaces to format the output."," * @return {string} JSON string representation of the input"," * @static"," */"," stringify : function (o,w,ind) {"," return Native && Y.JSON.useNativeStringify ?"," Native.stringify(o,w,ind) : _stringify(o,w,ind);"," },",""," /**"," * <p>Number of occurrences of a special character within a single call to"," * stringify that should trigger promotion of that character to a dedicated"," * preprocess step for future calls. This is only used in environments"," * that don't support native JSON, or when useNativeStringify is set to"," * false.</p>"," *"," * <p>So, if set to 50 and an object is passed to stringify that includes"," * strings containing the special character \\x07 more than 50 times,"," * subsequent calls to stringify will process object strings through a"," * faster serialization path for \\x07 before using the generic, slower,"," * replacement process for all special characters.</p>"," *"," * <p>To prime the preprocessor cache, set this value to 1, then call"," * <code>Y.JSON.stringify(\"<em>(all special characters to"," * cache)</em>\");</code>, then return this setting to a more conservative"," * value.</p>"," *"," * <p>Special characters \\ \" \\b \\t \\n \\f \\r are already cached.</p>"," *"," * @property charCacheThreshold"," * @static"," * @default 100"," * @type {Number}"," */"," charCacheThreshold: 100","});","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];-_yuitest_coverage["build/json-stringify/json-stringify.js"].lines = {"1":0,"11":0,"74":0,"75":0,"76":0,"84":0,"85":0,"86":0,"87":0,"91":0,"92":0,"93":0,"96":0,"100":0,"101":0,"105":0,"106":0,"107":0,"111":0,"115":0,"116":0,"120":0,"121":0,"122":0,"125":0,"131":0,"132":0,"134":0,"135":0,"139":0,"140":0,"141":0,"142":0,"144":0,"149":0,"153":0,"154":0,"164":0,"165":0,"166":0,"167":0,"170":0,"171":0,"174":0,"175":0,"178":0,"182":0,"183":0,"184":0,"185":0,"186":0,"187":0,"191":0,"192":0,"193":0,"197":0,"200":0,"202":0,"203":0,"204":0,"208":0,"209":0,"211":0,"212":0,"213":0,"214":0,"215":0,"222":0,"224":0,"225":0,"229":0,"236":0,"241":0,"242":0,"243":0,"245":0,"249":0,"275":0,"276":0,"279":0,"315":0};-_yuitest_coverage["build/json-stringify/json-stringify.js"].functions = {"_type:74":0,"_char:84":0,"_string:100":0,"_indent:115":0,"_serialize:153":0,"_stringify:120":0,"_zeroPad:275":0,"dateToString:274":0,"stringify:314":0,"(anonymous 1):1":0};-_yuitest_coverage["build/json-stringify/json-stringify.js"].coveredLines = 81;-_yuitest_coverage["build/json-stringify/json-stringify.js"].coveredFunctions = 10;+_yuitest_coverage["build/json-stringify/json-stringify.js"].code=["YUI.add('json-stringify', function (Y, NAME) {","","/**"," * Provides Y.JSON.stringify method for converting objects to JSON strings."," *"," * @module json"," * @submodule json-stringify"," * @for JSON"," * @static"," */","// All internals kept private for security reasons","function fromGlobal(ref) {"," var g = ((typeof global === 'object') ? global : undefined);"," return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];","}","var _JSON = fromGlobal('JSON'),"," Lang = Y.Lang,"," isFunction= Lang.isFunction,"," isObject = Lang.isObject,"," isArray = Lang.isArray,"," _toStr = Object.prototype.toString,"," Native = (_toStr.call(_JSON) === '[object JSON]' && _JSON),"," useNative = !!Native,"," UNDEFINED = 'undefined',"," OBJECT = 'object',"," NULL = 'null',"," STRING = 'string',"," NUMBER = 'number',"," BOOLEAN = 'boolean',"," DATE = 'date',"," _allowable= {"," 'undefined' : UNDEFINED,"," 'string' : STRING,"," '[object String]' : STRING,"," 'number' : NUMBER,"," '[object Number]' : NUMBER,"," 'boolean' : BOOLEAN,"," '[object Boolean]' : BOOLEAN,"," '[object Date]' : DATE,"," '[object RegExp]' : OBJECT"," },"," EMPTY = '',"," OPEN_O = '{',"," CLOSE_O = '}',"," OPEN_A = '[',"," CLOSE_A = ']',"," COMMA = ',',"," COMMA_CR = \",\\n\","," CR = \"\\n\","," COLON = ':',"," COLON_SP = ': ',"," QUOTE = '\"',",""," // Regex used to capture characters that need escaping before enclosing"," // their containing string in quotes."," _SPECIAL = /[\\x00-\\x07\\x0b\\x0e-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]/g,",""," // Character substitution map for common escapes and special characters."," _COMMON = ["," [/\\\\/g, '\\\\\\\\'],"," [/\\\"/g, '\\\\\"'],"," [/\\x08/g, '\\\\b'],"," [/\\x09/g, '\\\\t'],"," [/\\x0a/g, '\\\\n'],"," [/\\x0c/g, '\\\\f'],"," [/\\x0d/g, '\\\\r']"," ],"," _COMMON_LENGTH = _COMMON.length,",""," // In-process optimization for special character escapes that haven't yet"," // been promoted to _COMMON"," _CHAR = {},",""," // Per-char counter to determine if it's worth fast tracking a special"," // character escape sequence."," _CHAR_COUNT, _CACHE_THRESHOLD;","","// Utility function used to determine how to serialize a variable.","function _type(o) {"," var t = typeof o;"," return _allowable[t] || // number, string, boolean, undefined"," _allowable[_toStr.call(o)] || // Number, String, Boolean, Date"," (t === OBJECT ?"," (o ? OBJECT : NULL) : // object, array, null, misc natives"," UNDEFINED); // function, unknown","}","","// Escapes a special character to a safe Unicode representation","function _char(c) {"," if (!_CHAR[c]) {"," _CHAR[c] = '\\\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);"," _CHAR_COUNT[c] = 0;"," }",""," // === to avoid this conditional for the remainder of the current operation"," if (++_CHAR_COUNT[c] === _CACHE_THRESHOLD) {"," _COMMON.push([new RegExp(c, 'g'), _CHAR[c]]);"," _COMMON_LENGTH = _COMMON.length;"," }",""," return _CHAR[c];","}","","// Enclose escaped strings in quotes","function _string(s) {"," var i, chr;",""," // Preprocess the string against common characters to avoid function"," // overhead associated with replacement via function."," for (i = 0; i < _COMMON_LENGTH; i++) {"," chr = _COMMON[i];"," s = s.replace(chr[0], chr[1]);"," }"," "," // original function replace for the not-as-common set of chars"," return QUOTE + s.replace(_SPECIAL, _char) + QUOTE;","}","","// Adds the provided space to the beginning of every line in the input string","function _indent(s,space) {"," return s.replace(/^/gm, space);","}","","// JavaScript implementation of stringify (see API declaration of stringify)","function _stringify(o,w,space) {"," if (o === undefined) {"," return undefined;"," }",""," var replacer = isFunction(w) ? w : null,"," format = _toStr.call(space).match(/String|Number/) || [],"," _date = Y.JSON.dateToString,"," stack = [],"," tmp,i,len;",""," _CHAR_COUNT = {};"," _CACHE_THRESHOLD = Y.JSON.charCacheThreshold;",""," if (replacer || !isArray(w)) {"," w = undefined;"," }",""," // Ensure whitelist keys are unique (bug 2110391)"," if (w) {"," tmp = {};"," for (i = 0, len = w.length; i < len; ++i) {"," tmp[w[i]] = true;"," }"," w = tmp;"," }",""," // Per the spec, strings are truncated to 10 characters and numbers"," // are converted to that number of spaces (max 10)"," space = format[0] === 'Number' ?"," new Array(Math.min(Math.max(0,space),10)+1).join(\" \") :"," (space || EMPTY).slice(0,10);",""," function _serialize(h,key) {"," var value = h[key],"," t = _type(value),"," a = [],"," colon = space ? COLON_SP : COLON,"," arr, i, keys, k, v;",""," // Per the ECMA 5 spec, toJSON is applied before the replacer is"," // called. Also per the spec, Date.prototype.toJSON has been added, so"," // Date instances should be serialized prior to exposure to the"," // replacer. I disagree with this decision, but the spec is the spec."," if (isObject(value) && isFunction(value.toJSON)) {"," value = value.toJSON(key);"," } else if (t === DATE) {"," value = _date(value);"," }",""," if (isFunction(replacer)) {"," value = replacer.call(h,key,value);"," }",""," if (value !== h[key]) {"," t = _type(value);"," }",""," switch (t) {"," case DATE : // intentional fallthrough. Pre-replacer Dates are"," // serialized in the toJSON stage. Dates here would"," // have been produced by the replacer."," case OBJECT : break;"," case STRING : return _string(value);"," case NUMBER : return isFinite(value) ? value+EMPTY : NULL;"," case BOOLEAN : return value+EMPTY;"," case NULL : return NULL;"," default : return undefined;"," }",""," // Check for cyclical references in nested objects"," for (i = stack.length - 1; i >= 0; --i) {"," if (stack[i] === value) {"," throw new Error(\"JSON.stringify. Cyclical reference\");"," }"," }",""," arr = isArray(value);",""," // Add the object to the processing stack"," stack.push(value);",""," if (arr) { // Array"," for (i = value.length - 1; i >= 0; --i) {"," a[i] = _serialize(value, i) || NULL;"," }"," } else { // Object"," // If whitelist provided, take only those keys"," keys = w || value;"," i = 0;",""," for (k in keys) {"," if (keys.hasOwnProperty(k)) {"," v = _serialize(value, k);"," if (v) {"," a[i++] = _string(k) + colon + v;"," }"," }"," }"," }",""," // remove the array from the stack"," stack.pop();",""," if (space && a.length) {"," return arr ?"," OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A :"," OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O;"," } else {"," return arr ?"," OPEN_A + a.join(COMMA) + CLOSE_A :"," OPEN_O + a.join(COMMA) + CLOSE_O;"," }"," }",""," // process the input"," return _serialize({'':o},'');","}","","// Double check basic native functionality. This is primarily to catch broken","// early JSON API implementations in Firefox 3.1 beta1 and beta2.","if ( Native ) {"," try {"," useNative = ( '0' === Native.stringify(0) );"," } catch ( e ) {"," useNative = false;"," }","}","","Y.mix(Y.namespace('JSON'),{"," /**"," * Leverage native JSON stringify if the browser has a native"," * implementation. In general, this is a good idea. See the Known Issues"," * section in the JSON user guide for caveats. The default value is true"," * for browsers with native JSON support."," *"," * @property useNativeStringify"," * @type Boolean"," * @default true"," * @static"," */"," useNativeStringify : useNative,",""," /**"," * Serializes a Date instance as a UTC date string. Used internally by"," * stringify. Override this method if you need Dates serialized in a"," * different format."," *"," * @method dateToString"," * @param d {Date} The Date to serialize"," * @return {String} stringified Date in UTC format YYYY-MM-DDTHH:mm:SSZ"," * @deprecated Use a replacer function"," * @static"," */"," dateToString : function (d) {"," function _zeroPad(v) {"," return v < 10 ? '0' + v : v;"," }",""," return d.getUTCFullYear() + '-' +"," _zeroPad(d.getUTCMonth() + 1) + '-' +"," _zeroPad(d.getUTCDate()) + 'T' +"," _zeroPad(d.getUTCHours()) + COLON +"," _zeroPad(d.getUTCMinutes()) + COLON +"," _zeroPad(d.getUTCSeconds()) + 'Z';"," },",""," /**"," * <p>Converts an arbitrary value to a JSON string representation.</p>"," *"," * <p>Objects with cyclical references will trigger an exception.</p>"," *"," * <p>If a whitelist is provided, only matching object keys will be"," * included. Alternately, a replacer function may be passed as the"," * second parameter. This function is executed on every value in the"," * input, and its return value will be used in place of the original value."," * This is useful to serialize specialized objects or class instances.</p>"," *"," * <p>If a positive integer or non-empty string is passed as the third"," * parameter, the output will be formatted with carriage returns and"," * indentation for readability. If a String is passed (such as \"\\t\") it"," * will be used once for each indentation level. If a number is passed,"," * that number of spaces will be used.</p>"," *"," * @method stringify"," * @param o {MIXED} any arbitrary value to convert to JSON string"," * @param w {Array|Function} (optional) whitelist of acceptable object"," * keys to include, or a replacer function to modify the"," * raw value before serialization"," * @param ind {Number|String} (optional) indentation character or depth of"," * spaces to format the output."," * @return {string} JSON string representation of the input"," * @static"," */"," stringify : function (o,w,ind) {"," return Native && Y.JSON.useNativeStringify ?"," Native.stringify(o,w,ind) : _stringify(o,w,ind);"," },",""," /**"," * <p>Number of occurrences of a special character within a single call to"," * stringify that should trigger promotion of that character to a dedicated"," * preprocess step for future calls. This is only used in environments"," * that don't support native JSON, or when useNativeStringify is set to"," * false.</p>"," *"," * <p>So, if set to 50 and an object is passed to stringify that includes"," * strings containing the special character \\x07 more than 50 times,"," * subsequent calls to stringify will process object strings through a"," * faster serialization path for \\x07 before using the generic, slower,"," * replacement process for all special characters.</p>"," *"," * <p>To prime the preprocessor cache, set this value to 1, then call"," * <code>Y.JSON.stringify(\"<em>(all special characters to"," * cache)</em>\");</code>, then return this setting to a more conservative"," * value.</p>"," *"," * <p>Special characters \\ \" \\b \\t \\n \\f \\r are already cached.</p>"," *"," * @property charCacheThreshold"," * @static"," * @default 100"," * @type {Number}"," */"," charCacheThreshold: 100","});","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/json-stringify/json-stringify.js"].lines = {"1":0,"12":0,"13":0,"14":0,"16":0,"79":0,"80":0,"81":0,"89":0,"90":0,"91":0,"92":0,"96":0,"97":0,"98":0,"101":0,"105":0,"106":0,"110":0,"111":0,"112":0,"116":0,"120":0,"121":0,"125":0,"126":0,"127":0,"130":0,"136":0,"137":0,"139":0,"140":0,"144":0,"145":0,"146":0,"147":0,"149":0,"154":0,"158":0,"159":0,"169":0,"170":0,"171":0,"172":0,"175":0,"176":0,"179":0,"180":0,"183":0,"187":0,"188":0,"189":0,"190":0,"191":0,"192":0,"196":0,"197":0,"198":0,"202":0,"205":0,"207":0,"208":0,"209":0,"213":0,"214":0,"216":0,"217":0,"218":0,"219":0,"220":0,"227":0,"229":0,"230":0,"234":0,"241":0,"246":0,"247":0,"248":0,"250":0,"254":0,"280":0,"281":0,"284":0,"320":0};+_yuitest_coverage["build/json-stringify/json-stringify.js"].functions = {"fromGlobal:12":0,"_type:79":0,"_char:89":0,"_string:105":0,"_indent:120":0,"_serialize:158":0,"_stringify:125":0,"_zeroPad:280":0,"dateToString:279":0,"stringify:319":0,"(anonymous 1):1":0};+_yuitest_coverage["build/json-stringify/json-stringify.js"].coveredLines = 84;+_yuitest_coverage["build/json-stringify/json-stringify.js"].coveredFunctions = 11; _yuitest_coverline("build/json-stringify/json-stringify.js", 1); YUI.add('json-stringify', function (Y, NAME) { @@ -48,9 +48,18 @@ * @for JSON * @static */+// All internals kept private for security reasons _yuitest_coverfunc("build/json-stringify/json-stringify.js", "(anonymous 1)", 1);-_yuitest_coverline("build/json-stringify/json-stringify.js", 11);-var _JSON = (Y.config.win || {}).JSON,+_yuitest_coverline("build/json-stringify/json-stringify.js", 12);+function fromGlobal(ref) {+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "fromGlobal", 12);+_yuitest_coverline("build/json-stringify/json-stringify.js", 13);+var g = ((typeof global === 'object') ? global : undefined);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 14);+return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];+}+_yuitest_coverline("build/json-stringify/json-stringify.js", 16);+var _JSON = fromGlobal('JSON'), Lang = Y.Lang, isFunction= Lang.isFunction, isObject = Lang.isObject,@@ -113,12 +122,12 @@ _CHAR_COUNT, _CACHE_THRESHOLD; // Utility function used to determine how to serialize a variable.-_yuitest_coverline("build/json-stringify/json-stringify.js", 74);+_yuitest_coverline("build/json-stringify/json-stringify.js", 79); function _type(o) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_type", 74);-_yuitest_coverline("build/json-stringify/json-stringify.js", 75);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_type", 79);+_yuitest_coverline("build/json-stringify/json-stringify.js", 80); var t = typeof o;- _yuitest_coverline("build/json-stringify/json-stringify.js", 76);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 81); return _allowable[t] || // number, string, boolean, undefined _allowable[_toStr.call(o)] || // Number, String, Boolean, Date (t === OBJECT ?@@ -127,113 +136,113 @@ } // Escapes a special character to a safe Unicode representation-_yuitest_coverline("build/json-stringify/json-stringify.js", 84);+_yuitest_coverline("build/json-stringify/json-stringify.js", 89); function _char(c) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_char", 84);-_yuitest_coverline("build/json-stringify/json-stringify.js", 85);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_char", 89);+_yuitest_coverline("build/json-stringify/json-stringify.js", 90); if (!_CHAR[c]) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 86);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 91); _CHAR[c] = '\\u'+('0000'+(+(c.charCodeAt(0))).toString(16)).slice(-4);- _yuitest_coverline("build/json-stringify/json-stringify.js", 87);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 92); _CHAR_COUNT[c] = 0; } // === to avoid this conditional for the remainder of the current operation- _yuitest_coverline("build/json-stringify/json-stringify.js", 91);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 96); if (++_CHAR_COUNT[c] === _CACHE_THRESHOLD) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 92);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 97); _COMMON.push([new RegExp(c, 'g'), _CHAR[c]]);- _yuitest_coverline("build/json-stringify/json-stringify.js", 93);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 98); _COMMON_LENGTH = _COMMON.length; } - _yuitest_coverline("build/json-stringify/json-stringify.js", 96);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 101); return _CHAR[c]; } // Enclose escaped strings in quotes-_yuitest_coverline("build/json-stringify/json-stringify.js", 100);+_yuitest_coverline("build/json-stringify/json-stringify.js", 105); function _string(s) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_string", 100);-_yuitest_coverline("build/json-stringify/json-stringify.js", 101);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_string", 105);+_yuitest_coverline("build/json-stringify/json-stringify.js", 106); var i, chr; // Preprocess the string against common characters to avoid function // overhead associated with replacement via function.- _yuitest_coverline("build/json-stringify/json-stringify.js", 105);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 110); for (i = 0; i < _COMMON_LENGTH; i++) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 106);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 111); chr = _COMMON[i];- _yuitest_coverline("build/json-stringify/json-stringify.js", 107);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 112); s = s.replace(chr[0], chr[1]); } // original function replace for the not-as-common set of chars- _yuitest_coverline("build/json-stringify/json-stringify.js", 111);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 116); return QUOTE + s.replace(_SPECIAL, _char) + QUOTE; } // Adds the provided space to the beginning of every line in the input string-_yuitest_coverline("build/json-stringify/json-stringify.js", 115);+_yuitest_coverline("build/json-stringify/json-stringify.js", 120); function _indent(s,space) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_indent", 115);-_yuitest_coverline("build/json-stringify/json-stringify.js", 116);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_indent", 120);+_yuitest_coverline("build/json-stringify/json-stringify.js", 121); return s.replace(/^/gm, space); } // JavaScript implementation of stringify (see API declaration of stringify)-_yuitest_coverline("build/json-stringify/json-stringify.js", 120);+_yuitest_coverline("build/json-stringify/json-stringify.js", 125); function _stringify(o,w,space) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_stringify", 120);-_yuitest_coverline("build/json-stringify/json-stringify.js", 121);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_stringify", 125);+_yuitest_coverline("build/json-stringify/json-stringify.js", 126); if (o === undefined) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 122);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 127); return undefined; } - _yuitest_coverline("build/json-stringify/json-stringify.js", 125);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 130); var replacer = isFunction(w) ? w : null, format = _toStr.call(space).match(/String|Number/) || [], _date = Y.JSON.dateToString, stack = [], tmp,i,len; - _yuitest_coverline("build/json-stringify/json-stringify.js", 131);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 136); _CHAR_COUNT = {};- _yuitest_coverline("build/json-stringify/json-stringify.js", 132);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 137); _CACHE_THRESHOLD = Y.JSON.charCacheThreshold; - _yuitest_coverline("build/json-stringify/json-stringify.js", 134);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 139); if (replacer || !isArray(w)) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 135);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 140); w = undefined; } // Ensure whitelist keys are unique (bug 2110391)- _yuitest_coverline("build/json-stringify/json-stringify.js", 139);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 144); if (w) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 140);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 145); tmp = {};- _yuitest_coverline("build/json-stringify/json-stringify.js", 141);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 146); for (i = 0, len = w.length; i < len; ++i) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 142);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 147); tmp[w[i]] = true; }- _yuitest_coverline("build/json-stringify/json-stringify.js", 144);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 149); w = tmp; } // Per the spec, strings are truncated to 10 characters and numbers // are converted to that number of spaces (max 10)- _yuitest_coverline("build/json-stringify/json-stringify.js", 149);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 154); space = format[0] === 'Number' ? new Array(Math.min(Math.max(0,space),10)+1).join(" ") : (space || EMPTY).slice(0,10); - _yuitest_coverline("build/json-stringify/json-stringify.js", 153);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 158); function _serialize(h,key) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_serialize", 153);-_yuitest_coverline("build/json-stringify/json-stringify.js", 154);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_serialize", 158);+_yuitest_coverline("build/json-stringify/json-stringify.js", 159); var value = h[key], t = _type(value), a = [],@@ -244,87 +253,87 @@ // called. Also per the spec, Date.prototype.toJSON has been added, so // Date instances should be serialized prior to exposure to the // replacer. I disagree with this decision, but the spec is the spec.- _yuitest_coverline("build/json-stringify/json-stringify.js", 164);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 169); if (isObject(value) && isFunction(value.toJSON)) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 165);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 170); value = value.toJSON(key);- } else {_yuitest_coverline("build/json-stringify/json-stringify.js", 166);+ } else {_yuitest_coverline("build/json-stringify/json-stringify.js", 171); if (t === DATE) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 167);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 172); value = _date(value); }} - _yuitest_coverline("build/json-stringify/json-stringify.js", 170);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 175); if (isFunction(replacer)) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 171);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 176); value = replacer.call(h,key,value); } - _yuitest_coverline("build/json-stringify/json-stringify.js", 174);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 179); if (value !== h[key]) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 175);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 180); t = _type(value); } - _yuitest_coverline("build/json-stringify/json-stringify.js", 178);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 183); switch (t) { case DATE : // intentional fallthrough. Pre-replacer Dates are // serialized in the toJSON stage. Dates here would // have been produced by the replacer.- case OBJECT : _yuitest_coverline("build/json-stringify/json-stringify.js", 182);+ case OBJECT : _yuitest_coverline("build/json-stringify/json-stringify.js", 187); break;- case STRING : _yuitest_coverline("build/json-stringify/json-stringify.js", 183);+ case STRING : _yuitest_coverline("build/json-stringify/json-stringify.js", 188); return _string(value);- case NUMBER : _yuitest_coverline("build/json-stringify/json-stringify.js", 184);+ case NUMBER : _yuitest_coverline("build/json-stringify/json-stringify.js", 189); return isFinite(value) ? value+EMPTY : NULL;- case BOOLEAN : _yuitest_coverline("build/json-stringify/json-stringify.js", 185);+ case BOOLEAN : _yuitest_coverline("build/json-stringify/json-stringify.js", 190); return value+EMPTY;- case NULL : _yuitest_coverline("build/json-stringify/json-stringify.js", 186);+ case NULL : _yuitest_coverline("build/json-stringify/json-stringify.js", 191); return NULL;- default : _yuitest_coverline("build/json-stringify/json-stringify.js", 187);+ default : _yuitest_coverline("build/json-stringify/json-stringify.js", 192); return undefined; } // Check for cyclical references in nested objects- _yuitest_coverline("build/json-stringify/json-stringify.js", 191);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 196); for (i = stack.length - 1; i >= 0; --i) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 192);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 197); if (stack[i] === value) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 193);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 198); throw new Error("JSON.stringify. Cyclical reference"); } } - _yuitest_coverline("build/json-stringify/json-stringify.js", 197);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 202); arr = isArray(value); // Add the object to the processing stack- _yuitest_coverline("build/json-stringify/json-stringify.js", 200);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 205); stack.push(value); - _yuitest_coverline("build/json-stringify/json-stringify.js", 202);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 207); if (arr) { // Array- _yuitest_coverline("build/json-stringify/json-stringify.js", 203);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 208); for (i = value.length - 1; i >= 0; --i) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 204);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 209); a[i] = _serialize(value, i) || NULL; } } else { // Object // If whitelist provided, take only those keys- _yuitest_coverline("build/json-stringify/json-stringify.js", 208);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 213); keys = w || value;- _yuitest_coverline("build/json-stringify/json-stringify.js", 209);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 214); i = 0; - _yuitest_coverline("build/json-stringify/json-stringify.js", 211);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 216); for (k in keys) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 212);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 217); if (keys.hasOwnProperty(k)) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 213);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 218); v = _serialize(value, k);- _yuitest_coverline("build/json-stringify/json-stringify.js", 214);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 219); if (v) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 215);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 220); a[i++] = _string(k) + colon + v; } }@@ -332,17 +341,17 @@ } // remove the array from the stack- _yuitest_coverline("build/json-stringify/json-stringify.js", 222);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 227); stack.pop(); - _yuitest_coverline("build/json-stringify/json-stringify.js", 224);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 229); if (space && a.length) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 225);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 230); return arr ? OPEN_A + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_A : OPEN_O + CR + _indent(a.join(COMMA_CR), space) + CR + CLOSE_O; } else {- _yuitest_coverline("build/json-stringify/json-stringify.js", 229);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 234); return arr ? OPEN_A + a.join(COMMA) + CLOSE_A : OPEN_O + a.join(COMMA) + CLOSE_O;@@ -350,25 +359,25 @@ } // process the input- _yuitest_coverline("build/json-stringify/json-stringify.js", 236);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 241); return _serialize({'':o},''); } // Double check basic native functionality. This is primarily to catch broken // early JSON API implementations in Firefox 3.1 beta1 and beta2.-_yuitest_coverline("build/json-stringify/json-stringify.js", 241);+_yuitest_coverline("build/json-stringify/json-stringify.js", 246); if ( Native ) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 242);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 247); try {- _yuitest_coverline("build/json-stringify/json-stringify.js", 243);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 248); useNative = ( '0' === Native.stringify(0) ); } catch ( e ) {- _yuitest_coverline("build/json-stringify/json-stringify.js", 245);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 250); useNative = false; } } -_yuitest_coverline("build/json-stringify/json-stringify.js", 249);+_yuitest_coverline("build/json-stringify/json-stringify.js", 254); Y.mix(Y.namespace('JSON'),{ /** * Leverage native JSON stringify if the browser has a native@@ -395,15 +404,15 @@ * @static */ dateToString : function (d) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "dateToString", 274);-_yuitest_coverline("build/json-stringify/json-stringify.js", 275);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "dateToString", 279);+_yuitest_coverline("build/json-stringify/json-stringify.js", 280); function _zeroPad(v) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_zeroPad", 275);-_yuitest_coverline("build/json-stringify/json-stringify.js", 276);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "_zeroPad", 280);+_yuitest_coverline("build/json-stringify/json-stringify.js", 281); return v < 10 ? '0' + v : v; } - _yuitest_coverline("build/json-stringify/json-stringify.js", 279);+ _yuitest_coverline("build/json-stringify/json-stringify.js", 284); return d.getUTCFullYear() + '-' + _zeroPad(d.getUTCMonth() + 1) + '-' + _zeroPad(d.getUTCDate()) + 'T' +@@ -440,8 +449,8 @@ * @static */ stringify : function (o,w,ind) {- _yuitest_coverfunc("build/json-stringify/json-stringify.js", "stringify", 314);-_yuitest_coverline("build/json-stringify/json-stringify.js", 315);+ _yuitest_coverfunc("build/json-stringify/json-stringify.js", "stringify", 319);+_yuitest_coverline("build/json-stringify/json-stringify.js", 320); return Native && Y.JSON.useNativeStringify ? Native.stringify(o,w,ind) : _stringify(o,w,ind); },@@ -475,4 +484,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/json-stringify/json-stringify-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -14,7 +14,12 @@ * @for JSON * @static */-var _JSON = (Y.config.win || {}).JSON,+// All internals kept private for security reasons+function fromGlobal(ref) {+ var g = ((typeof global === 'object') ? global : undefined);+ return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];+}+var _JSON = fromGlobal('JSON'), Lang = Y.Lang, isFunction= Lang.isFunction, isObject = Lang.isObject,@@ -351,4 +356,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/json-stringify/json-stringify-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("json-stringify",function(e,t){function H(e){var t=typeof e;return g[t]||g[u.call(e)]||(t===c?e?c:h:l)}function B(e){return _[e]||(_[e]="\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4),D[e]=0),++D[e]===P&&(O.push([new RegExp(e,"g"),_[e]]),M=O.length),_[e]}function j(e){var t,n;for(t=0;t<M;t++)n=O[t],e=e.replace(n[0],n[1]);return L+e.replace(A,B)+L}function F(e,t){return e.replace(/^/gm,t)}function I(t,n,r){function M(e,t){var u=e[t],f=H(u),L=[],A=r?k:C,O,_,D,P,B;s(u)&&i(u.toJSON)?u=u.toJSON(t):f===m&&(u=l(u)),i(a)&&(u=a.call(e,t,u)),u!==e[t]&&(f=H(u));switch(f){case m:case c:break;case p:return j(u);case d:return isFinite(u)?u+y:h;case v:return u+y;case h:return h;default:return undefined}for(_=g.length-1;_>=0;--_)if(g[_]===u)throw new Error("JSON.stringify. Cyclical reference");O=o(u),g.push(u);if(O)for(_=u.length-1;_>=0;--_)L[_]=M(u,_)||h;else{D=n||u,_=0;for(P in D)D.hasOwnProperty(P)&&(B=M(u,P),B&&(L[_++]=j(P)+A+B))}return g.pop(),r&&L.length?O?E+N+F(L.join(T),r)+N+S:b+N+F(L.join(T),r)+N+w:O?E+L.join(x)+S:b+L.join(x)+w}if(t===undefined)return undefined;var a=i(n)?n:null,f=u.call(r).match(/String|Number/)||[],l=e.JSON.dateToString,g=[],L,A,O;D={},P=e.JSON.charCacheThreshold;if(a||!o(n))n=undefined;if(n){L={};for(A=0,O=n.length;A<O;++A)L[n[A]]=!0;n=L}return r=f[0]==="Number"?(new Array(Math.min(Math.max(0,r),10)+1)).join(" "):(r||y).slice(0,10),M({"":t},"")}var n=(e.config.win||{}).JSON,r=e.Lang,i=r.isFunction,s=r.isObject,o=r.isArray,u=Object.prototype.toString,a=u.call(n)==="[object JSON]"&&n,f=!!a,l="undefined",c="object",h="null",p="string",d="number",v="boolean",m="date",g={"undefined":l,string:p,"[object String]":p,number:d,"[object Number]":d,"boolean":v,"[object Boolean]":v,"[object Date]":m,"[object RegExp]":c},y="",b="{",w="}",E="[",S="]",x=",",T=",\n",N="\n",C=":",k=": ",L='"',A=/[\x00-\x07\x0b\x0e-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,O=[[/\\/g,"\\\\"],[/\"/g,'\\"'],[/\x08/g,"\\b"],[/\x09/g,"\\t"],[/\x0a/g,"\\n"],[/\x0c/g,"\\f"],[/\x0d/g,"\\r"]],M=O.length,_={},D,P;if(a)try{f="0"===a.stringify(0)}catch(q){f=!1}e.mix(e.namespace("JSON"),{useNativeStringify:f,dateToString:function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+C+t(e.getUTCMinutes())+C+t(e.getUTCSeconds())+"Z"},stringify:function(t,n,r){return a&&e.JSON.useNativeStringify?a.stringify(t,n,r):I(t,n,r)},charCacheThreshold:100})},"3.7.2",{requires:["yui-base"]});+YUI.add("json-stringify",function(e,t){function n(t){var n=typeof global=="object"?global:undefined;return(e.UA.nodejs&&n?n:e.config.win||{})[t]}function B(e){var t=typeof e;return y[t]||y[a.call(e)]||(t===h?e?h:p:c)}function j(e){return D[e]||(D[e]="\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4),P[e]=0),++P[e]===H&&(M.push([new RegExp(e,"g"),D[e]]),_=M.length),D[e]}function F(e){var t,n;for(t=0;t<_;t++)n=M[t],e=e.replace(n[0],n[1]);return A+e.replace(O,j)+A}function I(e,t){return e.replace(/^/gm,t)}function q(t,n,r){function M(e,t){var a=e[t],f=B(a),y=[],A=r?L:k,O,_,D,P,H;o(a)&&s(a.toJSON)?a=a.toJSON(t):f===g&&(a=l(a)),s(i)&&(a=i.call(e,t,a)),a!==e[t]&&(f=B(a));switch(f){case g:case h:break;case d:return F(a);case v:return isFinite(a)?a+b:p;case m:return a+b;case p:return p;default:return undefined}for(_=c.length-1;_>=0;--_)if(c[_]===a)throw new Error("JSON.stringify. Cyclical reference");O=u(a),c.push(a);if(O)for(_=a.length-1;_>=0;--_)y[_]=M(a,_)||p;else{D=n||a,_=0;for(P in D)D.hasOwnProperty(P)&&(H=M(a,P),H&&(y[_++]=F(P)+A+H))}return c.pop(),r&&y.length?O?S+C+I(y.join(N),r)+C+x:w+C+I(y.join(N),r)+C+E:O?S+y.join(T)+x:w+y.join(T)+E}if(t===undefined)return undefined;var i=s(n)?n:null,f=a.call(r).match(/String|Number/)||[],l=e.JSON.dateToString,c=[],y,A,O;P={},H=e.JSON.charCacheThreshold;if(i||!u(n))n=undefined;if(n){y={};for(A=0,O=n.length;A<O;++A)y[n[A]]=!0;n=y}return r=f[0]==="Number"?(new Array(Math.min(Math.max(0,r),10)+1)).join(" "):(r||b).slice(0,10),M({"":t},"")}var r=n("JSON"),i=e.Lang,s=i.isFunction,o=i.isObject,u=i.isArray,a=Object.prototype.toString,f=a.call(r)==="[object JSON]"&&r,l=!!f,c="undefined",h="object",p="null",d="string",v="number",m="boolean",g="date",y={"undefined":c,string:d,"[object String]":d,number:v,"[object Number]":v,"boolean":m,"[object Boolean]":m,"[object Date]":g,"[object RegExp]":h},b="",w="{",E="}",S="[",x="]",T=",",N=",\n",C="\n",k=":",L=": ",A='"',O=/[\x00-\x07\x0b\x0e-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,M=[[/\\/g,"\\\\"],[/\"/g,'\\"'],[/\x08/g,"\\b"],[/\x09/g,"\\t"],[/\x0a/g,"\\n"],[/\x0c/g,"\\f"],[/\x0d/g,"\\r"]],_=M.length,D={},P,H;if(f)try{l="0"===f.stringify(0)}catch(R){l=!1}e.mix(e.namespace("JSON"),{useNativeStringify:l,dateToString:function(e){function t(e){return e<10?"0"+e:e}return e.getUTCFullYear()+"-"+t(e.getUTCMonth()+1)+"-"+t(e.getUTCDate())+"T"+t(e.getUTCHours())+k+t(e.getUTCMinutes())+k+t(e.getUTCSeconds())+"Z"},stringify:function(t,n,r){return f&&e.JSON.useNativeStringify?f.stringify(t,n,r):q(t,n,r)},charCacheThreshold:100})},"3.7.3",{requires:["yui-base"]});
bundle/json-stringify/json-stringify.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -14,7 +14,12 @@ * @for JSON * @static */-var _JSON = (Y.config.win || {}).JSON,+// All internals kept private for security reasons+function fromGlobal(ref) {+ var g = ((typeof global === 'object') ? global : undefined);+ return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref];+}+var _JSON = fromGlobal('JSON'), Lang = Y.Lang, isFunction= Lang.isFunction, isObject = Lang.isObject,@@ -351,4 +356,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/jsonp-url/jsonp-url-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/jsonp-url/jsonp-url.js", code: [] };-_yuitest_coverage["build/jsonp-url/jsonp-url.js"].code=["YUI.add('jsonp-url', function (Y, NAME) {","","var JSONPRequest = Y.JSONPRequest,"," getByPath = Y.Object.getValue,"," noop = function () {};","","/**"," * Adds support for parsing complex callback identifiers from the jsonp url."," * This includes callback=foo[1]bar.baz[\"goo\"] as well as referencing methods"," * in the YUI instance."," *"," * @module jsonp"," * @submodule jsonp-url"," * @for JSONPRequest"," */","","Y.mix(JSONPRequest.prototype, {"," /**"," * RegExp used by the default URL formatter to insert the generated callback"," * name into the JSONP url. Looks for a query param callback=. If a value"," * is assigned, it will be clobbered."," *"," * @property _pattern"," * @type RegExp"," * @default /\\bcallback=.*?(?=&|$)/i"," * @protected"," */"," _pattern: /\\bcallback=(.*?)(?=&|$)/i,",""," /**"," * Template used by the default URL formatter to add the callback function"," * name to the url."," *"," * @property _template"," * @type String"," * @default \"callback={callback}\""," * @protected"," */"," _template: \"callback={callback}\",",""," /**"," * <p>Parses the url for a callback named explicitly in the string."," * Override this if the target JSONP service uses a different query"," * parameter or url format.</p>"," *"," * <p>If the callback is declared inline, the corresponding function will"," * be returned. Otherwise null.</p>"," *"," * @method _defaultCallback"," * @param url {String} the url to search in"," * @return {Function} the callback function if found, or null"," * @protected"," */"," _defaultCallback: function (url) {"," var match = url.match(this._pattern),"," keys = [],"," i = 0,"," locator, path, callback;",""," if (match) {"," // Strip the [\"string keys\"] and [1] array indexes"," locator = match[1]"," .replace(/\\[(['\"])(.*?)\\1\\]/g,"," function (x, $1, $2) {"," keys[i] = $2;"," return '.@' + (i++);"," })"," .replace(/\\[(\\d+)\\]/g,"," function (x, $1) {"," keys[i] = parseInt($1, 10) | 0;"," return '.@' + (i++);"," })"," .replace(/^\\./, ''); // remove leading dot",""," // Validate against problematic characters."," if (!/[^\\w\\.\\$@]/.test(locator)) {"," path = locator.split('.');"," for (i = path.length - 1; i >= 0; --i) {"," if (path[i].charAt(0) === '@') {"," path[i] = keys[parseInt(path[i].substr(1), 10)];"," }"," }",""," // First look for a global function, then the Y, then try the Y"," // again from the second token (to support \"callback=Y.handler\")"," callback = getByPath(Y.config.win, path) ||"," getByPath(Y, path) ||"," getByPath(Y, path.slice(1));"," }"," }",""," return callback || noop;"," },",""," /**"," * URL formatter that looks for callback= in the url and appends it"," * if not present. The supplied proxy name will be assigned to the query"," * param. Override this method by passing a function as the"," * "format" property in the config object to the constructor."," *"," * @method _format"," * @param url { String } the original url"," * @param proxy {String} the function name that will be used as a proxy to"," * the configured callback methods."," * @return {String} fully qualified JSONP url"," * @protected"," */"," _format: function (url, proxy) {"," var callback = this._template.replace(/\\{callback\\}/, proxy),"," lastChar;",""," if (this._pattern.test(url)) {"," return url.replace(this._pattern, callback);"," } else {"," lastChar = url.slice(-1);"," if (lastChar !== '&' && lastChar !== '?') {"," url += (url.indexOf('?') > -1) ? '&' : '?';"," }"," return url + callback;"," }"," }","","}, true);","","","}, '3.7.2', {\"requires\": [\"jsonp\"]});"];+_yuitest_coverage["build/jsonp-url/jsonp-url.js"].code=["YUI.add('jsonp-url', function (Y, NAME) {","","var JSONPRequest = Y.JSONPRequest,"," getByPath = Y.Object.getValue,"," noop = function () {};","","/**"," * Adds support for parsing complex callback identifiers from the jsonp url."," * This includes callback=foo[1]bar.baz[\"goo\"] as well as referencing methods"," * in the YUI instance."," *"," * @module jsonp"," * @submodule jsonp-url"," * @for JSONPRequest"," */","","Y.mix(JSONPRequest.prototype, {"," /**"," * RegExp used by the default URL formatter to insert the generated callback"," * name into the JSONP url. Looks for a query param callback=. If a value"," * is assigned, it will be clobbered."," *"," * @property _pattern"," * @type RegExp"," * @default /\\bcallback=.*?(?=&|$)/i"," * @protected"," */"," _pattern: /\\bcallback=(.*?)(?=&|$)/i,",""," /**"," * Template used by the default URL formatter to add the callback function"," * name to the url."," *"," * @property _template"," * @type String"," * @default \"callback={callback}\""," * @protected"," */"," _template: \"callback={callback}\",",""," /**"," * <p>Parses the url for a callback named explicitly in the string."," * Override this if the target JSONP service uses a different query"," * parameter or url format.</p>"," *"," * <p>If the callback is declared inline, the corresponding function will"," * be returned. Otherwise null.</p>"," *"," * @method _defaultCallback"," * @param url {String} the url to search in"," * @return {Function} the callback function if found, or null"," * @protected"," */"," _defaultCallback: function (url) {"," var match = url.match(this._pattern),"," keys = [],"," i = 0,"," locator, path, callback;",""," if (match) {"," // Strip the [\"string keys\"] and [1] array indexes"," locator = match[1]"," .replace(/\\[(['\"])(.*?)\\1\\]/g,"," function (x, $1, $2) {"," keys[i] = $2;"," return '.@' + (i++);"," })"," .replace(/\\[(\\d+)\\]/g,"," function (x, $1) {"," keys[i] = parseInt($1, 10) | 0;"," return '.@' + (i++);"," })"," .replace(/^\\./, ''); // remove leading dot",""," // Validate against problematic characters."," if (!/[^\\w\\.\\$@]/.test(locator)) {"," path = locator.split('.');"," for (i = path.length - 1; i >= 0; --i) {"," if (path[i].charAt(0) === '@') {"," path[i] = keys[parseInt(path[i].substr(1), 10)];"," }"," }",""," // First look for a global function, then the Y, then try the Y"," // again from the second token (to support \"callback=Y.handler\")"," callback = getByPath(Y.config.win, path) ||"," getByPath(Y, path) ||"," getByPath(Y, path.slice(1));"," }"," }",""," return callback || noop;"," },",""," /**"," * URL formatter that looks for callback= in the url and appends it"," * if not present. The supplied proxy name will be assigned to the query"," * param. Override this method by passing a function as the"," * "format" property in the config object to the constructor."," *"," * @method _format"," * @param url { String } the original url"," * @param proxy {String} the function name that will be used as a proxy to"," * the configured callback methods."," * @return {String} fully qualified JSONP url"," * @protected"," */"," _format: function (url, proxy) {"," var callback = this._template.replace(/\\{callback\\}/, proxy),"," lastChar;",""," if (this._pattern.test(url)) {"," return url.replace(this._pattern, callback);"," } else {"," lastChar = url.slice(-1);"," if (lastChar !== '&' && lastChar !== '?') {"," url += (url.indexOf('?') > -1) ? '&' : '?';"," }"," return url + callback;"," }"," }","","}, true);","","","}, '3.7.3', {\"requires\": [\"jsonp\"]});"]; _yuitest_coverage["build/jsonp-url/jsonp-url.js"].lines = {"1":0,"3":0,"17":0,"55":0,"60":0,"62":0,"65":0,"66":0,"70":0,"71":0,"76":0,"77":0,"78":0,"79":0,"80":0,"86":0,"92":0,"109":0,"112":0,"113":0,"115":0,"116":0,"117":0,"119":0}; _yuitest_coverage["build/jsonp-url/jsonp-url.js"].functions = {"(anonymous 2):64":0,"(anonymous 3):69":0,"_defaultCallback:54":0,"_format:108":0,"(anonymous 1):1":0}; _yuitest_coverage["build/jsonp-url/jsonp-url.js"].coveredLines = 24;@@ -191,4 +191,4 @@ }, true); -}, '3.7.2', {"requires": ["jsonp"]});+}, '3.7.3', {"requires": ["jsonp"]});
bundle/jsonp-url/jsonp-url-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -129,4 +129,4 @@ }, true); -}, '3.7.2', {"requires": ["jsonp"]});+}, '3.7.3', {"requires": ["jsonp"]});
bundle/jsonp-url/jsonp-url-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("jsonp-url",function(e,t){var n=e.JSONPRequest,r=e.Object.getValue,i=function(){};e.mix(n.prototype,{_pattern:/\bcallback=(.*?)(?=&|$)/i,_template:"callback={callback}",_defaultCallback:function(t){var n=t.match(this._pattern),s=[],o=0,u,a,f;if(n){u=n[1].replace(/\[(['"])(.*?)\1\]/g,function(e,t,n){return s[o]=n,".@"+o++}).replace(/\[(\d+)\]/g,function(e,t){return s[o]=parseInt(t,10)|0,".@"+o++}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(u)){a=u.split(".");for(o=a.length-1;o>=0;--o)a[o].charAt(0)==="@"&&(a[o]=s[parseInt(a[o].substr(1),10)]);f=r(e.config.win,a)||r(e,a)||r(e,a.slice(1))}}return f||i},_format:function(e,t){var n=this._template.replace(/\{callback\}/,t),r;return this._pattern.test(e)?e.replace(this._pattern,n):(r=e.slice(-1),r!=="&"&&r!=="?"&&(e+=e.indexOf("?")>-1?"&":"?"),e+n)}},!0)},"3.7.2",{requires:["jsonp"]});+YUI.add("jsonp-url",function(e,t){var n=e.JSONPRequest,r=e.Object.getValue,i=function(){};e.mix(n.prototype,{_pattern:/\bcallback=(.*?)(?=&|$)/i,_template:"callback={callback}",_defaultCallback:function(t){var n=t.match(this._pattern),s=[],o=0,u,a,f;if(n){u=n[1].replace(/\[(['"])(.*?)\1\]/g,function(e,t,n){return s[o]=n,".@"+o++}).replace(/\[(\d+)\]/g,function(e,t){return s[o]=parseInt(t,10)|0,".@"+o++}).replace(/^\./,"");if(!/[^\w\.\$@]/.test(u)){a=u.split(".");for(o=a.length-1;o>=0;--o)a[o].charAt(0)==="@"&&(a[o]=s[parseInt(a[o].substr(1),10)]);f=r(e.config.win,a)||r(e,a)||r(e,a.slice(1))}}return f||i},_format:function(e,t){var n=this._template.replace(/\{callback\}/,t),r;return this._pattern.test(e)?e.replace(this._pattern,n):(r=e.slice(-1),r!=="&"&&r!=="?"&&(e+=e.indexOf("?")>-1?"&":"?"),e+n)}},!0)},"3.7.3",{requires:["jsonp"]});
bundle/jsonp-url/jsonp-url.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -129,4 +129,4 @@ }, true); -}, '3.7.2', {"requires": ["jsonp"]});+}, '3.7.3', {"requires": ["jsonp"]});
bundle/jsonp/jsonp-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/jsonp/jsonp.js", code: [] };-_yuitest_coverage["build/jsonp/jsonp.js"].code=["YUI.add('jsonp', function (Y, NAME) {","","var isFunction = Y.Lang.isFunction;","","/**"," * <p>Provides a JSONPRequest class for repeated JSONP calls, and a convenience"," * method Y.jsonp(url, callback) to instantiate and send a JSONP request.</p>"," *"," * <p>Both the constructor as well as the convenience function take two"," * parameters: a url string and a callback.</p>"," *"," * <p>The url provided must include the placeholder string"," * "{callback}" which will be replaced by a dynamically"," * generated routing function to pass the data to your callback function."," * An example url might look like"," * "http://example.com/service?callback={callback}".</p>"," *"," * <p>The second parameter can be a callback function that accepts the JSON"," * payload as its argument, or a configuration object supporting the keys:</p>"," * <ul>"," * <li>on - map of callback subscribers"," * <ul>"," * <li>success - function handler for successful transmission</li>"," * <li>failure - function handler for failed transmission</li>"," * <li>timeout - function handler for transactions that timeout</li>"," * </ul>"," * </li>"," * <li>format - override function for inserting the proxy name in the url</li>"," * <li>timeout - the number of milliseconds to wait before giving up</li>"," * <li>context - becomes <code>this</code> in the callbacks</li>"," * <li>args - array of subsequent parameters to pass to the callbacks</li>"," * <li>allowCache - use the same proxy name for all requests? (boolean)</li>"," * </ul>"," *"," * @module jsonp"," * @class JSONPRequest"," * @constructor"," * @param url {String} the url of the JSONP service"," * @param callback {Object|Function} the default callback configuration or"," * success handler"," */","function JSONPRequest() {"," this._init.apply(this, arguments);","}","","JSONPRequest.prototype = {"," /**"," * Set up the success and failure handlers and the regex pattern used"," * to insert the temporary callback name in the url."," *"," * @method _init"," * @param url {String} the url of the JSONP service"," * @param callback {Object|Function} Optional success callback or config"," * object containing success and failure functions and"," * the url regex."," * @protected"," */"," _init : function (url, callback) {"," this.url = url;",""," /**"," * Map of the number of requests currently pending responses per"," * generated proxy. Used to ensure the proxy is not flushed if the"," * request times out and there is a timeout handler and success"," * handler, and used by connections configured to allowCache to make"," * sure the proxy isn't deleted until the last response has returned."," *"," * @property _requests"," * @private"," * @type {Object}"," */"," this._requests = {};",""," /**"," * Map of the number of timeouts received from the destination url"," * by generated proxy. Used to ensure the proxy is not flushed if the"," * request times out and there is a timeout handler and success"," * handler, and used by connections configured to allowCache to make"," * sure the proxy isn't deleted until the last response has returned."," *"," * @property _timeouts"," * @private"," * @type {Object}"," */"," this._timeouts = {};",""," // Accept a function, an object, or nothing"," callback = (isFunction(callback)) ?"," { on: { success: callback } } :"," callback || {};",""," var subs = callback.on || {};",""," if (!subs.success) {"," subs.success = this._defaultCallback(url, callback);"," }",""," // Apply defaults and store"," this._config = Y.merge({"," context: this,"," args : [],"," format : this._format,"," allowCache: false"," }, callback, { on: subs });"," },",""," /** "," * Override this method to provide logic to default the success callback if"," * it is not provided at construction. This is overridden by jsonp-url to"," * parse the callback from the url string."," * "," * @method _defaultCallback"," * @param url {String} the url passed at construction"," * @param config {Object} (optional) the config object passed at"," * construction"," * @return {Function}"," */"," _defaultCallback: function () {},",""," /** "," * Issues the JSONP request."," *"," * @method send"," * @param args* {any} any additional arguments to pass to the url formatter"," * beyond the base url and the proxy function name"," * @chainable"," */"," send : function () {"," var self = this,"," args = Y.Array(arguments, 0, true),"," config = self._config,"," proxy = self._proxy || Y.guid(),"," url;"," "," // TODO: support allowCache as time value"," if (config.allowCache) {"," self._proxy = proxy;"," }",""," if (self._requests[proxy] === undefined) {"," self._requests[proxy] = 0;"," }"," if (self._timeouts[proxy] === undefined) {"," self._timeouts[proxy] = 0;"," }"," self._requests[proxy]++;","",""," args.unshift(self.url, 'YUI.Env.JSONP.' + proxy);"," url = config.format.apply(self, args);",""," if (!config.on.success) {"," return self;"," }",""," function wrap(fn, isTimeout) {"," return (isFunction(fn)) ?"," function (data) {"," var execute = true,"," counter = '_requests';",""," //if (config.allowCache) {"," // A lot of wrangling to make sure timeouts result in"," // fewer success callbacks, but the proxy is properly"," // cleaned up."," if (isTimeout) {"," ++self._timeouts[proxy];"," --self._requests[proxy];"," } else {"," if (!self._requests[proxy]) {"," execute = false;"," counter = '_timeouts';"," }"," --self[counter][proxy];"," }"," //}",""," if (!self._requests[proxy] && !self._timeouts[proxy]) {"," delete YUI.Env.JSONP[proxy];"," }",""," if (execute) {"," fn.apply(config.context, [data].concat(config.args));"," }"," } :"," null;"," }",""," // Temporary un-sandboxed function alias"," // TODO: queuing"," YUI.Env.JSONP[proxy] = wrap(config.on.success);",""," Y.Get.script(url, {"," onFailure : wrap(config.on.failure),"," onTimeout : wrap(config.on.timeout, true),"," timeout : config.timeout,"," charset : config.charset,"," attributes: config.attributes"," });",""," return self;"," },",""," /**"," * Default url formatter. Looks for callback= in the url and appends it"," * if not present. The supplied proxy name will be assigned to the query"," * param. Override this method by passing a function as the"," * "format" property in the config object to the constructor."," *"," * @method _format"," * @param url { String } the original url"," * @param proxy {String} the function name that will be used as a proxy to"," * the configured callback methods."," * @param args* {any} additional args passed to send()"," * @return {String} fully qualified JSONP url"," * @protected"," */"," _format: function (url, proxy) {"," return url.replace(/\\{callback\\}/, proxy);"," }","};","","Y.JSONPRequest = JSONPRequest;","","/**"," *"," * @method jsonp"," * @param url {String} the url of the JSONP service with the {callback}"," * placeholder where the callback function name typically goes."," * @param c {Function|Object} Callback function accepting the JSON payload"," * as its argument, or a configuration object (see above)."," * @param args* {any} additional arguments to pass to send()"," * @return {JSONPRequest}"," * @static"," * @for YUI"," */","Y.jsonp = function (url,c) {"," var req = new Y.JSONPRequest(url,c);"," return req.send.apply(req, Y.Array(arguments, 2, true));","};","","if (!YUI.Env.JSONP) {"," YUI.Env.JSONP = {};","}","","","}, '3.7.2', {\"requires\": [\"get\", \"oop\"]});"];+_yuitest_coverage["build/jsonp/jsonp.js"].code=["YUI.add('jsonp', function (Y, NAME) {","","var isFunction = Y.Lang.isFunction;","","/**"," * <p>Provides a JSONPRequest class for repeated JSONP calls, and a convenience"," * method Y.jsonp(url, callback) to instantiate and send a JSONP request.</p>"," *"," * <p>Both the constructor as well as the convenience function take two"," * parameters: a url string and a callback.</p>"," *"," * <p>The url provided must include the placeholder string"," * "{callback}" which will be replaced by a dynamically"," * generated routing function to pass the data to your callback function."," * An example url might look like"," * "http://example.com/service?callback={callback}".</p>"," *"," * <p>The second parameter can be a callback function that accepts the JSON"," * payload as its argument, or a configuration object supporting the keys:</p>"," * <ul>"," * <li>on - map of callback subscribers"," * <ul>"," * <li>success - function handler for successful transmission</li>"," * <li>failure - function handler for failed transmission</li>"," * <li>timeout - function handler for transactions that timeout</li>"," * </ul>"," * </li>"," * <li>format - override function for inserting the proxy name in the url</li>"," * <li>timeout - the number of milliseconds to wait before giving up</li>"," * <li>context - becomes <code>this</code> in the callbacks</li>"," * <li>args - array of subsequent parameters to pass to the callbacks</li>"," * <li>allowCache - use the same proxy name for all requests? (boolean)</li>"," * </ul>"," *"," * @module jsonp"," * @class JSONPRequest"," * @constructor"," * @param url {String} the url of the JSONP service"," * @param callback {Object|Function} the default callback configuration or"," * success handler"," */","function JSONPRequest() {"," this._init.apply(this, arguments);","}","","JSONPRequest.prototype = {"," /**"," * Set up the success and failure handlers and the regex pattern used"," * to insert the temporary callback name in the url."," *"," * @method _init"," * @param url {String} the url of the JSONP service"," * @param callback {Object|Function} Optional success callback or config"," * object containing success and failure functions and"," * the url regex."," * @protected"," */"," _init : function (url, callback) {"," this.url = url;",""," /**"," * Map of the number of requests currently pending responses per"," * generated proxy. Used to ensure the proxy is not flushed if the"," * request times out and there is a timeout handler and success"," * handler, and used by connections configured to allowCache to make"," * sure the proxy isn't deleted until the last response has returned."," *"," * @property _requests"," * @private"," * @type {Object}"," */"," this._requests = {};",""," /**"," * Map of the number of timeouts received from the destination url"," * by generated proxy. Used to ensure the proxy is not flushed if the"," * request times out and there is a timeout handler and success"," * handler, and used by connections configured to allowCache to make"," * sure the proxy isn't deleted until the last response has returned."," *"," * @property _timeouts"," * @private"," * @type {Object}"," */"," this._timeouts = {};",""," // Accept a function, an object, or nothing"," callback = (isFunction(callback)) ?"," { on: { success: callback } } :"," callback || {};",""," var subs = callback.on || {};",""," if (!subs.success) {"," subs.success = this._defaultCallback(url, callback);"," }",""," // Apply defaults and store"," this._config = Y.merge({"," context: this,"," args : [],"," format : this._format,"," allowCache: false"," }, callback, { on: subs });"," },",""," /** "," * Override this method to provide logic to default the success callback if"," * it is not provided at construction. This is overridden by jsonp-url to"," * parse the callback from the url string."," * "," * @method _defaultCallback"," * @param url {String} the url passed at construction"," * @param config {Object} (optional) the config object passed at"," * construction"," * @return {Function}"," */"," _defaultCallback: function () {},",""," /** "," * Issues the JSONP request."," *"," * @method send"," * @param args* {any} any additional arguments to pass to the url formatter"," * beyond the base url and the proxy function name"," * @chainable"," */"," send : function () {"," var self = this,"," args = Y.Array(arguments, 0, true),"," config = self._config,"," proxy = self._proxy || Y.guid(),"," url;"," "," // TODO: support allowCache as time value"," if (config.allowCache) {"," self._proxy = proxy;"," }",""," if (self._requests[proxy] === undefined) {"," self._requests[proxy] = 0;"," }"," if (self._timeouts[proxy] === undefined) {"," self._timeouts[proxy] = 0;"," }"," self._requests[proxy]++;","",""," args.unshift(self.url, 'YUI.Env.JSONP.' + proxy);"," url = config.format.apply(self, args);",""," if (!config.on.success) {"," return self;"," }",""," function wrap(fn, isTimeout) {"," return (isFunction(fn)) ?"," function (data) {"," var execute = true,"," counter = '_requests';",""," //if (config.allowCache) {"," // A lot of wrangling to make sure timeouts result in"," // fewer success callbacks, but the proxy is properly"," // cleaned up."," if (isTimeout) {"," ++self._timeouts[proxy];"," --self._requests[proxy];"," } else {"," if (!self._requests[proxy]) {"," execute = false;"," counter = '_timeouts';"," }"," --self[counter][proxy];"," }"," //}",""," if (!self._requests[proxy] && !self._timeouts[proxy]) {"," delete YUI.Env.JSONP[proxy];"," }",""," if (execute) {"," fn.apply(config.context, [data].concat(config.args));"," }"," } :"," null;"," }",""," // Temporary un-sandboxed function alias"," // TODO: queuing"," YUI.Env.JSONP[proxy] = wrap(config.on.success);",""," Y.Get.script(url, {"," onFailure : wrap(config.on.failure),"," onTimeout : wrap(config.on.timeout, true),"," timeout : config.timeout,"," charset : config.charset,"," attributes: config.attributes"," });",""," return self;"," },",""," /**"," * Default url formatter. Looks for callback= in the url and appends it"," * if not present. The supplied proxy name will be assigned to the query"," * param. Override this method by passing a function as the"," * "format" property in the config object to the constructor."," *"," * @method _format"," * @param url { String } the original url"," * @param proxy {String} the function name that will be used as a proxy to"," * the configured callback methods."," * @param args* {any} additional args passed to send()"," * @return {String} fully qualified JSONP url"," * @protected"," */"," _format: function (url, proxy) {"," return url.replace(/\\{callback\\}/, proxy);"," }","};","","Y.JSONPRequest = JSONPRequest;","","/**"," *"," * @method jsonp"," * @param url {String} the url of the JSONP service with the {callback}"," * placeholder where the callback function name typically goes."," * @param c {Function|Object} Callback function accepting the JSON payload"," * as its argument, or a configuration object (see above)."," * @param args* {any} additional arguments to pass to send()"," * @return {JSONPRequest}"," * @static"," * @for YUI"," */","Y.jsonp = function (url,c) {"," var req = new Y.JSONPRequest(url,c);"," return req.send.apply(req, Y.Array(arguments, 2, true));","};","","if (!YUI.Env.JSONP) {"," YUI.Env.JSONP = {};","}","","","}, '3.7.3', {\"requires\": [\"get\", \"oop\"]});"]; _yuitest_coverage["build/jsonp/jsonp.js"].lines = {"1":0,"3":0,"42":0,"43":0,"46":0,"59":0,"72":0,"85":0,"88":0,"92":0,"94":0,"95":0,"99":0,"129":0,"136":0,"137":0,"140":0,"141":0,"143":0,"144":0,"146":0,"149":0,"150":0,"152":0,"153":0,"156":0,"157":0,"159":0,"166":0,"167":0,"168":0,"170":0,"171":0,"172":0,"174":0,"178":0,"179":0,"182":0,"183":0,"191":0,"193":0,"201":0,"219":0,"223":0,"237":0,"238":0,"239":0,"242":0,"243":0}; _yuitest_coverage["build/jsonp/jsonp.js"].functions = {"JSONPRequest:42":0,"_init:58":0,"(anonymous 2):158":0,"wrap:156":0,"send:128":0,"_format:218":0,"jsonp:237":0,"(anonymous 1):1":0}; _yuitest_coverage["build/jsonp/jsonp.js"].coveredLines = 49;@@ -340,4 +340,4 @@ } -}, '3.7.2', {"requires": ["get", "oop"]});+}, '3.7.3', {"requires": ["get", "oop"]});
bundle/jsonp/jsonp-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -255,4 +255,4 @@ } -}, '3.7.2', {"requires": ["get", "oop"]});+}, '3.7.3', {"requires": ["get", "oop"]});
bundle/jsonp/jsonp-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("jsonp",function(e,t){function r(){this._init.apply(this,arguments)}var n=e.Lang.isFunction;r.prototype={_init:function(t,r){this.url=t,this._requests={},this._timeouts={},r=n(r)?{on:{success:r}}:r||{};var i=r.on||{};i.success||(i.success=this._defaultCallback(t,r)),this._config=e.merge({context:this,args:[],format:this._format,allowCache:!1},r,{on:i})},_defaultCallback:function(){},send:function(){function u(e,r){return n(e)?function(n){var o=!0,u="_requests";r?(++t._timeouts[s],--t._requests[s]):(t._requests[s]||(o=!1,u="_timeouts"),--t[u][s]),!t._requests[s]&&!t._timeouts[s]&&delete YUI.Env.JSONP[s],o&&e.apply(i.context,[n].concat(i.args))}:null}var t=this,r=e.Array(arguments,0,!0),i=t._config,s=t._proxy||e.guid(),o;return i.allowCache&&(t._proxy=s),t._requests[s]===undefined&&(t._requests[s]=0),t._timeouts[s]===undefined&&(t._timeouts[s]=0),t._requests[s]++,r.unshift(t.url,"YUI.Env.JSONP."+s),o=i.format.apply(t,r),i.on.success?(YUI.Env.JSONP[s]=u(i.on.success),e.Get.script(o,{onFailure:u(i.on.failure),onTimeout:u(i.on.timeout,!0),timeout:i.timeout,charset:i.charset,attributes:i.attributes}),t):t},_format:function(e,t){return e.replace(/\{callback\}/,t)}},e.JSONPRequest=r,e.jsonp=function(t,n){var r=new e.JSONPRequest(t,n);return r.send.apply(r,e.Array(arguments,2,!0))},YUI.Env.JSONP||(YUI.Env.JSONP={})},"3.7.2",{requires:["get","oop"]});+YUI.add("jsonp",function(e,t){function r(){this._init.apply(this,arguments)}var n=e.Lang.isFunction;r.prototype={_init:function(t,r){this.url=t,this._requests={},this._timeouts={},r=n(r)?{on:{success:r}}:r||{};var i=r.on||{};i.success||(i.success=this._defaultCallback(t,r)),this._config=e.merge({context:this,args:[],format:this._format,allowCache:!1},r,{on:i})},_defaultCallback:function(){},send:function(){function u(e,r){return n(e)?function(n){var o=!0,u="_requests";r?(++t._timeouts[s],--t._requests[s]):(t._requests[s]||(o=!1,u="_timeouts"),--t[u][s]),!t._requests[s]&&!t._timeouts[s]&&delete YUI.Env.JSONP[s],o&&e.apply(i.context,[n].concat(i.args))}:null}var t=this,r=e.Array(arguments,0,!0),i=t._config,s=t._proxy||e.guid(),o;return i.allowCache&&(t._proxy=s),t._requests[s]===undefined&&(t._requests[s]=0),t._timeouts[s]===undefined&&(t._timeouts[s]=0),t._requests[s]++,r.unshift(t.url,"YUI.Env.JSONP."+s),o=i.format.apply(t,r),i.on.success?(YUI.Env.JSONP[s]=u(i.on.success),e.Get.script(o,{onFailure:u(i.on.failure),onTimeout:u(i.on.timeout,!0),timeout:i.timeout,charset:i.charset,attributes:i.attributes}),t):t},_format:function(e,t){return e.replace(/\{callback\}/,t)}},e.JSONPRequest=r,e.jsonp=function(t,n){var r=new e.JSONPRequest(t,n);return r.send.apply(r,e.Array(arguments,2,!0))},YUI.Env.JSONP||(YUI.Env.JSONP={})},"3.7.3",{requires:["get","oop"]});
bundle/jsonp/jsonp.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -250,4 +250,4 @@ } -}, '3.7.2', {"requires": ["get", "oop"]});+}, '3.7.3', {"requires": ["get", "oop"]});
bundle/lazy-model-list/lazy-model-list-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/lazy-model-list/lazy-model-list.js", code: [] };-_yuitest_coverage["build/lazy-model-list/lazy-model-list.js"].code=["YUI.add('lazy-model-list', function (Y, NAME) {","","/**","Provides the LazyModelList class, which is a ModelList subclass that manages","plain objects instead of fully instantiated model instances.","","@module app","@submodule lazy-model-list","@since 3.6.0","**/","","/**","LazyModelList is a subclass of ModelList that maintains a list of plain","JavaScript objects rather than a list of Model instances. This makes it","well-suited for managing large amounts of data (on the order of thousands of","items) that would tend to bog down a vanilla ModelList.","","The API presented by LazyModelList is the same as that of ModelList, except that","in every case where ModelList would provide a Model instance, LazyModelList","provides a plain JavaScript object. LazyModelList also provides a `revive()`","method that can convert the plain object at a given index into a full Model","instance.","","Since the items stored in a LazyModelList are plain objects and not full Model","instances, there are a few caveats to be aware of:",""," * Since items are plain objects and not Model instances, they contain"," properties rather than Model attributes. To retrieve a property, use"," `item.foo` rather than `item.get('foo')`. To set a property, use"," `item.foo = 'bar'` rather than `item.set('foo', 'bar')`.",""," * Model attribute getters and setters aren't supported, since items in the"," LazyModelList are stored and manipulated as plain objects with simple"," properties rather than YUI attributes.",""," * Changes made to the plain object version of an item will not trigger or"," bubble up Model `change` events. However, once an item is revived into a"," full Model using the `revive()` method, changes to that Model instance"," will trigger and bubble change events as expected.",""," * Custom `idAttribute` fields are not supported.",""," * `id` and `clientId` properties _are_ supported. If an item doesn't have a"," `clientId` property, one will be generated automatically when the item is"," added to a LazyModelList.","","LazyModelList is generally much more memory efficient than ModelList when","managing large numbers of items, and adding/removing items is significantly","faster. However, the tradeoff is that LazyModelList is only well-suited for","storing very simple items without complex attributes, and consumers must","explicitly revive items into full Model instances as needed (this is not done","transparently for performance reasons).","","@class LazyModelList","@extends ModelList","@constructor","@since 3.6.0","**/","","var AttrProto = Y.Attribute.prototype,"," GlobalEnv = YUI.namespace('Env.Model'),"," Lang = Y.Lang,"," YArray = Y.Array,",""," EVT_ADD = 'add',"," EVT_ERROR = 'error',"," EVT_RESET = 'reset';","","Y.LazyModelList = Y.Base.create('lazyModelList', Y.ModelList, [], {"," // -- Public Methods -------------------------------------------------------",""," /**"," Deletes the specified model from the model cache to release memory. The"," model won't be destroyed or removed from the list, just freed from the"," cache; it can still be instantiated again using `revive()`.",""," If no model or model index is specified, all cached models in this list will"," be freed.",""," Note: Specifying an index is faster than specifying a model instance, since"," the latter requires an `indexOf()` call.",""," @method free"," @param {Model|Number} [model] Model or index of the model to free. If not"," specified, all instantiated models in this list will be freed."," @chainable"," @see revive()"," **/"," free: function (model) {"," var index;",""," if (model) {"," index = Lang.isNumber(model) ? model : this.indexOf(model);",""," if (index >= 0) {"," // We don't detach the model because it's not being removed from"," // the list, just being freed from memory. If something else"," // still holds a reference to it, it may still bubble events to"," // the list, but that's okay."," //"," // `this._models` is a sparse array, which ensures that the"," // indices of models and items match even if we don't have model"," // instances for all items."," delete this._models[index];"," }"," } else {"," this._models = [];"," }",""," return this;"," },",""," /**"," Overrides ModelList#get() to return a map of property values rather than"," performing attribute lookups.",""," @method get"," @param {String} name Property name."," @return {String[]} Array of property values."," @see ModelList.get()"," **/"," get: function (name) {"," if (this.attrAdded(name)) {"," return AttrProto.get.apply(this, arguments);"," }",""," return YArray.map(this._items, function (item) {"," return item[name];"," });"," },",""," /**"," Overrides ModelList#getAsHTML() to return a map of HTML-escaped property"," values rather than performing attribute lookups.",""," @method getAsHTML"," @param {String} name Property name."," @return {String[]} Array of HTML-escaped property values."," @see ModelList.getAsHTML()"," **/"," getAsHTML: function (name) {"," if (this.attrAdded(name)) {"," return Y.Escape.html(AttrProto.get.apply(this, arguments));"," }",""," return YArray.map(this._items, function (item) {"," return Y.Escape.html(item[name]);"," });"," },",""," /**"," Overrides ModelList#getAsURL() to return a map of URL-encoded property"," values rather than performing attribute lookups.",""," @method getAsURL"," @param {String} name Property name."," @return {String[]} Array of URL-encoded property values."," @see ModelList.getAsURL()"," **/"," getAsURL: function (name) {"," if (this.attrAdded(name)) {"," return encodeURIComponent(AttrProto.get.apply(this, arguments));"," }",""," return YArray.map(this._items, function (item) {"," return encodeURIComponent(item[name]);"," });"," },",""," /**"," Returns the index of the given object or Model instance in this"," LazyModelList.",""," @method indexOf"," @param {Model|Object} needle The object or Model instance to search for."," @return {Number} Item index, or `-1` if not found."," @see ModelList.indexOf()"," **/"," indexOf: function (model) {"," return YArray.indexOf(model && model._isYUIModel ?"," this._models : this._items, model);"," },",""," /**"," Overrides ModelList#reset() to work with plain objects.",""," @method reset"," @param {Object[]|Model[]|ModelList} [models] Models to add."," @param {Object} [options] Options."," @chainable"," @see ModelList.reset()"," **/"," reset: function (items, options) {"," items || (items = []);"," options || (options = {});",""," var facade = Y.merge({src: 'reset'}, options);",""," // Convert `items` into an array of plain objects, since we don't want"," // model instances."," items = items._isYUIModelList ? items.map(this._modelToObject) :"," YArray.map(items, this._modelToObject);",""," facade.models = items;",""," if (options.silent) {"," this._defResetFn(facade);"," } else {"," // Sort the items before firing the reset event."," if (this.comparator) {"," items.sort(Y.bind(this._sort, this));"," }",""," this.fire(EVT_RESET, facade);"," }",""," return this;"," },",""," /**"," Revives an item (or all items) into a full Model instance. The _item_"," argument may be the index of an object in this list, an actual object (which"," must exist in the list), or may be omitted to revive all items in the list.",""," Once revived, Model instances are attached to this list and cached so that"," reviving them in the future doesn't require another Model instantiation. Use"," the `free()` method to explicitly uncache and detach a previously revived"," Model instance.",""," Note: Specifying an index rather than an object will be faster, since"," objects require an `indexOf()` lookup in order to retrieve the index.",""," @method revive"," @param {Number|Object} [item] Index of the object to revive, or the object"," itself. If an object, that object must exist in this list. If not"," specified, all items in the list will be revived and an array of models"," will be returned."," @return {Model|Model[]|null} Revived Model instance, array of revived Model"," instances, or `null` if the given index or object was not found in this"," list."," @see free()"," **/"," revive: function (item) {"," var i, len, models;",""," if (item || item === 0) {"," return this._revive(Lang.isNumber(item) ? item :"," this.indexOf(item));"," } else {"," models = [];",""," for (i = 0, len = this._items.length; i < len; i++) {"," models.push(this._revive(i));"," }",""," return models;"," }"," },",""," /**"," Overrides ModelList#toJSON() to use toArray() instead, since it's more"," efficient for LazyModelList.",""," @method toJSON"," @return {Object[]} Array of objects."," @see ModelList.toJSON()"," **/"," toJSON: function () {"," return this.toArray();"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Overrides ModelList#add() to work with plain objects.",""," @method _add"," @param {Object|Model} item Object or model to add."," @param {Object} [options] Options."," @return {Object} Added item."," @protected"," @see ModelList._add()"," **/"," _add: function (item, options) {"," var facade;",""," options || (options = {});",""," // If the item is a model instance, convert it to a plain object."," item = this._modelToObject(item);",""," // Ensure that the item has a clientId."," if (!('clientId' in item)) {"," item.clientId = this._generateClientId();"," }",""," if (this._isInList(item)) {"," this.fire(EVT_ERROR, {"," error: 'Model is already in the list.',"," model: item,"," src : 'add'"," });",""," return;"," }",""," facade = Y.merge(options, {"," index: 'index' in options ? options.index : this._findIndex(item),"," model: item"," });",""," options.silent ? this._defAddFn(facade) : this.fire(EVT_ADD, facade);",""," return item;"," },",""," /**"," Overrides ModelList#clear() to support `this._models`.",""," @method _clear"," @protected"," @see ModelList.clear()"," **/"," _clear: function () {"," YArray.each(this._models, this._detachList, this);",""," this._clientIdMap = {};"," this._idMap = {};"," this._items = [];"," this._models = [];"," },",""," /**"," Generates an ad-hoc clientId for a non-instantiated Model.",""," @method _generateClientId"," @return {String} Unique clientId."," @protected"," **/"," _generateClientId: function () {"," GlobalEnv.lastId || (GlobalEnv.lastId = 0);"," return this.model.NAME + '_' + (GlobalEnv.lastId += 1);"," },",""," /**"," Returns `true` if the given item is in this list, `false` otherwise.",""," @method _isInList"," @param {Object} item Plain object item."," @return {Boolean} `true` if the item is in this list, `false` otherwise."," @protected"," **/"," _isInList: function (item) {"," return !!(('clientId' in item && this._clientIdMap[item.clientId]) ||"," ('id' in item && this._idMap[item.id]));"," },",""," /**"," Converts a Model instance into a plain object. If _model_ is not a Model"," instance, it will be returned as is.",""," This method differs from Model#toJSON() in that it doesn't delete the"," `clientId` property.",""," @method _modelToObject"," @param {Model|Object} model Model instance to convert."," @return {Object} Plain object."," @protected"," **/"," _modelToObject: function (model) {"," if (model._isYUIModel) {"," model = model.getAttrs();"," delete model.destroyed;"," delete model.initialized;"," }",""," return model;"," },",""," /**"," Overrides ModelList#_remove() to convert Model instances to indices"," before removing to ensure consistency in the `remove` event facade.",""," @method _remove"," @param {Object|Model} item Object or model to remove."," @param {Object} [options] Options."," @return {Object} Removed object."," @protected"," **/"," _remove: function (item, options) {"," // If the given item is a model instance, turn it into an index before"," // calling the parent _remove method, since we only want to deal with"," // the plain object version."," if (item._isYUIModel) {"," item = this.indexOf(item);"," }",""," return Y.ModelList.prototype._remove.call(this, item, options);"," },",""," /**"," Revives a single model at the specified index and returns it. This is the"," underlying implementation for `revive()`.",""," @method _revive"," @param {Number} index Index of the item to revive."," @return {Model} Revived model."," @protected"," **/"," _revive: function (index) {"," var item, model;",""," if (index < 0) {"," return null;"," }",""," item = this._items[index];",""," if (!item) {"," return null;"," }",""," model = this._models[index];",""," if (!model) {"," model = new this.model(item);"," this._attachList(model);"," this._models[index] = model;"," }",""," return model;"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Overrides ModelList#_defAddFn() to support plain objects.",""," @method _defAddFn"," @param {EventFacade} e"," @protected"," **/"," _defAddFn: function (e) {"," var item = e.model;",""," this._clientIdMap[item.clientId] = item;",""," if (Lang.isValue(item.id)) {"," this._idMap[item.id] = item;"," }",""," this._items.splice(e.index, 0, item);"," },",""," /**"," Overrides ModelList#_defRemoveFn() to support plain objects.",""," @method _defRemoveFn"," @param {EventFacade} e"," @protected"," **/"," _defRemoveFn: function (e) {"," var index = e.index,"," item = e.model,"," model = this._models[index];",""," delete this._clientIdMap[item.clientId];",""," if ('id' in item) {"," delete this._idMap[item.id];"," }",""," if (model) {"," this._detachList(model);"," }",""," this._items.splice(index, 1);"," this._models.splice(index, 1);"," }","});","","","}, '3.7.2', {\"requires\": [\"model-list\"]});"];+_yuitest_coverage["build/lazy-model-list/lazy-model-list.js"].code=["YUI.add('lazy-model-list', function (Y, NAME) {","","/**","Provides the LazyModelList class, which is a ModelList subclass that manages","plain objects instead of fully instantiated model instances.","","@module app","@submodule lazy-model-list","@since 3.6.0","**/","","/**","LazyModelList is a subclass of ModelList that maintains a list of plain","JavaScript objects rather than a list of Model instances. This makes it","well-suited for managing large amounts of data (on the order of thousands of","items) that would tend to bog down a vanilla ModelList.","","The API presented by LazyModelList is the same as that of ModelList, except that","in every case where ModelList would provide a Model instance, LazyModelList","provides a plain JavaScript object. LazyModelList also provides a `revive()`","method that can convert the plain object at a given index into a full Model","instance.","","Since the items stored in a LazyModelList are plain objects and not full Model","instances, there are a few caveats to be aware of:",""," * Since items are plain objects and not Model instances, they contain"," properties rather than Model attributes. To retrieve a property, use"," `item.foo` rather than `item.get('foo')`. To set a property, use"," `item.foo = 'bar'` rather than `item.set('foo', 'bar')`.",""," * Model attribute getters and setters aren't supported, since items in the"," LazyModelList are stored and manipulated as plain objects with simple"," properties rather than YUI attributes.",""," * Changes made to the plain object version of an item will not trigger or"," bubble up Model `change` events. However, once an item is revived into a"," full Model using the `revive()` method, changes to that Model instance"," will trigger and bubble change events as expected.",""," * Custom `idAttribute` fields are not supported.",""," * `id` and `clientId` properties _are_ supported. If an item doesn't have a"," `clientId` property, one will be generated automatically when the item is"," added to a LazyModelList.","","LazyModelList is generally much more memory efficient than ModelList when","managing large numbers of items, and adding/removing items is significantly","faster. However, the tradeoff is that LazyModelList is only well-suited for","storing very simple items without complex attributes, and consumers must","explicitly revive items into full Model instances as needed (this is not done","transparently for performance reasons).","","@class LazyModelList","@extends ModelList","@constructor","@since 3.6.0","**/","","var AttrProto = Y.Attribute.prototype,"," GlobalEnv = YUI.namespace('Env.Model'),"," Lang = Y.Lang,"," YArray = Y.Array,",""," EVT_ADD = 'add',"," EVT_ERROR = 'error',"," EVT_RESET = 'reset';","","Y.LazyModelList = Y.Base.create('lazyModelList', Y.ModelList, [], {"," // -- Public Methods -------------------------------------------------------",""," /**"," Deletes the specified model from the model cache to release memory. The"," model won't be destroyed or removed from the list, just freed from the"," cache; it can still be instantiated again using `revive()`.",""," If no model or model index is specified, all cached models in this list will"," be freed.",""," Note: Specifying an index is faster than specifying a model instance, since"," the latter requires an `indexOf()` call.",""," @method free"," @param {Model|Number} [model] Model or index of the model to free. If not"," specified, all instantiated models in this list will be freed."," @chainable"," @see revive()"," **/"," free: function (model) {"," var index;",""," if (model) {"," index = Lang.isNumber(model) ? model : this.indexOf(model);",""," if (index >= 0) {"," // We don't detach the model because it's not being removed from"," // the list, just being freed from memory. If something else"," // still holds a reference to it, it may still bubble events to"," // the list, but that's okay."," //"," // `this._models` is a sparse array, which ensures that the"," // indices of models and items match even if we don't have model"," // instances for all items."," delete this._models[index];"," }"," } else {"," this._models = [];"," }",""," return this;"," },",""," /**"," Overrides ModelList#get() to return a map of property values rather than"," performing attribute lookups.",""," @method get"," @param {String} name Property name."," @return {String[]} Array of property values."," @see ModelList.get()"," **/"," get: function (name) {"," if (this.attrAdded(name)) {"," return AttrProto.get.apply(this, arguments);"," }",""," return YArray.map(this._items, function (item) {"," return item[name];"," });"," },",""," /**"," Overrides ModelList#getAsHTML() to return a map of HTML-escaped property"," values rather than performing attribute lookups.",""," @method getAsHTML"," @param {String} name Property name."," @return {String[]} Array of HTML-escaped property values."," @see ModelList.getAsHTML()"," **/"," getAsHTML: function (name) {"," if (this.attrAdded(name)) {"," return Y.Escape.html(AttrProto.get.apply(this, arguments));"," }",""," return YArray.map(this._items, function (item) {"," return Y.Escape.html(item[name]);"," });"," },",""," /**"," Overrides ModelList#getAsURL() to return a map of URL-encoded property"," values rather than performing attribute lookups.",""," @method getAsURL"," @param {String} name Property name."," @return {String[]} Array of URL-encoded property values."," @see ModelList.getAsURL()"," **/"," getAsURL: function (name) {"," if (this.attrAdded(name)) {"," return encodeURIComponent(AttrProto.get.apply(this, arguments));"," }",""," return YArray.map(this._items, function (item) {"," return encodeURIComponent(item[name]);"," });"," },",""," /**"," Returns the index of the given object or Model instance in this"," LazyModelList.",""," @method indexOf"," @param {Model|Object} needle The object or Model instance to search for."," @return {Number} Item index, or `-1` if not found."," @see ModelList.indexOf()"," **/"," indexOf: function (model) {"," return YArray.indexOf(model && model._isYUIModel ?"," this._models : this._items, model);"," },",""," /**"," Overrides ModelList#reset() to work with plain objects.",""," @method reset"," @param {Object[]|Model[]|ModelList} [models] Models to add."," @param {Object} [options] Options."," @chainable"," @see ModelList.reset()"," **/"," reset: function (items, options) {"," items || (items = []);"," options || (options = {});",""," var facade = Y.merge({src: 'reset'}, options);",""," // Convert `items` into an array of plain objects, since we don't want"," // model instances."," items = items._isYUIModelList ? items.map(this._modelToObject) :"," YArray.map(items, this._modelToObject);",""," facade.models = items;",""," if (options.silent) {"," this._defResetFn(facade);"," } else {"," // Sort the items before firing the reset event."," if (this.comparator) {"," items.sort(Y.bind(this._sort, this));"," }",""," this.fire(EVT_RESET, facade);"," }",""," return this;"," },",""," /**"," Revives an item (or all items) into a full Model instance. The _item_"," argument may be the index of an object in this list, an actual object (which"," must exist in the list), or may be omitted to revive all items in the list.",""," Once revived, Model instances are attached to this list and cached so that"," reviving them in the future doesn't require another Model instantiation. Use"," the `free()` method to explicitly uncache and detach a previously revived"," Model instance.",""," Note: Specifying an index rather than an object will be faster, since"," objects require an `indexOf()` lookup in order to retrieve the index.",""," @method revive"," @param {Number|Object} [item] Index of the object to revive, or the object"," itself. If an object, that object must exist in this list. If not"," specified, all items in the list will be revived and an array of models"," will be returned."," @return {Model|Model[]|null} Revived Model instance, array of revived Model"," instances, or `null` if the given index or object was not found in this"," list."," @see free()"," **/"," revive: function (item) {"," var i, len, models;",""," if (item || item === 0) {"," return this._revive(Lang.isNumber(item) ? item :"," this.indexOf(item));"," } else {"," models = [];",""," for (i = 0, len = this._items.length; i < len; i++) {"," models.push(this._revive(i));"," }",""," return models;"," }"," },",""," /**"," Overrides ModelList#toJSON() to use toArray() instead, since it's more"," efficient for LazyModelList.",""," @method toJSON"," @return {Object[]} Array of objects."," @see ModelList.toJSON()"," **/"," toJSON: function () {"," return this.toArray();"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Overrides ModelList#add() to work with plain objects.",""," @method _add"," @param {Object|Model} item Object or model to add."," @param {Object} [options] Options."," @return {Object} Added item."," @protected"," @see ModelList._add()"," **/"," _add: function (item, options) {"," var facade;",""," options || (options = {});",""," // If the item is a model instance, convert it to a plain object."," item = this._modelToObject(item);",""," // Ensure that the item has a clientId."," if (!('clientId' in item)) {"," item.clientId = this._generateClientId();"," }",""," if (this._isInList(item)) {"," this.fire(EVT_ERROR, {"," error: 'Model is already in the list.',"," model: item,"," src : 'add'"," });",""," return;"," }",""," facade = Y.merge(options, {"," index: 'index' in options ? options.index : this._findIndex(item),"," model: item"," });",""," options.silent ? this._defAddFn(facade) : this.fire(EVT_ADD, facade);",""," return item;"," },",""," /**"," Overrides ModelList#clear() to support `this._models`.",""," @method _clear"," @protected"," @see ModelList.clear()"," **/"," _clear: function () {"," YArray.each(this._models, this._detachList, this);",""," this._clientIdMap = {};"," this._idMap = {};"," this._items = [];"," this._models = [];"," },",""," /**"," Generates an ad-hoc clientId for a non-instantiated Model.",""," @method _generateClientId"," @return {String} Unique clientId."," @protected"," **/"," _generateClientId: function () {"," GlobalEnv.lastId || (GlobalEnv.lastId = 0);"," return this.model.NAME + '_' + (GlobalEnv.lastId += 1);"," },",""," /**"," Returns `true` if the given item is in this list, `false` otherwise.",""," @method _isInList"," @param {Object} item Plain object item."," @return {Boolean} `true` if the item is in this list, `false` otherwise."," @protected"," **/"," _isInList: function (item) {"," return !!(('clientId' in item && this._clientIdMap[item.clientId]) ||"," ('id' in item && this._idMap[item.id]));"," },",""," /**"," Converts a Model instance into a plain object. If _model_ is not a Model"," instance, it will be returned as is.",""," This method differs from Model#toJSON() in that it doesn't delete the"," `clientId` property.",""," @method _modelToObject"," @param {Model|Object} model Model instance to convert."," @return {Object} Plain object."," @protected"," **/"," _modelToObject: function (model) {"," if (model._isYUIModel) {"," model = model.getAttrs();"," delete model.destroyed;"," delete model.initialized;"," }",""," return model;"," },",""," /**"," Overrides ModelList#_remove() to convert Model instances to indices"," before removing to ensure consistency in the `remove` event facade.",""," @method _remove"," @param {Object|Model} item Object or model to remove."," @param {Object} [options] Options."," @return {Object} Removed object."," @protected"," **/"," _remove: function (item, options) {"," // If the given item is a model instance, turn it into an index before"," // calling the parent _remove method, since we only want to deal with"," // the plain object version."," if (item._isYUIModel) {"," item = this.indexOf(item);"," }",""," return Y.ModelList.prototype._remove.call(this, item, options);"," },",""," /**"," Revives a single model at the specified index and returns it. This is the"," underlying implementation for `revive()`.",""," @method _revive"," @param {Number} index Index of the item to revive."," @return {Model} Revived model."," @protected"," **/"," _revive: function (index) {"," var item, model;",""," if (index < 0) {"," return null;"," }",""," item = this._items[index];",""," if (!item) {"," return null;"," }",""," model = this._models[index];",""," if (!model) {"," model = new this.model(item);"," this._attachList(model);"," this._models[index] = model;"," }",""," return model;"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Overrides ModelList#_defAddFn() to support plain objects.",""," @method _defAddFn"," @param {EventFacade} e"," @protected"," **/"," _defAddFn: function (e) {"," var item = e.model;",""," this._clientIdMap[item.clientId] = item;",""," if (Lang.isValue(item.id)) {"," this._idMap[item.id] = item;"," }",""," this._items.splice(e.index, 0, item);"," },",""," /**"," Overrides ModelList#_defRemoveFn() to support plain objects.",""," @method _defRemoveFn"," @param {EventFacade} e"," @protected"," **/"," _defRemoveFn: function (e) {"," var index = e.index,"," item = e.model,"," model = this._models[index];",""," delete this._clientIdMap[item.clientId];",""," if ('id' in item) {"," delete this._idMap[item.id];"," }",""," if (model) {"," this._detachList(model);"," }",""," this._items.splice(index, 1);"," this._models.splice(index, 1);"," }","});","","","}, '3.7.3', {\"requires\": [\"model-list\"]});"]; _yuitest_coverage["build/lazy-model-list/lazy-model-list.js"].lines = {"1":0,"60":0,"69":0,"90":0,"92":0,"93":0,"95":0,"104":0,"107":0,"110":0,"123":0,"124":0,"127":0,"128":0,"142":0,"143":0,"146":0,"147":0,"161":0,"162":0,"165":0,"166":0,"180":0,"194":0,"195":0,"197":0,"201":0,"204":0,"206":0,"207":0,"210":0,"211":0,"214":0,"217":0,"244":0,"246":0,"247":0,"250":0,"252":0,"253":0,"256":0,"269":0,"285":0,"287":0,"290":0,"293":0,"294":0,"297":0,"298":0,"304":0,"307":0,"312":0,"314":0,"325":0,"327":0,"328":0,"329":0,"330":0,"341":0,"342":0,"354":0,"371":0,"372":0,"373":0,"374":0,"377":0,"394":0,"395":0,"398":0,"411":0,"413":0,"414":0,"417":0,"419":0,"420":0,"423":0,"425":0,"426":0,"427":0,"428":0,"431":0,"444":0,"446":0,"448":0,"449":0,"452":0,"463":0,"467":0,"469":0,"470":0,"473":0,"474":0,"477":0,"478":0}; _yuitest_coverage["build/lazy-model-list/lazy-model-list.js"].functions = {"free:89":0,"(anonymous 2):127":0,"get:122":0,"(anonymous 3):146":0,"getAsHTML:141":0,"(anonymous 4):165":0,"getAsURL:160":0,"indexOf:179":0,"reset:193":0,"revive:243":0,"toJSON:268":0,"_add:284":0,"_clear:324":0,"_generateClientId:340":0,"_isInList:353":0,"_modelToObject:370":0,"_remove:390":0,"_revive:410":0,"_defAddFn:443":0,"_defRemoveFn:462":0,"(anonymous 1):1":0}; _yuitest_coverage["build/lazy-model-list/lazy-model-list.js"].coveredLines = 94;@@ -634,4 +634,4 @@ }); -}, '3.7.2', {"requires": ["model-list"]});+}, '3.7.3', {"requires": ["model-list"]});
bundle/lazy-model-list/lazy-model-list-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -486,4 +486,4 @@ }); -}, '3.7.2', {"requires": ["model-list"]});+}, '3.7.3', {"requires": ["model-list"]});
bundle/lazy-model-list/lazy-model-list-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("lazy-model-list",function(e,t){var n=e.Attribute.prototype,r=YUI.namespace("Env.Model"),i=e.Lang,s=e.Array,o="add",u="error",a="reset";e.LazyModelList=e.Base.create("lazyModelList",e.ModelList,[],{free:function(e){var t;return e?(t=i.isNumber(e)?e:this.indexOf(e),t>=0&&delete this._models[t]):this._models=[],this},get:function(e){return this.attrAdded(e)?n.get.apply(this,arguments):s.map(this._items,function(t){return t[e]})},getAsHTML:function(t){return this.attrAdded(t)?e.Escape.html(n.get.apply(this,arguments)):s.map(this._items,function(n){return e.Escape.html(n[t])})},getAsURL:function(e){return this.attrAdded(e)?encodeURIComponent(n.get.apply(this,arguments)):s.map(this._items,function(t){return encodeURIComponent(t[e])})},indexOf:function(e){return s.indexOf(e&&e._isYUIModel?this._models:this._items,e)},reset:function(t,n){t||(t=[]),n||(n={});var r=e.merge({src:"reset"},n);return t=t._isYUIModelList?t.map(this._modelToObject):s.map(t,this._modelToObject),r.models=t,n.silent?this._defResetFn(r):(this.comparator&&t.sort(e.bind(this._sort,this)),this.fire(a,r)),this},revive:function(e){var t,n,r;if(e||e===0)return this._revive(i.isNumber(e)?e:this.indexOf(e));r=[];for(t=0,n=this._items.length;t<n;t++)r.push(this._revive(t));return r},toJSON:function(){return this.toArray()},_add:function(t,n){var r;n||(n={}),t=this._modelToObject(t),"clientId"in t||(t.clientId=this._generateClientId());if(this._isInList(t)){this.fire(u,{error:"Model is already in the list.",model:t,src:"add"});return}return r=e.merge(n,{index:"index"in n?n.index:this._findIndex(t),model:t}),n.silent?this._defAddFn(r):this.fire(o,r),t},_clear:function(){s.each(this._models,this._detachList,this),this._clientIdMap={},this._idMap={},this._items=[],this._models=[]},_generateClientId:function(){return r.lastId||(r.lastId=0),this.model.NAME+"_"+(r.lastId+=1)},_isInList:function(e){return!!("clientId"in e&&this._clientIdMap[e.clientId]||"id"in e&&this._idMap[e.id])},_modelToObject:function(e){return e._isYUIModel&&(e=e.getAttrs(),delete e.destroyed,delete e.initialized),e},_remove:function(t,n){return t._isYUIModel&&(t=this.indexOf(t)),e.ModelList.prototype._remove.call(this,t,n)},_revive:function(e){var t,n;return e<0?null:(t=this._items[e],t?(n=this._models[e],n||(n=new this.model(t),this._attachList(n),this._models[e]=n),n):null)},_defAddFn:function(e){var t=e.model;this._clientIdMap[t.clientId]=t,i.isValue(t.id)&&(this._idMap[t.id]=t),this._items.splice(e.index,0,t)},_defRemoveFn:function(e){var t=e.index,n=e.model,r=this._models[t];delete this._clientIdMap[n.clientId],"id"in n&&delete this._idMap[n.id],r&&this._detachList(r),this._items.splice(t,1),this._models.splice(t,1)}})},"3.7.2",{requires:["model-list"]});+YUI.add("lazy-model-list",function(e,t){var n=e.Attribute.prototype,r=YUI.namespace("Env.Model"),i=e.Lang,s=e.Array,o="add",u="error",a="reset";e.LazyModelList=e.Base.create("lazyModelList",e.ModelList,[],{free:function(e){var t;return e?(t=i.isNumber(e)?e:this.indexOf(e),t>=0&&delete this._models[t]):this._models=[],this},get:function(e){return this.attrAdded(e)?n.get.apply(this,arguments):s.map(this._items,function(t){return t[e]})},getAsHTML:function(t){return this.attrAdded(t)?e.Escape.html(n.get.apply(this,arguments)):s.map(this._items,function(n){return e.Escape.html(n[t])})},getAsURL:function(e){return this.attrAdded(e)?encodeURIComponent(n.get.apply(this,arguments)):s.map(this._items,function(t){return encodeURIComponent(t[e])})},indexOf:function(e){return s.indexOf(e&&e._isYUIModel?this._models:this._items,e)},reset:function(t,n){t||(t=[]),n||(n={});var r=e.merge({src:"reset"},n);return t=t._isYUIModelList?t.map(this._modelToObject):s.map(t,this._modelToObject),r.models=t,n.silent?this._defResetFn(r):(this.comparator&&t.sort(e.bind(this._sort,this)),this.fire(a,r)),this},revive:function(e){var t,n,r;if(e||e===0)return this._revive(i.isNumber(e)?e:this.indexOf(e));r=[];for(t=0,n=this._items.length;t<n;t++)r.push(this._revive(t));return r},toJSON:function(){return this.toArray()},_add:function(t,n){var r;n||(n={}),t=this._modelToObject(t),"clientId"in t||(t.clientId=this._generateClientId());if(this._isInList(t)){this.fire(u,{error:"Model is already in the list.",model:t,src:"add"});return}return r=e.merge(n,{index:"index"in n?n.index:this._findIndex(t),model:t}),n.silent?this._defAddFn(r):this.fire(o,r),t},_clear:function(){s.each(this._models,this._detachList,this),this._clientIdMap={},this._idMap={},this._items=[],this._models=[]},_generateClientId:function(){return r.lastId||(r.lastId=0),this.model.NAME+"_"+(r.lastId+=1)},_isInList:function(e){return!!("clientId"in e&&this._clientIdMap[e.clientId]||"id"in e&&this._idMap[e.id])},_modelToObject:function(e){return e._isYUIModel&&(e=e.getAttrs(),delete e.destroyed,delete e.initialized),e},_remove:function(t,n){return t._isYUIModel&&(t=this.indexOf(t)),e.ModelList.prototype._remove.call(this,t,n)},_revive:function(e){var t,n;return e<0?null:(t=this._items[e],t?(n=this._models[e],n||(n=new this.model(t),this._attachList(n),this._models[e]=n),n):null)},_defAddFn:function(e){var t=e.model;this._clientIdMap[t.clientId]=t,i.isValue(t.id)&&(this._idMap[t.id]=t),this._items.splice(e.index,0,t)},_defRemoveFn:function(e){var t=e.index,n=e.model,r=this._models[t];delete this._clientIdMap[n.clientId],"id"in n&&delete this._idMap[n.id],r&&this._detachList(r),this._items.splice(t,1),this._models.splice(t,1)}})},"3.7.3",{requires:["model-list"]});
bundle/lazy-model-list/lazy-model-list.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -486,4 +486,4 @@ }); -}, '3.7.2', {"requires": ["model-list"]});+}, '3.7.3', {"requires": ["model-list"]});
bundle/loader-base/loader-base-coverage.js view
@@ -1,3796 +1,3787 @@ /*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-if (typeof _yuitest_coverage == "undefined"){- _yuitest_coverage = {};- _yuitest_coverline = function(src, line){- var coverage = _yuitest_coverage[src];- if (!coverage.lines[line]){- coverage.calledLines++;- }- coverage.lines[line]++;- };- _yuitest_coverfunc = function(src, name, line){- var coverage = _yuitest_coverage[src],- funcId = name + ":" + line;- if (!coverage.functions[funcId]){- coverage.calledFunctions++;- }- coverage.functions[funcId]++;- };-}-_yuitest_coverage["build/loader-base/loader-base.js"] = {- lines: {},- functions: {},- coveredLines: 0,- calledLines: 0,- coveredFunctions: 0,- calledFunctions: 0,- path: "build/loader-base/loader-base.js",- code: []-};-_yuitest_coverage["build/loader-base/loader-base.js"].code=["YUI.add('loader-base', function (Y, NAME) {","","/**"," * The YUI loader core"," * @module loader"," * @submodule loader-base"," */","","if (!YUI.Env[Y.version]) {",""," (function() {"," var VERSION = Y.version,"," BUILD = '/build/',"," ROOT = VERSION + BUILD,"," CDN_BASE = Y.Env.base,"," GALLERY_VERSION = 'gallery-2012.09.19-20-07',"," TNT = '2in3',"," TNT_VERSION = '4',"," YUI2_VERSION = '2.9.0',"," COMBO_BASE = CDN_BASE + 'combo?',"," META = { version: VERSION,"," root: ROOT,"," base: Y.Env.base,"," comboBase: COMBO_BASE,"," skin: { defaultSkin: 'sam',"," base: 'assets/skins/',"," path: 'skin.css',"," after: ['cssreset',"," 'cssfonts',"," 'cssgrids',"," 'cssbase',"," 'cssreset-context',"," 'cssfonts-context']},"," groups: {},"," patterns: {} },"," groups = META.groups,"," yui2Update = function(tnt, yui2, config) {"," "," var root = TNT + '.' +"," (tnt || TNT_VERSION) + '/' +"," (yui2 || YUI2_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.yui2.base = base + root;"," groups.yui2.root = root;"," groups.yui2.comboBase = combo;"," },"," galleryUpdate = function(tag, config) {"," var root = (tag || GALLERY_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.gallery.base = base + root;"," groups.gallery.root = root;"," groups.gallery.comboBase = combo;"," };","",""," groups[VERSION] = {};",""," groups.gallery = {"," ext: false,"," combine: true,"," comboBase: COMBO_BASE,"," update: galleryUpdate,"," patterns: { 'gallery-': { },"," 'lang/gallery-': {},"," 'gallerycss-': { type: 'css' } }"," };",""," groups.yui2 = {"," combine: true,"," ext: false,"," comboBase: COMBO_BASE,"," update: yui2Update,"," patterns: {"," 'yui2-': {"," configFn: function(me) {"," if (/-skin|reset|fonts|grids|base/.test(me.name)) {"," me.type = 'css';"," me.path = me.path.replace(/\\.js/, '.css');"," // this makes skins in builds earlier than"," // 2.6.0 work as long as combine is false"," me.path = me.path.replace(/\\/yui2-skin/,"," '/assets/skins/sam/yui2-skin');"," }"," }"," }"," }"," };",""," galleryUpdate();"," yui2Update();",""," YUI.Env[VERSION] = META;"," }());","}","","","/*jslint forin: true */","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * information for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can also load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files."," *"," * @module loader"," * @main loader"," * @submodule loader-base"," */","","var NOT_FOUND = {},"," NO_REQUIREMENTS = [],"," MAX_URL_LENGTH = 1024,"," GLOBAL_ENV = YUI.Env,"," GLOBAL_LOADED = GLOBAL_ENV._loaded,"," CSS = 'css',"," JS = 'js',"," INTL = 'intl',"," DEFAULT_SKIN = 'sam',"," VERSION = Y.version,"," ROOT_LANG = '',"," YObject = Y.Object,"," oeach = YObject.each,"," YArray = Y.Array,"," _queue = GLOBAL_ENV._loaderQueue,"," META = GLOBAL_ENV[VERSION],"," SKIN_PREFIX = 'skin-',"," L = Y.Lang,"," ON_PAGE = GLOBAL_ENV.mods,"," modulekey,"," cache,"," _path = function(dir, file, type, nomin) {"," var path = dir + '/' + file;"," if (!nomin) {"," path += '-min';"," }"," path += '.' + (type || CSS);",""," return path;"," };","",""," if (!YUI.Env._cssLoaded) {"," YUI.Env._cssLoaded = {};"," }","","","/**"," * The component metadata is stored in Y.Env.meta."," * Part of the loader module."," * @property meta"," * @for YUI"," */","Y.Env.meta = META;","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * info for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files. You can also specify an external, custom combo service to host"," * your modules as well.",""," var Y = YUI();"," var loader = new Y.Loader({"," filter: 'debug',"," base: '../../',"," root: 'build/',"," combine: true,"," require: ['node', 'dd', 'console']"," });"," var out = loader.resolve(true);"," "," * @constructor"," * @class Loader"," * @param {Object} config an optional set of configuration options."," * @param {String} config.base The base dir which to fetch this module from"," * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`"," * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`"," * @param {String|Object} config.filter A filter to apply to result urls. <a href=\"#property_filter\">See filter property</a>"," * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config."," * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies"," * @param {Boolean} [config.async=true] Fetch files in async"," * @param {Array} config.ignore: A list of modules that should never be dynamically loaded"," * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page"," * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes"," * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes"," * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes"," * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout"," * @param {Object} config.context Execution context for all callbacks"," * @param {Function} config.onSuccess Callback for the 'success' event"," * @param {Function} config.onFailure Callback for the 'failure' event"," * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading."," * @param {Function} config.onTimeout Callback for the 'timeout' event"," * @param {Function} config.onProgress Callback executed each time a script or css file is loaded"," * @param {Object} config.modules A list of module definitions. See <a href=\"#method_addModule\">Loader.addModule</a> for the supported module metadata"," * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`."," * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox."," * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward."," */","Y.Loader = function(o) {",""," var self = this;"," "," //Catch no config passed."," o = o || {};",""," modulekey = META.md5;",""," /**"," * Internal callback to handle multiple internal insert() calls"," * so that css is inserted prior to js"," * @property _internalCallback"," * @private"," */"," // self._internalCallback = null;",""," /**"," * Callback that will be executed when the loader is finished"," * with an insert"," * @method onSuccess"," * @type function"," */"," // self.onSuccess = null;",""," /**"," * Callback that will be executed if there is a failure"," * @method onFailure"," * @type function"," */"," // self.onFailure = null;",""," /**"," * Callback for the 'CSSComplete' event. When loading YUI components"," * with CSS the CSS is loaded first, then the script. This provides"," * a moment you can tie into to improve the presentation of the page"," * while the script is loading."," * @method onCSS"," * @type function"," */"," // self.onCSS = null;",""," /**"," * Callback executed each time a script or css file is loaded"," * @method onProgress"," * @type function"," */"," // self.onProgress = null;",""," /**"," * Callback that will be executed if a timeout occurs"," * @method onTimeout"," * @type function"," */"," // self.onTimeout = null;",""," /**"," * The execution context for all callbacks"," * @property context"," * @default {YUI} the YUI instance"," */"," self.context = Y;",""," /**"," * Data that is passed to all callbacks"," * @property data"," */"," // self.data = null;",""," /**"," * Node reference or id where new nodes should be inserted before"," * @property insertBefore"," * @type string|HTMLElement"," */"," // self.insertBefore = null;",""," /**"," * The charset attribute for inserted nodes"," * @property charset"," * @type string"," * @deprecated , use cssAttributes or jsAttributes."," */"," // self.charset = null;",""," /**"," * An object literal containing attributes to add to link nodes"," * @property cssAttributes"," * @type object"," */"," // self.cssAttributes = null;",""," /**"," * An object literal containing attributes to add to script nodes"," * @property jsAttributes"," * @type object"," */"," // self.jsAttributes = null;",""," /**"," * The base directory."," * @property base"," * @type string"," * @default http://yui.yahooapis.com/[YUI VERSION]/build/"," */"," self.base = Y.Env.meta.base + Y.Env.meta.root;",""," /**"," * Base path for the combo service"," * @property comboBase"," * @type string"," * @default http://yui.yahooapis.com/combo?"," */"," self.comboBase = Y.Env.meta.comboBase;",""," /*"," * Base path for language packs."," */"," // self.langBase = Y.Env.meta.langBase;"," // self.lang = \"\";",""," /**"," * If configured, the loader will attempt to use the combo"," * service for YUI resources and configured external resources."," * @property combine"," * @type boolean"," * @default true if a base dir isn't in the config"," */"," self.combine = o.base &&"," (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);"," "," /**"," * The default seperator to use between files in a combo URL"," * @property comboSep"," * @type {String}"," * @default Ampersand"," */"," self.comboSep = '&';"," /**"," * Max url length for combo urls. The default is 1024. This is the URL"," * limit for the Yahoo! hosted combo servers. If consuming"," * a different combo service that has a different URL limit"," * it is possible to override this default by supplying"," * the maxURLLength config option. The config option will"," * only take effect if lower than the default."," *"," * @property maxURLLength"," * @type int"," */"," self.maxURLLength = MAX_URL_LENGTH;",""," /**"," * Ignore modules registered on the YUI global"," * @property ignoreRegistered"," * @default false"," */"," self.ignoreRegistered = o.ignoreRegistered;",""," /**"," * Root path to prepend to module path for the combo"," * service"," * @property root"," * @type string"," * @default [YUI VERSION]/build/"," */"," self.root = Y.Env.meta.root;",""," /**"," * Timeout value in milliseconds. If set, self value will be used by"," * the get utility. the timeout event will fire if"," * a timeout occurs."," * @property timeout"," * @type int"," */"," self.timeout = 0;",""," /**"," * A list of modules that should not be loaded, even if"," * they turn up in the dependency tree"," * @property ignore"," * @type string[]"," */"," // self.ignore = null;",""," /**"," * A list of modules that should always be loaded, even"," * if they have already been inserted into the page."," * @property force"," * @type string[]"," */"," // self.force = null;",""," self.forceMap = {};",""," /**"," * Should we allow rollups"," * @property allowRollup"," * @type boolean"," * @default false"," */"," self.allowRollup = false;",""," /**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js)."," * </dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * @property filter"," * @type string| {searchExp: string, replaceStr: string}"," */"," // self.filter = null;",""," /**"," * per-component filter specification. If specified for a given"," * component, this overrides the filter config."," * @property filters"," * @type object"," */"," self.filters = {};",""," /**"," * The list of requested modules"," * @property required"," * @type {string: boolean}"," */"," self.required = {};",""," /**"," * If a module name is predefined when requested, it is checked againsts"," * the patterns provided in this property. If there is a match, the"," * module is added with the default configuration."," *"," * At the moment only supporting module prefixes, but anticipate"," * supporting at least regular expressions."," * @property patterns"," * @type Object"," */"," // self.patterns = Y.merge(Y.Env.meta.patterns);"," self.patterns = {};",""," /**"," * The library metadata"," * @property moduleInfo"," */"," // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);"," self.moduleInfo = {};",""," self.groups = Y.merge(Y.Env.meta.groups);",""," /**"," * Provides the information used to skin the skinnable components."," * The following skin definition would result in 'skin1' and 'skin2'"," * being loaded for calendar (if calendar was requested), and"," * 'sam' for all other skinnable components:"," *"," * skin: {"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin. ex:"," * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/"," * base: 'assets/skins/',"," * "," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * calendar: ['skin1', 'skin2']"," * }"," * }"," * @property skin"," * @type {Object}"," */"," self.skin = Y.merge(Y.Env.meta.skin);",""," /*"," * Map of conditional modules"," * @since 3.2.0"," */"," self.conditions = {};",""," // map of modules with a hash of modules that meet the requirement"," // self.provides = {};",""," self.config = o;"," self._internal = true;",""," self._populateCache();",""," /**"," * Set when beginning to compute the dependency tree."," * Composed of what YUI reports to be loaded combined"," * with what has been loaded by any instance on the page"," * with the version number specified in the metadata."," * @property loaded"," * @type {string: boolean}"," */"," self.loaded = GLOBAL_LOADED[VERSION];",""," "," /**"," * Should Loader fetch scripts in `async`, defaults to `true`"," * @property async"," */",""," self.async = true;",""," self._inspectPage();",""," self._internal = false;",""," self._config(o);",""," self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; ",""," self.testresults = null;",""," if (Y.config.tests) {"," self.testresults = Y.config.tests;"," }"," "," /**"," * List of rollup files found in the library metadata"," * @property rollups"," */"," // self.rollups = null;",""," /**"," * Whether or not to load optional dependencies for"," * the requested modules"," * @property loadOptional"," * @type boolean"," * @default false"," */"," // self.loadOptional = false;",""," /**"," * All of the derived dependencies in sorted order, which"," * will be populated when either calculate() or insert()"," * is called"," * @property sorted"," * @type string[]"," */"," self.sorted = [];",""," /*"," * A list of modules to attach to the YUI instance when complete."," * If not supplied, the sorted list of dependencies are applied."," * @property attaching"," */"," // self.attaching = null;",""," /**"," * Flag to indicate the dependency tree needs to be recomputed"," * if insert is called again."," * @property dirty"," * @type boolean"," * @default true"," */"," self.dirty = true;",""," /**"," * List of modules inserted by the utility"," * @property inserted"," * @type {string: boolean}"," */"," self.inserted = {};",""," /**"," * List of skipped modules during insert() because the module"," * was not defined"," * @property skipped"," */"," self.skipped = {};",""," // Y.on('yui:load', self.loadNext, self);",""," self.tested = {};",""," /*"," * Cached sorted calculate results"," * @property results"," * @since 3.2.0"," */"," //self.results = {};",""," if (self.ignoreRegistered) {"," //Clear inpage already processed modules."," self._resetModules();"," }","","};","","Y.Loader.prototype = {"," /**"," * Checks the cache for modules and conditions, if they do not exist"," * process the default metadata and populate the local moduleInfo hash."," * @method _populateCache"," * @private"," */"," _populateCache: function() {"," var self = this,"," defaults = META.modules,"," cache = GLOBAL_ENV._renderedMods,"," i;",""," if (cache && !self.ignoreRegistered) {"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.moduleInfo[i] = Y.merge(cache[i]);"," }"," }",""," cache = GLOBAL_ENV._conditions;"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.conditions[i] = Y.merge(cache[i]);"," }"," }",""," } else {"," for (i in defaults) {"," if (defaults.hasOwnProperty(i)) {"," self.addModule(defaults[i], i);"," }"," }"," }",""," },"," /**"," * Reset modules in the module cache to a pre-processed state so additional"," * computations with a different skin or language will work as expected."," * @private _resetModules"," */"," _resetModules: function() {"," var self = this, i, o;"," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," var mod = self.moduleInfo[i],"," name = mod.name,"," details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);",""," if (details) {"," self.moduleInfo[name]._reset = true;"," self.moduleInfo[name].requires = details.requires || [];"," self.moduleInfo[name].optional = details.optional || [];"," self.moduleInfo[name].supersedes = details.supercedes || [];"," }",""," if (mod.defaults) {"," for (o in mod.defaults) {"," if (mod.defaults.hasOwnProperty(o)) {"," if (mod[o]) {"," mod[o] = mod.defaults[o];"," }"," }"," }"," }"," delete mod.langCache;"," delete mod.skinCache;"," if (mod.skinnable) {"," self._addSkin(self.skin.defaultSkin, mod.name);"," }"," }"," }"," },"," /**"," Regex that matches a CSS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_CSS"," @type RegExp"," @final"," @protected"," @since 3.5.0"," **/"," REGEX_CSS: /\\.css(?:[?;].*)?$/i,"," "," /**"," * Default filters for raw and debug"," * @property FILTER_DEFS"," * @type Object"," * @final"," * @protected"," */"," FILTER_DEFS: {"," RAW: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '.js'"," },"," DEBUG: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-debug.js'"," },"," COVERAGE: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-coverage.js'"," }"," },"," /*"," * Check the pages meta-data and cache the result."," * @method _inspectPage"," * @private"," */"," _inspectPage: function() {"," var self = this, v, m, req, mr, i;",""," //Inspect the page for CSS only modules and mark them as loaded."," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," v = self.moduleInfo[i];"," if (v.type && v.type === CSS) {"," if (self.isCSSLoaded(v.name)) {"," self.loaded[i] = true;"," }"," }"," }"," }"," for (i in ON_PAGE) {"," if (ON_PAGE.hasOwnProperty(i)) {"," v = ON_PAGE[i];"," if (v.details) {"," m = self.moduleInfo[v.name];"," req = v.details.requires;"," mr = m && m.requires;",""," if (m) {"," if (!m._inspected && req && mr.length != req.length) {"," // console.log('deleting ' + m.name);"," delete m.expanded;"," }"," } else {"," m = self.addModule(v.details, i);"," }"," m._inspected = true;"," }"," }"," }"," },"," /*"," * returns true if b is not loaded, and is required directly or by means of modules it supersedes."," * @private"," * @method _requires"," * @param {String} mod1 The first module to compare"," * @param {String} mod2 The second module to compare"," */"," _requires: function(mod1, mod2) {",""," var i, rm, after_map, s,"," info = this.moduleInfo,"," m = info[mod1],"," other = info[mod2];",""," if (!m || !other) {"," return false;"," }",""," rm = m.expanded_map;"," after_map = m.after_map;",""," // check if this module should be sorted after the other"," // do this first to short circut circular deps"," if (after_map && (mod2 in after_map)) {"," return true;"," }",""," after_map = other.after_map;",""," // and vis-versa"," if (after_map && (mod1 in after_map)) {"," return false;"," }",""," // check if this module requires one the other supersedes"," s = info[mod2] && info[mod2].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod1, s[i])) {"," return true;"," }"," }"," }",""," s = info[mod1] && info[mod1].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod2, s[i])) {"," return false;"," }"," }"," }",""," // check if this module requires the other directly"," // if (r && YArray.indexOf(r, mod2) > -1) {"," if (rm && (mod2 in rm)) {"," return true;"," }",""," // external css files should be sorted below yui css"," if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {"," return true;"," }",""," return false;"," },"," /**"," * Apply a new config to the Loader instance"," * @method _config"," * @private"," * @param {Object} o The new configuration"," */"," _config: function(o) {"," var i, j, val, a, f, group, groupName, self = this;"," // apply config values"," if (o) {"," for (i in o) {"," if (o.hasOwnProperty(i)) {"," val = o[i];"," if (i == 'require') {"," self.require(val);"," } else if (i == 'skin') {"," //If the config.skin is a string, format to the expected object"," if (typeof val === 'string') {"," self.skin.defaultSkin = o.skin;"," val = {"," defaultSkin: val"," };"," }",""," Y.mix(self.skin, val, true);"," } else if (i == 'groups') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," groupName = j;"," group = val[j];"," self.addGroup(group, groupName);"," if (group.aliases) {"," for (a in group.aliases) {"," if (group.aliases.hasOwnProperty(a)) {"," self.addAlias(group.aliases[a], a);"," }"," }"," }"," }"," }",""," } else if (i == 'modules') {"," // add a hash of module definitions"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addModule(val[j], j);"," }"," }"," } else if (i === 'aliases') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addAlias(val[j], j);"," }"," }"," } else if (i == 'gallery') {"," this.groups.gallery.update(val, o);"," } else if (i == 'yui2' || i == '2in3') {"," this.groups.yui2.update(o['2in3'], o.yui2, o);"," } else {"," self[i] = val;"," }"," }"," }"," }",""," // fix filter"," f = self.filter;",""," if (L.isString(f)) {"," f = f.toUpperCase();"," self.filterName = f;"," self.filter = self.FILTER_DEFS[f];"," if (f == 'DEBUG') {"," self.require('yui-log', 'dump');"," }"," }",""," if (self.filterName && self.coverage) {"," if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {"," var mods = [];"," for (i = 0; i < self.coverage.length; i++) {"," var mod = self.coverage[i];"," if (self.moduleInfo[mod] && self.moduleInfo[mod].use) {"," mods = [].concat(mods, self.moduleInfo[mod].use);"," } else {"," mods.push(mod);"," }"," }"," self.filters = self.filters || {};"," Y.Array.each(mods, function(mod) {"," self.filters[mod] = self.FILTER_DEFS.COVERAGE;"," });"," self.filterName = 'RAW';"," self.filter = self.FILTER_DEFS[self.filterName];"," }"," }"," ",""," if (self.lang) {"," //Removed this so that when Loader is invoked"," //it doesn't request what it doesn't need."," //self.require('intl-base', 'intl');"," }",""," },",""," /**"," * Returns the skin module name for the specified skin name. If a"," * module name is supplied, the returned skin module name is"," * specific to the module passed in."," * @method formatSkin"," * @param {string} skin the name of the skin."," * @param {string} mod optional: the name of a module to skin."," * @return {string} the full skin module name."," */"," formatSkin: function(skin, mod) {"," var s = SKIN_PREFIX + skin;"," if (mod) {"," s = s + '-' + mod;"," }",""," return s;"," },",""," /**"," * Adds the skin def to the module info"," * @method _addSkin"," * @param {string} skin the name of the skin."," * @param {string} mod the name of the module."," * @param {string} parent parent module if this is a skin of a"," * submodule or plugin."," * @return {string} the module name for the skin."," * @private"," */"," _addSkin: function(skin, mod, parent) {"," var mdef, pkg, name, nmod,"," info = this.moduleInfo,"," sinf = this.skin,"," ext = info[mod] && info[mod].ext;",""," // Add a module definition for the module-specific skin css"," if (mod) {"," name = this.formatSkin(skin, mod);"," if (!info[name]) {"," mdef = info[mod];"," pkg = mdef.pkg || mod;"," nmod = {"," skin: true,"," name: name,"," group: mdef.group,"," type: 'css',"," after: sinf.after,"," path: (parent || pkg) + '/' + sinf.base + skin +"," '/' + mod + '.css',"," ext: ext"," };"," if (mdef.base) {"," nmod.base = mdef.base;"," }"," if (mdef.configFn) {"," nmod.configFn = mdef.configFn;"," }"," this.addModule(nmod, name);",""," }"," }",""," return name;"," },"," /**"," * Adds an alias module to the system"," * @method addAlias"," * @param {Array} use An array of modules that makes up this alias"," * @param {String} name The name of the alias"," * @example"," * var loader = new Y.Loader({});"," * loader.addAlias([ 'node', 'yql' ], 'davglass');"," * loader.require(['davglass']);"," * var out = loader.resolve(true);"," *"," * //out.js will contain Node and YQL modules"," */"," addAlias: function(use, name) {"," YUI.Env.aliases[name] = use;"," this.addModule({"," name: name,"," use: use"," });"," },"," /**"," * Add a new module group"," * @method addGroup"," * @param {Object} config An object containing the group configuration data"," * @param {String} config.name required, the group name"," * @param {String} config.base The base directory for this module group"," * @param {String} config.root The root path to add to each combo resource path"," * @param {Boolean} config.combine Should the request be combined"," * @param {String} config.comboBase Combo service base path"," * @param {Object} config.modules The group of modules"," * @param {String} name the group name."," * @example"," * var loader = new Y.Loader({});"," * loader.addGroup({"," * name: 'davglass',"," * combine: true,"," * comboBase: '/combo?',"," * root: '',"," * modules: {"," * //Module List here"," * }"," * }, 'davglass');"," */"," addGroup: function(o, name) {"," var mods = o.modules,"," self = this, i, v;",""," name = name || o.name;"," o.name = name;"," self.groups[name] = o;",""," if (o.patterns) {"," for (i in o.patterns) {"," if (o.patterns.hasOwnProperty(i)) {"," o.patterns[i].group = name;"," self.patterns[i] = o.patterns[i];"," }"," }"," }",""," if (mods) {"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," v = mods[i];"," if (typeof v === 'string') {"," v = { name: i, fullpath: v };"," }"," v.group = name;"," self.addModule(v, i);"," }"," }"," }"," },",""," /**"," * Add a new module to the component metadata."," * @method addModule"," * @param {Object} config An object containing the module data."," * @param {String} config.name Required, the component name"," * @param {String} config.type Required, the component type (js or css)"," * @param {String} config.path Required, the path to the script from `base`"," * @param {Array} config.requires Array of modules required by this component"," * @param {Array} [config.optional] Array of optional modules for this component"," * @param {Array} [config.supersedes] Array of the modules this component replaces"," * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one"," * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array"," * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup"," * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`"," * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in"," * @param {Object} [config.submodules] Hash of submodules"," * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration."," * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `[\"en-GB\", \"zh-Hans-CN\"]`"," * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:"," * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load"," * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded."," * @param {String} [config.condition.when] Specifies the load order of the conditional module"," * with regard to the position of the trigger module."," * This should be one of three values: `before`, `after`, or `instead`. The default is `after`."," * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`"," * @param {Function} [config.configFn] A function to exectute when configuring this module"," * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config."," * @param {String} [name] The module name, required if not in the module data."," * @return {Object} the module definition or null if the object passed in did not provide all required attributes."," */"," addModule: function(o, name) {"," name = name || o.name;",""," if (typeof o === 'string') {"," o = { name: name, fullpath: o };"," }"," "," //Only merge this data if the temp flag is set"," //from an earlier pass from a pattern or else"," //an override module (YUI_config) can not be used to"," //replace a default module."," if (this.moduleInfo[name] && this.moduleInfo[name].temp) {"," //This catches temp modules loaded via a pattern"," // The module will be added twice, once from the pattern and"," // Once from the actual add call, this ensures that properties"," // that were added to the module the first time around (group: gallery)"," // are also added the second time around too."," o = Y.merge(this.moduleInfo[name], o);"," }",""," o.name = name;",""," if (!o || !o.name) {"," return null;"," }",""," if (!o.type) {"," //Always assume it's javascript unless the CSS pattern is matched."," o.type = JS;"," var p = o.path || o.fullpath;"," if (p && this.REGEX_CSS.test(p)) {"," o.type = CSS;"," }"," }",""," if (!o.path && !o.fullpath) {"," o.path = _path(name, name, o.type);"," }"," o.supersedes = o.supersedes || o.use;",""," o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;",""," // Handle submodule logic"," var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,"," j, langs, packName, supName, flatSup, flatLang, lang, ret,"," overrides, skinname, when, g,"," conditions = this.conditions, trigger;"," // , existing = this.moduleInfo[name], newr;"," "," this.moduleInfo[name] = o;",""," o.requires = o.requires || [];"," "," /*"," Only allowing the cascade of requires information, since"," optional and supersedes are far more fine grained than"," a blanket requires is."," */"," if (this.requires) {"," for (i = 0; i < this.requires.length; i++) {"," o.requires.push(this.requires[i]);"," }"," }"," if (o.group && this.groups && this.groups[o.group]) {"," g = this.groups[o.group];"," if (g.requires) {"," for (i = 0; i < g.requires.length; i++) {"," o.requires.push(g.requires[i]);"," }"," }"," }","",""," if (!o.defaults) {"," o.defaults = {"," requires: o.requires ? [].concat(o.requires) : null,"," supersedes: o.supersedes ? [].concat(o.supersedes) : null,"," optional: o.optional ? [].concat(o.optional) : null"," };"," }",""," if (o.skinnable && o.ext && o.temp) {"," skinname = this._addSkin(this.skin.defaultSkin, name);"," o.requires.unshift(skinname);"," }"," "," if (o.requires.length) {"," o.requires = this.filterRequires(o.requires) || [];"," }",""," if (!o.langPack && o.lang) {"," langs = YArray(o.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," smod = this.moduleInfo[packName];"," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }"," }"," }","",""," if (subs) {"," sup = o.supersedes || [];"," l = 0;",""," for (i in subs) {"," if (subs.hasOwnProperty(i)) {"," s = subs[i];",""," s.path = s.path || _path(name, i, o.type);"," s.pkg = name;"," s.group = o.group;",""," if (s.supersedes) {"," sup = sup.concat(s.supersedes);"," }",""," smod = this.addModule(s, i);"," sup.push(i);",""," if (smod.skinnable) {"," o.skinnable = true;"," overrides = this.skin.overrides;"," if (overrides && overrides[i]) {"," for (j = 0; j < overrides[i].length; j++) {"," skinname = this._addSkin(overrides[i][j],"," i, name);"," sup.push(skinname);"," }"," }"," skinname = this._addSkin(this.skin.defaultSkin,"," i, name);"," sup.push(skinname);"," }",""," // looks like we are expected to work out the metadata"," // for the parent module language packs from what is"," // specified in the child modules."," if (s.lang && s.lang.length) {",""," langs = YArray(s.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," supName = this.getLangPackName(lang, i);"," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," flatSup = flatSup || YArray.hash(smod.supersedes);",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }",""," o.lang = o.lang || [];",""," flatLang = flatLang || YArray.hash(o.lang);",""," if (!(lang in flatLang)) {"," o.lang.push(lang);"," }","","// Add rollup file, need to add to supersedes list too",""," // default packages"," packName = this.getLangPackName(ROOT_LANG, name);"," supName = this.getLangPackName(ROOT_LANG, i);",""," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }","","// Add rollup file, need to add to supersedes list too",""," }"," }",""," l++;"," }"," }"," //o.supersedes = YObject.keys(YArray.hash(sup));"," o.supersedes = YArray.dedupe(sup);"," if (this.allowRollup) {"," o.rollup = (l < 4) ? l : Math.min(l - 1, 4);"," }"," }",""," plugins = o.plugins;"," if (plugins) {"," for (i in plugins) {"," if (plugins.hasOwnProperty(i)) {"," plug = plugins[i];"," plug.pkg = name;"," plug.path = plug.path || _path(name, i, o.type);"," plug.requires = plug.requires || [];"," plug.group = o.group;"," this.addModule(plug, i);"," if (o.skinnable) {"," this._addSkin(this.skin.defaultSkin, i, name);"," }",""," }"," }"," }",""," if (o.condition) {"," t = o.condition.trigger;"," if (YUI.Env.aliases[t]) {"," t = YUI.Env.aliases[t];"," }"," if (!Y.Lang.isArray(t)) {"," t = [t];"," }",""," for (i = 0; i < t.length; i++) {"," trigger = t[i];"," when = o.condition.when;"," conditions[trigger] = conditions[trigger] || {};"," conditions[trigger][name] = o.condition;"," // the 'when' attribute can be 'before', 'after', or 'instead'"," // the default is after."," if (when && when != 'after') {"," if (when == 'instead') { // replace the trigger"," o.supersedes = o.supersedes || [];"," o.supersedes.push(trigger);"," } else { // before the trigger"," // the trigger requires the conditional mod,"," // so it should appear before the conditional"," // mod if we do not intersede."," }"," } else { // after the trigger"," o.after = o.after || [];"," o.after.push(trigger);"," }"," }"," }",""," if (o.supersedes) {"," o.supersedes = this.filterRequires(o.supersedes);"," }",""," if (o.after) {"," o.after = this.filterRequires(o.after);"," o.after_map = YArray.hash(o.after);"," }",""," // this.dirty = true;",""," if (o.configFn) {"," ret = o.configFn(o);"," if (ret === false) {"," delete this.moduleInfo[name];"," delete GLOBAL_ENV._renderedMods[name];"," o = null;"," }"," }"," //Add to global cache"," if (o) {"," if (!GLOBAL_ENV._renderedMods) {"," GLOBAL_ENV._renderedMods = {};"," }"," GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);"," GLOBAL_ENV._conditions = conditions;"," }",""," return o;"," },",""," /**"," * Add a requirement for one or more module"," * @method require"," * @param {string[] | string*} what the modules to load."," */"," require: function(what) {"," var a = (typeof what === 'string') ? YArray(arguments) : what;"," this.dirty = true;"," this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));",""," this._explodeRollups();"," },"," /**"," * Grab all the items that were asked for, check to see if the Loader"," * meta-data contains a \"use\" array. If it doesm remove the asked item and replace it with "," * the content of the \"use\"."," * This will make asking for: \"dd\""," * Actually ask for: \"dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin\""," * @private"," * @method _explodeRollups"," */"," _explodeRollups: function() {"," var self = this, m, m2, i, a, v, len, len2,"," r = self.required;",""," if (!self.allowRollup) {"," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = self.getModule(i);"," if (m && m.use) {"," len = m.use.length;"," for (a = 0; a < len; a++) {"," m2 = self.getModule(m.use[a]);"," if (m2 && m2.use) {"," len2 = m2.use.length;"," for (v = 0; v < len2; v++) {"," r[m2.use[v]] = true;"," }"," } else {"," r[m.use[a]] = true;"," }"," }"," }"," }"," }"," self.required = r;"," }",""," },"," /**"," * Explodes the required array to remove aliases and replace them with real modules"," * @method filterRequires"," * @param {Array} r The original requires array"," * @return {Array} The new array of exploded requirements"," */"," filterRequires: function(r) {"," if (r) {"," if (!Y.Lang.isArray(r)) {"," r = [r];"," }"," r = Y.Array(r);"," var c = [], i, mod, o, m;",""," for (i = 0; i < r.length; i++) {"," mod = this.getModule(r[i]);"," if (mod && mod.use) {"," for (o = 0; o < mod.use.length; o++) {"," //Must walk the other modules in case a module is a rollup of rollups (datatype)"," m = this.getModule(mod.use[o]);"," if (m && m.use && (m.name !== mod.name)) {"," c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));"," } else {"," c.push(mod.use[o]);"," }"," }"," } else {"," c.push(r[i]);"," }"," }"," r = c;"," }"," return r;"," },"," /**"," * Returns an object containing properties for all modules required"," * in order to load the requested module"," * @method getRequires"," * @param {object} mod The module definition from moduleInfo."," * @return {array} the expanded requirement list."," */"," getRequires: function(mod) {",""," if (!mod) {"," //console.log('returning no reqs for ' + mod.name);"," return NO_REQUIREMENTS;"," }",""," if (mod._parsed) {"," //console.log('returning requires for ' + mod.name, mod.requires);"," return mod.expanded || NO_REQUIREMENTS;"," }",""," //TODO add modue cache here out of scope..",""," var i, m, j, add, packName, lang, testresults = this.testresults,"," name = mod.name, cond,"," adddef = ON_PAGE[name] && ON_PAGE[name].details,"," d, k, m1, go, def,"," r, old_mod,"," o, skinmod, skindef, skinpar, skinname,"," intl = mod.lang || mod.intl,"," info = this.moduleInfo,"," ftests = Y.Features && Y.Features.tests.load,"," hash, reparse;",""," // console.log(name);",""," // pattern match leaves module stub that needs to be filled out"," if (mod.temp && adddef) {"," old_mod = mod;"," mod = this.addModule(adddef, name);"," mod.group = old_mod.group;"," mod.pkg = old_mod.pkg;"," delete mod.expanded;"," }",""," // console.log('cache: ' + mod.langCache + ' == ' + this.lang);"," "," //If a skin or a lang is different, reparse.."," reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));",""," if (mod.expanded && !reparse) {"," return mod.expanded;"," }"," ",""," d = [];"," hash = {};"," r = this.filterRequires(mod.requires);"," if (mod.lang) {"," //If a module has a lang attribute, auto add the intl requirement."," d.unshift('intl');"," r.unshift('intl');"," intl = true;"," }"," o = this.filterRequires(mod.optional);","",""," mod._parsed = true;"," mod.langCache = this.lang;"," mod.skinCache = this.skin.defaultSkin;",""," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," d.push(r[i]);"," hash[r[i]] = true;"," m = this.getModule(r[i]);"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }",""," // get the requirements from superseded modules, if any"," r = this.filterRequires(mod.supersedes);"," if (r) {"," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," // if this module has submodules, the requirements list is"," // expanded to include the submodules. This is so we can"," // prevent dups when a submodule is already loaded and the"," // parent is requested."," if (mod.submodules) {"," d.push(r[i]);"," }",""," hash[r[i]] = true;"," m = this.getModule(r[i]);",""," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," if (o && this.loadOptional) {"," for (i = 0; i < o.length; i++) {"," if (!hash[o[i]]) {"," d.push(o[i]);"," hash[o[i]] = true;"," m = info[o[i]];"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," cond = this.conditions[name];",""," if (cond) {"," //Set the module to not parsed since we have conditionals and this could change the dependency tree."," mod._parsed = false;"," if (testresults && ftests) {"," oeach(testresults, function(result, id) {"," var condmod = ftests[id].name;"," if (!hash[condmod] && ftests[id].trigger == name) {"," if (result && ftests[id]) {"," hash[condmod] = true;"," d.push(condmod);"," }"," }"," });"," } else {"," for (i in cond) {"," if (cond.hasOwnProperty(i)) {"," if (!hash[i]) {"," def = cond[i];"," //first see if they've specfied a ua check"," //then see if they've got a test fn & if it returns true"," //otherwise just having a condition block is enough"," go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||"," (def.test && def.test(Y, r)));",""," if (go) {"," hash[i] = true;"," d.push(i);"," m = this.getModule(i);"," if (m) {"," add = this.getRequires(m);"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }",""," }"," }"," }"," }"," }"," }"," }",""," // Create skin modules"," if (mod.skinnable) {"," skindef = this.skin.overrides;"," for (i in YUI.Env.aliases) {"," if (YUI.Env.aliases.hasOwnProperty(i)) {"," if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {"," skinpar = i;"," }"," }"," }"," if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {"," skinname = name;"," if (skindef[skinpar]) {"," skinname = skinpar;"," }"," for (i = 0; i < skindef[skinname].length; i++) {"," skinmod = this._addSkin(skindef[skinname][i], name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," } else {"," skinmod = this._addSkin(this.skin.defaultSkin, name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," }",""," mod._parsed = false;",""," if (intl) {",""," if (mod.lang && !mod.langPack && Y.Intl) {"," lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);"," packName = this.getLangPackName(lang, name);"," if (packName) {"," d.unshift(packName);"," }"," }"," d.unshift(INTL);"," }",""," mod.expanded_map = YArray.hash(d);",""," mod.expanded = YObject.keys(mod.expanded_map);",""," return mod.expanded;"," },"," /**"," * Check to see if named css module is already loaded on the page"," * @method isCSSLoaded"," * @param {String} name The name of the css file"," * @return Boolean"," */"," isCSSLoaded: function(name, skip) {"," //TODO - Make this call a batching call with name being an array"," if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {"," return false;"," }"," var el = YUI.Env.cssStampEl,"," ret = false,"," mod = YUI.Env._cssLoaded[name],"," style = el.currentStyle; //IE",""," "," if (mod !== undefined) {"," return mod;"," }",""," //Add the classname to the element"," el.className = name;",""," if (!style) {"," style = Y.config.doc.defaultView.getComputedStyle(el, null);"," }",""," if (style && style.display === 'none') {"," ret = true;"," }","",""," el.className = ''; //Reset the classname to ''",""," YUI.Env._cssLoaded[name] = ret;",""," return ret;"," },",""," /**"," * Returns a hash of module names the supplied module satisfies."," * @method getProvides"," * @param {string} name The name of the module."," * @return {object} what this module provides."," */"," getProvides: function(name) {"," var m = this.getModule(name), o, s;"," // supmap = this.provides;",""," if (!m) {"," return NOT_FOUND;"," }",""," if (m && !m.provides) {"," o = {};"," s = m.supersedes;",""," if (s) {"," YArray.each(s, function(v) {"," Y.mix(o, this.getProvides(v));"," }, this);"," }",""," o[name] = true;"," m.provides = o;",""," }",""," return m.provides;"," },",""," /**"," * Calculates the dependency tree, the result is stored in the sorted"," * property."," * @method calculate"," * @param {object} o optional options object."," * @param {string} type optional argument to prune modules."," */"," calculate: function(o, type) {"," if (o || type || this.dirty) {",""," if (o) {"," this._config(o);"," }",""," if (!this._init) {"," this._setup();"," }",""," this._explode();",""," if (this.allowRollup) {"," this._rollup();"," } else {"," this._explodeRollups();"," }"," this._reduce();"," this._sort();"," }"," },"," /**"," * Creates a \"psuedo\" package for languages provided in the lang array"," * @method _addLangPack"," * @private"," * @param {String} lang The language to create"," * @param {Object} m The module definition to create the language pack around"," * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)"," * @return {Object} The module definition"," */"," _addLangPack: function(lang, m, packName) {"," var name = m.name,"," packPath, conf,"," existing = this.moduleInfo[packName];",""," if (!existing) {",""," packPath = _path((m.pkg || name), packName, JS, true);",""," conf = {"," path: packPath,"," intl: true,"," langPack: true,"," ext: m.ext,"," group: m.group,"," supersedes: []"," };"," if (m.root) {"," conf.root = m.root;"," }"," if (m.base) {"," conf.base = m.base;"," }",""," if (m.configFn) {"," conf.configFn = m.configFn;"," }",""," this.addModule(conf, packName);",""," if (lang) {"," Y.Env.lang = Y.Env.lang || {};"," Y.Env.lang[lang] = Y.Env.lang[lang] || {};"," Y.Env.lang[lang][name] = true;"," }"," }",""," return this.moduleInfo[packName];"," },",""," /**"," * Investigates the current YUI configuration on the page. By default,"," * modules already detected will not be loaded again unless a force"," * option is encountered. Called by calculate()"," * @method _setup"," * @private"," */"," _setup: function() {"," var info = this.moduleInfo, name, i, j, m, l,"," packName;",""," for (name in info) {"," if (info.hasOwnProperty(name)) {"," m = info[name];"," if (m) {",""," // remove dups"," //m.requires = YObject.keys(YArray.hash(m.requires));"," m.requires = YArray.dedupe(m.requires);",""," // Create lang pack modules"," //if (m.lang && m.lang.length) {"," if (m.lang) {"," // Setup root package if the module has lang defined,"," // it needs to provide a root language pack"," packName = this.getLangPackName(ROOT_LANG, name);"," this._addLangPack(null, m, packName);"," }",""," }"," }"," }","",""," //l = Y.merge(this.inserted);"," l = {};",""," // available modules"," if (!this.ignoreRegistered) {"," Y.mix(l, GLOBAL_ENV.mods);"," }",""," // add the ignore list to the list of loaded packages"," if (this.ignore) {"," Y.mix(l, YArray.hash(this.ignore));"," }",""," // expand the list to include superseded modules"," for (j in l) {"," if (l.hasOwnProperty(j)) {"," Y.mix(l, this.getProvides(j));"," }"," }",""," // remove modules on the force list from the loaded list"," if (this.force) {"," for (i = 0; i < this.force.length; i++) {"," if (this.force[i] in l) {"," delete l[this.force[i]];"," }"," }"," }",""," Y.mix(this.loaded, l);",""," this._init = true;"," },",""," /**"," * Builds a module name for a language pack"," * @method getLangPackName"," * @param {string} lang the language code."," * @param {string} mname the module to build it for."," * @return {string} the language pack module name."," */"," getLangPackName: function(lang, mname) {"," return ('lang/' + mname + ((lang) ? '_' + lang : ''));"," },"," /**"," * Inspects the required modules list looking for additional"," * dependencies. Expands the required list to include all"," * required modules. Called by calculate()"," * @method _explode"," * @private"," */"," _explode: function() {"," //TODO Move done out of scope"," var r = this.required, m, reqs, done = {},"," self = this, name;",""," // the setup phase is over, all modules have been created"," self.dirty = false;",""," self._explodeRollups();"," r = self.required;"," "," for (name in r) {"," if (r.hasOwnProperty(name)) {"," if (!done[name]) {"," done[name] = true;"," m = self.getModule(name);"," if (m) {"," var expound = m.expound;",""," if (expound) {"," r[expound] = self.getModule(expound);"," reqs = self.getRequires(r[expound]);"," Y.mix(r, YArray.hash(reqs));"," }",""," reqs = self.getRequires(m);"," Y.mix(r, YArray.hash(reqs));"," }"," }"," }"," }",""," },"," /**"," * The default method used to test a module against a pattern"," * @method _patternTest"," * @private"," * @param {String} mname The module being tested"," * @param {String} pname The pattern to match"," */"," _patternTest: function(mname, pname) {"," return (mname.indexOf(pname) > -1);"," },"," /**"," * Get's the loader meta data for the requested module"," * @method getModule"," * @param {String} mname The module name to get"," * @return {Object} The module metadata"," */"," getModule: function(mname) {"," //TODO: Remove name check - it's a quick hack to fix pattern WIP"," if (!mname) {"," return null;"," }",""," var p, found, pname,"," m = this.moduleInfo[mname],"," patterns = this.patterns;",""," // check the patterns library to see if we should automatically add"," // the module with defaults"," if (!m || (m && m.ext)) {"," for (pname in patterns) {"," if (patterns.hasOwnProperty(pname)) {"," p = patterns[pname];"," "," //There is no test method, create a default one that tests"," // the pattern against the mod name"," if (!p.test) {"," p.test = this._patternTest;"," }",""," if (p.test(mname, pname)) {"," // use the metadata supplied for the pattern"," // as the module definition."," found = p;"," break;"," }"," }"," }"," }",""," if (!m) {"," if (found) {"," if (p.action) {"," p.action.call(this, mname, pname);"," } else {"," // ext true or false?"," m = this.addModule(Y.merge(found), mname);"," if (found.configFn) {"," m.configFn = found.configFn;"," }"," m.temp = true;"," }"," }"," } else {"," if (found && m && found.configFn && !m.configFn) {"," m.configFn = found.configFn;"," m.configFn(m);"," }"," }",""," return m;"," },",""," // impl in rollup submodule"," _rollup: function() { },",""," /**"," * Remove superceded modules and loaded modules. Called by"," * calculate() after we have the mega list of all dependencies"," * @method _reduce"," * @return {object} the reduced dependency hash."," * @private"," */"," _reduce: function(r) {",""," r = r || this.required;",""," var i, j, s, m, type = this.loadType,"," ignore = this.ignore ? YArray.hash(this.ignore) : false;",""," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = this.getModule(i);"," // remove if already loaded"," if (((this.loaded[i] || ON_PAGE[i]) &&"," !this.forceMap[i] && !this.ignoreRegistered) ||"," (type && m && m.type != type)) {"," delete r[i];"," }"," if (ignore && ignore[i]) {"," delete r[i];"," }"," // remove anything this module supersedes"," s = m && m.supersedes;"," if (s) {"," for (j = 0; j < s.length; j++) {"," if (s[j] in r) {"," delete r[s[j]];"," }"," }"," }"," }"," }",""," return r;"," },"," /**"," * Handles the queue when a module has been loaded for all cases"," * @method _finish"," * @private"," * @param {String} msg The message from Loader"," * @param {Boolean} success A boolean denoting success or failure"," */"," _finish: function(msg, success) {",""," _queue.running = false;",""," var onEnd = this.onEnd;"," if (onEnd) {"," onEnd.call(this.context, {"," msg: msg,"," data: this.data,"," success: success"," });"," }"," this._continue();"," },"," /**"," * The default Loader onSuccess handler, calls this.onSuccess with a payload"," * @method _onSuccess"," * @private"," */"," _onSuccess: function() {"," var self = this, skipped = Y.merge(self.skipped), fn,"," failed = [], rreg = self.requireRegistration,"," success, msg, i, mod;"," "," for (i in skipped) {"," if (skipped.hasOwnProperty(i)) {"," delete self.inserted[i];"," }"," }",""," self.skipped = {};"," "," for (i in self.inserted) {"," if (self.inserted.hasOwnProperty(i)) {"," mod = self.getModule(i);"," if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {"," failed.push(i);"," } else {"," Y.mix(self.loaded, self.getProvides(i));"," }"," }"," }",""," fn = self.onSuccess;"," msg = (failed.length) ? 'notregistered' : 'success';"," success = !(failed.length);"," if (fn) {"," fn.call(self.context, {"," msg: msg,"," data: self.data,"," success: success,"," failed: failed,"," skipped: skipped"," });"," }"," self._finish(msg, success);"," },"," /**"," * The default Loader onProgress handler, calls this.onProgress with a payload"," * @method _onProgress"," * @private"," */"," _onProgress: function(e) {"," var self = this, i;"," //set the internal cache to what just came in."," if (e.data && e.data.length) {"," for (i = 0; i < e.data.length; i++) {"," e.data[i] = self.getModule(e.data[i].name);"," }"," }"," if (self.onProgress) {"," self.onProgress.call(self.context, {"," name: e.url,"," data: e.data"," });"," }"," },"," /**"," * The default Loader onFailure handler, calls this.onFailure with a payload"," * @method _onFailure"," * @private"," */"," _onFailure: function(o) {"," var f = this.onFailure, msg = [], i = 0, len = o.errors.length;"," "," for (i; i < len; i++) {"," msg.push(o.errors[i].error);"," }",""," msg = msg.join(',');",""," "," if (f) {"," f.call(this.context, {"," msg: msg,"," data: this.data,"," success: false"," });"," }"," "," this._finish(msg, false);",""," },",""," /**"," * The default Loader onTimeout handler, calls this.onTimeout with a payload"," * @method _onTimeout"," * @private"," */"," _onTimeout: function() {"," var f = this.onTimeout;"," if (f) {"," f.call(this.context, {"," msg: 'timeout',"," data: this.data,"," success: false"," });"," }"," },",""," /**"," * Sorts the dependency tree. The last step of calculate()"," * @method _sort"," * @private"," */"," _sort: function() {",""," // create an indexed list"," var s = YObject.keys(this.required),"," // loaded = this.loaded,"," //TODO Move this out of scope"," done = {},"," p = 0, l, a, b, j, k, moved, doneKey;",""," // keep going until we make a pass without moving anything"," for (;;) {",""," l = s.length;"," moved = false;",""," // start the loop after items that are already sorted"," for (j = p; j < l; j++) {",""," // check the next module on the list to see if its"," // dependencies have been met"," a = s[j];",""," // check everything below current item and move if we"," // find a requirement for the current item"," for (k = j + 1; k < l; k++) {"," doneKey = a + s[k];",""," if (!done[doneKey] && this._requires(a, s[k])) {",""," // extract the dependency so we can move it up"," b = s.splice(k, 1);",""," // insert the dependency above the item that"," // requires it"," s.splice(j, 0, b[0]);",""," // only swap two dependencies once to short circut"," // circular dependencies"," done[doneKey] = true;",""," // keep working"," moved = true;",""," break;"," }"," }",""," // jump out of loop if we moved something"," if (moved) {"," break;"," // this item is sorted, move our pointer and keep going"," } else {"," p++;"," }"," }",""," // when we make it here and moved is false, we are"," // finished sorting"," if (!moved) {"," break;"," }",""," }",""," this.sorted = s;"," },",""," /**"," * Handles the actual insertion of script/link tags"," * @method _insert"," * @private"," * @param {Object} source The YUI instance the request came from"," * @param {Object} o The metadata to include"," * @param {String} type JS or CSS"," * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta"," */"," _insert: function(source, o, type, skipcalc) {","",""," // restore the state at the time of the request"," if (source) {"," this._config(source);"," }",""," // build the dependency list"," // don't include type so we can process CSS and script in"," // one pass when the type is not specified."," if (!skipcalc) {"," //this.calculate(o);"," }",""," var modules = this.resolve(!skipcalc),"," self = this, comp = 0, actions = 0,"," mods = {}, deps;",""," self._refetch = [];",""," if (type) {"," //Filter out the opposite type and reset the array so the checks later work"," modules[((type === JS) ? CSS : JS)] = [];"," }"," if (!self.fetchCSS) {"," modules.css = [];"," }"," if (modules.js.length) {"," comp++;"," }"," if (modules.css.length) {"," comp++;"," }",""," //console.log('Resolved Modules: ', modules);",""," var complete = function(d) {"," actions++;"," var errs = {}, i = 0, o = 0, u = '', fn,"," modName, resMods;",""," if (d && d.errors) {"," for (i = 0; i < d.errors.length; i++) {"," if (d.errors[i].request) {"," u = d.errors[i].request.url;"," } else {"," u = d.errors[i];"," }"," errs[u] = u;"," }"," }"," "," if (d && d.data && d.data.length && (d.type === 'success')) {"," for (i = 0; i < d.data.length; i++) {"," self.inserted[d.data[i].name] = true;"," //If the external module has a skin or a lang, reprocess it"," if (d.data[i].lang || d.data[i].skinnable) {"," delete self.inserted[d.data[i].name];"," self._refetch.push(d.data[i].name);"," }"," }"," }",""," if (actions === comp) {"," self._loading = null;"," if (self._refetch.length) {"," //Get the deps for the new meta-data and reprocess"," for (i = 0; i < self._refetch.length; i++) {"," deps = self.getRequires(self.getModule(self._refetch[i]));"," for (o = 0; o < deps.length; o++) {"," if (!self.inserted[deps[o]]) {"," //We wouldn't be to this point without the module being here"," mods[deps[o]] = deps[o];"," }"," }"," }"," mods = Y.Object.keys(mods);"," if (mods.length) {"," self.require(mods);"," resMods = self.resolve(true);"," if (resMods.cssMods.length) {"," for (i=0; i < resMods.cssMods.length; i++) {"," modName = resMods.cssMods[i].name;"," delete YUI.Env._cssLoaded[modName];"," if (self.isCSSLoaded(modName)) {"," self.inserted[modName] = true;"," delete self.required[modName];"," }"," }"," self.sorted = [];"," self._sort();"," }"," d = null; //bail"," self._insert(); //insert the new deps"," }"," }"," if (d && d.fn) {"," fn = d.fn;"," delete d.fn;"," fn.call(self, d);"," }"," }"," };",""," this._loading = true;",""," if (!modules.js.length && !modules.css.length) {"," actions = -1;"," complete({"," fn: self._onSuccess"," });"," return;"," }"," ",""," if (modules.css.length) { //Load CSS first"," Y.Get.css(modules.css, {"," data: modules.cssMods,"," attributes: self.cssAttributes,"," insertBefore: self.insertBefore,"," charset: self.charset,"," timeout: self.timeout,"," context: self,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }",""," if (modules.js.length) {"," Y.Get.js(modules.js, {"," data: modules.jsMods,"," insertBefore: self.insertBefore,"," attributes: self.jsAttributes,"," charset: self.charset,"," timeout: self.timeout,"," autopurge: false,"," context: self,"," async: self.async,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }"," },"," /**"," * Once a loader operation is completely finished, process any additional queued items."," * @method _continue"," * @private"," */"," _continue: function() {"," if (!(_queue.running) && _queue.size() > 0) {"," _queue.running = true;"," _queue.next()();"," }"," },",""," /**"," * inserts the requested modules and their dependencies."," * <code>type</code> can be \"js\" or \"css\". Both script and"," * css are inserted if type is not provided."," * @method insert"," * @param {object} o optional options object."," * @param {string} type the type of dependency to insert."," */"," insert: function(o, type, skipsort) {"," var self = this, copy = Y.merge(this);"," delete copy.require;"," delete copy.dirty;"," _queue.add(function() {"," self._insert(copy, o, type, skipsort);"," });"," this._continue();"," },",""," /**"," * Executed every time a module is loaded, and if we are in a load"," * cycle, we attempt to load the next script. Public so that it"," * is possible to call this if using a method other than"," * Y.register to determine when scripts are fully loaded"," * @method loadNext"," * @deprecated"," * @param {string} mname optional the name of the module that has"," * been loaded (which is usually why it is time to load the next"," * one)."," */"," loadNext: function(mname) {"," return;"," },",""," /**"," * Apply filter defined for this instance to a url/path"," * @method _filter"," * @param {string} u the string to filter."," * @param {string} name the name of the module, if we are processing"," * a single module as opposed to a combined url."," * @return {string} the filtered string."," * @private"," */"," _filter: function(u, name, group) {"," var f = this.filter,"," hasFilter = name && (name in this.filters),"," modFilter = hasFilter && this.filters[name],"," groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);",""," if (groupName && this.groups[groupName] && this.groups[groupName].filter) {"," modFilter = this.groups[groupName].filter;"," hasFilter = true;"," }",""," if (u) {"," if (hasFilter) {"," f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;"," }"," if (f) {"," u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);"," }"," }"," return u;"," },",""," /**"," * Generates the full url for a module"," * @method _url"," * @param {string} path the path fragment."," * @param {String} name The name of the module"," * @param {String} [base=self.base] The base url to use"," * @return {string} the full url."," * @private"," */"," _url: function(path, name, base) {"," return this._filter((base || this.base || '') + path, name);"," },"," /**"," * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules."," * @method resolve"," * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else"," * @param {Array} [s=loader.sorted] An override for the loader.sorted array"," * @return {Object} Object hash (js and css) of two arrays of file lists"," * @example This method can be used as an off-line dep calculator"," *"," * var Y = YUI();"," * var loader = new Y.Loader({"," * filter: 'debug',"," * base: '../../',"," * root: 'build/',"," * combine: true,"," * require: ['node', 'dd', 'console']"," * });"," * var out = loader.resolve(true);"," *"," */"," resolve: function(calc, s) {",""," var len, i, m, url, fn, msg, attr, group, groupName, j, frag,"," comboSource, comboSources, mods, comboBase,"," base, urls, u = [], tmpBase, baseLen, resCombos = {},"," self = this, comboSep, maxURLLength, singles = [],"," inserted = (self.ignoreRegistered) ? {} : self.inserted,"," resolved = { js: [], jsMods: [], css: [], cssMods: [] },"," type = self.loadType || 'js';",""," if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { "," self._resetModules();"," }",""," if (calc) {"," self.calculate();"," }"," s = s || self.sorted;",""," var addSingle = function(m) {"," "," if (m) {"," group = (m.group && self.groups[m.group]) || NOT_FOUND;"," "," //Always assume it's async"," if (group.async === false) {"," m.async = group.async;"," }",""," url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :"," self._url(m.path, s[i], group.base || m.base);"," "," if (m.attributes || m.async === false) {"," url = {"," url: url,"," async: m.async"," };"," if (m.attributes) {"," url.attributes = m.attributes;"," }"," }"," resolved[m.type].push(url);"," resolved[m.type + 'Mods'].push(m);"," } else {"," }"," "," };",""," len = s.length;",""," // the default combo base"," comboBase = self.comboBase;",""," url = comboBase;",""," comboSources = {};",""," for (i = 0; i < len; i++) {"," comboSource = comboBase;"," m = self.getModule(s[i]);"," groupName = m && m.group;"," group = self.groups[groupName];"," if (groupName && group) {",""," if (!group.combine || m.fullpath) {"," //This is not a combo module, skip it and load it singly later."," //singles.push(s[i]);"," addSingle(m);"," continue;"," }"," m.combine = true;"," if (group.comboBase) {"," comboSource = group.comboBase;"," }",""," if (\"root\" in group && L.isValue(group.root)) {"," m.root = group.root;"," }"," m.comboSep = group.comboSep || self.comboSep;"," m.maxURLLength = group.maxURLLength || self.maxURLLength;"," } else {"," if (!self.combine) {"," //This is not a combo module, skip it and load it singly later."," //singles.push(s[i]);"," addSingle(m);"," continue;"," }"," }",""," comboSources[comboSource] = comboSources[comboSource] || [];"," comboSources[comboSource].push(m);"," }",""," for (j in comboSources) {"," if (comboSources.hasOwnProperty(j)) {"," resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };"," url = j;"," mods = comboSources[j];"," len = mods.length;"," "," if (len) {"," for (i = 0; i < len; i++) {"," if (inserted[mods[i]]) {"," continue;"," }"," m = mods[i];"," // Do not try to combine non-yui JS unless combo def"," // is found"," if (m && (m.combine || !m.ext)) {"," resCombos[j].comboSep = m.comboSep;"," resCombos[j].group = m.group;"," resCombos[j].maxURLLength = m.maxURLLength;"," frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);"," frag = self._filter(frag, m.name);"," resCombos[j][m.type].push(frag);"," resCombos[j][m.type + 'Mods'].push(m);"," } else {"," //Add them to the next process.."," if (mods[i]) {"," //singles.push(mods[i].name);"," addSingle(mods[i]);"," }"," }",""," }"," }"," }"," }","",""," for (j in resCombos) {"," base = j;"," comboSep = resCombos[base].comboSep || self.comboSep;"," maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;"," for (type in resCombos[base]) {"," if (type === JS || type === CSS) {"," urls = resCombos[base][type];"," mods = resCombos[base][type + 'Mods'];"," len = urls.length;"," tmpBase = base + urls.join(comboSep);"," baseLen = tmpBase.length;"," if (maxURLLength <= base.length) {"," maxURLLength = MAX_URL_LENGTH;"," }"," "," if (len) {"," if (baseLen > maxURLLength) {"," u = [];"," for (s = 0; s < len; s++) {"," u.push(urls[s]);"," tmpBase = base + u.join(comboSep);",""," if (tmpBase.length > maxURLLength) {"," m = u.pop();"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," u = [];"," if (m) {"," u.push(m);"," }"," }"," }"," if (u.length) {"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," } else {"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," }"," resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);"," }"," }"," }",""," resCombos = null;",""," return resolved;"," },"," /**"," Shortcut to calculate, resolve and load all modules.",""," var loader = new Y.Loader({"," ignoreRegistered: true,"," modules: {"," mod: {"," path: 'mod.js'"," }"," },"," requires: [ 'mod' ]"," });"," loader.load(function() {"," console.log('All modules have loaded..');"," });","",""," @method load"," @param {Callback} cb Executed after all load operations are complete"," */"," load: function(cb) {"," if (!cb) {"," return;"," }"," var self = this,"," out = self.resolve(true);"," "," self.data = out;",""," self.onEnd = function() {"," cb.apply(self.context || self, arguments);"," };",""," self.insert();"," }","};","","","","}, '3.7.2', {\"requires\": [\"get\", \"features\"]});"];-_yuitest_coverage["build/loader-base/loader-base.js"].lines = {"1":0,"9":0,"11":0,"12":0,"39":0,"45":0,"46":0,"47":0,"50":0,"54":0,"55":0,"56":0,"60":0,"62":0,"72":0,"80":0,"81":0,"82":0,"85":0,"93":0,"94":0,"96":0,"116":0,"138":0,"139":0,"140":0,"142":0,"144":0,"148":0,"149":0,"159":0,"207":0,"209":0,"212":0,"214":0,"268":0,"311":0,"319":0,"334":0,"343":0,"355":0,"362":0,"371":0,"380":0,"398":0,"406":0,"441":0,"448":0,"461":0,"468":0,"470":0,"500":0,"506":0,"511":0,"512":0,"514":0,"524":0,"532":0,"534":0,"536":0,"538":0,"540":0,"542":0,"544":0,"545":0,"570":0,"586":0,"593":0,"600":0,"604":0,"613":0,"615":0,"620":0,"628":0,"633":0,"634":0,"635":0,"636":0,"640":0,"641":0,"642":0,"643":0,"648":0,"649":0,"650":0,"662":0,"663":0,"664":0,"665":0,"669":0,"670":0,"671":0,"672":0,"673":0,"676":0,"677":0,"678":0,"679":0,"680":0,"685":0,"686":0,"687":0,"688":0,"732":0,"735":0,"736":0,"737":0,"738":0,"739":0,"740":0,"745":0,"746":0,"747":0,"748":0,"749":0,"750":0,"751":0,"753":0,"754":0,"756":0,"759":0,"761":0,"775":0,"780":0,"781":0,"784":0,"785":0,"789":0,"790":0,"793":0,"796":0,"797":0,"801":0,"802":0,"803":0,"804":0,"805":0,"810":0,"811":0,"812":0,"813":0,"814":0,"821":0,"822":0,"826":0,"827":0,"830":0,"839":0,"841":0,"842":0,"843":0,"844":0,"845":0,"846":0,"847":0,"849":0,"850":0,"851":0,"856":0,"857":0,"858":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"865":0,"866":0,"873":0,"875":0,"876":0,"877":0,"880":0,"881":0,"882":0,"883":0,"886":0,"887":0,"888":0,"889":0,"891":0,"898":0,"900":0,"901":0,"902":0,"903":0,"904":0,"905":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"915":0,"917":0,"920":0,"921":0,"922":0,"924":0,"925":0,"930":0,"948":0,"949":0,"950":0,"953":0,"967":0,"973":0,"974":0,"975":0,"976":0,"977":0,"978":0,"988":0,"989":0,"991":0,"992":0,"994":0,"999":0,"1015":0,"1016":0,"1045":0,"1048":0,"1049":0,"1050":0,"1052":0,"1053":0,"1054":0,"1055":0,"1056":0,"1061":0,"1062":0,"1063":0,"1064":0,"1065":0,"1066":0,"1068":0,"1069":0,"1106":0,"1108":0,"1109":0,"1116":0,"1122":0,"1125":0,"1127":0,"1128":0,"1131":0,"1133":0,"1134":0,"1135":0,"1136":0,"1140":0,"1141":0,"1143":0,"1145":0,"1148":0,"1154":0,"1156":0,"1163":0,"1164":0,"1165":0,"1168":0,"1169":0,"1170":0,"1171":0,"1172":0,"1178":0,"1179":0,"1186":0,"1187":0,"1188":0,"1191":0,"1192":0,"1195":0,"1196":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1208":0,"1209":0,"1210":0,"1212":0,"1213":0,"1214":0,"1216":0,"1217":0,"1218":0,"1220":0,"1221":0,"1224":0,"1225":0,"1227":0,"1228":0,"1229":0,"1230":0,"1231":0,"1232":0,"1234":0,"1237":0,"1239":0,"1245":0,"1247":0,"1248":0,"1249":0,"1250":0,"1251":0,"1252":0,"1254":0,"1255":0,"1258":0,"1260":0,"1261":0,"1264":0,"1266":0,"1268":0,"1269":0,"1275":0,"1276":0,"1278":0,"1280":0,"1281":0,"1284":0,"1285":0,"1293":0,"1297":0,"1298":0,"1299":0,"1303":0,"1304":0,"1305":0,"1306":0,"1307":0,"1308":0,"1309":0,"1310":0,"1311":0,"1312":0,"1313":0,"1314":0,"1321":0,"1322":0,"1323":0,"1324":0,"1326":0,"1327":0,"1330":0,"1331":0,"1332":0,"1333":0,"1334":0,"1337":0,"1338":0,"1339":0,"1340":0,"1347":0,"1348":0,"1353":0,"1354":0,"1357":0,"1358":0,"1359":0,"1364":0,"1365":0,"1366":0,"1367":0,"1368":0,"1369":0,"1373":0,"1374":0,"1375":0,"1377":0,"1378":0,"1381":0,"1390":0,"1391":0,"1392":0,"1394":0,"1406":0,"1409":0,"1410":0,"1411":0,"1412":0,"1413":0,"1414":0,"1415":0,"1416":0,"1417":0,"1418":0,"1419":0,"1420":0,"1423":0,"1429":0,"1440":0,"1441":0,"1442":0,"1444":0,"1445":0,"1447":0,"1448":0,"1449":0,"1450":0,"1452":0,"1453":0,"1454":0,"1456":0,"1460":0,"1463":0,"1465":0,"1476":0,"1478":0,"1481":0,"1483":0,"1488":0,"1502":0,"1503":0,"1504":0,"1505":0,"1506":0,"1507":0,"1513":0,"1515":0,"1516":0,"1520":0,"1521":0,"1522":0,"1523":0,"1525":0,"1526":0,"1527":0,"1529":0,"1532":0,"1533":0,"1534":0,"1536":0,"1537":0,"1538":0,"1539":0,"1540":0,"1541":0,"1542":0,"1543":0,"1545":0,"1546":0,"1553":0,"1554":0,"1555":0,"1556":0,"1561":0,"1562":0,"1565":0,"1566":0,"1568":0,"1569":0,"1570":0,"1572":0,"1573":0,"1580":0,"1581":0,"1582":0,"1583":0,"1584":0,"1585":0,"1586":0,"1587":0,"1588":0,"1590":0,"1591":0,"1598":0,"1600":0,"1602":0,"1603":0,"1604":0,"1605":0,"1606":0,"1607":0,"1608":0,"1609":0,"1614":0,"1615":0,"1616":0,"1617":0,"1621":0,"1624":0,"1625":0,"1626":0,"1627":0,"1628":0,"1629":0,"1630":0,"1631":0,"1643":0,"1644":0,"1645":0,"1646":0,"1647":0,"1648":0,"1652":0,"1653":0,"1654":0,"1655":0,"1657":0,"1658":0,"1659":0,"1660":0,"1664":0,"1665":0,"1666":0,"1671":0,"1673":0,"1675":0,"1676":0,"1677":0,"1678":0,"1679":0,"1682":0,"1685":0,"1687":0,"1689":0,"1699":0,"1700":0,"1702":0,"1708":0,"1709":0,"1713":0,"1715":0,"1716":0,"1719":0,"1720":0,"1724":0,"1726":0,"1728":0,"1738":0,"1741":0,"1742":0,"1745":0,"1746":0,"1747":0,"1749":0,"1750":0,"1751":0,"1755":0,"1756":0,"1760":0,"1771":0,"1773":0,"1774":0,"1777":0,"1778":0,"1781":0,"1783":0,"1784":0,"1786":0,"1788":0,"1789":0,"1802":0,"1806":0,"1808":0,"1810":0,"1818":0,"1819":0,"1821":0,"1822":0,"1825":0,"1826":0,"1829":0,"1831":0,"1832":0,"1833":0,"1834":0,"1838":0,"1849":0,"1852":0,"1853":0,"1854":0,"1855":0,"1859":0,"1863":0,"1866":0,"1867":0,"1876":0,"1879":0,"1880":0,"1884":0,"1885":0,"1889":0,"1890":0,"1891":0,"1896":0,"1897":0,"1898":0,"1899":0,"1904":0,"1906":0,"1917":0,"1928":0,"1932":0,"1934":0,"1935":0,"1937":0,"1938":0,"1939":0,"1940":0,"1941":0,"1942":0,"1943":0,"1945":0,"1946":0,"1947":0,"1948":0,"1951":0,"1952":0,"1967":0,"1977":0,"1978":0,"1981":0,"1987":0,"1988":0,"1989":0,"1990":0,"1994":0,"1995":0,"1998":0,"2001":0,"2002":0,"2008":0,"2009":0,"2010":0,"2011":0,"2014":0,"2015":0,"2016":0,"2018":0,"2022":0,"2023":0,"2024":0,"2028":0,"2043":0,"2045":0,"2048":0,"2049":0,"2050":0,"2052":0,"2055":0,"2057":0,"2058":0,"2061":0,"2062":0,"2063":0,"2064":0,"2065":0,"2072":0,"2083":0,"2085":0,"2086":0,"2087":0,"2093":0,"2101":0,"2105":0,"2106":0,"2107":0,"2111":0,"2113":0,"2114":0,"2115":0,"2116":0,"2117":0,"2119":0,"2124":0,"2125":0,"2126":0,"2127":0,"2128":0,"2136":0,"2144":0,"2146":0,"2147":0,"2148":0,"2151":0,"2152":0,"2164":0,"2166":0,"2167":0,"2170":0,"2173":0,"2174":0,"2181":0,"2191":0,"2192":0,"2193":0,"2209":0,"2216":0,"2218":0,"2219":0,"2222":0,"2226":0,"2230":0,"2231":0,"2233":0,"2236":0,"2240":0,"2244":0,"2247":0,"2249":0,"2254":0,"2255":0,"2258":0,"2264":0,"2265":0,"2270":0,"2286":0,"2287":0,"2293":0,"2297":0,"2301":0,"2303":0,"2305":0,"2307":0,"2308":0,"2310":0,"2311":0,"2313":0,"2314":0,"2319":0,"2320":0,"2321":0,"2324":0,"2325":0,"2326":0,"2327":0,"2329":0,"2331":0,"2335":0,"2336":0,"2337":0,"2339":0,"2340":0,"2341":0,"2346":0,"2347":0,"2348":0,"2350":0,"2351":0,"2352":0,"2353":0,"2355":0,"2359":0,"2360":0,"2361":0,"2362":0,"2363":0,"2364":0,"2365":0,"2366":0,"2367":0,"2368":0,"2369":0,"2372":0,"2373":0,"2375":0,"2376":0,"2379":0,"2380":0,"2381":0,"2382":0,"2387":0,"2389":0,"2390":0,"2391":0,"2394":0,"2398":0,"2399":0,"2407":0,"2410":0,"2413":0,"2414":0,"2415":0,"2418":0,"2419":0,"2420":0,"2425":0,"2426":0,"2436":0,"2439":0,"2442":0,"2443":0,"2444":0,"2447":0,"2448":0,"2449":0,"2460":0,"2461":0,"2462":0,"2475":0,"2476":0,"2477":0,"2478":0,"2479":0,"2481":0,"2496":0,"2509":0,"2514":0,"2515":0,"2516":0,"2519":0,"2520":0,"2521":0,"2523":0,"2524":0,"2527":0,"2540":0,"2563":0,"2571":0,"2572":0,"2575":0,"2576":0,"2578":0,"2580":0,"2582":0,"2583":0,"2586":0,"2587":0,"2590":0,"2593":0,"2594":0,"2598":0,"2599":0,"2602":0,"2603":0,"2609":0,"2612":0,"2614":0,"2616":0,"2618":0,"2619":0,"2620":0,"2621":0,"2622":0,"2623":0,"2625":0,"2628":0,"2629":0,"2631":0,"2632":0,"2633":0,"2636":0,"2637":0,"2639":0,"2640":0,"2642":0,"2645":0,"2646":0,"2650":0,"2651":0,"2654":0,"2655":0,"2656":0,"2657":0,"2658":0,"2659":0,"2661":0,"2662":0,"2663":0,"2664":0,"2666":0,"2669":0,"2670":0,"2671":0,"2672":0,"2673":0,"2674":0,"2675":0,"2676":0,"2679":0,"2681":0,"2691":0,"2692":0,"2693":0,"2694":0,"2695":0,"2696":0,"2697":0,"2698":0,"2699":0,"2700":0,"2701":0,"2702":0,"2703":0,"2706":0,"2707":0,"2708":0,"2709":0,"2710":0,"2711":0,"2713":0,"2714":0,"2715":0,"2716":0,"2717":0,"2718":0,"2719":0,"2723":0,"2724":0,"2725":0,"2728":0,"2731":0,"2736":0,"2738":0,"2761":0,"2762":0,"2764":0,"2767":0,"2769":0,"2770":0,"2773":0};-_yuitest_coverage["build/loader-base/loader-base.js"].functions = {"yui2Update:37":0,"galleryUpdate:49":0,"configFn:79":0,"(anonymous 2):11":0,"_path:137":0,"Loader:207":0,"_populateCache:627":0,"_resetModules:661":0,"_inspectPage:731":0,"_requires:773":0,"(anonymous 3):921":0,"_config:838":0,"formatSkin:947":0,"_addSkin:966":0,"addAlias:1014":0,"addGroup:1044":0,"addModule:1105":0,"require:1389":0,"_explodeRollups:1405":0,"filterRequires:1439":0,"(anonymous 4):1604":0,"getRequires:1474":0,"isCSSLoaded:1697":0,"(anonymous 5):1750":0,"getProvides:1737":0,"calculate:1770":0,"_addLangPack:1801":0,"_setup:1848":0,"getLangPackName:1916":0,"_explode:1926":0,"_patternTest:1966":0,"getModule:1975":0,"_reduce:2041":0,"_finish:2081":0,"_onSuccess:2100":0,"_onProgress:2143":0,"_onFailure:2163":0,"_onTimeout:2190":0,"_sort:2206":0,"complete:2319":0,"onProgress:2406":0,"onTimeout:2409":0,"onSuccess:2412":0,"onFailure:2417":0,"onProgress:2435":0,"onTimeout:2438":0,"onSuccess:2441":0,"onFailure:2446":0,"_insert:2282":0,"_continue:2459":0,"(anonymous 6):2478":0,"insert:2474":0,"loadNext:2495":0,"_filter:2508":0,"_url:2539":0,"addSingle:2580":0,"resolve:2561":0,"onEnd:2769":0,"load:2760":0,"(anonymous 1):1":0};-_yuitest_coverage["build/loader-base/loader-base.js"].coveredLines = 918;-_yuitest_coverage["build/loader-base/loader-base.js"].coveredFunctions = 60;-_yuitest_coverline("build/loader-base/loader-base.js", 1);-YUI.add('loader-base', function (Y, NAME) {--/**- * The YUI loader core- * @module loader- * @submodule loader-base- */--_yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 1)", 1);-_yuitest_coverline("build/loader-base/loader-base.js", 9);-if (!YUI.Env[Y.version]) {-- _yuitest_coverline("build/loader-base/loader-base.js", 11);-(function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 2)", 11);-_yuitest_coverline("build/loader-base/loader-base.js", 12);-var VERSION = Y.version,- BUILD = '/build/',- ROOT = VERSION + BUILD,- CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',- TNT = '2in3',- TNT_VERSION = '4',- YUI2_VERSION = '2.9.0',- COMBO_BASE = CDN_BASE + 'combo?',- META = { version: VERSION,- root: ROOT,- base: Y.Env.base,- comboBase: COMBO_BASE,- skin: { defaultSkin: 'sam',- base: 'assets/skins/',- path: 'skin.css',- after: ['cssreset',- 'cssfonts',- 'cssgrids',- 'cssbase',- 'cssreset-context',- 'cssfonts-context']},- groups: {},- patterns: {} },- groups = META.groups,- yui2Update = function(tnt, yui2, config) {- - _yuitest_coverfunc("build/loader-base/loader-base.js", "yui2Update", 37);-_yuitest_coverline("build/loader-base/loader-base.js", 39);-var root = TNT + '.' +- (tnt || TNT_VERSION) + '/' +- (yui2 || YUI2_VERSION) + BUILD,- base = (config && config.base) ? config.base : CDN_BASE,- combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;-- _yuitest_coverline("build/loader-base/loader-base.js", 45);-groups.yui2.base = base + root;- _yuitest_coverline("build/loader-base/loader-base.js", 46);-groups.yui2.root = root;- _yuitest_coverline("build/loader-base/loader-base.js", 47);-groups.yui2.comboBase = combo;- },- galleryUpdate = function(tag, config) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "galleryUpdate", 49);-_yuitest_coverline("build/loader-base/loader-base.js", 50);-var root = (tag || GALLERY_VERSION) + BUILD,- base = (config && config.base) ? config.base : CDN_BASE,- combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;-- _yuitest_coverline("build/loader-base/loader-base.js", 54);-groups.gallery.base = base + root;- _yuitest_coverline("build/loader-base/loader-base.js", 55);-groups.gallery.root = root;- _yuitest_coverline("build/loader-base/loader-base.js", 56);-groups.gallery.comboBase = combo;- };--- _yuitest_coverline("build/loader-base/loader-base.js", 60);-groups[VERSION] = {};-- _yuitest_coverline("build/loader-base/loader-base.js", 62);-groups.gallery = {- ext: false,- combine: true,- comboBase: COMBO_BASE,- update: galleryUpdate,- patterns: { 'gallery-': { },- 'lang/gallery-': {},- 'gallerycss-': { type: 'css' } }- };-- _yuitest_coverline("build/loader-base/loader-base.js", 72);-groups.yui2 = {- combine: true,- ext: false,- comboBase: COMBO_BASE,- update: yui2Update,- patterns: {- 'yui2-': {- configFn: function(me) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "configFn", 79);-_yuitest_coverline("build/loader-base/loader-base.js", 80);-if (/-skin|reset|fonts|grids|base/.test(me.name)) {- _yuitest_coverline("build/loader-base/loader-base.js", 81);-me.type = 'css';- _yuitest_coverline("build/loader-base/loader-base.js", 82);-me.path = me.path.replace(/\.js/, '.css');- // this makes skins in builds earlier than- // 2.6.0 work as long as combine is false- _yuitest_coverline("build/loader-base/loader-base.js", 85);-me.path = me.path.replace(/\/yui2-skin/,- '/assets/skins/sam/yui2-skin');- }- }- }- }- };-- _yuitest_coverline("build/loader-base/loader-base.js", 93);-galleryUpdate();- _yuitest_coverline("build/loader-base/loader-base.js", 94);-yui2Update();-- _yuitest_coverline("build/loader-base/loader-base.js", 96);-YUI.Env[VERSION] = META;- }());-}---/*jslint forin: true */--/**- * Loader dynamically loads script and css files. It includes the dependency- * information for the version of the library in use, and will automatically pull in- * dependencies for the modules requested. It can also load the- * files from the Yahoo! CDN, and it can utilize the combo service provided on- * this network to reduce the number of http connections required to download- * YUI files.- *- * @module loader- * @main loader- * @submodule loader-base- */--_yuitest_coverline("build/loader-base/loader-base.js", 116);-var NOT_FOUND = {},- NO_REQUIREMENTS = [],- MAX_URL_LENGTH = 1024,- GLOBAL_ENV = YUI.Env,- GLOBAL_LOADED = GLOBAL_ENV._loaded,- CSS = 'css',- JS = 'js',- INTL = 'intl',- DEFAULT_SKIN = 'sam',- VERSION = Y.version,- ROOT_LANG = '',- YObject = Y.Object,- oeach = YObject.each,- YArray = Y.Array,- _queue = GLOBAL_ENV._loaderQueue,- META = GLOBAL_ENV[VERSION],- SKIN_PREFIX = 'skin-',- L = Y.Lang,- ON_PAGE = GLOBAL_ENV.mods,- modulekey,- cache,- _path = function(dir, file, type, nomin) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_path", 137);-_yuitest_coverline("build/loader-base/loader-base.js", 138);-var path = dir + '/' + file;- _yuitest_coverline("build/loader-base/loader-base.js", 139);-if (!nomin) {- _yuitest_coverline("build/loader-base/loader-base.js", 140);-path += '-min';- }- _yuitest_coverline("build/loader-base/loader-base.js", 142);-path += '.' + (type || CSS);-- _yuitest_coverline("build/loader-base/loader-base.js", 144);-return path;- };--- _yuitest_coverline("build/loader-base/loader-base.js", 148);-if (!YUI.Env._cssLoaded) {- _yuitest_coverline("build/loader-base/loader-base.js", 149);-YUI.Env._cssLoaded = {};- }---/**- * The component metadata is stored in Y.Env.meta.- * Part of the loader module.- * @property meta- * @for YUI- */-_yuitest_coverline("build/loader-base/loader-base.js", 159);-Y.Env.meta = META;--/**- * Loader dynamically loads script and css files. It includes the dependency- * info for the version of the library in use, and will automatically pull in- * dependencies for the modules requested. It can load the- * files from the Yahoo! CDN, and it can utilize the combo service provided on- * this network to reduce the number of http connections required to download- * YUI files. You can also specify an external, custom combo service to host- * your modules as well.-- var Y = YUI();- var loader = new Y.Loader({- filter: 'debug',- base: '../../',- root: 'build/',- combine: true,- require: ['node', 'dd', 'console']- });- var out = loader.resolve(true);- - * @constructor- * @class Loader- * @param {Object} config an optional set of configuration options.- * @param {String} config.base The base dir which to fetch this module from- * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`- * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`- * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>- * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config.- * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies- * @param {Boolean} [config.async=true] Fetch files in async- * @param {Array} config.ignore: A list of modules that should never be dynamically loaded- * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page- * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes- * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes- * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes- * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout- * @param {Object} config.context Execution context for all callbacks- * @param {Function} config.onSuccess Callback for the 'success' event- * @param {Function} config.onFailure Callback for the 'failure' event- * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading.- * @param {Function} config.onTimeout Callback for the 'timeout' event- * @param {Function} config.onProgress Callback executed each time a script or css file is loaded- * @param {Object} config.modules A list of module definitions. See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata- * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.- * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.- * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.- */-_yuitest_coverline("build/loader-base/loader-base.js", 207);-Y.Loader = function(o) {-- _yuitest_coverfunc("build/loader-base/loader-base.js", "Loader", 207);-_yuitest_coverline("build/loader-base/loader-base.js", 209);-var self = this;- - //Catch no config passed.- _yuitest_coverline("build/loader-base/loader-base.js", 212);-o = o || {};-- _yuitest_coverline("build/loader-base/loader-base.js", 214);-modulekey = META.md5;-- /**- * Internal callback to handle multiple internal insert() calls- * so that css is inserted prior to js- * @property _internalCallback- * @private- */- // self._internalCallback = null;-- /**- * Callback that will be executed when the loader is finished- * with an insert- * @method onSuccess- * @type function- */- // self.onSuccess = null;-- /**- * Callback that will be executed if there is a failure- * @method onFailure- * @type function- */- // self.onFailure = null;-- /**- * Callback for the 'CSSComplete' event. When loading YUI components- * with CSS the CSS is loaded first, then the script. This provides- * a moment you can tie into to improve the presentation of the page- * while the script is loading.- * @method onCSS- * @type function- */- // self.onCSS = null;-- /**- * Callback executed each time a script or css file is loaded- * @method onProgress- * @type function- */- // self.onProgress = null;-- /**- * Callback that will be executed if a timeout occurs- * @method onTimeout- * @type function- */- // self.onTimeout = null;-- /**- * The execution context for all callbacks- * @property context- * @default {YUI} the YUI instance- */- _yuitest_coverline("build/loader-base/loader-base.js", 268);-self.context = Y;-- /**- * Data that is passed to all callbacks- * @property data- */- // self.data = null;-- /**- * Node reference or id where new nodes should be inserted before- * @property insertBefore- * @type string|HTMLElement- */- // self.insertBefore = null;-- /**- * The charset attribute for inserted nodes- * @property charset- * @type string- * @deprecated , use cssAttributes or jsAttributes.- */- // self.charset = null;-- /**- * An object literal containing attributes to add to link nodes- * @property cssAttributes- * @type object- */- // self.cssAttributes = null;-- /**- * An object literal containing attributes to add to script nodes- * @property jsAttributes- * @type object- */- // self.jsAttributes = null;-- /**- * The base directory.- * @property base- * @type string- * @default http://yui.yahooapis.com/[YUI VERSION]/build/- */- _yuitest_coverline("build/loader-base/loader-base.js", 311);-self.base = Y.Env.meta.base + Y.Env.meta.root;-- /**- * Base path for the combo service- * @property comboBase- * @type string- * @default http://yui.yahooapis.com/combo?- */- _yuitest_coverline("build/loader-base/loader-base.js", 319);-self.comboBase = Y.Env.meta.comboBase;-- /*- * Base path for language packs.- */- // self.langBase = Y.Env.meta.langBase;- // self.lang = "";-- /**- * If configured, the loader will attempt to use the combo- * service for YUI resources and configured external resources.- * @property combine- * @type boolean- * @default true if a base dir isn't in the config- */- _yuitest_coverline("build/loader-base/loader-base.js", 334);-self.combine = o.base &&- (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- - /**- * The default seperator to use between files in a combo URL- * @property comboSep- * @type {String}- * @default Ampersand- */- _yuitest_coverline("build/loader-base/loader-base.js", 343);-self.comboSep = '&';- /**- * Max url length for combo urls. The default is 1024. This is the URL- * limit for the Yahoo! hosted combo servers. If consuming- * a different combo service that has a different URL limit- * it is possible to override this default by supplying- * the maxURLLength config option. The config option will- * only take effect if lower than the default.- *- * @property maxURLLength- * @type int- */- _yuitest_coverline("build/loader-base/loader-base.js", 355);-self.maxURLLength = MAX_URL_LENGTH;-- /**- * Ignore modules registered on the YUI global- * @property ignoreRegistered- * @default false- */- _yuitest_coverline("build/loader-base/loader-base.js", 362);-self.ignoreRegistered = o.ignoreRegistered;-- /**- * Root path to prepend to module path for the combo- * service- * @property root- * @type string- * @default [YUI VERSION]/build/- */- _yuitest_coverline("build/loader-base/loader-base.js", 371);-self.root = Y.Env.meta.root;-- /**- * Timeout value in milliseconds. If set, self value will be used by- * the get utility. the timeout event will fire if- * a timeout occurs.- * @property timeout- * @type int- */- _yuitest_coverline("build/loader-base/loader-base.js", 380);-self.timeout = 0;-- /**- * A list of modules that should not be loaded, even if- * they turn up in the dependency tree- * @property ignore- * @type string[]- */- // self.ignore = null;-- /**- * A list of modules that should always be loaded, even- * if they have already been inserted into the page.- * @property force- * @type string[]- */- // self.force = null;-- _yuitest_coverline("build/loader-base/loader-base.js", 398);-self.forceMap = {};-- /**- * Should we allow rollups- * @property allowRollup- * @type boolean- * @default false- */- _yuitest_coverline("build/loader-base/loader-base.js", 406);-self.allowRollup = false;-- /**- * A filter to apply to result urls. This filter will modify the default- * path for all modules. The default path for the YUI library is the- * minified version of the files (e.g., event-min.js). The filter property- * can be a predefined filter or a custom filter. The valid predefined- * filters are:- * <dl>- * <dt>DEBUG</dt>- * <dd>Selects the debug versions of the library (e.g., event-debug.js).- * This option will automatically include the Logger widget</dd>- * <dt>RAW</dt>- * <dd>Selects the non-minified version of the library (e.g., event.js).- * </dd>- * </dl>- * You can also define a custom filter, which must be an object literal- * containing a search expression and a replace string:- *- * myFilter: {- * 'searchExp': "-min\\.js",- * 'replaceStr': "-debug.js"- * }- *- * @property filter- * @type string| {searchExp: string, replaceStr: string}- */- // self.filter = null;-- /**- * per-component filter specification. If specified for a given- * component, this overrides the filter config.- * @property filters- * @type object- */- _yuitest_coverline("build/loader-base/loader-base.js", 441);-self.filters = {};-- /**- * The list of requested modules- * @property required- * @type {string: boolean}- */- _yuitest_coverline("build/loader-base/loader-base.js", 448);-self.required = {};-- /**- * If a module name is predefined when requested, it is checked againsts- * the patterns provided in this property. If there is a match, the- * module is added with the default configuration.- *- * At the moment only supporting module prefixes, but anticipate- * supporting at least regular expressions.- * @property patterns- * @type Object- */- // self.patterns = Y.merge(Y.Env.meta.patterns);- _yuitest_coverline("build/loader-base/loader-base.js", 461);-self.patterns = {};-- /**- * The library metadata- * @property moduleInfo- */- // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);- _yuitest_coverline("build/loader-base/loader-base.js", 468);-self.moduleInfo = {};-- _yuitest_coverline("build/loader-base/loader-base.js", 470);-self.groups = Y.merge(Y.Env.meta.groups);-- /**- * Provides the information used to skin the skinnable components.- * The following skin definition would result in 'skin1' and 'skin2'- * being loaded for calendar (if calendar was requested), and- * 'sam' for all other skinnable components:- *- * skin: {- * // The default skin, which is automatically applied if not- * // overriden by a component-specific skin definition.- * // Change this in to apply a different skin globally- * defaultSkin: 'sam',- *- * // This is combined with the loader base property to get- * // the default root directory for a skin. ex:- * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/- * base: 'assets/skins/',- * - * // Any component-specific overrides can be specified here,- * // making it possible to load different skins for different- * // components. It is possible to load more than one skin- * // for a given component as well.- * overrides: {- * calendar: ['skin1', 'skin2']- * }- * }- * @property skin- * @type {Object}- */- _yuitest_coverline("build/loader-base/loader-base.js", 500);-self.skin = Y.merge(Y.Env.meta.skin);-- /*- * Map of conditional modules- * @since 3.2.0- */- _yuitest_coverline("build/loader-base/loader-base.js", 506);-self.conditions = {};-- // map of modules with a hash of modules that meet the requirement- // self.provides = {};-- _yuitest_coverline("build/loader-base/loader-base.js", 511);-self.config = o;- _yuitest_coverline("build/loader-base/loader-base.js", 512);-self._internal = true;-- _yuitest_coverline("build/loader-base/loader-base.js", 514);-self._populateCache();-- /**- * Set when beginning to compute the dependency tree.- * Composed of what YUI reports to be loaded combined- * with what has been loaded by any instance on the page- * with the version number specified in the metadata.- * @property loaded- * @type {string: boolean}- */- _yuitest_coverline("build/loader-base/loader-base.js", 524);-self.loaded = GLOBAL_LOADED[VERSION];-- - /**- * Should Loader fetch scripts in `async`, defaults to `true`- * @property async- */-- _yuitest_coverline("build/loader-base/loader-base.js", 532);-self.async = true;-- _yuitest_coverline("build/loader-base/loader-base.js", 534);-self._inspectPage();-- _yuitest_coverline("build/loader-base/loader-base.js", 536);-self._internal = false;-- _yuitest_coverline("build/loader-base/loader-base.js", 538);-self._config(o);-- _yuitest_coverline("build/loader-base/loader-base.js", 540);-self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; -- _yuitest_coverline("build/loader-base/loader-base.js", 542);-self.testresults = null;-- _yuitest_coverline("build/loader-base/loader-base.js", 544);-if (Y.config.tests) {- _yuitest_coverline("build/loader-base/loader-base.js", 545);-self.testresults = Y.config.tests;- }- - /**- * List of rollup files found in the library metadata- * @property rollups- */- // self.rollups = null;-- /**- * Whether or not to load optional dependencies for- * the requested modules- * @property loadOptional- * @type boolean- * @default false- */- // self.loadOptional = false;-- /**- * All of the derived dependencies in sorted order, which- * will be populated when either calculate() or insert()- * is called- * @property sorted- * @type string[]- */- _yuitest_coverline("build/loader-base/loader-base.js", 570);-self.sorted = [];-- /*- * A list of modules to attach to the YUI instance when complete.- * If not supplied, the sorted list of dependencies are applied.- * @property attaching- */- // self.attaching = null;-- /**- * Flag to indicate the dependency tree needs to be recomputed- * if insert is called again.- * @property dirty- * @type boolean- * @default true- */- _yuitest_coverline("build/loader-base/loader-base.js", 586);-self.dirty = true;-- /**- * List of modules inserted by the utility- * @property inserted- * @type {string: boolean}- */- _yuitest_coverline("build/loader-base/loader-base.js", 593);-self.inserted = {};-- /**- * List of skipped modules during insert() because the module- * was not defined- * @property skipped- */- _yuitest_coverline("build/loader-base/loader-base.js", 600);-self.skipped = {};-- // Y.on('yui:load', self.loadNext, self);-- _yuitest_coverline("build/loader-base/loader-base.js", 604);-self.tested = {};-- /*- * Cached sorted calculate results- * @property results- * @since 3.2.0- */- //self.results = {};-- _yuitest_coverline("build/loader-base/loader-base.js", 613);-if (self.ignoreRegistered) {- //Clear inpage already processed modules.- _yuitest_coverline("build/loader-base/loader-base.js", 615);-self._resetModules();- }--};--_yuitest_coverline("build/loader-base/loader-base.js", 620);-Y.Loader.prototype = {- /**- * Checks the cache for modules and conditions, if they do not exist- * process the default metadata and populate the local moduleInfo hash.- * @method _populateCache- * @private- */- _populateCache: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_populateCache", 627);-_yuitest_coverline("build/loader-base/loader-base.js", 628);-var self = this,- defaults = META.modules,- cache = GLOBAL_ENV._renderedMods,- i;-- _yuitest_coverline("build/loader-base/loader-base.js", 633);-if (cache && !self.ignoreRegistered) {- _yuitest_coverline("build/loader-base/loader-base.js", 634);-for (i in cache) {- _yuitest_coverline("build/loader-base/loader-base.js", 635);-if (cache.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 636);-self.moduleInfo[i] = Y.merge(cache[i]);- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 640);-cache = GLOBAL_ENV._conditions;- _yuitest_coverline("build/loader-base/loader-base.js", 641);-for (i in cache) {- _yuitest_coverline("build/loader-base/loader-base.js", 642);-if (cache.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 643);-self.conditions[i] = Y.merge(cache[i]);- }- }-- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 648);-for (i in defaults) {- _yuitest_coverline("build/loader-base/loader-base.js", 649);-if (defaults.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 650);-self.addModule(defaults[i], i);- }- }- }-- },- /**- * Reset modules in the module cache to a pre-processed state so additional- * computations with a different skin or language will work as expected.- * @private _resetModules- */- _resetModules: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_resetModules", 661);-_yuitest_coverline("build/loader-base/loader-base.js", 662);-var self = this, i, o;- _yuitest_coverline("build/loader-base/loader-base.js", 663);-for (i in self.moduleInfo) {- _yuitest_coverline("build/loader-base/loader-base.js", 664);-if (self.moduleInfo.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 665);-var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);-- _yuitest_coverline("build/loader-base/loader-base.js", 669);-if (details) {- _yuitest_coverline("build/loader-base/loader-base.js", 670);-self.moduleInfo[name]._reset = true;- _yuitest_coverline("build/loader-base/loader-base.js", 671);-self.moduleInfo[name].requires = details.requires || [];- _yuitest_coverline("build/loader-base/loader-base.js", 672);-self.moduleInfo[name].optional = details.optional || [];- _yuitest_coverline("build/loader-base/loader-base.js", 673);-self.moduleInfo[name].supersedes = details.supercedes || [];- }-- _yuitest_coverline("build/loader-base/loader-base.js", 676);-if (mod.defaults) {- _yuitest_coverline("build/loader-base/loader-base.js", 677);-for (o in mod.defaults) {- _yuitest_coverline("build/loader-base/loader-base.js", 678);-if (mod.defaults.hasOwnProperty(o)) {- _yuitest_coverline("build/loader-base/loader-base.js", 679);-if (mod[o]) {- _yuitest_coverline("build/loader-base/loader-base.js", 680);-mod[o] = mod.defaults[o];- }- }- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 685);-delete mod.langCache;- _yuitest_coverline("build/loader-base/loader-base.js", 686);-delete mod.skinCache;- _yuitest_coverline("build/loader-base/loader-base.js", 687);-if (mod.skinnable) {- _yuitest_coverline("build/loader-base/loader-base.js", 688);-self._addSkin(self.skin.defaultSkin, mod.name);- }- }- }- },- /**- Regex that matches a CSS URL. Used to guess the file type when it's not- specified.-- @property REGEX_CSS- @type RegExp- @final- @protected- @since 3.5.0- **/- REGEX_CSS: /\.css(?:[?;].*)?$/i,- - /**- * Default filters for raw and debug- * @property FILTER_DEFS- * @type Object- * @final- * @protected- */- FILTER_DEFS: {- RAW: {- 'searchExp': '-min\\.js',- 'replaceStr': '.js'- },- DEBUG: {- 'searchExp': '-min\\.js',- 'replaceStr': '-debug.js'- },- COVERAGE: {- 'searchExp': '-min\\.js',- 'replaceStr': '-coverage.js'- }- },- /*- * Check the pages meta-data and cache the result.- * @method _inspectPage- * @private- */- _inspectPage: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_inspectPage", 731);-_yuitest_coverline("build/loader-base/loader-base.js", 732);-var self = this, v, m, req, mr, i;-- //Inspect the page for CSS only modules and mark them as loaded.- _yuitest_coverline("build/loader-base/loader-base.js", 735);-for (i in self.moduleInfo) {- _yuitest_coverline("build/loader-base/loader-base.js", 736);-if (self.moduleInfo.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 737);-v = self.moduleInfo[i];- _yuitest_coverline("build/loader-base/loader-base.js", 738);-if (v.type && v.type === CSS) {- _yuitest_coverline("build/loader-base/loader-base.js", 739);-if (self.isCSSLoaded(v.name)) {- _yuitest_coverline("build/loader-base/loader-base.js", 740);-self.loaded[i] = true;- }- }- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 745);-for (i in ON_PAGE) {- _yuitest_coverline("build/loader-base/loader-base.js", 746);-if (ON_PAGE.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 747);-v = ON_PAGE[i];- _yuitest_coverline("build/loader-base/loader-base.js", 748);-if (v.details) {- _yuitest_coverline("build/loader-base/loader-base.js", 749);-m = self.moduleInfo[v.name];- _yuitest_coverline("build/loader-base/loader-base.js", 750);-req = v.details.requires;- _yuitest_coverline("build/loader-base/loader-base.js", 751);-mr = m && m.requires;-- _yuitest_coverline("build/loader-base/loader-base.js", 753);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 754);-if (!m._inspected && req && mr.length != req.length) {- // console.log('deleting ' + m.name);- _yuitest_coverline("build/loader-base/loader-base.js", 756);-delete m.expanded;- }- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 759);-m = self.addModule(v.details, i);- }- _yuitest_coverline("build/loader-base/loader-base.js", 761);-m._inspected = true;- }- }- }- },- /*- * returns true if b is not loaded, and is required directly or by means of modules it supersedes.- * @private- * @method _requires- * @param {String} mod1 The first module to compare- * @param {String} mod2 The second module to compare- */- _requires: function(mod1, mod2) {-- _yuitest_coverfunc("build/loader-base/loader-base.js", "_requires", 773);-_yuitest_coverline("build/loader-base/loader-base.js", 775);-var i, rm, after_map, s,- info = this.moduleInfo,- m = info[mod1],- other = info[mod2];-- _yuitest_coverline("build/loader-base/loader-base.js", 780);-if (!m || !other) {- _yuitest_coverline("build/loader-base/loader-base.js", 781);-return false;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 784);-rm = m.expanded_map;- _yuitest_coverline("build/loader-base/loader-base.js", 785);-after_map = m.after_map;-- // check if this module should be sorted after the other- // do this first to short circut circular deps- _yuitest_coverline("build/loader-base/loader-base.js", 789);-if (after_map && (mod2 in after_map)) {- _yuitest_coverline("build/loader-base/loader-base.js", 790);-return true;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 793);-after_map = other.after_map;-- // and vis-versa- _yuitest_coverline("build/loader-base/loader-base.js", 796);-if (after_map && (mod1 in after_map)) {- _yuitest_coverline("build/loader-base/loader-base.js", 797);-return false;- }-- // check if this module requires one the other supersedes- _yuitest_coverline("build/loader-base/loader-base.js", 801);-s = info[mod2] && info[mod2].supersedes;- _yuitest_coverline("build/loader-base/loader-base.js", 802);-if (s) {- _yuitest_coverline("build/loader-base/loader-base.js", 803);-for (i = 0; i < s.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 804);-if (this._requires(mod1, s[i])) {- _yuitest_coverline("build/loader-base/loader-base.js", 805);-return true;- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 810);-s = info[mod1] && info[mod1].supersedes;- _yuitest_coverline("build/loader-base/loader-base.js", 811);-if (s) {- _yuitest_coverline("build/loader-base/loader-base.js", 812);-for (i = 0; i < s.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 813);-if (this._requires(mod2, s[i])) {- _yuitest_coverline("build/loader-base/loader-base.js", 814);-return false;- }- }- }-- // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {- _yuitest_coverline("build/loader-base/loader-base.js", 821);-if (rm && (mod2 in rm)) {- _yuitest_coverline("build/loader-base/loader-base.js", 822);-return true;- }-- // external css files should be sorted below yui css- _yuitest_coverline("build/loader-base/loader-base.js", 826);-if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {- _yuitest_coverline("build/loader-base/loader-base.js", 827);-return true;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 830);-return false;- },- /**- * Apply a new config to the Loader instance- * @method _config- * @private- * @param {Object} o The new configuration- */- _config: function(o) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_config", 838);-_yuitest_coverline("build/loader-base/loader-base.js", 839);-var i, j, val, a, f, group, groupName, self = this;- // apply config values- _yuitest_coverline("build/loader-base/loader-base.js", 841);-if (o) {- _yuitest_coverline("build/loader-base/loader-base.js", 842);-for (i in o) {- _yuitest_coverline("build/loader-base/loader-base.js", 843);-if (o.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 844);-val = o[i];- _yuitest_coverline("build/loader-base/loader-base.js", 845);-if (i == 'require') {- _yuitest_coverline("build/loader-base/loader-base.js", 846);-self.require(val);- } else {_yuitest_coverline("build/loader-base/loader-base.js", 847);-if (i == 'skin') {- //If the config.skin is a string, format to the expected object- _yuitest_coverline("build/loader-base/loader-base.js", 849);-if (typeof val === 'string') {- _yuitest_coverline("build/loader-base/loader-base.js", 850);-self.skin.defaultSkin = o.skin;- _yuitest_coverline("build/loader-base/loader-base.js", 851);-val = {- defaultSkin: val- };- }-- _yuitest_coverline("build/loader-base/loader-base.js", 856);-Y.mix(self.skin, val, true);- } else {_yuitest_coverline("build/loader-base/loader-base.js", 857);-if (i == 'groups') {- _yuitest_coverline("build/loader-base/loader-base.js", 858);-for (j in val) {- _yuitest_coverline("build/loader-base/loader-base.js", 859);-if (val.hasOwnProperty(j)) {- _yuitest_coverline("build/loader-base/loader-base.js", 860);-groupName = j;- _yuitest_coverline("build/loader-base/loader-base.js", 861);-group = val[j];- _yuitest_coverline("build/loader-base/loader-base.js", 862);-self.addGroup(group, groupName);- _yuitest_coverline("build/loader-base/loader-base.js", 863);-if (group.aliases) {- _yuitest_coverline("build/loader-base/loader-base.js", 864);-for (a in group.aliases) {- _yuitest_coverline("build/loader-base/loader-base.js", 865);-if (group.aliases.hasOwnProperty(a)) {- _yuitest_coverline("build/loader-base/loader-base.js", 866);-self.addAlias(group.aliases[a], a);- }- }- }- }- }-- } else {_yuitest_coverline("build/loader-base/loader-base.js", 873);-if (i == 'modules') {- // add a hash of module definitions- _yuitest_coverline("build/loader-base/loader-base.js", 875);-for (j in val) {- _yuitest_coverline("build/loader-base/loader-base.js", 876);-if (val.hasOwnProperty(j)) {- _yuitest_coverline("build/loader-base/loader-base.js", 877);-self.addModule(val[j], j);- }- }- } else {_yuitest_coverline("build/loader-base/loader-base.js", 880);-if (i === 'aliases') {- _yuitest_coverline("build/loader-base/loader-base.js", 881);-for (j in val) {- _yuitest_coverline("build/loader-base/loader-base.js", 882);-if (val.hasOwnProperty(j)) {- _yuitest_coverline("build/loader-base/loader-base.js", 883);-self.addAlias(val[j], j);- }- }- } else {_yuitest_coverline("build/loader-base/loader-base.js", 886);-if (i == 'gallery') {- _yuitest_coverline("build/loader-base/loader-base.js", 887);-this.groups.gallery.update(val, o);- } else {_yuitest_coverline("build/loader-base/loader-base.js", 888);-if (i == 'yui2' || i == '2in3') {- _yuitest_coverline("build/loader-base/loader-base.js", 889);-this.groups.yui2.update(o['2in3'], o.yui2, o);- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 891);-self[i] = val;- }}}}}}}- }- }- }-- // fix filter- _yuitest_coverline("build/loader-base/loader-base.js", 898);-f = self.filter;-- _yuitest_coverline("build/loader-base/loader-base.js", 900);-if (L.isString(f)) {- _yuitest_coverline("build/loader-base/loader-base.js", 901);-f = f.toUpperCase();- _yuitest_coverline("build/loader-base/loader-base.js", 902);-self.filterName = f;- _yuitest_coverline("build/loader-base/loader-base.js", 903);-self.filter = self.FILTER_DEFS[f];- _yuitest_coverline("build/loader-base/loader-base.js", 904);-if (f == 'DEBUG') {- _yuitest_coverline("build/loader-base/loader-base.js", 905);-self.require('yui-log', 'dump');- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 909);-if (self.filterName && self.coverage) {- _yuitest_coverline("build/loader-base/loader-base.js", 910);-if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 911);-var mods = [];- _yuitest_coverline("build/loader-base/loader-base.js", 912);-for (i = 0; i < self.coverage.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 913);-var mod = self.coverage[i];- _yuitest_coverline("build/loader-base/loader-base.js", 914);-if (self.moduleInfo[mod] && self.moduleInfo[mod].use) {- _yuitest_coverline("build/loader-base/loader-base.js", 915);-mods = [].concat(mods, self.moduleInfo[mod].use);- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 917);-mods.push(mod);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 920);-self.filters = self.filters || {};- _yuitest_coverline("build/loader-base/loader-base.js", 921);-Y.Array.each(mods, function(mod) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 3)", 921);-_yuitest_coverline("build/loader-base/loader-base.js", 922);-self.filters[mod] = self.FILTER_DEFS.COVERAGE;- });- _yuitest_coverline("build/loader-base/loader-base.js", 924);-self.filterName = 'RAW';- _yuitest_coverline("build/loader-base/loader-base.js", 925);-self.filter = self.FILTER_DEFS[self.filterName];- }- }- -- _yuitest_coverline("build/loader-base/loader-base.js", 930);-if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }-- },-- /**- * Returns the skin module name for the specified skin name. If a- * module name is supplied, the returned skin module name is- * specific to the module passed in.- * @method formatSkin- * @param {string} skin the name of the skin.- * @param {string} mod optional: the name of a module to skin.- * @return {string} the full skin module name.- */- formatSkin: function(skin, mod) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "formatSkin", 947);-_yuitest_coverline("build/loader-base/loader-base.js", 948);-var s = SKIN_PREFIX + skin;- _yuitest_coverline("build/loader-base/loader-base.js", 949);-if (mod) {- _yuitest_coverline("build/loader-base/loader-base.js", 950);-s = s + '-' + mod;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 953);-return s;- },-- /**- * Adds the skin def to the module info- * @method _addSkin- * @param {string} skin the name of the skin.- * @param {string} mod the name of the module.- * @param {string} parent parent module if this is a skin of a- * submodule or plugin.- * @return {string} the module name for the skin.- * @private- */- _addSkin: function(skin, mod, parent) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_addSkin", 966);-_yuitest_coverline("build/loader-base/loader-base.js", 967);-var mdef, pkg, name, nmod,- info = this.moduleInfo,- sinf = this.skin,- ext = info[mod] && info[mod].ext;-- // Add a module definition for the module-specific skin css- _yuitest_coverline("build/loader-base/loader-base.js", 973);-if (mod) {- _yuitest_coverline("build/loader-base/loader-base.js", 974);-name = this.formatSkin(skin, mod);- _yuitest_coverline("build/loader-base/loader-base.js", 975);-if (!info[name]) {- _yuitest_coverline("build/loader-base/loader-base.js", 976);-mdef = info[mod];- _yuitest_coverline("build/loader-base/loader-base.js", 977);-pkg = mdef.pkg || mod;- _yuitest_coverline("build/loader-base/loader-base.js", 978);-nmod = {- skin: true,- name: name,- group: mdef.group,- type: 'css',- after: sinf.after,- path: (parent || pkg) + '/' + sinf.base + skin +- '/' + mod + '.css',- ext: ext- };- _yuitest_coverline("build/loader-base/loader-base.js", 988);-if (mdef.base) {- _yuitest_coverline("build/loader-base/loader-base.js", 989);-nmod.base = mdef.base;- }- _yuitest_coverline("build/loader-base/loader-base.js", 991);-if (mdef.configFn) {- _yuitest_coverline("build/loader-base/loader-base.js", 992);-nmod.configFn = mdef.configFn;- }- _yuitest_coverline("build/loader-base/loader-base.js", 994);-this.addModule(nmod, name);-- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 999);-return name;- },- /**- * Adds an alias module to the system- * @method addAlias- * @param {Array} use An array of modules that makes up this alias- * @param {String} name The name of the alias- * @example- * var loader = new Y.Loader({});- * loader.addAlias([ 'node', 'yql' ], 'davglass');- * loader.require(['davglass']);- * var out = loader.resolve(true);- *- * //out.js will contain Node and YQL modules- */- addAlias: function(use, name) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "addAlias", 1014);-_yuitest_coverline("build/loader-base/loader-base.js", 1015);-YUI.Env.aliases[name] = use;- _yuitest_coverline("build/loader-base/loader-base.js", 1016);-this.addModule({- name: name,- use: use- });- },- /**- * Add a new module group- * @method addGroup- * @param {Object} config An object containing the group configuration data- * @param {String} config.name required, the group name- * @param {String} config.base The base directory for this module group- * @param {String} config.root The root path to add to each combo resource path- * @param {Boolean} config.combine Should the request be combined- * @param {String} config.comboBase Combo service base path- * @param {Object} config.modules The group of modules- * @param {String} name the group name.- * @example- * var loader = new Y.Loader({});- * loader.addGroup({- * name: 'davglass',- * combine: true,- * comboBase: '/combo?',- * root: '',- * modules: {- * //Module List here- * }- * }, 'davglass');- */- addGroup: function(o, name) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "addGroup", 1044);-_yuitest_coverline("build/loader-base/loader-base.js", 1045);-var mods = o.modules,- self = this, i, v;-- _yuitest_coverline("build/loader-base/loader-base.js", 1048);-name = name || o.name;- _yuitest_coverline("build/loader-base/loader-base.js", 1049);-o.name = name;- _yuitest_coverline("build/loader-base/loader-base.js", 1050);-self.groups[name] = o;-- _yuitest_coverline("build/loader-base/loader-base.js", 1052);-if (o.patterns) {- _yuitest_coverline("build/loader-base/loader-base.js", 1053);-for (i in o.patterns) {- _yuitest_coverline("build/loader-base/loader-base.js", 1054);-if (o.patterns.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1055);-o.patterns[i].group = name;- _yuitest_coverline("build/loader-base/loader-base.js", 1056);-self.patterns[i] = o.patterns[i];- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1061);-if (mods) {- _yuitest_coverline("build/loader-base/loader-base.js", 1062);-for (i in mods) {- _yuitest_coverline("build/loader-base/loader-base.js", 1063);-if (mods.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1064);-v = mods[i];- _yuitest_coverline("build/loader-base/loader-base.js", 1065);-if (typeof v === 'string') {- _yuitest_coverline("build/loader-base/loader-base.js", 1066);-v = { name: i, fullpath: v };- }- _yuitest_coverline("build/loader-base/loader-base.js", 1068);-v.group = name;- _yuitest_coverline("build/loader-base/loader-base.js", 1069);-self.addModule(v, i);- }- }- }- },-- /**- * Add a new module to the component metadata.- * @method addModule- * @param {Object} config An object containing the module data.- * @param {String} config.name Required, the component name- * @param {String} config.type Required, the component type (js or css)- * @param {String} config.path Required, the path to the script from `base`- * @param {Array} config.requires Array of modules required by this component- * @param {Array} [config.optional] Array of optional modules for this component- * @param {Array} [config.supersedes] Array of the modules this component replaces- * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one- * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array- * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup- * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`- * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in- * @param {Object} [config.submodules] Hash of submodules- * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.- * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`- * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:- * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load- * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.- * @param {String} [config.condition.when] Specifies the load order of the conditional module- * with regard to the position of the trigger module.- * This should be one of three values: `before`, `after`, or `instead`. The default is `after`.- * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`- * @param {Function} [config.configFn] A function to exectute when configuring this module- * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.- * @param {String} [name] The module name, required if not in the module data.- * @return {Object} the module definition or null if the object passed in did not provide all required attributes.- */- addModule: function(o, name) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "addModule", 1105);-_yuitest_coverline("build/loader-base/loader-base.js", 1106);-name = name || o.name;-- _yuitest_coverline("build/loader-base/loader-base.js", 1108);-if (typeof o === 'string') {- _yuitest_coverline("build/loader-base/loader-base.js", 1109);-o = { name: name, fullpath: o };- }- - //Only merge this data if the temp flag is set- //from an earlier pass from a pattern or else- //an override module (YUI_config) can not be used to- //replace a default module.- _yuitest_coverline("build/loader-base/loader-base.js", 1116);-if (this.moduleInfo[name] && this.moduleInfo[name].temp) {- //This catches temp modules loaded via a pattern- // The module will be added twice, once from the pattern and- // Once from the actual add call, this ensures that properties- // that were added to the module the first time around (group: gallery)- // are also added the second time around too.- _yuitest_coverline("build/loader-base/loader-base.js", 1122);-o = Y.merge(this.moduleInfo[name], o);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1125);-o.name = name;-- _yuitest_coverline("build/loader-base/loader-base.js", 1127);-if (!o || !o.name) {- _yuitest_coverline("build/loader-base/loader-base.js", 1128);-return null;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1131);-if (!o.type) {- //Always assume it's javascript unless the CSS pattern is matched.- _yuitest_coverline("build/loader-base/loader-base.js", 1133);-o.type = JS;- _yuitest_coverline("build/loader-base/loader-base.js", 1134);-var p = o.path || o.fullpath;- _yuitest_coverline("build/loader-base/loader-base.js", 1135);-if (p && this.REGEX_CSS.test(p)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1136);-o.type = CSS;- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1140);-if (!o.path && !o.fullpath) {- _yuitest_coverline("build/loader-base/loader-base.js", 1141);-o.path = _path(name, name, o.type);- }- _yuitest_coverline("build/loader-base/loader-base.js", 1143);-o.supersedes = o.supersedes || o.use;-- _yuitest_coverline("build/loader-base/loader-base.js", 1145);-o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;-- // Handle submodule logic- _yuitest_coverline("build/loader-base/loader-base.js", 1148);-var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- - _yuitest_coverline("build/loader-base/loader-base.js", 1154);-this.moduleInfo[name] = o;-- _yuitest_coverline("build/loader-base/loader-base.js", 1156);-o.requires = o.requires || [];- - /*- Only allowing the cascade of requires information, since- optional and supersedes are far more fine grained than- a blanket requires is.- */- _yuitest_coverline("build/loader-base/loader-base.js", 1163);-if (this.requires) {- _yuitest_coverline("build/loader-base/loader-base.js", 1164);-for (i = 0; i < this.requires.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1165);-o.requires.push(this.requires[i]);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 1168);-if (o.group && this.groups && this.groups[o.group]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1169);-g = this.groups[o.group];- _yuitest_coverline("build/loader-base/loader-base.js", 1170);-if (g.requires) {- _yuitest_coverline("build/loader-base/loader-base.js", 1171);-for (i = 0; i < g.requires.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1172);-o.requires.push(g.requires[i]);- }- }- }--- _yuitest_coverline("build/loader-base/loader-base.js", 1178);-if (!o.defaults) {- _yuitest_coverline("build/loader-base/loader-base.js", 1179);-o.defaults = {- requires: o.requires ? [].concat(o.requires) : null,- supersedes: o.supersedes ? [].concat(o.supersedes) : null,- optional: o.optional ? [].concat(o.optional) : null- };- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1186);-if (o.skinnable && o.ext && o.temp) {- _yuitest_coverline("build/loader-base/loader-base.js", 1187);-skinname = this._addSkin(this.skin.defaultSkin, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1188);-o.requires.unshift(skinname);- }- - _yuitest_coverline("build/loader-base/loader-base.js", 1191);-if (o.requires.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 1192);-o.requires = this.filterRequires(o.requires) || [];- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1195);-if (!o.langPack && o.lang) {- _yuitest_coverline("build/loader-base/loader-base.js", 1196);-langs = YArray(o.lang);- _yuitest_coverline("build/loader-base/loader-base.js", 1197);-for (j = 0; j < langs.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1198);-lang = langs[j];- _yuitest_coverline("build/loader-base/loader-base.js", 1199);-packName = this.getLangPackName(lang, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1200);-smod = this.moduleInfo[packName];- _yuitest_coverline("build/loader-base/loader-base.js", 1201);-if (!smod) {- _yuitest_coverline("build/loader-base/loader-base.js", 1202);-smod = this._addLangPack(lang, o, packName);- }- }- }--- _yuitest_coverline("build/loader-base/loader-base.js", 1208);-if (subs) {- _yuitest_coverline("build/loader-base/loader-base.js", 1209);-sup = o.supersedes || [];- _yuitest_coverline("build/loader-base/loader-base.js", 1210);-l = 0;-- _yuitest_coverline("build/loader-base/loader-base.js", 1212);-for (i in subs) {- _yuitest_coverline("build/loader-base/loader-base.js", 1213);-if (subs.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1214);-s = subs[i];-- _yuitest_coverline("build/loader-base/loader-base.js", 1216);-s.path = s.path || _path(name, i, o.type);- _yuitest_coverline("build/loader-base/loader-base.js", 1217);-s.pkg = name;- _yuitest_coverline("build/loader-base/loader-base.js", 1218);-s.group = o.group;-- _yuitest_coverline("build/loader-base/loader-base.js", 1220);-if (s.supersedes) {- _yuitest_coverline("build/loader-base/loader-base.js", 1221);-sup = sup.concat(s.supersedes);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1224);-smod = this.addModule(s, i);- _yuitest_coverline("build/loader-base/loader-base.js", 1225);-sup.push(i);-- _yuitest_coverline("build/loader-base/loader-base.js", 1227);-if (smod.skinnable) {- _yuitest_coverline("build/loader-base/loader-base.js", 1228);-o.skinnable = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1229);-overrides = this.skin.overrides;- _yuitest_coverline("build/loader-base/loader-base.js", 1230);-if (overrides && overrides[i]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1231);-for (j = 0; j < overrides[i].length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1232);-skinname = this._addSkin(overrides[i][j],- i, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1234);-sup.push(skinname);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 1237);-skinname = this._addSkin(this.skin.defaultSkin,- i, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1239);-sup.push(skinname);- }-- // looks like we are expected to work out the metadata- // for the parent module language packs from what is- // specified in the child modules.- _yuitest_coverline("build/loader-base/loader-base.js", 1245);-if (s.lang && s.lang.length) {-- _yuitest_coverline("build/loader-base/loader-base.js", 1247);-langs = YArray(s.lang);- _yuitest_coverline("build/loader-base/loader-base.js", 1248);-for (j = 0; j < langs.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1249);-lang = langs[j];- _yuitest_coverline("build/loader-base/loader-base.js", 1250);-packName = this.getLangPackName(lang, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1251);-supName = this.getLangPackName(lang, i);- _yuitest_coverline("build/loader-base/loader-base.js", 1252);-smod = this.moduleInfo[packName];-- _yuitest_coverline("build/loader-base/loader-base.js", 1254);-if (!smod) {- _yuitest_coverline("build/loader-base/loader-base.js", 1255);-smod = this._addLangPack(lang, o, packName);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1258);-flatSup = flatSup || YArray.hash(smod.supersedes);-- _yuitest_coverline("build/loader-base/loader-base.js", 1260);-if (!(supName in flatSup)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1261);-smod.supersedes.push(supName);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1264);-o.lang = o.lang || [];-- _yuitest_coverline("build/loader-base/loader-base.js", 1266);-flatLang = flatLang || YArray.hash(o.lang);-- _yuitest_coverline("build/loader-base/loader-base.js", 1268);-if (!(lang in flatLang)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1269);-o.lang.push(lang);- }--// Add rollup file, need to add to supersedes list too-- // default packages- _yuitest_coverline("build/loader-base/loader-base.js", 1275);-packName = this.getLangPackName(ROOT_LANG, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1276);-supName = this.getLangPackName(ROOT_LANG, i);-- _yuitest_coverline("build/loader-base/loader-base.js", 1278);-smod = this.moduleInfo[packName];-- _yuitest_coverline("build/loader-base/loader-base.js", 1280);-if (!smod) {- _yuitest_coverline("build/loader-base/loader-base.js", 1281);-smod = this._addLangPack(lang, o, packName);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1284);-if (!(supName in flatSup)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1285);-smod.supersedes.push(supName);- }--// Add rollup file, need to add to supersedes list too-- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1293);-l++;- }- }- //o.supersedes = YObject.keys(YArray.hash(sup));- _yuitest_coverline("build/loader-base/loader-base.js", 1297);-o.supersedes = YArray.dedupe(sup);- _yuitest_coverline("build/loader-base/loader-base.js", 1298);-if (this.allowRollup) {- _yuitest_coverline("build/loader-base/loader-base.js", 1299);-o.rollup = (l < 4) ? l : Math.min(l - 1, 4);- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1303);-plugins = o.plugins;- _yuitest_coverline("build/loader-base/loader-base.js", 1304);-if (plugins) {- _yuitest_coverline("build/loader-base/loader-base.js", 1305);-for (i in plugins) {- _yuitest_coverline("build/loader-base/loader-base.js", 1306);-if (plugins.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1307);-plug = plugins[i];- _yuitest_coverline("build/loader-base/loader-base.js", 1308);-plug.pkg = name;- _yuitest_coverline("build/loader-base/loader-base.js", 1309);-plug.path = plug.path || _path(name, i, o.type);- _yuitest_coverline("build/loader-base/loader-base.js", 1310);-plug.requires = plug.requires || [];- _yuitest_coverline("build/loader-base/loader-base.js", 1311);-plug.group = o.group;- _yuitest_coverline("build/loader-base/loader-base.js", 1312);-this.addModule(plug, i);- _yuitest_coverline("build/loader-base/loader-base.js", 1313);-if (o.skinnable) {- _yuitest_coverline("build/loader-base/loader-base.js", 1314);-this._addSkin(this.skin.defaultSkin, i, name);- }-- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1321);-if (o.condition) {- _yuitest_coverline("build/loader-base/loader-base.js", 1322);-t = o.condition.trigger;- _yuitest_coverline("build/loader-base/loader-base.js", 1323);-if (YUI.Env.aliases[t]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1324);-t = YUI.Env.aliases[t];- }- _yuitest_coverline("build/loader-base/loader-base.js", 1326);-if (!Y.Lang.isArray(t)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1327);-t = [t];- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1330);-for (i = 0; i < t.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1331);-trigger = t[i];- _yuitest_coverline("build/loader-base/loader-base.js", 1332);-when = o.condition.when;- _yuitest_coverline("build/loader-base/loader-base.js", 1333);-conditions[trigger] = conditions[trigger] || {};- _yuitest_coverline("build/loader-base/loader-base.js", 1334);-conditions[trigger][name] = o.condition;- // the 'when' attribute can be 'before', 'after', or 'instead'- // the default is after.- _yuitest_coverline("build/loader-base/loader-base.js", 1337);-if (when && when != 'after') {- _yuitest_coverline("build/loader-base/loader-base.js", 1338);-if (when == 'instead') { // replace the trigger- _yuitest_coverline("build/loader-base/loader-base.js", 1339);-o.supersedes = o.supersedes || [];- _yuitest_coverline("build/loader-base/loader-base.js", 1340);-o.supersedes.push(trigger);- } else { // before the trigger- // the trigger requires the conditional mod,- // so it should appear before the conditional- // mod if we do not intersede.- }- } else { // after the trigger- _yuitest_coverline("build/loader-base/loader-base.js", 1347);-o.after = o.after || [];- _yuitest_coverline("build/loader-base/loader-base.js", 1348);-o.after.push(trigger);- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1353);-if (o.supersedes) {- _yuitest_coverline("build/loader-base/loader-base.js", 1354);-o.supersedes = this.filterRequires(o.supersedes);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1357);-if (o.after) {- _yuitest_coverline("build/loader-base/loader-base.js", 1358);-o.after = this.filterRequires(o.after);- _yuitest_coverline("build/loader-base/loader-base.js", 1359);-o.after_map = YArray.hash(o.after);- }-- // this.dirty = true;-- _yuitest_coverline("build/loader-base/loader-base.js", 1364);-if (o.configFn) {- _yuitest_coverline("build/loader-base/loader-base.js", 1365);-ret = o.configFn(o);- _yuitest_coverline("build/loader-base/loader-base.js", 1366);-if (ret === false) {- _yuitest_coverline("build/loader-base/loader-base.js", 1367);-delete this.moduleInfo[name];- _yuitest_coverline("build/loader-base/loader-base.js", 1368);-delete GLOBAL_ENV._renderedMods[name];- _yuitest_coverline("build/loader-base/loader-base.js", 1369);-o = null;- }- }- //Add to global cache- _yuitest_coverline("build/loader-base/loader-base.js", 1373);-if (o) {- _yuitest_coverline("build/loader-base/loader-base.js", 1374);-if (!GLOBAL_ENV._renderedMods) {- _yuitest_coverline("build/loader-base/loader-base.js", 1375);-GLOBAL_ENV._renderedMods = {};- }- _yuitest_coverline("build/loader-base/loader-base.js", 1377);-GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);- _yuitest_coverline("build/loader-base/loader-base.js", 1378);-GLOBAL_ENV._conditions = conditions;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1381);-return o;- },-- /**- * Add a requirement for one or more module- * @method require- * @param {string[] | string*} what the modules to load.- */- require: function(what) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "require", 1389);-_yuitest_coverline("build/loader-base/loader-base.js", 1390);-var a = (typeof what === 'string') ? YArray(arguments) : what;- _yuitest_coverline("build/loader-base/loader-base.js", 1391);-this.dirty = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1392);-this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));-- _yuitest_coverline("build/loader-base/loader-base.js", 1394);-this._explodeRollups();- },- /**- * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with - * the content of the "use".- * This will make asking for: "dd"- * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"- * @private- * @method _explodeRollups- */- _explodeRollups: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_explodeRollups", 1405);-_yuitest_coverline("build/loader-base/loader-base.js", 1406);-var self = this, m, m2, i, a, v, len, len2,- r = self.required;-- _yuitest_coverline("build/loader-base/loader-base.js", 1409);-if (!self.allowRollup) {- _yuitest_coverline("build/loader-base/loader-base.js", 1410);-for (i in r) {- _yuitest_coverline("build/loader-base/loader-base.js", 1411);-if (r.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1412);-m = self.getModule(i);- _yuitest_coverline("build/loader-base/loader-base.js", 1413);-if (m && m.use) {- _yuitest_coverline("build/loader-base/loader-base.js", 1414);-len = m.use.length;- _yuitest_coverline("build/loader-base/loader-base.js", 1415);-for (a = 0; a < len; a++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1416);-m2 = self.getModule(m.use[a]);- _yuitest_coverline("build/loader-base/loader-base.js", 1417);-if (m2 && m2.use) {- _yuitest_coverline("build/loader-base/loader-base.js", 1418);-len2 = m2.use.length;- _yuitest_coverline("build/loader-base/loader-base.js", 1419);-for (v = 0; v < len2; v++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1420);-r[m2.use[v]] = true;- }- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 1423);-r[m.use[a]] = true;- }- }- }- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 1429);-self.required = r;- }-- },- /**- * Explodes the required array to remove aliases and replace them with real modules- * @method filterRequires- * @param {Array} r The original requires array- * @return {Array} The new array of exploded requirements- */- filterRequires: function(r) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "filterRequires", 1439);-_yuitest_coverline("build/loader-base/loader-base.js", 1440);-if (r) {- _yuitest_coverline("build/loader-base/loader-base.js", 1441);-if (!Y.Lang.isArray(r)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1442);-r = [r];- }- _yuitest_coverline("build/loader-base/loader-base.js", 1444);-r = Y.Array(r);- _yuitest_coverline("build/loader-base/loader-base.js", 1445);-var c = [], i, mod, o, m;-- _yuitest_coverline("build/loader-base/loader-base.js", 1447);-for (i = 0; i < r.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1448);-mod = this.getModule(r[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 1449);-if (mod && mod.use) {- _yuitest_coverline("build/loader-base/loader-base.js", 1450);-for (o = 0; o < mod.use.length; o++) {- //Must walk the other modules in case a module is a rollup of rollups (datatype)- _yuitest_coverline("build/loader-base/loader-base.js", 1452);-m = this.getModule(mod.use[o]);- _yuitest_coverline("build/loader-base/loader-base.js", 1453);-if (m && m.use && (m.name !== mod.name)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1454);-c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 1456);-c.push(mod.use[o]);- }- }- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 1460);-c.push(r[i]);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 1463);-r = c;- }- _yuitest_coverline("build/loader-base/loader-base.js", 1465);-return r;- },- /**- * Returns an object containing properties for all modules required- * in order to load the requested module- * @method getRequires- * @param {object} mod The module definition from moduleInfo.- * @return {array} the expanded requirement list.- */- getRequires: function(mod) {-- _yuitest_coverfunc("build/loader-base/loader-base.js", "getRequires", 1474);-_yuitest_coverline("build/loader-base/loader-base.js", 1476);-if (!mod) {- //console.log('returning no reqs for ' + mod.name);- _yuitest_coverline("build/loader-base/loader-base.js", 1478);-return NO_REQUIREMENTS;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1481);-if (mod._parsed) {- //console.log('returning requires for ' + mod.name, mod.requires);- _yuitest_coverline("build/loader-base/loader-base.js", 1483);-return mod.expanded || NO_REQUIREMENTS;- }-- //TODO add modue cache here out of scope..-- _yuitest_coverline("build/loader-base/loader-base.js", 1488);-var i, m, j, add, packName, lang, testresults = this.testresults,- name = mod.name, cond,- adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,- r, old_mod,- o, skinmod, skindef, skinpar, skinname,- intl = mod.lang || mod.intl,- info = this.moduleInfo,- ftests = Y.Features && Y.Features.tests.load,- hash, reparse;-- // console.log(name);-- // pattern match leaves module stub that needs to be filled out- _yuitest_coverline("build/loader-base/loader-base.js", 1502);-if (mod.temp && adddef) {- _yuitest_coverline("build/loader-base/loader-base.js", 1503);-old_mod = mod;- _yuitest_coverline("build/loader-base/loader-base.js", 1504);-mod = this.addModule(adddef, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1505);-mod.group = old_mod.group;- _yuitest_coverline("build/loader-base/loader-base.js", 1506);-mod.pkg = old_mod.pkg;- _yuitest_coverline("build/loader-base/loader-base.js", 1507);-delete mod.expanded;- }-- // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- - //If a skin or a lang is different, reparse..- _yuitest_coverline("build/loader-base/loader-base.js", 1513);-reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));-- _yuitest_coverline("build/loader-base/loader-base.js", 1515);-if (mod.expanded && !reparse) {- _yuitest_coverline("build/loader-base/loader-base.js", 1516);-return mod.expanded;- }- -- _yuitest_coverline("build/loader-base/loader-base.js", 1520);-d = [];- _yuitest_coverline("build/loader-base/loader-base.js", 1521);-hash = {};- _yuitest_coverline("build/loader-base/loader-base.js", 1522);-r = this.filterRequires(mod.requires);- _yuitest_coverline("build/loader-base/loader-base.js", 1523);-if (mod.lang) {- //If a module has a lang attribute, auto add the intl requirement.- _yuitest_coverline("build/loader-base/loader-base.js", 1525);-d.unshift('intl');- _yuitest_coverline("build/loader-base/loader-base.js", 1526);-r.unshift('intl');- _yuitest_coverline("build/loader-base/loader-base.js", 1527);-intl = true;- }- _yuitest_coverline("build/loader-base/loader-base.js", 1529);-o = this.filterRequires(mod.optional);--- _yuitest_coverline("build/loader-base/loader-base.js", 1532);-mod._parsed = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1533);-mod.langCache = this.lang;- _yuitest_coverline("build/loader-base/loader-base.js", 1534);-mod.skinCache = this.skin.defaultSkin;-- _yuitest_coverline("build/loader-base/loader-base.js", 1536);-for (i = 0; i < r.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1537);-if (!hash[r[i]]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1538);-d.push(r[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 1539);-hash[r[i]] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1540);-m = this.getModule(r[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 1541);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 1542);-add = this.getRequires(m);- _yuitest_coverline("build/loader-base/loader-base.js", 1543);-intl = intl || (m.expanded_map &&- (INTL in m.expanded_map));- _yuitest_coverline("build/loader-base/loader-base.js", 1545);-for (j = 0; j < add.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1546);-d.push(add[j]);- }- }- }- }-- // get the requirements from superseded modules, if any- _yuitest_coverline("build/loader-base/loader-base.js", 1553);-r = this.filterRequires(mod.supersedes);- _yuitest_coverline("build/loader-base/loader-base.js", 1554);-if (r) {- _yuitest_coverline("build/loader-base/loader-base.js", 1555);-for (i = 0; i < r.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1556);-if (!hash[r[i]]) {- // if this module has submodules, the requirements list is- // expanded to include the submodules. This is so we can- // prevent dups when a submodule is already loaded and the- // parent is requested.- _yuitest_coverline("build/loader-base/loader-base.js", 1561);-if (mod.submodules) {- _yuitest_coverline("build/loader-base/loader-base.js", 1562);-d.push(r[i]);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1565);-hash[r[i]] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1566);-m = this.getModule(r[i]);-- _yuitest_coverline("build/loader-base/loader-base.js", 1568);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 1569);-add = this.getRequires(m);- _yuitest_coverline("build/loader-base/loader-base.js", 1570);-intl = intl || (m.expanded_map &&- (INTL in m.expanded_map));- _yuitest_coverline("build/loader-base/loader-base.js", 1572);-for (j = 0; j < add.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1573);-d.push(add[j]);- }- }- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1580);-if (o && this.loadOptional) {- _yuitest_coverline("build/loader-base/loader-base.js", 1581);-for (i = 0; i < o.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1582);-if (!hash[o[i]]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1583);-d.push(o[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 1584);-hash[o[i]] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1585);-m = info[o[i]];- _yuitest_coverline("build/loader-base/loader-base.js", 1586);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 1587);-add = this.getRequires(m);- _yuitest_coverline("build/loader-base/loader-base.js", 1588);-intl = intl || (m.expanded_map &&- (INTL in m.expanded_map));- _yuitest_coverline("build/loader-base/loader-base.js", 1590);-for (j = 0; j < add.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1591);-d.push(add[j]);- }- }- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1598);-cond = this.conditions[name];-- _yuitest_coverline("build/loader-base/loader-base.js", 1600);-if (cond) {- //Set the module to not parsed since we have conditionals and this could change the dependency tree.- _yuitest_coverline("build/loader-base/loader-base.js", 1602);-mod._parsed = false;- _yuitest_coverline("build/loader-base/loader-base.js", 1603);-if (testresults && ftests) {- _yuitest_coverline("build/loader-base/loader-base.js", 1604);-oeach(testresults, function(result, id) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 4)", 1604);-_yuitest_coverline("build/loader-base/loader-base.js", 1605);-var condmod = ftests[id].name;- _yuitest_coverline("build/loader-base/loader-base.js", 1606);-if (!hash[condmod] && ftests[id].trigger == name) {- _yuitest_coverline("build/loader-base/loader-base.js", 1607);-if (result && ftests[id]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1608);-hash[condmod] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1609);-d.push(condmod);- }- }- });- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 1614);-for (i in cond) {- _yuitest_coverline("build/loader-base/loader-base.js", 1615);-if (cond.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1616);-if (!hash[i]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1617);-def = cond[i];- //first see if they've specfied a ua check- //then see if they've got a test fn & if it returns true- //otherwise just having a condition block is enough- _yuitest_coverline("build/loader-base/loader-base.js", 1621);-go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||- (def.test && def.test(Y, r)));-- _yuitest_coverline("build/loader-base/loader-base.js", 1624);-if (go) {- _yuitest_coverline("build/loader-base/loader-base.js", 1625);-hash[i] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1626);-d.push(i);- _yuitest_coverline("build/loader-base/loader-base.js", 1627);-m = this.getModule(i);- _yuitest_coverline("build/loader-base/loader-base.js", 1628);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 1629);-add = this.getRequires(m);- _yuitest_coverline("build/loader-base/loader-base.js", 1630);-for (j = 0; j < add.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1631);-d.push(add[j]);- }-- }- }- }- }- }- }- }-- // Create skin modules- _yuitest_coverline("build/loader-base/loader-base.js", 1643);-if (mod.skinnable) {- _yuitest_coverline("build/loader-base/loader-base.js", 1644);-skindef = this.skin.overrides;- _yuitest_coverline("build/loader-base/loader-base.js", 1645);-for (i in YUI.Env.aliases) {- _yuitest_coverline("build/loader-base/loader-base.js", 1646);-if (YUI.Env.aliases.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1647);-if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {- _yuitest_coverline("build/loader-base/loader-base.js", 1648);-skinpar = i;- }- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 1652);-if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {- _yuitest_coverline("build/loader-base/loader-base.js", 1653);-skinname = name;- _yuitest_coverline("build/loader-base/loader-base.js", 1654);-if (skindef[skinpar]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1655);-skinname = skinpar;- }- _yuitest_coverline("build/loader-base/loader-base.js", 1657);-for (i = 0; i < skindef[skinname].length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1658);-skinmod = this._addSkin(skindef[skinname][i], name);- _yuitest_coverline("build/loader-base/loader-base.js", 1659);-if (!this.isCSSLoaded(skinmod, this._boot)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1660);-d.push(skinmod);- }- }- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 1664);-skinmod = this._addSkin(this.skin.defaultSkin, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1665);-if (!this.isCSSLoaded(skinmod, this._boot)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1666);-d.push(skinmod);- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1671);-mod._parsed = false;-- _yuitest_coverline("build/loader-base/loader-base.js", 1673);-if (intl) {-- _yuitest_coverline("build/loader-base/loader-base.js", 1675);-if (mod.lang && !mod.langPack && Y.Intl) {- _yuitest_coverline("build/loader-base/loader-base.js", 1676);-lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);- _yuitest_coverline("build/loader-base/loader-base.js", 1677);-packName = this.getLangPackName(lang, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1678);-if (packName) {- _yuitest_coverline("build/loader-base/loader-base.js", 1679);-d.unshift(packName);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 1682);-d.unshift(INTL);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1685);-mod.expanded_map = YArray.hash(d);-- _yuitest_coverline("build/loader-base/loader-base.js", 1687);-mod.expanded = YObject.keys(mod.expanded_map);-- _yuitest_coverline("build/loader-base/loader-base.js", 1689);-return mod.expanded;- },- /**- * Check to see if named css module is already loaded on the page- * @method isCSSLoaded- * @param {String} name The name of the css file- * @return Boolean- */- isCSSLoaded: function(name, skip) {- //TODO - Make this call a batching call with name being an array- _yuitest_coverfunc("build/loader-base/loader-base.js", "isCSSLoaded", 1697);-_yuitest_coverline("build/loader-base/loader-base.js", 1699);-if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1700);-return false;- }- _yuitest_coverline("build/loader-base/loader-base.js", 1702);-var el = YUI.Env.cssStampEl,- ret = false,- mod = YUI.Env._cssLoaded[name],- style = el.currentStyle; //IE-- - _yuitest_coverline("build/loader-base/loader-base.js", 1708);-if (mod !== undefined) {- _yuitest_coverline("build/loader-base/loader-base.js", 1709);-return mod;- }-- //Add the classname to the element- _yuitest_coverline("build/loader-base/loader-base.js", 1713);-el.className = name;-- _yuitest_coverline("build/loader-base/loader-base.js", 1715);-if (!style) {- _yuitest_coverline("build/loader-base/loader-base.js", 1716);-style = Y.config.doc.defaultView.getComputedStyle(el, null);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1719);-if (style && style.display === 'none') {- _yuitest_coverline("build/loader-base/loader-base.js", 1720);-ret = true;- }--- _yuitest_coverline("build/loader-base/loader-base.js", 1724);-el.className = ''; //Reset the classname to ''-- _yuitest_coverline("build/loader-base/loader-base.js", 1726);-YUI.Env._cssLoaded[name] = ret;-- _yuitest_coverline("build/loader-base/loader-base.js", 1728);-return ret;- },-- /**- * Returns a hash of module names the supplied module satisfies.- * @method getProvides- * @param {string} name The name of the module.- * @return {object} what this module provides.- */- getProvides: function(name) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "getProvides", 1737);-_yuitest_coverline("build/loader-base/loader-base.js", 1738);-var m = this.getModule(name), o, s;- // supmap = this.provides;-- _yuitest_coverline("build/loader-base/loader-base.js", 1741);-if (!m) {- _yuitest_coverline("build/loader-base/loader-base.js", 1742);-return NOT_FOUND;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1745);-if (m && !m.provides) {- _yuitest_coverline("build/loader-base/loader-base.js", 1746);-o = {};- _yuitest_coverline("build/loader-base/loader-base.js", 1747);-s = m.supersedes;-- _yuitest_coverline("build/loader-base/loader-base.js", 1749);-if (s) {- _yuitest_coverline("build/loader-base/loader-base.js", 1750);-YArray.each(s, function(v) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 5)", 1750);-_yuitest_coverline("build/loader-base/loader-base.js", 1751);-Y.mix(o, this.getProvides(v));- }, this);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1755);-o[name] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1756);-m.provides = o;-- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1760);-return m.provides;- },-- /**- * Calculates the dependency tree, the result is stored in the sorted- * property.- * @method calculate- * @param {object} o optional options object.- * @param {string} type optional argument to prune modules.- */- calculate: function(o, type) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "calculate", 1770);-_yuitest_coverline("build/loader-base/loader-base.js", 1771);-if (o || type || this.dirty) {-- _yuitest_coverline("build/loader-base/loader-base.js", 1773);-if (o) {- _yuitest_coverline("build/loader-base/loader-base.js", 1774);-this._config(o);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1777);-if (!this._init) {- _yuitest_coverline("build/loader-base/loader-base.js", 1778);-this._setup();- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1781);-this._explode();-- _yuitest_coverline("build/loader-base/loader-base.js", 1783);-if (this.allowRollup) {- _yuitest_coverline("build/loader-base/loader-base.js", 1784);-this._rollup();- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 1786);-this._explodeRollups();- }- _yuitest_coverline("build/loader-base/loader-base.js", 1788);-this._reduce();- _yuitest_coverline("build/loader-base/loader-base.js", 1789);-this._sort();- }- },- /**- * Creates a "psuedo" package for languages provided in the lang array- * @method _addLangPack- * @private- * @param {String} lang The language to create- * @param {Object} m The module definition to create the language pack around- * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)- * @return {Object} The module definition- */- _addLangPack: function(lang, m, packName) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_addLangPack", 1801);-_yuitest_coverline("build/loader-base/loader-base.js", 1802);-var name = m.name,- packPath, conf,- existing = this.moduleInfo[packName];-- _yuitest_coverline("build/loader-base/loader-base.js", 1806);-if (!existing) {-- _yuitest_coverline("build/loader-base/loader-base.js", 1808);-packPath = _path((m.pkg || name), packName, JS, true);-- _yuitest_coverline("build/loader-base/loader-base.js", 1810);-conf = {- path: packPath,- intl: true,- langPack: true,- ext: m.ext,- group: m.group,- supersedes: []- };- _yuitest_coverline("build/loader-base/loader-base.js", 1818);-if (m.root) {- _yuitest_coverline("build/loader-base/loader-base.js", 1819);-conf.root = m.root;- }- _yuitest_coverline("build/loader-base/loader-base.js", 1821);-if (m.base) {- _yuitest_coverline("build/loader-base/loader-base.js", 1822);-conf.base = m.base;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1825);-if (m.configFn) {- _yuitest_coverline("build/loader-base/loader-base.js", 1826);-conf.configFn = m.configFn;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1829);-this.addModule(conf, packName);-- _yuitest_coverline("build/loader-base/loader-base.js", 1831);-if (lang) {- _yuitest_coverline("build/loader-base/loader-base.js", 1832);-Y.Env.lang = Y.Env.lang || {};- _yuitest_coverline("build/loader-base/loader-base.js", 1833);-Y.Env.lang[lang] = Y.Env.lang[lang] || {};- _yuitest_coverline("build/loader-base/loader-base.js", 1834);-Y.Env.lang[lang][name] = true;- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1838);-return this.moduleInfo[packName];- },-- /**- * Investigates the current YUI configuration on the page. By default,- * modules already detected will not be loaded again unless a force- * option is encountered. Called by calculate()- * @method _setup- * @private- */- _setup: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_setup", 1848);-_yuitest_coverline("build/loader-base/loader-base.js", 1849);-var info = this.moduleInfo, name, i, j, m, l,- packName;-- _yuitest_coverline("build/loader-base/loader-base.js", 1852);-for (name in info) {- _yuitest_coverline("build/loader-base/loader-base.js", 1853);-if (info.hasOwnProperty(name)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1854);-m = info[name];- _yuitest_coverline("build/loader-base/loader-base.js", 1855);-if (m) {-- // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- _yuitest_coverline("build/loader-base/loader-base.js", 1859);-m.requires = YArray.dedupe(m.requires);-- // Create lang pack modules- //if (m.lang && m.lang.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 1863);-if (m.lang) {- // Setup root package if the module has lang defined,- // it needs to provide a root language pack- _yuitest_coverline("build/loader-base/loader-base.js", 1866);-packName = this.getLangPackName(ROOT_LANG, name);- _yuitest_coverline("build/loader-base/loader-base.js", 1867);-this._addLangPack(null, m, packName);- }-- }- }- }--- //l = Y.merge(this.inserted);- _yuitest_coverline("build/loader-base/loader-base.js", 1876);-l = {};-- // available modules- _yuitest_coverline("build/loader-base/loader-base.js", 1879);-if (!this.ignoreRegistered) {- _yuitest_coverline("build/loader-base/loader-base.js", 1880);-Y.mix(l, GLOBAL_ENV.mods);- }-- // add the ignore list to the list of loaded packages- _yuitest_coverline("build/loader-base/loader-base.js", 1884);-if (this.ignore) {- _yuitest_coverline("build/loader-base/loader-base.js", 1885);-Y.mix(l, YArray.hash(this.ignore));- }-- // expand the list to include superseded modules- _yuitest_coverline("build/loader-base/loader-base.js", 1889);-for (j in l) {- _yuitest_coverline("build/loader-base/loader-base.js", 1890);-if (l.hasOwnProperty(j)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1891);-Y.mix(l, this.getProvides(j));- }- }-- // remove modules on the force list from the loaded list- _yuitest_coverline("build/loader-base/loader-base.js", 1896);-if (this.force) {- _yuitest_coverline("build/loader-base/loader-base.js", 1897);-for (i = 0; i < this.force.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 1898);-if (this.force[i] in l) {- _yuitest_coverline("build/loader-base/loader-base.js", 1899);-delete l[this.force[i]];- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1904);-Y.mix(this.loaded, l);-- _yuitest_coverline("build/loader-base/loader-base.js", 1906);-this._init = true;- },-- /**- * Builds a module name for a language pack- * @method getLangPackName- * @param {string} lang the language code.- * @param {string} mname the module to build it for.- * @return {string} the language pack module name.- */- getLangPackName: function(lang, mname) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "getLangPackName", 1916);-_yuitest_coverline("build/loader-base/loader-base.js", 1917);-return ('lang/' + mname + ((lang) ? '_' + lang : ''));- },- /**- * Inspects the required modules list looking for additional- * dependencies. Expands the required list to include all- * required modules. Called by calculate()- * @method _explode- * @private- */- _explode: function() {- //TODO Move done out of scope- _yuitest_coverfunc("build/loader-base/loader-base.js", "_explode", 1926);-_yuitest_coverline("build/loader-base/loader-base.js", 1928);-var r = this.required, m, reqs, done = {},- self = this, name;-- // the setup phase is over, all modules have been created- _yuitest_coverline("build/loader-base/loader-base.js", 1932);-self.dirty = false;-- _yuitest_coverline("build/loader-base/loader-base.js", 1934);-self._explodeRollups();- _yuitest_coverline("build/loader-base/loader-base.js", 1935);-r = self.required;- - _yuitest_coverline("build/loader-base/loader-base.js", 1937);-for (name in r) {- _yuitest_coverline("build/loader-base/loader-base.js", 1938);-if (r.hasOwnProperty(name)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1939);-if (!done[name]) {- _yuitest_coverline("build/loader-base/loader-base.js", 1940);-done[name] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 1941);-m = self.getModule(name);- _yuitest_coverline("build/loader-base/loader-base.js", 1942);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 1943);-var expound = m.expound;-- _yuitest_coverline("build/loader-base/loader-base.js", 1945);-if (expound) {- _yuitest_coverline("build/loader-base/loader-base.js", 1946);-r[expound] = self.getModule(expound);- _yuitest_coverline("build/loader-base/loader-base.js", 1947);-reqs = self.getRequires(r[expound]);- _yuitest_coverline("build/loader-base/loader-base.js", 1948);-Y.mix(r, YArray.hash(reqs));- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1951);-reqs = self.getRequires(m);- _yuitest_coverline("build/loader-base/loader-base.js", 1952);-Y.mix(r, YArray.hash(reqs));- }- }- }- }-- },- /**- * The default method used to test a module against a pattern- * @method _patternTest- * @private- * @param {String} mname The module being tested- * @param {String} pname The pattern to match- */- _patternTest: function(mname, pname) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_patternTest", 1966);-_yuitest_coverline("build/loader-base/loader-base.js", 1967);-return (mname.indexOf(pname) > -1);- },- /**- * Get's the loader meta data for the requested module- * @method getModule- * @param {String} mname The module name to get- * @return {Object} The module metadata- */- getModule: function(mname) {- //TODO: Remove name check - it's a quick hack to fix pattern WIP- _yuitest_coverfunc("build/loader-base/loader-base.js", "getModule", 1975);-_yuitest_coverline("build/loader-base/loader-base.js", 1977);-if (!mname) {- _yuitest_coverline("build/loader-base/loader-base.js", 1978);-return null;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1981);-var p, found, pname,- m = this.moduleInfo[mname],- patterns = this.patterns;-- // check the patterns library to see if we should automatically add- // the module with defaults- _yuitest_coverline("build/loader-base/loader-base.js", 1987);-if (!m || (m && m.ext)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1988);-for (pname in patterns) {- _yuitest_coverline("build/loader-base/loader-base.js", 1989);-if (patterns.hasOwnProperty(pname)) {- _yuitest_coverline("build/loader-base/loader-base.js", 1990);-p = patterns[pname];- - //There is no test method, create a default one that tests- // the pattern against the mod name- _yuitest_coverline("build/loader-base/loader-base.js", 1994);-if (!p.test) {- _yuitest_coverline("build/loader-base/loader-base.js", 1995);-p.test = this._patternTest;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 1998);-if (p.test(mname, pname)) {- // use the metadata supplied for the pattern- // as the module definition.- _yuitest_coverline("build/loader-base/loader-base.js", 2001);-found = p;- _yuitest_coverline("build/loader-base/loader-base.js", 2002);-break;- }- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2008);-if (!m) {- _yuitest_coverline("build/loader-base/loader-base.js", 2009);-if (found) {- _yuitest_coverline("build/loader-base/loader-base.js", 2010);-if (p.action) {- _yuitest_coverline("build/loader-base/loader-base.js", 2011);-p.action.call(this, mname, pname);- } else {- // ext true or false?- _yuitest_coverline("build/loader-base/loader-base.js", 2014);-m = this.addModule(Y.merge(found), mname);- _yuitest_coverline("build/loader-base/loader-base.js", 2015);-if (found.configFn) {- _yuitest_coverline("build/loader-base/loader-base.js", 2016);-m.configFn = found.configFn;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2018);-m.temp = true;- }- }- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 2022);-if (found && m && found.configFn && !m.configFn) {- _yuitest_coverline("build/loader-base/loader-base.js", 2023);-m.configFn = found.configFn;- _yuitest_coverline("build/loader-base/loader-base.js", 2024);-m.configFn(m);- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2028);-return m;- },-- // impl in rollup submodule- _rollup: function() { },-- /**- * Remove superceded modules and loaded modules. Called by- * calculate() after we have the mega list of all dependencies- * @method _reduce- * @return {object} the reduced dependency hash.- * @private- */- _reduce: function(r) {-- _yuitest_coverfunc("build/loader-base/loader-base.js", "_reduce", 2041);-_yuitest_coverline("build/loader-base/loader-base.js", 2043);-r = r || this.required;-- _yuitest_coverline("build/loader-base/loader-base.js", 2045);-var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;-- _yuitest_coverline("build/loader-base/loader-base.js", 2048);-for (i in r) {- _yuitest_coverline("build/loader-base/loader-base.js", 2049);-if (r.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2050);-m = this.getModule(i);- // remove if already loaded- _yuitest_coverline("build/loader-base/loader-base.js", 2052);-if (((this.loaded[i] || ON_PAGE[i]) &&- !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2055);-delete r[i];- }- _yuitest_coverline("build/loader-base/loader-base.js", 2057);-if (ignore && ignore[i]) {- _yuitest_coverline("build/loader-base/loader-base.js", 2058);-delete r[i];- }- // remove anything this module supersedes- _yuitest_coverline("build/loader-base/loader-base.js", 2061);-s = m && m.supersedes;- _yuitest_coverline("build/loader-base/loader-base.js", 2062);-if (s) {- _yuitest_coverline("build/loader-base/loader-base.js", 2063);-for (j = 0; j < s.length; j++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2064);-if (s[j] in r) {- _yuitest_coverline("build/loader-base/loader-base.js", 2065);-delete r[s[j]];- }- }- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2072);-return r;- },- /**- * Handles the queue when a module has been loaded for all cases- * @method _finish- * @private- * @param {String} msg The message from Loader- * @param {Boolean} success A boolean denoting success or failure- */- _finish: function(msg, success) {-- _yuitest_coverfunc("build/loader-base/loader-base.js", "_finish", 2081);-_yuitest_coverline("build/loader-base/loader-base.js", 2083);-_queue.running = false;-- _yuitest_coverline("build/loader-base/loader-base.js", 2085);-var onEnd = this.onEnd;- _yuitest_coverline("build/loader-base/loader-base.js", 2086);-if (onEnd) {- _yuitest_coverline("build/loader-base/loader-base.js", 2087);-onEnd.call(this.context, {- msg: msg,- data: this.data,- success: success- });- }- _yuitest_coverline("build/loader-base/loader-base.js", 2093);-this._continue();- },- /**- * The default Loader onSuccess handler, calls this.onSuccess with a payload- * @method _onSuccess- * @private- */- _onSuccess: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_onSuccess", 2100);-_yuitest_coverline("build/loader-base/loader-base.js", 2101);-var self = this, skipped = Y.merge(self.skipped), fn,- failed = [], rreg = self.requireRegistration,- success, msg, i, mod;- - _yuitest_coverline("build/loader-base/loader-base.js", 2105);-for (i in skipped) {- _yuitest_coverline("build/loader-base/loader-base.js", 2106);-if (skipped.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2107);-delete self.inserted[i];- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2111);-self.skipped = {};- - _yuitest_coverline("build/loader-base/loader-base.js", 2113);-for (i in self.inserted) {- _yuitest_coverline("build/loader-base/loader-base.js", 2114);-if (self.inserted.hasOwnProperty(i)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2115);-mod = self.getModule(i);- _yuitest_coverline("build/loader-base/loader-base.js", 2116);-if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2117);-failed.push(i);- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 2119);-Y.mix(self.loaded, self.getProvides(i));- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2124);-fn = self.onSuccess;- _yuitest_coverline("build/loader-base/loader-base.js", 2125);-msg = (failed.length) ? 'notregistered' : 'success';- _yuitest_coverline("build/loader-base/loader-base.js", 2126);-success = !(failed.length);- _yuitest_coverline("build/loader-base/loader-base.js", 2127);-if (fn) {- _yuitest_coverline("build/loader-base/loader-base.js", 2128);-fn.call(self.context, {- msg: msg,- data: self.data,- success: success,- failed: failed,- skipped: skipped- });- }- _yuitest_coverline("build/loader-base/loader-base.js", 2136);-self._finish(msg, success);- },- /**- * The default Loader onProgress handler, calls this.onProgress with a payload- * @method _onProgress- * @private- */- _onProgress: function(e) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_onProgress", 2143);-_yuitest_coverline("build/loader-base/loader-base.js", 2144);-var self = this, i;- //set the internal cache to what just came in.- _yuitest_coverline("build/loader-base/loader-base.js", 2146);-if (e.data && e.data.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2147);-for (i = 0; i < e.data.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2148);-e.data[i] = self.getModule(e.data[i].name);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2151);-if (self.onProgress) {- _yuitest_coverline("build/loader-base/loader-base.js", 2152);-self.onProgress.call(self.context, {- name: e.url,- data: e.data- });- }- },- /**- * The default Loader onFailure handler, calls this.onFailure with a payload- * @method _onFailure- * @private- */- _onFailure: function(o) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_onFailure", 2163);-_yuitest_coverline("build/loader-base/loader-base.js", 2164);-var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- - _yuitest_coverline("build/loader-base/loader-base.js", 2166);-for (i; i < len; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2167);-msg.push(o.errors[i].error);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2170);-msg = msg.join(',');-- - _yuitest_coverline("build/loader-base/loader-base.js", 2173);-if (f) {- _yuitest_coverline("build/loader-base/loader-base.js", 2174);-f.call(this.context, {- msg: msg,- data: this.data,- success: false- });- }- - _yuitest_coverline("build/loader-base/loader-base.js", 2181);-this._finish(msg, false);-- },-- /**- * The default Loader onTimeout handler, calls this.onTimeout with a payload- * @method _onTimeout- * @private- */- _onTimeout: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_onTimeout", 2190);-_yuitest_coverline("build/loader-base/loader-base.js", 2191);-var f = this.onTimeout;- _yuitest_coverline("build/loader-base/loader-base.js", 2192);-if (f) {- _yuitest_coverline("build/loader-base/loader-base.js", 2193);-f.call(this.context, {- msg: 'timeout',- data: this.data,- success: false- });- }- },-- /**- * Sorts the dependency tree. The last step of calculate()- * @method _sort- * @private- */- _sort: function() {-- // create an indexed list- _yuitest_coverfunc("build/loader-base/loader-base.js", "_sort", 2206);-_yuitest_coverline("build/loader-base/loader-base.js", 2209);-var s = YObject.keys(this.required),- // loaded = this.loaded,- //TODO Move this out of scope- done = {},- p = 0, l, a, b, j, k, moved, doneKey;-- // keep going until we make a pass without moving anything- _yuitest_coverline("build/loader-base/loader-base.js", 2216);-for (;;) {-- _yuitest_coverline("build/loader-base/loader-base.js", 2218);-l = s.length;- _yuitest_coverline("build/loader-base/loader-base.js", 2219);-moved = false;-- // start the loop after items that are already sorted- _yuitest_coverline("build/loader-base/loader-base.js", 2222);-for (j = p; j < l; j++) {-- // check the next module on the list to see if its- // dependencies have been met- _yuitest_coverline("build/loader-base/loader-base.js", 2226);-a = s[j];-- // check everything below current item and move if we- // find a requirement for the current item- _yuitest_coverline("build/loader-base/loader-base.js", 2230);-for (k = j + 1; k < l; k++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2231);-doneKey = a + s[k];-- _yuitest_coverline("build/loader-base/loader-base.js", 2233);-if (!done[doneKey] && this._requires(a, s[k])) {-- // extract the dependency so we can move it up- _yuitest_coverline("build/loader-base/loader-base.js", 2236);-b = s.splice(k, 1);-- // insert the dependency above the item that- // requires it- _yuitest_coverline("build/loader-base/loader-base.js", 2240);-s.splice(j, 0, b[0]);-- // only swap two dependencies once to short circut- // circular dependencies- _yuitest_coverline("build/loader-base/loader-base.js", 2244);-done[doneKey] = true;-- // keep working- _yuitest_coverline("build/loader-base/loader-base.js", 2247);-moved = true;-- _yuitest_coverline("build/loader-base/loader-base.js", 2249);-break;- }- }-- // jump out of loop if we moved something- _yuitest_coverline("build/loader-base/loader-base.js", 2254);-if (moved) {- _yuitest_coverline("build/loader-base/loader-base.js", 2255);-break;- // this item is sorted, move our pointer and keep going- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 2258);-p++;- }- }-- // when we make it here and moved is false, we are- // finished sorting- _yuitest_coverline("build/loader-base/loader-base.js", 2264);-if (!moved) {- _yuitest_coverline("build/loader-base/loader-base.js", 2265);-break;- }-- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2270);-this.sorted = s;- },-- /**- * Handles the actual insertion of script/link tags- * @method _insert- * @private- * @param {Object} source The YUI instance the request came from- * @param {Object} o The metadata to include- * @param {String} type JS or CSS- * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta- */- _insert: function(source, o, type, skipcalc) {--- // restore the state at the time of the request- _yuitest_coverfunc("build/loader-base/loader-base.js", "_insert", 2282);-_yuitest_coverline("build/loader-base/loader-base.js", 2286);-if (source) {- _yuitest_coverline("build/loader-base/loader-base.js", 2287);-this._config(source);- }-- // build the dependency list- // don't include type so we can process CSS and script in- // one pass when the type is not specified.- _yuitest_coverline("build/loader-base/loader-base.js", 2293);-if (!skipcalc) {- //this.calculate(o);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2297);-var modules = this.resolve(!skipcalc),- self = this, comp = 0, actions = 0,- mods = {}, deps;-- _yuitest_coverline("build/loader-base/loader-base.js", 2301);-self._refetch = [];-- _yuitest_coverline("build/loader-base/loader-base.js", 2303);-if (type) {- //Filter out the opposite type and reset the array so the checks later work- _yuitest_coverline("build/loader-base/loader-base.js", 2305);-modules[((type === JS) ? CSS : JS)] = [];- }- _yuitest_coverline("build/loader-base/loader-base.js", 2307);-if (!self.fetchCSS) {- _yuitest_coverline("build/loader-base/loader-base.js", 2308);-modules.css = [];- }- _yuitest_coverline("build/loader-base/loader-base.js", 2310);-if (modules.js.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2311);-comp++;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2313);-if (modules.css.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2314);-comp++;- }-- //console.log('Resolved Modules: ', modules);-- _yuitest_coverline("build/loader-base/loader-base.js", 2319);-var complete = function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "complete", 2319);-_yuitest_coverline("build/loader-base/loader-base.js", 2320);-actions++;- _yuitest_coverline("build/loader-base/loader-base.js", 2321);-var errs = {}, i = 0, o = 0, u = '', fn,- modName, resMods;-- _yuitest_coverline("build/loader-base/loader-base.js", 2324);-if (d && d.errors) {- _yuitest_coverline("build/loader-base/loader-base.js", 2325);-for (i = 0; i < d.errors.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2326);-if (d.errors[i].request) {- _yuitest_coverline("build/loader-base/loader-base.js", 2327);-u = d.errors[i].request.url;- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 2329);-u = d.errors[i];- }- _yuitest_coverline("build/loader-base/loader-base.js", 2331);-errs[u] = u;- }- }- - _yuitest_coverline("build/loader-base/loader-base.js", 2335);-if (d && d.data && d.data.length && (d.type === 'success')) {- _yuitest_coverline("build/loader-base/loader-base.js", 2336);-for (i = 0; i < d.data.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2337);-self.inserted[d.data[i].name] = true;- //If the external module has a skin or a lang, reprocess it- _yuitest_coverline("build/loader-base/loader-base.js", 2339);-if (d.data[i].lang || d.data[i].skinnable) {- _yuitest_coverline("build/loader-base/loader-base.js", 2340);-delete self.inserted[d.data[i].name];- _yuitest_coverline("build/loader-base/loader-base.js", 2341);-self._refetch.push(d.data[i].name);- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2346);-if (actions === comp) {- _yuitest_coverline("build/loader-base/loader-base.js", 2347);-self._loading = null;- _yuitest_coverline("build/loader-base/loader-base.js", 2348);-if (self._refetch.length) {- //Get the deps for the new meta-data and reprocess- _yuitest_coverline("build/loader-base/loader-base.js", 2350);-for (i = 0; i < self._refetch.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2351);-deps = self.getRequires(self.getModule(self._refetch[i]));- _yuitest_coverline("build/loader-base/loader-base.js", 2352);-for (o = 0; o < deps.length; o++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2353);-if (!self.inserted[deps[o]]) {- //We wouldn't be to this point without the module being here- _yuitest_coverline("build/loader-base/loader-base.js", 2355);-mods[deps[o]] = deps[o];- }- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2359);-mods = Y.Object.keys(mods);- _yuitest_coverline("build/loader-base/loader-base.js", 2360);-if (mods.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2361);-self.require(mods);- _yuitest_coverline("build/loader-base/loader-base.js", 2362);-resMods = self.resolve(true);- _yuitest_coverline("build/loader-base/loader-base.js", 2363);-if (resMods.cssMods.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2364);-for (i=0; i < resMods.cssMods.length; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2365);-modName = resMods.cssMods[i].name;- _yuitest_coverline("build/loader-base/loader-base.js", 2366);-delete YUI.Env._cssLoaded[modName];- _yuitest_coverline("build/loader-base/loader-base.js", 2367);-if (self.isCSSLoaded(modName)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2368);-self.inserted[modName] = true;- _yuitest_coverline("build/loader-base/loader-base.js", 2369);-delete self.required[modName];- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2372);-self.sorted = [];- _yuitest_coverline("build/loader-base/loader-base.js", 2373);-self._sort();- }- _yuitest_coverline("build/loader-base/loader-base.js", 2375);-d = null; //bail- _yuitest_coverline("build/loader-base/loader-base.js", 2376);-self._insert(); //insert the new deps- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2379);-if (d && d.fn) {- _yuitest_coverline("build/loader-base/loader-base.js", 2380);-fn = d.fn;- _yuitest_coverline("build/loader-base/loader-base.js", 2381);-delete d.fn;- _yuitest_coverline("build/loader-base/loader-base.js", 2382);-fn.call(self, d);- }- }- };-- _yuitest_coverline("build/loader-base/loader-base.js", 2387);-this._loading = true;-- _yuitest_coverline("build/loader-base/loader-base.js", 2389);-if (!modules.js.length && !modules.css.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2390);-actions = -1;- _yuitest_coverline("build/loader-base/loader-base.js", 2391);-complete({- fn: self._onSuccess- });- _yuitest_coverline("build/loader-base/loader-base.js", 2394);-return;- }- -- _yuitest_coverline("build/loader-base/loader-base.js", 2398);-if (modules.css.length) { //Load CSS first- _yuitest_coverline("build/loader-base/loader-base.js", 2399);-Y.Get.css(modules.css, {- data: modules.cssMods,- attributes: self.cssAttributes,- insertBefore: self.insertBefore,- charset: self.charset,- timeout: self.timeout,- context: self,- onProgress: function(e) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onProgress", 2406);-_yuitest_coverline("build/loader-base/loader-base.js", 2407);-self._onProgress.call(self, e);- },- onTimeout: function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onTimeout", 2409);-_yuitest_coverline("build/loader-base/loader-base.js", 2410);-self._onTimeout.call(self, d);- },- onSuccess: function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onSuccess", 2412);-_yuitest_coverline("build/loader-base/loader-base.js", 2413);-d.type = 'success';- _yuitest_coverline("build/loader-base/loader-base.js", 2414);-d.fn = self._onSuccess;- _yuitest_coverline("build/loader-base/loader-base.js", 2415);-complete.call(self, d);- },- onFailure: function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onFailure", 2417);-_yuitest_coverline("build/loader-base/loader-base.js", 2418);-d.type = 'failure';- _yuitest_coverline("build/loader-base/loader-base.js", 2419);-d.fn = self._onFailure;- _yuitest_coverline("build/loader-base/loader-base.js", 2420);-complete.call(self, d);- }- });- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2425);-if (modules.js.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2426);-Y.Get.js(modules.js, {- data: modules.jsMods,- insertBefore: self.insertBefore,- attributes: self.jsAttributes,- charset: self.charset,- timeout: self.timeout,- autopurge: false,- context: self,- async: self.async,- onProgress: function(e) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onProgress", 2435);-_yuitest_coverline("build/loader-base/loader-base.js", 2436);-self._onProgress.call(self, e);- },- onTimeout: function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onTimeout", 2438);-_yuitest_coverline("build/loader-base/loader-base.js", 2439);-self._onTimeout.call(self, d);- },- onSuccess: function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onSuccess", 2441);-_yuitest_coverline("build/loader-base/loader-base.js", 2442);-d.type = 'success';- _yuitest_coverline("build/loader-base/loader-base.js", 2443);-d.fn = self._onSuccess;- _yuitest_coverline("build/loader-base/loader-base.js", 2444);-complete.call(self, d);- },- onFailure: function(d) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onFailure", 2446);-_yuitest_coverline("build/loader-base/loader-base.js", 2447);-d.type = 'failure';- _yuitest_coverline("build/loader-base/loader-base.js", 2448);-d.fn = self._onFailure;- _yuitest_coverline("build/loader-base/loader-base.js", 2449);-complete.call(self, d);- }- });- }- },- /**- * Once a loader operation is completely finished, process any additional queued items.- * @method _continue- * @private- */- _continue: function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_continue", 2459);-_yuitest_coverline("build/loader-base/loader-base.js", 2460);-if (!(_queue.running) && _queue.size() > 0) {- _yuitest_coverline("build/loader-base/loader-base.js", 2461);-_queue.running = true;- _yuitest_coverline("build/loader-base/loader-base.js", 2462);-_queue.next()();- }- },-- /**- * inserts the requested modules and their dependencies.- * <code>type</code> can be "js" or "css". Both script and- * css are inserted if type is not provided.- * @method insert- * @param {object} o optional options object.- * @param {string} type the type of dependency to insert.- */- insert: function(o, type, skipsort) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "insert", 2474);-_yuitest_coverline("build/loader-base/loader-base.js", 2475);-var self = this, copy = Y.merge(this);- _yuitest_coverline("build/loader-base/loader-base.js", 2476);-delete copy.require;- _yuitest_coverline("build/loader-base/loader-base.js", 2477);-delete copy.dirty;- _yuitest_coverline("build/loader-base/loader-base.js", 2478);-_queue.add(function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 6)", 2478);-_yuitest_coverline("build/loader-base/loader-base.js", 2479);-self._insert(copy, o, type, skipsort);- });- _yuitest_coverline("build/loader-base/loader-base.js", 2481);-this._continue();- },-- /**- * Executed every time a module is loaded, and if we are in a load- * cycle, we attempt to load the next script. Public so that it- * is possible to call this if using a method other than- * Y.register to determine when scripts are fully loaded- * @method loadNext- * @deprecated- * @param {string} mname optional the name of the module that has- * been loaded (which is usually why it is time to load the next- * one).- */- loadNext: function(mname) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "loadNext", 2495);-_yuitest_coverline("build/loader-base/loader-base.js", 2496);-return;- },-- /**- * Apply filter defined for this instance to a url/path- * @method _filter- * @param {string} u the string to filter.- * @param {string} name the name of the module, if we are processing- * a single module as opposed to a combined url.- * @return {string} the filtered string.- * @private- */- _filter: function(u, name, group) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_filter", 2508);-_yuitest_coverline("build/loader-base/loader-base.js", 2509);-var f = this.filter,- hasFilter = name && (name in this.filters),- modFilter = hasFilter && this.filters[name],- groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);-- _yuitest_coverline("build/loader-base/loader-base.js", 2514);-if (groupName && this.groups[groupName] && this.groups[groupName].filter) {- _yuitest_coverline("build/loader-base/loader-base.js", 2515);-modFilter = this.groups[groupName].filter;- _yuitest_coverline("build/loader-base/loader-base.js", 2516);-hasFilter = true;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2519);-if (u) {- _yuitest_coverline("build/loader-base/loader-base.js", 2520);-if (hasFilter) {- _yuitest_coverline("build/loader-base/loader-base.js", 2521);-f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2523);-if (f) {- _yuitest_coverline("build/loader-base/loader-base.js", 2524);-u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2527);-return u;- },-- /**- * Generates the full url for a module- * @method _url- * @param {string} path the path fragment.- * @param {String} name The name of the module- * @param {String} [base=self.base] The base url to use- * @return {string} the full url.- * @private- */- _url: function(path, name, base) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "_url", 2539);-_yuitest_coverline("build/loader-base/loader-base.js", 2540);-return this._filter((base || this.base || '') + path, name);- },- /**- * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.- * @method resolve- * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else- * @param {Array} [s=loader.sorted] An override for the loader.sorted array- * @return {Object} Object hash (js and css) of two arrays of file lists- * @example This method can be used as an off-line dep calculator- *- * var Y = YUI();- * var loader = new Y.Loader({- * filter: 'debug',- * base: '../../',- * root: 'build/',- * combine: true,- * require: ['node', 'dd', 'console']- * });- * var out = loader.resolve(true);- *- */- resolve: function(calc, s) {-- _yuitest_coverfunc("build/loader-base/loader-base.js", "resolve", 2561);-_yuitest_coverline("build/loader-base/loader-base.js", 2563);-var len, i, m, url, fn, msg, attr, group, groupName, j, frag,- comboSource, comboSources, mods, comboBase,- base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],- inserted = (self.ignoreRegistered) ? {} : self.inserted,- resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';-- _yuitest_coverline("build/loader-base/loader-base.js", 2571);-if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { - _yuitest_coverline("build/loader-base/loader-base.js", 2572);-self._resetModules();- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2575);-if (calc) {- _yuitest_coverline("build/loader-base/loader-base.js", 2576);-self.calculate();- }- _yuitest_coverline("build/loader-base/loader-base.js", 2578);-s = s || self.sorted;-- _yuitest_coverline("build/loader-base/loader-base.js", 2580);-var addSingle = function(m) {- - _yuitest_coverfunc("build/loader-base/loader-base.js", "addSingle", 2580);-_yuitest_coverline("build/loader-base/loader-base.js", 2582);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 2583);-group = (m.group && self.groups[m.group]) || NOT_FOUND;- - //Always assume it's async- _yuitest_coverline("build/loader-base/loader-base.js", 2586);-if (group.async === false) {- _yuitest_coverline("build/loader-base/loader-base.js", 2587);-m.async = group.async;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2590);-url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :- self._url(m.path, s[i], group.base || m.base);- - _yuitest_coverline("build/loader-base/loader-base.js", 2593);-if (m.attributes || m.async === false) {- _yuitest_coverline("build/loader-base/loader-base.js", 2594);-url = {- url: url,- async: m.async- };- _yuitest_coverline("build/loader-base/loader-base.js", 2598);-if (m.attributes) {- _yuitest_coverline("build/loader-base/loader-base.js", 2599);-url.attributes = m.attributes;- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2602);-resolved[m.type].push(url);- _yuitest_coverline("build/loader-base/loader-base.js", 2603);-resolved[m.type + 'Mods'].push(m);- } else {- }- - };-- _yuitest_coverline("build/loader-base/loader-base.js", 2609);-len = s.length;-- // the default combo base- _yuitest_coverline("build/loader-base/loader-base.js", 2612);-comboBase = self.comboBase;-- _yuitest_coverline("build/loader-base/loader-base.js", 2614);-url = comboBase;-- _yuitest_coverline("build/loader-base/loader-base.js", 2616);-comboSources = {};-- _yuitest_coverline("build/loader-base/loader-base.js", 2618);-for (i = 0; i < len; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2619);-comboSource = comboBase;- _yuitest_coverline("build/loader-base/loader-base.js", 2620);-m = self.getModule(s[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 2621);-groupName = m && m.group;- _yuitest_coverline("build/loader-base/loader-base.js", 2622);-group = self.groups[groupName];- _yuitest_coverline("build/loader-base/loader-base.js", 2623);-if (groupName && group) {-- _yuitest_coverline("build/loader-base/loader-base.js", 2625);-if (!group.combine || m.fullpath) {- //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 2628);-addSingle(m);- _yuitest_coverline("build/loader-base/loader-base.js", 2629);-continue;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2631);-m.combine = true;- _yuitest_coverline("build/loader-base/loader-base.js", 2632);-if (group.comboBase) {- _yuitest_coverline("build/loader-base/loader-base.js", 2633);-comboSource = group.comboBase;- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2636);-if ("root" in group && L.isValue(group.root)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2637);-m.root = group.root;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2639);-m.comboSep = group.comboSep || self.comboSep;- _yuitest_coverline("build/loader-base/loader-base.js", 2640);-m.maxURLLength = group.maxURLLength || self.maxURLLength;- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 2642);-if (!self.combine) {- //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]);- _yuitest_coverline("build/loader-base/loader-base.js", 2645);-addSingle(m);- _yuitest_coverline("build/loader-base/loader-base.js", 2646);-continue;- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2650);-comboSources[comboSource] = comboSources[comboSource] || [];- _yuitest_coverline("build/loader-base/loader-base.js", 2651);-comboSources[comboSource].push(m);- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2654);-for (j in comboSources) {- _yuitest_coverline("build/loader-base/loader-base.js", 2655);-if (comboSources.hasOwnProperty(j)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2656);-resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };- _yuitest_coverline("build/loader-base/loader-base.js", 2657);-url = j;- _yuitest_coverline("build/loader-base/loader-base.js", 2658);-mods = comboSources[j];- _yuitest_coverline("build/loader-base/loader-base.js", 2659);-len = mods.length;- - _yuitest_coverline("build/loader-base/loader-base.js", 2661);-if (len) {- _yuitest_coverline("build/loader-base/loader-base.js", 2662);-for (i = 0; i < len; i++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2663);-if (inserted[mods[i]]) {- _yuitest_coverline("build/loader-base/loader-base.js", 2664);-continue;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2666);-m = mods[i];- // Do not try to combine non-yui JS unless combo def- // is found- _yuitest_coverline("build/loader-base/loader-base.js", 2669);-if (m && (m.combine || !m.ext)) {- _yuitest_coverline("build/loader-base/loader-base.js", 2670);-resCombos[j].comboSep = m.comboSep;- _yuitest_coverline("build/loader-base/loader-base.js", 2671);-resCombos[j].group = m.group;- _yuitest_coverline("build/loader-base/loader-base.js", 2672);-resCombos[j].maxURLLength = m.maxURLLength;- _yuitest_coverline("build/loader-base/loader-base.js", 2673);-frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);- _yuitest_coverline("build/loader-base/loader-base.js", 2674);-frag = self._filter(frag, m.name);- _yuitest_coverline("build/loader-base/loader-base.js", 2675);-resCombos[j][m.type].push(frag);- _yuitest_coverline("build/loader-base/loader-base.js", 2676);-resCombos[j][m.type + 'Mods'].push(m);- } else {- //Add them to the next process..- _yuitest_coverline("build/loader-base/loader-base.js", 2679);-if (mods[i]) {- //singles.push(mods[i].name);- _yuitest_coverline("build/loader-base/loader-base.js", 2681);-addSingle(mods[i]);- }- }-- }- }- }- }--- _yuitest_coverline("build/loader-base/loader-base.js", 2691);-for (j in resCombos) {- _yuitest_coverline("build/loader-base/loader-base.js", 2692);-base = j;- _yuitest_coverline("build/loader-base/loader-base.js", 2693);-comboSep = resCombos[base].comboSep || self.comboSep;- _yuitest_coverline("build/loader-base/loader-base.js", 2694);-maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;- _yuitest_coverline("build/loader-base/loader-base.js", 2695);-for (type in resCombos[base]) {- _yuitest_coverline("build/loader-base/loader-base.js", 2696);-if (type === JS || type === CSS) {- _yuitest_coverline("build/loader-base/loader-base.js", 2697);-urls = resCombos[base][type];- _yuitest_coverline("build/loader-base/loader-base.js", 2698);-mods = resCombos[base][type + 'Mods'];- _yuitest_coverline("build/loader-base/loader-base.js", 2699);-len = urls.length;- _yuitest_coverline("build/loader-base/loader-base.js", 2700);-tmpBase = base + urls.join(comboSep);- _yuitest_coverline("build/loader-base/loader-base.js", 2701);-baseLen = tmpBase.length;- _yuitest_coverline("build/loader-base/loader-base.js", 2702);-if (maxURLLength <= base.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2703);-maxURLLength = MAX_URL_LENGTH;- }- - _yuitest_coverline("build/loader-base/loader-base.js", 2706);-if (len) {- _yuitest_coverline("build/loader-base/loader-base.js", 2707);-if (baseLen > maxURLLength) {- _yuitest_coverline("build/loader-base/loader-base.js", 2708);-u = [];- _yuitest_coverline("build/loader-base/loader-base.js", 2709);-for (s = 0; s < len; s++) {- _yuitest_coverline("build/loader-base/loader-base.js", 2710);-u.push(urls[s]);- _yuitest_coverline("build/loader-base/loader-base.js", 2711);-tmpBase = base + u.join(comboSep);-- _yuitest_coverline("build/loader-base/loader-base.js", 2713);-if (tmpBase.length > maxURLLength) {- _yuitest_coverline("build/loader-base/loader-base.js", 2714);-m = u.pop();- _yuitest_coverline("build/loader-base/loader-base.js", 2715);-tmpBase = base + u.join(comboSep);- _yuitest_coverline("build/loader-base/loader-base.js", 2716);-resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));- _yuitest_coverline("build/loader-base/loader-base.js", 2717);-u = [];- _yuitest_coverline("build/loader-base/loader-base.js", 2718);-if (m) {- _yuitest_coverline("build/loader-base/loader-base.js", 2719);-u.push(m);- }- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2723);-if (u.length) {- _yuitest_coverline("build/loader-base/loader-base.js", 2724);-tmpBase = base + u.join(comboSep);- _yuitest_coverline("build/loader-base/loader-base.js", 2725);-resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));- }- } else {- _yuitest_coverline("build/loader-base/loader-base.js", 2728);-resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));- }- }- _yuitest_coverline("build/loader-base/loader-base.js", 2731);-resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);- }- }- }-- _yuitest_coverline("build/loader-base/loader-base.js", 2736);-resCombos = null;-- _yuitest_coverline("build/loader-base/loader-base.js", 2738);-return resolved;- },- /**- Shortcut to calculate, resolve and load all modules.-- var loader = new Y.Loader({- ignoreRegistered: true,- modules: {- mod: {- path: 'mod.js'- }- },- requires: [ 'mod' ]- });- loader.load(function() {- console.log('All modules have loaded..');- });--- @method load- @param {Callback} cb Executed after all load operations are complete- */- load: function(cb) {- _yuitest_coverfunc("build/loader-base/loader-base.js", "load", 2760);-_yuitest_coverline("build/loader-base/loader-base.js", 2761);-if (!cb) {- _yuitest_coverline("build/loader-base/loader-base.js", 2762);-return;- }- _yuitest_coverline("build/loader-base/loader-base.js", 2764);-var self = this,- out = self.resolve(true);- - _yuitest_coverline("build/loader-base/loader-base.js", 2767);-self.data = out;-- _yuitest_coverline("build/loader-base/loader-base.js", 2769);-self.onEnd = function() {- _yuitest_coverfunc("build/loader-base/loader-base.js", "onEnd", 2769);-_yuitest_coverline("build/loader-base/loader-base.js", 2770);-cb.apply(self.context || self, arguments);- };-- _yuitest_coverline("build/loader-base/loader-base.js", 2773);-self.insert();- }-};----}, '3.7.2', {"requires": ["get", "features"]});+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/loader-base/loader-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/loader-base/loader-base.js",+ code: []+};+_yuitest_coverage["build/loader-base/loader-base.js"].code=["YUI.add('loader-base', function (Y, NAME) {","","/**"," * The YUI loader core"," * @module loader"," * @submodule loader-base"," */","","if (!YUI.Env[Y.version]) {",""," (function() {"," var VERSION = Y.version,"," BUILD = '/build/',"," ROOT = VERSION + BUILD,"," CDN_BASE = Y.Env.base,"," GALLERY_VERSION = 'gallery-2012.10.10-19-59',"," TNT = '2in3',"," TNT_VERSION = '4',"," YUI2_VERSION = '2.9.0',"," COMBO_BASE = CDN_BASE + 'combo?',"," META = { version: VERSION,"," root: ROOT,"," base: Y.Env.base,"," comboBase: COMBO_BASE,"," skin: { defaultSkin: 'sam',"," base: 'assets/skins/',"," path: 'skin.css',"," after: ['cssreset',"," 'cssfonts',"," 'cssgrids',"," 'cssbase',"," 'cssreset-context',"," 'cssfonts-context']},"," groups: {},"," patterns: {} },"," groups = META.groups,"," yui2Update = function(tnt, yui2, config) {",""," var root = TNT + '.' +"," (tnt || TNT_VERSION) + '/' +"," (yui2 || YUI2_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.yui2.base = base + root;"," groups.yui2.root = root;"," groups.yui2.comboBase = combo;"," },"," galleryUpdate = function(tag, config) {"," var root = (tag || GALLERY_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.gallery.base = base + root;"," groups.gallery.root = root;"," groups.gallery.comboBase = combo;"," };","",""," groups[VERSION] = {};",""," groups.gallery = {"," ext: false,"," combine: true,"," comboBase: COMBO_BASE,"," update: galleryUpdate,"," patterns: { 'gallery-': { },"," 'lang/gallery-': {},"," 'gallerycss-': { type: 'css' } }"," };",""," groups.yui2 = {"," combine: true,"," ext: false,"," comboBase: COMBO_BASE,"," update: yui2Update,"," patterns: {"," 'yui2-': {"," configFn: function(me) {"," if (/-skin|reset|fonts|grids|base/.test(me.name)) {"," me.type = 'css';"," me.path = me.path.replace(/\\.js/, '.css');"," // this makes skins in builds earlier than"," // 2.6.0 work as long as combine is false"," me.path = me.path.replace(/\\/yui2-skin/,"," '/assets/skins/sam/yui2-skin');"," }"," }"," }"," }"," };",""," galleryUpdate();"," yui2Update();",""," YUI.Env[VERSION] = META;"," }());","}","","","/*jslint forin: true, maxlen: 350 */","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * information for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can also load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files."," *"," * @module loader"," * @main loader"," * @submodule loader-base"," */","","var NOT_FOUND = {},"," NO_REQUIREMENTS = [],"," MAX_URL_LENGTH = 1024,"," GLOBAL_ENV = YUI.Env,"," GLOBAL_LOADED = GLOBAL_ENV._loaded,"," CSS = 'css',"," JS = 'js',"," INTL = 'intl',"," DEFAULT_SKIN = 'sam',"," VERSION = Y.version,"," ROOT_LANG = '',"," YObject = Y.Object,"," oeach = YObject.each,"," yArray = Y.Array,"," _queue = GLOBAL_ENV._loaderQueue,"," META = GLOBAL_ENV[VERSION],"," SKIN_PREFIX = 'skin-',"," L = Y.Lang,"," ON_PAGE = GLOBAL_ENV.mods,"," modulekey,"," _path = function(dir, file, type, nomin) {"," var path = dir + '/' + file;"," if (!nomin) {"," path += '-min';"," }"," path += '.' + (type || CSS);",""," return path;"," };","",""," if (!YUI.Env._cssLoaded) {"," YUI.Env._cssLoaded = {};"," }","","","/**"," * The component metadata is stored in Y.Env.meta."," * Part of the loader module."," * @property meta"," * @for YUI"," */","Y.Env.meta = META;","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * info for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files. You can also specify an external, custom combo service to host"," * your modules as well.",""," var Y = YUI();"," var loader = new Y.Loader({"," filter: 'debug',"," base: '../../',"," root: 'build/',"," combine: true,"," require: ['node', 'dd', 'console']"," });"," var out = loader.resolve(true);",""," * @constructor"," * @class Loader"," * @param {Object} config an optional set of configuration options."," * @param {String} config.base The base dir which to fetch this module from"," * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`"," * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`"," * @param {String|Object} config.filter A filter to apply to result urls. <a href=\"#property_filter\">See filter property</a>"," * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config."," * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies"," * @param {Boolean} [config.async=true] Fetch files in async"," * @param {Array} config.ignore: A list of modules that should never be dynamically loaded"," * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page"," * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes"," * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes"," * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes"," * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout"," * @param {Object} config.context Execution context for all callbacks"," * @param {Function} config.onSuccess Callback for the 'success' event"," * @param {Function} config.onFailure Callback for the 'failure' event"," * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading."," * @param {Function} config.onTimeout Callback for the 'timeout' event"," * @param {Function} config.onProgress Callback executed each time a script or css file is loaded"," * @param {Object} config.modules A list of module definitions. See <a href=\"#method_addModule\">Loader.addModule</a> for the supported module metadata"," * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`."," * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox."," * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward."," */","Y.Loader = function(o) {",""," var self = this;",""," //Catch no config passed."," o = o || {};",""," modulekey = META.md5;",""," /**"," * Internal callback to handle multiple internal insert() calls"," * so that css is inserted prior to js"," * @property _internalCallback"," * @private"," */"," // self._internalCallback = null;",""," /**"," * Callback that will be executed when the loader is finished"," * with an insert"," * @method onSuccess"," * @type function"," */"," // self.onSuccess = null;",""," /**"," * Callback that will be executed if there is a failure"," * @method onFailure"," * @type function"," */"," // self.onFailure = null;",""," /**"," * Callback for the 'CSSComplete' event. When loading YUI components"," * with CSS the CSS is loaded first, then the script. This provides"," * a moment you can tie into to improve the presentation of the page"," * while the script is loading."," * @method onCSS"," * @type function"," */"," // self.onCSS = null;",""," /**"," * Callback executed each time a script or css file is loaded"," * @method onProgress"," * @type function"," */"," // self.onProgress = null;",""," /**"," * Callback that will be executed if a timeout occurs"," * @method onTimeout"," * @type function"," */"," // self.onTimeout = null;",""," /**"," * The execution context for all callbacks"," * @property context"," * @default {YUI} the YUI instance"," */"," self.context = Y;",""," /**"," * Data that is passed to all callbacks"," * @property data"," */"," // self.data = null;",""," /**"," * Node reference or id where new nodes should be inserted before"," * @property insertBefore"," * @type string|HTMLElement"," */"," // self.insertBefore = null;",""," /**"," * The charset attribute for inserted nodes"," * @property charset"," * @type string"," * @deprecated , use cssAttributes or jsAttributes."," */"," // self.charset = null;",""," /**"," * An object literal containing attributes to add to link nodes"," * @property cssAttributes"," * @type object"," */"," // self.cssAttributes = null;",""," /**"," * An object literal containing attributes to add to script nodes"," * @property jsAttributes"," * @type object"," */"," // self.jsAttributes = null;",""," /**"," * The base directory."," * @property base"," * @type string"," * @default http://yui.yahooapis.com/[YUI VERSION]/build/"," */"," self.base = Y.Env.meta.base + Y.Env.meta.root;",""," /**"," * Base path for the combo service"," * @property comboBase"," * @type string"," * @default http://yui.yahooapis.com/combo?"," */"," self.comboBase = Y.Env.meta.comboBase;",""," /*"," * Base path for language packs."," */"," // self.langBase = Y.Env.meta.langBase;"," // self.lang = \"\";",""," /**"," * If configured, the loader will attempt to use the combo"," * service for YUI resources and configured external resources."," * @property combine"," * @type boolean"," * @default true if a base dir isn't in the config"," */"," self.combine = o.base &&"," (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);",""," /**"," * The default seperator to use between files in a combo URL"," * @property comboSep"," * @type {String}"," * @default Ampersand"," */"," self.comboSep = '&';"," /**"," * Max url length for combo urls. The default is 1024. This is the URL"," * limit for the Yahoo! hosted combo servers. If consuming"," * a different combo service that has a different URL limit"," * it is possible to override this default by supplying"," * the maxURLLength config option. The config option will"," * only take effect if lower than the default."," *"," * @property maxURLLength"," * @type int"," */"," self.maxURLLength = MAX_URL_LENGTH;",""," /**"," * Ignore modules registered on the YUI global"," * @property ignoreRegistered"," * @default false"," */"," self.ignoreRegistered = o.ignoreRegistered;",""," /**"," * Root path to prepend to module path for the combo"," * service"," * @property root"," * @type string"," * @default [YUI VERSION]/build/"," */"," self.root = Y.Env.meta.root;",""," /**"," * Timeout value in milliseconds. If set, self value will be used by"," * the get utility. the timeout event will fire if"," * a timeout occurs."," * @property timeout"," * @type int"," */"," self.timeout = 0;",""," /**"," * A list of modules that should not be loaded, even if"," * they turn up in the dependency tree"," * @property ignore"," * @type string[]"," */"," // self.ignore = null;",""," /**"," * A list of modules that should always be loaded, even"," * if they have already been inserted into the page."," * @property force"," * @type string[]"," */"," // self.force = null;",""," self.forceMap = {};",""," /**"," * Should we allow rollups"," * @property allowRollup"," * @type boolean"," * @default false"," */"," self.allowRollup = false;",""," /**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js)."," * </dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * @property filter"," * @type string| {searchExp: string, replaceStr: string}"," */"," // self.filter = null;",""," /**"," * per-component filter specification. If specified for a given"," * component, this overrides the filter config."," * @property filters"," * @type object"," */"," self.filters = {};",""," /**"," * The list of requested modules"," * @property required"," * @type {string: boolean}"," */"," self.required = {};",""," /**"," * If a module name is predefined when requested, it is checked againsts"," * the patterns provided in this property. If there is a match, the"," * module is added with the default configuration."," *"," * At the moment only supporting module prefixes, but anticipate"," * supporting at least regular expressions."," * @property patterns"," * @type Object"," */"," // self.patterns = Y.merge(Y.Env.meta.patterns);"," self.patterns = {};",""," /**"," * The library metadata"," * @property moduleInfo"," */"," // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);"," self.moduleInfo = {};",""," self.groups = Y.merge(Y.Env.meta.groups);",""," /**"," * Provides the information used to skin the skinnable components."," * The following skin definition would result in 'skin1' and 'skin2'"," * being loaded for calendar (if calendar was requested), and"," * 'sam' for all other skinnable components:"," *"," * skin: {"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin. ex:"," * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/"," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * calendar: ['skin1', 'skin2']"," * }"," * }"," * @property skin"," * @type {Object}"," */"," self.skin = Y.merge(Y.Env.meta.skin);",""," /*"," * Map of conditional modules"," * @since 3.2.0"," */"," self.conditions = {};",""," // map of modules with a hash of modules that meet the requirement"," // self.provides = {};",""," self.config = o;"," self._internal = true;",""," self._populateCache();",""," /**"," * Set when beginning to compute the dependency tree."," * Composed of what YUI reports to be loaded combined"," * with what has been loaded by any instance on the page"," * with the version number specified in the metadata."," * @property loaded"," * @type {string: boolean}"," */"," self.loaded = GLOBAL_LOADED[VERSION];","",""," /**"," * Should Loader fetch scripts in `async`, defaults to `true`"," * @property async"," */",""," self.async = true;",""," self._inspectPage();",""," self._internal = false;",""," self._config(o);",""," self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};",""," self.testresults = null;",""," if (Y.config.tests) {"," self.testresults = Y.config.tests;"," }",""," /**"," * List of rollup files found in the library metadata"," * @property rollups"," */"," // self.rollups = null;",""," /**"," * Whether or not to load optional dependencies for"," * the requested modules"," * @property loadOptional"," * @type boolean"," * @default false"," */"," // self.loadOptional = false;",""," /**"," * All of the derived dependencies in sorted order, which"," * will be populated when either calculate() or insert()"," * is called"," * @property sorted"," * @type string[]"," */"," self.sorted = [];",""," /*"," * A list of modules to attach to the YUI instance when complete."," * If not supplied, the sorted list of dependencies are applied."," * @property attaching"," */"," // self.attaching = null;",""," /**"," * Flag to indicate the dependency tree needs to be recomputed"," * if insert is called again."," * @property dirty"," * @type boolean"," * @default true"," */"," self.dirty = true;",""," /**"," * List of modules inserted by the utility"," * @property inserted"," * @type {string: boolean}"," */"," self.inserted = {};",""," /**"," * List of skipped modules during insert() because the module"," * was not defined"," * @property skipped"," */"," self.skipped = {};",""," // Y.on('yui:load', self.loadNext, self);",""," self.tested = {};",""," /*"," * Cached sorted calculate results"," * @property results"," * @since 3.2.0"," */"," //self.results = {};",""," if (self.ignoreRegistered) {"," //Clear inpage already processed modules."," self._resetModules();"," }","","};","","Y.Loader.prototype = {"," /**"," * Checks the cache for modules and conditions, if they do not exist"," * process the default metadata and populate the local moduleInfo hash."," * @method _populateCache"," * @private"," */"," _populateCache: function() {"," var self = this,"," defaults = META.modules,"," cache = GLOBAL_ENV._renderedMods,"," i;",""," if (cache && !self.ignoreRegistered) {"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.moduleInfo[i] = Y.merge(cache[i]);"," }"," }",""," cache = GLOBAL_ENV._conditions;"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.conditions[i] = Y.merge(cache[i]);"," }"," }",""," } else {"," for (i in defaults) {"," if (defaults.hasOwnProperty(i)) {"," self.addModule(defaults[i], i);"," }"," }"," }",""," },"," /**"," * Reset modules in the module cache to a pre-processed state so additional"," * computations with a different skin or language will work as expected."," * @method _resetModules"," * @private"," */"," _resetModules: function() {"," var self = this, i, o,"," mod, name, details;"," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," mod = self.moduleInfo[i];"," name = mod.name;"," details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);",""," if (details) {"," self.moduleInfo[name]._reset = true;"," self.moduleInfo[name].requires = details.requires || [];"," self.moduleInfo[name].optional = details.optional || [];"," self.moduleInfo[name].supersedes = details.supercedes || [];"," }",""," if (mod.defaults) {"," for (o in mod.defaults) {"," if (mod.defaults.hasOwnProperty(o)) {"," if (mod[o]) {"," mod[o] = mod.defaults[o];"," }"," }"," }"," }"," delete mod.langCache;"," delete mod.skinCache;"," if (mod.skinnable) {"," self._addSkin(self.skin.defaultSkin, mod.name);"," }"," }"," }"," },"," /**"," Regex that matches a CSS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_CSS"," @type RegExp"," @final"," @protected"," @since 3.5.0"," **/"," REGEX_CSS: /\\.css(?:[?;].*)?$/i,",""," /**"," * Default filters for raw and debug"," * @property FILTER_DEFS"," * @type Object"," * @final"," * @protected"," */"," FILTER_DEFS: {"," RAW: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '.js'"," },"," DEBUG: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-debug.js'"," },"," COVERAGE: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-coverage.js'"," }"," },"," /*"," * Check the pages meta-data and cache the result."," * @method _inspectPage"," * @private"," */"," _inspectPage: function() {"," var self = this, v, m, req, mr, i;",""," //Inspect the page for CSS only modules and mark them as loaded."," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," v = self.moduleInfo[i];"," if (v.type && v.type === CSS) {"," if (self.isCSSLoaded(v.name)) {"," self.loaded[i] = true;"," }"," }"," }"," }"," for (i in ON_PAGE) {"," if (ON_PAGE.hasOwnProperty(i)) {"," v = ON_PAGE[i];"," if (v.details) {"," m = self.moduleInfo[v.name];"," req = v.details.requires;"," mr = m && m.requires;",""," if (m) {"," if (!m._inspected && req && mr.length !== req.length) {"," // console.log('deleting ' + m.name);"," delete m.expanded;"," }"," } else {"," m = self.addModule(v.details, i);"," }"," m._inspected = true;"," }"," }"," }"," },"," /*"," * returns true if b is not loaded, and is required directly or by means of modules it supersedes."," * @private"," * @method _requires"," * @param {String} mod1 The first module to compare"," * @param {String} mod2 The second module to compare"," */"," _requires: function(mod1, mod2) {",""," var i, rm, after_map, s,"," info = this.moduleInfo,"," m = info[mod1],"," other = info[mod2];",""," if (!m || !other) {"," return false;"," }",""," rm = m.expanded_map;"," after_map = m.after_map;",""," // check if this module should be sorted after the other"," // do this first to short circut circular deps"," if (after_map && (mod2 in after_map)) {"," return true;"," }",""," after_map = other.after_map;",""," // and vis-versa"," if (after_map && (mod1 in after_map)) {"," return false;"," }",""," // check if this module requires one the other supersedes"," s = info[mod2] && info[mod2].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod1, s[i])) {"," return true;"," }"," }"," }",""," s = info[mod1] && info[mod1].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod2, s[i])) {"," return false;"," }"," }"," }",""," // check if this module requires the other directly"," // if (r && yArray.indexOf(r, mod2) > -1) {"," if (rm && (mod2 in rm)) {"," return true;"," }",""," // external css files should be sorted below yui css"," if (m.ext && m.type === CSS && !other.ext && other.type === CSS) {"," return true;"," }",""," return false;"," },"," /**"," * Apply a new config to the Loader instance"," * @method _config"," * @private"," * @param {Object} o The new configuration"," */"," _config: function(o) {"," var i, j, val, a, f, group, groupName, self = this,"," mods = [], mod;"," // apply config values"," if (o) {"," for (i in o) {"," if (o.hasOwnProperty(i)) {"," val = o[i];"," //TODO This should be a case"," if (i === 'require') {"," self.require(val);"," } else if (i === 'skin') {"," //If the config.skin is a string, format to the expected object"," if (typeof val === 'string') {"," self.skin.defaultSkin = o.skin;"," val = {"," defaultSkin: val"," };"," }",""," Y.mix(self.skin, val, true);"," } else if (i === 'groups') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," groupName = j;"," group = val[j];"," self.addGroup(group, groupName);"," if (group.aliases) {"," for (a in group.aliases) {"," if (group.aliases.hasOwnProperty(a)) {"," self.addAlias(group.aliases[a], a);"," }"," }"," }"," }"," }",""," } else if (i === 'modules') {"," // add a hash of module definitions"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addModule(val[j], j);"," }"," }"," } else if (i === 'aliases') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addAlias(val[j], j);"," }"," }"," } else if (i === 'gallery') {"," this.groups.gallery.update(val, o);"," } else if (i === 'yui2' || i === '2in3') {"," this.groups.yui2.update(o['2in3'], o.yui2, o);"," } else {"," self[i] = val;"," }"," }"," }"," }",""," // fix filter"," f = self.filter;",""," if (L.isString(f)) {"," f = f.toUpperCase();"," self.filterName = f;"," self.filter = self.FILTER_DEFS[f];"," if (f === 'DEBUG') {"," self.require('yui-log', 'dump');"," }"," }",""," if (self.filterName && self.coverage) {"," if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {"," for (i = 0; i < self.coverage.length; i++) {"," mod = self.coverage[i];"," if (self.moduleInfo[mod] && self.moduleInfo[mod].use) {"," mods = [].concat(mods, self.moduleInfo[mod].use);"," } else {"," mods.push(mod);"," }"," }"," self.filters = self.filters || {};"," Y.Array.each(mods, function(mod) {"," self.filters[mod] = self.FILTER_DEFS.COVERAGE;"," });"," self.filterName = 'RAW';"," self.filter = self.FILTER_DEFS[self.filterName];"," }"," }",""," },",""," /**"," * Returns the skin module name for the specified skin name. If a"," * module name is supplied, the returned skin module name is"," * specific to the module passed in."," * @method formatSkin"," * @param {string} skin the name of the skin."," * @param {string} mod optional: the name of a module to skin."," * @return {string} the full skin module name."," */"," formatSkin: function(skin, mod) {"," var s = SKIN_PREFIX + skin;"," if (mod) {"," s = s + '-' + mod;"," }",""," return s;"," },",""," /**"," * Adds the skin def to the module info"," * @method _addSkin"," * @param {string} skin the name of the skin."," * @param {string} mod the name of the module."," * @param {string} parent parent module if this is a skin of a"," * submodule or plugin."," * @return {string} the module name for the skin."," * @private"," */"," _addSkin: function(skin, mod, parent) {"," var mdef, pkg, name, nmod,"," info = this.moduleInfo,"," sinf = this.skin,"," ext = info[mod] && info[mod].ext;",""," // Add a module definition for the module-specific skin css"," if (mod) {"," name = this.formatSkin(skin, mod);"," if (!info[name]) {"," mdef = info[mod];"," pkg = mdef.pkg || mod;"," nmod = {"," skin: true,"," name: name,"," group: mdef.group,"," type: 'css',"," after: sinf.after,"," path: (parent || pkg) + '/' + sinf.base + skin +"," '/' + mod + '.css',"," ext: ext"," };"," if (mdef.base) {"," nmod.base = mdef.base;"," }"," if (mdef.configFn) {"," nmod.configFn = mdef.configFn;"," }"," this.addModule(nmod, name);",""," }"," }",""," return name;"," },"," /**"," * Adds an alias module to the system"," * @method addAlias"," * @param {Array} use An array of modules that makes up this alias"," * @param {String} name The name of the alias"," * @example"," * var loader = new Y.Loader({});"," * loader.addAlias([ 'node', 'yql' ], 'davglass');"," * loader.require(['davglass']);"," * var out = loader.resolve(true);"," *"," * //out.js will contain Node and YQL modules"," */"," addAlias: function(use, name) {"," YUI.Env.aliases[name] = use;"," this.addModule({"," name: name,"," use: use"," });"," },"," /**"," * Add a new module group"," * @method addGroup"," * @param {Object} config An object containing the group configuration data"," * @param {String} config.name required, the group name"," * @param {String} config.base The base directory for this module group"," * @param {String} config.root The root path to add to each combo resource path"," * @param {Boolean} config.combine Should the request be combined"," * @param {String} config.comboBase Combo service base path"," * @param {Object} config.modules The group of modules"," * @param {String} name the group name."," * @example"," * var loader = new Y.Loader({});"," * loader.addGroup({"," * name: 'davglass',"," * combine: true,"," * comboBase: '/combo?',"," * root: '',"," * modules: {"," * //Module List here"," * }"," * }, 'davglass');"," */"," addGroup: function(o, name) {"," var mods = o.modules,"," self = this, i, v;",""," name = name || o.name;"," o.name = name;"," self.groups[name] = o;",""," if (o.patterns) {"," for (i in o.patterns) {"," if (o.patterns.hasOwnProperty(i)) {"," o.patterns[i].group = name;"," self.patterns[i] = o.patterns[i];"," }"," }"," }",""," if (mods) {"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," v = mods[i];"," if (typeof v === 'string') {"," v = { name: i, fullpath: v };"," }"," v.group = name;"," self.addModule(v, i);"," }"," }"," }"," },",""," /**"," * Add a new module to the component metadata."," * @method addModule"," * @param {Object} config An object containing the module data."," * @param {String} config.name Required, the component name"," * @param {String} config.type Required, the component type (js or css)"," * @param {String} config.path Required, the path to the script from `base`"," * @param {Array} config.requires Array of modules required by this component"," * @param {Array} [config.optional] Array of optional modules for this component"," * @param {Array} [config.supersedes] Array of the modules this component replaces"," * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one"," * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array"," * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup"," * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`"," * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in"," * @param {Object} [config.submodules] Hash of submodules"," * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration."," * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `[\"en-GB\", \"zh-Hans-CN\"]`"," * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:"," * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load"," * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded."," * @param {String} [config.condition.when] Specifies the load order of the conditional module"," * with regard to the position of the trigger module."," * This should be one of three values: `before`, `after`, or `instead`. The default is `after`."," * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`"," * @param {Function} [config.configFn] A function to exectute when configuring this module"," * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config."," * @param {String} [name] The module name, required if not in the module data."," * @return {Object} the module definition or null if the object passed in did not provide all required attributes."," */"," addModule: function(o, name) {"," name = name || o.name;",""," if (typeof o === 'string') {"," o = { name: name, fullpath: o };"," }","",""," var subs, i, l, t, sup, s, smod, plugins, plug,"," j, langs, packName, supName, flatSup, flatLang, lang, ret,"," overrides, skinname, when, g, p,"," conditions = this.conditions, trigger;",""," //Only merge this data if the temp flag is set"," //from an earlier pass from a pattern or else"," //an override module (YUI_config) can not be used to"," //replace a default module."," if (this.moduleInfo[name] && this.moduleInfo[name].temp) {"," //This catches temp modules loaded via a pattern"," // The module will be added twice, once from the pattern and"," // Once from the actual add call, this ensures that properties"," // that were added to the module the first time around (group: gallery)"," // are also added the second time around too."," o = Y.merge(this.moduleInfo[name], o);"," }",""," o.name = name;",""," if (!o || !o.name) {"," return null;"," }",""," if (!o.type) {"," //Always assume it's javascript unless the CSS pattern is matched."," o.type = JS;"," p = o.path || o.fullpath;"," if (p && this.REGEX_CSS.test(p)) {"," o.type = CSS;"," }"," }",""," if (!o.path && !o.fullpath) {"," o.path = _path(name, name, o.type);"," }"," o.supersedes = o.supersedes || o.use;",""," o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;",""," // Handle submodule logic"," subs = o.submodules;",""," this.moduleInfo[name] = o;",""," o.requires = o.requires || [];",""," /*"," Only allowing the cascade of requires information, since"," optional and supersedes are far more fine grained than"," a blanket requires is."," */"," if (this.requires) {"," for (i = 0; i < this.requires.length; i++) {"," o.requires.push(this.requires[i]);"," }"," }"," if (o.group && this.groups && this.groups[o.group]) {"," g = this.groups[o.group];"," if (g.requires) {"," for (i = 0; i < g.requires.length; i++) {"," o.requires.push(g.requires[i]);"," }"," }"," }","",""," if (!o.defaults) {"," o.defaults = {"," requires: o.requires ? [].concat(o.requires) : null,"," supersedes: o.supersedes ? [].concat(o.supersedes) : null,"," optional: o.optional ? [].concat(o.optional) : null"," };"," }",""," if (o.skinnable && o.ext && o.temp) {"," skinname = this._addSkin(this.skin.defaultSkin, name);"," o.requires.unshift(skinname);"," }",""," if (o.requires.length) {"," o.requires = this.filterRequires(o.requires) || [];"," }",""," if (!o.langPack && o.lang) {"," langs = yArray(o.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," smod = this.moduleInfo[packName];"," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }"," }"," }","",""," if (subs) {"," sup = o.supersedes || [];"," l = 0;",""," for (i in subs) {"," if (subs.hasOwnProperty(i)) {"," s = subs[i];",""," s.path = s.path || _path(name, i, o.type);"," s.pkg = name;"," s.group = o.group;",""," if (s.supersedes) {"," sup = sup.concat(s.supersedes);"," }",""," smod = this.addModule(s, i);"," sup.push(i);",""," if (smod.skinnable) {"," o.skinnable = true;"," overrides = this.skin.overrides;"," if (overrides && overrides[i]) {"," for (j = 0; j < overrides[i].length; j++) {"," skinname = this._addSkin(overrides[i][j],"," i, name);"," sup.push(skinname);"," }"," }"," skinname = this._addSkin(this.skin.defaultSkin,"," i, name);"," sup.push(skinname);"," }",""," // looks like we are expected to work out the metadata"," // for the parent module language packs from what is"," // specified in the child modules."," if (s.lang && s.lang.length) {",""," langs = yArray(s.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," supName = this.getLangPackName(lang, i);"," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," flatSup = flatSup || yArray.hash(smod.supersedes);",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }",""," o.lang = o.lang || [];",""," flatLang = flatLang || yArray.hash(o.lang);",""," if (!(lang in flatLang)) {"," o.lang.push(lang);"," }","","// Add rollup file, need to add to supersedes list too",""," // default packages"," packName = this.getLangPackName(ROOT_LANG, name);"," supName = this.getLangPackName(ROOT_LANG, i);",""," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }","","// Add rollup file, need to add to supersedes list too",""," }"," }",""," l++;"," }"," }"," //o.supersedes = YObject.keys(yArray.hash(sup));"," o.supersedes = yArray.dedupe(sup);"," if (this.allowRollup) {"," o.rollup = (l < 4) ? l : Math.min(l - 1, 4);"," }"," }",""," plugins = o.plugins;"," if (plugins) {"," for (i in plugins) {"," if (plugins.hasOwnProperty(i)) {"," plug = plugins[i];"," plug.pkg = name;"," plug.path = plug.path || _path(name, i, o.type);"," plug.requires = plug.requires || [];"," plug.group = o.group;"," this.addModule(plug, i);"," if (o.skinnable) {"," this._addSkin(this.skin.defaultSkin, i, name);"," }",""," }"," }"," }",""," if (o.condition) {"," t = o.condition.trigger;"," if (YUI.Env.aliases[t]) {"," t = YUI.Env.aliases[t];"," }"," if (!Y.Lang.isArray(t)) {"," t = [t];"," }",""," for (i = 0; i < t.length; i++) {"," trigger = t[i];"," when = o.condition.when;"," conditions[trigger] = conditions[trigger] || {};"," conditions[trigger][name] = o.condition;"," // the 'when' attribute can be 'before', 'after', or 'instead'"," // the default is after."," if (when && when !== 'after') {"," if (when === 'instead') { // replace the trigger"," o.supersedes = o.supersedes || [];"," o.supersedes.push(trigger);"," }"," // before the trigger"," // the trigger requires the conditional mod,"," // so it should appear before the conditional"," // mod if we do not intersede."," } else { // after the trigger"," o.after = o.after || [];"," o.after.push(trigger);"," }"," }"," }",""," if (o.supersedes) {"," o.supersedes = this.filterRequires(o.supersedes);"," }",""," if (o.after) {"," o.after = this.filterRequires(o.after);"," o.after_map = yArray.hash(o.after);"," }",""," // this.dirty = true;",""," if (o.configFn) {"," ret = o.configFn(o);"," if (ret === false) {"," delete this.moduleInfo[name];"," delete GLOBAL_ENV._renderedMods[name];"," o = null;"," }"," }"," //Add to global cache"," if (o) {"," if (!GLOBAL_ENV._renderedMods) {"," GLOBAL_ENV._renderedMods = {};"," }"," GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);"," GLOBAL_ENV._conditions = conditions;"," }",""," return o;"," },",""," /**"," * Add a requirement for one or more module"," * @method require"," * @param {string[] | string*} what the modules to load."," */"," require: function(what) {"," var a = (typeof what === 'string') ? yArray(arguments) : what;"," this.dirty = true;"," this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a)));",""," this._explodeRollups();"," },"," /**"," * Grab all the items that were asked for, check to see if the Loader"," * meta-data contains a \"use\" array. If it doesm remove the asked item and replace it with"," * the content of the \"use\"."," * This will make asking for: \"dd\""," * Actually ask for: \"dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin\""," * @private"," * @method _explodeRollups"," */"," _explodeRollups: function() {"," var self = this, m, m2, i, a, v, len, len2,"," r = self.required;",""," if (!self.allowRollup) {"," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = self.getModule(i);"," if (m && m.use) {"," len = m.use.length;"," for (a = 0; a < len; a++) {"," m2 = self.getModule(m.use[a]);"," if (m2 && m2.use) {"," len2 = m2.use.length;"," for (v = 0; v < len2; v++) {"," r[m2.use[v]] = true;"," }"," } else {"," r[m.use[a]] = true;"," }"," }"," }"," }"," }"," self.required = r;"," }",""," },"," /**"," * Explodes the required array to remove aliases and replace them with real modules"," * @method filterRequires"," * @param {Array} r The original requires array"," * @return {Array} The new array of exploded requirements"," */"," filterRequires: function(r) {"," if (r) {"," if (!Y.Lang.isArray(r)) {"," r = [r];"," }"," r = Y.Array(r);"," var c = [], i, mod, o, m;",""," for (i = 0; i < r.length; i++) {"," mod = this.getModule(r[i]);"," if (mod && mod.use) {"," for (o = 0; o < mod.use.length; o++) {"," //Must walk the other modules in case a module is a rollup of rollups (datatype)"," m = this.getModule(mod.use[o]);"," if (m && m.use && (m.name !== mod.name)) {"," c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));"," } else {"," c.push(mod.use[o]);"," }"," }"," } else {"," c.push(r[i]);"," }"," }"," r = c;"," }"," return r;"," },"," /**"," * Returns an object containing properties for all modules required"," * in order to load the requested module"," * @method getRequires"," * @param {object} mod The module definition from moduleInfo."," * @return {array} the expanded requirement list."," */"," getRequires: function(mod) {",""," if (!mod) {"," //console.log('returning no reqs for ' + mod.name);"," return NO_REQUIREMENTS;"," }",""," if (mod._parsed) {"," //console.log('returning requires for ' + mod.name, mod.requires);"," return mod.expanded || NO_REQUIREMENTS;"," }",""," //TODO add modue cache here out of scope..",""," var i, m, j, add, packName, lang, testresults = this.testresults,"," name = mod.name, cond,"," adddef = ON_PAGE[name] && ON_PAGE[name].details,"," d, go, def,"," r, old_mod,"," o, skinmod, skindef, skinpar, skinname,"," intl = mod.lang || mod.intl,"," info = this.moduleInfo,"," ftests = Y.Features && Y.Features.tests.load,"," hash, reparse;",""," // console.log(name);",""," // pattern match leaves module stub that needs to be filled out"," if (mod.temp && adddef) {"," old_mod = mod;"," mod = this.addModule(adddef, name);"," mod.group = old_mod.group;"," mod.pkg = old_mod.pkg;"," delete mod.expanded;"," }",""," // console.log('cache: ' + mod.langCache + ' == ' + this.lang);",""," //If a skin or a lang is different, reparse.."," reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));",""," if (mod.expanded && !reparse) {"," return mod.expanded;"," }","",""," d = [];"," hash = {};"," r = this.filterRequires(mod.requires);"," if (mod.lang) {"," //If a module has a lang attribute, auto add the intl requirement."," d.unshift('intl');"," r.unshift('intl');"," intl = true;"," }"," o = this.filterRequires(mod.optional);","",""," mod._parsed = true;"," mod.langCache = this.lang;"," mod.skinCache = this.skin.defaultSkin;",""," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," d.push(r[i]);"," hash[r[i]] = true;"," m = this.getModule(r[i]);"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }",""," // get the requirements from superseded modules, if any"," r = this.filterRequires(mod.supersedes);"," if (r) {"," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," // if this module has submodules, the requirements list is"," // expanded to include the submodules. This is so we can"," // prevent dups when a submodule is already loaded and the"," // parent is requested."," if (mod.submodules) {"," d.push(r[i]);"," }",""," hash[r[i]] = true;"," m = this.getModule(r[i]);",""," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," if (o && this.loadOptional) {"," for (i = 0; i < o.length; i++) {"," if (!hash[o[i]]) {"," d.push(o[i]);"," hash[o[i]] = true;"," m = info[o[i]];"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," cond = this.conditions[name];",""," if (cond) {"," //Set the module to not parsed since we have conditionals and this could change the dependency tree."," mod._parsed = false;"," if (testresults && ftests) {"," oeach(testresults, function(result, id) {"," var condmod = ftests[id].name;"," if (!hash[condmod] && ftests[id].trigger === name) {"," if (result && ftests[id]) {"," hash[condmod] = true;"," d.push(condmod);"," }"," }"," });"," } else {"," for (i in cond) {"," if (cond.hasOwnProperty(i)) {"," if (!hash[i]) {"," def = cond[i];"," //first see if they've specfied a ua check"," //then see if they've got a test fn & if it returns true"," //otherwise just having a condition block is enough"," go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||"," (def.test && def.test(Y, r)));",""," if (go) {"," hash[i] = true;"," d.push(i);"," m = this.getModule(i);"," if (m) {"," add = this.getRequires(m);"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }",""," }"," }"," }"," }"," }"," }"," }",""," // Create skin modules"," if (mod.skinnable) {"," skindef = this.skin.overrides;"," for (i in YUI.Env.aliases) {"," if (YUI.Env.aliases.hasOwnProperty(i)) {"," if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {"," skinpar = i;"," }"," }"," }"," if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {"," skinname = name;"," if (skindef[skinpar]) {"," skinname = skinpar;"," }"," for (i = 0; i < skindef[skinname].length; i++) {"," skinmod = this._addSkin(skindef[skinname][i], name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," } else {"," skinmod = this._addSkin(this.skin.defaultSkin, name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," }",""," mod._parsed = false;",""," if (intl) {",""," if (mod.lang && !mod.langPack && Y.Intl) {"," lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);"," packName = this.getLangPackName(lang, name);"," if (packName) {"," d.unshift(packName);"," }"," }"," d.unshift(INTL);"," }",""," mod.expanded_map = yArray.hash(d);",""," mod.expanded = YObject.keys(mod.expanded_map);",""," return mod.expanded;"," },"," /**"," * Check to see if named css module is already loaded on the page"," * @method isCSSLoaded"," * @param {String} name The name of the css file"," * @return Boolean"," */"," isCSSLoaded: function(name, skip) {"," //TODO - Make this call a batching call with name being an array"," if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {"," return false;"," }"," var el = YUI.Env.cssStampEl,"," ret = false,"," mod = YUI.Env._cssLoaded[name],"," style = el.currentStyle; //IE","",""," if (mod !== undefined) {"," return mod;"," }",""," //Add the classname to the element"," el.className = name;",""," if (!style) {"," style = Y.config.doc.defaultView.getComputedStyle(el, null);"," }",""," if (style && style.display === 'none') {"," ret = true;"," }","",""," el.className = ''; //Reset the classname to ''",""," YUI.Env._cssLoaded[name] = ret;",""," return ret;"," },",""," /**"," * Returns a hash of module names the supplied module satisfies."," * @method getProvides"," * @param {string} name The name of the module."," * @return {object} what this module provides."," */"," getProvides: function(name) {"," var m = this.getModule(name), o, s;"," // supmap = this.provides;",""," if (!m) {"," return NOT_FOUND;"," }",""," if (m && !m.provides) {"," o = {};"," s = m.supersedes;",""," if (s) {"," yArray.each(s, function(v) {"," Y.mix(o, this.getProvides(v));"," }, this);"," }",""," o[name] = true;"," m.provides = o;",""," }",""," return m.provides;"," },",""," /**"," * Calculates the dependency tree, the result is stored in the sorted"," * property."," * @method calculate"," * @param {object} o optional options object."," * @param {string} type optional argument to prune modules."," */"," calculate: function(o, type) {"," if (o || type || this.dirty) {",""," if (o) {"," this._config(o);"," }",""," if (!this._init) {"," this._setup();"," }",""," this._explode();",""," if (this.allowRollup) {"," this._rollup();"," } else {"," this._explodeRollups();"," }"," this._reduce();"," this._sort();"," }"," },"," /**"," * Creates a \"psuedo\" package for languages provided in the lang array"," * @method _addLangPack"," * @private"," * @param {String} lang The language to create"," * @param {Object} m The module definition to create the language pack around"," * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)"," * @return {Object} The module definition"," */"," _addLangPack: function(lang, m, packName) {"," var name = m.name,"," packPath, conf,"," existing = this.moduleInfo[packName];",""," if (!existing) {",""," packPath = _path((m.pkg || name), packName, JS, true);",""," conf = {"," path: packPath,"," intl: true,"," langPack: true,"," ext: m.ext,"," group: m.group,"," supersedes: []"," };"," if (m.root) {"," conf.root = m.root;"," }"," if (m.base) {"," conf.base = m.base;"," }",""," if (m.configFn) {"," conf.configFn = m.configFn;"," }",""," this.addModule(conf, packName);",""," if (lang) {"," Y.Env.lang = Y.Env.lang || {};"," Y.Env.lang[lang] = Y.Env.lang[lang] || {};"," Y.Env.lang[lang][name] = true;"," }"," }",""," return this.moduleInfo[packName];"," },",""," /**"," * Investigates the current YUI configuration on the page. By default,"," * modules already detected will not be loaded again unless a force"," * option is encountered. Called by calculate()"," * @method _setup"," * @private"," */"," _setup: function() {"," var info = this.moduleInfo, name, i, j, m, l,"," packName;",""," for (name in info) {"," if (info.hasOwnProperty(name)) {"," m = info[name];"," if (m) {",""," // remove dups"," //m.requires = YObject.keys(yArray.hash(m.requires));"," m.requires = yArray.dedupe(m.requires);",""," // Create lang pack modules"," //if (m.lang && m.lang.length) {"," if (m.lang) {"," // Setup root package if the module has lang defined,"," // it needs to provide a root language pack"," packName = this.getLangPackName(ROOT_LANG, name);"," this._addLangPack(null, m, packName);"," }",""," }"," }"," }","",""," //l = Y.merge(this.inserted);"," l = {};",""," // available modules"," if (!this.ignoreRegistered) {"," Y.mix(l, GLOBAL_ENV.mods);"," }",""," // add the ignore list to the list of loaded packages"," if (this.ignore) {"," Y.mix(l, yArray.hash(this.ignore));"," }",""," // expand the list to include superseded modules"," for (j in l) {"," if (l.hasOwnProperty(j)) {"," Y.mix(l, this.getProvides(j));"," }"," }",""," // remove modules on the force list from the loaded list"," if (this.force) {"," for (i = 0; i < this.force.length; i++) {"," if (this.force[i] in l) {"," delete l[this.force[i]];"," }"," }"," }",""," Y.mix(this.loaded, l);",""," this._init = true;"," },",""," /**"," * Builds a module name for a language pack"," * @method getLangPackName"," * @param {string} lang the language code."," * @param {string} mname the module to build it for."," * @return {string} the language pack module name."," */"," getLangPackName: function(lang, mname) {"," return ('lang/' + mname + ((lang) ? '_' + lang : ''));"," },"," /**"," * Inspects the required modules list looking for additional"," * dependencies. Expands the required list to include all"," * required modules. Called by calculate()"," * @method _explode"," * @private"," */"," _explode: function() {"," //TODO Move done out of scope"," var r = this.required, m, reqs, done = {},"," self = this, name, expound;",""," // the setup phase is over, all modules have been created"," self.dirty = false;",""," self._explodeRollups();"," r = self.required;",""," for (name in r) {"," if (r.hasOwnProperty(name)) {"," if (!done[name]) {"," done[name] = true;"," m = self.getModule(name);"," if (m) {"," expound = m.expound;",""," if (expound) {"," r[expound] = self.getModule(expound);"," reqs = self.getRequires(r[expound]);"," Y.mix(r, yArray.hash(reqs));"," }",""," reqs = self.getRequires(m);"," Y.mix(r, yArray.hash(reqs));"," }"," }"," }"," }",""," },"," /**"," * The default method used to test a module against a pattern"," * @method _patternTest"," * @private"," * @param {String} mname The module being tested"," * @param {String} pname The pattern to match"," */"," _patternTest: function(mname, pname) {"," return (mname.indexOf(pname) > -1);"," },"," /**"," * Get's the loader meta data for the requested module"," * @method getModule"," * @param {String} mname The module name to get"," * @return {Object} The module metadata"," */"," getModule: function(mname) {"," //TODO: Remove name check - it's a quick hack to fix pattern WIP"," if (!mname) {"," return null;"," }",""," var p, found, pname,"," m = this.moduleInfo[mname],"," patterns = this.patterns;",""," // check the patterns library to see if we should automatically add"," // the module with defaults"," if (!m || (m && m.ext)) {"," for (pname in patterns) {"," if (patterns.hasOwnProperty(pname)) {"," p = patterns[pname];",""," //There is no test method, create a default one that tests"," // the pattern against the mod name"," if (!p.test) {"," p.test = this._patternTest;"," }",""," if (p.test(mname, pname)) {"," // use the metadata supplied for the pattern"," // as the module definition."," found = p;"," break;"," }"," }"," }"," }",""," if (!m) {"," if (found) {"," if (p.action) {"," p.action.call(this, mname, pname);"," } else {"," // ext true or false?"," m = this.addModule(Y.merge(found), mname);"," if (found.configFn) {"," m.configFn = found.configFn;"," }"," m.temp = true;"," }"," }"," } else {"," if (found && m && found.configFn && !m.configFn) {"," m.configFn = found.configFn;"," m.configFn(m);"," }"," }",""," return m;"," },",""," // impl in rollup submodule"," _rollup: function() { },",""," /**"," * Remove superceded modules and loaded modules. Called by"," * calculate() after we have the mega list of all dependencies"," * @method _reduce"," * @return {object} the reduced dependency hash."," * @private"," */"," _reduce: function(r) {",""," r = r || this.required;",""," var i, j, s, m, type = this.loadType,"," ignore = this.ignore ? yArray.hash(this.ignore) : false;",""," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = this.getModule(i);"," // remove if already loaded"," if (((this.loaded[i] || ON_PAGE[i]) &&"," !this.forceMap[i] && !this.ignoreRegistered) ||"," (type && m && m.type !== type)) {"," delete r[i];"," }"," if (ignore && ignore[i]) {"," delete r[i];"," }"," // remove anything this module supersedes"," s = m && m.supersedes;"," if (s) {"," for (j = 0; j < s.length; j++) {"," if (s[j] in r) {"," delete r[s[j]];"," }"," }"," }"," }"," }",""," return r;"," },"," /**"," * Handles the queue when a module has been loaded for all cases"," * @method _finish"," * @private"," * @param {String} msg The message from Loader"," * @param {Boolean} success A boolean denoting success or failure"," */"," _finish: function(msg, success) {",""," _queue.running = false;",""," var onEnd = this.onEnd;"," if (onEnd) {"," onEnd.call(this.context, {"," msg: msg,"," data: this.data,"," success: success"," });"," }"," this._continue();"," },"," /**"," * The default Loader onSuccess handler, calls this.onSuccess with a payload"," * @method _onSuccess"," * @private"," */"," _onSuccess: function() {"," var self = this, skipped = Y.merge(self.skipped), fn,"," failed = [], rreg = self.requireRegistration,"," success, msg, i, mod;",""," for (i in skipped) {"," if (skipped.hasOwnProperty(i)) {"," delete self.inserted[i];"," }"," }",""," self.skipped = {};",""," for (i in self.inserted) {"," if (self.inserted.hasOwnProperty(i)) {"," mod = self.getModule(i);"," if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) {"," failed.push(i);"," } else {"," Y.mix(self.loaded, self.getProvides(i));"," }"," }"," }",""," fn = self.onSuccess;"," msg = (failed.length) ? 'notregistered' : 'success';"," success = !(failed.length);"," if (fn) {"," fn.call(self.context, {"," msg: msg,"," data: self.data,"," success: success,"," failed: failed,"," skipped: skipped"," });"," }"," self._finish(msg, success);"," },"," /**"," * The default Loader onProgress handler, calls this.onProgress with a payload"," * @method _onProgress"," * @private"," */"," _onProgress: function(e) {"," var self = this, i;"," //set the internal cache to what just came in."," if (e.data && e.data.length) {"," for (i = 0; i < e.data.length; i++) {"," e.data[i] = self.getModule(e.data[i].name);"," }"," }"," if (self.onProgress) {"," self.onProgress.call(self.context, {"," name: e.url,"," data: e.data"," });"," }"," },"," /**"," * The default Loader onFailure handler, calls this.onFailure with a payload"," * @method _onFailure"," * @private"," */"," _onFailure: function(o) {"," var f = this.onFailure, msg = [], i = 0, len = o.errors.length;",""," for (i; i < len; i++) {"," msg.push(o.errors[i].error);"," }",""," msg = msg.join(',');","",""," if (f) {"," f.call(this.context, {"," msg: msg,"," data: this.data,"," success: false"," });"," }",""," this._finish(msg, false);",""," },",""," /**"," * The default Loader onTimeout handler, calls this.onTimeout with a payload"," * @method _onTimeout"," * @private"," */"," _onTimeout: function() {"," var f = this.onTimeout;"," if (f) {"," f.call(this.context, {"," msg: 'timeout',"," data: this.data,"," success: false"," });"," }"," },",""," /**"," * Sorts the dependency tree. The last step of calculate()"," * @method _sort"," * @private"," */"," _sort: function() {",""," // create an indexed list"," var s = YObject.keys(this.required),"," // loaded = this.loaded,"," //TODO Move this out of scope"," done = {},"," p = 0, l, a, b, j, k, moved, doneKey;",""," // keep going until we make a pass without moving anything"," for (;;) {",""," l = s.length;"," moved = false;",""," // start the loop after items that are already sorted"," for (j = p; j < l; j++) {",""," // check the next module on the list to see if its"," // dependencies have been met"," a = s[j];",""," // check everything below current item and move if we"," // find a requirement for the current item"," for (k = j + 1; k < l; k++) {"," doneKey = a + s[k];",""," if (!done[doneKey] && this._requires(a, s[k])) {",""," // extract the dependency so we can move it up"," b = s.splice(k, 1);",""," // insert the dependency above the item that"," // requires it"," s.splice(j, 0, b[0]);",""," // only swap two dependencies once to short circut"," // circular dependencies"," done[doneKey] = true;",""," // keep working"," moved = true;",""," break;"," }"," }",""," // jump out of loop if we moved something"," if (moved) {"," break;"," // this item is sorted, move our pointer and keep going"," } else {"," p++;"," }"," }",""," // when we make it here and moved is false, we are"," // finished sorting"," if (!moved) {"," break;"," }",""," }",""," this.sorted = s;"," },",""," /**"," * Handles the actual insertion of script/link tags"," * @method _insert"," * @private"," * @param {Object} source The YUI instance the request came from"," * @param {Object} o The metadata to include"," * @param {String} type JS or CSS"," * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta"," */"," _insert: function(source, o, type, skipcalc) {","",""," // restore the state at the time of the request"," if (source) {"," this._config(source);"," }",""," // build the dependency list"," // don't include type so we can process CSS and script in"," // one pass when the type is not specified.",""," var modules = this.resolve(!skipcalc),"," self = this, comp = 0, actions = 0,"," mods = {}, deps, complete;",""," self._refetch = [];",""," if (type) {"," //Filter out the opposite type and reset the array so the checks later work"," modules[((type === JS) ? CSS : JS)] = [];"," }"," if (!self.fetchCSS) {"," modules.css = [];"," }"," if (modules.js.length) {"," comp++;"," }"," if (modules.css.length) {"," comp++;"," }",""," //console.log('Resolved Modules: ', modules);",""," complete = function(d) {"," actions++;"," var errs = {}, i = 0, o = 0, u = '', fn,"," modName, resMods;",""," if (d && d.errors) {"," for (i = 0; i < d.errors.length; i++) {"," if (d.errors[i].request) {"," u = d.errors[i].request.url;"," } else {"," u = d.errors[i];"," }"," errs[u] = u;"," }"," }",""," if (d && d.data && d.data.length && (d.type === 'success')) {"," for (i = 0; i < d.data.length; i++) {"," self.inserted[d.data[i].name] = true;"," //If the external module has a skin or a lang, reprocess it"," if (d.data[i].lang || d.data[i].skinnable) {"," delete self.inserted[d.data[i].name];"," self._refetch.push(d.data[i].name);"," }"," }"," }",""," if (actions === comp) {"," self._loading = null;"," if (self._refetch.length) {"," //Get the deps for the new meta-data and reprocess"," for (i = 0; i < self._refetch.length; i++) {"," deps = self.getRequires(self.getModule(self._refetch[i]));"," for (o = 0; o < deps.length; o++) {"," if (!self.inserted[deps[o]]) {"," //We wouldn't be to this point without the module being here"," mods[deps[o]] = deps[o];"," }"," }"," }"," mods = Y.Object.keys(mods);"," if (mods.length) {"," self.require(mods);"," resMods = self.resolve(true);"," if (resMods.cssMods.length) {"," for (i=0; i < resMods.cssMods.length; i++) {"," modName = resMods.cssMods[i].name;"," delete YUI.Env._cssLoaded[modName];"," if (self.isCSSLoaded(modName)) {"," self.inserted[modName] = true;"," delete self.required[modName];"," }"," }"," self.sorted = [];"," self._sort();"," }"," d = null; //bail"," self._insert(); //insert the new deps"," }"," }"," if (d && d.fn) {"," fn = d.fn;"," delete d.fn;"," fn.call(self, d);"," }"," }"," };",""," this._loading = true;",""," if (!modules.js.length && !modules.css.length) {"," actions = -1;"," complete({"," fn: self._onSuccess"," });"," return;"," }","",""," if (modules.css.length) { //Load CSS first"," Y.Get.css(modules.css, {"," data: modules.cssMods,"," attributes: self.cssAttributes,"," insertBefore: self.insertBefore,"," charset: self.charset,"," timeout: self.timeout,"," context: self,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }",""," if (modules.js.length) {"," Y.Get.js(modules.js, {"," data: modules.jsMods,"," insertBefore: self.insertBefore,"," attributes: self.jsAttributes,"," charset: self.charset,"," timeout: self.timeout,"," autopurge: false,"," context: self,"," async: self.async,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }"," },"," /**"," * Once a loader operation is completely finished, process any additional queued items."," * @method _continue"," * @private"," */"," _continue: function() {"," if (!(_queue.running) && _queue.size() > 0) {"," _queue.running = true;"," _queue.next()();"," }"," },",""," /**"," * inserts the requested modules and their dependencies."," * <code>type</code> can be \"js\" or \"css\". Both script and"," * css are inserted if type is not provided."," * @method insert"," * @param {object} o optional options object."," * @param {string} type the type of dependency to insert."," */"," insert: function(o, type, skipsort) {"," var self = this, copy = Y.merge(this);"," delete copy.require;"," delete copy.dirty;"," _queue.add(function() {"," self._insert(copy, o, type, skipsort);"," });"," this._continue();"," },",""," /**"," * Executed every time a module is loaded, and if we are in a load"," * cycle, we attempt to load the next script. Public so that it"," * is possible to call this if using a method other than"," * Y.register to determine when scripts are fully loaded"," * @method loadNext"," * @deprecated"," * @param {string} mname optional the name of the module that has"," * been loaded (which is usually why it is time to load the next"," * one)."," */"," loadNext: function() {"," return;"," },",""," /**"," * Apply filter defined for this instance to a url/path"," * @method _filter"," * @param {string} u the string to filter."," * @param {string} name the name of the module, if we are processing"," * a single module as opposed to a combined url."," * @return {string} the filtered string."," * @private"," */"," _filter: function(u, name, group) {"," var f = this.filter,"," hasFilter = name && (name in this.filters),"," modFilter = hasFilter && this.filters[name],"," groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);",""," if (groupName && this.groups[groupName] && this.groups[groupName].filter) {"," modFilter = this.groups[groupName].filter;"," hasFilter = true;"," }",""," if (u) {"," if (hasFilter) {"," f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;"," }"," if (f) {"," u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);"," }"," }"," return u;"," },",""," /**"," * Generates the full url for a module"," * @method _url"," * @param {string} path the path fragment."," * @param {String} name The name of the module"," * @param {String} [base=self.base] The base url to use"," * @return {string} the full url."," * @private"," */"," _url: function(path, name, base) {"," return this._filter((base || this.base || '') + path, name);"," },"," /**"," * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules."," * @method resolve"," * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else"," * @param {Array} [s=loader.sorted] An override for the loader.sorted array"," * @return {Object} Object hash (js and css) of two arrays of file lists"," * @example This method can be used as an off-line dep calculator"," *"," * var Y = YUI();"," * var loader = new Y.Loader({"," * filter: 'debug',"," * base: '../../',"," * root: 'build/',"," * combine: true,"," * require: ['node', 'dd', 'console']"," * });"," * var out = loader.resolve(true);"," *"," */"," resolve: function(calc, s) {",""," var len, i, m, url, group, groupName, j, frag,"," comboSource, comboSources, mods, comboBase,"," base, urls, u = [], tmpBase, baseLen, resCombos = {},"," self = this, comboSep, maxURLLength,"," inserted = (self.ignoreRegistered) ? {} : self.inserted,"," resolved = { js: [], jsMods: [], css: [], cssMods: [] },"," type = self.loadType || 'js', addSingle;",""," if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) {"," self._resetModules();"," }",""," if (calc) {"," self.calculate();"," }"," s = s || self.sorted;",""," addSingle = function(m) {",""," if (m) {"," group = (m.group && self.groups[m.group]) || NOT_FOUND;",""," //Always assume it's async"," if (group.async === false) {"," m.async = group.async;"," }",""," url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :"," self._url(m.path, s[i], group.base || m.base);",""," if (m.attributes || m.async === false) {"," url = {"," url: url,"," async: m.async"," };"," if (m.attributes) {"," url.attributes = m.attributes;"," }"," }"," resolved[m.type].push(url);"," resolved[m.type + 'Mods'].push(m);"," } else {"," }",""," };",""," len = s.length;",""," // the default combo base"," comboBase = self.comboBase;",""," url = comboBase;",""," comboSources = {};",""," for (i = 0; i < len; i++) {"," comboSource = comboBase;"," m = self.getModule(s[i]);"," groupName = m && m.group;"," group = self.groups[groupName];"," if (groupName && group) {",""," if (!group.combine || m.fullpath) {"," //This is not a combo module, skip it and load it singly later."," addSingle(m);"," continue;"," }"," m.combine = true;"," if (group.comboBase) {"," comboSource = group.comboBase;"," }",""," if (\"root\" in group && L.isValue(group.root)) {"," m.root = group.root;"," }"," m.comboSep = group.comboSep || self.comboSep;"," m.maxURLLength = group.maxURLLength || self.maxURLLength;"," } else {"," if (!self.combine) {"," //This is not a combo module, skip it and load it singly later."," addSingle(m);"," continue;"," }"," }",""," comboSources[comboSource] = comboSources[comboSource] || [];"," comboSources[comboSource].push(m);"," }",""," for (j in comboSources) {"," if (comboSources.hasOwnProperty(j)) {"," resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };"," url = j;"," mods = comboSources[j];"," len = mods.length;",""," if (len) {"," for (i = 0; i < len; i++) {"," if (inserted[mods[i]]) {"," continue;"," }"," m = mods[i];"," // Do not try to combine non-yui JS unless combo def"," // is found"," if (m && (m.combine || !m.ext)) {"," resCombos[j].comboSep = m.comboSep;"," resCombos[j].group = m.group;"," resCombos[j].maxURLLength = m.maxURLLength;"," frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);"," frag = self._filter(frag, m.name);"," resCombos[j][m.type].push(frag);"," resCombos[j][m.type + 'Mods'].push(m);"," } else {"," //Add them to the next process.."," if (mods[i]) {"," addSingle(mods[i]);"," }"," }",""," }"," }"," }"," }","",""," for (j in resCombos) {"," base = j;"," comboSep = resCombos[base].comboSep || self.comboSep;"," maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;"," for (type in resCombos[base]) {"," if (type === JS || type === CSS) {"," urls = resCombos[base][type];"," mods = resCombos[base][type + 'Mods'];"," len = urls.length;"," tmpBase = base + urls.join(comboSep);"," baseLen = tmpBase.length;"," if (maxURLLength <= base.length) {"," maxURLLength = MAX_URL_LENGTH;"," }",""," if (len) {"," if (baseLen > maxURLLength) {"," u = [];"," for (s = 0; s < len; s++) {"," u.push(urls[s]);"," tmpBase = base + u.join(comboSep);",""," if (tmpBase.length > maxURLLength) {"," m = u.pop();"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," u = [];"," if (m) {"," u.push(m);"," }"," }"," }"," if (u.length) {"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," } else {"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," }"," resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);"," }"," }"," }",""," resCombos = null;",""," return resolved;"," },"," /**"," Shortcut to calculate, resolve and load all modules.",""," var loader = new Y.Loader({"," ignoreRegistered: true,"," modules: {"," mod: {"," path: 'mod.js'"," }"," },"," requires: [ 'mod' ]"," });"," loader.load(function() {"," console.log('All modules have loaded..');"," });","",""," @method load"," @param {Callback} cb Executed after all load operations are complete"," */"," load: function(cb) {"," if (!cb) {"," return;"," }"," var self = this,"," out = self.resolve(true);",""," self.data = out;",""," self.onEnd = function() {"," cb.apply(self.context || self, arguments);"," };",""," self.insert();"," }","};","","","","}, '3.7.3', {\"requires\": [\"get\", \"features\"]});"];+_yuitest_coverage["build/loader-base/loader-base.js"].lines = {"1":0,"9":0,"11":0,"12":0,"39":0,"45":0,"46":0,"47":0,"50":0,"54":0,"55":0,"56":0,"60":0,"62":0,"72":0,"80":0,"81":0,"82":0,"85":0,"93":0,"94":0,"96":0,"116":0,"137":0,"138":0,"139":0,"141":0,"143":0,"147":0,"148":0,"158":0,"206":0,"208":0,"211":0,"213":0,"267":0,"310":0,"318":0,"333":0,"342":0,"354":0,"361":0,"370":0,"379":0,"397":0,"405":0,"440":0,"447":0,"460":0,"467":0,"469":0,"499":0,"505":0,"510":0,"511":0,"513":0,"523":0,"531":0,"533":0,"535":0,"537":0,"539":0,"541":0,"543":0,"544":0,"569":0,"585":0,"592":0,"599":0,"603":0,"612":0,"614":0,"619":0,"627":0,"632":0,"633":0,"634":0,"635":0,"639":0,"640":0,"641":0,"642":0,"647":0,"648":0,"649":0,"662":0,"664":0,"665":0,"666":0,"667":0,"668":0,"670":0,"671":0,"672":0,"673":0,"674":0,"677":0,"678":0,"679":0,"680":0,"681":0,"686":0,"687":0,"688":0,"689":0,"733":0,"736":0,"737":0,"738":0,"739":0,"740":0,"741":0,"746":0,"747":0,"748":0,"749":0,"750":0,"751":0,"752":0,"754":0,"755":0,"757":0,"760":0,"762":0,"776":0,"781":0,"782":0,"785":0,"786":0,"790":0,"791":0,"794":0,"797":0,"798":0,"802":0,"803":0,"804":0,"805":0,"806":0,"811":0,"812":0,"813":0,"814":0,"815":0,"822":0,"823":0,"827":0,"828":0,"831":0,"840":0,"843":0,"844":0,"845":0,"846":0,"848":0,"849":0,"850":0,"852":0,"853":0,"854":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"865":0,"866":0,"867":0,"868":0,"869":0,"876":0,"878":0,"879":0,"880":0,"883":0,"884":0,"885":0,"886":0,"889":0,"890":0,"891":0,"892":0,"894":0,"901":0,"903":0,"904":0,"905":0,"906":0,"907":0,"908":0,"912":0,"913":0,"914":0,"915":0,"916":0,"917":0,"919":0,"922":0,"923":0,"924":0,"926":0,"927":0,"943":0,"944":0,"945":0,"948":0,"962":0,"968":0,"969":0,"970":0,"971":0,"972":0,"973":0,"983":0,"984":0,"986":0,"987":0,"989":0,"994":0,"1010":0,"1011":0,"1040":0,"1043":0,"1044":0,"1045":0,"1047":0,"1048":0,"1049":0,"1050":0,"1051":0,"1056":0,"1057":0,"1058":0,"1059":0,"1060":0,"1061":0,"1063":0,"1064":0,"1101":0,"1103":0,"1104":0,"1108":0,"1117":0,"1123":0,"1126":0,"1128":0,"1129":0,"1132":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1146":0,"1149":0,"1151":0,"1153":0,"1160":0,"1161":0,"1162":0,"1165":0,"1166":0,"1167":0,"1168":0,"1169":0,"1175":0,"1176":0,"1183":0,"1184":0,"1185":0,"1188":0,"1189":0,"1192":0,"1193":0,"1194":0,"1195":0,"1196":0,"1197":0,"1198":0,"1199":0,"1205":0,"1206":0,"1207":0,"1209":0,"1210":0,"1211":0,"1213":0,"1214":0,"1215":0,"1217":0,"1218":0,"1221":0,"1222":0,"1224":0,"1225":0,"1226":0,"1227":0,"1228":0,"1229":0,"1231":0,"1234":0,"1236":0,"1242":0,"1244":0,"1245":0,"1246":0,"1247":0,"1248":0,"1249":0,"1251":0,"1252":0,"1255":0,"1257":0,"1258":0,"1261":0,"1263":0,"1265":0,"1266":0,"1272":0,"1273":0,"1275":0,"1277":0,"1278":0,"1281":0,"1282":0,"1290":0,"1294":0,"1295":0,"1296":0,"1300":0,"1301":0,"1302":0,"1303":0,"1304":0,"1305":0,"1306":0,"1307":0,"1308":0,"1309":0,"1310":0,"1311":0,"1318":0,"1319":0,"1320":0,"1321":0,"1323":0,"1324":0,"1327":0,"1328":0,"1329":0,"1330":0,"1331":0,"1334":0,"1335":0,"1336":0,"1337":0,"1344":0,"1345":0,"1350":0,"1351":0,"1354":0,"1355":0,"1356":0,"1361":0,"1362":0,"1363":0,"1364":0,"1365":0,"1366":0,"1370":0,"1371":0,"1372":0,"1374":0,"1375":0,"1378":0,"1387":0,"1388":0,"1389":0,"1391":0,"1403":0,"1406":0,"1407":0,"1408":0,"1409":0,"1410":0,"1411":0,"1412":0,"1413":0,"1414":0,"1415":0,"1416":0,"1417":0,"1420":0,"1426":0,"1437":0,"1438":0,"1439":0,"1441":0,"1442":0,"1444":0,"1445":0,"1446":0,"1447":0,"1449":0,"1450":0,"1451":0,"1453":0,"1457":0,"1460":0,"1462":0,"1473":0,"1475":0,"1478":0,"1480":0,"1485":0,"1499":0,"1500":0,"1501":0,"1502":0,"1503":0,"1504":0,"1510":0,"1512":0,"1513":0,"1517":0,"1518":0,"1519":0,"1520":0,"1522":0,"1523":0,"1524":0,"1526":0,"1529":0,"1530":0,"1531":0,"1533":0,"1534":0,"1535":0,"1536":0,"1537":0,"1538":0,"1539":0,"1540":0,"1542":0,"1543":0,"1550":0,"1551":0,"1552":0,"1553":0,"1558":0,"1559":0,"1562":0,"1563":0,"1565":0,"1566":0,"1567":0,"1569":0,"1570":0,"1577":0,"1578":0,"1579":0,"1580":0,"1581":0,"1582":0,"1583":0,"1584":0,"1585":0,"1587":0,"1588":0,"1595":0,"1597":0,"1599":0,"1600":0,"1601":0,"1602":0,"1603":0,"1604":0,"1605":0,"1606":0,"1611":0,"1612":0,"1613":0,"1614":0,"1618":0,"1621":0,"1622":0,"1623":0,"1624":0,"1625":0,"1626":0,"1627":0,"1628":0,"1640":0,"1641":0,"1642":0,"1643":0,"1644":0,"1645":0,"1649":0,"1650":0,"1651":0,"1652":0,"1654":0,"1655":0,"1656":0,"1657":0,"1661":0,"1662":0,"1663":0,"1668":0,"1670":0,"1672":0,"1673":0,"1674":0,"1675":0,"1676":0,"1679":0,"1682":0,"1684":0,"1686":0,"1696":0,"1697":0,"1699":0,"1705":0,"1706":0,"1710":0,"1712":0,"1713":0,"1716":0,"1717":0,"1721":0,"1723":0,"1725":0,"1735":0,"1738":0,"1739":0,"1742":0,"1743":0,"1744":0,"1746":0,"1747":0,"1748":0,"1752":0,"1753":0,"1757":0,"1768":0,"1770":0,"1771":0,"1774":0,"1775":0,"1778":0,"1780":0,"1781":0,"1783":0,"1785":0,"1786":0,"1799":0,"1803":0,"1805":0,"1807":0,"1815":0,"1816":0,"1818":0,"1819":0,"1822":0,"1823":0,"1826":0,"1828":0,"1829":0,"1830":0,"1831":0,"1835":0,"1846":0,"1849":0,"1850":0,"1851":0,"1852":0,"1856":0,"1860":0,"1863":0,"1864":0,"1873":0,"1876":0,"1877":0,"1881":0,"1882":0,"1886":0,"1887":0,"1888":0,"1893":0,"1894":0,"1895":0,"1896":0,"1901":0,"1903":0,"1914":0,"1925":0,"1929":0,"1931":0,"1932":0,"1934":0,"1935":0,"1936":0,"1937":0,"1938":0,"1939":0,"1940":0,"1942":0,"1943":0,"1944":0,"1945":0,"1948":0,"1949":0,"1964":0,"1974":0,"1975":0,"1978":0,"1984":0,"1985":0,"1986":0,"1987":0,"1991":0,"1992":0,"1995":0,"1998":0,"1999":0,"2005":0,"2006":0,"2007":0,"2008":0,"2011":0,"2012":0,"2013":0,"2015":0,"2019":0,"2020":0,"2021":0,"2025":0,"2040":0,"2042":0,"2045":0,"2046":0,"2047":0,"2049":0,"2052":0,"2054":0,"2055":0,"2058":0,"2059":0,"2060":0,"2061":0,"2062":0,"2069":0,"2080":0,"2082":0,"2083":0,"2084":0,"2090":0,"2098":0,"2102":0,"2103":0,"2104":0,"2108":0,"2110":0,"2111":0,"2112":0,"2113":0,"2114":0,"2116":0,"2121":0,"2122":0,"2123":0,"2124":0,"2125":0,"2133":0,"2141":0,"2143":0,"2144":0,"2145":0,"2148":0,"2149":0,"2161":0,"2163":0,"2164":0,"2167":0,"2170":0,"2171":0,"2178":0,"2188":0,"2189":0,"2190":0,"2206":0,"2213":0,"2215":0,"2216":0,"2219":0,"2223":0,"2227":0,"2228":0,"2230":0,"2233":0,"2237":0,"2241":0,"2244":0,"2246":0,"2251":0,"2252":0,"2255":0,"2261":0,"2262":0,"2267":0,"2283":0,"2284":0,"2291":0,"2295":0,"2297":0,"2299":0,"2301":0,"2302":0,"2304":0,"2305":0,"2307":0,"2308":0,"2313":0,"2314":0,"2315":0,"2318":0,"2319":0,"2320":0,"2321":0,"2323":0,"2325":0,"2329":0,"2330":0,"2331":0,"2333":0,"2334":0,"2335":0,"2340":0,"2341":0,"2342":0,"2344":0,"2345":0,"2346":0,"2347":0,"2349":0,"2353":0,"2354":0,"2355":0,"2356":0,"2357":0,"2358":0,"2359":0,"2360":0,"2361":0,"2362":0,"2363":0,"2366":0,"2367":0,"2369":0,"2370":0,"2373":0,"2374":0,"2375":0,"2376":0,"2381":0,"2383":0,"2384":0,"2385":0,"2388":0,"2392":0,"2393":0,"2401":0,"2404":0,"2407":0,"2408":0,"2409":0,"2412":0,"2413":0,"2414":0,"2419":0,"2420":0,"2430":0,"2433":0,"2436":0,"2437":0,"2438":0,"2441":0,"2442":0,"2443":0,"2454":0,"2455":0,"2456":0,"2469":0,"2470":0,"2471":0,"2472":0,"2473":0,"2475":0,"2490":0,"2503":0,"2508":0,"2509":0,"2510":0,"2513":0,"2514":0,"2515":0,"2517":0,"2518":0,"2521":0,"2534":0,"2557":0,"2565":0,"2566":0,"2569":0,"2570":0,"2572":0,"2574":0,"2576":0,"2577":0,"2580":0,"2581":0,"2584":0,"2587":0,"2588":0,"2592":0,"2593":0,"2596":0,"2597":0,"2603":0,"2606":0,"2608":0,"2610":0,"2612":0,"2613":0,"2614":0,"2615":0,"2616":0,"2617":0,"2619":0,"2621":0,"2622":0,"2624":0,"2625":0,"2626":0,"2629":0,"2630":0,"2632":0,"2633":0,"2635":0,"2637":0,"2638":0,"2642":0,"2643":0,"2646":0,"2647":0,"2648":0,"2649":0,"2650":0,"2651":0,"2653":0,"2654":0,"2655":0,"2656":0,"2658":0,"2661":0,"2662":0,"2663":0,"2664":0,"2665":0,"2666":0,"2667":0,"2668":0,"2671":0,"2672":0,"2682":0,"2683":0,"2684":0,"2685":0,"2686":0,"2687":0,"2688":0,"2689":0,"2690":0,"2691":0,"2692":0,"2693":0,"2694":0,"2697":0,"2698":0,"2699":0,"2700":0,"2701":0,"2702":0,"2704":0,"2705":0,"2706":0,"2707":0,"2708":0,"2709":0,"2710":0,"2714":0,"2715":0,"2716":0,"2719":0,"2722":0,"2727":0,"2729":0,"2752":0,"2753":0,"2755":0,"2758":0,"2760":0,"2761":0,"2764":0};+_yuitest_coverage["build/loader-base/loader-base.js"].functions = {"yui2Update:37":0,"galleryUpdate:49":0,"configFn:79":0,"(anonymous 2):11":0,"_path:136":0,"Loader:206":0,"_populateCache:626":0,"_resetModules:661":0,"_inspectPage:732":0,"_requires:774":0,"(anonymous 3):923":0,"_config:839":0,"formatSkin:942":0,"_addSkin:961":0,"addAlias:1009":0,"addGroup:1039":0,"addModule:1100":0,"require:1386":0,"_explodeRollups:1402":0,"filterRequires:1436":0,"(anonymous 4):1601":0,"getRequires:1471":0,"isCSSLoaded:1694":0,"(anonymous 5):1747":0,"getProvides:1734":0,"calculate:1767":0,"_addLangPack:1798":0,"_setup:1845":0,"getLangPackName:1913":0,"_explode:1923":0,"_patternTest:1963":0,"getModule:1972":0,"_reduce:2038":0,"_finish:2078":0,"_onSuccess:2097":0,"_onProgress:2140":0,"_onFailure:2160":0,"_onTimeout:2187":0,"_sort:2203":0,"complete:2313":0,"onProgress:2400":0,"onTimeout:2403":0,"onSuccess:2406":0,"onFailure:2411":0,"onProgress:2429":0,"onTimeout:2432":0,"onSuccess:2435":0,"onFailure:2440":0,"_insert:2279":0,"_continue:2453":0,"(anonymous 6):2472":0,"insert:2468":0,"loadNext:2489":0,"_filter:2502":0,"_url:2533":0,"addSingle:2574":0,"resolve:2555":0,"onEnd:2760":0,"load:2751":0,"(anonymous 1):1":0};+_yuitest_coverage["build/loader-base/loader-base.js"].coveredLines = 918;+_yuitest_coverage["build/loader-base/loader-base.js"].coveredFunctions = 60;+_yuitest_coverline("build/loader-base/loader-base.js", 1);+YUI.add('loader-base', function (Y, NAME) {++/**+ * The YUI loader core+ * @module loader+ * @submodule loader-base+ */++_yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/loader-base/loader-base.js", 9);+if (!YUI.Env[Y.version]) {++ _yuitest_coverline("build/loader-base/loader-base.js", 11);+(function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 2)", 11);+_yuitest_coverline("build/loader-base/loader-base.js", 12);+var VERSION = Y.version,+ BUILD = '/build/',+ ROOT = VERSION + BUILD,+ CDN_BASE = Y.Env.base,+ GALLERY_VERSION = 'gallery-2012.10.10-19-59',+ TNT = '2in3',+ TNT_VERSION = '4',+ YUI2_VERSION = '2.9.0',+ COMBO_BASE = CDN_BASE + 'combo?',+ META = { version: VERSION,+ root: ROOT,+ base: Y.Env.base,+ comboBase: COMBO_BASE,+ skin: { defaultSkin: 'sam',+ base: 'assets/skins/',+ path: 'skin.css',+ after: ['cssreset',+ 'cssfonts',+ 'cssgrids',+ 'cssbase',+ 'cssreset-context',+ 'cssfonts-context']},+ groups: {},+ patterns: {} },+ groups = META.groups,+ yui2Update = function(tnt, yui2, config) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "yui2Update", 37);+_yuitest_coverline("build/loader-base/loader-base.js", 39);+var root = TNT + '.' ++ (tnt || TNT_VERSION) + '/' ++ (yui2 || YUI2_VERSION) + BUILD,+ base = (config && config.base) ? config.base : CDN_BASE,+ combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;++ _yuitest_coverline("build/loader-base/loader-base.js", 45);+groups.yui2.base = base + root;+ _yuitest_coverline("build/loader-base/loader-base.js", 46);+groups.yui2.root = root;+ _yuitest_coverline("build/loader-base/loader-base.js", 47);+groups.yui2.comboBase = combo;+ },+ galleryUpdate = function(tag, config) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "galleryUpdate", 49);+_yuitest_coverline("build/loader-base/loader-base.js", 50);+var root = (tag || GALLERY_VERSION) + BUILD,+ base = (config && config.base) ? config.base : CDN_BASE,+ combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;++ _yuitest_coverline("build/loader-base/loader-base.js", 54);+groups.gallery.base = base + root;+ _yuitest_coverline("build/loader-base/loader-base.js", 55);+groups.gallery.root = root;+ _yuitest_coverline("build/loader-base/loader-base.js", 56);+groups.gallery.comboBase = combo;+ };+++ _yuitest_coverline("build/loader-base/loader-base.js", 60);+groups[VERSION] = {};++ _yuitest_coverline("build/loader-base/loader-base.js", 62);+groups.gallery = {+ ext: false,+ combine: true,+ comboBase: COMBO_BASE,+ update: galleryUpdate,+ patterns: { 'gallery-': { },+ 'lang/gallery-': {},+ 'gallerycss-': { type: 'css' } }+ };++ _yuitest_coverline("build/loader-base/loader-base.js", 72);+groups.yui2 = {+ combine: true,+ ext: false,+ comboBase: COMBO_BASE,+ update: yui2Update,+ patterns: {+ 'yui2-': {+ configFn: function(me) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "configFn", 79);+_yuitest_coverline("build/loader-base/loader-base.js", 80);+if (/-skin|reset|fonts|grids|base/.test(me.name)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 81);+me.type = 'css';+ _yuitest_coverline("build/loader-base/loader-base.js", 82);+me.path = me.path.replace(/\.js/, '.css');+ // this makes skins in builds earlier than+ // 2.6.0 work as long as combine is false+ _yuitest_coverline("build/loader-base/loader-base.js", 85);+me.path = me.path.replace(/\/yui2-skin/,+ '/assets/skins/sam/yui2-skin');+ }+ }+ }+ }+ };++ _yuitest_coverline("build/loader-base/loader-base.js", 93);+galleryUpdate();+ _yuitest_coverline("build/loader-base/loader-base.js", 94);+yui2Update();++ _yuitest_coverline("build/loader-base/loader-base.js", 96);+YUI.Env[VERSION] = META;+ }());+}+++/*jslint forin: true, maxlen: 350 */++/**+ * Loader dynamically loads script and css files. It includes the dependency+ * information for the version of the library in use, and will automatically pull in+ * dependencies for the modules requested. It can also load the+ * files from the Yahoo! CDN, and it can utilize the combo service provided on+ * this network to reduce the number of http connections required to download+ * YUI files.+ *+ * @module loader+ * @main loader+ * @submodule loader-base+ */++_yuitest_coverline("build/loader-base/loader-base.js", 116);+var NOT_FOUND = {},+ NO_REQUIREMENTS = [],+ MAX_URL_LENGTH = 1024,+ GLOBAL_ENV = YUI.Env,+ GLOBAL_LOADED = GLOBAL_ENV._loaded,+ CSS = 'css',+ JS = 'js',+ INTL = 'intl',+ DEFAULT_SKIN = 'sam',+ VERSION = Y.version,+ ROOT_LANG = '',+ YObject = Y.Object,+ oeach = YObject.each,+ yArray = Y.Array,+ _queue = GLOBAL_ENV._loaderQueue,+ META = GLOBAL_ENV[VERSION],+ SKIN_PREFIX = 'skin-',+ L = Y.Lang,+ ON_PAGE = GLOBAL_ENV.mods,+ modulekey,+ _path = function(dir, file, type, nomin) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_path", 136);+_yuitest_coverline("build/loader-base/loader-base.js", 137);+var path = dir + '/' + file;+ _yuitest_coverline("build/loader-base/loader-base.js", 138);+if (!nomin) {+ _yuitest_coverline("build/loader-base/loader-base.js", 139);+path += '-min';+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 141);+path += '.' + (type || CSS);++ _yuitest_coverline("build/loader-base/loader-base.js", 143);+return path;+ };+++ _yuitest_coverline("build/loader-base/loader-base.js", 147);+if (!YUI.Env._cssLoaded) {+ _yuitest_coverline("build/loader-base/loader-base.js", 148);+YUI.Env._cssLoaded = {};+ }+++/**+ * The component metadata is stored in Y.Env.meta.+ * Part of the loader module.+ * @property meta+ * @for YUI+ */+_yuitest_coverline("build/loader-base/loader-base.js", 158);+Y.Env.meta = META;++/**+ * Loader dynamically loads script and css files. It includes the dependency+ * info for the version of the library in use, and will automatically pull in+ * dependencies for the modules requested. It can load the+ * files from the Yahoo! CDN, and it can utilize the combo service provided on+ * this network to reduce the number of http connections required to download+ * YUI files. You can also specify an external, custom combo service to host+ * your modules as well.++ var Y = YUI();+ var loader = new Y.Loader({+ filter: 'debug',+ base: '../../',+ root: 'build/',+ combine: true,+ require: ['node', 'dd', 'console']+ });+ var out = loader.resolve(true);++ * @constructor+ * @class Loader+ * @param {Object} config an optional set of configuration options.+ * @param {String} config.base The base dir which to fetch this module from+ * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`+ * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`+ * @param {String|Object} config.filter A filter to apply to result urls. <a href="#property_filter">See filter property</a>+ * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config.+ * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies+ * @param {Boolean} [config.async=true] Fetch files in async+ * @param {Array} config.ignore: A list of modules that should never be dynamically loaded+ * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page+ * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes+ * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes+ * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes+ * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout+ * @param {Object} config.context Execution context for all callbacks+ * @param {Function} config.onSuccess Callback for the 'success' event+ * @param {Function} config.onFailure Callback for the 'failure' event+ * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading.+ * @param {Function} config.onTimeout Callback for the 'timeout' event+ * @param {Function} config.onProgress Callback executed each time a script or css file is loaded+ * @param {Object} config.modules A list of module definitions. See <a href="#method_addModule">Loader.addModule</a> for the supported module metadata+ * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`.+ * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox.+ * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward.+ */+_yuitest_coverline("build/loader-base/loader-base.js", 206);+Y.Loader = function(o) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "Loader", 206);+_yuitest_coverline("build/loader-base/loader-base.js", 208);+var self = this;++ //Catch no config passed.+ _yuitest_coverline("build/loader-base/loader-base.js", 211);+o = o || {};++ _yuitest_coverline("build/loader-base/loader-base.js", 213);+modulekey = META.md5;++ /**+ * Internal callback to handle multiple internal insert() calls+ * so that css is inserted prior to js+ * @property _internalCallback+ * @private+ */+ // self._internalCallback = null;++ /**+ * Callback that will be executed when the loader is finished+ * with an insert+ * @method onSuccess+ * @type function+ */+ // self.onSuccess = null;++ /**+ * Callback that will be executed if there is a failure+ * @method onFailure+ * @type function+ */+ // self.onFailure = null;++ /**+ * Callback for the 'CSSComplete' event. When loading YUI components+ * with CSS the CSS is loaded first, then the script. This provides+ * a moment you can tie into to improve the presentation of the page+ * while the script is loading.+ * @method onCSS+ * @type function+ */+ // self.onCSS = null;++ /**+ * Callback executed each time a script or css file is loaded+ * @method onProgress+ * @type function+ */+ // self.onProgress = null;++ /**+ * Callback that will be executed if a timeout occurs+ * @method onTimeout+ * @type function+ */+ // self.onTimeout = null;++ /**+ * The execution context for all callbacks+ * @property context+ * @default {YUI} the YUI instance+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 267);+self.context = Y;++ /**+ * Data that is passed to all callbacks+ * @property data+ */+ // self.data = null;++ /**+ * Node reference or id where new nodes should be inserted before+ * @property insertBefore+ * @type string|HTMLElement+ */+ // self.insertBefore = null;++ /**+ * The charset attribute for inserted nodes+ * @property charset+ * @type string+ * @deprecated , use cssAttributes or jsAttributes.+ */+ // self.charset = null;++ /**+ * An object literal containing attributes to add to link nodes+ * @property cssAttributes+ * @type object+ */+ // self.cssAttributes = null;++ /**+ * An object literal containing attributes to add to script nodes+ * @property jsAttributes+ * @type object+ */+ // self.jsAttributes = null;++ /**+ * The base directory.+ * @property base+ * @type string+ * @default http://yui.yahooapis.com/[YUI VERSION]/build/+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 310);+self.base = Y.Env.meta.base + Y.Env.meta.root;++ /**+ * Base path for the combo service+ * @property comboBase+ * @type string+ * @default http://yui.yahooapis.com/combo?+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 318);+self.comboBase = Y.Env.meta.comboBase;++ /*+ * Base path for language packs.+ */+ // self.langBase = Y.Env.meta.langBase;+ // self.lang = "";++ /**+ * If configured, the loader will attempt to use the combo+ * service for YUI resources and configured external resources.+ * @property combine+ * @type boolean+ * @default true if a base dir isn't in the config+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 333);+self.combine = o.base &&+ (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);++ /**+ * The default seperator to use between files in a combo URL+ * @property comboSep+ * @type {String}+ * @default Ampersand+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 342);+self.comboSep = '&';+ /**+ * Max url length for combo urls. The default is 1024. This is the URL+ * limit for the Yahoo! hosted combo servers. If consuming+ * a different combo service that has a different URL limit+ * it is possible to override this default by supplying+ * the maxURLLength config option. The config option will+ * only take effect if lower than the default.+ *+ * @property maxURLLength+ * @type int+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 354);+self.maxURLLength = MAX_URL_LENGTH;++ /**+ * Ignore modules registered on the YUI global+ * @property ignoreRegistered+ * @default false+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 361);+self.ignoreRegistered = o.ignoreRegistered;++ /**+ * Root path to prepend to module path for the combo+ * service+ * @property root+ * @type string+ * @default [YUI VERSION]/build/+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 370);+self.root = Y.Env.meta.root;++ /**+ * Timeout value in milliseconds. If set, self value will be used by+ * the get utility. the timeout event will fire if+ * a timeout occurs.+ * @property timeout+ * @type int+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 379);+self.timeout = 0;++ /**+ * A list of modules that should not be loaded, even if+ * they turn up in the dependency tree+ * @property ignore+ * @type string[]+ */+ // self.ignore = null;++ /**+ * A list of modules that should always be loaded, even+ * if they have already been inserted into the page.+ * @property force+ * @type string[]+ */+ // self.force = null;++ _yuitest_coverline("build/loader-base/loader-base.js", 397);+self.forceMap = {};++ /**+ * Should we allow rollups+ * @property allowRollup+ * @type boolean+ * @default false+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 405);+self.allowRollup = false;++ /**+ * A filter to apply to result urls. This filter will modify the default+ * path for all modules. The default path for the YUI library is the+ * minified version of the files (e.g., event-min.js). The filter property+ * can be a predefined filter or a custom filter. The valid predefined+ * filters are:+ * <dl>+ * <dt>DEBUG</dt>+ * <dd>Selects the debug versions of the library (e.g., event-debug.js).+ * This option will automatically include the Logger widget</dd>+ * <dt>RAW</dt>+ * <dd>Selects the non-minified version of the library (e.g., event.js).+ * </dd>+ * </dl>+ * You can also define a custom filter, which must be an object literal+ * containing a search expression and a replace string:+ *+ * myFilter: {+ * 'searchExp': "-min\\.js",+ * 'replaceStr': "-debug.js"+ * }+ *+ * @property filter+ * @type string| {searchExp: string, replaceStr: string}+ */+ // self.filter = null;++ /**+ * per-component filter specification. If specified for a given+ * component, this overrides the filter config.+ * @property filters+ * @type object+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 440);+self.filters = {};++ /**+ * The list of requested modules+ * @property required+ * @type {string: boolean}+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 447);+self.required = {};++ /**+ * If a module name is predefined when requested, it is checked againsts+ * the patterns provided in this property. If there is a match, the+ * module is added with the default configuration.+ *+ * At the moment only supporting module prefixes, but anticipate+ * supporting at least regular expressions.+ * @property patterns+ * @type Object+ */+ // self.patterns = Y.merge(Y.Env.meta.patterns);+ _yuitest_coverline("build/loader-base/loader-base.js", 460);+self.patterns = {};++ /**+ * The library metadata+ * @property moduleInfo+ */+ // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);+ _yuitest_coverline("build/loader-base/loader-base.js", 467);+self.moduleInfo = {};++ _yuitest_coverline("build/loader-base/loader-base.js", 469);+self.groups = Y.merge(Y.Env.meta.groups);++ /**+ * Provides the information used to skin the skinnable components.+ * The following skin definition would result in 'skin1' and 'skin2'+ * being loaded for calendar (if calendar was requested), and+ * 'sam' for all other skinnable components:+ *+ * skin: {+ * // The default skin, which is automatically applied if not+ * // overriden by a component-specific skin definition.+ * // Change this in to apply a different skin globally+ * defaultSkin: 'sam',+ *+ * // This is combined with the loader base property to get+ * // the default root directory for a skin. ex:+ * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/+ * base: 'assets/skins/',+ *+ * // Any component-specific overrides can be specified here,+ * // making it possible to load different skins for different+ * // components. It is possible to load more than one skin+ * // for a given component as well.+ * overrides: {+ * calendar: ['skin1', 'skin2']+ * }+ * }+ * @property skin+ * @type {Object}+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 499);+self.skin = Y.merge(Y.Env.meta.skin);++ /*+ * Map of conditional modules+ * @since 3.2.0+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 505);+self.conditions = {};++ // map of modules with a hash of modules that meet the requirement+ // self.provides = {};++ _yuitest_coverline("build/loader-base/loader-base.js", 510);+self.config = o;+ _yuitest_coverline("build/loader-base/loader-base.js", 511);+self._internal = true;++ _yuitest_coverline("build/loader-base/loader-base.js", 513);+self._populateCache();++ /**+ * Set when beginning to compute the dependency tree.+ * Composed of what YUI reports to be loaded combined+ * with what has been loaded by any instance on the page+ * with the version number specified in the metadata.+ * @property loaded+ * @type {string: boolean}+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 523);+self.loaded = GLOBAL_LOADED[VERSION];+++ /**+ * Should Loader fetch scripts in `async`, defaults to `true`+ * @property async+ */++ _yuitest_coverline("build/loader-base/loader-base.js", 531);+self.async = true;++ _yuitest_coverline("build/loader-base/loader-base.js", 533);+self._inspectPage();++ _yuitest_coverline("build/loader-base/loader-base.js", 535);+self._internal = false;++ _yuitest_coverline("build/loader-base/loader-base.js", 537);+self._config(o);++ _yuitest_coverline("build/loader-base/loader-base.js", 539);+self.forceMap = (self.force) ? Y.Array.hash(self.force) : {};++ _yuitest_coverline("build/loader-base/loader-base.js", 541);+self.testresults = null;++ _yuitest_coverline("build/loader-base/loader-base.js", 543);+if (Y.config.tests) {+ _yuitest_coverline("build/loader-base/loader-base.js", 544);+self.testresults = Y.config.tests;+ }++ /**+ * List of rollup files found in the library metadata+ * @property rollups+ */+ // self.rollups = null;++ /**+ * Whether or not to load optional dependencies for+ * the requested modules+ * @property loadOptional+ * @type boolean+ * @default false+ */+ // self.loadOptional = false;++ /**+ * All of the derived dependencies in sorted order, which+ * will be populated when either calculate() or insert()+ * is called+ * @property sorted+ * @type string[]+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 569);+self.sorted = [];++ /*+ * A list of modules to attach to the YUI instance when complete.+ * If not supplied, the sorted list of dependencies are applied.+ * @property attaching+ */+ // self.attaching = null;++ /**+ * Flag to indicate the dependency tree needs to be recomputed+ * if insert is called again.+ * @property dirty+ * @type boolean+ * @default true+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 585);+self.dirty = true;++ /**+ * List of modules inserted by the utility+ * @property inserted+ * @type {string: boolean}+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 592);+self.inserted = {};++ /**+ * List of skipped modules during insert() because the module+ * was not defined+ * @property skipped+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 599);+self.skipped = {};++ // Y.on('yui:load', self.loadNext, self);++ _yuitest_coverline("build/loader-base/loader-base.js", 603);+self.tested = {};++ /*+ * Cached sorted calculate results+ * @property results+ * @since 3.2.0+ */+ //self.results = {};++ _yuitest_coverline("build/loader-base/loader-base.js", 612);+if (self.ignoreRegistered) {+ //Clear inpage already processed modules.+ _yuitest_coverline("build/loader-base/loader-base.js", 614);+self._resetModules();+ }++};++_yuitest_coverline("build/loader-base/loader-base.js", 619);+Y.Loader.prototype = {+ /**+ * Checks the cache for modules and conditions, if they do not exist+ * process the default metadata and populate the local moduleInfo hash.+ * @method _populateCache+ * @private+ */+ _populateCache: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_populateCache", 626);+_yuitest_coverline("build/loader-base/loader-base.js", 627);+var self = this,+ defaults = META.modules,+ cache = GLOBAL_ENV._renderedMods,+ i;++ _yuitest_coverline("build/loader-base/loader-base.js", 632);+if (cache && !self.ignoreRegistered) {+ _yuitest_coverline("build/loader-base/loader-base.js", 633);+for (i in cache) {+ _yuitest_coverline("build/loader-base/loader-base.js", 634);+if (cache.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 635);+self.moduleInfo[i] = Y.merge(cache[i]);+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 639);+cache = GLOBAL_ENV._conditions;+ _yuitest_coverline("build/loader-base/loader-base.js", 640);+for (i in cache) {+ _yuitest_coverline("build/loader-base/loader-base.js", 641);+if (cache.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 642);+self.conditions[i] = Y.merge(cache[i]);+ }+ }++ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 647);+for (i in defaults) {+ _yuitest_coverline("build/loader-base/loader-base.js", 648);+if (defaults.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 649);+self.addModule(defaults[i], i);+ }+ }+ }++ },+ /**+ * Reset modules in the module cache to a pre-processed state so additional+ * computations with a different skin or language will work as expected.+ * @method _resetModules+ * @private+ */+ _resetModules: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_resetModules", 661);+_yuitest_coverline("build/loader-base/loader-base.js", 662);+var self = this, i, o,+ mod, name, details;+ _yuitest_coverline("build/loader-base/loader-base.js", 664);+for (i in self.moduleInfo) {+ _yuitest_coverline("build/loader-base/loader-base.js", 665);+if (self.moduleInfo.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 666);+mod = self.moduleInfo[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 667);+name = mod.name;+ _yuitest_coverline("build/loader-base/loader-base.js", 668);+details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);++ _yuitest_coverline("build/loader-base/loader-base.js", 670);+if (details) {+ _yuitest_coverline("build/loader-base/loader-base.js", 671);+self.moduleInfo[name]._reset = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 672);+self.moduleInfo[name].requires = details.requires || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 673);+self.moduleInfo[name].optional = details.optional || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 674);+self.moduleInfo[name].supersedes = details.supercedes || [];+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 677);+if (mod.defaults) {+ _yuitest_coverline("build/loader-base/loader-base.js", 678);+for (o in mod.defaults) {+ _yuitest_coverline("build/loader-base/loader-base.js", 679);+if (mod.defaults.hasOwnProperty(o)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 680);+if (mod[o]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 681);+mod[o] = mod.defaults[o];+ }+ }+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 686);+delete mod.langCache;+ _yuitest_coverline("build/loader-base/loader-base.js", 687);+delete mod.skinCache;+ _yuitest_coverline("build/loader-base/loader-base.js", 688);+if (mod.skinnable) {+ _yuitest_coverline("build/loader-base/loader-base.js", 689);+self._addSkin(self.skin.defaultSkin, mod.name);+ }+ }+ }+ },+ /**+ Regex that matches a CSS URL. Used to guess the file type when it's not+ specified.++ @property REGEX_CSS+ @type RegExp+ @final+ @protected+ @since 3.5.0+ **/+ REGEX_CSS: /\.css(?:[?;].*)?$/i,++ /**+ * Default filters for raw and debug+ * @property FILTER_DEFS+ * @type Object+ * @final+ * @protected+ */+ FILTER_DEFS: {+ RAW: {+ 'searchExp': '-min\\.js',+ 'replaceStr': '.js'+ },+ DEBUG: {+ 'searchExp': '-min\\.js',+ 'replaceStr': '-debug.js'+ },+ COVERAGE: {+ 'searchExp': '-min\\.js',+ 'replaceStr': '-coverage.js'+ }+ },+ /*+ * Check the pages meta-data and cache the result.+ * @method _inspectPage+ * @private+ */+ _inspectPage: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_inspectPage", 732);+_yuitest_coverline("build/loader-base/loader-base.js", 733);+var self = this, v, m, req, mr, i;++ //Inspect the page for CSS only modules and mark them as loaded.+ _yuitest_coverline("build/loader-base/loader-base.js", 736);+for (i in self.moduleInfo) {+ _yuitest_coverline("build/loader-base/loader-base.js", 737);+if (self.moduleInfo.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 738);+v = self.moduleInfo[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 739);+if (v.type && v.type === CSS) {+ _yuitest_coverline("build/loader-base/loader-base.js", 740);+if (self.isCSSLoaded(v.name)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 741);+self.loaded[i] = true;+ }+ }+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 746);+for (i in ON_PAGE) {+ _yuitest_coverline("build/loader-base/loader-base.js", 747);+if (ON_PAGE.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 748);+v = ON_PAGE[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 749);+if (v.details) {+ _yuitest_coverline("build/loader-base/loader-base.js", 750);+m = self.moduleInfo[v.name];+ _yuitest_coverline("build/loader-base/loader-base.js", 751);+req = v.details.requires;+ _yuitest_coverline("build/loader-base/loader-base.js", 752);+mr = m && m.requires;++ _yuitest_coverline("build/loader-base/loader-base.js", 754);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 755);+if (!m._inspected && req && mr.length !== req.length) {+ // console.log('deleting ' + m.name);+ _yuitest_coverline("build/loader-base/loader-base.js", 757);+delete m.expanded;+ }+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 760);+m = self.addModule(v.details, i);+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 762);+m._inspected = true;+ }+ }+ }+ },+ /*+ * returns true if b is not loaded, and is required directly or by means of modules it supersedes.+ * @private+ * @method _requires+ * @param {String} mod1 The first module to compare+ * @param {String} mod2 The second module to compare+ */+ _requires: function(mod1, mod2) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "_requires", 774);+_yuitest_coverline("build/loader-base/loader-base.js", 776);+var i, rm, after_map, s,+ info = this.moduleInfo,+ m = info[mod1],+ other = info[mod2];++ _yuitest_coverline("build/loader-base/loader-base.js", 781);+if (!m || !other) {+ _yuitest_coverline("build/loader-base/loader-base.js", 782);+return false;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 785);+rm = m.expanded_map;+ _yuitest_coverline("build/loader-base/loader-base.js", 786);+after_map = m.after_map;++ // check if this module should be sorted after the other+ // do this first to short circut circular deps+ _yuitest_coverline("build/loader-base/loader-base.js", 790);+if (after_map && (mod2 in after_map)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 791);+return true;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 794);+after_map = other.after_map;++ // and vis-versa+ _yuitest_coverline("build/loader-base/loader-base.js", 797);+if (after_map && (mod1 in after_map)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 798);+return false;+ }++ // check if this module requires one the other supersedes+ _yuitest_coverline("build/loader-base/loader-base.js", 802);+s = info[mod2] && info[mod2].supersedes;+ _yuitest_coverline("build/loader-base/loader-base.js", 803);+if (s) {+ _yuitest_coverline("build/loader-base/loader-base.js", 804);+for (i = 0; i < s.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 805);+if (this._requires(mod1, s[i])) {+ _yuitest_coverline("build/loader-base/loader-base.js", 806);+return true;+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 811);+s = info[mod1] && info[mod1].supersedes;+ _yuitest_coverline("build/loader-base/loader-base.js", 812);+if (s) {+ _yuitest_coverline("build/loader-base/loader-base.js", 813);+for (i = 0; i < s.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 814);+if (this._requires(mod2, s[i])) {+ _yuitest_coverline("build/loader-base/loader-base.js", 815);+return false;+ }+ }+ }++ // check if this module requires the other directly+ // if (r && yArray.indexOf(r, mod2) > -1) {+ _yuitest_coverline("build/loader-base/loader-base.js", 822);+if (rm && (mod2 in rm)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 823);+return true;+ }++ // external css files should be sorted below yui css+ _yuitest_coverline("build/loader-base/loader-base.js", 827);+if (m.ext && m.type === CSS && !other.ext && other.type === CSS) {+ _yuitest_coverline("build/loader-base/loader-base.js", 828);+return true;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 831);+return false;+ },+ /**+ * Apply a new config to the Loader instance+ * @method _config+ * @private+ * @param {Object} o The new configuration+ */+ _config: function(o) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_config", 839);+_yuitest_coverline("build/loader-base/loader-base.js", 840);+var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod;+ // apply config values+ _yuitest_coverline("build/loader-base/loader-base.js", 843);+if (o) {+ _yuitest_coverline("build/loader-base/loader-base.js", 844);+for (i in o) {+ _yuitest_coverline("build/loader-base/loader-base.js", 845);+if (o.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 846);+val = o[i];+ //TODO This should be a case+ _yuitest_coverline("build/loader-base/loader-base.js", 848);+if (i === 'require') {+ _yuitest_coverline("build/loader-base/loader-base.js", 849);+self.require(val);+ } else {_yuitest_coverline("build/loader-base/loader-base.js", 850);+if (i === 'skin') {+ //If the config.skin is a string, format to the expected object+ _yuitest_coverline("build/loader-base/loader-base.js", 852);+if (typeof val === 'string') {+ _yuitest_coverline("build/loader-base/loader-base.js", 853);+self.skin.defaultSkin = o.skin;+ _yuitest_coverline("build/loader-base/loader-base.js", 854);+val = {+ defaultSkin: val+ };+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 859);+Y.mix(self.skin, val, true);+ } else {_yuitest_coverline("build/loader-base/loader-base.js", 860);+if (i === 'groups') {+ _yuitest_coverline("build/loader-base/loader-base.js", 861);+for (j in val) {+ _yuitest_coverline("build/loader-base/loader-base.js", 862);+if (val.hasOwnProperty(j)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 863);+groupName = j;+ _yuitest_coverline("build/loader-base/loader-base.js", 864);+group = val[j];+ _yuitest_coverline("build/loader-base/loader-base.js", 865);+self.addGroup(group, groupName);+ _yuitest_coverline("build/loader-base/loader-base.js", 866);+if (group.aliases) {+ _yuitest_coverline("build/loader-base/loader-base.js", 867);+for (a in group.aliases) {+ _yuitest_coverline("build/loader-base/loader-base.js", 868);+if (group.aliases.hasOwnProperty(a)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 869);+self.addAlias(group.aliases[a], a);+ }+ }+ }+ }+ }++ } else {_yuitest_coverline("build/loader-base/loader-base.js", 876);+if (i === 'modules') {+ // add a hash of module definitions+ _yuitest_coverline("build/loader-base/loader-base.js", 878);+for (j in val) {+ _yuitest_coverline("build/loader-base/loader-base.js", 879);+if (val.hasOwnProperty(j)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 880);+self.addModule(val[j], j);+ }+ }+ } else {_yuitest_coverline("build/loader-base/loader-base.js", 883);+if (i === 'aliases') {+ _yuitest_coverline("build/loader-base/loader-base.js", 884);+for (j in val) {+ _yuitest_coverline("build/loader-base/loader-base.js", 885);+if (val.hasOwnProperty(j)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 886);+self.addAlias(val[j], j);+ }+ }+ } else {_yuitest_coverline("build/loader-base/loader-base.js", 889);+if (i === 'gallery') {+ _yuitest_coverline("build/loader-base/loader-base.js", 890);+this.groups.gallery.update(val, o);+ } else {_yuitest_coverline("build/loader-base/loader-base.js", 891);+if (i === 'yui2' || i === '2in3') {+ _yuitest_coverline("build/loader-base/loader-base.js", 892);+this.groups.yui2.update(o['2in3'], o.yui2, o);+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 894);+self[i] = val;+ }}}}}}}+ }+ }+ }++ // fix filter+ _yuitest_coverline("build/loader-base/loader-base.js", 901);+f = self.filter;++ _yuitest_coverline("build/loader-base/loader-base.js", 903);+if (L.isString(f)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 904);+f = f.toUpperCase();+ _yuitest_coverline("build/loader-base/loader-base.js", 905);+self.filterName = f;+ _yuitest_coverline("build/loader-base/loader-base.js", 906);+self.filter = self.FILTER_DEFS[f];+ _yuitest_coverline("build/loader-base/loader-base.js", 907);+if (f === 'DEBUG') {+ _yuitest_coverline("build/loader-base/loader-base.js", 908);+self.require('yui-log', 'dump');+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 912);+if (self.filterName && self.coverage) {+ _yuitest_coverline("build/loader-base/loader-base.js", 913);+if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 914);+for (i = 0; i < self.coverage.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 915);+mod = self.coverage[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 916);+if (self.moduleInfo[mod] && self.moduleInfo[mod].use) {+ _yuitest_coverline("build/loader-base/loader-base.js", 917);+mods = [].concat(mods, self.moduleInfo[mod].use);+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 919);+mods.push(mod);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 922);+self.filters = self.filters || {};+ _yuitest_coverline("build/loader-base/loader-base.js", 923);+Y.Array.each(mods, function(mod) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 3)", 923);+_yuitest_coverline("build/loader-base/loader-base.js", 924);+self.filters[mod] = self.FILTER_DEFS.COVERAGE;+ });+ _yuitest_coverline("build/loader-base/loader-base.js", 926);+self.filterName = 'RAW';+ _yuitest_coverline("build/loader-base/loader-base.js", 927);+self.filter = self.FILTER_DEFS[self.filterName];+ }+ }++ },++ /**+ * Returns the skin module name for the specified skin name. If a+ * module name is supplied, the returned skin module name is+ * specific to the module passed in.+ * @method formatSkin+ * @param {string} skin the name of the skin.+ * @param {string} mod optional: the name of a module to skin.+ * @return {string} the full skin module name.+ */+ formatSkin: function(skin, mod) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "formatSkin", 942);+_yuitest_coverline("build/loader-base/loader-base.js", 943);+var s = SKIN_PREFIX + skin;+ _yuitest_coverline("build/loader-base/loader-base.js", 944);+if (mod) {+ _yuitest_coverline("build/loader-base/loader-base.js", 945);+s = s + '-' + mod;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 948);+return s;+ },++ /**+ * Adds the skin def to the module info+ * @method _addSkin+ * @param {string} skin the name of the skin.+ * @param {string} mod the name of the module.+ * @param {string} parent parent module if this is a skin of a+ * submodule or plugin.+ * @return {string} the module name for the skin.+ * @private+ */+ _addSkin: function(skin, mod, parent) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_addSkin", 961);+_yuitest_coverline("build/loader-base/loader-base.js", 962);+var mdef, pkg, name, nmod,+ info = this.moduleInfo,+ sinf = this.skin,+ ext = info[mod] && info[mod].ext;++ // Add a module definition for the module-specific skin css+ _yuitest_coverline("build/loader-base/loader-base.js", 968);+if (mod) {+ _yuitest_coverline("build/loader-base/loader-base.js", 969);+name = this.formatSkin(skin, mod);+ _yuitest_coverline("build/loader-base/loader-base.js", 970);+if (!info[name]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 971);+mdef = info[mod];+ _yuitest_coverline("build/loader-base/loader-base.js", 972);+pkg = mdef.pkg || mod;+ _yuitest_coverline("build/loader-base/loader-base.js", 973);+nmod = {+ skin: true,+ name: name,+ group: mdef.group,+ type: 'css',+ after: sinf.after,+ path: (parent || pkg) + '/' + sinf.base + skin ++ '/' + mod + '.css',+ ext: ext+ };+ _yuitest_coverline("build/loader-base/loader-base.js", 983);+if (mdef.base) {+ _yuitest_coverline("build/loader-base/loader-base.js", 984);+nmod.base = mdef.base;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 986);+if (mdef.configFn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 987);+nmod.configFn = mdef.configFn;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 989);+this.addModule(nmod, name);++ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 994);+return name;+ },+ /**+ * Adds an alias module to the system+ * @method addAlias+ * @param {Array} use An array of modules that makes up this alias+ * @param {String} name The name of the alias+ * @example+ * var loader = new Y.Loader({});+ * loader.addAlias([ 'node', 'yql' ], 'davglass');+ * loader.require(['davglass']);+ * var out = loader.resolve(true);+ *+ * //out.js will contain Node and YQL modules+ */+ addAlias: function(use, name) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "addAlias", 1009);+_yuitest_coverline("build/loader-base/loader-base.js", 1010);+YUI.Env.aliases[name] = use;+ _yuitest_coverline("build/loader-base/loader-base.js", 1011);+this.addModule({+ name: name,+ use: use+ });+ },+ /**+ * Add a new module group+ * @method addGroup+ * @param {Object} config An object containing the group configuration data+ * @param {String} config.name required, the group name+ * @param {String} config.base The base directory for this module group+ * @param {String} config.root The root path to add to each combo resource path+ * @param {Boolean} config.combine Should the request be combined+ * @param {String} config.comboBase Combo service base path+ * @param {Object} config.modules The group of modules+ * @param {String} name the group name.+ * @example+ * var loader = new Y.Loader({});+ * loader.addGroup({+ * name: 'davglass',+ * combine: true,+ * comboBase: '/combo?',+ * root: '',+ * modules: {+ * //Module List here+ * }+ * }, 'davglass');+ */+ addGroup: function(o, name) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "addGroup", 1039);+_yuitest_coverline("build/loader-base/loader-base.js", 1040);+var mods = o.modules,+ self = this, i, v;++ _yuitest_coverline("build/loader-base/loader-base.js", 1043);+name = name || o.name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1044);+o.name = name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1045);+self.groups[name] = o;++ _yuitest_coverline("build/loader-base/loader-base.js", 1047);+if (o.patterns) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1048);+for (i in o.patterns) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1049);+if (o.patterns.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1050);+o.patterns[i].group = name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1051);+self.patterns[i] = o.patterns[i];+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1056);+if (mods) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1057);+for (i in mods) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1058);+if (mods.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1059);+v = mods[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 1060);+if (typeof v === 'string') {+ _yuitest_coverline("build/loader-base/loader-base.js", 1061);+v = { name: i, fullpath: v };+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1063);+v.group = name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1064);+self.addModule(v, i);+ }+ }+ }+ },++ /**+ * Add a new module to the component metadata.+ * @method addModule+ * @param {Object} config An object containing the module data.+ * @param {String} config.name Required, the component name+ * @param {String} config.type Required, the component type (js or css)+ * @param {String} config.path Required, the path to the script from `base`+ * @param {Array} config.requires Array of modules required by this component+ * @param {Array} [config.optional] Array of optional modules for this component+ * @param {Array} [config.supersedes] Array of the modules this component replaces+ * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one+ * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array+ * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup+ * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`+ * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in+ * @param {Object} [config.submodules] Hash of submodules+ * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration.+ * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `["en-GB", "zh-Hans-CN"]`+ * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:+ * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load+ * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded.+ * @param {String} [config.condition.when] Specifies the load order of the conditional module+ * with regard to the position of the trigger module.+ * This should be one of three values: `before`, `after`, or `instead`. The default is `after`.+ * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`+ * @param {Function} [config.configFn] A function to exectute when configuring this module+ * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config.+ * @param {String} [name] The module name, required if not in the module data.+ * @return {Object} the module definition or null if the object passed in did not provide all required attributes.+ */+ addModule: function(o, name) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "addModule", 1100);+_yuitest_coverline("build/loader-base/loader-base.js", 1101);+name = name || o.name;++ _yuitest_coverline("build/loader-base/loader-base.js", 1103);+if (typeof o === 'string') {+ _yuitest_coverline("build/loader-base/loader-base.js", 1104);+o = { name: name, fullpath: o };+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 1108);+var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;++ //Only merge this data if the temp flag is set+ //from an earlier pass from a pattern or else+ //an override module (YUI_config) can not be used to+ //replace a default module.+ _yuitest_coverline("build/loader-base/loader-base.js", 1117);+if (this.moduleInfo[name] && this.moduleInfo[name].temp) {+ //This catches temp modules loaded via a pattern+ // The module will be added twice, once from the pattern and+ // Once from the actual add call, this ensures that properties+ // that were added to the module the first time around (group: gallery)+ // are also added the second time around too.+ _yuitest_coverline("build/loader-base/loader-base.js", 1123);+o = Y.merge(this.moduleInfo[name], o);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1126);+o.name = name;++ _yuitest_coverline("build/loader-base/loader-base.js", 1128);+if (!o || !o.name) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1129);+return null;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1132);+if (!o.type) {+ //Always assume it's javascript unless the CSS pattern is matched.+ _yuitest_coverline("build/loader-base/loader-base.js", 1134);+o.type = JS;+ _yuitest_coverline("build/loader-base/loader-base.js", 1135);+p = o.path || o.fullpath;+ _yuitest_coverline("build/loader-base/loader-base.js", 1136);+if (p && this.REGEX_CSS.test(p)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1137);+o.type = CSS;+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1141);+if (!o.path && !o.fullpath) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1142);+o.path = _path(name, name, o.type);+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1144);+o.supersedes = o.supersedes || o.use;++ _yuitest_coverline("build/loader-base/loader-base.js", 1146);+o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;++ // Handle submodule logic+ _yuitest_coverline("build/loader-base/loader-base.js", 1149);+subs = o.submodules;++ _yuitest_coverline("build/loader-base/loader-base.js", 1151);+this.moduleInfo[name] = o;++ _yuitest_coverline("build/loader-base/loader-base.js", 1153);+o.requires = o.requires || [];++ /*+ Only allowing the cascade of requires information, since+ optional and supersedes are far more fine grained than+ a blanket requires is.+ */+ _yuitest_coverline("build/loader-base/loader-base.js", 1160);+if (this.requires) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1161);+for (i = 0; i < this.requires.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1162);+o.requires.push(this.requires[i]);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1165);+if (o.group && this.groups && this.groups[o.group]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1166);+g = this.groups[o.group];+ _yuitest_coverline("build/loader-base/loader-base.js", 1167);+if (g.requires) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1168);+for (i = 0; i < g.requires.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1169);+o.requires.push(g.requires[i]);+ }+ }+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 1175);+if (!o.defaults) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1176);+o.defaults = {+ requires: o.requires ? [].concat(o.requires) : null,+ supersedes: o.supersedes ? [].concat(o.supersedes) : null,+ optional: o.optional ? [].concat(o.optional) : null+ };+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1183);+if (o.skinnable && o.ext && o.temp) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1184);+skinname = this._addSkin(this.skin.defaultSkin, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1185);+o.requires.unshift(skinname);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1188);+if (o.requires.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1189);+o.requires = this.filterRequires(o.requires) || [];+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1192);+if (!o.langPack && o.lang) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1193);+langs = yArray(o.lang);+ _yuitest_coverline("build/loader-base/loader-base.js", 1194);+for (j = 0; j < langs.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1195);+lang = langs[j];+ _yuitest_coverline("build/loader-base/loader-base.js", 1196);+packName = this.getLangPackName(lang, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1197);+smod = this.moduleInfo[packName];+ _yuitest_coverline("build/loader-base/loader-base.js", 1198);+if (!smod) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1199);+smod = this._addLangPack(lang, o, packName);+ }+ }+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 1205);+if (subs) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1206);+sup = o.supersedes || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 1207);+l = 0;++ _yuitest_coverline("build/loader-base/loader-base.js", 1209);+for (i in subs) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1210);+if (subs.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1211);+s = subs[i];++ _yuitest_coverline("build/loader-base/loader-base.js", 1213);+s.path = s.path || _path(name, i, o.type);+ _yuitest_coverline("build/loader-base/loader-base.js", 1214);+s.pkg = name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1215);+s.group = o.group;++ _yuitest_coverline("build/loader-base/loader-base.js", 1217);+if (s.supersedes) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1218);+sup = sup.concat(s.supersedes);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1221);+smod = this.addModule(s, i);+ _yuitest_coverline("build/loader-base/loader-base.js", 1222);+sup.push(i);++ _yuitest_coverline("build/loader-base/loader-base.js", 1224);+if (smod.skinnable) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1225);+o.skinnable = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1226);+overrides = this.skin.overrides;+ _yuitest_coverline("build/loader-base/loader-base.js", 1227);+if (overrides && overrides[i]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1228);+for (j = 0; j < overrides[i].length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1229);+skinname = this._addSkin(overrides[i][j],+ i, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1231);+sup.push(skinname);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1234);+skinname = this._addSkin(this.skin.defaultSkin,+ i, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1236);+sup.push(skinname);+ }++ // looks like we are expected to work out the metadata+ // for the parent module language packs from what is+ // specified in the child modules.+ _yuitest_coverline("build/loader-base/loader-base.js", 1242);+if (s.lang && s.lang.length) {++ _yuitest_coverline("build/loader-base/loader-base.js", 1244);+langs = yArray(s.lang);+ _yuitest_coverline("build/loader-base/loader-base.js", 1245);+for (j = 0; j < langs.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1246);+lang = langs[j];+ _yuitest_coverline("build/loader-base/loader-base.js", 1247);+packName = this.getLangPackName(lang, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1248);+supName = this.getLangPackName(lang, i);+ _yuitest_coverline("build/loader-base/loader-base.js", 1249);+smod = this.moduleInfo[packName];++ _yuitest_coverline("build/loader-base/loader-base.js", 1251);+if (!smod) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1252);+smod = this._addLangPack(lang, o, packName);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1255);+flatSup = flatSup || yArray.hash(smod.supersedes);++ _yuitest_coverline("build/loader-base/loader-base.js", 1257);+if (!(supName in flatSup)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1258);+smod.supersedes.push(supName);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1261);+o.lang = o.lang || [];++ _yuitest_coverline("build/loader-base/loader-base.js", 1263);+flatLang = flatLang || yArray.hash(o.lang);++ _yuitest_coverline("build/loader-base/loader-base.js", 1265);+if (!(lang in flatLang)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1266);+o.lang.push(lang);+ }++// Add rollup file, need to add to supersedes list too++ // default packages+ _yuitest_coverline("build/loader-base/loader-base.js", 1272);+packName = this.getLangPackName(ROOT_LANG, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1273);+supName = this.getLangPackName(ROOT_LANG, i);++ _yuitest_coverline("build/loader-base/loader-base.js", 1275);+smod = this.moduleInfo[packName];++ _yuitest_coverline("build/loader-base/loader-base.js", 1277);+if (!smod) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1278);+smod = this._addLangPack(lang, o, packName);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1281);+if (!(supName in flatSup)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1282);+smod.supersedes.push(supName);+ }++// Add rollup file, need to add to supersedes list too++ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1290);+l++;+ }+ }+ //o.supersedes = YObject.keys(yArray.hash(sup));+ _yuitest_coverline("build/loader-base/loader-base.js", 1294);+o.supersedes = yArray.dedupe(sup);+ _yuitest_coverline("build/loader-base/loader-base.js", 1295);+if (this.allowRollup) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1296);+o.rollup = (l < 4) ? l : Math.min(l - 1, 4);+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1300);+plugins = o.plugins;+ _yuitest_coverline("build/loader-base/loader-base.js", 1301);+if (plugins) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1302);+for (i in plugins) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1303);+if (plugins.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1304);+plug = plugins[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 1305);+plug.pkg = name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1306);+plug.path = plug.path || _path(name, i, o.type);+ _yuitest_coverline("build/loader-base/loader-base.js", 1307);+plug.requires = plug.requires || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 1308);+plug.group = o.group;+ _yuitest_coverline("build/loader-base/loader-base.js", 1309);+this.addModule(plug, i);+ _yuitest_coverline("build/loader-base/loader-base.js", 1310);+if (o.skinnable) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1311);+this._addSkin(this.skin.defaultSkin, i, name);+ }++ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1318);+if (o.condition) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1319);+t = o.condition.trigger;+ _yuitest_coverline("build/loader-base/loader-base.js", 1320);+if (YUI.Env.aliases[t]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1321);+t = YUI.Env.aliases[t];+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1323);+if (!Y.Lang.isArray(t)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1324);+t = [t];+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1327);+for (i = 0; i < t.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1328);+trigger = t[i];+ _yuitest_coverline("build/loader-base/loader-base.js", 1329);+when = o.condition.when;+ _yuitest_coverline("build/loader-base/loader-base.js", 1330);+conditions[trigger] = conditions[trigger] || {};+ _yuitest_coverline("build/loader-base/loader-base.js", 1331);+conditions[trigger][name] = o.condition;+ // the 'when' attribute can be 'before', 'after', or 'instead'+ // the default is after.+ _yuitest_coverline("build/loader-base/loader-base.js", 1334);+if (when && when !== 'after') {+ _yuitest_coverline("build/loader-base/loader-base.js", 1335);+if (when === 'instead') { // replace the trigger+ _yuitest_coverline("build/loader-base/loader-base.js", 1336);+o.supersedes = o.supersedes || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 1337);+o.supersedes.push(trigger);+ }+ // before the trigger+ // the trigger requires the conditional mod,+ // so it should appear before the conditional+ // mod if we do not intersede.+ } else { // after the trigger+ _yuitest_coverline("build/loader-base/loader-base.js", 1344);+o.after = o.after || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 1345);+o.after.push(trigger);+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1350);+if (o.supersedes) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1351);+o.supersedes = this.filterRequires(o.supersedes);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1354);+if (o.after) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1355);+o.after = this.filterRequires(o.after);+ _yuitest_coverline("build/loader-base/loader-base.js", 1356);+o.after_map = yArray.hash(o.after);+ }++ // this.dirty = true;++ _yuitest_coverline("build/loader-base/loader-base.js", 1361);+if (o.configFn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1362);+ret = o.configFn(o);+ _yuitest_coverline("build/loader-base/loader-base.js", 1363);+if (ret === false) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1364);+delete this.moduleInfo[name];+ _yuitest_coverline("build/loader-base/loader-base.js", 1365);+delete GLOBAL_ENV._renderedMods[name];+ _yuitest_coverline("build/loader-base/loader-base.js", 1366);+o = null;+ }+ }+ //Add to global cache+ _yuitest_coverline("build/loader-base/loader-base.js", 1370);+if (o) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1371);+if (!GLOBAL_ENV._renderedMods) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1372);+GLOBAL_ENV._renderedMods = {};+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1374);+GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);+ _yuitest_coverline("build/loader-base/loader-base.js", 1375);+GLOBAL_ENV._conditions = conditions;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1378);+return o;+ },++ /**+ * Add a requirement for one or more module+ * @method require+ * @param {string[] | string*} what the modules to load.+ */+ require: function(what) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "require", 1386);+_yuitest_coverline("build/loader-base/loader-base.js", 1387);+var a = (typeof what === 'string') ? yArray(arguments) : what;+ _yuitest_coverline("build/loader-base/loader-base.js", 1388);+this.dirty = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1389);+this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a)));++ _yuitest_coverline("build/loader-base/loader-base.js", 1391);+this._explodeRollups();+ },+ /**+ * Grab all the items that were asked for, check to see if the Loader+ * meta-data contains a "use" array. If it doesm remove the asked item and replace it with+ * the content of the "use".+ * This will make asking for: "dd"+ * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"+ * @private+ * @method _explodeRollups+ */+ _explodeRollups: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_explodeRollups", 1402);+_yuitest_coverline("build/loader-base/loader-base.js", 1403);+var self = this, m, m2, i, a, v, len, len2,+ r = self.required;++ _yuitest_coverline("build/loader-base/loader-base.js", 1406);+if (!self.allowRollup) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1407);+for (i in r) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1408);+if (r.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1409);+m = self.getModule(i);+ _yuitest_coverline("build/loader-base/loader-base.js", 1410);+if (m && m.use) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1411);+len = m.use.length;+ _yuitest_coverline("build/loader-base/loader-base.js", 1412);+for (a = 0; a < len; a++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1413);+m2 = self.getModule(m.use[a]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1414);+if (m2 && m2.use) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1415);+len2 = m2.use.length;+ _yuitest_coverline("build/loader-base/loader-base.js", 1416);+for (v = 0; v < len2; v++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1417);+r[m2.use[v]] = true;+ }+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 1420);+r[m.use[a]] = true;+ }+ }+ }+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1426);+self.required = r;+ }++ },+ /**+ * Explodes the required array to remove aliases and replace them with real modules+ * @method filterRequires+ * @param {Array} r The original requires array+ * @return {Array} The new array of exploded requirements+ */+ filterRequires: function(r) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "filterRequires", 1436);+_yuitest_coverline("build/loader-base/loader-base.js", 1437);+if (r) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1438);+if (!Y.Lang.isArray(r)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1439);+r = [r];+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1441);+r = Y.Array(r);+ _yuitest_coverline("build/loader-base/loader-base.js", 1442);+var c = [], i, mod, o, m;++ _yuitest_coverline("build/loader-base/loader-base.js", 1444);+for (i = 0; i < r.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1445);+mod = this.getModule(r[i]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1446);+if (mod && mod.use) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1447);+for (o = 0; o < mod.use.length; o++) {+ //Must walk the other modules in case a module is a rollup of rollups (datatype)+ _yuitest_coverline("build/loader-base/loader-base.js", 1449);+m = this.getModule(mod.use[o]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1450);+if (m && m.use && (m.name !== mod.name)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1451);+c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 1453);+c.push(mod.use[o]);+ }+ }+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 1457);+c.push(r[i]);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1460);+r = c;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1462);+return r;+ },+ /**+ * Returns an object containing properties for all modules required+ * in order to load the requested module+ * @method getRequires+ * @param {object} mod The module definition from moduleInfo.+ * @return {array} the expanded requirement list.+ */+ getRequires: function(mod) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "getRequires", 1471);+_yuitest_coverline("build/loader-base/loader-base.js", 1473);+if (!mod) {+ //console.log('returning no reqs for ' + mod.name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1475);+return NO_REQUIREMENTS;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1478);+if (mod._parsed) {+ //console.log('returning requires for ' + mod.name, mod.requires);+ _yuitest_coverline("build/loader-base/loader-base.js", 1480);+return mod.expanded || NO_REQUIREMENTS;+ }++ //TODO add modue cache here out of scope..++ _yuitest_coverline("build/loader-base/loader-base.js", 1485);+var i, m, j, add, packName, lang, testresults = this.testresults,+ name = mod.name, cond,+ adddef = ON_PAGE[name] && ON_PAGE[name].details,+ d, go, def,+ r, old_mod,+ o, skinmod, skindef, skinpar, skinname,+ intl = mod.lang || mod.intl,+ info = this.moduleInfo,+ ftests = Y.Features && Y.Features.tests.load,+ hash, reparse;++ // console.log(name);++ // pattern match leaves module stub that needs to be filled out+ _yuitest_coverline("build/loader-base/loader-base.js", 1499);+if (mod.temp && adddef) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1500);+old_mod = mod;+ _yuitest_coverline("build/loader-base/loader-base.js", 1501);+mod = this.addModule(adddef, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1502);+mod.group = old_mod.group;+ _yuitest_coverline("build/loader-base/loader-base.js", 1503);+mod.pkg = old_mod.pkg;+ _yuitest_coverline("build/loader-base/loader-base.js", 1504);+delete mod.expanded;+ }++ // console.log('cache: ' + mod.langCache + ' == ' + this.lang);++ //If a skin or a lang is different, reparse..+ _yuitest_coverline("build/loader-base/loader-base.js", 1510);+reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));++ _yuitest_coverline("build/loader-base/loader-base.js", 1512);+if (mod.expanded && !reparse) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1513);+return mod.expanded;+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 1517);+d = [];+ _yuitest_coverline("build/loader-base/loader-base.js", 1518);+hash = {};+ _yuitest_coverline("build/loader-base/loader-base.js", 1519);+r = this.filterRequires(mod.requires);+ _yuitest_coverline("build/loader-base/loader-base.js", 1520);+if (mod.lang) {+ //If a module has a lang attribute, auto add the intl requirement.+ _yuitest_coverline("build/loader-base/loader-base.js", 1522);+d.unshift('intl');+ _yuitest_coverline("build/loader-base/loader-base.js", 1523);+r.unshift('intl');+ _yuitest_coverline("build/loader-base/loader-base.js", 1524);+intl = true;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1526);+o = this.filterRequires(mod.optional);+++ _yuitest_coverline("build/loader-base/loader-base.js", 1529);+mod._parsed = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1530);+mod.langCache = this.lang;+ _yuitest_coverline("build/loader-base/loader-base.js", 1531);+mod.skinCache = this.skin.defaultSkin;++ _yuitest_coverline("build/loader-base/loader-base.js", 1533);+for (i = 0; i < r.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1534);+if (!hash[r[i]]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1535);+d.push(r[i]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1536);+hash[r[i]] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1537);+m = this.getModule(r[i]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1538);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1539);+add = this.getRequires(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 1540);+intl = intl || (m.expanded_map &&+ (INTL in m.expanded_map));+ _yuitest_coverline("build/loader-base/loader-base.js", 1542);+for (j = 0; j < add.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1543);+d.push(add[j]);+ }+ }+ }+ }++ // get the requirements from superseded modules, if any+ _yuitest_coverline("build/loader-base/loader-base.js", 1550);+r = this.filterRequires(mod.supersedes);+ _yuitest_coverline("build/loader-base/loader-base.js", 1551);+if (r) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1552);+for (i = 0; i < r.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1553);+if (!hash[r[i]]) {+ // if this module has submodules, the requirements list is+ // expanded to include the submodules. This is so we can+ // prevent dups when a submodule is already loaded and the+ // parent is requested.+ _yuitest_coverline("build/loader-base/loader-base.js", 1558);+if (mod.submodules) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1559);+d.push(r[i]);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1562);+hash[r[i]] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1563);+m = this.getModule(r[i]);++ _yuitest_coverline("build/loader-base/loader-base.js", 1565);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1566);+add = this.getRequires(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 1567);+intl = intl || (m.expanded_map &&+ (INTL in m.expanded_map));+ _yuitest_coverline("build/loader-base/loader-base.js", 1569);+for (j = 0; j < add.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1570);+d.push(add[j]);+ }+ }+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1577);+if (o && this.loadOptional) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1578);+for (i = 0; i < o.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1579);+if (!hash[o[i]]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1580);+d.push(o[i]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1581);+hash[o[i]] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1582);+m = info[o[i]];+ _yuitest_coverline("build/loader-base/loader-base.js", 1583);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1584);+add = this.getRequires(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 1585);+intl = intl || (m.expanded_map &&+ (INTL in m.expanded_map));+ _yuitest_coverline("build/loader-base/loader-base.js", 1587);+for (j = 0; j < add.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1588);+d.push(add[j]);+ }+ }+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1595);+cond = this.conditions[name];++ _yuitest_coverline("build/loader-base/loader-base.js", 1597);+if (cond) {+ //Set the module to not parsed since we have conditionals and this could change the dependency tree.+ _yuitest_coverline("build/loader-base/loader-base.js", 1599);+mod._parsed = false;+ _yuitest_coverline("build/loader-base/loader-base.js", 1600);+if (testresults && ftests) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1601);+oeach(testresults, function(result, id) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 4)", 1601);+_yuitest_coverline("build/loader-base/loader-base.js", 1602);+var condmod = ftests[id].name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1603);+if (!hash[condmod] && ftests[id].trigger === name) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1604);+if (result && ftests[id]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1605);+hash[condmod] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1606);+d.push(condmod);+ }+ }+ });+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 1611);+for (i in cond) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1612);+if (cond.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1613);+if (!hash[i]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1614);+def = cond[i];+ //first see if they've specfied a ua check+ //then see if they've got a test fn & if it returns true+ //otherwise just having a condition block is enough+ _yuitest_coverline("build/loader-base/loader-base.js", 1618);+go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||+ (def.test && def.test(Y, r)));++ _yuitest_coverline("build/loader-base/loader-base.js", 1621);+if (go) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1622);+hash[i] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1623);+d.push(i);+ _yuitest_coverline("build/loader-base/loader-base.js", 1624);+m = this.getModule(i);+ _yuitest_coverline("build/loader-base/loader-base.js", 1625);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1626);+add = this.getRequires(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 1627);+for (j = 0; j < add.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1628);+d.push(add[j]);+ }++ }+ }+ }+ }+ }+ }+ }++ // Create skin modules+ _yuitest_coverline("build/loader-base/loader-base.js", 1640);+if (mod.skinnable) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1641);+skindef = this.skin.overrides;+ _yuitest_coverline("build/loader-base/loader-base.js", 1642);+for (i in YUI.Env.aliases) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1643);+if (YUI.Env.aliases.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1644);+if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1645);+skinpar = i;+ }+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1649);+if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1650);+skinname = name;+ _yuitest_coverline("build/loader-base/loader-base.js", 1651);+if (skindef[skinpar]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1652);+skinname = skinpar;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1654);+for (i = 0; i < skindef[skinname].length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1655);+skinmod = this._addSkin(skindef[skinname][i], name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1656);+if (!this.isCSSLoaded(skinmod, this._boot)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1657);+d.push(skinmod);+ }+ }+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 1661);+skinmod = this._addSkin(this.skin.defaultSkin, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1662);+if (!this.isCSSLoaded(skinmod, this._boot)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1663);+d.push(skinmod);+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1668);+mod._parsed = false;++ _yuitest_coverline("build/loader-base/loader-base.js", 1670);+if (intl) {++ _yuitest_coverline("build/loader-base/loader-base.js", 1672);+if (mod.lang && !mod.langPack && Y.Intl) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1673);+lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);+ _yuitest_coverline("build/loader-base/loader-base.js", 1674);+packName = this.getLangPackName(lang, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1675);+if (packName) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1676);+d.unshift(packName);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1679);+d.unshift(INTL);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1682);+mod.expanded_map = yArray.hash(d);++ _yuitest_coverline("build/loader-base/loader-base.js", 1684);+mod.expanded = YObject.keys(mod.expanded_map);++ _yuitest_coverline("build/loader-base/loader-base.js", 1686);+return mod.expanded;+ },+ /**+ * Check to see if named css module is already loaded on the page+ * @method isCSSLoaded+ * @param {String} name The name of the css file+ * @return Boolean+ */+ isCSSLoaded: function(name, skip) {+ //TODO - Make this call a batching call with name being an array+ _yuitest_coverfunc("build/loader-base/loader-base.js", "isCSSLoaded", 1694);+_yuitest_coverline("build/loader-base/loader-base.js", 1696);+if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1697);+return false;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1699);+var el = YUI.Env.cssStampEl,+ ret = false,+ mod = YUI.Env._cssLoaded[name],+ style = el.currentStyle; //IE+++ _yuitest_coverline("build/loader-base/loader-base.js", 1705);+if (mod !== undefined) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1706);+return mod;+ }++ //Add the classname to the element+ _yuitest_coverline("build/loader-base/loader-base.js", 1710);+el.className = name;++ _yuitest_coverline("build/loader-base/loader-base.js", 1712);+if (!style) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1713);+style = Y.config.doc.defaultView.getComputedStyle(el, null);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1716);+if (style && style.display === 'none') {+ _yuitest_coverline("build/loader-base/loader-base.js", 1717);+ret = true;+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 1721);+el.className = ''; //Reset the classname to ''++ _yuitest_coverline("build/loader-base/loader-base.js", 1723);+YUI.Env._cssLoaded[name] = ret;++ _yuitest_coverline("build/loader-base/loader-base.js", 1725);+return ret;+ },++ /**+ * Returns a hash of module names the supplied module satisfies.+ * @method getProvides+ * @param {string} name The name of the module.+ * @return {object} what this module provides.+ */+ getProvides: function(name) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "getProvides", 1734);+_yuitest_coverline("build/loader-base/loader-base.js", 1735);+var m = this.getModule(name), o, s;+ // supmap = this.provides;++ _yuitest_coverline("build/loader-base/loader-base.js", 1738);+if (!m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1739);+return NOT_FOUND;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1742);+if (m && !m.provides) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1743);+o = {};+ _yuitest_coverline("build/loader-base/loader-base.js", 1744);+s = m.supersedes;++ _yuitest_coverline("build/loader-base/loader-base.js", 1746);+if (s) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1747);+yArray.each(s, function(v) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 5)", 1747);+_yuitest_coverline("build/loader-base/loader-base.js", 1748);+Y.mix(o, this.getProvides(v));+ }, this);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1752);+o[name] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1753);+m.provides = o;++ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1757);+return m.provides;+ },++ /**+ * Calculates the dependency tree, the result is stored in the sorted+ * property.+ * @method calculate+ * @param {object} o optional options object.+ * @param {string} type optional argument to prune modules.+ */+ calculate: function(o, type) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "calculate", 1767);+_yuitest_coverline("build/loader-base/loader-base.js", 1768);+if (o || type || this.dirty) {++ _yuitest_coverline("build/loader-base/loader-base.js", 1770);+if (o) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1771);+this._config(o);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1774);+if (!this._init) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1775);+this._setup();+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1778);+this._explode();++ _yuitest_coverline("build/loader-base/loader-base.js", 1780);+if (this.allowRollup) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1781);+this._rollup();+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 1783);+this._explodeRollups();+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1785);+this._reduce();+ _yuitest_coverline("build/loader-base/loader-base.js", 1786);+this._sort();+ }+ },+ /**+ * Creates a "psuedo" package for languages provided in the lang array+ * @method _addLangPack+ * @private+ * @param {String} lang The language to create+ * @param {Object} m The module definition to create the language pack around+ * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)+ * @return {Object} The module definition+ */+ _addLangPack: function(lang, m, packName) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_addLangPack", 1798);+_yuitest_coverline("build/loader-base/loader-base.js", 1799);+var name = m.name,+ packPath, conf,+ existing = this.moduleInfo[packName];++ _yuitest_coverline("build/loader-base/loader-base.js", 1803);+if (!existing) {++ _yuitest_coverline("build/loader-base/loader-base.js", 1805);+packPath = _path((m.pkg || name), packName, JS, true);++ _yuitest_coverline("build/loader-base/loader-base.js", 1807);+conf = {+ path: packPath,+ intl: true,+ langPack: true,+ ext: m.ext,+ group: m.group,+ supersedes: []+ };+ _yuitest_coverline("build/loader-base/loader-base.js", 1815);+if (m.root) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1816);+conf.root = m.root;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 1818);+if (m.base) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1819);+conf.base = m.base;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1822);+if (m.configFn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1823);+conf.configFn = m.configFn;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1826);+this.addModule(conf, packName);++ _yuitest_coverline("build/loader-base/loader-base.js", 1828);+if (lang) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1829);+Y.Env.lang = Y.Env.lang || {};+ _yuitest_coverline("build/loader-base/loader-base.js", 1830);+Y.Env.lang[lang] = Y.Env.lang[lang] || {};+ _yuitest_coverline("build/loader-base/loader-base.js", 1831);+Y.Env.lang[lang][name] = true;+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1835);+return this.moduleInfo[packName];+ },++ /**+ * Investigates the current YUI configuration on the page. By default,+ * modules already detected will not be loaded again unless a force+ * option is encountered. Called by calculate()+ * @method _setup+ * @private+ */+ _setup: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_setup", 1845);+_yuitest_coverline("build/loader-base/loader-base.js", 1846);+var info = this.moduleInfo, name, i, j, m, l,+ packName;++ _yuitest_coverline("build/loader-base/loader-base.js", 1849);+for (name in info) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1850);+if (info.hasOwnProperty(name)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1851);+m = info[name];+ _yuitest_coverline("build/loader-base/loader-base.js", 1852);+if (m) {++ // remove dups+ //m.requires = YObject.keys(yArray.hash(m.requires));+ _yuitest_coverline("build/loader-base/loader-base.js", 1856);+m.requires = yArray.dedupe(m.requires);++ // Create lang pack modules+ //if (m.lang && m.lang.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1860);+if (m.lang) {+ // Setup root package if the module has lang defined,+ // it needs to provide a root language pack+ _yuitest_coverline("build/loader-base/loader-base.js", 1863);+packName = this.getLangPackName(ROOT_LANG, name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1864);+this._addLangPack(null, m, packName);+ }++ }+ }+ }+++ //l = Y.merge(this.inserted);+ _yuitest_coverline("build/loader-base/loader-base.js", 1873);+l = {};++ // available modules+ _yuitest_coverline("build/loader-base/loader-base.js", 1876);+if (!this.ignoreRegistered) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1877);+Y.mix(l, GLOBAL_ENV.mods);+ }++ // add the ignore list to the list of loaded packages+ _yuitest_coverline("build/loader-base/loader-base.js", 1881);+if (this.ignore) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1882);+Y.mix(l, yArray.hash(this.ignore));+ }++ // expand the list to include superseded modules+ _yuitest_coverline("build/loader-base/loader-base.js", 1886);+for (j in l) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1887);+if (l.hasOwnProperty(j)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1888);+Y.mix(l, this.getProvides(j));+ }+ }++ // remove modules on the force list from the loaded list+ _yuitest_coverline("build/loader-base/loader-base.js", 1893);+if (this.force) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1894);+for (i = 0; i < this.force.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1895);+if (this.force[i] in l) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1896);+delete l[this.force[i]];+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1901);+Y.mix(this.loaded, l);++ _yuitest_coverline("build/loader-base/loader-base.js", 1903);+this._init = true;+ },++ /**+ * Builds a module name for a language pack+ * @method getLangPackName+ * @param {string} lang the language code.+ * @param {string} mname the module to build it for.+ * @return {string} the language pack module name.+ */+ getLangPackName: function(lang, mname) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "getLangPackName", 1913);+_yuitest_coverline("build/loader-base/loader-base.js", 1914);+return ('lang/' + mname + ((lang) ? '_' + lang : ''));+ },+ /**+ * Inspects the required modules list looking for additional+ * dependencies. Expands the required list to include all+ * required modules. Called by calculate()+ * @method _explode+ * @private+ */+ _explode: function() {+ //TODO Move done out of scope+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_explode", 1923);+_yuitest_coverline("build/loader-base/loader-base.js", 1925);+var r = this.required, m, reqs, done = {},+ self = this, name, expound;++ // the setup phase is over, all modules have been created+ _yuitest_coverline("build/loader-base/loader-base.js", 1929);+self.dirty = false;++ _yuitest_coverline("build/loader-base/loader-base.js", 1931);+self._explodeRollups();+ _yuitest_coverline("build/loader-base/loader-base.js", 1932);+r = self.required;++ _yuitest_coverline("build/loader-base/loader-base.js", 1934);+for (name in r) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1935);+if (r.hasOwnProperty(name)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1936);+if (!done[name]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1937);+done[name] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 1938);+m = self.getModule(name);+ _yuitest_coverline("build/loader-base/loader-base.js", 1939);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1940);+expound = m.expound;++ _yuitest_coverline("build/loader-base/loader-base.js", 1942);+if (expound) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1943);+r[expound] = self.getModule(expound);+ _yuitest_coverline("build/loader-base/loader-base.js", 1944);+reqs = self.getRequires(r[expound]);+ _yuitest_coverline("build/loader-base/loader-base.js", 1945);+Y.mix(r, yArray.hash(reqs));+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1948);+reqs = self.getRequires(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 1949);+Y.mix(r, yArray.hash(reqs));+ }+ }+ }+ }++ },+ /**+ * The default method used to test a module against a pattern+ * @method _patternTest+ * @private+ * @param {String} mname The module being tested+ * @param {String} pname The pattern to match+ */+ _patternTest: function(mname, pname) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_patternTest", 1963);+_yuitest_coverline("build/loader-base/loader-base.js", 1964);+return (mname.indexOf(pname) > -1);+ },+ /**+ * Get's the loader meta data for the requested module+ * @method getModule+ * @param {String} mname The module name to get+ * @return {Object} The module metadata+ */+ getModule: function(mname) {+ //TODO: Remove name check - it's a quick hack to fix pattern WIP+ _yuitest_coverfunc("build/loader-base/loader-base.js", "getModule", 1972);+_yuitest_coverline("build/loader-base/loader-base.js", 1974);+if (!mname) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1975);+return null;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1978);+var p, found, pname,+ m = this.moduleInfo[mname],+ patterns = this.patterns;++ // check the patterns library to see if we should automatically add+ // the module with defaults+ _yuitest_coverline("build/loader-base/loader-base.js", 1984);+if (!m || (m && m.ext)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1985);+for (pname in patterns) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1986);+if (patterns.hasOwnProperty(pname)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1987);+p = patterns[pname];++ //There is no test method, create a default one that tests+ // the pattern against the mod name+ _yuitest_coverline("build/loader-base/loader-base.js", 1991);+if (!p.test) {+ _yuitest_coverline("build/loader-base/loader-base.js", 1992);+p.test = this._patternTest;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 1995);+if (p.test(mname, pname)) {+ // use the metadata supplied for the pattern+ // as the module definition.+ _yuitest_coverline("build/loader-base/loader-base.js", 1998);+found = p;+ _yuitest_coverline("build/loader-base/loader-base.js", 1999);+break;+ }+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2005);+if (!m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2006);+if (found) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2007);+if (p.action) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2008);+p.action.call(this, mname, pname);+ } else {+ // ext true or false?+ _yuitest_coverline("build/loader-base/loader-base.js", 2011);+m = this.addModule(Y.merge(found), mname);+ _yuitest_coverline("build/loader-base/loader-base.js", 2012);+if (found.configFn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2013);+m.configFn = found.configFn;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2015);+m.temp = true;+ }+ }+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 2019);+if (found && m && found.configFn && !m.configFn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2020);+m.configFn = found.configFn;+ _yuitest_coverline("build/loader-base/loader-base.js", 2021);+m.configFn(m);+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2025);+return m;+ },++ // impl in rollup submodule+ _rollup: function() { },++ /**+ * Remove superceded modules and loaded modules. Called by+ * calculate() after we have the mega list of all dependencies+ * @method _reduce+ * @return {object} the reduced dependency hash.+ * @private+ */+ _reduce: function(r) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "_reduce", 2038);+_yuitest_coverline("build/loader-base/loader-base.js", 2040);+r = r || this.required;++ _yuitest_coverline("build/loader-base/loader-base.js", 2042);+var i, j, s, m, type = this.loadType,+ ignore = this.ignore ? yArray.hash(this.ignore) : false;++ _yuitest_coverline("build/loader-base/loader-base.js", 2045);+for (i in r) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2046);+if (r.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2047);+m = this.getModule(i);+ // remove if already loaded+ _yuitest_coverline("build/loader-base/loader-base.js", 2049);+if (((this.loaded[i] || ON_PAGE[i]) &&+ !this.forceMap[i] && !this.ignoreRegistered) ||+ (type && m && m.type !== type)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2052);+delete r[i];+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2054);+if (ignore && ignore[i]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2055);+delete r[i];+ }+ // remove anything this module supersedes+ _yuitest_coverline("build/loader-base/loader-base.js", 2058);+s = m && m.supersedes;+ _yuitest_coverline("build/loader-base/loader-base.js", 2059);+if (s) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2060);+for (j = 0; j < s.length; j++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2061);+if (s[j] in r) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2062);+delete r[s[j]];+ }+ }+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2069);+return r;+ },+ /**+ * Handles the queue when a module has been loaded for all cases+ * @method _finish+ * @private+ * @param {String} msg The message from Loader+ * @param {Boolean} success A boolean denoting success or failure+ */+ _finish: function(msg, success) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "_finish", 2078);+_yuitest_coverline("build/loader-base/loader-base.js", 2080);+_queue.running = false;++ _yuitest_coverline("build/loader-base/loader-base.js", 2082);+var onEnd = this.onEnd;+ _yuitest_coverline("build/loader-base/loader-base.js", 2083);+if (onEnd) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2084);+onEnd.call(this.context, {+ msg: msg,+ data: this.data,+ success: success+ });+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2090);+this._continue();+ },+ /**+ * The default Loader onSuccess handler, calls this.onSuccess with a payload+ * @method _onSuccess+ * @private+ */+ _onSuccess: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_onSuccess", 2097);+_yuitest_coverline("build/loader-base/loader-base.js", 2098);+var self = this, skipped = Y.merge(self.skipped), fn,+ failed = [], rreg = self.requireRegistration,+ success, msg, i, mod;++ _yuitest_coverline("build/loader-base/loader-base.js", 2102);+for (i in skipped) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2103);+if (skipped.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2104);+delete self.inserted[i];+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2108);+self.skipped = {};++ _yuitest_coverline("build/loader-base/loader-base.js", 2110);+for (i in self.inserted) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2111);+if (self.inserted.hasOwnProperty(i)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2112);+mod = self.getModule(i);+ _yuitest_coverline("build/loader-base/loader-base.js", 2113);+if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2114);+failed.push(i);+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 2116);+Y.mix(self.loaded, self.getProvides(i));+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2121);+fn = self.onSuccess;+ _yuitest_coverline("build/loader-base/loader-base.js", 2122);+msg = (failed.length) ? 'notregistered' : 'success';+ _yuitest_coverline("build/loader-base/loader-base.js", 2123);+success = !(failed.length);+ _yuitest_coverline("build/loader-base/loader-base.js", 2124);+if (fn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2125);+fn.call(self.context, {+ msg: msg,+ data: self.data,+ success: success,+ failed: failed,+ skipped: skipped+ });+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2133);+self._finish(msg, success);+ },+ /**+ * The default Loader onProgress handler, calls this.onProgress with a payload+ * @method _onProgress+ * @private+ */+ _onProgress: function(e) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_onProgress", 2140);+_yuitest_coverline("build/loader-base/loader-base.js", 2141);+var self = this, i;+ //set the internal cache to what just came in.+ _yuitest_coverline("build/loader-base/loader-base.js", 2143);+if (e.data && e.data.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2144);+for (i = 0; i < e.data.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2145);+e.data[i] = self.getModule(e.data[i].name);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2148);+if (self.onProgress) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2149);+self.onProgress.call(self.context, {+ name: e.url,+ data: e.data+ });+ }+ },+ /**+ * The default Loader onFailure handler, calls this.onFailure with a payload+ * @method _onFailure+ * @private+ */+ _onFailure: function(o) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_onFailure", 2160);+_yuitest_coverline("build/loader-base/loader-base.js", 2161);+var f = this.onFailure, msg = [], i = 0, len = o.errors.length;++ _yuitest_coverline("build/loader-base/loader-base.js", 2163);+for (i; i < len; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2164);+msg.push(o.errors[i].error);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2167);+msg = msg.join(',');+++ _yuitest_coverline("build/loader-base/loader-base.js", 2170);+if (f) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2171);+f.call(this.context, {+ msg: msg,+ data: this.data,+ success: false+ });+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2178);+this._finish(msg, false);++ },++ /**+ * The default Loader onTimeout handler, calls this.onTimeout with a payload+ * @method _onTimeout+ * @private+ */+ _onTimeout: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_onTimeout", 2187);+_yuitest_coverline("build/loader-base/loader-base.js", 2188);+var f = this.onTimeout;+ _yuitest_coverline("build/loader-base/loader-base.js", 2189);+if (f) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2190);+f.call(this.context, {+ msg: 'timeout',+ data: this.data,+ success: false+ });+ }+ },++ /**+ * Sorts the dependency tree. The last step of calculate()+ * @method _sort+ * @private+ */+ _sort: function() {++ // create an indexed list+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_sort", 2203);+_yuitest_coverline("build/loader-base/loader-base.js", 2206);+var s = YObject.keys(this.required),+ // loaded = this.loaded,+ //TODO Move this out of scope+ done = {},+ p = 0, l, a, b, j, k, moved, doneKey;++ // keep going until we make a pass without moving anything+ _yuitest_coverline("build/loader-base/loader-base.js", 2213);+for (;;) {++ _yuitest_coverline("build/loader-base/loader-base.js", 2215);+l = s.length;+ _yuitest_coverline("build/loader-base/loader-base.js", 2216);+moved = false;++ // start the loop after items that are already sorted+ _yuitest_coverline("build/loader-base/loader-base.js", 2219);+for (j = p; j < l; j++) {++ // check the next module on the list to see if its+ // dependencies have been met+ _yuitest_coverline("build/loader-base/loader-base.js", 2223);+a = s[j];++ // check everything below current item and move if we+ // find a requirement for the current item+ _yuitest_coverline("build/loader-base/loader-base.js", 2227);+for (k = j + 1; k < l; k++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2228);+doneKey = a + s[k];++ _yuitest_coverline("build/loader-base/loader-base.js", 2230);+if (!done[doneKey] && this._requires(a, s[k])) {++ // extract the dependency so we can move it up+ _yuitest_coverline("build/loader-base/loader-base.js", 2233);+b = s.splice(k, 1);++ // insert the dependency above the item that+ // requires it+ _yuitest_coverline("build/loader-base/loader-base.js", 2237);+s.splice(j, 0, b[0]);++ // only swap two dependencies once to short circut+ // circular dependencies+ _yuitest_coverline("build/loader-base/loader-base.js", 2241);+done[doneKey] = true;++ // keep working+ _yuitest_coverline("build/loader-base/loader-base.js", 2244);+moved = true;++ _yuitest_coverline("build/loader-base/loader-base.js", 2246);+break;+ }+ }++ // jump out of loop if we moved something+ _yuitest_coverline("build/loader-base/loader-base.js", 2251);+if (moved) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2252);+break;+ // this item is sorted, move our pointer and keep going+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 2255);+p++;+ }+ }++ // when we make it here and moved is false, we are+ // finished sorting+ _yuitest_coverline("build/loader-base/loader-base.js", 2261);+if (!moved) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2262);+break;+ }++ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2267);+this.sorted = s;+ },++ /**+ * Handles the actual insertion of script/link tags+ * @method _insert+ * @private+ * @param {Object} source The YUI instance the request came from+ * @param {Object} o The metadata to include+ * @param {String} type JS or CSS+ * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta+ */+ _insert: function(source, o, type, skipcalc) {+++ // restore the state at the time of the request+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_insert", 2279);+_yuitest_coverline("build/loader-base/loader-base.js", 2283);+if (source) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2284);+this._config(source);+ }++ // build the dependency list+ // don't include type so we can process CSS and script in+ // one pass when the type is not specified.++ _yuitest_coverline("build/loader-base/loader-base.js", 2291);+var modules = this.resolve(!skipcalc),+ self = this, comp = 0, actions = 0,+ mods = {}, deps, complete;++ _yuitest_coverline("build/loader-base/loader-base.js", 2295);+self._refetch = [];++ _yuitest_coverline("build/loader-base/loader-base.js", 2297);+if (type) {+ //Filter out the opposite type and reset the array so the checks later work+ _yuitest_coverline("build/loader-base/loader-base.js", 2299);+modules[((type === JS) ? CSS : JS)] = [];+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2301);+if (!self.fetchCSS) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2302);+modules.css = [];+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2304);+if (modules.js.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2305);+comp++;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2307);+if (modules.css.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2308);+comp++;+ }++ //console.log('Resolved Modules: ', modules);++ _yuitest_coverline("build/loader-base/loader-base.js", 2313);+complete = function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "complete", 2313);+_yuitest_coverline("build/loader-base/loader-base.js", 2314);+actions++;+ _yuitest_coverline("build/loader-base/loader-base.js", 2315);+var errs = {}, i = 0, o = 0, u = '', fn,+ modName, resMods;++ _yuitest_coverline("build/loader-base/loader-base.js", 2318);+if (d && d.errors) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2319);+for (i = 0; i < d.errors.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2320);+if (d.errors[i].request) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2321);+u = d.errors[i].request.url;+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 2323);+u = d.errors[i];+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2325);+errs[u] = u;+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2329);+if (d && d.data && d.data.length && (d.type === 'success')) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2330);+for (i = 0; i < d.data.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2331);+self.inserted[d.data[i].name] = true;+ //If the external module has a skin or a lang, reprocess it+ _yuitest_coverline("build/loader-base/loader-base.js", 2333);+if (d.data[i].lang || d.data[i].skinnable) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2334);+delete self.inserted[d.data[i].name];+ _yuitest_coverline("build/loader-base/loader-base.js", 2335);+self._refetch.push(d.data[i].name);+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2340);+if (actions === comp) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2341);+self._loading = null;+ _yuitest_coverline("build/loader-base/loader-base.js", 2342);+if (self._refetch.length) {+ //Get the deps for the new meta-data and reprocess+ _yuitest_coverline("build/loader-base/loader-base.js", 2344);+for (i = 0; i < self._refetch.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2345);+deps = self.getRequires(self.getModule(self._refetch[i]));+ _yuitest_coverline("build/loader-base/loader-base.js", 2346);+for (o = 0; o < deps.length; o++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2347);+if (!self.inserted[deps[o]]) {+ //We wouldn't be to this point without the module being here+ _yuitest_coverline("build/loader-base/loader-base.js", 2349);+mods[deps[o]] = deps[o];+ }+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2353);+mods = Y.Object.keys(mods);+ _yuitest_coverline("build/loader-base/loader-base.js", 2354);+if (mods.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2355);+self.require(mods);+ _yuitest_coverline("build/loader-base/loader-base.js", 2356);+resMods = self.resolve(true);+ _yuitest_coverline("build/loader-base/loader-base.js", 2357);+if (resMods.cssMods.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2358);+for (i=0; i < resMods.cssMods.length; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2359);+modName = resMods.cssMods[i].name;+ _yuitest_coverline("build/loader-base/loader-base.js", 2360);+delete YUI.Env._cssLoaded[modName];+ _yuitest_coverline("build/loader-base/loader-base.js", 2361);+if (self.isCSSLoaded(modName)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2362);+self.inserted[modName] = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 2363);+delete self.required[modName];+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2366);+self.sorted = [];+ _yuitest_coverline("build/loader-base/loader-base.js", 2367);+self._sort();+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2369);+d = null; //bail+ _yuitest_coverline("build/loader-base/loader-base.js", 2370);+self._insert(); //insert the new deps+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2373);+if (d && d.fn) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2374);+fn = d.fn;+ _yuitest_coverline("build/loader-base/loader-base.js", 2375);+delete d.fn;+ _yuitest_coverline("build/loader-base/loader-base.js", 2376);+fn.call(self, d);+ }+ }+ };++ _yuitest_coverline("build/loader-base/loader-base.js", 2381);+this._loading = true;++ _yuitest_coverline("build/loader-base/loader-base.js", 2383);+if (!modules.js.length && !modules.css.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2384);+actions = -1;+ _yuitest_coverline("build/loader-base/loader-base.js", 2385);+complete({+ fn: self._onSuccess+ });+ _yuitest_coverline("build/loader-base/loader-base.js", 2388);+return;+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 2392);+if (modules.css.length) { //Load CSS first+ _yuitest_coverline("build/loader-base/loader-base.js", 2393);+Y.Get.css(modules.css, {+ data: modules.cssMods,+ attributes: self.cssAttributes,+ insertBefore: self.insertBefore,+ charset: self.charset,+ timeout: self.timeout,+ context: self,+ onProgress: function(e) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onProgress", 2400);+_yuitest_coverline("build/loader-base/loader-base.js", 2401);+self._onProgress.call(self, e);+ },+ onTimeout: function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onTimeout", 2403);+_yuitest_coverline("build/loader-base/loader-base.js", 2404);+self._onTimeout.call(self, d);+ },+ onSuccess: function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onSuccess", 2406);+_yuitest_coverline("build/loader-base/loader-base.js", 2407);+d.type = 'success';+ _yuitest_coverline("build/loader-base/loader-base.js", 2408);+d.fn = self._onSuccess;+ _yuitest_coverline("build/loader-base/loader-base.js", 2409);+complete.call(self, d);+ },+ onFailure: function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onFailure", 2411);+_yuitest_coverline("build/loader-base/loader-base.js", 2412);+d.type = 'failure';+ _yuitest_coverline("build/loader-base/loader-base.js", 2413);+d.fn = self._onFailure;+ _yuitest_coverline("build/loader-base/loader-base.js", 2414);+complete.call(self, d);+ }+ });+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2419);+if (modules.js.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2420);+Y.Get.js(modules.js, {+ data: modules.jsMods,+ insertBefore: self.insertBefore,+ attributes: self.jsAttributes,+ charset: self.charset,+ timeout: self.timeout,+ autopurge: false,+ context: self,+ async: self.async,+ onProgress: function(e) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onProgress", 2429);+_yuitest_coverline("build/loader-base/loader-base.js", 2430);+self._onProgress.call(self, e);+ },+ onTimeout: function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onTimeout", 2432);+_yuitest_coverline("build/loader-base/loader-base.js", 2433);+self._onTimeout.call(self, d);+ },+ onSuccess: function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onSuccess", 2435);+_yuitest_coverline("build/loader-base/loader-base.js", 2436);+d.type = 'success';+ _yuitest_coverline("build/loader-base/loader-base.js", 2437);+d.fn = self._onSuccess;+ _yuitest_coverline("build/loader-base/loader-base.js", 2438);+complete.call(self, d);+ },+ onFailure: function(d) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onFailure", 2440);+_yuitest_coverline("build/loader-base/loader-base.js", 2441);+d.type = 'failure';+ _yuitest_coverline("build/loader-base/loader-base.js", 2442);+d.fn = self._onFailure;+ _yuitest_coverline("build/loader-base/loader-base.js", 2443);+complete.call(self, d);+ }+ });+ }+ },+ /**+ * Once a loader operation is completely finished, process any additional queued items.+ * @method _continue+ * @private+ */+ _continue: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_continue", 2453);+_yuitest_coverline("build/loader-base/loader-base.js", 2454);+if (!(_queue.running) && _queue.size() > 0) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2455);+_queue.running = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 2456);+_queue.next()();+ }+ },++ /**+ * inserts the requested modules and their dependencies.+ * <code>type</code> can be "js" or "css". Both script and+ * css are inserted if type is not provided.+ * @method insert+ * @param {object} o optional options object.+ * @param {string} type the type of dependency to insert.+ */+ insert: function(o, type, skipsort) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "insert", 2468);+_yuitest_coverline("build/loader-base/loader-base.js", 2469);+var self = this, copy = Y.merge(this);+ _yuitest_coverline("build/loader-base/loader-base.js", 2470);+delete copy.require;+ _yuitest_coverline("build/loader-base/loader-base.js", 2471);+delete copy.dirty;+ _yuitest_coverline("build/loader-base/loader-base.js", 2472);+_queue.add(function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "(anonymous 6)", 2472);+_yuitest_coverline("build/loader-base/loader-base.js", 2473);+self._insert(copy, o, type, skipsort);+ });+ _yuitest_coverline("build/loader-base/loader-base.js", 2475);+this._continue();+ },++ /**+ * Executed every time a module is loaded, and if we are in a load+ * cycle, we attempt to load the next script. Public so that it+ * is possible to call this if using a method other than+ * Y.register to determine when scripts are fully loaded+ * @method loadNext+ * @deprecated+ * @param {string} mname optional the name of the module that has+ * been loaded (which is usually why it is time to load the next+ * one).+ */+ loadNext: function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "loadNext", 2489);+_yuitest_coverline("build/loader-base/loader-base.js", 2490);+return;+ },++ /**+ * Apply filter defined for this instance to a url/path+ * @method _filter+ * @param {string} u the string to filter.+ * @param {string} name the name of the module, if we are processing+ * a single module as opposed to a combined url.+ * @return {string} the filtered string.+ * @private+ */+ _filter: function(u, name, group) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_filter", 2502);+_yuitest_coverline("build/loader-base/loader-base.js", 2503);+var f = this.filter,+ hasFilter = name && (name in this.filters),+ modFilter = hasFilter && this.filters[name],+ groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);++ _yuitest_coverline("build/loader-base/loader-base.js", 2508);+if (groupName && this.groups[groupName] && this.groups[groupName].filter) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2509);+modFilter = this.groups[groupName].filter;+ _yuitest_coverline("build/loader-base/loader-base.js", 2510);+hasFilter = true;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2513);+if (u) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2514);+if (hasFilter) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2515);+f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2517);+if (f) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2518);+u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2521);+return u;+ },++ /**+ * Generates the full url for a module+ * @method _url+ * @param {string} path the path fragment.+ * @param {String} name The name of the module+ * @param {String} [base=self.base] The base url to use+ * @return {string} the full url.+ * @private+ */+ _url: function(path, name, base) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "_url", 2533);+_yuitest_coverline("build/loader-base/loader-base.js", 2534);+return this._filter((base || this.base || '') + path, name);+ },+ /**+ * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules.+ * @method resolve+ * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else+ * @param {Array} [s=loader.sorted] An override for the loader.sorted array+ * @return {Object} Object hash (js and css) of two arrays of file lists+ * @example This method can be used as an off-line dep calculator+ *+ * var Y = YUI();+ * var loader = new Y.Loader({+ * filter: 'debug',+ * base: '../../',+ * root: 'build/',+ * combine: true,+ * require: ['node', 'dd', 'console']+ * });+ * var out = loader.resolve(true);+ *+ */+ resolve: function(calc, s) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "resolve", 2555);+_yuitest_coverline("build/loader-base/loader-base.js", 2557);+var len, i, m, url, group, groupName, j, frag,+ comboSource, comboSources, mods, comboBase,+ base, urls, u = [], tmpBase, baseLen, resCombos = {},+ self = this, comboSep, maxURLLength,+ inserted = (self.ignoreRegistered) ? {} : self.inserted,+ resolved = { js: [], jsMods: [], css: [], cssMods: [] },+ type = self.loadType || 'js', addSingle;++ _yuitest_coverline("build/loader-base/loader-base.js", 2565);+if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2566);+self._resetModules();+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2569);+if (calc) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2570);+self.calculate();+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2572);+s = s || self.sorted;++ _yuitest_coverline("build/loader-base/loader-base.js", 2574);+addSingle = function(m) {++ _yuitest_coverfunc("build/loader-base/loader-base.js", "addSingle", 2574);+_yuitest_coverline("build/loader-base/loader-base.js", 2576);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2577);+group = (m.group && self.groups[m.group]) || NOT_FOUND;++ //Always assume it's async+ _yuitest_coverline("build/loader-base/loader-base.js", 2580);+if (group.async === false) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2581);+m.async = group.async;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2584);+url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :+ self._url(m.path, s[i], group.base || m.base);++ _yuitest_coverline("build/loader-base/loader-base.js", 2587);+if (m.attributes || m.async === false) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2588);+url = {+ url: url,+ async: m.async+ };+ _yuitest_coverline("build/loader-base/loader-base.js", 2592);+if (m.attributes) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2593);+url.attributes = m.attributes;+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2596);+resolved[m.type].push(url);+ _yuitest_coverline("build/loader-base/loader-base.js", 2597);+resolved[m.type + 'Mods'].push(m);+ } else {+ }++ };++ _yuitest_coverline("build/loader-base/loader-base.js", 2603);+len = s.length;++ // the default combo base+ _yuitest_coverline("build/loader-base/loader-base.js", 2606);+comboBase = self.comboBase;++ _yuitest_coverline("build/loader-base/loader-base.js", 2608);+url = comboBase;++ _yuitest_coverline("build/loader-base/loader-base.js", 2610);+comboSources = {};++ _yuitest_coverline("build/loader-base/loader-base.js", 2612);+for (i = 0; i < len; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2613);+comboSource = comboBase;+ _yuitest_coverline("build/loader-base/loader-base.js", 2614);+m = self.getModule(s[i]);+ _yuitest_coverline("build/loader-base/loader-base.js", 2615);+groupName = m && m.group;+ _yuitest_coverline("build/loader-base/loader-base.js", 2616);+group = self.groups[groupName];+ _yuitest_coverline("build/loader-base/loader-base.js", 2617);+if (groupName && group) {++ _yuitest_coverline("build/loader-base/loader-base.js", 2619);+if (!group.combine || m.fullpath) {+ //This is not a combo module, skip it and load it singly later.+ _yuitest_coverline("build/loader-base/loader-base.js", 2621);+addSingle(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 2622);+continue;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2624);+m.combine = true;+ _yuitest_coverline("build/loader-base/loader-base.js", 2625);+if (group.comboBase) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2626);+comboSource = group.comboBase;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2629);+if ("root" in group && L.isValue(group.root)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2630);+m.root = group.root;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2632);+m.comboSep = group.comboSep || self.comboSep;+ _yuitest_coverline("build/loader-base/loader-base.js", 2633);+m.maxURLLength = group.maxURLLength || self.maxURLLength;+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 2635);+if (!self.combine) {+ //This is not a combo module, skip it and load it singly later.+ _yuitest_coverline("build/loader-base/loader-base.js", 2637);+addSingle(m);+ _yuitest_coverline("build/loader-base/loader-base.js", 2638);+continue;+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2642);+comboSources[comboSource] = comboSources[comboSource] || [];+ _yuitest_coverline("build/loader-base/loader-base.js", 2643);+comboSources[comboSource].push(m);+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2646);+for (j in comboSources) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2647);+if (comboSources.hasOwnProperty(j)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2648);+resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };+ _yuitest_coverline("build/loader-base/loader-base.js", 2649);+url = j;+ _yuitest_coverline("build/loader-base/loader-base.js", 2650);+mods = comboSources[j];+ _yuitest_coverline("build/loader-base/loader-base.js", 2651);+len = mods.length;++ _yuitest_coverline("build/loader-base/loader-base.js", 2653);+if (len) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2654);+for (i = 0; i < len; i++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2655);+if (inserted[mods[i]]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2656);+continue;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2658);+m = mods[i];+ // Do not try to combine non-yui JS unless combo def+ // is found+ _yuitest_coverline("build/loader-base/loader-base.js", 2661);+if (m && (m.combine || !m.ext)) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2662);+resCombos[j].comboSep = m.comboSep;+ _yuitest_coverline("build/loader-base/loader-base.js", 2663);+resCombos[j].group = m.group;+ _yuitest_coverline("build/loader-base/loader-base.js", 2664);+resCombos[j].maxURLLength = m.maxURLLength;+ _yuitest_coverline("build/loader-base/loader-base.js", 2665);+frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);+ _yuitest_coverline("build/loader-base/loader-base.js", 2666);+frag = self._filter(frag, m.name);+ _yuitest_coverline("build/loader-base/loader-base.js", 2667);+resCombos[j][m.type].push(frag);+ _yuitest_coverline("build/loader-base/loader-base.js", 2668);+resCombos[j][m.type + 'Mods'].push(m);+ } else {+ //Add them to the next process..+ _yuitest_coverline("build/loader-base/loader-base.js", 2671);+if (mods[i]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2672);+addSingle(mods[i]);+ }+ }++ }+ }+ }+ }+++ _yuitest_coverline("build/loader-base/loader-base.js", 2682);+for (j in resCombos) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2683);+base = j;+ _yuitest_coverline("build/loader-base/loader-base.js", 2684);+comboSep = resCombos[base].comboSep || self.comboSep;+ _yuitest_coverline("build/loader-base/loader-base.js", 2685);+maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;+ _yuitest_coverline("build/loader-base/loader-base.js", 2686);+for (type in resCombos[base]) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2687);+if (type === JS || type === CSS) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2688);+urls = resCombos[base][type];+ _yuitest_coverline("build/loader-base/loader-base.js", 2689);+mods = resCombos[base][type + 'Mods'];+ _yuitest_coverline("build/loader-base/loader-base.js", 2690);+len = urls.length;+ _yuitest_coverline("build/loader-base/loader-base.js", 2691);+tmpBase = base + urls.join(comboSep);+ _yuitest_coverline("build/loader-base/loader-base.js", 2692);+baseLen = tmpBase.length;+ _yuitest_coverline("build/loader-base/loader-base.js", 2693);+if (maxURLLength <= base.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2694);+maxURLLength = MAX_URL_LENGTH;+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2697);+if (len) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2698);+if (baseLen > maxURLLength) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2699);+u = [];+ _yuitest_coverline("build/loader-base/loader-base.js", 2700);+for (s = 0; s < len; s++) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2701);+u.push(urls[s]);+ _yuitest_coverline("build/loader-base/loader-base.js", 2702);+tmpBase = base + u.join(comboSep);++ _yuitest_coverline("build/loader-base/loader-base.js", 2704);+if (tmpBase.length > maxURLLength) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2705);+m = u.pop();+ _yuitest_coverline("build/loader-base/loader-base.js", 2706);+tmpBase = base + u.join(comboSep);+ _yuitest_coverline("build/loader-base/loader-base.js", 2707);+resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));+ _yuitest_coverline("build/loader-base/loader-base.js", 2708);+u = [];+ _yuitest_coverline("build/loader-base/loader-base.js", 2709);+if (m) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2710);+u.push(m);+ }+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2714);+if (u.length) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2715);+tmpBase = base + u.join(comboSep);+ _yuitest_coverline("build/loader-base/loader-base.js", 2716);+resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));+ }+ } else {+ _yuitest_coverline("build/loader-base/loader-base.js", 2719);+resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));+ }+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2722);+resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);+ }+ }+ }++ _yuitest_coverline("build/loader-base/loader-base.js", 2727);+resCombos = null;++ _yuitest_coverline("build/loader-base/loader-base.js", 2729);+return resolved;+ },+ /**+ Shortcut to calculate, resolve and load all modules.++ var loader = new Y.Loader({+ ignoreRegistered: true,+ modules: {+ mod: {+ path: 'mod.js'+ }+ },+ requires: [ 'mod' ]+ });+ loader.load(function() {+ console.log('All modules have loaded..');+ });+++ @method load+ @param {Callback} cb Executed after all load operations are complete+ */+ load: function(cb) {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "load", 2751);+_yuitest_coverline("build/loader-base/loader-base.js", 2752);+if (!cb) {+ _yuitest_coverline("build/loader-base/loader-base.js", 2753);+return;+ }+ _yuitest_coverline("build/loader-base/loader-base.js", 2755);+var self = this,+ out = self.resolve(true);++ _yuitest_coverline("build/loader-base/loader-base.js", 2758);+self.data = out;++ _yuitest_coverline("build/loader-base/loader-base.js", 2760);+self.onEnd = function() {+ _yuitest_coverfunc("build/loader-base/loader-base.js", "onEnd", 2760);+_yuitest_coverline("build/loader-base/loader-base.js", 2761);+cb.apply(self.context || self, arguments);+ };++ _yuitest_coverline("build/loader-base/loader-base.js", 2764);+self.insert();+ }+};++++}, '3.7.3', {"requires": ["get", "features"]});
bundle/loader-base/loader-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -41,7 +41,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -104,7 +104,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -132,14 +132,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -182,7 +181,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -213,7 +212,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -339,7 +338,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -491,7 +490,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -529,7 +528,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -543,14 +542,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -662,15 +661,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -707,7 +708,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -758,7 +759,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -824,13 +825,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -843,15 +844,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -861,7 +864,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { // Y.log('group: ' + j);@@ -878,7 +881,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -891,9 +894,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -909,16 +912,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -933,14 +935,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -1117,7 +1112,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -1140,7 +1141,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { Y.log('Auto determined module type as CSS', 'warn', 'loader'); o.type = CSS;@@ -1155,16 +1156,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -1197,13 +1194,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1254,7 +1251,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1265,7 +1262,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -1273,7 +1270,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -1305,8 +1302,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -1346,15 +1343,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -1368,7 +1365,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -1400,15 +1397,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -1501,7 +1498,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -1521,7 +1518,7 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); @@ -1529,8 +1526,8 @@ //Y.log('Already expanded ' + name + ', ' + mod.expanded); return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -1620,7 +1617,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -1700,7 +1697,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -1723,7 +1720,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { //Y.log('isCSSLoaded was cached for ' + name, 'warn', 'loader'); return mod;@@ -1768,7 +1765,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -1876,8 +1873,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -1903,7 +1900,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -1947,30 +1944,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -2012,7 +2009,7 @@ if (patterns.hasOwnProperty(pname)) { // Y.log('testing pattern ' + i); p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -2070,7 +2067,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -2078,7 +2075,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -2130,7 +2127,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -2138,11 +2135,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -2191,7 +2188,7 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); }@@ -2199,7 +2196,7 @@ msg = msg.join(','); Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');- + if (f) { f.call(this.context, { msg: msg,@@ -2207,7 +2204,7 @@ success: false }); }- + this._finish(msg, false); },@@ -2322,13 +2319,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -2348,7 +2342,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -2363,7 +2357,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -2430,8 +2424,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.log('Loading CSS modules', 'info', 'loader'); Y.Get.css(modules.css, {@@ -2533,7 +2527,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { Y.log('loadNext was called..', 'error', 'loader'); return; },@@ -2602,15 +2596,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -2619,11 +2613,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -2631,7 +2625,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -2646,7 +2640,7 @@ } else { Y.log('Undefined Module', 'warn', 'loader'); }- + }; len = s.length;@@ -2667,7 +2661,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2684,7 +2677,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2700,7 +2692,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -2720,7 +2712,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -2747,7 +2738,7 @@ Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader'); maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');@@ -2810,7 +2801,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -2823,4 +2814,4 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]});
bundle/loader-base/loader-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.09.19-20-07",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S,x=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){var r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null;s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!=r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type==u&&!f.ext&&f.type==u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n=="require")f.require(i);else if(n=="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n=="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n=="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n=="gallery"?this.groups.gallery.update(i,t):n=="yui2"||n=="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o=="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName=="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){var l=[];for(n=0;n<f.coverage.length;n++){var c=f.coverage[n];f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c)}f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}f.lang},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t}),this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;if(!t.type){t.type=a;var r=t.path||t.fullpath;r&&this.REGEX_CSS.test(r)&&(t.type=u)}!t.path&&!t.fullpath&&(t.path=x(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0;var i=t.submodules,o,f,l,c,p,d,m,g,y,b,w,E,S,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(o=0;o<this.requires.length;o++)t.requires.push(this.requires[o]);if(t.group&&this.groups&&this.groups[t.group]){O=this.groups[t.group];if(O.requires)for(o=0;o<O.requires.length;o++)t.requires.push(O.requires[o])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(L=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(L)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){b=v(t.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w))}if(i){c=t.supersedes||[],f=0;for(o in i)if(i.hasOwnProperty(o)){p=i[o],p.path=p.path||x(n,o,t.type),p.pkg=n,p.group=t.group,p.supersedes&&(c=c.concat(p.supersedes)),d=this.addModule(p,o),c.push(o);if(d.skinnable){t.skinnable=!0,k=this.skin.overrides;if(k&&k[o])for(y=0;y<k[o].length;y++)L=this._addSkin(k[o][y],o,n),c.push(L);L=this._addSkin(this.skin.defaultSkin,o,n),c.push(L)}if(p.lang&&p.lang.length){b=v(p.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),E=this.getLangPackName(N,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),S=S||v.hash(d.supersedes),E in S||d.supersedes.push(E),t.lang=t.lang||[],T=T||v.hash(t.lang),N in T||t.lang.push(N),w=this.getLangPackName(h,n),E=this.getLangPackName(h,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),E in S||d.supersedes.push(E)}f++}t.supersedes=v.dedupe(c),this.allowRollup&&(t.rollup=f<4?f:Math.min(f-1,4))}m=t.plugins;if(m)for(o in m)m.hasOwnProperty(o)&&(g=m[o],g.pkg=n,g.path=g.path||x(n,o,t.type),g.requires=g.requires||[],g.group=t.group,this.addModule(g,o),t.skinnable&&this._addSkin(this.skin.defaultSkin,o,n));if(t.condition){l=t.condition.trigger,YUI.Env.aliases[l]&&(l=YUI.Env.aliases[l]),e.Lang.isArray(l)||(l=[l]);for(o=0;o<l.length;o++)_=l[o],A=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,A&&A!="after"?A=="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(C=t.configFn(t),C===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A,O,M=t.lang||t.intl,_=this.moduleInfo,D=e.Features&&e.Features.tests.load,P,H;t.temp&&g&&(N=t,t=this.addModule(g,c),t.group=N.group,t.pkg=N.pkg,delete t.expanded),H=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!H)return t.expanded;y=[],P={},T=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),T.unshift("intl"),M=!0),C=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<T.length;n++)if(!P[T[n]]){y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}T=this.filterRequires(t.supersedes);if(T)for(n=0;n<T.length;n++)if(!P[T[n]]){t.submodules&&y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(C&&this.loadOptional)for(n=0;n<C.length;n++)if(!P[C[n]]){y.push(C[n]),P[C[n]]=!0,i=_[C[n]];if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&D)d(l,function(e,t){var n=D[t].name;!P[n]&&D[t].trigger==c&&e&&D[t]&&(P[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!P[n]){x=m[n],S=x&&(!x.ua&&!x.test||x.ua&&e.UA[x.ua]||x.test&&x.test(e,T));if(S){P[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){L=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(A=n);if(L&&(L[c]||A&&L[A])){O=c,L[A]&&(O=A);for(n=0;n<L[O].length;n++)k=this._addSkin(L[O][n],c),this.isCSSLoaded(k,this._boot)||y.push(k)}else k=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(k,this._boot)||y.push(k)}return t._parsed=!1,M&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=x(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)if(t.hasOwnProperty(o)&&!i[o]){i[o]=!0,n=s.getModule(o);if(n){var u=n.expound;u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r))}}},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!=s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!=a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t),!i;var s=this.resolve(!i),o=this,f=0,l=0,c={},h;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++;var p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}};this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(e){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S,x,T,N=[],C,k,A={},O=this,M,_,D=[],P=O.ignoreRegistered?{}:O.inserted,H={js:[],jsMods:[],css:[],cssMods:[]},B=O.loadType||"js";(O.skin.overrides||O.skin.defaultSkin!==l||O.ignoreRegistered)&&O._resetModules(),e&&O.calculate(),t=t||O.sorted;var j=function(e){if(e){d=e.group&&O.groups[e.group]||n,d.async===!1&&(e.async=d.async),f=e.fullpath?O._filter(e.fullpath,t[s]):O._url(e.path,t[s],d.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);H[e.type].push(f),H[e.type+"Mods"].push(e)}};r=t.length,S=O.comboBase,f=S,w={};for(s=0;s<r;s++){y=S,o=O.getModule(t[s]),v=o&&o.group,d=O.groups[v];if(v&&d){if(!d.combine||o.fullpath){j(o);continue}o.combine=!0,d.comboBase&&(y=d.comboBase),"root"in d&&b.isValue(d.root)&&(o.root=d.root),o.comboSep=d.comboSep||O.comboSep,o.maxURLLength=d.maxURLLength||O.maxURLLength}else if(!O.combine){j(o);continue}w[y]=w[y]||[],w[y].push(o)}for(m in w)if(w.hasOwnProperty(m)){A[m]=A[m]||{js:[],jsMods:[],css:[],cssMods:[]},f=m,E=w[m],r=E.length;if(r)for(s=0;s<r;s++){if(P[E[s]])continue;o=E[s],o&&(o.combine||!o.ext)?(A[m].comboSep=o.comboSep,A[m].group=o.group,A[m].maxURLLength=o.maxURLLength,g=(b.isValue(o.root)?o.root:O.root)+(o.path||o.fullpath),g=O._filter(g,o.name),A[m][o.type].push(g),A[m][o.type+"Mods"].push(o)):E[s]&&j(E[s])}}for(m in A){x=m,M=A[x].comboSep||O.comboSep,_=A[x].maxURLLength||O.maxURLLength;for(B in A[x])if(B===a||B===u){T=A[x][B],E=A[x][B+"Mods"],r=T.length,C=x+T.join(M),k=C.length,_<=x.length&&(_=i);if(r)if(k>_){N=[];for(t=0;t<r;t++)N.push(T[t]),C=x+N.join(M),C.length>_&&(o=N.pop(),C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)),N=[],o&&N.push(o));N.length&&(C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)))}else H[B].push(O._filter(C,null,A[x].group));H[B+"Mods"]=H[B+"Mods"].concat(E)}}return A=null,H},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.2",{requires:["get","features"]});+YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.10.10-19-59",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n,r,i,s;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null,s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!==r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type===u&&!f.ext&&f.type===u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this,l=[],c;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n==="require")f.require(i);else if(n==="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n==="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n==="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n==="gallery"?this.groups.gallery.update(i,t):n==="yui2"||n==="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o==="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName==="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){for(n=0;n<f.coverage.length;n++)c=f.coverage[n],f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c);f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t});var r,i,o,f,l,c,p,d,m,g,y,b,w,E,x,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;t.type||(t.type=a,O=t.path||t.fullpath,O&&this.REGEX_CSS.test(O)&&(t.type=u)),!t.path&&!t.fullpath&&(t.path=S(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0,r=t.submodules,this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(i=0;i<this.requires.length;i++)t.requires.push(this.requires[i]);if(t.group&&this.groups&&this.groups[t.group]){A=this.groups[t.group];if(A.requires)for(i=0;i<A.requires.length;i++)t.requires.push(A.requires[i])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(k=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(k)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){y=v(t.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b))}if(r){l=t.supersedes||[],o=0;for(i in r)if(r.hasOwnProperty(i)){c=r[i],c.path=c.path||S(n,i,t.type),c.pkg=n,c.group=t.group,c.supersedes&&(l=l.concat(c.supersedes)),p=this.addModule(c,i),l.push(i);if(p.skinnable){t.skinnable=!0,C=this.skin.overrides;if(C&&C[i])for(g=0;g<C[i].length;g++)k=this._addSkin(C[i][g],i,n),l.push(k);k=this._addSkin(this.skin.defaultSkin,i,n),l.push(k)}if(c.lang&&c.lang.length){y=v(c.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),w=this.getLangPackName(T,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),E=E||v.hash(p.supersedes),w in E||p.supersedes.push(w),t.lang=t.lang||[],x=x||v.hash(t.lang),T in x||t.lang.push(T),b=this.getLangPackName(h,n),w=this.getLangPackName(h,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),w in E||p.supersedes.push(w)}o++}t.supersedes=v.dedupe(l),this.allowRollup&&(t.rollup=o<4?o:Math.min(o-1,4))}d=t.plugins;if(d)for(i in d)d.hasOwnProperty(i)&&(m=d[i],m.pkg=n,m.path=m.path||S(n,i,t.type),m.requires=m.requires||[],m.group=t.group,this.addModule(m,i),t.skinnable&&this._addSkin(this.skin.defaultSkin,i,n));if(t.condition){f=t.condition.trigger,YUI.Env.aliases[f]&&(f=YUI.Env.aliases[f]),e.Lang.isArray(f)||(f=[f]);for(i=0;i<f.length;i++)_=f[i],L=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,L&&L!=="after"?L==="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(N=t.configFn(t),N===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A=t.lang||t.intl,O=this.moduleInfo,M=e.Features&&e.Features.tests.load,_,D;t.temp&&g&&(x=t,t=this.addModule(g,c),t.group=x.group,t.pkg=x.pkg,delete t.expanded),D=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!D)return t.expanded;y=[],_={},S=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),S.unshift("intl"),A=!0),T=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<S.length;n++)if(!_[S[n]]){y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}S=this.filterRequires(t.supersedes);if(S)for(n=0;n<S.length;n++)if(!_[S[n]]){t.submodules&&y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(T&&this.loadOptional)for(n=0;n<T.length;n++)if(!_[T[n]]){y.push(T[n]),_[T[n]]=!0,i=O[T[n]];if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&M)d(l,function(e,t){var n=M[t].name;!_[n]&&M[t].trigger===c&&e&&M[t]&&(_[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!_[n]){E=m[n],b=E&&(!E.ua&&!E.test||E.ua&&e.UA[E.ua]||E.test&&E.test(e,S));if(b){_[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){C=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(k=n);if(C&&(C[c]||k&&C[k])){L=c,C[k]&&(L=k);for(n=0;n<C[L].length;n++)N=this._addSkin(C[L][n],c),this.isCSSLoaded(N,this._boot)||y.push(N)}else N=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(N,this._boot)||y.push(N)}return t._parsed=!1,A&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=S(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o,u;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)t.hasOwnProperty(o)&&(i[o]||(i[o]=!0,n=s.getModule(o),n&&(u=n.expound,u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r)))))},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!==s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!==a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t);var s=this.resolve(!i),o=this,f=0,l=0,c={},h,p;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++,p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}},this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S=[],x,T,N={},C=this,k,A,O=C.ignoreRegistered?{}:C.inserted,M={js:[],jsMods:[],css:[],cssMods:[]},_=C.loadType||"js",D;(C.skin.overrides||C.skin.defaultSkin!==l||C.ignoreRegistered)&&C._resetModules(),e&&C.calculate(),t=t||C.sorted,D=function(e){if(e){c=e.group&&C.groups[e.group]||n,c.async===!1&&(e.async=c.async),f=e.fullpath?C._filter(e.fullpath,t[s]):C._url(e.path,t[s],c.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);M[e.type].push(f),M[e.type+"Mods"].push(e)}},r=t.length,y=C.comboBase,f=y,m={};for(s=0;s<r;s++){v=y,o=C.getModule(t[s]),h=o&&o.group,c=C.groups[h];if(h&&c){if(!c.combine||o.fullpath){D(o);continue}o.combine=!0,c.comboBase&&(v=c.comboBase),"root"in c&&b.isValue(c.root)&&(o.root=c.root),o.comboSep=c.comboSep||C.comboSep,o.maxURLLength=c.maxURLLength||C.maxURLLength}else if(!C.combine){D(o);continue}m[v]=m[v]||[],m[v].push(o)}for(p in m)if(m.hasOwnProperty(p)){N[p]=N[p]||{js:[],jsMods:[],css:[],cssMods:[]},f=p,g=m[p],r=g.length;if(r)for(s=0;s<r;s++){if(O[g[s]])continue;o=g[s],o&&(o.combine||!o.ext)?(N[p].comboSep=o.comboSep,N[p].group=o.group,N[p].maxURLLength=o.maxURLLength,d=(b.isValue(o.root)?o.root:C.root)+(o.path||o.fullpath),d=C._filter(d,o.name),N[p][o.type].push(d),N[p][o.type+"Mods"].push(o)):g[s]&&D(g[s])}}for(p in N){w=p,k=N[w].comboSep||C.comboSep,A=N[w].maxURLLength||C.maxURLLength;for(_ in N[w])if(_===a||_===u){E=N[w][_],g=N[w][_+"Mods"],r=E.length,x=w+E.join(k),T=x.length,A<=w.length&&(A=i);if(r)if(T>A){S=[];for(t=0;t<r;t++)S.push(E[t]),x=w+S.join(k),x.length>A&&(o=S.pop(),x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)),S=[],o&&S.push(o));S.length&&(x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)))}else M[_].push(C._filter(x,null,N[w].group));M[_+"Mods"]=M[_+"Mods"].concat(g)}}return N=null,M},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.3",{requires:["get","features"]});
bundle/loader-base/loader-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -41,7 +41,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -104,7 +104,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -132,14 +132,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -182,7 +181,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -213,7 +212,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -339,7 +338,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -491,7 +490,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -529,7 +528,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -543,14 +542,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -662,15 +661,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -707,7 +708,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -757,7 +758,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -823,13 +824,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -842,15 +843,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -860,7 +863,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { groupName = j;@@ -876,7 +879,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -889,9 +892,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -907,16 +910,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -931,14 +933,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -1114,7 +1109,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -1137,7 +1138,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { o.type = CSS; }@@ -1151,16 +1152,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -1193,13 +1190,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1250,7 +1247,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1261,7 +1258,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -1269,7 +1266,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -1299,8 +1296,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -1340,15 +1337,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -1362,7 +1359,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -1393,15 +1390,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -1494,7 +1491,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -1514,15 +1511,15 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); if (mod.expanded && !reparse) { return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -1609,7 +1606,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -1688,7 +1685,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -1710,7 +1707,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { return mod; }@@ -1753,7 +1750,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -1861,8 +1858,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -1888,7 +1885,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -1932,30 +1929,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -1994,7 +1991,7 @@ for (pname in patterns) { if (patterns.hasOwnProperty(pname)) { p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -2049,7 +2046,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -2057,7 +2054,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -2107,7 +2104,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -2115,11 +2112,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -2168,14 +2165,14 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); } msg = msg.join(','); - + if (f) { f.call(this.context, { msg: msg,@@ -2183,7 +2180,7 @@ success: false }); }- + this._finish(msg, false); },@@ -2296,13 +2293,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -2322,7 +2316,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -2337,7 +2331,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -2399,8 +2393,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.Get.css(modules.css, { data: modules.cssMods,@@ -2498,7 +2492,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { return; }, @@ -2566,15 +2560,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -2583,11 +2577,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -2595,7 +2589,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -2609,7 +2603,7 @@ resolved[m.type + 'Mods'].push(m); } else { }- + }; len = s.length;@@ -2630,7 +2624,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2647,7 +2640,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2663,7 +2655,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -2683,7 +2675,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -2708,7 +2699,7 @@ if (maxURLLength <= base.length) { maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { u = [];@@ -2769,7 +2760,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -2782,4 +2773,4 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]});
bundle/loader-rollup/loader-rollup-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/loader-rollup/loader-rollup.js", code: [] };-_yuitest_coverage["build/loader-rollup/loader-rollup.js"].code=["YUI.add('loader-rollup', function (Y, NAME) {","","/**"," * Optional automatic rollup logic for reducing http connections"," * when not using a combo service."," * @module loader"," * @submodule rollup"," */","","/**"," * Look for rollup packages to determine if all of the modules a"," * rollup supersedes are required. If so, include the rollup to"," * help reduce the total number of connections required. Called"," * by calculate(). This is an optional feature, and requires the"," * appropriate submodule to function."," * @method _rollup"," * @for Loader"," * @private"," */","Y.Loader.prototype._rollup = function() {"," var i, j, m, s, r = this.required, roll,"," info = this.moduleInfo, rolled, c, smod;",""," // find and cache rollup modules"," if (this.dirty || !this.rollups) {"," this.rollups = {};"," for (i in info) {"," if (info.hasOwnProperty(i)) {"," m = this.getModule(i);"," // if (m && m.rollup && m.supersedes) {"," if (m && m.rollup) {"," this.rollups[i] = m;"," }"," }"," }"," }",""," // make as many passes as needed to pick up rollup rollups"," for (;;) {"," rolled = false;",""," // go through the rollup candidates"," for (i in this.rollups) {"," if (this.rollups.hasOwnProperty(i)) {"," // there can be only one, unless forced"," if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {"," m = this.getModule(i);"," s = m.supersedes || [];"," roll = false;",""," // @TODO remove continue"," if (!m.rollup) {"," continue;"," }",""," c = 0;",""," // check the threshold"," for (j = 0; j < s.length; j++) {"," smod = info[s[j]];",""," // if the superseded module is loaded, we can't"," // load the rollup unless it has been forced."," if (this.loaded[s[j]] && !this.forceMap[s[j]]) {"," roll = false;"," break;"," // increment the counter if this module is required."," // if we are beyond the rollup threshold, we will"," // use the rollup module"," } else if (r[s[j]] && m.type == smod.type) {"," c++;"," roll = (c >= m.rollup);"," if (roll) {"," break;"," }"," }"," }",""," if (roll) {"," // add the rollup"," r[i] = true;"," rolled = true;",""," // expand the rollup's dependencies"," this.getRequires(m);"," }"," }"," }"," }",""," // if we made it here w/o rolling up something, we are done"," if (!rolled) {"," break;"," }"," }","};","","","}, '3.7.2', {\"requires\": [\"loader-base\"]});"];+_yuitest_coverage["build/loader-rollup/loader-rollup.js"].code=["YUI.add('loader-rollup', function (Y, NAME) {","","/**"," * Optional automatic rollup logic for reducing http connections"," * when not using a combo service."," * @module loader"," * @submodule rollup"," */","","/**"," * Look for rollup packages to determine if all of the modules a"," * rollup supersedes are required. If so, include the rollup to"," * help reduce the total number of connections required. Called"," * by calculate(). This is an optional feature, and requires the"," * appropriate submodule to function."," * @method _rollup"," * @for Loader"," * @private"," */","Y.Loader.prototype._rollup = function() {"," var i, j, m, s, r = this.required, roll,"," info = this.moduleInfo, rolled, c, smod;",""," // find and cache rollup modules"," if (this.dirty || !this.rollups) {"," this.rollups = {};"," for (i in info) {"," if (info.hasOwnProperty(i)) {"," m = this.getModule(i);"," // if (m && m.rollup && m.supersedes) {"," if (m && m.rollup) {"," this.rollups[i] = m;"," }"," }"," }"," }",""," // make as many passes as needed to pick up rollup rollups"," for (;;) {"," rolled = false;",""," // go through the rollup candidates"," for (i in this.rollups) {"," if (this.rollups.hasOwnProperty(i)) {"," // there can be only one, unless forced"," if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {"," m = this.getModule(i);"," s = m.supersedes || [];"," roll = false;",""," // @TODO remove continue"," if (!m.rollup) {"," continue;"," }",""," c = 0;",""," // check the threshold"," for (j = 0; j < s.length; j++) {"," smod = info[s[j]];",""," // if the superseded module is loaded, we can't"," // load the rollup unless it has been forced."," if (this.loaded[s[j]] && !this.forceMap[s[j]]) {"," roll = false;"," break;"," // increment the counter if this module is required."," // if we are beyond the rollup threshold, we will"," // use the rollup module"," } else if (r[s[j]] && m.type === smod.type) {"," c++;"," roll = (c >= m.rollup);"," if (roll) {"," break;"," }"," }"," }",""," if (roll) {"," // add the rollup"," r[i] = true;"," rolled = true;",""," // expand the rollup's dependencies"," this.getRequires(m);"," }"," }"," }"," }",""," // if we made it here w/o rolling up something, we are done"," if (!rolled) {"," break;"," }"," }","};","","","}, '3.7.3', {\"requires\": [\"loader-base\"]});"]; _yuitest_coverage["build/loader-rollup/loader-rollup.js"].lines = {"1":0,"20":0,"21":0,"25":0,"26":0,"27":0,"28":0,"29":0,"31":0,"32":0,"39":0,"40":0,"43":0,"44":0,"46":0,"47":0,"48":0,"49":0,"52":0,"53":0,"56":0,"59":0,"60":0,"64":0,"65":0,"66":0,"70":0,"71":0,"72":0,"73":0,"74":0,"79":0,"81":0,"82":0,"85":0,"92":0,"93":0}; _yuitest_coverage["build/loader-rollup/loader-rollup.js"].functions = {"_rollup:20":0,"(anonymous 1):1":0}; _yuitest_coverage["build/loader-rollup/loader-rollup.js"].coveredLines = 37;@@ -135,7 +135,7 @@ // if we are beyond the rollup threshold, we will // use the rollup module } else {_yuitest_coverline("build/loader-rollup/loader-rollup.js", 70);-if (r[s[j]] && m.type == smod.type) {+if (r[s[j]] && m.type === smod.type) { _yuitest_coverline("build/loader-rollup/loader-rollup.js", 71); c++; _yuitest_coverline("build/loader-rollup/loader-rollup.js", 72);@@ -174,4 +174,4 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]});
bundle/loader-rollup/loader-rollup-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -73,7 +73,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; // Y.log("adding to thresh: " + c + ", " + s[j]); roll = (c >= m.rollup);@@ -105,4 +105,4 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]});
bundle/loader-rollup/loader-rollup-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type==f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.2",{requires:["loader-base"]});+YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type===f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.3",{requires:["loader-base"]});
bundle/loader-rollup/loader-rollup.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -73,7 +73,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; roll = (c >= m.rollup); if (roll) {@@ -102,4 +102,4 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]});
bundle/loader-yui3/loader-yui3-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/loader-yui3/loader-yui3.js", code: [] };-_yuitest_coverage["build/loader-yui3/loader-yui3.js"].code=["YUI.add('loader-yui3', function (Y, NAME) {","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","","/**"," * YUI 3 module metadata"," * @module loader"," * @submodule yui3"," */","YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {"," \"align-plugin\": {"," \"requires\": ["," \"node-screen\","," \"node-pluginhost\""," ]"," },"," \"anim\": {"," \"use\": ["," \"anim-base\","," \"anim-color\","," \"anim-curve\","," \"anim-easing\","," \"anim-node-plugin\","," \"anim-scroll\","," \"anim-xy\""," ]"," },"," \"anim-base\": {"," \"requires\": ["," \"base-base\","," \"node-style\""," ]"," },"," \"anim-color\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-curve\": {"," \"requires\": ["," \"anim-xy\""," ]"," },"," \"anim-easing\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-node-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"anim-base\""," ]"," },"," \"anim-scroll\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-shape\": {"," \"requires\": ["," \"anim-base\","," \"anim-easing\","," \"anim-color\","," \"matrix\""," ]"," },"," \"anim-shape-transform\": {"," \"use\": ["," \"anim-shape\""," ]"," },"," \"anim-xy\": {"," \"requires\": ["," \"anim-base\","," \"node-screen\""," ]"," },"," \"app\": {"," \"use\": ["," \"app-base\","," \"app-content\","," \"app-transitions\","," \"lazy-model-list\","," \"model\","," \"model-list\","," \"model-sync-rest\","," \"router\","," \"view\","," \"view-node-map\""," ]"," },"," \"app-base\": {"," \"requires\": ["," \"classnamemanager\","," \"pjax-base\","," \"router\","," \"view\""," ]"," },"," \"app-content\": {"," \"requires\": ["," \"app-base\","," \"pjax-content\""," ]"," },"," \"app-transitions\": {"," \"requires\": ["," \"app-base\""," ]"," },"," \"app-transitions-css\": {"," \"type\": \"css\""," },"," \"app-transitions-native\": {"," \"condition\": {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\""," },"," \"requires\": ["," \"app-transitions\","," \"app-transitions-css\","," \"parallel\","," \"transition\""," ]"," },"," \"array-extras\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"array-invoke\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist-add\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraylist-filter\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraysort\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"async-queue\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute\": {"," \"use\": ["," \"attribute-base\","," \"attribute-complex\""," ]"," },"," \"attribute-base\": {"," \"requires\": ["," \"attribute-core\","," \"attribute-events\","," \"attribute-extras\""," ]"," },"," \"attribute-complex\": {"," \"requires\": ["," \"attribute-base\""," ]"," },"," \"attribute-core\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"attribute-events\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute-extras\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"autocomplete\": {"," \"use\": ["," \"autocomplete-base\","," \"autocomplete-sources\","," \"autocomplete-list\","," \"autocomplete-plugin\""," ]"," },"," \"autocomplete-base\": {"," \"optional\": ["," \"autocomplete-sources\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"escape\","," \"event-valuechange\","," \"node-base\""," ]"," },"," \"autocomplete-filters\": {"," \"requires\": ["," \"array-extras\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-filters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-highlighters\": {"," \"requires\": ["," \"array-extras\","," \"highlight-base\""," ]"," },"," \"autocomplete-highlighters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"highlight-accentfold\""," ]"," },"," \"autocomplete-list\": {"," \"after\": ["," \"autocomplete-sources\""," ],"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"autocomplete-base\","," \"event-resize\","," \"node-screen\","," \"selector-css3\","," \"shim-plugin\","," \"widget\","," \"widget-position\","," \"widget-position-align\""," ],"," \"skinnable\": true"," },"," \"autocomplete-list-keys\": {"," \"condition\": {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\""," },"," \"requires\": ["," \"autocomplete-list\","," \"base-build\""," ]"," },"," \"autocomplete-plugin\": {"," \"requires\": ["," \"autocomplete-list\","," \"node-pluginhost\""," ]"," },"," \"autocomplete-sources\": {"," \"optional\": ["," \"io-base\","," \"json-parse\","," \"jsonp\","," \"yql\""," ],"," \"requires\": ["," \"autocomplete-base\""," ]"," },"," \"base\": {"," \"use\": ["," \"base-base\","," \"base-pluginhost\","," \"base-build\""," ]"," },"," \"base-base\": {"," \"after\": ["," \"attribute-complex\""," ],"," \"requires\": ["," \"base-core\","," \"attribute-base\""," ]"," },"," \"base-build\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"base-core\": {"," \"requires\": ["," \"attribute-core\""," ]"," },"," \"base-pluginhost\": {"," \"requires\": ["," \"base-base\","," \"pluginhost\""," ]"," },"," \"button\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-core\": {"," \"requires\": ["," \"attribute-core\","," \"classnamemanager\","," \"node-base\""," ]"," },"," \"button-group\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-plugin\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"node-pluginhost\""," ]"," },"," \"cache\": {"," \"use\": ["," \"cache-base\","," \"cache-offline\","," \"cache-plugin\""," ]"," },"," \"cache-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"cache-offline\": {"," \"requires\": ["," \"cache-base\","," \"json\""," ]"," },"," \"cache-plugin\": {"," \"requires\": ["," \"plugin\","," \"cache-base\""," ]"," },"," \"calendar\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"calendar-base\","," \"calendarnavigator\""," ],"," \"skinnable\": true"," },"," \"calendar-base\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"widget\","," \"substitute\","," \"datatype-date\","," \"datatype-date-math\","," \"cssgrids\""," ],"," \"skinnable\": true"," },"," \"calendarnavigator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\","," \"datatype-date\","," \"node\","," \"substitute\""," ],"," \"skinnable\": true"," },"," \"charts\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"charts-base\": {"," \"requires\": ["," \"dom\","," \"datatype-number\","," \"datatype-date\","," \"event-custom\","," \"event-mouseenter\","," \"event-touch\","," \"widget\","," \"widget-position\","," \"widget-stack\","," \"graphics\""," ]"," },"," \"charts-legend\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"classnamemanager\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"clickable-rail\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"collection\": {"," \"use\": ["," \"array-extras\","," \"arraylist\","," \"arraylist-add\","," \"arraylist-filter\","," \"array-invoke\""," ]"," },"," \"console\": {"," \"lang\": ["," \"en\","," \"es\","," \"ja\""," ],"," \"requires\": ["," \"yui-log\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"console-filters\": {"," \"requires\": ["," \"plugin\","," \"console\""," ],"," \"skinnable\": true"," },"," \"controller\": {"," \"use\": ["," \"router\""," ]"," },"," \"cookie\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"createlink-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"cssbase\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbase-context\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbutton\": {"," \"type\": \"css\""," },"," \"cssfonts\": {"," \"type\": \"css\""," },"," \"cssfonts-context\": {"," \"type\": \"css\""," },"," \"cssgrids\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-base\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-units\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"requires\": ["," \"cssgrids-base\""," ],"," \"type\": \"css\""," },"," \"cssreset\": {"," \"type\": \"css\""," },"," \"cssreset-context\": {"," \"type\": \"css\""," },"," \"dataschema\": {"," \"use\": ["," \"dataschema-base\","," \"dataschema-json\","," \"dataschema-xml\","," \"dataschema-array\","," \"dataschema-text\""," ]"," },"," \"dataschema-array\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"dataschema-json\": {"," \"requires\": ["," \"dataschema-base\","," \"json\""," ]"," },"," \"dataschema-text\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-xml\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"datasource\": {"," \"use\": ["," \"datasource-local\","," \"datasource-io\","," \"datasource-get\","," \"datasource-function\","," \"datasource-cache\","," \"datasource-jsonschema\","," \"datasource-xmlschema\","," \"datasource-arrayschema\","," \"datasource-textschema\","," \"datasource-polling\""," ]"," },"," \"datasource-arrayschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-array\""," ]"," },"," \"datasource-cache\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"cache-base\""," ]"," },"," \"datasource-function\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-get\": {"," \"requires\": ["," \"datasource-local\","," \"get\""," ]"," },"," \"datasource-io\": {"," \"requires\": ["," \"datasource-local\","," \"io-base\""," ]"," },"," \"datasource-jsonschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-json\""," ]"," },"," \"datasource-local\": {"," \"requires\": ["," \"base\""," ]"," },"," \"datasource-polling\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-textschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-text\""," ]"," },"," \"datasource-xmlschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-xml\""," ]"," },"," \"datatable\": {"," \"use\": ["," \"datatable-core\","," \"datatable-table\","," \"datatable-head\","," \"datatable-body\","," \"datatable-base\","," \"datatable-column-widths\","," \"datatable-message\","," \"datatable-mutable\","," \"datatable-sort\","," \"datatable-datasource\""," ]"," },"," \"datatable-base\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-table\","," \"datatable-head\","," \"datatable-body\","," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"datatable-base-deprecated\": {"," \"requires\": ["," \"recordset-base\","," \"widget\","," \"substitute\","," \"event-mouseenter\""," ],"," \"skinnable\": true"," },"," \"datatable-body\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-column-widths\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-core\": {"," \"requires\": ["," \"escape\","," \"model-list\","," \"node-event-delegate\""," ]"," },"," \"datatable-datasource\": {"," \"requires\": ["," \"datatable-base\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-datasource-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-deprecated\": {"," \"use\": ["," \"datatable-base-deprecated\","," \"datatable-datasource-deprecated\","," \"datatable-sort-deprecated\","," \"datatable-scroll-deprecated\""," ]"," },"," \"datatable-head\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-message\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-mutable\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-scroll\": {"," \"requires\": ["," \"datatable-base\","," \"datatable-column-widths\","," \"dom-screen\""," ],"," \"skinnable\": true"," },"," \"datatable-scroll-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\""," ]"," },"," \"datatable-sort\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-sort-deprecated\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"recordset-sort\""," ]"," },"," \"datatable-table\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-head\","," \"datatable-body\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatype\": {"," \"use\": ["," \"datatype-date\","," \"datatype-number\","," \"datatype-xml\""," ]"," },"," \"datatype-date\": {"," \"use\": ["," \"datatype-date-parse\","," \"datatype-date-format\","," \"datatype-date-math\""," ]"," },"," \"datatype-date-format\": {"," \"lang\": ["," \"ar\","," \"ar-JO\","," \"ca\","," \"ca-ES\","," \"da\","," \"da-DK\","," \"de\","," \"de-AT\","," \"de-DE\","," \"el\","," \"el-GR\","," \"en\","," \"en-AU\","," \"en-CA\","," \"en-GB\","," \"en-IE\","," \"en-IN\","," \"en-JO\","," \"en-MY\","," \"en-NZ\","," \"en-PH\","," \"en-SG\","," \"en-US\","," \"es\","," \"es-AR\","," \"es-BO\","," \"es-CL\","," \"es-CO\","," \"es-EC\","," \"es-ES\","," \"es-MX\","," \"es-PE\","," \"es-PY\","," \"es-US\","," \"es-UY\","," \"es-VE\","," \"fi\","," \"fi-FI\","," \"fr\","," \"fr-BE\","," \"fr-CA\","," \"fr-FR\","," \"hi\","," \"hi-IN\","," \"id\","," \"id-ID\","," \"it\","," \"it-IT\","," \"ja\","," \"ja-JP\","," \"ko\","," \"ko-KR\","," \"ms\","," \"ms-MY\","," \"nb\","," \"nb-NO\","," \"nl\","," \"nl-BE\","," \"nl-NL\","," \"pl\","," \"pl-PL\","," \"pt\","," \"pt-BR\","," \"ro\","," \"ro-RO\","," \"ru\","," \"ru-RU\","," \"sv\","," \"sv-SE\","," \"th\","," \"th-TH\","," \"tr\","," \"tr-TR\","," \"vi\","," \"vi-VN\","," \"zh-Hans\","," \"zh-Hans-CN\","," \"zh-Hant\","," \"zh-Hant-HK\","," \"zh-Hant-TW\""," ]"," },"," \"datatype-date-math\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"datatype-date-parse\": {},"," \"datatype-number\": {"," \"use\": ["," \"datatype-number-parse\","," \"datatype-number-format\""," ]"," },"," \"datatype-number-format\": {},"," \"datatype-number-parse\": {},"," \"datatype-xml\": {"," \"use\": ["," \"datatype-xml-parse\","," \"datatype-xml-format\""," ]"," },"," \"datatype-xml-format\": {},"," \"datatype-xml-parse\": {},"," \"dd\": {"," \"use\": ["," \"dd-ddm-base\","," \"dd-ddm\","," \"dd-ddm-drop\","," \"dd-drag\","," \"dd-proxy\","," \"dd-constrain\","," \"dd-drop\","," \"dd-scroll\","," \"dd-delegate\""," ]"," },"," \"dd-constrain\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-ddm\": {"," \"requires\": ["," \"dd-ddm-base\","," \"event-resize\""," ]"," },"," \"dd-ddm-base\": {"," \"requires\": ["," \"node\","," \"base\","," \"yui-throttle\","," \"classnamemanager\""," ]"," },"," \"dd-ddm-drop\": {"," \"requires\": ["," \"dd-ddm\""," ]"," },"," \"dd-delegate\": {"," \"requires\": ["," \"dd-drag\","," \"dd-drop-plugin\","," \"event-mouseenter\""," ]"," },"," \"dd-drag\": {"," \"requires\": ["," \"dd-ddm-base\""," ]"," },"," \"dd-drop\": {"," \"requires\": ["," \"dd-drag\","," \"dd-ddm-drop\""," ]"," },"," \"dd-drop-plugin\": {"," \"requires\": ["," \"dd-drop\""," ]"," },"," \"dd-gestures\": {"," \"condition\": {"," \"name\": \"dd-gestures\","," \"test\": function(Y) {"," return ((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));","},"," \"trigger\": \"dd-drag\""," },"," \"requires\": ["," \"dd-drag\","," \"event-synthetic\","," \"event-gestures\""," ]"," },"," \"dd-plugin\": {"," \"optional\": ["," \"dd-constrain\","," \"dd-proxy\""," ],"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-proxy\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-scroll\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dial\": {"," \"lang\": ["," \"en\","," \"es\""," ],"," \"requires\": ["," \"widget\","," \"dd-drag\","," \"event-mouseenter\","," \"event-move\","," \"event-key\","," \"transition\","," \"intl\""," ],"," \"skinnable\": true"," },"," \"dom\": {"," \"use\": ["," \"dom-base\","," \"dom-screen\","," \"dom-style\","," \"selector-native\","," \"selector\""," ]"," },"," \"dom-base\": {"," \"requires\": ["," \"dom-core\""," ]"," },"," \"dom-core\": {"," \"requires\": ["," \"oop\","," \"features\""," ]"," },"," \"dom-deprecated\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-screen\": {"," \"requires\": ["," \"dom-base\","," \"dom-style\""," ]"," },"," \"dom-style\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-style-ie\": {"," \"condition\": {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\""," },"," \"requires\": ["," \"dom-style\""," ]"," },"," \"dump\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"editor\": {"," \"use\": ["," \"frame\","," \"editor-selection\","," \"exec-command\","," \"editor-base\","," \"editor-para\","," \"editor-br\","," \"editor-bidi\","," \"editor-tab\","," \"createlink-base\""," ]"," },"," \"editor-base\": {"," \"requires\": ["," \"base\","," \"frame\","," \"node\","," \"exec-command\","," \"editor-selection\""," ]"," },"," \"editor-bidi\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-br\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-lists\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para\": {"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-para-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para-ie\": {"," \"condition\": {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\""," },"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-selection\": {"," \"requires\": ["," \"node\""," ]"," },"," \"editor-tab\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"escape\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"event\": {"," \"after\": ["," \"node-base\""," ],"," \"use\": ["," \"event-base\","," \"event-delegate\","," \"event-synthetic\","," \"event-mousewheel\","," \"event-mouseenter\","," \"event-key\","," \"event-focus\","," \"event-resize\","," \"event-hover\","," \"event-outside\","," \"event-touch\","," \"event-move\","," \"event-flick\","," \"event-valuechange\","," \"event-tap\""," ]"," },"," \"event-base\": {"," \"after\": ["," \"node-base\""," ],"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-base-ie\": {"," \"after\": ["," \"event-base\""," ],"," \"condition\": {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\""," },"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-contextmenu\": {"," \"requires\": ["," \"event-synthetic\","," \"dom-screen\""," ]"," },"," \"event-custom\": {"," \"use\": ["," \"event-custom-base\","," \"event-custom-complex\""," ]"," },"," \"event-custom-base\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"event-custom-complex\": {"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-delegate\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-flick\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-focus\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-gestures\": {"," \"use\": ["," \"event-flick\","," \"event-move\""," ]"," },"," \"event-hover\": {"," \"requires\": ["," \"event-mouseenter\""," ]"," },"," \"event-key\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mouseenter\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mousewheel\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-move\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-outside\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-resize\": {"," \"requires\": ["," \"node-base\","," \"event-synthetic\""," ]"," },"," \"event-simulate\": {"," \"requires\": ["," \"event-base\""," ]"," },"," \"event-synthetic\": {"," \"requires\": ["," \"node-base\","," \"event-custom-complex\""," ]"," },"," \"event-tap\": {"," \"requires\": ["," \"node-base\","," \"event-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-touch\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-valuechange\": {"," \"requires\": ["," \"event-focus\","," \"event-synthetic\""," ]"," },"," \"exec-command\": {"," \"requires\": ["," \"frame\""," ]"," },"," \"features\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"file\": {"," \"requires\": ["," \"file-flash\","," \"file-html5\""," ]"," },"," \"file-flash\": {"," \"requires\": ["," \"base\""," ]"," },"," \"file-html5\": {"," \"requires\": ["," \"base\""," ]"," },"," \"frame\": {"," \"requires\": ["," \"base\","," \"node\","," \"selector-css3\","," \"yui-throttle\""," ]"," },"," \"gesture-simulate\": {"," \"requires\": ["," \"async-queue\","," \"event-simulate\","," \"node-screen\""," ]"," },"," \"get\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"graphics\": {"," \"requires\": ["," \"node\","," \"event-custom\","," \"pluginhost\","," \"matrix\","," \"classnamemanager\""," ]"," },"," \"graphics-canvas\": {"," \"condition\": {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-canvas-default\": {"," \"condition\": {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-svg\": {"," \"condition\": {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-svg-default\": {"," \"condition\": {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-vml\": {"," \"condition\": {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-vml-default\": {"," \"condition\": {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," }"," },"," \"handlebars\": {"," \"use\": ["," \"handlebars-compiler\""," ]"," },"," \"handlebars-base\": {"," \"requires\": ["," \"escape\""," ]"," },"," \"handlebars-compiler\": {"," \"requires\": ["," \"handlebars-base\""," ]"," },"," \"highlight\": {"," \"use\": ["," \"highlight-base\","," \"highlight-accentfold\""," ]"," },"," \"highlight-accentfold\": {"," \"requires\": ["," \"highlight-base\","," \"text-accentfold\""," ]"," },"," \"highlight-base\": {"," \"requires\": ["," \"array-extras\","," \"classnamemanager\","," \"escape\","," \"text-wordbreak\""," ]"," },"," \"history\": {"," \"use\": ["," \"history-base\","," \"history-hash\","," \"history-hash-ie\","," \"history-html5\""," ]"," },"," \"history-base\": {"," \"requires\": ["," \"event-custom-complex\""," ]"," },"," \"history-hash\": {"," \"after\": ["," \"history-html5\""," ],"," \"requires\": ["," \"event-synthetic\","," \"history-base\","," \"yui-later\""," ]"," },"," \"history-hash-ie\": {"," \"condition\": {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\""," },"," \"requires\": ["," \"history-hash\","," \"node-base\""," ]"," },"," \"history-html5\": {"," \"optional\": ["," \"json\""," ],"," \"requires\": ["," \"event-base\","," \"history-base\","," \"node-base\""," ]"," },"," \"imageloader\": {"," \"requires\": ["," \"base-base\","," \"node-style\","," \"node-screen\""," ]"," },"," \"intl\": {"," \"requires\": ["," \"intl-base\","," \"event-custom\""," ]"," },"," \"intl-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"io\": {"," \"use\": ["," \"io-base\","," \"io-xdr\","," \"io-form\","," \"io-upload-iframe\","," \"io-queue\""," ]"," },"," \"io-base\": {"," \"requires\": ["," \"event-custom-base\","," \"querystring-stringify-simple\""," ]"," },"," \"io-form\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-nodejs\": {"," \"condition\": {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\""," },"," \"requires\": ["," \"io-base\""," ]"," },"," \"io-queue\": {"," \"requires\": ["," \"io-base\","," \"queue-promote\""," ]"," },"," \"io-upload-iframe\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-xdr\": {"," \"requires\": ["," \"io-base\","," \"datatype-xml-parse\""," ]"," },"," \"json\": {"," \"use\": ["," \"json-parse\","," \"json-stringify\""," ]"," },"," \"json-parse\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"json-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"jsonp\": {"," \"requires\": ["," \"get\","," \"oop\""," ]"," },"," \"jsonp-url\": {"," \"requires\": ["," \"jsonp\""," ]"," },"," \"lazy-model-list\": {"," \"requires\": ["," \"model-list\""," ]"," },"," \"loader\": {"," \"use\": ["," \"loader-base\","," \"loader-rollup\","," \"loader-yui3\""," ]"," },"," \"loader-base\": {"," \"requires\": ["," \"get\","," \"features\""," ]"," },"," \"loader-rollup\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"loader-yui3\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"matrix\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"model\": {"," \"requires\": ["," \"base-build\","," \"escape\","," \"json-parse\""," ]"," },"," \"model-list\": {"," \"requires\": ["," \"array-extras\","," \"array-invoke\","," \"arraylist\","," \"base-build\","," \"escape\","," \"json-parse\","," \"model\""," ]"," },"," \"model-sync-rest\": {"," \"requires\": ["," \"model\","," \"io-base\","," \"json-stringify\""," ]"," },"," \"node\": {"," \"use\": ["," \"node-base\","," \"node-event-delegate\","," \"node-pluginhost\","," \"node-screen\","," \"node-style\""," ]"," },"," \"node-base\": {"," \"requires\": ["," \"event-base\","," \"node-core\","," \"dom-base\""," ]"," },"," \"node-core\": {"," \"requires\": ["," \"dom-core\","," \"selector\""," ]"," },"," \"node-deprecated\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-delegate\": {"," \"requires\": ["," \"node-base\","," \"event-delegate\""," ]"," },"," \"node-event-html5\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-simulate\": {"," \"requires\": ["," \"node-base\","," \"event-simulate\","," \"gesture-simulate\""," ]"," },"," \"node-flick\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"event-flick\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"node-focusmanager\": {"," \"requires\": ["," \"attribute\","," \"node\","," \"plugin\","," \"node-event-simulate\","," \"event-key\","," \"event-focus\""," ]"," },"," \"node-load\": {"," \"requires\": ["," \"node-base\","," \"io-base\""," ]"," },"," \"node-menunav\": {"," \"requires\": ["," \"node\","," \"classnamemanager\","," \"plugin\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"node-pluginhost\": {"," \"requires\": ["," \"node-base\","," \"pluginhost\""," ]"," },"," \"node-screen\": {"," \"requires\": ["," \"dom-screen\","," \"node-base\""," ]"," },"," \"node-scroll-info\": {"," \"requires\": ["," \"base-build\","," \"dom-screen\","," \"event-resize\","," \"node-pluginhost\","," \"plugin\""," ]"," },"," \"node-style\": {"," \"requires\": ["," \"dom-style\","," \"node-base\""," ]"," },"," \"oop\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"overlay\": {"," \"requires\": ["," \"widget\","," \"widget-stdmod\","," \"widget-position\","," \"widget-position-align\","," \"widget-stack\","," \"widget-position-constrain\""," ],"," \"skinnable\": true"," },"," \"panel\": {"," \"requires\": ["," \"widget\","," \"widget-autohide\","," \"widget-buttons\","," \"widget-modality\","," \"widget-position\","," \"widget-position-align\","," \"widget-position-constrain\","," \"widget-stack\","," \"widget-stdmod\""," ],"," \"skinnable\": true"," },"," \"parallel\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pjax\": {"," \"requires\": ["," \"pjax-base\","," \"pjax-content\""," ]"," },"," \"pjax-base\": {"," \"requires\": ["," \"classnamemanager\","," \"node-event-delegate\","," \"router\""," ]"," },"," \"pjax-content\": {"," \"requires\": ["," \"io-base\","," \"node-base\","," \"router\""," ]"," },"," \"pjax-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"pjax\","," \"plugin\""," ]"," },"," \"plugin\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"pluginhost\": {"," \"use\": ["," \"pluginhost-base\","," \"pluginhost-config\""," ]"," },"," \"pluginhost-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pluginhost-config\": {"," \"requires\": ["," \"pluginhost-base\""," ]"," },"," \"profiler\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring\": {"," \"use\": ["," \"querystring-parse\","," \"querystring-stringify\""," ]"," },"," \"querystring-parse\": {"," \"requires\": ["," \"yui-base\","," \"array-extras\""," ]"," },"," \"querystring-parse-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"queue-promote\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"range-slider\": {"," \"requires\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\""," ]"," },"," \"recordset\": {"," \"use\": ["," \"recordset-base\","," \"recordset-sort\","," \"recordset-filter\","," \"recordset-indexer\""," ]"," },"," \"recordset-base\": {"," \"requires\": ["," \"base\","," \"arraylist\""," ]"," },"," \"recordset-filter\": {"," \"requires\": ["," \"recordset-base\","," \"array-extras\","," \"plugin\""," ]"," },"," \"recordset-indexer\": {"," \"requires\": ["," \"recordset-base\","," \"plugin\""," ]"," },"," \"recordset-sort\": {"," \"requires\": ["," \"arraysort\","," \"recordset-base\","," \"plugin\""," ]"," },"," \"resize\": {"," \"use\": ["," \"resize-base\","," \"resize-proxy\","," \"resize-constrain\""," ]"," },"," \"resize-base\": {"," \"requires\": ["," \"base\","," \"widget\","," \"event\","," \"oop\","," \"dd-drag\","," \"dd-delegate\","," \"dd-drop\""," ],"," \"skinnable\": true"," },"," \"resize-constrain\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"resize-plugin\": {"," \"optional\": ["," \"resize-constrain\""," ],"," \"requires\": ["," \"resize-base\","," \"plugin\""," ]"," },"," \"resize-proxy\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"router\": {"," \"optional\": ["," \"querystring-parse\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"history\""," ]"," },"," \"scrollview\": {"," \"requires\": ["," \"scrollview-base\","," \"scrollview-scrollbars\""," ]"," },"," \"scrollview-base\": {"," \"requires\": ["," \"widget\","," \"event-gestures\","," \"event-mousewheel\","," \"transition\""," ],"," \"skinnable\": true"," },"," \"scrollview-base-ie\": {"," \"condition\": {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"scrollview-base\""," ]"," },"," \"scrollview-list\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ],"," \"skinnable\": true"," },"," \"scrollview-paginator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ]"," },"," \"scrollview-scrollbars\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"selector\": {"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css2\": {"," \"condition\": {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\""," },"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css3\": {"," \"requires\": ["," \"selector-native\","," \"selector-css2\""," ]"," },"," \"selector-native\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"shim-plugin\": {"," \"requires\": ["," \"node-style\","," \"node-pluginhost\""," ]"," },"," \"slider\": {"," \"use\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\","," \"range-slider\""," ]"," },"," \"slider-base\": {"," \"requires\": ["," \"widget\","," \"dd-constrain\","," \"event-key\""," ],"," \"skinnable\": true"," },"," \"slider-value-range\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"sortable\": {"," \"requires\": ["," \"dd-delegate\","," \"dd-drop-plugin\","," \"dd-proxy\""," ]"," },"," \"sortable-scroll\": {"," \"requires\": ["," \"dd-scroll\","," \"sortable\""," ]"," },"," \"stylesheet\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"substitute\": {"," \"optional\": ["," \"dump\""," ],"," \"requires\": ["," \"yui-base\""," ]"," },"," \"swf\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"swfdetect\","," \"escape\""," ]"," },"," \"swfdetect\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"tabview\": {"," \"requires\": ["," \"widget\","," \"widget-parent\","," \"widget-child\","," \"tabview-base\","," \"node-pluginhost\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"tabview-base\": {"," \"requires\": ["," \"node-event-delegate\","," \"classnamemanager\","," \"skin-sam-tabview\""," ]"," },"," \"tabview-plugin\": {"," \"requires\": ["," \"tabview-base\""," ]"," },"," \"test\": {"," \"requires\": ["," \"event-simulate\","," \"event-custom\","," \"json-stringify\""," ]"," },"," \"test-console\": {"," \"requires\": ["," \"console-filters\","," \"test\""," ],"," \"skinnable\": true"," },"," \"text\": {"," \"use\": ["," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"text-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-data-accentfold\""," ]"," },"," \"text-data-accentfold\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-data-wordbreak\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-wordbreak\": {"," \"requires\": ["," \"array-extras\","," \"text-data-wordbreak\""," ]"," },"," \"transition\": {"," \"requires\": ["," \"node-style\""," ]"," },"," \"transition-timer\": {"," \"condition\": {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);"," } ",""," return ret;","},"," \"trigger\": \"transition\""," },"," \"requires\": ["," \"transition\""," ]"," },"," \"uploader\": {"," \"requires\": ["," \"uploader-html5\","," \"uploader-flash\""," ]"," },"," \"uploader-deprecated\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"base\","," \"swf\""," ]"," },"," \"uploader-flash\": {"," \"requires\": ["," \"swf\","," \"widget\","," \"substitute\","," \"base\","," \"cssbutton\","," \"node\","," \"event-custom\","," \"file-flash\","," \"uploader-queue\""," ]"," },"," \"uploader-html5\": {"," \"requires\": ["," \"widget\","," \"node-event-simulate\","," \"substitute\","," \"file-html5\","," \"uploader-queue\""," ]"," },"," \"uploader-queue\": {"," \"requires\": ["," \"base\""," ]"," },"," \"view\": {"," \"requires\": ["," \"base-build\","," \"node-event-delegate\""," ]"," },"," \"view-node-map\": {"," \"requires\": ["," \"view\""," ]"," },"," \"widget\": {"," \"use\": ["," \"widget-base\","," \"widget-htmlparser\","," \"widget-skin\","," \"widget-uievents\""," ]"," },"," \"widget-anim\": {"," \"requires\": ["," \"anim-base\","," \"plugin\","," \"widget\""," ]"," },"," \"widget-autohide\": {"," \"requires\": ["," \"base-build\","," \"event-key\","," \"event-outside\","," \"widget\""," ]"," },"," \"widget-base\": {"," \"requires\": ["," \"attribute\","," \"base-base\","," \"base-pluginhost\","," \"classnamemanager\","," \"event-focus\","," \"node-base\","," \"node-style\""," ],"," \"skinnable\": true"," },"," \"widget-base-ie\": {"," \"condition\": {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-buttons\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget-stdmod\""," ]"," },"," \"widget-child\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-htmlparser\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-locale\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-modality\": {"," \"requires\": ["," \"base-build\","," \"event-outside\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-parent\": {"," \"requires\": ["," \"arraylist\","," \"base-build\","," \"widget\""," ]"," },"," \"widget-position\": {"," \"requires\": ["," \"base-build\","," \"node-screen\","," \"widget\""," ]"," },"," \"widget-position-align\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-position-constrain\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-skin\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-stack\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-stdmod\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-uievents\": {"," \"requires\": ["," \"node-event-delegate\","," \"widget-base\""," ]"," },"," \"yql\": {"," \"requires\": ["," \"jsonp\","," \"jsonp-url\""," ]"," },"," \"yui\": {},"," \"yui-base\": {},"," \"yui-later\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-log\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-throttle\": {"," \"requires\": ["," \"yui-base\""," ]"," }","};","YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';","","","}, '3.7.2', {\"requires\": [\"loader-base\"]});"];-_yuitest_coverage["build/loader-yui3/loader-yui3.js"].lines = {"1":0,"10":0,"119":0,"122":0,"123":0,"126":0,"284":0,"1012":0,"1098":0,"1105":0,"1107":0,"1111":0,"1113":0,"1117":0,"1120":0,"1243":0,"1244":0,"1424":0,"1428":0,"1440":0,"1444":0,"1453":0,"1458":0,"1470":0,"1475":0,"1484":0,"1486":0,"1498":0,"1500":0,"1567":0,"1569":0,"2113":0,"2116":0,"2275":0,"2279":0,"2280":0,"2283":0,"2491":0};-_yuitest_coverage["build/loader-yui3/loader-yui3.js"].functions = {"\"test\":118":0,"\"test\":272":0,"\"test\":1011":0,"test:1106":0,"test:1112":0,"\"test\":1096":0,"\"test\":1242":0,"\"test\":1423":0,"\"test\":1439":0,"\"test\":1452":0,"\"test\":1469":0,"\"test\":1483":0,"\"test\":1497":0,"\"test\":1566":0,"\"test\":2112":0,"\"test\":2274":0,"(anonymous 1):1":0};-_yuitest_coverage["build/loader-yui3/loader-yui3.js"].coveredLines = 38;-_yuitest_coverage["build/loader-yui3/loader-yui3.js"].coveredFunctions = 17;+_yuitest_coverage["build/loader-yui3/loader-yui3.js"].code=["YUI.add('loader-yui3', function (Y, NAME) {","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","","/**"," * YUI 3 module metadata"," * @module loader"," * @submodule yui3"," */","YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {"," \"align-plugin\": {"," \"requires\": ["," \"node-screen\","," \"node-pluginhost\""," ]"," },"," \"anim\": {"," \"use\": ["," \"anim-base\","," \"anim-color\","," \"anim-curve\","," \"anim-easing\","," \"anim-node-plugin\","," \"anim-scroll\","," \"anim-xy\""," ]"," },"," \"anim-base\": {"," \"requires\": ["," \"base-base\","," \"node-style\""," ]"," },"," \"anim-color\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-curve\": {"," \"requires\": ["," \"anim-xy\""," ]"," },"," \"anim-easing\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-node-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"anim-base\""," ]"," },"," \"anim-scroll\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-shape\": {"," \"requires\": ["," \"anim-base\","," \"anim-easing\","," \"anim-color\","," \"matrix\""," ]"," },"," \"anim-shape-transform\": {"," \"use\": ["," \"anim-shape\""," ]"," },"," \"anim-xy\": {"," \"requires\": ["," \"anim-base\","," \"node-screen\""," ]"," },"," \"app\": {"," \"use\": ["," \"app-base\","," \"app-content\","," \"app-transitions\","," \"lazy-model-list\","," \"model\","," \"model-list\","," \"model-sync-rest\","," \"router\","," \"view\","," \"view-node-map\""," ]"," },"," \"app-base\": {"," \"requires\": ["," \"classnamemanager\","," \"pjax-base\","," \"router\","," \"view\""," ]"," },"," \"app-content\": {"," \"requires\": ["," \"app-base\","," \"pjax-content\""," ]"," },"," \"app-transitions\": {"," \"requires\": ["," \"app-base\""," ]"," },"," \"app-transitions-css\": {"," \"type\": \"css\""," },"," \"app-transitions-native\": {"," \"condition\": {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\""," },"," \"requires\": ["," \"app-transitions\","," \"app-transitions-css\","," \"parallel\","," \"transition\""," ]"," },"," \"array-extras\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"array-invoke\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist-add\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraylist-filter\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraysort\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"async-queue\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute\": {"," \"use\": ["," \"attribute-base\","," \"attribute-complex\""," ]"," },"," \"attribute-base\": {"," \"requires\": ["," \"attribute-core\","," \"attribute-events\","," \"attribute-extras\""," ]"," },"," \"attribute-complex\": {"," \"requires\": ["," \"attribute-base\""," ]"," },"," \"attribute-core\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"attribute-events\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute-extras\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"autocomplete\": {"," \"use\": ["," \"autocomplete-base\","," \"autocomplete-sources\","," \"autocomplete-list\","," \"autocomplete-plugin\""," ]"," },"," \"autocomplete-base\": {"," \"optional\": ["," \"autocomplete-sources\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"escape\","," \"event-valuechange\","," \"node-base\""," ]"," },"," \"autocomplete-filters\": {"," \"requires\": ["," \"array-extras\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-filters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-highlighters\": {"," \"requires\": ["," \"array-extras\","," \"highlight-base\""," ]"," },"," \"autocomplete-highlighters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"highlight-accentfold\""," ]"," },"," \"autocomplete-list\": {"," \"after\": ["," \"autocomplete-sources\""," ],"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"autocomplete-base\","," \"event-resize\","," \"node-screen\","," \"selector-css3\","," \"shim-plugin\","," \"widget\","," \"widget-position\","," \"widget-position-align\""," ],"," \"skinnable\": true"," },"," \"autocomplete-list-keys\": {"," \"condition\": {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\""," },"," \"requires\": ["," \"autocomplete-list\","," \"base-build\""," ]"," },"," \"autocomplete-plugin\": {"," \"requires\": ["," \"autocomplete-list\","," \"node-pluginhost\""," ]"," },"," \"autocomplete-sources\": {"," \"optional\": ["," \"io-base\","," \"json-parse\","," \"jsonp\","," \"yql\""," ],"," \"requires\": ["," \"autocomplete-base\""," ]"," },"," \"base\": {"," \"use\": ["," \"base-base\","," \"base-pluginhost\","," \"base-build\""," ]"," },"," \"base-base\": {"," \"after\": ["," \"attribute-complex\""," ],"," \"requires\": ["," \"base-core\","," \"attribute-base\""," ]"," },"," \"base-build\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"base-core\": {"," \"requires\": ["," \"attribute-core\""," ]"," },"," \"base-pluginhost\": {"," \"requires\": ["," \"base-base\","," \"pluginhost\""," ]"," },"," \"button\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-core\": {"," \"requires\": ["," \"attribute-core\","," \"classnamemanager\","," \"node-base\""," ]"," },"," \"button-group\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-plugin\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"node-pluginhost\""," ]"," },"," \"cache\": {"," \"use\": ["," \"cache-base\","," \"cache-offline\","," \"cache-plugin\""," ]"," },"," \"cache-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"cache-offline\": {"," \"requires\": ["," \"cache-base\","," \"json\""," ]"," },"," \"cache-plugin\": {"," \"requires\": ["," \"plugin\","," \"cache-base\""," ]"," },"," \"calendar\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"calendar-base\","," \"calendarnavigator\""," ],"," \"skinnable\": true"," },"," \"calendar-base\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"widget\","," \"substitute\","," \"datatype-date\","," \"datatype-date-math\","," \"cssgrids\""," ],"," \"skinnable\": true"," },"," \"calendarnavigator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\","," \"datatype-date\","," \"node\","," \"substitute\""," ],"," \"skinnable\": true"," },"," \"charts\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"charts-base\": {"," \"requires\": ["," \"dom\","," \"datatype-number\","," \"datatype-date\","," \"event-custom\","," \"event-mouseenter\","," \"event-touch\","," \"widget\","," \"widget-position\","," \"widget-stack\","," \"graphics\""," ]"," },"," \"charts-legend\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"classnamemanager\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"clickable-rail\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"collection\": {"," \"use\": ["," \"array-extras\","," \"arraylist\","," \"arraylist-add\","," \"arraylist-filter\","," \"array-invoke\""," ]"," },"," \"console\": {"," \"lang\": ["," \"en\","," \"es\","," \"ja\""," ],"," \"requires\": ["," \"yui-log\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"console-filters\": {"," \"requires\": ["," \"plugin\","," \"console\""," ],"," \"skinnable\": true"," },"," \"controller\": {"," \"use\": ["," \"router\""," ]"," },"," \"cookie\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"createlink-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"cssbase\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbase-context\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbutton\": {"," \"type\": \"css\""," },"," \"cssfonts\": {"," \"type\": \"css\""," },"," \"cssfonts-context\": {"," \"type\": \"css\""," },"," \"cssgrids\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-base\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-units\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"requires\": ["," \"cssgrids-base\""," ],"," \"type\": \"css\""," },"," \"cssreset\": {"," \"type\": \"css\""," },"," \"cssreset-context\": {"," \"type\": \"css\""," },"," \"dataschema\": {"," \"use\": ["," \"dataschema-base\","," \"dataschema-json\","," \"dataschema-xml\","," \"dataschema-array\","," \"dataschema-text\""," ]"," },"," \"dataschema-array\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"dataschema-json\": {"," \"requires\": ["," \"dataschema-base\","," \"json\""," ]"," },"," \"dataschema-text\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-xml\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"datasource\": {"," \"use\": ["," \"datasource-local\","," \"datasource-io\","," \"datasource-get\","," \"datasource-function\","," \"datasource-cache\","," \"datasource-jsonschema\","," \"datasource-xmlschema\","," \"datasource-arrayschema\","," \"datasource-textschema\","," \"datasource-polling\""," ]"," },"," \"datasource-arrayschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-array\""," ]"," },"," \"datasource-cache\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"cache-base\""," ]"," },"," \"datasource-function\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-get\": {"," \"requires\": ["," \"datasource-local\","," \"get\""," ]"," },"," \"datasource-io\": {"," \"requires\": ["," \"datasource-local\","," \"io-base\""," ]"," },"," \"datasource-jsonschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-json\""," ]"," },"," \"datasource-local\": {"," \"requires\": ["," \"base\""," ]"," },"," \"datasource-polling\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-textschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-text\""," ]"," },"," \"datasource-xmlschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"datatype-xml\","," \"dataschema-xml\""," ]"," },"," \"datatable\": {"," \"use\": ["," \"datatable-core\","," \"datatable-table\","," \"datatable-head\","," \"datatable-body\","," \"datatable-base\","," \"datatable-column-widths\","," \"datatable-message\","," \"datatable-mutable\","," \"datatable-sort\","," \"datatable-datasource\""," ]"," },"," \"datatable-base\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-table\","," \"datatable-head\","," \"datatable-body\","," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"datatable-base-deprecated\": {"," \"requires\": ["," \"recordset-base\","," \"widget\","," \"substitute\","," \"event-mouseenter\""," ],"," \"skinnable\": true"," },"," \"datatable-body\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-column-widths\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-core\": {"," \"requires\": ["," \"escape\","," \"model-list\","," \"node-event-delegate\""," ]"," },"," \"datatable-datasource\": {"," \"requires\": ["," \"datatable-base\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-datasource-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-deprecated\": {"," \"use\": ["," \"datatable-base-deprecated\","," \"datatable-datasource-deprecated\","," \"datatable-sort-deprecated\","," \"datatable-scroll-deprecated\""," ]"," },"," \"datatable-head\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-message\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-mutable\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-scroll\": {"," \"requires\": ["," \"datatable-base\","," \"datatable-column-widths\","," \"dom-screen\""," ],"," \"skinnable\": true"," },"," \"datatable-scroll-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\""," ]"," },"," \"datatable-sort\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-sort-deprecated\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"recordset-sort\""," ]"," },"," \"datatable-table\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-head\","," \"datatable-body\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatype\": {"," \"use\": ["," \"datatype-date\","," \"datatype-number\","," \"datatype-xml\""," ]"," },"," \"datatype-date\": {"," \"use\": ["," \"datatype-date-parse\","," \"datatype-date-format\","," \"datatype-date-math\""," ]"," },"," \"datatype-date-format\": {"," \"lang\": ["," \"ar\","," \"ar-JO\","," \"ca\","," \"ca-ES\","," \"da\","," \"da-DK\","," \"de\","," \"de-AT\","," \"de-DE\","," \"el\","," \"el-GR\","," \"en\","," \"en-AU\","," \"en-CA\","," \"en-GB\","," \"en-IE\","," \"en-IN\","," \"en-JO\","," \"en-MY\","," \"en-NZ\","," \"en-PH\","," \"en-SG\","," \"en-US\","," \"es\","," \"es-AR\","," \"es-BO\","," \"es-CL\","," \"es-CO\","," \"es-EC\","," \"es-ES\","," \"es-MX\","," \"es-PE\","," \"es-PY\","," \"es-US\","," \"es-UY\","," \"es-VE\","," \"fi\","," \"fi-FI\","," \"fr\","," \"fr-BE\","," \"fr-CA\","," \"fr-FR\","," \"hi\","," \"hi-IN\","," \"id\","," \"id-ID\","," \"it\","," \"it-IT\","," \"ja\","," \"ja-JP\","," \"ko\","," \"ko-KR\","," \"ms\","," \"ms-MY\","," \"nb\","," \"nb-NO\","," \"nl\","," \"nl-BE\","," \"nl-NL\","," \"pl\","," \"pl-PL\","," \"pt\","," \"pt-BR\","," \"ro\","," \"ro-RO\","," \"ru\","," \"ru-RU\","," \"sv\","," \"sv-SE\","," \"th\","," \"th-TH\","," \"tr\","," \"tr-TR\","," \"vi\","," \"vi-VN\","," \"zh-Hans\","," \"zh-Hans-CN\","," \"zh-Hant\","," \"zh-Hant-HK\","," \"zh-Hant-TW\""," ]"," },"," \"datatype-date-math\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"datatype-date-parse\": {},"," \"datatype-number\": {"," \"use\": ["," \"datatype-number-parse\","," \"datatype-number-format\""," ]"," },"," \"datatype-number-format\": {},"," \"datatype-number-parse\": {},"," \"datatype-xml\": {"," \"use\": ["," \"datatype-xml-parse\","," \"datatype-xml-format\""," ]"," },"," \"datatype-xml-format\": {},"," \"datatype-xml-parse\": {},"," \"dd\": {"," \"use\": ["," \"dd-ddm-base\","," \"dd-ddm\","," \"dd-ddm-drop\","," \"dd-drag\","," \"dd-proxy\","," \"dd-constrain\","," \"dd-drop\","," \"dd-scroll\","," \"dd-delegate\""," ]"," },"," \"dd-constrain\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-ddm\": {"," \"requires\": ["," \"dd-ddm-base\","," \"event-resize\""," ]"," },"," \"dd-ddm-base\": {"," \"requires\": ["," \"node\","," \"base\","," \"yui-throttle\","," \"classnamemanager\""," ]"," },"," \"dd-ddm-drop\": {"," \"requires\": ["," \"dd-ddm\""," ]"," },"," \"dd-delegate\": {"," \"requires\": ["," \"dd-drag\","," \"dd-drop-plugin\","," \"event-mouseenter\""," ]"," },"," \"dd-drag\": {"," \"requires\": ["," \"dd-ddm-base\""," ]"," },"," \"dd-drop\": {"," \"requires\": ["," \"dd-drag\","," \"dd-ddm-drop\""," ]"," },"," \"dd-drop-plugin\": {"," \"requires\": ["," \"dd-drop\""," ]"," },"," \"dd-gestures\": {"," \"condition\": {"," \"name\": \"dd-gestures\","," \"trigger\": \"dd-drag\","," \"ua\": \"touchEnabled\""," },"," \"requires\": ["," \"dd-drag\","," \"event-synthetic\","," \"event-gestures\""," ]"," },"," \"dd-plugin\": {"," \"optional\": ["," \"dd-constrain\","," \"dd-proxy\""," ],"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-proxy\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-scroll\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dial\": {"," \"lang\": ["," \"en\","," \"es\""," ],"," \"requires\": ["," \"widget\","," \"dd-drag\","," \"event-mouseenter\","," \"event-move\","," \"event-key\","," \"transition\","," \"intl\""," ],"," \"skinnable\": true"," },"," \"dom\": {"," \"use\": ["," \"dom-base\","," \"dom-screen\","," \"dom-style\","," \"selector-native\","," \"selector\""," ]"," },"," \"dom-base\": {"," \"requires\": ["," \"dom-core\""," ]"," },"," \"dom-core\": {"," \"requires\": ["," \"oop\","," \"features\""," ]"," },"," \"dom-deprecated\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-screen\": {"," \"requires\": ["," \"dom-base\","," \"dom-style\""," ]"," },"," \"dom-style\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-style-ie\": {"," \"condition\": {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\""," },"," \"requires\": ["," \"dom-style\""," ]"," },"," \"dump\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"editor\": {"," \"use\": ["," \"frame\","," \"editor-selection\","," \"exec-command\","," \"editor-base\","," \"editor-para\","," \"editor-br\","," \"editor-bidi\","," \"editor-tab\","," \"createlink-base\""," ]"," },"," \"editor-base\": {"," \"requires\": ["," \"base\","," \"frame\","," \"node\","," \"exec-command\","," \"editor-selection\""," ]"," },"," \"editor-bidi\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-br\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-lists\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para\": {"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-para-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para-ie\": {"," \"condition\": {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\""," },"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-selection\": {"," \"requires\": ["," \"node\""," ]"," },"," \"editor-tab\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"escape\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"event\": {"," \"after\": ["," \"node-base\""," ],"," \"use\": ["," \"event-base\","," \"event-delegate\","," \"event-synthetic\","," \"event-mousewheel\","," \"event-mouseenter\","," \"event-key\","," \"event-focus\","," \"event-resize\","," \"event-hover\","," \"event-outside\","," \"event-touch\","," \"event-move\","," \"event-flick\","," \"event-valuechange\","," \"event-tap\""," ]"," },"," \"event-base\": {"," \"after\": ["," \"node-base\""," ],"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-base-ie\": {"," \"after\": ["," \"event-base\""," ],"," \"condition\": {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\""," },"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-contextmenu\": {"," \"requires\": ["," \"event-synthetic\","," \"dom-screen\""," ]"," },"," \"event-custom\": {"," \"use\": ["," \"event-custom-base\","," \"event-custom-complex\""," ]"," },"," \"event-custom-base\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"event-custom-complex\": {"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-delegate\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-flick\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-focus\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-gestures\": {"," \"use\": ["," \"event-flick\","," \"event-move\""," ]"," },"," \"event-hover\": {"," \"requires\": ["," \"event-mouseenter\""," ]"," },"," \"event-key\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mouseenter\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mousewheel\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-move\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-outside\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-resize\": {"," \"requires\": ["," \"node-base\","," \"event-synthetic\""," ]"," },"," \"event-simulate\": {"," \"requires\": ["," \"event-base\""," ]"," },"," \"event-synthetic\": {"," \"requires\": ["," \"node-base\","," \"event-custom-complex\""," ]"," },"," \"event-tap\": {"," \"requires\": ["," \"node-base\","," \"event-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-touch\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-valuechange\": {"," \"requires\": ["," \"event-focus\","," \"event-synthetic\""," ]"," },"," \"exec-command\": {"," \"requires\": ["," \"frame\""," ]"," },"," \"features\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"file\": {"," \"requires\": ["," \"file-flash\","," \"file-html5\""," ]"," },"," \"file-flash\": {"," \"requires\": ["," \"base\""," ]"," },"," \"file-html5\": {"," \"requires\": ["," \"base\""," ]"," },"," \"frame\": {"," \"requires\": ["," \"base\","," \"node\","," \"selector-css3\","," \"yui-throttle\""," ]"," },"," \"gesture-simulate\": {"," \"requires\": ["," \"async-queue\","," \"event-simulate\","," \"node-screen\""," ]"," },"," \"get\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"graphics\": {"," \"requires\": ["," \"node\","," \"event-custom\","," \"pluginhost\","," \"matrix\","," \"classnamemanager\""," ]"," },"," \"graphics-canvas\": {"," \"condition\": {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-canvas-default\": {"," \"condition\": {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-svg\": {"," \"condition\": {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-svg-default\": {"," \"condition\": {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-vml\": {"," \"condition\": {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-vml-default\": {"," \"condition\": {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," }"," },"," \"handlebars\": {"," \"use\": ["," \"handlebars-compiler\""," ]"," },"," \"handlebars-base\": {"," \"requires\": ["," \"escape\""," ]"," },"," \"handlebars-compiler\": {"," \"requires\": ["," \"handlebars-base\""," ]"," },"," \"highlight\": {"," \"use\": ["," \"highlight-base\","," \"highlight-accentfold\""," ]"," },"," \"highlight-accentfold\": {"," \"requires\": ["," \"highlight-base\","," \"text-accentfold\""," ]"," },"," \"highlight-base\": {"," \"requires\": ["," \"array-extras\","," \"classnamemanager\","," \"escape\","," \"text-wordbreak\""," ]"," },"," \"history\": {"," \"use\": ["," \"history-base\","," \"history-hash\","," \"history-hash-ie\","," \"history-html5\""," ]"," },"," \"history-base\": {"," \"requires\": ["," \"event-custom-complex\""," ]"," },"," \"history-hash\": {"," \"after\": ["," \"history-html5\""," ],"," \"requires\": ["," \"event-synthetic\","," \"history-base\","," \"yui-later\""," ]"," },"," \"history-hash-ie\": {"," \"condition\": {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\""," },"," \"requires\": ["," \"history-hash\","," \"node-base\""," ]"," },"," \"history-html5\": {"," \"optional\": ["," \"json\""," ],"," \"requires\": ["," \"event-base\","," \"history-base\","," \"node-base\""," ]"," },"," \"imageloader\": {"," \"requires\": ["," \"base-base\","," \"node-style\","," \"node-screen\""," ]"," },"," \"intl\": {"," \"requires\": ["," \"intl-base\","," \"event-custom\""," ]"," },"," \"intl-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"io\": {"," \"use\": ["," \"io-base\","," \"io-xdr\","," \"io-form\","," \"io-upload-iframe\","," \"io-queue\""," ]"," },"," \"io-base\": {"," \"requires\": ["," \"event-custom-base\","," \"querystring-stringify-simple\""," ]"," },"," \"io-form\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-nodejs\": {"," \"condition\": {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\""," },"," \"requires\": ["," \"io-base\""," ]"," },"," \"io-queue\": {"," \"requires\": ["," \"io-base\","," \"queue-promote\""," ]"," },"," \"io-upload-iframe\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-xdr\": {"," \"requires\": ["," \"io-base\","," \"datatype-xml-parse\""," ]"," },"," \"json\": {"," \"use\": ["," \"json-parse\","," \"json-stringify\""," ]"," },"," \"json-parse\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"json-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"jsonp\": {"," \"requires\": ["," \"get\","," \"oop\""," ]"," },"," \"jsonp-url\": {"," \"requires\": ["," \"jsonp\""," ]"," },"," \"lazy-model-list\": {"," \"requires\": ["," \"model-list\""," ]"," },"," \"loader\": {"," \"use\": ["," \"loader-base\","," \"loader-rollup\","," \"loader-yui3\""," ]"," },"," \"loader-base\": {"," \"requires\": ["," \"get\","," \"features\""," ]"," },"," \"loader-rollup\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"loader-yui3\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"matrix\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"model\": {"," \"requires\": ["," \"base-build\","," \"escape\","," \"json-parse\""," ]"," },"," \"model-list\": {"," \"requires\": ["," \"array-extras\","," \"array-invoke\","," \"arraylist\","," \"base-build\","," \"escape\","," \"json-parse\","," \"model\""," ]"," },"," \"model-sync-rest\": {"," \"requires\": ["," \"model\","," \"io-base\","," \"json-stringify\""," ]"," },"," \"node\": {"," \"use\": ["," \"node-base\","," \"node-event-delegate\","," \"node-pluginhost\","," \"node-screen\","," \"node-style\""," ]"," },"," \"node-base\": {"," \"requires\": ["," \"event-base\","," \"node-core\","," \"dom-base\""," ]"," },"," \"node-core\": {"," \"requires\": ["," \"dom-core\","," \"selector\""," ]"," },"," \"node-deprecated\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-delegate\": {"," \"requires\": ["," \"node-base\","," \"event-delegate\""," ]"," },"," \"node-event-html5\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-simulate\": {"," \"requires\": ["," \"node-base\","," \"event-simulate\","," \"gesture-simulate\""," ]"," },"," \"node-flick\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"event-flick\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"node-focusmanager\": {"," \"requires\": ["," \"attribute\","," \"node\","," \"plugin\","," \"node-event-simulate\","," \"event-key\","," \"event-focus\""," ]"," },"," \"node-load\": {"," \"requires\": ["," \"node-base\","," \"io-base\""," ]"," },"," \"node-menunav\": {"," \"requires\": ["," \"node\","," \"classnamemanager\","," \"plugin\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"node-pluginhost\": {"," \"requires\": ["," \"node-base\","," \"pluginhost\""," ]"," },"," \"node-screen\": {"," \"requires\": ["," \"dom-screen\","," \"node-base\""," ]"," },"," \"node-scroll-info\": {"," \"requires\": ["," \"base-build\","," \"dom-screen\","," \"event-resize\","," \"node-pluginhost\","," \"plugin\""," ]"," },"," \"node-style\": {"," \"requires\": ["," \"dom-style\","," \"node-base\""," ]"," },"," \"oop\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"overlay\": {"," \"requires\": ["," \"widget\","," \"widget-stdmod\","," \"widget-position\","," \"widget-position-align\","," \"widget-stack\","," \"widget-position-constrain\""," ],"," \"skinnable\": true"," },"," \"panel\": {"," \"requires\": ["," \"widget\","," \"widget-autohide\","," \"widget-buttons\","," \"widget-modality\","," \"widget-position\","," \"widget-position-align\","," \"widget-position-constrain\","," \"widget-stack\","," \"widget-stdmod\""," ],"," \"skinnable\": true"," },"," \"parallel\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pjax\": {"," \"requires\": ["," \"pjax-base\","," \"pjax-content\""," ]"," },"," \"pjax-base\": {"," \"requires\": ["," \"classnamemanager\","," \"node-event-delegate\","," \"router\""," ]"," },"," \"pjax-content\": {"," \"requires\": ["," \"io-base\","," \"node-base\","," \"router\""," ]"," },"," \"pjax-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"pjax\","," \"plugin\""," ]"," },"," \"plugin\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"pluginhost\": {"," \"use\": ["," \"pluginhost-base\","," \"pluginhost-config\""," ]"," },"," \"pluginhost-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pluginhost-config\": {"," \"requires\": ["," \"pluginhost-base\""," ]"," },"," \"profiler\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring\": {"," \"use\": ["," \"querystring-parse\","," \"querystring-stringify\""," ]"," },"," \"querystring-parse\": {"," \"requires\": ["," \"yui-base\","," \"array-extras\""," ]"," },"," \"querystring-parse-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"queue-promote\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"range-slider\": {"," \"requires\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\""," ]"," },"," \"recordset\": {"," \"use\": ["," \"recordset-base\","," \"recordset-sort\","," \"recordset-filter\","," \"recordset-indexer\""," ]"," },"," \"recordset-base\": {"," \"requires\": ["," \"base\","," \"arraylist\""," ]"," },"," \"recordset-filter\": {"," \"requires\": ["," \"recordset-base\","," \"array-extras\","," \"plugin\""," ]"," },"," \"recordset-indexer\": {"," \"requires\": ["," \"recordset-base\","," \"plugin\""," ]"," },"," \"recordset-sort\": {"," \"requires\": ["," \"arraysort\","," \"recordset-base\","," \"plugin\""," ]"," },"," \"resize\": {"," \"use\": ["," \"resize-base\","," \"resize-proxy\","," \"resize-constrain\""," ]"," },"," \"resize-base\": {"," \"requires\": ["," \"base\","," \"widget\","," \"event\","," \"oop\","," \"dd-drag\","," \"dd-delegate\","," \"dd-drop\""," ],"," \"skinnable\": true"," },"," \"resize-constrain\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"resize-plugin\": {"," \"optional\": ["," \"resize-constrain\""," ],"," \"requires\": ["," \"resize-base\","," \"plugin\""," ]"," },"," \"resize-proxy\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"router\": {"," \"optional\": ["," \"querystring-parse\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"history\""," ]"," },"," \"scrollview\": {"," \"requires\": ["," \"scrollview-base\","," \"scrollview-scrollbars\""," ]"," },"," \"scrollview-base\": {"," \"requires\": ["," \"widget\","," \"event-gestures\","," \"event-mousewheel\","," \"transition\""," ],"," \"skinnable\": true"," },"," \"scrollview-base-ie\": {"," \"condition\": {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"scrollview-base\""," ]"," },"," \"scrollview-list\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ],"," \"skinnable\": true"," },"," \"scrollview-paginator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ]"," },"," \"scrollview-scrollbars\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"selector\": {"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css2\": {"," \"condition\": {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\""," },"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css3\": {"," \"requires\": ["," \"selector-native\","," \"selector-css2\""," ]"," },"," \"selector-native\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"shim-plugin\": {"," \"requires\": ["," \"node-style\","," \"node-pluginhost\""," ]"," },"," \"slider\": {"," \"use\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\","," \"range-slider\""," ]"," },"," \"slider-base\": {"," \"requires\": ["," \"widget\","," \"dd-constrain\","," \"event-key\""," ],"," \"skinnable\": true"," },"," \"slider-value-range\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"sortable\": {"," \"requires\": ["," \"dd-delegate\","," \"dd-drop-plugin\","," \"dd-proxy\""," ]"," },"," \"sortable-scroll\": {"," \"requires\": ["," \"dd-scroll\","," \"sortable\""," ]"," },"," \"stylesheet\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"substitute\": {"," \"optional\": ["," \"dump\""," ],"," \"requires\": ["," \"yui-base\""," ]"," },"," \"swf\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"swfdetect\","," \"escape\""," ]"," },"," \"swfdetect\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"tabview\": {"," \"requires\": ["," \"widget\","," \"widget-parent\","," \"widget-child\","," \"tabview-base\","," \"node-pluginhost\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"tabview-base\": {"," \"requires\": ["," \"node-event-delegate\","," \"classnamemanager\","," \"skin-sam-tabview\""," ]"," },"," \"tabview-plugin\": {"," \"requires\": ["," \"tabview-base\""," ]"," },"," \"test\": {"," \"requires\": ["," \"event-simulate\","," \"event-custom\","," \"json-stringify\""," ]"," },"," \"test-console\": {"," \"requires\": ["," \"console-filters\","," \"test\","," \"array-extras\""," ],"," \"skinnable\": true"," },"," \"text\": {"," \"use\": ["," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"text-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-data-accentfold\""," ]"," },"," \"text-data-accentfold\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-data-wordbreak\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-wordbreak\": {"," \"requires\": ["," \"array-extras\","," \"text-data-wordbreak\""," ]"," },"," \"transition\": {"," \"requires\": ["," \"node-style\""," ]"," },"," \"transition-timer\": {"," \"condition\": {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);"," }",""," return ret;","},"," \"trigger\": \"transition\""," },"," \"requires\": ["," \"transition\""," ]"," },"," \"uploader\": {"," \"requires\": ["," \"uploader-html5\","," \"uploader-flash\""," ]"," },"," \"uploader-deprecated\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"base\","," \"swf\""," ]"," },"," \"uploader-flash\": {"," \"requires\": ["," \"swf\","," \"widget\","," \"substitute\","," \"base\","," \"cssbutton\","," \"node\","," \"event-custom\","," \"file-flash\","," \"uploader-queue\""," ]"," },"," \"uploader-html5\": {"," \"requires\": ["," \"widget\","," \"node-event-simulate\","," \"substitute\","," \"file-html5\","," \"uploader-queue\""," ]"," },"," \"uploader-queue\": {"," \"requires\": ["," \"base\""," ]"," },"," \"view\": {"," \"requires\": ["," \"base-build\","," \"node-event-delegate\""," ]"," },"," \"view-node-map\": {"," \"requires\": ["," \"view\""," ]"," },"," \"widget\": {"," \"use\": ["," \"widget-base\","," \"widget-htmlparser\","," \"widget-skin\","," \"widget-uievents\""," ]"," },"," \"widget-anim\": {"," \"requires\": ["," \"anim-base\","," \"plugin\","," \"widget\""," ]"," },"," \"widget-autohide\": {"," \"requires\": ["," \"base-build\","," \"event-key\","," \"event-outside\","," \"widget\""," ]"," },"," \"widget-base\": {"," \"requires\": ["," \"attribute\","," \"base-base\","," \"base-pluginhost\","," \"classnamemanager\","," \"event-focus\","," \"node-base\","," \"node-style\""," ],"," \"skinnable\": true"," },"," \"widget-base-ie\": {"," \"condition\": {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-buttons\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget-stdmod\""," ]"," },"," \"widget-child\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-htmlparser\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-locale\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-modality\": {"," \"requires\": ["," \"base-build\","," \"event-outside\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-parent\": {"," \"requires\": ["," \"arraylist\","," \"base-build\","," \"widget\""," ]"," },"," \"widget-position\": {"," \"requires\": ["," \"base-build\","," \"node-screen\","," \"widget\""," ]"," },"," \"widget-position-align\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-position-constrain\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-skin\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-stack\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-stdmod\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-uievents\": {"," \"requires\": ["," \"node-event-delegate\","," \"widget-base\""," ]"," },"," \"yql\": {"," \"requires\": ["," \"jsonp\","," \"jsonp-url\""," ]"," },"," \"yql-nodejs\": {"," \"condition\": {"," \"name\": \"yql-nodejs\","," \"trigger\": \"yql\","," \"ua\": \"nodejs\","," \"when\": \"after\""," }"," },"," \"yql-winjs\": {"," \"condition\": {"," \"name\": \"yql-winjs\","," \"trigger\": \"yql\","," \"ua\": \"winjs\","," \"when\": \"after\""," }"," },"," \"yui\": {},"," \"yui-base\": {},"," \"yui-later\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-log\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-throttle\": {"," \"requires\": ["," \"yui-base\""," ]"," }","};","YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df';","","","}, '3.7.3', {\"requires\": [\"loader-base\"]});"];+_yuitest_coverage["build/loader-yui3/loader-yui3.js"].lines = {"1":0,"10":0,"119":0,"122":0,"123":0,"126":0,"284":0,"1097":0,"1104":0,"1106":0,"1110":0,"1112":0,"1116":0,"1119":0,"1242":0,"1243":0,"1423":0,"1427":0,"1439":0,"1443":0,"1452":0,"1457":0,"1469":0,"1474":0,"1483":0,"1485":0,"1497":0,"1499":0,"1566":0,"1568":0,"2112":0,"2115":0,"2275":0,"2279":0,"2280":0,"2283":0,"2507":0};+_yuitest_coverage["build/loader-yui3/loader-yui3.js"].functions = {"\"test\":118":0,"\"test\":272":0,"test:1105":0,"test:1111":0,"\"test\":1095":0,"\"test\":1241":0,"\"test\":1422":0,"\"test\":1438":0,"\"test\":1451":0,"\"test\":1468":0,"\"test\":1482":0,"\"test\":1496":0,"\"test\":1565":0,"\"test\":2111":0,"\"test\":2274":0,"(anonymous 1):1":0};+_yuitest_coverage["build/loader-yui3/loader-yui3.js"].coveredLines = 37;+_yuitest_coverage["build/loader-yui3/loader-yui3.js"].coveredFunctions = 16; _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1); YUI.add('loader-yui3', function (Y, NAME) { @@ -166,7 +166,7 @@ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 122); if (node && node.style) { _yuitest_coverline("build/loader-yui3/loader-yui3.js", 123);-return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } _yuitest_coverline("build/loader-yui3/loader-yui3.js", 126);@@ -733,6 +733,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -1057,12 +1058,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1011);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1012);-return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -1146,8 +1143,8 @@ "name": "dom-style-ie", "test": function (Y) { - _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1096);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1098);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1095);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1097); var testFeature = Y.Features.test, addFeature = Y.Features.add, WINDOW = Y.config.win,@@ -1155,29 +1152,29 @@ DOCUMENT_ELEMENT = 'documentElement', ret = false; - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1105);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1104); addFeature('style', 'computedStyle', { test: function() {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "test", 1106);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1107);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "test", 1105);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1106); return WINDOW && 'getComputedStyle' in WINDOW; } }); - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1111);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1110); addFeature('style', 'opacity', { test: function() {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "test", 1112);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1113);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "test", 1111);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1112); return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style; } }); - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1117);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1116); ret = (!testFeature('style', 'opacity') && !testFeature('style', 'computedStyle')); - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1120);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1119); return ret; }, "trigger": "dom-style"@@ -1301,10 +1298,10 @@ "condition": { "name": "event-base-ie", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1242);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1243);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1241);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1242); var imp = Y.config.doc && Y.config.doc.implementation;- _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1244);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1243); return (imp && (!imp.hasFeature('Events', '2.0'))); }, "trigger": "node-base"@@ -1485,13 +1482,13 @@ "condition": { "name": "graphics-canvas", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1423);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1424);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1422);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1423); var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));- _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1428);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1427); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics"@@ -1504,13 +1501,13 @@ "condition": { "name": "graphics-canvas-default", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1439);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1440);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1438);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1439); var DOCUMENT = Y.config.doc, useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1"));- _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1444);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1443); return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext("2d")); }, "trigger": "graphics"@@ -1520,14 +1517,14 @@ "condition": { "name": "graphics-svg", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1452);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1453);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1451);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1452); var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1458);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1457); return svg && (useSVG || !canvas); }, "trigger": "graphics"@@ -1540,14 +1537,14 @@ "condition": { "name": "graphics-svg-default", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1469);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1470);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1468);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1469); var DOCUMENT = Y.config.doc, useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != "canvas", canvas = DOCUMENT && DOCUMENT.createElement("canvas"), svg = (DOCUMENT && DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")); - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1475);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1474); return svg && (useSVG || !canvas); }, "trigger": "graphics"@@ -1557,11 +1554,11 @@ "condition": { "name": "graphics-vml", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1483);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1484);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1482);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1483); var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas");- _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1486);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1485); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics"@@ -1574,11 +1571,11 @@ "condition": { "name": "graphics-vml-default", "test": function(Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1497);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1498);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1496);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1497); var DOCUMENT = Y.config.doc, canvas = DOCUMENT && DOCUMENT.createElement("canvas");- _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1500);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1499); return (DOCUMENT && !DOCUMENT.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1") && (!canvas || !canvas.getContext || !canvas.getContext("2d"))); }, "trigger": "graphics"@@ -1646,11 +1643,11 @@ "condition": { "name": "history-hash-ie", "test": function (Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1566);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1567);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 1565);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 1566); var docMode = Y.config.doc && Y.config.doc.documentMode; - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1569);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 1568); return Y.UA.ie && (!('onhashchange' in Y.config.win) || !docMode || docMode < 8); },@@ -2195,12 +2192,12 @@ "condition": { "name": "selector-css2", "test": function (Y) {- _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 2112);-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 2113);+ _yuitest_coverfunc("build/loader-yui3/loader-yui3.js", "\"test\"", 2111);+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 2112); var DOCUMENT = Y.config.doc, ret = DOCUMENT && !('querySelectorAll' in DOCUMENT); - _yuitest_coverline("build/loader-yui3/loader-yui3.js", 2116);+ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 2115); return ret; }, "trigger": "selector"@@ -2319,7 +2316,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -2369,8 +2367,8 @@ _yuitest_coverline("build/loader-yui3/loader-yui3.js", 2279); if (node && node.style) { _yuitest_coverline("build/loader-yui3/loader-yui3.js", 2280);-ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } +ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } _yuitest_coverline("build/loader-yui3/loader-yui3.js", 2283); return ret;@@ -2563,6 +2561,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -2581,8 +2595,8 @@ ] } };-_yuitest_coverline("build/loader-yui3/loader-yui3.js", 2491);-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+_yuitest_coverline("build/loader-yui3/loader-yui3.js", 2507);+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]});
bundle/loader-yui3/loader-yui3-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -126,7 +126,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -690,6 +690,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -1014,10 +1015,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -2237,7 +2236,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -2283,8 +2283,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -2476,6 +2476,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -2494,7 +2510,7 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]});
bundle/loader-yui3/loader-yui3-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="5fe7d71505fef8108b090c35db73bcde"},"3.7.2",{requires:["loader-base"]});+YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"}},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="a28e022ad022130f7a4fb4ac77a2f1df"},"3.7.3",{requires:["loader-base"]});
bundle/loader-yui3/loader-yui3.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -126,7 +126,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -690,6 +690,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -1014,10 +1015,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -2237,7 +2236,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -2283,8 +2283,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -2476,6 +2476,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -2494,7 +2510,7 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]});
bundle/loader/loader-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/loader/loader.js", code: [] };-_yuitest_coverage["/build/loader/loader.js"].code=["YUI.add('loader-base', function(Y) {","","/**"," * The YUI loader core"," * @module loader"," * @submodule loader-base"," */","","if (!YUI.Env[Y.version]) {",""," (function() {"," var VERSION = Y.version,"," BUILD = '/build/',"," ROOT = VERSION + BUILD,"," CDN_BASE = Y.Env.base,"," GALLERY_VERSION = 'gallery-2012.08.22-20-00',"," TNT = '2in3',"," TNT_VERSION = '4',"," YUI2_VERSION = '2.9.0',"," COMBO_BASE = CDN_BASE + 'combo?',"," META = { version: VERSION,"," root: ROOT,"," base: Y.Env.base,"," comboBase: COMBO_BASE,"," skin: { defaultSkin: 'sam',"," base: 'assets/skins/',"," path: 'skin.css',"," after: ['cssreset',"," 'cssfonts',"," 'cssgrids',"," 'cssbase',"," 'cssreset-context',"," 'cssfonts-context']},"," groups: {},"," patterns: {} },"," groups = META.groups,"," yui2Update = function(tnt, yui2, config) {"," "," var root = TNT + '.' +"," (tnt || TNT_VERSION) + '/' +"," (yui2 || YUI2_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.yui2.base = base + root;"," groups.yui2.root = root;"," groups.yui2.comboBase = combo;"," },"," galleryUpdate = function(tag, config) {"," var root = (tag || GALLERY_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.gallery.base = base + root;"," groups.gallery.root = root;"," groups.gallery.comboBase = combo;"," };","",""," groups[VERSION] = {};",""," groups.gallery = {"," ext: false,"," combine: true,"," comboBase: COMBO_BASE,"," update: galleryUpdate,"," patterns: { 'gallery-': { },"," 'lang/gallery-': {},"," 'gallerycss-': { type: 'css' } }"," };",""," groups.yui2 = {"," combine: true,"," ext: false,"," comboBase: COMBO_BASE,"," update: yui2Update,"," patterns: {"," 'yui2-': {"," configFn: function(me) {"," if (/-skin|reset|fonts|grids|base/.test(me.name)) {"," me.type = 'css';"," me.path = me.path.replace(/\\.js/, '.css');"," // this makes skins in builds earlier than"," // 2.6.0 work as long as combine is false"," me.path = me.path.replace(/\\/yui2-skin/,"," '/assets/skins/sam/yui2-skin');"," }"," }"," }"," }"," };",""," galleryUpdate();"," yui2Update();",""," YUI.Env[VERSION] = META;"," }());","}","","","/*jslint forin: true */","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * information for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can also load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files."," *"," * @module loader"," * @main loader"," * @submodule loader-base"," */","","var NOT_FOUND = {},"," NO_REQUIREMENTS = [],"," MAX_URL_LENGTH = 1024,"," GLOBAL_ENV = YUI.Env,"," GLOBAL_LOADED = GLOBAL_ENV._loaded,"," CSS = 'css',"," JS = 'js',"," INTL = 'intl',"," DEFAULT_SKIN = 'sam',"," VERSION = Y.version,"," ROOT_LANG = '',"," YObject = Y.Object,"," oeach = YObject.each,"," YArray = Y.Array,"," _queue = GLOBAL_ENV._loaderQueue,"," META = GLOBAL_ENV[VERSION],"," SKIN_PREFIX = 'skin-',"," L = Y.Lang,"," ON_PAGE = GLOBAL_ENV.mods,"," modulekey,"," cache,"," _path = function(dir, file, type, nomin) {"," var path = dir + '/' + file;"," if (!nomin) {"," path += '-min';"," }"," path += '.' + (type || CSS);",""," return path;"," };","",""," if (!YUI.Env._cssLoaded) {"," YUI.Env._cssLoaded = {};"," }","","","/**"," * The component metadata is stored in Y.Env.meta."," * Part of the loader module."," * @property meta"," * @for YUI"," */","Y.Env.meta = META;","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * info for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files. You can also specify an external, custom combo service to host"," * your modules as well.",""," var Y = YUI();"," var loader = new Y.Loader({"," filter: 'debug',"," base: '../../',"," root: 'build/',"," combine: true,"," require: ['node', 'dd', 'console']"," });"," var out = loader.resolve(true);"," "," * @constructor"," * @class Loader"," * @param {Object} config an optional set of configuration options."," * @param {String} config.base The base dir which to fetch this module from"," * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`"," * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`"," * @param {String|Object} config.filter A filter to apply to result urls. <a href=\"#property_filter\">See filter property</a>"," * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config."," * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies"," * @param {Boolean} [config.async=true] Fetch files in async"," * @param {Array} config.ignore: A list of modules that should never be dynamically loaded"," * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page"," * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes"," * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes"," * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes"," * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout"," * @param {Object} config.context Execution context for all callbacks"," * @param {Function} config.onSuccess Callback for the 'success' event"," * @param {Function} config.onFailure Callback for the 'failure' event"," * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading."," * @param {Function} config.onTimeout Callback for the 'timeout' event"," * @param {Function} config.onProgress Callback executed each time a script or css file is loaded"," * @param {Object} config.modules A list of module definitions. See <a href=\"#method_addModule\">Loader.addModule</a> for the supported module metadata"," * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`."," * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox."," * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward."," */","Y.Loader = function(o) {",""," var self = this;"," "," //Catch no config passed."," o = o || {};",""," modulekey = META.md5;",""," /**"," * Internal callback to handle multiple internal insert() calls"," * so that css is inserted prior to js"," * @property _internalCallback"," * @private"," */"," // self._internalCallback = null;",""," /**"," * Callback that will be executed when the loader is finished"," * with an insert"," * @method onSuccess"," * @type function"," */"," // self.onSuccess = null;",""," /**"," * Callback that will be executed if there is a failure"," * @method onFailure"," * @type function"," */"," // self.onFailure = null;",""," /**"," * Callback for the 'CSSComplete' event. When loading YUI components"," * with CSS the CSS is loaded first, then the script. This provides"," * a moment you can tie into to improve the presentation of the page"," * while the script is loading."," * @method onCSS"," * @type function"," */"," // self.onCSS = null;",""," /**"," * Callback executed each time a script or css file is loaded"," * @method onProgress"," * @type function"," */"," // self.onProgress = null;",""," /**"," * Callback that will be executed if a timeout occurs"," * @method onTimeout"," * @type function"," */"," // self.onTimeout = null;",""," /**"," * The execution context for all callbacks"," * @property context"," * @default {YUI} the YUI instance"," */"," self.context = Y;",""," /**"," * Data that is passed to all callbacks"," * @property data"," */"," // self.data = null;",""," /**"," * Node reference or id where new nodes should be inserted before"," * @property insertBefore"," * @type string|HTMLElement"," */"," // self.insertBefore = null;",""," /**"," * The charset attribute for inserted nodes"," * @property charset"," * @type string"," * @deprecated , use cssAttributes or jsAttributes."," */"," // self.charset = null;",""," /**"," * An object literal containing attributes to add to link nodes"," * @property cssAttributes"," * @type object"," */"," // self.cssAttributes = null;",""," /**"," * An object literal containing attributes to add to script nodes"," * @property jsAttributes"," * @type object"," */"," // self.jsAttributes = null;",""," /**"," * The base directory."," * @property base"," * @type string"," * @default http://yui.yahooapis.com/[YUI VERSION]/build/"," */"," self.base = Y.Env.meta.base + Y.Env.meta.root;",""," /**"," * Base path for the combo service"," * @property comboBase"," * @type string"," * @default http://yui.yahooapis.com/combo?"," */"," self.comboBase = Y.Env.meta.comboBase;",""," /*"," * Base path for language packs."," */"," // self.langBase = Y.Env.meta.langBase;"," // self.lang = \"\";",""," /**"," * If configured, the loader will attempt to use the combo"," * service for YUI resources and configured external resources."," * @property combine"," * @type boolean"," * @default true if a base dir isn't in the config"," */"," self.combine = o.base &&"," (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);"," "," /**"," * The default seperator to use between files in a combo URL"," * @property comboSep"," * @type {String}"," * @default Ampersand"," */"," self.comboSep = '&';"," /**"," * Max url length for combo urls. The default is 1024. This is the URL"," * limit for the Yahoo! hosted combo servers. If consuming"," * a different combo service that has a different URL limit"," * it is possible to override this default by supplying"," * the maxURLLength config option. The config option will"," * only take effect if lower than the default."," *"," * @property maxURLLength"," * @type int"," */"," self.maxURLLength = MAX_URL_LENGTH;",""," /**"," * Ignore modules registered on the YUI global"," * @property ignoreRegistered"," * @default false"," */"," self.ignoreRegistered = o.ignoreRegistered;",""," /**"," * Root path to prepend to module path for the combo"," * service"," * @property root"," * @type string"," * @default [YUI VERSION]/build/"," */"," self.root = Y.Env.meta.root;",""," /**"," * Timeout value in milliseconds. If set, self value will be used by"," * the get utility. the timeout event will fire if"," * a timeout occurs."," * @property timeout"," * @type int"," */"," self.timeout = 0;",""," /**"," * A list of modules that should not be loaded, even if"," * they turn up in the dependency tree"," * @property ignore"," * @type string[]"," */"," // self.ignore = null;",""," /**"," * A list of modules that should always be loaded, even"," * if they have already been inserted into the page."," * @property force"," * @type string[]"," */"," // self.force = null;",""," self.forceMap = {};",""," /**"," * Should we allow rollups"," * @property allowRollup"," * @type boolean"," * @default false"," */"," self.allowRollup = false;",""," /**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js)."," * </dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * @property filter"," * @type string| {searchExp: string, replaceStr: string}"," */"," // self.filter = null;",""," /**"," * per-component filter specification. If specified for a given"," * component, this overrides the filter config."," * @property filters"," * @type object"," */"," self.filters = {};",""," /**"," * The list of requested modules"," * @property required"," * @type {string: boolean}"," */"," self.required = {};",""," /**"," * If a module name is predefined when requested, it is checked againsts"," * the patterns provided in this property. If there is a match, the"," * module is added with the default configuration."," *"," * At the moment only supporting module prefixes, but anticipate"," * supporting at least regular expressions."," * @property patterns"," * @type Object"," */"," // self.patterns = Y.merge(Y.Env.meta.patterns);"," self.patterns = {};",""," /**"," * The library metadata"," * @property moduleInfo"," */"," // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);"," self.moduleInfo = {};",""," self.groups = Y.merge(Y.Env.meta.groups);",""," /**"," * Provides the information used to skin the skinnable components."," * The following skin definition would result in 'skin1' and 'skin2'"," * being loaded for calendar (if calendar was requested), and"," * 'sam' for all other skinnable components:"," *"," * skin: {"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin. ex:"," * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/"," * base: 'assets/skins/',"," * "," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * calendar: ['skin1', 'skin2']"," * }"," * }"," * @property skin"," * @type {Object}"," */"," self.skin = Y.merge(Y.Env.meta.skin);",""," /*"," * Map of conditional modules"," * @since 3.2.0"," */"," self.conditions = {};",""," // map of modules with a hash of modules that meet the requirement"," // self.provides = {};",""," self.config = o;"," self._internal = true;",""," self._populateCache();",""," /**"," * Set when beginning to compute the dependency tree."," * Composed of what YUI reports to be loaded combined"," * with what has been loaded by any instance on the page"," * with the version number specified in the metadata."," * @property loaded"," * @type {string: boolean}"," */"," self.loaded = GLOBAL_LOADED[VERSION];",""," "," /**"," * Should Loader fetch scripts in `async`, defaults to `true`"," * @property async"," */",""," self.async = true;",""," self._inspectPage();",""," self._internal = false;",""," self._config(o);",""," self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; ",""," self.testresults = null;",""," if (Y.config.tests) {"," self.testresults = Y.config.tests;"," }"," "," /**"," * List of rollup files found in the library metadata"," * @property rollups"," */"," // self.rollups = null;",""," /**"," * Whether or not to load optional dependencies for"," * the requested modules"," * @property loadOptional"," * @type boolean"," * @default false"," */"," // self.loadOptional = false;",""," /**"," * All of the derived dependencies in sorted order, which"," * will be populated when either calculate() or insert()"," * is called"," * @property sorted"," * @type string[]"," */"," self.sorted = [];",""," /*"," * A list of modules to attach to the YUI instance when complete."," * If not supplied, the sorted list of dependencies are applied."," * @property attaching"," */"," // self.attaching = null;",""," /**"," * Flag to indicate the dependency tree needs to be recomputed"," * if insert is called again."," * @property dirty"," * @type boolean"," * @default true"," */"," self.dirty = true;",""," /**"," * List of modules inserted by the utility"," * @property inserted"," * @type {string: boolean}"," */"," self.inserted = {};",""," /**"," * List of skipped modules during insert() because the module"," * was not defined"," * @property skipped"," */"," self.skipped = {};",""," // Y.on('yui:load', self.loadNext, self);",""," self.tested = {};",""," /*"," * Cached sorted calculate results"," * @property results"," * @since 3.2.0"," */"," //self.results = {};",""," if (self.ignoreRegistered) {"," //Clear inpage already processed modules."," self._resetModules();"," }","","};","","Y.Loader.prototype = {"," /**"," * Checks the cache for modules and conditions, if they do not exist"," * process the default metadata and populate the local moduleInfo hash."," * @method _populateCache"," * @private"," */"," _populateCache: function() {"," var self = this,"," defaults = META.modules,"," cache = GLOBAL_ENV._renderedMods,"," i;",""," if (cache && !self.ignoreRegistered) {"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.moduleInfo[i] = Y.merge(cache[i]);"," }"," }",""," cache = GLOBAL_ENV._conditions;"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.conditions[i] = Y.merge(cache[i]);"," }"," }",""," } else {"," for (i in defaults) {"," if (defaults.hasOwnProperty(i)) {"," self.addModule(defaults[i], i);"," }"," }"," }",""," },"," /**"," * Reset modules in the module cache to a pre-processed state so additional"," * computations with a different skin or language will work as expected."," * @private _resetModules"," */"," _resetModules: function() {"," var self = this, i, o;"," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," var mod = self.moduleInfo[i],"," name = mod.name,"," details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);",""," if (details) {"," self.moduleInfo[name]._reset = true;"," self.moduleInfo[name].requires = details.requires || [];"," self.moduleInfo[name].optional = details.optional || [];"," self.moduleInfo[name].supersedes = details.supercedes || [];"," }",""," if (mod.defaults) {"," for (o in mod.defaults) {"," if (mod.defaults.hasOwnProperty(o)) {"," if (mod[o]) {"," mod[o] = mod.defaults[o];"," }"," }"," }"," }"," delete mod.langCache;"," delete mod.skinCache;"," if (mod.skinnable) {"," self._addSkin(self.skin.defaultSkin, mod.name);"," }"," }"," }"," },"," /**"," Regex that matches a CSS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_CSS"," @type RegExp"," @final"," @protected"," @since 3.5.0"," **/"," REGEX_CSS: /\\.css(?:[?;].*)?$/i,"," "," /**"," * Default filters for raw and debug"," * @property FILTER_DEFS"," * @type Object"," * @final"," * @protected"," */"," FILTER_DEFS: {"," RAW: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '.js'"," },"," DEBUG: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-debug.js'"," },"," COVERAGE: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-coverage.js'"," }"," },"," /*"," * Check the pages meta-data and cache the result."," * @method _inspectPage"," * @private"," */"," _inspectPage: function() {"," var self = this, v, m, req, mr, i;",""," //Inspect the page for CSS only modules and mark them as loaded."," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," v = self.moduleInfo[i];"," if (v.type && v.type === CSS) {"," if (self.isCSSLoaded(v.name)) {"," self.loaded[i] = true;"," }"," }"," }"," }"," for (i in ON_PAGE) {"," if (ON_PAGE.hasOwnProperty(i)) {"," v = ON_PAGE[i];"," if (v.details) {"," m = self.moduleInfo[v.name];"," req = v.details.requires;"," mr = m && m.requires;",""," if (m) {"," if (!m._inspected && req && mr.length != req.length) {"," // console.log('deleting ' + m.name);"," delete m.expanded;"," }"," } else {"," m = self.addModule(v.details, i);"," }"," m._inspected = true;"," }"," }"," }"," },"," /*"," * returns true if b is not loaded, and is required directly or by means of modules it supersedes."," * @private"," * @method _requires"," * @param {String} mod1 The first module to compare"," * @param {String} mod2 The second module to compare"," */"," _requires: function(mod1, mod2) {",""," var i, rm, after_map, s,"," info = this.moduleInfo,"," m = info[mod1],"," other = info[mod2];",""," if (!m || !other) {"," return false;"," }",""," rm = m.expanded_map;"," after_map = m.after_map;",""," // check if this module should be sorted after the other"," // do this first to short circut circular deps"," if (after_map && (mod2 in after_map)) {"," return true;"," }",""," after_map = other.after_map;",""," // and vis-versa"," if (after_map && (mod1 in after_map)) {"," return false;"," }",""," // check if this module requires one the other supersedes"," s = info[mod2] && info[mod2].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod1, s[i])) {"," return true;"," }"," }"," }",""," s = info[mod1] && info[mod1].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod2, s[i])) {"," return false;"," }"," }"," }",""," // check if this module requires the other directly"," // if (r && YArray.indexOf(r, mod2) > -1) {"," if (rm && (mod2 in rm)) {"," return true;"," }",""," // external css files should be sorted below yui css"," if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {"," return true;"," }",""," return false;"," },"," /**"," * Apply a new config to the Loader instance"," * @method _config"," * @private"," * @param {Object} o The new configuration"," */"," _config: function(o) {"," var i, j, val, a, f, group, groupName, self = this;"," // apply config values"," if (o) {"," for (i in o) {"," if (o.hasOwnProperty(i)) {"," val = o[i];"," if (i == 'require') {"," self.require(val);"," } else if (i == 'skin') {"," //If the config.skin is a string, format to the expected object"," if (typeof val === 'string') {"," self.skin.defaultSkin = o.skin;"," val = {"," defaultSkin: val"," };"," }",""," Y.mix(self.skin, val, true);"," } else if (i == 'groups') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," groupName = j;"," group = val[j];"," self.addGroup(group, groupName);"," if (group.aliases) {"," for (a in group.aliases) {"," if (group.aliases.hasOwnProperty(a)) {"," self.addAlias(group.aliases[a], a);"," }"," }"," }"," }"," }",""," } else if (i == 'modules') {"," // add a hash of module definitions"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addModule(val[j], j);"," }"," }"," } else if (i === 'aliases') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addAlias(val[j], j);"," }"," }"," } else if (i == 'gallery') {"," this.groups.gallery.update(val, o);"," } else if (i == 'yui2' || i == '2in3') {"," this.groups.yui2.update(o['2in3'], o.yui2, o);"," } else {"," self[i] = val;"," }"," }"," }"," }",""," // fix filter"," f = self.filter;",""," if (L.isString(f)) {"," f = f.toUpperCase();"," self.filterName = f;"," self.filter = self.FILTER_DEFS[f];"," if (f == 'DEBUG') {"," self.require('yui-log', 'dump');"," }"," }",""," if (self.filterName && self.coverage) {"," if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {"," var mods = [];"," for (i = 0; i < self.coverage.length; i++) {"," var mod = self.coverage[i];"," if (self.moduleInfo[mod] && self.moduleInfo[mod].use) {"," mods = [].concat(mods, self.moduleInfo[mod].use);"," } else {"," mods.push(mod);"," }"," }"," self.filters = self.filters || {};"," Y.Array.each(mods, function(mod) {"," self.filters[mod] = self.FILTER_DEFS.COVERAGE;"," });"," self.filterName = 'RAW';"," self.filter = self.FILTER_DEFS[self.filterName];"," }"," }"," ",""," if (self.lang) {"," //Removed this so that when Loader is invoked"," //it doesn't request what it doesn't need."," //self.require('intl-base', 'intl');"," }",""," },",""," /**"," * Returns the skin module name for the specified skin name. If a"," * module name is supplied, the returned skin module name is"," * specific to the module passed in."," * @method formatSkin"," * @param {string} skin the name of the skin."," * @param {string} mod optional: the name of a module to skin."," * @return {string} the full skin module name."," */"," formatSkin: function(skin, mod) {"," var s = SKIN_PREFIX + skin;"," if (mod) {"," s = s + '-' + mod;"," }",""," return s;"," },",""," /**"," * Adds the skin def to the module info"," * @method _addSkin"," * @param {string} skin the name of the skin."," * @param {string} mod the name of the module."," * @param {string} parent parent module if this is a skin of a"," * submodule or plugin."," * @return {string} the module name for the skin."," * @private"," */"," _addSkin: function(skin, mod, parent) {"," var mdef, pkg, name, nmod,"," info = this.moduleInfo,"," sinf = this.skin,"," ext = info[mod] && info[mod].ext;",""," // Add a module definition for the module-specific skin css"," if (mod) {"," name = this.formatSkin(skin, mod);"," if (!info[name]) {"," mdef = info[mod];"," pkg = mdef.pkg || mod;"," nmod = {"," skin: true,"," name: name,"," group: mdef.group,"," type: 'css',"," after: sinf.after,"," path: (parent || pkg) + '/' + sinf.base + skin +"," '/' + mod + '.css',"," ext: ext"," };"," if (mdef.base) {"," nmod.base = mdef.base;"," }"," if (mdef.configFn) {"," nmod.configFn = mdef.configFn;"," }"," this.addModule(nmod, name);",""," }"," }",""," return name;"," },"," /**"," * Adds an alias module to the system"," * @method addAlias"," * @param {Array} use An array of modules that makes up this alias"," * @param {String} name The name of the alias"," * @example"," * var loader = new Y.Loader({});"," * loader.addAlias([ 'node', 'yql' ], 'davglass');"," * loader.require(['davglass']);"," * var out = loader.resolve(true);"," *"," * //out.js will contain Node and YQL modules"," */"," addAlias: function(use, name) {"," YUI.Env.aliases[name] = use;"," this.addModule({"," name: name,"," use: use"," });"," },"," /**"," * Add a new module group"," * @method addGroup"," * @param {Object} config An object containing the group configuration data"," * @param {String} config.name required, the group name"," * @param {String} config.base The base directory for this module group"," * @param {String} config.root The root path to add to each combo resource path"," * @param {Boolean} config.combine Should the request be combined"," * @param {String} config.comboBase Combo service base path"," * @param {Object} config.modules The group of modules"," * @param {String} name the group name."," * @example"," * var loader = new Y.Loader({});"," * loader.addGroup({"," * name: 'davglass',"," * combine: true,"," * comboBase: '/combo?',"," * root: '',"," * modules: {"," * //Module List here"," * }"," * }, 'davglass');"," */"," addGroup: function(o, name) {"," var mods = o.modules,"," self = this, i, v;",""," name = name || o.name;"," o.name = name;"," self.groups[name] = o;",""," if (o.patterns) {"," for (i in o.patterns) {"," if (o.patterns.hasOwnProperty(i)) {"," o.patterns[i].group = name;"," self.patterns[i] = o.patterns[i];"," }"," }"," }",""," if (mods) {"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," v = mods[i];"," if (typeof v === 'string') {"," v = { name: i, fullpath: v };"," }"," v.group = name;"," self.addModule(v, i);"," }"," }"," }"," },",""," /**"," * Add a new module to the component metadata."," * @method addModule"," * @param {Object} config An object containing the module data."," * @param {String} config.name Required, the component name"," * @param {String} config.type Required, the component type (js or css)"," * @param {String} config.path Required, the path to the script from `base`"," * @param {Array} config.requires Array of modules required by this component"," * @param {Array} [config.optional] Array of optional modules for this component"," * @param {Array} [config.supersedes] Array of the modules this component replaces"," * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one"," * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array"," * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup"," * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`"," * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in"," * @param {Object} [config.submodules] Hash of submodules"," * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration."," * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `[\"en-GB\", \"zh-Hans-CN\"]`"," * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:"," * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load"," * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded."," * @param {String} [config.condition.when] Specifies the load order of the conditional module"," * with regard to the position of the trigger module."," * This should be one of three values: `before`, `after`, or `instead`. The default is `after`."," * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`"," * @param {Function} [config.configFn] A function to exectute when configuring this module"," * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config."," * @param {String} [name] The module name, required if not in the module data."," * @return {Object} the module definition or null if the object passed in did not provide all required attributes."," */"," addModule: function(o, name) {"," name = name || o.name;",""," if (typeof o === 'string') {"," o = { name: name, fullpath: o };"," }"," "," //Only merge this data if the temp flag is set"," //from an earlier pass from a pattern or else"," //an override module (YUI_config) can not be used to"," //replace a default module."," if (this.moduleInfo[name] && this.moduleInfo[name].temp) {"," //This catches temp modules loaded via a pattern"," // The module will be added twice, once from the pattern and"," // Once from the actual add call, this ensures that properties"," // that were added to the module the first time around (group: gallery)"," // are also added the second time around too."," o = Y.merge(this.moduleInfo[name], o);"," }",""," o.name = name;",""," if (!o || !o.name) {"," return null;"," }",""," if (!o.type) {"," //Always assume it's javascript unless the CSS pattern is matched."," o.type = JS;"," var p = o.path || o.fullpath;"," if (p && this.REGEX_CSS.test(p)) {"," o.type = CSS;"," }"," }",""," if (!o.path && !o.fullpath) {"," o.path = _path(name, name, o.type);"," }"," o.supersedes = o.supersedes || o.use;",""," o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;",""," // Handle submodule logic"," var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,"," j, langs, packName, supName, flatSup, flatLang, lang, ret,"," overrides, skinname, when, g,"," conditions = this.conditions, trigger;"," // , existing = this.moduleInfo[name], newr;"," "," this.moduleInfo[name] = o;",""," o.requires = o.requires || [];"," "," /*"," Only allowing the cascade of requires information, since"," optional and supersedes are far more fine grained than"," a blanket requires is."," */"," if (this.requires) {"," for (i = 0; i < this.requires.length; i++) {"," o.requires.push(this.requires[i]);"," }"," }"," if (o.group && this.groups && this.groups[o.group]) {"," g = this.groups[o.group];"," if (g.requires) {"," for (i = 0; i < g.requires.length; i++) {"," o.requires.push(g.requires[i]);"," }"," }"," }","",""," if (!o.defaults) {"," o.defaults = {"," requires: o.requires ? [].concat(o.requires) : null,"," supersedes: o.supersedes ? [].concat(o.supersedes) : null,"," optional: o.optional ? [].concat(o.optional) : null"," };"," }",""," if (o.skinnable && o.ext && o.temp) {"," skinname = this._addSkin(this.skin.defaultSkin, name);"," o.requires.unshift(skinname);"," }"," "," if (o.requires.length) {"," o.requires = this.filterRequires(o.requires) || [];"," }",""," if (!o.langPack && o.lang) {"," langs = YArray(o.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," smod = this.moduleInfo[packName];"," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }"," }"," }","",""," if (subs) {"," sup = o.supersedes || [];"," l = 0;",""," for (i in subs) {"," if (subs.hasOwnProperty(i)) {"," s = subs[i];",""," s.path = s.path || _path(name, i, o.type);"," s.pkg = name;"," s.group = o.group;",""," if (s.supersedes) {"," sup = sup.concat(s.supersedes);"," }",""," smod = this.addModule(s, i);"," sup.push(i);",""," if (smod.skinnable) {"," o.skinnable = true;"," overrides = this.skin.overrides;"," if (overrides && overrides[i]) {"," for (j = 0; j < overrides[i].length; j++) {"," skinname = this._addSkin(overrides[i][j],"," i, name);"," sup.push(skinname);"," }"," }"," skinname = this._addSkin(this.skin.defaultSkin,"," i, name);"," sup.push(skinname);"," }",""," // looks like we are expected to work out the metadata"," // for the parent module language packs from what is"," // specified in the child modules."," if (s.lang && s.lang.length) {",""," langs = YArray(s.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," supName = this.getLangPackName(lang, i);"," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," flatSup = flatSup || YArray.hash(smod.supersedes);",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }",""," o.lang = o.lang || [];",""," flatLang = flatLang || YArray.hash(o.lang);",""," if (!(lang in flatLang)) {"," o.lang.push(lang);"," }","","// Add rollup file, need to add to supersedes list too",""," // default packages"," packName = this.getLangPackName(ROOT_LANG, name);"," supName = this.getLangPackName(ROOT_LANG, i);",""," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }","","// Add rollup file, need to add to supersedes list too",""," }"," }",""," l++;"," }"," }"," //o.supersedes = YObject.keys(YArray.hash(sup));"," o.supersedes = YArray.dedupe(sup);"," if (this.allowRollup) {"," o.rollup = (l < 4) ? l : Math.min(l - 1, 4);"," }"," }",""," plugins = o.plugins;"," if (plugins) {"," for (i in plugins) {"," if (plugins.hasOwnProperty(i)) {"," plug = plugins[i];"," plug.pkg = name;"," plug.path = plug.path || _path(name, i, o.type);"," plug.requires = plug.requires || [];"," plug.group = o.group;"," this.addModule(plug, i);"," if (o.skinnable) {"," this._addSkin(this.skin.defaultSkin, i, name);"," }",""," }"," }"," }",""," if (o.condition) {"," t = o.condition.trigger;"," if (YUI.Env.aliases[t]) {"," t = YUI.Env.aliases[t];"," }"," if (!Y.Lang.isArray(t)) {"," t = [t];"," }",""," for (i = 0; i < t.length; i++) {"," trigger = t[i];"," when = o.condition.when;"," conditions[trigger] = conditions[trigger] || {};"," conditions[trigger][name] = o.condition;"," // the 'when' attribute can be 'before', 'after', or 'instead'"," // the default is after."," if (when && when != 'after') {"," if (when == 'instead') { // replace the trigger"," o.supersedes = o.supersedes || [];"," o.supersedes.push(trigger);"," } else { // before the trigger"," // the trigger requires the conditional mod,"," // so it should appear before the conditional"," // mod if we do not intersede."," }"," } else { // after the trigger"," o.after = o.after || [];"," o.after.push(trigger);"," }"," }"," }",""," if (o.supersedes) {"," o.supersedes = this.filterRequires(o.supersedes);"," }",""," if (o.after) {"," o.after = this.filterRequires(o.after);"," o.after_map = YArray.hash(o.after);"," }",""," // this.dirty = true;",""," if (o.configFn) {"," ret = o.configFn(o);"," if (ret === false) {"," delete this.moduleInfo[name];"," delete GLOBAL_ENV._renderedMods[name];"," o = null;"," }"," }"," //Add to global cache"," if (o) {"," if (!GLOBAL_ENV._renderedMods) {"," GLOBAL_ENV._renderedMods = {};"," }"," GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);"," GLOBAL_ENV._conditions = conditions;"," }",""," return o;"," },",""," /**"," * Add a requirement for one or more module"," * @method require"," * @param {string[] | string*} what the modules to load."," */"," require: function(what) {"," var a = (typeof what === 'string') ? YArray(arguments) : what;"," this.dirty = true;"," this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));",""," this._explodeRollups();"," },"," /**"," * Grab all the items that were asked for, check to see if the Loader"," * meta-data contains a \"use\" array. If it doesm remove the asked item and replace it with "," * the content of the \"use\"."," * This will make asking for: \"dd\""," * Actually ask for: \"dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin\""," * @private"," * @method _explodeRollups"," */"," _explodeRollups: function() {"," var self = this, m, m2, i, a, v, len, len2,"," r = self.required;",""," if (!self.allowRollup) {"," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = self.getModule(i);"," if (m && m.use) {"," len = m.use.length;"," for (a = 0; a < len; a++) {"," m2 = self.getModule(m.use[a]);"," if (m2 && m2.use) {"," len2 = m2.use.length;"," for (v = 0; v < len2; v++) {"," r[m2.use[v]] = true;"," }"," } else {"," r[m.use[a]] = true;"," }"," }"," }"," }"," }"," self.required = r;"," }",""," },"," /**"," * Explodes the required array to remove aliases and replace them with real modules"," * @method filterRequires"," * @param {Array} r The original requires array"," * @return {Array} The new array of exploded requirements"," */"," filterRequires: function(r) {"," if (r) {"," if (!Y.Lang.isArray(r)) {"," r = [r];"," }"," r = Y.Array(r);"," var c = [], i, mod, o, m;",""," for (i = 0; i < r.length; i++) {"," mod = this.getModule(r[i]);"," if (mod && mod.use) {"," for (o = 0; o < mod.use.length; o++) {"," //Must walk the other modules in case a module is a rollup of rollups (datatype)"," m = this.getModule(mod.use[o]);"," if (m && m.use) {"," c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));"," } else {"," c.push(mod.use[o]);"," }"," }"," } else {"," c.push(r[i]);"," }"," }"," r = c;"," }"," return r;"," },"," /**"," * Returns an object containing properties for all modules required"," * in order to load the requested module"," * @method getRequires"," * @param {object} mod The module definition from moduleInfo."," * @return {array} the expanded requirement list."," */"," getRequires: function(mod) {",""," if (!mod) {"," //console.log('returning no reqs for ' + mod.name);"," return NO_REQUIREMENTS;"," }",""," if (mod._parsed) {"," //console.log('returning requires for ' + mod.name, mod.requires);"," return mod.expanded || NO_REQUIREMENTS;"," }",""," //TODO add modue cache here out of scope..",""," var i, m, j, add, packName, lang, testresults = this.testresults,"," name = mod.name, cond,"," adddef = ON_PAGE[name] && ON_PAGE[name].details,"," d, k, m1, go, def,"," r, old_mod,"," o, skinmod, skindef, skinpar, skinname,"," intl = mod.lang || mod.intl,"," info = this.moduleInfo,"," ftests = Y.Features && Y.Features.tests.load,"," hash, reparse;",""," // console.log(name);",""," // pattern match leaves module stub that needs to be filled out"," if (mod.temp && adddef) {"," old_mod = mod;"," mod = this.addModule(adddef, name);"," mod.group = old_mod.group;"," mod.pkg = old_mod.pkg;"," delete mod.expanded;"," }",""," // console.log('cache: ' + mod.langCache + ' == ' + this.lang);"," "," //If a skin or a lang is different, reparse.."," reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));",""," if (mod.expanded && !reparse) {"," return mod.expanded;"," }"," ",""," d = [];"," hash = {};"," r = this.filterRequires(mod.requires);"," if (mod.lang) {"," //If a module has a lang attribute, auto add the intl requirement."," d.unshift('intl');"," r.unshift('intl');"," intl = true;"," }"," o = this.filterRequires(mod.optional);","",""," mod._parsed = true;"," mod.langCache = this.lang;"," mod.skinCache = this.skin.defaultSkin;",""," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," d.push(r[i]);"," hash[r[i]] = true;"," m = this.getModule(r[i]);"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }",""," // get the requirements from superseded modules, if any"," r = this.filterRequires(mod.supersedes);"," if (r) {"," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," // if this module has submodules, the requirements list is"," // expanded to include the submodules. This is so we can"," // prevent dups when a submodule is already loaded and the"," // parent is requested."," if (mod.submodules) {"," d.push(r[i]);"," }",""," hash[r[i]] = true;"," m = this.getModule(r[i]);",""," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," if (o && this.loadOptional) {"," for (i = 0; i < o.length; i++) {"," if (!hash[o[i]]) {"," d.push(o[i]);"," hash[o[i]] = true;"," m = info[o[i]];"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," cond = this.conditions[name];",""," if (cond) {"," //Set the module to not parsed since we have conditionals and this could change the dependency tree."," mod._parsed = false;"," if (testresults && ftests) {"," oeach(testresults, function(result, id) {"," var condmod = ftests[id].name;"," if (!hash[condmod] && ftests[id].trigger == name) {"," if (result && ftests[id]) {"," hash[condmod] = true;"," d.push(condmod);"," }"," }"," });"," } else {"," for (i in cond) {"," if (cond.hasOwnProperty(i)) {"," if (!hash[i]) {"," def = cond[i];"," //first see if they've specfied a ua check"," //then see if they've got a test fn & if it returns true"," //otherwise just having a condition block is enough"," go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||"," (def.test && def.test(Y, r)));",""," if (go) {"," hash[i] = true;"," d.push(i);"," m = this.getModule(i);"," if (m) {"," add = this.getRequires(m);"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }",""," }"," }"," }"," }"," }"," }"," }",""," // Create skin modules"," if (mod.skinnable) {"," skindef = this.skin.overrides;"," for (i in YUI.Env.aliases) {"," if (YUI.Env.aliases.hasOwnProperty(i)) {"," if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {"," skinpar = i;"," }"," }"," }"," if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {"," skinname = name;"," if (skindef[skinpar]) {"," skinname = skinpar;"," }"," for (i = 0; i < skindef[skinname].length; i++) {"," skinmod = this._addSkin(skindef[skinname][i], name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," } else {"," skinmod = this._addSkin(this.skin.defaultSkin, name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," }",""," mod._parsed = false;",""," if (intl) {",""," if (mod.lang && !mod.langPack && Y.Intl) {"," lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);"," packName = this.getLangPackName(lang, name);"," if (packName) {"," d.unshift(packName);"," }"," }"," d.unshift(INTL);"," }",""," mod.expanded_map = YArray.hash(d);",""," mod.expanded = YObject.keys(mod.expanded_map);",""," return mod.expanded;"," },"," /**"," * Check to see if named css module is already loaded on the page"," * @method isCSSLoaded"," * @param {String} name The name of the css file"," * @return Boolean"," */"," isCSSLoaded: function(name, skip) {"," //TODO - Make this call a batching call with name being an array"," if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {"," return false;"," }"," var el = YUI.Env.cssStampEl,"," ret = false,"," mod = YUI.Env._cssLoaded[name],"," style = el.currentStyle; //IE",""," "," if (mod !== undefined) {"," return mod;"," }",""," //Add the classname to the element"," el.className = name;",""," if (!style) {"," style = Y.config.doc.defaultView.getComputedStyle(el, null);"," }",""," if (style && style.display === 'none') {"," ret = true;"," }","",""," el.className = ''; //Reset the classname to ''",""," YUI.Env._cssLoaded[name] = ret;",""," return ret;"," },",""," /**"," * Returns a hash of module names the supplied module satisfies."," * @method getProvides"," * @param {string} name The name of the module."," * @return {object} what this module provides."," */"," getProvides: function(name) {"," var m = this.getModule(name), o, s;"," // supmap = this.provides;",""," if (!m) {"," return NOT_FOUND;"," }",""," if (m && !m.provides) {"," o = {};"," s = m.supersedes;",""," if (s) {"," YArray.each(s, function(v) {"," Y.mix(o, this.getProvides(v));"," }, this);"," }",""," o[name] = true;"," m.provides = o;",""," }",""," return m.provides;"," },",""," /**"," * Calculates the dependency tree, the result is stored in the sorted"," * property."," * @method calculate"," * @param {object} o optional options object."," * @param {string} type optional argument to prune modules."," */"," calculate: function(o, type) {"," if (o || type || this.dirty) {",""," if (o) {"," this._config(o);"," }",""," if (!this._init) {"," this._setup();"," }",""," this._explode();",""," if (this.allowRollup) {"," this._rollup();"," } else {"," this._explodeRollups();"," }"," this._reduce();"," this._sort();"," }"," },"," /**"," * Creates a \"psuedo\" package for languages provided in the lang array"," * @method _addLangPack"," * @private"," * @param {String} lang The language to create"," * @param {Object} m The module definition to create the language pack around"," * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)"," * @return {Object} The module definition"," */"," _addLangPack: function(lang, m, packName) {"," var name = m.name,"," packPath, conf,"," existing = this.moduleInfo[packName];",""," if (!existing) {",""," packPath = _path((m.pkg || name), packName, JS, true);",""," conf = {"," path: packPath,"," intl: true,"," langPack: true,"," ext: m.ext,"," group: m.group,"," supersedes: []"," };"," if (m.root) {"," conf.root = m.root;"," }"," if (m.base) {"," conf.base = m.base;"," }",""," if (m.configFn) {"," conf.configFn = m.configFn;"," }",""," this.addModule(conf, packName);",""," if (lang) {"," Y.Env.lang = Y.Env.lang || {};"," Y.Env.lang[lang] = Y.Env.lang[lang] || {};"," Y.Env.lang[lang][name] = true;"," }"," }",""," return this.moduleInfo[packName];"," },",""," /**"," * Investigates the current YUI configuration on the page. By default,"," * modules already detected will not be loaded again unless a force"," * option is encountered. Called by calculate()"," * @method _setup"," * @private"," */"," _setup: function() {"," var info = this.moduleInfo, name, i, j, m, l,"," packName;",""," for (name in info) {"," if (info.hasOwnProperty(name)) {"," m = info[name];"," if (m) {",""," // remove dups"," //m.requires = YObject.keys(YArray.hash(m.requires));"," m.requires = YArray.dedupe(m.requires);",""," // Create lang pack modules"," //if (m.lang && m.lang.length) {"," if (m.lang) {"," // Setup root package if the module has lang defined,"," // it needs to provide a root language pack"," packName = this.getLangPackName(ROOT_LANG, name);"," this._addLangPack(null, m, packName);"," }",""," }"," }"," }","",""," //l = Y.merge(this.inserted);"," l = {};",""," // available modules"," if (!this.ignoreRegistered) {"," Y.mix(l, GLOBAL_ENV.mods);"," }",""," // add the ignore list to the list of loaded packages"," if (this.ignore) {"," Y.mix(l, YArray.hash(this.ignore));"," }",""," // expand the list to include superseded modules"," for (j in l) {"," if (l.hasOwnProperty(j)) {"," Y.mix(l, this.getProvides(j));"," }"," }",""," // remove modules on the force list from the loaded list"," if (this.force) {"," for (i = 0; i < this.force.length; i++) {"," if (this.force[i] in l) {"," delete l[this.force[i]];"," }"," }"," }",""," Y.mix(this.loaded, l);",""," this._init = true;"," },",""," /**"," * Builds a module name for a language pack"," * @method getLangPackName"," * @param {string} lang the language code."," * @param {string} mname the module to build it for."," * @return {string} the language pack module name."," */"," getLangPackName: function(lang, mname) {"," return ('lang/' + mname + ((lang) ? '_' + lang : ''));"," },"," /**"," * Inspects the required modules list looking for additional"," * dependencies. Expands the required list to include all"," * required modules. Called by calculate()"," * @method _explode"," * @private"," */"," _explode: function() {"," //TODO Move done out of scope"," var r = this.required, m, reqs, done = {},"," self = this, name;",""," // the setup phase is over, all modules have been created"," self.dirty = false;",""," self._explodeRollups();"," r = self.required;"," "," for (name in r) {"," if (r.hasOwnProperty(name)) {"," if (!done[name]) {"," done[name] = true;"," m = self.getModule(name);"," if (m) {"," var expound = m.expound;",""," if (expound) {"," r[expound] = self.getModule(expound);"," reqs = self.getRequires(r[expound]);"," Y.mix(r, YArray.hash(reqs));"," }",""," reqs = self.getRequires(m);"," Y.mix(r, YArray.hash(reqs));"," }"," }"," }"," }",""," },"," /**"," * The default method used to test a module against a pattern"," * @method _patternTest"," * @private"," * @param {String} mname The module being tested"," * @param {String} pname The pattern to match"," */"," _patternTest: function(mname, pname) {"," return (mname.indexOf(pname) > -1);"," },"," /**"," * Get's the loader meta data for the requested module"," * @method getModule"," * @param {String} mname The module name to get"," * @return {Object} The module metadata"," */"," getModule: function(mname) {"," //TODO: Remove name check - it's a quick hack to fix pattern WIP"," if (!mname) {"," return null;"," }",""," var p, found, pname,"," m = this.moduleInfo[mname],"," patterns = this.patterns;",""," // check the patterns library to see if we should automatically add"," // the module with defaults"," if (!m || (m && m.ext)) {"," for (pname in patterns) {"," if (patterns.hasOwnProperty(pname)) {"," p = patterns[pname];"," "," //There is no test method, create a default one that tests"," // the pattern against the mod name"," if (!p.test) {"," p.test = this._patternTest;"," }",""," if (p.test(mname, pname)) {"," // use the metadata supplied for the pattern"," // as the module definition."," found = p;"," break;"," }"," }"," }"," }",""," if (!m) {"," if (found) {"," if (p.action) {"," p.action.call(this, mname, pname);"," } else {"," // ext true or false?"," m = this.addModule(Y.merge(found), mname);"," if (found.configFn) {"," m.configFn = found.configFn;"," }"," m.temp = true;"," }"," }"," } else {"," if (found && m && found.configFn && !m.configFn) {"," m.configFn = found.configFn;"," m.configFn(m);"," }"," }",""," return m;"," },",""," // impl in rollup submodule"," _rollup: function() { },",""," /**"," * Remove superceded modules and loaded modules. Called by"," * calculate() after we have the mega list of all dependencies"," * @method _reduce"," * @return {object} the reduced dependency hash."," * @private"," */"," _reduce: function(r) {",""," r = r || this.required;",""," var i, j, s, m, type = this.loadType,"," ignore = this.ignore ? YArray.hash(this.ignore) : false;",""," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = this.getModule(i);"," // remove if already loaded"," if (((this.loaded[i] || ON_PAGE[i]) &&"," !this.forceMap[i] && !this.ignoreRegistered) ||"," (type && m && m.type != type)) {"," delete r[i];"," }"," if (ignore && ignore[i]) {"," delete r[i];"," }"," // remove anything this module supersedes"," s = m && m.supersedes;"," if (s) {"," for (j = 0; j < s.length; j++) {"," if (s[j] in r) {"," delete r[s[j]];"," }"," }"," }"," }"," }",""," return r;"," },"," /**"," * Handles the queue when a module has been loaded for all cases"," * @method _finish"," * @private"," * @param {String} msg The message from Loader"," * @param {Boolean} success A boolean denoting success or failure"," */"," _finish: function(msg, success) {",""," _queue.running = false;",""," var onEnd = this.onEnd;"," if (onEnd) {"," onEnd.call(this.context, {"," msg: msg,"," data: this.data,"," success: success"," });"," }"," this._continue();"," },"," /**"," * The default Loader onSuccess handler, calls this.onSuccess with a payload"," * @method _onSuccess"," * @private"," */"," _onSuccess: function() {"," var self = this, skipped = Y.merge(self.skipped), fn,"," failed = [], rreg = self.requireRegistration,"," success, msg, i, mod;"," "," for (i in skipped) {"," if (skipped.hasOwnProperty(i)) {"," delete self.inserted[i];"," }"," }",""," self.skipped = {};"," "," for (i in self.inserted) {"," if (self.inserted.hasOwnProperty(i)) {"," mod = self.getModule(i);"," if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {"," failed.push(i);"," } else {"," Y.mix(self.loaded, self.getProvides(i));"," }"," }"," }",""," fn = self.onSuccess;"," msg = (failed.length) ? 'notregistered' : 'success';"," success = !(failed.length);"," if (fn) {"," fn.call(self.context, {"," msg: msg,"," data: self.data,"," success: success,"," failed: failed,"," skipped: skipped"," });"," }"," self._finish(msg, success);"," },"," /**"," * The default Loader onProgress handler, calls this.onProgress with a payload"," * @method _onProgress"," * @private"," */"," _onProgress: function(e) {"," var self = this;"," if (self.onProgress) {"," self.onProgress.call(self.context, {"," name: e.url,"," data: e.data"," });"," }"," },"," /**"," * The default Loader onFailure handler, calls this.onFailure with a payload"," * @method _onFailure"," * @private"," */"," _onFailure: function(o) {"," var f = this.onFailure, msg = [], i = 0, len = o.errors.length;"," "," for (i; i < len; i++) {"," msg.push(o.errors[i].error);"," }",""," msg = msg.join(',');",""," "," if (f) {"," f.call(this.context, {"," msg: msg,"," data: this.data,"," success: false"," });"," }"," "," this._finish(msg, false);",""," },",""," /**"," * The default Loader onTimeout handler, calls this.onTimeout with a payload"," * @method _onTimeout"," * @private"," */"," _onTimeout: function() {"," var f = this.onTimeout;"," if (f) {"," f.call(this.context, {"," msg: 'timeout',"," data: this.data,"," success: false"," });"," }"," },",""," /**"," * Sorts the dependency tree. The last step of calculate()"," * @method _sort"," * @private"," */"," _sort: function() {",""," // create an indexed list"," var s = YObject.keys(this.required),"," // loaded = this.loaded,"," //TODO Move this out of scope"," done = {},"," p = 0, l, a, b, j, k, moved, doneKey;",""," // keep going until we make a pass without moving anything"," for (;;) {",""," l = s.length;"," moved = false;",""," // start the loop after items that are already sorted"," for (j = p; j < l; j++) {",""," // check the next module on the list to see if its"," // dependencies have been met"," a = s[j];",""," // check everything below current item and move if we"," // find a requirement for the current item"," for (k = j + 1; k < l; k++) {"," doneKey = a + s[k];",""," if (!done[doneKey] && this._requires(a, s[k])) {",""," // extract the dependency so we can move it up"," b = s.splice(k, 1);",""," // insert the dependency above the item that"," // requires it"," s.splice(j, 0, b[0]);",""," // only swap two dependencies once to short circut"," // circular dependencies"," done[doneKey] = true;",""," // keep working"," moved = true;",""," break;"," }"," }",""," // jump out of loop if we moved something"," if (moved) {"," break;"," // this item is sorted, move our pointer and keep going"," } else {"," p++;"," }"," }",""," // when we make it here and moved is false, we are"," // finished sorting"," if (!moved) {"," break;"," }",""," }",""," this.sorted = s;"," },",""," /**"," * Handles the actual insertion of script/link tags"," * @method _insert"," * @private"," * @param {Object} source The YUI instance the request came from"," * @param {Object} o The metadata to include"," * @param {String} type JS or CSS"," * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta"," */"," _insert: function(source, o, type, skipcalc) {","",""," // restore the state at the time of the request"," if (source) {"," this._config(source);"," }",""," // build the dependency list"," // don't include type so we can process CSS and script in"," // one pass when the type is not specified."," if (!skipcalc) {"," //this.calculate(o);"," }",""," var modules = this.resolve(!skipcalc),"," self = this, comp = 0, actions = 0;",""," if (type) {"," //Filter out the opposite type and reset the array so the checks later work"," modules[((type === JS) ? CSS : JS)] = [];"," }"," if (modules.js.length) {"," comp++;"," }"," if (modules.css.length) {"," comp++;"," }",""," //console.log('Resolved Modules: ', modules);",""," var complete = function(d) {"," actions++;"," var errs = {}, i = 0, u = '', fn;",""," if (d && d.errors) {"," for (i = 0; i < d.errors.length; i++) {"," if (d.errors[i].request) {"," u = d.errors[i].request.url;"," } else {"," u = d.errors[i];"," }"," errs[u] = u;"," }"," }"," "," if (d && d.data && d.data.length && (d.type === 'success')) {"," for (i = 0; i < d.data.length; i++) {"," self.inserted[d.data[i].name] = true;"," }"," }",""," if (actions === comp) {"," self._loading = null;"," if (d && d.fn) {"," fn = d.fn;"," delete d.fn;"," fn.call(self, d);"," }"," }"," };",""," this._loading = true;",""," if (!modules.js.length && !modules.css.length) {"," actions = -1;"," complete({"," fn: self._onSuccess"," });"," return;"," }"," ",""," if (modules.css.length) { //Load CSS first"," Y.Get.css(modules.css, {"," data: modules.cssMods,"," attributes: self.cssAttributes,"," insertBefore: self.insertBefore,"," charset: self.charset,"," timeout: self.timeout,"," context: self,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }",""," if (modules.js.length) {"," Y.Get.js(modules.js, {"," data: modules.jsMods,"," insertBefore: self.insertBefore,"," attributes: self.jsAttributes,"," charset: self.charset,"," timeout: self.timeout,"," autopurge: false,"," context: self,"," async: self.async,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }"," },"," /**"," * Once a loader operation is completely finished, process any additional queued items."," * @method _continue"," * @private"," */"," _continue: function() {"," if (!(_queue.running) && _queue.size() > 0) {"," _queue.running = true;"," _queue.next()();"," }"," },",""," /**"," * inserts the requested modules and their dependencies."," * <code>type</code> can be \"js\" or \"css\". Both script and"," * css are inserted if type is not provided."," * @method insert"," * @param {object} o optional options object."," * @param {string} type the type of dependency to insert."," */"," insert: function(o, type, skipsort) {"," var self = this, copy = Y.merge(this);"," delete copy.require;"," delete copy.dirty;"," _queue.add(function() {"," self._insert(copy, o, type, skipsort);"," });"," this._continue();"," },",""," /**"," * Executed every time a module is loaded, and if we are in a load"," * cycle, we attempt to load the next script. Public so that it"," * is possible to call this if using a method other than"," * Y.register to determine when scripts are fully loaded"," * @method loadNext"," * @deprecated"," * @param {string} mname optional the name of the module that has"," * been loaded (which is usually why it is time to load the next"," * one)."," */"," loadNext: function(mname) {"," return;"," },",""," /**"," * Apply filter defined for this instance to a url/path"," * @method _filter"," * @param {string} u the string to filter."," * @param {string} name the name of the module, if we are processing"," * a single module as opposed to a combined url."," * @return {string} the filtered string."," * @private"," */"," _filter: function(u, name, group) {"," var f = this.filter,"," hasFilter = name && (name in this.filters),"," modFilter = hasFilter && this.filters[name],"," groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);",""," if (groupName && this.groups[groupName] && this.groups[groupName].filter) {"," modFilter = this.groups[groupName].filter;"," hasFilter = true;"," }",""," if (u) {"," if (hasFilter) {"," f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;"," }"," if (f) {"," u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);"," }"," }"," return u;"," },",""," /**"," * Generates the full url for a module"," * @method _url"," * @param {string} path the path fragment."," * @param {String} name The name of the module"," * @param {String} [base=self.base] The base url to use"," * @return {string} the full url."," * @private"," */"," _url: function(path, name, base) {"," return this._filter((base || this.base || '') + path, name);"," },"," /**"," * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules."," * @method resolve"," * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else"," * @param {Array} [s=loader.sorted] An override for the loader.sorted array"," * @return {Object} Object hash (js and css) of two arrays of file lists"," * @example This method can be used as an off-line dep calculator"," *"," * var Y = YUI();"," * var loader = new Y.Loader({"," * filter: 'debug',"," * base: '../../',"," * root: 'build/',"," * combine: true,"," * require: ['node', 'dd', 'console']"," * });"," * var out = loader.resolve(true);"," *"," */"," resolve: function(calc, s) {",""," var len, i, m, url, fn, msg, attr, group, groupName, j, frag,"," comboSource, comboSources, mods, comboBase,"," base, urls, u = [], tmpBase, baseLen, resCombos = {},"," self = this, comboSep, maxURLLength, singles = [],"," inserted = (self.ignoreRegistered) ? {} : self.inserted,"," resolved = { js: [], jsMods: [], css: [], cssMods: [] },"," type = self.loadType || 'js';",""," if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { "," self._resetModules();"," }",""," if (calc) {"," self.calculate();"," }"," s = s || self.sorted;",""," var addSingle = function(m) {"," "," if (m) {"," group = (m.group && self.groups[m.group]) || NOT_FOUND;"," "," //Always assume it's async"," if (group.async === false) {"," m.async = group.async;"," }",""," url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :"," self._url(m.path, s[i], group.base || m.base);"," "," if (m.attributes || m.async === false) {"," url = {"," url: url,"," async: m.async"," };"," if (m.attributes) {"," url.attributes = m.attributes;"," }"," }"," resolved[m.type].push(url);"," resolved[m.type + 'Mods'].push(m);"," } else {"," }"," "," };",""," len = s.length;",""," // the default combo base"," comboBase = self.comboBase;",""," url = comboBase;",""," comboSources = {};",""," for (i = 0; i < len; i++) {"," comboSource = comboBase;"," m = self.getModule(s[i]);"," groupName = m && m.group;"," group = self.groups[groupName];"," if (groupName && group) {",""," if (!group.combine || m.fullpath) {"," //This is not a combo module, skip it and load it singly later."," //singles.push(s[i]);"," addSingle(m);"," continue;"," }"," m.combine = true;"," if (group.comboBase) {"," comboSource = group.comboBase;"," }",""," if (\"root\" in group && L.isValue(group.root)) {"," m.root = group.root;"," }"," m.comboSep = group.comboSep || self.comboSep;"," m.maxURLLength = group.maxURLLength || self.maxURLLength;"," } else {"," if (!self.combine) {"," //This is not a combo module, skip it and load it singly later."," //singles.push(s[i]);"," addSingle(m);"," continue;"," }"," }",""," comboSources[comboSource] = comboSources[comboSource] || [];"," comboSources[comboSource].push(m);"," }",""," for (j in comboSources) {"," if (comboSources.hasOwnProperty(j)) {"," resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };"," url = j;"," mods = comboSources[j];"," len = mods.length;"," "," if (len) {"," for (i = 0; i < len; i++) {"," if (inserted[mods[i]]) {"," continue;"," }"," m = mods[i];"," // Do not try to combine non-yui JS unless combo def"," // is found"," if (m && (m.combine || !m.ext)) {"," resCombos[j].comboSep = m.comboSep;"," resCombos[j].group = m.group;"," resCombos[j].maxURLLength = m.maxURLLength;"," frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);"," frag = self._filter(frag, m.name);"," resCombos[j][m.type].push(frag);"," resCombos[j][m.type + 'Mods'].push(m);"," } else {"," //Add them to the next process.."," if (mods[i]) {"," //singles.push(mods[i].name);"," addSingle(mods[i]);"," }"," }",""," }"," }"," }"," }","",""," for (j in resCombos) {"," base = j;"," comboSep = resCombos[base].comboSep || self.comboSep;"," maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;"," for (type in resCombos[base]) {"," if (type === JS || type === CSS) {"," urls = resCombos[base][type];"," mods = resCombos[base][type + 'Mods'];"," len = urls.length;"," tmpBase = base + urls.join(comboSep);"," baseLen = tmpBase.length;"," if (maxURLLength <= base.length) {"," maxURLLength = MAX_URL_LENGTH;"," }"," "," if (len) {"," if (baseLen > maxURLLength) {"," u = [];"," for (s = 0; s < len; s++) {"," u.push(urls[s]);"," tmpBase = base + u.join(comboSep);",""," if (tmpBase.length > maxURLLength) {"," m = u.pop();"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," u = [];"," if (m) {"," u.push(m);"," }"," }"," }"," if (u.length) {"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," } else {"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," }"," resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);"," }"," }"," }",""," resCombos = null;",""," return resolved;"," },"," /**"," Shortcut to calculate, resolve and load all modules.",""," var loader = new Y.Loader({"," ignoreRegistered: true,"," modules: {"," mod: {"," path: 'mod.js'"," }"," },"," requires: [ 'mod' ]"," });"," loader.load(function() {"," console.log('All modules have loaded..');"," });","",""," @method load"," @param {Callback} cb Executed after all load operations are complete"," */"," load: function(cb) {"," if (!cb) {"," return;"," }"," var self = this,"," out = self.resolve(true);"," "," self.data = out;",""," self.onEnd = function() {"," cb.apply(self.context || self, arguments);"," };",""," self.insert();"," }","};","","","","}, '3.7.2' ,{requires:['get', 'features']});","YUI.add('loader-rollup', function(Y) {","","/**"," * Optional automatic rollup logic for reducing http connections"," * when not using a combo service."," * @module loader"," * @submodule rollup"," */","","/**"," * Look for rollup packages to determine if all of the modules a"," * rollup supersedes are required. If so, include the rollup to"," * help reduce the total number of connections required. Called"," * by calculate(). This is an optional feature, and requires the"," * appropriate submodule to function."," * @method _rollup"," * @for Loader"," * @private"," */","Y.Loader.prototype._rollup = function() {"," var i, j, m, s, r = this.required, roll,"," info = this.moduleInfo, rolled, c, smod;",""," // find and cache rollup modules"," if (this.dirty || !this.rollups) {"," this.rollups = {};"," for (i in info) {"," if (info.hasOwnProperty(i)) {"," m = this.getModule(i);"," // if (m && m.rollup && m.supersedes) {"," if (m && m.rollup) {"," this.rollups[i] = m;"," }"," }"," }"," }",""," // make as many passes as needed to pick up rollup rollups"," for (;;) {"," rolled = false;",""," // go through the rollup candidates"," for (i in this.rollups) {"," if (this.rollups.hasOwnProperty(i)) {"," // there can be only one, unless forced"," if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {"," m = this.getModule(i);"," s = m.supersedes || [];"," roll = false;",""," // @TODO remove continue"," if (!m.rollup) {"," continue;"," }",""," c = 0;",""," // check the threshold"," for (j = 0; j < s.length; j++) {"," smod = info[s[j]];",""," // if the superseded module is loaded, we can't"," // load the rollup unless it has been forced."," if (this.loaded[s[j]] && !this.forceMap[s[j]]) {"," roll = false;"," break;"," // increment the counter if this module is required."," // if we are beyond the rollup threshold, we will"," // use the rollup module"," } else if (r[s[j]] && m.type == smod.type) {"," c++;"," roll = (c >= m.rollup);"," if (roll) {"," break;"," }"," }"," }",""," if (roll) {"," // add the rollup"," r[i] = true;"," rolled = true;",""," // expand the rollup's dependencies"," this.getRequires(m);"," }"," }"," }"," }",""," // if we made it here w/o rolling up something, we are done"," if (!rolled) {"," break;"," }"," }","};","","","}, '3.7.2' ,{requires:['loader-base']});","YUI.add('loader-yui3', function(Y) {","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","","/**"," * YUI 3 module metadata"," * @module loader"," * @submodule yui3"," */","YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {"," \"align-plugin\": {"," \"requires\": ["," \"node-screen\","," \"node-pluginhost\""," ]"," },"," \"anim\": {"," \"use\": ["," \"anim-base\","," \"anim-color\","," \"anim-curve\","," \"anim-easing\","," \"anim-node-plugin\","," \"anim-scroll\","," \"anim-xy\""," ]"," },"," \"anim-base\": {"," \"requires\": ["," \"base-base\","," \"node-style\""," ]"," },"," \"anim-color\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-curve\": {"," \"requires\": ["," \"anim-xy\""," ]"," },"," \"anim-easing\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-node-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"anim-base\""," ]"," },"," \"anim-scroll\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-shape-transform\": {"," \"requires\": ["," \"anim-base\","," \"anim-easing\","," \"matrix\""," ]"," },"," \"anim-xy\": {"," \"requires\": ["," \"anim-base\","," \"node-screen\""," ]"," },"," \"app\": {"," \"use\": ["," \"app-base\","," \"app-content\","," \"app-transitions\","," \"lazy-model-list\","," \"model\","," \"model-list\","," \"model-sync-rest\","," \"router\","," \"view\","," \"view-node-map\""," ]"," },"," \"app-base\": {"," \"requires\": ["," \"classnamemanager\","," \"pjax-base\","," \"router\","," \"view\""," ]"," },"," \"app-content\": {"," \"requires\": ["," \"app-base\","," \"pjax-content\""," ]"," },"," \"app-transitions\": {"," \"requires\": ["," \"app-base\""," ]"," },"," \"app-transitions-css\": {"," \"type\": \"css\""," },"," \"app-transitions-native\": {"," \"condition\": {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\""," },"," \"requires\": ["," \"app-transitions\","," \"app-transitions-css\","," \"parallel\","," \"transition\""," ]"," },"," \"array-extras\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"array-invoke\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist-add\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraylist-filter\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraysort\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"async-queue\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute\": {"," \"use\": ["," \"attribute-base\","," \"attribute-complex\""," ]"," },"," \"attribute-base\": {"," \"requires\": ["," \"attribute-core\","," \"attribute-events\","," \"attribute-extras\""," ]"," },"," \"attribute-complex\": {"," \"requires\": ["," \"attribute-base\""," ]"," },"," \"attribute-core\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"attribute-events\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute-extras\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"autocomplete\": {"," \"use\": ["," \"autocomplete-base\","," \"autocomplete-sources\","," \"autocomplete-list\","," \"autocomplete-plugin\""," ]"," },"," \"autocomplete-base\": {"," \"optional\": ["," \"autocomplete-sources\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"escape\","," \"event-valuechange\","," \"node-base\""," ]"," },"," \"autocomplete-filters\": {"," \"requires\": ["," \"array-extras\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-filters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-highlighters\": {"," \"requires\": ["," \"array-extras\","," \"highlight-base\""," ]"," },"," \"autocomplete-highlighters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"highlight-accentfold\""," ]"," },"," \"autocomplete-list\": {"," \"after\": ["," \"autocomplete-sources\""," ],"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"autocomplete-base\","," \"event-resize\","," \"node-screen\","," \"selector-css3\","," \"shim-plugin\","," \"widget\","," \"widget-position\","," \"widget-position-align\""," ],"," \"skinnable\": true"," },"," \"autocomplete-list-keys\": {"," \"condition\": {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\""," },"," \"requires\": ["," \"autocomplete-list\","," \"base-build\""," ]"," },"," \"autocomplete-plugin\": {"," \"requires\": ["," \"autocomplete-list\","," \"node-pluginhost\""," ]"," },"," \"autocomplete-sources\": {"," \"optional\": ["," \"io-base\","," \"json-parse\","," \"jsonp\","," \"yql\""," ],"," \"requires\": ["," \"autocomplete-base\""," ]"," },"," \"base\": {"," \"use\": ["," \"base-base\","," \"base-pluginhost\","," \"base-build\""," ]"," },"," \"base-base\": {"," \"after\": ["," \"attribute-complex\""," ],"," \"requires\": ["," \"base-core\","," \"attribute-base\""," ]"," },"," \"base-build\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"base-core\": {"," \"requires\": ["," \"attribute-core\""," ]"," },"," \"base-pluginhost\": {"," \"requires\": ["," \"base-base\","," \"pluginhost\""," ]"," },"," \"button\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-core\": {"," \"requires\": ["," \"attribute-core\","," \"classnamemanager\","," \"node-base\""," ]"," },"," \"button-group\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-plugin\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"node-pluginhost\""," ]"," },"," \"cache\": {"," \"use\": ["," \"cache-base\","," \"cache-offline\","," \"cache-plugin\""," ]"," },"," \"cache-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"cache-offline\": {"," \"requires\": ["," \"cache-base\","," \"json\""," ]"," },"," \"cache-plugin\": {"," \"requires\": ["," \"plugin\","," \"cache-base\""," ]"," },"," \"calendar\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"calendar-base\","," \"calendarnavigator\""," ],"," \"skinnable\": true"," },"," \"calendar-base\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"widget\","," \"substitute\","," \"datatype-date\","," \"datatype-date-math\","," \"cssgrids\""," ],"," \"skinnable\": true"," },"," \"calendarnavigator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\","," \"datatype-date\","," \"node\","," \"substitute\""," ],"," \"skinnable\": true"," },"," \"charts\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"charts-base\": {"," \"requires\": ["," \"dom\","," \"datatype-number\","," \"datatype-date\","," \"event-custom\","," \"event-mouseenter\","," \"event-touch\","," \"widget\","," \"widget-position\","," \"widget-stack\","," \"graphics\""," ]"," },"," \"charts-legend\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"classnamemanager\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"clickable-rail\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"collection\": {"," \"use\": ["," \"array-extras\","," \"arraylist\","," \"arraylist-add\","," \"arraylist-filter\","," \"array-invoke\""," ]"," },"," \"console\": {"," \"lang\": ["," \"en\","," \"es\","," \"ja\""," ],"," \"requires\": ["," \"yui-log\","," \"widget\","," \"substitute\""," ],"," \"skinnable\": true"," },"," \"console-filters\": {"," \"requires\": ["," \"plugin\","," \"console\""," ],"," \"skinnable\": true"," },"," \"controller\": {"," \"use\": ["," \"router\""," ]"," },"," \"cookie\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"createlink-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"cssbase\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbase-context\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbutton\": {"," \"type\": \"css\""," },"," \"cssfonts\": {"," \"type\": \"css\""," },"," \"cssfonts-context\": {"," \"type\": \"css\""," },"," \"cssgrids\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-base\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-units\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"requires\": ["," \"cssgrids-base\""," ],"," \"type\": \"css\""," },"," \"cssreset\": {"," \"type\": \"css\""," },"," \"cssreset-context\": {"," \"type\": \"css\""," },"," \"dataschema\": {"," \"use\": ["," \"dataschema-base\","," \"dataschema-json\","," \"dataschema-xml\","," \"dataschema-array\","," \"dataschema-text\""," ]"," },"," \"dataschema-array\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"dataschema-json\": {"," \"requires\": ["," \"dataschema-base\","," \"json\""," ]"," },"," \"dataschema-text\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-xml\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"datasource\": {"," \"use\": ["," \"datasource-local\","," \"datasource-io\","," \"datasource-get\","," \"datasource-function\","," \"datasource-cache\","," \"datasource-jsonschema\","," \"datasource-xmlschema\","," \"datasource-arrayschema\","," \"datasource-textschema\","," \"datasource-polling\""," ]"," },"," \"datasource-arrayschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-array\""," ]"," },"," \"datasource-cache\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"cache-base\""," ]"," },"," \"datasource-function\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-get\": {"," \"requires\": ["," \"datasource-local\","," \"get\""," ]"," },"," \"datasource-io\": {"," \"requires\": ["," \"datasource-local\","," \"io-base\""," ]"," },"," \"datasource-jsonschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-json\""," ]"," },"," \"datasource-local\": {"," \"requires\": ["," \"base\""," ]"," },"," \"datasource-polling\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-textschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-text\""," ]"," },"," \"datasource-xmlschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-xml\""," ]"," },"," \"datatable\": {"," \"use\": ["," \"datatable-core\","," \"datatable-table\","," \"datatable-head\","," \"datatable-body\","," \"datatable-base\","," \"datatable-column-widths\","," \"datatable-message\","," \"datatable-mutable\","," \"datatable-sort\","," \"datatable-datasource\""," ]"," },"," \"datatable-base\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-table\","," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"datatable-base-deprecated\": {"," \"requires\": ["," \"recordset-base\","," \"widget\","," \"substitute\","," \"event-mouseenter\""," ],"," \"skinnable\": true"," },"," \"datatable-body\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-column-widths\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-core\": {"," \"requires\": ["," \"escape\","," \"model-list\","," \"node-event-delegate\""," ]"," },"," \"datatable-datasource\": {"," \"requires\": ["," \"datatable-base\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-datasource-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-deprecated\": {"," \"use\": ["," \"datatable-base-deprecated\","," \"datatable-datasource-deprecated\","," \"datatable-sort-deprecated\","," \"datatable-scroll-deprecated\""," ]"," },"," \"datatable-head\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-message\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-mutable\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-scroll\": {"," \"requires\": ["," \"datatable-base\","," \"datatable-column-widths\","," \"dom-screen\""," ],"," \"skinnable\": true"," },"," \"datatable-scroll-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\""," ]"," },"," \"datatable-sort\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-sort-deprecated\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"recordset-sort\""," ]"," },"," \"datatable-table\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-head\","," \"datatable-body\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatype\": {"," \"use\": ["," \"datatype-number\","," \"datatype-date\","," \"datatype-xml\""," ]"," },"," \"datatype-date\": {"," \"supersedes\": ["," \"datatype-date-format\""," ],"," \"use\": ["," \"datatype-date-parse\","," \"datatype-date-format\""," ]"," },"," \"datatype-date-format\": {"," \"lang\": ["," \"ar\","," \"ar-JO\","," \"ca\","," \"ca-ES\","," \"da\","," \"da-DK\","," \"de\","," \"de-AT\","," \"de-DE\","," \"el\","," \"el-GR\","," \"en\","," \"en-AU\","," \"en-CA\","," \"en-GB\","," \"en-IE\","," \"en-IN\","," \"en-JO\","," \"en-MY\","," \"en-NZ\","," \"en-PH\","," \"en-SG\","," \"en-US\","," \"es\","," \"es-AR\","," \"es-BO\","," \"es-CL\","," \"es-CO\","," \"es-EC\","," \"es-ES\","," \"es-MX\","," \"es-PE\","," \"es-PY\","," \"es-US\","," \"es-UY\","," \"es-VE\","," \"fi\","," \"fi-FI\","," \"fr\","," \"fr-BE\","," \"fr-CA\","," \"fr-FR\","," \"hi\","," \"hi-IN\","," \"id\","," \"id-ID\","," \"it\","," \"it-IT\","," \"ja\","," \"ja-JP\","," \"ko\","," \"ko-KR\","," \"ms\","," \"ms-MY\","," \"nb\","," \"nb-NO\","," \"nl\","," \"nl-BE\","," \"nl-NL\","," \"pl\","," \"pl-PL\","," \"pt\","," \"pt-BR\","," \"ro\","," \"ro-RO\","," \"ru\","," \"ru-RU\","," \"sv\","," \"sv-SE\","," \"th\","," \"th-TH\","," \"tr\","," \"tr-TR\","," \"vi\","," \"vi-VN\","," \"zh-Hans\","," \"zh-Hans-CN\","," \"zh-Hant\","," \"zh-Hant-HK\","," \"zh-Hant-TW\""," ]"," },"," \"datatype-date-math\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"datatype-date-parse\": {},"," \"datatype-number\": {"," \"use\": ["," \"datatype-number-parse\","," \"datatype-number-format\""," ]"," },"," \"datatype-number-format\": {},"," \"datatype-number-parse\": {},"," \"datatype-xml\": {"," \"use\": ["," \"datatype-xml-parse\","," \"datatype-xml-format\""," ]"," },"," \"datatype-xml-format\": {},"," \"datatype-xml-parse\": {},"," \"dd\": {"," \"use\": ["," \"dd-ddm-base\","," \"dd-ddm\","," \"dd-ddm-drop\","," \"dd-drag\","," \"dd-proxy\","," \"dd-constrain\","," \"dd-drop\","," \"dd-scroll\","," \"dd-delegate\""," ]"," },"," \"dd-constrain\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-ddm\": {"," \"requires\": ["," \"dd-ddm-base\","," \"event-resize\""," ]"," },"," \"dd-ddm-base\": {"," \"requires\": ["," \"node\","," \"base\","," \"yui-throttle\","," \"classnamemanager\""," ]"," },"," \"dd-ddm-drop\": {"," \"requires\": ["," \"dd-ddm\""," ]"," },"," \"dd-delegate\": {"," \"requires\": ["," \"dd-drag\","," \"dd-drop-plugin\","," \"event-mouseenter\""," ]"," },"," \"dd-drag\": {"," \"requires\": ["," \"dd-ddm-base\""," ]"," },"," \"dd-drop\": {"," \"requires\": ["," \"dd-drag\","," \"dd-ddm-drop\""," ]"," },"," \"dd-drop-plugin\": {"," \"requires\": ["," \"dd-drop\""," ]"," },"," \"dd-gestures\": {"," \"condition\": {"," \"name\": \"dd-gestures\","," \"test\": function(Y) {"," return ((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));","},"," \"trigger\": \"dd-drag\""," },"," \"requires\": ["," \"dd-drag\","," \"event-synthetic\","," \"event-gestures\""," ]"," },"," \"dd-plugin\": {"," \"optional\": ["," \"dd-constrain\","," \"dd-proxy\""," ],"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-proxy\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-scroll\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dial\": {"," \"lang\": ["," \"en\","," \"es\""," ],"," \"requires\": ["," \"widget\","," \"dd-drag\","," \"substitute\","," \"event-mouseenter\","," \"event-move\","," \"event-key\","," \"transition\","," \"intl\""," ],"," \"skinnable\": true"," },"," \"dom\": {"," \"use\": ["," \"dom-base\","," \"dom-screen\","," \"dom-style\","," \"selector-native\","," \"selector\""," ]"," },"," \"dom-base\": {"," \"requires\": ["," \"dom-core\""," ]"," },"," \"dom-core\": {"," \"requires\": ["," \"oop\","," \"features\""," ]"," },"," \"dom-deprecated\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-screen\": {"," \"requires\": ["," \"dom-base\","," \"dom-style\""," ]"," },"," \"dom-style\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-style-ie\": {"," \"condition\": {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\""," },"," \"requires\": ["," \"dom-style\""," ]"," },"," \"dump\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"editor\": {"," \"use\": ["," \"frame\","," \"editor-selection\","," \"exec-command\","," \"editor-base\","," \"editor-para\","," \"editor-br\","," \"editor-bidi\","," \"editor-tab\","," \"createlink-base\""," ]"," },"," \"editor-base\": {"," \"requires\": ["," \"base\","," \"frame\","," \"node\","," \"exec-command\","," \"editor-selection\""," ]"," },"," \"editor-bidi\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-br\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-lists\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para\": {"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-para-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para-ie\": {"," \"condition\": {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\""," },"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-selection\": {"," \"requires\": ["," \"node\""," ]"," },"," \"editor-tab\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"escape\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"event\": {"," \"after\": ["," \"node-base\""," ],"," \"use\": ["," \"event-base\","," \"event-delegate\","," \"event-synthetic\","," \"event-mousewheel\","," \"event-mouseenter\","," \"event-key\","," \"event-focus\","," \"event-resize\","," \"event-hover\","," \"event-outside\","," \"event-touch\","," \"event-move\","," \"event-flick\","," \"event-valuechange\""," ]"," },"," \"event-base\": {"," \"after\": ["," \"node-base\""," ],"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-base-ie\": {"," \"after\": ["," \"event-base\""," ],"," \"condition\": {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\""," },"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-contextmenu\": {"," \"requires\": ["," \"event-synthetic\","," \"dom-screen\""," ]"," },"," \"event-custom\": {"," \"use\": ["," \"event-custom-base\","," \"event-custom-complex\""," ]"," },"," \"event-custom-base\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"event-custom-complex\": {"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-delegate\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-flick\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-focus\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-gestures\": {"," \"use\": ["," \"event-flick\","," \"event-move\""," ]"," },"," \"event-hover\": {"," \"requires\": ["," \"event-mouseenter\""," ]"," },"," \"event-key\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mouseenter\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mousewheel\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-move\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-outside\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-resize\": {"," \"requires\": ["," \"node-base\","," \"event-synthetic\""," ]"," },"," \"event-simulate\": {"," \"requires\": ["," \"event-base\""," ]"," },"," \"event-synthetic\": {"," \"requires\": ["," \"node-base\","," \"event-custom-complex\""," ]"," },"," \"event-touch\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-valuechange\": {"," \"requires\": ["," \"event-focus\","," \"event-synthetic\""," ]"," },"," \"exec-command\": {"," \"requires\": ["," \"frame\""," ]"," },"," \"features\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"file\": {"," \"requires\": ["," \"file-flash\","," \"file-html5\""," ]"," },"," \"file-flash\": {"," \"requires\": ["," \"base\""," ]"," },"," \"file-html5\": {"," \"requires\": ["," \"base\""," ]"," },"," \"frame\": {"," \"requires\": ["," \"base\","," \"node\","," \"selector-css3\","," \"substitute\","," \"yui-throttle\""," ]"," },"," \"gesture-simulate\": {"," \"requires\": ["," \"async-queue\","," \"event-simulate\","," \"node-screen\""," ]"," },"," \"get\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"graphics\": {"," \"requires\": ["," \"node\","," \"event-custom\","," \"pluginhost\","," \"matrix\","," \"classnamemanager\""," ]"," },"," \"graphics-canvas\": {"," \"condition\": {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-canvas-default\": {"," \"condition\": {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-svg\": {"," \"condition\": {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-svg-default\": {"," \"condition\": {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-vml\": {"," \"condition\": {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-vml-default\": {"," \"condition\": {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," }"," },"," \"handlebars\": {"," \"use\": ["," \"handlebars-compiler\""," ]"," },"," \"handlebars-base\": {"," \"requires\": ["," \"escape\""," ]"," },"," \"handlebars-compiler\": {"," \"requires\": ["," \"handlebars-base\""," ]"," },"," \"highlight\": {"," \"use\": ["," \"highlight-base\","," \"highlight-accentfold\""," ]"," },"," \"highlight-accentfold\": {"," \"requires\": ["," \"highlight-base\","," \"text-accentfold\""," ]"," },"," \"highlight-base\": {"," \"requires\": ["," \"array-extras\","," \"classnamemanager\","," \"escape\","," \"text-wordbreak\""," ]"," },"," \"history\": {"," \"use\": ["," \"history-base\","," \"history-hash\","," \"history-hash-ie\","," \"history-html5\""," ]"," },"," \"history-base\": {"," \"requires\": ["," \"event-custom-complex\""," ]"," },"," \"history-hash\": {"," \"after\": ["," \"history-html5\""," ],"," \"requires\": ["," \"event-synthetic\","," \"history-base\","," \"yui-later\""," ]"," },"," \"history-hash-ie\": {"," \"condition\": {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\""," },"," \"requires\": ["," \"history-hash\","," \"node-base\""," ]"," },"," \"history-html5\": {"," \"optional\": ["," \"json\""," ],"," \"requires\": ["," \"event-base\","," \"history-base\","," \"node-base\""," ]"," },"," \"imageloader\": {"," \"requires\": ["," \"base-base\","," \"node-style\","," \"node-screen\""," ]"," },"," \"intl\": {"," \"requires\": ["," \"intl-base\","," \"event-custom\""," ]"," },"," \"intl-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"io\": {"," \"use\": ["," \"io-base\","," \"io-xdr\","," \"io-form\","," \"io-upload-iframe\","," \"io-queue\""," ]"," },"," \"io-base\": {"," \"requires\": ["," \"event-custom-base\","," \"querystring-stringify-simple\""," ]"," },"," \"io-form\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-nodejs\": {"," \"condition\": {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\""," },"," \"requires\": ["," \"io-base\""," ]"," },"," \"io-queue\": {"," \"requires\": ["," \"io-base\","," \"queue-promote\""," ]"," },"," \"io-upload-iframe\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-xdr\": {"," \"requires\": ["," \"io-base\","," \"datatype-xml-parse\""," ]"," },"," \"json\": {"," \"use\": ["," \"json-parse\","," \"json-stringify\""," ]"," },"," \"json-parse\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"json-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"jsonp\": {"," \"requires\": ["," \"get\","," \"oop\""," ]"," },"," \"jsonp-url\": {"," \"requires\": ["," \"jsonp\""," ]"," },"," \"lazy-model-list\": {"," \"requires\": ["," \"model-list\""," ]"," },"," \"loader\": {"," \"use\": ["," \"loader-base\","," \"loader-rollup\","," \"loader-yui3\""," ]"," },"," \"loader-base\": {"," \"requires\": ["," \"get\","," \"features\""," ]"," },"," \"loader-rollup\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"loader-yui3\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"matrix\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"model\": {"," \"requires\": ["," \"base-build\","," \"escape\","," \"json-parse\""," ]"," },"," \"model-list\": {"," \"requires\": ["," \"array-extras\","," \"array-invoke\","," \"arraylist\","," \"base-build\","," \"escape\","," \"json-parse\","," \"model\""," ]"," },"," \"model-sync-rest\": {"," \"requires\": ["," \"model\","," \"io-base\","," \"json-stringify\""," ]"," },"," \"node\": {"," \"use\": ["," \"node-base\","," \"node-event-delegate\","," \"node-pluginhost\","," \"node-screen\","," \"node-style\""," ]"," },"," \"node-base\": {"," \"requires\": ["," \"event-base\","," \"node-core\","," \"dom-base\""," ]"," },"," \"node-core\": {"," \"requires\": ["," \"dom-core\","," \"selector\""," ]"," },"," \"node-deprecated\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-delegate\": {"," \"requires\": ["," \"node-base\","," \"event-delegate\""," ]"," },"," \"node-event-html5\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-simulate\": {"," \"requires\": ["," \"node-base\","," \"event-simulate\","," \"gesture-simulate\""," ]"," },"," \"node-flick\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"event-flick\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"node-focusmanager\": {"," \"requires\": ["," \"attribute\","," \"node\","," \"plugin\","," \"node-event-simulate\","," \"event-key\","," \"event-focus\""," ]"," },"," \"node-load\": {"," \"requires\": ["," \"node-base\","," \"io-base\""," ]"," },"," \"node-menunav\": {"," \"requires\": ["," \"node\","," \"classnamemanager\","," \"plugin\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"node-pluginhost\": {"," \"requires\": ["," \"node-base\","," \"pluginhost\""," ]"," },"," \"node-screen\": {"," \"requires\": ["," \"dom-screen\","," \"node-base\""," ]"," },"," \"node-style\": {"," \"requires\": ["," \"dom-style\","," \"node-base\""," ]"," },"," \"oop\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"overlay\": {"," \"requires\": ["," \"widget\","," \"widget-stdmod\","," \"widget-position\","," \"widget-position-align\","," \"widget-stack\","," \"widget-position-constrain\""," ],"," \"skinnable\": true"," },"," \"panel\": {"," \"requires\": ["," \"widget\","," \"widget-autohide\","," \"widget-buttons\","," \"widget-modality\","," \"widget-position\","," \"widget-position-align\","," \"widget-position-constrain\","," \"widget-stack\","," \"widget-stdmod\""," ],"," \"skinnable\": true"," },"," \"parallel\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pjax\": {"," \"requires\": ["," \"pjax-base\","," \"pjax-content\""," ]"," },"," \"pjax-base\": {"," \"requires\": ["," \"classnamemanager\","," \"node-event-delegate\","," \"router\""," ]"," },"," \"pjax-content\": {"," \"requires\": ["," \"io-base\","," \"node-base\","," \"router\""," ]"," },"," \"pjax-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"pjax\","," \"plugin\""," ]"," },"," \"plugin\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"pluginhost\": {"," \"use\": ["," \"pluginhost-base\","," \"pluginhost-config\""," ]"," },"," \"pluginhost-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pluginhost-config\": {"," \"requires\": ["," \"pluginhost-base\""," ]"," },"," \"profiler\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring\": {"," \"use\": ["," \"querystring-parse\","," \"querystring-stringify\""," ]"," },"," \"querystring-parse\": {"," \"requires\": ["," \"yui-base\","," \"array-extras\""," ]"," },"," \"querystring-parse-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"queue-promote\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"range-slider\": {"," \"requires\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\""," ]"," },"," \"recordset\": {"," \"use\": ["," \"recordset-base\","," \"recordset-sort\","," \"recordset-filter\","," \"recordset-indexer\""," ]"," },"," \"recordset-base\": {"," \"requires\": ["," \"base\","," \"arraylist\""," ]"," },"," \"recordset-filter\": {"," \"requires\": ["," \"recordset-base\","," \"array-extras\","," \"plugin\""," ]"," },"," \"recordset-indexer\": {"," \"requires\": ["," \"recordset-base\","," \"plugin\""," ]"," },"," \"recordset-sort\": {"," \"requires\": ["," \"arraysort\","," \"recordset-base\","," \"plugin\""," ]"," },"," \"resize\": {"," \"use\": ["," \"resize-base\","," \"resize-proxy\","," \"resize-constrain\""," ]"," },"," \"resize-base\": {"," \"requires\": ["," \"base\","," \"widget\","," \"substitute\","," \"event\","," \"oop\","," \"dd-drag\","," \"dd-delegate\","," \"dd-drop\""," ],"," \"skinnable\": true"," },"," \"resize-constrain\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"resize-plugin\": {"," \"optional\": ["," \"resize-constrain\""," ],"," \"requires\": ["," \"resize-base\","," \"plugin\""," ]"," },"," \"resize-proxy\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"router\": {"," \"optional\": ["," \"querystring-parse\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"history\""," ]"," },"," \"scrollview\": {"," \"requires\": ["," \"scrollview-base\","," \"scrollview-scrollbars\""," ]"," },"," \"scrollview-base\": {"," \"requires\": ["," \"widget\","," \"event-gestures\","," \"event-mousewheel\","," \"transition\""," ],"," \"skinnable\": true"," },"," \"scrollview-base-ie\": {"," \"condition\": {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"scrollview-base\""," ]"," },"," \"scrollview-list\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ],"," \"skinnable\": true"," },"," \"scrollview-paginator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ]"," },"," \"scrollview-scrollbars\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"selector\": {"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css2\": {"," \"condition\": {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\""," },"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css3\": {"," \"requires\": ["," \"selector-native\","," \"selector-css2\""," ]"," },"," \"selector-native\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"shim-plugin\": {"," \"requires\": ["," \"node-style\","," \"node-pluginhost\""," ]"," },"," \"slider\": {"," \"use\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\","," \"range-slider\""," ]"," },"," \"slider-base\": {"," \"requires\": ["," \"widget\","," \"dd-constrain\","," \"substitute\","," \"event-key\""," ],"," \"skinnable\": true"," },"," \"slider-value-range\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"sortable\": {"," \"requires\": ["," \"dd-delegate\","," \"dd-drop-plugin\","," \"dd-proxy\""," ]"," },"," \"sortable-scroll\": {"," \"requires\": ["," \"dd-scroll\","," \"sortable\""," ]"," },"," \"stylesheet\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"substitute\": {"," \"optional\": ["," \"dump\""," ],"," \"requires\": ["," \"yui-base\""," ]"," },"," \"swf\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"swfdetect\","," \"escape\""," ]"," },"," \"swfdetect\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"tabview\": {"," \"requires\": ["," \"widget\","," \"widget-parent\","," \"widget-child\","," \"tabview-base\","," \"node-pluginhost\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"tabview-base\": {"," \"requires\": ["," \"node-event-delegate\","," \"classnamemanager\","," \"skin-sam-tabview\""," ]"," },"," \"tabview-plugin\": {"," \"requires\": ["," \"tabview-base\""," ]"," },"," \"test\": {"," \"requires\": ["," \"event-simulate\","," \"event-custom\","," \"substitute\","," \"json-stringify\""," ],"," \"skinnable\": true"," },"," \"test-console\": {"," \"requires\": ["," \"console-filters\","," \"test\""," ],"," \"skinnable\": true"," },"," \"text\": {"," \"use\": ["," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"text-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-data-accentfold\""," ]"," },"," \"text-data-accentfold\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-data-wordbreak\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-wordbreak\": {"," \"requires\": ["," \"array-extras\","," \"text-data-wordbreak\""," ]"," },"," \"transition\": {"," \"requires\": ["," \"node-style\""," ]"," },"," \"transition-timer\": {"," \"condition\": {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);"," } ",""," return ret;","},"," \"trigger\": \"transition\""," },"," \"requires\": ["," \"transition\""," ]"," },"," \"uploader\": {"," \"requires\": ["," \"uploader-html5\","," \"uploader-flash\""," ]"," },"," \"uploader-deprecated\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"base\","," \"swf\""," ]"," },"," \"uploader-flash\": {"," \"requires\": ["," \"swf\","," \"widget\","," \"substitute\","," \"base\","," \"cssbutton\","," \"node\","," \"event-custom\","," \"file-flash\","," \"uploader-queue\""," ]"," },"," \"uploader-html5\": {"," \"requires\": ["," \"widget\","," \"node-event-simulate\","," \"substitute\","," \"file-html5\","," \"uploader-queue\""," ]"," },"," \"uploader-queue\": {"," \"requires\": ["," \"base\""," ]"," },"," \"view\": {"," \"requires\": ["," \"base-build\","," \"node-event-delegate\""," ]"," },"," \"view-node-map\": {"," \"requires\": ["," \"view\""," ]"," },"," \"widget\": {"," \"use\": ["," \"widget-base\","," \"widget-htmlparser\","," \"widget-skin\","," \"widget-uievents\""," ]"," },"," \"widget-anim\": {"," \"requires\": ["," \"anim-base\","," \"plugin\","," \"widget\""," ]"," },"," \"widget-autohide\": {"," \"requires\": ["," \"base-build\","," \"event-key\","," \"event-outside\","," \"widget\""," ]"," },"," \"widget-base\": {"," \"requires\": ["," \"attribute\","," \"base-base\","," \"base-pluginhost\","," \"classnamemanager\","," \"event-focus\","," \"node-base\","," \"node-style\""," ],"," \"skinnable\": true"," },"," \"widget-base-ie\": {"," \"condition\": {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-buttons\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget-stdmod\""," ]"," },"," \"widget-child\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-htmlparser\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-locale\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-modality\": {"," \"requires\": ["," \"base-build\","," \"event-outside\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-parent\": {"," \"requires\": ["," \"arraylist\","," \"base-build\","," \"widget\""," ]"," },"," \"widget-position\": {"," \"requires\": ["," \"base-build\","," \"node-screen\","," \"widget\""," ]"," },"," \"widget-position-align\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-position-constrain\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-skin\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-stack\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-stdmod\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-uievents\": {"," \"requires\": ["," \"node-event-delegate\","," \"widget-base\""," ]"," },"," \"yql\": {"," \"requires\": ["," \"jsonp\","," \"jsonp-url\""," ]"," },"," \"yui\": {},"," \"yui-base\": {},"," \"yui-later\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-log\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-throttle\": {"," \"requires\": ["," \"yui-base\""," ]"," }","};","YUI.Env[Y.version].md5 = '2631b5fb2c08064b4e8385f1142513e5';","","","}, '3.7.2' ,{requires:['loader-base']});","","","YUI.add('loader', function(Y){}, '3.7.2' ,{use:['loader-base', 'loader-rollup', 'loader-yui3' ]});",""];+_yuitest_coverage["/build/loader/loader.js"].code=["YUI.add('loader-base', function(Y) {","","/**"," * The YUI loader core"," * @module loader"," * @submodule loader-base"," */","","if (!YUI.Env[Y.version]) {",""," (function() {"," var VERSION = Y.version,"," BUILD = '/build/',"," ROOT = VERSION + BUILD,"," CDN_BASE = Y.Env.base,"," GALLERY_VERSION = 'gallery-2012.08.22-20-00',"," TNT = '2in3',"," TNT_VERSION = '4',"," YUI2_VERSION = '2.9.0',"," COMBO_BASE = CDN_BASE + 'combo?',"," META = { version: VERSION,"," root: ROOT,"," base: Y.Env.base,"," comboBase: COMBO_BASE,"," skin: { defaultSkin: 'sam',"," base: 'assets/skins/',"," path: 'skin.css',"," after: ['cssreset',"," 'cssfonts',"," 'cssgrids',"," 'cssbase',"," 'cssreset-context',"," 'cssfonts-context']},"," groups: {},"," patterns: {} },"," groups = META.groups,"," yui2Update = function(tnt, yui2, config) {"," "," var root = TNT + '.' +"," (tnt || TNT_VERSION) + '/' +"," (yui2 || YUI2_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.yui2.base = base + root;"," groups.yui2.root = root;"," groups.yui2.comboBase = combo;"," },"," galleryUpdate = function(tag, config) {"," var root = (tag || GALLERY_VERSION) + BUILD,"," base = (config && config.base) ? config.base : CDN_BASE,"," combo = (config && config.comboBase) ? config.comboBase : COMBO_BASE;",""," groups.gallery.base = base + root;"," groups.gallery.root = root;"," groups.gallery.comboBase = combo;"," };","",""," groups[VERSION] = {};",""," groups.gallery = {"," ext: false,"," combine: true,"," comboBase: COMBO_BASE,"," update: galleryUpdate,"," patterns: { 'gallery-': { },"," 'lang/gallery-': {},"," 'gallerycss-': { type: 'css' } }"," };",""," groups.yui2 = {"," combine: true,"," ext: false,"," comboBase: COMBO_BASE,"," update: yui2Update,"," patterns: {"," 'yui2-': {"," configFn: function(me) {"," if (/-skin|reset|fonts|grids|base/.test(me.name)) {"," me.type = 'css';"," me.path = me.path.replace(/\\.js/, '.css');"," // this makes skins in builds earlier than"," // 2.6.0 work as long as combine is false"," me.path = me.path.replace(/\\/yui2-skin/,"," '/assets/skins/sam/yui2-skin');"," }"," }"," }"," }"," };",""," galleryUpdate();"," yui2Update();",""," YUI.Env[VERSION] = META;"," }());","}","","","/*jslint forin: true */","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * information for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can also load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files."," *"," * @module loader"," * @main loader"," * @submodule loader-base"," */","","var NOT_FOUND = {},"," NO_REQUIREMENTS = [],"," MAX_URL_LENGTH = 1024,"," GLOBAL_ENV = YUI.Env,"," GLOBAL_LOADED = GLOBAL_ENV._loaded,"," CSS = 'css',"," JS = 'js',"," INTL = 'intl',"," DEFAULT_SKIN = 'sam',"," VERSION = Y.version,"," ROOT_LANG = '',"," YObject = Y.Object,"," oeach = YObject.each,"," YArray = Y.Array,"," _queue = GLOBAL_ENV._loaderQueue,"," META = GLOBAL_ENV[VERSION],"," SKIN_PREFIX = 'skin-',"," L = Y.Lang,"," ON_PAGE = GLOBAL_ENV.mods,"," modulekey,"," cache,"," _path = function(dir, file, type, nomin) {"," var path = dir + '/' + file;"," if (!nomin) {"," path += '-min';"," }"," path += '.' + (type || CSS);",""," return path;"," };","",""," if (!YUI.Env._cssLoaded) {"," YUI.Env._cssLoaded = {};"," }","","","/**"," * The component metadata is stored in Y.Env.meta."," * Part of the loader module."," * @property meta"," * @for YUI"," */","Y.Env.meta = META;","","/**"," * Loader dynamically loads script and css files. It includes the dependency"," * info for the version of the library in use, and will automatically pull in"," * dependencies for the modules requested. It can load the"," * files from the Yahoo! CDN, and it can utilize the combo service provided on"," * this network to reduce the number of http connections required to download"," * YUI files. You can also specify an external, custom combo service to host"," * your modules as well.",""," var Y = YUI();"," var loader = new Y.Loader({"," filter: 'debug',"," base: '../../',"," root: 'build/',"," combine: true,"," require: ['node', 'dd', 'console']"," });"," var out = loader.resolve(true);"," "," * @constructor"," * @class Loader"," * @param {Object} config an optional set of configuration options."," * @param {String} config.base The base dir which to fetch this module from"," * @param {String} config.comboBase The Combo service base path. Ex: `http://yui.yahooapis.com/combo?`"," * @param {String} config.root The root path to prepend to module names for the combo service. Ex: `2.5.2/build/`"," * @param {String|Object} config.filter A filter to apply to result urls. <a href=\"#property_filter\">See filter property</a>"," * @param {Object} config.filters Per-component filter specification. If specified for a given component, this overrides the filter config."," * @param {Boolean} config.combine Use a combo service to reduce the number of http connections required to load your dependencies"," * @param {Boolean} [config.async=true] Fetch files in async"," * @param {Array} config.ignore: A list of modules that should never be dynamically loaded"," * @param {Array} config.force A list of modules that should always be loaded when required, even if already present on the page"," * @param {HTMLElement|String} config.insertBefore Node or id for a node that should be used as the insertion point for new nodes"," * @param {Object} config.jsAttributes Object literal containing attributes to add to script nodes"," * @param {Object} config.cssAttributes Object literal containing attributes to add to link nodes"," * @param {Number} config.timeout The number of milliseconds before a timeout occurs when dynamically loading nodes. If not set, there is no timeout"," * @param {Object} config.context Execution context for all callbacks"," * @param {Function} config.onSuccess Callback for the 'success' event"," * @param {Function} config.onFailure Callback for the 'failure' event"," * @param {Function} config.onCSS Callback for the 'CSSComplete' event. When loading YUI components with CSS the CSS is loaded first, then the script. This provides a moment you can tie into to improve the presentation of the page while the script is loading."," * @param {Function} config.onTimeout Callback for the 'timeout' event"," * @param {Function} config.onProgress Callback executed each time a script or css file is loaded"," * @param {Object} config.modules A list of module definitions. See <a href=\"#method_addModule\">Loader.addModule</a> for the supported module metadata"," * @param {Object} config.groups A list of group definitions. Each group can contain specific definitions for `base`, `comboBase`, `combine`, and accepts a list of `modules`."," * @param {String} config.2in3 The version of the YUI 2 in 3 wrapper to use. The intrinsic support for YUI 2 modules in YUI 3 relies on versions of the YUI 2 components inside YUI 3 module wrappers. These wrappers change over time to accomodate the issues that arise from running YUI 2 in a YUI 3 sandbox."," * @param {String} config.yui2 When using the 2in3 project, you can select the version of YUI 2 to use. Valid values are `2.2.2`, `2.3.1`, `2.4.1`, `2.5.2`, `2.6.0`, `2.7.0`, `2.8.0`, `2.8.1` and `2.9.0` [default] -- plus all versions of YUI 2 going forward."," */","Y.Loader = function(o) {",""," var self = this;"," "," //Catch no config passed."," o = o || {};",""," modulekey = META.md5;",""," /**"," * Internal callback to handle multiple internal insert() calls"," * so that css is inserted prior to js"," * @property _internalCallback"," * @private"," */"," // self._internalCallback = null;",""," /**"," * Callback that will be executed when the loader is finished"," * with an insert"," * @method onSuccess"," * @type function"," */"," // self.onSuccess = null;",""," /**"," * Callback that will be executed if there is a failure"," * @method onFailure"," * @type function"," */"," // self.onFailure = null;",""," /**"," * Callback for the 'CSSComplete' event. When loading YUI components"," * with CSS the CSS is loaded first, then the script. This provides"," * a moment you can tie into to improve the presentation of the page"," * while the script is loading."," * @method onCSS"," * @type function"," */"," // self.onCSS = null;",""," /**"," * Callback executed each time a script or css file is loaded"," * @method onProgress"," * @type function"," */"," // self.onProgress = null;",""," /**"," * Callback that will be executed if a timeout occurs"," * @method onTimeout"," * @type function"," */"," // self.onTimeout = null;",""," /**"," * The execution context for all callbacks"," * @property context"," * @default {YUI} the YUI instance"," */"," self.context = Y;",""," /**"," * Data that is passed to all callbacks"," * @property data"," */"," // self.data = null;",""," /**"," * Node reference or id where new nodes should be inserted before"," * @property insertBefore"," * @type string|HTMLElement"," */"," // self.insertBefore = null;",""," /**"," * The charset attribute for inserted nodes"," * @property charset"," * @type string"," * @deprecated , use cssAttributes or jsAttributes."," */"," // self.charset = null;",""," /**"," * An object literal containing attributes to add to link nodes"," * @property cssAttributes"," * @type object"," */"," // self.cssAttributes = null;",""," /**"," * An object literal containing attributes to add to script nodes"," * @property jsAttributes"," * @type object"," */"," // self.jsAttributes = null;",""," /**"," * The base directory."," * @property base"," * @type string"," * @default http://yui.yahooapis.com/[YUI VERSION]/build/"," */"," self.base = Y.Env.meta.base + Y.Env.meta.root;",""," /**"," * Base path for the combo service"," * @property comboBase"," * @type string"," * @default http://yui.yahooapis.com/combo?"," */"," self.comboBase = Y.Env.meta.comboBase;",""," /*"," * Base path for language packs."," */"," // self.langBase = Y.Env.meta.langBase;"," // self.lang = \"\";",""," /**"," * If configured, the loader will attempt to use the combo"," * service for YUI resources and configured external resources."," * @property combine"," * @type boolean"," * @default true if a base dir isn't in the config"," */"," self.combine = o.base &&"," (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);"," "," /**"," * The default seperator to use between files in a combo URL"," * @property comboSep"," * @type {String}"," * @default Ampersand"," */"," self.comboSep = '&';"," /**"," * Max url length for combo urls. The default is 1024. This is the URL"," * limit for the Yahoo! hosted combo servers. If consuming"," * a different combo service that has a different URL limit"," * it is possible to override this default by supplying"," * the maxURLLength config option. The config option will"," * only take effect if lower than the default."," *"," * @property maxURLLength"," * @type int"," */"," self.maxURLLength = MAX_URL_LENGTH;",""," /**"," * Ignore modules registered on the YUI global"," * @property ignoreRegistered"," * @default false"," */"," self.ignoreRegistered = o.ignoreRegistered;",""," /**"," * Root path to prepend to module path for the combo"," * service"," * @property root"," * @type string"," * @default [YUI VERSION]/build/"," */"," self.root = Y.Env.meta.root;",""," /**"," * Timeout value in milliseconds. If set, self value will be used by"," * the get utility. the timeout event will fire if"," * a timeout occurs."," * @property timeout"," * @type int"," */"," self.timeout = 0;",""," /**"," * A list of modules that should not be loaded, even if"," * they turn up in the dependency tree"," * @property ignore"," * @type string[]"," */"," // self.ignore = null;",""," /**"," * A list of modules that should always be loaded, even"," * if they have already been inserted into the page."," * @property force"," * @type string[]"," */"," // self.force = null;",""," self.forceMap = {};",""," /**"," * Should we allow rollups"," * @property allowRollup"," * @type boolean"," * @default false"," */"," self.allowRollup = false;",""," /**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js)."," * </dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * @property filter"," * @type string| {searchExp: string, replaceStr: string}"," */"," // self.filter = null;",""," /**"," * per-component filter specification. If specified for a given"," * component, this overrides the filter config."," * @property filters"," * @type object"," */"," self.filters = {};",""," /**"," * The list of requested modules"," * @property required"," * @type {string: boolean}"," */"," self.required = {};",""," /**"," * If a module name is predefined when requested, it is checked againsts"," * the patterns provided in this property. If there is a match, the"," * module is added with the default configuration."," *"," * At the moment only supporting module prefixes, but anticipate"," * supporting at least regular expressions."," * @property patterns"," * @type Object"," */"," // self.patterns = Y.merge(Y.Env.meta.patterns);"," self.patterns = {};",""," /**"," * The library metadata"," * @property moduleInfo"," */"," // self.moduleInfo = Y.merge(Y.Env.meta.moduleInfo);"," self.moduleInfo = {};",""," self.groups = Y.merge(Y.Env.meta.groups);",""," /**"," * Provides the information used to skin the skinnable components."," * The following skin definition would result in 'skin1' and 'skin2'"," * being loaded for calendar (if calendar was requested), and"," * 'sam' for all other skinnable components:"," *"," * skin: {"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin. ex:"," * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/"," * base: 'assets/skins/',"," * "," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * calendar: ['skin1', 'skin2']"," * }"," * }"," * @property skin"," * @type {Object}"," */"," self.skin = Y.merge(Y.Env.meta.skin);",""," /*"," * Map of conditional modules"," * @since 3.2.0"," */"," self.conditions = {};",""," // map of modules with a hash of modules that meet the requirement"," // self.provides = {};",""," self.config = o;"," self._internal = true;",""," self._populateCache();",""," /**"," * Set when beginning to compute the dependency tree."," * Composed of what YUI reports to be loaded combined"," * with what has been loaded by any instance on the page"," * with the version number specified in the metadata."," * @property loaded"," * @type {string: boolean}"," */"," self.loaded = GLOBAL_LOADED[VERSION];",""," "," /**"," * Should Loader fetch scripts in `async`, defaults to `true`"," * @property async"," */",""," self.async = true;",""," self._inspectPage();",""," self._internal = false;",""," self._config(o);",""," self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; ",""," self.testresults = null;",""," if (Y.config.tests) {"," self.testresults = Y.config.tests;"," }"," "," /**"," * List of rollup files found in the library metadata"," * @property rollups"," */"," // self.rollups = null;",""," /**"," * Whether or not to load optional dependencies for"," * the requested modules"," * @property loadOptional"," * @type boolean"," * @default false"," */"," // self.loadOptional = false;",""," /**"," * All of the derived dependencies in sorted order, which"," * will be populated when either calculate() or insert()"," * is called"," * @property sorted"," * @type string[]"," */"," self.sorted = [];",""," /*"," * A list of modules to attach to the YUI instance when complete."," * If not supplied, the sorted list of dependencies are applied."," * @property attaching"," */"," // self.attaching = null;",""," /**"," * Flag to indicate the dependency tree needs to be recomputed"," * if insert is called again."," * @property dirty"," * @type boolean"," * @default true"," */"," self.dirty = true;",""," /**"," * List of modules inserted by the utility"," * @property inserted"," * @type {string: boolean}"," */"," self.inserted = {};",""," /**"," * List of skipped modules during insert() because the module"," * was not defined"," * @property skipped"," */"," self.skipped = {};",""," // Y.on('yui:load', self.loadNext, self);",""," self.tested = {};",""," /*"," * Cached sorted calculate results"," * @property results"," * @since 3.2.0"," */"," //self.results = {};",""," if (self.ignoreRegistered) {"," //Clear inpage already processed modules."," self._resetModules();"," }","","};","","Y.Loader.prototype = {"," /**"," * Checks the cache for modules and conditions, if they do not exist"," * process the default metadata and populate the local moduleInfo hash."," * @method _populateCache"," * @private"," */"," _populateCache: function() {"," var self = this,"," defaults = META.modules,"," cache = GLOBAL_ENV._renderedMods,"," i;",""," if (cache && !self.ignoreRegistered) {"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.moduleInfo[i] = Y.merge(cache[i]);"," }"," }",""," cache = GLOBAL_ENV._conditions;"," for (i in cache) {"," if (cache.hasOwnProperty(i)) {"," self.conditions[i] = Y.merge(cache[i]);"," }"," }",""," } else {"," for (i in defaults) {"," if (defaults.hasOwnProperty(i)) {"," self.addModule(defaults[i], i);"," }"," }"," }",""," },"," /**"," * Reset modules in the module cache to a pre-processed state so additional"," * computations with a different skin or language will work as expected."," * @private _resetModules"," */"," _resetModules: function() {"," var self = this, i, o;"," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," var mod = self.moduleInfo[i],"," name = mod.name,"," details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);",""," if (details) {"," self.moduleInfo[name]._reset = true;"," self.moduleInfo[name].requires = details.requires || [];"," self.moduleInfo[name].optional = details.optional || [];"," self.moduleInfo[name].supersedes = details.supercedes || [];"," }",""," if (mod.defaults) {"," for (o in mod.defaults) {"," if (mod.defaults.hasOwnProperty(o)) {"," if (mod[o]) {"," mod[o] = mod.defaults[o];"," }"," }"," }"," }"," delete mod.langCache;"," delete mod.skinCache;"," if (mod.skinnable) {"," self._addSkin(self.skin.defaultSkin, mod.name);"," }"," }"," }"," },"," /**"," Regex that matches a CSS URL. Used to guess the file type when it's not"," specified.",""," @property REGEX_CSS"," @type RegExp"," @final"," @protected"," @since 3.5.0"," **/"," REGEX_CSS: /\\.css(?:[?;].*)?$/i,"," "," /**"," * Default filters for raw and debug"," * @property FILTER_DEFS"," * @type Object"," * @final"," * @protected"," */"," FILTER_DEFS: {"," RAW: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '.js'"," },"," DEBUG: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-debug.js'"," },"," COVERAGE: {"," 'searchExp': '-min\\\\.js',"," 'replaceStr': '-coverage.js'"," }"," },"," /*"," * Check the pages meta-data and cache the result."," * @method _inspectPage"," * @private"," */"," _inspectPage: function() {"," var self = this, v, m, req, mr, i;",""," //Inspect the page for CSS only modules and mark them as loaded."," for (i in self.moduleInfo) {"," if (self.moduleInfo.hasOwnProperty(i)) {"," v = self.moduleInfo[i];"," if (v.type && v.type === CSS) {"," if (self.isCSSLoaded(v.name)) {"," self.loaded[i] = true;"," }"," }"," }"," }"," for (i in ON_PAGE) {"," if (ON_PAGE.hasOwnProperty(i)) {"," v = ON_PAGE[i];"," if (v.details) {"," m = self.moduleInfo[v.name];"," req = v.details.requires;"," mr = m && m.requires;",""," if (m) {"," if (!m._inspected && req && mr.length != req.length) {"," // console.log('deleting ' + m.name);"," delete m.expanded;"," }"," } else {"," m = self.addModule(v.details, i);"," }"," m._inspected = true;"," }"," }"," }"," },"," /*"," * returns true if b is not loaded, and is required directly or by means of modules it supersedes."," * @private"," * @method _requires"," * @param {String} mod1 The first module to compare"," * @param {String} mod2 The second module to compare"," */"," _requires: function(mod1, mod2) {",""," var i, rm, after_map, s,"," info = this.moduleInfo,"," m = info[mod1],"," other = info[mod2];",""," if (!m || !other) {"," return false;"," }",""," rm = m.expanded_map;"," after_map = m.after_map;",""," // check if this module should be sorted after the other"," // do this first to short circut circular deps"," if (after_map && (mod2 in after_map)) {"," return true;"," }",""," after_map = other.after_map;",""," // and vis-versa"," if (after_map && (mod1 in after_map)) {"," return false;"," }",""," // check if this module requires one the other supersedes"," s = info[mod2] && info[mod2].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod1, s[i])) {"," return true;"," }"," }"," }",""," s = info[mod1] && info[mod1].supersedes;"," if (s) {"," for (i = 0; i < s.length; i++) {"," if (this._requires(mod2, s[i])) {"," return false;"," }"," }"," }",""," // check if this module requires the other directly"," // if (r && YArray.indexOf(r, mod2) > -1) {"," if (rm && (mod2 in rm)) {"," return true;"," }",""," // external css files should be sorted below yui css"," if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {"," return true;"," }",""," return false;"," },"," /**"," * Apply a new config to the Loader instance"," * @method _config"," * @private"," * @param {Object} o The new configuration"," */"," _config: function(o) {"," var i, j, val, a, f, group, groupName, self = this;"," // apply config values"," if (o) {"," for (i in o) {"," if (o.hasOwnProperty(i)) {"," val = o[i];"," if (i == 'require') {"," self.require(val);"," } else if (i == 'skin') {"," //If the config.skin is a string, format to the expected object"," if (typeof val === 'string') {"," self.skin.defaultSkin = o.skin;"," val = {"," defaultSkin: val"," };"," }",""," Y.mix(self.skin, val, true);"," } else if (i == 'groups') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," groupName = j;"," group = val[j];"," self.addGroup(group, groupName);"," if (group.aliases) {"," for (a in group.aliases) {"," if (group.aliases.hasOwnProperty(a)) {"," self.addAlias(group.aliases[a], a);"," }"," }"," }"," }"," }",""," } else if (i == 'modules') {"," // add a hash of module definitions"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addModule(val[j], j);"," }"," }"," } else if (i === 'aliases') {"," for (j in val) {"," if (val.hasOwnProperty(j)) {"," self.addAlias(val[j], j);"," }"," }"," } else if (i == 'gallery') {"," this.groups.gallery.update(val, o);"," } else if (i == 'yui2' || i == '2in3') {"," this.groups.yui2.update(o['2in3'], o.yui2, o);"," } else {"," self[i] = val;"," }"," }"," }"," }",""," // fix filter"," f = self.filter;",""," if (L.isString(f)) {"," f = f.toUpperCase();"," self.filterName = f;"," self.filter = self.FILTER_DEFS[f];"," if (f == 'DEBUG') {"," self.require('yui-log', 'dump');"," }"," }",""," if (self.filterName && self.coverage) {"," if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {"," var mods = [];"," for (i = 0; i < self.coverage.length; i++) {"," var mod = self.coverage[i];"," if (self.moduleInfo[mod] && self.moduleInfo[mod].use) {"," mods = [].concat(mods, self.moduleInfo[mod].use);"," } else {"," mods.push(mod);"," }"," }"," self.filters = self.filters || {};"," Y.Array.each(mods, function(mod) {"," self.filters[mod] = self.FILTER_DEFS.COVERAGE;"," });"," self.filterName = 'RAW';"," self.filter = self.FILTER_DEFS[self.filterName];"," }"," }"," ",""," if (self.lang) {"," //Removed this so that when Loader is invoked"," //it doesn't request what it doesn't need."," //self.require('intl-base', 'intl');"," }",""," },",""," /**"," * Returns the skin module name for the specified skin name. If a"," * module name is supplied, the returned skin module name is"," * specific to the module passed in."," * @method formatSkin"," * @param {string} skin the name of the skin."," * @param {string} mod optional: the name of a module to skin."," * @return {string} the full skin module name."," */"," formatSkin: function(skin, mod) {"," var s = SKIN_PREFIX + skin;"," if (mod) {"," s = s + '-' + mod;"," }",""," return s;"," },",""," /**"," * Adds the skin def to the module info"," * @method _addSkin"," * @param {string} skin the name of the skin."," * @param {string} mod the name of the module."," * @param {string} parent parent module if this is a skin of a"," * submodule or plugin."," * @return {string} the module name for the skin."," * @private"," */"," _addSkin: function(skin, mod, parent) {"," var mdef, pkg, name, nmod,"," info = this.moduleInfo,"," sinf = this.skin,"," ext = info[mod] && info[mod].ext;",""," // Add a module definition for the module-specific skin css"," if (mod) {"," name = this.formatSkin(skin, mod);"," if (!info[name]) {"," mdef = info[mod];"," pkg = mdef.pkg || mod;"," nmod = {"," skin: true,"," name: name,"," group: mdef.group,"," type: 'css',"," after: sinf.after,"," path: (parent || pkg) + '/' + sinf.base + skin +"," '/' + mod + '.css',"," ext: ext"," };"," if (mdef.base) {"," nmod.base = mdef.base;"," }"," if (mdef.configFn) {"," nmod.configFn = mdef.configFn;"," }"," this.addModule(nmod, name);",""," }"," }",""," return name;"," },"," /**"," * Adds an alias module to the system"," * @method addAlias"," * @param {Array} use An array of modules that makes up this alias"," * @param {String} name The name of the alias"," * @example"," * var loader = new Y.Loader({});"," * loader.addAlias([ 'node', 'yql' ], 'davglass');"," * loader.require(['davglass']);"," * var out = loader.resolve(true);"," *"," * //out.js will contain Node and YQL modules"," */"," addAlias: function(use, name) {"," YUI.Env.aliases[name] = use;"," this.addModule({"," name: name,"," use: use"," });"," },"," /**"," * Add a new module group"," * @method addGroup"," * @param {Object} config An object containing the group configuration data"," * @param {String} config.name required, the group name"," * @param {String} config.base The base directory for this module group"," * @param {String} config.root The root path to add to each combo resource path"," * @param {Boolean} config.combine Should the request be combined"," * @param {String} config.comboBase Combo service base path"," * @param {Object} config.modules The group of modules"," * @param {String} name the group name."," * @example"," * var loader = new Y.Loader({});"," * loader.addGroup({"," * name: 'davglass',"," * combine: true,"," * comboBase: '/combo?',"," * root: '',"," * modules: {"," * //Module List here"," * }"," * }, 'davglass');"," */"," addGroup: function(o, name) {"," var mods = o.modules,"," self = this, i, v;",""," name = name || o.name;"," o.name = name;"," self.groups[name] = o;",""," if (o.patterns) {"," for (i in o.patterns) {"," if (o.patterns.hasOwnProperty(i)) {"," o.patterns[i].group = name;"," self.patterns[i] = o.patterns[i];"," }"," }"," }",""," if (mods) {"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," v = mods[i];"," if (typeof v === 'string') {"," v = { name: i, fullpath: v };"," }"," v.group = name;"," self.addModule(v, i);"," }"," }"," }"," },",""," /**"," * Add a new module to the component metadata."," * @method addModule"," * @param {Object} config An object containing the module data."," * @param {String} config.name Required, the component name"," * @param {String} config.type Required, the component type (js or css)"," * @param {String} config.path Required, the path to the script from `base`"," * @param {Array} config.requires Array of modules required by this component"," * @param {Array} [config.optional] Array of optional modules for this component"," * @param {Array} [config.supersedes] Array of the modules this component replaces"," * @param {Array} [config.after] Array of modules the components which, if present, should be sorted above this one"," * @param {Object} [config.after_map] Faster alternative to 'after' -- supply a hash instead of an array"," * @param {Number} [config.rollup] The number of superseded modules required for automatic rollup"," * @param {String} [config.fullpath] If `fullpath` is specified, this is used instead of the configured `base + path`"," * @param {Boolean} [config.skinnable] Flag to determine if skin assets should automatically be pulled in"," * @param {Object} [config.submodules] Hash of submodules"," * @param {String} [config.group] The group the module belongs to -- this is set automatically when it is added as part of a group configuration."," * @param {Array} [config.lang] Array of BCP 47 language tags of languages for which this module has localized resource bundles, e.g., `[\"en-GB\", \"zh-Hans-CN\"]`"," * @param {Object} [config.condition] Specifies that the module should be loaded automatically if a condition is met. This is an object with up to three fields:"," * @param {String} [config.condition.trigger] The name of a module that can trigger the auto-load"," * @param {Function} [config.condition.test] A function that returns true when the module is to be loaded."," * @param {String} [config.condition.when] Specifies the load order of the conditional module"," * with regard to the position of the trigger module."," * This should be one of three values: `before`, `after`, or `instead`. The default is `after`."," * @param {Object} [config.testresults] A hash of test results from `Y.Features.all()`"," * @param {Function} [config.configFn] A function to exectute when configuring this module"," * @param {Object} config.configFn.mod The module config, modifying this object will modify it's config. Returning false will delete the module's config."," * @param {String} [name] The module name, required if not in the module data."," * @return {Object} the module definition or null if the object passed in did not provide all required attributes."," */"," addModule: function(o, name) {"," name = name || o.name;",""," if (typeof o === 'string') {"," o = { name: name, fullpath: o };"," }"," "," //Only merge this data if the temp flag is set"," //from an earlier pass from a pattern or else"," //an override module (YUI_config) can not be used to"," //replace a default module."," if (this.moduleInfo[name] && this.moduleInfo[name].temp) {"," //This catches temp modules loaded via a pattern"," // The module will be added twice, once from the pattern and"," // Once from the actual add call, this ensures that properties"," // that were added to the module the first time around (group: gallery)"," // are also added the second time around too."," o = Y.merge(this.moduleInfo[name], o);"," }",""," o.name = name;",""," if (!o || !o.name) {"," return null;"," }",""," if (!o.type) {"," //Always assume it's javascript unless the CSS pattern is matched."," o.type = JS;"," var p = o.path || o.fullpath;"," if (p && this.REGEX_CSS.test(p)) {"," o.type = CSS;"," }"," }",""," if (!o.path && !o.fullpath) {"," o.path = _path(name, name, o.type);"," }"," o.supersedes = o.supersedes || o.use;",""," o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true;",""," // Handle submodule logic"," var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,"," j, langs, packName, supName, flatSup, flatLang, lang, ret,"," overrides, skinname, when, g,"," conditions = this.conditions, trigger;"," // , existing = this.moduleInfo[name], newr;"," "," this.moduleInfo[name] = o;",""," o.requires = o.requires || [];"," "," /*"," Only allowing the cascade of requires information, since"," optional and supersedes are far more fine grained than"," a blanket requires is."," */"," if (this.requires) {"," for (i = 0; i < this.requires.length; i++) {"," o.requires.push(this.requires[i]);"," }"," }"," if (o.group && this.groups && this.groups[o.group]) {"," g = this.groups[o.group];"," if (g.requires) {"," for (i = 0; i < g.requires.length; i++) {"," o.requires.push(g.requires[i]);"," }"," }"," }","",""," if (!o.defaults) {"," o.defaults = {"," requires: o.requires ? [].concat(o.requires) : null,"," supersedes: o.supersedes ? [].concat(o.supersedes) : null,"," optional: o.optional ? [].concat(o.optional) : null"," };"," }",""," if (o.skinnable && o.ext && o.temp) {"," skinname = this._addSkin(this.skin.defaultSkin, name);"," o.requires.unshift(skinname);"," }"," "," if (o.requires.length) {"," o.requires = this.filterRequires(o.requires) || [];"," }",""," if (!o.langPack && o.lang) {"," langs = YArray(o.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," smod = this.moduleInfo[packName];"," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }"," }"," }","",""," if (subs) {"," sup = o.supersedes || [];"," l = 0;",""," for (i in subs) {"," if (subs.hasOwnProperty(i)) {"," s = subs[i];",""," s.path = s.path || _path(name, i, o.type);"," s.pkg = name;"," s.group = o.group;",""," if (s.supersedes) {"," sup = sup.concat(s.supersedes);"," }",""," smod = this.addModule(s, i);"," sup.push(i);",""," if (smod.skinnable) {"," o.skinnable = true;"," overrides = this.skin.overrides;"," if (overrides && overrides[i]) {"," for (j = 0; j < overrides[i].length; j++) {"," skinname = this._addSkin(overrides[i][j],"," i, name);"," sup.push(skinname);"," }"," }"," skinname = this._addSkin(this.skin.defaultSkin,"," i, name);"," sup.push(skinname);"," }",""," // looks like we are expected to work out the metadata"," // for the parent module language packs from what is"," // specified in the child modules."," if (s.lang && s.lang.length) {",""," langs = YArray(s.lang);"," for (j = 0; j < langs.length; j++) {"," lang = langs[j];"," packName = this.getLangPackName(lang, name);"," supName = this.getLangPackName(lang, i);"," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," flatSup = flatSup || YArray.hash(smod.supersedes);",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }",""," o.lang = o.lang || [];",""," flatLang = flatLang || YArray.hash(o.lang);",""," if (!(lang in flatLang)) {"," o.lang.push(lang);"," }","","// Add rollup file, need to add to supersedes list too",""," // default packages"," packName = this.getLangPackName(ROOT_LANG, name);"," supName = this.getLangPackName(ROOT_LANG, i);",""," smod = this.moduleInfo[packName];",""," if (!smod) {"," smod = this._addLangPack(lang, o, packName);"," }",""," if (!(supName in flatSup)) {"," smod.supersedes.push(supName);"," }","","// Add rollup file, need to add to supersedes list too",""," }"," }",""," l++;"," }"," }"," //o.supersedes = YObject.keys(YArray.hash(sup));"," o.supersedes = YArray.dedupe(sup);"," if (this.allowRollup) {"," o.rollup = (l < 4) ? l : Math.min(l - 1, 4);"," }"," }",""," plugins = o.plugins;"," if (plugins) {"," for (i in plugins) {"," if (plugins.hasOwnProperty(i)) {"," plug = plugins[i];"," plug.pkg = name;"," plug.path = plug.path || _path(name, i, o.type);"," plug.requires = plug.requires || [];"," plug.group = o.group;"," this.addModule(plug, i);"," if (o.skinnable) {"," this._addSkin(this.skin.defaultSkin, i, name);"," }",""," }"," }"," }",""," if (o.condition) {"," t = o.condition.trigger;"," if (YUI.Env.aliases[t]) {"," t = YUI.Env.aliases[t];"," }"," if (!Y.Lang.isArray(t)) {"," t = [t];"," }",""," for (i = 0; i < t.length; i++) {"," trigger = t[i];"," when = o.condition.when;"," conditions[trigger] = conditions[trigger] || {};"," conditions[trigger][name] = o.condition;"," // the 'when' attribute can be 'before', 'after', or 'instead'"," // the default is after."," if (when && when != 'after') {"," if (when == 'instead') { // replace the trigger"," o.supersedes = o.supersedes || [];"," o.supersedes.push(trigger);"," } else { // before the trigger"," // the trigger requires the conditional mod,"," // so it should appear before the conditional"," // mod if we do not intersede."," }"," } else { // after the trigger"," o.after = o.after || [];"," o.after.push(trigger);"," }"," }"," }",""," if (o.supersedes) {"," o.supersedes = this.filterRequires(o.supersedes);"," }",""," if (o.after) {"," o.after = this.filterRequires(o.after);"," o.after_map = YArray.hash(o.after);"," }",""," // this.dirty = true;",""," if (o.configFn) {"," ret = o.configFn(o);"," if (ret === false) {"," delete this.moduleInfo[name];"," delete GLOBAL_ENV._renderedMods[name];"," o = null;"," }"," }"," //Add to global cache"," if (o) {"," if (!GLOBAL_ENV._renderedMods) {"," GLOBAL_ENV._renderedMods = {};"," }"," GLOBAL_ENV._renderedMods[name] = Y.mix(GLOBAL_ENV._renderedMods[name] || {}, o);"," GLOBAL_ENV._conditions = conditions;"," }",""," return o;"," },",""," /**"," * Add a requirement for one or more module"," * @method require"," * @param {string[] | string*} what the modules to load."," */"," require: function(what) {"," var a = (typeof what === 'string') ? YArray(arguments) : what;"," this.dirty = true;"," this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));",""," this._explodeRollups();"," },"," /**"," * Grab all the items that were asked for, check to see if the Loader"," * meta-data contains a \"use\" array. If it doesm remove the asked item and replace it with "," * the content of the \"use\"."," * This will make asking for: \"dd\""," * Actually ask for: \"dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin\""," * @private"," * @method _explodeRollups"," */"," _explodeRollups: function() {"," var self = this, m, m2, i, a, v, len, len2,"," r = self.required;",""," if (!self.allowRollup) {"," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = self.getModule(i);"," if (m && m.use) {"," len = m.use.length;"," for (a = 0; a < len; a++) {"," m2 = self.getModule(m.use[a]);"," if (m2 && m2.use) {"," len2 = m2.use.length;"," for (v = 0; v < len2; v++) {"," r[m2.use[v]] = true;"," }"," } else {"," r[m.use[a]] = true;"," }"," }"," }"," }"," }"," self.required = r;"," }",""," },"," /**"," * Explodes the required array to remove aliases and replace them with real modules"," * @method filterRequires"," * @param {Array} r The original requires array"," * @return {Array} The new array of exploded requirements"," */"," filterRequires: function(r) {"," if (r) {"," if (!Y.Lang.isArray(r)) {"," r = [r];"," }"," r = Y.Array(r);"," var c = [], i, mod, o, m;",""," for (i = 0; i < r.length; i++) {"," mod = this.getModule(r[i]);"," if (mod && mod.use) {"," for (o = 0; o < mod.use.length; o++) {"," //Must walk the other modules in case a module is a rollup of rollups (datatype)"," m = this.getModule(mod.use[o]);"," if (m && m.use) {"," c = Y.Array.dedupe([].concat(c, this.filterRequires(m.use)));"," } else {"," c.push(mod.use[o]);"," }"," }"," } else {"," c.push(r[i]);"," }"," }"," r = c;"," }"," return r;"," },"," /**"," * Returns an object containing properties for all modules required"," * in order to load the requested module"," * @method getRequires"," * @param {object} mod The module definition from moduleInfo."," * @return {array} the expanded requirement list."," */"," getRequires: function(mod) {",""," if (!mod) {"," //console.log('returning no reqs for ' + mod.name);"," return NO_REQUIREMENTS;"," }",""," if (mod._parsed) {"," //console.log('returning requires for ' + mod.name, mod.requires);"," return mod.expanded || NO_REQUIREMENTS;"," }",""," //TODO add modue cache here out of scope..",""," var i, m, j, add, packName, lang, testresults = this.testresults,"," name = mod.name, cond,"," adddef = ON_PAGE[name] && ON_PAGE[name].details,"," d, k, m1, go, def,"," r, old_mod,"," o, skinmod, skindef, skinpar, skinname,"," intl = mod.lang || mod.intl,"," info = this.moduleInfo,"," ftests = Y.Features && Y.Features.tests.load,"," hash, reparse;",""," // console.log(name);",""," // pattern match leaves module stub that needs to be filled out"," if (mod.temp && adddef) {"," old_mod = mod;"," mod = this.addModule(adddef, name);"," mod.group = old_mod.group;"," mod.pkg = old_mod.pkg;"," delete mod.expanded;"," }",""," // console.log('cache: ' + mod.langCache + ' == ' + this.lang);"," "," //If a skin or a lang is different, reparse.."," reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin));",""," if (mod.expanded && !reparse) {"," return mod.expanded;"," }"," ",""," d = [];"," hash = {};"," r = this.filterRequires(mod.requires);"," if (mod.lang) {"," //If a module has a lang attribute, auto add the intl requirement."," d.unshift('intl');"," r.unshift('intl');"," intl = true;"," }"," o = this.filterRequires(mod.optional);","",""," mod._parsed = true;"," mod.langCache = this.lang;"," mod.skinCache = this.skin.defaultSkin;",""," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," d.push(r[i]);"," hash[r[i]] = true;"," m = this.getModule(r[i]);"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }",""," // get the requirements from superseded modules, if any"," r = this.filterRequires(mod.supersedes);"," if (r) {"," for (i = 0; i < r.length; i++) {"," if (!hash[r[i]]) {"," // if this module has submodules, the requirements list is"," // expanded to include the submodules. This is so we can"," // prevent dups when a submodule is already loaded and the"," // parent is requested."," if (mod.submodules) {"," d.push(r[i]);"," }",""," hash[r[i]] = true;"," m = this.getModule(r[i]);",""," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," if (o && this.loadOptional) {"," for (i = 0; i < o.length; i++) {"," if (!hash[o[i]]) {"," d.push(o[i]);"," hash[o[i]] = true;"," m = info[o[i]];"," if (m) {"," add = this.getRequires(m);"," intl = intl || (m.expanded_map &&"," (INTL in m.expanded_map));"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }"," }"," }"," }"," }",""," cond = this.conditions[name];",""," if (cond) {"," //Set the module to not parsed since we have conditionals and this could change the dependency tree."," mod._parsed = false;"," if (testresults && ftests) {"," oeach(testresults, function(result, id) {"," var condmod = ftests[id].name;"," if (!hash[condmod] && ftests[id].trigger == name) {"," if (result && ftests[id]) {"," hash[condmod] = true;"," d.push(condmod);"," }"," }"," });"," } else {"," for (i in cond) {"," if (cond.hasOwnProperty(i)) {"," if (!hash[i]) {"," def = cond[i];"," //first see if they've specfied a ua check"," //then see if they've got a test fn & if it returns true"," //otherwise just having a condition block is enough"," go = def && ((!def.ua && !def.test) || (def.ua && Y.UA[def.ua]) ||"," (def.test && def.test(Y, r)));",""," if (go) {"," hash[i] = true;"," d.push(i);"," m = this.getModule(i);"," if (m) {"," add = this.getRequires(m);"," for (j = 0; j < add.length; j++) {"," d.push(add[j]);"," }",""," }"," }"," }"," }"," }"," }"," }",""," // Create skin modules"," if (mod.skinnable) {"," skindef = this.skin.overrides;"," for (i in YUI.Env.aliases) {"," if (YUI.Env.aliases.hasOwnProperty(i)) {"," if (Y.Array.indexOf(YUI.Env.aliases[i], name) > -1) {"," skinpar = i;"," }"," }"," }"," if (skindef && (skindef[name] || (skinpar && skindef[skinpar]))) {"," skinname = name;"," if (skindef[skinpar]) {"," skinname = skinpar;"," }"," for (i = 0; i < skindef[skinname].length; i++) {"," skinmod = this._addSkin(skindef[skinname][i], name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," } else {"," skinmod = this._addSkin(this.skin.defaultSkin, name);"," if (!this.isCSSLoaded(skinmod, this._boot)) {"," d.push(skinmod);"," }"," }"," }",""," mod._parsed = false;",""," if (intl) {",""," if (mod.lang && !mod.langPack && Y.Intl) {"," lang = Y.Intl.lookupBestLang(this.lang || ROOT_LANG, mod.lang);"," packName = this.getLangPackName(lang, name);"," if (packName) {"," d.unshift(packName);"," }"," }"," d.unshift(INTL);"," }",""," mod.expanded_map = YArray.hash(d);",""," mod.expanded = YObject.keys(mod.expanded_map);",""," return mod.expanded;"," },"," /**"," * Check to see if named css module is already loaded on the page"," * @method isCSSLoaded"," * @param {String} name The name of the css file"," * @return Boolean"," */"," isCSSLoaded: function(name, skip) {"," //TODO - Make this call a batching call with name being an array"," if (!name || !YUI.Env.cssStampEl || (!skip && this.ignoreRegistered)) {"," return false;"," }"," var el = YUI.Env.cssStampEl,"," ret = false,"," mod = YUI.Env._cssLoaded[name],"," style = el.currentStyle; //IE",""," "," if (mod !== undefined) {"," return mod;"," }",""," //Add the classname to the element"," el.className = name;",""," if (!style) {"," style = Y.config.doc.defaultView.getComputedStyle(el, null);"," }",""," if (style && style.display === 'none') {"," ret = true;"," }","",""," el.className = ''; //Reset the classname to ''",""," YUI.Env._cssLoaded[name] = ret;",""," return ret;"," },",""," /**"," * Returns a hash of module names the supplied module satisfies."," * @method getProvides"," * @param {string} name The name of the module."," * @return {object} what this module provides."," */"," getProvides: function(name) {"," var m = this.getModule(name), o, s;"," // supmap = this.provides;",""," if (!m) {"," return NOT_FOUND;"," }",""," if (m && !m.provides) {"," o = {};"," s = m.supersedes;",""," if (s) {"," YArray.each(s, function(v) {"," Y.mix(o, this.getProvides(v));"," }, this);"," }",""," o[name] = true;"," m.provides = o;",""," }",""," return m.provides;"," },",""," /**"," * Calculates the dependency tree, the result is stored in the sorted"," * property."," * @method calculate"," * @param {object} o optional options object."," * @param {string} type optional argument to prune modules."," */"," calculate: function(o, type) {"," if (o || type || this.dirty) {",""," if (o) {"," this._config(o);"," }",""," if (!this._init) {"," this._setup();"," }",""," this._explode();",""," if (this.allowRollup) {"," this._rollup();"," } else {"," this._explodeRollups();"," }"," this._reduce();"," this._sort();"," }"," },"," /**"," * Creates a \"psuedo\" package for languages provided in the lang array"," * @method _addLangPack"," * @private"," * @param {String} lang The language to create"," * @param {Object} m The module definition to create the language pack around"," * @param {String} packName The name of the package (e.g: lang/datatype-date-en-US)"," * @return {Object} The module definition"," */"," _addLangPack: function(lang, m, packName) {"," var name = m.name,"," packPath, conf,"," existing = this.moduleInfo[packName];",""," if (!existing) {",""," packPath = _path((m.pkg || name), packName, JS, true);",""," conf = {"," path: packPath,"," intl: true,"," langPack: true,"," ext: m.ext,"," group: m.group,"," supersedes: []"," };"," if (m.root) {"," conf.root = m.root;"," }"," if (m.base) {"," conf.base = m.base;"," }",""," if (m.configFn) {"," conf.configFn = m.configFn;"," }",""," this.addModule(conf, packName);",""," if (lang) {"," Y.Env.lang = Y.Env.lang || {};"," Y.Env.lang[lang] = Y.Env.lang[lang] || {};"," Y.Env.lang[lang][name] = true;"," }"," }",""," return this.moduleInfo[packName];"," },",""," /**"," * Investigates the current YUI configuration on the page. By default,"," * modules already detected will not be loaded again unless a force"," * option is encountered. Called by calculate()"," * @method _setup"," * @private"," */"," _setup: function() {"," var info = this.moduleInfo, name, i, j, m, l,"," packName;",""," for (name in info) {"," if (info.hasOwnProperty(name)) {"," m = info[name];"," if (m) {",""," // remove dups"," //m.requires = YObject.keys(YArray.hash(m.requires));"," m.requires = YArray.dedupe(m.requires);",""," // Create lang pack modules"," //if (m.lang && m.lang.length) {"," if (m.lang) {"," // Setup root package if the module has lang defined,"," // it needs to provide a root language pack"," packName = this.getLangPackName(ROOT_LANG, name);"," this._addLangPack(null, m, packName);"," }",""," }"," }"," }","",""," //l = Y.merge(this.inserted);"," l = {};",""," // available modules"," if (!this.ignoreRegistered) {"," Y.mix(l, GLOBAL_ENV.mods);"," }",""," // add the ignore list to the list of loaded packages"," if (this.ignore) {"," Y.mix(l, YArray.hash(this.ignore));"," }",""," // expand the list to include superseded modules"," for (j in l) {"," if (l.hasOwnProperty(j)) {"," Y.mix(l, this.getProvides(j));"," }"," }",""," // remove modules on the force list from the loaded list"," if (this.force) {"," for (i = 0; i < this.force.length; i++) {"," if (this.force[i] in l) {"," delete l[this.force[i]];"," }"," }"," }",""," Y.mix(this.loaded, l);",""," this._init = true;"," },",""," /**"," * Builds a module name for a language pack"," * @method getLangPackName"," * @param {string} lang the language code."," * @param {string} mname the module to build it for."," * @return {string} the language pack module name."," */"," getLangPackName: function(lang, mname) {"," return ('lang/' + mname + ((lang) ? '_' + lang : ''));"," },"," /**"," * Inspects the required modules list looking for additional"," * dependencies. Expands the required list to include all"," * required modules. Called by calculate()"," * @method _explode"," * @private"," */"," _explode: function() {"," //TODO Move done out of scope"," var r = this.required, m, reqs, done = {},"," self = this, name;",""," // the setup phase is over, all modules have been created"," self.dirty = false;",""," self._explodeRollups();"," r = self.required;"," "," for (name in r) {"," if (r.hasOwnProperty(name)) {"," if (!done[name]) {"," done[name] = true;"," m = self.getModule(name);"," if (m) {"," var expound = m.expound;",""," if (expound) {"," r[expound] = self.getModule(expound);"," reqs = self.getRequires(r[expound]);"," Y.mix(r, YArray.hash(reqs));"," }",""," reqs = self.getRequires(m);"," Y.mix(r, YArray.hash(reqs));"," }"," }"," }"," }",""," },"," /**"," * The default method used to test a module against a pattern"," * @method _patternTest"," * @private"," * @param {String} mname The module being tested"," * @param {String} pname The pattern to match"," */"," _patternTest: function(mname, pname) {"," return (mname.indexOf(pname) > -1);"," },"," /**"," * Get's the loader meta data for the requested module"," * @method getModule"," * @param {String} mname The module name to get"," * @return {Object} The module metadata"," */"," getModule: function(mname) {"," //TODO: Remove name check - it's a quick hack to fix pattern WIP"," if (!mname) {"," return null;"," }",""," var p, found, pname,"," m = this.moduleInfo[mname],"," patterns = this.patterns;",""," // check the patterns library to see if we should automatically add"," // the module with defaults"," if (!m || (m && m.ext)) {"," for (pname in patterns) {"," if (patterns.hasOwnProperty(pname)) {"," p = patterns[pname];"," "," //There is no test method, create a default one that tests"," // the pattern against the mod name"," if (!p.test) {"," p.test = this._patternTest;"," }",""," if (p.test(mname, pname)) {"," // use the metadata supplied for the pattern"," // as the module definition."," found = p;"," break;"," }"," }"," }"," }",""," if (!m) {"," if (found) {"," if (p.action) {"," p.action.call(this, mname, pname);"," } else {"," // ext true or false?"," m = this.addModule(Y.merge(found), mname);"," if (found.configFn) {"," m.configFn = found.configFn;"," }"," m.temp = true;"," }"," }"," } else {"," if (found && m && found.configFn && !m.configFn) {"," m.configFn = found.configFn;"," m.configFn(m);"," }"," }",""," return m;"," },",""," // impl in rollup submodule"," _rollup: function() { },",""," /**"," * Remove superceded modules and loaded modules. Called by"," * calculate() after we have the mega list of all dependencies"," * @method _reduce"," * @return {object} the reduced dependency hash."," * @private"," */"," _reduce: function(r) {",""," r = r || this.required;",""," var i, j, s, m, type = this.loadType,"," ignore = this.ignore ? YArray.hash(this.ignore) : false;",""," for (i in r) {"," if (r.hasOwnProperty(i)) {"," m = this.getModule(i);"," // remove if already loaded"," if (((this.loaded[i] || ON_PAGE[i]) &&"," !this.forceMap[i] && !this.ignoreRegistered) ||"," (type && m && m.type != type)) {"," delete r[i];"," }"," if (ignore && ignore[i]) {"," delete r[i];"," }"," // remove anything this module supersedes"," s = m && m.supersedes;"," if (s) {"," for (j = 0; j < s.length; j++) {"," if (s[j] in r) {"," delete r[s[j]];"," }"," }"," }"," }"," }",""," return r;"," },"," /**"," * Handles the queue when a module has been loaded for all cases"," * @method _finish"," * @private"," * @param {String} msg The message from Loader"," * @param {Boolean} success A boolean denoting success or failure"," */"," _finish: function(msg, success) {",""," _queue.running = false;",""," var onEnd = this.onEnd;"," if (onEnd) {"," onEnd.call(this.context, {"," msg: msg,"," data: this.data,"," success: success"," });"," }"," this._continue();"," },"," /**"," * The default Loader onSuccess handler, calls this.onSuccess with a payload"," * @method _onSuccess"," * @private"," */"," _onSuccess: function() {"," var self = this, skipped = Y.merge(self.skipped), fn,"," failed = [], rreg = self.requireRegistration,"," success, msg, i, mod;"," "," for (i in skipped) {"," if (skipped.hasOwnProperty(i)) {"," delete self.inserted[i];"," }"," }",""," self.skipped = {};"," "," for (i in self.inserted) {"," if (self.inserted.hasOwnProperty(i)) {"," mod = self.getModule(i);"," if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {"," failed.push(i);"," } else {"," Y.mix(self.loaded, self.getProvides(i));"," }"," }"," }",""," fn = self.onSuccess;"," msg = (failed.length) ? 'notregistered' : 'success';"," success = !(failed.length);"," if (fn) {"," fn.call(self.context, {"," msg: msg,"," data: self.data,"," success: success,"," failed: failed,"," skipped: skipped"," });"," }"," self._finish(msg, success);"," },"," /**"," * The default Loader onProgress handler, calls this.onProgress with a payload"," * @method _onProgress"," * @private"," */"," _onProgress: function(e) {"," var self = this;"," if (self.onProgress) {"," self.onProgress.call(self.context, {"," name: e.url,"," data: e.data"," });"," }"," },"," /**"," * The default Loader onFailure handler, calls this.onFailure with a payload"," * @method _onFailure"," * @private"," */"," _onFailure: function(o) {"," var f = this.onFailure, msg = [], i = 0, len = o.errors.length;"," "," for (i; i < len; i++) {"," msg.push(o.errors[i].error);"," }",""," msg = msg.join(',');",""," "," if (f) {"," f.call(this.context, {"," msg: msg,"," data: this.data,"," success: false"," });"," }"," "," this._finish(msg, false);",""," },",""," /**"," * The default Loader onTimeout handler, calls this.onTimeout with a payload"," * @method _onTimeout"," * @private"," */"," _onTimeout: function() {"," var f = this.onTimeout;"," if (f) {"," f.call(this.context, {"," msg: 'timeout',"," data: this.data,"," success: false"," });"," }"," },",""," /**"," * Sorts the dependency tree. The last step of calculate()"," * @method _sort"," * @private"," */"," _sort: function() {",""," // create an indexed list"," var s = YObject.keys(this.required),"," // loaded = this.loaded,"," //TODO Move this out of scope"," done = {},"," p = 0, l, a, b, j, k, moved, doneKey;",""," // keep going until we make a pass without moving anything"," for (;;) {",""," l = s.length;"," moved = false;",""," // start the loop after items that are already sorted"," for (j = p; j < l; j++) {",""," // check the next module on the list to see if its"," // dependencies have been met"," a = s[j];",""," // check everything below current item and move if we"," // find a requirement for the current item"," for (k = j + 1; k < l; k++) {"," doneKey = a + s[k];",""," if (!done[doneKey] && this._requires(a, s[k])) {",""," // extract the dependency so we can move it up"," b = s.splice(k, 1);",""," // insert the dependency above the item that"," // requires it"," s.splice(j, 0, b[0]);",""," // only swap two dependencies once to short circut"," // circular dependencies"," done[doneKey] = true;",""," // keep working"," moved = true;",""," break;"," }"," }",""," // jump out of loop if we moved something"," if (moved) {"," break;"," // this item is sorted, move our pointer and keep going"," } else {"," p++;"," }"," }",""," // when we make it here and moved is false, we are"," // finished sorting"," if (!moved) {"," break;"," }",""," }",""," this.sorted = s;"," },",""," /**"," * Handles the actual insertion of script/link tags"," * @method _insert"," * @private"," * @param {Object} source The YUI instance the request came from"," * @param {Object} o The metadata to include"," * @param {String} type JS or CSS"," * @param {Boolean} [skipcalc=false] Do a Loader.calculate on the meta"," */"," _insert: function(source, o, type, skipcalc) {","",""," // restore the state at the time of the request"," if (source) {"," this._config(source);"," }",""," // build the dependency list"," // don't include type so we can process CSS and script in"," // one pass when the type is not specified."," if (!skipcalc) {"," //this.calculate(o);"," }",""," var modules = this.resolve(!skipcalc),"," self = this, comp = 0, actions = 0;",""," if (type) {"," //Filter out the opposite type and reset the array so the checks later work"," modules[((type === JS) ? CSS : JS)] = [];"," }"," if (modules.js.length) {"," comp++;"," }"," if (modules.css.length) {"," comp++;"," }",""," //console.log('Resolved Modules: ', modules);",""," var complete = function(d) {"," actions++;"," var errs = {}, i = 0, u = '', fn;",""," if (d && d.errors) {"," for (i = 0; i < d.errors.length; i++) {"," if (d.errors[i].request) {"," u = d.errors[i].request.url;"," } else {"," u = d.errors[i];"," }"," errs[u] = u;"," }"," }"," "," if (d && d.data && d.data.length && (d.type === 'success')) {"," for (i = 0; i < d.data.length; i++) {"," self.inserted[d.data[i].name] = true;"," }"," }",""," if (actions === comp) {"," self._loading = null;"," if (d && d.fn) {"," fn = d.fn;"," delete d.fn;"," fn.call(self, d);"," }"," }"," };",""," this._loading = true;",""," if (!modules.js.length && !modules.css.length) {"," actions = -1;"," complete({"," fn: self._onSuccess"," });"," return;"," }"," ",""," if (modules.css.length) { //Load CSS first"," Y.Get.css(modules.css, {"," data: modules.cssMods,"," attributes: self.cssAttributes,"," insertBefore: self.insertBefore,"," charset: self.charset,"," timeout: self.timeout,"," context: self,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }",""," if (modules.js.length) {"," Y.Get.js(modules.js, {"," data: modules.jsMods,"," insertBefore: self.insertBefore,"," attributes: self.jsAttributes,"," charset: self.charset,"," timeout: self.timeout,"," autopurge: false,"," context: self,"," async: self.async,"," onProgress: function(e) {"," self._onProgress.call(self, e);"," },"," onTimeout: function(d) {"," self._onTimeout.call(self, d);"," },"," onSuccess: function(d) {"," d.type = 'success';"," d.fn = self._onSuccess;"," complete.call(self, d);"," },"," onFailure: function(d) {"," d.type = 'failure';"," d.fn = self._onFailure;"," complete.call(self, d);"," }"," });"," }"," },"," /**"," * Once a loader operation is completely finished, process any additional queued items."," * @method _continue"," * @private"," */"," _continue: function() {"," if (!(_queue.running) && _queue.size() > 0) {"," _queue.running = true;"," _queue.next()();"," }"," },",""," /**"," * inserts the requested modules and their dependencies."," * <code>type</code> can be \"js\" or \"css\". Both script and"," * css are inserted if type is not provided."," * @method insert"," * @param {object} o optional options object."," * @param {string} type the type of dependency to insert."," */"," insert: function(o, type, skipsort) {"," var self = this, copy = Y.merge(this);"," delete copy.require;"," delete copy.dirty;"," _queue.add(function() {"," self._insert(copy, o, type, skipsort);"," });"," this._continue();"," },",""," /**"," * Executed every time a module is loaded, and if we are in a load"," * cycle, we attempt to load the next script. Public so that it"," * is possible to call this if using a method other than"," * Y.register to determine when scripts are fully loaded"," * @method loadNext"," * @deprecated"," * @param {string} mname optional the name of the module that has"," * been loaded (which is usually why it is time to load the next"," * one)."," */"," loadNext: function(mname) {"," return;"," },",""," /**"," * Apply filter defined for this instance to a url/path"," * @method _filter"," * @param {string} u the string to filter."," * @param {string} name the name of the module, if we are processing"," * a single module as opposed to a combined url."," * @return {string} the filtered string."," * @private"," */"," _filter: function(u, name, group) {"," var f = this.filter,"," hasFilter = name && (name in this.filters),"," modFilter = hasFilter && this.filters[name],"," groupName = group || (this.moduleInfo[name] ? this.moduleInfo[name].group : null);",""," if (groupName && this.groups[groupName] && this.groups[groupName].filter) {"," modFilter = this.groups[groupName].filter;"," hasFilter = true;"," }",""," if (u) {"," if (hasFilter) {"," f = (L.isString(modFilter)) ? this.FILTER_DEFS[modFilter.toUpperCase()] || null : modFilter;"," }"," if (f) {"," u = u.replace(new RegExp(f.searchExp, 'g'), f.replaceStr);"," }"," }"," return u;"," },",""," /**"," * Generates the full url for a module"," * @method _url"," * @param {string} path the path fragment."," * @param {String} name The name of the module"," * @param {String} [base=self.base] The base url to use"," * @return {string} the full url."," * @private"," */"," _url: function(path, name, base) {"," return this._filter((base || this.base || '') + path, name);"," },"," /**"," * Returns an Object hash of file arrays built from `loader.sorted` or from an arbitrary list of sorted modules."," * @method resolve"," * @param {Boolean} [calc=false] Perform a loader.calculate() before anything else"," * @param {Array} [s=loader.sorted] An override for the loader.sorted array"," * @return {Object} Object hash (js and css) of two arrays of file lists"," * @example This method can be used as an off-line dep calculator"," *"," * var Y = YUI();"," * var loader = new Y.Loader({"," * filter: 'debug',"," * base: '../../',"," * root: 'build/',"," * combine: true,"," * require: ['node', 'dd', 'console']"," * });"," * var out = loader.resolve(true);"," *"," */"," resolve: function(calc, s) {",""," var len, i, m, url, fn, msg, attr, group, groupName, j, frag,"," comboSource, comboSources, mods, comboBase,"," base, urls, u = [], tmpBase, baseLen, resCombos = {},"," self = this, comboSep, maxURLLength, singles = [],"," inserted = (self.ignoreRegistered) ? {} : self.inserted,"," resolved = { js: [], jsMods: [], css: [], cssMods: [] },"," type = self.loadType || 'js';",""," if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { "," self._resetModules();"," }",""," if (calc) {"," self.calculate();"," }"," s = s || self.sorted;",""," var addSingle = function(m) {"," "," if (m) {"," group = (m.group && self.groups[m.group]) || NOT_FOUND;"," "," //Always assume it's async"," if (group.async === false) {"," m.async = group.async;"," }",""," url = (m.fullpath) ? self._filter(m.fullpath, s[i]) :"," self._url(m.path, s[i], group.base || m.base);"," "," if (m.attributes || m.async === false) {"," url = {"," url: url,"," async: m.async"," };"," if (m.attributes) {"," url.attributes = m.attributes;"," }"," }"," resolved[m.type].push(url);"," resolved[m.type + 'Mods'].push(m);"," } else {"," }"," "," };",""," len = s.length;",""," // the default combo base"," comboBase = self.comboBase;",""," url = comboBase;",""," comboSources = {};",""," for (i = 0; i < len; i++) {"," comboSource = comboBase;"," m = self.getModule(s[i]);"," groupName = m && m.group;"," group = self.groups[groupName];"," if (groupName && group) {",""," if (!group.combine || m.fullpath) {"," //This is not a combo module, skip it and load it singly later."," //singles.push(s[i]);"," addSingle(m);"," continue;"," }"," m.combine = true;"," if (group.comboBase) {"," comboSource = group.comboBase;"," }",""," if (\"root\" in group && L.isValue(group.root)) {"," m.root = group.root;"," }"," m.comboSep = group.comboSep || self.comboSep;"," m.maxURLLength = group.maxURLLength || self.maxURLLength;"," } else {"," if (!self.combine) {"," //This is not a combo module, skip it and load it singly later."," //singles.push(s[i]);"," addSingle(m);"," continue;"," }"," }",""," comboSources[comboSource] = comboSources[comboSource] || [];"," comboSources[comboSource].push(m);"," }",""," for (j in comboSources) {"," if (comboSources.hasOwnProperty(j)) {"," resCombos[j] = resCombos[j] || { js: [], jsMods: [], css: [], cssMods: [] };"," url = j;"," mods = comboSources[j];"," len = mods.length;"," "," if (len) {"," for (i = 0; i < len; i++) {"," if (inserted[mods[i]]) {"," continue;"," }"," m = mods[i];"," // Do not try to combine non-yui JS unless combo def"," // is found"," if (m && (m.combine || !m.ext)) {"," resCombos[j].comboSep = m.comboSep;"," resCombos[j].group = m.group;"," resCombos[j].maxURLLength = m.maxURLLength;"," frag = ((L.isValue(m.root)) ? m.root : self.root) + (m.path || m.fullpath);"," frag = self._filter(frag, m.name);"," resCombos[j][m.type].push(frag);"," resCombos[j][m.type + 'Mods'].push(m);"," } else {"," //Add them to the next process.."," if (mods[i]) {"," //singles.push(mods[i].name);"," addSingle(mods[i]);"," }"," }",""," }"," }"," }"," }","",""," for (j in resCombos) {"," base = j;"," comboSep = resCombos[base].comboSep || self.comboSep;"," maxURLLength = resCombos[base].maxURLLength || self.maxURLLength;"," for (type in resCombos[base]) {"," if (type === JS || type === CSS) {"," urls = resCombos[base][type];"," mods = resCombos[base][type + 'Mods'];"," len = urls.length;"," tmpBase = base + urls.join(comboSep);"," baseLen = tmpBase.length;"," if (maxURLLength <= base.length) {"," maxURLLength = MAX_URL_LENGTH;"," }"," "," if (len) {"," if (baseLen > maxURLLength) {"," u = [];"," for (s = 0; s < len; s++) {"," u.push(urls[s]);"," tmpBase = base + u.join(comboSep);",""," if (tmpBase.length > maxURLLength) {"," m = u.pop();"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," u = [];"," if (m) {"," u.push(m);"," }"," }"," }"," if (u.length) {"," tmpBase = base + u.join(comboSep);"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," } else {"," resolved[type].push(self._filter(tmpBase, null, resCombos[base].group));"," }"," }"," resolved[type + 'Mods'] = resolved[type + 'Mods'].concat(mods);"," }"," }"," }",""," resCombos = null;",""," return resolved;"," },"," /**"," Shortcut to calculate, resolve and load all modules.",""," var loader = new Y.Loader({"," ignoreRegistered: true,"," modules: {"," mod: {"," path: 'mod.js'"," }"," },"," requires: [ 'mod' ]"," });"," loader.load(function() {"," console.log('All modules have loaded..');"," });","",""," @method load"," @param {Callback} cb Executed after all load operations are complete"," */"," load: function(cb) {"," if (!cb) {"," return;"," }"," var self = this,"," out = self.resolve(true);"," "," self.data = out;",""," self.onEnd = function() {"," cb.apply(self.context || self, arguments);"," };",""," self.insert();"," }","};","","","","}, '3.7.3' ,{requires:['get', 'features']});","YUI.add('loader-rollup', function(Y) {","","/**"," * Optional automatic rollup logic for reducing http connections"," * when not using a combo service."," * @module loader"," * @submodule rollup"," */","","/**"," * Look for rollup packages to determine if all of the modules a"," * rollup supersedes are required. If so, include the rollup to"," * help reduce the total number of connections required. Called"," * by calculate(). This is an optional feature, and requires the"," * appropriate submodule to function."," * @method _rollup"," * @for Loader"," * @private"," */","Y.Loader.prototype._rollup = function() {"," var i, j, m, s, r = this.required, roll,"," info = this.moduleInfo, rolled, c, smod;",""," // find and cache rollup modules"," if (this.dirty || !this.rollups) {"," this.rollups = {};"," for (i in info) {"," if (info.hasOwnProperty(i)) {"," m = this.getModule(i);"," // if (m && m.rollup && m.supersedes) {"," if (m && m.rollup) {"," this.rollups[i] = m;"," }"," }"," }"," }",""," // make as many passes as needed to pick up rollup rollups"," for (;;) {"," rolled = false;",""," // go through the rollup candidates"," for (i in this.rollups) {"," if (this.rollups.hasOwnProperty(i)) {"," // there can be only one, unless forced"," if (!r[i] && ((!this.loaded[i]) || this.forceMap[i])) {"," m = this.getModule(i);"," s = m.supersedes || [];"," roll = false;",""," // @TODO remove continue"," if (!m.rollup) {"," continue;"," }",""," c = 0;",""," // check the threshold"," for (j = 0; j < s.length; j++) {"," smod = info[s[j]];",""," // if the superseded module is loaded, we can't"," // load the rollup unless it has been forced."," if (this.loaded[s[j]] && !this.forceMap[s[j]]) {"," roll = false;"," break;"," // increment the counter if this module is required."," // if we are beyond the rollup threshold, we will"," // use the rollup module"," } else if (r[s[j]] && m.type == smod.type) {"," c++;"," roll = (c >= m.rollup);"," if (roll) {"," break;"," }"," }"," }",""," if (roll) {"," // add the rollup"," r[i] = true;"," rolled = true;",""," // expand the rollup's dependencies"," this.getRequires(m);"," }"," }"," }"," }",""," // if we made it here w/o rolling up something, we are done"," if (!rolled) {"," break;"," }"," }","};","","","}, '3.7.3' ,{requires:['loader-base']});","YUI.add('loader-yui3', function(Y) {","","/* This file is auto-generated by src/loader/scripts/meta_join.js */","","/**"," * YUI 3 module metadata"," * @module loader"," * @submodule yui3"," */","YUI.Env[Y.version].modules = YUI.Env[Y.version].modules || {"," \"align-plugin\": {"," \"requires\": ["," \"node-screen\","," \"node-pluginhost\""," ]"," },"," \"anim\": {"," \"use\": ["," \"anim-base\","," \"anim-color\","," \"anim-curve\","," \"anim-easing\","," \"anim-node-plugin\","," \"anim-scroll\","," \"anim-xy\""," ]"," },"," \"anim-base\": {"," \"requires\": ["," \"base-base\","," \"node-style\""," ]"," },"," \"anim-color\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-curve\": {"," \"requires\": ["," \"anim-xy\""," ]"," },"," \"anim-easing\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-node-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"anim-base\""," ]"," },"," \"anim-scroll\": {"," \"requires\": ["," \"anim-base\""," ]"," },"," \"anim-shape-transform\": {"," \"requires\": ["," \"anim-base\","," \"anim-easing\","," \"matrix\""," ]"," },"," \"anim-xy\": {"," \"requires\": ["," \"anim-base\","," \"node-screen\""," ]"," },"," \"app\": {"," \"use\": ["," \"app-base\","," \"app-content\","," \"app-transitions\","," \"lazy-model-list\","," \"model\","," \"model-list\","," \"model-sync-rest\","," \"router\","," \"view\","," \"view-node-map\""," ]"," },"," \"app-base\": {"," \"requires\": ["," \"classnamemanager\","," \"pjax-base\","," \"router\","," \"view\""," ]"," },"," \"app-content\": {"," \"requires\": ["," \"app-base\","," \"pjax-content\""," ]"," },"," \"app-transitions\": {"," \"requires\": ["," \"app-base\""," ]"," },"," \"app-transitions-css\": {"," \"type\": \"css\""," },"," \"app-transitions-native\": {"," \"condition\": {"," \"name\": \"app-transitions-native\","," \"test\": function (Y) {"," var doc = Y.config.doc,"," node = doc ? doc.documentElement : null;",""," if (node && node.style) {"," return ('MozTransition' in node.style || 'WebkitTransition' in node.style);"," }",""," return false;","},"," \"trigger\": \"app-transitions\""," },"," \"requires\": ["," \"app-transitions\","," \"app-transitions-css\","," \"parallel\","," \"transition\""," ]"," },"," \"array-extras\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"array-invoke\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"arraylist-add\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraylist-filter\": {"," \"requires\": ["," \"arraylist\""," ]"," },"," \"arraysort\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"async-queue\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute\": {"," \"use\": ["," \"attribute-base\","," \"attribute-complex\""," ]"," },"," \"attribute-base\": {"," \"requires\": ["," \"attribute-core\","," \"attribute-events\","," \"attribute-extras\""," ]"," },"," \"attribute-complex\": {"," \"requires\": ["," \"attribute-base\""," ]"," },"," \"attribute-core\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"attribute-events\": {"," \"requires\": ["," \"event-custom\""," ]"," },"," \"attribute-extras\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"autocomplete\": {"," \"use\": ["," \"autocomplete-base\","," \"autocomplete-sources\","," \"autocomplete-list\","," \"autocomplete-plugin\""," ]"," },"," \"autocomplete-base\": {"," \"optional\": ["," \"autocomplete-sources\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"escape\","," \"event-valuechange\","," \"node-base\""," ]"," },"," \"autocomplete-filters\": {"," \"requires\": ["," \"array-extras\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-filters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"autocomplete-highlighters\": {"," \"requires\": ["," \"array-extras\","," \"highlight-base\""," ]"," },"," \"autocomplete-highlighters-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"highlight-accentfold\""," ]"," },"," \"autocomplete-list\": {"," \"after\": ["," \"autocomplete-sources\""," ],"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"autocomplete-base\","," \"event-resize\","," \"node-screen\","," \"selector-css3\","," \"shim-plugin\","," \"widget\","," \"widget-position\","," \"widget-position-align\""," ],"," \"skinnable\": true"," },"," \"autocomplete-list-keys\": {"," \"condition\": {"," \"name\": \"autocomplete-list-keys\","," \"test\": function (Y) {"," // Only add keyboard support to autocomplete-list if this doesn't appear to"," // be an iOS or Android-based mobile device."," //"," // There's currently no feasible way to actually detect whether a device has"," // a hardware keyboard, so this sniff will have to do. It can easily be"," // overridden by manually loading the autocomplete-list-keys module."," //"," // Worth noting: even though iOS supports bluetooth keyboards, Mobile Safari"," // doesn't fire the keyboard events used by AutoCompleteList, so there's"," // no point loading the -keys module even when a bluetooth keyboard may be"," // available."," return !(Y.UA.ios || Y.UA.android);","},"," \"trigger\": \"autocomplete-list\""," },"," \"requires\": ["," \"autocomplete-list\","," \"base-build\""," ]"," },"," \"autocomplete-plugin\": {"," \"requires\": ["," \"autocomplete-list\","," \"node-pluginhost\""," ]"," },"," \"autocomplete-sources\": {"," \"optional\": ["," \"io-base\","," \"json-parse\","," \"jsonp\","," \"yql\""," ],"," \"requires\": ["," \"autocomplete-base\""," ]"," },"," \"base\": {"," \"use\": ["," \"base-base\","," \"base-pluginhost\","," \"base-build\""," ]"," },"," \"base-base\": {"," \"after\": ["," \"attribute-complex\""," ],"," \"requires\": ["," \"base-core\","," \"attribute-base\""," ]"," },"," \"base-build\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"base-core\": {"," \"requires\": ["," \"attribute-core\""," ]"," },"," \"base-pluginhost\": {"," \"requires\": ["," \"base-base\","," \"pluginhost\""," ]"," },"," \"button\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-core\": {"," \"requires\": ["," \"attribute-core\","," \"classnamemanager\","," \"node-base\""," ]"," },"," \"button-group\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget\""," ]"," },"," \"button-plugin\": {"," \"requires\": ["," \"button-core\","," \"cssbutton\","," \"node-pluginhost\""," ]"," },"," \"cache\": {"," \"use\": ["," \"cache-base\","," \"cache-offline\","," \"cache-plugin\""," ]"," },"," \"cache-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"cache-offline\": {"," \"requires\": ["," \"cache-base\","," \"json\""," ]"," },"," \"cache-plugin\": {"," \"requires\": ["," \"plugin\","," \"cache-base\""," ]"," },"," \"calendar\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"calendar-base\","," \"calendarnavigator\""," ],"," \"skinnable\": true"," },"," \"calendar-base\": {"," \"lang\": ["," \"de\","," \"en\","," \"fr\","," \"ja\","," \"nb-NO\","," \"pt-BR\","," \"ru\","," \"zh-HANT-TW\""," ],"," \"requires\": ["," \"widget\","," \"substitute\","," \"datatype-date\","," \"datatype-date-math\","," \"cssgrids\""," ],"," \"skinnable\": true"," },"," \"calendarnavigator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\","," \"datatype-date\","," \"node\","," \"substitute\""," ],"," \"skinnable\": true"," },"," \"charts\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"charts-base\": {"," \"requires\": ["," \"dom\","," \"datatype-number\","," \"datatype-date\","," \"event-custom\","," \"event-mouseenter\","," \"event-touch\","," \"widget\","," \"widget-position\","," \"widget-stack\","," \"graphics\""," ]"," },"," \"charts-legend\": {"," \"requires\": ["," \"charts-base\""," ]"," },"," \"classnamemanager\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"clickable-rail\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"collection\": {"," \"use\": ["," \"array-extras\","," \"arraylist\","," \"arraylist-add\","," \"arraylist-filter\","," \"array-invoke\""," ]"," },"," \"console\": {"," \"lang\": ["," \"en\","," \"es\","," \"ja\""," ],"," \"requires\": ["," \"yui-log\","," \"widget\","," \"substitute\""," ],"," \"skinnable\": true"," },"," \"console-filters\": {"," \"requires\": ["," \"plugin\","," \"console\""," ],"," \"skinnable\": true"," },"," \"controller\": {"," \"use\": ["," \"router\""," ]"," },"," \"cookie\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"createlink-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"cssbase\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbase-context\": {"," \"after\": ["," \"cssreset\","," \"cssfonts\","," \"cssgrids\","," \"cssreset-context\","," \"cssfonts-context\","," \"cssgrids-context\""," ],"," \"type\": \"css\""," },"," \"cssbutton\": {"," \"type\": \"css\""," },"," \"cssfonts\": {"," \"type\": \"css\""," },"," \"cssfonts-context\": {"," \"type\": \"css\""," },"," \"cssgrids\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-base\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"type\": \"css\""," },"," \"cssgrids-units\": {"," \"optional\": ["," \"cssreset\","," \"cssfonts\""," ],"," \"requires\": ["," \"cssgrids-base\""," ],"," \"type\": \"css\""," },"," \"cssreset\": {"," \"type\": \"css\""," },"," \"cssreset-context\": {"," \"type\": \"css\""," },"," \"dataschema\": {"," \"use\": ["," \"dataschema-base\","," \"dataschema-json\","," \"dataschema-xml\","," \"dataschema-array\","," \"dataschema-text\""," ]"," },"," \"dataschema-array\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-base\": {"," \"requires\": ["," \"base\""," ]"," },"," \"dataschema-json\": {"," \"requires\": ["," \"dataschema-base\","," \"json\""," ]"," },"," \"dataschema-text\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"dataschema-xml\": {"," \"requires\": ["," \"dataschema-base\""," ]"," },"," \"datasource\": {"," \"use\": ["," \"datasource-local\","," \"datasource-io\","," \"datasource-get\","," \"datasource-function\","," \"datasource-cache\","," \"datasource-jsonschema\","," \"datasource-xmlschema\","," \"datasource-arrayschema\","," \"datasource-textschema\","," \"datasource-polling\""," ]"," },"," \"datasource-arrayschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-array\""," ]"," },"," \"datasource-cache\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"cache-base\""," ]"," },"," \"datasource-function\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-get\": {"," \"requires\": ["," \"datasource-local\","," \"get\""," ]"," },"," \"datasource-io\": {"," \"requires\": ["," \"datasource-local\","," \"io-base\""," ]"," },"," \"datasource-jsonschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-json\""," ]"," },"," \"datasource-local\": {"," \"requires\": ["," \"base\""," ]"," },"," \"datasource-polling\": {"," \"requires\": ["," \"datasource-local\""," ]"," },"," \"datasource-textschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-text\""," ]"," },"," \"datasource-xmlschema\": {"," \"requires\": ["," \"datasource-local\","," \"plugin\","," \"dataschema-xml\""," ]"," },"," \"datatable\": {"," \"use\": ["," \"datatable-core\","," \"datatable-table\","," \"datatable-head\","," \"datatable-body\","," \"datatable-base\","," \"datatable-column-widths\","," \"datatable-message\","," \"datatable-mutable\","," \"datatable-sort\","," \"datatable-datasource\""," ]"," },"," \"datatable-base\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-table\","," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"datatable-base-deprecated\": {"," \"requires\": ["," \"recordset-base\","," \"widget\","," \"substitute\","," \"event-mouseenter\""," ],"," \"skinnable\": true"," },"," \"datatable-body\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-column-widths\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-core\": {"," \"requires\": ["," \"escape\","," \"model-list\","," \"node-event-delegate\""," ]"," },"," \"datatable-datasource\": {"," \"requires\": ["," \"datatable-base\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-datasource-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"datasource-local\""," ]"," },"," \"datatable-deprecated\": {"," \"use\": ["," \"datatable-base-deprecated\","," \"datatable-datasource-deprecated\","," \"datatable-sort-deprecated\","," \"datatable-scroll-deprecated\""," ]"," },"," \"datatable-head\": {"," \"requires\": ["," \"datatable-core\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatable-message\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-mutable\": {"," \"requires\": ["," \"datatable-base\""," ]"," },"," \"datatable-scroll\": {"," \"requires\": ["," \"datatable-base\","," \"datatable-column-widths\","," \"dom-screen\""," ],"," \"skinnable\": true"," },"," \"datatable-scroll-deprecated\": {"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\""," ]"," },"," \"datatable-sort\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base\""," ],"," \"skinnable\": true"," },"," \"datatable-sort-deprecated\": {"," \"lang\": ["," \"en\""," ],"," \"requires\": ["," \"datatable-base-deprecated\","," \"plugin\","," \"recordset-sort\""," ]"," },"," \"datatable-table\": {"," \"requires\": ["," \"datatable-core\","," \"datatable-head\","," \"datatable-body\","," \"view\","," \"classnamemanager\""," ]"," },"," \"datatype\": {"," \"use\": ["," \"datatype-number\","," \"datatype-date\","," \"datatype-xml\""," ]"," },"," \"datatype-date\": {"," \"supersedes\": ["," \"datatype-date-format\""," ],"," \"use\": ["," \"datatype-date-parse\","," \"datatype-date-format\""," ]"," },"," \"datatype-date-format\": {"," \"lang\": ["," \"ar\","," \"ar-JO\","," \"ca\","," \"ca-ES\","," \"da\","," \"da-DK\","," \"de\","," \"de-AT\","," \"de-DE\","," \"el\","," \"el-GR\","," \"en\","," \"en-AU\","," \"en-CA\","," \"en-GB\","," \"en-IE\","," \"en-IN\","," \"en-JO\","," \"en-MY\","," \"en-NZ\","," \"en-PH\","," \"en-SG\","," \"en-US\","," \"es\","," \"es-AR\","," \"es-BO\","," \"es-CL\","," \"es-CO\","," \"es-EC\","," \"es-ES\","," \"es-MX\","," \"es-PE\","," \"es-PY\","," \"es-US\","," \"es-UY\","," \"es-VE\","," \"fi\","," \"fi-FI\","," \"fr\","," \"fr-BE\","," \"fr-CA\","," \"fr-FR\","," \"hi\","," \"hi-IN\","," \"id\","," \"id-ID\","," \"it\","," \"it-IT\","," \"ja\","," \"ja-JP\","," \"ko\","," \"ko-KR\","," \"ms\","," \"ms-MY\","," \"nb\","," \"nb-NO\","," \"nl\","," \"nl-BE\","," \"nl-NL\","," \"pl\","," \"pl-PL\","," \"pt\","," \"pt-BR\","," \"ro\","," \"ro-RO\","," \"ru\","," \"ru-RU\","," \"sv\","," \"sv-SE\","," \"th\","," \"th-TH\","," \"tr\","," \"tr-TR\","," \"vi\","," \"vi-VN\","," \"zh-Hans\","," \"zh-Hans-CN\","," \"zh-Hant\","," \"zh-Hant-HK\","," \"zh-Hant-TW\""," ]"," },"," \"datatype-date-math\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"datatype-date-parse\": {},"," \"datatype-number\": {"," \"use\": ["," \"datatype-number-parse\","," \"datatype-number-format\""," ]"," },"," \"datatype-number-format\": {},"," \"datatype-number-parse\": {},"," \"datatype-xml\": {"," \"use\": ["," \"datatype-xml-parse\","," \"datatype-xml-format\""," ]"," },"," \"datatype-xml-format\": {},"," \"datatype-xml-parse\": {},"," \"dd\": {"," \"use\": ["," \"dd-ddm-base\","," \"dd-ddm\","," \"dd-ddm-drop\","," \"dd-drag\","," \"dd-proxy\","," \"dd-constrain\","," \"dd-drop\","," \"dd-scroll\","," \"dd-delegate\""," ]"," },"," \"dd-constrain\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-ddm\": {"," \"requires\": ["," \"dd-ddm-base\","," \"event-resize\""," ]"," },"," \"dd-ddm-base\": {"," \"requires\": ["," \"node\","," \"base\","," \"yui-throttle\","," \"classnamemanager\""," ]"," },"," \"dd-ddm-drop\": {"," \"requires\": ["," \"dd-ddm\""," ]"," },"," \"dd-delegate\": {"," \"requires\": ["," \"dd-drag\","," \"dd-drop-plugin\","," \"event-mouseenter\""," ]"," },"," \"dd-drag\": {"," \"requires\": ["," \"dd-ddm-base\""," ]"," },"," \"dd-drop\": {"," \"requires\": ["," \"dd-drag\","," \"dd-ddm-drop\""," ]"," },"," \"dd-drop-plugin\": {"," \"requires\": ["," \"dd-drop\""," ]"," },"," \"dd-gestures\": {"," \"condition\": {"," \"name\": \"dd-gestures\","," \"test\": function(Y) {"," return ((Y.config.win && (\"ontouchstart\" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));","},"," \"trigger\": \"dd-drag\""," },"," \"requires\": ["," \"dd-drag\","," \"event-synthetic\","," \"event-gestures\""," ]"," },"," \"dd-plugin\": {"," \"optional\": ["," \"dd-constrain\","," \"dd-proxy\""," ],"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-proxy\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dd-scroll\": {"," \"requires\": ["," \"dd-drag\""," ]"," },"," \"dial\": {"," \"lang\": ["," \"en\","," \"es\""," ],"," \"requires\": ["," \"widget\","," \"dd-drag\","," \"substitute\","," \"event-mouseenter\","," \"event-move\","," \"event-key\","," \"transition\","," \"intl\""," ],"," \"skinnable\": true"," },"," \"dom\": {"," \"use\": ["," \"dom-base\","," \"dom-screen\","," \"dom-style\","," \"selector-native\","," \"selector\""," ]"," },"," \"dom-base\": {"," \"requires\": ["," \"dom-core\""," ]"," },"," \"dom-core\": {"," \"requires\": ["," \"oop\","," \"features\""," ]"," },"," \"dom-deprecated\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-screen\": {"," \"requires\": ["," \"dom-base\","," \"dom-style\""," ]"," },"," \"dom-style\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"dom-style-ie\": {"," \"condition\": {"," \"name\": \"dom-style-ie\","," \"test\": function (Y) {",""," var testFeature = Y.Features.test,"," addFeature = Y.Features.add,"," WINDOW = Y.config.win,"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," ret = false;",""," addFeature('style', 'computedStyle', {"," test: function() {"," return WINDOW && 'getComputedStyle' in WINDOW;"," }"," });",""," addFeature('style', 'opacity', {"," test: function() {"," return DOCUMENT && 'opacity' in DOCUMENT[DOCUMENT_ELEMENT].style;"," }"," });",""," ret = (!testFeature('style', 'opacity') &&"," !testFeature('style', 'computedStyle'));",""," return ret;","},"," \"trigger\": \"dom-style\""," },"," \"requires\": ["," \"dom-style\""," ]"," },"," \"dump\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"editor\": {"," \"use\": ["," \"frame\","," \"editor-selection\","," \"exec-command\","," \"editor-base\","," \"editor-para\","," \"editor-br\","," \"editor-bidi\","," \"editor-tab\","," \"createlink-base\""," ]"," },"," \"editor-base\": {"," \"requires\": ["," \"base\","," \"frame\","," \"node\","," \"exec-command\","," \"editor-selection\""," ]"," },"," \"editor-bidi\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-br\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-lists\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para\": {"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-para-base\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"editor-para-ie\": {"," \"condition\": {"," \"name\": \"editor-para-ie\","," \"trigger\": \"editor-para\","," \"ua\": \"ie\","," \"when\": \"instead\""," },"," \"requires\": ["," \"editor-para-base\""," ]"," },"," \"editor-selection\": {"," \"requires\": ["," \"node\""," ]"," },"," \"editor-tab\": {"," \"requires\": ["," \"editor-base\""," ]"," },"," \"escape\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"event\": {"," \"after\": ["," \"node-base\""," ],"," \"use\": ["," \"event-base\","," \"event-delegate\","," \"event-synthetic\","," \"event-mousewheel\","," \"event-mouseenter\","," \"event-key\","," \"event-focus\","," \"event-resize\","," \"event-hover\","," \"event-outside\","," \"event-touch\","," \"event-move\","," \"event-flick\","," \"event-valuechange\""," ]"," },"," \"event-base\": {"," \"after\": ["," \"node-base\""," ],"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-base-ie\": {"," \"after\": ["," \"event-base\""," ],"," \"condition\": {"," \"name\": \"event-base-ie\","," \"test\": function(Y) {"," var imp = Y.config.doc && Y.config.doc.implementation;"," return (imp && (!imp.hasFeature('Events', '2.0')));","},"," \"trigger\": \"node-base\""," },"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-contextmenu\": {"," \"requires\": ["," \"event-synthetic\","," \"dom-screen\""," ]"," },"," \"event-custom\": {"," \"use\": ["," \"event-custom-base\","," \"event-custom-complex\""," ]"," },"," \"event-custom-base\": {"," \"requires\": ["," \"oop\""," ]"," },"," \"event-custom-complex\": {"," \"requires\": ["," \"event-custom-base\""," ]"," },"," \"event-delegate\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-flick\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-focus\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-gestures\": {"," \"use\": ["," \"event-flick\","," \"event-move\""," ]"," },"," \"event-hover\": {"," \"requires\": ["," \"event-mouseenter\""," ]"," },"," \"event-key\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mouseenter\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-mousewheel\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-move\": {"," \"requires\": ["," \"node-base\","," \"event-touch\","," \"event-synthetic\""," ]"," },"," \"event-outside\": {"," \"requires\": ["," \"event-synthetic\""," ]"," },"," \"event-resize\": {"," \"requires\": ["," \"node-base\","," \"event-synthetic\""," ]"," },"," \"event-simulate\": {"," \"requires\": ["," \"event-base\""," ]"," },"," \"event-synthetic\": {"," \"requires\": ["," \"node-base\","," \"event-custom-complex\""," ]"," },"," \"event-touch\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"event-valuechange\": {"," \"requires\": ["," \"event-focus\","," \"event-synthetic\""," ]"," },"," \"exec-command\": {"," \"requires\": ["," \"frame\""," ]"," },"," \"features\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"file\": {"," \"requires\": ["," \"file-flash\","," \"file-html5\""," ]"," },"," \"file-flash\": {"," \"requires\": ["," \"base\""," ]"," },"," \"file-html5\": {"," \"requires\": ["," \"base\""," ]"," },"," \"frame\": {"," \"requires\": ["," \"base\","," \"node\","," \"selector-css3\","," \"substitute\","," \"yui-throttle\""," ]"," },"," \"gesture-simulate\": {"," \"requires\": ["," \"async-queue\","," \"event-simulate\","," \"node-screen\""," ]"," },"," \"get\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"graphics\": {"," \"requires\": ["," \"node\","," \"event-custom\","," \"pluginhost\","," \"matrix\","," \"classnamemanager\""," ]"," },"," \"graphics-canvas\": {"," \"condition\": {"," \"name\": \"graphics-canvas\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-canvas-default\": {"," \"condition\": {"," \"name\": \"graphics-canvas-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useCanvas = Y.config.defaultGraphicEngine && Y.config.defaultGraphicEngine == \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," return (!svg || useCanvas) && (canvas && canvas.getContext && canvas.getContext(\"2d\"));","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-svg\": {"," \"condition\": {"," \"name\": \"graphics-svg\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-svg-default\": {"," \"condition\": {"," \"name\": \"graphics-svg-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," useSVG = !Y.config.defaultGraphicEngine || Y.config.defaultGraphicEngine != \"canvas\","," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\"),"," svg = (DOCUMENT && DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\"));"," "," return svg && (useSVG || !canvas);","},"," \"trigger\": \"graphics\""," }"," },"," \"graphics-vml\": {"," \"condition\": {"," \"name\": \"graphics-vml\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," },"," \"requires\": ["," \"graphics\""," ]"," },"," \"graphics-vml-default\": {"," \"condition\": {"," \"name\": \"graphics-vml-default\","," \"test\": function(Y) {"," var DOCUMENT = Y.config.doc,"," canvas = DOCUMENT && DOCUMENT.createElement(\"canvas\");"," return (DOCUMENT && !DOCUMENT.implementation.hasFeature(\"http://www.w3.org/TR/SVG11/feature#BasicStructure\", \"1.1\") && (!canvas || !canvas.getContext || !canvas.getContext(\"2d\")));","},"," \"trigger\": \"graphics\""," }"," },"," \"handlebars\": {"," \"use\": ["," \"handlebars-compiler\""," ]"," },"," \"handlebars-base\": {"," \"requires\": ["," \"escape\""," ]"," },"," \"handlebars-compiler\": {"," \"requires\": ["," \"handlebars-base\""," ]"," },"," \"highlight\": {"," \"use\": ["," \"highlight-base\","," \"highlight-accentfold\""," ]"," },"," \"highlight-accentfold\": {"," \"requires\": ["," \"highlight-base\","," \"text-accentfold\""," ]"," },"," \"highlight-base\": {"," \"requires\": ["," \"array-extras\","," \"classnamemanager\","," \"escape\","," \"text-wordbreak\""," ]"," },"," \"history\": {"," \"use\": ["," \"history-base\","," \"history-hash\","," \"history-hash-ie\","," \"history-html5\""," ]"," },"," \"history-base\": {"," \"requires\": ["," \"event-custom-complex\""," ]"," },"," \"history-hash\": {"," \"after\": ["," \"history-html5\""," ],"," \"requires\": ["," \"event-synthetic\","," \"history-base\","," \"yui-later\""," ]"," },"," \"history-hash-ie\": {"," \"condition\": {"," \"name\": \"history-hash-ie\","," \"test\": function (Y) {"," var docMode = Y.config.doc && Y.config.doc.documentMode;",""," return Y.UA.ie && (!('onhashchange' in Y.config.win) ||"," !docMode || docMode < 8);","},"," \"trigger\": \"history-hash\""," },"," \"requires\": ["," \"history-hash\","," \"node-base\""," ]"," },"," \"history-html5\": {"," \"optional\": ["," \"json\""," ],"," \"requires\": ["," \"event-base\","," \"history-base\","," \"node-base\""," ]"," },"," \"imageloader\": {"," \"requires\": ["," \"base-base\","," \"node-style\","," \"node-screen\""," ]"," },"," \"intl\": {"," \"requires\": ["," \"intl-base\","," \"event-custom\""," ]"," },"," \"intl-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"io\": {"," \"use\": ["," \"io-base\","," \"io-xdr\","," \"io-form\","," \"io-upload-iframe\","," \"io-queue\""," ]"," },"," \"io-base\": {"," \"requires\": ["," \"event-custom-base\","," \"querystring-stringify-simple\""," ]"," },"," \"io-form\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-nodejs\": {"," \"condition\": {"," \"name\": \"io-nodejs\","," \"trigger\": \"io-base\","," \"ua\": \"nodejs\""," },"," \"requires\": ["," \"io-base\""," ]"," },"," \"io-queue\": {"," \"requires\": ["," \"io-base\","," \"queue-promote\""," ]"," },"," \"io-upload-iframe\": {"," \"requires\": ["," \"io-base\","," \"node-base\""," ]"," },"," \"io-xdr\": {"," \"requires\": ["," \"io-base\","," \"datatype-xml-parse\""," ]"," },"," \"json\": {"," \"use\": ["," \"json-parse\","," \"json-stringify\""," ]"," },"," \"json-parse\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"json-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"jsonp\": {"," \"requires\": ["," \"get\","," \"oop\""," ]"," },"," \"jsonp-url\": {"," \"requires\": ["," \"jsonp\""," ]"," },"," \"lazy-model-list\": {"," \"requires\": ["," \"model-list\""," ]"," },"," \"loader\": {"," \"use\": ["," \"loader-base\","," \"loader-rollup\","," \"loader-yui3\""," ]"," },"," \"loader-base\": {"," \"requires\": ["," \"get\","," \"features\""," ]"," },"," \"loader-rollup\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"loader-yui3\": {"," \"requires\": ["," \"loader-base\""," ]"," },"," \"matrix\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"model\": {"," \"requires\": ["," \"base-build\","," \"escape\","," \"json-parse\""," ]"," },"," \"model-list\": {"," \"requires\": ["," \"array-extras\","," \"array-invoke\","," \"arraylist\","," \"base-build\","," \"escape\","," \"json-parse\","," \"model\""," ]"," },"," \"model-sync-rest\": {"," \"requires\": ["," \"model\","," \"io-base\","," \"json-stringify\""," ]"," },"," \"node\": {"," \"use\": ["," \"node-base\","," \"node-event-delegate\","," \"node-pluginhost\","," \"node-screen\","," \"node-style\""," ]"," },"," \"node-base\": {"," \"requires\": ["," \"event-base\","," \"node-core\","," \"dom-base\""," ]"," },"," \"node-core\": {"," \"requires\": ["," \"dom-core\","," \"selector\""," ]"," },"," \"node-deprecated\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-delegate\": {"," \"requires\": ["," \"node-base\","," \"event-delegate\""," ]"," },"," \"node-event-html5\": {"," \"requires\": ["," \"node-base\""," ]"," },"," \"node-event-simulate\": {"," \"requires\": ["," \"node-base\","," \"event-simulate\","," \"gesture-simulate\""," ]"," },"," \"node-flick\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"event-flick\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"node-focusmanager\": {"," \"requires\": ["," \"attribute\","," \"node\","," \"plugin\","," \"node-event-simulate\","," \"event-key\","," \"event-focus\""," ]"," },"," \"node-load\": {"," \"requires\": ["," \"node-base\","," \"io-base\""," ]"," },"," \"node-menunav\": {"," \"requires\": ["," \"node\","," \"classnamemanager\","," \"plugin\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"node-pluginhost\": {"," \"requires\": ["," \"node-base\","," \"pluginhost\""," ]"," },"," \"node-screen\": {"," \"requires\": ["," \"dom-screen\","," \"node-base\""," ]"," },"," \"node-style\": {"," \"requires\": ["," \"dom-style\","," \"node-base\""," ]"," },"," \"oop\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"overlay\": {"," \"requires\": ["," \"widget\","," \"widget-stdmod\","," \"widget-position\","," \"widget-position-align\","," \"widget-stack\","," \"widget-position-constrain\""," ],"," \"skinnable\": true"," },"," \"panel\": {"," \"requires\": ["," \"widget\","," \"widget-autohide\","," \"widget-buttons\","," \"widget-modality\","," \"widget-position\","," \"widget-position-align\","," \"widget-position-constrain\","," \"widget-stack\","," \"widget-stdmod\""," ],"," \"skinnable\": true"," },"," \"parallel\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pjax\": {"," \"requires\": ["," \"pjax-base\","," \"pjax-content\""," ]"," },"," \"pjax-base\": {"," \"requires\": ["," \"classnamemanager\","," \"node-event-delegate\","," \"router\""," ]"," },"," \"pjax-content\": {"," \"requires\": ["," \"io-base\","," \"node-base\","," \"router\""," ]"," },"," \"pjax-plugin\": {"," \"requires\": ["," \"node-pluginhost\","," \"pjax\","," \"plugin\""," ]"," },"," \"plugin\": {"," \"requires\": ["," \"base-base\""," ]"," },"," \"pluginhost\": {"," \"use\": ["," \"pluginhost-base\","," \"pluginhost-config\""," ]"," },"," \"pluginhost-base\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"pluginhost-config\": {"," \"requires\": ["," \"pluginhost-base\""," ]"," },"," \"profiler\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring\": {"," \"use\": ["," \"querystring-parse\","," \"querystring-stringify\""," ]"," },"," \"querystring-parse\": {"," \"requires\": ["," \"yui-base\","," \"array-extras\""," ]"," },"," \"querystring-parse-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"querystring-stringify-simple\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"queue-promote\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"range-slider\": {"," \"requires\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\""," ]"," },"," \"recordset\": {"," \"use\": ["," \"recordset-base\","," \"recordset-sort\","," \"recordset-filter\","," \"recordset-indexer\""," ]"," },"," \"recordset-base\": {"," \"requires\": ["," \"base\","," \"arraylist\""," ]"," },"," \"recordset-filter\": {"," \"requires\": ["," \"recordset-base\","," \"array-extras\","," \"plugin\""," ]"," },"," \"recordset-indexer\": {"," \"requires\": ["," \"recordset-base\","," \"plugin\""," ]"," },"," \"recordset-sort\": {"," \"requires\": ["," \"arraysort\","," \"recordset-base\","," \"plugin\""," ]"," },"," \"resize\": {"," \"use\": ["," \"resize-base\","," \"resize-proxy\","," \"resize-constrain\""," ]"," },"," \"resize-base\": {"," \"requires\": ["," \"base\","," \"widget\","," \"substitute\","," \"event\","," \"oop\","," \"dd-drag\","," \"dd-delegate\","," \"dd-drop\""," ],"," \"skinnable\": true"," },"," \"resize-constrain\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"resize-plugin\": {"," \"optional\": ["," \"resize-constrain\""," ],"," \"requires\": ["," \"resize-base\","," \"plugin\""," ]"," },"," \"resize-proxy\": {"," \"requires\": ["," \"plugin\","," \"resize-base\""," ]"," },"," \"router\": {"," \"optional\": ["," \"querystring-parse\""," ],"," \"requires\": ["," \"array-extras\","," \"base-build\","," \"history\""," ]"," },"," \"scrollview\": {"," \"requires\": ["," \"scrollview-base\","," \"scrollview-scrollbars\""," ]"," },"," \"scrollview-base\": {"," \"requires\": ["," \"widget\","," \"event-gestures\","," \"event-mousewheel\","," \"transition\""," ],"," \"skinnable\": true"," },"," \"scrollview-base-ie\": {"," \"condition\": {"," \"name\": \"scrollview-base-ie\","," \"trigger\": \"scrollview-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"scrollview-base\""," ]"," },"," \"scrollview-list\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ],"," \"skinnable\": true"," },"," \"scrollview-paginator\": {"," \"requires\": ["," \"plugin\","," \"classnamemanager\""," ]"," },"," \"scrollview-scrollbars\": {"," \"requires\": ["," \"classnamemanager\","," \"transition\","," \"plugin\""," ],"," \"skinnable\": true"," },"," \"selector\": {"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css2\": {"," \"condition\": {"," \"name\": \"selector-css2\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," ret = DOCUMENT && !('querySelectorAll' in DOCUMENT);",""," return ret;","},"," \"trigger\": \"selector\""," },"," \"requires\": ["," \"selector-native\""," ]"," },"," \"selector-css3\": {"," \"requires\": ["," \"selector-native\","," \"selector-css2\""," ]"," },"," \"selector-native\": {"," \"requires\": ["," \"dom-base\""," ]"," },"," \"shim-plugin\": {"," \"requires\": ["," \"node-style\","," \"node-pluginhost\""," ]"," },"," \"slider\": {"," \"use\": ["," \"slider-base\","," \"slider-value-range\","," \"clickable-rail\","," \"range-slider\""," ]"," },"," \"slider-base\": {"," \"requires\": ["," \"widget\","," \"dd-constrain\","," \"substitute\","," \"event-key\""," ],"," \"skinnable\": true"," },"," \"slider-value-range\": {"," \"requires\": ["," \"slider-base\""," ]"," },"," \"sortable\": {"," \"requires\": ["," \"dd-delegate\","," \"dd-drop-plugin\","," \"dd-proxy\""," ]"," },"," \"sortable-scroll\": {"," \"requires\": ["," \"dd-scroll\","," \"sortable\""," ]"," },"," \"stylesheet\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"substitute\": {"," \"optional\": ["," \"dump\""," ],"," \"requires\": ["," \"yui-base\""," ]"," },"," \"swf\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"swfdetect\","," \"escape\""," ]"," },"," \"swfdetect\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"tabview\": {"," \"requires\": ["," \"widget\","," \"widget-parent\","," \"widget-child\","," \"tabview-base\","," \"node-pluginhost\","," \"node-focusmanager\""," ],"," \"skinnable\": true"," },"," \"tabview-base\": {"," \"requires\": ["," \"node-event-delegate\","," \"classnamemanager\","," \"skin-sam-tabview\""," ]"," },"," \"tabview-plugin\": {"," \"requires\": ["," \"tabview-base\""," ]"," },"," \"test\": {"," \"requires\": ["," \"event-simulate\","," \"event-custom\","," \"substitute\","," \"json-stringify\""," ],"," \"skinnable\": true"," },"," \"test-console\": {"," \"requires\": ["," \"console-filters\","," \"test\""," ],"," \"skinnable\": true"," },"," \"text\": {"," \"use\": ["," \"text-accentfold\","," \"text-wordbreak\""," ]"," },"," \"text-accentfold\": {"," \"requires\": ["," \"array-extras\","," \"text-data-accentfold\""," ]"," },"," \"text-data-accentfold\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-data-wordbreak\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"text-wordbreak\": {"," \"requires\": ["," \"array-extras\","," \"text-data-wordbreak\""," ]"," },"," \"transition\": {"," \"requires\": ["," \"node-style\""," ]"," },"," \"transition-timer\": {"," \"condition\": {"," \"name\": \"transition-timer\","," \"test\": function (Y) {"," var DOCUMENT = Y.config.doc,"," node = (DOCUMENT) ? DOCUMENT.documentElement: null,"," ret = true;",""," if (node && node.style) {"," ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);"," } ",""," return ret;","},"," \"trigger\": \"transition\""," },"," \"requires\": ["," \"transition\""," ]"," },"," \"uploader\": {"," \"requires\": ["," \"uploader-html5\","," \"uploader-flash\""," ]"," },"," \"uploader-deprecated\": {"," \"requires\": ["," \"event-custom\","," \"node\","," \"base\","," \"swf\""," ]"," },"," \"uploader-flash\": {"," \"requires\": ["," \"swf\","," \"widget\","," \"substitute\","," \"base\","," \"cssbutton\","," \"node\","," \"event-custom\","," \"file-flash\","," \"uploader-queue\""," ]"," },"," \"uploader-html5\": {"," \"requires\": ["," \"widget\","," \"node-event-simulate\","," \"substitute\","," \"file-html5\","," \"uploader-queue\""," ]"," },"," \"uploader-queue\": {"," \"requires\": ["," \"base\""," ]"," },"," \"view\": {"," \"requires\": ["," \"base-build\","," \"node-event-delegate\""," ]"," },"," \"view-node-map\": {"," \"requires\": ["," \"view\""," ]"," },"," \"widget\": {"," \"use\": ["," \"widget-base\","," \"widget-htmlparser\","," \"widget-skin\","," \"widget-uievents\""," ]"," },"," \"widget-anim\": {"," \"requires\": ["," \"anim-base\","," \"plugin\","," \"widget\""," ]"," },"," \"widget-autohide\": {"," \"requires\": ["," \"base-build\","," \"event-key\","," \"event-outside\","," \"widget\""," ]"," },"," \"widget-base\": {"," \"requires\": ["," \"attribute\","," \"base-base\","," \"base-pluginhost\","," \"classnamemanager\","," \"event-focus\","," \"node-base\","," \"node-style\""," ],"," \"skinnable\": true"," },"," \"widget-base-ie\": {"," \"condition\": {"," \"name\": \"widget-base-ie\","," \"trigger\": \"widget-base\","," \"ua\": \"ie\""," },"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-buttons\": {"," \"requires\": ["," \"button-plugin\","," \"cssbutton\","," \"widget-stdmod\""," ]"," },"," \"widget-child\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-htmlparser\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-locale\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-modality\": {"," \"requires\": ["," \"base-build\","," \"event-outside\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-parent\": {"," \"requires\": ["," \"arraylist\","," \"base-build\","," \"widget\""," ]"," },"," \"widget-position\": {"," \"requires\": ["," \"base-build\","," \"node-screen\","," \"widget\""," ]"," },"," \"widget-position-align\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-position-constrain\": {"," \"requires\": ["," \"widget-position\""," ]"," },"," \"widget-skin\": {"," \"requires\": ["," \"widget-base\""," ]"," },"," \"widget-stack\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ],"," \"skinnable\": true"," },"," \"widget-stdmod\": {"," \"requires\": ["," \"base-build\","," \"widget\""," ]"," },"," \"widget-uievents\": {"," \"requires\": ["," \"node-event-delegate\","," \"widget-base\""," ]"," },"," \"yql\": {"," \"requires\": ["," \"jsonp\","," \"jsonp-url\""," ]"," },"," \"yui\": {},"," \"yui-base\": {},"," \"yui-later\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-log\": {"," \"requires\": ["," \"yui-base\""," ]"," },"," \"yui-throttle\": {"," \"requires\": ["," \"yui-base\""," ]"," }","};","YUI.Env[Y.version].md5 = '2631b5fb2c08064b4e8385f1142513e5';","","","}, '3.7.3' ,{requires:['loader-base']});","","","YUI.add('loader', function(Y){}, '3.7.3' ,{use:['loader-base', 'loader-rollup', 'loader-yui3' ]});",""]; _yuitest_coverage["/build/loader/loader.js"].lines = {"1":0,"9":0,"11":0,"12":0,"39":0,"45":0,"46":0,"47":0,"50":0,"54":0,"55":0,"56":0,"60":0,"62":0,"72":0,"80":0,"81":0,"82":0,"85":0,"93":0,"94":0,"96":0,"116":0,"138":0,"139":0,"140":0,"142":0,"144":0,"148":0,"149":0,"159":0,"207":0,"209":0,"212":0,"214":0,"268":0,"311":0,"319":0,"334":0,"343":0,"355":0,"362":0,"371":0,"380":0,"398":0,"406":0,"441":0,"448":0,"461":0,"468":0,"470":0,"500":0,"506":0,"511":0,"512":0,"514":0,"524":0,"532":0,"534":0,"536":0,"538":0,"540":0,"542":0,"544":0,"545":0,"570":0,"586":0,"593":0,"600":0,"604":0,"613":0,"615":0,"620":0,"628":0,"633":0,"634":0,"635":0,"636":0,"640":0,"641":0,"642":0,"643":0,"648":0,"649":0,"650":0,"662":0,"663":0,"664":0,"665":0,"669":0,"670":0,"671":0,"672":0,"673":0,"676":0,"677":0,"678":0,"679":0,"680":0,"685":0,"686":0,"687":0,"688":0,"732":0,"735":0,"736":0,"737":0,"738":0,"739":0,"740":0,"745":0,"746":0,"747":0,"748":0,"749":0,"750":0,"751":0,"753":0,"754":0,"756":0,"759":0,"761":0,"775":0,"780":0,"781":0,"784":0,"785":0,"789":0,"790":0,"793":0,"796":0,"797":0,"801":0,"802":0,"803":0,"804":0,"805":0,"810":0,"811":0,"812":0,"813":0,"814":0,"821":0,"822":0,"826":0,"827":0,"830":0,"839":0,"841":0,"842":0,"843":0,"844":0,"845":0,"846":0,"847":0,"849":0,"850":0,"851":0,"856":0,"857":0,"858":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"865":0,"866":0,"873":0,"875":0,"876":0,"877":0,"880":0,"881":0,"882":0,"883":0,"886":0,"887":0,"888":0,"889":0,"891":0,"898":0,"900":0,"901":0,"902":0,"903":0,"904":0,"905":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"915":0,"917":0,"920":0,"921":0,"922":0,"924":0,"925":0,"930":0,"948":0,"949":0,"950":0,"953":0,"967":0,"973":0,"974":0,"975":0,"976":0,"977":0,"978":0,"988":0,"989":0,"991":0,"992":0,"994":0,"999":0,"1015":0,"1016":0,"1045":0,"1048":0,"1049":0,"1050":0,"1052":0,"1053":0,"1054":0,"1055":0,"1056":0,"1061":0,"1062":0,"1063":0,"1064":0,"1065":0,"1066":0,"1068":0,"1069":0,"1106":0,"1108":0,"1109":0,"1116":0,"1122":0,"1125":0,"1127":0,"1128":0,"1131":0,"1133":0,"1134":0,"1135":0,"1136":0,"1140":0,"1141":0,"1143":0,"1145":0,"1148":0,"1154":0,"1156":0,"1163":0,"1164":0,"1165":0,"1168":0,"1169":0,"1170":0,"1171":0,"1172":0,"1178":0,"1179":0,"1186":0,"1187":0,"1188":0,"1191":0,"1192":0,"1195":0,"1196":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1208":0,"1209":0,"1210":0,"1212":0,"1213":0,"1214":0,"1216":0,"1217":0,"1218":0,"1220":0,"1221":0,"1224":0,"1225":0,"1227":0,"1228":0,"1229":0,"1230":0,"1231":0,"1232":0,"1234":0,"1237":0,"1239":0,"1245":0,"1247":0,"1248":0,"1249":0,"1250":0,"1251":0,"1252":0,"1254":0,"1255":0,"1258":0,"1260":0,"1261":0,"1264":0,"1266":0,"1268":0,"1269":0,"1275":0,"1276":0,"1278":0,"1280":0,"1281":0,"1284":0,"1285":0,"1293":0,"1297":0,"1298":0,"1299":0,"1303":0,"1304":0,"1305":0,"1306":0,"1307":0,"1308":0,"1309":0,"1310":0,"1311":0,"1312":0,"1313":0,"1314":0,"1321":0,"1322":0,"1323":0,"1324":0,"1326":0,"1327":0,"1330":0,"1331":0,"1332":0,"1333":0,"1334":0,"1337":0,"1338":0,"1339":0,"1340":0,"1347":0,"1348":0,"1353":0,"1354":0,"1357":0,"1358":0,"1359":0,"1364":0,"1365":0,"1366":0,"1367":0,"1368":0,"1369":0,"1373":0,"1374":0,"1375":0,"1377":0,"1378":0,"1381":0,"1390":0,"1391":0,"1392":0,"1394":0,"1406":0,"1409":0,"1410":0,"1411":0,"1412":0,"1413":0,"1414":0,"1415":0,"1416":0,"1417":0,"1418":0,"1419":0,"1420":0,"1423":0,"1429":0,"1440":0,"1441":0,"1442":0,"1444":0,"1445":0,"1447":0,"1448":0,"1449":0,"1450":0,"1452":0,"1453":0,"1454":0,"1456":0,"1460":0,"1463":0,"1465":0,"1476":0,"1478":0,"1481":0,"1483":0,"1488":0,"1502":0,"1503":0,"1504":0,"1505":0,"1506":0,"1507":0,"1513":0,"1515":0,"1516":0,"1520":0,"1521":0,"1522":0,"1523":0,"1525":0,"1526":0,"1527":0,"1529":0,"1532":0,"1533":0,"1534":0,"1536":0,"1537":0,"1538":0,"1539":0,"1540":0,"1541":0,"1542":0,"1543":0,"1545":0,"1546":0,"1553":0,"1554":0,"1555":0,"1556":0,"1561":0,"1562":0,"1565":0,"1566":0,"1568":0,"1569":0,"1570":0,"1572":0,"1573":0,"1580":0,"1581":0,"1582":0,"1583":0,"1584":0,"1585":0,"1586":0,"1587":0,"1588":0,"1590":0,"1591":0,"1598":0,"1600":0,"1602":0,"1603":0,"1604":0,"1605":0,"1606":0,"1607":0,"1608":0,"1609":0,"1614":0,"1615":0,"1616":0,"1617":0,"1621":0,"1624":0,"1625":0,"1626":0,"1627":0,"1628":0,"1629":0,"1630":0,"1631":0,"1643":0,"1644":0,"1645":0,"1646":0,"1647":0,"1648":0,"1652":0,"1653":0,"1654":0,"1655":0,"1657":0,"1658":0,"1659":0,"1660":0,"1664":0,"1665":0,"1666":0,"1671":0,"1673":0,"1675":0,"1676":0,"1677":0,"1678":0,"1679":0,"1682":0,"1685":0,"1687":0,"1689":0,"1699":0,"1700":0,"1702":0,"1708":0,"1709":0,"1713":0,"1715":0,"1716":0,"1719":0,"1720":0,"1724":0,"1726":0,"1728":0,"1738":0,"1741":0,"1742":0,"1745":0,"1746":0,"1747":0,"1749":0,"1750":0,"1751":0,"1755":0,"1756":0,"1760":0,"1771":0,"1773":0,"1774":0,"1777":0,"1778":0,"1781":0,"1783":0,"1784":0,"1786":0,"1788":0,"1789":0,"1802":0,"1806":0,"1808":0,"1810":0,"1818":0,"1819":0,"1821":0,"1822":0,"1825":0,"1826":0,"1829":0,"1831":0,"1832":0,"1833":0,"1834":0,"1838":0,"1849":0,"1852":0,"1853":0,"1854":0,"1855":0,"1859":0,"1863":0,"1866":0,"1867":0,"1876":0,"1879":0,"1880":0,"1884":0,"1885":0,"1889":0,"1890":0,"1891":0,"1896":0,"1897":0,"1898":0,"1899":0,"1904":0,"1906":0,"1917":0,"1928":0,"1932":0,"1934":0,"1935":0,"1937":0,"1938":0,"1939":0,"1940":0,"1941":0,"1942":0,"1943":0,"1945":0,"1946":0,"1947":0,"1948":0,"1951":0,"1952":0,"1967":0,"1977":0,"1978":0,"1981":0,"1987":0,"1988":0,"1989":0,"1990":0,"1994":0,"1995":0,"1998":0,"2001":0,"2002":0,"2008":0,"2009":0,"2010":0,"2011":0,"2014":0,"2015":0,"2016":0,"2018":0,"2022":0,"2023":0,"2024":0,"2028":0,"2043":0,"2045":0,"2048":0,"2049":0,"2050":0,"2052":0,"2055":0,"2057":0,"2058":0,"2061":0,"2062":0,"2063":0,"2064":0,"2065":0,"2072":0,"2083":0,"2085":0,"2086":0,"2087":0,"2093":0,"2101":0,"2105":0,"2106":0,"2107":0,"2111":0,"2113":0,"2114":0,"2115":0,"2116":0,"2117":0,"2119":0,"2124":0,"2125":0,"2126":0,"2127":0,"2128":0,"2136":0,"2144":0,"2145":0,"2146":0,"2158":0,"2160":0,"2161":0,"2164":0,"2167":0,"2168":0,"2175":0,"2185":0,"2186":0,"2187":0,"2203":0,"2210":0,"2212":0,"2213":0,"2216":0,"2220":0,"2224":0,"2225":0,"2227":0,"2230":0,"2234":0,"2238":0,"2241":0,"2243":0,"2248":0,"2249":0,"2252":0,"2258":0,"2259":0,"2264":0,"2280":0,"2281":0,"2287":0,"2291":0,"2294":0,"2296":0,"2298":0,"2299":0,"2301":0,"2302":0,"2307":0,"2308":0,"2309":0,"2311":0,"2312":0,"2313":0,"2314":0,"2316":0,"2318":0,"2322":0,"2323":0,"2324":0,"2328":0,"2329":0,"2330":0,"2331":0,"2332":0,"2333":0,"2338":0,"2340":0,"2341":0,"2342":0,"2345":0,"2349":0,"2350":0,"2358":0,"2361":0,"2364":0,"2365":0,"2366":0,"2369":0,"2370":0,"2371":0,"2376":0,"2377":0,"2387":0,"2390":0,"2393":0,"2394":0,"2395":0,"2398":0,"2399":0,"2400":0,"2411":0,"2412":0,"2413":0,"2426":0,"2427":0,"2428":0,"2429":0,"2430":0,"2432":0,"2447":0,"2460":0,"2465":0,"2466":0,"2467":0,"2470":0,"2471":0,"2472":0,"2474":0,"2475":0,"2478":0,"2491":0,"2514":0,"2522":0,"2523":0,"2526":0,"2527":0,"2529":0,"2531":0,"2533":0,"2534":0,"2537":0,"2538":0,"2541":0,"2544":0,"2545":0,"2549":0,"2550":0,"2553":0,"2554":0,"2560":0,"2563":0,"2565":0,"2567":0,"2569":0,"2570":0,"2571":0,"2572":0,"2573":0,"2574":0,"2576":0,"2579":0,"2580":0,"2582":0,"2583":0,"2584":0,"2587":0,"2588":0,"2590":0,"2591":0,"2593":0,"2596":0,"2597":0,"2601":0,"2602":0,"2605":0,"2606":0,"2607":0,"2608":0,"2609":0,"2610":0,"2612":0,"2613":0,"2614":0,"2615":0,"2617":0,"2620":0,"2621":0,"2622":0,"2623":0,"2624":0,"2625":0,"2626":0,"2627":0,"2630":0,"2632":0,"2642":0,"2643":0,"2644":0,"2645":0,"2646":0,"2647":0,"2648":0,"2649":0,"2650":0,"2651":0,"2652":0,"2653":0,"2654":0,"2657":0,"2658":0,"2659":0,"2660":0,"2661":0,"2662":0,"2664":0,"2665":0,"2666":0,"2667":0,"2668":0,"2669":0,"2670":0,"2674":0,"2675":0,"2676":0,"2679":0,"2682":0,"2687":0,"2689":0,"2712":0,"2713":0,"2715":0,"2718":0,"2720":0,"2721":0,"2724":0,"2731":0,"2750":0,"2751":0,"2755":0,"2756":0,"2757":0,"2758":0,"2759":0,"2761":0,"2762":0,"2769":0,"2770":0,"2773":0,"2774":0,"2776":0,"2777":0,"2778":0,"2779":0,"2782":0,"2783":0,"2786":0,"2789":0,"2790":0,"2794":0,"2795":0,"2796":0,"2800":0,"2801":0,"2802":0,"2803":0,"2804":0,"2809":0,"2811":0,"2812":0,"2815":0,"2822":0,"2823":0,"2830":0,"2839":0,"2942":0,"2945":0,"2946":0,"2949":0,"3107":0,"3836":0,"3923":0,"3930":0,"3932":0,"3936":0,"3938":0,"3942":0,"3945":0,"4067":0,"4068":0,"4241":0,"4245":0,"4257":0,"4261":0,"4270":0,"4275":0,"4287":0,"4292":0,"4301":0,"4303":0,"4315":0,"4317":0,"4384":0,"4386":0,"4922":0,"4925":0,"5087":0,"5091":0,"5092":0,"5095":0,"5303":0,"5309":0}; _yuitest_coverage["/build/loader/loader.js"].functions = {"yui2Update:37":0,"galleryUpdate:49":0,"configFn:79":0,"(anonymous 2):11":0,"_path:137":0,"Loader:207":0,"_populateCache:627":0,"_resetModules:661":0,"_inspectPage:731":0,"_requires:773":0,"(anonymous 3):921":0,"_config:838":0,"formatSkin:947":0,"_addSkin:966":0,"addAlias:1014":0,"addGroup:1044":0,"addModule:1105":0,"require:1389":0,"_explodeRollups:1405":0,"filterRequires:1439":0,"(anonymous 4):1604":0,"getRequires:1474":0,"isCSSLoaded:1697":0,"(anonymous 5):1750":0,"getProvides:1737":0,"calculate:1770":0,"_addLangPack:1801":0,"_setup:1848":0,"getLangPackName:1916":0,"_explode:1926":0,"_patternTest:1966":0,"getModule:1975":0,"_reduce:2041":0,"_finish:2081":0,"_onSuccess:2100":0,"_onProgress:2143":0,"_onFailure:2157":0,"_onTimeout:2184":0,"_sort:2200":0,"complete:2307":0,"onProgress:2357":0,"onTimeout:2360":0,"onSuccess:2363":0,"onFailure:2368":0,"onProgress:2386":0,"onTimeout:2389":0,"onSuccess:2392":0,"onFailure:2397":0,"_insert:2276":0,"_continue:2410":0,"(anonymous 6):2429":0,"insert:2425":0,"loadNext:2446":0,"_filter:2459":0,"_url:2490":0,"addSingle:2531":0,"resolve:2512":0,"onEnd:2720":0,"load:2711":0,"(anonymous 1):1":0,"_rollup:2750":0,"(anonymous 7):2731":0,"\"test\":2941":0,"\"test\":3095":0,"\"test\":3835":0,"test:3931":0,"test:3937":0,"\"test\":3921":0,"\"test\":4066":0,"\"test\":4240":0,"\"test\":4256":0,"\"test\":4269":0,"\"test\":4286":0,"\"test\":4300":0,"\"test\":4314":0,"\"test\":4383":0,"\"test\":4921":0,"\"test\":5086":0,"(anonymous 8):2830":0}; _yuitest_coverage["/build/loader/loader.js"].coveredLines = 964;@@ -3714,7 +3714,7 @@ -}, '3.7.2' ,{requires:['get', 'features']});+}, '3.7.3' ,{requires:['get', 'features']}); _yuitest_coverline("/build/loader/loader.js", 2731); YUI.add('loader-rollup', function(Y) { @@ -3852,7 +3852,7 @@ }; -}, '3.7.2' ,{requires:['loader-base']});+}, '3.7.3' ,{requires:['loader-base']}); _yuitest_coverline("/build/loader/loader.js", 2830); YUI.add('loader-yui3', function(Y) { @@ -6384,9 +6384,9 @@ YUI.Env[Y.version].md5 = '2631b5fb2c08064b4e8385f1142513e5'; -}, '3.7.2' ,{requires:['loader-base']});+}, '3.7.3' ,{requires:['loader-base']}); _yuitest_coverline("/build/loader/loader.js", 5309);-YUI.add('loader', function(Y){}, '3.7.2' ,{use:['loader-base', 'loader-rollup', 'loader-yui3' ]});+YUI.add('loader', function(Y){}, '3.7.3' ,{use:['loader-base', 'loader-rollup', 'loader-yui3' ]});
bundle/loader/loader-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -41,7 +41,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -104,7 +104,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -132,14 +132,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -182,7 +181,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -213,7 +212,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -339,7 +338,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -491,7 +490,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -529,7 +528,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -543,14 +542,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -662,15 +661,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -707,7 +708,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -758,7 +759,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -824,13 +825,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -843,15 +844,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -861,7 +864,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { // Y.log('group: ' + j);@@ -878,7 +881,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -891,9 +894,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -909,16 +912,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -933,14 +935,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -1117,7 +1112,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -1140,7 +1141,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { Y.log('Auto determined module type as CSS', 'warn', 'loader'); o.type = CSS;@@ -1155,16 +1156,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -1197,13 +1194,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1254,7 +1251,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1265,7 +1262,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -1273,7 +1270,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -1305,8 +1302,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -1346,15 +1343,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -1368,7 +1365,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -1400,15 +1397,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -1501,7 +1498,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -1521,7 +1518,7 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); @@ -1529,8 +1526,8 @@ //Y.log('Already expanded ' + name + ', ' + mod.expanded); return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -1620,7 +1617,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -1700,7 +1697,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -1723,7 +1720,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { //Y.log('isCSSLoaded was cached for ' + name, 'warn', 'loader'); return mod;@@ -1768,7 +1765,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -1876,8 +1873,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -1903,7 +1900,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -1947,30 +1944,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -2012,7 +2009,7 @@ if (patterns.hasOwnProperty(pname)) { // Y.log('testing pattern ' + i); p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -2070,7 +2067,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -2078,7 +2075,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -2130,7 +2127,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -2138,11 +2135,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -2191,7 +2188,7 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); }@@ -2199,7 +2196,7 @@ msg = msg.join(','); Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');- + if (f) { f.call(this.context, { msg: msg,@@ -2207,7 +2204,7 @@ success: false }); }- + this._finish(msg, false); },@@ -2322,13 +2319,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -2348,7 +2342,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -2363,7 +2357,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -2430,8 +2424,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.log('Loading CSS modules', 'info', 'loader'); Y.Get.css(modules.css, {@@ -2533,7 +2527,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { Y.log('loadNext was called..', 'error', 'loader'); return; },@@ -2602,15 +2596,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -2619,11 +2613,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -2631,7 +2625,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -2646,7 +2640,7 @@ } else { Y.log('Undefined Module', 'warn', 'loader'); }- + }; len = s.length;@@ -2667,7 +2661,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2684,7 +2677,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2700,7 +2692,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -2720,7 +2712,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -2747,7 +2738,7 @@ Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader'); maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');@@ -2810,7 +2801,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -2823,7 +2814,7 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /**@@ -2893,7 +2884,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; // Y.log("adding to thresh: " + c + ", " + s[j]); roll = (c >= m.rollup);@@ -2925,7 +2916,7 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by src/loader/scripts/meta_join.js */@@ -3048,7 +3039,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -3612,6 +3603,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -3936,10 +3928,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -5159,7 +5149,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -5205,8 +5196,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5398,6 +5389,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -5416,8 +5423,8 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});-YUI.add('loader', function (Y, NAME) {}, '3.7.2', {"use": ["loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"requires": ["loader-base"]});+YUI.add('loader', function (Y, NAME) {}, '3.7.3', {"use": ["loader-base", "loader-rollup", "loader-yui3"]});
bundle/loader/loader-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.09.19-20-07",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S,x=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){var r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null;s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!=r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type==u&&!f.ext&&f.type==u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n=="require")f.require(i);else if(n=="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n=="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n=="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n=="gallery"?this.groups.gallery.update(i,t):n=="yui2"||n=="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o=="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName=="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){var l=[];for(n=0;n<f.coverage.length;n++){var c=f.coverage[n];f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c)}f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}f.lang},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t}),this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;if(!t.type){t.type=a;var r=t.path||t.fullpath;r&&this.REGEX_CSS.test(r)&&(t.type=u)}!t.path&&!t.fullpath&&(t.path=x(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0;var i=t.submodules,o,f,l,c,p,d,m,g,y,b,w,E,S,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(o=0;o<this.requires.length;o++)t.requires.push(this.requires[o]);if(t.group&&this.groups&&this.groups[t.group]){O=this.groups[t.group];if(O.requires)for(o=0;o<O.requires.length;o++)t.requires.push(O.requires[o])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(L=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(L)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){b=v(t.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w))}if(i){c=t.supersedes||[],f=0;for(o in i)if(i.hasOwnProperty(o)){p=i[o],p.path=p.path||x(n,o,t.type),p.pkg=n,p.group=t.group,p.supersedes&&(c=c.concat(p.supersedes)),d=this.addModule(p,o),c.push(o);if(d.skinnable){t.skinnable=!0,k=this.skin.overrides;if(k&&k[o])for(y=0;y<k[o].length;y++)L=this._addSkin(k[o][y],o,n),c.push(L);L=this._addSkin(this.skin.defaultSkin,o,n),c.push(L)}if(p.lang&&p.lang.length){b=v(p.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),E=this.getLangPackName(N,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),S=S||v.hash(d.supersedes),E in S||d.supersedes.push(E),t.lang=t.lang||[],T=T||v.hash(t.lang),N in T||t.lang.push(N),w=this.getLangPackName(h,n),E=this.getLangPackName(h,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),E in S||d.supersedes.push(E)}f++}t.supersedes=v.dedupe(c),this.allowRollup&&(t.rollup=f<4?f:Math.min(f-1,4))}m=t.plugins;if(m)for(o in m)m.hasOwnProperty(o)&&(g=m[o],g.pkg=n,g.path=g.path||x(n,o,t.type),g.requires=g.requires||[],g.group=t.group,this.addModule(g,o),t.skinnable&&this._addSkin(this.skin.defaultSkin,o,n));if(t.condition){l=t.condition.trigger,YUI.Env.aliases[l]&&(l=YUI.Env.aliases[l]),e.Lang.isArray(l)||(l=[l]);for(o=0;o<l.length;o++)_=l[o],A=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,A&&A!="after"?A=="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(C=t.configFn(t),C===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A,O,M=t.lang||t.intl,_=this.moduleInfo,D=e.Features&&e.Features.tests.load,P,H;t.temp&&g&&(N=t,t=this.addModule(g,c),t.group=N.group,t.pkg=N.pkg,delete t.expanded),H=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!H)return t.expanded;y=[],P={},T=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),T.unshift("intl"),M=!0),C=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<T.length;n++)if(!P[T[n]]){y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}T=this.filterRequires(t.supersedes);if(T)for(n=0;n<T.length;n++)if(!P[T[n]]){t.submodules&&y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(C&&this.loadOptional)for(n=0;n<C.length;n++)if(!P[C[n]]){y.push(C[n]),P[C[n]]=!0,i=_[C[n]];if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&D)d(l,function(e,t){var n=D[t].name;!P[n]&&D[t].trigger==c&&e&&D[t]&&(P[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!P[n]){x=m[n],S=x&&(!x.ua&&!x.test||x.ua&&e.UA[x.ua]||x.test&&x.test(e,T));if(S){P[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){L=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(A=n);if(L&&(L[c]||A&&L[A])){O=c,L[A]&&(O=A);for(n=0;n<L[O].length;n++)k=this._addSkin(L[O][n],c),this.isCSSLoaded(k,this._boot)||y.push(k)}else k=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(k,this._boot)||y.push(k)}return t._parsed=!1,M&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=x(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)if(t.hasOwnProperty(o)&&!i[o]){i[o]=!0,n=s.getModule(o);if(n){var u=n.expound;u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r))}}},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!=s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!=a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t),!i;var s=this.resolve(!i),o=this,f=0,l=0,c={},h;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++;var p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}};this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(e){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S,x,T,N=[],C,k,A={},O=this,M,_,D=[],P=O.ignoreRegistered?{}:O.inserted,H={js:[],jsMods:[],css:[],cssMods:[]},B=O.loadType||"js";(O.skin.overrides||O.skin.defaultSkin!==l||O.ignoreRegistered)&&O._resetModules(),e&&O.calculate(),t=t||O.sorted;var j=function(e){if(e){d=e.group&&O.groups[e.group]||n,d.async===!1&&(e.async=d.async),f=e.fullpath?O._filter(e.fullpath,t[s]):O._url(e.path,t[s],d.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);H[e.type].push(f),H[e.type+"Mods"].push(e)}};r=t.length,S=O.comboBase,f=S,w={};for(s=0;s<r;s++){y=S,o=O.getModule(t[s]),v=o&&o.group,d=O.groups[v];if(v&&d){if(!d.combine||o.fullpath){j(o);continue}o.combine=!0,d.comboBase&&(y=d.comboBase),"root"in d&&b.isValue(d.root)&&(o.root=d.root),o.comboSep=d.comboSep||O.comboSep,o.maxURLLength=d.maxURLLength||O.maxURLLength}else if(!O.combine){j(o);continue}w[y]=w[y]||[],w[y].push(o)}for(m in w)if(w.hasOwnProperty(m)){A[m]=A[m]||{js:[],jsMods:[],css:[],cssMods:[]},f=m,E=w[m],r=E.length;if(r)for(s=0;s<r;s++){if(P[E[s]])continue;o=E[s],o&&(o.combine||!o.ext)?(A[m].comboSep=o.comboSep,A[m].group=o.group,A[m].maxURLLength=o.maxURLLength,g=(b.isValue(o.root)?o.root:O.root)+(o.path||o.fullpath),g=O._filter(g,o.name),A[m][o.type].push(g),A[m][o.type+"Mods"].push(o)):E[s]&&j(E[s])}}for(m in A){x=m,M=A[x].comboSep||O.comboSep,_=A[x].maxURLLength||O.maxURLLength;for(B in A[x])if(B===a||B===u){T=A[x][B],E=A[x][B+"Mods"],r=T.length,C=x+T.join(M),k=C.length,_<=x.length&&(_=i);if(r)if(k>_){N=[];for(t=0;t<r;t++)N.push(T[t]),C=x+N.join(M),C.length>_&&(o=N.pop(),C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)),N=[],o&&N.push(o));N.length&&(C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)))}else H[B].push(O._filter(C,null,A[x].group));H[B+"Mods"]=H[B+"Mods"].concat(E)}}return A=null,H},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.2",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type==f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.2",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="5fe7d71505fef8108b090c35db73bcde"},"3.7.2",{requires:["loader-base"]}),YUI.add("loader",function(e,t){},"3.7.2",{use:["loader-base","loader-rollup","loader-yui3"]});+YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.10.10-19-59",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n,r,i,s;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null,s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!==r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type===u&&!f.ext&&f.type===u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this,l=[],c;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n==="require")f.require(i);else if(n==="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n==="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n==="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n==="gallery"?this.groups.gallery.update(i,t):n==="yui2"||n==="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o==="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName==="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){for(n=0;n<f.coverage.length;n++)c=f.coverage[n],f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c);f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t});var r,i,o,f,l,c,p,d,m,g,y,b,w,E,x,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;t.type||(t.type=a,O=t.path||t.fullpath,O&&this.REGEX_CSS.test(O)&&(t.type=u)),!t.path&&!t.fullpath&&(t.path=S(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0,r=t.submodules,this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(i=0;i<this.requires.length;i++)t.requires.push(this.requires[i]);if(t.group&&this.groups&&this.groups[t.group]){A=this.groups[t.group];if(A.requires)for(i=0;i<A.requires.length;i++)t.requires.push(A.requires[i])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(k=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(k)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){y=v(t.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b))}if(r){l=t.supersedes||[],o=0;for(i in r)if(r.hasOwnProperty(i)){c=r[i],c.path=c.path||S(n,i,t.type),c.pkg=n,c.group=t.group,c.supersedes&&(l=l.concat(c.supersedes)),p=this.addModule(c,i),l.push(i);if(p.skinnable){t.skinnable=!0,C=this.skin.overrides;if(C&&C[i])for(g=0;g<C[i].length;g++)k=this._addSkin(C[i][g],i,n),l.push(k);k=this._addSkin(this.skin.defaultSkin,i,n),l.push(k)}if(c.lang&&c.lang.length){y=v(c.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),w=this.getLangPackName(T,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),E=E||v.hash(p.supersedes),w in E||p.supersedes.push(w),t.lang=t.lang||[],x=x||v.hash(t.lang),T in x||t.lang.push(T),b=this.getLangPackName(h,n),w=this.getLangPackName(h,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),w in E||p.supersedes.push(w)}o++}t.supersedes=v.dedupe(l),this.allowRollup&&(t.rollup=o<4?o:Math.min(o-1,4))}d=t.plugins;if(d)for(i in d)d.hasOwnProperty(i)&&(m=d[i],m.pkg=n,m.path=m.path||S(n,i,t.type),m.requires=m.requires||[],m.group=t.group,this.addModule(m,i),t.skinnable&&this._addSkin(this.skin.defaultSkin,i,n));if(t.condition){f=t.condition.trigger,YUI.Env.aliases[f]&&(f=YUI.Env.aliases[f]),e.Lang.isArray(f)||(f=[f]);for(i=0;i<f.length;i++)_=f[i],L=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,L&&L!=="after"?L==="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(N=t.configFn(t),N===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A=t.lang||t.intl,O=this.moduleInfo,M=e.Features&&e.Features.tests.load,_,D;t.temp&&g&&(x=t,t=this.addModule(g,c),t.group=x.group,t.pkg=x.pkg,delete t.expanded),D=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!D)return t.expanded;y=[],_={},S=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),S.unshift("intl"),A=!0),T=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<S.length;n++)if(!_[S[n]]){y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}S=this.filterRequires(t.supersedes);if(S)for(n=0;n<S.length;n++)if(!_[S[n]]){t.submodules&&y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(T&&this.loadOptional)for(n=0;n<T.length;n++)if(!_[T[n]]){y.push(T[n]),_[T[n]]=!0,i=O[T[n]];if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&M)d(l,function(e,t){var n=M[t].name;!_[n]&&M[t].trigger===c&&e&&M[t]&&(_[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!_[n]){E=m[n],b=E&&(!E.ua&&!E.test||E.ua&&e.UA[E.ua]||E.test&&E.test(e,S));if(b){_[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){C=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(k=n);if(C&&(C[c]||k&&C[k])){L=c,C[k]&&(L=k);for(n=0;n<C[L].length;n++)N=this._addSkin(C[L][n],c),this.isCSSLoaded(N,this._boot)||y.push(N)}else N=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(N,this._boot)||y.push(N)}return t._parsed=!1,A&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=S(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o,u;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)t.hasOwnProperty(o)&&(i[o]||(i[o]=!0,n=s.getModule(o),n&&(u=n.expound,u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r)))))},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!==s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!==a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t);var s=this.resolve(!i),o=this,f=0,l=0,c={},h,p;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++,p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}},this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S=[],x,T,N={},C=this,k,A,O=C.ignoreRegistered?{}:C.inserted,M={js:[],jsMods:[],css:[],cssMods:[]},_=C.loadType||"js",D;(C.skin.overrides||C.skin.defaultSkin!==l||C.ignoreRegistered)&&C._resetModules(),e&&C.calculate(),t=t||C.sorted,D=function(e){if(e){c=e.group&&C.groups[e.group]||n,c.async===!1&&(e.async=c.async),f=e.fullpath?C._filter(e.fullpath,t[s]):C._url(e.path,t[s],c.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);M[e.type].push(f),M[e.type+"Mods"].push(e)}},r=t.length,y=C.comboBase,f=y,m={};for(s=0;s<r;s++){v=y,o=C.getModule(t[s]),h=o&&o.group,c=C.groups[h];if(h&&c){if(!c.combine||o.fullpath){D(o);continue}o.combine=!0,c.comboBase&&(v=c.comboBase),"root"in c&&b.isValue(c.root)&&(o.root=c.root),o.comboSep=c.comboSep||C.comboSep,o.maxURLLength=c.maxURLLength||C.maxURLLength}else if(!C.combine){D(o);continue}m[v]=m[v]||[],m[v].push(o)}for(p in m)if(m.hasOwnProperty(p)){N[p]=N[p]||{js:[],jsMods:[],css:[],cssMods:[]},f=p,g=m[p],r=g.length;if(r)for(s=0;s<r;s++){if(O[g[s]])continue;o=g[s],o&&(o.combine||!o.ext)?(N[p].comboSep=o.comboSep,N[p].group=o.group,N[p].maxURLLength=o.maxURLLength,d=(b.isValue(o.root)?o.root:C.root)+(o.path||o.fullpath),d=C._filter(d,o.name),N[p][o.type].push(d),N[p][o.type+"Mods"].push(o)):g[s]&&D(g[s])}}for(p in N){w=p,k=N[w].comboSep||C.comboSep,A=N[w].maxURLLength||C.maxURLLength;for(_ in N[w])if(_===a||_===u){E=N[w][_],g=N[w][_+"Mods"],r=E.length,x=w+E.join(k),T=x.length,A<=w.length&&(A=i);if(r)if(T>A){S=[];for(t=0;t<r;t++)S.push(E[t]),x=w+S.join(k),x.length>A&&(o=S.pop(),x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)),S=[],o&&S.push(o));S.length&&(x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)))}else M[_].push(C._filter(x,null,N[w].group));M[_+"Mods"]=M[_+"Mods"].concat(g)}}return N=null,M},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.3",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type===f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.3",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"}},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="a28e022ad022130f7a4fb4ac77a2f1df"},"3.7.3",{requires:["loader-base"]}),YUI.add("loader",function(e,t){},"3.7.3",{use:["loader-base","loader-rollup","loader-yui3"]});
bundle/loader/loader.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,7 +19,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -41,7 +41,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -104,7 +104,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -132,14 +132,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -182,7 +181,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -213,7 +212,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -339,7 +338,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -491,7 +490,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -529,7 +528,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -543,14 +542,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -662,15 +661,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -707,7 +708,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -757,7 +758,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -823,13 +824,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -842,15 +843,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -860,7 +863,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { groupName = j;@@ -876,7 +879,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -889,9 +892,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -907,16 +910,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -931,14 +933,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -1114,7 +1109,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -1137,7 +1138,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { o.type = CSS; }@@ -1151,16 +1152,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -1193,13 +1190,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1250,7 +1247,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -1261,7 +1258,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -1269,7 +1266,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -1299,8 +1296,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -1340,15 +1337,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -1362,7 +1359,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -1393,15 +1390,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -1494,7 +1491,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -1514,15 +1511,15 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); if (mod.expanded && !reparse) { return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -1609,7 +1606,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -1688,7 +1685,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -1710,7 +1707,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { return mod; }@@ -1753,7 +1750,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -1861,8 +1858,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -1888,7 +1885,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -1932,30 +1929,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -1994,7 +1991,7 @@ for (pname in patterns) { if (patterns.hasOwnProperty(pname)) { p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -2049,7 +2046,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -2057,7 +2054,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -2107,7 +2104,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -2115,11 +2112,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -2168,14 +2165,14 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); } msg = msg.join(','); - + if (f) { f.call(this.context, { msg: msg,@@ -2183,7 +2180,7 @@ success: false }); }- + this._finish(msg, false); },@@ -2296,13 +2293,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -2322,7 +2316,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -2337,7 +2331,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -2399,8 +2393,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.Get.css(modules.css, { data: modules.cssMods,@@ -2498,7 +2492,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { return; }, @@ -2566,15 +2560,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -2583,11 +2577,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -2595,7 +2589,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -2609,7 +2603,7 @@ resolved[m.type + 'Mods'].push(m); } else { }- + }; len = s.length;@@ -2630,7 +2624,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2647,7 +2640,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -2663,7 +2655,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -2683,7 +2675,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -2708,7 +2699,7 @@ if (maxURLLength <= base.length) { maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { u = [];@@ -2769,7 +2760,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -2782,7 +2773,7 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /**@@ -2852,7 +2843,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; roll = (c >= m.rollup); if (roll) {@@ -2881,7 +2872,7 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by src/loader/scripts/meta_join.js */@@ -3004,7 +2995,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -3568,6 +3559,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -3892,10 +3884,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -5115,7 +5105,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -5161,8 +5152,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5354,6 +5345,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -5372,8 +5379,8 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});-YUI.add('loader', function (Y, NAME) {}, '3.7.2', {"use": ["loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"requires": ["loader-base"]});+YUI.add('loader', function (Y, NAME) {}, '3.7.3', {"use": ["loader-base", "loader-rollup", "loader-yui3"]});
bundle/matrix/matrix-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,16 +32,23 @@ path: "build/matrix/matrix.js", code: [] };-_yuitest_coverage["build/matrix/matrix.js"].code=["YUI.add('matrix', function (Y, NAME) {","","var MatrixUtil = {"," /**"," * Used as value for the _rounding method."," *"," * @property _rounder"," * @private"," */"," _rounder: 100000,"," "," /**"," * Rounds values"," *"," * @method _round"," * @private"," */"," _round: function(val) {"," val = Math.round(val * MatrixUtil._rounder) / MatrixUtil._rounder;"," return val;"," },"," /**"," * Converts a radian value to a degree."," *"," * @method rad2deg"," * @param {Number} rad Radian value to be converted."," * @return Number"," */"," rad2deg: function(rad) {"," var deg = rad * (180 / Math.PI);"," return deg;"," },",""," /**"," * Converts a degree value to a radian."," *"," * @method deg2rad"," * @param {Number} deg Degree value to be converted to radian."," * @return Number"," */"," deg2rad: function(deg) {"," var rad = deg * (Math.PI / 180);"," return rad;"," },",""," /**"," * Converts an angle to a radian"," *"," * @method angle2rad"," * @param {Objecxt} val Value to be converted to radian."," * @return Number"," */"," angle2rad: function(val) {"," if (typeof val === 'string' && val.indexOf('rad') > -1) {"," val = parseFloat(val);"," } else { // default to deg"," val = MatrixUtil.deg2rad(parseFloat(val));"," }",""," return val;"," },",""," /**"," * Converts a transform object to an array of column vectors. "," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * \\ /"," *"," * @method getnxn"," * @return Array"," */"," convertTransformToArray: function(matrix)"," {"," var matrixArray = ["," [matrix.a, matrix.c, matrix.dx],"," [matrix.b, matrix.d, matrix.dy],"," [0, 0, 1]"," ];"," return matrixArray;"," },",""," /**"," * Returns the determinant of a given matrix. "," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * | matrix[0][3] matrix[1][3] matrix[2][3] |"," * \\ /"," *"," * @method getDeterminant"," * @param {Array} matrix An nxn matrix represented an array of vector (column) arrays. Each vector array has index for each row."," * @return Number"," */"," getDeterminant: function(matrix)"," {"," var determinant = 0,"," len = matrix.length,"," i = 0,"," multiplier;",""," if(len == 2)"," {"," return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];"," }"," for(; i < len; ++i)"," {"," multiplier = matrix[i][0];"," if(i % 2 === 0 || i === 0)"," {"," determinant += multiplier * MatrixUtil.getDeterminant(MatrixUtil.getMinors(matrix, i, 0)); "," }"," else"," {"," determinant -= multiplier * MatrixUtil.getDeterminant(MatrixUtil.getMinors(matrix, i, 0));"," }"," }"," return determinant;"," },",""," /**"," * Returns the inverse of a matrix"," *"," * @method inverse"," * @param Array matrix An array representing an nxn matrix"," * @return Array"," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * | matrix[0][3] matrix[1][3] matrix[2][3] |"," * \\ /"," */"," inverse: function(matrix)"," {"," var determinant = 0,"," len = matrix.length,"," i = 0,"," j,"," inverse,"," adjunct = [],"," //vector representing 2x2 matrix"," minor = [];"," if(len === 2) "," {"," determinant = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];"," inverse = ["," [matrix[1][1] * determinant, -matrix[1][0] * determinant],"," [-matrix[0][1] * determinant, matrix[0][0] * determinant]"," ]; "," }"," else"," {"," determinant = MatrixUtil.getDeterminant(matrix);"," for(; i < len; ++i)"," {"," adjunct[i] = [];"," for(j = 0; j < len; ++j)"," {"," minor = MatrixUtil.getMinors(matrix, j, i);"," adjunct[i][j] = MatrixUtil.getDeterminant(minor);"," if((i + j) % 2 !== 0 && (i + j) !== 0)"," {"," adjunct[i][j] *= -1;"," }"," }"," }"," inverse = MatrixUtil.scalarMultiply(adjunct, 1/determinant);"," }"," return inverse;"," },",""," /**"," * Multiplies a matrix by a numeric value."," *"," * @method scalarMultiply"," * @param {Array} matrix The matrix to be altered."," * @param {Number} multiplier The number to multiply against the matrix."," * @return Array"," */"," scalarMultiply: function(matrix, multiplier)"," {"," var i = 0,"," j,"," len = matrix.length;"," for(; i < len; ++i)"," {"," for(j = 0; j < len; ++j)"," {"," matrix[i][j] = MatrixUtil._round(matrix[i][j] * multiplier);"," }"," }"," return matrix;"," },",""," /**"," * Returns the transpose for an nxn matrix."," *"," * @method transpose"," * @param matrix An nxn matrix represented by an array of vector arrays."," * @return Array"," */"," transpose: function(matrix)"," {"," var len = matrix.length,"," i = 0,"," j = 0,"," transpose = [];"," for(; i < len; ++i)"," {"," transpose[i] = [];"," for(j = 0; j < len; ++j)"," {"," transpose[i].push(matrix[j][i]);"," }"," }"," return transpose;"," },",""," /**"," * Returns a matrix of minors based on a matrix, column index and row index."," *"," * @method getMinors"," * @param {Array} matrix The matrix from which to extract the matrix of minors."," * @param {Number} columnIndex A zero-based index representing the specified column to exclude."," * @param {Number} rowIndex A zero-based index represeenting the specified row to exclude."," * @return Array"," */"," getMinors: function(matrix, columnIndex, rowIndex)"," {"," var minors = [],"," len = matrix.length,"," i = 0,"," j,"," column;"," for(; i < len; ++i)"," {"," if(i !== columnIndex)"," {"," column = [];"," for(j = 0; j < len; ++j)"," {"," if(j !== rowIndex)"," {"," column.push(matrix[i][j]);"," }"," }"," minors.push(column);"," }"," }"," return minors;"," },",""," /**"," * Returns the sign of value"," *"," * @method sign"," * @param {Number} val value to be interpreted"," * @return Number"," */"," sign: function(val)"," {"," return val === 0 ? 1 : val/Math.abs(val);"," },",""," /**"," * Multiplies a vector and a matrix"," *"," * @method vectorMatrixProduct"," * @param {Array} vector Array representing a column vector"," * @param {Array} matrix Array representing an nxn matrix"," * @return Array"," */"," vectorMatrixProduct: function(vector, matrix)"," {"," var i,"," j,"," len = vector.length,"," product = [],"," rowProduct;"," for(i = 0; i < len; ++i)"," {"," rowProduct = 0;"," for(j = 0; j < len; ++j)"," {"," rowProduct += vector[i] * matrix[i][j];"," }"," product[i] = rowProduct;"," }"," return product;"," },"," "," /**"," * Breaks up a 2d transform matrix into a series of transform operations."," *"," * @method decompose"," * @param {Array} 3x3 matrix array"," * @return Array"," */"," decompose: function(matrix)"," {"," var a = parseFloat(matrix[0][0]),"," b = parseFloat(matrix[1][0]),"," c = parseFloat(matrix[0][1]),"," d = parseFloat(matrix[1][1]),"," dx = parseFloat(matrix[0][2]),"," dy = parseFloat(matrix[1][2]),"," rotate,"," sx,"," sy,"," shear;"," if((a * d - b * c) === 0)"," {"," return false;"," }"," //get length of vector(ab)"," sx = MatrixUtil._round(Math.sqrt(a * a + b * b));"," //normalize components of vector(ab)"," a /= sx;"," b /= sx;"," shear = MatrixUtil._round(a * c + b * d);"," c -= a * shear;"," d -= b * shear;"," //get length of vector(cd)"," sy = MatrixUtil._round(Math.sqrt(c * c + d * d));"," //normalize components of vector(cd)"," c /= sy;"," d /= sy;"," shear /=sy;"," shear = MatrixUtil._round(MatrixUtil.rad2deg(Math.atan(shear)));"," rotate = MatrixUtil._round(MatrixUtil.rad2deg(Math.atan2(matrix[1][0], matrix[0][0])));",""," return ["," [\"translate\", dx, dy],"," [\"rotate\", rotate],"," [\"skewX\", shear],"," [\"scale\", sx, sy]"," ];"," },",""," /**"," * Parses a transform string and returns an array of transform arrays."," *"," * @method getTransformArray "," * @param {String} val A transform string"," * @return Array"," */"," getTransformArray: function(transform) {"," var re = /\\s*([a-z]*)\\(([\\w,\\.,\\-,\\s]*)\\)/gi,"," transforms = [],"," args,"," m,"," decomp,"," methods = MatrixUtil.transformMethods;"," "," while ((m = re.exec(transform))) {"," if (methods.hasOwnProperty(m[1])) "," {"," args = m[2].split(',');"," args.unshift(m[1]);"," transforms.push(args);"," }"," else if(m[1] == \"matrix\")"," {"," args = m[2].split(',');"," decomp = MatrixUtil.decompose(["," [args[0], args[2], args[4]],"," [args[1], args[3], args[5]],"," [0, 0, 1]"," ]);"," transforms.push(decomp[0]);"," transforms.push(decomp[1]);"," transforms.push(decomp[2]);"," transforms.push(decomp[3]);"," }"," }"," return transforms;"," },"," "," /**"," * Returns an array of transform arrays representing transform functions and arguments."," *"," * @method getTransformFunctionArray"," * @return Array"," */"," getTransformFunctionArray: function(transform) {"," var list;"," switch(transform)"," {"," case \"skew\" :"," list = [transform, 0, 0];"," break;"," case \"scale\" :"," list = [transform, 1, 1];"," break;"," case \"scaleX\" :"," list = [transform, 1];"," break;"," case \"scaleY\" :"," list = [transform, 1];"," break;"," case \"translate\" :"," list = [transform, 0, 0];"," break;"," default :"," list = [transform, 0];"," break;"," }"," return list;"," },",""," /**"," * Compares to arrays or transform functions to ensure both contain the same functions in the same "," * order."," *"," * @method compareTransformSequence"," * @param {Array} list1 Array to compare"," * @param {Array} list2 Array to compare"," * @return Boolean"," */"," compareTransformSequence: function(list1, list2)"," {"," var i = 0,"," len = list1.length,"," len2 = list2.length,"," isEqual = len === len2;"," if(isEqual)"," {"," for(; i < len; ++i)"," {"," if(list1[i][0] != list2[i][0])"," {"," isEqual = false;"," break;"," }"," }"," }"," return isEqual;"," },",""," /**"," * Mapping of possible transform method names."," *"," * @property transformMethods"," * @type Object"," */"," transformMethods: {"," rotate: \"rotate\","," skew: \"skew\","," skewX: \"skewX\","," skewY: \"skewY\","," translate: \"translate\","," translateX: \"translateX\","," translateY: \"tranlsateY\","," scale: \"scale\","," scaleX: \"scaleX\","," scaleY: \"scaleY\""," }","","};","","Y.MatrixUtil = MatrixUtil;","","/**"," * Matrix is a class that allows for the manipulation of a transform matrix."," * This class is a work in progress."," *"," * @class Matrix"," * @constructor"," * @module matrix"," */","var Matrix = function(config) {"," this.init(config);","};","","Matrix.prototype = {"," /**"," * Used as value for the _rounding method."," *"," * @property _rounder"," * @private"," */"," _rounder: 100000,",""," /**"," * Updates the matrix. "," *"," * @method multiple"," * @param {Number} a "," * @param {Number} b"," * @param {Number} c"," * @param {Number} d"," * @param {Number} dx"," * @param {Number} dy"," */"," multiply: function(a, b, c, d, dx, dy) {"," var matrix = this,"," matrix_a = matrix.a * a + matrix.c * b,"," matrix_b = matrix.b * a + matrix.d * b,"," matrix_c = matrix.a * c + matrix.c * d,"," matrix_d = matrix.b * c + matrix.d * d,"," matrix_dx = matrix.a * dx + matrix.c * dy + matrix.dx,"," matrix_dy = matrix.b * dx + matrix.d * dy + matrix.dy;",""," matrix.a = this._round(matrix_a);"," matrix.b = this._round(matrix_b);"," matrix.c = this._round(matrix_c);"," matrix.d = this._round(matrix_d);"," matrix.dx = this._round(matrix_dx);"," matrix.dy = this._round(matrix_dy);"," return this;"," },",""," /**"," * Parses a string and updates the matrix."," *"," * @method applyCSSText"," * @param {String} val A css transform string"," */"," applyCSSText: function(val) {"," var re = /\\s*([a-z]*)\\(([\\w,\\.,\\-,\\s]*)\\)/gi,"," args,"," m;",""," val = val.replace(/matrix/g, \"multiply\");"," while ((m = re.exec(val))) {"," if (typeof this[m[1]] === 'function') {"," args = m[2].split(',');"," this[m[1]].apply(this, args);"," }"," }"," },"," "," /**"," * Parses a string and returns an array of transform arrays."," *"," * @method getTransformArray "," * @param {String} val A css transform string"," * @return Array"," */"," getTransformArray: function(val) {"," var re = /\\s*([a-z]*)\\(([\\w,\\.,\\-,\\s]*)\\)/gi,"," transforms = [],"," args,"," m;"," "," val = val.replace(/matrix/g, \"multiply\");"," while ((m = re.exec(val))) {"," if (typeof this[m[1]] === 'function') {"," args = m[2].split(',');"," args.unshift(m[1]);"," transforms.push(args);"," }"," }"," return transforms;"," },",""," /**"," * Default values for the matrix"," *"," * @property _defaults"," * @private"," */"," _defaults: {"," a: 1,"," b: 0,"," c: 0,"," d: 1,"," dx: 0,"," dy: 0"," },",""," /**"," * Rounds values"," *"," * @method _round"," * @private"," */"," _round: function(val) {"," val = Math.round(val * this._rounder) / this._rounder;"," return val;"," },",""," /**"," * Initializes a matrix."," *"," * @method init"," * @param {Object} config Specified key value pairs for matrix properties. If a property is not explicitly defined in the config argument,"," * the default value will be used."," */"," init: function(config) {"," var defaults = this._defaults,"," prop;",""," config = config || {};",""," for (prop in defaults) {"," if(defaults.hasOwnProperty(prop))"," {"," this[prop] = (prop in config) ? config[prop] : defaults[prop];"," }"," }",""," this._config = config;"," },",""," /**"," * Applies a scale transform"," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y) {"," this.multiply(x, 0, 0, y, 0, 0);"," return this;"," },"," "," /**"," * Applies a skew transformation."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y) {"," x = x || 0;"," y = y || 0;",""," if (x !== undefined) { // null or undef"," x = Math.tan(this.angle2rad(x));",""," }",""," if (y !== undefined) { // null or undef"," y = Math.tan(this.angle2rad(y));"," }",""," this.multiply(1, y, x, 1, 0, 0);"," return this;"," },",""," /**"," * Applies a skew to the x-coordinate"," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x) {"," this.skew(x);"," return this;"," },",""," /**"," * Applies a skew to the y-coordinate"," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y) {"," this.skew(null, y);"," return this;"," },",""," /**"," * Returns a string of text that can be used to populate a the css transform property of an element."," *"," * @method toCSSText"," * @return String"," */"," toCSSText: function() {"," var matrix = this,"," text = 'matrix(' +"," matrix.a + ',' + "," matrix.b + ',' + "," matrix.c + ',' + "," matrix.d + ',' + "," matrix.dx + ',' +"," matrix.dy + ')';"," return text;"," },",""," /**"," * Returns a string that can be used to populate the css filter property of an element."," *"," * @method toFilterText"," * @return String"," */"," toFilterText: function() {"," var matrix = this,"," text = 'progid:DXImageTransform.Microsoft.Matrix(';"," text += 'M11=' + matrix.a + ',' + "," 'M21=' + matrix.b + ',' + "," 'M12=' + matrix.c + ',' + "," 'M22=' + matrix.d + ',' +"," 'sizingMethod=\"auto expand\")';",""," text += '';",""," return text;"," },",""," /**"," * Converts a radian value to a degree."," *"," * @method rad2deg"," * @param {Number} rad Radian value to be converted."," * @return Number"," */"," rad2deg: function(rad) {"," var deg = rad * (180 / Math.PI);"," return deg;"," },",""," /**"," * Converts a degree value to a radian."," *"," * @method deg2rad"," * @param {Number} deg Degree value to be converted to radian."," * @return Number"," */"," deg2rad: function(deg) {"," var rad = deg * (Math.PI / 180);"," return rad;"," },",""," angle2rad: function(val) {"," if (typeof val === 'string' && val.indexOf('rad') > -1) {"," val = parseFloat(val);"," } else { // default to deg"," val = this.deg2rad(parseFloat(val));"," }",""," return val;"," },",""," /**"," * Applies a rotate transform."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg, x, y) {"," var rad = this.angle2rad(deg),"," sin = Math.sin(rad),"," cos = Math.cos(rad);"," this.multiply(cos, sin, 0 - sin, cos, 0, 0);"," return this;"," },",""," /**"," * Applies translate transformation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y) {"," x = parseFloat(x) || 0;"," y = parseFloat(y) || 0;"," this.multiply(1, 0, 0, 1, x, y);"," return this;"," },"," "," /**"," * Applies a translate to the x-coordinate"," *"," * @method translateX"," * @param {Number} x x-coordinate"," */"," translateX: function(x) {"," this.translate(x);"," return this;"," },",""," /**"," * Applies a translate to the y-coordinate"," *"," * @method translateY"," * @param {Number} y y-coordinate"," */"," translateY: function(y) {"," this.translate(null, y);"," return this;"," },","",""," /**"," * Returns an identity matrix."," *"," * @method identity"," * @return Object"," */"," identity: function() {"," var config = this._config,"," defaults = this._defaults,"," prop;",""," for (prop in config) {"," if (prop in defaults) {"," this[prop] = defaults[prop];"," }"," }"," return this;"," },",""," /**"," * Returns a 3x3 Matrix array"," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * \\ /"," *"," * @method getMatrixArray"," * @return Array"," */"," getMatrixArray: function()"," {"," var matrix = this,"," matrixArray = ["," [matrix.a, matrix.c, matrix.dx],"," [matrix.b, matrix.d, matrix.dy],"," [0, 0, 1]"," ];"," return matrixArray;"," },",""," /**"," * Returns the left, top, right and bottom coordinates for a transformed"," * item."," *"," * @method getContentRect"," * @param {Number} width The width of the item."," * @param {Number} height The height of the item."," * @param {Number} x The x-coordinate of the item."," * @param {Number} y The y-coordinate of the item."," * @return Object"," */"," getContentRect: function(width, height, x, y)"," {"," var left = !isNaN(x) ? x : 0,"," top = !isNaN(y) ? y : 0,"," right = left + width,"," bottom = top + height,"," matrix = this,"," a = matrix.a,"," b = matrix.b,"," c = matrix.c,"," d = matrix.d,"," dx = matrix.dx,"," dy = matrix.dy,"," x1 = (a * left + c * top + dx), "," y1 = (b * left + d * top + dy),"," //[x2, y2]"," x2 = (a * right + c * top + dx),"," y2 = (b * right + d * top + dy),"," //[x3, y3]"," x3 = (a * left + c * bottom + dx),"," y3 = (b * left + d * bottom + dy),"," //[x4, y4]"," x4 = (a * right + c * bottom + dx),"," y4 = (b * right + d * bottom + dy);"," return {"," left: Math.min(x3, Math.min(x1, Math.min(x2, x4))),"," right: Math.max(x3, Math.max(x1, Math.max(x2, x4))),"," top: Math.min(y2, Math.min(y4, Math.min(y3, y1))),"," bottom: Math.max(y2, Math.max(y4, Math.max(y3, y1)))"," };"," }, "," "," /**"," * Returns the determinant of the matrix."," *"," * @method getDeterminant"," * @return Number"," */"," getDeterminant: function()"," {"," return Y.MatrixUtil.getDeterminant(this.getMatrixArray());"," },",""," /**"," * Returns the inverse (in array form) of the matrix."," *"," * @method inverse"," * @return Array"," */"," inverse: function()"," {"," return Y.MatrixUtil.inverse(this.getMatrixArray());"," },",""," /**"," * Returns the transpose of the matrix"," *"," * @method transpose"," * @return Array"," */"," transpose: function()"," {"," return Y.MatrixUtil.transpose(this.getMatrixArray());"," },",""," /**"," * Returns an array of transform commands that represent the matrix."," *"," * @method decompose"," * @return Array"," */"," decompose: function()"," {"," return Y.MatrixUtil.decompose(this.getMatrixArray());"," }","};","","Y.Matrix = Matrix;","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];-_yuitest_coverage["build/matrix/matrix.js"].lines = {"1":0,"3":0,"19":0,"20":0,"30":0,"31":0,"42":0,"43":0,"54":0,"55":0,"57":0,"60":0,"77":0,"82":0,"101":0,"106":0,"108":0,"110":0,"112":0,"113":0,"115":0,"119":0,"122":0,"141":0,"149":0,"151":0,"152":0,"159":0,"160":0,"162":0,"163":0,"165":0,"166":0,"167":0,"169":0,"173":0,"175":0,"188":0,"191":0,"193":0,"195":0,"198":0,"210":0,"214":0,"216":0,"217":0,"219":0,"222":0,"236":0,"241":0,"243":0,"245":0,"246":0,"248":0,"250":0,"253":0,"256":0,"268":0,"281":0,"286":0,"288":0,"289":0,"291":0,"293":0,"295":0,"307":0,"317":0,"319":0,"322":0,"324":0,"325":0,"326":0,"327":0,"328":0,"330":0,"332":0,"333":0,"334":0,"335":0,"336":0,"338":0,"354":0,"361":0,"362":0,"364":0,"365":0,"366":0,"368":0,"370":0,"371":0,"376":0,"377":0,"378":0,"379":0,"382":0,"392":0,"393":0,"396":0,"397":0,"399":0,"400":0,"402":0,"403":0,"405":0,"406":0,"408":0,"409":0,"411":0,"412":0,"414":0,"428":0,"432":0,"434":0,"436":0,"438":0,"439":0,"443":0,"467":0,"477":0,"478":0,"481":0,"502":0,"510":0,"511":0,"512":0,"513":0,"514":0,"515":0,"516":0,"526":0,"530":0,"531":0,"532":0,"533":0,"534":0,"547":0,"552":0,"553":0,"554":0,"555":0,"556":0,"557":0,"560":0,"585":0,"586":0,"597":0,"600":0,"602":0,"603":0,"605":0,"609":0,"619":0,"620":0,"631":0,"632":0,"634":0,"635":0,"639":0,"640":0,"643":0,"644":0,"654":0,"655":0,"665":0,"666":0,"676":0,"684":0,"694":0,"696":0,"702":0,"704":0,"715":0,"716":0,"727":0,"728":0,"732":0,"733":0,"735":0,"738":0,"748":0,"751":0,"752":0,"763":0,"764":0,"765":0,"766":0,"776":0,"777":0,"787":0,"788":0,"799":0,"803":0,"804":0,"805":0,"808":0,"825":0,"831":0,"847":0,"869":0,"885":0,"896":0,"907":0,"918":0,"922":0};-_yuitest_coverage["build/matrix/matrix.js"].functions = {"_round:18":0,"rad2deg:29":0,"deg2rad:41":0,"angle2rad:53":0,"convertTransformToArray:75":0,"getDeterminant:99":0,"inverse:139":0,"scalarMultiply:186":0,"transpose:208":0,"getMinors:234":0,"sign:266":0,"vectorMatrixProduct:279":0,"decompose:305":0,"getTransformArray:353":0,"getTransformFunctionArray:391":0,"compareTransformSequence:426":0,"Matrix:477":0,"multiply:501":0,"applyCSSText:525":0,"getTransformArray:546":0,"_round:584":0,"init:596":0,"scale:618":0,"skew:630":0,"skewX:653":0,"skewY:664":0,"toCSSText:675":0,"toFilterText:693":0,"rad2deg:714":0,"deg2rad:726":0,"angle2rad:731":0,"rotate:747":0,"translate:762":0,"translateX:775":0,"translateY:786":0,"identity:798":0,"getMatrixArray:823":0,"getContentRect:845":0,"getDeterminant:883":0,"inverse:894":0,"transpose:905":0,"decompose:916":0,"(anonymous 1):1":0};+_yuitest_coverage["build/matrix/matrix.js"].code=["YUI.add('matrix', function (Y, NAME) {","","/**"," * Matrix utilities."," *"," * @class MatrixUtil"," * @module matrix"," **/","","var MatrixUtil = {"," /**"," * Used as value for the _rounding method."," *"," * @property _rounder"," * @private"," */"," _rounder: 100000,"," "," /**"," * Rounds values"," *"," * @method _round"," * @private"," */"," _round: function(val) {"," val = Math.round(val * MatrixUtil._rounder) / MatrixUtil._rounder;"," return val;"," },"," /**"," * Converts a radian value to a degree."," *"," * @method rad2deg"," * @param {Number} rad Radian value to be converted."," * @return Number"," */"," rad2deg: function(rad) {"," var deg = rad * (180 / Math.PI);"," return deg;"," },",""," /**"," * Converts a degree value to a radian."," *"," * @method deg2rad"," * @param {Number} deg Degree value to be converted to radian."," * @return Number"," */"," deg2rad: function(deg) {"," var rad = deg * (Math.PI / 180);"," return rad;"," },",""," /**"," * Converts an angle to a radian"," *"," * @method angle2rad"," * @param {Objecxt} val Value to be converted to radian."," * @return Number"," */"," angle2rad: function(val) {"," if (typeof val === 'string' && val.indexOf('rad') > -1) {"," val = parseFloat(val);"," } else { // default to deg"," val = MatrixUtil.deg2rad(parseFloat(val));"," }",""," return val;"," },",""," /**"," * Converts a transform object to an array of column vectors. "," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * \\ /"," *"," * @method getnxn"," * @return Array"," */"," convertTransformToArray: function(matrix)"," {"," var matrixArray = ["," [matrix.a, matrix.c, matrix.dx],"," [matrix.b, matrix.d, matrix.dy],"," [0, 0, 1]"," ];"," return matrixArray;"," },",""," /**"," * Returns the determinant of a given matrix. "," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * | matrix[0][3] matrix[1][3] matrix[2][3] |"," * \\ /"," *"," * @method getDeterminant"," * @param {Array} matrix An nxn matrix represented an array of vector (column) arrays. Each vector array has index for each row."," * @return Number"," */"," getDeterminant: function(matrix)"," {"," var determinant = 0,"," len = matrix.length,"," i = 0,"," multiplier;",""," if(len == 2)"," {"," return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];"," }"," for(; i < len; ++i)"," {"," multiplier = matrix[i][0];"," if(i % 2 === 0 || i === 0)"," {"," determinant += multiplier * MatrixUtil.getDeterminant(MatrixUtil.getMinors(matrix, i, 0)); "," }"," else"," {"," determinant -= multiplier * MatrixUtil.getDeterminant(MatrixUtil.getMinors(matrix, i, 0));"," }"," }"," return determinant;"," },",""," /**"," * Returns the inverse of a matrix"," *"," * @method inverse"," * @param Array matrix An array representing an nxn matrix"," * @return Array"," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * | matrix[0][3] matrix[1][3] matrix[2][3] |"," * \\ /"," */"," inverse: function(matrix)"," {"," var determinant = 0,"," len = matrix.length,"," i = 0,"," j,"," inverse,"," adjunct = [],"," //vector representing 2x2 matrix"," minor = [];"," if(len === 2) "," {"," determinant = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];"," inverse = ["," [matrix[1][1] * determinant, -matrix[1][0] * determinant],"," [-matrix[0][1] * determinant, matrix[0][0] * determinant]"," ]; "," }"," else"," {"," determinant = MatrixUtil.getDeterminant(matrix);"," for(; i < len; ++i)"," {"," adjunct[i] = [];"," for(j = 0; j < len; ++j)"," {"," minor = MatrixUtil.getMinors(matrix, j, i);"," adjunct[i][j] = MatrixUtil.getDeterminant(minor);"," if((i + j) % 2 !== 0 && (i + j) !== 0)"," {"," adjunct[i][j] *= -1;"," }"," }"," }"," inverse = MatrixUtil.scalarMultiply(adjunct, 1/determinant);"," }"," return inverse;"," },",""," /**"," * Multiplies a matrix by a numeric value."," *"," * @method scalarMultiply"," * @param {Array} matrix The matrix to be altered."," * @param {Number} multiplier The number to multiply against the matrix."," * @return Array"," */"," scalarMultiply: function(matrix, multiplier)"," {"," var i = 0,"," j,"," len = matrix.length;"," for(; i < len; ++i)"," {"," for(j = 0; j < len; ++j)"," {"," matrix[i][j] = MatrixUtil._round(matrix[i][j] * multiplier);"," }"," }"," return matrix;"," },",""," /**"," * Returns the transpose for an nxn matrix."," *"," * @method transpose"," * @param matrix An nxn matrix represented by an array of vector arrays."," * @return Array"," */"," transpose: function(matrix)"," {"," var len = matrix.length,"," i = 0,"," j = 0,"," transpose = [];"," for(; i < len; ++i)"," {"," transpose[i] = [];"," for(j = 0; j < len; ++j)"," {"," transpose[i].push(matrix[j][i]);"," }"," }"," return transpose;"," },",""," /**"," * Returns a matrix of minors based on a matrix, column index and row index."," *"," * @method getMinors"," * @param {Array} matrix The matrix from which to extract the matrix of minors."," * @param {Number} columnIndex A zero-based index representing the specified column to exclude."," * @param {Number} rowIndex A zero-based index represeenting the specified row to exclude."," * @return Array"," */"," getMinors: function(matrix, columnIndex, rowIndex)"," {"," var minors = [],"," len = matrix.length,"," i = 0,"," j,"," column;"," for(; i < len; ++i)"," {"," if(i !== columnIndex)"," {"," column = [];"," for(j = 0; j < len; ++j)"," {"," if(j !== rowIndex)"," {"," column.push(matrix[i][j]);"," }"," }"," minors.push(column);"," }"," }"," return minors;"," },",""," /**"," * Returns the sign of value"," *"," * @method sign"," * @param {Number} val value to be interpreted"," * @return Number"," */"," sign: function(val)"," {"," return val === 0 ? 1 : val/Math.abs(val);"," },",""," /**"," * Multiplies a vector and a matrix"," *"," * @method vectorMatrixProduct"," * @param {Array} vector Array representing a column vector"," * @param {Array} matrix Array representing an nxn matrix"," * @return Array"," */"," vectorMatrixProduct: function(vector, matrix)"," {"," var i,"," j,"," len = vector.length,"," product = [],"," rowProduct;"," for(i = 0; i < len; ++i)"," {"," rowProduct = 0;"," for(j = 0; j < len; ++j)"," {"," rowProduct += vector[i] * matrix[i][j];"," }"," product[i] = rowProduct;"," }"," return product;"," },"," "," /**"," * Breaks up a 2d transform matrix into a series of transform operations."," *"," * @method decompose"," * @param {Array} 3x3 matrix array"," * @return Array"," */"," decompose: function(matrix)"," {"," var a = parseFloat(matrix[0][0]),"," b = parseFloat(matrix[1][0]),"," c = parseFloat(matrix[0][1]),"," d = parseFloat(matrix[1][1]),"," dx = parseFloat(matrix[0][2]),"," dy = parseFloat(matrix[1][2]),"," rotate,"," sx,"," sy,"," shear;"," if((a * d - b * c) === 0)"," {"," return false;"," }"," //get length of vector(ab)"," sx = MatrixUtil._round(Math.sqrt(a * a + b * b));"," //normalize components of vector(ab)"," a /= sx;"," b /= sx;"," shear = MatrixUtil._round(a * c + b * d);"," c -= a * shear;"," d -= b * shear;"," //get length of vector(cd)"," sy = MatrixUtil._round(Math.sqrt(c * c + d * d));"," //normalize components of vector(cd)"," c /= sy;"," d /= sy;"," shear /=sy;"," shear = MatrixUtil._round(MatrixUtil.rad2deg(Math.atan(shear)));"," rotate = MatrixUtil._round(MatrixUtil.rad2deg(Math.atan2(matrix[1][0], matrix[0][0])));",""," return ["," [\"translate\", dx, dy],"," [\"rotate\", rotate],"," [\"skewX\", shear],"," [\"scale\", sx, sy]"," ];"," },",""," /**"," * Parses a transform string and returns an array of transform arrays."," *"," * @method getTransformArray "," * @param {String} val A transform string"," * @return Array"," */"," getTransformArray: function(transform) {"," var re = /\\s*([a-z]*)\\(([\\w,\\.,\\-,\\s]*)\\)/gi,"," transforms = [],"," args,"," m,"," decomp,"," methods = MatrixUtil.transformMethods;"," "," while ((m = re.exec(transform))) {"," if (methods.hasOwnProperty(m[1])) "," {"," args = m[2].split(',');"," args.unshift(m[1]);"," transforms.push(args);"," }"," else if(m[1] == \"matrix\")"," {"," args = m[2].split(',');"," decomp = MatrixUtil.decompose(["," [args[0], args[2], args[4]],"," [args[1], args[3], args[5]],"," [0, 0, 1]"," ]);"," transforms.push(decomp[0]);"," transforms.push(decomp[1]);"," transforms.push(decomp[2]);"," transforms.push(decomp[3]);"," }"," }"," return transforms;"," },"," "," /**"," * Returns an array of transform arrays representing transform functions and arguments."," *"," * @method getTransformFunctionArray"," * @return Array"," */"," getTransformFunctionArray: function(transform) {"," var list;"," switch(transform)"," {"," case \"skew\" :"," list = [transform, 0, 0];"," break;"," case \"scale\" :"," list = [transform, 1, 1];"," break;"," case \"scaleX\" :"," list = [transform, 1];"," break;"," case \"scaleY\" :"," list = [transform, 1];"," break;"," case \"translate\" :"," list = [transform, 0, 0];"," break;"," default :"," list = [transform, 0];"," break;"," }"," return list;"," },",""," /**"," * Compares to arrays or transform functions to ensure both contain the same functions in the same "," * order."," *"," * @method compareTransformSequence"," * @param {Array} list1 Array to compare"," * @param {Array} list2 Array to compare"," * @return Boolean"," */"," compareTransformSequence: function(list1, list2)"," {"," var i = 0,"," len = list1.length,"," len2 = list2.length,"," isEqual = len === len2;"," if(isEqual)"," {"," for(; i < len; ++i)"," {"," if(list1[i][0] != list2[i][0])"," {"," isEqual = false;"," break;"," }"," }"," }"," return isEqual;"," },",""," /**"," * Mapping of possible transform method names."," *"," * @property transformMethods"," * @type Object"," */"," transformMethods: {"," rotate: \"rotate\","," skew: \"skew\","," skewX: \"skewX\","," skewY: \"skewY\","," translate: \"translate\","," translateX: \"translateX\","," translateY: \"tranlsateY\","," scale: \"scale\","," scaleX: \"scaleX\","," scaleY: \"scaleY\""," }","","};","","Y.MatrixUtil = MatrixUtil;","","/**"," * Matrix is a class that allows for the manipulation of a transform matrix."," * This class is a work in progress."," *"," * @class Matrix"," * @constructor"," * @module matrix"," */","var Matrix = function(config) {"," this.init(config);","};","","Matrix.prototype = {"," /**"," * Used as value for the _rounding method."," *"," * @property _rounder"," * @private"," */"," _rounder: 100000,",""," /**"," * Updates the matrix. "," *"," * @method multiple"," * @param {Number} a "," * @param {Number} b"," * @param {Number} c"," * @param {Number} d"," * @param {Number} dx"," * @param {Number} dy"," */"," multiply: function(a, b, c, d, dx, dy) {"," var matrix = this,"," matrix_a = matrix.a * a + matrix.c * b,"," matrix_b = matrix.b * a + matrix.d * b,"," matrix_c = matrix.a * c + matrix.c * d,"," matrix_d = matrix.b * c + matrix.d * d,"," matrix_dx = matrix.a * dx + matrix.c * dy + matrix.dx,"," matrix_dy = matrix.b * dx + matrix.d * dy + matrix.dy;",""," matrix.a = this._round(matrix_a);"," matrix.b = this._round(matrix_b);"," matrix.c = this._round(matrix_c);"," matrix.d = this._round(matrix_d);"," matrix.dx = this._round(matrix_dx);"," matrix.dy = this._round(matrix_dy);"," return this;"," },",""," /**"," * Parses a string and updates the matrix."," *"," * @method applyCSSText"," * @param {String} val A css transform string"," */"," applyCSSText: function(val) {"," var re = /\\s*([a-z]*)\\(([\\w,\\.,\\-,\\s]*)\\)/gi,"," args,"," m;",""," val = val.replace(/matrix/g, \"multiply\");"," while ((m = re.exec(val))) {"," if (typeof this[m[1]] === 'function') {"," args = m[2].split(',');"," this[m[1]].apply(this, args);"," }"," }"," },"," "," /**"," * Parses a string and returns an array of transform arrays."," *"," * @method getTransformArray "," * @param {String} val A css transform string"," * @return Array"," */"," getTransformArray: function(val) {"," var re = /\\s*([a-z]*)\\(([\\w,\\.,\\-,\\s]*)\\)/gi,"," transforms = [],"," args,"," m;"," "," val = val.replace(/matrix/g, \"multiply\");"," while ((m = re.exec(val))) {"," if (typeof this[m[1]] === 'function') {"," args = m[2].split(',');"," args.unshift(m[1]);"," transforms.push(args);"," }"," }"," return transforms;"," },",""," /**"," * Default values for the matrix"," *"," * @property _defaults"," * @private"," */"," _defaults: {"," a: 1,"," b: 0,"," c: 0,"," d: 1,"," dx: 0,"," dy: 0"," },",""," /**"," * Rounds values"," *"," * @method _round"," * @private"," */"," _round: function(val) {"," val = Math.round(val * this._rounder) / this._rounder;"," return val;"," },",""," /**"," * Initializes a matrix."," *"," * @method init"," * @param {Object} config Specified key value pairs for matrix properties. If a property is not explicitly defined in the config argument,"," * the default value will be used."," */"," init: function(config) {"," var defaults = this._defaults,"," prop;",""," config = config || {};",""," for (prop in defaults) {"," if(defaults.hasOwnProperty(prop))"," {"," this[prop] = (prop in config) ? config[prop] : defaults[prop];"," }"," }",""," this._config = config;"," },",""," /**"," * Applies a scale transform"," *"," * @method scale"," * @param {Number} val"," */"," scale: function(x, y) {"," this.multiply(x, 0, 0, y, 0, 0);"," return this;"," },"," "," /**"," * Applies a skew transformation."," *"," * @method skew"," * @param {Number} x The value to skew on the x-axis."," * @param {Number} y The value to skew on the y-axis."," */"," skew: function(x, y) {"," x = x || 0;"," y = y || 0;",""," if (x !== undefined) { // null or undef"," x = Math.tan(this.angle2rad(x));",""," }",""," if (y !== undefined) { // null or undef"," y = Math.tan(this.angle2rad(y));"," }",""," this.multiply(1, y, x, 1, 0, 0);"," return this;"," },",""," /**"," * Applies a skew to the x-coordinate"," *"," * @method skewX"," * @param {Number} x x-coordinate"," */"," skewX: function(x) {"," this.skew(x);"," return this;"," },",""," /**"," * Applies a skew to the y-coordinate"," *"," * @method skewY"," * @param {Number} y y-coordinate"," */"," skewY: function(y) {"," this.skew(null, y);"," return this;"," },",""," /**"," * Returns a string of text that can be used to populate a the css transform property of an element."," *"," * @method toCSSText"," * @return String"," */"," toCSSText: function() {"," var matrix = this,"," text = 'matrix(' +"," matrix.a + ',' + "," matrix.b + ',' + "," matrix.c + ',' + "," matrix.d + ',' + "," matrix.dx + ',' +"," matrix.dy + ')';"," return text;"," },",""," /**"," * Returns a string that can be used to populate the css filter property of an element."," *"," * @method toFilterText"," * @return String"," */"," toFilterText: function() {"," var matrix = this,"," text = 'progid:DXImageTransform.Microsoft.Matrix(';"," text += 'M11=' + matrix.a + ',' + "," 'M21=' + matrix.b + ',' + "," 'M12=' + matrix.c + ',' + "," 'M22=' + matrix.d + ',' +"," 'sizingMethod=\"auto expand\")';",""," text += '';",""," return text;"," },",""," /**"," * Converts a radian value to a degree."," *"," * @method rad2deg"," * @param {Number} rad Radian value to be converted."," * @return Number"," */"," rad2deg: function(rad) {"," var deg = rad * (180 / Math.PI);"," return deg;"," },",""," /**"," * Converts a degree value to a radian."," *"," * @method deg2rad"," * @param {Number} deg Degree value to be converted to radian."," * @return Number"," */"," deg2rad: function(deg) {"," var rad = deg * (Math.PI / 180);"," return rad;"," },",""," angle2rad: function(val) {"," if (typeof val === 'string' && val.indexOf('rad') > -1) {"," val = parseFloat(val);"," } else { // default to deg"," val = this.deg2rad(parseFloat(val));"," }",""," return val;"," },",""," /**"," * Applies a rotate transform."," *"," * @method rotate"," * @param {Number} deg The degree of the rotation."," */"," rotate: function(deg, x, y) {"," var rad = this.angle2rad(deg),"," sin = Math.sin(rad),"," cos = Math.cos(rad);"," this.multiply(cos, sin, 0 - sin, cos, 0, 0);"," return this;"," },",""," /**"," * Applies translate transformation."," *"," * @method translate"," * @param {Number} x The value to transate on the x-axis."," * @param {Number} y The value to translate on the y-axis."," */"," translate: function(x, y) {"," x = parseFloat(x) || 0;"," y = parseFloat(y) || 0;"," this.multiply(1, 0, 0, 1, x, y);"," return this;"," },"," "," /**"," * Applies a translate to the x-coordinate"," *"," * @method translateX"," * @param {Number} x x-coordinate"," */"," translateX: function(x) {"," this.translate(x);"," return this;"," },",""," /**"," * Applies a translate to the y-coordinate"," *"," * @method translateY"," * @param {Number} y y-coordinate"," */"," translateY: function(y) {"," this.translate(null, y);"," return this;"," },","",""," /**"," * Returns an identity matrix."," *"," * @method identity"," * @return Object"," */"," identity: function() {"," var config = this._config,"," defaults = this._defaults,"," prop;",""," for (prop in config) {"," if (prop in defaults) {"," this[prop] = defaults[prop];"," }"," }"," return this;"," },",""," /**"," * Returns a 3x3 Matrix array"," *"," * / \\"," * | matrix[0][0] matrix[1][0] matrix[2][0] |"," * | matrix[0][1] matrix[1][1] matrix[2][1] |"," * | matrix[0][2] matrix[1][2] matrix[2][2] |"," * \\ /"," *"," * @method getMatrixArray"," * @return Array"," */"," getMatrixArray: function()"," {"," var matrix = this,"," matrixArray = ["," [matrix.a, matrix.c, matrix.dx],"," [matrix.b, matrix.d, matrix.dy],"," [0, 0, 1]"," ];"," return matrixArray;"," },",""," /**"," * Returns the left, top, right and bottom coordinates for a transformed"," * item."," *"," * @method getContentRect"," * @param {Number} width The width of the item."," * @param {Number} height The height of the item."," * @param {Number} x The x-coordinate of the item."," * @param {Number} y The y-coordinate of the item."," * @return Object"," */"," getContentRect: function(width, height, x, y)"," {"," var left = !isNaN(x) ? x : 0,"," top = !isNaN(y) ? y : 0,"," right = left + width,"," bottom = top + height,"," matrix = this,"," a = matrix.a,"," b = matrix.b,"," c = matrix.c,"," d = matrix.d,"," dx = matrix.dx,"," dy = matrix.dy,"," x1 = (a * left + c * top + dx), "," y1 = (b * left + d * top + dy),"," //[x2, y2]"," x2 = (a * right + c * top + dx),"," y2 = (b * right + d * top + dy),"," //[x3, y3]"," x3 = (a * left + c * bottom + dx),"," y3 = (b * left + d * bottom + dy),"," //[x4, y4]"," x4 = (a * right + c * bottom + dx),"," y4 = (b * right + d * bottom + dy);"," return {"," left: Math.min(x3, Math.min(x1, Math.min(x2, x4))),"," right: Math.max(x3, Math.max(x1, Math.max(x2, x4))),"," top: Math.min(y2, Math.min(y4, Math.min(y3, y1))),"," bottom: Math.max(y2, Math.max(y4, Math.max(y3, y1)))"," };"," }, "," "," /**"," * Returns the determinant of the matrix."," *"," * @method getDeterminant"," * @return Number"," */"," getDeterminant: function()"," {"," return Y.MatrixUtil.getDeterminant(this.getMatrixArray());"," },",""," /**"," * Returns the inverse (in array form) of the matrix."," *"," * @method inverse"," * @return Array"," */"," inverse: function()"," {"," return Y.MatrixUtil.inverse(this.getMatrixArray());"," },",""," /**"," * Returns the transpose of the matrix"," *"," * @method transpose"," * @return Array"," */"," transpose: function()"," {"," return Y.MatrixUtil.transpose(this.getMatrixArray());"," },",""," /**"," * Returns an array of transform commands that represent the matrix."," *"," * @method decompose"," * @return Array"," */"," decompose: function()"," {"," return Y.MatrixUtil.decompose(this.getMatrixArray());"," }","};","","Y.Matrix = Matrix;","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/matrix/matrix.js"].lines = {"1":0,"10":0,"26":0,"27":0,"37":0,"38":0,"49":0,"50":0,"61":0,"62":0,"64":0,"67":0,"84":0,"89":0,"108":0,"113":0,"115":0,"117":0,"119":0,"120":0,"122":0,"126":0,"129":0,"148":0,"156":0,"158":0,"159":0,"166":0,"167":0,"169":0,"170":0,"172":0,"173":0,"174":0,"176":0,"180":0,"182":0,"195":0,"198":0,"200":0,"202":0,"205":0,"217":0,"221":0,"223":0,"224":0,"226":0,"229":0,"243":0,"248":0,"250":0,"252":0,"253":0,"255":0,"257":0,"260":0,"263":0,"275":0,"288":0,"293":0,"295":0,"296":0,"298":0,"300":0,"302":0,"314":0,"324":0,"326":0,"329":0,"331":0,"332":0,"333":0,"334":0,"335":0,"337":0,"339":0,"340":0,"341":0,"342":0,"343":0,"345":0,"361":0,"368":0,"369":0,"371":0,"372":0,"373":0,"375":0,"377":0,"378":0,"383":0,"384":0,"385":0,"386":0,"389":0,"399":0,"400":0,"403":0,"404":0,"406":0,"407":0,"409":0,"410":0,"412":0,"413":0,"415":0,"416":0,"418":0,"419":0,"421":0,"435":0,"439":0,"441":0,"443":0,"445":0,"446":0,"450":0,"474":0,"484":0,"485":0,"488":0,"509":0,"517":0,"518":0,"519":0,"520":0,"521":0,"522":0,"523":0,"533":0,"537":0,"538":0,"539":0,"540":0,"541":0,"554":0,"559":0,"560":0,"561":0,"562":0,"563":0,"564":0,"567":0,"592":0,"593":0,"604":0,"607":0,"609":0,"610":0,"612":0,"616":0,"626":0,"627":0,"638":0,"639":0,"641":0,"642":0,"646":0,"647":0,"650":0,"651":0,"661":0,"662":0,"672":0,"673":0,"683":0,"691":0,"701":0,"703":0,"709":0,"711":0,"722":0,"723":0,"734":0,"735":0,"739":0,"740":0,"742":0,"745":0,"755":0,"758":0,"759":0,"770":0,"771":0,"772":0,"773":0,"783":0,"784":0,"794":0,"795":0,"806":0,"810":0,"811":0,"812":0,"815":0,"832":0,"838":0,"854":0,"876":0,"892":0,"903":0,"914":0,"925":0,"929":0};+_yuitest_coverage["build/matrix/matrix.js"].functions = {"_round:25":0,"rad2deg:36":0,"deg2rad:48":0,"angle2rad:60":0,"convertTransformToArray:82":0,"getDeterminant:106":0,"inverse:146":0,"scalarMultiply:193":0,"transpose:215":0,"getMinors:241":0,"sign:273":0,"vectorMatrixProduct:286":0,"decompose:312":0,"getTransformArray:360":0,"getTransformFunctionArray:398":0,"compareTransformSequence:433":0,"Matrix:484":0,"multiply:508":0,"applyCSSText:532":0,"getTransformArray:553":0,"_round:591":0,"init:603":0,"scale:625":0,"skew:637":0,"skewX:660":0,"skewY:671":0,"toCSSText:682":0,"toFilterText:700":0,"rad2deg:721":0,"deg2rad:733":0,"angle2rad:738":0,"rotate:754":0,"translate:769":0,"translateX:782":0,"translateY:793":0,"identity:805":0,"getMatrixArray:830":0,"getContentRect:852":0,"getDeterminant:890":0,"inverse:901":0,"transpose:912":0,"decompose:923":0,"(anonymous 1):1":0}; _yuitest_coverage["build/matrix/matrix.js"].coveredLines = 204; _yuitest_coverage["build/matrix/matrix.js"].coveredFunctions = 43; _yuitest_coverline("build/matrix/matrix.js", 1); YUI.add('matrix', function (Y, NAME) { +/**+ * Matrix utilities.+ *+ * @class MatrixUtil+ * @module matrix+ **/+ _yuitest_coverfunc("build/matrix/matrix.js", "(anonymous 1)", 1);-_yuitest_coverline("build/matrix/matrix.js", 3);+_yuitest_coverline("build/matrix/matrix.js", 10); var MatrixUtil = { /** * Used as value for the _rounding method.@@ -58,10 +65,10 @@ * @private */ _round: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "_round", 18);-_yuitest_coverline("build/matrix/matrix.js", 19);+ _yuitest_coverfunc("build/matrix/matrix.js", "_round", 25);+_yuitest_coverline("build/matrix/matrix.js", 26); val = Math.round(val * MatrixUtil._rounder) / MatrixUtil._rounder;- _yuitest_coverline("build/matrix/matrix.js", 20);+ _yuitest_coverline("build/matrix/matrix.js", 27); return val; }, /**@@ -72,10 +79,10 @@ * @return Number */ rad2deg: function(rad) {- _yuitest_coverfunc("build/matrix/matrix.js", "rad2deg", 29);-_yuitest_coverline("build/matrix/matrix.js", 30);+ _yuitest_coverfunc("build/matrix/matrix.js", "rad2deg", 36);+_yuitest_coverline("build/matrix/matrix.js", 37); var deg = rad * (180 / Math.PI);- _yuitest_coverline("build/matrix/matrix.js", 31);+ _yuitest_coverline("build/matrix/matrix.js", 38); return deg; }, @@ -87,10 +94,10 @@ * @return Number */ deg2rad: function(deg) {- _yuitest_coverfunc("build/matrix/matrix.js", "deg2rad", 41);-_yuitest_coverline("build/matrix/matrix.js", 42);+ _yuitest_coverfunc("build/matrix/matrix.js", "deg2rad", 48);+_yuitest_coverline("build/matrix/matrix.js", 49); var rad = deg * (Math.PI / 180);- _yuitest_coverline("build/matrix/matrix.js", 43);+ _yuitest_coverline("build/matrix/matrix.js", 50); return rad; }, @@ -102,17 +109,17 @@ * @return Number */ angle2rad: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "angle2rad", 53);-_yuitest_coverline("build/matrix/matrix.js", 54);+ _yuitest_coverfunc("build/matrix/matrix.js", "angle2rad", 60);+_yuitest_coverline("build/matrix/matrix.js", 61); if (typeof val === 'string' && val.indexOf('rad') > -1) {- _yuitest_coverline("build/matrix/matrix.js", 55);+ _yuitest_coverline("build/matrix/matrix.js", 62); val = parseFloat(val); } else { // default to deg- _yuitest_coverline("build/matrix/matrix.js", 57);+ _yuitest_coverline("build/matrix/matrix.js", 64); val = MatrixUtil.deg2rad(parseFloat(val)); } - _yuitest_coverline("build/matrix/matrix.js", 60);+ _yuitest_coverline("build/matrix/matrix.js", 67); return val; }, @@ -130,14 +137,14 @@ */ convertTransformToArray: function(matrix) {- _yuitest_coverfunc("build/matrix/matrix.js", "convertTransformToArray", 75);-_yuitest_coverline("build/matrix/matrix.js", 77);+ _yuitest_coverfunc("build/matrix/matrix.js", "convertTransformToArray", 82);+_yuitest_coverline("build/matrix/matrix.js", 84); var matrixArray = [ [matrix.a, matrix.c, matrix.dx], [matrix.b, matrix.d, matrix.dy], [0, 0, 1] ];- _yuitest_coverline("build/matrix/matrix.js", 82);+ _yuitest_coverline("build/matrix/matrix.js", 89); return matrixArray; }, @@ -157,37 +164,37 @@ */ getDeterminant: function(matrix) {- _yuitest_coverfunc("build/matrix/matrix.js", "getDeterminant", 99);-_yuitest_coverline("build/matrix/matrix.js", 101);+ _yuitest_coverfunc("build/matrix/matrix.js", "getDeterminant", 106);+_yuitest_coverline("build/matrix/matrix.js", 108); var determinant = 0, len = matrix.length, i = 0, multiplier; - _yuitest_coverline("build/matrix/matrix.js", 106);+ _yuitest_coverline("build/matrix/matrix.js", 113); if(len == 2) {- _yuitest_coverline("build/matrix/matrix.js", 108);+ _yuitest_coverline("build/matrix/matrix.js", 115); return matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0]; }- _yuitest_coverline("build/matrix/matrix.js", 110);+ _yuitest_coverline("build/matrix/matrix.js", 117); for(; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 112);+ _yuitest_coverline("build/matrix/matrix.js", 119); multiplier = matrix[i][0];- _yuitest_coverline("build/matrix/matrix.js", 113);+ _yuitest_coverline("build/matrix/matrix.js", 120); if(i % 2 === 0 || i === 0) {- _yuitest_coverline("build/matrix/matrix.js", 115);+ _yuitest_coverline("build/matrix/matrix.js", 122); determinant += multiplier * MatrixUtil.getDeterminant(MatrixUtil.getMinors(matrix, i, 0)); } else {- _yuitest_coverline("build/matrix/matrix.js", 119);+ _yuitest_coverline("build/matrix/matrix.js", 126); determinant -= multiplier * MatrixUtil.getDeterminant(MatrixUtil.getMinors(matrix, i, 0)); } }- _yuitest_coverline("build/matrix/matrix.js", 122);+ _yuitest_coverline("build/matrix/matrix.js", 129); return determinant; }, @@ -207,8 +214,8 @@ */ inverse: function(matrix) {- _yuitest_coverfunc("build/matrix/matrix.js", "inverse", 139);-_yuitest_coverline("build/matrix/matrix.js", 141);+ _yuitest_coverfunc("build/matrix/matrix.js", "inverse", 146);+_yuitest_coverline("build/matrix/matrix.js", 148); var determinant = 0, len = matrix.length, i = 0,@@ -217,12 +224,12 @@ adjunct = [], //vector representing 2x2 matrix minor = [];- _yuitest_coverline("build/matrix/matrix.js", 149);+ _yuitest_coverline("build/matrix/matrix.js", 156); if(len === 2) {- _yuitest_coverline("build/matrix/matrix.js", 151);+ _yuitest_coverline("build/matrix/matrix.js", 158); determinant = matrix[0][0] * matrix[1][1] - matrix[0][1] * matrix[1][0];- _yuitest_coverline("build/matrix/matrix.js", 152);+ _yuitest_coverline("build/matrix/matrix.js", 159); inverse = [ [matrix[1][1] * determinant, -matrix[1][0] * determinant], [-matrix[0][1] * determinant, matrix[0][0] * determinant]@@ -230,32 +237,32 @@ } else {- _yuitest_coverline("build/matrix/matrix.js", 159);+ _yuitest_coverline("build/matrix/matrix.js", 166); determinant = MatrixUtil.getDeterminant(matrix);- _yuitest_coverline("build/matrix/matrix.js", 160);+ _yuitest_coverline("build/matrix/matrix.js", 167); for(; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 162);+ _yuitest_coverline("build/matrix/matrix.js", 169); adjunct[i] = [];- _yuitest_coverline("build/matrix/matrix.js", 163);+ _yuitest_coverline("build/matrix/matrix.js", 170); for(j = 0; j < len; ++j) {- _yuitest_coverline("build/matrix/matrix.js", 165);+ _yuitest_coverline("build/matrix/matrix.js", 172); minor = MatrixUtil.getMinors(matrix, j, i);- _yuitest_coverline("build/matrix/matrix.js", 166);+ _yuitest_coverline("build/matrix/matrix.js", 173); adjunct[i][j] = MatrixUtil.getDeterminant(minor);- _yuitest_coverline("build/matrix/matrix.js", 167);+ _yuitest_coverline("build/matrix/matrix.js", 174); if((i + j) % 2 !== 0 && (i + j) !== 0) {- _yuitest_coverline("build/matrix/matrix.js", 169);+ _yuitest_coverline("build/matrix/matrix.js", 176); adjunct[i][j] *= -1; } } }- _yuitest_coverline("build/matrix/matrix.js", 173);+ _yuitest_coverline("build/matrix/matrix.js", 180); inverse = MatrixUtil.scalarMultiply(adjunct, 1/determinant); }- _yuitest_coverline("build/matrix/matrix.js", 175);+ _yuitest_coverline("build/matrix/matrix.js", 182); return inverse; }, @@ -269,22 +276,22 @@ */ scalarMultiply: function(matrix, multiplier) {- _yuitest_coverfunc("build/matrix/matrix.js", "scalarMultiply", 186);-_yuitest_coverline("build/matrix/matrix.js", 188);+ _yuitest_coverfunc("build/matrix/matrix.js", "scalarMultiply", 193);+_yuitest_coverline("build/matrix/matrix.js", 195); var i = 0, j, len = matrix.length;- _yuitest_coverline("build/matrix/matrix.js", 191);+ _yuitest_coverline("build/matrix/matrix.js", 198); for(; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 193);+ _yuitest_coverline("build/matrix/matrix.js", 200); for(j = 0; j < len; ++j) {- _yuitest_coverline("build/matrix/matrix.js", 195);+ _yuitest_coverline("build/matrix/matrix.js", 202); matrix[i][j] = MatrixUtil._round(matrix[i][j] * multiplier); } }- _yuitest_coverline("build/matrix/matrix.js", 198);+ _yuitest_coverline("build/matrix/matrix.js", 205); return matrix; }, @@ -297,25 +304,25 @@ */ transpose: function(matrix) {- _yuitest_coverfunc("build/matrix/matrix.js", "transpose", 208);-_yuitest_coverline("build/matrix/matrix.js", 210);+ _yuitest_coverfunc("build/matrix/matrix.js", "transpose", 215);+_yuitest_coverline("build/matrix/matrix.js", 217); var len = matrix.length, i = 0, j = 0, transpose = [];- _yuitest_coverline("build/matrix/matrix.js", 214);+ _yuitest_coverline("build/matrix/matrix.js", 221); for(; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 216);+ _yuitest_coverline("build/matrix/matrix.js", 223); transpose[i] = [];- _yuitest_coverline("build/matrix/matrix.js", 217);+ _yuitest_coverline("build/matrix/matrix.js", 224); for(j = 0; j < len; ++j) {- _yuitest_coverline("build/matrix/matrix.js", 219);+ _yuitest_coverline("build/matrix/matrix.js", 226); transpose[i].push(matrix[j][i]); } }- _yuitest_coverline("build/matrix/matrix.js", 222);+ _yuitest_coverline("build/matrix/matrix.js", 229); return transpose; }, @@ -330,36 +337,36 @@ */ getMinors: function(matrix, columnIndex, rowIndex) {- _yuitest_coverfunc("build/matrix/matrix.js", "getMinors", 234);-_yuitest_coverline("build/matrix/matrix.js", 236);+ _yuitest_coverfunc("build/matrix/matrix.js", "getMinors", 241);+_yuitest_coverline("build/matrix/matrix.js", 243); var minors = [], len = matrix.length, i = 0, j, column;- _yuitest_coverline("build/matrix/matrix.js", 241);+ _yuitest_coverline("build/matrix/matrix.js", 248); for(; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 243);+ _yuitest_coverline("build/matrix/matrix.js", 250); if(i !== columnIndex) {- _yuitest_coverline("build/matrix/matrix.js", 245);+ _yuitest_coverline("build/matrix/matrix.js", 252); column = [];- _yuitest_coverline("build/matrix/matrix.js", 246);+ _yuitest_coverline("build/matrix/matrix.js", 253); for(j = 0; j < len; ++j) {- _yuitest_coverline("build/matrix/matrix.js", 248);+ _yuitest_coverline("build/matrix/matrix.js", 255); if(j !== rowIndex) {- _yuitest_coverline("build/matrix/matrix.js", 250);+ _yuitest_coverline("build/matrix/matrix.js", 257); column.push(matrix[i][j]); } }- _yuitest_coverline("build/matrix/matrix.js", 253);+ _yuitest_coverline("build/matrix/matrix.js", 260); minors.push(column); } }- _yuitest_coverline("build/matrix/matrix.js", 256);+ _yuitest_coverline("build/matrix/matrix.js", 263); return minors; }, @@ -372,8 +379,8 @@ */ sign: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "sign", 266);-_yuitest_coverline("build/matrix/matrix.js", 268);+ _yuitest_coverfunc("build/matrix/matrix.js", "sign", 273);+_yuitest_coverline("build/matrix/matrix.js", 275); return val === 0 ? 1 : val/Math.abs(val); }, @@ -387,28 +394,28 @@ */ vectorMatrixProduct: function(vector, matrix) {- _yuitest_coverfunc("build/matrix/matrix.js", "vectorMatrixProduct", 279);-_yuitest_coverline("build/matrix/matrix.js", 281);+ _yuitest_coverfunc("build/matrix/matrix.js", "vectorMatrixProduct", 286);+_yuitest_coverline("build/matrix/matrix.js", 288); var i, j, len = vector.length, product = [], rowProduct;- _yuitest_coverline("build/matrix/matrix.js", 286);+ _yuitest_coverline("build/matrix/matrix.js", 293); for(i = 0; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 288);+ _yuitest_coverline("build/matrix/matrix.js", 295); rowProduct = 0;- _yuitest_coverline("build/matrix/matrix.js", 289);+ _yuitest_coverline("build/matrix/matrix.js", 296); for(j = 0; j < len; ++j) {- _yuitest_coverline("build/matrix/matrix.js", 291);+ _yuitest_coverline("build/matrix/matrix.js", 298); rowProduct += vector[i] * matrix[i][j]; }- _yuitest_coverline("build/matrix/matrix.js", 293);+ _yuitest_coverline("build/matrix/matrix.js", 300); product[i] = rowProduct; }- _yuitest_coverline("build/matrix/matrix.js", 295);+ _yuitest_coverline("build/matrix/matrix.js", 302); return product; }, @@ -421,8 +428,8 @@ */ decompose: function(matrix) {- _yuitest_coverfunc("build/matrix/matrix.js", "decompose", 305);-_yuitest_coverline("build/matrix/matrix.js", 307);+ _yuitest_coverfunc("build/matrix/matrix.js", "decompose", 312);+_yuitest_coverline("build/matrix/matrix.js", 314); var a = parseFloat(matrix[0][0]), b = parseFloat(matrix[1][0]), c = parseFloat(matrix[0][1]),@@ -433,42 +440,42 @@ sx, sy, shear;- _yuitest_coverline("build/matrix/matrix.js", 317);+ _yuitest_coverline("build/matrix/matrix.js", 324); if((a * d - b * c) === 0) {- _yuitest_coverline("build/matrix/matrix.js", 319);+ _yuitest_coverline("build/matrix/matrix.js", 326); return false; } //get length of vector(ab)- _yuitest_coverline("build/matrix/matrix.js", 322);+ _yuitest_coverline("build/matrix/matrix.js", 329); sx = MatrixUtil._round(Math.sqrt(a * a + b * b)); //normalize components of vector(ab)- _yuitest_coverline("build/matrix/matrix.js", 324);+ _yuitest_coverline("build/matrix/matrix.js", 331); a /= sx;- _yuitest_coverline("build/matrix/matrix.js", 325);+ _yuitest_coverline("build/matrix/matrix.js", 332); b /= sx;- _yuitest_coverline("build/matrix/matrix.js", 326);+ _yuitest_coverline("build/matrix/matrix.js", 333); shear = MatrixUtil._round(a * c + b * d);- _yuitest_coverline("build/matrix/matrix.js", 327);+ _yuitest_coverline("build/matrix/matrix.js", 334); c -= a * shear;- _yuitest_coverline("build/matrix/matrix.js", 328);+ _yuitest_coverline("build/matrix/matrix.js", 335); d -= b * shear; //get length of vector(cd)- _yuitest_coverline("build/matrix/matrix.js", 330);+ _yuitest_coverline("build/matrix/matrix.js", 337); sy = MatrixUtil._round(Math.sqrt(c * c + d * d)); //normalize components of vector(cd)- _yuitest_coverline("build/matrix/matrix.js", 332);+ _yuitest_coverline("build/matrix/matrix.js", 339); c /= sy;- _yuitest_coverline("build/matrix/matrix.js", 333);+ _yuitest_coverline("build/matrix/matrix.js", 340); d /= sy;- _yuitest_coverline("build/matrix/matrix.js", 334);+ _yuitest_coverline("build/matrix/matrix.js", 341); shear /=sy;- _yuitest_coverline("build/matrix/matrix.js", 335);+ _yuitest_coverline("build/matrix/matrix.js", 342); shear = MatrixUtil._round(MatrixUtil.rad2deg(Math.atan(shear)));- _yuitest_coverline("build/matrix/matrix.js", 336);+ _yuitest_coverline("build/matrix/matrix.js", 343); rotate = MatrixUtil._round(MatrixUtil.rad2deg(Math.atan2(matrix[1][0], matrix[0][0]))); - _yuitest_coverline("build/matrix/matrix.js", 338);+ _yuitest_coverline("build/matrix/matrix.js", 345); return [ ["translate", dx, dy], ["rotate", rotate],@@ -485,8 +492,8 @@ * @return Array */ getTransformArray: function(transform) {- _yuitest_coverfunc("build/matrix/matrix.js", "getTransformArray", 353);-_yuitest_coverline("build/matrix/matrix.js", 354);+ _yuitest_coverfunc("build/matrix/matrix.js", "getTransformArray", 360);+_yuitest_coverline("build/matrix/matrix.js", 361); var re = /\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi, transforms = [], args,@@ -494,40 +501,40 @@ decomp, methods = MatrixUtil.transformMethods; - _yuitest_coverline("build/matrix/matrix.js", 361);+ _yuitest_coverline("build/matrix/matrix.js", 368); while ((m = re.exec(transform))) {- _yuitest_coverline("build/matrix/matrix.js", 362);+ _yuitest_coverline("build/matrix/matrix.js", 369); if (methods.hasOwnProperty(m[1])) {- _yuitest_coverline("build/matrix/matrix.js", 364);+ _yuitest_coverline("build/matrix/matrix.js", 371); args = m[2].split(',');- _yuitest_coverline("build/matrix/matrix.js", 365);+ _yuitest_coverline("build/matrix/matrix.js", 372); args.unshift(m[1]);- _yuitest_coverline("build/matrix/matrix.js", 366);+ _yuitest_coverline("build/matrix/matrix.js", 373); transforms.push(args); }- else {_yuitest_coverline("build/matrix/matrix.js", 368);+ else {_yuitest_coverline("build/matrix/matrix.js", 375); if(m[1] == "matrix") {- _yuitest_coverline("build/matrix/matrix.js", 370);+ _yuitest_coverline("build/matrix/matrix.js", 377); args = m[2].split(',');- _yuitest_coverline("build/matrix/matrix.js", 371);+ _yuitest_coverline("build/matrix/matrix.js", 378); decomp = MatrixUtil.decompose([ [args[0], args[2], args[4]], [args[1], args[3], args[5]], [0, 0, 1] ]);- _yuitest_coverline("build/matrix/matrix.js", 376);+ _yuitest_coverline("build/matrix/matrix.js", 383); transforms.push(decomp[0]);- _yuitest_coverline("build/matrix/matrix.js", 377);+ _yuitest_coverline("build/matrix/matrix.js", 384); transforms.push(decomp[1]);- _yuitest_coverline("build/matrix/matrix.js", 378);+ _yuitest_coverline("build/matrix/matrix.js", 385); transforms.push(decomp[2]);- _yuitest_coverline("build/matrix/matrix.js", 379);+ _yuitest_coverline("build/matrix/matrix.js", 386); transforms.push(decomp[3]); }} }- _yuitest_coverline("build/matrix/matrix.js", 382);+ _yuitest_coverline("build/matrix/matrix.js", 389); return transforms; }, @@ -538,44 +545,44 @@ * @return Array */ getTransformFunctionArray: function(transform) {- _yuitest_coverfunc("build/matrix/matrix.js", "getTransformFunctionArray", 391);-_yuitest_coverline("build/matrix/matrix.js", 392);+ _yuitest_coverfunc("build/matrix/matrix.js", "getTransformFunctionArray", 398);+_yuitest_coverline("build/matrix/matrix.js", 399); var list;- _yuitest_coverline("build/matrix/matrix.js", 393);+ _yuitest_coverline("build/matrix/matrix.js", 400); switch(transform) { case "skew" :- _yuitest_coverline("build/matrix/matrix.js", 396);+ _yuitest_coverline("build/matrix/matrix.js", 403); list = [transform, 0, 0];- _yuitest_coverline("build/matrix/matrix.js", 397);+ _yuitest_coverline("build/matrix/matrix.js", 404); break; case "scale" :- _yuitest_coverline("build/matrix/matrix.js", 399);+ _yuitest_coverline("build/matrix/matrix.js", 406); list = [transform, 1, 1];- _yuitest_coverline("build/matrix/matrix.js", 400);+ _yuitest_coverline("build/matrix/matrix.js", 407); break; case "scaleX" :- _yuitest_coverline("build/matrix/matrix.js", 402);+ _yuitest_coverline("build/matrix/matrix.js", 409); list = [transform, 1];- _yuitest_coverline("build/matrix/matrix.js", 403);+ _yuitest_coverline("build/matrix/matrix.js", 410); break; case "scaleY" :- _yuitest_coverline("build/matrix/matrix.js", 405);+ _yuitest_coverline("build/matrix/matrix.js", 412); list = [transform, 1];- _yuitest_coverline("build/matrix/matrix.js", 406);+ _yuitest_coverline("build/matrix/matrix.js", 413); break; case "translate" :- _yuitest_coverline("build/matrix/matrix.js", 408);+ _yuitest_coverline("build/matrix/matrix.js", 415); list = [transform, 0, 0];- _yuitest_coverline("build/matrix/matrix.js", 409);+ _yuitest_coverline("build/matrix/matrix.js", 416); break; default :- _yuitest_coverline("build/matrix/matrix.js", 411);+ _yuitest_coverline("build/matrix/matrix.js", 418); list = [transform, 0];- _yuitest_coverline("build/matrix/matrix.js", 412);+ _yuitest_coverline("build/matrix/matrix.js", 419); break; }- _yuitest_coverline("build/matrix/matrix.js", 414);+ _yuitest_coverline("build/matrix/matrix.js", 421); return list; }, @@ -590,29 +597,29 @@ */ compareTransformSequence: function(list1, list2) {- _yuitest_coverfunc("build/matrix/matrix.js", "compareTransformSequence", 426);-_yuitest_coverline("build/matrix/matrix.js", 428);+ _yuitest_coverfunc("build/matrix/matrix.js", "compareTransformSequence", 433);+_yuitest_coverline("build/matrix/matrix.js", 435); var i = 0, len = list1.length, len2 = list2.length, isEqual = len === len2;- _yuitest_coverline("build/matrix/matrix.js", 432);+ _yuitest_coverline("build/matrix/matrix.js", 439); if(isEqual) {- _yuitest_coverline("build/matrix/matrix.js", 434);+ _yuitest_coverline("build/matrix/matrix.js", 441); for(; i < len; ++i) {- _yuitest_coverline("build/matrix/matrix.js", 436);+ _yuitest_coverline("build/matrix/matrix.js", 443); if(list1[i][0] != list2[i][0]) {- _yuitest_coverline("build/matrix/matrix.js", 438);+ _yuitest_coverline("build/matrix/matrix.js", 445); isEqual = false;- _yuitest_coverline("build/matrix/matrix.js", 439);+ _yuitest_coverline("build/matrix/matrix.js", 446); break; } } }- _yuitest_coverline("build/matrix/matrix.js", 443);+ _yuitest_coverline("build/matrix/matrix.js", 450); return isEqual; }, @@ -637,7 +644,7 @@ }; -_yuitest_coverline("build/matrix/matrix.js", 467);+_yuitest_coverline("build/matrix/matrix.js", 474); Y.MatrixUtil = MatrixUtil; /**@@ -648,14 +655,14 @@ * @constructor * @module matrix */-_yuitest_coverline("build/matrix/matrix.js", 477);+_yuitest_coverline("build/matrix/matrix.js", 484); var Matrix = function(config) {- _yuitest_coverfunc("build/matrix/matrix.js", "Matrix", 477);-_yuitest_coverline("build/matrix/matrix.js", 478);+ _yuitest_coverfunc("build/matrix/matrix.js", "Matrix", 484);+_yuitest_coverline("build/matrix/matrix.js", 485); this.init(config); }; -_yuitest_coverline("build/matrix/matrix.js", 481);+_yuitest_coverline("build/matrix/matrix.js", 488); Matrix.prototype = { /** * Used as value for the _rounding method.@@ -677,8 +684,8 @@ * @param {Number} dy */ multiply: function(a, b, c, d, dx, dy) {- _yuitest_coverfunc("build/matrix/matrix.js", "multiply", 501);-_yuitest_coverline("build/matrix/matrix.js", 502);+ _yuitest_coverfunc("build/matrix/matrix.js", "multiply", 508);+_yuitest_coverline("build/matrix/matrix.js", 509); var matrix = this, matrix_a = matrix.a * a + matrix.c * b, matrix_b = matrix.b * a + matrix.d * b,@@ -687,19 +694,19 @@ matrix_dx = matrix.a * dx + matrix.c * dy + matrix.dx, matrix_dy = matrix.b * dx + matrix.d * dy + matrix.dy; - _yuitest_coverline("build/matrix/matrix.js", 510);+ _yuitest_coverline("build/matrix/matrix.js", 517); matrix.a = this._round(matrix_a);- _yuitest_coverline("build/matrix/matrix.js", 511);+ _yuitest_coverline("build/matrix/matrix.js", 518); matrix.b = this._round(matrix_b);- _yuitest_coverline("build/matrix/matrix.js", 512);+ _yuitest_coverline("build/matrix/matrix.js", 519); matrix.c = this._round(matrix_c);- _yuitest_coverline("build/matrix/matrix.js", 513);+ _yuitest_coverline("build/matrix/matrix.js", 520); matrix.d = this._round(matrix_d);- _yuitest_coverline("build/matrix/matrix.js", 514);+ _yuitest_coverline("build/matrix/matrix.js", 521); matrix.dx = this._round(matrix_dx);- _yuitest_coverline("build/matrix/matrix.js", 515);+ _yuitest_coverline("build/matrix/matrix.js", 522); matrix.dy = this._round(matrix_dy);- _yuitest_coverline("build/matrix/matrix.js", 516);+ _yuitest_coverline("build/matrix/matrix.js", 523); return this; }, @@ -710,21 +717,21 @@ * @param {String} val A css transform string */ applyCSSText: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "applyCSSText", 525);-_yuitest_coverline("build/matrix/matrix.js", 526);+ _yuitest_coverfunc("build/matrix/matrix.js", "applyCSSText", 532);+_yuitest_coverline("build/matrix/matrix.js", 533); var re = /\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi, args, m; - _yuitest_coverline("build/matrix/matrix.js", 530);+ _yuitest_coverline("build/matrix/matrix.js", 537); val = val.replace(/matrix/g, "multiply");- _yuitest_coverline("build/matrix/matrix.js", 531);+ _yuitest_coverline("build/matrix/matrix.js", 538); while ((m = re.exec(val))) {- _yuitest_coverline("build/matrix/matrix.js", 532);+ _yuitest_coverline("build/matrix/matrix.js", 539); if (typeof this[m[1]] === 'function') {- _yuitest_coverline("build/matrix/matrix.js", 533);+ _yuitest_coverline("build/matrix/matrix.js", 540); args = m[2].split(',');- _yuitest_coverline("build/matrix/matrix.js", 534);+ _yuitest_coverline("build/matrix/matrix.js", 541); this[m[1]].apply(this, args); } }@@ -738,28 +745,28 @@ * @return Array */ getTransformArray: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "getTransformArray", 546);-_yuitest_coverline("build/matrix/matrix.js", 547);+ _yuitest_coverfunc("build/matrix/matrix.js", "getTransformArray", 553);+_yuitest_coverline("build/matrix/matrix.js", 554); var re = /\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi, transforms = [], args, m; - _yuitest_coverline("build/matrix/matrix.js", 552);+ _yuitest_coverline("build/matrix/matrix.js", 559); val = val.replace(/matrix/g, "multiply");- _yuitest_coverline("build/matrix/matrix.js", 553);+ _yuitest_coverline("build/matrix/matrix.js", 560); while ((m = re.exec(val))) {- _yuitest_coverline("build/matrix/matrix.js", 554);+ _yuitest_coverline("build/matrix/matrix.js", 561); if (typeof this[m[1]] === 'function') {- _yuitest_coverline("build/matrix/matrix.js", 555);+ _yuitest_coverline("build/matrix/matrix.js", 562); args = m[2].split(',');- _yuitest_coverline("build/matrix/matrix.js", 556);+ _yuitest_coverline("build/matrix/matrix.js", 563); args.unshift(m[1]);- _yuitest_coverline("build/matrix/matrix.js", 557);+ _yuitest_coverline("build/matrix/matrix.js", 564); transforms.push(args); } }- _yuitest_coverline("build/matrix/matrix.js", 560);+ _yuitest_coverline("build/matrix/matrix.js", 567); return transforms; }, @@ -785,10 +792,10 @@ * @private */ _round: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "_round", 584);-_yuitest_coverline("build/matrix/matrix.js", 585);+ _yuitest_coverfunc("build/matrix/matrix.js", "_round", 591);+_yuitest_coverline("build/matrix/matrix.js", 592); val = Math.round(val * this._rounder) / this._rounder;- _yuitest_coverline("build/matrix/matrix.js", 586);+ _yuitest_coverline("build/matrix/matrix.js", 593); return val; }, @@ -800,25 +807,25 @@ * the default value will be used. */ init: function(config) {- _yuitest_coverfunc("build/matrix/matrix.js", "init", 596);-_yuitest_coverline("build/matrix/matrix.js", 597);+ _yuitest_coverfunc("build/matrix/matrix.js", "init", 603);+_yuitest_coverline("build/matrix/matrix.js", 604); var defaults = this._defaults, prop; - _yuitest_coverline("build/matrix/matrix.js", 600);+ _yuitest_coverline("build/matrix/matrix.js", 607); config = config || {}; - _yuitest_coverline("build/matrix/matrix.js", 602);+ _yuitest_coverline("build/matrix/matrix.js", 609); for (prop in defaults) {- _yuitest_coverline("build/matrix/matrix.js", 603);+ _yuitest_coverline("build/matrix/matrix.js", 610); if(defaults.hasOwnProperty(prop)) {- _yuitest_coverline("build/matrix/matrix.js", 605);+ _yuitest_coverline("build/matrix/matrix.js", 612); this[prop] = (prop in config) ? config[prop] : defaults[prop]; } } - _yuitest_coverline("build/matrix/matrix.js", 609);+ _yuitest_coverline("build/matrix/matrix.js", 616); this._config = config; }, @@ -829,10 +836,10 @@ * @param {Number} val */ scale: function(x, y) {- _yuitest_coverfunc("build/matrix/matrix.js", "scale", 618);-_yuitest_coverline("build/matrix/matrix.js", 619);+ _yuitest_coverfunc("build/matrix/matrix.js", "scale", 625);+_yuitest_coverline("build/matrix/matrix.js", 626); this.multiply(x, 0, 0, y, 0, 0);- _yuitest_coverline("build/matrix/matrix.js", 620);+ _yuitest_coverline("build/matrix/matrix.js", 627); return this; }, @@ -844,28 +851,28 @@ * @param {Number} y The value to skew on the y-axis. */ skew: function(x, y) {- _yuitest_coverfunc("build/matrix/matrix.js", "skew", 630);-_yuitest_coverline("build/matrix/matrix.js", 631);+ _yuitest_coverfunc("build/matrix/matrix.js", "skew", 637);+_yuitest_coverline("build/matrix/matrix.js", 638); x = x || 0;- _yuitest_coverline("build/matrix/matrix.js", 632);+ _yuitest_coverline("build/matrix/matrix.js", 639); y = y || 0; - _yuitest_coverline("build/matrix/matrix.js", 634);+ _yuitest_coverline("build/matrix/matrix.js", 641); if (x !== undefined) { // null or undef- _yuitest_coverline("build/matrix/matrix.js", 635);+ _yuitest_coverline("build/matrix/matrix.js", 642); x = Math.tan(this.angle2rad(x)); } - _yuitest_coverline("build/matrix/matrix.js", 639);+ _yuitest_coverline("build/matrix/matrix.js", 646); if (y !== undefined) { // null or undef- _yuitest_coverline("build/matrix/matrix.js", 640);+ _yuitest_coverline("build/matrix/matrix.js", 647); y = Math.tan(this.angle2rad(y)); } - _yuitest_coverline("build/matrix/matrix.js", 643);+ _yuitest_coverline("build/matrix/matrix.js", 650); this.multiply(1, y, x, 1, 0, 0);- _yuitest_coverline("build/matrix/matrix.js", 644);+ _yuitest_coverline("build/matrix/matrix.js", 651); return this; }, @@ -876,10 +883,10 @@ * @param {Number} x x-coordinate */ skewX: function(x) {- _yuitest_coverfunc("build/matrix/matrix.js", "skewX", 653);-_yuitest_coverline("build/matrix/matrix.js", 654);+ _yuitest_coverfunc("build/matrix/matrix.js", "skewX", 660);+_yuitest_coverline("build/matrix/matrix.js", 661); this.skew(x);- _yuitest_coverline("build/matrix/matrix.js", 655);+ _yuitest_coverline("build/matrix/matrix.js", 662); return this; }, @@ -890,10 +897,10 @@ * @param {Number} y y-coordinate */ skewY: function(y) {- _yuitest_coverfunc("build/matrix/matrix.js", "skewY", 664);-_yuitest_coverline("build/matrix/matrix.js", 665);+ _yuitest_coverfunc("build/matrix/matrix.js", "skewY", 671);+_yuitest_coverline("build/matrix/matrix.js", 672); this.skew(null, y);- _yuitest_coverline("build/matrix/matrix.js", 666);+ _yuitest_coverline("build/matrix/matrix.js", 673); return this; }, @@ -904,8 +911,8 @@ * @return String */ toCSSText: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "toCSSText", 675);-_yuitest_coverline("build/matrix/matrix.js", 676);+ _yuitest_coverfunc("build/matrix/matrix.js", "toCSSText", 682);+_yuitest_coverline("build/matrix/matrix.js", 683); var matrix = this, text = 'matrix(' + matrix.a + ',' + @@ -914,7 +921,7 @@ matrix.d + ',' + matrix.dx + ',' + matrix.dy + ')';- _yuitest_coverline("build/matrix/matrix.js", 684);+ _yuitest_coverline("build/matrix/matrix.js", 691); return text; }, @@ -925,21 +932,21 @@ * @return String */ toFilterText: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "toFilterText", 693);-_yuitest_coverline("build/matrix/matrix.js", 694);+ _yuitest_coverfunc("build/matrix/matrix.js", "toFilterText", 700);+_yuitest_coverline("build/matrix/matrix.js", 701); var matrix = this, text = 'progid:DXImageTransform.Microsoft.Matrix(';- _yuitest_coverline("build/matrix/matrix.js", 696);+ _yuitest_coverline("build/matrix/matrix.js", 703); text += 'M11=' + matrix.a + ',' + 'M21=' + matrix.b + ',' + 'M12=' + matrix.c + ',' + 'M22=' + matrix.d + ',' + 'sizingMethod="auto expand")'; - _yuitest_coverline("build/matrix/matrix.js", 702);+ _yuitest_coverline("build/matrix/matrix.js", 709); text += ''; - _yuitest_coverline("build/matrix/matrix.js", 704);+ _yuitest_coverline("build/matrix/matrix.js", 711); return text; }, @@ -951,10 +958,10 @@ * @return Number */ rad2deg: function(rad) {- _yuitest_coverfunc("build/matrix/matrix.js", "rad2deg", 714);-_yuitest_coverline("build/matrix/matrix.js", 715);+ _yuitest_coverfunc("build/matrix/matrix.js", "rad2deg", 721);+_yuitest_coverline("build/matrix/matrix.js", 722); var deg = rad * (180 / Math.PI);- _yuitest_coverline("build/matrix/matrix.js", 716);+ _yuitest_coverline("build/matrix/matrix.js", 723); return deg; }, @@ -966,25 +973,25 @@ * @return Number */ deg2rad: function(deg) {- _yuitest_coverfunc("build/matrix/matrix.js", "deg2rad", 726);-_yuitest_coverline("build/matrix/matrix.js", 727);+ _yuitest_coverfunc("build/matrix/matrix.js", "deg2rad", 733);+_yuitest_coverline("build/matrix/matrix.js", 734); var rad = deg * (Math.PI / 180);- _yuitest_coverline("build/matrix/matrix.js", 728);+ _yuitest_coverline("build/matrix/matrix.js", 735); return rad; }, angle2rad: function(val) {- _yuitest_coverfunc("build/matrix/matrix.js", "angle2rad", 731);-_yuitest_coverline("build/matrix/matrix.js", 732);+ _yuitest_coverfunc("build/matrix/matrix.js", "angle2rad", 738);+_yuitest_coverline("build/matrix/matrix.js", 739); if (typeof val === 'string' && val.indexOf('rad') > -1) {- _yuitest_coverline("build/matrix/matrix.js", 733);+ _yuitest_coverline("build/matrix/matrix.js", 740); val = parseFloat(val); } else { // default to deg- _yuitest_coverline("build/matrix/matrix.js", 735);+ _yuitest_coverline("build/matrix/matrix.js", 742); val = this.deg2rad(parseFloat(val)); } - _yuitest_coverline("build/matrix/matrix.js", 738);+ _yuitest_coverline("build/matrix/matrix.js", 745); return val; }, @@ -995,14 +1002,14 @@ * @param {Number} deg The degree of the rotation. */ rotate: function(deg, x, y) {- _yuitest_coverfunc("build/matrix/matrix.js", "rotate", 747);-_yuitest_coverline("build/matrix/matrix.js", 748);+ _yuitest_coverfunc("build/matrix/matrix.js", "rotate", 754);+_yuitest_coverline("build/matrix/matrix.js", 755); var rad = this.angle2rad(deg), sin = Math.sin(rad), cos = Math.cos(rad);- _yuitest_coverline("build/matrix/matrix.js", 751);+ _yuitest_coverline("build/matrix/matrix.js", 758); this.multiply(cos, sin, 0 - sin, cos, 0, 0);- _yuitest_coverline("build/matrix/matrix.js", 752);+ _yuitest_coverline("build/matrix/matrix.js", 759); return this; }, @@ -1014,14 +1021,14 @@ * @param {Number} y The value to translate on the y-axis. */ translate: function(x, y) {- _yuitest_coverfunc("build/matrix/matrix.js", "translate", 762);-_yuitest_coverline("build/matrix/matrix.js", 763);+ _yuitest_coverfunc("build/matrix/matrix.js", "translate", 769);+_yuitest_coverline("build/matrix/matrix.js", 770); x = parseFloat(x) || 0;- _yuitest_coverline("build/matrix/matrix.js", 764);+ _yuitest_coverline("build/matrix/matrix.js", 771); y = parseFloat(y) || 0;- _yuitest_coverline("build/matrix/matrix.js", 765);+ _yuitest_coverline("build/matrix/matrix.js", 772); this.multiply(1, 0, 0, 1, x, y);- _yuitest_coverline("build/matrix/matrix.js", 766);+ _yuitest_coverline("build/matrix/matrix.js", 773); return this; }, @@ -1032,10 +1039,10 @@ * @param {Number} x x-coordinate */ translateX: function(x) {- _yuitest_coverfunc("build/matrix/matrix.js", "translateX", 775);-_yuitest_coverline("build/matrix/matrix.js", 776);+ _yuitest_coverfunc("build/matrix/matrix.js", "translateX", 782);+_yuitest_coverline("build/matrix/matrix.js", 783); this.translate(x);- _yuitest_coverline("build/matrix/matrix.js", 777);+ _yuitest_coverline("build/matrix/matrix.js", 784); return this; }, @@ -1046,10 +1053,10 @@ * @param {Number} y y-coordinate */ translateY: function(y) {- _yuitest_coverfunc("build/matrix/matrix.js", "translateY", 786);-_yuitest_coverline("build/matrix/matrix.js", 787);+ _yuitest_coverfunc("build/matrix/matrix.js", "translateY", 793);+_yuitest_coverline("build/matrix/matrix.js", 794); this.translate(null, y);- _yuitest_coverline("build/matrix/matrix.js", 788);+ _yuitest_coverline("build/matrix/matrix.js", 795); return this; }, @@ -1061,21 +1068,21 @@ * @return Object */ identity: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "identity", 798);-_yuitest_coverline("build/matrix/matrix.js", 799);+ _yuitest_coverfunc("build/matrix/matrix.js", "identity", 805);+_yuitest_coverline("build/matrix/matrix.js", 806); var config = this._config, defaults = this._defaults, prop; - _yuitest_coverline("build/matrix/matrix.js", 803);+ _yuitest_coverline("build/matrix/matrix.js", 810); for (prop in config) {- _yuitest_coverline("build/matrix/matrix.js", 804);+ _yuitest_coverline("build/matrix/matrix.js", 811); if (prop in defaults) {- _yuitest_coverline("build/matrix/matrix.js", 805);+ _yuitest_coverline("build/matrix/matrix.js", 812); this[prop] = defaults[prop]; } }- _yuitest_coverline("build/matrix/matrix.js", 808);+ _yuitest_coverline("build/matrix/matrix.js", 815); return this; }, @@ -1093,15 +1100,15 @@ */ getMatrixArray: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "getMatrixArray", 823);-_yuitest_coverline("build/matrix/matrix.js", 825);+ _yuitest_coverfunc("build/matrix/matrix.js", "getMatrixArray", 830);+_yuitest_coverline("build/matrix/matrix.js", 832); var matrix = this, matrixArray = [ [matrix.a, matrix.c, matrix.dx], [matrix.b, matrix.d, matrix.dy], [0, 0, 1] ];- _yuitest_coverline("build/matrix/matrix.js", 831);+ _yuitest_coverline("build/matrix/matrix.js", 838); return matrixArray; }, @@ -1118,8 +1125,8 @@ */ getContentRect: function(width, height, x, y) {- _yuitest_coverfunc("build/matrix/matrix.js", "getContentRect", 845);-_yuitest_coverline("build/matrix/matrix.js", 847);+ _yuitest_coverfunc("build/matrix/matrix.js", "getContentRect", 852);+_yuitest_coverline("build/matrix/matrix.js", 854); var left = !isNaN(x) ? x : 0, top = !isNaN(y) ? y : 0, right = left + width,@@ -1142,7 +1149,7 @@ //[x4, y4] x4 = (a * right + c * bottom + dx), y4 = (b * right + d * bottom + dy);- _yuitest_coverline("build/matrix/matrix.js", 869);+ _yuitest_coverline("build/matrix/matrix.js", 876); return { left: Math.min(x3, Math.min(x1, Math.min(x2, x4))), right: Math.max(x3, Math.max(x1, Math.max(x2, x4))),@@ -1159,8 +1166,8 @@ */ getDeterminant: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "getDeterminant", 883);-_yuitest_coverline("build/matrix/matrix.js", 885);+ _yuitest_coverfunc("build/matrix/matrix.js", "getDeterminant", 890);+_yuitest_coverline("build/matrix/matrix.js", 892); return Y.MatrixUtil.getDeterminant(this.getMatrixArray()); }, @@ -1172,8 +1179,8 @@ */ inverse: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "inverse", 894);-_yuitest_coverline("build/matrix/matrix.js", 896);+ _yuitest_coverfunc("build/matrix/matrix.js", "inverse", 901);+_yuitest_coverline("build/matrix/matrix.js", 903); return Y.MatrixUtil.inverse(this.getMatrixArray()); }, @@ -1185,8 +1192,8 @@ */ transpose: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "transpose", 905);-_yuitest_coverline("build/matrix/matrix.js", 907);+ _yuitest_coverfunc("build/matrix/matrix.js", "transpose", 912);+_yuitest_coverline("build/matrix/matrix.js", 914); return Y.MatrixUtil.transpose(this.getMatrixArray()); }, @@ -1198,14 +1205,14 @@ */ decompose: function() {- _yuitest_coverfunc("build/matrix/matrix.js", "decompose", 916);-_yuitest_coverline("build/matrix/matrix.js", 918);+ _yuitest_coverfunc("build/matrix/matrix.js", "decompose", 923);+_yuitest_coverline("build/matrix/matrix.js", 925); return Y.MatrixUtil.decompose(this.getMatrixArray()); } }; -_yuitest_coverline("build/matrix/matrix.js", 922);+_yuitest_coverline("build/matrix/matrix.js", 929); Y.Matrix = Matrix; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/matrix/matrix-debug.js view
@@ -1,11 +1,18 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('matrix', function (Y, NAME) { +/**+ * Matrix utilities.+ *+ * @class MatrixUtil+ * @module matrix+ **/+ var MatrixUtil = { /** * Used as value for the _rounding method.@@ -928,4 +935,4 @@ Y.Matrix = Matrix; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/matrix/matrix-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("matrix",function(e,t){var n={_rounder:1e5,_round:function(e){return e=Math.round(e*n._rounder)/n._rounder,e},rad2deg:function(e){var t=e*(180/Math.PI);return t},deg2rad:function(e){var t=e*(Math.PI/180);return t},angle2rad:function(e){return typeof e=="string"&&e.indexOf("rad")>-1?e=parseFloat(e):e=n.deg2rad(parseFloat(e)),e},convertTransformToArray:function(e){var t=[[e.a,e.c,e.dx],[e.b,e.d,e.dy],[0,0,1]];return t},getDeterminant:function(e){var t=0,r=e.length,i=0,s;if(r==2)return e[0][0]*e[1][1]-e[0][1]*e[1][0];for(;i<r;++i)s=e[i][0],i%2===0||i===0?t+=s*n.getDeterminant(n.getMinors(e,i,0)):t-=s*n.getDeterminant(n.getMinors(e,i,0));return t},inverse:function(e){var t=0,r=e.length,i=0,s,o,u=[],a=[];if(r===2)t=e[0][0]*e[1][1]-e[0][1]*e[1][0],o=[[e[1][1]*t,-e[1][0]*t],[-e[0][1]*t,e[0][0]*t]];else{t=n.getDeterminant(e);for(;i<r;++i){u[i]=[];for(s=0;s<r;++s)a=n.getMinors(e,s,i),u[i][s]=n.getDeterminant(a),(i+s)%2!==0&&i+s!==0&&(u[i][s]*=-1)}o=n.scalarMultiply(u,1/t)}return o},scalarMultiply:function(e,t){var r=0,i,s=e.length;for(;r<s;++r)for(i=0;i<s;++i)e[r][i]=n._round(e[r][i]*t);return e},transpose:function(e){var t=e.length,n=0,r=0,i=[];for(;n<t;++n){i[n]=[];for(r=0;r<t;++r)i[n].push(e[r][n])}return i},getMinors:function(e,t,n){var r=[],i=e.length,s=0,o,u;for(;s<i;++s)if(s!==t){u=[];for(o=0;o<i;++o)o!==n&&u.push(e[s][o]);r.push(u)}return r},sign:function(e){return e===0?1:e/Math.abs(e)},vectorMatrixProduct:function(e,t){var n,r,i=e.length,s=[],o;for(n=0;n<i;++n){o=0;for(r=0;r<i;++r)o+=e[n]*t[n][r];s[n]=o}return s},decompose:function(e){var t=parseFloat(e[0][0]),r=parseFloat(e[1][0]),i=parseFloat(e[0][1]),s=parseFloat(e[1][1]),o=parseFloat(e[0][2]),u=parseFloat(e[1][2]),a,f,l,c;return t*s-r*i===0?!1:(f=n._round(Math.sqrt(t*t+r*r)),t/=f,r/=f,c=n._round(t*i+r*s),i-=t*c,s-=r*c,l=n._round(Math.sqrt(i*i+s*s)),i/=l,s/=l,c/=l,c=n._round(n.rad2deg(Math.atan(c))),a=n._round(n.rad2deg(Math.atan2(e[1][0],e[0][0]))),[["translate",o,u],["rotate",a],["skewX",c],["scale",f,l]])},getTransformArray:function(e){var t=/\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi,r=[],i,s,o,u=n.transformMethods;while(s=t.exec(e))u.hasOwnProperty(s[1])?(i=s[2].split(","),i.unshift(s[1]),r.push(i)):s[1]=="matrix"&&(i=s[2].split(","),o=n.decompose([[i[0],i[2],i[4]],[i[1],i[3],i[5]],[0,0,1]]),r.push(o[0]),r.push(o[1]),r.push(o[2]),r.push(o[3]));return r},getTransformFunctionArray:function(e){var t;switch(e){case"skew":t=[e,0,0];break;case"scale":t=[e,1,1];break;case"scaleX":t=[e,1];break;case"scaleY":t=[e,1];break;case"translate":t=[e,0,0];break;default:t=[e,0]}return t},compareTransformSequence:function(e,t){var n=0,r=e.length,i=t.length,s=r===i;if(s)for(;n<r;++n)if(e[n][0]!=t[n][0]){s=!1;break}return s},transformMethods:{rotate:"rotate",skew:"skew",skewX:"skewX",skewY:"skewY",translate:"translate",translateX:"translateX",translateY:"tranlsateY",scale:"scale",scaleX:"scaleX",scaleY:"scaleY"}};e.MatrixUtil=n;var r=function(e){this.init(e)};r.prototype={_rounder:1e5,multiply:function(e,t,n,r,i,s){var o=this,u=o.a*e+o.c*t,a=o.b*e+o.d*t,f=o.a*n+o.c*r,l=o.b*n+o.d*r,c=o.a*i+o.c*s+o.dx,h=o.b*i+o.d*s+o.dy;return o.a=this._round(u),o.b=this._round(a),o.c=this._round(f),o.d=this._round(l),o.dx=this._round(c),o.dy=this._round(h),this},applyCSSText:function(e){var t=/\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi,n,r;e=e.replace(/matrix/g,"multiply");while(r=t.exec(e))typeof this[r[1]]=="function"&&(n=r[2].split(","),this[r[1]].apply(this,n))},getTransformArray:function(e){var t=/\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi,n=[],r,i;e=e.replace(/matrix/g,"multiply");while(i=t.exec(e))typeof this[i[1]]=="function"&&(r=i[2].split(","),r.unshift(i[1]),n.push(r));return n},_defaults:{a:1,b:0,c:0,d:1,dx:0,dy:0},_round:function(e){return e=Math.round(e*this._rounder)/this._rounder,e},init:function(e){var t=this._defaults,n;e=e||{};for(n in t)t.hasOwnProperty(n)&&(this[n]=n in e?e[n]:t[n]);this._config=e},scale:function(e,t){return this.multiply(e,0,0,t,0,0),this},skew:function(e,t){return e=e||0,t=t||0,e!==undefined&&(e=Math.tan(this.angle2rad(e))),t!==undefined&&(t=Math.tan(this.angle2rad(t))),this.multiply(1,t,e,1,0,0),this},skewX:function(e){return this.skew(e),this},skewY:function(e){return this.skew(null,e),this},toCSSText:function(){var e=this,t="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.dx+","+e.dy+")";return t},toFilterText:function(){var e=this,t="progid:DXImageTransform.Microsoft.Matrix(";return t+="M11="+e.a+","+"M21="+e.b+","+"M12="+e.c+","+"M22="+e.d+","+'sizingMethod="auto expand")',t+="",t},rad2deg:function(e){var t=e*(180/Math.PI);return t},deg2rad:function(e){var t=e*(Math.PI/180);return t},angle2rad:function(e){return typeof e=="string"&&e.indexOf("rad")>-1?e=parseFloat(e):e=this.deg2rad(parseFloat(e)),e},rotate:function(e,t,n){var r=this.angle2rad(e),i=Math.sin(r),s=Math.cos(r);return this.multiply(s,i,0-i,s,0,0),this},translate:function(e,t){return e=parseFloat(e)||0,t=parseFloat(t)||0,this.multiply(1,0,0,1,e,t),this},translateX:function(e){return this.translate(e),this},translateY:function(e){return this.translate(null,e),this},identity:function(){var e=this._config,t=this._defaults,n;for(n in e)n in t&&(this[n]=t[n]);return this},getMatrixArray:function(){var e=this,t=[[e.a,e.c,e.dx],[e.b,e.d,e.dy],[0,0,1]];return t},getContentRect:function(e,t,n,r){var i=isNaN(n)?0:n,s=isNaN(r)?0:r,o=i+e,u=s+t,a=this,f=a.a,l=a.b,c=a.c,h=a.d,p=a.dx,d=a.dy,v=f*i+c*s+p,m=l*i+h*s+d,g=f*o+c*s+p,y=l*o+h*s+d,b=f*i+c*u+p,w=l*i+h*u+d,E=f*o+c*u+p,S=l*o+h*u+d;return{left:Math.min(b,Math.min(v,Math.min(g,E))),right:Math.max(b,Math.max(v,Math.max(g,E))),top:Math.min(y,Math.min(S,Math.min(w,m))),bottom:Math.max(y,Math.max(S,Math.max(w,m)))}},getDeterminant:function(){return e.MatrixUtil.getDeterminant(this.getMatrixArray())},inverse:function(){return e.MatrixUtil.inverse(this.getMatrixArray())},transpose:function(){return e.MatrixUtil.transpose(this.getMatrixArray())},decompose:function(){return e.MatrixUtil.decompose(this.getMatrixArray())}},e.Matrix=r},"3.7.2",{requires:["yui-base"]});+YUI.add("matrix",function(e,t){var n={_rounder:1e5,_round:function(e){return e=Math.round(e*n._rounder)/n._rounder,e},rad2deg:function(e){var t=e*(180/Math.PI);return t},deg2rad:function(e){var t=e*(Math.PI/180);return t},angle2rad:function(e){return typeof e=="string"&&e.indexOf("rad")>-1?e=parseFloat(e):e=n.deg2rad(parseFloat(e)),e},convertTransformToArray:function(e){var t=[[e.a,e.c,e.dx],[e.b,e.d,e.dy],[0,0,1]];return t},getDeterminant:function(e){var t=0,r=e.length,i=0,s;if(r==2)return e[0][0]*e[1][1]-e[0][1]*e[1][0];for(;i<r;++i)s=e[i][0],i%2===0||i===0?t+=s*n.getDeterminant(n.getMinors(e,i,0)):t-=s*n.getDeterminant(n.getMinors(e,i,0));return t},inverse:function(e){var t=0,r=e.length,i=0,s,o,u=[],a=[];if(r===2)t=e[0][0]*e[1][1]-e[0][1]*e[1][0],o=[[e[1][1]*t,-e[1][0]*t],[-e[0][1]*t,e[0][0]*t]];else{t=n.getDeterminant(e);for(;i<r;++i){u[i]=[];for(s=0;s<r;++s)a=n.getMinors(e,s,i),u[i][s]=n.getDeterminant(a),(i+s)%2!==0&&i+s!==0&&(u[i][s]*=-1)}o=n.scalarMultiply(u,1/t)}return o},scalarMultiply:function(e,t){var r=0,i,s=e.length;for(;r<s;++r)for(i=0;i<s;++i)e[r][i]=n._round(e[r][i]*t);return e},transpose:function(e){var t=e.length,n=0,r=0,i=[];for(;n<t;++n){i[n]=[];for(r=0;r<t;++r)i[n].push(e[r][n])}return i},getMinors:function(e,t,n){var r=[],i=e.length,s=0,o,u;for(;s<i;++s)if(s!==t){u=[];for(o=0;o<i;++o)o!==n&&u.push(e[s][o]);r.push(u)}return r},sign:function(e){return e===0?1:e/Math.abs(e)},vectorMatrixProduct:function(e,t){var n,r,i=e.length,s=[],o;for(n=0;n<i;++n){o=0;for(r=0;r<i;++r)o+=e[n]*t[n][r];s[n]=o}return s},decompose:function(e){var t=parseFloat(e[0][0]),r=parseFloat(e[1][0]),i=parseFloat(e[0][1]),s=parseFloat(e[1][1]),o=parseFloat(e[0][2]),u=parseFloat(e[1][2]),a,f,l,c;return t*s-r*i===0?!1:(f=n._round(Math.sqrt(t*t+r*r)),t/=f,r/=f,c=n._round(t*i+r*s),i-=t*c,s-=r*c,l=n._round(Math.sqrt(i*i+s*s)),i/=l,s/=l,c/=l,c=n._round(n.rad2deg(Math.atan(c))),a=n._round(n.rad2deg(Math.atan2(e[1][0],e[0][0]))),[["translate",o,u],["rotate",a],["skewX",c],["scale",f,l]])},getTransformArray:function(e){var t=/\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi,r=[],i,s,o,u=n.transformMethods;while(s=t.exec(e))u.hasOwnProperty(s[1])?(i=s[2].split(","),i.unshift(s[1]),r.push(i)):s[1]=="matrix"&&(i=s[2].split(","),o=n.decompose([[i[0],i[2],i[4]],[i[1],i[3],i[5]],[0,0,1]]),r.push(o[0]),r.push(o[1]),r.push(o[2]),r.push(o[3]));return r},getTransformFunctionArray:function(e){var t;switch(e){case"skew":t=[e,0,0];break;case"scale":t=[e,1,1];break;case"scaleX":t=[e,1];break;case"scaleY":t=[e,1];break;case"translate":t=[e,0,0];break;default:t=[e,0]}return t},compareTransformSequence:function(e,t){var n=0,r=e.length,i=t.length,s=r===i;if(s)for(;n<r;++n)if(e[n][0]!=t[n][0]){s=!1;break}return s},transformMethods:{rotate:"rotate",skew:"skew",skewX:"skewX",skewY:"skewY",translate:"translate",translateX:"translateX",translateY:"tranlsateY",scale:"scale",scaleX:"scaleX",scaleY:"scaleY"}};e.MatrixUtil=n;var r=function(e){this.init(e)};r.prototype={_rounder:1e5,multiply:function(e,t,n,r,i,s){var o=this,u=o.a*e+o.c*t,a=o.b*e+o.d*t,f=o.a*n+o.c*r,l=o.b*n+o.d*r,c=o.a*i+o.c*s+o.dx,h=o.b*i+o.d*s+o.dy;return o.a=this._round(u),o.b=this._round(a),o.c=this._round(f),o.d=this._round(l),o.dx=this._round(c),o.dy=this._round(h),this},applyCSSText:function(e){var t=/\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi,n,r;e=e.replace(/matrix/g,"multiply");while(r=t.exec(e))typeof this[r[1]]=="function"&&(n=r[2].split(","),this[r[1]].apply(this,n))},getTransformArray:function(e){var t=/\s*([a-z]*)\(([\w,\.,\-,\s]*)\)/gi,n=[],r,i;e=e.replace(/matrix/g,"multiply");while(i=t.exec(e))typeof this[i[1]]=="function"&&(r=i[2].split(","),r.unshift(i[1]),n.push(r));return n},_defaults:{a:1,b:0,c:0,d:1,dx:0,dy:0},_round:function(e){return e=Math.round(e*this._rounder)/this._rounder,e},init:function(e){var t=this._defaults,n;e=e||{};for(n in t)t.hasOwnProperty(n)&&(this[n]=n in e?e[n]:t[n]);this._config=e},scale:function(e,t){return this.multiply(e,0,0,t,0,0),this},skew:function(e,t){return e=e||0,t=t||0,e!==undefined&&(e=Math.tan(this.angle2rad(e))),t!==undefined&&(t=Math.tan(this.angle2rad(t))),this.multiply(1,t,e,1,0,0),this},skewX:function(e){return this.skew(e),this},skewY:function(e){return this.skew(null,e),this},toCSSText:function(){var e=this,t="matrix("+e.a+","+e.b+","+e.c+","+e.d+","+e.dx+","+e.dy+")";return t},toFilterText:function(){var e=this,t="progid:DXImageTransform.Microsoft.Matrix(";return t+="M11="+e.a+","+"M21="+e.b+","+"M12="+e.c+","+"M22="+e.d+","+'sizingMethod="auto expand")',t+="",t},rad2deg:function(e){var t=e*(180/Math.PI);return t},deg2rad:function(e){var t=e*(Math.PI/180);return t},angle2rad:function(e){return typeof e=="string"&&e.indexOf("rad")>-1?e=parseFloat(e):e=this.deg2rad(parseFloat(e)),e},rotate:function(e,t,n){var r=this.angle2rad(e),i=Math.sin(r),s=Math.cos(r);return this.multiply(s,i,0-i,s,0,0),this},translate:function(e,t){return e=parseFloat(e)||0,t=parseFloat(t)||0,this.multiply(1,0,0,1,e,t),this},translateX:function(e){return this.translate(e),this},translateY:function(e){return this.translate(null,e),this},identity:function(){var e=this._config,t=this._defaults,n;for(n in e)n in t&&(this[n]=t[n]);return this},getMatrixArray:function(){var e=this,t=[[e.a,e.c,e.dx],[e.b,e.d,e.dy],[0,0,1]];return t},getContentRect:function(e,t,n,r){var i=isNaN(n)?0:n,s=isNaN(r)?0:r,o=i+e,u=s+t,a=this,f=a.a,l=a.b,c=a.c,h=a.d,p=a.dx,d=a.dy,v=f*i+c*s+p,m=l*i+h*s+d,g=f*o+c*s+p,y=l*o+h*s+d,b=f*i+c*u+p,w=l*i+h*u+d,E=f*o+c*u+p,S=l*o+h*u+d;return{left:Math.min(b,Math.min(v,Math.min(g,E))),right:Math.max(b,Math.max(v,Math.max(g,E))),top:Math.min(y,Math.min(S,Math.min(w,m))),bottom:Math.max(y,Math.max(S,Math.max(w,m)))}},getDeterminant:function(){return e.MatrixUtil.getDeterminant(this.getMatrixArray())},inverse:function(){return e.MatrixUtil.inverse(this.getMatrixArray())},transpose:function(){return e.MatrixUtil.transpose(this.getMatrixArray())},decompose:function(){return e.MatrixUtil.decompose(this.getMatrixArray())}},e.Matrix=r},"3.7.3",{requires:["yui-base"]});
bundle/matrix/matrix.js view
@@ -1,11 +1,18 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add('matrix', function (Y, NAME) { +/**+ * Matrix utilities.+ *+ * @class MatrixUtil+ * @module matrix+ **/+ var MatrixUtil = { /** * Used as value for the _rounding method.@@ -928,4 +935,4 @@ Y.Matrix = Matrix; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/model-list/model-list-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/model-list/model-list.js", code: [] };-_yuitest_coverage["build/model-list/model-list.js"].code=["YUI.add('model-list', function (Y, NAME) {","","/**","Provides an API for managing an ordered list of Model instances.","","@module app","@submodule model-list","@since 3.4.0","**/","","/**","Provides an API for managing an ordered list of Model instances.","","In addition to providing convenient `add`, `create`, `reset`, and `remove`","methods for managing the models in the list, ModelLists are also bubble targets","for events on the model instances they contain. This means, for example, that","you can add several models to a list, and then subscribe to the `*:change` event","on the list to be notified whenever any model in the list changes.","","ModelLists also maintain sort order efficiently as models are added and removed,","based on a custom `comparator` function you may define (if no comparator is","defined, models are sorted in insertion order).","","@class ModelList","@extends Base","@uses ArrayList","@constructor","@param {Object} config Config options."," @param {Model|Model[]|ModelList|Object|Object[]} config.items Model"," instance, array of model instances, or ModelList to add to this list on"," init. The `add` event will not be fired for models added on init.","@since 3.4.0","**/","","var AttrProto = Y.Attribute.prototype,"," Lang = Y.Lang,"," YArray = Y.Array,",""," /**"," Fired when a model is added to the list.",""," Listen to the `on` phase of this event to be notified before a model is"," added to the list. Calling `e.preventDefault()` during the `on` phase will"," prevent the model from being added.",""," Listen to the `after` phase of this event to be notified after a model has"," been added to the list.",""," @event add"," @param {Model} model The model being added."," @param {Number} index The index at which the model will be added."," @preventable _defAddFn"," **/"," EVT_ADD = 'add',",""," /**"," Fired when a model is created or updated via the `create()` method, but"," before the model is actually saved or added to the list. The `add` event"," will be fired after the model has been saved and added to the list.",""," @event create"," @param {Model} model The model being created/updated."," @since 3.5.0"," **/"," EVT_CREATE = 'create',",""," /**"," Fired when an error occurs, such as when an attempt is made to add a"," duplicate model to the list, or when a sync layer response can't be parsed.",""," @event error"," @param {Any} error Error message, object, or exception generated by the"," error. Calling `toString()` on this should result in a meaningful error"," message."," @param {String} src Source of the error. May be one of the following (or any"," custom error source defined by a ModelList subclass):",""," * `add`: Error while adding a model (probably because it's already in the"," list and can't be added again). The model in question will be provided"," as the `model` property on the event facade."," * `parse`: An error parsing a JSON response. The response in question will"," be provided as the `response` property on the event facade."," * `remove`: Error while removing a model (probably because it isn't in the"," list and can't be removed). The model in question will be provided as"," the `model` property on the event facade."," **/"," EVT_ERROR = 'error',",""," /**"," Fired after models are loaded from a sync layer.",""," @event load"," @param {Object} parsed The parsed version of the sync layer's response to"," the load request."," @param {Mixed} response The sync layer's raw, unparsed response to the load"," request."," @since 3.5.0"," **/"," EVT_LOAD = 'load',",""," /**"," Fired when a model is removed from the list.",""," Listen to the `on` phase of this event to be notified before a model is"," removed from the list. Calling `e.preventDefault()` during the `on` phase"," will prevent the model from being removed.",""," Listen to the `after` phase of this event to be notified after a model has"," been removed from the list.",""," @event remove"," @param {Model} model The model being removed."," @param {Number} index The index of the model being removed."," @preventable _defRemoveFn"," **/"," EVT_REMOVE = 'remove',",""," /**"," Fired when the list is completely reset via the `reset()` method or sorted"," via the `sort()` method.",""," Listen to the `on` phase of this event to be notified before the list is"," reset. Calling `e.preventDefault()` during the `on` phase will prevent"," the list from being reset.",""," Listen to the `after` phase of this event to be notified after the list has"," been reset.",""," @event reset"," @param {Model[]} models Array of the list's new models after the reset."," @param {String} src Source of the event. May be either `'reset'` or"," `'sort'`."," @preventable _defResetFn"," **/"," EVT_RESET = 'reset';","","function ModelList() {"," ModelList.superclass.constructor.apply(this, arguments);","}","","Y.ModelList = Y.extend(ModelList, Y.Base, {"," // -- Public Properties ----------------------------------------------------",""," /**"," The `Model` class or subclass of the models in this list.",""," The class specified here will be used to create model instances"," automatically based on attribute hashes passed to the `add()`, `create()`,"," and `reset()` methods.",""," You may specify the class as an actual class reference or as a string that"," resolves to a class reference at runtime (the latter can be useful if the"," specified class will be loaded lazily).",""," @property model"," @type Model|String"," @default Y.Model"," **/"," model: Y.Model,",""," // -- Protected Properties -------------------------------------------------",""," /**"," Total hack to allow us to identify ModelList instances without using"," `instanceof`, which won't work when the instance was created in another"," window or YUI sandbox.",""," @property _isYUIModelList"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _isYUIModelList: true,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," var model = this.model = config.model || this.model;",""," if (typeof model === 'string') {"," // Look for a namespaced Model class on `Y`."," this.model = Y.Object.getValue(Y, model.split('.'));",""," if (!this.model) {"," Y.error('ModelList: Model class not found: ' + model);"," }"," }",""," this.publish(EVT_ADD, {defaultFn: this._defAddFn});"," this.publish(EVT_RESET, {defaultFn: this._defResetFn});"," this.publish(EVT_REMOVE, {defaultFn: this._defRemoveFn});",""," this.after('*:idChange', this._afterIdChange);",""," this._clear();",""," if (config.items) {"," this.add(config.items, {silent: true});"," }"," },",""," destructor: function () {"," this._clear();"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Adds the specified model or array of models to this list. You may also pass"," another ModelList instance, in which case all the models in that list will"," be added to this one as well.",""," @example",""," // Add a single model instance."," list.add(new Model({foo: 'bar'}));",""," // Add a single model, creating a new instance automatically."," list.add({foo: 'bar'});",""," // Add multiple models, creating new instances automatically."," list.add(["," {foo: 'bar'},"," {baz: 'quux'}"," ]);",""," // Add all the models in another ModelList instance."," list.add(otherList);",""," @method add"," @param {Model|Model[]|ModelList|Object|Object[]} models Model or array of"," models to add. May be existing model instances or hashes of model"," attributes, in which case new model instances will be created from the"," hashes. You may also pass a ModelList instance to add all the models it"," contains."," @param {Object} [options] Data to be mixed into the event facade of the"," `add` event(s) for the added models.",""," @param {Number} [options.index] Index at which to insert the added"," models. If not specified, the models will automatically be inserted"," in the appropriate place according to the current sort order as"," dictated by the `comparator()` method, if any."," @param {Boolean} [options.silent=false] If `true`, no `add` event(s)"," will be fired.",""," @return {Model|Model[]} Added model or array of added models."," **/"," add: function (models, options) {"," var isList = models._isYUIModelList;",""," if (isList || Lang.isArray(models)) {"," return YArray.map(isList ? models.toArray() : models, function (model, index) {"," var modelOptions = options || {};",""," // When an explicit insertion index is specified, ensure that"," // the index is increased by one for each subsequent item in the"," // array."," if ('index' in modelOptions) {"," modelOptions = Y.merge(modelOptions, {"," index: modelOptions.index + index"," });"," }",""," return this._add(model, modelOptions);"," }, this);"," } else {"," return this._add(models, options);"," }"," },",""," /**"," Define this method to provide a function that takes a model as a parameter"," and returns a value by which that model should be sorted relative to other"," models in this list.",""," By default, no comparator is defined, meaning that models will not be sorted"," (they'll be stored in the order they're added).",""," @example"," var list = new Y.ModelList({model: Y.Model});",""," list.comparator = function (model) {"," return model.get('id'); // Sort models by id."," };",""," @method comparator"," @param {Model} model Model being sorted."," @return {Number|String} Value by which the model should be sorted relative"," to other models in this list."," **/",""," // comparator is not defined by default",""," /**"," Creates or updates the specified model on the server, then adds it to this"," list if the server indicates success.",""," @method create"," @param {Model|Object} model Model to create. May be an existing model"," instance or a hash of model attributes, in which case a new model instance"," will be created from the hash."," @param {Object} [options] Options to be passed to the model's `sync()` and"," `set()` methods and mixed into the `create` and `add` event facades."," @param {Boolean} [options.silent=false] If `true`, no `add` event(s) will"," be fired."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} callback.response The server's response."," @return {Model} Created model."," **/"," create: function (model, options, callback) {"," var self = this;",""," // Allow callback as second arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," if (!model._isYUIModel) {"," model = new this.model(model);"," }",""," self.fire(EVT_CREATE, Y.merge(options, {"," model: model"," }));",""," return model.save(options, function (err) {"," if (!err) {"," self.add(model, options);"," }",""," callback && callback.apply(null, arguments);"," });"," },",""," /**"," Executes the supplied function on each model in this list.",""," By default, the callback function's `this` object will refer to the model"," currently being iterated. Specify a `thisObj` to override the `this` object"," if desired.",""," Note: Iteration is performed on a copy of the internal array of models, so"," it's safe to delete a model from the list during iteration.",""," @method each"," @param {Function} callback Function to execute on each model."," @param {Model} callback.model Model instance."," @param {Number} callback.index Index of the current model."," @param {ModelList} callback.list The ModelList being iterated."," @param {Object} [thisObj] Object to use as the `this` object when executing"," the callback."," @chainable"," @since 3.6.0"," **/"," each: function (callback, thisObj) {"," var items = this._items.concat(),"," i, item, len;",""," for (i = 0, len = items.length; i < len; i++) {"," item = items[i];"," callback.call(thisObj || item, item, i, this);"," }",""," return this;"," },",""," /**"," Executes the supplied function on each model in this list. Returns an array"," containing the models for which the supplied function returned a truthy"," value.",""," The callback function's `this` object will refer to this ModelList. Use"," `Y.bind()` to bind the `this` object to another object if desired.",""," @example",""," // Get an array containing only the models whose \"enabled\" attribute is"," // truthy."," var filtered = list.filter(function (model) {"," return model.get('enabled');"," });",""," // Get a new ModelList containing only the models whose \"enabled\""," // attribute is truthy."," var filteredList = list.filter({asList: true}, function (model) {"," return model.get('enabled');"," });",""," @method filter"," @param {Object} [options] Filter options."," @param {Boolean} [options.asList=false] If truthy, results will be"," returned as a new ModelList instance rather than as an array.",""," @param {Function} callback Function to execute on each model."," @param {Model} callback.model Model instance."," @param {Number} callback.index Index of the current model."," @param {ModelList} callback.list The ModelList being filtered.",""," @return {Array|ModelList} Array of models for which the callback function"," returned a truthy value (empty if it never returned a truthy value). If"," the `options.asList` option is truthy, a new ModelList instance will be"," returned instead of an array."," @since 3.5.0"," */"," filter: function (options, callback) {"," var filtered = [],"," items = this._items,"," i, item, len, list;",""," // Allow options as first arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," for (i = 0, len = items.length; i < len; ++i) {"," item = items[i];",""," if (callback.call(this, item, i, this)) {"," filtered.push(item);"," }"," }",""," if (options.asList) {"," list = new this.constructor({model: this.model});",""," if (filtered.length) {"," list.add(filtered, {silent: true});"," }",""," return list;"," } else {"," return filtered;"," }"," },",""," /**"," If _name_ refers to an attribute on this ModelList instance, returns the"," value of that attribute. Otherwise, returns an array containing the values"," of the specified attribute from each model in this list.",""," @method get"," @param {String} name Attribute name or object property path."," @return {Any|Array} Attribute value or array of attribute values."," @see Model.get()"," **/"," get: function (name) {"," if (this.attrAdded(name)) {"," return AttrProto.get.apply(this, arguments);"," }",""," return this.invoke('get', name);"," },",""," /**"," If _name_ refers to an attribute on this ModelList instance, returns the"," HTML-escaped value of that attribute. Otherwise, returns an array containing"," the HTML-escaped values of the specified attribute from each model in this"," list.",""," The values are escaped using `Escape.html()`.",""," @method getAsHTML"," @param {String} name Attribute name or object property path."," @return {String|String[]} HTML-escaped value or array of HTML-escaped"," values."," @see Model.getAsHTML()"," **/"," getAsHTML: function (name) {"," if (this.attrAdded(name)) {"," return Y.Escape.html(AttrProto.get.apply(this, arguments));"," }",""," return this.invoke('getAsHTML', name);"," },",""," /**"," If _name_ refers to an attribute on this ModelList instance, returns the"," URL-encoded value of that attribute. Otherwise, returns an array containing"," the URL-encoded values of the specified attribute from each model in this"," list.",""," The values are encoded using the native `encodeURIComponent()` function.",""," @method getAsURL"," @param {String} name Attribute name or object property path."," @return {String|String[]} URL-encoded value or array of URL-encoded values."," @see Model.getAsURL()"," **/"," getAsURL: function (name) {"," if (this.attrAdded(name)) {"," return encodeURIComponent(AttrProto.get.apply(this, arguments));"," }",""," return this.invoke('getAsURL', name);"," },",""," /**"," Returns the model with the specified _clientId_, or `null` if not found.",""," @method getByClientId"," @param {String} clientId Client id."," @return {Model} Model, or `null` if not found."," **/"," getByClientId: function (clientId) {"," return this._clientIdMap[clientId] || null;"," },",""," /**"," Returns the model with the specified _id_, or `null` if not found.",""," Note that models aren't expected to have an id until they're saved, so if"," you're working with unsaved models, it may be safer to call"," `getByClientId()`.",""," @method getById"," @param {String|Number} id Model id."," @return {Model} Model, or `null` if not found."," **/"," getById: function (id) {"," return this._idMap[id] || null;"," },",""," /**"," Calls the named method on every model in the list. Any arguments provided"," after _name_ will be passed on to the invoked method.",""," @method invoke"," @param {String} name Name of the method to call on each model."," @param {Any} [args*] Zero or more arguments to pass to the invoked method."," @return {Array} Array of return values, indexed according to the index of"," the model on which the method was called."," **/"," invoke: function (name /*, args* */) {"," var args = [this._items, name].concat(YArray(arguments, 1, true));"," return YArray.invoke.apply(YArray, args);"," },",""," /**"," Returns the model at the specified _index_.",""," @method item"," @param {Number} index Index of the model to fetch."," @return {Model} The model at the specified index, or `undefined` if there"," isn't a model there."," **/",""," // item() is inherited from ArrayList.",""," /**"," Loads this list of models from the server.",""," This method delegates to the `sync()` method to perform the actual load"," operation, which is an asynchronous action. Specify a _callback_ function to"," be notified of success or failure.",""," If the load operation succeeds, a `reset` event will be fired.",""," @method load"," @param {Object} [options] Options to be passed to `sync()` and to"," `reset()` when adding the loaded models. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an array of model attribute hashes."," @chainable"," **/"," load: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," this.sync('read', options, function (err, response) {"," var facade = {"," options : options,"," response: response"," },",""," parsed;",""," if (err) {"," facade.error = err;"," facade.src = 'load';",""," self.fire(EVT_ERROR, facade);"," } else {"," // Lazy publish."," if (!self._loadEvent) {"," self._loadEvent = self.publish(EVT_LOAD, {"," preventable: false"," });"," }",""," parsed = facade.parsed = self._parse(response);",""," self.reset(parsed, options);"," self.fire(EVT_LOAD, facade);"," }",""," callback && callback.apply(null, arguments);"," });",""," return this;"," },",""," /**"," Executes the specified function on each model in this list and returns an"," array of the function's collected return values.",""," @method map"," @param {Function} fn Function to execute on each model."," @param {Model} fn.model Current model being iterated."," @param {Number} fn.index Index of the current model in the list."," @param {Model[]} fn.models Array of models being iterated."," @param {Object} [thisObj] `this` object to use when calling _fn_."," @return {Array} Array of return values from _fn_."," **/"," map: function (fn, thisObj) {"," return YArray.map(this._items, fn, thisObj);"," },",""," /**"," Called to parse the _response_ when the list is loaded from the server."," This method receives a server _response_ and is expected to return an array"," of model attribute hashes.",""," The default implementation assumes that _response_ is either an array of"," attribute hashes or a JSON string that can be parsed into an array of"," attribute hashes. If _response_ is a JSON string and either `Y.JSON` or the"," native `JSON` object are available, it will be parsed automatically. If a"," parse error occurs, an `error` event will be fired and the model will not be"," updated.",""," You may override this method to implement custom parsing logic if necessary.",""," @method parse"," @param {Any} response Server response."," @return {Object[]} Array of model attribute hashes."," **/"," parse: function (response) {"," if (typeof response === 'string') {"," try {"," return Y.JSON.parse(response) || [];"," } catch (ex) {"," this.fire(EVT_ERROR, {"," error : ex,"," response: response,"," src : 'parse'"," });",""," return null;"," }"," }",""," return response || [];"," },",""," /**"," Removes the specified model or array of models from this list. You may also"," pass another ModelList instance to remove all the models that are in both"," that instance and this instance, or pass numerical indices to remove the"," models at those indices.",""," @method remove"," @param {Model|Model[]|ModelList|Number|Number[]} models Models or indices of"," models to remove."," @param {Object} [options] Data to be mixed into the event facade of the"," `remove` event(s) for the removed models.",""," @param {Boolean} [options.silent=false] If `true`, no `remove` event(s)"," will be fired.",""," @return {Model|Model[]} Removed model or array of removed models."," **/"," remove: function (models, options) {"," var isList = models._isYUIModelList;",""," if (isList || Lang.isArray(models)) {"," // We can't remove multiple models by index because the indices will"," // change as we remove them, so we need to get the actual models"," // first."," models = YArray.map(isList ? models.toArray() : models, function (model) {"," if (Lang.isNumber(model)) {"," return this.item(model);"," }",""," return model;"," }, this);",""," return YArray.map(models, function (model) {"," return this._remove(model, options);"," }, this);"," } else {"," return this._remove(models, options);"," }"," },",""," /**"," Completely replaces all models in the list with those specified, and fires a"," single `reset` event.",""," Use `reset` when you want to add or remove a large number of items at once"," with less overhead, and without firing `add` or `remove` events for each"," one.",""," @method reset"," @param {Model[]|ModelList|Object[]} [models] Models to add. May be existing"," model instances or hashes of model attributes, in which case new model"," instances will be created from the hashes. If a ModelList is passed, all"," the models in that list will be added to this list. Calling `reset()`"," without passing in any models will clear the list."," @param {Object} [options] Data to be mixed into the event facade of the"," `reset` event.",""," @param {Boolean} [options.silent=false] If `true`, no `reset` event will"," be fired.",""," @chainable"," **/"," reset: function (models, options) {"," models || (models = []);"," options || (options = {});",""," var facade = Y.merge({src: 'reset'}, options);",""," if (models._isYUIModelList) {"," models = models.toArray();"," } else {"," models = YArray.map(models, function (model) {"," return model._isYUIModel ? model : new this.model(model);"," }, this);"," }",""," facade.models = models;",""," if (options.silent) {"," this._defResetFn(facade);"," } else {"," // Sort the models before firing the reset event."," if (this.comparator) {"," models.sort(Y.bind(this._sort, this));"," }",""," this.fire(EVT_RESET, facade);"," }",""," return this;"," },",""," /**"," Executes the supplied function on each model in this list, and stops"," iterating if the callback returns `true`.",""," By default, the callback function's `this` object will refer to the model"," currently being iterated. Specify a `thisObj` to override the `this` object"," if desired.",""," Note: Iteration is performed on a copy of the internal array of models, so"," it's safe to delete a model from the list during iteration.",""," @method some"," @param {Function} callback Function to execute on each model."," @param {Model} callback.model Model instance."," @param {Number} callback.index Index of the current model."," @param {ModelList} callback.list The ModelList being iterated."," @param {Object} [thisObj] Object to use as the `this` object when executing"," the callback."," @return {Boolean} `true` if the callback returned `true` for any item,"," `false` otherwise."," @since 3.6.0"," **/"," some: function (callback, thisObj) {"," var items = this._items.concat(),"," i, item, len;",""," for (i = 0, len = items.length; i < len; i++) {"," item = items[i];",""," if (callback.call(thisObj || item, item, i, this)) {"," return true;"," }"," }",""," return false;"," },",""," /**"," Forcibly re-sorts the list.",""," Usually it shouldn't be necessary to call this method since the list"," maintains its sort order when items are added and removed, but if you change"," the `comparator` function after items are already in the list, you'll need"," to re-sort.",""," @method sort"," @param {Object} [options] Data to be mixed into the event facade of the"," `reset` event."," @param {Boolean} [options.silent=false] If `true`, no `reset` event will"," be fired."," @chainable"," **/"," sort: function (options) {"," if (!this.comparator) {"," return this;"," }",""," var models = this._items.concat(),"," facade;",""," options || (options = {});",""," models.sort(Y.bind(this._sort, this));",""," facade = Y.merge(options, {"," models: models,"," src : 'sort'"," });",""," options.silent ? this._defResetFn(facade) :"," this.fire(EVT_RESET, facade);",""," return this;"," },",""," /**"," Override this method to provide a custom persistence implementation for this"," list. The default method just calls the callback without actually doing"," anything.",""," This method is called internally by `load()`.",""," @method sync"," @param {String} action Sync action to perform. May be one of the following:",""," * `create`: Store a list of newly-created models for the first time."," * `delete`: Delete a list of existing models."," * `read` : Load a list of existing models."," * `update`: Update a list of existing models.",""," Currently, model lists only make use of the `read` action, but other"," actions may be used in future versions.",""," @param {Object} [options] Sync options. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} [callback.response] The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an array of model attribute hashes."," **/"," sync: function (/* action, options, callback */) {"," var callback = YArray(arguments, 0, true).pop();",""," if (typeof callback === 'function') {"," callback();"," }"," },",""," /**"," Returns an array containing the models in this list.",""," @method toArray"," @return {Array} Array containing the models in this list."," **/"," toArray: function () {"," return this._items.concat();"," },",""," /**"," Returns an array containing attribute hashes for each model in this list,"," suitable for being passed to `Y.JSON.stringify()`.",""," Under the hood, this method calls `toJSON()` on each model in the list and"," pushes the results into an array.",""," @method toJSON"," @return {Object[]} Array of model attribute hashes."," @see Model.toJSON()"," **/"," toJSON: function () {"," return this.map(function (model) {"," return model.toJSON();"," });"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Adds the specified _model_ if it isn't already in this list.",""," If the model's `clientId` or `id` matches that of a model that's already in"," the list, an `error` event will be fired and the model will not be added.",""," @method _add"," @param {Model|Object} model Model or object to add."," @param {Object} [options] Data to be mixed into the event facade of the"," `add` event for the added model."," @param {Boolean} [options.silent=false] If `true`, no `add` event will be"," fired."," @return {Model} The added model."," @protected"," **/"," _add: function (model, options) {"," var facade, id;",""," options || (options = {});",""," if (!model._isYUIModel) {"," model = new this.model(model);"," }",""," id = model.get('id');",""," if (this._clientIdMap[model.get('clientId')]"," || (Lang.isValue(id) && this._idMap[id])) {",""," this.fire(EVT_ERROR, {"," error: 'Model is already in the list.',"," model: model,"," src : 'add'"," });",""," return;"," }",""," facade = Y.merge(options, {"," index: 'index' in options ? options.index : this._findIndex(model),"," model: model"," });",""," options.silent ? this._defAddFn(facade) : this.fire(EVT_ADD, facade);",""," return model;"," },",""," /**"," Adds this list as a bubble target for the specified model's events.",""," @method _attachList"," @param {Model} model Model to attach to this list."," @protected"," **/"," _attachList: function (model) {"," // Attach this list and make it a bubble target for the model."," model.lists.push(this);"," model.addTarget(this);"," },",""," /**"," Clears all internal state and the internal list of models, returning this"," list to an empty state. Automatically detaches all models in the list.",""," @method _clear"," @protected"," **/"," _clear: function () {"," YArray.each(this._items, this._detachList, this);",""," this._clientIdMap = {};"," this._idMap = {};"," this._items = [];"," },",""," /**"," Compares the value _a_ to the value _b_ for sorting purposes. Values are"," assumed to be the result of calling a model's `comparator()` method. You can"," override this method to implement custom sorting logic, such as a descending"," sort or multi-field sorting.",""," @method _compare"," @param {Mixed} a First value to compare."," @param {Mixed} b Second value to compare."," @return {Number} `-1` if _a_ should come before _b_, `0` if they're"," equivalent, `1` if _a_ should come after _b_."," @protected"," @since 3.5.0"," **/"," _compare: function (a, b) {"," return a < b ? -1 : (a > b ? 1 : 0);"," },",""," /**"," Removes this list as a bubble target for the specified model's events.",""," @method _detachList"," @param {Model} model Model to detach."," @protected"," **/"," _detachList: function (model) {"," var index = YArray.indexOf(model.lists, this);",""," if (index > -1) {"," model.lists.splice(index, 1);"," model.removeTarget(this);"," }"," },",""," /**"," Returns the index at which the given _model_ should be inserted to maintain"," the sort order of the list.",""," @method _findIndex"," @param {Model} model The model being inserted."," @return {Number} Index at which the model should be inserted."," @protected"," **/"," _findIndex: function (model) {"," var items = this._items,"," max = items.length,"," min = 0,"," item, middle, needle;",""," if (!this.comparator || !max) {"," return max;"," }",""," needle = this.comparator(model);",""," // Perform an iterative binary search to determine the correct position"," // based on the return value of the `comparator` function."," while (min < max) {"," middle = (min + max) >> 1; // Divide by two and discard remainder."," item = items[middle];",""," if (this._compare(this.comparator(item), needle) < 0) {"," min = middle + 1;"," } else {"," max = middle;"," }"," }",""," return min;"," },",""," /**"," Calls the public, overrideable `parse()` method and returns the result.",""," Override this method to provide a custom pre-parsing implementation. This"," provides a hook for custom persistence implementations to \"prep\" a response"," before calling the `parse()` method.",""," @method _parse"," @param {Any} response Server response."," @return {Object[]} Array of model attribute hashes."," @protected"," @see ModelList.parse()"," @since 3.7.0"," **/"," _parse: function (response) {"," return this.parse(response);"," },",""," /**"," Removes the specified _model_ if it's in this list.",""," @method _remove"," @param {Model|Number} model Model or index of the model to remove."," @param {Object} [options] Data to be mixed into the event facade of the"," `remove` event for the removed model."," @param {Boolean} [options.silent=false] If `true`, no `remove` event will"," be fired."," @return {Model} Removed model."," @protected"," **/"," _remove: function (model, options) {"," var index, facade;",""," options || (options = {});",""," if (Lang.isNumber(model)) {"," index = model;"," model = this.item(index);"," } else {"," index = this.indexOf(model);"," }",""," if (index === -1 || !model) {"," this.fire(EVT_ERROR, {"," error: 'Model is not in the list.',"," index: index,"," model: model,"," src : 'remove'"," });",""," return;"," }",""," facade = Y.merge(options, {"," index: index,"," model: model"," });",""," options.silent ? this._defRemoveFn(facade) :"," this.fire(EVT_REMOVE, facade);",""," return model;"," },",""," /**"," Array sort function used by `sort()` to re-sort the models in the list.",""," @method _sort"," @param {Model} a First model to compare."," @param {Model} b Second model to compare."," @return {Number} `-1` if _a_ is less than _b_, `0` if equal, `1` if greater."," @protected"," **/"," _sort: function (a, b) {"," return this._compare(this.comparator(a), this.comparator(b));"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Updates the model maps when a model's `id` attribute changes.",""," @method _afterIdChange"," @param {EventFacade} e"," @protected"," **/"," _afterIdChange: function (e) {"," var newVal = e.newVal,"," prevVal = e.prevVal,"," target = e.target;",""," if (Lang.isValue(prevVal)) {"," if (this._idMap[prevVal] === target) {"," delete this._idMap[prevVal];"," } else {"," // The model that changed isn't in this list. Probably just a"," // bubbled change event from a nested Model List."," return;"," }"," } else {"," // The model had no previous id. Verify that it exists in this list"," // before continuing."," if (this.indexOf(target) === -1) {"," return;"," }"," }",""," if (Lang.isValue(newVal)) {"," this._idMap[newVal] = target;"," }"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Default event handler for `add` events.",""," @method _defAddFn"," @param {EventFacade} e"," @protected"," **/"," _defAddFn: function (e) {"," var model = e.model,"," id = model.get('id');",""," this._clientIdMap[model.get('clientId')] = model;",""," if (Lang.isValue(id)) {"," this._idMap[id] = model;"," }",""," this._attachList(model);"," this._items.splice(e.index, 0, model);"," },",""," /**"," Default event handler for `remove` events.",""," @method _defRemoveFn"," @param {EventFacade} e"," @protected"," **/"," _defRemoveFn: function (e) {"," var model = e.model,"," id = model.get('id');",""," this._detachList(model);"," delete this._clientIdMap[model.get('clientId')];",""," if (Lang.isValue(id)) {"," delete this._idMap[id];"," }",""," this._items.splice(e.index, 1);"," },",""," /**"," Default event handler for `reset` events.",""," @method _defResetFn"," @param {EventFacade} e"," @protected"," **/"," _defResetFn: function (e) {"," // When fired from the `sort` method, we don't need to clear the list or"," // add any models, since the existing models are sorted in place."," if (e.src === 'sort') {"," this._items = e.models.concat();"," return;"," }",""," this._clear();",""," if (e.models.length) {"," this.add(e.models, {silent: true});"," }"," }","}, {"," NAME: 'modelList'","});","","Y.augment(ModelList, Y.ArrayList);","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"array-invoke\", \"arraylist\", \"base-build\", \"escape\", \"json-parse\", \"model\"]});"];+_yuitest_coverage["build/model-list/model-list.js"].code=["YUI.add('model-list', function (Y, NAME) {","","/**","Provides an API for managing an ordered list of Model instances.","","@module app","@submodule model-list","@since 3.4.0","**/","","/**","Provides an API for managing an ordered list of Model instances.","","In addition to providing convenient `add`, `create`, `reset`, and `remove`","methods for managing the models in the list, ModelLists are also bubble targets","for events on the model instances they contain. This means, for example, that","you can add several models to a list, and then subscribe to the `*:change` event","on the list to be notified whenever any model in the list changes.","","ModelLists also maintain sort order efficiently as models are added and removed,","based on a custom `comparator` function you may define (if no comparator is","defined, models are sorted in insertion order).","","@class ModelList","@extends Base","@uses ArrayList","@constructor","@param {Object} config Config options."," @param {Model|Model[]|ModelList|Object|Object[]} config.items Model"," instance, array of model instances, or ModelList to add to this list on"," init. The `add` event will not be fired for models added on init.","@since 3.4.0","**/","","var AttrProto = Y.Attribute.prototype,"," Lang = Y.Lang,"," YArray = Y.Array,",""," /**"," Fired when a model is added to the list.",""," Listen to the `on` phase of this event to be notified before a model is"," added to the list. Calling `e.preventDefault()` during the `on` phase will"," prevent the model from being added.",""," Listen to the `after` phase of this event to be notified after a model has"," been added to the list.",""," @event add"," @param {Model} model The model being added."," @param {Number} index The index at which the model will be added."," @preventable _defAddFn"," **/"," EVT_ADD = 'add',",""," /**"," Fired when a model is created or updated via the `create()` method, but"," before the model is actually saved or added to the list. The `add` event"," will be fired after the model has been saved and added to the list.",""," @event create"," @param {Model} model The model being created/updated."," @since 3.5.0"," **/"," EVT_CREATE = 'create',",""," /**"," Fired when an error occurs, such as when an attempt is made to add a"," duplicate model to the list, or when a sync layer response can't be parsed.",""," @event error"," @param {Any} error Error message, object, or exception generated by the"," error. Calling `toString()` on this should result in a meaningful error"," message."," @param {String} src Source of the error. May be one of the following (or any"," custom error source defined by a ModelList subclass):",""," * `add`: Error while adding a model (probably because it's already in the"," list and can't be added again). The model in question will be provided"," as the `model` property on the event facade."," * `parse`: An error parsing a JSON response. The response in question will"," be provided as the `response` property on the event facade."," * `remove`: Error while removing a model (probably because it isn't in the"," list and can't be removed). The model in question will be provided as"," the `model` property on the event facade."," **/"," EVT_ERROR = 'error',",""," /**"," Fired after models are loaded from a sync layer.",""," @event load"," @param {Object} parsed The parsed version of the sync layer's response to"," the load request."," @param {Mixed} response The sync layer's raw, unparsed response to the load"," request."," @since 3.5.0"," **/"," EVT_LOAD = 'load',",""," /**"," Fired when a model is removed from the list.",""," Listen to the `on` phase of this event to be notified before a model is"," removed from the list. Calling `e.preventDefault()` during the `on` phase"," will prevent the model from being removed.",""," Listen to the `after` phase of this event to be notified after a model has"," been removed from the list.",""," @event remove"," @param {Model} model The model being removed."," @param {Number} index The index of the model being removed."," @preventable _defRemoveFn"," **/"," EVT_REMOVE = 'remove',",""," /**"," Fired when the list is completely reset via the `reset()` method or sorted"," via the `sort()` method.",""," Listen to the `on` phase of this event to be notified before the list is"," reset. Calling `e.preventDefault()` during the `on` phase will prevent"," the list from being reset.",""," Listen to the `after` phase of this event to be notified after the list has"," been reset.",""," @event reset"," @param {Model[]} models Array of the list's new models after the reset."," @param {String} src Source of the event. May be either `'reset'` or"," `'sort'`."," @preventable _defResetFn"," **/"," EVT_RESET = 'reset';","","function ModelList() {"," ModelList.superclass.constructor.apply(this, arguments);","}","","Y.ModelList = Y.extend(ModelList, Y.Base, {"," // -- Public Properties ----------------------------------------------------",""," /**"," The `Model` class or subclass of the models in this list.",""," The class specified here will be used to create model instances"," automatically based on attribute hashes passed to the `add()`, `create()`,"," and `reset()` methods.",""," You may specify the class as an actual class reference or as a string that"," resolves to a class reference at runtime (the latter can be useful if the"," specified class will be loaded lazily).",""," @property model"," @type Model|String"," @default Y.Model"," **/"," model: Y.Model,",""," // -- Protected Properties -------------------------------------------------",""," /**"," Total hack to allow us to identify ModelList instances without using"," `instanceof`, which won't work when the instance was created in another"," window or YUI sandbox.",""," @property _isYUIModelList"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _isYUIModelList: true,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," var model = this.model = config.model || this.model;",""," if (typeof model === 'string') {"," // Look for a namespaced Model class on `Y`."," this.model = Y.Object.getValue(Y, model.split('.'));",""," if (!this.model) {"," Y.error('ModelList: Model class not found: ' + model);"," }"," }",""," this.publish(EVT_ADD, {defaultFn: this._defAddFn});"," this.publish(EVT_RESET, {defaultFn: this._defResetFn});"," this.publish(EVT_REMOVE, {defaultFn: this._defRemoveFn});",""," this.after('*:idChange', this._afterIdChange);",""," this._clear();",""," if (config.items) {"," this.add(config.items, {silent: true});"," }"," },",""," destructor: function () {"," this._clear();"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Adds the specified model or array of models to this list. You may also pass"," another ModelList instance, in which case all the models in that list will"," be added to this one as well.",""," @example",""," // Add a single model instance."," list.add(new Model({foo: 'bar'}));",""," // Add a single model, creating a new instance automatically."," list.add({foo: 'bar'});",""," // Add multiple models, creating new instances automatically."," list.add(["," {foo: 'bar'},"," {baz: 'quux'}"," ]);",""," // Add all the models in another ModelList instance."," list.add(otherList);",""," @method add"," @param {Model|Model[]|ModelList|Object|Object[]} models Model or array of"," models to add. May be existing model instances or hashes of model"," attributes, in which case new model instances will be created from the"," hashes. You may also pass a ModelList instance to add all the models it"," contains."," @param {Object} [options] Data to be mixed into the event facade of the"," `add` event(s) for the added models.",""," @param {Number} [options.index] Index at which to insert the added"," models. If not specified, the models will automatically be inserted"," in the appropriate place according to the current sort order as"," dictated by the `comparator()` method, if any."," @param {Boolean} [options.silent=false] If `true`, no `add` event(s)"," will be fired.",""," @return {Model|Model[]} Added model or array of added models."," **/"," add: function (models, options) {"," var isList = models._isYUIModelList;",""," if (isList || Lang.isArray(models)) {"," return YArray.map(isList ? models.toArray() : models, function (model, index) {"," var modelOptions = options || {};",""," // When an explicit insertion index is specified, ensure that"," // the index is increased by one for each subsequent item in the"," // array."," if ('index' in modelOptions) {"," modelOptions = Y.merge(modelOptions, {"," index: modelOptions.index + index"," });"," }",""," return this._add(model, modelOptions);"," }, this);"," } else {"," return this._add(models, options);"," }"," },",""," /**"," Define this method to provide a function that takes a model as a parameter"," and returns a value by which that model should be sorted relative to other"," models in this list.",""," By default, no comparator is defined, meaning that models will not be sorted"," (they'll be stored in the order they're added).",""," @example"," var list = new Y.ModelList({model: Y.Model});",""," list.comparator = function (model) {"," return model.get('id'); // Sort models by id."," };",""," @method comparator"," @param {Model} model Model being sorted."," @return {Number|String} Value by which the model should be sorted relative"," to other models in this list."," **/",""," // comparator is not defined by default",""," /**"," Creates or updates the specified model on the server, then adds it to this"," list if the server indicates success.",""," @method create"," @param {Model|Object} model Model to create. May be an existing model"," instance or a hash of model attributes, in which case a new model instance"," will be created from the hash."," @param {Object} [options] Options to be passed to the model's `sync()` and"," `set()` methods and mixed into the `create` and `add` event facades."," @param {Boolean} [options.silent=false] If `true`, no `add` event(s) will"," be fired."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} callback.response The server's response."," @return {Model} Created model."," **/"," create: function (model, options, callback) {"," var self = this;",""," // Allow callback as second arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," if (!model._isYUIModel) {"," model = new this.model(model);"," }",""," self.fire(EVT_CREATE, Y.merge(options, {"," model: model"," }));",""," return model.save(options, function (err) {"," if (!err) {"," self.add(model, options);"," }",""," callback && callback.apply(null, arguments);"," });"," },",""," /**"," Executes the supplied function on each model in this list.",""," By default, the callback function's `this` object will refer to the model"," currently being iterated. Specify a `thisObj` to override the `this` object"," if desired.",""," Note: Iteration is performed on a copy of the internal array of models, so"," it's safe to delete a model from the list during iteration.",""," @method each"," @param {Function} callback Function to execute on each model."," @param {Model} callback.model Model instance."," @param {Number} callback.index Index of the current model."," @param {ModelList} callback.list The ModelList being iterated."," @param {Object} [thisObj] Object to use as the `this` object when executing"," the callback."," @chainable"," @since 3.6.0"," **/"," each: function (callback, thisObj) {"," var items = this._items.concat(),"," i, item, len;",""," for (i = 0, len = items.length; i < len; i++) {"," item = items[i];"," callback.call(thisObj || item, item, i, this);"," }",""," return this;"," },",""," /**"," Executes the supplied function on each model in this list. Returns an array"," containing the models for which the supplied function returned a truthy"," value.",""," The callback function's `this` object will refer to this ModelList. Use"," `Y.bind()` to bind the `this` object to another object if desired.",""," @example",""," // Get an array containing only the models whose \"enabled\" attribute is"," // truthy."," var filtered = list.filter(function (model) {"," return model.get('enabled');"," });",""," // Get a new ModelList containing only the models whose \"enabled\""," // attribute is truthy."," var filteredList = list.filter({asList: true}, function (model) {"," return model.get('enabled');"," });",""," @method filter"," @param {Object} [options] Filter options."," @param {Boolean} [options.asList=false] If truthy, results will be"," returned as a new ModelList instance rather than as an array.",""," @param {Function} callback Function to execute on each model."," @param {Model} callback.model Model instance."," @param {Number} callback.index Index of the current model."," @param {ModelList} callback.list The ModelList being filtered.",""," @return {Array|ModelList} Array of models for which the callback function"," returned a truthy value (empty if it never returned a truthy value). If"," the `options.asList` option is truthy, a new ModelList instance will be"," returned instead of an array."," @since 3.5.0"," */"," filter: function (options, callback) {"," var filtered = [],"," items = this._items,"," i, item, len, list;",""," // Allow options as first arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," for (i = 0, len = items.length; i < len; ++i) {"," item = items[i];",""," if (callback.call(this, item, i, this)) {"," filtered.push(item);"," }"," }",""," if (options.asList) {"," list = new this.constructor({model: this.model});",""," if (filtered.length) {"," list.add(filtered, {silent: true});"," }",""," return list;"," } else {"," return filtered;"," }"," },",""," /**"," If _name_ refers to an attribute on this ModelList instance, returns the"," value of that attribute. Otherwise, returns an array containing the values"," of the specified attribute from each model in this list.",""," @method get"," @param {String} name Attribute name or object property path."," @return {Any|Array} Attribute value or array of attribute values."," @see Model.get()"," **/"," get: function (name) {"," if (this.attrAdded(name)) {"," return AttrProto.get.apply(this, arguments);"," }",""," return this.invoke('get', name);"," },",""," /**"," If _name_ refers to an attribute on this ModelList instance, returns the"," HTML-escaped value of that attribute. Otherwise, returns an array containing"," the HTML-escaped values of the specified attribute from each model in this"," list.",""," The values are escaped using `Escape.html()`.",""," @method getAsHTML"," @param {String} name Attribute name or object property path."," @return {String|String[]} HTML-escaped value or array of HTML-escaped"," values."," @see Model.getAsHTML()"," **/"," getAsHTML: function (name) {"," if (this.attrAdded(name)) {"," return Y.Escape.html(AttrProto.get.apply(this, arguments));"," }",""," return this.invoke('getAsHTML', name);"," },",""," /**"," If _name_ refers to an attribute on this ModelList instance, returns the"," URL-encoded value of that attribute. Otherwise, returns an array containing"," the URL-encoded values of the specified attribute from each model in this"," list.",""," The values are encoded using the native `encodeURIComponent()` function.",""," @method getAsURL"," @param {String} name Attribute name or object property path."," @return {String|String[]} URL-encoded value or array of URL-encoded values."," @see Model.getAsURL()"," **/"," getAsURL: function (name) {"," if (this.attrAdded(name)) {"," return encodeURIComponent(AttrProto.get.apply(this, arguments));"," }",""," return this.invoke('getAsURL', name);"," },",""," /**"," Returns the model with the specified _clientId_, or `null` if not found.",""," @method getByClientId"," @param {String} clientId Client id."," @return {Model} Model, or `null` if not found."," **/"," getByClientId: function (clientId) {"," return this._clientIdMap[clientId] || null;"," },",""," /**"," Returns the model with the specified _id_, or `null` if not found.",""," Note that models aren't expected to have an id until they're saved, so if"," you're working with unsaved models, it may be safer to call"," `getByClientId()`.",""," @method getById"," @param {String|Number} id Model id."," @return {Model} Model, or `null` if not found."," **/"," getById: function (id) {"," return this._idMap[id] || null;"," },",""," /**"," Calls the named method on every model in the list. Any arguments provided"," after _name_ will be passed on to the invoked method.",""," @method invoke"," @param {String} name Name of the method to call on each model."," @param {Any} [args*] Zero or more arguments to pass to the invoked method."," @return {Array} Array of return values, indexed according to the index of"," the model on which the method was called."," **/"," invoke: function (name /*, args* */) {"," var args = [this._items, name].concat(YArray(arguments, 1, true));"," return YArray.invoke.apply(YArray, args);"," },",""," /**"," Returns the model at the specified _index_.",""," @method item"," @param {Number} index Index of the model to fetch."," @return {Model} The model at the specified index, or `undefined` if there"," isn't a model there."," **/",""," // item() is inherited from ArrayList.",""," /**"," Loads this list of models from the server.",""," This method delegates to the `sync()` method to perform the actual load"," operation, which is an asynchronous action. Specify a _callback_ function to"," be notified of success or failure.",""," If the load operation succeeds, a `reset` event will be fired.",""," @method load"," @param {Object} [options] Options to be passed to `sync()` and to"," `reset()` when adding the loaded models. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an array of model attribute hashes."," @chainable"," **/"," load: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," this.sync('read', options, function (err, response) {"," var facade = {"," options : options,"," response: response"," },",""," parsed;",""," if (err) {"," facade.error = err;"," facade.src = 'load';",""," self.fire(EVT_ERROR, facade);"," } else {"," // Lazy publish."," if (!self._loadEvent) {"," self._loadEvent = self.publish(EVT_LOAD, {"," preventable: false"," });"," }",""," parsed = facade.parsed = self._parse(response);",""," self.reset(parsed, options);"," self.fire(EVT_LOAD, facade);"," }",""," callback && callback.apply(null, arguments);"," });",""," return this;"," },",""," /**"," Executes the specified function on each model in this list and returns an"," array of the function's collected return values.",""," @method map"," @param {Function} fn Function to execute on each model."," @param {Model} fn.model Current model being iterated."," @param {Number} fn.index Index of the current model in the list."," @param {Model[]} fn.models Array of models being iterated."," @param {Object} [thisObj] `this` object to use when calling _fn_."," @return {Array} Array of return values from _fn_."," **/"," map: function (fn, thisObj) {"," return YArray.map(this._items, fn, thisObj);"," },",""," /**"," Called to parse the _response_ when the list is loaded from the server."," This method receives a server _response_ and is expected to return an array"," of model attribute hashes.",""," The default implementation assumes that _response_ is either an array of"," attribute hashes or a JSON string that can be parsed into an array of"," attribute hashes. If _response_ is a JSON string and either `Y.JSON` or the"," native `JSON` object are available, it will be parsed automatically. If a"," parse error occurs, an `error` event will be fired and the model will not be"," updated.",""," You may override this method to implement custom parsing logic if necessary.",""," @method parse"," @param {Any} response Server response."," @return {Object[]} Array of model attribute hashes."," **/"," parse: function (response) {"," if (typeof response === 'string') {"," try {"," return Y.JSON.parse(response) || [];"," } catch (ex) {"," this.fire(EVT_ERROR, {"," error : ex,"," response: response,"," src : 'parse'"," });",""," return null;"," }"," }",""," return response || [];"," },",""," /**"," Removes the specified model or array of models from this list. You may also"," pass another ModelList instance to remove all the models that are in both"," that instance and this instance, or pass numerical indices to remove the"," models at those indices.",""," @method remove"," @param {Model|Model[]|ModelList|Number|Number[]} models Models or indices of"," models to remove."," @param {Object} [options] Data to be mixed into the event facade of the"," `remove` event(s) for the removed models.",""," @param {Boolean} [options.silent=false] If `true`, no `remove` event(s)"," will be fired.",""," @return {Model|Model[]} Removed model or array of removed models."," **/"," remove: function (models, options) {"," var isList = models._isYUIModelList;",""," if (isList || Lang.isArray(models)) {"," // We can't remove multiple models by index because the indices will"," // change as we remove them, so we need to get the actual models"," // first."," models = YArray.map(isList ? models.toArray() : models, function (model) {"," if (Lang.isNumber(model)) {"," return this.item(model);"," }",""," return model;"," }, this);",""," return YArray.map(models, function (model) {"," return this._remove(model, options);"," }, this);"," } else {"," return this._remove(models, options);"," }"," },",""," /**"," Completely replaces all models in the list with those specified, and fires a"," single `reset` event.",""," Use `reset` when you want to add or remove a large number of items at once"," with less overhead, and without firing `add` or `remove` events for each"," one.",""," @method reset"," @param {Model[]|ModelList|Object[]} [models] Models to add. May be existing"," model instances or hashes of model attributes, in which case new model"," instances will be created from the hashes. If a ModelList is passed, all"," the models in that list will be added to this list. Calling `reset()`"," without passing in any models will clear the list."," @param {Object} [options] Data to be mixed into the event facade of the"," `reset` event.",""," @param {Boolean} [options.silent=false] If `true`, no `reset` event will"," be fired.",""," @chainable"," **/"," reset: function (models, options) {"," models || (models = []);"," options || (options = {});",""," var facade = Y.merge({src: 'reset'}, options);",""," if (models._isYUIModelList) {"," models = models.toArray();"," } else {"," models = YArray.map(models, function (model) {"," return model._isYUIModel ? model : new this.model(model);"," }, this);"," }",""," facade.models = models;",""," if (options.silent) {"," this._defResetFn(facade);"," } else {"," // Sort the models before firing the reset event."," if (this.comparator) {"," models.sort(Y.bind(this._sort, this));"," }",""," this.fire(EVT_RESET, facade);"," }",""," return this;"," },",""," /**"," Executes the supplied function on each model in this list, and stops"," iterating if the callback returns `true`.",""," By default, the callback function's `this` object will refer to the model"," currently being iterated. Specify a `thisObj` to override the `this` object"," if desired.",""," Note: Iteration is performed on a copy of the internal array of models, so"," it's safe to delete a model from the list during iteration.",""," @method some"," @param {Function} callback Function to execute on each model."," @param {Model} callback.model Model instance."," @param {Number} callback.index Index of the current model."," @param {ModelList} callback.list The ModelList being iterated."," @param {Object} [thisObj] Object to use as the `this` object when executing"," the callback."," @return {Boolean} `true` if the callback returned `true` for any item,"," `false` otherwise."," @since 3.6.0"," **/"," some: function (callback, thisObj) {"," var items = this._items.concat(),"," i, item, len;",""," for (i = 0, len = items.length; i < len; i++) {"," item = items[i];",""," if (callback.call(thisObj || item, item, i, this)) {"," return true;"," }"," }",""," return false;"," },",""," /**"," Forcibly re-sorts the list.",""," Usually it shouldn't be necessary to call this method since the list"," maintains its sort order when items are added and removed, but if you change"," the `comparator` function after items are already in the list, you'll need"," to re-sort.",""," @method sort"," @param {Object} [options] Data to be mixed into the event facade of the"," `reset` event."," @param {Boolean} [options.silent=false] If `true`, no `reset` event will"," be fired."," @chainable"," **/"," sort: function (options) {"," if (!this.comparator) {"," return this;"," }",""," var models = this._items.concat(),"," facade;",""," options || (options = {});",""," models.sort(Y.bind(this._sort, this));",""," facade = Y.merge(options, {"," models: models,"," src : 'sort'"," });",""," options.silent ? this._defResetFn(facade) :"," this.fire(EVT_RESET, facade);",""," return this;"," },",""," /**"," Override this method to provide a custom persistence implementation for this"," list. The default method just calls the callback without actually doing"," anything.",""," This method is called internally by `load()`.",""," @method sync"," @param {String} action Sync action to perform. May be one of the following:",""," * `create`: Store a list of newly-created models for the first time."," * `delete`: Delete a list of existing models."," * `read` : Load a list of existing models."," * `update`: Update a list of existing models.",""," Currently, model lists only make use of the `read` action, but other"," actions may be used in future versions.",""," @param {Object} [options] Sync options. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} [callback.response] The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an array of model attribute hashes."," **/"," sync: function (/* action, options, callback */) {"," var callback = YArray(arguments, 0, true).pop();",""," if (typeof callback === 'function') {"," callback();"," }"," },",""," /**"," Returns an array containing the models in this list.",""," @method toArray"," @return {Array} Array containing the models in this list."," **/"," toArray: function () {"," return this._items.concat();"," },",""," /**"," Returns an array containing attribute hashes for each model in this list,"," suitable for being passed to `Y.JSON.stringify()`.",""," Under the hood, this method calls `toJSON()` on each model in the list and"," pushes the results into an array.",""," @method toJSON"," @return {Object[]} Array of model attribute hashes."," @see Model.toJSON()"," **/"," toJSON: function () {"," return this.map(function (model) {"," return model.toJSON();"," });"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Adds the specified _model_ if it isn't already in this list.",""," If the model's `clientId` or `id` matches that of a model that's already in"," the list, an `error` event will be fired and the model will not be added.",""," @method _add"," @param {Model|Object} model Model or object to add."," @param {Object} [options] Data to be mixed into the event facade of the"," `add` event for the added model."," @param {Boolean} [options.silent=false] If `true`, no `add` event will be"," fired."," @return {Model} The added model."," @protected"," **/"," _add: function (model, options) {"," var facade, id;",""," options || (options = {});",""," if (!model._isYUIModel) {"," model = new this.model(model);"," }",""," id = model.get('id');",""," if (this._clientIdMap[model.get('clientId')]"," || (Lang.isValue(id) && this._idMap[id])) {",""," this.fire(EVT_ERROR, {"," error: 'Model is already in the list.',"," model: model,"," src : 'add'"," });",""," return;"," }",""," facade = Y.merge(options, {"," index: 'index' in options ? options.index : this._findIndex(model),"," model: model"," });",""," options.silent ? this._defAddFn(facade) : this.fire(EVT_ADD, facade);",""," return model;"," },",""," /**"," Adds this list as a bubble target for the specified model's events.",""," @method _attachList"," @param {Model} model Model to attach to this list."," @protected"," **/"," _attachList: function (model) {"," // Attach this list and make it a bubble target for the model."," model.lists.push(this);"," model.addTarget(this);"," },",""," /**"," Clears all internal state and the internal list of models, returning this"," list to an empty state. Automatically detaches all models in the list.",""," @method _clear"," @protected"," **/"," _clear: function () {"," YArray.each(this._items, this._detachList, this);",""," this._clientIdMap = {};"," this._idMap = {};"," this._items = [];"," },",""," /**"," Compares the value _a_ to the value _b_ for sorting purposes. Values are"," assumed to be the result of calling a model's `comparator()` method. You can"," override this method to implement custom sorting logic, such as a descending"," sort or multi-field sorting.",""," @method _compare"," @param {Mixed} a First value to compare."," @param {Mixed} b Second value to compare."," @return {Number} `-1` if _a_ should come before _b_, `0` if they're"," equivalent, `1` if _a_ should come after _b_."," @protected"," @since 3.5.0"," **/"," _compare: function (a, b) {"," return a < b ? -1 : (a > b ? 1 : 0);"," },",""," /**"," Removes this list as a bubble target for the specified model's events.",""," @method _detachList"," @param {Model} model Model to detach."," @protected"," **/"," _detachList: function (model) {"," var index = YArray.indexOf(model.lists, this);",""," if (index > -1) {"," model.lists.splice(index, 1);"," model.removeTarget(this);"," }"," },",""," /**"," Returns the index at which the given _model_ should be inserted to maintain"," the sort order of the list.",""," @method _findIndex"," @param {Model} model The model being inserted."," @return {Number} Index at which the model should be inserted."," @protected"," **/"," _findIndex: function (model) {"," var items = this._items,"," max = items.length,"," min = 0,"," item, middle, needle;",""," if (!this.comparator || !max) {"," return max;"," }",""," needle = this.comparator(model);",""," // Perform an iterative binary search to determine the correct position"," // based on the return value of the `comparator` function."," while (min < max) {"," middle = (min + max) >> 1; // Divide by two and discard remainder."," item = items[middle];",""," if (this._compare(this.comparator(item), needle) < 0) {"," min = middle + 1;"," } else {"," max = middle;"," }"," }",""," return min;"," },",""," /**"," Calls the public, overrideable `parse()` method and returns the result.",""," Override this method to provide a custom pre-parsing implementation. This"," provides a hook for custom persistence implementations to \"prep\" a response"," before calling the `parse()` method.",""," @method _parse"," @param {Any} response Server response."," @return {Object[]} Array of model attribute hashes."," @protected"," @see ModelList.parse()"," @since 3.7.0"," **/"," _parse: function (response) {"," return this.parse(response);"," },",""," /**"," Removes the specified _model_ if it's in this list.",""," @method _remove"," @param {Model|Number} model Model or index of the model to remove."," @param {Object} [options] Data to be mixed into the event facade of the"," `remove` event for the removed model."," @param {Boolean} [options.silent=false] If `true`, no `remove` event will"," be fired."," @return {Model} Removed model."," @protected"," **/"," _remove: function (model, options) {"," var index, facade;",""," options || (options = {});",""," if (Lang.isNumber(model)) {"," index = model;"," model = this.item(index);"," } else {"," index = this.indexOf(model);"," }",""," if (index === -1 || !model) {"," this.fire(EVT_ERROR, {"," error: 'Model is not in the list.',"," index: index,"," model: model,"," src : 'remove'"," });",""," return;"," }",""," facade = Y.merge(options, {"," index: index,"," model: model"," });",""," options.silent ? this._defRemoveFn(facade) :"," this.fire(EVT_REMOVE, facade);",""," return model;"," },",""," /**"," Array sort function used by `sort()` to re-sort the models in the list.",""," @method _sort"," @param {Model} a First model to compare."," @param {Model} b Second model to compare."," @return {Number} `-1` if _a_ is less than _b_, `0` if equal, `1` if greater."," @protected"," **/"," _sort: function (a, b) {"," return this._compare(this.comparator(a), this.comparator(b));"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Updates the model maps when a model's `id` attribute changes.",""," @method _afterIdChange"," @param {EventFacade} e"," @protected"," **/"," _afterIdChange: function (e) {"," var newVal = e.newVal,"," prevVal = e.prevVal,"," target = e.target;",""," if (Lang.isValue(prevVal)) {"," if (this._idMap[prevVal] === target) {"," delete this._idMap[prevVal];"," } else {"," // The model that changed isn't in this list. Probably just a"," // bubbled change event from a nested Model List."," return;"," }"," } else {"," // The model had no previous id. Verify that it exists in this list"," // before continuing."," if (this.indexOf(target) === -1) {"," return;"," }"," }",""," if (Lang.isValue(newVal)) {"," this._idMap[newVal] = target;"," }"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Default event handler for `add` events.",""," @method _defAddFn"," @param {EventFacade} e"," @protected"," **/"," _defAddFn: function (e) {"," var model = e.model,"," id = model.get('id');",""," this._clientIdMap[model.get('clientId')] = model;",""," if (Lang.isValue(id)) {"," this._idMap[id] = model;"," }",""," this._attachList(model);"," this._items.splice(e.index, 0, model);"," },",""," /**"," Default event handler for `remove` events.",""," @method _defRemoveFn"," @param {EventFacade} e"," @protected"," **/"," _defRemoveFn: function (e) {"," var model = e.model,"," id = model.get('id');",""," this._detachList(model);"," delete this._clientIdMap[model.get('clientId')];",""," if (Lang.isValue(id)) {"," delete this._idMap[id];"," }",""," this._items.splice(e.index, 1);"," },",""," /**"," Default event handler for `reset` events.",""," @method _defResetFn"," @param {EventFacade} e"," @protected"," **/"," _defResetFn: function (e) {"," // When fired from the `sort` method, we don't need to clear the list or"," // add any models, since the existing models are sorted in place."," if (e.src === 'sort') {"," this._items = e.models.concat();"," return;"," }",""," this._clear();",""," if (e.models.length) {"," this.add(e.models, {silent: true});"," }"," }","}, {"," NAME: 'modelList'","});","","Y.augment(ModelList, Y.ArrayList);","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"array-invoke\", \"arraylist\", \"base-build\", \"escape\", \"json-parse\", \"model\"]});"]; _yuitest_coverage["build/model-list/model-list.js"].lines = {"1":0,"35":0,"137":0,"138":0,"141":0,"178":0,"180":0,"182":0,"184":0,"186":0,"187":0,"191":0,"192":0,"193":0,"195":0,"197":0,"199":0,"200":0,"205":0,"251":0,"253":0,"254":0,"255":0,"260":0,"261":0,"266":0,"269":0,"316":0,"319":0,"320":0,"321":0,"324":0,"326":0,"327":0,"330":0,"334":0,"335":0,"336":0,"339":0,"364":0,"367":0,"368":0,"369":0,"372":0,"414":0,"419":0,"420":0,"421":0,"424":0,"425":0,"427":0,"428":0,"432":0,"433":0,"435":0,"436":0,"439":0,"441":0,"456":0,"457":0,"460":0,"478":0,"479":0,"482":0,"499":0,"500":0,"503":0,"514":0,"529":0,"543":0,"544":0,"581":0,"584":0,"585":0,"586":0,"589":0,"591":0,"592":0,"599":0,"600":0,"601":0,"603":0,"606":0,"607":0,"612":0,"614":0,"615":0,"618":0,"621":0,"637":0,"659":0,"660":0,"661":0,"663":0,"669":0,"673":0,"694":0,"696":0,"700":0,"701":0,"702":0,"705":0,"708":0,"709":0,"712":0,"739":0,"740":0,"742":0,"744":0,"745":0,"747":0,"748":0,"752":0,"754":0,"755":0,"758":0,"759":0,"762":0,"765":0,"791":0,"794":0,"795":0,"797":0,"798":0,"802":0,"821":0,"822":0,"825":0,"828":0,"830":0,"832":0,"837":0,"840":0,"872":0,"874":0,"875":0,"886":0,"901":0,"902":0,"924":0,"926":0,"928":0,"929":0,"932":0,"934":0,"937":0,"943":0,"946":0,"951":0,"953":0,"965":0,"966":0,"977":0,"979":0,"980":0,"981":0,"999":0,"1010":0,"1012":0,"1013":0,"1014":0,"1028":0,"1033":0,"1034":0,"1037":0,"1041":0,"1042":0,"1043":0,"1045":0,"1046":0,"1048":0,"1052":0,"1070":0,"1086":0,"1088":0,"1090":0,"1091":0,"1092":0,"1094":0,"1097":0,"1098":0,"1105":0,"1108":0,"1113":0,"1116":0,"1129":0,"1142":0,"1146":0,"1147":0,"1148":0,"1152":0,"1157":0,"1158":0,"1162":0,"1163":0,"1177":0,"1180":0,"1182":0,"1183":0,"1186":0,"1187":0,"1198":0,"1201":0,"1202":0,"1204":0,"1205":0,"1208":0,"1221":0,"1222":0,"1223":0,"1226":0,"1228":0,"1229":0,"1236":0}; _yuitest_coverage["build/model-list/model-list.js"].functions = {"ModelList:137":0,"initializer:177":0,"destructor:204":0,"(anonymous 2):254":0,"add:250":0,"(anonymous 3):334":0,"create:315":0,"each:363":0,"filter:413":0,"get:455":0,"getAsHTML:477":0,"getAsURL:498":0,"getByClientId:513":0,"getById:528":0,"invoke:542":0,"(anonymous 4):591":0,"load:580":0,"map:636":0,"parse:658":0,"(anonymous 5):700":0,"(anonymous 6):708":0,"remove:693":0,"(anonymous 7):747":0,"reset:738":0,"some:790":0,"sort:820":0,"sync:871":0,"toArray:885":0,"(anonymous 8):901":0,"toJSON:900":0,"_add:923":0,"_attachList:963":0,"_clear:976":0,"_compare:998":0,"_detachList:1009":0,"_findIndex:1027":0,"_parse:1069":0,"_remove:1085":0,"_sort:1128":0,"_afterIdChange:1141":0,"_defAddFn:1176":0,"_defRemoveFn:1197":0,"_defResetFn:1218":0,"(anonymous 1):1":0}; _yuitest_coverage["build/model-list/model-list.js"].coveredLines = 214;@@ -1533,4 +1533,4 @@ Y.augment(ModelList, Y.ArrayList); -}, '3.7.2', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});+}, '3.7.3', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});
bundle/model-list/model-list-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1242,4 +1242,4 @@ Y.augment(ModelList, Y.ArrayList); -}, '3.7.2', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});+}, '3.7.3', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});
bundle/model-list/model-list-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("model-list",function(e,t){function c(){c.superclass.constructor.apply(this,arguments)}var n=e.Attribute.prototype,r=e.Lang,i=e.Array,s="add",o="create",u="error",a="load",f="remove",l="reset";e.ModelList=e.extend(c,e.Base,{model:e.Model,_isYUIModelList:!0,initializer:function(t){t||(t={});var n=this.model=t.model||this.model;typeof n=="string"&&(this.model=e.Object.getValue(e,n.split(".")),this.model||e.error("ModelList: Model class not found: "+n)),this.publish(s,{defaultFn:this._defAddFn}),this.publish(l,{defaultFn:this._defResetFn}),this.publish(f,{defaultFn:this._defRemoveFn}),this.after("*:idChange",this._afterIdChange),this._clear(),t.items&&this.add(t.items,{silent:!0})},destructor:function(){this._clear()},add:function(t,n){var s=t._isYUIModelList;return s||r.isArray(t)?i.map(s?t.toArray():t,function(t,r){var i=n||{};return"index"in i&&(i=e.merge(i,{index:i.index+r})),this._add(t,i)},this):this._add(t,n)},create:function(t,n,r){var i=this;return typeof n=="function"&&(r=n,n={}),n||(n={}),t._isYUIModel||(t=new this.model(t)),i.fire(o,e.merge(n,{model:t})),t.save(n,function(e){e||i.add(t,n),r&&r.apply(null,arguments)})},each:function(e,t){var n=this._items.concat(),r,i,s;for(r=0,s=n.length;r<s;r++)i=n[r],e.call(t||i,i,r,this);return this},filter:function(e,t){var n=[],r=this._items,i,s,o,u;typeof e=="function"&&(t=e,e={});for(i=0,o=r.length;i<o;++i)s=r[i],t.call(this,s,i,this)&&n.push(s);return e.asList?(u=new this.constructor({model:this.model}),n.length&&u.add(n,{silent:!0}),u):n},get:function(e){return this.attrAdded(e)?n.get.apply(this,arguments):this.invoke("get",e)},getAsHTML:function(t){return this.attrAdded(t)?e.Escape.html(n.get.apply(this,arguments)):this.invoke("getAsHTML",t)},getAsURL:function(e){return this.attrAdded(e)?encodeURIComponent(n.get.apply(this,arguments)):this.invoke("getAsURL",e)},getByClientId:function(e){return this._clientIdMap[e]||null},getById:function(e){return this._idMap[e]||null},invoke:function(e){var t=[this._items,e].concat(i(arguments,1,!0));return i.invoke.apply(i,t)},load:function(e,t){var n=this;return typeof e=="function"&&(t=e,e={}),e||(e={}),this.sync("read",e,function(r,i){var s={options:e,response:i},o;r?(s.error=r,s.src="load",n.fire(u,s)):(n._loadEvent||(n._loadEvent=n.publish(a,{preventable:!1})),o=s.parsed=n._parse(i),n.reset(o,e),n.fire(a,s)),t&&t.apply(null,arguments)}),this},map:function(e,t){return i.map(this._items,e,t)},parse:function(t){if(typeof t=="string")try{return e.JSON.parse(t)||[]}catch(n){return this.fire(u,{error:n,response:t,src:"parse"}),null}return t||[]},remove:function(e,t){var n=e._isYUIModelList;return n||r.isArray(e)?(e=i.map(n?e.toArray():e,function(e){return r.isNumber(e)?this.item(e):e},this),i.map(e,function(e){return this._remove(e,t)},this)):this._remove(e,t)},reset:function(t,n){t||(t=[]),n||(n={});var r=e.merge({src:"reset"},n);return t._isYUIModelList?t=t.toArray():t=i.map(t,function(e){return e._isYUIModel?e:new this.model(e)},this),r.models=t,n.silent?this._defResetFn(r):(this.comparator&&t.sort(e.bind(this._sort,this)),this.fire(l,r)),this},some:function(e,t){var n=this._items.concat(),r,i,s;for(r=0,s=n.length;r<s;r++){i=n[r];if(e.call(t||i,i,r,this))return!0}return!1},sort:function(t){if(!this.comparator)return this;var n=this._items.concat(),r;return t||(t={}),n.sort(e.bind(this._sort,this)),r=e.merge(t,{models:n,src:"sort"}),t.silent?this._defResetFn(r):this.fire(l,r),this},sync:function(){var e=i(arguments,0,!0).pop();typeof e=="function"&&e()},toArray:function(){return this._items.concat()},toJSON:function(){return this.map(function(e){return e.toJSON()})},_add:function(t,n){var i,o;n||(n={}),t._isYUIModel||(t=new this.model(t)),o=t.get("id");if(this._clientIdMap[t.get("clientId")]||r.isValue(o)&&this._idMap[o]){this.fire(u,{error:"Model is already in the list.",model:t,src:"add"});return}return i=e.merge(n,{index:"index"in n?n.index:this._findIndex(t),model:t}),n.silent?this._defAddFn(i):this.fire(s,i),t},_attachList:function(e){e.lists.push(this),e.addTarget(this)},_clear:function(){i.each(this._items,this._detachList,this),this._clientIdMap={},this._idMap={},this._items=[]},_compare:function(e,t){return e<t?-1:e>t?1:0},_detachList:function(e){var t=i.indexOf(e.lists,this);t>-1&&(e.lists.splice(t,1),e.removeTarget(this))},_findIndex:function(e){var t=this._items,n=t.length,r=0,i,s,o;if(!this.comparator||!n)return n;o=this.comparator(e);while(r<n)s=r+n>>1,i=t[s],this._compare(this.comparator(i),o)<0?r=s+1:n=s;return r},_parse:function(e){return this.parse(e)},_remove:function(t,n){var i,s;n||(n={}),r.isNumber(t)?(i=t,t=this.item(i)):i=this.indexOf(t);if(i===-1||!t){this.fire(u,{error:"Model is not in the list.",index:i,model:t,src:"remove"});return}return s=e.merge(n,{index:i,model:t}),n.silent?this._defRemoveFn(s):this.fire(f,s),t},_sort:function(e,t){return this._compare(this.comparator(e),this.comparator(t))},_afterIdChange:function(e){var t=e.newVal,n=e.prevVal,i=e.target;if(r.isValue(n)){if(this._idMap[n]!==i)return;delete this._idMap[n]}else if(this.indexOf(i)===-1)return;r.isValue(t)&&(this._idMap[t]=i)},_defAddFn:function(e){var t=e.model,n=t.get("id");this._clientIdMap[t.get("clientId")]=t,r.isValue(n)&&(this._idMap[n]=t),this._attachList(t),this._items.splice(e.index,0,t)},_defRemoveFn:function(e){var t=e.model,n=t.get("id");this._detachList(t),delete this._clientIdMap[t.get("clientId")],r.isValue(n)&&delete this._idMap[n],this._items.splice(e.index,1)},_defResetFn:function(e){if(e.src==="sort"){this._items=e.models.concat();return}this._clear(),e.models.length&&this.add(e.models,{silent:!0})}},{NAME:"modelList"}),e.augment(c,e.ArrayList)},"3.7.2",{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]});+YUI.add("model-list",function(e,t){function c(){c.superclass.constructor.apply(this,arguments)}var n=e.Attribute.prototype,r=e.Lang,i=e.Array,s="add",o="create",u="error",a="load",f="remove",l="reset";e.ModelList=e.extend(c,e.Base,{model:e.Model,_isYUIModelList:!0,initializer:function(t){t||(t={});var n=this.model=t.model||this.model;typeof n=="string"&&(this.model=e.Object.getValue(e,n.split(".")),this.model||e.error("ModelList: Model class not found: "+n)),this.publish(s,{defaultFn:this._defAddFn}),this.publish(l,{defaultFn:this._defResetFn}),this.publish(f,{defaultFn:this._defRemoveFn}),this.after("*:idChange",this._afterIdChange),this._clear(),t.items&&this.add(t.items,{silent:!0})},destructor:function(){this._clear()},add:function(t,n){var s=t._isYUIModelList;return s||r.isArray(t)?i.map(s?t.toArray():t,function(t,r){var i=n||{};return"index"in i&&(i=e.merge(i,{index:i.index+r})),this._add(t,i)},this):this._add(t,n)},create:function(t,n,r){var i=this;return typeof n=="function"&&(r=n,n={}),n||(n={}),t._isYUIModel||(t=new this.model(t)),i.fire(o,e.merge(n,{model:t})),t.save(n,function(e){e||i.add(t,n),r&&r.apply(null,arguments)})},each:function(e,t){var n=this._items.concat(),r,i,s;for(r=0,s=n.length;r<s;r++)i=n[r],e.call(t||i,i,r,this);return this},filter:function(e,t){var n=[],r=this._items,i,s,o,u;typeof e=="function"&&(t=e,e={});for(i=0,o=r.length;i<o;++i)s=r[i],t.call(this,s,i,this)&&n.push(s);return e.asList?(u=new this.constructor({model:this.model}),n.length&&u.add(n,{silent:!0}),u):n},get:function(e){return this.attrAdded(e)?n.get.apply(this,arguments):this.invoke("get",e)},getAsHTML:function(t){return this.attrAdded(t)?e.Escape.html(n.get.apply(this,arguments)):this.invoke("getAsHTML",t)},getAsURL:function(e){return this.attrAdded(e)?encodeURIComponent(n.get.apply(this,arguments)):this.invoke("getAsURL",e)},getByClientId:function(e){return this._clientIdMap[e]||null},getById:function(e){return this._idMap[e]||null},invoke:function(e){var t=[this._items,e].concat(i(arguments,1,!0));return i.invoke.apply(i,t)},load:function(e,t){var n=this;return typeof e=="function"&&(t=e,e={}),e||(e={}),this.sync("read",e,function(r,i){var s={options:e,response:i},o;r?(s.error=r,s.src="load",n.fire(u,s)):(n._loadEvent||(n._loadEvent=n.publish(a,{preventable:!1})),o=s.parsed=n._parse(i),n.reset(o,e),n.fire(a,s)),t&&t.apply(null,arguments)}),this},map:function(e,t){return i.map(this._items,e,t)},parse:function(t){if(typeof t=="string")try{return e.JSON.parse(t)||[]}catch(n){return this.fire(u,{error:n,response:t,src:"parse"}),null}return t||[]},remove:function(e,t){var n=e._isYUIModelList;return n||r.isArray(e)?(e=i.map(n?e.toArray():e,function(e){return r.isNumber(e)?this.item(e):e},this),i.map(e,function(e){return this._remove(e,t)},this)):this._remove(e,t)},reset:function(t,n){t||(t=[]),n||(n={});var r=e.merge({src:"reset"},n);return t._isYUIModelList?t=t.toArray():t=i.map(t,function(e){return e._isYUIModel?e:new this.model(e)},this),r.models=t,n.silent?this._defResetFn(r):(this.comparator&&t.sort(e.bind(this._sort,this)),this.fire(l,r)),this},some:function(e,t){var n=this._items.concat(),r,i,s;for(r=0,s=n.length;r<s;r++){i=n[r];if(e.call(t||i,i,r,this))return!0}return!1},sort:function(t){if(!this.comparator)return this;var n=this._items.concat(),r;return t||(t={}),n.sort(e.bind(this._sort,this)),r=e.merge(t,{models:n,src:"sort"}),t.silent?this._defResetFn(r):this.fire(l,r),this},sync:function(){var e=i(arguments,0,!0).pop();typeof e=="function"&&e()},toArray:function(){return this._items.concat()},toJSON:function(){return this.map(function(e){return e.toJSON()})},_add:function(t,n){var i,o;n||(n={}),t._isYUIModel||(t=new this.model(t)),o=t.get("id");if(this._clientIdMap[t.get("clientId")]||r.isValue(o)&&this._idMap[o]){this.fire(u,{error:"Model is already in the list.",model:t,src:"add"});return}return i=e.merge(n,{index:"index"in n?n.index:this._findIndex(t),model:t}),n.silent?this._defAddFn(i):this.fire(s,i),t},_attachList:function(e){e.lists.push(this),e.addTarget(this)},_clear:function(){i.each(this._items,this._detachList,this),this._clientIdMap={},this._idMap={},this._items=[]},_compare:function(e,t){return e<t?-1:e>t?1:0},_detachList:function(e){var t=i.indexOf(e.lists,this);t>-1&&(e.lists.splice(t,1),e.removeTarget(this))},_findIndex:function(e){var t=this._items,n=t.length,r=0,i,s,o;if(!this.comparator||!n)return n;o=this.comparator(e);while(r<n)s=r+n>>1,i=t[s],this._compare(this.comparator(i),o)<0?r=s+1:n=s;return r},_parse:function(e){return this.parse(e)},_remove:function(t,n){var i,s;n||(n={}),r.isNumber(t)?(i=t,t=this.item(i)):i=this.indexOf(t);if(i===-1||!t){this.fire(u,{error:"Model is not in the list.",index:i,model:t,src:"remove"});return}return s=e.merge(n,{index:i,model:t}),n.silent?this._defRemoveFn(s):this.fire(f,s),t},_sort:function(e,t){return this._compare(this.comparator(e),this.comparator(t))},_afterIdChange:function(e){var t=e.newVal,n=e.prevVal,i=e.target;if(r.isValue(n)){if(this._idMap[n]!==i)return;delete this._idMap[n]}else if(this.indexOf(i)===-1)return;r.isValue(t)&&(this._idMap[t]=i)},_defAddFn:function(e){var t=e.model,n=t.get("id");this._clientIdMap[t.get("clientId")]=t,r.isValue(n)&&(this._idMap[n]=t),this._attachList(t),this._items.splice(e.index,0,t)},_defRemoveFn:function(e){var t=e.model,n=t.get("id");this._detachList(t),delete this._clientIdMap[t.get("clientId")],r.isValue(n)&&delete this._idMap[n],this._items.splice(e.index,1)},_defResetFn:function(e){if(e.src==="sort"){this._items=e.models.concat();return}this._clear(),e.models.length&&this.add(e.models,{silent:!0})}},{NAME:"modelList"}),e.augment(c,e.ArrayList)},"3.7.3",{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]});
bundle/model-list/model-list.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1242,4 +1242,4 @@ Y.augment(ModelList, Y.ArrayList); -}, '3.7.2', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});+}, '3.7.3', {"requires": ["array-extras", "array-invoke", "arraylist", "base-build", "escape", "json-parse", "model"]});
bundle/model-sync-rest/model-sync-rest-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/model-sync-rest/model-sync-rest.js", code: [] };-_yuitest_coverage["build/model-sync-rest/model-sync-rest.js"].code=["YUI.add('model-sync-rest', function (Y, NAME) {","","/**","An extension which provides a RESTful XHR sync implementation that can be mixed","into a Model or ModelList subclass.","","@module app","@submodule model-sync-rest","@since 3.6.0","**/","","var Lang = Y.Lang;","","/**","An extension which provides a RESTful XHR sync implementation that can be mixed","into a Model or ModelList subclass.","","This makes it trivial for your Model or ModelList subclasses communicate and","transmit their data via RESTful XHRs. In most cases you'll only need to provide","a value for `root` when sub-classing `Y.Model`.",""," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users'"," });",""," Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {"," // By convention `Y.User`'s `root` will be used for the lists' URL."," model: Y.User"," });",""," var users = new Y.Users();",""," // GET users list from: \"/users\""," users.load(function () {"," var firstUser = users.item(0);",""," firstUser.get('id'); // => \"1\"",""," // PUT updated user data at: \"/users/1\""," firstUser.set('name', 'Eric').save();"," });","","@class ModelSync.REST","@extensionfor Model","@extensionfor ModelList","@since 3.6.0","**/","function RESTSync() {}","","/**","A request authenticity token to validate HTTP requests made by this extension","with the server when the request results in changing persistent state. This","allows you to protect your server from Cross-Site Request Forgery attacks.","","A CSRF token provided by the server can be embedded in the HTML document and","assigned to `YUI.Env.CSRF_TOKEN` like this:",""," <script>"," YUI.Env.CSRF_TOKEN = {{session.authenticityToken}};"," </script>","","The above should come after YUI seed file so that `YUI.Env` will be defined.","","**Note:** This can be overridden on a per-request basis. See `sync()` method.","","When a value for the CSRF token is provided, either statically or via `options`","passed to the `save()` and `destroy()` methods, the applicable HTTP requests","will have a `X-CSRF-Token` header added with the token value.","","@property CSRF_TOKEN","@type String","@default YUI.Env.CSRF_TOKEN","@static","@since 3.6.0","**/","RESTSync.CSRF_TOKEN = YUI.Env.CSRF_TOKEN;","","/**","Static flag to use the HTTP POST method instead of PUT or DELETE.","","If the server-side HTTP framework isn't RESTful, setting this flag to `true`","will cause all PUT and DELETE requests to instead use the POST HTTP method, and","add a `X-HTTP-Method-Override` HTTP header with the value of the method type","which was overridden.","","@property EMULATE_HTTP","@type Boolean","@default false","@static","@since 3.6.0","**/","RESTSync.EMULATE_HTTP = false;","","/**","Default headers used with all XHRs.","","By default the `Accept` and `Content-Type` headers are set to","\"application/json\", this signals to the HTTP server to process the request","bodies as JSON and send JSON responses. If you're sending and receiving content","other than JSON, you can override these headers and the `parse()` and","`serialize()` methods.","","**Note:** These headers will be merged with any request-specific headers, and","the request-specific headers will take precedence.","","@property HTTP_HEADERS","@type Object","@default"," {"," \"Accept\" : \"application/json\","," \"Content-Type\": \"application/json\""," }","@static","@since 3.6.0","**/","RESTSync.HTTP_HEADERS = {"," 'Accept' : 'application/json',"," 'Content-Type': 'application/json'","};","","/**","Static mapping of RESTful HTTP methods corresponding to CRUD actions.","","@property HTTP_METHODS","@type Object","@default"," {"," \"create\": \"POST\","," \"read\" : \"GET\","," \"update\": \"PUT\","," \"delete\": \"DELETE\""," }","@static","@since 3.6.0","**/","RESTSync.HTTP_METHODS = {"," 'create': 'POST',"," 'read' : 'GET',"," 'update': 'PUT',"," 'delete': 'DELETE'","};","","/**","The number of milliseconds before the XHRs will timeout/abort. This defaults to","30 seconds.","","**Note:** This can be overridden on a per-request basis. See `sync()` method.","","@property HTTP_TIMEOUT","@type Number","@default 30000","@static","@since 3.6.0","**/","RESTSync.HTTP_TIMEOUT = 30000;","","/**","Properties that shouldn't be turned into ad-hoc attributes when passed to a","Model or ModelList constructor.","","@property _NON_ATTRS_CFG","@type Array","@default [\"root\", \"url\"]","@static","@protected","@since 3.6.0","**/","RESTSync._NON_ATTRS_CFG = ['root', 'url'];","","RESTSync.prototype = {",""," // -- Public Properties ----------------------------------------------------",""," /**"," A string which represents the root or collection part of the URL which"," relates to a Model or ModelList. Usually this value should be same for all"," instances of a specific Model/ModelList subclass.",""," When sub-classing `Y.Model`, usually you'll only need to override this"," property, which lets the URLs for the XHRs be generated by convention. If"," the `root` string ends with a trailing-slash, XHR URLs will also end with a"," \"/\", and if the `root` does not end with a slash, neither will the XHR URLs.",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users'"," });",""," var currentUser, newUser;",""," // GET the user data from: \"/users/123\""," currentUser = new Y.User({id: '123'}).load();",""," // POST the new user data to: \"/users\""," newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();",""," When sub-classing `Y.ModelList`, usually you'll want to ignore configuring"," the `root` and simply rely on the build-in convention of the list's"," generated URLs defaulting to the `root` specified by the list's `model`.",""," @property root"," @type String"," @default \"\""," @since 3.6.0"," **/"," root: '',",""," /**"," A string which specifies the URL to use when making XHRs, if not value is"," provided, the URLs used to make XHRs will be generated by convention.",""," While a `url` can be provided for each Model/ModelList instance, usually"," you'll want to either rely on the default convention or provide a tokenized"," string on the prototype which can be used for all instances.",""," When sub-classing `Y.Model`, you will probably be able to rely on the"," default convention of generating URLs in conjunction with the `root`"," property and whether the model is new or not (i.e. has an `id`). If the"," `root` property ends with a trailing-slash, the generated URL for the"," specific model will also end with a trailing-slash.",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users/'"," });",""," var currentUser, newUser;",""," // GET the user data from: \"/users/123/\""," currentUser = new Y.User({id: '123'}).load();",""," // POST the new user data to: \"/users/\""," newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();",""," If a `url` is specified, it will be processed by `Y.Lang.sub()`, which is"," useful when the URLs for a Model/ModelList subclass match a specific pattern"," and can use simple replacement tokens; e.g.:",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users',"," url : '/users/{username}'"," });",""," **Note:** String subsitituion of the `url` only use string an number values"," provided by this object's attribute and/or the `options` passed to the"," `getURL()` method. Do not expect something fancy to happen with Object,"," Array, or Boolean values, they will simply be ignored.",""," If your URLs have plural roots or collection URLs, while the specific item"," resources are under a singular name, e.g. \"/users\" (plural) and \"/user/123\""," (singular), you'll probably want to configure the `root` and `url`"," properties like this:",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users',"," url : '/user/{id}'"," });",""," var currentUser, newUser;",""," // GET the user data from: \"/user/123\""," currentUser = new Y.User({id: '123'}).load();",""," // POST the new user data to: \"/users\""," newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();",""," When sub-classing `Y.ModelList`, usually you'll be able to rely on the"," associated `model` to supply its `root` to be used as the model list's URL."," If this needs to be customized, you can provide a simple string for the"," `url` property.",""," @example"," Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {"," // Leverages `Y.User`'s `root`, which is \"/users\"."," model: Y.User"," });",""," // Or specified explicitly...",""," Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {"," model: Y.User,"," url : '/users'"," });",""," @property url"," @type String"," @default \"\""," @since 3.6.0"," **/"," url: '',",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function (config) {"," config || (config = {});",""," // Overrides `root` at the instance level."," if ('root' in config) {"," this.root = config.root || '';"," }",""," // Overrides `url` at the instance level."," if ('url' in config) {"," this.url = config.url || '';"," }"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Returns the URL for this model or model list for the given `action` and"," `options`, if specified.",""," This method correctly handles the variations of `root` and `url` values and"," is called by the `sync()` method to get the URLs used to make the XHRs.",""," You can override this method if you need to provide a specific"," implementation for how the URLs of your Model and ModelList subclasses need"," to be generated.",""," @method getURL"," @param {String} [action] Optional `sync()` action for which to generate the"," URL."," @param {Object} [options] Optional options which may be used to help"," generate the URL."," @return {String} this model's or model list's URL for the the given"," `action` and `options`."," @since 3.6.0"," **/"," getURL: function (action, options) {"," var root = this.root,"," url = this.url;",""," // If this is a model list, use its `url` and substitute placeholders,"," // but default to the `root` of its `model`. By convention a model's"," // `root` is the location to a collection resource."," if (this._isYUIModelList) {"," if (!url) {"," return this.model.prototype.root;"," }",""," return this._substituteURL(url, Y.merge(this.getAttrs(), options));"," }",""," // Assume `this` is a model.",""," // When a model is new, i.e. has no `id`, the `root` should be used. By"," // convention a model's `root` is the location to a collection resource."," // The model's `url` will be used as a fallback if `root` isn't defined."," if (root && (action === 'create' || this.isNew())) {"," return root;"," }",""," // When a model's `url` is not provided, we'll generate a URL to use by"," // convention. This will combine the model's `id` with its configured"," // `root` and add a trailing-slash if the root ends with \"/\"."," if (!url) {"," return this._joinURL(this.getAsURL('id') || '');"," }",""," // Substitute placeholders in the `url` with URL-encoded values from the"," // model's attribute values or the specified `options`."," return this._substituteURL(url, Y.merge(this.getAttrs(), options));"," },",""," /**"," Called to parse the response object returned from `Y.io()`. This method"," receives the full response object and is expected to \"prep\" a response which"," is suitable to pass to the `parse()` method.",""," By default the response body is returned (`responseText`), because it"," usually represents the entire entity of this model on the server.",""," If you need to parse data out of the response's headers you should do so by"," overriding this method. If you'd like the entire response object from the"," XHR to be passed to your `parse()` method, you can simply assign this"," property to `false`.",""," @method parseIOResponse"," @param {Object} response Response object from `Y.io()`."," @return {Any} The modified response to pass along to the `parse()` method."," @since 3.7.0"," **/"," parseIOResponse: function (response) {"," return response.responseText;"," },",""," /**"," Serializes `this` model to be used as the HTTP request entity body.",""," By default this model will be serialized to a JSON string via its `toJSON()`"," method.",""," You can override this method when the HTTP server expects a different"," representation of this model's data that is different from the default JSON"," serialization. If you're sending and receive content other than JSON, be"," sure change the `Accept` and `Content-Type` `HTTP_HEADERS` as well.",""," **Note:** A model's `toJSON()` method can also be overridden. If you only"," need to modify which attributes are serialized to JSON, that's a better"," place to start.",""," @method serialize"," @param {String} [action] Optional `sync()` action for which to generate the"," the serialized representation of this model."," @return {String} serialized HTTP request entity body."," @since 3.6.0"," **/"," serialize: function (action) {"," return Y.JSON.stringify(this);"," },",""," /**"," Communicates with a RESTful HTTP server by sending and receiving data via"," XHRs. This method is called internally by load(), save(), and destroy().",""," The URL used for each XHR will be retrieved by calling the `getURL()` method"," and passing it the specified `action` and `options`.",""," This method relies heavily on standard RESTful HTTP conventions",""," @method sync"," @param {String} action Sync action to perform. May be one of the following:",""," * `create`: Store a newly-created model for the first time."," * `delete`: Delete an existing model."," * `read` : Load an existing model."," * `update`: Update an existing model.",""," @param {Object} [options] Sync options:"," @param {String} [options.csrfToken] The authenticity token used by the"," server to verify the validity of this request and protected against CSRF"," attacks. This overrides the default value provided by the static"," `CSRF_TOKEN` property."," @param {Object} [options.headers] The HTTP headers to mix with the default"," headers specified by the static `HTTP_HEADERS` property."," @param {Number} [options.timeout] The number of milliseconds before the"," request will timeout and be aborted. This overrides the default provided"," by the static `HTTP_TIMEOUT` property."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} [callback.response] The server's response."," **/"," sync: function (action, options, callback) {"," options || (options = {});",""," var url = this.getURL(action, options),"," method = RESTSync.HTTP_METHODS[action],"," headers = Y.merge(RESTSync.HTTP_HEADERS, options.headers),"," timeout = options.timeout || RESTSync.HTTP_TIMEOUT,"," csrfToken = options.csrfToken || RESTSync.CSRF_TOKEN,"," entity;",""," // Prepare the content if we are sending data to the server."," if (method === 'POST' || method === 'PUT') {"," entity = this.serialize(action);"," } else {"," // Remove header, no content is being sent."," delete headers['Content-Type'];"," }",""," // Setup HTTP emulation for older servers if we need it."," if (RESTSync.EMULATE_HTTP &&"," (method === 'PUT' || method === 'DELETE')) {",""," // Pass along original method type in the headers."," headers['X-HTTP-Method-Override'] = method;",""," // Fall-back to using POST method type."," method = 'POST';"," }",""," // Add CSRF token to HTTP request headers if one is specified and the"," // request will cause side effects on the server."," if (csrfToken &&"," (method === 'POST' || method === 'PUT' || method === 'DELETE')) {",""," headers['X-CSRF-Token'] = csrfToken;"," }",""," this._sendSyncIORequest({"," action : action,"," callback: callback,"," entity : entity,"," headers : headers,"," method : method,"," timeout : timeout,"," url : url"," });"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Joins the `root` URL to the specified `url`, normalizing leading/trailing"," \"/\" characters.",""," @example"," model.root = '/foo'"," model._joinURL('bar'); // => '/foo/bar'"," model._joinURL('/bar'); // => '/foo/bar'",""," model.root = '/foo/'"," model._joinURL('bar'); // => '/foo/bar/'"," model._joinURL('/bar'); // => '/foo/bar/'",""," @method _joinURL"," @param {String} url URL to append to the `root` URL."," @return {String} Joined URL."," @protected"," @since 3.6.0"," **/"," _joinURL: function (url) {"," var root = this.root;",""," if (!(root || url)) {"," return '';"," }",""," if (url.charAt(0) === '/') {"," url = url.substring(1);"," }",""," // Combines the `root` with the `url` and adds a trailing-slash if the"," // `root` has a trailing-slash."," return root && root.charAt(root.length - 1) === '/' ?"," root + url + '/' :"," root + '/' + url;"," },","",""," /**"," Calls both public, overrideable methods: `parseIOResponse()`, then `parse()`"," and returns the result.",""," This will call into `parseIOResponse()`, if it's defined as a method,"," passing it the full response object from the XHR and using its return value"," to pass along to the `parse()`. This enables developers to easily parse data"," out of the response headers which should be used by the `parse()` method.",""," @method _parse"," @param {Object} response Response object from `Y.io()`."," @return {Object|Object[]} Attribute hash or Array of model attribute hashes."," @protected"," @since 3.7.0"," **/"," _parse: function (response) {"," // When `parseIOResponse` is defined as a method, it will be invoked and"," // the result will become the new response object that the `parse()`"," // will be invoked with."," if (typeof this.parseIOResponse === 'function') {"," response = this.parseIOResponse(response);"," }",""," return this.parse(response);"," },",""," /**"," Performs the XHR and returns the resulting `Y.io()` request object.",""," This method is called by `sync()`.",""," @method _sendSyncIORequest"," @param {Object} config An object with the following properties:"," @param {String} config.action The `sync()` action being performed."," @param {Function} [config.callback] Called when the sync operation"," finishes."," @param {String} [config.entity] The HTTP request entity body."," @param {Object} config.headers The HTTP request headers."," @param {String} config.method The HTTP request method."," @param {Number} [config.timeout] Time until the HTTP request is aborted."," @param {String} config.url The URL of the HTTP resource."," @return {Object} The resulting `Y.io()` request object."," @protected"," @since 3.6.0"," **/"," _sendSyncIORequest: function (config) {"," return Y.io(config.url, {"," 'arguments': {"," action : config.action,"," callback: config.callback,"," url : config.url"," },",""," context: this,"," data : config.entity,"," headers: config.headers,"," method : config.method,"," timeout: config.timeout,",""," on: {"," start : this._onSyncIOStart,"," failure: this._onSyncIOFailure,"," success: this._onSyncIOSuccess,"," end : this._onSyncIOEnd"," }"," });"," },",""," /**"," Utility which takes a tokenized `url` string and substitutes its"," placeholders using a specified `data` object.",""," This method will property URL-encode any values before substituting them."," Also, only expect it to work with String and Number values.",""," @example"," var url = this._substituteURL('/users/{name}', {id: 'Eric F'});"," // => \"/users/Eric%20F\"",""," @method _substituteURL"," @param {String} url Tokenized URL string to substitute placeholder values."," @param {Object} data Set of data to fill in the `url`'s placeholders."," @return {String} Substituted URL."," @protected"," @since 3.6.0"," **/"," _substituteURL: function (url, data) {"," if (!url) {"," return '';"," }",""," var values = {};",""," // Creates a hash of the string and number values only to be used to"," // replace any placeholders in a tokenized `url`."," Y.Object.each(data, function (v, k) {"," if (Lang.isString(v) || Lang.isNumber(v)) {"," // URL-encode any string or number values."," values[k] = encodeURIComponent(v);"," }"," });",""," return Lang.sub(url, values);"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Called when the `Y.io` request has finished, after \"success\" or \"failure\""," has been determined.",""," This is a no-op by default, but provides a hook for overriding.",""," @method _onSyncIOEnd"," @param {String} txId The `Y.io` transaction id."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} details.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOEnd: function (txId, details) {},",""," /**"," Called when the `Y.io` request has finished unsuccessfully.",""," By default this calls the `details.callback` function passing it the HTTP"," status code and message as an error object along with the response body.",""," @method _onSyncIOFailure"," @param {String} txId The `Y.io` transaction id."," @param {Object} res The `Y.io` response object."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} details.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOFailure: function (txId, res, details) {"," var callback = details.callback;",""," if (callback) {"," callback({"," code: res.status,"," msg : res.statusText"," }, res);"," }"," },",""," /**"," Called when the `Y.io` request has finished successfully.",""," By default this calls the `details.callback` function passing it the"," response body.",""," @method _onSyncIOSuccess"," @param {String} txId The `Y.io` transaction id."," @param {Object} res The `Y.io` response object."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} details.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOSuccess: function (txId, res, details) {"," var callback = details.callback;",""," if (callback) {"," callback(null, res);"," }"," },",""," /**"," Called when the `Y.io` request is made.",""," This is a no-op by default, but provides a hook for overriding.",""," @method _onSyncIOStart"," @param {String} txId The `Y.io` transaction id."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} detials.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOStart: function (txId, details) {}","};","","// -- Namespace ----------------------------------------------------------------","","Y.namespace('ModelSync').REST = RESTSync;","","","}, '3.7.2', {\"requires\": [\"model\", \"io-base\", \"json-stringify\"]});"];+_yuitest_coverage["build/model-sync-rest/model-sync-rest.js"].code=["YUI.add('model-sync-rest', function (Y, NAME) {","","/**","An extension which provides a RESTful XHR sync implementation that can be mixed","into a Model or ModelList subclass.","","@module app","@submodule model-sync-rest","@since 3.6.0","**/","","var Lang = Y.Lang;","","/**","An extension which provides a RESTful XHR sync implementation that can be mixed","into a Model or ModelList subclass.","","This makes it trivial for your Model or ModelList subclasses communicate and","transmit their data via RESTful XHRs. In most cases you'll only need to provide","a value for `root` when sub-classing `Y.Model`.",""," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users'"," });",""," Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {"," // By convention `Y.User`'s `root` will be used for the lists' URL."," model: Y.User"," });",""," var users = new Y.Users();",""," // GET users list from: \"/users\""," users.load(function () {"," var firstUser = users.item(0);",""," firstUser.get('id'); // => \"1\"",""," // PUT updated user data at: \"/users/1\""," firstUser.set('name', 'Eric').save();"," });","","@class ModelSync.REST","@extensionfor Model","@extensionfor ModelList","@since 3.6.0","**/","function RESTSync() {}","","/**","A request authenticity token to validate HTTP requests made by this extension","with the server when the request results in changing persistent state. This","allows you to protect your server from Cross-Site Request Forgery attacks.","","A CSRF token provided by the server can be embedded in the HTML document and","assigned to `YUI.Env.CSRF_TOKEN` like this:",""," <script>"," YUI.Env.CSRF_TOKEN = {{session.authenticityToken}};"," </script>","","The above should come after YUI seed file so that `YUI.Env` will be defined.","","**Note:** This can be overridden on a per-request basis. See `sync()` method.","","When a value for the CSRF token is provided, either statically or via `options`","passed to the `save()` and `destroy()` methods, the applicable HTTP requests","will have a `X-CSRF-Token` header added with the token value.","","@property CSRF_TOKEN","@type String","@default YUI.Env.CSRF_TOKEN","@static","@since 3.6.0","**/","RESTSync.CSRF_TOKEN = YUI.Env.CSRF_TOKEN;","","/**","Static flag to use the HTTP POST method instead of PUT or DELETE.","","If the server-side HTTP framework isn't RESTful, setting this flag to `true`","will cause all PUT and DELETE requests to instead use the POST HTTP method, and","add a `X-HTTP-Method-Override` HTTP header with the value of the method type","which was overridden.","","@property EMULATE_HTTP","@type Boolean","@default false","@static","@since 3.6.0","**/","RESTSync.EMULATE_HTTP = false;","","/**","Default headers used with all XHRs.","","By default the `Accept` and `Content-Type` headers are set to","\"application/json\", this signals to the HTTP server to process the request","bodies as JSON and send JSON responses. If you're sending and receiving content","other than JSON, you can override these headers and the `parse()` and","`serialize()` methods.","","**Note:** These headers will be merged with any request-specific headers, and","the request-specific headers will take precedence.","","@property HTTP_HEADERS","@type Object","@default"," {"," \"Accept\" : \"application/json\","," \"Content-Type\": \"application/json\""," }","@static","@since 3.6.0","**/","RESTSync.HTTP_HEADERS = {"," 'Accept' : 'application/json',"," 'Content-Type': 'application/json'","};","","/**","Static mapping of RESTful HTTP methods corresponding to CRUD actions.","","@property HTTP_METHODS","@type Object","@default"," {"," \"create\": \"POST\","," \"read\" : \"GET\","," \"update\": \"PUT\","," \"delete\": \"DELETE\""," }","@static","@since 3.6.0","**/","RESTSync.HTTP_METHODS = {"," 'create': 'POST',"," 'read' : 'GET',"," 'update': 'PUT',"," 'delete': 'DELETE'","};","","/**","The number of milliseconds before the XHRs will timeout/abort. This defaults to","30 seconds.","","**Note:** This can be overridden on a per-request basis. See `sync()` method.","","@property HTTP_TIMEOUT","@type Number","@default 30000","@static","@since 3.6.0","**/","RESTSync.HTTP_TIMEOUT = 30000;","","/**","Properties that shouldn't be turned into ad-hoc attributes when passed to a","Model or ModelList constructor.","","@property _NON_ATTRS_CFG","@type Array","@default [\"root\", \"url\"]","@static","@protected","@since 3.6.0","**/","RESTSync._NON_ATTRS_CFG = ['root', 'url'];","","RESTSync.prototype = {",""," // -- Public Properties ----------------------------------------------------",""," /**"," A string which represents the root or collection part of the URL which"," relates to a Model or ModelList. Usually this value should be same for all"," instances of a specific Model/ModelList subclass.",""," When sub-classing `Y.Model`, usually you'll only need to override this"," property, which lets the URLs for the XHRs be generated by convention. If"," the `root` string ends with a trailing-slash, XHR URLs will also end with a"," \"/\", and if the `root` does not end with a slash, neither will the XHR URLs.",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users'"," });",""," var currentUser, newUser;",""," // GET the user data from: \"/users/123\""," currentUser = new Y.User({id: '123'}).load();",""," // POST the new user data to: \"/users\""," newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();",""," When sub-classing `Y.ModelList`, usually you'll want to ignore configuring"," the `root` and simply rely on the build-in convention of the list's"," generated URLs defaulting to the `root` specified by the list's `model`.",""," @property root"," @type String"," @default \"\""," @since 3.6.0"," **/"," root: '',",""," /**"," A string which specifies the URL to use when making XHRs, if not value is"," provided, the URLs used to make XHRs will be generated by convention.",""," While a `url` can be provided for each Model/ModelList instance, usually"," you'll want to either rely on the default convention or provide a tokenized"," string on the prototype which can be used for all instances.",""," When sub-classing `Y.Model`, you will probably be able to rely on the"," default convention of generating URLs in conjunction with the `root`"," property and whether the model is new or not (i.e. has an `id`). If the"," `root` property ends with a trailing-slash, the generated URL for the"," specific model will also end with a trailing-slash.",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users/'"," });",""," var currentUser, newUser;",""," // GET the user data from: \"/users/123/\""," currentUser = new Y.User({id: '123'}).load();",""," // POST the new user data to: \"/users/\""," newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();",""," If a `url` is specified, it will be processed by `Y.Lang.sub()`, which is"," useful when the URLs for a Model/ModelList subclass match a specific pattern"," and can use simple replacement tokens; e.g.:",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users',"," url : '/users/{username}'"," });",""," **Note:** String subsitituion of the `url` only use string an number values"," provided by this object's attribute and/or the `options` passed to the"," `getURL()` method. Do not expect something fancy to happen with Object,"," Array, or Boolean values, they will simply be ignored.",""," If your URLs have plural roots or collection URLs, while the specific item"," resources are under a singular name, e.g. \"/users\" (plural) and \"/user/123\""," (singular), you'll probably want to configure the `root` and `url`"," properties like this:",""," @example"," Y.User = Y.Base.create('user', Y.Model, [Y.ModelSync.REST], {"," root: '/users',"," url : '/user/{id}'"," });",""," var currentUser, newUser;",""," // GET the user data from: \"/user/123\""," currentUser = new Y.User({id: '123'}).load();",""," // POST the new user data to: \"/users\""," newUser = new Y.User({name: 'Eric Ferraiuolo'}).save();",""," When sub-classing `Y.ModelList`, usually you'll be able to rely on the"," associated `model` to supply its `root` to be used as the model list's URL."," If this needs to be customized, you can provide a simple string for the"," `url` property.",""," @example"," Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {"," // Leverages `Y.User`'s `root`, which is \"/users\"."," model: Y.User"," });",""," // Or specified explicitly...",""," Y.Users = Y.Base.create('users', Y.ModelList, [Y.ModelSync.REST], {"," model: Y.User,"," url : '/users'"," });",""," @property url"," @type String"," @default \"\""," @since 3.6.0"," **/"," url: '',",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function (config) {"," config || (config = {});",""," // Overrides `root` at the instance level."," if ('root' in config) {"," this.root = config.root || '';"," }",""," // Overrides `url` at the instance level."," if ('url' in config) {"," this.url = config.url || '';"," }"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Returns the URL for this model or model list for the given `action` and"," `options`, if specified.",""," This method correctly handles the variations of `root` and `url` values and"," is called by the `sync()` method to get the URLs used to make the XHRs.",""," You can override this method if you need to provide a specific"," implementation for how the URLs of your Model and ModelList subclasses need"," to be generated.",""," @method getURL"," @param {String} [action] Optional `sync()` action for which to generate the"," URL."," @param {Object} [options] Optional options which may be used to help"," generate the URL."," @return {String} this model's or model list's URL for the the given"," `action` and `options`."," @since 3.6.0"," **/"," getURL: function (action, options) {"," var root = this.root,"," url = this.url;",""," // If this is a model list, use its `url` and substitute placeholders,"," // but default to the `root` of its `model`. By convention a model's"," // `root` is the location to a collection resource."," if (this._isYUIModelList) {"," if (!url) {"," return this.model.prototype.root;"," }",""," return this._substituteURL(url, Y.merge(this.getAttrs(), options));"," }",""," // Assume `this` is a model.",""," // When a model is new, i.e. has no `id`, the `root` should be used. By"," // convention a model's `root` is the location to a collection resource."," // The model's `url` will be used as a fallback if `root` isn't defined."," if (root && (action === 'create' || this.isNew())) {"," return root;"," }",""," // When a model's `url` is not provided, we'll generate a URL to use by"," // convention. This will combine the model's `id` with its configured"," // `root` and add a trailing-slash if the root ends with \"/\"."," if (!url) {"," return this._joinURL(this.getAsURL('id') || '');"," }",""," // Substitute placeholders in the `url` with URL-encoded values from the"," // model's attribute values or the specified `options`."," return this._substituteURL(url, Y.merge(this.getAttrs(), options));"," },",""," /**"," Called to parse the response object returned from `Y.io()`. This method"," receives the full response object and is expected to \"prep\" a response which"," is suitable to pass to the `parse()` method.",""," By default the response body is returned (`responseText`), because it"," usually represents the entire entity of this model on the server.",""," If you need to parse data out of the response's headers you should do so by"," overriding this method. If you'd like the entire response object from the"," XHR to be passed to your `parse()` method, you can simply assign this"," property to `false`.",""," @method parseIOResponse"," @param {Object} response Response object from `Y.io()`."," @return {Any} The modified response to pass along to the `parse()` method."," @since 3.7.0"," **/"," parseIOResponse: function (response) {"," return response.responseText;"," },",""," /**"," Serializes `this` model to be used as the HTTP request entity body.",""," By default this model will be serialized to a JSON string via its `toJSON()`"," method.",""," You can override this method when the HTTP server expects a different"," representation of this model's data that is different from the default JSON"," serialization. If you're sending and receive content other than JSON, be"," sure change the `Accept` and `Content-Type` `HTTP_HEADERS` as well.",""," **Note:** A model's `toJSON()` method can also be overridden. If you only"," need to modify which attributes are serialized to JSON, that's a better"," place to start.",""," @method serialize"," @param {String} [action] Optional `sync()` action for which to generate the"," the serialized representation of this model."," @return {String} serialized HTTP request entity body."," @since 3.6.0"," **/"," serialize: function (action) {"," return Y.JSON.stringify(this);"," },",""," /**"," Communicates with a RESTful HTTP server by sending and receiving data via"," XHRs. This method is called internally by load(), save(), and destroy().",""," The URL used for each XHR will be retrieved by calling the `getURL()` method"," and passing it the specified `action` and `options`.",""," This method relies heavily on standard RESTful HTTP conventions",""," @method sync"," @param {String} action Sync action to perform. May be one of the following:",""," * `create`: Store a newly-created model for the first time."," * `delete`: Delete an existing model."," * `read` : Load an existing model."," * `update`: Update an existing model.",""," @param {Object} [options] Sync options:"," @param {String} [options.csrfToken] The authenticity token used by the"," server to verify the validity of this request and protected against CSRF"," attacks. This overrides the default value provided by the static"," `CSRF_TOKEN` property."," @param {Object} [options.headers] The HTTP headers to mix with the default"," headers specified by the static `HTTP_HEADERS` property."," @param {Number} [options.timeout] The number of milliseconds before the"," request will timeout and be aborted. This overrides the default provided"," by the static `HTTP_TIMEOUT` property."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} [callback.response] The server's response."," **/"," sync: function (action, options, callback) {"," options || (options = {});",""," var url = this.getURL(action, options),"," method = RESTSync.HTTP_METHODS[action],"," headers = Y.merge(RESTSync.HTTP_HEADERS, options.headers),"," timeout = options.timeout || RESTSync.HTTP_TIMEOUT,"," csrfToken = options.csrfToken || RESTSync.CSRF_TOKEN,"," entity;",""," // Prepare the content if we are sending data to the server."," if (method === 'POST' || method === 'PUT') {"," entity = this.serialize(action);"," } else {"," // Remove header, no content is being sent."," delete headers['Content-Type'];"," }",""," // Setup HTTP emulation for older servers if we need it."," if (RESTSync.EMULATE_HTTP &&"," (method === 'PUT' || method === 'DELETE')) {",""," // Pass along original method type in the headers."," headers['X-HTTP-Method-Override'] = method;",""," // Fall-back to using POST method type."," method = 'POST';"," }",""," // Add CSRF token to HTTP request headers if one is specified and the"," // request will cause side effects on the server."," if (csrfToken &&"," (method === 'POST' || method === 'PUT' || method === 'DELETE')) {",""," headers['X-CSRF-Token'] = csrfToken;"," }",""," this._sendSyncIORequest({"," action : action,"," callback: callback,"," entity : entity,"," headers : headers,"," method : method,"," timeout : timeout,"," url : url"," });"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Joins the `root` URL to the specified `url`, normalizing leading/trailing"," \"/\" characters.",""," @example"," model.root = '/foo'"," model._joinURL('bar'); // => '/foo/bar'"," model._joinURL('/bar'); // => '/foo/bar'",""," model.root = '/foo/'"," model._joinURL('bar'); // => '/foo/bar/'"," model._joinURL('/bar'); // => '/foo/bar/'",""," @method _joinURL"," @param {String} url URL to append to the `root` URL."," @return {String} Joined URL."," @protected"," @since 3.6.0"," **/"," _joinURL: function (url) {"," var root = this.root;",""," if (!(root || url)) {"," return '';"," }",""," if (url.charAt(0) === '/') {"," url = url.substring(1);"," }",""," // Combines the `root` with the `url` and adds a trailing-slash if the"," // `root` has a trailing-slash."," return root && root.charAt(root.length - 1) === '/' ?"," root + url + '/' :"," root + '/' + url;"," },","",""," /**"," Calls both public, overrideable methods: `parseIOResponse()`, then `parse()`"," and returns the result.",""," This will call into `parseIOResponse()`, if it's defined as a method,"," passing it the full response object from the XHR and using its return value"," to pass along to the `parse()`. This enables developers to easily parse data"," out of the response headers which should be used by the `parse()` method.",""," @method _parse"," @param {Object} response Response object from `Y.io()`."," @return {Object|Object[]} Attribute hash or Array of model attribute hashes."," @protected"," @since 3.7.0"," **/"," _parse: function (response) {"," // When `parseIOResponse` is defined as a method, it will be invoked and"," // the result will become the new response object that the `parse()`"," // will be invoked with."," if (typeof this.parseIOResponse === 'function') {"," response = this.parseIOResponse(response);"," }",""," return this.parse(response);"," },",""," /**"," Performs the XHR and returns the resulting `Y.io()` request object.",""," This method is called by `sync()`.",""," @method _sendSyncIORequest"," @param {Object} config An object with the following properties:"," @param {String} config.action The `sync()` action being performed."," @param {Function} [config.callback] Called when the sync operation"," finishes."," @param {String} [config.entity] The HTTP request entity body."," @param {Object} config.headers The HTTP request headers."," @param {String} config.method The HTTP request method."," @param {Number} [config.timeout] Time until the HTTP request is aborted."," @param {String} config.url The URL of the HTTP resource."," @return {Object} The resulting `Y.io()` request object."," @protected"," @since 3.6.0"," **/"," _sendSyncIORequest: function (config) {"," return Y.io(config.url, {"," 'arguments': {"," action : config.action,"," callback: config.callback,"," url : config.url"," },",""," context: this,"," data : config.entity,"," headers: config.headers,"," method : config.method,"," timeout: config.timeout,",""," on: {"," start : this._onSyncIOStart,"," failure: this._onSyncIOFailure,"," success: this._onSyncIOSuccess,"," end : this._onSyncIOEnd"," }"," });"," },",""," /**"," Utility which takes a tokenized `url` string and substitutes its"," placeholders using a specified `data` object.",""," This method will property URL-encode any values before substituting them."," Also, only expect it to work with String and Number values.",""," @example"," var url = this._substituteURL('/users/{name}', {id: 'Eric F'});"," // => \"/users/Eric%20F\"",""," @method _substituteURL"," @param {String} url Tokenized URL string to substitute placeholder values."," @param {Object} data Set of data to fill in the `url`'s placeholders."," @return {String} Substituted URL."," @protected"," @since 3.6.0"," **/"," _substituteURL: function (url, data) {"," if (!url) {"," return '';"," }",""," var values = {};",""," // Creates a hash of the string and number values only to be used to"," // replace any placeholders in a tokenized `url`."," Y.Object.each(data, function (v, k) {"," if (Lang.isString(v) || Lang.isNumber(v)) {"," // URL-encode any string or number values."," values[k] = encodeURIComponent(v);"," }"," });",""," return Lang.sub(url, values);"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Called when the `Y.io` request has finished, after \"success\" or \"failure\""," has been determined.",""," This is a no-op by default, but provides a hook for overriding.",""," @method _onSyncIOEnd"," @param {String} txId The `Y.io` transaction id."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} details.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOEnd: function (txId, details) {},",""," /**"," Called when the `Y.io` request has finished unsuccessfully.",""," By default this calls the `details.callback` function passing it the HTTP"," status code and message as an error object along with the response body.",""," @method _onSyncIOFailure"," @param {String} txId The `Y.io` transaction id."," @param {Object} res The `Y.io` response object."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} details.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOFailure: function (txId, res, details) {"," var callback = details.callback;",""," if (callback) {"," callback({"," code: res.status,"," msg : res.statusText"," }, res);"," }"," },",""," /**"," Called when the `Y.io` request has finished successfully.",""," By default this calls the `details.callback` function passing it the"," response body.",""," @method _onSyncIOSuccess"," @param {String} txId The `Y.io` transaction id."," @param {Object} res The `Y.io` response object."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} details.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOSuccess: function (txId, res, details) {"," var callback = details.callback;",""," if (callback) {"," callback(null, res);"," }"," },",""," /**"," Called when the `Y.io` request is made.",""," This is a no-op by default, but provides a hook for overriding.",""," @method _onSyncIOStart"," @param {String} txId The `Y.io` transaction id."," @param {Object} details Extra details carried through from `sync()`:"," @param {String} detials.action The sync action performed."," @param {Function} [details.callback] The function to call after syncing."," @param {String} details.url The URL of the requested resource."," @protected"," @since 3.6.0"," **/"," _onSyncIOStart: function (txId, details) {}","};","","// -- Namespace ----------------------------------------------------------------","","Y.namespace('ModelSync').REST = RESTSync;","","","}, '3.7.3', {\"requires\": [\"model\", \"io-base\", \"json-stringify\"]});"]; _yuitest_coverage["build/model-sync-rest/model-sync-rest.js"].lines = {"1":0,"12":0,"48":0,"76":0,"92":0,"116":0,"136":0,"155":0,"168":0,"170":0,"297":0,"300":0,"301":0,"305":0,"306":0,"333":0,"339":0,"340":0,"341":0,"344":0,"352":0,"353":0,"359":0,"360":0,"365":0,"387":0,"412":0,"449":0,"451":0,"459":0,"460":0,"463":0,"467":0,"471":0,"474":0,"479":0,"482":0,"485":0,"518":0,"520":0,"521":0,"524":0,"525":0,"530":0,"555":0,"556":0,"559":0,"582":0,"623":0,"624":0,"627":0,"631":0,"632":0,"634":0,"638":0,"677":0,"679":0,"680":0,"704":0,"706":0,"707":0,"730":0}; _yuitest_coverage["build/model-sync-rest/model-sync-rest.js"].functions = {"RESTSync:48":0,"initializer:296":0,"getURL:332":0,"parseIOResponse:386":0,"serialize:411":0,"sync:448":0,"_joinURL:517":0,"_parse:551":0,"_sendSyncIORequest:581":0,"(anonymous 2):631":0,"_substituteURL:622":0,"_onSyncIOFailure:676":0,"_onSyncIOSuccess:703":0,"(anonymous 1):1":0}; _yuitest_coverage["build/model-sync-rest/model-sync-rest.js"].coveredLines = 62;@@ -844,4 +844,4 @@ Y.namespace('ModelSync').REST = RESTSync; -}, '3.7.2', {"requires": ["model", "io-base", "json-stringify"]});+}, '3.7.3', {"requires": ["model", "io-base", "json-stringify"]});
bundle/model-sync-rest/model-sync-rest-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -736,4 +736,4 @@ Y.namespace('ModelSync').REST = RESTSync; -}, '3.7.2', {"requires": ["model", "io-base", "json-stringify"]});+}, '3.7.3', {"requires": ["model", "io-base", "json-stringify"]});
bundle/model-sync-rest/model-sync-rest-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("model-sync-rest",function(e,t){function r(){}var n=e.Lang;r.CSRF_TOKEN=YUI.Env.CSRF_TOKEN,r.EMULATE_HTTP=!1,r.HTTP_HEADERS={Accept:"application/json","Content-Type":"application/json"},r.HTTP_METHODS={create:"POST",read:"GET",update:"PUT","delete":"DELETE"},r.HTTP_TIMEOUT=3e4,r._NON_ATTRS_CFG=["root","url"],r.prototype={root:"",url:"",initializer:function(e){e||(e={}),"root"in e&&(this.root=e.root||""),"url"in e&&(this.url=e.url||"")},getURL:function(t,n){var r=this.root,i=this.url;return this._isYUIModelList?i?this._substituteURL(i,e.merge(this.getAttrs(),n)):this.model.prototype.root:r&&(t==="create"||this.isNew())?r:i?this._substituteURL(i,e.merge(this.getAttrs(),n)):this._joinURL(this.getAsURL("id")||"")},parseIOResponse:function(e){return e.responseText},serialize:function(t){return e.JSON.stringify(this)},sync:function(t,n,i){n||(n={});var s=this.getURL(t,n),o=r.HTTP_METHODS[t],u=e.merge(r.HTTP_HEADERS,n.headers),a=n.timeout||r.HTTP_TIMEOUT,f=n.csrfToken||r.CSRF_TOKEN,l;o==="POST"||o==="PUT"?l=this.serialize(t):delete u["Content-Type"],r.EMULATE_HTTP&&(o==="PUT"||o==="DELETE")&&(u["X-HTTP-Method-Override"]=o,o="POST"),f&&(o==="POST"||o==="PUT"||o==="DELETE")&&(u["X-CSRF-Token"]=f),this._sendSyncIORequest({action:t,callback:i,entity:l,headers:u,method:o,timeout:a,url:s})},_joinURL:function(e){var t=this.root;return!t&&!e?"":(e.charAt(0)==="/"&&(e=e.substring(1)),t&&t.charAt(t.length-1)==="/"?t+e+"/":t+"/"+e)},_parse:function(e){return typeof this.parseIOResponse=="function"&&(e=this.parseIOResponse(e)),this.parse(e)},_sendSyncIORequest:function(t){return e.io(t.url,{arguments:{action:t.action,callback:t.callback,url:t.url},context:this,data:t.entity,headers:t.headers,method:t.method,timeout:t.timeout,on:{start:this._onSyncIOStart,failure:this._onSyncIOFailure,success:this._onSyncIOSuccess,end:this._onSyncIOEnd}})},_substituteURL:function(t,r){if(!t)return"";var i={};return e.Object.each(r,function(e,t){if(n.isString(e)||n.isNumber(e))i[t]=encodeURIComponent(e)}),n.sub(t,i)},_onSyncIOEnd:function(e,t){},_onSyncIOFailure:function(e,t,n){var r=n.callback;r&&r({code:t.status,msg:t.statusText},t)},_onSyncIOSuccess:function(e,t,n){var r=n.callback;r&&r(null,t)},_onSyncIOStart:function(e,t){}},e.namespace("ModelSync").REST=r},"3.7.2",{requires:["model","io-base","json-stringify"]});+YUI.add("model-sync-rest",function(e,t){function r(){}var n=e.Lang;r.CSRF_TOKEN=YUI.Env.CSRF_TOKEN,r.EMULATE_HTTP=!1,r.HTTP_HEADERS={Accept:"application/json","Content-Type":"application/json"},r.HTTP_METHODS={create:"POST",read:"GET",update:"PUT","delete":"DELETE"},r.HTTP_TIMEOUT=3e4,r._NON_ATTRS_CFG=["root","url"],r.prototype={root:"",url:"",initializer:function(e){e||(e={}),"root"in e&&(this.root=e.root||""),"url"in e&&(this.url=e.url||"")},getURL:function(t,n){var r=this.root,i=this.url;return this._isYUIModelList?i?this._substituteURL(i,e.merge(this.getAttrs(),n)):this.model.prototype.root:r&&(t==="create"||this.isNew())?r:i?this._substituteURL(i,e.merge(this.getAttrs(),n)):this._joinURL(this.getAsURL("id")||"")},parseIOResponse:function(e){return e.responseText},serialize:function(t){return e.JSON.stringify(this)},sync:function(t,n,i){n||(n={});var s=this.getURL(t,n),o=r.HTTP_METHODS[t],u=e.merge(r.HTTP_HEADERS,n.headers),a=n.timeout||r.HTTP_TIMEOUT,f=n.csrfToken||r.CSRF_TOKEN,l;o==="POST"||o==="PUT"?l=this.serialize(t):delete u["Content-Type"],r.EMULATE_HTTP&&(o==="PUT"||o==="DELETE")&&(u["X-HTTP-Method-Override"]=o,o="POST"),f&&(o==="POST"||o==="PUT"||o==="DELETE")&&(u["X-CSRF-Token"]=f),this._sendSyncIORequest({action:t,callback:i,entity:l,headers:u,method:o,timeout:a,url:s})},_joinURL:function(e){var t=this.root;return!t&&!e?"":(e.charAt(0)==="/"&&(e=e.substring(1)),t&&t.charAt(t.length-1)==="/"?t+e+"/":t+"/"+e)},_parse:function(e){return typeof this.parseIOResponse=="function"&&(e=this.parseIOResponse(e)),this.parse(e)},_sendSyncIORequest:function(t){return e.io(t.url,{arguments:{action:t.action,callback:t.callback,url:t.url},context:this,data:t.entity,headers:t.headers,method:t.method,timeout:t.timeout,on:{start:this._onSyncIOStart,failure:this._onSyncIOFailure,success:this._onSyncIOSuccess,end:this._onSyncIOEnd}})},_substituteURL:function(t,r){if(!t)return"";var i={};return e.Object.each(r,function(e,t){if(n.isString(e)||n.isNumber(e))i[t]=encodeURIComponent(e)}),n.sub(t,i)},_onSyncIOEnd:function(e,t){},_onSyncIOFailure:function(e,t,n){var r=n.callback;r&&r({code:t.status,msg:t.statusText},t)},_onSyncIOSuccess:function(e,t,n){var r=n.callback;r&&r(null,t)},_onSyncIOStart:function(e,t){}},e.namespace("ModelSync").REST=r},"3.7.3",{requires:["model","io-base","json-stringify"]});
bundle/model-sync-rest/model-sync-rest.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -736,4 +736,4 @@ Y.namespace('ModelSync').REST = RESTSync; -}, '3.7.2', {"requires": ["model", "io-base", "json-stringify"]});+}, '3.7.3', {"requires": ["model", "io-base", "json-stringify"]});
bundle/model/model-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/model/model.js", code: [] };-_yuitest_coverage["build/model/model.js"].code=["YUI.add('model', function (Y, NAME) {","","/**","Attribute-based data model with APIs for getting, setting, validating, and","syncing attribute values, as well as events for being notified of model changes.","","@module app","@submodule model","@since 3.4.0","**/","","/**","Attribute-based data model with APIs for getting, setting, validating, and","syncing attribute values, as well as events for being notified of model changes.","","In most cases, you'll want to create your own subclass of `Y.Model` and","customize it to meet your needs. In particular, the `sync()` and `validate()`","methods are meant to be overridden by custom implementations. You may also want","to override the `parse()` method to parse non-generic server responses.","","@class Model","@constructor","@extends Base","@since 3.4.0","**/","","var GlobalEnv = YUI.namespace('Env.Model'),"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,",""," /**"," Fired when one or more attributes on this model are changed.",""," @event change"," @param {Object} changed Hash of change information for each attribute that"," changed. Each item in the hash has the following properties:"," @param {Any} changed.newVal New value of the attribute."," @param {Any} changed.prevVal Previous value of the attribute."," @param {String|null} changed.src Source of the change event, if any."," **/"," EVT_CHANGE = 'change',",""," /**"," Fired when an error occurs, such as when the model doesn't validate or when"," a sync layer response can't be parsed.",""," @event error"," @param {Any} error Error message, object, or exception generated by the"," error. Calling `toString()` on this should result in a meaningful error"," message."," @param {String} src Source of the error. May be one of the following (or any"," custom error source defined by a Model subclass):",""," * `load`: An error loading the model from a sync layer. The sync layer's"," response (if any) will be provided as the `response` property on the"," event facade.",""," * `parse`: An error parsing a JSON response. The response in question will"," be provided as the `response` property on the event facade.",""," * `save`: An error saving the model to a sync layer. The sync layer's"," response (if any) will be provided as the `response` property on the"," event facade.",""," * `validate`: The model failed to validate. The attributes being validated"," will be provided as the `attributes` property on the event facade."," **/"," EVT_ERROR = 'error',",""," /**"," Fired after model attributes are loaded from a sync layer.",""," @event load"," @param {Object} parsed The parsed version of the sync layer's response to"," the load request."," @param {any} response The sync layer's raw, unparsed response to the load"," request."," @since 3.5.0"," **/"," EVT_LOAD = 'load',",""," /**"," Fired after model attributes are saved to a sync layer.",""," @event save"," @param {Object} [parsed] The parsed version of the sync layer's response to"," the save request, if there was a response."," @param {any} [response] The sync layer's raw, unparsed response to the save"," request, if there was one."," @since 3.5.0"," **/"," EVT_SAVE = 'save';","","function Model() {"," Model.superclass.constructor.apply(this, arguments);","}","","Y.Model = Y.extend(Model, Y.Base, {"," // -- Public Properties ----------------------------------------------------",""," /**"," Hash of attributes that have changed since the last time this model was"," saved.",""," @property changed"," @type Object"," @default {}"," **/",""," /**"," Name of the attribute to use as the unique id (or primary key) for this"," model.",""," The default is `id`, but if your persistence layer uses a different name for"," the primary key (such as `_id` or `uid`), you can specify that here.",""," The built-in `id` attribute will always be an alias for whatever attribute"," name you specify here, so getting and setting `id` will always behave the"," same as getting and setting your custom id attribute.",""," @property idAttribute"," @type String"," @default `'id'`"," **/"," idAttribute: 'id',",""," /**"," Hash of attributes that were changed in the last `change` event. Each item"," in this hash is an object with the following properties:",""," * `newVal`: The new value of the attribute after it changed."," * `prevVal`: The old value of the attribute before it changed."," * `src`: The source of the change, or `null` if no source was specified.",""," @property lastChange"," @type Object"," @default {}"," **/",""," /**"," Array of `ModelList` instances that contain this model.",""," When a model is in one or more lists, the model's events will bubble up to"," those lists. You can subscribe to a model event on a list to be notified"," when any model in the list fires that event.",""," This property is updated automatically when this model is added to or"," removed from a `ModelList` instance. You shouldn't alter it manually. When"," working with models in a list, you should always add and remove models using"," the list's `add()` and `remove()` methods.",""," @example Subscribing to model events on a list:",""," // Assuming `list` is an existing Y.ModelList instance."," list.on('*:change', function (e) {"," // This function will be called whenever any model in the list"," // fires a `change` event."," //"," // `e.target` will refer to the model instance that fired the"," // event."," });",""," @property lists"," @type ModelList[]"," @default `[]`"," **/",""," // -- Protected Properties -------------------------------------------------",""," /**"," This tells `Y.Base` that it should create ad-hoc attributes for config"," properties passed to Model's constructor. This makes it possible to"," instantiate a model and set a bunch of attributes without having to subclass"," `Y.Model` and declare all those attributes first.",""," @property _allowAdHocAttrs"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _allowAdHocAttrs: true,",""," /**"," Total hack to allow us to identify Model instances without using"," `instanceof`, which won't work when the instance was created in another"," window or YUI sandbox.",""," @property _isYUIModel"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _isYUIModel: true,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," this.changed = {};"," this.lastChange = {};"," this.lists = [];"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Destroys this model instance and removes it from its containing lists, if"," any.",""," The _callback_, if one is provided, will be called after the model is"," destroyed.",""," If `options.remove` is `true`, then this method delegates to the `sync()`"," method to delete the model from the persistence layer, which is an"," asynchronous action. In this case, the _callback_ (if provided) will be"," called after the sync layer indicates success or failure of the delete"," operation.",""," @method destroy"," @param {Object} [options] Sync options. It's up to the custom sync"," implementation to determine what options it supports or requires, if"," any."," @param {Boolean} [options.remove=false] If `true`, the model will be"," deleted via the sync layer in addition to the instance being destroyed."," @param {callback} [callback] Called after the model has been destroyed (and"," deleted via the sync layer if `options.remove` is `true`)."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. Otherwise _err_ will be `null`."," @chainable"," **/"," destroy: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = null;"," }",""," self.onceAfter('destroy', function () {"," function finish(err) {"," if (!err) {"," YArray.each(self.lists.concat(), function (list) {"," list.remove(self, options);"," });"," }",""," callback && callback.apply(null, arguments);"," }",""," if (options && (options.remove || options['delete'])) {"," self.sync('delete', options, finish);"," } else {"," finish();"," }"," });",""," return Model.superclass.destroy.call(self);"," },",""," /**"," Returns a clientId string that's unique among all models on the current page"," (even models in other YUI instances). Uniqueness across pageviews is"," unlikely.",""," @method generateClientId"," @return {String} Unique clientId."," **/"," generateClientId: function () {"," GlobalEnv.lastId || (GlobalEnv.lastId = 0);"," return this.constructor.NAME + '_' + (GlobalEnv.lastId += 1);"," },",""," /**"," Returns the value of the specified attribute.",""," If the attribute's value is an object, _name_ may use dot notation to"," specify the path to a specific property within the object, and the value of"," that property will be returned.",""," @example"," // Set the 'foo' attribute to an object."," myModel.set('foo', {"," bar: {"," baz: 'quux'"," }"," });",""," // Get the value of 'foo'."," myModel.get('foo');"," // => {bar: {baz: 'quux'}}",""," // Get the value of 'foo.bar.baz'."," myModel.get('foo.bar.baz');"," // => 'quux'",""," @method get"," @param {String} name Attribute name or object property path."," @return {Any} Attribute value, or `undefined` if the attribute doesn't"," exist."," **/",""," // get() is defined by Y.Attribute.",""," /**"," Returns an HTML-escaped version of the value of the specified string"," attribute. The value is escaped using `Y.Escape.html()`.",""," @method getAsHTML"," @param {String} name Attribute name or object property path."," @return {String} HTML-escaped attribute value."," **/"," getAsHTML: function (name) {"," var value = this.get(name);"," return Y.Escape.html(Lang.isValue(value) ? String(value) : '');"," },",""," /**"," Returns a URL-encoded version of the value of the specified string"," attribute. The value is encoded using the native `encodeURIComponent()`"," function.",""," @method getAsURL"," @param {String} name Attribute name or object property path."," @return {String} URL-encoded attribute value."," **/"," getAsURL: function (name) {"," var value = this.get(name);"," return encodeURIComponent(Lang.isValue(value) ? String(value) : '');"," },",""," /**"," Returns `true` if any attribute of this model has been changed since the"," model was last saved.",""," New models (models for which `isNew()` returns `true`) are implicitly"," considered to be \"modified\" until the first time they're saved.",""," @method isModified"," @return {Boolean} `true` if this model has changed since it was last saved,"," `false` otherwise."," **/"," isModified: function () {"," return this.isNew() || !YObject.isEmpty(this.changed);"," },",""," /**"," Returns `true` if this model is \"new\", meaning it hasn't been saved since it"," was created.",""," Newness is determined by checking whether the model's `id` attribute has"," been set. An empty id is assumed to indicate a new model, whereas a"," non-empty id indicates a model that was either loaded or has been saved"," since it was created.",""," @method isNew"," @return {Boolean} `true` if this model is new, `false` otherwise."," **/"," isNew: function () {"," return !Lang.isValue(this.get('id'));"," },",""," /**"," Loads this model from the server.",""," This method delegates to the `sync()` method to perform the actual load"," operation, which is an asynchronous action. Specify a _callback_ function to"," be notified of success or failure.",""," A successful load operation will fire a `load` event, while an unsuccessful"," load operation will fire an `error` event with the `src` value \"load\".",""," If the load operation succeeds and one or more of the loaded attributes"," differ from this model's current attributes, a `change` event will be fired.",""," @method load"," @param {Object} [options] Options to be passed to `sync()` and to `set()`"," when setting the loaded attributes. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {callback} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @chainable"," **/"," load: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," self.sync('read', options, function (err, response) {"," var facade = {"," options : options,"," response: response"," },",""," parsed;",""," if (err) {"," facade.error = err;"," facade.src = 'load';",""," self.fire(EVT_ERROR, facade);"," } else {"," // Lazy publish."," if (!self._loadEvent) {"," self._loadEvent = self.publish(EVT_LOAD, {"," preventable: false"," });"," }",""," parsed = facade.parsed = self._parse(response);",""," self.setAttrs(parsed, options);"," self.changed = {};",""," self.fire(EVT_LOAD, facade);"," }",""," callback && callback.apply(null, arguments);"," });",""," return self;"," },",""," /**"," Called to parse the _response_ when the model is loaded from the server."," This method receives a server _response_ and is expected to return an"," attribute hash.",""," The default implementation assumes that _response_ is either an attribute"," hash or a JSON string that can be parsed into an attribute hash. If"," _response_ is a JSON string and either `Y.JSON` or the native `JSON` object"," are available, it will be parsed automatically. If a parse error occurs, an"," `error` event will be fired and the model will not be updated.",""," You may override this method to implement custom parsing logic if necessary.",""," @method parse"," @param {Any} response Server response."," @return {Object} Attribute hash."," **/"," parse: function (response) {"," if (typeof response === 'string') {"," try {"," return Y.JSON.parse(response);"," } catch (ex) {"," this.fire(EVT_ERROR, {"," error : ex,"," response: response,"," src : 'parse'"," });",""," return null;"," }"," }",""," return response;"," },",""," /**"," Saves this model to the server.",""," This method delegates to the `sync()` method to perform the actual save"," operation, which is an asynchronous action. Specify a _callback_ function to"," be notified of success or failure.",""," A successful save operation will fire a `save` event, while an unsuccessful"," save operation will fire an `error` event with the `src` value \"save\".",""," If the save operation succeeds and one or more of the attributes returned in"," the server's response differ from this model's current attributes, a"," `change` event will be fired.",""," @method save"," @param {Object} [options] Options to be passed to `sync()` and to `set()`"," when setting synced attributes. It's up to the custom sync implementation"," to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @chainable"," **/"," save: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," self._validate(self.toJSON(), function (err) {"," if (err) {"," callback && callback.call(null, err);"," return;"," }",""," self.sync(self.isNew() ? 'create' : 'update', options, function (err, response) {"," var facade = {"," options : options,"," response: response"," },",""," parsed;",""," if (err) {"," facade.error = err;"," facade.src = 'save';",""," self.fire(EVT_ERROR, facade);"," } else {"," // Lazy publish."," if (!self._saveEvent) {"," self._saveEvent = self.publish(EVT_SAVE, {"," preventable: false"," });"," }",""," if (response) {"," parsed = facade.parsed = self._parse(response);"," self.setAttrs(parsed, options);"," }",""," self.changed = {};"," self.fire(EVT_SAVE, facade);"," }",""," callback && callback.apply(null, arguments);"," });"," });",""," return self;"," },",""," /**"," Sets the value of a single attribute. If model validation fails, the"," attribute will not be set and an `error` event will be fired.",""," Use `setAttrs()` to set multiple attributes at once.",""," @example"," model.set('foo', 'bar');",""," @method set"," @param {String} name Attribute name or object property path."," @param {any} value Value to set."," @param {Object} [options] Data to be mixed into the event facade of the"," `change` event(s) for these attributes."," @param {Boolean} [options.silent=false] If `true`, no `change` event will"," be fired."," @chainable"," **/"," set: function (name, value, options) {"," var attributes = {};"," attributes[name] = value;",""," return this.setAttrs(attributes, options);"," },",""," /**"," Sets the values of multiple attributes at once. If model validation fails,"," the attributes will not be set and an `error` event will be fired.",""," @example"," model.setAttrs({"," foo: 'bar',"," baz: 'quux'"," });",""," @method setAttrs"," @param {Object} attributes Hash of attribute names and values to set."," @param {Object} [options] Data to be mixed into the event facade of the"," `change` event(s) for these attributes."," @param {Boolean} [options.silent=false] If `true`, no `change` event will"," be fired."," @chainable"," **/"," setAttrs: function (attributes, options) {"," var idAttribute = this.idAttribute,"," changed, e, key, lastChange, transaction;",""," options || (options = {});"," transaction = options._transaction = {};",""," // When a custom id attribute is in use, always keep the default `id`"," // attribute in sync."," if (idAttribute !== 'id') {"," // So we don't modify someone else's object."," attributes = Y.merge(attributes);",""," if (YObject.owns(attributes, idAttribute)) {"," attributes.id = attributes[idAttribute];"," } else if (YObject.owns(attributes, 'id')) {"," attributes[idAttribute] = attributes.id;"," }"," }",""," for (key in attributes) {"," if (YObject.owns(attributes, key)) {"," this._setAttr(key, attributes[key], options);"," }"," }",""," if (!YObject.isEmpty(transaction)) {"," changed = this.changed;"," lastChange = this.lastChange = {};",""," for (key in transaction) {"," if (YObject.owns(transaction, key)) {"," e = transaction[key];",""," changed[key] = e.newVal;",""," lastChange[key] = {"," newVal : e.newVal,"," prevVal: e.prevVal,"," src : e.src || null"," };"," }"," }",""," if (!options.silent) {"," // Lazy publish for the change event."," if (!this._changeEvent) {"," this._changeEvent = this.publish(EVT_CHANGE, {"," preventable: false"," });"," }",""," this.fire(EVT_CHANGE, Y.merge(options, {changed: lastChange}));"," }"," }",""," return this;"," },",""," /**"," Override this method to provide a custom persistence implementation for this"," model. The default just calls the callback without actually doing anything.",""," This method is called internally by `load()`, `save()`, and `destroy()`.",""," @method sync"," @param {String} action Sync action to perform. May be one of the following:",""," * `create`: Store a newly-created model for the first time."," * `delete`: Delete an existing model."," * `read` : Load an existing model."," * `update`: Update an existing model.",""," @param {Object} [options] Sync options. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} [callback.response] The server's response."," **/"," sync: function (/* action, options, callback */) {"," var callback = YArray(arguments, 0, true).pop();",""," if (typeof callback === 'function') {"," callback();"," }"," },",""," /**"," Returns a copy of this model's attributes that can be passed to"," `Y.JSON.stringify()` or used for other nefarious purposes.",""," The `clientId` attribute is not included in the returned object.",""," If you've specified a custom attribute name in the `idAttribute` property,"," the default `id` attribute will not be included in the returned object.",""," Note: The ECMAScript 5 specification states that objects may implement a"," `toJSON` method to provide an alternate object representation to serialize"," when passed to `JSON.stringify(obj)`. This allows class instances to be"," serialized as if they were plain objects. This is why Model's `toJSON`"," returns an object, not a JSON string.",""," See <http://es5.github.com/#x15.12.3> for details.",""," @method toJSON"," @return {Object} Copy of this model's attributes."," **/"," toJSON: function () {"," var attrs = this.getAttrs();",""," delete attrs.clientId;"," delete attrs.destroyed;"," delete attrs.initialized;",""," if (this.idAttribute !== 'id') {"," delete attrs.id;"," }",""," return attrs;"," },",""," /**"," Reverts the last change to the model.",""," If an _attrNames_ array is provided, then only the named attributes will be"," reverted (and only if they were modified in the previous change). If no"," _attrNames_ array is provided, then all changed attributes will be reverted"," to their previous values.",""," Note that only one level of undo is available: from the current state to the"," previous state. If `undo()` is called when no previous state is available,"," it will simply do nothing.",""," @method undo"," @param {Array} [attrNames] Array of specific attribute names to revert. If"," not specified, all attributes modified in the last change will be"," reverted."," @param {Object} [options] Data to be mixed into the event facade of the"," change event(s) for these attributes."," @param {Boolean} [options.silent=false] If `true`, no `change` event will"," be fired."," @chainable"," **/"," undo: function (attrNames, options) {"," var lastChange = this.lastChange,"," idAttribute = this.idAttribute,"," toUndo = {},"," needUndo;",""," attrNames || (attrNames = YObject.keys(lastChange));",""," YArray.each(attrNames, function (name) {"," if (YObject.owns(lastChange, name)) {"," // Don't generate a double change for custom id attributes."," name = name === idAttribute ? 'id' : name;",""," needUndo = true;"," toUndo[name] = lastChange[name].prevVal;"," }"," });",""," return needUndo ? this.setAttrs(toUndo, options) : this;"," },",""," /**"," Override this method to provide custom validation logic for this model.",""," While attribute-specific validators can be used to validate individual"," attributes, this method gives you a hook to validate a hash of all"," attributes before the model is saved. This method is called automatically"," before `save()` takes any action. If validation fails, the `save()` call"," will be aborted.",""," In your validation method, call the provided `callback` function with no"," arguments to indicate success. To indicate failure, pass a single argument,"," which may contain an error message, an array of error messages, or any other"," value. This value will be passed along to the `error` event.",""," @example",""," model.validate = function (attrs, callback) {"," if (attrs.pie !== true) {"," // No pie?! Invalid!"," callback('Must provide pie.');"," return;"," }",""," // Success!"," callback();"," };",""," @method validate"," @param {Object} attrs Attribute hash containing all model attributes to"," be validated."," @param {Function} callback Validation callback. Call this function when your"," validation logic finishes. To trigger a validation failure, pass any"," value as the first argument to the callback (ideally a meaningful"," validation error of some kind).",""," @param {Any} [callback.err] Validation error. Don't provide this"," argument if validation succeeds. If validation fails, set this to an"," error message or some other meaningful value. It will be passed"," along to the resulting `error` event."," **/"," validate: function (attrs, callback) {"," callback && callback();"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Duckpunches the `addAttr` method provided by `Y.Attribute` to keep the"," `id` attribute’s value and a custom id attribute’s (if provided) value"," in sync when adding the attributes to the model instance object.",""," Marked as protected to hide it from Model's public API docs, even though"," this is a public method in Attribute.",""," @method addAttr"," @param {String} name The name of the attribute."," @param {Object} config An object with attribute configuration property/value"," pairs, specifying the configuration for the attribute."," @param {Boolean} lazy (optional) Whether or not to add this attribute lazily"," (on the first call to get/set)."," @return {Object} A reference to the host object."," @chainable"," @protected"," **/"," addAttr: function (name, config, lazy) {"," var idAttribute = this.idAttribute,"," idAttrCfg, id;",""," if (idAttribute && name === idAttribute) {"," idAttrCfg = this._isLazyAttr('id') || this._getAttrCfg('id');"," id = config.value === config.defaultValue ? null : config.value;",""," if (!Lang.isValue(id)) {"," // Hunt for the id value."," id = idAttrCfg.value === idAttrCfg.defaultValue ? null : idAttrCfg.value;",""," if (!Lang.isValue(id)) {"," // No id value provided on construction, check defaults."," id = Lang.isValue(config.defaultValue) ?"," config.defaultValue :"," idAttrCfg.defaultValue;"," }"," }",""," config.value = id;",""," // Make sure `id` is in sync."," if (idAttrCfg.value !== id) {"," idAttrCfg.value = id;",""," if (this._isLazyAttr('id')) {"," this._state.add('id', 'lazy', idAttrCfg);"," } else {"," this._state.add('id', 'value', id);"," }"," }"," }",""," return Model.superclass.addAttr.apply(this, arguments);"," },",""," /**"," Calls the public, overrideable `parse()` method and returns the result.",""," Override this method to provide a custom pre-parsing implementation. This"," provides a hook for custom persistence implementations to \"prep\" a response"," before calling the `parse()` method.",""," @method _parse"," @param {Any} response Server response."," @return {Object} Attribute hash."," @protected"," @see Model.parse()"," @since 3.7.0"," **/"," _parse: function (response) {"," return this.parse(response);"," },",""," /**"," Calls the public, overridable `validate()` method and fires an `error` event"," if validation fails.",""," @method _validate"," @param {Object} attributes Attribute hash."," @param {Function} callback Validation callback."," @param {Any} [callback.err] Value on failure, non-value on success."," @protected"," **/"," _validate: function (attributes, callback) {"," var self = this;",""," function handler(err) {"," if (Lang.isValue(err)) {"," // Validation failed. Fire an error."," self.fire(EVT_ERROR, {"," attributes: attributes,"," error : err,"," src : 'validate'"," });",""," callback(err);"," return;"," }",""," callback();"," }",""," if (self.validate.length === 1) {"," // Backcompat for 3.4.x-style synchronous validate() functions that"," // don't take a callback argument."," handler(self.validate(attributes, handler));"," } else {"," self.validate(attributes, handler);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Duckpunches the `_defAttrChangeFn()` provided by `Y.Attribute` so we can"," have a single global notification when a change event occurs.",""," @method _defAttrChangeFn"," @param {EventFacade} e"," @protected"," **/"," _defAttrChangeFn: function (e) {"," var attrName = e.attrName;",""," if (!this._setAttrVal(attrName, e.subAttrName, e.prevVal, e.newVal)) {"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," e.newVal = this.get(attrName);",""," if (e._transaction) {"," e._transaction[attrName] = e;"," }"," }"," }","}, {"," NAME: 'model',",""," ATTRS: {"," /**"," A client-only identifier for this model.",""," Like the `id` attribute, `clientId` may be used to retrieve model"," instances from lists. Unlike the `id` attribute, `clientId` is"," automatically generated, and is only intended to be used on the client"," during the current pageview.",""," @attribute clientId"," @type String"," @readOnly"," **/"," clientId: {"," valueFn : 'generateClientId',"," readOnly: true"," },",""," /**"," A unique identifier for this model. Among other things, this id may be"," used to retrieve model instances from lists, so it should be unique.",""," If the id is empty, this model instance is assumed to represent a new"," item that hasn't yet been saved.",""," If you would prefer to use a custom attribute as this model's id instead"," of using the `id` attribute (for example, maybe you'd rather use `_id`"," or `uid` as the primary id), you may set the `idAttribute` property to"," the name of your custom id attribute. The `id` attribute will then"," act as an alias for your custom attribute.",""," @attribute id"," @type String|Number|null"," @default `null`"," **/"," id: {value: null}"," }","});","","","}, '3.7.2', {\"requires\": [\"base-build\", \"escape\", \"json-parse\"]});"];+_yuitest_coverage["build/model/model.js"].code=["YUI.add('model', function (Y, NAME) {","","/**","Attribute-based data model with APIs for getting, setting, validating, and","syncing attribute values, as well as events for being notified of model changes.","","@module app","@submodule model","@since 3.4.0","**/","","/**","Attribute-based data model with APIs for getting, setting, validating, and","syncing attribute values, as well as events for being notified of model changes.","","In most cases, you'll want to create your own subclass of `Y.Model` and","customize it to meet your needs. In particular, the `sync()` and `validate()`","methods are meant to be overridden by custom implementations. You may also want","to override the `parse()` method to parse non-generic server responses.","","@class Model","@constructor","@extends Base","@since 3.4.0","**/","","var GlobalEnv = YUI.namespace('Env.Model'),"," Lang = Y.Lang,"," YArray = Y.Array,"," YObject = Y.Object,",""," /**"," Fired when one or more attributes on this model are changed.",""," @event change"," @param {Object} changed Hash of change information for each attribute that"," changed. Each item in the hash has the following properties:"," @param {Any} changed.newVal New value of the attribute."," @param {Any} changed.prevVal Previous value of the attribute."," @param {String|null} changed.src Source of the change event, if any."," **/"," EVT_CHANGE = 'change',",""," /**"," Fired when an error occurs, such as when the model doesn't validate or when"," a sync layer response can't be parsed.",""," @event error"," @param {Any} error Error message, object, or exception generated by the"," error. Calling `toString()` on this should result in a meaningful error"," message."," @param {String} src Source of the error. May be one of the following (or any"," custom error source defined by a Model subclass):",""," * `load`: An error loading the model from a sync layer. The sync layer's"," response (if any) will be provided as the `response` property on the"," event facade.",""," * `parse`: An error parsing a JSON response. The response in question will"," be provided as the `response` property on the event facade.",""," * `save`: An error saving the model to a sync layer. The sync layer's"," response (if any) will be provided as the `response` property on the"," event facade.",""," * `validate`: The model failed to validate. The attributes being validated"," will be provided as the `attributes` property on the event facade."," **/"," EVT_ERROR = 'error',",""," /**"," Fired after model attributes are loaded from a sync layer.",""," @event load"," @param {Object} parsed The parsed version of the sync layer's response to"," the load request."," @param {any} response The sync layer's raw, unparsed response to the load"," request."," @since 3.5.0"," **/"," EVT_LOAD = 'load',",""," /**"," Fired after model attributes are saved to a sync layer.",""," @event save"," @param {Object} [parsed] The parsed version of the sync layer's response to"," the save request, if there was a response."," @param {any} [response] The sync layer's raw, unparsed response to the save"," request, if there was one."," @since 3.5.0"," **/"," EVT_SAVE = 'save';","","function Model() {"," Model.superclass.constructor.apply(this, arguments);","}","","Y.Model = Y.extend(Model, Y.Base, {"," // -- Public Properties ----------------------------------------------------",""," /**"," Hash of attributes that have changed since the last time this model was"," saved.",""," @property changed"," @type Object"," @default {}"," **/",""," /**"," Name of the attribute to use as the unique id (or primary key) for this"," model.",""," The default is `id`, but if your persistence layer uses a different name for"," the primary key (such as `_id` or `uid`), you can specify that here.",""," The built-in `id` attribute will always be an alias for whatever attribute"," name you specify here, so getting and setting `id` will always behave the"," same as getting and setting your custom id attribute.",""," @property idAttribute"," @type String"," @default `'id'`"," **/"," idAttribute: 'id',",""," /**"," Hash of attributes that were changed in the last `change` event. Each item"," in this hash is an object with the following properties:",""," * `newVal`: The new value of the attribute after it changed."," * `prevVal`: The old value of the attribute before it changed."," * `src`: The source of the change, or `null` if no source was specified.",""," @property lastChange"," @type Object"," @default {}"," **/",""," /**"," Array of `ModelList` instances that contain this model.",""," When a model is in one or more lists, the model's events will bubble up to"," those lists. You can subscribe to a model event on a list to be notified"," when any model in the list fires that event.",""," This property is updated automatically when this model is added to or"," removed from a `ModelList` instance. You shouldn't alter it manually. When"," working with models in a list, you should always add and remove models using"," the list's `add()` and `remove()` methods.",""," @example Subscribing to model events on a list:",""," // Assuming `list` is an existing Y.ModelList instance."," list.on('*:change', function (e) {"," // This function will be called whenever any model in the list"," // fires a `change` event."," //"," // `e.target` will refer to the model instance that fired the"," // event."," });",""," @property lists"," @type ModelList[]"," @default `[]`"," **/",""," // -- Protected Properties -------------------------------------------------",""," /**"," This tells `Y.Base` that it should create ad-hoc attributes for config"," properties passed to Model's constructor. This makes it possible to"," instantiate a model and set a bunch of attributes without having to subclass"," `Y.Model` and declare all those attributes first.",""," @property _allowAdHocAttrs"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _allowAdHocAttrs: true,",""," /**"," Total hack to allow us to identify Model instances without using"," `instanceof`, which won't work when the instance was created in another"," window or YUI sandbox.",""," @property _isYUIModel"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _isYUIModel: true,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," this.changed = {};"," this.lastChange = {};"," this.lists = [];"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Destroys this model instance and removes it from its containing lists, if"," any.",""," The _callback_, if one is provided, will be called after the model is"," destroyed.",""," If `options.remove` is `true`, then this method delegates to the `sync()`"," method to delete the model from the persistence layer, which is an"," asynchronous action. In this case, the _callback_ (if provided) will be"," called after the sync layer indicates success or failure of the delete"," operation.",""," @method destroy"," @param {Object} [options] Sync options. It's up to the custom sync"," implementation to determine what options it supports or requires, if"," any."," @param {Boolean} [options.remove=false] If `true`, the model will be"," deleted via the sync layer in addition to the instance being destroyed."," @param {callback} [callback] Called after the model has been destroyed (and"," deleted via the sync layer if `options.remove` is `true`)."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. Otherwise _err_ will be `null`."," @chainable"," **/"," destroy: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = null;"," }",""," self.onceAfter('destroy', function () {"," function finish(err) {"," if (!err) {"," YArray.each(self.lists.concat(), function (list) {"," list.remove(self, options);"," });"," }",""," callback && callback.apply(null, arguments);"," }",""," if (options && (options.remove || options['delete'])) {"," self.sync('delete', options, finish);"," } else {"," finish();"," }"," });",""," return Model.superclass.destroy.call(self);"," },",""," /**"," Returns a clientId string that's unique among all models on the current page"," (even models in other YUI instances). Uniqueness across pageviews is"," unlikely.",""," @method generateClientId"," @return {String} Unique clientId."," **/"," generateClientId: function () {"," GlobalEnv.lastId || (GlobalEnv.lastId = 0);"," return this.constructor.NAME + '_' + (GlobalEnv.lastId += 1);"," },",""," /**"," Returns the value of the specified attribute.",""," If the attribute's value is an object, _name_ may use dot notation to"," specify the path to a specific property within the object, and the value of"," that property will be returned.",""," @example"," // Set the 'foo' attribute to an object."," myModel.set('foo', {"," bar: {"," baz: 'quux'"," }"," });",""," // Get the value of 'foo'."," myModel.get('foo');"," // => {bar: {baz: 'quux'}}",""," // Get the value of 'foo.bar.baz'."," myModel.get('foo.bar.baz');"," // => 'quux'",""," @method get"," @param {String} name Attribute name or object property path."," @return {Any} Attribute value, or `undefined` if the attribute doesn't"," exist."," **/",""," // get() is defined by Y.Attribute.",""," /**"," Returns an HTML-escaped version of the value of the specified string"," attribute. The value is escaped using `Y.Escape.html()`.",""," @method getAsHTML"," @param {String} name Attribute name or object property path."," @return {String} HTML-escaped attribute value."," **/"," getAsHTML: function (name) {"," var value = this.get(name);"," return Y.Escape.html(Lang.isValue(value) ? String(value) : '');"," },",""," /**"," Returns a URL-encoded version of the value of the specified string"," attribute. The value is encoded using the native `encodeURIComponent()`"," function.",""," @method getAsURL"," @param {String} name Attribute name or object property path."," @return {String} URL-encoded attribute value."," **/"," getAsURL: function (name) {"," var value = this.get(name);"," return encodeURIComponent(Lang.isValue(value) ? String(value) : '');"," },",""," /**"," Returns `true` if any attribute of this model has been changed since the"," model was last saved.",""," New models (models for which `isNew()` returns `true`) are implicitly"," considered to be \"modified\" until the first time they're saved.",""," @method isModified"," @return {Boolean} `true` if this model has changed since it was last saved,"," `false` otherwise."," **/"," isModified: function () {"," return this.isNew() || !YObject.isEmpty(this.changed);"," },",""," /**"," Returns `true` if this model is \"new\", meaning it hasn't been saved since it"," was created.",""," Newness is determined by checking whether the model's `id` attribute has"," been set. An empty id is assumed to indicate a new model, whereas a"," non-empty id indicates a model that was either loaded or has been saved"," since it was created.",""," @method isNew"," @return {Boolean} `true` if this model is new, `false` otherwise."," **/"," isNew: function () {"," return !Lang.isValue(this.get('id'));"," },",""," /**"," Loads this model from the server.",""," This method delegates to the `sync()` method to perform the actual load"," operation, which is an asynchronous action. Specify a _callback_ function to"," be notified of success or failure.",""," A successful load operation will fire a `load` event, while an unsuccessful"," load operation will fire an `error` event with the `src` value \"load\".",""," If the load operation succeeds and one or more of the loaded attributes"," differ from this model's current attributes, a `change` event will be fired.",""," @method load"," @param {Object} [options] Options to be passed to `sync()` and to `set()`"," when setting the loaded attributes. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {callback} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @chainable"," **/"," load: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," self.sync('read', options, function (err, response) {"," var facade = {"," options : options,"," response: response"," },",""," parsed;",""," if (err) {"," facade.error = err;"," facade.src = 'load';",""," self.fire(EVT_ERROR, facade);"," } else {"," // Lazy publish."," if (!self._loadEvent) {"," self._loadEvent = self.publish(EVT_LOAD, {"," preventable: false"," });"," }",""," parsed = facade.parsed = self._parse(response);",""," self.setAttrs(parsed, options);"," self.changed = {};",""," self.fire(EVT_LOAD, facade);"," }",""," callback && callback.apply(null, arguments);"," });",""," return self;"," },",""," /**"," Called to parse the _response_ when the model is loaded from the server."," This method receives a server _response_ and is expected to return an"," attribute hash.",""," The default implementation assumes that _response_ is either an attribute"," hash or a JSON string that can be parsed into an attribute hash. If"," _response_ is a JSON string and either `Y.JSON` or the native `JSON` object"," are available, it will be parsed automatically. If a parse error occurs, an"," `error` event will be fired and the model will not be updated.",""," You may override this method to implement custom parsing logic if necessary.",""," @method parse"," @param {Any} response Server response."," @return {Object} Attribute hash."," **/"," parse: function (response) {"," if (typeof response === 'string') {"," try {"," return Y.JSON.parse(response);"," } catch (ex) {"," this.fire(EVT_ERROR, {"," error : ex,"," response: response,"," src : 'parse'"," });",""," return null;"," }"," }",""," return response;"," },",""," /**"," Saves this model to the server.",""," This method delegates to the `sync()` method to perform the actual save"," operation, which is an asynchronous action. Specify a _callback_ function to"," be notified of success or failure.",""," A successful save operation will fire a `save` event, while an unsuccessful"," save operation will fire an `error` event with the `src` value \"save\".",""," If the save operation succeeds and one or more of the attributes returned in"," the server's response differ from this model's current attributes, a"," `change` event will be fired.",""," @method save"," @param {Object} [options] Options to be passed to `sync()` and to `set()`"," when setting synced attributes. It's up to the custom sync implementation"," to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred or validation"," failed, this parameter will contain the error. If the sync operation"," succeeded, _err_ will be `null`."," @param {Any} callback.response The server's response. This value will"," be passed to the `parse()` method, which is expected to parse it and"," return an attribute hash."," @chainable"," **/"," save: function (options, callback) {"," var self = this;",""," // Allow callback as only arg."," if (typeof options === 'function') {"," callback = options;"," options = {};"," }",""," options || (options = {});",""," self._validate(self.toJSON(), function (err) {"," if (err) {"," callback && callback.call(null, err);"," return;"," }",""," self.sync(self.isNew() ? 'create' : 'update', options, function (err, response) {"," var facade = {"," options : options,"," response: response"," },",""," parsed;",""," if (err) {"," facade.error = err;"," facade.src = 'save';",""," self.fire(EVT_ERROR, facade);"," } else {"," // Lazy publish."," if (!self._saveEvent) {"," self._saveEvent = self.publish(EVT_SAVE, {"," preventable: false"," });"," }",""," if (response) {"," parsed = facade.parsed = self._parse(response);"," self.setAttrs(parsed, options);"," }",""," self.changed = {};"," self.fire(EVT_SAVE, facade);"," }",""," callback && callback.apply(null, arguments);"," });"," });",""," return self;"," },",""," /**"," Sets the value of a single attribute. If model validation fails, the"," attribute will not be set and an `error` event will be fired.",""," Use `setAttrs()` to set multiple attributes at once.",""," @example"," model.set('foo', 'bar');",""," @method set"," @param {String} name Attribute name or object property path."," @param {any} value Value to set."," @param {Object} [options] Data to be mixed into the event facade of the"," `change` event(s) for these attributes."," @param {Boolean} [options.silent=false] If `true`, no `change` event will"," be fired."," @chainable"," **/"," set: function (name, value, options) {"," var attributes = {};"," attributes[name] = value;",""," return this.setAttrs(attributes, options);"," },",""," /**"," Sets the values of multiple attributes at once. If model validation fails,"," the attributes will not be set and an `error` event will be fired.",""," @example"," model.setAttrs({"," foo: 'bar',"," baz: 'quux'"," });",""," @method setAttrs"," @param {Object} attributes Hash of attribute names and values to set."," @param {Object} [options] Data to be mixed into the event facade of the"," `change` event(s) for these attributes."," @param {Boolean} [options.silent=false] If `true`, no `change` event will"," be fired."," @chainable"," **/"," setAttrs: function (attributes, options) {"," var idAttribute = this.idAttribute,"," changed, e, key, lastChange, transaction;",""," options || (options = {});"," transaction = options._transaction = {};",""," // When a custom id attribute is in use, always keep the default `id`"," // attribute in sync."," if (idAttribute !== 'id') {"," // So we don't modify someone else's object."," attributes = Y.merge(attributes);",""," if (YObject.owns(attributes, idAttribute)) {"," attributes.id = attributes[idAttribute];"," } else if (YObject.owns(attributes, 'id')) {"," attributes[idAttribute] = attributes.id;"," }"," }",""," for (key in attributes) {"," if (YObject.owns(attributes, key)) {"," this._setAttr(key, attributes[key], options);"," }"," }",""," if (!YObject.isEmpty(transaction)) {"," changed = this.changed;"," lastChange = this.lastChange = {};",""," for (key in transaction) {"," if (YObject.owns(transaction, key)) {"," e = transaction[key];",""," changed[key] = e.newVal;",""," lastChange[key] = {"," newVal : e.newVal,"," prevVal: e.prevVal,"," src : e.src || null"," };"," }"," }",""," if (!options.silent) {"," // Lazy publish for the change event."," if (!this._changeEvent) {"," this._changeEvent = this.publish(EVT_CHANGE, {"," preventable: false"," });"," }",""," this.fire(EVT_CHANGE, Y.merge(options, {changed: lastChange}));"," }"," }",""," return this;"," },",""," /**"," Override this method to provide a custom persistence implementation for this"," model. The default just calls the callback without actually doing anything.",""," This method is called internally by `load()`, `save()`, and `destroy()`.",""," @method sync"," @param {String} action Sync action to perform. May be one of the following:",""," * `create`: Store a newly-created model for the first time."," * `delete`: Delete an existing model."," * `read` : Load an existing model."," * `update`: Update an existing model.",""," @param {Object} [options] Sync options. It's up to the custom sync"," implementation to determine what options it supports or requires, if any."," @param {Function} [callback] Called when the sync operation finishes."," @param {Error|null} callback.err If an error occurred, this parameter will"," contain the error. If the sync operation succeeded, _err_ will be"," falsy."," @param {Any} [callback.response] The server's response."," **/"," sync: function (/* action, options, callback */) {"," var callback = YArray(arguments, 0, true).pop();",""," if (typeof callback === 'function') {"," callback();"," }"," },",""," /**"," Returns a copy of this model's attributes that can be passed to"," `Y.JSON.stringify()` or used for other nefarious purposes.",""," The `clientId` attribute is not included in the returned object.",""," If you've specified a custom attribute name in the `idAttribute` property,"," the default `id` attribute will not be included in the returned object.",""," Note: The ECMAScript 5 specification states that objects may implement a"," `toJSON` method to provide an alternate object representation to serialize"," when passed to `JSON.stringify(obj)`. This allows class instances to be"," serialized as if they were plain objects. This is why Model's `toJSON`"," returns an object, not a JSON string.",""," See <http://es5.github.com/#x15.12.3> for details.",""," @method toJSON"," @return {Object} Copy of this model's attributes."," **/"," toJSON: function () {"," var attrs = this.getAttrs();",""," delete attrs.clientId;"," delete attrs.destroyed;"," delete attrs.initialized;",""," if (this.idAttribute !== 'id') {"," delete attrs.id;"," }",""," return attrs;"," },",""," /**"," Reverts the last change to the model.",""," If an _attrNames_ array is provided, then only the named attributes will be"," reverted (and only if they were modified in the previous change). If no"," _attrNames_ array is provided, then all changed attributes will be reverted"," to their previous values.",""," Note that only one level of undo is available: from the current state to the"," previous state. If `undo()` is called when no previous state is available,"," it will simply do nothing.",""," @method undo"," @param {Array} [attrNames] Array of specific attribute names to revert. If"," not specified, all attributes modified in the last change will be"," reverted."," @param {Object} [options] Data to be mixed into the event facade of the"," change event(s) for these attributes."," @param {Boolean} [options.silent=false] If `true`, no `change` event will"," be fired."," @chainable"," **/"," undo: function (attrNames, options) {"," var lastChange = this.lastChange,"," idAttribute = this.idAttribute,"," toUndo = {},"," needUndo;",""," attrNames || (attrNames = YObject.keys(lastChange));",""," YArray.each(attrNames, function (name) {"," if (YObject.owns(lastChange, name)) {"," // Don't generate a double change for custom id attributes."," name = name === idAttribute ? 'id' : name;",""," needUndo = true;"," toUndo[name] = lastChange[name].prevVal;"," }"," });",""," return needUndo ? this.setAttrs(toUndo, options) : this;"," },",""," /**"," Override this method to provide custom validation logic for this model.",""," While attribute-specific validators can be used to validate individual"," attributes, this method gives you a hook to validate a hash of all"," attributes before the model is saved. This method is called automatically"," before `save()` takes any action. If validation fails, the `save()` call"," will be aborted.",""," In your validation method, call the provided `callback` function with no"," arguments to indicate success. To indicate failure, pass a single argument,"," which may contain an error message, an array of error messages, or any other"," value. This value will be passed along to the `error` event.",""," @example",""," model.validate = function (attrs, callback) {"," if (attrs.pie !== true) {"," // No pie?! Invalid!"," callback('Must provide pie.');"," return;"," }",""," // Success!"," callback();"," };",""," @method validate"," @param {Object} attrs Attribute hash containing all model attributes to"," be validated."," @param {Function} callback Validation callback. Call this function when your"," validation logic finishes. To trigger a validation failure, pass any"," value as the first argument to the callback (ideally a meaningful"," validation error of some kind).",""," @param {Any} [callback.err] Validation error. Don't provide this"," argument if validation succeeds. If validation fails, set this to an"," error message or some other meaningful value. It will be passed"," along to the resulting `error` event."," **/"," validate: function (attrs, callback) {"," callback && callback();"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Duckpunches the `addAttr` method provided by `Y.Attribute` to keep the"," `id` attribute’s value and a custom id attribute’s (if provided) value"," in sync when adding the attributes to the model instance object.",""," Marked as protected to hide it from Model's public API docs, even though"," this is a public method in Attribute.",""," @method addAttr"," @param {String} name The name of the attribute."," @param {Object} config An object with attribute configuration property/value"," pairs, specifying the configuration for the attribute."," @param {Boolean} lazy (optional) Whether or not to add this attribute lazily"," (on the first call to get/set)."," @return {Object} A reference to the host object."," @chainable"," @protected"," **/"," addAttr: function (name, config, lazy) {"," var idAttribute = this.idAttribute,"," idAttrCfg, id;",""," if (idAttribute && name === idAttribute) {"," idAttrCfg = this._isLazyAttr('id') || this._getAttrCfg('id');"," id = config.value === config.defaultValue ? null : config.value;",""," if (!Lang.isValue(id)) {"," // Hunt for the id value."," id = idAttrCfg.value === idAttrCfg.defaultValue ? null : idAttrCfg.value;",""," if (!Lang.isValue(id)) {"," // No id value provided on construction, check defaults."," id = Lang.isValue(config.defaultValue) ?"," config.defaultValue :"," idAttrCfg.defaultValue;"," }"," }",""," config.value = id;",""," // Make sure `id` is in sync."," if (idAttrCfg.value !== id) {"," idAttrCfg.value = id;",""," if (this._isLazyAttr('id')) {"," this._state.add('id', 'lazy', idAttrCfg);"," } else {"," this._state.add('id', 'value', id);"," }"," }"," }",""," return Model.superclass.addAttr.apply(this, arguments);"," },",""," /**"," Calls the public, overrideable `parse()` method and returns the result.",""," Override this method to provide a custom pre-parsing implementation. This"," provides a hook for custom persistence implementations to \"prep\" a response"," before calling the `parse()` method.",""," @method _parse"," @param {Any} response Server response."," @return {Object} Attribute hash."," @protected"," @see Model.parse()"," @since 3.7.0"," **/"," _parse: function (response) {"," return this.parse(response);"," },",""," /**"," Calls the public, overridable `validate()` method and fires an `error` event"," if validation fails.",""," @method _validate"," @param {Object} attributes Attribute hash."," @param {Function} callback Validation callback."," @param {Any} [callback.err] Value on failure, non-value on success."," @protected"," **/"," _validate: function (attributes, callback) {"," var self = this;",""," function handler(err) {"," if (Lang.isValue(err)) {"," // Validation failed. Fire an error."," self.fire(EVT_ERROR, {"," attributes: attributes,"," error : err,"," src : 'validate'"," });",""," callback(err);"," return;"," }",""," callback();"," }",""," if (self.validate.length === 1) {"," // Backcompat for 3.4.x-style synchronous validate() functions that"," // don't take a callback argument."," handler(self.validate(attributes, handler));"," } else {"," self.validate(attributes, handler);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Duckpunches the `_defAttrChangeFn()` provided by `Y.Attribute` so we can"," have a single global notification when a change event occurs.",""," @method _defAttrChangeFn"," @param {EventFacade} e"," @protected"," **/"," _defAttrChangeFn: function (e) {"," var attrName = e.attrName;",""," if (!this._setAttrVal(attrName, e.subAttrName, e.prevVal, e.newVal)) {"," // Prevent \"after\" listeners from being invoked since nothing changed."," e.stopImmediatePropagation();"," } else {"," e.newVal = this.get(attrName);",""," if (e._transaction) {"," e._transaction[attrName] = e;"," }"," }"," }","}, {"," NAME: 'model',",""," ATTRS: {"," /**"," A client-only identifier for this model.",""," Like the `id` attribute, `clientId` may be used to retrieve model"," instances from lists. Unlike the `id` attribute, `clientId` is"," automatically generated, and is only intended to be used on the client"," during the current pageview.",""," @attribute clientId"," @type String"," @readOnly"," **/"," clientId: {"," valueFn : 'generateClientId',"," readOnly: true"," },",""," /**"," A unique identifier for this model. Among other things, this id may be"," used to retrieve model instances from lists, so it should be unique.",""," If the id is empty, this model instance is assumed to represent a new"," item that hasn't yet been saved.",""," If you would prefer to use a custom attribute as this model's id instead"," of using the `id` attribute (for example, maybe you'd rather use `_id`"," or `uid` as the primary id), you may set the `idAttribute` property to"," the name of your custom id attribute. The `id` attribute will then"," act as an alias for your custom attribute.",""," @attribute id"," @type String|Number|null"," @default `null`"," **/"," id: {value: null}"," }","});","","","}, '3.7.3', {\"requires\": [\"base-build\", \"escape\", \"json-parse\"]});"]; _yuitest_coverage["build/model/model.js"].lines = {"1":0,"27":0,"95":0,"96":0,"99":0,"200":0,"201":0,"202":0,"233":0,"236":0,"237":0,"238":0,"241":0,"242":0,"243":0,"244":0,"245":0,"249":0,"252":0,"253":0,"255":0,"259":0,"271":0,"272":0,"315":0,"316":0,"329":0,"330":0,"345":0,"361":0,"391":0,"394":0,"395":0,"396":0,"399":0,"401":0,"402":0,"409":0,"410":0,"411":0,"413":0,"416":0,"417":0,"422":0,"424":0,"425":0,"427":0,"430":0,"433":0,"454":0,"455":0,"456":0,"458":0,"464":0,"468":0,"499":0,"502":0,"503":0,"504":0,"507":0,"509":0,"510":0,"511":0,"512":0,"515":0,"516":0,"523":0,"524":0,"525":0,"527":0,"530":0,"531":0,"536":0,"537":0,"538":0,"541":0,"542":0,"545":0,"549":0,"571":0,"572":0,"574":0,"596":0,"599":0,"600":0,"604":0,"606":0,"608":0,"609":0,"610":0,"611":0,"615":0,"616":0,"617":0,"621":0,"622":0,"623":0,"625":0,"626":0,"627":0,"629":0,"631":0,"639":0,"641":0,"642":0,"647":0,"651":0,"677":0,"679":0,"680":0,"705":0,"707":0,"708":0,"709":0,"711":0,"712":0,"715":0,"741":0,"746":0,"748":0,"749":0,"751":0,"753":0,"754":0,"758":0,"802":0,"826":0,"829":0,"830":0,"831":0,"833":0,"835":0,"837":0,"839":0,"845":0,"848":0,"849":0,"851":0,"852":0,"854":0,"859":0,"877":0,"891":0,"893":0,"894":0,"896":0,"902":0,"903":0,"906":0,"909":0,"912":0,"914":0,"929":0,"931":0,"933":0,"935":0,"937":0,"938":0}; _yuitest_coverage["build/model/model.js"].functions = {"Model:95":0,"initializer:199":0,"(anonymous 3):244":0,"finish:242":0,"(anonymous 2):241":0,"destroy:232":0,"generateClientId:270":0,"getAsHTML:314":0,"getAsURL:328":0,"isModified:344":0,"isNew:360":0,"(anonymous 4):401":0,"load:390":0,"parse:453":0,"(anonymous 6):515":0,"(anonymous 5):509":0,"save:498":0,"set:570":0,"setAttrs:595":0,"sync:676":0,"toJSON:704":0,"(anonymous 7):748":0,"undo:740":0,"validate:801":0,"addAttr:825":0,"_parse:876":0,"handler:893":0,"_validate:890":0,"_defAttrChangeFn:928":0,"(anonymous 1):1":0}; _yuitest_coverage["build/model/model.js"].coveredLines = 158;@@ -1209,4 +1209,4 @@ }); -}, '3.7.2', {"requires": ["base-build", "escape", "json-parse"]});+}, '3.7.3', {"requires": ["base-build", "escape", "json-parse"]});
bundle/model/model-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -990,4 +990,4 @@ }); -}, '3.7.2', {"requires": ["base-build", "escape", "json-parse"]});+}, '3.7.3', {"requires": ["base-build", "escape", "json-parse"]});
bundle/model/model-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("model",function(e,t){function l(){l.superclass.constructor.apply(this,arguments)}var n=YUI.namespace("Env.Model"),r=e.Lang,i=e.Array,s=e.Object,o="change",u="error",a="load",f="save";e.Model=e.extend(l,e.Base,{idAttribute:"id",_allowAdHocAttrs:!0,_isYUIModel:!0,initializer:function(e){this.changed={},this.lastChange={},this.lists=[]},destroy:function(e,t){var n=this;return typeof e=="function"&&(t=e,e=null),n.onceAfter("destroy",function(){function r(r){r||i.each(n.lists.concat(),function(t){t.remove(n,e)}),t&&t.apply(null,arguments)}e&&(e.remove||e["delete"])?n.sync("delete",e,r):r()}),l.superclass.destroy.call(n)},generateClientId:function(){return n.lastId||(n.lastId=0),this.constructor.NAME+"_"+(n.lastId+=1)},getAsHTML:function(t){var n=this.get(t);return e.Escape.html(r.isValue(n)?String(n):"")},getAsURL:function(e){var t=this.get(e);return encodeURIComponent(r.isValue(t)?String(t):"")},isModified:function(){return this.isNew()||!s.isEmpty(this.changed)},isNew:function(){return!r.isValue(this.get("id"))},load:function(e,t){var n=this;return typeof e=="function"&&(t=e,e={}),e||(e={}),n.sync("read",e,function(r,i){var s={options:e,response:i},o;r?(s.error=r,s.src="load",n.fire(u,s)):(n._loadEvent||(n._loadEvent=n.publish(a,{preventable:!1})),o=s.parsed=n._parse(i),n.setAttrs(o,e),n.changed={},n.fire(a,s)),t&&t.apply(null,arguments)}),n},parse:function(t){if(typeof t=="string")try{return e.JSON.parse(t)}catch(n){return this.fire(u,{error:n,response:t,src:"parse"}),null}return t},save:function(e,t){var n=this;return typeof e=="function"&&(t=e,e={}),e||(e={}),n._validate(n.toJSON(),function(r){if(r){t&&t.call(null,r);return}n.sync(n.isNew()?"create":"update",e,function(r,i){var s={options:e,response:i},o;r?(s.error=r,s.src="save",n.fire(u,s)):(n._saveEvent||(n._saveEvent=n.publish(f,{preventable:!1})),i&&(o=s.parsed=n._parse(i),n.setAttrs(o,e)),n.changed={},n.fire(f,s)),t&&t.apply(null,arguments)})}),n},set:function(e,t,n){var r={};return r[e]=t,this.setAttrs(r,n)},setAttrs:function(t,n){var r=this.idAttribute,i,u,a,f,l;n||(n={}),l=n._transaction={},r!=="id"&&(t=e.merge(t),s.owns(t,r)?t.id=t[r]:s.owns(t,"id")&&(t[r]=t.id));for(a in t)s.owns(t,a)&&this._setAttr(a,t[a],n);if(!s.isEmpty(l)){i=this.changed,f=this.lastChange={};for(a in l)s.owns(l,a)&&(u=l[a],i[a]=u.newVal,f[a]={newVal:u.newVal,prevVal:u.prevVal,src:u.src||null});n.silent||(this._changeEvent||(this._changeEvent=this.publish(o,{preventable:!1})),this.fire(o,e.merge(n,{changed:f})))}return this},sync:function(){var e=i(arguments,0,!0).pop();typeof e=="function"&&e()},toJSON:function(){var e=this.getAttrs();return delete e.clientId,delete e.destroyed,delete e.initialized,this.idAttribute!=="id"&&delete e.id,e},undo:function(e,t){var n=this.lastChange,r=this.idAttribute,o={},u;return e||(e=s.keys(n)),i.each(e,function(e){s.owns(n,e)&&(e=e===r?"id":e,u=!0,o[e]=n[e].prevVal)}),u?this.setAttrs(o,t):this},validate:function(e,t){t&&t()},addAttr:function(e,t,n){var i=this.idAttribute,s,o;return i&&e===i&&(s=this._isLazyAttr("id")||this._getAttrCfg("id"),o=t.value===t.defaultValue?null:t.value,r.isValue(o)||(o=s.value===s.defaultValue?null:s.value,r.isValue(o)||(o=r.isValue(t.defaultValue)?t.defaultValue:s.defaultValue)),t.value=o,s.value!==o&&(s.value=o,this._isLazyAttr("id")?this._state.add("id","lazy",s):this._state.add("id","value",o))),l.superclass.addAttr.apply(this,arguments)},_parse:function(e){return this.parse(e)},_validate:function(e,t){function i(i){if(r.isValue(i)){n.fire(u,{attributes:e,error:i,src:"validate"}),t(i);return}t()}var n=this;n.validate.length===1?i(n.validate(e,i)):n.validate(e,i)},_defAttrChangeFn:function(e){var t=e.attrName;this._setAttrVal(t,e.subAttrName,e.prevVal,e.newVal)?(e.newVal=this.get(t),e._transaction&&(e._transaction[t]=e)):e.stopImmediatePropagation()}},{NAME:"model",ATTRS:{clientId:{valueFn:"generateClientId",readOnly:!0},id:{value:null}}})},"3.7.2",{requires:["base-build","escape","json-parse"]});+YUI.add("model",function(e,t){function l(){l.superclass.constructor.apply(this,arguments)}var n=YUI.namespace("Env.Model"),r=e.Lang,i=e.Array,s=e.Object,o="change",u="error",a="load",f="save";e.Model=e.extend(l,e.Base,{idAttribute:"id",_allowAdHocAttrs:!0,_isYUIModel:!0,initializer:function(e){this.changed={},this.lastChange={},this.lists=[]},destroy:function(e,t){var n=this;return typeof e=="function"&&(t=e,e=null),n.onceAfter("destroy",function(){function r(r){r||i.each(n.lists.concat(),function(t){t.remove(n,e)}),t&&t.apply(null,arguments)}e&&(e.remove||e["delete"])?n.sync("delete",e,r):r()}),l.superclass.destroy.call(n)},generateClientId:function(){return n.lastId||(n.lastId=0),this.constructor.NAME+"_"+(n.lastId+=1)},getAsHTML:function(t){var n=this.get(t);return e.Escape.html(r.isValue(n)?String(n):"")},getAsURL:function(e){var t=this.get(e);return encodeURIComponent(r.isValue(t)?String(t):"")},isModified:function(){return this.isNew()||!s.isEmpty(this.changed)},isNew:function(){return!r.isValue(this.get("id"))},load:function(e,t){var n=this;return typeof e=="function"&&(t=e,e={}),e||(e={}),n.sync("read",e,function(r,i){var s={options:e,response:i},o;r?(s.error=r,s.src="load",n.fire(u,s)):(n._loadEvent||(n._loadEvent=n.publish(a,{preventable:!1})),o=s.parsed=n._parse(i),n.setAttrs(o,e),n.changed={},n.fire(a,s)),t&&t.apply(null,arguments)}),n},parse:function(t){if(typeof t=="string")try{return e.JSON.parse(t)}catch(n){return this.fire(u,{error:n,response:t,src:"parse"}),null}return t},save:function(e,t){var n=this;return typeof e=="function"&&(t=e,e={}),e||(e={}),n._validate(n.toJSON(),function(r){if(r){t&&t.call(null,r);return}n.sync(n.isNew()?"create":"update",e,function(r,i){var s={options:e,response:i},o;r?(s.error=r,s.src="save",n.fire(u,s)):(n._saveEvent||(n._saveEvent=n.publish(f,{preventable:!1})),i&&(o=s.parsed=n._parse(i),n.setAttrs(o,e)),n.changed={},n.fire(f,s)),t&&t.apply(null,arguments)})}),n},set:function(e,t,n){var r={};return r[e]=t,this.setAttrs(r,n)},setAttrs:function(t,n){var r=this.idAttribute,i,u,a,f,l;n||(n={}),l=n._transaction={},r!=="id"&&(t=e.merge(t),s.owns(t,r)?t.id=t[r]:s.owns(t,"id")&&(t[r]=t.id));for(a in t)s.owns(t,a)&&this._setAttr(a,t[a],n);if(!s.isEmpty(l)){i=this.changed,f=this.lastChange={};for(a in l)s.owns(l,a)&&(u=l[a],i[a]=u.newVal,f[a]={newVal:u.newVal,prevVal:u.prevVal,src:u.src||null});n.silent||(this._changeEvent||(this._changeEvent=this.publish(o,{preventable:!1})),this.fire(o,e.merge(n,{changed:f})))}return this},sync:function(){var e=i(arguments,0,!0).pop();typeof e=="function"&&e()},toJSON:function(){var e=this.getAttrs();return delete e.clientId,delete e.destroyed,delete e.initialized,this.idAttribute!=="id"&&delete e.id,e},undo:function(e,t){var n=this.lastChange,r=this.idAttribute,o={},u;return e||(e=s.keys(n)),i.each(e,function(e){s.owns(n,e)&&(e=e===r?"id":e,u=!0,o[e]=n[e].prevVal)}),u?this.setAttrs(o,t):this},validate:function(e,t){t&&t()},addAttr:function(e,t,n){var i=this.idAttribute,s,o;return i&&e===i&&(s=this._isLazyAttr("id")||this._getAttrCfg("id"),o=t.value===t.defaultValue?null:t.value,r.isValue(o)||(o=s.value===s.defaultValue?null:s.value,r.isValue(o)||(o=r.isValue(t.defaultValue)?t.defaultValue:s.defaultValue)),t.value=o,s.value!==o&&(s.value=o,this._isLazyAttr("id")?this._state.add("id","lazy",s):this._state.add("id","value",o))),l.superclass.addAttr.apply(this,arguments)},_parse:function(e){return this.parse(e)},_validate:function(e,t){function i(i){if(r.isValue(i)){n.fire(u,{attributes:e,error:i,src:"validate"}),t(i);return}t()}var n=this;n.validate.length===1?i(n.validate(e,i)):n.validate(e,i)},_defAttrChangeFn:function(e){var t=e.attrName;this._setAttrVal(t,e.subAttrName,e.prevVal,e.newVal)?(e.newVal=this.get(t),e._transaction&&(e._transaction[t]=e)):e.stopImmediatePropagation()}},{NAME:"model",ATTRS:{clientId:{valueFn:"generateClientId",readOnly:!0},id:{value:null}}})},"3.7.3",{requires:["base-build","escape","json-parse"]});
bundle/model/model.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -988,4 +988,4 @@ }); -}, '3.7.2', {"requires": ["base-build", "escape", "json-parse"]});+}, '3.7.3', {"requires": ["base-build", "escape", "json-parse"]});
bundle/node-base/node-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-base/node-base.js", code: [] };-_yuitest_coverage["build/node-base/node-base.js"].code=["YUI.add('node-base', function (Y, NAME) {","","/**"," * @module node"," * @submodule node-base"," */","","var methods = [","/**"," * Determines whether each node has the given className."," * @method hasClass"," * @for Node"," * @param {String} className the class name to search for"," * @return {Boolean} Whether or not the element has the specified class"," */"," 'hasClass',","","/**"," * Adds a class name to each node."," * @method addClass"," * @param {String} className the class name to add to the node's class attribute"," * @chainable"," */"," 'addClass',","","/**"," * Removes a class name from each node."," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," * @chainable"," */"," 'removeClass',","","/**"," * Replace a class with another class for each node."," * If no oldClassName is present, the newClassName is simply added."," * @method replaceClass"," * @param {String} oldClassName the class name to be replaced"," * @param {String} newClassName the class name that will be replacing the old class name"," * @chainable"," */"," 'replaceClass',","","/**"," * If the className exists on the node it is removed, if it doesn't exist it is added."," * @method toggleClass"," * @param {String} className the class name to be toggled"," * @param {Boolean} force Option to force adding or removing the class."," * @chainable"," */"," 'toggleClass'","];","","Y.Node.importMethod(Y.DOM, methods);","/**"," * Determines whether each node has the given className."," * @method hasClass"," * @see Node.hasClass"," * @for NodeList"," * @param {String} className the class name to search for"," * @return {Array} An array of booleans for each node bound to the NodeList."," */","","/**"," * Adds a class name to each node."," * @method addClass"," * @see Node.addClass"," * @param {String} className the class name to add to the node's class attribute"," * @chainable"," */","","/**"," * Removes a class name from each node."," * @method removeClass"," * @see Node.removeClass"," * @param {String} className the class name to remove from the node's class attribute"," * @chainable"," */","","/**"," * Replace a class with another class for each node."," * If no oldClassName is present, the newClassName is simply added."," * @method replaceClass"," * @see Node.replaceClass"," * @param {String} oldClassName the class name to be replaced"," * @param {String} newClassName the class name that will be replacing the old class name"," * @chainable"," */","","/**"," * If the className exists on the node it is removed, if it doesn't exist it is added."," * @method toggleClass"," * @see Node.toggleClass"," * @param {String} className the class name to be toggled"," * @chainable"," */","Y.NodeList.importMethod(Y.Node.prototype, methods);","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node,"," Y_DOM = Y.DOM;","","/**"," * Returns a new dom node using the provided markup string."," * @method create"," * @static"," * @param {String} html The markup used to create the element"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @param {HTMLDocument} doc An optional document context"," * @return {Node} A Node instance bound to a DOM node or fragment"," * @for Node"," */","Y_Node.create = function(html, doc) {"," if (doc && doc._node) {"," doc = doc._node;"," }"," return Y.one(Y_DOM.create(html, doc));","};","","Y.mix(Y_Node.prototype, {"," /**"," * Creates a new Node using the provided markup string."," * @method create"," * @param {String} html The markup used to create the element."," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @param {HTMLDocument} doc An optional document context"," * @return {Node} A Node instance bound to a DOM node or fragment"," */"," create: Y_Node.create,",""," /**"," * Inserts the content before the reference node."," * @method insert"," * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @param {Int | Node | HTMLElement | String} where The position to insert at."," * Possible \"where\" arguments"," * <dl>"," * <dt>Y.Node</dt>"," * <dd>The Node to insert before</dd>"," * <dt>HTMLElement</dt>"," * <dd>The element to insert before</dd>"," * <dt>Int</dt>"," * <dd>The index of the child element to insert before</dd>"," * <dt>\"replace\"</dt>"," * <dd>Replaces the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts before the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts content before the node</dd>"," * <dt>\"after\"</dt>"," * <dd>Inserts content after the node</dd>"," * </dl>"," * @chainable"," */"," insert: function(content, where) {"," this._insert(content, where);"," return this;"," },",""," _insert: function(content, where) {"," var node = this._node,"," ret = null;",""," if (typeof where == 'number') { // allow index"," where = this._node.childNodes[where];"," } else if (where && where._node) { // Node"," where = where._node;"," }",""," if (content && typeof content != 'string') { // allow Node or NodeList/Array instances"," content = content._node || content._nodes || content;"," }"," ret = Y_DOM.addHTML(node, content, where);",""," return ret;"," },",""," /**"," * Inserts the content as the firstChild of the node."," * @method prepend"," * @param {String | Node | HTMLElement} content The content to insert"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @chainable"," */"," prepend: function(content) {"," return this.insert(content, 0);"," },",""," /**"," * Inserts the content as the lastChild of the node."," * @method append"," * @param {String | Node | HTMLElement} content The content to insert"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @chainable"," */"," append: function(content) {"," return this.insert(content, null);"," },",""," /**"," * @method appendChild"," * @param {String | HTMLElement | Node} node Node to be appended"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @return {Node} The appended node"," */"," appendChild: function(node) {"," return Y_Node.scrubVal(this._insert(node));"," },",""," /**"," * @method insertBefore"," * @param {String | HTMLElement | Node} newNode Node to be appended"," * @param {HTMLElement | Node} refNode Node to be inserted before"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @return {Node} The inserted node"," */"," insertBefore: function(newNode, refNode) {"," return Y.Node.scrubVal(this._insert(newNode, refNode));"," },",""," /**"," * Appends the node to the given node."," * @method appendTo"," * @param {Node | HTMLElement} node The node to append to"," * @chainable"," */"," appendTo: function(node) {"," Y.one(node).append(this);"," return this;"," },",""," /**"," * Replaces the node's current content with the content."," * Note that this passes to innerHTML and is not escaped."," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content or `set('text')` to add as text."," * @method setContent"," * @deprecated Use setHTML"," * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert"," * @chainable"," */"," setContent: function(content) {"," this._insert(content, 'replace');"," return this;"," },",""," /**"," * Returns the node's current content (e.g. innerHTML)"," * @method getContent"," * @deprecated Use getHTML"," * @return {String} The current content"," */"," getContent: function(content) {"," return this.get('innerHTML');"," }","});","","/**"," * Replaces the node's current html content with the content provided."," * Note that this passes to innerHTML and is not escaped."," * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text."," * @method setHTML"," * @param {String | HTML | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert"," * @chainable"," */","Y.Node.prototype.setHTML = Y.Node.prototype.setContent;","","/**"," * Returns the node's current html content (e.g. innerHTML)"," * @method getHTML"," * @return {String} The html content"," */","Y.Node.prototype.getHTML = Y.Node.prototype.getContent;","","Y.NodeList.importMethod(Y.Node.prototype, ["," /**"," * Called on each Node instance"," * @for NodeList"," * @method append"," * @see Node.append"," */"," 'append',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method insert"," * @see Node.insert"," */"," 'insert',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method appendChild"," * @see Node.appendChild"," */"," 'appendChild',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method insertBefore"," * @see Node.insertBefore"," */"," 'insertBefore',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method prepend"," * @see Node.prepend"," */"," 'prepend',",""," /**"," * Called on each Node instance"," * Note that this passes to innerHTML and is not escaped."," * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text."," * @for NodeList"," * @method setContent"," * @deprecated Use setHTML"," */"," 'setContent',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method getContent"," * @deprecated Use getHTML"," */"," 'getContent',",""," /**"," * Called on each Node instance"," * Note that this passes to innerHTML and is not escaped."," * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text."," * @for NodeList"," * @method setHTML"," * @see Node.setHTML"," */"," 'setHTML',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method getHTML"," * @see Node.getHTML"," */"," 'getHTML'","]);","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node,"," Y_DOM = Y.DOM;","","/**"," * Static collection of configuration attributes for special handling"," * @property ATTRS"," * @static"," * @type object"," */","Y_Node.ATTRS = {"," /**"," * Allows for getting and setting the text of an element."," * Formatting is preserved and special characters are treated literally."," * @config text"," * @type String"," */"," text: {"," getter: function() {"," return Y_DOM.getText(this._node);"," },",""," setter: function(content) {"," Y_DOM.setText(this._node, content);"," return content;"," }"," },",""," /**"," * Allows for getting and setting the text of an element."," * Formatting is preserved and special characters are treated literally."," * @config for"," * @type String"," */"," 'for': {"," getter: function() {"," return Y_DOM.getAttribute(this._node, 'for');"," },",""," setter: function(val) {"," Y_DOM.setAttribute(this._node, 'for', val);"," return val;"," }"," },",""," 'options': {"," getter: function() {"," return this._node.getElementsByTagName('option');"," }"," },",""," /**"," * Returns a NodeList instance of all HTMLElement children."," * @readOnly"," * @config children"," * @type NodeList"," */"," 'children': {"," getter: function() {"," var node = this._node,"," children = node.children,"," childNodes, i, len;",""," if (!children) {"," childNodes = node.childNodes;"," children = [];",""," for (i = 0, len = childNodes.length; i < len; ++i) {"," if (childNodes[i].tagName) {"," children[children.length] = childNodes[i];"," }"," }"," }"," return Y.all(children);"," }"," },",""," value: {"," getter: function() {"," return Y_DOM.getValue(this._node);"," },",""," setter: function(val) {"," Y_DOM.setValue(this._node, val);"," return val;"," }"," }","};","","Y.Node.importMethod(Y.DOM, ["," /**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @for Node"," * @for NodeList"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',"," /**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @for Node"," * @for NodeList"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */"," 'getAttribute'","","]);","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node;","var Y_NodeList = Y.NodeList;","/**"," * List of events that route to DOM events"," * @static"," * @property DOM_EVENTS"," * @for Node"," */","","Y_Node.DOM_EVENTS = {"," abort: 1,"," beforeunload: 1,"," blur: 1,"," change: 1,"," click: 1,"," close: 1,"," command: 1,"," contextmenu: 1,"," dblclick: 1,"," DOMMouseScroll: 1,"," drag: 1,"," dragstart: 1,"," dragenter: 1,"," dragover: 1,"," dragleave: 1,"," dragend: 1,"," drop: 1,"," error: 1,"," focus: 1,"," key: 1,"," keydown: 1,"," keypress: 1,"," keyup: 1,"," load: 1,"," message: 1,"," mousedown: 1,"," mouseenter: 1,"," mouseleave: 1,"," mousemove: 1,"," mousemultiwheel: 1,"," mouseout: 1,"," mouseover: 1,"," mouseup: 1,"," mousewheel: 1,"," orientationchange: 1,"," reset: 1,"," resize: 1,"," select: 1,"," selectstart: 1,"," submit: 1,"," scroll: 1,"," textInput: 1,"," unload: 1","};","","// Add custom event adaptors to this list. This will make it so","// that delegate, key, available, contentready, etc all will","// be available through Node.on","Y.mix(Y_Node.DOM_EVENTS, Y.Env.evt.plugins);","","Y.augment(Y_Node, Y.EventTarget);","","Y.mix(Y_Node.prototype, {"," /**"," * Removes event listeners from the node and (optionally) its subtree"," * @method purge"," * @param {Boolean} recurse (optional) Whether or not to remove listeners from the"," * node's subtree"," * @param {String} type (optional) Only remove listeners of the specified type"," * @chainable"," *"," */"," purge: function(recurse, type) {"," Y.Event.purgeElement(this._node, recurse, type);"," return this;"," }","","});","","Y.mix(Y.NodeList.prototype, {"," _prepEvtArgs: function(type, fn, context) {"," // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc)"," var args = Y.Array(arguments, 0, true);",""," if (args.length < 2) { // type only (event hash) just add nodes"," args[2] = this._nodes;"," } else {"," args.splice(2, 0, this._nodes);"," }",""," args[3] = context || this; // default to NodeList instance as context",""," return args;"," },",""," /**"," Subscribe a callback function for each `Node` in the collection to execute"," in response to a DOM event.",""," NOTE: Generally, the `on()` method should be avoided on `NodeLists`, in"," favor of using event delegation from a parent Node. See the Event user"," guide for details.",""," Most DOM events are associated with a preventable default behavior, such as"," link clicks navigating to a new page. Callbacks are passed a"," `DOMEventFacade` object as their first argument (usually called `e`) that"," can be used to prevent this default behavior with `e.preventDefault()`. See"," the `DOMEventFacade` API for all available properties and methods on the"," object.",""," By default, the `this` object will be the `NodeList` that the subscription"," came from, <em>not the `Node` that received the event</em>. Use"," `e.currentTarget` to refer to the `Node`.",""," Returning `false` from a callback is supported as an alternative to calling"," `e.preventDefault(); e.stopPropagation();`. However, it is recommended to"," use the event methods.",""," @example",""," Y.all(\".sku\").on(\"keydown\", function (e) {"," if (e.keyCode === 13) {"," e.preventDefault();",""," // Use e.currentTarget to refer to the individual Node"," var item = Y.MyApp.searchInventory( e.currentTarget.get('value') );"," // etc ..."," }"," });",""," @method on"," @param {String} type The name of the event"," @param {Function} fn The callback to execute in response to the event"," @param {Object} [context] Override `this` object in callback"," @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," @return {EventHandle} A subscription handle capable of detaching that"," subscription"," @for NodeList"," **/"," on: function(type, fn, context) {"," return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments));"," },",""," /**"," * Applies an one-time event listener to each Node bound to the NodeList."," * @method once"," * @param {String} type The event being listened for"," * @param {Function} fn The handler to call when the event fires"," * @param {Object} context The context to call the handler with."," * Default is the NodeList instance."," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," * @for NodeList"," */"," once: function(type, fn, context) {"," return Y.once.apply(Y, this._prepEvtArgs.apply(this, arguments));"," },",""," /**"," * Applies an event listener to each Node bound to the NodeList."," * The handler is called only after all on() handlers are called"," * and the event is not prevented."," * @method after"," * @param {String} type The event being listened for"," * @param {Function} fn The handler to call when the event fires"," * @param {Object} context The context to call the handler with."," * Default is the NodeList instance."," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," * @for NodeList"," */"," after: function(type, fn, context) {"," return Y.after.apply(Y, this._prepEvtArgs.apply(this, arguments));"," },",""," /**"," * Applies an one-time event listener to each Node bound to the NodeList"," * that will be called only after all on() handlers are called and the"," * event is not prevented."," *"," * @method onceAfter"," * @param {String} type The event being listened for"," * @param {Function} fn The handler to call when the event fires"," * @param {Object} context The context to call the handler with."," * Default is the NodeList instance."," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," * @for NodeList"," */"," onceAfter: function(type, fn, context) {"," return Y.onceAfter.apply(Y, this._prepEvtArgs.apply(this, arguments));"," }","});","","Y_NodeList.importMethod(Y.Node.prototype, ["," /**"," * Called on each Node instance"," * @method detach"," * @see Node.detach"," * @for NodeList"," */"," 'detach',",""," /** Called on each Node instance"," * @method detachAll"," * @see Node.detachAll"," * @for NodeList"," */"," 'detachAll'","]);","","/**","Subscribe a callback function to execute in response to a DOM event or custom","event.","","Most DOM events are associated with a preventable default behavior such as","link clicks navigating to a new page. Callbacks are passed a `DOMEventFacade`","object as their first argument (usually called `e`) that can be used to","prevent this default behavior with `e.preventDefault()`. See the","`DOMEventFacade` API for all available properties and methods on the object.","","If the event name passed as the first parameter is not a whitelisted DOM event,","it will be treated as a custom event subscriptions, allowing","`node.fire('customEventName')` later in the code. Refer to the Event user guide","for the full DOM event whitelist.","","By default, the `this` object in the callback will refer to the subscribed","`Node`.","","Returning `false` from a callback is supported as an alternative to calling","`e.preventDefault(); e.stopPropagation();`. However, it is recommended to use","the event methods.","","@example",""," Y.one(\"#my-form\").on(\"submit\", function (e) {"," e.preventDefault();",""," // proceed with ajax form submission instead..."," });","","@method on","@param {String} type The name of the event","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching that"," subscription","@for Node","**/","","Y.mix(Y.Node.ATTRS, {"," offsetHeight: {"," setter: function(h) {"," Y.DOM.setHeight(this._node, h);"," return h;"," },",""," getter: function() {"," return this._node.offsetHeight;"," }"," },",""," offsetWidth: {"," setter: function(w) {"," Y.DOM.setWidth(this._node, w);"," return w;"," },",""," getter: function() {"," return this._node.offsetWidth;"," }"," }","});","","Y.mix(Y.Node.prototype, {"," sizeTo: function(w, h) {"," var node;"," if (arguments.length < 2) {"," node = Y.one(w);"," w = node.get('offsetWidth');"," h = node.get('offsetHeight');"," }",""," this.setAttrs({"," offsetWidth: w,"," offsetHeight: h"," });"," }","});","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node;","","Y.mix(Y_Node.prototype, {"," /**"," * Makes the node visible."," * If the \"transition\" module is loaded, show optionally"," * animates the showing of the node using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method show"," * @for Node"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @chainable"," */"," show: function(callback) {"," callback = arguments[arguments.length - 1];"," this.toggleView(true, callback);"," return this;"," },",""," /**"," * The implementation for showing nodes."," * Default is to toggle the style.display property."," * @method _show"," * @protected"," * @chainable"," */"," _show: function() {"," this.setStyle('display', '');",""," },",""," _isHidden: function() {"," return Y.DOM.getStyle(this._node, 'display') === 'none';"," },",""," /**"," * Displays or hides the node."," * If the \"transition\" module is loaded, toggleView optionally"," * animates the toggling of the node using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method toggleView"," * @for Node"," * @param {Boolean} [on] An optional boolean value to force the node to be shown or hidden"," * @param {Function} [callback] An optional function to run after the transition completes."," * @chainable"," */"," toggleView: function(on, callback) {"," this._toggleView.apply(this, arguments);"," return this;"," },",""," _toggleView: function(on, callback) {"," callback = arguments[arguments.length - 1];",""," // base on current state if not forcing"," if (typeof on != 'boolean') {"," on = (this._isHidden()) ? 1 : 0;"," }",""," if (on) {"," this._show();"," } else {"," this._hide();"," }",""," if (typeof callback == 'function') {"," callback.call(this);"," }",""," return this;"," },",""," /**"," * Hides the node."," * If the \"transition\" module is loaded, hide optionally"," * animates the hiding of the node using either the default"," * transition effect ('fadeOut'), or the given named effect."," * @method hide"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @chainable"," */"," hide: function(callback) {"," callback = arguments[arguments.length - 1];"," this.toggleView(false, callback);"," return this;"," },",""," /**"," * The implementation for hiding nodes."," * Default is to toggle the style.display property."," * @method _hide"," * @protected"," * @chainable"," */"," _hide: function() {"," this.setStyle('display', 'none');"," }","});","","Y.NodeList.importMethod(Y.Node.prototype, ["," /**"," * Makes each node visible."," * If the \"transition\" module is loaded, show optionally"," * animates the showing of the node using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method show"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @for NodeList"," * @chainable"," */"," 'show',",""," /**"," * Hides each node."," * If the \"transition\" module is loaded, hide optionally"," * animates the hiding of the node using either the default"," * transition effect ('fadeOut'), or the given named effect."," * @method hide"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @chainable"," */"," 'hide',",""," /**"," * Displays or hides each node."," * If the \"transition\" module is loaded, toggleView optionally"," * animates the toggling of the nodes using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method toggleView"," * @param {Boolean} [on] An optional boolean value to force the nodes to be shown or hidden"," * @param {Function} [callback] An optional function to run after the transition completes."," * @chainable"," */"," 'toggleView'","]);","","if (!Y.config.doc.documentElement.hasAttribute) { // IE < 8"," Y.Node.prototype.hasAttribute = function(attr) {"," if (attr === 'value') {"," if (this.get('value') !== \"\") { // IE < 8 fails to populate specified when set in HTML"," return true;"," }"," }"," return !!(this._node.attributes[attr] &&"," this._node.attributes[attr].specified);"," };","}","","// IE throws an error when calling focus() on an element that's invisible, not","// displayed, or disabled.","Y.Node.prototype.focus = function () {"," try {"," this._node.focus();"," } catch (e) {"," }",""," return this;","};","","// IE throws error when setting input.type = 'hidden',","// input.setAttribute('type', 'hidden') and input.attributes.type.value = 'hidden'","Y.Node.ATTRS.type = {"," setter: function(val) {"," if (val === 'hidden') {"," try {"," this._node.type = 'hidden';"," } catch(e) {"," this.setStyle('display', 'none');"," this._inputType = 'hidden';"," }"," } else {"," try { // IE errors when changing the type from \"hidden'"," this._node.type = val;"," } catch (e) {"," }"," }"," return val;"," },",""," getter: function() {"," return this._inputType || this._node.type;"," },",""," _bypassProxy: true // don't update DOM when using with Attribute","};","","if (Y.config.doc.createElement('form').elements.nodeType) {"," // IE: elements collection is also FORM node which trips up scrubVal."," Y.Node.ATTRS.elements = {"," getter: function() {"," return this.all('input, textarea, button, select');"," }"," };","}","","/**"," * Provides methods for managing custom Node data."," * "," * @module node"," * @main node"," * @submodule node-data"," */","","Y.mix(Y.Node.prototype, {"," _initData: function() {"," if (! ('_data' in this)) {"," this._data = {};"," }"," },",""," /**"," * @method getData"," * @for Node"," * @description Retrieves arbitrary data stored on a Node instance."," * If no data is associated with the Node, it will attempt to retrieve"," * a value from the corresponding HTML data attribute. (e.g. node.getData('foo')"," * will check node.getAttribute('data-foo'))."," * @param {string} name Optional name of the data field to retrieve."," * If no name is given, all data is returned."," * @return {any | Object} Whatever is stored at the given field,"," * or an object hash of all fields."," */"," getData: function(name) {"," this._initData();"," var data = this._data,"," ret = data;",""," if (arguments.length) { // single field"," if (name in data) {"," ret = data[name];"," } else { // initialize from HTML attribute"," ret = this._getDataAttribute(name);"," }"," } else if (typeof data == 'object' && data !== null) { // all fields"," ret = {};"," Y.Object.each(data, function(v, n) {"," ret[n] = v;"," });",""," ret = this._getDataAttributes(ret);"," }",""," return ret;",""," },",""," _getDataAttributes: function(ret) {"," ret = ret || {};"," var i = 0,"," attrs = this._node.attributes,"," len = attrs.length,"," prefix = this.DATA_PREFIX,"," prefixLength = prefix.length,"," name;",""," while (i < len) {"," name = attrs[i].name;"," if (name.indexOf(prefix) === 0) {"," name = name.substr(prefixLength);"," if (!(name in ret)) { // only merge if not already stored"," ret[name] = this._getDataAttribute(name);"," }"," }",""," i += 1;"," }",""," return ret;"," },",""," _getDataAttribute: function(name) {"," var name = this.DATA_PREFIX + name,"," node = this._node,"," attrs = node.attributes,"," data = attrs && attrs[name] && attrs[name].value;",""," return data;"," },",""," /**"," * @method setData"," * @for Node"," * @description Stores arbitrary data on a Node instance."," * This is not stored with the DOM node."," * @param {string} name The name of the field to set. If no val"," * is given, name is treated as the data and overrides any existing data."," * @param {any} val The value to be assigned to the field."," * @chainable"," */"," setData: function(name, val) {"," this._initData();"," if (arguments.length > 1) {"," this._data[name] = val;"," } else {"," this._data = name;"," }",""," return this;"," },",""," /**"," * @method clearData"," * @for Node"," * @description Clears internally stored data."," * @param {string} name The name of the field to clear. If no name"," * is given, all data is cleared."," * @chainable"," */"," clearData: function(name) {"," if ('_data' in this) {"," if (typeof name != 'undefined') {"," delete this._data[name];"," } else {"," delete this._data;"," }"," }",""," return this;"," }","});","","Y.mix(Y.NodeList.prototype, {"," /**"," * @method getData"," * @for NodeList"," * @description Retrieves arbitrary data stored on each Node instance"," * bound to the NodeList."," * @see Node"," * @param {string} name Optional name of the data field to retrieve."," * If no name is given, all data is returned."," * @return {Array} An array containing all of the data for each Node instance. "," * or an object hash of all fields."," */"," getData: function(name) {"," var args = (arguments.length) ? [name] : [];"," return this._invoke('getData', args, true);"," },",""," /**"," * @method setData"," * @for NodeList"," * @description Stores arbitrary data on each Node instance bound to the"," * NodeList. This is not stored with the DOM node."," * @param {string} name The name of the field to set. If no name"," * is given, name is treated as the data and overrides any existing data."," * @param {any} val The value to be assigned to the field."," * @chainable"," */"," setData: function(name, val) {"," var args = (arguments.length > 1) ? [name, val] : [name];"," return this._invoke('setData', args);"," },",""," /**"," * @method clearData"," * @for NodeList"," * @description Clears data on all Node instances bound to the NodeList."," * @param {string} name The name of the field to clear. If no name"," * is given, all data is cleared."," * @chainable"," */"," clearData: function(name) {"," var args = (arguments.length) ? [name] : [];"," return this._invoke('clearData', [name]);"," }","});","","","}, '3.7.2', {\"requires\": [\"event-base\", \"node-core\", \"dom-base\"]});"];+_yuitest_coverage["build/node-base/node-base.js"].code=["YUI.add('node-base', function (Y, NAME) {","","/**"," * @module node"," * @submodule node-base"," */","","var methods = [","/**"," * Determines whether each node has the given className."," * @method hasClass"," * @for Node"," * @param {String} className the class name to search for"," * @return {Boolean} Whether or not the element has the specified class"," */"," 'hasClass',","","/**"," * Adds a class name to each node."," * @method addClass"," * @param {String} className the class name to add to the node's class attribute"," * @chainable"," */"," 'addClass',","","/**"," * Removes a class name from each node."," * @method removeClass"," * @param {String} className the class name to remove from the node's class attribute"," * @chainable"," */"," 'removeClass',","","/**"," * Replace a class with another class for each node."," * If no oldClassName is present, the newClassName is simply added."," * @method replaceClass"," * @param {String} oldClassName the class name to be replaced"," * @param {String} newClassName the class name that will be replacing the old class name"," * @chainable"," */"," 'replaceClass',","","/**"," * If the className exists on the node it is removed, if it doesn't exist it is added."," * @method toggleClass"," * @param {String} className the class name to be toggled"," * @param {Boolean} force Option to force adding or removing the class."," * @chainable"," */"," 'toggleClass'","];","","Y.Node.importMethod(Y.DOM, methods);","/**"," * Determines whether each node has the given className."," * @method hasClass"," * @see Node.hasClass"," * @for NodeList"," * @param {String} className the class name to search for"," * @return {Array} An array of booleans for each node bound to the NodeList."," */","","/**"," * Adds a class name to each node."," * @method addClass"," * @see Node.addClass"," * @param {String} className the class name to add to the node's class attribute"," * @chainable"," */","","/**"," * Removes a class name from each node."," * @method removeClass"," * @see Node.removeClass"," * @param {String} className the class name to remove from the node's class attribute"," * @chainable"," */","","/**"," * Replace a class with another class for each node."," * If no oldClassName is present, the newClassName is simply added."," * @method replaceClass"," * @see Node.replaceClass"," * @param {String} oldClassName the class name to be replaced"," * @param {String} newClassName the class name that will be replacing the old class name"," * @chainable"," */","","/**"," * If the className exists on the node it is removed, if it doesn't exist it is added."," * @method toggleClass"," * @see Node.toggleClass"," * @param {String} className the class name to be toggled"," * @chainable"," */","Y.NodeList.importMethod(Y.Node.prototype, methods);","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node,"," Y_DOM = Y.DOM;","","/**"," * Returns a new dom node using the provided markup string."," * @method create"," * @static"," * @param {String} html The markup used to create the element"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @param {HTMLDocument} doc An optional document context"," * @return {Node} A Node instance bound to a DOM node or fragment"," * @for Node"," */","Y_Node.create = function(html, doc) {"," if (doc && doc._node) {"," doc = doc._node;"," }"," return Y.one(Y_DOM.create(html, doc));","};","","Y.mix(Y_Node.prototype, {"," /**"," * Creates a new Node using the provided markup string."," * @method create"," * @param {String} html The markup used to create the element."," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @param {HTMLDocument} doc An optional document context"," * @return {Node} A Node instance bound to a DOM node or fragment"," */"," create: Y_Node.create,",""," /**"," * Inserts the content before the reference node."," * @method insert"," * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @param {Int | Node | HTMLElement | String} where The position to insert at."," * Possible \"where\" arguments"," * <dl>"," * <dt>Y.Node</dt>"," * <dd>The Node to insert before</dd>"," * <dt>HTMLElement</dt>"," * <dd>The element to insert before</dd>"," * <dt>Int</dt>"," * <dd>The index of the child element to insert before</dd>"," * <dt>\"replace\"</dt>"," * <dd>Replaces the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts before the existing HTML</dd>"," * <dt>\"before\"</dt>"," * <dd>Inserts content before the node</dd>"," * <dt>\"after\"</dt>"," * <dd>Inserts content after the node</dd>"," * </dl>"," * @chainable"," */"," insert: function(content, where) {"," this._insert(content, where);"," return this;"," },",""," _insert: function(content, where) {"," var node = this._node,"," ret = null;",""," if (typeof where == 'number') { // allow index"," where = this._node.childNodes[where];"," } else if (where && where._node) { // Node"," where = where._node;"," }",""," if (content && typeof content != 'string') { // allow Node or NodeList/Array instances"," content = content._node || content._nodes || content;"," }"," ret = Y_DOM.addHTML(node, content, where);",""," return ret;"," },",""," /**"," * Inserts the content as the firstChild of the node."," * @method prepend"," * @param {String | Node | HTMLElement} content The content to insert"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @chainable"," */"," prepend: function(content) {"," return this.insert(content, 0);"," },",""," /**"," * Inserts the content as the lastChild of the node."," * @method append"," * @param {String | Node | HTMLElement} content The content to insert"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @chainable"," */"," append: function(content) {"," return this.insert(content, null);"," },",""," /**"," * @method appendChild"," * @param {String | HTMLElement | Node} node Node to be appended"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @return {Node} The appended node"," */"," appendChild: function(node) {"," return Y_Node.scrubVal(this._insert(node));"," },",""," /**"," * @method insertBefore"," * @param {String | HTMLElement | Node} newNode Node to be appended"," * @param {HTMLElement | Node} refNode Node to be inserted before"," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content."," * @return {Node} The inserted node"," */"," insertBefore: function(newNode, refNode) {"," return Y.Node.scrubVal(this._insert(newNode, refNode));"," },",""," /**"," * Appends the node to the given node."," * @method appendTo"," * @param {Node | HTMLElement} node The node to append to"," * @chainable"," */"," appendTo: function(node) {"," Y.one(node).append(this);"," return this;"," },",""," /**"," * Replaces the node's current content with the content."," * Note that this passes to innerHTML and is not escaped."," * Use <a href=\"../classes/Escape.html#method_html\">`Y.Escape.html()`</a>"," * to escape html content or `set('text')` to add as text."," * @method setContent"," * @deprecated Use setHTML"," * @param {String | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert"," * @chainable"," */"," setContent: function(content) {"," this._insert(content, 'replace');"," return this;"," },",""," /**"," * Returns the node's current content (e.g. innerHTML)"," * @method getContent"," * @deprecated Use getHTML"," * @return {String} The current content"," */"," getContent: function(content) {"," return this.get('innerHTML');"," }","});","","/**"," * Replaces the node's current html content with the content provided."," * Note that this passes to innerHTML and is not escaped."," * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text."," * @method setHTML"," * @param {String | HTML | Node | HTMLElement | NodeList | HTMLCollection} content The content to insert"," * @chainable"," */","Y.Node.prototype.setHTML = Y.Node.prototype.setContent;","","/**"," * Returns the node's current html content (e.g. innerHTML)"," * @method getHTML"," * @return {String} The html content"," */","Y.Node.prototype.getHTML = Y.Node.prototype.getContent;","","Y.NodeList.importMethod(Y.Node.prototype, ["," /**"," * Called on each Node instance"," * @for NodeList"," * @method append"," * @see Node.append"," */"," 'append',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method insert"," * @see Node.insert"," */"," 'insert',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method appendChild"," * @see Node.appendChild"," */"," 'appendChild',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method insertBefore"," * @see Node.insertBefore"," */"," 'insertBefore',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method prepend"," * @see Node.prepend"," */"," 'prepend',",""," /**"," * Called on each Node instance"," * Note that this passes to innerHTML and is not escaped."," * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text."," * @for NodeList"," * @method setContent"," * @deprecated Use setHTML"," */"," 'setContent',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method getContent"," * @deprecated Use getHTML"," */"," 'getContent',",""," /**"," * Called on each Node instance"," * Note that this passes to innerHTML and is not escaped."," * Use `Y.Escape.html()` to escape HTML, or `set('text')` to add as text."," * @for NodeList"," * @method setHTML"," * @see Node.setHTML"," */"," 'setHTML',",""," /**"," * Called on each Node instance"," * @for NodeList"," * @method getHTML"," * @see Node.getHTML"," */"," 'getHTML'","]);","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node,"," Y_DOM = Y.DOM;","","/**"," * Static collection of configuration attributes for special handling"," * @property ATTRS"," * @static"," * @type object"," */","Y_Node.ATTRS = {"," /**"," * Allows for getting and setting the text of an element."," * Formatting is preserved and special characters are treated literally."," * @config text"," * @type String"," */"," text: {"," getter: function() {"," return Y_DOM.getText(this._node);"," },",""," setter: function(content) {"," Y_DOM.setText(this._node, content);"," return content;"," }"," },",""," /**"," * Allows for getting and setting the text of an element."," * Formatting is preserved and special characters are treated literally."," * @config for"," * @type String"," */"," 'for': {"," getter: function() {"," return Y_DOM.getAttribute(this._node, 'for');"," },",""," setter: function(val) {"," Y_DOM.setAttribute(this._node, 'for', val);"," return val;"," }"," },",""," 'options': {"," getter: function() {"," return this._node.getElementsByTagName('option');"," }"," },",""," /**"," * Returns a NodeList instance of all HTMLElement children."," * @readOnly"," * @config children"," * @type NodeList"," */"," 'children': {"," getter: function() {"," var node = this._node,"," children = node.children,"," childNodes, i, len;",""," if (!children) {"," childNodes = node.childNodes;"," children = [];",""," for (i = 0, len = childNodes.length; i < len; ++i) {"," if (childNodes[i].tagName) {"," children[children.length] = childNodes[i];"," }"," }"," }"," return Y.all(children);"," }"," },",""," value: {"," getter: function() {"," return Y_DOM.getValue(this._node);"," },",""," setter: function(val) {"," Y_DOM.setValue(this._node, val);"," return val;"," }"," }","};","","Y.Node.importMethod(Y.DOM, ["," /**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @for Node"," * @for NodeList"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',"," /**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @for Node"," * @for NodeList"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */"," 'getAttribute'","","]);","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node;","var Y_NodeList = Y.NodeList;","/**"," * List of events that route to DOM events"," * @static"," * @property DOM_EVENTS"," * @for Node"," */","","Y_Node.DOM_EVENTS = {"," abort: 1,"," beforeunload: 1,"," blur: 1,"," change: 1,"," click: 1,"," close: 1,"," command: 1,"," contextmenu: 1,"," dblclick: 1,"," DOMMouseScroll: 1,"," drag: 1,"," dragstart: 1,"," dragenter: 1,"," dragover: 1,"," dragleave: 1,"," dragend: 1,"," drop: 1,"," error: 1,"," focus: 1,"," key: 1,"," keydown: 1,"," keypress: 1,"," keyup: 1,"," load: 1,"," message: 1,"," mousedown: 1,"," mouseenter: 1,"," mouseleave: 1,"," mousemove: 1,"," mousemultiwheel: 1,"," mouseout: 1,"," mouseover: 1,"," mouseup: 1,"," mousewheel: 1,"," orientationchange: 1,"," reset: 1,"," resize: 1,"," select: 1,"," selectstart: 1,"," submit: 1,"," scroll: 1,"," textInput: 1,"," unload: 1","};","","// Add custom event adaptors to this list. This will make it so","// that delegate, key, available, contentready, etc all will","// be available through Node.on","Y.mix(Y_Node.DOM_EVENTS, Y.Env.evt.plugins);","","Y.augment(Y_Node, Y.EventTarget);","","Y.mix(Y_Node.prototype, {"," /**"," * Removes event listeners from the node and (optionally) its subtree"," * @method purge"," * @param {Boolean} recurse (optional) Whether or not to remove listeners from the"," * node's subtree"," * @param {String} type (optional) Only remove listeners of the specified type"," * @chainable"," *"," */"," purge: function(recurse, type) {"," Y.Event.purgeElement(this._node, recurse, type);"," return this;"," }","","});","","Y.mix(Y.NodeList.prototype, {"," _prepEvtArgs: function(type, fn, context) {"," // map to Y.on/after signature (type, fn, nodes, context, arg1, arg2, etc)"," var args = Y.Array(arguments, 0, true);",""," if (args.length < 2) { // type only (event hash) just add nodes"," args[2] = this._nodes;"," } else {"," args.splice(2, 0, this._nodes);"," }",""," args[3] = context || this; // default to NodeList instance as context",""," return args;"," },",""," /**"," Subscribe a callback function for each `Node` in the collection to execute"," in response to a DOM event.",""," NOTE: Generally, the `on()` method should be avoided on `NodeLists`, in"," favor of using event delegation from a parent Node. See the Event user"," guide for details.",""," Most DOM events are associated with a preventable default behavior, such as"," link clicks navigating to a new page. Callbacks are passed a"," `DOMEventFacade` object as their first argument (usually called `e`) that"," can be used to prevent this default behavior with `e.preventDefault()`. See"," the `DOMEventFacade` API for all available properties and methods on the"," object.",""," By default, the `this` object will be the `NodeList` that the subscription"," came from, <em>not the `Node` that received the event</em>. Use"," `e.currentTarget` to refer to the `Node`.",""," Returning `false` from a callback is supported as an alternative to calling"," `e.preventDefault(); e.stopPropagation();`. However, it is recommended to"," use the event methods.",""," @example",""," Y.all(\".sku\").on(\"keydown\", function (e) {"," if (e.keyCode === 13) {"," e.preventDefault();",""," // Use e.currentTarget to refer to the individual Node"," var item = Y.MyApp.searchInventory( e.currentTarget.get('value') );"," // etc ..."," }"," });",""," @method on"," @param {String} type The name of the event"," @param {Function} fn The callback to execute in response to the event"," @param {Object} [context] Override `this` object in callback"," @param {Any} [arg*] 0..n additional arguments to supply to the subscriber"," @return {EventHandle} A subscription handle capable of detaching that"," subscription"," @for NodeList"," **/"," on: function(type, fn, context) {"," return Y.on.apply(Y, this._prepEvtArgs.apply(this, arguments));"," },",""," /**"," * Applies an one-time event listener to each Node bound to the NodeList."," * @method once"," * @param {String} type The event being listened for"," * @param {Function} fn The handler to call when the event fires"," * @param {Object} context The context to call the handler with."," * Default is the NodeList instance."," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," * @for NodeList"," */"," once: function(type, fn, context) {"," return Y.once.apply(Y, this._prepEvtArgs.apply(this, arguments));"," },",""," /**"," * Applies an event listener to each Node bound to the NodeList."," * The handler is called only after all on() handlers are called"," * and the event is not prevented."," * @method after"," * @param {String} type The event being listened for"," * @param {Function} fn The handler to call when the event fires"," * @param {Object} context The context to call the handler with."," * Default is the NodeList instance."," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," * @for NodeList"," */"," after: function(type, fn, context) {"," return Y.after.apply(Y, this._prepEvtArgs.apply(this, arguments));"," },",""," /**"," * Applies an one-time event listener to each Node bound to the NodeList"," * that will be called only after all on() handlers are called and the"," * event is not prevented."," *"," * @method onceAfter"," * @param {String} type The event being listened for"," * @param {Function} fn The handler to call when the event fires"," * @param {Object} context The context to call the handler with."," * Default is the NodeList instance."," * @return {EventHandle} A subscription handle capable of detaching that"," * subscription"," * @for NodeList"," */"," onceAfter: function(type, fn, context) {"," return Y.onceAfter.apply(Y, this._prepEvtArgs.apply(this, arguments));"," }","});","","Y_NodeList.importMethod(Y.Node.prototype, ["," /**"," * Called on each Node instance"," * @method detach"," * @see Node.detach"," * @for NodeList"," */"," 'detach',",""," /** Called on each Node instance"," * @method detachAll"," * @see Node.detachAll"," * @for NodeList"," */"," 'detachAll'","]);","","/**","Subscribe a callback function to execute in response to a DOM event or custom","event.","","Most DOM events are associated with a preventable default behavior such as","link clicks navigating to a new page. Callbacks are passed a `DOMEventFacade`","object as their first argument (usually called `e`) that can be used to","prevent this default behavior with `e.preventDefault()`. See the","`DOMEventFacade` API for all available properties and methods on the object.","","If the event name passed as the first parameter is not a whitelisted DOM event,","it will be treated as a custom event subscriptions, allowing","`node.fire('customEventName')` later in the code. Refer to the Event user guide","for the full DOM event whitelist.","","By default, the `this` object in the callback will refer to the subscribed","`Node`.","","Returning `false` from a callback is supported as an alternative to calling","`e.preventDefault(); e.stopPropagation();`. However, it is recommended to use","the event methods.","","@example",""," Y.one(\"#my-form\").on(\"submit\", function (e) {"," e.preventDefault();",""," // proceed with ajax form submission instead..."," });","","@method on","@param {String} type The name of the event","@param {Function} fn The callback to execute in response to the event","@param {Object} [context] Override `this` object in callback","@param {Any} [arg*] 0..n additional arguments to supply to the subscriber","@return {EventHandle} A subscription handle capable of detaching that"," subscription","@for Node","**/","","Y.mix(Y.Node.ATTRS, {"," offsetHeight: {"," setter: function(h) {"," Y.DOM.setHeight(this._node, h);"," return h;"," },",""," getter: function() {"," return this._node.offsetHeight;"," }"," },",""," offsetWidth: {"," setter: function(w) {"," Y.DOM.setWidth(this._node, w);"," return w;"," },",""," getter: function() {"," return this._node.offsetWidth;"," }"," }","});","","Y.mix(Y.Node.prototype, {"," sizeTo: function(w, h) {"," var node;"," if (arguments.length < 2) {"," node = Y.one(w);"," w = node.get('offsetWidth');"," h = node.get('offsetHeight');"," }",""," this.setAttrs({"," offsetWidth: w,"," offsetHeight: h"," });"," }","});","/**"," * @module node"," * @submodule node-base"," */","","var Y_Node = Y.Node;","","Y.mix(Y_Node.prototype, {"," /**"," * Makes the node visible."," * If the \"transition\" module is loaded, show optionally"," * animates the showing of the node using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method show"," * @for Node"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @chainable"," */"," show: function(callback) {"," callback = arguments[arguments.length - 1];"," this.toggleView(true, callback);"," return this;"," },",""," /**"," * The implementation for showing nodes."," * Default is to toggle the style.display property."," * @method _show"," * @protected"," * @chainable"," */"," _show: function() {"," this.setStyle('display', '');",""," },",""," _isHidden: function() {"," return Y.DOM.getStyle(this._node, 'display') === 'none';"," },",""," /**"," * Displays or hides the node."," * If the \"transition\" module is loaded, toggleView optionally"," * animates the toggling of the node using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method toggleView"," * @for Node"," * @param {Boolean} [on] An optional boolean value to force the node to be shown or hidden"," * @param {Function} [callback] An optional function to run after the transition completes."," * @chainable"," */"," toggleView: function(on, callback) {"," this._toggleView.apply(this, arguments);"," return this;"," },",""," _toggleView: function(on, callback) {"," callback = arguments[arguments.length - 1];",""," // base on current state if not forcing"," if (typeof on != 'boolean') {"," on = (this._isHidden()) ? 1 : 0;"," }",""," if (on) {"," this._show();"," } else {"," this._hide();"," }",""," if (typeof callback == 'function') {"," callback.call(this);"," }",""," return this;"," },",""," /**"," * Hides the node."," * If the \"transition\" module is loaded, hide optionally"," * animates the hiding of the node using either the default"," * transition effect ('fadeOut'), or the given named effect."," * @method hide"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @chainable"," */"," hide: function(callback) {"," callback = arguments[arguments.length - 1];"," this.toggleView(false, callback);"," return this;"," },",""," /**"," * The implementation for hiding nodes."," * Default is to toggle the style.display property."," * @method _hide"," * @protected"," * @chainable"," */"," _hide: function() {"," this.setStyle('display', 'none');"," }","});","","Y.NodeList.importMethod(Y.Node.prototype, ["," /**"," * Makes each node visible."," * If the \"transition\" module is loaded, show optionally"," * animates the showing of the node using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method show"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @for NodeList"," * @chainable"," */"," 'show',",""," /**"," * Hides each node."," * If the \"transition\" module is loaded, hide optionally"," * animates the hiding of the node using either the default"," * transition effect ('fadeOut'), or the given named effect."," * @method hide"," * @param {String} name A named Transition effect to use as the show effect."," * @param {Object} config Options to use with the transition."," * @param {Function} callback An optional function to run after the transition completes."," * @chainable"," */"," 'hide',",""," /**"," * Displays or hides each node."," * If the \"transition\" module is loaded, toggleView optionally"," * animates the toggling of the nodes using either the default"," * transition effect ('fadeIn'), or the given named effect."," * @method toggleView"," * @param {Boolean} [on] An optional boolean value to force the nodes to be shown or hidden"," * @param {Function} [callback] An optional function to run after the transition completes."," * @chainable"," */"," 'toggleView'","]);","","if (!Y.config.doc.documentElement.hasAttribute) { // IE < 8"," Y.Node.prototype.hasAttribute = function(attr) {"," if (attr === 'value') {"," if (this.get('value') !== \"\") { // IE < 8 fails to populate specified when set in HTML"," return true;"," }"," }"," return !!(this._node.attributes[attr] &&"," this._node.attributes[attr].specified);"," };","}","","// IE throws an error when calling focus() on an element that's invisible, not","// displayed, or disabled.","Y.Node.prototype.focus = function () {"," try {"," this._node.focus();"," } catch (e) {"," }",""," return this;","};","","// IE throws error when setting input.type = 'hidden',","// input.setAttribute('type', 'hidden') and input.attributes.type.value = 'hidden'","Y.Node.ATTRS.type = {"," setter: function(val) {"," if (val === 'hidden') {"," try {"," this._node.type = 'hidden';"," } catch(e) {"," this.setStyle('display', 'none');"," this._inputType = 'hidden';"," }"," } else {"," try { // IE errors when changing the type from \"hidden'"," this._node.type = val;"," } catch (e) {"," }"," }"," return val;"," },",""," getter: function() {"," return this._inputType || this._node.type;"," },",""," _bypassProxy: true // don't update DOM when using with Attribute","};","","if (Y.config.doc.createElement('form').elements.nodeType) {"," // IE: elements collection is also FORM node which trips up scrubVal."," Y.Node.ATTRS.elements = {"," getter: function() {"," return this.all('input, textarea, button, select');"," }"," };","}","","/**"," * Provides methods for managing custom Node data."," * "," * @module node"," * @main node"," * @submodule node-data"," */","","Y.mix(Y.Node.prototype, {"," _initData: function() {"," if (! ('_data' in this)) {"," this._data = {};"," }"," },",""," /**"," * @method getData"," * @for Node"," * @description Retrieves arbitrary data stored on a Node instance."," * If no data is associated with the Node, it will attempt to retrieve"," * a value from the corresponding HTML data attribute. (e.g. node.getData('foo')"," * will check node.getAttribute('data-foo'))."," * @param {string} name Optional name of the data field to retrieve."," * If no name is given, all data is returned."," * @return {any | Object} Whatever is stored at the given field,"," * or an object hash of all fields."," */"," getData: function(name) {"," this._initData();"," var data = this._data,"," ret = data;",""," if (arguments.length) { // single field"," if (name in data) {"," ret = data[name];"," } else { // initialize from HTML attribute"," ret = this._getDataAttribute(name);"," }"," } else if (typeof data == 'object' && data !== null) { // all fields"," ret = {};"," Y.Object.each(data, function(v, n) {"," ret[n] = v;"," });",""," ret = this._getDataAttributes(ret);"," }",""," return ret;",""," },",""," _getDataAttributes: function(ret) {"," ret = ret || {};"," var i = 0,"," attrs = this._node.attributes,"," len = attrs.length,"," prefix = this.DATA_PREFIX,"," prefixLength = prefix.length,"," name;",""," while (i < len) {"," name = attrs[i].name;"," if (name.indexOf(prefix) === 0) {"," name = name.substr(prefixLength);"," if (!(name in ret)) { // only merge if not already stored"," ret[name] = this._getDataAttribute(name);"," }"," }",""," i += 1;"," }",""," return ret;"," },",""," _getDataAttribute: function(name) {"," var name = this.DATA_PREFIX + name,"," node = this._node,"," attrs = node.attributes,"," data = attrs && attrs[name] && attrs[name].value;",""," return data;"," },",""," /**"," * @method setData"," * @for Node"," * @description Stores arbitrary data on a Node instance."," * This is not stored with the DOM node."," * @param {string} name The name of the field to set. If no val"," * is given, name is treated as the data and overrides any existing data."," * @param {any} val The value to be assigned to the field."," * @chainable"," */"," setData: function(name, val) {"," this._initData();"," if (arguments.length > 1) {"," this._data[name] = val;"," } else {"," this._data = name;"," }",""," return this;"," },",""," /**"," * @method clearData"," * @for Node"," * @description Clears internally stored data."," * @param {string} name The name of the field to clear. If no name"," * is given, all data is cleared."," * @chainable"," */"," clearData: function(name) {"," if ('_data' in this) {"," if (typeof name != 'undefined') {"," delete this._data[name];"," } else {"," delete this._data;"," }"," }",""," return this;"," }","});","","Y.mix(Y.NodeList.prototype, {"," /**"," * @method getData"," * @for NodeList"," * @description Retrieves arbitrary data stored on each Node instance"," * bound to the NodeList."," * @see Node"," * @param {string} name Optional name of the data field to retrieve."," * If no name is given, all data is returned."," * @return {Array} An array containing all of the data for each Node instance. "," * or an object hash of all fields."," */"," getData: function(name) {"," var args = (arguments.length) ? [name] : [];"," return this._invoke('getData', args, true);"," },",""," /**"," * @method setData"," * @for NodeList"," * @description Stores arbitrary data on each Node instance bound to the"," * NodeList. This is not stored with the DOM node."," * @param {string} name The name of the field to set. If no name"," * is given, name is treated as the data and overrides any existing data."," * @param {any} val The value to be assigned to the field."," * @chainable"," */"," setData: function(name, val) {"," var args = (arguments.length > 1) ? [name, val] : [name];"," return this._invoke('setData', args);"," },",""," /**"," * @method clearData"," * @for NodeList"," * @description Clears data on all Node instances bound to the NodeList."," * @param {string} name The name of the field to clear. If no name"," * is given, all data is cleared."," * @chainable"," */"," clearData: function(name) {"," var args = (arguments.length) ? [name] : [];"," return this._invoke('clearData', [name]);"," }","});","","","}, '3.7.3', {\"requires\": [\"event-base\", \"node-core\", \"dom-base\"]});"]; _yuitest_coverage["build/node-base/node-base.js"].lines = {"1":0,"8":0,"54":0,"97":0,"103":0,"117":0,"118":0,"119":0,"121":0,"124":0,"163":0,"164":0,"168":0,"171":0,"172":0,"173":0,"174":0,"177":0,"178":0,"180":0,"182":0,"194":0,"206":0,"217":0,"229":0,"239":0,"240":0,"254":0,"255":0,"265":0,"277":0,"284":0,"286":0,"368":0,"377":0,"386":0,"390":0,"391":0,"403":0,"407":0,"408":0,"414":0,"426":0,"430":0,"431":0,"432":0,"434":0,"435":0,"436":0,"440":0,"446":0,"450":0,"451":0,"456":0,"485":0,"486":0,"494":0,"543":0,"545":0,"547":0,"558":0,"559":0,"564":0,"567":0,"569":0,"570":0,"572":0,"575":0,"577":0,"625":0,"640":0,"657":0,"675":0,"679":0,"736":0,"739":0,"740":0,"744":0,"750":0,"751":0,"755":0,"760":0,"762":0,"763":0,"764":0,"765":0,"766":0,"769":0,"780":0,"782":0,"796":0,"797":0,"798":0,"809":0,"814":0,"829":0,"830":0,"834":0,"837":0,"838":0,"841":0,"842":0,"844":0,"847":0,"848":0,"851":0,"866":0,"867":0,"868":0,"879":0,"883":0,"924":0,"925":0,"926":0,"927":0,"928":0,"931":0,"938":0,"939":0,"940":0,"944":0,"949":0,"951":0,"952":0,"953":0,"955":0,"956":0,"959":0,"960":0,"964":0,"968":0,"974":0,"976":0,"978":0,"991":0,"993":0,"994":0,"1011":0,"1012":0,"1015":0,"1016":0,"1017":0,"1019":0,"1021":0,"1022":0,"1023":0,"1024":0,"1027":0,"1030":0,"1035":0,"1036":0,"1043":0,"1044":0,"1045":0,"1046":0,"1047":0,"1048":0,"1052":0,"1055":0,"1059":0,"1064":0,"1078":0,"1079":0,"1080":0,"1082":0,"1085":0,"1097":0,"1098":0,"1099":0,"1101":0,"1105":0,"1109":0,"1122":0,"1123":0,"1137":0,"1138":0,"1150":0,"1151":0}; _yuitest_coverage["build/node-base/node-base.js"].functions = {"create:117":0,"insert:162":0,"_insert:167":0,"prepend:193":0,"append:205":0,"appendChild:216":0,"insertBefore:228":0,"appendTo:238":0,"setContent:253":0,"getContent:264":0,"getter:385":0,"setter:389":0,"getter:402":0,"setter:406":0,"getter:413":0,"getter:425":0,"getter:445":0,"setter:449":0,"purge:557":0,"_prepEvtArgs:565":0,"on:624":0,"once:639":0,"after:656":0,"onceAfter:674":0,"setter:738":0,"getter:743":0,"setter:749":0,"getter:754":0,"sizeTo:761":0,"show:795":0,"_show:808":0,"_isHidden:813":0,"toggleView:828":0,"_toggleView:833":0,"hide:865":0,"_hide:878":0,"hasAttribute:925":0,"focus:938":0,"setter:950":0,"getter:967":0,"getter:977":0,"_initData:992":0,"(anonymous 2):1023":0,"getData:1010":0,"_getDataAttributes:1034":0,"_getDataAttribute:1058":0,"setData:1077":0,"clearData:1096":0,"getData:1121":0,"setData:1136":0,"clearData:1149":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-base/node-base.js"].coveredLines = 178;@@ -1422,4 +1422,4 @@ }); -}, '3.7.2', {"requires": ["event-base", "node-core", "dom-base"]});+}, '3.7.3', {"requires": ["event-base", "node-core", "dom-base"]});
bundle/node-base/node-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1161,4 +1161,4 @@ }); -}, '3.7.2', {"requires": ["event-base", "node-core", "dom-base"]});+}, '3.7.3', {"requires": ["event-base", "node-core", "dom-base"]});
bundle/node-base/node-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-base",function(e,t){var n=["hasClass","addClass","removeClass","replaceClass","toggleClass"];e.Node.importMethod(e.DOM,n),e.NodeList.importMethod(e.Node.prototype,n);var r=e.Node,i=e.DOM;r.create=function(t,n){return n&&n._node&&(n=n._node),e.one(i.create(t,n))},e.mix(r.prototype,{create:r.create,insert:function(e,t){return this._insert(e,t),this},_insert:function(e,t){var n=this._node,r=null;return typeof t=="number"?t=this._node.childNodes[t]:t&&t._node&&(t=t._node),e&&typeof e!="string"&&(e=e._node||e._nodes||e),r=i.addHTML(n,e,t),r},prepend:function(e){return this.insert(e,0)},append:function(e){return this.insert(e,null)},appendChild:function(e){return r.scrubVal(this._insert(e))},insertBefore:function(t,n){return e.Node.scrubVal(this._insert(t,n))},appendTo:function(t){return e.one(t).append(this),this},setContent:function(e){return this._insert(e,"replace"),this},getContent:function(e){return this.get("innerHTML")}}),e.Node.prototype.setHTML=e.Node.prototype.setContent,e.Node.prototype.getHTML=e.Node.prototype.getContent,e.NodeList.importMethod(e.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent","setHTML","getHTML"]);var r=e.Node,i=e.DOM;r.ATTRS={text:{getter:function(){return i.getText(this._node)},setter:function(e){return i.setText(this._node,e),e}},"for":{getter:function(){return i.getAttribute(this._node,"for")},setter:function(e){return i.setAttribute(this._node,"for",e),e}},options:{getter:function(){return this._node.getElementsByTagName("option")}},children:{getter:function(){var t=this._node,n=t.children,r,i,s;if(!n){r=t.childNodes,n=[];for(i=0,s=r.length;i<s;++i)r[i].tagName&&(n[n.length]=r[i])}return e.all(n)}},value:{getter:function(){return i.getValue(this._node)},setter:function(e){return i.setValue(this._node,e),e}}},e.Node.importMethod(e.DOM,["setAttribute","getAttribute"]);var r=e.Node,s=e.NodeList;r.DOM_EVENTS={abort:1,beforeunload:1,blur:1,change:1,click:1,close:1,command:1,contextmenu:1,dblclick:1,DOMMouseScroll:1,drag:1,dragstart:1,dragenter:1,dragover:1,dragleave:1,dragend:1,drop:1,error:1,focus:1,key:1,keydown:1,keypress:1,keyup:1,load:1,message:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mousemultiwheel:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,orientationchange:1,reset:1,resize:1,select:1,selectstart:1,submit:1,scroll:1,textInput:1,unload:1},e.mix(r.DOM_EVENTS,e.Env.evt.plugins),e.augment(r,e.EventTarget),e.mix(r.prototype,{purge:function(t,n){return e.Event.purgeElement(this._node,t,n),this}}),e.mix(e.NodeList.prototype,{_prepEvtArgs:function(t,n,r){var i=e.Array(arguments,0,!0);return i.length<2?i[2]=this._nodes:i.splice(2,0,this._nodes),i[3]=r||this,i},on:function(t,n,r){return e.on.apply(e,this._prepEvtArgs.apply(this,arguments))},once:function(t,n,r){return e.once.apply(e,this._prepEvtArgs.apply(this,arguments))},after:function(t,n,r){return e.after.apply(e,this._prepEvtArgs.apply(this,arguments))},onceAfter:function(t,n,r){return e.onceAfter.apply(e,this._prepEvtArgs.apply(this,arguments))}}),s.importMethod(e.Node.prototype,["detach","detachAll"]),e.mix(e.Node.ATTRS,{offsetHeight:{setter:function(t){return e.DOM.setHeight(this._node,t),t},getter:function(){return this._node.offsetHeight}},offsetWidth:{setter:function(t){return e.DOM.setWidth(this._node,t),t},getter:function(){return this._node.offsetWidth}}}),e.mix(e.Node.prototype,{sizeTo:function(t,n){var r;arguments.length<2&&(r=e.one(t),t=r.get("offsetWidth"),n=r.get("offsetHeight")),this.setAttrs({offsetWidth:t,offsetHeight:n})}});var r=e.Node;e.mix(r.prototype,{show:function(e){return e=arguments[arguments.length-1],this.toggleView(!0,e),this},_show:function(){this.setStyle("display","")},_isHidden:function(){return e.DOM.getStyle(this._node,"display")==="none"},toggleView:function(e,t){return this._toggleView.apply(this,arguments),this},_toggleView:function(e,t){return t=arguments[arguments.length-1],typeof e!="boolean"&&(e=this._isHidden()?1:0),e?this._show():this._hide(),typeof t=="function"&&t.call(this),this},hide:function(e){return e=arguments[arguments.length-1],this.toggleView(!1,e),this},_hide:function(){this.setStyle("display","none")}}),e.NodeList.importMethod(e.Node.prototype,["show","hide","toggleView"]),e.config.doc.documentElement.hasAttribute||(e.Node.prototype.hasAttribute=function(e){return e==="value"&&this.get("value")!==""?!0:!!this._node.attributes[e]&&!!this._node.attributes[e].specified}),e.Node.prototype.focus=function(){try{this._node.focus()}catch(e){}return this},e.Node.ATTRS.type={setter:function(e){if(e==="hidden")try{this._node.type="hidden"}catch(t){this.setStyle("display","none"),this._inputType="hidden"}else try{this._node.type=e}catch(t){}return e},getter:function(){return this._inputType||this._node.type},_bypassProxy:!0},e.config.doc.createElement("form").elements.nodeType&&(e.Node.ATTRS.elements={getter:function(){return this.all("input, textarea, button, select")}}),e.mix(e.Node.prototype,{_initData:function(){"_data"in this||(this._data={})},getData:function(t){this._initData();var n=this._data,r=n;return arguments.length?t in n?r=n[t]:r=this._getDataAttribute(t):typeof n=="object"&&n!==null&&(r={},e.Object.each(n,function(e,t){r[t]=e}),r=this._getDataAttributes(r)),r},_getDataAttributes:function(e){e=e||{};var t=0,n=this._node.attributes,r=n.length,i=this.DATA_PREFIX,s=i.length,o;while(t<r)o=n[t].name,o.indexOf(i)===0&&(o=o.substr(s),o in e||(e[o]=this._getDataAttribute(o))),t+=1;return e},_getDataAttribute:function(e){var e=this.DATA_PREFIX+e,t=this._node,n=t.attributes,r=n&&n[e]&&n[e].value;return r},setData:function(e,t){return this._initData(),arguments.length>1?this._data[e]=t:this._data=e,this},clearData:function(e){return"_data"in this&&(typeof e!="undefined"?delete this._data[e]:delete this._data),this}}),e.mix(e.NodeList.prototype,{getData:function(e){var t=arguments.length?[e]:[];return this._invoke("getData",t,!0)},setData:function(e,t){var n=arguments.length>1?[e,t]:[e];return this._invoke("setData",n)},clearData:function(e){var t=arguments.length?[e]:[];return this._invoke("clearData",[e])}})},"3.7.2",{requires:["event-base","node-core","dom-base"]});+YUI.add("node-base",function(e,t){var n=["hasClass","addClass","removeClass","replaceClass","toggleClass"];e.Node.importMethod(e.DOM,n),e.NodeList.importMethod(e.Node.prototype,n);var r=e.Node,i=e.DOM;r.create=function(t,n){return n&&n._node&&(n=n._node),e.one(i.create(t,n))},e.mix(r.prototype,{create:r.create,insert:function(e,t){return this._insert(e,t),this},_insert:function(e,t){var n=this._node,r=null;return typeof t=="number"?t=this._node.childNodes[t]:t&&t._node&&(t=t._node),e&&typeof e!="string"&&(e=e._node||e._nodes||e),r=i.addHTML(n,e,t),r},prepend:function(e){return this.insert(e,0)},append:function(e){return this.insert(e,null)},appendChild:function(e){return r.scrubVal(this._insert(e))},insertBefore:function(t,n){return e.Node.scrubVal(this._insert(t,n))},appendTo:function(t){return e.one(t).append(this),this},setContent:function(e){return this._insert(e,"replace"),this},getContent:function(e){return this.get("innerHTML")}}),e.Node.prototype.setHTML=e.Node.prototype.setContent,e.Node.prototype.getHTML=e.Node.prototype.getContent,e.NodeList.importMethod(e.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent","setHTML","getHTML"]);var r=e.Node,i=e.DOM;r.ATTRS={text:{getter:function(){return i.getText(this._node)},setter:function(e){return i.setText(this._node,e),e}},"for":{getter:function(){return i.getAttribute(this._node,"for")},setter:function(e){return i.setAttribute(this._node,"for",e),e}},options:{getter:function(){return this._node.getElementsByTagName("option")}},children:{getter:function(){var t=this._node,n=t.children,r,i,s;if(!n){r=t.childNodes,n=[];for(i=0,s=r.length;i<s;++i)r[i].tagName&&(n[n.length]=r[i])}return e.all(n)}},value:{getter:function(){return i.getValue(this._node)},setter:function(e){return i.setValue(this._node,e),e}}},e.Node.importMethod(e.DOM,["setAttribute","getAttribute"]);var r=e.Node,s=e.NodeList;r.DOM_EVENTS={abort:1,beforeunload:1,blur:1,change:1,click:1,close:1,command:1,contextmenu:1,dblclick:1,DOMMouseScroll:1,drag:1,dragstart:1,dragenter:1,dragover:1,dragleave:1,dragend:1,drop:1,error:1,focus:1,key:1,keydown:1,keypress:1,keyup:1,load:1,message:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mousemultiwheel:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,orientationchange:1,reset:1,resize:1,select:1,selectstart:1,submit:1,scroll:1,textInput:1,unload:1},e.mix(r.DOM_EVENTS,e.Env.evt.plugins),e.augment(r,e.EventTarget),e.mix(r.prototype,{purge:function(t,n){return e.Event.purgeElement(this._node,t,n),this}}),e.mix(e.NodeList.prototype,{_prepEvtArgs:function(t,n,r){var i=e.Array(arguments,0,!0);return i.length<2?i[2]=this._nodes:i.splice(2,0,this._nodes),i[3]=r||this,i},on:function(t,n,r){return e.on.apply(e,this._prepEvtArgs.apply(this,arguments))},once:function(t,n,r){return e.once.apply(e,this._prepEvtArgs.apply(this,arguments))},after:function(t,n,r){return e.after.apply(e,this._prepEvtArgs.apply(this,arguments))},onceAfter:function(t,n,r){return e.onceAfter.apply(e,this._prepEvtArgs.apply(this,arguments))}}),s.importMethod(e.Node.prototype,["detach","detachAll"]),e.mix(e.Node.ATTRS,{offsetHeight:{setter:function(t){return e.DOM.setHeight(this._node,t),t},getter:function(){return this._node.offsetHeight}},offsetWidth:{setter:function(t){return e.DOM.setWidth(this._node,t),t},getter:function(){return this._node.offsetWidth}}}),e.mix(e.Node.prototype,{sizeTo:function(t,n){var r;arguments.length<2&&(r=e.one(t),t=r.get("offsetWidth"),n=r.get("offsetHeight")),this.setAttrs({offsetWidth:t,offsetHeight:n})}});var r=e.Node;e.mix(r.prototype,{show:function(e){return e=arguments[arguments.length-1],this.toggleView(!0,e),this},_show:function(){this.setStyle("display","")},_isHidden:function(){return e.DOM.getStyle(this._node,"display")==="none"},toggleView:function(e,t){return this._toggleView.apply(this,arguments),this},_toggleView:function(e,t){return t=arguments[arguments.length-1],typeof e!="boolean"&&(e=this._isHidden()?1:0),e?this._show():this._hide(),typeof t=="function"&&t.call(this),this},hide:function(e){return e=arguments[arguments.length-1],this.toggleView(!1,e),this},_hide:function(){this.setStyle("display","none")}}),e.NodeList.importMethod(e.Node.prototype,["show","hide","toggleView"]),e.config.doc.documentElement.hasAttribute||(e.Node.prototype.hasAttribute=function(e){return e==="value"&&this.get("value")!==""?!0:!!this._node.attributes[e]&&!!this._node.attributes[e].specified}),e.Node.prototype.focus=function(){try{this._node.focus()}catch(e){}return this},e.Node.ATTRS.type={setter:function(e){if(e==="hidden")try{this._node.type="hidden"}catch(t){this.setStyle("display","none"),this._inputType="hidden"}else try{this._node.type=e}catch(t){}return e},getter:function(){return this._inputType||this._node.type},_bypassProxy:!0},e.config.doc.createElement("form").elements.nodeType&&(e.Node.ATTRS.elements={getter:function(){return this.all("input, textarea, button, select")}}),e.mix(e.Node.prototype,{_initData:function(){"_data"in this||(this._data={})},getData:function(t){this._initData();var n=this._data,r=n;return arguments.length?t in n?r=n[t]:r=this._getDataAttribute(t):typeof n=="object"&&n!==null&&(r={},e.Object.each(n,function(e,t){r[t]=e}),r=this._getDataAttributes(r)),r},_getDataAttributes:function(e){e=e||{};var t=0,n=this._node.attributes,r=n.length,i=this.DATA_PREFIX,s=i.length,o;while(t<r)o=n[t].name,o.indexOf(i)===0&&(o=o.substr(s),o in e||(e[o]=this._getDataAttribute(o))),t+=1;return e},_getDataAttribute:function(e){var e=this.DATA_PREFIX+e,t=this._node,n=t.attributes,r=n&&n[e]&&n[e].value;return r},setData:function(e,t){return this._initData(),arguments.length>1?this._data[e]=t:this._data=e,this},clearData:function(e){return"_data"in this&&(typeof e!="undefined"?delete this._data[e]:delete this._data),this}}),e.mix(e.NodeList.prototype,{getData:function(e){var t=arguments.length?[e]:[];return this._invoke("getData",t,!0)},setData:function(e,t){var n=arguments.length>1?[e,t]:[e];return this._invoke("setData",n)},clearData:function(e){var t=arguments.length?[e]:[];return this._invoke("clearData",[e])}})},"3.7.3",{requires:["event-base","node-core","dom-base"]});
bundle/node-base/node-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1159,4 +1159,4 @@ }); -}, '3.7.2', {"requires": ["event-base", "node-core", "dom-base"]});+}, '3.7.3', {"requires": ["event-base", "node-core", "dom-base"]});
bundle/node-core/node-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/node-core/node-core.js", code: [] };-_yuitest_coverage["build/node-core/node-core.js"].code=["YUI.add('node-core', function (Y, NAME) {","","/**"," * The Node Utility provides a DOM-like interface for interacting with DOM nodes."," * @module node"," * @main node"," * @submodule node-core"," */","","/**"," * The Node class provides a wrapper for manipulating DOM Nodes."," * Node properties can be accessed via the set/get methods."," * Use `Y.one()` to retrieve Node instances."," *"," * <strong>NOTE:</strong> Node properties are accessed using"," * the <code>set</code> and <code>get</code> methods."," *"," * @class Node"," * @constructor"," * @param {DOMNode} node the DOM node to be mapped to the Node instance."," * @uses EventTarget"," */","","// \"globals\"","var DOT = '.',"," NODE_NAME = 'nodeName',"," NODE_TYPE = 'nodeType',"," OWNER_DOCUMENT = 'ownerDocument',"," TAG_NAME = 'tagName',"," UID = '_yuid',"," EMPTY_OBJ = {},",""," _slice = Array.prototype.slice,",""," Y_DOM = Y.DOM,",""," Y_Node = function(node) {"," if (!this.getDOMNode) { // support optional \"new\""," return new Y_Node(node);"," }",""," if (typeof node == 'string') {"," node = Y_Node._fromString(node);"," if (!node) {"," return null; // NOTE: return"," }"," }",""," var uid = (node.nodeType !== 9) ? node.uniqueID : node[UID];",""," if (uid && Y_Node._instances[uid] && Y_Node._instances[uid]._node !== node) {"," node[UID] = null; // unset existing uid to prevent collision (via clone or hack)"," }",""," uid = uid || Y.stamp(node);"," if (!uid) { // stamp failed; likely IE non-HTMLElement"," uid = Y.guid();"," }",""," this[UID] = uid;",""," /**"," * The underlying DOM node bound to the Y.Node instance"," * @property _node"," * @type DOMNode"," * @private"," */"," this._node = node;",""," this._stateProxy = node; // when augmented with Attribute",""," if (this._initPlugins) { // when augmented with Plugin.Host"," this._initPlugins();"," }"," },",""," // used with previous/next/ancestor tests"," _wrapFn = function(fn) {"," var ret = null;"," if (fn) {"," ret = (typeof fn == 'string') ?"," function(n) {"," return Y.Selector.test(n, fn);"," } :"," function(n) {"," return fn(Y.one(n));"," };"," }",""," return ret;"," };","// end \"globals\"","","Y_Node.ATTRS = {};","Y_Node.DOM_EVENTS = {};","","Y_Node._fromString = function(node) {"," if (node) {"," if (node.indexOf('doc') === 0) { // doc OR document"," node = Y.config.doc;"," } else if (node.indexOf('win') === 0) { // win OR window"," node = Y.config.win;"," } else {"," node = Y.Selector.query(node, null, true);"," }"," }",""," return node || null;","};","","/**"," * The name of the component"," * @static"," * @type String"," * @property NAME"," */","Y_Node.NAME = 'node';","","/*"," * The pattern used to identify ARIA attributes"," */","Y_Node.re_aria = /^(?:role$|aria-)/;","","Y_Node.SHOW_TRANSITION = 'fadeIn';","Y_Node.HIDE_TRANSITION = 'fadeOut';","","/**"," * A list of Node instances that have been created"," * @private"," * @type Object"," * @property _instances"," * @static"," *"," */","Y_Node._instances = {};","","/**"," * Retrieves the DOM node bound to a Node instance"," * @method getDOMNode"," * @static"," *"," * @param {Node | HTMLNode} node The Node instance or an HTMLNode"," * @return {HTMLNode} The DOM node bound to the Node instance. If a DOM node is passed"," * as the node argument, it is simply returned."," */","Y_Node.getDOMNode = function(node) {"," if (node) {"," return (node.nodeType) ? node : node._node || null;"," }"," return null;","};","","/**"," * Checks Node return values and wraps DOM Nodes as Y.Node instances"," * and DOM Collections / Arrays as Y.NodeList instances."," * Other return values just pass thru. If undefined is returned (e.g. no return)"," * then the Node instance is returned for chainability."," * @method scrubVal"," * @static"," *"," * @param {any} node The Node instance or an HTMLNode"," * @return {Node | NodeList | Any} Depends on what is returned from the DOM node."," */","Y_Node.scrubVal = function(val, node) {"," if (val) { // only truthy values are risky"," if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function"," if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window"," val = Y.one(val);"," } else if ((val.item && !val._nodes) || // dom collection or Node instance"," (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes"," val = Y.all(val);"," }"," }"," } else if (typeof val === 'undefined') {"," val = node; // for chaining"," } else if (val === null) {"," val = null; // IE: DOM null not the same as null"," }",""," return val;","};","","/**"," * Adds methods to the Y.Node prototype, routing through scrubVal."," * @method addMethod"," * @static"," *"," * @param {String} name The name of the method to add"," * @param {Function} fn The function that becomes the method"," * @param {Object} context An optional context to call the method with"," * (defaults to the Node instance)"," * @return {any} Depends on what is returned from the DOM node."," */","Y_Node.addMethod = function(name, fn, context) {"," if (name && fn && typeof fn == 'function') {"," Y_Node.prototype[name] = function() {"," var args = _slice.call(arguments),"," node = this,"," ret;",""," if (args[0] && args[0]._node) {"," args[0] = args[0]._node;"," }",""," if (args[1] && args[1]._node) {"," args[1] = args[1]._node;"," }"," args.unshift(node._node);",""," ret = fn.apply(node, args);",""," if (ret) { // scrub truthy"," ret = Y_Node.scrubVal(ret, node);"," }",""," (typeof ret != 'undefined') || (ret = node);"," return ret;"," };"," } else {"," }","};","","/**"," * Imports utility methods to be added as Y.Node methods."," * @method importMethod"," * @static"," *"," * @param {Object} host The object that contains the method to import."," * @param {String} name The name of the method to import"," * @param {String} altName An optional name to use in place of the host name"," * @param {Object} context An optional context to call the method with"," */","Y_Node.importMethod = function(host, name, altName) {"," if (typeof name == 'string') {"," altName = altName || name;"," Y_Node.addMethod(altName, host[name], host);"," } else {"," Y.Array.each(name, function(n) {"," Y_Node.importMethod(host, n);"," });"," }","};","","/**"," * Retrieves a NodeList based on the given CSS selector."," * @method all"," *"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," * @for YUI"," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector. Returns null if no match found."," * <strong>Note:</strong> For chaining purposes you may want to"," * use <code>Y.all</code>, which returns a NodeList when no match is found."," * @method one"," * @param {String | HTMLElement} node a node or Selector"," * @return {Node | null} a Node instance or null if no match found."," * @for YUI"," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector. Returns null if no match found."," * <strong>Note:</strong> For chaining purposes you may want to"," * use <code>Y.all</code>, which returns a NodeList when no match is found."," * @method one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @return {Node | null} a Node instance or null if no match found."," * @for Node"," */","Y_Node.one = function(node) {"," var instance = null,"," cachedNode,"," uid;",""," if (node) {"," if (typeof node == 'string') {"," node = Y_Node._fromString(node);"," if (!node) {"," return null; // NOTE: return"," }"," } else if (node.getDOMNode) {"," return node; // NOTE: return"," }",""," if (node.nodeType || Y.DOM.isWindow(node)) { // avoid bad input (numbers, boolean, etc)"," uid = (node.uniqueID && node.nodeType !== 9) ? node.uniqueID : node._yuid;"," instance = Y_Node._instances[uid]; // reuse exising instances"," cachedNode = instance ? instance._node : null;"," if (!instance || (cachedNode && node !== cachedNode)) { // new Node when nodes don't match"," instance = new Y_Node(node);"," if (node.nodeType != 11) { // dont cache document fragment"," Y_Node._instances[instance[UID]] = instance; // cache node"," }"," }"," }"," }",""," return instance;","};","","/**"," * The default setter for DOM properties"," * Called with instance context (this === the Node instance)"," * @method DEFAULT_SETTER"," * @static"," * @param {String} name The attribute/property being set"," * @param {any} val The value to be set"," * @return {any} The value"," */","Y_Node.DEFAULT_SETTER = function(name, val) {"," var node = this._stateProxy,"," strPath;",""," if (name.indexOf(DOT) > -1) {"," strPath = name;"," name = name.split(DOT);"," // only allow when defined on node"," Y.Object.setValue(node, name, val);"," } else if (typeof node[name] != 'undefined') { // pass thru DOM properties"," node[name] = val;"," }",""," return val;","};","","/**"," * The default getter for DOM properties"," * Called with instance context (this === the Node instance)"," * @method DEFAULT_GETTER"," * @static"," * @param {String} name The attribute/property to look up"," * @return {any} The current value"," */","Y_Node.DEFAULT_GETTER = function(name) {"," var node = this._stateProxy,"," val;",""," if (name.indexOf && name.indexOf(DOT) > -1) {"," val = Y.Object.getValue(node, name.split(DOT));"," } else if (typeof node[name] != 'undefined') { // pass thru from DOM"," val = node[name];"," }",""," return val;","};","","Y.mix(Y_Node.prototype, {"," DATA_PREFIX: 'data-',",""," /**"," * The method called when outputting Node instances as strings"," * @method toString"," * @return {String} A string representation of the Node instance"," */"," toString: function() {"," var str = this[UID] + ': not bound to a node',"," node = this._node,"," attrs, id, className;",""," if (node) {"," attrs = node.attributes;"," id = (attrs && attrs.id) ? node.getAttribute('id') : null;"," className = (attrs && attrs.className) ? node.getAttribute('className') : null;"," str = node[NODE_NAME];",""," if (id) {"," str += '#' + id;"," }",""," if (className) {"," str += '.' + className.replace(' ', '.');"," }",""," // TODO: add yuid?"," str += ' ' + this[UID];"," }"," return str;"," },",""," /**"," * Returns an attribute value on the Node instance."," * Unless pre-configured (via `Node.ATTRS`), get hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be queried."," * @method get"," * @param {String} attr The attribute"," * @return {any} The current value of the attribute"," */"," get: function(attr) {"," var val;",""," if (this._getAttr) { // use Attribute imple"," val = this._getAttr(attr);"," } else {"," val = this._get(attr);"," }",""," if (val) {"," val = Y_Node.scrubVal(val, this);"," } else if (val === null) {"," val = null; // IE: DOM null is not true null (even though they ===)"," }"," return val;"," },",""," /**"," * Helper method for get."," * @method _get"," * @private"," * @param {String} attr The attribute"," * @return {any} The current value of the attribute"," */"," _get: function(attr) {"," var attrConfig = Y_Node.ATTRS[attr],"," val;",""," if (attrConfig && attrConfig.getter) {"," val = attrConfig.getter.call(this);"," } else if (Y_Node.re_aria.test(attr)) {"," val = this._node.getAttribute(attr, 2);"," } else {"," val = Y_Node.DEFAULT_GETTER.apply(this, arguments);"," }",""," return val;"," },",""," /**"," * Sets an attribute on the Node instance."," * Unless pre-configured (via Node.ATTRS), set hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be set."," * To set custom attributes use setAttribute."," * @method set"," * @param {String} attr The attribute to be set."," * @param {any} val The value to set the attribute to."," * @chainable"," */"," set: function(attr, val) {"," var attrConfig = Y_Node.ATTRS[attr];",""," if (this._setAttr) { // use Attribute imple"," this._setAttr.apply(this, arguments);"," } else { // use setters inline"," if (attrConfig && attrConfig.setter) {"," attrConfig.setter.call(this, val, attr);"," } else if (Y_Node.re_aria.test(attr)) { // special case Aria"," this._node.setAttribute(attr, val);"," } else {"," Y_Node.DEFAULT_SETTER.apply(this, arguments);"," }"," }",""," return this;"," },",""," /**"," * Sets multiple attributes."," * @method setAttrs"," * @param {Object} attrMap an object of name/value pairs to set"," * @chainable"," */"," setAttrs: function(attrMap) {"," if (this._setAttrs) { // use Attribute imple"," this._setAttrs(attrMap);"," } else { // use setters inline"," Y.Object.each(attrMap, function(v, n) {"," this.set(n, v);"," }, this);"," }",""," return this;"," },",""," /**"," * Returns an object containing the values for the requested attributes."," * @method getAttrs"," * @param {Array} attrs an array of attributes to get values"," * @return {Object} An object with attribute name/value pairs."," */"," getAttrs: function(attrs) {"," var ret = {};"," if (this._getAttrs) { // use Attribute imple"," this._getAttrs(attrs);"," } else { // use setters inline"," Y.Array.each(attrs, function(v, n) {"," ret[v] = this.get(v);"," }, this);"," }",""," return ret;"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this._node;",""," if (refNode && refNode._node) {"," refNode = refNode._node;"," }"," return node === refNode;"," },",""," /**"," * Determines whether the node is appended to the document."," * @method inDoc"," * @param {Node|HTMLElement} doc optional An optional document to check against."," * Defaults to current document."," * @return {Boolean} Whether or not this node is appended to the document."," */"," inDoc: function(doc) {"," var node = this._node;"," doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT];"," if (doc.documentElement) {"," return Y_DOM.contains(doc.documentElement, node);"," }"," },",""," getById: function(id) {"," var node = this._node,"," ret = Y_DOM.byId(id, node[OWNER_DOCUMENT]);"," if (ret && Y_DOM.contains(node, ret)) {"," ret = Y.one(ret);"," } else {"," ret = null;"," }"," return ret;"," },",""," /**"," * Returns the nearest ancestor that passes the test applied by supplied boolean method."," * @method ancestor"," * @param {String | Function} fn A selector string or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * If fn is not passed as an argument, the parent node will be returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan"," * @param {String | Function} stopFn optional A selector string or boolean"," * method to indicate when the search should stop. The search bails when the function"," * returns true or the selector matches."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} The matching Node instance or null if not found"," */"," ancestor: function(fn, testSelf, stopFn) {"," // testSelf is optional, check for stopFn as 2nd arg"," if (arguments.length === 2 &&"," (typeof testSelf == 'string' || typeof testSelf == 'function')) {"," stopFn = testSelf;"," }",""," return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn)));"," },",""," /**"," * Returns the ancestors that pass the test applied by supplied boolean method."," * @method ancestors"," * @param {String | Function} fn A selector string or boolean method for testing elements."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan"," * If a function is used, it receives the current node being tested as the only argument."," * @return {NodeList} A NodeList instance containing the matching elements"," */"," ancestors: function(fn, testSelf, stopFn) {"," if (arguments.length === 2 &&"," (typeof testSelf == 'string' || typeof testSelf == 'function')) {"," stopFn = testSelf;"," }"," return Y.all(Y_DOM.ancestors(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn)));"," },",""," /**"," * Returns the previous matching sibling."," * Returns the nearest element node sibling if no method provided."," * @method previous"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} Node instance or null if not found"," */"," previous: function(fn, all) {"," return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));"," },",""," /**"," * Returns the next matching sibling."," * Returns the nearest element node sibling if no method provided."," * @method next"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} Node instance or null if not found"," */"," next: function(fn, all) {"," return Y.one(Y_DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));"," },",""," /**"," * Returns all matching siblings."," * Returns all siblings if no method provided."," * @method siblings"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {NodeList} NodeList instance bound to found siblings"," */"," siblings: function(fn) {"," return Y.all(Y_DOM.siblings(this._node, _wrapFn(fn)));"," },",""," /**"," * Retrieves a Node instance of nodes based on the given CSS selector."," * @method one"," *"," * @param {string} selector The CSS selector to test against."," * @return {Node} A Node instance for the matching HTMLElement."," */"," one: function(selector) {"," return Y.one(Y.Selector.query(selector, this._node, true));"," },",""," /**"," * Retrieves a NodeList based on the given CSS selector."," * @method all"," *"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," */"," all: function(selector) {"," var nodelist = Y.all(Y.Selector.query(selector, this._node));"," nodelist._query = selector;"," nodelist._queryRoot = this._node;"," return nodelist;"," },",""," // TODO: allow fn test"," /**"," * Test if the supplied node matches the supplied selector."," * @method test"," *"," * @param {string} selector The CSS selector to test against."," * @return {boolean} Whether or not the node matches the selector."," */"," test: function(selector) {"," return Y.Selector.test(this._node, selector);"," },",""," /**"," * Removes the node from its parent."," * Shortcut for myNode.get('parentNode').removeChild(myNode);"," * @method remove"," * @param {Boolean} destroy whether or not to call destroy() on the node"," * after removal."," * @chainable"," *"," */"," remove: function(destroy) {"," var node = this._node;",""," if (node && node.parentNode) {"," node.parentNode.removeChild(node);"," }",""," if (destroy) {"," this.destroy();"," }",""," return this;"," },",""," /**"," * Replace the node with the other node. This is a DOM update only"," * and does not change the node bound to the Node instance."," * Shortcut for myNode.get('parentNode').replaceChild(newNode, myNode);"," * @method replace"," * @param {Node | HTMLNode} newNode Node to be inserted"," * @chainable"," *"," */"," replace: function(newNode) {"," var node = this._node;"," if (typeof newNode == 'string') {"," newNode = Y_Node.create(newNode);"," }"," node.parentNode.replaceChild(Y_Node.getDOMNode(newNode), node);"," return this;"," },",""," /**"," * @method replaceChild"," * @for Node"," * @param {String | HTMLElement | Node} node Node to be inserted"," * @param {HTMLElement | Node} refNode Node to be replaced"," * @return {Node} The replaced node"," */"," replaceChild: function(node, refNode) {"," if (typeof node == 'string') {"," node = Y_DOM.create(node);"," }",""," return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node), Y_Node.getDOMNode(refNode)));"," },",""," /**"," * Nulls internal node references, removes any plugins and event listeners"," * @method destroy"," * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the"," * node's subtree (default is false)"," *"," */"," destroy: function(recursive) {"," var UID = Y.config.doc.uniqueID ? 'uniqueID' : '_yuid',"," instance;",""," this.purge(); // TODO: only remove events add via this Node",""," if (this.unplug) { // may not be a PluginHost"," this.unplug();"," }",""," this.clearData();",""," if (recursive) {"," Y.NodeList.each(this.all('*'), function(node) {"," instance = Y_Node._instances[node[UID]];"," if (instance) {"," instance.destroy();"," } else { // purge in case added by other means"," Y.Event.purgeElement(node);"," }"," });"," }",""," this._node = null;"," this._stateProxy = null;",""," delete Y_Node._instances[this._yuid];"," },",""," /**"," * Invokes a method on the Node instance"," * @method invoke"," * @param {String} method The name of the method to invoke"," * @param {Any} a, b, c, etc. Arguments to invoke the method with."," * @return Whatever the underly method returns."," * DOM Nodes and Collections return values"," * are converted to Node/NodeList instances."," *"," */"," invoke: function(method, a, b, c, d, e) {"," var node = this._node,"," ret;",""," if (a && a._node) {"," a = a._node;"," }",""," if (b && b._node) {"," b = b._node;"," }",""," ret = node[method](a, b, c, d, e);"," return Y_Node.scrubVal(ret, this);"," },",""," /**"," * @method swap"," * @description Swap DOM locations with the given node."," * This does not change which DOM node each Node instance refers to."," * @param {Node} otherNode The node to swap with"," * @chainable"," */"," swap: Y.config.doc.documentElement.swapNode ?"," function(otherNode) {"," this._node.swapNode(Y_Node.getDOMNode(otherNode));"," } :"," function(otherNode) {"," otherNode = Y_Node.getDOMNode(otherNode);"," var node = this._node,"," parent = otherNode.parentNode,"," nextSibling = otherNode.nextSibling;",""," if (nextSibling === node) {"," parent.insertBefore(node, otherNode);"," } else if (otherNode === node.nextSibling) {"," parent.insertBefore(otherNode, node);"," } else {"," node.parentNode.replaceChild(otherNode, node);"," Y_DOM.addHTML(parent, node, nextSibling);"," }"," return this;"," },","",""," hasMethod: function(method) {"," var node = this._node;"," return !!(node && method in node &&"," typeof node[method] != 'unknown' &&"," (typeof node[method] == 'function' ||"," String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space"," },",""," isFragment: function() {"," return (this.get('nodeType') === 11);"," },",""," /**"," * Removes and destroys all of the nodes within the node."," * @method empty"," * @chainable"," */"," empty: function() {"," this.get('childNodes').remove().destroy(true);"," return this;"," },",""," /**"," * Returns the DOM node bound to the Node instance"," * @method getDOMNode"," * @return {DOMNode}"," */"," getDOMNode: function() {"," return this._node;"," }","}, true);","","Y.Node = Y_Node;","Y.one = Y_Node.one;","/**"," * The NodeList module provides support for managing collections of Nodes."," * @module node"," * @submodule node-core"," */","","/**"," * The NodeList class provides a wrapper for manipulating DOM NodeLists."," * NodeList properties can be accessed via the set/get methods."," * Use Y.all() to retrieve NodeList instances."," *"," * @class NodeList"," * @constructor"," * @param nodes {String|element|Node|Array} A selector, DOM element, Node, list of DOM elements, or list of Nodes with which to populate this NodeList."," */","","var NodeList = function(nodes) {"," var tmp = [];",""," if (nodes) {"," if (typeof nodes === 'string') { // selector query"," this._query = nodes;"," nodes = Y.Selector.query(nodes);"," } else if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window"," nodes = [nodes];"," } else if (nodes._node) { // Y.Node"," nodes = [nodes._node];"," } else if (nodes[0] && nodes[0]._node) { // allow array of Y.Nodes"," Y.Array.each(nodes, function(node) {"," if (node._node) {"," tmp.push(node._node);"," }"," });"," nodes = tmp;"," } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes)"," nodes = Y.Array(nodes, 0, true);"," }"," }",""," /**"," * The underlying array of DOM nodes bound to the Y.NodeList instance"," * @property _nodes"," * @private"," */"," this._nodes = nodes || [];","};","","NodeList.NAME = 'NodeList';","","/**"," * Retrieves the DOM nodes bound to a NodeList instance"," * @method getDOMNodes"," * @static"," *"," * @param {NodeList} nodelist The NodeList instance"," * @return {Array} The array of DOM nodes bound to the NodeList"," */","NodeList.getDOMNodes = function(nodelist) {"," return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist;","};","","NodeList.each = function(instance, fn, context) {"," var nodes = instance._nodes;"," if (nodes && nodes.length) {"," Y.Array.each(nodes, fn, context || instance);"," } else {"," }","};","","NodeList.addMethod = function(name, fn, context) {"," if (name && fn) {"," NodeList.prototype[name] = function() {"," var ret = [],"," args = arguments;",""," Y.Array.each(this._nodes, function(node) {"," var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid',"," instance = Y.Node._instances[node[UID]],"," ctx,"," result;",""," if (!instance) {"," instance = NodeList._getTempNode(node);"," }"," ctx = context || instance;"," result = fn.apply(ctx, args);"," if (result !== undefined && result !== instance) {"," ret[ret.length] = result;"," }"," });",""," // TODO: remove tmp pointer"," return ret.length ? ret : this;"," };"," } else {"," }","};","","NodeList.importMethod = function(host, name, altName) {"," if (typeof name === 'string') {"," altName = altName || name;"," NodeList.addMethod(name, host[name]);"," } else {"," Y.Array.each(name, function(n) {"," NodeList.importMethod(host, n);"," });"," }","};","","NodeList._getTempNode = function(node) {"," var tmp = NodeList._tempNode;"," if (!tmp) {"," tmp = Y.Node.create('<div></div>');"," NodeList._tempNode = tmp;"," }",""," tmp._node = node;"," tmp._stateProxy = node;"," return tmp;","};","","Y.mix(NodeList.prototype, {"," _invoke: function(method, args, getter) {"," var ret = (getter) ? [] : this;",""," this.each(function(node) {"," var val = node[method].apply(node, args);"," if (getter) {"," ret.push(val);"," }"," });",""," return ret;"," },",""," /**"," * Retrieves the Node instance at the given index."," * @method item"," *"," * @param {Number} index The index of the target Node."," * @return {Node} The Node instance at the given index."," */"," item: function(index) {"," return Y.one((this._nodes || [])[index]);"," },",""," /**"," * Applies the given function to each Node in the NodeList."," * @method each"," * @param {Function} fn The function to apply. It receives 3 arguments:"," * the current node instance, the node's index, and the NodeList instance"," * @param {Object} context optional An optional context to apply the function with"," * Default context is the current Node instance"," * @chainable"," */"," each: function(fn, context) {"," var instance = this;"," Y.Array.each(this._nodes, function(node, index) {"," node = Y.one(node);"," return fn.call(context || node, node, index, instance);"," });"," return instance;"," },",""," batch: function(fn, context) {"," var nodelist = this;",""," Y.Array.each(this._nodes, function(node, index) {"," var instance = Y.Node._instances[node[UID]];"," if (!instance) {"," instance = NodeList._getTempNode(node);"," }",""," return fn.call(context || instance, instance, index, nodelist);"," });"," return nodelist;"," },",""," /**"," * Executes the function once for each node until a true value is returned."," * @method some"," * @param {Function} fn The function to apply. It receives 3 arguments:"," * the current node instance, the node's index, and the NodeList instance"," * @param {Object} context optional An optional context to execute the function from."," * Default context is the current Node instance"," * @return {Boolean} Whether or not the function returned true for any node."," */"," some: function(fn, context) {"," var instance = this;"," return Y.Array.some(this._nodes, function(node, index) {"," node = Y.one(node);"," context = context || node;"," return fn.call(context, node, index, instance);"," });"," },",""," /**"," * Creates a documenFragment from the nodes bound to the NodeList instance"," * @method toFrag"," * @return {Node} a Node instance bound to the documentFragment"," */"," toFrag: function() {"," return Y.one(Y.DOM._nl2frag(this._nodes));"," },",""," /**"," * Returns the index of the node in the NodeList instance"," * or -1 if the node isn't found."," * @method indexOf"," * @param {Node | DOMNode} node the node to search for"," * @return {Int} the index of the node value or -1 if not found"," */"," indexOf: function(node) {"," return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node));"," },",""," /**"," * Filters the NodeList instance down to only nodes matching the given selector."," * @method filter"," * @param {String} selector The selector to filter against"," * @return {NodeList} NodeList containing the updated collection"," * @see Selector"," */"," filter: function(selector) {"," return Y.all(Y.Selector.filter(this._nodes, selector));"," },","",""," /**"," * Creates a new NodeList containing all nodes at every n indices, where"," * remainder n % index equals r."," * (zero-based index)."," * @method modulus"," * @param {Int} n The offset to use (return every nth node)"," * @param {Int} r An optional remainder to use with the modulus operation (defaults to zero)"," * @return {NodeList} NodeList containing the updated collection"," */"," modulus: function(n, r) {"," r = r || 0;"," var nodes = [];"," NodeList.each(this, function(node, i) {"," if (i % n === r) {"," nodes.push(node);"," }"," });",""," return Y.all(nodes);"," },",""," /**"," * Creates a new NodeList containing all nodes at odd indices"," * (zero-based index)."," * @method odd"," * @return {NodeList} NodeList containing the updated collection"," */"," odd: function() {"," return this.modulus(2, 1);"," },",""," /**"," * Creates a new NodeList containing all nodes at even indices"," * (zero-based index), including zero."," * @method even"," * @return {NodeList} NodeList containing the updated collection"," */"," even: function() {"," return this.modulus(2);"," },",""," destructor: function() {"," },",""," /**"," * Reruns the initial query, when created using a selector query"," * @method refresh"," * @chainable"," */"," refresh: function() {"," var doc,"," nodes = this._nodes,"," query = this._query,"," root = this._queryRoot;",""," if (query) {"," if (!root) {"," if (nodes && nodes[0] && nodes[0].ownerDocument) {"," root = nodes[0].ownerDocument;"," }"," }",""," this._nodes = Y.Selector.query(query, root);"," }",""," return this;"," },",""," /**"," * Returns the current number of items in the NodeList."," * @method size"," * @return {Int} The number of items in the NodeList."," */"," size: function() {"," return this._nodes.length;"," },",""," /**"," * Determines if the instance is bound to any nodes"," * @method isEmpty"," * @return {Boolean} Whether or not the NodeList is bound to any nodes"," */"," isEmpty: function() {"," return this._nodes.length < 1;"," },",""," toString: function() {"," var str = '',"," errorMsg = this[UID] + ': not bound to any nodes',"," nodes = this._nodes,"," node;",""," if (nodes && nodes[0]) {"," node = nodes[0];"," str += node[NODE_NAME];"," if (node.id) {"," str += '#' + node.id;"," }",""," if (node.className) {"," str += '.' + node.className.replace(' ', '.');"," }",""," if (nodes.length > 1) {"," str += '...[' + nodes.length + ' items]';"," }"," }"," return str || errorMsg;"," },",""," /**"," * Returns the DOM node bound to the Node instance"," * @method getDOMNodes"," * @return {Array}"," */"," getDOMNodes: function() {"," return this._nodes;"," }","}, true);","","NodeList.importMethod(Y.Node.prototype, ["," /** "," * Called on each Node instance. Nulls internal node references, "," * removes any plugins and event listeners"," * @method destroy"," * @param {Boolean} recursivePurge (optional) Whether or not to "," * remove listeners from the node's subtree (default is false)"," * @see Node.destroy"," */"," 'destroy',",""," /** "," * Called on each Node instance. Removes and destroys all of the nodes "," * within the node"," * @method empty"," * @chainable"," * @see Node.empty"," */"," 'empty',",""," /** "," * Called on each Node instance. Removes the node from its parent."," * Shortcut for myNode.get('parentNode').removeChild(myNode);"," * @method remove"," * @param {Boolean} destroy whether or not to call destroy() on the node"," * after removal."," * @chainable"," * @see Node.remove"," */"," 'remove',",""," /** "," * Called on each Node instance. Sets an attribute on the Node instance."," * Unless pre-configured (via Node.ATTRS), set hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be set."," * To set custom attributes use setAttribute."," * @method set"," * @param {String} attr The attribute to be set."," * @param {any} val The value to set the attribute to."," * @chainable"," * @see Node.set"," */"," 'set'","]);","","// one-off implementation to convert array of Nodes to NodeList","// e.g. Y.all('input').get('parentNode');","","/** Called on each Node instance"," * @method get"," * @see Node"," */","NodeList.prototype.get = function(attr) {"," var ret = [],"," nodes = this._nodes,"," isNodeList = false,"," getTemp = NodeList._getTempNode,"," instance,"," val;",""," if (nodes[0]) {"," instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]);"," val = instance._get(attr);"," if (val && val.nodeType) {"," isNodeList = true;"," }"," }",""," Y.Array.each(nodes, function(node) {"," instance = Y.Node._instances[node._yuid];",""," if (!instance) {"," instance = getTemp(node);"," }",""," val = instance._get(attr);"," if (!isNodeList) { // convert array of Nodes to NodeList"," val = Y.Node.scrubVal(val, instance);"," }",""," ret.push(val);"," });",""," return (isNodeList) ? Y.all(ret) : ret;","};","","Y.NodeList = NodeList;","","Y.all = function(nodes) {"," return new NodeList(nodes);","};","","Y.Node.all = Y.all;","/**"," * @module node"," * @submodule node-core"," */","","var Y_NodeList = Y.NodeList,"," ArrayProto = Array.prototype,"," ArrayMethods = {"," /** Returns a new NodeList combining the given NodeList(s)"," * @for NodeList"," * @method concat"," * @param {NodeList | Array} valueN Arrays/NodeLists and/or values to"," * concatenate to the resulting NodeList"," * @return {NodeList} A new NodeList comprised of this NodeList joined with the input."," */"," 'concat': 1,"," /** Removes the last from the NodeList and returns it."," * @for NodeList"," * @method pop"," * @return {Node} The last item in the NodeList."," */"," 'pop': 0,"," /** Adds the given Node(s) to the end of the NodeList."," * @for NodeList"," * @method push"," * @param {Node | DOMNode} nodes One or more nodes to add to the end of the NodeList."," */"," 'push': 0,"," /** Removes the first item from the NodeList and returns it."," * @for NodeList"," * @method shift"," * @return {Node} The first item in the NodeList."," */"," 'shift': 0,"," /** Returns a new NodeList comprising the Nodes in the given range."," * @for NodeList"," * @method slice"," * @param {Number} begin Zero-based index at which to begin extraction."," As a negative index, start indicates an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element in the sequence."," * @param {Number} end Zero-based index at which to end extraction. slice extracts up to but not including end."," slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3)."," As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence."," If end is omitted, slice extracts to the end of the sequence."," * @return {NodeList} A new NodeList comprised of this NodeList joined with the input."," */"," 'slice': 1,"," /** Changes the content of the NodeList, adding new elements while removing old elements."," * @for NodeList"," * @method splice"," * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end."," * @param {Number} howMany An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you should specify at least one new element. If no howMany parameter is specified (second syntax above, which is a SpiderMonkey extension), all elements after index are removed."," * {Node | DOMNode| element1, ..., elementN"," The elements to add to the array. If you don't specify any elements, splice simply removes elements from the array."," * @return {NodeList} The element(s) removed."," */"," 'splice': 1,"," /** Adds the given Node(s) to the beginning of the NodeList."," * @for NodeList"," * @method unshift"," * @param {Node | DOMNode} nodes One or more nodes to add to the NodeList."," */"," 'unshift': 0"," };","","","Y.Object.each(ArrayMethods, function(returnNodeList, name) {"," Y_NodeList.prototype[name] = function() {"," var args = [],"," i = 0,"," arg,"," ret;",""," while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists"," args.push(arg._node || arg._nodes || arg);"," }",""," ret = ArrayProto[name].apply(this._nodes, args);",""," if (returnNodeList) {"," ret = Y.all(ret);"," } else {"," ret = Y.Node.scrubVal(ret);"," }",""," return ret;"," };","});","/**"," * @module node"," * @submodule node-core"," */","","Y.Array.each(["," /**"," * Passes through to DOM method."," * @for Node"," * @method removeChild"," * @param {HTMLElement | Node} node Node to be removed"," * @return {Node} The removed node"," */"," 'removeChild',",""," /**"," * Passes through to DOM method."," * @method hasChildNodes"," * @return {Boolean} Whether or not the node has any childNodes"," */"," 'hasChildNodes',",""," /**"," * Passes through to DOM method."," * @method cloneNode"," * @param {Boolean} deep Whether or not to perform a deep clone, which includes"," * subtree and attributes"," * @return {Node} The clone"," */"," 'cloneNode',",""," /**"," * Passes through to DOM method."," * @method hasAttribute"," * @param {String} attribute The attribute to test for"," * @return {Boolean} Whether or not the attribute is present"," */"," 'hasAttribute',",""," /**"," * Passes through to DOM method."," * @method scrollIntoView"," * @chainable"," */"," 'scrollIntoView',",""," /**"," * Passes through to DOM method."," * @method getElementsByTagName"," * @param {String} tagName The tagName to collect"," * @return {NodeList} A NodeList representing the HTMLCollection"," */"," 'getElementsByTagName',",""," /**"," * Passes through to DOM method."," * @method focus"," * @chainable"," */"," 'focus',",""," /**"," * Passes through to DOM method."," * @method blur"," * @chainable"," */"," 'blur',",""," /**"," * Passes through to DOM method."," * Only valid on FORM elements"," * @method submit"," * @chainable"," */"," 'submit',",""," /**"," * Passes through to DOM method."," * Only valid on FORM elements"," * @method reset"," * @chainable"," */"," 'reset',",""," /**"," * Passes through to DOM method."," * @method select"," * @chainable"," */"," 'select',",""," /**"," * Passes through to DOM method."," * Only valid on TABLE elements"," * @method createCaption"," * @chainable"," */"," 'createCaption'","","], function(method) {"," Y.Node.prototype[method] = function(arg1, arg2, arg3) {"," var ret = this.invoke(method, arg1, arg2, arg3);"," return ret;"," };","});","","/**"," * Passes through to DOM method."," * @method removeAttribute"," * @param {String} attribute The attribute to be removed"," * @chainable"," */"," // one-off implementation due to IE returning boolean, breaking chaining","Y.Node.prototype.removeAttribute = function(attr) {"," var node = this._node;"," if (node) {"," node.removeAttribute(attr, 0); // comma zero for IE < 8 to force case-insensitive"," }",""," return this;","};","","Y.Node.importMethod(Y.DOM, ["," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy."," * @method contains"," * @param {Node | HTMLElement} needle The possible node or descendent"," * @return {Boolean} Whether or not this node is the needle its ancestor"," */"," 'contains',"," /**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @for Node"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',"," /**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @for Node"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */"," 'getAttribute',",""," /**"," * Wraps the given HTML around the node."," * @method wrap"," * @param {String} html The markup to wrap around the node."," * @chainable"," * @for Node"," */"," 'wrap',",""," /**"," * Removes the node's parent node."," * @method unwrap"," * @chainable"," */"," 'unwrap',",""," /**"," * Applies a unique ID to the node if none exists"," * @method generateID"," * @return {String} The existing or generated ID"," */"," 'generateID'","]);","","Y.NodeList.importMethod(Y.Node.prototype, [","/**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @see Node"," * @for NodeList"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */",""," 'getAttribute',","/**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @see Node"," * @for NodeList"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',","","/**"," * Allows for removing attributes on DOM nodes."," * This passes through to the DOM node, allowing for custom attributes."," * @method removeAttribute"," * @see Node"," * @for NodeList"," * @param {string} name The attribute to remove"," */"," 'removeAttribute',","/**"," * Removes the parent node from node in the list."," * @method unwrap"," * @chainable"," */"," 'unwrap',","/**"," * Wraps the given HTML around each node."," * @method wrap"," * @param {String} html The markup to wrap around the node."," * @chainable"," */"," 'wrap',","","/**"," * Applies a unique ID to each node if none exists"," * @method generateID"," * @return {String} The existing or generated ID"," */"," 'generateID'","]);","","","}, '3.7.2', {\"requires\": [\"dom-core\", \"selector\"]});"];-_yuitest_coverage["build/node-core/node-core.js"].lines = {"1":0,"25":0,"38":0,"39":0,"42":0,"43":0,"44":0,"45":0,"49":0,"51":0,"52":0,"55":0,"56":0,"57":0,"60":0,"68":0,"70":0,"72":0,"73":0,"79":0,"80":0,"81":0,"83":0,"86":0,"90":0,"94":0,"95":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"104":0,"108":0,"117":0,"122":0,"124":0,"125":0,"135":0,"146":0,"147":0,"148":0,"150":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"171":0,"174":0,"175":0,"176":0,"177":0,"180":0,"194":0,"195":0,"196":0,"197":0,"201":0,"202":0,"205":0,"206":0,"208":0,"210":0,"212":0,"213":0,"216":0,"217":0,"233":0,"234":0,"235":0,"236":0,"238":0,"239":0,"275":0,"276":0,"280":0,"281":0,"282":0,"283":0,"284":0,"286":0,"287":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0,"296":0,"297":0,"303":0,"315":0,"316":0,"319":0,"320":0,"321":0,"323":0,"324":0,"325":0,"328":0,"339":0,"340":0,"343":0,"344":0,"345":0,"346":0,"349":0,"352":0,"361":0,"365":0,"366":0,"367":0,"368":0,"369":0,"371":0,"372":0,"375":0,"376":0,"380":0,"382":0,"395":0,"397":0,"398":0,"400":0,"403":0,"404":0,"405":0,"406":0,"408":0,"419":0,"422":0,"423":0,"424":0,"425":0,"427":0,"430":0,"445":0,"447":0,"448":0,"450":0,"451":0,"452":0,"453":0,"455":0,"459":0,"469":0,"470":0,"472":0,"473":0,"477":0,"487":0,"488":0,"489":0,"491":0,"492":0,"496":0,"507":0,"509":0,"510":0,"512":0,"523":0,"524":0,"525":0,"526":0,"531":0,"533":0,"534":0,"536":0,"538":0,"556":0,"558":0,"561":0,"573":0,"575":0,"577":0,"589":0,"601":0,"613":0,"624":0,"635":0,"636":0,"637":0,"638":0,"650":0,"663":0,"665":0,"666":0,"669":0,"670":0,"673":0,"686":0,"687":0,"688":0,"690":0,"691":0,"702":0,"703":0,"706":0,"717":0,"720":0,"722":0,"723":0,"726":0,"728":0,"729":0,"730":0,"731":0,"732":0,"734":0,"739":0,"740":0,"742":0,"756":0,"759":0,"760":0,"763":0,"764":0,"767":0,"768":0,"780":0,"783":0,"784":0,"788":0,"789":0,"790":0,"791":0,"793":0,"794":0,"796":0,"801":0,"802":0,"809":0,"818":0,"819":0,"828":0,"832":0,"833":0,"850":0,"851":0,"853":0,"854":0,"855":0,"856":0,"857":0,"858":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"878":0,"881":0,"891":0,"892":0,"895":0,"896":0,"897":0,"898":0,"903":0,"904":0,"905":0,"906":0,"909":0,"910":0,"915":0,"916":0,"918":0,"919":0,"920":0,"921":0,"926":0,"932":0,"933":0,"934":0,"935":0,"937":0,"938":0,"943":0,"944":0,"945":0,"946":0,"947":0,"950":0,"951":0,"952":0,"955":0,"957":0,"959":0,"960":0,"961":0,"962":0,"966":0,"977":0,"990":0,"991":0,"992":0,"993":0,"995":0,"999":0,"1001":0,"1002":0,"1003":0,"1004":0,"1007":0,"1009":0,"1022":0,"1023":0,"1024":0,"1025":0,"1026":0,"1036":0,"1047":0,"1058":0,"1072":0,"1073":0,"1074":0,"1075":0,"1076":0,"1080":0,"1090":0,"1100":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1124":0,"1127":0,"1136":0,"1145":0,"1149":0,"1154":0,"1155":0,"1156":0,"1157":0,"1158":0,"1161":0,"1162":0,"1165":0,"1166":0,"1169":0,"1178":0,"1182":0,"1235":0,"1236":0,"1243":0,"1244":0,"1245":0,"1246":0,"1247":0,"1251":0,"1252":0,"1254":0,"1255":0,"1258":0,"1259":0,"1260":0,"1263":0,"1266":0,"1269":0,"1271":0,"1272":0,"1275":0,"1281":0,"1341":0,"1342":0,"1343":0,"1348":0,"1349":0,"1352":0,"1354":0,"1355":0,"1357":0,"1360":0,"1368":0,"1463":0,"1464":0,"1465":0,"1476":0,"1477":0,"1478":0,"1479":0,"1482":0,"1485":0,"1537":0};-_yuitest_coverage["build/node-core/node-core.js"].functions = {"Y_Node:37":0,"(anonymous 2):82":0,"}:85":0,"_wrapFn:78":0,"_fromString:97":0,"getDOMNode:146":0,"scrubVal:164":0,"]:196":0,"addMethod:194":0,"(anonymous 3):238":0,"importMethod:233":0,"one:275":0,"DEFAULT_SETTER:315":0,"DEFAULT_GETTER:339":0,"toString:360":0,"get:394":0,"_get:418":0,"set:444":0,"(anonymous 4):472":0,"setAttrs:468":0,"(anonymous 5):491":0,"getAttrs:486":0,"compareTo:506":0,"inDoc:522":0,"getById:530":0,"ancestor:554":0,"ancestors:572":0,"previous:588":0,"next:600":0,"siblings:612":0,"one:623":0,"all:634":0,"test:649":0,"remove:662":0,"replace:685":0,"replaceChild:701":0,"(anonymous 6):729":0,"destroy:716":0,"invoke:755":0,"(anonymous 7):779":0,"}:782":0,"hasMethod:800":0,"isFragment:808":0,"empty:817":0,"getDOMNode:827":0,"(anonymous 8):862":0,"NodeList:850":0,"getDOMNodes:891":0,"each:895":0,"(anonymous 9):909":0,"]:905":0,"addMethod:903":0,"(anonymous 10):937":0,"importMethod:932":0,"_getTempNode:943":0,"(anonymous 11):959":0,"_invoke:956":0,"item:976":0,"(anonymous 12):991":0,"each:989":0,"(anonymous 13):1001":0,"batch:998":0,"(anonymous 14):1023":0,"some:1021":0,"toFrag:1035":0,"indexOf:1046":0,"filter:1057":0,"(anonymous 15):1074":0,"modulus:1071":0,"odd:1089":0,"even:1099":0,"refresh:1111":0,"size:1135":0,"isEmpty:1144":0,"toString:1148":0,"getDOMNodes:1177":0,"(anonymous 16):1251":0,"get:1235":0,"all:1271":0,"]:1342":0,"(anonymous 17):1341":0,"]:1463":0,"(anonymous 18):1462":0,"removeAttribute:1476":0,"(anonymous 1):1":0};+_yuitest_coverage["build/node-core/node-core.js"].code=["YUI.add('node-core', function (Y, NAME) {","","/**"," * The Node Utility provides a DOM-like interface for interacting with DOM nodes."," * @module node"," * @main node"," * @submodule node-core"," */","","/**"," * The Node class provides a wrapper for manipulating DOM Nodes."," * Node properties can be accessed via the set/get methods."," * Use `Y.one()` to retrieve Node instances."," *"," * <strong>NOTE:</strong> Node properties are accessed using"," * the <code>set</code> and <code>get</code> methods."," *"," * @class Node"," * @constructor"," * @param {DOMNode} node the DOM node to be mapped to the Node instance."," * @uses EventTarget"," */","","// \"globals\"","var DOT = '.',"," NODE_NAME = 'nodeName',"," NODE_TYPE = 'nodeType',"," OWNER_DOCUMENT = 'ownerDocument',"," TAG_NAME = 'tagName',"," UID = '_yuid',"," EMPTY_OBJ = {},",""," _slice = Array.prototype.slice,",""," Y_DOM = Y.DOM,",""," Y_Node = function(node) {"," if (!this.getDOMNode) { // support optional \"new\""," return new Y_Node(node);"," }",""," if (typeof node == 'string') {"," node = Y_Node._fromString(node);"," if (!node) {"," return null; // NOTE: return"," }"," }",""," var uid = (node.nodeType !== 9) ? node.uniqueID : node[UID];",""," if (uid && Y_Node._instances[uid] && Y_Node._instances[uid]._node !== node) {"," node[UID] = null; // unset existing uid to prevent collision (via clone or hack)"," }",""," uid = uid || Y.stamp(node);"," if (!uid) { // stamp failed; likely IE non-HTMLElement"," uid = Y.guid();"," }",""," this[UID] = uid;",""," /**"," * The underlying DOM node bound to the Y.Node instance"," * @property _node"," * @type DOMNode"," * @private"," */"," this._node = node;",""," this._stateProxy = node; // when augmented with Attribute",""," if (this._initPlugins) { // when augmented with Plugin.Host"," this._initPlugins();"," }"," },",""," // used with previous/next/ancestor tests"," _wrapFn = function(fn) {"," var ret = null;"," if (fn) {"," ret = (typeof fn == 'string') ?"," function(n) {"," return Y.Selector.test(n, fn);"," } :"," function(n) {"," return fn(Y.one(n));"," };"," }",""," return ret;"," };","// end \"globals\"","","Y_Node.ATTRS = {};","Y_Node.DOM_EVENTS = {};","","Y_Node._fromString = function(node) {"," if (node) {"," if (node.indexOf('doc') === 0) { // doc OR document"," node = Y.config.doc;"," } else if (node.indexOf('win') === 0) { // win OR window"," node = Y.config.win;"," } else {"," node = Y.Selector.query(node, null, true);"," }"," }",""," return node || null;","};","","/**"," * The name of the component"," * @static"," * @type String"," * @property NAME"," */","Y_Node.NAME = 'node';","","/*"," * The pattern used to identify ARIA attributes"," */","Y_Node.re_aria = /^(?:role$|aria-)/;","","Y_Node.SHOW_TRANSITION = 'fadeIn';","Y_Node.HIDE_TRANSITION = 'fadeOut';","","/**"," * A list of Node instances that have been created"," * @private"," * @type Object"," * @property _instances"," * @static"," *"," */","Y_Node._instances = {};","","/**"," * Retrieves the DOM node bound to a Node instance"," * @method getDOMNode"," * @static"," *"," * @param {Node | HTMLNode} node The Node instance or an HTMLNode"," * @return {HTMLNode} The DOM node bound to the Node instance. If a DOM node is passed"," * as the node argument, it is simply returned."," */","Y_Node.getDOMNode = function(node) {"," if (node) {"," return (node.nodeType) ? node : node._node || null;"," }"," return null;","};","","/**"," * Checks Node return values and wraps DOM Nodes as Y.Node instances"," * and DOM Collections / Arrays as Y.NodeList instances."," * Other return values just pass thru. If undefined is returned (e.g. no return)"," * then the Node instance is returned for chainability."," * @method scrubVal"," * @static"," *"," * @param {any} node The Node instance or an HTMLNode"," * @return {Node | NodeList | Any} Depends on what is returned from the DOM node."," */","Y_Node.scrubVal = function(val, node) {"," if (val) { // only truthy values are risky"," if (typeof val == 'object' || typeof val == 'function') { // safari nodeList === function"," if (NODE_TYPE in val || Y_DOM.isWindow(val)) {// node || window"," val = Y.one(val);"," } else if ((val.item && !val._nodes) || // dom collection or Node instance"," (val[0] && val[0][NODE_TYPE])) { // array of DOM Nodes"," val = Y.all(val);"," }"," }"," } else if (typeof val === 'undefined') {"," val = node; // for chaining"," } else if (val === null) {"," val = null; // IE: DOM null not the same as null"," }",""," return val;","};","","/**"," * Adds methods to the Y.Node prototype, routing through scrubVal."," * @method addMethod"," * @static"," *"," * @param {String} name The name of the method to add"," * @param {Function} fn The function that becomes the method"," * @param {Object} context An optional context to call the method with"," * (defaults to the Node instance)"," * @return {any} Depends on what is returned from the DOM node."," */","Y_Node.addMethod = function(name, fn, context) {"," if (name && fn && typeof fn == 'function') {"," Y_Node.prototype[name] = function() {"," var args = _slice.call(arguments),"," node = this,"," ret;",""," if (args[0] && args[0]._node) {"," args[0] = args[0]._node;"," }",""," if (args[1] && args[1]._node) {"," args[1] = args[1]._node;"," }"," args.unshift(node._node);",""," ret = fn.apply(node, args);",""," if (ret) { // scrub truthy"," ret = Y_Node.scrubVal(ret, node);"," }",""," (typeof ret != 'undefined') || (ret = node);"," return ret;"," };"," } else {"," }","};","","/**"," * Imports utility methods to be added as Y.Node methods."," * @method importMethod"," * @static"," *"," * @param {Object} host The object that contains the method to import."," * @param {String} name The name of the method to import"," * @param {String} altName An optional name to use in place of the host name"," * @param {Object} context An optional context to call the method with"," */","Y_Node.importMethod = function(host, name, altName) {"," if (typeof name == 'string') {"," altName = altName || name;"," Y_Node.addMethod(altName, host[name], host);"," } else {"," Y.Array.each(name, function(n) {"," Y_Node.importMethod(host, n);"," });"," }","};","","/**"," * Retrieves a NodeList based on the given CSS selector."," * @method all"," *"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," * @for YUI"," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector. Returns null if no match found."," * <strong>Note:</strong> For chaining purposes you may want to"," * use <code>Y.all</code>, which returns a NodeList when no match is found."," * @method one"," * @param {String | HTMLElement} node a node or Selector"," * @return {Node | null} a Node instance or null if no match found."," * @for YUI"," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector. Returns null if no match found."," * <strong>Note:</strong> For chaining purposes you may want to"," * use <code>Y.all</code>, which returns a NodeList when no match is found."," * @method one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @return {Node | null} a Node instance or null if no match found."," * @for Node"," */","Y_Node.one = function(node) {"," var instance = null,"," cachedNode,"," uid;",""," if (node) {"," if (typeof node == 'string') {"," node = Y_Node._fromString(node);"," if (!node) {"," return null; // NOTE: return"," }"," } else if (node.getDOMNode) {"," return node; // NOTE: return"," }",""," if (node.nodeType || Y.DOM.isWindow(node)) { // avoid bad input (numbers, boolean, etc)"," uid = (node.uniqueID && node.nodeType !== 9) ? node.uniqueID : node._yuid;"," instance = Y_Node._instances[uid]; // reuse exising instances"," cachedNode = instance ? instance._node : null;"," if (!instance || (cachedNode && node !== cachedNode)) { // new Node when nodes don't match"," instance = new Y_Node(node);"," if (node.nodeType != 11) { // dont cache document fragment"," Y_Node._instances[instance[UID]] = instance; // cache node"," }"," }"," }"," }",""," return instance;","};","","/**"," * The default setter for DOM properties"," * Called with instance context (this === the Node instance)"," * @method DEFAULT_SETTER"," * @static"," * @param {String} name The attribute/property being set"," * @param {any} val The value to be set"," * @return {any} The value"," */","Y_Node.DEFAULT_SETTER = function(name, val) {"," var node = this._stateProxy,"," strPath;",""," if (name.indexOf(DOT) > -1) {"," strPath = name;"," name = name.split(DOT);"," // only allow when defined on node"," Y.Object.setValue(node, name, val);"," } else if (typeof node[name] != 'undefined') { // pass thru DOM properties"," node[name] = val;"," }",""," return val;","};","","/**"," * The default getter for DOM properties"," * Called with instance context (this === the Node instance)"," * @method DEFAULT_GETTER"," * @static"," * @param {String} name The attribute/property to look up"," * @return {any} The current value"," */","Y_Node.DEFAULT_GETTER = function(name) {"," var node = this._stateProxy,"," val;",""," if (name.indexOf && name.indexOf(DOT) > -1) {"," val = Y.Object.getValue(node, name.split(DOT));"," } else if (typeof node[name] != 'undefined') { // pass thru from DOM"," val = node[name];"," }",""," return val;","};","","Y.mix(Y_Node.prototype, {"," DATA_PREFIX: 'data-',",""," /**"," * The method called when outputting Node instances as strings"," * @method toString"," * @return {String} A string representation of the Node instance"," */"," toString: function() {"," var str = this[UID] + ': not bound to a node',"," node = this._node,"," attrs, id, className;",""," if (node) {"," attrs = node.attributes;"," id = (attrs && attrs.id) ? node.getAttribute('id') : null;"," className = (attrs && attrs.className) ? node.getAttribute('className') : null;"," str = node[NODE_NAME];",""," if (id) {"," str += '#' + id;"," }",""," if (className) {"," str += '.' + className.replace(' ', '.');"," }",""," // TODO: add yuid?"," str += ' ' + this[UID];"," }"," return str;"," },",""," /**"," * Returns an attribute value on the Node instance."," * Unless pre-configured (via `Node.ATTRS`), get hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be queried."," * @method get"," * @param {String} attr The attribute"," * @return {any} The current value of the attribute"," */"," get: function(attr) {"," var val;",""," if (this._getAttr) { // use Attribute imple"," val = this._getAttr(attr);"," } else {"," val = this._get(attr);"," }",""," if (val) {"," val = Y_Node.scrubVal(val, this);"," } else if (val === null) {"," val = null; // IE: DOM null is not true null (even though they ===)"," }"," return val;"," },",""," /**"," * Helper method for get."," * @method _get"," * @private"," * @param {String} attr The attribute"," * @return {any} The current value of the attribute"," */"," _get: function(attr) {"," var attrConfig = Y_Node.ATTRS[attr],"," val;",""," if (attrConfig && attrConfig.getter) {"," val = attrConfig.getter.call(this);"," } else if (Y_Node.re_aria.test(attr)) {"," val = this._node.getAttribute(attr, 2);"," } else {"," val = Y_Node.DEFAULT_GETTER.apply(this, arguments);"," }",""," return val;"," },",""," /**"," * Sets an attribute on the Node instance."," * Unless pre-configured (via Node.ATTRS), set hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be set."," * To set custom attributes use setAttribute."," * @method set"," * @param {String} attr The attribute to be set."," * @param {any} val The value to set the attribute to."," * @chainable"," */"," set: function(attr, val) {"," var attrConfig = Y_Node.ATTRS[attr];",""," if (this._setAttr) { // use Attribute imple"," this._setAttr.apply(this, arguments);"," } else { // use setters inline"," if (attrConfig && attrConfig.setter) {"," attrConfig.setter.call(this, val, attr);"," } else if (Y_Node.re_aria.test(attr)) { // special case Aria"," this._node.setAttribute(attr, val);"," } else {"," Y_Node.DEFAULT_SETTER.apply(this, arguments);"," }"," }",""," return this;"," },",""," /**"," * Sets multiple attributes."," * @method setAttrs"," * @param {Object} attrMap an object of name/value pairs to set"," * @chainable"," */"," setAttrs: function(attrMap) {"," if (this._setAttrs) { // use Attribute imple"," this._setAttrs(attrMap);"," } else { // use setters inline"," Y.Object.each(attrMap, function(v, n) {"," this.set(n, v);"," }, this);"," }",""," return this;"," },",""," /**"," * Returns an object containing the values for the requested attributes."," * @method getAttrs"," * @param {Array} attrs an array of attributes to get values"," * @return {Object} An object with attribute name/value pairs."," */"," getAttrs: function(attrs) {"," var ret = {};"," if (this._getAttrs) { // use Attribute imple"," this._getAttrs(attrs);"," } else { // use setters inline"," Y.Array.each(attrs, function(v, n) {"," ret[v] = this.get(v);"," }, this);"," }",""," return ret;"," },",""," /**"," * Compares nodes to determine if they match."," * Node instances can be compared to each other and/or HTMLElements."," * @method compareTo"," * @param {HTMLElement | Node} refNode The reference node to compare to the node."," * @return {Boolean} True if the nodes match, false if they do not."," */"," compareTo: function(refNode) {"," var node = this._node;",""," if (refNode && refNode._node) {"," refNode = refNode._node;"," }"," return node === refNode;"," },",""," /**"," * Determines whether the node is appended to the document."," * @method inDoc"," * @param {Node|HTMLElement} doc optional An optional document to check against."," * Defaults to current document."," * @return {Boolean} Whether or not this node is appended to the document."," */"," inDoc: function(doc) {"," var node = this._node;"," doc = (doc) ? doc._node || doc : node[OWNER_DOCUMENT];"," if (doc.documentElement) {"," return Y_DOM.contains(doc.documentElement, node);"," }"," },",""," getById: function(id) {"," var node = this._node,"," ret = Y_DOM.byId(id, node[OWNER_DOCUMENT]);"," if (ret && Y_DOM.contains(node, ret)) {"," ret = Y.one(ret);"," } else {"," ret = null;"," }"," return ret;"," },",""," /**"," * Returns the nearest ancestor that passes the test applied by supplied boolean method."," * @method ancestor"," * @param {String | Function} fn A selector string or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * If fn is not passed as an argument, the parent node will be returned."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan"," * @param {String | Function} stopFn optional A selector string or boolean"," * method to indicate when the search should stop. The search bails when the function"," * returns true or the selector matches."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} The matching Node instance or null if not found"," */"," ancestor: function(fn, testSelf, stopFn) {"," // testSelf is optional, check for stopFn as 2nd arg"," if (arguments.length === 2 &&"," (typeof testSelf == 'string' || typeof testSelf == 'function')) {"," stopFn = testSelf;"," }",""," return Y.one(Y_DOM.ancestor(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn)));"," },",""," /**"," * Returns the ancestors that pass the test applied by supplied boolean method."," * @method ancestors"," * @param {String | Function} fn A selector string or boolean method for testing elements."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan"," * If a function is used, it receives the current node being tested as the only argument."," * @return {NodeList} A NodeList instance containing the matching elements"," */"," ancestors: function(fn, testSelf, stopFn) {"," if (arguments.length === 2 &&"," (typeof testSelf == 'string' || typeof testSelf == 'function')) {"," stopFn = testSelf;"," }"," return Y.all(Y_DOM.ancestors(this._node, _wrapFn(fn), testSelf, _wrapFn(stopFn)));"," },",""," /**"," * Returns the previous matching sibling."," * Returns the nearest element node sibling if no method provided."," * @method previous"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} Node instance or null if not found"," */"," previous: function(fn, all) {"," return Y.one(Y_DOM.elementByAxis(this._node, 'previousSibling', _wrapFn(fn), all));"," },",""," /**"," * Returns the next matching sibling."," * Returns the nearest element node sibling if no method provided."," * @method next"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {Node} Node instance or null if not found"," */"," next: function(fn, all) {"," return Y.one(Y_DOM.elementByAxis(this._node, 'nextSibling', _wrapFn(fn), all));"," },",""," /**"," * Returns all matching siblings."," * Returns all siblings if no method provided."," * @method siblings"," * @param {String | Function} fn A selector or boolean method for testing elements."," * If a function is used, it receives the current node being tested as the only argument."," * @return {NodeList} NodeList instance bound to found siblings"," */"," siblings: function(fn) {"," return Y.all(Y_DOM.siblings(this._node, _wrapFn(fn)));"," },",""," /**"," * Retrieves a Node instance of nodes based on the given CSS selector."," * @method one"," *"," * @param {string} selector The CSS selector to test against."," * @return {Node} A Node instance for the matching HTMLElement."," */"," one: function(selector) {"," return Y.one(Y.Selector.query(selector, this._node, true));"," },",""," /**"," * Retrieves a NodeList based on the given CSS selector."," * @method all"," *"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," */"," all: function(selector) {"," var nodelist = Y.all(Y.Selector.query(selector, this._node));"," nodelist._query = selector;"," nodelist._queryRoot = this._node;"," return nodelist;"," },",""," // TODO: allow fn test"," /**"," * Test if the supplied node matches the supplied selector."," * @method test"," *"," * @param {string} selector The CSS selector to test against."," * @return {boolean} Whether or not the node matches the selector."," */"," test: function(selector) {"," return Y.Selector.test(this._node, selector);"," },",""," /**"," * Removes the node from its parent."," * Shortcut for myNode.get('parentNode').removeChild(myNode);"," * @method remove"," * @param {Boolean} destroy whether or not to call destroy() on the node"," * after removal."," * @chainable"," *"," */"," remove: function(destroy) {"," var node = this._node;",""," if (node && node.parentNode) {"," node.parentNode.removeChild(node);"," }",""," if (destroy) {"," this.destroy();"," }",""," return this;"," },",""," /**"," * Replace the node with the other node. This is a DOM update only"," * and does not change the node bound to the Node instance."," * Shortcut for myNode.get('parentNode').replaceChild(newNode, myNode);"," * @method replace"," * @param {Node | HTMLNode} newNode Node to be inserted"," * @chainable"," *"," */"," replace: function(newNode) {"," var node = this._node;"," if (typeof newNode == 'string') {"," newNode = Y_Node.create(newNode);"," }"," node.parentNode.replaceChild(Y_Node.getDOMNode(newNode), node);"," return this;"," },",""," /**"," * @method replaceChild"," * @for Node"," * @param {String | HTMLElement | Node} node Node to be inserted"," * @param {HTMLElement | Node} refNode Node to be replaced"," * @return {Node} The replaced node"," */"," replaceChild: function(node, refNode) {"," if (typeof node == 'string') {"," node = Y_DOM.create(node);"," }",""," return Y.one(this._node.replaceChild(Y_Node.getDOMNode(node), Y_Node.getDOMNode(refNode)));"," },",""," /**"," * Nulls internal node references, removes any plugins and event listeners."," * Note that destroy() will not remove the node from its parent or from the DOM. For that"," * functionality, call remove(true)."," * @method destroy"," * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the"," * node's subtree (default is false)"," *"," */"," destroy: function(recursive) {"," var UID = Y.config.doc.uniqueID ? 'uniqueID' : '_yuid',"," instance;",""," this.purge(); // TODO: only remove events add via this Node",""," if (this.unplug) { // may not be a PluginHost"," this.unplug();"," }",""," this.clearData();",""," if (recursive) {"," Y.NodeList.each(this.all('*'), function(node) {"," instance = Y_Node._instances[node[UID]];"," if (instance) {"," instance.destroy();"," } else { // purge in case added by other means"," Y.Event.purgeElement(node);"," }"," });"," }",""," this._node = null;"," this._stateProxy = null;",""," delete Y_Node._instances[this._yuid];"," },",""," /**"," * Invokes a method on the Node instance"," * @method invoke"," * @param {String} method The name of the method to invoke"," * @param {Any} a, b, c, etc. Arguments to invoke the method with."," * @return Whatever the underly method returns."," * DOM Nodes and Collections return values"," * are converted to Node/NodeList instances."," *"," */"," invoke: function(method, a, b, c, d, e) {"," var node = this._node,"," ret;",""," if (a && a._node) {"," a = a._node;"," }",""," if (b && b._node) {"," b = b._node;"," }",""," ret = node[method](a, b, c, d, e);"," return Y_Node.scrubVal(ret, this);"," },",""," /**"," * @method swap"," * @description Swap DOM locations with the given node."," * This does not change which DOM node each Node instance refers to."," * @param {Node} otherNode The node to swap with"," * @chainable"," */"," swap: Y.config.doc.documentElement.swapNode ?"," function(otherNode) {"," this._node.swapNode(Y_Node.getDOMNode(otherNode));"," } :"," function(otherNode) {"," otherNode = Y_Node.getDOMNode(otherNode);"," var node = this._node,"," parent = otherNode.parentNode,"," nextSibling = otherNode.nextSibling;",""," if (nextSibling === node) {"," parent.insertBefore(node, otherNode);"," } else if (otherNode === node.nextSibling) {"," parent.insertBefore(otherNode, node);"," } else {"," node.parentNode.replaceChild(otherNode, node);"," Y_DOM.addHTML(parent, node, nextSibling);"," }"," return this;"," },","",""," hasMethod: function(method) {"," var node = this._node;"," return !!(node && method in node &&"," typeof node[method] != 'unknown' &&"," (typeof node[method] == 'function' ||"," String(node[method]).indexOf('function') === 1)); // IE reports as object, prepends space"," },",""," isFragment: function() {"," return (this.get('nodeType') === 11);"," },",""," /**"," * Removes and destroys all of the nodes within the node."," * @method empty"," * @chainable"," */"," empty: function() {"," this.get('childNodes').remove().destroy(true);"," return this;"," },",""," /**"," * Returns the DOM node bound to the Node instance"," * @method getDOMNode"," * @return {DOMNode}"," */"," getDOMNode: function() {"," return this._node;"," }","}, true);","","Y.Node = Y_Node;","Y.one = Y_Node.one;","/**"," * The NodeList module provides support for managing collections of Nodes."," * @module node"," * @submodule node-core"," */","","/**"," * The NodeList class provides a wrapper for manipulating DOM NodeLists."," * NodeList properties can be accessed via the set/get methods."," * Use Y.all() to retrieve NodeList instances."," *"," * @class NodeList"," * @constructor"," * @param nodes {String|element|Node|Array} A selector, DOM element, Node, list of DOM elements, or list of Nodes with which to populate this NodeList."," */","","var NodeList = function(nodes) {"," var tmp = [];",""," if (nodes) {"," if (typeof nodes === 'string') { // selector query"," this._query = nodes;"," nodes = Y.Selector.query(nodes);"," } else if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window"," nodes = [nodes];"," } else if (nodes._node) { // Y.Node"," nodes = [nodes._node];"," } else if (nodes[0] && nodes[0]._node) { // allow array of Y.Nodes"," Y.Array.each(nodes, function(node) {"," if (node._node) {"," tmp.push(node._node);"," }"," });"," nodes = tmp;"," } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes)"," nodes = Y.Array(nodes, 0, true);"," }"," }",""," /**"," * The underlying array of DOM nodes bound to the Y.NodeList instance"," * @property _nodes"," * @private"," */"," this._nodes = nodes || [];","};","","NodeList.NAME = 'NodeList';","","/**"," * Retrieves the DOM nodes bound to a NodeList instance"," * @method getDOMNodes"," * @static"," *"," * @param {NodeList} nodelist The NodeList instance"," * @return {Array} The array of DOM nodes bound to the NodeList"," */","NodeList.getDOMNodes = function(nodelist) {"," return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist;","};","","NodeList.each = function(instance, fn, context) {"," var nodes = instance._nodes;"," if (nodes && nodes.length) {"," Y.Array.each(nodes, fn, context || instance);"," } else {"," }","};","","NodeList.addMethod = function(name, fn, context) {"," if (name && fn) {"," NodeList.prototype[name] = function() {"," var ret = [],"," args = arguments;",""," Y.Array.each(this._nodes, function(node) {"," var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid',"," instance = Y.Node._instances[node[UID]],"," ctx,"," result;",""," if (!instance) {"," instance = NodeList._getTempNode(node);"," }"," ctx = context || instance;"," result = fn.apply(ctx, args);"," if (result !== undefined && result !== instance) {"," ret[ret.length] = result;"," }"," });",""," // TODO: remove tmp pointer"," return ret.length ? ret : this;"," };"," } else {"," }","};","","NodeList.importMethod = function(host, name, altName) {"," if (typeof name === 'string') {"," altName = altName || name;"," NodeList.addMethod(name, host[name]);"," } else {"," Y.Array.each(name, function(n) {"," NodeList.importMethod(host, n);"," });"," }","};","","NodeList._getTempNode = function(node) {"," var tmp = NodeList._tempNode;"," if (!tmp) {"," tmp = Y.Node.create('<div></div>');"," NodeList._tempNode = tmp;"," }",""," tmp._node = node;"," tmp._stateProxy = node;"," return tmp;","};","","Y.mix(NodeList.prototype, {"," _invoke: function(method, args, getter) {"," var ret = (getter) ? [] : this;",""," this.each(function(node) {"," var val = node[method].apply(node, args);"," if (getter) {"," ret.push(val);"," }"," });",""," return ret;"," },",""," /**"," * Retrieves the Node instance at the given index."," * @method item"," *"," * @param {Number} index The index of the target Node."," * @return {Node} The Node instance at the given index."," */"," item: function(index) {"," return Y.one((this._nodes || [])[index]);"," },",""," /**"," * Applies the given function to each Node in the NodeList."," * @method each"," * @param {Function} fn The function to apply. It receives 3 arguments:"," * the current node instance, the node's index, and the NodeList instance"," * @param {Object} context optional An optional context to apply the function with"," * Default context is the current Node instance"," * @chainable"," */"," each: function(fn, context) {"," var instance = this;"," Y.Array.each(this._nodes, function(node, index) {"," node = Y.one(node);"," return fn.call(context || node, node, index, instance);"," });"," return instance;"," },",""," batch: function(fn, context) {"," var nodelist = this;",""," Y.Array.each(this._nodes, function(node, index) {"," var instance = Y.Node._instances[node[UID]];"," if (!instance) {"," instance = NodeList._getTempNode(node);"," }",""," return fn.call(context || instance, instance, index, nodelist);"," });"," return nodelist;"," },",""," /**"," * Executes the function once for each node until a true value is returned."," * @method some"," * @param {Function} fn The function to apply. It receives 3 arguments:"," * the current node instance, the node's index, and the NodeList instance"," * @param {Object} context optional An optional context to execute the function from."," * Default context is the current Node instance"," * @return {Boolean} Whether or not the function returned true for any node."," */"," some: function(fn, context) {"," var instance = this;"," return Y.Array.some(this._nodes, function(node, index) {"," node = Y.one(node);"," context = context || node;"," return fn.call(context, node, index, instance);"," });"," },",""," /**"," * Creates a documenFragment from the nodes bound to the NodeList instance"," * @method toFrag"," * @return {Node} a Node instance bound to the documentFragment"," */"," toFrag: function() {"," return Y.one(Y.DOM._nl2frag(this._nodes));"," },",""," /**"," * Returns the index of the node in the NodeList instance"," * or -1 if the node isn't found."," * @method indexOf"," * @param {Node | DOMNode} node the node to search for"," * @return {Int} the index of the node value or -1 if not found"," */"," indexOf: function(node) {"," return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node));"," },",""," /**"," * Filters the NodeList instance down to only nodes matching the given selector."," * @method filter"," * @param {String} selector The selector to filter against"," * @return {NodeList} NodeList containing the updated collection"," * @see Selector"," */"," filter: function(selector) {"," return Y.all(Y.Selector.filter(this._nodes, selector));"," },","",""," /**"," * Creates a new NodeList containing all nodes at every n indices, where"," * remainder n % index equals r."," * (zero-based index)."," * @method modulus"," * @param {Int} n The offset to use (return every nth node)"," * @param {Int} r An optional remainder to use with the modulus operation (defaults to zero)"," * @return {NodeList} NodeList containing the updated collection"," */"," modulus: function(n, r) {"," r = r || 0;"," var nodes = [];"," NodeList.each(this, function(node, i) {"," if (i % n === r) {"," nodes.push(node);"," }"," });",""," return Y.all(nodes);"," },",""," /**"," * Creates a new NodeList containing all nodes at odd indices"," * (zero-based index)."," * @method odd"," * @return {NodeList} NodeList containing the updated collection"," */"," odd: function() {"," return this.modulus(2, 1);"," },",""," /**"," * Creates a new NodeList containing all nodes at even indices"," * (zero-based index), including zero."," * @method even"," * @return {NodeList} NodeList containing the updated collection"," */"," even: function() {"," return this.modulus(2);"," },",""," destructor: function() {"," },",""," /**"," * Reruns the initial query, when created using a selector query"," * @method refresh"," * @chainable"," */"," refresh: function() {"," var doc,"," nodes = this._nodes,"," query = this._query,"," root = this._queryRoot;",""," if (query) {"," if (!root) {"," if (nodes && nodes[0] && nodes[0].ownerDocument) {"," root = nodes[0].ownerDocument;"," }"," }",""," this._nodes = Y.Selector.query(query, root);"," }",""," return this;"," },",""," /**"," * Returns the current number of items in the NodeList."," * @method size"," * @return {Int} The number of items in the NodeList."," */"," size: function() {"," return this._nodes.length;"," },",""," /**"," * Determines if the instance is bound to any nodes"," * @method isEmpty"," * @return {Boolean} Whether or not the NodeList is bound to any nodes"," */"," isEmpty: function() {"," return this._nodes.length < 1;"," },",""," toString: function() {"," var str = '',"," errorMsg = this[UID] + ': not bound to any nodes',"," nodes = this._nodes,"," node;",""," if (nodes && nodes[0]) {"," node = nodes[0];"," str += node[NODE_NAME];"," if (node.id) {"," str += '#' + node.id;"," }",""," if (node.className) {"," str += '.' + node.className.replace(' ', '.');"," }",""," if (nodes.length > 1) {"," str += '...[' + nodes.length + ' items]';"," }"," }"," return str || errorMsg;"," },",""," /**"," * Returns the DOM node bound to the Node instance"," * @method getDOMNodes"," * @return {Array}"," */"," getDOMNodes: function() {"," return this._nodes;"," }","}, true);","","NodeList.importMethod(Y.Node.prototype, ["," /** "," * Called on each Node instance. Nulls internal node references, "," * removes any plugins and event listeners"," * @method destroy"," * @param {Boolean} recursivePurge (optional) Whether or not to "," * remove listeners from the node's subtree (default is false)"," * @see Node.destroy"," */"," 'destroy',",""," /** "," * Called on each Node instance. Removes and destroys all of the nodes "," * within the node"," * @method empty"," * @chainable"," * @see Node.empty"," */"," 'empty',",""," /** "," * Called on each Node instance. Removes the node from its parent."," * Shortcut for myNode.get('parentNode').removeChild(myNode);"," * @method remove"," * @param {Boolean} destroy whether or not to call destroy() on the node"," * after removal."," * @chainable"," * @see Node.remove"," */"," 'remove',",""," /** "," * Called on each Node instance. Sets an attribute on the Node instance."," * Unless pre-configured (via Node.ATTRS), set hands"," * off to the underlying DOM node. Only valid"," * attributes/properties for the node will be set."," * To set custom attributes use setAttribute."," * @method set"," * @param {String} attr The attribute to be set."," * @param {any} val The value to set the attribute to."," * @chainable"," * @see Node.set"," */"," 'set'","]);","","// one-off implementation to convert array of Nodes to NodeList","// e.g. Y.all('input').get('parentNode');","","/** Called on each Node instance"," * @method get"," * @see Node"," */","NodeList.prototype.get = function(attr) {"," var ret = [],"," nodes = this._nodes,"," isNodeList = false,"," getTemp = NodeList._getTempNode,"," instance,"," val;",""," if (nodes[0]) {"," instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]);"," val = instance._get(attr);"," if (val && val.nodeType) {"," isNodeList = true;"," }"," }",""," Y.Array.each(nodes, function(node) {"," instance = Y.Node._instances[node._yuid];",""," if (!instance) {"," instance = getTemp(node);"," }",""," val = instance._get(attr);"," if (!isNodeList) { // convert array of Nodes to NodeList"," val = Y.Node.scrubVal(val, instance);"," }",""," ret.push(val);"," });",""," return (isNodeList) ? Y.all(ret) : ret;","};","","Y.NodeList = NodeList;","","Y.all = function(nodes) {"," return new NodeList(nodes);","};","","Y.Node.all = Y.all;","/**"," * @module node"," * @submodule node-core"," */","","var Y_NodeList = Y.NodeList,"," ArrayProto = Array.prototype,"," ArrayMethods = {"," /** Returns a new NodeList combining the given NodeList(s)"," * @for NodeList"," * @method concat"," * @param {NodeList | Array} valueN Arrays/NodeLists and/or values to"," * concatenate to the resulting NodeList"," * @return {NodeList} A new NodeList comprised of this NodeList joined with the input."," */"," 'concat': 1,"," /** Removes the last from the NodeList and returns it."," * @for NodeList"," * @method pop"," * @return {Node} The last item in the NodeList."," */"," 'pop': 0,"," /** Adds the given Node(s) to the end of the NodeList."," * @for NodeList"," * @method push"," * @param {Node | DOMNode} nodes One or more nodes to add to the end of the NodeList."," */"," 'push': 0,"," /** Removes the first item from the NodeList and returns it."," * @for NodeList"," * @method shift"," * @return {Node} The first item in the NodeList."," */"," 'shift': 0,"," /** Returns a new NodeList comprising the Nodes in the given range."," * @for NodeList"," * @method slice"," * @param {Number} begin Zero-based index at which to begin extraction."," As a negative index, start indicates an offset from the end of the sequence. slice(-2) extracts the second-to-last element and the last element in the sequence."," * @param {Number} end Zero-based index at which to end extraction. slice extracts up to but not including end."," slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3)."," As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second-to-last element in the sequence."," If end is omitted, slice extracts to the end of the sequence."," * @return {NodeList} A new NodeList comprised of this NodeList joined with the input."," */"," 'slice': 1,"," /** Changes the content of the NodeList, adding new elements while removing old elements."," * @for NodeList"," * @method splice"," * @param {Number} index Index at which to start changing the array. If negative, will begin that many elements from the end."," * @param {Number} howMany An integer indicating the number of old array elements to remove. If howMany is 0, no elements are removed. In this case, you should specify at least one new element. If no howMany parameter is specified (second syntax above, which is a SpiderMonkey extension), all elements after index are removed."," * {Node | DOMNode| element1, ..., elementN"," The elements to add to the array. If you don't specify any elements, splice simply removes elements from the array."," * @return {NodeList} The element(s) removed."," */"," 'splice': 1,"," /** Adds the given Node(s) to the beginning of the NodeList."," * @for NodeList"," * @method unshift"," * @param {Node | DOMNode} nodes One or more nodes to add to the NodeList."," */"," 'unshift': 0"," };","","","Y.Object.each(ArrayMethods, function(returnNodeList, name) {"," Y_NodeList.prototype[name] = function() {"," var args = [],"," i = 0,"," arg,"," ret;",""," while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists"," args.push(arg._node || arg._nodes || arg);"," }",""," ret = ArrayProto[name].apply(this._nodes, args);",""," if (returnNodeList) {"," ret = Y.all(ret);"," } else {"," ret = Y.Node.scrubVal(ret);"," }",""," return ret;"," };","});","/**"," * @module node"," * @submodule node-core"," */","","Y.Array.each(["," /**"," * Passes through to DOM method."," * @for Node"," * @method removeChild"," * @param {HTMLElement | Node} node Node to be removed"," * @return {Node} The removed node"," */"," 'removeChild',",""," /**"," * Passes through to DOM method."," * @method hasChildNodes"," * @return {Boolean} Whether or not the node has any childNodes"," */"," 'hasChildNodes',",""," /**"," * Passes through to DOM method."," * @method cloneNode"," * @param {Boolean} deep Whether or not to perform a deep clone, which includes"," * subtree and attributes"," * @return {Node} The clone"," */"," 'cloneNode',",""," /**"," * Passes through to DOM method."," * @method hasAttribute"," * @param {String} attribute The attribute to test for"," * @return {Boolean} Whether or not the attribute is present"," */"," 'hasAttribute',",""," /**"," * Passes through to DOM method."," * @method scrollIntoView"," * @chainable"," */"," 'scrollIntoView',",""," /**"," * Passes through to DOM method."," * @method getElementsByTagName"," * @param {String} tagName The tagName to collect"," * @return {NodeList} A NodeList representing the HTMLCollection"," */"," 'getElementsByTagName',",""," /**"," * Passes through to DOM method."," * @method focus"," * @chainable"," */"," 'focus',",""," /**"," * Passes through to DOM method."," * @method blur"," * @chainable"," */"," 'blur',",""," /**"," * Passes through to DOM method."," * Only valid on FORM elements"," * @method submit"," * @chainable"," */"," 'submit',",""," /**"," * Passes through to DOM method."," * Only valid on FORM elements"," * @method reset"," * @chainable"," */"," 'reset',",""," /**"," * Passes through to DOM method."," * @method select"," * @chainable"," */"," 'select',",""," /**"," * Passes through to DOM method."," * Only valid on TABLE elements"," * @method createCaption"," * @chainable"," */"," 'createCaption'","","], function(method) {"," Y.Node.prototype[method] = function(arg1, arg2, arg3) {"," var ret = this.invoke(method, arg1, arg2, arg3);"," return ret;"," };","});","","/**"," * Passes through to DOM method."," * @method removeAttribute"," * @param {String} attribute The attribute to be removed"," * @chainable"," */"," // one-off implementation due to IE returning boolean, breaking chaining","Y.Node.prototype.removeAttribute = function(attr) {"," var node = this._node;"," if (node) {"," node.removeAttribute(attr, 0); // comma zero for IE < 8 to force case-insensitive"," }",""," return this;","};","","Y.Node.importMethod(Y.DOM, ["," /**"," * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy."," * @method contains"," * @param {Node | HTMLElement} needle The possible node or descendent"," * @return {Boolean} Whether or not this node is the needle its ancestor"," */"," 'contains',"," /**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @for Node"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',"," /**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @for Node"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */"," 'getAttribute',",""," /**"," * Wraps the given HTML around the node."," * @method wrap"," * @param {String} html The markup to wrap around the node."," * @chainable"," * @for Node"," */"," 'wrap',",""," /**"," * Removes the node's parent node."," * @method unwrap"," * @chainable"," */"," 'unwrap',",""," /**"," * Applies a unique ID to the node if none exists"," * @method generateID"," * @return {String} The existing or generated ID"," */"," 'generateID'","]);","","Y.NodeList.importMethod(Y.Node.prototype, [","/**"," * Allows getting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method getAttribute"," * @see Node"," * @for NodeList"," * @param {string} name The attribute name"," * @return {string} The attribute value"," */",""," 'getAttribute',","/**"," * Allows setting attributes on DOM nodes, normalizing in some cases."," * This passes through to the DOM node, allowing for custom attributes."," * @method setAttribute"," * @see Node"," * @for NodeList"," * @chainable"," * @param {string} name The attribute name"," * @param {string} value The value to set"," */"," 'setAttribute',","","/**"," * Allows for removing attributes on DOM nodes."," * This passes through to the DOM node, allowing for custom attributes."," * @method removeAttribute"," * @see Node"," * @for NodeList"," * @param {string} name The attribute to remove"," */"," 'removeAttribute',","/**"," * Removes the parent node from node in the list."," * @method unwrap"," * @chainable"," */"," 'unwrap',","/**"," * Wraps the given HTML around each node."," * @method wrap"," * @param {String} html The markup to wrap around the node."," * @chainable"," */"," 'wrap',","","/**"," * Applies a unique ID to each node if none exists"," * @method generateID"," * @return {String} The existing or generated ID"," */"," 'generateID'","]);","","","}, '3.7.3', {\"requires\": [\"dom-core\", \"selector\"]});"];+_yuitest_coverage["build/node-core/node-core.js"].lines = {"1":0,"25":0,"38":0,"39":0,"42":0,"43":0,"44":0,"45":0,"49":0,"51":0,"52":0,"55":0,"56":0,"57":0,"60":0,"68":0,"70":0,"72":0,"73":0,"79":0,"80":0,"81":0,"83":0,"86":0,"90":0,"94":0,"95":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"104":0,"108":0,"117":0,"122":0,"124":0,"125":0,"135":0,"146":0,"147":0,"148":0,"150":0,"164":0,"165":0,"166":0,"167":0,"168":0,"169":0,"171":0,"174":0,"175":0,"176":0,"177":0,"180":0,"194":0,"195":0,"196":0,"197":0,"201":0,"202":0,"205":0,"206":0,"208":0,"210":0,"212":0,"213":0,"216":0,"217":0,"233":0,"234":0,"235":0,"236":0,"238":0,"239":0,"275":0,"276":0,"280":0,"281":0,"282":0,"283":0,"284":0,"286":0,"287":0,"290":0,"291":0,"292":0,"293":0,"294":0,"295":0,"296":0,"297":0,"303":0,"315":0,"316":0,"319":0,"320":0,"321":0,"323":0,"324":0,"325":0,"328":0,"339":0,"340":0,"343":0,"344":0,"345":0,"346":0,"349":0,"352":0,"361":0,"365":0,"366":0,"367":0,"368":0,"369":0,"371":0,"372":0,"375":0,"376":0,"380":0,"382":0,"395":0,"397":0,"398":0,"400":0,"403":0,"404":0,"405":0,"406":0,"408":0,"419":0,"422":0,"423":0,"424":0,"425":0,"427":0,"430":0,"445":0,"447":0,"448":0,"450":0,"451":0,"452":0,"453":0,"455":0,"459":0,"469":0,"470":0,"472":0,"473":0,"477":0,"487":0,"488":0,"489":0,"491":0,"492":0,"496":0,"507":0,"509":0,"510":0,"512":0,"523":0,"524":0,"525":0,"526":0,"531":0,"533":0,"534":0,"536":0,"538":0,"556":0,"558":0,"561":0,"573":0,"575":0,"577":0,"589":0,"601":0,"613":0,"624":0,"635":0,"636":0,"637":0,"638":0,"650":0,"663":0,"665":0,"666":0,"669":0,"670":0,"673":0,"686":0,"687":0,"688":0,"690":0,"691":0,"702":0,"703":0,"706":0,"719":0,"722":0,"724":0,"725":0,"728":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"744":0,"758":0,"761":0,"762":0,"765":0,"766":0,"769":0,"770":0,"782":0,"785":0,"786":0,"790":0,"791":0,"792":0,"793":0,"795":0,"796":0,"798":0,"803":0,"804":0,"811":0,"820":0,"821":0,"830":0,"834":0,"835":0,"852":0,"853":0,"855":0,"856":0,"857":0,"858":0,"859":0,"860":0,"861":0,"862":0,"863":0,"864":0,"865":0,"866":0,"869":0,"871":0,"880":0,"883":0,"893":0,"894":0,"897":0,"898":0,"899":0,"900":0,"905":0,"906":0,"907":0,"908":0,"911":0,"912":0,"917":0,"918":0,"920":0,"921":0,"922":0,"923":0,"928":0,"934":0,"935":0,"936":0,"937":0,"939":0,"940":0,"945":0,"946":0,"947":0,"948":0,"949":0,"952":0,"953":0,"954":0,"957":0,"959":0,"961":0,"962":0,"963":0,"964":0,"968":0,"979":0,"992":0,"993":0,"994":0,"995":0,"997":0,"1001":0,"1003":0,"1004":0,"1005":0,"1006":0,"1009":0,"1011":0,"1024":0,"1025":0,"1026":0,"1027":0,"1028":0,"1038":0,"1049":0,"1060":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1082":0,"1092":0,"1102":0,"1114":0,"1119":0,"1120":0,"1121":0,"1122":0,"1126":0,"1129":0,"1138":0,"1147":0,"1151":0,"1156":0,"1157":0,"1158":0,"1159":0,"1160":0,"1163":0,"1164":0,"1167":0,"1168":0,"1171":0,"1180":0,"1184":0,"1237":0,"1238":0,"1245":0,"1246":0,"1247":0,"1248":0,"1249":0,"1253":0,"1254":0,"1256":0,"1257":0,"1260":0,"1261":0,"1262":0,"1265":0,"1268":0,"1271":0,"1273":0,"1274":0,"1277":0,"1283":0,"1343":0,"1344":0,"1345":0,"1350":0,"1351":0,"1354":0,"1356":0,"1357":0,"1359":0,"1362":0,"1370":0,"1465":0,"1466":0,"1467":0,"1478":0,"1479":0,"1480":0,"1481":0,"1484":0,"1487":0,"1539":0};+_yuitest_coverage["build/node-core/node-core.js"].functions = {"Y_Node:37":0,"(anonymous 2):82":0,"}:85":0,"_wrapFn:78":0,"_fromString:97":0,"getDOMNode:146":0,"scrubVal:164":0,"]:196":0,"addMethod:194":0,"(anonymous 3):238":0,"importMethod:233":0,"one:275":0,"DEFAULT_SETTER:315":0,"DEFAULT_GETTER:339":0,"toString:360":0,"get:394":0,"_get:418":0,"set:444":0,"(anonymous 4):472":0,"setAttrs:468":0,"(anonymous 5):491":0,"getAttrs:486":0,"compareTo:506":0,"inDoc:522":0,"getById:530":0,"ancestor:554":0,"ancestors:572":0,"previous:588":0,"next:600":0,"siblings:612":0,"one:623":0,"all:634":0,"test:649":0,"remove:662":0,"replace:685":0,"replaceChild:701":0,"(anonymous 6):731":0,"destroy:718":0,"invoke:757":0,"(anonymous 7):781":0,"}:784":0,"hasMethod:802":0,"isFragment:810":0,"empty:819":0,"getDOMNode:829":0,"(anonymous 8):864":0,"NodeList:852":0,"getDOMNodes:893":0,"each:897":0,"(anonymous 9):911":0,"]:907":0,"addMethod:905":0,"(anonymous 10):939":0,"importMethod:934":0,"_getTempNode:945":0,"(anonymous 11):961":0,"_invoke:958":0,"item:978":0,"(anonymous 12):993":0,"each:991":0,"(anonymous 13):1003":0,"batch:1000":0,"(anonymous 14):1025":0,"some:1023":0,"toFrag:1037":0,"indexOf:1048":0,"filter:1059":0,"(anonymous 15):1076":0,"modulus:1073":0,"odd:1091":0,"even:1101":0,"refresh:1113":0,"size:1137":0,"isEmpty:1146":0,"toString:1150":0,"getDOMNodes:1179":0,"(anonymous 16):1253":0,"get:1237":0,"all:1273":0,"]:1344":0,"(anonymous 17):1343":0,"]:1465":0,"(anonymous 18):1464":0,"removeAttribute:1478":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-core/node-core.js"].coveredLines = 391; _yuitest_coverage["build/node-core/node-core.js"].coveredFunctions = 85; _yuitest_coverline("build/node-core/node-core.js", 1);@@ -984,54 +984,56 @@ }, /**- * Nulls internal node references, removes any plugins and event listeners+ * Nulls internal node references, removes any plugins and event listeners.+ * Note that destroy() will not remove the node from its parent or from the DOM. For that+ * functionality, call remove(true). * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false) * */ destroy: function(recursive) {- _yuitest_coverfunc("build/node-core/node-core.js", "destroy", 716);-_yuitest_coverline("build/node-core/node-core.js", 717);+ _yuitest_coverfunc("build/node-core/node-core.js", "destroy", 718);+_yuitest_coverline("build/node-core/node-core.js", 719); var UID = Y.config.doc.uniqueID ? 'uniqueID' : '_yuid', instance; - _yuitest_coverline("build/node-core/node-core.js", 720);+ _yuitest_coverline("build/node-core/node-core.js", 722); this.purge(); // TODO: only remove events add via this Node - _yuitest_coverline("build/node-core/node-core.js", 722);+ _yuitest_coverline("build/node-core/node-core.js", 724); if (this.unplug) { // may not be a PluginHost- _yuitest_coverline("build/node-core/node-core.js", 723);+ _yuitest_coverline("build/node-core/node-core.js", 725); this.unplug(); } - _yuitest_coverline("build/node-core/node-core.js", 726);+ _yuitest_coverline("build/node-core/node-core.js", 728); this.clearData(); - _yuitest_coverline("build/node-core/node-core.js", 728);+ _yuitest_coverline("build/node-core/node-core.js", 730); if (recursive) {- _yuitest_coverline("build/node-core/node-core.js", 729);+ _yuitest_coverline("build/node-core/node-core.js", 731); Y.NodeList.each(this.all('*'), function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 6)", 729);-_yuitest_coverline("build/node-core/node-core.js", 730);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 6)", 731);+_yuitest_coverline("build/node-core/node-core.js", 732); instance = Y_Node._instances[node[UID]];- _yuitest_coverline("build/node-core/node-core.js", 731);+ _yuitest_coverline("build/node-core/node-core.js", 733); if (instance) {- _yuitest_coverline("build/node-core/node-core.js", 732);+ _yuitest_coverline("build/node-core/node-core.js", 734); instance.destroy(); } else { // purge in case added by other means- _yuitest_coverline("build/node-core/node-core.js", 734);+ _yuitest_coverline("build/node-core/node-core.js", 736); Y.Event.purgeElement(node); } }); } - _yuitest_coverline("build/node-core/node-core.js", 739);+ _yuitest_coverline("build/node-core/node-core.js", 741); this._node = null;- _yuitest_coverline("build/node-core/node-core.js", 740);+ _yuitest_coverline("build/node-core/node-core.js", 742); this._stateProxy = null; - _yuitest_coverline("build/node-core/node-core.js", 742);+ _yuitest_coverline("build/node-core/node-core.js", 744); delete Y_Node._instances[this._yuid]; }, @@ -1046,26 +1048,26 @@ * */ invoke: function(method, a, b, c, d, e) {- _yuitest_coverfunc("build/node-core/node-core.js", "invoke", 755);-_yuitest_coverline("build/node-core/node-core.js", 756);+ _yuitest_coverfunc("build/node-core/node-core.js", "invoke", 757);+_yuitest_coverline("build/node-core/node-core.js", 758); var node = this._node, ret; - _yuitest_coverline("build/node-core/node-core.js", 759);+ _yuitest_coverline("build/node-core/node-core.js", 761); if (a && a._node) {- _yuitest_coverline("build/node-core/node-core.js", 760);+ _yuitest_coverline("build/node-core/node-core.js", 762); a = a._node; } - _yuitest_coverline("build/node-core/node-core.js", 763);+ _yuitest_coverline("build/node-core/node-core.js", 765); if (b && b._node) {- _yuitest_coverline("build/node-core/node-core.js", 764);+ _yuitest_coverline("build/node-core/node-core.js", 766); b = b._node; } - _yuitest_coverline("build/node-core/node-core.js", 767);+ _yuitest_coverline("build/node-core/node-core.js", 769); ret = node[method](a, b, c, d, e);- _yuitest_coverline("build/node-core/node-core.js", 768);+ _yuitest_coverline("build/node-core/node-core.js", 770); return Y_Node.scrubVal(ret, this); }, @@ -1078,43 +1080,43 @@ */ swap: Y.config.doc.documentElement.swapNode ? function(otherNode) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 7)", 779);-_yuitest_coverline("build/node-core/node-core.js", 780);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 7)", 781);+_yuitest_coverline("build/node-core/node-core.js", 782); this._node.swapNode(Y_Node.getDOMNode(otherNode)); } : function(otherNode) {- _yuitest_coverfunc("build/node-core/node-core.js", "}", 782);-_yuitest_coverline("build/node-core/node-core.js", 783);+ _yuitest_coverfunc("build/node-core/node-core.js", "}", 784);+_yuitest_coverline("build/node-core/node-core.js", 785); otherNode = Y_Node.getDOMNode(otherNode);- _yuitest_coverline("build/node-core/node-core.js", 784);+ _yuitest_coverline("build/node-core/node-core.js", 786); var node = this._node, parent = otherNode.parentNode, nextSibling = otherNode.nextSibling; - _yuitest_coverline("build/node-core/node-core.js", 788);+ _yuitest_coverline("build/node-core/node-core.js", 790); if (nextSibling === node) {- _yuitest_coverline("build/node-core/node-core.js", 789);+ _yuitest_coverline("build/node-core/node-core.js", 791); parent.insertBefore(node, otherNode);- } else {_yuitest_coverline("build/node-core/node-core.js", 790);+ } else {_yuitest_coverline("build/node-core/node-core.js", 792); if (otherNode === node.nextSibling) {- _yuitest_coverline("build/node-core/node-core.js", 791);+ _yuitest_coverline("build/node-core/node-core.js", 793); parent.insertBefore(otherNode, node); } else {- _yuitest_coverline("build/node-core/node-core.js", 793);+ _yuitest_coverline("build/node-core/node-core.js", 795); node.parentNode.replaceChild(otherNode, node);- _yuitest_coverline("build/node-core/node-core.js", 794);+ _yuitest_coverline("build/node-core/node-core.js", 796); Y_DOM.addHTML(parent, node, nextSibling); }}- _yuitest_coverline("build/node-core/node-core.js", 796);+ _yuitest_coverline("build/node-core/node-core.js", 798); return this; }, hasMethod: function(method) {- _yuitest_coverfunc("build/node-core/node-core.js", "hasMethod", 800);-_yuitest_coverline("build/node-core/node-core.js", 801);+ _yuitest_coverfunc("build/node-core/node-core.js", "hasMethod", 802);+_yuitest_coverline("build/node-core/node-core.js", 803); var node = this._node;- _yuitest_coverline("build/node-core/node-core.js", 802);+ _yuitest_coverline("build/node-core/node-core.js", 804); return !!(node && method in node && typeof node[method] != 'unknown' && (typeof node[method] == 'function' ||@@ -1122,8 +1124,8 @@ }, isFragment: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "isFragment", 808);-_yuitest_coverline("build/node-core/node-core.js", 809);+ _yuitest_coverfunc("build/node-core/node-core.js", "isFragment", 810);+_yuitest_coverline("build/node-core/node-core.js", 811); return (this.get('nodeType') === 11); }, @@ -1133,10 +1135,10 @@ * @chainable */ empty: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "empty", 817);-_yuitest_coverline("build/node-core/node-core.js", 818);+ _yuitest_coverfunc("build/node-core/node-core.js", "empty", 819);+_yuitest_coverline("build/node-core/node-core.js", 820); this.get('childNodes').remove().destroy(true);- _yuitest_coverline("build/node-core/node-core.js", 819);+ _yuitest_coverline("build/node-core/node-core.js", 821); return this; }, @@ -1146,15 +1148,15 @@ * @return {DOMNode} */ getDOMNode: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "getDOMNode", 827);-_yuitest_coverline("build/node-core/node-core.js", 828);+ _yuitest_coverfunc("build/node-core/node-core.js", "getDOMNode", 829);+_yuitest_coverline("build/node-core/node-core.js", 830); return this._node; } }, true); -_yuitest_coverline("build/node-core/node-core.js", 832);+_yuitest_coverline("build/node-core/node-core.js", 834); Y.Node = Y_Node;-_yuitest_coverline("build/node-core/node-core.js", 833);+_yuitest_coverline("build/node-core/node-core.js", 835); Y.one = Y_Node.one; /** * The NodeList module provides support for managing collections of Nodes.@@ -1172,43 +1174,43 @@ * @param nodes {String|element|Node|Array} A selector, DOM element, Node, list of DOM elements, or list of Nodes with which to populate this NodeList. */ -_yuitest_coverline("build/node-core/node-core.js", 850);+_yuitest_coverline("build/node-core/node-core.js", 852); var NodeList = function(nodes) {- _yuitest_coverfunc("build/node-core/node-core.js", "NodeList", 850);-_yuitest_coverline("build/node-core/node-core.js", 851);+ _yuitest_coverfunc("build/node-core/node-core.js", "NodeList", 852);+_yuitest_coverline("build/node-core/node-core.js", 853); var tmp = []; - _yuitest_coverline("build/node-core/node-core.js", 853);+ _yuitest_coverline("build/node-core/node-core.js", 855); if (nodes) {- _yuitest_coverline("build/node-core/node-core.js", 854);+ _yuitest_coverline("build/node-core/node-core.js", 856); if (typeof nodes === 'string') { // selector query- _yuitest_coverline("build/node-core/node-core.js", 855);+ _yuitest_coverline("build/node-core/node-core.js", 857); this._query = nodes;- _yuitest_coverline("build/node-core/node-core.js", 856);+ _yuitest_coverline("build/node-core/node-core.js", 858); nodes = Y.Selector.query(nodes);- } else {_yuitest_coverline("build/node-core/node-core.js", 857);+ } else {_yuitest_coverline("build/node-core/node-core.js", 859); if (nodes.nodeType || Y_DOM.isWindow(nodes)) { // domNode || window- _yuitest_coverline("build/node-core/node-core.js", 858);+ _yuitest_coverline("build/node-core/node-core.js", 860); nodes = [nodes];- } else {_yuitest_coverline("build/node-core/node-core.js", 859);+ } else {_yuitest_coverline("build/node-core/node-core.js", 861); if (nodes._node) { // Y.Node- _yuitest_coverline("build/node-core/node-core.js", 860);+ _yuitest_coverline("build/node-core/node-core.js", 862); nodes = [nodes._node];- } else {_yuitest_coverline("build/node-core/node-core.js", 861);+ } else {_yuitest_coverline("build/node-core/node-core.js", 863); if (nodes[0] && nodes[0]._node) { // allow array of Y.Nodes- _yuitest_coverline("build/node-core/node-core.js", 862);+ _yuitest_coverline("build/node-core/node-core.js", 864); Y.Array.each(nodes, function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 8)", 862);-_yuitest_coverline("build/node-core/node-core.js", 863);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 8)", 864);+_yuitest_coverline("build/node-core/node-core.js", 865); if (node._node) {- _yuitest_coverline("build/node-core/node-core.js", 864);+ _yuitest_coverline("build/node-core/node-core.js", 866); tmp.push(node._node); } });- _yuitest_coverline("build/node-core/node-core.js", 867);+ _yuitest_coverline("build/node-core/node-core.js", 869); nodes = tmp; } else { // array of domNodes or domNodeList (no mixed array of Y.Node/domNodes)- _yuitest_coverline("build/node-core/node-core.js", 869);+ _yuitest_coverline("build/node-core/node-core.js", 871); nodes = Y.Array(nodes, 0, true); }}}} }@@ -1218,11 +1220,11 @@ * @property _nodes * @private */- _yuitest_coverline("build/node-core/node-core.js", 878);+ _yuitest_coverline("build/node-core/node-core.js", 880); this._nodes = nodes || []; }; -_yuitest_coverline("build/node-core/node-core.js", 881);+_yuitest_coverline("build/node-core/node-core.js", 883); NodeList.NAME = 'NodeList'; /**@@ -1233,131 +1235,131 @@ * @param {NodeList} nodelist The NodeList instance * @return {Array} The array of DOM nodes bound to the NodeList */-_yuitest_coverline("build/node-core/node-core.js", 891);+_yuitest_coverline("build/node-core/node-core.js", 893); NodeList.getDOMNodes = function(nodelist) {- _yuitest_coverfunc("build/node-core/node-core.js", "getDOMNodes", 891);-_yuitest_coverline("build/node-core/node-core.js", 892);+ _yuitest_coverfunc("build/node-core/node-core.js", "getDOMNodes", 893);+_yuitest_coverline("build/node-core/node-core.js", 894); return (nodelist && nodelist._nodes) ? nodelist._nodes : nodelist; }; -_yuitest_coverline("build/node-core/node-core.js", 895);+_yuitest_coverline("build/node-core/node-core.js", 897); NodeList.each = function(instance, fn, context) {- _yuitest_coverfunc("build/node-core/node-core.js", "each", 895);-_yuitest_coverline("build/node-core/node-core.js", 896);+ _yuitest_coverfunc("build/node-core/node-core.js", "each", 897);+_yuitest_coverline("build/node-core/node-core.js", 898); var nodes = instance._nodes;- _yuitest_coverline("build/node-core/node-core.js", 897);+ _yuitest_coverline("build/node-core/node-core.js", 899); if (nodes && nodes.length) {- _yuitest_coverline("build/node-core/node-core.js", 898);+ _yuitest_coverline("build/node-core/node-core.js", 900); Y.Array.each(nodes, fn, context || instance); } else { } }; -_yuitest_coverline("build/node-core/node-core.js", 903);+_yuitest_coverline("build/node-core/node-core.js", 905); NodeList.addMethod = function(name, fn, context) {- _yuitest_coverfunc("build/node-core/node-core.js", "addMethod", 903);-_yuitest_coverline("build/node-core/node-core.js", 904);+ _yuitest_coverfunc("build/node-core/node-core.js", "addMethod", 905);+_yuitest_coverline("build/node-core/node-core.js", 906); if (name && fn) {- _yuitest_coverline("build/node-core/node-core.js", 905);+ _yuitest_coverline("build/node-core/node-core.js", 907); NodeList.prototype[name] = function() {- _yuitest_coverfunc("build/node-core/node-core.js", "]", 905);-_yuitest_coverline("build/node-core/node-core.js", 906);+ _yuitest_coverfunc("build/node-core/node-core.js", "]", 907);+_yuitest_coverline("build/node-core/node-core.js", 908); var ret = [], args = arguments; - _yuitest_coverline("build/node-core/node-core.js", 909);+ _yuitest_coverline("build/node-core/node-core.js", 911); Y.Array.each(this._nodes, function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 9)", 909);-_yuitest_coverline("build/node-core/node-core.js", 910);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 9)", 911);+_yuitest_coverline("build/node-core/node-core.js", 912); var UID = (node.uniqueID && node.nodeType !== 9 ) ? 'uniqueID' : '_yuid', instance = Y.Node._instances[node[UID]], ctx, result; - _yuitest_coverline("build/node-core/node-core.js", 915);+ _yuitest_coverline("build/node-core/node-core.js", 917); if (!instance) {- _yuitest_coverline("build/node-core/node-core.js", 916);+ _yuitest_coverline("build/node-core/node-core.js", 918); instance = NodeList._getTempNode(node); }- _yuitest_coverline("build/node-core/node-core.js", 918);+ _yuitest_coverline("build/node-core/node-core.js", 920); ctx = context || instance;- _yuitest_coverline("build/node-core/node-core.js", 919);+ _yuitest_coverline("build/node-core/node-core.js", 921); result = fn.apply(ctx, args);- _yuitest_coverline("build/node-core/node-core.js", 920);+ _yuitest_coverline("build/node-core/node-core.js", 922); if (result !== undefined && result !== instance) {- _yuitest_coverline("build/node-core/node-core.js", 921);+ _yuitest_coverline("build/node-core/node-core.js", 923); ret[ret.length] = result; } }); // TODO: remove tmp pointer- _yuitest_coverline("build/node-core/node-core.js", 926);+ _yuitest_coverline("build/node-core/node-core.js", 928); return ret.length ? ret : this; }; } else { } }; -_yuitest_coverline("build/node-core/node-core.js", 932);+_yuitest_coverline("build/node-core/node-core.js", 934); NodeList.importMethod = function(host, name, altName) {- _yuitest_coverfunc("build/node-core/node-core.js", "importMethod", 932);-_yuitest_coverline("build/node-core/node-core.js", 933);+ _yuitest_coverfunc("build/node-core/node-core.js", "importMethod", 934);+_yuitest_coverline("build/node-core/node-core.js", 935); if (typeof name === 'string') {- _yuitest_coverline("build/node-core/node-core.js", 934);+ _yuitest_coverline("build/node-core/node-core.js", 936); altName = altName || name;- _yuitest_coverline("build/node-core/node-core.js", 935);+ _yuitest_coverline("build/node-core/node-core.js", 937); NodeList.addMethod(name, host[name]); } else {- _yuitest_coverline("build/node-core/node-core.js", 937);+ _yuitest_coverline("build/node-core/node-core.js", 939); Y.Array.each(name, function(n) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 10)", 937);-_yuitest_coverline("build/node-core/node-core.js", 938);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 10)", 939);+_yuitest_coverline("build/node-core/node-core.js", 940); NodeList.importMethod(host, n); }); } }; -_yuitest_coverline("build/node-core/node-core.js", 943);+_yuitest_coverline("build/node-core/node-core.js", 945); NodeList._getTempNode = function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "_getTempNode", 943);-_yuitest_coverline("build/node-core/node-core.js", 944);+ _yuitest_coverfunc("build/node-core/node-core.js", "_getTempNode", 945);+_yuitest_coverline("build/node-core/node-core.js", 946); var tmp = NodeList._tempNode;- _yuitest_coverline("build/node-core/node-core.js", 945);+ _yuitest_coverline("build/node-core/node-core.js", 947); if (!tmp) {- _yuitest_coverline("build/node-core/node-core.js", 946);+ _yuitest_coverline("build/node-core/node-core.js", 948); tmp = Y.Node.create('<div></div>');- _yuitest_coverline("build/node-core/node-core.js", 947);+ _yuitest_coverline("build/node-core/node-core.js", 949); NodeList._tempNode = tmp; } - _yuitest_coverline("build/node-core/node-core.js", 950);+ _yuitest_coverline("build/node-core/node-core.js", 952); tmp._node = node;- _yuitest_coverline("build/node-core/node-core.js", 951);+ _yuitest_coverline("build/node-core/node-core.js", 953); tmp._stateProxy = node;- _yuitest_coverline("build/node-core/node-core.js", 952);+ _yuitest_coverline("build/node-core/node-core.js", 954); return tmp; }; -_yuitest_coverline("build/node-core/node-core.js", 955);+_yuitest_coverline("build/node-core/node-core.js", 957); Y.mix(NodeList.prototype, { _invoke: function(method, args, getter) {- _yuitest_coverfunc("build/node-core/node-core.js", "_invoke", 956);-_yuitest_coverline("build/node-core/node-core.js", 957);+ _yuitest_coverfunc("build/node-core/node-core.js", "_invoke", 958);+_yuitest_coverline("build/node-core/node-core.js", 959); var ret = (getter) ? [] : this; - _yuitest_coverline("build/node-core/node-core.js", 959);+ _yuitest_coverline("build/node-core/node-core.js", 961); this.each(function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 11)", 959);-_yuitest_coverline("build/node-core/node-core.js", 960);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 11)", 961);+_yuitest_coverline("build/node-core/node-core.js", 962); var val = node[method].apply(node, args);- _yuitest_coverline("build/node-core/node-core.js", 961);+ _yuitest_coverline("build/node-core/node-core.js", 963); if (getter) {- _yuitest_coverline("build/node-core/node-core.js", 962);+ _yuitest_coverline("build/node-core/node-core.js", 964); ret.push(val); } }); - _yuitest_coverline("build/node-core/node-core.js", 966);+ _yuitest_coverline("build/node-core/node-core.js", 968); return ret; }, @@ -1369,8 +1371,8 @@ * @return {Node} The Node instance at the given index. */ item: function(index) {- _yuitest_coverfunc("build/node-core/node-core.js", "item", 976);-_yuitest_coverline("build/node-core/node-core.js", 977);+ _yuitest_coverfunc("build/node-core/node-core.js", "item", 978);+_yuitest_coverline("build/node-core/node-core.js", 979); return Y.one((this._nodes || [])[index]); }, @@ -1384,41 +1386,41 @@ * @chainable */ each: function(fn, context) {- _yuitest_coverfunc("build/node-core/node-core.js", "each", 989);-_yuitest_coverline("build/node-core/node-core.js", 990);+ _yuitest_coverfunc("build/node-core/node-core.js", "each", 991);+_yuitest_coverline("build/node-core/node-core.js", 992); var instance = this;- _yuitest_coverline("build/node-core/node-core.js", 991);+ _yuitest_coverline("build/node-core/node-core.js", 993); Y.Array.each(this._nodes, function(node, index) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 12)", 991);-_yuitest_coverline("build/node-core/node-core.js", 992);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 12)", 993);+_yuitest_coverline("build/node-core/node-core.js", 994); node = Y.one(node);- _yuitest_coverline("build/node-core/node-core.js", 993);+ _yuitest_coverline("build/node-core/node-core.js", 995); return fn.call(context || node, node, index, instance); });- _yuitest_coverline("build/node-core/node-core.js", 995);+ _yuitest_coverline("build/node-core/node-core.js", 997); return instance; }, batch: function(fn, context) {- _yuitest_coverfunc("build/node-core/node-core.js", "batch", 998);-_yuitest_coverline("build/node-core/node-core.js", 999);+ _yuitest_coverfunc("build/node-core/node-core.js", "batch", 1000);+_yuitest_coverline("build/node-core/node-core.js", 1001); var nodelist = this; - _yuitest_coverline("build/node-core/node-core.js", 1001);+ _yuitest_coverline("build/node-core/node-core.js", 1003); Y.Array.each(this._nodes, function(node, index) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 13)", 1001);-_yuitest_coverline("build/node-core/node-core.js", 1002);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 13)", 1003);+_yuitest_coverline("build/node-core/node-core.js", 1004); var instance = Y.Node._instances[node[UID]];- _yuitest_coverline("build/node-core/node-core.js", 1003);+ _yuitest_coverline("build/node-core/node-core.js", 1005); if (!instance) {- _yuitest_coverline("build/node-core/node-core.js", 1004);+ _yuitest_coverline("build/node-core/node-core.js", 1006); instance = NodeList._getTempNode(node); } - _yuitest_coverline("build/node-core/node-core.js", 1007);+ _yuitest_coverline("build/node-core/node-core.js", 1009); return fn.call(context || instance, instance, index, nodelist); });- _yuitest_coverline("build/node-core/node-core.js", 1009);+ _yuitest_coverline("build/node-core/node-core.js", 1011); return nodelist; }, @@ -1432,17 +1434,17 @@ * @return {Boolean} Whether or not the function returned true for any node. */ some: function(fn, context) {- _yuitest_coverfunc("build/node-core/node-core.js", "some", 1021);-_yuitest_coverline("build/node-core/node-core.js", 1022);+ _yuitest_coverfunc("build/node-core/node-core.js", "some", 1023);+_yuitest_coverline("build/node-core/node-core.js", 1024); var instance = this;- _yuitest_coverline("build/node-core/node-core.js", 1023);+ _yuitest_coverline("build/node-core/node-core.js", 1025); return Y.Array.some(this._nodes, function(node, index) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 14)", 1023);-_yuitest_coverline("build/node-core/node-core.js", 1024);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 14)", 1025);+_yuitest_coverline("build/node-core/node-core.js", 1026); node = Y.one(node);- _yuitest_coverline("build/node-core/node-core.js", 1025);+ _yuitest_coverline("build/node-core/node-core.js", 1027); context = context || node;- _yuitest_coverline("build/node-core/node-core.js", 1026);+ _yuitest_coverline("build/node-core/node-core.js", 1028); return fn.call(context, node, index, instance); }); },@@ -1453,8 +1455,8 @@ * @return {Node} a Node instance bound to the documentFragment */ toFrag: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "toFrag", 1035);-_yuitest_coverline("build/node-core/node-core.js", 1036);+ _yuitest_coverfunc("build/node-core/node-core.js", "toFrag", 1037);+_yuitest_coverline("build/node-core/node-core.js", 1038); return Y.one(Y.DOM._nl2frag(this._nodes)); }, @@ -1466,8 +1468,8 @@ * @return {Int} the index of the node value or -1 if not found */ indexOf: function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "indexOf", 1046);-_yuitest_coverline("build/node-core/node-core.js", 1047);+ _yuitest_coverfunc("build/node-core/node-core.js", "indexOf", 1048);+_yuitest_coverline("build/node-core/node-core.js", 1049); return Y.Array.indexOf(this._nodes, Y.Node.getDOMNode(node)); }, @@ -1479,8 +1481,8 @@ * @see Selector */ filter: function(selector) {- _yuitest_coverfunc("build/node-core/node-core.js", "filter", 1057);-_yuitest_coverline("build/node-core/node-core.js", 1058);+ _yuitest_coverfunc("build/node-core/node-core.js", "filter", 1059);+_yuitest_coverline("build/node-core/node-core.js", 1060); return Y.all(Y.Selector.filter(this._nodes, selector)); }, @@ -1495,22 +1497,22 @@ * @return {NodeList} NodeList containing the updated collection */ modulus: function(n, r) {- _yuitest_coverfunc("build/node-core/node-core.js", "modulus", 1071);-_yuitest_coverline("build/node-core/node-core.js", 1072);+ _yuitest_coverfunc("build/node-core/node-core.js", "modulus", 1073);+_yuitest_coverline("build/node-core/node-core.js", 1074); r = r || 0;- _yuitest_coverline("build/node-core/node-core.js", 1073);+ _yuitest_coverline("build/node-core/node-core.js", 1075); var nodes = [];- _yuitest_coverline("build/node-core/node-core.js", 1074);+ _yuitest_coverline("build/node-core/node-core.js", 1076); NodeList.each(this, function(node, i) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 15)", 1074);-_yuitest_coverline("build/node-core/node-core.js", 1075);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 15)", 1076);+_yuitest_coverline("build/node-core/node-core.js", 1077); if (i % n === r) {- _yuitest_coverline("build/node-core/node-core.js", 1076);+ _yuitest_coverline("build/node-core/node-core.js", 1078); nodes.push(node); } }); - _yuitest_coverline("build/node-core/node-core.js", 1080);+ _yuitest_coverline("build/node-core/node-core.js", 1082); return Y.all(nodes); }, @@ -1521,8 +1523,8 @@ * @return {NodeList} NodeList containing the updated collection */ odd: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "odd", 1089);-_yuitest_coverline("build/node-core/node-core.js", 1090);+ _yuitest_coverfunc("build/node-core/node-core.js", "odd", 1091);+_yuitest_coverline("build/node-core/node-core.js", 1092); return this.modulus(2, 1); }, @@ -1533,8 +1535,8 @@ * @return {NodeList} NodeList containing the updated collection */ even: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "even", 1099);-_yuitest_coverline("build/node-core/node-core.js", 1100);+ _yuitest_coverfunc("build/node-core/node-core.js", "even", 1101);+_yuitest_coverline("build/node-core/node-core.js", 1102); return this.modulus(2); }, @@ -1547,29 +1549,29 @@ * @chainable */ refresh: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "refresh", 1111);-_yuitest_coverline("build/node-core/node-core.js", 1112);+ _yuitest_coverfunc("build/node-core/node-core.js", "refresh", 1113);+_yuitest_coverline("build/node-core/node-core.js", 1114); var doc, nodes = this._nodes, query = this._query, root = this._queryRoot; - _yuitest_coverline("build/node-core/node-core.js", 1117);+ _yuitest_coverline("build/node-core/node-core.js", 1119); if (query) {- _yuitest_coverline("build/node-core/node-core.js", 1118);+ _yuitest_coverline("build/node-core/node-core.js", 1120); if (!root) {- _yuitest_coverline("build/node-core/node-core.js", 1119);+ _yuitest_coverline("build/node-core/node-core.js", 1121); if (nodes && nodes[0] && nodes[0].ownerDocument) {- _yuitest_coverline("build/node-core/node-core.js", 1120);+ _yuitest_coverline("build/node-core/node-core.js", 1122); root = nodes[0].ownerDocument; } } - _yuitest_coverline("build/node-core/node-core.js", 1124);+ _yuitest_coverline("build/node-core/node-core.js", 1126); this._nodes = Y.Selector.query(query, root); } - _yuitest_coverline("build/node-core/node-core.js", 1127);+ _yuitest_coverline("build/node-core/node-core.js", 1129); return this; }, @@ -1579,8 +1581,8 @@ * @return {Int} The number of items in the NodeList. */ size: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "size", 1135);-_yuitest_coverline("build/node-core/node-core.js", 1136);+ _yuitest_coverfunc("build/node-core/node-core.js", "size", 1137);+_yuitest_coverline("build/node-core/node-core.js", 1138); return this._nodes.length; }, @@ -1590,44 +1592,44 @@ * @return {Boolean} Whether or not the NodeList is bound to any nodes */ isEmpty: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "isEmpty", 1144);-_yuitest_coverline("build/node-core/node-core.js", 1145);+ _yuitest_coverfunc("build/node-core/node-core.js", "isEmpty", 1146);+_yuitest_coverline("build/node-core/node-core.js", 1147); return this._nodes.length < 1; }, toString: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "toString", 1148);-_yuitest_coverline("build/node-core/node-core.js", 1149);+ _yuitest_coverfunc("build/node-core/node-core.js", "toString", 1150);+_yuitest_coverline("build/node-core/node-core.js", 1151); var str = '', errorMsg = this[UID] + ': not bound to any nodes', nodes = this._nodes, node; - _yuitest_coverline("build/node-core/node-core.js", 1154);+ _yuitest_coverline("build/node-core/node-core.js", 1156); if (nodes && nodes[0]) {- _yuitest_coverline("build/node-core/node-core.js", 1155);+ _yuitest_coverline("build/node-core/node-core.js", 1157); node = nodes[0];- _yuitest_coverline("build/node-core/node-core.js", 1156);+ _yuitest_coverline("build/node-core/node-core.js", 1158); str += node[NODE_NAME];- _yuitest_coverline("build/node-core/node-core.js", 1157);+ _yuitest_coverline("build/node-core/node-core.js", 1159); if (node.id) {- _yuitest_coverline("build/node-core/node-core.js", 1158);+ _yuitest_coverline("build/node-core/node-core.js", 1160); str += '#' + node.id; } - _yuitest_coverline("build/node-core/node-core.js", 1161);+ _yuitest_coverline("build/node-core/node-core.js", 1163); if (node.className) {- _yuitest_coverline("build/node-core/node-core.js", 1162);+ _yuitest_coverline("build/node-core/node-core.js", 1164); str += '.' + node.className.replace(' ', '.'); } - _yuitest_coverline("build/node-core/node-core.js", 1165);+ _yuitest_coverline("build/node-core/node-core.js", 1167); if (nodes.length > 1) {- _yuitest_coverline("build/node-core/node-core.js", 1166);+ _yuitest_coverline("build/node-core/node-core.js", 1168); str += '...[' + nodes.length + ' items]'; } }- _yuitest_coverline("build/node-core/node-core.js", 1169);+ _yuitest_coverline("build/node-core/node-core.js", 1171); return str || errorMsg; }, @@ -1637,13 +1639,13 @@ * @return {Array} */ getDOMNodes: function() {- _yuitest_coverfunc("build/node-core/node-core.js", "getDOMNodes", 1177);-_yuitest_coverline("build/node-core/node-core.js", 1178);+ _yuitest_coverfunc("build/node-core/node-core.js", "getDOMNodes", 1179);+_yuitest_coverline("build/node-core/node-core.js", 1180); return this._nodes; } }, true); -_yuitest_coverline("build/node-core/node-core.js", 1182);+_yuitest_coverline("build/node-core/node-core.js", 1184); NodeList.importMethod(Y.Node.prototype, [ /** * Called on each Node instance. Nulls internal node references, @@ -1697,10 +1699,10 @@ * @method get * @see Node */-_yuitest_coverline("build/node-core/node-core.js", 1235);+_yuitest_coverline("build/node-core/node-core.js", 1237); NodeList.prototype.get = function(attr) {- _yuitest_coverfunc("build/node-core/node-core.js", "get", 1235);-_yuitest_coverline("build/node-core/node-core.js", 1236);+ _yuitest_coverfunc("build/node-core/node-core.js", "get", 1237);+_yuitest_coverline("build/node-core/node-core.js", 1238); var ret = [], nodes = this._nodes, isNodeList = false,@@ -1708,65 +1710,65 @@ instance, val; - _yuitest_coverline("build/node-core/node-core.js", 1243);+ _yuitest_coverline("build/node-core/node-core.js", 1245); if (nodes[0]) {- _yuitest_coverline("build/node-core/node-core.js", 1244);+ _yuitest_coverline("build/node-core/node-core.js", 1246); instance = Y.Node._instances[nodes[0]._yuid] || getTemp(nodes[0]);- _yuitest_coverline("build/node-core/node-core.js", 1245);+ _yuitest_coverline("build/node-core/node-core.js", 1247); val = instance._get(attr);- _yuitest_coverline("build/node-core/node-core.js", 1246);+ _yuitest_coverline("build/node-core/node-core.js", 1248); if (val && val.nodeType) {- _yuitest_coverline("build/node-core/node-core.js", 1247);+ _yuitest_coverline("build/node-core/node-core.js", 1249); isNodeList = true; } } - _yuitest_coverline("build/node-core/node-core.js", 1251);+ _yuitest_coverline("build/node-core/node-core.js", 1253); Y.Array.each(nodes, function(node) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 16)", 1251);-_yuitest_coverline("build/node-core/node-core.js", 1252);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 16)", 1253);+_yuitest_coverline("build/node-core/node-core.js", 1254); instance = Y.Node._instances[node._yuid]; - _yuitest_coverline("build/node-core/node-core.js", 1254);+ _yuitest_coverline("build/node-core/node-core.js", 1256); if (!instance) {- _yuitest_coverline("build/node-core/node-core.js", 1255);+ _yuitest_coverline("build/node-core/node-core.js", 1257); instance = getTemp(node); } - _yuitest_coverline("build/node-core/node-core.js", 1258);+ _yuitest_coverline("build/node-core/node-core.js", 1260); val = instance._get(attr);- _yuitest_coverline("build/node-core/node-core.js", 1259);+ _yuitest_coverline("build/node-core/node-core.js", 1261); if (!isNodeList) { // convert array of Nodes to NodeList- _yuitest_coverline("build/node-core/node-core.js", 1260);+ _yuitest_coverline("build/node-core/node-core.js", 1262); val = Y.Node.scrubVal(val, instance); } - _yuitest_coverline("build/node-core/node-core.js", 1263);+ _yuitest_coverline("build/node-core/node-core.js", 1265); ret.push(val); }); - _yuitest_coverline("build/node-core/node-core.js", 1266);+ _yuitest_coverline("build/node-core/node-core.js", 1268); return (isNodeList) ? Y.all(ret) : ret; }; -_yuitest_coverline("build/node-core/node-core.js", 1269);+_yuitest_coverline("build/node-core/node-core.js", 1271); Y.NodeList = NodeList; -_yuitest_coverline("build/node-core/node-core.js", 1271);+_yuitest_coverline("build/node-core/node-core.js", 1273); Y.all = function(nodes) {- _yuitest_coverfunc("build/node-core/node-core.js", "all", 1271);-_yuitest_coverline("build/node-core/node-core.js", 1272);+ _yuitest_coverfunc("build/node-core/node-core.js", "all", 1273);+_yuitest_coverline("build/node-core/node-core.js", 1274); return new NodeList(nodes); }; -_yuitest_coverline("build/node-core/node-core.js", 1275);+_yuitest_coverline("build/node-core/node-core.js", 1277); Y.Node.all = Y.all; /** * @module node * @submodule node-core */ -_yuitest_coverline("build/node-core/node-core.js", 1281);+_yuitest_coverline("build/node-core/node-core.js", 1283); var Y_NodeList = Y.NodeList, ArrayProto = Array.prototype, ArrayMethods = {@@ -1827,37 +1829,37 @@ }; -_yuitest_coverline("build/node-core/node-core.js", 1341);+_yuitest_coverline("build/node-core/node-core.js", 1343); Y.Object.each(ArrayMethods, function(returnNodeList, name) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 17)", 1341);-_yuitest_coverline("build/node-core/node-core.js", 1342);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 17)", 1343);+_yuitest_coverline("build/node-core/node-core.js", 1344); Y_NodeList.prototype[name] = function() {- _yuitest_coverfunc("build/node-core/node-core.js", "]", 1342);-_yuitest_coverline("build/node-core/node-core.js", 1343);+ _yuitest_coverfunc("build/node-core/node-core.js", "]", 1344);+_yuitest_coverline("build/node-core/node-core.js", 1345); var args = [], i = 0, arg, ret; - _yuitest_coverline("build/node-core/node-core.js", 1348);+ _yuitest_coverline("build/node-core/node-core.js", 1350); while (typeof (arg = arguments[i++]) != 'undefined') { // use DOM nodes/nodeLists- _yuitest_coverline("build/node-core/node-core.js", 1349);+ _yuitest_coverline("build/node-core/node-core.js", 1351); args.push(arg._node || arg._nodes || arg); } - _yuitest_coverline("build/node-core/node-core.js", 1352);+ _yuitest_coverline("build/node-core/node-core.js", 1354); ret = ArrayProto[name].apply(this._nodes, args); - _yuitest_coverline("build/node-core/node-core.js", 1354);+ _yuitest_coverline("build/node-core/node-core.js", 1356); if (returnNodeList) {- _yuitest_coverline("build/node-core/node-core.js", 1355);+ _yuitest_coverline("build/node-core/node-core.js", 1357); ret = Y.all(ret); } else {- _yuitest_coverline("build/node-core/node-core.js", 1357);+ _yuitest_coverline("build/node-core/node-core.js", 1359); ret = Y.Node.scrubVal(ret); } - _yuitest_coverline("build/node-core/node-core.js", 1360);+ _yuitest_coverline("build/node-core/node-core.js", 1362); return ret; }; });@@ -1866,7 +1868,7 @@ * @submodule node-core */ -_yuitest_coverline("build/node-core/node-core.js", 1368);+_yuitest_coverline("build/node-core/node-core.js", 1370); Y.Array.each([ /** * Passes through to DOM method.@@ -1962,13 +1964,13 @@ 'createCaption' ], function(method) {- _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 18)", 1462);-_yuitest_coverline("build/node-core/node-core.js", 1463);+ _yuitest_coverfunc("build/node-core/node-core.js", "(anonymous 18)", 1464);+_yuitest_coverline("build/node-core/node-core.js", 1465); Y.Node.prototype[method] = function(arg1, arg2, arg3) {- _yuitest_coverfunc("build/node-core/node-core.js", "]", 1463);-_yuitest_coverline("build/node-core/node-core.js", 1464);+ _yuitest_coverfunc("build/node-core/node-core.js", "]", 1465);+_yuitest_coverline("build/node-core/node-core.js", 1466); var ret = this.invoke(method, arg1, arg2, arg3);- _yuitest_coverline("build/node-core/node-core.js", 1465);+ _yuitest_coverline("build/node-core/node-core.js", 1467); return ret; }; });@@ -1980,22 +1982,22 @@ * @chainable */ // one-off implementation due to IE returning boolean, breaking chaining-_yuitest_coverline("build/node-core/node-core.js", 1476);+_yuitest_coverline("build/node-core/node-core.js", 1478); Y.Node.prototype.removeAttribute = function(attr) {- _yuitest_coverfunc("build/node-core/node-core.js", "removeAttribute", 1476);-_yuitest_coverline("build/node-core/node-core.js", 1477);+ _yuitest_coverfunc("build/node-core/node-core.js", "removeAttribute", 1478);+_yuitest_coverline("build/node-core/node-core.js", 1479); var node = this._node;- _yuitest_coverline("build/node-core/node-core.js", 1478);+ _yuitest_coverline("build/node-core/node-core.js", 1480); if (node) {- _yuitest_coverline("build/node-core/node-core.js", 1479);+ _yuitest_coverline("build/node-core/node-core.js", 1481); node.removeAttribute(attr, 0); // comma zero for IE < 8 to force case-insensitive } - _yuitest_coverline("build/node-core/node-core.js", 1482);+ _yuitest_coverline("build/node-core/node-core.js", 1484); return this; }; -_yuitest_coverline("build/node-core/node-core.js", 1485);+_yuitest_coverline("build/node-core/node-core.js", 1487); Y.Node.importMethod(Y.DOM, [ /** * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.@@ -2048,7 +2050,7 @@ 'generateID' ]); -_yuitest_coverline("build/node-core/node-core.js", 1537);+_yuitest_coverline("build/node-core/node-core.js", 1539); Y.NodeList.importMethod(Y.Node.prototype, [ /** * Allows getting attributes on DOM nodes, normalizing in some cases.@@ -2105,4 +2107,4 @@ ]); -}, '3.7.2', {"requires": ["dom-core", "selector"]});+}, '3.7.3', {"requires": ["dom-core", "selector"]});
bundle/node-core/node-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -714,7 +714,9 @@ }, /**- * Nulls internal node references, removes any plugins and event listeners+ * Nulls internal node references, removes any plugins and event listeners.+ * Note that destroy() will not remove the node from its parent or from the DOM. For that+ * functionality, call remove(true). * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false)@@ -1600,4 +1602,4 @@ ]); -}, '3.7.2', {"requires": ["dom-core", "selector"]});+}, '3.7.3', {"requires": ["dom-core", "selector"]});
bundle/node-core/node-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-core",function(e,t){var n=".",r="nodeName",i="nodeType",s="ownerDocument",o="tagName",u="_yuid",a={},f=Array.prototype.slice,l=e.DOM,c=function(t){if(!this.getDOMNode)return new c(t);if(typeof t=="string"){t=c._fromString(t);if(!t)return null}var n=t.nodeType!==9?t.uniqueID:t[u];n&&c._instances[n]&&c._instances[n]._node!==t&&(t[u]=null),n=n||e.stamp(t),n||(n=e.guid()),this[u]=n,this._node=t,this._stateProxy=t,this._initPlugins&&this._initPlugins()},h=function(t){var n=null;return t&&(n=typeof t=="string"?function(n){return e.Selector.test(n,t)}:function(n){return t(e.one(n))}),n};c.ATTRS={},c.DOM_EVENTS={},c._fromString=function(t){return t&&(t.indexOf("doc")===0?t=e.config.doc:t.indexOf("win")===0?t=e.config.win:t=e.Selector.query(t,null,!0)),t||null},c.NAME="node",c.re_aria=/^(?:role$|aria-)/,c.SHOW_TRANSITION="fadeIn",c.HIDE_TRANSITION="fadeOut",c._instances={},c.getDOMNode=function(e){return e?e.nodeType?e:e._node||null:null},c.scrubVal=function(t,n){if(t){if(typeof t=="object"||typeof t=="function")if(i in t||l.isWindow(t))t=e.one(t);else if(t.item&&!t._nodes||t[0]&&t[0][i])t=e.all(t)}else typeof t=="undefined"?t=n:t===null&&(t=null);return t},c.addMethod=function(e,t,n){e&&t&&typeof t=="function"&&(c.prototype[e]=function(){var e=f.call(arguments),n=this,r;return e[0]&&e[0]._node&&(e[0]=e[0]._node),e[1]&&e[1]._node&&(e[1]=e[1]._node),e.unshift(n._node),r=t.apply(n,e),r&&(r=c.scrubVal(r,n)),typeof r!="undefined"||(r=n),r})},c.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,c.addMethod(r,t[n],t)):e.Array.each(n,function(e){c.importMethod(t,e)})},c.one=function(t){var n=null,r,i;if(t){if(typeof t=="string"){t=c._fromString(t);if(!t)return null}else if(t.getDOMNode)return t;if(t.nodeType||e.DOM.isWindow(t)){i=t.uniqueID&&t.nodeType!==9?t.uniqueID:t._yuid,n=c._instances[i],r=n?n._node:null;if(!n||r&&t!==r)n=new c(t),t.nodeType!=11&&(c._instances[n[u]]=n)}}return n},c.DEFAULT_SETTER=function(t,r){var i=this._stateProxy,s;return t.indexOf(n)>-1?(s=t,t=t.split(n),e.Object.setValue(i,t,r)):typeof i[t]!="undefined"&&(i[t]=r),r},c.DEFAULT_GETTER=function(t){var r=this._stateProxy,i;return t.indexOf&&t.indexOf(n)>-1?i=e.Object.getValue(r,t.split(n)):typeof r[t]!="undefined"&&(i=r[t]),i},e.mix(c.prototype,{DATA_PREFIX:"data-",toString:function(){var e=this[u]+": not bound to a node",t=this._node,n,i,s;return t&&(n=t.attributes,i=n&&n.id?t.getAttribute("id"):null,s=n&&n.className?t.getAttribute("className"):null,e=t[r],i&&(e+="#"+i),s&&(e+="."+s.replace(" ",".")),e+=" "+this[u]),e},get:function(e){var t;return this._getAttr?t=this._getAttr(e):t=this._get(e),t?t=c.scrubVal(t,this):t===null&&(t=null),t},_get:function(e){var t=c.ATTRS[e],n;return t&&t.getter?n=t.getter.call(this):c.re_aria.test(e)?n=this._node.getAttribute(e,2):n=c.DEFAULT_GETTER.apply(this,arguments),n},set:function(e,t){var n=c.ATTRS[e];return this._setAttr?this._setAttr.apply(this,arguments):n&&n.setter?n.setter.call(this,t,e):c.re_aria.test(e)?this._node.setAttribute(e,t):c.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(t){return this._setAttrs?this._setAttrs(t):e.Object.each(t,function(e,t){this.set(t,e)},this),this},getAttrs:function(t){var n={};return this._getAttrs?this._getAttrs(t):e.Array.each(t,function(e,t){n[e]=this.get(e)},this),n},compareTo:function(e){var t=this._node;return e&&e._node&&(e=e._node),t===e},inDoc:function(e){var t=this._node;e=e?e._node||e:t[s];if(e.documentElement)return l.contains(e.documentElement,t)},getById:function(t){var n=this._node,r=l.byId(t,n[s]);return r&&l.contains(n,r)?r=e.one(r):r=null,r},ancestor:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.one(l.ancestor(this._node,h(t),n,h(r)))},ancestors:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.all(l.ancestors(this._node,h(t),n,h(r)))},previous:function(t,n){return e.one(l.elementByAxis(this._node,"previousSibling",h(t),n))},next:function(t,n){return e.one(l.elementByAxis(this._node,"nextSibling",h(t),n))},siblings:function(t){return e.all(l.siblings(this._node,h(t)))},one:function(t){return e.one(e.Selector.query(t,this._node,!0))},all:function(t){var n=e.all(e.Selector.query(t,this._node));return n._query=t,n._queryRoot=this._node,n},test:function(t){return e.Selector.test(this._node,t)},remove:function(e){var t=this._node;return t&&t.parentNode&&t.parentNode.removeChild(t),e&&this.destroy(),this},replace:function(e){var t=this._node;return typeof e=="string"&&(e=c.create(e)),t.parentNode.replaceChild(c.getDOMNode(e),t),this},replaceChild:function(t,n){return typeof t=="string"&&(t=l.create(t)),e.one(this._node.replaceChild(c.getDOMNode(t),c.getDOMNode(n)))},destroy:function(t){var n=e.config.doc.uniqueID?"uniqueID":"_yuid",r;this.purge(),this.unplug&&this.unplug(),this.clearData(),t&&e.NodeList.each(this.all("*"),function(t){r=c._instances[t[n]],r?r.destroy():e.Event.purgeElement(t)}),this._node=null,this._stateProxy=null,delete c._instances[this._yuid]},invoke:function(e,t,n,r,i,s){var o=this._node,u;return t&&t._node&&(t=t._node),n&&n._node&&(n=n._node),u=o[e](t,n,r,i,s),c.scrubVal(u,this)},swap:e.config.doc.documentElement.swapNode?function(e){this._node.swapNode(c.getDOMNode(e))}:function(e){e=c.getDOMNode(e);var t=this._node,n=e.parentNode,r=e.nextSibling;return r===t?n.insertBefore(t,e):e===t.nextSibling?n.insertBefore(e,t):(t.parentNode.replaceChild(e,t),l.addHTML(n,t,r)),this},hasMethod:function(e){var t=this._node;return!(!(t&&e in t&&typeof t[e]!="unknown")||typeof t[e]!="function"&&String(t[e]).indexOf("function")!==1)},isFragment:function(){return this.get("nodeType")===11},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),e.Node=c,e.one=c.one;var p=function(t){var n=[];t&&(typeof t=="string"?(this._query=t,t=e.Selector.query(t)):t.nodeType||l.isWindow(t)?t=[t]:t._node?t=[t._node]:t[0]&&t[0]._node?(e.Array.each(t,function(e){e._node&&n.push(e._node)}),t=n):t=e.Array(t,0,!0)),this._nodes=t||[]};p.NAME="NodeList",p.getDOMNodes=function(e){return e&&e._nodes?e._nodes:e},p.each=function(t,n,r){var i=t._nodes;i&&i.length&&e.Array.each(i,n,r||t)},p.addMethod=function(t,n,r){t&&n&&(p.prototype[t]=function(){var t=[],i=arguments;return e.Array.each(this._nodes,function(s){var o=s.uniqueID&&s.nodeType!==9?"uniqueID":"_yuid",u=e.Node._instances[s[o]],a,f;u||(u=p._getTempNode(s)),a=r||u,f=n.apply(a,i),f!==undefined&&f!==u&&(t[t.length]=f)}),t.length?t:this})},p.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,p.addMethod(n,t[n])):e.Array.each(n,function(e){p.importMethod(t,e)})},p._getTempNode=function(t){var n=p._tempNode;return n||(n=e.Node.create("<div></div>"),p._tempNode=n),n._node=t,n._stateProxy=t,n},e.mix(p.prototype,{_invoke:function(e,t,n){var r=n?[]:this;return this.each(function(i){var s=i[e].apply(i,t);n&&r.push(s)}),r},item:function(t){return e.one((this._nodes||[])[t])},each:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){return i=e.one(i),t.call(n||i,i,s,r)}),r},batch:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){var o=e.Node._instances[i[u]];return o||(o=p._getTempNode(i)),t.call(n||o,o,s,r)}),r},some:function(t,n){var r=this;return e.Array.some(this._nodes,function(i,s){return i=e.one(i),n=n||i,t.call(n,i,s,r)})},toFrag:function(){return e.one(e.DOM._nl2frag(this._nodes))},indexOf:function(t){return e.Array.indexOf(this._nodes,e.Node.getDOMNode(t))},filter:function(t){return e.all(e.Selector.filter(this._nodes,t))},modulus:function(t,n){n=n||0;var r=[];return p.each(this,function(e,i){i%t===n&&r.push(e)}),e.all(r)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var t,n=this._nodes,r=this._query,i=this._queryRoot;return r&&(i||n&&n[0]&&n[0].ownerDocument&&(i=n[0].ownerDocument),this._nodes=e.Selector.query(r,i)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e="",t=this[u]+": not bound to any nodes",n=this._nodes,i;return n&&n[0]&&(i=n[0],e+=i[r],i.id&&(e+="#"+i.id),i.className&&(e+="."+i.className.replace(" ",".")),n.length>1&&(e+="...["+n.length+" items]")),e||t},getDOMNodes:function(){return this._nodes}},!0),p.importMethod(e.Node.prototype,["destroy","empty","remove","set"]),p.prototype.get=function(t){var n=[],r=this._nodes,i=!1,s=p._getTempNode,o,u;return r[0]&&(o=e.Node._instances[r[0]._yuid]||s(r[0]),u=o._get(t),u&&u.nodeType&&(i=!0)),e.Array.each(r,function(r){o=e.Node._instances[r._yuid],o||(o=s(r)),u=o._get(t),i||(u=e.Node.scrubVal(u,o)),n.push(u)}),i?e.all(n):n},e.NodeList=p,e.all=function(e){return new p(e)},e.Node.all=e.all;var d=e.NodeList,v=Array.prototype,m={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};e.Object.each(m,function(t,n){d.prototype[n]=function(){var r=[],i=0,s,o;while(typeof (s=arguments[i++])!="undefined")r.push(s._node||s._nodes||s);return o=v[n].apply(this._nodes,r),t?o=e.all(o):o=e.Node.scrubVal(o),o}}),e.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(t){e.Node.prototype[t]=function(e,n,r){var i=this.invoke(t,e,n,r);return i}}),e.Node.prototype.removeAttribute=function(e){var t=this._node;return t&&t.removeAttribute(e,0),this},e.Node.importMethod(e.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),e.NodeList.importMethod(e.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"3.7.2",{requires:["dom-core","selector"]});+YUI.add("node-core",function(e,t){var n=".",r="nodeName",i="nodeType",s="ownerDocument",o="tagName",u="_yuid",a={},f=Array.prototype.slice,l=e.DOM,c=function(t){if(!this.getDOMNode)return new c(t);if(typeof t=="string"){t=c._fromString(t);if(!t)return null}var n=t.nodeType!==9?t.uniqueID:t[u];n&&c._instances[n]&&c._instances[n]._node!==t&&(t[u]=null),n=n||e.stamp(t),n||(n=e.guid()),this[u]=n,this._node=t,this._stateProxy=t,this._initPlugins&&this._initPlugins()},h=function(t){var n=null;return t&&(n=typeof t=="string"?function(n){return e.Selector.test(n,t)}:function(n){return t(e.one(n))}),n};c.ATTRS={},c.DOM_EVENTS={},c._fromString=function(t){return t&&(t.indexOf("doc")===0?t=e.config.doc:t.indexOf("win")===0?t=e.config.win:t=e.Selector.query(t,null,!0)),t||null},c.NAME="node",c.re_aria=/^(?:role$|aria-)/,c.SHOW_TRANSITION="fadeIn",c.HIDE_TRANSITION="fadeOut",c._instances={},c.getDOMNode=function(e){return e?e.nodeType?e:e._node||null:null},c.scrubVal=function(t,n){if(t){if(typeof t=="object"||typeof t=="function")if(i in t||l.isWindow(t))t=e.one(t);else if(t.item&&!t._nodes||t[0]&&t[0][i])t=e.all(t)}else typeof t=="undefined"?t=n:t===null&&(t=null);return t},c.addMethod=function(e,t,n){e&&t&&typeof t=="function"&&(c.prototype[e]=function(){var e=f.call(arguments),n=this,r;return e[0]&&e[0]._node&&(e[0]=e[0]._node),e[1]&&e[1]._node&&(e[1]=e[1]._node),e.unshift(n._node),r=t.apply(n,e),r&&(r=c.scrubVal(r,n)),typeof r!="undefined"||(r=n),r})},c.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,c.addMethod(r,t[n],t)):e.Array.each(n,function(e){c.importMethod(t,e)})},c.one=function(t){var n=null,r,i;if(t){if(typeof t=="string"){t=c._fromString(t);if(!t)return null}else if(t.getDOMNode)return t;if(t.nodeType||e.DOM.isWindow(t)){i=t.uniqueID&&t.nodeType!==9?t.uniqueID:t._yuid,n=c._instances[i],r=n?n._node:null;if(!n||r&&t!==r)n=new c(t),t.nodeType!=11&&(c._instances[n[u]]=n)}}return n},c.DEFAULT_SETTER=function(t,r){var i=this._stateProxy,s;return t.indexOf(n)>-1?(s=t,t=t.split(n),e.Object.setValue(i,t,r)):typeof i[t]!="undefined"&&(i[t]=r),r},c.DEFAULT_GETTER=function(t){var r=this._stateProxy,i;return t.indexOf&&t.indexOf(n)>-1?i=e.Object.getValue(r,t.split(n)):typeof r[t]!="undefined"&&(i=r[t]),i},e.mix(c.prototype,{DATA_PREFIX:"data-",toString:function(){var e=this[u]+": not bound to a node",t=this._node,n,i,s;return t&&(n=t.attributes,i=n&&n.id?t.getAttribute("id"):null,s=n&&n.className?t.getAttribute("className"):null,e=t[r],i&&(e+="#"+i),s&&(e+="."+s.replace(" ",".")),e+=" "+this[u]),e},get:function(e){var t;return this._getAttr?t=this._getAttr(e):t=this._get(e),t?t=c.scrubVal(t,this):t===null&&(t=null),t},_get:function(e){var t=c.ATTRS[e],n;return t&&t.getter?n=t.getter.call(this):c.re_aria.test(e)?n=this._node.getAttribute(e,2):n=c.DEFAULT_GETTER.apply(this,arguments),n},set:function(e,t){var n=c.ATTRS[e];return this._setAttr?this._setAttr.apply(this,arguments):n&&n.setter?n.setter.call(this,t,e):c.re_aria.test(e)?this._node.setAttribute(e,t):c.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(t){return this._setAttrs?this._setAttrs(t):e.Object.each(t,function(e,t){this.set(t,e)},this),this},getAttrs:function(t){var n={};return this._getAttrs?this._getAttrs(t):e.Array.each(t,function(e,t){n[e]=this.get(e)},this),n},compareTo:function(e){var t=this._node;return e&&e._node&&(e=e._node),t===e},inDoc:function(e){var t=this._node;e=e?e._node||e:t[s];if(e.documentElement)return l.contains(e.documentElement,t)},getById:function(t){var n=this._node,r=l.byId(t,n[s]);return r&&l.contains(n,r)?r=e.one(r):r=null,r},ancestor:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.one(l.ancestor(this._node,h(t),n,h(r)))},ancestors:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.all(l.ancestors(this._node,h(t),n,h(r)))},previous:function(t,n){return e.one(l.elementByAxis(this._node,"previousSibling",h(t),n))},next:function(t,n){return e.one(l.elementByAxis(this._node,"nextSibling",h(t),n))},siblings:function(t){return e.all(l.siblings(this._node,h(t)))},one:function(t){return e.one(e.Selector.query(t,this._node,!0))},all:function(t){var n=e.all(e.Selector.query(t,this._node));return n._query=t,n._queryRoot=this._node,n},test:function(t){return e.Selector.test(this._node,t)},remove:function(e){var t=this._node;return t&&t.parentNode&&t.parentNode.removeChild(t),e&&this.destroy(),this},replace:function(e){var t=this._node;return typeof e=="string"&&(e=c.create(e)),t.parentNode.replaceChild(c.getDOMNode(e),t),this},replaceChild:function(t,n){return typeof t=="string"&&(t=l.create(t)),e.one(this._node.replaceChild(c.getDOMNode(t),c.getDOMNode(n)))},destroy:function(t){var n=e.config.doc.uniqueID?"uniqueID":"_yuid",r;this.purge(),this.unplug&&this.unplug(),this.clearData(),t&&e.NodeList.each(this.all("*"),function(t){r=c._instances[t[n]],r?r.destroy():e.Event.purgeElement(t)}),this._node=null,this._stateProxy=null,delete c._instances[this._yuid]},invoke:function(e,t,n,r,i,s){var o=this._node,u;return t&&t._node&&(t=t._node),n&&n._node&&(n=n._node),u=o[e](t,n,r,i,s),c.scrubVal(u,this)},swap:e.config.doc.documentElement.swapNode?function(e){this._node.swapNode(c.getDOMNode(e))}:function(e){e=c.getDOMNode(e);var t=this._node,n=e.parentNode,r=e.nextSibling;return r===t?n.insertBefore(t,e):e===t.nextSibling?n.insertBefore(e,t):(t.parentNode.replaceChild(e,t),l.addHTML(n,t,r)),this},hasMethod:function(e){var t=this._node;return!(!(t&&e in t&&typeof t[e]!="unknown")||typeof t[e]!="function"&&String(t[e]).indexOf("function")!==1)},isFragment:function(){return this.get("nodeType")===11},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),e.Node=c,e.one=c.one;var p=function(t){var n=[];t&&(typeof t=="string"?(this._query=t,t=e.Selector.query(t)):t.nodeType||l.isWindow(t)?t=[t]:t._node?t=[t._node]:t[0]&&t[0]._node?(e.Array.each(t,function(e){e._node&&n.push(e._node)}),t=n):t=e.Array(t,0,!0)),this._nodes=t||[]};p.NAME="NodeList",p.getDOMNodes=function(e){return e&&e._nodes?e._nodes:e},p.each=function(t,n,r){var i=t._nodes;i&&i.length&&e.Array.each(i,n,r||t)},p.addMethod=function(t,n,r){t&&n&&(p.prototype[t]=function(){var t=[],i=arguments;return e.Array.each(this._nodes,function(s){var o=s.uniqueID&&s.nodeType!==9?"uniqueID":"_yuid",u=e.Node._instances[s[o]],a,f;u||(u=p._getTempNode(s)),a=r||u,f=n.apply(a,i),f!==undefined&&f!==u&&(t[t.length]=f)}),t.length?t:this})},p.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,p.addMethod(n,t[n])):e.Array.each(n,function(e){p.importMethod(t,e)})},p._getTempNode=function(t){var n=p._tempNode;return n||(n=e.Node.create("<div></div>"),p._tempNode=n),n._node=t,n._stateProxy=t,n},e.mix(p.prototype,{_invoke:function(e,t,n){var r=n?[]:this;return this.each(function(i){var s=i[e].apply(i,t);n&&r.push(s)}),r},item:function(t){return e.one((this._nodes||[])[t])},each:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){return i=e.one(i),t.call(n||i,i,s,r)}),r},batch:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){var o=e.Node._instances[i[u]];return o||(o=p._getTempNode(i)),t.call(n||o,o,s,r)}),r},some:function(t,n){var r=this;return e.Array.some(this._nodes,function(i,s){return i=e.one(i),n=n||i,t.call(n,i,s,r)})},toFrag:function(){return e.one(e.DOM._nl2frag(this._nodes))},indexOf:function(t){return e.Array.indexOf(this._nodes,e.Node.getDOMNode(t))},filter:function(t){return e.all(e.Selector.filter(this._nodes,t))},modulus:function(t,n){n=n||0;var r=[];return p.each(this,function(e,i){i%t===n&&r.push(e)}),e.all(r)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var t,n=this._nodes,r=this._query,i=this._queryRoot;return r&&(i||n&&n[0]&&n[0].ownerDocument&&(i=n[0].ownerDocument),this._nodes=e.Selector.query(r,i)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e="",t=this[u]+": not bound to any nodes",n=this._nodes,i;return n&&n[0]&&(i=n[0],e+=i[r],i.id&&(e+="#"+i.id),i.className&&(e+="."+i.className.replace(" ",".")),n.length>1&&(e+="...["+n.length+" items]")),e||t},getDOMNodes:function(){return this._nodes}},!0),p.importMethod(e.Node.prototype,["destroy","empty","remove","set"]),p.prototype.get=function(t){var n=[],r=this._nodes,i=!1,s=p._getTempNode,o,u;return r[0]&&(o=e.Node._instances[r[0]._yuid]||s(r[0]),u=o._get(t),u&&u.nodeType&&(i=!0)),e.Array.each(r,function(r){o=e.Node._instances[r._yuid],o||(o=s(r)),u=o._get(t),i||(u=e.Node.scrubVal(u,o)),n.push(u)}),i?e.all(n):n},e.NodeList=p,e.all=function(e){return new p(e)},e.Node.all=e.all;var d=e.NodeList,v=Array.prototype,m={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};e.Object.each(m,function(t,n){d.prototype[n]=function(){var r=[],i=0,s,o;while(typeof (s=arguments[i++])!="undefined")r.push(s._node||s._nodes||s);return o=v[n].apply(this._nodes,r),t?o=e.all(o):o=e.Node.scrubVal(o),o}}),e.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(t){e.Node.prototype[t]=function(e,n,r){var i=this.invoke(t,e,n,r);return i}}),e.Node.prototype.removeAttribute=function(e){var t=this._node;return t&&t.removeAttribute(e,0),this},e.Node.importMethod(e.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),e.NodeList.importMethod(e.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"3.7.3",{requires:["dom-core","selector"]});
bundle/node-core/node-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -713,7 +713,9 @@ }, /**- * Nulls internal node references, removes any plugins and event listeners+ * Nulls internal node references, removes any plugins and event listeners.+ * Note that destroy() will not remove the node from its parent or from the DOM. For that+ * functionality, call remove(true). * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false)@@ -1596,4 +1598,4 @@ ]); -}, '3.7.2', {"requires": ["dom-core", "selector"]});+}, '3.7.3', {"requires": ["dom-core", "selector"]});
bundle/node-deprecated/node-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-deprecated/node-deprecated.js", code: [] };-_yuitest_coverage["build/node-deprecated/node-deprecated.js"].code=["YUI.add('node-deprecated', function (Y, NAME) {","","/**"," * @module node"," * @submodule node-deprecated"," * @deprecated"," */","","var Y_Node = Y.Node;","","/*"," * Flat data store for off-DOM usage"," * @config data"," * @type any"," * @deprecated Use getData/setData"," * @for Node"," */","Y_Node.ATTRS.data = {"," getter: function() {"," return this._dataVal;"," },"," setter: function(val) {"," this._dataVal = val;"," return val;"," },"," value: null","};","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector."," * @method get"," * @for YUI"," * @deprecated Use Y.one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc."," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector."," * @method get"," * @for Node"," * @deprecated Use Y.one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc."," */","Y.get = Y_Node.get = function() {"," return Y_Node.one.apply(Y_Node, arguments);","};","","","Y.mix(Y_Node.prototype, {"," /**"," * Retrieves a Node instance of nodes based on the given CSS selector."," * @method query"," * @deprecated Use one()"," * @param {string} selector The CSS selector to test against."," * @return {Node} A Node instance for the matching HTMLElement."," */"," query: function(selector) {"," return this.one(selector);"," },",""," /**"," * Retrieves a nodeList based on the given CSS selector."," * @method queryAll"," * @deprecated Use all()"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," */"," queryAll: function(selector) {"," return this.all(selector);"," },",""," /**"," * Applies the given function to each Node in the NodeList."," * @method each"," * @deprecated Use NodeList"," * @param {Function} fn The function to apply"," * @param {Object} context optional An optional context to apply the function with"," * Default context is the NodeList instance"," * @chainable"," */"," each: function(fn, context) {"," context = context || this;"," return fn.call(context, this);"," },",""," /**"," * Retrieves the Node instance at the given index."," * @method item"," * @deprecated Use NodeList"," *"," * @param {Number} index The index of the target Node."," * @return {Node} The Node instance at the given index."," */"," item: function(index) {"," return this;"," },",""," /**"," * Returns the current number of items in the Node."," * @method size"," * @deprecated Use NodeList"," * @return {Int} The number of items in the Node."," */"," size: function() {"," return this._node ? 1 : 0;"," }","","});","","","","","}, '3.7.2', {\"requires\": [\"node-base\"]});"];+_yuitest_coverage["build/node-deprecated/node-deprecated.js"].code=["YUI.add('node-deprecated', function (Y, NAME) {","","/**"," * @module node"," * @submodule node-deprecated"," * @deprecated"," */","","var Y_Node = Y.Node;","","/*"," * Flat data store for off-DOM usage"," * @config data"," * @type any"," * @deprecated Use getData/setData"," * @for Node"," */","Y_Node.ATTRS.data = {"," getter: function() {"," return this._dataVal;"," },"," setter: function(val) {"," this._dataVal = val;"," return val;"," },"," value: null","};","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector."," * @method get"," * @for YUI"," * @deprecated Use Y.one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc."," */","","/**"," * Returns a single Node instance bound to the node or the"," * first element matching the given selector."," * @method get"," * @for Node"," * @deprecated Use Y.one"," * @static"," * @param {String | HTMLElement} node a node or Selector"," * @param {Node | HTMLElement} doc an optional document to scan. Defaults to Y.config.doc."," */","Y.get = Y_Node.get = function() {"," return Y_Node.one.apply(Y_Node, arguments);","};","","","Y.mix(Y_Node.prototype, {"," /**"," * Retrieves a Node instance of nodes based on the given CSS selector."," * @method query"," * @deprecated Use one()"," * @param {string} selector The CSS selector to test against."," * @return {Node} A Node instance for the matching HTMLElement."," */"," query: function(selector) {"," return this.one(selector);"," },",""," /**"," * Retrieves a nodeList based on the given CSS selector."," * @method queryAll"," * @deprecated Use all()"," * @param {string} selector The CSS selector to test against."," * @return {NodeList} A NodeList instance for the matching HTMLCollection/Array."," */"," queryAll: function(selector) {"," return this.all(selector);"," },",""," /**"," * Applies the given function to each Node in the NodeList."," * @method each"," * @deprecated Use NodeList"," * @param {Function} fn The function to apply"," * @param {Object} context optional An optional context to apply the function with"," * Default context is the NodeList instance"," * @chainable"," */"," each: function(fn, context) {"," context = context || this;"," return fn.call(context, this);"," },",""," /**"," * Retrieves the Node instance at the given index."," * @method item"," * @deprecated Use NodeList"," *"," * @param {Number} index The index of the target Node."," * @return {Node} The Node instance at the given index."," */"," item: function(index) {"," return this;"," },",""," /**"," * Returns the current number of items in the Node."," * @method size"," * @deprecated Use NodeList"," * @return {Int} The number of items in the Node."," */"," size: function() {"," return this._node ? 1 : 0;"," }","","});","","","","","}, '3.7.3', {\"requires\": [\"node-base\"]});"]; _yuitest_coverage["build/node-deprecated/node-deprecated.js"].lines = {"1":0,"9":0,"18":0,"20":0,"23":0,"24":0,"50":0,"51":0,"55":0,"64":0,"75":0,"88":0,"89":0,"101":0,"111":0}; _yuitest_coverage["build/node-deprecated/node-deprecated.js"].functions = {"getter:19":0,"setter:22":0,"get:50":0,"query:63":0,"queryAll:74":0,"each:87":0,"item:100":0,"size:110":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-deprecated/node-deprecated.js"].coveredLines = 15;@@ -179,4 +179,4 @@ -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/node-deprecated/node-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -128,4 +128,4 @@ -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/node-deprecated/node-deprecated-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-deprecated",function(e,t){var n=e.Node;n.ATTRS.data={getter:function(){return this._dataVal},setter:function(e){return this._dataVal=e,e},value:null},e.get=n.get=function(){return n.one.apply(n,arguments)},e.mix(n.prototype,{query:function(e){return this.one(e)},queryAll:function(e){return this.all(e)},each:function(e,t){return t=t||this,e.call(t,this)},item:function(e){return this},size:function(){return this._node?1:0}})},"3.7.2",{requires:["node-base"]});+YUI.add("node-deprecated",function(e,t){var n=e.Node;n.ATTRS.data={getter:function(){return this._dataVal},setter:function(e){return this._dataVal=e,e},value:null},e.get=n.get=function(){return n.one.apply(n,arguments)},e.mix(n.prototype,{query:function(e){return this.one(e)},queryAll:function(e){return this.all(e)},each:function(e,t){return t=t||this,e.call(t,this)},item:function(e){return this},size:function(){return this._node?1:0}})},"3.7.3",{requires:["node-base"]});
bundle/node-deprecated/node-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -122,4 +122,4 @@ -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/node-event-delegate/node-event-delegate-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-event-delegate/node-event-delegate.js", code: [] };-_yuitest_coverage["build/node-event-delegate/node-event-delegate.js"].code=["YUI.add('node-event-delegate', function (Y, NAME) {","","/**"," * Functionality to make the node a delegated event container"," * @module node"," * @submodule node-event-delegate"," */","","/**"," * <p>Sets up a delegation listener for an event occurring inside the Node."," * The delegated event will be verified against a supplied selector or"," * filtering function to test if the event references at least one node that"," * should trigger the subscription callback.</p>"," *"," * <p>Selector string filters will trigger the callback if the event originated"," * from a node that matches it or is contained in a node that matches it."," * Function filters are called for each Node up the parent axis to the"," * subscribing container node, and receive at each level the Node and the event"," * object. The function should return true (or a truthy value) if that Node"," * should trigger the subscription callback. Note, it is possible for filters"," * to match multiple Nodes for a single event. In this case, the delegate"," * callback will be executed for each matching Node.</p>"," *"," * <p>For each matching Node, the callback will be executed with its 'this'"," * object set to the Node matched by the filter (unless a specific context was"," * provided during subscription), and the provided event's"," * <code>currentTarget</code> will also be set to the matching Node. The"," * containing Node from which the subscription was originally made can be"," * referenced as <code>e.container</code>."," *"," * @method delegate"," * @param type {String} the event type to delegate"," * @param fn {Function} the callback function to execute. This function"," * will be provided the event object for the delegated event."," * @param spec {String|Function} a selector that must match the target of the"," * event or a function to test target and its parents for a match"," * @param context {Object} optional argument that specifies what 'this' refers to."," * @param args* {any} 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for Node"," */","Y.Node.prototype.delegate = function(type) {",""," var args = Y.Array(arguments, 0, true),"," index = (Y.Lang.isObject(type) && !Y.Lang.isArray(type)) ? 1 : 2;",""," args.splice(index, 0, this._node);",""," return Y.delegate.apply(Y, args);","};","","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-delegate\"]});"];+_yuitest_coverage["build/node-event-delegate/node-event-delegate.js"].code=["YUI.add('node-event-delegate', function (Y, NAME) {","","/**"," * Functionality to make the node a delegated event container"," * @module node"," * @submodule node-event-delegate"," */","","/**"," * <p>Sets up a delegation listener for an event occurring inside the Node."," * The delegated event will be verified against a supplied selector or"," * filtering function to test if the event references at least one node that"," * should trigger the subscription callback.</p>"," *"," * <p>Selector string filters will trigger the callback if the event originated"," * from a node that matches it or is contained in a node that matches it."," * Function filters are called for each Node up the parent axis to the"," * subscribing container node, and receive at each level the Node and the event"," * object. The function should return true (or a truthy value) if that Node"," * should trigger the subscription callback. Note, it is possible for filters"," * to match multiple Nodes for a single event. In this case, the delegate"," * callback will be executed for each matching Node.</p>"," *"," * <p>For each matching Node, the callback will be executed with its 'this'"," * object set to the Node matched by the filter (unless a specific context was"," * provided during subscription), and the provided event's"," * <code>currentTarget</code> will also be set to the matching Node. The"," * containing Node from which the subscription was originally made can be"," * referenced as <code>e.container</code>."," *"," * @method delegate"," * @param type {String} the event type to delegate"," * @param fn {Function} the callback function to execute. This function"," * will be provided the event object for the delegated event."," * @param spec {String|Function} a selector that must match the target of the"," * event or a function to test target and its parents for a match"," * @param context {Object} optional argument that specifies what 'this' refers to."," * @param args* {any} 0..n additional arguments to pass on to the callback function."," * These arguments will be added after the event object."," * @return {EventHandle} the detach handle"," * @for Node"," */","Y.Node.prototype.delegate = function(type) {",""," var args = Y.Array(arguments, 0, true),"," index = (Y.Lang.isObject(type) && !Y.Lang.isArray(type)) ? 1 : 2;",""," args.splice(index, 0, this._node);",""," return Y.delegate.apply(Y, args);","};","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-delegate\"]});"]; _yuitest_coverage["build/node-event-delegate/node-event-delegate.js"].lines = {"1":0,"43":0,"45":0,"48":0,"50":0}; _yuitest_coverage["build/node-event-delegate/node-event-delegate.js"].functions = {"delegate:43":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-event-delegate/node-event-delegate.js"].coveredLines = 5;@@ -97,4 +97,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-delegate"]});+}, '3.7.3', {"requires": ["node-base", "event-delegate"]});
bundle/node-event-delegate/node-event-delegate-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -57,4 +57,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-delegate"]});+}, '3.7.3', {"requires": ["node-base", "event-delegate"]});
bundle/node-event-delegate/node-event-delegate-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-event-delegate",function(e,t){e.Node.prototype.delegate=function(t){var n=e.Array(arguments,0,!0),r=e.Lang.isObject(t)&&!e.Lang.isArray(t)?1:2;return n.splice(r,0,this._node),e.delegate.apply(e,n)}},"3.7.2",{requires:["node-base","event-delegate"]});+YUI.add("node-event-delegate",function(e,t){e.Node.prototype.delegate=function(t){var n=e.Array(arguments,0,!0),r=e.Lang.isObject(t)&&!e.Lang.isArray(t)?1:2;return n.splice(r,0,this._node),e.delegate.apply(e,n)}},"3.7.3",{requires:["node-base","event-delegate"]});
bundle/node-event-delegate/node-event-delegate.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -57,4 +57,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-delegate"]});+}, '3.7.3', {"requires": ["node-base", "event-delegate"]});
bundle/node-event-html5/node-event-html5-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-event-html5/node-event-html5.js", code: [] };-_yuitest_coverage["build/node-event-html5/node-event-html5.js"].code=["YUI.add('node-event-html5', function (Y, NAME) {","","/**"," * Adds HTML5 event support to Node."," *"," * @module node"," * @submodule node-event-html5"," **/","","Y.mix(Y.Node.DOM_EVENTS, {"," DOMActivate: 1,"," DOMContentLoaded: 1,"," afterprint: 1,"," beforeprint: 1,"," canplay: 1,"," canplaythrough: 1,"," durationchange: 1,"," emptied: 1,"," ended: 1,"," formchange: 1,"," forminput: 1,"," hashchange: 1,"," input: 1,"," invalid: 1,"," loadedmetadata: 1,"," loadeddata: 1,"," loadstart: 1,"," offline: 1,"," online: 1,"," pagehide: 1,"," pageshow: 1,"," pause: 1,"," play: 1,"," playing: 1,"," popstate: 1,"," progress: 1,"," ratechange: 1,"," readystatechange: 1,"," redo: 1,"," seeking: 1,"," seeked: 1,"," show: 1,"," stalled: 1,"," suspend: 1,"," timeupdate: 1,"," undo: 1,"," volumechange: 1,"," waiting: 1","});","","","}, '3.7.2', {\"requires\": [\"node-base\"]});"];+_yuitest_coverage["build/node-event-html5/node-event-html5.js"].code=["YUI.add('node-event-html5', function (Y, NAME) {","","/**"," * Adds HTML5 event support to Node."," *"," * @module node"," * @submodule node-event-html5"," **/","","Y.mix(Y.Node.DOM_EVENTS, {"," DOMActivate: 1,"," DOMContentLoaded: 1,"," afterprint: 1,"," beforeprint: 1,"," canplay: 1,"," canplaythrough: 1,"," durationchange: 1,"," emptied: 1,"," ended: 1,"," formchange: 1,"," forminput: 1,"," hashchange: 1,"," input: 1,"," invalid: 1,"," loadedmetadata: 1,"," loadeddata: 1,"," loadstart: 1,"," offline: 1,"," online: 1,"," pagehide: 1,"," pageshow: 1,"," pause: 1,"," play: 1,"," playing: 1,"," popstate: 1,"," progress: 1,"," ratechange: 1,"," readystatechange: 1,"," redo: 1,"," seeking: 1,"," seeked: 1,"," show: 1,"," stalled: 1,"," suspend: 1,"," timeupdate: 1,"," undo: 1,"," volumechange: 1,"," waiting: 1","});","","","}, '3.7.3', {\"requires\": [\"node-base\"]});"]; _yuitest_coverage["build/node-event-html5/node-event-html5.js"].lines = {"1":0,"10":0}; _yuitest_coverage["build/node-event-html5/node-event-html5.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/node-event-html5/node-event-html5.js"].coveredLines = 2;@@ -91,4 +91,4 @@ }); -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/node-event-html5/node-event-html5-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -55,4 +55,4 @@ }); -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/node-event-html5/node-event-html5-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-event-html5",function(e,t){e.mix(e.Node.DOM_EVENTS,{DOMActivate:1,DOMContentLoaded:1,afterprint:1,beforeprint:1,canplay:1,canplaythrough:1,durationchange:1,emptied:1,ended:1,formchange:1,forminput:1,hashchange:1,input:1,invalid:1,loadedmetadata:1,loadeddata:1,loadstart:1,offline:1,online:1,pagehide:1,pageshow:1,pause:1,play:1,playing:1,popstate:1,progress:1,ratechange:1,readystatechange:1,redo:1,seeking:1,seeked:1,show:1,stalled:1,suspend:1,timeupdate:1,undo:1,volumechange:1,waiting:1})},"3.7.2",{requires:["node-base"]});+YUI.add("node-event-html5",function(e,t){e.mix(e.Node.DOM_EVENTS,{DOMActivate:1,DOMContentLoaded:1,afterprint:1,beforeprint:1,canplay:1,canplaythrough:1,durationchange:1,emptied:1,ended:1,formchange:1,forminput:1,hashchange:1,input:1,invalid:1,loadedmetadata:1,loadeddata:1,loadstart:1,offline:1,online:1,pagehide:1,pageshow:1,pause:1,play:1,playing:1,popstate:1,progress:1,ratechange:1,readystatechange:1,redo:1,seeking:1,seeked:1,show:1,stalled:1,suspend:1,timeupdate:1,undo:1,volumechange:1,waiting:1})},"3.7.3",{requires:["node-base"]});
bundle/node-event-html5/node-event-html5.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -55,4 +55,4 @@ }); -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]});
bundle/node-event-simulate/node-event-simulate-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-event-simulate/node-event-simulate.js", code: [] };-_yuitest_coverage["build/node-event-simulate/node-event-simulate.js"].code=["YUI.add('node-event-simulate', function (Y, NAME) {","","/**"," * Adds functionality to simulate events."," * @module node"," * @submodule node-event-simulate"," */","","/**"," * Simulates an event on the node."," * @param {String} type The type of event (i.e., \"click\")."," * @param {Object} options (Optional) Extra options to copy onto the event object."," * @return {void}"," * @for Node"," * @method simulate"," */","Y.Node.prototype.simulate = function (type, options) {"," "," Y.Event.simulate(Y.Node.getDOMNode(this), type, options);","};","","/**"," * Simulates the higher user level gesture of the given name on this node. "," * This method generates a set of low level touch events(Apple specific gesture "," * events as well for the iOS platforms) asynchronously. Note that gesture "," * simulation is relying on `Y.Event.simulate()` method to generate "," * the touch events under the hood. The `Y.Event.simulate()` method"," * itself is a synchronous method."," * "," * Supported gestures are `tap`, `doubletap`, `press`, `move`, `flick`, `pinch`"," * and `rotate`."," * "," * The `pinch` gesture is used to simulate the pinching and spreading of two"," * fingers. During a pinch simulation, rotation is also possible. Essentially"," * `pinch` and `rotate` simulations share the same base implementation to allow"," * both pinching and rotation at the same time. The only difference is `pinch`"," * requires `start` and `end` option properties while `rotate` requires `rotation` "," * option property."," * "," * The `pinch` and `rotate` gestures can be described as placing 2 fingers along a"," * circle. Pinching and spreading can be described by start and end circles while "," * rotation occurs on a single circle. If the radius of the start circle is greater "," * than the end circle, the gesture becomes a pinch, otherwise it is a spread spread."," * "," * @example"," *"," * var node = Y.one(\"#target\");"," * "," * // double tap example"," * node.simulateGesture(\"doubletap\", function() {"," * // my callback function"," * });"," * "," * // flick example from the center of the node, move 50 pixels down for 50ms)"," * node.simulateGesture(\"flick\", {"," * axis: y,"," * distance: -100"," * duration: 50"," * }, function() {"," * // my callback function"," * });"," * "," * // simulate rotating a node 75 degrees counter-clockwise "," * node.simulateGesture(\"rotate\", {"," * rotation: -75"," * });"," *"," * // simulate a pinch and a rotation at the same time. "," * // fingers start on a circle of radius 100 px, placed at top/bottom"," * // fingers end on a circle of radius 50px, placed at right/left "," * node.simulateGesture(\"pinch\", {"," * r1: 100,"," * r2: 50,"," * start: 0"," * rotation: 90"," * });"," * "," * @method simulateGesture"," * @param {String} name The name of the supported gesture to simulate. The "," * supported gesture name is one of \"tap\", \"doubletap\", \"press\", \"move\", "," * \"flick\", \"pinch\" and \"rotate\". "," * @param {Object} [options] Extra options used to define the gesture behavior:"," * "," * Valid options properties for the `tap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the tap should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=10] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation."," * @param {Number} [options.times=1] (Optional) Indicates the number of taps."," * @param {Number} [options.delay=10] (Optional) The number of milliseconds "," * before the next tap simulation happens. This is valid only when `times` "," * is more than 1. "," * "," * Valid options properties for the `doubletap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the doubletap should be simulated. Default is the center of the "," * node element."," * "," * Valid options properties for the `press` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the press should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=3000] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation. "," * Default is 3000ms (3 seconds)."," * "," * Valid options properties for the `move` gesture:"," * "," * @param {Object} [options.path] (Optional) Indicates the path of the finger "," * movement. It's an object with three optional properties: `point`, "," * `xdist` and `ydist`."," * @param {Array} [options.path.point] A starting point of the gesture."," * Default is the center of the node element."," * @param {Number} [options.path.xdist=200] A distance to move in pixels "," * along the X axis. A negative distance value indicates moving left."," * @param {Number} [options.path.ydist=0] A distance to move in pixels "," * along the Y axis. A negative distance value indicates moving up."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * "," * Valid options properties for the `flick` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x, y] coordinates "," * where the flick should be simulated. Default is the center of the "," * node element."," * @param {String} [options.axis='x'] (Optional) Valid values are either "," * \"x\" or \"y\". Indicates axis to move along. The flick can move to one of "," * 4 directions(left, right, up and down)."," * @param {Number} [options.distance=200] (Optional) Distance to move in pixels"," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds. User given value could be automatically "," * adjusted by the framework if it is below the minimum velocity to be "," * a flick gesture."," * "," * Valid options properties for the `pinch` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Required) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element."," * @param {Number} [options.r2] (Required) Pixel radius of the end circle "," * when this gesture ends."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation=0] (Optional) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * Valid options properties for the `rotate` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Optional) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element. Default is a fourth of the node "," * element width or height, whichever is smaller."," * @param {Number} [options.r2] (Optional) Pixel radius of the end circle "," * when this gesture ends. Default is a fourth of the node element width or "," * height, whichever is smaller."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation] (Required) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * @param {Function} [cb] The callback to execute when the asynchronouse gesture "," * simulation is completed. "," * @param {Error} cb.err An error object if the simulation is failed. "," * @return {void}"," * @for Node"," */","Y.Node.prototype.simulateGesture = function (name, options, cb) {",""," Y.Event.simulateGesture(this, name, options, cb);","};","","","}, '3.7.2', {\"requires\": [\"node-base\", \"event-simulate\", \"gesture-simulate\"]});"];+_yuitest_coverage["build/node-event-simulate/node-event-simulate.js"].code=["YUI.add('node-event-simulate', function (Y, NAME) {","","/**"," * Adds functionality to simulate events."," * @module node"," * @submodule node-event-simulate"," */","","/**"," * Simulates an event on the node."," * @param {String} type The type of event (i.e., \"click\")."," * @param {Object} options (Optional) Extra options to copy onto the event object."," * @return {void}"," * @for Node"," * @method simulate"," */","Y.Node.prototype.simulate = function (type, options) {"," "," Y.Event.simulate(Y.Node.getDOMNode(this), type, options);","};","","/**"," * Simulates the higher user level gesture of the given name on this node. "," * This method generates a set of low level touch events(Apple specific gesture "," * events as well for the iOS platforms) asynchronously. Note that gesture "," * simulation is relying on `Y.Event.simulate()` method to generate "," * the touch events under the hood. The `Y.Event.simulate()` method"," * itself is a synchronous method."," * "," * Supported gestures are `tap`, `doubletap`, `press`, `move`, `flick`, `pinch`"," * and `rotate`."," * "," * The `pinch` gesture is used to simulate the pinching and spreading of two"," * fingers. During a pinch simulation, rotation is also possible. Essentially"," * `pinch` and `rotate` simulations share the same base implementation to allow"," * both pinching and rotation at the same time. The only difference is `pinch`"," * requires `start` and `end` option properties while `rotate` requires `rotation` "," * option property."," * "," * The `pinch` and `rotate` gestures can be described as placing 2 fingers along a"," * circle. Pinching and spreading can be described by start and end circles while "," * rotation occurs on a single circle. If the radius of the start circle is greater "," * than the end circle, the gesture becomes a pinch, otherwise it is a spread spread."," * "," * @example"," *"," * var node = Y.one(\"#target\");"," * "," * // double tap example"," * node.simulateGesture(\"doubletap\", function() {"," * // my callback function"," * });"," * "," * // flick example from the center of the node, move 50 pixels down for 50ms)"," * node.simulateGesture(\"flick\", {"," * axis: y,"," * distance: -100"," * duration: 50"," * }, function() {"," * // my callback function"," * });"," * "," * // simulate rotating a node 75 degrees counter-clockwise "," * node.simulateGesture(\"rotate\", {"," * rotation: -75"," * });"," *"," * // simulate a pinch and a rotation at the same time. "," * // fingers start on a circle of radius 100 px, placed at top/bottom"," * // fingers end on a circle of radius 50px, placed at right/left "," * node.simulateGesture(\"pinch\", {"," * r1: 100,"," * r2: 50,"," * start: 0"," * rotation: 90"," * });"," * "," * @method simulateGesture"," * @param {String} name The name of the supported gesture to simulate. The "," * supported gesture name is one of \"tap\", \"doubletap\", \"press\", \"move\", "," * \"flick\", \"pinch\" and \"rotate\". "," * @param {Object} [options] Extra options used to define the gesture behavior:"," * "," * Valid options properties for the `tap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the tap should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=10] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation."," * @param {Number} [options.times=1] (Optional) Indicates the number of taps."," * @param {Number} [options.delay=10] (Optional) The number of milliseconds "," * before the next tap simulation happens. This is valid only when `times` "," * is more than 1. "," * "," * Valid options properties for the `doubletap` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the doubletap should be simulated. Default is the center of the "," * node element."," * "," * Valid options properties for the `press` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x,y] coordinates "," * where the press should be simulated. Default is the center of the node "," * element."," * @param {Number} [options.hold=3000] (Optional) The hold time in milliseconds. "," * This is the time between `touchstart` and `touchend` event generation. "," * Default is 3000ms (3 seconds)."," * "," * Valid options properties for the `move` gesture:"," * "," * @param {Object} [options.path] (Optional) Indicates the path of the finger "," * movement. It's an object with three optional properties: `point`, "," * `xdist` and `ydist`."," * @param {Array} [options.path.point] A starting point of the gesture."," * Default is the center of the node element."," * @param {Number} [options.path.xdist=200] A distance to move in pixels "," * along the X axis. A negative distance value indicates moving left."," * @param {Number} [options.path.ydist=0] A distance to move in pixels "," * along the Y axis. A negative distance value indicates moving up."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * "," * Valid options properties for the `flick` gesture:"," * "," * @param {Array} [options.point] (Optional) Indicates the [x, y] coordinates "," * where the flick should be simulated. Default is the center of the "," * node element."," * @param {String} [options.axis='x'] (Optional) Valid values are either "," * \"x\" or \"y\". Indicates axis to move along. The flick can move to one of "," * 4 directions(left, right, up and down)."," * @param {Number} [options.distance=200] (Optional) Distance to move in pixels"," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds. User given value could be automatically "," * adjusted by the framework if it is below the minimum velocity to be "," * a flick gesture."," * "," * Valid options properties for the `pinch` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Required) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element."," * @param {Number} [options.r2] (Required) Pixel radius of the end circle "," * when this gesture ends."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation=0] (Optional) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * Valid options properties for the `rotate` gesture:"," * "," * @param {Array} [options.center] (Optional) The center of the circle where "," * two fingers are placed. Default is the center of the node element."," * @param {Number} [options.r1] (Optional) Pixel radius of the start circle "," * where 2 fingers will be on when the gesture starts. The circles are "," * centered at the center of the element. Default is a fourth of the node "," * element width or height, whichever is smaller."," * @param {Number} [options.r2] (Optional) Pixel radius of the end circle "," * when this gesture ends. Default is a fourth of the node element width or "," * height, whichever is smaller."," * @param {Number} [options.duration=1000] (Optional) The duration of the "," * gesture in milliseconds."," * @param {Number} [options.start=0] (Optional) Starting degree of the first "," * finger. The value is relative to the path of the north. Default is 0 "," * (i.e., 12:00 on a clock)."," * @param {Number} [options.rotation] (Required) Degrees to rotate from "," * the starting degree. A negative value means rotation to the "," * counter-clockwise direction."," * "," * @param {Function} [cb] The callback to execute when the asynchronouse gesture "," * simulation is completed. "," * @param {Error} cb.err An error object if the simulation is failed. "," * @return {void}"," * @for Node"," */","Y.Node.prototype.simulateGesture = function (name, options, cb) {",""," Y.Event.simulateGesture(this, name, options, cb);","};","","","}, '3.7.3', {\"requires\": [\"node-base\", \"event-simulate\", \"gesture-simulate\"]});"]; _yuitest_coverage["build/node-event-simulate/node-event-simulate.js"].lines = {"1":0,"17":0,"19":0,"183":0,"185":0}; _yuitest_coverage["build/node-event-simulate/node-event-simulate.js"].functions = {"simulate:17":0,"simulateGesture:183":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-event-simulate/node-event-simulate.js"].coveredLines = 5;@@ -233,4 +233,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});+}, '3.7.3', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
bundle/node-event-simulate/node-event-simulate-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -192,4 +192,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});+}, '3.7.3', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
bundle/node-event-simulate/node-event-simulate-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-event-simulate",function(e,t){e.Node.prototype.simulate=function(t,n){e.Event.simulate(e.Node.getDOMNode(this),t,n)},e.Node.prototype.simulateGesture=function(t,n,r){e.Event.simulateGesture(this,t,n,r)}},"3.7.2",{requires:["node-base","event-simulate","gesture-simulate"]});+YUI.add("node-event-simulate",function(e,t){e.Node.prototype.simulate=function(t,n){e.Event.simulate(e.Node.getDOMNode(this),t,n)},e.Node.prototype.simulateGesture=function(t,n,r){e.Event.simulateGesture(this,t,n,r)}},"3.7.3",{requires:["node-base","event-simulate","gesture-simulate"]});
bundle/node-event-simulate/node-event-simulate.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -192,4 +192,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});+}, '3.7.3', {"requires": ["node-base", "event-simulate", "gesture-simulate"]});
bundle/node-flick/assets/node-flick-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/node-flick/assets/skins/sam/node-flick-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/node-flick/assets/skins/sam/node-flick.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/node-flick/node-flick-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-flick/node-flick.js", code: [] };-_yuitest_coverage["build/node-flick/node-flick.js"].code=["YUI.add('node-flick', function (Y, NAME) {","","/**"," * Provide a simple Flick plugin, which can be used along with the \"flick\" gesture event, to "," * animate the motion of the host node in response to a (mouse or touch) flick gesture. "," * "," * <p>The current implementation is designed to move the node, relative to the bounds of a parent node and is suitable"," * for scroll/carousel type implementations. Future versions will remove that constraint, to allow open ended movement within"," * the document.</p>"," *"," * @module node-flick"," */",""," var HOST = \"host\","," PARENT_NODE = \"parentNode\","," BOUNDING_BOX = \"boundingBox\","," OFFSET_HEIGHT = \"offsetHeight\","," OFFSET_WIDTH = \"offsetWidth\","," SCROLL_HEIGHT = \"scrollHeight\","," SCROLL_WIDTH = \"scrollWidth\","," BOUNCE = \"bounce\","," MIN_DISTANCE = \"minDistance\","," MIN_VELOCITY = \"minVelocity\","," BOUNCE_DISTANCE = \"bounceDistance\","," DECELERATION = \"deceleration\","," STEP = \"step\","," DURATION = \"duration\","," EASING = \"easing\","," FLICK = \"flick\","," "," getClassName = Y.ClassNameManager.getClassName;",""," /**"," * A plugin class which can be used to animate the motion of a node, in response to a flick gesture."," * "," * @class Flick"," * @namespace Plugin"," * @param {Object} config The initial attribute values for the plugin"," */"," function Flick(config) {"," Flick.superclass.constructor.apply(this, arguments);"," }",""," Flick.ATTRS = {",""," /**"," * Drag coefficent for inertial scrolling. The closer to 1 this"," * value is, the less friction during scrolling."," *"," * @attribute deceleration"," * @default 0.98"," */"," deceleration : {"," value: 0.98"," },",""," /**"," * Drag coefficient for intertial scrolling at the upper"," * and lower boundaries of the scrollview. Set to 0 to "," * disable \"rubber-banding\"."," *"," * @attribute bounce"," * @type Number"," * @default 0.7"," */"," bounce : {"," value: 0.7"," },",""," /**"," * The bounce distance in pixels"," *"," * @attribute bounceDistance"," * @type Number"," * @default 150"," */"," bounceDistance : {"," value: 150"," },",""," /**"," * The minimum flick gesture velocity (px/ms) at which to trigger the flick response"," *"," * @attribute minVelocity"," * @type Number"," * @default 0"," */"," minVelocity : {"," value: 0"," },",""," /**"," * The minimum flick gesture distance (px) for which to trigger the flick response"," *"," * @attribute minVelocity"," * @type Number"," * @default 10"," */"," minDistance : {"," value: 10"," },",""," /**"," * The constraining box relative to which the flick animation and bounds should be calculated."," *"," * @attribute boundingBox"," * @type Node"," * @default parentNode"," */"," boundingBox : {"," valueFn : function() {"," return this.get(HOST).get(PARENT_NODE);"," }"," },",""," /**"," * The constraining box relative to which the flick animation and bounds should be calculated."," *"," * @attribute boundingBox"," * @type Node"," * @default parentNode"," */"," step : {"," value:10"," },",""," /**"," * The custom duration to apply to the flick animation. By default,"," * the animation duration is controlled by the deceleration factor."," *"," * @attribute duration"," * @type Number"," * @default null"," */"," duration : {"," value:null"," },",""," /**"," * The custom transition easing to use for the flick animation. If not"," * provided defaults to internally to Flick.EASING, or Flick.SNAP_EASING based"," * on whether or not we're animating the flick or bounce step. "," *"," * @attribute easing"," * @type String"," * @default null"," */"," easing : {"," value:null"," }"," };",""," /**"," * The NAME of the Flick class. Used to prefix events generated"," * by the plugin."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginFlick\""," */"," Flick.NAME = \"pluginFlick\";",""," /**"," * The namespace for the plugin. This will be the property on the node, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"flick\""," */"," Flick.NS = \"flick\";",""," Y.extend(Flick, Y.Plugin.Base, {",""," /**"," * The initializer lifecycle implementation."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {"," this._node = this.get(HOST);",""," this._renderClasses();"," this.setBounds();",""," this._node.on(FLICK, Y.bind(this._onFlick, this), {"," minDistance : this.get(MIN_DISTANCE),"," minVelocity : this.get(MIN_VELOCITY)"," });"," },",""," /**"," * Sets the min/max boundaries for the flick animation,"," * based on the boundingBox dimensions."," * "," * @method setBounds"," */"," setBounds : function () {"," var box = this.get(BOUNDING_BOX),"," node = this._node,",""," boxHeight = box.get(OFFSET_HEIGHT),"," boxWidth = box.get(OFFSET_WIDTH),",""," contentHeight = node.get(SCROLL_HEIGHT),"," contentWidth = node.get(SCROLL_WIDTH);",""," if (contentHeight > boxHeight) {"," this._maxY = contentHeight - boxHeight;"," this._minY = 0;"," this._scrollY = true;"," }",""," if (contentWidth > boxWidth) {"," this._maxX = contentWidth - boxWidth;"," this._minX = 0;"," this._scrollX = true;"," }",""," this._x = this._y = 0;",""," node.set(\"top\", this._y + \"px\");"," node.set(\"left\", this._x + \"px\");"," },",""," /**"," * Adds the CSS classes, necessary to set up overflow/position properties on the"," * node and boundingBox. "," *"," * @method _renderClasses"," * @protected"," */"," _renderClasses : function() {"," this.get(BOUNDING_BOX).addClass(Flick.CLASS_NAMES.box);"," this._node.addClass(Flick.CLASS_NAMES.content);"," },",""," /**"," * The flick event listener. Kicks off the flick animation."," *"," * @method _onFlick"," * @param e {EventFacade} The flick event facade, containing e.flick.distance, e.flick.velocity etc."," * @protected"," */"," _onFlick: function(e) {"," this._v = e.flick.velocity;"," this._flick = true;"," this._flickAnim();"," },",""," /**"," * Executes a single frame in the flick animation"," *"," * @method _flickFrame"," * @protected"," */"," _flickAnim: function() {",""," var y = this._y,"," x = this._x,",""," maxY = this._maxY,"," minY = this._minY,"," maxX = this._maxX,"," minX = this._minX,"," velocity = this._v,",""," step = this.get(STEP),"," deceleration = this.get(DECELERATION),"," bounce = this.get(BOUNCE);",""," this._v = (velocity * deceleration);",""," this._snapToEdge = false;",""," if (this._scrollX) {"," x = x - (velocity * step);"," }"," "," if (this._scrollY) {"," y = y - (velocity * step);"," }",""," if (Math.abs(velocity).toFixed(4) <= Flick.VELOCITY_THRESHOLD) {",""," this._flick = false;",""," this._killTimer(!(this._exceededYBoundary || this._exceededXBoundary));",""," if (this._scrollX) {"," if (x < minX) {"," this._snapToEdge = true;"," this._setX(minX);"," } else if (x > maxX) {"," this._snapToEdge = true;"," this._setX(maxX);"," }"," }",""," if (this._scrollY) {"," if (y < minY) {"," this._snapToEdge = true;"," this._setY(minY);"," } else if (y > maxY) {"," this._snapToEdge = true;"," this._setY(maxY);"," }"," }",""," } else {",""," if (this._scrollX && (x < minX || x > maxX)) {"," this._exceededXBoundary = true;"," this._v *= bounce;"," }",""," if (this._scrollY && (y < minY || y > maxY)) {"," this._exceededYBoundary = true;"," this._v *= bounce;"," }",""," if (this._scrollX) {"," this._setX(x);"," }",""," if (this._scrollY) {"," this._setY(y);"," }",""," this._flickTimer = Y.later(step, this, this._flickAnim);"," }"," },",""," /**"," * Internal utility method to set the X offset position"," *"," * @method _setX"," * @param {Number} val"," * @private"," */"," _setX : function(val) {"," this._move(val, null, this.get(DURATION), this.get(EASING));"," },",""," /**"," * Internal utility method to set the Y offset position"," * "," * @method _setY"," * @param {Number} val"," * @private"," */"," _setY : function(val) {"," this._move(null, val, this.get(DURATION), this.get(EASING));"," },",""," /**"," * Internal utility method to move the node to a given XY position,"," * using transitions, if specified."," *"," * @method _move"," * @param {Number} x The X offset position"," * @param {Number} y The Y offset position"," * @param {Number} duration The duration to use for the transition animation"," * @param {String} easing The easing to use for the transition animation."," *"," * @private"," */"," _move: function(x, y, duration, easing) {",""," if (x !== null) {"," x = this._bounce(x);"," } else {"," x = this._x; "," }",""," if (y !== null) {"," y = this._bounce(y);"," } else {"," y = this._y;"," }",""," duration = duration || this._snapToEdge ? Flick.SNAP_DURATION : 0;"," easing = easing || this._snapToEdge ? Flick.SNAP_EASING : Flick.EASING;",""," this._x = x;"," this._y = y;",""," this._anim(x, y, duration, easing);"," },",""," /**"," * Internal utility method to perform the transition step"," *"," * @method _anim"," * @param {Number} x The X offset position"," * @param {Number} y The Y offset position"," * @param {Number} duration The duration to use for the transition animation"," * @param {String} easing The easing to use for the transition animation."," *"," * @private"," */"," _anim : function(x, y, duration, easing) {"," var xn = x * -1,"," yn = y * -1,",""," transition = {"," duration : duration / 1000,"," easing : easing"," };","",""," if (Y.Transition.useNative) {"," transition.transform = 'translate('+ (xn) + 'px,' + (yn) +'px)'; "," } else {"," transition.left = xn + 'px';"," transition.top = yn + 'px';"," }",""," this._node.transition(transition);"," },",""," /**"," * Internal utility method to constrain the offset value"," * based on the bounce criteria. "," *"," * @method _bounce"," * @param {Number} x The offset value to constrain."," * @param {Number} max The max offset value."," *"," * @private"," */"," _bounce : function(val, max) {"," var bounce = this.get(BOUNCE),"," dist = this.get(BOUNCE_DISTANCE),"," min = bounce ? -dist : 0;",""," max = bounce ? max + dist : max;"," "," if(!bounce) {"," if(val < min) {"," val = min;"," } else if(val > max) {"," val = max;"," } "," }"," return val;"," },",""," /**"," * Stop the animation timer"," *"," * @method _killTimer"," * @private"," */"," _killTimer: function() {"," if(this._flickTimer) {"," this._flickTimer.cancel();"," }"," }",""," }, {",""," /**"," * The threshold used to determine when the decelerated velocity of the node"," * is practically 0."," *"," * @property VELOCITY_THRESHOLD"," * @static"," * @type Number"," * @default 0.015"," */"," VELOCITY_THRESHOLD : 0.015,",""," /**"," * The duration to use for the bounce snap-back transition"," *"," * @property SNAP_DURATION"," * @static"," * @type Number"," * @default 400"," */"," SNAP_DURATION : 400,"," "," /**"," * The default easing to use for the main flick movement transition"," *"," * @property EASING"," * @static"," * @type String"," * @default 'cubic-bezier(0, 0.1, 0, 1.0)'"," */"," EASING : 'cubic-bezier(0, 0.1, 0, 1.0)',",""," /**"," * The default easing to use for the bounce snap-back transition"," *"," * @property SNAP_EASING"," * @static"," * @type String"," * @default 'ease-out'"," */"," SNAP_EASING : 'ease-out',",""," /**"," * The default CSS class names used by the plugin"," *"," * @property CLASS_NAMES"," * @static"," * @type Object"," */"," CLASS_NAMES : {"," box: getClassName(Flick.NS),"," content: getClassName(Flick.NS, \"content\")"," }"," });",""," Y.Plugin.Flick = Flick;","","","}, '3.7.2', {\"requires\": [\"classnamemanager\", \"transition\", \"event-flick\", \"plugin\"], \"skinnable\": true});"];+_yuitest_coverage["build/node-flick/node-flick.js"].code=["YUI.add('node-flick', function (Y, NAME) {","","/**"," * Provide a simple Flick plugin, which can be used along with the \"flick\" gesture event, to "," * animate the motion of the host node in response to a (mouse or touch) flick gesture. "," * "," * <p>The current implementation is designed to move the node, relative to the bounds of a parent node and is suitable"," * for scroll/carousel type implementations. Future versions will remove that constraint, to allow open ended movement within"," * the document.</p>"," *"," * @module node-flick"," */",""," var HOST = \"host\","," PARENT_NODE = \"parentNode\","," BOUNDING_BOX = \"boundingBox\","," OFFSET_HEIGHT = \"offsetHeight\","," OFFSET_WIDTH = \"offsetWidth\","," SCROLL_HEIGHT = \"scrollHeight\","," SCROLL_WIDTH = \"scrollWidth\","," BOUNCE = \"bounce\","," MIN_DISTANCE = \"minDistance\","," MIN_VELOCITY = \"minVelocity\","," BOUNCE_DISTANCE = \"bounceDistance\","," DECELERATION = \"deceleration\","," STEP = \"step\","," DURATION = \"duration\","," EASING = \"easing\","," FLICK = \"flick\","," "," getClassName = Y.ClassNameManager.getClassName;",""," /**"," * A plugin class which can be used to animate the motion of a node, in response to a flick gesture."," * "," * @class Flick"," * @namespace Plugin"," * @param {Object} config The initial attribute values for the plugin"," */"," function Flick(config) {"," Flick.superclass.constructor.apply(this, arguments);"," }",""," Flick.ATTRS = {",""," /**"," * Drag coefficent for inertial scrolling. The closer to 1 this"," * value is, the less friction during scrolling."," *"," * @attribute deceleration"," * @default 0.98"," */"," deceleration : {"," value: 0.98"," },",""," /**"," * Drag coefficient for intertial scrolling at the upper"," * and lower boundaries of the scrollview. Set to 0 to "," * disable \"rubber-banding\"."," *"," * @attribute bounce"," * @type Number"," * @default 0.7"," */"," bounce : {"," value: 0.7"," },",""," /**"," * The bounce distance in pixels"," *"," * @attribute bounceDistance"," * @type Number"," * @default 150"," */"," bounceDistance : {"," value: 150"," },",""," /**"," * The minimum flick gesture velocity (px/ms) at which to trigger the flick response"," *"," * @attribute minVelocity"," * @type Number"," * @default 0"," */"," minVelocity : {"," value: 0"," },",""," /**"," * The minimum flick gesture distance (px) for which to trigger the flick response"," *"," * @attribute minVelocity"," * @type Number"," * @default 10"," */"," minDistance : {"," value: 10"," },",""," /**"," * The constraining box relative to which the flick animation and bounds should be calculated."," *"," * @attribute boundingBox"," * @type Node"," * @default parentNode"," */"," boundingBox : {"," valueFn : function() {"," return this.get(HOST).get(PARENT_NODE);"," }"," },",""," /**"," * Time between flick animation frames."," *"," * @attribute step"," * @type Number"," * @default 10"," */"," step : {"," value:10"," },",""," /**"," * The custom duration to apply to the flick animation. By default,"," * the animation duration is controlled by the deceleration factor."," *"," * @attribute duration"," * @type Number"," * @default null"," */"," duration : {"," value:null"," },",""," /**"," * The custom transition easing to use for the flick animation. If not"," * provided defaults to internally to Flick.EASING, or Flick.SNAP_EASING based"," * on whether or not we're animating the flick or bounce step. "," *"," * @attribute easing"," * @type String"," * @default null"," */"," easing : {"," value:null"," }"," };",""," /**"," * The NAME of the Flick class. Used to prefix events generated"," * by the plugin."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginFlick\""," */"," Flick.NAME = \"pluginFlick\";",""," /**"," * The namespace for the plugin. This will be the property on the node, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"flick\""," */"," Flick.NS = \"flick\";",""," Y.extend(Flick, Y.Plugin.Base, {",""," /**"," * The initializer lifecycle implementation."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {"," this._node = this.get(HOST);",""," this._renderClasses();"," this.setBounds();",""," this._node.on(FLICK, Y.bind(this._onFlick, this), {"," minDistance : this.get(MIN_DISTANCE),"," minVelocity : this.get(MIN_VELOCITY)"," });"," },",""," /**"," * Sets the min/max boundaries for the flick animation,"," * based on the boundingBox dimensions."," * "," * @method setBounds"," */"," setBounds : function () {"," var box = this.get(BOUNDING_BOX),"," node = this._node,",""," boxHeight = box.get(OFFSET_HEIGHT),"," boxWidth = box.get(OFFSET_WIDTH),",""," contentHeight = node.get(SCROLL_HEIGHT),"," contentWidth = node.get(SCROLL_WIDTH);",""," if (contentHeight > boxHeight) {"," this._maxY = contentHeight - boxHeight;"," this._minY = 0;"," this._scrollY = true;"," }",""," if (contentWidth > boxWidth) {"," this._maxX = contentWidth - boxWidth;"," this._minX = 0;"," this._scrollX = true;"," }",""," this._x = this._y = 0;",""," node.set(\"top\", this._y + \"px\");"," node.set(\"left\", this._x + \"px\");"," },",""," /**"," * Adds the CSS classes, necessary to set up overflow/position properties on the"," * node and boundingBox. "," *"," * @method _renderClasses"," * @protected"," */"," _renderClasses : function() {"," this.get(BOUNDING_BOX).addClass(Flick.CLASS_NAMES.box);"," this._node.addClass(Flick.CLASS_NAMES.content);"," },",""," /**"," * The flick event listener. Kicks off the flick animation."," *"," * @method _onFlick"," * @param e {EventFacade} The flick event facade, containing e.flick.distance, e.flick.velocity etc."," * @protected"," */"," _onFlick: function(e) {"," this._v = e.flick.velocity;"," this._flick = true;"," this._flickAnim();"," },",""," /**"," * Executes a single frame in the flick animation"," *"," * @method _flickFrame"," * @protected"," */"," _flickAnim: function() {",""," var y = this._y,"," x = this._x,",""," maxY = this._maxY,"," minY = this._minY,"," maxX = this._maxX,"," minX = this._minX,"," velocity = this._v,",""," step = this.get(STEP),"," deceleration = this.get(DECELERATION),"," bounce = this.get(BOUNCE);",""," this._v = (velocity * deceleration);",""," this._snapToEdge = false;",""," if (this._scrollX) {"," x = x - (velocity * step);"," }"," "," if (this._scrollY) {"," y = y - (velocity * step);"," }",""," if (Math.abs(velocity).toFixed(4) <= Flick.VELOCITY_THRESHOLD) {",""," this._flick = false;",""," this._killTimer(!(this._exceededYBoundary || this._exceededXBoundary));",""," if (this._scrollX) {"," if (x < minX) {"," this._snapToEdge = true;"," this._setX(minX);"," } else if (x > maxX) {"," this._snapToEdge = true;"," this._setX(maxX);"," }"," }",""," if (this._scrollY) {"," if (y < minY) {"," this._snapToEdge = true;"," this._setY(minY);"," } else if (y > maxY) {"," this._snapToEdge = true;"," this._setY(maxY);"," }"," }",""," } else {",""," if (this._scrollX && (x < minX || x > maxX)) {"," this._exceededXBoundary = true;"," this._v *= bounce;"," }",""," if (this._scrollY && (y < minY || y > maxY)) {"," this._exceededYBoundary = true;"," this._v *= bounce;"," }",""," if (this._scrollX) {"," this._setX(x);"," }",""," if (this._scrollY) {"," this._setY(y);"," }",""," this._flickTimer = Y.later(step, this, this._flickAnim);"," }"," },",""," /**"," * Internal utility method to set the X offset position"," *"," * @method _setX"," * @param {Number} val"," * @private"," */"," _setX : function(val) {"," this._move(val, null, this.get(DURATION), this.get(EASING));"," },",""," /**"," * Internal utility method to set the Y offset position"," * "," * @method _setY"," * @param {Number} val"," * @private"," */"," _setY : function(val) {"," this._move(null, val, this.get(DURATION), this.get(EASING));"," },",""," /**"," * Internal utility method to move the node to a given XY position,"," * using transitions, if specified."," *"," * @method _move"," * @param {Number} x The X offset position"," * @param {Number} y The Y offset position"," * @param {Number} duration The duration to use for the transition animation"," * @param {String} easing The easing to use for the transition animation."," *"," * @private"," */"," _move: function(x, y, duration, easing) {",""," if (x !== null) {"," x = this._bounce(x);"," } else {"," x = this._x; "," }",""," if (y !== null) {"," y = this._bounce(y);"," } else {"," y = this._y;"," }",""," duration = duration || this._snapToEdge ? Flick.SNAP_DURATION : 0;"," easing = easing || this._snapToEdge ? Flick.SNAP_EASING : Flick.EASING;",""," this._x = x;"," this._y = y;",""," this._anim(x, y, duration, easing);"," },",""," /**"," * Internal utility method to perform the transition step"," *"," * @method _anim"," * @param {Number} x The X offset position"," * @param {Number} y The Y offset position"," * @param {Number} duration The duration to use for the transition animation"," * @param {String} easing The easing to use for the transition animation."," *"," * @private"," */"," _anim : function(x, y, duration, easing) {"," var xn = x * -1,"," yn = y * -1,",""," transition = {"," duration : duration / 1000,"," easing : easing"," };","",""," if (Y.Transition.useNative) {"," transition.transform = 'translate('+ (xn) + 'px,' + (yn) +'px)'; "," } else {"," transition.left = xn + 'px';"," transition.top = yn + 'px';"," }",""," this._node.transition(transition);"," },",""," /**"," * Internal utility method to constrain the offset value"," * based on the bounce criteria. "," *"," * @method _bounce"," * @param {Number} x The offset value to constrain."," * @param {Number} max The max offset value."," *"," * @private"," */"," _bounce : function(val, max) {"," var bounce = this.get(BOUNCE),"," dist = this.get(BOUNCE_DISTANCE),"," min = bounce ? -dist : 0;",""," max = bounce ? max + dist : max;"," "," if(!bounce) {"," if(val < min) {"," val = min;"," } else if(val > max) {"," val = max;"," } "," }"," return val;"," },",""," /**"," * Stop the animation timer"," *"," * @method _killTimer"," * @private"," */"," _killTimer: function() {"," if(this._flickTimer) {"," this._flickTimer.cancel();"," }"," }",""," }, {",""," /**"," * The threshold used to determine when the decelerated velocity of the node"," * is practically 0."," *"," * @property VELOCITY_THRESHOLD"," * @static"," * @type Number"," * @default 0.015"," */"," VELOCITY_THRESHOLD : 0.015,",""," /**"," * The duration to use for the bounce snap-back transition"," *"," * @property SNAP_DURATION"," * @static"," * @type Number"," * @default 400"," */"," SNAP_DURATION : 400,"," "," /**"," * The default easing to use for the main flick movement transition"," *"," * @property EASING"," * @static"," * @type String"," * @default 'cubic-bezier(0, 0.1, 0, 1.0)'"," */"," EASING : 'cubic-bezier(0, 0.1, 0, 1.0)',",""," /**"," * The default easing to use for the bounce snap-back transition"," *"," * @property SNAP_EASING"," * @static"," * @type String"," * @default 'ease-out'"," */"," SNAP_EASING : 'ease-out',",""," /**"," * The default CSS class names used by the plugin"," *"," * @property CLASS_NAMES"," * @static"," * @type Object"," */"," CLASS_NAMES : {"," box: getClassName(Flick.NS),"," content: getClassName(Flick.NS, \"content\")"," }"," });",""," Y.Plugin.Flick = Flick;","","","}, '3.7.3', {\"requires\": [\"classnamemanager\", \"transition\", \"event-flick\", \"plugin\"], \"skinnable\": true});"]; _yuitest_coverage["build/node-flick/node-flick.js"].lines = {"1":0,"14":0,"40":0,"41":0,"44":0,"112":0,"162":0,"173":0,"175":0,"184":0,"186":0,"187":0,"189":0,"202":0,"211":0,"212":0,"213":0,"214":0,"217":0,"218":0,"219":0,"220":0,"223":0,"225":0,"226":0,"237":0,"238":0,"249":0,"250":0,"251":0,"262":0,"275":0,"277":0,"279":0,"280":0,"283":0,"284":0,"287":0,"289":0,"291":0,"293":0,"294":0,"295":0,"296":0,"297":0,"298":0,"299":0,"303":0,"304":0,"305":0,"306":0,"307":0,"308":0,"309":0,"315":0,"316":0,"317":0,"320":0,"321":0,"322":0,"325":0,"326":0,"329":0,"330":0,"333":0,"345":0,"356":0,"373":0,"374":0,"376":0,"379":0,"380":0,"382":0,"385":0,"386":0,"388":0,"389":0,"391":0,"406":0,"415":0,"416":0,"418":0,"419":0,"422":0,"436":0,"440":0,"442":0,"443":0,"444":0,"445":0,"446":0,"449":0,"459":0,"460":0,"520":0}; _yuitest_coverage["build/node-flick/node-flick.js"].functions = {"Flick:40":0,"valueFn:111":0,"initializer:183":0,"setBounds:201":0,"_renderClasses:236":0,"_onFlick:248":0,"_flickAnim:260":0,"_setX:344":0,"_setY:355":0,"_move:371":0,"_anim:405":0,"_bounce:435":0,"_killTimer:458":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-flick/node-flick.js"].coveredLines = 95;@@ -162,11 +162,11 @@ }, /**- * The constraining box relative to which the flick animation and bounds should be calculated.+ * Time between flick animation frames. *- * @attribute boundingBox- * @type Node- * @default parentNode+ * @attribute step+ * @type Number+ * @default 10 */ step : { value:10@@ -668,4 +668,4 @@ Y.Plugin.Flick = Flick; -}, '3.7.2', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});+}, '3.7.3', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});
bundle/node-flick/node-flick-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -120,11 +120,11 @@ }, /**- * The constraining box relative to which the flick animation and bounds should be calculated.+ * Time between flick animation frames. *- * @attribute boundingBox- * @type Node- * @default parentNode+ * @attribute step+ * @type Number+ * @default 10 */ step : { value:10@@ -527,4 +527,4 @@ Y.Plugin.Flick = Flick; -}, '3.7.2', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});+}, '3.7.3', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});
bundle/node-flick/node-flick-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-flick",function(e,t){function b(e){b.superclass.constructor.apply(this,arguments)}var n="host",r="parentNode",i="boundingBox",s="offsetHeight",o="offsetWidth",u="scrollHeight",a="scrollWidth",f="bounce",l="minDistance",c="minVelocity",h="bounceDistance",p="deceleration",d="step",v="duration",m="easing",g="flick",y=e.ClassNameManager.getClassName;b.ATTRS={deceleration:{value:.98},bounce:{value:.7},bounceDistance:{value:150},minVelocity:{value:0},minDistance:{value:10},boundingBox:{valueFn:function(){return this.get(n).get(r)}},step:{value:10},duration:{value:null},easing:{value:null}},b.NAME="pluginFlick",b.NS="flick",e.extend(b,e.Plugin.Base,{initializer:function(t){this._node=this.get(n),this._renderClasses(),this.setBounds(),this._node.on(g,e.bind(this._onFlick,this),{minDistance:this.get(l),minVelocity:this.get(c)})},setBounds:function(){var e=this.get(i),t=this._node,n=e.get(s),r=e.get(o),f=t.get(u),l=t.get(a);f>n&&(this._maxY=f-n,this._minY=0,this._scrollY=!0),l>r&&(this._maxX=l-r,this._minX=0,this._scrollX=!0),this._x=this._y=0,t.set("top",this._y+"px"),t.set("left",this._x+"px")},_renderClasses:function(){this.get(i).addClass(b.CLASS_NAMES.box),this._node.addClass(b.CLASS_NAMES.content)},_onFlick:function(e){this._v=e.flick.velocity,this._flick=!0,this._flickAnim()},_flickAnim:function(){var t=this._y,n=this._x,r=this._maxY,i=this._minY,s=this._maxX,o=this._minX,u=this._v,a=this.get(d),l=this.get(p),c=this.get(f);this._v=u*l,this._snapToEdge=!1,this._scrollX&&(n-=u*a),this._scrollY&&(t-=u*a),Math.abs(u).toFixed(4)<=b.VELOCITY_THRESHOLD?(this._flick=!1,this._killTimer(!this._exceededYBoundary&&!this._exceededXBoundary),this._scrollX&&(n<o?(this._snapToEdge=!0,this._setX(o)):n>s&&(this._snapToEdge=!0,this._setX(s))),this._scrollY&&(t<i?(this._snapToEdge=!0,this._setY(i)):t>r&&(this._snapToEdge=!0,this._setY(r)))):(this._scrollX&&(n<o||n>s)&&(this._exceededXBoundary=!0,this._v*=c),this._scrollY&&(t<i||t>r)&&(this._exceededYBoundary=!0,this._v*=c),this._scrollX&&this._setX(n),this._scrollY&&this._setY(t),this._flickTimer=e.later(a,this,this._flickAnim))},_setX:function(e){this._move(e,null,this.get(v),this.get(m))},_setY:function(e){this._move(null,e,this.get(v),this.get(m))},_move:function(e,t,n,r){e!==null?e=this._bounce(e):e=this._x,t!==null?t=this._bounce(t):t=this._y,n=n||this._snapToEdge?b.SNAP_DURATION:0,r=r||this._snapToEdge?b.SNAP_EASING:b.EASING,this._x=e,this._y=t,this._anim(e,t,n,r)},_anim:function(t,n,r,i){var s=t*-1,o=n*-1,u={duration:r/1e3,easing:i};e.Transition.useNative?u.transform="translate("+s+"px,"+o+"px)":(u.left=s+"px",u.top=o+"px"),this._node.transition(u)},_bounce:function(e,t){var n=this.get(f),r=this.get(h),i=n?-r:0;return t=n?t+r:t,n||(e<i?e=i:e>t&&(e=t)),e},_killTimer:function(){this._flickTimer&&this._flickTimer.cancel()}},{VELOCITY_THRESHOLD:.015,SNAP_DURATION:400,EASING:"cubic-bezier(0, 0.1, 0, 1.0)",SNAP_EASING:"ease-out",CLASS_NAMES:{box:y(b.NS),content:y(b.NS,"content")}}),e.Plugin.Flick=b},"3.7.2",{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0});+YUI.add("node-flick",function(e,t){function b(e){b.superclass.constructor.apply(this,arguments)}var n="host",r="parentNode",i="boundingBox",s="offsetHeight",o="offsetWidth",u="scrollHeight",a="scrollWidth",f="bounce",l="minDistance",c="minVelocity",h="bounceDistance",p="deceleration",d="step",v="duration",m="easing",g="flick",y=e.ClassNameManager.getClassName;b.ATTRS={deceleration:{value:.98},bounce:{value:.7},bounceDistance:{value:150},minVelocity:{value:0},minDistance:{value:10},boundingBox:{valueFn:function(){return this.get(n).get(r)}},step:{value:10},duration:{value:null},easing:{value:null}},b.NAME="pluginFlick",b.NS="flick",e.extend(b,e.Plugin.Base,{initializer:function(t){this._node=this.get(n),this._renderClasses(),this.setBounds(),this._node.on(g,e.bind(this._onFlick,this),{minDistance:this.get(l),minVelocity:this.get(c)})},setBounds:function(){var e=this.get(i),t=this._node,n=e.get(s),r=e.get(o),f=t.get(u),l=t.get(a);f>n&&(this._maxY=f-n,this._minY=0,this._scrollY=!0),l>r&&(this._maxX=l-r,this._minX=0,this._scrollX=!0),this._x=this._y=0,t.set("top",this._y+"px"),t.set("left",this._x+"px")},_renderClasses:function(){this.get(i).addClass(b.CLASS_NAMES.box),this._node.addClass(b.CLASS_NAMES.content)},_onFlick:function(e){this._v=e.flick.velocity,this._flick=!0,this._flickAnim()},_flickAnim:function(){var t=this._y,n=this._x,r=this._maxY,i=this._minY,s=this._maxX,o=this._minX,u=this._v,a=this.get(d),l=this.get(p),c=this.get(f);this._v=u*l,this._snapToEdge=!1,this._scrollX&&(n-=u*a),this._scrollY&&(t-=u*a),Math.abs(u).toFixed(4)<=b.VELOCITY_THRESHOLD?(this._flick=!1,this._killTimer(!this._exceededYBoundary&&!this._exceededXBoundary),this._scrollX&&(n<o?(this._snapToEdge=!0,this._setX(o)):n>s&&(this._snapToEdge=!0,this._setX(s))),this._scrollY&&(t<i?(this._snapToEdge=!0,this._setY(i)):t>r&&(this._snapToEdge=!0,this._setY(r)))):(this._scrollX&&(n<o||n>s)&&(this._exceededXBoundary=!0,this._v*=c),this._scrollY&&(t<i||t>r)&&(this._exceededYBoundary=!0,this._v*=c),this._scrollX&&this._setX(n),this._scrollY&&this._setY(t),this._flickTimer=e.later(a,this,this._flickAnim))},_setX:function(e){this._move(e,null,this.get(v),this.get(m))},_setY:function(e){this._move(null,e,this.get(v),this.get(m))},_move:function(e,t,n,r){e!==null?e=this._bounce(e):e=this._x,t!==null?t=this._bounce(t):t=this._y,n=n||this._snapToEdge?b.SNAP_DURATION:0,r=r||this._snapToEdge?b.SNAP_EASING:b.EASING,this._x=e,this._y=t,this._anim(e,t,n,r)},_anim:function(t,n,r,i){var s=t*-1,o=n*-1,u={duration:r/1e3,easing:i};e.Transition.useNative?u.transform="translate("+s+"px,"+o+"px)":(u.left=s+"px",u.top=o+"px"),this._node.transition(u)},_bounce:function(e,t){var n=this.get(f),r=this.get(h),i=n?-r:0;return t=n?t+r:t,n||(e<i?e=i:e>t&&(e=t)),e},_killTimer:function(){this._flickTimer&&this._flickTimer.cancel()}},{VELOCITY_THRESHOLD:.015,SNAP_DURATION:400,EASING:"cubic-bezier(0, 0.1, 0, 1.0)",SNAP_EASING:"ease-out",CLASS_NAMES:{box:y(b.NS),content:y(b.NS,"content")}}),e.Plugin.Flick=b},"3.7.3",{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0});
bundle/node-flick/node-flick.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -120,11 +120,11 @@ }, /**- * The constraining box relative to which the flick animation and bounds should be calculated.+ * Time between flick animation frames. *- * @attribute boundingBox- * @type Node- * @default parentNode+ * @attribute step+ * @type Number+ * @default 10 */ step : { value:10@@ -526,4 +526,4 @@ Y.Plugin.Flick = Flick; -}, '3.7.2', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});+}, '3.7.3', {"requires": ["classnamemanager", "transition", "event-flick", "plugin"], "skinnable": true});
bundle/node-focusmanager/node-focusmanager-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-focusmanager/node-focusmanager.js", code: [] };-_yuitest_coverage["build/node-focusmanager/node-focusmanager.js"].code=["YUI.add('node-focusmanager', function (Y, NAME) {","","/**","* <p>The Focus Manager Node Plugin makes it easy to manage focus among","* a Node's descendants. Primarily intended to help with widget development,","* the Focus Manager Node Plugin can be used to improve the keyboard","* accessibility of widgets.</p>","*","* <p>","* When designing widgets that manage a set of descendant controls (i.e. buttons","* in a toolbar, tabs in a tablist, menuitems in a menu, etc.) it is important to","* limit the number of descendants in the browser's default tab flow. The fewer","* number of descendants in the default tab flow, the easier it is for keyboard","* users to navigate between widgets by pressing the tab key. When a widget has","* focus it should provide a set of shortcut keys (typically the arrow keys)","* to move focus among its descendants.","* </p>","*","* <p>","* To this end, the Focus Manager Node Plugin makes it easy to define a Node's","* focusable descendants, define which descendant should be in the default tab","* flow, and define the keys that move focus among each descendant.","* Additionally, as the CSS","* <a href=\"http://www.w3.org/TR/CSS21/selector.html#x38\"><code>:focus</code></a>","* pseudo class is not supported on all elements in all","* <a href=\"http://developer.yahoo.com/yui/articles/gbs/\">A-Grade browsers</a>,","* the Focus Manager Node Plugin provides an easy, cross-browser means of","* styling focus.","* </p>","*","* @module node-focusmanager","*/",""," // Frequently used strings","","var ACTIVE_DESCENDANT = \"activeDescendant\","," ID = \"id\","," DISABLED = \"disabled\","," TAB_INDEX = \"tabIndex\","," FOCUSED = \"focused\","," FOCUS_CLASS = \"focusClass\","," CIRCULAR = \"circular\","," UI = \"UI\","," KEY = \"key\","," ACTIVE_DESCENDANT_CHANGE = ACTIVE_DESCENDANT + \"Change\","," HOST = \"host\",",""," // Collection of keys that, when pressed, cause the browser viewport"," // to scroll."," scrollKeys = {"," 37: true,"," 38: true,"," 39: true,"," 40: true"," },",""," clickableElements = {"," \"a\": true,"," \"button\": true,"," \"input\": true,"," \"object\": true"," },",""," // Library shortcuts",""," Lang = Y.Lang,"," UA = Y.UA,",""," /**"," * The NodeFocusManager class is a plugin for a Node instance. The class is used"," * via the <a href=\"Node.html#method_plug\"><code>plug</code></a> method of Node"," * and should not be instantiated directly."," * @namespace plugin"," * @class NodeFocusManager"," */"," NodeFocusManager = function () {",""," NodeFocusManager.superclass.constructor.apply(this, arguments);",""," };","","","NodeFocusManager.ATTRS = {",""," /**"," * Boolean indicating that one of the descendants is focused."," *"," * @attribute focused"," * @readOnly"," * @default false"," * @type boolean"," */"," focused: {",""," value: false,"," readOnly: true",""," },","",""," /**"," * String representing the CSS selector used to define the descendant Nodes"," * whose focus should be managed."," *"," * @attribute descendants"," * @type Y.NodeList"," */"," descendants: {",""," getter: function (value) {",""," return this.get(HOST).all(value);",""," }",""," },","",""," /**"," * <p>Node, or index of the Node, representing the descendant that is either"," * focused or is focusable (<code>tabIndex</code> attribute is set to 0)."," * The value cannot represent a disabled descendant Node. Use a value of -1"," * to remove all descendant Nodes from the default tab flow."," * If no value is specified, the active descendant will be inferred using"," * the following criteria:</p>"," * <ol>"," * <li>Examining the <code>tabIndex</code> attribute of each descendant and"," * using the first descendant whose <code>tabIndex</code> attribute is set"," * to 0</li>"," * <li>If no default can be inferred then the value is set to either 0 or"," * the index of the first enabled descendant.</li>"," * </ol>"," *"," * @attribute activeDescendant"," * @type Number"," */"," activeDescendant: {",""," setter: function (value) {",""," var isNumber = Lang.isNumber,"," INVALID_VALUE = Y.Attribute.INVALID_VALUE,"," descendantsMap = this._descendantsMap,"," descendants = this._descendants,"," nodeIndex,"," returnValue,"," oNode;","",""," if (isNumber(value)) {"," nodeIndex = value;"," returnValue = nodeIndex;"," }"," else if ((value instanceof Y.Node) && descendantsMap) {",""," nodeIndex = descendantsMap[value.get(ID)];",""," if (isNumber(nodeIndex)) {"," returnValue = nodeIndex;"," }"," else {",""," // The user passed a reference to a Node that wasn't one"," // of the descendants."," returnValue = INVALID_VALUE;",""," }",""," }"," else {"," returnValue = INVALID_VALUE;"," }","",""," if (descendants) {",""," oNode = descendants.item(nodeIndex);",""," if (oNode && oNode.get(\"disabled\")) {",""," // Setting the \"activeDescendant\" attribute to the index"," // of a disabled descendant is invalid."," returnValue = INVALID_VALUE;",""," }",""," }",""," return returnValue;",""," }",""," },","",""," /**"," * Object literal representing the keys to be used to navigate between the"," * next/previous descendant. The format for the attribute's value is"," * <code>{ next: \"down:40\", previous: \"down:38\" }</code>. The value for the"," * \"next\" and \"previous\" properties are used to attach"," * <a href=\"event/#keylistener\"><code>key</code></a> event listeners. See"," * the <a href=\"event/#keylistener\">Using the key Event</a> section of"," * the Event documentation for more information on \"key\" event listeners."," *"," * @attribute keys"," * @type Object"," */"," keys: {",""," value: {",""," next: null,"," previous: null",""," }","",""," },","",""," /**"," * String representing the name of class applied to the focused active"," * descendant Node. Can also be an object literal used to define both the"," * class name, and the Node to which the class should be applied. If using"," * an object literal, the format is:"," * <code>{ className: \"focus\", fn: myFunction }</code>. The function"," * referenced by the <code>fn</code> property in the object literal will be"," * passed a reference to the currently focused active descendant Node."," *"," * @attribute focusClass"," * @type String|Object"," */"," focusClass: { },","",""," /**"," * Boolean indicating if focus should be set to the first/last descendant"," * when the end or beginning of the descendants has been reached."," *"," * @attribute circular"," * @type Boolean"," * @default true"," */"," circular: {"," value: true"," }","","};","","Y.extend(NodeFocusManager, Y.Plugin.Base, {",""," // Protected properties",""," // Boolean indicating if the NodeFocusManager is active."," _stopped: true,",""," // NodeList representing the descendants selected via the"," // \"descendants\" attribute."," _descendants: null,",""," // Object literal mapping the IDs of each descendant to its index in the"," // \"_descendants\" NodeList."," _descendantsMap: null,",""," // Reference to the Node instance to which the focused class (defined"," // by the \"focusClass\" attribute) is currently applied."," _focusedNode: null,",""," // Number representing the index of the last descendant Node."," _lastNodeIndex: 0,",""," // Array of handles for event handlers used for a NodeFocusManager instance."," _eventHandlers: null,","","",""," // Protected methods",""," /**"," * @method _initDescendants"," * @description Sets the <code>tabIndex</code> attribute of all of the"," * descendants to -1, except the active descendant, whose"," * <code>tabIndex</code> attribute is set to 0."," * @protected"," */"," _initDescendants: function () {",""," var descendants = this.get(\"descendants\"),"," descendantsMap = {},"," nFirstEnabled = -1,"," nDescendants,"," nActiveDescendant = this.get(ACTIVE_DESCENDANT),"," oNode,"," sID,"," i = 0;","","",""," if (Lang.isUndefined(nActiveDescendant)) {"," nActiveDescendant = -1;"," }","",""," if (descendants) {",""," nDescendants = descendants.size();","",""," for (i = 0; i < nDescendants; i++) {",""," oNode = descendants.item(i);",""," if (nFirstEnabled === -1 && !oNode.get(DISABLED)) {"," nFirstEnabled = i;"," }","",""," // If the user didn't specify a value for the"," // \"activeDescendant\" attribute try to infer it from"," // the markup.",""," // Need to pass \"2\" when using \"getAttribute\" for IE to get"," // the attribute value as it is set in the markup."," // Need to use \"parseInt\" because IE always returns the"," // value as a number, whereas all other browsers return"," // the attribute as a string when accessed"," // via \"getAttribute\".",""," if (nActiveDescendant < 0 &&"," parseInt(oNode.getAttribute(TAB_INDEX, 2), 10) === 0) {",""," nActiveDescendant = i;",""," }",""," if (oNode) {"," oNode.set(TAB_INDEX, -1);"," }",""," sID = oNode.get(ID);",""," if (!sID) {"," sID = Y.guid();"," oNode.set(ID, sID);"," }",""," descendantsMap[sID] = i;",""," }","",""," // If the user didn't specify a value for the"," // \"activeDescendant\" attribute and no default value could be"," // determined from the markup, then default to 0.",""," if (nActiveDescendant < 0) {"," nActiveDescendant = 0;"," }","",""," oNode = descendants.item(nActiveDescendant);",""," // Check to make sure the active descendant isn't disabled,"," // and fall back to the first enabled descendant if it is.",""," if (!oNode || oNode.get(DISABLED)) {"," oNode = descendants.item(nFirstEnabled);"," nActiveDescendant = nFirstEnabled;"," }",""," this._lastNodeIndex = nDescendants - 1;"," this._descendants = descendants;"," this._descendantsMap = descendantsMap;",""," this.set(ACTIVE_DESCENDANT, nActiveDescendant);",""," // Need to set the \"tabIndex\" attribute here, since the"," // \"activeDescendantChange\" event handler used to manage"," // the setting of the \"tabIndex\" attribute isn't wired up yet.",""," if (oNode) {"," oNode.set(TAB_INDEX, 0);"," }",""," }",""," },","",""," /**"," * @method _isDescendant"," * @description Determines if the specified Node instance is a descendant"," * managed by the Focus Manager."," * @param node {Node} Node instance to be checked."," * @return {Boolean} Boolean indicating if the specified Node instance is a"," * descendant managed by the Focus Manager."," * @protected"," */"," _isDescendant: function (node) {",""," return (node.get(ID) in this._descendantsMap);",""," },","",""," /**"," * @method _removeFocusClass"," * @description Removes the class name representing focus (as specified by"," * the \"focusClass\" attribute) from the Node instance to which it is"," * currently applied."," * @protected"," */"," _removeFocusClass: function () {",""," var oFocusedNode = this._focusedNode,"," focusClass = this.get(FOCUS_CLASS),"," sClassName;",""," if (focusClass) {"," sClassName = Lang.isString(focusClass) ?"," focusClass : focusClass.className;"," }",""," if (oFocusedNode && sClassName) {"," oFocusedNode.removeClass(sClassName);"," }",""," },","",""," /**"," * @method _detachKeyHandler"," * @description Detaches the \"key\" event handlers used to support the \"keys\""," * attribute."," * @protected"," */"," _detachKeyHandler: function () {",""," var prevKeyHandler = this._prevKeyHandler,"," nextKeyHandler = this._nextKeyHandler;",""," if (prevKeyHandler) {"," prevKeyHandler.detach();"," }",""," if (nextKeyHandler) {"," nextKeyHandler.detach();"," }",""," },","",""," /**"," * @method _preventScroll"," * @description Prevents the viewport from scolling when the user presses"," * the up, down, left, or right key."," * @protected"," */"," _preventScroll: function (event) {",""," if (scrollKeys[event.keyCode] && this._isDescendant(event.target)) {"," event.preventDefault();"," }",""," },","",""," /**"," * @method _fireClick"," * @description Fires the click event if the enter key is pressed while"," * focused on an HTML element that is not natively clickable."," * @protected"," */"," _fireClick: function (event) {",""," var oTarget = event.target,"," sNodeName = oTarget.get(\"nodeName\").toLowerCase();",""," if (event.keyCode === 13 && (!clickableElements[sNodeName] ||"," (sNodeName === \"a\" && !oTarget.getAttribute(\"href\")))) {","",""," oTarget.simulate(\"click\");",""," }",""," },","",""," /**"," * @method _attachKeyHandler"," * @description Attaches the \"key\" event handlers used to support the \"keys\""," * attribute."," * @protected"," */"," _attachKeyHandler: function () {",""," this._detachKeyHandler();",""," var sNextKey = this.get(\"keys.next\"),"," sPrevKey = this.get(\"keys.previous\"),"," oNode = this.get(HOST),"," aHandlers = this._eventHandlers;",""," if (sPrevKey) {"," this._prevKeyHandler ="," Y.on(KEY, Y.bind(this._focusPrevious, this), oNode, sPrevKey);"," }",""," if (sNextKey) {"," this._nextKeyHandler ="," Y.on(KEY, Y.bind(this._focusNext, this), oNode, sNextKey);"," }","",""," // In Opera it is necessary to call the \"preventDefault\" method in"," // response to the user pressing the arrow keys in order to prevent"," // the viewport from scrolling when the user is moving focus among"," // the focusable descendants.",""," if (UA.opera) {"," aHandlers.push(oNode.on(\"keypress\", this._preventScroll, this));"," }","",""," // For all browsers except Opera: HTML elements that are not natively"," // focusable but made focusable via the tabIndex attribute don't"," // fire a click event when the user presses the enter key. It is"," // possible to work around this problem by simplying dispatching a"," // click event in response to the user pressing the enter key.",""," if (!UA.opera) {"," aHandlers.push(oNode.on(\"keypress\", this._fireClick, this));"," }",""," },","",""," /**"," * @method _detachEventHandlers"," * @description Detaches all event handlers used by the Focus Manager."," * @protected"," */"," _detachEventHandlers: function () {",""," this._detachKeyHandler();",""," var aHandlers = this._eventHandlers;",""," if (aHandlers) {",""," Y.Array.each(aHandlers, function (handle) {"," handle.detach();"," });",""," this._eventHandlers = null;",""," }",""," },","",""," /**"," * @method _detachEventHandlers"," * @description Attaches all event handlers used by the Focus Manager."," * @protected"," */"," _attachEventHandlers: function () {",""," var descendants = this._descendants,"," aHandlers,"," oDocument,"," handle;",""," if (descendants && descendants.size()) {",""," aHandlers = this._eventHandlers || [];"," oDocument = this.get(HOST).get(\"ownerDocument\");","",""," if (aHandlers.length === 0) {","",""," aHandlers.push(oDocument.on(\"focus\", this._onDocFocus, this));",""," aHandlers.push(oDocument.on(\"mousedown\","," this._onDocMouseDown, this));",""," aHandlers.push("," this.after(\"keysChange\", this._attachKeyHandler));",""," aHandlers.push("," this.after(\"descendantsChange\", this._initDescendants));",""," aHandlers.push("," this.after(ACTIVE_DESCENDANT_CHANGE,"," this._afterActiveDescendantChange));","",""," // For performance: defer attaching all key-related event"," // handlers until the first time one of the specified"," // descendants receives focus.",""," handle = this.after(\"focusedChange\", Y.bind(function (event) {",""," if (event.newVal) {","",""," this._attachKeyHandler();",""," // Detach this \"focusedChange\" handler so that the"," // key-related handlers only get attached once.",""," handle.detach();",""," }",""," }, this));",""," aHandlers.push(handle);",""," }","",""," this._eventHandlers = aHandlers;",""," }",""," },","",""," // Protected event handlers",""," /**"," * @method _onDocMouseDown"," * @description \"mousedown\" event handler for the owner document of the"," * Focus Manager's Node."," * @protected"," * @param event {Object} Object representing the DOM event."," */"," _onDocMouseDown: function (event) {",""," var oHost = this.get(HOST),"," oTarget = event.target,"," bChildNode = oHost.contains(oTarget),"," node,",""," getFocusable = function (node) {",""," var returnVal = false;",""," if (!node.compareTo(oHost)) {",""," returnVal = this._isDescendant(node) ? node :"," getFocusable.call(this, node.get(\"parentNode\"));",""," }",""," return returnVal;",""," };","",""," if (bChildNode) {",""," // Check to make sure that the target isn't a child node of one"," // of the focusable descendants.",""," node = getFocusable.call(this, oTarget);",""," if (node) {"," oTarget = node;"," }"," else if (!node && this.get(FOCUSED)) {",""," // The target was a non-focusable descendant of the root"," // node, so the \"focused\" attribute should be set to false.",""," this._set(FOCUSED, false);"," this._onDocFocus(event);",""," }",""," }","",""," if (bChildNode && this._isDescendant(oTarget)) {",""," // Fix general problem in Webkit: mousing down on a button or an"," // anchor element doesn't focus it.",""," // For all browsers: makes sure that the descendant that"," // was the target of the mousedown event is now considered the"," // active descendant.",""," this.focus(oTarget);"," }"," else if (UA.webkit && this.get(FOCUSED) &&"," (!bChildNode || (bChildNode && !this._isDescendant(oTarget)))) {",""," // Fix for Webkit:",""," // Document doesn't receive focus in Webkit when the user mouses"," // down on it, so the \"focused\" attribute won't get set to the"," // correct value.",""," // The goal is to force a blur if the user moused down on"," // either: 1) A descendant node, but not one that managed by"," // the FocusManager, or 2) an element outside of the"," // FocusManager",""," this._set(FOCUSED, false);"," this._onDocFocus(event);",""," }",""," },","",""," /**"," * @method _onDocFocus"," * @description \"focus\" event handler for the owner document of the"," * Focus Manager's Node."," * @protected"," * @param event {Object} Object representing the DOM event."," */"," _onDocFocus: function (event) {",""," var oTarget = this._focusTarget || event.target,"," bFocused = this.get(FOCUSED),"," focusClass = this.get(FOCUS_CLASS),"," oFocusedNode = this._focusedNode,"," bInCollection;",""," if (this._focusTarget) {"," this._focusTarget = null;"," }","",""," if (this.get(HOST).contains(oTarget)) {",""," // The target is a descendant of the root Node.",""," bInCollection = this._isDescendant(oTarget);",""," if (!bFocused && bInCollection) {",""," // The user has focused a focusable descendant.",""," bFocused = true;",""," }"," else if (bFocused && !bInCollection) {",""," // The user has focused a child of the root Node that is"," // not one of the descendants managed by this Focus Manager"," // so clear the currently focused descendant.",""," bFocused = false;",""," }",""," }"," else {",""," // The target is some other node in the document.",""," bFocused = false;",""," }","",""," if (focusClass) {",""," if (oFocusedNode && (!oFocusedNode.compareTo(oTarget) || !bFocused)) {"," this._removeFocusClass();"," }",""," if (bInCollection && bFocused) {",""," if (focusClass.fn) {"," oTarget = focusClass.fn(oTarget);"," oTarget.addClass(focusClass.className);"," }"," else {"," oTarget.addClass(focusClass);"," }",""," this._focusedNode = oTarget;",""," }",""," }","",""," this._set(FOCUSED, bFocused);",""," },","",""," /**"," * @method _focusNext"," * @description Keydown event handler that moves focus to the next"," * enabled descendant."," * @protected"," * @param event {Object} Object representing the DOM event."," * @param activeDescendant {Number} Number representing the index of the"," * next descendant to be focused"," */"," _focusNext: function (event, activeDescendant) {",""," var nActiveDescendant = activeDescendant || this.get(ACTIVE_DESCENDANT),"," oNode;","",""," if (this._isDescendant(event.target) &&"," (nActiveDescendant <= this._lastNodeIndex)) {",""," nActiveDescendant = nActiveDescendant + 1;",""," if (nActiveDescendant === (this._lastNodeIndex + 1) &&"," this.get(CIRCULAR)) {",""," nActiveDescendant = 0;",""," }",""," oNode = this._descendants.item(nActiveDescendant);",""," if (oNode) {",""," if (oNode.get(\"disabled\")) {"," this._focusNext(event, nActiveDescendant);"," }"," else {"," this.focus(nActiveDescendant);"," }",""," }",""," }",""," this._preventScroll(event);",""," },","",""," /**"," * @method _focusPrevious"," * @description Keydown event handler that moves focus to the previous"," * enabled descendant."," * @protected"," * @param event {Object} Object representing the DOM event."," * @param activeDescendant {Number} Number representing the index of the"," * next descendant to be focused."," */"," _focusPrevious: function (event, activeDescendant) {",""," var nActiveDescendant = activeDescendant || this.get(ACTIVE_DESCENDANT),"," oNode;",""," if (this._isDescendant(event.target) && nActiveDescendant >= 0) {",""," nActiveDescendant = nActiveDescendant - 1;",""," if (nActiveDescendant === -1 && this.get(CIRCULAR)) {"," nActiveDescendant = this._lastNodeIndex;"," }",""," oNode = this._descendants.item(nActiveDescendant);",""," if (oNode) {",""," if (oNode.get(\"disabled\")) {"," this._focusPrevious(event, nActiveDescendant);"," }"," else {"," this.focus(nActiveDescendant);"," }",""," }",""," }",""," this._preventScroll(event);",""," },","",""," /**"," * @method _afterActiveDescendantChange"," * @description afterChange event handler for the"," * \"activeDescendant\" attribute."," * @protected"," * @param event {Object} Object representing the change event."," */"," _afterActiveDescendantChange: function (event) {",""," var oNode = this._descendants.item(event.prevVal);",""," if (oNode) {"," oNode.set(TAB_INDEX, -1);"," }",""," oNode = this._descendants.item(event.newVal);",""," if (oNode) {"," oNode.set(TAB_INDEX, 0);"," }",""," },","","",""," // Public methods",""," initializer: function (config) {",""," this.start();",""," },",""," destructor: function () {",""," this.stop();"," this.get(HOST).focusManager = null;",""," },","",""," /**"," * @method focus"," * @description Focuses the active descendant and sets the"," * <code>focused</code> attribute to true."," * @param index {Number} Optional. Number representing the index of the"," * descendant to be set as the active descendant."," * @param index {Node} Optional. Node instance representing the"," * descendant to be set as the active descendant."," */"," focus: function (index) {",""," if (Lang.isUndefined(index)) {"," index = this.get(ACTIVE_DESCENDANT);"," }",""," this.set(ACTIVE_DESCENDANT, index, { src: UI });",""," var oNode = this._descendants.item(this.get(ACTIVE_DESCENDANT));",""," if (oNode) {",""," oNode.focus();",""," // In Opera focusing a <BUTTON> element programmatically"," // will result in the document-level focus event handler"," // \"_onDocFocus\" being called, resulting in the handler"," // incorrectly setting the \"focused\" Attribute to false. To fix"," // this, set a flag (\"_focusTarget\") that the \"_onDocFocus\" method"," // can look for to properly handle this edge case.",""," if (UA.opera && oNode.get(\"nodeName\").toLowerCase() === \"button\") {"," this._focusTarget = oNode;"," }",""," }",""," },","",""," /**"," * @method blur"," * @description Blurs the current active descendant and sets the"," * <code>focused</code> attribute to false."," */"," blur: function () {",""," var oNode;",""," if (this.get(FOCUSED)) {",""," oNode = this._descendants.item(this.get(ACTIVE_DESCENDANT));",""," if (oNode) {",""," oNode.blur();",""," // For Opera and Webkit: Blurring an element in either browser"," // doesn't result in another element (such as the document)"," // being focused. Therefore, the \"_onDocFocus\" method"," // responsible for managing the application and removal of the"," // focus indicator class name is never called.",""," this._removeFocusClass();",""," }",""," this._set(FOCUSED, false, { src: UI });"," }",""," },","",""," /**"," * @method start"," * @description Enables the Focus Manager."," */"," start: function () {",""," if (this._stopped) {",""," this._initDescendants();"," this._attachEventHandlers();",""," this._stopped = false;",""," }",""," },","",""," /**"," * @method stop"," * @description Disables the Focus Manager by detaching all event handlers."," */"," stop: function () {",""," if (!this._stopped) {",""," this._detachEventHandlers();",""," this._descendants = null;"," this._focusedNode = null;"," this._lastNodeIndex = 0;"," this._stopped = true;",""," }",""," },","",""," /**"," * @method refresh"," * @description Refreshes the Focus Manager's descendants by re-executing the"," * CSS selector query specified by the <code>descendants</code> attribute."," */"," refresh: function () {",""," this._initDescendants();",""," if (!this._eventHandlers) {"," this._attachEventHandlers();"," }",""," }","","});","","","NodeFocusManager.NAME = \"nodeFocusManager\";","NodeFocusManager.NS = \"focusManager\";","","Y.namespace(\"Plugin\");","Y.Plugin.NodeFocusManager = NodeFocusManager;","","","}, '3.7.2', {\"requires\": [\"attribute\", \"node\", \"plugin\", \"node-event-simulate\", \"event-key\", \"event-focus\"]});"];+_yuitest_coverage["build/node-focusmanager/node-focusmanager.js"].code=["YUI.add('node-focusmanager', function (Y, NAME) {","","/**","* <p>The Focus Manager Node Plugin makes it easy to manage focus among","* a Node's descendants. Primarily intended to help with widget development,","* the Focus Manager Node Plugin can be used to improve the keyboard","* accessibility of widgets.</p>","*","* <p>","* When designing widgets that manage a set of descendant controls (i.e. buttons","* in a toolbar, tabs in a tablist, menuitems in a menu, etc.) it is important to","* limit the number of descendants in the browser's default tab flow. The fewer","* number of descendants in the default tab flow, the easier it is for keyboard","* users to navigate between widgets by pressing the tab key. When a widget has","* focus it should provide a set of shortcut keys (typically the arrow keys)","* to move focus among its descendants.","* </p>","*","* <p>","* To this end, the Focus Manager Node Plugin makes it easy to define a Node's","* focusable descendants, define which descendant should be in the default tab","* flow, and define the keys that move focus among each descendant.","* Additionally, as the CSS","* <a href=\"http://www.w3.org/TR/CSS21/selector.html#x38\"><code>:focus</code></a>","* pseudo class is not supported on all elements in all","* <a href=\"http://developer.yahoo.com/yui/articles/gbs/\">A-Grade browsers</a>,","* the Focus Manager Node Plugin provides an easy, cross-browser means of","* styling focus.","* </p>","*","* @module node-focusmanager","*/",""," // Frequently used strings","","var ACTIVE_DESCENDANT = \"activeDescendant\","," ID = \"id\","," DISABLED = \"disabled\","," TAB_INDEX = \"tabIndex\","," FOCUSED = \"focused\","," FOCUS_CLASS = \"focusClass\","," CIRCULAR = \"circular\","," UI = \"UI\","," KEY = \"key\","," ACTIVE_DESCENDANT_CHANGE = ACTIVE_DESCENDANT + \"Change\","," HOST = \"host\",",""," // Collection of keys that, when pressed, cause the browser viewport"," // to scroll."," scrollKeys = {"," 37: true,"," 38: true,"," 39: true,"," 40: true"," },",""," clickableElements = {"," \"a\": true,"," \"button\": true,"," \"input\": true,"," \"object\": true"," },",""," // Library shortcuts",""," Lang = Y.Lang,"," UA = Y.UA,",""," /**"," * The NodeFocusManager class is a plugin for a Node instance. The class is used"," * via the <a href=\"Node.html#method_plug\"><code>plug</code></a> method of Node"," * and should not be instantiated directly."," * @namespace plugin"," * @class NodeFocusManager"," */"," NodeFocusManager = function () {",""," NodeFocusManager.superclass.constructor.apply(this, arguments);",""," };","","","NodeFocusManager.ATTRS = {",""," /**"," * Boolean indicating that one of the descendants is focused."," *"," * @attribute focused"," * @readOnly"," * @default false"," * @type boolean"," */"," focused: {",""," value: false,"," readOnly: true",""," },","",""," /**"," * String representing the CSS selector used to define the descendant Nodes"," * whose focus should be managed."," *"," * @attribute descendants"," * @type Y.NodeList"," */"," descendants: {",""," getter: function (value) {",""," return this.get(HOST).all(value);",""," }",""," },","",""," /**"," * <p>Node, or index of the Node, representing the descendant that is either"," * focused or is focusable (<code>tabIndex</code> attribute is set to 0)."," * The value cannot represent a disabled descendant Node. Use a value of -1"," * to remove all descendant Nodes from the default tab flow."," * If no value is specified, the active descendant will be inferred using"," * the following criteria:</p>"," * <ol>"," * <li>Examining the <code>tabIndex</code> attribute of each descendant and"," * using the first descendant whose <code>tabIndex</code> attribute is set"," * to 0</li>"," * <li>If no default can be inferred then the value is set to either 0 or"," * the index of the first enabled descendant.</li>"," * </ol>"," *"," * @attribute activeDescendant"," * @type Number"," */"," activeDescendant: {",""," setter: function (value) {",""," var isNumber = Lang.isNumber,"," INVALID_VALUE = Y.Attribute.INVALID_VALUE,"," descendantsMap = this._descendantsMap,"," descendants = this._descendants,"," nodeIndex,"," returnValue,"," oNode;","",""," if (isNumber(value)) {"," nodeIndex = value;"," returnValue = nodeIndex;"," }"," else if ((value instanceof Y.Node) && descendantsMap) {",""," nodeIndex = descendantsMap[value.get(ID)];",""," if (isNumber(nodeIndex)) {"," returnValue = nodeIndex;"," }"," else {",""," // The user passed a reference to a Node that wasn't one"," // of the descendants."," returnValue = INVALID_VALUE;",""," }",""," }"," else {"," returnValue = INVALID_VALUE;"," }","",""," if (descendants) {",""," oNode = descendants.item(nodeIndex);",""," if (oNode && oNode.get(\"disabled\")) {",""," // Setting the \"activeDescendant\" attribute to the index"," // of a disabled descendant is invalid."," returnValue = INVALID_VALUE;",""," }",""," }",""," return returnValue;",""," }",""," },","",""," /**"," * Object literal representing the keys to be used to navigate between the"," * next/previous descendant. The format for the attribute's value is"," * <code>{ next: \"down:40\", previous: \"down:38\" }</code>. The value for the"," * \"next\" and \"previous\" properties are used to attach"," * <a href=\"event/#keylistener\"><code>key</code></a> event listeners. See"," * the <a href=\"event/#keylistener\">Using the key Event</a> section of"," * the Event documentation for more information on \"key\" event listeners."," *"," * @attribute keys"," * @type Object"," */"," keys: {",""," value: {",""," next: null,"," previous: null",""," }","",""," },","",""," /**"," * String representing the name of class applied to the focused active"," * descendant Node. Can also be an object literal used to define both the"," * class name, and the Node to which the class should be applied. If using"," * an object literal, the format is:"," * <code>{ className: \"focus\", fn: myFunction }</code>. The function"," * referenced by the <code>fn</code> property in the object literal will be"," * passed a reference to the currently focused active descendant Node."," *"," * @attribute focusClass"," * @type String|Object"," */"," focusClass: { },","",""," /**"," * Boolean indicating if focus should be set to the first/last descendant"," * when the end or beginning of the descendants has been reached."," *"," * @attribute circular"," * @type Boolean"," * @default true"," */"," circular: {"," value: true"," }","","};","","Y.extend(NodeFocusManager, Y.Plugin.Base, {",""," // Protected properties",""," // Boolean indicating if the NodeFocusManager is active."," _stopped: true,",""," // NodeList representing the descendants selected via the"," // \"descendants\" attribute."," _descendants: null,",""," // Object literal mapping the IDs of each descendant to its index in the"," // \"_descendants\" NodeList."," _descendantsMap: null,",""," // Reference to the Node instance to which the focused class (defined"," // by the \"focusClass\" attribute) is currently applied."," _focusedNode: null,",""," // Number representing the index of the last descendant Node."," _lastNodeIndex: 0,",""," // Array of handles for event handlers used for a NodeFocusManager instance."," _eventHandlers: null,","","",""," // Protected methods",""," /**"," * @method _initDescendants"," * @description Sets the <code>tabIndex</code> attribute of all of the"," * descendants to -1, except the active descendant, whose"," * <code>tabIndex</code> attribute is set to 0."," * @protected"," */"," _initDescendants: function () {",""," var descendants = this.get(\"descendants\"),"," descendantsMap = {},"," nFirstEnabled = -1,"," nDescendants,"," nActiveDescendant = this.get(ACTIVE_DESCENDANT),"," oNode,"," sID,"," i = 0;","","",""," if (Lang.isUndefined(nActiveDescendant)) {"," nActiveDescendant = -1;"," }","",""," if (descendants) {",""," nDescendants = descendants.size();","",""," for (i = 0; i < nDescendants; i++) {",""," oNode = descendants.item(i);",""," if (nFirstEnabled === -1 && !oNode.get(DISABLED)) {"," nFirstEnabled = i;"," }","",""," // If the user didn't specify a value for the"," // \"activeDescendant\" attribute try to infer it from"," // the markup.",""," // Need to pass \"2\" when using \"getAttribute\" for IE to get"," // the attribute value as it is set in the markup."," // Need to use \"parseInt\" because IE always returns the"," // value as a number, whereas all other browsers return"," // the attribute as a string when accessed"," // via \"getAttribute\".",""," if (nActiveDescendant < 0 &&"," parseInt(oNode.getAttribute(TAB_INDEX, 2), 10) === 0) {",""," nActiveDescendant = i;",""," }",""," if (oNode) {"," oNode.set(TAB_INDEX, -1);"," }",""," sID = oNode.get(ID);",""," if (!sID) {"," sID = Y.guid();"," oNode.set(ID, sID);"," }",""," descendantsMap[sID] = i;",""," }","",""," // If the user didn't specify a value for the"," // \"activeDescendant\" attribute and no default value could be"," // determined from the markup, then default to 0.",""," if (nActiveDescendant < 0) {"," nActiveDescendant = 0;"," }","",""," oNode = descendants.item(nActiveDescendant);",""," // Check to make sure the active descendant isn't disabled,"," // and fall back to the first enabled descendant if it is.",""," if (!oNode || oNode.get(DISABLED)) {"," oNode = descendants.item(nFirstEnabled);"," nActiveDescendant = nFirstEnabled;"," }",""," this._lastNodeIndex = nDescendants - 1;"," this._descendants = descendants;"," this._descendantsMap = descendantsMap;",""," this.set(ACTIVE_DESCENDANT, nActiveDescendant);",""," // Need to set the \"tabIndex\" attribute here, since the"," // \"activeDescendantChange\" event handler used to manage"," // the setting of the \"tabIndex\" attribute isn't wired up yet.",""," if (oNode) {"," oNode.set(TAB_INDEX, 0);"," }",""," }",""," },","",""," /**"," * @method _isDescendant"," * @description Determines if the specified Node instance is a descendant"," * managed by the Focus Manager."," * @param node {Node} Node instance to be checked."," * @return {Boolean} Boolean indicating if the specified Node instance is a"," * descendant managed by the Focus Manager."," * @protected"," */"," _isDescendant: function (node) {",""," return (node.get(ID) in this._descendantsMap);",""," },","",""," /**"," * @method _removeFocusClass"," * @description Removes the class name representing focus (as specified by"," * the \"focusClass\" attribute) from the Node instance to which it is"," * currently applied."," * @protected"," */"," _removeFocusClass: function () {",""," var oFocusedNode = this._focusedNode,"," focusClass = this.get(FOCUS_CLASS),"," sClassName;",""," if (focusClass) {"," sClassName = Lang.isString(focusClass) ?"," focusClass : focusClass.className;"," }",""," if (oFocusedNode && sClassName) {"," oFocusedNode.removeClass(sClassName);"," }",""," },","",""," /**"," * @method _detachKeyHandler"," * @description Detaches the \"key\" event handlers used to support the \"keys\""," * attribute."," * @protected"," */"," _detachKeyHandler: function () {",""," var prevKeyHandler = this._prevKeyHandler,"," nextKeyHandler = this._nextKeyHandler;",""," if (prevKeyHandler) {"," prevKeyHandler.detach();"," }",""," if (nextKeyHandler) {"," nextKeyHandler.detach();"," }",""," },","",""," /**"," * @method _preventScroll"," * @description Prevents the viewport from scolling when the user presses"," * the up, down, left, or right key."," * @protected"," */"," _preventScroll: function (event) {",""," if (scrollKeys[event.keyCode] && this._isDescendant(event.target)) {"," event.preventDefault();"," }",""," },","",""," /**"," * @method _fireClick"," * @description Fires the click event if the enter key is pressed while"," * focused on an HTML element that is not natively clickable."," * @protected"," */"," _fireClick: function (event) {",""," var oTarget = event.target,"," sNodeName = oTarget.get(\"nodeName\").toLowerCase();",""," if (event.keyCode === 13 && (!clickableElements[sNodeName] ||"," (sNodeName === \"a\" && !oTarget.getAttribute(\"href\")))) {","",""," oTarget.simulate(\"click\");",""," }",""," },","",""," /**"," * @method _attachKeyHandler"," * @description Attaches the \"key\" event handlers used to support the \"keys\""," * attribute."," * @protected"," */"," _attachKeyHandler: function () {",""," this._detachKeyHandler();",""," var sNextKey = this.get(\"keys.next\"),"," sPrevKey = this.get(\"keys.previous\"),"," oNode = this.get(HOST),"," aHandlers = this._eventHandlers;",""," if (sPrevKey) {"," this._prevKeyHandler ="," Y.on(KEY, Y.bind(this._focusPrevious, this), oNode, sPrevKey);"," }",""," if (sNextKey) {"," this._nextKeyHandler ="," Y.on(KEY, Y.bind(this._focusNext, this), oNode, sNextKey);"," }","",""," // In Opera it is necessary to call the \"preventDefault\" method in"," // response to the user pressing the arrow keys in order to prevent"," // the viewport from scrolling when the user is moving focus among"," // the focusable descendants.",""," if (UA.opera) {"," aHandlers.push(oNode.on(\"keypress\", this._preventScroll, this));"," }","",""," // For all browsers except Opera: HTML elements that are not natively"," // focusable but made focusable via the tabIndex attribute don't"," // fire a click event when the user presses the enter key. It is"," // possible to work around this problem by simplying dispatching a"," // click event in response to the user pressing the enter key.",""," if (!UA.opera) {"," aHandlers.push(oNode.on(\"keypress\", this._fireClick, this));"," }",""," },","",""," /**"," * @method _detachEventHandlers"," * @description Detaches all event handlers used by the Focus Manager."," * @protected"," */"," _detachEventHandlers: function () {",""," this._detachKeyHandler();",""," var aHandlers = this._eventHandlers;",""," if (aHandlers) {",""," Y.Array.each(aHandlers, function (handle) {"," handle.detach();"," });",""," this._eventHandlers = null;",""," }",""," },","",""," /**"," * @method _detachEventHandlers"," * @description Attaches all event handlers used by the Focus Manager."," * @protected"," */"," _attachEventHandlers: function () {",""," var descendants = this._descendants,"," aHandlers,"," oDocument,"," handle;",""," if (descendants && descendants.size()) {",""," aHandlers = this._eventHandlers || [];"," oDocument = this.get(HOST).get(\"ownerDocument\");","",""," if (aHandlers.length === 0) {","",""," aHandlers.push(oDocument.on(\"focus\", this._onDocFocus, this));",""," aHandlers.push(oDocument.on(\"mousedown\","," this._onDocMouseDown, this));",""," aHandlers.push("," this.after(\"keysChange\", this._attachKeyHandler));",""," aHandlers.push("," this.after(\"descendantsChange\", this._initDescendants));",""," aHandlers.push("," this.after(ACTIVE_DESCENDANT_CHANGE,"," this._afterActiveDescendantChange));","",""," // For performance: defer attaching all key-related event"," // handlers until the first time one of the specified"," // descendants receives focus.",""," handle = this.after(\"focusedChange\", Y.bind(function (event) {",""," if (event.newVal) {","",""," this._attachKeyHandler();",""," // Detach this \"focusedChange\" handler so that the"," // key-related handlers only get attached once.",""," handle.detach();",""," }",""," }, this));",""," aHandlers.push(handle);",""," }","",""," this._eventHandlers = aHandlers;",""," }",""," },","",""," // Protected event handlers",""," /**"," * @method _onDocMouseDown"," * @description \"mousedown\" event handler for the owner document of the"," * Focus Manager's Node."," * @protected"," * @param event {Object} Object representing the DOM event."," */"," _onDocMouseDown: function (event) {",""," var oHost = this.get(HOST),"," oTarget = event.target,"," bChildNode = oHost.contains(oTarget),"," node,",""," getFocusable = function (node) {",""," var returnVal = false;",""," if (!node.compareTo(oHost)) {",""," returnVal = this._isDescendant(node) ? node :"," getFocusable.call(this, node.get(\"parentNode\"));",""," }",""," return returnVal;",""," };","",""," if (bChildNode) {",""," // Check to make sure that the target isn't a child node of one"," // of the focusable descendants.",""," node = getFocusable.call(this, oTarget);",""," if (node) {"," oTarget = node;"," }"," else if (!node && this.get(FOCUSED)) {",""," // The target was a non-focusable descendant of the root"," // node, so the \"focused\" attribute should be set to false.",""," this._set(FOCUSED, false);"," this._onDocFocus(event);",""," }",""," }","",""," if (bChildNode && this._isDescendant(oTarget)) {",""," // Fix general problem in Webkit: mousing down on a button or an"," // anchor element doesn't focus it.",""," // For all browsers: makes sure that the descendant that"," // was the target of the mousedown event is now considered the"," // active descendant.",""," this.focus(oTarget);"," }"," else if (UA.webkit && this.get(FOCUSED) &&"," (!bChildNode || (bChildNode && !this._isDescendant(oTarget)))) {",""," // Fix for Webkit:",""," // Document doesn't receive focus in Webkit when the user mouses"," // down on it, so the \"focused\" attribute won't get set to the"," // correct value.",""," // The goal is to force a blur if the user moused down on"," // either: 1) A descendant node, but not one that managed by"," // the FocusManager, or 2) an element outside of the"," // FocusManager",""," this._set(FOCUSED, false);"," this._onDocFocus(event);",""," }",""," },","",""," /**"," * @method _onDocFocus"," * @description \"focus\" event handler for the owner document of the"," * Focus Manager's Node."," * @protected"," * @param event {Object} Object representing the DOM event."," */"," _onDocFocus: function (event) {",""," var oTarget = this._focusTarget || event.target,"," bFocused = this.get(FOCUSED),"," focusClass = this.get(FOCUS_CLASS),"," oFocusedNode = this._focusedNode,"," bInCollection;",""," if (this._focusTarget) {"," this._focusTarget = null;"," }","",""," if (this.get(HOST).contains(oTarget)) {",""," // The target is a descendant of the root Node.",""," bInCollection = this._isDescendant(oTarget);",""," if (!bFocused && bInCollection) {",""," // The user has focused a focusable descendant.",""," bFocused = true;",""," }"," else if (bFocused && !bInCollection) {",""," // The user has focused a child of the root Node that is"," // not one of the descendants managed by this Focus Manager"," // so clear the currently focused descendant.",""," bFocused = false;",""," }",""," }"," else {",""," // The target is some other node in the document.",""," bFocused = false;",""," }","",""," if (focusClass) {",""," if (oFocusedNode && (!oFocusedNode.compareTo(oTarget) || !bFocused)) {"," this._removeFocusClass();"," }",""," if (bInCollection && bFocused) {",""," if (focusClass.fn) {"," oTarget = focusClass.fn(oTarget);"," oTarget.addClass(focusClass.className);"," }"," else {"," oTarget.addClass(focusClass);"," }",""," this._focusedNode = oTarget;",""," }",""," }","",""," this._set(FOCUSED, bFocused);",""," },","",""," /**"," * @method _focusNext"," * @description Keydown event handler that moves focus to the next"," * enabled descendant."," * @protected"," * @param event {Object} Object representing the DOM event."," * @param activeDescendant {Number} Number representing the index of the"," * next descendant to be focused"," */"," _focusNext: function (event, activeDescendant) {",""," var nActiveDescendant = activeDescendant || this.get(ACTIVE_DESCENDANT),"," oNode;","",""," if (this._isDescendant(event.target) &&"," (nActiveDescendant <= this._lastNodeIndex)) {",""," nActiveDescendant = nActiveDescendant + 1;",""," if (nActiveDescendant === (this._lastNodeIndex + 1) &&"," this.get(CIRCULAR)) {",""," nActiveDescendant = 0;",""," }",""," oNode = this._descendants.item(nActiveDescendant);",""," if (oNode) {",""," if (oNode.get(\"disabled\")) {"," this._focusNext(event, nActiveDescendant);"," }"," else {"," this.focus(nActiveDescendant);"," }",""," }",""," }",""," this._preventScroll(event);",""," },","",""," /**"," * @method _focusPrevious"," * @description Keydown event handler that moves focus to the previous"," * enabled descendant."," * @protected"," * @param event {Object} Object representing the DOM event."," * @param activeDescendant {Number} Number representing the index of the"," * next descendant to be focused."," */"," _focusPrevious: function (event, activeDescendant) {",""," var nActiveDescendant = activeDescendant || this.get(ACTIVE_DESCENDANT),"," oNode;",""," if (this._isDescendant(event.target) && nActiveDescendant >= 0) {",""," nActiveDescendant = nActiveDescendant - 1;",""," if (nActiveDescendant === -1 && this.get(CIRCULAR)) {"," nActiveDescendant = this._lastNodeIndex;"," }",""," oNode = this._descendants.item(nActiveDescendant);",""," if (oNode) {",""," if (oNode.get(\"disabled\")) {"," this._focusPrevious(event, nActiveDescendant);"," }"," else {"," this.focus(nActiveDescendant);"," }",""," }",""," }",""," this._preventScroll(event);",""," },","",""," /**"," * @method _afterActiveDescendantChange"," * @description afterChange event handler for the"," * \"activeDescendant\" attribute."," * @protected"," * @param event {Object} Object representing the change event."," */"," _afterActiveDescendantChange: function (event) {",""," var oNode = this._descendants.item(event.prevVal);",""," if (oNode) {"," oNode.set(TAB_INDEX, -1);"," }",""," oNode = this._descendants.item(event.newVal);",""," if (oNode) {"," oNode.set(TAB_INDEX, 0);"," }",""," },","","",""," // Public methods",""," initializer: function (config) {",""," this.start();",""," },",""," destructor: function () {",""," this.stop();"," this.get(HOST).focusManager = null;",""," },","",""," /**"," * @method focus"," * @description Focuses the active descendant and sets the"," * <code>focused</code> attribute to true."," * @param index {Number} Optional. Number representing the index of the"," * descendant to be set as the active descendant."," * @param index {Node} Optional. Node instance representing the"," * descendant to be set as the active descendant."," */"," focus: function (index) {",""," if (Lang.isUndefined(index)) {"," index = this.get(ACTIVE_DESCENDANT);"," }",""," this.set(ACTIVE_DESCENDANT, index, { src: UI });",""," var oNode = this._descendants.item(this.get(ACTIVE_DESCENDANT));",""," if (oNode) {",""," oNode.focus();",""," // In Opera focusing a <BUTTON> element programmatically"," // will result in the document-level focus event handler"," // \"_onDocFocus\" being called, resulting in the handler"," // incorrectly setting the \"focused\" Attribute to false. To fix"," // this, set a flag (\"_focusTarget\") that the \"_onDocFocus\" method"," // can look for to properly handle this edge case.",""," if (UA.opera && oNode.get(\"nodeName\").toLowerCase() === \"button\") {"," this._focusTarget = oNode;"," }",""," }",""," },","",""," /**"," * @method blur"," * @description Blurs the current active descendant and sets the"," * <code>focused</code> attribute to false."," */"," blur: function () {",""," var oNode;",""," if (this.get(FOCUSED)) {",""," oNode = this._descendants.item(this.get(ACTIVE_DESCENDANT));",""," if (oNode) {",""," oNode.blur();",""," // For Opera and Webkit: Blurring an element in either browser"," // doesn't result in another element (such as the document)"," // being focused. Therefore, the \"_onDocFocus\" method"," // responsible for managing the application and removal of the"," // focus indicator class name is never called.",""," this._removeFocusClass();",""," }",""," this._set(FOCUSED, false, { src: UI });"," }",""," },","",""," /**"," * @method start"," * @description Enables the Focus Manager."," */"," start: function () {",""," if (this._stopped) {",""," this._initDescendants();"," this._attachEventHandlers();",""," this._stopped = false;",""," }",""," },","",""," /**"," * @method stop"," * @description Disables the Focus Manager by detaching all event handlers."," */"," stop: function () {",""," if (!this._stopped) {",""," this._detachEventHandlers();",""," this._descendants = null;"," this._focusedNode = null;"," this._lastNodeIndex = 0;"," this._stopped = true;",""," }",""," },","",""," /**"," * @method refresh"," * @description Refreshes the Focus Manager's descendants by re-executing the"," * CSS selector query specified by the <code>descendants</code> attribute."," */"," refresh: function () {",""," this._initDescendants();",""," if (!this._eventHandlers) {"," this._attachEventHandlers();"," }",""," }","","});","","","NodeFocusManager.NAME = \"nodeFocusManager\";","NodeFocusManager.NS = \"focusManager\";","","Y.namespace(\"Plugin\");","Y.Plugin.NodeFocusManager = NodeFocusManager;","","","}, '3.7.3', {\"requires\": [\"attribute\", \"node\", \"plugin\", \"node-event-simulate\", \"event-key\", \"event-focus\"]});"]; _yuitest_coverage["build/node-focusmanager/node-focusmanager.js"].lines = {"1":0,"36":0,"78":0,"83":0,"112":0,"141":0,"150":0,"151":0,"152":0,"154":0,"156":0,"158":0,"159":0,"165":0,"171":0,"175":0,"177":0,"179":0,"183":0,"189":0,"250":0,"288":0,"299":0,"300":0,"304":0,"306":0,"309":0,"311":0,"313":0,"314":0,"329":0,"332":0,"336":0,"337":0,"340":0,"342":0,"343":0,"344":0,"347":0,"356":0,"357":0,"361":0,"366":0,"367":0,"368":0,"371":0,"372":0,"373":0,"375":0,"381":0,"382":0,"401":0,"415":0,"419":0,"420":0,"424":0,"425":0,"439":0,"442":0,"443":0,"446":0,"447":0,"461":0,"462":0,"476":0,"479":0,"483":0,"498":0,"500":0,"505":0,"506":0,"510":0,"511":0,"521":0,"522":0,"532":0,"533":0,"546":0,"548":0,"550":0,"552":0,"553":0,"556":0,"570":0,"575":0,"577":0,"578":0,"581":0,"584":0,"586":0,"589":0,"592":0,"595":0,"604":0,"606":0,"609":0,"614":0,"620":0,"625":0,"643":0,"650":0,"652":0,"654":0,"659":0,"664":0,"669":0,"671":0,"672":0,"674":0,"679":0,"680":0,"687":0,"696":0,"698":0,"712":0,"713":0,"729":0,"735":0,"736":0,"740":0,"744":0,"746":0,"750":0,"753":0,"759":0,"768":0,"773":0,"775":0,"776":0,"779":0,"781":0,"782":0,"783":0,"786":0,"789":0,"796":0,"812":0,"816":0,"819":0,"821":0,"824":0,"828":0,"830":0,"832":0,"833":0,"836":0,"843":0,"859":0,"862":0,"864":0,"866":0,"867":0,"870":0,"872":0,"874":0,"875":0,"878":0,"885":0,"899":0,"901":0,"902":0,"905":0,"907":0,"908":0,"919":0,"925":0,"926":0,"942":0,"943":0,"946":0,"948":0,"950":0,"952":0,"961":0,"962":0,"977":0,"979":0,"981":0,"983":0,"985":0,"993":0,"997":0,"1009":0,"1011":0,"1012":0,"1014":0,"1027":0,"1029":0,"1031":0,"1032":0,"1033":0,"1034":0,"1048":0,"1050":0,"1051":0,"1059":0,"1060":0,"1062":0,"1063":0}; _yuitest_coverage["build/node-focusmanager/node-focusmanager.js"].functions = {"NodeFocusManager:76":0,"getter:110":0,"setter:139":0,"_initDescendants:286":0,"_isDescendant:399":0,"_removeFocusClass:413":0,"_detachKeyHandler:437":0,"_preventScroll:459":0,"_fireClick:474":0,"_attachKeyHandler:496":0,"(anonymous 2):552":0,"_detachEventHandlers:544":0,"(anonymous 3):604":0,"_attachEventHandlers:568":0,"getFocusable:648":0,"_onDocMouseDown:641":0,"_onDocFocus:727":0,"_focusNext:810":0,"_focusPrevious:857":0,"_afterActiveDescendantChange:897":0,"initializer:917":0,"destructor:923":0,"focus:940":0,"blur:975":0,"start:1007":0,"stop:1025":0,"refresh:1046":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-focusmanager/node-focusmanager.js"].coveredLines = 199;@@ -1329,4 +1329,4 @@ Y.Plugin.NodeFocusManager = NodeFocusManager; -}, '3.7.2', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});+}, '3.7.3', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});
bundle/node-focusmanager/node-focusmanager-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1072,4 +1072,4 @@ Y.Plugin.NodeFocusManager = NodeFocusManager; -}, '3.7.2', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});+}, '3.7.3', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});
bundle/node-focusmanager/node-focusmanager-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-focusmanager",function(e,t){var n="activeDescendant",r="id",i="disabled",s="tabIndex",o="focused",u="focusClass",a="circular",f="UI",l="key",c=n+"Change",h="host",p={37:!0,38:!0,39:!0,40:!0},d={a:!0,button:!0,input:!0,object:!0},v=e.Lang,m=e.UA,g=function(){g.superclass.constructor.apply(this,arguments)};g.ATTRS={focused:{value:!1,readOnly:!0},descendants:{getter:function(e){return this.get(h).all(e)}},activeDescendant:{setter:function(t){var n=v.isNumber,i=e.Attribute.INVALID_VALUE,s=this._descendantsMap,o=this._descendants,u,a,f;return n(t)?(u=t,a=u):t instanceof e.Node&&s?(u=s[t.get(r)],n(u)?a=u:a=i):a=i,o&&(f=o.item(u),f&&f.get("disabled")&&(a=i)),a}},keys:{value:{next:null,previous:null}},focusClass:{},circular:{value:!0}},e.extend(g,e.Plugin.Base,{_stopped:!0,_descendants:null,_descendantsMap:null,_focusedNode:null,_lastNodeIndex:0,_eventHandlers:null,_initDescendants:function(){var t=this.get("descendants"),o={},u=-1,a,f=this.get(n),l,c,h=0;v.isUndefined(f)&&(f=-1);if(t){a=t.size();for(h=0;h<a;h++)l=t.item(h),u===-1&&!l.get(i)&&(u=h),f<0&&parseInt(l.getAttribute(s,2),10)===0&&(f=h),l&&l.set(s,-1),c=l.get(r),c||(c=e.guid(),l.set(r,c)),o[c]=h;f<0&&(f=0),l=t.item(f);if(!l||l.get(i))l=t.item(u),f=u;this._lastNodeIndex=a-1,this._descendants=t,this._descendantsMap=o,this.set(n,f),l&&l.set(s,0)}},_isDescendant:function(e){return e.get(r)in this._descendantsMap},_removeFocusClass:function(){var e=this._focusedNode,t=this.get(u),n;t&&(n=v.isString(t)?t:t.className),e&&n&&e.removeClass(n)},_detachKeyHandler:function(){var e=this._prevKeyHandler,t=this._nextKeyHandler;e&&e.detach(),t&&t.detach()},_preventScroll:function(e){p[e.keyCode]&&this._isDescendant(e.target)&&e.preventDefault()},_fireClick:function(e){var t=e.target,n=t.get("nodeName").toLowerCase();e.keyCode===13&&(!d[n]||n==="a"&&!t.getAttribute("href"))&&t.simulate("click")},_attachKeyHandler:function(){this._detachKeyHandler();var t=this.get("keys.next"),n=this.get("keys.previous"),r=this.get(h),i=this._eventHandlers;n&&(this._prevKeyHandler=e.on(l,e.bind(this._focusPrevious,this),r,n)),t&&(this._nextKeyHandler=e.on(l,e.bind(this._focusNext,this),r,t)),m.opera&&i.push(r.on("keypress",this._preventScroll,this)),m.opera||i.push(r.on("keypress",this._fireClick,this))},_detachEventHandlers:function(){this._detachKeyHandler();var t=this._eventHandlers;t&&(e.Array.each(t,function(e){e.detach()}),this._eventHandlers=null)},_attachEventHandlers:function(){var t=this._descendants,n,r,i;t&&t.size()&&(n=this._eventHandlers||[],r=this.get(h).get("ownerDocument"),n.length===0&&(n.push(r.on("focus",this._onDocFocus,this)),n.push(r.on("mousedown",this._onDocMouseDown,this)),n.push(this.after("keysChange",this._attachKeyHandler)),n.push(this.after("descendantsChange",this._initDescendants)),n.push(this.after(c,this._afterActiveDescendantChange)),i=this.after("focusedChange",e.bind(function(e){e.newVal&&(this._attachKeyHandler(),i.detach())},this)),n.push(i)),this._eventHandlers=n)},_onDocMouseDown:function(e){var t=this.get(h),n=e.target,r=t.contains(n),i,s=function(e){var n=!1;return e.compareTo(t)||(n=this._isDescendant(e)?e:s.call(this,e.get("parentNode"))),n};r&&(i=s.call(this,n),i?n=i:!i&&this.get(o)&&(this._set(o,!1),this._onDocFocus(e))),r&&this._isDescendant(n)?this.focus(n):m.webkit&&this.get(o)&&(!r||r&&!this._isDescendant(n))&&(this._set(o,!1),this._onDocFocus(e))},_onDocFocus:function(e){var t=this._focusTarget||e.target,n=this.get(o),r=this.get(u),i=this._focusedNode,s;this._focusTarget&&(this._focusTarget=null),this.get(h).contains(t)?(s=this._isDescendant(t),!n&&s?n=!0:n&&!s&&(n=!1)):n=!1,r&&(i&&(!i.compareTo(t)||!n)&&this._removeFocusClass(),s&&n&&(r.fn?(t=r.fn(t),t.addClass(r.className)):t.addClass(r),this._focusedNode=t)),this._set(o,n)},_focusNext:function(e,t){var r=t||this.get(n),i;this._isDescendant(e.target)&&r<=this._lastNodeIndex&&(r+=1,r===this._lastNodeIndex+1&&this.get(a)&&(r=0),i=this._descendants.item(r),i&&(i.get("disabled")?this._focusNext(e,r):this.focus(r))),this._preventScroll(e)},_focusPrevious:function(e,t){var r=t||this.get(n),i;this._isDescendant(e.target)&&r>=0&&(r-=1,r===-1&&this.get(a)&&(r=this._lastNodeIndex),i=this._descendants.item(r),i&&(i.get("disabled")?this._focusPrevious(e,r):this.focus(r))),this._preventScroll(e)},_afterActiveDescendantChange:function(e){var t=this._descendants.item(e.prevVal);t&&t.set(s,-1),t=this._descendants.item(e.newVal),t&&t.set(s,0)},initializer:function(e){this.start()},destructor:function(){this.stop(),this.get(h).focusManager=null},focus:function(e){v.isUndefined(e)&&(e=this.get(n)),this.set(n,e,{src:f});var t=this._descendants.item(this.get(n));t&&(t.focus(),m.opera&&t.get("nodeName").toLowerCase()==="button"&&(this._focusTarget=t))},blur:function(){var e;this.get(o)&&(e=this._descendants.item(this.get(n)),e&&(e.blur(),this._removeFocusClass()),this._set(o,!1,{src:f}))},start:function(){this._stopped&&(this._initDescendants(),this._attachEventHandlers(),this._stopped=!1)},stop:function(){this._stopped||(this._detachEventHandlers(),this._descendants=null,this._focusedNode=null,this._lastNodeIndex=0,this._stopped=!0)},refresh:function(){this._initDescendants(),this._eventHandlers||this._attachEventHandlers()}}),g.NAME="nodeFocusManager",g.NS="focusManager",e.namespace("Plugin"),e.Plugin.NodeFocusManager=g},"3.7.2",{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]});+YUI.add("node-focusmanager",function(e,t){var n="activeDescendant",r="id",i="disabled",s="tabIndex",o="focused",u="focusClass",a="circular",f="UI",l="key",c=n+"Change",h="host",p={37:!0,38:!0,39:!0,40:!0},d={a:!0,button:!0,input:!0,object:!0},v=e.Lang,m=e.UA,g=function(){g.superclass.constructor.apply(this,arguments)};g.ATTRS={focused:{value:!1,readOnly:!0},descendants:{getter:function(e){return this.get(h).all(e)}},activeDescendant:{setter:function(t){var n=v.isNumber,i=e.Attribute.INVALID_VALUE,s=this._descendantsMap,o=this._descendants,u,a,f;return n(t)?(u=t,a=u):t instanceof e.Node&&s?(u=s[t.get(r)],n(u)?a=u:a=i):a=i,o&&(f=o.item(u),f&&f.get("disabled")&&(a=i)),a}},keys:{value:{next:null,previous:null}},focusClass:{},circular:{value:!0}},e.extend(g,e.Plugin.Base,{_stopped:!0,_descendants:null,_descendantsMap:null,_focusedNode:null,_lastNodeIndex:0,_eventHandlers:null,_initDescendants:function(){var t=this.get("descendants"),o={},u=-1,a,f=this.get(n),l,c,h=0;v.isUndefined(f)&&(f=-1);if(t){a=t.size();for(h=0;h<a;h++)l=t.item(h),u===-1&&!l.get(i)&&(u=h),f<0&&parseInt(l.getAttribute(s,2),10)===0&&(f=h),l&&l.set(s,-1),c=l.get(r),c||(c=e.guid(),l.set(r,c)),o[c]=h;f<0&&(f=0),l=t.item(f);if(!l||l.get(i))l=t.item(u),f=u;this._lastNodeIndex=a-1,this._descendants=t,this._descendantsMap=o,this.set(n,f),l&&l.set(s,0)}},_isDescendant:function(e){return e.get(r)in this._descendantsMap},_removeFocusClass:function(){var e=this._focusedNode,t=this.get(u),n;t&&(n=v.isString(t)?t:t.className),e&&n&&e.removeClass(n)},_detachKeyHandler:function(){var e=this._prevKeyHandler,t=this._nextKeyHandler;e&&e.detach(),t&&t.detach()},_preventScroll:function(e){p[e.keyCode]&&this._isDescendant(e.target)&&e.preventDefault()},_fireClick:function(e){var t=e.target,n=t.get("nodeName").toLowerCase();e.keyCode===13&&(!d[n]||n==="a"&&!t.getAttribute("href"))&&t.simulate("click")},_attachKeyHandler:function(){this._detachKeyHandler();var t=this.get("keys.next"),n=this.get("keys.previous"),r=this.get(h),i=this._eventHandlers;n&&(this._prevKeyHandler=e.on(l,e.bind(this._focusPrevious,this),r,n)),t&&(this._nextKeyHandler=e.on(l,e.bind(this._focusNext,this),r,t)),m.opera&&i.push(r.on("keypress",this._preventScroll,this)),m.opera||i.push(r.on("keypress",this._fireClick,this))},_detachEventHandlers:function(){this._detachKeyHandler();var t=this._eventHandlers;t&&(e.Array.each(t,function(e){e.detach()}),this._eventHandlers=null)},_attachEventHandlers:function(){var t=this._descendants,n,r,i;t&&t.size()&&(n=this._eventHandlers||[],r=this.get(h).get("ownerDocument"),n.length===0&&(n.push(r.on("focus",this._onDocFocus,this)),n.push(r.on("mousedown",this._onDocMouseDown,this)),n.push(this.after("keysChange",this._attachKeyHandler)),n.push(this.after("descendantsChange",this._initDescendants)),n.push(this.after(c,this._afterActiveDescendantChange)),i=this.after("focusedChange",e.bind(function(e){e.newVal&&(this._attachKeyHandler(),i.detach())},this)),n.push(i)),this._eventHandlers=n)},_onDocMouseDown:function(e){var t=this.get(h),n=e.target,r=t.contains(n),i,s=function(e){var n=!1;return e.compareTo(t)||(n=this._isDescendant(e)?e:s.call(this,e.get("parentNode"))),n};r&&(i=s.call(this,n),i?n=i:!i&&this.get(o)&&(this._set(o,!1),this._onDocFocus(e))),r&&this._isDescendant(n)?this.focus(n):m.webkit&&this.get(o)&&(!r||r&&!this._isDescendant(n))&&(this._set(o,!1),this._onDocFocus(e))},_onDocFocus:function(e){var t=this._focusTarget||e.target,n=this.get(o),r=this.get(u),i=this._focusedNode,s;this._focusTarget&&(this._focusTarget=null),this.get(h).contains(t)?(s=this._isDescendant(t),!n&&s?n=!0:n&&!s&&(n=!1)):n=!1,r&&(i&&(!i.compareTo(t)||!n)&&this._removeFocusClass(),s&&n&&(r.fn?(t=r.fn(t),t.addClass(r.className)):t.addClass(r),this._focusedNode=t)),this._set(o,n)},_focusNext:function(e,t){var r=t||this.get(n),i;this._isDescendant(e.target)&&r<=this._lastNodeIndex&&(r+=1,r===this._lastNodeIndex+1&&this.get(a)&&(r=0),i=this._descendants.item(r),i&&(i.get("disabled")?this._focusNext(e,r):this.focus(r))),this._preventScroll(e)},_focusPrevious:function(e,t){var r=t||this.get(n),i;this._isDescendant(e.target)&&r>=0&&(r-=1,r===-1&&this.get(a)&&(r=this._lastNodeIndex),i=this._descendants.item(r),i&&(i.get("disabled")?this._focusPrevious(e,r):this.focus(r))),this._preventScroll(e)},_afterActiveDescendantChange:function(e){var t=this._descendants.item(e.prevVal);t&&t.set(s,-1),t=this._descendants.item(e.newVal),t&&t.set(s,0)},initializer:function(e){this.start()},destructor:function(){this.stop(),this.get(h).focusManager=null},focus:function(e){v.isUndefined(e)&&(e=this.get(n)),this.set(n,e,{src:f});var t=this._descendants.item(this.get(n));t&&(t.focus(),m.opera&&t.get("nodeName").toLowerCase()==="button"&&(this._focusTarget=t))},blur:function(){var e;this.get(o)&&(e=this._descendants.item(this.get(n)),e&&(e.blur(),this._removeFocusClass()),this._set(o,!1,{src:f}))},start:function(){this._stopped&&(this._initDescendants(),this._attachEventHandlers(),this._stopped=!1)},stop:function(){this._stopped||(this._detachEventHandlers(),this._descendants=null,this._focusedNode=null,this._lastNodeIndex=0,this._stopped=!0)},refresh:function(){this._initDescendants(),this._eventHandlers||this._attachEventHandlers()}}),g.NAME="nodeFocusManager",g.NS="focusManager",e.namespace("Plugin"),e.Plugin.NodeFocusManager=g},"3.7.3",{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]});
bundle/node-focusmanager/node-focusmanager.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1069,4 +1069,4 @@ Y.Plugin.NodeFocusManager = NodeFocusManager; -}, '3.7.2', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});+}, '3.7.3', {"requires": ["attribute", "node", "plugin", "node-event-simulate", "event-key", "event-focus"]});
bundle/node-load/node-load-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-load/node-load.js", code: [] };-_yuitest_coverage["build/node-load/node-load.js"].code=["YUI.add('node-load', function (Y, NAME) {","","/**"," * Extended Node interface with a basic IO API."," * @module node"," * @submodule node-load"," */","","/**"," * The default IO complete handler."," * @method _ioComplete"," * @protected"," * @for Node"," * @param {String} code The response code."," * @param {Object} response The response object."," * @param {Array} args An array containing the callback and selector"," */","","Y.Node.prototype._ioComplete = function(code, response, args) {"," var selector = args[0],"," callback = args[1],"," tmp,"," content;",""," if (response && response.responseText) {"," content = response.responseText;"," if (selector) {"," tmp = Y.DOM.create(content);"," content = Y.Selector.query(selector, tmp);"," }"," this.setContent(content);"," }"," if (callback) {"," callback.call(this, code, response);"," }","};","","/**"," * Loads content from the given url and replaces the Node's"," * existing content with the remote content."," * @method load"," * @param {String} url The URL to load via XMLHttpRequest."," * @param {String} selector An optional selector representing a subset of an HTML document to load."," * @param {Function} callback An optional function to run after the content has been loaded."," * @chainable"," */","Y.Node.prototype.load = function(url, selector, callback) {"," if (typeof selector == 'function') {"," callback = selector;"," selector = null;"," }"," var config = {"," context: this,"," on: {"," complete: this._ioComplete"," },"," arguments: [selector, callback]"," };",""," Y.io(url, config);"," return this;","};","","","}, '3.7.2', {\"requires\": [\"node-base\", \"io-base\"]});"];+_yuitest_coverage["build/node-load/node-load.js"].code=["YUI.add('node-load', function (Y, NAME) {","","/**"," * Extended Node interface with a basic IO API."," * @module node"," * @submodule node-load"," */","","/**"," * The default IO complete handler."," * @method _ioComplete"," * @protected"," * @for Node"," * @param {String} code The response code."," * @param {Object} response The response object."," * @param {Array} args An array containing the callback and selector"," */","","Y.Node.prototype._ioComplete = function(code, response, args) {"," var selector = args[0],"," callback = args[1],"," tmp,"," content;",""," if (response && response.responseText) {"," content = response.responseText;"," if (selector) {"," tmp = Y.DOM.create(content);"," content = Y.Selector.query(selector, tmp);"," }"," this.setContent(content);"," }"," if (callback) {"," callback.call(this, code, response);"," }","};","","/**"," * Loads content from the given url and replaces the Node's"," * existing content with the remote content."," * @method load"," * @param {String} url The URL to load via XMLHttpRequest."," * @param {String} selector An optional selector representing a subset of an HTML document to load."," * @param {Function} callback An optional function to run after the content has been loaded."," * @chainable"," */","Y.Node.prototype.load = function(url, selector, callback) {"," if (typeof selector == 'function') {"," callback = selector;"," selector = null;"," }"," var config = {"," context: this,"," on: {"," complete: this._ioComplete"," },"," arguments: [selector, callback]"," };",""," Y.io(url, config);"," return this;","};","","","}, '3.7.3', {\"requires\": [\"node-base\", \"io-base\"]});"]; _yuitest_coverage["build/node-load/node-load.js"].lines = {"1":0,"19":0,"20":0,"25":0,"26":0,"27":0,"28":0,"29":0,"31":0,"33":0,"34":0,"47":0,"48":0,"49":0,"50":0,"52":0,"60":0,"61":0}; _yuitest_coverage["build/node-load/node-load.js"].functions = {"_ioComplete:19":0,"load:47":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-load/node-load.js"].coveredLines = 18;@@ -122,4 +122,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "io-base"]});+}, '3.7.3', {"requires": ["node-base", "io-base"]});
bundle/node-load/node-load-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -68,4 +68,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "io-base"]});+}, '3.7.3', {"requires": ["node-base", "io-base"]});
bundle/node-load/node-load-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-load",function(e,t){e.Node.prototype._ioComplete=function(t,n,r){var i=r[0],s=r[1],o,u;n&&n.responseText&&(u=n.responseText,i&&(o=e.DOM.create(u),u=e.Selector.query(i,o)),this.setContent(u)),s&&s.call(this,t,n)},e.Node.prototype.load=function(t,n,r){typeof n=="function"&&(r=n,n=null);var i={context:this,on:{complete:this._ioComplete},arguments:[n,r]};return e.io(t,i),this}},"3.7.2",{requires:["node-base","io-base"]});+YUI.add("node-load",function(e,t){e.Node.prototype._ioComplete=function(t,n,r){var i=r[0],s=r[1],o,u;n&&n.responseText&&(u=n.responseText,i&&(o=e.DOM.create(u),u=e.Selector.query(i,o)),this.setContent(u)),s&&s.call(this,t,n)},e.Node.prototype.load=function(t,n,r){typeof n=="function"&&(r=n,n=null);var i={context:this,on:{complete:this._ioComplete},arguments:[n,r]};return e.io(t,i),this}},"3.7.3",{requires:["node-base","io-base"]});
bundle/node-load/node-load.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -68,4 +68,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "io-base"]});+}, '3.7.3', {"requires": ["node-base", "io-base"]});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-menunav/node-menunav.js", code: [] };-_yuitest_coverage["build/node-menunav/node-menunav.js"].code=["YUI.add('node-menunav', function (Y, NAME) {","","/**","* <p>The MenuNav Node Plugin makes it easy to transform existing list-based ","* markup into traditional, drop down navigational menus that are both accessible ","* and easy to customize, and only require a small set of dependencies.</p>","* ","* ","* <p>To use the MenuNav Node Plugin, simply pass a reference to the plugin to a ","* Node instance's <code>plug</code> method.</p>","* ","* <p>","* <code>","* <script type=\"text/javascript\"> <br>","* <br>","* // Call the \"use\" method, passing in \"node-menunav\". This will <br>","* // load the script and CSS for the MenuNav Node Plugin and all of <br>","* // the required dependencies. <br>","* <br>","* YUI().use(\"node-menunav\", function(Y) { <br>","* <br>","* // Use the \"contentready\" event to initialize the menu when <br>","* // the subtree of element representing the root menu <br>","* // (<div id=\"menu-1\">) is ready to be scripted. <br>","* <br>","* Y.on(\"contentready\", function () { <br>","* <br>","* // The scope of the callback will be a Node instance <br>","* // representing the root menu (<div id=\"menu-1\">). <br>","* // Therefore, since \"this\" represents a Node instance, it <br>","* // is possible to just call \"this.plug\" passing in a <br>","* // reference to the MenuNav Node Plugin. <br>","* <br>","* this.plug(Y.Plugin.NodeMenuNav); <br>","* <br>","* }, \"#menu-1\"); <br>","* <br> ","* }); <br>","* <br> ","* </script> <br>","* </code>","* </p>","*","* <p>The MenuNav Node Plugin has several configuration properties that can be ","* set via an object literal that is passed as a second argument to a Node ","* instance's <code>plug</code> method.","* </p>","*","* <p>","* <code>","* <script type=\"text/javascript\"> <br>","* <br>","* // Call the \"use\" method, passing in \"node-menunav\". This will <br>","* // load the script and CSS for the MenuNav Node Plugin and all of <br>","* // the required dependencies. <br>","* <br>","* YUI().use(\"node-menunav\", function(Y) { <br>","* <br>","* // Use the \"contentready\" event to initialize the menu when <br>","* // the subtree of element representing the root menu <br>","* // (<div id=\"menu-1\">) is ready to be scripted. <br>","* <br>","* Y.on(\"contentready\", function () { <br>","* <br>","* // The scope of the callback will be a Node instance <br>","* // representing the root menu (<div id=\"menu-1\">). <br>","* // Therefore, since \"this\" represents a Node instance, it <br>","* // is possible to just call \"this.plug\" passing in a <br>","* // reference to the MenuNav Node Plugin. <br>","* <br>","* this.plug(Y.Plugin.NodeMenuNav, { mouseOutHideDelay: 1000 });","* <br><br>","* }, \"#menu-1\"); <br>","* <br> ","* }); <br>","* <br> ","* </script> <br>","* </code>","* </p>","* ","* @module node-menunav","*/","",""," // Util shortcuts","","var UA = Y.UA,"," later = Y.later,"," getClassName = Y.ClassNameManager.getClassName,","","",""," // Frequently used strings",""," MENU = \"menu\","," MENUITEM = \"menuitem\","," HIDDEN = \"hidden\","," PARENT_NODE = \"parentNode\","," CHILDREN = \"children\","," OFFSET_HEIGHT = \"offsetHeight\","," OFFSET_WIDTH = \"offsetWidth\","," PX = \"px\","," ID = \"id\","," PERIOD = \".\","," HANDLED_MOUSEOUT = \"handledMouseOut\","," HANDLED_MOUSEOVER = \"handledMouseOver\","," ACTIVE = \"active\","," LABEL = \"label\","," LOWERCASE_A = \"a\","," MOUSEDOWN = \"mousedown\","," KEYDOWN = \"keydown\","," CLICK = \"click\","," EMPTY_STRING = \"\","," FIRST_OF_TYPE = \"first-of-type\","," ROLE = \"role\","," PRESENTATION = \"presentation\","," DESCENDANTS = \"descendants\","," UI = \"UI\","," ACTIVE_DESCENDANT = \"activeDescendant\","," USE_ARIA = \"useARIA\","," ARIA_HIDDEN = \"aria-hidden\","," CONTENT = \"content\","," HOST = \"host\","," ACTIVE_DESCENDANT_CHANGE = ACTIVE_DESCENDANT + \"Change\",","",""," // Attribute keys"," "," AUTO_SUBMENU_DISPLAY = \"autoSubmenuDisplay\","," MOUSEOUT_HIDE_DELAY = \"mouseOutHideDelay\",","",""," // CSS class names",""," CSS_MENU = getClassName(MENU),"," CSS_MENU_HIDDEN = getClassName(MENU, HIDDEN),"," CSS_MENU_HORIZONTAL = getClassName(MENU, \"horizontal\"),"," CSS_MENU_LABEL = getClassName(MENU, LABEL),"," CSS_MENU_LABEL_ACTIVE = getClassName(MENU, LABEL, ACTIVE),"," CSS_MENU_LABEL_MENUVISIBLE = getClassName(MENU, LABEL, (MENU + \"visible\")),"," CSS_MENUITEM = getClassName(MENUITEM),"," CSS_MENUITEM_ACTIVE = getClassName(MENUITEM, ACTIVE),","",""," // CSS selectors"," "," MENU_SELECTOR = PERIOD + CSS_MENU,"," MENU_TOGGLE_SELECTOR = (PERIOD + getClassName(MENU, \"toggle\")),"," MENU_CONTENT_SELECTOR = PERIOD + getClassName(MENU, CONTENT),"," MENU_LABEL_SELECTOR = PERIOD + CSS_MENU_LABEL,",""," STANDARD_QUERY = \">\" + MENU_CONTENT_SELECTOR + \">ul>li>a\","," EXTENDED_QUERY = \">\" + MENU_CONTENT_SELECTOR + \">ul>li>\" + MENU_LABEL_SELECTOR + \">a:first-child\";","","// Utility functions","","","var getPreviousSibling = function (node) {",""," var oPrevious = node.previous(),"," oChildren;",""," if (!oPrevious) {"," oChildren = node.get(PARENT_NODE).get(CHILDREN);"," oPrevious = oChildren.item(oChildren.size() - 1);"," }"," "," return oPrevious;","","};","","","var getNextSibling = function (node) {",""," var oNext = node.next();",""," if (!oNext) {"," oNext = node.get(PARENT_NODE).get(CHILDREN).item(0); "," }"," "," return oNext;","","};","","","var isAnchor = function (node) {"," "," var bReturnVal = false;"," "," if (node) {"," bReturnVal = node.get(\"nodeName\").toLowerCase() === LOWERCASE_A;"," }"," "," return bReturnVal;"," ","};","","","var isMenuItem = function (node) {",""," return node.hasClass(CSS_MENUITEM);","","};","","","var isMenuLabel = function (node) {",""," return node.hasClass(CSS_MENU_LABEL);","","};","","","var isHorizontalMenu = function (menu) {",""," return menu.hasClass(CSS_MENU_HORIZONTAL);","","};","","","var hasVisibleSubmenu = function (menuLabel) {",""," return menuLabel.hasClass(CSS_MENU_LABEL_MENUVISIBLE);","","};","","","var getItemAnchor = function (node) {",""," return isAnchor(node) ? node : node.one(LOWERCASE_A);","","};","","","var getNodeWithClass = function (node, className, searchAncestors) {",""," var oItem;"," "," if (node) {"," "," if (node.hasClass(className)) {"," oItem = node;"," }"," "," if (!oItem && searchAncestors) {"," oItem = node.ancestor((PERIOD + className));"," }"," "," }"," "," return oItem;","","};","","","var getParentMenu = function (node) {",""," return node.ancestor(MENU_SELECTOR);"," ","};","","","var getMenu = function (node, searchAncestors) {",""," return getNodeWithClass(node, CSS_MENU, searchAncestors);","","};","","","var getMenuItem = function (node, searchAncestors) {",""," var oItem;"," "," if (node) {"," oItem = getNodeWithClass(node, CSS_MENUITEM, searchAncestors);"," }"," "," return oItem;","","};","","","var getMenuLabel = function (node, searchAncestors) {",""," var oItem;"," "," if (node) {"," "," if (searchAncestors) {"," oItem = getNodeWithClass(node, CSS_MENU_LABEL, searchAncestors);"," }"," else {"," oItem = getNodeWithClass(node, CSS_MENU_LABEL) || "," node.one((PERIOD + CSS_MENU_LABEL));"," }"," "," }"," "," return oItem;","","};","","","var getItem = function (node, searchAncestors) {",""," var oItem;"," "," if (node) {"," oItem = getMenuItem(node, searchAncestors) || "," getMenuLabel(node, searchAncestors);"," }"," "," return oItem; ","","};","","","var getFirstItem = function (menu) {"," "," return getItem(menu.one(\"li\"));","","};","","","var getActiveClass = function (node) {",""," return isMenuItem(node) ? CSS_MENUITEM_ACTIVE : CSS_MENU_LABEL_ACTIVE;","","};","","","var handleMouseOverForNode = function (node, target) {",""," return node && !node[HANDLED_MOUSEOVER] && "," (node.compareTo(target) || node.contains(target));","","};","","","var handleMouseOutForNode = function (node, relatedTarget) {",""," return node && !node[HANDLED_MOUSEOUT] && "," (!node.compareTo(relatedTarget) && !node.contains(relatedTarget));","","};","","/**","* The NodeMenuNav class is a plugin for a Node instance. The class is used via ","* the <a href=\"Node.html#method_plug\"><code>plug</code></a> method of Node and ","* should not be instantiated directly.","* @namespace plugin","* @class NodeMenuNav","*/","var NodeMenuNav = function () {",""," NodeMenuNav.superclass.constructor.apply(this, arguments);","","};","","NodeMenuNav.NAME = \"nodeMenuNav\";","NodeMenuNav.NS = \"menuNav\";","","","/** ","* @property SHIM_TEMPLATE_TITLE","* @description String representing the value for the <code>title</code> ","* attribute for the shim used to prevent <code><select></code> elements ","* from poking through menus in IE 6.","* @default \"Menu Stacking Shim\"","* @type String","*/","NodeMenuNav.SHIM_TEMPLATE_TITLE = \"Menu Stacking Shim\";","","","/** ","* @property SHIM_TEMPLATE","* @description String representing the HTML used to create the ","* <code><iframe></code> shim used to prevent ","* <code><select></code> elements from poking through menus in IE 6.","* @default "<iframe frameborder="0" tabindex="-1" ","* class="yui-shim" title="Menu Stacking Shim" ","* src="javascript:false;"></iframe>"","* @type String","*/","","// <iframe> shim notes:","//","// 1) Need to set the \"frameBorder\" property to 0 to suppress the default ","// <iframe> border in IE. (Setting the CSS \"border\" property alone doesn't ","// suppress it.) ","//","// 2) The \"src\" attribute of the <iframe> is set to \"javascript:false;\" so ","// that it won't load a page inside it, preventing the secure/nonsecure ","// warning in IE when using HTTPS.","//","// 3) Since the role of the <iframe> shim is completely presentational, its ","// \"tabindex\" attribute is set to \"-1\" and its title attribute is set to ","// \"Menu Stacking Shim\". Both strategies help users of screen readers to ","// avoid mistakenly interacting with the <iframe> shim.","","NodeMenuNav.SHIM_TEMPLATE = '<iframe frameborder=\"0\" tabindex=\"-1\" class=\"' + "," getClassName(\"shim\") + "," '\" title=\"' + NodeMenuNav.SHIM_TEMPLATE_TITLE + "," '\" src=\"javascript:false;\"></iframe>';","","","NodeMenuNav.ATTRS = {",""," /**"," * Boolean indicating if use of the WAI-ARIA Roles and States should be "," * enabled for the menu."," *"," * @attribute useARIA"," * @readOnly"," * @writeOnce "," * @default true"," * @type boolean"," */"," useARIA: {"," "," value: true,"," writeOnce: true,"," lazyAdd: false,"," setter: function (value) {",""," var oMenu = this.get(HOST),"," oMenuLabel,"," oMenuToggle,"," oSubmenu,"," sID;",""," if (value) {",""," oMenu.set(ROLE, MENU);",""," oMenu.all(\"ul,li,\" + MENU_CONTENT_SELECTOR).set(ROLE, PRESENTATION);",""," oMenu.all((PERIOD + getClassName(MENUITEM, CONTENT))).set(ROLE, MENUITEM);",""," oMenu.all((PERIOD + CSS_MENU_LABEL)).each(function (node) {",""," oMenuLabel = node;"," oMenuToggle = node.one(MENU_TOGGLE_SELECTOR);",""," if (oMenuToggle) {"," oMenuToggle.set(ROLE, PRESENTATION);"," oMenuLabel = oMenuToggle.previous();"," }",""," oMenuLabel.set(ROLE, MENUITEM);"," oMenuLabel.set(\"aria-haspopup\", true);",""," oSubmenu = node.next();",""," if (oSubmenu) {",""," oSubmenu.set(ROLE, MENU);",""," oMenuLabel = oSubmenu.previous();"," oMenuToggle = oMenuLabel.one(MENU_TOGGLE_SELECTOR);",""," if (oMenuToggle) {"," oMenuLabel = oMenuToggle;"," }",""," sID = Y.stamp(oMenuLabel);",""," if (!oMenuLabel.get(ID)) {"," oMenuLabel.set(ID, sID);"," }",""," oSubmenu.set(\"aria-labelledby\", sID);"," oSubmenu.set(ARIA_HIDDEN, true);"," "," }",""," });"," "," }",""," }"," "," },","",""," /**"," * Boolean indicating if submenus are automatically made visible when the "," * user mouses over the menu's items."," *"," * @attribute autoSubmenuDisplay"," * @readOnly"," * @writeOnce "," * @default true"," * @type boolean"," */ "," autoSubmenuDisplay: {"," "," value: true,"," writeOnce: true"," "," },","",""," /**"," * Number indicating the time (in milliseconds) that should expire before a "," * submenu is made visible when the user mouses over the menu's label."," *"," * @attribute submenuShowDelay"," * @readOnly"," * @writeOnce "," * @default 250"," * @type Number"," */"," submenuShowDelay: {"," "," value: 250,"," writeOnce: true"," "," },","",""," /**"," * Number indicating the time (in milliseconds) that should expire before a "," * submenu is hidden when the user mouses out of a menu label heading in the "," * direction of a submenu. "," *"," * @attribute submenuHideDelay"," * @readOnly"," * @writeOnce "," * @default 250"," * @type Number"," */"," submenuHideDelay: {"," "," value: 250,"," writeOnce: true"," "," },","",""," /**"," * Number indicating the time (in milliseconds) that should expire before a "," * submenu is hidden when the user mouses out of it."," * "," * @attribute mouseOutHideDelay"," * @readOnly"," * @writeOnce "," * @default 750"," * @type Number"," */ "," mouseOutHideDelay: {"," "," value: 750,"," writeOnce: true"," "," }","","};","","","Y.extend(NodeMenuNav, Y.Plugin.Base, {",""," // Protected properties",""," /** "," * @property _rootMenu"," * @description Node instance representing the root menu in the menu."," * @default null"," * @protected"," * @type Node"," */"," _rootMenu: null, ","",""," /** "," * @property _activeItem"," * @description Node instance representing the menu's active descendent: "," * the menuitem or menu label the user is currently interacting with."," * @default null"," * @protected"," * @type Node"," */"," _activeItem: null, ","",""," /** "," * @property _activeMenu"," * @description Node instance representing the menu that is the parent of "," * the menu's active descendent."," * @default null"," * @protected"," * @type Node"," */"," _activeMenu: null,","",""," /** "," * @property _hasFocus"," * @description Boolean indicating if the menu has focus."," * @default false"," * @protected"," * @type Boolean"," */"," _hasFocus: false,","",""," // In gecko-based browsers a mouseover and mouseout event will fire even "," // if a DOM element moves out from under the mouse without the user "," // actually moving the mouse. This bug affects NodeMenuNav because the "," // user can hit the Esc key to hide a menu, and if the mouse is over the "," // menu when the user presses Esc, the _onMenuMouseOut handler will be "," // called. To fix this bug the following flag (_blockMouseEvent) is used "," // to block the code in the _onMenuMouseOut handler from executing.",""," /** "," * @property _blockMouseEvent"," * @description Boolean indicating whether or not to handle the "," * \"mouseover\" event."," * @default false"," * @protected"," * @type Boolean"," */"," _blockMouseEvent: false,","",""," /** "," * @property _currentMouseX"," * @description Number representing the current x coordinate of the mouse "," * inside the menu."," * @default 0"," * @protected"," * @type Number"," */"," _currentMouseX: 0,","",""," /** "," * @property _movingToSubmenu"," * @description Boolean indicating if the mouse is moving from a menu "," * label to its corresponding submenu."," * @default false"," * @protected"," * @type Boolean"," */"," _movingToSubmenu: false,","",""," /** "," * @property _showSubmenuTimer"," * @description Timer used to show a submenu."," * @default null"," * @protected"," * @type Object"," */"," _showSubmenuTimer: null,","",""," /** "," * @property _hideSubmenuTimer"," * @description Timer used to hide a submenu."," * @default null"," * @protected"," * @type Object"," */"," _hideSubmenuTimer: null,","",""," /** "," * @property _hideAllSubmenusTimer"," * @description Timer used to hide a all submenus."," * @default null"," * @protected"," * @type Object"," */"," _hideAllSubmenusTimer: null,","",""," /** "," * @property _firstItem"," * @description Node instance representing the first item (menuitem or menu "," * label) in the root menu of a menu."," * @default null"," * @protected"," * @type Node"," */"," _firstItem: null,","",""," // Public methods","",""," initializer: function (config) {",""," var menuNav = this,"," oRootMenu = this.get(HOST),"," aHandlers = [],"," oDoc;","",""," if (oRootMenu) {",""," menuNav._rootMenu = oRootMenu;",""," oRootMenu.all(\"ul:first-child\").addClass(FIRST_OF_TYPE);",""," // Hide all visible submenus",""," oRootMenu.all(MENU_SELECTOR).addClass(CSS_MENU_HIDDEN);","",""," // Wire up all event handlers",""," aHandlers.push(oRootMenu.on(\"mouseover\", menuNav._onMouseOver, menuNav));"," aHandlers.push(oRootMenu.on(\"mouseout\", menuNav._onMouseOut, menuNav));"," aHandlers.push(oRootMenu.on(\"mousemove\", menuNav._onMouseMove, menuNav));"," aHandlers.push(oRootMenu.on(MOUSEDOWN, menuNav._toggleSubmenuDisplay, menuNav));"," aHandlers.push(Y.on(\"key\", menuNav._toggleSubmenuDisplay, oRootMenu, \"down:13\", menuNav));"," aHandlers.push(oRootMenu.on(CLICK, menuNav._toggleSubmenuDisplay, menuNav));"," aHandlers.push(oRootMenu.on(\"keypress\", menuNav._onKeyPress, menuNav));"," aHandlers.push(oRootMenu.on(KEYDOWN, menuNav._onKeyDown, menuNav));",""," oDoc = oRootMenu.get(\"ownerDocument\");",""," aHandlers.push(oDoc.on(MOUSEDOWN, menuNav._onDocMouseDown, menuNav));"," aHandlers.push(oDoc.on(\"focus\", menuNav._onDocFocus, menuNav));",""," this._eventHandlers = aHandlers;",""," menuNav._initFocusManager();",""," }"," ",""," },",""," destructor: function () {",""," var aHandlers = this._eventHandlers;",""," if (aHandlers) {",""," Y.Array.each(aHandlers, function (handle) {"," handle.detach();"," });",""," this._eventHandlers = null;",""," }"," "," this.get(HOST).unplug(\"focusManager\");"," "," },","","",""," // Protected methods",""," /**"," * @method _isRoot"," * @description Returns a boolean indicating if the specified menu is the "," * root menu in the menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @return {Boolean} Boolean indicating if the specified menu is the root "," * menu in the menu."," */"," _isRoot: function (menu) {",""," return this._rootMenu.compareTo(menu);",""," },","",""," /**"," * @method _getTopmostSubmenu"," * @description Returns the topmost submenu of a submenu hierarchy."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @return {Node} Node instance representing a menu."," */"," _getTopmostSubmenu: function (menu) {"," "," var menuNav = this,"," oMenu = getParentMenu(menu),"," returnVal;","",""," if (!oMenu) {"," returnVal = menu;"," }"," else if (menuNav._isRoot(oMenu)) {"," returnVal = menu;"," }"," else {"," returnVal = menuNav._getTopmostSubmenu(oMenu);"," }"," "," return returnVal;"," "," },","",""," /**"," * @method _clearActiveItem"," * @description Clears the menu's active descendent."," * @protected"," */"," _clearActiveItem: function () {",""," var menuNav = this,"," oActiveItem = menuNav._activeItem;"," "," if (oActiveItem) {"," oActiveItem.removeClass(getActiveClass(oActiveItem));"," }",""," menuNav._activeItem = null;"," "," },","",""," /**"," * @method _setActiveItem"," * @description Sets the specified menuitem or menu label as the menu's "," * active descendent."," * @protected"," * @param {Node} item Node instance representing a menuitem or menu label."," */"," _setActiveItem: function (item) {",""," var menuNav = this;"," "," if (item) {"," "," menuNav._clearActiveItem();"," "," item.addClass(getActiveClass(item));"," "," menuNav._activeItem = item;"," "," }"," "," },","",""," /**"," * @method _focusItem"," * @description Focuses the specified menuitem or menu label."," * @protected"," * @param {Node} item Node instance representing a menuitem or menu label."," */"," _focusItem: function (item) {"," "," var menuNav = this,"," oMenu,"," oItem;"," "," if (item && menuNav._hasFocus) {",""," oMenu = getParentMenu(item);"," oItem = getItemAnchor(item);",""," if (oMenu && !oMenu.compareTo(menuNav._activeMenu)) {"," menuNav._activeMenu = oMenu;"," menuNav._initFocusManager();"," }"," "," menuNav._focusManager.focus(oItem);",""," }"," "," },","",""," /**"," * @method _showMenu"," * @description Shows the specified menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," */"," _showMenu: function (menu) {",""," var oParentMenu = getParentMenu(menu),"," oLI = menu.get(PARENT_NODE),"," aXY = oLI.getXY();","",""," if (this.get(USE_ARIA)) {"," menu.set(ARIA_HIDDEN, false);"," }","",""," if (isHorizontalMenu(oParentMenu)) {"," aXY[1] = aXY[1] + oLI.get(OFFSET_HEIGHT);"," }"," else {"," aXY[0] = aXY[0] + oLI.get(OFFSET_WIDTH);"," }"," "," menu.setXY(aXY);",""," if (UA.ie < 8) {",""," if (UA.ie === 6 && !menu.hasIFrameShim) {"," "," menu.appendChild(Y.Node.create(NodeMenuNav.SHIM_TEMPLATE));"," menu.hasIFrameShim = true;",""," }",""," // Clear previous values for height and width",""," menu.setStyles({ height: EMPTY_STRING, width: EMPTY_STRING });",""," // Set the width and height of the menu's bounding box - this is "," // necessary for IE 6 so that the CSS for the <iframe> shim can "," // simply set the <iframe>'s width and height to 100% to ensure "," // that dimensions of an <iframe> shim are always sync'd to the "," // that of its parent menu. Specifying a width and height also "," // helps when positioning decorator elements (for creating effects "," // like rounded corners) inside a menu's bounding box in IE 7."," "," menu.setStyles({ "," height: (menu.get(OFFSET_HEIGHT) + PX), "," width: (menu.get(OFFSET_WIDTH) + PX) });",""," }",""," menu.previous().addClass(CSS_MENU_LABEL_MENUVISIBLE);"," menu.removeClass(CSS_MENU_HIDDEN);",""," },"," ",""," /**"," * @method _hideMenu "," * @description Hides the specified menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @param {Boolean} activateAndFocusLabel Boolean indicating if the label "," * for the specified "," * menu should be focused and set as active."," */"," _hideMenu: function (menu, activateAndFocusLabel) {",""," var menuNav = this,"," oLabel = menu.previous(),"," oActiveItem;",""," oLabel.removeClass(CSS_MENU_LABEL_MENUVISIBLE);","",""," if (activateAndFocusLabel) {"," menuNav._focusItem(oLabel);"," menuNav._setActiveItem(oLabel); "," }",""," oActiveItem = menu.one((PERIOD + CSS_MENUITEM_ACTIVE));",""," if (oActiveItem) {"," oActiveItem.removeClass(CSS_MENUITEM_ACTIVE);"," }",""," // Clear the values for top and left that were set by the call to "," // \"setXY\" when the menu was shown so that the hidden position "," // specified in the core CSS file will take affect.",""," menu.setStyles({ left: EMPTY_STRING, top: EMPTY_STRING });"," "," menu.addClass(CSS_MENU_HIDDEN);",""," if (menuNav.get(USE_ARIA)) {"," menu.set(ARIA_HIDDEN, true);"," } "," "," },","",""," /**"," * @method _hideAllSubmenus"," * @description Hides all submenus of the specified menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," */"," _hideAllSubmenus: function (menu) {",""," var menuNav = this;",""," menu.all(MENU_SELECTOR).each(Y.bind(function (submenuNode) {"," "," menuNav._hideMenu(submenuNode);"," "," }, menuNav));"," "," },","",""," /**"," * @method _cancelShowSubmenuTimer"," * @description Cancels the timer used to show a submenu."," * @protected"," */"," _cancelShowSubmenuTimer: function () {",""," var menuNav = this,"," oShowSubmenuTimer = menuNav._showSubmenuTimer;",""," if (oShowSubmenuTimer) {"," oShowSubmenuTimer.cancel();"," menuNav._showSubmenuTimer = null;"," }"," "," },","",""," /**"," * @method _cancelHideSubmenuTimer"," * @description Cancels the timer used to hide a submenu."," * @protected"," */"," _cancelHideSubmenuTimer: function () {",""," var menuNav = this,"," oHideSubmenuTimer = menuNav._hideSubmenuTimer;","",""," if (oHideSubmenuTimer) {"," oHideSubmenuTimer.cancel();"," menuNav._hideSubmenuTimer = null;"," }"," "," },","",""," /**"," * @method _initFocusManager"," * @description Initializes and updates the Focus Manager so that is is "," * always managing descendants of the active menu."," * @protected"," */"," _initFocusManager: function () {",""," var menuNav = this,"," oRootMenu = menuNav._rootMenu,"," oMenu = menuNav._activeMenu || oRootMenu,"," sSelectorBase = "," menuNav._isRoot(oMenu) ? EMPTY_STRING : (\"#\" + oMenu.get(\"id\")),"," oFocusManager = menuNav._focusManager,"," sKeysVal,"," sDescendantSelector,"," sQuery;",""," if (isHorizontalMenu(oMenu)) {",""," sDescendantSelector = sSelectorBase + STANDARD_QUERY + \",\" + "," sSelectorBase + EXTENDED_QUERY;"," "," sKeysVal = { next: \"down:39\", previous: \"down:37\" };"," "," }"," else {",""," sDescendantSelector = sSelectorBase + STANDARD_QUERY;"," sKeysVal = { next: \"down:40\", previous: \"down:38\" };",""," }","",""," if (!oFocusManager) {",""," oRootMenu.plug(Y.Plugin.NodeFocusManager, { "," descendants: sDescendantSelector,"," keys: sKeysVal,"," circular: true"," });",""," oFocusManager = oRootMenu.focusManager;",""," sQuery = \"#\" + oRootMenu.get(\"id\") + MENU_SELECTOR + \" a,\" + "," MENU_TOGGLE_SELECTOR;",""," oRootMenu.all(sQuery).set(\"tabIndex\", -1);",""," oFocusManager.on(ACTIVE_DESCENDANT_CHANGE, "," this._onActiveDescendantChange, oFocusManager, this);",""," oFocusManager.after(ACTIVE_DESCENDANT_CHANGE, "," this._afterActiveDescendantChange, oFocusManager, this);"," "," menuNav._focusManager = oFocusManager;"," "," }"," else {",""," oFocusManager.set(ACTIVE_DESCENDANT, -1);"," oFocusManager.set(DESCENDANTS, sDescendantSelector);"," oFocusManager.set(\"keys\", sKeysVal);"," "," }",""," },","",""," // Event handlers for discrete pieces of pieces of the menu","",""," /**"," * @method _onActiveDescendantChange"," * @description \"activeDescendantChange\" event handler for menu's "," * Focus Manager."," * @protected"," * @param {Object} event Object representing the Attribute change event."," * @param {NodeMenuNav} menuNav Object representing the NodeMenuNav instance."," */"," _onActiveDescendantChange: function (event, menuNav) {",""," if (event.src === UI && menuNav._activeMenu && "," !menuNav._movingToSubmenu) {",""," menuNav._hideAllSubmenus(menuNav._activeMenu);",""," }"," "," },","",""," /**"," * @method _afterActiveDescendantChange"," * @description \"activeDescendantChange\" event handler for menu's "," * Focus Manager."," * @protected"," * @param {Object} event Object representing the Attribute change event."," * @param {NodeMenuNav} menuNav Object representing the NodeMenuNav instance."," */"," _afterActiveDescendantChange: function (event, menuNav) {",""," var oItem;",""," if (event.src === UI) {"," oItem = getItem(this.get(DESCENDANTS).item(event.newVal), true);"," menuNav._setActiveItem(oItem);"," }"," "," },","",""," /**"," * @method _onDocFocus"," * @description \"focus\" event handler for the owner document of the MenuNav."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onDocFocus: function (event) {"," "," var menuNav = this,"," oActiveItem = menuNav._activeItem,"," oTarget = event.target,"," oMenu;"," ",""," if (menuNav._rootMenu.contains(oTarget)) { // The menu has focus",""," if (menuNav._hasFocus) { ",""," oMenu = getParentMenu(oTarget);",""," // If the element that was focused is a descendant of the "," // root menu, but is in a submenu not currently being "," // managed by the Focus Manager, update the Focus Manager so "," // that it is now managing the submenu that is the parent of "," // the element that was focused."," "," if (!menuNav._activeMenu.compareTo(oMenu)) {",""," menuNav._activeMenu = oMenu;"," menuNav._initFocusManager();"," menuNav._focusManager.set(ACTIVE_DESCENDANT, oTarget);"," menuNav._setActiveItem(getItem(oTarget, true));"," "," }"," "," }"," else { // Initial focus",""," // First time the menu has been focused, need to setup focused "," // state and established active active descendant"," "," menuNav._hasFocus = true;"," "," oActiveItem = getItem(oTarget, true);"," "," if (oActiveItem) { "," menuNav._setActiveItem(oActiveItem);"," }"," "," }"," "," }"," else { // The menu has lost focus",""," menuNav._clearActiveItem();",""," menuNav._cancelShowSubmenuTimer();"," menuNav._hideAllSubmenus(menuNav._rootMenu);",""," menuNav._activeMenu = menuNav._rootMenu;"," menuNav._initFocusManager();"," "," menuNav._focusManager.set(ACTIVE_DESCENDANT, 0);"," "," menuNav._hasFocus = false;",""," }"," "," },","",""," /**"," * @method _onMenuMouseOver"," * @description \"mouseover\" event handler for a menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @param {Object} event Object representing the DOM event."," */"," _onMenuMouseOver: function (menu, event) {",""," var menuNav = this,"," oHideAllSubmenusTimer = menuNav._hideAllSubmenusTimer;",""," if (oHideAllSubmenusTimer) {"," oHideAllSubmenusTimer.cancel();"," menuNav._hideAllSubmenusTimer = null;"," }",""," menuNav._cancelHideSubmenuTimer();",""," // Need to update the FocusManager in advance of focus a new "," // Menu in order to avoid the FocusManager thinking that "," // it has lost focus"," "," if (menu && !menu.compareTo(menuNav._activeMenu)) {"," menuNav._activeMenu = menu;",""," if (menuNav._hasFocus) {"," menuNav._initFocusManager();"," }",""," }",""," if (menuNav._movingToSubmenu && isHorizontalMenu(menu)) {"," menuNav._movingToSubmenu = false;"," }",""," },","",""," /**"," * @method _hideAndFocusLabel"," * @description Hides all of the submenus of the root menu and focuses the "," * label of the topmost submenu"," * @protected"," */"," _hideAndFocusLabel: function () {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oSubmenu;"," "," menuNav._hideAllSubmenus(menuNav._rootMenu);",""," if (oActiveMenu) {",""," // Focus the label element for the topmost submenu"," oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu);"," menuNav._focusItem(oSubmenu.previous());",""," }"," "," },","",""," /**"," * @method _onMenuMouseOut"," * @description \"mouseout\" event handler for a menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @param {Object} event Object representing the DOM event."," */"," _onMenuMouseOut: function (menu, event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oRelatedTarget = event.relatedTarget,"," oActiveItem = menuNav._activeItem,"," oParentMenu,"," oMenu;","",""," if (oActiveMenu && !oActiveMenu.contains(oRelatedTarget)) {"," "," oParentMenu = getParentMenu(oActiveMenu);"," ",""," if (oParentMenu && !oParentMenu.contains(oRelatedTarget)) {",""," if (menuNav.get(MOUSEOUT_HIDE_DELAY) > 0) {",""," menuNav._cancelShowSubmenuTimer();",""," menuNav._hideAllSubmenusTimer = ",""," later(menuNav.get(MOUSEOUT_HIDE_DELAY), "," menuNav, menuNav._hideAndFocusLabel);"," "," }"," "," }"," else {"," "," if (oActiveItem) {"," "," oMenu = getParentMenu(oActiveItem);",""," if (!menuNav._isRoot(oMenu)) { "," menuNav._focusItem(oMenu.previous());"," }"," "," }"," "," }",""," }",""," },","",""," /**"," * @method _onMenuLabelMouseOver"," * @description \"mouseover\" event handler for a menu label."," * @protected"," * @param {Node} menuLabel Node instance representing a menu label."," * @param {Object} event Object representing the DOM event."," */"," _onMenuLabelMouseOver: function (menuLabel, event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," bIsRoot = menuNav._isRoot(oActiveMenu),"," bUseAutoSubmenuDisplay = "," (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot),"," submenuShowDelay = menuNav.get(\"submenuShowDelay\"), "," oSubmenu;"," ",""," var showSubmenu = function (delay) {",""," menuNav._cancelHideSubmenuTimer();"," menuNav._cancelShowSubmenuTimer();",""," if (!hasVisibleSubmenu(menuLabel)) {",""," oSubmenu = menuLabel.next();",""," if (oSubmenu) {"," menuNav._hideAllSubmenus(oActiveMenu);"," menuNav._showSubmenuTimer = later(delay, menuNav, menuNav._showMenu, oSubmenu);"," }",""," }"," "," };","",""," menuNav._focusItem(menuLabel);"," menuNav._setActiveItem(menuLabel);","",""," if (bUseAutoSubmenuDisplay) {"," "," if (menuNav._movingToSubmenu) {"," "," // If the user is moving diagonally from a submenu to "," // another submenu and they then stop and pause on a"," // menu label for an amount of time equal to the amount of "," // time defined for the display of a submenu then show the "," // submenu immediately."," // http://yuilibrary.com/projects/yui3/ticket/2528316"," "," //Y.message(\"Pause path\");"," "," menuNav._hoverTimer = later(submenuShowDelay, menuNav, function () {"," showSubmenu(0);"," });"," "," }"," else {"," showSubmenu(submenuShowDelay);"," }"," "," }",""," },","",""," /**"," * @method _onMenuLabelMouseOut"," * @description \"mouseout\" event handler for a menu label."," * @protected"," * @param {Node} menuLabel Node instance representing a menu label."," * @param {Object} event Object representing the DOM event."," */"," _onMenuLabelMouseOut: function (menuLabel, event) {",""," var menuNav = this,"," bIsRoot = menuNav._isRoot(menuNav._activeMenu),"," bUseAutoSubmenuDisplay = "," (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot),",""," oRelatedTarget = event.relatedTarget,"," oSubmenu = menuLabel.next(),"," hoverTimer = menuNav._hoverTimer;",""," if (hoverTimer) {"," hoverTimer.cancel();"," }",""," menuNav._clearActiveItem();",""," if (bUseAutoSubmenuDisplay) {",""," if (menuNav._movingToSubmenu && "," !menuNav._showSubmenuTimer && oSubmenu) {",""," // If the mouse is moving diagonally toward the submenu and "," // another submenu isn't in the process of being displayed "," // (via a timer), then hide the submenu via a timer to give"," // the user some time to reach the submenu."," "," menuNav._hideSubmenuTimer = "," later(menuNav.get(\"submenuHideDelay\"), menuNav, "," menuNav._hideMenu, oSubmenu);"," "," }"," else if (!menuNav._movingToSubmenu && oSubmenu && (!oRelatedTarget || "," (oRelatedTarget && "," !oSubmenu.contains(oRelatedTarget) && "," !oRelatedTarget.compareTo(oSubmenu)))) {",""," // If the mouse is not moving toward the submenu, cancel any "," // submenus that might be in the process of being displayed "," // (via a timer) and hide this submenu immediately.",""," menuNav._cancelShowSubmenuTimer();",""," menuNav._hideMenu(oSubmenu);",""," }",""," }",""," },"," ",""," /**"," * @method _onMenuItemMouseOver"," * @description \"mouseover\" event handler for a menuitem."," * @protected"," * @param {Node} menuItem Node instance representing a menuitem."," * @param {Object} event Object representing the DOM event."," */"," _onMenuItemMouseOver: function (menuItem, event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," bIsRoot = menuNav._isRoot(oActiveMenu),"," bUseAutoSubmenuDisplay = "," (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot);","",""," menuNav._focusItem(menuItem);"," menuNav._setActiveItem(menuItem);","",""," if (bUseAutoSubmenuDisplay && !menuNav._movingToSubmenu) {",""," menuNav._hideAllSubmenus(oActiveMenu);",""," }",""," },"," ",""," /**"," * @method _onMenuItemMouseOut"," * @description \"mouseout\" event handler for a menuitem."," * @protected"," * @param {Node} menuItem Node instance representing a menuitem."," * @param {Object} event Object representing the DOM event."," */"," _onMenuItemMouseOut: function (menuItem, event) {",""," this._clearActiveItem();",""," },","",""," /**"," * @method _onVerticalMenuKeyDown"," * @description \"keydown\" event handler for vertical menus."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onVerticalMenuKeyDown: function (event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oRootMenu = menuNav._rootMenu,"," oTarget = event.target,"," bPreventDefault = false,"," nKeyCode = event.keyCode,"," oSubmenu,"," oParentMenu,"," oLI,"," oItem;","",""," switch (nKeyCode) {",""," case 37: // left arrow",""," oParentMenu = getParentMenu(oActiveMenu);",""," if (oParentMenu && isHorizontalMenu(oParentMenu)) {"," "," menuNav._hideMenu(oActiveMenu);"," oLI = getPreviousSibling(oActiveMenu.get(PARENT_NODE));"," oItem = getItem(oLI);"," "," if (oItem) {",""," if (isMenuLabel(oItem)) { // Menu label"," "," oSubmenu = oItem.next();"," ",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }"," else {"," "," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem);"," "," }"," "," }"," else { // MenuItem",""," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem);",""," }"," "," }",""," }"," else if (!menuNav._isRoot(oActiveMenu)) {"," menuNav._hideMenu(oActiveMenu, true);"," }","",""," bPreventDefault = true;",""," break;",""," case 39: // right arrow",""," if (isMenuLabel(oTarget)) {"," "," oSubmenu = oTarget.next();",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }"," "," }"," else if (isHorizontalMenu(oRootMenu)) {",""," oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu);"," oLI = getNextSibling(oSubmenu.get(PARENT_NODE));"," oItem = getItem(oLI);",""," menuNav._hideAllSubmenus(oRootMenu);",""," if (oItem) {",""," if (isMenuLabel(oItem)) { // Menu label",""," oSubmenu = oItem.next();",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }"," else {",""," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem); ",""," }"," "," }"," else { // MenuItem",""," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem);",""," } ",""," }"," "," }",""," bPreventDefault = true;",""," break;",""," } ","",""," if (bPreventDefault) {",""," // Prevent the browser from scrolling the window",""," event.preventDefault(); ",""," }"," "," },"," ",""," /**"," * @method _onHorizontalMenuKeyDown"," * @description \"keydown\" event handler for horizontal menus."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onHorizontalMenuKeyDown: function (event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oTarget = event.target,"," oFocusedItem = getItem(oTarget, true),"," bPreventDefault = false,"," nKeyCode = event.keyCode,"," oSubmenu;","",""," if (nKeyCode === 40) {",""," menuNav._hideAllSubmenus(oActiveMenu);",""," if (isMenuLabel(oFocusedItem)) {"," "," oSubmenu = oFocusedItem.next();",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }",""," bPreventDefault = true;"," "," }",""," } ","",""," if (bPreventDefault) {",""," // Prevent the browser from scrolling the window",""," event.preventDefault(); ",""," }"," "," },","",""," // Generic DOM Event handlers","",""," /**"," * @method _onMouseMove"," * @description \"mousemove\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onMouseMove: function (event) {",""," var menuNav = this;",""," // Using a timer to set the value of the \"_currentMouseX\" property "," // helps improve the reliability of the calculation used to set the "," // value of the \"_movingToSubmenu\" property - especially in Opera.",""," later(10, menuNav, function () {",""," menuNav._currentMouseX = event.pageX;"," "," });"," "," },","",""," /**"," * @method _onMouseOver"," * @description \"mouseover\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onMouseOver: function (event) {",""," var menuNav = this,"," oTarget,"," oMenu,"," oMenuLabel,"," oParentMenu,"," oMenuItem;","",""," if (menuNav._blockMouseEvent) {"," menuNav._blockMouseEvent = false;"," }"," else {",""," oTarget = event.target;"," oMenu = getMenu(oTarget, true);"," oMenuLabel = getMenuLabel(oTarget, true);"," oMenuItem = getMenuItem(oTarget, true);","",""," if (handleMouseOverForNode(oMenu, oTarget)) {",""," menuNav._onMenuMouseOver(oMenu, event);",""," oMenu[HANDLED_MOUSEOVER] = true;"," oMenu[HANDLED_MOUSEOUT] = false;",""," oParentMenu = getParentMenu(oMenu);",""," if (oParentMenu) {",""," oParentMenu[HANDLED_MOUSEOUT] = true;"," oParentMenu[HANDLED_MOUSEOVER] = false;"," "," }"," "," }",""," if (handleMouseOverForNode(oMenuLabel, oTarget)) {",""," menuNav._onMenuLabelMouseOver(oMenuLabel, event);",""," oMenuLabel[HANDLED_MOUSEOVER] = true;"," oMenuLabel[HANDLED_MOUSEOUT] = false;"," "," }",""," if (handleMouseOverForNode(oMenuItem, oTarget)) {"," "," menuNav._onMenuItemMouseOver(oMenuItem, event);",""," oMenuItem[HANDLED_MOUSEOVER] = true;"," oMenuItem[HANDLED_MOUSEOUT] = false;"," "," }",""," }",""," },","",""," /**"," * @method _onMouseOut"," * @description \"mouseout\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onMouseOut: function (event) {"," "," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," bMovingToSubmenu = false,"," oTarget,"," oRelatedTarget,"," oMenu,"," oMenuLabel,"," oSubmenu,"," oMenuItem;","",""," menuNav._movingToSubmenu = "," (oActiveMenu && !isHorizontalMenu(oActiveMenu) && "," ((event.pageX - 5) > menuNav._currentMouseX));"," "," oTarget = event.target;"," oRelatedTarget = event.relatedTarget;"," oMenu = getMenu(oTarget, true);"," oMenuLabel = getMenuLabel(oTarget, true);"," oMenuItem = getMenuItem(oTarget, true);","",""," if (handleMouseOutForNode(oMenuLabel, oRelatedTarget)) {",""," menuNav._onMenuLabelMouseOut(oMenuLabel, event);",""," oMenuLabel[HANDLED_MOUSEOUT] = true;"," oMenuLabel[HANDLED_MOUSEOVER] = false;",""," }",""," if (handleMouseOutForNode(oMenuItem, oRelatedTarget)) {",""," menuNav._onMenuItemMouseOut(oMenuItem, event);",""," oMenuItem[HANDLED_MOUSEOUT] = true;"," oMenuItem[HANDLED_MOUSEOVER] = false;"," "," }","",""," if (oMenuLabel) {",""," oSubmenu = oMenuLabel.next();",""," if (oSubmenu && oRelatedTarget && "," (oRelatedTarget.compareTo(oSubmenu) || "," oSubmenu.contains(oRelatedTarget))) {",""," bMovingToSubmenu = true;",""," }"," "," }"," ",""," if (handleMouseOutForNode(oMenu, oRelatedTarget) || bMovingToSubmenu) {",""," menuNav._onMenuMouseOut(oMenu, event); ",""," oMenu[HANDLED_MOUSEOUT] = true;"," oMenu[HANDLED_MOUSEOVER] = false;"," "," }"," "," },","",""," /**"," * @method _toggleSubmenuDisplay"," * @description \"mousedown,\" \"keydown,\" and \"click\" event handler for the "," * menu used to toggle the display of a submenu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _toggleSubmenuDisplay: function (event) {",""," var menuNav = this,"," oTarget = event.target,"," oMenuLabel = getMenuLabel(oTarget, true),"," sType = event.type,"," oAnchor,"," oSubmenu,"," sHref,"," nHashPos,"," nLen,"," sId;","",""," if (oMenuLabel) {",""," oAnchor = isAnchor(oTarget) ? oTarget : oTarget.ancestor(isAnchor);"," ",""," if (oAnchor) {",""," // Need to pass \"2\" as a second argument to \"getAttribute\" for "," // IE otherwise IE will return a fully qualified URL for the "," // value of the \"href\" attribute."," // http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx",""," sHref = oAnchor.getAttribute(\"href\", 2);"," nHashPos = sHref.indexOf(\"#\");"," nLen = sHref.length;",""," if (nHashPos === 0 && nLen > 1) {",""," sId = sHref.substr(1, nLen);"," oSubmenu = oMenuLabel.next();",""," if (oSubmenu && (oSubmenu.get(ID) === sId)) {",""," if (sType === MOUSEDOWN || sType === KEYDOWN) {"," "," if ((UA.opera || UA.gecko || UA.ie) && sType === KEYDOWN && !menuNav._preventClickHandle) {",""," // Prevent the browser from following the URL of "," // the anchor element",""," menuNav._preventClickHandle = menuNav._rootMenu.on(\"click\", function (event) {",""," event.preventDefault();",""," menuNav._preventClickHandle.detach();"," menuNav._preventClickHandle = null;",""," });",""," }"," "," if (sType == MOUSEDOWN) {",""," // Prevent the target from getting focused by "," // default, since the element to be focused will"," // be determined by weather or not the submenu"," // is visible."," event.preventDefault();",""," // FocusManager will attempt to focus any "," // descendant that is the target of the mousedown"," // event. Since we want to explicitly control "," // where focus is going, we need to call "," // \"stopImmediatePropagation\" to stop the "," // FocusManager from doing its thing."," event.stopImmediatePropagation(); ",""," // The \"_focusItem\" method relies on the "," // \"_hasFocus\" property being set to true. The"," // \"_hasFocus\" property is normally set via a "," // \"focus\" event listener, but since we've "," // blocked focus from happening, we need to set "," // this property manually."," menuNav._hasFocus = true;",""," }",""," "," if (menuNav._isRoot(getParentMenu(oTarget))) { // Event target is a submenu label in the root menu"," "," // Menu label toggle functionality"," "," if (hasVisibleSubmenu(oMenuLabel)) {"," "," menuNav._hideMenu(oSubmenu);"," menuNav._focusItem(oMenuLabel); "," menuNav._setActiveItem(oMenuLabel);"," "," }"," else {"," "," menuNav._hideAllSubmenus(menuNav._rootMenu);"," menuNav._showMenu(oSubmenu);",""," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));"," "," }"," "," }"," else { // Event target is a submenu label within a submenu"," "," if (menuNav._activeItem == oMenuLabel) {"," "," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu)); "," "," }"," else {"," "," if (!oMenuLabel._clickHandle) {",""," oMenuLabel._clickHandle = oMenuLabel.on(\"click\", function () {",""," menuNav._hideAllSubmenus(menuNav._rootMenu);",""," menuNav._hasFocus = false;"," menuNav._clearActiveItem();","",""," oMenuLabel._clickHandle.detach();"," "," oMenuLabel._clickHandle = null;",""," });"," "," }"," "," }"," "," }",""," }","",""," if (sType === CLICK) {"," "," // Prevent the browser from following the URL of "," // the anchor element"," "," event.preventDefault();"," "," }"," "," }"," "," } ","",""," }"," "," }"," "," },"," ",""," /**"," * @method _onKeyPress"," * @description \"keypress\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onKeyPress: function (event) {"," "," switch (event.keyCode) {",""," case 37: // left arrow"," case 38: // up arrow"," case 39: // right arrow"," case 40: // down arrow",""," // Prevent the browser from scrolling the window",""," event.preventDefault();",""," break;",""," } ",""," }, ","",""," /**"," * @method _onKeyDown"," * @description \"keydown\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onKeyDown: function (event) {",""," var menuNav = this,"," oActiveItem = menuNav._activeItem,"," oTarget = event.target,"," oActiveMenu = getParentMenu(oTarget),"," oSubmenu;",""," if (oActiveMenu) {",""," menuNav._activeMenu = oActiveMenu;",""," if (isHorizontalMenu(oActiveMenu)) {"," menuNav._onHorizontalMenuKeyDown(event);"," }"," else {"," menuNav._onVerticalMenuKeyDown(event);"," }","",""," if (event.keyCode === 27) {",""," if (!menuNav._isRoot(oActiveMenu)) {",""," if (UA.opera) {"," later(0, menuNav, function () {"," menuNav._hideMenu(oActiveMenu, true);"," }); "," }"," else {"," menuNav._hideMenu(oActiveMenu, true); "," }",""," event.stopPropagation();"," menuNav._blockMouseEvent = UA.gecko ? true : false;",""," }"," else if (oActiveItem) {",""," if (isMenuLabel(oActiveItem) && "," hasVisibleSubmenu(oActiveItem)) {"," "," oSubmenu = oActiveItem.next();",""," if (oSubmenu) {"," menuNav._hideMenu(oSubmenu);"," }",""," }"," else {",""," menuNav._focusManager.blur();",""," // This is necessary for Webkit since blurring the "," // active menuitem won't result in the document "," // gaining focus, meaning the that _onDocFocus "," // listener won't clear the active menuitem.",""," menuNav._clearActiveItem(); "," "," menuNav._hasFocus = false;",""," }",""," }"," "," }"," "," }"," "," },"," "," /**"," * @method _onDocMouseDown"," * @description \"mousedown\" event handler for the owner document of "," * the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onDocMouseDown: function (event) {",""," var menuNav = this,"," oRoot = menuNav._rootMenu,"," oTarget = event.target;","",""," if (!(oRoot.compareTo(oTarget) || oRoot.contains(oTarget))) {",""," menuNav._hideAllSubmenus(oRoot);",""," // Document doesn't receive focus in Webkit when the user mouses "," // down on it, so the \"_hasFocus\" property won't get set to the "," // correct value. The following line corrects the problem.",""," if (UA.webkit) {"," menuNav._hasFocus = false;"," menuNav._clearActiveItem();"," }",""," }",""," }"," ","});","","","Y.namespace('Plugin');","","Y.Plugin.NodeMenuNav = NodeMenuNav;","","","}, '3.7.2', {\"requires\": [\"node\", \"classnamemanager\", \"plugin\", \"node-focusmanager\"], \"skinnable\": true});"];+_yuitest_coverage["build/node-menunav/node-menunav.js"].code=["YUI.add('node-menunav', function (Y, NAME) {","","/**","* <p>The MenuNav Node Plugin makes it easy to transform existing list-based ","* markup into traditional, drop down navigational menus that are both accessible ","* and easy to customize, and only require a small set of dependencies.</p>","* ","* ","* <p>To use the MenuNav Node Plugin, simply pass a reference to the plugin to a ","* Node instance's <code>plug</code> method.</p>","* ","* <p>","* <code>","* <script type=\"text/javascript\"> <br>","* <br>","* // Call the \"use\" method, passing in \"node-menunav\". This will <br>","* // load the script and CSS for the MenuNav Node Plugin and all of <br>","* // the required dependencies. <br>","* <br>","* YUI().use(\"node-menunav\", function(Y) { <br>","* <br>","* // Use the \"contentready\" event to initialize the menu when <br>","* // the subtree of element representing the root menu <br>","* // (<div id=\"menu-1\">) is ready to be scripted. <br>","* <br>","* Y.on(\"contentready\", function () { <br>","* <br>","* // The scope of the callback will be a Node instance <br>","* // representing the root menu (<div id=\"menu-1\">). <br>","* // Therefore, since \"this\" represents a Node instance, it <br>","* // is possible to just call \"this.plug\" passing in a <br>","* // reference to the MenuNav Node Plugin. <br>","* <br>","* this.plug(Y.Plugin.NodeMenuNav); <br>","* <br>","* }, \"#menu-1\"); <br>","* <br> ","* }); <br>","* <br> ","* </script> <br>","* </code>","* </p>","*","* <p>The MenuNav Node Plugin has several configuration properties that can be ","* set via an object literal that is passed as a second argument to a Node ","* instance's <code>plug</code> method.","* </p>","*","* <p>","* <code>","* <script type=\"text/javascript\"> <br>","* <br>","* // Call the \"use\" method, passing in \"node-menunav\". This will <br>","* // load the script and CSS for the MenuNav Node Plugin and all of <br>","* // the required dependencies. <br>","* <br>","* YUI().use(\"node-menunav\", function(Y) { <br>","* <br>","* // Use the \"contentready\" event to initialize the menu when <br>","* // the subtree of element representing the root menu <br>","* // (<div id=\"menu-1\">) is ready to be scripted. <br>","* <br>","* Y.on(\"contentready\", function () { <br>","* <br>","* // The scope of the callback will be a Node instance <br>","* // representing the root menu (<div id=\"menu-1\">). <br>","* // Therefore, since \"this\" represents a Node instance, it <br>","* // is possible to just call \"this.plug\" passing in a <br>","* // reference to the MenuNav Node Plugin. <br>","* <br>","* this.plug(Y.Plugin.NodeMenuNav, { mouseOutHideDelay: 1000 });","* <br><br>","* }, \"#menu-1\"); <br>","* <br> ","* }); <br>","* <br> ","* </script> <br>","* </code>","* </p>","* ","* @module node-menunav","*/","",""," // Util shortcuts","","var UA = Y.UA,"," later = Y.later,"," getClassName = Y.ClassNameManager.getClassName,","","",""," // Frequently used strings",""," MENU = \"menu\","," MENUITEM = \"menuitem\","," HIDDEN = \"hidden\","," PARENT_NODE = \"parentNode\","," CHILDREN = \"children\","," OFFSET_HEIGHT = \"offsetHeight\","," OFFSET_WIDTH = \"offsetWidth\","," PX = \"px\","," ID = \"id\","," PERIOD = \".\","," HANDLED_MOUSEOUT = \"handledMouseOut\","," HANDLED_MOUSEOVER = \"handledMouseOver\","," ACTIVE = \"active\","," LABEL = \"label\","," LOWERCASE_A = \"a\","," MOUSEDOWN = \"mousedown\","," KEYDOWN = \"keydown\","," CLICK = \"click\","," EMPTY_STRING = \"\","," FIRST_OF_TYPE = \"first-of-type\","," ROLE = \"role\","," PRESENTATION = \"presentation\","," DESCENDANTS = \"descendants\","," UI = \"UI\","," ACTIVE_DESCENDANT = \"activeDescendant\","," USE_ARIA = \"useARIA\","," ARIA_HIDDEN = \"aria-hidden\","," CONTENT = \"content\","," HOST = \"host\","," ACTIVE_DESCENDANT_CHANGE = ACTIVE_DESCENDANT + \"Change\",","",""," // Attribute keys"," "," AUTO_SUBMENU_DISPLAY = \"autoSubmenuDisplay\","," MOUSEOUT_HIDE_DELAY = \"mouseOutHideDelay\",","",""," // CSS class names",""," CSS_MENU = getClassName(MENU),"," CSS_MENU_HIDDEN = getClassName(MENU, HIDDEN),"," CSS_MENU_HORIZONTAL = getClassName(MENU, \"horizontal\"),"," CSS_MENU_LABEL = getClassName(MENU, LABEL),"," CSS_MENU_LABEL_ACTIVE = getClassName(MENU, LABEL, ACTIVE),"," CSS_MENU_LABEL_MENUVISIBLE = getClassName(MENU, LABEL, (MENU + \"visible\")),"," CSS_MENUITEM = getClassName(MENUITEM),"," CSS_MENUITEM_ACTIVE = getClassName(MENUITEM, ACTIVE),","",""," // CSS selectors"," "," MENU_SELECTOR = PERIOD + CSS_MENU,"," MENU_TOGGLE_SELECTOR = (PERIOD + getClassName(MENU, \"toggle\")),"," MENU_CONTENT_SELECTOR = PERIOD + getClassName(MENU, CONTENT),"," MENU_LABEL_SELECTOR = PERIOD + CSS_MENU_LABEL,",""," STANDARD_QUERY = \">\" + MENU_CONTENT_SELECTOR + \">ul>li>a\","," EXTENDED_QUERY = \">\" + MENU_CONTENT_SELECTOR + \">ul>li>\" + MENU_LABEL_SELECTOR + \">a:first-child\";","","// Utility functions","","","var getPreviousSibling = function (node) {",""," var oPrevious = node.previous(),"," oChildren;",""," if (!oPrevious) {"," oChildren = node.get(PARENT_NODE).get(CHILDREN);"," oPrevious = oChildren.item(oChildren.size() - 1);"," }"," "," return oPrevious;","","};","","","var getNextSibling = function (node) {",""," var oNext = node.next();",""," if (!oNext) {"," oNext = node.get(PARENT_NODE).get(CHILDREN).item(0); "," }"," "," return oNext;","","};","","","var isAnchor = function (node) {"," "," var bReturnVal = false;"," "," if (node) {"," bReturnVal = node.get(\"nodeName\").toLowerCase() === LOWERCASE_A;"," }"," "," return bReturnVal;"," ","};","","","var isMenuItem = function (node) {",""," return node.hasClass(CSS_MENUITEM);","","};","","","var isMenuLabel = function (node) {",""," return node.hasClass(CSS_MENU_LABEL);","","};","","","var isHorizontalMenu = function (menu) {",""," return menu.hasClass(CSS_MENU_HORIZONTAL);","","};","","","var hasVisibleSubmenu = function (menuLabel) {",""," return menuLabel.hasClass(CSS_MENU_LABEL_MENUVISIBLE);","","};","","","var getItemAnchor = function (node) {",""," return isAnchor(node) ? node : node.one(LOWERCASE_A);","","};","","","var getNodeWithClass = function (node, className, searchAncestors) {",""," var oItem;"," "," if (node) {"," "," if (node.hasClass(className)) {"," oItem = node;"," }"," "," if (!oItem && searchAncestors) {"," oItem = node.ancestor((PERIOD + className));"," }"," "," }"," "," return oItem;","","};","","","var getParentMenu = function (node) {",""," return node.ancestor(MENU_SELECTOR);"," ","};","","","var getMenu = function (node, searchAncestors) {",""," return getNodeWithClass(node, CSS_MENU, searchAncestors);","","};","","","var getMenuItem = function (node, searchAncestors) {",""," var oItem;"," "," if (node) {"," oItem = getNodeWithClass(node, CSS_MENUITEM, searchAncestors);"," }"," "," return oItem;","","};","","","var getMenuLabel = function (node, searchAncestors) {",""," var oItem;"," "," if (node) {"," "," if (searchAncestors) {"," oItem = getNodeWithClass(node, CSS_MENU_LABEL, searchAncestors);"," }"," else {"," oItem = getNodeWithClass(node, CSS_MENU_LABEL) || "," node.one((PERIOD + CSS_MENU_LABEL));"," }"," "," }"," "," return oItem;","","};","","","var getItem = function (node, searchAncestors) {",""," var oItem;"," "," if (node) {"," oItem = getMenuItem(node, searchAncestors) || "," getMenuLabel(node, searchAncestors);"," }"," "," return oItem; ","","};","","","var getFirstItem = function (menu) {"," "," return getItem(menu.one(\"li\"));","","};","","","var getActiveClass = function (node) {",""," return isMenuItem(node) ? CSS_MENUITEM_ACTIVE : CSS_MENU_LABEL_ACTIVE;","","};","","","var handleMouseOverForNode = function (node, target) {",""," return node && !node[HANDLED_MOUSEOVER] && "," (node.compareTo(target) || node.contains(target));","","};","","","var handleMouseOutForNode = function (node, relatedTarget) {",""," return node && !node[HANDLED_MOUSEOUT] && "," (!node.compareTo(relatedTarget) && !node.contains(relatedTarget));","","};","","/**","* The NodeMenuNav class is a plugin for a Node instance. The class is used via ","* the <a href=\"Node.html#method_plug\"><code>plug</code></a> method of Node and ","* should not be instantiated directly.","* @namespace plugin","* @class NodeMenuNav","*/","var NodeMenuNav = function () {",""," NodeMenuNav.superclass.constructor.apply(this, arguments);","","};","","NodeMenuNav.NAME = \"nodeMenuNav\";","NodeMenuNav.NS = \"menuNav\";","","","/** ","* @property SHIM_TEMPLATE_TITLE","* @description String representing the value for the <code>title</code> ","* attribute for the shim used to prevent <code><select></code> elements ","* from poking through menus in IE 6.","* @default \"Menu Stacking Shim\"","* @type String","*/","NodeMenuNav.SHIM_TEMPLATE_TITLE = \"Menu Stacking Shim\";","","","/** ","* @property SHIM_TEMPLATE","* @description String representing the HTML used to create the ","* <code><iframe></code> shim used to prevent ","* <code><select></code> elements from poking through menus in IE 6.","* @default "<iframe frameborder="0" tabindex="-1" ","* class="yui-shim" title="Menu Stacking Shim" ","* src="javascript:false;"></iframe>"","* @type String","*/","","// <iframe> shim notes:","//","// 1) Need to set the \"frameBorder\" property to 0 to suppress the default ","// <iframe> border in IE. (Setting the CSS \"border\" property alone doesn't ","// suppress it.) ","//","// 2) The \"src\" attribute of the <iframe> is set to \"javascript:false;\" so ","// that it won't load a page inside it, preventing the secure/nonsecure ","// warning in IE when using HTTPS.","//","// 3) Since the role of the <iframe> shim is completely presentational, its ","// \"tabindex\" attribute is set to \"-1\" and its title attribute is set to ","// \"Menu Stacking Shim\". Both strategies help users of screen readers to ","// avoid mistakenly interacting with the <iframe> shim.","","NodeMenuNav.SHIM_TEMPLATE = '<iframe frameborder=\"0\" tabindex=\"-1\" class=\"' + "," getClassName(\"shim\") + "," '\" title=\"' + NodeMenuNav.SHIM_TEMPLATE_TITLE + "," '\" src=\"javascript:false;\"></iframe>';","","","NodeMenuNav.ATTRS = {",""," /**"," * Boolean indicating if use of the WAI-ARIA Roles and States should be "," * enabled for the menu."," *"," * @attribute useARIA"," * @readOnly"," * @writeOnce "," * @default true"," * @type boolean"," */"," useARIA: {"," "," value: true,"," writeOnce: true,"," lazyAdd: false,"," setter: function (value) {",""," var oMenu = this.get(HOST),"," oMenuLabel,"," oMenuToggle,"," oSubmenu,"," sID;",""," if (value) {",""," oMenu.set(ROLE, MENU);",""," oMenu.all(\"ul,li,\" + MENU_CONTENT_SELECTOR).set(ROLE, PRESENTATION);",""," oMenu.all((PERIOD + getClassName(MENUITEM, CONTENT))).set(ROLE, MENUITEM);",""," oMenu.all((PERIOD + CSS_MENU_LABEL)).each(function (node) {",""," oMenuLabel = node;"," oMenuToggle = node.one(MENU_TOGGLE_SELECTOR);",""," if (oMenuToggle) {"," oMenuToggle.set(ROLE, PRESENTATION);"," oMenuLabel = oMenuToggle.previous();"," }",""," oMenuLabel.set(ROLE, MENUITEM);"," oMenuLabel.set(\"aria-haspopup\", true);",""," oSubmenu = node.next();",""," if (oSubmenu) {",""," oSubmenu.set(ROLE, MENU);",""," oMenuLabel = oSubmenu.previous();"," oMenuToggle = oMenuLabel.one(MENU_TOGGLE_SELECTOR);",""," if (oMenuToggle) {"," oMenuLabel = oMenuToggle;"," }",""," sID = Y.stamp(oMenuLabel);",""," if (!oMenuLabel.get(ID)) {"," oMenuLabel.set(ID, sID);"," }",""," oSubmenu.set(\"aria-labelledby\", sID);"," oSubmenu.set(ARIA_HIDDEN, true);"," "," }",""," });"," "," }",""," }"," "," },","",""," /**"," * Boolean indicating if submenus are automatically made visible when the "," * user mouses over the menu's items."," *"," * @attribute autoSubmenuDisplay"," * @readOnly"," * @writeOnce "," * @default true"," * @type boolean"," */ "," autoSubmenuDisplay: {"," "," value: true,"," writeOnce: true"," "," },","",""," /**"," * Number indicating the time (in milliseconds) that should expire before a "," * submenu is made visible when the user mouses over the menu's label."," *"," * @attribute submenuShowDelay"," * @readOnly"," * @writeOnce "," * @default 250"," * @type Number"," */"," submenuShowDelay: {"," "," value: 250,"," writeOnce: true"," "," },","",""," /**"," * Number indicating the time (in milliseconds) that should expire before a "," * submenu is hidden when the user mouses out of a menu label heading in the "," * direction of a submenu. "," *"," * @attribute submenuHideDelay"," * @readOnly"," * @writeOnce "," * @default 250"," * @type Number"," */"," submenuHideDelay: {"," "," value: 250,"," writeOnce: true"," "," },","",""," /**"," * Number indicating the time (in milliseconds) that should expire before a "," * submenu is hidden when the user mouses out of it."," * "," * @attribute mouseOutHideDelay"," * @readOnly"," * @writeOnce "," * @default 750"," * @type Number"," */ "," mouseOutHideDelay: {"," "," value: 750,"," writeOnce: true"," "," }","","};","","","Y.extend(NodeMenuNav, Y.Plugin.Base, {",""," // Protected properties",""," /** "," * @property _rootMenu"," * @description Node instance representing the root menu in the menu."," * @default null"," * @protected"," * @type Node"," */"," _rootMenu: null, ","",""," /** "," * @property _activeItem"," * @description Node instance representing the menu's active descendent: "," * the menuitem or menu label the user is currently interacting with."," * @default null"," * @protected"," * @type Node"," */"," _activeItem: null, ","",""," /** "," * @property _activeMenu"," * @description Node instance representing the menu that is the parent of "," * the menu's active descendent."," * @default null"," * @protected"," * @type Node"," */"," _activeMenu: null,","",""," /** "," * @property _hasFocus"," * @description Boolean indicating if the menu has focus."," * @default false"," * @protected"," * @type Boolean"," */"," _hasFocus: false,","",""," // In gecko-based browsers a mouseover and mouseout event will fire even "," // if a DOM element moves out from under the mouse without the user "," // actually moving the mouse. This bug affects NodeMenuNav because the "," // user can hit the Esc key to hide a menu, and if the mouse is over the "," // menu when the user presses Esc, the _onMenuMouseOut handler will be "," // called. To fix this bug the following flag (_blockMouseEvent) is used "," // to block the code in the _onMenuMouseOut handler from executing.",""," /** "," * @property _blockMouseEvent"," * @description Boolean indicating whether or not to handle the "," * \"mouseover\" event."," * @default false"," * @protected"," * @type Boolean"," */"," _blockMouseEvent: false,","",""," /** "," * @property _currentMouseX"," * @description Number representing the current x coordinate of the mouse "," * inside the menu."," * @default 0"," * @protected"," * @type Number"," */"," _currentMouseX: 0,","",""," /** "," * @property _movingToSubmenu"," * @description Boolean indicating if the mouse is moving from a menu "," * label to its corresponding submenu."," * @default false"," * @protected"," * @type Boolean"," */"," _movingToSubmenu: false,","",""," /** "," * @property _showSubmenuTimer"," * @description Timer used to show a submenu."," * @default null"," * @protected"," * @type Object"," */"," _showSubmenuTimer: null,","",""," /** "," * @property _hideSubmenuTimer"," * @description Timer used to hide a submenu."," * @default null"," * @protected"," * @type Object"," */"," _hideSubmenuTimer: null,","",""," /** "," * @property _hideAllSubmenusTimer"," * @description Timer used to hide a all submenus."," * @default null"," * @protected"," * @type Object"," */"," _hideAllSubmenusTimer: null,","",""," /** "," * @property _firstItem"," * @description Node instance representing the first item (menuitem or menu "," * label) in the root menu of a menu."," * @default null"," * @protected"," * @type Node"," */"," _firstItem: null,","",""," // Public methods","",""," initializer: function (config) {",""," var menuNav = this,"," oRootMenu = this.get(HOST),"," aHandlers = [],"," oDoc;","",""," if (oRootMenu) {",""," menuNav._rootMenu = oRootMenu;",""," oRootMenu.all(\"ul:first-child\").addClass(FIRST_OF_TYPE);",""," // Hide all visible submenus",""," oRootMenu.all(MENU_SELECTOR).addClass(CSS_MENU_HIDDEN);","",""," // Wire up all event handlers",""," aHandlers.push(oRootMenu.on(\"mouseover\", menuNav._onMouseOver, menuNav));"," aHandlers.push(oRootMenu.on(\"mouseout\", menuNav._onMouseOut, menuNav));"," aHandlers.push(oRootMenu.on(\"mousemove\", menuNav._onMouseMove, menuNav));"," aHandlers.push(oRootMenu.on(MOUSEDOWN, menuNav._toggleSubmenuDisplay, menuNav));"," aHandlers.push(Y.on(\"key\", menuNav._toggleSubmenuDisplay, oRootMenu, \"down:13\", menuNav));"," aHandlers.push(oRootMenu.on(CLICK, menuNav._toggleSubmenuDisplay, menuNav));"," aHandlers.push(oRootMenu.on(\"keypress\", menuNav._onKeyPress, menuNav));"," aHandlers.push(oRootMenu.on(KEYDOWN, menuNav._onKeyDown, menuNav));",""," oDoc = oRootMenu.get(\"ownerDocument\");",""," aHandlers.push(oDoc.on(MOUSEDOWN, menuNav._onDocMouseDown, menuNav));"," aHandlers.push(oDoc.on(\"focus\", menuNav._onDocFocus, menuNav));",""," this._eventHandlers = aHandlers;",""," menuNav._initFocusManager();",""," }"," ",""," },",""," destructor: function () {",""," var aHandlers = this._eventHandlers;",""," if (aHandlers) {",""," Y.Array.each(aHandlers, function (handle) {"," handle.detach();"," });",""," this._eventHandlers = null;",""," }"," "," this.get(HOST).unplug(\"focusManager\");"," "," },","","",""," // Protected methods",""," /**"," * @method _isRoot"," * @description Returns a boolean indicating if the specified menu is the "," * root menu in the menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @return {Boolean} Boolean indicating if the specified menu is the root "," * menu in the menu."," */"," _isRoot: function (menu) {",""," return this._rootMenu.compareTo(menu);",""," },","",""," /**"," * @method _getTopmostSubmenu"," * @description Returns the topmost submenu of a submenu hierarchy."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @return {Node} Node instance representing a menu."," */"," _getTopmostSubmenu: function (menu) {"," "," var menuNav = this,"," oMenu = getParentMenu(menu),"," returnVal;","",""," if (!oMenu) {"," returnVal = menu;"," }"," else if (menuNav._isRoot(oMenu)) {"," returnVal = menu;"," }"," else {"," returnVal = menuNav._getTopmostSubmenu(oMenu);"," }"," "," return returnVal;"," "," },","",""," /**"," * @method _clearActiveItem"," * @description Clears the menu's active descendent."," * @protected"," */"," _clearActiveItem: function () {",""," var menuNav = this,"," oActiveItem = menuNav._activeItem;"," "," if (oActiveItem) {"," oActiveItem.removeClass(getActiveClass(oActiveItem));"," }",""," menuNav._activeItem = null;"," "," },","",""," /**"," * @method _setActiveItem"," * @description Sets the specified menuitem or menu label as the menu's "," * active descendent."," * @protected"," * @param {Node} item Node instance representing a menuitem or menu label."," */"," _setActiveItem: function (item) {",""," var menuNav = this;"," "," if (item) {"," "," menuNav._clearActiveItem();"," "," item.addClass(getActiveClass(item));"," "," menuNav._activeItem = item;"," "," }"," "," },","",""," /**"," * @method _focusItem"," * @description Focuses the specified menuitem or menu label."," * @protected"," * @param {Node} item Node instance representing a menuitem or menu label."," */"," _focusItem: function (item) {"," "," var menuNav = this,"," oMenu,"," oItem;"," "," if (item && menuNav._hasFocus) {",""," oMenu = getParentMenu(item);"," oItem = getItemAnchor(item);",""," if (oMenu && !oMenu.compareTo(menuNav._activeMenu)) {"," menuNav._activeMenu = oMenu;"," menuNav._initFocusManager();"," }"," "," menuNav._focusManager.focus(oItem);",""," }"," "," },","",""," /**"," * @method _showMenu"," * @description Shows the specified menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," */"," _showMenu: function (menu) {",""," var oParentMenu = getParentMenu(menu),"," oLI = menu.get(PARENT_NODE),"," aXY = oLI.getXY();","",""," if (this.get(USE_ARIA)) {"," menu.set(ARIA_HIDDEN, false);"," }","",""," if (isHorizontalMenu(oParentMenu)) {"," aXY[1] = aXY[1] + oLI.get(OFFSET_HEIGHT);"," }"," else {"," aXY[0] = aXY[0] + oLI.get(OFFSET_WIDTH);"," }"," "," menu.setXY(aXY);",""," if (UA.ie < 8) {",""," if (UA.ie === 6 && !menu.hasIFrameShim) {"," "," menu.appendChild(Y.Node.create(NodeMenuNav.SHIM_TEMPLATE));"," menu.hasIFrameShim = true;",""," }",""," // Clear previous values for height and width",""," menu.setStyles({ height: EMPTY_STRING, width: EMPTY_STRING });",""," // Set the width and height of the menu's bounding box - this is "," // necessary for IE 6 so that the CSS for the <iframe> shim can "," // simply set the <iframe>'s width and height to 100% to ensure "," // that dimensions of an <iframe> shim are always sync'd to the "," // that of its parent menu. Specifying a width and height also "," // helps when positioning decorator elements (for creating effects "," // like rounded corners) inside a menu's bounding box in IE 7."," "," menu.setStyles({ "," height: (menu.get(OFFSET_HEIGHT) + PX), "," width: (menu.get(OFFSET_WIDTH) + PX) });",""," }",""," menu.previous().addClass(CSS_MENU_LABEL_MENUVISIBLE);"," menu.removeClass(CSS_MENU_HIDDEN);",""," },"," ",""," /**"," * @method _hideMenu "," * @description Hides the specified menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @param {Boolean} activateAndFocusLabel Boolean indicating if the label "," * for the specified "," * menu should be focused and set as active."," */"," _hideMenu: function (menu, activateAndFocusLabel) {",""," var menuNav = this,"," oLabel = menu.previous(),"," oActiveItem;",""," oLabel.removeClass(CSS_MENU_LABEL_MENUVISIBLE);","",""," if (activateAndFocusLabel) {"," menuNav._focusItem(oLabel);"," menuNav._setActiveItem(oLabel); "," }",""," oActiveItem = menu.one((PERIOD + CSS_MENUITEM_ACTIVE));",""," if (oActiveItem) {"," oActiveItem.removeClass(CSS_MENUITEM_ACTIVE);"," }",""," // Clear the values for top and left that were set by the call to "," // \"setXY\" when the menu was shown so that the hidden position "," // specified in the core CSS file will take affect.",""," menu.setStyles({ left: EMPTY_STRING, top: EMPTY_STRING });"," "," menu.addClass(CSS_MENU_HIDDEN);",""," if (menuNav.get(USE_ARIA)) {"," menu.set(ARIA_HIDDEN, true);"," } "," "," },","",""," /**"," * @method _hideAllSubmenus"," * @description Hides all submenus of the specified menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," */"," _hideAllSubmenus: function (menu) {",""," var menuNav = this;",""," menu.all(MENU_SELECTOR).each(Y.bind(function (submenuNode) {"," "," menuNav._hideMenu(submenuNode);"," "," }, menuNav));"," "," },","",""," /**"," * @method _cancelShowSubmenuTimer"," * @description Cancels the timer used to show a submenu."," * @protected"," */"," _cancelShowSubmenuTimer: function () {",""," var menuNav = this,"," oShowSubmenuTimer = menuNav._showSubmenuTimer;",""," if (oShowSubmenuTimer) {"," oShowSubmenuTimer.cancel();"," menuNav._showSubmenuTimer = null;"," }"," "," },","",""," /**"," * @method _cancelHideSubmenuTimer"," * @description Cancels the timer used to hide a submenu."," * @protected"," */"," _cancelHideSubmenuTimer: function () {",""," var menuNav = this,"," oHideSubmenuTimer = menuNav._hideSubmenuTimer;","",""," if (oHideSubmenuTimer) {"," oHideSubmenuTimer.cancel();"," menuNav._hideSubmenuTimer = null;"," }"," "," },","",""," /**"," * @method _initFocusManager"," * @description Initializes and updates the Focus Manager so that is is "," * always managing descendants of the active menu."," * @protected"," */"," _initFocusManager: function () {",""," var menuNav = this,"," oRootMenu = menuNav._rootMenu,"," oMenu = menuNav._activeMenu || oRootMenu,"," sSelectorBase = "," menuNav._isRoot(oMenu) ? EMPTY_STRING : (\"#\" + oMenu.get(\"id\")),"," oFocusManager = menuNav._focusManager,"," sKeysVal,"," sDescendantSelector,"," sQuery;",""," if (isHorizontalMenu(oMenu)) {",""," sDescendantSelector = sSelectorBase + STANDARD_QUERY + \",\" + "," sSelectorBase + EXTENDED_QUERY;"," "," sKeysVal = { next: \"down:39\", previous: \"down:37\" };"," "," }"," else {",""," sDescendantSelector = sSelectorBase + STANDARD_QUERY;"," sKeysVal = { next: \"down:40\", previous: \"down:38\" };",""," }","",""," if (!oFocusManager) {",""," oRootMenu.plug(Y.Plugin.NodeFocusManager, { "," descendants: sDescendantSelector,"," keys: sKeysVal,"," circular: true"," });",""," oFocusManager = oRootMenu.focusManager;",""," sQuery = \"#\" + oRootMenu.get(\"id\") + MENU_SELECTOR + \" a,\" + "," MENU_TOGGLE_SELECTOR;",""," oRootMenu.all(sQuery).set(\"tabIndex\", -1);",""," oFocusManager.on(ACTIVE_DESCENDANT_CHANGE, "," this._onActiveDescendantChange, oFocusManager, this);",""," oFocusManager.after(ACTIVE_DESCENDANT_CHANGE, "," this._afterActiveDescendantChange, oFocusManager, this);"," "," menuNav._focusManager = oFocusManager;"," "," }"," else {",""," oFocusManager.set(ACTIVE_DESCENDANT, -1);"," oFocusManager.set(DESCENDANTS, sDescendantSelector);"," oFocusManager.set(\"keys\", sKeysVal);"," "," }",""," },","",""," // Event handlers for discrete pieces of pieces of the menu","",""," /**"," * @method _onActiveDescendantChange"," * @description \"activeDescendantChange\" event handler for menu's "," * Focus Manager."," * @protected"," * @param {Object} event Object representing the Attribute change event."," * @param {NodeMenuNav} menuNav Object representing the NodeMenuNav instance."," */"," _onActiveDescendantChange: function (event, menuNav) {",""," if (event.src === UI && menuNav._activeMenu && "," !menuNav._movingToSubmenu) {",""," menuNav._hideAllSubmenus(menuNav._activeMenu);",""," }"," "," },","",""," /**"," * @method _afterActiveDescendantChange"," * @description \"activeDescendantChange\" event handler for menu's "," * Focus Manager."," * @protected"," * @param {Object} event Object representing the Attribute change event."," * @param {NodeMenuNav} menuNav Object representing the NodeMenuNav instance."," */"," _afterActiveDescendantChange: function (event, menuNav) {",""," var oItem;",""," if (event.src === UI) {"," oItem = getItem(this.get(DESCENDANTS).item(event.newVal), true);"," menuNav._setActiveItem(oItem);"," }"," "," },","",""," /**"," * @method _onDocFocus"," * @description \"focus\" event handler for the owner document of the MenuNav."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onDocFocus: function (event) {"," "," var menuNav = this,"," oActiveItem = menuNav._activeItem,"," oTarget = event.target,"," oMenu;"," ",""," if (menuNav._rootMenu.contains(oTarget)) { // The menu has focus",""," if (menuNav._hasFocus) { ",""," oMenu = getParentMenu(oTarget);",""," // If the element that was focused is a descendant of the "," // root menu, but is in a submenu not currently being "," // managed by the Focus Manager, update the Focus Manager so "," // that it is now managing the submenu that is the parent of "," // the element that was focused."," "," if (!menuNav._activeMenu.compareTo(oMenu)) {",""," menuNav._activeMenu = oMenu;"," menuNav._initFocusManager();"," menuNav._focusManager.set(ACTIVE_DESCENDANT, oTarget);"," menuNav._setActiveItem(getItem(oTarget, true));"," "," }"," "," }"," else { // Initial focus",""," // First time the menu has been focused, need to setup focused "," // state and established active active descendant"," "," menuNav._hasFocus = true;"," "," oActiveItem = getItem(oTarget, true);"," "," if (oActiveItem) { "," menuNav._setActiveItem(oActiveItem);"," }"," "," }"," "," }"," else { // The menu has lost focus",""," menuNav._clearActiveItem();",""," menuNav._cancelShowSubmenuTimer();"," menuNav._hideAllSubmenus(menuNav._rootMenu);",""," menuNav._activeMenu = menuNav._rootMenu;"," menuNav._initFocusManager();"," "," menuNav._focusManager.set(ACTIVE_DESCENDANT, 0);"," "," menuNav._hasFocus = false;",""," }"," "," },","",""," /**"," * @method _onMenuMouseOver"," * @description \"mouseover\" event handler for a menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @param {Object} event Object representing the DOM event."," */"," _onMenuMouseOver: function (menu, event) {",""," var menuNav = this,"," oHideAllSubmenusTimer = menuNav._hideAllSubmenusTimer;",""," if (oHideAllSubmenusTimer) {"," oHideAllSubmenusTimer.cancel();"," menuNav._hideAllSubmenusTimer = null;"," }",""," menuNav._cancelHideSubmenuTimer();",""," // Need to update the FocusManager in advance of focus a new "," // Menu in order to avoid the FocusManager thinking that "," // it has lost focus"," "," if (menu && !menu.compareTo(menuNav._activeMenu)) {"," menuNav._activeMenu = menu;",""," if (menuNav._hasFocus) {"," menuNav._initFocusManager();"," }",""," }",""," if (menuNav._movingToSubmenu && isHorizontalMenu(menu)) {"," menuNav._movingToSubmenu = false;"," }",""," },","",""," /**"," * @method _hideAndFocusLabel"," * @description Hides all of the submenus of the root menu and focuses the "," * label of the topmost submenu"," * @protected"," */"," _hideAndFocusLabel: function () {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oSubmenu;"," "," menuNav._hideAllSubmenus(menuNav._rootMenu);",""," if (oActiveMenu) {",""," // Focus the label element for the topmost submenu"," oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu);"," menuNav._focusItem(oSubmenu.previous());",""," }"," "," },","",""," /**"," * @method _onMenuMouseOut"," * @description \"mouseout\" event handler for a menu."," * @protected"," * @param {Node} menu Node instance representing a menu."," * @param {Object} event Object representing the DOM event."," */"," _onMenuMouseOut: function (menu, event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oRelatedTarget = event.relatedTarget,"," oActiveItem = menuNav._activeItem,"," oParentMenu,"," oMenu;","",""," if (oActiveMenu && !oActiveMenu.contains(oRelatedTarget)) {"," "," oParentMenu = getParentMenu(oActiveMenu);"," ",""," if (oParentMenu && !oParentMenu.contains(oRelatedTarget)) {",""," if (menuNav.get(MOUSEOUT_HIDE_DELAY) > 0) {",""," menuNav._cancelShowSubmenuTimer();",""," menuNav._hideAllSubmenusTimer = ",""," later(menuNav.get(MOUSEOUT_HIDE_DELAY), "," menuNav, menuNav._hideAndFocusLabel);"," "," }"," "," }"," else {"," "," if (oActiveItem) {"," "," oMenu = getParentMenu(oActiveItem);",""," if (!menuNav._isRoot(oMenu)) { "," menuNav._focusItem(oMenu.previous());"," }"," "," }"," "," }",""," }",""," },","",""," /**"," * @method _onMenuLabelMouseOver"," * @description \"mouseover\" event handler for a menu label."," * @protected"," * @param {Node} menuLabel Node instance representing a menu label."," * @param {Object} event Object representing the DOM event."," */"," _onMenuLabelMouseOver: function (menuLabel, event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," bIsRoot = menuNav._isRoot(oActiveMenu),"," bUseAutoSubmenuDisplay = "," (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot),"," submenuShowDelay = menuNav.get(\"submenuShowDelay\"), "," oSubmenu;"," ",""," var showSubmenu = function (delay) {",""," menuNav._cancelHideSubmenuTimer();"," menuNav._cancelShowSubmenuTimer();",""," if (!hasVisibleSubmenu(menuLabel)) {",""," oSubmenu = menuLabel.next();",""," if (oSubmenu) {"," menuNav._hideAllSubmenus(oActiveMenu);"," menuNav._showSubmenuTimer = later(delay, menuNav, menuNav._showMenu, oSubmenu);"," }",""," }"," "," };","",""," menuNav._focusItem(menuLabel);"," menuNav._setActiveItem(menuLabel);","",""," if (bUseAutoSubmenuDisplay) {"," "," if (menuNav._movingToSubmenu) {"," "," // If the user is moving diagonally from a submenu to "," // another submenu and they then stop and pause on a"," // menu label for an amount of time equal to the amount of "," // time defined for the display of a submenu then show the "," // submenu immediately."," // http://yuilibrary.com/projects/yui3/ticket/2528316"," "," //Y.message(\"Pause path\");"," "," menuNav._hoverTimer = later(submenuShowDelay, menuNav, function () {"," showSubmenu(0);"," });"," "," }"," else {"," showSubmenu(submenuShowDelay);"," }"," "," }",""," },","",""," /**"," * @method _onMenuLabelMouseOut"," * @description \"mouseout\" event handler for a menu label."," * @protected"," * @param {Node} menuLabel Node instance representing a menu label."," * @param {Object} event Object representing the DOM event."," */"," _onMenuLabelMouseOut: function (menuLabel, event) {",""," var menuNav = this,"," bIsRoot = menuNav._isRoot(menuNav._activeMenu),"," bUseAutoSubmenuDisplay = "," (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot),",""," oRelatedTarget = event.relatedTarget,"," oSubmenu = menuLabel.next(),"," hoverTimer = menuNav._hoverTimer;",""," if (hoverTimer) {"," hoverTimer.cancel();"," }",""," menuNav._clearActiveItem();",""," if (bUseAutoSubmenuDisplay) {",""," if (menuNav._movingToSubmenu && "," !menuNav._showSubmenuTimer && oSubmenu) {",""," // If the mouse is moving diagonally toward the submenu and "," // another submenu isn't in the process of being displayed "," // (via a timer), then hide the submenu via a timer to give"," // the user some time to reach the submenu."," "," menuNav._hideSubmenuTimer = "," later(menuNav.get(\"submenuHideDelay\"), menuNav, "," menuNav._hideMenu, oSubmenu);"," "," }"," else if (!menuNav._movingToSubmenu && oSubmenu && (!oRelatedTarget || "," (oRelatedTarget && "," !oSubmenu.contains(oRelatedTarget) && "," !oRelatedTarget.compareTo(oSubmenu)))) {",""," // If the mouse is not moving toward the submenu, cancel any "," // submenus that might be in the process of being displayed "," // (via a timer) and hide this submenu immediately.",""," menuNav._cancelShowSubmenuTimer();",""," menuNav._hideMenu(oSubmenu);",""," }",""," }",""," },"," ",""," /**"," * @method _onMenuItemMouseOver"," * @description \"mouseover\" event handler for a menuitem."," * @protected"," * @param {Node} menuItem Node instance representing a menuitem."," * @param {Object} event Object representing the DOM event."," */"," _onMenuItemMouseOver: function (menuItem, event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," bIsRoot = menuNav._isRoot(oActiveMenu),"," bUseAutoSubmenuDisplay = "," (menuNav.get(AUTO_SUBMENU_DISPLAY) && bIsRoot || !bIsRoot);","",""," menuNav._focusItem(menuItem);"," menuNav._setActiveItem(menuItem);","",""," if (bUseAutoSubmenuDisplay && !menuNav._movingToSubmenu) {",""," menuNav._hideAllSubmenus(oActiveMenu);",""," }",""," },"," ",""," /**"," * @method _onMenuItemMouseOut"," * @description \"mouseout\" event handler for a menuitem."," * @protected"," * @param {Node} menuItem Node instance representing a menuitem."," * @param {Object} event Object representing the DOM event."," */"," _onMenuItemMouseOut: function (menuItem, event) {",""," this._clearActiveItem();",""," },","",""," /**"," * @method _onVerticalMenuKeyDown"," * @description \"keydown\" event handler for vertical menus."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onVerticalMenuKeyDown: function (event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oRootMenu = menuNav._rootMenu,"," oTarget = event.target,"," bPreventDefault = false,"," nKeyCode = event.keyCode,"," oSubmenu,"," oParentMenu,"," oLI,"," oItem;","",""," switch (nKeyCode) {",""," case 37: // left arrow",""," oParentMenu = getParentMenu(oActiveMenu);",""," if (oParentMenu && isHorizontalMenu(oParentMenu)) {"," "," menuNav._hideMenu(oActiveMenu);"," oLI = getPreviousSibling(oActiveMenu.get(PARENT_NODE));"," oItem = getItem(oLI);"," "," if (oItem) {",""," if (isMenuLabel(oItem)) { // Menu label"," "," oSubmenu = oItem.next();"," ",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }"," else {"," "," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem);"," "," }"," "," }"," else { // MenuItem",""," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem);",""," }"," "," }",""," }"," else if (!menuNav._isRoot(oActiveMenu)) {"," menuNav._hideMenu(oActiveMenu, true);"," }","",""," bPreventDefault = true;",""," break;",""," case 39: // right arrow",""," if (isMenuLabel(oTarget)) {"," "," oSubmenu = oTarget.next();",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }"," "," }"," else if (isHorizontalMenu(oRootMenu)) {",""," oSubmenu = menuNav._getTopmostSubmenu(oActiveMenu);"," oLI = getNextSibling(oSubmenu.get(PARENT_NODE));"," oItem = getItem(oLI);",""," menuNav._hideAllSubmenus(oRootMenu);",""," if (oItem) {",""," if (isMenuLabel(oItem)) { // Menu label",""," oSubmenu = oItem.next();",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }"," else {",""," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem); ",""," }"," "," }"," else { // MenuItem",""," menuNav._focusItem(oItem);"," menuNav._setActiveItem(oItem);",""," } ",""," }"," "," }",""," bPreventDefault = true;",""," break;",""," } ","",""," if (bPreventDefault) {",""," // Prevent the browser from scrolling the window",""," event.preventDefault(); ",""," }"," "," },"," ",""," /**"," * @method _onHorizontalMenuKeyDown"," * @description \"keydown\" event handler for horizontal menus."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onHorizontalMenuKeyDown: function (event) {",""," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," oTarget = event.target,"," oFocusedItem = getItem(oTarget, true),"," bPreventDefault = false,"," nKeyCode = event.keyCode,"," oSubmenu;","",""," if (nKeyCode === 40) {",""," menuNav._hideAllSubmenus(oActiveMenu);",""," if (isMenuLabel(oFocusedItem)) {"," "," oSubmenu = oFocusedItem.next();",""," if (oSubmenu) {",""," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));",""," }",""," bPreventDefault = true;"," "," }",""," } ","",""," if (bPreventDefault) {",""," // Prevent the browser from scrolling the window",""," event.preventDefault(); ",""," }"," "," },","",""," // Generic DOM Event handlers","",""," /**"," * @method _onMouseMove"," * @description \"mousemove\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onMouseMove: function (event) {",""," var menuNav = this;",""," // Using a timer to set the value of the \"_currentMouseX\" property "," // helps improve the reliability of the calculation used to set the "," // value of the \"_movingToSubmenu\" property - especially in Opera.",""," later(10, menuNav, function () {",""," menuNav._currentMouseX = event.pageX;"," "," });"," "," },","",""," /**"," * @method _onMouseOver"," * @description \"mouseover\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onMouseOver: function (event) {",""," var menuNav = this,"," oTarget,"," oMenu,"," oMenuLabel,"," oParentMenu,"," oMenuItem;","",""," if (menuNav._blockMouseEvent) {"," menuNav._blockMouseEvent = false;"," }"," else {",""," oTarget = event.target;"," oMenu = getMenu(oTarget, true);"," oMenuLabel = getMenuLabel(oTarget, true);"," oMenuItem = getMenuItem(oTarget, true);","",""," if (handleMouseOverForNode(oMenu, oTarget)) {",""," menuNav._onMenuMouseOver(oMenu, event);",""," oMenu[HANDLED_MOUSEOVER] = true;"," oMenu[HANDLED_MOUSEOUT] = false;",""," oParentMenu = getParentMenu(oMenu);",""," if (oParentMenu) {",""," oParentMenu[HANDLED_MOUSEOUT] = true;"," oParentMenu[HANDLED_MOUSEOVER] = false;"," "," }"," "," }",""," if (handleMouseOverForNode(oMenuLabel, oTarget)) {",""," menuNav._onMenuLabelMouseOver(oMenuLabel, event);",""," oMenuLabel[HANDLED_MOUSEOVER] = true;"," oMenuLabel[HANDLED_MOUSEOUT] = false;"," "," }",""," if (handleMouseOverForNode(oMenuItem, oTarget)) {"," "," menuNav._onMenuItemMouseOver(oMenuItem, event);",""," oMenuItem[HANDLED_MOUSEOVER] = true;"," oMenuItem[HANDLED_MOUSEOUT] = false;"," "," }",""," }",""," },","",""," /**"," * @method _onMouseOut"," * @description \"mouseout\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onMouseOut: function (event) {"," "," var menuNav = this,"," oActiveMenu = menuNav._activeMenu,"," bMovingToSubmenu = false,"," oTarget,"," oRelatedTarget,"," oMenu,"," oMenuLabel,"," oSubmenu,"," oMenuItem;","",""," menuNav._movingToSubmenu = "," (oActiveMenu && !isHorizontalMenu(oActiveMenu) && "," ((event.pageX - 5) > menuNav._currentMouseX));"," "," oTarget = event.target;"," oRelatedTarget = event.relatedTarget;"," oMenu = getMenu(oTarget, true);"," oMenuLabel = getMenuLabel(oTarget, true);"," oMenuItem = getMenuItem(oTarget, true);","",""," if (handleMouseOutForNode(oMenuLabel, oRelatedTarget)) {",""," menuNav._onMenuLabelMouseOut(oMenuLabel, event);",""," oMenuLabel[HANDLED_MOUSEOUT] = true;"," oMenuLabel[HANDLED_MOUSEOVER] = false;",""," }",""," if (handleMouseOutForNode(oMenuItem, oRelatedTarget)) {",""," menuNav._onMenuItemMouseOut(oMenuItem, event);",""," oMenuItem[HANDLED_MOUSEOUT] = true;"," oMenuItem[HANDLED_MOUSEOVER] = false;"," "," }","",""," if (oMenuLabel) {",""," oSubmenu = oMenuLabel.next();",""," if (oSubmenu && oRelatedTarget && "," (oRelatedTarget.compareTo(oSubmenu) || "," oSubmenu.contains(oRelatedTarget))) {",""," bMovingToSubmenu = true;",""," }"," "," }"," ",""," if (handleMouseOutForNode(oMenu, oRelatedTarget) || bMovingToSubmenu) {",""," menuNav._onMenuMouseOut(oMenu, event); ",""," oMenu[HANDLED_MOUSEOUT] = true;"," oMenu[HANDLED_MOUSEOVER] = false;"," "," }"," "," },","",""," /**"," * @method _toggleSubmenuDisplay"," * @description \"mousedown,\" \"keydown,\" and \"click\" event handler for the "," * menu used to toggle the display of a submenu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _toggleSubmenuDisplay: function (event) {",""," var menuNav = this,"," oTarget = event.target,"," oMenuLabel = getMenuLabel(oTarget, true),"," sType = event.type,"," oAnchor,"," oSubmenu,"," sHref,"," nHashPos,"," nLen,"," sId;","",""," if (oMenuLabel) {",""," oAnchor = isAnchor(oTarget) ? oTarget : oTarget.ancestor(isAnchor);"," ",""," if (oAnchor) {",""," // Need to pass \"2\" as a second argument to \"getAttribute\" for "," // IE otherwise IE will return a fully qualified URL for the "," // value of the \"href\" attribute."," // http://msdn.microsoft.com/en-us/library/ms536429(VS.85).aspx",""," sHref = oAnchor.getAttribute(\"href\", 2);"," nHashPos = sHref.indexOf(\"#\");"," nLen = sHref.length;",""," if (nHashPos === 0 && nLen > 1) {",""," sId = sHref.substr(1, nLen);"," oSubmenu = oMenuLabel.next();",""," if (oSubmenu && (oSubmenu.get(ID) === sId)) {",""," if (sType === MOUSEDOWN || sType === KEYDOWN) {"," "," if ((UA.opera || UA.gecko || UA.ie) && sType === KEYDOWN && !menuNav._preventClickHandle) {",""," // Prevent the browser from following the URL of "," // the anchor element",""," menuNav._preventClickHandle = menuNav._rootMenu.on(\"click\", function (event) {",""," event.preventDefault();",""," menuNav._preventClickHandle.detach();"," menuNav._preventClickHandle = null;",""," });",""," }"," "," if (sType == MOUSEDOWN) {",""," // Prevent the target from getting focused by "," // default, since the element to be focused will"," // be determined by weather or not the submenu"," // is visible."," event.preventDefault();",""," // FocusManager will attempt to focus any "," // descendant that is the target of the mousedown"," // event. Since we want to explicitly control "," // where focus is going, we need to call "," // \"stopImmediatePropagation\" to stop the "," // FocusManager from doing its thing."," event.stopImmediatePropagation(); ",""," // The \"_focusItem\" method relies on the "," // \"_hasFocus\" property being set to true. The"," // \"_hasFocus\" property is normally set via a "," // \"focus\" event listener, but since we've "," // blocked focus from happening, we need to set "," // this property manually."," menuNav._hasFocus = true;",""," }",""," "," if (menuNav._isRoot(getParentMenu(oTarget))) { // Event target is a submenu label in the root menu"," "," // Menu label toggle functionality"," "," if (hasVisibleSubmenu(oMenuLabel)) {"," "," menuNav._hideMenu(oSubmenu);"," menuNav._focusItem(oMenuLabel); "," menuNav._setActiveItem(oMenuLabel);"," "," }"," else {"," "," menuNav._hideAllSubmenus(menuNav._rootMenu);"," menuNav._showMenu(oSubmenu);",""," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu));"," "," }"," "," }"," else { // Event target is a submenu label within a submenu"," "," if (menuNav._activeItem == oMenuLabel) {"," "," menuNav._showMenu(oSubmenu);"," menuNav._focusItem(getFirstItem(oSubmenu));"," menuNav._setActiveItem(getFirstItem(oSubmenu)); "," "," }"," else {"," "," if (!oMenuLabel._clickHandle) {",""," oMenuLabel._clickHandle = oMenuLabel.on(\"click\", function () {",""," menuNav._hideAllSubmenus(menuNav._rootMenu);",""," menuNav._hasFocus = false;"," menuNav._clearActiveItem();","",""," oMenuLabel._clickHandle.detach();"," "," oMenuLabel._clickHandle = null;",""," });"," "," }"," "," }"," "," }",""," }","",""," if (sType === CLICK) {"," "," // Prevent the browser from following the URL of "," // the anchor element"," "," event.preventDefault();"," "," }"," "," }"," "," } ","",""," }"," "," }"," "," },"," ",""," /**"," * @method _onKeyPress"," * @description \"keypress\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onKeyPress: function (event) {"," "," switch (event.keyCode) {",""," case 37: // left arrow"," case 38: // up arrow"," case 39: // right arrow"," case 40: // down arrow",""," // Prevent the browser from scrolling the window",""," event.preventDefault();",""," break;",""," } ",""," }, ","",""," /**"," * @method _onKeyDown"," * @description \"keydown\" event handler for the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onKeyDown: function (event) {",""," var menuNav = this,"," oActiveItem = menuNav._activeItem,"," oTarget = event.target,"," oActiveMenu = getParentMenu(oTarget),"," oSubmenu;",""," if (oActiveMenu) {",""," menuNav._activeMenu = oActiveMenu;",""," if (isHorizontalMenu(oActiveMenu)) {"," menuNav._onHorizontalMenuKeyDown(event);"," }"," else {"," menuNav._onVerticalMenuKeyDown(event);"," }","",""," if (event.keyCode === 27) {",""," if (!menuNav._isRoot(oActiveMenu)) {",""," if (UA.opera) {"," later(0, menuNav, function () {"," menuNav._hideMenu(oActiveMenu, true);"," }); "," }"," else {"," menuNav._hideMenu(oActiveMenu, true); "," }",""," event.stopPropagation();"," menuNav._blockMouseEvent = UA.gecko ? true : false;",""," }"," else if (oActiveItem) {",""," if (isMenuLabel(oActiveItem) && "," hasVisibleSubmenu(oActiveItem)) {"," "," oSubmenu = oActiveItem.next();",""," if (oSubmenu) {"," menuNav._hideMenu(oSubmenu);"," }",""," }"," else {",""," menuNav._focusManager.blur();",""," // This is necessary for Webkit since blurring the "," // active menuitem won't result in the document "," // gaining focus, meaning the that _onDocFocus "," // listener won't clear the active menuitem.",""," menuNav._clearActiveItem(); "," "," menuNav._hasFocus = false;",""," }",""," }"," "," }"," "," }"," "," },"," "," /**"," * @method _onDocMouseDown"," * @description \"mousedown\" event handler for the owner document of "," * the menu."," * @protected"," * @param {Object} event Object representing the DOM event."," */"," _onDocMouseDown: function (event) {",""," var menuNav = this,"," oRoot = menuNav._rootMenu,"," oTarget = event.target;","",""," if (!(oRoot.compareTo(oTarget) || oRoot.contains(oTarget))) {",""," menuNav._hideAllSubmenus(oRoot);",""," // Document doesn't receive focus in Webkit when the user mouses "," // down on it, so the \"_hasFocus\" property won't get set to the "," // correct value. The following line corrects the problem.",""," if (UA.webkit) {"," menuNav._hasFocus = false;"," menuNav._clearActiveItem();"," }",""," }",""," }"," ","});","","","Y.namespace('Plugin');","","Y.Plugin.NodeMenuNav = NodeMenuNav;","","","}, '3.7.3', {\"requires\": [\"node\", \"classnamemanager\", \"plugin\", \"node-focusmanager\"], \"skinnable\": true});"]; _yuitest_coverage["build/node-menunav/node-menunav.js"].lines = {"1":0,"87":0,"158":0,"160":0,"163":0,"164":0,"165":0,"168":0,"173":0,"175":0,"177":0,"178":0,"181":0,"186":0,"188":0,"190":0,"191":0,"194":0,"199":0,"201":0,"206":0,"208":0,"213":0,"215":0,"220":0,"222":0,"227":0,"229":0,"234":0,"236":0,"238":0,"240":0,"241":0,"244":0,"245":0,"250":0,"255":0,"257":0,"262":0,"264":0,"269":0,"271":0,"273":0,"274":0,"277":0,"282":0,"284":0,"286":0,"288":0,"289":0,"292":0,"298":0,"303":0,"305":0,"307":0,"308":0,"312":0,"317":0,"319":0,"324":0,"326":0,"331":0,"333":0,"339":0,"341":0,"353":0,"355":0,"359":0,"360":0,"371":0,"400":0,"406":0,"425":0,"431":0,"433":0,"435":0,"437":0,"439":0,"441":0,"442":0,"444":0,"445":0,"446":0,"449":0,"450":0,"452":0,"454":0,"456":0,"458":0,"459":0,"461":0,"462":0,"465":0,"467":0,"468":0,"471":0,"472":0,"560":0,"693":0,"699":0,"701":0,"703":0,"707":0,"712":0,"713":0,"714":0,"715":0,"716":0,"717":0,"718":0,"719":0,"721":0,"723":0,"724":0,"726":0,"728":0,"737":0,"739":0,"741":0,"742":0,"745":0,"749":0,"768":0,"782":0,"787":0,"788":0,"790":0,"791":0,"794":0,"797":0,"809":0,"812":0,"813":0,"816":0,"830":0,"832":0,"834":0,"836":0,"838":0,"853":0,"857":0,"859":0,"860":0,"862":0,"863":0,"864":0,"867":0,"882":0,"887":0,"888":0,"892":0,"893":0,"896":0,"899":0,"901":0,"903":0,"905":0,"906":0,"912":0,"922":0,"928":0,"929":0,"945":0,"949":0,"952":0,"953":0,"954":0,"957":0,"959":0,"960":0,"967":0,"969":0,"971":0,"972":0,"986":0,"988":0,"990":0,"1004":0,"1007":0,"1008":0,"1009":0,"1022":0,"1026":0,"1027":0,"1028":0,"1042":0,"1052":0,"1054":0,"1057":0,"1062":0,"1063":0,"1068":0,"1070":0,"1076":0,"1078":0,"1081":0,"1083":0,"1086":0,"1089":0,"1094":0,"1095":0,"1096":0,"1116":0,"1119":0,"1136":0,"1138":0,"1139":0,"1140":0,"1154":0,"1160":0,"1162":0,"1164":0,"1172":0,"1174":0,"1175":0,"1176":0,"1177":0,"1187":0,"1189":0,"1191":0,"1192":0,"1200":0,"1202":0,"1203":0,"1205":0,"1206":0,"1208":0,"1210":0,"1226":0,"1229":0,"1230":0,"1231":0,"1234":0,"1240":0,"1241":0,"1243":0,"1244":0,"1249":0,"1250":0,"1264":0,"1268":0,"1270":0,"1273":0,"1274":0,"1290":0,"1298":0,"1300":0,"1303":0,"1305":0,"1307":0,"1309":0,"1319":0,"1321":0,"1323":0,"1324":0,"1345":0,"1354":0,"1356":0,"1357":0,"1359":0,"1361":0,"1363":0,"1364":0,"1365":0,"1373":0,"1374":0,"1377":0,"1379":0,"1390":0,"1391":0,"1396":0,"1413":0,"1422":0,"1423":0,"1426":0,"1428":0,"1430":0,"1438":0,"1443":0,"1452":0,"1454":0,"1472":0,"1479":0,"1480":0,"1483":0,"1485":0,"1501":0,"1514":0,"1526":0,"1530":0,"1532":0,"1534":0,"1535":0,"1536":0,"1538":0,"1540":0,"1542":0,"1545":0,"1547":0,"1548":0,"1549":0,"1554":0,"1555":0,"1562":0,"1563":0,"1570":0,"1571":0,"1575":0,"1577":0,"1581":0,"1583":0,"1585":0,"1587":0,"1588":0,"1589":0,"1594":0,"1596":0,"1597":0,"1598":0,"1600":0,"1602":0,"1604":0,"1606":0,"1608":0,"1610":0,"1611":0,"1612":0,"1617":0,"1618":0,"1625":0,"1626":0,"1634":0,"1636":0,"1641":0,"1645":0,"1660":0,"1669":0,"1671":0,"1673":0,"1675":0,"1677":0,"1679":0,"1680":0,"1681":0,"1685":0,"1692":0,"1696":0,"1714":0,"1720":0,"1722":0,"1737":0,"1745":0,"1746":0,"1750":0,"1751":0,"1752":0,"1753":0,"1756":0,"1758":0,"1760":0,"1761":0,"1763":0,"1765":0,"1767":0,"1768":0,"1774":0,"1776":0,"1778":0,"1779":0,"1783":0,"1785":0,"1787":0,"1788":0,"1805":0,"1816":0,"1820":0,"1821":0,"1822":0,"1823":0,"1824":0,"1827":0,"1829":0,"1831":0,"1832":0,"1836":0,"1838":0,"1840":0,"1841":0,"1846":0,"1848":0,"1850":0,"1854":0,"1861":0,"1863":0,"1865":0,"1866":0,"1882":0,"1894":0,"1896":0,"1899":0,"1906":0,"1907":0,"1908":0,"1910":0,"1912":0,"1913":0,"1915":0,"1917":0,"1919":0,"1924":0,"1926":0,"1928":0,"1929":0,"1935":0,"1941":0,"1949":0,"1957":0,"1962":0,"1966":0,"1968":0,"1969":0,"1970":0,"1975":0,"1976":0,"1978":0,"1979":0,"1986":0,"1988":0,"1989":0,"1990":0,"1995":0,"1997":0,"1999":0,"2001":0,"2002":0,"2005":0,"2007":0,"2020":0,"2025":0,"2049":0,"2058":0,"2060":0,"2075":0,"2081":0,"2083":0,"2085":0,"2086":0,"2089":0,"2093":0,"2095":0,"2097":0,"2098":0,"2099":0,"2103":0,"2106":0,"2107":0,"2110":0,"2112":0,"2115":0,"2117":0,"2118":0,"2124":0,"2131":0,"2133":0,"2154":0,"2159":0,"2161":0,"2167":0,"2168":0,"2169":0,"2179":0,"2181":0}; _yuitest_coverage["build/node-menunav/node-menunav.js"].functions = {"getPreviousSibling:158":0,"getNextSibling:173":0,"isAnchor:186":0,"isMenuItem:199":0,"isMenuLabel:206":0,"isHorizontalMenu:213":0,"hasVisibleSubmenu:220":0,"getItemAnchor:227":0,"getNodeWithClass:234":0,"getParentMenu:255":0,"getMenu:262":0,"getMenuItem:269":0,"getMenuLabel:282":0,"getItem:303":0,"getFirstItem:317":0,"getActiveClass:324":0,"handleMouseOverForNode:331":0,"handleMouseOutForNode:339":0,"NodeMenuNav:353":0,"(anonymous 2):439":0,"setter:423":0,"initializer:691":0,"(anonymous 3):741":0,"destructor:735":0,"_isRoot:766":0,"_getTopmostSubmenu:780":0,"_clearActiveItem:807":0,"_setActiveItem:828":0,"_focusItem:851":0,"_showMenu:880":0,"_hideMenu:943":0,"(anonymous 4):988":0,"_hideAllSubmenus:984":0,"_cancelShowSubmenuTimer:1002":0,"_cancelHideSubmenuTimer:1020":0,"_initFocusManager:1040":0,"_onActiveDescendantChange:1114":0,"_afterActiveDescendantChange:1134":0,"_onDocFocus:1152":0,"_onMenuMouseOver:1224":0,"_hideAndFocusLabel:1262":0,"_onMenuMouseOut:1288":0,"showSubmenu:1354":0,"(anonymous 5):1390":0,"_onMenuLabelMouseOver:1343":0,"_onMenuLabelMouseOut:1411":0,"_onMenuItemMouseOver:1470":0,"_onMenuItemMouseOut:1499":0,"_onVerticalMenuKeyDown:1512":0,"_onHorizontalMenuKeyDown:1658":0,"(anonymous 6):1720":0,"_onMouseMove:1712":0,"_onMouseOver:1735":0,"_onMouseOut:1803":0,"(anonymous 7):1924":0,"(anonymous 8):1997":0,"_toggleSubmenuDisplay:1880":0,"_onKeyPress:2047":0,"(anonymous 9):2098":0,"_onKeyDown:2073":0,"_onDocMouseDown:2152":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-menunav/node-menunav.js"].coveredLines = 472;@@ -2754,4 +2754,4 @@ Y.Plugin.NodeMenuNav = NodeMenuNav; -}, '3.7.2', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});+}, '3.7.3', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -2187,4 +2187,4 @@ Y.Plugin.NodeMenuNav = NodeMenuNav; -}, '3.7.2', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});+}, '3.7.3', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-menunav",function(e,t){var n=e.UA,r=e.later,i=e.ClassNameManager.getClassName,s="menu",o="menuitem",u="hidden",a="parentNode",f="children",l="offsetHeight",c="offsetWidth",h="px",p="id",d=".",v="handledMouseOut",m="handledMouseOver",g="active",y="label",b="a",w="mousedown",E="keydown",S="click",x="",T="first-of-type",N="role",C="presentation",k="descendants",L="UI",A="activeDescendant",O="useARIA",M="aria-hidden",_="content",D="host",P=A+"Change",H="autoSubmenuDisplay",B="mouseOutHideDelay",j=i(s),F=i(s,u),I=i(s,"horizontal"),q=i(s,y),R=i(s,y,g),U=i(s,y,s+"visible"),z=i(o),W=i(o,g),X=d+j,V=d+i(s,"toggle"),$=d+i(s,_),J=d+q,K=">"+$+">ul>li>a",Q=">"+$+">ul>li>"+J+">a:first-child",G=function(e){var t=e.previous(),n;return t||(n=e.get(a).get(f),t=n.item(n.size()-1)),t},Y=function(e){var t=e.next();return t||(t=e.get(a).get(f).item(0)),t},Z=function(e){var t=!1;return e&&(t=e.get("nodeName").toLowerCase()===b),t},et=function(e){return e.hasClass(z)},tt=function(e){return e.hasClass(q)},nt=function(e){return e.hasClass(I)},rt=function(e){return e.hasClass(U)},it=function(e){return Z(e)?e:e.one(b)},st=function(e,t,n){var r;return e&&(e.hasClass(t)&&(r=e),!r&&n&&(r=e.ancestor(d+t))),r},ot=function(e){return e.ancestor(X)},ut=function(e,t){return st(e,j,t)},at=function(e,t){var n;return e&&(n=st(e,z,t)),n},ft=function(e,t){var n;return e&&(t?n=st(e,q,t):n=st(e,q)||e.one(d+q)),n},lt=function(e,t){var n;return e&&(n=at(e,t)||ft(e,t)),n},ct=function(e){return lt(e.one("li"))},ht=function(e){return et(e)?W:R},pt=function(e,t){return e&&!e[m]&&(e.compareTo(t)||e.contains(t))},dt=function(e,t){return e&&!e[v]&&!e.compareTo(t)&&!e.contains(t)},vt=function(){vt.superclass.constructor.apply(this,arguments)};vt.NAME="nodeMenuNav",vt.NS="menuNav",vt.SHIM_TEMPLATE_TITLE="Menu Stacking Shim",vt.SHIM_TEMPLATE='<iframe frameborder="0" tabindex="-1" class="'+i("shim")+'" title="'+vt.SHIM_TEMPLATE_TITLE+'" src="javascript:false;"></iframe>',vt.ATTRS={useARIA:{value:!0,writeOnce:!0,lazyAdd:!1,setter:function(t){var n=this.get(D),r,u,a,f;t&&(n.set(N,s),n.all("ul,li,"+$).set(N,C),n.all(d+i(o,_)).set(N,o),n.all(d+q).each(function(t){r=t,u=t.one(V),u&&(u.set(N,C),r=u.previous()),r.set(N,o),r.set("aria-haspopup",!0),a=t.next(),a&&(a.set(N,s),r=a.previous(),u=r.one(V),u&&(r=u),f=e.stamp(r),r.get(p)||r.set(p,f),a.set("aria-labelledby",f),a.set(M,!0))}))}},autoSubmenuDisplay:{value:!0,writeOnce:!0},submenuShowDelay:{value:250,writeOnce:!0},submenuHideDelay:{value:250,writeOnce:!0},mouseOutHideDelay:{value:750,writeOnce:!0}},e.extend(vt,e.Plugin.Base,{_rootMenu:null,_activeItem:null,_activeMenu:null,_hasFocus:!1,_blockMouseEvent:!1,_currentMouseX:0,_movingToSubmenu:!1,_showSubmenuTimer:null,_hideSubmenuTimer:null,_hideAllSubmenusTimer:null,_firstItem:null,initializer:function(t){var n=this,r=this.get(D),i=[],s;r&&(n._rootMenu=r,r.all("ul:first-child").addClass(T),r.all(X).addClass(F),i.push(r.on("mouseover",n._onMouseOver,n)),i.push(r.on("mouseout",n._onMouseOut,n)),i.push(r.on("mousemove",n._onMouseMove,n)),i.push(r.on(w,n._toggleSubmenuDisplay,n)),i.push(e.on("key",n._toggleSubmenuDisplay,r,"down:13",n)),i.push(r.on(S,n._toggleSubmenuDisplay,n)),i.push(r.on("keypress",n._onKeyPress,n)),i.push(r.on(E,n._onKeyDown,n)),s=r.get("ownerDocument"),i.push(s.on(w,n._onDocMouseDown,n)),i.push(s.on("focus",n._onDocFocus,n)),this._eventHandlers=i,n._initFocusManager())},destructor:function(){var t=this._eventHandlers;t&&(e.Array.each(t,function(e){e.detach()}),this._eventHandlers=null),this.get(D).unplug("focusManager")},_isRoot:function(e){return this._rootMenu.compareTo(e)},_getTopmostSubmenu:function(e){var t=this,n=ot(e),r;return n?t._isRoot(n)?r=e:r=t._getTopmostSubmenu(n):r=e,r},_clearActiveItem:function(){var e=this,t=e._activeItem;t&&t.removeClass(ht(t)),e._activeItem=null},_setActiveItem:function(e){var t=this;e&&(t._clearActiveItem(),e.addClass(ht(e)),t._activeItem=e)},_focusItem:function(e){var t=this,n,r;e&&t._hasFocus&&(n=ot(e),r=it(e),n&&!n.compareTo(t._activeMenu)&&(t._activeMenu=n,t._initFocusManager()),t._focusManager.focus(r))},_showMenu:function(t){var r=ot(t),i=t.get(a),s=i.getXY();this.get(O)&&t.set(M,!1),nt(r)?s[1]=s[1]+i.get(l):s[0]=s[0]+i.get(c),t.setXY(s),n.ie<8&&(n.ie===6&&!t.hasIFrameShim&&(t.appendChild(e.Node.create(vt.SHIM_TEMPLATE)),t.hasIFrameShim=!0),t.setStyles({height:x,width:x}),t.setStyles({height:t.get(l)+h,width:t.get(c)+h})),t.previous().addClass(U),t.removeClass(F)},_hideMenu:function(e,t){var n=this,r=e.previous(),i;r.removeClass(U),t&&(n._focusItem(r),n._setActiveItem(r)),i=e.one(d+W),i&&i.removeClass(W),e.setStyles({left:x,top:x}),e.addClass(F),n.get(O)&&e.set(M,!0)},_hideAllSubmenus:function(t){var n=this;t.all(X).each(e.bind(function(e){n._hideMenu(e)},n))},_cancelShowSubmenuTimer:function(){var e=this,t=e._showSubmenuTimer;t&&(t.cancel(),e._showSubmenuTimer=null)},_cancelHideSubmenuTimer:function(){var e=this,t=e._hideSubmenuTimer;t&&(t.cancel(),e._hideSubmenuTimer=null)},_initFocusManager:function(){var t=this,n=t._rootMenu,r=t._activeMenu||n,i=t._isRoot(r)?x:"#"+r.get("id"),s=t._focusManager,o,u,a;nt(r)?(u=i+K+","+i+Q,o={next:"down:39",previous:"down:37"}):(u=i+K,o={next:"down:40",previous:"down:38"}),s?(s.set(A,-1),s.set(k,u),s.set("keys",o)):(n.plug(e.Plugin.NodeFocusManager,{descendants:u,keys:o,circular:!0}),s=n.focusManager,a="#"+n.get("id")+X+" a,"+V,n.all(a).set("tabIndex",-1),s.on(P,this._onActiveDescendantChange,s,this),s.after(P,this._afterActiveDescendantChange,s,this),t._focusManager=s)},_onActiveDescendantChange:function(e,t){e.src===L&&t._activeMenu&&!t._movingToSubmenu&&t._hideAllSubmenus(t._activeMenu)},_afterActiveDescendantChange:function(e,t){var n;e.src===L&&(n=lt(this.get(k).item(e.newVal),!0),t._setActiveItem(n))},_onDocFocus:function(e){var t=this,n=t._activeItem,r=e.target,i;t._rootMenu.contains(r)?t._hasFocus?(i=ot(r),t._activeMenu.compareTo(i)||(t._activeMenu=i,t._initFocusManager(),t._focusManager.set(A,r),t._setActiveItem(lt(r,!0)))):(t._hasFocus=!0,n=lt(r,!0),n&&t._setActiveItem(n)):(t._clearActiveItem(),t._cancelShowSubmenuTimer(),t._hideAllSubmenus(t._rootMenu),t._activeMenu=t._rootMenu,t._initFocusManager(),t._focusManager.set(A,0),t._hasFocus=!1)},_onMenuMouseOver:function(e,t){var n=this,r=n._hideAllSubmenusTimer;r&&(r.cancel(),n._hideAllSubmenusTimer=null),n._cancelHideSubmenuTimer(),e&&!e.compareTo(n._activeMenu)&&(n._activeMenu=e,n._hasFocus&&n._initFocusManager()),n._movingToSubmenu&&nt(e)&&(n._movingToSubmenu=!1)},_hideAndFocusLabel:function(){var e=this,t=e._activeMenu,n;e._hideAllSubmenus(e._rootMenu),t&&(n=e._getTopmostSubmenu(t),e._focusItem(n.previous()))},_onMenuMouseOut:function(e,t){var n=this,i=n._activeMenu,s=t.relatedTarget,o=n._activeItem,u,a;i&&!i.contains(s)&&(u=ot(i),u&&!u.contains(s)?n.get(B)>0&&(n._cancelShowSubmenuTimer(),n._hideAllSubmenusTimer=r(n.get(B),n,n._hideAndFocusLabel)):o&&(a=ot(o),n._isRoot(a)||n._focusItem(a.previous())))},_onMenuLabelMouseOver:function(e,t){var n=this,i=n._activeMenu,s=n._isRoot(i),o=n.get(H)&&s||!s,u=n.get("submenuShowDelay"),a,f=function(t){n._cancelHideSubmenuTimer(),n._cancelShowSubmenuTimer(),rt(e)||(a=e.next(),a&&(n._hideAllSubmenus(i),n._showSubmenuTimer=r(t,n,n._showMenu,a)))};n._focusItem(e),n._setActiveItem(e),o&&(n._movingToSubmenu?n._hoverTimer=r(u,n,function(){f(0)}):f(u))},_onMenuLabelMouseOut:function(e,t){var n=this,i=n._isRoot(n._activeMenu),s=n.get(H)&&i||!i,o=t.relatedTarget,u=e.next(),a=n._hoverTimer;a&&a.cancel(),n._clearActiveItem(),s&&(n._movingToSubmenu&&!n._showSubmenuTimer&&u?n._hideSubmenuTimer=r(n.get("submenuHideDelay"),n,n._hideMenu,u):!n._movingToSubmenu&&u&&(!o||o&&!u.contains(o)&&!o.compareTo(u))&&(n._cancelShowSubmenuTimer(),n._hideMenu(u)))},_onMenuItemMouseOver:function(e,t){var n=this,r=n._activeMenu,i=n._isRoot(r),s=n.get(H)&&i||!i;n._focusItem(e),n._setActiveItem(e),s&&!n._movingToSubmenu&&n._hideAllSubmenus(r)},_onMenuItemMouseOut:function(e,t){this._clearActiveItem()},_onVerticalMenuKeyDown:function(e){var t=this,n=t._activeMenu,r=t._rootMenu,i=e.target,s=!1,o=e.keyCode,u,f,l,c;switch(o){case 37:f=ot(n),f&&nt(f)?(t._hideMenu(n),l=G(n.get(a)),c=lt(l),c&&(tt(c)?(u=c.next(),u?(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):(t._focusItem(c),t._setActiveItem(c))):(t._focusItem(c),t._setActiveItem(c)))):t._isRoot(n)||t._hideMenu(n,!0),s=!0;break;case 39:tt(i)?(u=i.next(),u&&(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u)))):nt(r)&&(u=t._getTopmostSubmenu(n),l=Y(u.get(a)),c=lt(l),t._hideAllSubmenus(r),c&&(tt(c)?(u=c.next(),u?(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):(t._focusItem(c),t._setActiveItem(c))):(t._focusItem(c),t._setActiveItem(c)))),s=!0}s&&e.preventDefault()},_onHorizontalMenuKeyDown:function(e){var t=this,n=t._activeMenu,r=e.target,i=lt(r,!0),s=!1,o=e.keyCode,u;o===40&&(t._hideAllSubmenus(n),tt(i)&&(u=i.next(),u&&(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))),s=!0)),s&&e.preventDefault()},_onMouseMove:function(e){var t=this;r(10,t,function(){t._currentMouseX=e.pageX})},_onMouseOver:function(e){var t=this,n,r,i,s,o;t._blockMouseEvent?t._blockMouseEvent=!1:(n=e.target,r=ut(n,!0),i=ft(n,!0),o=at(n,!0),pt(r,n)&&(t._onMenuMouseOver(r,e),r[m]=!0,r[v]=!1,s=ot(r),s&&(s[v]=!0,s[m]=!1)),pt(i,n)&&(t._onMenuLabelMouseOver(i,e),i[m]=!0,i[v]=!1),pt(o,n)&&(t._onMenuItemMouseOver(o,e),o[m]=!0,o[v]=!1))},_onMouseOut:function(e){var t=this,n=t._activeMenu,r=!1,i,s,o,u,a,f;t._movingToSubmenu=n&&!nt(n)&&e.pageX-5>t._currentMouseX,i=e.target,s=e.relatedTarget,o=ut(i,!0),u=ft(i,!0),f=at(i,!0),dt(u,s)&&(t._onMenuLabelMouseOut(u,e),u[v]=!0,u[m]=!1),dt(f,s)&&(t._onMenuItemMouseOut(f,e),f[v]=!0,f[m]=!1),u&&(a=u.next(),a&&s&&(s.compareTo(a)||a.contains(s))&&(r=!0));if(dt(o,s)||r)t._onMenuMouseOut(o,e),o[v]=!0,o[m]=!1},_toggleSubmenuDisplay:function(e){var t=this,r=e.target,i=ft(r,!0),s=e.type,o,u,a,f,l,c;if(i){o=Z(r)?r:r.ancestor(Z);if(o){a=o.getAttribute("href",2),f=a.indexOf("#"),l=a.length;if(f===0&&l>1){c=a.substr(1,l),u=i.next();if(u&&u.get(p)===c){if(s===w||s===E)(n.opera||n.gecko||n.ie)&&s===E&&!t._preventClickHandle&&(t._preventClickHandle=t._rootMenu.on("click",function(e){e.preventDefault(),t._preventClickHandle.detach(),t._preventClickHandle=null})),s==w&&(e.preventDefault(),e.stopImmediatePropagation(),t._hasFocus=!0),t._isRoot(ot(r))?rt(i)?(t._hideMenu(u),t._focusItem(i),t._setActiveItem(i)):(t._hideAllSubmenus(t._rootMenu),t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):t._activeItem==i?(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):i._clickHandle||(i._clickHandle=i.on("click",function(){t._hideAllSubmenus(t._rootMenu),t._hasFocus=!1,t._clearActiveItem(),i._clickHandle.detach(),i._clickHandle=null}));s===S&&e.preventDefault()}}}}},_onKeyPress:function(e){switch(e.keyCode){case 37:case 38:case 39:case 40:e.preventDefault()}},_onKeyDown:function(e){var t=this,i=t._activeItem,s=e.target,o=ot(s),u;o&&(t._activeMenu=o,nt(o)?t._onHorizontalMenuKeyDown(e):t._onVerticalMenuKeyDown(e),e.keyCode===27&&(t._isRoot(o)?i&&(tt(i)&&rt(i)?(u=i.next(),u&&t._hideMenu(u)):(t._focusManager.blur(),t._clearActiveItem(),t._hasFocus=!1)):(n.opera?r(0,t,function(){t._hideMenu(o,!0)}):t._hideMenu(o,!0),e.stopPropagation(),t._blockMouseEvent=n.gecko?!0:!1)))},_onDocMouseDown:function(e){var t=this,r=t._rootMenu,i=e.target;!r.compareTo(i)&&!r.contains(i)&&(t._hideAllSubmenus(r),n.webkit&&(t._hasFocus=!1,t._clearActiveItem()))}}),e.namespace("Plugin"),e.Plugin.NodeMenuNav=vt},"3.7.2",{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0});+YUI.add("node-menunav",function(e,t){var n=e.UA,r=e.later,i=e.ClassNameManager.getClassName,s="menu",o="menuitem",u="hidden",a="parentNode",f="children",l="offsetHeight",c="offsetWidth",h="px",p="id",d=".",v="handledMouseOut",m="handledMouseOver",g="active",y="label",b="a",w="mousedown",E="keydown",S="click",x="",T="first-of-type",N="role",C="presentation",k="descendants",L="UI",A="activeDescendant",O="useARIA",M="aria-hidden",_="content",D="host",P=A+"Change",H="autoSubmenuDisplay",B="mouseOutHideDelay",j=i(s),F=i(s,u),I=i(s,"horizontal"),q=i(s,y),R=i(s,y,g),U=i(s,y,s+"visible"),z=i(o),W=i(o,g),X=d+j,V=d+i(s,"toggle"),$=d+i(s,_),J=d+q,K=">"+$+">ul>li>a",Q=">"+$+">ul>li>"+J+">a:first-child",G=function(e){var t=e.previous(),n;return t||(n=e.get(a).get(f),t=n.item(n.size()-1)),t},Y=function(e){var t=e.next();return t||(t=e.get(a).get(f).item(0)),t},Z=function(e){var t=!1;return e&&(t=e.get("nodeName").toLowerCase()===b),t},et=function(e){return e.hasClass(z)},tt=function(e){return e.hasClass(q)},nt=function(e){return e.hasClass(I)},rt=function(e){return e.hasClass(U)},it=function(e){return Z(e)?e:e.one(b)},st=function(e,t,n){var r;return e&&(e.hasClass(t)&&(r=e),!r&&n&&(r=e.ancestor(d+t))),r},ot=function(e){return e.ancestor(X)},ut=function(e,t){return st(e,j,t)},at=function(e,t){var n;return e&&(n=st(e,z,t)),n},ft=function(e,t){var n;return e&&(t?n=st(e,q,t):n=st(e,q)||e.one(d+q)),n},lt=function(e,t){var n;return e&&(n=at(e,t)||ft(e,t)),n},ct=function(e){return lt(e.one("li"))},ht=function(e){return et(e)?W:R},pt=function(e,t){return e&&!e[m]&&(e.compareTo(t)||e.contains(t))},dt=function(e,t){return e&&!e[v]&&!e.compareTo(t)&&!e.contains(t)},vt=function(){vt.superclass.constructor.apply(this,arguments)};vt.NAME="nodeMenuNav",vt.NS="menuNav",vt.SHIM_TEMPLATE_TITLE="Menu Stacking Shim",vt.SHIM_TEMPLATE='<iframe frameborder="0" tabindex="-1" class="'+i("shim")+'" title="'+vt.SHIM_TEMPLATE_TITLE+'" src="javascript:false;"></iframe>',vt.ATTRS={useARIA:{value:!0,writeOnce:!0,lazyAdd:!1,setter:function(t){var n=this.get(D),r,u,a,f;t&&(n.set(N,s),n.all("ul,li,"+$).set(N,C),n.all(d+i(o,_)).set(N,o),n.all(d+q).each(function(t){r=t,u=t.one(V),u&&(u.set(N,C),r=u.previous()),r.set(N,o),r.set("aria-haspopup",!0),a=t.next(),a&&(a.set(N,s),r=a.previous(),u=r.one(V),u&&(r=u),f=e.stamp(r),r.get(p)||r.set(p,f),a.set("aria-labelledby",f),a.set(M,!0))}))}},autoSubmenuDisplay:{value:!0,writeOnce:!0},submenuShowDelay:{value:250,writeOnce:!0},submenuHideDelay:{value:250,writeOnce:!0},mouseOutHideDelay:{value:750,writeOnce:!0}},e.extend(vt,e.Plugin.Base,{_rootMenu:null,_activeItem:null,_activeMenu:null,_hasFocus:!1,_blockMouseEvent:!1,_currentMouseX:0,_movingToSubmenu:!1,_showSubmenuTimer:null,_hideSubmenuTimer:null,_hideAllSubmenusTimer:null,_firstItem:null,initializer:function(t){var n=this,r=this.get(D),i=[],s;r&&(n._rootMenu=r,r.all("ul:first-child").addClass(T),r.all(X).addClass(F),i.push(r.on("mouseover",n._onMouseOver,n)),i.push(r.on("mouseout",n._onMouseOut,n)),i.push(r.on("mousemove",n._onMouseMove,n)),i.push(r.on(w,n._toggleSubmenuDisplay,n)),i.push(e.on("key",n._toggleSubmenuDisplay,r,"down:13",n)),i.push(r.on(S,n._toggleSubmenuDisplay,n)),i.push(r.on("keypress",n._onKeyPress,n)),i.push(r.on(E,n._onKeyDown,n)),s=r.get("ownerDocument"),i.push(s.on(w,n._onDocMouseDown,n)),i.push(s.on("focus",n._onDocFocus,n)),this._eventHandlers=i,n._initFocusManager())},destructor:function(){var t=this._eventHandlers;t&&(e.Array.each(t,function(e){e.detach()}),this._eventHandlers=null),this.get(D).unplug("focusManager")},_isRoot:function(e){return this._rootMenu.compareTo(e)},_getTopmostSubmenu:function(e){var t=this,n=ot(e),r;return n?t._isRoot(n)?r=e:r=t._getTopmostSubmenu(n):r=e,r},_clearActiveItem:function(){var e=this,t=e._activeItem;t&&t.removeClass(ht(t)),e._activeItem=null},_setActiveItem:function(e){var t=this;e&&(t._clearActiveItem(),e.addClass(ht(e)),t._activeItem=e)},_focusItem:function(e){var t=this,n,r;e&&t._hasFocus&&(n=ot(e),r=it(e),n&&!n.compareTo(t._activeMenu)&&(t._activeMenu=n,t._initFocusManager()),t._focusManager.focus(r))},_showMenu:function(t){var r=ot(t),i=t.get(a),s=i.getXY();this.get(O)&&t.set(M,!1),nt(r)?s[1]=s[1]+i.get(l):s[0]=s[0]+i.get(c),t.setXY(s),n.ie<8&&(n.ie===6&&!t.hasIFrameShim&&(t.appendChild(e.Node.create(vt.SHIM_TEMPLATE)),t.hasIFrameShim=!0),t.setStyles({height:x,width:x}),t.setStyles({height:t.get(l)+h,width:t.get(c)+h})),t.previous().addClass(U),t.removeClass(F)},_hideMenu:function(e,t){var n=this,r=e.previous(),i;r.removeClass(U),t&&(n._focusItem(r),n._setActiveItem(r)),i=e.one(d+W),i&&i.removeClass(W),e.setStyles({left:x,top:x}),e.addClass(F),n.get(O)&&e.set(M,!0)},_hideAllSubmenus:function(t){var n=this;t.all(X).each(e.bind(function(e){n._hideMenu(e)},n))},_cancelShowSubmenuTimer:function(){var e=this,t=e._showSubmenuTimer;t&&(t.cancel(),e._showSubmenuTimer=null)},_cancelHideSubmenuTimer:function(){var e=this,t=e._hideSubmenuTimer;t&&(t.cancel(),e._hideSubmenuTimer=null)},_initFocusManager:function(){var t=this,n=t._rootMenu,r=t._activeMenu||n,i=t._isRoot(r)?x:"#"+r.get("id"),s=t._focusManager,o,u,a;nt(r)?(u=i+K+","+i+Q,o={next:"down:39",previous:"down:37"}):(u=i+K,o={next:"down:40",previous:"down:38"}),s?(s.set(A,-1),s.set(k,u),s.set("keys",o)):(n.plug(e.Plugin.NodeFocusManager,{descendants:u,keys:o,circular:!0}),s=n.focusManager,a="#"+n.get("id")+X+" a,"+V,n.all(a).set("tabIndex",-1),s.on(P,this._onActiveDescendantChange,s,this),s.after(P,this._afterActiveDescendantChange,s,this),t._focusManager=s)},_onActiveDescendantChange:function(e,t){e.src===L&&t._activeMenu&&!t._movingToSubmenu&&t._hideAllSubmenus(t._activeMenu)},_afterActiveDescendantChange:function(e,t){var n;e.src===L&&(n=lt(this.get(k).item(e.newVal),!0),t._setActiveItem(n))},_onDocFocus:function(e){var t=this,n=t._activeItem,r=e.target,i;t._rootMenu.contains(r)?t._hasFocus?(i=ot(r),t._activeMenu.compareTo(i)||(t._activeMenu=i,t._initFocusManager(),t._focusManager.set(A,r),t._setActiveItem(lt(r,!0)))):(t._hasFocus=!0,n=lt(r,!0),n&&t._setActiveItem(n)):(t._clearActiveItem(),t._cancelShowSubmenuTimer(),t._hideAllSubmenus(t._rootMenu),t._activeMenu=t._rootMenu,t._initFocusManager(),t._focusManager.set(A,0),t._hasFocus=!1)},_onMenuMouseOver:function(e,t){var n=this,r=n._hideAllSubmenusTimer;r&&(r.cancel(),n._hideAllSubmenusTimer=null),n._cancelHideSubmenuTimer(),e&&!e.compareTo(n._activeMenu)&&(n._activeMenu=e,n._hasFocus&&n._initFocusManager()),n._movingToSubmenu&&nt(e)&&(n._movingToSubmenu=!1)},_hideAndFocusLabel:function(){var e=this,t=e._activeMenu,n;e._hideAllSubmenus(e._rootMenu),t&&(n=e._getTopmostSubmenu(t),e._focusItem(n.previous()))},_onMenuMouseOut:function(e,t){var n=this,i=n._activeMenu,s=t.relatedTarget,o=n._activeItem,u,a;i&&!i.contains(s)&&(u=ot(i),u&&!u.contains(s)?n.get(B)>0&&(n._cancelShowSubmenuTimer(),n._hideAllSubmenusTimer=r(n.get(B),n,n._hideAndFocusLabel)):o&&(a=ot(o),n._isRoot(a)||n._focusItem(a.previous())))},_onMenuLabelMouseOver:function(e,t){var n=this,i=n._activeMenu,s=n._isRoot(i),o=n.get(H)&&s||!s,u=n.get("submenuShowDelay"),a,f=function(t){n._cancelHideSubmenuTimer(),n._cancelShowSubmenuTimer(),rt(e)||(a=e.next(),a&&(n._hideAllSubmenus(i),n._showSubmenuTimer=r(t,n,n._showMenu,a)))};n._focusItem(e),n._setActiveItem(e),o&&(n._movingToSubmenu?n._hoverTimer=r(u,n,function(){f(0)}):f(u))},_onMenuLabelMouseOut:function(e,t){var n=this,i=n._isRoot(n._activeMenu),s=n.get(H)&&i||!i,o=t.relatedTarget,u=e.next(),a=n._hoverTimer;a&&a.cancel(),n._clearActiveItem(),s&&(n._movingToSubmenu&&!n._showSubmenuTimer&&u?n._hideSubmenuTimer=r(n.get("submenuHideDelay"),n,n._hideMenu,u):!n._movingToSubmenu&&u&&(!o||o&&!u.contains(o)&&!o.compareTo(u))&&(n._cancelShowSubmenuTimer(),n._hideMenu(u)))},_onMenuItemMouseOver:function(e,t){var n=this,r=n._activeMenu,i=n._isRoot(r),s=n.get(H)&&i||!i;n._focusItem(e),n._setActiveItem(e),s&&!n._movingToSubmenu&&n._hideAllSubmenus(r)},_onMenuItemMouseOut:function(e,t){this._clearActiveItem()},_onVerticalMenuKeyDown:function(e){var t=this,n=t._activeMenu,r=t._rootMenu,i=e.target,s=!1,o=e.keyCode,u,f,l,c;switch(o){case 37:f=ot(n),f&&nt(f)?(t._hideMenu(n),l=G(n.get(a)),c=lt(l),c&&(tt(c)?(u=c.next(),u?(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):(t._focusItem(c),t._setActiveItem(c))):(t._focusItem(c),t._setActiveItem(c)))):t._isRoot(n)||t._hideMenu(n,!0),s=!0;break;case 39:tt(i)?(u=i.next(),u&&(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u)))):nt(r)&&(u=t._getTopmostSubmenu(n),l=Y(u.get(a)),c=lt(l),t._hideAllSubmenus(r),c&&(tt(c)?(u=c.next(),u?(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):(t._focusItem(c),t._setActiveItem(c))):(t._focusItem(c),t._setActiveItem(c)))),s=!0}s&&e.preventDefault()},_onHorizontalMenuKeyDown:function(e){var t=this,n=t._activeMenu,r=e.target,i=lt(r,!0),s=!1,o=e.keyCode,u;o===40&&(t._hideAllSubmenus(n),tt(i)&&(u=i.next(),u&&(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))),s=!0)),s&&e.preventDefault()},_onMouseMove:function(e){var t=this;r(10,t,function(){t._currentMouseX=e.pageX})},_onMouseOver:function(e){var t=this,n,r,i,s,o;t._blockMouseEvent?t._blockMouseEvent=!1:(n=e.target,r=ut(n,!0),i=ft(n,!0),o=at(n,!0),pt(r,n)&&(t._onMenuMouseOver(r,e),r[m]=!0,r[v]=!1,s=ot(r),s&&(s[v]=!0,s[m]=!1)),pt(i,n)&&(t._onMenuLabelMouseOver(i,e),i[m]=!0,i[v]=!1),pt(o,n)&&(t._onMenuItemMouseOver(o,e),o[m]=!0,o[v]=!1))},_onMouseOut:function(e){var t=this,n=t._activeMenu,r=!1,i,s,o,u,a,f;t._movingToSubmenu=n&&!nt(n)&&e.pageX-5>t._currentMouseX,i=e.target,s=e.relatedTarget,o=ut(i,!0),u=ft(i,!0),f=at(i,!0),dt(u,s)&&(t._onMenuLabelMouseOut(u,e),u[v]=!0,u[m]=!1),dt(f,s)&&(t._onMenuItemMouseOut(f,e),f[v]=!0,f[m]=!1),u&&(a=u.next(),a&&s&&(s.compareTo(a)||a.contains(s))&&(r=!0));if(dt(o,s)||r)t._onMenuMouseOut(o,e),o[v]=!0,o[m]=!1},_toggleSubmenuDisplay:function(e){var t=this,r=e.target,i=ft(r,!0),s=e.type,o,u,a,f,l,c;if(i){o=Z(r)?r:r.ancestor(Z);if(o){a=o.getAttribute("href",2),f=a.indexOf("#"),l=a.length;if(f===0&&l>1){c=a.substr(1,l),u=i.next();if(u&&u.get(p)===c){if(s===w||s===E)(n.opera||n.gecko||n.ie)&&s===E&&!t._preventClickHandle&&(t._preventClickHandle=t._rootMenu.on("click",function(e){e.preventDefault(),t._preventClickHandle.detach(),t._preventClickHandle=null})),s==w&&(e.preventDefault(),e.stopImmediatePropagation(),t._hasFocus=!0),t._isRoot(ot(r))?rt(i)?(t._hideMenu(u),t._focusItem(i),t._setActiveItem(i)):(t._hideAllSubmenus(t._rootMenu),t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):t._activeItem==i?(t._showMenu(u),t._focusItem(ct(u)),t._setActiveItem(ct(u))):i._clickHandle||(i._clickHandle=i.on("click",function(){t._hideAllSubmenus(t._rootMenu),t._hasFocus=!1,t._clearActiveItem(),i._clickHandle.detach(),i._clickHandle=null}));s===S&&e.preventDefault()}}}}},_onKeyPress:function(e){switch(e.keyCode){case 37:case 38:case 39:case 40:e.preventDefault()}},_onKeyDown:function(e){var t=this,i=t._activeItem,s=e.target,o=ot(s),u;o&&(t._activeMenu=o,nt(o)?t._onHorizontalMenuKeyDown(e):t._onVerticalMenuKeyDown(e),e.keyCode===27&&(t._isRoot(o)?i&&(tt(i)&&rt(i)?(u=i.next(),u&&t._hideMenu(u)):(t._focusManager.blur(),t._clearActiveItem(),t._hasFocus=!1)):(n.opera?r(0,t,function(){t._hideMenu(o,!0)}):t._hideMenu(o,!0),e.stopPropagation(),t._blockMouseEvent=n.gecko?!0:!1)))},_onDocMouseDown:function(e){var t=this,r=t._rootMenu,i=e.target;!r.compareTo(i)&&!r.contains(i)&&(t._hideAllSubmenus(r),n.webkit&&(t._hasFocus=!1,t._clearActiveItem()))}}),e.namespace("Plugin"),e.Plugin.NodeMenuNav=vt},"3.7.3",{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0});
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -2187,4 +2187,4 @@ Y.Plugin.NodeMenuNav = NodeMenuNav; -}, '3.7.2', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});+}, '3.7.3', {"requires": ["node", "classnamemanager", "plugin", "node-focusmanager"], "skinnable": true});
bundle/node-pluginhost/node-pluginhost-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-pluginhost/node-pluginhost.js", code: [] };-_yuitest_coverage["build/node-pluginhost/node-pluginhost.js"].code=["YUI.add('node-pluginhost', function (Y, NAME) {","","/**"," * @module node"," * @submodule node-pluginhost"," */","","/**"," * Registers plugins to be instantiated at the class level (plugins"," * which should be plugged into every instance of Node by default)."," *"," * @method plug"," * @static"," * @for Node"," * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined)"," * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin"," */","Y.Node.plug = function() {"," var args = Y.Array(arguments);"," args.unshift(Y.Node);"," Y.Plugin.Host.plug.apply(Y.Base, args);"," return Y.Node;","};","","/**"," * Unregisters any class level plugins which have been registered by the Node"," *"," * @method unplug"," * @static"," *"," * @param {Function | Array} plugin The plugin class, or an array of plugin classes"," */","Y.Node.unplug = function() {"," var args = Y.Array(arguments);"," args.unshift(Y.Node);"," Y.Plugin.Host.unplug.apply(Y.Base, args);"," return Y.Node;","};","","Y.mix(Y.Node, Y.Plugin.Host, false, null, 1);","","// allow batching of plug/unplug via NodeList","// doesn't use NodeList.importMethod because we need real Nodes (not tmpNode)","/**"," * Adds a plugin to each node in the NodeList."," * This will instantiate the plugin and attach it to the configured namespace on each node"," * @method plug"," * @for NodeList"," * @param P {Function | Object |Array} Accepts the plugin class, or an "," * object with a \"fn\" property specifying the plugin class and "," * a \"cfg\" property specifying the configuration for the Plugin."," * <p>"," * Additionally an Array can also be passed in, with the above function or "," * object values, allowing the user to add multiple plugins in a single call."," * </p>"," * @param config (Optional) If the first argument is the plugin class, the second argument"," * can be the configuration for the plugin."," * @chainable"," */","Y.NodeList.prototype.plug = function() {"," var args = arguments;"," Y.NodeList.each(this, function(node) {"," Y.Node.prototype.plug.apply(Y.one(node), args);"," });"," return this;","};","","/**"," * Removes a plugin from all nodes in the NodeList. This will destroy the "," * plugin instance and delete the namespace each node. "," * @method unplug"," * @for NodeList"," * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided,"," * all registered plugins are unplugged."," * @chainable"," */","Y.NodeList.prototype.unplug = function() {"," var args = arguments;"," Y.NodeList.each(this, function(node) {"," Y.Node.prototype.unplug.apply(Y.one(node), args);"," });"," return this;","};","","","}, '3.7.2', {\"requires\": [\"node-base\", \"pluginhost\"]});"];+_yuitest_coverage["build/node-pluginhost/node-pluginhost.js"].code=["YUI.add('node-pluginhost', function (Y, NAME) {","","/**"," * @module node"," * @submodule node-pluginhost"," */","","/**"," * Registers plugins to be instantiated at the class level (plugins"," * which should be plugged into every instance of Node by default)."," *"," * @method plug"," * @static"," * @for Node"," * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined)"," * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin"," */","Y.Node.plug = function() {"," var args = Y.Array(arguments);"," args.unshift(Y.Node);"," Y.Plugin.Host.plug.apply(Y.Base, args);"," return Y.Node;","};","","/**"," * Unregisters any class level plugins which have been registered by the Node"," *"," * @method unplug"," * @static"," *"," * @param {Function | Array} plugin The plugin class, or an array of plugin classes"," */","Y.Node.unplug = function() {"," var args = Y.Array(arguments);"," args.unshift(Y.Node);"," Y.Plugin.Host.unplug.apply(Y.Base, args);"," return Y.Node;","};","","Y.mix(Y.Node, Y.Plugin.Host, false, null, 1);","","// allow batching of plug/unplug via NodeList","// doesn't use NodeList.importMethod because we need real Nodes (not tmpNode)","/**"," * Adds a plugin to each node in the NodeList."," * This will instantiate the plugin and attach it to the configured namespace on each node"," * @method plug"," * @for NodeList"," * @param P {Function | Object |Array} Accepts the plugin class, or an "," * object with a \"fn\" property specifying the plugin class and "," * a \"cfg\" property specifying the configuration for the Plugin."," * <p>"," * Additionally an Array can also be passed in, with the above function or "," * object values, allowing the user to add multiple plugins in a single call."," * </p>"," * @param config (Optional) If the first argument is the plugin class, the second argument"," * can be the configuration for the plugin."," * @chainable"," */","Y.NodeList.prototype.plug = function() {"," var args = arguments;"," Y.NodeList.each(this, function(node) {"," Y.Node.prototype.plug.apply(Y.one(node), args);"," });"," return this;","};","","/**"," * Removes a plugin from all nodes in the NodeList. This will destroy the "," * plugin instance and delete the namespace each node. "," * @method unplug"," * @for NodeList"," * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided,"," * all registered plugins are unplugged."," * @chainable"," */","Y.NodeList.prototype.unplug = function() {"," var args = arguments;"," Y.NodeList.each(this, function(node) {"," Y.Node.prototype.unplug.apply(Y.one(node), args);"," });"," return this;","};","","","}, '3.7.3', {\"requires\": [\"node-base\", \"pluginhost\"]});"]; _yuitest_coverage["build/node-pluginhost/node-pluginhost.js"].lines = {"1":0,"18":0,"19":0,"20":0,"21":0,"22":0,"33":0,"34":0,"35":0,"36":0,"37":0,"40":0,"60":0,"61":0,"62":0,"63":0,"65":0,"77":0,"78":0,"79":0,"80":0,"82":0}; _yuitest_coverage["build/node-pluginhost/node-pluginhost.js"].functions = {"plug:18":0,"unplug:33":0,"(anonymous 2):62":0,"plug:60":0,"(anonymous 3):79":0,"unplug:77":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-pluginhost/node-pluginhost.js"].coveredLines = 22;@@ -151,4 +151,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "pluginhost"]});+}, '3.7.3', {"requires": ["node-base", "pluginhost"]});
bundle/node-pluginhost/node-pluginhost-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -89,4 +89,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "pluginhost"]});+}, '3.7.3', {"requires": ["node-base", "pluginhost"]});
bundle/node-pluginhost/node-pluginhost-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-pluginhost",function(e,t){e.Node.plug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.plug.apply(e.Base,t),e.Node},e.Node.unplug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.unplug.apply(e.Base,t),e.Node},e.mix(e.Node,e.Plugin.Host,!1,null,1),e.NodeList.prototype.plug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.plug.apply(e.one(n),t)}),this},e.NodeList.prototype.unplug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.unplug.apply(e.one(n),t)}),this}},"3.7.2",{requires:["node-base","pluginhost"]});+YUI.add("node-pluginhost",function(e,t){e.Node.plug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.plug.apply(e.Base,t),e.Node},e.Node.unplug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.unplug.apply(e.Base,t),e.Node},e.mix(e.Node,e.Plugin.Host,!1,null,1),e.NodeList.prototype.plug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.plug.apply(e.one(n),t)}),this},e.NodeList.prototype.unplug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.unplug.apply(e.one(n),t)}),this}},"3.7.3",{requires:["node-base","pluginhost"]});
bundle/node-pluginhost/node-pluginhost.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -89,4 +89,4 @@ }; -}, '3.7.2', {"requires": ["node-base", "pluginhost"]});+}, '3.7.3', {"requires": ["node-base", "pluginhost"]});
bundle/node-screen/node-screen-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-screen/node-screen.js", code: [] };-_yuitest_coverage["build/node-screen/node-screen.js"].code=["YUI.add('node-screen', function (Y, NAME) {","","/**"," * Extended Node interface for managing regions and screen positioning."," * Adds support for positioning elements and normalizes window size and scroll detection. "," * @module node"," * @submodule node-screen"," */","","// these are all \"safe\" returns, no wrapping required","Y.each(["," /**"," * Returns the inner width of the viewport (exludes scrollbar). "," * @config winWidth"," * @for Node"," * @type {Int}"," */"," 'winWidth',",""," /**"," * Returns the inner height of the viewport (exludes scrollbar). "," * @config winHeight"," * @type {Int}"," */"," 'winHeight',",""," /**"," * Document width "," * @config docWidth"," * @type {Int}"," */"," 'docWidth',",""," /**"," * Document height "," * @config docHeight"," * @type {Int}"," */"," 'docHeight',",""," /**"," * Pixel distance the page has been scrolled horizontally "," * @config docScrollX"," * @type {Int}"," */"," 'docScrollX',",""," /**"," * Pixel distance the page has been scrolled vertically "," * @config docScrollY"," * @type {Int}"," */"," 'docScrollY'"," ],"," function(name) {"," Y.Node.ATTRS[name] = {"," getter: function() {"," var args = Array.prototype.slice.call(arguments);"," args.unshift(Y.Node.getDOMNode(this));",""," return Y.DOM[name].apply(this, args);"," }"," };"," }",");","","Y.Node.ATTRS.scrollLeft = {"," getter: function() {"," var node = Y.Node.getDOMNode(this);"," return ('scrollLeft' in node) ? node.scrollLeft : Y.DOM.docScrollX(node);"," },",""," setter: function(val) {"," var node = Y.Node.getDOMNode(this);"," if (node) {"," if ('scrollLeft' in node) {"," node.scrollLeft = val;"," } else if (node.document || node.nodeType === 9) {"," Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc"," }"," } else {"," }"," }","};","","Y.Node.ATTRS.scrollTop = {"," getter: function() {"," var node = Y.Node.getDOMNode(this);"," return ('scrollTop' in node) ? node.scrollTop : Y.DOM.docScrollY(node);"," },",""," setter: function(val) {"," var node = Y.Node.getDOMNode(this);"," if (node) {"," if ('scrollTop' in node) {"," node.scrollTop = val;"," } else if (node.document || node.nodeType === 9) {"," Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc"," }"," } else {"," }"," }","};","","Y.Node.importMethod(Y.DOM, [","/**"," * Gets the current position of the node in page coordinates. "," * @method getXY"," * @for Node"," * @return {Array} The XY position of the node","*/"," 'getXY',","","/**"," * Set the position of the node in page coordinates, regardless of how the node is positioned."," * @method setXY"," * @param {Array} xy Contains X & Y values for new position (coordinates are page-based)"," * @chainable"," */"," 'setXY',","","/**"," * Gets the current position of the node in page coordinates. "," * @method getX"," * @return {Int} The X position of the node","*/"," 'getX',","","/**"," * Set the position of the node in page coordinates, regardless of how the node is positioned."," * @method setX"," * @param {Int} x X value for new position (coordinates are page-based)"," * @chainable"," */"," 'setX',","","/**"," * Gets the current position of the node in page coordinates. "," * @method getY"," * @return {Int} The Y position of the node","*/"," 'getY',","","/**"," * Set the position of the node in page coordinates, regardless of how the node is positioned."," * @method setY"," * @param {Int} y Y value for new position (coordinates are page-based)"," * @chainable"," */"," 'setY',","","/**"," * Swaps the XY position of this node with another node. "," * @method swapXY"," * @param {Node | HTMLElement} otherNode The node to swap with."," * @chainable"," */"," 'swapXY'","]);","","/**"," * @module node"," * @submodule node-screen"," */","","/**"," * Returns a region object for the node"," * @config region"," * @for Node"," * @type Node"," */","Y.Node.ATTRS.region = {"," getter: function() {"," var node = this.getDOMNode(),"," region;",""," if (node && !node.tagName) {"," if (node.nodeType === 9) { // document"," node = node.documentElement;"," }"," }"," if (Y.DOM.isWindow(node)) {"," region = Y.DOM.viewportRegion(node);"," } else {"," region = Y.DOM.region(node);"," }"," return region;"," }","};","","/**"," * Returns a region object for the node's viewport"," * @config viewportRegion"," * @type Node"," */","Y.Node.ATTRS.viewportRegion = {"," getter: function() {"," return Y.DOM.viewportRegion(Y.Node.getDOMNode(this));"," }","};","","Y.Node.importMethod(Y.DOM, 'inViewportRegion');","","// these need special treatment to extract 2nd node arg","/**"," * Compares the intersection of the node with another node or region"," * @method intersect"," * @for Node"," * @param {Node|Object} node2 The node or region to compare with."," * @param {Object} altRegion An alternate region to use (rather than this node's)."," * @return {Object} An object representing the intersection of the regions."," */","Y.Node.prototype.intersect = function(node2, altRegion) {"," var node1 = Y.Node.getDOMNode(this);"," if (Y.instanceOf(node2, Y.Node)) { // might be a region object"," node2 = Y.Node.getDOMNode(node2);"," }"," return Y.DOM.intersect(node1, node2, altRegion);","};","","/**"," * Determines whether or not the node is within the giving region."," * @method inRegion"," * @param {Node|Object} node2 The node or region to compare with."," * @param {Boolean} all Whether or not all of the node must be in the region."," * @param {Object} altRegion An alternate region to use (rather than this node's)."," * @return {Object} An object representing the intersection of the regions."," */","Y.Node.prototype.inRegion = function(node2, all, altRegion) {"," var node1 = Y.Node.getDOMNode(this);"," if (Y.instanceOf(node2, Y.Node)) { // might be a region object"," node2 = Y.Node.getDOMNode(node2);"," }"," return Y.DOM.inRegion(node1, node2, all, altRegion);","};","","","}, '3.7.2', {\"requires\": [\"dom-screen\", \"node-base\"]});"];+_yuitest_coverage["build/node-screen/node-screen.js"].code=["YUI.add('node-screen', function (Y, NAME) {","","/**"," * Extended Node interface for managing regions and screen positioning."," * Adds support for positioning elements and normalizes window size and scroll detection. "," * @module node"," * @submodule node-screen"," */","","// these are all \"safe\" returns, no wrapping required","Y.each(["," /**"," * Returns the inner width of the viewport (exludes scrollbar). "," * @config winWidth"," * @for Node"," * @type {Int}"," */"," 'winWidth',",""," /**"," * Returns the inner height of the viewport (exludes scrollbar). "," * @config winHeight"," * @type {Int}"," */"," 'winHeight',",""," /**"," * Document width "," * @config docWidth"," * @type {Int}"," */"," 'docWidth',",""," /**"," * Document height "," * @config docHeight"," * @type {Int}"," */"," 'docHeight',",""," /**"," * Pixel distance the page has been scrolled horizontally "," * @config docScrollX"," * @type {Int}"," */"," 'docScrollX',",""," /**"," * Pixel distance the page has been scrolled vertically "," * @config docScrollY"," * @type {Int}"," */"," 'docScrollY'"," ],"," function(name) {"," Y.Node.ATTRS[name] = {"," getter: function() {"," var args = Array.prototype.slice.call(arguments);"," args.unshift(Y.Node.getDOMNode(this));",""," return Y.DOM[name].apply(this, args);"," }"," };"," }",");","","Y.Node.ATTRS.scrollLeft = {"," getter: function() {"," var node = Y.Node.getDOMNode(this);"," return ('scrollLeft' in node) ? node.scrollLeft : Y.DOM.docScrollX(node);"," },",""," setter: function(val) {"," var node = Y.Node.getDOMNode(this);"," if (node) {"," if ('scrollLeft' in node) {"," node.scrollLeft = val;"," } else if (node.document || node.nodeType === 9) {"," Y.DOM._getWin(node).scrollTo(val, Y.DOM.docScrollY(node)); // scroll window if win or doc"," }"," } else {"," }"," }","};","","Y.Node.ATTRS.scrollTop = {"," getter: function() {"," var node = Y.Node.getDOMNode(this);"," return ('scrollTop' in node) ? node.scrollTop : Y.DOM.docScrollY(node);"," },",""," setter: function(val) {"," var node = Y.Node.getDOMNode(this);"," if (node) {"," if ('scrollTop' in node) {"," node.scrollTop = val;"," } else if (node.document || node.nodeType === 9) {"," Y.DOM._getWin(node).scrollTo(Y.DOM.docScrollX(node), val); // scroll window if win or doc"," }"," } else {"," }"," }","};","","Y.Node.importMethod(Y.DOM, [","/**"," * Gets the current position of the node in page coordinates. "," * @method getXY"," * @for Node"," * @return {Array} The XY position of the node","*/"," 'getXY',","","/**"," * Set the position of the node in page coordinates, regardless of how the node is positioned."," * @method setXY"," * @param {Array} xy Contains X & Y values for new position (coordinates are page-based)"," * @chainable"," */"," 'setXY',","","/**"," * Gets the current position of the node in page coordinates. "," * @method getX"," * @return {Int} The X position of the node","*/"," 'getX',","","/**"," * Set the position of the node in page coordinates, regardless of how the node is positioned."," * @method setX"," * @param {Int} x X value for new position (coordinates are page-based)"," * @chainable"," */"," 'setX',","","/**"," * Gets the current position of the node in page coordinates. "," * @method getY"," * @return {Int} The Y position of the node","*/"," 'getY',","","/**"," * Set the position of the node in page coordinates, regardless of how the node is positioned."," * @method setY"," * @param {Int} y Y value for new position (coordinates are page-based)"," * @chainable"," */"," 'setY',","","/**"," * Swaps the XY position of this node with another node. "," * @method swapXY"," * @param {Node | HTMLElement} otherNode The node to swap with."," * @chainable"," */"," 'swapXY'","]);","","/**"," * @module node"," * @submodule node-screen"," */","","/**"," * Returns a region object for the node"," * @config region"," * @for Node"," * @type Node"," */","Y.Node.ATTRS.region = {"," getter: function() {"," var node = this.getDOMNode(),"," region;",""," if (node && !node.tagName) {"," if (node.nodeType === 9) { // document"," node = node.documentElement;"," }"," }"," if (Y.DOM.isWindow(node)) {"," region = Y.DOM.viewportRegion(node);"," } else {"," region = Y.DOM.region(node);"," }"," return region;"," }","};","","/**"," * Returns a region object for the node's viewport"," * @config viewportRegion"," * @type Node"," */","Y.Node.ATTRS.viewportRegion = {"," getter: function() {"," return Y.DOM.viewportRegion(Y.Node.getDOMNode(this));"," }","};","","Y.Node.importMethod(Y.DOM, 'inViewportRegion');","","// these need special treatment to extract 2nd node arg","/**"," * Compares the intersection of the node with another node or region"," * @method intersect"," * @for Node"," * @param {Node|Object} node2 The node or region to compare with."," * @param {Object} altRegion An alternate region to use (rather than this node's)."," * @return {Object} An object representing the intersection of the regions."," */","Y.Node.prototype.intersect = function(node2, altRegion) {"," var node1 = Y.Node.getDOMNode(this);"," if (Y.instanceOf(node2, Y.Node)) { // might be a region object"," node2 = Y.Node.getDOMNode(node2);"," }"," return Y.DOM.intersect(node1, node2, altRegion);","};","","/**"," * Determines whether or not the node is within the giving region."," * @method inRegion"," * @param {Node|Object} node2 The node or region to compare with."," * @param {Boolean} all Whether or not all of the node must be in the region."," * @param {Object} altRegion An alternate region to use (rather than this node's)."," * @return {Object} An object representing the intersection of the regions."," */","Y.Node.prototype.inRegion = function(node2, all, altRegion) {"," var node1 = Y.Node.getDOMNode(this);"," if (Y.instanceOf(node2, Y.Node)) { // might be a region object"," node2 = Y.Node.getDOMNode(node2);"," }"," return Y.DOM.inRegion(node1, node2, all, altRegion);","};","","","}, '3.7.3', {\"requires\": [\"dom-screen\", \"node-base\"]});"]; _yuitest_coverage["build/node-screen/node-screen.js"].lines = {"1":0,"11":0,"56":0,"58":0,"59":0,"61":0,"67":0,"69":0,"70":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"86":0,"88":0,"89":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"105":0,"172":0,"174":0,"177":0,"178":0,"179":0,"182":0,"183":0,"185":0,"187":0,"196":0,"198":0,"202":0,"213":0,"214":0,"215":0,"216":0,"218":0,"229":0,"230":0,"231":0,"232":0,"234":0}; _yuitest_coverage["build/node-screen/node-screen.js"].functions = {"getter:57":0,"(anonymous 2):55":0,"getter:68":0,"setter:73":0,"getter:87":0,"setter:92":0,"getter:173":0,"getter:197":0,"intersect:213":0,"inRegion:229":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-screen/node-screen.js"].coveredLines = 47;@@ -332,4 +332,4 @@ }; -}, '3.7.2', {"requires": ["dom-screen", "node-base"]});+}, '3.7.3', {"requires": ["dom-screen", "node-base"]});
bundle/node-screen/node-screen-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -243,4 +243,4 @@ }; -}, '3.7.2', {"requires": ["dom-screen", "node-base"]});+}, '3.7.3', {"requires": ["dom-screen", "node-base"]});
bundle/node-screen/node-screen-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-screen",function(e,t){e.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(t){e.Node.ATTRS[t]={getter:function(){var n=Array.prototype.slice.call(arguments);return n.unshift(e.Node.getDOMNode(this)),e.DOM[t].apply(this,n)}}}),e.Node.ATTRS.scrollLeft={getter:function(){var t=e.Node.getDOMNode(this);return"scrollLeft"in t?t.scrollLeft:e.DOM.docScrollX(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollLeft"in n?n.scrollLeft=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(t,e.DOM.docScrollY(n)))}},e.Node.ATTRS.scrollTop={getter:function(){var t=e.Node.getDOMNode(this);return"scrollTop"in t?t.scrollTop:e.DOM.docScrollY(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollTop"in n?n.scrollTop=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(e.DOM.docScrollX(n),t))}},e.Node.importMethod(e.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),e.Node.ATTRS.region={getter:function(){var t=this.getDOMNode(),n;return t&&!t.tagName&&t.nodeType===9&&(t=t.documentElement),e.DOM.isWindow(t)?n=e.DOM.viewportRegion(t):n=e.DOM.region(t),n}},e.Node.ATTRS.viewportRegion={getter:function(){return e.DOM.viewportRegion(e.Node.getDOMNode(this))}},e.Node.importMethod(e.DOM,"inViewportRegion"),e.Node.prototype.intersect=function(t,n){var r=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.intersect(r,t,n)},e.Node.prototype.inRegion=function(t,n,r){var i=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.inRegion(i,t,n,r)}},"3.7.2",{requires:["dom-screen","node-base"]});+YUI.add("node-screen",function(e,t){e.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(t){e.Node.ATTRS[t]={getter:function(){var n=Array.prototype.slice.call(arguments);return n.unshift(e.Node.getDOMNode(this)),e.DOM[t].apply(this,n)}}}),e.Node.ATTRS.scrollLeft={getter:function(){var t=e.Node.getDOMNode(this);return"scrollLeft"in t?t.scrollLeft:e.DOM.docScrollX(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollLeft"in n?n.scrollLeft=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(t,e.DOM.docScrollY(n)))}},e.Node.ATTRS.scrollTop={getter:function(){var t=e.Node.getDOMNode(this);return"scrollTop"in t?t.scrollTop:e.DOM.docScrollY(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollTop"in n?n.scrollTop=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(e.DOM.docScrollX(n),t))}},e.Node.importMethod(e.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),e.Node.ATTRS.region={getter:function(){var t=this.getDOMNode(),n;return t&&!t.tagName&&t.nodeType===9&&(t=t.documentElement),e.DOM.isWindow(t)?n=e.DOM.viewportRegion(t):n=e.DOM.region(t),n}},e.Node.ATTRS.viewportRegion={getter:function(){return e.DOM.viewportRegion(e.Node.getDOMNode(this))}},e.Node.importMethod(e.DOM,"inViewportRegion"),e.Node.prototype.intersect=function(t,n){var r=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.intersect(r,t,n)},e.Node.prototype.inRegion=function(t,n,r){var i=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.inRegion(i,t,n,r)}},"3.7.3",{requires:["dom-screen","node-base"]});
bundle/node-screen/node-screen.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -241,4 +241,4 @@ }; -}, '3.7.2', {"requires": ["dom-screen", "node-base"]});+}, '3.7.3', {"requires": ["dom-screen", "node-base"]});
bundle/node-scroll-info/node-scroll-info-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-scroll-info/node-scroll-info.js", code: [] };-_yuitest_coverage["build/node-scroll-info/node-scroll-info.js"].code=["YUI.add('node-scroll-info', function (Y, NAME) {","","/**","Provides the ScrollInfo Node plugin, which exposes convenient events and methods","related to scrolling.","","@module node-scroll-info","@since 3.7.0","**/","","/**","Provides convenient events and methods related to scrolling. This could be used,","for example, to implement infinite scrolling, or to lazy-load content based on","the current scroll position.","","### Example",""," var body = Y.one('body');",""," body.plug(Y.Plugin.ScrollInfo);",""," body.scrollInfo.on('scrollToBottom', function (e) {"," // Load more content when the user scrolls to the bottom of the page."," });","","@class Plugin.ScrollInfo","@extends Plugin.Base","@since 3.7.0","**/","","/**","Fired when the user scrolls within the host node.","","This event (like all scroll events exposed by ScrollInfo) is throttled and fired","only after the number of milliseconds specified by the `scrollDelay` attribute","have passed in order to prevent thrashing.","","This event passes along the event facade for the standard DOM `scroll` event and","mixes in the following additional properties.","","@event scroll","@param {Boolean} atBottom Whether the current scroll position is at the bottom"," of the scrollable region.","@param {Boolean} atLeft Whether the current scroll position is at the extreme"," left of the scrollable region.","@param {Boolean} atRight Whether the current scroll position is at the extreme"," right of the scrollable region.","@param {Boolean} atTop Whether the current scroll position is at the top of the"," scrollable region.","@param {Boolean} isScrollDown `true` if the user scrolled down.","@param {Boolean} isScrollLeft `true` if the user scrolled left.","@param {Boolean} isScrollRight `true` if the user scrolled right.","@param {Boolean} isScrollUp `true` if the user scrolled up.","@param {Number} scrollBottom Y value of the bottom-most onscreen pixel of the"," scrollable region.","@param {Number} scrollHeight Total height in pixels of the scrollable region,"," including offscreen pixels.","@param {Number} scrollLeft X value of the left-most onscreen pixel of the"," scrollable region.","@param {Number} scrollRight X value of the right-most onscreen pixel of the"," scrollable region.","@param {Number} scrollTop Y value of the top-most onscreen pixel of the"," scrollable region.","@param {Number} scrollWidth Total width in pixels of the scrollable region,"," including offscreen pixels.","@see scrollDelay","@see scrollMargin","**/","var EVT_SCROLL = 'scroll',",""," /**"," Fired when the user scrolls down within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollDown"," @see scroll"," **/"," EVT_SCROLL_DOWN = 'scrollDown',",""," /**"," Fired when the user scrolls left within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollLeft"," @see scroll"," **/"," EVT_SCROLL_LEFT = 'scrollLeft',",""," /**"," Fired when the user scrolls right within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollRight"," @see scroll"," **/"," EVT_SCROLL_RIGHT = 'scrollRight',",""," /**"," Fired when the user scrolls up within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollUp"," @see scroll"," **/"," EVT_SCROLL_UP = 'scrollUp',",""," /**"," Fired when the user scrolls to the bottom of the scrollable region within"," the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToBottom"," @see scroll"," **/"," EVT_SCROLL_TO_BOTTOM = 'scrollToBottom',",""," /**"," Fired when the user scrolls to the extreme left of the scrollable region"," within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToLeft"," @see scroll"," **/"," EVT_SCROLL_TO_LEFT = 'scrollToLeft',",""," /**"," Fired when the user scrolls to the extreme right of the scrollable region"," within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToRight"," @see scroll"," **/"," EVT_SCROLL_TO_RIGHT = 'scrollToRight',",""," /**"," Fired when the user scrolls to the top of the scrollable region within the"," host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToTop"," @see scroll"," **/"," EVT_SCROLL_TO_TOP = 'scrollToTop';","","Y.Plugin.ScrollInfo = Y.Base.create('scrollInfoPlugin', Y.Plugin.Base, [], {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," // Cache for quicker lookups in the critical path."," this._host = config.host;"," this._hostIsBody = this._host.get('nodeName').toLowerCase() === 'body';"," this._scrollDelay = this.get('scrollDelay');"," this._scrollMargin = this.get('scrollMargin');"," this._scrollNode = this._getScrollNode();",""," this.refreshDimensions();",""," this._lastScroll = this.getScrollInfo();",""," this._bind();"," },",""," destructor: function () {"," (new Y.EventHandle(this._events)).detach();"," delete this._events;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Returns a NodeList containing all offscreen nodes inside the host node that"," match the given CSS selector. An offscreen node is any node that is entirely"," outside the visible (onscreen) region of the host node based on the current"," scroll location.",""," @method getOffscreenNodes"," @param {String} [selector] CSS selector. If omitted, all offscreen nodes"," will be returned."," @param {Number} [margin] Additional margin in pixels beyond the actual"," onscreen region that should be considered \"onscreen\" for the purposes of"," this query. Defaults to the value of the `scrollMargin` attribute."," @return {NodeList} Offscreen nodes matching _selector_."," @see scrollMargin"," **/"," getOffscreenNodes: function (selector, margin) {"," if (typeof margin === 'undefined') {"," margin = this._scrollMargin;"," }",""," var lastScroll = this._lastScroll,"," nodes = this._host.all(selector || '*'),",""," scrollBottom = lastScroll.scrollBottom + margin,"," scrollLeft = lastScroll.scrollLeft - margin,"," scrollRight = lastScroll.scrollRight + margin,"," scrollTop = lastScroll.scrollTop - margin,",""," self = this;",""," return nodes.filter(function (el) {"," var xy = Y.DOM.getXY(el),"," elLeft = xy[0] - self._left,"," elTop = xy[1] - self._top,"," elBottom, elRight;",""," // Check whether the element's top left point is within the"," // viewport. This is the least expensive check."," if (elLeft >= scrollLeft && elLeft < scrollRight &&"," elTop >= scrollTop && elTop < scrollBottom) {",""," return false;"," }",""," // Check whether the element's bottom right point is within the"," // viewport. This check is more expensive since we have to get the"," // element's height and width."," elBottom = elTop + el.offsetHeight;"," elRight = elLeft + el.offsetWidth;",""," if (elRight < scrollRight && elRight >= scrollLeft &&"," elBottom < scrollBottom && elBottom >= scrollTop) {",""," return false;"," }",""," // If we get here, the element isn't within the viewport."," return true;"," });"," },",""," /**"," Returns a NodeList containing all onscreen nodes inside the host node that"," match the given CSS selector. An onscreen node is any node that is fully or"," partially within the visible (onscreen) region of the host node based on the"," current scroll location.",""," @method getOnscreenNodes"," @param {String} [selector] CSS selector. If omitted, all onscreen nodes will"," be returned."," @param {Number} [margin] Additional margin in pixels beyond the actual"," onscreen region that should be considered \"onscreen\" for the purposes of"," this query. Defaults to the value of the `scrollMargin` attribute."," @return {NodeList} Onscreen nodes matching _selector_."," @see scrollMargin"," **/"," getOnscreenNodes: function (selector, margin) {"," if (typeof margin === 'undefined') {"," margin = this._scrollMargin;"," }",""," var lastScroll = this._lastScroll,"," nodes = this._host.all(selector || '*'),",""," scrollBottom = lastScroll.scrollBottom + margin,"," scrollLeft = lastScroll.scrollLeft - margin,"," scrollRight = lastScroll.scrollRight + margin,"," scrollTop = lastScroll.scrollTop - margin,",""," self = this;",""," return nodes.filter(function (el) {"," var xy = Y.DOM.getXY(el),"," elLeft = xy[0] - self._left,"," elTop = xy[1] - self._top,"," elBottom, elRight;",""," // Check whether the element's top left point is within the"," // viewport. This is the least expensive check."," if (elLeft >= scrollLeft && elLeft < scrollRight &&"," elTop >= scrollTop && elTop < scrollBottom) {",""," return true;"," }",""," // Check whether the element's bottom right point is within the"," // viewport. This check is more expensive since we have to get the"," // element's height and width."," elBottom = elTop + el.offsetHeight;"," elRight = elLeft + el.offsetWidth;",""," if (elRight < scrollRight && elRight >= scrollLeft &&"," elBottom < scrollBottom && elBottom >= scrollTop) {",""," return true;"," }",""," // If we get here, the element isn't within the viewport."," return false;"," });"," },",""," /**"," Returns an object hash containing information about the current scroll"," position of the host node. This is the same information that's mixed into"," the event facade of the `scroll` event and other scroll-related events.",""," @method getScrollInfo"," @return {Object} Object hash containing information about the current scroll"," position. See the `scroll` event for details on what properties this"," object contains."," @see scroll"," **/"," getScrollInfo: function () {"," var domNode = this._scrollNode,"," lastScroll = this._lastScroll,"," margin = this._scrollMargin,",""," scrollLeft = domNode.scrollLeft,"," scrollHeight = domNode.scrollHeight,"," scrollTop = domNode.scrollTop,"," scrollWidth = domNode.scrollWidth,",""," scrollBottom = scrollTop + this._height,"," scrollRight = scrollLeft + this._width;",""," return {"," atBottom: scrollBottom > (scrollHeight - margin),"," atLeft : scrollLeft < margin,"," atRight : scrollRight > (scrollWidth - margin),"," atTop : scrollTop < margin,",""," isScrollDown : lastScroll && scrollTop > lastScroll.scrollTop,"," isScrollLeft : lastScroll && scrollLeft < lastScroll.scrollLeft,"," isScrollRight: lastScroll && scrollLeft > lastScroll.scrollLeft,"," isScrollUp : lastScroll && scrollTop < lastScroll.scrollTop,",""," scrollBottom: scrollBottom,"," scrollHeight: scrollHeight,"," scrollLeft : scrollLeft,"," scrollRight : scrollRight,"," scrollTop : scrollTop,"," scrollWidth : scrollWidth"," };"," },",""," /**"," Refreshes cached position, height, and width dimensions for the host node."," If the host node is the body, then the viewport height and width will be"," used.",""," This info is cached to improve performance during scroll events, since it's"," expensive to touch the DOM for these values. Dimensions are automatically"," refreshed whenever the browser is resized, but if you change the dimensions"," or position of the host node in JS, you may need to call"," `refreshDimensions()` manually to cache the new dimensions.",""," @method refreshDimensions"," **/"," refreshDimensions: function () {"," // WebKit only returns reliable scroll info on the body, and only"," // returns reliable height/width info on the documentElement, so we"," // have to special-case it (see the other special case in"," // _getScrollNode())."," //"," // On iOS devices, documentElement.clientHeight/Width aren't reliable,"," // but window.innerHeight/Width are. And no, dom-screen's viewport size"," // methods don't account for this, which is why we do it here.",""," var hostIsBody = this._hostIsBody,"," iosHack = hostIsBody && Y.UA.ios,"," win = Y.config.win,"," el;",""," if (hostIsBody && Y.UA.webkit) {"," el = Y.config.doc.documentElement;"," } else {"," el = this._scrollNode;"," }",""," this._height = iosHack ? win.innerHeight : el.clientHeight;"," this._left = el.offsetLeft;"," this._top = el.offsetTop;"," this._width = iosHack ? win.innerWidth : el.clientWidth;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Binds event handlers.",""," @method _bind"," @protected"," **/"," _bind: function () {"," var winNode = Y.one('win');",""," this._events = ["," this.after({"," scrollDelayChange : this._afterScrollDelayChange,"," scrollMarginChange: this._afterScrollMarginChange"," }),",""," winNode.on('windowresize', this._afterResize, this),",""," // If we're attached to the body, listen for the scroll event on the"," // window, since <body> doesn't have a scroll event."," (this._hostIsBody ? winNode : this._host).after("," 'scroll', this._afterScroll, this)"," ];"," },",""," /**"," Returns the DOM node that should be used to lookup scroll coordinates. In"," some browsers, the `<body>` element doesn't return scroll coordinates, and"," the documentElement must be used instead; this method takes care of"," determining which node should be used.",""," @method _getScrollNode"," @return {HTMLElement} DOM node."," @protected"," **/"," _getScrollNode: function () {"," // WebKit returns scroll coordinates on the body element, but other"," // browsers don't, so we have to use the documentElement."," return this._hostIsBody && !Y.UA.webkit ? Y.config.doc.documentElement :"," Y.Node.getDOMNode(this._host);"," },",""," /**"," Mixes detailed scroll information into the given DOM `scroll` event facade"," and fires appropriate local events.",""," @method _triggerScroll"," @param {EventFacade} e Event facade from the DOM `scroll` event."," @protected"," **/"," _triggerScroll: function (e) {"," var info = this.getScrollInfo(),"," facade = Y.merge(e, info),"," lastScroll = this._lastScroll;",""," this._lastScroll = info;",""," this.fire(EVT_SCROLL, facade);",""," if (info.isScrollLeft) {"," this.fire(EVT_SCROLL_LEFT, facade);"," } else if (info.isScrollRight) {"," this.fire(EVT_SCROLL_RIGHT, facade);"," }",""," if (info.isScrollUp) {"," this.fire(EVT_SCROLL_UP, facade);"," } else if (info.isScrollDown) {"," this.fire(EVT_SCROLL_DOWN, facade);"," }",""," if (info.atBottom && (!lastScroll.atBottom ||"," info.scrollHeight > lastScroll.scrollHeight)) {",""," this.fire(EVT_SCROLL_TO_BOTTOM, facade);"," }",""," if (info.atLeft && !lastScroll.atLeft) {"," this.fire(EVT_SCROLL_TO_LEFT, facade);"," }",""," if (info.atRight && (!lastScroll.atRight ||"," info.scrollWidth > lastScroll.scrollWidth)) {",""," this.fire(EVT_SCROLL_TO_RIGHT, facade);"," }",""," if (info.atTop && !lastScroll.atTop) {"," this.fire(EVT_SCROLL_TO_TOP, facade);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles browser resize events.",""," @method _afterResize"," @param {EventFacade} e"," @protected"," **/"," _afterResize: function (e) {"," this.refreshDimensions();"," },",""," /**"," Handles DOM `scroll` events.",""," @method _afterScroll"," @param {EventFacade} e"," @protected"," **/"," _afterScroll: function (e) {"," var self = this;",""," clearTimeout(this._scrollTimeout);",""," this._scrollTimeout = setTimeout(function () {"," self._triggerScroll(e);"," }, this._scrollDelay);"," },",""," /**"," Caches the `scrollDelay` value after that attribute changes to allow"," quicker lookups in critical path code.",""," @method _afterScrollDelayChange"," @param {EventFacade} e"," @protected"," **/"," _afterScrollDelayChange: function (e) {"," this._scrollDelay = e.newVal;"," },",""," /**"," Caches the `scrollMargin` value after that attribute changes to allow"," quicker lookups in critical path code.",""," @method _afterScrollMarginChange"," @param {EventFacade} e"," @protected"," **/"," _afterScrollMarginChange: function (e) {"," this._scrollMargin = e.newVal;"," }","}, {"," NS: 'scrollInfo',",""," ATTRS: {"," /**"," Number of milliseconds to wait after a native `scroll` event before"," firing local scroll events. If another native scroll event occurs during"," this time, previous events will be ignored. This ensures that we don't"," fire thousands of events when the user is scrolling quickly.",""," @attribute scrollDelay"," @type Number"," @default 50"," **/"," scrollDelay: {"," value: 50"," },",""," /**"," Additional margin in pixels beyond the onscreen region of the host node"," that should be considered \"onscreen\".",""," For example, if set to 50, then a `scrollToBottom` event would be fired"," when the user scrolls to within 50 pixels of the bottom of the"," scrollable region, even if they don't actually scroll completely to the"," very bottom pixel.",""," This margin also applies to the `getOffscreenNodes()` and"," `getOnscreenNodes()` methods by default.",""," @attribute scrollMargin"," @type Number"," @default 50"," **/"," scrollMargin: {"," value: 50"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"base-build\", \"dom-screen\", \"event-resize\", \"node-pluginhost\", \"plugin\"]});"];+_yuitest_coverage["build/node-scroll-info/node-scroll-info.js"].code=["YUI.add('node-scroll-info', function (Y, NAME) {","","/**","Provides the ScrollInfo Node plugin, which exposes convenient events and methods","related to scrolling.","","@module node-scroll-info","@since 3.7.0","**/","","/**","Provides convenient events and methods related to scrolling. This could be used,","for example, to implement infinite scrolling, or to lazy-load content based on","the current scroll position.","","### Example",""," var body = Y.one('body');",""," body.plug(Y.Plugin.ScrollInfo);",""," body.scrollInfo.on('scrollToBottom', function (e) {"," // Load more content when the user scrolls to the bottom of the page."," });","","@class Plugin.ScrollInfo","@extends Plugin.Base","@since 3.7.0","**/","","/**","Fired when the user scrolls within the host node.","","This event (like all scroll events exposed by ScrollInfo) is throttled and fired","only after the number of milliseconds specified by the `scrollDelay` attribute","have passed in order to prevent thrashing.","","This event passes along the event facade for the standard DOM `scroll` event and","mixes in the following additional properties.","","@event scroll","@param {Boolean} atBottom Whether the current scroll position is at the bottom"," of the scrollable region.","@param {Boolean} atLeft Whether the current scroll position is at the extreme"," left of the scrollable region.","@param {Boolean} atRight Whether the current scroll position is at the extreme"," right of the scrollable region.","@param {Boolean} atTop Whether the current scroll position is at the top of the"," scrollable region.","@param {Boolean} isScrollDown `true` if the user scrolled down.","@param {Boolean} isScrollLeft `true` if the user scrolled left.","@param {Boolean} isScrollRight `true` if the user scrolled right.","@param {Boolean} isScrollUp `true` if the user scrolled up.","@param {Number} scrollBottom Y value of the bottom-most onscreen pixel of the"," scrollable region.","@param {Number} scrollHeight Total height in pixels of the scrollable region,"," including offscreen pixels.","@param {Number} scrollLeft X value of the left-most onscreen pixel of the"," scrollable region.","@param {Number} scrollRight X value of the right-most onscreen pixel of the"," scrollable region.","@param {Number} scrollTop Y value of the top-most onscreen pixel of the"," scrollable region.","@param {Number} scrollWidth Total width in pixels of the scrollable region,"," including offscreen pixels.","@see scrollDelay","@see scrollMargin","**/","var EVT_SCROLL = 'scroll',",""," /**"," Fired when the user scrolls down within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollDown"," @see scroll"," **/"," EVT_SCROLL_DOWN = 'scrollDown',",""," /**"," Fired when the user scrolls left within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollLeft"," @see scroll"," **/"," EVT_SCROLL_LEFT = 'scrollLeft',",""," /**"," Fired when the user scrolls right within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollRight"," @see scroll"," **/"," EVT_SCROLL_RIGHT = 'scrollRight',",""," /**"," Fired when the user scrolls up within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollUp"," @see scroll"," **/"," EVT_SCROLL_UP = 'scrollUp',",""," /**"," Fired when the user scrolls to the bottom of the scrollable region within"," the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToBottom"," @see scroll"," **/"," EVT_SCROLL_TO_BOTTOM = 'scrollToBottom',",""," /**"," Fired when the user scrolls to the extreme left of the scrollable region"," within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToLeft"," @see scroll"," **/"," EVT_SCROLL_TO_LEFT = 'scrollToLeft',",""," /**"," Fired when the user scrolls to the extreme right of the scrollable region"," within the host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToRight"," @see scroll"," **/"," EVT_SCROLL_TO_RIGHT = 'scrollToRight',",""," /**"," Fired when the user scrolls to the top of the scrollable region within the"," host node.",""," This event provides the same event facade as the `scroll` event. See that"," event for details.",""," @event scrollToTop"," @see scroll"," **/"," EVT_SCROLL_TO_TOP = 'scrollToTop';","","Y.Plugin.ScrollInfo = Y.Base.create('scrollInfoPlugin', Y.Plugin.Base, [], {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," // Cache for quicker lookups in the critical path."," this._host = config.host;"," this._hostIsBody = this._host.get('nodeName').toLowerCase() === 'body';"," this._scrollDelay = this.get('scrollDelay');"," this._scrollMargin = this.get('scrollMargin');"," this._scrollNode = this._getScrollNode();",""," this.refreshDimensions();",""," this._lastScroll = this.getScrollInfo();",""," this._bind();"," },",""," destructor: function () {"," (new Y.EventHandle(this._events)).detach();"," delete this._events;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Returns a NodeList containing all offscreen nodes inside the host node that"," match the given CSS selector. An offscreen node is any node that is entirely"," outside the visible (onscreen) region of the host node based on the current"," scroll location.",""," @method getOffscreenNodes"," @param {String} [selector] CSS selector. If omitted, all offscreen nodes"," will be returned."," @param {Number} [margin] Additional margin in pixels beyond the actual"," onscreen region that should be considered \"onscreen\" for the purposes of"," this query. Defaults to the value of the `scrollMargin` attribute."," @return {NodeList} Offscreen nodes matching _selector_."," @see scrollMargin"," **/"," getOffscreenNodes: function (selector, margin) {"," if (typeof margin === 'undefined') {"," margin = this._scrollMargin;"," }",""," var lastScroll = this._lastScroll,"," nodes = this._host.all(selector || '*'),",""," scrollBottom = lastScroll.scrollBottom + margin,"," scrollLeft = lastScroll.scrollLeft - margin,"," scrollRight = lastScroll.scrollRight + margin,"," scrollTop = lastScroll.scrollTop - margin,",""," self = this;",""," return nodes.filter(function (el) {"," var xy = Y.DOM.getXY(el),"," elLeft = xy[0] - self._left,"," elTop = xy[1] - self._top,"," elBottom, elRight;",""," // Check whether the element's top left point is within the"," // viewport. This is the least expensive check."," if (elLeft >= scrollLeft && elLeft < scrollRight &&"," elTop >= scrollTop && elTop < scrollBottom) {",""," return false;"," }",""," // Check whether the element's bottom right point is within the"," // viewport. This check is more expensive since we have to get the"," // element's height and width."," elBottom = elTop + el.offsetHeight;"," elRight = elLeft + el.offsetWidth;",""," if (elRight < scrollRight && elRight >= scrollLeft &&"," elBottom < scrollBottom && elBottom >= scrollTop) {",""," return false;"," }",""," // If we get here, the element isn't within the viewport."," return true;"," });"," },",""," /**"," Returns a NodeList containing all onscreen nodes inside the host node that"," match the given CSS selector. An onscreen node is any node that is fully or"," partially within the visible (onscreen) region of the host node based on the"," current scroll location.",""," @method getOnscreenNodes"," @param {String} [selector] CSS selector. If omitted, all onscreen nodes will"," be returned."," @param {Number} [margin] Additional margin in pixels beyond the actual"," onscreen region that should be considered \"onscreen\" for the purposes of"," this query. Defaults to the value of the `scrollMargin` attribute."," @return {NodeList} Onscreen nodes matching _selector_."," @see scrollMargin"," **/"," getOnscreenNodes: function (selector, margin) {"," if (typeof margin === 'undefined') {"," margin = this._scrollMargin;"," }",""," var lastScroll = this._lastScroll,"," nodes = this._host.all(selector || '*'),",""," scrollBottom = lastScroll.scrollBottom + margin,"," scrollLeft = lastScroll.scrollLeft - margin,"," scrollRight = lastScroll.scrollRight + margin,"," scrollTop = lastScroll.scrollTop - margin,",""," self = this;",""," return nodes.filter(function (el) {"," var xy = Y.DOM.getXY(el),"," elLeft = xy[0] - self._left,"," elTop = xy[1] - self._top,"," elBottom, elRight;",""," // Check whether the element's top left point is within the"," // viewport. This is the least expensive check."," if (elLeft >= scrollLeft && elLeft < scrollRight &&"," elTop >= scrollTop && elTop < scrollBottom) {",""," return true;"," }",""," // Check whether the element's bottom right point is within the"," // viewport. This check is more expensive since we have to get the"," // element's height and width."," elBottom = elTop + el.offsetHeight;"," elRight = elLeft + el.offsetWidth;",""," if (elRight < scrollRight && elRight >= scrollLeft &&"," elBottom < scrollBottom && elBottom >= scrollTop) {",""," return true;"," }",""," // If we get here, the element isn't within the viewport."," return false;"," });"," },",""," /**"," Returns an object hash containing information about the current scroll"," position of the host node. This is the same information that's mixed into"," the event facade of the `scroll` event and other scroll-related events.",""," @method getScrollInfo"," @return {Object} Object hash containing information about the current scroll"," position. See the `scroll` event for details on what properties this"," object contains."," @see scroll"," **/"," getScrollInfo: function () {"," var domNode = this._scrollNode,"," lastScroll = this._lastScroll,"," margin = this._scrollMargin,",""," scrollLeft = domNode.scrollLeft,"," scrollHeight = domNode.scrollHeight,"," scrollTop = domNode.scrollTop,"," scrollWidth = domNode.scrollWidth,",""," scrollBottom = scrollTop + this._height,"," scrollRight = scrollLeft + this._width;",""," return {"," atBottom: scrollBottom > (scrollHeight - margin),"," atLeft : scrollLeft < margin,"," atRight : scrollRight > (scrollWidth - margin),"," atTop : scrollTop < margin,",""," isScrollDown : lastScroll && scrollTop > lastScroll.scrollTop,"," isScrollLeft : lastScroll && scrollLeft < lastScroll.scrollLeft,"," isScrollRight: lastScroll && scrollLeft > lastScroll.scrollLeft,"," isScrollUp : lastScroll && scrollTop < lastScroll.scrollTop,",""," scrollBottom: scrollBottom,"," scrollHeight: scrollHeight,"," scrollLeft : scrollLeft,"," scrollRight : scrollRight,"," scrollTop : scrollTop,"," scrollWidth : scrollWidth"," };"," },",""," /**"," Refreshes cached position, height, and width dimensions for the host node."," If the host node is the body, then the viewport height and width will be"," used.",""," This info is cached to improve performance during scroll events, since it's"," expensive to touch the DOM for these values. Dimensions are automatically"," refreshed whenever the browser is resized, but if you change the dimensions"," or position of the host node in JS, you may need to call"," `refreshDimensions()` manually to cache the new dimensions.",""," @method refreshDimensions"," **/"," refreshDimensions: function () {"," // WebKit only returns reliable scroll info on the body, and only"," // returns reliable height/width info on the documentElement, so we"," // have to special-case it (see the other special case in"," // _getScrollNode())."," //"," // On iOS devices, documentElement.clientHeight/Width aren't reliable,"," // but window.innerHeight/Width are. And no, dom-screen's viewport size"," // methods don't account for this, which is why we do it here.",""," var hostIsBody = this._hostIsBody,"," iosHack = hostIsBody && Y.UA.ios,"," win = Y.config.win,"," el;",""," if (hostIsBody && Y.UA.webkit) {"," el = Y.config.doc.documentElement;"," } else {"," el = this._scrollNode;"," }",""," this._height = iosHack ? win.innerHeight : el.clientHeight;"," this._left = el.offsetLeft;"," this._top = el.offsetTop;"," this._width = iosHack ? win.innerWidth : el.clientWidth;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Binds event handlers.",""," @method _bind"," @protected"," **/"," _bind: function () {"," var winNode = Y.one('win');",""," this._events = ["," this.after({"," scrollDelayChange : this._afterScrollDelayChange,"," scrollMarginChange: this._afterScrollMarginChange"," }),",""," winNode.on('windowresize', this._afterResize, this),",""," // If we're attached to the body, listen for the scroll event on the"," // window, since <body> doesn't have a scroll event."," (this._hostIsBody ? winNode : this._host).after("," 'scroll', this._afterScroll, this)"," ];"," },",""," /**"," Returns the DOM node that should be used to lookup scroll coordinates. In"," some browsers, the `<body>` element doesn't return scroll coordinates, and"," the documentElement must be used instead; this method takes care of"," determining which node should be used.",""," @method _getScrollNode"," @return {HTMLElement} DOM node."," @protected"," **/"," _getScrollNode: function () {"," // WebKit returns scroll coordinates on the body element, but other"," // browsers don't, so we have to use the documentElement."," return this._hostIsBody && !Y.UA.webkit ? Y.config.doc.documentElement :"," Y.Node.getDOMNode(this._host);"," },",""," /**"," Mixes detailed scroll information into the given DOM `scroll` event facade"," and fires appropriate local events.",""," @method _triggerScroll"," @param {EventFacade} e Event facade from the DOM `scroll` event."," @protected"," **/"," _triggerScroll: function (e) {"," var info = this.getScrollInfo(),"," facade = Y.merge(e, info),"," lastScroll = this._lastScroll;",""," this._lastScroll = info;",""," this.fire(EVT_SCROLL, facade);",""," if (info.isScrollLeft) {"," this.fire(EVT_SCROLL_LEFT, facade);"," } else if (info.isScrollRight) {"," this.fire(EVT_SCROLL_RIGHT, facade);"," }",""," if (info.isScrollUp) {"," this.fire(EVT_SCROLL_UP, facade);"," } else if (info.isScrollDown) {"," this.fire(EVT_SCROLL_DOWN, facade);"," }",""," if (info.atBottom && (!lastScroll.atBottom ||"," info.scrollHeight > lastScroll.scrollHeight)) {",""," this.fire(EVT_SCROLL_TO_BOTTOM, facade);"," }",""," if (info.atLeft && !lastScroll.atLeft) {"," this.fire(EVT_SCROLL_TO_LEFT, facade);"," }",""," if (info.atRight && (!lastScroll.atRight ||"," info.scrollWidth > lastScroll.scrollWidth)) {",""," this.fire(EVT_SCROLL_TO_RIGHT, facade);"," }",""," if (info.atTop && !lastScroll.atTop) {"," this.fire(EVT_SCROLL_TO_TOP, facade);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles browser resize events.",""," @method _afterResize"," @param {EventFacade} e"," @protected"," **/"," _afterResize: function (e) {"," this.refreshDimensions();"," },",""," /**"," Handles DOM `scroll` events.",""," @method _afterScroll"," @param {EventFacade} e"," @protected"," **/"," _afterScroll: function (e) {"," var self = this;",""," clearTimeout(this._scrollTimeout);",""," this._scrollTimeout = setTimeout(function () {"," self._triggerScroll(e);"," }, this._scrollDelay);"," },",""," /**"," Caches the `scrollDelay` value after that attribute changes to allow"," quicker lookups in critical path code.",""," @method _afterScrollDelayChange"," @param {EventFacade} e"," @protected"," **/"," _afterScrollDelayChange: function (e) {"," this._scrollDelay = e.newVal;"," },",""," /**"," Caches the `scrollMargin` value after that attribute changes to allow"," quicker lookups in critical path code.",""," @method _afterScrollMarginChange"," @param {EventFacade} e"," @protected"," **/"," _afterScrollMarginChange: function (e) {"," this._scrollMargin = e.newVal;"," }","}, {"," NS: 'scrollInfo',",""," ATTRS: {"," /**"," Number of milliseconds to wait after a native `scroll` event before"," firing local scroll events. If another native scroll event occurs during"," this time, previous events will be ignored. This ensures that we don't"," fire thousands of events when the user is scrolling quickly.",""," @attribute scrollDelay"," @type Number"," @default 50"," **/"," scrollDelay: {"," value: 50"," },",""," /**"," Additional margin in pixels beyond the onscreen region of the host node"," that should be considered \"onscreen\".",""," For example, if set to 50, then a `scrollToBottom` event would be fired"," when the user scrolls to within 50 pixels of the bottom of the"," scrollable region, even if they don't actually scroll completely to the"," very bottom pixel.",""," This margin also applies to the `getOffscreenNodes()` and"," `getOnscreenNodes()` methods by default.",""," @attribute scrollMargin"," @type Number"," @default 50"," **/"," scrollMargin: {"," value: 50"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"base-build\", \"dom-screen\", \"event-resize\", \"node-pluginhost\", \"plugin\"]});"]; _yuitest_coverage["build/node-scroll-info/node-scroll-info.js"].lines = {"1":0,"69":0,"163":0,"167":0,"168":0,"169":0,"170":0,"171":0,"173":0,"175":0,"177":0,"181":0,"182":0,"203":0,"204":0,"207":0,"217":0,"218":0,"225":0,"228":0,"234":0,"235":0,"237":0,"240":0,"244":0,"264":0,"265":0,"268":0,"278":0,"279":0,"286":0,"289":0,"295":0,"296":0,"298":0,"301":0,"305":0,"321":0,"333":0,"376":0,"381":0,"382":0,"384":0,"387":0,"388":0,"389":0,"390":0,"402":0,"404":0,"432":0,"445":0,"449":0,"451":0,"453":0,"454":0,"455":0,"456":0,"459":0,"460":0,"461":0,"462":0,"465":0,"468":0,"471":0,"472":0,"475":0,"478":0,"481":0,"482":0,"496":0,"507":0,"509":0,"511":0,"512":0,"525":0,"537":0}; _yuitest_coverage["build/node-scroll-info/node-scroll-info.js"].functions = {"initializer:165":0,"destructor:180":0,"(anonymous 2):217":0,"getOffscreenNodes:202":0,"(anonymous 3):278":0,"getOnscreenNodes:263":0,"getScrollInfo:320":0,"refreshDimensions:366":0,"_bind:401":0,"_getScrollNode:429":0,"_triggerScroll:444":0,"_afterResize:495":0,"(anonymous 4):511":0,"_afterScroll:506":0,"_afterScrollDelayChange:524":0,"_afterScrollMarginChange:536":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-scroll-info/node-scroll-info.js"].coveredLines = 76;@@ -709,4 +709,4 @@ }); -}, '3.7.2', {"requires": ["base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin"]});+}, '3.7.3', {"requires": ["base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin"]});
bundle/node-scroll-info/node-scroll-info-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -583,4 +583,4 @@ }); -}, '3.7.2', {"requires": ["base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin"]});+}, '3.7.3', {"requires": ["base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin"]});
bundle/node-scroll-info/node-scroll-info-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-scroll-info",function(e,t){var n="scroll",r="scrollDown",i="scrollLeft",s="scrollRight",o="scrollUp",u="scrollToBottom",a="scrollToLeft",f="scrollToRight",l="scrollToTop";e.Plugin.ScrollInfo=e.Base.create("scrollInfoPlugin",e.Plugin.Base,[],{initializer:function(e){this._host=e.host,this._hostIsBody=this._host.get("nodeName").toLowerCase()==="body",this._scrollDelay=this.get("scrollDelay"),this._scrollMargin=this.get("scrollMargin"),this._scrollNode=this._getScrollNode(),this.refreshDimensions(),this._lastScroll=this.getScrollInfo(),this._bind()},destructor:function(){(new e.EventHandle(this._events)).detach(),delete this._events},getOffscreenNodes:function(t,n){typeof n=="undefined"&&(n=this._scrollMargin);var r=this._lastScroll,i=this._host.all(t||"*"),s=r.scrollBottom+n,o=r.scrollLeft-n,u=r.scrollRight+n,a=r.scrollTop-n,f=this;return i.filter(function(t){var n=e.DOM.getXY(t),r=n[0]-f._left,i=n[1]-f._top,l,c;return r>=o&&r<u&&i>=a&&i<s?!1:(l=i+t.offsetHeight,c=r+t.offsetWidth,c<u&&c>=o&&l<s&&l>=a?!1:!0)})},getOnscreenNodes:function(t,n){typeof n=="undefined"&&(n=this._scrollMargin);var r=this._lastScroll,i=this._host.all(t||"*"),s=r.scrollBottom+n,o=r.scrollLeft-n,u=r.scrollRight+n,a=r.scrollTop-n,f=this;return i.filter(function(t){var n=e.DOM.getXY(t),r=n[0]-f._left,i=n[1]-f._top,l,c;return r>=o&&r<u&&i>=a&&i<s?!0:(l=i+t.offsetHeight,c=r+t.offsetWidth,c<u&&c>=o&&l<s&&l>=a?!0:!1)})},getScrollInfo:function(){var e=this._scrollNode,t=this._lastScroll,n=this._scrollMargin,r=e.scrollLeft,i=e.scrollHeight,s=e.scrollTop,o=e.scrollWidth,u=s+this._height,a=r+this._width;return{atBottom:u>i-n,atLeft:r<n,atRight:a>o-n,atTop:s<n,isScrollDown:t&&s>t.scrollTop,isScrollLeft:t&&r<t.scrollLeft,isScrollRight:t&&r>t.scrollLeft,isScrollUp:t&&s<t.scrollTop,scrollBottom:u,scrollHeight:i,scrollLeft:r,scrollRight:a,scrollTop:s,scrollWidth:o}},refreshDimensions:function(){var t=this._hostIsBody,n=t&&e.UA.ios,r=e.config.win,i;t&&e.UA.webkit?i=e.config.doc.documentElement:i=this._scrollNode,this._height=n?r.innerHeight:i.clientHeight,this._left=i.offsetLeft,this._top=i.offsetTop,this._width=n?r.innerWidth:i.clientWidth},_bind:function(){var t=e.one("win");this._events=[this.after({scrollDelayChange:this._afterScrollDelayChange,scrollMarginChange:this._afterScrollMarginChange}),t.on("windowresize",this._afterResize,this),(this._hostIsBody?t:this._host).after("scroll",this._afterScroll,this)]},_getScrollNode:function(){return this._hostIsBody&&!e.UA.webkit?e.config.doc.documentElement:e.Node.getDOMNode(this._host)},_triggerScroll:function(t){var c=this.getScrollInfo(),h=e.merge(t,c),p=this._lastScroll;this._lastScroll=c,this.fire(n,h),c.isScrollLeft?this.fire(i,h):c.isScrollRight&&this.fire(s,h),c.isScrollUp?this.fire(o,h):c.isScrollDown&&this.fire(r,h),c.atBottom&&(!p.atBottom||c.scrollHeight>p.scrollHeight)&&this.fire(u,h),c.atLeft&&!p.atLeft&&this.fire(a,h),c.atRight&&(!p.atRight||c.scrollWidth>p.scrollWidth)&&this.fire(f,h),c.atTop&&!p.atTop&&this.fire(l,h)},_afterResize:function(e){this.refreshDimensions()},_afterScroll:function(e){var t=this;clearTimeout(this._scrollTimeout),this._scrollTimeout=setTimeout(function(){t._triggerScroll(e)},this._scrollDelay)},_afterScrollDelayChange:function(e){this._scrollDelay=e.newVal},_afterScrollMarginChange:function(e){this._scrollMargin=e.newVal}},{NS:"scrollInfo",ATTRS:{scrollDelay:{value:50},scrollMargin:{value:50}}})},"3.7.2",{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]});+YUI.add("node-scroll-info",function(e,t){var n="scroll",r="scrollDown",i="scrollLeft",s="scrollRight",o="scrollUp",u="scrollToBottom",a="scrollToLeft",f="scrollToRight",l="scrollToTop";e.Plugin.ScrollInfo=e.Base.create("scrollInfoPlugin",e.Plugin.Base,[],{initializer:function(e){this._host=e.host,this._hostIsBody=this._host.get("nodeName").toLowerCase()==="body",this._scrollDelay=this.get("scrollDelay"),this._scrollMargin=this.get("scrollMargin"),this._scrollNode=this._getScrollNode(),this.refreshDimensions(),this._lastScroll=this.getScrollInfo(),this._bind()},destructor:function(){(new e.EventHandle(this._events)).detach(),delete this._events},getOffscreenNodes:function(t,n){typeof n=="undefined"&&(n=this._scrollMargin);var r=this._lastScroll,i=this._host.all(t||"*"),s=r.scrollBottom+n,o=r.scrollLeft-n,u=r.scrollRight+n,a=r.scrollTop-n,f=this;return i.filter(function(t){var n=e.DOM.getXY(t),r=n[0]-f._left,i=n[1]-f._top,l,c;return r>=o&&r<u&&i>=a&&i<s?!1:(l=i+t.offsetHeight,c=r+t.offsetWidth,c<u&&c>=o&&l<s&&l>=a?!1:!0)})},getOnscreenNodes:function(t,n){typeof n=="undefined"&&(n=this._scrollMargin);var r=this._lastScroll,i=this._host.all(t||"*"),s=r.scrollBottom+n,o=r.scrollLeft-n,u=r.scrollRight+n,a=r.scrollTop-n,f=this;return i.filter(function(t){var n=e.DOM.getXY(t),r=n[0]-f._left,i=n[1]-f._top,l,c;return r>=o&&r<u&&i>=a&&i<s?!0:(l=i+t.offsetHeight,c=r+t.offsetWidth,c<u&&c>=o&&l<s&&l>=a?!0:!1)})},getScrollInfo:function(){var e=this._scrollNode,t=this._lastScroll,n=this._scrollMargin,r=e.scrollLeft,i=e.scrollHeight,s=e.scrollTop,o=e.scrollWidth,u=s+this._height,a=r+this._width;return{atBottom:u>i-n,atLeft:r<n,atRight:a>o-n,atTop:s<n,isScrollDown:t&&s>t.scrollTop,isScrollLeft:t&&r<t.scrollLeft,isScrollRight:t&&r>t.scrollLeft,isScrollUp:t&&s<t.scrollTop,scrollBottom:u,scrollHeight:i,scrollLeft:r,scrollRight:a,scrollTop:s,scrollWidth:o}},refreshDimensions:function(){var t=this._hostIsBody,n=t&&e.UA.ios,r=e.config.win,i;t&&e.UA.webkit?i=e.config.doc.documentElement:i=this._scrollNode,this._height=n?r.innerHeight:i.clientHeight,this._left=i.offsetLeft,this._top=i.offsetTop,this._width=n?r.innerWidth:i.clientWidth},_bind:function(){var t=e.one("win");this._events=[this.after({scrollDelayChange:this._afterScrollDelayChange,scrollMarginChange:this._afterScrollMarginChange}),t.on("windowresize",this._afterResize,this),(this._hostIsBody?t:this._host).after("scroll",this._afterScroll,this)]},_getScrollNode:function(){return this._hostIsBody&&!e.UA.webkit?e.config.doc.documentElement:e.Node.getDOMNode(this._host)},_triggerScroll:function(t){var c=this.getScrollInfo(),h=e.merge(t,c),p=this._lastScroll;this._lastScroll=c,this.fire(n,h),c.isScrollLeft?this.fire(i,h):c.isScrollRight&&this.fire(s,h),c.isScrollUp?this.fire(o,h):c.isScrollDown&&this.fire(r,h),c.atBottom&&(!p.atBottom||c.scrollHeight>p.scrollHeight)&&this.fire(u,h),c.atLeft&&!p.atLeft&&this.fire(a,h),c.atRight&&(!p.atRight||c.scrollWidth>p.scrollWidth)&&this.fire(f,h),c.atTop&&!p.atTop&&this.fire(l,h)},_afterResize:function(e){this.refreshDimensions()},_afterScroll:function(e){var t=this;clearTimeout(this._scrollTimeout),this._scrollTimeout=setTimeout(function(){t._triggerScroll(e)},this._scrollDelay)},_afterScrollDelayChange:function(e){this._scrollDelay=e.newVal},_afterScrollMarginChange:function(e){this._scrollMargin=e.newVal}},{NS:"scrollInfo",ATTRS:{scrollDelay:{value:50},scrollMargin:{value:50}}})},"3.7.3",{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]});
bundle/node-scroll-info/node-scroll-info.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -583,4 +583,4 @@ }); -}, '3.7.2', {"requires": ["base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin"]});+}, '3.7.3', {"requires": ["base-build", "dom-screen", "event-resize", "node-pluginhost", "plugin"]});
bundle/node-style/node-style-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/node-style/node-style.js", code: [] };-_yuitest_coverage["build/node-style/node-style.js"].code=["YUI.add('node-style', function (Y, NAME) {","","(function(Y) {","/**"," * Extended Node interface for managing node styles."," * @module node"," * @submodule node-style"," */","","Y.mix(Y.Node.prototype, {"," /**"," * Sets a style property of the node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyle"," * @param {String} attr The style attribute to set. "," * @param {String|Number} val The value. "," * @chainable"," */"," setStyle: function(attr, val) {"," Y.DOM.setStyle(this._node, attr, val);"," return this;"," },",""," /**"," * Sets multiple style properties on the node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyles"," * @param {Object} hash An object literal of property:value pairs. "," * @chainable"," */"," setStyles: function(hash) {"," Y.DOM.setStyles(this._node, hash);"," return this;"," },",""," /**"," * Returns the style's current value."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getStyle"," * @for Node"," * @param {String} attr The style attribute to retrieve. "," * @return {String} The current value of the style property for the element."," */",""," getStyle: function(attr) {"," return Y.DOM.getStyle(this._node, attr);"," },",""," /**"," * Returns the computed value for the given style property."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getComputedStyle"," * @param {String} attr The style attribute to retrieve. "," * @return {String} The computed value of the style property for the element."," */"," getComputedStyle: function(attr) {"," return Y.DOM.getComputedStyle(this._node, attr);"," }","});","","/**"," * Returns an array of values for each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getStyle"," * @for NodeList"," * @see Node.getStyle"," * @param {String} attr The style attribute to retrieve. "," * @return {Array} The current values of the style property for the element."," */","","/**"," * Returns an array of the computed value for each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getComputedStyle"," * @see Node.getComputedStyle"," * @param {String} attr The style attribute to retrieve. "," * @return {Array} The computed values for each node."," */","","/**"," * Sets a style property on each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyle"," * @see Node.setStyle"," * @param {String} attr The style attribute to set. "," * @param {String|Number} val The value. "," * @chainable"," */","","/**"," * Sets multiple style properties on each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyles"," * @see Node.setStyles"," * @param {Object} hash An object literal of property:value pairs. "," * @chainable"," */","","// These are broken out to handle undefined return (avoid false positive for","// chainable)","","Y.NodeList.importMethod(Y.Node.prototype, ['getStyle', 'getComputedStyle', 'setStyle', 'setStyles']);","})(Y);","","","}, '3.7.2', {\"requires\": [\"dom-style\", \"node-base\"]});"];+_yuitest_coverage["build/node-style/node-style.js"].code=["YUI.add('node-style', function (Y, NAME) {","","(function(Y) {","/**"," * Extended Node interface for managing node styles."," * @module node"," * @submodule node-style"," */","","Y.mix(Y.Node.prototype, {"," /**"," * Sets a style property of the node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyle"," * @param {String} attr The style attribute to set. "," * @param {String|Number} val The value. "," * @chainable"," */"," setStyle: function(attr, val) {"," Y.DOM.setStyle(this._node, attr, val);"," return this;"," },",""," /**"," * Sets multiple style properties on the node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyles"," * @param {Object} hash An object literal of property:value pairs. "," * @chainable"," */"," setStyles: function(hash) {"," Y.DOM.setStyles(this._node, hash);"," return this;"," },",""," /**"," * Returns the style's current value."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getStyle"," * @for Node"," * @param {String} attr The style attribute to retrieve. "," * @return {String} The current value of the style property for the element."," */",""," getStyle: function(attr) {"," return Y.DOM.getStyle(this._node, attr);"," },",""," /**"," * Returns the computed value for the given style property."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getComputedStyle"," * @param {String} attr The style attribute to retrieve. "," * @return {String} The computed value of the style property for the element."," */"," getComputedStyle: function(attr) {"," return Y.DOM.getComputedStyle(this._node, attr);"," }","});","","/**"," * Returns an array of values for each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getStyle"," * @for NodeList"," * @see Node.getStyle"," * @param {String} attr The style attribute to retrieve. "," * @return {Array} The current values of the style property for the element."," */","","/**"," * Returns an array of the computed value for each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method getComputedStyle"," * @see Node.getComputedStyle"," * @param {String} attr The style attribute to retrieve. "," * @return {Array} The computed values for each node."," */","","/**"," * Sets a style property on each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyle"," * @see Node.setStyle"," * @param {String} attr The style attribute to set. "," * @param {String|Number} val The value. "," * @chainable"," */","","/**"," * Sets multiple style properties on each node."," * Use camelCase (e.g. 'backgroundColor') for multi-word properties."," * @method setStyles"," * @see Node.setStyles"," * @param {Object} hash An object literal of property:value pairs. "," * @chainable"," */","","// These are broken out to handle undefined return (avoid false positive for","// chainable)","","Y.NodeList.importMethod(Y.Node.prototype, ['getStyle', 'getComputedStyle', 'setStyle', 'setStyles']);","})(Y);","","","}, '3.7.3', {\"requires\": [\"dom-style\", \"node-base\"]});"]; _yuitest_coverage["build/node-style/node-style.js"].lines = {"1":0,"3":0,"10":0,"20":0,"21":0,"32":0,"33":0,"46":0,"57":0,"102":0}; _yuitest_coverage["build/node-style/node-style.js"].functions = {"setStyle:19":0,"setStyles:31":0,"getStyle:45":0,"getComputedStyle:56":0,"(anonymous 2):3":0,"(anonymous 1):1":0}; _yuitest_coverage["build/node-style/node-style.js"].coveredLines = 10;@@ -158,4 +158,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style", "node-base"]});+}, '3.7.3', {"requires": ["dom-style", "node-base"]});
bundle/node-style/node-style-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style", "node-base"]});+}, '3.7.3', {"requires": ["dom-style", "node-base"]});
bundle/node-style/node-style-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("node-style",function(e,t){(function(e){e.mix(e.Node.prototype,{setStyle:function(t,n){return e.DOM.setStyle(this._node,t,n),this},setStyles:function(t){return e.DOM.setStyles(this._node,t),this},getStyle:function(t){return e.DOM.getStyle(this._node,t)},getComputedStyle:function(t){return e.DOM.getComputedStyle(this._node,t)}}),e.NodeList.importMethod(e.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"])})(e)},"3.7.2",{requires:["dom-style","node-base"]});+YUI.add("node-style",function(e,t){(function(e){e.mix(e.Node.prototype,{setStyle:function(t,n){return e.DOM.setStyle(this._node,t,n),this},setStyles:function(t){return e.DOM.setStyles(this._node,t),this},getStyle:function(t){return e.DOM.getStyle(this._node,t)},getComputedStyle:function(t){return e.DOM.getComputedStyle(this._node,t)}}),e.NodeList.importMethod(e.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"])})(e)},"3.7.3",{requires:["dom-style","node-base"]});
bundle/node-style/node-style.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style", "node-base"]});+}, '3.7.3', {"requires": ["dom-style", "node-base"]});
bundle/oop/oop-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/oop/oop.js", code: [] };-_yuitest_coverage["build/oop/oop.js"].code=["YUI.add('oop', function (Y, NAME) {","","/**","Adds object inheritance and manipulation utilities to the YUI instance. This","module is required by most YUI components.","","@module oop","**/","","var L = Y.Lang,"," A = Y.Array,"," OP = Object.prototype,"," CLONE_MARKER = '_~yuim~_',",""," hasOwn = OP.hasOwnProperty,"," toString = OP.toString;","","function dispatch(o, f, c, proto, action) {"," if (o && o[action] && o !== Y) {"," return o[action].call(o, f, c);"," } else {"," switch (A.test(o)) {"," case 1:"," return A[action](o, f, c);"," case 2:"," return A[action](Y.Array(o, 0, true), f, c);"," default:"," return Y.Object[action](o, f, c, proto);"," }"," }","}","","/**","Augments the _receiver_ with prototype properties from the _supplier_. The","receiver may be a constructor function or an object. The supplier must be a","constructor function.","","If the _receiver_ is an object, then the _supplier_ constructor will be called","immediately after _receiver_ is augmented, with _receiver_ as the `this` object.","","If the _receiver_ is a constructor function, then all prototype methods of","_supplier_ that are copied to _receiver_ will be sequestered, and the","_supplier_ constructor will not be called immediately. The first time any","sequestered method is called on the _receiver_'s prototype, all sequestered","methods will be immediately copied to the _receiver_'s prototype, the","_supplier_'s constructor will be executed, and finally the newly unsequestered","method that was called will be executed.","","This sequestering logic sounds like a bunch of complicated voodoo, but it makes","it cheap to perform frequent augmentation by ensuring that suppliers'","constructors are only called if a supplied method is actually used. If none of","the supplied methods is ever used, then there's no need to take the performance","hit of calling the _supplier_'s constructor.","","@method augment","@param {Function|Object} receiver Object or function to be augmented.","@param {Function} supplier Function that supplies the prototype properties with"," which to augment the _receiver_.","@param {Boolean} [overwrite=false] If `true`, properties already on the receiver"," will be overwritten if found on the supplier's prototype.","@param {String[]} [whitelist] An array of property names. If specified,"," only the whitelisted prototype properties will be applied to the receiver, and"," all others will be ignored.","@param {Array|any} [args] Argument or array of arguments to pass to the"," supplier's constructor when initializing.","@return {Function} Augmented object.","@for YUI","**/","Y.augment = function (receiver, supplier, overwrite, whitelist, args) {"," var rProto = receiver.prototype,"," sequester = rProto && supplier,"," sProto = supplier.prototype,"," to = rProto || receiver,",""," copy,"," newPrototype,"," replacements,"," sequestered,"," unsequester;",""," args = args ? Y.Array(args) : [];",""," if (sequester) {"," newPrototype = {};"," replacements = {};"," sequestered = {};",""," copy = function (value, key) {"," if (overwrite || !(key in rProto)) {"," if (toString.call(value) === '[object Function]') {"," sequestered[key] = value;",""," newPrototype[key] = replacements[key] = function () {"," return unsequester(this, value, arguments);"," };"," } else {"," newPrototype[key] = value;"," }"," }"," };",""," unsequester = function (instance, fn, fnArgs) {"," // Unsequester all sequestered functions."," for (var key in sequestered) {"," if (hasOwn.call(sequestered, key)"," && instance[key] === replacements[key]) {",""," instance[key] = sequestered[key];"," }"," }",""," // Execute the supplier constructor."," supplier.apply(instance, args);",""," // Finally, execute the original sequestered function."," return fn.apply(instance, fnArgs);"," };",""," if (whitelist) {"," Y.Array.each(whitelist, function (name) {"," if (name in sProto) {"," copy(sProto[name], name);"," }"," });"," } else {"," Y.Object.each(sProto, copy, null, true);"," }"," }",""," Y.mix(to, newPrototype || sProto, overwrite, whitelist);",""," if (!sequester) {"," supplier.apply(to, args);"," }",""," return receiver;","};","","/**"," * Copies object properties from the supplier to the receiver. If the target has"," * the property, and the property is an object, the target object will be"," * augmented with the supplier's value."," *"," * @method aggregate"," * @param {Object} receiver Object to receive the augmentation."," * @param {Object} supplier Object that supplies the properties with which to"," * augment the receiver."," * @param {Boolean} [overwrite=false] If `true`, properties already on the receiver"," * will be overwritten if found on the supplier."," * @param {String[]} [whitelist] Whitelist. If supplied, only properties in this"," * list will be applied to the receiver."," * @return {Object} Augmented object."," */","Y.aggregate = function(r, s, ov, wl) {"," return Y.mix(r, s, ov, wl, 0, true);","};","","/**"," * Utility to set up the prototype, constructor and superclass properties to"," * support an inheritance strategy that can chain constructors and methods."," * Static members will not be inherited."," *"," * @method extend"," * @param {function} r the object to modify."," * @param {function} s the object to inherit."," * @param {object} px prototype properties to add/override."," * @param {object} sx static properties to add/override."," * @return {object} the extended object."," */","Y.extend = function(r, s, px, sx) {"," if (!s || !r) {"," Y.error('extend failed, verify dependencies');"," }",""," var sp = s.prototype, rp = Y.Object(sp);"," r.prototype = rp;",""," rp.constructor = r;"," r.superclass = sp;",""," // assign constructor property"," if (s != Object && sp.constructor == OP.constructor) {"," sp.constructor = s;"," }",""," // add prototype overrides"," if (px) {"," Y.mix(rp, px, true);"," }",""," // add object overrides"," if (sx) {"," Y.mix(r, sx, true);"," }",""," return r;","};","","/**"," * Executes the supplied function for each item in"," * a collection. Supports arrays, objects, and"," * NodeLists"," * @method each"," * @param {object} o the object to iterate."," * @param {function} f the function to execute. This function"," * receives the value, key, and object as parameters."," * @param {object} c the execution context for the function."," * @param {boolean} proto if true, prototype properties are"," * iterated on objects."," * @return {YUI} the YUI instance."," */","Y.each = function(o, f, c, proto) {"," return dispatch(o, f, c, proto, 'each');","};","","/**"," * Executes the supplied function for each item in"," * a collection. The operation stops if the function"," * returns true. Supports arrays, objects, and"," * NodeLists."," * @method some"," * @param {object} o the object to iterate."," * @param {function} f the function to execute. This function"," * receives the value, key, and object as parameters."," * @param {object} c the execution context for the function."," * @param {boolean} proto if true, prototype properties are"," * iterated on objects."," * @return {boolean} true if the function ever returns true,"," * false otherwise."," */","Y.some = function(o, f, c, proto) {"," return dispatch(o, f, c, proto, 'some');","};","","/**"," * Deep object/array copy. Function clones are actually"," * wrappers around the original function."," * Array-like objects are treated as arrays."," * Primitives are returned untouched. Optionally, a"," * function can be provided to handle other data types,"," * filter keys, validate values, etc."," *"," * NOTE: Cloning a non-trivial object is a reasonably heavy operation, due to"," * the need to recurrsively iterate down non-primitive properties. Clone"," * should be used only when a deep clone down to leaf level properties"," * is explicitly required."," *"," * In many cases (for example, when trying to isolate objects used as "," * hashes for configuration properties), a shallow copy, using Y.merge is "," * normally sufficient. If more than one level of isolation is required, "," * Y.merge can be used selectively at each level which needs to be "," * isolated from the original without going all the way to leaf properties."," *"," * @method clone"," * @param {object} o what to clone."," * @param {boolean} safe if true, objects will not have prototype"," * items from the source. If false, they will. In this case, the"," * original is initially protected, but the clone is not completely"," * immune from changes to the source object prototype. Also, cloned"," * prototype items that are deleted from the clone will result"," * in the value of the source prototype being exposed. If operating"," * on a non-safe clone, items should be nulled out rather than deleted."," * @param {function} f optional function to apply to each item in a"," * collection; it will be executed prior to applying the value to"," * the new object. Return false to prevent the copy."," * @param {object} c optional execution context for f."," * @param {object} owner Owner object passed when clone is iterating"," * an object. Used to set up context for cloned functions."," * @param {object} cloned hash of previously cloned objects to avoid"," * multiple clones."," * @return {Array|Object} the cloned object."," */","Y.clone = function(o, safe, f, c, owner, cloned) {",""," if (!L.isObject(o)) {"," return o;"," }",""," // @todo cloning YUI instances doesn't currently work"," if (Y.instanceOf(o, YUI)) {"," return o;"," }",""," var o2, marked = cloned || {}, stamp,"," yeach = Y.each;",""," switch (L.type(o)) {"," case 'date':"," return new Date(o);"," case 'regexp':"," // if we do this we need to set the flags too"," // return new RegExp(o.source);"," return o;"," case 'function':"," // o2 = Y.bind(o, owner);"," // break;"," return o;"," case 'array':"," o2 = [];"," break;"," default:",""," // #2528250 only one clone of a given object should be created."," if (o[CLONE_MARKER]) {"," return marked[o[CLONE_MARKER]];"," }",""," stamp = Y.guid();",""," o2 = (safe) ? {} : Y.Object(o);",""," o[CLONE_MARKER] = stamp;"," marked[stamp] = o;"," }",""," // #2528250 don't try to clone element properties"," if (!o.addEventListener && !o.attachEvent) {"," yeach(o, function(v, k) {","if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {"," if (k !== CLONE_MARKER) {"," if (k == 'prototype') {"," // skip the prototype"," // } else if (o[k] === o) {"," // this[k] = this;"," } else {"," this[k] ="," Y.clone(v, safe, f, c, owner || o, marked);"," }"," }"," }"," }, o2);"," }",""," if (!cloned) {"," Y.Object.each(marked, function(v, k) {"," if (v[CLONE_MARKER]) {"," try {"," delete v[CLONE_MARKER];"," } catch (e) {"," v[CLONE_MARKER] = null;"," }"," }"," }, this);"," marked = null;"," }",""," return o2;","};","","","/**"," * Returns a function that will execute the supplied function in the"," * supplied object's context, optionally adding any additional"," * supplied parameters to the beginning of the arguments collection the"," * supplied to the function."," *"," * @method bind"," * @param {Function|String} f the function to bind, or a function name"," * to execute on the context object."," * @param {object} c the execution context."," * @param {any} args* 0..n arguments to include before the arguments the"," * function is executed with."," * @return {function} the wrapped function."," */","Y.bind = function(f, c) {"," var xargs = arguments.length > 2 ?"," Y.Array(arguments, 2, true) : null;"," return function() {"," var fn = L.isString(f) ? c[f] : f,"," args = (xargs) ?"," xargs.concat(Y.Array(arguments, 0, true)) : arguments;"," return fn.apply(c || fn, args);"," };","};","","/**"," * Returns a function that will execute the supplied function in the"," * supplied object's context, optionally adding any additional"," * supplied parameters to the end of the arguments the function"," * is executed with."," *"," * @method rbind"," * @param {Function|String} f the function to bind, or a function name"," * to execute on the context object."," * @param {object} c the execution context."," * @param {any} args* 0..n arguments to append to the end of"," * arguments collection supplied to the function."," * @return {function} the wrapped function."," */","Y.rbind = function(f, c) {"," var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null;"," return function() {"," var fn = L.isString(f) ? c[f] : f,"," args = (xargs) ?"," Y.Array(arguments, 0, true).concat(xargs) : arguments;"," return fn.apply(c || fn, args);"," };","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/oop/oop.js"].code=["YUI.add('oop', function (Y, NAME) {","","/**","Adds object inheritance and manipulation utilities to the YUI instance. This","module is required by most YUI components.","","@module oop","**/","","var L = Y.Lang,"," A = Y.Array,"," OP = Object.prototype,"," CLONE_MARKER = '_~yuim~_',",""," hasOwn = OP.hasOwnProperty,"," toString = OP.toString;","","function dispatch(o, f, c, proto, action) {"," if (o && o[action] && o !== Y) {"," return o[action].call(o, f, c);"," } else {"," switch (A.test(o)) {"," case 1:"," return A[action](o, f, c);"," case 2:"," return A[action](Y.Array(o, 0, true), f, c);"," default:"," return Y.Object[action](o, f, c, proto);"," }"," }","}","","/**","Augments the _receiver_ with prototype properties from the _supplier_. The","receiver may be a constructor function or an object. The supplier must be a","constructor function.","","If the _receiver_ is an object, then the _supplier_ constructor will be called","immediately after _receiver_ is augmented, with _receiver_ as the `this` object.","","If the _receiver_ is a constructor function, then all prototype methods of","_supplier_ that are copied to _receiver_ will be sequestered, and the","_supplier_ constructor will not be called immediately. The first time any","sequestered method is called on the _receiver_'s prototype, all sequestered","methods will be immediately copied to the _receiver_'s prototype, the","_supplier_'s constructor will be executed, and finally the newly unsequestered","method that was called will be executed.","","This sequestering logic sounds like a bunch of complicated voodoo, but it makes","it cheap to perform frequent augmentation by ensuring that suppliers'","constructors are only called if a supplied method is actually used. If none of","the supplied methods is ever used, then there's no need to take the performance","hit of calling the _supplier_'s constructor.","","@method augment","@param {Function|Object} receiver Object or function to be augmented.","@param {Function} supplier Function that supplies the prototype properties with"," which to augment the _receiver_.","@param {Boolean} [overwrite=false] If `true`, properties already on the receiver"," will be overwritten if found on the supplier's prototype.","@param {String[]} [whitelist] An array of property names. If specified,"," only the whitelisted prototype properties will be applied to the receiver, and"," all others will be ignored.","@param {Array|any} [args] Argument or array of arguments to pass to the"," supplier's constructor when initializing.","@return {Function} Augmented object.","@for YUI","**/","Y.augment = function (receiver, supplier, overwrite, whitelist, args) {"," var rProto = receiver.prototype,"," sequester = rProto && supplier,"," sProto = supplier.prototype,"," to = rProto || receiver,",""," copy,"," newPrototype,"," replacements,"," sequestered,"," unsequester;",""," args = args ? Y.Array(args) : [];",""," if (sequester) {"," newPrototype = {};"," replacements = {};"," sequestered = {};",""," copy = function (value, key) {"," if (overwrite || !(key in rProto)) {"," if (toString.call(value) === '[object Function]') {"," sequestered[key] = value;",""," newPrototype[key] = replacements[key] = function () {"," return unsequester(this, value, arguments);"," };"," } else {"," newPrototype[key] = value;"," }"," }"," };",""," unsequester = function (instance, fn, fnArgs) {"," // Unsequester all sequestered functions."," for (var key in sequestered) {"," if (hasOwn.call(sequestered, key)"," && instance[key] === replacements[key]) {",""," instance[key] = sequestered[key];"," }"," }",""," // Execute the supplier constructor."," supplier.apply(instance, args);",""," // Finally, execute the original sequestered function."," return fn.apply(instance, fnArgs);"," };",""," if (whitelist) {"," Y.Array.each(whitelist, function (name) {"," if (name in sProto) {"," copy(sProto[name], name);"," }"," });"," } else {"," Y.Object.each(sProto, copy, null, true);"," }"," }",""," Y.mix(to, newPrototype || sProto, overwrite, whitelist);",""," if (!sequester) {"," supplier.apply(to, args);"," }",""," return receiver;","};","","/**"," * Copies object properties from the supplier to the receiver. If the target has"," * the property, and the property is an object, the target object will be"," * augmented with the supplier's value."," *"," * @method aggregate"," * @param {Object} receiver Object to receive the augmentation."," * @param {Object} supplier Object that supplies the properties with which to"," * augment the receiver."," * @param {Boolean} [overwrite=false] If `true`, properties already on the receiver"," * will be overwritten if found on the supplier."," * @param {String[]} [whitelist] Whitelist. If supplied, only properties in this"," * list will be applied to the receiver."," * @return {Object} Augmented object."," */","Y.aggregate = function(r, s, ov, wl) {"," return Y.mix(r, s, ov, wl, 0, true);","};","","/**"," * Utility to set up the prototype, constructor and superclass properties to"," * support an inheritance strategy that can chain constructors and methods."," * Static members will not be inherited."," *"," * @method extend"," * @param {function} r the object to modify."," * @param {function} s the object to inherit."," * @param {object} px prototype properties to add/override."," * @param {object} sx static properties to add/override."," * @return {object} the extended object."," */","Y.extend = function(r, s, px, sx) {"," if (!s || !r) {"," Y.error('extend failed, verify dependencies');"," }",""," var sp = s.prototype, rp = Y.Object(sp);"," r.prototype = rp;",""," rp.constructor = r;"," r.superclass = sp;",""," // assign constructor property"," if (s != Object && sp.constructor == OP.constructor) {"," sp.constructor = s;"," }",""," // add prototype overrides"," if (px) {"," Y.mix(rp, px, true);"," }",""," // add object overrides"," if (sx) {"," Y.mix(r, sx, true);"," }",""," return r;","};","","/**"," * Executes the supplied function for each item in"," * a collection. Supports arrays, objects, and"," * NodeLists"," * @method each"," * @param {object} o the object to iterate."," * @param {function} f the function to execute. This function"," * receives the value, key, and object as parameters."," * @param {object} c the execution context for the function."," * @param {boolean} proto if true, prototype properties are"," * iterated on objects."," * @return {YUI} the YUI instance."," */","Y.each = function(o, f, c, proto) {"," return dispatch(o, f, c, proto, 'each');","};","","/**"," * Executes the supplied function for each item in"," * a collection. The operation stops if the function"," * returns true. Supports arrays, objects, and"," * NodeLists."," * @method some"," * @param {object} o the object to iterate."," * @param {function} f the function to execute. This function"," * receives the value, key, and object as parameters."," * @param {object} c the execution context for the function."," * @param {boolean} proto if true, prototype properties are"," * iterated on objects."," * @return {boolean} true if the function ever returns true,"," * false otherwise."," */","Y.some = function(o, f, c, proto) {"," return dispatch(o, f, c, proto, 'some');","};","","/**"," * Deep object/array copy. Function clones are actually"," * wrappers around the original function."," * Array-like objects are treated as arrays."," * Primitives are returned untouched. Optionally, a"," * function can be provided to handle other data types,"," * filter keys, validate values, etc."," *"," * NOTE: Cloning a non-trivial object is a reasonably heavy operation, due to"," * the need to recurrsively iterate down non-primitive properties. Clone"," * should be used only when a deep clone down to leaf level properties"," * is explicitly required."," *"," * In many cases (for example, when trying to isolate objects used as "," * hashes for configuration properties), a shallow copy, using Y.merge is "," * normally sufficient. If more than one level of isolation is required, "," * Y.merge can be used selectively at each level which needs to be "," * isolated from the original without going all the way to leaf properties."," *"," * @method clone"," * @param {object} o what to clone."," * @param {boolean} safe if true, objects will not have prototype"," * items from the source. If false, they will. In this case, the"," * original is initially protected, but the clone is not completely"," * immune from changes to the source object prototype. Also, cloned"," * prototype items that are deleted from the clone will result"," * in the value of the source prototype being exposed. If operating"," * on a non-safe clone, items should be nulled out rather than deleted."," * @param {function} f optional function to apply to each item in a"," * collection; it will be executed prior to applying the value to"," * the new object. Return false to prevent the copy."," * @param {object} c optional execution context for f."," * @param {object} owner Owner object passed when clone is iterating"," * an object. Used to set up context for cloned functions."," * @param {object} cloned hash of previously cloned objects to avoid"," * multiple clones."," * @return {Array|Object} the cloned object."," */","Y.clone = function(o, safe, f, c, owner, cloned) {",""," if (!L.isObject(o)) {"," return o;"," }",""," // @todo cloning YUI instances doesn't currently work"," if (Y.instanceOf(o, YUI)) {"," return o;"," }",""," var o2, marked = cloned || {}, stamp,"," yeach = Y.each;",""," switch (L.type(o)) {"," case 'date':"," return new Date(o);"," case 'regexp':"," // if we do this we need to set the flags too"," // return new RegExp(o.source);"," return o;"," case 'function':"," // o2 = Y.bind(o, owner);"," // break;"," return o;"," case 'array':"," o2 = [];"," break;"," default:",""," // #2528250 only one clone of a given object should be created."," if (o[CLONE_MARKER]) {"," return marked[o[CLONE_MARKER]];"," }",""," stamp = Y.guid();",""," o2 = (safe) ? {} : Y.Object(o);",""," o[CLONE_MARKER] = stamp;"," marked[stamp] = o;"," }",""," // #2528250 don't try to clone element properties"," if (!o.addEventListener && !o.attachEvent) {"," yeach(o, function(v, k) {","if ((k || k === 0) && (!f || (f.call(c || this, v, k, this, o) !== false))) {"," if (k !== CLONE_MARKER) {"," if (k == 'prototype') {"," // skip the prototype"," // } else if (o[k] === o) {"," // this[k] = this;"," } else {"," this[k] ="," Y.clone(v, safe, f, c, owner || o, marked);"," }"," }"," }"," }, o2);"," }",""," if (!cloned) {"," Y.Object.each(marked, function(v, k) {"," if (v[CLONE_MARKER]) {"," try {"," delete v[CLONE_MARKER];"," } catch (e) {"," v[CLONE_MARKER] = null;"," }"," }"," }, this);"," marked = null;"," }",""," return o2;","};","","","/**"," * Returns a function that will execute the supplied function in the"," * supplied object's context, optionally adding any additional"," * supplied parameters to the beginning of the arguments collection the"," * supplied to the function."," *"," * @method bind"," * @param {Function|String} f the function to bind, or a function name"," * to execute on the context object."," * @param {object} c the execution context."," * @param {any} args* 0..n arguments to include before the arguments the"," * function is executed with."," * @return {function} the wrapped function."," */","Y.bind = function(f, c) {"," var xargs = arguments.length > 2 ?"," Y.Array(arguments, 2, true) : null;"," return function() {"," var fn = L.isString(f) ? c[f] : f,"," args = (xargs) ?"," xargs.concat(Y.Array(arguments, 0, true)) : arguments;"," return fn.apply(c || fn, args);"," };","};","","/**"," * Returns a function that will execute the supplied function in the"," * supplied object's context, optionally adding any additional"," * supplied parameters to the end of the arguments the function"," * is executed with."," *"," * @method rbind"," * @param {Function|String} f the function to bind, or a function name"," * to execute on the context object."," * @param {object} c the execution context."," * @param {any} args* 0..n arguments to append to the end of"," * arguments collection supplied to the function."," * @return {function} the wrapped function."," */","Y.rbind = function(f, c) {"," var xargs = arguments.length > 2 ? Y.Array(arguments, 2, true) : null;"," return function() {"," var fn = L.isString(f) ? c[f] : f,"," args = (xargs) ?"," Y.Array(arguments, 0, true).concat(xargs) : arguments;"," return fn.apply(c || fn, args);"," };","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/oop/oop.js"].lines = {"1":0,"10":0,"18":0,"19":0,"20":0,"22":0,"24":0,"26":0,"28":0,"69":0,"70":0,"81":0,"83":0,"84":0,"85":0,"86":0,"88":0,"89":0,"90":0,"91":0,"93":0,"94":0,"97":0,"102":0,"104":0,"105":0,"108":0,"113":0,"116":0,"119":0,"120":0,"121":0,"122":0,"126":0,"130":0,"132":0,"133":0,"136":0,"154":0,"155":0,"170":0,"171":0,"172":0,"175":0,"176":0,"178":0,"179":0,"182":0,"183":0,"187":0,"188":0,"192":0,"193":0,"196":0,"212":0,"213":0,"231":0,"232":0,"273":0,"275":0,"276":0,"280":0,"281":0,"284":0,"287":0,"289":0,"293":0,"297":0,"299":0,"300":0,"304":0,"305":0,"308":0,"310":0,"312":0,"313":0,"317":0,"318":0,"319":0,"320":0,"321":0,"326":0,"334":0,"335":0,"336":0,"337":0,"338":0,"340":0,"344":0,"347":0,"365":0,"366":0,"368":0,"369":0,"372":0,"390":0,"391":0,"392":0,"393":0,"396":0}; _yuitest_coverage["build/oop/oop.js"].functions = {"dispatch:18":0,"]:93":0,"copy:88":0,"unsequester:102":0,"(anonymous 2):120":0,"augment:69":0,"aggregate:154":0,"extend:170":0,"each:212":0,"some:231":0,"(anonymous 3):318":0,"(anonymous 4):335":0,"clone:273":0,"(anonymous 5):368":0,"bind:365":0,"(anonymous 6):392":0,"rbind:390":0,"(anonymous 1):1":0}; _yuitest_coverage["build/oop/oop.js"].coveredLines = 100;@@ -555,4 +555,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/oop/oop-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -404,4 +404,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/oop/oop-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("oop",function(e,t){function a(t,n,i,s,o){if(t&&t[o]&&t!==e)return t[o].call(t,n,i);switch(r.test(t)){case 1:return r[o](t,n,i);case 2:return r[o](e.Array(t,0,!0),n,i);default:return e.Object[o](t,n,i,s)}}var n=e.Lang,r=e.Array,i=Object.prototype,s="_~yuim~_",o=i.hasOwnProperty,u=i.toString;e.augment=function(t,n,r,i,s){var a=t.prototype,f=a&&n,l=n.prototype,c=a||t,h,p,d,v,m;return s=s?e.Array(s):[],f&&(p={},d={},v={},h=function(e,t){if(r||!(t in a))u.call(e)==="[object Function]"?(v[t]=e,p[t]=d[t]=function(){return m(this,e,arguments)}):p[t]=e},m=function(e,t,r){for(var i in v)o.call(v,i)&&e[i]===d[i]&&(e[i]=v[i]);return n.apply(e,s),t.apply(e,r)},i?e.Array.each(i,function(e){e in l&&h(l[e],e)}):e.Object.each(l,h,null,!0)),e.mix(c,p||l,r,i),f||n.apply(c,s),t},e.aggregate=function(t,n,r,i){return e.mix(t,n,r,i,0,!0)},e.extend=function(t,n,r,s){(!n||!t)&&e.error("extend failed, verify dependencies");var o=n.prototype,u=e.Object(o);return t.prototype=u,u.constructor=t,t.superclass=o,n!=Object&&o.constructor==i.constructor&&(o.constructor=n),r&&e.mix(u,r,!0),s&&e.mix(t,s,!0),t},e.each=function(e,t,n,r){return a(e,t,n,r,"each")},e.some=function(e,t,n,r){return a(e,t,n,r,"some")},e.clone=function(t,r,i,o,u,a){if(!n.isObject(t))return t;if(e.instanceOf(t,YUI))return t;var f,l=a||{},c,h=e.each;switch(n.type(t)){case"date":return new Date(t);case"regexp":return t;case"function":return t;case"array":f=[];break;default:if(t[s])return l[t[s]];c=e.guid(),f=r?{}:e.Object(t),t[s]=c,l[c]=t}return!t.addEventListener&&!t.attachEvent&&h(t,function(n,a){(a||a===0)&&(!i||i.call(o||this,n,a,this,t)!==!1)&&a!==s&&a!="prototype"&&(this[a]=e.clone(n,r,i,o,u||t,l))},f),a||(e.Object.each(l,function(e,t){if(e[s])try{delete e[s]}catch(n){e[s]=null}},this),l=null),f},e.bind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?i.concat(e.Array(arguments,0,!0)):arguments;return s.apply(r||s,o)}},e.rbind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?e.Array(arguments,0,!0).concat(i):arguments;return s.apply(r||s,o)}}},"3.7.2",{requires:["yui-base"]});+YUI.add("oop",function(e,t){function a(t,n,i,s,o){if(t&&t[o]&&t!==e)return t[o].call(t,n,i);switch(r.test(t)){case 1:return r[o](t,n,i);case 2:return r[o](e.Array(t,0,!0),n,i);default:return e.Object[o](t,n,i,s)}}var n=e.Lang,r=e.Array,i=Object.prototype,s="_~yuim~_",o=i.hasOwnProperty,u=i.toString;e.augment=function(t,n,r,i,s){var a=t.prototype,f=a&&n,l=n.prototype,c=a||t,h,p,d,v,m;return s=s?e.Array(s):[],f&&(p={},d={},v={},h=function(e,t){if(r||!(t in a))u.call(e)==="[object Function]"?(v[t]=e,p[t]=d[t]=function(){return m(this,e,arguments)}):p[t]=e},m=function(e,t,r){for(var i in v)o.call(v,i)&&e[i]===d[i]&&(e[i]=v[i]);return n.apply(e,s),t.apply(e,r)},i?e.Array.each(i,function(e){e in l&&h(l[e],e)}):e.Object.each(l,h,null,!0)),e.mix(c,p||l,r,i),f||n.apply(c,s),t},e.aggregate=function(t,n,r,i){return e.mix(t,n,r,i,0,!0)},e.extend=function(t,n,r,s){(!n||!t)&&e.error("extend failed, verify dependencies");var o=n.prototype,u=e.Object(o);return t.prototype=u,u.constructor=t,t.superclass=o,n!=Object&&o.constructor==i.constructor&&(o.constructor=n),r&&e.mix(u,r,!0),s&&e.mix(t,s,!0),t},e.each=function(e,t,n,r){return a(e,t,n,r,"each")},e.some=function(e,t,n,r){return a(e,t,n,r,"some")},e.clone=function(t,r,i,o,u,a){if(!n.isObject(t))return t;if(e.instanceOf(t,YUI))return t;var f,l=a||{},c,h=e.each;switch(n.type(t)){case"date":return new Date(t);case"regexp":return t;case"function":return t;case"array":f=[];break;default:if(t[s])return l[t[s]];c=e.guid(),f=r?{}:e.Object(t),t[s]=c,l[c]=t}return!t.addEventListener&&!t.attachEvent&&h(t,function(n,a){(a||a===0)&&(!i||i.call(o||this,n,a,this,t)!==!1)&&a!==s&&a!="prototype"&&(this[a]=e.clone(n,r,i,o,u||t,l))},f),a||(e.Object.each(l,function(e,t){if(e[s])try{delete e[s]}catch(n){e[s]=null}},this),l=null),f},e.bind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?i.concat(e.Array(arguments,0,!0)):arguments;return s.apply(r||s,o)}},e.rbind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?e.Array(arguments,0,!0).concat(i):arguments;return s.apply(r||s,o)}}},"3.7.3",{requires:["yui-base"]});
bundle/oop/oop.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -404,4 +404,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/overlay/assets/overlay-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/overlay/assets/skins/night/overlay-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/overlay/assets/skins/night/overlay.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/overlay/assets/skins/sam/overlay-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/overlay/assets/skins/sam/overlay.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/overlay/overlay-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/overlay/overlay.js", code: [] };-_yuitest_coverage["build/overlay/overlay.js"].code=["YUI.add('overlay', function (Y, NAME) {","","/**"," * Provides a basic Overlay widget, with Standard Module content support. The Overlay widget"," * provides Page XY positioning support, alignment and centering support along with basic "," * stackable support (z-index and shimming)."," *"," * @module overlay"," */","","/**"," * A basic Overlay Widget, which can be positioned based on Page XY co-ordinates and is stackable (z-index support)."," * It also provides alignment and centering support and uses a standard module format for it's content, with header,"," * body and footer section support."," *"," * @class Overlay"," * @constructor"," * @extends Widget"," * @uses WidgetStdMod"," * @uses WidgetPosition"," * @uses WidgetStack"," * @uses WidgetPositionAlign"," * @uses WidgetPositionConstrain"," * @param {Object} object The user configuration for the instance."," */","Y.Overlay = Y.Base.create(\"overlay\", Y.Widget, [Y.WidgetStdMod, Y.WidgetPosition, Y.WidgetStack, Y.WidgetPositionAlign, Y.WidgetPositionConstrain]);","","","}, '3.7.2', {\"requires\": [\"widget\", \"widget-stdmod\", \"widget-position\", \"widget-position-align\", \"widget-stack\", \"widget-position-constrain\"], \"skinnable\": true});"];+_yuitest_coverage["build/overlay/overlay.js"].code=["YUI.add('overlay', function (Y, NAME) {","","/**"," * Provides a basic Overlay widget, with Standard Module content support. The Overlay widget"," * provides Page XY positioning support, alignment and centering support along with basic "," * stackable support (z-index and shimming)."," *"," * @module overlay"," */","","/**"," * A basic Overlay Widget, which can be positioned based on Page XY co-ordinates and is stackable (z-index support)."," * It also provides alignment and centering support and uses a standard module format for it's content, with header,"," * body and footer section support."," *"," * @class Overlay"," * @constructor"," * @extends Widget"," * @uses WidgetStdMod"," * @uses WidgetPosition"," * @uses WidgetStack"," * @uses WidgetPositionAlign"," * @uses WidgetPositionConstrain"," * @param {Object} object The user configuration for the instance."," */","Y.Overlay = Y.Base.create(\"overlay\", Y.Widget, [Y.WidgetStdMod, Y.WidgetPosition, Y.WidgetStack, Y.WidgetPositionAlign, Y.WidgetPositionConstrain]);","","","}, '3.7.3', {\"requires\": [\"widget\", \"widget-stdmod\", \"widget-position\", \"widget-position-align\", \"widget-stack\", \"widget-position-constrain\"], \"skinnable\": true});"]; _yuitest_coverage["build/overlay/overlay.js"].lines = {"1":0,"26":0}; _yuitest_coverage["build/overlay/overlay.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/overlay/overlay.js"].coveredLines = 2;@@ -68,4 +68,4 @@ Y.Overlay = Y.Base.create("overlay", Y.Widget, [Y.WidgetStdMod, Y.WidgetPosition, Y.WidgetStack, Y.WidgetPositionAlign, Y.WidgetPositionConstrain]); -}, '3.7.2', {"requires": ["widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain"], "skinnable": true});
bundle/overlay/overlay-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,4 +32,4 @@ Y.Overlay = Y.Base.create("overlay", Y.Widget, [Y.WidgetStdMod, Y.WidgetPosition, Y.WidgetStack, Y.WidgetPositionAlign, Y.WidgetPositionConstrain]); -}, '3.7.2', {"requires": ["widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain"], "skinnable": true});
bundle/overlay/overlay-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("overlay",function(e,t){e.Overlay=e.Base.create("overlay",e.Widget,[e.WidgetStdMod,e.WidgetPosition,e.WidgetStack,e.WidgetPositionAlign,e.WidgetPositionConstrain])},"3.7.2",{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0});+YUI.add("overlay",function(e,t){e.Overlay=e.Base.create("overlay",e.Widget,[e.WidgetStdMod,e.WidgetPosition,e.WidgetStack,e.WidgetPositionAlign,e.WidgetPositionConstrain])},"3.7.3",{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0});
bundle/overlay/overlay.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,4 +32,4 @@ Y.Overlay = Y.Base.create("overlay", Y.Widget, [Y.WidgetStdMod, Y.WidgetPosition, Y.WidgetStack, Y.WidgetPositionAlign, Y.WidgetPositionConstrain]); -}, '3.7.2', {"requires": ["widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-stdmod", "widget-position", "widget-position-align", "widget-stack", "widget-position-constrain"], "skinnable": true});
bundle/panel/assets/panel-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/panel/assets/skins/night/panel-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/panel/assets/skins/night/panel.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/panel/assets/skins/sam/panel-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/panel/assets/skins/sam/panel.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/panel/panel-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/panel/panel.js", code: [] };-_yuitest_coverage["build/panel/panel.js"].code=["YUI.add('panel', function (Y, NAME) {","","// TODO: Change this description!","/**","Provides a Panel widget, a widget that mimics the functionality of a regular OS","window. Comes with Standard Module support, XY Positioning, Alignment Support,","Stack (z-index) support, modality, auto-focus and auto-hide functionality, and","header/footer button support.","","@module panel","**/","","var getClassName = Y.ClassNameManager.getClassName;","","// TODO: Change this description!","/**","A basic Panel Widget, which can be positioned based on Page XY co-ordinates and","is stackable (z-index support). It also provides alignment and centering support","and uses a standard module format for it's content, with header, body and footer","section support. It can be made modal, and has functionality to hide and focus","on different events. The header and footer sections can be modified to allow for","button support.","","@class Panel","@constructor","@extends Widget","@uses WidgetAutohide","@uses WidgetButtons","@uses WidgetModality","@uses WidgetPosition","@uses WidgetPositionAlign","@uses WidgetPositionConstrain","@uses WidgetStack","@uses WidgetStdMod","@since 3.4.0"," */","Y.Panel = Y.Base.create('panel', Y.Widget, ["," // Other Widget extensions depend on these two."," Y.WidgetPosition,"," Y.WidgetStdMod,",""," Y.WidgetAutohide,"," Y.WidgetButtons,"," Y.WidgetModality,"," Y.WidgetPositionAlign,"," Y.WidgetPositionConstrain,"," Y.WidgetStack","], {"," // -- Public Properties ----------------------------------------------------",""," /**"," Collection of predefined buttons mapped from name => config.",""," Panel includes a \"close\" button which can be use by name. When the close"," button is in the header (which is the default), it will look like: [x].",""," See `addButton()` for a list of possible configuration values.",""," @example"," // Panel with close button in header."," var panel = new Y.Panel({"," buttons: ['close']"," });",""," // Panel with close button in footer."," var otherPanel = new Y.Panel({"," buttons: {"," footer: ['close']"," }"," });",""," @property BUTTONS"," @type Object"," @default {close: {}}"," @since 3.5.0"," **/"," BUTTONS: {"," close: {"," label : 'Close',"," action : 'hide',"," section: 'header',",""," // Uses `type=\"button\"` so the button's default action can still"," // occur but it won't cause things like a form to submit."," template : '<button type=\"button\" />',"," classNames: getClassName('button', 'close')"," }"," }","}, {"," ATTRS: {"," // TODO: API Docs."," buttons: {"," value: ['close']"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"widget\", \"widget-autohide\", \"widget-buttons\", \"widget-modality\", \"widget-position\", \"widget-position-align\", \"widget-position-constrain\", \"widget-stack\", \"widget-stdmod\"], \"skinnable\": true});"];+_yuitest_coverage["build/panel/panel.js"].code=["YUI.add('panel', function (Y, NAME) {","","// TODO: Change this description!","/**","Provides a Panel widget, a widget that mimics the functionality of a regular OS","window. Comes with Standard Module support, XY Positioning, Alignment Support,","Stack (z-index) support, modality, auto-focus and auto-hide functionality, and","header/footer button support.","","@module panel","**/","","var getClassName = Y.ClassNameManager.getClassName;","","// TODO: Change this description!","/**","A basic Panel Widget, which can be positioned based on Page XY co-ordinates and","is stackable (z-index support). It also provides alignment and centering support","and uses a standard module format for it's content, with header, body and footer","section support. It can be made modal, and has functionality to hide and focus","on different events. The header and footer sections can be modified to allow for","button support.","","@class Panel","@constructor","@extends Widget","@uses WidgetAutohide","@uses WidgetButtons","@uses WidgetModality","@uses WidgetPosition","@uses WidgetPositionAlign","@uses WidgetPositionConstrain","@uses WidgetStack","@uses WidgetStdMod","@since 3.4.0"," */","Y.Panel = Y.Base.create('panel', Y.Widget, ["," // Other Widget extensions depend on these two."," Y.WidgetPosition,"," Y.WidgetStdMod,",""," Y.WidgetAutohide,"," Y.WidgetButtons,"," Y.WidgetModality,"," Y.WidgetPositionAlign,"," Y.WidgetPositionConstrain,"," Y.WidgetStack","], {"," // -- Public Properties ----------------------------------------------------",""," /**"," Collection of predefined buttons mapped from name => config.",""," Panel includes a \"close\" button which can be use by name. When the close"," button is in the header (which is the default), it will look like: [x].",""," See `addButton()` for a list of possible configuration values.",""," @example"," // Panel with close button in header."," var panel = new Y.Panel({"," buttons: ['close']"," });",""," // Panel with close button in footer."," var otherPanel = new Y.Panel({"," buttons: {"," footer: ['close']"," }"," });",""," @property BUTTONS"," @type Object"," @default {close: {}}"," @since 3.5.0"," **/"," BUTTONS: {"," close: {"," label : 'Close',"," action : 'hide',"," section: 'header',",""," // Uses `type=\"button\"` so the button's default action can still"," // occur but it won't cause things like a form to submit."," template : '<button type=\"button\" />',"," classNames: getClassName('button', 'close')"," }"," }","}, {"," ATTRS: {"," // TODO: API Docs."," buttons: {"," value: ['close']"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"widget\", \"widget-autohide\", \"widget-buttons\", \"widget-modality\", \"widget-position\", \"widget-position-align\", \"widget-position-constrain\", \"widget-stack\", \"widget-stdmod\"], \"skinnable\": true});"]; _yuitest_coverage["build/panel/panel.js"].lines = {"1":0,"13":0,"37":0}; _yuitest_coverage["build/panel/panel.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/panel/panel.js"].coveredLines = 3;@@ -139,4 +139,4 @@ }); -}, '3.7.2', {"requires": ["widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod"], "skinnable": true});
bundle/panel/panel-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -102,4 +102,4 @@ }); -}, '3.7.2', {"requires": ["widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod"], "skinnable": true});
bundle/panel/panel-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("panel",function(e,t){var n=e.ClassNameManager.getClassName;e.Panel=e.Base.create("panel",e.Widget,[e.WidgetPosition,e.WidgetStdMod,e.WidgetAutohide,e.WidgetButtons,e.WidgetModality,e.WidgetPositionAlign,e.WidgetPositionConstrain,e.WidgetStack],{BUTTONS:{close:{label:"Close",action:"hide",section:"header",template:'<button type="button" />',classNames:n("button","close")}}},{ATTRS:{buttons:{value:["close"]}}})},"3.7.2",{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0});+YUI.add("panel",function(e,t){var n=e.ClassNameManager.getClassName;e.Panel=e.Base.create("panel",e.Widget,[e.WidgetPosition,e.WidgetStdMod,e.WidgetAutohide,e.WidgetButtons,e.WidgetModality,e.WidgetPositionAlign,e.WidgetPositionConstrain,e.WidgetStack],{BUTTONS:{close:{label:"Close",action:"hide",section:"header",template:'<button type="button" />',classNames:n("button","close")}}},{ATTRS:{buttons:{value:["close"]}}})},"3.7.3",{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0});
bundle/panel/panel.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -102,4 +102,4 @@ }); -}, '3.7.2', {"requires": ["widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-autohide", "widget-buttons", "widget-modality", "widget-position", "widget-position-align", "widget-position-constrain", "widget-stack", "widget-stdmod"], "skinnable": true});
bundle/parallel/parallel-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/parallel/parallel.js", code: [] };-_yuitest_coverage["build/parallel/parallel.js"].code=["YUI.add('parallel', function (Y, NAME) {","","","/**","* A concurrent parallel processor to help in running several async functions.","* @module parallel","* @main parallel","*/","","/**","A concurrent parallel processor to help in running several async functions.",""," var stack = new Y.Parallel();",""," for (var i = 0; i < 15; i++) {"," Y.io('./api/json/' + i, {"," on: {"," success: stack.add(function() {"," })"," }"," });"," }",""," stack.done(function() {"," });","","@class Parallel","@param {Object} o A config object","@param {Object} [o.context=Y] The execution context of the callback to done","","","*/","","Y.Parallel = function(o) {"," this.config = o || {};"," this.results = [];"," this.context = this.config.context || Y;"," this.total = 0;"," this.finished = 0;","};","","Y.Parallel.prototype = {"," /**"," * An Array of results from all the callbacks in the stack"," * @property results"," * @type Array"," */",""," results: null,"," /**"," * The total items in the stack"," * @property total"," * @type Number"," */"," total: null,"," /**"," * The number of stacked callbacks executed"," * @property finished"," * @type Number"," */"," finished: null,"," /**"," * Add a callback to the stack"," * @method add"," * @param {Function} fn The function callback we are waiting for"," */"," add: function (fn) {"," var self = this,"," index = self.total;",""," self.total += 1;",""," return function () {"," self.finished++;"," self.results[index] = (fn && fn.apply(self.context, arguments)) ||"," (arguments.length === 1 ? arguments[0] : Y.Array(arguments));",""," self.test();"," };"," },"," /**"," * Test to see if all registered items in the stack have completed, if so call the callback to `done`"," * @method test"," */"," test: function () {"," var self = this;"," if (self.finished >= self.total && self.callback) {"," self.callback.call(self.context, self.results, self.data);"," }"," },"," /**"," * The method to call when all the items in the stack are complete."," * @method done"," * @param {Function} callback The callback to execute on complete"," * @param {Mixed} callback.results The results of all the callbacks in the stack"," * @param {Mixed} [callback.data] The data given to the `done` method"," * @param {Mixed} data Mixed data to pass to the success callback"," */"," done: function (callback, data) {"," this.callback = callback;"," this.data = data;"," this.test();"," }","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/parallel/parallel.js"].code=["YUI.add('parallel', function (Y, NAME) {","","","/**","* A concurrent parallel processor to help in running several async functions.","* @module parallel","* @main parallel","*/","","/**","A concurrent parallel processor to help in running several async functions.",""," var stack = new Y.Parallel();",""," for (var i = 0; i < 15; i++) {"," Y.io('./api/json/' + i, {"," on: {"," success: stack.add(function() {"," })"," }"," });"," }",""," stack.done(function() {"," });","","@class Parallel","@param {Object} o A config object","@param {Object} [o.context=Y] The execution context of the callback to done","","","*/","","Y.Parallel = function(o) {"," this.config = o || {};"," this.results = [];"," this.context = this.config.context || Y;"," this.total = 0;"," this.finished = 0;","};","","Y.Parallel.prototype = {"," /**"," * An Array of results from all the callbacks in the stack"," * @property results"," * @type Array"," */",""," results: null,"," /**"," * The total items in the stack"," * @property total"," * @type Number"," */"," total: null,"," /**"," * The number of stacked callbacks executed"," * @property finished"," * @type Number"," */"," finished: null,"," /**"," * Add a callback to the stack"," * @method add"," * @param {Function} fn The function callback we are waiting for"," */"," add: function (fn) {"," var self = this,"," index = self.total;",""," self.total += 1;",""," return function () {"," self.finished++;"," self.results[index] = (fn && fn.apply(self.context, arguments)) ||"," (arguments.length === 1 ? arguments[0] : Y.Array(arguments));",""," self.test();"," };"," },"," /**"," * Test to see if all registered items in the stack have completed, if so call the callback to `done`"," * @method test"," */"," test: function () {"," var self = this;"," if (self.finished >= self.total && self.callback) {"," self.callback.call(self.context, self.results, self.data);"," }"," },"," /**"," * The method to call when all the items in the stack are complete."," * @method done"," * @param {Function} callback The callback to execute on complete"," * @param {Mixed} callback.results The results of all the callbacks in the stack"," * @param {Mixed} [callback.data] The data given to the `done` method"," * @param {Mixed} data Mixed data to pass to the success callback"," */"," done: function (callback, data) {"," this.callback = callback;"," this.data = data;"," this.test();"," }","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/parallel/parallel.js"].lines = {"1":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"42":0,"68":0,"71":0,"73":0,"74":0,"75":0,"78":0,"86":0,"87":0,"88":0,"100":0,"101":0,"102":0}; _yuitest_coverage["build/parallel/parallel.js"].functions = {"Parallel:34":0,"(anonymous 2):73":0,"add:67":0,"test:85":0,"done:99":0,"(anonymous 1):1":0}; _yuitest_coverage["build/parallel/parallel.js"].coveredLines = 20;@@ -169,4 +169,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/parallel/parallel-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -112,4 +112,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/parallel/parallel-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("parallel",function(e,t){e.Parallel=function(t){this.config=t||{},this.results=[],this.context=this.config.context||e,this.total=0,this.finished=0},e.Parallel.prototype={results:null,total:null,finished:null,add:function(t){var n=this,r=n.total;return n.total+=1,function(){n.finished++,n.results[r]=t&&t.apply(n.context,arguments)||(arguments.length===1?arguments[0]:e.Array(arguments)),n.test()}},test:function(){var e=this;e.finished>=e.total&&e.callback&&e.callback.call(e.context,e.results,e.data)},done:function(e,t){this.callback=e,this.data=t,this.test()}}},"3.7.2",{requires:["yui-base"]});+YUI.add("parallel",function(e,t){e.Parallel=function(t){this.config=t||{},this.results=[],this.context=this.config.context||e,this.total=0,this.finished=0},e.Parallel.prototype={results:null,total:null,finished:null,add:function(t){var n=this,r=n.total;return n.total+=1,function(){n.finished++,n.results[r]=t&&t.apply(n.context,arguments)||(arguments.length===1?arguments[0]:e.Array(arguments)),n.test()}},test:function(){var e=this;e.finished>=e.total&&e.callback&&e.callback.call(e.context,e.results,e.data)},done:function(e,t){this.callback=e,this.data=t,this.test()}}},"3.7.3",{requires:["yui-base"]});
bundle/parallel/parallel.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -110,4 +110,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/pjax-base/pjax-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/pjax-base/pjax-base.js", code: [] };-_yuitest_coverage["build/pjax-base/pjax-base.js"].code=["YUI.add('pjax-base', function (Y, NAME) {","","/**","`Y.Router` extension that provides the core plumbing for enhanced navigation","implemented using the pjax technique (HTML5 pushState + Ajax).","","@module pjax","@submodule pjax-base","@since 3.5.0","**/","","var win = Y.config.win,",""," // The CSS class name used to filter link clicks from only the links which"," // the pjax enhanced navigation should be used."," CLASS_PJAX = Y.ClassNameManager.getClassName('pjax'),",""," /**"," Fired when navigating to a URL via Pjax.",""," When the `navigate()` method is called or a pjax link is clicked, this event"," will be fired if the browser supports HTML5 history _and_ the router has a"," route handler for the specified URL.",""," This is a useful event to listen to for adding a visual loading indicator"," while the route handlers are busy handling the URL change.",""," @event navigate"," @param {String} url The URL that the router will dispatch to its route"," handlers in order to fulfill the enhanced navigation \"request\"."," @param {Boolean} [force=false] Whether the enhanced navigation should occur"," even in browsers without HTML5 history."," @param {String} [hash] The hash-fragment (including \"#\") of the `url`. This"," will be present when the `url` differs from the current URL only by its"," hash and `navigateOnHash` has been set to `true`."," @param {Event} [originEvent] The event that caused the navigation. Usually"," this would be a click event from a \"pjax\" anchor element."," @param {Boolean} [replace] Whether or not the current history entry will be"," replaced, or a new entry will be created. Will default to `true` if the"," specified `url` is the same as the current URL."," @since 3.5.0"," **/"," EVT_NAVIGATE = 'navigate';","","/**","`Y.Router` extension that provides the core plumbing for enhanced navigation","implemented using the pjax technique (HTML5 `pushState` + Ajax).","","This makes it easy to enhance the navigation between the URLs of an application","in HTML5 history capable browsers by delegating to the router to fulfill the","\"request\" and seamlessly falling-back to using standard full-page reloads in","older, less-capable browsers.","","The `PjaxBase` class isn't useful on its own, but can be mixed into a","`Router`-based class to add Pjax functionality to that Router. For a pre-made","standalone Pjax router, see the `Pjax` class.",""," var MyRouter = Y.Base.create('myRouter', Y.Router, [Y.PjaxBase], {"," // ..."," });","","@class PjaxBase","@extensionfor Router","@since 3.5.0","**/","function PjaxBase() {}","","PjaxBase.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Holds the delegated pjax-link click handler.",""," @property _pjaxEvents"," @type EventHandle"," @protected"," @since 3.5.0"," **/",""," /**"," Regex used to break up a URL string around the URL's path.",""," Subpattern captures:",""," 1. Origin, everything before the URL's path-part."," 2. The URL's path-part."," 3. Suffix, everything after the URL's path-part.",""," @property _regexURL"," @type RegExp"," @protected"," @since 3.5.0"," **/"," _regexURL: /^((?:[^\\/#?:]+:\\/\\/|\\/\\/)[^\\/]*)?([^?#]*)(\\?[^#]*)?(#.*)?$/,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," this.publish(EVT_NAVIGATE, {defaultFn: this._defNavigateFn});",""," // Pjax is all about progressively enhancing the navigation between"," // \"pages\", so by default we only want to handle and route link clicks"," // in HTML5 `pushState`-compatible browsers."," if (this.get('html5')) {"," this._pjaxBindUI();"," }"," },",""," destructor: function () {"," this._pjaxEvents && this._pjaxEvents.detach();"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Navigates to the specified URL if there is a route handler that matches. In"," browsers capable of using HTML5 history, the navigation will be enhanced by"," firing the `navigate` event and having the router handle the \"request\"."," Non-HTML5 browsers will navigate to the new URL via manipulation of"," `window.location`.",""," When there is a route handler for the specified URL and it is being"," navigated to, this method will return `true`, otherwise it will return"," `false`.",""," **Note:** The specified URL _must_ be of the same origin as the current URL,"," otherwise an error will be logged and navigation will not occur. This is"," intended as both a security constraint and a purposely imposed limitation as"," it does not make sense to tell the router to navigate to a URL on a"," different scheme, host, or port.",""," @method navigate"," @param {String} url The URL to navigate to. This must be of the same origin"," as the current URL."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force=false] Whether the enhanced navigation"," should occur even in browsers without HTML5 history."," @return {Boolean} `true` if the URL was navigated to, `false` otherwise."," @since 3.5.0"," **/"," navigate: function (url, options) {"," // The `_navigate()` method expects fully-resolved URLs."," url = this._resolveURL(url);",""," if (this._navigate(url, options)) {"," return true;"," }",""," if (!this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," }",""," return false;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Utility method to test whether a specified link/anchor node's `href` is of"," the same origin as the page's current location.",""," This normalize browser inconsistencies with how the `port` is reported for"," anchor elements (IE reports a value for the default port, e.g. \"80\").",""," @method _isLinkSameOrigin"," @param {Node} link The anchor element to test whether its `href` is of the"," same origin as the page's current location."," @return {Boolean} Whether or not the link's `href` is of the same origin as"," the page's current location."," @protected"," @since 3.6.0"," **/"," _isLinkSameOrigin: function (link) {"," var location = Y.getLocation(),"," protocol = location.protocol,"," hostname = location.hostname,"," port = parseInt(location.port, 10) || null,"," linkPort;",""," // Link must have the same `protocol` and `hostname` as the page's"," // currrent location."," if (link.get('protocol') !== protocol ||"," link.get('hostname') !== hostname) {",""," return false;"," }",""," linkPort = parseInt(link.get('port'), 10) || null;",""," // Normalize ports. In most cases browsers use an empty string when the"," // port is the default port, but IE does weird things with anchor"," // elements, so to be sure, this will re-assign the default ports before"," // they are compared."," if (protocol === 'http:') {"," port || (port = 80);"," linkPort || (linkPort = 80);"," } else if (protocol === 'https:') {"," port || (port = 443);"," linkPort || (linkPort = 443);"," }",""," // Finally, to be from the same origin, the link's `port` must match the"," // page's current `port`."," return linkPort === port;"," },",""," /**"," Underlying implementation for `navigate()`.",""," @method _navigate"," @param {String} url The fully-resolved URL that the router should dispatch"," to its route handlers to fulfill the enhanced navigation \"request\", or use"," to update `window.location` in non-HTML5 history capable browsers."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force=false] Whether the enhanced navigation"," should occur even in browsers without HTML5 history."," @return {Boolean} `true` if the URL was navigated to, `false` otherwise."," @protected"," @since 3.5.0"," **/"," _navigate: function (url, options) {"," url = this._upgradeURL(url);",""," // Navigation can only be enhanced if there is a route-handler."," if (!this.hasRoute(url)) {"," return false;"," }",""," // Make a copy of `options` before modifying it."," options = Y.merge(options, {url: url});",""," var currentURL = this._getURL(),"," hash, hashlessURL;",""," // Captures the `url`'s hash and returns a URL without that hash."," hashlessURL = url.replace(/(#.*)$/, function (u, h, i) {"," hash = h;"," return u.substring(i);"," });",""," if (hash && hashlessURL === currentURL.replace(/#.*$/, '')) {"," // When the specified `url` and current URL only differ by the hash,"," // the browser should handle this in-page navigation normally."," if (!this.get('navigateOnHash')) {"," return false;"," }",""," options.hash = hash;"," }",""," // When navigating to the same URL as the current URL, behave like a"," // browser and replace the history entry instead of creating a new one."," 'replace' in options || (options.replace = url === currentURL);",""," // The `navigate` event will only fire and therefore enhance the"," // navigation to the new URL in HTML5 history enabled browsers or when"," // forced. Otherwise it will fallback to assigning or replacing the URL"," // on `window.location`."," if (this.get('html5') || options.force) {"," this.fire(EVT_NAVIGATE, options);"," } else {"," if (options.replace) {"," win && win.location.replace(url);"," } else {"," win && (win.location = url);"," }"," }",""," return true;"," },",""," /**"," Binds the delegation of link-click events that match the `linkSelector` to"," the `_onLinkClick()` handler.",""," By default this method will only be called if the browser is capable of"," using HTML5 history.",""," @method _pjaxBindUI"," @protected"," @since 3.5.0"," **/"," _pjaxBindUI: function () {"," // Only bind link if we haven't already."," if (!this._pjaxEvents) {"," this._pjaxEvents = Y.one('body').delegate('click',"," this._onLinkClick, this.get('linkSelector'), this);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Default handler for the `navigate` event.",""," Adds a new history entry or replaces the current entry for the specified URL"," and will scroll the page to the top if configured to do so.",""," @method _defNavigateFn"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _defNavigateFn: function (e) {"," this[e.replace ? 'replace' : 'save'](e.url);",""," if (win && this.get('scrollToTop')) {"," // Scroll to the top of the page. The timeout ensures that the"," // scroll happens after navigation begins, so that the current"," // scroll position will be restored if the user clicks the back"," // button."," setTimeout(function () {"," win.scroll(0, 0);"," }, 1);"," }"," },",""," /**"," Handler for delegated link-click events which match the `linkSelector`.",""," This will attempt to enhance the navigation to the link element's `href` by"," passing the URL to the `_navigate()` method. When the navigation is being"," enhanced, the default action is prevented.",""," If the user clicks a link with the middle/right mouse buttons, or is holding"," down the Ctrl or Command keys, this method's behavior is not applied and"," allows the native behavior to occur. Similarly, if the router is not capable"," or handling the URL because no route-handlers match, the link click will"," behave natively.",""," @method _onLinkClick"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _onLinkClick: function (e) {"," var link, url;",""," // Allow the native behavior on middle/right-click, or when Ctrl or"," // Command are pressed."," if (e.button !== 1 || e.ctrlKey || e.metaKey) { return; }",""," link = e.currentTarget;",""," // Only allow anchor elements because we need access to its `protocol`,"," // `host`, and `href` attributes."," if (link.get('tagName').toUpperCase() !== 'A') {"," return;"," }",""," // Same origin check to prevent trying to navigate to URLs from other"," // sites or things like mailto links."," if (!this._isLinkSameOrigin(link)) {"," return;"," }",""," // All browsers fully resolve an anchor's `href` property."," url = link.get('href');",""," // Try and navigate to the URL via the router, and prevent the default"," // link-click action if we do."," url && this._navigate(url, {originEvent: e}) && e.preventDefault();"," }","};","","PjaxBase.ATTRS = {"," /**"," CSS selector string used to filter link click events so that only the links"," which match it will have the enhanced navigation behavior of Pjax applied.",""," When a link is clicked and that link matches this selector, Pjax will"," attempt to dispatch to any route handlers matching the link's `href` URL. If"," HTML5 history is not supported or if no route handlers match, the link click"," will be handled by the browser just like any old link.",""," @attribute linkSelector"," @type String|Function"," @default \"a.yui3-pjax\""," @initOnly"," @since 3.5.0"," **/"," linkSelector: {"," value : 'a.' + CLASS_PJAX,"," writeOnce: 'initOnly'"," },",""," /**"," Whether navigating to a hash-fragment identifier on the current page should"," be enhanced and cause the `navigate` event to fire.",""," By default Pjax allows the browser to perform its default action when a user"," is navigating within a page by clicking in-page links"," (e.g. `<a href=\"#top\">Top of page</a>`) and does not attempt to interfere or"," enhance in-page navigation.",""," @attribute navigateOnHash"," @type Boolean"," @default false"," @since 3.5.0"," **/"," navigateOnHash: {"," value: false"," },",""," /**"," Whether the page should be scrolled to the top after navigating to a URL.",""," When the user clicks the browser's back button, the previous scroll position"," will be maintained.",""," @attribute scrollToTop"," @type Boolean"," @default true"," @since 3.5.0"," **/"," scrollToTop: {"," value: true"," }","};","","Y.PjaxBase = PjaxBase;","","","}, '3.7.2', {\"requires\": [\"classnamemanager\", \"node-event-delegate\", \"router\"]});"];+_yuitest_coverage["build/pjax-base/pjax-base.js"].code=["YUI.add('pjax-base', function (Y, NAME) {","","/**","`Y.Router` extension that provides the core plumbing for enhanced navigation","implemented using the pjax technique (HTML5 pushState + Ajax).","","@module pjax","@submodule pjax-base","@since 3.5.0","**/","","var win = Y.config.win,",""," // The CSS class name used to filter link clicks from only the links which"," // the pjax enhanced navigation should be used."," CLASS_PJAX = Y.ClassNameManager.getClassName('pjax'),",""," /**"," Fired when navigating to a URL via Pjax.",""," When the `navigate()` method is called or a pjax link is clicked, this event"," will be fired if the browser supports HTML5 history _and_ the router has a"," route handler for the specified URL.",""," This is a useful event to listen to for adding a visual loading indicator"," while the route handlers are busy handling the URL change.",""," @event navigate"," @param {String} url The URL that the router will dispatch to its route"," handlers in order to fulfill the enhanced navigation \"request\"."," @param {Boolean} [force=false] Whether the enhanced navigation should occur"," even in browsers without HTML5 history."," @param {String} [hash] The hash-fragment (including \"#\") of the `url`. This"," will be present when the `url` differs from the current URL only by its"," hash and `navigateOnHash` has been set to `true`."," @param {Event} [originEvent] The event that caused the navigation. Usually"," this would be a click event from a \"pjax\" anchor element."," @param {Boolean} [replace] Whether or not the current history entry will be"," replaced, or a new entry will be created. Will default to `true` if the"," specified `url` is the same as the current URL."," @since 3.5.0"," **/"," EVT_NAVIGATE = 'navigate';","","/**","`Y.Router` extension that provides the core plumbing for enhanced navigation","implemented using the pjax technique (HTML5 `pushState` + Ajax).","","This makes it easy to enhance the navigation between the URLs of an application","in HTML5 history capable browsers by delegating to the router to fulfill the","\"request\" and seamlessly falling-back to using standard full-page reloads in","older, less-capable browsers.","","The `PjaxBase` class isn't useful on its own, but can be mixed into a","`Router`-based class to add Pjax functionality to that Router. For a pre-made","standalone Pjax router, see the `Pjax` class.",""," var MyRouter = Y.Base.create('myRouter', Y.Router, [Y.PjaxBase], {"," // ..."," });","","@class PjaxBase","@extensionfor Router","@since 3.5.0","**/","function PjaxBase() {}","","PjaxBase.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Holds the delegated pjax-link click handler.",""," @property _pjaxEvents"," @type EventHandle"," @protected"," @since 3.5.0"," **/",""," /**"," Regex used to break up a URL string around the URL's path.",""," Subpattern captures:",""," 1. Origin, everything before the URL's path-part."," 2. The URL's path-part."," 3. Suffix, everything after the URL's path-part.",""," @property _regexURL"," @type RegExp"," @protected"," @since 3.5.0"," **/"," _regexURL: /^((?:[^\\/#?:]+:\\/\\/|\\/\\/)[^\\/]*)?([^?#]*)(\\?[^#]*)?(#.*)?$/,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," this.publish(EVT_NAVIGATE, {defaultFn: this._defNavigateFn});",""," // Pjax is all about progressively enhancing the navigation between"," // \"pages\", so by default we only want to handle and route link clicks"," // in HTML5 `pushState`-compatible browsers."," if (this.get('html5')) {"," this._pjaxBindUI();"," }"," },",""," destructor: function () {"," this._pjaxEvents && this._pjaxEvents.detach();"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Navigates to the specified URL if there is a route handler that matches. In"," browsers capable of using HTML5 history, the navigation will be enhanced by"," firing the `navigate` event and having the router handle the \"request\"."," Non-HTML5 browsers will navigate to the new URL via manipulation of"," `window.location`.",""," When there is a route handler for the specified URL and it is being"," navigated to, this method will return `true`, otherwise it will return"," `false`.",""," **Note:** The specified URL _must_ be of the same origin as the current URL,"," otherwise an error will be logged and navigation will not occur. This is"," intended as both a security constraint and a purposely imposed limitation as"," it does not make sense to tell the router to navigate to a URL on a"," different scheme, host, or port.",""," @method navigate"," @param {String} url The URL to navigate to. This must be of the same origin"," as the current URL."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force=false] Whether the enhanced navigation"," should occur even in browsers without HTML5 history."," @return {Boolean} `true` if the URL was navigated to, `false` otherwise."," @since 3.5.0"," **/"," navigate: function (url, options) {"," // The `_navigate()` method expects fully-resolved URLs."," url = this._resolveURL(url);",""," if (this._navigate(url, options)) {"," return true;"," }",""," if (!this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," }",""," return false;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Utility method to test whether a specified link/anchor node's `href` is of"," the same origin as the page's current location.",""," This normalize browser inconsistencies with how the `port` is reported for"," anchor elements (IE reports a value for the default port, e.g. \"80\").",""," @method _isLinkSameOrigin"," @param {Node} link The anchor element to test whether its `href` is of the"," same origin as the page's current location."," @return {Boolean} Whether or not the link's `href` is of the same origin as"," the page's current location."," @protected"," @since 3.6.0"," **/"," _isLinkSameOrigin: function (link) {"," var location = Y.getLocation(),"," protocol = location.protocol,"," hostname = location.hostname,"," port = parseInt(location.port, 10) || null,"," linkPort;",""," // Link must have the same `protocol` and `hostname` as the page's"," // currrent location."," if (link.get('protocol') !== protocol ||"," link.get('hostname') !== hostname) {",""," return false;"," }",""," linkPort = parseInt(link.get('port'), 10) || null;",""," // Normalize ports. In most cases browsers use an empty string when the"," // port is the default port, but IE does weird things with anchor"," // elements, so to be sure, this will re-assign the default ports before"," // they are compared."," if (protocol === 'http:') {"," port || (port = 80);"," linkPort || (linkPort = 80);"," } else if (protocol === 'https:') {"," port || (port = 443);"," linkPort || (linkPort = 443);"," }",""," // Finally, to be from the same origin, the link's `port` must match the"," // page's current `port`."," return linkPort === port;"," },",""," /**"," Underlying implementation for `navigate()`.",""," @method _navigate"," @param {String} url The fully-resolved URL that the router should dispatch"," to its route handlers to fulfill the enhanced navigation \"request\", or use"," to update `window.location` in non-HTML5 history capable browsers."," @param {Object} [options] Additional options to configure the navigation."," These are mixed into the `navigate` event facade."," @param {Boolean} [options.replace] Whether or not the current history"," entry will be replaced, or a new entry will be created. Will default"," to `true` if the specified `url` is the same as the current URL."," @param {Boolean} [options.force=false] Whether the enhanced navigation"," should occur even in browsers without HTML5 history."," @return {Boolean} `true` if the URL was navigated to, `false` otherwise."," @protected"," @since 3.5.0"," **/"," _navigate: function (url, options) {"," url = this._upgradeURL(url);",""," // Navigation can only be enhanced if there is a route-handler."," if (!this.hasRoute(url)) {"," return false;"," }",""," // Make a copy of `options` before modifying it."," options = Y.merge(options, {url: url});",""," var currentURL = this._getURL(),"," hash, hashlessURL;",""," // Captures the `url`'s hash and returns a URL without that hash."," hashlessURL = url.replace(/(#.*)$/, function (u, h, i) {"," hash = h;"," return u.substring(i);"," });",""," if (hash && hashlessURL === currentURL.replace(/#.*$/, '')) {"," // When the specified `url` and current URL only differ by the hash,"," // the browser should handle this in-page navigation normally."," if (!this.get('navigateOnHash')) {"," return false;"," }",""," options.hash = hash;"," }",""," // When navigating to the same URL as the current URL, behave like a"," // browser and replace the history entry instead of creating a new one."," 'replace' in options || (options.replace = url === currentURL);",""," // The `navigate` event will only fire and therefore enhance the"," // navigation to the new URL in HTML5 history enabled browsers or when"," // forced. Otherwise it will fallback to assigning or replacing the URL"," // on `window.location`."," if (this.get('html5') || options.force) {"," this.fire(EVT_NAVIGATE, options);"," } else {"," if (options.replace) {"," win && win.location.replace(url);"," } else {"," win && (win.location = url);"," }"," }",""," return true;"," },",""," /**"," Binds the delegation of link-click events that match the `linkSelector` to"," the `_onLinkClick()` handler.",""," By default this method will only be called if the browser is capable of"," using HTML5 history.",""," @method _pjaxBindUI"," @protected"," @since 3.5.0"," **/"," _pjaxBindUI: function () {"," // Only bind link if we haven't already."," if (!this._pjaxEvents) {"," this._pjaxEvents = Y.one('body').delegate('click',"," this._onLinkClick, this.get('linkSelector'), this);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Default handler for the `navigate` event.",""," Adds a new history entry or replaces the current entry for the specified URL"," and will scroll the page to the top if configured to do so.",""," @method _defNavigateFn"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _defNavigateFn: function (e) {"," this[e.replace ? 'replace' : 'save'](e.url);",""," if (win && this.get('scrollToTop')) {"," // Scroll to the top of the page. The timeout ensures that the"," // scroll happens after navigation begins, so that the current"," // scroll position will be restored if the user clicks the back"," // button."," setTimeout(function () {"," win.scroll(0, 0);"," }, 1);"," }"," },",""," /**"," Handler for delegated link-click events which match the `linkSelector`.",""," This will attempt to enhance the navigation to the link element's `href` by"," passing the URL to the `_navigate()` method. When the navigation is being"," enhanced, the default action is prevented.",""," If the user clicks a link with the middle/right mouse buttons, or is holding"," down the Ctrl or Command keys, this method's behavior is not applied and"," allows the native behavior to occur. Similarly, if the router is not capable"," or handling the URL because no route-handlers match, the link click will"," behave natively.",""," @method _onLinkClick"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _onLinkClick: function (e) {"," var link, url;",""," // Allow the native behavior on middle/right-click, or when Ctrl or"," // Command are pressed."," if (e.button !== 1 || e.ctrlKey || e.metaKey) { return; }",""," link = e.currentTarget;",""," // Only allow anchor elements because we need access to its `protocol`,"," // `host`, and `href` attributes."," if (link.get('tagName').toUpperCase() !== 'A') {"," return;"," }",""," // Same origin check to prevent trying to navigate to URLs from other"," // sites or things like mailto links."," if (!this._isLinkSameOrigin(link)) {"," return;"," }",""," // All browsers fully resolve an anchor's `href` property."," url = link.get('href');",""," // Try and navigate to the URL via the router, and prevent the default"," // link-click action if we do."," url && this._navigate(url, {originEvent: e}) && e.preventDefault();"," }","};","","PjaxBase.ATTRS = {"," /**"," CSS selector string used to filter link click events so that only the links"," which match it will have the enhanced navigation behavior of Pjax applied.",""," When a link is clicked and that link matches this selector, Pjax will"," attempt to dispatch to any route handlers matching the link's `href` URL. If"," HTML5 history is not supported or if no route handlers match, the link click"," will be handled by the browser just like any old link.",""," @attribute linkSelector"," @type String|Function"," @default \"a.yui3-pjax\""," @initOnly"," @since 3.5.0"," **/"," linkSelector: {"," value : 'a.' + CLASS_PJAX,"," writeOnce: 'initOnly'"," },",""," /**"," Whether navigating to a hash-fragment identifier on the current page should"," be enhanced and cause the `navigate` event to fire.",""," By default Pjax allows the browser to perform its default action when a user"," is navigating within a page by clicking in-page links"," (e.g. `<a href=\"#top\">Top of page</a>`) and does not attempt to interfere or"," enhance in-page navigation.",""," @attribute navigateOnHash"," @type Boolean"," @default false"," @since 3.5.0"," **/"," navigateOnHash: {"," value: false"," },",""," /**"," Whether the page should be scrolled to the top after navigating to a URL.",""," When the user clicks the browser's back button, the previous scroll position"," will be maintained.",""," @attribute scrollToTop"," @type Boolean"," @default true"," @since 3.5.0"," **/"," scrollToTop: {"," value: true"," }","};","","Y.PjaxBase = PjaxBase;","","","}, '3.7.3', {\"requires\": [\"classnamemanager\", \"node-event-delegate\", \"router\"]});"]; _yuitest_coverage["build/pjax-base/pjax-base.js"].lines = {"1":0,"12":0,"66":0,"68":0,"98":0,"103":0,"104":0,"109":0,"146":0,"148":0,"149":0,"152":0,"153":0,"156":0,"177":0,"185":0,"188":0,"191":0,"197":0,"198":0,"199":0,"200":0,"201":0,"202":0,"207":0,"229":0,"232":0,"233":0,"237":0,"239":0,"243":0,"244":0,"245":0,"248":0,"251":0,"252":0,"255":0,"260":0,"266":0,"267":0,"269":0,"270":0,"272":0,"276":0,"292":0,"293":0,"312":0,"314":0,"319":0,"320":0,"344":0,"348":0,"350":0,"354":0,"355":0,"360":0,"361":0,"365":0,"369":0,"373":0,"428":0}; _yuitest_coverage["build/pjax-base/pjax-base.js"].functions = {"PjaxBase:66":0,"initializer:97":0,"destructor:108":0,"navigate:144":0,"_isLinkSameOrigin:176":0,"(anonymous 2):243":0,"_navigate:228":0,"_pjaxBindUI:290":0,"(anonymous 3):319":0,"_defNavigateFn:311":0,"_onLinkClick:343":0,"(anonymous 1):1":0}; _yuitest_coverage["build/pjax-base/pjax-base.js"].coveredLines = 61;@@ -539,4 +539,4 @@ Y.PjaxBase = PjaxBase; -}, '3.7.2', {"requires": ["classnamemanager", "node-event-delegate", "router"]});+}, '3.7.3', {"requires": ["classnamemanager", "node-event-delegate", "router"]});
bundle/pjax-base/pjax-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -435,4 +435,4 @@ Y.PjaxBase = PjaxBase; -}, '3.7.2', {"requires": ["classnamemanager", "node-event-delegate", "router"]});+}, '3.7.3', {"requires": ["classnamemanager", "node-event-delegate", "router"]});
bundle/pjax-base/pjax-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("pjax-base",function(e,t){function s(){}var n=e.config.win,r=e.ClassNameManager.getClassName("pjax"),i="navigate";s.prototype={_regexURL:/^((?:[^\/#?:]+:\/\/|\/\/)[^\/]*)?([^?#]*)(\?[^#]*)?(#.*)?$/,initializer:function(){this.publish(i,{defaultFn:this._defNavigateFn}),this.get("html5")&&this._pjaxBindUI()},destructor:function(){this._pjaxEvents&&this._pjaxEvents.detach()},navigate:function(t,n){return t=this._resolveURL(t),this._navigate(t,n)?!0:(this._hasSameOrigin(t)||e.error("Security error: The new URL must be of the same origin as the current URL."),!1)},_isLinkSameOrigin:function(t){var n=e.getLocation(),r=n.protocol,i=n.hostname,s=parseInt(n.port,10)||null,o;return t.get("protocol")!==r||t.get("hostname")!==i?!1:(o=parseInt(t.get("port"),10)||null,r==="http:"?(s||(s=80),o||(o=80)):r==="https:"&&(s||(s=443),o||(o=443)),o===s)},_navigate:function(t,r){t=this._upgradeURL(t);if(!this.hasRoute(t))return!1;r=e.merge(r,{url:t});var s=this._getURL(),o,u;u=t.replace(/(#.*)$/,function(e,t,n){return o=t,e.substring(n)});if(o&&u===s.replace(/#.*$/,"")){if(!this.get("navigateOnHash"))return!1;r.hash=o}return"replace"in r||(r.replace=t===s),this.get("html5")||r.force?this.fire(i,r):r.replace?n&&n.location.replace(t):n&&(n.location=t),!0},_pjaxBindUI:function(){this._pjaxEvents||(this._pjaxEvents=e.one("body").delegate("click",this._onLinkClick,this.get("linkSelector"),this))},_defNavigateFn:function(e){this[e.replace?"replace":"save"](e.url),n&&this.get("scrollToTop")&&setTimeout(function(){n.scroll(0,0)},1)},_onLinkClick:function(e){var t,n;if(e.button!==1||e.ctrlKey||e.metaKey)return;t=e.currentTarget;if(t.get("tagName").toUpperCase()!=="A")return;if(!this._isLinkSameOrigin(t))return;n=t.get("href"),n&&this._navigate(n,{originEvent:e})&&e.preventDefault()}},s.ATTRS={linkSelector:{value:"a."+r,writeOnce:"initOnly"},navigateOnHash:{value:!1},scrollToTop:{value:!0}},e.PjaxBase=s},"3.7.2",{requires:["classnamemanager","node-event-delegate","router"]});+YUI.add("pjax-base",function(e,t){function s(){}var n=e.config.win,r=e.ClassNameManager.getClassName("pjax"),i="navigate";s.prototype={_regexURL:/^((?:[^\/#?:]+:\/\/|\/\/)[^\/]*)?([^?#]*)(\?[^#]*)?(#.*)?$/,initializer:function(){this.publish(i,{defaultFn:this._defNavigateFn}),this.get("html5")&&this._pjaxBindUI()},destructor:function(){this._pjaxEvents&&this._pjaxEvents.detach()},navigate:function(t,n){return t=this._resolveURL(t),this._navigate(t,n)?!0:(this._hasSameOrigin(t)||e.error("Security error: The new URL must be of the same origin as the current URL."),!1)},_isLinkSameOrigin:function(t){var n=e.getLocation(),r=n.protocol,i=n.hostname,s=parseInt(n.port,10)||null,o;return t.get("protocol")!==r||t.get("hostname")!==i?!1:(o=parseInt(t.get("port"),10)||null,r==="http:"?(s||(s=80),o||(o=80)):r==="https:"&&(s||(s=443),o||(o=443)),o===s)},_navigate:function(t,r){t=this._upgradeURL(t);if(!this.hasRoute(t))return!1;r=e.merge(r,{url:t});var s=this._getURL(),o,u;u=t.replace(/(#.*)$/,function(e,t,n){return o=t,e.substring(n)});if(o&&u===s.replace(/#.*$/,"")){if(!this.get("navigateOnHash"))return!1;r.hash=o}return"replace"in r||(r.replace=t===s),this.get("html5")||r.force?this.fire(i,r):r.replace?n&&n.location.replace(t):n&&(n.location=t),!0},_pjaxBindUI:function(){this._pjaxEvents||(this._pjaxEvents=e.one("body").delegate("click",this._onLinkClick,this.get("linkSelector"),this))},_defNavigateFn:function(e){this[e.replace?"replace":"save"](e.url),n&&this.get("scrollToTop")&&setTimeout(function(){n.scroll(0,0)},1)},_onLinkClick:function(e){var t,n;if(e.button!==1||e.ctrlKey||e.metaKey)return;t=e.currentTarget;if(t.get("tagName").toUpperCase()!=="A")return;if(!this._isLinkSameOrigin(t))return;n=t.get("href"),n&&this._navigate(n,{originEvent:e})&&e.preventDefault()}},s.ATTRS={linkSelector:{value:"a."+r,writeOnce:"initOnly"},navigateOnHash:{value:!1},scrollToTop:{value:!0}},e.PjaxBase=s},"3.7.3",{requires:["classnamemanager","node-event-delegate","router"]});
bundle/pjax-base/pjax-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -434,4 +434,4 @@ Y.PjaxBase = PjaxBase; -}, '3.7.2', {"requires": ["classnamemanager", "node-event-delegate", "router"]});+}, '3.7.3', {"requires": ["classnamemanager", "node-event-delegate", "router"]});
bundle/pjax-content/pjax-content-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/pjax-content/pjax-content.js", code: [] };-_yuitest_coverage["build/pjax-content/pjax-content.js"].code=["YUI.add('pjax-content', function (Y, NAME) {","","/**","`Y.Router` extension that provides the content fetching and handling needed to","implement the standard pjax (HTMP5 pushState + Ajax) functionality.","","@module pjax","@submodule pjax-content","@since 3.7.0","**/","","/**","`Y.Router` extension that provides the content fetching and handling needed to","implement the standard pjax (HTMP5 pushState + Ajax) functionality.","","This makes it easy to fetch server rendered content for URLs using Ajax. By","helping the router to fulfill the \"request\" for the content you can avoid full","page loads.","","The `PjaxContent` class isn't useful on its own, but can be mixed into a","`Router`-based class along with the `PjaxBase` class to add Pjax functionality","to that Router. For a pre-made standalone Pjax router, see the `Pjax` class.",""," var MyRouter = Y.Base.create('myRouter', Y.Router, ["," Y.PjaxBase,"," Y.PjaxContent"," ], {"," // ..."," });","","@class PjaxContent","@extensionfor Router","@since 3.7.0","**/","function PjaxContent() {}","","PjaxContent.prototype = {"," // -- Public Methods -------------------------------------------------------",""," /**"," Extracts and returns the relevant HTML content from an Ajax response. The"," content is extracted using the `contentSelector` attribute as a CSS"," selector. If `contentSelector` is `null`, the entire response will be"," returned.",""," The return value is an object containing two properties:",""," * `node`: A `Y.Node` instance for a document fragment containing the"," extracted HTML content.",""," * `title`: The title of the HTML page, if any, extracted using the"," `titleSelector` attribute (which defaults to looking for a `<title>`"," element). If `titleSelector` is not set or if a title could not be"," found, this property will be `undefined`.",""," @method getContent"," @param {String} responseText Raw Ajax response text."," @return {Object} Content object with the properties described above."," @since 3.5.0"," **/"," getContent: function (responseText) {"," var content = {},"," contentSelector = this.get('contentSelector'),"," frag = Y.Node.create(responseText || ''),"," titleSelector = this.get('titleSelector'),"," titleNode;",""," if (contentSelector) {"," content.node = frag.all(contentSelector).toFrag();"," } else {"," content.node = frag;"," }",""," if (titleSelector) {"," titleNode = frag.one(titleSelector);",""," if (titleNode) {"," content.title = titleNode.get('text');"," }"," }",""," return content;"," },",""," /**"," Pjax route middleware to load content from a server. This makes an Ajax"," request for the requested URL, parses the returned content and puts it on"," the route's response object.",""," This is route middleware and not intended to be the final callback for a"," route. This will add the following information to the route's request and"," response objects:",""," - `req.ioURL`: The full URL that was used to make the `Y.io()` XHR. This"," may contain `\"pjax=1\"` if the `addPjaxParam` option is set.",""," - `res.content`: An object containing `node` and `title` properties for"," the content extracted from the server's response. See `getContent()` for"," more details.",""," - `res.ioResponse`: The full `Y.io()` response object. This is useful if"," you need access to the XHR's response `status` or HTTP headers.",""," @example"," router.route('/foo/', 'loadContent', function (req, res, next) {"," Y.one('container').setHTML(res.content.node);"," Y.config.doc.title = res.content.title;"," });",""," @method loadContent"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @since 3.7.0"," @see Router.route()"," **/"," loadContent: function (req, res, next) {"," var url = req.url;",""," // If there's an outstanding request, abort it."," if (this._request) {"," this._request.abort();"," }",""," // Add a 'pjax=1' query parameter if enabled."," if (this.get('addPjaxParam')) {"," // Captures the path with query, and hash parts of the URL. Then"," // properly injects the \"pjax=1\" query param in the right place,"," // before any hash fragment, and returns the updated URL."," url = url.replace(/([^#]*)(#.*)?$/, function (match, path, hash) {"," path += (path.indexOf('?') > -1 ? '&' : '?') + 'pjax=1';"," return path + (hash || '');"," });"," }",""," // Send a request."," this._request = Y.io(url, {"," 'arguments': {"," route: {"," req : req,"," res : res,"," next: next"," },",""," url: url"," },",""," context: this,"," headers: {'X-PJAX': 'true'},"," timeout: this.get('timeout'),",""," on: {"," complete: this._onPjaxIOComplete,"," end : this._onPjaxIOEnd"," }"," });"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Handles IO complete events.",""," This parses the content from the `Y.io()` response and puts it on the"," route's response object.",""," @method _onPjaxIOComplete"," @param {String} id The `Y.io` transaction id."," @param {Object} ioResponse The `Y.io` response object."," @param {Object} details Extra details carried through from `loadContent()`."," @protected"," @since 3.7.0"," **/"," _onPjaxIOComplete: function (id, ioResponse, details) {"," var content = this.getContent(ioResponse.responseText),"," route = details.route,"," req = route.req,"," res = route.res;",""," // Put the URL requested through `Y.io` on the route's `req` object."," req.ioURL = details.url;",""," // Put the parsed content and `Y.io` response object on the route's"," // `res` object."," res.content = content;"," res.ioResponse = ioResponse;",""," route.next();"," },",""," /**"," Handles IO end events.",""," @method _onPjaxIOEnd"," @param {String} id The `Y.io` transaction id."," @param {Object} details Extra details carried through from `loadContent()`."," @protected"," @since 3.5.0"," **/"," _onPjaxIOEnd: function () {"," this._request = null;"," }","};","","PjaxContent.ATTRS = {"," /**"," If `true`, a \"pjax=1\" query parameter will be appended to all URLs"," requested via Pjax.",""," Browsers ignore HTTP request headers when caching content, so if the"," same URL is used to request a partial Pjax page and a full page, the"," browser will cache them under the same key and may later load the"," cached partial page when the user actually requests a full page (or vice"," versa).",""," To prevent this, we can add a bogus query parameter to the URL so that"," Pjax URLs will always be cached separately from non-Pjax URLs.",""," @attribute addPjaxParam"," @type Boolean"," @default true"," @since 3.5.0"," **/"," addPjaxParam: {"," value: true"," },",""," /**"," CSS selector used to extract a specific portion of the content of a page"," loaded via Pjax.",""," For example, if you wanted to load the page `example.html` but only use"," the content within an element with the id \"pjax-content\", you'd set"," `contentSelector` to \"#pjax-content\".",""," If not set, the entire page will be used.",""," @attribute contentSelector"," @type String"," @default null"," @since 3.5.0"," **/"," contentSelector: {"," value: null"," },",""," /**"," CSS selector used to extract a page title from the content of a page"," loaded via Pjax.",""," By default this is set to extract the title from the `<title>` element,"," but you could customize it to extract the title from an `<h1>`, or from"," any other element, if that's more appropriate for the content you're"," loading.",""," @attribute titleSelector"," @type String"," @default \"title\""," @since 3.5.0"," **/"," titleSelector: {"," value: 'title'"," },",""," /**"," Time in milliseconds after which an Ajax request should time out.",""," @attribute timeout"," @type Number"," @default 30000"," @since 3.5.0"," **/"," timeout: {"," value: 30000"," }","};","","Y.PjaxContent = PjaxContent;","","","}, '3.7.2', {\"requires\": [\"io-base\", \"node-base\", \"router\"]});"];+_yuitest_coverage["build/pjax-content/pjax-content.js"].code=["YUI.add('pjax-content', function (Y, NAME) {","","/**","`Y.Router` extension that provides the content fetching and handling needed to","implement the standard pjax (HTMP5 pushState + Ajax) functionality.","","@module pjax","@submodule pjax-content","@since 3.7.0","**/","","/**","`Y.Router` extension that provides the content fetching and handling needed to","implement the standard pjax (HTMP5 pushState + Ajax) functionality.","","This makes it easy to fetch server rendered content for URLs using Ajax. By","helping the router to fulfill the \"request\" for the content you can avoid full","page loads.","","The `PjaxContent` class isn't useful on its own, but can be mixed into a","`Router`-based class along with the `PjaxBase` class to add Pjax functionality","to that Router. For a pre-made standalone Pjax router, see the `Pjax` class.",""," var MyRouter = Y.Base.create('myRouter', Y.Router, ["," Y.PjaxBase,"," Y.PjaxContent"," ], {"," // ..."," });","","@class PjaxContent","@extensionfor Router","@since 3.7.0","**/","function PjaxContent() {}","","PjaxContent.prototype = {"," // -- Public Methods -------------------------------------------------------",""," /**"," Extracts and returns the relevant HTML content from an Ajax response. The"," content is extracted using the `contentSelector` attribute as a CSS"," selector. If `contentSelector` is `null`, the entire response will be"," returned.",""," The return value is an object containing two properties:",""," * `node`: A `Y.Node` instance for a document fragment containing the"," extracted HTML content.",""," * `title`: The title of the HTML page, if any, extracted using the"," `titleSelector` attribute (which defaults to looking for a `<title>`"," element). If `titleSelector` is not set or if a title could not be"," found, this property will be `undefined`.",""," @method getContent"," @param {String} responseText Raw Ajax response text."," @return {Object} Content object with the properties described above."," @since 3.5.0"," **/"," getContent: function (responseText) {"," var content = {},"," contentSelector = this.get('contentSelector'),"," frag = Y.Node.create(responseText || ''),"," titleSelector = this.get('titleSelector'),"," titleNode;",""," if (contentSelector) {"," content.node = frag.all(contentSelector).toFrag();"," } else {"," content.node = frag;"," }",""," if (titleSelector) {"," titleNode = frag.one(titleSelector);",""," if (titleNode) {"," content.title = titleNode.get('text');"," }"," }",""," return content;"," },",""," /**"," Pjax route middleware to load content from a server. This makes an Ajax"," request for the requested URL, parses the returned content and puts it on"," the route's response object.",""," This is route middleware and not intended to be the final callback for a"," route. This will add the following information to the route's request and"," response objects:",""," - `req.ioURL`: The full URL that was used to make the `Y.io()` XHR. This"," may contain `\"pjax=1\"` if the `addPjaxParam` option is set.",""," - `res.content`: An object containing `node` and `title` properties for"," the content extracted from the server's response. See `getContent()` for"," more details.",""," - `res.ioResponse`: The full `Y.io()` response object. This is useful if"," you need access to the XHR's response `status` or HTTP headers.",""," @example"," router.route('/foo/', 'loadContent', function (req, res, next) {"," Y.one('container').setHTML(res.content.node);"," Y.config.doc.title = res.content.title;"," });",""," @method loadContent"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @since 3.7.0"," @see Router.route()"," **/"," loadContent: function (req, res, next) {"," var url = req.url;",""," // If there's an outstanding request, abort it."," if (this._request) {"," this._request.abort();"," }",""," // Add a 'pjax=1' query parameter if enabled."," if (this.get('addPjaxParam')) {"," // Captures the path with query, and hash parts of the URL. Then"," // properly injects the \"pjax=1\" query param in the right place,"," // before any hash fragment, and returns the updated URL."," url = url.replace(/([^#]*)(#.*)?$/, function (match, path, hash) {"," path += (path.indexOf('?') > -1 ? '&' : '?') + 'pjax=1';"," return path + (hash || '');"," });"," }",""," // Send a request."," this._request = Y.io(url, {"," 'arguments': {"," route: {"," req : req,"," res : res,"," next: next"," },",""," url: url"," },",""," context: this,"," headers: {'X-PJAX': 'true'},"," timeout: this.get('timeout'),",""," on: {"," complete: this._onPjaxIOComplete,"," end : this._onPjaxIOEnd"," }"," });"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Handles IO complete events.",""," This parses the content from the `Y.io()` response and puts it on the"," route's response object.",""," @method _onPjaxIOComplete"," @param {String} id The `Y.io` transaction id."," @param {Object} ioResponse The `Y.io` response object."," @param {Object} details Extra details carried through from `loadContent()`."," @protected"," @since 3.7.0"," **/"," _onPjaxIOComplete: function (id, ioResponse, details) {"," var content = this.getContent(ioResponse.responseText),"," route = details.route,"," req = route.req,"," res = route.res;",""," // Put the URL requested through `Y.io` on the route's `req` object."," req.ioURL = details.url;",""," // Put the parsed content and `Y.io` response object on the route's"," // `res` object."," res.content = content;"," res.ioResponse = ioResponse;",""," route.next();"," },",""," /**"," Handles IO end events.",""," @method _onPjaxIOEnd"," @param {String} id The `Y.io` transaction id."," @param {Object} details Extra details carried through from `loadContent()`."," @protected"," @since 3.5.0"," **/"," _onPjaxIOEnd: function () {"," this._request = null;"," }","};","","PjaxContent.ATTRS = {"," /**"," If `true`, a \"pjax=1\" query parameter will be appended to all URLs"," requested via Pjax.",""," Browsers ignore HTTP request headers when caching content, so if the"," same URL is used to request a partial Pjax page and a full page, the"," browser will cache them under the same key and may later load the"," cached partial page when the user actually requests a full page (or vice"," versa).",""," To prevent this, we can add a bogus query parameter to the URL so that"," Pjax URLs will always be cached separately from non-Pjax URLs.",""," @attribute addPjaxParam"," @type Boolean"," @default true"," @since 3.5.0"," **/"," addPjaxParam: {"," value: true"," },",""," /**"," CSS selector used to extract a specific portion of the content of a page"," loaded via Pjax.",""," For example, if you wanted to load the page `example.html` but only use"," the content within an element with the id \"pjax-content\", you'd set"," `contentSelector` to \"#pjax-content\".",""," If not set, the entire page will be used.",""," @attribute contentSelector"," @type String"," @default null"," @since 3.5.0"," **/"," contentSelector: {"," value: null"," },",""," /**"," CSS selector used to extract a page title from the content of a page"," loaded via Pjax.",""," By default this is set to extract the title from the `<title>` element,"," but you could customize it to extract the title from an `<h1>`, or from"," any other element, if that's more appropriate for the content you're"," loading.",""," @attribute titleSelector"," @type String"," @default \"title\""," @since 3.5.0"," **/"," titleSelector: {"," value: 'title'"," },",""," /**"," Time in milliseconds after which an Ajax request should time out.",""," @attribute timeout"," @type Number"," @default 30000"," @since 3.5.0"," **/"," timeout: {"," value: 30000"," }","};","","Y.PjaxContent = PjaxContent;","","","}, '3.7.3', {\"requires\": [\"io-base\", \"node-base\", \"router\"]});"]; _yuitest_coverage["build/pjax-content/pjax-content.js"].lines = {"1":0,"35":0,"37":0,"62":0,"68":0,"69":0,"71":0,"74":0,"75":0,"77":0,"78":0,"82":0,"118":0,"121":0,"122":0,"126":0,"130":0,"131":0,"132":0,"137":0,"175":0,"181":0,"185":0,"186":0,"188":0,"201":0,"205":0,"278":0}; _yuitest_coverage["build/pjax-content/pjax-content.js"].functions = {"PjaxContent:35":0,"getContent:61":0,"(anonymous 2):130":0,"loadContent:117":0,"_onPjaxIOComplete:174":0,"_onPjaxIOEnd:200":0,"(anonymous 1):1":0}; _yuitest_coverage["build/pjax-content/pjax-content.js"].coveredLines = 28;@@ -351,4 +351,4 @@ Y.PjaxContent = PjaxContent; -}, '3.7.2', {"requires": ["io-base", "node-base", "router"]});+}, '3.7.3', {"requires": ["io-base", "node-base", "router"]});
bundle/pjax-content/pjax-content-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -284,4 +284,4 @@ Y.PjaxContent = PjaxContent; -}, '3.7.2', {"requires": ["io-base", "node-base", "router"]});+}, '3.7.3', {"requires": ["io-base", "node-base", "router"]});
bundle/pjax-content/pjax-content-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("pjax-content",function(e,t){function n(){}n.prototype={getContent:function(t){var n={},r=this.get("contentSelector"),i=e.Node.create(t||""),s=this.get("titleSelector"),o;return r?n.node=i.all(r).toFrag():n.node=i,s&&(o=i.one(s),o&&(n.title=o.get("text"))),n},loadContent:function(t,n,r){var i=t.url;this._request&&this._request.abort(),this.get("addPjaxParam")&&(i=i.replace(/([^#]*)(#.*)?$/,function(e,t,n){return t+=(t.indexOf("?")>-1?"&":"?")+"pjax=1",t+(n||"")})),this._request=e.io(i,{arguments:{route:{req:t,res:n,next:r},url:i},context:this,headers:{"X-PJAX":"true"},timeout:this.get("timeout"),on:{complete:this._onPjaxIOComplete,end:this._onPjaxIOEnd}})},_onPjaxIOComplete:function(e,t,n){var r=this.getContent(t.responseText),i=n.route,s=i.req,o=i.res;s.ioURL=n.url,o.content=r,o.ioResponse=t,i.next()},_onPjaxIOEnd:function(){this._request=null}},n.ATTRS={addPjaxParam:{value:!0},contentSelector:{value:null},titleSelector:{value:"title"},timeout:{value:3e4}},e.PjaxContent=n},"3.7.2",{requires:["io-base","node-base","router"]});+YUI.add("pjax-content",function(e,t){function n(){}n.prototype={getContent:function(t){var n={},r=this.get("contentSelector"),i=e.Node.create(t||""),s=this.get("titleSelector"),o;return r?n.node=i.all(r).toFrag():n.node=i,s&&(o=i.one(s),o&&(n.title=o.get("text"))),n},loadContent:function(t,n,r){var i=t.url;this._request&&this._request.abort(),this.get("addPjaxParam")&&(i=i.replace(/([^#]*)(#.*)?$/,function(e,t,n){return t+=(t.indexOf("?")>-1?"&":"?")+"pjax=1",t+(n||"")})),this._request=e.io(i,{arguments:{route:{req:t,res:n,next:r},url:i},context:this,headers:{"X-PJAX":"true"},timeout:this.get("timeout"),on:{complete:this._onPjaxIOComplete,end:this._onPjaxIOEnd}})},_onPjaxIOComplete:function(e,t,n){var r=this.getContent(t.responseText),i=n.route,s=i.req,o=i.res;s.ioURL=n.url,o.content=r,o.ioResponse=t,i.next()},_onPjaxIOEnd:function(){this._request=null}},n.ATTRS={addPjaxParam:{value:!0},contentSelector:{value:null},titleSelector:{value:"title"},timeout:{value:3e4}},e.PjaxContent=n},"3.7.3",{requires:["io-base","node-base","router"]});
bundle/pjax-content/pjax-content.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -284,4 +284,4 @@ Y.PjaxContent = PjaxContent; -}, '3.7.2', {"requires": ["io-base", "node-base", "router"]});+}, '3.7.3', {"requires": ["io-base", "node-base", "router"]});
bundle/pjax-plugin/pjax-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/pjax-plugin/pjax-plugin.js", code: [] };-_yuitest_coverage["build/pjax-plugin/pjax-plugin.js"].code=["YUI.add('pjax-plugin', function (Y, NAME) {","","/**","Node plugin that provides seamless, gracefully degrading pjax functionality.","","@module pjax","@submodule pjax-plugin","@since 3.5.0","**/","","/**","Node plugin that provides seamless, gracefully degrading pjax functionality.","","@class Plugin.Pjax","@extends Pjax","@since 3.5.0","**/","","Y.Plugin.Pjax = Y.Base.create('pjaxPlugin', Y.Pjax, [Y.Plugin.Base], {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," this.set('container', config.host);"," }","}, {"," NS: 'pjax'","});","","","}, '3.7.2', {\"requires\": [\"node-pluginhost\", \"pjax\", \"plugin\"]});"];+_yuitest_coverage["build/pjax-plugin/pjax-plugin.js"].code=["YUI.add('pjax-plugin', function (Y, NAME) {","","/**","Node plugin that provides seamless, gracefully degrading pjax functionality.","","@module pjax","@submodule pjax-plugin","@since 3.5.0","**/","","/**","Node plugin that provides seamless, gracefully degrading pjax functionality.","","@class Plugin.Pjax","@extends Pjax","@since 3.5.0","**/","","Y.Plugin.Pjax = Y.Base.create('pjaxPlugin', Y.Pjax, [Y.Plugin.Base], {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," this.set('container', config.host);"," }","}, {"," NS: 'pjax'","});","","","}, '3.7.3', {\"requires\": [\"node-pluginhost\", \"pjax\", \"plugin\"]});"]; _yuitest_coverage["build/pjax-plugin/pjax-plugin.js"].lines = {"1":0,"19":0,"22":0}; _yuitest_coverage["build/pjax-plugin/pjax-plugin.js"].functions = {"initializer:21":0,"(anonymous 1):1":0}; _yuitest_coverage["build/pjax-plugin/pjax-plugin.js"].coveredLines = 3;@@ -70,4 +70,4 @@ }); -}, '3.7.2', {"requires": ["node-pluginhost", "pjax", "plugin"]});+}, '3.7.3', {"requires": ["node-pluginhost", "pjax", "plugin"]});
bundle/pjax-plugin/pjax-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,4 +32,4 @@ }); -}, '3.7.2', {"requires": ["node-pluginhost", "pjax", "plugin"]});+}, '3.7.3', {"requires": ["node-pluginhost", "pjax", "plugin"]});
bundle/pjax-plugin/pjax-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("pjax-plugin",function(e,t){e.Plugin.Pjax=e.Base.create("pjaxPlugin",e.Pjax,[e.Plugin.Base],{initializer:function(e){this.set("container",e.host)}},{NS:"pjax"})},"3.7.2",{requires:["node-pluginhost","pjax","plugin"]});+YUI.add("pjax-plugin",function(e,t){e.Plugin.Pjax=e.Base.create("pjaxPlugin",e.Pjax,[e.Plugin.Base],{initializer:function(e){this.set("container",e.host)}},{NS:"pjax"})},"3.7.3",{requires:["node-pluginhost","pjax","plugin"]});
bundle/pjax-plugin/pjax-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,4 +32,4 @@ }); -}, '3.7.2', {"requires": ["node-pluginhost", "pjax", "plugin"]});+}, '3.7.3', {"requires": ["node-pluginhost", "pjax", "plugin"]});
bundle/pjax/pjax-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/pjax/pjax.js", code: [] };-_yuitest_coverage["build/pjax/pjax.js"].code=["YUI.add('pjax', function (Y, NAME) {","","/**","Provides seamless, gracefully degrading Pjax (pushState + Ajax) functionality,","which makes it easy to progressively enhance standard links on the page so that","they can be loaded normally in old browsers, or via Ajax (with HTML5 history","support) in newer browsers.","","@module pjax","@main","@since 3.5.0","**/","","/**","A stack of middleware which forms the default Pjax route.","","@property defaultRoute","@type Array","@static","@since 3.7.0","**/","var defaultRoute = ['loadContent', '_defaultRoute'],","","/**","Fired when an error occurs while attempting to load a URL via Ajax.","","@event error","@param {Object} content Content extracted from the response, if any."," @param {Node} content.node A `Y.Node` instance for a document fragment"," containing the extracted HTML content."," @param {String} [content.title] The title of the HTML page, if any,"," extracted using the `titleSelector` attribute. If `titleSelector` is"," not set or if a title could not be found, this property will be"," `undefined`.","@param {String} responseText Raw Ajax response text.","@param {Number} status HTTP status code for the Ajax response.","@param {String} url The absolute URL that failed to load.","@since 3.5.0","**/","EVT_ERROR = 'error',","","/**","Fired when a URL is successfully loaded via Ajax.","","@event load","@param {Object} content Content extracted from the response, if any."," @param {Node} content.node A `Y.Node` instance for a document fragment"," containing the extracted HTML content."," @param {String} [content.title] The title of the HTML page, if any,"," extracted using the `titleSelector` attribute. If `titleSelector` is"," not set or if a title could not be found, this property will be"," `undefined`.","@param {String} responseText Raw Ajax response text.","@param {Number} status HTTP status code for the Ajax response.","@param {String} url The absolute URL that was loaded.","@since 3.5.0","**/","EVT_LOAD = 'load';","","/**","Provides seamless, gracefully degrading Pjax (pushState + Ajax) functionality,","which makes it easy to progressively enhance standard links on the page so that","they can be loaded normally in old browsers, or via Ajax (with HTML5 history","support) in newer browsers.","","@class Pjax","@extends Router","@uses PjaxBase","@uses PjaxContent","@constructor","@param {Object} [config] Config attributes.","@since 3.5.0","**/","Y.Pjax = Y.Base.create('pjax', Y.Router, [Y.PjaxBase, Y.PjaxContent], {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," this.publish(EVT_ERROR, {defaultFn: this._defCompleteFn});"," this.publish(EVT_LOAD, {defaultFn: this._defCompleteFn});"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Default Pjax route callback. Fires either the `load` or `error` event based"," on the status of the `Y.io` request made by the `loadContent()` middleware.",""," **Note:** This route callback assumes that it's called after the"," `loadContent()` middleware.",""," @method _defaultRoute"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @protected"," @since 3.5.0"," @see Y.Pjax.defaultRoute"," **/"," _defaultRoute: function (req, res, next) {"," var ioResponse = res.ioResponse,"," status = ioResponse.status,"," event = status >= 200 && status < 300 ? EVT_LOAD : EVT_ERROR;",""," this.fire(event, {"," content : res.content,"," responseText: ioResponse.responseText,"," status : status,"," url : req.ioURL"," });",""," next();"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Default event handler for both the `error` and `load` events. Attempts to"," insert the loaded content into the `container` node and update the page's"," title.",""," @method _defCompleteFn"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _defCompleteFn: function (e) {"," var container = this.get('container'),"," content = e.content;",""," if (container && content.node) {"," container.setHTML(content.node);"," }",""," if (content.title && Y.config.doc) {"," Y.config.doc.title = content.title;"," }"," }","}, {"," ATTRS: {"," /**"," Node into which content should be inserted when a page is loaded via"," Pjax. This node's existing contents will be removed to make way for the"," new content.",""," If not set, loaded content will not be automatically inserted into the"," page.",""," @attribute container"," @type Node"," @default null"," @since 3.5.0"," **/"," container: {"," value : null,"," setter: Y.one"," },",""," // Inherited from Router and already documented there."," routes: {"," value: ["," {path: '*', callbacks: defaultRoute}"," ]"," }"," },",""," // Documented towards the top of this file."," defaultRoute: defaultRoute","});","","","}, '3.7.2', {\"requires\": [\"pjax-base\", \"pjax-content\"]});"];+_yuitest_coverage["build/pjax/pjax.js"].code=["YUI.add('pjax', function (Y, NAME) {","","/**","Provides seamless, gracefully degrading Pjax (pushState + Ajax) functionality,","which makes it easy to progressively enhance standard links on the page so that","they can be loaded normally in old browsers, or via Ajax (with HTML5 history","support) in newer browsers.","","@module pjax","@main","@since 3.5.0","**/","","/**","A stack of middleware which forms the default Pjax route.","","@property defaultRoute","@type Array","@static","@since 3.7.0","**/","var defaultRoute = ['loadContent', '_defaultRoute'],","","/**","Fired when an error occurs while attempting to load a URL via Ajax.","","@event error","@param {Object} content Content extracted from the response, if any."," @param {Node} content.node A `Y.Node` instance for a document fragment"," containing the extracted HTML content."," @param {String} [content.title] The title of the HTML page, if any,"," extracted using the `titleSelector` attribute. If `titleSelector` is"," not set or if a title could not be found, this property will be"," `undefined`.","@param {String} responseText Raw Ajax response text.","@param {Number} status HTTP status code for the Ajax response.","@param {String} url The absolute URL that failed to load.","@since 3.5.0","**/","EVT_ERROR = 'error',","","/**","Fired when a URL is successfully loaded via Ajax.","","@event load","@param {Object} content Content extracted from the response, if any."," @param {Node} content.node A `Y.Node` instance for a document fragment"," containing the extracted HTML content."," @param {String} [content.title] The title of the HTML page, if any,"," extracted using the `titleSelector` attribute. If `titleSelector` is"," not set or if a title could not be found, this property will be"," `undefined`.","@param {String} responseText Raw Ajax response text.","@param {Number} status HTTP status code for the Ajax response.","@param {String} url The absolute URL that was loaded.","@since 3.5.0","**/","EVT_LOAD = 'load';","","/**","Provides seamless, gracefully degrading Pjax (pushState + Ajax) functionality,","which makes it easy to progressively enhance standard links on the page so that","they can be loaded normally in old browsers, or via Ajax (with HTML5 history","support) in newer browsers.","","@class Pjax","@extends Router","@uses PjaxBase","@uses PjaxContent","@constructor","@param {Object} [config] Config attributes.","@since 3.5.0","**/","Y.Pjax = Y.Base.create('pjax', Y.Router, [Y.PjaxBase, Y.PjaxContent], {"," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function () {"," this.publish(EVT_ERROR, {defaultFn: this._defCompleteFn});"," this.publish(EVT_LOAD, {defaultFn: this._defCompleteFn});"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Default Pjax route callback. Fires either the `load` or `error` event based"," on the status of the `Y.io` request made by the `loadContent()` middleware.",""," **Note:** This route callback assumes that it's called after the"," `loadContent()` middleware.",""," @method _defaultRoute"," @param {Object} req Request object."," @param {Object} res Response Object."," @param {Function} next Function to pass control to the next route callback."," @protected"," @since 3.5.0"," @see Y.Pjax.defaultRoute"," **/"," _defaultRoute: function (req, res, next) {"," var ioResponse = res.ioResponse,"," status = ioResponse.status,"," event = status >= 200 && status < 300 ? EVT_LOAD : EVT_ERROR;",""," this.fire(event, {"," content : res.content,"," responseText: ioResponse.responseText,"," status : status,"," url : req.ioURL"," });",""," next();"," },",""," // -- Event Handlers -------------------------------------------------------",""," /**"," Default event handler for both the `error` and `load` events. Attempts to"," insert the loaded content into the `container` node and update the page's"," title.",""," @method _defCompleteFn"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _defCompleteFn: function (e) {"," var container = this.get('container'),"," content = e.content;",""," if (container && content.node) {"," container.setHTML(content.node);"," }",""," if (content.title && Y.config.doc) {"," Y.config.doc.title = content.title;"," }"," }","}, {"," ATTRS: {"," /**"," Node into which content should be inserted when a page is loaded via"," Pjax. This node's existing contents will be removed to make way for the"," new content.",""," If not set, loaded content will not be automatically inserted into the"," page.",""," @attribute container"," @type Node"," @default null"," @since 3.5.0"," **/"," container: {"," value : null,"," setter: Y.one"," },",""," // Inherited from Router and already documented there."," routes: {"," value: ["," {path: '*', callbacks: defaultRoute}"," ]"," }"," },",""," // Documented towards the top of this file."," defaultRoute: defaultRoute","});","","","}, '3.7.3', {\"requires\": [\"pjax-base\", \"pjax-content\"]});"]; _yuitest_coverage["build/pjax/pjax.js"].lines = {"1":0,"22":0,"74":0,"77":0,"78":0,"99":0,"103":0,"110":0,"126":0,"129":0,"130":0,"133":0,"134":0}; _yuitest_coverage["build/pjax/pjax.js"].functions = {"initializer:76":0,"_defaultRoute:98":0,"_defCompleteFn:125":0,"(anonymous 1):1":0}; _yuitest_coverage["build/pjax/pjax.js"].coveredLines = 13;@@ -223,4 +223,4 @@ }); -}, '3.7.2', {"requires": ["pjax-base", "pjax-content"]});+}, '3.7.3', {"requires": ["pjax-base", "pjax-content"]});
bundle/pjax/pjax-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -173,4 +173,4 @@ }); -}, '3.7.2', {"requires": ["pjax-base", "pjax-content"]});+}, '3.7.3', {"requires": ["pjax-base", "pjax-content"]});
bundle/pjax/pjax-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("pjax",function(e,t){var n=["loadContent","_defaultRoute"],r="error",i="load";e.Pjax=e.Base.create("pjax",e.Router,[e.PjaxBase,e.PjaxContent],{initializer:function(){this.publish(r,{defaultFn:this._defCompleteFn}),this.publish(i,{defaultFn:this._defCompleteFn})},_defaultRoute:function(e,t,n){var s=t.ioResponse,o=s.status,u=o>=200&&o<300?i:r;this.fire(u,{content:t.content,responseText:s.responseText,status:o,url:e.ioURL}),n()},_defCompleteFn:function(t){var n=this.get("container"),r=t.content;n&&r.node&&n.setHTML(r.node),r.title&&e.config.doc&&(e.config.doc.title=r.title)}},{ATTRS:{container:{value:null,setter:e.one},routes:{value:[{path:"*",callbacks:n}]}},defaultRoute:n})},"3.7.2",{requires:["pjax-base","pjax-content"]});+YUI.add("pjax",function(e,t){var n=["loadContent","_defaultRoute"],r="error",i="load";e.Pjax=e.Base.create("pjax",e.Router,[e.PjaxBase,e.PjaxContent],{initializer:function(){this.publish(r,{defaultFn:this._defCompleteFn}),this.publish(i,{defaultFn:this._defCompleteFn})},_defaultRoute:function(e,t,n){var s=t.ioResponse,o=s.status,u=o>=200&&o<300?i:r;this.fire(u,{content:t.content,responseText:s.responseText,status:o,url:e.ioURL}),n()},_defCompleteFn:function(t){var n=this.get("container"),r=t.content;n&&r.node&&n.setHTML(r.node),r.title&&e.config.doc&&(e.config.doc.title=r.title)}},{ATTRS:{container:{value:null,setter:e.one},routes:{value:[{path:"*",callbacks:n}]}},defaultRoute:n})},"3.7.3",{requires:["pjax-base","pjax-content"]});
bundle/pjax/pjax.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -173,4 +173,4 @@ }); -}, '3.7.2', {"requires": ["pjax-base", "pjax-content"]});+}, '3.7.3', {"requires": ["pjax-base", "pjax-content"]});
bundle/plugin/plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/plugin/plugin.js", code: [] };-_yuitest_coverage["build/plugin/plugin.js"].code=["YUI.add('plugin', function (Y, NAME) {",""," /**"," * Provides the base Plugin class, which plugin developers should extend, when creating custom plugins"," *"," * @module plugin"," */",""," /**"," * The base class for all Plugin instances."," *"," * @class Plugin.Base "," * @extends Base"," * @param {Object} config Configuration object with property name/value pairs."," */"," function Plugin(config) {"," if (! (this.hasImpl && this.hasImpl(Y.Plugin.Base)) ) {"," Plugin.superclass.constructor.apply(this, arguments);"," } else {"," Plugin.prototype.initializer.apply(this, arguments);"," }"," }",""," /**"," * Object defining the set of attributes supported by the Plugin.Base class"," * "," * @property ATTRS"," * @type Object"," * @static"," */"," Plugin.ATTRS = {",""," /**"," * The plugin's host object."," *"," * @attribute host"," * @writeonce"," * @type Plugin.Host"," */"," host : {"," writeOnce: true"," }"," };",""," /**"," * The string identifying the Plugin.Base class. Plugins extending"," * Plugin.Base should set their own NAME value."," *"," * @property NAME"," * @type String"," * @static"," */"," Plugin.NAME = 'plugin';",""," /**"," * The name of the property the the plugin will be attached to"," * when plugged into a Plugin Host. Plugins extending Plugin.Base,"," * should set their own NS value."," *"," * @property NS"," * @type String"," * @static"," */"," Plugin.NS = 'plugin';",""," Y.extend(Plugin, Y.Base, {",""," /**"," * The list of event handles for event listeners or AOP injected methods"," * applied by the plugin to the host object."," *"," * @property _handles"," * @private"," * @type Array"," * @value null"," */"," _handles: null,",""," /**"," * Initializer lifecycle implementation."," *"," * @method initializer"," * @param {Object} config Configuration object with property name/value pairs."," */"," initializer : function(config) {"," this._handles = [];"," },",""," /**"," * Destructor lifecycle implementation."," *"," * Removes any event listeners or injected methods applied by the Plugin"," *"," * @method destructor"," */"," destructor: function() {"," // remove all handles"," if (this._handles) {"," for (var i = 0, l = this._handles.length; i < l; i++) {"," this._handles[i].detach();"," }"," }"," },",""," /**"," * Listens for the \"on\" moment of events fired by the host, "," * or injects code \"before\" a given method on the host."," *"," * @method doBefore"," *"," * @param strMethod {String} The event to listen for, or method to inject logic before."," * @param fn {Function} The handler function. For events, the \"on\" moment listener. For methods, the function to execute before the given method is executed."," * @param context {Object} An optional context to call the handler with. The default context is the plugin instance."," * @return handle {EventHandle} The detach handle for the handler."," */"," doBefore: function(strMethod, fn, context) {"," var host = this.get(\"host\"), handle;",""," if (strMethod in host) { // method"," handle = this.beforeHostMethod(strMethod, fn, context);"," } else if (host.on) { // event"," handle = this.onHostEvent(strMethod, fn, context);"," }",""," return handle;"," },",""," /**"," * Listens for the \"after\" moment of events fired by the host, "," * or injects code \"after\" a given method on the host."," *"," * @method doAfter"," *"," * @param strMethod {String} The event to listen for, or method to inject logic after."," * @param fn {Function} The handler function. For events, the \"after\" moment listener. For methods, the function to execute after the given method is executed."," * @param context {Object} An optional context to call the handler with. The default context is the plugin instance."," * @return handle {EventHandle} The detach handle for the listener."," */"," doAfter: function(strMethod, fn, context) {"," var host = this.get(\"host\"), handle;",""," if (strMethod in host) { // method"," handle = this.afterHostMethod(strMethod, fn, context);"," } else if (host.after) { // event"," handle = this.afterHostEvent(strMethod, fn, context);"," }",""," return handle;"," },",""," /**"," * Listens for the \"on\" moment of events fired by the host object."," *"," * Listeners attached through this method will be detached when the plugin is unplugged."," * "," * @method onHostEvent"," * @param {String | Object} type The event type."," * @param {Function} fn The listener."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the listener. "," */"," onHostEvent : function(type, fn, context) {"," var handle = this.get(\"host\").on(type, fn, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Listens for the \"after\" moment of events fired by the host object."," *"," * Listeners attached through this method will be detached when the plugin is unplugged."," * "," * @method afterHostEvent"," * @param {String | Object} type The event type."," * @param {Function} fn The listener."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the listener. "," */"," afterHostEvent : function(type, fn, context) {"," var handle = this.get(\"host\").after(type, fn, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Injects a function to be executed before a given method on host object."," *"," * The function will be detached when the plugin is unplugged."," *"," * @method beforeHostMethod"," * @param {String} method The name of the method to inject the function before."," * @param {Function} fn The function to inject."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the injected function. "," */"," beforeHostMethod : function(strMethod, fn, context) {"," var handle = Y.Do.before(fn, this.get(\"host\"), strMethod, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Injects a function to be executed after a given method on host object."," *"," * The function will be detached when the plugin is unplugged."," *"," * @method afterHostMethod"," * @param {String} method The name of the method to inject the function after."," * @param {Function} fn The function to inject."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the injected function. "," */"," afterHostMethod : function(strMethod, fn, context) {"," var handle = Y.Do.after(fn, this.get(\"host\"), strMethod, context || this);"," this._handles.push(handle);"," return handle;"," },",""," toString: function() {"," return this.constructor.NAME + '[' + this.constructor.NS + ']';"," }"," });",""," Y.namespace(\"Plugin\").Base = Plugin;","","","}, '3.7.2', {\"requires\": [\"base-base\"]});"];+_yuitest_coverage["build/plugin/plugin.js"].code=["YUI.add('plugin', function (Y, NAME) {",""," /**"," * Provides the base Plugin class, which plugin developers should extend, when creating custom plugins"," *"," * @module plugin"," */",""," /**"," * The base class for all Plugin instances."," *"," * @class Plugin.Base "," * @extends Base"," * @param {Object} config Configuration object with property name/value pairs."," */"," function Plugin(config) {"," if (! (this.hasImpl && this.hasImpl(Y.Plugin.Base)) ) {"," Plugin.superclass.constructor.apply(this, arguments);"," } else {"," Plugin.prototype.initializer.apply(this, arguments);"," }"," }",""," /**"," * Object defining the set of attributes supported by the Plugin.Base class"," * "," * @property ATTRS"," * @type Object"," * @static"," */"," Plugin.ATTRS = {",""," /**"," * The plugin's host object."," *"," * @attribute host"," * @writeonce"," * @type Plugin.Host"," */"," host : {"," writeOnce: true"," }"," };",""," /**"," * The string identifying the Plugin.Base class. Plugins extending"," * Plugin.Base should set their own NAME value."," *"," * @property NAME"," * @type String"," * @static"," */"," Plugin.NAME = 'plugin';",""," /**"," * The name of the property the the plugin will be attached to"," * when plugged into a Plugin Host. Plugins extending Plugin.Base,"," * should set their own NS value."," *"," * @property NS"," * @type String"," * @static"," */"," Plugin.NS = 'plugin';",""," Y.extend(Plugin, Y.Base, {",""," /**"," * The list of event handles for event listeners or AOP injected methods"," * applied by the plugin to the host object."," *"," * @property _handles"," * @private"," * @type Array"," * @value null"," */"," _handles: null,",""," /**"," * Initializer lifecycle implementation."," *"," * @method initializer"," * @param {Object} config Configuration object with property name/value pairs."," */"," initializer : function(config) {"," this._handles = [];"," },",""," /**"," * Destructor lifecycle implementation."," *"," * Removes any event listeners or injected methods applied by the Plugin"," *"," * @method destructor"," */"," destructor: function() {"," // remove all handles"," if (this._handles) {"," for (var i = 0, l = this._handles.length; i < l; i++) {"," this._handles[i].detach();"," }"," }"," },",""," /**"," * Listens for the \"on\" moment of events fired by the host, "," * or injects code \"before\" a given method on the host."," *"," * @method doBefore"," *"," * @param strMethod {String} The event to listen for, or method to inject logic before."," * @param fn {Function} The handler function. For events, the \"on\" moment listener. For methods, the function to execute before the given method is executed."," * @param context {Object} An optional context to call the handler with. The default context is the plugin instance."," * @return handle {EventHandle} The detach handle for the handler."," */"," doBefore: function(strMethod, fn, context) {"," var host = this.get(\"host\"), handle;",""," if (strMethod in host) { // method"," handle = this.beforeHostMethod(strMethod, fn, context);"," } else if (host.on) { // event"," handle = this.onHostEvent(strMethod, fn, context);"," }",""," return handle;"," },",""," /**"," * Listens for the \"after\" moment of events fired by the host, "," * or injects code \"after\" a given method on the host."," *"," * @method doAfter"," *"," * @param strMethod {String} The event to listen for, or method to inject logic after."," * @param fn {Function} The handler function. For events, the \"after\" moment listener. For methods, the function to execute after the given method is executed."," * @param context {Object} An optional context to call the handler with. The default context is the plugin instance."," * @return handle {EventHandle} The detach handle for the listener."," */"," doAfter: function(strMethod, fn, context) {"," var host = this.get(\"host\"), handle;",""," if (strMethod in host) { // method"," handle = this.afterHostMethod(strMethod, fn, context);"," } else if (host.after) { // event"," handle = this.afterHostEvent(strMethod, fn, context);"," }",""," return handle;"," },",""," /**"," * Listens for the \"on\" moment of events fired by the host object."," *"," * Listeners attached through this method will be detached when the plugin is unplugged."," * "," * @method onHostEvent"," * @param {String | Object} type The event type."," * @param {Function} fn The listener."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the listener. "," */"," onHostEvent : function(type, fn, context) {"," var handle = this.get(\"host\").on(type, fn, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Listens for the \"after\" moment of events fired by the host object."," *"," * Listeners attached through this method will be detached when the plugin is unplugged."," * "," * @method afterHostEvent"," * @param {String | Object} type The event type."," * @param {Function} fn The listener."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the listener. "," */"," afterHostEvent : function(type, fn, context) {"," var handle = this.get(\"host\").after(type, fn, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Injects a function to be executed before a given method on host object."," *"," * The function will be detached when the plugin is unplugged."," *"," * @method beforeHostMethod"," * @param {String} method The name of the method to inject the function before."," * @param {Function} fn The function to inject."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the injected function. "," */"," beforeHostMethod : function(strMethod, fn, context) {"," var handle = Y.Do.before(fn, this.get(\"host\"), strMethod, context || this);"," this._handles.push(handle);"," return handle;"," },",""," /**"," * Injects a function to be executed after a given method on host object."," *"," * The function will be detached when the plugin is unplugged."," *"," * @method afterHostMethod"," * @param {String} method The name of the method to inject the function after."," * @param {Function} fn The function to inject."," * @param {Object} context The execution context. Defaults to the plugin instance."," * @return handle {EventHandle} The detach handle for the injected function. "," */"," afterHostMethod : function(strMethod, fn, context) {"," var handle = Y.Do.after(fn, this.get(\"host\"), strMethod, context || this);"," this._handles.push(handle);"," return handle;"," },",""," toString: function() {"," return this.constructor.NAME + '[' + this.constructor.NS + ']';"," }"," });",""," Y.namespace(\"Plugin\").Base = Plugin;","","","}, '3.7.3', {\"requires\": [\"base-base\"]});"]; _yuitest_coverage["build/plugin/plugin.js"].lines = {"1":0,"16":0,"17":0,"18":0,"20":0,"31":0,"53":0,"64":0,"66":0,"86":0,"98":0,"99":0,"100":0,"117":0,"119":0,"120":0,"121":0,"122":0,"125":0,"140":0,"142":0,"143":0,"144":0,"145":0,"148":0,"163":0,"164":0,"165":0,"180":0,"181":0,"182":0,"197":0,"198":0,"199":0,"214":0,"215":0,"216":0,"220":0,"224":0}; _yuitest_coverage["build/plugin/plugin.js"].functions = {"Plugin:16":0,"initializer:85":0,"destructor:96":0,"doBefore:116":0,"doAfter:139":0,"onHostEvent:162":0,"afterHostEvent:179":0,"beforeHostMethod:196":0,"afterHostMethod:213":0,"toString:219":0,"(anonymous 1):1":0}; _yuitest_coverage["build/plugin/plugin.js"].coveredLines = 39;@@ -313,4 +313,4 @@ Y.namespace("Plugin").Base = Plugin; -}, '3.7.2', {"requires": ["base-base"]});+}, '3.7.3', {"requires": ["base-base"]});
bundle/plugin/plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -232,4 +232,4 @@ Y.namespace("Plugin").Base = Plugin; -}, '3.7.2', {"requires": ["base-base"]});+}, '3.7.3', {"requires": ["base-base"]});
bundle/plugin/plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("plugin",function(e,t){function n(t){!this.hasImpl||!this.hasImpl(e.Plugin.Base)?n.superclass.constructor.apply(this,arguments):n.prototype.initializer.apply(this,arguments)}n.ATTRS={host:{writeOnce:!0}},n.NAME="plugin",n.NS="plugin",e.extend(n,e.Base,{_handles:null,initializer:function(e){this._handles=[]},destructor:function(){if(this._handles)for(var e=0,t=this._handles.length;e<t;e++)this._handles[e].detach()},doBefore:function(e,t,n){var r=this.get("host"),i;return e in r?i=this.beforeHostMethod(e,t,n):r.on&&(i=this.onHostEvent(e,t,n)),i},doAfter:function(e,t,n){var r=this.get("host"),i;return e in r?i=this.afterHostMethod(e,t,n):r.after&&(i=this.afterHostEvent(e,t,n)),i},onHostEvent:function(e,t,n){var r=this.get("host").on(e,t,n||this);return this._handles.push(r),r},afterHostEvent:function(e,t,n){var r=this.get("host").after(e,t,n||this);return this._handles.push(r),r},beforeHostMethod:function(t,n,r){var i=e.Do.before(n,this.get("host"),t,r||this);return this._handles.push(i),i},afterHostMethod:function(t,n,r){var i=e.Do.after(n,this.get("host"),t,r||this);return this._handles.push(i),i},toString:function(){return this.constructor.NAME+"["+this.constructor.NS+"]"}}),e.namespace("Plugin").Base=n},"3.7.2",{requires:["base-base"]});+YUI.add("plugin",function(e,t){function n(t){!this.hasImpl||!this.hasImpl(e.Plugin.Base)?n.superclass.constructor.apply(this,arguments):n.prototype.initializer.apply(this,arguments)}n.ATTRS={host:{writeOnce:!0}},n.NAME="plugin",n.NS="plugin",e.extend(n,e.Base,{_handles:null,initializer:function(e){this._handles=[]},destructor:function(){if(this._handles)for(var e=0,t=this._handles.length;e<t;e++)this._handles[e].detach()},doBefore:function(e,t,n){var r=this.get("host"),i;return e in r?i=this.beforeHostMethod(e,t,n):r.on&&(i=this.onHostEvent(e,t,n)),i},doAfter:function(e,t,n){var r=this.get("host"),i;return e in r?i=this.afterHostMethod(e,t,n):r.after&&(i=this.afterHostEvent(e,t,n)),i},onHostEvent:function(e,t,n){var r=this.get("host").on(e,t,n||this);return this._handles.push(r),r},afterHostEvent:function(e,t,n){var r=this.get("host").after(e,t,n||this);return this._handles.push(r),r},beforeHostMethod:function(t,n,r){var i=e.Do.before(n,this.get("host"),t,r||this);return this._handles.push(i),i},afterHostMethod:function(t,n,r){var i=e.Do.after(n,this.get("host"),t,r||this);return this._handles.push(i),i},toString:function(){return this.constructor.NAME+"["+this.constructor.NS+"]"}}),e.namespace("Plugin").Base=n},"3.7.3",{requires:["base-base"]});
bundle/plugin/plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -230,4 +230,4 @@ Y.namespace("Plugin").Base = Plugin; -}, '3.7.2', {"requires": ["base-base"]});+}, '3.7.3', {"requires": ["base-base"]});
bundle/pluginhost-base/pluginhost-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/pluginhost-base/pluginhost-base.js", code: [] };-_yuitest_coverage["build/pluginhost-base/pluginhost-base.js"].code=["YUI.add('pluginhost-base', function (Y, NAME) {",""," /**"," * Provides the augmentable PluginHost interface, which can be added to any class."," * @module pluginhost"," */",""," /**"," * Provides the augmentable PluginHost interface, which can be added to any class."," * @module pluginhost-base"," */",""," /**"," * <p>"," * An augmentable class, which provides the augmented class with the ability to host plugins."," * It adds <a href=\"#method_plug\">plug</a> and <a href=\"#method_unplug\">unplug</a> methods to the augmented class, which can "," * be used to add or remove plugins from instances of the class."," * </p>"," *"," * <p>Plugins can also be added through the constructor configuration object passed to the host class' constructor using"," * the \"plugins\" property. Supported values for the \"plugins\" property are those defined by the <a href=\"#method_plug\">plug</a> method. "," * "," * For example the following code would add the AnimPlugin and IOPlugin to Overlay (the plugin host):"," * <xmp>"," * var o = new Overlay({plugins: [ AnimPlugin, {fn:IOPlugin, cfg:{section:\"header\"}}]});"," * </xmp>"," * </p>"," * <p>"," * Plug.Host's protected <a href=\"#method_initPlugins\">_initPlugins</a> and <a href=\"#method_destroyPlugins\">_destroyPlugins</a> "," * methods should be invoked by the host class at the appropriate point in the host's lifecyle. "," * </p>"," *"," * @class Plugin.Host"," */",""," var L = Y.Lang;",""," function PluginHost() {"," this._plugins = {};"," }",""," PluginHost.prototype = {",""," /**"," * Adds a plugin to the host object. This will instantiate the "," * plugin and attach it to the configured namespace on the host object."," *"," * @method plug"," * @chainable"," * @param P {Function | Object |Array} Accepts the plugin class, or an "," * object with a \"fn\" property specifying the plugin class and "," * a \"cfg\" property specifying the configuration for the Plugin."," * <p>"," * Additionally an Array can also be passed in, with the above function or "," * object values, allowing the user to add multiple plugins in a single call."," * </p>"," * @param config (Optional) If the first argument is the plugin class, the second argument"," * can be the configuration for the plugin."," * @return {Base} A reference to the host object"," */"," plug: function(Plugin, config) {"," var i, ln, ns;",""," if (L.isArray(Plugin)) {"," for (i = 0, ln = Plugin.length; i < ln; i++) {"," this.plug(Plugin[i]);"," }"," } else {"," if (Plugin && !L.isFunction(Plugin)) {"," config = Plugin.cfg;"," Plugin = Plugin.fn;"," }",""," // Plugin should be fn by now"," if (Plugin && Plugin.NS) {"," ns = Plugin.NS;"," "," config = config || {};"," config.host = this;"," "," if (this.hasPlugin(ns)) {"," // Update config"," if (this[ns].setAttrs) {"," this[ns].setAttrs(config);"," }"," } else {"," // Create new instance"," this[ns] = new Plugin(config);"," this._plugins[ns] = Plugin;"," }"," }"," }"," return this;"," },",""," /**"," * Removes a plugin from the host object. This will destroy the "," * plugin instance and delete the namespace from the host object. "," *"," * @method unplug"," * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided,"," * all registered plugins are unplugged."," * @return {Base} A reference to the host object"," * @chainable"," */"," unplug: function(plugin) {"," var ns = plugin, "," plugins = this._plugins;"," "," if (plugin) {"," if (L.isFunction(plugin)) {"," ns = plugin.NS;"," if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {"," ns = null;"," }"," }"," "," if (ns) {"," if (this[ns]) {"," if (this[ns].destroy) {"," this[ns].destroy();"," }"," delete this[ns];"," }"," if (plugins[ns]) {"," delete plugins[ns];"," }"," }"," } else {"," for (ns in this._plugins) {"," if (this._plugins.hasOwnProperty(ns)) {"," this.unplug(ns);"," }"," }"," }"," return this;"," },",""," /**"," * Determines if a plugin has plugged into this host."," *"," * @method hasPlugin"," * @param {String} ns The plugin's namespace"," * @return {Plugin} Returns a truthy value (the plugin instance) if present, or undefined if not."," */"," hasPlugin : function(ns) {"," return (this._plugins[ns] && this[ns]);"," },",""," /**"," * Initializes static plugins registered on the host (using the"," * Base.plug static method) and any plugins passed to the "," * instance through the \"plugins\" configuration property."," *"," * @method _initPlugins"," * @param {Config} config The configuration object with property name/value pairs."," * @private"," */"," "," _initPlugins: function(config) {"," this._plugins = this._plugins || {};",""," if (this._initConfigPlugins) {"," this._initConfigPlugins(config);"," }"," },",""," /**"," * Unplugs and destroys all plugins on the host"," * @method _destroyPlugins"," * @private"," */"," _destroyPlugins: function() {"," this.unplug();"," }"," };",""," Y.namespace(\"Plugin\").Host = PluginHost;","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/pluginhost-base/pluginhost-base.js"].code=["YUI.add('pluginhost-base', function (Y, NAME) {",""," /**"," * Provides the augmentable PluginHost interface, which can be added to any class."," * @module pluginhost"," */",""," /**"," * Provides the augmentable PluginHost interface, which can be added to any class."," * @module pluginhost-base"," */",""," /**"," * <p>"," * An augmentable class, which provides the augmented class with the ability to host plugins."," * It adds <a href=\"#method_plug\">plug</a> and <a href=\"#method_unplug\">unplug</a> methods to the augmented class, which can "," * be used to add or remove plugins from instances of the class."," * </p>"," *"," * <p>Plugins can also be added through the constructor configuration object passed to the host class' constructor using"," * the \"plugins\" property. Supported values for the \"plugins\" property are those defined by the <a href=\"#method_plug\">plug</a> method. "," * "," * For example the following code would add the AnimPlugin and IOPlugin to Overlay (the plugin host):"," * <xmp>"," * var o = new Overlay({plugins: [ AnimPlugin, {fn:IOPlugin, cfg:{section:\"header\"}}]});"," * </xmp>"," * </p>"," * <p>"," * Plug.Host's protected <a href=\"#method_initPlugins\">_initPlugins</a> and <a href=\"#method_destroyPlugins\">_destroyPlugins</a> "," * methods should be invoked by the host class at the appropriate point in the host's lifecyle. "," * </p>"," *"," * @class Plugin.Host"," */",""," var L = Y.Lang;",""," function PluginHost() {"," this._plugins = {};"," }",""," PluginHost.prototype = {",""," /**"," * Adds a plugin to the host object. This will instantiate the "," * plugin and attach it to the configured namespace on the host object."," *"," * @method plug"," * @chainable"," * @param P {Function | Object |Array} Accepts the plugin class, or an "," * object with a \"fn\" property specifying the plugin class and "," * a \"cfg\" property specifying the configuration for the Plugin."," * <p>"," * Additionally an Array can also be passed in, with the above function or "," * object values, allowing the user to add multiple plugins in a single call."," * </p>"," * @param config (Optional) If the first argument is the plugin class, the second argument"," * can be the configuration for the plugin."," * @return {Base} A reference to the host object"," */"," plug: function(Plugin, config) {"," var i, ln, ns;",""," if (L.isArray(Plugin)) {"," for (i = 0, ln = Plugin.length; i < ln; i++) {"," this.plug(Plugin[i]);"," }"," } else {"," if (Plugin && !L.isFunction(Plugin)) {"," config = Plugin.cfg;"," Plugin = Plugin.fn;"," }",""," // Plugin should be fn by now"," if (Plugin && Plugin.NS) {"," ns = Plugin.NS;"," "," config = config || {};"," config.host = this;"," "," if (this.hasPlugin(ns)) {"," // Update config"," if (this[ns].setAttrs) {"," this[ns].setAttrs(config);"," }"," } else {"," // Create new instance"," this[ns] = new Plugin(config);"," this._plugins[ns] = Plugin;"," }"," }"," }"," return this;"," },",""," /**"," * Removes a plugin from the host object. This will destroy the "," * plugin instance and delete the namespace from the host object. "," *"," * @method unplug"," * @param {String | Function} plugin The namespace of the plugin, or the plugin class with the static NS namespace property defined. If not provided,"," * all registered plugins are unplugged."," * @return {Base} A reference to the host object"," * @chainable"," */"," unplug: function(plugin) {"," var ns = plugin, "," plugins = this._plugins;"," "," if (plugin) {"," if (L.isFunction(plugin)) {"," ns = plugin.NS;"," if (ns && (!plugins[ns] || plugins[ns] !== plugin)) {"," ns = null;"," }"," }"," "," if (ns) {"," if (this[ns]) {"," if (this[ns].destroy) {"," this[ns].destroy();"," }"," delete this[ns];"," }"," if (plugins[ns]) {"," delete plugins[ns];"," }"," }"," } else {"," for (ns in this._plugins) {"," if (this._plugins.hasOwnProperty(ns)) {"," this.unplug(ns);"," }"," }"," }"," return this;"," },",""," /**"," * Determines if a plugin has plugged into this host."," *"," * @method hasPlugin"," * @param {String} ns The plugin's namespace"," * @return {Plugin} Returns a truthy value (the plugin instance) if present, or undefined if not."," */"," hasPlugin : function(ns) {"," return (this._plugins[ns] && this[ns]);"," },",""," /**"," * Initializes static plugins registered on the host (using the"," * Base.plug static method) and any plugins passed to the "," * instance through the \"plugins\" configuration property."," *"," * @method _initPlugins"," * @param {Config} config The configuration object with property name/value pairs."," * @private"," */"," "," _initPlugins: function(config) {"," this._plugins = this._plugins || {};",""," if (this._initConfigPlugins) {"," this._initConfigPlugins(config);"," }"," },",""," /**"," * Unplugs and destroys all plugins on the host"," * @method _destroyPlugins"," * @private"," */"," _destroyPlugins: function() {"," this.unplug();"," }"," };",""," Y.namespace(\"Plugin\").Host = PluginHost;","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/pluginhost-base/pluginhost-base.js"].lines = {"1":0,"36":0,"38":0,"39":0,"42":0,"62":0,"64":0,"65":0,"66":0,"69":0,"70":0,"71":0,"75":0,"76":0,"78":0,"79":0,"81":0,"83":0,"84":0,"88":0,"89":0,"93":0,"107":0,"110":0,"111":0,"112":0,"113":0,"114":0,"118":0,"119":0,"120":0,"121":0,"123":0,"125":0,"126":0,"130":0,"131":0,"132":0,"136":0,"147":0,"161":0,"163":0,"164":0,"174":0,"178":0}; _yuitest_coverage["build/pluginhost-base/pluginhost-base.js"].functions = {"PluginHost:38":0,"plug:61":0,"unplug:106":0,"hasPlugin:146":0,"_initPlugins:160":0,"_destroyPlugins:173":0,"(anonymous 1):1":0}; _yuitest_coverage["build/pluginhost-base/pluginhost-base.js"].coveredLines = 45;@@ -269,4 +269,4 @@ Y.namespace("Plugin").Host = PluginHost; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/pluginhost-base/pluginhost-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -186,4 +186,4 @@ Y.namespace("Plugin").Host = PluginHost; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/pluginhost-base/pluginhost-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("pluginhost-base",function(e,t){function r(){this._plugins={}}var n=e.Lang;r.prototype={plug:function(e,t){var r,i,s;if(n.isArray(e))for(r=0,i=e.length;r<i;r++)this.plug(e[r]);else e&&!n.isFunction(e)&&(t=e.cfg,e=e.fn),e&&e.NS&&(s=e.NS,t=t||{},t.host=this,this.hasPlugin(s)?this[s].setAttrs&&this[s].setAttrs(t):(this[s]=new e(t),this._plugins[s]=e));return this},unplug:function(e){var t=e,r=this._plugins;if(e)n.isFunction(e)&&(t=e.NS,t&&(!r[t]||r[t]!==e)&&(t=null)),t&&(this[t]&&(this[t].destroy&&this[t].destroy(),delete this[t]),r[t]&&delete r[t]);else for(t in this._plugins)this._plugins.hasOwnProperty(t)&&this.unplug(t);return this},hasPlugin:function(e){return this._plugins[e]&&this[e]},_initPlugins:function(e){this._plugins=this._plugins||{},this._initConfigPlugins&&this._initConfigPlugins(e)},_destroyPlugins:function(){this.unplug()}},e.namespace("Plugin").Host=r},"3.7.2",{requires:["yui-base"]});+YUI.add("pluginhost-base",function(e,t){function r(){this._plugins={}}var n=e.Lang;r.prototype={plug:function(e,t){var r,i,s;if(n.isArray(e))for(r=0,i=e.length;r<i;r++)this.plug(e[r]);else e&&!n.isFunction(e)&&(t=e.cfg,e=e.fn),e&&e.NS&&(s=e.NS,t=t||{},t.host=this,this.hasPlugin(s)?this[s].setAttrs&&this[s].setAttrs(t):(this[s]=new e(t),this._plugins[s]=e));return this},unplug:function(e){var t=e,r=this._plugins;if(e)n.isFunction(e)&&(t=e.NS,t&&(!r[t]||r[t]!==e)&&(t=null)),t&&(this[t]&&(this[t].destroy&&this[t].destroy(),delete this[t]),r[t]&&delete r[t]);else for(t in this._plugins)this._plugins.hasOwnProperty(t)&&this.unplug(t);return this},hasPlugin:function(e){return this._plugins[e]&&this[e]},_initPlugins:function(e){this._plugins=this._plugins||{},this._initConfigPlugins&&this._initConfigPlugins(e)},_destroyPlugins:function(){this.unplug()}},e.namespace("Plugin").Host=r},"3.7.3",{requires:["yui-base"]});
bundle/pluginhost-base/pluginhost-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -184,4 +184,4 @@ Y.namespace("Plugin").Host = PluginHost; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/pluginhost-config/pluginhost-config-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/pluginhost-config/pluginhost-config.js", code: [] };-_yuitest_coverage["build/pluginhost-config/pluginhost-config.js"].code=["YUI.add('pluginhost-config', function (Y, NAME) {",""," /**"," * Adds pluginhost constructor configuration and static configuration support"," * @submodule pluginhost-config"," */",""," var PluginHost = Y.Plugin.Host,"," L = Y.Lang;",""," /**"," * A protected initialization method, used by the host class to initialize"," * plugin configurations passed the constructor, through the config object."," * "," * Host objects should invoke this method at the appropriate time in their"," * construction lifecycle."," * "," * @method _initConfigPlugins"," * @param {Object} config The configuration object passed to the constructor"," * @protected"," * @for Plugin.Host"," */"," PluginHost.prototype._initConfigPlugins = function(config) {",""," // Class Configuration"," var classes = (this._getClasses) ? this._getClasses() : [this.constructor],"," plug = [],"," unplug = {},"," constructor, i, classPlug, classUnplug, pluginClassName;",""," // TODO: Room for optimization. Can we apply statically/unplug in same pass?"," for (i = classes.length - 1; i >= 0; i--) {"," constructor = classes[i];",""," classUnplug = constructor._UNPLUG;"," if (classUnplug) {"," // subclasses over-write"," Y.mix(unplug, classUnplug, true);"," }",""," classPlug = constructor._PLUG;"," if (classPlug) {"," // subclasses over-write"," Y.mix(plug, classPlug, true);"," }"," }",""," for (pluginClassName in plug) {"," if (plug.hasOwnProperty(pluginClassName)) {"," if (!unplug[pluginClassName]) {"," this.plug(plug[pluginClassName]);"," }"," }"," }",""," // User Configuration"," if (config && config.plugins) {"," this.plug(config.plugins);"," }"," };"," "," /**"," * Registers plugins to be instantiated at the class level (plugins "," * which should be plugged into every instance of the class by default)."," *"," * @method plug"," * @static"," *"," * @param {Function} hostClass The host class on which to register the plugins"," * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined)"," * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin"," * @for Plugin.Host"," */"," PluginHost.plug = function(hostClass, plugin, config) {"," // Cannot plug into Base, since Plugins derive from Base [ will cause infinite recurrsion ]"," var p, i, l, name;"," "," if (hostClass !== Y.Base) {"," hostClass._PLUG = hostClass._PLUG || {};"," "," if (!L.isArray(plugin)) {"," if (config) {"," plugin = {fn:plugin, cfg:config};"," }"," plugin = [plugin];"," }"," "," for (i = 0, l = plugin.length; i < l;i++) {"," p = plugin[i];"," name = p.NAME || p.fn.NAME;"," hostClass._PLUG[name] = p;"," }"," }"," };",""," /**"," * Unregisters any class level plugins which have been registered by the host class, or any"," * other class in the hierarchy."," *"," * @method unplug"," * @static"," *"," * @param {Function} hostClass The host class from which to unregister the plugins"," * @param {Function | Array} plugin The plugin class, or an array of plugin classes"," * @for Plugin.Host"," */"," PluginHost.unplug = function(hostClass, plugin) {"," var p, i, l, name;"," "," if (hostClass !== Y.Base) {"," hostClass._UNPLUG = hostClass._UNPLUG || {};"," "," if (!L.isArray(plugin)) {"," plugin = [plugin];"," }"," "," for (i = 0, l = plugin.length; i < l; i++) {"," p = plugin[i];"," name = p.NAME;"," if (!hostClass._PLUG[name]) {"," hostClass._UNPLUG[name] = p;"," } else {"," delete hostClass._PLUG[name];"," }"," }"," }"," };","","","}, '3.7.2', {\"requires\": [\"pluginhost-base\"]});"];+_yuitest_coverage["build/pluginhost-config/pluginhost-config.js"].code=["YUI.add('pluginhost-config', function (Y, NAME) {",""," /**"," * Adds pluginhost constructor configuration and static configuration support"," * @submodule pluginhost-config"," */",""," var PluginHost = Y.Plugin.Host,"," L = Y.Lang;",""," /**"," * A protected initialization method, used by the host class to initialize"," * plugin configurations passed the constructor, through the config object."," * "," * Host objects should invoke this method at the appropriate time in their"," * construction lifecycle."," * "," * @method _initConfigPlugins"," * @param {Object} config The configuration object passed to the constructor"," * @protected"," * @for Plugin.Host"," */"," PluginHost.prototype._initConfigPlugins = function(config) {",""," // Class Configuration"," var classes = (this._getClasses) ? this._getClasses() : [this.constructor],"," plug = [],"," unplug = {},"," constructor, i, classPlug, classUnplug, pluginClassName;",""," // TODO: Room for optimization. Can we apply statically/unplug in same pass?"," for (i = classes.length - 1; i >= 0; i--) {"," constructor = classes[i];",""," classUnplug = constructor._UNPLUG;"," if (classUnplug) {"," // subclasses over-write"," Y.mix(unplug, classUnplug, true);"," }",""," classPlug = constructor._PLUG;"," if (classPlug) {"," // subclasses over-write"," Y.mix(plug, classPlug, true);"," }"," }",""," for (pluginClassName in plug) {"," if (plug.hasOwnProperty(pluginClassName)) {"," if (!unplug[pluginClassName]) {"," this.plug(plug[pluginClassName]);"," }"," }"," }",""," // User Configuration"," if (config && config.plugins) {"," this.plug(config.plugins);"," }"," };"," "," /**"," * Registers plugins to be instantiated at the class level (plugins "," * which should be plugged into every instance of the class by default)."," *"," * @method plug"," * @static"," *"," * @param {Function} hostClass The host class on which to register the plugins"," * @param {Function | Array} plugin Either the plugin class, an array of plugin classes or an array of objects (with fn and cfg properties defined)"," * @param {Object} config (Optional) If plugin is the plugin class, the configuration for the plugin"," * @for Plugin.Host"," */"," PluginHost.plug = function(hostClass, plugin, config) {"," // Cannot plug into Base, since Plugins derive from Base [ will cause infinite recurrsion ]"," var p, i, l, name;"," "," if (hostClass !== Y.Base) {"," hostClass._PLUG = hostClass._PLUG || {};"," "," if (!L.isArray(plugin)) {"," if (config) {"," plugin = {fn:plugin, cfg:config};"," }"," plugin = [plugin];"," }"," "," for (i = 0, l = plugin.length; i < l;i++) {"," p = plugin[i];"," name = p.NAME || p.fn.NAME;"," hostClass._PLUG[name] = p;"," }"," }"," };",""," /**"," * Unregisters any class level plugins which have been registered by the host class, or any"," * other class in the hierarchy."," *"," * @method unplug"," * @static"," *"," * @param {Function} hostClass The host class from which to unregister the plugins"," * @param {Function | Array} plugin The plugin class, or an array of plugin classes"," * @for Plugin.Host"," */"," PluginHost.unplug = function(hostClass, plugin) {"," var p, i, l, name;"," "," if (hostClass !== Y.Base) {"," hostClass._UNPLUG = hostClass._UNPLUG || {};"," "," if (!L.isArray(plugin)) {"," plugin = [plugin];"," }"," "," for (i = 0, l = plugin.length; i < l; i++) {"," p = plugin[i];"," name = p.NAME;"," if (!hostClass._PLUG[name]) {"," hostClass._UNPLUG[name] = p;"," } else {"," delete hostClass._PLUG[name];"," }"," }"," }"," };","","","}, '3.7.3', {\"requires\": [\"pluginhost-base\"]});"]; _yuitest_coverage["build/pluginhost-config/pluginhost-config.js"].lines = {"1":0,"8":0,"23":0,"26":0,"32":0,"33":0,"35":0,"36":0,"38":0,"41":0,"42":0,"44":0,"48":0,"49":0,"50":0,"51":0,"57":0,"58":0,"74":0,"76":0,"78":0,"79":0,"81":0,"82":0,"83":0,"85":0,"88":0,"89":0,"90":0,"91":0,"107":0,"108":0,"110":0,"111":0,"113":0,"114":0,"117":0,"118":0,"119":0,"120":0,"121":0,"123":0}; _yuitest_coverage["build/pluginhost-config/pluginhost-config.js"].functions = {"_initConfigPlugins:23":0,"plug:74":0,"unplug:107":0,"(anonymous 1):1":0}; _yuitest_coverage["build/pluginhost-config/pluginhost-config.js"].coveredLines = 42;@@ -212,4 +212,4 @@ }; -}, '3.7.2', {"requires": ["pluginhost-base"]});+}, '3.7.3', {"requires": ["pluginhost-base"]});
bundle/pluginhost-config/pluginhost-config-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -133,4 +133,4 @@ }; -}, '3.7.2', {"requires": ["pluginhost-base"]});+}, '3.7.3', {"requires": ["pluginhost-base"]});
bundle/pluginhost-config/pluginhost-config-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("pluginhost-config",function(e,t){var n=e.Plugin.Host,r=e.Lang;n.prototype._initConfigPlugins=function(t){var n=this._getClasses?this._getClasses():[this.constructor],r=[],i={},s,o,u,a,f;for(o=n.length-1;o>=0;o--)s=n[o],a=s._UNPLUG,a&&e.mix(i,a,!0),u=s._PLUG,u&&e.mix(r,u,!0);for(f in r)r.hasOwnProperty(f)&&(i[f]||this.plug(r[f]));t&&t.plugins&&this.plug(t.plugins)},n.plug=function(t,n,i){var s,o,u,a;if(t!==e.Base){t._PLUG=t._PLUG||{},r.isArray(n)||(i&&(n={fn:n,cfg:i}),n=[n]);for(o=0,u=n.length;o<u;o++)s=n[o],a=s.NAME||s.fn.NAME,t._PLUG[a]=s}},n.unplug=function(t,n){var i,s,o,u;if(t!==e.Base){t._UNPLUG=t._UNPLUG||{},r.isArray(n)||(n=[n]);for(s=0,o=n.length;s<o;s++)i=n[s],u=i.NAME,t._PLUG[u]?delete t._PLUG[u]:t._UNPLUG[u]=i}}},"3.7.2",{requires:["pluginhost-base"]});+YUI.add("pluginhost-config",function(e,t){var n=e.Plugin.Host,r=e.Lang;n.prototype._initConfigPlugins=function(t){var n=this._getClasses?this._getClasses():[this.constructor],r=[],i={},s,o,u,a,f;for(o=n.length-1;o>=0;o--)s=n[o],a=s._UNPLUG,a&&e.mix(i,a,!0),u=s._PLUG,u&&e.mix(r,u,!0);for(f in r)r.hasOwnProperty(f)&&(i[f]||this.plug(r[f]));t&&t.plugins&&this.plug(t.plugins)},n.plug=function(t,n,i){var s,o,u,a;if(t!==e.Base){t._PLUG=t._PLUG||{},r.isArray(n)||(i&&(n={fn:n,cfg:i}),n=[n]);for(o=0,u=n.length;o<u;o++)s=n[o],a=s.NAME||s.fn.NAME,t._PLUG[a]=s}},n.unplug=function(t,n){var i,s,o,u;if(t!==e.Base){t._UNPLUG=t._UNPLUG||{},r.isArray(n)||(n=[n]);for(s=0,o=n.length;s<o;s++)i=n[s],u=i.NAME,t._PLUG[u]?delete t._PLUG[u]:t._UNPLUG[u]=i}}},"3.7.3",{requires:["pluginhost-base"]});
bundle/pluginhost-config/pluginhost-config.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -133,4 +133,4 @@ }; -}, '3.7.2', {"requires": ["pluginhost-base"]});+}, '3.7.3', {"requires": ["pluginhost-base"]});
bundle/profiler/profiler-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/profiler/profiler.js", code: [] };-_yuitest_coverage["build/profiler/profiler.js"].code=["YUI.add('profiler', function (Y, NAME) {",""," /**"," * The YUI JavaScript profiler."," * @module profiler"," */"," "," //-------------------------------------------------------------------------"," // 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, "," "," //shortcuts"," L = Y.Lang;",""," /* (intentionally not documented)"," * 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: []"," };"," return report[name];"," }"," "," /* (intentionally not documented)"," * 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;"," } "," "," }"," "," //-------------------------------------------------------------------------"," // Public Interface"," //-------------------------------------------------------------------------"," "," /**"," * Profiles functions in JavaScript."," * @class Profiler"," * @static"," */"," Y.Profiler = {"," "," //-------------------------------------------------------------------------"," // 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 (L.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"," Y.mix(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."," * @method getFullReport"," * @static"," */"," getFullReport : function (filter /*:Function*/) /*:Object*/ {"," filter = filter || function(){return true;};"," "," if (L.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 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 (!L.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 (L.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 = (L.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 (L.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 (L.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 (L.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];"," }"," "," }"," "," "," };","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/profiler/profiler.js"].code=["YUI.add('profiler', function (Y, NAME) {",""," /**"," * The YUI JavaScript profiler."," * @module profiler"," */"," "," //-------------------------------------------------------------------------"," // 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, "," "," //shortcuts"," L = Y.Lang;",""," /* (intentionally not documented)"," * 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: []"," };"," return report[name];"," }"," "," /* (intentionally not documented)"," * 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;"," } "," "," }"," "," //-------------------------------------------------------------------------"," // Public Interface"," //-------------------------------------------------------------------------"," "," /**"," * Profiles functions in JavaScript."," * @class Profiler"," * @static"," */"," Y.Profiler = {"," "," //-------------------------------------------------------------------------"," // 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 (L.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"," Y.mix(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."," * @method getFullReport"," * @static"," */"," getFullReport : function (filter /*:Function*/) /*:Object*/ {"," filter = filter || function(){return true;};"," "," if (L.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 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 (!L.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 (L.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 = (L.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 (L.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 (L.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 (L.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];"," }"," "," }"," "," "," };","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/profiler/profiler.js"].lines = {"1":0,"12":0,"30":0,"31":0,"38":0,"53":0,"56":0,"59":0,"60":0,"64":0,"65":0,"68":0,"69":0,"70":0,"71":0,"73":0,"74":0,"75":0,"89":0,"104":0,"105":0,"106":0,"108":0,"109":0,"121":0,"135":0,"137":0,"141":0,"143":0,"148":0,"151":0,"152":0,"155":0,"156":0,"159":0,"162":0,"177":0,"180":0,"181":0,"182":0,"183":0,"198":0,"199":0,"203":0,"204":0,"208":0,"209":0,"216":0,"217":0,"218":0,"232":0,"235":0,"236":0,"237":0,"238":0,"239":0,"243":0,"244":0,"245":0,"264":0,"275":0,"289":0,"303":0,"315":0,"326":0,"339":0,"341":0,"342":0,"344":0,"345":0,"346":0,"350":0,"367":0,"390":0,"396":0,"397":0,"401":0,"402":0,"405":0,"408":0,"415":0,"416":0,"419":0,"420":0,"443":0,"446":0,"448":0,"449":0,"450":0,"451":0,"453":0,"454":0,"471":0,"472":0,"487":0,"490":0,"491":0,"495":0,"499":0,"500":0,"503":0,"506":0,"527":0,"528":0,"530":0,"531":0,"532":0,"533":0,"534":0,"538":0}; _yuitest_coverage["build/profiler/profiler.js"].functions = {"createReport:30":0,"saveDataPoint:53":0,"clear:103":0,"getOriginal:120":0,"newMethod:135":0,"instrument:132":0,"pause:176":0,"start:197":0,"stop:231":0,"getAverage:263":0,"getCallCount:274":0,"getMax:288":0,"getMin:302":0,"getFunctionReport:314":0,"getReport:325":0,"(anonymous 2):339":0,"getFullReport:338":0,"registerConstructor:366":0,"registerFunction:387":0,"registerObject:440":0,"unregisterConstructor:468":0,"unregisterFunction:484":0,"unregisterObject:524":0,"(anonymous 1):1":0}; _yuitest_coverage["build/profiler/profiler.js"].coveredLines = 110;@@ -716,4 +716,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/profiler/profiler-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -549,4 +549,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/profiler/profiler-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("profiler",function(Y,NAME){function createReport(e){return report[e]={calls:0,max:0,min:0,avg:0,points:[]},report[e]}function saveDataPoint(e,t){var n=report[e];n||(n=createReport(e)),n.calls++,n.points.push(t),n.calls>1?(n.avg=(n.avg*(n.calls-1)+t)/n.calls,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t)):(n.avg=t,n.min=t,n.max=t)}var container={},report={},stopwatches={},WATCH_STARTED=0,WATCH_STOPPED=1,WATCH_PAUSED=2,L=Y.Lang;Y.Profiler={clear:function(e){L.isString(e)?(delete report[e],delete stopwatches[e]):(report={},stopwatches={})},getOriginal:function(e){return container[e]},instrument:function(e,t){var n=function(){var n=new Date,r=t.apply(this,arguments),i=new Date;return saveDataPoint(e,i-n),r};return Y.mix(n,t),n.__yuiProfiled=!0,n.prototype=t.prototype,container[e]=t,container[e].__yuiFuncName=e,createReport(e),n},pause:function(e){var t=new Date,n=stopwatches[e];n&&n.state==WATCH_STARTED&&(n.total+=t-n.start,n.start=0,n.state=WATCH_PAUSED)},start:function(e){if(container[e])throw new Error("Cannot use '"+e+"' for profiling through start(), name is already in use.");report[e]||createReport(e),stopwatches[e]||(stopwatches[e]={state:WATCH_STOPPED,start:0,total:0}),stopwatches[e].state==WATCH_STOPPED&&(stopwatches[e].state=WATCH_STARTED,stopwatches[e].start=new Date)},stop:function(e){var t=new Date,n=stopwatches[e];n&&(n.state==WATCH_STARTED?saveDataPoint(e,n.total+(t-n.start)):n.state==WATCH_PAUSED&&saveDataPoint(e,n.total),n.start=0,n.total=0,n.state=WATCH_STOPPED)},getAverage:function(e){return report[e].avg},getCallCount:function(e){return report[e].calls},getMax:function(e){return report[e].max},getMin:function(e){return report[e].min},getFunctionReport:function(e){return report[e]},getReport:function(e){return report[e]},getFullReport:function(e){e=e||function(){return!0};if(L.isFunction(e)){var t={};for(var n in report)e(report[n])&&(t[n]=report[n]);return t}},registerConstructor:function(e,t){this.registerFunction(e,t,!0)},registerFunction:function(name,owner,registerPrototype){var funcName=name.indexOf(".")>-1?name.substring(name.lastIndexOf(".")+1):name,method,prototype;L.isObject(owner)||(owner=eval(name.substring(0,name.lastIndexOf(".")))),method=owner[funcName],prototype=method.prototype,L.isFunction(method)&&!method.__yuiProfiled&&(owner[funcName]=this.instrument(name,method),container[name].__yuiOwner=owner,container[name].__yuiFuncName=funcName,registerPrototype&&this.registerObject(name+".prototype",prototype))},registerObject:function(name,object,recurse){object=L.isObject(object)?object:eval(name),container[name]=object;for(var prop in object)typeof object[prop]=="function"?prop!="constructor"&&prop!="superclass"&&this.registerFunction(name+"."+prop,object):typeof object[prop]=="object"&&recurse&&this.registerObject(name+"."+prop,object[prop],recurse)},unregisterConstructor:function(e){L.isFunction(container[e])&&this.unregisterFunction(e,!0)},unregisterFunction:function(e,t){if(L.isFunction(container[e])){t&&this.unregisterObject(e+".prototype",container[e].prototype);var n=container[e].__yuiOwner,r=container[e].__yuiFuncName;delete container[e].__yuiOwner,delete container[e].__yuiFuncName,n[r]=container[e],delete container[e]}},unregisterObject:function(e,t){if(L.isObject(container[e])){var n=container[e];for(var r in n)typeof n[r]=="function"?this.unregisterFunction(e+"."+r):typeof n[r]=="object"&&t&&this.unregisterObject(e+"."+r,t);delete container[e]}}}},"3.7.2",{requires:["yui-base"]});+YUI.add("profiler",function(Y,NAME){function createReport(e){return report[e]={calls:0,max:0,min:0,avg:0,points:[]},report[e]}function saveDataPoint(e,t){var n=report[e];n||(n=createReport(e)),n.calls++,n.points.push(t),n.calls>1?(n.avg=(n.avg*(n.calls-1)+t)/n.calls,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t)):(n.avg=t,n.min=t,n.max=t)}var container={},report={},stopwatches={},WATCH_STARTED=0,WATCH_STOPPED=1,WATCH_PAUSED=2,L=Y.Lang;Y.Profiler={clear:function(e){L.isString(e)?(delete report[e],delete stopwatches[e]):(report={},stopwatches={})},getOriginal:function(e){return container[e]},instrument:function(e,t){var n=function(){var n=new Date,r=t.apply(this,arguments),i=new Date;return saveDataPoint(e,i-n),r};return Y.mix(n,t),n.__yuiProfiled=!0,n.prototype=t.prototype,container[e]=t,container[e].__yuiFuncName=e,createReport(e),n},pause:function(e){var t=new Date,n=stopwatches[e];n&&n.state==WATCH_STARTED&&(n.total+=t-n.start,n.start=0,n.state=WATCH_PAUSED)},start:function(e){if(container[e])throw new Error("Cannot use '"+e+"' for profiling through start(), name is already in use.");report[e]||createReport(e),stopwatches[e]||(stopwatches[e]={state:WATCH_STOPPED,start:0,total:0}),stopwatches[e].state==WATCH_STOPPED&&(stopwatches[e].state=WATCH_STARTED,stopwatches[e].start=new Date)},stop:function(e){var t=new Date,n=stopwatches[e];n&&(n.state==WATCH_STARTED?saveDataPoint(e,n.total+(t-n.start)):n.state==WATCH_PAUSED&&saveDataPoint(e,n.total),n.start=0,n.total=0,n.state=WATCH_STOPPED)},getAverage:function(e){return report[e].avg},getCallCount:function(e){return report[e].calls},getMax:function(e){return report[e].max},getMin:function(e){return report[e].min},getFunctionReport:function(e){return report[e]},getReport:function(e){return report[e]},getFullReport:function(e){e=e||function(){return!0};if(L.isFunction(e)){var t={};for(var n in report)e(report[n])&&(t[n]=report[n]);return t}},registerConstructor:function(e,t){this.registerFunction(e,t,!0)},registerFunction:function(name,owner,registerPrototype){var funcName=name.indexOf(".")>-1?name.substring(name.lastIndexOf(".")+1):name,method,prototype;L.isObject(owner)||(owner=eval(name.substring(0,name.lastIndexOf(".")))),method=owner[funcName],prototype=method.prototype,L.isFunction(method)&&!method.__yuiProfiled&&(owner[funcName]=this.instrument(name,method),container[name].__yuiOwner=owner,container[name].__yuiFuncName=funcName,registerPrototype&&this.registerObject(name+".prototype",prototype))},registerObject:function(name,object,recurse){object=L.isObject(object)?object:eval(name),container[name]=object;for(var prop in object)typeof object[prop]=="function"?prop!="constructor"&&prop!="superclass"&&this.registerFunction(name+"."+prop,object):typeof object[prop]=="object"&&recurse&&this.registerObject(name+"."+prop,object[prop],recurse)},unregisterConstructor:function(e){L.isFunction(container[e])&&this.unregisterFunction(e,!0)},unregisterFunction:function(e,t){if(L.isFunction(container[e])){t&&this.unregisterObject(e+".prototype",container[e].prototype);var n=container[e].__yuiOwner,r=container[e].__yuiFuncName;delete container[e].__yuiOwner,delete container[e].__yuiFuncName,n[r]=container[e],delete container[e]}},unregisterObject:function(e,t){if(L.isObject(container[e])){var n=container[e];for(var r in n)typeof n[r]=="function"?this.unregisterFunction(e+"."+r):typeof n[r]=="object"&&t&&this.unregisterObject(e+"."+r,t);delete container[e]}}}},"3.7.3",{requires:["yui-base"]});
bundle/profiler/profiler.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -549,4 +549,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-parse-simple/querystring-parse-simple-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/querystring-parse-simple/querystring-parse-simple.js", code: [] };-_yuitest_coverage["build/querystring-parse-simple/querystring-parse-simple.js"].code=["YUI.add('querystring-parse-simple', function (Y, NAME) {","","// @TODO this looks like we are requiring the user to extract the querystring","// portion of the url, which isn't good. The majority use case will be to","// extract querystring from the document configured for this YUI instance.","// This should be the default if qs is not supplied.","","/*global Y */","/**"," * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings."," * This is a simpler implementation than the full querystring-stringify.</p>"," * <p>Because some things may require basic query string escaping functionality,"," * this module provides the bare minimum functionality (decoding a hash of simple values),"," * without the additional support for arrays, objects, and so on.</p>"," * <p>This provides a friendly way to deserialize basic query strings, without necessitating"," * a lot of code for simple use-cases.</p>"," *"," * @module querystring"," * @submodule querystring-parse-simple"," * @for QueryString"," * @static"," */","","var QueryString = Y.namespace(\"QueryString\");","","/**"," * Provides Y.QueryString.parse method to accept Query Strings and return native"," * JavaScript objects."," *"," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method parse"," * @param qs {String} Querystring to be parsed into an object."," * @param sep {String} (optional) Character that should join param k=v pairs together. Default: \"&\""," * @param eq {String} (optional) Character that should join keys to their values. Default: \"=\""," * @public"," * @static"," */","QueryString.parse = function (qs, sep, eq) {"," sep = sep || \"&\";"," eq = eq || \"=\";"," for ("," var obj = {},"," i = 0,"," pieces = qs.split(sep),"," l = pieces.length,"," tuple;"," i < l;"," i ++"," ) {"," tuple = pieces[i].split(eq);"," if (tuple.length > 0) {"," obj[QueryString.unescape(tuple.shift())] = QueryString.unescape(tuple.join(eq));"," }"," }"," return obj;","};","","/**"," * Provides Y.QueryString.unescape method to be able to override default decoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: replace \"+\" with \" \", and then decodeURIComponent behavior."," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method unescape"," * @param s {String} String to be decoded."," * @public"," * @static"," **/","QueryString.unescape = function (s) {"," return decodeURIComponent(s.replace(/\\+/g, ' '));","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/querystring-parse-simple/querystring-parse-simple.js"].code=["YUI.add('querystring-parse-simple', function (Y, NAME) {","","// @TODO this looks like we are requiring the user to extract the querystring","// portion of the url, which isn't good. The majority use case will be to","// extract querystring from the document configured for this YUI instance.","// This should be the default if qs is not supplied.","","/*global Y */","/**"," * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings."," * This is a simpler implementation than the full querystring-stringify.</p>"," * <p>Because some things may require basic query string escaping functionality,"," * this module provides the bare minimum functionality (decoding a hash of simple values),"," * without the additional support for arrays, objects, and so on.</p>"," * <p>This provides a friendly way to deserialize basic query strings, without necessitating"," * a lot of code for simple use-cases.</p>"," *"," * @module querystring"," * @submodule querystring-parse-simple"," * @for QueryString"," * @static"," */","","var QueryString = Y.namespace(\"QueryString\");","","/**"," * Provides Y.QueryString.parse method to accept Query Strings and return native"," * JavaScript objects."," *"," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method parse"," * @param qs {String} Querystring to be parsed into an object."," * @param sep {String} (optional) Character that should join param k=v pairs together. Default: \"&\""," * @param eq {String} (optional) Character that should join keys to their values. Default: \"=\""," * @public"," * @static"," */","QueryString.parse = function (qs, sep, eq) {"," sep = sep || \"&\";"," eq = eq || \"=\";"," for ("," var obj = {},"," i = 0,"," pieces = qs.split(sep),"," l = pieces.length,"," tuple;"," i < l;"," i ++"," ) {"," tuple = pieces[i].split(eq);"," if (tuple.length > 0) {"," obj[QueryString.unescape(tuple.shift())] = QueryString.unescape(tuple.join(eq));"," }"," }"," return obj;","};","","/**"," * Provides Y.QueryString.unescape method to be able to override default decoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: replace \"+\" with \" \", and then decodeURIComponent behavior."," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method unescape"," * @param s {String} String to be decoded."," * @public"," * @static"," **/","QueryString.unescape = function (s) {"," return decodeURIComponent(s.replace(/\\+/g, ' '));","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/querystring-parse-simple/querystring-parse-simple.js"].lines = {"1":0,"24":0,"40":0,"41":0,"42":0,"43":0,"52":0,"53":0,"54":0,"57":0,"74":0,"75":0}; _yuitest_coverage["build/querystring-parse-simple/querystring-parse-simple.js"].functions = {"parse:40":0,"unescape:74":0,"(anonymous 1):1":0}; _yuitest_coverage["build/querystring-parse-simple/querystring-parse-simple.js"].coveredLines = 12;@@ -130,4 +130,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-parse-simple/querystring-parse-simple-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -82,4 +82,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-parse-simple/querystring-parse-simple-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("querystring-parse-simple",function(e,t){var n=e.namespace("QueryString");n.parse=function(e,t,r){t=t||"&",r=r||"=";for(var i={},s=0,o=e.split(t),u=o.length,a;s<u;s++)a=o[s].split(r),a.length>0&&(i[n.unescape(a.shift())]=n.unescape(a.join(r)));return i},n.unescape=function(e){return decodeURIComponent(e.replace(/\+/g," "))}},"3.7.2",{requires:["yui-base"]});+YUI.add("querystring-parse-simple",function(e,t){var n=e.namespace("QueryString");n.parse=function(e,t,r){t=t||"&",r=r||"=";for(var i={},s=0,o=e.split(t),u=o.length,a;s<u;s++)a=o[s].split(r),a.length>0&&(i[n.unescape(a.shift())]=n.unescape(a.join(r)));return i},n.unescape=function(e){return decodeURIComponent(e.replace(/\+/g," "))}},"3.7.3",{requires:["yui-base"]});
bundle/querystring-parse-simple/querystring-parse-simple.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -82,4 +82,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-parse/querystring-parse-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/querystring-parse/querystring-parse.js", code: [] };-_yuitest_coverage["build/querystring-parse/querystring-parse.js"].code=["YUI.add('querystring-parse', function (Y, NAME) {","","/**"," * The QueryString module adds support for serializing JavaScript objects into"," * query strings and parsing JavaScript objects from query strings format."," *"," * The QueryString namespace is added to your YUI instance including static methods"," * `Y.QueryString.parse(..)` and `Y.QueryString.stringify(..)`."," *"," * The `querystring` module is a alias for `querystring-parse` and"," * `querystring-stringify`."," *"," * As their names suggest, `querystring-parse` adds support for parsing"," * Query String data (`Y.QueryString.parse`) and `querystring-stringify` for serializing"," * JavaScript data into Query Strings (`Y.QueryString.stringify`). You may choose to"," * include either of the submodules individually if you don't need the"," * complementary functionality, or include the rollup for both."," *"," * @module querystring"," * @main querystring","*/","/**"," * The QueryString module adds support for serializing JavaScript objects into"," * query strings and parsing JavaScript objects from query strings format."," * @class QueryString"," * @static"," */","var QueryString = Y.namespace(\"QueryString\"),","","// Parse a key=val string.","// These can get pretty hairy","// example flow:","// parse(foo[bar][][bla]=baz)","// return parse(foo[bar][][bla],\"baz\")","// return parse(foo[bar][], {bla : \"baz\"})","// return parse(foo[bar], [{bla:\"baz\"}])","// return parse(foo, {bar:[{bla:\"baz\"}]})","// return {foo:{bar:[{bla:\"baz\"}]}}","pieceParser = function (eq) {"," return function parsePiece (key, val) {",""," var sliced, numVal, head, tail, ret;",""," if (arguments.length !== 2) {"," // key=val, called from the map/reduce"," key = key.split(eq);"," return parsePiece("," QueryString.unescape(key.shift()),"," QueryString.unescape(key.join(eq))"," );"," }"," key = key.replace(/^\\s+|\\s+$/g, '');"," if (Y.Lang.isString(val)) {"," val = val.replace(/^\\s+|\\s+$/g, '');"," // convert numerals to numbers"," if (!isNaN(val)) {"," numVal = +val;"," if (val === numVal.toString(10)) {"," val = numVal;"," }"," }"," }"," sliced = /(.*)\\[([^\\]]*)\\]$/.exec(key);"," if (!sliced) {"," ret = {};"," if (key) {"," ret[key] = val;"," }"," return ret;"," }"," // [\"foo[][bar][][baz]\", \"foo[][bar][]\", \"baz\"]"," tail = sliced[2];"," head = sliced[1];",""," // array: key[]=val"," if (!tail) {"," return parsePiece(head, [val]);"," }",""," // obj: key[subkey]=val"," ret = {};"," ret[tail] = val;"," return parsePiece(head, ret);"," };","},","","// the reducer function that merges each query piece together into one set of params","mergeParams = function(params, addition) {"," return ("," // if it's uncontested, then just return the addition."," (!params) ? addition"," // if the existing value is an array, then concat it."," : (Y.Lang.isArray(params)) ? params.concat(addition)"," // if the existing value is not an array, and either are not objects, arrayify it."," : (!Y.Lang.isObject(params) || !Y.Lang.isObject(addition)) ? [params].concat(addition)"," // else merge them as objects, which is a little more complex"," : mergeObjects(params, addition)"," );","},","","// Merge two *objects* together. If this is called, we've already ruled","// out the simple cases, and need to do the for-in business.","mergeObjects = function(params, addition) {"," for (var i in addition) {"," if (i && addition.hasOwnProperty(i)) {"," params[i] = mergeParams(params[i], addition[i]);"," }"," }"," return params;","};","","/**"," * Provides Y.QueryString.parse method to accept Query Strings and return native"," * JavaScript objects."," *"," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method parse"," * @param qs {String} Querystring to be parsed into an object."," * @param sep {String} (optional) Character that should join param k=v pairs together. Default: \"&\""," * @param eq {String} (optional) Character that should join keys to their values. Default: \"=\""," * @public"," * @static"," */","QueryString.parse = function (qs, sep, eq) {"," // wouldn't Y.Array(qs.split()).map(pieceParser(eq)).reduce(mergeParams) be prettier?"," return Y.Array.reduce("," Y.Array.map("," qs.split(sep || \"&\"),"," pieceParser(eq || \"=\")"," ),"," {},"," mergeParams"," );","};","","/**"," * Provides Y.QueryString.unescape method to be able to override default decoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: replace \"+\" with \" \", and then decodeURIComponent behavior."," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method unescape"," * @param s {String} String to be decoded."," * @public"," * @static"," **/","QueryString.unescape = function (s) {"," return decodeURIComponent(s.replace(/\\+/g, ' '));","};","","","","","}, '3.7.2', {\"requires\": [\"yui-base\", \"array-extras\"]});"];+_yuitest_coverage["build/querystring-parse/querystring-parse.js"].code=["YUI.add('querystring-parse', function (Y, NAME) {","","/**"," * The QueryString module adds support for serializing JavaScript objects into"," * query strings and parsing JavaScript objects from query strings format."," *"," * The QueryString namespace is added to your YUI instance including static methods"," * `Y.QueryString.parse(..)` and `Y.QueryString.stringify(..)`."," *"," * The `querystring` module is a alias for `querystring-parse` and"," * `querystring-stringify`."," *"," * As their names suggest, `querystring-parse` adds support for parsing"," * Query String data (`Y.QueryString.parse`) and `querystring-stringify` for serializing"," * JavaScript data into Query Strings (`Y.QueryString.stringify`). You may choose to"," * include either of the submodules individually if you don't need the"," * complementary functionality, or include the rollup for both."," *"," * @module querystring"," * @main querystring","*/","/**"," * The QueryString module adds support for serializing JavaScript objects into"," * query strings and parsing JavaScript objects from query strings format."," * @class QueryString"," * @static"," */","var QueryString = Y.namespace(\"QueryString\"),","","// Parse a key=val string.","// These can get pretty hairy","// example flow:","// parse(foo[bar][][bla]=baz)","// return parse(foo[bar][][bla],\"baz\")","// return parse(foo[bar][], {bla : \"baz\"})","// return parse(foo[bar], [{bla:\"baz\"}])","// return parse(foo, {bar:[{bla:\"baz\"}]})","// return {foo:{bar:[{bla:\"baz\"}]}}","pieceParser = function (eq) {"," return function parsePiece (key, val) {",""," var sliced, numVal, head, tail, ret;",""," if (arguments.length !== 2) {"," // key=val, called from the map/reduce"," key = key.split(eq);"," return parsePiece("," QueryString.unescape(key.shift()),"," QueryString.unescape(key.join(eq))"," );"," }"," key = key.replace(/^\\s+|\\s+$/g, '');"," if (Y.Lang.isString(val)) {"," val = val.replace(/^\\s+|\\s+$/g, '');"," // convert numerals to numbers"," if (!isNaN(val)) {"," numVal = +val;"," if (val === numVal.toString(10)) {"," val = numVal;"," }"," }"," }"," sliced = /(.*)\\[([^\\]]*)\\]$/.exec(key);"," if (!sliced) {"," ret = {};"," if (key) {"," ret[key] = val;"," }"," return ret;"," }"," // [\"foo[][bar][][baz]\", \"foo[][bar][]\", \"baz\"]"," tail = sliced[2];"," head = sliced[1];",""," // array: key[]=val"," if (!tail) {"," return parsePiece(head, [val]);"," }",""," // obj: key[subkey]=val"," ret = {};"," ret[tail] = val;"," return parsePiece(head, ret);"," };","},","","// the reducer function that merges each query piece together into one set of params","mergeParams = function(params, addition) {"," return ("," // if it's uncontested, then just return the addition."," (!params) ? addition"," // if the existing value is an array, then concat it."," : (Y.Lang.isArray(params)) ? params.concat(addition)"," // if the existing value is not an array, and either are not objects, arrayify it."," : (!Y.Lang.isObject(params) || !Y.Lang.isObject(addition)) ? [params].concat(addition)"," // else merge them as objects, which is a little more complex"," : mergeObjects(params, addition)"," );","},","","// Merge two *objects* together. If this is called, we've already ruled","// out the simple cases, and need to do the for-in business.","mergeObjects = function(params, addition) {"," for (var i in addition) {"," if (i && addition.hasOwnProperty(i)) {"," params[i] = mergeParams(params[i], addition[i]);"," }"," }"," return params;","};","","/**"," * Provides Y.QueryString.parse method to accept Query Strings and return native"," * JavaScript objects."," *"," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method parse"," * @param qs {String} Querystring to be parsed into an object."," * @param sep {String} (optional) Character that should join param k=v pairs together. Default: \"&\""," * @param eq {String} (optional) Character that should join keys to their values. Default: \"=\""," * @public"," * @static"," */","QueryString.parse = function (qs, sep, eq) {"," // wouldn't Y.Array(qs.split()).map(pieceParser(eq)).reduce(mergeParams) be prettier?"," return Y.Array.reduce("," Y.Array.map("," qs.split(sep || \"&\"),"," pieceParser(eq || \"=\")"," ),"," {},"," mergeParams"," );","};","","/**"," * Provides Y.QueryString.unescape method to be able to override default decoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: replace \"+\" with \" \", and then decodeURIComponent behavior."," * @module querystring"," * @submodule querystring-parse"," * @for QueryString"," * @method unescape"," * @param s {String} String to be decoded."," * @public"," * @static"," **/","QueryString.unescape = function (s) {"," return decodeURIComponent(s.replace(/\\+/g, ' '));","};","","","","","}, '3.7.3', {\"requires\": [\"yui-base\", \"array-extras\"]});"]; _yuitest_coverage["build/querystring-parse/querystring-parse.js"].lines = {"1":0,"28":0,"40":0,"42":0,"44":0,"46":0,"47":0,"52":0,"53":0,"54":0,"56":0,"57":0,"58":0,"59":0,"63":0,"64":0,"65":0,"66":0,"67":0,"69":0,"72":0,"73":0,"76":0,"77":0,"81":0,"82":0,"83":0,"89":0,"104":0,"105":0,"106":0,"109":0,"126":0,"128":0,"152":0,"153":0}; _yuitest_coverage["build/querystring-parse/querystring-parse.js"].functions = {"parsePiece:40":0,"pieceParser:39":0,"mergeParams:88":0,"mergeObjects:103":0,"parse:126":0,"unescape:152":0,"(anonymous 1):1":0}; _yuitest_coverage["build/querystring-parse/querystring-parse.js"].coveredLines = 36;@@ -238,4 +238,4 @@ -}, '3.7.2', {"requires": ["yui-base", "array-extras"]});+}, '3.7.3', {"requires": ["yui-base", "array-extras"]});
bundle/querystring-parse/querystring-parse-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -162,4 +162,4 @@ -}, '3.7.2', {"requires": ["yui-base", "array-extras"]});+}, '3.7.3', {"requires": ["yui-base", "array-extras"]});
bundle/querystring-parse/querystring-parse-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("querystring-parse",function(e,t){var n=e.namespace("QueryString"),r=function(t){return function r(i,s){var o,u,a,f,l;return arguments.length!==2?(i=i.split(t),r(n.unescape(i.shift()),n.unescape(i.join(t)))):(i=i.replace(/^\s+|\s+$/g,""),e.Lang.isString(s)&&(s=s.replace(/^\s+|\s+$/g,""),isNaN(s)||(u=+s,s===u.toString(10)&&(s=u))),o=/(.*)\[([^\]]*)\]$/.exec(i),o?(f=o[2],a=o[1],f?(l={},l[f]=s,r(a,l)):r(a,[s])):(l={},i&&(l[i]=s),l))}},i=function(t,n){return t?e.Lang.isArray(t)?t.concat(n):!e.Lang.isObject(t)||!e.Lang.isObject(n)?[t].concat(n):s(t,n):n},s=function(e,t){for(var n in t)n&&t.hasOwnProperty(n)&&(e[n]=i(e[n],t[n]));return e};n.parse=function(t,n,s){return e.Array.reduce(e.Array.map(t.split(n||"&"),r(s||"=")),{},i)},n.unescape=function(e){return decodeURIComponent(e.replace(/\+/g," "))}},"3.7.2",{requires:["yui-base","array-extras"]});+YUI.add("querystring-parse",function(e,t){var n=e.namespace("QueryString"),r=function(t){return function r(i,s){var o,u,a,f,l;return arguments.length!==2?(i=i.split(t),r(n.unescape(i.shift()),n.unescape(i.join(t)))):(i=i.replace(/^\s+|\s+$/g,""),e.Lang.isString(s)&&(s=s.replace(/^\s+|\s+$/g,""),isNaN(s)||(u=+s,s===u.toString(10)&&(s=u))),o=/(.*)\[([^\]]*)\]$/.exec(i),o?(f=o[2],a=o[1],f?(l={},l[f]=s,r(a,l)):r(a,[s])):(l={},i&&(l[i]=s),l))}},i=function(t,n){return t?e.Lang.isArray(t)?t.concat(n):!e.Lang.isObject(t)||!e.Lang.isObject(n)?[t].concat(n):s(t,n):n},s=function(e,t){for(var n in t)n&&t.hasOwnProperty(n)&&(e[n]=i(e[n],t[n]));return e};n.parse=function(t,n,s){return e.Array.reduce(e.Array.map(t.split(n||"&"),r(s||"=")),{},i)},n.unescape=function(e){return decodeURIComponent(e.replace(/\+/g," "))}},"3.7.3",{requires:["yui-base","array-extras"]});
bundle/querystring-parse/querystring-parse.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -162,4 +162,4 @@ -}, '3.7.2', {"requires": ["yui-base", "array-extras"]});+}, '3.7.3', {"requires": ["yui-base", "array-extras"]});
bundle/querystring-stringify-simple/querystring-stringify-simple-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/querystring-stringify-simple/querystring-stringify-simple.js", code: [] };-_yuitest_coverage["build/querystring-stringify-simple/querystring-stringify-simple.js"].code=["YUI.add('querystring-stringify-simple', function (Y, NAME) {","","/*global Y */","/**"," * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings."," * This is a subset implementation of the full querystring-stringify.</p>"," * <p>This module provides the bare minimum functionality (encoding a hash of simple values),"," * without the additional support for nested data structures. Every key-value pair is"," * encoded by encodeURIComponent.</p>"," * <p>This module provides a minimalistic way for io to handle single-level objects"," * as transaction data.</p>"," *"," * @module querystring"," * @submodule querystring-stringify-simple"," * @for QueryString"," * @static"," */","","var QueryString = Y.namespace(\"QueryString\"),"," EUC = encodeURIComponent;","","/**"," * <p>Converts a simple object to a Query String representation.</p>"," * <p>Nested objects, Arrays, and so on, are not supported.</p>"," *"," * @method stringify"," * @for QueryString"," * @public"," * @submodule querystring-stringify-simple"," * @param obj {Object} A single-level object to convert to a querystring."," * @param cfg {Object} (optional) Configuration object. In the simple"," * module, only the arrayKey setting is"," * supported. When set to true, the key of an"," * array will have the '[]' notation appended"," * to the key;."," * @static"," */","QueryString.stringify = function (obj, c) {"," var qs = [],"," // Default behavior is false; standard key notation."," s = c && c.arrayKey ? true : false,"," key, i, l;",""," for (key in obj) {"," if (obj.hasOwnProperty(key)) {"," if (Y.Lang.isArray(obj[key])) {"," for (i = 0, l = obj[key].length; i < l; i++) {"," qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i]));"," }"," }"," else {"," qs.push(EUC(key) + '=' + EUC(obj[key]));"," }"," }"," }",""," return qs.join('&');","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/querystring-stringify-simple/querystring-stringify-simple.js"].code=["YUI.add('querystring-stringify-simple', function (Y, NAME) {","","/*global Y */","/**"," * <p>Provides Y.QueryString.stringify method for converting objects to Query Strings."," * This is a subset implementation of the full querystring-stringify.</p>"," * <p>This module provides the bare minimum functionality (encoding a hash of simple values),"," * without the additional support for nested data structures. Every key-value pair is"," * encoded by encodeURIComponent.</p>"," * <p>This module provides a minimalistic way for io to handle single-level objects"," * as transaction data.</p>"," *"," * @module querystring"," * @submodule querystring-stringify-simple"," * @for QueryString"," * @static"," */","","var QueryString = Y.namespace(\"QueryString\"),"," EUC = encodeURIComponent;","","/**"," * <p>Converts a simple object to a Query String representation.</p>"," * <p>Nested objects, Arrays, and so on, are not supported.</p>"," *"," * @method stringify"," * @for QueryString"," * @public"," * @submodule querystring-stringify-simple"," * @param obj {Object} A single-level object to convert to a querystring."," * @param cfg {Object} (optional) Configuration object. In the simple"," * module, only the arrayKey setting is"," * supported. When set to true, the key of an"," * array will have the '[]' notation appended"," * to the key;."," * @static"," */","QueryString.stringify = function (obj, c) {"," var qs = [],"," // Default behavior is false; standard key notation."," s = c && c.arrayKey ? true : false,"," key, i, l;",""," for (key in obj) {"," if (obj.hasOwnProperty(key)) {"," if (Y.Lang.isArray(obj[key])) {"," for (i = 0, l = obj[key].length; i < l; i++) {"," qs.push(EUC(s ? key + '[]' : key) + '=' + EUC(obj[key][i]));"," }"," }"," else {"," qs.push(EUC(key) + '=' + EUC(obj[key]));"," }"," }"," }",""," return qs.join('&');","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/querystring-stringify-simple/querystring-stringify-simple.js"].lines = {"1":0,"19":0,"38":0,"39":0,"44":0,"45":0,"46":0,"47":0,"48":0,"52":0,"57":0}; _yuitest_coverage["build/querystring-stringify-simple/querystring-stringify-simple.js"].functions = {"stringify:38":0,"(anonymous 1):1":0}; _yuitest_coverage["build/querystring-stringify-simple/querystring-stringify-simple.js"].coveredLines = 11;@@ -110,4 +110,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-stringify-simple/querystring-stringify-simple-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -64,4 +64,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-stringify-simple/querystring-stringify-simple-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("querystring-stringify-simple",function(e,t){var n=e.namespace("QueryString"),r=encodeURIComponent;n.stringify=function(t,n){var i=[],s=n&&n.arrayKey?!0:!1,o,u,a;for(o in t)if(t.hasOwnProperty(o))if(e.Lang.isArray(t[o]))for(u=0,a=t[o].length;u<a;u++)i.push(r(s?o+"[]":o)+"="+r(t[o][u]));else i.push(r(o)+"="+r(t[o]));return i.join("&")}},"3.7.2",{requires:["yui-base"]});+YUI.add("querystring-stringify-simple",function(e,t){var n=e.namespace("QueryString"),r=encodeURIComponent;n.stringify=function(t,n){var i=[],s=n&&n.arrayKey?!0:!1,o,u,a;for(o in t)if(t.hasOwnProperty(o))if(e.Lang.isArray(t[o]))for(u=0,a=t[o].length;u<a;u++)i.push(r(s?o+"[]":o)+"="+r(t[o][u]));else i.push(r(o)+"="+r(t[o]));return i.join("&")}},"3.7.3",{requires:["yui-base"]});
bundle/querystring-stringify-simple/querystring-stringify-simple.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -64,4 +64,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-stringify/querystring-stringify-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/querystring-stringify/querystring-stringify.js", code: [] };-_yuitest_coverage["build/querystring-stringify/querystring-stringify.js"].code=["YUI.add('querystring-stringify', function (Y, NAME) {","","/**"," * Provides Y.QueryString.stringify method for converting objects to Query Strings."," *"," * @module querystring"," * @submodule querystring-stringify"," * @for QueryString"," * @static"," */","","var QueryString = Y.namespace(\"QueryString\"),"," stack = [],"," L = Y.Lang;","","/**"," * Provides Y.QueryString.escape method to be able to override default encoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: encodeURIComponent"," * @module querystring"," * @submodule querystring-stringify"," * @for QueryString"," * @static"," **/","QueryString.escape = encodeURIComponent;","","/**"," * <p>Converts an arbitrary value to a Query String representation.</p>"," *"," * <p>Objects with cyclical references will trigger an exception.</p>"," *"," * @method stringify"," * @public"," * @param obj {Variant} any arbitrary value to convert to query string"," * @param cfg {Object} (optional) Configuration object. The three"," * supported configurations are:"," * <ul><li>sep: When defined, the value will be used as the key-value"," * separator. The default value is \"&\".</li>"," * <li>eq: When defined, the value will be used to join the key to"," * the value. The default value is \"=\".</li>"," * <li>arrayKey: When set to true, the key of an array will have the"," * '[]' notation appended to the key. The default value is false."," * </li></ul>"," * @param name {String} (optional) Name of the current key, for handling children recursively."," * @static"," */","QueryString.stringify = function (obj, c, name) {"," var begin, end, i, l, n, s,"," sep = c && c.sep ? c.sep : \"&\","," eq = c && c.eq ? c.eq : \"=\","," aK = c && c.arrayKey ? c.arrayKey : false;",""," if (L.isNull(obj) || L.isUndefined(obj) || L.isFunction(obj)) {"," return name ? QueryString.escape(name) + eq : '';"," }",""," if (L.isBoolean(obj) || Object.prototype.toString.call(obj) === '[object Boolean]') {"," obj =+ obj;"," }",""," if (L.isNumber(obj) || L.isString(obj)) {"," return QueryString.escape(name) + eq + QueryString.escape(obj);"," }",""," if (L.isArray(obj)) {"," s = [];"," name = aK ? name + '[]' : name;"," l = obj.length;"," for (i = 0; i < l; i++) {"," s.push( QueryString.stringify(obj[i], c, name) );"," }",""," return s.join(sep);"," }"," // now we know it's an object.",""," // Check for cyclical references in nested objects"," for (i = stack.length - 1; i >= 0; --i) {"," if (stack[i] === obj) {"," throw new Error(\"QueryString.stringify. Cyclical reference\");"," }"," }",""," stack.push(obj);"," s = [];"," begin = name ? name + '[' : '';"," end = name ? ']' : '';"," for (i in obj) {"," if (obj.hasOwnProperty(i)) {"," n = begin + i + end;"," s.push(QueryString.stringify(obj[i], c, n));"," }"," }",""," stack.pop();"," s = s.join(sep);"," if (!s && name) {"," return name + \"=\";"," }",""," return s;","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/querystring-stringify/querystring-stringify.js"].code=["YUI.add('querystring-stringify', function (Y, NAME) {","","/**"," * Provides Y.QueryString.stringify method for converting objects to Query Strings."," *"," * @module querystring"," * @submodule querystring-stringify"," * @for QueryString"," * @static"," */","","var QueryString = Y.namespace(\"QueryString\"),"," stack = [],"," L = Y.Lang;","","/**"," * Provides Y.QueryString.escape method to be able to override default encoding"," * method. This is important in cases where non-standard delimiters are used, if"," * the delimiters would not normally be handled properly by the builtin"," * (en|de)codeURIComponent functions."," * Default: encodeURIComponent"," * @module querystring"," * @submodule querystring-stringify"," * @for QueryString"," * @static"," **/","QueryString.escape = encodeURIComponent;","","/**"," * <p>Converts an arbitrary value to a Query String representation.</p>"," *"," * <p>Objects with cyclical references will trigger an exception.</p>"," *"," * @method stringify"," * @public"," * @param obj {Variant} any arbitrary value to convert to query string"," * @param cfg {Object} (optional) Configuration object. The three"," * supported configurations are:"," * <ul><li>sep: When defined, the value will be used as the key-value"," * separator. The default value is \"&\".</li>"," * <li>eq: When defined, the value will be used to join the key to"," * the value. The default value is \"=\".</li>"," * <li>arrayKey: When set to true, the key of an array will have the"," * '[]' notation appended to the key. The default value is false."," * </li></ul>"," * @param name {String} (optional) Name of the current key, for handling children recursively."," * @static"," */","QueryString.stringify = function (obj, c, name) {"," var begin, end, i, l, n, s,"," sep = c && c.sep ? c.sep : \"&\","," eq = c && c.eq ? c.eq : \"=\","," aK = c && c.arrayKey ? c.arrayKey : false;",""," if (L.isNull(obj) || L.isUndefined(obj) || L.isFunction(obj)) {"," return name ? QueryString.escape(name) + eq : '';"," }",""," if (L.isBoolean(obj) || Object.prototype.toString.call(obj) === '[object Boolean]') {"," obj =+ obj;"," }",""," if (L.isNumber(obj) || L.isString(obj)) {"," return QueryString.escape(name) + eq + QueryString.escape(obj);"," }",""," if (L.isArray(obj)) {"," s = [];"," name = aK ? name + '[]' : name;"," l = obj.length;"," for (i = 0; i < l; i++) {"," s.push( QueryString.stringify(obj[i], c, name) );"," }",""," return s.join(sep);"," }"," // now we know it's an object.",""," // Check for cyclical references in nested objects"," for (i = stack.length - 1; i >= 0; --i) {"," if (stack[i] === obj) {"," throw new Error(\"QueryString.stringify. Cyclical reference\");"," }"," }",""," stack.push(obj);"," s = [];"," begin = name ? name + '[' : '';"," end = name ? ']' : '';"," for (i in obj) {"," if (obj.hasOwnProperty(i)) {"," n = begin + i + end;"," s.push(QueryString.stringify(obj[i], c, n));"," }"," }",""," stack.pop();"," s = s.join(sep);"," if (!s && name) {"," return name + \"=\";"," }",""," return s;","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/querystring-stringify/querystring-stringify.js"].lines = {"1":0,"12":0,"27":0,"49":0,"50":0,"55":0,"56":0,"59":0,"60":0,"63":0,"64":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"75":0,"80":0,"81":0,"82":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"97":0,"98":0,"99":0,"100":0,"103":0}; _yuitest_coverage["build/querystring-stringify/querystring-stringify.js"].functions = {"stringify:49":0,"(anonymous 1):1":0}; _yuitest_coverage["build/querystring-stringify/querystring-stringify.js"].coveredLines = 34;@@ -179,4 +179,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-stringify/querystring-stringify-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -115,4 +115,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/querystring-stringify/querystring-stringify-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("querystring-stringify",function(e,t){var n=e.namespace("QueryString"),r=[],i=e.Lang;n.escape=encodeURIComponent,n.stringify=function(e,t,s){var o,u,a,f,l,c,h=t&&t.sep?t.sep:"&",p=t&&t.eq?t.eq:"=",d=t&&t.arrayKey?t.arrayKey:!1;if(i.isNull(e)||i.isUndefined(e)||i.isFunction(e))return s?n.escape(s)+p:"";if(i.isBoolean(e)||Object.prototype.toString.call(e)==="[object Boolean]")e=+e;if(i.isNumber(e)||i.isString(e))return n.escape(s)+p+n.escape(e);if(i.isArray(e)){c=[],s=d?s+"[]":s,f=e.length;for(a=0;a<f;a++)c.push(n.stringify(e[a],t,s));return c.join(h)}for(a=r.length-1;a>=0;--a)if(r[a]===e)throw new Error("QueryString.stringify. Cyclical reference");r.push(e),c=[],o=s?s+"[":"",u=s?"]":"";for(a in e)e.hasOwnProperty(a)&&(l=o+a+u,c.push(n.stringify(e[a],t,l)));return r.pop(),c=c.join(h),!c&&s?s+"=":c}},"3.7.2",{requires:["yui-base"]});+YUI.add("querystring-stringify",function(e,t){var n=e.namespace("QueryString"),r=[],i=e.Lang;n.escape=encodeURIComponent,n.stringify=function(e,t,s){var o,u,a,f,l,c,h=t&&t.sep?t.sep:"&",p=t&&t.eq?t.eq:"=",d=t&&t.arrayKey?t.arrayKey:!1;if(i.isNull(e)||i.isUndefined(e)||i.isFunction(e))return s?n.escape(s)+p:"";if(i.isBoolean(e)||Object.prototype.toString.call(e)==="[object Boolean]")e=+e;if(i.isNumber(e)||i.isString(e))return n.escape(s)+p+n.escape(e);if(i.isArray(e)){c=[],s=d?s+"[]":s,f=e.length;for(a=0;a<f;a++)c.push(n.stringify(e[a],t,s));return c.join(h)}for(a=r.length-1;a>=0;--a)if(r[a]===e)throw new Error("QueryString.stringify. Cyclical reference");r.push(e),c=[],o=s?s+"[":"",u=s?"]":"";for(a in e)e.hasOwnProperty(a)&&(l=o+a+u,c.push(n.stringify(e[a],t,l)));return r.pop(),c=c.join(h),!c&&s?s+"=":c}},"3.7.3",{requires:["yui-base"]});
bundle/querystring-stringify/querystring-stringify.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -110,4 +110,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/queue-promote/queue-promote-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/queue-promote/queue-promote.js", code: [] };-_yuitest_coverage["build/queue-promote/queue-promote.js"].code=["YUI.add('queue-promote', function (Y, NAME) {","","/**"," * Adds methods promote, remove, and indexOf to Queue instances."," *"," * @module queue-promote"," * @for Queue"," */","","Y.mix(Y.Queue.prototype, {"," /**"," * Returns the current index in the queue of the specified item"," * "," * @method indexOf"," * @param needle {MIXED} the item to search for"," * @return {Number} the index of the item or -1 if not found"," */"," indexOf : function (callback) {"," return Y.Array.indexOf(this._q, callback);"," },",""," /**"," * Moves the referenced item to the head of the queue"," *"," * @method promote"," * @param item {MIXED} an item in the queue"," */"," promote : function (callback) {"," var index = this.indexOf(callback);",""," if (index > -1) {"," this._q.unshift(this._q.splice(index,1)[0]);"," }"," },",""," /**"," * Removes the referenced item from the queue"," *"," * @method remove"," * @param item {MIXED} an item in the queue"," */"," remove : function (callback) {"," var index = this.indexOf(callback);",""," if (index > -1) {"," this._q.splice(index,1);"," }"," }","","});","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/queue-promote/queue-promote.js"].code=["YUI.add('queue-promote', function (Y, NAME) {","","/**"," * Adds methods promote, remove, and indexOf to Queue instances."," *"," * @module queue-promote"," * @for Queue"," */","","Y.mix(Y.Queue.prototype, {"," /**"," * Returns the current index in the queue of the specified item"," * "," * @method indexOf"," * @param needle {MIXED} the item to search for"," * @return {Number} the index of the item or -1 if not found"," */"," indexOf : function (callback) {"," return Y.Array.indexOf(this._q, callback);"," },",""," /**"," * Moves the referenced item to the head of the queue"," *"," * @method promote"," * @param item {MIXED} an item in the queue"," */"," promote : function (callback) {"," var index = this.indexOf(callback);",""," if (index > -1) {"," this._q.unshift(this._q.splice(index,1)[0]);"," }"," },",""," /**"," * Removes the referenced item from the queue"," *"," * @method remove"," * @param item {MIXED} an item in the queue"," */"," remove : function (callback) {"," var index = this.indexOf(callback);",""," if (index > -1) {"," this._q.splice(index,1);"," }"," }","","});","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/queue-promote/queue-promote.js"].lines = {"1":0,"10":0,"19":0,"29":0,"31":0,"32":0,"43":0,"45":0,"46":0}; _yuitest_coverage["build/queue-promote/queue-promote.js"].functions = {"indexOf:18":0,"promote:28":0,"remove:42":0,"(anonymous 1):1":0}; _yuitest_coverage["build/queue-promote/queue-promote.js"].coveredLines = 9;@@ -102,4 +102,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/queue-promote/queue-promote-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/queue-promote/queue-promote-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("queue-promote",function(e,t){e.mix(e.Queue.prototype,{indexOf:function(t){return e.Array.indexOf(this._q,t)},promote:function(e){var t=this.indexOf(e);t>-1&&this._q.unshift(this._q.splice(t,1)[0])},remove:function(e){var t=this.indexOf(e);t>-1&&this._q.splice(t,1)}})},"3.7.2",{requires:["yui-base"]});+YUI.add("queue-promote",function(e,t){e.mix(e.Queue.prototype,{indexOf:function(t){return e.Array.indexOf(this._q,t)},promote:function(e){var t=this.indexOf(e);t>-1&&this._q.unshift(this._q.splice(t,1)[0])},remove:function(e){var t=this.indexOf(e);t>-1&&this._q.splice(t,1)}})},"3.7.3",{requires:["yui-base"]});
bundle/queue-promote/queue-promote.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -56,4 +56,4 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/range-slider/assets/slider-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/range-slider/assets/slider-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/range-slider/range-slider-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/range-slider/range-slider.js", code: [] };-_yuitest_coverage["build/range-slider/range-slider.js"].code=["YUI.add('range-slider', function (Y, NAME) {","","/**"," * Create a sliding value range input visualized as a draggable thumb on a"," * background rail element."," * "," * @module slider"," * @main slider"," * @submodule range-slider"," */","","/**"," * Create a slider to represent an integer value between a given minimum and"," * maximum. Sliders may be aligned vertically or horizontally, based on the"," * <code>axis</code> configuration."," *"," * @class Slider"," * @constructor"," * @extends SliderBase"," * @uses SliderValueRange"," * @uses ClickableRail"," * @param config {Object} Configuration object"," */","Y.Slider = Y.Base.build( 'slider', Y.SliderBase,"," [ Y.SliderValueRange, Y.ClickableRail ] );","","","}, '3.7.2', {\"requires\": [\"slider-base\", \"slider-value-range\", \"clickable-rail\"]});"];+_yuitest_coverage["build/range-slider/range-slider.js"].code=["YUI.add('range-slider', function (Y, NAME) {","","/**"," * Create a sliding value range input visualized as a draggable thumb on a"," * background rail element."," * "," * @module slider"," * @main slider"," * @submodule range-slider"," */","","/**"," * Create a slider to represent an integer value between a given minimum and"," * maximum. Sliders may be aligned vertically or horizontally, based on the"," * <code>axis</code> configuration."," *"," * @class Slider"," * @constructor"," * @extends SliderBase"," * @uses SliderValueRange"," * @uses ClickableRail"," * @param config {Object} Configuration object"," */","Y.Slider = Y.Base.build( 'slider', Y.SliderBase,"," [ Y.SliderValueRange, Y.ClickableRail ] );","","","}, '3.7.3', {\"requires\": [\"slider-base\", \"slider-value-range\", \"clickable-rail\"]});"]; _yuitest_coverage["build/range-slider/range-slider.js"].lines = {"1":0,"24":0}; _yuitest_coverage["build/range-slider/range-slider.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/range-slider/range-slider.js"].coveredLines = 2;@@ -67,4 +67,4 @@ [ Y.SliderValueRange, Y.ClickableRail ] ); -}, '3.7.2', {"requires": ["slider-base", "slider-value-range", "clickable-rail"]});+}, '3.7.3', {"requires": ["slider-base", "slider-value-range", "clickable-rail"]});
bundle/range-slider/range-slider-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -31,4 +31,4 @@ [ Y.SliderValueRange, Y.ClickableRail ] ); -}, '3.7.2', {"requires": ["slider-base", "slider-value-range", "clickable-rail"]});+}, '3.7.3', {"requires": ["slider-base", "slider-value-range", "clickable-rail"]});
bundle/range-slider/range-slider-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("range-slider",function(e,t){e.Slider=e.Base.build("slider",e.SliderBase,[e.SliderValueRange,e.ClickableRail])},"3.7.2",{requires:["slider-base","slider-value-range","clickable-rail"]});+YUI.add("range-slider",function(e,t){e.Slider=e.Base.build("slider",e.SliderBase,[e.SliderValueRange,e.ClickableRail])},"3.7.3",{requires:["slider-base","slider-value-range","clickable-rail"]});
bundle/range-slider/range-slider.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -31,4 +31,4 @@ [ Y.SliderValueRange, Y.ClickableRail ] ); -}, '3.7.2', {"requires": ["slider-base", "slider-value-range", "clickable-rail"]});+}, '3.7.3', {"requires": ["slider-base", "slider-value-range", "clickable-rail"]});
bundle/recordset-base/recordset-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/recordset-base/recordset-base.js", code: [] };-_yuitest_coverage["build/recordset-base/recordset-base.js"].code=["YUI.add('recordset-base', function (Y, NAME) {","","/**"," * Provides a wrapper around a standard javascript object. Can be inserted into a Recordset instance."," *"," * @class Record"," */","var Record = Y.Base.create('record', Y.Base, [], {"," _setId: function() {"," return Y.guid();"," },",""," initializer: function() {"," },",""," destructor: function() {"," },",""," /**"," * Retrieve a particular (or all) values from the object"," *"," * @param field {string} (optional) The key to retrieve the value from. If not supplied, the entire object is returned."," * @method getValue"," * @public"," */"," getValue: function(field) {"," if (field === undefined) {"," return this.get(\"data\");"," }"," else {"," return this.get(\"data\")[field];"," }"," return null;"," }","},","{"," ATTRS: {",""," /**"," * @description Unique ID of the record instance"," * @attribute id"," * @type string"," */"," id: {"," valueFn: \"_setId\""," },",""," /**"," * @description The object stored within the record instance"," * @attribute data"," * @type object"," */"," data: {"," value: null"," }"," }","});","","Y.Record = Record;","/**","The Recordset utility provides a standard way for dealing with","a collection of similar objects.","@module recordset","@main recordset","@submodule recordset-base","**/","","","var ArrayList = Y.ArrayList,","Lang = Y.Lang,","","/**","The Recordset utility provides a standard way for dealing with","a collection of similar objects.","","Provides the base Recordset implementation, which can be extended to add","additional functionality, such as custom indexing. sorting, and filtering.","","@class Recordset","@extends Base","@uses ArrayList","@param config {Object} Configuration object with initial attribute values","@constructor","**/","Recordset = Y.Base.create('recordset', Y.Base, [], {","",""," /**"," * Publish default functions for events. Create the initial hash table."," *"," * @method initializer"," * @protected"," */"," initializer: function() {"," // The reason the conditional is needed is because of two scenarios:"," // 1. Instantiating new Y.Recordset() will not go into the setter of \"records\", and so it is necessary to create this._items in the initializer."," // 2. Instantiating new Y.Recordset({records: [{...}]}) will call the setter of \"records\" and create this._items. In this case, we don't want that to be overwritten by []."," if (!this._items) {"," this._items = [];"," }",""," //set up event listener to fire events when recordset is modified in anyway"," this.publish({"," /**"," * <p>At least one record is being added. Additional properties of"," * the event are:</p>"," * <dl>"," * <dt>added</dt>"," * <dd>Array of new records to be added</dd>"," * <dt>index</dt>"," * <dd>The insertion index in the Recordset's internal"," * array</dd>"," * </dl>"," *"," * <p>Preventing this event will cause the new records NOT to be"," * added to the Recordset's internal collection.</p>"," *"," * @event add"," * @preventable _defAddFn"," */"," add: { defaultFn: this._defAddFn },",""," /**"," * <p>At least one record is being removed. Additional properties of"," * the event are:</p>"," * <dl>"," * <dt>removed</dt>"," * <dd>Array of records to be removed</dd>"," * <dt>range</dt>"," * <dd>Number of records to be removed</dd>"," * <dt>index</dt>"," * <dd>The starting index in the Recordset's internal"," * array from which to remove records</dd>"," * </dl>"," *"," * <p>Preventing this event will cause the records NOT to be"," * removed from the Recordset's internal collection.</p>"," *"," * @event remove"," * @preventable _defRemoveFn"," */"," remove: { defaultFn: this._defRemoveFn },",""," /**"," * The Recordset is being flushed of all records."," *"," * @event empty"," * @preventable _defEmptyFn"," */"," empty: { defaultFn: this._defEmptyFn },",""," /**"," * <p>At least one record is being updated. Additional properties of"," * the event are:</p>"," * <dl>"," * <dt>updated</dt>"," * <dd>Array of records with updated values</dd>"," * <dt>overwritten</dt>"," * <dd>Array of current records that will be replaced</dd>"," * <dt>index</dt>"," * <dd>The starting index in the Recordset's internal"," * array from which to update will apply</dd>"," * </dl>"," *"," * <p>Preventing this event will cause the records NOT to be"," * updated in the Recordset's internal collection.</p>"," *"," * @event update"," * @preventable _defUpdateFn"," */"," update: { defaultFn: this._defUpdateFn }"," });",""," this._buildHashTable(this.get('key'));",""," this.after(["," 'recordsChange',"," 'add',"," 'remove',"," 'update',"," 'empty'], this._updateHash);"," },",""," /**"," * Returns the record with particular ID or index"," *"," * @method getRecord"," * @param i {String, Number} The ID of the record if a string, or the index if a number."," * @return {Record} A Y.Record instance"," */"," getRecord: function(i) {",""," if (Lang.isString(i)) {"," return this.get('table')[i];"," }"," else if (Lang.isNumber(i)) {"," return this._items[i];"," }"," return null;"," },","",""," /**"," * Returns the record at a particular index"," *"," * @method getRecordByIndex"," * @param i {Number} Index at which the required record resides"," * @return {Record} A Y.Record instance"," */"," getRecordByIndex: function(i) {"," return this._items[i];"," },",""," /**"," * Returns a range of records beginning at particular index"," *"," * @method getRecordsByIndex"," * @param index {Number} Index at which the required record resides"," * @param range {Number} (Optional) Number of records to retrieve. The default is 1"," * @return {Array} An array of Y.Record instances"," */"," getRecordsByIndex: function(index, range) {"," var i = 0,"," returnedRecords = [];"," //Range cannot take on negative values"," range = (Lang.isNumber(range) && (range > 0)) ? range: 1;",""," for (; i < range; i++) {"," returnedRecords.push(this._items[index + i]);"," }"," return returnedRecords;"," },",""," /**"," * Returns the length of the recordset"," *"," * @method getLength"," * @return {Number} Number of records in the recordset"," */"," getLength: function() {"," return this.size();"," },",""," /**"," Gets an array of values for a data _key_ in the set's records. If no _key_"," is supplied, the returned array will contain the full data object for each"," record.",""," @method getValuesByKey"," @param {String} [key] Data property to get from all records"," @return {Array} An array of values for the given _key_ if supplied."," Otherwise, an array of each record's data hash."," **/"," getValuesByKey: function(key) {"," var i = 0,"," len = this._items.length,"," retVals = [];"," for (; i < len; i++) {"," retVals.push(this._items[i].getValue(key));"," }"," return retVals;"," },","",""," /**"," * Adds one or more Records to the RecordSet at the given index. If index is null, then adds the Records to the end of the RecordSet."," *"," * @method add"," * @param {Record|Object|Array} oData A Y.Record instance, An object literal of data or an array of object literals"," * @param [index] {Number} [index] Index at which to add the record(s)"," * @return {Recordset} The updated recordset instance"," */"," add: function(oData, index) {",""," var newRecords = [],"," idx,"," i = 0;",""," idx = (Lang.isNumber(index) && (index > -1)) ? index: this._items.length;",""," //Passing in array of object literals for oData"," if (Lang.isArray(oData)) {"," for (; i < oData.length; i++) {"," newRecords[i] = this._changeToRecord(oData[i]);"," }"," } else if (Lang.isObject(oData)) {"," newRecords[0] = this._changeToRecord(oData);"," }",""," this.fire('add', {"," added: newRecords,"," index: idx"," });"," return this;"," },",""," /**"," Removes one or more Records to the RecordSet at the given index. If index"," is null, then removes a single Record from the end of the RecordSet."," "," @method remove"," @param {Number} [index] Index at which to remove the record(s) from"," @param {Number} [range] Number of records to remove (including the one"," at the index)"," @return {Recordset} The updated recordset instance"," **/"," remove: function(index, range) {"," var remRecords = [];",""," //Default is to only remove the last record - the length is always 1 greater than the last index"," index = (index > -1) ? index: (this._items.length - 1);"," range = (range > 0) ? range: 1;",""," remRecords = this._items.slice(index, (index + range));"," this.fire('remove', {"," removed: remRecords,"," range: range,"," index: index"," });"," //this._recordRemoved(remRecords, index);"," //return ({data: remRecords, index:index});"," return this;"," },",""," /**"," * Empties the recordset"," *"," * @method empty"," * @return {Recordset} The updated recordset instance"," */"," empty: function() {"," this.fire('empty', {});"," return this;"," },",""," /**"," Updates the recordset with the new records passed in. Overwrites existing"," records when updating the index with the new records."," "," @method update"," @param {Record|Object|Array} data A Y.Record instance, An object literal of"," data or an array of object literals"," @param {Number} [index] The index to start updating from. "," @return {Recordset} The updated recordset instance"," **/"," update: function(data, index) {"," var rec,"," arr,"," i = 0;",""," // Whatever is passed in, we are changing it to an array so that it can"," // be easily iterated in the _defUpdateFn method"," arr = (!(Lang.isArray(data))) ? [data] : data;"," rec = this._items.slice(index, index + arr.length);",""," for (; i < arr.length; i++) {"," arr[i] = this._changeToRecord(arr[i]);"," }",""," this.fire('update', {"," updated: arr,"," overwritten: rec,"," index: index"," });",""," return this;"," },",""," /**"," * Default behavior for the \"add\" event. Adds Record instances starting from"," * the index specified in `e.index`."," *"," * @method _defAddFn"," * @param {EventFacade} e The add event"," * @private"," */"," _defAddFn: function(e) {"," this._items.splice.apply(this._items, [e.index, 0].concat(e.added));"," },",""," /**"," * Default behavior for the \"remove\" event. Removes Records from the"," * internal array starting from `e.index`. By default, it will remove one"," * Record. But if `e.range` is set, it will remove that many Records."," *"," * @method _defRemoveFn"," * @param {EventFacade} e The remove event"," * @private"," */"," _defRemoveFn: function(e) {"," this._items.splice(e.index, e.range || 1);"," },",""," /**"," * Default behavior for the \"update\" event. Sets Record instances for each"," * item in `e.updated` at indexes starting from `e.index`."," *"," * @method _defUpdateFn"," * @param {EventFacade} e The update event"," * @private"," */"," _defUpdateFn: function(e) {"," for (var i = 0; i < e.updated.length; i++) {"," this._items[e.index + i] = this._changeToRecord(e.updated[i]);"," }"," },",""," /**"," * Default behavior for the \"empty\" event. Clears the internal array of"," * Records."," *"," * @method _defEmptyFn"," * @param {EventFacade} e The empty event"," * @private"," */"," _defEmptyFn: function(e) {"," this._items = [];"," },",""," /**"," Updates the internal hash table.",""," @method _defUpdateHash"," @param {EventFacade} e Event triggering the hash table update"," @private"," **/"," _updateHash: function (e) {"," var handler = \"_hash\","," type = e.type.replace(/.*:/,''),"," newHash;",""," // _hashAdd, _hashRemove, _hashEmpty, etc"," // Not a switch or else if setup to allow for external expansion."," handler += type.charAt(0).toUpperCase() + type.slice(1);",""," newHash = this[handler] &&"," this[handler](this.get('table'), this.get('key'), e);",""," if (newHash) {"," this.set('table', newHash);"," }"," },",""," /**"," Regenerates the hash table from the current internal array of Records.",""," @method _hashRecordsChange"," @param {Object} hash The hash map before replacement"," @param {String} key The key by which to add items to the hash"," @param {Object} e The event or object containing the items to be added."," Items are expected to be stored in an array assigned to"," the `added` property."," @return {Object} The updated hash map"," @private"," **/"," _hashRecordsChange: function (hash, key, e) {"," return this._buildHashTable(key);"," },",""," /**"," Builds a hash table from the current internal array of Records.",""," @method _buildHashTable"," @param {String} key The Record key to hash the items by"," @return {Object} A new hash map of Records keyed by each Records' key"," @private"," **/"," _buildHashTable: function (key) {"," return this._hashAdd({}, key, { added: this._items });"," },",""," /**"," Adds items to the hash table. Items are the values, and the keys are the"," values of the item's attribute named in the `key` parameter.",""," @method _hashAdd"," @param {Object} hash The hash map before adding items"," @param {String} key The key by which to add the items to the hash"," @param {Object} e The event or object containing the items to be added."," Items are expected to be stored in an array assigned to"," the `added` property."," @return {Object} The updated hash map"," @private"," **/"," _hashAdd: function(hash, key, e) {"," var items = e.added,"," i, len;",""," for (i = 0, len = e.added.length; i < len; ++i) {"," hash[items[i].get(key)] = items[i];"," }",""," return hash;"," },",""," /**"," Removes items from the hash table.",""," @method _hashRemove"," @param {Object} hash The hash map before removing items"," @param {String} key The key by which to remove the items from the hash"," @param {Object} e The event or object containing the items to be removed."," Items are expected to be stored in an array assigned to"," the `removed` property."," @return {Object} The updated hash map"," @private"," **/"," _hashRemove: function(hash, key, e) {"," for (var i = e.removed.length - 1; i >= 0; --i) {"," delete hash[e.removed[i].get(key)];"," }",""," return hash;"," },",""," /**"," Updates items in the hash table.",""," @method _hashUpdate"," @param {Object} hash The hash map before updating items"," @param {String} key The key by which to update the items to the hash"," @param {Object} e The event or object containing the items to be updated."," Items are expected to be stored in an array assigned to"," the `updated` property. Optionally, items can be"," identified for being overwritten by including them in an"," array assigned to the `overwritten` property."," @return {Object} The updated hash map"," @private"," **/"," _hashUpdate: function (hash, key, e) {"," if (e.overwritten && e.overwritten.length) {"," hash = this._hashRemove(hash, key, { removed: e.overwritten });"," }",""," return this._hashAdd(hash, key, { added: e.updated });"," },",""," /**"," Clears the hash table.",""," @method _hashEmpty"," @param {Object} hash The hash map before adding items"," @param {String} key The key by which to remove the items from the hash"," @param {Object} e The event or object containing the items to be removed."," Items are expected to be stored in an array assigned to"," the `removed` property."," @return {Object} An empty hash"," @private"," **/"," _hashEmpty: function() {"," return {};"," },",""," /**"," * Sets up the hashtable with all the records currently in the recordset"," *"," * @method _initHashTable"," * @private"," */"," _initHashTable: function() {"," return this._hashAdd({}, this.get('key'), { added: this._items || [] });"," },",""," /**"," * Helper method - it takes an object bag and converts it to a Y.Record"," *"," * @method _changeToRecord"," * @param obj {Object|Record} Any objet literal or Y.Record instance"," * @return {Record} A Record instance."," * @private"," */"," _changeToRecord: function(obj) {"," return (obj instanceof Y.Record) ? obj : new Y.Record({ data: obj });"," },",""," /**"," Ensures the value being set is an array of Record instances. If array items"," are raw object data, they are turned into Records.",""," @method _setRecords"," @param {Record[]|Object[]} items The Records or data Objects to store as"," Records."," @return {Record[]}"," **/"," _setRecords: function (items) {"," if (!Y.Lang.isArray(items)) {"," return Y.Attribute.INVALID_VALUE;"," }",""," var records = [],"," i, len;",""," // FIXME: This should use the flyweight pattern if possible"," for (i = 0, len = items.length; i < len; ++i) {"," records[i] = this._changeToRecord(items[i]);"," }",""," return (this._items = records);"," }","}, {"," ATTRS: {",""," /**"," * An array of Records that the Recordset is storing. Passing an array"," * of raw record data is also accepted. The data for each item will be"," * wrapped in a Record instance."," *"," * @attribute records"," * @type {Record[]}"," */"," records: {"," // TODO: necessary? valueFn?"," lazyAdd: false,"," getter: function() {"," // give them a copy, not the internal object"," return Y.Array(this._items);"," },"," setter: \"_setRecords\""," },",""," /**"," A hash table where the ID of the record is the key, and the record"," instance is the value."," "," @attribute table"," @type object"," **/"," table: {"," valueFn: '_initHashTable'"," },",""," /**"," The ID to use as the key in the hash table."," "," @attribute key"," @type string"," **/"," key: {"," value: 'id',"," readOnly: true"," }",""," }","});","Y.augment(Recordset, ArrayList);","Y.Recordset = Recordset;","","","","}, '3.7.2', {\"requires\": [\"base\", \"arraylist\"]});"];+_yuitest_coverage["build/recordset-base/recordset-base.js"].code=["YUI.add('recordset-base', function (Y, NAME) {","","/**"," * Provides a wrapper around a standard javascript object. Can be inserted into a Recordset instance."," *"," * @class Record"," */","var Record = Y.Base.create('record', Y.Base, [], {"," _setId: function() {"," return Y.guid();"," },",""," initializer: function() {"," },",""," destructor: function() {"," },",""," /**"," * Retrieve a particular (or all) values from the object"," *"," * @param field {string} (optional) The key to retrieve the value from. If not supplied, the entire object is returned."," * @method getValue"," * @public"," */"," getValue: function(field) {"," if (field === undefined) {"," return this.get(\"data\");"," }"," else {"," return this.get(\"data\")[field];"," }"," return null;"," }","},","{"," ATTRS: {",""," /**"," * @description Unique ID of the record instance"," * @attribute id"," * @type string"," */"," id: {"," valueFn: \"_setId\""," },",""," /**"," * @description The object stored within the record instance"," * @attribute data"," * @type object"," */"," data: {"," value: null"," }"," }","});","","Y.Record = Record;","/**","The Recordset utility provides a standard way for dealing with","a collection of similar objects.","@module recordset","@main recordset","@submodule recordset-base","**/","","","var ArrayList = Y.ArrayList,","Lang = Y.Lang,","","/**","The Recordset utility provides a standard way for dealing with","a collection of similar objects.","","Provides the base Recordset implementation, which can be extended to add","additional functionality, such as custom indexing. sorting, and filtering.","","@class Recordset","@extends Base","@uses ArrayList","@param config {Object} Configuration object with initial attribute values","@constructor","**/","Recordset = Y.Base.create('recordset', Y.Base, [], {","",""," /**"," * Publish default functions for events. Create the initial hash table."," *"," * @method initializer"," * @protected"," */"," initializer: function() {"," // The reason the conditional is needed is because of two scenarios:"," // 1. Instantiating new Y.Recordset() will not go into the setter of \"records\", and so it is necessary to create this._items in the initializer."," // 2. Instantiating new Y.Recordset({records: [{...}]}) will call the setter of \"records\" and create this._items. In this case, we don't want that to be overwritten by []."," if (!this._items) {"," this._items = [];"," }",""," //set up event listener to fire events when recordset is modified in anyway"," this.publish({"," /**"," * <p>At least one record is being added. Additional properties of"," * the event are:</p>"," * <dl>"," * <dt>added</dt>"," * <dd>Array of new records to be added</dd>"," * <dt>index</dt>"," * <dd>The insertion index in the Recordset's internal"," * array</dd>"," * </dl>"," *"," * <p>Preventing this event will cause the new records NOT to be"," * added to the Recordset's internal collection.</p>"," *"," * @event add"," * @preventable _defAddFn"," */"," add: { defaultFn: this._defAddFn },",""," /**"," * <p>At least one record is being removed. Additional properties of"," * the event are:</p>"," * <dl>"," * <dt>removed</dt>"," * <dd>Array of records to be removed</dd>"," * <dt>range</dt>"," * <dd>Number of records to be removed</dd>"," * <dt>index</dt>"," * <dd>The starting index in the Recordset's internal"," * array from which to remove records</dd>"," * </dl>"," *"," * <p>Preventing this event will cause the records NOT to be"," * removed from the Recordset's internal collection.</p>"," *"," * @event remove"," * @preventable _defRemoveFn"," */"," remove: { defaultFn: this._defRemoveFn },",""," /**"," * The Recordset is being flushed of all records."," *"," * @event empty"," * @preventable _defEmptyFn"," */"," empty: { defaultFn: this._defEmptyFn },",""," /**"," * <p>At least one record is being updated. Additional properties of"," * the event are:</p>"," * <dl>"," * <dt>updated</dt>"," * <dd>Array of records with updated values</dd>"," * <dt>overwritten</dt>"," * <dd>Array of current records that will be replaced</dd>"," * <dt>index</dt>"," * <dd>The starting index in the Recordset's internal"," * array from which to update will apply</dd>"," * </dl>"," *"," * <p>Preventing this event will cause the records NOT to be"," * updated in the Recordset's internal collection.</p>"," *"," * @event update"," * @preventable _defUpdateFn"," */"," update: { defaultFn: this._defUpdateFn }"," });",""," this._buildHashTable(this.get('key'));",""," this.after(["," 'recordsChange',"," 'add',"," 'remove',"," 'update',"," 'empty'], this._updateHash);"," },",""," /**"," * Returns the record with particular ID or index"," *"," * @method getRecord"," * @param i {String, Number} The ID of the record if a string, or the index if a number."," * @return {Record} A Y.Record instance"," */"," getRecord: function(i) {",""," if (Lang.isString(i)) {"," return this.get('table')[i];"," }"," else if (Lang.isNumber(i)) {"," return this._items[i];"," }"," return null;"," },","",""," /**"," * Returns the record at a particular index"," *"," * @method getRecordByIndex"," * @param i {Number} Index at which the required record resides"," * @return {Record} A Y.Record instance"," */"," getRecordByIndex: function(i) {"," return this._items[i];"," },",""," /**"," * Returns a range of records beginning at particular index"," *"," * @method getRecordsByIndex"," * @param index {Number} Index at which the required record resides"," * @param range {Number} (Optional) Number of records to retrieve. The default is 1"," * @return {Array} An array of Y.Record instances"," */"," getRecordsByIndex: function(index, range) {"," var i = 0,"," returnedRecords = [];"," //Range cannot take on negative values"," range = (Lang.isNumber(range) && (range > 0)) ? range: 1;",""," for (; i < range; i++) {"," returnedRecords.push(this._items[index + i]);"," }"," return returnedRecords;"," },",""," /**"," * Returns the length of the recordset"," *"," * @method getLength"," * @return {Number} Number of records in the recordset"," */"," getLength: function() {"," return this.size();"," },",""," /**"," Gets an array of values for a data _key_ in the set's records. If no _key_"," is supplied, the returned array will contain the full data object for each"," record.",""," @method getValuesByKey"," @param {String} [key] Data property to get from all records"," @return {Array} An array of values for the given _key_ if supplied."," Otherwise, an array of each record's data hash."," **/"," getValuesByKey: function(key) {"," var i = 0,"," len = this._items.length,"," retVals = [];"," for (; i < len; i++) {"," retVals.push(this._items[i].getValue(key));"," }"," return retVals;"," },","",""," /**"," * Adds one or more Records to the RecordSet at the given index. If index is null, then adds the Records to the end of the RecordSet."," *"," * @method add"," * @param {Record|Object|Array} oData A Y.Record instance, An object literal of data or an array of object literals"," * @param [index] {Number} [index] Index at which to add the record(s)"," * @return {Recordset} The updated recordset instance"," */"," add: function(oData, index) {",""," var newRecords = [],"," idx,"," i = 0;",""," idx = (Lang.isNumber(index) && (index > -1)) ? index: this._items.length;",""," //Passing in array of object literals for oData"," if (Lang.isArray(oData)) {"," for (; i < oData.length; i++) {"," newRecords[i] = this._changeToRecord(oData[i]);"," }"," } else if (Lang.isObject(oData)) {"," newRecords[0] = this._changeToRecord(oData);"," }",""," this.fire('add', {"," added: newRecords,"," index: idx"," });"," return this;"," },",""," /**"," Removes one or more Records to the RecordSet at the given index. If index"," is null, then removes a single Record from the end of the RecordSet."," "," @method remove"," @param {Number} [index] Index at which to remove the record(s) from"," @param {Number} [range] Number of records to remove (including the one"," at the index)"," @return {Recordset} The updated recordset instance"," **/"," remove: function(index, range) {"," var remRecords = [];",""," //Default is to only remove the last record - the length is always 1 greater than the last index"," index = (index > -1) ? index: (this._items.length - 1);"," range = (range > 0) ? range: 1;",""," remRecords = this._items.slice(index, (index + range));"," this.fire('remove', {"," removed: remRecords,"," range: range,"," index: index"," });"," //this._recordRemoved(remRecords, index);"," //return ({data: remRecords, index:index});"," return this;"," },",""," /**"," * Empties the recordset"," *"," * @method empty"," * @return {Recordset} The updated recordset instance"," */"," empty: function() {"," this.fire('empty', {});"," return this;"," },",""," /**"," Updates the recordset with the new records passed in. Overwrites existing"," records when updating the index with the new records."," "," @method update"," @param {Record|Object|Array} data A Y.Record instance, An object literal of"," data or an array of object literals"," @param {Number} [index] The index to start updating from. "," @return {Recordset} The updated recordset instance"," **/"," update: function(data, index) {"," var rec,"," arr,"," i = 0;",""," // Whatever is passed in, we are changing it to an array so that it can"," // be easily iterated in the _defUpdateFn method"," arr = (!(Lang.isArray(data))) ? [data] : data;"," rec = this._items.slice(index, index + arr.length);",""," for (; i < arr.length; i++) {"," arr[i] = this._changeToRecord(arr[i]);"," }",""," this.fire('update', {"," updated: arr,"," overwritten: rec,"," index: index"," });",""," return this;"," },",""," /**"," * Default behavior for the \"add\" event. Adds Record instances starting from"," * the index specified in `e.index`."," *"," * @method _defAddFn"," * @param {EventFacade} e The add event"," * @private"," */"," _defAddFn: function(e) {"," this._items.splice.apply(this._items, [e.index, 0].concat(e.added));"," },",""," /**"," * Default behavior for the \"remove\" event. Removes Records from the"," * internal array starting from `e.index`. By default, it will remove one"," * Record. But if `e.range` is set, it will remove that many Records."," *"," * @method _defRemoveFn"," * @param {EventFacade} e The remove event"," * @private"," */"," _defRemoveFn: function(e) {"," this._items.splice(e.index, e.range || 1);"," },",""," /**"," * Default behavior for the \"update\" event. Sets Record instances for each"," * item in `e.updated` at indexes starting from `e.index`."," *"," * @method _defUpdateFn"," * @param {EventFacade} e The update event"," * @private"," */"," _defUpdateFn: function(e) {"," for (var i = 0; i < e.updated.length; i++) {"," this._items[e.index + i] = this._changeToRecord(e.updated[i]);"," }"," },",""," /**"," * Default behavior for the \"empty\" event. Clears the internal array of"," * Records."," *"," * @method _defEmptyFn"," * @param {EventFacade} e The empty event"," * @private"," */"," _defEmptyFn: function(e) {"," this._items = [];"," },",""," /**"," Updates the internal hash table.",""," @method _defUpdateHash"," @param {EventFacade} e Event triggering the hash table update"," @private"," **/"," _updateHash: function (e) {"," var handler = \"_hash\","," type = e.type.replace(/.*:/,''),"," newHash;",""," // _hashAdd, _hashRemove, _hashEmpty, etc"," // Not a switch or else if setup to allow for external expansion."," handler += type.charAt(0).toUpperCase() + type.slice(1);",""," newHash = this[handler] &&"," this[handler](this.get('table'), this.get('key'), e);",""," if (newHash) {"," this.set('table', newHash);"," }"," },",""," /**"," Regenerates the hash table from the current internal array of Records.",""," @method _hashRecordsChange"," @param {Object} hash The hash map before replacement"," @param {String} key The key by which to add items to the hash"," @param {Object} e The event or object containing the items to be added."," Items are expected to be stored in an array assigned to"," the `added` property."," @return {Object} The updated hash map"," @private"," **/"," _hashRecordsChange: function (hash, key, e) {"," return this._buildHashTable(key);"," },",""," /**"," Builds a hash table from the current internal array of Records.",""," @method _buildHashTable"," @param {String} key The Record key to hash the items by"," @return {Object} A new hash map of Records keyed by each Records' key"," @private"," **/"," _buildHashTable: function (key) {"," return this._hashAdd({}, key, { added: this._items });"," },",""," /**"," Adds items to the hash table. Items are the values, and the keys are the"," values of the item's attribute named in the `key` parameter.",""," @method _hashAdd"," @param {Object} hash The hash map before adding items"," @param {String} key The key by which to add the items to the hash"," @param {Object} e The event or object containing the items to be added."," Items are expected to be stored in an array assigned to"," the `added` property."," @return {Object} The updated hash map"," @private"," **/"," _hashAdd: function(hash, key, e) {"," var items = e.added,"," i, len;",""," for (i = 0, len = e.added.length; i < len; ++i) {"," hash[items[i].get(key)] = items[i];"," }",""," return hash;"," },",""," /**"," Removes items from the hash table.",""," @method _hashRemove"," @param {Object} hash The hash map before removing items"," @param {String} key The key by which to remove the items from the hash"," @param {Object} e The event or object containing the items to be removed."," Items are expected to be stored in an array assigned to"," the `removed` property."," @return {Object} The updated hash map"," @private"," **/"," _hashRemove: function(hash, key, e) {"," for (var i = e.removed.length - 1; i >= 0; --i) {"," delete hash[e.removed[i].get(key)];"," }",""," return hash;"," },",""," /**"," Updates items in the hash table.",""," @method _hashUpdate"," @param {Object} hash The hash map before updating items"," @param {String} key The key by which to update the items to the hash"," @param {Object} e The event or object containing the items to be updated."," Items are expected to be stored in an array assigned to"," the `updated` property. Optionally, items can be"," identified for being overwritten by including them in an"," array assigned to the `overwritten` property."," @return {Object} The updated hash map"," @private"," **/"," _hashUpdate: function (hash, key, e) {"," if (e.overwritten && e.overwritten.length) {"," hash = this._hashRemove(hash, key, { removed: e.overwritten });"," }",""," return this._hashAdd(hash, key, { added: e.updated });"," },",""," /**"," Clears the hash table.",""," @method _hashEmpty"," @param {Object} hash The hash map before adding items"," @param {String} key The key by which to remove the items from the hash"," @param {Object} e The event or object containing the items to be removed."," Items are expected to be stored in an array assigned to"," the `removed` property."," @return {Object} An empty hash"," @private"," **/"," _hashEmpty: function() {"," return {};"," },",""," /**"," * Sets up the hashtable with all the records currently in the recordset"," *"," * @method _initHashTable"," * @private"," */"," _initHashTable: function() {"," return this._hashAdd({}, this.get('key'), { added: this._items || [] });"," },",""," /**"," * Helper method - it takes an object bag and converts it to a Y.Record"," *"," * @method _changeToRecord"," * @param obj {Object|Record} Any objet literal or Y.Record instance"," * @return {Record} A Record instance."," * @private"," */"," _changeToRecord: function(obj) {"," return (obj instanceof Y.Record) ? obj : new Y.Record({ data: obj });"," },",""," /**"," Ensures the value being set is an array of Record instances. If array items"," are raw object data, they are turned into Records.",""," @method _setRecords"," @param {Record[]|Object[]} items The Records or data Objects to store as"," Records."," @return {Record[]}"," **/"," _setRecords: function (items) {"," if (!Y.Lang.isArray(items)) {"," return Y.Attribute.INVALID_VALUE;"," }",""," var records = [],"," i, len;",""," // FIXME: This should use the flyweight pattern if possible"," for (i = 0, len = items.length; i < len; ++i) {"," records[i] = this._changeToRecord(items[i]);"," }",""," return (this._items = records);"," }","}, {"," ATTRS: {",""," /**"," * An array of Records that the Recordset is storing. Passing an array"," * of raw record data is also accepted. The data for each item will be"," * wrapped in a Record instance."," *"," * @attribute records"," * @type {Record[]}"," */"," records: {"," // TODO: necessary? valueFn?"," lazyAdd: false,"," getter: function() {"," // give them a copy, not the internal object"," return Y.Array(this._items);"," },"," setter: \"_setRecords\""," },",""," /**"," A hash table where the ID of the record is the key, and the record"," instance is the value."," "," @attribute table"," @type object"," **/"," table: {"," valueFn: '_initHashTable'"," },",""," /**"," The ID to use as the key in the hash table."," "," @attribute key"," @type string"," **/"," key: {"," value: 'id',"," readOnly: true"," }",""," }","});","Y.augment(Recordset, ArrayList);","Y.Recordset = Recordset;","","","","}, '3.7.3', {\"requires\": [\"base\", \"arraylist\"]});"]; _yuitest_coverage["build/recordset-base/recordset-base.js"].lines = {"1":0,"8":0,"10":0,"27":0,"28":0,"31":0,"33":0,"59":0,"69":0,"98":0,"99":0,"103":0,"174":0,"176":0,"193":0,"194":0,"196":0,"197":0,"199":0,"211":0,"223":0,"226":0,"228":0,"229":0,"231":0,"241":0,"255":0,"258":0,"259":0,"261":0,"275":0,"279":0,"282":0,"283":0,"284":0,"286":0,"287":0,"290":0,"294":0,"308":0,"311":0,"312":0,"314":0,"315":0,"322":0,"332":0,"333":0,"347":0,"353":0,"354":0,"356":0,"357":0,"360":0,"366":0,"378":0,"391":0,"403":0,"404":0,"417":0,"428":0,"434":0,"436":0,"439":0,"440":0,"457":0,"469":0,"486":0,"489":0,"490":0,"493":0,"509":0,"510":0,"513":0,"531":0,"532":0,"535":0,"551":0,"561":0,"573":0,"586":0,"587":0,"590":0,"594":0,"595":0,"598":0,"616":0,"645":0,"646":0}; _yuitest_coverage["build/recordset-base/recordset-base.js"].functions = {"_setId:9":0,"getValue:26":0,"initializer:94":0,"getRecord:191":0,"getRecordByIndex:210":0,"getRecordsByIndex:222":0,"getLength:240":0,"getValuesByKey:254":0,"add:273":0,"remove:307":0,"empty:331":0,"update:346":0,"_defAddFn:377":0,"_defRemoveFn:390":0,"_defUpdateFn:402":0,"_defEmptyFn:416":0,"_updateHash:427":0,"_hashRecordsChange:456":0,"_buildHashTable:468":0,"_hashAdd:485":0,"_hashRemove:508":0,"_hashUpdate:530":0,"_hashEmpty:550":0,"_initHashTable:560":0,"_changeToRecord:572":0,"_setRecords:585":0,"getter:614":0,"(anonymous 1):1":0}; _yuitest_coverage["build/recordset-base/recordset-base.js"].coveredLines = 88;@@ -802,4 +802,4 @@ -}, '3.7.2', {"requires": ["base", "arraylist"]});+}, '3.7.3', {"requires": ["base", "arraylist"]});
bundle/recordset-base/recordset-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -654,4 +654,4 @@ -}, '3.7.2', {"requires": ["base", "arraylist"]});+}, '3.7.3', {"requires": ["base", "arraylist"]});
bundle/recordset-base/recordset-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("recordset-base",function(e,t){var n=e.Base.create("record",e.Base,[],{_setId:function(){return e.guid()},initializer:function(){},destructor:function(){},getValue:function(e){return e===undefined?this.get("data"):this.get("data")[e]}},{ATTRS:{id:{valueFn:"_setId"},data:{value:null}}});e.Record=n;var r=e.ArrayList,i=e.Lang,s=e.Base.create("recordset",e.Base,[],{initializer:function(){this._items||(this._items=[]),this.publish({add:{defaultFn:this._defAddFn},remove:{defaultFn:this._defRemoveFn},empty:{defaultFn:this._defEmptyFn},update:{defaultFn:this._defUpdateFn}}),this._buildHashTable(this.get("key")),this.after(["recordsChange","add","remove","update","empty"],this._updateHash)},getRecord:function(e){return i.isString(e)?this.get("table")[e]:i.isNumber(e)?this._items[e]:null},getRecordByIndex:function(e){return this._items[e]},getRecordsByIndex:function(e,t){var n=0,r=[];t=i.isNumber(t)&&t>0?t:1;for(;n<t;n++)r.push(this._items[e+n]);return r},getLength:function(){return this.size()},getValuesByKey:function(e){var t=0,n=this._items.length,r=[];for(;t<n;t++)r.push(this._items[t].getValue(e));return r},add:function(e,t){var n=[],r,s=0;r=i.isNumber(t)&&t>-1?t:this._items.length;if(i.isArray(e))for(;s<e.length;s++)n[s]=this._changeToRecord(e[s]);else i.isObject(e)&&(n[0]=this._changeToRecord(e));return this.fire("add",{added:n,index:r}),this},remove:function(e,t){var n=[];return e=e>-1?e:this._items.length-1,t=t>0?t:1,n=this._items.slice(e,e+t),this.fire("remove",{removed:n,range:t,index:e}),this},empty:function(){return this.fire("empty",{}),this},update:function(e,t){var n,r,s=0;r=i.isArray(e)?e:[e],n=this._items.slice(t,t+r.length);for(;s<r.length;s++)r[s]=this._changeToRecord(r[s]);return this.fire("update",{updated:r,overwritten:n,index:t}),this},_defAddFn:function(e){this._items.splice.apply(this._items,[e.index,0].concat(e.added))},_defRemoveFn:function(e){this._items.splice(e.index,e.range||1)},_defUpdateFn:function(e){for(var t=0;t<e.updated.length;t++)this._items[e.index+t]=this._changeToRecord(e.updated[t])},_defEmptyFn:function(e){this._items=[]},_updateHash:function(e){var t="_hash",n=e.type.replace(/.*:/,""),r;t+=n.charAt(0).toUpperCase()+n.slice(1),r=this[t]&&this[t](this.get("table"),this.get("key"),e),r&&this.set("table",r)},_hashRecordsChange:function(e,t,n){return this._buildHashTable(t)},_buildHashTable:function(e){return this._hashAdd({},e,{added:this._items})},_hashAdd:function(e,t,n){var r=n.added,i,s;for(i=0,s=n.added.length;i<s;++i)e[r[i].get(t)]=r[i];return e},_hashRemove:function(e,t,n){for(var r=n.removed.length-1;r>=0;--r)delete e[n.removed[r].get(t)];return e},_hashUpdate:function(e,t,n){return n.overwritten&&n.overwritten.length&&(e=this._hashRemove(e,t,{removed:n.overwritten})),this._hashAdd(e,t,{added:n.updated})},_hashEmpty:function(){return{}},_initHashTable:function(){return this._hashAdd({},this.get("key"),{added:this._items||[]})},_changeToRecord:function(t){return t instanceof e.Record?t:new e.Record({data:t})},_setRecords:function(t){if(!e.Lang.isArray(t))return e.Attribute.INVALID_VALUE;var n=[],r,i;for(r=0,i=t.length;r<i;++r)n[r]=this._changeToRecord(t[r]);return this._items=n}},{ATTRS:{records:{lazyAdd:!1,getter:function(){return e.Array(this._items)},setter:"_setRecords"},table:{valueFn:"_initHashTable"},key:{value:"id",readOnly:!0}}});e.augment(s,r),e.Recordset=s},"3.7.2",{requires:["base","arraylist"]});+YUI.add("recordset-base",function(e,t){var n=e.Base.create("record",e.Base,[],{_setId:function(){return e.guid()},initializer:function(){},destructor:function(){},getValue:function(e){return e===undefined?this.get("data"):this.get("data")[e]}},{ATTRS:{id:{valueFn:"_setId"},data:{value:null}}});e.Record=n;var r=e.ArrayList,i=e.Lang,s=e.Base.create("recordset",e.Base,[],{initializer:function(){this._items||(this._items=[]),this.publish({add:{defaultFn:this._defAddFn},remove:{defaultFn:this._defRemoveFn},empty:{defaultFn:this._defEmptyFn},update:{defaultFn:this._defUpdateFn}}),this._buildHashTable(this.get("key")),this.after(["recordsChange","add","remove","update","empty"],this._updateHash)},getRecord:function(e){return i.isString(e)?this.get("table")[e]:i.isNumber(e)?this._items[e]:null},getRecordByIndex:function(e){return this._items[e]},getRecordsByIndex:function(e,t){var n=0,r=[];t=i.isNumber(t)&&t>0?t:1;for(;n<t;n++)r.push(this._items[e+n]);return r},getLength:function(){return this.size()},getValuesByKey:function(e){var t=0,n=this._items.length,r=[];for(;t<n;t++)r.push(this._items[t].getValue(e));return r},add:function(e,t){var n=[],r,s=0;r=i.isNumber(t)&&t>-1?t:this._items.length;if(i.isArray(e))for(;s<e.length;s++)n[s]=this._changeToRecord(e[s]);else i.isObject(e)&&(n[0]=this._changeToRecord(e));return this.fire("add",{added:n,index:r}),this},remove:function(e,t){var n=[];return e=e>-1?e:this._items.length-1,t=t>0?t:1,n=this._items.slice(e,e+t),this.fire("remove",{removed:n,range:t,index:e}),this},empty:function(){return this.fire("empty",{}),this},update:function(e,t){var n,r,s=0;r=i.isArray(e)?e:[e],n=this._items.slice(t,t+r.length);for(;s<r.length;s++)r[s]=this._changeToRecord(r[s]);return this.fire("update",{updated:r,overwritten:n,index:t}),this},_defAddFn:function(e){this._items.splice.apply(this._items,[e.index,0].concat(e.added))},_defRemoveFn:function(e){this._items.splice(e.index,e.range||1)},_defUpdateFn:function(e){for(var t=0;t<e.updated.length;t++)this._items[e.index+t]=this._changeToRecord(e.updated[t])},_defEmptyFn:function(e){this._items=[]},_updateHash:function(e){var t="_hash",n=e.type.replace(/.*:/,""),r;t+=n.charAt(0).toUpperCase()+n.slice(1),r=this[t]&&this[t](this.get("table"),this.get("key"),e),r&&this.set("table",r)},_hashRecordsChange:function(e,t,n){return this._buildHashTable(t)},_buildHashTable:function(e){return this._hashAdd({},e,{added:this._items})},_hashAdd:function(e,t,n){var r=n.added,i,s;for(i=0,s=n.added.length;i<s;++i)e[r[i].get(t)]=r[i];return e},_hashRemove:function(e,t,n){for(var r=n.removed.length-1;r>=0;--r)delete e[n.removed[r].get(t)];return e},_hashUpdate:function(e,t,n){return n.overwritten&&n.overwritten.length&&(e=this._hashRemove(e,t,{removed:n.overwritten})),this._hashAdd(e,t,{added:n.updated})},_hashEmpty:function(){return{}},_initHashTable:function(){return this._hashAdd({},this.get("key"),{added:this._items||[]})},_changeToRecord:function(t){return t instanceof e.Record?t:new e.Record({data:t})},_setRecords:function(t){if(!e.Lang.isArray(t))return e.Attribute.INVALID_VALUE;var n=[],r,i;for(r=0,i=t.length;r<i;++r)n[r]=this._changeToRecord(t[r]);return this._items=n}},{ATTRS:{records:{lazyAdd:!1,getter:function(){return e.Array(this._items)},setter:"_setRecords"},table:{valueFn:"_initHashTable"},key:{value:"id",readOnly:!0}}});e.augment(s,r),e.Recordset=s},"3.7.3",{requires:["base","arraylist"]});
bundle/recordset-base/recordset-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -653,4 +653,4 @@ -}, '3.7.2', {"requires": ["base", "arraylist"]});+}, '3.7.3', {"requires": ["base", "arraylist"]});
bundle/recordset-filter/recordset-filter-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/recordset-filter/recordset-filter.js", code: [] };-_yuitest_coverage["build/recordset-filter/recordset-filter.js"].code=["YUI.add('recordset-filter', function (Y, NAME) {","","/**"," * Plugin that provides the ability to filter through a recordset."," * Uses the filter methods available on Y.Array (see arrayextras submodule) to filter the recordset."," * @module recordset"," * @submodule recordset-filter"," */","","","var YArray = Y.Array,","Lang = Y.Lang;","","","/**"," * Plugin that provides the ability to filter through a recordset."," * Uses the filter methods available on Y.Array (see arrayextras submodule) to filter the recordset. "," * @class RecordsetFilter"," */","function RecordsetFilter(config) {"," RecordsetFilter.superclass.constructor.apply(this, arguments);","}","","Y.mix(RecordsetFilter, {"," NS: \"filter\",",""," NAME: \"recordsetFilter\",",""," ATTRS: {"," }","","});","","","Y.extend(RecordsetFilter, Y.Plugin.Base, {","",""," /**"," Filter through the recordset with a custom filter function, or a key-value"," pair."," "," @method filter"," @param {Function|String} filter A custom filter function or a string"," representing the key to filter by."," @param {Any} [value] If filtering by key (_filter_ is a string), further"," filter by a specific value."," @return {Recordset} A new filtered Recordset instance"," **/"," filter: function (filter, value) {"," var recs = this.get('host').get('records'),"," key;",""," //If a key-value pair is passed in, generate a custom function"," if (value && Lang.isString(filter)) {"," key = filter;"," filter = function(item) {"," return (item.getValue(key) === value);"," };"," }",""," //TODO: PARENT CHILD RELATIONSHIP"," return new Y.Recordset({"," records: YArray.filter(recs, filter)"," });"," },",""," /**"," The inverse of filter. Executes the supplied function on each item. Returns"," a new Recordset containing the items that the supplied function returned"," `false` for.",""," @method reject"," @param {Function} filter A boolean function, executed on each item."," @return {Recordset} A new Recordset instance containing the items on which"," the supplied function returned false."," **/"," reject: function (filter) {"," return new Y.Recordset({"," records: YArray.reject(this.get('host').get('records'), filter)"," });"," },",""," /**"," Iterates over the Recordset, returning a new Recordset of all the elements"," that match the supplied regular expression",""," @method grep"," @param {RegExp} pattern The regular expression to test against each record."," @return {Recordset} A Recordset instance containing all the items in the"," collection that produce a match against the supplied regular"," expression. If no items match, an empty Recordset instance is returned."," **/"," grep: function (pattern) {"," return new Y.Recordset({"," records: YArray.grep(this.get('host').get('records'), pattern)"," });"," }",""," //TODO: Add more pass-through methods to arrayextras","});","","Y.namespace(\"Plugin\").RecordsetFilter = RecordsetFilter;","","","}, '3.7.2', {\"requires\": [\"recordset-base\", \"array-extras\", \"plugin\"]});"];+_yuitest_coverage["build/recordset-filter/recordset-filter.js"].code=["YUI.add('recordset-filter', function (Y, NAME) {","","/**"," * Plugin that provides the ability to filter through a recordset."," * Uses the filter methods available on Y.Array (see arrayextras submodule) to filter the recordset."," * @module recordset"," * @submodule recordset-filter"," */","","","var YArray = Y.Array,","Lang = Y.Lang;","","","/**"," * Plugin that provides the ability to filter through a recordset."," * Uses the filter methods available on Y.Array (see arrayextras submodule) to filter the recordset. "," * @class RecordsetFilter"," */","function RecordsetFilter(config) {"," RecordsetFilter.superclass.constructor.apply(this, arguments);","}","","Y.mix(RecordsetFilter, {"," NS: \"filter\",",""," NAME: \"recordsetFilter\",",""," ATTRS: {"," }","","});","","","Y.extend(RecordsetFilter, Y.Plugin.Base, {","",""," /**"," Filter through the recordset with a custom filter function, or a key-value"," pair."," "," @method filter"," @param {Function|String} filter A custom filter function or a string"," representing the key to filter by."," @param {Any} [value] If filtering by key (_filter_ is a string), further"," filter by a specific value."," @return {Recordset} A new filtered Recordset instance"," **/"," filter: function (filter, value) {"," var recs = this.get('host').get('records'),"," key;",""," //If a key-value pair is passed in, generate a custom function"," if (value && Lang.isString(filter)) {"," key = filter;"," filter = function(item) {"," return (item.getValue(key) === value);"," };"," }",""," //TODO: PARENT CHILD RELATIONSHIP"," return new Y.Recordset({"," records: YArray.filter(recs, filter)"," });"," },",""," /**"," The inverse of filter. Executes the supplied function on each item. Returns"," a new Recordset containing the items that the supplied function returned"," `false` for.",""," @method reject"," @param {Function} filter A boolean function, executed on each item."," @return {Recordset} A new Recordset instance containing the items on which"," the supplied function returned false."," **/"," reject: function (filter) {"," return new Y.Recordset({"," records: YArray.reject(this.get('host').get('records'), filter)"," });"," },",""," /**"," Iterates over the Recordset, returning a new Recordset of all the elements"," that match the supplied regular expression",""," @method grep"," @param {RegExp} pattern The regular expression to test against each record."," @return {Recordset} A Recordset instance containing all the items in the"," collection that produce a match against the supplied regular"," expression. If no items match, an empty Recordset instance is returned."," **/"," grep: function (pattern) {"," return new Y.Recordset({"," records: YArray.grep(this.get('host').get('records'), pattern)"," });"," }",""," //TODO: Add more pass-through methods to arrayextras","});","","Y.namespace(\"Plugin\").RecordsetFilter = RecordsetFilter;","","","}, '3.7.3', {\"requires\": [\"recordset-base\", \"array-extras\", \"plugin\"]});"]; _yuitest_coverage["build/recordset-filter/recordset-filter.js"].lines = {"1":0,"11":0,"20":0,"21":0,"24":0,"35":0,"50":0,"54":0,"55":0,"56":0,"57":0,"62":0,"78":0,"94":0,"102":0}; _yuitest_coverage["build/recordset-filter/recordset-filter.js"].functions = {"RecordsetFilter:20":0,"filter:56":0,"filter:49":0,"reject:77":0,"grep:93":0,"(anonymous 1):1":0}; _yuitest_coverage["build/recordset-filter/recordset-filter.js"].coveredLines = 15;@@ -162,4 +162,4 @@ Y.namespace("Plugin").RecordsetFilter = RecordsetFilter; -}, '3.7.2', {"requires": ["recordset-base", "array-extras", "plugin"]});+}, '3.7.3', {"requires": ["recordset-base", "array-extras", "plugin"]});
bundle/recordset-filter/recordset-filter-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -108,4 +108,4 @@ Y.namespace("Plugin").RecordsetFilter = RecordsetFilter; -}, '3.7.2', {"requires": ["recordset-base", "array-extras", "plugin"]});+}, '3.7.3', {"requires": ["recordset-base", "array-extras", "plugin"]});
bundle/recordset-filter/recordset-filter-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("recordset-filter",function(e,t){function i(e){i.superclass.constructor.apply(this,arguments)}var n=e.Array,r=e.Lang;e.mix(i,{NS:"filter",NAME:"recordsetFilter",ATTRS:{}}),e.extend(i,e.Plugin.Base,{filter:function(t,i){var s=this.get("host").get("records"),o;return i&&r.isString(t)&&(o=t,t=function(e){return e.getValue(o)===i}),new e.Recordset({records:n.filter(s,t)})},reject:function(t){return new e.Recordset({records:n.reject(this.get("host").get("records"),t)})},grep:function(t){return new e.Recordset({records:n.grep(this.get("host").get("records"),t)})}}),e.namespace("Plugin").RecordsetFilter=i},"3.7.2",{requires:["recordset-base","array-extras","plugin"]});+YUI.add("recordset-filter",function(e,t){function i(e){i.superclass.constructor.apply(this,arguments)}var n=e.Array,r=e.Lang;e.mix(i,{NS:"filter",NAME:"recordsetFilter",ATTRS:{}}),e.extend(i,e.Plugin.Base,{filter:function(t,i){var s=this.get("host").get("records"),o;return i&&r.isString(t)&&(o=t,t=function(e){return e.getValue(o)===i}),new e.Recordset({records:n.filter(s,t)})},reject:function(t){return new e.Recordset({records:n.reject(this.get("host").get("records"),t)})},grep:function(t){return new e.Recordset({records:n.grep(this.get("host").get("records"),t)})}}),e.namespace("Plugin").RecordsetFilter=i},"3.7.3",{requires:["recordset-base","array-extras","plugin"]});
bundle/recordset-filter/recordset-filter.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -108,4 +108,4 @@ Y.namespace("Plugin").RecordsetFilter = RecordsetFilter; -}, '3.7.2', {"requires": ["recordset-base", "array-extras", "plugin"]});+}, '3.7.3', {"requires": ["recordset-base", "array-extras", "plugin"]});
bundle/recordset-indexer/recordset-indexer-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/recordset-indexer/recordset-indexer.js", code: [] };-_yuitest_coverage["build/recordset-indexer/recordset-indexer.js"].code=["YUI.add('recordset-indexer', function (Y, NAME) {","","/**"," * Provides the ability to store multiple custom hash tables referencing records in the recordset."," * @module recordset"," * @submodule recordset-indexer"," */","/**"," * Plugin that provides the ability to store multiple custom hash tables referencing records in the recordset."," * This utility does not support any collision handling. New hash table entries with a used key overwrite older ones."," * @class RecordsetIndexer"," */","function RecordsetIndexer(config) {"," RecordsetIndexer.superclass.constructor.apply(this, arguments);","}","","Y.mix(RecordsetIndexer, {"," NS: \"indexer\",",""," NAME: \"recordsetIndexer\",",""," ATTRS: {"," /**"," * @description Collection of all the hashTables created by the plugin. "," * The individual tables can be accessed by the key they are hashing against. "," *"," * @attribute hashTables"," * @public"," * @type object"," */"," hashTables: {"," value: {",""," }"," },","",""," keys: {"," value: {",""," }"," }"," }","});","","","Y.extend(RecordsetIndexer, Y.Plugin.Base, {",""," initializer: function(config) {"," var host = this.get('host');",""," //setup listeners on recordset events"," this.onHostEvent('add', Y.bind(\"_defAddHash\", this), host);"," this.onHostEvent('remove', Y.bind('_defRemoveHash', this), host);"," this.onHostEvent('update', Y.bind('_defUpdateHash', this), host);",""," },",""," destructor: function(config) {"," "," },","",""," /**"," * @description Setup the hash table for a given key with all existing records in the recordset"," *"," * @method _setHashTable"," * @param key {string} A key to hash by."," * @return obj {object} The created hash table"," * @private"," */"," _setHashTable: function(key) {"," var host = this.get('host'),"," obj = {},"," i = 0,"," len = host.getLength();",""," for (; i < len; i++) {"," obj[host._items[i].getValue(key)] = host._items[i];"," }"," return obj;"," },",""," //---------------------------------------------"," // Syncing Methods"," //---------------------------------------------",""," /**"," * @description Updates all hash tables when a record is added to the recordset"," *"," * @method _defAddHash"," * @private"," */"," _defAddHash: function(e) {"," var tbl = this.get('hashTables');","",""," //Go through every hashtable that is stored."," //in each hashtable, look to see if the key is represented in the object being added."," Y.each(tbl,"," function(v, key) {"," Y.each(e.added || e.updated,"," function(o) {"," //if the object being added has a key which is being stored by hashtable v, add it into the table."," if (o.getValue(key)) {"," v[o.getValue(key)] = o;"," }"," });"," });",""," },",""," /**"," * @description Updates all hash tables when a record is removed from the recordset"," *"," * @method _defRemoveHash"," * @private"," */"," _defRemoveHash: function(e) {"," var tbl = this.get('hashTables'),"," reckey;",""," //Go through every hashtable that is stored."," //in each hashtable, look to see if the key is represented in the object being deleted."," Y.each(tbl,"," function(v, key) {"," Y.each(e.removed || e.overwritten,"," function(o) {"," reckey = o.getValue(key);",""," //if the hashtable has a key storing a record, and the key and the record both match the record being deleted, delete that row from the hashtable"," if (reckey && v[reckey] === o) {"," delete v[reckey];"," }"," });"," });"," },",""," /**"," * @description Updates all hash tables when the recordset is updated (a combination of add and remove)"," *"," * @method _defUpdateHash"," * @private"," */"," _defUpdateHash: function(e) {",""," //TODO: It will be more performant to create a new method rather than using _defAddHash, _defRemoveHash, due to the number of loops. See commented code."," e.added = e.updated;"," e.removed = e.overwritten;"," this._defAddHash(e);"," this._defRemoveHash(e);",""," /*"," var tbl = this.get('hashTables'), reckey;"," "," Y.each(tbl, function(v, key) {"," Y.each(e.updated, function(o, i) {"," "," //delete record from hashtable if it has been overwritten"," reckey = o.getValue(key);"," "," if (reckey) {"," v[reckey] = o;"," }"," "," //the undefined case is if more records are updated than currently exist in the recordset. "," if (e.overwritten[i] && (v[e.overwritten[i].getValue(key)] === e.overwritten[i])) {"," delete v[e.overwritten[i].getValue(key)];"," }"," "," // if (v[reckey] === o) {"," // delete v[reckey];"," // }"," // "," // //add the new updated record if it has a key that corresponds to a hash table"," // if (o.getValue(key)) {"," // v[o.getValue(key)] = o;"," // }"," "," });"," });"," */"," },",""," //---------------------------------------------"," // Public Methods"," //---------------------------------------------",""," /**"," * @description Creates a new hash table."," *"," * @method createTable"," * @param key {string} A key to hash by."," * @return tbls[key] {object} The created hash table"," * @public"," */"," createTable: function(key) {"," var tbls = this.get('hashTables');"," tbls[key] = this._setHashTable(key);"," this.set('hashTables', tbls);",""," return tbls[key];"," },","",""," /**"," * @description Get a hash table that hashes records by a given key."," *"," * @method getTable"," * @param key {string} A key to hash by."," * @return table {object} The created hash table"," * @public"," */"," getTable: function(key) {"," return this.get('hashTables')[key];"," }","","","","","","});","Y.namespace(\"Plugin\").RecordsetIndexer = RecordsetIndexer;","","","","}, '3.7.2', {\"requires\": [\"recordset-base\", \"plugin\"]});"];+_yuitest_coverage["build/recordset-indexer/recordset-indexer.js"].code=["YUI.add('recordset-indexer', function (Y, NAME) {","","/**"," * Provides the ability to store multiple custom hash tables referencing records in the recordset."," * @module recordset"," * @submodule recordset-indexer"," */","/**"," * Plugin that provides the ability to store multiple custom hash tables referencing records in the recordset."," * This utility does not support any collision handling. New hash table entries with a used key overwrite older ones."," * @class RecordsetIndexer"," */","function RecordsetIndexer(config) {"," RecordsetIndexer.superclass.constructor.apply(this, arguments);","}","","Y.mix(RecordsetIndexer, {"," NS: \"indexer\",",""," NAME: \"recordsetIndexer\",",""," ATTRS: {"," /**"," * @description Collection of all the hashTables created by the plugin. "," * The individual tables can be accessed by the key they are hashing against. "," *"," * @attribute hashTables"," * @public"," * @type object"," */"," hashTables: {"," value: {",""," }"," },","",""," keys: {"," value: {",""," }"," }"," }","});","","","Y.extend(RecordsetIndexer, Y.Plugin.Base, {",""," initializer: function(config) {"," var host = this.get('host');",""," //setup listeners on recordset events"," this.onHostEvent('add', Y.bind(\"_defAddHash\", this), host);"," this.onHostEvent('remove', Y.bind('_defRemoveHash', this), host);"," this.onHostEvent('update', Y.bind('_defUpdateHash', this), host);",""," },",""," destructor: function(config) {"," "," },","",""," /**"," * @description Setup the hash table for a given key with all existing records in the recordset"," *"," * @method _setHashTable"," * @param key {string} A key to hash by."," * @return obj {object} The created hash table"," * @private"," */"," _setHashTable: function(key) {"," var host = this.get('host'),"," obj = {},"," i = 0,"," len = host.getLength();",""," for (; i < len; i++) {"," obj[host._items[i].getValue(key)] = host._items[i];"," }"," return obj;"," },",""," //---------------------------------------------"," // Syncing Methods"," //---------------------------------------------",""," /**"," * @description Updates all hash tables when a record is added to the recordset"," *"," * @method _defAddHash"," * @private"," */"," _defAddHash: function(e) {"," var tbl = this.get('hashTables');","",""," //Go through every hashtable that is stored."," //in each hashtable, look to see if the key is represented in the object being added."," Y.each(tbl,"," function(v, key) {"," Y.each(e.added || e.updated,"," function(o) {"," //if the object being added has a key which is being stored by hashtable v, add it into the table."," if (o.getValue(key)) {"," v[o.getValue(key)] = o;"," }"," });"," });",""," },",""," /**"," * @description Updates all hash tables when a record is removed from the recordset"," *"," * @method _defRemoveHash"," * @private"," */"," _defRemoveHash: function(e) {"," var tbl = this.get('hashTables'),"," reckey;",""," //Go through every hashtable that is stored."," //in each hashtable, look to see if the key is represented in the object being deleted."," Y.each(tbl,"," function(v, key) {"," Y.each(e.removed || e.overwritten,"," function(o) {"," reckey = o.getValue(key);",""," //if the hashtable has a key storing a record, and the key and the record both match the record being deleted, delete that row from the hashtable"," if (reckey && v[reckey] === o) {"," delete v[reckey];"," }"," });"," });"," },",""," /**"," * @description Updates all hash tables when the recordset is updated (a combination of add and remove)"," *"," * @method _defUpdateHash"," * @private"," */"," _defUpdateHash: function(e) {",""," //TODO: It will be more performant to create a new method rather than using _defAddHash, _defRemoveHash, due to the number of loops. See commented code."," e.added = e.updated;"," e.removed = e.overwritten;"," this._defAddHash(e);"," this._defRemoveHash(e);",""," /*"," var tbl = this.get('hashTables'), reckey;"," "," Y.each(tbl, function(v, key) {"," Y.each(e.updated, function(o, i) {"," "," //delete record from hashtable if it has been overwritten"," reckey = o.getValue(key);"," "," if (reckey) {"," v[reckey] = o;"," }"," "," //the undefined case is if more records are updated than currently exist in the recordset. "," if (e.overwritten[i] && (v[e.overwritten[i].getValue(key)] === e.overwritten[i])) {"," delete v[e.overwritten[i].getValue(key)];"," }"," "," // if (v[reckey] === o) {"," // delete v[reckey];"," // }"," // "," // //add the new updated record if it has a key that corresponds to a hash table"," // if (o.getValue(key)) {"," // v[o.getValue(key)] = o;"," // }"," "," });"," });"," */"," },",""," //---------------------------------------------"," // Public Methods"," //---------------------------------------------",""," /**"," * @description Creates a new hash table."," *"," * @method createTable"," * @param key {string} A key to hash by."," * @return tbls[key] {object} The created hash table"," * @public"," */"," createTable: function(key) {"," var tbls = this.get('hashTables');"," tbls[key] = this._setHashTable(key);"," this.set('hashTables', tbls);",""," return tbls[key];"," },","",""," /**"," * @description Get a hash table that hashes records by a given key."," *"," * @method getTable"," * @param key {string} A key to hash by."," * @return table {object} The created hash table"," * @public"," */"," getTable: function(key) {"," return this.get('hashTables')[key];"," }","","","","","","});","Y.namespace(\"Plugin\").RecordsetIndexer = RecordsetIndexer;","","","","}, '3.7.3', {\"requires\": [\"recordset-base\", \"plugin\"]});"]; _yuitest_coverage["build/recordset-indexer/recordset-indexer.js"].lines = {"1":0,"13":0,"14":0,"17":0,"47":0,"50":0,"53":0,"54":0,"55":0,"73":0,"78":0,"79":0,"81":0,"95":0,"100":0,"102":0,"105":0,"106":0,"120":0,"125":0,"127":0,"129":0,"132":0,"133":0,"148":0,"149":0,"150":0,"151":0,"198":0,"199":0,"200":0,"202":0,"215":0,"223":0}; _yuitest_coverage["build/recordset-indexer/recordset-indexer.js"].functions = {"RecordsetIndexer:13":0,"initializer:49":0,"_setHashTable:72":0,"(anonymous 3):103":0,"(anonymous 2):101":0,"_defAddHash:94":0,"(anonymous 5):128":0,"(anonymous 4):126":0,"_defRemoveHash:119":0,"_defUpdateHash:145":0,"createTable:197":0,"getTable:214":0,"(anonymous 1):1":0}; _yuitest_coverage["build/recordset-indexer/recordset-indexer.js"].coveredLines = 34;@@ -310,4 +310,4 @@ -}, '3.7.2', {"requires": ["recordset-base", "plugin"]});+}, '3.7.3', {"requires": ["recordset-base", "plugin"]});
bundle/recordset-indexer/recordset-indexer-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -230,4 +230,4 @@ -}, '3.7.2', {"requires": ["recordset-base", "plugin"]});+}, '3.7.3', {"requires": ["recordset-base", "plugin"]});
bundle/recordset-indexer/recordset-indexer-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("recordset-indexer",function(e,t){function n(e){n.superclass.constructor.apply(this,arguments)}e.mix(n,{NS:"indexer",NAME:"recordsetIndexer",ATTRS:{hashTables:{value:{}},keys:{value:{}}}}),e.extend(n,e.Plugin.Base,{initializer:function(t){var n=this.get("host");this.onHostEvent("add",e.bind("_defAddHash",this),n),this.onHostEvent("remove",e.bind("_defRemoveHash",this),n),this.onHostEvent("update",e.bind("_defUpdateHash",this),n)},destructor:function(e){},_setHashTable:function(e){var t=this.get("host"),n={},r=0,i=t.getLength();for(;r<i;r++)n[t._items[r].getValue(e)]=t._items[r];return n},_defAddHash:function(t){var n=this.get("hashTables");e.each(n,function(n,r){e.each(t.added||t.updated,function(e){e.getValue(r)&&(n[e.getValue(r)]=e)})})},_defRemoveHash:function(t){var n=this.get("hashTables"),r;e.each(n,function(n,i){e.each(t.removed||t.overwritten,function(e){r=e.getValue(i),r&&n[r]===e&&delete n[r]})})},_defUpdateHash:function(e){e.added=e.updated,e.removed=e.overwritten,this._defAddHash(e),this._defRemoveHash(e)},createTable:function(e){var t=this.get("hashTables");return t[e]=this._setHashTable(e),this.set("hashTables",t),t[e]},getTable:function(e){return this.get("hashTables")[e]}}),e.namespace("Plugin").RecordsetIndexer=n},"3.7.2",{requires:["recordset-base","plugin"]});+YUI.add("recordset-indexer",function(e,t){function n(e){n.superclass.constructor.apply(this,arguments)}e.mix(n,{NS:"indexer",NAME:"recordsetIndexer",ATTRS:{hashTables:{value:{}},keys:{value:{}}}}),e.extend(n,e.Plugin.Base,{initializer:function(t){var n=this.get("host");this.onHostEvent("add",e.bind("_defAddHash",this),n),this.onHostEvent("remove",e.bind("_defRemoveHash",this),n),this.onHostEvent("update",e.bind("_defUpdateHash",this),n)},destructor:function(e){},_setHashTable:function(e){var t=this.get("host"),n={},r=0,i=t.getLength();for(;r<i;r++)n[t._items[r].getValue(e)]=t._items[r];return n},_defAddHash:function(t){var n=this.get("hashTables");e.each(n,function(n,r){e.each(t.added||t.updated,function(e){e.getValue(r)&&(n[e.getValue(r)]=e)})})},_defRemoveHash:function(t){var n=this.get("hashTables"),r;e.each(n,function(n,i){e.each(t.removed||t.overwritten,function(e){r=e.getValue(i),r&&n[r]===e&&delete n[r]})})},_defUpdateHash:function(e){e.added=e.updated,e.removed=e.overwritten,this._defAddHash(e),this._defRemoveHash(e)},createTable:function(e){var t=this.get("hashTables");return t[e]=this._setHashTable(e),this.set("hashTables",t),t[e]},getTable:function(e){return this.get("hashTables")[e]}}),e.namespace("Plugin").RecordsetIndexer=n},"3.7.3",{requires:["recordset-base","plugin"]});
bundle/recordset-indexer/recordset-indexer.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -230,4 +230,4 @@ -}, '3.7.2', {"requires": ["recordset-base", "plugin"]});+}, '3.7.3', {"requires": ["recordset-base", "plugin"]});
bundle/recordset-sort/recordset-sort-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/recordset-sort/recordset-sort.js", code: [] };-_yuitest_coverage["build/recordset-sort/recordset-sort.js"].code=["YUI.add('recordset-sort', function (Y, NAME) {","","/**"," * Adds default and custom sorting functionality to the Recordset utility"," * @module recordset"," * @submodule recordset-sort"," */","","var Compare = Y.ArraySort.compare,","isValue = Y.Lang.isValue;","","/**"," * Plugin that adds default and custom sorting functionality to the Recordset utility"," * @class RecordsetSort"," */","","function RecordsetSort(field, desc, sorter) {"," RecordsetSort.superclass.constructor.apply(this, arguments);","}","","Y.mix(RecordsetSort, {"," NS: \"sort\",",""," NAME: \"recordsetSort\",",""," ATTRS: {",""," /**"," * @description The last properties used to sort. Consists of an object literal with the keys \"field\", \"desc\", and \"sorter\""," *"," * @attribute lastSortProperties"," * @public"," * @type object"," */"," lastSortProperties: {"," value: {"," field: undefined,"," desc: true,"," sorter: undefined"," },"," validator: function(v) {"," return (isValue(v.field) && isValue(v.desc) && isValue(v.sorter));"," }"," },",""," /**"," * @description Default sort function to use if none is specified by the user."," * Takes two records, the key to sort by, and whether sorting direction is descending or not (boolean)."," * If two records have the same value for a given key, the ID is used as the tie-breaker."," *"," * @attribute defaultSorter"," * @public"," * @type function"," */"," defaultSorter: {"," value: function(recA, recB, field, desc) {"," var sorted = Compare(recA.getValue(field), recB.getValue(field), desc);"," if (sorted === 0) {"," return Compare(recA.get(\"id\"), recB.get(\"id\"), desc);"," }"," else {"," return sorted;"," }"," }"," },",""," /**"," * @description A boolean telling if the recordset is in a sorted state."," *"," * @attribute defaultSorter"," * @public"," * @type function"," */"," isSorted: {"," value: false"," }"," }","});","","Y.extend(RecordsetSort, Y.Plugin.Base, {",""," /**"," * @description Sets up the default function to use when the \"sort\" event is fired."," *"," * @method initializer"," * @protected"," */"," initializer: function(config) {",""," var self = this,"," host = this.get('host');","",""," this.publish(\"sort\", {"," defaultFn: Y.bind(\"_defSortFn\", this)"," });",""," //Toggle the isSorted ATTR based on events."," //Remove events dont affect isSorted, as they are just popped/sliced out"," this.on(\"sort\","," function() {"," self.set('isSorted', true);"," });",""," this.onHostEvent('add',"," function() {"," self.set('isSorted', false);"," },"," host);"," this.onHostEvent('update',"," function() {"," self.set('isSorted', false);"," },"," host);",""," },",""," destructor: function(config) {"," },",""," /**"," * @description Method that all sort calls go through. "," * Sets up the lastSortProperties object with the details of the sort, and passes in parameters "," * to the \"defaultSorter\" or a custom specified sort function."," *"," * @method _defSortFn"," * @private"," */"," _defSortFn: function(e) {"," //have to work directly with _items here - changing the recordset."," this.get(\"host\")._items.sort(function(a, b) {"," return (e.sorter)(a, b, e.field, e.desc);"," });"," "," this.set('lastSortProperties', e);"," },",""," /**"," * @description Sorts the recordset."," *"," * @method sort"," * @param field {string} A key to sort by."," * @param desc {boolean} True if you want sort order to be descending, false if you want sort order to be ascending"," * @public"," */"," sort: function(field, desc, sorter) {"," this.fire(\"sort\", {"," field: field,"," desc: desc,"," sorter: sorter || this.get(\"defaultSorter\")"," });"," },",""," /**"," * @description Resorts the recordset based on the last-used sort parameters (stored in 'lastSortProperties' ATTR)"," *"," * @method resort"," * @public"," */"," resort: function() {"," var p = this.get('lastSortProperties');"," this.fire(\"sort\", {"," field: p.field,"," desc: p.desc,"," sorter: p.sorter || this.get(\"defaultSorter\")"," });"," },",""," /**"," * @description Reverses the recordset calling the standard array.reverse() method."," *"," * @method reverse"," * @public"," */"," reverse: function() {"," this.get('host')._items.reverse();"," },",""," /**"," * @description Sorts the recordset based on the last-used sort parameters, but flips the order. (ie: Descending becomes ascending, and vice versa)."," *"," * @method flip"," * @public"," */"," flip: function() {"," var p = this.get('lastSortProperties');",""," //If a predefined field is not provided by which to sort by, throw an error"," if (isValue(p.field)) {"," this.fire(\"sort\", {"," field: p.field,"," desc: !p.desc,"," sorter: p.sorter || this.get(\"defaultSorter\")"," });"," }"," else {"," }"," }","});","","Y.namespace(\"Plugin\").RecordsetSort = RecordsetSort;","","","","}, '3.7.2', {\"requires\": [\"arraysort\", \"recordset-base\", \"plugin\"]});"];+_yuitest_coverage["build/recordset-sort/recordset-sort.js"].code=["YUI.add('recordset-sort', function (Y, NAME) {","","/**"," * Adds default and custom sorting functionality to the Recordset utility"," * @module recordset"," * @submodule recordset-sort"," */","","var Compare = Y.ArraySort.compare,","isValue = Y.Lang.isValue;","","/**"," * Plugin that adds default and custom sorting functionality to the Recordset utility"," * @class RecordsetSort"," */","","function RecordsetSort(field, desc, sorter) {"," RecordsetSort.superclass.constructor.apply(this, arguments);","}","","Y.mix(RecordsetSort, {"," NS: \"sort\",",""," NAME: \"recordsetSort\",",""," ATTRS: {",""," /**"," * @description The last properties used to sort. Consists of an object literal with the keys \"field\", \"desc\", and \"sorter\""," *"," * @attribute lastSortProperties"," * @public"," * @type object"," */"," lastSortProperties: {"," value: {"," field: undefined,"," desc: true,"," sorter: undefined"," },"," validator: function(v) {"," return (isValue(v.field) && isValue(v.desc) && isValue(v.sorter));"," }"," },",""," /**"," * @description Default sort function to use if none is specified by the user."," * Takes two records, the key to sort by, and whether sorting direction is descending or not (boolean)."," * If two records have the same value for a given key, the ID is used as the tie-breaker."," *"," * @attribute defaultSorter"," * @public"," * @type function"," */"," defaultSorter: {"," value: function(recA, recB, field, desc) {"," var sorted = Compare(recA.getValue(field), recB.getValue(field), desc);"," if (sorted === 0) {"," return Compare(recA.get(\"id\"), recB.get(\"id\"), desc);"," }"," else {"," return sorted;"," }"," }"," },",""," /**"," * @description A boolean telling if the recordset is in a sorted state."," *"," * @attribute defaultSorter"," * @public"," * @type function"," */"," isSorted: {"," value: false"," }"," }","});","","Y.extend(RecordsetSort, Y.Plugin.Base, {",""," /**"," * @description Sets up the default function to use when the \"sort\" event is fired."," *"," * @method initializer"," * @protected"," */"," initializer: function(config) {",""," var self = this,"," host = this.get('host');","",""," this.publish(\"sort\", {"," defaultFn: Y.bind(\"_defSortFn\", this)"," });",""," //Toggle the isSorted ATTR based on events."," //Remove events dont affect isSorted, as they are just popped/sliced out"," this.on(\"sort\","," function() {"," self.set('isSorted', true);"," });",""," this.onHostEvent('add',"," function() {"," self.set('isSorted', false);"," },"," host);"," this.onHostEvent('update',"," function() {"," self.set('isSorted', false);"," },"," host);",""," },",""," destructor: function(config) {"," },",""," /**"," * @description Method that all sort calls go through. "," * Sets up the lastSortProperties object with the details of the sort, and passes in parameters "," * to the \"defaultSorter\" or a custom specified sort function."," *"," * @method _defSortFn"," * @private"," */"," _defSortFn: function(e) {"," //have to work directly with _items here - changing the recordset."," this.get(\"host\")._items.sort(function(a, b) {"," return (e.sorter)(a, b, e.field, e.desc);"," });"," "," this.set('lastSortProperties', e);"," },",""," /**"," * @description Sorts the recordset."," *"," * @method sort"," * @param field {string} A key to sort by."," * @param desc {boolean} True if you want sort order to be descending, false if you want sort order to be ascending"," * @public"," */"," sort: function(field, desc, sorter) {"," this.fire(\"sort\", {"," field: field,"," desc: desc,"," sorter: sorter || this.get(\"defaultSorter\")"," });"," },",""," /**"," * @description Resorts the recordset based on the last-used sort parameters (stored in 'lastSortProperties' ATTR)"," *"," * @method resort"," * @public"," */"," resort: function() {"," var p = this.get('lastSortProperties');"," this.fire(\"sort\", {"," field: p.field,"," desc: p.desc,"," sorter: p.sorter || this.get(\"defaultSorter\")"," });"," },",""," /**"," * @description Reverses the recordset calling the standard array.reverse() method."," *"," * @method reverse"," * @public"," */"," reverse: function() {"," this.get('host')._items.reverse();"," },",""," /**"," * @description Sorts the recordset based on the last-used sort parameters, but flips the order. (ie: Descending becomes ascending, and vice versa)."," *"," * @method flip"," * @public"," */"," flip: function() {"," var p = this.get('lastSortProperties');",""," //If a predefined field is not provided by which to sort by, throw an error"," if (isValue(p.field)) {"," this.fire(\"sort\", {"," field: p.field,"," desc: !p.desc,"," sorter: p.sorter || this.get(\"defaultSorter\")"," });"," }"," else {"," }"," }","});","","Y.namespace(\"Plugin\").RecordsetSort = RecordsetSort;","","","","}, '3.7.3', {\"requires\": [\"arraysort\", \"recordset-base\", \"plugin\"]});"]; _yuitest_coverage["build/recordset-sort/recordset-sort.js"].lines = {"1":0,"9":0,"17":0,"18":0,"21":0,"42":0,"57":0,"58":0,"59":0,"62":0,"80":0,"90":0,"94":0,"100":0,"102":0,"105":0,"107":0,"110":0,"112":0,"131":0,"132":0,"135":0,"147":0,"161":0,"162":0,"176":0,"186":0,"189":0,"190":0,"201":0}; _yuitest_coverage["build/recordset-sort/recordset-sort.js"].functions = {"RecordsetSort:17":0,"validator:41":0,"value:56":0,"(anonymous 2):101":0,"(anonymous 3):106":0,"(anonymous 4):111":0,"initializer:88":0,"(anonymous 5):131":0,"_defSortFn:129":0,"sort:146":0,"resort:160":0,"reverse:175":0,"flip:185":0,"(anonymous 1):1":0}; _yuitest_coverage["build/recordset-sort/recordset-sort.js"].coveredLines = 30;@@ -285,4 +285,4 @@ -}, '3.7.2', {"requires": ["arraysort", "recordset-base", "plugin"]});+}, '3.7.3', {"requires": ["arraysort", "recordset-base", "plugin"]});
bundle/recordset-sort/recordset-sort-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -209,4 +209,4 @@ -}, '3.7.2', {"requires": ["arraysort", "recordset-base", "plugin"]});+}, '3.7.3', {"requires": ["arraysort", "recordset-base", "plugin"]});
bundle/recordset-sort/recordset-sort-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("recordset-sort",function(e,t){function i(e,t,n){i.superclass.constructor.apply(this,arguments)}var n=e.ArraySort.compare,r=e.Lang.isValue;e.mix(i,{NS:"sort",NAME:"recordsetSort",ATTRS:{lastSortProperties:{value:{field:undefined,desc:!0,sorter:undefined},validator:function(e){return r(e.field)&&r(e.desc)&&r(e.sorter)}},defaultSorter:{value:function(e,t,r,i){var s=n(e.getValue(r),t.getValue(r),i);return s===0?n(e.get("id"),t.get("id"),i):s}},isSorted:{value:!1}}}),e.extend(i,e.Plugin.Base,{initializer:function(t){var n=this,r=this.get("host");this.publish("sort",{defaultFn:e.bind("_defSortFn",this)}),this.on("sort",function(){n.set("isSorted",!0)}),this.onHostEvent("add",function(){n.set("isSorted",!1)},r),this.onHostEvent("update",function(){n.set("isSorted",!1)},r)},destructor:function(e){},_defSortFn:function(e){this.get("host")._items.sort(function(t,n){return e.sorter(t,n,e.field,e.desc)}),this.set("lastSortProperties",e)},sort:function(e,t,n){this.fire("sort",{field:e,desc:t,sorter:n||this.get("defaultSorter")})},resort:function(){var e=this.get("lastSortProperties");this.fire("sort",{field:e.field,desc:e.desc,sorter:e.sorter||this.get("defaultSorter")})},reverse:function(){this.get("host")._items.reverse()},flip:function(){var e=this.get("lastSortProperties");r(e.field)&&this.fire("sort",{field:e.field,desc:!e.desc,sorter:e.sorter||this.get("defaultSorter")})}}),e.namespace("Plugin").RecordsetSort=i},"3.7.2",{requires:["arraysort","recordset-base","plugin"]});+YUI.add("recordset-sort",function(e,t){function i(e,t,n){i.superclass.constructor.apply(this,arguments)}var n=e.ArraySort.compare,r=e.Lang.isValue;e.mix(i,{NS:"sort",NAME:"recordsetSort",ATTRS:{lastSortProperties:{value:{field:undefined,desc:!0,sorter:undefined},validator:function(e){return r(e.field)&&r(e.desc)&&r(e.sorter)}},defaultSorter:{value:function(e,t,r,i){var s=n(e.getValue(r),t.getValue(r),i);return s===0?n(e.get("id"),t.get("id"),i):s}},isSorted:{value:!1}}}),e.extend(i,e.Plugin.Base,{initializer:function(t){var n=this,r=this.get("host");this.publish("sort",{defaultFn:e.bind("_defSortFn",this)}),this.on("sort",function(){n.set("isSorted",!0)}),this.onHostEvent("add",function(){n.set("isSorted",!1)},r),this.onHostEvent("update",function(){n.set("isSorted",!1)},r)},destructor:function(e){},_defSortFn:function(e){this.get("host")._items.sort(function(t,n){return e.sorter(t,n,e.field,e.desc)}),this.set("lastSortProperties",e)},sort:function(e,t,n){this.fire("sort",{field:e,desc:t,sorter:n||this.get("defaultSorter")})},resort:function(){var e=this.get("lastSortProperties");this.fire("sort",{field:e.field,desc:e.desc,sorter:e.sorter||this.get("defaultSorter")})},reverse:function(){this.get("host")._items.reverse()},flip:function(){var e=this.get("lastSortProperties");r(e.field)&&this.fire("sort",{field:e.field,desc:!e.desc,sorter:e.sorter||this.get("defaultSorter")})}}),e.namespace("Plugin").RecordsetSort=i},"3.7.3",{requires:["arraysort","recordset-base","plugin"]});
bundle/recordset-sort/recordset-sort.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -208,4 +208,4 @@ -}, '3.7.2', {"requires": ["arraysort", "recordset-base", "plugin"]});+}, '3.7.3', {"requires": ["arraysort", "recordset-base", "plugin"]});
bundle/resize-base/assets/resize-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-base/assets/skins/night/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-base/assets/skins/night/resize-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-base/assets/skins/sam/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-base/assets/skins/sam/resize-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-base/resize-base-coverage.js view
@@ -1,2007 +1,2008 @@ /*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-if (typeof _yuitest_coverage == "undefined"){- _yuitest_coverage = {};- _yuitest_coverline = function(src, line){- var coverage = _yuitest_coverage[src];- if (!coverage.lines[line]){- coverage.calledLines++;- }- coverage.lines[line]++;- };- _yuitest_coverfunc = function(src, name, line){- var coverage = _yuitest_coverage[src],- funcId = name + ":" + line;- if (!coverage.functions[funcId]){- coverage.calledFunctions++;- }- coverage.functions[funcId]++;- };-}-_yuitest_coverage["build/resize-base/resize-base.js"] = {- lines: {},- functions: {},- coveredLines: 0,- calledLines: 0,- coveredFunctions: 0,- calledFunctions: 0,- path: "build/resize-base/resize-base.js",- code: []-};-_yuitest_coverage["build/resize-base/resize-base.js"].code=["YUI.add('resize-base', function (Y, NAME) {","","/**"," * The Resize Utility allows you to make an HTML element resizable."," * @module resize"," * @main resize"," */","","var Lang = Y.Lang,"," isArray = Lang.isArray,"," isBoolean = Lang.isBoolean,"," isNumber = Lang.isNumber,"," isString = Lang.isString,",""," YArray = Y.Array,"," trim = Lang.trim,"," indexOf = YArray.indexOf,",""," COMMA = ',',"," DOT = '.',"," EMPTY_STR = '',"," HANDLE_SUB = '{handle}',"," SPACE = ' ',",""," ACTIVE = 'active',"," ACTIVE_HANDLE = 'activeHandle',"," ACTIVE_HANDLE_NODE = 'activeHandleNode',"," ALL = 'all',"," AUTO_HIDE = 'autoHide',"," BORDER = 'border',"," BOTTOM = 'bottom',"," CLASS_NAME = 'className',"," COLOR = 'color',"," DEF_MIN_HEIGHT = 'defMinHeight',"," DEF_MIN_WIDTH = 'defMinWidth',"," HANDLE = 'handle',"," HANDLES = 'handles',"," HANDLES_WRAPPER = 'handlesWrapper',"," HIDDEN = 'hidden',"," INNER = 'inner',"," LEFT = 'left',"," MARGIN = 'margin',"," NODE = 'node',"," NODE_NAME = 'nodeName',"," NONE = 'none',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," PADDING = 'padding',"," PARENT_NODE = 'parentNode',"," POSITION = 'position',"," RELATIVE = 'relative',"," RESIZE = 'resize',"," RESIZING = 'resizing',"," RIGHT = 'right',"," STATIC = 'static',"," STYLE = 'style',"," TOP = 'top',"," WIDTH = 'width',"," WRAP = 'wrap',"," WRAPPER = 'wrapper',"," WRAP_TYPES = 'wrapTypes',",""," EV_MOUSE_UP = 'resize:mouseUp',"," EV_RESIZE = 'resize:resize',"," EV_RESIZE_ALIGN = 'resize:align',"," EV_RESIZE_END = 'resize:end',"," EV_RESIZE_START = 'resize:start',",""," T = 't',"," TR = 'tr',"," R = 'r',"," BR = 'br',"," B = 'b',"," BL = 'bl',"," L = 'l',"," TL = 'tl',",""," concat = function() {"," return Array.prototype.slice.call(arguments).join(SPACE);"," },",""," // round the passed number to get rid of pixel-flickering"," toRoundNumber = function(num) {"," return Math.round(parseFloat(num)) || 0;"," },",""," getCompStyle = function(node, val) {"," return node.getComputedStyle(val);"," },",""," handleAttrName = function(handle) {"," return HANDLE + handle.toUpperCase();"," },",""," isNode = function(v) {"," return (v instanceof Y.Node);"," },",""," toInitialCap = Y.cached("," function(str) {"," return str.substring(0, 1).toUpperCase() + str.substring(1);"," }"," ),",""," capitalize = Y.cached(function() {"," var out = [],"," args = YArray(arguments, 0, true);",""," YArray.each(args, function(part, i) {"," if (i > 0) {"," part = toInitialCap(part);"," }"," out.push(part);"," });",""," return out.join(EMPTY_STR);"," }),",""," getCN = Y.ClassNameManager.getClassName,",""," CSS_RESIZE = getCN(RESIZE),"," CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),"," CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),"," CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),"," CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),"," CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),"," CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),"," CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),"," CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);","","/**","A base class for Resize, providing:",""," * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)"," * Applies drag handles to an element to make it resizable"," * Here is the list of valid resize handles:"," `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can"," read this list as top, top-right, right, bottom-right, bottom,"," bottom-left, left, top-left."," * The drag handles are inserted into the element and positioned"," absolute. Some elements, such as a textarea or image, don't support"," children. To overcome that, set wrap:true in your config and the"," element willbe wrapped for you automatically.","","Quick Example:",""," var instance = new Y.Resize({"," node: '#resize1',"," preserveRatio: true,"," wrap: true,"," maxHeight: 170,"," maxWidth: 400,"," handles: 't, tr, r, br, b, bl, l, tl'"," });","","Check the list of <a href=\"Resize.html#configattributes\">Configuration Attributes</a> available for","Resize.","","@class Resize","@param config {Object} Object literal specifying widget configuration properties.","@constructor","@extends Base","*/","","function Resize() {"," Resize.superclass.constructor.apply(this, arguments);","}","","Y.mix(Resize, {"," /**"," * Static property provides a string to identify the class."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME: RESIZE,",""," /**"," * Static property used to define the default attribute"," * configuration for the Resize."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," ATTRS: {"," /**"," * Stores the active handle during the resize."," *"," * @attribute activeHandle"," * @default null"," * @private"," * @type String"," */"," activeHandle: {"," value: null,"," validator: function(v) {"," return Y.Lang.isString(v) || Y.Lang.isNull(v);"," }"," },",""," /**"," * Stores the active handle element during the resize."," *"," * @attribute activeHandleNode"," * @default null"," * @private"," * @type Node"," */"," activeHandleNode: {"," value: null,"," validator: isNode"," },",""," /**"," * False to ensure that the resize handles are always visible, true to"," * display them only when the user mouses over the resizable borders."," *"," * @attribute autoHide"," * @default false"," * @type boolean"," */"," autoHide: {"," value: false,"," validator: isBoolean"," },",""," /**"," * The default minimum height of the element. Only used when"," * ResizeConstrained is not plugged."," *"," * @attribute defMinHeight"," * @default 15"," * @type Number"," */"," defMinHeight: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The default minimum width of the element. Only used when"," * ResizeConstrained is not plugged."," *"," * @attribute defMinWidth"," * @default 15"," * @type Number"," */"," defMinWidth: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',"," * 'br', 'tl', 'tr'. Can use a shortcut of All."," *"," * @attribute handles"," * @default all"," * @type Array | String"," */"," handles: {"," setter: '_setHandles',"," value: ALL"," },",""," /**"," * Node to wrap the resize handles."," *"," * @attribute handlesWrapper"," * @type Node"," */"," handlesWrapper: {"," readOnly: true,"," setter: Y.one,"," valueFn: '_valueHandlesWrapper'"," },",""," /**"," * The selector or element to resize. Required."," *"," * @attribute node"," * @type Node"," */"," node: {"," setter: Y.one"," },",""," /**"," * True when the element is being Resized."," *"," * @attribute resizing"," * @default false"," * @type boolean"," */"," resizing: {"," value: false,"," validator: isBoolean"," },",""," /**"," * True to wrap an element with a div if needed (required for textareas"," * and images, defaults to false) in favor of the handles config option."," * The wrapper element type (default div) could be over-riden passing the"," * <code>wrapper</code> attribute."," *"," * @attribute wrap"," * @default false"," * @type boolean"," */"," wrap: {"," setter: '_setWrap',"," value: false,"," validator: isBoolean"," },",""," /**"," * Elements that requires a wrapper by default. Normally are elements"," * which cannot have children elements."," *"," * @attribute wrapTypes"," * @default /canvas|textarea|input|select|button|img/i"," * @readOnly"," * @type Regex"," */"," wrapTypes: {"," readOnly: true,"," value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i"," },",""," /**"," * Element to wrap the <code>wrapTypes</code>. This element will house"," * the handles elements."," *"," * @attribute wrapper"," * @default div"," * @type String | Node"," * @writeOnce"," */"," wrapper: {"," readOnly: true,"," valueFn: '_valueWrapper',"," writeOnce: true"," }"," },",""," RULES: {"," b: function(instance, dx, dy) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.offsetHeight = originalInfo.offsetHeight + dy;"," },",""," l: function(instance, dx, dy) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.left = originalInfo.left + dx;"," info.offsetWidth = originalInfo.offsetWidth - dx;"," },",""," r: function(instance, dx, dy) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.offsetWidth = originalInfo.offsetWidth + dx;"," },",""," t: function(instance, dx, dy) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.top = originalInfo.top + dy;"," info.offsetHeight = originalInfo.offsetHeight - dy;"," },",""," tr: function(instance, dx, dy) {"," this.t.apply(this, arguments);"," this.r.apply(this, arguments);"," },",""," bl: function(instance, dx, dy) {"," this.b.apply(this, arguments);"," this.l.apply(this, arguments);"," },",""," br: function(instance, dx, dy) {"," this.b.apply(this, arguments);"," this.r.apply(this, arguments);"," },",""," tl: function(instance, dx, dy) {"," this.t.apply(this, arguments);"," this.l.apply(this, arguments);"," }"," },",""," capitalize: capitalize","});","","Y.Resize = Y.extend("," Resize,"," Y.Base,"," {"," /**"," * Array containing all possible resizable handles."," *"," * @property ALL_HANDLES"," * @type {String}"," */"," ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],",""," /**"," * Regex which matches with the handles that could change the height of"," * the resizable element."," *"," * @property REGEX_CHANGE_HEIGHT"," * @type {String}"," */"," REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,",""," /**"," * Regex which matches with the handles that could change the left of"," * the resizable element."," *"," * @property REGEX_CHANGE_LEFT"," * @type {String}"," */"," REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,",""," /**"," * Regex which matches with the handles that could change the top of"," * the resizable element."," *"," * @property REGEX_CHANGE_TOP"," * @type {String}"," */"," REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,",""," /**"," * Regex which matches with the handles that could change the width of"," * the resizable element."," *"," * @property REGEX_CHANGE_WIDTH"," * @type {String}"," */"," REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,",""," /**"," * Template used to create the resize wrapper for the handles."," *"," * @property HANDLES_WRAP_TEMPLATE"," * @type {String}"," */"," HANDLES_WRAP_TEMPLATE: '<div class=\"'+CSS_RESIZE_HANDLES_WRAPPER+'\"></div>',",""," /**"," * Template used to create the resize wrapper node when needed."," *"," * @property WRAP_TEMPLATE"," * @type {String}"," */"," WRAP_TEMPLATE: '<div class=\"'+CSS_RESIZE_WRAPPER+'\"></div>',",""," /**"," * Template used to create each resize handle."," *"," * @property HANDLE_TEMPLATE"," * @type {String}"," */"," HANDLE_TEMPLATE: '<div class=\"'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'\">' +"," '<div class=\"'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'\"> </div>' +"," '</div>',","",""," /**"," * Each box has a content area and optional surrounding padding and"," * border areas. This property stores the sum of all horizontal"," * surrounding * information needed to adjust the node height."," *"," * @property totalHSurrounding"," * @default 0"," * @type number"," */"," totalHSurrounding: 0,",""," /**"," * Each box has a content area and optional surrounding padding and"," * border areas. This property stores the sum of all vertical"," * surrounding * information needed to adjust the node height."," *"," * @property totalVSurrounding"," * @default 0"," * @type number"," */"," totalVSurrounding: 0,",""," /**"," * Stores the <a href=\"Resize.html#attr_node\">node</a>"," * surrounding information retrieved from"," * <a href=\"Resize.html#method__getBoxSurroundingInfo\">_getBoxSurroundingInfo</a>."," *"," * @property nodeSurrounding"," * @type Object"," * @default null"," */"," nodeSurrounding: null,",""," /**"," * Stores the <a href=\"Resize.html#attr_wrapper\">wrapper</a>"," * surrounding information retrieved from"," * <a href=\"Resize.html#method__getBoxSurroundingInfo\">_getBoxSurroundingInfo</a>."," *"," * @property wrapperSurrounding"," * @type Object"," * @default null"," */"," wrapperSurrounding: null,",""," /**"," * Whether the handle being dragged can change the height."," *"," * @property changeHeightHandles"," * @default false"," * @type boolean"," */"," changeHeightHandles: false,",""," /**"," * Whether the handle being dragged can change the left."," *"," * @property changeLeftHandles"," * @default false"," * @type boolean"," */"," changeLeftHandles: false,",""," /**"," * Whether the handle being dragged can change the top."," *"," * @property changeTopHandles"," * @default false"," * @type boolean"," */"," changeTopHandles: false,",""," /**"," * Whether the handle being dragged can change the width."," *"," * @property changeWidthHandles"," * @default false"," * @type boolean"," */"," changeWidthHandles: false,",""," /**"," * Store DD.Delegate reference for the respective Resize instance."," *"," * @property delegate"," * @default null"," * @type Object"," */"," delegate: null,",""," /**"," * Stores the current values for the height, width, top and left. You are"," * able to manipulate these values on resize in order to change the resize"," * behavior."," *"," * @property info"," * @type Object"," * @protected"," */"," info: null,",""," /**"," * Stores the last values for the height, width, top and left."," *"," * @property lastInfo"," * @type Object"," * @protected"," */"," lastInfo: null,",""," /**"," * Stores the original values for the height, width, top and left, stored"," * on resize start."," *"," * @property originalInfo"," * @type Object"," * @protected"," */"," originalInfo: null,",""," /**"," * Construction logic executed during Resize instantiation. Lifecycle."," *"," * @method initializer"," * @protected"," */"," initializer: function() {"," this._eventHandles = [];",""," this.renderer();"," },",""," /**"," * Create the DOM structure for the Resize. Lifecycle."," *"," * @method renderUI"," * @protected"," */"," renderUI: function() {"," var instance = this;",""," instance._renderHandles();"," },",""," /**"," * Bind the events on the Resize UI. Lifecycle."," *"," * @method bindUI"," * @protected"," */"," bindUI: function() {"," var instance = this;",""," instance._createEvents();"," instance._bindDD();"," instance._bindHandle();"," },",""," /**"," * Sync the Resize UI."," *"," * @method syncUI"," * @protected"," */"," syncUI: function() {"," var instance = this;",""," this.get(NODE).addClass(CSS_RESIZE);",""," // hide handles if AUTO_HIDE is true"," instance._setHideHandlesUI("," instance.get(AUTO_HIDE)"," );"," },",""," /**"," * Destructor lifecycle implementation for the Resize class."," * Detaches all previously attached listeners and removes the Resize handles."," *"," * @method destructor"," * @protected"," */"," destructor: function() {"," var instance = this,"," node = instance.get(NODE),"," wrapper = instance.get(WRAPPER),"," pNode = wrapper.get(PARENT_NODE);",""," Y.each("," instance._eventHandles,"," function(handle, index) {"," handle.detach();"," }"," );",""," instance._eventHandles.length = 0;",""," // destroy handles dd and remove them from the dom"," instance.eachHandle(function(handleEl) {"," instance.delegate.dd.destroy();",""," // remove handle"," handleEl.remove(true);"," });",""," instance.delegate.destroy();",""," // unwrap node"," if (instance.get(WRAP)) {"," instance._copyStyles(wrapper, node);",""," if (pNode) {"," pNode.insertBefore(node, wrapper);"," }",""," wrapper.remove(true);"," }",""," node.removeClass(CSS_RESIZE);"," node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);"," },",""," /**"," * Creates DOM (or manipulates DOM for progressive enhancement)"," * This method is invoked by initializer(). It's chained automatically for"," * subclasses if required."," *"," * @method renderer"," * @protected"," */"," renderer: function() {"," this.renderUI();"," this.bindUI();"," this.syncUI();"," },",""," /**"," * <p>Loop through each handle which is being used and executes a callback.</p>"," * <p>Example:</p>"," * <pre><code>instance.eachHandle("," * function(handleName, index) { ... }"," * );</code></pre>"," *"," * @method eachHandle"," * @param {function} fn Callback function to be executed for each handle."," */"," eachHandle: function(fn) {"," var instance = this;",""," Y.each("," instance.get(HANDLES),"," function(handle, i) {"," var handleEl = instance.get("," handleAttrName(handle)"," );",""," fn.apply(instance, [handleEl, handle, i]);"," }"," );"," },",""," /**"," * Bind the handles DragDrop events to the Resize instance."," *"," * @method _bindDD"," * @private"," */"," _bindDD: function() {"," var instance = this;",""," instance.delegate = new Y.DD.Delegate("," {"," bubbleTargets: instance,"," container: instance.get(HANDLES_WRAPPER),"," dragConfig: {"," clickPixelThresh: 0,"," clickTimeThresh: 0,"," useShim: true,"," move: false"," },"," nodes: DOT+CSS_RESIZE_HANDLE,"," target: false"," }"," );",""," instance._eventHandles.push("," instance.on('drag:drag', instance._handleResizeEvent),"," instance.on('drag:dropmiss', instance._handleMouseUpEvent),"," instance.on('drag:end', instance._handleResizeEndEvent),"," instance.on('drag:start', instance._handleResizeStartEvent)"," );"," },",""," /**"," * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave)."," *"," * @method _bindHandle"," * @private"," */"," _bindHandle: function() {"," var instance = this,"," wrapper = instance.get(WRAPPER);",""," instance._eventHandles.push("," wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),"," wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),"," wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),"," wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)"," );"," },",""," /**"," * Create the custom events used on the Resize."," *"," * @method _createEvents"," * @private"," */"," _createEvents: function() {"," var instance = this,"," // create publish function for kweight optimization"," publish = function(name, fn) {"," instance.publish(name, {"," defaultFn: fn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: RESIZE"," });"," };",""," /**"," * Handles the resize start event. Fired when a handle starts to be"," * dragged."," *"," * @event resize:start"," * @preventable _defResizeStartFn"," * @param {Event.Facade} event The resize start event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE_START, this._defResizeStartFn);",""," /**"," * Handles the resize event. Fired on each pixel when the handle is"," * being dragged."," *"," * @event resize:resize"," * @preventable _defResizeFn"," * @param {Event.Facade} event The resize event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE, this._defResizeFn);",""," /**"," * Handles the resize align event."," *"," * @event resize:align"," * @preventable _defResizeAlignFn"," * @param {Event.Facade} event The resize align event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);",""," /**"," * Handles the resize end event. Fired when a handle stop to be"," * dragged."," *"," * @event resize:end"," * @preventable _defResizeEndFn"," * @param {Event.Facade} event The resize end event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE_END, this._defResizeEndFn);",""," /**"," * Handles the resize mouseUp event. Fired when a mouseUp event happens on a"," * handle."," *"," * @event resize:mouseUp"," * @preventable _defMouseUpFn"," * @param {Event.Facade} event The resize mouseUp event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_MOUSE_UP, this._defMouseUpFn);"," },",""," /**"," * Responsible for loop each handle element and append to the wrapper."," *"," * @method _renderHandles"," * @protected"," */"," _renderHandles: function() {"," var instance = this,"," wrapper = instance.get(WRAPPER),"," handlesWrapper = instance.get(HANDLES_WRAPPER);",""," instance.eachHandle(function(handleEl) {"," handlesWrapper.append(handleEl);"," });",""," wrapper.append(handlesWrapper);"," },",""," /**"," * Creates the handle element based on the handle name and initialize the"," * DragDrop on it."," *"," * @method _buildHandle"," * @param {String} handle Handle name ('t', 'tr', 'b', ...)."," * @protected"," */"," _buildHandle: function(handle) {"," var instance = this;",""," return Y.Node.create("," Y.Lang.sub(instance.HANDLE_TEMPLATE, {"," handle: handle"," })"," );"," },",""," /**"," * Basic resize calculations."," *"," * @method _calcResize"," * @protected"," */"," _calcResize: function() {"," var instance = this,"," handle = instance.handle,"," info = instance.info,"," originalInfo = instance.originalInfo,",""," dx = info.actXY[0] - originalInfo.actXY[0],"," dy = info.actXY[1] - originalInfo.actXY[1];",""," if (handle && Y.Resize.RULES[handle]) {"," Y.Resize.RULES[handle](instance, dx, dy);"," }"," else {"," }"," },",""," /**"," * Helper method to update the current size value on"," * <a href=\"Resize.html#property_info\">info</a> to respect the"," * min/max values and fix the top/left calculations."," *"," * @method _checkSize"," * @param {String} offset 'offsetHeight' or 'offsetWidth'"," * @param {number} size Size to restrict the offset"," * @protected"," */"," _checkSize: function(offset, size) {"," var instance = this,"," info = instance.info,"," originalInfo = instance.originalInfo,"," axis = (offset == OFFSET_HEIGHT) ? TOP : LEFT;",""," // forcing the offsetHeight/offsetWidth to be the passed size"," info[offset] = size;",""," // predicting, based on the original information, the last left valid in case of reach the min/max dimension"," // this calculation avoid browser event leaks when user interact very fast"," if (((axis == LEFT) && instance.changeLeftHandles) ||"," ((axis == TOP) && instance.changeTopHandles)) {",""," info[axis] = originalInfo[axis] + originalInfo[offset] - size;"," }"," },",""," /**"," * Copy relevant styles of the <a href=\"Resize.html#attr_node\">node</a>"," * to the <a href=\"Resize.html#attr_wrapper\">wrapper</a>."," *"," * @method _copyStyles"," * @param {Node} node Node from."," * @param {Node} wrapper Node to."," * @protected"," */"," _copyStyles: function(node, wrapper) {"," var position = node.getStyle(POSITION).toLowerCase(),"," surrounding = this._getBoxSurroundingInfo(node),"," wrapperStyle;",""," // resizable wrapper should be positioned"," if (position == STATIC) {"," position = RELATIVE;"," }",""," wrapperStyle = {"," position: position,"," left: getCompStyle(node, LEFT),"," top: getCompStyle(node, TOP)"," };",""," Y.mix(wrapperStyle, surrounding.margin);"," Y.mix(wrapperStyle, surrounding.border);",""," wrapper.setStyles(wrapperStyle);",""," // remove margin and border from the internal node"," node.setStyles({ border: 0, margin: 0 });",""," wrapper.sizeTo("," node.get(OFFSET_WIDTH) + surrounding.totalHBorder,"," node.get(OFFSET_HEIGHT) + surrounding.totalVBorder"," );"," },",""," // extract handle name from a string"," // using Y.cached to memoize the function for performance"," _extractHandleName: Y.cached("," function(node) {"," var className = node.get(CLASS_NAME),",""," match = className.match("," new RegExp("," getCN(RESIZE, HANDLE, '(\\\\w{1,2})\\\\b')"," )"," );",""," return match ? match[1] : null;"," }"," ),",""," /**"," * <p>Generates metadata to the <a href=\"Resize.html#property_info\">info</a>"," * and <a href=\"Resize.html#property_originalInfo\">originalInfo</a></p>"," * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>"," *"," * @method _getInfo"," * @param {Node} node"," * @param {EventFacade} event"," * @private"," */"," _getInfo: function(node, event) {"," var actXY = [0,0],"," drag = event.dragEvent.target,"," nodeXY = node.getXY(),"," nodeX = nodeXY[0],"," nodeY = nodeXY[1],"," offsetHeight = node.get(OFFSET_HEIGHT),"," offsetWidth = node.get(OFFSET_WIDTH);",""," if (event) {"," // the xy that the node will be set to. Changing this will alter the position as it's dragged."," actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);"," }",""," return {"," actXY: actXY,"," bottom: (nodeY + offsetHeight),"," left: nodeX,"," offsetHeight: offsetHeight,"," offsetWidth: offsetWidth,"," right: (nodeX + offsetWidth),"," top: nodeY"," };"," },",""," /**"," * Each box has a content area and optional surrounding margin,"," * padding and * border areas. This method get all this information from"," * the passed node. For more reference see"," * <a href=\"http://www.w3.org/TR/CSS21/box.html#box-dimensions\">"," * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>."," *"," * @method _getBoxSurroundingInfo"," * @param {Node} node"," * @private"," * @return {Object}"," */"," _getBoxSurroundingInfo: function(node) {"," var info = {"," padding: {},"," margin: {},"," border: {}"," };",""," if (isNode(node)) {"," Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {"," var paddingProperty = capitalize(PADDING, dir),"," marginProperty = capitalize(MARGIN, dir),"," borderWidthProperty = capitalize(BORDER, dir, WIDTH),"," borderColorProperty = capitalize(BORDER, dir, COLOR),"," borderStyleProperty = capitalize(BORDER, dir, STYLE);",""," info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);"," info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);"," info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);"," info.margin[marginProperty] = getCompStyle(node, marginProperty);"," info.padding[paddingProperty] = getCompStyle(node, paddingProperty);"," });"," }",""," info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));"," info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));"," info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));"," info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));",""," return info;"," },",""," /**"," * Sync the Resize UI with internal values from"," * <a href=\"Resize.html#property_info\">info</a>."," *"," * @method _syncUI"," * @protected"," */"," _syncUI: function() {"," var instance = this,"," info = instance.info,"," wrapperSurrounding = instance.wrapperSurrounding,"," wrapper = instance.get(WRAPPER),"," node = instance.get(NODE);",""," wrapper.sizeTo(info.offsetWidth, info.offsetHeight);",""," if (instance.changeLeftHandles || instance.changeTopHandles) {"," wrapper.setXY([info.left, info.top]);"," }",""," // if a wrap node is being used"," if (!wrapper.compareTo(node)) {"," // the original internal node borders were copied to the wrapper on _copyStyles, to compensate that subtract the borders from the internal node"," node.sizeTo("," info.offsetWidth - wrapperSurrounding.totalHBorder,"," info.offsetHeight - wrapperSurrounding.totalVBorder"," );"," }",""," // prevent webkit textarea resize"," if (Y.UA.webkit) {"," node.setStyle(RESIZE, NONE);"," }"," },",""," /**"," * Update <code>instance.changeHeightHandles,"," * instance.changeLeftHandles, instance.changeTopHandles,"," * instance.changeWidthHandles</code> information."," *"," * @method _updateChangeHandleInfo"," * @private"," */"," _updateChangeHandleInfo: function(handle) {"," var instance = this;",""," instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);"," instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);"," instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);"," instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);"," },",""," /**"," * Update <a href=\"Resize.html#property_info\">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right)."," *"," * @method _updateInfo"," * @private"," */"," _updateInfo: function(event) {"," var instance = this;",""," instance.info = instance._getInfo(instance.get(WRAPPER), event);"," },",""," /**"," * Update properties"," * <a href=\"Resize.html#property_nodeSurrounding\">nodeSurrounding</a>,"," * <a href=\"Resize.html#property_nodeSurrounding\">wrapperSurrounding</a>,"," * <a href=\"Resize.html#property_nodeSurrounding\">totalVSurrounding</a>,"," * <a href=\"Resize.html#property_nodeSurrounding\">totalHSurrounding</a>."," *"," * @method _updateSurroundingInfo"," * @private"," */"," _updateSurroundingInfo: function() {"," var instance = this,"," node = instance.get(NODE),"," wrapper = instance.get(WRAPPER),"," nodeSurrounding = instance._getBoxSurroundingInfo(node),"," wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);",""," instance.nodeSurrounding = nodeSurrounding;"," instance.wrapperSurrounding = wrapperSurrounding;",""," instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);"," instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);"," },",""," /**"," * Set the active state of the handles."," *"," * @method _setActiveHandlesUI"," * @param {boolean} val True to activate the handles, false to deactivate."," * @protected"," */"," _setActiveHandlesUI: function(val) {"," var instance = this,"," activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);",""," if (activeHandleNode) {"," if (val) {"," // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active"," instance.eachHandle("," function(handleEl) {"," handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);"," }"," );",""," activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);"," }"," else {"," activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);"," }"," }"," },",""," /**"," * Setter for the handles attribute"," *"," * @method _setHandles"," * @protected"," * @param {String} val"," */"," _setHandles: function(val) {"," var instance = this,"," handles = [];",""," // handles attr accepts both array or string"," if (isArray(val)) {"," handles = val;"," }"," else if (isString(val)) {"," // if the handles attr passed in is an ALL string..."," if (val.toLowerCase() == ALL) {"," handles = instance.ALL_HANDLES;"," }"," // otherwise, split the string to extract the handles"," else {"," Y.each("," val.split(COMMA),"," function(node, i) {"," var handle = trim(node);",""," // if its a valid handle, add it to the handles output"," if (indexOf(instance.ALL_HANDLES, handle) > -1) {"," handles.push(handle);"," }"," }"," );"," }"," }",""," return handles;"," },",""," /**"," * Set the visibility of the handles."," *"," * @method _setHideHandlesUI"," * @param {boolean} val True to hide the handles, false to show."," * @protected"," */"," _setHideHandlesUI: function(val) {"," var instance = this,"," wrapper = instance.get(WRAPPER);",""," if (!instance.get(RESIZING)) {"," if (val) {"," wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);"," }"," else {"," wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);"," }"," }"," },",""," /**"," * Setter for the wrap attribute"," *"," * @method _setWrap"," * @protected"," * @param {boolean} val"," */"," _setWrap: function(val) {"," var instance = this,"," node = instance.get(NODE),"," nodeName = node.get(NODE_NAME),"," typeRegex = instance.get(WRAP_TYPES);",""," // if nodeName is listed on WRAP_TYPES force use the wrapper"," if (typeRegex.test(nodeName)) {"," val = true;"," }",""," return val;"," },",""," /**"," * Default resize:mouseUp handler"," *"," * @method _defMouseUpFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defMouseUpFn: function(event) {"," var instance = this;",""," instance.set(RESIZING, false);"," },",""," /**"," * Default resize:resize handler"," *"," * @method _defResizeFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeFn: function(event) {"," var instance = this;",""," instance._resize(event);"," },",""," /**"," * Logic method for _defResizeFn. Allow AOP."," *"," * @method _resize"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resize: function(event) {"," var instance = this;",""," instance._handleResizeAlignEvent(event.dragEvent);",""," // _syncUI of the wrapper, not using proxy"," instance._syncUI();"," },",""," /**"," * Default resize:align handler"," *"," * @method _defResizeAlignFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeAlignFn: function(event) {"," var instance = this;",""," instance._resizeAlign(event);"," },",""," /**"," * Logic method for _defResizeAlignFn. Allow AOP."," *"," * @method _resizeAlign"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resizeAlign: function(event) {"," var instance = this,"," info,"," defMinHeight,"," defMinWidth;",""," instance.lastInfo = instance.info;",""," // update the instance.info values"," instance._updateInfo(event);",""," info = instance.info;",""," // basic resize calculations"," instance._calcResize();",""," // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension"," if (!instance.con) {"," defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);"," defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);",""," if (info.offsetHeight <= defMinHeight) {"," instance._checkSize(OFFSET_HEIGHT, defMinHeight);"," }",""," if (info.offsetWidth <= defMinWidth) {"," instance._checkSize(OFFSET_WIDTH, defMinWidth);"," }"," }"," },",""," /**"," * Default resize:end handler"," *"," * @method _defResizeEndFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeEndFn: function(event) {"," var instance = this;",""," instance._resizeEnd(event);"," },",""," /**"," * Logic method for _defResizeEndFn. Allow AOP."," *"," * @method _resizeEnd"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resizeEnd: function(event) {"," var instance = this,"," drag = event.dragEvent.target;",""," // reseting actXY from drag when drag end"," drag.actXY = [];",""," // syncUI when resize end"," instance._syncUI();",""," instance._setActiveHandlesUI(false);",""," instance.set(ACTIVE_HANDLE, null);"," instance.set(ACTIVE_HANDLE_NODE, null);",""," instance.handle = null;"," },",""," /**"," * Default resize:start handler"," *"," * @method _defResizeStartFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeStartFn: function(event) {"," var instance = this;",""," instance._resizeStart(event);"," },",""," /**"," * Logic method for _defResizeStartFn. Allow AOP."," *"," * @method _resizeStart"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resizeStart: function(event) {"," var instance = this,"," wrapper = instance.get(WRAPPER);",""," instance.handle = instance.get(ACTIVE_HANDLE);",""," instance.set(RESIZING, true);",""," instance._updateSurroundingInfo();",""," // create an originalInfo information for reference"," instance.originalInfo = instance._getInfo(wrapper, event);",""," instance._updateInfo(event);"," },",""," /**"," * Fires the resize:mouseUp event."," *"," * @method _handleMouseUpEvent"," * @param {EventFacade} event resize:mouseUp event facade"," * @protected"," */"," _handleMouseUpEvent: function(event) {"," this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:resize event."," *"," * @method _handleResizeEvent"," * @param {EventFacade} event resize:resize event facade"," * @protected"," */"," _handleResizeEvent: function(event) {"," this.fire(EV_RESIZE, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:align event."," *"," * @method _handleResizeAlignEvent"," * @param {EventFacade} event resize:resize event facade"," * @protected"," */"," _handleResizeAlignEvent: function(event) {"," this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:end event."," *"," * @method _handleResizeEndEvent"," * @param {EventFacade} event resize:end event facade"," * @protected"," */"," _handleResizeEndEvent: function(event) {"," this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:start event."," *"," * @method _handleResizeStartEvent"," * @param {EventFacade} event resize:start event facade"," * @protected"," */"," _handleResizeStartEvent: function(event) {"," if (!this.get(ACTIVE_HANDLE)) {"," //This handles the \"touch\" case"," this._setHandleFromNode(event.target.get('node'));"," }"," this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });"," },",""," /**"," * Mouseenter event handler for the <a href=\"Resize.html#attr_wrapper\">wrapper</a>."," *"," * @method _onWrapperMouseEnter"," * @param {EventFacade} event"," * @protected"," */"," _onWrapperMouseEnter: function(event) {"," var instance = this;",""," if (instance.get(AUTO_HIDE)) {"," instance._setHideHandlesUI(false);"," }"," },",""," /**"," * Mouseleave event handler for the <a href=\"Resize.html#attr_wrapper\">wrapper</a>."," *"," * @method _onWrapperMouseLeave"," * @param {EventFacade} event"," * @protected"," */"," _onWrapperMouseLeave: function(event) {"," var instance = this;",""," if (instance.get(AUTO_HIDE)) {"," instance._setHideHandlesUI(true);"," }"," },",""," /**"," * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse)."," *"," * @method _setHandleFromNode"," * @param {Node} node"," * @protected"," */"," _setHandleFromNode: function(node) {"," var instance = this,"," handle = instance._extractHandleName(node);",""," if (!instance.get(RESIZING)) {"," instance.set(ACTIVE_HANDLE, handle);"," instance.set(ACTIVE_HANDLE_NODE, node);",""," instance._setActiveHandlesUI(true);"," instance._updateChangeHandleInfo(handle);"," }"," },",""," /**"," * Mouseenter event handler for the handles."," *"," * @method _onHandleMouseEnter"," * @param {EventFacade} event"," * @protected"," */"," _onHandleMouseEnter: function(event) {"," this._setHandleFromNode(event.currentTarget);"," },",""," /**"," * Mouseout event handler for the handles."," *"," * @method _onHandleMouseLeave"," * @param {EventFacade} event"," * @protected"," */"," _onHandleMouseLeave: function(event) {"," var instance = this;",""," if (!instance.get(RESIZING)) {"," instance._setActiveHandlesUI(false);"," }"," },",""," /**"," * Default value for the wrapper handles node attribute"," *"," * @method _valueHandlesWrapper"," * @protected"," * @readOnly"," */"," _valueHandlesWrapper: function() {"," return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);"," },",""," /**"," * Default value for the wrapper attribute"," *"," * @method _valueWrapper"," * @protected"," * @readOnly"," */"," _valueWrapper: function() {"," var instance = this,"," node = instance.get(NODE),"," pNode = node.get(PARENT_NODE),"," // by deafult the wrapper is always the node"," wrapper = node;",""," // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper"," if (instance.get(WRAP)) {"," wrapper = Y.Node.create(instance.WRAP_TEMPLATE);",""," if (pNode) {"," pNode.insertBefore(wrapper, node);"," }",""," wrapper.append(node);",""," instance._copyStyles(node, wrapper);",""," // remove positioning of wrapped node, the WRAPPER take care about positioning"," node.setStyles({"," position: STATIC,"," left: 0,"," top: 0"," });"," }",""," return wrapper;"," }"," }",");","","Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle, i) {"," // creating ATTRS with the handles elements"," Y.Resize.ATTRS[handleAttrName(handle)] = {"," setter: function() {"," return this._buildHandle(handle);"," },"," value: null,"," writeOnce: true"," };","});","","","}, '3.7.2', {\"requires\": [\"base\", \"widget\", \"event\", \"oop\", \"dd-drag\", \"dd-delegate\", \"dd-drop\"], \"skinnable\": true});"];-_yuitest_coverage["build/resize-base/resize-base.js"].lines = {"1":0,"9":0,"79":0,"84":0,"88":0,"92":0,"96":0,"101":0,"106":0,"109":0,"110":0,"111":0,"113":0,"116":0,"165":0,"166":0,"169":0,"199":0,"350":0,"353":0,"357":0,"360":0,"361":0,"365":0,"368":0,"372":0,"375":0,"376":0,"380":0,"381":0,"385":0,"386":0,"390":0,"391":0,"395":0,"396":0,"403":0,"604":0,"606":0,"616":0,"618":0,"628":0,"630":0,"631":0,"632":0,"642":0,"644":0,"647":0,"660":0,"665":0,"668":0,"672":0,"675":0,"676":0,"679":0,"682":0,"685":0,"686":0,"688":0,"689":0,"692":0,"695":0,"696":0,"708":0,"709":0,"710":0,"724":0,"726":0,"729":0,"733":0,"745":0,"747":0,"762":0,"777":0,"780":0,"795":0,"798":0,"817":0,"829":0,"840":0,"852":0,"864":0,"874":0,"878":0,"879":0,"882":0,"894":0,"896":0,"910":0,"918":0,"919":0,"936":0,"942":0,"946":0,"949":0,"963":0,"968":0,"969":0,"972":0,"978":0,"979":0,"981":0,"984":0,"986":0,"996":0,"1004":0,"1019":0,"1027":0,"1029":0,"1032":0,"1056":0,"1062":0,"1063":0,"1064":0,"1070":0,"1071":0,"1072":0,"1073":0,"1074":0,"1078":0,"1079":0,"1080":0,"1081":0,"1083":0,"1094":0,"1100":0,"1102":0,"1103":0,"1107":0,"1109":0,"1116":0,"1117":0,"1130":0,"1132":0,"1133":0,"1134":0,"1135":0,"1145":0,"1147":0,"1161":0,"1167":0,"1168":0,"1170":0,"1171":0,"1182":0,"1185":0,"1186":0,"1188":0,"1190":0,"1194":0,"1197":0,"1210":0,"1214":0,"1215":0,"1217":0,"1219":0,"1220":0,"1224":0,"1227":0,"1230":0,"1231":0,"1238":0,"1249":0,"1252":0,"1253":0,"1254":0,"1257":0,"1270":0,"1276":0,"1277":0,"1280":0,"1291":0,"1293":0,"1304":0,"1306":0,"1317":0,"1319":0,"1322":0,"1333":0,"1335":0,"1346":0,"1351":0,"1354":0,"1356":0,"1359":0,"1362":0,"1363":0,"1364":0,"1366":0,"1367":0,"1370":0,"1371":0,"1384":0,"1386":0,"1397":0,"1401":0,"1404":0,"1406":0,"1408":0,"1409":0,"1411":0,"1422":0,"1424":0,"1435":0,"1438":0,"1440":0,"1442":0,"1445":0,"1447":0,"1458":0,"1469":0,"1480":0,"1491":0,"1502":0,"1504":0,"1506":0,"1517":0,"1519":0,"1520":0,"1532":0,"1534":0,"1535":0,"1547":0,"1550":0,"1551":0,"1552":0,"1554":0,"1555":0,"1567":0,"1578":0,"1580":0,"1581":0,"1593":0,"1604":0,"1611":0,"1612":0,"1614":0,"1615":0,"1618":0,"1620":0,"1623":0,"1630":0,"1635":0,"1637":0,"1639":0};-_yuitest_coverage["build/resize-base/resize-base.js"].functions = {"concat:78":0,"toRoundNumber:83":0,"getCompStyle:87":0,"handleAttrName:91":0,"isNode:95":0,"(anonymous 2):100":0,"(anonymous 4):109":0,"(anonymous 3):105":0,"Resize:165":0,"validator:198":0,"b:349":0,"l:356":0,"r:364":0,"t:371":0,"tr:379":0,"bl:384":0,"br:389":0,"tl:394":0,"initializer:603":0,"renderUI:615":0,"bindUI:627":0,"syncUI:641":0,"(anonymous 5):667":0,"(anonymous 6):675":0,"destructor:659":0,"renderer:707":0,"(anonymous 7):728":0,"eachHandle:723":0,"_bindDD:744":0,"_bindHandle:776":0,"publish:797":0,"_createEvents:794":0,"(anonymous 8):878":0,"_renderHandles:873":0,"_buildHandle:893":0,"_calcResize:909":0,"_checkSize:935":0,"_copyStyles:962":0,"(anonymous 9):995":0,"_getInfo:1018":0,"(anonymous 10):1063":0,"_getBoxSurroundingInfo:1055":0,"_syncUI:1093":0,"_updateChangeHandleInfo:1129":0,"_updateInfo:1144":0,"_updateSurroundingInfo:1160":0,"(anonymous 11):1189":0,"_setActiveHandlesUI:1181":0,"(anonymous 12):1226":0,"_setHandles:1209":0,"_setHideHandlesUI:1248":0,"_setWrap:1269":0,"_defMouseUpFn:1290":0,"_defResizeFn:1303":0,"_resize:1316":0,"_defResizeAlignFn:1332":0,"_resizeAlign:1345":0,"_defResizeEndFn:1383":0,"_resizeEnd:1396":0,"_defResizeStartFn:1421":0,"_resizeStart:1434":0,"_handleMouseUpEvent:1457":0,"_handleResizeEvent:1468":0,"_handleResizeAlignEvent:1479":0,"_handleResizeEndEvent:1490":0,"_handleResizeStartEvent:1501":0,"_onWrapperMouseEnter:1516":0,"_onWrapperMouseLeave:1531":0,"_setHandleFromNode:1546":0,"_onHandleMouseEnter:1566":0,"_onHandleMouseLeave:1577":0,"_valueHandlesWrapper:1592":0,"_valueWrapper:1603":0,"setter:1638":0,"(anonymous 13):1635":0,"(anonymous 1):1":0};-_yuitest_coverage["build/resize-base/resize-base.js"].coveredLines = 245;-_yuitest_coverage["build/resize-base/resize-base.js"].coveredFunctions = 76;-_yuitest_coverline("build/resize-base/resize-base.js", 1);-YUI.add('resize-base', function (Y, NAME) {--/**- * The Resize Utility allows you to make an HTML element resizable.- * @module resize- * @main resize- */--_yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 1)", 1);-_yuitest_coverline("build/resize-base/resize-base.js", 9);-var Lang = Y.Lang,- isArray = Lang.isArray,- isBoolean = Lang.isBoolean,- isNumber = Lang.isNumber,- isString = Lang.isString,-- YArray = Y.Array,- trim = Lang.trim,- indexOf = YArray.indexOf,-- COMMA = ',',- DOT = '.',- EMPTY_STR = '',- HANDLE_SUB = '{handle}',- SPACE = ' ',-- ACTIVE = 'active',- ACTIVE_HANDLE = 'activeHandle',- ACTIVE_HANDLE_NODE = 'activeHandleNode',- ALL = 'all',- AUTO_HIDE = 'autoHide',- BORDER = 'border',- BOTTOM = 'bottom',- CLASS_NAME = 'className',- COLOR = 'color',- DEF_MIN_HEIGHT = 'defMinHeight',- DEF_MIN_WIDTH = 'defMinWidth',- HANDLE = 'handle',- HANDLES = 'handles',- HANDLES_WRAPPER = 'handlesWrapper',- HIDDEN = 'hidden',- INNER = 'inner',- LEFT = 'left',- MARGIN = 'margin',- NODE = 'node',- NODE_NAME = 'nodeName',- NONE = 'none',- OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth',- PADDING = 'padding',- PARENT_NODE = 'parentNode',- POSITION = 'position',- RELATIVE = 'relative',- RESIZE = 'resize',- RESIZING = 'resizing',- RIGHT = 'right',- STATIC = 'static',- STYLE = 'style',- TOP = 'top',- WIDTH = 'width',- WRAP = 'wrap',- WRAPPER = 'wrapper',- WRAP_TYPES = 'wrapTypes',-- EV_MOUSE_UP = 'resize:mouseUp',- EV_RESIZE = 'resize:resize',- EV_RESIZE_ALIGN = 'resize:align',- EV_RESIZE_END = 'resize:end',- EV_RESIZE_START = 'resize:start',-- T = 't',- TR = 'tr',- R = 'r',- BR = 'br',- B = 'b',- BL = 'bl',- L = 'l',- TL = 'tl',-- concat = function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "concat", 78);-_yuitest_coverline("build/resize-base/resize-base.js", 79);-return Array.prototype.slice.call(arguments).join(SPACE);- },-- // round the passed number to get rid of pixel-flickering- toRoundNumber = function(num) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "toRoundNumber", 83);-_yuitest_coverline("build/resize-base/resize-base.js", 84);-return Math.round(parseFloat(num)) || 0;- },-- getCompStyle = function(node, val) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "getCompStyle", 87);-_yuitest_coverline("build/resize-base/resize-base.js", 88);-return node.getComputedStyle(val);- },-- handleAttrName = function(handle) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "handleAttrName", 91);-_yuitest_coverline("build/resize-base/resize-base.js", 92);-return HANDLE + handle.toUpperCase();- },-- isNode = function(v) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "isNode", 95);-_yuitest_coverline("build/resize-base/resize-base.js", 96);-return (v instanceof Y.Node);- },-- toInitialCap = Y.cached(- function(str) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 2)", 100);-_yuitest_coverline("build/resize-base/resize-base.js", 101);-return str.substring(0, 1).toUpperCase() + str.substring(1);- }- ),-- capitalize = Y.cached(function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 3)", 105);-_yuitest_coverline("build/resize-base/resize-base.js", 106);-var out = [],- args = YArray(arguments, 0, true);-- _yuitest_coverline("build/resize-base/resize-base.js", 109);-YArray.each(args, function(part, i) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 4)", 109);-_yuitest_coverline("build/resize-base/resize-base.js", 110);-if (i > 0) {- _yuitest_coverline("build/resize-base/resize-base.js", 111);-part = toInitialCap(part);- }- _yuitest_coverline("build/resize-base/resize-base.js", 113);-out.push(part);- });-- _yuitest_coverline("build/resize-base/resize-base.js", 116);-return out.join(EMPTY_STR);- }),-- getCN = Y.ClassNameManager.getClassName,-- CSS_RESIZE = getCN(RESIZE),- CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),- CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),- CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),- CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),- CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),- CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),- CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),- CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);--/**-A base class for Resize, providing:-- * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)- * Applies drag handles to an element to make it resizable- * Here is the list of valid resize handles:- `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can- read this list as top, top-right, right, bottom-right, bottom,- bottom-left, left, top-left.- * The drag handles are inserted into the element and positioned- absolute. Some elements, such as a textarea or image, don't support- children. To overcome that, set wrap:true in your config and the- element willbe wrapped for you automatically.--Quick Example:-- var instance = new Y.Resize({- node: '#resize1',- preserveRatio: true,- wrap: true,- maxHeight: 170,- maxWidth: 400,- handles: 't, tr, r, br, b, bl, l, tl'- });--Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for-Resize.--@class Resize-@param config {Object} Object literal specifying widget configuration properties.-@constructor-@extends Base-*/--_yuitest_coverline("build/resize-base/resize-base.js", 165);-function Resize() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "Resize", 165);-_yuitest_coverline("build/resize-base/resize-base.js", 166);-Resize.superclass.constructor.apply(this, arguments);-}--_yuitest_coverline("build/resize-base/resize-base.js", 169);-Y.mix(Resize, {- /**- * Static property provides a string to identify the class.- *- * @property NAME- * @type String- * @static- */- NAME: RESIZE,-- /**- * Static property used to define the default attribute- * configuration for the Resize.- *- * @property ATTRS- * @type Object- * @static- */- ATTRS: {- /**- * Stores the active handle during the resize.- *- * @attribute activeHandle- * @default null- * @private- * @type String- */- activeHandle: {- value: null,- validator: function(v) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "validator", 198);-_yuitest_coverline("build/resize-base/resize-base.js", 199);-return Y.Lang.isString(v) || Y.Lang.isNull(v);- }- },-- /**- * Stores the active handle element during the resize.- *- * @attribute activeHandleNode- * @default null- * @private- * @type Node- */- activeHandleNode: {- value: null,- validator: isNode- },-- /**- * False to ensure that the resize handles are always visible, true to- * display them only when the user mouses over the resizable borders.- *- * @attribute autoHide- * @default false- * @type boolean- */- autoHide: {- value: false,- validator: isBoolean- },-- /**- * The default minimum height of the element. Only used when- * ResizeConstrained is not plugged.- *- * @attribute defMinHeight- * @default 15- * @type Number- */- defMinHeight: {- value: 15,- validator: isNumber- },-- /**- * The default minimum width of the element. Only used when- * ResizeConstrained is not plugged.- *- * @attribute defMinWidth- * @default 15- * @type Number- */- defMinWidth: {- value: 15,- validator: isNumber- },-- /**- * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',- * 'br', 'tl', 'tr'. Can use a shortcut of All.- *- * @attribute handles- * @default all- * @type Array | String- */- handles: {- setter: '_setHandles',- value: ALL- },-- /**- * Node to wrap the resize handles.- *- * @attribute handlesWrapper- * @type Node- */- handlesWrapper: {- readOnly: true,- setter: Y.one,- valueFn: '_valueHandlesWrapper'- },-- /**- * The selector or element to resize. Required.- *- * @attribute node- * @type Node- */- node: {- setter: Y.one- },-- /**- * True when the element is being Resized.- *- * @attribute resizing- * @default false- * @type boolean- */- resizing: {- value: false,- validator: isBoolean- },-- /**- * True to wrap an element with a div if needed (required for textareas- * and images, defaults to false) in favor of the handles config option.- * The wrapper element type (default div) could be over-riden passing the- * <code>wrapper</code> attribute.- *- * @attribute wrap- * @default false- * @type boolean- */- wrap: {- setter: '_setWrap',- value: false,- validator: isBoolean- },-- /**- * Elements that requires a wrapper by default. Normally are elements- * which cannot have children elements.- *- * @attribute wrapTypes- * @default /canvas|textarea|input|select|button|img/i- * @readOnly- * @type Regex- */- wrapTypes: {- readOnly: true,- value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i- },-- /**- * Element to wrap the <code>wrapTypes</code>. This element will house- * the handles elements.- *- * @attribute wrapper- * @default div- * @type String | Node- * @writeOnce- */- wrapper: {- readOnly: true,- valueFn: '_valueWrapper',- writeOnce: true- }- },-- RULES: {- b: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "b", 349);-_yuitest_coverline("build/resize-base/resize-base.js", 350);-var info = instance.info,- originalInfo = instance.originalInfo;-- _yuitest_coverline("build/resize-base/resize-base.js", 353);-info.offsetHeight = originalInfo.offsetHeight + dy;- },-- l: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "l", 356);-_yuitest_coverline("build/resize-base/resize-base.js", 357);-var info = instance.info,- originalInfo = instance.originalInfo;-- _yuitest_coverline("build/resize-base/resize-base.js", 360);-info.left = originalInfo.left + dx;- _yuitest_coverline("build/resize-base/resize-base.js", 361);-info.offsetWidth = originalInfo.offsetWidth - dx;- },-- r: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "r", 364);-_yuitest_coverline("build/resize-base/resize-base.js", 365);-var info = instance.info,- originalInfo = instance.originalInfo;-- _yuitest_coverline("build/resize-base/resize-base.js", 368);-info.offsetWidth = originalInfo.offsetWidth + dx;- },-- t: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "t", 371);-_yuitest_coverline("build/resize-base/resize-base.js", 372);-var info = instance.info,- originalInfo = instance.originalInfo;-- _yuitest_coverline("build/resize-base/resize-base.js", 375);-info.top = originalInfo.top + dy;- _yuitest_coverline("build/resize-base/resize-base.js", 376);-info.offsetHeight = originalInfo.offsetHeight - dy;- },-- tr: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "tr", 379);-_yuitest_coverline("build/resize-base/resize-base.js", 380);-this.t.apply(this, arguments);- _yuitest_coverline("build/resize-base/resize-base.js", 381);-this.r.apply(this, arguments);- },-- bl: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "bl", 384);-_yuitest_coverline("build/resize-base/resize-base.js", 385);-this.b.apply(this, arguments);- _yuitest_coverline("build/resize-base/resize-base.js", 386);-this.l.apply(this, arguments);- },-- br: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "br", 389);-_yuitest_coverline("build/resize-base/resize-base.js", 390);-this.b.apply(this, arguments);- _yuitest_coverline("build/resize-base/resize-base.js", 391);-this.r.apply(this, arguments);- },-- tl: function(instance, dx, dy) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "tl", 394);-_yuitest_coverline("build/resize-base/resize-base.js", 395);-this.t.apply(this, arguments);- _yuitest_coverline("build/resize-base/resize-base.js", 396);-this.l.apply(this, arguments);- }- },-- capitalize: capitalize-});--_yuitest_coverline("build/resize-base/resize-base.js", 403);-Y.Resize = Y.extend(- Resize,- Y.Base,- {- /**- * Array containing all possible resizable handles.- *- * @property ALL_HANDLES- * @type {String}- */- ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],-- /**- * Regex which matches with the handles that could change the height of- * the resizable element.- *- * @property REGEX_CHANGE_HEIGHT- * @type {String}- */- REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,-- /**- * Regex which matches with the handles that could change the left of- * the resizable element.- *- * @property REGEX_CHANGE_LEFT- * @type {String}- */- REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,-- /**- * Regex which matches with the handles that could change the top of- * the resizable element.- *- * @property REGEX_CHANGE_TOP- * @type {String}- */- REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,-- /**- * Regex which matches with the handles that could change the width of- * the resizable element.- *- * @property REGEX_CHANGE_WIDTH- * @type {String}- */- REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,-- /**- * Template used to create the resize wrapper for the handles.- *- * @property HANDLES_WRAP_TEMPLATE- * @type {String}- */- HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>',-- /**- * Template used to create the resize wrapper node when needed.- *- * @property WRAP_TEMPLATE- * @type {String}- */- WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>',-- /**- * Template used to create each resize handle.- *- * @property HANDLE_TEMPLATE- * @type {String}- */- HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' +- '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' +- '</div>',--- /**- * Each box has a content area and optional surrounding padding and- * border areas. This property stores the sum of all horizontal- * surrounding * information needed to adjust the node height.- *- * @property totalHSurrounding- * @default 0- * @type number- */- totalHSurrounding: 0,-- /**- * Each box has a content area and optional surrounding padding and- * border areas. This property stores the sum of all vertical- * surrounding * information needed to adjust the node height.- *- * @property totalVSurrounding- * @default 0- * @type number- */- totalVSurrounding: 0,-- /**- * Stores the <a href="Resize.html#attr_node">node</a>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property nodeSurrounding- * @type Object- * @default null- */- nodeSurrounding: null,-- /**- * Stores the <a href="Resize.html#attr_wrapper">wrapper</a>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property wrapperSurrounding- * @type Object- * @default null- */- wrapperSurrounding: null,-- /**- * Whether the handle being dragged can change the height.- *- * @property changeHeightHandles- * @default false- * @type boolean- */- changeHeightHandles: false,-- /**- * Whether the handle being dragged can change the left.- *- * @property changeLeftHandles- * @default false- * @type boolean- */- changeLeftHandles: false,-- /**- * Whether the handle being dragged can change the top.- *- * @property changeTopHandles- * @default false- * @type boolean- */- changeTopHandles: false,-- /**- * Whether the handle being dragged can change the width.- *- * @property changeWidthHandles- * @default false- * @type boolean- */- changeWidthHandles: false,-- /**- * Store DD.Delegate reference for the respective Resize instance.- *- * @property delegate- * @default null- * @type Object- */- delegate: null,-- /**- * Stores the current values for the height, width, top and left. You are- * able to manipulate these values on resize in order to change the resize- * behavior.- *- * @property info- * @type Object- * @protected- */- info: null,-- /**- * Stores the last values for the height, width, top and left.- *- * @property lastInfo- * @type Object- * @protected- */- lastInfo: null,-- /**- * Stores the original values for the height, width, top and left, stored- * on resize start.- *- * @property originalInfo- * @type Object- * @protected- */- originalInfo: null,-- /**- * Construction logic executed during Resize instantiation. Lifecycle.- *- * @method initializer- * @protected- */- initializer: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "initializer", 603);-_yuitest_coverline("build/resize-base/resize-base.js", 604);-this._eventHandles = [];-- _yuitest_coverline("build/resize-base/resize-base.js", 606);-this.renderer();- },-- /**- * Create the DOM structure for the Resize. Lifecycle.- *- * @method renderUI- * @protected- */- renderUI: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "renderUI", 615);-_yuitest_coverline("build/resize-base/resize-base.js", 616);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 618);-instance._renderHandles();- },-- /**- * Bind the events on the Resize UI. Lifecycle.- *- * @method bindUI- * @protected- */- bindUI: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "bindUI", 627);-_yuitest_coverline("build/resize-base/resize-base.js", 628);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 630);-instance._createEvents();- _yuitest_coverline("build/resize-base/resize-base.js", 631);-instance._bindDD();- _yuitest_coverline("build/resize-base/resize-base.js", 632);-instance._bindHandle();- },-- /**- * Sync the Resize UI.- *- * @method syncUI- * @protected- */- syncUI: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "syncUI", 641);-_yuitest_coverline("build/resize-base/resize-base.js", 642);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 644);-this.get(NODE).addClass(CSS_RESIZE);-- // hide handles if AUTO_HIDE is true- _yuitest_coverline("build/resize-base/resize-base.js", 647);-instance._setHideHandlesUI(- instance.get(AUTO_HIDE)- );- },-- /**- * Destructor lifecycle implementation for the Resize class.- * Detaches all previously attached listeners and removes the Resize handles.- *- * @method destructor- * @protected- */- destructor: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "destructor", 659);-_yuitest_coverline("build/resize-base/resize-base.js", 660);-var instance = this,- node = instance.get(NODE),- wrapper = instance.get(WRAPPER),- pNode = wrapper.get(PARENT_NODE);-- _yuitest_coverline("build/resize-base/resize-base.js", 665);-Y.each(- instance._eventHandles,- function(handle, index) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 5)", 667);-_yuitest_coverline("build/resize-base/resize-base.js", 668);-handle.detach();- }- );-- _yuitest_coverline("build/resize-base/resize-base.js", 672);-instance._eventHandles.length = 0;-- // destroy handles dd and remove them from the dom- _yuitest_coverline("build/resize-base/resize-base.js", 675);-instance.eachHandle(function(handleEl) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 6)", 675);-_yuitest_coverline("build/resize-base/resize-base.js", 676);-instance.delegate.dd.destroy();-- // remove handle- _yuitest_coverline("build/resize-base/resize-base.js", 679);-handleEl.remove(true);- });-- _yuitest_coverline("build/resize-base/resize-base.js", 682);-instance.delegate.destroy();-- // unwrap node- _yuitest_coverline("build/resize-base/resize-base.js", 685);-if (instance.get(WRAP)) {- _yuitest_coverline("build/resize-base/resize-base.js", 686);-instance._copyStyles(wrapper, node);-- _yuitest_coverline("build/resize-base/resize-base.js", 688);-if (pNode) {- _yuitest_coverline("build/resize-base/resize-base.js", 689);-pNode.insertBefore(node, wrapper);- }-- _yuitest_coverline("build/resize-base/resize-base.js", 692);-wrapper.remove(true);- }-- _yuitest_coverline("build/resize-base/resize-base.js", 695);-node.removeClass(CSS_RESIZE);- _yuitest_coverline("build/resize-base/resize-base.js", 696);-node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);- },-- /**- * Creates DOM (or manipulates DOM for progressive enhancement)- * This method is invoked by initializer(). It's chained automatically for- * subclasses if required.- *- * @method renderer- * @protected- */- renderer: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "renderer", 707);-_yuitest_coverline("build/resize-base/resize-base.js", 708);-this.renderUI();- _yuitest_coverline("build/resize-base/resize-base.js", 709);-this.bindUI();- _yuitest_coverline("build/resize-base/resize-base.js", 710);-this.syncUI();- },-- /**- * <p>Loop through each handle which is being used and executes a callback.</p>- * <p>Example:</p>- * <pre><code>instance.eachHandle(- * function(handleName, index) { ... }- * );</code></pre>- *- * @method eachHandle- * @param {function} fn Callback function to be executed for each handle.- */- eachHandle: function(fn) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "eachHandle", 723);-_yuitest_coverline("build/resize-base/resize-base.js", 724);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 726);-Y.each(- instance.get(HANDLES),- function(handle, i) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 7)", 728);-_yuitest_coverline("build/resize-base/resize-base.js", 729);-var handleEl = instance.get(- handleAttrName(handle)- );-- _yuitest_coverline("build/resize-base/resize-base.js", 733);-fn.apply(instance, [handleEl, handle, i]);- }- );- },-- /**- * Bind the handles DragDrop events to the Resize instance.- *- * @method _bindDD- * @private- */- _bindDD: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_bindDD", 744);-_yuitest_coverline("build/resize-base/resize-base.js", 745);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 747);-instance.delegate = new Y.DD.Delegate(- {- bubbleTargets: instance,- container: instance.get(HANDLES_WRAPPER),- dragConfig: {- clickPixelThresh: 0,- clickTimeThresh: 0,- useShim: true,- move: false- },- nodes: DOT+CSS_RESIZE_HANDLE,- target: false- }- );-- _yuitest_coverline("build/resize-base/resize-base.js", 762);-instance._eventHandles.push(- instance.on('drag:drag', instance._handleResizeEvent),- instance.on('drag:dropmiss', instance._handleMouseUpEvent),- instance.on('drag:end', instance._handleResizeEndEvent),- instance.on('drag:start', instance._handleResizeStartEvent)- );- },-- /**- * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave).- *- * @method _bindHandle- * @private- */- _bindHandle: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_bindHandle", 776);-_yuitest_coverline("build/resize-base/resize-base.js", 777);-var instance = this,- wrapper = instance.get(WRAPPER);-- _yuitest_coverline("build/resize-base/resize-base.js", 780);-instance._eventHandles.push(- wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),- wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),- wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),- wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)- );- },-- /**- * Create the custom events used on the Resize.- *- * @method _createEvents- * @private- */- _createEvents: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_createEvents", 794);-_yuitest_coverline("build/resize-base/resize-base.js", 795);-var instance = this,- // create publish function for kweight optimization- publish = function(name, fn) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "publish", 797);-_yuitest_coverline("build/resize-base/resize-base.js", 798);-instance.publish(name, {- defaultFn: fn,- queuable: false,- emitFacade: true,- bubbles: true,- prefix: RESIZE- });- };-- /**- * Handles the resize start event. Fired when a handle starts to be- * dragged.- *- * @event resize:start- * @preventable _defResizeStartFn- * @param {Event.Facade} event The resize start event.- * @bubbles Resize- * @type {Event.Custom}- */- _yuitest_coverline("build/resize-base/resize-base.js", 817);-publish(EV_RESIZE_START, this._defResizeStartFn);-- /**- * Handles the resize event. Fired on each pixel when the handle is- * being dragged.- *- * @event resize:resize- * @preventable _defResizeFn- * @param {Event.Facade} event The resize event.- * @bubbles Resize- * @type {Event.Custom}- */- _yuitest_coverline("build/resize-base/resize-base.js", 829);-publish(EV_RESIZE, this._defResizeFn);-- /**- * Handles the resize align event.- *- * @event resize:align- * @preventable _defResizeAlignFn- * @param {Event.Facade} event The resize align event.- * @bubbles Resize- * @type {Event.Custom}- */- _yuitest_coverline("build/resize-base/resize-base.js", 840);-publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);-- /**- * Handles the resize end event. Fired when a handle stop to be- * dragged.- *- * @event resize:end- * @preventable _defResizeEndFn- * @param {Event.Facade} event The resize end event.- * @bubbles Resize- * @type {Event.Custom}- */- _yuitest_coverline("build/resize-base/resize-base.js", 852);-publish(EV_RESIZE_END, this._defResizeEndFn);-- /**- * Handles the resize mouseUp event. Fired when a mouseUp event happens on a- * handle.- *- * @event resize:mouseUp- * @preventable _defMouseUpFn- * @param {Event.Facade} event The resize mouseUp event.- * @bubbles Resize- * @type {Event.Custom}- */- _yuitest_coverline("build/resize-base/resize-base.js", 864);-publish(EV_MOUSE_UP, this._defMouseUpFn);- },-- /**- * Responsible for loop each handle element and append to the wrapper.- *- * @method _renderHandles- * @protected- */- _renderHandles: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_renderHandles", 873);-_yuitest_coverline("build/resize-base/resize-base.js", 874);-var instance = this,- wrapper = instance.get(WRAPPER),- handlesWrapper = instance.get(HANDLES_WRAPPER);-- _yuitest_coverline("build/resize-base/resize-base.js", 878);-instance.eachHandle(function(handleEl) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 8)", 878);-_yuitest_coverline("build/resize-base/resize-base.js", 879);-handlesWrapper.append(handleEl);- });-- _yuitest_coverline("build/resize-base/resize-base.js", 882);-wrapper.append(handlesWrapper);- },-- /**- * Creates the handle element based on the handle name and initialize the- * DragDrop on it.- *- * @method _buildHandle- * @param {String} handle Handle name ('t', 'tr', 'b', ...).- * @protected- */- _buildHandle: function(handle) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_buildHandle", 893);-_yuitest_coverline("build/resize-base/resize-base.js", 894);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 896);-return Y.Node.create(- Y.Lang.sub(instance.HANDLE_TEMPLATE, {- handle: handle- })- );- },-- /**- * Basic resize calculations.- *- * @method _calcResize- * @protected- */- _calcResize: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_calcResize", 909);-_yuitest_coverline("build/resize-base/resize-base.js", 910);-var instance = this,- handle = instance.handle,- info = instance.info,- originalInfo = instance.originalInfo,-- dx = info.actXY[0] - originalInfo.actXY[0],- dy = info.actXY[1] - originalInfo.actXY[1];-- _yuitest_coverline("build/resize-base/resize-base.js", 918);-if (handle && Y.Resize.RULES[handle]) {- _yuitest_coverline("build/resize-base/resize-base.js", 919);-Y.Resize.RULES[handle](instance, dx, dy);- }- else {- }- },-- /**- * Helper method to update the current size value on- * <a href="Resize.html#property_info">info</a> to respect the- * min/max values and fix the top/left calculations.- *- * @method _checkSize- * @param {String} offset 'offsetHeight' or 'offsetWidth'- * @param {number} size Size to restrict the offset- * @protected- */- _checkSize: function(offset, size) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_checkSize", 935);-_yuitest_coverline("build/resize-base/resize-base.js", 936);-var instance = this,- info = instance.info,- originalInfo = instance.originalInfo,- axis = (offset == OFFSET_HEIGHT) ? TOP : LEFT;-- // forcing the offsetHeight/offsetWidth to be the passed size- _yuitest_coverline("build/resize-base/resize-base.js", 942);-info[offset] = size;-- // predicting, based on the original information, the last left valid in case of reach the min/max dimension- // this calculation avoid browser event leaks when user interact very fast- _yuitest_coverline("build/resize-base/resize-base.js", 946);-if (((axis == LEFT) && instance.changeLeftHandles) ||- ((axis == TOP) && instance.changeTopHandles)) {-- _yuitest_coverline("build/resize-base/resize-base.js", 949);-info[axis] = originalInfo[axis] + originalInfo[offset] - size;- }- },-- /**- * Copy relevant styles of the <a href="Resize.html#attr_node">node</a>- * to the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _copyStyles- * @param {Node} node Node from.- * @param {Node} wrapper Node to.- * @protected- */- _copyStyles: function(node, wrapper) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_copyStyles", 962);-_yuitest_coverline("build/resize-base/resize-base.js", 963);-var position = node.getStyle(POSITION).toLowerCase(),- surrounding = this._getBoxSurroundingInfo(node),- wrapperStyle;-- // resizable wrapper should be positioned- _yuitest_coverline("build/resize-base/resize-base.js", 968);-if (position == STATIC) {- _yuitest_coverline("build/resize-base/resize-base.js", 969);-position = RELATIVE;- }-- _yuitest_coverline("build/resize-base/resize-base.js", 972);-wrapperStyle = {- position: position,- left: getCompStyle(node, LEFT),- top: getCompStyle(node, TOP)- };-- _yuitest_coverline("build/resize-base/resize-base.js", 978);-Y.mix(wrapperStyle, surrounding.margin);- _yuitest_coverline("build/resize-base/resize-base.js", 979);-Y.mix(wrapperStyle, surrounding.border);-- _yuitest_coverline("build/resize-base/resize-base.js", 981);-wrapper.setStyles(wrapperStyle);-- // remove margin and border from the internal node- _yuitest_coverline("build/resize-base/resize-base.js", 984);-node.setStyles({ border: 0, margin: 0 });-- _yuitest_coverline("build/resize-base/resize-base.js", 986);-wrapper.sizeTo(- node.get(OFFSET_WIDTH) + surrounding.totalHBorder,- node.get(OFFSET_HEIGHT) + surrounding.totalVBorder- );- },-- // extract handle name from a string- // using Y.cached to memoize the function for performance- _extractHandleName: Y.cached(- function(node) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 9)", 995);-_yuitest_coverline("build/resize-base/resize-base.js", 996);-var className = node.get(CLASS_NAME),-- match = className.match(- new RegExp(- getCN(RESIZE, HANDLE, '(\\w{1,2})\\b')- )- );-- _yuitest_coverline("build/resize-base/resize-base.js", 1004);-return match ? match[1] : null;- }- ),-- /**- * <p>Generates metadata to the <a href="Resize.html#property_info">info</a>- * and <a href="Resize.html#property_originalInfo">originalInfo</a></p>- * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>- *- * @method _getInfo- * @param {Node} node- * @param {EventFacade} event- * @private- */- _getInfo: function(node, event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_getInfo", 1018);-_yuitest_coverline("build/resize-base/resize-base.js", 1019);-var actXY = [0,0],- drag = event.dragEvent.target,- nodeXY = node.getXY(),- nodeX = nodeXY[0],- nodeY = nodeXY[1],- offsetHeight = node.get(OFFSET_HEIGHT),- offsetWidth = node.get(OFFSET_WIDTH);-- _yuitest_coverline("build/resize-base/resize-base.js", 1027);-if (event) {- // the xy that the node will be set to. Changing this will alter the position as it's dragged.- _yuitest_coverline("build/resize-base/resize-base.js", 1029);-actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);- }-- _yuitest_coverline("build/resize-base/resize-base.js", 1032);-return {- actXY: actXY,- bottom: (nodeY + offsetHeight),- left: nodeX,- offsetHeight: offsetHeight,- offsetWidth: offsetWidth,- right: (nodeX + offsetWidth),- top: nodeY- };- },-- /**- * Each box has a content area and optional surrounding margin,- * padding and * border areas. This method get all this information from- * the passed node. For more reference see- * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">- * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.- *- * @method _getBoxSurroundingInfo- * @param {Node} node- * @private- * @return {Object}- */- _getBoxSurroundingInfo: function(node) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_getBoxSurroundingInfo", 1055);-_yuitest_coverline("build/resize-base/resize-base.js", 1056);-var info = {- padding: {},- margin: {},- border: {}- };-- _yuitest_coverline("build/resize-base/resize-base.js", 1062);-if (isNode(node)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1063);-Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 10)", 1063);-_yuitest_coverline("build/resize-base/resize-base.js", 1064);-var paddingProperty = capitalize(PADDING, dir),- marginProperty = capitalize(MARGIN, dir),- borderWidthProperty = capitalize(BORDER, dir, WIDTH),- borderColorProperty = capitalize(BORDER, dir, COLOR),- borderStyleProperty = capitalize(BORDER, dir, STYLE);-- _yuitest_coverline("build/resize-base/resize-base.js", 1070);-info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);- _yuitest_coverline("build/resize-base/resize-base.js", 1071);-info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);- _yuitest_coverline("build/resize-base/resize-base.js", 1072);-info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);- _yuitest_coverline("build/resize-base/resize-base.js", 1073);-info.margin[marginProperty] = getCompStyle(node, marginProperty);- _yuitest_coverline("build/resize-base/resize-base.js", 1074);-info.padding[paddingProperty] = getCompStyle(node, paddingProperty);- });- }-- _yuitest_coverline("build/resize-base/resize-base.js", 1078);-info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));- _yuitest_coverline("build/resize-base/resize-base.js", 1079);-info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));- _yuitest_coverline("build/resize-base/resize-base.js", 1080);-info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));- _yuitest_coverline("build/resize-base/resize-base.js", 1081);-info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));-- _yuitest_coverline("build/resize-base/resize-base.js", 1083);-return info;- },-- /**- * Sync the Resize UI with internal values from- * <a href="Resize.html#property_info">info</a>.- *- * @method _syncUI- * @protected- */- _syncUI: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_syncUI", 1093);-_yuitest_coverline("build/resize-base/resize-base.js", 1094);-var instance = this,- info = instance.info,- wrapperSurrounding = instance.wrapperSurrounding,- wrapper = instance.get(WRAPPER),- node = instance.get(NODE);-- _yuitest_coverline("build/resize-base/resize-base.js", 1100);-wrapper.sizeTo(info.offsetWidth, info.offsetHeight);-- _yuitest_coverline("build/resize-base/resize-base.js", 1102);-if (instance.changeLeftHandles || instance.changeTopHandles) {- _yuitest_coverline("build/resize-base/resize-base.js", 1103);-wrapper.setXY([info.left, info.top]);- }-- // if a wrap node is being used- _yuitest_coverline("build/resize-base/resize-base.js", 1107);-if (!wrapper.compareTo(node)) {- // the original internal node borders were copied to the wrapper on _copyStyles, to compensate that subtract the borders from the internal node- _yuitest_coverline("build/resize-base/resize-base.js", 1109);-node.sizeTo(- info.offsetWidth - wrapperSurrounding.totalHBorder,- info.offsetHeight - wrapperSurrounding.totalVBorder- );- }-- // prevent webkit textarea resize- _yuitest_coverline("build/resize-base/resize-base.js", 1116);-if (Y.UA.webkit) {- _yuitest_coverline("build/resize-base/resize-base.js", 1117);-node.setStyle(RESIZE, NONE);- }- },-- /**- * Update <code>instance.changeHeightHandles,- * instance.changeLeftHandles, instance.changeTopHandles,- * instance.changeWidthHandles</code> information.- *- * @method _updateChangeHandleInfo- * @private- */- _updateChangeHandleInfo: function(handle) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_updateChangeHandleInfo", 1129);-_yuitest_coverline("build/resize-base/resize-base.js", 1130);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1132);-instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);- _yuitest_coverline("build/resize-base/resize-base.js", 1133);-instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);- _yuitest_coverline("build/resize-base/resize-base.js", 1134);-instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);- _yuitest_coverline("build/resize-base/resize-base.js", 1135);-instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);- },-- /**- * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).- *- * @method _updateInfo- * @private- */- _updateInfo: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_updateInfo", 1144);-_yuitest_coverline("build/resize-base/resize-base.js", 1145);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1147);-instance.info = instance._getInfo(instance.get(WRAPPER), event);- },-- /**- * Update properties- * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.- *- * @method _updateSurroundingInfo- * @private- */- _updateSurroundingInfo: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_updateSurroundingInfo", 1160);-_yuitest_coverline("build/resize-base/resize-base.js", 1161);-var instance = this,- node = instance.get(NODE),- wrapper = instance.get(WRAPPER),- nodeSurrounding = instance._getBoxSurroundingInfo(node),- wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);-- _yuitest_coverline("build/resize-base/resize-base.js", 1167);-instance.nodeSurrounding = nodeSurrounding;- _yuitest_coverline("build/resize-base/resize-base.js", 1168);-instance.wrapperSurrounding = wrapperSurrounding;-- _yuitest_coverline("build/resize-base/resize-base.js", 1170);-instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);- _yuitest_coverline("build/resize-base/resize-base.js", 1171);-instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);- },-- /**- * Set the active state of the handles.- *- * @method _setActiveHandlesUI- * @param {boolean} val True to activate the handles, false to deactivate.- * @protected- */- _setActiveHandlesUI: function(val) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_setActiveHandlesUI", 1181);-_yuitest_coverline("build/resize-base/resize-base.js", 1182);-var instance = this,- activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);-- _yuitest_coverline("build/resize-base/resize-base.js", 1185);-if (activeHandleNode) {- _yuitest_coverline("build/resize-base/resize-base.js", 1186);-if (val) {- // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active- _yuitest_coverline("build/resize-base/resize-base.js", 1188);-instance.eachHandle(- function(handleEl) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 11)", 1189);-_yuitest_coverline("build/resize-base/resize-base.js", 1190);-handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);- }- );-- _yuitest_coverline("build/resize-base/resize-base.js", 1194);-activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);- }- else {- _yuitest_coverline("build/resize-base/resize-base.js", 1197);-activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);- }- }- },-- /**- * Setter for the handles attribute- *- * @method _setHandles- * @protected- * @param {String} val- */- _setHandles: function(val) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_setHandles", 1209);-_yuitest_coverline("build/resize-base/resize-base.js", 1210);-var instance = this,- handles = [];-- // handles attr accepts both array or string- _yuitest_coverline("build/resize-base/resize-base.js", 1214);-if (isArray(val)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1215);-handles = val;- }- else {_yuitest_coverline("build/resize-base/resize-base.js", 1217);-if (isString(val)) {- // if the handles attr passed in is an ALL string...- _yuitest_coverline("build/resize-base/resize-base.js", 1219);-if (val.toLowerCase() == ALL) {- _yuitest_coverline("build/resize-base/resize-base.js", 1220);-handles = instance.ALL_HANDLES;- }- // otherwise, split the string to extract the handles- else {- _yuitest_coverline("build/resize-base/resize-base.js", 1224);-Y.each(- val.split(COMMA),- function(node, i) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 12)", 1226);-_yuitest_coverline("build/resize-base/resize-base.js", 1227);-var handle = trim(node);-- // if its a valid handle, add it to the handles output- _yuitest_coverline("build/resize-base/resize-base.js", 1230);-if (indexOf(instance.ALL_HANDLES, handle) > -1) {- _yuitest_coverline("build/resize-base/resize-base.js", 1231);-handles.push(handle);- }- }- );- }- }}-- _yuitest_coverline("build/resize-base/resize-base.js", 1238);-return handles;- },-- /**- * Set the visibility of the handles.- *- * @method _setHideHandlesUI- * @param {boolean} val True to hide the handles, false to show.- * @protected- */- _setHideHandlesUI: function(val) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_setHideHandlesUI", 1248);-_yuitest_coverline("build/resize-base/resize-base.js", 1249);-var instance = this,- wrapper = instance.get(WRAPPER);-- _yuitest_coverline("build/resize-base/resize-base.js", 1252);-if (!instance.get(RESIZING)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1253);-if (val) {- _yuitest_coverline("build/resize-base/resize-base.js", 1254);-wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);- }- else {- _yuitest_coverline("build/resize-base/resize-base.js", 1257);-wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);- }- }- },-- /**- * Setter for the wrap attribute- *- * @method _setWrap- * @protected- * @param {boolean} val- */- _setWrap: function(val) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_setWrap", 1269);-_yuitest_coverline("build/resize-base/resize-base.js", 1270);-var instance = this,- node = instance.get(NODE),- nodeName = node.get(NODE_NAME),- typeRegex = instance.get(WRAP_TYPES);-- // if nodeName is listed on WRAP_TYPES force use the wrapper- _yuitest_coverline("build/resize-base/resize-base.js", 1276);-if (typeRegex.test(nodeName)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1277);-val = true;- }-- _yuitest_coverline("build/resize-base/resize-base.js", 1280);-return val;- },-- /**- * Default resize:mouseUp handler- *- * @method _defMouseUpFn- * @param {EventFacade} event The Event object- * @protected- */- _defMouseUpFn: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_defMouseUpFn", 1290);-_yuitest_coverline("build/resize-base/resize-base.js", 1291);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1293);-instance.set(RESIZING, false);- },-- /**- * Default resize:resize handler- *- * @method _defResizeFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeFn: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeFn", 1303);-_yuitest_coverline("build/resize-base/resize-base.js", 1304);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1306);-instance._resize(event);- },-- /**- * Logic method for _defResizeFn. Allow AOP.- *- * @method _resize- * @param {EventFacade} event The Event object- * @protected- */- _resize: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_resize", 1316);-_yuitest_coverline("build/resize-base/resize-base.js", 1317);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1319);-instance._handleResizeAlignEvent(event.dragEvent);-- // _syncUI of the wrapper, not using proxy- _yuitest_coverline("build/resize-base/resize-base.js", 1322);-instance._syncUI();- },-- /**- * Default resize:align handler- *- * @method _defResizeAlignFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeAlignFn: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeAlignFn", 1332);-_yuitest_coverline("build/resize-base/resize-base.js", 1333);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1335);-instance._resizeAlign(event);- },-- /**- * Logic method for _defResizeAlignFn. Allow AOP.- *- * @method _resizeAlign- * @param {EventFacade} event The Event object- * @protected- */- _resizeAlign: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_resizeAlign", 1345);-_yuitest_coverline("build/resize-base/resize-base.js", 1346);-var instance = this,- info,- defMinHeight,- defMinWidth;-- _yuitest_coverline("build/resize-base/resize-base.js", 1351);-instance.lastInfo = instance.info;-- // update the instance.info values- _yuitest_coverline("build/resize-base/resize-base.js", 1354);-instance._updateInfo(event);-- _yuitest_coverline("build/resize-base/resize-base.js", 1356);-info = instance.info;-- // basic resize calculations- _yuitest_coverline("build/resize-base/resize-base.js", 1359);-instance._calcResize();-- // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension- _yuitest_coverline("build/resize-base/resize-base.js", 1362);-if (!instance.con) {- _yuitest_coverline("build/resize-base/resize-base.js", 1363);-defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);- _yuitest_coverline("build/resize-base/resize-base.js", 1364);-defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);-- _yuitest_coverline("build/resize-base/resize-base.js", 1366);-if (info.offsetHeight <= defMinHeight) {- _yuitest_coverline("build/resize-base/resize-base.js", 1367);-instance._checkSize(OFFSET_HEIGHT, defMinHeight);- }-- _yuitest_coverline("build/resize-base/resize-base.js", 1370);-if (info.offsetWidth <= defMinWidth) {- _yuitest_coverline("build/resize-base/resize-base.js", 1371);-instance._checkSize(OFFSET_WIDTH, defMinWidth);- }- }- },-- /**- * Default resize:end handler- *- * @method _defResizeEndFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeEndFn: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeEndFn", 1383);-_yuitest_coverline("build/resize-base/resize-base.js", 1384);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1386);-instance._resizeEnd(event);- },-- /**- * Logic method for _defResizeEndFn. Allow AOP.- *- * @method _resizeEnd- * @param {EventFacade} event The Event object- * @protected- */- _resizeEnd: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_resizeEnd", 1396);-_yuitest_coverline("build/resize-base/resize-base.js", 1397);-var instance = this,- drag = event.dragEvent.target;-- // reseting actXY from drag when drag end- _yuitest_coverline("build/resize-base/resize-base.js", 1401);-drag.actXY = [];-- // syncUI when resize end- _yuitest_coverline("build/resize-base/resize-base.js", 1404);-instance._syncUI();-- _yuitest_coverline("build/resize-base/resize-base.js", 1406);-instance._setActiveHandlesUI(false);-- _yuitest_coverline("build/resize-base/resize-base.js", 1408);-instance.set(ACTIVE_HANDLE, null);- _yuitest_coverline("build/resize-base/resize-base.js", 1409);-instance.set(ACTIVE_HANDLE_NODE, null);-- _yuitest_coverline("build/resize-base/resize-base.js", 1411);-instance.handle = null;- },-- /**- * Default resize:start handler- *- * @method _defResizeStartFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeStartFn: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeStartFn", 1421);-_yuitest_coverline("build/resize-base/resize-base.js", 1422);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1424);-instance._resizeStart(event);- },-- /**- * Logic method for _defResizeStartFn. Allow AOP.- *- * @method _resizeStart- * @param {EventFacade} event The Event object- * @protected- */- _resizeStart: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_resizeStart", 1434);-_yuitest_coverline("build/resize-base/resize-base.js", 1435);-var instance = this,- wrapper = instance.get(WRAPPER);-- _yuitest_coverline("build/resize-base/resize-base.js", 1438);-instance.handle = instance.get(ACTIVE_HANDLE);-- _yuitest_coverline("build/resize-base/resize-base.js", 1440);-instance.set(RESIZING, true);-- _yuitest_coverline("build/resize-base/resize-base.js", 1442);-instance._updateSurroundingInfo();-- // create an originalInfo information for reference- _yuitest_coverline("build/resize-base/resize-base.js", 1445);-instance.originalInfo = instance._getInfo(wrapper, event);-- _yuitest_coverline("build/resize-base/resize-base.js", 1447);-instance._updateInfo(event);- },-- /**- * Fires the resize:mouseUp event.- *- * @method _handleMouseUpEvent- * @param {EventFacade} event resize:mouseUp event facade- * @protected- */- _handleMouseUpEvent: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleMouseUpEvent", 1457);-_yuitest_coverline("build/resize-base/resize-base.js", 1458);-this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:resize event.- *- * @method _handleResizeEvent- * @param {EventFacade} event resize:resize event facade- * @protected- */- _handleResizeEvent: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeEvent", 1468);-_yuitest_coverline("build/resize-base/resize-base.js", 1469);-this.fire(EV_RESIZE, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:align event.- *- * @method _handleResizeAlignEvent- * @param {EventFacade} event resize:resize event facade- * @protected- */- _handleResizeAlignEvent: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeAlignEvent", 1479);-_yuitest_coverline("build/resize-base/resize-base.js", 1480);-this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:end event.- *- * @method _handleResizeEndEvent- * @param {EventFacade} event resize:end event facade- * @protected- */- _handleResizeEndEvent: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeEndEvent", 1490);-_yuitest_coverline("build/resize-base/resize-base.js", 1491);-this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:start event.- *- * @method _handleResizeStartEvent- * @param {EventFacade} event resize:start event facade- * @protected- */- _handleResizeStartEvent: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeStartEvent", 1501);-_yuitest_coverline("build/resize-base/resize-base.js", 1502);-if (!this.get(ACTIVE_HANDLE)) {- //This handles the "touch" case- _yuitest_coverline("build/resize-base/resize-base.js", 1504);-this._setHandleFromNode(event.target.get('node'));- }- _yuitest_coverline("build/resize-base/resize-base.js", 1506);-this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });- },-- /**- * Mouseenter event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _onWrapperMouseEnter- * @param {EventFacade} event- * @protected- */- _onWrapperMouseEnter: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_onWrapperMouseEnter", 1516);-_yuitest_coverline("build/resize-base/resize-base.js", 1517);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1519);-if (instance.get(AUTO_HIDE)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1520);-instance._setHideHandlesUI(false);- }- },-- /**- * Mouseleave event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _onWrapperMouseLeave- * @param {EventFacade} event- * @protected- */- _onWrapperMouseLeave: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_onWrapperMouseLeave", 1531);-_yuitest_coverline("build/resize-base/resize-base.js", 1532);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1534);-if (instance.get(AUTO_HIDE)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1535);-instance._setHideHandlesUI(true);- }- },-- /**- * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).- *- * @method _setHandleFromNode- * @param {Node} node- * @protected- */- _setHandleFromNode: function(node) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_setHandleFromNode", 1546);-_yuitest_coverline("build/resize-base/resize-base.js", 1547);-var instance = this,- handle = instance._extractHandleName(node);-- _yuitest_coverline("build/resize-base/resize-base.js", 1550);-if (!instance.get(RESIZING)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1551);-instance.set(ACTIVE_HANDLE, handle);- _yuitest_coverline("build/resize-base/resize-base.js", 1552);-instance.set(ACTIVE_HANDLE_NODE, node);-- _yuitest_coverline("build/resize-base/resize-base.js", 1554);-instance._setActiveHandlesUI(true);- _yuitest_coverline("build/resize-base/resize-base.js", 1555);-instance._updateChangeHandleInfo(handle);- }- },-- /**- * Mouseenter event handler for the handles.- *- * @method _onHandleMouseEnter- * @param {EventFacade} event- * @protected- */- _onHandleMouseEnter: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_onHandleMouseEnter", 1566);-_yuitest_coverline("build/resize-base/resize-base.js", 1567);-this._setHandleFromNode(event.currentTarget);- },-- /**- * Mouseout event handler for the handles.- *- * @method _onHandleMouseLeave- * @param {EventFacade} event- * @protected- */- _onHandleMouseLeave: function(event) {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_onHandleMouseLeave", 1577);-_yuitest_coverline("build/resize-base/resize-base.js", 1578);-var instance = this;-- _yuitest_coverline("build/resize-base/resize-base.js", 1580);-if (!instance.get(RESIZING)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1581);-instance._setActiveHandlesUI(false);- }- },-- /**- * Default value for the wrapper handles node attribute- *- * @method _valueHandlesWrapper- * @protected- * @readOnly- */- _valueHandlesWrapper: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_valueHandlesWrapper", 1592);-_yuitest_coverline("build/resize-base/resize-base.js", 1593);-return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);- },-- /**- * Default value for the wrapper attribute- *- * @method _valueWrapper- * @protected- * @readOnly- */- _valueWrapper: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "_valueWrapper", 1603);-_yuitest_coverline("build/resize-base/resize-base.js", 1604);-var instance = this,- node = instance.get(NODE),- pNode = node.get(PARENT_NODE),- // by deafult the wrapper is always the node- wrapper = node;-- // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper- _yuitest_coverline("build/resize-base/resize-base.js", 1611);-if (instance.get(WRAP)) {- _yuitest_coverline("build/resize-base/resize-base.js", 1612);-wrapper = Y.Node.create(instance.WRAP_TEMPLATE);-- _yuitest_coverline("build/resize-base/resize-base.js", 1614);-if (pNode) {- _yuitest_coverline("build/resize-base/resize-base.js", 1615);-pNode.insertBefore(wrapper, node);- }-- _yuitest_coverline("build/resize-base/resize-base.js", 1618);-wrapper.append(node);-- _yuitest_coverline("build/resize-base/resize-base.js", 1620);-instance._copyStyles(node, wrapper);-- // remove positioning of wrapped node, the WRAPPER take care about positioning- _yuitest_coverline("build/resize-base/resize-base.js", 1623);-node.setStyles({- position: STATIC,- left: 0,- top: 0- });- }-- _yuitest_coverline("build/resize-base/resize-base.js", 1630);-return wrapper;- }- }-);--_yuitest_coverline("build/resize-base/resize-base.js", 1635);-Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle, i) {- // creating ATTRS with the handles elements- _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 13)", 1635);-_yuitest_coverline("build/resize-base/resize-base.js", 1637);-Y.Resize.ATTRS[handleAttrName(handle)] = {- setter: function() {- _yuitest_coverfunc("build/resize-base/resize-base.js", "setter", 1638);-_yuitest_coverline("build/resize-base/resize-base.js", 1639);-return this._buildHandle(handle);- },- value: null,- writeOnce: true- };-});---}, '3.7.2', {"requires": ["base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop"], "skinnable": true});+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/resize-base/resize-base.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/resize-base/resize-base.js",+ code: []+};+_yuitest_coverage["build/resize-base/resize-base.js"].code=["YUI.add('resize-base', function (Y, NAME) {","","/**"," * The Resize Utility allows you to make an HTML element resizable."," * @module resize"," * @main resize"," */","","var Lang = Y.Lang,"," isArray = Lang.isArray,"," isBoolean = Lang.isBoolean,"," isNumber = Lang.isNumber,"," isString = Lang.isString,",""," yArray = Y.Array,"," trim = Lang.trim,"," indexOf = yArray.indexOf,",""," COMMA = ',',"," DOT = '.',"," EMPTY_STR = '',"," HANDLE_SUB = '{handle}',"," SPACE = ' ',",""," ACTIVE = 'active',"," ACTIVE_HANDLE = 'activeHandle',"," ACTIVE_HANDLE_NODE = 'activeHandleNode',"," ALL = 'all',"," AUTO_HIDE = 'autoHide',"," BORDER = 'border',"," BOTTOM = 'bottom',"," CLASS_NAME = 'className',"," COLOR = 'color',"," DEF_MIN_HEIGHT = 'defMinHeight',"," DEF_MIN_WIDTH = 'defMinWidth',"," HANDLE = 'handle',"," HANDLES = 'handles',"," HANDLES_WRAPPER = 'handlesWrapper',"," HIDDEN = 'hidden',"," INNER = 'inner',"," LEFT = 'left',"," MARGIN = 'margin',"," NODE = 'node',"," NODE_NAME = 'nodeName',"," NONE = 'none',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," PADDING = 'padding',"," PARENT_NODE = 'parentNode',"," POSITION = 'position',"," RELATIVE = 'relative',"," RESIZE = 'resize',"," RESIZING = 'resizing',"," RIGHT = 'right',"," STATIC = 'static',"," STYLE = 'style',"," TOP = 'top',"," WIDTH = 'width',"," WRAP = 'wrap',"," WRAPPER = 'wrapper',"," WRAP_TYPES = 'wrapTypes',",""," EV_MOUSE_UP = 'resize:mouseUp',"," EV_RESIZE = 'resize:resize',"," EV_RESIZE_ALIGN = 'resize:align',"," EV_RESIZE_END = 'resize:end',"," EV_RESIZE_START = 'resize:start',",""," T = 't',"," TR = 'tr',"," R = 'r',"," BR = 'br',"," B = 'b',"," BL = 'bl',"," L = 'l',"," TL = 'tl',",""," concat = function() {"," return Array.prototype.slice.call(arguments).join(SPACE);"," },",""," // round the passed number to get rid of pixel-flickering"," toRoundNumber = function(num) {"," return Math.round(parseFloat(num)) || 0;"," },",""," getCompStyle = function(node, val) {"," return node.getComputedStyle(val);"," },",""," handleAttrName = function(handle) {"," return HANDLE + handle.toUpperCase();"," },",""," isNode = function(v) {"," return (v instanceof Y.Node);"," },",""," toInitialCap = Y.cached("," function(str) {"," return str.substring(0, 1).toUpperCase() + str.substring(1);"," }"," ),",""," capitalize = Y.cached(function() {"," var out = [],"," args = yArray(arguments, 0, true);",""," yArray.each(args, function(part, i) {"," if (i > 0) {"," part = toInitialCap(part);"," }"," out.push(part);"," });",""," return out.join(EMPTY_STR);"," }),",""," getCN = Y.ClassNameManager.getClassName,",""," CSS_RESIZE = getCN(RESIZE),"," CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),"," CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),"," CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),"," CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),"," CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),"," CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),"," CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),"," CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);","","/**","A base class for Resize, providing:",""," * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)"," * Applies drag handles to an element to make it resizable"," * Here is the list of valid resize handles:"," `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can"," read this list as top, top-right, right, bottom-right, bottom,"," bottom-left, left, top-left."," * The drag handles are inserted into the element and positioned"," absolute. Some elements, such as a textarea or image, don't support"," children. To overcome that, set wrap:true in your config and the"," element willbe wrapped for you automatically.","","Quick Example:",""," var instance = new Y.Resize({"," node: '#resize1',"," preserveRatio: true,"," wrap: true,"," maxHeight: 170,"," maxWidth: 400,"," handles: 't, tr, r, br, b, bl, l, tl'"," });","","Check the list of <a href=\"Resize.html#configattributes\">Configuration Attributes</a> available for","Resize.","","@class Resize","@param config {Object} Object literal specifying widget configuration properties.","@constructor","@extends Base","*/","","function Resize() {"," Resize.superclass.constructor.apply(this, arguments);","}","","Y.mix(Resize, {"," /**"," * Static property provides a string to identify the class."," *"," * @property NAME"," * @type String"," * @static"," */"," NAME: RESIZE,",""," /**"," * Static property used to define the default attribute"," * configuration for the Resize."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," ATTRS: {"," /**"," * Stores the active handle during the resize."," *"," * @attribute activeHandle"," * @default null"," * @private"," * @type String"," */"," activeHandle: {"," value: null,"," validator: function(v) {"," return Y.Lang.isString(v) || Y.Lang.isNull(v);"," }"," },",""," /**"," * Stores the active handle element during the resize."," *"," * @attribute activeHandleNode"," * @default null"," * @private"," * @type Node"," */"," activeHandleNode: {"," value: null,"," validator: isNode"," },",""," /**"," * False to ensure that the resize handles are always visible, true to"," * display them only when the user mouses over the resizable borders."," *"," * @attribute autoHide"," * @default false"," * @type boolean"," */"," autoHide: {"," value: false,"," validator: isBoolean"," },",""," /**"," * The default minimum height of the element. Only used when"," * ResizeConstrained is not plugged."," *"," * @attribute defMinHeight"," * @default 15"," * @type Number"," */"," defMinHeight: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The default minimum width of the element. Only used when"," * ResizeConstrained is not plugged."," *"," * @attribute defMinWidth"," * @default 15"," * @type Number"," */"," defMinWidth: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',"," * 'br', 'tl', 'tr'. Can use a shortcut of All."," *"," * @attribute handles"," * @default all"," * @type Array | String"," */"," handles: {"," setter: '_setHandles',"," value: ALL"," },",""," /**"," * Node to wrap the resize handles."," *"," * @attribute handlesWrapper"," * @type Node"," */"," handlesWrapper: {"," readOnly: true,"," setter: Y.one,"," valueFn: '_valueHandlesWrapper'"," },",""," /**"," * The selector or element to resize. Required."," *"," * @attribute node"," * @type Node"," */"," node: {"," setter: Y.one"," },",""," /**"," * True when the element is being Resized."," *"," * @attribute resizing"," * @default false"," * @type boolean"," */"," resizing: {"," value: false,"," validator: isBoolean"," },",""," /**"," * True to wrap an element with a div if needed (required for textareas"," * and images, defaults to false) in favor of the handles config option."," * The wrapper element type (default div) could be over-riden passing the"," * <code>wrapper</code> attribute."," *"," * @attribute wrap"," * @default false"," * @type boolean"," */"," wrap: {"," setter: '_setWrap',"," value: false,"," validator: isBoolean"," },",""," /**"," * Elements that requires a wrapper by default. Normally are elements"," * which cannot have children elements."," *"," * @attribute wrapTypes"," * @default /canvas|textarea|input|select|button|img/i"," * @readOnly"," * @type Regex"," */"," wrapTypes: {"," readOnly: true,"," value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i"," },",""," /**"," * Element to wrap the <code>wrapTypes</code>. This element will house"," * the handles elements."," *"," * @attribute wrapper"," * @default div"," * @type String | Node"," * @writeOnce"," */"," wrapper: {"," readOnly: true,"," valueFn: '_valueWrapper',"," writeOnce: true"," }"," },",""," RULES: {"," b: function(instance, dx, dy) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.offsetHeight = originalInfo.offsetHeight + dy;"," },",""," l: function(instance, dx) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.left = originalInfo.left + dx;"," info.offsetWidth = originalInfo.offsetWidth - dx;"," },",""," r: function(instance, dx) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.offsetWidth = originalInfo.offsetWidth + dx;"," },",""," t: function(instance, dx, dy) {"," var info = instance.info,"," originalInfo = instance.originalInfo;",""," info.top = originalInfo.top + dy;"," info.offsetHeight = originalInfo.offsetHeight - dy;"," },",""," tr: function() {"," this.t.apply(this, arguments);"," this.r.apply(this, arguments);"," },",""," bl: function() {"," this.b.apply(this, arguments);"," this.l.apply(this, arguments);"," },",""," br: function() {"," this.b.apply(this, arguments);"," this.r.apply(this, arguments);"," },",""," tl: function() {"," this.t.apply(this, arguments);"," this.l.apply(this, arguments);"," }"," },",""," capitalize: capitalize","});","","Y.Resize = Y.extend("," Resize,"," Y.Base,"," {"," /**"," * Array containing all possible resizable handles."," *"," * @property ALL_HANDLES"," * @type {String}"," */"," ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],",""," /**"," * Regex which matches with the handles that could change the height of"," * the resizable element."," *"," * @property REGEX_CHANGE_HEIGHT"," * @type {String}"," */"," REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,",""," /**"," * Regex which matches with the handles that could change the left of"," * the resizable element."," *"," * @property REGEX_CHANGE_LEFT"," * @type {String}"," */"," REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,",""," /**"," * Regex which matches with the handles that could change the top of"," * the resizable element."," *"," * @property REGEX_CHANGE_TOP"," * @type {String}"," */"," REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,",""," /**"," * Regex which matches with the handles that could change the width of"," * the resizable element."," *"," * @property REGEX_CHANGE_WIDTH"," * @type {String}"," */"," REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,",""," /**"," * Template used to create the resize wrapper for the handles."," *"," * @property HANDLES_WRAP_TEMPLATE"," * @type {String}"," */"," HANDLES_WRAP_TEMPLATE: '<div class=\"'+CSS_RESIZE_HANDLES_WRAPPER+'\"></div>',",""," /**"," * Template used to create the resize wrapper node when needed."," *"," * @property WRAP_TEMPLATE"," * @type {String}"," */"," WRAP_TEMPLATE: '<div class=\"'+CSS_RESIZE_WRAPPER+'\"></div>',",""," /**"," * Template used to create each resize handle."," *"," * @property HANDLE_TEMPLATE"," * @type {String}"," */"," HANDLE_TEMPLATE: '<div class=\"'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'\">' +"," '<div class=\"'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'\"> </div>' +"," '</div>',","",""," /**"," * Each box has a content area and optional surrounding padding and"," * border areas. This property stores the sum of all horizontal"," * surrounding * information needed to adjust the node height."," *"," * @property totalHSurrounding"," * @default 0"," * @type number"," */"," totalHSurrounding: 0,",""," /**"," * Each box has a content area and optional surrounding padding and"," * border areas. This property stores the sum of all vertical"," * surrounding * information needed to adjust the node height."," *"," * @property totalVSurrounding"," * @default 0"," * @type number"," */"," totalVSurrounding: 0,",""," /**"," * Stores the <a href=\"Resize.html#attr_node\">node</a>"," * surrounding information retrieved from"," * <a href=\"Resize.html#method__getBoxSurroundingInfo\">_getBoxSurroundingInfo</a>."," *"," * @property nodeSurrounding"," * @type Object"," * @default null"," */"," nodeSurrounding: null,",""," /**"," * Stores the <a href=\"Resize.html#attr_wrapper\">wrapper</a>"," * surrounding information retrieved from"," * <a href=\"Resize.html#method__getBoxSurroundingInfo\">_getBoxSurroundingInfo</a>."," *"," * @property wrapperSurrounding"," * @type Object"," * @default null"," */"," wrapperSurrounding: null,",""," /**"," * Whether the handle being dragged can change the height."," *"," * @property changeHeightHandles"," * @default false"," * @type boolean"," */"," changeHeightHandles: false,",""," /**"," * Whether the handle being dragged can change the left."," *"," * @property changeLeftHandles"," * @default false"," * @type boolean"," */"," changeLeftHandles: false,",""," /**"," * Whether the handle being dragged can change the top."," *"," * @property changeTopHandles"," * @default false"," * @type boolean"," */"," changeTopHandles: false,",""," /**"," * Whether the handle being dragged can change the width."," *"," * @property changeWidthHandles"," * @default false"," * @type boolean"," */"," changeWidthHandles: false,",""," /**"," * Store DD.Delegate reference for the respective Resize instance."," *"," * @property delegate"," * @default null"," * @type Object"," */"," delegate: null,",""," /**"," * Stores the current values for the height, width, top and left. You are"," * able to manipulate these values on resize in order to change the resize"," * behavior."," *"," * @property info"," * @type Object"," * @protected"," */"," info: null,",""," /**"," * Stores the last values for the height, width, top and left."," *"," * @property lastInfo"," * @type Object"," * @protected"," */"," lastInfo: null,",""," /**"," * Stores the original values for the height, width, top and left, stored"," * on resize start."," *"," * @property originalInfo"," * @type Object"," * @protected"," */"," originalInfo: null,",""," /**"," * Construction logic executed during Resize instantiation. Lifecycle."," *"," * @method initializer"," * @protected"," */"," initializer: function() {"," this._eventHandles = [];",""," this.renderer();"," },",""," /**"," * Create the DOM structure for the Resize. Lifecycle."," *"," * @method renderUI"," * @protected"," */"," renderUI: function() {"," var instance = this;",""," instance._renderHandles();"," },",""," /**"," * Bind the events on the Resize UI. Lifecycle."," *"," * @method bindUI"," * @protected"," */"," bindUI: function() {"," var instance = this;",""," instance._createEvents();"," instance._bindDD();"," instance._bindHandle();"," },",""," /**"," * Sync the Resize UI."," *"," * @method syncUI"," * @protected"," */"," syncUI: function() {"," var instance = this;",""," this.get(NODE).addClass(CSS_RESIZE);",""," // hide handles if AUTO_HIDE is true"," instance._setHideHandlesUI("," instance.get(AUTO_HIDE)"," );"," },",""," /**"," * Destructor lifecycle implementation for the Resize class."," * Detaches all previously attached listeners and removes the Resize handles."," *"," * @method destructor"," * @protected"," */"," destructor: function() {"," var instance = this,"," node = instance.get(NODE),"," wrapper = instance.get(WRAPPER),"," pNode = wrapper.get(PARENT_NODE);",""," Y.each("," instance._eventHandles,"," function(handle) {"," handle.detach();"," }"," );",""," instance._eventHandles.length = 0;",""," // destroy handles dd and remove them from the dom"," instance.eachHandle(function(handleEl) {"," instance.delegate.dd.destroy();",""," // remove handle"," handleEl.remove(true);"," });",""," instance.delegate.destroy();",""," // unwrap node"," if (instance.get(WRAP)) {"," instance._copyStyles(wrapper, node);",""," if (pNode) {"," pNode.insertBefore(node, wrapper);"," }",""," wrapper.remove(true);"," }",""," node.removeClass(CSS_RESIZE);"," node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);"," },",""," /**"," * Creates DOM (or manipulates DOM for progressive enhancement)"," * This method is invoked by initializer(). It's chained automatically for"," * subclasses if required."," *"," * @method renderer"," * @protected"," */"," renderer: function() {"," this.renderUI();"," this.bindUI();"," this.syncUI();"," },",""," /**"," * <p>Loop through each handle which is being used and executes a callback.</p>"," * <p>Example:</p>"," * <pre><code>instance.eachHandle("," * function(handleName, index) { ... }"," * );</code></pre>"," *"," * @method eachHandle"," * @param {function} fn Callback function to be executed for each handle."," */"," eachHandle: function(fn) {"," var instance = this;",""," Y.each("," instance.get(HANDLES),"," function(handle, i) {"," var handleEl = instance.get("," handleAttrName(handle)"," );",""," fn.apply(instance, [handleEl, handle, i]);"," }"," );"," },",""," /**"," * Bind the handles DragDrop events to the Resize instance."," *"," * @method _bindDD"," * @private"," */"," _bindDD: function() {"," var instance = this;",""," instance.delegate = new Y.DD.Delegate("," {"," bubbleTargets: instance,"," container: instance.get(HANDLES_WRAPPER),"," dragConfig: {"," clickPixelThresh: 0,"," clickTimeThresh: 0,"," useShim: true,"," move: false"," },"," nodes: DOT+CSS_RESIZE_HANDLE,"," target: false"," }"," );",""," instance._eventHandles.push("," instance.on('drag:drag', instance._handleResizeEvent),"," instance.on('drag:dropmiss', instance._handleMouseUpEvent),"," instance.on('drag:end', instance._handleResizeEndEvent),"," instance.on('drag:start', instance._handleResizeStartEvent)"," );"," },",""," /**"," * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave)."," *"," * @method _bindHandle"," * @private"," */"," _bindHandle: function() {"," var instance = this,"," wrapper = instance.get(WRAPPER);",""," instance._eventHandles.push("," wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),"," wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),"," wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),"," wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)"," );"," },",""," /**"," * Create the custom events used on the Resize."," *"," * @method _createEvents"," * @private"," */"," _createEvents: function() {"," var instance = this,"," // create publish function for kweight optimization"," publish = function(name, fn) {"," instance.publish(name, {"," defaultFn: fn,"," queuable: false,"," emitFacade: true,"," bubbles: true,"," prefix: RESIZE"," });"," };",""," /**"," * Handles the resize start event. Fired when a handle starts to be"," * dragged."," *"," * @event resize:start"," * @preventable _defResizeStartFn"," * @param {Event.Facade} event The resize start event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE_START, this._defResizeStartFn);",""," /**"," * Handles the resize event. Fired on each pixel when the handle is"," * being dragged."," *"," * @event resize:resize"," * @preventable _defResizeFn"," * @param {Event.Facade} event The resize event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE, this._defResizeFn);",""," /**"," * Handles the resize align event."," *"," * @event resize:align"," * @preventable _defResizeAlignFn"," * @param {Event.Facade} event The resize align event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);",""," /**"," * Handles the resize end event. Fired when a handle stop to be"," * dragged."," *"," * @event resize:end"," * @preventable _defResizeEndFn"," * @param {Event.Facade} event The resize end event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_RESIZE_END, this._defResizeEndFn);",""," /**"," * Handles the resize mouseUp event. Fired when a mouseUp event happens on a"," * handle."," *"," * @event resize:mouseUp"," * @preventable _defMouseUpFn"," * @param {Event.Facade} event The resize mouseUp event."," * @bubbles Resize"," * @type {Event.Custom}"," */"," publish(EV_MOUSE_UP, this._defMouseUpFn);"," },",""," /**"," * Responsible for loop each handle element and append to the wrapper."," *"," * @method _renderHandles"," * @protected"," */"," _renderHandles: function() {"," var instance = this,"," wrapper = instance.get(WRAPPER),"," handlesWrapper = instance.get(HANDLES_WRAPPER);",""," instance.eachHandle(function(handleEl) {"," handlesWrapper.append(handleEl);"," });",""," wrapper.append(handlesWrapper);"," },",""," /**"," * Creates the handle element based on the handle name and initialize the"," * DragDrop on it."," *"," * @method _buildHandle"," * @param {String} handle Handle name ('t', 'tr', 'b', ...)."," * @protected"," */"," _buildHandle: function(handle) {"," var instance = this;",""," return Y.Node.create("," Y.Lang.sub(instance.HANDLE_TEMPLATE, {"," handle: handle"," })"," );"," },",""," /**"," * Basic resize calculations."," *"," * @method _calcResize"," * @protected"," */"," _calcResize: function() {"," var instance = this,"," handle = instance.handle,"," info = instance.info,"," originalInfo = instance.originalInfo,",""," dx = info.actXY[0] - originalInfo.actXY[0],"," dy = info.actXY[1] - originalInfo.actXY[1];",""," if (handle && Y.Resize.RULES[handle]) {"," Y.Resize.RULES[handle](instance, dx, dy);"," }"," else {"," }"," },",""," /**"," * Helper method to update the current size value on"," * <a href=\"Resize.html#property_info\">info</a> to respect the"," * min/max values and fix the top/left calculations."," *"," * @method _checkSize"," * @param {String} offset 'offsetHeight' or 'offsetWidth'"," * @param {number} size Size to restrict the offset"," * @protected"," */"," _checkSize: function(offset, size) {"," var instance = this,"," info = instance.info,"," originalInfo = instance.originalInfo,"," axis = (offset === OFFSET_HEIGHT) ? TOP : LEFT;",""," // forcing the offsetHeight/offsetWidth to be the passed size"," info[offset] = size;",""," // predicting, based on the original information, the last left valid in case of reach the min/max dimension"," // this calculation avoid browser event leaks when user interact very fast"," if (((axis === LEFT) && instance.changeLeftHandles) ||"," ((axis === TOP) && instance.changeTopHandles)) {",""," info[axis] = originalInfo[axis] + originalInfo[offset] - size;"," }"," },",""," /**"," * Copy relevant styles of the <a href=\"Resize.html#attr_node\">node</a>"," * to the <a href=\"Resize.html#attr_wrapper\">wrapper</a>."," *"," * @method _copyStyles"," * @param {Node} node Node from."," * @param {Node} wrapper Node to."," * @protected"," */"," _copyStyles: function(node, wrapper) {"," var position = node.getStyle(POSITION).toLowerCase(),"," surrounding = this._getBoxSurroundingInfo(node),"," wrapperStyle;",""," // resizable wrapper should be positioned"," if (position === STATIC) {"," position = RELATIVE;"," }",""," wrapperStyle = {"," position: position,"," left: getCompStyle(node, LEFT),"," top: getCompStyle(node, TOP)"," };",""," Y.mix(wrapperStyle, surrounding.margin);"," Y.mix(wrapperStyle, surrounding.border);",""," wrapper.setStyles(wrapperStyle);",""," // remove margin and border from the internal node"," node.setStyles({ border: 0, margin: 0 });",""," wrapper.sizeTo("," node.get(OFFSET_WIDTH) + surrounding.totalHBorder,"," node.get(OFFSET_HEIGHT) + surrounding.totalVBorder"," );"," },",""," // extract handle name from a string"," // using Y.cached to memoize the function for performance"," _extractHandleName: Y.cached("," function(node) {"," var className = node.get(CLASS_NAME),",""," match = className.match("," new RegExp("," getCN(RESIZE, HANDLE, '(\\\\w{1,2})\\\\b')"," )"," );",""," return match ? match[1] : null;"," }"," ),",""," /**"," * <p>Generates metadata to the <a href=\"Resize.html#property_info\">info</a>"," * and <a href=\"Resize.html#property_originalInfo\">originalInfo</a></p>"," * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>"," *"," * @method _getInfo"," * @param {Node} node"," * @param {EventFacade} event"," * @private"," */"," _getInfo: function(node, event) {"," var actXY = [0,0],"," drag = event.dragEvent.target,"," nodeXY = node.getXY(),"," nodeX = nodeXY[0],"," nodeY = nodeXY[1],"," offsetHeight = node.get(OFFSET_HEIGHT),"," offsetWidth = node.get(OFFSET_WIDTH);",""," if (event) {"," // the xy that the node will be set to. Changing this will alter the position as it's dragged."," actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);"," }",""," return {"," actXY: actXY,"," bottom: (nodeY + offsetHeight),"," left: nodeX,"," offsetHeight: offsetHeight,"," offsetWidth: offsetWidth,"," right: (nodeX + offsetWidth),"," top: nodeY"," };"," },",""," /**"," * Each box has a content area and optional surrounding margin,"," * padding and * border areas. This method get all this information from"," * the passed node. For more reference see"," * <a href=\"http://www.w3.org/TR/CSS21/box.html#box-dimensions\">"," * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>."," *"," * @method _getBoxSurroundingInfo"," * @param {Node} node"," * @private"," * @return {Object}"," */"," _getBoxSurroundingInfo: function(node) {"," var info = {"," padding: {},"," margin: {},"," border: {}"," };",""," if (isNode(node)) {"," Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {"," var paddingProperty = capitalize(PADDING, dir),"," marginProperty = capitalize(MARGIN, dir),"," borderWidthProperty = capitalize(BORDER, dir, WIDTH),"," borderColorProperty = capitalize(BORDER, dir, COLOR),"," borderStyleProperty = capitalize(BORDER, dir, STYLE);",""," info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);"," info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);"," info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);"," info.margin[marginProperty] = getCompStyle(node, marginProperty);"," info.padding[paddingProperty] = getCompStyle(node, paddingProperty);"," });"," }",""," info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));"," info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));"," info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));"," info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));",""," return info;"," },",""," /**"," * Sync the Resize UI with internal values from"," * <a href=\"Resize.html#property_info\">info</a>."," *"," * @method _syncUI"," * @protected"," */"," _syncUI: function() {"," var instance = this,"," info = instance.info,"," wrapperSurrounding = instance.wrapperSurrounding,"," wrapper = instance.get(WRAPPER),"," node = instance.get(NODE);",""," wrapper.sizeTo(info.offsetWidth, info.offsetHeight);",""," if (instance.changeLeftHandles || instance.changeTopHandles) {"," wrapper.setXY([info.left, info.top]);"," }",""," // if a wrap node is being used"," if (!wrapper.compareTo(node)) {"," // the original internal node borders were copied to the wrapper on"," // _copyStyles, to compensate that subtract the borders from the internal node"," node.sizeTo("," info.offsetWidth - wrapperSurrounding.totalHBorder,"," info.offsetHeight - wrapperSurrounding.totalVBorder"," );"," }",""," // prevent webkit textarea resize"," if (Y.UA.webkit) {"," node.setStyle(RESIZE, NONE);"," }"," },",""," /**"," * Update <code>instance.changeHeightHandles,"," * instance.changeLeftHandles, instance.changeTopHandles,"," * instance.changeWidthHandles</code> information."," *"," * @method _updateChangeHandleInfo"," * @private"," */"," _updateChangeHandleInfo: function(handle) {"," var instance = this;",""," instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);"," instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);"," instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);"," instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);"," },",""," /**"," * Update <a href=\"Resize.html#property_info\">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right)."," *"," * @method _updateInfo"," * @private"," */"," _updateInfo: function(event) {"," var instance = this;",""," instance.info = instance._getInfo(instance.get(WRAPPER), event);"," },",""," /**"," * Update properties"," * <a href=\"Resize.html#property_nodeSurrounding\">nodeSurrounding</a>,"," * <a href=\"Resize.html#property_nodeSurrounding\">wrapperSurrounding</a>,"," * <a href=\"Resize.html#property_nodeSurrounding\">totalVSurrounding</a>,"," * <a href=\"Resize.html#property_nodeSurrounding\">totalHSurrounding</a>."," *"," * @method _updateSurroundingInfo"," * @private"," */"," _updateSurroundingInfo: function() {"," var instance = this,"," node = instance.get(NODE),"," wrapper = instance.get(WRAPPER),"," nodeSurrounding = instance._getBoxSurroundingInfo(node),"," wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);",""," instance.nodeSurrounding = nodeSurrounding;"," instance.wrapperSurrounding = wrapperSurrounding;",""," instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);"," instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);"," },",""," /**"," * Set the active state of the handles."," *"," * @method _setActiveHandlesUI"," * @param {boolean} val True to activate the handles, false to deactivate."," * @protected"," */"," _setActiveHandlesUI: function(val) {"," var instance = this,"," activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);",""," if (activeHandleNode) {"," if (val) {"," // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active"," instance.eachHandle("," function(handleEl) {"," handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);"," }"," );",""," activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);"," }"," else {"," activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);"," }"," }"," },",""," /**"," * Setter for the handles attribute"," *"," * @method _setHandles"," * @protected"," * @param {String} val"," */"," _setHandles: function(val) {"," var instance = this,"," handles = [];",""," // handles attr accepts both array or string"," if (isArray(val)) {"," handles = val;"," }"," else if (isString(val)) {"," // if the handles attr passed in is an ALL string..."," if (val.toLowerCase() === ALL) {"," handles = instance.ALL_HANDLES;"," }"," // otherwise, split the string to extract the handles"," else {"," Y.each("," val.split(COMMA),"," function(node) {"," var handle = trim(node);",""," // if its a valid handle, add it to the handles output"," if (indexOf(instance.ALL_HANDLES, handle) > -1) {"," handles.push(handle);"," }"," }"," );"," }"," }",""," return handles;"," },",""," /**"," * Set the visibility of the handles."," *"," * @method _setHideHandlesUI"," * @param {boolean} val True to hide the handles, false to show."," * @protected"," */"," _setHideHandlesUI: function(val) {"," var instance = this,"," wrapper = instance.get(WRAPPER);",""," if (!instance.get(RESIZING)) {"," if (val) {"," wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);"," }"," else {"," wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);"," }"," }"," },",""," /**"," * Setter for the wrap attribute"," *"," * @method _setWrap"," * @protected"," * @param {boolean} val"," */"," _setWrap: function(val) {"," var instance = this,"," node = instance.get(NODE),"," nodeName = node.get(NODE_NAME),"," typeRegex = instance.get(WRAP_TYPES);",""," // if nodeName is listed on WRAP_TYPES force use the wrapper"," if (typeRegex.test(nodeName)) {"," val = true;"," }",""," return val;"," },",""," /**"," * Default resize:mouseUp handler"," *"," * @method _defMouseUpFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defMouseUpFn: function() {"," var instance = this;",""," instance.set(RESIZING, false);"," },",""," /**"," * Default resize:resize handler"," *"," * @method _defResizeFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeFn: function(event) {"," var instance = this;",""," instance._resize(event);"," },",""," /**"," * Logic method for _defResizeFn. Allow AOP."," *"," * @method _resize"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resize: function(event) {"," var instance = this;",""," instance._handleResizeAlignEvent(event.dragEvent);",""," // _syncUI of the wrapper, not using proxy"," instance._syncUI();"," },",""," /**"," * Default resize:align handler"," *"," * @method _defResizeAlignFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeAlignFn: function(event) {"," var instance = this;",""," instance._resizeAlign(event);"," },",""," /**"," * Logic method for _defResizeAlignFn. Allow AOP."," *"," * @method _resizeAlign"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resizeAlign: function(event) {"," var instance = this,"," info,"," defMinHeight,"," defMinWidth;",""," instance.lastInfo = instance.info;",""," // update the instance.info values"," instance._updateInfo(event);",""," info = instance.info;",""," // basic resize calculations"," instance._calcResize();",""," // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension"," if (!instance.con) {"," defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);"," defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);",""," if (info.offsetHeight <= defMinHeight) {"," instance._checkSize(OFFSET_HEIGHT, defMinHeight);"," }",""," if (info.offsetWidth <= defMinWidth) {"," instance._checkSize(OFFSET_WIDTH, defMinWidth);"," }"," }"," },",""," /**"," * Default resize:end handler"," *"," * @method _defResizeEndFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeEndFn: function(event) {"," var instance = this;",""," instance._resizeEnd(event);"," },",""," /**"," * Logic method for _defResizeEndFn. Allow AOP."," *"," * @method _resizeEnd"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resizeEnd: function(event) {"," var instance = this,"," drag = event.dragEvent.target;",""," // reseting actXY from drag when drag end"," drag.actXY = [];",""," // syncUI when resize end"," instance._syncUI();",""," instance._setActiveHandlesUI(false);",""," instance.set(ACTIVE_HANDLE, null);"," instance.set(ACTIVE_HANDLE_NODE, null);",""," instance.handle = null;"," },",""," /**"," * Default resize:start handler"," *"," * @method _defResizeStartFn"," * @param {EventFacade} event The Event object"," * @protected"," */"," _defResizeStartFn: function(event) {"," var instance = this;",""," instance._resizeStart(event);"," },",""," /**"," * Logic method for _defResizeStartFn. Allow AOP."," *"," * @method _resizeStart"," * @param {EventFacade} event The Event object"," * @protected"," */"," _resizeStart: function(event) {"," var instance = this,"," wrapper = instance.get(WRAPPER);",""," instance.handle = instance.get(ACTIVE_HANDLE);",""," instance.set(RESIZING, true);",""," instance._updateSurroundingInfo();",""," // create an originalInfo information for reference"," instance.originalInfo = instance._getInfo(wrapper, event);",""," instance._updateInfo(event);"," },",""," /**"," * Fires the resize:mouseUp event."," *"," * @method _handleMouseUpEvent"," * @param {EventFacade} event resize:mouseUp event facade"," * @protected"," */"," _handleMouseUpEvent: function(event) {"," this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:resize event."," *"," * @method _handleResizeEvent"," * @param {EventFacade} event resize:resize event facade"," * @protected"," */"," _handleResizeEvent: function(event) {"," this.fire(EV_RESIZE, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:align event."," *"," * @method _handleResizeAlignEvent"," * @param {EventFacade} event resize:resize event facade"," * @protected"," */"," _handleResizeAlignEvent: function(event) {"," this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:end event."," *"," * @method _handleResizeEndEvent"," * @param {EventFacade} event resize:end event facade"," * @protected"," */"," _handleResizeEndEvent: function(event) {"," this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });"," },",""," /**"," * Fires the resize:start event."," *"," * @method _handleResizeStartEvent"," * @param {EventFacade} event resize:start event facade"," * @protected"," */"," _handleResizeStartEvent: function(event) {"," if (!this.get(ACTIVE_HANDLE)) {"," //This handles the \"touch\" case"," this._setHandleFromNode(event.target.get('node'));"," }"," this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });"," },",""," /**"," * Mouseenter event handler for the <a href=\"Resize.html#attr_wrapper\">wrapper</a>."," *"," * @method _onWrapperMouseEnter"," * @param {EventFacade} event"," * @protected"," */"," _onWrapperMouseEnter: function() {"," var instance = this;",""," if (instance.get(AUTO_HIDE)) {"," instance._setHideHandlesUI(false);"," }"," },",""," /**"," * Mouseleave event handler for the <a href=\"Resize.html#attr_wrapper\">wrapper</a>."," *"," * @method _onWrapperMouseLeave"," * @param {EventFacade} event"," * @protected"," */"," _onWrapperMouseLeave: function() {"," var instance = this;",""," if (instance.get(AUTO_HIDE)) {"," instance._setHideHandlesUI(true);"," }"," },",""," /**"," * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse)."," *"," * @method _setHandleFromNode"," * @param {Node} node"," * @protected"," */"," _setHandleFromNode: function(node) {"," var instance = this,"," handle = instance._extractHandleName(node);",""," if (!instance.get(RESIZING)) {"," instance.set(ACTIVE_HANDLE, handle);"," instance.set(ACTIVE_HANDLE_NODE, node);",""," instance._setActiveHandlesUI(true);"," instance._updateChangeHandleInfo(handle);"," }"," },",""," /**"," * Mouseenter event handler for the handles."," *"," * @method _onHandleMouseEnter"," * @param {EventFacade} event"," * @protected"," */"," _onHandleMouseEnter: function(event) {"," this._setHandleFromNode(event.currentTarget);"," },",""," /**"," * Mouseout event handler for the handles."," *"," * @method _onHandleMouseLeave"," * @param {EventFacade} event"," * @protected"," */"," _onHandleMouseLeave: function() {"," var instance = this;",""," if (!instance.get(RESIZING)) {"," instance._setActiveHandlesUI(false);"," }"," },",""," /**"," * Default value for the wrapper handles node attribute"," *"," * @method _valueHandlesWrapper"," * @protected"," * @readOnly"," */"," _valueHandlesWrapper: function() {"," return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);"," },",""," /**"," * Default value for the wrapper attribute"," *"," * @method _valueWrapper"," * @protected"," * @readOnly"," */"," _valueWrapper: function() {"," var instance = this,"," node = instance.get(NODE),"," pNode = node.get(PARENT_NODE),"," // by deafult the wrapper is always the node"," wrapper = node;",""," // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper"," if (instance.get(WRAP)) {"," wrapper = Y.Node.create(instance.WRAP_TEMPLATE);",""," if (pNode) {"," pNode.insertBefore(wrapper, node);"," }",""," wrapper.append(node);",""," instance._copyStyles(node, wrapper);",""," // remove positioning of wrapped node, the WRAPPER take care about positioning"," node.setStyles({"," position: STATIC,"," left: 0,"," top: 0"," });"," }",""," return wrapper;"," }"," }",");","","Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle) {"," // creating ATTRS with the handles elements"," Y.Resize.ATTRS[handleAttrName(handle)] = {"," setter: function() {"," return this._buildHandle(handle);"," },"," value: null,"," writeOnce: true"," };","});","","","}, '3.7.3', {\"requires\": [\"base\", \"widget\", \"event\", \"oop\", \"dd-drag\", \"dd-delegate\", \"dd-drop\"], \"skinnable\": true});"];+_yuitest_coverage["build/resize-base/resize-base.js"].lines = {"1":0,"9":0,"79":0,"84":0,"88":0,"92":0,"96":0,"101":0,"106":0,"109":0,"110":0,"111":0,"113":0,"116":0,"165":0,"166":0,"169":0,"199":0,"350":0,"353":0,"357":0,"360":0,"361":0,"365":0,"368":0,"372":0,"375":0,"376":0,"380":0,"381":0,"385":0,"386":0,"390":0,"391":0,"395":0,"396":0,"403":0,"604":0,"606":0,"616":0,"618":0,"628":0,"630":0,"631":0,"632":0,"642":0,"644":0,"647":0,"660":0,"665":0,"668":0,"672":0,"675":0,"676":0,"679":0,"682":0,"685":0,"686":0,"688":0,"689":0,"692":0,"695":0,"696":0,"708":0,"709":0,"710":0,"724":0,"726":0,"729":0,"733":0,"745":0,"747":0,"762":0,"777":0,"780":0,"795":0,"798":0,"817":0,"829":0,"840":0,"852":0,"864":0,"874":0,"878":0,"879":0,"882":0,"894":0,"896":0,"910":0,"918":0,"919":0,"936":0,"942":0,"946":0,"949":0,"963":0,"968":0,"969":0,"972":0,"978":0,"979":0,"981":0,"984":0,"986":0,"996":0,"1004":0,"1019":0,"1027":0,"1029":0,"1032":0,"1056":0,"1062":0,"1063":0,"1064":0,"1070":0,"1071":0,"1072":0,"1073":0,"1074":0,"1078":0,"1079":0,"1080":0,"1081":0,"1083":0,"1094":0,"1100":0,"1102":0,"1103":0,"1107":0,"1110":0,"1117":0,"1118":0,"1131":0,"1133":0,"1134":0,"1135":0,"1136":0,"1146":0,"1148":0,"1162":0,"1168":0,"1169":0,"1171":0,"1172":0,"1183":0,"1186":0,"1187":0,"1189":0,"1191":0,"1195":0,"1198":0,"1211":0,"1215":0,"1216":0,"1218":0,"1220":0,"1221":0,"1225":0,"1228":0,"1231":0,"1232":0,"1239":0,"1250":0,"1253":0,"1254":0,"1255":0,"1258":0,"1271":0,"1277":0,"1278":0,"1281":0,"1292":0,"1294":0,"1305":0,"1307":0,"1318":0,"1320":0,"1323":0,"1334":0,"1336":0,"1347":0,"1352":0,"1355":0,"1357":0,"1360":0,"1363":0,"1364":0,"1365":0,"1367":0,"1368":0,"1371":0,"1372":0,"1385":0,"1387":0,"1398":0,"1402":0,"1405":0,"1407":0,"1409":0,"1410":0,"1412":0,"1423":0,"1425":0,"1436":0,"1439":0,"1441":0,"1443":0,"1446":0,"1448":0,"1459":0,"1470":0,"1481":0,"1492":0,"1503":0,"1505":0,"1507":0,"1518":0,"1520":0,"1521":0,"1533":0,"1535":0,"1536":0,"1548":0,"1551":0,"1552":0,"1553":0,"1555":0,"1556":0,"1568":0,"1579":0,"1581":0,"1582":0,"1594":0,"1605":0,"1612":0,"1613":0,"1615":0,"1616":0,"1619":0,"1621":0,"1624":0,"1631":0,"1636":0,"1638":0,"1640":0};+_yuitest_coverage["build/resize-base/resize-base.js"].functions = {"concat:78":0,"toRoundNumber:83":0,"getCompStyle:87":0,"handleAttrName:91":0,"isNode:95":0,"(anonymous 2):100":0,"(anonymous 4):109":0,"(anonymous 3):105":0,"Resize:165":0,"validator:198":0,"b:349":0,"l:356":0,"r:364":0,"t:371":0,"tr:379":0,"bl:384":0,"br:389":0,"tl:394":0,"initializer:603":0,"renderUI:615":0,"bindUI:627":0,"syncUI:641":0,"(anonymous 5):667":0,"(anonymous 6):675":0,"destructor:659":0,"renderer:707":0,"(anonymous 7):728":0,"eachHandle:723":0,"_bindDD:744":0,"_bindHandle:776":0,"publish:797":0,"_createEvents:794":0,"(anonymous 8):878":0,"_renderHandles:873":0,"_buildHandle:893":0,"_calcResize:909":0,"_checkSize:935":0,"_copyStyles:962":0,"(anonymous 9):995":0,"_getInfo:1018":0,"(anonymous 10):1063":0,"_getBoxSurroundingInfo:1055":0,"_syncUI:1093":0,"_updateChangeHandleInfo:1130":0,"_updateInfo:1145":0,"_updateSurroundingInfo:1161":0,"(anonymous 11):1190":0,"_setActiveHandlesUI:1182":0,"(anonymous 12):1227":0,"_setHandles:1210":0,"_setHideHandlesUI:1249":0,"_setWrap:1270":0,"_defMouseUpFn:1291":0,"_defResizeFn:1304":0,"_resize:1317":0,"_defResizeAlignFn:1333":0,"_resizeAlign:1346":0,"_defResizeEndFn:1384":0,"_resizeEnd:1397":0,"_defResizeStartFn:1422":0,"_resizeStart:1435":0,"_handleMouseUpEvent:1458":0,"_handleResizeEvent:1469":0,"_handleResizeAlignEvent:1480":0,"_handleResizeEndEvent:1491":0,"_handleResizeStartEvent:1502":0,"_onWrapperMouseEnter:1517":0,"_onWrapperMouseLeave:1532":0,"_setHandleFromNode:1547":0,"_onHandleMouseEnter:1567":0,"_onHandleMouseLeave:1578":0,"_valueHandlesWrapper:1593":0,"_valueWrapper:1604":0,"setter:1639":0,"(anonymous 13):1636":0,"(anonymous 1):1":0};+_yuitest_coverage["build/resize-base/resize-base.js"].coveredLines = 245;+_yuitest_coverage["build/resize-base/resize-base.js"].coveredFunctions = 76;+_yuitest_coverline("build/resize-base/resize-base.js", 1);+YUI.add('resize-base', function (Y, NAME) {++/**+ * The Resize Utility allows you to make an HTML element resizable.+ * @module resize+ * @main resize+ */++_yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 1)", 1);+_yuitest_coverline("build/resize-base/resize-base.js", 9);+var Lang = Y.Lang,+ isArray = Lang.isArray,+ isBoolean = Lang.isBoolean,+ isNumber = Lang.isNumber,+ isString = Lang.isString,++ yArray = Y.Array,+ trim = Lang.trim,+ indexOf = yArray.indexOf,++ COMMA = ',',+ DOT = '.',+ EMPTY_STR = '',+ HANDLE_SUB = '{handle}',+ SPACE = ' ',++ ACTIVE = 'active',+ ACTIVE_HANDLE = 'activeHandle',+ ACTIVE_HANDLE_NODE = 'activeHandleNode',+ ALL = 'all',+ AUTO_HIDE = 'autoHide',+ BORDER = 'border',+ BOTTOM = 'bottom',+ CLASS_NAME = 'className',+ COLOR = 'color',+ DEF_MIN_HEIGHT = 'defMinHeight',+ DEF_MIN_WIDTH = 'defMinWidth',+ HANDLE = 'handle',+ HANDLES = 'handles',+ HANDLES_WRAPPER = 'handlesWrapper',+ HIDDEN = 'hidden',+ INNER = 'inner',+ LEFT = 'left',+ MARGIN = 'margin',+ NODE = 'node',+ NODE_NAME = 'nodeName',+ NONE = 'none',+ OFFSET_HEIGHT = 'offsetHeight',+ OFFSET_WIDTH = 'offsetWidth',+ PADDING = 'padding',+ PARENT_NODE = 'parentNode',+ POSITION = 'position',+ RELATIVE = 'relative',+ RESIZE = 'resize',+ RESIZING = 'resizing',+ RIGHT = 'right',+ STATIC = 'static',+ STYLE = 'style',+ TOP = 'top',+ WIDTH = 'width',+ WRAP = 'wrap',+ WRAPPER = 'wrapper',+ WRAP_TYPES = 'wrapTypes',++ EV_MOUSE_UP = 'resize:mouseUp',+ EV_RESIZE = 'resize:resize',+ EV_RESIZE_ALIGN = 'resize:align',+ EV_RESIZE_END = 'resize:end',+ EV_RESIZE_START = 'resize:start',++ T = 't',+ TR = 'tr',+ R = 'r',+ BR = 'br',+ B = 'b',+ BL = 'bl',+ L = 'l',+ TL = 'tl',++ concat = function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "concat", 78);+_yuitest_coverline("build/resize-base/resize-base.js", 79);+return Array.prototype.slice.call(arguments).join(SPACE);+ },++ // round the passed number to get rid of pixel-flickering+ toRoundNumber = function(num) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "toRoundNumber", 83);+_yuitest_coverline("build/resize-base/resize-base.js", 84);+return Math.round(parseFloat(num)) || 0;+ },++ getCompStyle = function(node, val) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "getCompStyle", 87);+_yuitest_coverline("build/resize-base/resize-base.js", 88);+return node.getComputedStyle(val);+ },++ handleAttrName = function(handle) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "handleAttrName", 91);+_yuitest_coverline("build/resize-base/resize-base.js", 92);+return HANDLE + handle.toUpperCase();+ },++ isNode = function(v) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "isNode", 95);+_yuitest_coverline("build/resize-base/resize-base.js", 96);+return (v instanceof Y.Node);+ },++ toInitialCap = Y.cached(+ function(str) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 2)", 100);+_yuitest_coverline("build/resize-base/resize-base.js", 101);+return str.substring(0, 1).toUpperCase() + str.substring(1);+ }+ ),++ capitalize = Y.cached(function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 3)", 105);+_yuitest_coverline("build/resize-base/resize-base.js", 106);+var out = [],+ args = yArray(arguments, 0, true);++ _yuitest_coverline("build/resize-base/resize-base.js", 109);+yArray.each(args, function(part, i) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 4)", 109);+_yuitest_coverline("build/resize-base/resize-base.js", 110);+if (i > 0) {+ _yuitest_coverline("build/resize-base/resize-base.js", 111);+part = toInitialCap(part);+ }+ _yuitest_coverline("build/resize-base/resize-base.js", 113);+out.push(part);+ });++ _yuitest_coverline("build/resize-base/resize-base.js", 116);+return out.join(EMPTY_STR);+ }),++ getCN = Y.ClassNameManager.getClassName,++ CSS_RESIZE = getCN(RESIZE),+ CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),+ CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),+ CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),+ CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),+ CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),+ CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),+ CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),+ CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);++/**+A base class for Resize, providing:++ * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)+ * Applies drag handles to an element to make it resizable+ * Here is the list of valid resize handles:+ `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can+ read this list as top, top-right, right, bottom-right, bottom,+ bottom-left, left, top-left.+ * The drag handles are inserted into the element and positioned+ absolute. Some elements, such as a textarea or image, don't support+ children. To overcome that, set wrap:true in your config and the+ element willbe wrapped for you automatically.++Quick Example:++ var instance = new Y.Resize({+ node: '#resize1',+ preserveRatio: true,+ wrap: true,+ maxHeight: 170,+ maxWidth: 400,+ handles: 't, tr, r, br, b, bl, l, tl'+ });++Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for+Resize.++@class Resize+@param config {Object} Object literal specifying widget configuration properties.+@constructor+@extends Base+*/++_yuitest_coverline("build/resize-base/resize-base.js", 165);+function Resize() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "Resize", 165);+_yuitest_coverline("build/resize-base/resize-base.js", 166);+Resize.superclass.constructor.apply(this, arguments);+}++_yuitest_coverline("build/resize-base/resize-base.js", 169);+Y.mix(Resize, {+ /**+ * Static property provides a string to identify the class.+ *+ * @property NAME+ * @type String+ * @static+ */+ NAME: RESIZE,++ /**+ * Static property used to define the default attribute+ * configuration for the Resize.+ *+ * @property ATTRS+ * @type Object+ * @static+ */+ ATTRS: {+ /**+ * Stores the active handle during the resize.+ *+ * @attribute activeHandle+ * @default null+ * @private+ * @type String+ */+ activeHandle: {+ value: null,+ validator: function(v) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "validator", 198);+_yuitest_coverline("build/resize-base/resize-base.js", 199);+return Y.Lang.isString(v) || Y.Lang.isNull(v);+ }+ },++ /**+ * Stores the active handle element during the resize.+ *+ * @attribute activeHandleNode+ * @default null+ * @private+ * @type Node+ */+ activeHandleNode: {+ value: null,+ validator: isNode+ },++ /**+ * False to ensure that the resize handles are always visible, true to+ * display them only when the user mouses over the resizable borders.+ *+ * @attribute autoHide+ * @default false+ * @type boolean+ */+ autoHide: {+ value: false,+ validator: isBoolean+ },++ /**+ * The default minimum height of the element. Only used when+ * ResizeConstrained is not plugged.+ *+ * @attribute defMinHeight+ * @default 15+ * @type Number+ */+ defMinHeight: {+ value: 15,+ validator: isNumber+ },++ /**+ * The default minimum width of the element. Only used when+ * ResizeConstrained is not plugged.+ *+ * @attribute defMinWidth+ * @default 15+ * @type Number+ */+ defMinWidth: {+ value: 15,+ validator: isNumber+ },++ /**+ * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',+ * 'br', 'tl', 'tr'. Can use a shortcut of All.+ *+ * @attribute handles+ * @default all+ * @type Array | String+ */+ handles: {+ setter: '_setHandles',+ value: ALL+ },++ /**+ * Node to wrap the resize handles.+ *+ * @attribute handlesWrapper+ * @type Node+ */+ handlesWrapper: {+ readOnly: true,+ setter: Y.one,+ valueFn: '_valueHandlesWrapper'+ },++ /**+ * The selector or element to resize. Required.+ *+ * @attribute node+ * @type Node+ */+ node: {+ setter: Y.one+ },++ /**+ * True when the element is being Resized.+ *+ * @attribute resizing+ * @default false+ * @type boolean+ */+ resizing: {+ value: false,+ validator: isBoolean+ },++ /**+ * True to wrap an element with a div if needed (required for textareas+ * and images, defaults to false) in favor of the handles config option.+ * The wrapper element type (default div) could be over-riden passing the+ * <code>wrapper</code> attribute.+ *+ * @attribute wrap+ * @default false+ * @type boolean+ */+ wrap: {+ setter: '_setWrap',+ value: false,+ validator: isBoolean+ },++ /**+ * Elements that requires a wrapper by default. Normally are elements+ * which cannot have children elements.+ *+ * @attribute wrapTypes+ * @default /canvas|textarea|input|select|button|img/i+ * @readOnly+ * @type Regex+ */+ wrapTypes: {+ readOnly: true,+ value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i+ },++ /**+ * Element to wrap the <code>wrapTypes</code>. This element will house+ * the handles elements.+ *+ * @attribute wrapper+ * @default div+ * @type String | Node+ * @writeOnce+ */+ wrapper: {+ readOnly: true,+ valueFn: '_valueWrapper',+ writeOnce: true+ }+ },++ RULES: {+ b: function(instance, dx, dy) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "b", 349);+_yuitest_coverline("build/resize-base/resize-base.js", 350);+var info = instance.info,+ originalInfo = instance.originalInfo;++ _yuitest_coverline("build/resize-base/resize-base.js", 353);+info.offsetHeight = originalInfo.offsetHeight + dy;+ },++ l: function(instance, dx) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "l", 356);+_yuitest_coverline("build/resize-base/resize-base.js", 357);+var info = instance.info,+ originalInfo = instance.originalInfo;++ _yuitest_coverline("build/resize-base/resize-base.js", 360);+info.left = originalInfo.left + dx;+ _yuitest_coverline("build/resize-base/resize-base.js", 361);+info.offsetWidth = originalInfo.offsetWidth - dx;+ },++ r: function(instance, dx) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "r", 364);+_yuitest_coverline("build/resize-base/resize-base.js", 365);+var info = instance.info,+ originalInfo = instance.originalInfo;++ _yuitest_coverline("build/resize-base/resize-base.js", 368);+info.offsetWidth = originalInfo.offsetWidth + dx;+ },++ t: function(instance, dx, dy) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "t", 371);+_yuitest_coverline("build/resize-base/resize-base.js", 372);+var info = instance.info,+ originalInfo = instance.originalInfo;++ _yuitest_coverline("build/resize-base/resize-base.js", 375);+info.top = originalInfo.top + dy;+ _yuitest_coverline("build/resize-base/resize-base.js", 376);+info.offsetHeight = originalInfo.offsetHeight - dy;+ },++ tr: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "tr", 379);+_yuitest_coverline("build/resize-base/resize-base.js", 380);+this.t.apply(this, arguments);+ _yuitest_coverline("build/resize-base/resize-base.js", 381);+this.r.apply(this, arguments);+ },++ bl: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "bl", 384);+_yuitest_coverline("build/resize-base/resize-base.js", 385);+this.b.apply(this, arguments);+ _yuitest_coverline("build/resize-base/resize-base.js", 386);+this.l.apply(this, arguments);+ },++ br: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "br", 389);+_yuitest_coverline("build/resize-base/resize-base.js", 390);+this.b.apply(this, arguments);+ _yuitest_coverline("build/resize-base/resize-base.js", 391);+this.r.apply(this, arguments);+ },++ tl: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "tl", 394);+_yuitest_coverline("build/resize-base/resize-base.js", 395);+this.t.apply(this, arguments);+ _yuitest_coverline("build/resize-base/resize-base.js", 396);+this.l.apply(this, arguments);+ }+ },++ capitalize: capitalize+});++_yuitest_coverline("build/resize-base/resize-base.js", 403);+Y.Resize = Y.extend(+ Resize,+ Y.Base,+ {+ /**+ * Array containing all possible resizable handles.+ *+ * @property ALL_HANDLES+ * @type {String}+ */+ ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],++ /**+ * Regex which matches with the handles that could change the height of+ * the resizable element.+ *+ * @property REGEX_CHANGE_HEIGHT+ * @type {String}+ */+ REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,++ /**+ * Regex which matches with the handles that could change the left of+ * the resizable element.+ *+ * @property REGEX_CHANGE_LEFT+ * @type {String}+ */+ REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,++ /**+ * Regex which matches with the handles that could change the top of+ * the resizable element.+ *+ * @property REGEX_CHANGE_TOP+ * @type {String}+ */+ REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,++ /**+ * Regex which matches with the handles that could change the width of+ * the resizable element.+ *+ * @property REGEX_CHANGE_WIDTH+ * @type {String}+ */+ REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,++ /**+ * Template used to create the resize wrapper for the handles.+ *+ * @property HANDLES_WRAP_TEMPLATE+ * @type {String}+ */+ HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>',++ /**+ * Template used to create the resize wrapper node when needed.+ *+ * @property WRAP_TEMPLATE+ * @type {String}+ */+ WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>',++ /**+ * Template used to create each resize handle.+ *+ * @property HANDLE_TEMPLATE+ * @type {String}+ */+ HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' ++ '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' ++ '</div>',+++ /**+ * Each box has a content area and optional surrounding padding and+ * border areas. This property stores the sum of all horizontal+ * surrounding * information needed to adjust the node height.+ *+ * @property totalHSurrounding+ * @default 0+ * @type number+ */+ totalHSurrounding: 0,++ /**+ * Each box has a content area and optional surrounding padding and+ * border areas. This property stores the sum of all vertical+ * surrounding * information needed to adjust the node height.+ *+ * @property totalVSurrounding+ * @default 0+ * @type number+ */+ totalVSurrounding: 0,++ /**+ * Stores the <a href="Resize.html#attr_node">node</a>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property nodeSurrounding+ * @type Object+ * @default null+ */+ nodeSurrounding: null,++ /**+ * Stores the <a href="Resize.html#attr_wrapper">wrapper</a>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property wrapperSurrounding+ * @type Object+ * @default null+ */+ wrapperSurrounding: null,++ /**+ * Whether the handle being dragged can change the height.+ *+ * @property changeHeightHandles+ * @default false+ * @type boolean+ */+ changeHeightHandles: false,++ /**+ * Whether the handle being dragged can change the left.+ *+ * @property changeLeftHandles+ * @default false+ * @type boolean+ */+ changeLeftHandles: false,++ /**+ * Whether the handle being dragged can change the top.+ *+ * @property changeTopHandles+ * @default false+ * @type boolean+ */+ changeTopHandles: false,++ /**+ * Whether the handle being dragged can change the width.+ *+ * @property changeWidthHandles+ * @default false+ * @type boolean+ */+ changeWidthHandles: false,++ /**+ * Store DD.Delegate reference for the respective Resize instance.+ *+ * @property delegate+ * @default null+ * @type Object+ */+ delegate: null,++ /**+ * Stores the current values for the height, width, top and left. You are+ * able to manipulate these values on resize in order to change the resize+ * behavior.+ *+ * @property info+ * @type Object+ * @protected+ */+ info: null,++ /**+ * Stores the last values for the height, width, top and left.+ *+ * @property lastInfo+ * @type Object+ * @protected+ */+ lastInfo: null,++ /**+ * Stores the original values for the height, width, top and left, stored+ * on resize start.+ *+ * @property originalInfo+ * @type Object+ * @protected+ */+ originalInfo: null,++ /**+ * Construction logic executed during Resize instantiation. Lifecycle.+ *+ * @method initializer+ * @protected+ */+ initializer: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "initializer", 603);+_yuitest_coverline("build/resize-base/resize-base.js", 604);+this._eventHandles = [];++ _yuitest_coverline("build/resize-base/resize-base.js", 606);+this.renderer();+ },++ /**+ * Create the DOM structure for the Resize. Lifecycle.+ *+ * @method renderUI+ * @protected+ */+ renderUI: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "renderUI", 615);+_yuitest_coverline("build/resize-base/resize-base.js", 616);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 618);+instance._renderHandles();+ },++ /**+ * Bind the events on the Resize UI. Lifecycle.+ *+ * @method bindUI+ * @protected+ */+ bindUI: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "bindUI", 627);+_yuitest_coverline("build/resize-base/resize-base.js", 628);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 630);+instance._createEvents();+ _yuitest_coverline("build/resize-base/resize-base.js", 631);+instance._bindDD();+ _yuitest_coverline("build/resize-base/resize-base.js", 632);+instance._bindHandle();+ },++ /**+ * Sync the Resize UI.+ *+ * @method syncUI+ * @protected+ */+ syncUI: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "syncUI", 641);+_yuitest_coverline("build/resize-base/resize-base.js", 642);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 644);+this.get(NODE).addClass(CSS_RESIZE);++ // hide handles if AUTO_HIDE is true+ _yuitest_coverline("build/resize-base/resize-base.js", 647);+instance._setHideHandlesUI(+ instance.get(AUTO_HIDE)+ );+ },++ /**+ * Destructor lifecycle implementation for the Resize class.+ * Detaches all previously attached listeners and removes the Resize handles.+ *+ * @method destructor+ * @protected+ */+ destructor: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "destructor", 659);+_yuitest_coverline("build/resize-base/resize-base.js", 660);+var instance = this,+ node = instance.get(NODE),+ wrapper = instance.get(WRAPPER),+ pNode = wrapper.get(PARENT_NODE);++ _yuitest_coverline("build/resize-base/resize-base.js", 665);+Y.each(+ instance._eventHandles,+ function(handle) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 5)", 667);+_yuitest_coverline("build/resize-base/resize-base.js", 668);+handle.detach();+ }+ );++ _yuitest_coverline("build/resize-base/resize-base.js", 672);+instance._eventHandles.length = 0;++ // destroy handles dd and remove them from the dom+ _yuitest_coverline("build/resize-base/resize-base.js", 675);+instance.eachHandle(function(handleEl) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 6)", 675);+_yuitest_coverline("build/resize-base/resize-base.js", 676);+instance.delegate.dd.destroy();++ // remove handle+ _yuitest_coverline("build/resize-base/resize-base.js", 679);+handleEl.remove(true);+ });++ _yuitest_coverline("build/resize-base/resize-base.js", 682);+instance.delegate.destroy();++ // unwrap node+ _yuitest_coverline("build/resize-base/resize-base.js", 685);+if (instance.get(WRAP)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 686);+instance._copyStyles(wrapper, node);++ _yuitest_coverline("build/resize-base/resize-base.js", 688);+if (pNode) {+ _yuitest_coverline("build/resize-base/resize-base.js", 689);+pNode.insertBefore(node, wrapper);+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 692);+wrapper.remove(true);+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 695);+node.removeClass(CSS_RESIZE);+ _yuitest_coverline("build/resize-base/resize-base.js", 696);+node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);+ },++ /**+ * Creates DOM (or manipulates DOM for progressive enhancement)+ * This method is invoked by initializer(). It's chained automatically for+ * subclasses if required.+ *+ * @method renderer+ * @protected+ */+ renderer: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "renderer", 707);+_yuitest_coverline("build/resize-base/resize-base.js", 708);+this.renderUI();+ _yuitest_coverline("build/resize-base/resize-base.js", 709);+this.bindUI();+ _yuitest_coverline("build/resize-base/resize-base.js", 710);+this.syncUI();+ },++ /**+ * <p>Loop through each handle which is being used and executes a callback.</p>+ * <p>Example:</p>+ * <pre><code>instance.eachHandle(+ * function(handleName, index) { ... }+ * );</code></pre>+ *+ * @method eachHandle+ * @param {function} fn Callback function to be executed for each handle.+ */+ eachHandle: function(fn) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "eachHandle", 723);+_yuitest_coverline("build/resize-base/resize-base.js", 724);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 726);+Y.each(+ instance.get(HANDLES),+ function(handle, i) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 7)", 728);+_yuitest_coverline("build/resize-base/resize-base.js", 729);+var handleEl = instance.get(+ handleAttrName(handle)+ );++ _yuitest_coverline("build/resize-base/resize-base.js", 733);+fn.apply(instance, [handleEl, handle, i]);+ }+ );+ },++ /**+ * Bind the handles DragDrop events to the Resize instance.+ *+ * @method _bindDD+ * @private+ */+ _bindDD: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_bindDD", 744);+_yuitest_coverline("build/resize-base/resize-base.js", 745);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 747);+instance.delegate = new Y.DD.Delegate(+ {+ bubbleTargets: instance,+ container: instance.get(HANDLES_WRAPPER),+ dragConfig: {+ clickPixelThresh: 0,+ clickTimeThresh: 0,+ useShim: true,+ move: false+ },+ nodes: DOT+CSS_RESIZE_HANDLE,+ target: false+ }+ );++ _yuitest_coverline("build/resize-base/resize-base.js", 762);+instance._eventHandles.push(+ instance.on('drag:drag', instance._handleResizeEvent),+ instance.on('drag:dropmiss', instance._handleMouseUpEvent),+ instance.on('drag:end', instance._handleResizeEndEvent),+ instance.on('drag:start', instance._handleResizeStartEvent)+ );+ },++ /**+ * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave).+ *+ * @method _bindHandle+ * @private+ */+ _bindHandle: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_bindHandle", 776);+_yuitest_coverline("build/resize-base/resize-base.js", 777);+var instance = this,+ wrapper = instance.get(WRAPPER);++ _yuitest_coverline("build/resize-base/resize-base.js", 780);+instance._eventHandles.push(+ wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),+ wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),+ wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),+ wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)+ );+ },++ /**+ * Create the custom events used on the Resize.+ *+ * @method _createEvents+ * @private+ */+ _createEvents: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_createEvents", 794);+_yuitest_coverline("build/resize-base/resize-base.js", 795);+var instance = this,+ // create publish function for kweight optimization+ publish = function(name, fn) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "publish", 797);+_yuitest_coverline("build/resize-base/resize-base.js", 798);+instance.publish(name, {+ defaultFn: fn,+ queuable: false,+ emitFacade: true,+ bubbles: true,+ prefix: RESIZE+ });+ };++ /**+ * Handles the resize start event. Fired when a handle starts to be+ * dragged.+ *+ * @event resize:start+ * @preventable _defResizeStartFn+ * @param {Event.Facade} event The resize start event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ _yuitest_coverline("build/resize-base/resize-base.js", 817);+publish(EV_RESIZE_START, this._defResizeStartFn);++ /**+ * Handles the resize event. Fired on each pixel when the handle is+ * being dragged.+ *+ * @event resize:resize+ * @preventable _defResizeFn+ * @param {Event.Facade} event The resize event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ _yuitest_coverline("build/resize-base/resize-base.js", 829);+publish(EV_RESIZE, this._defResizeFn);++ /**+ * Handles the resize align event.+ *+ * @event resize:align+ * @preventable _defResizeAlignFn+ * @param {Event.Facade} event The resize align event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ _yuitest_coverline("build/resize-base/resize-base.js", 840);+publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);++ /**+ * Handles the resize end event. Fired when a handle stop to be+ * dragged.+ *+ * @event resize:end+ * @preventable _defResizeEndFn+ * @param {Event.Facade} event The resize end event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ _yuitest_coverline("build/resize-base/resize-base.js", 852);+publish(EV_RESIZE_END, this._defResizeEndFn);++ /**+ * Handles the resize mouseUp event. Fired when a mouseUp event happens on a+ * handle.+ *+ * @event resize:mouseUp+ * @preventable _defMouseUpFn+ * @param {Event.Facade} event The resize mouseUp event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ _yuitest_coverline("build/resize-base/resize-base.js", 864);+publish(EV_MOUSE_UP, this._defMouseUpFn);+ },++ /**+ * Responsible for loop each handle element and append to the wrapper.+ *+ * @method _renderHandles+ * @protected+ */+ _renderHandles: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_renderHandles", 873);+_yuitest_coverline("build/resize-base/resize-base.js", 874);+var instance = this,+ wrapper = instance.get(WRAPPER),+ handlesWrapper = instance.get(HANDLES_WRAPPER);++ _yuitest_coverline("build/resize-base/resize-base.js", 878);+instance.eachHandle(function(handleEl) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 8)", 878);+_yuitest_coverline("build/resize-base/resize-base.js", 879);+handlesWrapper.append(handleEl);+ });++ _yuitest_coverline("build/resize-base/resize-base.js", 882);+wrapper.append(handlesWrapper);+ },++ /**+ * Creates the handle element based on the handle name and initialize the+ * DragDrop on it.+ *+ * @method _buildHandle+ * @param {String} handle Handle name ('t', 'tr', 'b', ...).+ * @protected+ */+ _buildHandle: function(handle) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_buildHandle", 893);+_yuitest_coverline("build/resize-base/resize-base.js", 894);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 896);+return Y.Node.create(+ Y.Lang.sub(instance.HANDLE_TEMPLATE, {+ handle: handle+ })+ );+ },++ /**+ * Basic resize calculations.+ *+ * @method _calcResize+ * @protected+ */+ _calcResize: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_calcResize", 909);+_yuitest_coverline("build/resize-base/resize-base.js", 910);+var instance = this,+ handle = instance.handle,+ info = instance.info,+ originalInfo = instance.originalInfo,++ dx = info.actXY[0] - originalInfo.actXY[0],+ dy = info.actXY[1] - originalInfo.actXY[1];++ _yuitest_coverline("build/resize-base/resize-base.js", 918);+if (handle && Y.Resize.RULES[handle]) {+ _yuitest_coverline("build/resize-base/resize-base.js", 919);+Y.Resize.RULES[handle](instance, dx, dy);+ }+ else {+ }+ },++ /**+ * Helper method to update the current size value on+ * <a href="Resize.html#property_info">info</a> to respect the+ * min/max values and fix the top/left calculations.+ *+ * @method _checkSize+ * @param {String} offset 'offsetHeight' or 'offsetWidth'+ * @param {number} size Size to restrict the offset+ * @protected+ */+ _checkSize: function(offset, size) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_checkSize", 935);+_yuitest_coverline("build/resize-base/resize-base.js", 936);+var instance = this,+ info = instance.info,+ originalInfo = instance.originalInfo,+ axis = (offset === OFFSET_HEIGHT) ? TOP : LEFT;++ // forcing the offsetHeight/offsetWidth to be the passed size+ _yuitest_coverline("build/resize-base/resize-base.js", 942);+info[offset] = size;++ // predicting, based on the original information, the last left valid in case of reach the min/max dimension+ // this calculation avoid browser event leaks when user interact very fast+ _yuitest_coverline("build/resize-base/resize-base.js", 946);+if (((axis === LEFT) && instance.changeLeftHandles) ||+ ((axis === TOP) && instance.changeTopHandles)) {++ _yuitest_coverline("build/resize-base/resize-base.js", 949);+info[axis] = originalInfo[axis] + originalInfo[offset] - size;+ }+ },++ /**+ * Copy relevant styles of the <a href="Resize.html#attr_node">node</a>+ * to the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _copyStyles+ * @param {Node} node Node from.+ * @param {Node} wrapper Node to.+ * @protected+ */+ _copyStyles: function(node, wrapper) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_copyStyles", 962);+_yuitest_coverline("build/resize-base/resize-base.js", 963);+var position = node.getStyle(POSITION).toLowerCase(),+ surrounding = this._getBoxSurroundingInfo(node),+ wrapperStyle;++ // resizable wrapper should be positioned+ _yuitest_coverline("build/resize-base/resize-base.js", 968);+if (position === STATIC) {+ _yuitest_coverline("build/resize-base/resize-base.js", 969);+position = RELATIVE;+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 972);+wrapperStyle = {+ position: position,+ left: getCompStyle(node, LEFT),+ top: getCompStyle(node, TOP)+ };++ _yuitest_coverline("build/resize-base/resize-base.js", 978);+Y.mix(wrapperStyle, surrounding.margin);+ _yuitest_coverline("build/resize-base/resize-base.js", 979);+Y.mix(wrapperStyle, surrounding.border);++ _yuitest_coverline("build/resize-base/resize-base.js", 981);+wrapper.setStyles(wrapperStyle);++ // remove margin and border from the internal node+ _yuitest_coverline("build/resize-base/resize-base.js", 984);+node.setStyles({ border: 0, margin: 0 });++ _yuitest_coverline("build/resize-base/resize-base.js", 986);+wrapper.sizeTo(+ node.get(OFFSET_WIDTH) + surrounding.totalHBorder,+ node.get(OFFSET_HEIGHT) + surrounding.totalVBorder+ );+ },++ // extract handle name from a string+ // using Y.cached to memoize the function for performance+ _extractHandleName: Y.cached(+ function(node) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 9)", 995);+_yuitest_coverline("build/resize-base/resize-base.js", 996);+var className = node.get(CLASS_NAME),++ match = className.match(+ new RegExp(+ getCN(RESIZE, HANDLE, '(\\w{1,2})\\b')+ )+ );++ _yuitest_coverline("build/resize-base/resize-base.js", 1004);+return match ? match[1] : null;+ }+ ),++ /**+ * <p>Generates metadata to the <a href="Resize.html#property_info">info</a>+ * and <a href="Resize.html#property_originalInfo">originalInfo</a></p>+ * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>+ *+ * @method _getInfo+ * @param {Node} node+ * @param {EventFacade} event+ * @private+ */+ _getInfo: function(node, event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_getInfo", 1018);+_yuitest_coverline("build/resize-base/resize-base.js", 1019);+var actXY = [0,0],+ drag = event.dragEvent.target,+ nodeXY = node.getXY(),+ nodeX = nodeXY[0],+ nodeY = nodeXY[1],+ offsetHeight = node.get(OFFSET_HEIGHT),+ offsetWidth = node.get(OFFSET_WIDTH);++ _yuitest_coverline("build/resize-base/resize-base.js", 1027);+if (event) {+ // the xy that the node will be set to. Changing this will alter the position as it's dragged.+ _yuitest_coverline("build/resize-base/resize-base.js", 1029);+actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 1032);+return {+ actXY: actXY,+ bottom: (nodeY + offsetHeight),+ left: nodeX,+ offsetHeight: offsetHeight,+ offsetWidth: offsetWidth,+ right: (nodeX + offsetWidth),+ top: nodeY+ };+ },++ /**+ * Each box has a content area and optional surrounding margin,+ * padding and * border areas. This method get all this information from+ * the passed node. For more reference see+ * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">+ * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.+ *+ * @method _getBoxSurroundingInfo+ * @param {Node} node+ * @private+ * @return {Object}+ */+ _getBoxSurroundingInfo: function(node) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_getBoxSurroundingInfo", 1055);+_yuitest_coverline("build/resize-base/resize-base.js", 1056);+var info = {+ padding: {},+ margin: {},+ border: {}+ };++ _yuitest_coverline("build/resize-base/resize-base.js", 1062);+if (isNode(node)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1063);+Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 10)", 1063);+_yuitest_coverline("build/resize-base/resize-base.js", 1064);+var paddingProperty = capitalize(PADDING, dir),+ marginProperty = capitalize(MARGIN, dir),+ borderWidthProperty = capitalize(BORDER, dir, WIDTH),+ borderColorProperty = capitalize(BORDER, dir, COLOR),+ borderStyleProperty = capitalize(BORDER, dir, STYLE);++ _yuitest_coverline("build/resize-base/resize-base.js", 1070);+info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);+ _yuitest_coverline("build/resize-base/resize-base.js", 1071);+info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);+ _yuitest_coverline("build/resize-base/resize-base.js", 1072);+info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);+ _yuitest_coverline("build/resize-base/resize-base.js", 1073);+info.margin[marginProperty] = getCompStyle(node, marginProperty);+ _yuitest_coverline("build/resize-base/resize-base.js", 1074);+info.padding[paddingProperty] = getCompStyle(node, paddingProperty);+ });+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 1078);+info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));+ _yuitest_coverline("build/resize-base/resize-base.js", 1079);+info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));+ _yuitest_coverline("build/resize-base/resize-base.js", 1080);+info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));+ _yuitest_coverline("build/resize-base/resize-base.js", 1081);+info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));++ _yuitest_coverline("build/resize-base/resize-base.js", 1083);+return info;+ },++ /**+ * Sync the Resize UI with internal values from+ * <a href="Resize.html#property_info">info</a>.+ *+ * @method _syncUI+ * @protected+ */+ _syncUI: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_syncUI", 1093);+_yuitest_coverline("build/resize-base/resize-base.js", 1094);+var instance = this,+ info = instance.info,+ wrapperSurrounding = instance.wrapperSurrounding,+ wrapper = instance.get(WRAPPER),+ node = instance.get(NODE);++ _yuitest_coverline("build/resize-base/resize-base.js", 1100);+wrapper.sizeTo(info.offsetWidth, info.offsetHeight);++ _yuitest_coverline("build/resize-base/resize-base.js", 1102);+if (instance.changeLeftHandles || instance.changeTopHandles) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1103);+wrapper.setXY([info.left, info.top]);+ }++ // if a wrap node is being used+ _yuitest_coverline("build/resize-base/resize-base.js", 1107);+if (!wrapper.compareTo(node)) {+ // the original internal node borders were copied to the wrapper on+ // _copyStyles, to compensate that subtract the borders from the internal node+ _yuitest_coverline("build/resize-base/resize-base.js", 1110);+node.sizeTo(+ info.offsetWidth - wrapperSurrounding.totalHBorder,+ info.offsetHeight - wrapperSurrounding.totalVBorder+ );+ }++ // prevent webkit textarea resize+ _yuitest_coverline("build/resize-base/resize-base.js", 1117);+if (Y.UA.webkit) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1118);+node.setStyle(RESIZE, NONE);+ }+ },++ /**+ * Update <code>instance.changeHeightHandles,+ * instance.changeLeftHandles, instance.changeTopHandles,+ * instance.changeWidthHandles</code> information.+ *+ * @method _updateChangeHandleInfo+ * @private+ */+ _updateChangeHandleInfo: function(handle) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_updateChangeHandleInfo", 1130);+_yuitest_coverline("build/resize-base/resize-base.js", 1131);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1133);+instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);+ _yuitest_coverline("build/resize-base/resize-base.js", 1134);+instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);+ _yuitest_coverline("build/resize-base/resize-base.js", 1135);+instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);+ _yuitest_coverline("build/resize-base/resize-base.js", 1136);+instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);+ },++ /**+ * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).+ *+ * @method _updateInfo+ * @private+ */+ _updateInfo: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_updateInfo", 1145);+_yuitest_coverline("build/resize-base/resize-base.js", 1146);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1148);+instance.info = instance._getInfo(instance.get(WRAPPER), event);+ },++ /**+ * Update properties+ * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.+ *+ * @method _updateSurroundingInfo+ * @private+ */+ _updateSurroundingInfo: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_updateSurroundingInfo", 1161);+_yuitest_coverline("build/resize-base/resize-base.js", 1162);+var instance = this,+ node = instance.get(NODE),+ wrapper = instance.get(WRAPPER),+ nodeSurrounding = instance._getBoxSurroundingInfo(node),+ wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);++ _yuitest_coverline("build/resize-base/resize-base.js", 1168);+instance.nodeSurrounding = nodeSurrounding;+ _yuitest_coverline("build/resize-base/resize-base.js", 1169);+instance.wrapperSurrounding = wrapperSurrounding;++ _yuitest_coverline("build/resize-base/resize-base.js", 1171);+instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);+ _yuitest_coverline("build/resize-base/resize-base.js", 1172);+instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);+ },++ /**+ * Set the active state of the handles.+ *+ * @method _setActiveHandlesUI+ * @param {boolean} val True to activate the handles, false to deactivate.+ * @protected+ */+ _setActiveHandlesUI: function(val) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_setActiveHandlesUI", 1182);+_yuitest_coverline("build/resize-base/resize-base.js", 1183);+var instance = this,+ activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);++ _yuitest_coverline("build/resize-base/resize-base.js", 1186);+if (activeHandleNode) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1187);+if (val) {+ // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active+ _yuitest_coverline("build/resize-base/resize-base.js", 1189);+instance.eachHandle(+ function(handleEl) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 11)", 1190);+_yuitest_coverline("build/resize-base/resize-base.js", 1191);+handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ );++ _yuitest_coverline("build/resize-base/resize-base.js", 1195);+activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ else {+ _yuitest_coverline("build/resize-base/resize-base.js", 1198);+activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ }+ },++ /**+ * Setter for the handles attribute+ *+ * @method _setHandles+ * @protected+ * @param {String} val+ */+ _setHandles: function(val) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_setHandles", 1210);+_yuitest_coverline("build/resize-base/resize-base.js", 1211);+var instance = this,+ handles = [];++ // handles attr accepts both array or string+ _yuitest_coverline("build/resize-base/resize-base.js", 1215);+if (isArray(val)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1216);+handles = val;+ }+ else {_yuitest_coverline("build/resize-base/resize-base.js", 1218);+if (isString(val)) {+ // if the handles attr passed in is an ALL string...+ _yuitest_coverline("build/resize-base/resize-base.js", 1220);+if (val.toLowerCase() === ALL) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1221);+handles = instance.ALL_HANDLES;+ }+ // otherwise, split the string to extract the handles+ else {+ _yuitest_coverline("build/resize-base/resize-base.js", 1225);+Y.each(+ val.split(COMMA),+ function(node) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 12)", 1227);+_yuitest_coverline("build/resize-base/resize-base.js", 1228);+var handle = trim(node);++ // if its a valid handle, add it to the handles output+ _yuitest_coverline("build/resize-base/resize-base.js", 1231);+if (indexOf(instance.ALL_HANDLES, handle) > -1) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1232);+handles.push(handle);+ }+ }+ );+ }+ }}++ _yuitest_coverline("build/resize-base/resize-base.js", 1239);+return handles;+ },++ /**+ * Set the visibility of the handles.+ *+ * @method _setHideHandlesUI+ * @param {boolean} val True to hide the handles, false to show.+ * @protected+ */+ _setHideHandlesUI: function(val) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_setHideHandlesUI", 1249);+_yuitest_coverline("build/resize-base/resize-base.js", 1250);+var instance = this,+ wrapper = instance.get(WRAPPER);++ _yuitest_coverline("build/resize-base/resize-base.js", 1253);+if (!instance.get(RESIZING)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1254);+if (val) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1255);+wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);+ }+ else {+ _yuitest_coverline("build/resize-base/resize-base.js", 1258);+wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);+ }+ }+ },++ /**+ * Setter for the wrap attribute+ *+ * @method _setWrap+ * @protected+ * @param {boolean} val+ */+ _setWrap: function(val) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_setWrap", 1270);+_yuitest_coverline("build/resize-base/resize-base.js", 1271);+var instance = this,+ node = instance.get(NODE),+ nodeName = node.get(NODE_NAME),+ typeRegex = instance.get(WRAP_TYPES);++ // if nodeName is listed on WRAP_TYPES force use the wrapper+ _yuitest_coverline("build/resize-base/resize-base.js", 1277);+if (typeRegex.test(nodeName)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1278);+val = true;+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 1281);+return val;+ },++ /**+ * Default resize:mouseUp handler+ *+ * @method _defMouseUpFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defMouseUpFn: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_defMouseUpFn", 1291);+_yuitest_coverline("build/resize-base/resize-base.js", 1292);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1294);+instance.set(RESIZING, false);+ },++ /**+ * Default resize:resize handler+ *+ * @method _defResizeFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeFn: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeFn", 1304);+_yuitest_coverline("build/resize-base/resize-base.js", 1305);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1307);+instance._resize(event);+ },++ /**+ * Logic method for _defResizeFn. Allow AOP.+ *+ * @method _resize+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resize: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_resize", 1317);+_yuitest_coverline("build/resize-base/resize-base.js", 1318);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1320);+instance._handleResizeAlignEvent(event.dragEvent);++ // _syncUI of the wrapper, not using proxy+ _yuitest_coverline("build/resize-base/resize-base.js", 1323);+instance._syncUI();+ },++ /**+ * Default resize:align handler+ *+ * @method _defResizeAlignFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeAlignFn: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeAlignFn", 1333);+_yuitest_coverline("build/resize-base/resize-base.js", 1334);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1336);+instance._resizeAlign(event);+ },++ /**+ * Logic method for _defResizeAlignFn. Allow AOP.+ *+ * @method _resizeAlign+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeAlign: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_resizeAlign", 1346);+_yuitest_coverline("build/resize-base/resize-base.js", 1347);+var instance = this,+ info,+ defMinHeight,+ defMinWidth;++ _yuitest_coverline("build/resize-base/resize-base.js", 1352);+instance.lastInfo = instance.info;++ // update the instance.info values+ _yuitest_coverline("build/resize-base/resize-base.js", 1355);+instance._updateInfo(event);++ _yuitest_coverline("build/resize-base/resize-base.js", 1357);+info = instance.info;++ // basic resize calculations+ _yuitest_coverline("build/resize-base/resize-base.js", 1360);+instance._calcResize();++ // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension+ _yuitest_coverline("build/resize-base/resize-base.js", 1363);+if (!instance.con) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1364);+defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);+ _yuitest_coverline("build/resize-base/resize-base.js", 1365);+defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);++ _yuitest_coverline("build/resize-base/resize-base.js", 1367);+if (info.offsetHeight <= defMinHeight) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1368);+instance._checkSize(OFFSET_HEIGHT, defMinHeight);+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 1371);+if (info.offsetWidth <= defMinWidth) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1372);+instance._checkSize(OFFSET_WIDTH, defMinWidth);+ }+ }+ },++ /**+ * Default resize:end handler+ *+ * @method _defResizeEndFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeEndFn: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeEndFn", 1384);+_yuitest_coverline("build/resize-base/resize-base.js", 1385);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1387);+instance._resizeEnd(event);+ },++ /**+ * Logic method for _defResizeEndFn. Allow AOP.+ *+ * @method _resizeEnd+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeEnd: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_resizeEnd", 1397);+_yuitest_coverline("build/resize-base/resize-base.js", 1398);+var instance = this,+ drag = event.dragEvent.target;++ // reseting actXY from drag when drag end+ _yuitest_coverline("build/resize-base/resize-base.js", 1402);+drag.actXY = [];++ // syncUI when resize end+ _yuitest_coverline("build/resize-base/resize-base.js", 1405);+instance._syncUI();++ _yuitest_coverline("build/resize-base/resize-base.js", 1407);+instance._setActiveHandlesUI(false);++ _yuitest_coverline("build/resize-base/resize-base.js", 1409);+instance.set(ACTIVE_HANDLE, null);+ _yuitest_coverline("build/resize-base/resize-base.js", 1410);+instance.set(ACTIVE_HANDLE_NODE, null);++ _yuitest_coverline("build/resize-base/resize-base.js", 1412);+instance.handle = null;+ },++ /**+ * Default resize:start handler+ *+ * @method _defResizeStartFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeStartFn: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_defResizeStartFn", 1422);+_yuitest_coverline("build/resize-base/resize-base.js", 1423);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1425);+instance._resizeStart(event);+ },++ /**+ * Logic method for _defResizeStartFn. Allow AOP.+ *+ * @method _resizeStart+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeStart: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_resizeStart", 1435);+_yuitest_coverline("build/resize-base/resize-base.js", 1436);+var instance = this,+ wrapper = instance.get(WRAPPER);++ _yuitest_coverline("build/resize-base/resize-base.js", 1439);+instance.handle = instance.get(ACTIVE_HANDLE);++ _yuitest_coverline("build/resize-base/resize-base.js", 1441);+instance.set(RESIZING, true);++ _yuitest_coverline("build/resize-base/resize-base.js", 1443);+instance._updateSurroundingInfo();++ // create an originalInfo information for reference+ _yuitest_coverline("build/resize-base/resize-base.js", 1446);+instance.originalInfo = instance._getInfo(wrapper, event);++ _yuitest_coverline("build/resize-base/resize-base.js", 1448);+instance._updateInfo(event);+ },++ /**+ * Fires the resize:mouseUp event.+ *+ * @method _handleMouseUpEvent+ * @param {EventFacade} event resize:mouseUp event facade+ * @protected+ */+ _handleMouseUpEvent: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleMouseUpEvent", 1458);+_yuitest_coverline("build/resize-base/resize-base.js", 1459);+this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:resize event.+ *+ * @method _handleResizeEvent+ * @param {EventFacade} event resize:resize event facade+ * @protected+ */+ _handleResizeEvent: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeEvent", 1469);+_yuitest_coverline("build/resize-base/resize-base.js", 1470);+this.fire(EV_RESIZE, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:align event.+ *+ * @method _handleResizeAlignEvent+ * @param {EventFacade} event resize:resize event facade+ * @protected+ */+ _handleResizeAlignEvent: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeAlignEvent", 1480);+_yuitest_coverline("build/resize-base/resize-base.js", 1481);+this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:end event.+ *+ * @method _handleResizeEndEvent+ * @param {EventFacade} event resize:end event facade+ * @protected+ */+ _handleResizeEndEvent: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeEndEvent", 1491);+_yuitest_coverline("build/resize-base/resize-base.js", 1492);+this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:start event.+ *+ * @method _handleResizeStartEvent+ * @param {EventFacade} event resize:start event facade+ * @protected+ */+ _handleResizeStartEvent: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_handleResizeStartEvent", 1502);+_yuitest_coverline("build/resize-base/resize-base.js", 1503);+if (!this.get(ACTIVE_HANDLE)) {+ //This handles the "touch" case+ _yuitest_coverline("build/resize-base/resize-base.js", 1505);+this._setHandleFromNode(event.target.get('node'));+ }+ _yuitest_coverline("build/resize-base/resize-base.js", 1507);+this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });+ },++ /**+ * Mouseenter event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _onWrapperMouseEnter+ * @param {EventFacade} event+ * @protected+ */+ _onWrapperMouseEnter: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_onWrapperMouseEnter", 1517);+_yuitest_coverline("build/resize-base/resize-base.js", 1518);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1520);+if (instance.get(AUTO_HIDE)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1521);+instance._setHideHandlesUI(false);+ }+ },++ /**+ * Mouseleave event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _onWrapperMouseLeave+ * @param {EventFacade} event+ * @protected+ */+ _onWrapperMouseLeave: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_onWrapperMouseLeave", 1532);+_yuitest_coverline("build/resize-base/resize-base.js", 1533);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1535);+if (instance.get(AUTO_HIDE)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1536);+instance._setHideHandlesUI(true);+ }+ },++ /**+ * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).+ *+ * @method _setHandleFromNode+ * @param {Node} node+ * @protected+ */+ _setHandleFromNode: function(node) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_setHandleFromNode", 1547);+_yuitest_coverline("build/resize-base/resize-base.js", 1548);+var instance = this,+ handle = instance._extractHandleName(node);++ _yuitest_coverline("build/resize-base/resize-base.js", 1551);+if (!instance.get(RESIZING)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1552);+instance.set(ACTIVE_HANDLE, handle);+ _yuitest_coverline("build/resize-base/resize-base.js", 1553);+instance.set(ACTIVE_HANDLE_NODE, node);++ _yuitest_coverline("build/resize-base/resize-base.js", 1555);+instance._setActiveHandlesUI(true);+ _yuitest_coverline("build/resize-base/resize-base.js", 1556);+instance._updateChangeHandleInfo(handle);+ }+ },++ /**+ * Mouseenter event handler for the handles.+ *+ * @method _onHandleMouseEnter+ * @param {EventFacade} event+ * @protected+ */+ _onHandleMouseEnter: function(event) {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_onHandleMouseEnter", 1567);+_yuitest_coverline("build/resize-base/resize-base.js", 1568);+this._setHandleFromNode(event.currentTarget);+ },++ /**+ * Mouseout event handler for the handles.+ *+ * @method _onHandleMouseLeave+ * @param {EventFacade} event+ * @protected+ */+ _onHandleMouseLeave: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_onHandleMouseLeave", 1578);+_yuitest_coverline("build/resize-base/resize-base.js", 1579);+var instance = this;++ _yuitest_coverline("build/resize-base/resize-base.js", 1581);+if (!instance.get(RESIZING)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1582);+instance._setActiveHandlesUI(false);+ }+ },++ /**+ * Default value for the wrapper handles node attribute+ *+ * @method _valueHandlesWrapper+ * @protected+ * @readOnly+ */+ _valueHandlesWrapper: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_valueHandlesWrapper", 1593);+_yuitest_coverline("build/resize-base/resize-base.js", 1594);+return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);+ },++ /**+ * Default value for the wrapper attribute+ *+ * @method _valueWrapper+ * @protected+ * @readOnly+ */+ _valueWrapper: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "_valueWrapper", 1604);+_yuitest_coverline("build/resize-base/resize-base.js", 1605);+var instance = this,+ node = instance.get(NODE),+ pNode = node.get(PARENT_NODE),+ // by deafult the wrapper is always the node+ wrapper = node;++ // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper+ _yuitest_coverline("build/resize-base/resize-base.js", 1612);+if (instance.get(WRAP)) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1613);+wrapper = Y.Node.create(instance.WRAP_TEMPLATE);++ _yuitest_coverline("build/resize-base/resize-base.js", 1615);+if (pNode) {+ _yuitest_coverline("build/resize-base/resize-base.js", 1616);+pNode.insertBefore(wrapper, node);+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 1619);+wrapper.append(node);++ _yuitest_coverline("build/resize-base/resize-base.js", 1621);+instance._copyStyles(node, wrapper);++ // remove positioning of wrapped node, the WRAPPER take care about positioning+ _yuitest_coverline("build/resize-base/resize-base.js", 1624);+node.setStyles({+ position: STATIC,+ left: 0,+ top: 0+ });+ }++ _yuitest_coverline("build/resize-base/resize-base.js", 1631);+return wrapper;+ }+ }+);++_yuitest_coverline("build/resize-base/resize-base.js", 1636);+Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle) {+ // creating ATTRS with the handles elements+ _yuitest_coverfunc("build/resize-base/resize-base.js", "(anonymous 13)", 1636);+_yuitest_coverline("build/resize-base/resize-base.js", 1638);+Y.Resize.ATTRS[handleAttrName(handle)] = {+ setter: function() {+ _yuitest_coverfunc("build/resize-base/resize-base.js", "setter", 1639);+_yuitest_coverline("build/resize-base/resize-base.js", 1640);+return this._buildHandle(handle);+ },+ value: null,+ writeOnce: true+ };+});+++}, '3.7.3', {"requires": ["base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop"], "skinnable": true});
bundle/resize-base/resize-base-debug.js view
@@ -1,1654 +1,1655 @@ /*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('resize-base', function (Y, NAME) {--/**- * The Resize Utility allows you to make an HTML element resizable.- * @module resize- * @main resize- */--var Lang = Y.Lang,- isArray = Lang.isArray,- isBoolean = Lang.isBoolean,- isNumber = Lang.isNumber,- isString = Lang.isString,-- YArray = Y.Array,- trim = Lang.trim,- indexOf = YArray.indexOf,-- COMMA = ',',- DOT = '.',- EMPTY_STR = '',- HANDLE_SUB = '{handle}',- SPACE = ' ',-- ACTIVE = 'active',- ACTIVE_HANDLE = 'activeHandle',- ACTIVE_HANDLE_NODE = 'activeHandleNode',- ALL = 'all',- AUTO_HIDE = 'autoHide',- BORDER = 'border',- BOTTOM = 'bottom',- CLASS_NAME = 'className',- COLOR = 'color',- DEF_MIN_HEIGHT = 'defMinHeight',- DEF_MIN_WIDTH = 'defMinWidth',- HANDLE = 'handle',- HANDLES = 'handles',- HANDLES_WRAPPER = 'handlesWrapper',- HIDDEN = 'hidden',- INNER = 'inner',- LEFT = 'left',- MARGIN = 'margin',- NODE = 'node',- NODE_NAME = 'nodeName',- NONE = 'none',- OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth',- PADDING = 'padding',- PARENT_NODE = 'parentNode',- POSITION = 'position',- RELATIVE = 'relative',- RESIZE = 'resize',- RESIZING = 'resizing',- RIGHT = 'right',- STATIC = 'static',- STYLE = 'style',- TOP = 'top',- WIDTH = 'width',- WRAP = 'wrap',- WRAPPER = 'wrapper',- WRAP_TYPES = 'wrapTypes',-- EV_MOUSE_UP = 'resize:mouseUp',- EV_RESIZE = 'resize:resize',- EV_RESIZE_ALIGN = 'resize:align',- EV_RESIZE_END = 'resize:end',- EV_RESIZE_START = 'resize:start',-- T = 't',- TR = 'tr',- R = 'r',- BR = 'br',- B = 'b',- BL = 'bl',- L = 'l',- TL = 'tl',-- concat = function() {- return Array.prototype.slice.call(arguments).join(SPACE);- },-- // round the passed number to get rid of pixel-flickering- toRoundNumber = function(num) {- return Math.round(parseFloat(num)) || 0;- },-- getCompStyle = function(node, val) {- return node.getComputedStyle(val);- },-- handleAttrName = function(handle) {- return HANDLE + handle.toUpperCase();- },-- isNode = function(v) {- return (v instanceof Y.Node);- },-- toInitialCap = Y.cached(- function(str) {- return str.substring(0, 1).toUpperCase() + str.substring(1);- }- ),-- capitalize = Y.cached(function() {- var out = [],- args = YArray(arguments, 0, true);-- YArray.each(args, function(part, i) {- if (i > 0) {- part = toInitialCap(part);- }- out.push(part);- });-- return out.join(EMPTY_STR);- }),-- getCN = Y.ClassNameManager.getClassName,-- CSS_RESIZE = getCN(RESIZE),- CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),- CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),- CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),- CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),- CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),- CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),- CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),- CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);--/**-A base class for Resize, providing:-- * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)- * Applies drag handles to an element to make it resizable- * Here is the list of valid resize handles:- `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can- read this list as top, top-right, right, bottom-right, bottom,- bottom-left, left, top-left.- * The drag handles are inserted into the element and positioned- absolute. Some elements, such as a textarea or image, don't support- children. To overcome that, set wrap:true in your config and the- element willbe wrapped for you automatically.--Quick Example:-- var instance = new Y.Resize({- node: '#resize1',- preserveRatio: true,- wrap: true,- maxHeight: 170,- maxWidth: 400,- handles: 't, tr, r, br, b, bl, l, tl'- });--Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for-Resize.--@class Resize-@param config {Object} Object literal specifying widget configuration properties.-@constructor-@extends Base-*/--function Resize() {- Resize.superclass.constructor.apply(this, arguments);-}--Y.mix(Resize, {- /**- * Static property provides a string to identify the class.- *- * @property NAME- * @type String- * @static- */- NAME: RESIZE,-- /**- * Static property used to define the default attribute- * configuration for the Resize.- *- * @property ATTRS- * @type Object- * @static- */- ATTRS: {- /**- * Stores the active handle during the resize.- *- * @attribute activeHandle- * @default null- * @private- * @type String- */- activeHandle: {- value: null,- validator: function(v) {- return Y.Lang.isString(v) || Y.Lang.isNull(v);- }- },-- /**- * Stores the active handle element during the resize.- *- * @attribute activeHandleNode- * @default null- * @private- * @type Node- */- activeHandleNode: {- value: null,- validator: isNode- },-- /**- * False to ensure that the resize handles are always visible, true to- * display them only when the user mouses over the resizable borders.- *- * @attribute autoHide- * @default false- * @type boolean- */- autoHide: {- value: false,- validator: isBoolean- },-- /**- * The default minimum height of the element. Only used when- * ResizeConstrained is not plugged.- *- * @attribute defMinHeight- * @default 15- * @type Number- */- defMinHeight: {- value: 15,- validator: isNumber- },-- /**- * The default minimum width of the element. Only used when- * ResizeConstrained is not plugged.- *- * @attribute defMinWidth- * @default 15- * @type Number- */- defMinWidth: {- value: 15,- validator: isNumber- },-- /**- * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',- * 'br', 'tl', 'tr'. Can use a shortcut of All.- *- * @attribute handles- * @default all- * @type Array | String- */- handles: {- setter: '_setHandles',- value: ALL- },-- /**- * Node to wrap the resize handles.- *- * @attribute handlesWrapper- * @type Node- */- handlesWrapper: {- readOnly: true,- setter: Y.one,- valueFn: '_valueHandlesWrapper'- },-- /**- * The selector or element to resize. Required.- *- * @attribute node- * @type Node- */- node: {- setter: Y.one- },-- /**- * True when the element is being Resized.- *- * @attribute resizing- * @default false- * @type boolean- */- resizing: {- value: false,- validator: isBoolean- },-- /**- * True to wrap an element with a div if needed (required for textareas- * and images, defaults to false) in favor of the handles config option.- * The wrapper element type (default div) could be over-riden passing the- * <code>wrapper</code> attribute.- *- * @attribute wrap- * @default false- * @type boolean- */- wrap: {- setter: '_setWrap',- value: false,- validator: isBoolean- },-- /**- * Elements that requires a wrapper by default. Normally are elements- * which cannot have children elements.- *- * @attribute wrapTypes- * @default /canvas|textarea|input|select|button|img/i- * @readOnly- * @type Regex- */- wrapTypes: {- readOnly: true,- value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i- },-- /**- * Element to wrap the <code>wrapTypes</code>. This element will house- * the handles elements.- *- * @attribute wrapper- * @default div- * @type String | Node- * @writeOnce- */- wrapper: {- readOnly: true,- valueFn: '_valueWrapper',- writeOnce: true- }- },-- RULES: {- b: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.offsetHeight = originalInfo.offsetHeight + dy;- },-- l: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.left = originalInfo.left + dx;- info.offsetWidth = originalInfo.offsetWidth - dx;- },-- r: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.offsetWidth = originalInfo.offsetWidth + dx;- },-- t: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.top = originalInfo.top + dy;- info.offsetHeight = originalInfo.offsetHeight - dy;- },-- tr: function(instance, dx, dy) {- this.t.apply(this, arguments);- this.r.apply(this, arguments);- },-- bl: function(instance, dx, dy) {- this.b.apply(this, arguments);- this.l.apply(this, arguments);- },-- br: function(instance, dx, dy) {- this.b.apply(this, arguments);- this.r.apply(this, arguments);- },-- tl: function(instance, dx, dy) {- this.t.apply(this, arguments);- this.l.apply(this, arguments);- }- },-- capitalize: capitalize-});--Y.Resize = Y.extend(- Resize,- Y.Base,- {- /**- * Array containing all possible resizable handles.- *- * @property ALL_HANDLES- * @type {String}- */- ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],-- /**- * Regex which matches with the handles that could change the height of- * the resizable element.- *- * @property REGEX_CHANGE_HEIGHT- * @type {String}- */- REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,-- /**- * Regex which matches with the handles that could change the left of- * the resizable element.- *- * @property REGEX_CHANGE_LEFT- * @type {String}- */- REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,-- /**- * Regex which matches with the handles that could change the top of- * the resizable element.- *- * @property REGEX_CHANGE_TOP- * @type {String}- */- REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,-- /**- * Regex which matches with the handles that could change the width of- * the resizable element.- *- * @property REGEX_CHANGE_WIDTH- * @type {String}- */- REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,-- /**- * Template used to create the resize wrapper for the handles.- *- * @property HANDLES_WRAP_TEMPLATE- * @type {String}- */- HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>',-- /**- * Template used to create the resize wrapper node when needed.- *- * @property WRAP_TEMPLATE- * @type {String}- */- WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>',-- /**- * Template used to create each resize handle.- *- * @property HANDLE_TEMPLATE- * @type {String}- */- HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' +- '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' +- '</div>',--- /**- * Each box has a content area and optional surrounding padding and- * border areas. This property stores the sum of all horizontal- * surrounding * information needed to adjust the node height.- *- * @property totalHSurrounding- * @default 0- * @type number- */- totalHSurrounding: 0,-- /**- * Each box has a content area and optional surrounding padding and- * border areas. This property stores the sum of all vertical- * surrounding * information needed to adjust the node height.- *- * @property totalVSurrounding- * @default 0- * @type number- */- totalVSurrounding: 0,-- /**- * Stores the <a href="Resize.html#attr_node">node</a>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property nodeSurrounding- * @type Object- * @default null- */- nodeSurrounding: null,-- /**- * Stores the <a href="Resize.html#attr_wrapper">wrapper</a>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property wrapperSurrounding- * @type Object- * @default null- */- wrapperSurrounding: null,-- /**- * Whether the handle being dragged can change the height.- *- * @property changeHeightHandles- * @default false- * @type boolean- */- changeHeightHandles: false,-- /**- * Whether the handle being dragged can change the left.- *- * @property changeLeftHandles- * @default false- * @type boolean- */- changeLeftHandles: false,-- /**- * Whether the handle being dragged can change the top.- *- * @property changeTopHandles- * @default false- * @type boolean- */- changeTopHandles: false,-- /**- * Whether the handle being dragged can change the width.- *- * @property changeWidthHandles- * @default false- * @type boolean- */- changeWidthHandles: false,-- /**- * Store DD.Delegate reference for the respective Resize instance.- *- * @property delegate- * @default null- * @type Object- */- delegate: null,-- /**- * Stores the current values for the height, width, top and left. You are- * able to manipulate these values on resize in order to change the resize- * behavior.- *- * @property info- * @type Object- * @protected- */- info: null,-- /**- * Stores the last values for the height, width, top and left.- *- * @property lastInfo- * @type Object- * @protected- */- lastInfo: null,-- /**- * Stores the original values for the height, width, top and left, stored- * on resize start.- *- * @property originalInfo- * @type Object- * @protected- */- originalInfo: null,-- /**- * Construction logic executed during Resize instantiation. Lifecycle.- *- * @method initializer- * @protected- */- initializer: function() {- this._eventHandles = [];-- this.renderer();- },-- /**- * Create the DOM structure for the Resize. Lifecycle.- *- * @method renderUI- * @protected- */- renderUI: function() {- var instance = this;-- instance._renderHandles();- },-- /**- * Bind the events on the Resize UI. Lifecycle.- *- * @method bindUI- * @protected- */- bindUI: function() {- var instance = this;-- instance._createEvents();- instance._bindDD();- instance._bindHandle();- },-- /**- * Sync the Resize UI.- *- * @method syncUI- * @protected- */- syncUI: function() {- var instance = this;-- this.get(NODE).addClass(CSS_RESIZE);-- // hide handles if AUTO_HIDE is true- instance._setHideHandlesUI(- instance.get(AUTO_HIDE)- );- },-- /**- * Destructor lifecycle implementation for the Resize class.- * Detaches all previously attached listeners and removes the Resize handles.- *- * @method destructor- * @protected- */- destructor: function() {- var instance = this,- node = instance.get(NODE),- wrapper = instance.get(WRAPPER),- pNode = wrapper.get(PARENT_NODE);-- Y.each(- instance._eventHandles,- function(handle, index) {- handle.detach();- }- );-- instance._eventHandles.length = 0;-- // destroy handles dd and remove them from the dom- instance.eachHandle(function(handleEl) {- instance.delegate.dd.destroy();-- // remove handle- handleEl.remove(true);- });-- instance.delegate.destroy();-- // unwrap node- if (instance.get(WRAP)) {- instance._copyStyles(wrapper, node);-- if (pNode) {- pNode.insertBefore(node, wrapper);- }-- wrapper.remove(true);- }-- node.removeClass(CSS_RESIZE);- node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);- },-- /**- * Creates DOM (or manipulates DOM for progressive enhancement)- * This method is invoked by initializer(). It's chained automatically for- * subclasses if required.- *- * @method renderer- * @protected- */- renderer: function() {- this.renderUI();- this.bindUI();- this.syncUI();- },-- /**- * <p>Loop through each handle which is being used and executes a callback.</p>- * <p>Example:</p>- * <pre><code>instance.eachHandle(- * function(handleName, index) { ... }- * );</code></pre>- *- * @method eachHandle- * @param {function} fn Callback function to be executed for each handle.- */- eachHandle: function(fn) {- var instance = this;-- Y.each(- instance.get(HANDLES),- function(handle, i) {- var handleEl = instance.get(- handleAttrName(handle)- );-- fn.apply(instance, [handleEl, handle, i]);- }- );- },-- /**- * Bind the handles DragDrop events to the Resize instance.- *- * @method _bindDD- * @private- */- _bindDD: function() {- var instance = this;-- instance.delegate = new Y.DD.Delegate(- {- bubbleTargets: instance,- container: instance.get(HANDLES_WRAPPER),- dragConfig: {- clickPixelThresh: 0,- clickTimeThresh: 0,- useShim: true,- move: false- },- nodes: DOT+CSS_RESIZE_HANDLE,- target: false- }- );-- instance._eventHandles.push(- instance.on('drag:drag', instance._handleResizeEvent),- instance.on('drag:dropmiss', instance._handleMouseUpEvent),- instance.on('drag:end', instance._handleResizeEndEvent),- instance.on('drag:start', instance._handleResizeStartEvent)- );- },-- /**- * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave).- *- * @method _bindHandle- * @private- */- _bindHandle: function() {- var instance = this,- wrapper = instance.get(WRAPPER);-- instance._eventHandles.push(- wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),- wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),- wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),- wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)- );- },-- /**- * Create the custom events used on the Resize.- *- * @method _createEvents- * @private- */- _createEvents: function() {- var instance = this,- // create publish function for kweight optimization- publish = function(name, fn) {- instance.publish(name, {- defaultFn: fn,- queuable: false,- emitFacade: true,- bubbles: true,- prefix: RESIZE- });- };-- /**- * Handles the resize start event. Fired when a handle starts to be- * dragged.- *- * @event resize:start- * @preventable _defResizeStartFn- * @param {Event.Facade} event The resize start event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE_START, this._defResizeStartFn);-- /**- * Handles the resize event. Fired on each pixel when the handle is- * being dragged.- *- * @event resize:resize- * @preventable _defResizeFn- * @param {Event.Facade} event The resize event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE, this._defResizeFn);-- /**- * Handles the resize align event.- *- * @event resize:align- * @preventable _defResizeAlignFn- * @param {Event.Facade} event The resize align event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);-- /**- * Handles the resize end event. Fired when a handle stop to be- * dragged.- *- * @event resize:end- * @preventable _defResizeEndFn- * @param {Event.Facade} event The resize end event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE_END, this._defResizeEndFn);-- /**- * Handles the resize mouseUp event. Fired when a mouseUp event happens on a- * handle.- *- * @event resize:mouseUp- * @preventable _defMouseUpFn- * @param {Event.Facade} event The resize mouseUp event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_MOUSE_UP, this._defMouseUpFn);- },-- /**- * Responsible for loop each handle element and append to the wrapper.- *- * @method _renderHandles- * @protected- */- _renderHandles: function() {- var instance = this,- wrapper = instance.get(WRAPPER),- handlesWrapper = instance.get(HANDLES_WRAPPER);-- instance.eachHandle(function(handleEl) {- handlesWrapper.append(handleEl);- });-- wrapper.append(handlesWrapper);- },-- /**- * Creates the handle element based on the handle name and initialize the- * DragDrop on it.- *- * @method _buildHandle- * @param {String} handle Handle name ('t', 'tr', 'b', ...).- * @protected- */- _buildHandle: function(handle) {- var instance = this;-- return Y.Node.create(- Y.Lang.sub(instance.HANDLE_TEMPLATE, {- handle: handle- })- );- },-- /**- * Basic resize calculations.- *- * @method _calcResize- * @protected- */- _calcResize: function() {- var instance = this,- handle = instance.handle,- info = instance.info,- originalInfo = instance.originalInfo,-- dx = info.actXY[0] - originalInfo.actXY[0],- dy = info.actXY[1] - originalInfo.actXY[1];-- if (handle && Y.Resize.RULES[handle]) {- Y.Resize.RULES[handle](instance, dx, dy);- }- else {- Y.log('Handle rule not found: ' + handle, 'warn', 'resize');- }- },-- /**- * Helper method to update the current size value on- * <a href="Resize.html#property_info">info</a> to respect the- * min/max values and fix the top/left calculations.- *- * @method _checkSize- * @param {String} offset 'offsetHeight' or 'offsetWidth'- * @param {number} size Size to restrict the offset- * @protected- */- _checkSize: function(offset, size) {- var instance = this,- info = instance.info,- originalInfo = instance.originalInfo,- axis = (offset == OFFSET_HEIGHT) ? TOP : LEFT;-- // forcing the offsetHeight/offsetWidth to be the passed size- info[offset] = size;-- // predicting, based on the original information, the last left valid in case of reach the min/max dimension- // this calculation avoid browser event leaks when user interact very fast- if (((axis == LEFT) && instance.changeLeftHandles) ||- ((axis == TOP) && instance.changeTopHandles)) {-- info[axis] = originalInfo[axis] + originalInfo[offset] - size;- }- },-- /**- * Copy relevant styles of the <a href="Resize.html#attr_node">node</a>- * to the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _copyStyles- * @param {Node} node Node from.- * @param {Node} wrapper Node to.- * @protected- */- _copyStyles: function(node, wrapper) {- var position = node.getStyle(POSITION).toLowerCase(),- surrounding = this._getBoxSurroundingInfo(node),- wrapperStyle;-- // resizable wrapper should be positioned- if (position == STATIC) {- position = RELATIVE;- }-- wrapperStyle = {- position: position,- left: getCompStyle(node, LEFT),- top: getCompStyle(node, TOP)- };-- Y.mix(wrapperStyle, surrounding.margin);- Y.mix(wrapperStyle, surrounding.border);-- wrapper.setStyles(wrapperStyle);-- // remove margin and border from the internal node- node.setStyles({ border: 0, margin: 0 });-- wrapper.sizeTo(- node.get(OFFSET_WIDTH) + surrounding.totalHBorder,- node.get(OFFSET_HEIGHT) + surrounding.totalVBorder- );- },-- // extract handle name from a string- // using Y.cached to memoize the function for performance- _extractHandleName: Y.cached(- function(node) {- var className = node.get(CLASS_NAME),-- match = className.match(- new RegExp(- getCN(RESIZE, HANDLE, '(\\w{1,2})\\b')- )- );-- return match ? match[1] : null;- }- ),-- /**- * <p>Generates metadata to the <a href="Resize.html#property_info">info</a>- * and <a href="Resize.html#property_originalInfo">originalInfo</a></p>- * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>- *- * @method _getInfo- * @param {Node} node- * @param {EventFacade} event- * @private- */- _getInfo: function(node, event) {- var actXY = [0,0],- drag = event.dragEvent.target,- nodeXY = node.getXY(),- nodeX = nodeXY[0],- nodeY = nodeXY[1],- offsetHeight = node.get(OFFSET_HEIGHT),- offsetWidth = node.get(OFFSET_WIDTH);-- if (event) {- // the xy that the node will be set to. Changing this will alter the position as it's dragged.- actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);- }-- return {- actXY: actXY,- bottom: (nodeY + offsetHeight),- left: nodeX,- offsetHeight: offsetHeight,- offsetWidth: offsetWidth,- right: (nodeX + offsetWidth),- top: nodeY- };- },-- /**- * Each box has a content area and optional surrounding margin,- * padding and * border areas. This method get all this information from- * the passed node. For more reference see- * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">- * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.- *- * @method _getBoxSurroundingInfo- * @param {Node} node- * @private- * @return {Object}- */- _getBoxSurroundingInfo: function(node) {- var info = {- padding: {},- margin: {},- border: {}- };-- if (isNode(node)) {- Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {- var paddingProperty = capitalize(PADDING, dir),- marginProperty = capitalize(MARGIN, dir),- borderWidthProperty = capitalize(BORDER, dir, WIDTH),- borderColorProperty = capitalize(BORDER, dir, COLOR),- borderStyleProperty = capitalize(BORDER, dir, STYLE);-- info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);- info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);- info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);- info.margin[marginProperty] = getCompStyle(node, marginProperty);- info.padding[paddingProperty] = getCompStyle(node, paddingProperty);- });- }-- info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));- info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));- info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));- info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));-- return info;- },-- /**- * Sync the Resize UI with internal values from- * <a href="Resize.html#property_info">info</a>.- *- * @method _syncUI- * @protected- */- _syncUI: function() {- var instance = this,- info = instance.info,- wrapperSurrounding = instance.wrapperSurrounding,- wrapper = instance.get(WRAPPER),- node = instance.get(NODE);-- wrapper.sizeTo(info.offsetWidth, info.offsetHeight);-- if (instance.changeLeftHandles || instance.changeTopHandles) {- wrapper.setXY([info.left, info.top]);- }-- // if a wrap node is being used- if (!wrapper.compareTo(node)) {- // the original internal node borders were copied to the wrapper on _copyStyles, to compensate that subtract the borders from the internal node- node.sizeTo(- info.offsetWidth - wrapperSurrounding.totalHBorder,- info.offsetHeight - wrapperSurrounding.totalVBorder- );- }-- // prevent webkit textarea resize- if (Y.UA.webkit) {- node.setStyle(RESIZE, NONE);- }- },-- /**- * Update <code>instance.changeHeightHandles,- * instance.changeLeftHandles, instance.changeTopHandles,- * instance.changeWidthHandles</code> information.- *- * @method _updateChangeHandleInfo- * @private- */- _updateChangeHandleInfo: function(handle) {- var instance = this;-- instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);- instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);- instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);- instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);- },-- /**- * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).- *- * @method _updateInfo- * @private- */- _updateInfo: function(event) {- var instance = this;-- instance.info = instance._getInfo(instance.get(WRAPPER), event);- },-- /**- * Update properties- * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.- *- * @method _updateSurroundingInfo- * @private- */- _updateSurroundingInfo: function() {- var instance = this,- node = instance.get(NODE),- wrapper = instance.get(WRAPPER),- nodeSurrounding = instance._getBoxSurroundingInfo(node),- wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);-- instance.nodeSurrounding = nodeSurrounding;- instance.wrapperSurrounding = wrapperSurrounding;-- instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);- instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);- },-- /**- * Set the active state of the handles.- *- * @method _setActiveHandlesUI- * @param {boolean} val True to activate the handles, false to deactivate.- * @protected- */- _setActiveHandlesUI: function(val) {- var instance = this,- activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);-- if (activeHandleNode) {- if (val) {- // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active- instance.eachHandle(- function(handleEl) {- handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);- }- );-- activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);- }- else {- activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);- }- }- },-- /**- * Setter for the handles attribute- *- * @method _setHandles- * @protected- * @param {String} val- */- _setHandles: function(val) {- var instance = this,- handles = [];-- // handles attr accepts both array or string- if (isArray(val)) {- handles = val;- }- else if (isString(val)) {- // if the handles attr passed in is an ALL string...- if (val.toLowerCase() == ALL) {- handles = instance.ALL_HANDLES;- }- // otherwise, split the string to extract the handles- else {- Y.each(- val.split(COMMA),- function(node, i) {- var handle = trim(node);-- // if its a valid handle, add it to the handles output- if (indexOf(instance.ALL_HANDLES, handle) > -1) {- handles.push(handle);- }- }- );- }- }-- return handles;- },-- /**- * Set the visibility of the handles.- *- * @method _setHideHandlesUI- * @param {boolean} val True to hide the handles, false to show.- * @protected- */- _setHideHandlesUI: function(val) {- var instance = this,- wrapper = instance.get(WRAPPER);-- if (!instance.get(RESIZING)) {- if (val) {- wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);- }- else {- wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);- }- }- },-- /**- * Setter for the wrap attribute- *- * @method _setWrap- * @protected- * @param {boolean} val- */- _setWrap: function(val) {- var instance = this,- node = instance.get(NODE),- nodeName = node.get(NODE_NAME),- typeRegex = instance.get(WRAP_TYPES);-- // if nodeName is listed on WRAP_TYPES force use the wrapper- if (typeRegex.test(nodeName)) {- val = true;- }-- return val;- },-- /**- * Default resize:mouseUp handler- *- * @method _defMouseUpFn- * @param {EventFacade} event The Event object- * @protected- */- _defMouseUpFn: function(event) {- var instance = this;-- instance.set(RESIZING, false);- },-- /**- * Default resize:resize handler- *- * @method _defResizeFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeFn: function(event) {- var instance = this;-- instance._resize(event);- },-- /**- * Logic method for _defResizeFn. Allow AOP.- *- * @method _resize- * @param {EventFacade} event The Event object- * @protected- */- _resize: function(event) {- var instance = this;-- instance._handleResizeAlignEvent(event.dragEvent);-- // _syncUI of the wrapper, not using proxy- instance._syncUI();- },-- /**- * Default resize:align handler- *- * @method _defResizeAlignFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeAlignFn: function(event) {- var instance = this;-- instance._resizeAlign(event);- },-- /**- * Logic method for _defResizeAlignFn. Allow AOP.- *- * @method _resizeAlign- * @param {EventFacade} event The Event object- * @protected- */- _resizeAlign: function(event) {- var instance = this,- info,- defMinHeight,- defMinWidth;-- instance.lastInfo = instance.info;-- // update the instance.info values- instance._updateInfo(event);-- info = instance.info;-- // basic resize calculations- instance._calcResize();-- // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension- if (!instance.con) {- defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);- defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);-- if (info.offsetHeight <= defMinHeight) {- instance._checkSize(OFFSET_HEIGHT, defMinHeight);- }-- if (info.offsetWidth <= defMinWidth) {- instance._checkSize(OFFSET_WIDTH, defMinWidth);- }- }- },-- /**- * Default resize:end handler- *- * @method _defResizeEndFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeEndFn: function(event) {- var instance = this;-- instance._resizeEnd(event);- },-- /**- * Logic method for _defResizeEndFn. Allow AOP.- *- * @method _resizeEnd- * @param {EventFacade} event The Event object- * @protected- */- _resizeEnd: function(event) {- var instance = this,- drag = event.dragEvent.target;-- // reseting actXY from drag when drag end- drag.actXY = [];-- // syncUI when resize end- instance._syncUI();-- instance._setActiveHandlesUI(false);-- instance.set(ACTIVE_HANDLE, null);- instance.set(ACTIVE_HANDLE_NODE, null);-- instance.handle = null;- },-- /**- * Default resize:start handler- *- * @method _defResizeStartFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeStartFn: function(event) {- var instance = this;-- instance._resizeStart(event);- },-- /**- * Logic method for _defResizeStartFn. Allow AOP.- *- * @method _resizeStart- * @param {EventFacade} event The Event object- * @protected- */- _resizeStart: function(event) {- var instance = this,- wrapper = instance.get(WRAPPER);-- instance.handle = instance.get(ACTIVE_HANDLE);-- instance.set(RESIZING, true);-- instance._updateSurroundingInfo();-- // create an originalInfo information for reference- instance.originalInfo = instance._getInfo(wrapper, event);-- instance._updateInfo(event);- },-- /**- * Fires the resize:mouseUp event.- *- * @method _handleMouseUpEvent- * @param {EventFacade} event resize:mouseUp event facade- * @protected- */- _handleMouseUpEvent: function(event) {- this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:resize event.- *- * @method _handleResizeEvent- * @param {EventFacade} event resize:resize event facade- * @protected- */- _handleResizeEvent: function(event) {- this.fire(EV_RESIZE, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:align event.- *- * @method _handleResizeAlignEvent- * @param {EventFacade} event resize:resize event facade- * @protected- */- _handleResizeAlignEvent: function(event) {- this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:end event.- *- * @method _handleResizeEndEvent- * @param {EventFacade} event resize:end event facade- * @protected- */- _handleResizeEndEvent: function(event) {- this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:start event.- *- * @method _handleResizeStartEvent- * @param {EventFacade} event resize:start event facade- * @protected- */- _handleResizeStartEvent: function(event) {- if (!this.get(ACTIVE_HANDLE)) {- //This handles the "touch" case- this._setHandleFromNode(event.target.get('node'));- }- this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });- },-- /**- * Mouseenter event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _onWrapperMouseEnter- * @param {EventFacade} event- * @protected- */- _onWrapperMouseEnter: function(event) {- var instance = this;-- if (instance.get(AUTO_HIDE)) {- instance._setHideHandlesUI(false);- }- },-- /**- * Mouseleave event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _onWrapperMouseLeave- * @param {EventFacade} event- * @protected- */- _onWrapperMouseLeave: function(event) {- var instance = this;-- if (instance.get(AUTO_HIDE)) {- instance._setHideHandlesUI(true);- }- },-- /**- * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).- *- * @method _setHandleFromNode- * @param {Node} node- * @protected- */- _setHandleFromNode: function(node) {- var instance = this,- handle = instance._extractHandleName(node);-- if (!instance.get(RESIZING)) {- instance.set(ACTIVE_HANDLE, handle);- instance.set(ACTIVE_HANDLE_NODE, node);-- instance._setActiveHandlesUI(true);- instance._updateChangeHandleInfo(handle);- }- },-- /**- * Mouseenter event handler for the handles.- *- * @method _onHandleMouseEnter- * @param {EventFacade} event- * @protected- */- _onHandleMouseEnter: function(event) {- this._setHandleFromNode(event.currentTarget);- },-- /**- * Mouseout event handler for the handles.- *- * @method _onHandleMouseLeave- * @param {EventFacade} event- * @protected- */- _onHandleMouseLeave: function(event) {- var instance = this;-- if (!instance.get(RESIZING)) {- instance._setActiveHandlesUI(false);- }- },-- /**- * Default value for the wrapper handles node attribute- *- * @method _valueHandlesWrapper- * @protected- * @readOnly- */- _valueHandlesWrapper: function() {- return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);- },-- /**- * Default value for the wrapper attribute- *- * @method _valueWrapper- * @protected- * @readOnly- */- _valueWrapper: function() {- var instance = this,- node = instance.get(NODE),- pNode = node.get(PARENT_NODE),- // by deafult the wrapper is always the node- wrapper = node;-- // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper- if (instance.get(WRAP)) {- wrapper = Y.Node.create(instance.WRAP_TEMPLATE);-- if (pNode) {- pNode.insertBefore(wrapper, node);- }-- wrapper.append(node);-- instance._copyStyles(node, wrapper);-- // remove positioning of wrapped node, the WRAPPER take care about positioning- node.setStyles({- position: STATIC,- left: 0,- top: 0- });- }-- return wrapper;- }- }-);--Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle, i) {- // creating ATTRS with the handles elements- Y.Resize.ATTRS[handleAttrName(handle)] = {- setter: function() {- return this._buildHandle(handle);- },- value: null,- writeOnce: true- };-});---}, '3.7.2', {"requires": ["base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop"], "skinnable": true});+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('resize-base', function (Y, NAME) {++/**+ * The Resize Utility allows you to make an HTML element resizable.+ * @module resize+ * @main resize+ */++var Lang = Y.Lang,+ isArray = Lang.isArray,+ isBoolean = Lang.isBoolean,+ isNumber = Lang.isNumber,+ isString = Lang.isString,++ yArray = Y.Array,+ trim = Lang.trim,+ indexOf = yArray.indexOf,++ COMMA = ',',+ DOT = '.',+ EMPTY_STR = '',+ HANDLE_SUB = '{handle}',+ SPACE = ' ',++ ACTIVE = 'active',+ ACTIVE_HANDLE = 'activeHandle',+ ACTIVE_HANDLE_NODE = 'activeHandleNode',+ ALL = 'all',+ AUTO_HIDE = 'autoHide',+ BORDER = 'border',+ BOTTOM = 'bottom',+ CLASS_NAME = 'className',+ COLOR = 'color',+ DEF_MIN_HEIGHT = 'defMinHeight',+ DEF_MIN_WIDTH = 'defMinWidth',+ HANDLE = 'handle',+ HANDLES = 'handles',+ HANDLES_WRAPPER = 'handlesWrapper',+ HIDDEN = 'hidden',+ INNER = 'inner',+ LEFT = 'left',+ MARGIN = 'margin',+ NODE = 'node',+ NODE_NAME = 'nodeName',+ NONE = 'none',+ OFFSET_HEIGHT = 'offsetHeight',+ OFFSET_WIDTH = 'offsetWidth',+ PADDING = 'padding',+ PARENT_NODE = 'parentNode',+ POSITION = 'position',+ RELATIVE = 'relative',+ RESIZE = 'resize',+ RESIZING = 'resizing',+ RIGHT = 'right',+ STATIC = 'static',+ STYLE = 'style',+ TOP = 'top',+ WIDTH = 'width',+ WRAP = 'wrap',+ WRAPPER = 'wrapper',+ WRAP_TYPES = 'wrapTypes',++ EV_MOUSE_UP = 'resize:mouseUp',+ EV_RESIZE = 'resize:resize',+ EV_RESIZE_ALIGN = 'resize:align',+ EV_RESIZE_END = 'resize:end',+ EV_RESIZE_START = 'resize:start',++ T = 't',+ TR = 'tr',+ R = 'r',+ BR = 'br',+ B = 'b',+ BL = 'bl',+ L = 'l',+ TL = 'tl',++ concat = function() {+ return Array.prototype.slice.call(arguments).join(SPACE);+ },++ // round the passed number to get rid of pixel-flickering+ toRoundNumber = function(num) {+ return Math.round(parseFloat(num)) || 0;+ },++ getCompStyle = function(node, val) {+ return node.getComputedStyle(val);+ },++ handleAttrName = function(handle) {+ return HANDLE + handle.toUpperCase();+ },++ isNode = function(v) {+ return (v instanceof Y.Node);+ },++ toInitialCap = Y.cached(+ function(str) {+ return str.substring(0, 1).toUpperCase() + str.substring(1);+ }+ ),++ capitalize = Y.cached(function() {+ var out = [],+ args = yArray(arguments, 0, true);++ yArray.each(args, function(part, i) {+ if (i > 0) {+ part = toInitialCap(part);+ }+ out.push(part);+ });++ return out.join(EMPTY_STR);+ }),++ getCN = Y.ClassNameManager.getClassName,++ CSS_RESIZE = getCN(RESIZE),+ CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),+ CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),+ CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),+ CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),+ CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),+ CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),+ CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),+ CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);++/**+A base class for Resize, providing:++ * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)+ * Applies drag handles to an element to make it resizable+ * Here is the list of valid resize handles:+ `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can+ read this list as top, top-right, right, bottom-right, bottom,+ bottom-left, left, top-left.+ * The drag handles are inserted into the element and positioned+ absolute. Some elements, such as a textarea or image, don't support+ children. To overcome that, set wrap:true in your config and the+ element willbe wrapped for you automatically.++Quick Example:++ var instance = new Y.Resize({+ node: '#resize1',+ preserveRatio: true,+ wrap: true,+ maxHeight: 170,+ maxWidth: 400,+ handles: 't, tr, r, br, b, bl, l, tl'+ });++Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for+Resize.++@class Resize+@param config {Object} Object literal specifying widget configuration properties.+@constructor+@extends Base+*/++function Resize() {+ Resize.superclass.constructor.apply(this, arguments);+}++Y.mix(Resize, {+ /**+ * Static property provides a string to identify the class.+ *+ * @property NAME+ * @type String+ * @static+ */+ NAME: RESIZE,++ /**+ * Static property used to define the default attribute+ * configuration for the Resize.+ *+ * @property ATTRS+ * @type Object+ * @static+ */+ ATTRS: {+ /**+ * Stores the active handle during the resize.+ *+ * @attribute activeHandle+ * @default null+ * @private+ * @type String+ */+ activeHandle: {+ value: null,+ validator: function(v) {+ return Y.Lang.isString(v) || Y.Lang.isNull(v);+ }+ },++ /**+ * Stores the active handle element during the resize.+ *+ * @attribute activeHandleNode+ * @default null+ * @private+ * @type Node+ */+ activeHandleNode: {+ value: null,+ validator: isNode+ },++ /**+ * False to ensure that the resize handles are always visible, true to+ * display them only when the user mouses over the resizable borders.+ *+ * @attribute autoHide+ * @default false+ * @type boolean+ */+ autoHide: {+ value: false,+ validator: isBoolean+ },++ /**+ * The default minimum height of the element. Only used when+ * ResizeConstrained is not plugged.+ *+ * @attribute defMinHeight+ * @default 15+ * @type Number+ */+ defMinHeight: {+ value: 15,+ validator: isNumber+ },++ /**+ * The default minimum width of the element. Only used when+ * ResizeConstrained is not plugged.+ *+ * @attribute defMinWidth+ * @default 15+ * @type Number+ */+ defMinWidth: {+ value: 15,+ validator: isNumber+ },++ /**+ * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',+ * 'br', 'tl', 'tr'. Can use a shortcut of All.+ *+ * @attribute handles+ * @default all+ * @type Array | String+ */+ handles: {+ setter: '_setHandles',+ value: ALL+ },++ /**+ * Node to wrap the resize handles.+ *+ * @attribute handlesWrapper+ * @type Node+ */+ handlesWrapper: {+ readOnly: true,+ setter: Y.one,+ valueFn: '_valueHandlesWrapper'+ },++ /**+ * The selector or element to resize. Required.+ *+ * @attribute node+ * @type Node+ */+ node: {+ setter: Y.one+ },++ /**+ * True when the element is being Resized.+ *+ * @attribute resizing+ * @default false+ * @type boolean+ */+ resizing: {+ value: false,+ validator: isBoolean+ },++ /**+ * True to wrap an element with a div if needed (required for textareas+ * and images, defaults to false) in favor of the handles config option.+ * The wrapper element type (default div) could be over-riden passing the+ * <code>wrapper</code> attribute.+ *+ * @attribute wrap+ * @default false+ * @type boolean+ */+ wrap: {+ setter: '_setWrap',+ value: false,+ validator: isBoolean+ },++ /**+ * Elements that requires a wrapper by default. Normally are elements+ * which cannot have children elements.+ *+ * @attribute wrapTypes+ * @default /canvas|textarea|input|select|button|img/i+ * @readOnly+ * @type Regex+ */+ wrapTypes: {+ readOnly: true,+ value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i+ },++ /**+ * Element to wrap the <code>wrapTypes</code>. This element will house+ * the handles elements.+ *+ * @attribute wrapper+ * @default div+ * @type String | Node+ * @writeOnce+ */+ wrapper: {+ readOnly: true,+ valueFn: '_valueWrapper',+ writeOnce: true+ }+ },++ RULES: {+ b: function(instance, dx, dy) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.offsetHeight = originalInfo.offsetHeight + dy;+ },++ l: function(instance, dx) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.left = originalInfo.left + dx;+ info.offsetWidth = originalInfo.offsetWidth - dx;+ },++ r: function(instance, dx) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.offsetWidth = originalInfo.offsetWidth + dx;+ },++ t: function(instance, dx, dy) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.top = originalInfo.top + dy;+ info.offsetHeight = originalInfo.offsetHeight - dy;+ },++ tr: function() {+ this.t.apply(this, arguments);+ this.r.apply(this, arguments);+ },++ bl: function() {+ this.b.apply(this, arguments);+ this.l.apply(this, arguments);+ },++ br: function() {+ this.b.apply(this, arguments);+ this.r.apply(this, arguments);+ },++ tl: function() {+ this.t.apply(this, arguments);+ this.l.apply(this, arguments);+ }+ },++ capitalize: capitalize+});++Y.Resize = Y.extend(+ Resize,+ Y.Base,+ {+ /**+ * Array containing all possible resizable handles.+ *+ * @property ALL_HANDLES+ * @type {String}+ */+ ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],++ /**+ * Regex which matches with the handles that could change the height of+ * the resizable element.+ *+ * @property REGEX_CHANGE_HEIGHT+ * @type {String}+ */+ REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,++ /**+ * Regex which matches with the handles that could change the left of+ * the resizable element.+ *+ * @property REGEX_CHANGE_LEFT+ * @type {String}+ */+ REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,++ /**+ * Regex which matches with the handles that could change the top of+ * the resizable element.+ *+ * @property REGEX_CHANGE_TOP+ * @type {String}+ */+ REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,++ /**+ * Regex which matches with the handles that could change the width of+ * the resizable element.+ *+ * @property REGEX_CHANGE_WIDTH+ * @type {String}+ */+ REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,++ /**+ * Template used to create the resize wrapper for the handles.+ *+ * @property HANDLES_WRAP_TEMPLATE+ * @type {String}+ */+ HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>',++ /**+ * Template used to create the resize wrapper node when needed.+ *+ * @property WRAP_TEMPLATE+ * @type {String}+ */+ WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>',++ /**+ * Template used to create each resize handle.+ *+ * @property HANDLE_TEMPLATE+ * @type {String}+ */+ HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' ++ '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' ++ '</div>',+++ /**+ * Each box has a content area and optional surrounding padding and+ * border areas. This property stores the sum of all horizontal+ * surrounding * information needed to adjust the node height.+ *+ * @property totalHSurrounding+ * @default 0+ * @type number+ */+ totalHSurrounding: 0,++ /**+ * Each box has a content area and optional surrounding padding and+ * border areas. This property stores the sum of all vertical+ * surrounding * information needed to adjust the node height.+ *+ * @property totalVSurrounding+ * @default 0+ * @type number+ */+ totalVSurrounding: 0,++ /**+ * Stores the <a href="Resize.html#attr_node">node</a>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property nodeSurrounding+ * @type Object+ * @default null+ */+ nodeSurrounding: null,++ /**+ * Stores the <a href="Resize.html#attr_wrapper">wrapper</a>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property wrapperSurrounding+ * @type Object+ * @default null+ */+ wrapperSurrounding: null,++ /**+ * Whether the handle being dragged can change the height.+ *+ * @property changeHeightHandles+ * @default false+ * @type boolean+ */+ changeHeightHandles: false,++ /**+ * Whether the handle being dragged can change the left.+ *+ * @property changeLeftHandles+ * @default false+ * @type boolean+ */+ changeLeftHandles: false,++ /**+ * Whether the handle being dragged can change the top.+ *+ * @property changeTopHandles+ * @default false+ * @type boolean+ */+ changeTopHandles: false,++ /**+ * Whether the handle being dragged can change the width.+ *+ * @property changeWidthHandles+ * @default false+ * @type boolean+ */+ changeWidthHandles: false,++ /**+ * Store DD.Delegate reference for the respective Resize instance.+ *+ * @property delegate+ * @default null+ * @type Object+ */+ delegate: null,++ /**+ * Stores the current values for the height, width, top and left. You are+ * able to manipulate these values on resize in order to change the resize+ * behavior.+ *+ * @property info+ * @type Object+ * @protected+ */+ info: null,++ /**+ * Stores the last values for the height, width, top and left.+ *+ * @property lastInfo+ * @type Object+ * @protected+ */+ lastInfo: null,++ /**+ * Stores the original values for the height, width, top and left, stored+ * on resize start.+ *+ * @property originalInfo+ * @type Object+ * @protected+ */+ originalInfo: null,++ /**+ * Construction logic executed during Resize instantiation. Lifecycle.+ *+ * @method initializer+ * @protected+ */+ initializer: function() {+ this._eventHandles = [];++ this.renderer();+ },++ /**+ * Create the DOM structure for the Resize. Lifecycle.+ *+ * @method renderUI+ * @protected+ */+ renderUI: function() {+ var instance = this;++ instance._renderHandles();+ },++ /**+ * Bind the events on the Resize UI. Lifecycle.+ *+ * @method bindUI+ * @protected+ */+ bindUI: function() {+ var instance = this;++ instance._createEvents();+ instance._bindDD();+ instance._bindHandle();+ },++ /**+ * Sync the Resize UI.+ *+ * @method syncUI+ * @protected+ */+ syncUI: function() {+ var instance = this;++ this.get(NODE).addClass(CSS_RESIZE);++ // hide handles if AUTO_HIDE is true+ instance._setHideHandlesUI(+ instance.get(AUTO_HIDE)+ );+ },++ /**+ * Destructor lifecycle implementation for the Resize class.+ * Detaches all previously attached listeners and removes the Resize handles.+ *+ * @method destructor+ * @protected+ */+ destructor: function() {+ var instance = this,+ node = instance.get(NODE),+ wrapper = instance.get(WRAPPER),+ pNode = wrapper.get(PARENT_NODE);++ Y.each(+ instance._eventHandles,+ function(handle) {+ handle.detach();+ }+ );++ instance._eventHandles.length = 0;++ // destroy handles dd and remove them from the dom+ instance.eachHandle(function(handleEl) {+ instance.delegate.dd.destroy();++ // remove handle+ handleEl.remove(true);+ });++ instance.delegate.destroy();++ // unwrap node+ if (instance.get(WRAP)) {+ instance._copyStyles(wrapper, node);++ if (pNode) {+ pNode.insertBefore(node, wrapper);+ }++ wrapper.remove(true);+ }++ node.removeClass(CSS_RESIZE);+ node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);+ },++ /**+ * Creates DOM (or manipulates DOM for progressive enhancement)+ * This method is invoked by initializer(). It's chained automatically for+ * subclasses if required.+ *+ * @method renderer+ * @protected+ */+ renderer: function() {+ this.renderUI();+ this.bindUI();+ this.syncUI();+ },++ /**+ * <p>Loop through each handle which is being used and executes a callback.</p>+ * <p>Example:</p>+ * <pre><code>instance.eachHandle(+ * function(handleName, index) { ... }+ * );</code></pre>+ *+ * @method eachHandle+ * @param {function} fn Callback function to be executed for each handle.+ */+ eachHandle: function(fn) {+ var instance = this;++ Y.each(+ instance.get(HANDLES),+ function(handle, i) {+ var handleEl = instance.get(+ handleAttrName(handle)+ );++ fn.apply(instance, [handleEl, handle, i]);+ }+ );+ },++ /**+ * Bind the handles DragDrop events to the Resize instance.+ *+ * @method _bindDD+ * @private+ */+ _bindDD: function() {+ var instance = this;++ instance.delegate = new Y.DD.Delegate(+ {+ bubbleTargets: instance,+ container: instance.get(HANDLES_WRAPPER),+ dragConfig: {+ clickPixelThresh: 0,+ clickTimeThresh: 0,+ useShim: true,+ move: false+ },+ nodes: DOT+CSS_RESIZE_HANDLE,+ target: false+ }+ );++ instance._eventHandles.push(+ instance.on('drag:drag', instance._handleResizeEvent),+ instance.on('drag:dropmiss', instance._handleMouseUpEvent),+ instance.on('drag:end', instance._handleResizeEndEvent),+ instance.on('drag:start', instance._handleResizeStartEvent)+ );+ },++ /**+ * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave).+ *+ * @method _bindHandle+ * @private+ */+ _bindHandle: function() {+ var instance = this,+ wrapper = instance.get(WRAPPER);++ instance._eventHandles.push(+ wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),+ wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),+ wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),+ wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)+ );+ },++ /**+ * Create the custom events used on the Resize.+ *+ * @method _createEvents+ * @private+ */+ _createEvents: function() {+ var instance = this,+ // create publish function for kweight optimization+ publish = function(name, fn) {+ instance.publish(name, {+ defaultFn: fn,+ queuable: false,+ emitFacade: true,+ bubbles: true,+ prefix: RESIZE+ });+ };++ /**+ * Handles the resize start event. Fired when a handle starts to be+ * dragged.+ *+ * @event resize:start+ * @preventable _defResizeStartFn+ * @param {Event.Facade} event The resize start event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE_START, this._defResizeStartFn);++ /**+ * Handles the resize event. Fired on each pixel when the handle is+ * being dragged.+ *+ * @event resize:resize+ * @preventable _defResizeFn+ * @param {Event.Facade} event The resize event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE, this._defResizeFn);++ /**+ * Handles the resize align event.+ *+ * @event resize:align+ * @preventable _defResizeAlignFn+ * @param {Event.Facade} event The resize align event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);++ /**+ * Handles the resize end event. Fired when a handle stop to be+ * dragged.+ *+ * @event resize:end+ * @preventable _defResizeEndFn+ * @param {Event.Facade} event The resize end event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE_END, this._defResizeEndFn);++ /**+ * Handles the resize mouseUp event. Fired when a mouseUp event happens on a+ * handle.+ *+ * @event resize:mouseUp+ * @preventable _defMouseUpFn+ * @param {Event.Facade} event The resize mouseUp event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_MOUSE_UP, this._defMouseUpFn);+ },++ /**+ * Responsible for loop each handle element and append to the wrapper.+ *+ * @method _renderHandles+ * @protected+ */+ _renderHandles: function() {+ var instance = this,+ wrapper = instance.get(WRAPPER),+ handlesWrapper = instance.get(HANDLES_WRAPPER);++ instance.eachHandle(function(handleEl) {+ handlesWrapper.append(handleEl);+ });++ wrapper.append(handlesWrapper);+ },++ /**+ * Creates the handle element based on the handle name and initialize the+ * DragDrop on it.+ *+ * @method _buildHandle+ * @param {String} handle Handle name ('t', 'tr', 'b', ...).+ * @protected+ */+ _buildHandle: function(handle) {+ var instance = this;++ return Y.Node.create(+ Y.Lang.sub(instance.HANDLE_TEMPLATE, {+ handle: handle+ })+ );+ },++ /**+ * Basic resize calculations.+ *+ * @method _calcResize+ * @protected+ */+ _calcResize: function() {+ var instance = this,+ handle = instance.handle,+ info = instance.info,+ originalInfo = instance.originalInfo,++ dx = info.actXY[0] - originalInfo.actXY[0],+ dy = info.actXY[1] - originalInfo.actXY[1];++ if (handle && Y.Resize.RULES[handle]) {+ Y.Resize.RULES[handle](instance, dx, dy);+ }+ else {+ Y.log('Handle rule not found: ' + handle, 'warn', 'resize');+ }+ },++ /**+ * Helper method to update the current size value on+ * <a href="Resize.html#property_info">info</a> to respect the+ * min/max values and fix the top/left calculations.+ *+ * @method _checkSize+ * @param {String} offset 'offsetHeight' or 'offsetWidth'+ * @param {number} size Size to restrict the offset+ * @protected+ */+ _checkSize: function(offset, size) {+ var instance = this,+ info = instance.info,+ originalInfo = instance.originalInfo,+ axis = (offset === OFFSET_HEIGHT) ? TOP : LEFT;++ // forcing the offsetHeight/offsetWidth to be the passed size+ info[offset] = size;++ // predicting, based on the original information, the last left valid in case of reach the min/max dimension+ // this calculation avoid browser event leaks when user interact very fast+ if (((axis === LEFT) && instance.changeLeftHandles) ||+ ((axis === TOP) && instance.changeTopHandles)) {++ info[axis] = originalInfo[axis] + originalInfo[offset] - size;+ }+ },++ /**+ * Copy relevant styles of the <a href="Resize.html#attr_node">node</a>+ * to the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _copyStyles+ * @param {Node} node Node from.+ * @param {Node} wrapper Node to.+ * @protected+ */+ _copyStyles: function(node, wrapper) {+ var position = node.getStyle(POSITION).toLowerCase(),+ surrounding = this._getBoxSurroundingInfo(node),+ wrapperStyle;++ // resizable wrapper should be positioned+ if (position === STATIC) {+ position = RELATIVE;+ }++ wrapperStyle = {+ position: position,+ left: getCompStyle(node, LEFT),+ top: getCompStyle(node, TOP)+ };++ Y.mix(wrapperStyle, surrounding.margin);+ Y.mix(wrapperStyle, surrounding.border);++ wrapper.setStyles(wrapperStyle);++ // remove margin and border from the internal node+ node.setStyles({ border: 0, margin: 0 });++ wrapper.sizeTo(+ node.get(OFFSET_WIDTH) + surrounding.totalHBorder,+ node.get(OFFSET_HEIGHT) + surrounding.totalVBorder+ );+ },++ // extract handle name from a string+ // using Y.cached to memoize the function for performance+ _extractHandleName: Y.cached(+ function(node) {+ var className = node.get(CLASS_NAME),++ match = className.match(+ new RegExp(+ getCN(RESIZE, HANDLE, '(\\w{1,2})\\b')+ )+ );++ return match ? match[1] : null;+ }+ ),++ /**+ * <p>Generates metadata to the <a href="Resize.html#property_info">info</a>+ * and <a href="Resize.html#property_originalInfo">originalInfo</a></p>+ * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>+ *+ * @method _getInfo+ * @param {Node} node+ * @param {EventFacade} event+ * @private+ */+ _getInfo: function(node, event) {+ var actXY = [0,0],+ drag = event.dragEvent.target,+ nodeXY = node.getXY(),+ nodeX = nodeXY[0],+ nodeY = nodeXY[1],+ offsetHeight = node.get(OFFSET_HEIGHT),+ offsetWidth = node.get(OFFSET_WIDTH);++ if (event) {+ // the xy that the node will be set to. Changing this will alter the position as it's dragged.+ actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);+ }++ return {+ actXY: actXY,+ bottom: (nodeY + offsetHeight),+ left: nodeX,+ offsetHeight: offsetHeight,+ offsetWidth: offsetWidth,+ right: (nodeX + offsetWidth),+ top: nodeY+ };+ },++ /**+ * Each box has a content area and optional surrounding margin,+ * padding and * border areas. This method get all this information from+ * the passed node. For more reference see+ * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">+ * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.+ *+ * @method _getBoxSurroundingInfo+ * @param {Node} node+ * @private+ * @return {Object}+ */+ _getBoxSurroundingInfo: function(node) {+ var info = {+ padding: {},+ margin: {},+ border: {}+ };++ if (isNode(node)) {+ Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {+ var paddingProperty = capitalize(PADDING, dir),+ marginProperty = capitalize(MARGIN, dir),+ borderWidthProperty = capitalize(BORDER, dir, WIDTH),+ borderColorProperty = capitalize(BORDER, dir, COLOR),+ borderStyleProperty = capitalize(BORDER, dir, STYLE);++ info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);+ info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);+ info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);+ info.margin[marginProperty] = getCompStyle(node, marginProperty);+ info.padding[paddingProperty] = getCompStyle(node, paddingProperty);+ });+ }++ info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));+ info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));+ info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));+ info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));++ return info;+ },++ /**+ * Sync the Resize UI with internal values from+ * <a href="Resize.html#property_info">info</a>.+ *+ * @method _syncUI+ * @protected+ */+ _syncUI: function() {+ var instance = this,+ info = instance.info,+ wrapperSurrounding = instance.wrapperSurrounding,+ wrapper = instance.get(WRAPPER),+ node = instance.get(NODE);++ wrapper.sizeTo(info.offsetWidth, info.offsetHeight);++ if (instance.changeLeftHandles || instance.changeTopHandles) {+ wrapper.setXY([info.left, info.top]);+ }++ // if a wrap node is being used+ if (!wrapper.compareTo(node)) {+ // the original internal node borders were copied to the wrapper on+ // _copyStyles, to compensate that subtract the borders from the internal node+ node.sizeTo(+ info.offsetWidth - wrapperSurrounding.totalHBorder,+ info.offsetHeight - wrapperSurrounding.totalVBorder+ );+ }++ // prevent webkit textarea resize+ if (Y.UA.webkit) {+ node.setStyle(RESIZE, NONE);+ }+ },++ /**+ * Update <code>instance.changeHeightHandles,+ * instance.changeLeftHandles, instance.changeTopHandles,+ * instance.changeWidthHandles</code> information.+ *+ * @method _updateChangeHandleInfo+ * @private+ */+ _updateChangeHandleInfo: function(handle) {+ var instance = this;++ instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);+ instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);+ instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);+ instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);+ },++ /**+ * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).+ *+ * @method _updateInfo+ * @private+ */+ _updateInfo: function(event) {+ var instance = this;++ instance.info = instance._getInfo(instance.get(WRAPPER), event);+ },++ /**+ * Update properties+ * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.+ *+ * @method _updateSurroundingInfo+ * @private+ */+ _updateSurroundingInfo: function() {+ var instance = this,+ node = instance.get(NODE),+ wrapper = instance.get(WRAPPER),+ nodeSurrounding = instance._getBoxSurroundingInfo(node),+ wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);++ instance.nodeSurrounding = nodeSurrounding;+ instance.wrapperSurrounding = wrapperSurrounding;++ instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);+ instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);+ },++ /**+ * Set the active state of the handles.+ *+ * @method _setActiveHandlesUI+ * @param {boolean} val True to activate the handles, false to deactivate.+ * @protected+ */+ _setActiveHandlesUI: function(val) {+ var instance = this,+ activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);++ if (activeHandleNode) {+ if (val) {+ // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active+ instance.eachHandle(+ function(handleEl) {+ handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ );++ activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ else {+ activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ }+ },++ /**+ * Setter for the handles attribute+ *+ * @method _setHandles+ * @protected+ * @param {String} val+ */+ _setHandles: function(val) {+ var instance = this,+ handles = [];++ // handles attr accepts both array or string+ if (isArray(val)) {+ handles = val;+ }+ else if (isString(val)) {+ // if the handles attr passed in is an ALL string...+ if (val.toLowerCase() === ALL) {+ handles = instance.ALL_HANDLES;+ }+ // otherwise, split the string to extract the handles+ else {+ Y.each(+ val.split(COMMA),+ function(node) {+ var handle = trim(node);++ // if its a valid handle, add it to the handles output+ if (indexOf(instance.ALL_HANDLES, handle) > -1) {+ handles.push(handle);+ }+ }+ );+ }+ }++ return handles;+ },++ /**+ * Set the visibility of the handles.+ *+ * @method _setHideHandlesUI+ * @param {boolean} val True to hide the handles, false to show.+ * @protected+ */+ _setHideHandlesUI: function(val) {+ var instance = this,+ wrapper = instance.get(WRAPPER);++ if (!instance.get(RESIZING)) {+ if (val) {+ wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);+ }+ else {+ wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);+ }+ }+ },++ /**+ * Setter for the wrap attribute+ *+ * @method _setWrap+ * @protected+ * @param {boolean} val+ */+ _setWrap: function(val) {+ var instance = this,+ node = instance.get(NODE),+ nodeName = node.get(NODE_NAME),+ typeRegex = instance.get(WRAP_TYPES);++ // if nodeName is listed on WRAP_TYPES force use the wrapper+ if (typeRegex.test(nodeName)) {+ val = true;+ }++ return val;+ },++ /**+ * Default resize:mouseUp handler+ *+ * @method _defMouseUpFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defMouseUpFn: function() {+ var instance = this;++ instance.set(RESIZING, false);+ },++ /**+ * Default resize:resize handler+ *+ * @method _defResizeFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeFn: function(event) {+ var instance = this;++ instance._resize(event);+ },++ /**+ * Logic method for _defResizeFn. Allow AOP.+ *+ * @method _resize+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resize: function(event) {+ var instance = this;++ instance._handleResizeAlignEvent(event.dragEvent);++ // _syncUI of the wrapper, not using proxy+ instance._syncUI();+ },++ /**+ * Default resize:align handler+ *+ * @method _defResizeAlignFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeAlignFn: function(event) {+ var instance = this;++ instance._resizeAlign(event);+ },++ /**+ * Logic method for _defResizeAlignFn. Allow AOP.+ *+ * @method _resizeAlign+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeAlign: function(event) {+ var instance = this,+ info,+ defMinHeight,+ defMinWidth;++ instance.lastInfo = instance.info;++ // update the instance.info values+ instance._updateInfo(event);++ info = instance.info;++ // basic resize calculations+ instance._calcResize();++ // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension+ if (!instance.con) {+ defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);+ defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);++ if (info.offsetHeight <= defMinHeight) {+ instance._checkSize(OFFSET_HEIGHT, defMinHeight);+ }++ if (info.offsetWidth <= defMinWidth) {+ instance._checkSize(OFFSET_WIDTH, defMinWidth);+ }+ }+ },++ /**+ * Default resize:end handler+ *+ * @method _defResizeEndFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeEndFn: function(event) {+ var instance = this;++ instance._resizeEnd(event);+ },++ /**+ * Logic method for _defResizeEndFn. Allow AOP.+ *+ * @method _resizeEnd+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeEnd: function(event) {+ var instance = this,+ drag = event.dragEvent.target;++ // reseting actXY from drag when drag end+ drag.actXY = [];++ // syncUI when resize end+ instance._syncUI();++ instance._setActiveHandlesUI(false);++ instance.set(ACTIVE_HANDLE, null);+ instance.set(ACTIVE_HANDLE_NODE, null);++ instance.handle = null;+ },++ /**+ * Default resize:start handler+ *+ * @method _defResizeStartFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeStartFn: function(event) {+ var instance = this;++ instance._resizeStart(event);+ },++ /**+ * Logic method for _defResizeStartFn. Allow AOP.+ *+ * @method _resizeStart+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeStart: function(event) {+ var instance = this,+ wrapper = instance.get(WRAPPER);++ instance.handle = instance.get(ACTIVE_HANDLE);++ instance.set(RESIZING, true);++ instance._updateSurroundingInfo();++ // create an originalInfo information for reference+ instance.originalInfo = instance._getInfo(wrapper, event);++ instance._updateInfo(event);+ },++ /**+ * Fires the resize:mouseUp event.+ *+ * @method _handleMouseUpEvent+ * @param {EventFacade} event resize:mouseUp event facade+ * @protected+ */+ _handleMouseUpEvent: function(event) {+ this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:resize event.+ *+ * @method _handleResizeEvent+ * @param {EventFacade} event resize:resize event facade+ * @protected+ */+ _handleResizeEvent: function(event) {+ this.fire(EV_RESIZE, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:align event.+ *+ * @method _handleResizeAlignEvent+ * @param {EventFacade} event resize:resize event facade+ * @protected+ */+ _handleResizeAlignEvent: function(event) {+ this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:end event.+ *+ * @method _handleResizeEndEvent+ * @param {EventFacade} event resize:end event facade+ * @protected+ */+ _handleResizeEndEvent: function(event) {+ this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:start event.+ *+ * @method _handleResizeStartEvent+ * @param {EventFacade} event resize:start event facade+ * @protected+ */+ _handleResizeStartEvent: function(event) {+ if (!this.get(ACTIVE_HANDLE)) {+ //This handles the "touch" case+ this._setHandleFromNode(event.target.get('node'));+ }+ this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });+ },++ /**+ * Mouseenter event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _onWrapperMouseEnter+ * @param {EventFacade} event+ * @protected+ */+ _onWrapperMouseEnter: function() {+ var instance = this;++ if (instance.get(AUTO_HIDE)) {+ instance._setHideHandlesUI(false);+ }+ },++ /**+ * Mouseleave event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _onWrapperMouseLeave+ * @param {EventFacade} event+ * @protected+ */+ _onWrapperMouseLeave: function() {+ var instance = this;++ if (instance.get(AUTO_HIDE)) {+ instance._setHideHandlesUI(true);+ }+ },++ /**+ * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).+ *+ * @method _setHandleFromNode+ * @param {Node} node+ * @protected+ */+ _setHandleFromNode: function(node) {+ var instance = this,+ handle = instance._extractHandleName(node);++ if (!instance.get(RESIZING)) {+ instance.set(ACTIVE_HANDLE, handle);+ instance.set(ACTIVE_HANDLE_NODE, node);++ instance._setActiveHandlesUI(true);+ instance._updateChangeHandleInfo(handle);+ }+ },++ /**+ * Mouseenter event handler for the handles.+ *+ * @method _onHandleMouseEnter+ * @param {EventFacade} event+ * @protected+ */+ _onHandleMouseEnter: function(event) {+ this._setHandleFromNode(event.currentTarget);+ },++ /**+ * Mouseout event handler for the handles.+ *+ * @method _onHandleMouseLeave+ * @param {EventFacade} event+ * @protected+ */+ _onHandleMouseLeave: function() {+ var instance = this;++ if (!instance.get(RESIZING)) {+ instance._setActiveHandlesUI(false);+ }+ },++ /**+ * Default value for the wrapper handles node attribute+ *+ * @method _valueHandlesWrapper+ * @protected+ * @readOnly+ */+ _valueHandlesWrapper: function() {+ return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);+ },++ /**+ * Default value for the wrapper attribute+ *+ * @method _valueWrapper+ * @protected+ * @readOnly+ */+ _valueWrapper: function() {+ var instance = this,+ node = instance.get(NODE),+ pNode = node.get(PARENT_NODE),+ // by deafult the wrapper is always the node+ wrapper = node;++ // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper+ if (instance.get(WRAP)) {+ wrapper = Y.Node.create(instance.WRAP_TEMPLATE);++ if (pNode) {+ pNode.insertBefore(wrapper, node);+ }++ wrapper.append(node);++ instance._copyStyles(node, wrapper);++ // remove positioning of wrapped node, the WRAPPER take care about positioning+ node.setStyles({+ position: STATIC,+ left: 0,+ top: 0+ });+ }++ return wrapper;+ }+ }+);++Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle) {+ // creating ATTRS with the handles elements+ Y.Resize.ATTRS[handleAttrName(handle)] = {+ setter: function() {+ return this._buildHandle(handle);+ },+ value: null,+ writeOnce: true+ };+});+++}, '3.7.3', {"requires": ["base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop"], "skinnable": true});
bundle/resize-base/resize-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("resize-base",function(e,t){function Lt(){Lt.superclass.constructor.apply(this,arguments)}var n=e.Lang,r=n.isArray,i=n.isBoolean,s=n.isNumber,o=n.isString,u=e.Array,a=n.trim,f=u.indexOf,l=",",c=".",h="",p="{handle}",d=" ",v="active",m="activeHandle",g="activeHandleNode",y="all",b="autoHide",w="border",E="bottom",S="className",x="color",T="defMinHeight",N="defMinWidth",C="handle",k="handles",L="handlesWrapper",A="hidden",O="inner",M="left",_="margin",D="node",P="nodeName",H="none",B="offsetHeight",j="offsetWidth",F="padding",I="parentNode",q="position",R="relative",U="resize",z="resizing",W="right",X="static",V="style",$="top",J="width",K="wrap",Q="wrapper",G="wrapTypes",Y="resize:mouseUp",Z="resize:resize",et="resize:align",tt="resize:end",nt="resize:start",rt="t",it="tr",st="r",ot="br",ut="b",at="bl",ft="l",lt="tl",ct=function(){return Array.prototype.slice.call(arguments).join(d)},ht=function(e){return Math.round(parseFloat(e))||0},pt=function(e,t){return e.getComputedStyle(t)},dt=function(e){return C+e.toUpperCase()},vt=function(t){return t instanceof e.Node},mt=e.cached(function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}),gt=e.cached(function(){var e=[],t=u(arguments,0,!0);return u.each(t,function(t,n){n>0&&(t=mt(t)),e.push(t)}),e.join(h)}),yt=e.ClassNameManager.getClassName,bt=yt(U),wt=yt(U,C),Et=yt(U,C,v),St=yt(U,C,O),xt=yt(U,C,O,p),Tt=yt(U,C,p),Nt=yt(U,A,k),Ct=yt(U,k,Q),kt=yt(U,Q);e.mix(Lt,{NAME:U,ATTRS:{activeHandle:{value:null,validator:function(t){return e.Lang.isString(t)||e.Lang.isNull(t)}},activeHandleNode:{value:null,validator:vt},autoHide:{value:!1,validator:i},defMinHeight:{value:15,validator:s},defMinWidth:{value:15,validator:s},handles:{setter:"_setHandles",value:y},handlesWrapper:{readOnly:!0,setter:e.one,valueFn:"_valueHandlesWrapper"},node:{setter:e.one},resizing:{value:!1,validator:i},wrap:{setter:"_setWrap",value:!1,validator:i},wrapTypes:{readOnly:!0,value:/^canvas|textarea|input|select|button|img|iframe|table|embed$/i},wrapper:{readOnly:!0,valueFn:"_valueWrapper",writeOnce:!0}},RULES:{b:function(e,t,n){var r=e.info,i=e.originalInfo;r.offsetHeight=i.offsetHeight+n},l:function(e,t,n){var r=e.info,i=e.originalInfo;r.left=i.left+t,r.offsetWidth=i.offsetWidth-t},r:function(e,t,n){var r=e.info,i=e.originalInfo;r.offsetWidth=i.offsetWidth+t},t:function(e,t,n){var r=e.info,i=e.originalInfo;r.top=i.top+n,r.offsetHeight=i.offsetHeight-n},tr:function(e,t,n){this.t.apply(this,arguments),this.r.apply(this,arguments)},bl:function(e,t,n){this.b.apply(this,arguments),this.l.apply(this,arguments)},br:function(e,t,n){this.b.apply(this,arguments),this.r.apply(this,arguments)},tl:function(e,t,n){this.t.apply(this,arguments),this.l.apply(this,arguments)}},capitalize:gt}),e.Resize=e.extend(Lt,e.Base,{ALL_HANDLES:[rt,it,st,ot,ut,at,ft,lt],REGEX_CHANGE_HEIGHT:/^(t|tr|b|bl|br|tl)$/i,REGEX_CHANGE_LEFT:/^(tl|l|bl)$/i,REGEX_CHANGE_TOP:/^(tl|t|tr)$/i,REGEX_CHANGE_WIDTH:/^(bl|br|l|r|tl|tr)$/i,HANDLES_WRAP_TEMPLATE:'<div class="'+Ct+'"></div>',WRAP_TEMPLATE:'<div class="'+kt+'"></div>',HANDLE_TEMPLATE:'<div class="'+ct(wt,Tt)+'">'+'<div class="'+ct(St,xt)+'"> </div>'+"</div>",totalHSurrounding:0,totalVSurrounding:0,nodeSurrounding:null,wrapperSurrounding:null,changeHeightHandles:!1,changeLeftHandles:!1,changeTopHandles:!1,changeWidthHandles:!1,delegate:null,info:null,lastInfo:null,originalInfo:null,initializer:function(){this._eventHandles=[],this.renderer()},renderUI:function(){var e=this;e._renderHandles()},bindUI:function(){var e=this;e._createEvents(),e._bindDD(),e._bindHandle()},syncUI:function(){var e=this;this.get(D).addClass(bt),e._setHideHandlesUI(e.get(b))},destructor:function(){var t=this,n=t.get(D),r=t.get(Q),i=r.get(I);e.each(t._eventHandles,function(e,t){e.detach()}),t._eventHandles.length=0,t.eachHandle(function(e){t.delegate.dd.destroy(),e.remove(!0)}),t.delegate.destroy(),t.get(K)&&(t._copyStyles(r,n),i&&i.insertBefore(n,r),r.remove(!0)),n.removeClass(bt),n.removeClass(Nt)},renderer:function(){this.renderUI(),this.bindUI(),this.syncUI()},eachHandle:function(t){var n=this;e.each(n.get(k),function(e,r){var i=n.get(dt(e));t.apply(n,[i,e,r])})},_bindDD:function(){var t=this;t.delegate=new e.DD.Delegate({bubbleTargets:t,container:t.get(L),dragConfig:{clickPixelThresh:0,clickTimeThresh:0,useShim:!0,move:!1},nodes:c+wt,target:!1}),t._eventHandles.push(t.on("drag:drag",t._handleResizeEvent),t.on("drag:dropmiss",t._handleMouseUpEvent),t.on("drag:end",t._handleResizeEndEvent),t.on("drag:start",t._handleResizeStartEvent))},_bindHandle:function(){var t=this,n=t.get(Q);t._eventHandles.push(n.on("mouseenter",e.bind(t._onWrapperMouseEnter,t)),n.on("mouseleave",e.bind(t._onWrapperMouseLeave,t)),n.delegate("mouseenter",e.bind(t._onHandleMouseEnter,t),c+wt),n.delegate("mouseleave",e.bind(t._onHandleMouseLeave,t),c+wt))},_createEvents:function(){var e=this,t=function(t,n){e.publish(t,{defaultFn:n,queuable:!1,emitFacade:!0,bubbles:!0,prefix:U})};t(nt,this._defResizeStartFn),t(Z,this._defResizeFn),t(et,this._defResizeAlignFn),t(tt,this._defResizeEndFn),t(Y,this._defMouseUpFn)},_renderHandles:function(){var e=this,t=e.get(Q),n=e.get(L);e.eachHandle(function(e){n.append(e)}),t.append(n)},_buildHandle:function(t){var n=this;return e.Node.create(e.Lang.sub(n.HANDLE_TEMPLATE,{handle:t}))},_calcResize:function(){var t=this,n=t.handle,r=t.info,i=t.originalInfo,s=r.actXY[0]-i.actXY[0],o=r.actXY[1]-i.actXY[1];n&&e.Resize.RULES[n]&&e.Resize.RULES[n](t,s,o)},_checkSize:function(e,t){var n=this,r=n.info,i=n.originalInfo,s=e==B?$:M;r[e]=t;if(s==M&&n.changeLeftHandles||s==$&&n.changeTopHandles)r[s]=i[s]+i[e]-t},_copyStyles:function(t,n){var r=t.getStyle(q).toLowerCase(),i=this._getBoxSurroundingInfo(t),s;r==X&&(r=R),s={position:r,left:pt(t,M),top:pt(t,$)},e.mix(s,i.margin),e.mix(s,i.border),n.setStyles(s),t.setStyles({border:0,margin:0}),n.sizeTo(t.get(j)+i.totalHBorder,t.get(B)+i.totalVBorder)},_extractHandleName:e.cached(function(e){var t=e.get(S),n=t.match(new RegExp(yt(U,C,"(\\w{1,2})\\b")));return n?n[1]:null}),_getInfo:function(e,t){var n=[0,0],r=t.dragEvent.target,i=e.getXY(),s=i[0],o=i[1],u=e.get(B),a=e.get(j);return t&&(n=r.actXY.length?r.actXY:r.lastXY),{actXY:n,bottom:o+u,left:s,offsetHeight:u,offsetWidth:a,right:s+a,top:o}},_getBoxSurroundingInfo:function(t){var n={padding:{},margin:{},border:{}};return vt(t)&&e.each([$,W,E,M],function(e){var r=gt(F,e),i=gt(_,e),s=gt(w,e,J),o=gt(w,e,x),u=gt(w,e,V);n.border[o]=pt(t,o),n.border[u]=pt(t,u),n.border[s]=pt(t,s),n.margin[i]=pt(t,i),n.padding[r]=pt(t,r)}),n.totalHBorder=ht(n.border.borderLeftWidth)+ht(n.border.borderRightWidth),n.totalHPadding=ht(n.padding.paddingLeft)+ht(n.padding.paddingRight),n.totalVBorder=ht(n.border.borderBottomWidth)+ht(n.border.borderTopWidth),n.totalVPadding=ht(n.padding.paddingBottom)+ht(n.padding.paddingTop),n},_syncUI:function(){var t=this,n=t.info,r=t.wrapperSurrounding,i=t.get(Q),s=t.get(D);i.sizeTo(n.offsetWidth,n.offsetHeight),(t.changeLeftHandles||t.changeTopHandles)&&i.setXY([n.left,n.top]),i.compareTo(s)||s.sizeTo(n.offsetWidth-r.totalHBorder,n.offsetHeight-r.totalVBorder),e.UA.webkit&&s.setStyle(U,H)},_updateChangeHandleInfo:function(e){var t=this;t.changeHeightHandles=t.REGEX_CHANGE_HEIGHT.test(e),t.changeLeftHandles=t.REGEX_CHANGE_LEFT.test(e),t.changeTopHandles=t.REGEX_CHANGE_TOP.test(e),t.changeWidthHandles=t.REGEX_CHANGE_WIDTH.test(e)},_updateInfo:function(e){var t=this;t.info=t._getInfo(t.get(Q),e)},_updateSurroundingInfo:function(){var e=this,t=e.get(D),n=e.get(Q),r=e._getBoxSurroundingInfo(t),i=e._getBoxSurroundingInfo(n);e.nodeSurrounding=r,e.wrapperSurrounding=i,e.totalVSurrounding=r.totalVPadding+i.totalVBorder,e.totalHSurrounding=r.totalHPadding+i.totalHBorder},_setActiveHandlesUI:function(e){var t=this,n=t.get(g);n&&(e?(t.eachHandle(function(e){e.removeClass(Et)}),n.addClass(Et)):n.removeClass(Et))},_setHandles:function(t){var n=this,i=[];return r(t)?i=t:o(t)&&(t.toLowerCase()==y?i=n.ALL_HANDLES:e.each(t.split(l),function(e,t){var r=a(e);f(n.ALL_HANDLES,r)>-1&&i.push(r)})),i},_setHideHandlesUI:function(e){var t=this,n=t.get(Q);t.get(z)||(e?n.addClass(Nt):n.removeClass(Nt))},_setWrap:function(e){var t=this,n=t.get(D),r=n.get(P),i=t.get(G);return i.test(r)&&(e=!0),e},_defMouseUpFn:function(e){var t=this;t.set(z,!1)},_defResizeFn:function(e){var t=this;t._resize(e)},_resize:function(e){var t=this;t._handleResizeAlignEvent(e.dragEvent),t._syncUI()},_defResizeAlignFn:function(e){var t=this;t._resizeAlign(e)},_resizeAlign:function(e){var t=this,n,r,i;t.lastInfo=t.info,t._updateInfo(e),n=t.info,t._calcResize(),t.con||(r=t.get(T)+t.totalVSurrounding,i=t.get(N)+t.totalHSurrounding,n.offsetHeight<=r&&t._checkSize(B,r),n.offsetWidth<=i&&t._checkSize(j,i))},_defResizeEndFn:function(e){var t=this;t._resizeEnd(e)},_resizeEnd:function(e){var t=this,n=e.dragEvent.target;n.actXY=[],t._syncUI(),t._setActiveHandlesUI(!1),t.set(m,null),t.set(g,null),t.handle=null},_defResizeStartFn:function(e){var t=this;t._resizeStart(e)},_resizeStart:function(e){var t=this,n=t.get(Q);t.handle=t.get(m),t.set(z,!0),t._updateSurroundingInfo(),t.originalInfo=t._getInfo(n,e),t._updateInfo(e)},_handleMouseUpEvent:function(e){this.fire(Y,{dragEvent:e,info:this.info})},_handleResizeEvent:function(e){this.fire(Z,{dragEvent:e,info:this.info})},_handleResizeAlignEvent:function(e){this.fire(et,{dragEvent:e,info:this.info})},_handleResizeEndEvent:function(e){this.fire(tt,{dragEvent:e,info:this.info})},_handleResizeStartEvent:function(e){this.get(m)||this._setHandleFromNode(e.target.get("node")),this.fire(nt,{dragEvent:e,info:this.info})},_onWrapperMouseEnter:function(e){var t=this;t.get(b)&&t._setHideHandlesUI(!1)},_onWrapperMouseLeave:function(e){var t=this;t.get(b)&&t._setHideHandlesUI(!0)},_setHandleFromNode:function(e){var t=this,n=t._extractHandleName(e);t.get(z)||(t.set(m,n),t.set(g,e),t._setActiveHandlesUI(!0),t._updateChangeHandleInfo(n))},_onHandleMouseEnter:function(e){this._setHandleFromNode(e.currentTarget)},_onHandleMouseLeave:function(e){var t=this;t.get(z)||t._setActiveHandlesUI(!1)},_valueHandlesWrapper:function(){return e.Node.create(this.HANDLES_WRAP_TEMPLATE)},_valueWrapper:function(){var t=this,n=t.get(D),r=n.get(I),i=n;return t.get(K)&&(i=e.Node.create(t.WRAP_TEMPLATE),r&&r.insertBefore(i,n),i.append(n),t._copyStyles(n,i),n.setStyles({position:X,left:0,top:0})),i}}),e.each(e.Resize.prototype.ALL_HANDLES,function(t,n){e.Resize.ATTRS[dt(t)]={setter:function(){return this._buildHandle(t)},value:null,writeOnce:!0}})},"3.7.2",{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0});+YUI.add("resize-base",function(e,t){function Lt(){Lt.superclass.constructor.apply(this,arguments)}var n=e.Lang,r=n.isArray,i=n.isBoolean,s=n.isNumber,o=n.isString,u=e.Array,a=n.trim,f=u.indexOf,l=",",c=".",h="",p="{handle}",d=" ",v="active",m="activeHandle",g="activeHandleNode",y="all",b="autoHide",w="border",E="bottom",S="className",x="color",T="defMinHeight",N="defMinWidth",C="handle",k="handles",L="handlesWrapper",A="hidden",O="inner",M="left",_="margin",D="node",P="nodeName",H="none",B="offsetHeight",j="offsetWidth",F="padding",I="parentNode",q="position",R="relative",U="resize",z="resizing",W="right",X="static",V="style",$="top",J="width",K="wrap",Q="wrapper",G="wrapTypes",Y="resize:mouseUp",Z="resize:resize",et="resize:align",tt="resize:end",nt="resize:start",rt="t",it="tr",st="r",ot="br",ut="b",at="bl",ft="l",lt="tl",ct=function(){return Array.prototype.slice.call(arguments).join(d)},ht=function(e){return Math.round(parseFloat(e))||0},pt=function(e,t){return e.getComputedStyle(t)},dt=function(e){return C+e.toUpperCase()},vt=function(t){return t instanceof e.Node},mt=e.cached(function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}),gt=e.cached(function(){var e=[],t=u(arguments,0,!0);return u.each(t,function(t,n){n>0&&(t=mt(t)),e.push(t)}),e.join(h)}),yt=e.ClassNameManager.getClassName,bt=yt(U),wt=yt(U,C),Et=yt(U,C,v),St=yt(U,C,O),xt=yt(U,C,O,p),Tt=yt(U,C,p),Nt=yt(U,A,k),Ct=yt(U,k,Q),kt=yt(U,Q);e.mix(Lt,{NAME:U,ATTRS:{activeHandle:{value:null,validator:function(t){return e.Lang.isString(t)||e.Lang.isNull(t)}},activeHandleNode:{value:null,validator:vt},autoHide:{value:!1,validator:i},defMinHeight:{value:15,validator:s},defMinWidth:{value:15,validator:s},handles:{setter:"_setHandles",value:y},handlesWrapper:{readOnly:!0,setter:e.one,valueFn:"_valueHandlesWrapper"},node:{setter:e.one},resizing:{value:!1,validator:i},wrap:{setter:"_setWrap",value:!1,validator:i},wrapTypes:{readOnly:!0,value:/^canvas|textarea|input|select|button|img|iframe|table|embed$/i},wrapper:{readOnly:!0,valueFn:"_valueWrapper",writeOnce:!0}},RULES:{b:function(e,t,n){var r=e.info,i=e.originalInfo;r.offsetHeight=i.offsetHeight+n},l:function(e,t){var n=e.info,r=e.originalInfo;n.left=r.left+t,n.offsetWidth=r.offsetWidth-t},r:function(e,t){var n=e.info,r=e.originalInfo;n.offsetWidth=r.offsetWidth+t},t:function(e,t,n){var r=e.info,i=e.originalInfo;r.top=i.top+n,r.offsetHeight=i.offsetHeight-n},tr:function(){this.t.apply(this,arguments),this.r.apply(this,arguments)},bl:function(){this.b.apply(this,arguments),this.l.apply(this,arguments)},br:function(){this.b.apply(this,arguments),this.r.apply(this,arguments)},tl:function(){this.t.apply(this,arguments),this.l.apply(this,arguments)}},capitalize:gt}),e.Resize=e.extend(Lt,e.Base,{ALL_HANDLES:[rt,it,st,ot,ut,at,ft,lt],REGEX_CHANGE_HEIGHT:/^(t|tr|b|bl|br|tl)$/i,REGEX_CHANGE_LEFT:/^(tl|l|bl)$/i,REGEX_CHANGE_TOP:/^(tl|t|tr)$/i,REGEX_CHANGE_WIDTH:/^(bl|br|l|r|tl|tr)$/i,HANDLES_WRAP_TEMPLATE:'<div class="'+Ct+'"></div>',WRAP_TEMPLATE:'<div class="'+kt+'"></div>',HANDLE_TEMPLATE:'<div class="'+ct(wt,Tt)+'">'+'<div class="'+ct(St,xt)+'"> </div>'+"</div>",totalHSurrounding:0,totalVSurrounding:0,nodeSurrounding:null,wrapperSurrounding:null,changeHeightHandles:!1,changeLeftHandles:!1,changeTopHandles:!1,changeWidthHandles:!1,delegate:null,info:null,lastInfo:null,originalInfo:null,initializer:function(){this._eventHandles=[],this.renderer()},renderUI:function(){var e=this;e._renderHandles()},bindUI:function(){var e=this;e._createEvents(),e._bindDD(),e._bindHandle()},syncUI:function(){var e=this;this.get(D).addClass(bt),e._setHideHandlesUI(e.get(b))},destructor:function(){var t=this,n=t.get(D),r=t.get(Q),i=r.get(I);e.each(t._eventHandles,function(e){e.detach()}),t._eventHandles.length=0,t.eachHandle(function(e){t.delegate.dd.destroy(),e.remove(!0)}),t.delegate.destroy(),t.get(K)&&(t._copyStyles(r,n),i&&i.insertBefore(n,r),r.remove(!0)),n.removeClass(bt),n.removeClass(Nt)},renderer:function(){this.renderUI(),this.bindUI(),this.syncUI()},eachHandle:function(t){var n=this;e.each(n.get(k),function(e,r){var i=n.get(dt(e));t.apply(n,[i,e,r])})},_bindDD:function(){var t=this;t.delegate=new e.DD.Delegate({bubbleTargets:t,container:t.get(L),dragConfig:{clickPixelThresh:0,clickTimeThresh:0,useShim:!0,move:!1},nodes:c+wt,target:!1}),t._eventHandles.push(t.on("drag:drag",t._handleResizeEvent),t.on("drag:dropmiss",t._handleMouseUpEvent),t.on("drag:end",t._handleResizeEndEvent),t.on("drag:start",t._handleResizeStartEvent))},_bindHandle:function(){var t=this,n=t.get(Q);t._eventHandles.push(n.on("mouseenter",e.bind(t._onWrapperMouseEnter,t)),n.on("mouseleave",e.bind(t._onWrapperMouseLeave,t)),n.delegate("mouseenter",e.bind(t._onHandleMouseEnter,t),c+wt),n.delegate("mouseleave",e.bind(t._onHandleMouseLeave,t),c+wt))},_createEvents:function(){var e=this,t=function(t,n){e.publish(t,{defaultFn:n,queuable:!1,emitFacade:!0,bubbles:!0,prefix:U})};t(nt,this._defResizeStartFn),t(Z,this._defResizeFn),t(et,this._defResizeAlignFn),t(tt,this._defResizeEndFn),t(Y,this._defMouseUpFn)},_renderHandles:function(){var e=this,t=e.get(Q),n=e.get(L);e.eachHandle(function(e){n.append(e)}),t.append(n)},_buildHandle:function(t){var n=this;return e.Node.create(e.Lang.sub(n.HANDLE_TEMPLATE,{handle:t}))},_calcResize:function(){var t=this,n=t.handle,r=t.info,i=t.originalInfo,s=r.actXY[0]-i.actXY[0],o=r.actXY[1]-i.actXY[1];n&&e.Resize.RULES[n]&&e.Resize.RULES[n](t,s,o)},_checkSize:function(e,t){var n=this,r=n.info,i=n.originalInfo,s=e===B?$:M;r[e]=t;if(s===M&&n.changeLeftHandles||s===$&&n.changeTopHandles)r[s]=i[s]+i[e]-t},_copyStyles:function(t,n){var r=t.getStyle(q).toLowerCase(),i=this._getBoxSurroundingInfo(t),s;r===X&&(r=R),s={position:r,left:pt(t,M),top:pt(t,$)},e.mix(s,i.margin),e.mix(s,i.border),n.setStyles(s),t.setStyles({border:0,margin:0}),n.sizeTo(t.get(j)+i.totalHBorder,t.get(B)+i.totalVBorder)},_extractHandleName:e.cached(function(e){var t=e.get(S),n=t.match(new RegExp(yt(U,C,"(\\w{1,2})\\b")));return n?n[1]:null}),_getInfo:function(e,t){var n=[0,0],r=t.dragEvent.target,i=e.getXY(),s=i[0],o=i[1],u=e.get(B),a=e.get(j);return t&&(n=r.actXY.length?r.actXY:r.lastXY),{actXY:n,bottom:o+u,left:s,offsetHeight:u,offsetWidth:a,right:s+a,top:o}},_getBoxSurroundingInfo:function(t){var n={padding:{},margin:{},border:{}};return vt(t)&&e.each([$,W,E,M],function(e){var r=gt(F,e),i=gt(_,e),s=gt(w,e,J),o=gt(w,e,x),u=gt(w,e,V);n.border[o]=pt(t,o),n.border[u]=pt(t,u),n.border[s]=pt(t,s),n.margin[i]=pt(t,i),n.padding[r]=pt(t,r)}),n.totalHBorder=ht(n.border.borderLeftWidth)+ht(n.border.borderRightWidth),n.totalHPadding=ht(n.padding.paddingLeft)+ht(n.padding.paddingRight),n.totalVBorder=ht(n.border.borderBottomWidth)+ht(n.border.borderTopWidth),n.totalVPadding=ht(n.padding.paddingBottom)+ht(n.padding.paddingTop),n},_syncUI:function(){var t=this,n=t.info,r=t.wrapperSurrounding,i=t.get(Q),s=t.get(D);i.sizeTo(n.offsetWidth,n.offsetHeight),(t.changeLeftHandles||t.changeTopHandles)&&i.setXY([n.left,n.top]),i.compareTo(s)||s.sizeTo(n.offsetWidth-r.totalHBorder,n.offsetHeight-r.totalVBorder),e.UA.webkit&&s.setStyle(U,H)},_updateChangeHandleInfo:function(e){var t=this;t.changeHeightHandles=t.REGEX_CHANGE_HEIGHT.test(e),t.changeLeftHandles=t.REGEX_CHANGE_LEFT.test(e),t.changeTopHandles=t.REGEX_CHANGE_TOP.test(e),t.changeWidthHandles=t.REGEX_CHANGE_WIDTH.test(e)},_updateInfo:function(e){var t=this;t.info=t._getInfo(t.get(Q),e)},_updateSurroundingInfo:function(){var e=this,t=e.get(D),n=e.get(Q),r=e._getBoxSurroundingInfo(t),i=e._getBoxSurroundingInfo(n);e.nodeSurrounding=r,e.wrapperSurrounding=i,e.totalVSurrounding=r.totalVPadding+i.totalVBorder,e.totalHSurrounding=r.totalHPadding+i.totalHBorder},_setActiveHandlesUI:function(e){var t=this,n=t.get(g);n&&(e?(t.eachHandle(function(e){e.removeClass(Et)}),n.addClass(Et)):n.removeClass(Et))},_setHandles:function(t){var n=this,i=[];return r(t)?i=t:o(t)&&(t.toLowerCase()===y?i=n.ALL_HANDLES:e.each(t.split(l),function(e){var t=a(e);f(n.ALL_HANDLES,t)>-1&&i.push(t)})),i},_setHideHandlesUI:function(e){var t=this,n=t.get(Q);t.get(z)||(e?n.addClass(Nt):n.removeClass(Nt))},_setWrap:function(e){var t=this,n=t.get(D),r=n.get(P),i=t.get(G);return i.test(r)&&(e=!0),e},_defMouseUpFn:function(){var e=this;e.set(z,!1)},_defResizeFn:function(e){var t=this;t._resize(e)},_resize:function(e){var t=this;t._handleResizeAlignEvent(e.dragEvent),t._syncUI()},_defResizeAlignFn:function(e){var t=this;t._resizeAlign(e)},_resizeAlign:function(e){var t=this,n,r,i;t.lastInfo=t.info,t._updateInfo(e),n=t.info,t._calcResize(),t.con||(r=t.get(T)+t.totalVSurrounding,i=t.get(N)+t.totalHSurrounding,n.offsetHeight<=r&&t._checkSize(B,r),n.offsetWidth<=i&&t._checkSize(j,i))},_defResizeEndFn:function(e){var t=this;t._resizeEnd(e)},_resizeEnd:function(e){var t=this,n=e.dragEvent.target;n.actXY=[],t._syncUI(),t._setActiveHandlesUI(!1),t.set(m,null),t.set(g,null),t.handle=null},_defResizeStartFn:function(e){var t=this;t._resizeStart(e)},_resizeStart:function(e){var t=this,n=t.get(Q);t.handle=t.get(m),t.set(z,!0),t._updateSurroundingInfo(),t.originalInfo=t._getInfo(n,e),t._updateInfo(e)},_handleMouseUpEvent:function(e){this.fire(Y,{dragEvent:e,info:this.info})},_handleResizeEvent:function(e){this.fire(Z,{dragEvent:e,info:this.info})},_handleResizeAlignEvent:function(e){this.fire(et,{dragEvent:e,info:this.info})},_handleResizeEndEvent:function(e){this.fire(tt,{dragEvent:e,info:this.info})},_handleResizeStartEvent:function(e){this.get(m)||this._setHandleFromNode(e.target.get("node")),this.fire(nt,{dragEvent:e,info:this.info})},_onWrapperMouseEnter:function(){var e=this;e.get(b)&&e._setHideHandlesUI(!1)},_onWrapperMouseLeave:function(){var e=this;e.get(b)&&e._setHideHandlesUI(!0)},_setHandleFromNode:function(e){var t=this,n=t._extractHandleName(e);t.get(z)||(t.set(m,n),t.set(g,e),t._setActiveHandlesUI(!0),t._updateChangeHandleInfo(n))},_onHandleMouseEnter:function(e){this._setHandleFromNode(e.currentTarget)},_onHandleMouseLeave:function(){var e=this;e.get(z)||e._setActiveHandlesUI(!1)},_valueHandlesWrapper:function(){return e.Node.create(this.HANDLES_WRAP_TEMPLATE)},_valueWrapper:function(){var t=this,n=t.get(D),r=n.get(I),i=n;return t.get(K)&&(i=e.Node.create(t.WRAP_TEMPLATE),r&&r.insertBefore(i,n),i.append(n),t._copyStyles(n,i),n.setStyles({position:X,left:0,top:0})),i}}),e.each(e.Resize.prototype.ALL_HANDLES,function(t){e.Resize.ATTRS[dt(t)]={setter:function(){return this._buildHandle(t)},value:null,writeOnce:!0}})},"3.7.3",{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0});
bundle/resize-base/resize-base.js view
@@ -1,1653 +1,1654 @@ /*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('resize-base', function (Y, NAME) {--/**- * The Resize Utility allows you to make an HTML element resizable.- * @module resize- * @main resize- */--var Lang = Y.Lang,- isArray = Lang.isArray,- isBoolean = Lang.isBoolean,- isNumber = Lang.isNumber,- isString = Lang.isString,-- YArray = Y.Array,- trim = Lang.trim,- indexOf = YArray.indexOf,-- COMMA = ',',- DOT = '.',- EMPTY_STR = '',- HANDLE_SUB = '{handle}',- SPACE = ' ',-- ACTIVE = 'active',- ACTIVE_HANDLE = 'activeHandle',- ACTIVE_HANDLE_NODE = 'activeHandleNode',- ALL = 'all',- AUTO_HIDE = 'autoHide',- BORDER = 'border',- BOTTOM = 'bottom',- CLASS_NAME = 'className',- COLOR = 'color',- DEF_MIN_HEIGHT = 'defMinHeight',- DEF_MIN_WIDTH = 'defMinWidth',- HANDLE = 'handle',- HANDLES = 'handles',- HANDLES_WRAPPER = 'handlesWrapper',- HIDDEN = 'hidden',- INNER = 'inner',- LEFT = 'left',- MARGIN = 'margin',- NODE = 'node',- NODE_NAME = 'nodeName',- NONE = 'none',- OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth',- PADDING = 'padding',- PARENT_NODE = 'parentNode',- POSITION = 'position',- RELATIVE = 'relative',- RESIZE = 'resize',- RESIZING = 'resizing',- RIGHT = 'right',- STATIC = 'static',- STYLE = 'style',- TOP = 'top',- WIDTH = 'width',- WRAP = 'wrap',- WRAPPER = 'wrapper',- WRAP_TYPES = 'wrapTypes',-- EV_MOUSE_UP = 'resize:mouseUp',- EV_RESIZE = 'resize:resize',- EV_RESIZE_ALIGN = 'resize:align',- EV_RESIZE_END = 'resize:end',- EV_RESIZE_START = 'resize:start',-- T = 't',- TR = 'tr',- R = 'r',- BR = 'br',- B = 'b',- BL = 'bl',- L = 'l',- TL = 'tl',-- concat = function() {- return Array.prototype.slice.call(arguments).join(SPACE);- },-- // round the passed number to get rid of pixel-flickering- toRoundNumber = function(num) {- return Math.round(parseFloat(num)) || 0;- },-- getCompStyle = function(node, val) {- return node.getComputedStyle(val);- },-- handleAttrName = function(handle) {- return HANDLE + handle.toUpperCase();- },-- isNode = function(v) {- return (v instanceof Y.Node);- },-- toInitialCap = Y.cached(- function(str) {- return str.substring(0, 1).toUpperCase() + str.substring(1);- }- ),-- capitalize = Y.cached(function() {- var out = [],- args = YArray(arguments, 0, true);-- YArray.each(args, function(part, i) {- if (i > 0) {- part = toInitialCap(part);- }- out.push(part);- });-- return out.join(EMPTY_STR);- }),-- getCN = Y.ClassNameManager.getClassName,-- CSS_RESIZE = getCN(RESIZE),- CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),- CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),- CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),- CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),- CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),- CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),- CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),- CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);--/**-A base class for Resize, providing:-- * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)- * Applies drag handles to an element to make it resizable- * Here is the list of valid resize handles:- `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can- read this list as top, top-right, right, bottom-right, bottom,- bottom-left, left, top-left.- * The drag handles are inserted into the element and positioned- absolute. Some elements, such as a textarea or image, don't support- children. To overcome that, set wrap:true in your config and the- element willbe wrapped for you automatically.--Quick Example:-- var instance = new Y.Resize({- node: '#resize1',- preserveRatio: true,- wrap: true,- maxHeight: 170,- maxWidth: 400,- handles: 't, tr, r, br, b, bl, l, tl'- });--Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for-Resize.--@class Resize-@param config {Object} Object literal specifying widget configuration properties.-@constructor-@extends Base-*/--function Resize() {- Resize.superclass.constructor.apply(this, arguments);-}--Y.mix(Resize, {- /**- * Static property provides a string to identify the class.- *- * @property NAME- * @type String- * @static- */- NAME: RESIZE,-- /**- * Static property used to define the default attribute- * configuration for the Resize.- *- * @property ATTRS- * @type Object- * @static- */- ATTRS: {- /**- * Stores the active handle during the resize.- *- * @attribute activeHandle- * @default null- * @private- * @type String- */- activeHandle: {- value: null,- validator: function(v) {- return Y.Lang.isString(v) || Y.Lang.isNull(v);- }- },-- /**- * Stores the active handle element during the resize.- *- * @attribute activeHandleNode- * @default null- * @private- * @type Node- */- activeHandleNode: {- value: null,- validator: isNode- },-- /**- * False to ensure that the resize handles are always visible, true to- * display them only when the user mouses over the resizable borders.- *- * @attribute autoHide- * @default false- * @type boolean- */- autoHide: {- value: false,- validator: isBoolean- },-- /**- * The default minimum height of the element. Only used when- * ResizeConstrained is not plugged.- *- * @attribute defMinHeight- * @default 15- * @type Number- */- defMinHeight: {- value: 15,- validator: isNumber- },-- /**- * The default minimum width of the element. Only used when- * ResizeConstrained is not plugged.- *- * @attribute defMinWidth- * @default 15- * @type Number- */- defMinWidth: {- value: 15,- validator: isNumber- },-- /**- * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',- * 'br', 'tl', 'tr'. Can use a shortcut of All.- *- * @attribute handles- * @default all- * @type Array | String- */- handles: {- setter: '_setHandles',- value: ALL- },-- /**- * Node to wrap the resize handles.- *- * @attribute handlesWrapper- * @type Node- */- handlesWrapper: {- readOnly: true,- setter: Y.one,- valueFn: '_valueHandlesWrapper'- },-- /**- * The selector or element to resize. Required.- *- * @attribute node- * @type Node- */- node: {- setter: Y.one- },-- /**- * True when the element is being Resized.- *- * @attribute resizing- * @default false- * @type boolean- */- resizing: {- value: false,- validator: isBoolean- },-- /**- * True to wrap an element with a div if needed (required for textareas- * and images, defaults to false) in favor of the handles config option.- * The wrapper element type (default div) could be over-riden passing the- * <code>wrapper</code> attribute.- *- * @attribute wrap- * @default false- * @type boolean- */- wrap: {- setter: '_setWrap',- value: false,- validator: isBoolean- },-- /**- * Elements that requires a wrapper by default. Normally are elements- * which cannot have children elements.- *- * @attribute wrapTypes- * @default /canvas|textarea|input|select|button|img/i- * @readOnly- * @type Regex- */- wrapTypes: {- readOnly: true,- value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i- },-- /**- * Element to wrap the <code>wrapTypes</code>. This element will house- * the handles elements.- *- * @attribute wrapper- * @default div- * @type String | Node- * @writeOnce- */- wrapper: {- readOnly: true,- valueFn: '_valueWrapper',- writeOnce: true- }- },-- RULES: {- b: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.offsetHeight = originalInfo.offsetHeight + dy;- },-- l: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.left = originalInfo.left + dx;- info.offsetWidth = originalInfo.offsetWidth - dx;- },-- r: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.offsetWidth = originalInfo.offsetWidth + dx;- },-- t: function(instance, dx, dy) {- var info = instance.info,- originalInfo = instance.originalInfo;-- info.top = originalInfo.top + dy;- info.offsetHeight = originalInfo.offsetHeight - dy;- },-- tr: function(instance, dx, dy) {- this.t.apply(this, arguments);- this.r.apply(this, arguments);- },-- bl: function(instance, dx, dy) {- this.b.apply(this, arguments);- this.l.apply(this, arguments);- },-- br: function(instance, dx, dy) {- this.b.apply(this, arguments);- this.r.apply(this, arguments);- },-- tl: function(instance, dx, dy) {- this.t.apply(this, arguments);- this.l.apply(this, arguments);- }- },-- capitalize: capitalize-});--Y.Resize = Y.extend(- Resize,- Y.Base,- {- /**- * Array containing all possible resizable handles.- *- * @property ALL_HANDLES- * @type {String}- */- ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],-- /**- * Regex which matches with the handles that could change the height of- * the resizable element.- *- * @property REGEX_CHANGE_HEIGHT- * @type {String}- */- REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,-- /**- * Regex which matches with the handles that could change the left of- * the resizable element.- *- * @property REGEX_CHANGE_LEFT- * @type {String}- */- REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,-- /**- * Regex which matches with the handles that could change the top of- * the resizable element.- *- * @property REGEX_CHANGE_TOP- * @type {String}- */- REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,-- /**- * Regex which matches with the handles that could change the width of- * the resizable element.- *- * @property REGEX_CHANGE_WIDTH- * @type {String}- */- REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,-- /**- * Template used to create the resize wrapper for the handles.- *- * @property HANDLES_WRAP_TEMPLATE- * @type {String}- */- HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>',-- /**- * Template used to create the resize wrapper node when needed.- *- * @property WRAP_TEMPLATE- * @type {String}- */- WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>',-- /**- * Template used to create each resize handle.- *- * @property HANDLE_TEMPLATE- * @type {String}- */- HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' +- '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' +- '</div>',--- /**- * Each box has a content area and optional surrounding padding and- * border areas. This property stores the sum of all horizontal- * surrounding * information needed to adjust the node height.- *- * @property totalHSurrounding- * @default 0- * @type number- */- totalHSurrounding: 0,-- /**- * Each box has a content area and optional surrounding padding and- * border areas. This property stores the sum of all vertical- * surrounding * information needed to adjust the node height.- *- * @property totalVSurrounding- * @default 0- * @type number- */- totalVSurrounding: 0,-- /**- * Stores the <a href="Resize.html#attr_node">node</a>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property nodeSurrounding- * @type Object- * @default null- */- nodeSurrounding: null,-- /**- * Stores the <a href="Resize.html#attr_wrapper">wrapper</a>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property wrapperSurrounding- * @type Object- * @default null- */- wrapperSurrounding: null,-- /**- * Whether the handle being dragged can change the height.- *- * @property changeHeightHandles- * @default false- * @type boolean- */- changeHeightHandles: false,-- /**- * Whether the handle being dragged can change the left.- *- * @property changeLeftHandles- * @default false- * @type boolean- */- changeLeftHandles: false,-- /**- * Whether the handle being dragged can change the top.- *- * @property changeTopHandles- * @default false- * @type boolean- */- changeTopHandles: false,-- /**- * Whether the handle being dragged can change the width.- *- * @property changeWidthHandles- * @default false- * @type boolean- */- changeWidthHandles: false,-- /**- * Store DD.Delegate reference for the respective Resize instance.- *- * @property delegate- * @default null- * @type Object- */- delegate: null,-- /**- * Stores the current values for the height, width, top and left. You are- * able to manipulate these values on resize in order to change the resize- * behavior.- *- * @property info- * @type Object- * @protected- */- info: null,-- /**- * Stores the last values for the height, width, top and left.- *- * @property lastInfo- * @type Object- * @protected- */- lastInfo: null,-- /**- * Stores the original values for the height, width, top and left, stored- * on resize start.- *- * @property originalInfo- * @type Object- * @protected- */- originalInfo: null,-- /**- * Construction logic executed during Resize instantiation. Lifecycle.- *- * @method initializer- * @protected- */- initializer: function() {- this._eventHandles = [];-- this.renderer();- },-- /**- * Create the DOM structure for the Resize. Lifecycle.- *- * @method renderUI- * @protected- */- renderUI: function() {- var instance = this;-- instance._renderHandles();- },-- /**- * Bind the events on the Resize UI. Lifecycle.- *- * @method bindUI- * @protected- */- bindUI: function() {- var instance = this;-- instance._createEvents();- instance._bindDD();- instance._bindHandle();- },-- /**- * Sync the Resize UI.- *- * @method syncUI- * @protected- */- syncUI: function() {- var instance = this;-- this.get(NODE).addClass(CSS_RESIZE);-- // hide handles if AUTO_HIDE is true- instance._setHideHandlesUI(- instance.get(AUTO_HIDE)- );- },-- /**- * Destructor lifecycle implementation for the Resize class.- * Detaches all previously attached listeners and removes the Resize handles.- *- * @method destructor- * @protected- */- destructor: function() {- var instance = this,- node = instance.get(NODE),- wrapper = instance.get(WRAPPER),- pNode = wrapper.get(PARENT_NODE);-- Y.each(- instance._eventHandles,- function(handle, index) {- handle.detach();- }- );-- instance._eventHandles.length = 0;-- // destroy handles dd and remove them from the dom- instance.eachHandle(function(handleEl) {- instance.delegate.dd.destroy();-- // remove handle- handleEl.remove(true);- });-- instance.delegate.destroy();-- // unwrap node- if (instance.get(WRAP)) {- instance._copyStyles(wrapper, node);-- if (pNode) {- pNode.insertBefore(node, wrapper);- }-- wrapper.remove(true);- }-- node.removeClass(CSS_RESIZE);- node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);- },-- /**- * Creates DOM (or manipulates DOM for progressive enhancement)- * This method is invoked by initializer(). It's chained automatically for- * subclasses if required.- *- * @method renderer- * @protected- */- renderer: function() {- this.renderUI();- this.bindUI();- this.syncUI();- },-- /**- * <p>Loop through each handle which is being used and executes a callback.</p>- * <p>Example:</p>- * <pre><code>instance.eachHandle(- * function(handleName, index) { ... }- * );</code></pre>- *- * @method eachHandle- * @param {function} fn Callback function to be executed for each handle.- */- eachHandle: function(fn) {- var instance = this;-- Y.each(- instance.get(HANDLES),- function(handle, i) {- var handleEl = instance.get(- handleAttrName(handle)- );-- fn.apply(instance, [handleEl, handle, i]);- }- );- },-- /**- * Bind the handles DragDrop events to the Resize instance.- *- * @method _bindDD- * @private- */- _bindDD: function() {- var instance = this;-- instance.delegate = new Y.DD.Delegate(- {- bubbleTargets: instance,- container: instance.get(HANDLES_WRAPPER),- dragConfig: {- clickPixelThresh: 0,- clickTimeThresh: 0,- useShim: true,- move: false- },- nodes: DOT+CSS_RESIZE_HANDLE,- target: false- }- );-- instance._eventHandles.push(- instance.on('drag:drag', instance._handleResizeEvent),- instance.on('drag:dropmiss', instance._handleMouseUpEvent),- instance.on('drag:end', instance._handleResizeEndEvent),- instance.on('drag:start', instance._handleResizeStartEvent)- );- },-- /**- * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave).- *- * @method _bindHandle- * @private- */- _bindHandle: function() {- var instance = this,- wrapper = instance.get(WRAPPER);-- instance._eventHandles.push(- wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),- wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),- wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),- wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)- );- },-- /**- * Create the custom events used on the Resize.- *- * @method _createEvents- * @private- */- _createEvents: function() {- var instance = this,- // create publish function for kweight optimization- publish = function(name, fn) {- instance.publish(name, {- defaultFn: fn,- queuable: false,- emitFacade: true,- bubbles: true,- prefix: RESIZE- });- };-- /**- * Handles the resize start event. Fired when a handle starts to be- * dragged.- *- * @event resize:start- * @preventable _defResizeStartFn- * @param {Event.Facade} event The resize start event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE_START, this._defResizeStartFn);-- /**- * Handles the resize event. Fired on each pixel when the handle is- * being dragged.- *- * @event resize:resize- * @preventable _defResizeFn- * @param {Event.Facade} event The resize event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE, this._defResizeFn);-- /**- * Handles the resize align event.- *- * @event resize:align- * @preventable _defResizeAlignFn- * @param {Event.Facade} event The resize align event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);-- /**- * Handles the resize end event. Fired when a handle stop to be- * dragged.- *- * @event resize:end- * @preventable _defResizeEndFn- * @param {Event.Facade} event The resize end event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_RESIZE_END, this._defResizeEndFn);-- /**- * Handles the resize mouseUp event. Fired when a mouseUp event happens on a- * handle.- *- * @event resize:mouseUp- * @preventable _defMouseUpFn- * @param {Event.Facade} event The resize mouseUp event.- * @bubbles Resize- * @type {Event.Custom}- */- publish(EV_MOUSE_UP, this._defMouseUpFn);- },-- /**- * Responsible for loop each handle element and append to the wrapper.- *- * @method _renderHandles- * @protected- */- _renderHandles: function() {- var instance = this,- wrapper = instance.get(WRAPPER),- handlesWrapper = instance.get(HANDLES_WRAPPER);-- instance.eachHandle(function(handleEl) {- handlesWrapper.append(handleEl);- });-- wrapper.append(handlesWrapper);- },-- /**- * Creates the handle element based on the handle name and initialize the- * DragDrop on it.- *- * @method _buildHandle- * @param {String} handle Handle name ('t', 'tr', 'b', ...).- * @protected- */- _buildHandle: function(handle) {- var instance = this;-- return Y.Node.create(- Y.Lang.sub(instance.HANDLE_TEMPLATE, {- handle: handle- })- );- },-- /**- * Basic resize calculations.- *- * @method _calcResize- * @protected- */- _calcResize: function() {- var instance = this,- handle = instance.handle,- info = instance.info,- originalInfo = instance.originalInfo,-- dx = info.actXY[0] - originalInfo.actXY[0],- dy = info.actXY[1] - originalInfo.actXY[1];-- if (handle && Y.Resize.RULES[handle]) {- Y.Resize.RULES[handle](instance, dx, dy);- }- else {- }- },-- /**- * Helper method to update the current size value on- * <a href="Resize.html#property_info">info</a> to respect the- * min/max values and fix the top/left calculations.- *- * @method _checkSize- * @param {String} offset 'offsetHeight' or 'offsetWidth'- * @param {number} size Size to restrict the offset- * @protected- */- _checkSize: function(offset, size) {- var instance = this,- info = instance.info,- originalInfo = instance.originalInfo,- axis = (offset == OFFSET_HEIGHT) ? TOP : LEFT;-- // forcing the offsetHeight/offsetWidth to be the passed size- info[offset] = size;-- // predicting, based on the original information, the last left valid in case of reach the min/max dimension- // this calculation avoid browser event leaks when user interact very fast- if (((axis == LEFT) && instance.changeLeftHandles) ||- ((axis == TOP) && instance.changeTopHandles)) {-- info[axis] = originalInfo[axis] + originalInfo[offset] - size;- }- },-- /**- * Copy relevant styles of the <a href="Resize.html#attr_node">node</a>- * to the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _copyStyles- * @param {Node} node Node from.- * @param {Node} wrapper Node to.- * @protected- */- _copyStyles: function(node, wrapper) {- var position = node.getStyle(POSITION).toLowerCase(),- surrounding = this._getBoxSurroundingInfo(node),- wrapperStyle;-- // resizable wrapper should be positioned- if (position == STATIC) {- position = RELATIVE;- }-- wrapperStyle = {- position: position,- left: getCompStyle(node, LEFT),- top: getCompStyle(node, TOP)- };-- Y.mix(wrapperStyle, surrounding.margin);- Y.mix(wrapperStyle, surrounding.border);-- wrapper.setStyles(wrapperStyle);-- // remove margin and border from the internal node- node.setStyles({ border: 0, margin: 0 });-- wrapper.sizeTo(- node.get(OFFSET_WIDTH) + surrounding.totalHBorder,- node.get(OFFSET_HEIGHT) + surrounding.totalVBorder- );- },-- // extract handle name from a string- // using Y.cached to memoize the function for performance- _extractHandleName: Y.cached(- function(node) {- var className = node.get(CLASS_NAME),-- match = className.match(- new RegExp(- getCN(RESIZE, HANDLE, '(\\w{1,2})\\b')- )- );-- return match ? match[1] : null;- }- ),-- /**- * <p>Generates metadata to the <a href="Resize.html#property_info">info</a>- * and <a href="Resize.html#property_originalInfo">originalInfo</a></p>- * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>- *- * @method _getInfo- * @param {Node} node- * @param {EventFacade} event- * @private- */- _getInfo: function(node, event) {- var actXY = [0,0],- drag = event.dragEvent.target,- nodeXY = node.getXY(),- nodeX = nodeXY[0],- nodeY = nodeXY[1],- offsetHeight = node.get(OFFSET_HEIGHT),- offsetWidth = node.get(OFFSET_WIDTH);-- if (event) {- // the xy that the node will be set to. Changing this will alter the position as it's dragged.- actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);- }-- return {- actXY: actXY,- bottom: (nodeY + offsetHeight),- left: nodeX,- offsetHeight: offsetHeight,- offsetWidth: offsetWidth,- right: (nodeX + offsetWidth),- top: nodeY- };- },-- /**- * Each box has a content area and optional surrounding margin,- * padding and * border areas. This method get all this information from- * the passed node. For more reference see- * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">- * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.- *- * @method _getBoxSurroundingInfo- * @param {Node} node- * @private- * @return {Object}- */- _getBoxSurroundingInfo: function(node) {- var info = {- padding: {},- margin: {},- border: {}- };-- if (isNode(node)) {- Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {- var paddingProperty = capitalize(PADDING, dir),- marginProperty = capitalize(MARGIN, dir),- borderWidthProperty = capitalize(BORDER, dir, WIDTH),- borderColorProperty = capitalize(BORDER, dir, COLOR),- borderStyleProperty = capitalize(BORDER, dir, STYLE);-- info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);- info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);- info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);- info.margin[marginProperty] = getCompStyle(node, marginProperty);- info.padding[paddingProperty] = getCompStyle(node, paddingProperty);- });- }-- info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));- info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));- info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));- info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));-- return info;- },-- /**- * Sync the Resize UI with internal values from- * <a href="Resize.html#property_info">info</a>.- *- * @method _syncUI- * @protected- */- _syncUI: function() {- var instance = this,- info = instance.info,- wrapperSurrounding = instance.wrapperSurrounding,- wrapper = instance.get(WRAPPER),- node = instance.get(NODE);-- wrapper.sizeTo(info.offsetWidth, info.offsetHeight);-- if (instance.changeLeftHandles || instance.changeTopHandles) {- wrapper.setXY([info.left, info.top]);- }-- // if a wrap node is being used- if (!wrapper.compareTo(node)) {- // the original internal node borders were copied to the wrapper on _copyStyles, to compensate that subtract the borders from the internal node- node.sizeTo(- info.offsetWidth - wrapperSurrounding.totalHBorder,- info.offsetHeight - wrapperSurrounding.totalVBorder- );- }-- // prevent webkit textarea resize- if (Y.UA.webkit) {- node.setStyle(RESIZE, NONE);- }- },-- /**- * Update <code>instance.changeHeightHandles,- * instance.changeLeftHandles, instance.changeTopHandles,- * instance.changeWidthHandles</code> information.- *- * @method _updateChangeHandleInfo- * @private- */- _updateChangeHandleInfo: function(handle) {- var instance = this;-- instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);- instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);- instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);- instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);- },-- /**- * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).- *- * @method _updateInfo- * @private- */- _updateInfo: function(event) {- var instance = this;-- instance.info = instance._getInfo(instance.get(WRAPPER), event);- },-- /**- * Update properties- * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,- * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.- *- * @method _updateSurroundingInfo- * @private- */- _updateSurroundingInfo: function() {- var instance = this,- node = instance.get(NODE),- wrapper = instance.get(WRAPPER),- nodeSurrounding = instance._getBoxSurroundingInfo(node),- wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);-- instance.nodeSurrounding = nodeSurrounding;- instance.wrapperSurrounding = wrapperSurrounding;-- instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);- instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);- },-- /**- * Set the active state of the handles.- *- * @method _setActiveHandlesUI- * @param {boolean} val True to activate the handles, false to deactivate.- * @protected- */- _setActiveHandlesUI: function(val) {- var instance = this,- activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);-- if (activeHandleNode) {- if (val) {- // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active- instance.eachHandle(- function(handleEl) {- handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);- }- );-- activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);- }- else {- activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);- }- }- },-- /**- * Setter for the handles attribute- *- * @method _setHandles- * @protected- * @param {String} val- */- _setHandles: function(val) {- var instance = this,- handles = [];-- // handles attr accepts both array or string- if (isArray(val)) {- handles = val;- }- else if (isString(val)) {- // if the handles attr passed in is an ALL string...- if (val.toLowerCase() == ALL) {- handles = instance.ALL_HANDLES;- }- // otherwise, split the string to extract the handles- else {- Y.each(- val.split(COMMA),- function(node, i) {- var handle = trim(node);-- // if its a valid handle, add it to the handles output- if (indexOf(instance.ALL_HANDLES, handle) > -1) {- handles.push(handle);- }- }- );- }- }-- return handles;- },-- /**- * Set the visibility of the handles.- *- * @method _setHideHandlesUI- * @param {boolean} val True to hide the handles, false to show.- * @protected- */- _setHideHandlesUI: function(val) {- var instance = this,- wrapper = instance.get(WRAPPER);-- if (!instance.get(RESIZING)) {- if (val) {- wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);- }- else {- wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);- }- }- },-- /**- * Setter for the wrap attribute- *- * @method _setWrap- * @protected- * @param {boolean} val- */- _setWrap: function(val) {- var instance = this,- node = instance.get(NODE),- nodeName = node.get(NODE_NAME),- typeRegex = instance.get(WRAP_TYPES);-- // if nodeName is listed on WRAP_TYPES force use the wrapper- if (typeRegex.test(nodeName)) {- val = true;- }-- return val;- },-- /**- * Default resize:mouseUp handler- *- * @method _defMouseUpFn- * @param {EventFacade} event The Event object- * @protected- */- _defMouseUpFn: function(event) {- var instance = this;-- instance.set(RESIZING, false);- },-- /**- * Default resize:resize handler- *- * @method _defResizeFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeFn: function(event) {- var instance = this;-- instance._resize(event);- },-- /**- * Logic method for _defResizeFn. Allow AOP.- *- * @method _resize- * @param {EventFacade} event The Event object- * @protected- */- _resize: function(event) {- var instance = this;-- instance._handleResizeAlignEvent(event.dragEvent);-- // _syncUI of the wrapper, not using proxy- instance._syncUI();- },-- /**- * Default resize:align handler- *- * @method _defResizeAlignFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeAlignFn: function(event) {- var instance = this;-- instance._resizeAlign(event);- },-- /**- * Logic method for _defResizeAlignFn. Allow AOP.- *- * @method _resizeAlign- * @param {EventFacade} event The Event object- * @protected- */- _resizeAlign: function(event) {- var instance = this,- info,- defMinHeight,- defMinWidth;-- instance.lastInfo = instance.info;-- // update the instance.info values- instance._updateInfo(event);-- info = instance.info;-- // basic resize calculations- instance._calcResize();-- // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension- if (!instance.con) {- defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);- defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);-- if (info.offsetHeight <= defMinHeight) {- instance._checkSize(OFFSET_HEIGHT, defMinHeight);- }-- if (info.offsetWidth <= defMinWidth) {- instance._checkSize(OFFSET_WIDTH, defMinWidth);- }- }- },-- /**- * Default resize:end handler- *- * @method _defResizeEndFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeEndFn: function(event) {- var instance = this;-- instance._resizeEnd(event);- },-- /**- * Logic method for _defResizeEndFn. Allow AOP.- *- * @method _resizeEnd- * @param {EventFacade} event The Event object- * @protected- */- _resizeEnd: function(event) {- var instance = this,- drag = event.dragEvent.target;-- // reseting actXY from drag when drag end- drag.actXY = [];-- // syncUI when resize end- instance._syncUI();-- instance._setActiveHandlesUI(false);-- instance.set(ACTIVE_HANDLE, null);- instance.set(ACTIVE_HANDLE_NODE, null);-- instance.handle = null;- },-- /**- * Default resize:start handler- *- * @method _defResizeStartFn- * @param {EventFacade} event The Event object- * @protected- */- _defResizeStartFn: function(event) {- var instance = this;-- instance._resizeStart(event);- },-- /**- * Logic method for _defResizeStartFn. Allow AOP.- *- * @method _resizeStart- * @param {EventFacade} event The Event object- * @protected- */- _resizeStart: function(event) {- var instance = this,- wrapper = instance.get(WRAPPER);-- instance.handle = instance.get(ACTIVE_HANDLE);-- instance.set(RESIZING, true);-- instance._updateSurroundingInfo();-- // create an originalInfo information for reference- instance.originalInfo = instance._getInfo(wrapper, event);-- instance._updateInfo(event);- },-- /**- * Fires the resize:mouseUp event.- *- * @method _handleMouseUpEvent- * @param {EventFacade} event resize:mouseUp event facade- * @protected- */- _handleMouseUpEvent: function(event) {- this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:resize event.- *- * @method _handleResizeEvent- * @param {EventFacade} event resize:resize event facade- * @protected- */- _handleResizeEvent: function(event) {- this.fire(EV_RESIZE, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:align event.- *- * @method _handleResizeAlignEvent- * @param {EventFacade} event resize:resize event facade- * @protected- */- _handleResizeAlignEvent: function(event) {- this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:end event.- *- * @method _handleResizeEndEvent- * @param {EventFacade} event resize:end event facade- * @protected- */- _handleResizeEndEvent: function(event) {- this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });- },-- /**- * Fires the resize:start event.- *- * @method _handleResizeStartEvent- * @param {EventFacade} event resize:start event facade- * @protected- */- _handleResizeStartEvent: function(event) {- if (!this.get(ACTIVE_HANDLE)) {- //This handles the "touch" case- this._setHandleFromNode(event.target.get('node'));- }- this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });- },-- /**- * Mouseenter event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _onWrapperMouseEnter- * @param {EventFacade} event- * @protected- */- _onWrapperMouseEnter: function(event) {- var instance = this;-- if (instance.get(AUTO_HIDE)) {- instance._setHideHandlesUI(false);- }- },-- /**- * Mouseleave event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.- *- * @method _onWrapperMouseLeave- * @param {EventFacade} event- * @protected- */- _onWrapperMouseLeave: function(event) {- var instance = this;-- if (instance.get(AUTO_HIDE)) {- instance._setHideHandlesUI(true);- }- },-- /**- * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).- *- * @method _setHandleFromNode- * @param {Node} node- * @protected- */- _setHandleFromNode: function(node) {- var instance = this,- handle = instance._extractHandleName(node);-- if (!instance.get(RESIZING)) {- instance.set(ACTIVE_HANDLE, handle);- instance.set(ACTIVE_HANDLE_NODE, node);-- instance._setActiveHandlesUI(true);- instance._updateChangeHandleInfo(handle);- }- },-- /**- * Mouseenter event handler for the handles.- *- * @method _onHandleMouseEnter- * @param {EventFacade} event- * @protected- */- _onHandleMouseEnter: function(event) {- this._setHandleFromNode(event.currentTarget);- },-- /**- * Mouseout event handler for the handles.- *- * @method _onHandleMouseLeave- * @param {EventFacade} event- * @protected- */- _onHandleMouseLeave: function(event) {- var instance = this;-- if (!instance.get(RESIZING)) {- instance._setActiveHandlesUI(false);- }- },-- /**- * Default value for the wrapper handles node attribute- *- * @method _valueHandlesWrapper- * @protected- * @readOnly- */- _valueHandlesWrapper: function() {- return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);- },-- /**- * Default value for the wrapper attribute- *- * @method _valueWrapper- * @protected- * @readOnly- */- _valueWrapper: function() {- var instance = this,- node = instance.get(NODE),- pNode = node.get(PARENT_NODE),- // by deafult the wrapper is always the node- wrapper = node;-- // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper- if (instance.get(WRAP)) {- wrapper = Y.Node.create(instance.WRAP_TEMPLATE);-- if (pNode) {- pNode.insertBefore(wrapper, node);- }-- wrapper.append(node);-- instance._copyStyles(node, wrapper);-- // remove positioning of wrapped node, the WRAPPER take care about positioning- node.setStyles({- position: STATIC,- left: 0,- top: 0- });- }-- return wrapper;- }- }-);--Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle, i) {- // creating ATTRS with the handles elements- Y.Resize.ATTRS[handleAttrName(handle)] = {- setter: function() {- return this._buildHandle(handle);- },- value: null,- writeOnce: true- };-});---}, '3.7.2', {"requires": ["base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop"], "skinnable": true});+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('resize-base', function (Y, NAME) {++/**+ * The Resize Utility allows you to make an HTML element resizable.+ * @module resize+ * @main resize+ */++var Lang = Y.Lang,+ isArray = Lang.isArray,+ isBoolean = Lang.isBoolean,+ isNumber = Lang.isNumber,+ isString = Lang.isString,++ yArray = Y.Array,+ trim = Lang.trim,+ indexOf = yArray.indexOf,++ COMMA = ',',+ DOT = '.',+ EMPTY_STR = '',+ HANDLE_SUB = '{handle}',+ SPACE = ' ',++ ACTIVE = 'active',+ ACTIVE_HANDLE = 'activeHandle',+ ACTIVE_HANDLE_NODE = 'activeHandleNode',+ ALL = 'all',+ AUTO_HIDE = 'autoHide',+ BORDER = 'border',+ BOTTOM = 'bottom',+ CLASS_NAME = 'className',+ COLOR = 'color',+ DEF_MIN_HEIGHT = 'defMinHeight',+ DEF_MIN_WIDTH = 'defMinWidth',+ HANDLE = 'handle',+ HANDLES = 'handles',+ HANDLES_WRAPPER = 'handlesWrapper',+ HIDDEN = 'hidden',+ INNER = 'inner',+ LEFT = 'left',+ MARGIN = 'margin',+ NODE = 'node',+ NODE_NAME = 'nodeName',+ NONE = 'none',+ OFFSET_HEIGHT = 'offsetHeight',+ OFFSET_WIDTH = 'offsetWidth',+ PADDING = 'padding',+ PARENT_NODE = 'parentNode',+ POSITION = 'position',+ RELATIVE = 'relative',+ RESIZE = 'resize',+ RESIZING = 'resizing',+ RIGHT = 'right',+ STATIC = 'static',+ STYLE = 'style',+ TOP = 'top',+ WIDTH = 'width',+ WRAP = 'wrap',+ WRAPPER = 'wrapper',+ WRAP_TYPES = 'wrapTypes',++ EV_MOUSE_UP = 'resize:mouseUp',+ EV_RESIZE = 'resize:resize',+ EV_RESIZE_ALIGN = 'resize:align',+ EV_RESIZE_END = 'resize:end',+ EV_RESIZE_START = 'resize:start',++ T = 't',+ TR = 'tr',+ R = 'r',+ BR = 'br',+ B = 'b',+ BL = 'bl',+ L = 'l',+ TL = 'tl',++ concat = function() {+ return Array.prototype.slice.call(arguments).join(SPACE);+ },++ // round the passed number to get rid of pixel-flickering+ toRoundNumber = function(num) {+ return Math.round(parseFloat(num)) || 0;+ },++ getCompStyle = function(node, val) {+ return node.getComputedStyle(val);+ },++ handleAttrName = function(handle) {+ return HANDLE + handle.toUpperCase();+ },++ isNode = function(v) {+ return (v instanceof Y.Node);+ },++ toInitialCap = Y.cached(+ function(str) {+ return str.substring(0, 1).toUpperCase() + str.substring(1);+ }+ ),++ capitalize = Y.cached(function() {+ var out = [],+ args = yArray(arguments, 0, true);++ yArray.each(args, function(part, i) {+ if (i > 0) {+ part = toInitialCap(part);+ }+ out.push(part);+ });++ return out.join(EMPTY_STR);+ }),++ getCN = Y.ClassNameManager.getClassName,++ CSS_RESIZE = getCN(RESIZE),+ CSS_RESIZE_HANDLE = getCN(RESIZE, HANDLE),+ CSS_RESIZE_HANDLE_ACTIVE = getCN(RESIZE, HANDLE, ACTIVE),+ CSS_RESIZE_HANDLE_INNER = getCN(RESIZE, HANDLE, INNER),+ CSS_RESIZE_HANDLE_INNER_PLACEHOLDER = getCN(RESIZE, HANDLE, INNER, HANDLE_SUB),+ CSS_RESIZE_HANDLE_PLACEHOLDER = getCN(RESIZE, HANDLE, HANDLE_SUB),+ CSS_RESIZE_HIDDEN_HANDLES = getCN(RESIZE, HIDDEN, HANDLES),+ CSS_RESIZE_HANDLES_WRAPPER = getCN(RESIZE, HANDLES, WRAPPER),+ CSS_RESIZE_WRAPPER = getCN(RESIZE, WRAPPER);++/**+A base class for Resize, providing:++ * Basic Lifecycle (initializer, renderUI, bindUI, syncUI, destructor)+ * Applies drag handles to an element to make it resizable+ * Here is the list of valid resize handles:+ `[ 't', 'tr', 'r', 'br', 'b', 'bl', 'l', 'tl' ]`. You can+ read this list as top, top-right, right, bottom-right, bottom,+ bottom-left, left, top-left.+ * The drag handles are inserted into the element and positioned+ absolute. Some elements, such as a textarea or image, don't support+ children. To overcome that, set wrap:true in your config and the+ element willbe wrapped for you automatically.++Quick Example:++ var instance = new Y.Resize({+ node: '#resize1',+ preserveRatio: true,+ wrap: true,+ maxHeight: 170,+ maxWidth: 400,+ handles: 't, tr, r, br, b, bl, l, tl'+ });++Check the list of <a href="Resize.html#configattributes">Configuration Attributes</a> available for+Resize.++@class Resize+@param config {Object} Object literal specifying widget configuration properties.+@constructor+@extends Base+*/++function Resize() {+ Resize.superclass.constructor.apply(this, arguments);+}++Y.mix(Resize, {+ /**+ * Static property provides a string to identify the class.+ *+ * @property NAME+ * @type String+ * @static+ */+ NAME: RESIZE,++ /**+ * Static property used to define the default attribute+ * configuration for the Resize.+ *+ * @property ATTRS+ * @type Object+ * @static+ */+ ATTRS: {+ /**+ * Stores the active handle during the resize.+ *+ * @attribute activeHandle+ * @default null+ * @private+ * @type String+ */+ activeHandle: {+ value: null,+ validator: function(v) {+ return Y.Lang.isString(v) || Y.Lang.isNull(v);+ }+ },++ /**+ * Stores the active handle element during the resize.+ *+ * @attribute activeHandleNode+ * @default null+ * @private+ * @type Node+ */+ activeHandleNode: {+ value: null,+ validator: isNode+ },++ /**+ * False to ensure that the resize handles are always visible, true to+ * display them only when the user mouses over the resizable borders.+ *+ * @attribute autoHide+ * @default false+ * @type boolean+ */+ autoHide: {+ value: false,+ validator: isBoolean+ },++ /**+ * The default minimum height of the element. Only used when+ * ResizeConstrained is not plugged.+ *+ * @attribute defMinHeight+ * @default 15+ * @type Number+ */+ defMinHeight: {+ value: 15,+ validator: isNumber+ },++ /**+ * The default minimum width of the element. Only used when+ * ResizeConstrained is not plugged.+ *+ * @attribute defMinWidth+ * @default 15+ * @type Number+ */+ defMinWidth: {+ value: 15,+ validator: isNumber+ },++ /**+ * The handles to use (any combination of): 't', 'b', 'r', 'l', 'bl',+ * 'br', 'tl', 'tr'. Can use a shortcut of All.+ *+ * @attribute handles+ * @default all+ * @type Array | String+ */+ handles: {+ setter: '_setHandles',+ value: ALL+ },++ /**+ * Node to wrap the resize handles.+ *+ * @attribute handlesWrapper+ * @type Node+ */+ handlesWrapper: {+ readOnly: true,+ setter: Y.one,+ valueFn: '_valueHandlesWrapper'+ },++ /**+ * The selector or element to resize. Required.+ *+ * @attribute node+ * @type Node+ */+ node: {+ setter: Y.one+ },++ /**+ * True when the element is being Resized.+ *+ * @attribute resizing+ * @default false+ * @type boolean+ */+ resizing: {+ value: false,+ validator: isBoolean+ },++ /**+ * True to wrap an element with a div if needed (required for textareas+ * and images, defaults to false) in favor of the handles config option.+ * The wrapper element type (default div) could be over-riden passing the+ * <code>wrapper</code> attribute.+ *+ * @attribute wrap+ * @default false+ * @type boolean+ */+ wrap: {+ setter: '_setWrap',+ value: false,+ validator: isBoolean+ },++ /**+ * Elements that requires a wrapper by default. Normally are elements+ * which cannot have children elements.+ *+ * @attribute wrapTypes+ * @default /canvas|textarea|input|select|button|img/i+ * @readOnly+ * @type Regex+ */+ wrapTypes: {+ readOnly: true,+ value: /^canvas|textarea|input|select|button|img|iframe|table|embed$/i+ },++ /**+ * Element to wrap the <code>wrapTypes</code>. This element will house+ * the handles elements.+ *+ * @attribute wrapper+ * @default div+ * @type String | Node+ * @writeOnce+ */+ wrapper: {+ readOnly: true,+ valueFn: '_valueWrapper',+ writeOnce: true+ }+ },++ RULES: {+ b: function(instance, dx, dy) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.offsetHeight = originalInfo.offsetHeight + dy;+ },++ l: function(instance, dx) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.left = originalInfo.left + dx;+ info.offsetWidth = originalInfo.offsetWidth - dx;+ },++ r: function(instance, dx) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.offsetWidth = originalInfo.offsetWidth + dx;+ },++ t: function(instance, dx, dy) {+ var info = instance.info,+ originalInfo = instance.originalInfo;++ info.top = originalInfo.top + dy;+ info.offsetHeight = originalInfo.offsetHeight - dy;+ },++ tr: function() {+ this.t.apply(this, arguments);+ this.r.apply(this, arguments);+ },++ bl: function() {+ this.b.apply(this, arguments);+ this.l.apply(this, arguments);+ },++ br: function() {+ this.b.apply(this, arguments);+ this.r.apply(this, arguments);+ },++ tl: function() {+ this.t.apply(this, arguments);+ this.l.apply(this, arguments);+ }+ },++ capitalize: capitalize+});++Y.Resize = Y.extend(+ Resize,+ Y.Base,+ {+ /**+ * Array containing all possible resizable handles.+ *+ * @property ALL_HANDLES+ * @type {String}+ */+ ALL_HANDLES: [ T, TR, R, BR, B, BL, L, TL ],++ /**+ * Regex which matches with the handles that could change the height of+ * the resizable element.+ *+ * @property REGEX_CHANGE_HEIGHT+ * @type {String}+ */+ REGEX_CHANGE_HEIGHT: /^(t|tr|b|bl|br|tl)$/i,++ /**+ * Regex which matches with the handles that could change the left of+ * the resizable element.+ *+ * @property REGEX_CHANGE_LEFT+ * @type {String}+ */+ REGEX_CHANGE_LEFT: /^(tl|l|bl)$/i,++ /**+ * Regex which matches with the handles that could change the top of+ * the resizable element.+ *+ * @property REGEX_CHANGE_TOP+ * @type {String}+ */+ REGEX_CHANGE_TOP: /^(tl|t|tr)$/i,++ /**+ * Regex which matches with the handles that could change the width of+ * the resizable element.+ *+ * @property REGEX_CHANGE_WIDTH+ * @type {String}+ */+ REGEX_CHANGE_WIDTH: /^(bl|br|l|r|tl|tr)$/i,++ /**+ * Template used to create the resize wrapper for the handles.+ *+ * @property HANDLES_WRAP_TEMPLATE+ * @type {String}+ */+ HANDLES_WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_HANDLES_WRAPPER+'"></div>',++ /**+ * Template used to create the resize wrapper node when needed.+ *+ * @property WRAP_TEMPLATE+ * @type {String}+ */+ WRAP_TEMPLATE: '<div class="'+CSS_RESIZE_WRAPPER+'"></div>',++ /**+ * Template used to create each resize handle.+ *+ * @property HANDLE_TEMPLATE+ * @type {String}+ */+ HANDLE_TEMPLATE: '<div class="'+concat(CSS_RESIZE_HANDLE, CSS_RESIZE_HANDLE_PLACEHOLDER)+'">' ++ '<div class="'+concat(CSS_RESIZE_HANDLE_INNER, CSS_RESIZE_HANDLE_INNER_PLACEHOLDER)+'"> </div>' ++ '</div>',+++ /**+ * Each box has a content area and optional surrounding padding and+ * border areas. This property stores the sum of all horizontal+ * surrounding * information needed to adjust the node height.+ *+ * @property totalHSurrounding+ * @default 0+ * @type number+ */+ totalHSurrounding: 0,++ /**+ * Each box has a content area and optional surrounding padding and+ * border areas. This property stores the sum of all vertical+ * surrounding * information needed to adjust the node height.+ *+ * @property totalVSurrounding+ * @default 0+ * @type number+ */+ totalVSurrounding: 0,++ /**+ * Stores the <a href="Resize.html#attr_node">node</a>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property nodeSurrounding+ * @type Object+ * @default null+ */+ nodeSurrounding: null,++ /**+ * Stores the <a href="Resize.html#attr_wrapper">wrapper</a>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property wrapperSurrounding+ * @type Object+ * @default null+ */+ wrapperSurrounding: null,++ /**+ * Whether the handle being dragged can change the height.+ *+ * @property changeHeightHandles+ * @default false+ * @type boolean+ */+ changeHeightHandles: false,++ /**+ * Whether the handle being dragged can change the left.+ *+ * @property changeLeftHandles+ * @default false+ * @type boolean+ */+ changeLeftHandles: false,++ /**+ * Whether the handle being dragged can change the top.+ *+ * @property changeTopHandles+ * @default false+ * @type boolean+ */+ changeTopHandles: false,++ /**+ * Whether the handle being dragged can change the width.+ *+ * @property changeWidthHandles+ * @default false+ * @type boolean+ */+ changeWidthHandles: false,++ /**+ * Store DD.Delegate reference for the respective Resize instance.+ *+ * @property delegate+ * @default null+ * @type Object+ */+ delegate: null,++ /**+ * Stores the current values for the height, width, top and left. You are+ * able to manipulate these values on resize in order to change the resize+ * behavior.+ *+ * @property info+ * @type Object+ * @protected+ */+ info: null,++ /**+ * Stores the last values for the height, width, top and left.+ *+ * @property lastInfo+ * @type Object+ * @protected+ */+ lastInfo: null,++ /**+ * Stores the original values for the height, width, top and left, stored+ * on resize start.+ *+ * @property originalInfo+ * @type Object+ * @protected+ */+ originalInfo: null,++ /**+ * Construction logic executed during Resize instantiation. Lifecycle.+ *+ * @method initializer+ * @protected+ */+ initializer: function() {+ this._eventHandles = [];++ this.renderer();+ },++ /**+ * Create the DOM structure for the Resize. Lifecycle.+ *+ * @method renderUI+ * @protected+ */+ renderUI: function() {+ var instance = this;++ instance._renderHandles();+ },++ /**+ * Bind the events on the Resize UI. Lifecycle.+ *+ * @method bindUI+ * @protected+ */+ bindUI: function() {+ var instance = this;++ instance._createEvents();+ instance._bindDD();+ instance._bindHandle();+ },++ /**+ * Sync the Resize UI.+ *+ * @method syncUI+ * @protected+ */+ syncUI: function() {+ var instance = this;++ this.get(NODE).addClass(CSS_RESIZE);++ // hide handles if AUTO_HIDE is true+ instance._setHideHandlesUI(+ instance.get(AUTO_HIDE)+ );+ },++ /**+ * Destructor lifecycle implementation for the Resize class.+ * Detaches all previously attached listeners and removes the Resize handles.+ *+ * @method destructor+ * @protected+ */+ destructor: function() {+ var instance = this,+ node = instance.get(NODE),+ wrapper = instance.get(WRAPPER),+ pNode = wrapper.get(PARENT_NODE);++ Y.each(+ instance._eventHandles,+ function(handle) {+ handle.detach();+ }+ );++ instance._eventHandles.length = 0;++ // destroy handles dd and remove them from the dom+ instance.eachHandle(function(handleEl) {+ instance.delegate.dd.destroy();++ // remove handle+ handleEl.remove(true);+ });++ instance.delegate.destroy();++ // unwrap node+ if (instance.get(WRAP)) {+ instance._copyStyles(wrapper, node);++ if (pNode) {+ pNode.insertBefore(node, wrapper);+ }++ wrapper.remove(true);+ }++ node.removeClass(CSS_RESIZE);+ node.removeClass(CSS_RESIZE_HIDDEN_HANDLES);+ },++ /**+ * Creates DOM (or manipulates DOM for progressive enhancement)+ * This method is invoked by initializer(). It's chained automatically for+ * subclasses if required.+ *+ * @method renderer+ * @protected+ */+ renderer: function() {+ this.renderUI();+ this.bindUI();+ this.syncUI();+ },++ /**+ * <p>Loop through each handle which is being used and executes a callback.</p>+ * <p>Example:</p>+ * <pre><code>instance.eachHandle(+ * function(handleName, index) { ... }+ * );</code></pre>+ *+ * @method eachHandle+ * @param {function} fn Callback function to be executed for each handle.+ */+ eachHandle: function(fn) {+ var instance = this;++ Y.each(+ instance.get(HANDLES),+ function(handle, i) {+ var handleEl = instance.get(+ handleAttrName(handle)+ );++ fn.apply(instance, [handleEl, handle, i]);+ }+ );+ },++ /**+ * Bind the handles DragDrop events to the Resize instance.+ *+ * @method _bindDD+ * @private+ */+ _bindDD: function() {+ var instance = this;++ instance.delegate = new Y.DD.Delegate(+ {+ bubbleTargets: instance,+ container: instance.get(HANDLES_WRAPPER),+ dragConfig: {+ clickPixelThresh: 0,+ clickTimeThresh: 0,+ useShim: true,+ move: false+ },+ nodes: DOT+CSS_RESIZE_HANDLE,+ target: false+ }+ );++ instance._eventHandles.push(+ instance.on('drag:drag', instance._handleResizeEvent),+ instance.on('drag:dropmiss', instance._handleMouseUpEvent),+ instance.on('drag:end', instance._handleResizeEndEvent),+ instance.on('drag:start', instance._handleResizeStartEvent)+ );+ },++ /**+ * Bind the events related to the handles (_onHandleMouseEnter, _onHandleMouseLeave).+ *+ * @method _bindHandle+ * @private+ */+ _bindHandle: function() {+ var instance = this,+ wrapper = instance.get(WRAPPER);++ instance._eventHandles.push(+ wrapper.on('mouseenter', Y.bind(instance._onWrapperMouseEnter, instance)),+ wrapper.on('mouseleave', Y.bind(instance._onWrapperMouseLeave, instance)),+ wrapper.delegate('mouseenter', Y.bind(instance._onHandleMouseEnter, instance), DOT+CSS_RESIZE_HANDLE),+ wrapper.delegate('mouseleave', Y.bind(instance._onHandleMouseLeave, instance), DOT+CSS_RESIZE_HANDLE)+ );+ },++ /**+ * Create the custom events used on the Resize.+ *+ * @method _createEvents+ * @private+ */+ _createEvents: function() {+ var instance = this,+ // create publish function for kweight optimization+ publish = function(name, fn) {+ instance.publish(name, {+ defaultFn: fn,+ queuable: false,+ emitFacade: true,+ bubbles: true,+ prefix: RESIZE+ });+ };++ /**+ * Handles the resize start event. Fired when a handle starts to be+ * dragged.+ *+ * @event resize:start+ * @preventable _defResizeStartFn+ * @param {Event.Facade} event The resize start event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE_START, this._defResizeStartFn);++ /**+ * Handles the resize event. Fired on each pixel when the handle is+ * being dragged.+ *+ * @event resize:resize+ * @preventable _defResizeFn+ * @param {Event.Facade} event The resize event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE, this._defResizeFn);++ /**+ * Handles the resize align event.+ *+ * @event resize:align+ * @preventable _defResizeAlignFn+ * @param {Event.Facade} event The resize align event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE_ALIGN, this._defResizeAlignFn);++ /**+ * Handles the resize end event. Fired when a handle stop to be+ * dragged.+ *+ * @event resize:end+ * @preventable _defResizeEndFn+ * @param {Event.Facade} event The resize end event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_RESIZE_END, this._defResizeEndFn);++ /**+ * Handles the resize mouseUp event. Fired when a mouseUp event happens on a+ * handle.+ *+ * @event resize:mouseUp+ * @preventable _defMouseUpFn+ * @param {Event.Facade} event The resize mouseUp event.+ * @bubbles Resize+ * @type {Event.Custom}+ */+ publish(EV_MOUSE_UP, this._defMouseUpFn);+ },++ /**+ * Responsible for loop each handle element and append to the wrapper.+ *+ * @method _renderHandles+ * @protected+ */+ _renderHandles: function() {+ var instance = this,+ wrapper = instance.get(WRAPPER),+ handlesWrapper = instance.get(HANDLES_WRAPPER);++ instance.eachHandle(function(handleEl) {+ handlesWrapper.append(handleEl);+ });++ wrapper.append(handlesWrapper);+ },++ /**+ * Creates the handle element based on the handle name and initialize the+ * DragDrop on it.+ *+ * @method _buildHandle+ * @param {String} handle Handle name ('t', 'tr', 'b', ...).+ * @protected+ */+ _buildHandle: function(handle) {+ var instance = this;++ return Y.Node.create(+ Y.Lang.sub(instance.HANDLE_TEMPLATE, {+ handle: handle+ })+ );+ },++ /**+ * Basic resize calculations.+ *+ * @method _calcResize+ * @protected+ */+ _calcResize: function() {+ var instance = this,+ handle = instance.handle,+ info = instance.info,+ originalInfo = instance.originalInfo,++ dx = info.actXY[0] - originalInfo.actXY[0],+ dy = info.actXY[1] - originalInfo.actXY[1];++ if (handle && Y.Resize.RULES[handle]) {+ Y.Resize.RULES[handle](instance, dx, dy);+ }+ else {+ }+ },++ /**+ * Helper method to update the current size value on+ * <a href="Resize.html#property_info">info</a> to respect the+ * min/max values and fix the top/left calculations.+ *+ * @method _checkSize+ * @param {String} offset 'offsetHeight' or 'offsetWidth'+ * @param {number} size Size to restrict the offset+ * @protected+ */+ _checkSize: function(offset, size) {+ var instance = this,+ info = instance.info,+ originalInfo = instance.originalInfo,+ axis = (offset === OFFSET_HEIGHT) ? TOP : LEFT;++ // forcing the offsetHeight/offsetWidth to be the passed size+ info[offset] = size;++ // predicting, based on the original information, the last left valid in case of reach the min/max dimension+ // this calculation avoid browser event leaks when user interact very fast+ if (((axis === LEFT) && instance.changeLeftHandles) ||+ ((axis === TOP) && instance.changeTopHandles)) {++ info[axis] = originalInfo[axis] + originalInfo[offset] - size;+ }+ },++ /**+ * Copy relevant styles of the <a href="Resize.html#attr_node">node</a>+ * to the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _copyStyles+ * @param {Node} node Node from.+ * @param {Node} wrapper Node to.+ * @protected+ */+ _copyStyles: function(node, wrapper) {+ var position = node.getStyle(POSITION).toLowerCase(),+ surrounding = this._getBoxSurroundingInfo(node),+ wrapperStyle;++ // resizable wrapper should be positioned+ if (position === STATIC) {+ position = RELATIVE;+ }++ wrapperStyle = {+ position: position,+ left: getCompStyle(node, LEFT),+ top: getCompStyle(node, TOP)+ };++ Y.mix(wrapperStyle, surrounding.margin);+ Y.mix(wrapperStyle, surrounding.border);++ wrapper.setStyles(wrapperStyle);++ // remove margin and border from the internal node+ node.setStyles({ border: 0, margin: 0 });++ wrapper.sizeTo(+ node.get(OFFSET_WIDTH) + surrounding.totalHBorder,+ node.get(OFFSET_HEIGHT) + surrounding.totalVBorder+ );+ },++ // extract handle name from a string+ // using Y.cached to memoize the function for performance+ _extractHandleName: Y.cached(+ function(node) {+ var className = node.get(CLASS_NAME),++ match = className.match(+ new RegExp(+ getCN(RESIZE, HANDLE, '(\\w{1,2})\\b')+ )+ );++ return match ? match[1] : null;+ }+ ),++ /**+ * <p>Generates metadata to the <a href="Resize.html#property_info">info</a>+ * and <a href="Resize.html#property_originalInfo">originalInfo</a></p>+ * <pre><code>bottom, actXY, left, top, offsetHeight, offsetWidth, right</code></pre>+ *+ * @method _getInfo+ * @param {Node} node+ * @param {EventFacade} event+ * @private+ */+ _getInfo: function(node, event) {+ var actXY = [0,0],+ drag = event.dragEvent.target,+ nodeXY = node.getXY(),+ nodeX = nodeXY[0],+ nodeY = nodeXY[1],+ offsetHeight = node.get(OFFSET_HEIGHT),+ offsetWidth = node.get(OFFSET_WIDTH);++ if (event) {+ // the xy that the node will be set to. Changing this will alter the position as it's dragged.+ actXY = (drag.actXY.length ? drag.actXY : drag.lastXY);+ }++ return {+ actXY: actXY,+ bottom: (nodeY + offsetHeight),+ left: nodeX,+ offsetHeight: offsetHeight,+ offsetWidth: offsetWidth,+ right: (nodeX + offsetWidth),+ top: nodeY+ };+ },++ /**+ * Each box has a content area and optional surrounding margin,+ * padding and * border areas. This method get all this information from+ * the passed node. For more reference see+ * <a href="http://www.w3.org/TR/CSS21/box.html#box-dimensions">+ * http://www.w3.org/TR/CSS21/box.html#box-dimensions</a>.+ *+ * @method _getBoxSurroundingInfo+ * @param {Node} node+ * @private+ * @return {Object}+ */+ _getBoxSurroundingInfo: function(node) {+ var info = {+ padding: {},+ margin: {},+ border: {}+ };++ if (isNode(node)) {+ Y.each([ TOP, RIGHT, BOTTOM, LEFT ], function(dir) {+ var paddingProperty = capitalize(PADDING, dir),+ marginProperty = capitalize(MARGIN, dir),+ borderWidthProperty = capitalize(BORDER, dir, WIDTH),+ borderColorProperty = capitalize(BORDER, dir, COLOR),+ borderStyleProperty = capitalize(BORDER, dir, STYLE);++ info.border[borderColorProperty] = getCompStyle(node, borderColorProperty);+ info.border[borderStyleProperty] = getCompStyle(node, borderStyleProperty);+ info.border[borderWidthProperty] = getCompStyle(node, borderWidthProperty);+ info.margin[marginProperty] = getCompStyle(node, marginProperty);+ info.padding[paddingProperty] = getCompStyle(node, paddingProperty);+ });+ }++ info.totalHBorder = (toRoundNumber(info.border.borderLeftWidth) + toRoundNumber(info.border.borderRightWidth));+ info.totalHPadding = (toRoundNumber(info.padding.paddingLeft) + toRoundNumber(info.padding.paddingRight));+ info.totalVBorder = (toRoundNumber(info.border.borderBottomWidth) + toRoundNumber(info.border.borderTopWidth));+ info.totalVPadding = (toRoundNumber(info.padding.paddingBottom) + toRoundNumber(info.padding.paddingTop));++ return info;+ },++ /**+ * Sync the Resize UI with internal values from+ * <a href="Resize.html#property_info">info</a>.+ *+ * @method _syncUI+ * @protected+ */+ _syncUI: function() {+ var instance = this,+ info = instance.info,+ wrapperSurrounding = instance.wrapperSurrounding,+ wrapper = instance.get(WRAPPER),+ node = instance.get(NODE);++ wrapper.sizeTo(info.offsetWidth, info.offsetHeight);++ if (instance.changeLeftHandles || instance.changeTopHandles) {+ wrapper.setXY([info.left, info.top]);+ }++ // if a wrap node is being used+ if (!wrapper.compareTo(node)) {+ // the original internal node borders were copied to the wrapper on+ // _copyStyles, to compensate that subtract the borders from the internal node+ node.sizeTo(+ info.offsetWidth - wrapperSurrounding.totalHBorder,+ info.offsetHeight - wrapperSurrounding.totalVBorder+ );+ }++ // prevent webkit textarea resize+ if (Y.UA.webkit) {+ node.setStyle(RESIZE, NONE);+ }+ },++ /**+ * Update <code>instance.changeHeightHandles,+ * instance.changeLeftHandles, instance.changeTopHandles,+ * instance.changeWidthHandles</code> information.+ *+ * @method _updateChangeHandleInfo+ * @private+ */+ _updateChangeHandleInfo: function(handle) {+ var instance = this;++ instance.changeHeightHandles = instance.REGEX_CHANGE_HEIGHT.test(handle);+ instance.changeLeftHandles = instance.REGEX_CHANGE_LEFT.test(handle);+ instance.changeTopHandles = instance.REGEX_CHANGE_TOP.test(handle);+ instance.changeWidthHandles = instance.REGEX_CHANGE_WIDTH.test(handle);+ },++ /**+ * Update <a href="Resize.html#property_info">info</a> values (bottom, actXY, left, top, offsetHeight, offsetWidth, right).+ *+ * @method _updateInfo+ * @private+ */+ _updateInfo: function(event) {+ var instance = this;++ instance.info = instance._getInfo(instance.get(WRAPPER), event);+ },++ /**+ * Update properties+ * <a href="Resize.html#property_nodeSurrounding">nodeSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">wrapperSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">totalVSurrounding</a>,+ * <a href="Resize.html#property_nodeSurrounding">totalHSurrounding</a>.+ *+ * @method _updateSurroundingInfo+ * @private+ */+ _updateSurroundingInfo: function() {+ var instance = this,+ node = instance.get(NODE),+ wrapper = instance.get(WRAPPER),+ nodeSurrounding = instance._getBoxSurroundingInfo(node),+ wrapperSurrounding = instance._getBoxSurroundingInfo(wrapper);++ instance.nodeSurrounding = nodeSurrounding;+ instance.wrapperSurrounding = wrapperSurrounding;++ instance.totalVSurrounding = (nodeSurrounding.totalVPadding + wrapperSurrounding.totalVBorder);+ instance.totalHSurrounding = (nodeSurrounding.totalHPadding + wrapperSurrounding.totalHBorder);+ },++ /**+ * Set the active state of the handles.+ *+ * @method _setActiveHandlesUI+ * @param {boolean} val True to activate the handles, false to deactivate.+ * @protected+ */+ _setActiveHandlesUI: function(val) {+ var instance = this,+ activeHandleNode = instance.get(ACTIVE_HANDLE_NODE);++ if (activeHandleNode) {+ if (val) {+ // remove CSS_RESIZE_HANDLE_ACTIVE from all handles before addClass on the active+ instance.eachHandle(+ function(handleEl) {+ handleEl.removeClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ );++ activeHandleNode.addClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ else {+ activeHandleNode.removeClass(CSS_RESIZE_HANDLE_ACTIVE);+ }+ }+ },++ /**+ * Setter for the handles attribute+ *+ * @method _setHandles+ * @protected+ * @param {String} val+ */+ _setHandles: function(val) {+ var instance = this,+ handles = [];++ // handles attr accepts both array or string+ if (isArray(val)) {+ handles = val;+ }+ else if (isString(val)) {+ // if the handles attr passed in is an ALL string...+ if (val.toLowerCase() === ALL) {+ handles = instance.ALL_HANDLES;+ }+ // otherwise, split the string to extract the handles+ else {+ Y.each(+ val.split(COMMA),+ function(node) {+ var handle = trim(node);++ // if its a valid handle, add it to the handles output+ if (indexOf(instance.ALL_HANDLES, handle) > -1) {+ handles.push(handle);+ }+ }+ );+ }+ }++ return handles;+ },++ /**+ * Set the visibility of the handles.+ *+ * @method _setHideHandlesUI+ * @param {boolean} val True to hide the handles, false to show.+ * @protected+ */+ _setHideHandlesUI: function(val) {+ var instance = this,+ wrapper = instance.get(WRAPPER);++ if (!instance.get(RESIZING)) {+ if (val) {+ wrapper.addClass(CSS_RESIZE_HIDDEN_HANDLES);+ }+ else {+ wrapper.removeClass(CSS_RESIZE_HIDDEN_HANDLES);+ }+ }+ },++ /**+ * Setter for the wrap attribute+ *+ * @method _setWrap+ * @protected+ * @param {boolean} val+ */+ _setWrap: function(val) {+ var instance = this,+ node = instance.get(NODE),+ nodeName = node.get(NODE_NAME),+ typeRegex = instance.get(WRAP_TYPES);++ // if nodeName is listed on WRAP_TYPES force use the wrapper+ if (typeRegex.test(nodeName)) {+ val = true;+ }++ return val;+ },++ /**+ * Default resize:mouseUp handler+ *+ * @method _defMouseUpFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defMouseUpFn: function() {+ var instance = this;++ instance.set(RESIZING, false);+ },++ /**+ * Default resize:resize handler+ *+ * @method _defResizeFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeFn: function(event) {+ var instance = this;++ instance._resize(event);+ },++ /**+ * Logic method for _defResizeFn. Allow AOP.+ *+ * @method _resize+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resize: function(event) {+ var instance = this;++ instance._handleResizeAlignEvent(event.dragEvent);++ // _syncUI of the wrapper, not using proxy+ instance._syncUI();+ },++ /**+ * Default resize:align handler+ *+ * @method _defResizeAlignFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeAlignFn: function(event) {+ var instance = this;++ instance._resizeAlign(event);+ },++ /**+ * Logic method for _defResizeAlignFn. Allow AOP.+ *+ * @method _resizeAlign+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeAlign: function(event) {+ var instance = this,+ info,+ defMinHeight,+ defMinWidth;++ instance.lastInfo = instance.info;++ // update the instance.info values+ instance._updateInfo(event);++ info = instance.info;++ // basic resize calculations+ instance._calcResize();++ // if Y.Plugin.ResizeConstrained is not plugged, check for min dimension+ if (!instance.con) {+ defMinHeight = (instance.get(DEF_MIN_HEIGHT) + instance.totalVSurrounding);+ defMinWidth = (instance.get(DEF_MIN_WIDTH) + instance.totalHSurrounding);++ if (info.offsetHeight <= defMinHeight) {+ instance._checkSize(OFFSET_HEIGHT, defMinHeight);+ }++ if (info.offsetWidth <= defMinWidth) {+ instance._checkSize(OFFSET_WIDTH, defMinWidth);+ }+ }+ },++ /**+ * Default resize:end handler+ *+ * @method _defResizeEndFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeEndFn: function(event) {+ var instance = this;++ instance._resizeEnd(event);+ },++ /**+ * Logic method for _defResizeEndFn. Allow AOP.+ *+ * @method _resizeEnd+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeEnd: function(event) {+ var instance = this,+ drag = event.dragEvent.target;++ // reseting actXY from drag when drag end+ drag.actXY = [];++ // syncUI when resize end+ instance._syncUI();++ instance._setActiveHandlesUI(false);++ instance.set(ACTIVE_HANDLE, null);+ instance.set(ACTIVE_HANDLE_NODE, null);++ instance.handle = null;+ },++ /**+ * Default resize:start handler+ *+ * @method _defResizeStartFn+ * @param {EventFacade} event The Event object+ * @protected+ */+ _defResizeStartFn: function(event) {+ var instance = this;++ instance._resizeStart(event);+ },++ /**+ * Logic method for _defResizeStartFn. Allow AOP.+ *+ * @method _resizeStart+ * @param {EventFacade} event The Event object+ * @protected+ */+ _resizeStart: function(event) {+ var instance = this,+ wrapper = instance.get(WRAPPER);++ instance.handle = instance.get(ACTIVE_HANDLE);++ instance.set(RESIZING, true);++ instance._updateSurroundingInfo();++ // create an originalInfo information for reference+ instance.originalInfo = instance._getInfo(wrapper, event);++ instance._updateInfo(event);+ },++ /**+ * Fires the resize:mouseUp event.+ *+ * @method _handleMouseUpEvent+ * @param {EventFacade} event resize:mouseUp event facade+ * @protected+ */+ _handleMouseUpEvent: function(event) {+ this.fire(EV_MOUSE_UP, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:resize event.+ *+ * @method _handleResizeEvent+ * @param {EventFacade} event resize:resize event facade+ * @protected+ */+ _handleResizeEvent: function(event) {+ this.fire(EV_RESIZE, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:align event.+ *+ * @method _handleResizeAlignEvent+ * @param {EventFacade} event resize:resize event facade+ * @protected+ */+ _handleResizeAlignEvent: function(event) {+ this.fire(EV_RESIZE_ALIGN, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:end event.+ *+ * @method _handleResizeEndEvent+ * @param {EventFacade} event resize:end event facade+ * @protected+ */+ _handleResizeEndEvent: function(event) {+ this.fire(EV_RESIZE_END, { dragEvent: event, info: this.info });+ },++ /**+ * Fires the resize:start event.+ *+ * @method _handleResizeStartEvent+ * @param {EventFacade} event resize:start event facade+ * @protected+ */+ _handleResizeStartEvent: function(event) {+ if (!this.get(ACTIVE_HANDLE)) {+ //This handles the "touch" case+ this._setHandleFromNode(event.target.get('node'));+ }+ this.fire(EV_RESIZE_START, { dragEvent: event, info: this.info });+ },++ /**+ * Mouseenter event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _onWrapperMouseEnter+ * @param {EventFacade} event+ * @protected+ */+ _onWrapperMouseEnter: function() {+ var instance = this;++ if (instance.get(AUTO_HIDE)) {+ instance._setHideHandlesUI(false);+ }+ },++ /**+ * Mouseleave event handler for the <a href="Resize.html#attr_wrapper">wrapper</a>.+ *+ * @method _onWrapperMouseLeave+ * @param {EventFacade} event+ * @protected+ */+ _onWrapperMouseLeave: function() {+ var instance = this;++ if (instance.get(AUTO_HIDE)) {+ instance._setHideHandlesUI(true);+ }+ },++ /**+ * Handles setting the activeHandle from a node, used from startDrag (for touch) and mouseenter (for mouse).+ *+ * @method _setHandleFromNode+ * @param {Node} node+ * @protected+ */+ _setHandleFromNode: function(node) {+ var instance = this,+ handle = instance._extractHandleName(node);++ if (!instance.get(RESIZING)) {+ instance.set(ACTIVE_HANDLE, handle);+ instance.set(ACTIVE_HANDLE_NODE, node);++ instance._setActiveHandlesUI(true);+ instance._updateChangeHandleInfo(handle);+ }+ },++ /**+ * Mouseenter event handler for the handles.+ *+ * @method _onHandleMouseEnter+ * @param {EventFacade} event+ * @protected+ */+ _onHandleMouseEnter: function(event) {+ this._setHandleFromNode(event.currentTarget);+ },++ /**+ * Mouseout event handler for the handles.+ *+ * @method _onHandleMouseLeave+ * @param {EventFacade} event+ * @protected+ */+ _onHandleMouseLeave: function() {+ var instance = this;++ if (!instance.get(RESIZING)) {+ instance._setActiveHandlesUI(false);+ }+ },++ /**+ * Default value for the wrapper handles node attribute+ *+ * @method _valueHandlesWrapper+ * @protected+ * @readOnly+ */+ _valueHandlesWrapper: function() {+ return Y.Node.create(this.HANDLES_WRAP_TEMPLATE);+ },++ /**+ * Default value for the wrapper attribute+ *+ * @method _valueWrapper+ * @protected+ * @readOnly+ */+ _valueWrapper: function() {+ var instance = this,+ node = instance.get(NODE),+ pNode = node.get(PARENT_NODE),+ // by deafult the wrapper is always the node+ wrapper = node;++ // if the node is listed on the wrapTypes or wrap is set to true, create another wrapper+ if (instance.get(WRAP)) {+ wrapper = Y.Node.create(instance.WRAP_TEMPLATE);++ if (pNode) {+ pNode.insertBefore(wrapper, node);+ }++ wrapper.append(node);++ instance._copyStyles(node, wrapper);++ // remove positioning of wrapped node, the WRAPPER take care about positioning+ node.setStyles({+ position: STATIC,+ left: 0,+ top: 0+ });+ }++ return wrapper;+ }+ }+);++Y.each(Y.Resize.prototype.ALL_HANDLES, function(handle) {+ // creating ATTRS with the handles elements+ Y.Resize.ATTRS[handleAttrName(handle)] = {+ setter: function() {+ return this._buildHandle(handle);+ },+ value: null,+ writeOnce: true+ };+});+++}, '3.7.3', {"requires": ["base", "widget", "event", "oop", "dd-drag", "dd-delegate", "dd-drop"], "skinnable": true});
bundle/resize-constrain/assets/resize-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-constrain/assets/skins/night/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-constrain/assets/skins/sam/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-constrain/resize-constrain-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/resize-constrain/resize-constrain.js", code: [] };-_yuitest_coverage["build/resize-constrain/resize-constrain.js"].code=["YUI.add('resize-constrain', function (Y, NAME) {","","var Lang = Y.Lang,"," isBoolean = Lang.isBoolean,"," isNumber = Lang.isNumber,"," isString = Lang.isString,"," capitalize = Y.Resize.capitalize,",""," isNode = function(v) {"," return (v instanceof Y.Node);"," },",""," toNumber = function(num) {"," return parseFloat(num) || 0;"," },",""," BORDER_BOTTOM_WIDTH = 'borderBottomWidth',"," BORDER_LEFT_WIDTH = 'borderLeftWidth',"," BORDER_RIGHT_WIDTH = 'borderRightWidth',"," BORDER_TOP_WIDTH = 'borderTopWidth',"," BORDER = 'border',"," BOTTOM = 'bottom',"," CON = 'con',"," CONSTRAIN = 'constrain',"," HOST = 'host',"," LEFT = 'left',"," MAX_HEIGHT = 'maxHeight',"," MAX_WIDTH = 'maxWidth',"," MIN_HEIGHT = 'minHeight',"," MIN_WIDTH = 'minWidth',"," NODE = 'node',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," PRESEVE_RATIO = 'preserveRatio',"," REGION = 'region',"," RESIZE_CONTRAINED = 'resizeConstrained',"," RIGHT = 'right',"," TICK_X = 'tickX',"," TICK_Y = 'tickY',"," TOP = 'top',"," WIDTH = 'width',"," VIEW = 'view',"," VIEWPORT_REGION = 'viewportRegion';","","/**","A Resize plugin that will attempt to constrain the resize node to the boundaries.","@module resize","@submodule resize-contrain","@class ResizeConstrained","@param config {Object} Object literal specifying widget configuration properties.","@constructor","@extends Plugin.Base","@namespace Plugin","*/","","function ResizeConstrained() {"," ResizeConstrained.superclass.constructor.apply(this, arguments);","}","","Y.mix(ResizeConstrained, {"," NAME: RESIZE_CONTRAINED,",""," NS: CON,",""," ATTRS: {"," /**"," * Will attempt to constrain the resize node to the boundaries. Arguments:<br>"," * 'view': Contrain to Viewport<br>"," * '#selector_string': Constrain to this node<br>"," * '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions"," *"," * @attribute constrain"," * @type {String|Object|Node}"," */"," constrain: {"," setter: function(v) {"," if (v && (isNode(v) || isString(v) || v.nodeType)) {"," v = Y.one(v);"," }",""," return v;"," }"," },",""," /**"," * The minimum height of the element"," *"," * @attribute minHeight"," * @default 15"," * @type Number"," */"," minHeight: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The minimum width of the element"," *"," * @attribute minWidth"," * @default 15"," * @type Number"," */"," minWidth: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The maximum height of the element"," *"," * @attribute maxHeight"," * @default Infinity"," * @type Number"," */"," maxHeight: {"," value: Infinity,"," validator: isNumber"," },",""," /**"," * The maximum width of the element"," *"," * @attribute maxWidth"," * @default Infinity"," * @type Number"," */"," maxWidth: {"," value: Infinity,"," validator: isNumber"," },",""," /**"," * Maintain the element's ratio when resizing."," *"," * @attribute preserveRatio"," * @default false"," * @type boolean"," */"," preserveRatio: {"," value: false,"," validator: isBoolean"," },",""," /**"," * The number of x ticks to span the resize to."," *"," * @attribute tickX"," * @default false"," * @type Number | false"," */"," tickX: {"," value: false"," },",""," /**"," * The number of y ticks to span the resize to."," *"," * @attribute tickY"," * @default false"," * @type Number | false"," */"," tickY: {"," value: false"," }"," }","});","","Y.extend(ResizeConstrained, Y.Plugin.Base, {"," /**"," * Stores the <code>constrain</code>"," * surrounding information retrieved from"," * <a href=\"Resize.html#method__getBoxSurroundingInfo\">_getBoxSurroundingInfo</a>."," *"," * @property constrainSurrounding"," * @type Object"," * @default null"," */"," constrainSurrounding: null,",""," initializer: function() {"," var instance = this,"," host = instance.get(HOST);",""," host.delegate.dd.plug("," Y.Plugin.DDConstrained,"," {"," tickX: instance.get(TICK_X),"," tickY: instance.get(TICK_Y)"," }"," );",""," host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));"," host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));"," },",""," /**"," * Helper method to update the current values on"," * <a href=\"Resize.html#property_info\">info</a> to respect the"," * constrain node."," *"," * @method _checkConstrain"," * @param {String} axis 'top' or 'left'"," * @param {String} axisConstrain 'bottom' or 'right'"," * @param {String} offset 'offsetHeight' or 'offsetWidth'"," * @protected"," */"," _checkConstrain: function(axis, axisConstrain, offset) {"," var instance = this,"," point1,"," point1Constrain,"," point2,"," point2Constrain,"," host = instance.get(HOST),"," info = host.info,"," constrainBorders = instance.constrainSurrounding.border,"," region = instance._getConstrainRegion();",""," if (region) {"," point1 = info[axis] + info[offset];"," point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]);",""," if (point1 >= point1Constrain) {"," info[offset] -= (point1 - point1Constrain);"," }",""," point2 = info[axis];"," point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]);",""," if (point2 <= point2Constrain) {"," info[axis] += (point2Constrain - point2);"," info[offset] -= (point2Constrain - point2);"," }"," }"," },",""," /**"," * Update the current values on <a href=\"Resize.html#property_info\">info</a>"," * to respect the maxHeight and minHeight."," *"," * @method _checkHeight"," * @protected"," */"," _checkHeight: function() {"," var instance = this,"," host = instance.get(HOST),"," info = host.info,"," maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),"," minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding);",""," instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT);",""," if (info.offsetHeight > maxHeight) {"," host._checkSize(OFFSET_HEIGHT, maxHeight);"," }",""," if (info.offsetHeight < minHeight) {"," host._checkSize(OFFSET_HEIGHT, minHeight);"," }"," },",""," /**"," * Update the current values on <a href=\"Resize.html#property_info\">info</a>"," * calculating the correct ratio for the other values."," *"," * @method _checkRatio"," * @protected"," */"," _checkRatio: function() {"," var instance = this,"," host = instance.get(HOST),"," info = host.info,"," originalInfo = host.originalInfo,"," oWidth = originalInfo.offsetWidth,"," oHeight = originalInfo.offsetHeight,"," oTop = originalInfo.top,"," oLeft = originalInfo.left,"," oBottom = originalInfo.bottom,"," oRight = originalInfo.right,"," // wRatio/hRatio functions keep the ratio information always synced with the current info information"," // RETURN: percentage how much width/height has changed from the original width/height"," wRatio = function() {"," return (info.offsetWidth/oWidth);"," },"," hRatio = function() {"," return (info.offsetHeight/oHeight);"," },"," isClosestToHeight = host.changeHeightHandles,"," bottomDiff,"," constrainBorders,"," constrainRegion,"," leftDiff,"," rightDiff,"," topDiff;",""," // check whether the resizable node is closest to height or not"," if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {"," constrainRegion = instance._getConstrainRegion();"," constrainBorders = instance.constrainSurrounding.border;"," bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;"," leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));"," rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;"," topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH]));",""," if (host.changeLeftHandles && host.changeTopHandles) {"," isClosestToHeight = (topDiff < leftDiff);"," }"," else if (host.changeLeftHandles) {"," isClosestToHeight = (bottomDiff < leftDiff);"," }"," else if (host.changeTopHandles) {"," isClosestToHeight = (topDiff < rightDiff);"," }"," else {"," isClosestToHeight = (bottomDiff < rightDiff);"," }"," }",""," // when the height of the resizable element touch the border of the constrain first"," // force the offsetWidth to be calculated based on the height ratio"," if (isClosestToHeight) {"," info.offsetWidth = oWidth*hRatio();"," instance._checkWidth();"," info.offsetHeight = oHeight*wRatio();"," }"," else {"," info.offsetHeight = oHeight*wRatio();"," instance._checkHeight();"," info.offsetWidth = oWidth*hRatio();"," }",""," // fixing the top on handles which are able to change top"," // the idea here is change the top based on how much the height has changed instead of follow the dy"," if (host.changeTopHandles) {"," info.top = oTop + (oHeight - info.offsetHeight);"," }",""," // fixing the left on handles which are able to change left"," // the idea here is change the left based on how much the width has changed instead of follow the dx"," if (host.changeLeftHandles) {"," info.left = oLeft + (oWidth - info.offsetWidth);"," }",""," // rounding values to avoid pixel jumpings"," Y.each(info, function(value, key) {"," if (isNumber(value)) {"," info[key] = Math.round(value);"," }"," });"," },",""," /**"," * Check whether the resizable node is inside the constrain region."," *"," * @method _checkRegion"," * @protected"," * @return {boolean}"," */"," _checkRegion: function() {"," var instance = this,"," host = instance.get(HOST),"," region = instance._getConstrainRegion();",""," return Y.DOM.inRegion(null, region, true, host.info);"," },",""," /**"," * Update the current values on <a href=\"Resize.html#property_info\">info</a>"," * to respect the maxWidth and minWidth."," *"," * @method _checkWidth"," * @protected"," */"," _checkWidth: function() {"," var instance = this,"," host = instance.get(HOST),"," info = host.info,"," maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),"," minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding);",""," instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH);",""," if (info.offsetWidth < minWidth) {"," host._checkSize(OFFSET_WIDTH, minWidth);"," }",""," if (info.offsetWidth > maxWidth) {"," host._checkSize(OFFSET_WIDTH, maxWidth);"," }"," },",""," /**"," * Get the constrain region based on the <code>constrain</code>"," * attribute."," *"," * @method _getConstrainRegion"," * @protected"," * @return {Object Region}"," */"," _getConstrainRegion: function() {"," var instance = this,"," host = instance.get(HOST),"," node = host.get(NODE),"," constrain = instance.get(CONSTRAIN),"," region = null;",""," if (constrain) {"," if (constrain == VIEW) {"," region = node.get(VIEWPORT_REGION);"," }"," else if (isNode(constrain)) {"," region = constrain.get(REGION);"," }"," else {"," region = constrain;"," }"," }",""," return region;"," },",""," _handleResizeAlignEvent: function(event) {"," var instance = this,"," host = instance.get(HOST);",""," // check the max/min height and locking top when these values are reach"," instance._checkHeight();",""," // check the max/min width and locking left when these values are reach"," instance._checkWidth();",""," // calculating the ratio, for proportionally resizing"," if (instance.get(PRESEVE_RATIO)) {"," instance._checkRatio();"," }",""," if (instance.get(CONSTRAIN) && !instance._checkRegion()) {"," host.info = host.lastInfo;"," }"," },",""," _handleResizeStartEvent: function(event) {"," var instance = this,"," constrain = instance.get(CONSTRAIN),"," host = instance.get(HOST);",""," instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);"," }","});","","Y.namespace('Plugin');","Y.Plugin.ResizeConstrained = ResizeConstrained;","","","}, '3.7.2', {\"requires\": [\"plugin\", \"resize-base\"]});"];+_yuitest_coverage["build/resize-constrain/resize-constrain.js"].code=["YUI.add('resize-constrain', function (Y, NAME) {","","var Lang = Y.Lang,"," isBoolean = Lang.isBoolean,"," isNumber = Lang.isNumber,"," isString = Lang.isString,"," capitalize = Y.Resize.capitalize,",""," isNode = function(v) {"," return (v instanceof Y.Node);"," },",""," toNumber = function(num) {"," return parseFloat(num) || 0;"," },",""," BORDER_BOTTOM_WIDTH = 'borderBottomWidth',"," BORDER_LEFT_WIDTH = 'borderLeftWidth',"," BORDER_RIGHT_WIDTH = 'borderRightWidth',"," BORDER_TOP_WIDTH = 'borderTopWidth',"," BORDER = 'border',"," BOTTOM = 'bottom',"," CON = 'con',"," CONSTRAIN = 'constrain',"," HOST = 'host',"," LEFT = 'left',"," MAX_HEIGHT = 'maxHeight',"," MAX_WIDTH = 'maxWidth',"," MIN_HEIGHT = 'minHeight',"," MIN_WIDTH = 'minWidth',"," NODE = 'node',"," OFFSET_HEIGHT = 'offsetHeight',"," OFFSET_WIDTH = 'offsetWidth',"," PRESEVE_RATIO = 'preserveRatio',"," REGION = 'region',"," RESIZE_CONTRAINED = 'resizeConstrained',"," RIGHT = 'right',"," TICK_X = 'tickX',"," TICK_Y = 'tickY',"," TOP = 'top',"," WIDTH = 'width',"," VIEW = 'view',"," VIEWPORT_REGION = 'viewportRegion';","","/**","A Resize plugin that will attempt to constrain the resize node to the boundaries.","@module resize","@submodule resize-contrain","@class ResizeConstrained","@param config {Object} Object literal specifying widget configuration properties.","@constructor","@extends Plugin.Base","@namespace Plugin","*/","","function ResizeConstrained() {"," ResizeConstrained.superclass.constructor.apply(this, arguments);","}","","Y.mix(ResizeConstrained, {"," NAME: RESIZE_CONTRAINED,",""," NS: CON,",""," ATTRS: {"," /**"," * Will attempt to constrain the resize node to the boundaries. Arguments:<br>"," * 'view': Contrain to Viewport<br>"," * '#selector_string': Constrain to this node<br>"," * '{Region Object}': An Object Literal containing a valid region (top, right, bottom, left) of page positions"," *"," * @attribute constrain"," * @type {String|Object|Node}"," */"," constrain: {"," setter: function(v) {"," if (v && (isNode(v) || isString(v) || v.nodeType)) {"," v = Y.one(v);"," }",""," return v;"," }"," },",""," /**"," * The minimum height of the element"," *"," * @attribute minHeight"," * @default 15"," * @type Number"," */"," minHeight: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The minimum width of the element"," *"," * @attribute minWidth"," * @default 15"," * @type Number"," */"," minWidth: {"," value: 15,"," validator: isNumber"," },",""," /**"," * The maximum height of the element"," *"," * @attribute maxHeight"," * @default Infinity"," * @type Number"," */"," maxHeight: {"," value: Infinity,"," validator: isNumber"," },",""," /**"," * The maximum width of the element"," *"," * @attribute maxWidth"," * @default Infinity"," * @type Number"," */"," maxWidth: {"," value: Infinity,"," validator: isNumber"," },",""," /**"," * Maintain the element's ratio when resizing."," *"," * @attribute preserveRatio"," * @default false"," * @type boolean"," */"," preserveRatio: {"," value: false,"," validator: isBoolean"," },",""," /**"," * The number of x ticks to span the resize to."," *"," * @attribute tickX"," * @default false"," * @type Number | false"," */"," tickX: {"," value: false"," },",""," /**"," * The number of y ticks to span the resize to."," *"," * @attribute tickY"," * @default false"," * @type Number | false"," */"," tickY: {"," value: false"," }"," }","});","","Y.extend(ResizeConstrained, Y.Plugin.Base, {"," /**"," * Stores the <code>constrain</code>"," * surrounding information retrieved from"," * <a href=\"Resize.html#method__getBoxSurroundingInfo\">_getBoxSurroundingInfo</a>."," *"," * @property constrainSurrounding"," * @type Object"," * @default null"," */"," constrainSurrounding: null,",""," initializer: function() {"," var instance = this,"," host = instance.get(HOST);",""," host.delegate.dd.plug("," Y.Plugin.DDConstrained,"," {"," tickX: instance.get(TICK_X),"," tickY: instance.get(TICK_Y)"," }"," );",""," host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));"," host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));"," },",""," /**"," * Helper method to update the current values on"," * <a href=\"Resize.html#property_info\">info</a> to respect the"," * constrain node."," *"," * @method _checkConstrain"," * @param {String} axis 'top' or 'left'"," * @param {String} axisConstrain 'bottom' or 'right'"," * @param {String} offset 'offsetHeight' or 'offsetWidth'"," * @protected"," */"," _checkConstrain: function(axis, axisConstrain, offset) {"," var instance = this,"," point1,"," point1Constrain,"," point2,"," point2Constrain,"," host = instance.get(HOST),"," info = host.info,"," constrainBorders = instance.constrainSurrounding.border,"," region = instance._getConstrainRegion();",""," if (region) {"," point1 = info[axis] + info[offset];"," point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]);",""," if (point1 >= point1Constrain) {"," info[offset] -= (point1 - point1Constrain);"," }",""," point2 = info[axis];"," point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]);",""," if (point2 <= point2Constrain) {"," info[axis] += (point2Constrain - point2);"," info[offset] -= (point2Constrain - point2);"," }"," }"," },",""," /**"," * Update the current values on <a href=\"Resize.html#property_info\">info</a>"," * to respect the maxHeight and minHeight."," *"," * @method _checkHeight"," * @protected"," */"," _checkHeight: function() {"," var instance = this,"," host = instance.get(HOST),"," info = host.info,"," maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),"," minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding);",""," instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT);",""," if (info.offsetHeight > maxHeight) {"," host._checkSize(OFFSET_HEIGHT, maxHeight);"," }",""," if (info.offsetHeight < minHeight) {"," host._checkSize(OFFSET_HEIGHT, minHeight);"," }"," },",""," /**"," * Update the current values on <a href=\"Resize.html#property_info\">info</a>"," * calculating the correct ratio for the other values."," *"," * @method _checkRatio"," * @protected"," */"," _checkRatio: function() {"," var instance = this,"," host = instance.get(HOST),"," info = host.info,"," originalInfo = host.originalInfo,"," oWidth = originalInfo.offsetWidth,"," oHeight = originalInfo.offsetHeight,"," oTop = originalInfo.top,"," oLeft = originalInfo.left,"," oBottom = originalInfo.bottom,"," oRight = originalInfo.right,"," // wRatio/hRatio functions keep the ratio information always synced with the current info information"," // RETURN: percentage how much width/height has changed from the original width/height"," wRatio = function() {"," return (info.offsetWidth/oWidth);"," },"," hRatio = function() {"," return (info.offsetHeight/oHeight);"," },"," isClosestToHeight = host.changeHeightHandles,"," bottomDiff,"," constrainBorders,"," constrainRegion,"," leftDiff,"," rightDiff,"," topDiff;",""," // check whether the resizable node is closest to height or not"," if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {"," constrainRegion = instance._getConstrainRegion();"," constrainBorders = instance.constrainSurrounding.border;"," bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;"," leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));"," rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;"," topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH]));",""," if (host.changeLeftHandles && host.changeTopHandles) {"," isClosestToHeight = (topDiff < leftDiff);"," }"," else if (host.changeLeftHandles) {"," isClosestToHeight = (bottomDiff < leftDiff);"," }"," else if (host.changeTopHandles) {"," isClosestToHeight = (topDiff < rightDiff);"," }"," else {"," isClosestToHeight = (bottomDiff < rightDiff);"," }"," }",""," // when the height of the resizable element touch the border of the constrain first"," // force the offsetWidth to be calculated based on the height ratio"," if (isClosestToHeight) {"," info.offsetWidth = oWidth*hRatio();"," instance._checkWidth();"," info.offsetHeight = oHeight*wRatio();"," }"," else {"," info.offsetHeight = oHeight*wRatio();"," instance._checkHeight();"," info.offsetWidth = oWidth*hRatio();"," }",""," // fixing the top on handles which are able to change top"," // the idea here is change the top based on how much the height has changed instead of follow the dy"," if (host.changeTopHandles) {"," info.top = oTop + (oHeight - info.offsetHeight);"," }",""," // fixing the left on handles which are able to change left"," // the idea here is change the left based on how much the width has changed instead of follow the dx"," if (host.changeLeftHandles) {"," info.left = oLeft + (oWidth - info.offsetWidth);"," }",""," // rounding values to avoid pixel jumpings"," Y.each(info, function(value, key) {"," if (isNumber(value)) {"," info[key] = Math.round(value);"," }"," });"," },",""," /**"," * Check whether the resizable node is inside the constrain region."," *"," * @method _checkRegion"," * @protected"," * @return {boolean}"," */"," _checkRegion: function() {"," var instance = this,"," host = instance.get(HOST),"," region = instance._getConstrainRegion();",""," return Y.DOM.inRegion(null, region, true, host.info);"," },",""," /**"," * Update the current values on <a href=\"Resize.html#property_info\">info</a>"," * to respect the maxWidth and minWidth."," *"," * @method _checkWidth"," * @protected"," */"," _checkWidth: function() {"," var instance = this,"," host = instance.get(HOST),"," info = host.info,"," maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),"," minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding);",""," instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH);",""," if (info.offsetWidth < minWidth) {"," host._checkSize(OFFSET_WIDTH, minWidth);"," }",""," if (info.offsetWidth > maxWidth) {"," host._checkSize(OFFSET_WIDTH, maxWidth);"," }"," },",""," /**"," * Get the constrain region based on the <code>constrain</code>"," * attribute."," *"," * @method _getConstrainRegion"," * @protected"," * @return {Object Region}"," */"," _getConstrainRegion: function() {"," var instance = this,"," host = instance.get(HOST),"," node = host.get(NODE),"," constrain = instance.get(CONSTRAIN),"," region = null;",""," if (constrain) {"," if (constrain === VIEW) {"," region = node.get(VIEWPORT_REGION);"," }"," else if (isNode(constrain)) {"," region = constrain.get(REGION);"," }"," else {"," region = constrain;"," }"," }",""," return region;"," },",""," _handleResizeAlignEvent: function() {"," var instance = this,"," host = instance.get(HOST);",""," // check the max/min height and locking top when these values are reach"," instance._checkHeight();",""," // check the max/min width and locking left when these values are reach"," instance._checkWidth();",""," // calculating the ratio, for proportionally resizing"," if (instance.get(PRESEVE_RATIO)) {"," instance._checkRatio();"," }",""," if (instance.get(CONSTRAIN) && !instance._checkRegion()) {"," host.info = host.lastInfo;"," }"," },",""," _handleResizeStartEvent: function() {"," var instance = this,"," constrain = instance.get(CONSTRAIN),"," host = instance.get(HOST);",""," instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);"," }","});","","Y.namespace('Plugin');","Y.Plugin.ResizeConstrained = ResizeConstrained;","","","}, '3.7.3', {\"requires\": [\"plugin\", \"resize-base\"]});"]; _yuitest_coverage["build/resize-constrain/resize-constrain.js"].lines = {"1":0,"3":0,"10":0,"14":0,"56":0,"57":0,"60":0,"77":0,"78":0,"81":0,"169":0,"182":0,"185":0,"193":0,"194":0,"209":0,"219":0,"220":0,"221":0,"223":0,"224":0,"227":0,"228":0,"230":0,"231":0,"232":0,"245":0,"251":0,"253":0,"254":0,"257":0,"258":0,"270":0,"283":0,"286":0,"297":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"305":0,"306":0,"308":0,"309":0,"311":0,"312":0,"315":0,"321":0,"322":0,"323":0,"324":0,"327":0,"328":0,"329":0,"334":0,"335":0,"340":0,"341":0,"345":0,"346":0,"347":0,"360":0,"364":0,"375":0,"381":0,"383":0,"384":0,"387":0,"388":0,"401":0,"407":0,"408":0,"409":0,"411":0,"412":0,"415":0,"419":0,"423":0,"427":0,"430":0,"433":0,"434":0,"437":0,"438":0,"443":0,"447":0,"451":0,"452":0}; _yuitest_coverage["build/resize-constrain/resize-constrain.js"].functions = {"isNode:9":0,"toNumber:13":0,"ResizeConstrained:56":0,"setter:76":0,"initializer:181":0,"_checkConstrain:208":0,"_checkHeight:244":0,"wRatio:282":0,"hRatio:285":0,"(anonymous 2):345":0,"_checkRatio:269":0,"_checkRegion:359":0,"_checkWidth:374":0,"_getConstrainRegion:400":0,"_handleResizeAlignEvent:422":0,"_handleResizeStartEvent:442":0,"(anonymous 1):1":0}; _yuitest_coverage["build/resize-constrain/resize-constrain.js"].coveredLines = 90;@@ -43,50 +43,50 @@ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "(anonymous 1)", 1); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 3); var Lang = Y.Lang,- isBoolean = Lang.isBoolean,- isNumber = Lang.isNumber,- isString = Lang.isString,- capitalize = Y.Resize.capitalize,+ isBoolean = Lang.isBoolean,+ isNumber = Lang.isNumber,+ isString = Lang.isString,+ capitalize = Y.Resize.capitalize, - isNode = function(v) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "isNode", 9);+ isNode = function(v) {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "isNode", 9); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 10); return (v instanceof Y.Node);- },+ }, - toNumber = function(num) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "toNumber", 13);+ toNumber = function(num) {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "toNumber", 13); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 14); return parseFloat(num) || 0;- },+ }, - BORDER_BOTTOM_WIDTH = 'borderBottomWidth',- BORDER_LEFT_WIDTH = 'borderLeftWidth',- BORDER_RIGHT_WIDTH = 'borderRightWidth',- BORDER_TOP_WIDTH = 'borderTopWidth',- BORDER = 'border',- BOTTOM = 'bottom',- CON = 'con',- CONSTRAIN = 'constrain',- HOST = 'host',- LEFT = 'left',- MAX_HEIGHT = 'maxHeight',- MAX_WIDTH = 'maxWidth',- MIN_HEIGHT = 'minHeight',- MIN_WIDTH = 'minWidth',- NODE = 'node',- OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth',- PRESEVE_RATIO = 'preserveRatio',- REGION = 'region',- RESIZE_CONTRAINED = 'resizeConstrained',- RIGHT = 'right',- TICK_X = 'tickX',- TICK_Y = 'tickY',- TOP = 'top',- WIDTH = 'width',- VIEW = 'view',- VIEWPORT_REGION = 'viewportRegion';+ BORDER_BOTTOM_WIDTH = 'borderBottomWidth',+ BORDER_LEFT_WIDTH = 'borderLeftWidth',+ BORDER_RIGHT_WIDTH = 'borderRightWidth',+ BORDER_TOP_WIDTH = 'borderTopWidth',+ BORDER = 'border',+ BOTTOM = 'bottom',+ CON = 'con',+ CONSTRAIN = 'constrain',+ HOST = 'host',+ LEFT = 'left',+ MAX_HEIGHT = 'maxHeight',+ MAX_WIDTH = 'maxWidth',+ MIN_HEIGHT = 'minHeight',+ MIN_WIDTH = 'minWidth',+ NODE = 'node',+ OFFSET_HEIGHT = 'offsetHeight',+ OFFSET_WIDTH = 'offsetWidth',+ PRESEVE_RATIO = 'preserveRatio',+ REGION = 'region',+ RESIZE_CONTRAINED = 'resizeConstrained',+ RIGHT = 'right',+ TICK_X = 'tickX',+ TICK_Y = 'tickY',+ TOP = 'top',+ WIDTH = 'width',+ VIEW = 'view',+ VIEWPORT_REGION = 'viewportRegion'; /** A Resize plugin that will attempt to constrain the resize node to the boundaries.@@ -101,18 +101,18 @@ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 56); function ResizeConstrained() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "ResizeConstrained", 56);+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "ResizeConstrained", 56); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 57); ResizeConstrained.superclass.constructor.apply(this, arguments); } _yuitest_coverline("build/resize-constrain/resize-constrain.js", 60); Y.mix(ResizeConstrained, {- NAME: RESIZE_CONTRAINED,+ NAME: RESIZE_CONTRAINED, - NS: CON,+ NS: CON, - ATTRS: {+ ATTRS: { /** * Will attempt to constrain the resize node to the boundaries. Arguments:<br> * 'view': Contrain to Viewport<br>@@ -122,19 +122,19 @@ * @attribute constrain * @type {String|Object|Node} */- constrain: {- setter: function(v) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "setter", 76);+ constrain: {+ setter: function(v) {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "setter", 76); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 77); if (v && (isNode(v) || isString(v) || v.nodeType)) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 78);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 78); v = Y.one(v);- }+ } - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 81);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 81); return v;- }- },+ }+ }, /** * The minimum height of the element@@ -143,10 +143,10 @@ * @default 15 * @type Number */- minHeight: {- value: 15,- validator: isNumber- },+ minHeight: {+ value: 15,+ validator: isNumber+ }, /** * The minimum width of the element@@ -155,10 +155,10 @@ * @default 15 * @type Number */- minWidth: {- value: 15,- validator: isNumber- },+ minWidth: {+ value: 15,+ validator: isNumber+ }, /** * The maximum height of the element@@ -167,10 +167,10 @@ * @default Infinity * @type Number */- maxHeight: {- value: Infinity,- validator: isNumber- },+ maxHeight: {+ value: Infinity,+ validator: isNumber+ }, /** * The maximum width of the element@@ -179,33 +179,33 @@ * @default Infinity * @type Number */- maxWidth: {- value: Infinity,- validator: isNumber- },+ maxWidth: {+ value: Infinity,+ validator: isNumber+ }, - /**+ /** * Maintain the element's ratio when resizing. * * @attribute preserveRatio * @default false * @type boolean */- preserveRatio: {- value: false,- validator: isBoolean- },+ preserveRatio: {+ value: false,+ validator: isBoolean+ }, - /**+ /** * The number of x ticks to span the resize to. * * @attribute tickX * @default false * @type Number | false */- tickX: {- value: false- },+ tickX: {+ value: false+ }, /** * The number of y ticks to span the resize to.@@ -214,97 +214,97 @@ * @default false * @type Number | false */- tickY: {- value: false- }- }+ tickY: {+ value: false+ }+ } }); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 169); Y.extend(ResizeConstrained, Y.Plugin.Base, {- /**- * Stores the <code>constrain</code>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property constrainSurrounding- * @type Object- * @default null- */- constrainSurrounding: null,+ /**+ * Stores the <code>constrain</code>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property constrainSurrounding+ * @type Object+ * @default null+ */+ constrainSurrounding: null, - initializer: function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "initializer", 181);+ initializer: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "initializer", 181); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 182); var instance = this,- host = instance.get(HOST);+ host = instance.get(HOST); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 185);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 185); host.delegate.dd.plug(- Y.Plugin.DDConstrained,- {- tickX: instance.get(TICK_X),- tickY: instance.get(TICK_Y)- }- );+ Y.Plugin.DDConstrained,+ {+ tickX: instance.get(TICK_X),+ tickY: instance.get(TICK_Y)+ }+ ); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 193);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 193); host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 194);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 194); host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));- },+ }, - /**+ /** * Helper method to update the current values on * <a href="Resize.html#property_info">info</a> to respect the * constrain node.- *- * @method _checkConstrain- * @param {String} axis 'top' or 'left'- * @param {String} axisConstrain 'bottom' or 'right'- * @param {String} offset 'offsetHeight' or 'offsetWidth'- * @protected- */- _checkConstrain: function(axis, axisConstrain, offset) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkConstrain", 208);+ *+ * @method _checkConstrain+ * @param {String} axis 'top' or 'left'+ * @param {String} axisConstrain 'bottom' or 'right'+ * @param {String} offset 'offsetHeight' or 'offsetWidth'+ * @protected+ */+ _checkConstrain: function(axis, axisConstrain, offset) {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkConstrain", 208); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 209); var instance = this,- point1,- point1Constrain,- point2,- point2Constrain,- host = instance.get(HOST),- info = host.info,- constrainBorders = instance.constrainSurrounding.border,- region = instance._getConstrainRegion();+ point1,+ point1Constrain,+ point2,+ point2Constrain,+ host = instance.get(HOST),+ info = host.info,+ constrainBorders = instance.constrainSurrounding.border,+ region = instance._getConstrainRegion(); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 219);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 219); if (region) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 220);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 220); point1 = info[axis] + info[offset];- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 221);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 221); point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 223);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 223); if (point1 >= point1Constrain) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 224);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 224); info[offset] -= (point1 - point1Constrain);- }+ } - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 227);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 227); point2 = info[axis];- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 228);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 228); point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 230);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 230); if (point2 <= point2Constrain) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 231);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 231); info[axis] += (point2Constrain - point2);- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 232);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 232); info[offset] -= (point2Constrain - point2);- }- }- },+ }+ }+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -313,30 +313,30 @@ * @method _checkHeight * @protected */- _checkHeight: function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkHeight", 244);+ _checkHeight: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkHeight", 244); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 245); var instance = this,- host = instance.get(HOST),- info = host.info,- maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),- minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding);+ host = instance.get(HOST),+ info = host.info,+ maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),+ minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 251);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 251); instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 253);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 253); if (info.offsetHeight > maxHeight) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 254);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 254); host._checkSize(OFFSET_HEIGHT, maxHeight);- }+ } - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 257);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 257); if (info.offsetHeight < minHeight) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 258);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 258); host._checkSize(OFFSET_HEIGHT, minHeight);- }- },+ }+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -345,141 +345,141 @@ * @method _checkRatio * @protected */- _checkRatio: function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkRatio", 269);+ _checkRatio: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkRatio", 269); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 270); var instance = this,- host = instance.get(HOST),- info = host.info,- originalInfo = host.originalInfo,- oWidth = originalInfo.offsetWidth,- oHeight = originalInfo.offsetHeight,- oTop = originalInfo.top,- oLeft = originalInfo.left,- oBottom = originalInfo.bottom,- oRight = originalInfo.right,- // wRatio/hRatio functions keep the ratio information always synced with the current info information- // RETURN: percentage how much width/height has changed from the original width/height- wRatio = function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "wRatio", 282);+ host = instance.get(HOST),+ info = host.info,+ originalInfo = host.originalInfo,+ oWidth = originalInfo.offsetWidth,+ oHeight = originalInfo.offsetHeight,+ oTop = originalInfo.top,+ oLeft = originalInfo.left,+ oBottom = originalInfo.bottom,+ oRight = originalInfo.right,+ // wRatio/hRatio functions keep the ratio information always synced with the current info information+ // RETURN: percentage how much width/height has changed from the original width/height+ wRatio = function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "wRatio", 282); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 283); return (info.offsetWidth/oWidth);- },- hRatio = function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "hRatio", 285);+ },+ hRatio = function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "hRatio", 285); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 286); return (info.offsetHeight/oHeight);- },- isClosestToHeight = host.changeHeightHandles,- bottomDiff,- constrainBorders,- constrainRegion,- leftDiff,- rightDiff,- topDiff;+ },+ isClosestToHeight = host.changeHeightHandles,+ bottomDiff,+ constrainBorders,+ constrainRegion,+ leftDiff,+ rightDiff,+ topDiff; - // check whether the resizable node is closest to height or not- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 297);+ // check whether the resizable node is closest to height or not+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 297); if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 298);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 298); constrainRegion = instance._getConstrainRegion();- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 299);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 299); constrainBorders = instance.constrainSurrounding.border;- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 300);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 300); bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 301);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 301); leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 302);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 302); rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 303);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 303); topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH])); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 305);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 305); if (host.changeLeftHandles && host.changeTopHandles) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 306);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 306); isClosestToHeight = (topDiff < leftDiff);- }- else {_yuitest_coverline("build/resize-constrain/resize-constrain.js", 308);+ }+ else {_yuitest_coverline("build/resize-constrain/resize-constrain.js", 308); if (host.changeLeftHandles) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 309);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 309); isClosestToHeight = (bottomDiff < leftDiff);- }- else {_yuitest_coverline("build/resize-constrain/resize-constrain.js", 311);+ }+ else {_yuitest_coverline("build/resize-constrain/resize-constrain.js", 311); if (host.changeTopHandles) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 312);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 312); isClosestToHeight = (topDiff < rightDiff);- }- else {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 315);+ }+ else {+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 315); isClosestToHeight = (bottomDiff < rightDiff);- }}}- }+ }}}+ } - // when the height of the resizable element touch the border of the constrain first- // force the offsetWidth to be calculated based on the height ratio- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 321);+ // when the height of the resizable element touch the border of the constrain first+ // force the offsetWidth to be calculated based on the height ratio+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 321); if (isClosestToHeight) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 322);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 322); info.offsetWidth = oWidth*hRatio();- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 323);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 323); instance._checkWidth();- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 324);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 324); info.offsetHeight = oHeight*wRatio();- }- else {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 327);+ }+ else {+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 327); info.offsetHeight = oHeight*wRatio();- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 328);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 328); instance._checkHeight();- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 329);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 329); info.offsetWidth = oWidth*hRatio();- }+ } - // fixing the top on handles which are able to change top- // the idea here is change the top based on how much the height has changed instead of follow the dy- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 334);+ // fixing the top on handles which are able to change top+ // the idea here is change the top based on how much the height has changed instead of follow the dy+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 334); if (host.changeTopHandles) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 335);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 335); info.top = oTop + (oHeight - info.offsetHeight);- }+ } - // fixing the left on handles which are able to change left- // the idea here is change the left based on how much the width has changed instead of follow the dx- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 340);+ // fixing the left on handles which are able to change left+ // the idea here is change the left based on how much the width has changed instead of follow the dx+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 340); if (host.changeLeftHandles) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 341);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 341); info.left = oLeft + (oWidth - info.offsetWidth);- }+ } - // rounding values to avoid pixel jumpings- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 345);+ // rounding values to avoid pixel jumpings+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 345); Y.each(info, function(value, key) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "(anonymous 2)", 345);+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "(anonymous 2)", 345); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 346); if (isNumber(value)) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 347);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 347); info[key] = Math.round(value);- }- });- },+ }+ });+ }, - /**- * Check whether the resizable node is inside the constrain region.- *- * @method _checkRegion- * @protected- * @return {boolean}- */- _checkRegion: function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkRegion", 359);+ /**+ * Check whether the resizable node is inside the constrain region.+ *+ * @method _checkRegion+ * @protected+ * @return {boolean}+ */+ _checkRegion: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkRegion", 359); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 360); var instance = this,- host = instance.get(HOST),- region = instance._getConstrainRegion();+ host = instance.get(HOST),+ region = instance._getConstrainRegion(); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 364);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 364); return Y.DOM.inRegion(null, region, true, host.info);- },+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -488,108 +488,108 @@ * @method _checkWidth * @protected */- _checkWidth: function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkWidth", 374);+ _checkWidth: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_checkWidth", 374); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 375); var instance = this,- host = instance.get(HOST),- info = host.info,- maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),- minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding);+ host = instance.get(HOST),+ info = host.info,+ maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),+ minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 381);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 381); instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 383);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 383); if (info.offsetWidth < minWidth) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 384);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 384); host._checkSize(OFFSET_WIDTH, minWidth);- }+ } - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 387);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 387); if (info.offsetWidth > maxWidth) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 388);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 388); host._checkSize(OFFSET_WIDTH, maxWidth);- }- },+ }+ }, - /**- * Get the constrain region based on the <code>constrain</code>+ /**+ * Get the constrain region based on the <code>constrain</code> * attribute.- *- * @method _getConstrainRegion- * @protected- * @return {Object Region}- */- _getConstrainRegion: function() {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_getConstrainRegion", 400);+ *+ * @method _getConstrainRegion+ * @protected+ * @return {Object Region}+ */+ _getConstrainRegion: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_getConstrainRegion", 400); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 401); var instance = this,- host = instance.get(HOST),- node = host.get(NODE),- constrain = instance.get(CONSTRAIN),- region = null;+ host = instance.get(HOST),+ node = host.get(NODE),+ constrain = instance.get(CONSTRAIN),+ region = null; - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 407);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 407); if (constrain) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 408);-if (constrain == VIEW) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 409);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 408);+if (constrain === VIEW) {+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 409); region = node.get(VIEWPORT_REGION);- }- else {_yuitest_coverline("build/resize-constrain/resize-constrain.js", 411);+ }+ else {_yuitest_coverline("build/resize-constrain/resize-constrain.js", 411); if (isNode(constrain)) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 412);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 412); region = constrain.get(REGION);- }- else {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 415);+ }+ else {+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 415); region = constrain;- }}- }+ }}+ } - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 419);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 419); return region;- },+ }, - _handleResizeAlignEvent: function(event) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_handleResizeAlignEvent", 422);+ _handleResizeAlignEvent: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_handleResizeAlignEvent", 422); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 423); var instance = this,- host = instance.get(HOST);+ host = instance.get(HOST); - // check the max/min height and locking top when these values are reach- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 427);+ // check the max/min height and locking top when these values are reach+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 427); instance._checkHeight(); - // check the max/min width and locking left when these values are reach- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 430);+ // check the max/min width and locking left when these values are reach+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 430); instance._checkWidth(); - // calculating the ratio, for proportionally resizing- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 433);+ // calculating the ratio, for proportionally resizing+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 433); if (instance.get(PRESEVE_RATIO)) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 434);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 434); instance._checkRatio();- }+ } - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 437);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 437); if (instance.get(CONSTRAIN) && !instance._checkRegion()) {- _yuitest_coverline("build/resize-constrain/resize-constrain.js", 438);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 438); host.info = host.lastInfo;- }- },+ }+ }, - _handleResizeStartEvent: function(event) {- _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_handleResizeStartEvent", 442);+ _handleResizeStartEvent: function() {+ _yuitest_coverfunc("build/resize-constrain/resize-constrain.js", "_handleResizeStartEvent", 442); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 443); var instance = this,- constrain = instance.get(CONSTRAIN),- host = instance.get(HOST);+ constrain = instance.get(CONSTRAIN),+ host = instance.get(HOST); - _yuitest_coverline("build/resize-constrain/resize-constrain.js", 447);+ _yuitest_coverline("build/resize-constrain/resize-constrain.js", 447); instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);- }+ } }); _yuitest_coverline("build/resize-constrain/resize-constrain.js", 451);@@ -598,4 +598,4 @@ Y.Plugin.ResizeConstrained = ResizeConstrained; -}, '3.7.2', {"requires": ["plugin", "resize-base"]});+}, '3.7.3', {"requires": ["plugin", "resize-base"]});
bundle/resize-constrain/resize-constrain-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -7,46 +7,46 @@ YUI.add('resize-constrain', function (Y, NAME) { var Lang = Y.Lang,- isBoolean = Lang.isBoolean,- isNumber = Lang.isNumber,- isString = Lang.isString,- capitalize = Y.Resize.capitalize,+ isBoolean = Lang.isBoolean,+ isNumber = Lang.isNumber,+ isString = Lang.isString,+ capitalize = Y.Resize.capitalize, - isNode = function(v) {- return (v instanceof Y.Node);- },+ isNode = function(v) {+ return (v instanceof Y.Node);+ }, - toNumber = function(num) {- return parseFloat(num) || 0;- },+ toNumber = function(num) {+ return parseFloat(num) || 0;+ }, - BORDER_BOTTOM_WIDTH = 'borderBottomWidth',- BORDER_LEFT_WIDTH = 'borderLeftWidth',- BORDER_RIGHT_WIDTH = 'borderRightWidth',- BORDER_TOP_WIDTH = 'borderTopWidth',- BORDER = 'border',- BOTTOM = 'bottom',- CON = 'con',- CONSTRAIN = 'constrain',- HOST = 'host',- LEFT = 'left',- MAX_HEIGHT = 'maxHeight',- MAX_WIDTH = 'maxWidth',- MIN_HEIGHT = 'minHeight',- MIN_WIDTH = 'minWidth',- NODE = 'node',- OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth',- PRESEVE_RATIO = 'preserveRatio',- REGION = 'region',- RESIZE_CONTRAINED = 'resizeConstrained',- RIGHT = 'right',- TICK_X = 'tickX',- TICK_Y = 'tickY',- TOP = 'top',- WIDTH = 'width',- VIEW = 'view',- VIEWPORT_REGION = 'viewportRegion';+ BORDER_BOTTOM_WIDTH = 'borderBottomWidth',+ BORDER_LEFT_WIDTH = 'borderLeftWidth',+ BORDER_RIGHT_WIDTH = 'borderRightWidth',+ BORDER_TOP_WIDTH = 'borderTopWidth',+ BORDER = 'border',+ BOTTOM = 'bottom',+ CON = 'con',+ CONSTRAIN = 'constrain',+ HOST = 'host',+ LEFT = 'left',+ MAX_HEIGHT = 'maxHeight',+ MAX_WIDTH = 'maxWidth',+ MIN_HEIGHT = 'minHeight',+ MIN_WIDTH = 'minWidth',+ NODE = 'node',+ OFFSET_HEIGHT = 'offsetHeight',+ OFFSET_WIDTH = 'offsetWidth',+ PRESEVE_RATIO = 'preserveRatio',+ REGION = 'region',+ RESIZE_CONTRAINED = 'resizeConstrained',+ RIGHT = 'right',+ TICK_X = 'tickX',+ TICK_Y = 'tickY',+ TOP = 'top',+ WIDTH = 'width',+ VIEW = 'view',+ VIEWPORT_REGION = 'viewportRegion'; /** A Resize plugin that will attempt to constrain the resize node to the boundaries.@@ -60,15 +60,15 @@ */ function ResizeConstrained() {- ResizeConstrained.superclass.constructor.apply(this, arguments);+ ResizeConstrained.superclass.constructor.apply(this, arguments); } Y.mix(ResizeConstrained, {- NAME: RESIZE_CONTRAINED,+ NAME: RESIZE_CONTRAINED, - NS: CON,+ NS: CON, - ATTRS: {+ ATTRS: { /** * Will attempt to constrain the resize node to the boundaries. Arguments:<br> * 'view': Contrain to Viewport<br>@@ -78,15 +78,15 @@ * @attribute constrain * @type {String|Object|Node} */- constrain: {- setter: function(v) {- if (v && (isNode(v) || isString(v) || v.nodeType)) {- v = Y.one(v);- }+ constrain: {+ setter: function(v) {+ if (v && (isNode(v) || isString(v) || v.nodeType)) {+ v = Y.one(v);+ } - return v;- }- },+ return v;+ }+ }, /** * The minimum height of the element@@ -95,10 +95,10 @@ * @default 15 * @type Number */- minHeight: {- value: 15,- validator: isNumber- },+ minHeight: {+ value: 15,+ validator: isNumber+ }, /** * The minimum width of the element@@ -107,10 +107,10 @@ * @default 15 * @type Number */- minWidth: {- value: 15,- validator: isNumber- },+ minWidth: {+ value: 15,+ validator: isNumber+ }, /** * The maximum height of the element@@ -119,10 +119,10 @@ * @default Infinity * @type Number */- maxHeight: {- value: Infinity,- validator: isNumber- },+ maxHeight: {+ value: Infinity,+ validator: isNumber+ }, /** * The maximum width of the element@@ -131,33 +131,33 @@ * @default Infinity * @type Number */- maxWidth: {- value: Infinity,- validator: isNumber- },+ maxWidth: {+ value: Infinity,+ validator: isNumber+ }, - /**+ /** * Maintain the element's ratio when resizing. * * @attribute preserveRatio * @default false * @type boolean */- preserveRatio: {- value: false,- validator: isBoolean- },+ preserveRatio: {+ value: false,+ validator: isBoolean+ }, - /**+ /** * The number of x ticks to span the resize to. * * @attribute tickX * @default false * @type Number | false */- tickX: {- value: false- },+ tickX: {+ value: false+ }, /** * The number of y ticks to span the resize to.@@ -166,79 +166,79 @@ * @default false * @type Number | false */- tickY: {- value: false- }- }+ tickY: {+ value: false+ }+ } }); Y.extend(ResizeConstrained, Y.Plugin.Base, {- /**- * Stores the <code>constrain</code>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property constrainSurrounding- * @type Object- * @default null- */- constrainSurrounding: null,+ /**+ * Stores the <code>constrain</code>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property constrainSurrounding+ * @type Object+ * @default null+ */+ constrainSurrounding: null, - initializer: function() {- var instance = this,- host = instance.get(HOST);+ initializer: function() {+ var instance = this,+ host = instance.get(HOST); - host.delegate.dd.plug(- Y.Plugin.DDConstrained,- {- tickX: instance.get(TICK_X),- tickY: instance.get(TICK_Y)- }- );+ host.delegate.dd.plug(+ Y.Plugin.DDConstrained,+ {+ tickX: instance.get(TICK_X),+ tickY: instance.get(TICK_Y)+ }+ ); - host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));- host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));- },+ host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));+ host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));+ }, - /**+ /** * Helper method to update the current values on * <a href="Resize.html#property_info">info</a> to respect the * constrain node.- *- * @method _checkConstrain- * @param {String} axis 'top' or 'left'- * @param {String} axisConstrain 'bottom' or 'right'- * @param {String} offset 'offsetHeight' or 'offsetWidth'- * @protected- */- _checkConstrain: function(axis, axisConstrain, offset) {- var instance = this,- point1,- point1Constrain,- point2,- point2Constrain,- host = instance.get(HOST),- info = host.info,- constrainBorders = instance.constrainSurrounding.border,- region = instance._getConstrainRegion();+ *+ * @method _checkConstrain+ * @param {String} axis 'top' or 'left'+ * @param {String} axisConstrain 'bottom' or 'right'+ * @param {String} offset 'offsetHeight' or 'offsetWidth'+ * @protected+ */+ _checkConstrain: function(axis, axisConstrain, offset) {+ var instance = this,+ point1,+ point1Constrain,+ point2,+ point2Constrain,+ host = instance.get(HOST),+ info = host.info,+ constrainBorders = instance.constrainSurrounding.border,+ region = instance._getConstrainRegion(); - if (region) {- point1 = info[axis] + info[offset];- point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]);+ if (region) {+ point1 = info[axis] + info[offset];+ point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]); - if (point1 >= point1Constrain) {- info[offset] -= (point1 - point1Constrain);- }+ if (point1 >= point1Constrain) {+ info[offset] -= (point1 - point1Constrain);+ } - point2 = info[axis];- point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]);+ point2 = info[axis];+ point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]); - if (point2 <= point2Constrain) {- info[axis] += (point2Constrain - point2);- info[offset] -= (point2Constrain - point2);- }- }- },+ if (point2 <= point2Constrain) {+ info[axis] += (point2Constrain - point2);+ info[offset] -= (point2Constrain - point2);+ }+ }+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -247,23 +247,23 @@ * @method _checkHeight * @protected */- _checkHeight: function() {- var instance = this,- host = instance.get(HOST),- info = host.info,- maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),- minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding);+ _checkHeight: function() {+ var instance = this,+ host = instance.get(HOST),+ info = host.info,+ maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),+ minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding); - instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT);+ instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT); - if (info.offsetHeight > maxHeight) {- host._checkSize(OFFSET_HEIGHT, maxHeight);- }+ if (info.offsetHeight > maxHeight) {+ host._checkSize(OFFSET_HEIGHT, maxHeight);+ } - if (info.offsetHeight < minHeight) {- host._checkSize(OFFSET_HEIGHT, minHeight);- }- },+ if (info.offsetHeight < minHeight) {+ host._checkSize(OFFSET_HEIGHT, minHeight);+ }+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -272,103 +272,103 @@ * @method _checkRatio * @protected */- _checkRatio: function() {- var instance = this,- host = instance.get(HOST),- info = host.info,- originalInfo = host.originalInfo,- oWidth = originalInfo.offsetWidth,- oHeight = originalInfo.offsetHeight,- oTop = originalInfo.top,- oLeft = originalInfo.left,- oBottom = originalInfo.bottom,- oRight = originalInfo.right,- // wRatio/hRatio functions keep the ratio information always synced with the current info information- // RETURN: percentage how much width/height has changed from the original width/height- wRatio = function() {- return (info.offsetWidth/oWidth);- },- hRatio = function() {- return (info.offsetHeight/oHeight);- },- isClosestToHeight = host.changeHeightHandles,- bottomDiff,- constrainBorders,- constrainRegion,- leftDiff,- rightDiff,- topDiff;+ _checkRatio: function() {+ var instance = this,+ host = instance.get(HOST),+ info = host.info,+ originalInfo = host.originalInfo,+ oWidth = originalInfo.offsetWidth,+ oHeight = originalInfo.offsetHeight,+ oTop = originalInfo.top,+ oLeft = originalInfo.left,+ oBottom = originalInfo.bottom,+ oRight = originalInfo.right,+ // wRatio/hRatio functions keep the ratio information always synced with the current info information+ // RETURN: percentage how much width/height has changed from the original width/height+ wRatio = function() {+ return (info.offsetWidth/oWidth);+ },+ hRatio = function() {+ return (info.offsetHeight/oHeight);+ },+ isClosestToHeight = host.changeHeightHandles,+ bottomDiff,+ constrainBorders,+ constrainRegion,+ leftDiff,+ rightDiff,+ topDiff; - // check whether the resizable node is closest to height or not- if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {- constrainRegion = instance._getConstrainRegion();- constrainBorders = instance.constrainSurrounding.border;- bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;- leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));- rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;- topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH]));+ // check whether the resizable node is closest to height or not+ if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {+ constrainRegion = instance._getConstrainRegion();+ constrainBorders = instance.constrainSurrounding.border;+ bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;+ leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));+ rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;+ topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH])); - if (host.changeLeftHandles && host.changeTopHandles) {- isClosestToHeight = (topDiff < leftDiff);- }- else if (host.changeLeftHandles) {- isClosestToHeight = (bottomDiff < leftDiff);- }- else if (host.changeTopHandles) {- isClosestToHeight = (topDiff < rightDiff);- }- else {- isClosestToHeight = (bottomDiff < rightDiff);- }- }+ if (host.changeLeftHandles && host.changeTopHandles) {+ isClosestToHeight = (topDiff < leftDiff);+ }+ else if (host.changeLeftHandles) {+ isClosestToHeight = (bottomDiff < leftDiff);+ }+ else if (host.changeTopHandles) {+ isClosestToHeight = (topDiff < rightDiff);+ }+ else {+ isClosestToHeight = (bottomDiff < rightDiff);+ }+ } - // when the height of the resizable element touch the border of the constrain first- // force the offsetWidth to be calculated based on the height ratio- if (isClosestToHeight) {- info.offsetWidth = oWidth*hRatio();- instance._checkWidth();- info.offsetHeight = oHeight*wRatio();- }- else {- info.offsetHeight = oHeight*wRatio();- instance._checkHeight();- info.offsetWidth = oWidth*hRatio();- }+ // when the height of the resizable element touch the border of the constrain first+ // force the offsetWidth to be calculated based on the height ratio+ if (isClosestToHeight) {+ info.offsetWidth = oWidth*hRatio();+ instance._checkWidth();+ info.offsetHeight = oHeight*wRatio();+ }+ else {+ info.offsetHeight = oHeight*wRatio();+ instance._checkHeight();+ info.offsetWidth = oWidth*hRatio();+ } - // fixing the top on handles which are able to change top- // the idea here is change the top based on how much the height has changed instead of follow the dy- if (host.changeTopHandles) {- info.top = oTop + (oHeight - info.offsetHeight);- }+ // fixing the top on handles which are able to change top+ // the idea here is change the top based on how much the height has changed instead of follow the dy+ if (host.changeTopHandles) {+ info.top = oTop + (oHeight - info.offsetHeight);+ } - // fixing the left on handles which are able to change left- // the idea here is change the left based on how much the width has changed instead of follow the dx- if (host.changeLeftHandles) {- info.left = oLeft + (oWidth - info.offsetWidth);- }+ // fixing the left on handles which are able to change left+ // the idea here is change the left based on how much the width has changed instead of follow the dx+ if (host.changeLeftHandles) {+ info.left = oLeft + (oWidth - info.offsetWidth);+ } - // rounding values to avoid pixel jumpings- Y.each(info, function(value, key) {- if (isNumber(value)) {- info[key] = Math.round(value);- }- });- },+ // rounding values to avoid pixel jumpings+ Y.each(info, function(value, key) {+ if (isNumber(value)) {+ info[key] = Math.round(value);+ }+ });+ }, - /**- * Check whether the resizable node is inside the constrain region.- *- * @method _checkRegion- * @protected- * @return {boolean}- */- _checkRegion: function() {- var instance = this,- host = instance.get(HOST),- region = instance._getConstrainRegion();+ /**+ * Check whether the resizable node is inside the constrain region.+ *+ * @method _checkRegion+ * @protected+ * @return {boolean}+ */+ _checkRegion: function() {+ var instance = this,+ host = instance.get(HOST),+ region = instance._getConstrainRegion(); - return Y.DOM.inRegion(null, region, true, host.info);- },+ return Y.DOM.inRegion(null, region, true, host.info);+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -377,85 +377,85 @@ * @method _checkWidth * @protected */- _checkWidth: function() {- var instance = this,- host = instance.get(HOST),- info = host.info,- maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),- minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding);+ _checkWidth: function() {+ var instance = this,+ host = instance.get(HOST),+ info = host.info,+ maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),+ minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding); - instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH);+ instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH); - if (info.offsetWidth < minWidth) {- host._checkSize(OFFSET_WIDTH, minWidth);- }+ if (info.offsetWidth < minWidth) {+ host._checkSize(OFFSET_WIDTH, minWidth);+ } - if (info.offsetWidth > maxWidth) {- host._checkSize(OFFSET_WIDTH, maxWidth);- }- },+ if (info.offsetWidth > maxWidth) {+ host._checkSize(OFFSET_WIDTH, maxWidth);+ }+ }, - /**- * Get the constrain region based on the <code>constrain</code>+ /**+ * Get the constrain region based on the <code>constrain</code> * attribute.- *- * @method _getConstrainRegion- * @protected- * @return {Object Region}- */- _getConstrainRegion: function() {- var instance = this,- host = instance.get(HOST),- node = host.get(NODE),- constrain = instance.get(CONSTRAIN),- region = null;+ *+ * @method _getConstrainRegion+ * @protected+ * @return {Object Region}+ */+ _getConstrainRegion: function() {+ var instance = this,+ host = instance.get(HOST),+ node = host.get(NODE),+ constrain = instance.get(CONSTRAIN),+ region = null; - if (constrain) {- if (constrain == VIEW) {- region = node.get(VIEWPORT_REGION);- }- else if (isNode(constrain)) {- region = constrain.get(REGION);- }- else {- region = constrain;- }- }+ if (constrain) {+ if (constrain === VIEW) {+ region = node.get(VIEWPORT_REGION);+ }+ else if (isNode(constrain)) {+ region = constrain.get(REGION);+ }+ else {+ region = constrain;+ }+ } - return region;- },+ return region;+ }, - _handleResizeAlignEvent: function(event) {- var instance = this,- host = instance.get(HOST);+ _handleResizeAlignEvent: function() {+ var instance = this,+ host = instance.get(HOST); - // check the max/min height and locking top when these values are reach- instance._checkHeight();+ // check the max/min height and locking top when these values are reach+ instance._checkHeight(); - // check the max/min width and locking left when these values are reach- instance._checkWidth();+ // check the max/min width and locking left when these values are reach+ instance._checkWidth(); - // calculating the ratio, for proportionally resizing- if (instance.get(PRESEVE_RATIO)) {- instance._checkRatio();- }+ // calculating the ratio, for proportionally resizing+ if (instance.get(PRESEVE_RATIO)) {+ instance._checkRatio();+ } - if (instance.get(CONSTRAIN) && !instance._checkRegion()) {- host.info = host.lastInfo;- }- },+ if (instance.get(CONSTRAIN) && !instance._checkRegion()) {+ host.info = host.lastInfo;+ }+ }, - _handleResizeStartEvent: function(event) {- var instance = this,- constrain = instance.get(CONSTRAIN),- host = instance.get(HOST);+ _handleResizeStartEvent: function() {+ var instance = this,+ constrain = instance.get(CONSTRAIN),+ host = instance.get(HOST); - instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);- }+ instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);+ } }); Y.namespace('Plugin'); Y.Plugin.ResizeConstrained = ResizeConstrained; -}, '3.7.2', {"requires": ["plugin", "resize-base"]});+}, '3.7.3', {"requires": ["plugin", "resize-base"]});
bundle/resize-constrain/resize-constrain-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("resize-constrain",function(e,t){function B(){B.superclass.constructor.apply(this,arguments)}var n=e.Lang,r=n.isBoolean,i=n.isNumber,s=n.isString,o=e.Resize.capitalize,u=function(t){return t instanceof e.Node},a=function(e){return parseFloat(e)||0},f="borderBottomWidth",l="borderLeftWidth",c="borderRightWidth",h="borderTopWidth",p="border",d="bottom",v="con",m="constrain",g="host",y="left",b="maxHeight",w="maxWidth",E="minHeight",S="minWidth",x="node",T="offsetHeight",N="offsetWidth",C="preserveRatio",k="region",L="resizeConstrained",A="right",O="tickX",M="tickY",_="top",D="width",P="view",H="viewportRegion";e.mix(B,{NAME:L,NS:v,ATTRS:{constrain:{setter:function(t){return t&&(u(t)||s(t)||t.nodeType)&&(t=e.one(t)),t}},minHeight:{value:15,validator:i},minWidth:{value:15,validator:i},maxHeight:{value:Infinity,validator:i},maxWidth:{value:Infinity,validator:i},preserveRatio:{value:!1,validator:r},tickX:{value:!1},tickY:{value:!1}}}),e.extend(B,e.Plugin.Base,{constrainSurrounding:null,initializer:function(){var t=this,n=t.get(g);n.delegate.dd.plug(e.Plugin.DDConstrained,{tickX:t.get(O),tickY:t.get(M)}),n.after("resize:align",e.bind(t._handleResizeAlignEvent,t)),n.on("resize:start",e.bind(t._handleResizeStartEvent,t))},_checkConstrain:function(e,t,n){var r=this,i,s,u,f,l=r.get(g),c=l.info,h=r.constrainSurrounding.border,d=r._getConstrainRegion();d&&(i=c[e]+c[n],s=d[t]-a(h[o(p,t,D)]),i>=s&&(c[n]-=i-s),u=c[e],f=d[e]+a(h[o(p,e,D)]),u<=f&&(c[e]+=f-u,c[n]-=f-u))},_checkHeight:function(){var e=this,t=e.get(g),n=t.info,r=e.get(b)+t.totalVSurrounding,i=e.get(E)+t.totalVSurrounding;e._checkConstrain(_,d,T),n.offsetHeight>r&&t._checkSize(T,r),n.offsetHeight<i&&t._checkSize(T,i)},_checkRatio:function(){var t=this,n=t.get(g),r=n.info,s=n.originalInfo,o=s.offsetWidth,u=s.offsetHeight,p=s.top,d=s.left,v=s.bottom,y=s.right,b=function(){return r.offsetWidth/o},w=function(){return r.offsetHeight/u},E=n.changeHeightHandles,S,x,T,N,C,k;t.get(m)&&n.changeHeightHandles&&n.changeWidthHandles&&(T=t._getConstrainRegion(),x=t.constrainSurrounding.border,S=T.bottom-a(x[f])-v,N=d-(T.left+a(x[l])),C=T.right-a(x[c])-y,k=p-(T.top+a(x[h])),n.changeLeftHandles&&n.changeTopHandles?E=k<N:n.changeLeftHandles?E=S<N:n.changeTopHandles?E=k<C:E=S<C),E?(r.offsetWidth=o*w(),t._checkWidth(),r.offsetHeight=u*b()):(r.offsetHeight=u*b(),t._checkHeight(),r.offsetWidth=o*w()),n.changeTopHandles&&(r.top=p+(u-r.offsetHeight)),n.changeLeftHandles&&(r.left=d+(o-r.offsetWidth)),e.each(r,function(e,t){i(e)&&(r[t]=Math.round(e))})},_checkRegion:function(){var t=this,n=t.get(g),r=t._getConstrainRegion();return e.DOM.inRegion(null,r,!0,n.info)},_checkWidth:function(){var e=this,t=e.get(g),n=t.info,r=e.get(w)+t.totalHSurrounding,i=e.get(S)+t.totalHSurrounding;e._checkConstrain(y,A,N),n.offsetWidth<i&&t._checkSize(N,i),n.offsetWidth>r&&t._checkSize(N,r)},_getConstrainRegion:function(){var e=this,t=e.get(g),n=t.get(x),r=e.get(m),i=null;return r&&(r==P?i=n.get(H):u(r)?i=r.get(k):i=r),i},_handleResizeAlignEvent:function(e){var t=this,n=t.get(g);t._checkHeight(),t._checkWidth(),t.get(C)&&t._checkRatio(),t.get(m)&&!t._checkRegion()&&(n.info=n.lastInfo)},_handleResizeStartEvent:function(e){var t=this,n=t.get(m),r=t.get(g);t.constrainSurrounding=r._getBoxSurroundingInfo(n)}}),e.namespace("Plugin"),e.Plugin.ResizeConstrained=B},"3.7.2",{requires:["plugin","resize-base"]});+YUI.add("resize-constrain",function(e,t){function B(){B.superclass.constructor.apply(this,arguments)}var n=e.Lang,r=n.isBoolean,i=n.isNumber,s=n.isString,o=e.Resize.capitalize,u=function(t){return t instanceof e.Node},a=function(e){return parseFloat(e)||0},f="borderBottomWidth",l="borderLeftWidth",c="borderRightWidth",h="borderTopWidth",p="border",d="bottom",v="con",m="constrain",g="host",y="left",b="maxHeight",w="maxWidth",E="minHeight",S="minWidth",x="node",T="offsetHeight",N="offsetWidth",C="preserveRatio",k="region",L="resizeConstrained",A="right",O="tickX",M="tickY",_="top",D="width",P="view",H="viewportRegion";e.mix(B,{NAME:L,NS:v,ATTRS:{constrain:{setter:function(t){return t&&(u(t)||s(t)||t.nodeType)&&(t=e.one(t)),t}},minHeight:{value:15,validator:i},minWidth:{value:15,validator:i},maxHeight:{value:Infinity,validator:i},maxWidth:{value:Infinity,validator:i},preserveRatio:{value:!1,validator:r},tickX:{value:!1},tickY:{value:!1}}}),e.extend(B,e.Plugin.Base,{constrainSurrounding:null,initializer:function(){var t=this,n=t.get(g);n.delegate.dd.plug(e.Plugin.DDConstrained,{tickX:t.get(O),tickY:t.get(M)}),n.after("resize:align",e.bind(t._handleResizeAlignEvent,t)),n.on("resize:start",e.bind(t._handleResizeStartEvent,t))},_checkConstrain:function(e,t,n){var r=this,i,s,u,f,l=r.get(g),c=l.info,h=r.constrainSurrounding.border,d=r._getConstrainRegion();d&&(i=c[e]+c[n],s=d[t]-a(h[o(p,t,D)]),i>=s&&(c[n]-=i-s),u=c[e],f=d[e]+a(h[o(p,e,D)]),u<=f&&(c[e]+=f-u,c[n]-=f-u))},_checkHeight:function(){var e=this,t=e.get(g),n=t.info,r=e.get(b)+t.totalVSurrounding,i=e.get(E)+t.totalVSurrounding;e._checkConstrain(_,d,T),n.offsetHeight>r&&t._checkSize(T,r),n.offsetHeight<i&&t._checkSize(T,i)},_checkRatio:function(){var t=this,n=t.get(g),r=n.info,s=n.originalInfo,o=s.offsetWidth,u=s.offsetHeight,p=s.top,d=s.left,v=s.bottom,y=s.right,b=function(){return r.offsetWidth/o},w=function(){return r.offsetHeight/u},E=n.changeHeightHandles,S,x,T,N,C,k;t.get(m)&&n.changeHeightHandles&&n.changeWidthHandles&&(T=t._getConstrainRegion(),x=t.constrainSurrounding.border,S=T.bottom-a(x[f])-v,N=d-(T.left+a(x[l])),C=T.right-a(x[c])-y,k=p-(T.top+a(x[h])),n.changeLeftHandles&&n.changeTopHandles?E=k<N:n.changeLeftHandles?E=S<N:n.changeTopHandles?E=k<C:E=S<C),E?(r.offsetWidth=o*w(),t._checkWidth(),r.offsetHeight=u*b()):(r.offsetHeight=u*b(),t._checkHeight(),r.offsetWidth=o*w()),n.changeTopHandles&&(r.top=p+(u-r.offsetHeight)),n.changeLeftHandles&&(r.left=d+(o-r.offsetWidth)),e.each(r,function(e,t){i(e)&&(r[t]=Math.round(e))})},_checkRegion:function(){var t=this,n=t.get(g),r=t._getConstrainRegion();return e.DOM.inRegion(null,r,!0,n.info)},_checkWidth:function(){var e=this,t=e.get(g),n=t.info,r=e.get(w)+t.totalHSurrounding,i=e.get(S)+t.totalHSurrounding;e._checkConstrain(y,A,N),n.offsetWidth<i&&t._checkSize(N,i),n.offsetWidth>r&&t._checkSize(N,r)},_getConstrainRegion:function(){var e=this,t=e.get(g),n=t.get(x),r=e.get(m),i=null;return r&&(r===P?i=n.get(H):u(r)?i=r.get(k):i=r),i},_handleResizeAlignEvent:function(){var e=this,t=e.get(g);e._checkHeight(),e._checkWidth(),e.get(C)&&e._checkRatio(),e.get(m)&&!e._checkRegion()&&(t.info=t.lastInfo)},_handleResizeStartEvent:function(){var e=this,t=e.get(m),n=e.get(g);e.constrainSurrounding=n._getBoxSurroundingInfo(t)}}),e.namespace("Plugin"),e.Plugin.ResizeConstrained=B},"3.7.3",{requires:["plugin","resize-base"]});
bundle/resize-constrain/resize-constrain.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -7,46 +7,46 @@ YUI.add('resize-constrain', function (Y, NAME) { var Lang = Y.Lang,- isBoolean = Lang.isBoolean,- isNumber = Lang.isNumber,- isString = Lang.isString,- capitalize = Y.Resize.capitalize,+ isBoolean = Lang.isBoolean,+ isNumber = Lang.isNumber,+ isString = Lang.isString,+ capitalize = Y.Resize.capitalize, - isNode = function(v) {- return (v instanceof Y.Node);- },+ isNode = function(v) {+ return (v instanceof Y.Node);+ }, - toNumber = function(num) {- return parseFloat(num) || 0;- },+ toNumber = function(num) {+ return parseFloat(num) || 0;+ }, - BORDER_BOTTOM_WIDTH = 'borderBottomWidth',- BORDER_LEFT_WIDTH = 'borderLeftWidth',- BORDER_RIGHT_WIDTH = 'borderRightWidth',- BORDER_TOP_WIDTH = 'borderTopWidth',- BORDER = 'border',- BOTTOM = 'bottom',- CON = 'con',- CONSTRAIN = 'constrain',- HOST = 'host',- LEFT = 'left',- MAX_HEIGHT = 'maxHeight',- MAX_WIDTH = 'maxWidth',- MIN_HEIGHT = 'minHeight',- MIN_WIDTH = 'minWidth',- NODE = 'node',- OFFSET_HEIGHT = 'offsetHeight',- OFFSET_WIDTH = 'offsetWidth',- PRESEVE_RATIO = 'preserveRatio',- REGION = 'region',- RESIZE_CONTRAINED = 'resizeConstrained',- RIGHT = 'right',- TICK_X = 'tickX',- TICK_Y = 'tickY',- TOP = 'top',- WIDTH = 'width',- VIEW = 'view',- VIEWPORT_REGION = 'viewportRegion';+ BORDER_BOTTOM_WIDTH = 'borderBottomWidth',+ BORDER_LEFT_WIDTH = 'borderLeftWidth',+ BORDER_RIGHT_WIDTH = 'borderRightWidth',+ BORDER_TOP_WIDTH = 'borderTopWidth',+ BORDER = 'border',+ BOTTOM = 'bottom',+ CON = 'con',+ CONSTRAIN = 'constrain',+ HOST = 'host',+ LEFT = 'left',+ MAX_HEIGHT = 'maxHeight',+ MAX_WIDTH = 'maxWidth',+ MIN_HEIGHT = 'minHeight',+ MIN_WIDTH = 'minWidth',+ NODE = 'node',+ OFFSET_HEIGHT = 'offsetHeight',+ OFFSET_WIDTH = 'offsetWidth',+ PRESEVE_RATIO = 'preserveRatio',+ REGION = 'region',+ RESIZE_CONTRAINED = 'resizeConstrained',+ RIGHT = 'right',+ TICK_X = 'tickX',+ TICK_Y = 'tickY',+ TOP = 'top',+ WIDTH = 'width',+ VIEW = 'view',+ VIEWPORT_REGION = 'viewportRegion'; /** A Resize plugin that will attempt to constrain the resize node to the boundaries.@@ -60,15 +60,15 @@ */ function ResizeConstrained() {- ResizeConstrained.superclass.constructor.apply(this, arguments);+ ResizeConstrained.superclass.constructor.apply(this, arguments); } Y.mix(ResizeConstrained, {- NAME: RESIZE_CONTRAINED,+ NAME: RESIZE_CONTRAINED, - NS: CON,+ NS: CON, - ATTRS: {+ ATTRS: { /** * Will attempt to constrain the resize node to the boundaries. Arguments:<br> * 'view': Contrain to Viewport<br>@@ -78,15 +78,15 @@ * @attribute constrain * @type {String|Object|Node} */- constrain: {- setter: function(v) {- if (v && (isNode(v) || isString(v) || v.nodeType)) {- v = Y.one(v);- }+ constrain: {+ setter: function(v) {+ if (v && (isNode(v) || isString(v) || v.nodeType)) {+ v = Y.one(v);+ } - return v;- }- },+ return v;+ }+ }, /** * The minimum height of the element@@ -95,10 +95,10 @@ * @default 15 * @type Number */- minHeight: {- value: 15,- validator: isNumber- },+ minHeight: {+ value: 15,+ validator: isNumber+ }, /** * The minimum width of the element@@ -107,10 +107,10 @@ * @default 15 * @type Number */- minWidth: {- value: 15,- validator: isNumber- },+ minWidth: {+ value: 15,+ validator: isNumber+ }, /** * The maximum height of the element@@ -119,10 +119,10 @@ * @default Infinity * @type Number */- maxHeight: {- value: Infinity,- validator: isNumber- },+ maxHeight: {+ value: Infinity,+ validator: isNumber+ }, /** * The maximum width of the element@@ -131,33 +131,33 @@ * @default Infinity * @type Number */- maxWidth: {- value: Infinity,- validator: isNumber- },+ maxWidth: {+ value: Infinity,+ validator: isNumber+ }, - /**+ /** * Maintain the element's ratio when resizing. * * @attribute preserveRatio * @default false * @type boolean */- preserveRatio: {- value: false,- validator: isBoolean- },+ preserveRatio: {+ value: false,+ validator: isBoolean+ }, - /**+ /** * The number of x ticks to span the resize to. * * @attribute tickX * @default false * @type Number | false */- tickX: {- value: false- },+ tickX: {+ value: false+ }, /** * The number of y ticks to span the resize to.@@ -166,79 +166,79 @@ * @default false * @type Number | false */- tickY: {- value: false- }- }+ tickY: {+ value: false+ }+ } }); Y.extend(ResizeConstrained, Y.Plugin.Base, {- /**- * Stores the <code>constrain</code>- * surrounding information retrieved from- * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.- *- * @property constrainSurrounding- * @type Object- * @default null- */- constrainSurrounding: null,+ /**+ * Stores the <code>constrain</code>+ * surrounding information retrieved from+ * <a href="Resize.html#method__getBoxSurroundingInfo">_getBoxSurroundingInfo</a>.+ *+ * @property constrainSurrounding+ * @type Object+ * @default null+ */+ constrainSurrounding: null, - initializer: function() {- var instance = this,- host = instance.get(HOST);+ initializer: function() {+ var instance = this,+ host = instance.get(HOST); - host.delegate.dd.plug(- Y.Plugin.DDConstrained,- {- tickX: instance.get(TICK_X),- tickY: instance.get(TICK_Y)- }- );+ host.delegate.dd.plug(+ Y.Plugin.DDConstrained,+ {+ tickX: instance.get(TICK_X),+ tickY: instance.get(TICK_Y)+ }+ ); - host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));- host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));- },+ host.after('resize:align', Y.bind(instance._handleResizeAlignEvent, instance));+ host.on('resize:start', Y.bind(instance._handleResizeStartEvent, instance));+ }, - /**+ /** * Helper method to update the current values on * <a href="Resize.html#property_info">info</a> to respect the * constrain node.- *- * @method _checkConstrain- * @param {String} axis 'top' or 'left'- * @param {String} axisConstrain 'bottom' or 'right'- * @param {String} offset 'offsetHeight' or 'offsetWidth'- * @protected- */- _checkConstrain: function(axis, axisConstrain, offset) {- var instance = this,- point1,- point1Constrain,- point2,- point2Constrain,- host = instance.get(HOST),- info = host.info,- constrainBorders = instance.constrainSurrounding.border,- region = instance._getConstrainRegion();+ *+ * @method _checkConstrain+ * @param {String} axis 'top' or 'left'+ * @param {String} axisConstrain 'bottom' or 'right'+ * @param {String} offset 'offsetHeight' or 'offsetWidth'+ * @protected+ */+ _checkConstrain: function(axis, axisConstrain, offset) {+ var instance = this,+ point1,+ point1Constrain,+ point2,+ point2Constrain,+ host = instance.get(HOST),+ info = host.info,+ constrainBorders = instance.constrainSurrounding.border,+ region = instance._getConstrainRegion(); - if (region) {- point1 = info[axis] + info[offset];- point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]);+ if (region) {+ point1 = info[axis] + info[offset];+ point1Constrain = region[axisConstrain] - toNumber(constrainBorders[capitalize(BORDER, axisConstrain, WIDTH)]); - if (point1 >= point1Constrain) {- info[offset] -= (point1 - point1Constrain);- }+ if (point1 >= point1Constrain) {+ info[offset] -= (point1 - point1Constrain);+ } - point2 = info[axis];- point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]);+ point2 = info[axis];+ point2Constrain = region[axis] + toNumber(constrainBorders[capitalize(BORDER, axis, WIDTH)]); - if (point2 <= point2Constrain) {- info[axis] += (point2Constrain - point2);- info[offset] -= (point2Constrain - point2);- }- }- },+ if (point2 <= point2Constrain) {+ info[axis] += (point2Constrain - point2);+ info[offset] -= (point2Constrain - point2);+ }+ }+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -247,23 +247,23 @@ * @method _checkHeight * @protected */- _checkHeight: function() {- var instance = this,- host = instance.get(HOST),- info = host.info,- maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),- minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding);+ _checkHeight: function() {+ var instance = this,+ host = instance.get(HOST),+ info = host.info,+ maxHeight = (instance.get(MAX_HEIGHT) + host.totalVSurrounding),+ minHeight = (instance.get(MIN_HEIGHT) + host.totalVSurrounding); - instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT);+ instance._checkConstrain(TOP, BOTTOM, OFFSET_HEIGHT); - if (info.offsetHeight > maxHeight) {- host._checkSize(OFFSET_HEIGHT, maxHeight);- }+ if (info.offsetHeight > maxHeight) {+ host._checkSize(OFFSET_HEIGHT, maxHeight);+ } - if (info.offsetHeight < minHeight) {- host._checkSize(OFFSET_HEIGHT, minHeight);- }- },+ if (info.offsetHeight < minHeight) {+ host._checkSize(OFFSET_HEIGHT, minHeight);+ }+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -272,103 +272,103 @@ * @method _checkRatio * @protected */- _checkRatio: function() {- var instance = this,- host = instance.get(HOST),- info = host.info,- originalInfo = host.originalInfo,- oWidth = originalInfo.offsetWidth,- oHeight = originalInfo.offsetHeight,- oTop = originalInfo.top,- oLeft = originalInfo.left,- oBottom = originalInfo.bottom,- oRight = originalInfo.right,- // wRatio/hRatio functions keep the ratio information always synced with the current info information- // RETURN: percentage how much width/height has changed from the original width/height- wRatio = function() {- return (info.offsetWidth/oWidth);- },- hRatio = function() {- return (info.offsetHeight/oHeight);- },- isClosestToHeight = host.changeHeightHandles,- bottomDiff,- constrainBorders,- constrainRegion,- leftDiff,- rightDiff,- topDiff;+ _checkRatio: function() {+ var instance = this,+ host = instance.get(HOST),+ info = host.info,+ originalInfo = host.originalInfo,+ oWidth = originalInfo.offsetWidth,+ oHeight = originalInfo.offsetHeight,+ oTop = originalInfo.top,+ oLeft = originalInfo.left,+ oBottom = originalInfo.bottom,+ oRight = originalInfo.right,+ // wRatio/hRatio functions keep the ratio information always synced with the current info information+ // RETURN: percentage how much width/height has changed from the original width/height+ wRatio = function() {+ return (info.offsetWidth/oWidth);+ },+ hRatio = function() {+ return (info.offsetHeight/oHeight);+ },+ isClosestToHeight = host.changeHeightHandles,+ bottomDiff,+ constrainBorders,+ constrainRegion,+ leftDiff,+ rightDiff,+ topDiff; - // check whether the resizable node is closest to height or not- if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {- constrainRegion = instance._getConstrainRegion();- constrainBorders = instance.constrainSurrounding.border;- bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;- leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));- rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;- topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH]));+ // check whether the resizable node is closest to height or not+ if (instance.get(CONSTRAIN) && host.changeHeightHandles && host.changeWidthHandles) {+ constrainRegion = instance._getConstrainRegion();+ constrainBorders = instance.constrainSurrounding.border;+ bottomDiff = (constrainRegion.bottom - toNumber(constrainBorders[BORDER_BOTTOM_WIDTH])) - oBottom;+ leftDiff = oLeft - (constrainRegion.left + toNumber(constrainBorders[BORDER_LEFT_WIDTH]));+ rightDiff = (constrainRegion.right - toNumber(constrainBorders[BORDER_RIGHT_WIDTH])) - oRight;+ topDiff = oTop - (constrainRegion.top + toNumber(constrainBorders[BORDER_TOP_WIDTH])); - if (host.changeLeftHandles && host.changeTopHandles) {- isClosestToHeight = (topDiff < leftDiff);- }- else if (host.changeLeftHandles) {- isClosestToHeight = (bottomDiff < leftDiff);- }- else if (host.changeTopHandles) {- isClosestToHeight = (topDiff < rightDiff);- }- else {- isClosestToHeight = (bottomDiff < rightDiff);- }- }+ if (host.changeLeftHandles && host.changeTopHandles) {+ isClosestToHeight = (topDiff < leftDiff);+ }+ else if (host.changeLeftHandles) {+ isClosestToHeight = (bottomDiff < leftDiff);+ }+ else if (host.changeTopHandles) {+ isClosestToHeight = (topDiff < rightDiff);+ }+ else {+ isClosestToHeight = (bottomDiff < rightDiff);+ }+ } - // when the height of the resizable element touch the border of the constrain first- // force the offsetWidth to be calculated based on the height ratio- if (isClosestToHeight) {- info.offsetWidth = oWidth*hRatio();- instance._checkWidth();- info.offsetHeight = oHeight*wRatio();- }- else {- info.offsetHeight = oHeight*wRatio();- instance._checkHeight();- info.offsetWidth = oWidth*hRatio();- }+ // when the height of the resizable element touch the border of the constrain first+ // force the offsetWidth to be calculated based on the height ratio+ if (isClosestToHeight) {+ info.offsetWidth = oWidth*hRatio();+ instance._checkWidth();+ info.offsetHeight = oHeight*wRatio();+ }+ else {+ info.offsetHeight = oHeight*wRatio();+ instance._checkHeight();+ info.offsetWidth = oWidth*hRatio();+ } - // fixing the top on handles which are able to change top- // the idea here is change the top based on how much the height has changed instead of follow the dy- if (host.changeTopHandles) {- info.top = oTop + (oHeight - info.offsetHeight);- }+ // fixing the top on handles which are able to change top+ // the idea here is change the top based on how much the height has changed instead of follow the dy+ if (host.changeTopHandles) {+ info.top = oTop + (oHeight - info.offsetHeight);+ } - // fixing the left on handles which are able to change left- // the idea here is change the left based on how much the width has changed instead of follow the dx- if (host.changeLeftHandles) {- info.left = oLeft + (oWidth - info.offsetWidth);- }+ // fixing the left on handles which are able to change left+ // the idea here is change the left based on how much the width has changed instead of follow the dx+ if (host.changeLeftHandles) {+ info.left = oLeft + (oWidth - info.offsetWidth);+ } - // rounding values to avoid pixel jumpings- Y.each(info, function(value, key) {- if (isNumber(value)) {- info[key] = Math.round(value);- }- });- },+ // rounding values to avoid pixel jumpings+ Y.each(info, function(value, key) {+ if (isNumber(value)) {+ info[key] = Math.round(value);+ }+ });+ }, - /**- * Check whether the resizable node is inside the constrain region.- *- * @method _checkRegion- * @protected- * @return {boolean}- */- _checkRegion: function() {- var instance = this,- host = instance.get(HOST),- region = instance._getConstrainRegion();+ /**+ * Check whether the resizable node is inside the constrain region.+ *+ * @method _checkRegion+ * @protected+ * @return {boolean}+ */+ _checkRegion: function() {+ var instance = this,+ host = instance.get(HOST),+ region = instance._getConstrainRegion(); - return Y.DOM.inRegion(null, region, true, host.info);- },+ return Y.DOM.inRegion(null, region, true, host.info);+ }, /** * Update the current values on <a href="Resize.html#property_info">info</a>@@ -377,85 +377,85 @@ * @method _checkWidth * @protected */- _checkWidth: function() {- var instance = this,- host = instance.get(HOST),- info = host.info,- maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),- minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding);+ _checkWidth: function() {+ var instance = this,+ host = instance.get(HOST),+ info = host.info,+ maxWidth = (instance.get(MAX_WIDTH) + host.totalHSurrounding),+ minWidth = (instance.get(MIN_WIDTH) + host.totalHSurrounding); - instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH);+ instance._checkConstrain(LEFT, RIGHT, OFFSET_WIDTH); - if (info.offsetWidth < minWidth) {- host._checkSize(OFFSET_WIDTH, minWidth);- }+ if (info.offsetWidth < minWidth) {+ host._checkSize(OFFSET_WIDTH, minWidth);+ } - if (info.offsetWidth > maxWidth) {- host._checkSize(OFFSET_WIDTH, maxWidth);- }- },+ if (info.offsetWidth > maxWidth) {+ host._checkSize(OFFSET_WIDTH, maxWidth);+ }+ }, - /**- * Get the constrain region based on the <code>constrain</code>+ /**+ * Get the constrain region based on the <code>constrain</code> * attribute.- *- * @method _getConstrainRegion- * @protected- * @return {Object Region}- */- _getConstrainRegion: function() {- var instance = this,- host = instance.get(HOST),- node = host.get(NODE),- constrain = instance.get(CONSTRAIN),- region = null;+ *+ * @method _getConstrainRegion+ * @protected+ * @return {Object Region}+ */+ _getConstrainRegion: function() {+ var instance = this,+ host = instance.get(HOST),+ node = host.get(NODE),+ constrain = instance.get(CONSTRAIN),+ region = null; - if (constrain) {- if (constrain == VIEW) {- region = node.get(VIEWPORT_REGION);- }- else if (isNode(constrain)) {- region = constrain.get(REGION);- }- else {- region = constrain;- }- }+ if (constrain) {+ if (constrain === VIEW) {+ region = node.get(VIEWPORT_REGION);+ }+ else if (isNode(constrain)) {+ region = constrain.get(REGION);+ }+ else {+ region = constrain;+ }+ } - return region;- },+ return region;+ }, - _handleResizeAlignEvent: function(event) {- var instance = this,- host = instance.get(HOST);+ _handleResizeAlignEvent: function() {+ var instance = this,+ host = instance.get(HOST); - // check the max/min height and locking top when these values are reach- instance._checkHeight();+ // check the max/min height and locking top when these values are reach+ instance._checkHeight(); - // check the max/min width and locking left when these values are reach- instance._checkWidth();+ // check the max/min width and locking left when these values are reach+ instance._checkWidth(); - // calculating the ratio, for proportionally resizing- if (instance.get(PRESEVE_RATIO)) {- instance._checkRatio();- }+ // calculating the ratio, for proportionally resizing+ if (instance.get(PRESEVE_RATIO)) {+ instance._checkRatio();+ } - if (instance.get(CONSTRAIN) && !instance._checkRegion()) {- host.info = host.lastInfo;- }- },+ if (instance.get(CONSTRAIN) && !instance._checkRegion()) {+ host.info = host.lastInfo;+ }+ }, - _handleResizeStartEvent: function(event) {- var instance = this,- constrain = instance.get(CONSTRAIN),- host = instance.get(HOST);+ _handleResizeStartEvent: function() {+ var instance = this,+ constrain = instance.get(CONSTRAIN),+ host = instance.get(HOST); - instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);- }+ instance.constrainSurrounding = host._getBoxSurroundingInfo(constrain);+ } }); Y.namespace('Plugin'); Y.Plugin.ResizeConstrained = ResizeConstrained; -}, '3.7.2', {"requires": ["plugin", "resize-base"]});+}, '3.7.3', {"requires": ["plugin", "resize-base"]});
bundle/resize-plugin/assets/resize-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-plugin/assets/skins/night/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-plugin/assets/skins/sam/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-plugin/resize-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/resize-plugin/resize-plugin.js", code: [] };-_yuitest_coverage["build/resize-plugin/resize-plugin.js"].code=["YUI.add('resize-plugin', function (Y, NAME) {","","/**"," * The Resize Plugin allows you to make a Node or a Widget resizable. It supports all the functionality of"," * the standalone Resize utility. Additionally, resizing a widget updates the widget's height,width and x,y"," * attributes, if they exist.","",""," var overlay = new Y.Overlay({"," width: \"200px\","," srcNode: \"#overlay\","," visible: false,"," align: {node:\".example\", points:[\"tc\", \"bc\"]}"," });"," overlay.plug(Y.Plugin.Resize);"," ",""," *"," * @module resize"," * @submodule resize-plugin"," * @extends Resize"," * @class Plugin.Resize"," * @constructor"," */","var ResizePlugin = function(config) {",""," //if its a widget, get the bounding box"," config.node = ((Y.Widget && config.host instanceof Y.Widget) ? config.host.get('boundingBox') : config.host);"," if (config.host instanceof Y.Widget) {"," config.widget = config.host;"," }"," else {"," config.widget = false;"," }",""," ResizePlugin.superclass.constructor.call(this, config);"," };"," "," /**"," * @property NAME"," * @description resize-plugin"," * @type {String}"," */"," ResizePlugin.NAME = \"resize-plugin\";",""," /**"," * @property NS"," * @description The Resize instance will be placed on the Node instance under the resize namespace. It can be accessed via Node.resize or Widget.resize;"," * @type {String}"," */"," ResizePlugin.NS = \"resize\";",""," /**"," * Static property used to define the default attribute"," * configuration for the Resize plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," ResizePlugin.ATTRS = {",""," /**"," * Stores the node that is being resized"," *"," * @attribute node"," * @default undefined"," * @public"," */"," node: {"," value: undefined"," },",""," /**"," * Stores the widget that the node belongs to, if one exists"," *"," * @attribute widget"," * @default undefined"," * @public"," */"," widget: {"," value:undefined"," }"," };","",""," Y.extend(ResizePlugin, Y.Resize, {"," "," /**"," * Stores the values for node and widget, and sets up an event-listener"," *"," * @method initializer"," * @protected"," */"," initializer: function(config) {",""," this.set('node', config.node);"," this.set('widget', config.widget);",""," this.on('resize:resize', function(e) {"," this._correctDimensions(e);"," }); "," },",""," /**"," * Updates the node's (x,y) values if they are changed via resizing."," * If the node belongs to a widget, passes the widget down to _setWidgetProperties method"," *"," * @method _correctDimensions"," * @param {EventFacade} e The Event object"," * @private"," */"," _correctDimensions: function(e) {",""," var node = this.get('node'),"," x = {"," old: node.getX(),"," cur: e.currentTarget.info.left"," },"," y = {"," old: node.getY(),"," cur: e.currentTarget.info.top"," };",""," "," if (this.get('widget')) {"," this._setWidgetProperties(e, x, y);"," }",""," //now set properties on just the node or the widget's bounding box"," if (this._isDifferent(x.old, x.cur)) {"," node.set('x', x.cur);"," }",""," if (this._isDifferent(y.old, y.cur)) {"," node.set('y', y.cur);"," }",""," },",""," "," /**"," * If the host is a widget, then set the width, height. Then look for widgetPosition and set x,y"," *"," * @method _setWidgetProperties"," * @param {EventFacade} e The Event object"," * @param {Object} x Literal containing old x value and current x value"," * @param {Object} y Literal containing old y value and current y value"," * @private"," */"," _setWidgetProperties: function(e,x,y) {"," //all widgets have width/height attrs. change these only if they differ from the old values",""," var widget = this.get('widget'),"," oldHeight = widget.get('height'),"," oldWidth = widget.get('width'),"," currentWidth = e.currentTarget.info.offsetWidth - e.currentTarget.totalHSurrounding,"," currentHeight = e.currentTarget.info.offsetHeight - e.currentTarget.totalVSurrounding;",""," if (this._isDifferent(oldHeight, currentHeight)) {"," widget.set('height', currentHeight);"," }",""," if (this._isDifferent(oldWidth, currentWidth)) {"," widget.set('width', currentWidth);"," }",""," ",""," //If the widget uses Y.WidgetPosition, it will also have x,y position support. "," if (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) {"," "," if (this._isDifferent(widget.get('x'), x.cur)) {"," widget.set('x', x.cur);"," }",""," if (this._isDifferent(widget.get('y'), y.cur)) {"," widget.set('y', y.cur);"," }"," ",""," }"," },",""," /**"," * a little utility method that returns a value if the old !== new, otherwise it returns false."," *"," * @method _isDifferent"," * @param {Number} oldVal "," * @param {Number} newVal"," * @private"," */"," _isDifferent: function(oldVal, newVal) {"," var retValue = false;"," if (oldVal !== newVal) {"," retValue = newVal;"," }"," return retValue;"," }","",""," });"," Y.namespace('Plugin');"," Y.Plugin.Resize = ResizePlugin;","","","}, '3.7.2', {\"requires\": [\"resize-base\", \"plugin\"], \"optional\": [\"resize-constrain\"]});"];-_yuitest_coverage["build/resize-plugin/resize-plugin.js"].lines = {"1":0,"25":0,"28":0,"29":0,"30":0,"33":0,"36":0,"44":0,"51":0,"61":0,"87":0,"97":0,"98":0,"100":0,"101":0,"115":0,"126":0,"127":0,"131":0,"132":0,"135":0,"136":0,"154":0,"160":0,"161":0,"164":0,"165":0,"171":0,"173":0,"174":0,"177":0,"178":0,"194":0,"195":0,"196":0,"198":0,"203":0,"204":0};-_yuitest_coverage["build/resize-plugin/resize-plugin.js"].functions = {"ResizePlugin:25":0,"(anonymous 2):100":0,"initializer:95":0,"_correctDimensions:113":0,"_setWidgetProperties:151":0,"_isDifferent:193":0,"(anonymous 1):1":0};+_yuitest_coverage["build/resize-plugin/resize-plugin.js"].code=["YUI.add('resize-plugin', function (Y, NAME) {","","/**"," * The Resize Plugin allows you to make a Node or a Widget resizable. It supports all the functionality of"," * the standalone Resize utility. Additionally, resizing a widget updates the widget's height,width and x,y"," * attributes, if they exist.","",""," var overlay = new Y.Overlay({"," width: \"200px\","," srcNode: \"#overlay\","," visible: false,"," align: {node:\".example\", points:[\"tc\", \"bc\"]}"," });"," overlay.plug(Y.Plugin.Resize);","",""," *"," * @module resize"," * @submodule resize-plugin"," * @extends Resize"," * @class Plugin.Resize"," * @constructor"," */","var ResizePlugin = function(config) {",""," //if its a widget, get the bounding box"," config.node = ((Y.Widget && config.host instanceof Y.Widget) ? config.host.get('boundingBox') : config.host);"," if (config.host instanceof Y.Widget) {"," config.widget = config.host;"," }"," else {"," config.widget = false;"," }",""," ResizePlugin.superclass.constructor.call(this, config);"," };",""," /**"," * @property NAME"," * @description resize-plugin"," * @type {String}"," */"," ResizePlugin.NAME = \"resize-plugin\";",""," /**"," * The Resize instance will be placed on the Node instance under"," * the resize namespace. It can be accessed via Node.resize or Widget.resize;"," * @property NS"," * @type {String}"," */"," ResizePlugin.NS = \"resize\";",""," /**"," * Static property used to define the default attribute"," * configuration for the Resize plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," ResizePlugin.ATTRS = {",""," /**"," * Stores the node that is being resized"," *"," * @attribute node"," * @default undefined"," * @public"," */"," node: {"," value: undefined"," },",""," /**"," * Stores the widget that the node belongs to, if one exists"," *"," * @attribute widget"," * @default undefined"," * @public"," */"," widget: {"," value:undefined"," }"," };","",""," Y.extend(ResizePlugin, Y.Resize, {",""," /**"," * Stores the values for node and widget, and sets up an event-listener"," *"," * @method initializer"," * @protected"," */"," initializer: function(config) {",""," this.set('node', config.node);"," this.set('widget', config.widget);",""," this.on('resize:resize', function(e) {"," this._correctDimensions(e);"," });"," },",""," /**"," * Updates the node's (x,y) values if they are changed via resizing."," * If the node belongs to a widget, passes the widget down to _setWidgetProperties method"," *"," * @method _correctDimensions"," * @param {EventFacade} e The Event object"," * @private"," */"," _correctDimensions: function(e) {",""," var node = this.get('node'),"," x = {"," old: node.getX(),"," cur: e.currentTarget.info.left"," },"," y = {"," old: node.getY(),"," cur: e.currentTarget.info.top"," };","",""," if (this.get('widget')) {"," this._setWidgetProperties(e, x, y);"," }",""," //now set properties on just the node or the widget's bounding box"," if (this._isDifferent(x.old, x.cur)) {"," node.set('x', x.cur);"," }",""," if (this._isDifferent(y.old, y.cur)) {"," node.set('y', y.cur);"," }",""," },","",""," /**"," * If the host is a widget, then set the width, height. Then look for widgetPosition and set x,y"," *"," * @method _setWidgetProperties"," * @param {EventFacade} e The Event object"," * @param {Object} x Literal containing old x value and current x value"," * @param {Object} y Literal containing old y value and current y value"," * @private"," */"," _setWidgetProperties: function(e,x,y) {"," //all widgets have width/height attrs. change these only if they differ from the old values",""," var widget = this.get('widget'),"," oldHeight = widget.get('height'),"," oldWidth = widget.get('width'),"," currentWidth = e.currentTarget.info.offsetWidth - e.currentTarget.totalHSurrounding,"," currentHeight = e.currentTarget.info.offsetHeight - e.currentTarget.totalVSurrounding;",""," if (this._isDifferent(oldHeight, currentHeight)) {"," widget.set('height', currentHeight);"," }",""," if (this._isDifferent(oldWidth, currentWidth)) {"," widget.set('width', currentWidth);"," }","","",""," //If the widget uses Y.WidgetPosition, it will also have x,y position support."," if (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) {",""," if (this._isDifferent(widget.get('x'), x.cur)) {"," widget.set('x', x.cur);"," }",""," if (this._isDifferent(widget.get('y'), y.cur)) {"," widget.set('y', y.cur);"," }","",""," }"," },",""," /**"," * a little utility method that returns a value if the old !== new, otherwise it returns false."," *"," * @method _isDifferent"," * @param {Number} oldVal"," * @param {Number} newVal"," * @private"," */"," _isDifferent: function(oldVal, newVal) {"," var retValue = false;"," if (oldVal !== newVal) {"," retValue = newVal;"," }"," return retValue;"," }","",""," });"," Y.namespace('Plugin');"," Y.Plugin.Resize = ResizePlugin;","","","}, '3.7.3', {\"requires\": [\"resize-base\", \"plugin\"], \"optional\": [\"resize-constrain\"]});"];+_yuitest_coverage["build/resize-plugin/resize-plugin.js"].lines = {"1":0,"25":0,"28":0,"29":0,"30":0,"33":0,"36":0,"44":0,"52":0,"62":0,"88":0,"98":0,"99":0,"101":0,"102":0,"116":0,"127":0,"128":0,"132":0,"133":0,"136":0,"137":0,"155":0,"161":0,"162":0,"165":0,"166":0,"172":0,"174":0,"175":0,"178":0,"179":0,"195":0,"196":0,"197":0,"199":0,"204":0,"205":0};+_yuitest_coverage["build/resize-plugin/resize-plugin.js"].functions = {"ResizePlugin:25":0,"(anonymous 2):101":0,"initializer:96":0,"_correctDimensions:114":0,"_setWidgetProperties:152":0,"_isDifferent:194":0,"(anonymous 1):1":0}; _yuitest_coverage["build/resize-plugin/resize-plugin.js"].coveredLines = 38; _yuitest_coverage["build/resize-plugin/resize-plugin.js"].coveredFunctions = 7; _yuitest_coverline("build/resize-plugin/resize-plugin.js", 1);@@ -53,8 +53,8 @@ align: {node:".example", points:["tc", "bc"]} }); overlay.plug(Y.Plugin.Resize);- + * * @module resize * @submodule resize-plugin@@ -83,7 +83,7 @@ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 36); ResizePlugin.superclass.constructor.call(this, config); };- + /** * @property NAME * @description resize-plugin@@ -93,11 +93,12 @@ ResizePlugin.NAME = "resize-plugin"; /**+ * The Resize instance will be placed on the Node instance under+ * the resize namespace. It can be accessed via Node.resize or Widget.resize; * @property NS- * @description The Resize instance will be placed on the Node instance under the resize namespace. It can be accessed via Node.resize or Widget.resize; * @type {String} */- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 51);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 52); ResizePlugin.NS = "resize"; /**@@ -108,7 +109,7 @@ * @type Object * @static */- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 61);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 62); ResizePlugin.ATTRS = { /**@@ -135,9 +136,9 @@ }; - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 87);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 88); Y.extend(ResizePlugin, Y.Resize, {- + /** * Stores the values for node and widget, and sets up an event-listener *@@ -146,18 +147,18 @@ */ initializer: function(config) { - _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "initializer", 95);-_yuitest_coverline("build/resize-plugin/resize-plugin.js", 97);+ _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "initializer", 96);+_yuitest_coverline("build/resize-plugin/resize-plugin.js", 98); this.set('node', config.node);- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 98);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 99); this.set('widget', config.widget); - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 100);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 101); this.on('resize:resize', function(e) {- _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "(anonymous 2)", 100);-_yuitest_coverline("build/resize-plugin/resize-plugin.js", 101);+ _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "(anonymous 2)", 101);+_yuitest_coverline("build/resize-plugin/resize-plugin.js", 102); this._correctDimensions(e);- }); + }); }, /**@@ -170,8 +171,8 @@ */ _correctDimensions: function(e) { - _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "_correctDimensions", 113);-_yuitest_coverline("build/resize-plugin/resize-plugin.js", 115);+ _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "_correctDimensions", 114);+_yuitest_coverline("build/resize-plugin/resize-plugin.js", 116); var node = this.get('node'), x = { old: node.getX(),@@ -182,29 +183,29 @@ cur: e.currentTarget.info.top }; - - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 126);++ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 127); if (this.get('widget')) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 127);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 128); this._setWidgetProperties(e, x, y); } //now set properties on just the node or the widget's bounding box- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 131);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 132); if (this._isDifferent(x.old, x.cur)) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 132);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 133); node.set('x', x.cur); } - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 135);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 136); if (this._isDifferent(y.old, y.cur)) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 136);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 137); node.set('y', y.cur); } }, - + /** * If the host is a widget, then set the width, height. Then look for widgetPosition and set x,y *@@ -217,45 +218,45 @@ _setWidgetProperties: function(e,x,y) { //all widgets have width/height attrs. change these only if they differ from the old values - _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "_setWidgetProperties", 151);-_yuitest_coverline("build/resize-plugin/resize-plugin.js", 154);+ _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "_setWidgetProperties", 152);+_yuitest_coverline("build/resize-plugin/resize-plugin.js", 155); var widget = this.get('widget'), oldHeight = widget.get('height'), oldWidth = widget.get('width'), currentWidth = e.currentTarget.info.offsetWidth - e.currentTarget.totalHSurrounding, currentHeight = e.currentTarget.info.offsetHeight - e.currentTarget.totalVSurrounding; - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 160);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 161); if (this._isDifferent(oldHeight, currentHeight)) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 161);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 162); widget.set('height', currentHeight); } - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 164);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 165); if (this._isDifferent(oldWidth, currentWidth)) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 165);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 166); widget.set('width', currentWidth); } - - //If the widget uses Y.WidgetPosition, it will also have x,y position support. - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 171);++ //If the widget uses Y.WidgetPosition, it will also have x,y position support.+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 172); if (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) {- - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 173);++ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 174); if (this._isDifferent(widget.get('x'), x.cur)) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 174);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 175); widget.set('x', x.cur); } - _yuitest_coverline("build/resize-plugin/resize-plugin.js", 177);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 178); if (this._isDifferent(widget.get('y'), y.cur)) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 178);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 179); widget.set('y', y.cur); }- + } }, @@ -263,29 +264,29 @@ * a little utility method that returns a value if the old !== new, otherwise it returns false. * * @method _isDifferent- * @param {Number} oldVal + * @param {Number} oldVal * @param {Number} newVal * @private */ _isDifferent: function(oldVal, newVal) {- _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "_isDifferent", 193);-_yuitest_coverline("build/resize-plugin/resize-plugin.js", 194);+ _yuitest_coverfunc("build/resize-plugin/resize-plugin.js", "_isDifferent", 194);+_yuitest_coverline("build/resize-plugin/resize-plugin.js", 195); var retValue = false;- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 195);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 196); if (oldVal !== newVal) {- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 196);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 197); retValue = newVal; }- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 198);+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 199); return retValue; } });- _yuitest_coverline("build/resize-plugin/resize-plugin.js", 203);-Y.namespace('Plugin'); _yuitest_coverline("build/resize-plugin/resize-plugin.js", 204);+Y.namespace('Plugin');+ _yuitest_coverline("build/resize-plugin/resize-plugin.js", 205); Y.Plugin.Resize = ResizePlugin; -}, '3.7.2', {"requires": ["resize-base", "plugin"], "optional": ["resize-constrain"]});+}, '3.7.3', {"requires": ["resize-base", "plugin"], "optional": ["resize-constrain"]});
bundle/resize-plugin/resize-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,8 +19,8 @@ align: {node:".example", points:["tc", "bc"]} }); overlay.plug(Y.Plugin.Resize);- + * * @module resize * @submodule resize-plugin@@ -41,7 +41,7 @@ ResizePlugin.superclass.constructor.call(this, config); };- + /** * @property NAME * @description resize-plugin@@ -50,8 +50,9 @@ ResizePlugin.NAME = "resize-plugin"; /**+ * The Resize instance will be placed on the Node instance under+ * the resize namespace. It can be accessed via Node.resize or Widget.resize; * @property NS- * @description The Resize instance will be placed on the Node instance under the resize namespace. It can be accessed via Node.resize or Widget.resize; * @type {String} */ ResizePlugin.NS = "resize";@@ -91,7 +92,7 @@ Y.extend(ResizePlugin, Y.Resize, {- + /** * Stores the values for node and widget, and sets up an event-listener *@@ -105,7 +106,7 @@ this.on('resize:resize', function(e) { this._correctDimensions(e);- }); + }); }, /**@@ -128,7 +129,7 @@ cur: e.currentTarget.info.top }; - + if (this.get('widget')) { this._setWidgetProperties(e, x, y); }@@ -144,7 +145,7 @@ }, - + /** * If the host is a widget, then set the width, height. Then look for widgetPosition and set x,y *@@ -171,11 +172,11 @@ widget.set('width', currentWidth); } - - //If the widget uses Y.WidgetPosition, it will also have x,y position support. ++ //If the widget uses Y.WidgetPosition, it will also have x,y position support. if (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) {- + if (this._isDifferent(widget.get('x'), x.cur)) { widget.set('x', x.cur); }@@ -183,8 +184,8 @@ if (this._isDifferent(widget.get('y'), y.cur)) { widget.set('y', y.cur); }- + } }, @@ -192,7 +193,7 @@ * a little utility method that returns a value if the old !== new, otherwise it returns false. * * @method _isDifferent- * @param {Number} oldVal + * @param {Number} oldVal * @param {Number} newVal * @private */@@ -210,4 +211,4 @@ Y.Plugin.Resize = ResizePlugin; -}, '3.7.2', {"requires": ["resize-base", "plugin"], "optional": ["resize-constrain"]});+}, '3.7.3', {"requires": ["resize-base", "plugin"], "optional": ["resize-constrain"]});
bundle/resize-plugin/resize-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("resize-plugin",function(e,t){var n=function(t){t.node=e.Widget&&t.host instanceof e.Widget?t.host.get("boundingBox"):t.host,t.host instanceof e.Widget?t.widget=t.host:t.widget=!1,n.superclass.constructor.call(this,t)};n.NAME="resize-plugin",n.NS="resize",n.ATTRS={node:{value:undefined},widget:{value:undefined}},e.extend(n,e.Resize,{initializer:function(e){this.set("node",e.node),this.set("widget",e.widget),this.on("resize:resize",function(e){this._correctDimensions(e)})},_correctDimensions:function(e){var t=this.get("node"),n={old:t.getX(),cur:e.currentTarget.info.left},r={old:t.getY(),cur:e.currentTarget.info.top};this.get("widget")&&this._setWidgetProperties(e,n,r),this._isDifferent(n.old,n.cur)&&t.set("x",n.cur),this._isDifferent(r.old,r.cur)&&t.set("y",r.cur)},_setWidgetProperties:function(t,n,r){var i=this.get("widget"),s=i.get("height"),o=i.get("width"),u=t.currentTarget.info.offsetWidth-t.currentTarget.totalHSurrounding,a=t.currentTarget.info.offsetHeight-t.currentTarget.totalVSurrounding;this._isDifferent(s,a)&&i.set("height",a),this._isDifferent(o,u)&&i.set("width",u),i.hasImpl&&i.hasImpl(e.WidgetPosition)&&(this._isDifferent(i.get("x"),n.cur)&&i.set("x",n.cur),this._isDifferent(i.get("y"),r.cur)&&i.set("y",r.cur))},_isDifferent:function(e,t){var n=!1;return e!==t&&(n=t),n}}),e.namespace("Plugin"),e.Plugin.Resize=n},"3.7.2",{requires:["resize-base","plugin"],optional:["resize-constrain"]});+YUI.add("resize-plugin",function(e,t){var n=function(t){t.node=e.Widget&&t.host instanceof e.Widget?t.host.get("boundingBox"):t.host,t.host instanceof e.Widget?t.widget=t.host:t.widget=!1,n.superclass.constructor.call(this,t)};n.NAME="resize-plugin",n.NS="resize",n.ATTRS={node:{value:undefined},widget:{value:undefined}},e.extend(n,e.Resize,{initializer:function(e){this.set("node",e.node),this.set("widget",e.widget),this.on("resize:resize",function(e){this._correctDimensions(e)})},_correctDimensions:function(e){var t=this.get("node"),n={old:t.getX(),cur:e.currentTarget.info.left},r={old:t.getY(),cur:e.currentTarget.info.top};this.get("widget")&&this._setWidgetProperties(e,n,r),this._isDifferent(n.old,n.cur)&&t.set("x",n.cur),this._isDifferent(r.old,r.cur)&&t.set("y",r.cur)},_setWidgetProperties:function(t,n,r){var i=this.get("widget"),s=i.get("height"),o=i.get("width"),u=t.currentTarget.info.offsetWidth-t.currentTarget.totalHSurrounding,a=t.currentTarget.info.offsetHeight-t.currentTarget.totalVSurrounding;this._isDifferent(s,a)&&i.set("height",a),this._isDifferent(o,u)&&i.set("width",u),i.hasImpl&&i.hasImpl(e.WidgetPosition)&&(this._isDifferent(i.get("x"),n.cur)&&i.set("x",n.cur),this._isDifferent(i.get("y"),r.cur)&&i.set("y",r.cur))},_isDifferent:function(e,t){var n=!1;return e!==t&&(n=t),n}}),e.namespace("Plugin"),e.Plugin.Resize=n},"3.7.3",{requires:["resize-base","plugin"],optional:["resize-constrain"]});
bundle/resize-plugin/resize-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,8 +19,8 @@ align: {node:".example", points:["tc", "bc"]} }); overlay.plug(Y.Plugin.Resize);- + * * @module resize * @submodule resize-plugin@@ -41,7 +41,7 @@ ResizePlugin.superclass.constructor.call(this, config); };- + /** * @property NAME * @description resize-plugin@@ -50,8 +50,9 @@ ResizePlugin.NAME = "resize-plugin"; /**+ * The Resize instance will be placed on the Node instance under+ * the resize namespace. It can be accessed via Node.resize or Widget.resize; * @property NS- * @description The Resize instance will be placed on the Node instance under the resize namespace. It can be accessed via Node.resize or Widget.resize; * @type {String} */ ResizePlugin.NS = "resize";@@ -91,7 +92,7 @@ Y.extend(ResizePlugin, Y.Resize, {- + /** * Stores the values for node and widget, and sets up an event-listener *@@ -105,7 +106,7 @@ this.on('resize:resize', function(e) { this._correctDimensions(e);- }); + }); }, /**@@ -128,7 +129,7 @@ cur: e.currentTarget.info.top }; - + if (this.get('widget')) { this._setWidgetProperties(e, x, y); }@@ -144,7 +145,7 @@ }, - + /** * If the host is a widget, then set the width, height. Then look for widgetPosition and set x,y *@@ -171,11 +172,11 @@ widget.set('width', currentWidth); } - - //If the widget uses Y.WidgetPosition, it will also have x,y position support. ++ //If the widget uses Y.WidgetPosition, it will also have x,y position support. if (widget.hasImpl && widget.hasImpl(Y.WidgetPosition)) {- + if (this._isDifferent(widget.get('x'), x.cur)) { widget.set('x', x.cur); }@@ -183,8 +184,8 @@ if (this._isDifferent(widget.get('y'), y.cur)) { widget.set('y', y.cur); }- + } }, @@ -192,7 +193,7 @@ * a little utility method that returns a value if the old !== new, otherwise it returns false. * * @method _isDifferent- * @param {Number} oldVal + * @param {Number} oldVal * @param {Number} newVal * @private */@@ -210,4 +211,4 @@ Y.Plugin.Resize = ResizePlugin; -}, '3.7.2', {"requires": ["resize-base", "plugin"], "optional": ["resize-constrain"]});+}, '3.7.3', {"requires": ["resize-base", "plugin"], "optional": ["resize-constrain"]});
bundle/resize-proxy/assets/resize-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-proxy/assets/skins/night/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-proxy/assets/skins/sam/resize-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/resize-proxy/resize-proxy-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/resize-proxy/resize-proxy.js", code: [] };-_yuitest_coverage["build/resize-proxy/resize-proxy.js"].code=["YUI.add('resize-proxy', function (Y, NAME) {","","var ACTIVE_HANDLE_NODE = 'activeHandleNode',"," CURSOR = 'cursor',"," DRAG_CURSOR = 'dragCursor',"," HOST = 'host',"," PARENT_NODE = 'parentNode',"," PROXY = 'proxy',"," PROXY_NODE = 'proxyNode',"," RESIZE = 'resize',"," RESIZE_PROXY = 'resize-proxy',"," WRAPPER = 'wrapper',",""," getCN = Y.ClassNameManager.getClassName,",""," CSS_RESIZE_PROXY = getCN(RESIZE, PROXY);","","","/**","Adds a `proxyNode` attribute and resizes it instead of the actual node. __very similar to DDProxy__",""," var resize = new Y.Resize({"," //Selector of the node to resize"," node: '#demo'"," });"," resize.plug(Y.Plugin.ResizeProxy);"," ","","@class ResizeProxy","@module resize","@submodule resize-proxy","@constructor","@extends Plugin.Base","@namespace Plugin","*/","","","function ResizeProxy() {"," ResizeProxy.superclass.constructor.apply(this, arguments);","}","","Y.mix(ResizeProxy, {"," NAME: RESIZE_PROXY,",""," NS: PROXY,",""," ATTRS: {"," /**"," * The Resize proxy element."," *"," * @attribute proxyNode"," * @default Generated using an internal HTML markup"," * @type String|Node"," */"," proxyNode: {"," setter: Y.one,"," valueFn: function() {"," return Y.Node.create(this.PROXY_TEMPLATE);"," }"," }"," }","});","","Y.extend(ResizeProxy, Y.Plugin.Base, {"," /**"," * Template used to create the resize proxy."," *"," * @property PROXY_TEMPLATE"," * @type {String}"," */"," PROXY_TEMPLATE: '<div class=\"'+CSS_RESIZE_PROXY+'\"></div>',",""," initializer: function() {"," var instance = this;",""," instance.afterHostEvent('resize:start', instance._afterResizeStart);"," instance.beforeHostMethod('_resize', instance._beforeHostResize);"," instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);"," },",""," destructor: function() {"," var instance = this;",""," instance.get(PROXY_NODE).remove(true);"," },",""," _afterHostResizeEnd: function(event) {"," var instance = this,"," drag = event.dragEvent.target;",""," // reseting actXY from drag when drag end"," drag.actXY = [];",""," // if proxy is true, hide it on resize end"," instance._syncProxyUI();",""," instance.get(PROXY_NODE).hide();"," },",""," _afterResizeStart: function(event) {"," var instance = this;",""," instance._renderProxy();"," },",""," _beforeHostResize: function(event) {"," var instance = this,"," host = this.get(HOST);",""," host._handleResizeAlignEvent(event.dragEvent);",""," // if proxy is true _syncProxyUI instead of _syncUI"," instance._syncProxyUI();",""," return new Y.Do.Prevent();"," },",""," /**"," * Render the <a href=\"ResizeProxy.html#attr_proxyNode\">proxyNode</a> element and"," * make it sibling of the <a href=\"Resize.html#attr_node\">node</a>."," *"," * @method _renderProxy"," * @protected"," */"," _renderProxy: function() {"," var instance = this,"," host = this.get(HOST),"," proxyNode = instance.get(PROXY_NODE);",""," if (!proxyNode.inDoc()) {"," host.get(WRAPPER).get(PARENT_NODE).append("," proxyNode.hide()"," );"," }"," },",""," /**"," * Sync the proxy UI with internal values from"," * <a href=\"ResizeProxy.html#property_info\">info</a>."," *"," * @method _syncProxyUI"," * @protected"," */"," _syncProxyUI: function() {"," var instance = this,"," host = this.get(HOST),"," info = host.info,"," activeHandleNode = host.get(ACTIVE_HANDLE_NODE),"," proxyNode = instance.get(PROXY_NODE),"," cursor = activeHandleNode.getStyle(CURSOR);",""," proxyNode.show().setStyle(CURSOR, cursor);",""," host.delegate.dd.set(DRAG_CURSOR, cursor);",""," proxyNode.sizeTo(info.offsetWidth, info.offsetHeight);",""," proxyNode.setXY([ info.left, info.top ]);"," }","});","","Y.namespace('Plugin');","Y.Plugin.ResizeProxy = ResizeProxy;","","","}, '3.7.2', {\"requires\": [\"plugin\", \"resize-base\"]});"];+_yuitest_coverage["build/resize-proxy/resize-proxy.js"].code=["YUI.add('resize-proxy', function (Y, NAME) {","","var ACTIVE_HANDLE_NODE = 'activeHandleNode',"," CURSOR = 'cursor',"," DRAG_CURSOR = 'dragCursor',"," HOST = 'host',"," PARENT_NODE = 'parentNode',"," PROXY = 'proxy',"," PROXY_NODE = 'proxyNode',"," RESIZE = 'resize',"," RESIZE_PROXY = 'resize-proxy',"," WRAPPER = 'wrapper',",""," getCN = Y.ClassNameManager.getClassName,",""," CSS_RESIZE_PROXY = getCN(RESIZE, PROXY);","","","/**","Adds a `proxyNode` attribute and resizes it instead of the actual node. __very similar to DDProxy__",""," var resize = new Y.Resize({"," //Selector of the node to resize"," node: '#demo'"," });"," resize.plug(Y.Plugin.ResizeProxy);","","","@class ResizeProxy","@module resize","@submodule resize-proxy","@constructor","@extends Plugin.Base","@namespace Plugin","*/","","","function ResizeProxy() {"," ResizeProxy.superclass.constructor.apply(this, arguments);","}","","Y.mix(ResizeProxy, {"," NAME: RESIZE_PROXY,",""," NS: PROXY,",""," ATTRS: {"," /**"," * The Resize proxy element."," *"," * @attribute proxyNode"," * @default Generated using an internal HTML markup"," * @type String|Node"," */"," proxyNode: {"," setter: Y.one,"," valueFn: function() {"," return Y.Node.create(this.PROXY_TEMPLATE);"," }"," }"," }","});","","Y.extend(ResizeProxy, Y.Plugin.Base, {"," /**"," * Template used to create the resize proxy."," *"," * @property PROXY_TEMPLATE"," * @type {String}"," */"," PROXY_TEMPLATE: '<div class=\"'+CSS_RESIZE_PROXY+'\"></div>',",""," initializer: function() {"," var instance = this;",""," instance.afterHostEvent('resize:start', instance._afterResizeStart);"," instance.beforeHostMethod('_resize', instance._beforeHostResize);"," instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);"," },",""," destructor: function() {"," var instance = this;",""," instance.get(PROXY_NODE).remove(true);"," },",""," _afterHostResizeEnd: function(event) {"," var instance = this,"," drag = event.dragEvent.target;",""," // reseting actXY from drag when drag end"," drag.actXY = [];",""," // if proxy is true, hide it on resize end"," instance._syncProxyUI();",""," instance.get(PROXY_NODE).hide();"," },",""," _afterResizeStart: function() {"," var instance = this;",""," instance._renderProxy();"," },",""," _beforeHostResize: function(event) {"," var instance = this,"," host = this.get(HOST);",""," host._handleResizeAlignEvent(event.dragEvent);",""," // if proxy is true _syncProxyUI instead of _syncUI"," instance._syncProxyUI();",""," return new Y.Do.Prevent();"," },",""," /**"," * Render the <a href=\"ResizeProxy.html#attr_proxyNode\">proxyNode</a> element and"," * make it sibling of the <a href=\"Resize.html#attr_node\">node</a>."," *"," * @method _renderProxy"," * @protected"," */"," _renderProxy: function() {"," var instance = this,"," host = this.get(HOST),"," proxyNode = instance.get(PROXY_NODE);",""," if (!proxyNode.inDoc()) {"," host.get(WRAPPER).get(PARENT_NODE).append("," proxyNode.hide()"," );"," }"," },",""," /**"," * Sync the proxy UI with internal values from"," * <a href=\"ResizeProxy.html#property_info\">info</a>."," *"," * @method _syncProxyUI"," * @protected"," */"," _syncProxyUI: function() {"," var instance = this,"," host = this.get(HOST),"," info = host.info,"," activeHandleNode = host.get(ACTIVE_HANDLE_NODE),"," proxyNode = instance.get(PROXY_NODE),"," cursor = activeHandleNode.getStyle(CURSOR);",""," proxyNode.show().setStyle(CURSOR, cursor);",""," host.delegate.dd.set(DRAG_CURSOR, cursor);",""," proxyNode.sizeTo(info.offsetWidth, info.offsetHeight);",""," proxyNode.setXY([ info.left, info.top ]);"," }","});","","Y.namespace('Plugin');","Y.Plugin.ResizeProxy = ResizeProxy;","","","}, '3.7.3', {\"requires\": [\"plugin\", \"resize-base\"]});"]; _yuitest_coverage["build/resize-proxy/resize-proxy.js"].lines = {"1":0,"3":0,"38":0,"39":0,"42":0,"58":0,"64":0,"74":0,"76":0,"77":0,"78":0,"82":0,"84":0,"88":0,"92":0,"95":0,"97":0,"101":0,"103":0,"107":0,"110":0,"113":0,"115":0,"126":0,"130":0,"131":0,"145":0,"152":0,"154":0,"156":0,"158":0,"162":0,"163":0}; _yuitest_coverage["build/resize-proxy/resize-proxy.js"].functions = {"ResizeProxy:38":0,"valueFn:57":0,"initializer:73":0,"destructor:81":0,"_afterHostResizeEnd:87":0,"_afterResizeStart:100":0,"_beforeHostResize:106":0,"_renderProxy:125":0,"_syncProxyUI:144":0,"(anonymous 1):1":0}; _yuitest_coverage["build/resize-proxy/resize-proxy.js"].coveredLines = 33;@@ -43,19 +43,19 @@ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "(anonymous 1)", 1); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 3); var ACTIVE_HANDLE_NODE = 'activeHandleNode',- CURSOR = 'cursor',- DRAG_CURSOR = 'dragCursor',- HOST = 'host',- PARENT_NODE = 'parentNode',- PROXY = 'proxy',- PROXY_NODE = 'proxyNode',- RESIZE = 'resize',- RESIZE_PROXY = 'resize-proxy',- WRAPPER = 'wrapper',+ CURSOR = 'cursor',+ DRAG_CURSOR = 'dragCursor',+ HOST = 'host',+ PARENT_NODE = 'parentNode',+ PROXY = 'proxy',+ PROXY_NODE = 'proxyNode',+ RESIZE = 'resize',+ RESIZE_PROXY = 'resize-proxy',+ WRAPPER = 'wrapper', - getCN = Y.ClassNameManager.getClassName,+ getCN = Y.ClassNameManager.getClassName, - CSS_RESIZE_PROXY = getCN(RESIZE, PROXY);+ CSS_RESIZE_PROXY = getCN(RESIZE, PROXY); /**@@ -66,8 +66,8 @@ node: '#demo' }); resize.plug(Y.Plugin.ResizeProxy);- + @class ResizeProxy @module resize @submodule resize-proxy@@ -79,111 +79,111 @@ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 38); function ResizeProxy() {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "ResizeProxy", 38);+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "ResizeProxy", 38); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 39); ResizeProxy.superclass.constructor.apply(this, arguments); } _yuitest_coverline("build/resize-proxy/resize-proxy.js", 42); Y.mix(ResizeProxy, {- NAME: RESIZE_PROXY,+ NAME: RESIZE_PROXY, - NS: PROXY,+ NS: PROXY, - ATTRS: {- /**+ ATTRS: {+ /** * The Resize proxy element. * * @attribute proxyNode * @default Generated using an internal HTML markup * @type String|Node */- proxyNode: {- setter: Y.one,- valueFn: function() {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "valueFn", 57);+ proxyNode: {+ setter: Y.one,+ valueFn: function() {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "valueFn", 57); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 58); return Y.Node.create(this.PROXY_TEMPLATE);- }- }- }+ }+ }+ } }); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 64); Y.extend(ResizeProxy, Y.Plugin.Base, {- /**+ /** * Template used to create the resize proxy. * * @property PROXY_TEMPLATE * @type {String} */- PROXY_TEMPLATE: '<div class="'+CSS_RESIZE_PROXY+'"></div>',+ PROXY_TEMPLATE: '<div class="'+CSS_RESIZE_PROXY+'"></div>', - initializer: function() {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "initializer", 73);+ initializer: function() {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "initializer", 73); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 74); var instance = this; - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 76);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 76); instance.afterHostEvent('resize:start', instance._afterResizeStart);- _yuitest_coverline("build/resize-proxy/resize-proxy.js", 77);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 77); instance.beforeHostMethod('_resize', instance._beforeHostResize);- _yuitest_coverline("build/resize-proxy/resize-proxy.js", 78);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 78); instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);- },+ }, - destructor: function() {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "destructor", 81);+ destructor: function() {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "destructor", 81); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 82); var instance = this; - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 84);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 84); instance.get(PROXY_NODE).remove(true);- },+ }, - _afterHostResizeEnd: function(event) {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_afterHostResizeEnd", 87);+ _afterHostResizeEnd: function(event) {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_afterHostResizeEnd", 87); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 88); var instance = this,- drag = event.dragEvent.target;+ drag = event.dragEvent.target; - // reseting actXY from drag when drag end- _yuitest_coverline("build/resize-proxy/resize-proxy.js", 92);+ // reseting actXY from drag when drag end+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 92); drag.actXY = []; - // if proxy is true, hide it on resize end- _yuitest_coverline("build/resize-proxy/resize-proxy.js", 95);+ // if proxy is true, hide it on resize end+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 95); instance._syncProxyUI(); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 97);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 97); instance.get(PROXY_NODE).hide();- },+ }, - _afterResizeStart: function(event) {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_afterResizeStart", 100);+ _afterResizeStart: function() {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_afterResizeStart", 100); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 101); var instance = this; - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 103);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 103); instance._renderProxy();- },+ }, - _beforeHostResize: function(event) {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_beforeHostResize", 106);+ _beforeHostResize: function(event) {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_beforeHostResize", 106); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 107); var instance = this,- host = this.get(HOST);+ host = this.get(HOST); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 110);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 110); host._handleResizeAlignEvent(event.dragEvent); - // if proxy is true _syncProxyUI instead of _syncUI- _yuitest_coverline("build/resize-proxy/resize-proxy.js", 113);+ // if proxy is true _syncProxyUI instead of _syncUI+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 113); instance._syncProxyUI(); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 115);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 115); return new Y.Do.Prevent();- },+ }, /** * Render the <a href="ResizeProxy.html#attr_proxyNode">proxyNode</a> element and@@ -192,51 +192,51 @@ * @method _renderProxy * @protected */- _renderProxy: function() {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_renderProxy", 125);+ _renderProxy: function() {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_renderProxy", 125); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 126); var instance = this,- host = this.get(HOST),- proxyNode = instance.get(PROXY_NODE);+ host = this.get(HOST),+ proxyNode = instance.get(PROXY_NODE); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 130);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 130); if (!proxyNode.inDoc()) {- _yuitest_coverline("build/resize-proxy/resize-proxy.js", 131);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 131); host.get(WRAPPER).get(PARENT_NODE).append(- proxyNode.hide()- );- }- },+ proxyNode.hide()+ );+ }+ }, - /**+ /** * Sync the proxy UI with internal values from * <a href="ResizeProxy.html#property_info">info</a>. * * @method _syncProxyUI * @protected */- _syncProxyUI: function() {- _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_syncProxyUI", 144);+ _syncProxyUI: function() {+ _yuitest_coverfunc("build/resize-proxy/resize-proxy.js", "_syncProxyUI", 144); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 145); var instance = this,- host = this.get(HOST),- info = host.info,- activeHandleNode = host.get(ACTIVE_HANDLE_NODE),- proxyNode = instance.get(PROXY_NODE),- cursor = activeHandleNode.getStyle(CURSOR);+ host = this.get(HOST),+ info = host.info,+ activeHandleNode = host.get(ACTIVE_HANDLE_NODE),+ proxyNode = instance.get(PROXY_NODE),+ cursor = activeHandleNode.getStyle(CURSOR); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 152);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 152); proxyNode.show().setStyle(CURSOR, cursor); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 154);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 154); host.delegate.dd.set(DRAG_CURSOR, cursor); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 156);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 156); proxyNode.sizeTo(info.offsetWidth, info.offsetHeight); - _yuitest_coverline("build/resize-proxy/resize-proxy.js", 158);+ _yuitest_coverline("build/resize-proxy/resize-proxy.js", 158); proxyNode.setXY([ info.left, info.top ]);- }+ } }); _yuitest_coverline("build/resize-proxy/resize-proxy.js", 162);@@ -245,4 +245,4 @@ Y.Plugin.ResizeProxy = ResizeProxy; -}, '3.7.2', {"requires": ["plugin", "resize-base"]});+}, '3.7.3', {"requires": ["plugin", "resize-base"]});
bundle/resize-proxy/resize-proxy-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -7,19 +7,19 @@ YUI.add('resize-proxy', function (Y, NAME) { var ACTIVE_HANDLE_NODE = 'activeHandleNode',- CURSOR = 'cursor',- DRAG_CURSOR = 'dragCursor',- HOST = 'host',- PARENT_NODE = 'parentNode',- PROXY = 'proxy',- PROXY_NODE = 'proxyNode',- RESIZE = 'resize',- RESIZE_PROXY = 'resize-proxy',- WRAPPER = 'wrapper',+ CURSOR = 'cursor',+ DRAG_CURSOR = 'dragCursor',+ HOST = 'host',+ PARENT_NODE = 'parentNode',+ PROXY = 'proxy',+ PROXY_NODE = 'proxyNode',+ RESIZE = 'resize',+ RESIZE_PROXY = 'resize-proxy',+ WRAPPER = 'wrapper', - getCN = Y.ClassNameManager.getClassName,+ getCN = Y.ClassNameManager.getClassName, - CSS_RESIZE_PROXY = getCN(RESIZE, PROXY);+ CSS_RESIZE_PROXY = getCN(RESIZE, PROXY); /**@@ -30,8 +30,8 @@ node: '#demo' }); resize.plug(Y.Plugin.ResizeProxy);- + @class ResizeProxy @module resize @submodule resize-proxy@@ -42,84 +42,84 @@ function ResizeProxy() {- ResizeProxy.superclass.constructor.apply(this, arguments);+ ResizeProxy.superclass.constructor.apply(this, arguments); } Y.mix(ResizeProxy, {- NAME: RESIZE_PROXY,+ NAME: RESIZE_PROXY, - NS: PROXY,+ NS: PROXY, - ATTRS: {- /**+ ATTRS: {+ /** * The Resize proxy element. * * @attribute proxyNode * @default Generated using an internal HTML markup * @type String|Node */- proxyNode: {- setter: Y.one,- valueFn: function() {- return Y.Node.create(this.PROXY_TEMPLATE);- }- }- }+ proxyNode: {+ setter: Y.one,+ valueFn: function() {+ return Y.Node.create(this.PROXY_TEMPLATE);+ }+ }+ } }); Y.extend(ResizeProxy, Y.Plugin.Base, {- /**+ /** * Template used to create the resize proxy. * * @property PROXY_TEMPLATE * @type {String} */- PROXY_TEMPLATE: '<div class="'+CSS_RESIZE_PROXY+'"></div>',+ PROXY_TEMPLATE: '<div class="'+CSS_RESIZE_PROXY+'"></div>', - initializer: function() {- var instance = this;+ initializer: function() {+ var instance = this; - instance.afterHostEvent('resize:start', instance._afterResizeStart);- instance.beforeHostMethod('_resize', instance._beforeHostResize);- instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);- },+ instance.afterHostEvent('resize:start', instance._afterResizeStart);+ instance.beforeHostMethod('_resize', instance._beforeHostResize);+ instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);+ }, - destructor: function() {- var instance = this;+ destructor: function() {+ var instance = this; - instance.get(PROXY_NODE).remove(true);- },+ instance.get(PROXY_NODE).remove(true);+ }, - _afterHostResizeEnd: function(event) {- var instance = this,- drag = event.dragEvent.target;+ _afterHostResizeEnd: function(event) {+ var instance = this,+ drag = event.dragEvent.target; - // reseting actXY from drag when drag end- drag.actXY = [];+ // reseting actXY from drag when drag end+ drag.actXY = []; - // if proxy is true, hide it on resize end- instance._syncProxyUI();+ // if proxy is true, hide it on resize end+ instance._syncProxyUI(); - instance.get(PROXY_NODE).hide();- },+ instance.get(PROXY_NODE).hide();+ }, - _afterResizeStart: function(event) {- var instance = this;+ _afterResizeStart: function() {+ var instance = this; - instance._renderProxy();- },+ instance._renderProxy();+ }, - _beforeHostResize: function(event) {- var instance = this,- host = this.get(HOST);+ _beforeHostResize: function(event) {+ var instance = this,+ host = this.get(HOST); - host._handleResizeAlignEvent(event.dragEvent);+ host._handleResizeAlignEvent(event.dragEvent); - // if proxy is true _syncProxyUI instead of _syncUI- instance._syncProxyUI();+ // if proxy is true _syncProxyUI instead of _syncUI+ instance._syncProxyUI(); - return new Y.Do.Prevent();- },+ return new Y.Do.Prevent();+ }, /** * Render the <a href="ResizeProxy.html#attr_proxyNode">proxyNode</a> element and@@ -128,45 +128,45 @@ * @method _renderProxy * @protected */- _renderProxy: function() {- var instance = this,- host = this.get(HOST),- proxyNode = instance.get(PROXY_NODE);+ _renderProxy: function() {+ var instance = this,+ host = this.get(HOST),+ proxyNode = instance.get(PROXY_NODE); - if (!proxyNode.inDoc()) {- host.get(WRAPPER).get(PARENT_NODE).append(- proxyNode.hide()- );- }- },+ if (!proxyNode.inDoc()) {+ host.get(WRAPPER).get(PARENT_NODE).append(+ proxyNode.hide()+ );+ }+ }, - /**+ /** * Sync the proxy UI with internal values from * <a href="ResizeProxy.html#property_info">info</a>. * * @method _syncProxyUI * @protected */- _syncProxyUI: function() {- var instance = this,- host = this.get(HOST),- info = host.info,- activeHandleNode = host.get(ACTIVE_HANDLE_NODE),- proxyNode = instance.get(PROXY_NODE),- cursor = activeHandleNode.getStyle(CURSOR);+ _syncProxyUI: function() {+ var instance = this,+ host = this.get(HOST),+ info = host.info,+ activeHandleNode = host.get(ACTIVE_HANDLE_NODE),+ proxyNode = instance.get(PROXY_NODE),+ cursor = activeHandleNode.getStyle(CURSOR); - proxyNode.show().setStyle(CURSOR, cursor);+ proxyNode.show().setStyle(CURSOR, cursor); - host.delegate.dd.set(DRAG_CURSOR, cursor);+ host.delegate.dd.set(DRAG_CURSOR, cursor); - proxyNode.sizeTo(info.offsetWidth, info.offsetHeight);+ proxyNode.sizeTo(info.offsetWidth, info.offsetHeight); - proxyNode.setXY([ info.left, info.top ]);- }+ proxyNode.setXY([ info.left, info.top ]);+ } }); Y.namespace('Plugin'); Y.Plugin.ResizeProxy = ResizeProxy; -}, '3.7.2', {"requires": ["plugin", "resize-base"]});+}, '3.7.3', {"requires": ["plugin", "resize-base"]});
bundle/resize-proxy/resize-proxy-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("resize-proxy",function(e,t){function d(){d.superclass.constructor.apply(this,arguments)}var n="activeHandleNode",r="cursor",i="dragCursor",s="host",o="parentNode",u="proxy",a="proxyNode",f="resize",l="resize-proxy",c="wrapper",h=e.ClassNameManager.getClassName,p=h(f,u);e.mix(d,{NAME:l,NS:u,ATTRS:{proxyNode:{setter:e.one,valueFn:function(){return e.Node.create(this.PROXY_TEMPLATE)}}}}),e.extend(d,e.Plugin.Base,{PROXY_TEMPLATE:'<div class="'+p+'"></div>',initializer:function(){var e=this;e.afterHostEvent("resize:start",e._afterResizeStart),e.beforeHostMethod("_resize",e._beforeHostResize),e.afterHostMethod("_resizeEnd",e._afterHostResizeEnd)},destructor:function(){var e=this;e.get(a).remove(!0)},_afterHostResizeEnd:function(e){var t=this,n=e.dragEvent.target;n.actXY=[],t._syncProxyUI(),t.get(a).hide()},_afterResizeStart:function(e){var t=this;t._renderProxy()},_beforeHostResize:function(t){var n=this,r=this.get(s);return r._handleResizeAlignEvent(t.dragEvent),n._syncProxyUI(),new e.Do.Prevent},_renderProxy:function(){var e=this,t=this.get(s),n=e.get(a);n.inDoc()||t.get(c).get(o).append(n.hide())},_syncProxyUI:function(){var e=this,t=this.get(s),o=t.info,u=t.get(n),f=e.get(a),l=u.getStyle(r);f.show().setStyle(r,l),t.delegate.dd.set(i,l),f.sizeTo(o.offsetWidth,o.offsetHeight),f.setXY([o.left,o.top])}}),e.namespace("Plugin"),e.Plugin.ResizeProxy=d},"3.7.2",{requires:["plugin","resize-base"]});+YUI.add("resize-proxy",function(e,t){function d(){d.superclass.constructor.apply(this,arguments)}var n="activeHandleNode",r="cursor",i="dragCursor",s="host",o="parentNode",u="proxy",a="proxyNode",f="resize",l="resize-proxy",c="wrapper",h=e.ClassNameManager.getClassName,p=h(f,u);e.mix(d,{NAME:l,NS:u,ATTRS:{proxyNode:{setter:e.one,valueFn:function(){return e.Node.create(this.PROXY_TEMPLATE)}}}}),e.extend(d,e.Plugin.Base,{PROXY_TEMPLATE:'<div class="'+p+'"></div>',initializer:function(){var e=this;e.afterHostEvent("resize:start",e._afterResizeStart),e.beforeHostMethod("_resize",e._beforeHostResize),e.afterHostMethod("_resizeEnd",e._afterHostResizeEnd)},destructor:function(){var e=this;e.get(a).remove(!0)},_afterHostResizeEnd:function(e){var t=this,n=e.dragEvent.target;n.actXY=[],t._syncProxyUI(),t.get(a).hide()},_afterResizeStart:function(){var e=this;e._renderProxy()},_beforeHostResize:function(t){var n=this,r=this.get(s);return r._handleResizeAlignEvent(t.dragEvent),n._syncProxyUI(),new e.Do.Prevent},_renderProxy:function(){var e=this,t=this.get(s),n=e.get(a);n.inDoc()||t.get(c).get(o).append(n.hide())},_syncProxyUI:function(){var e=this,t=this.get(s),o=t.info,u=t.get(n),f=e.get(a),l=u.getStyle(r);f.show().setStyle(r,l),t.delegate.dd.set(i,l),f.sizeTo(o.offsetWidth,o.offsetHeight),f.setXY([o.left,o.top])}}),e.namespace("Plugin"),e.Plugin.ResizeProxy=d},"3.7.3",{requires:["plugin","resize-base"]});
bundle/resize-proxy/resize-proxy.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -7,19 +7,19 @@ YUI.add('resize-proxy', function (Y, NAME) { var ACTIVE_HANDLE_NODE = 'activeHandleNode',- CURSOR = 'cursor',- DRAG_CURSOR = 'dragCursor',- HOST = 'host',- PARENT_NODE = 'parentNode',- PROXY = 'proxy',- PROXY_NODE = 'proxyNode',- RESIZE = 'resize',- RESIZE_PROXY = 'resize-proxy',- WRAPPER = 'wrapper',+ CURSOR = 'cursor',+ DRAG_CURSOR = 'dragCursor',+ HOST = 'host',+ PARENT_NODE = 'parentNode',+ PROXY = 'proxy',+ PROXY_NODE = 'proxyNode',+ RESIZE = 'resize',+ RESIZE_PROXY = 'resize-proxy',+ WRAPPER = 'wrapper', - getCN = Y.ClassNameManager.getClassName,+ getCN = Y.ClassNameManager.getClassName, - CSS_RESIZE_PROXY = getCN(RESIZE, PROXY);+ CSS_RESIZE_PROXY = getCN(RESIZE, PROXY); /**@@ -30,8 +30,8 @@ node: '#demo' }); resize.plug(Y.Plugin.ResizeProxy);- + @class ResizeProxy @module resize @submodule resize-proxy@@ -42,84 +42,84 @@ function ResizeProxy() {- ResizeProxy.superclass.constructor.apply(this, arguments);+ ResizeProxy.superclass.constructor.apply(this, arguments); } Y.mix(ResizeProxy, {- NAME: RESIZE_PROXY,+ NAME: RESIZE_PROXY, - NS: PROXY,+ NS: PROXY, - ATTRS: {- /**+ ATTRS: {+ /** * The Resize proxy element. * * @attribute proxyNode * @default Generated using an internal HTML markup * @type String|Node */- proxyNode: {- setter: Y.one,- valueFn: function() {- return Y.Node.create(this.PROXY_TEMPLATE);- }- }- }+ proxyNode: {+ setter: Y.one,+ valueFn: function() {+ return Y.Node.create(this.PROXY_TEMPLATE);+ }+ }+ } }); Y.extend(ResizeProxy, Y.Plugin.Base, {- /**+ /** * Template used to create the resize proxy. * * @property PROXY_TEMPLATE * @type {String} */- PROXY_TEMPLATE: '<div class="'+CSS_RESIZE_PROXY+'"></div>',+ PROXY_TEMPLATE: '<div class="'+CSS_RESIZE_PROXY+'"></div>', - initializer: function() {- var instance = this;+ initializer: function() {+ var instance = this; - instance.afterHostEvent('resize:start', instance._afterResizeStart);- instance.beforeHostMethod('_resize', instance._beforeHostResize);- instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);- },+ instance.afterHostEvent('resize:start', instance._afterResizeStart);+ instance.beforeHostMethod('_resize', instance._beforeHostResize);+ instance.afterHostMethod('_resizeEnd', instance._afterHostResizeEnd);+ }, - destructor: function() {- var instance = this;+ destructor: function() {+ var instance = this; - instance.get(PROXY_NODE).remove(true);- },+ instance.get(PROXY_NODE).remove(true);+ }, - _afterHostResizeEnd: function(event) {- var instance = this,- drag = event.dragEvent.target;+ _afterHostResizeEnd: function(event) {+ var instance = this,+ drag = event.dragEvent.target; - // reseting actXY from drag when drag end- drag.actXY = [];+ // reseting actXY from drag when drag end+ drag.actXY = []; - // if proxy is true, hide it on resize end- instance._syncProxyUI();+ // if proxy is true, hide it on resize end+ instance._syncProxyUI(); - instance.get(PROXY_NODE).hide();- },+ instance.get(PROXY_NODE).hide();+ }, - _afterResizeStart: function(event) {- var instance = this;+ _afterResizeStart: function() {+ var instance = this; - instance._renderProxy();- },+ instance._renderProxy();+ }, - _beforeHostResize: function(event) {- var instance = this,- host = this.get(HOST);+ _beforeHostResize: function(event) {+ var instance = this,+ host = this.get(HOST); - host._handleResizeAlignEvent(event.dragEvent);+ host._handleResizeAlignEvent(event.dragEvent); - // if proxy is true _syncProxyUI instead of _syncUI- instance._syncProxyUI();+ // if proxy is true _syncProxyUI instead of _syncUI+ instance._syncProxyUI(); - return new Y.Do.Prevent();- },+ return new Y.Do.Prevent();+ }, /** * Render the <a href="ResizeProxy.html#attr_proxyNode">proxyNode</a> element and@@ -128,45 +128,45 @@ * @method _renderProxy * @protected */- _renderProxy: function() {- var instance = this,- host = this.get(HOST),- proxyNode = instance.get(PROXY_NODE);+ _renderProxy: function() {+ var instance = this,+ host = this.get(HOST),+ proxyNode = instance.get(PROXY_NODE); - if (!proxyNode.inDoc()) {- host.get(WRAPPER).get(PARENT_NODE).append(- proxyNode.hide()- );- }- },+ if (!proxyNode.inDoc()) {+ host.get(WRAPPER).get(PARENT_NODE).append(+ proxyNode.hide()+ );+ }+ }, - /**+ /** * Sync the proxy UI with internal values from * <a href="ResizeProxy.html#property_info">info</a>. * * @method _syncProxyUI * @protected */- _syncProxyUI: function() {- var instance = this,- host = this.get(HOST),- info = host.info,- activeHandleNode = host.get(ACTIVE_HANDLE_NODE),- proxyNode = instance.get(PROXY_NODE),- cursor = activeHandleNode.getStyle(CURSOR);+ _syncProxyUI: function() {+ var instance = this,+ host = this.get(HOST),+ info = host.info,+ activeHandleNode = host.get(ACTIVE_HANDLE_NODE),+ proxyNode = instance.get(PROXY_NODE),+ cursor = activeHandleNode.getStyle(CURSOR); - proxyNode.show().setStyle(CURSOR, cursor);+ proxyNode.show().setStyle(CURSOR, cursor); - host.delegate.dd.set(DRAG_CURSOR, cursor);+ host.delegate.dd.set(DRAG_CURSOR, cursor); - proxyNode.sizeTo(info.offsetWidth, info.offsetHeight);+ proxyNode.sizeTo(info.offsetWidth, info.offsetHeight); - proxyNode.setXY([ info.left, info.top ]);- }+ proxyNode.setXY([ info.left, info.top ]);+ } }); Y.namespace('Plugin'); Y.Plugin.ResizeProxy = ResizeProxy; -}, '3.7.2', {"requires": ["plugin", "resize-base"]});+}, '3.7.3', {"requires": ["plugin", "resize-base"]});
bundle/router/router-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/router/router.js", code: [] };-_yuitest_coverage["build/router/router.js"].code=["YUI.add('router', function (Y, NAME) {","","/**","Provides URL-based routing using HTML5 `pushState()` or the location hash.","","@module app","@submodule router","@since 3.4.0","**/","","var HistoryHash = Y.HistoryHash,"," QS = Y.QueryString,"," YArray = Y.Array,"," YLang = Y.Lang,",""," win = Y.config.win,",""," // Holds all the active router instances. This supports the static"," // `dispatch()` method which causes all routers to dispatch."," instances = [],",""," // We have to queue up pushState calls to avoid race conditions, since the"," // popstate event doesn't actually provide any info on what URL it's"," // associated with."," saveQueue = [],",""," /**"," Fired when the router is ready to begin dispatching to route handlers.",""," You shouldn't need to wait for this event unless you plan to implement some"," kind of custom dispatching logic. It's used internally in order to avoid"," dispatching to an initial route if a browser history change occurs first.",""," @event ready"," @param {Boolean} dispatched `true` if routes have already been dispatched"," (most likely due to a history change)."," @fireOnce"," **/"," EVT_READY = 'ready';","","/**","Provides URL-based routing using HTML5 `pushState()` or the location hash.","","This makes it easy to wire up route handlers for different application states","while providing full back/forward navigation support and bookmarkable, shareable","URLs.","","@class Router","@param {Object} [config] Config properties."," @param {Boolean} [config.html5] Overrides the default capability detection"," and forces this router to use (`true`) or not use (`false`) HTML5"," history."," @param {String} [config.root=''] Root path from which all routes should be"," evaluated."," @param {Array} [config.routes=[]] Array of route definition objects.","@constructor","@extends Base","@since 3.4.0","**/","function Router() {"," Router.superclass.constructor.apply(this, arguments);","}","","Y.Router = Y.extend(Router, Y.Base, {"," // -- Protected Properties -------------------------------------------------",""," /**"," Whether or not `_dispatch()` has been called since this router was"," instantiated.",""," @property _dispatched"," @type Boolean"," @default undefined"," @protected"," **/",""," /**"," Whether or not we're currently in the process of dispatching to routes.",""," @property _dispatching"," @type Boolean"," @default undefined"," @protected"," **/",""," /**"," History event handle for the `history:change` or `hashchange` event"," subscription.",""," @property _historyEvents"," @type EventHandle"," @protected"," **/",""," /**"," Cached copy of the `html5` attribute for internal use.",""," @property _html5"," @type Boolean"," @protected"," **/",""," /**"," Whether or not the `ready` event has fired yet.",""," @property _ready"," @type Boolean"," @default undefined"," @protected"," **/",""," /**"," Regex used to match parameter placeholders in route paths.",""," Subpattern captures:",""," 1. Parameter prefix character. Either a `:` for subpath parameters that"," should only match a single level of a path, or `*` for splat parameters"," that should match any number of path levels.",""," 2. Parameter name, if specified, otherwise it is a wildcard match.",""," @property _regexPathParam"," @type RegExp"," @protected"," **/"," _regexPathParam: /([:*])([\\w\\-]+)?/g,",""," /**"," Regex that matches and captures the query portion of a URL, minus the"," preceding `?` character, and discarding the hash portion of the URL if any.",""," @property _regexUrlQuery"," @type RegExp"," @protected"," **/"," _regexUrlQuery: /\\?([^#]*).*$/,",""," /**"," Regex that matches everything before the path portion of a URL (the origin)."," This will be used to strip this part of the URL from a string when we"," only want the path.",""," @property _regexUrlOrigin"," @type RegExp"," @protected"," **/"," _regexUrlOrigin: /^(?:[^\\/#?:]+:\\/\\/|\\/\\/)[^\\/]*/,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," var self = this;",""," self._html5 = self.get('html5');"," self._routes = [];"," self._url = self._getURL();",""," // Necessary because setters don't run on init."," self._setRoutes(config && config.routes ? config.routes :"," self.get('routes'));",""," // Set up a history instance or hashchange listener."," if (self._html5) {"," self._history = new Y.HistoryHTML5({force: true});"," self._historyEvents ="," Y.after('history:change', self._afterHistoryChange, self);"," } else {"," self._historyEvents ="," Y.on('hashchange', self._afterHistoryChange, win, self);"," }",""," // Fire a `ready` event once we're ready to route. We wait first for all"," // subclass initializers to finish, then for window.onload, and then an"," // additional 20ms to allow the browser to fire a useless initial"," // `popstate` event if it wants to (and Chrome always wants to)."," self.publish(EVT_READY, {"," defaultFn : self._defReadyFn,"," fireOnce : true,"," preventable: false"," });",""," self.once('initializedChange', function () {"," Y.once('load', function () {"," setTimeout(function () {"," self.fire(EVT_READY, {dispatched: !!self._dispatched});"," }, 20);"," });"," });",""," // Store this router in the collection of all active router instances."," instances.push(this);"," },",""," destructor: function () {"," var instanceIndex = YArray.indexOf(instances, this);",""," // Remove this router from the collection of active router instances."," if (instanceIndex > -1) {"," instances.splice(instanceIndex, 1);"," }",""," this._historyEvents && this._historyEvents.detach();"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Dispatches to the first route handler that matches the current URL, if any.",""," If `dispatch()` is called before the `ready` event has fired, it will"," automatically wait for the `ready` event before dispatching. Otherwise it"," will dispatch immediately.",""," @method dispatch"," @chainable"," **/"," dispatch: function () {"," this.once(EVT_READY, function () {"," this._ready = true;",""," if (this._html5 && this.upgrade()) {"," return;"," } else {"," this._dispatch(this._getPath(), this._getURL());"," }"," });",""," return this;"," },",""," /**"," Gets the current route path, relative to the `root` (if any).",""," @method getPath"," @return {String} Current route path."," **/"," getPath: function () {"," return this._getPath();"," },",""," /**"," Returns `true` if this router has at least one route that matches the"," specified URL, `false` otherwise.",""," This method enforces the same-origin security constraint on the specified"," `url`; any URL which is not from the same origin as the current URL will"," always return `false`.",""," @method hasRoute"," @param {String} url URL to match."," @return {Boolean} `true` if there's at least one matching route, `false`"," otherwise."," **/"," hasRoute: function (url) {"," var path;",""," if (!this._hasSameOrigin(url)) {"," return false;"," }",""," if (!this._html5) {"," url = this._upgradeURL(url);"," }",""," path = this.removeQuery(this.removeRoot(url));",""," return !!this.match(path).length;"," },",""," /**"," Returns an array of route objects that match the specified URL path.",""," This method is called internally to determine which routes match the current"," path whenever the URL changes. You may override it if you want to customize"," the route matching logic, although this usually shouldn't be necessary.",""," Each returned route object has the following properties:",""," * `callback`: A function or a string representing the name of a function"," this router that should be executed when the route is triggered.",""," * `keys`: An array of strings representing the named parameters defined in"," the route's path specification, if any.",""," * `path`: The route's path specification, which may be either a string or"," a regex.",""," * `regex`: A regular expression version of the route's path specification."," This regex is used to determine whether the route matches a given path.",""," @example"," router.route('/foo', function () {});"," router.match('/foo');"," // => [{callback: ..., keys: [], path: '/foo', regex: ...}]",""," @method match"," @param {String} path URL path to match."," @return {Object[]} Array of route objects that match the specified path."," **/"," match: function (path) {"," return YArray.filter(this._routes, function (route) {"," return path.search(route.regex) > -1;"," });"," },",""," /**"," Removes the `root` URL from the front of _url_ (if it's there) and returns"," the result. The returned path will always have a leading `/`.",""," @method removeRoot"," @param {String} url URL."," @return {String} Rootless path."," **/"," removeRoot: function (url) {"," var root = this.get('root');",""," // Strip out the non-path part of the URL, if any (e.g."," // \"http://foo.com\"), so that we're left with just the path."," url = url.replace(this._regexUrlOrigin, '');",""," if (root && url.indexOf(root) === 0) {"," url = url.substring(root.length);"," }",""," return url.charAt(0) === '/' ? url : '/' + url;"," },",""," /**"," Removes a query string from the end of the _url_ (if one exists) and returns"," the result.",""," @method removeQuery"," @param {String} url URL."," @return {String} Queryless path."," **/"," removeQuery: function (url) {"," return url.replace(/\\?.*$/, '');"," },",""," /**"," Replaces the current browser history entry with a new one, and dispatches to"," the first matching route handler, if any.",""," Behind the scenes, this method uses HTML5 `pushState()` in browsers that"," support it (or the location hash in older browsers and IE) to change the"," URL.",""," The specified URL must share the same origin (i.e., protocol, host, and"," port) as the current page, or an error will occur.",""," @example"," // Starting URL: http://example.com/",""," router.replace('/path/');"," // New URL: http://example.com/path/",""," router.replace('/path?foo=bar');"," // New URL: http://example.com/path?foo=bar",""," router.replace('/');"," // New URL: http://example.com/",""," @method replace"," @param {String} [url] URL to set. This URL needs to be of the same origin as"," the current URL. This can be a URL relative to the router's `root`"," attribute. If no URL is specified, the page's current URL will be used."," @chainable"," @see save()"," **/"," replace: function (url) {"," return this._queue(url, true);"," },",""," /**"," Adds a route handler for the specified URL _path_.",""," The _path_ parameter may be either a string or a regular expression. If it's"," a string, it may contain named parameters: `:param` will match any single"," part of a URL path (not including `/` characters), and `*param` will match"," any number of parts of a URL path (including `/` characters). These named"," parameters will be made available as keys on the `req.params` object that's"," passed to route handlers.",""," If the _path_ parameter is a regex, all pattern matches will be made"," available as numbered keys on `req.params`, starting with `0` for the full"," match, then `1` for the first subpattern match, and so on.",""," Here's a set of sample routes along with URL paths that they match:",""," * Route: `/photos/:tag/:page`"," * URL: `/photos/kittens/1`, params: `{tag: 'kittens', page: '1'}`"," * URL: `/photos/puppies/2`, params: `{tag: 'puppies', page: '2'}`",""," * Route: `/file/*path`"," * URL: `/file/foo/bar/baz.txt`, params: `{path: 'foo/bar/baz.txt'}`"," * URL: `/file/foo`, params: `{path: 'foo'}`",""," **Middleware**: Routes also support an arbitrary number of callback"," functions. This allows you to easily reuse parts of your route-handling code"," with different route. This method is liberal in how it processes the"," specified `callbacks`, you can specify them as separate arguments, or as"," arrays, or both.",""," If multiple route match a given URL, they will be executed in the order they"," were added. The first route that was added will be the first to be executed.",""," **Passing Control**: Invoking the `next()` function within a route callback"," will pass control to the next callback function (if any) or route handler"," (if any). If a value is passed to `next()`, it's assumed to be an error,"," therefore stopping the dispatch chain, unless that value is: `\"route\"`,"," which is special case and dispatching will skip to the next route handler."," This allows middleware to skip any remaining middleware for a particular"," route.",""," @example"," router.route('/photos/:tag/:page', function (req, res, next) {"," });",""," // Using middleware.",""," router.findUser = function (req, res, next) {"," req.user = this.get('users').findById(req.params.user);"," next();"," };",""," router.route('/users/:user', 'findUser', function (req, res, next) {"," // The `findUser` middleware puts the `user` object on the `req`."," });",""," @method route"," @param {String|RegExp} path Path to match. May be a string or a regular"," expression."," @param {Array|Function|String} callbacks* Callback functions to call"," whenever this route is triggered. These can be specified as separate"," arguments, or in arrays, or both. If a callback is specified as a"," string, the named function will be called on this router instance.",""," @param {Object} callbacks.req Request object containing information about"," the request. It contains the following properties.",""," @param {Array|Object} callbacks.req.params Captured parameters matched by"," the route path specification. If a string path was used and contained"," named parameters, then this will be a key/value hash mapping parameter"," names to their matched values. If a regex path was used, this will be"," an array of subpattern matches starting at index 0 for the full match,"," then 1 for the first subpattern match, and so on."," @param {String} callbacks.req.path The current URL path."," @param {Number} callbacks.req.pendingCallbacks Number of remaining"," callbacks the route handler has after this one in the dispatch chain."," @param {Number} callbacks.req.pendingRoutes Number of matching routes"," after this one in the dispatch chain."," @param {Object} callbacks.req.query Query hash representing the URL"," query string, if any. Parameter names are keys, and are mapped to"," parameter values."," @param {String} callbacks.req.url The full URL."," @param {String} callbacks.req.src What initiated the dispatch. In an"," HTML5 browser, when the back/forward buttons are used, this property"," will have a value of \"popstate\".",""," @param {Object} callbacks.res Response object containing methods and"," information that relate to responding to a request. It contains the"," following properties."," @param {Object} callbacks.res.req Reference to the request object.",""," @param {Function} callbacks.next Function to pass control to the next"," callback or the next matching route if no more callbacks (middleware)"," exist for the current route handler. If you don't call this function,"," then no further callbacks or route handlers will be executed, even if"," there are more that match. If you do call this function, then the next"," callback (if any) or matching route handler (if any) will be called."," All of these functions will receive the same `req` and `res` objects"," that were passed to this route (so you can use these objects to pass"," data along to subsequent callbacks and routes)."," @param {String} [callbacks.next.err] Optional error which will stop the"," dispatch chaining for this `req`, unless the value is `\"route\"`, which"," is special cased to jump skip past any callbacks for the current route"," and pass control the next route handler."," @chainable"," **/"," route: function (path, callbacks) {"," callbacks = YArray.flatten(YArray(arguments, 1, true));",""," var keys = [];",""," this._routes.push({"," callbacks: callbacks,"," keys : keys,"," path : path,"," regex : this._getRegex(path, keys),",""," // For back-compat."," callback: callbacks[0]"," });",""," return this;"," },",""," /**"," Saves a new browser history entry and dispatches to the first matching route"," handler, if any.",""," Behind the scenes, this method uses HTML5 `pushState()` in browsers that"," support it (or the location hash in older browsers and IE) to change the"," URL and create a history entry.",""," The specified URL must share the same origin (i.e., protocol, host, and"," port) as the current page, or an error will occur.",""," @example"," // Starting URL: http://example.com/",""," router.save('/path/');"," // New URL: http://example.com/path/",""," router.save('/path?foo=bar');"," // New URL: http://example.com/path?foo=bar",""," router.save('/');"," // New URL: http://example.com/",""," @method save"," @param {String} [url] URL to set. This URL needs to be of the same origin as"," the current URL. This can be a URL relative to the router's `root`"," attribute. If no URL is specified, the page's current URL will be used."," @chainable"," @see replace()"," **/"," save: function (url) {"," return this._queue(url);"," },",""," /**"," Upgrades a hash-based URL to an HTML5 URL if necessary. In non-HTML5"," browsers, this method is a noop.",""," @method upgrade"," @return {Boolean} `true` if the URL was upgraded, `false` otherwise."," **/"," upgrade: function () {"," if (!this._html5) {"," return false;"," }",""," // Get the resolve hash path."," var hashPath = this._getHashPath();",""," if (hashPath) {"," // This is an HTML5 browser and we have a hash-based path in the"," // URL, so we need to upgrade the URL to a non-hash URL. This"," // will trigger a `history:change` event, which will in turn"," // trigger a dispatch."," this.once(EVT_READY, function () {"," this.replace(hashPath);"," });",""," return true;"," }",""," return false;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Wrapper around `decodeURIComponent` that also converts `+` chars into"," spaces.",""," @method _decode"," @param {String} string String to decode."," @return {String} Decoded string."," @protected"," **/"," _decode: function (string) {"," return decodeURIComponent(string.replace(/\\+/g, ' '));"," },",""," /**"," Shifts the topmost `_save()` call off the queue and executes it. Does"," nothing if the queue is empty.",""," @method _dequeue"," @chainable"," @see _queue"," @protected"," **/"," _dequeue: function () {"," var self = this,"," fn;",""," // If window.onload hasn't yet fired, wait until it has before"," // dequeueing. This will ensure that we don't call pushState() before an"," // initial popstate event has fired."," if (!YUI.Env.windowLoaded) {"," Y.once('load', function () {"," self._dequeue();"," });",""," return this;"," }",""," fn = saveQueue.shift();"," return fn ? fn() : this;"," },",""," /**"," Dispatches to the first route handler that matches the specified _path_.",""," If called before the `ready` event has fired, the dispatch will be aborted."," This ensures normalized behavior between Chrome (which fires a `popstate`"," event on every pageview) and other browsers (which do not).",""," @method _dispatch"," @param {String} path URL path."," @param {String} url Full URL."," @param {String} src What initiated the dispatch."," @chainable"," @protected"," **/"," _dispatch: function (path, url, src) {"," var self = this,"," routes = self.match(path),"," callbacks = [],"," matches, req, res;",""," self._dispatching = self._dispatched = true;",""," if (!routes || !routes.length) {"," self._dispatching = false;"," return self;"," }",""," req = self._getRequest(path, url, src);"," res = self._getResponse(req);",""," req.next = function (err) {"," var callback, route;",""," if (err) {"," // Special case \"route\" to skip to the next route handler"," // avoiding any additional callbacks for the current route."," if (err === 'route') {"," callbacks = [];"," req.next();"," } else {"," Y.error(err);"," }",""," } else if ((callback = callbacks.shift())) {"," if (typeof callback === 'string') {"," callback = self[callback];"," }",""," // Allow access to the num or remaining callbacks for the route."," req.pendingCallbacks = callbacks.length;",""," callback.call(self, req, res, req.next);",""," } else if ((route = routes.shift())) {"," // Make a copy of this route's `callbacks` and find its matches."," callbacks = route.callbacks.concat();"," matches = route.regex.exec(path);",""," // Use named keys for parameter names if the route path contains"," // named keys. Otherwise, use numerical match indices."," if (matches.length === route.keys.length + 1) {"," req.params = YArray.hash(route.keys, matches.slice(1));"," } else {"," req.params = matches.concat();"," }",""," // Allow access tot he num of remaining routes for this request."," req.pendingRoutes = routes.length;",""," // Execute this route's `callbacks`."," req.next();"," }"," };",""," req.next();",""," self._dispatching = false;"," return self._dequeue();"," },",""," /**"," Returns the resolved path from the hash fragment, or an empty string if the"," hash is not path-like.",""," @method _getHashPath"," @param {String} [hash] Hash fragment to resolve into a path. By default this"," will be the hash from the current URL."," @return {String} Current hash path, or an empty string if the hash is empty."," @protected"," **/"," _getHashPath: function (hash) {"," hash || (hash = HistoryHash.getHash());",""," // Make sure the `hash` is path-like."," if (hash && hash.charAt(0) === '/') {"," return this._joinURL(hash);"," }",""," return '';"," },",""," /**"," Gets the location origin (i.e., protocol, host, and port) as a URL.",""," @example"," http://example.com",""," @method _getOrigin"," @return {String} Location origin (i.e., protocol, host, and port)."," @protected"," **/"," _getOrigin: function () {"," var location = Y.getLocation();"," return location.origin || (location.protocol + '//' + location.host);"," },",""," /**"," Gets the current route path, relative to the `root` (if any).",""," @method _getPath"," @return {String} Current route path."," @protected"," **/"," _getPath: function () {"," var path = (!this._html5 && this._getHashPath()) ||"," Y.getLocation().pathname;",""," return this.removeQuery(this.removeRoot(path));"," },",""," /**"," Returns the current path root after popping off the last path segment,"," making it useful for resolving other URL paths against.",""," The path root will always begin and end with a '/'.",""," @method _getPathRoot"," @return {String} The URL's path root."," @protected"," @since 3.5.0"," **/"," _getPathRoot: function () {"," var slash = '/',"," path = Y.getLocation().pathname,"," segments;",""," if (path.charAt(path.length - 1) === slash) {"," return path;"," }",""," segments = path.split(slash);"," segments.pop();",""," return segments.join(slash) + slash;"," },",""," /**"," Gets the current route query string.",""," @method _getQuery"," @return {String} Current route query string."," @protected"," **/"," _getQuery: function () {"," var location = Y.getLocation(),"," hash, matches;",""," if (this._html5) {"," return location.search.substring(1);"," }",""," hash = HistoryHash.getHash();"," matches = hash.match(this._regexUrlQuery);",""," return hash && matches ? matches[1] : location.search.substring(1);"," },",""," /**"," Creates a regular expression from the given route specification. If _path_"," is already a regex, it will be returned unmodified.",""," @method _getRegex"," @param {String|RegExp} path Route path specification."," @param {Array} keys Array reference to which route parameter names will be"," added."," @return {RegExp} Route regex."," @protected"," **/"," _getRegex: function (path, keys) {"," if (path instanceof RegExp) {"," return path;"," }",""," // Special case for catchall paths."," if (path === '*') {"," return (/.*/);"," }",""," path = path.replace(this._regexPathParam, function (match, operator, key) {"," // Only `*` operators are supported for key-less matches to allowing"," // in-path wildcards like: '/foo/*'."," if (!key) {"," return operator === '*' ? '.*' : match;"," }",""," keys.push(key);"," return operator === '*' ? '(.*?)' : '([^/#?]*)';"," });",""," return new RegExp('^' + path + '$');"," },",""," /**"," Gets a request object that can be passed to a route handler.",""," @method _getRequest"," @param {String} path Current path being dispatched."," @param {String} url Current full URL being dispatched."," @param {String} src What initiated the dispatch."," @return {Object} Request object."," @protected"," **/"," _getRequest: function (path, url, src) {"," return {"," path : path,"," query: this._parseQuery(this._getQuery()),"," url : url,"," src : src"," };"," },",""," /**"," Gets a response object that can be passed to a route handler.",""," @method _getResponse"," @param {Object} req Request object."," @return {Object} Response Object."," @protected"," **/"," _getResponse: function (req) {"," // For backwards compatibility, the response object is a function that"," // calls `next()` on the request object and returns the result."," var res = function () {"," return req.next.apply(this, arguments);"," };",""," res.req = req;"," return res;"," },",""," /**"," Getter for the `routes` attribute.",""," @method _getRoutes"," @return {Object[]} Array of route objects."," @protected"," **/"," _getRoutes: function () {"," return this._routes.concat();"," },",""," /**"," Gets the current full URL.",""," @method _getURL"," @return {String} URL."," @protected"," **/"," _getURL: function () {"," var url = Y.getLocation().toString();",""," if (!this._html5) {"," url = this._upgradeURL(url);"," }",""," return url;"," },",""," /**"," Returns `true` when the specified `url` is from the same origin as the"," current URL; i.e., the protocol, host, and port of the URLs are the same.",""," All host or path relative URLs are of the same origin. A scheme-relative URL"," is first prefixed with the current scheme before being evaluated.",""," @method _hasSameOrigin"," @param {String} url URL to compare origin with the current URL."," @return {Boolean} Whether the URL has the same origin of the current URL."," @protected"," **/"," _hasSameOrigin: function (url) {"," var origin = ((url && url.match(this._regexUrlOrigin)) || [])[0];",""," // Prepend current scheme to scheme-relative URLs."," if (origin && origin.indexOf('//') === 0) {"," origin = Y.getLocation().protocol + origin;"," }",""," return !origin || origin === this._getOrigin();"," },",""," /**"," Joins the `root` URL to the specified _url_, normalizing leading/trailing"," `/` characters.",""," @example"," router.set('root', '/foo');"," router._joinURL('bar'); // => '/foo/bar'"," router._joinURL('/bar'); // => '/foo/bar'",""," router.set('root', '/foo/');"," router._joinURL('bar'); // => '/foo/bar'"," router._joinURL('/bar'); // => '/foo/bar'",""," @method _joinURL"," @param {String} url URL to append to the `root` URL."," @return {String} Joined URL."," @protected"," **/"," _joinURL: function (url) {"," var root = this.get('root');",""," // Causes `url` to _always_ begin with a \"/\"."," url = this.removeRoot(url);",""," if (url.charAt(0) === '/') {"," url = url.substring(1);"," }",""," return root && root.charAt(root.length - 1) === '/' ?"," root + url :"," root + '/' + url;"," },",""," /**"," Returns a normalized path, ridding it of any '..' segments and properly"," handling leading and trailing slashes.",""," @method _normalizePath"," @param {String} path URL path to normalize."," @return {String} Normalized path."," @protected"," @since 3.5.0"," **/"," _normalizePath: function (path) {"," var dots = '..',"," slash = '/',"," i, len, normalized, segments, segment, stack;",""," if (!path || path === slash) {"," return slash;"," }",""," segments = path.split(slash);"," stack = [];",""," for (i = 0, len = segments.length; i < len; ++i) {"," segment = segments[i];",""," if (segment === dots) {"," stack.pop();"," } else if (segment) {"," stack.push(segment);"," }"," }",""," normalized = slash + stack.join(slash);",""," // Append trailing slash if necessary."," if (normalized !== slash && path.charAt(path.length - 1) === slash) {"," normalized += slash;"," }",""," return normalized;"," },",""," /**"," Parses a URL query string into a key/value hash. If `Y.QueryString.parse` is"," available, this method will be an alias to that.",""," @method _parseQuery"," @param {String} query Query string to parse."," @return {Object} Hash of key/value pairs for query parameters."," @protected"," **/"," _parseQuery: QS && QS.parse ? QS.parse : function (query) {"," var decode = this._decode,"," params = query.split('&'),"," i = 0,"," len = params.length,"," result = {},"," param;",""," for (; i < len; ++i) {"," param = params[i].split('=');",""," if (param[0]) {"," result[decode(param[0])] = decode(param[1] || '');"," }"," }",""," return result;"," },",""," /**"," Queues up a `_save()` call to run after all previously-queued calls have"," finished.",""," This is necessary because if we make multiple `_save()` calls before the"," first call gets dispatched, then both calls will dispatch to the last call's"," URL.",""," All arguments passed to `_queue()` will be passed on to `_save()` when the"," queued function is executed.",""," @method _queue"," @chainable"," @see _dequeue"," @protected"," **/"," _queue: function () {"," var args = arguments,"," self = this;",""," saveQueue.push(function () {"," if (self._html5) {"," if (Y.UA.ios && Y.UA.ios < 5) {"," // iOS <5 has buggy HTML5 history support, and needs to be"," // synchronous."," self._save.apply(self, args);"," } else {"," // Wrapped in a timeout to ensure that _save() calls are"," // always processed asynchronously. This ensures consistency"," // between HTML5- and hash-based history."," setTimeout(function () {"," self._save.apply(self, args);"," }, 1);"," }"," } else {"," self._dispatching = true; // otherwise we'll dequeue too quickly"," self._save.apply(self, args);"," }",""," return self;"," });",""," return !this._dispatching ? this._dequeue() : this;"," },",""," /**"," Returns the normalized result of resolving the `path` against the current"," path. Falsy values for `path` will return just the current path.",""," @method _resolvePath"," @param {String} path URL path to resolve."," @return {String} Resolved path."," @protected"," @since 3.5.0"," **/"," _resolvePath: function (path) {"," if (!path) {"," return Y.getLocation().pathname;"," }",""," if (path.charAt(0) !== '/') {"," path = this._getPathRoot() + path;"," }",""," return this._normalizePath(path);"," },",""," /**"," Resolves the specified URL against the current URL.",""," This method resolves URLs like a browser does and will always return an"," absolute URL. When the specified URL is already absolute, it is assumed to"," be fully resolved and is simply returned as is. Scheme-relative URLs are"," prefixed with the current protocol. Relative URLs are giving the current"," URL's origin and are resolved and normalized against the current path root.",""," @method _resolveURL"," @param {String} url URL to resolve."," @return {String} Resolved URL."," @protected"," @since 3.5.0"," **/"," _resolveURL: function (url) {"," var parts = url && url.match(this._regexURL),"," origin, path, query, hash, resolved;",""," if (!parts) {"," return Y.getLocation().toString();"," }",""," origin = parts[1];"," path = parts[2];"," query = parts[3];"," hash = parts[4];",""," // Absolute and scheme-relative URLs are assumed to be fully-resolved."," if (origin) {"," // Prepend the current scheme for scheme-relative URLs."," if (origin.indexOf('//') === 0) {"," origin = Y.getLocation().protocol + origin;"," }",""," return origin + (path || '/') + (query || '') + (hash || '');"," }",""," // Will default to the current origin and current path."," resolved = this._getOrigin() + this._resolvePath(path);",""," // A path or query for the specified URL trumps the current URL's."," if (path || query) {"," return resolved + (query || '') + (hash || '');"," }",""," query = this._getQuery();",""," return resolved + (query ? ('?' + query) : '') + (hash || '');"," },",""," /**"," Saves a history entry using either `pushState()` or the location hash.",""," This method enforces the same-origin security constraint; attempting to save"," a `url` that is not from the same origin as the current URL will result in"," an error.",""," @method _save"," @param {String} [url] URL for the history entry."," @param {Boolean} [replace=false] If `true`, the current history entry will"," be replaced instead of a new one being added."," @chainable"," @protected"," **/"," _save: function (url, replace) {"," var urlIsString = typeof url === 'string',"," currentPath, root;",""," // Perform same-origin check on the specified URL."," if (urlIsString && !this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," return this;"," }",""," // Joins the `url` with the `root`."," urlIsString && (url = this._joinURL(url));",""," // Force _ready to true to ensure that the history change is handled"," // even if _save is called before the `ready` event fires."," this._ready = true;",""," if (this._html5) {"," this._history[replace ? 'replace' : 'add'](null, {url: url});"," } else {"," currentPath = Y.getLocation().pathname;"," root = this.get('root');",""," // Determine if the `root` already exists in the current location's"," // `pathname`, and if it does then we can exclude it from the"," // hash-based path. No need to duplicate the info in the URL."," if (root === currentPath || root === this._getPathRoot()) {"," url = this.removeRoot(url);"," }",""," // The `hashchange` event only fires when the new hash is actually"," // different. This makes sure we'll always dequeue and dispatch"," // _all_ router instances, mimicking the HTML5 behavior."," if (url === HistoryHash.getHash()) {"," Y.Router.dispatch();"," } else {"," HistoryHash[replace ? 'replaceHash' : 'setHash'](url);"," }"," }",""," return this;"," },",""," /**"," Setter for the `routes` attribute.",""," @method _setRoutes"," @param {Object[]} routes Array of route objects."," @return {Object[]} Array of route objects."," @protected"," **/"," _setRoutes: function (routes) {"," this._routes = [];",""," YArray.each(routes, function (route) {"," // Makes sure to check `callback` for back-compat."," var callbacks = route.callbacks || route.callback;",""," this.route(route.path, callbacks);"," }, this);",""," return this._routes.concat();"," },",""," /**"," Upgrades a hash-based URL to a full-path URL, if necessary.",""," The specified `url` will be upgraded if its of the same origin as the"," current URL and has a path-like hash. URLs that don't need upgrading will be"," returned as-is.",""," @example"," app._upgradeURL('http://example.com/#/foo/'); // => 'http://example.com/foo/';",""," @method _upgradeURL"," @param {String} url The URL to upgrade from hash-based to full-path."," @return {String} The upgraded URL, or the specified URL untouched."," @protected"," @since 3.5.0"," **/"," _upgradeURL: function (url) {"," // We should not try to upgrade paths for external URLs."," if (!this._hasSameOrigin(url)) {"," return url;"," }",""," var hash = (url.match(/#(.*)$/) || [])[1] || '',"," hashPrefix = Y.HistoryHash.hashPrefix,"," hashPath;",""," // Strip any hash prefix, like hash-bangs."," if (hashPrefix && hash.indexOf(hashPrefix) === 0) {"," hash = hash.replace(hashPrefix, '');"," }",""," hash && (hashPath = this._getHashPath(hash));",""," // If the hash looks like a URL path, assume it is, and upgrade it!"," if (hashPath) {"," return this._resolveURL(hashPath);"," }",""," return url;"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `history:change` and `hashchange` events.",""," @method _afterHistoryChange"," @param {EventFacade} e"," @protected"," **/"," _afterHistoryChange: function (e) {"," var self = this,"," src = e.src,"," prevURL = self._url,"," currentURL = self._getURL();",""," self._url = currentURL;",""," // Handles the awkwardness that is the `popstate` event. HTML5 browsers"," // fire `popstate` right before they fire `hashchange`, and Chrome fires"," // `popstate` on page load. If this router is not ready or the previous"," // and current URLs only differ by their hash, then we want to ignore"," // this `popstate` event."," if (src === 'popstate' &&"," (!self._ready || prevURL.replace(/#.*$/, '') === currentURL.replace(/#.*$/, ''))) {",""," return;"," }",""," self._dispatch(self._getPath(), currentURL, src);"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Default handler for the `ready` event.",""," @method _defReadyFn"," @param {EventFacade} e"," @protected"," **/"," _defReadyFn: function (e) {"," this._ready = true;"," }","}, {"," // -- Static Properties ----------------------------------------------------"," NAME: 'router',",""," ATTRS: {"," /**"," Whether or not this browser is capable of using HTML5 history.",""," Setting this to `false` will force the use of hash-based history even on"," HTML5 browsers, but please don't do this unless you understand the"," consequences.",""," @attribute html5"," @type Boolean"," @initOnly"," **/"," html5: {"," // Android versions lower than 3.0 are buggy and don't update"," // window.location after a pushState() call, so we fall back to"," // hash-based history for them."," //"," // See http://code.google.com/p/android/issues/detail?id=17471"," valueFn: function () { return Y.Router.html5; },"," writeOnce: 'initOnly'"," },",""," /**"," Absolute root path from which all routes should be evaluated.",""," For example, if your router is running on a page at"," `http://example.com/myapp/` and you add a route with the path `/`, your"," route will never execute, because the path will always be preceded by"," `/myapp`. Setting `root` to `/myapp` would cause all routes to be"," evaluated relative to that root URL, so the `/` route would then execute"," when the user browses to `http://example.com/myapp/`.",""," @attribute root"," @type String"," @default `''`"," **/"," root: {"," value: ''"," },",""," /**"," Array of route objects.",""," Each item in the array must be an object with the following properties:",""," * `path`: String or regex representing the path to match. See the docs"," for the `route()` method for more details.",""," * `callbacks`: Function or a string representing the name of a"," function on this router instance that should be called when the"," route is triggered. An array of functions and/or strings may also be"," provided. See the docs for the `route()` method for more details.",""," This attribute is intended to be used to set routes at init time, or to"," completely reset all routes after init. To add routes after init without"," resetting all existing routes, use the `route()` method.",""," @attribute routes"," @type Object[]"," @default `[]`"," @see route"," **/"," routes: {"," value : [],"," getter: '_getRoutes',"," setter: '_setRoutes'"," }"," },",""," // Used as the default value for the `html5` attribute, and for testing."," html5: Y.HistoryBase.html5 && (!Y.UA.android || Y.UA.android >= 3),",""," // To make this testable."," _instances: instances,",""," /**"," Dispatches to the first route handler that matches the specified `path` for"," all active router instances.",""," This provides a mechanism to cause all active router instances to dispatch"," to their route handlers without needing to change the URL or fire the"," `history:change` or `hashchange` event.",""," @method dispatch"," @static"," @since 3.6.0"," **/"," dispatch: function () {"," var i, len, router;",""," for (i = 0, len = instances.length; i < len; i += 1) {"," router = instances[i];",""," if (router) {"," router._dispatch(router._getPath(), router._getURL());"," }"," }"," }","});","","/**","The `Controller` class was deprecated in YUI 3.5.0 and is now an alias for the","`Router` class. Use that class instead. This alias will be removed in a future","version of YUI.","","@class Controller","@constructor","@extends Base","@deprecated Use `Router` instead.","@see Router","**/","Y.Controller = Y.Router;","","","}, '3.7.2', {\"optional\": [\"querystring-parse\"], \"requires\": [\"array-extras\", \"base-build\", \"history\"]});"];+_yuitest_coverage["build/router/router.js"].code=["YUI.add('router', function (Y, NAME) {","","/**","Provides URL-based routing using HTML5 `pushState()` or the location hash.","","@module app","@submodule router","@since 3.4.0","**/","","var HistoryHash = Y.HistoryHash,"," QS = Y.QueryString,"," YArray = Y.Array,"," YLang = Y.Lang,",""," win = Y.config.win,",""," // Holds all the active router instances. This supports the static"," // `dispatch()` method which causes all routers to dispatch."," instances = [],",""," // We have to queue up pushState calls to avoid race conditions, since the"," // popstate event doesn't actually provide any info on what URL it's"," // associated with."," saveQueue = [],",""," /**"," Fired when the router is ready to begin dispatching to route handlers.",""," You shouldn't need to wait for this event unless you plan to implement some"," kind of custom dispatching logic. It's used internally in order to avoid"," dispatching to an initial route if a browser history change occurs first.",""," @event ready"," @param {Boolean} dispatched `true` if routes have already been dispatched"," (most likely due to a history change)."," @fireOnce"," **/"," EVT_READY = 'ready';","","/**","Provides URL-based routing using HTML5 `pushState()` or the location hash.","","This makes it easy to wire up route handlers for different application states","while providing full back/forward navigation support and bookmarkable, shareable","URLs.","","@class Router","@param {Object} [config] Config properties."," @param {Boolean} [config.html5] Overrides the default capability detection"," and forces this router to use (`true`) or not use (`false`) HTML5"," history."," @param {String} [config.root=''] Root path from which all routes should be"," evaluated."," @param {Array} [config.routes=[]] Array of route definition objects.","@constructor","@extends Base","@since 3.4.0","**/","function Router() {"," Router.superclass.constructor.apply(this, arguments);","}","","Y.Router = Y.extend(Router, Y.Base, {"," // -- Protected Properties -------------------------------------------------",""," /**"," Whether or not `_dispatch()` has been called since this router was"," instantiated.",""," @property _dispatched"," @type Boolean"," @default undefined"," @protected"," **/",""," /**"," Whether or not we're currently in the process of dispatching to routes.",""," @property _dispatching"," @type Boolean"," @default undefined"," @protected"," **/",""," /**"," History event handle for the `history:change` or `hashchange` event"," subscription.",""," @property _historyEvents"," @type EventHandle"," @protected"," **/",""," /**"," Cached copy of the `html5` attribute for internal use.",""," @property _html5"," @type Boolean"," @protected"," **/",""," /**"," Whether or not the `ready` event has fired yet.",""," @property _ready"," @type Boolean"," @default undefined"," @protected"," **/",""," /**"," Regex used to match parameter placeholders in route paths.",""," Subpattern captures:",""," 1. Parameter prefix character. Either a `:` for subpath parameters that"," should only match a single level of a path, or `*` for splat parameters"," that should match any number of path levels.",""," 2. Parameter name, if specified, otherwise it is a wildcard match.",""," @property _regexPathParam"," @type RegExp"," @protected"," **/"," _regexPathParam: /([:*])([\\w\\-]+)?/g,",""," /**"," Regex that matches and captures the query portion of a URL, minus the"," preceding `?` character, and discarding the hash portion of the URL if any.",""," @property _regexUrlQuery"," @type RegExp"," @protected"," **/"," _regexUrlQuery: /\\?([^#]*).*$/,",""," /**"," Regex that matches everything before the path portion of a URL (the origin)."," This will be used to strip this part of the URL from a string when we"," only want the path.",""," @property _regexUrlOrigin"," @type RegExp"," @protected"," **/"," _regexUrlOrigin: /^(?:[^\\/#?:]+:\\/\\/|\\/\\/)[^\\/]*/,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," var self = this;",""," self._html5 = self.get('html5');"," self._routes = [];"," self._url = self._getURL();",""," // Necessary because setters don't run on init."," self._setRoutes(config && config.routes ? config.routes :"," self.get('routes'));",""," // Set up a history instance or hashchange listener."," if (self._html5) {"," self._history = new Y.HistoryHTML5({force: true});"," self._historyEvents ="," Y.after('history:change', self._afterHistoryChange, self);"," } else {"," self._historyEvents ="," Y.on('hashchange', self._afterHistoryChange, win, self);"," }",""," // Fire a `ready` event once we're ready to route. We wait first for all"," // subclass initializers to finish, then for window.onload, and then an"," // additional 20ms to allow the browser to fire a useless initial"," // `popstate` event if it wants to (and Chrome always wants to)."," self.publish(EVT_READY, {"," defaultFn : self._defReadyFn,"," fireOnce : true,"," preventable: false"," });",""," self.once('initializedChange', function () {"," Y.once('load', function () {"," setTimeout(function () {"," self.fire(EVT_READY, {dispatched: !!self._dispatched});"," }, 20);"," });"," });",""," // Store this router in the collection of all active router instances."," instances.push(this);"," },",""," destructor: function () {"," var instanceIndex = YArray.indexOf(instances, this);",""," // Remove this router from the collection of active router instances."," if (instanceIndex > -1) {"," instances.splice(instanceIndex, 1);"," }",""," this._historyEvents && this._historyEvents.detach();"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Dispatches to the first route handler that matches the current URL, if any.",""," If `dispatch()` is called before the `ready` event has fired, it will"," automatically wait for the `ready` event before dispatching. Otherwise it"," will dispatch immediately.",""," @method dispatch"," @chainable"," **/"," dispatch: function () {"," this.once(EVT_READY, function () {"," this._ready = true;",""," if (this._html5 && this.upgrade()) {"," return;"," } else {"," this._dispatch(this._getPath(), this._getURL());"," }"," });",""," return this;"," },",""," /**"," Gets the current route path, relative to the `root` (if any).",""," @method getPath"," @return {String} Current route path."," **/"," getPath: function () {"," return this._getPath();"," },",""," /**"," Returns `true` if this router has at least one route that matches the"," specified URL, `false` otherwise.",""," This method enforces the same-origin security constraint on the specified"," `url`; any URL which is not from the same origin as the current URL will"," always return `false`.",""," @method hasRoute"," @param {String} url URL to match."," @return {Boolean} `true` if there's at least one matching route, `false`"," otherwise."," **/"," hasRoute: function (url) {"," var path;",""," if (!this._hasSameOrigin(url)) {"," return false;"," }",""," if (!this._html5) {"," url = this._upgradeURL(url);"," }",""," path = this.removeQuery(this.removeRoot(url));",""," return !!this.match(path).length;"," },",""," /**"," Returns an array of route objects that match the specified URL path.",""," This method is called internally to determine which routes match the current"," path whenever the URL changes. You may override it if you want to customize"," the route matching logic, although this usually shouldn't be necessary.",""," Each returned route object has the following properties:",""," * `callback`: A function or a string representing the name of a function"," this router that should be executed when the route is triggered.",""," * `keys`: An array of strings representing the named parameters defined in"," the route's path specification, if any.",""," * `path`: The route's path specification, which may be either a string or"," a regex.",""," * `regex`: A regular expression version of the route's path specification."," This regex is used to determine whether the route matches a given path.",""," @example"," router.route('/foo', function () {});"," router.match('/foo');"," // => [{callback: ..., keys: [], path: '/foo', regex: ...}]",""," @method match"," @param {String} path URL path to match."," @return {Object[]} Array of route objects that match the specified path."," **/"," match: function (path) {"," return YArray.filter(this._routes, function (route) {"," return path.search(route.regex) > -1;"," });"," },",""," /**"," Removes the `root` URL from the front of _url_ (if it's there) and returns"," the result. The returned path will always have a leading `/`.",""," @method removeRoot"," @param {String} url URL."," @return {String} Rootless path."," **/"," removeRoot: function (url) {"," var root = this.get('root');",""," // Strip out the non-path part of the URL, if any (e.g."," // \"http://foo.com\"), so that we're left with just the path."," url = url.replace(this._regexUrlOrigin, '');",""," if (root && url.indexOf(root) === 0) {"," url = url.substring(root.length);"," }",""," return url.charAt(0) === '/' ? url : '/' + url;"," },",""," /**"," Removes a query string from the end of the _url_ (if one exists) and returns"," the result.",""," @method removeQuery"," @param {String} url URL."," @return {String} Queryless path."," **/"," removeQuery: function (url) {"," return url.replace(/\\?.*$/, '');"," },",""," /**"," Replaces the current browser history entry with a new one, and dispatches to"," the first matching route handler, if any.",""," Behind the scenes, this method uses HTML5 `pushState()` in browsers that"," support it (or the location hash in older browsers and IE) to change the"," URL.",""," The specified URL must share the same origin (i.e., protocol, host, and"," port) as the current page, or an error will occur.",""," @example"," // Starting URL: http://example.com/",""," router.replace('/path/');"," // New URL: http://example.com/path/",""," router.replace('/path?foo=bar');"," // New URL: http://example.com/path?foo=bar",""," router.replace('/');"," // New URL: http://example.com/",""," @method replace"," @param {String} [url] URL to set. This URL needs to be of the same origin as"," the current URL. This can be a URL relative to the router's `root`"," attribute. If no URL is specified, the page's current URL will be used."," @chainable"," @see save()"," **/"," replace: function (url) {"," return this._queue(url, true);"," },",""," /**"," Adds a route handler for the specified URL _path_.",""," The _path_ parameter may be either a string or a regular expression. If it's"," a string, it may contain named parameters: `:param` will match any single"," part of a URL path (not including `/` characters), and `*param` will match"," any number of parts of a URL path (including `/` characters). These named"," parameters will be made available as keys on the `req.params` object that's"," passed to route handlers.",""," If the _path_ parameter is a regex, all pattern matches will be made"," available as numbered keys on `req.params`, starting with `0` for the full"," match, then `1` for the first subpattern match, and so on.",""," Here's a set of sample routes along with URL paths that they match:",""," * Route: `/photos/:tag/:page`"," * URL: `/photos/kittens/1`, params: `{tag: 'kittens', page: '1'}`"," * URL: `/photos/puppies/2`, params: `{tag: 'puppies', page: '2'}`",""," * Route: `/file/*path`"," * URL: `/file/foo/bar/baz.txt`, params: `{path: 'foo/bar/baz.txt'}`"," * URL: `/file/foo`, params: `{path: 'foo'}`",""," **Middleware**: Routes also support an arbitrary number of callback"," functions. This allows you to easily reuse parts of your route-handling code"," with different route. This method is liberal in how it processes the"," specified `callbacks`, you can specify them as separate arguments, or as"," arrays, or both.",""," If multiple route match a given URL, they will be executed in the order they"," were added. The first route that was added will be the first to be executed.",""," **Passing Control**: Invoking the `next()` function within a route callback"," will pass control to the next callback function (if any) or route handler"," (if any). If a value is passed to `next()`, it's assumed to be an error,"," therefore stopping the dispatch chain, unless that value is: `\"route\"`,"," which is special case and dispatching will skip to the next route handler."," This allows middleware to skip any remaining middleware for a particular"," route.",""," @example"," router.route('/photos/:tag/:page', function (req, res, next) {"," });",""," // Using middleware.",""," router.findUser = function (req, res, next) {"," req.user = this.get('users').findById(req.params.user);"," next();"," };",""," router.route('/users/:user', 'findUser', function (req, res, next) {"," // The `findUser` middleware puts the `user` object on the `req`."," });",""," @method route"," @param {String|RegExp} path Path to match. May be a string or a regular"," expression."," @param {Array|Function|String} callbacks* Callback functions to call"," whenever this route is triggered. These can be specified as separate"," arguments, or in arrays, or both. If a callback is specified as a"," string, the named function will be called on this router instance.",""," @param {Object} callbacks.req Request object containing information about"," the request. It contains the following properties.",""," @param {Array|Object} callbacks.req.params Captured parameters matched by"," the route path specification. If a string path was used and contained"," named parameters, then this will be a key/value hash mapping parameter"," names to their matched values. If a regex path was used, this will be"," an array of subpattern matches starting at index 0 for the full match,"," then 1 for the first subpattern match, and so on."," @param {String} callbacks.req.path The current URL path."," @param {Number} callbacks.req.pendingCallbacks Number of remaining"," callbacks the route handler has after this one in the dispatch chain."," @param {Number} callbacks.req.pendingRoutes Number of matching routes"," after this one in the dispatch chain."," @param {Object} callbacks.req.query Query hash representing the URL"," query string, if any. Parameter names are keys, and are mapped to"," parameter values."," @param {String} callbacks.req.url The full URL."," @param {String} callbacks.req.src What initiated the dispatch. In an"," HTML5 browser, when the back/forward buttons are used, this property"," will have a value of \"popstate\".",""," @param {Object} callbacks.res Response object containing methods and"," information that relate to responding to a request. It contains the"," following properties."," @param {Object} callbacks.res.req Reference to the request object.",""," @param {Function} callbacks.next Function to pass control to the next"," callback or the next matching route if no more callbacks (middleware)"," exist for the current route handler. If you don't call this function,"," then no further callbacks or route handlers will be executed, even if"," there are more that match. If you do call this function, then the next"," callback (if any) or matching route handler (if any) will be called."," All of these functions will receive the same `req` and `res` objects"," that were passed to this route (so you can use these objects to pass"," data along to subsequent callbacks and routes)."," @param {String} [callbacks.next.err] Optional error which will stop the"," dispatch chaining for this `req`, unless the value is `\"route\"`, which"," is special cased to jump skip past any callbacks for the current route"," and pass control the next route handler."," @chainable"," **/"," route: function (path, callbacks) {"," callbacks = YArray.flatten(YArray(arguments, 1, true));",""," var keys = [];",""," this._routes.push({"," callbacks: callbacks,"," keys : keys,"," path : path,"," regex : this._getRegex(path, keys),",""," // For back-compat."," callback: callbacks[0]"," });",""," return this;"," },",""," /**"," Saves a new browser history entry and dispatches to the first matching route"," handler, if any.",""," Behind the scenes, this method uses HTML5 `pushState()` in browsers that"," support it (or the location hash in older browsers and IE) to change the"," URL and create a history entry.",""," The specified URL must share the same origin (i.e., protocol, host, and"," port) as the current page, or an error will occur.",""," @example"," // Starting URL: http://example.com/",""," router.save('/path/');"," // New URL: http://example.com/path/",""," router.save('/path?foo=bar');"," // New URL: http://example.com/path?foo=bar",""," router.save('/');"," // New URL: http://example.com/",""," @method save"," @param {String} [url] URL to set. This URL needs to be of the same origin as"," the current URL. This can be a URL relative to the router's `root`"," attribute. If no URL is specified, the page's current URL will be used."," @chainable"," @see replace()"," **/"," save: function (url) {"," return this._queue(url);"," },",""," /**"," Upgrades a hash-based URL to an HTML5 URL if necessary. In non-HTML5"," browsers, this method is a noop.",""," @method upgrade"," @return {Boolean} `true` if the URL was upgraded, `false` otherwise."," **/"," upgrade: function () {"," if (!this._html5) {"," return false;"," }",""," // Get the resolve hash path."," var hashPath = this._getHashPath();",""," if (hashPath) {"," // This is an HTML5 browser and we have a hash-based path in the"," // URL, so we need to upgrade the URL to a non-hash URL. This"," // will trigger a `history:change` event, which will in turn"," // trigger a dispatch."," this.once(EVT_READY, function () {"," this.replace(hashPath);"," });",""," return true;"," }",""," return false;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Wrapper around `decodeURIComponent` that also converts `+` chars into"," spaces.",""," @method _decode"," @param {String} string String to decode."," @return {String} Decoded string."," @protected"," **/"," _decode: function (string) {"," return decodeURIComponent(string.replace(/\\+/g, ' '));"," },",""," /**"," Shifts the topmost `_save()` call off the queue and executes it. Does"," nothing if the queue is empty.",""," @method _dequeue"," @chainable"," @see _queue"," @protected"," **/"," _dequeue: function () {"," var self = this,"," fn;",""," // If window.onload hasn't yet fired, wait until it has before"," // dequeueing. This will ensure that we don't call pushState() before an"," // initial popstate event has fired."," if (!YUI.Env.windowLoaded) {"," Y.once('load', function () {"," self._dequeue();"," });",""," return this;"," }",""," fn = saveQueue.shift();"," return fn ? fn() : this;"," },",""," /**"," Dispatches to the first route handler that matches the specified _path_.",""," If called before the `ready` event has fired, the dispatch will be aborted."," This ensures normalized behavior between Chrome (which fires a `popstate`"," event on every pageview) and other browsers (which do not).",""," @method _dispatch"," @param {String} path URL path."," @param {String} url Full URL."," @param {String} src What initiated the dispatch."," @chainable"," @protected"," **/"," _dispatch: function (path, url, src) {"," var self = this,"," routes = self.match(path),"," callbacks = [],"," matches, req, res;",""," self._dispatching = self._dispatched = true;",""," if (!routes || !routes.length) {"," self._dispatching = false;"," return self;"," }",""," req = self._getRequest(path, url, src);"," res = self._getResponse(req);",""," req.next = function (err) {"," var callback, route;",""," if (err) {"," // Special case \"route\" to skip to the next route handler"," // avoiding any additional callbacks for the current route."," if (err === 'route') {"," callbacks = [];"," req.next();"," } else {"," Y.error(err);"," }",""," } else if ((callback = callbacks.shift())) {"," if (typeof callback === 'string') {"," callback = self[callback];"," }",""," // Allow access to the num or remaining callbacks for the route."," req.pendingCallbacks = callbacks.length;",""," callback.call(self, req, res, req.next);",""," } else if ((route = routes.shift())) {"," // Make a copy of this route's `callbacks` and find its matches."," callbacks = route.callbacks.concat();"," matches = route.regex.exec(path);",""," // Use named keys for parameter names if the route path contains"," // named keys. Otherwise, use numerical match indices."," if (matches.length === route.keys.length + 1) {"," req.params = YArray.hash(route.keys, matches.slice(1));"," } else {"," req.params = matches.concat();"," }",""," // Allow access tot he num of remaining routes for this request."," req.pendingRoutes = routes.length;",""," // Execute this route's `callbacks`."," req.next();"," }"," };",""," req.next();",""," self._dispatching = false;"," return self._dequeue();"," },",""," /**"," Returns the resolved path from the hash fragment, or an empty string if the"," hash is not path-like.",""," @method _getHashPath"," @param {String} [hash] Hash fragment to resolve into a path. By default this"," will be the hash from the current URL."," @return {String} Current hash path, or an empty string if the hash is empty."," @protected"," **/"," _getHashPath: function (hash) {"," hash || (hash = HistoryHash.getHash());",""," // Make sure the `hash` is path-like."," if (hash && hash.charAt(0) === '/') {"," return this._joinURL(hash);"," }",""," return '';"," },",""," /**"," Gets the location origin (i.e., protocol, host, and port) as a URL.",""," @example"," http://example.com",""," @method _getOrigin"," @return {String} Location origin (i.e., protocol, host, and port)."," @protected"," **/"," _getOrigin: function () {"," var location = Y.getLocation();"," return location.origin || (location.protocol + '//' + location.host);"," },",""," /**"," Gets the current route path, relative to the `root` (if any).",""," @method _getPath"," @return {String} Current route path."," @protected"," **/"," _getPath: function () {"," var path = (!this._html5 && this._getHashPath()) ||"," Y.getLocation().pathname;",""," return this.removeQuery(this.removeRoot(path));"," },",""," /**"," Returns the current path root after popping off the last path segment,"," making it useful for resolving other URL paths against.",""," The path root will always begin and end with a '/'.",""," @method _getPathRoot"," @return {String} The URL's path root."," @protected"," @since 3.5.0"," **/"," _getPathRoot: function () {"," var slash = '/',"," path = Y.getLocation().pathname,"," segments;",""," if (path.charAt(path.length - 1) === slash) {"," return path;"," }",""," segments = path.split(slash);"," segments.pop();",""," return segments.join(slash) + slash;"," },",""," /**"," Gets the current route query string.",""," @method _getQuery"," @return {String} Current route query string."," @protected"," **/"," _getQuery: function () {"," var location = Y.getLocation(),"," hash, matches;",""," if (this._html5) {"," return location.search.substring(1);"," }",""," hash = HistoryHash.getHash();"," matches = hash.match(this._regexUrlQuery);",""," return hash && matches ? matches[1] : location.search.substring(1);"," },",""," /**"," Creates a regular expression from the given route specification. If _path_"," is already a regex, it will be returned unmodified.",""," @method _getRegex"," @param {String|RegExp} path Route path specification."," @param {Array} keys Array reference to which route parameter names will be"," added."," @return {RegExp} Route regex."," @protected"," **/"," _getRegex: function (path, keys) {"," if (path instanceof RegExp) {"," return path;"," }",""," // Special case for catchall paths."," if (path === '*') {"," return (/.*/);"," }",""," path = path.replace(this._regexPathParam, function (match, operator, key) {"," // Only `*` operators are supported for key-less matches to allowing"," // in-path wildcards like: '/foo/*'."," if (!key) {"," return operator === '*' ? '.*' : match;"," }",""," keys.push(key);"," return operator === '*' ? '(.*?)' : '([^/#?]*)';"," });",""," return new RegExp('^' + path + '$');"," },",""," /**"," Gets a request object that can be passed to a route handler.",""," @method _getRequest"," @param {String} path Current path being dispatched."," @param {String} url Current full URL being dispatched."," @param {String} src What initiated the dispatch."," @return {Object} Request object."," @protected"," **/"," _getRequest: function (path, url, src) {"," return {"," path : path,"," query: this._parseQuery(this._getQuery()),"," url : url,"," src : src"," };"," },",""," /**"," Gets a response object that can be passed to a route handler.",""," @method _getResponse"," @param {Object} req Request object."," @return {Object} Response Object."," @protected"," **/"," _getResponse: function (req) {"," // For backwards compatibility, the response object is a function that"," // calls `next()` on the request object and returns the result."," var res = function () {"," return req.next.apply(this, arguments);"," };",""," res.req = req;"," return res;"," },",""," /**"," Getter for the `routes` attribute.",""," @method _getRoutes"," @return {Object[]} Array of route objects."," @protected"," **/"," _getRoutes: function () {"," return this._routes.concat();"," },",""," /**"," Gets the current full URL.",""," @method _getURL"," @return {String} URL."," @protected"," **/"," _getURL: function () {"," var url = Y.getLocation().toString();",""," if (!this._html5) {"," url = this._upgradeURL(url);"," }",""," return url;"," },",""," /**"," Returns `true` when the specified `url` is from the same origin as the"," current URL; i.e., the protocol, host, and port of the URLs are the same.",""," All host or path relative URLs are of the same origin. A scheme-relative URL"," is first prefixed with the current scheme before being evaluated.",""," @method _hasSameOrigin"," @param {String} url URL to compare origin with the current URL."," @return {Boolean} Whether the URL has the same origin of the current URL."," @protected"," **/"," _hasSameOrigin: function (url) {"," var origin = ((url && url.match(this._regexUrlOrigin)) || [])[0];",""," // Prepend current scheme to scheme-relative URLs."," if (origin && origin.indexOf('//') === 0) {"," origin = Y.getLocation().protocol + origin;"," }",""," return !origin || origin === this._getOrigin();"," },",""," /**"," Joins the `root` URL to the specified _url_, normalizing leading/trailing"," `/` characters.",""," @example"," router.set('root', '/foo');"," router._joinURL('bar'); // => '/foo/bar'"," router._joinURL('/bar'); // => '/foo/bar'",""," router.set('root', '/foo/');"," router._joinURL('bar'); // => '/foo/bar'"," router._joinURL('/bar'); // => '/foo/bar'",""," @method _joinURL"," @param {String} url URL to append to the `root` URL."," @return {String} Joined URL."," @protected"," **/"," _joinURL: function (url) {"," var root = this.get('root');",""," // Causes `url` to _always_ begin with a \"/\"."," url = this.removeRoot(url);",""," if (url.charAt(0) === '/') {"," url = url.substring(1);"," }",""," return root && root.charAt(root.length - 1) === '/' ?"," root + url :"," root + '/' + url;"," },",""," /**"," Returns a normalized path, ridding it of any '..' segments and properly"," handling leading and trailing slashes.",""," @method _normalizePath"," @param {String} path URL path to normalize."," @return {String} Normalized path."," @protected"," @since 3.5.0"," **/"," _normalizePath: function (path) {"," var dots = '..',"," slash = '/',"," i, len, normalized, segments, segment, stack;",""," if (!path || path === slash) {"," return slash;"," }",""," segments = path.split(slash);"," stack = [];",""," for (i = 0, len = segments.length; i < len; ++i) {"," segment = segments[i];",""," if (segment === dots) {"," stack.pop();"," } else if (segment) {"," stack.push(segment);"," }"," }",""," normalized = slash + stack.join(slash);",""," // Append trailing slash if necessary."," if (normalized !== slash && path.charAt(path.length - 1) === slash) {"," normalized += slash;"," }",""," return normalized;"," },",""," /**"," Parses a URL query string into a key/value hash. If `Y.QueryString.parse` is"," available, this method will be an alias to that.",""," @method _parseQuery"," @param {String} query Query string to parse."," @return {Object} Hash of key/value pairs for query parameters."," @protected"," **/"," _parseQuery: QS && QS.parse ? QS.parse : function (query) {"," var decode = this._decode,"," params = query.split('&'),"," i = 0,"," len = params.length,"," result = {},"," param;",""," for (; i < len; ++i) {"," param = params[i].split('=');",""," if (param[0]) {"," result[decode(param[0])] = decode(param[1] || '');"," }"," }",""," return result;"," },",""," /**"," Queues up a `_save()` call to run after all previously-queued calls have"," finished.",""," This is necessary because if we make multiple `_save()` calls before the"," first call gets dispatched, then both calls will dispatch to the last call's"," URL.",""," All arguments passed to `_queue()` will be passed on to `_save()` when the"," queued function is executed.",""," @method _queue"," @chainable"," @see _dequeue"," @protected"," **/"," _queue: function () {"," var args = arguments,"," self = this;",""," saveQueue.push(function () {"," if (self._html5) {"," if (Y.UA.ios && Y.UA.ios < 5) {"," // iOS <5 has buggy HTML5 history support, and needs to be"," // synchronous."," self._save.apply(self, args);"," } else {"," // Wrapped in a timeout to ensure that _save() calls are"," // always processed asynchronously. This ensures consistency"," // between HTML5- and hash-based history."," setTimeout(function () {"," self._save.apply(self, args);"," }, 1);"," }"," } else {"," self._dispatching = true; // otherwise we'll dequeue too quickly"," self._save.apply(self, args);"," }",""," return self;"," });",""," return !this._dispatching ? this._dequeue() : this;"," },",""," /**"," Returns the normalized result of resolving the `path` against the current"," path. Falsy values for `path` will return just the current path.",""," @method _resolvePath"," @param {String} path URL path to resolve."," @return {String} Resolved path."," @protected"," @since 3.5.0"," **/"," _resolvePath: function (path) {"," if (!path) {"," return Y.getLocation().pathname;"," }",""," if (path.charAt(0) !== '/') {"," path = this._getPathRoot() + path;"," }",""," return this._normalizePath(path);"," },",""," /**"," Resolves the specified URL against the current URL.",""," This method resolves URLs like a browser does and will always return an"," absolute URL. When the specified URL is already absolute, it is assumed to"," be fully resolved and is simply returned as is. Scheme-relative URLs are"," prefixed with the current protocol. Relative URLs are giving the current"," URL's origin and are resolved and normalized against the current path root.",""," @method _resolveURL"," @param {String} url URL to resolve."," @return {String} Resolved URL."," @protected"," @since 3.5.0"," **/"," _resolveURL: function (url) {"," var parts = url && url.match(this._regexURL),"," origin, path, query, hash, resolved;",""," if (!parts) {"," return Y.getLocation().toString();"," }",""," origin = parts[1];"," path = parts[2];"," query = parts[3];"," hash = parts[4];",""," // Absolute and scheme-relative URLs are assumed to be fully-resolved."," if (origin) {"," // Prepend the current scheme for scheme-relative URLs."," if (origin.indexOf('//') === 0) {"," origin = Y.getLocation().protocol + origin;"," }",""," return origin + (path || '/') + (query || '') + (hash || '');"," }",""," // Will default to the current origin and current path."," resolved = this._getOrigin() + this._resolvePath(path);",""," // A path or query for the specified URL trumps the current URL's."," if (path || query) {"," return resolved + (query || '') + (hash || '');"," }",""," query = this._getQuery();",""," return resolved + (query ? ('?' + query) : '') + (hash || '');"," },",""," /**"," Saves a history entry using either `pushState()` or the location hash.",""," This method enforces the same-origin security constraint; attempting to save"," a `url` that is not from the same origin as the current URL will result in"," an error.",""," @method _save"," @param {String} [url] URL for the history entry."," @param {Boolean} [replace=false] If `true`, the current history entry will"," be replaced instead of a new one being added."," @chainable"," @protected"," **/"," _save: function (url, replace) {"," var urlIsString = typeof url === 'string',"," currentPath, root;",""," // Perform same-origin check on the specified URL."," if (urlIsString && !this._hasSameOrigin(url)) {"," Y.error('Security error: The new URL must be of the same origin as the current URL.');"," return this;"," }",""," // Joins the `url` with the `root`."," urlIsString && (url = this._joinURL(url));",""," // Force _ready to true to ensure that the history change is handled"," // even if _save is called before the `ready` event fires."," this._ready = true;",""," if (this._html5) {"," this._history[replace ? 'replace' : 'add'](null, {url: url});"," } else {"," currentPath = Y.getLocation().pathname;"," root = this.get('root');",""," // Determine if the `root` already exists in the current location's"," // `pathname`, and if it does then we can exclude it from the"," // hash-based path. No need to duplicate the info in the URL."," if (root === currentPath || root === this._getPathRoot()) {"," url = this.removeRoot(url);"," }",""," // The `hashchange` event only fires when the new hash is actually"," // different. This makes sure we'll always dequeue and dispatch"," // _all_ router instances, mimicking the HTML5 behavior."," if (url === HistoryHash.getHash()) {"," Y.Router.dispatch();"," } else {"," HistoryHash[replace ? 'replaceHash' : 'setHash'](url);"," }"," }",""," return this;"," },",""," /**"," Setter for the `routes` attribute.",""," @method _setRoutes"," @param {Object[]} routes Array of route objects."," @return {Object[]} Array of route objects."," @protected"," **/"," _setRoutes: function (routes) {"," this._routes = [];",""," YArray.each(routes, function (route) {"," // Makes sure to check `callback` for back-compat."," var callbacks = route.callbacks || route.callback;",""," this.route(route.path, callbacks);"," }, this);",""," return this._routes.concat();"," },",""," /**"," Upgrades a hash-based URL to a full-path URL, if necessary.",""," The specified `url` will be upgraded if its of the same origin as the"," current URL and has a path-like hash. URLs that don't need upgrading will be"," returned as-is.",""," @example"," app._upgradeURL('http://example.com/#/foo/'); // => 'http://example.com/foo/';",""," @method _upgradeURL"," @param {String} url The URL to upgrade from hash-based to full-path."," @return {String} The upgraded URL, or the specified URL untouched."," @protected"," @since 3.5.0"," **/"," _upgradeURL: function (url) {"," // We should not try to upgrade paths for external URLs."," if (!this._hasSameOrigin(url)) {"," return url;"," }",""," var hash = (url.match(/#(.*)$/) || [])[1] || '',"," hashPrefix = Y.HistoryHash.hashPrefix,"," hashPath;",""," // Strip any hash prefix, like hash-bangs."," if (hashPrefix && hash.indexOf(hashPrefix) === 0) {"," hash = hash.replace(hashPrefix, '');"," }",""," hash && (hashPath = this._getHashPath(hash));",""," // If the hash looks like a URL path, assume it is, and upgrade it!"," if (hashPath) {"," return this._resolveURL(hashPath);"," }",""," return url;"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `history:change` and `hashchange` events.",""," @method _afterHistoryChange"," @param {EventFacade} e"," @protected"," **/"," _afterHistoryChange: function (e) {"," var self = this,"," src = e.src,"," prevURL = self._url,"," currentURL = self._getURL();",""," self._url = currentURL;",""," // Handles the awkwardness that is the `popstate` event. HTML5 browsers"," // fire `popstate` right before they fire `hashchange`, and Chrome fires"," // `popstate` on page load. If this router is not ready or the previous"," // and current URLs only differ by their hash, then we want to ignore"," // this `popstate` event."," if (src === 'popstate' &&"," (!self._ready || prevURL.replace(/#.*$/, '') === currentURL.replace(/#.*$/, ''))) {",""," return;"," }",""," self._dispatch(self._getPath(), currentURL, src);"," },",""," // -- Default Event Handlers -----------------------------------------------",""," /**"," Default handler for the `ready` event.",""," @method _defReadyFn"," @param {EventFacade} e"," @protected"," **/"," _defReadyFn: function (e) {"," this._ready = true;"," }","}, {"," // -- Static Properties ----------------------------------------------------"," NAME: 'router',",""," ATTRS: {"," /**"," Whether or not this browser is capable of using HTML5 history.",""," Setting this to `false` will force the use of hash-based history even on"," HTML5 browsers, but please don't do this unless you understand the"," consequences.",""," @attribute html5"," @type Boolean"," @initOnly"," **/"," html5: {"," // Android versions lower than 3.0 are buggy and don't update"," // window.location after a pushState() call, so we fall back to"," // hash-based history for them."," //"," // See http://code.google.com/p/android/issues/detail?id=17471"," valueFn: function () { return Y.Router.html5; },"," writeOnce: 'initOnly'"," },",""," /**"," Absolute root path from which all routes should be evaluated.",""," For example, if your router is running on a page at"," `http://example.com/myapp/` and you add a route with the path `/`, your"," route will never execute, because the path will always be preceded by"," `/myapp`. Setting `root` to `/myapp` would cause all routes to be"," evaluated relative to that root URL, so the `/` route would then execute"," when the user browses to `http://example.com/myapp/`.",""," @attribute root"," @type String"," @default `''`"," **/"," root: {"," value: ''"," },",""," /**"," Array of route objects.",""," Each item in the array must be an object with the following properties:",""," * `path`: String or regex representing the path to match. See the docs"," for the `route()` method for more details.",""," * `callbacks`: Function or a string representing the name of a"," function on this router instance that should be called when the"," route is triggered. An array of functions and/or strings may also be"," provided. See the docs for the `route()` method for more details.",""," This attribute is intended to be used to set routes at init time, or to"," completely reset all routes after init. To add routes after init without"," resetting all existing routes, use the `route()` method.",""," @attribute routes"," @type Object[]"," @default `[]`"," @see route"," **/"," routes: {"," value : [],"," getter: '_getRoutes',"," setter: '_setRoutes'"," }"," },",""," // Used as the default value for the `html5` attribute, and for testing."," html5: Y.HistoryBase.html5 && (!Y.UA.android || Y.UA.android >= 3),",""," // To make this testable."," _instances: instances,",""," /**"," Dispatches to the first route handler that matches the specified `path` for"," all active router instances.",""," This provides a mechanism to cause all active router instances to dispatch"," to their route handlers without needing to change the URL or fire the"," `history:change` or `hashchange` event.",""," @method dispatch"," @static"," @since 3.6.0"," **/"," dispatch: function () {"," var i, len, router;",""," for (i = 0, len = instances.length; i < len; i += 1) {"," router = instances[i];",""," if (router) {"," router._dispatch(router._getPath(), router._getURL());"," }"," }"," }","});","","/**","The `Controller` class was deprecated in YUI 3.5.0 and is now an alias for the","`Router` class. Use that class instead. This alias will be removed in a future","version of YUI.","","@class Controller","@constructor","@extends Base","@deprecated Use `Router` instead.","@see Router","**/","Y.Controller = Y.Router;","","","}, '3.7.3', {\"optional\": [\"querystring-parse\"], \"requires\": [\"array-extras\", \"base-build\", \"history\"]});"]; _yuitest_coverage["build/router/router.js"].lines = {"1":0,"11":0,"60":0,"61":0,"64":0,"152":0,"154":0,"155":0,"156":0,"159":0,"163":0,"164":0,"165":0,"168":0,"176":0,"182":0,"183":0,"184":0,"185":0,"191":0,"195":0,"198":0,"199":0,"202":0,"218":0,"219":0,"221":0,"222":0,"224":0,"228":0,"238":0,"255":0,"257":0,"258":0,"261":0,"262":0,"265":0,"267":0,"301":0,"302":0,"315":0,"319":0,"321":0,"322":0,"325":0,"337":0,"371":0,"481":0,"483":0,"485":0,"495":0,"529":0,"540":0,"541":0,"545":0,"547":0,"552":0,"553":0,"556":0,"559":0,"574":0,"587":0,"593":0,"594":0,"595":0,"598":0,"601":0,"602":0,"620":0,"625":0,"627":0,"628":0,"629":0,"632":0,"633":0,"635":0,"636":0,"638":0,"641":0,"642":0,"643":0,"645":0,"648":0,"649":0,"650":0,"654":0,"656":0,"658":0,"660":0,"661":0,"665":0,"666":0,"668":0,"672":0,"675":0,"679":0,"681":0,"682":0,"696":0,"699":0,"700":0,"703":0,"717":0,"718":0,"729":0,"732":0,"747":0,"751":0,"752":0,"755":0,"756":0,"758":0,"769":0,"772":0,"773":0,"776":0,"777":0,"779":0,"794":0,"795":0,"799":0,"800":0,"803":0,"806":0,"807":0,"810":0,"811":0,"814":0,"828":0,"847":0,"848":0,"851":0,"852":0,"863":0,"874":0,"876":0,"877":0,"880":0,"896":0,"899":0,"900":0,"903":0,"925":0,"928":0,"930":0,"931":0,"934":0,"950":0,"954":0,"955":0,"958":0,"959":0,"961":0,"962":0,"964":0,"965":0,"966":0,"967":0,"971":0,"974":0,"975":0,"978":0,"991":0,"998":0,"999":0,"1001":0,"1002":0,"1006":0,"1026":0,"1029":0,"1030":0,"1031":0,"1034":0,"1039":0,"1040":0,"1044":0,"1045":0,"1048":0,"1051":0,"1065":0,"1066":0,"1069":0,"1070":0,"1073":0,"1092":0,"1095":0,"1096":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1108":0,"1111":0,"1115":0,"1118":0,"1119":0,"1122":0,"1124":0,"1142":0,"1146":0,"1147":0,"1148":0,"1152":0,"1156":0,"1158":0,"1159":0,"1161":0,"1162":0,"1167":0,"1168":0,"1174":0,"1175":0,"1177":0,"1181":0,"1193":0,"1195":0,"1197":0,"1199":0,"1202":0,"1223":0,"1224":0,"1227":0,"1232":0,"1233":0,"1236":0,"1239":0,"1240":0,"1243":0,"1256":0,"1261":0,"1268":0,"1271":0,"1274":0,"1287":0,"1311":0,"1381":0,"1383":0,"1384":0,"1386":0,"1387":0,"1404":0}; _yuitest_coverage["build/router/router.js"].functions = {"Router:60":0,"(anonymous 4):184":0,"(anonymous 3):183":0,"(anonymous 2):182":0,"initializer:151":0,"destructor:194":0,"(anonymous 5):218":0,"dispatch:217":0,"getPath:237":0,"hasRoute:254":0,"(anonymous 6):301":0,"match:300":0,"removeRoot:314":0,"removeQuery:336":0,"replace:370":0,"route:480":0,"save:528":0,"(anonymous 7):552":0,"upgrade:539":0,"_decode:573":0,"(anonymous 8):594":0,"_dequeue:586":0,"next:635":0,"_dispatch:619":0,"_getHashPath:695":0,"_getOrigin:716":0,"_getPath:728":0,"_getPathRoot:746":0,"_getQuery:768":0,"(anonymous 9):803":0,"_getRegex:793":0,"_getRequest:827":0,"res:847":0,"_getResponse:844":0,"_getRoutes:862":0,"_getURL:873":0,"_hasSameOrigin:895":0,"_joinURL:924":0,"_normalizePath:949":0,"parse:990":0,"(anonymous 11):1039":0,"(anonymous 10):1029":0,"_queue:1025":0,"_resolvePath:1064":0,"_resolveURL:1091":0,"_save:1141":0,"(anonymous 12):1195":0,"_setRoutes:1192":0,"_upgradeURL:1221":0,"_afterHistoryChange:1255":0,"_defReadyFn:1286":0,"valueFn:1311":0,"dispatch:1380":0,"(anonymous 1):1":0}; _yuitest_coverage["build/router/router.js"].coveredLines = 243;@@ -1740,4 +1740,4 @@ Y.Controller = Y.Router; -}, '3.7.2', {"optional": ["querystring-parse"], "requires": ["array-extras", "base-build", "history"]});+}, '3.7.3', {"optional": ["querystring-parse"], "requires": ["array-extras", "base-build", "history"]});
bundle/router/router-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1413,4 +1413,4 @@ Y.Controller = Y.Router; -}, '3.7.2', {"optional": ["querystring-parse"], "requires": ["array-extras", "base-build", "history"]});+}, '3.7.3', {"optional": ["querystring-parse"], "requires": ["array-extras", "base-build", "history"]});
bundle/router/router-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("router",function(e,t){function l(){l.superclass.constructor.apply(this,arguments)}var n=e.HistoryHash,r=e.QueryString,i=e.Array,s=e.Lang,o=e.config.win,u=[],a=[],f="ready";e.Router=e.extend(l,e.Base,{_regexPathParam:/([:*])([\w\-]+)?/g,_regexUrlQuery:/\?([^#]*).*$/,_regexUrlOrigin:/^(?:[^\/#?:]+:\/\/|\/\/)[^\/]*/,initializer:function(t){var n=this;n._html5=n.get("html5"),n._routes=[],n._url=n._getURL(),n._setRoutes(t&&t.routes?t.routes:n.get("routes")),n._html5?(n._history=new e.HistoryHTML5({force:!0}),n._historyEvents=e.after("history:change",n._afterHistoryChange,n)):n._historyEvents=e.on("hashchange",n._afterHistoryChange,o,n),n.publish(f,{defaultFn:n._defReadyFn,fireOnce:!0,preventable:!1}),n.once("initializedChange",function(){e.once("load",function(){setTimeout(function(){n.fire(f,{dispatched:!!n._dispatched})},20)})}),u.push(this)},destructor:function(){var e=i.indexOf(u,this);e>-1&&u.splice(e,1),this._historyEvents&&this._historyEvents.detach()},dispatch:function(){return this.once(f,function(){this._ready=!0;if(this._html5&&this.upgrade())return;this._dispatch(this._getPath(),this._getURL())}),this},getPath:function(){return this._getPath()},hasRoute:function(e){var t;return this._hasSameOrigin(e)?(this._html5||(e=this._upgradeURL(e)),t=this.removeQuery(this.removeRoot(e)),!!this.match(t).length):!1},match:function(e){return i.filter(this._routes,function(t){return e.search(t.regex)>-1})},removeRoot:function(e){var t=this.get("root");return e=e.replace(this._regexUrlOrigin,""),t&&e.indexOf(t)===0&&(e=e.substring(t.length)),e.charAt(0)==="/"?e:"/"+e},removeQuery:function(e){return e.replace(/\?.*$/,"")},replace:function(e){return this._queue(e,!0)},route:function(e,t){t=i.flatten(i(arguments,1,!0));var n=[];return this._routes.push({callbacks:t,keys:n,path:e,regex:this._getRegex(e,n),callback:t[0]}),this},save:function(e){return this._queue(e)},upgrade:function(){if(!this._html5)return!1;var e=this._getHashPath();return e?(this.once(f,function(){this.replace(e)}),!0):!1},_decode:function(e){return decodeURIComponent(e.replace(/\+/g," "))},_dequeue:function(){var t=this,n;return YUI.Env.windowLoaded?(n=a.shift(),n?n():this):(e.once("load",function(){t._dequeue()}),this)},_dispatch:function(t,n,r){var s=this,o=s.match(t),u=[],a,f,l;return s._dispatching=s._dispatched=!0,!o||!o.length?(s._dispatching=!1,s):(f=s._getRequest(t,n,r),l=s._getResponse(f),f.next=function(n){var r,c;if(n)n==="route"?(u=[],f.next()):e.error(n);else if(r=u.shift())typeof r=="string"&&(r=s[r]),f.pendingCallbacks=u.length,r.call(s,f,l,f.next);else if(c=o.shift())u=c.callbacks.concat(),a=c.regex.exec(t),a.length===c.keys.length+1?f.params=i.hash(c.keys,a.slice(1)):f.params=a.concat(),f.pendingRoutes=o.length,f.next()},f.next(),s._dispatching=!1,s._dequeue())},_getHashPath:function(e){return e||(e=n.getHash()),e&&e.charAt(0)==="/"?this._joinURL(e):""},_getOrigin:function(){var t=e.getLocation();return t.origin||t.protocol+"//"+t.host},_getPath:function(){var t=!this._html5&&this._getHashPath()||e.getLocation().pathname;return this.removeQuery(this.removeRoot(t))},_getPathRoot:function(){var t="/",n=e.getLocation().pathname,r;return n.charAt(n.length-1)===t?n:(r=n.split(t),r.pop(),r.join(t)+t)},_getQuery:function(){var t=e.getLocation(),r,i;return this._html5?t.search.substring(1):(r=n.getHash(),i=r.match(this._regexUrlQuery),r&&i?i[1]:t.search.substring(1))},_getRegex:function(e,t){return e instanceof RegExp?e:e==="*"?/.*/:(e=e.replace(this._regexPathParam,function(e,n,r){return r?(t.push(r),n==="*"?"(.*?)":"([^/#?]*)"):n==="*"?".*":e}),new RegExp("^"+e+"$"))},_getRequest:function(e,t,n){return{path:e,query:this._parseQuery(this._getQuery()),url:t,src:n}},_getResponse:function(e){var t=function(){return e.next.apply(this,arguments)};return t.req=e,t},_getRoutes:function(){return this._routes.concat()},_getURL:function(){var t=e.getLocation().toString();return this._html5||(t=this._upgradeURL(t)),t},_hasSameOrigin:function(t){var n=(t&&t.match(this._regexUrlOrigin)||[])[0];return n&&n.indexOf("//")===0&&(n=e.getLocation().protocol+n),!n||n===this._getOrigin()},_joinURL:function(e){var t=this.get("root");return e=this.removeRoot(e),e.charAt(0)==="/"&&(e=e.substring(1)),t&&t.charAt(t.length-1)==="/"?t+e:t+"/"+e},_normalizePath:function(e){var t="..",n="/",r,i,s,o,u,a;if(!e||e===n)return n;o=e.split(n),a=[];for(r=0,i=o.length;r<i;++r)u=o[r],u===t?a.pop():u&&a.push(u);return s=n+a.join(n),s!==n&&e.charAt(e.length-1)===n&&(s+=n),s},_parseQuery:r&&r.parse?r.parse:function(e){var t=this._decode,n=e.split("&"),r=0,i=n.length,s={},o;for(;r<i;++r)o=n[r].split("="),o[0]&&(s[t(o[0])]=t(o[1]||""));return s},_queue:function(){var t=arguments,n=this;return a.push(function(){return n._html5?e.UA.ios&&e.UA.ios<5?n._save.apply(n,t):setTimeout(function(){n._save.apply(n,t)},1):(n._dispatching=!0,n._save.apply(n,t)),n}),this._dispatching?this:this._dequeue()},_resolvePath:function(t){return t?(t.charAt(0)!=="/"&&(t=this._getPathRoot()+t),this._normalizePath(t)):e.getLocation().pathname},_resolveURL:function(t){var n=t&&t.match(this._regexURL),r,i,s,o,u;return n?(r=n[1],i=n[2],s=n[3],o=n[4],r?(r.indexOf("//")===0&&(r=e.getLocation().protocol+r),r+(i||"/")+(s||"")+(o||"")):(u=this._getOrigin()+this._resolvePath(i),i||s?u+(s||"")+(o||""):(s=this._getQuery(),u+(s?"?"+s:"")+(o||"")))):e.getLocation().toString()},_save:function(t,r){var i=typeof t=="string",s,o;if(i&&!this._hasSameOrigin(t))return e.error("Security error: The new URL must be of the same origin as the current URL."),this;i&&(t=this._joinURL(t)),this._ready=!0;if(this._html5)this._history[r?"replace":"add"](null,{url:t});else{s=e.getLocation().pathname,o=this.get("root");if(o===s||o===this._getPathRoot())t=this.removeRoot(t);t===n.getHash()?e.Router.dispatch():n[r?"replaceHash":"setHash"](t)}return this},_setRoutes:function(e){return this._routes=[],i.each(e,function(e){var t=e.callbacks||e.callback;this.route(e.path,t)},this),this._routes.concat()},_upgradeURL:function(t){if(!this._hasSameOrigin(t))return t;var n=(t.match(/#(.*)$/)||[])[1]||"",r=e.HistoryHash.hashPrefix,i;return r&&n.indexOf(r)===0&&(n=n.replace(r,"")),n&&(i=this._getHashPath(n)),i?this._resolveURL(i):t},_afterHistoryChange:function(e){var t=this,n=e.src,r=t._url,i=t._getURL();t._url=i;if(n==="popstate"&&(!t._ready||r.replace(/#.*$/,"")===i.replace(/#.*$/,"")))return;t._dispatch(t._getPath(),i,n)},_defReadyFn:function(e){this._ready=!0}},{NAME:"router",ATTRS:{html5:{valueFn:function(){return e.Router.html5},writeOnce:"initOnly"},root:{value:""},routes:{value:[],getter:"_getRoutes",setter:"_setRoutes"}},html5:e.HistoryBase.html5&&(!e.UA.android||e.UA.android>=3),_instances:u,dispatch:function(){var e,t,n;for(e=0,t=u.length;e<t;e+=1)n=u[e],n&&n._dispatch(n._getPath(),n._getURL())}}),e.Controller=e.Router},"3.7.2",{optional:["querystring-parse"],requires:["array-extras","base-build","history"]});+YUI.add("router",function(e,t){function l(){l.superclass.constructor.apply(this,arguments)}var n=e.HistoryHash,r=e.QueryString,i=e.Array,s=e.Lang,o=e.config.win,u=[],a=[],f="ready";e.Router=e.extend(l,e.Base,{_regexPathParam:/([:*])([\w\-]+)?/g,_regexUrlQuery:/\?([^#]*).*$/,_regexUrlOrigin:/^(?:[^\/#?:]+:\/\/|\/\/)[^\/]*/,initializer:function(t){var n=this;n._html5=n.get("html5"),n._routes=[],n._url=n._getURL(),n._setRoutes(t&&t.routes?t.routes:n.get("routes")),n._html5?(n._history=new e.HistoryHTML5({force:!0}),n._historyEvents=e.after("history:change",n._afterHistoryChange,n)):n._historyEvents=e.on("hashchange",n._afterHistoryChange,o,n),n.publish(f,{defaultFn:n._defReadyFn,fireOnce:!0,preventable:!1}),n.once("initializedChange",function(){e.once("load",function(){setTimeout(function(){n.fire(f,{dispatched:!!n._dispatched})},20)})}),u.push(this)},destructor:function(){var e=i.indexOf(u,this);e>-1&&u.splice(e,1),this._historyEvents&&this._historyEvents.detach()},dispatch:function(){return this.once(f,function(){this._ready=!0;if(this._html5&&this.upgrade())return;this._dispatch(this._getPath(),this._getURL())}),this},getPath:function(){return this._getPath()},hasRoute:function(e){var t;return this._hasSameOrigin(e)?(this._html5||(e=this._upgradeURL(e)),t=this.removeQuery(this.removeRoot(e)),!!this.match(t).length):!1},match:function(e){return i.filter(this._routes,function(t){return e.search(t.regex)>-1})},removeRoot:function(e){var t=this.get("root");return e=e.replace(this._regexUrlOrigin,""),t&&e.indexOf(t)===0&&(e=e.substring(t.length)),e.charAt(0)==="/"?e:"/"+e},removeQuery:function(e){return e.replace(/\?.*$/,"")},replace:function(e){return this._queue(e,!0)},route:function(e,t){t=i.flatten(i(arguments,1,!0));var n=[];return this._routes.push({callbacks:t,keys:n,path:e,regex:this._getRegex(e,n),callback:t[0]}),this},save:function(e){return this._queue(e)},upgrade:function(){if(!this._html5)return!1;var e=this._getHashPath();return e?(this.once(f,function(){this.replace(e)}),!0):!1},_decode:function(e){return decodeURIComponent(e.replace(/\+/g," "))},_dequeue:function(){var t=this,n;return YUI.Env.windowLoaded?(n=a.shift(),n?n():this):(e.once("load",function(){t._dequeue()}),this)},_dispatch:function(t,n,r){var s=this,o=s.match(t),u=[],a,f,l;return s._dispatching=s._dispatched=!0,!o||!o.length?(s._dispatching=!1,s):(f=s._getRequest(t,n,r),l=s._getResponse(f),f.next=function(n){var r,c;if(n)n==="route"?(u=[],f.next()):e.error(n);else if(r=u.shift())typeof r=="string"&&(r=s[r]),f.pendingCallbacks=u.length,r.call(s,f,l,f.next);else if(c=o.shift())u=c.callbacks.concat(),a=c.regex.exec(t),a.length===c.keys.length+1?f.params=i.hash(c.keys,a.slice(1)):f.params=a.concat(),f.pendingRoutes=o.length,f.next()},f.next(),s._dispatching=!1,s._dequeue())},_getHashPath:function(e){return e||(e=n.getHash()),e&&e.charAt(0)==="/"?this._joinURL(e):""},_getOrigin:function(){var t=e.getLocation();return t.origin||t.protocol+"//"+t.host},_getPath:function(){var t=!this._html5&&this._getHashPath()||e.getLocation().pathname;return this.removeQuery(this.removeRoot(t))},_getPathRoot:function(){var t="/",n=e.getLocation().pathname,r;return n.charAt(n.length-1)===t?n:(r=n.split(t),r.pop(),r.join(t)+t)},_getQuery:function(){var t=e.getLocation(),r,i;return this._html5?t.search.substring(1):(r=n.getHash(),i=r.match(this._regexUrlQuery),r&&i?i[1]:t.search.substring(1))},_getRegex:function(e,t){return e instanceof RegExp?e:e==="*"?/.*/:(e=e.replace(this._regexPathParam,function(e,n,r){return r?(t.push(r),n==="*"?"(.*?)":"([^/#?]*)"):n==="*"?".*":e}),new RegExp("^"+e+"$"))},_getRequest:function(e,t,n){return{path:e,query:this._parseQuery(this._getQuery()),url:t,src:n}},_getResponse:function(e){var t=function(){return e.next.apply(this,arguments)};return t.req=e,t},_getRoutes:function(){return this._routes.concat()},_getURL:function(){var t=e.getLocation().toString();return this._html5||(t=this._upgradeURL(t)),t},_hasSameOrigin:function(t){var n=(t&&t.match(this._regexUrlOrigin)||[])[0];return n&&n.indexOf("//")===0&&(n=e.getLocation().protocol+n),!n||n===this._getOrigin()},_joinURL:function(e){var t=this.get("root");return e=this.removeRoot(e),e.charAt(0)==="/"&&(e=e.substring(1)),t&&t.charAt(t.length-1)==="/"?t+e:t+"/"+e},_normalizePath:function(e){var t="..",n="/",r,i,s,o,u,a;if(!e||e===n)return n;o=e.split(n),a=[];for(r=0,i=o.length;r<i;++r)u=o[r],u===t?a.pop():u&&a.push(u);return s=n+a.join(n),s!==n&&e.charAt(e.length-1)===n&&(s+=n),s},_parseQuery:r&&r.parse?r.parse:function(e){var t=this._decode,n=e.split("&"),r=0,i=n.length,s={},o;for(;r<i;++r)o=n[r].split("="),o[0]&&(s[t(o[0])]=t(o[1]||""));return s},_queue:function(){var t=arguments,n=this;return a.push(function(){return n._html5?e.UA.ios&&e.UA.ios<5?n._save.apply(n,t):setTimeout(function(){n._save.apply(n,t)},1):(n._dispatching=!0,n._save.apply(n,t)),n}),this._dispatching?this:this._dequeue()},_resolvePath:function(t){return t?(t.charAt(0)!=="/"&&(t=this._getPathRoot()+t),this._normalizePath(t)):e.getLocation().pathname},_resolveURL:function(t){var n=t&&t.match(this._regexURL),r,i,s,o,u;return n?(r=n[1],i=n[2],s=n[3],o=n[4],r?(r.indexOf("//")===0&&(r=e.getLocation().protocol+r),r+(i||"/")+(s||"")+(o||"")):(u=this._getOrigin()+this._resolvePath(i),i||s?u+(s||"")+(o||""):(s=this._getQuery(),u+(s?"?"+s:"")+(o||"")))):e.getLocation().toString()},_save:function(t,r){var i=typeof t=="string",s,o;if(i&&!this._hasSameOrigin(t))return e.error("Security error: The new URL must be of the same origin as the current URL."),this;i&&(t=this._joinURL(t)),this._ready=!0;if(this._html5)this._history[r?"replace":"add"](null,{url:t});else{s=e.getLocation().pathname,o=this.get("root");if(o===s||o===this._getPathRoot())t=this.removeRoot(t);t===n.getHash()?e.Router.dispatch():n[r?"replaceHash":"setHash"](t)}return this},_setRoutes:function(e){return this._routes=[],i.each(e,function(e){var t=e.callbacks||e.callback;this.route(e.path,t)},this),this._routes.concat()},_upgradeURL:function(t){if(!this._hasSameOrigin(t))return t;var n=(t.match(/#(.*)$/)||[])[1]||"",r=e.HistoryHash.hashPrefix,i;return r&&n.indexOf(r)===0&&(n=n.replace(r,"")),n&&(i=this._getHashPath(n)),i?this._resolveURL(i):t},_afterHistoryChange:function(e){var t=this,n=e.src,r=t._url,i=t._getURL();t._url=i;if(n==="popstate"&&(!t._ready||r.replace(/#.*$/,"")===i.replace(/#.*$/,"")))return;t._dispatch(t._getPath(),i,n)},_defReadyFn:function(e){this._ready=!0}},{NAME:"router",ATTRS:{html5:{valueFn:function(){return e.Router.html5},writeOnce:"initOnly"},root:{value:""},routes:{value:[],getter:"_getRoutes",setter:"_setRoutes"}},html5:e.HistoryBase.html5&&(!e.UA.android||e.UA.android>=3),_instances:u,dispatch:function(){var e,t,n;for(e=0,t=u.length;e<t;e+=1)n=u[e],n&&n._dispatch(n._getPath(),n._getURL())}}),e.Controller=e.Router},"3.7.3",{optional:["querystring-parse"],requires:["array-extras","base-build","history"]});
bundle/router/router.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1410,4 +1410,4 @@ Y.Controller = Y.Router; -}, '3.7.2', {"optional": ["querystring-parse"], "requires": ["array-extras", "base-build", "history"]});+}, '3.7.3', {"optional": ["querystring-parse"], "requires": ["array-extras", "base-build", "history"]});
bundle/scrollview-base-ie/scrollview-base-ie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/scrollview-base-ie/scrollview-base-ie.js", code: [] };-_yuitest_coverage["build/scrollview-base-ie/scrollview-base-ie.js"].code=["YUI.add('scrollview-base-ie', function (Y, NAME) {","","/**"," * IE specific support for the scrollview-base module."," *"," * @module scrollview-base-ie"," */","","Y.mix(Y.ScrollView.prototype, {",""," /**"," * Internal method to fix text selection in IE"," * "," * @method _fixIESelect"," * @for ScrollView"," * @private"," * @param {Node} bb The bounding box"," * @param {Node} cb The content box"," */"," _fixIESelect : function(bb, cb) {"," this._cbDoc = cb.get(\"ownerDocument\");"," this._nativeBody = Y.Node.getDOMNode(Y.one(\"body\", this._cbDoc));",""," cb.on(\"mousedown\", function() {"," this._selectstart = this._nativeBody.onselectstart;"," this._nativeBody.onselectstart = this._iePreventSelect;"," this._cbDoc.once(\"mouseup\", this._ieRestoreSelect, this);"," }, this);"," },",""," /**"," * Native onselectstart handle to prevent selection in IE"," *"," * @method _iePreventSelect"," * @for ScrollView"," * @private"," */"," _iePreventSelect : function() {"," return false;"," },",""," /**"," * Restores native onselectstart handle, backed up to prevent selection in IE"," *"," * @method _ieRestoreSelect"," * @for ScrollView"," * @private"," */"," _ieRestoreSelect : function() {"," this._nativeBody.onselectstart = this._selectstart;"," }","}, true);","","}, '3.7.2', {\"requires\": [\"scrollview-base\"]});"];+_yuitest_coverage["build/scrollview-base-ie/scrollview-base-ie.js"].code=["YUI.add('scrollview-base-ie', function (Y, NAME) {","","/**"," * IE specific support for the scrollview-base module."," *"," * @module scrollview-base-ie"," */","","Y.mix(Y.ScrollView.prototype, {",""," /**"," * Internal method to fix text selection in IE"," * "," * @method _fixIESelect"," * @for ScrollView"," * @private"," * @param {Node} bb The bounding box"," * @param {Node} cb The content box"," */"," _fixIESelect : function(bb, cb) {"," this._cbDoc = cb.get(\"ownerDocument\");"," this._nativeBody = Y.Node.getDOMNode(Y.one(\"body\", this._cbDoc));",""," cb.on(\"mousedown\", function() {"," this._selectstart = this._nativeBody.onselectstart;"," this._nativeBody.onselectstart = this._iePreventSelect;"," this._cbDoc.once(\"mouseup\", this._ieRestoreSelect, this);"," }, this);"," },",""," /**"," * Native onselectstart handle to prevent selection in IE"," *"," * @method _iePreventSelect"," * @for ScrollView"," * @private"," */"," _iePreventSelect : function() {"," return false;"," },",""," /**"," * Restores native onselectstart handle, backed up to prevent selection in IE"," *"," * @method _ieRestoreSelect"," * @for ScrollView"," * @private"," */"," _ieRestoreSelect : function() {"," this._nativeBody.onselectstart = this._selectstart;"," }","}, true);","","}, '3.7.3', {\"requires\": [\"scrollview-base\"]});"]; _yuitest_coverage["build/scrollview-base-ie/scrollview-base-ie.js"].lines = {"1":0,"9":0,"21":0,"22":0,"24":0,"25":0,"26":0,"27":0,"39":0,"50":0}; _yuitest_coverage["build/scrollview-base-ie/scrollview-base-ie.js"].functions = {"(anonymous 2):24":0,"_fixIESelect:20":0,"_iePreventSelect:38":0,"_ieRestoreSelect:49":0,"(anonymous 1):1":0}; _yuitest_coverage["build/scrollview-base-ie/scrollview-base-ie.js"].coveredLines = 10;@@ -105,4 +105,4 @@ } }, true); -}, '3.7.2', {"requires": ["scrollview-base"]});+}, '3.7.3', {"requires": ["scrollview-base"]});
bundle/scrollview-base-ie/scrollview-base-ie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -57,4 +57,4 @@ } }, true); -}, '3.7.2', {"requires": ["scrollview-base"]});+}, '3.7.3', {"requires": ["scrollview-base"]});
bundle/scrollview-base-ie/scrollview-base-ie-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("scrollview-base-ie",function(e,t){e.mix(e.ScrollView.prototype,{_fixIESelect:function(t,n){this._cbDoc=n.get("ownerDocument"),this._nativeBody=e.Node.getDOMNode(e.one("body",this._cbDoc)),n.on("mousedown",function(){this._selectstart=this._nativeBody.onselectstart,this._nativeBody.onselectstart=this._iePreventSelect,this._cbDoc.once("mouseup",this._ieRestoreSelect,this)},this)},_iePreventSelect:function(){return!1},_ieRestoreSelect:function(){this._nativeBody.onselectstart=this._selectstart}},!0)},"3.7.2",{requires:["scrollview-base"]});+YUI.add("scrollview-base-ie",function(e,t){e.mix(e.ScrollView.prototype,{_fixIESelect:function(t,n){this._cbDoc=n.get("ownerDocument"),this._nativeBody=e.Node.getDOMNode(e.one("body",this._cbDoc)),n.on("mousedown",function(){this._selectstart=this._nativeBody.onselectstart,this._nativeBody.onselectstart=this._iePreventSelect,this._cbDoc.once("mouseup",this._ieRestoreSelect,this)},this)},_iePreventSelect:function(){return!1},_ieRestoreSelect:function(){this._nativeBody.onselectstart=this._selectstart}},!0)},"3.7.3",{requires:["scrollview-base"]});
bundle/scrollview-base-ie/scrollview-base-ie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -57,4 +57,4 @@ } }, true); -}, '3.7.2', {"requires": ["scrollview-base"]});+}, '3.7.3', {"requires": ["scrollview-base"]});
bundle/scrollview-base/assets/scrollview-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-base/assets/skins/night/scrollview-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-base/assets/skins/night/scrollview-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-base/assets/skins/sam/scrollview-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-base/assets/skins/sam/scrollview-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-base/scrollview-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/scrollview-base/scrollview-base.js", code: [] };-_yuitest_coverage["build/scrollview-base/scrollview-base.js"].code=["YUI.add('scrollview-base', function (Y, NAME) {","","/**"," * The scrollview-base module provides a basic ScrollView Widget, without scrollbar indicators"," *"," * @module scrollview"," * @submodule scrollview-base"," */","var getClassName = Y.ClassNameManager.getClassName,"," DOCUMENT = Y.config.doc,"," WINDOW = Y.config.win,"," IE = Y.UA.ie,"," NATIVE_TRANSITIONS = Y.Transition.useNative,"," SCROLLVIEW = 'scrollview',"," CLASS_NAMES = {"," vertical: getClassName(SCROLLVIEW, 'vert'),"," horizontal: getClassName(SCROLLVIEW, 'horiz')"," },"," EV_SCROLL_END = 'scrollEnd',"," FLICK = 'flick',"," DRAG = 'drag',"," MOUSEWHEEL = 'mousewheel',"," UI = 'ui',"," TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',"," PX = 'px',"," AXIS = 'axis',"," SCROLL_Y = 'scrollY',"," SCROLL_X = 'scrollX',"," BOUNCE = 'bounce',"," DISABLED = 'disabled',"," DECELERATION = 'deceleration',"," DIM_X = 'x',"," DIM_Y = 'y',"," BOUNDING_BOX = 'boundingBox',"," CONTENT_BOX = 'contentBox',"," GESTURE_MOVE = 'gesturemove',"," START = 'start',"," END = 'end',"," EMPTY = '',"," ZERO = '0s',"," SNAP_DURATION = 'snapDuration',"," SNAP_EASING = 'snapEasing', "," EASING = 'easing', "," FRAME_DURATION = 'frameDuration', "," BOUNCE_RANGE = 'bounceRange',"," "," _constrain = function (val, min, max) {"," return Math.min(Math.max(val, min), max);"," };","","/**"," * ScrollView provides a scrollable widget, supporting flick gestures,"," * across both touch and mouse based devices."," *"," * @class ScrollView"," * @param config {Object} Object literal with initial attribute values"," * @extends Widget"," * @constructor"," */","function ScrollView() {"," ScrollView.superclass.constructor.apply(this, arguments);","}","","Y.ScrollView = Y.extend(ScrollView, Y.Widget, {",""," // *** Y.ScrollView prototype",""," /**"," * Flag driving whether or not we should try and force H/W acceleration when transforming. Currently enabled by default for Webkit."," * Used by the _transform method."," *"," * @property _forceHWTransforms"," * @type boolean"," * @protected"," */"," _forceHWTransforms: Y.UA.webkit ? true : false,",""," /**"," * <p>Used to control whether or not ScrollView's internal"," * gesturemovestart, gesturemove and gesturemoveend"," * event listeners should preventDefault. The value is an"," * object, with \"start\", \"move\" and \"end\" properties used to"," * specify which events should preventDefault and which shouldn't:</p>"," *"," * <pre>"," * {"," * start: false,"," * move: true,"," * end: false"," * }"," * </pre>"," *"," * <p>The default values are set up in order to prevent panning,"," * on touch devices, while allowing click listeners on elements inside"," * the ScrollView to be notified as expected.</p>"," *"," * @property _prevent"," * @type Object"," * @protected"," */"," _prevent: {"," start: false,"," move: true,"," end: false"," },",""," /**"," * Contains the distance (postive or negative) in pixels by which "," * the scrollview was last scrolled. This is useful when setting up "," * click listeners on the scrollview content, which on mouse based "," * devices are always fired, even after a drag/flick. "," * "," * <p>Touch based devices don't currently fire a click event, "," * if the finger has been moved (beyond a threshold) so this "," * check isn't required, if working in a purely touch based environment</p>"," * "," * @property lastScrolledAmt"," * @type Number"," * @public"," * @default 0"," */"," lastScrolledAmt: 0,",""," /**"," * Designated initializer"," *"," * @method initializer"," * @param {config} Configuration object for the plugin"," */"," initializer: function (config) {"," var sv = this;",""," // Cache these values, since they aren't going to change."," sv._bb = sv.get(BOUNDING_BOX);"," sv._cb = sv.get(CONTENT_BOX);",""," // Cache some attributes"," sv._cAxis = sv.get(AXIS);"," sv._cBounce = sv.get(BOUNCE);"," sv._cBounceRange = sv.get(BOUNCE_RANGE);"," sv._cDeceleration = sv.get(DECELERATION);"," sv._cFrameDuration = sv.get(FRAME_DURATION);"," },",""," /**"," * bindUI implementation"," *"," * Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function () {"," var sv = this;",""," // Bind interaction listers"," sv._bindFlick(sv.get(FLICK));"," sv._bindDrag(sv.get(DRAG));"," sv._bindMousewheel(true);"," "," // Bind change events"," sv._bindAttrs();",""," // IE SELECT HACK. See if we can do this non-natively and in the gesture for a future release."," if (IE) {"," sv._fixIESelect(sv._bb, sv._cb);"," }",""," // Set any deprecated static properties"," if (ScrollView.SNAP_DURATION) {"," sv.set(SNAP_DURATION, ScrollView.SNAP_DURATION);"," }",""," if (ScrollView.SNAP_EASING) {"," sv.set(SNAP_EASING, ScrollView.SNAP_EASING);"," }",""," if (ScrollView.EASING) {"," sv.set(EASING, ScrollView.EASING);"," }",""," if (ScrollView.FRAME_STEP) {"," sv.set(FRAME_DURATION, ScrollView.FRAME_STEP);"," }",""," if (ScrollView.BOUNCE_RANGE) {"," sv.set(BOUNCE_RANGE, ScrollView.BOUNCE_RANGE);"," }",""," // Recalculate dimension properties"," // TODO: This should be throttled."," // Y.one(WINDOW).after('resize', sv._afterDimChange, sv);"," },",""," /**"," * Bind event listeners"," *"," * @method _bindAttrs"," * @private"," */"," _bindAttrs: function () {"," var sv = this,"," scrollChangeHandler = sv._afterScrollChange,"," dimChangeHandler = sv._afterDimChange;",""," // Bind any change event listeners"," sv.after({"," 'scrollEnd': sv._afterScrollEnd,"," 'disabledChange': sv._afterDisabledChange,"," 'flickChange': sv._afterFlickChange,"," 'dragChange': sv._afterDragChange,"," 'axisChange': sv._afterAxisChange,"," 'scrollYChange': scrollChangeHandler,"," 'scrollXChange': scrollChangeHandler,"," 'heightChange': dimChangeHandler,"," 'widthChange': dimChangeHandler"," });"," },",""," /**"," * Bind (or unbind) gesture move listeners required for drag support"," *"," * @method _bindDrag"," * @param drag {boolean} If true, the method binds listener to enable drag (gesturemovestart). If false, the method unbinds gesturemove listeners for drag support."," * @private"," */"," _bindDrag: function (drag) {"," var sv = this,"," bb = sv._bb;",""," // Unbind any previous 'drag' listeners"," bb.detach(DRAG + '|*');",""," if (drag) {"," bb.on(DRAG + '|' + GESTURE_MOVE + START, Y.bind(sv._onGestureMoveStart, sv));"," }"," },",""," /**"," * Bind (or unbind) flick listeners."," *"," * @method _bindFlick"," * @param flick {Object|boolean} If truthy, the method binds listeners for flick support. If false, the method unbinds flick listeners."," * @private"," */"," _bindFlick: function (flick) {"," var sv = this,"," bb = sv._bb;",""," // Unbind any previous 'flick' listeners"," bb.detach(FLICK + '|*');",""," if (flick) {"," bb.on(FLICK + '|' + FLICK, Y.bind(sv._flick, sv), flick);",""," // Rebind Drag, becuase _onGestureMoveEnd always has to fire -after- _flick"," sv._bindDrag(sv.get(DRAG));"," }"," },",""," /**"," * Bind (or unbind) mousewheel listeners."," *"," * @method _bindMousewheel"," * @param mousewheel {Object|boolean} If truthy, the method binds listeners for mousewheel support. If false, the method unbinds mousewheel listeners."," * @private"," */"," _bindMousewheel: function (mousewheel) {"," var sv = this,"," bb = sv._bb;",""," // Unbind any previous 'mousewheel' listeners"," bb.detach(MOUSEWHEEL + '|*');",""," // Only enable for vertical scrollviews"," if (mousewheel) {"," // Bound to document, because that's where mousewheel events fire off of."," Y.one(DOCUMENT).on(MOUSEWHEEL, Y.bind(sv._mousewheel, sv));"," }"," },",""," /**"," * syncUI implementation."," *"," * Update the scroll position, based on the current value of scrollX/scrollY."," *"," * @method syncUI"," */"," syncUI: function () {"," var sv = this,"," scrollDims = sv._getScrollDims(),"," width = scrollDims.offsetWidth,"," height = scrollDims.offsetHeight,"," scrollWidth = scrollDims.scrollWidth,"," scrollHeight = scrollDims.scrollHeight;",""," // If the axis is undefined, auto-calculate it"," if (sv._cAxis === undefined) {"," // This should only ever be run once (for now)."," // In the future SV might post-load axis changes"," sv._cAxis = {"," x: (scrollWidth > width),"," y: (scrollHeight > height)"," };",""," sv._set(AXIS, sv._cAxis);"," }"," "," // get text direction on or inherited by scrollview node"," sv.rtl = (sv._cb.getComputedStyle('direction') === 'rtl');",""," // Cache the disabled value"," sv._cDisabled = sv.get(DISABLED);",""," // Run this to set initial values"," sv._uiDimensionsChange();",""," // If we're out-of-bounds, snap back."," if (sv._isOutOfBounds()) {"," sv._snapBack();"," }"," },",""," /**"," * Utility method to obtain widget dimensions"," * "," * @method _getScrollDims"," * @returns {Object} The offsetWidth, offsetHeight, scrollWidth and scrollHeight as an array: [offsetWidth, offsetHeight, scrollWidth, scrollHeight]"," * @private"," */"," _getScrollDims: function () {"," var sv = this,"," cb = sv._cb,"," bb = sv._bb,"," TRANS = ScrollView._TRANSITION,"," // Ideally using CSSMatrix - don't think we have it normalized yet though."," // origX = (new WebKitCSSMatrix(cb.getComputedStyle(\"transform\"))).e,"," // origY = (new WebKitCSSMatrix(cb.getComputedStyle(\"transform\"))).f,"," origX = sv.get(SCROLL_X),"," origY = sv.get(SCROLL_Y),"," origHWTransform,"," dims;",""," // TODO: Is this OK? Just in case it's called 'during' a transition."," if (NATIVE_TRANSITIONS) {"," cb.setStyle(TRANS.DURATION, ZERO);"," cb.setStyle(TRANS.PROPERTY, EMPTY);"," }",""," origHWTransform = sv._forceHWTransforms;"," sv._forceHWTransforms = false; // the z translation was causing issues with picking up accurate scrollWidths in Chrome/Mac.",""," sv._moveTo(cb, 0, 0);"," dims = {"," 'offsetWidth': bb.get('offsetWidth'),"," 'offsetHeight': bb.get('offsetHeight'),"," 'scrollWidth': bb.get('scrollWidth'),"," 'scrollHeight': bb.get('scrollHeight')"," };"," sv._moveTo(cb, -(origX), -(origY));",""," sv._forceHWTransforms = origHWTransform;",""," return dims;"," },",""," /**"," * This method gets invoked whenever the height or width attributes change,"," * allowing us to determine which scrolling axes need to be enabled."," *"," * @method _uiDimensionsChange"," * @protected"," */"," _uiDimensionsChange: function () {"," var sv = this,"," bb = sv._bb,"," scrollDims = sv._getScrollDims(),"," width = scrollDims.offsetWidth,"," height = scrollDims.offsetHeight,"," scrollWidth = scrollDims.scrollWidth,"," scrollHeight = scrollDims.scrollHeight,"," rtl = sv.rtl,"," svAxis = sv._cAxis;"," "," if (svAxis && svAxis.x) {"," bb.addClass(CLASS_NAMES.horizontal);"," }",""," if (svAxis && svAxis.y) {"," bb.addClass(CLASS_NAMES.vertical);"," }",""," /**"," * Internal state, defines the minimum amount that the scrollview can be scrolled along the X axis"," *"," * @property _minScrollX"," * @type number"," * @protected"," */"," sv._minScrollX = (rtl) ? Math.min(0, -(scrollWidth - width)) : 0;",""," /**"," * Internal state, defines the maximum amount that the scrollview can be scrolled along the X axis"," *"," * @property _maxScrollX"," * @type number"," * @protected"," */"," sv._maxScrollX = (rtl) ? 0 : Math.max(0, scrollWidth - width);",""," /**"," * Internal state, defines the minimum amount that the scrollview can be scrolled along the Y axis"," *"," * @property _minScrollY"," * @type number"," * @protected"," */"," sv._minScrollY = 0;",""," /**"," * Internal state, defines the maximum amount that the scrollview can be scrolled along the Y axis"," *"," * @property _maxScrollY"," * @type number"," * @protected"," */"," sv._maxScrollY = Math.max(0, scrollHeight - height);"," },",""," /**"," * Scroll the element to a given xy coordinate"," *"," * @method scrollTo"," * @param x {Number} The x-position to scroll to. (null for no movement)"," * @param y {Number} The y-position to scroll to. (null for no movement)"," * @param {Number} [duration] ms of the scroll animation. (default is 0)"," * @param {String} [easing] An easing equation if duration is set. (default is `easing` attribute)"," * @param {String} [node] The node to transform. Setting this can be useful in dual-axis paginated instances. (default is the instance's contentBox)"," */"," scrollTo: function (x, y, duration, easing, node) {"," // Check to see if widget is disabled"," if (this._cDisabled) {"," return;"," }",""," var sv = this,"," cb = sv._cb,"," TRANS = ScrollView._TRANSITION,"," callback = Y.bind(sv._onTransEnd, sv), // @Todo : cache this"," newX = 0,"," newY = 0,"," transition = {},"," transform;",""," // default the optional arguments"," duration = duration || 0;"," easing = easing || sv.get(EASING); // @TODO: Cache this"," node = node || cb;",""," if (x !== null) {"," sv.set(SCROLL_X, x, {src:UI});"," newX = -(x);"," }",""," if (y !== null) {"," sv.set(SCROLL_Y, y, {src:UI});"," newY = -(y);"," }",""," transform = sv._transform(newX, newY);",""," if (NATIVE_TRANSITIONS) {"," // ANDROID WORKAROUND - try and stop existing transition, before kicking off new one."," node.setStyle(TRANS.DURATION, ZERO).setStyle(TRANS.PROPERTY, EMPTY);"," }",""," // Move"," if (duration === 0) {"," if (NATIVE_TRANSITIONS) {"," node.setStyle('transform', transform);"," }"," else {"," // TODO: If both set, batch them in the same update"," // Update: Nope, setStyles() just loops through each property and applies it."," if (x !== null) {"," node.setStyle(LEFT, newX + PX);"," }"," if (y !== null) {"," node.setStyle(TOP, newY + PX);"," }"," }"," }",""," // Animate"," else {"," transition.easing = easing;"," transition.duration = duration / 1000;",""," if (NATIVE_TRANSITIONS) {"," transition.transform = transform;"," }"," else {"," transition.left = newX + PX;"," transition.top = newY + PX;"," }",""," node.transition(transition, callback);"," }"," },",""," /**"," * Utility method, to create the translate transform string with the"," * x, y translation amounts provided."," *"," * @method _transform"," * @param {Number} x Number of pixels to translate along the x axis"," * @param {Number} y Number of pixels to translate along the y axis"," * @private"," */"," _transform: function (x, y) {"," // TODO: Would we be better off using a Matrix for this?"," var prop = 'translate(' + x + 'px, ' + y + 'px)';",""," if (this._forceHWTransforms) {"," prop += ' translateZ(0)';"," }",""," return prop;"," },",""," /**"," * Utility method, to move the given element to the given xy position"," *"," * @method _moveTo"," * @param node {Node} The node to move"," * @param x {Number} The x-position to move to"," * @param y {Number} The y-position to move to"," * @private"," */"," _moveTo : function(node, x, y) {"," if (NATIVE_TRANSITIONS) {"," node.setStyle('transform', this._transform(x, y));"," } else {"," node.setStyle(LEFT, x + PX);"," node.setStyle(TOP, y + PX);"," }"," },","",""," /**"," * Content box transition callback"," *"," * @method _onTransEnd"," * @param {Event.Facade} e The event facade"," * @private"," */"," _onTransEnd: function (e) {"," var sv = this;",""," /**"," * Notification event fired at the end of a scroll transition"," *"," * @event scrollEnd"," * @param e {EventFacade} The default event facade."," */"," sv.fire(EV_SCROLL_END);"," },",""," /**"," * gesturemovestart event handler"," *"," * @method _onGestureMoveStart"," * @param e {Event.Facade} The gesturemovestart event facade"," * @private"," */"," _onGestureMoveStart: function (e) {",""," if (this._cDisabled) {"," return false;"," }",""," var sv = this,"," bb = sv._bb,"," currentX = sv.get(SCROLL_X),"," currentY = sv.get(SCROLL_Y),"," clientX = e.clientX,"," clientY = e.clientY;",""," if (sv._prevent.start) {"," e.preventDefault();"," }",""," // if a flick animation is in progress, cancel it"," if (sv._flickAnim) {"," // Cancel and delete sv._flickAnim"," sv._flickAnim.cancel();"," delete sv._flickAnim;"," sv._onTransEnd();"," }",""," // TODO: Review if neccesary (#2530129)"," e.stopPropagation();",""," // Reset lastScrolledAmt"," sv.lastScrolledAmt = 0;",""," // Stores data for this gesture cycle. Cleaned up later"," sv._gesture = {",""," // Will hold the axis value"," axis: null,",""," // The current attribute values"," startX: currentX,"," startY: currentY,",""," // The X/Y coordinates where the event began"," startClientX: clientX,"," startClientY: clientY,",""," // The X/Y coordinates where the event will end"," endClientX: null,"," endClientY: null,",""," // The current delta of the event"," deltaX: null,"," deltaY: null,",""," // Will be populated for flicks"," flick: null,",""," // Create some listeners for the rest of the gesture cycle"," onGestureMove: bb.on(DRAG + '|' + GESTURE_MOVE, Y.bind(sv._onGestureMove, sv)),"," "," // @TODO: Don't bind gestureMoveEnd if it's a Flick?"," onGestureMoveEnd: bb.on(DRAG + '|' + GESTURE_MOVE + END, Y.bind(sv._onGestureMoveEnd, sv))"," };"," },",""," /**"," * gesturemove event handler"," *"," * @method _onGestureMove"," * @param e {Event.Facade} The gesturemove event facade"," * @private"," */"," _onGestureMove: function (e) {"," var sv = this,"," gesture = sv._gesture,"," svAxis = sv._cAxis,"," svAxisX = svAxis.x,"," svAxisY = svAxis.y,"," startX = gesture.startX,"," startY = gesture.startY,"," startClientX = gesture.startClientX,"," startClientY = gesture.startClientY,"," clientX = e.clientX,"," clientY = e.clientY;",""," if (sv._prevent.move) {"," e.preventDefault();"," }",""," gesture.deltaX = startClientX - clientX;"," gesture.deltaY = startClientY - clientY;",""," // Determine if this is a vertical or horizontal movement"," // @TODO: This is crude, but it works. Investigate more intelligent ways to detect intent"," if (gesture.axis === null) {"," gesture.axis = (Math.abs(gesture.deltaX) > Math.abs(gesture.deltaY)) ? DIM_X : DIM_Y;"," }",""," // Move X or Y. @TODO: Move both if dualaxis. "," if (gesture.axis === DIM_X && svAxisX) {"," sv.set(SCROLL_X, startX + gesture.deltaX);"," }"," else if (gesture.axis === DIM_Y && svAxisY) {"," sv.set(SCROLL_Y, startY + gesture.deltaY);"," }"," },",""," /**"," * gesturemoveend event handler"," *"," * @method _onGestureMoveEnd"," * @param e {Event.Facade} The gesturemoveend event facade"," * @private"," */"," _onGestureMoveEnd: function (e) {"," var sv = this,"," gesture = sv._gesture,"," flick = gesture.flick,"," clientX = e.clientX,"," clientY = e.clientY;",""," if (sv._prevent.end) {"," e.preventDefault();"," }",""," // Store the end X/Y coordinates"," gesture.endClientX = clientX;"," gesture.endClientY = clientY;",""," // Cleanup the event handlers"," gesture.onGestureMove.detach();"," gesture.onGestureMoveEnd.detach();",""," // If this wasn't a flick, wrap up the gesture cycle"," if (!flick) {"," // @TODO: Be more intelligent about this. Look at the Flick attribute to see "," // if it is safe to assume _flick did or didn't fire. "," // Then, the order _flick and _onGestureMoveEnd fire doesn't matter?",""," // If there was movement (_onGestureMove fired)"," if (gesture.deltaX !== null && gesture.deltaY !== null) {",""," // If we're out-out-bounds, then snapback"," if (sv._isOutOfBounds()) {"," sv._snapBack();"," }",""," // Inbounds"," else {"," // Don't fire scrollEnd on the gesture axis is the same as paginator's"," // Not totally confident this is ideal to access a plugin's properties from a host, @TODO revisit"," if (sv.pages && !sv.pages.get(AXIS)[gesture.axis]) {"," sv._onTransEnd();"," }"," }"," }"," }"," },",""," /**"," * Execute a flick at the end of a scroll action"," *"," * @method _flick"," * @param e {Event.Facade} The Flick event facade"," * @private"," */"," _flick: function (e) {"," if (this._cDisabled) {"," return false;"," }",""," var sv = this,"," svAxis = sv._cAxis,"," flick = e.flick,"," flickAxis = flick.axis,"," flickVelocity = flick.velocity,"," axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y,"," startPosition = sv.get(axisAttr);",""," // Sometimes flick is enabled, but drag is disabled"," if (sv._gesture) {"," sv._gesture.flick = flick;"," }",""," // Prevent unneccesary firing of _flickFrame if we can't scroll on the flick axis"," if (svAxis[flickAxis]) {"," sv._flickFrame(flickVelocity, flickAxis, startPosition);"," }"," },",""," /**"," * Execute a single frame in the flick animation"," *"," * @method _flickFrame"," * @param velocity {Number} The velocity of this animated frame"," * @param flickAxis {String} The axis on which to animate"," * @param startPosition {Number} The starting X/Y point to flick from"," * @protected"," */"," _flickFrame: function (velocity, flickAxis, startPosition) {",""," var sv = this,"," axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y,",""," // Localize cached values"," bounce = sv._cBounce,"," bounceRange = sv._cBounceRange,"," deceleration = sv._cDeceleration,"," frameDuration = sv._cFrameDuration,",""," // Calculate"," newVelocity = velocity * deceleration,"," newPosition = startPosition - (frameDuration * newVelocity),",""," // Some convinience conditions"," min = flickAxis === DIM_X ? sv._minScrollX : sv._minScrollY,"," max = flickAxis === DIM_X ? sv._maxScrollX : sv._maxScrollY,"," belowMin = (newPosition < min),"," belowMax = (newPosition < max),"," aboveMin = (newPosition > min),"," aboveMax = (newPosition > max),"," belowMinRange = (newPosition < (min - bounceRange)),"," belowMaxRange = (newPosition < (max + bounceRange)),"," withinMinRange = (belowMin && (newPosition > (min - bounceRange))),"," withinMaxRange = (aboveMax && (newPosition < (max + bounceRange))),"," aboveMinRange = (newPosition > (min - bounceRange)),"," aboveMaxRange = (newPosition > (max + bounceRange)),"," tooSlow;",""," // If we're within the range but outside min/max, dampen the velocity"," if (withinMinRange || withinMaxRange) {"," newVelocity *= bounce;"," }",""," // Is the velocity too slow to bother?"," tooSlow = (Math.abs(newVelocity).toFixed(4) < 0.015);",""," // If the velocity is too slow or we're outside the range"," if (tooSlow || belowMinRange || aboveMaxRange) {"," // Cancel and delete sv._flickAnim"," if (sv._flickAnim) {"," sv._flickAnim.cancel();"," delete sv._flickAnim;"," }",""," // If we're inside the scroll area, just end"," if (aboveMin && belowMax) {"," sv._onTransEnd();"," }",""," // We're outside the scroll area, so we need to snap back"," else {"," sv._snapBack();"," }"," }",""," // Otherwise, animate to the next frame"," else {"," // @TODO: maybe use requestAnimationFrame instead"," sv._flickAnim = Y.later(frameDuration, sv, '_flickFrame', [newVelocity, flickAxis, newPosition]);"," sv.set(axisAttr, newPosition);"," }"," },",""," /**"," * Handle mousewheel events on the widget"," *"," * @method _mousewheel"," * @param e {Event.Facade} The mousewheel event facade"," * @private"," */"," _mousewheel: function (e) {"," var sv = this,"," scrollY = sv.get(SCROLL_Y),"," bb = sv._bb,"," scrollOffset = 10, // 10px"," isForward = (e.wheelDelta > 0),"," scrollToY = scrollY - ((isForward ? 1 : -1) * scrollOffset);",""," scrollToY = _constrain(scrollToY, sv._minScrollY, sv._maxScrollY);",""," // Because Mousewheel events fire off 'document', every ScrollView widget will react"," // to any mousewheel anywhere on the page. This check will ensure that the mouse is currently"," // over this specific ScrollView. Also, only allow mousewheel scrolling on Y-axis, "," // becuase otherwise the 'prevent' will block page scrolling."," if (bb.contains(e.target) && sv._cAxis[DIM_Y]) {",""," // Reset lastScrolledAmt"," sv.lastScrolledAmt = 0;",""," // Jump to the new offset"," sv.set(SCROLL_Y, scrollToY);",""," // if we have scrollbars plugin, update & set the flash timer on the scrollbar"," // @TODO: This probably shouldn't be in this module"," if (sv.scrollbars) {"," // @TODO: The scrollbars should handle this themselves"," sv.scrollbars._update();"," sv.scrollbars.flash();"," // or just this"," // sv.scrollbars._hostDimensionsChange();"," }",""," // Fire the 'scrollEnd' event"," sv._onTransEnd();",""," // prevent browser default behavior on mouse scroll"," e.preventDefault();"," }"," },",""," /**"," * Checks to see the current scrollX/scrollY position beyond the min/max boundary"," *"," * @method _isOutOfBounds"," * @param x {Number} [optional] The X position to check"," * @param y {Number} [optional] The Y position to check"," * @returns {boolen} Whether the current X/Y position is out of bounds (true) or not (false)"," * @private"," */"," _isOutOfBounds: function (x, y) {"," var sv = this,"," svAxis = sv._cAxis,"," svAxisX = svAxis.x,"," svAxisY = svAxis.y,"," currentX = x || sv.get(SCROLL_X),"," currentY = y || sv.get(SCROLL_Y),"," minX = sv._minScrollX,"," minY = sv._minScrollY,"," maxX = sv._maxScrollX,"," maxY = sv._maxScrollY;",""," return (svAxisX && (currentX < minX || currentX > maxX)) || (svAxisY && (currentY < minY || currentY > maxY));"," },",""," /**"," * Bounces back"," * @TODO: Should be more generalized and support both X and Y detection"," *"," * @method _snapBack"," * @private"," */"," _snapBack: function () {"," var sv = this,"," currentX = sv.get(SCROLL_X),"," currentY = sv.get(SCROLL_Y),"," minX = sv._minScrollX,"," minY = sv._minScrollY,"," maxX = sv._maxScrollX,"," maxY = sv._maxScrollY,"," newY = _constrain(currentY, minY, maxY),"," newX = _constrain(currentX, minX, maxX),"," duration = sv.get(SNAP_DURATION),"," easing = sv.get(SNAP_EASING);",""," if (newX !== currentX) {"," sv.set(SCROLL_X, newX, {duration:duration, easing:easing});"," }"," else if (newY !== currentY) {"," sv.set(SCROLL_Y, newY, {duration:duration, easing:easing});"," }"," else {"," // It shouldn't ever get here, but in case it does, fire scrollEnd"," sv._onTransEnd();"," }"," },",""," /**"," * After listener for changes to the scrollX or scrollY attribute"," *"," * @method _afterScrollChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterScrollChange: function (e) {",""," if (e.src === ScrollView.UI_SRC) {"," return false;"," }",""," var sv = this,"," duration = e.duration,"," easing = e.easing,"," val = e.newVal,"," scrollToArgs = [];",""," // Set the scrolled value"," sv.lastScrolledAmt = sv.lastScrolledAmt + (e.newVal - e.prevVal);",""," // Generate the array of args to pass to scrollTo()"," if (e.attrName === SCROLL_X) {"," scrollToArgs.push(val);"," scrollToArgs.push(sv.get(SCROLL_Y));"," }"," else {"," scrollToArgs.push(sv.get(SCROLL_X));"," scrollToArgs.push(val);"," }",""," scrollToArgs.push(duration);"," scrollToArgs.push(easing);",""," sv.scrollTo.apply(sv, scrollToArgs);"," },",""," /**"," * After listener for changes to the flick attribute"," *"," * @method _afterFlickChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterFlickChange: function (e) {"," this._bindFlick(e.newVal);"," },",""," /**"," * After listener for changes to the disabled attribute"," *"," * @method _afterDisabledChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterDisabledChange: function (e) {"," // Cache for performance - we check during move"," this._cDisabled = e.newVal;"," },",""," /**"," * After listener for the axis attribute"," *"," * @method _afterAxisChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterAxisChange: function (e) {"," this._cAxis = e.newVal;"," },",""," /**"," * After listener for changes to the drag attribute"," *"," * @method _afterDragChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterDragChange: function (e) {"," this._bindDrag(e.newVal);"," },",""," /**"," * After listener for the height or width attribute"," *"," * @method _afterDimChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterDimChange: function () {"," this._uiDimensionsChange();"," },",""," /**"," * After listener for scrollEnd, for cleanup"," *"," * @method _afterScrollEnd"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterScrollEnd: function (e) {"," var sv = this;",""," // @TODO: Move to sv._cancelFlick()"," if (sv._flickAnim) {"," // Cancel the flick (if it exists)"," sv._flickAnim.cancel();",""," // Also delete it, otherwise _onGestureMoveStart will think we're still flicking"," delete sv._flickAnim;"," }",""," // If for some reason we're OOB, snapback"," if (sv._isOutOfBounds()) {"," sv._snapBack();"," }",""," // Ideally this should be removed, but doing so causing some JS errors with fast swiping "," // because _gesture is being deleted after the previous one has been overwritten"," // delete sv._gesture; // TODO: Move to sv.prevGesture?"," },",""," /**"," * Setter for 'axis' attribute"," *"," * @method _axisSetter"," * @param val {Mixed} A string ('x', 'y', 'xy') to specify which axis/axes to allow scrolling on"," * @param name {String} The attribute name"," * @return {Object} An object to specify scrollability on the x & y axes"," * "," * @protected"," */"," _axisSetter: function (val, name) {",""," // Turn a string into an axis object"," if (Y.Lang.isString(val)) {"," return {"," x: val.match(/x/i) ? true : false,"," y: val.match(/y/i) ? true : false"," };"," }"," },"," "," /**"," * The scrollX, scrollY setter implementation"," *"," * @method _setScroll"," * @private"," * @param {Number} val"," * @param {String} dim"," *"," * @return {Number} The value"," */"," _setScroll : function(val, dim) {",""," // Just ensure the widget is not disabled"," if (this._cDisabled) {"," val = Y.Attribute.INVALID_VALUE;"," } ",""," return val;"," },",""," /**"," * Setter for the scrollX attribute"," *"," * @method _setScrollX"," * @param val {Number} The new scrollX value"," * @return {Number} The normalized value"," * @protected"," */"," _setScrollX: function(val) {"," return this._setScroll(val, DIM_X);"," },",""," /**"," * Setter for the scrollY ATTR"," *"," * @method _setScrollY"," * @param val {Number} The new scrollY value"," * @return {Number} The normalized value"," * @protected"," */"," _setScrollY: function(val) {"," return this._setScroll(val, DIM_Y);"," }",""," // End prototype properties","","}, {",""," // Static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'scrollview'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'scrollview',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * Specifies ability to scroll on x, y, or x and y axis/axes."," *"," * @attribute axis"," * @type String"," */"," axis: {"," setter: '_axisSetter',"," writeOnce: 'initOnly'"," },",""," /**"," * The current scroll position in the x-axis"," *"," * @attribute scrollX"," * @type Number"," * @default 0"," */"," scrollX: {"," value: 0,"," setter: '_setScrollX'"," },",""," /**"," * The current scroll position in the y-axis"," *"," * @attribute scrollY"," * @type Number"," * @default 0"," */"," scrollY: {"," value: 0,"," setter: '_setScrollY'"," },",""," /**"," * Drag coefficent for inertial scrolling. The closer to 1 this"," * value is, the less friction during scrolling."," *"," * @attribute deceleration"," * @default 0.93"," */"," deceleration: {"," value: 0.93"," },",""," /**"," * Drag coefficient for intertial scrolling at the upper"," * and lower boundaries of the scrollview. Set to 0 to"," * disable \"rubber-banding\"."," *"," * @attribute bounce"," * @type Number"," * @default 0.1"," */"," bounce: {"," value: 0.1"," },",""," /**"," * The minimum distance and/or velocity which define a flick. Can be set to false,"," * to disable flick support (note: drag support is enabled/disabled separately)"," *"," * @attribute flick"," * @type Object"," * @default Object with properties minDistance = 10, minVelocity = 0.3."," */"," flick: {"," value: {"," minDistance: 10,"," minVelocity: 0.3"," }"," },",""," /**"," * Enable/Disable dragging the ScrollView content (note: flick support is enabled/disabled separately)"," * @attribute drag"," * @type boolean"," * @default true"," */"," drag: {"," value: true"," },",""," /**"," * The default duration to use when animating the bounce snap back."," *"," * @attribute snapDuration"," * @type Number"," * @default 400"," */"," snapDuration: {"," value: 400"," },",""," /**"," * The default easing to use when animating the bounce snap back."," *"," * @attribute snapEasing"," * @type String"," * @default 'ease-out'"," */"," snapEasing: {"," value: 'ease-out'"," },",""," /**"," * The default easing used when animating the flick"," *"," * @attribute easing"," * @type String"," * @default 'cubic-bezier(0, 0.1, 0, 1.0)'"," */"," easing: {"," value: 'cubic-bezier(0, 0.1, 0, 1.0)'"," },",""," /**"," * The interval (ms) used when animating the flick for JS-timer animations"," *"," * @attribute frameDuration"," * @type Number"," * @default 15"," */"," frameDuration: {"," value: 15"," },",""," /**"," * The default bounce distance in pixels"," *"," * @attribute bounceRange"," * @type Number"," * @default 150"," */"," bounceRange: {"," value: 150"," }"," },",""," /**"," * List of class names used in the scrollview's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES,",""," /**"," * Flag used to source property changes initiated from the DOM"," *"," * @property UI_SRC"," * @type String"," * @static"," * @default 'ui'"," */"," UI_SRC: UI,",""," /**"," * Object map of style property names used to set transition properties."," * Defaults to the vendor prefix established by the Transition module."," * The configured property names are `_TRANSITION.DURATION` (e.g. \"WebkitTransitionDuration\") and"," * `_TRANSITION.PROPERTY (e.g. \"WebkitTransitionProperty\")."," *"," * @property _TRANSITION"," * @private"," */"," _TRANSITION: {"," DURATION: Y.Transition._VENDOR_PREFIX + 'TransitionDuration',"," PROPERTY: Y.Transition._VENDOR_PREFIX + 'TransitionProperty'"," },",""," /**"," * The default bounce distance in pixels"," *"," * @property BOUNCE_RANGE"," * @type Number"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," BOUNCE_RANGE: false,",""," /**"," * The interval (ms) used when animating the flick"," *"," * @property FRAME_STEP"," * @type Number"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," FRAME_STEP: false,",""," /**"," * The default easing used when animating the flick"," *"," * @property EASING"," * @type String"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," EASING: false,",""," /**"," * The default easing to use when animating the bounce snap back."," *"," * @property SNAP_EASING"," * @type String"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," SNAP_EASING: false,",""," /**"," * The default duration to use when animating the bounce snap back."," *"," * @property SNAP_DURATION"," * @type Number"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," SNAP_DURATION: false",""," // End static properties","","});","","}, '3.7.2', {\"requires\": [\"widget\", \"event-gestures\", \"event-mousewheel\", \"transition\"], \"skinnable\": true});"];-_yuitest_coverage["build/scrollview-base/scrollview-base.js"].lines = {"1":0,"9":0,"51":0,"63":0,"64":0,"67":0,"134":0,"137":0,"138":0,"141":0,"142":0,"143":0,"144":0,"145":0,"155":0,"158":0,"159":0,"160":0,"163":0,"166":0,"167":0,"171":0,"172":0,"175":0,"176":0,"179":0,"180":0,"183":0,"184":0,"187":0,"188":0,"203":0,"208":0,"229":0,"233":0,"235":0,"236":0,"248":0,"252":0,"254":0,"255":0,"258":0,"270":0,"274":0,"277":0,"279":0,"291":0,"299":0,"302":0,"307":0,"311":0,"314":0,"317":0,"320":0,"321":0,"333":0,"346":0,"347":0,"348":0,"351":0,"352":0,"354":0,"355":0,"361":0,"363":0,"365":0,"376":0,"386":0,"387":0,"390":0,"391":0,"401":0,"410":0,"419":0,"428":0,"443":0,"444":0,"447":0,"457":0,"458":0,"459":0,"461":0,"462":0,"463":0,"466":0,"467":0,"468":0,"471":0,"473":0,"475":0,"479":0,"480":0,"481":0,"486":0,"487":0,"489":0,"490":0,"497":0,"498":0,"500":0,"501":0,"504":0,"505":0,"508":0,"523":0,"525":0,"526":0,"529":0,"542":0,"543":0,"545":0,"546":0,"559":0,"567":0,"579":0,"580":0,"583":0,"590":0,"591":0,"595":0,"597":0,"598":0,"599":0,"603":0,"606":0,"609":0,"649":0,"661":0,"662":0,"665":0,"666":0,"670":0,"671":0,"675":0,"676":0,"678":0,"679":0,"691":0,"697":0,"698":0,"702":0,"703":0,"706":0,"707":0,"710":0,"716":0,"719":0,"720":0,"727":0,"728":0,"743":0,"744":0,"747":0,"756":0,"757":0,"761":0,"762":0,"777":0,"806":0,"807":0,"811":0,"814":0,"816":0,"817":0,"818":0,"822":0,"823":0,"828":0,"835":0,"836":0,"848":0,"855":0,"861":0,"864":0,"867":0,"871":0,"873":0,"874":0,"880":0,"883":0,"897":0,"908":0,"919":0,"931":0,"932":0,"934":0,"935":0,"939":0,"952":0,"953":0,"956":0,"963":0,"966":0,"967":0,"968":0,"971":0,"972":0,"975":0,"976":0,"978":0,"989":0,"1001":0,"1012":0,"1023":0,"1034":0,"1045":0,"1048":0,"1050":0,"1053":0,"1057":0,"1058":0,"1079":0,"1080":0,"1100":0,"1101":0,"1104":0,"1116":0,"1128":0};-_yuitest_coverage["build/scrollview-base/scrollview-base.js"].functions = {"_constrain:50":0,"ScrollView:63":0,"initializer:133":0,"bindUI:154":0,"_bindAttrs:202":0,"_bindDrag:228":0,"_bindFlick:247":0,"_bindMousewheel:269":0,"syncUI:290":0,"_getScrollDims:332":0,"_uiDimensionsChange:375":0,"scrollTo:441":0,"_transform:521":0,"_moveTo:541":0,"_onTransEnd:558":0,"_onGestureMoveStart:577":0,"_onGestureMove:648":0,"_onGestureMoveEnd:690":0,"_flick:742":0,"_flickFrame:775":0,"_mousewheel:847":0,"_isOutOfBounds:896":0,"_snapBack:918":0,"_afterScrollChange:950":0,"_afterFlickChange:988":0,"_afterDisabledChange:999":0,"_afterAxisChange:1011":0,"_afterDragChange:1022":0,"_afterDimChange:1033":0,"_afterScrollEnd:1044":0,"_axisSetter:1076":0,"_setScroll:1097":0,"_setScrollX:1115":0,"_setScrollY:1127":0,"(anonymous 1):1":0};+_yuitest_coverage["build/scrollview-base/scrollview-base.js"].code=["YUI.add('scrollview-base', function (Y, NAME) {","","/**"," * The scrollview-base module provides a basic ScrollView Widget, without scrollbar indicators"," *"," * @module scrollview"," * @submodule scrollview-base"," */","var getClassName = Y.ClassNameManager.getClassName,"," DOCUMENT = Y.config.doc,"," WINDOW = Y.config.win,"," IE = Y.UA.ie,"," NATIVE_TRANSITIONS = Y.Transition.useNative,"," vendorPrefix = Y.Transition._VENDOR_PREFIX, // Todo: This is a private property, and alternative approaches should be investigated"," SCROLLVIEW = 'scrollview',"," CLASS_NAMES = {"," vertical: getClassName(SCROLLVIEW, 'vert'),"," horizontal: getClassName(SCROLLVIEW, 'horiz')"," },"," EV_SCROLL_END = 'scrollEnd',"," FLICK = 'flick',"," DRAG = 'drag',"," MOUSEWHEEL = 'mousewheel',"," UI = 'ui',"," TOP = 'top',"," RIGHT = 'right',"," BOTTOM = 'bottom',"," LEFT = 'left',"," PX = 'px',"," AXIS = 'axis',"," SCROLL_Y = 'scrollY',"," SCROLL_X = 'scrollX',"," BOUNCE = 'bounce',"," DISABLED = 'disabled',"," DECELERATION = 'deceleration',"," DIM_X = 'x',"," DIM_Y = 'y',"," BOUNDING_BOX = 'boundingBox',"," CONTENT_BOX = 'contentBox',"," GESTURE_MOVE = 'gesturemove',"," START = 'start',"," END = 'end',"," EMPTY = '',"," ZERO = '0s',"," SNAP_DURATION = 'snapDuration',"," SNAP_EASING = 'snapEasing', "," EASING = 'easing', "," FRAME_DURATION = 'frameDuration', "," BOUNCE_RANGE = 'bounceRange',"," "," _constrain = function (val, min, max) {"," return Math.min(Math.max(val, min), max);"," };","","/**"," * ScrollView provides a scrollable widget, supporting flick gestures,"," * across both touch and mouse based devices."," *"," * @class ScrollView"," * @param config {Object} Object literal with initial attribute values"," * @extends Widget"," * @constructor"," */","function ScrollView() {"," ScrollView.superclass.constructor.apply(this, arguments);","}","","Y.ScrollView = Y.extend(ScrollView, Y.Widget, {",""," // *** Y.ScrollView prototype",""," /**"," * Flag driving whether or not we should try and force H/W acceleration when transforming. Currently enabled by default for Webkit."," * Used by the _transform method."," *"," * @property _forceHWTransforms"," * @type boolean"," * @protected"," */"," _forceHWTransforms: Y.UA.webkit ? true : false,",""," /**"," * <p>Used to control whether or not ScrollView's internal"," * gesturemovestart, gesturemove and gesturemoveend"," * event listeners should preventDefault. The value is an"," * object, with \"start\", \"move\" and \"end\" properties used to"," * specify which events should preventDefault and which shouldn't:</p>"," *"," * <pre>"," * {"," * start: false,"," * move: true,"," * end: false"," * }"," * </pre>"," *"," * <p>The default values are set up in order to prevent panning,"," * on touch devices, while allowing click listeners on elements inside"," * the ScrollView to be notified as expected.</p>"," *"," * @property _prevent"," * @type Object"," * @protected"," */"," _prevent: {"," start: false,"," move: true,"," end: false"," },",""," /**"," * Contains the distance (postive or negative) in pixels by which "," * the scrollview was last scrolled. This is useful when setting up "," * click listeners on the scrollview content, which on mouse based "," * devices are always fired, even after a drag/flick. "," * "," * <p>Touch based devices don't currently fire a click event, "," * if the finger has been moved (beyond a threshold) so this "," * check isn't required, if working in a purely touch based environment</p>"," * "," * @property lastScrolledAmt"," * @type Number"," * @public"," * @default 0"," */"," lastScrolledAmt: 0,",""," /**"," * Designated initializer"," *"," * @method initializer"," * @param {config} Configuration object for the plugin"," */"," initializer: function (config) {"," var sv = this;",""," // Cache these values, since they aren't going to change."," sv._bb = sv.get(BOUNDING_BOX);"," sv._cb = sv.get(CONTENT_BOX);",""," // Cache some attributes"," sv._cAxis = sv.get(AXIS);"," sv._cBounce = sv.get(BOUNCE);"," sv._cBounceRange = sv.get(BOUNCE_RANGE);"," sv._cDeceleration = sv.get(DECELERATION);"," sv._cFrameDuration = sv.get(FRAME_DURATION);"," },",""," /**"," * bindUI implementation"," *"," * Hooks up events for the widget"," * @method bindUI"," */"," bindUI: function () {"," var sv = this;",""," // Bind interaction listers"," sv._bindFlick(sv.get(FLICK));"," sv._bindDrag(sv.get(DRAG));"," sv._bindMousewheel(true);"," "," // Bind change events"," sv._bindAttrs();",""," // IE SELECT HACK. See if we can do this non-natively and in the gesture for a future release."," if (IE) {"," sv._fixIESelect(sv._bb, sv._cb);"," }",""," // Set any deprecated static properties"," if (ScrollView.SNAP_DURATION) {"," sv.set(SNAP_DURATION, ScrollView.SNAP_DURATION);"," }",""," if (ScrollView.SNAP_EASING) {"," sv.set(SNAP_EASING, ScrollView.SNAP_EASING);"," }",""," if (ScrollView.EASING) {"," sv.set(EASING, ScrollView.EASING);"," }",""," if (ScrollView.FRAME_STEP) {"," sv.set(FRAME_DURATION, ScrollView.FRAME_STEP);"," }",""," if (ScrollView.BOUNCE_RANGE) {"," sv.set(BOUNCE_RANGE, ScrollView.BOUNCE_RANGE);"," }",""," // Recalculate dimension properties"," // TODO: This should be throttled."," // Y.one(WINDOW).after('resize', sv._afterDimChange, sv);"," },",""," /**"," * Bind event listeners"," *"," * @method _bindAttrs"," * @private"," */"," _bindAttrs: function () {"," var sv = this,"," scrollChangeHandler = sv._afterScrollChange,"," dimChangeHandler = sv._afterDimChange;",""," // Bind any change event listeners"," sv.after({"," 'scrollEnd': sv._afterScrollEnd,"," 'disabledChange': sv._afterDisabledChange,"," 'flickChange': sv._afterFlickChange,"," 'dragChange': sv._afterDragChange,"," 'axisChange': sv._afterAxisChange,"," 'scrollYChange': scrollChangeHandler,"," 'scrollXChange': scrollChangeHandler,"," 'heightChange': dimChangeHandler,"," 'widthChange': dimChangeHandler"," });"," },",""," /**"," * Bind (or unbind) gesture move listeners required for drag support"," *"," * @method _bindDrag"," * @param drag {boolean} If true, the method binds listener to enable drag (gesturemovestart). If false, the method unbinds gesturemove listeners for drag support."," * @private"," */"," _bindDrag: function (drag) {"," var sv = this,"," bb = sv._bb;",""," // Unbind any previous 'drag' listeners"," bb.detach(DRAG + '|*');",""," if (drag) {"," bb.on(DRAG + '|' + GESTURE_MOVE + START, Y.bind(sv._onGestureMoveStart, sv));"," }"," },",""," /**"," * Bind (or unbind) flick listeners."," *"," * @method _bindFlick"," * @param flick {Object|boolean} If truthy, the method binds listeners for flick support. If false, the method unbinds flick listeners."," * @private"," */"," _bindFlick: function (flick) {"," var sv = this,"," bb = sv._bb;",""," // Unbind any previous 'flick' listeners"," bb.detach(FLICK + '|*');",""," if (flick) {"," bb.on(FLICK + '|' + FLICK, Y.bind(sv._flick, sv), flick);",""," // Rebind Drag, becuase _onGestureMoveEnd always has to fire -after- _flick"," sv._bindDrag(sv.get(DRAG));"," }"," },",""," /**"," * Bind (or unbind) mousewheel listeners."," *"," * @method _bindMousewheel"," * @param mousewheel {Object|boolean} If truthy, the method binds listeners for mousewheel support. If false, the method unbinds mousewheel listeners."," * @private"," */"," _bindMousewheel: function (mousewheel) {"," var sv = this,"," bb = sv._bb;",""," // Unbind any previous 'mousewheel' listeners"," bb.detach(MOUSEWHEEL + '|*');",""," // Only enable for vertical scrollviews"," if (mousewheel) {"," // Bound to document, because that's where mousewheel events fire off of."," Y.one(DOCUMENT).on(MOUSEWHEEL, Y.bind(sv._mousewheel, sv));"," }"," },",""," /**"," * syncUI implementation."," *"," * Update the scroll position, based on the current value of scrollX/scrollY."," *"," * @method syncUI"," */"," syncUI: function () {"," var sv = this,"," scrollDims = sv._getScrollDims(),"," width = scrollDims.offsetWidth,"," height = scrollDims.offsetHeight,"," scrollWidth = scrollDims.scrollWidth,"," scrollHeight = scrollDims.scrollHeight;",""," // If the axis is undefined, auto-calculate it"," if (sv._cAxis === undefined) {"," // This should only ever be run once (for now)."," // In the future SV might post-load axis changes"," sv._cAxis = {"," x: (scrollWidth > width),"," y: (scrollHeight > height)"," };",""," sv._set(AXIS, sv._cAxis);"," }"," "," // get text direction on or inherited by scrollview node"," sv.rtl = (sv._cb.getComputedStyle('direction') === 'rtl');",""," // Cache the disabled value"," sv._cDisabled = sv.get(DISABLED);",""," // Run this to set initial values"," sv._uiDimensionsChange();",""," // If we're out-of-bounds, snap back."," if (sv._isOutOfBounds()) {"," sv._snapBack();"," }"," },",""," /**"," * Utility method to obtain widget dimensions"," * "," * @method _getScrollDims"," * @returns {Object} The offsetWidth, offsetHeight, scrollWidth and scrollHeight as an array: [offsetWidth, offsetHeight, scrollWidth, scrollHeight]"," * @private"," */"," _getScrollDims: function () {"," var sv = this,"," cb = sv._cb,"," bb = sv._bb,"," TRANS = ScrollView._TRANSITION,"," // Ideally using CSSMatrix - don't think we have it normalized yet though."," // origX = (new WebKitCSSMatrix(cb.getComputedStyle(\"transform\"))).e,"," // origY = (new WebKitCSSMatrix(cb.getComputedStyle(\"transform\"))).f,"," origX = sv.get(SCROLL_X),"," origY = sv.get(SCROLL_Y),"," origHWTransform,"," dims;",""," // TODO: Is this OK? Just in case it's called 'during' a transition."," if (NATIVE_TRANSITIONS) {"," cb.setStyle(TRANS.DURATION, ZERO);"," cb.setStyle(TRANS.PROPERTY, EMPTY);"," }",""," origHWTransform = sv._forceHWTransforms;"," sv._forceHWTransforms = false; // the z translation was causing issues with picking up accurate scrollWidths in Chrome/Mac.",""," sv._moveTo(cb, 0, 0);"," dims = {"," 'offsetWidth': bb.get('offsetWidth'),"," 'offsetHeight': bb.get('offsetHeight'),"," 'scrollWidth': bb.get('scrollWidth'),"," 'scrollHeight': bb.get('scrollHeight')"," };"," sv._moveTo(cb, -(origX), -(origY));",""," sv._forceHWTransforms = origHWTransform;",""," return dims;"," },",""," /**"," * This method gets invoked whenever the height or width attributes change,"," * allowing us to determine which scrolling axes need to be enabled."," *"," * @method _uiDimensionsChange"," * @protected"," */"," _uiDimensionsChange: function () {"," var sv = this,"," bb = sv._bb,"," scrollDims = sv._getScrollDims(),"," width = scrollDims.offsetWidth,"," height = scrollDims.offsetHeight,"," scrollWidth = scrollDims.scrollWidth,"," scrollHeight = scrollDims.scrollHeight,"," rtl = sv.rtl,"," svAxis = sv._cAxis;"," "," if (svAxis && svAxis.x) {"," bb.addClass(CLASS_NAMES.horizontal);"," }",""," if (svAxis && svAxis.y) {"," bb.addClass(CLASS_NAMES.vertical);"," }",""," /**"," * Internal state, defines the minimum amount that the scrollview can be scrolled along the X axis"," *"," * @property _minScrollX"," * @type number"," * @protected"," */"," sv._minScrollX = (rtl) ? Math.min(0, -(scrollWidth - width)) : 0;",""," /**"," * Internal state, defines the maximum amount that the scrollview can be scrolled along the X axis"," *"," * @property _maxScrollX"," * @type number"," * @protected"," */"," sv._maxScrollX = (rtl) ? 0 : Math.max(0, scrollWidth - width);",""," /**"," * Internal state, defines the minimum amount that the scrollview can be scrolled along the Y axis"," *"," * @property _minScrollY"," * @type number"," * @protected"," */"," sv._minScrollY = 0;",""," /**"," * Internal state, defines the maximum amount that the scrollview can be scrolled along the Y axis"," *"," * @property _maxScrollY"," * @type number"," * @protected"," */"," sv._maxScrollY = Math.max(0, scrollHeight - height);"," },",""," /**"," * Scroll the element to a given xy coordinate"," *"," * @method scrollTo"," * @param x {Number} The x-position to scroll to. (null for no movement)"," * @param y {Number} The y-position to scroll to. (null for no movement)"," * @param {Number} [duration] ms of the scroll animation. (default is 0)"," * @param {String} [easing] An easing equation if duration is set. (default is `easing` attribute)"," * @param {String} [node] The node to transform. Setting this can be useful in dual-axis paginated instances. (default is the instance's contentBox)"," */"," scrollTo: function (x, y, duration, easing, node) {"," // Check to see if widget is disabled"," if (this._cDisabled) {"," return;"," }",""," var sv = this,"," cb = sv._cb,"," TRANS = ScrollView._TRANSITION,"," callback = Y.bind(sv._onTransEnd, sv), // @Todo : cache this"," newX = 0,"," newY = 0,"," transition = {},"," transform;",""," // default the optional arguments"," duration = duration || 0;"," easing = easing || sv.get(EASING); // @TODO: Cache this"," node = node || cb;",""," if (x !== null) {"," sv.set(SCROLL_X, x, {src:UI});"," newX = -(x);"," }",""," if (y !== null) {"," sv.set(SCROLL_Y, y, {src:UI});"," newY = -(y);"," }",""," transform = sv._transform(newX, newY);",""," if (NATIVE_TRANSITIONS) {"," // ANDROID WORKAROUND - try and stop existing transition, before kicking off new one."," node.setStyle(TRANS.DURATION, ZERO).setStyle(TRANS.PROPERTY, EMPTY);"," }",""," // Move"," if (duration === 0) {"," if (NATIVE_TRANSITIONS) {"," node.setStyle('transform', transform);"," }"," else {"," // TODO: If both set, batch them in the same update"," // Update: Nope, setStyles() just loops through each property and applies it."," if (x !== null) {"," node.setStyle(LEFT, newX + PX);"," }"," if (y !== null) {"," node.setStyle(TOP, newY + PX);"," }"," }"," }",""," // Animate"," else {"," transition.easing = easing;"," transition.duration = duration / 1000;",""," if (NATIVE_TRANSITIONS) {"," transition.transform = transform;"," }"," else {"," transition.left = newX + PX;"," transition.top = newY + PX;"," }",""," node.transition(transition, callback);"," }"," },",""," /**"," * Utility method, to create the translate transform string with the"," * x, y translation amounts provided."," *"," * @method _transform"," * @param {Number} x Number of pixels to translate along the x axis"," * @param {Number} y Number of pixels to translate along the y axis"," * @private"," */"," _transform: function (x, y) {"," // TODO: Would we be better off using a Matrix for this?"," var prop = 'translate(' + x + 'px, ' + y + 'px)';",""," if (this._forceHWTransforms) {"," prop += ' translateZ(0)';"," }",""," return prop;"," },",""," /**"," * Utility method, to move the given element to the given xy position"," *"," * @method _moveTo"," * @param node {Node} The node to move"," * @param x {Number} The x-position to move to"," * @param y {Number} The y-position to move to"," * @private"," */"," _moveTo : function(node, x, y) {"," if (NATIVE_TRANSITIONS) {"," node.setStyle('transform', this._transform(x, y));"," } else {"," node.setStyle(LEFT, x + PX);"," node.setStyle(TOP, y + PX);"," }"," },","",""," /**"," * Content box transition callback"," *"," * @method _onTransEnd"," * @param {Event.Facade} e The event facade"," * @private"," */"," _onTransEnd: function (e) {"," var sv = this;",""," /**"," * Notification event fired at the end of a scroll transition"," *"," * @event scrollEnd"," * @param e {EventFacade} The default event facade."," */"," sv.fire(EV_SCROLL_END);"," },",""," /**"," * gesturemovestart event handler"," *"," * @method _onGestureMoveStart"," * @param e {Event.Facade} The gesturemovestart event facade"," * @private"," */"," _onGestureMoveStart: function (e) {",""," if (this._cDisabled) {"," return false;"," }",""," var sv = this,"," bb = sv._bb,"," currentX = sv.get(SCROLL_X),"," currentY = sv.get(SCROLL_Y),"," clientX = e.clientX,"," clientY = e.clientY;",""," if (sv._prevent.start) {"," e.preventDefault();"," }",""," // if a flick animation is in progress, cancel it"," if (sv._flickAnim) {"," // Cancel and delete sv._flickAnim"," sv._flickAnim.cancel();"," delete sv._flickAnim;"," sv._onTransEnd();"," }",""," // TODO: Review if neccesary (#2530129)"," e.stopPropagation();",""," // Reset lastScrolledAmt"," sv.lastScrolledAmt = 0;",""," // Stores data for this gesture cycle. Cleaned up later"," sv._gesture = {",""," // Will hold the axis value"," axis: null,",""," // The current attribute values"," startX: currentX,"," startY: currentY,",""," // The X/Y coordinates where the event began"," startClientX: clientX,"," startClientY: clientY,",""," // The X/Y coordinates where the event will end"," endClientX: null,"," endClientY: null,",""," // The current delta of the event"," deltaX: null,"," deltaY: null,",""," // Will be populated for flicks"," flick: null,",""," // Create some listeners for the rest of the gesture cycle"," onGestureMove: bb.on(DRAG + '|' + GESTURE_MOVE, Y.bind(sv._onGestureMove, sv)),"," "," // @TODO: Don't bind gestureMoveEnd if it's a Flick?"," onGestureMoveEnd: bb.on(DRAG + '|' + GESTURE_MOVE + END, Y.bind(sv._onGestureMoveEnd, sv))"," };"," },",""," /**"," * gesturemove event handler"," *"," * @method _onGestureMove"," * @param e {Event.Facade} The gesturemove event facade"," * @private"," */"," _onGestureMove: function (e) {"," var sv = this,"," gesture = sv._gesture,"," svAxis = sv._cAxis,"," svAxisX = svAxis.x,"," svAxisY = svAxis.y,"," startX = gesture.startX,"," startY = gesture.startY,"," startClientX = gesture.startClientX,"," startClientY = gesture.startClientY,"," clientX = e.clientX,"," clientY = e.clientY;",""," if (sv._prevent.move) {"," e.preventDefault();"," }",""," gesture.deltaX = startClientX - clientX;"," gesture.deltaY = startClientY - clientY;",""," // Determine if this is a vertical or horizontal movement"," // @TODO: This is crude, but it works. Investigate more intelligent ways to detect intent"," if (gesture.axis === null) {"," gesture.axis = (Math.abs(gesture.deltaX) > Math.abs(gesture.deltaY)) ? DIM_X : DIM_Y;"," }",""," // Move X or Y. @TODO: Move both if dualaxis. "," if (gesture.axis === DIM_X && svAxisX) {"," sv.set(SCROLL_X, startX + gesture.deltaX);"," }"," else if (gesture.axis === DIM_Y && svAxisY) {"," sv.set(SCROLL_Y, startY + gesture.deltaY);"," }"," },",""," /**"," * gesturemoveend event handler"," *"," * @method _onGestureMoveEnd"," * @param e {Event.Facade} The gesturemoveend event facade"," * @private"," */"," _onGestureMoveEnd: function (e) {"," var sv = this,"," gesture = sv._gesture,"," flick = gesture.flick,"," clientX = e.clientX,"," clientY = e.clientY;",""," if (sv._prevent.end) {"," e.preventDefault();"," }",""," // Store the end X/Y coordinates"," gesture.endClientX = clientX;"," gesture.endClientY = clientY;",""," // Cleanup the event handlers"," gesture.onGestureMove.detach();"," gesture.onGestureMoveEnd.detach();",""," // If this wasn't a flick, wrap up the gesture cycle"," if (!flick) {"," // @TODO: Be more intelligent about this. Look at the Flick attribute to see "," // if it is safe to assume _flick did or didn't fire. "," // Then, the order _flick and _onGestureMoveEnd fire doesn't matter?",""," // If there was movement (_onGestureMove fired)"," if (gesture.deltaX !== null && gesture.deltaY !== null) {",""," // If we're out-out-bounds, then snapback"," if (sv._isOutOfBounds()) {"," sv._snapBack();"," }",""," // Inbounds"," else {"," // Don't fire scrollEnd on the gesture axis is the same as paginator's"," // Not totally confident this is ideal to access a plugin's properties from a host, @TODO revisit"," if (sv.pages && !sv.pages.get(AXIS)[gesture.axis]) {"," sv._onTransEnd();"," }"," }"," }"," }"," },",""," /**"," * Execute a flick at the end of a scroll action"," *"," * @method _flick"," * @param e {Event.Facade} The Flick event facade"," * @private"," */"," _flick: function (e) {"," if (this._cDisabled) {"," return false;"," }",""," var sv = this,"," svAxis = sv._cAxis,"," flick = e.flick,"," flickAxis = flick.axis,"," flickVelocity = flick.velocity,"," axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y,"," startPosition = sv.get(axisAttr);",""," // Sometimes flick is enabled, but drag is disabled"," if (sv._gesture) {"," sv._gesture.flick = flick;"," }",""," // Prevent unneccesary firing of _flickFrame if we can't scroll on the flick axis"," if (svAxis[flickAxis]) {"," sv._flickFrame(flickVelocity, flickAxis, startPosition);"," }"," },",""," /**"," * Execute a single frame in the flick animation"," *"," * @method _flickFrame"," * @param velocity {Number} The velocity of this animated frame"," * @param flickAxis {String} The axis on which to animate"," * @param startPosition {Number} The starting X/Y point to flick from"," * @protected"," */"," _flickFrame: function (velocity, flickAxis, startPosition) {",""," var sv = this,"," axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y,",""," // Localize cached values"," bounce = sv._cBounce,"," bounceRange = sv._cBounceRange,"," deceleration = sv._cDeceleration,"," frameDuration = sv._cFrameDuration,",""," // Calculate"," newVelocity = velocity * deceleration,"," newPosition = startPosition - (frameDuration * newVelocity),",""," // Some convinience conditions"," min = flickAxis === DIM_X ? sv._minScrollX : sv._minScrollY,"," max = flickAxis === DIM_X ? sv._maxScrollX : sv._maxScrollY,"," belowMin = (newPosition < min),"," belowMax = (newPosition < max),"," aboveMin = (newPosition > min),"," aboveMax = (newPosition > max),"," belowMinRange = (newPosition < (min - bounceRange)),"," belowMaxRange = (newPosition < (max + bounceRange)),"," withinMinRange = (belowMin && (newPosition > (min - bounceRange))),"," withinMaxRange = (aboveMax && (newPosition < (max + bounceRange))),"," aboveMinRange = (newPosition > (min - bounceRange)),"," aboveMaxRange = (newPosition > (max + bounceRange)),"," tooSlow;",""," // If we're within the range but outside min/max, dampen the velocity"," if (withinMinRange || withinMaxRange) {"," newVelocity *= bounce;"," }",""," // Is the velocity too slow to bother?"," tooSlow = (Math.abs(newVelocity).toFixed(4) < 0.015);",""," // If the velocity is too slow or we're outside the range"," if (tooSlow || belowMinRange || aboveMaxRange) {"," // Cancel and delete sv._flickAnim"," if (sv._flickAnim) {"," sv._flickAnim.cancel();"," delete sv._flickAnim;"," }",""," // If we're inside the scroll area, just end"," if (aboveMin && belowMax) {"," sv._onTransEnd();"," }",""," // We're outside the scroll area, so we need to snap back"," else {"," sv._snapBack();"," }"," }",""," // Otherwise, animate to the next frame"," else {"," // @TODO: maybe use requestAnimationFrame instead"," sv._flickAnim = Y.later(frameDuration, sv, '_flickFrame', [newVelocity, flickAxis, newPosition]);"," sv.set(axisAttr, newPosition);"," }"," },",""," /**"," * Handle mousewheel events on the widget"," *"," * @method _mousewheel"," * @param e {Event.Facade} The mousewheel event facade"," * @private"," */"," _mousewheel: function (e) {"," var sv = this,"," scrollY = sv.get(SCROLL_Y),"," bb = sv._bb,"," scrollOffset = 10, // 10px"," isForward = (e.wheelDelta > 0),"," scrollToY = scrollY - ((isForward ? 1 : -1) * scrollOffset);",""," scrollToY = _constrain(scrollToY, sv._minScrollY, sv._maxScrollY);",""," // Because Mousewheel events fire off 'document', every ScrollView widget will react"," // to any mousewheel anywhere on the page. This check will ensure that the mouse is currently"," // over this specific ScrollView. Also, only allow mousewheel scrolling on Y-axis, "," // becuase otherwise the 'prevent' will block page scrolling."," if (bb.contains(e.target) && sv._cAxis[DIM_Y]) {",""," // Reset lastScrolledAmt"," sv.lastScrolledAmt = 0;",""," // Jump to the new offset"," sv.set(SCROLL_Y, scrollToY);",""," // if we have scrollbars plugin, update & set the flash timer on the scrollbar"," // @TODO: This probably shouldn't be in this module"," if (sv.scrollbars) {"," // @TODO: The scrollbars should handle this themselves"," sv.scrollbars._update();"," sv.scrollbars.flash();"," // or just this"," // sv.scrollbars._hostDimensionsChange();"," }",""," // Fire the 'scrollEnd' event"," sv._onTransEnd();",""," // prevent browser default behavior on mouse scroll"," e.preventDefault();"," }"," },",""," /**"," * Checks to see the current scrollX/scrollY position beyond the min/max boundary"," *"," * @method _isOutOfBounds"," * @param x {Number} [optional] The X position to check"," * @param y {Number} [optional] The Y position to check"," * @returns {boolen} Whether the current X/Y position is out of bounds (true) or not (false)"," * @private"," */"," _isOutOfBounds: function (x, y) {"," var sv = this,"," svAxis = sv._cAxis,"," svAxisX = svAxis.x,"," svAxisY = svAxis.y,"," currentX = x || sv.get(SCROLL_X),"," currentY = y || sv.get(SCROLL_Y),"," minX = sv._minScrollX,"," minY = sv._minScrollY,"," maxX = sv._maxScrollX,"," maxY = sv._maxScrollY;",""," return (svAxisX && (currentX < minX || currentX > maxX)) || (svAxisY && (currentY < minY || currentY > maxY));"," },",""," /**"," * Bounces back"," * @TODO: Should be more generalized and support both X and Y detection"," *"," * @method _snapBack"," * @private"," */"," _snapBack: function () {"," var sv = this,"," currentX = sv.get(SCROLL_X),"," currentY = sv.get(SCROLL_Y),"," minX = sv._minScrollX,"," minY = sv._minScrollY,"," maxX = sv._maxScrollX,"," maxY = sv._maxScrollY,"," newY = _constrain(currentY, minY, maxY),"," newX = _constrain(currentX, minX, maxX),"," duration = sv.get(SNAP_DURATION),"," easing = sv.get(SNAP_EASING);",""," if (newX !== currentX) {"," sv.set(SCROLL_X, newX, {duration:duration, easing:easing});"," }"," else if (newY !== currentY) {"," sv.set(SCROLL_Y, newY, {duration:duration, easing:easing});"," }"," else {"," // It shouldn't ever get here, but in case it does, fire scrollEnd"," sv._onTransEnd();"," }"," },",""," /**"," * After listener for changes to the scrollX or scrollY attribute"," *"," * @method _afterScrollChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterScrollChange: function (e) {",""," if (e.src === ScrollView.UI_SRC) {"," return false;"," }",""," var sv = this,"," duration = e.duration,"," easing = e.easing,"," val = e.newVal,"," scrollToArgs = [];",""," // Set the scrolled value"," sv.lastScrolledAmt = sv.lastScrolledAmt + (e.newVal - e.prevVal);",""," // Generate the array of args to pass to scrollTo()"," if (e.attrName === SCROLL_X) {"," scrollToArgs.push(val);"," scrollToArgs.push(sv.get(SCROLL_Y));"," }"," else {"," scrollToArgs.push(sv.get(SCROLL_X));"," scrollToArgs.push(val);"," }",""," scrollToArgs.push(duration);"," scrollToArgs.push(easing);",""," sv.scrollTo.apply(sv, scrollToArgs);"," },",""," /**"," * After listener for changes to the flick attribute"," *"," * @method _afterFlickChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterFlickChange: function (e) {"," this._bindFlick(e.newVal);"," },",""," /**"," * After listener for changes to the disabled attribute"," *"," * @method _afterDisabledChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterDisabledChange: function (e) {"," // Cache for performance - we check during move"," this._cDisabled = e.newVal;"," },",""," /**"," * After listener for the axis attribute"," *"," * @method _afterAxisChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterAxisChange: function (e) {"," this._cAxis = e.newVal;"," },",""," /**"," * After listener for changes to the drag attribute"," *"," * @method _afterDragChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterDragChange: function (e) {"," this._bindDrag(e.newVal);"," },",""," /**"," * After listener for the height or width attribute"," *"," * @method _afterDimChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterDimChange: function () {"," this._uiDimensionsChange();"," },",""," /**"," * After listener for scrollEnd, for cleanup"," *"," * @method _afterScrollEnd"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterScrollEnd: function (e) {"," var sv = this;",""," // @TODO: Move to sv._cancelFlick()"," if (sv._flickAnim) {"," // Cancel the flick (if it exists)"," sv._flickAnim.cancel();",""," // Also delete it, otherwise _onGestureMoveStart will think we're still flicking"," delete sv._flickAnim;"," }",""," // If for some reason we're OOB, snapback"," if (sv._isOutOfBounds()) {"," sv._snapBack();"," }",""," // Ideally this should be removed, but doing so causing some JS errors with fast swiping "," // because _gesture is being deleted after the previous one has been overwritten"," // delete sv._gesture; // TODO: Move to sv.prevGesture?"," },",""," /**"," * Setter for 'axis' attribute"," *"," * @method _axisSetter"," * @param val {Mixed} A string ('x', 'y', 'xy') to specify which axis/axes to allow scrolling on"," * @param name {String} The attribute name"," * @return {Object} An object to specify scrollability on the x & y axes"," * "," * @protected"," */"," _axisSetter: function (val, name) {",""," // Turn a string into an axis object"," if (Y.Lang.isString(val)) {"," return {"," x: val.match(/x/i) ? true : false,"," y: val.match(/y/i) ? true : false"," };"," }"," },"," "," /**"," * The scrollX, scrollY setter implementation"," *"," * @method _setScroll"," * @private"," * @param {Number} val"," * @param {String} dim"," *"," * @return {Number} The value"," */"," _setScroll : function(val, dim) {",""," // Just ensure the widget is not disabled"," if (this._cDisabled) {"," val = Y.Attribute.INVALID_VALUE;"," } ",""," return val;"," },",""," /**"," * Setter for the scrollX attribute"," *"," * @method _setScrollX"," * @param val {Number} The new scrollX value"," * @return {Number} The normalized value"," * @protected"," */"," _setScrollX: function(val) {"," return this._setScroll(val, DIM_X);"," },",""," /**"," * Setter for the scrollY ATTR"," *"," * @method _setScrollY"," * @param val {Number} The new scrollY value"," * @return {Number} The normalized value"," * @protected"," */"," _setScrollY: function(val) {"," return this._setScroll(val, DIM_Y);"," }",""," // End prototype properties","","}, {",""," // Static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'scrollview'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'scrollview',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * Specifies ability to scroll on x, y, or x and y axis/axes."," *"," * @attribute axis"," * @type String"," */"," axis: {"," setter: '_axisSetter',"," writeOnce: 'initOnly'"," },",""," /**"," * The current scroll position in the x-axis"," *"," * @attribute scrollX"," * @type Number"," * @default 0"," */"," scrollX: {"," value: 0,"," setter: '_setScrollX'"," },",""," /**"," * The current scroll position in the y-axis"," *"," * @attribute scrollY"," * @type Number"," * @default 0"," */"," scrollY: {"," value: 0,"," setter: '_setScrollY'"," },",""," /**"," * Drag coefficent for inertial scrolling. The closer to 1 this"," * value is, the less friction during scrolling."," *"," * @attribute deceleration"," * @default 0.93"," */"," deceleration: {"," value: 0.93"," },",""," /**"," * Drag coefficient for intertial scrolling at the upper"," * and lower boundaries of the scrollview. Set to 0 to"," * disable \"rubber-banding\"."," *"," * @attribute bounce"," * @type Number"," * @default 0.1"," */"," bounce: {"," value: 0.1"," },",""," /**"," * The minimum distance and/or velocity which define a flick. Can be set to false,"," * to disable flick support (note: drag support is enabled/disabled separately)"," *"," * @attribute flick"," * @type Object"," * @default Object with properties minDistance = 10, minVelocity = 0.3."," */"," flick: {"," value: {"," minDistance: 10,"," minVelocity: 0.3"," }"," },",""," /**"," * Enable/Disable dragging the ScrollView content (note: flick support is enabled/disabled separately)"," * @attribute drag"," * @type boolean"," * @default true"," */"," drag: {"," value: true"," },",""," /**"," * The default duration to use when animating the bounce snap back."," *"," * @attribute snapDuration"," * @type Number"," * @default 400"," */"," snapDuration: {"," value: 400"," },",""," /**"," * The default easing to use when animating the bounce snap back."," *"," * @attribute snapEasing"," * @type String"," * @default 'ease-out'"," */"," snapEasing: {"," value: 'ease-out'"," },",""," /**"," * The default easing used when animating the flick"," *"," * @attribute easing"," * @type String"," * @default 'cubic-bezier(0, 0.1, 0, 1.0)'"," */"," easing: {"," value: 'cubic-bezier(0, 0.1, 0, 1.0)'"," },",""," /**"," * The interval (ms) used when animating the flick for JS-timer animations"," *"," * @attribute frameDuration"," * @type Number"," * @default 15"," */"," frameDuration: {"," value: 15"," },",""," /**"," * The default bounce distance in pixels"," *"," * @attribute bounceRange"," * @type Number"," * @default 150"," */"," bounceRange: {"," value: 150"," }"," },",""," /**"," * List of class names used in the scrollview's DOM"," *"," * @property CLASS_NAMES"," * @type Object"," * @static"," */"," CLASS_NAMES: CLASS_NAMES,",""," /**"," * Flag used to source property changes initiated from the DOM"," *"," * @property UI_SRC"," * @type String"," * @static"," * @default 'ui'"," */"," UI_SRC: UI,",""," /**"," * Object map of style property names used to set transition properties."," * Defaults to the vendor prefix established by the Transition module."," * The configured property names are `_TRANSITION.DURATION` (e.g. \"WebkitTransitionDuration\") and"," * `_TRANSITION.PROPERTY (e.g. \"WebkitTransitionProperty\")."," *"," * @property _TRANSITION"," * @private"," */"," _TRANSITION: {"," DURATION: (vendorPrefix ? vendorPrefix + 'TransitionDuration' : 'transitionDuration'),"," PROPERTY: (vendorPrefix ? vendorPrefix + 'TransitionProperty' : 'transitionProperty')"," },",""," /**"," * The default bounce distance in pixels"," *"," * @property BOUNCE_RANGE"," * @type Number"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," BOUNCE_RANGE: false,",""," /**"," * The interval (ms) used when animating the flick"," *"," * @property FRAME_STEP"," * @type Number"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," FRAME_STEP: false,",""," /**"," * The default easing used when animating the flick"," *"," * @property EASING"," * @type String"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," EASING: false,",""," /**"," * The default easing to use when animating the bounce snap back."," *"," * @property SNAP_EASING"," * @type String"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," SNAP_EASING: false,",""," /**"," * The default duration to use when animating the bounce snap back."," *"," * @property SNAP_DURATION"," * @type Number"," * @static"," * @default false"," * @deprecated (in 3.7.0)"," */"," SNAP_DURATION: false",""," // End static properties","","});","","}, '3.7.3', {\"requires\": [\"widget\", \"event-gestures\", \"event-mousewheel\", \"transition\"], \"skinnable\": true});"];+_yuitest_coverage["build/scrollview-base/scrollview-base.js"].lines = {"1":0,"9":0,"52":0,"64":0,"65":0,"68":0,"135":0,"138":0,"139":0,"142":0,"143":0,"144":0,"145":0,"146":0,"156":0,"159":0,"160":0,"161":0,"164":0,"167":0,"168":0,"172":0,"173":0,"176":0,"177":0,"180":0,"181":0,"184":0,"185":0,"188":0,"189":0,"204":0,"209":0,"230":0,"234":0,"236":0,"237":0,"249":0,"253":0,"255":0,"256":0,"259":0,"271":0,"275":0,"278":0,"280":0,"292":0,"300":0,"303":0,"308":0,"312":0,"315":0,"318":0,"321":0,"322":0,"334":0,"347":0,"348":0,"349":0,"352":0,"353":0,"355":0,"356":0,"362":0,"364":0,"366":0,"377":0,"387":0,"388":0,"391":0,"392":0,"402":0,"411":0,"420":0,"429":0,"444":0,"445":0,"448":0,"458":0,"459":0,"460":0,"462":0,"463":0,"464":0,"467":0,"468":0,"469":0,"472":0,"474":0,"476":0,"480":0,"481":0,"482":0,"487":0,"488":0,"490":0,"491":0,"498":0,"499":0,"501":0,"502":0,"505":0,"506":0,"509":0,"524":0,"526":0,"527":0,"530":0,"543":0,"544":0,"546":0,"547":0,"560":0,"568":0,"580":0,"581":0,"584":0,"591":0,"592":0,"596":0,"598":0,"599":0,"600":0,"604":0,"607":0,"610":0,"650":0,"662":0,"663":0,"666":0,"667":0,"671":0,"672":0,"676":0,"677":0,"679":0,"680":0,"692":0,"698":0,"699":0,"703":0,"704":0,"707":0,"708":0,"711":0,"717":0,"720":0,"721":0,"728":0,"729":0,"744":0,"745":0,"748":0,"757":0,"758":0,"762":0,"763":0,"778":0,"807":0,"808":0,"812":0,"815":0,"817":0,"818":0,"819":0,"823":0,"824":0,"829":0,"836":0,"837":0,"849":0,"856":0,"862":0,"865":0,"868":0,"872":0,"874":0,"875":0,"881":0,"884":0,"898":0,"909":0,"920":0,"932":0,"933":0,"935":0,"936":0,"940":0,"953":0,"954":0,"957":0,"964":0,"967":0,"968":0,"969":0,"972":0,"973":0,"976":0,"977":0,"979":0,"990":0,"1002":0,"1013":0,"1024":0,"1035":0,"1046":0,"1049":0,"1051":0,"1054":0,"1058":0,"1059":0,"1080":0,"1081":0,"1101":0,"1102":0,"1105":0,"1117":0,"1129":0};+_yuitest_coverage["build/scrollview-base/scrollview-base.js"].functions = {"_constrain:51":0,"ScrollView:64":0,"initializer:134":0,"bindUI:155":0,"_bindAttrs:203":0,"_bindDrag:229":0,"_bindFlick:248":0,"_bindMousewheel:270":0,"syncUI:291":0,"_getScrollDims:333":0,"_uiDimensionsChange:376":0,"scrollTo:442":0,"_transform:522":0,"_moveTo:542":0,"_onTransEnd:559":0,"_onGestureMoveStart:578":0,"_onGestureMove:649":0,"_onGestureMoveEnd:691":0,"_flick:743":0,"_flickFrame:776":0,"_mousewheel:848":0,"_isOutOfBounds:897":0,"_snapBack:919":0,"_afterScrollChange:951":0,"_afterFlickChange:989":0,"_afterDisabledChange:1000":0,"_afterAxisChange:1012":0,"_afterDragChange:1023":0,"_afterDimChange:1034":0,"_afterScrollEnd:1045":0,"_axisSetter:1077":0,"_setScroll:1098":0,"_setScrollX:1116":0,"_setScrollY:1128":0,"(anonymous 1):1":0}; _yuitest_coverage["build/scrollview-base/scrollview-base.js"].coveredLines = 218; _yuitest_coverage["build/scrollview-base/scrollview-base.js"].coveredFunctions = 35; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1);@@ -53,6 +53,7 @@ WINDOW = Y.config.win, IE = Y.UA.ie, NATIVE_TRANSITIONS = Y.Transition.useNative,+ vendorPrefix = Y.Transition._VENDOR_PREFIX, // Todo: This is a private property, and alternative approaches should be investigated SCROLLVIEW = 'scrollview', CLASS_NAMES = { vertical: getClassName(SCROLLVIEW, 'vert'),@@ -90,8 +91,8 @@ BOUNCE_RANGE = 'bounceRange', _constrain = function (val, min, max) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_constrain", 50);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 51);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_constrain", 51);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 52); return Math.min(Math.max(val, min), max); }; @@ -104,14 +105,14 @@ * @extends Widget * @constructor */-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 63);-function ScrollView() {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "ScrollView", 63); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 64);+function ScrollView() {+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "ScrollView", 64);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 65); ScrollView.superclass.constructor.apply(this, arguments); } -_yuitest_coverline("build/scrollview-base/scrollview-base.js", 67);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 68); Y.ScrollView = Y.extend(ScrollView, Y.Widget, { // *** Y.ScrollView prototype@@ -179,26 +180,26 @@ * @param {config} Configuration object for the plugin */ initializer: function (config) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "initializer", 133);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 134);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "initializer", 134);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 135); var sv = this; // Cache these values, since they aren't going to change.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 137);-sv._bb = sv.get(BOUNDING_BOX); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 138);+sv._bb = sv.get(BOUNDING_BOX);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 139); sv._cb = sv.get(CONTENT_BOX); // Cache some attributes- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 141);-sv._cAxis = sv.get(AXIS); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 142);-sv._cBounce = sv.get(BOUNCE);+sv._cAxis = sv.get(AXIS); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 143);-sv._cBounceRange = sv.get(BOUNCE_RANGE);+sv._cBounce = sv.get(BOUNCE); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 144);-sv._cDeceleration = sv.get(DECELERATION);+sv._cBounceRange = sv.get(BOUNCE_RANGE); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 145);+sv._cDeceleration = sv.get(DECELERATION);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 146); sv._cFrameDuration = sv.get(FRAME_DURATION); }, @@ -209,57 +210,57 @@ * @method bindUI */ bindUI: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "bindUI", 154);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 155);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "bindUI", 155);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 156); var sv = this; // Bind interaction listers- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 158);-sv._bindFlick(sv.get(FLICK)); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 159);-sv._bindDrag(sv.get(DRAG));+sv._bindFlick(sv.get(FLICK)); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 160);+sv._bindDrag(sv.get(DRAG));+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 161); sv._bindMousewheel(true); // Bind change events- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 163);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 164); sv._bindAttrs(); // IE SELECT HACK. See if we can do this non-natively and in the gesture for a future release.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 166);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 167); if (IE) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 167);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 168); sv._fixIESelect(sv._bb, sv._cb); } // Set any deprecated static properties- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 171);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 172); if (ScrollView.SNAP_DURATION) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 172);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 173); sv.set(SNAP_DURATION, ScrollView.SNAP_DURATION); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 175);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 176); if (ScrollView.SNAP_EASING) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 176);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 177); sv.set(SNAP_EASING, ScrollView.SNAP_EASING); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 179);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 180); if (ScrollView.EASING) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 180);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 181); sv.set(EASING, ScrollView.EASING); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 183);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 184); if (ScrollView.FRAME_STEP) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 184);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 185); sv.set(FRAME_DURATION, ScrollView.FRAME_STEP); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 187);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 188); if (ScrollView.BOUNCE_RANGE) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 188);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 189); sv.set(BOUNCE_RANGE, ScrollView.BOUNCE_RANGE); } @@ -275,14 +276,14 @@ * @private */ _bindAttrs: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindAttrs", 202);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 203);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindAttrs", 203);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 204); var sv = this, scrollChangeHandler = sv._afterScrollChange, dimChangeHandler = sv._afterDimChange; // Bind any change event listeners- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 208);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 209); sv.after({ 'scrollEnd': sv._afterScrollEnd, 'disabledChange': sv._afterDisabledChange,@@ -304,18 +305,18 @@ * @private */ _bindDrag: function (drag) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindDrag", 228);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 229);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindDrag", 229);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 230); var sv = this, bb = sv._bb; // Unbind any previous 'drag' listeners- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 233);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 234); bb.detach(DRAG + '|*'); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 235);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 236); if (drag) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 236);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 237); bb.on(DRAG + '|' + GESTURE_MOVE + START, Y.bind(sv._onGestureMoveStart, sv)); } },@@ -328,22 +329,22 @@ * @private */ _bindFlick: function (flick) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindFlick", 247);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 248);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindFlick", 248);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 249); var sv = this, bb = sv._bb; // Unbind any previous 'flick' listeners- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 252);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 253); bb.detach(FLICK + '|*'); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 254);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 255); if (flick) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 255);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 256); bb.on(FLICK + '|' + FLICK, Y.bind(sv._flick, sv), flick); // Rebind Drag, becuase _onGestureMoveEnd always has to fire -after- _flick- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 258);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 259); sv._bindDrag(sv.get(DRAG)); } },@@ -356,20 +357,20 @@ * @private */ _bindMousewheel: function (mousewheel) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindMousewheel", 269);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 270);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_bindMousewheel", 270);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 271); var sv = this, bb = sv._bb; // Unbind any previous 'mousewheel' listeners- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 274);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 275); bb.detach(MOUSEWHEEL + '|*'); // Only enable for vertical scrollviews- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 277);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 278); if (mousewheel) { // Bound to document, because that's where mousewheel events fire off of.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 279);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 280); Y.one(DOCUMENT).on(MOUSEWHEEL, Y.bind(sv._mousewheel, sv)); } },@@ -382,8 +383,8 @@ * @method syncUI */ syncUI: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "syncUI", 290);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 291);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "syncUI", 291);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 292); var sv = this, scrollDims = sv._getScrollDims(), width = scrollDims.offsetWidth,@@ -392,36 +393,36 @@ scrollHeight = scrollDims.scrollHeight; // If the axis is undefined, auto-calculate it- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 299);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 300); if (sv._cAxis === undefined) { // This should only ever be run once (for now). // In the future SV might post-load axis changes- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 302);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 303); sv._cAxis = { x: (scrollWidth > width), y: (scrollHeight > height) }; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 307);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 308); sv._set(AXIS, sv._cAxis); } // get text direction on or inherited by scrollview node- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 311);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 312); sv.rtl = (sv._cb.getComputedStyle('direction') === 'rtl'); // Cache the disabled value- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 314);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 315); sv._cDisabled = sv.get(DISABLED); // Run this to set initial values- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 317);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 318); sv._uiDimensionsChange(); // If we're out-of-bounds, snap back.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 320);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 321); if (sv._isOutOfBounds()) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 321);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 322); sv._snapBack(); } },@@ -434,8 +435,8 @@ * @private */ _getScrollDims: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_getScrollDims", 332);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 333);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_getScrollDims", 333);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 334); var sv = this, cb = sv._cb, bb = sv._bb,@@ -449,35 +450,35 @@ dims; // TODO: Is this OK? Just in case it's called 'during' a transition.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 346);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 347); if (NATIVE_TRANSITIONS) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 347);-cb.setStyle(TRANS.DURATION, ZERO); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 348);+cb.setStyle(TRANS.DURATION, ZERO);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 349); cb.setStyle(TRANS.PROPERTY, EMPTY); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 351);-origHWTransform = sv._forceHWTransforms; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 352);+origHWTransform = sv._forceHWTransforms;+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 353); sv._forceHWTransforms = false; // the z translation was causing issues with picking up accurate scrollWidths in Chrome/Mac. - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 354);-sv._moveTo(cb, 0, 0); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 355);+sv._moveTo(cb, 0, 0);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 356); dims = { 'offsetWidth': bb.get('offsetWidth'), 'offsetHeight': bb.get('offsetHeight'), 'scrollWidth': bb.get('scrollWidth'), 'scrollHeight': bb.get('scrollHeight') };- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 361);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 362); sv._moveTo(cb, -(origX), -(origY)); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 363);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 364); sv._forceHWTransforms = origHWTransform; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 365);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 366); return dims; }, @@ -489,8 +490,8 @@ * @protected */ _uiDimensionsChange: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_uiDimensionsChange", 375);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 376);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_uiDimensionsChange", 376);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 377); var sv = this, bb = sv._bb, scrollDims = sv._getScrollDims(),@@ -501,15 +502,15 @@ rtl = sv.rtl, svAxis = sv._cAxis; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 386);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 387); if (svAxis && svAxis.x) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 387);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 388); bb.addClass(CLASS_NAMES.horizontal); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 390);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 391); if (svAxis && svAxis.y) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 391);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 392); bb.addClass(CLASS_NAMES.vertical); } @@ -520,7 +521,7 @@ * @type number * @protected */- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 401);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 402); sv._minScrollX = (rtl) ? Math.min(0, -(scrollWidth - width)) : 0; /**@@ -530,7 +531,7 @@ * @type number * @protected */- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 410);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 411); sv._maxScrollX = (rtl) ? 0 : Math.max(0, scrollWidth - width); /**@@ -540,7 +541,7 @@ * @type number * @protected */- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 419);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 420); sv._minScrollY = 0; /**@@ -550,7 +551,7 @@ * @type number * @protected */- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 428);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 429); sv._maxScrollY = Math.max(0, scrollHeight - height); }, @@ -566,14 +567,14 @@ */ scrollTo: function (x, y, duration, easing, node) { // Check to see if widget is disabled- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "scrollTo", 441);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 443);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "scrollTo", 442);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 444); if (this._cDisabled) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 444);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 445); return; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 447);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 448); var sv = this, cb = sv._cb, TRANS = ScrollView._TRANSITION,@@ -584,58 +585,58 @@ transform; // default the optional arguments- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 457);-duration = duration || 0; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 458);-easing = easing || sv.get(EASING); // @TODO: Cache this+duration = duration || 0; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 459);+easing = easing || sv.get(EASING); // @TODO: Cache this+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 460); node = node || cb; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 461);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 462); if (x !== null) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 462);-sv.set(SCROLL_X, x, {src:UI}); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 463);+sv.set(SCROLL_X, x, {src:UI});+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 464); newX = -(x); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 466);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 467); if (y !== null) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 467);-sv.set(SCROLL_Y, y, {src:UI}); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 468);+sv.set(SCROLL_Y, y, {src:UI});+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 469); newY = -(y); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 471);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 472); transform = sv._transform(newX, newY); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 473);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 474); if (NATIVE_TRANSITIONS) { // ANDROID WORKAROUND - try and stop existing transition, before kicking off new one.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 475);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 476); node.setStyle(TRANS.DURATION, ZERO).setStyle(TRANS.PROPERTY, EMPTY); } // Move- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 479);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 480); if (duration === 0) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 480);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 481); if (NATIVE_TRANSITIONS) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 481);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 482); node.setStyle('transform', transform); } else { // TODO: If both set, batch them in the same update // Update: Nope, setStyles() just loops through each property and applies it.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 486);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 487); if (x !== null) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 487);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 488); node.setStyle(LEFT, newX + PX); }- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 489);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 490); if (y !== null) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 490);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 491); node.setStyle(TOP, newY + PX); } }@@ -643,24 +644,24 @@ // Animate else {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 497);-transition.easing = easing; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 498);+transition.easing = easing;+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 499); transition.duration = duration / 1000; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 500);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 501); if (NATIVE_TRANSITIONS) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 501);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 502); transition.transform = transform; } else {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 504);-transition.left = newX + PX; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 505);+transition.left = newX + PX;+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 506); transition.top = newY + PX; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 508);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 509); node.transition(transition, callback); } },@@ -676,17 +677,17 @@ */ _transform: function (x, y) { // TODO: Would we be better off using a Matrix for this?- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_transform", 521);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 523);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_transform", 522);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 524); var prop = 'translate(' + x + 'px, ' + y + 'px)'; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 525);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 526); if (this._forceHWTransforms) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 526);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 527); prop += ' translateZ(0)'; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 529);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 530); return prop; }, @@ -700,15 +701,15 @@ * @private */ _moveTo : function(node, x, y) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_moveTo", 541);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 542);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_moveTo", 542);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 543); if (NATIVE_TRANSITIONS) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 543);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 544); node.setStyle('transform', this._transform(x, y)); } else {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 545);-node.setStyle(LEFT, x + PX); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 546);+node.setStyle(LEFT, x + PX);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 547); node.setStyle(TOP, y + PX); } },@@ -722,8 +723,8 @@ * @private */ _onTransEnd: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onTransEnd", 558);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 559);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onTransEnd", 559);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 560); var sv = this; /**@@ -732,7 +733,7 @@ * @event scrollEnd * @param e {EventFacade} The default event facade. */- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 567);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 568); sv.fire(EV_SCROLL_END); }, @@ -745,14 +746,14 @@ */ _onGestureMoveStart: function (e) { - _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onGestureMoveStart", 577);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 579);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onGestureMoveStart", 578);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 580); if (this._cDisabled) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 580);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 581); return false; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 583);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 584); var sv = this, bb = sv._bb, currentX = sv.get(SCROLL_X),@@ -760,34 +761,34 @@ clientX = e.clientX, clientY = e.clientY; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 590);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 591); if (sv._prevent.start) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 591);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 592); e.preventDefault(); } // if a flick animation is in progress, cancel it- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 595);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 596); if (sv._flickAnim) { // Cancel and delete sv._flickAnim- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 597);-sv._flickAnim.cancel(); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 598);-delete sv._flickAnim;+sv._flickAnim.cancel(); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 599);+delete sv._flickAnim;+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 600); sv._onTransEnd(); } // TODO: Review if neccesary (#2530129)- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 603);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 604); e.stopPropagation(); // Reset lastScrolledAmt- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 606);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 607); sv.lastScrolledAmt = 0; // Stores data for this gesture cycle. Cleaned up later- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 609);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 610); sv._gesture = { // Will hold the axis value@@ -828,8 +829,8 @@ * @private */ _onGestureMove: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onGestureMove", 648);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 649);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onGestureMove", 649);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 650); var sv = this, gesture = sv._gesture, svAxis = sv._cAxis,@@ -842,34 +843,34 @@ clientX = e.clientX, clientY = e.clientY; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 661);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 662); if (sv._prevent.move) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 662);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 663); e.preventDefault(); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 665);-gesture.deltaX = startClientX - clientX; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 666);+gesture.deltaX = startClientX - clientX;+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 667); gesture.deltaY = startClientY - clientY; // Determine if this is a vertical or horizontal movement // @TODO: This is crude, but it works. Investigate more intelligent ways to detect intent- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 670);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 671); if (gesture.axis === null) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 671);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 672); gesture.axis = (Math.abs(gesture.deltaX) > Math.abs(gesture.deltaY)) ? DIM_X : DIM_Y; } // Move X or Y. @TODO: Move both if dualaxis. - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 675);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 676); if (gesture.axis === DIM_X && svAxisX) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 676);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 677); sv.set(SCROLL_X, startX + gesture.deltaX); }- else {_yuitest_coverline("build/scrollview-base/scrollview-base.js", 678);+ else {_yuitest_coverline("build/scrollview-base/scrollview-base.js", 679); if (gesture.axis === DIM_Y && svAxisY) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 679);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 680); sv.set(SCROLL_Y, startY + gesture.deltaY); }} },@@ -882,47 +883,47 @@ * @private */ _onGestureMoveEnd: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onGestureMoveEnd", 690);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 691);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_onGestureMoveEnd", 691);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 692); var sv = this, gesture = sv._gesture, flick = gesture.flick, clientX = e.clientX, clientY = e.clientY; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 697);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 698); if (sv._prevent.end) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 698);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 699); e.preventDefault(); } // Store the end X/Y coordinates- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 702);-gesture.endClientX = clientX; _yuitest_coverline("build/scrollview-base/scrollview-base.js", 703);+gesture.endClientX = clientX;+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 704); gesture.endClientY = clientY; // Cleanup the event handlers- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 706);-gesture.onGestureMove.detach(); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 707);+gesture.onGestureMove.detach();+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 708); gesture.onGestureMoveEnd.detach(); // If this wasn't a flick, wrap up the gesture cycle- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 710);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 711); if (!flick) { // @TODO: Be more intelligent about this. Look at the Flick attribute to see // if it is safe to assume _flick did or didn't fire. // Then, the order _flick and _onGestureMoveEnd fire doesn't matter? // If there was movement (_onGestureMove fired)- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 716);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 717); if (gesture.deltaX !== null && gesture.deltaY !== null) { // If we're out-out-bounds, then snapback- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 719);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 720); if (sv._isOutOfBounds()) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 720);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 721); sv._snapBack(); } @@ -930,9 +931,9 @@ else { // Don't fire scrollEnd on the gesture axis is the same as paginator's // Not totally confident this is ideal to access a plugin's properties from a host, @TODO revisit- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 727);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 728); if (sv.pages && !sv.pages.get(AXIS)[gesture.axis]) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 728);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 729); sv._onTransEnd(); } }@@ -948,14 +949,14 @@ * @private */ _flick: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_flick", 742);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 743);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_flick", 743);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 744); if (this._cDisabled) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 744);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 745); return false; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 747);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 748); var sv = this, svAxis = sv._cAxis, flick = e.flick,@@ -965,16 +966,16 @@ startPosition = sv.get(axisAttr); // Sometimes flick is enabled, but drag is disabled- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 756);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 757); if (sv._gesture) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 757);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 758); sv._gesture.flick = flick; } // Prevent unneccesary firing of _flickFrame if we can't scroll on the flick axis- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 761);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 762); if (svAxis[flickAxis]) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 762);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 763); sv._flickFrame(flickVelocity, flickAxis, startPosition); } },@@ -990,8 +991,8 @@ */ _flickFrame: function (velocity, flickAxis, startPosition) { - _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_flickFrame", 775);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 777);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_flickFrame", 776);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 778); var sv = this, axisAttr = flickAxis === DIM_X ? SCROLL_X : SCROLL_Y, @@ -1021,38 +1022,38 @@ tooSlow; // If we're within the range but outside min/max, dampen the velocity- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 806);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 807); if (withinMinRange || withinMaxRange) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 807);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 808); newVelocity *= bounce; } // Is the velocity too slow to bother?- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 811);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 812); tooSlow = (Math.abs(newVelocity).toFixed(4) < 0.015); // If the velocity is too slow or we're outside the range- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 814);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 815); if (tooSlow || belowMinRange || aboveMaxRange) { // Cancel and delete sv._flickAnim- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 816);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 817); if (sv._flickAnim) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 817);-sv._flickAnim.cancel(); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 818);+sv._flickAnim.cancel();+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 819); delete sv._flickAnim; } // If we're inside the scroll area, just end- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 822);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 823); if (aboveMin && belowMax) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 823);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 824); sv._onTransEnd(); } // We're outside the scroll area, so we need to snap back else {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 828);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 829); sv._snapBack(); } }@@ -1060,9 +1061,9 @@ // Otherwise, animate to the next frame else { // @TODO: maybe use requestAnimationFrame instead- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 835);-sv._flickAnim = Y.later(frameDuration, sv, '_flickFrame', [newVelocity, flickAxis, newPosition]); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 836);+sv._flickAnim = Y.later(frameDuration, sv, '_flickFrame', [newVelocity, flickAxis, newPosition]);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 837); sv.set(axisAttr, newPosition); } },@@ -1075,8 +1076,8 @@ * @private */ _mousewheel: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_mousewheel", 847);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 848);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_mousewheel", 848);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 849); var sv = this, scrollY = sv.get(SCROLL_Y), bb = sv._bb,@@ -1084,43 +1085,43 @@ isForward = (e.wheelDelta > 0), scrollToY = scrollY - ((isForward ? 1 : -1) * scrollOffset); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 855);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 856); scrollToY = _constrain(scrollToY, sv._minScrollY, sv._maxScrollY); // Because Mousewheel events fire off 'document', every ScrollView widget will react // to any mousewheel anywhere on the page. This check will ensure that the mouse is currently // over this specific ScrollView. Also, only allow mousewheel scrolling on Y-axis, // becuase otherwise the 'prevent' will block page scrolling.- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 861);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 862); if (bb.contains(e.target) && sv._cAxis[DIM_Y]) { // Reset lastScrolledAmt- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 864);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 865); sv.lastScrolledAmt = 0; // Jump to the new offset- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 867);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 868); sv.set(SCROLL_Y, scrollToY); // if we have scrollbars plugin, update & set the flash timer on the scrollbar // @TODO: This probably shouldn't be in this module- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 871);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 872); if (sv.scrollbars) { // @TODO: The scrollbars should handle this themselves- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 873);-sv.scrollbars._update(); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 874);+sv.scrollbars._update();+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 875); sv.scrollbars.flash(); // or just this // sv.scrollbars._hostDimensionsChange(); } // Fire the 'scrollEnd' event- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 880);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 881); sv._onTransEnd(); // prevent browser default behavior on mouse scroll- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 883);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 884); e.preventDefault(); } },@@ -1135,8 +1136,8 @@ * @private */ _isOutOfBounds: function (x, y) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_isOutOfBounds", 896);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 897);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_isOutOfBounds", 897);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 898); var sv = this, svAxis = sv._cAxis, svAxisX = svAxis.x,@@ -1148,7 +1149,7 @@ maxX = sv._maxScrollX, maxY = sv._maxScrollY; - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 908);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 909); return (svAxisX && (currentX < minX || currentX > maxX)) || (svAxisY && (currentY < minY || currentY > maxY)); }, @@ -1160,8 +1161,8 @@ * @private */ _snapBack: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_snapBack", 918);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 919);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_snapBack", 919);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 920); var sv = this, currentX = sv.get(SCROLL_X), currentY = sv.get(SCROLL_Y),@@ -1174,19 +1175,19 @@ duration = sv.get(SNAP_DURATION), easing = sv.get(SNAP_EASING); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 931);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 932); if (newX !== currentX) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 932);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 933); sv.set(SCROLL_X, newX, {duration:duration, easing:easing}); }- else {_yuitest_coverline("build/scrollview-base/scrollview-base.js", 934);+ else {_yuitest_coverline("build/scrollview-base/scrollview-base.js", 935); if (newY !== currentY) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 935);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 936); sv.set(SCROLL_Y, newY, {duration:duration, easing:easing}); } else { // It shouldn't ever get here, but in case it does, fire scrollEnd- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 939);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 940); sv._onTransEnd(); }} },@@ -1200,14 +1201,14 @@ */ _afterScrollChange: function (e) { - _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterScrollChange", 950);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 952);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterScrollChange", 951);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 953); if (e.src === ScrollView.UI_SRC) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 953);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 954); return false; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 956);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 957); var sv = this, duration = e.duration, easing = e.easing,@@ -1215,30 +1216,30 @@ scrollToArgs = []; // Set the scrolled value- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 963);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 964); sv.lastScrolledAmt = sv.lastScrolledAmt + (e.newVal - e.prevVal); // Generate the array of args to pass to scrollTo()- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 966);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 967); if (e.attrName === SCROLL_X) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 967);-scrollToArgs.push(val); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 968);+scrollToArgs.push(val);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 969); scrollToArgs.push(sv.get(SCROLL_Y)); } else {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 971);-scrollToArgs.push(sv.get(SCROLL_X)); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 972);+scrollToArgs.push(sv.get(SCROLL_X));+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 973); scrollToArgs.push(val); } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 975);-scrollToArgs.push(duration); _yuitest_coverline("build/scrollview-base/scrollview-base.js", 976);+scrollToArgs.push(duration);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 977); scrollToArgs.push(easing); - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 978);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 979); sv.scrollTo.apply(sv, scrollToArgs); }, @@ -1250,8 +1251,8 @@ * @protected */ _afterFlickChange: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterFlickChange", 988);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 989);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterFlickChange", 989);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 990); this._bindFlick(e.newVal); }, @@ -1264,8 +1265,8 @@ */ _afterDisabledChange: function (e) { // Cache for performance - we check during move- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterDisabledChange", 999);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1001);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterDisabledChange", 1000);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1002); this._cDisabled = e.newVal; }, @@ -1277,8 +1278,8 @@ * @protected */ _afterAxisChange: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterAxisChange", 1011);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1012);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterAxisChange", 1012);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1013); this._cAxis = e.newVal; }, @@ -1290,8 +1291,8 @@ * @protected */ _afterDragChange: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterDragChange", 1022);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1023);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterDragChange", 1023);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1024); this._bindDrag(e.newVal); }, @@ -1303,8 +1304,8 @@ * @protected */ _afterDimChange: function () {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterDimChange", 1033);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1034);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterDimChange", 1034);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1035); this._uiDimensionsChange(); }, @@ -1316,26 +1317,26 @@ * @protected */ _afterScrollEnd: function (e) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterScrollEnd", 1044);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1045);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_afterScrollEnd", 1045);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1046); var sv = this; // @TODO: Move to sv._cancelFlick()- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1048);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1049); if (sv._flickAnim) { // Cancel the flick (if it exists)- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1050);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1051); sv._flickAnim.cancel(); // Also delete it, otherwise _onGestureMoveStart will think we're still flicking- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1053);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1054); delete sv._flickAnim; } // If for some reason we're OOB, snapback- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1057);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1058); if (sv._isOutOfBounds()) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1058);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1059); sv._snapBack(); } @@ -1357,10 +1358,10 @@ _axisSetter: function (val, name) { // Turn a string into an axis object- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_axisSetter", 1076);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1079);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_axisSetter", 1077);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1080); if (Y.Lang.isString(val)) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1080);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1081); return { x: val.match(/x/i) ? true : false, y: val.match(/y/i) ? true : false@@ -1381,14 +1382,14 @@ _setScroll : function(val, dim) { // Just ensure the widget is not disabled- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_setScroll", 1097);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1100);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_setScroll", 1098);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1101); if (this._cDisabled) {- _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1101);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1102); val = Y.Attribute.INVALID_VALUE; } - _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1104);+ _yuitest_coverline("build/scrollview-base/scrollview-base.js", 1105); return val; }, @@ -1401,8 +1402,8 @@ * @protected */ _setScrollX: function(val) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_setScrollX", 1115);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1116);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_setScrollX", 1116);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1117); return this._setScroll(val, DIM_X); }, @@ -1415,8 +1416,8 @@ * @protected */ _setScrollY: function(val) {- _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_setScrollY", 1127);-_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1128);+ _yuitest_coverfunc("build/scrollview-base/scrollview-base.js", "_setScrollY", 1128);+_yuitest_coverline("build/scrollview-base/scrollview-base.js", 1129); return this._setScroll(val, DIM_Y); } @@ -1618,8 +1619,8 @@ * @private */ _TRANSITION: {- DURATION: Y.Transition._VENDOR_PREFIX + 'TransitionDuration',- PROPERTY: Y.Transition._VENDOR_PREFIX + 'TransitionProperty'+ DURATION: (vendorPrefix ? vendorPrefix + 'TransitionDuration' : 'transitionDuration'),+ PROPERTY: (vendorPrefix ? vendorPrefix + 'TransitionProperty' : 'transitionProperty') }, /**@@ -1681,4 +1682,4 @@ }); -}, '3.7.2', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});
bundle/scrollview-base/scrollview-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,6 +17,7 @@ WINDOW = Y.config.win, IE = Y.UA.ie, NATIVE_TRANSITIONS = Y.Transition.useNative,+ vendorPrefix = Y.Transition._VENDOR_PREFIX, // Todo: This is a private property, and alternative approaches should be investigated SCROLLVIEW = 'scrollview', CLASS_NAMES = { vertical: getClassName(SCROLLVIEW, 'vert'),@@ -1332,8 +1333,8 @@ * @private */ _TRANSITION: {- DURATION: Y.Transition._VENDOR_PREFIX + 'TransitionDuration',- PROPERTY: Y.Transition._VENDOR_PREFIX + 'TransitionProperty'+ DURATION: (vendorPrefix ? vendorPrefix + 'TransitionDuration' : 'transitionDuration'),+ PROPERTY: (vendorPrefix ? vendorPrefix + 'TransitionProperty' : 'transitionProperty') }, /**@@ -1395,4 +1396,4 @@ }); -}, '3.7.2', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});
bundle/scrollview-base/scrollview-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("scrollview-base",function(e,t){function q(){q.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r=e.config.doc,i=e.config.win,s=e.UA.ie,o=e.Transition.useNative,u="scrollview",a={vertical:n(u,"vert"),horizontal:n(u,"horiz")},f="scrollEnd",l="flick",c="drag",h="mousewheel",p="ui",d="top",v="right",m="bottom",g="left",y="px",b="axis",w="scrollY",E="scrollX",S="bounce",x="disabled",T="deceleration",N="x",C="y",k="boundingBox",L="contentBox",A="gesturemove",O="start",M="end",_="",D="0s",P="snapDuration",H="snapEasing",B="easing",j="frameDuration",F="bounceRange",I=function(e,t,n){return Math.min(Math.max(e,t),n)};e.ScrollView=e.extend(q,e.Widget,{_forceHWTransforms:e.UA.webkit?!0:!1,_prevent:{start:!1,move:!0,end:!1},lastScrolledAmt:0,initializer:function(e){var t=this;t._bb=t.get(k),t._cb=t.get(L),t._cAxis=t.get(b),t._cBounce=t.get(S),t._cBounceRange=t.get(F),t._cDeceleration=t.get(T),t._cFrameDuration=t.get(j)},bindUI:function(){var e=this;e._bindFlick(e.get(l)),e._bindDrag(e.get(c)),e._bindMousewheel(!0),e._bindAttrs(),s&&e._fixIESelect(e._bb,e._cb),q.SNAP_DURATION&&e.set(P,q.SNAP_DURATION),q.SNAP_EASING&&e.set(H,q.SNAP_EASING),q.EASING&&e.set(B,q.EASING),q.FRAME_STEP&&e.set(j,q.FRAME_STEP),q.BOUNCE_RANGE&&e.set(F,q.BOUNCE_RANGE)},_bindAttrs:function(){var e=this,t=e._afterScrollChange,n=e._afterDimChange;e.after({scrollEnd:e._afterScrollEnd,disabledChange:e._afterDisabledChange,flickChange:e._afterFlickChange,dragChange:e._afterDragChange,axisChange:e._afterAxisChange,scrollYChange:t,scrollXChange:t,heightChange:n,widthChange:n})},_bindDrag:function(t){var n=this,r=n._bb;r.detach(c+"|*"),t&&r.on(c+"|"+A+O,e.bind(n._onGestureMoveStart,n))},_bindFlick:function(t){var n=this,r=n._bb;r.detach(l+"|*"),t&&(r.on(l+"|"+l,e.bind(n._flick,n),t),n._bindDrag(n.get(c)))},_bindMousewheel:function(t){var n=this,i=n._bb;i.detach(h+"|*"),t&&e.one(r).on(h,e.bind(n._mousewheel,n))},syncUI:function(){var e=this,t=e._getScrollDims(),n=t.offsetWidth,r=t.offsetHeight,i=t.scrollWidth,s=t.scrollHeight;e._cAxis===undefined&&(e._cAxis={x:i>n,y:s>r},e._set(b,e._cAxis)),e.rtl=e._cb.getComputedStyle("direction")==="rtl",e._cDisabled=e.get(x),e._uiDimensionsChange(),e._isOutOfBounds()&&e._snapBack()},_getScrollDims:function(){var e=this,t=e._cb,n=e._bb,r=q._TRANSITION,i=e.get(E),s=e.get(w),u,a;return o&&(t.setStyle(r.DURATION,D),t.setStyle(r.PROPERTY,_)),u=e._forceHWTransforms,e._forceHWTransforms=!1,e._moveTo(t,0,0),a={offsetWidth:n.get("offsetWidth"),offsetHeight:n.get("offsetHeight"),scrollWidth:n.get("scrollWidth"),scrollHeight:n.get("scrollHeight")},e._moveTo(t,-i,-s),e._forceHWTransforms=u,a},_uiDimensionsChange:function(){var e=this,t=e._bb,n=e._getScrollDims(),r=n.offsetWidth,i=n.offsetHeight,s=n.scrollWidth,o=n.scrollHeight,u=e.rtl,f=e._cAxis;f&&f.x&&t.addClass(a.horizontal),f&&f.y&&t.addClass(a.vertical),e._minScrollX=u?Math.min(0,-(s-r)):0,e._maxScrollX=u?0:Math.max(0,s-r),e._minScrollY=0,e._maxScrollY=Math.max(0,o-i)},scrollTo:function(t,n,r,i,s){if(this._cDisabled)return;var u=this,a=u._cb,f=q._TRANSITION,l=e.bind(u._onTransEnd,u),c=0,h=0,v={},m;r=r||0,i=i||u.get(B),s=s||a,t!==null&&(u.set(E,t,{src:p}),c=-t),n!==null&&(u.set(w,n,{src:p}),h=-n),m=u._transform(c,h),o&&s.setStyle(f.DURATION,D).setStyle(f.PROPERTY,_),r===0?o?s.setStyle("transform",m):(t!==null&&s.setStyle(g,c+y),n!==null&&s.setStyle(d,h+y)):(v.easing=i,v.duration=r/1e3,o?v.transform=m:(v.left=c+y,v.top=h+y),s.transition(v,l))},_transform:function(e,t){var n="translate("+e+"px, "+t+"px)";return this._forceHWTransforms&&(n+=" translateZ(0)"),n},_moveTo:function(e,t,n){o?e.setStyle("transform",this._transform(t,n)):(e.setStyle(g,t+y),e.setStyle(d,n+y))},_onTransEnd:function(e){var t=this;t.fire(f)},_onGestureMoveStart:function(t){if(this._cDisabled)return!1;var n=this,r=n._bb,i=n.get(E),s=n.get(w),o=t.clientX,u=t.clientY;n._prevent.start&&t.preventDefault(),n._flickAnim&&(n._flickAnim.cancel(),delete n._flickAnim,n._onTransEnd()),t.stopPropagation(),n.lastScrolledAmt=0,n._gesture={axis:null,startX:i,startY:s,startClientX:o,startClientY:u,endClientX:null,endClientY:null,deltaX:null,deltaY:null,flick:null,onGestureMove:r.on(c+"|"+A,e.bind(n._onGestureMove,n)),onGestureMoveEnd:r.on(c+"|"+A+M,e.bind(n._onGestureMoveEnd,n))}},_onGestureMove:function(e){var t=this,n=t._gesture,r=t._cAxis,i=r.x,s=r.y,o=n.startX,u=n.startY,a=n.startClientX,f=n.startClientY,l=e.clientX,c=e.clientY;t._prevent.move&&e.preventDefault(),n.deltaX=a-l,n.deltaY=f-c,n.axis===null&&(n.axis=Math.abs(n.deltaX)>Math.abs(n.deltaY)?N:C),n.axis===N&&i?t.set(E,o+n.deltaX):n.axis===C&&s&&t.set(w,u+n.deltaY)},_onGestureMoveEnd:function(e){var t=this,n=t._gesture,r=n.flick,i=e.clientX,s=e.clientY;t._prevent.end&&e.preventDefault(),n.endClientX=i,n.endClientY=s,n.onGestureMove.detach(),n.onGestureMoveEnd.detach(),r||n.deltaX!==null&&n.deltaY!==null&&(t._isOutOfBounds()?t._snapBack():t.pages&&!t.pages.get(b)[n.axis]&&t._onTransEnd())},_flick:function(e){if(this._cDisabled)return!1;var t=this,n=t._cAxis,r=e.flick,i=r.axis,s=r.velocity,o=i===N?E:w,u=t.get(o);t._gesture&&(t._gesture.flick=r),n[i]&&t._flickFrame(s,i,u)},_flickFrame:function(t,n,r){var i=this,s=n===N?E:w,o=i._cBounce,u=i._cBounceRange,a=i._cDeceleration,f=i._cFrameDuration,l=t*a,c=r-f*l,h=n===N?i._minScrollX:i._minScrollY,p=n===N?i._maxScrollX:i._maxScrollY,d=c<h,v=c<p,m=c>h,g=c>p,y=c<h-u,b=c<p+u,S=d&&c>h-u,x=g&&c<p+u,T=c>h-u,C=c>p+u,k;if(S||x)l*=o;k=Math.abs(l).toFixed(4)<.015,k||y||C?(i._flickAnim&&(i._flickAnim.cancel(),delete i._flickAnim),m&&v?i._onTransEnd():i._snapBack()):(i._flickAnim=e.later(f,i,"_flickFrame",[l,n,c]),i.set(s,c))},_mousewheel:function(e){var t=this,n=t.get(w),r=t._bb,i=10,s=e.wheelDelta>0,o=n-(s?1:-1)*i;o=I(o,t._minScrollY,t._maxScrollY),r.contains(e.target)&&t._cAxis[C]&&(t.lastScrolledAmt=0,t.set(w,o),t.scrollbars&&(t.scrollbars._update(),t.scrollbars.flash()),t._onTransEnd(),e.preventDefault())},_isOutOfBounds:function(e,t){var n=this,r=n._cAxis,i=r.x,s=r.y,o=e||n.get(E),u=t||n.get(w),a=n._minScrollX,f=n._minScrollY,l=n._maxScrollX,c=n._maxScrollY;return i&&(o<a||o>l)||s&&(u<f||u>c)},_snapBack:function(){var e=this,t=e.get(E),n=e.get(w),r=e._minScrollX,i=e._minScrollY,s=e._maxScrollX,o=e._maxScrollY,u=I(n,i,o),a=I(t,r,s),f=e.get(P),l=e.get(H);a!==t?e.set(E,a,{duration:f,easing:l}):u!==n?e.set(w,u,{duration:f,easing:l}):e._onTransEnd()},_afterScrollChange:function(e){if(e.src===q.UI_SRC)return!1;var t=this,n=e.duration,r=e.easing,i=e.newVal,s=[];t.lastScrolledAmt=t.lastScrolledAmt+(e.newVal-e.prevVal),e.attrName===E?(s.push(i),s.push(t.get(w))):(s.push(t.get(E)),s.push(i)),s.push(n),s.push(r),t.scrollTo.apply(t,s)},_afterFlickChange:function(e){this._bindFlick(e.newVal)},_afterDisabledChange:function(e){this._cDisabled=e.newVal},_afterAxisChange:function(e){this._cAxis=e.newVal},_afterDragChange:function(e){this._bindDrag(e.newVal)},_afterDimChange:function(){this._uiDimensionsChange()},_afterScrollEnd:function(e){var t=this;t._flickAnim&&(t._flickAnim.cancel(),delete t._flickAnim),t._isOutOfBounds()&&t._snapBack()},_axisSetter:function(t,n){if(e.Lang.isString(t))return{x:t.match(/x/i)?!0:!1,y:t.match(/y/i)?!0:!1}},_setScroll:function(t,n){return this._cDisabled&&(t=e.Attribute.INVALID_VALUE),t},_setScrollX:function(e){return this._setScroll(e,N)},_setScrollY:function(e){return this._setScroll(e,C)}},{NAME:"scrollview",ATTRS:{axis:{setter:"_axisSetter",writeOnce:"initOnly"},scrollX:{value:0,setter:"_setScrollX"},scrollY:{value:0,setter:"_setScrollY"},deceleration:{value:.93},bounce:{value:.1},flick:{value:{minDistance:10,minVelocity:.3}},drag:{value:!0},snapDuration:{value:400},snapEasing:{value:"ease-out"},easing:{value:"cubic-bezier(0, 0.1, 0, 1.0)"},frameDuration:{value:15},bounceRange:{value:150}},CLASS_NAMES:a,UI_SRC:p,_TRANSITION:{DURATION:e.Transition._VENDOR_PREFIX+"TransitionDuration",PROPERTY:e.Transition._VENDOR_PREFIX+"TransitionProperty"},BOUNCE_RANGE:!1,FRAME_STEP:!1,EASING:!1,SNAP_EASING:!1,SNAP_DURATION:!1})},"3.7.2",{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0});+YUI.add("scrollview-base",function(e,t){function R(){R.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r=e.config.doc,i=e.config.win,s=e.UA.ie,o=e.Transition.useNative,u=e.Transition._VENDOR_PREFIX,a="scrollview",f={vertical:n(a,"vert"),horizontal:n(a,"horiz")},l="scrollEnd",c="flick",h="drag",p="mousewheel",d="ui",v="top",m="right",g="bottom",y="left",b="px",w="axis",E="scrollY",S="scrollX",x="bounce",T="disabled",N="deceleration",C="x",k="y",L="boundingBox",A="contentBox",O="gesturemove",M="start",_="end",D="",P="0s",H="snapDuration",B="snapEasing",j="easing",F="frameDuration",I="bounceRange",q=function(e,t,n){return Math.min(Math.max(e,t),n)};e.ScrollView=e.extend(R,e.Widget,{_forceHWTransforms:e.UA.webkit?!0:!1,_prevent:{start:!1,move:!0,end:!1},lastScrolledAmt:0,initializer:function(e){var t=this;t._bb=t.get(L),t._cb=t.get(A),t._cAxis=t.get(w),t._cBounce=t.get(x),t._cBounceRange=t.get(I),t._cDeceleration=t.get(N),t._cFrameDuration=t.get(F)},bindUI:function(){var e=this;e._bindFlick(e.get(c)),e._bindDrag(e.get(h)),e._bindMousewheel(!0),e._bindAttrs(),s&&e._fixIESelect(e._bb,e._cb),R.SNAP_DURATION&&e.set(H,R.SNAP_DURATION),R.SNAP_EASING&&e.set(B,R.SNAP_EASING),R.EASING&&e.set(j,R.EASING),R.FRAME_STEP&&e.set(F,R.FRAME_STEP),R.BOUNCE_RANGE&&e.set(I,R.BOUNCE_RANGE)},_bindAttrs:function(){var e=this,t=e._afterScrollChange,n=e._afterDimChange;e.after({scrollEnd:e._afterScrollEnd,disabledChange:e._afterDisabledChange,flickChange:e._afterFlickChange,dragChange:e._afterDragChange,axisChange:e._afterAxisChange,scrollYChange:t,scrollXChange:t,heightChange:n,widthChange:n})},_bindDrag:function(t){var n=this,r=n._bb;r.detach(h+"|*"),t&&r.on(h+"|"+O+M,e.bind(n._onGestureMoveStart,n))},_bindFlick:function(t){var n=this,r=n._bb;r.detach(c+"|*"),t&&(r.on(c+"|"+c,e.bind(n._flick,n),t),n._bindDrag(n.get(h)))},_bindMousewheel:function(t){var n=this,i=n._bb;i.detach(p+"|*"),t&&e.one(r).on(p,e.bind(n._mousewheel,n))},syncUI:function(){var e=this,t=e._getScrollDims(),n=t.offsetWidth,r=t.offsetHeight,i=t.scrollWidth,s=t.scrollHeight;e._cAxis===undefined&&(e._cAxis={x:i>n,y:s>r},e._set(w,e._cAxis)),e.rtl=e._cb.getComputedStyle("direction")==="rtl",e._cDisabled=e.get(T),e._uiDimensionsChange(),e._isOutOfBounds()&&e._snapBack()},_getScrollDims:function(){var e=this,t=e._cb,n=e._bb,r=R._TRANSITION,i=e.get(S),s=e.get(E),u,a;return o&&(t.setStyle(r.DURATION,P),t.setStyle(r.PROPERTY,D)),u=e._forceHWTransforms,e._forceHWTransforms=!1,e._moveTo(t,0,0),a={offsetWidth:n.get("offsetWidth"),offsetHeight:n.get("offsetHeight"),scrollWidth:n.get("scrollWidth"),scrollHeight:n.get("scrollHeight")},e._moveTo(t,-i,-s),e._forceHWTransforms=u,a},_uiDimensionsChange:function(){var e=this,t=e._bb,n=e._getScrollDims(),r=n.offsetWidth,i=n.offsetHeight,s=n.scrollWidth,o=n.scrollHeight,u=e.rtl,a=e._cAxis;a&&a.x&&t.addClass(f.horizontal),a&&a.y&&t.addClass(f.vertical),e._minScrollX=u?Math.min(0,-(s-r)):0,e._maxScrollX=u?0:Math.max(0,s-r),e._minScrollY=0,e._maxScrollY=Math.max(0,o-i)},scrollTo:function(t,n,r,i,s){if(this._cDisabled)return;var u=this,a=u._cb,f=R._TRANSITION,l=e.bind(u._onTransEnd,u),c=0,h=0,p={},m;r=r||0,i=i||u.get(j),s=s||a,t!==null&&(u.set(S,t,{src:d}),c=-t),n!==null&&(u.set(E,n,{src:d}),h=-n),m=u._transform(c,h),o&&s.setStyle(f.DURATION,P).setStyle(f.PROPERTY,D),r===0?o?s.setStyle("transform",m):(t!==null&&s.setStyle(y,c+b),n!==null&&s.setStyle(v,h+b)):(p.easing=i,p.duration=r/1e3,o?p.transform=m:(p.left=c+b,p.top=h+b),s.transition(p,l))},_transform:function(e,t){var n="translate("+e+"px, "+t+"px)";return this._forceHWTransforms&&(n+=" translateZ(0)"),n},_moveTo:function(e,t,n){o?e.setStyle("transform",this._transform(t,n)):(e.setStyle(y,t+b),e.setStyle(v,n+b))},_onTransEnd:function(e){var t=this;t.fire(l)},_onGestureMoveStart:function(t){if(this._cDisabled)return!1;var n=this,r=n._bb,i=n.get(S),s=n.get(E),o=t.clientX,u=t.clientY;n._prevent.start&&t.preventDefault(),n._flickAnim&&(n._flickAnim.cancel(),delete n._flickAnim,n._onTransEnd()),t.stopPropagation(),n.lastScrolledAmt=0,n._gesture={axis:null,startX:i,startY:s,startClientX:o,startClientY:u,endClientX:null,endClientY:null,deltaX:null,deltaY:null,flick:null,onGestureMove:r.on(h+"|"+O,e.bind(n._onGestureMove,n)),onGestureMoveEnd:r.on(h+"|"+O+_,e.bind(n._onGestureMoveEnd,n))}},_onGestureMove:function(e){var t=this,n=t._gesture,r=t._cAxis,i=r.x,s=r.y,o=n.startX,u=n.startY,a=n.startClientX,f=n.startClientY,l=e.clientX,c=e.clientY;t._prevent.move&&e.preventDefault(),n.deltaX=a-l,n.deltaY=f-c,n.axis===null&&(n.axis=Math.abs(n.deltaX)>Math.abs(n.deltaY)?C:k),n.axis===C&&i?t.set(S,o+n.deltaX):n.axis===k&&s&&t.set(E,u+n.deltaY)},_onGestureMoveEnd:function(e){var t=this,n=t._gesture,r=n.flick,i=e.clientX,s=e.clientY;t._prevent.end&&e.preventDefault(),n.endClientX=i,n.endClientY=s,n.onGestureMove.detach(),n.onGestureMoveEnd.detach(),r||n.deltaX!==null&&n.deltaY!==null&&(t._isOutOfBounds()?t._snapBack():t.pages&&!t.pages.get(w)[n.axis]&&t._onTransEnd())},_flick:function(e){if(this._cDisabled)return!1;var t=this,n=t._cAxis,r=e.flick,i=r.axis,s=r.velocity,o=i===C?S:E,u=t.get(o);t._gesture&&(t._gesture.flick=r),n[i]&&t._flickFrame(s,i,u)},_flickFrame:function(t,n,r){var i=this,s=n===C?S:E,o=i._cBounce,u=i._cBounceRange,a=i._cDeceleration,f=i._cFrameDuration,l=t*a,c=r-f*l,h=n===C?i._minScrollX:i._minScrollY,p=n===C?i._maxScrollX:i._maxScrollY,d=c<h,v=c<p,m=c>h,g=c>p,y=c<h-u,b=c<p+u,w=d&&c>h-u,x=g&&c<p+u,T=c>h-u,N=c>p+u,k;if(w||x)l*=o;k=Math.abs(l).toFixed(4)<.015,k||y||N?(i._flickAnim&&(i._flickAnim.cancel(),delete i._flickAnim),m&&v?i._onTransEnd():i._snapBack()):(i._flickAnim=e.later(f,i,"_flickFrame",[l,n,c]),i.set(s,c))},_mousewheel:function(e){var t=this,n=t.get(E),r=t._bb,i=10,s=e.wheelDelta>0,o=n-(s?1:-1)*i;o=q(o,t._minScrollY,t._maxScrollY),r.contains(e.target)&&t._cAxis[k]&&(t.lastScrolledAmt=0,t.set(E,o),t.scrollbars&&(t.scrollbars._update(),t.scrollbars.flash()),t._onTransEnd(),e.preventDefault())},_isOutOfBounds:function(e,t){var n=this,r=n._cAxis,i=r.x,s=r.y,o=e||n.get(S),u=t||n.get(E),a=n._minScrollX,f=n._minScrollY,l=n._maxScrollX,c=n._maxScrollY;return i&&(o<a||o>l)||s&&(u<f||u>c)},_snapBack:function(){var e=this,t=e.get(S),n=e.get(E),r=e._minScrollX,i=e._minScrollY,s=e._maxScrollX,o=e._maxScrollY,u=q(n,i,o),a=q(t,r,s),f=e.get(H),l=e.get(B);a!==t?e.set(S,a,{duration:f,easing:l}):u!==n?e.set(E,u,{duration:f,easing:l}):e._onTransEnd()},_afterScrollChange:function(e){if(e.src===R.UI_SRC)return!1;var t=this,n=e.duration,r=e.easing,i=e.newVal,s=[];t.lastScrolledAmt=t.lastScrolledAmt+(e.newVal-e.prevVal),e.attrName===S?(s.push(i),s.push(t.get(E))):(s.push(t.get(S)),s.push(i)),s.push(n),s.push(r),t.scrollTo.apply(t,s)},_afterFlickChange:function(e){this._bindFlick(e.newVal)},_afterDisabledChange:function(e){this._cDisabled=e.newVal},_afterAxisChange:function(e){this._cAxis=e.newVal},_afterDragChange:function(e){this._bindDrag(e.newVal)},_afterDimChange:function(){this._uiDimensionsChange()},_afterScrollEnd:function(e){var t=this;t._flickAnim&&(t._flickAnim.cancel(),delete t._flickAnim),t._isOutOfBounds()&&t._snapBack()},_axisSetter:function(t,n){if(e.Lang.isString(t))return{x:t.match(/x/i)?!0:!1,y:t.match(/y/i)?!0:!1}},_setScroll:function(t,n){return this._cDisabled&&(t=e.Attribute.INVALID_VALUE),t},_setScrollX:function(e){return this._setScroll(e,C)},_setScrollY:function(e){return this._setScroll(e,k)}},{NAME:"scrollview",ATTRS:{axis:{setter:"_axisSetter",writeOnce:"initOnly"},scrollX:{value:0,setter:"_setScrollX"},scrollY:{value:0,setter:"_setScrollY"},deceleration:{value:.93},bounce:{value:.1},flick:{value:{minDistance:10,minVelocity:.3}},drag:{value:!0},snapDuration:{value:400},snapEasing:{value:"ease-out"},easing:{value:"cubic-bezier(0, 0.1, 0, 1.0)"},frameDuration:{value:15},bounceRange:{value:150}},CLASS_NAMES:f,UI_SRC:d,_TRANSITION:{DURATION:u?u+"TransitionDuration":"transitionDuration",PROPERTY:u?u+"TransitionProperty":"transitionProperty"},BOUNCE_RANGE:!1,FRAME_STEP:!1,EASING:!1,SNAP_EASING:!1,SNAP_DURATION:!1})},"3.7.3",{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0});
bundle/scrollview-base/scrollview-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,6 +17,7 @@ WINDOW = Y.config.win, IE = Y.UA.ie, NATIVE_TRANSITIONS = Y.Transition.useNative,+ vendorPrefix = Y.Transition._VENDOR_PREFIX, // Todo: This is a private property, and alternative approaches should be investigated SCROLLVIEW = 'scrollview', CLASS_NAMES = { vertical: getClassName(SCROLLVIEW, 'vert'),@@ -1332,8 +1333,8 @@ * @private */ _TRANSITION: {- DURATION: Y.Transition._VENDOR_PREFIX + 'TransitionDuration',- PROPERTY: Y.Transition._VENDOR_PREFIX + 'TransitionProperty'+ DURATION: (vendorPrefix ? vendorPrefix + 'TransitionDuration' : 'transitionDuration'),+ PROPERTY: (vendorPrefix ? vendorPrefix + 'TransitionProperty' : 'transitionProperty') }, /**@@ -1395,4 +1396,4 @@ }); -}, '3.7.2', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "event-gestures", "event-mousewheel", "transition"], "skinnable": true});
bundle/scrollview-list/assets/scrollview-list-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-list/assets/skins/night/scrollview-list-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-list/assets/skins/night/scrollview-list.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-list/assets/skins/sam/scrollview-list-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-list/assets/skins/sam/scrollview-list.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-list/scrollview-list-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/scrollview-list/scrollview-list.js", code: [] };-_yuitest_coverage["build/scrollview-list/scrollview-list.js"].code=["YUI.add('scrollview-list', function (Y, NAME) {","","/**"," * Provides a plugin, which adds support for a scroll indicator to ScrollView instances"," *"," * @module scrollview-list"," */","var getCN = Y.ClassNameManager.getClassName,","SCROLLVIEW = 'scrollview',","LIST_CLASS = getCN(SCROLLVIEW, 'list'),","ITEM_CLASS = getCN(SCROLLVIEW, 'item'),","CONTENT_BOX = \"contentBox\",","RENDERED = 'rendered',","RENDER_UI = 'renderUI',","HOST = \"host\";","","/**"," * ScrollView plugin that adds class names to immediate descendant \"<li>\" to "," * allow for easier styling through CSS"," *"," * @class ScrollViewList"," * @namespace Plugin"," * @extends Plugin.Base"," * @constructor"," */","function ListPlugin() {"," ListPlugin.superclass.constructor.apply(this, arguments);","}",""," ","/**"," * The identity of the plugin"," *"," * @property NAME"," * @type String"," * @default 'pluginList'"," * @static"," */","ListPlugin.NAME = 'pluginList';"," ","/**"," * The namespace on which the plugin will reside."," *"," * @property NS"," * @type String"," * @default 'list'"," * @static"," */","ListPlugin.NS = 'list';","","","/**"," * The default attribute configuration for the plugin"," *"," * @property ATTRS"," * @type Object"," * @static"," */","ListPlugin.ATTRS = {"," "," /**"," * Specifies whether the list elements (the immediate <ul>'s and the immediate <li>'s inside those <ul>'s) have class names attached to them or not"," *"," * @attribute isAttached"," * @type boolean"," * @deprecated No real use for this attribute on the public API"," */"," isAttached: {"," value:false,"," validator: Y.Lang.isBoolean"," }","};","","Y.namespace(\"Plugin\").ScrollViewList = Y.extend(ListPlugin, Y.Plugin.Base, {",""," /**"," * Designated initializer"," *"," * @method initializer"," */"," initializer: function() {"," this._host = this.get(HOST);"," this.afterHostEvent(\"render\", this._addClassesToList);"," },",""," _addClassesToList: function() {"," if (!this.get('isAttached')) {"," var cb = this._host.get(CONTENT_BOX),"," ulList,"," liList;",""," if (cb.hasChildNodes()) {"," //get all direct descendants of the UL's that are directly under the content box."," ulList = cb.all('> ul');"," liList = cb.all('> ul > li');",""," //go through the UL's and add the class"," ulList.each(function(list) {"," list.addClass(LIST_CLASS);"," });",""," //go through LI's and add the class"," liList.each(function(item) {"," item.addClass(ITEM_CLASS);"," });",""," this.set('isAttached', true);"," "," // We need to call this again, since sv-list "," // relies on the \"-vert\" class, to apply padding."," // [ 1st syncUI pass applies -vert, 2nd pass re-calcs dims ] "," this._host.syncUI();"," }"," }"," }","","});","","","","","","","","","","","","","}, '3.7.2', {\"requires\": [\"plugin\", \"classnamemanager\"], \"skinnable\": true});"];+_yuitest_coverage["build/scrollview-list/scrollview-list.js"].code=["YUI.add('scrollview-list', function (Y, NAME) {","","/**"," * Provides a plugin, which adds support for a scroll indicator to ScrollView instances"," *"," * @module scrollview-list"," */","var getCN = Y.ClassNameManager.getClassName,","SCROLLVIEW = 'scrollview',","LIST_CLASS = getCN(SCROLLVIEW, 'list'),","ITEM_CLASS = getCN(SCROLLVIEW, 'item'),","CONTENT_BOX = \"contentBox\",","RENDERED = 'rendered',","RENDER_UI = 'renderUI',","HOST = \"host\";","","/**"," * ScrollView plugin that adds class names to immediate descendant \"<li>\" to "," * allow for easier styling through CSS"," *"," * @class ScrollViewList"," * @namespace Plugin"," * @extends Plugin.Base"," * @constructor"," */","function ListPlugin() {"," ListPlugin.superclass.constructor.apply(this, arguments);","}",""," ","/**"," * The identity of the plugin"," *"," * @property NAME"," * @type String"," * @default 'pluginList'"," * @static"," */","ListPlugin.NAME = 'pluginList';"," ","/**"," * The namespace on which the plugin will reside."," *"," * @property NS"," * @type String"," * @default 'list'"," * @static"," */","ListPlugin.NS = 'list';","","","/**"," * The default attribute configuration for the plugin"," *"," * @property ATTRS"," * @type Object"," * @static"," */","ListPlugin.ATTRS = {"," "," /**"," * Specifies whether the list elements (the immediate <ul>'s and the immediate <li>'s inside those <ul>'s) have class names attached to them or not"," *"," * @attribute isAttached"," * @type boolean"," * @deprecated No real use for this attribute on the public API"," */"," isAttached: {"," value:false,"," validator: Y.Lang.isBoolean"," }","};","","Y.namespace(\"Plugin\").ScrollViewList = Y.extend(ListPlugin, Y.Plugin.Base, {",""," /**"," * Designated initializer"," *"," * @method initializer"," */"," initializer: function() {"," this._host = this.get(HOST);"," this.afterHostEvent(\"render\", this._addClassesToList);"," },",""," _addClassesToList: function() {"," if (!this.get('isAttached')) {"," var cb = this._host.get(CONTENT_BOX),"," ulList,"," liList;",""," if (cb.hasChildNodes()) {"," //get all direct descendants of the UL's that are directly under the content box."," ulList = cb.all('> ul');"," liList = cb.all('> ul > li');",""," //go through the UL's and add the class"," ulList.each(function(list) {"," list.addClass(LIST_CLASS);"," });",""," //go through LI's and add the class"," liList.each(function(item) {"," item.addClass(ITEM_CLASS);"," });",""," this.set('isAttached', true);"," "," // We need to call this again, since sv-list "," // relies on the \"-vert\" class, to apply padding."," // [ 1st syncUI pass applies -vert, 2nd pass re-calcs dims ] "," this._host.syncUI();"," }"," }"," }","","});","","","","","","","","","","","","","}, '3.7.3', {\"requires\": [\"plugin\", \"classnamemanager\"], \"skinnable\": true});"]; _yuitest_coverage["build/scrollview-list/scrollview-list.js"].lines = {"1":0,"8":0,"26":0,"27":0,"39":0,"49":0,"59":0,"74":0,"82":0,"83":0,"87":0,"88":0,"92":0,"94":0,"95":0,"98":0,"99":0,"103":0,"104":0,"107":0,"112":0}; _yuitest_coverage["build/scrollview-list/scrollview-list.js"].functions = {"ListPlugin:26":0,"initializer:81":0,"(anonymous 2):98":0,"(anonymous 3):103":0,"_addClassesToList:86":0,"(anonymous 1):1":0}; _yuitest_coverage["build/scrollview-list/scrollview-list.js"].coveredLines = 21;@@ -193,4 +193,4 @@ -}, '3.7.2', {"requires": ["plugin", "classnamemanager"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "classnamemanager"], "skinnable": true});
bundle/scrollview-list/scrollview-list-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -133,4 +133,4 @@ -}, '3.7.2', {"requires": ["plugin", "classnamemanager"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "classnamemanager"], "skinnable": true});
bundle/scrollview-list/scrollview-list-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("scrollview-list",function(e,t){function l(){l.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="scrollview",i=n(r,"list"),s=n(r,"item"),o="contentBox",u="rendered",a="renderUI",f="host";l.NAME="pluginList",l.NS="list",l.ATTRS={isAttached:{value:!1,validator:e.Lang.isBoolean}},e.namespace("Plugin").ScrollViewList=e.extend(l,e.Plugin.Base,{initializer:function(){this._host=this.get(f),this.afterHostEvent("render",this._addClassesToList)},_addClassesToList:function(){if(!this.get("isAttached")){var e=this._host.get(o),t,n;e.hasChildNodes()&&(t=e.all("> ul"),n=e.all("> ul > li"),t.each(function(e){e.addClass(i)}),n.each(function(e){e.addClass(s)}),this.set("isAttached",!0),this._host.syncUI())}}})},"3.7.2",{requires:["plugin","classnamemanager"],skinnable:!0});+YUI.add("scrollview-list",function(e,t){function l(){l.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="scrollview",i=n(r,"list"),s=n(r,"item"),o="contentBox",u="rendered",a="renderUI",f="host";l.NAME="pluginList",l.NS="list",l.ATTRS={isAttached:{value:!1,validator:e.Lang.isBoolean}},e.namespace("Plugin").ScrollViewList=e.extend(l,e.Plugin.Base,{initializer:function(){this._host=this.get(f),this.afterHostEvent("render",this._addClassesToList)},_addClassesToList:function(){if(!this.get("isAttached")){var e=this._host.get(o),t,n;e.hasChildNodes()&&(t=e.all("> ul"),n=e.all("> ul > li"),t.each(function(e){e.addClass(i)}),n.each(function(e){e.addClass(s)}),this.set("isAttached",!0),this._host.syncUI())}}})},"3.7.3",{requires:["plugin","classnamemanager"],skinnable:!0});
bundle/scrollview-list/scrollview-list.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -133,4 +133,4 @@ -}, '3.7.2', {"requires": ["plugin", "classnamemanager"], "skinnable": true});+}, '3.7.3', {"requires": ["plugin", "classnamemanager"], "skinnable": true});
bundle/scrollview-paginator/scrollview-paginator-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/scrollview-paginator/scrollview-paginator.js", code: [] };-_yuitest_coverage["build/scrollview-paginator/scrollview-paginator.js"].code=["YUI.add('scrollview-paginator', function (Y, NAME) {","","/**"," * Provides a plugin that adds pagination support to ScrollView instances"," *"," * @module scrollview-paginator"," */","var getClassName = Y.ClassNameManager.getClassName,"," SCROLLVIEW = 'scrollview',"," CLASS_HIDDEN = getClassName(SCROLLVIEW, 'hidden'),"," CLASS_PAGED = getClassName(SCROLLVIEW, 'paged'),"," UI = (Y.ScrollView) ? Y.ScrollView.UI_SRC : 'ui',"," INDEX = 'index',"," SCROLL_X = 'scrollX',"," SCROLL_Y = 'scrollY',"," TOTAL = 'total',"," HOST = 'host',"," BOUNDING_BOX = 'boundingBox',"," CONTENT_BOX = 'contentBox',"," SELECTOR = 'selector',"," FLICK = 'flick',"," DRAG = 'drag',"," AXIS = 'axis',"," DIM_X = 'x',"," DIM_Y = 'y';","","/**"," * Scrollview plugin that adds support for paging"," *"," * @class ScrollViewPaginator"," * @namespace Plugin"," * @extends Plugin.Base"," * @constructor"," */","function PaginatorPlugin() {"," PaginatorPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(PaginatorPlugin, Y.Plugin.Base, {",""," /**"," * Designated initializer"," *"," * @method initializer"," * @param {config} Configuration object for the plugin"," */"," initializer: function (config) {"," var paginator = this,"," host = paginator.get(HOST);",""," // Initialize & default"," paginator._pageDims = [];"," paginator._pageBuffer = 1;"," paginator._optimizeMemory = false;",""," // Cache some values"," paginator._host = host;"," paginator._bb = host._bb;"," paginator._cb = host._cb;"," paginator._cIndex = paginator.get(INDEX);"," paginator._cAxis = paginator.get(AXIS);",""," // Apply configs"," if (config._optimizeMemory) {"," paginator._optimizeMemory = config._optimizeMemory;"," }",""," if (config._pageBuffer) {"," paginator._pageBuffer = config._pageBuffer;"," }",""," // Attach event bindings"," paginator._bindAttrs();"," },",""," /**"," * "," *"," * @method _bindAttrs"," * @private"," */"," _bindAttrs: function () {"," var paginator = this;",""," // Event listeners"," paginator.after({"," 'indexChange': paginator._afterIndexChange,"," 'axisChange': paginator._afterAxisChange"," });",""," // Host method listeners"," paginator.beforeHostMethod('scrollTo', paginator._beforeHostScrollTo);"," paginator.beforeHostMethod('_mousewheel', paginator._beforeHostMousewheel);"," paginator.beforeHostMethod('_flick', paginator._beforeHostFlick);"," paginator.afterHostMethod('_onGestureMoveEnd', paginator._afterHostGestureMoveEnd);"," paginator.afterHostMethod('_uiDimensionsChange', paginator._afterHostUIDimensionsChange);"," paginator.afterHostMethod('syncUI', paginator._afterHostSyncUI);"," "," // Host event listeners"," paginator.afterHostEvent('render', paginator._afterHostRender);"," paginator.afterHostEvent('scrollEnd', paginator._afterHostScrollEnded);"," },",""," /**"," * After host render"," *"," * @method _afterHostRender"," * @param {Event.Facade}"," * @protected"," */"," _afterHostRender: function (e) {"," var paginator = this,"," bb = paginator._bb,"," host = paginator._host,"," index = paginator._cIndex,"," paginatorAxis = paginator._cAxis,"," pageNodes = paginator._getPageNodes(),"," size = pageNodes.size(),"," maxScrollX = paginator._pageDims[index].maxScrollX,"," maxScrollY = paginator._pageDims[index].maxScrollY;",""," if (paginatorAxis[DIM_Y]) {"," host._maxScrollX = maxScrollX;"," }"," else if (paginatorAxis[DIM_X]) {"," host._maxScrollY = maxScrollY;"," }",""," // Set the page count"," paginator.set(TOTAL, size);",""," // Jump to the index"," if (index !== 0) {"," paginator.scrollToIndex(index, 0);"," }",""," // Add the paginator class"," bb.addClass(CLASS_PAGED);",""," // Trigger the optimization process"," paginator._optimize();"," },",""," /**"," * After host syncUI"," *"," * @method _afterHostSyncUI"," * @param {Event.Facade}"," * @protected"," */"," _afterHostSyncUI: function (e) {"," var paginator = this,"," host = paginator._host,"," hostFlick = host.get(FLICK),"," pageNodes = paginator._getPageNodes(),"," size = pageNodes.size(),"," paginatorAxis;",""," // Set the page count"," paginator.set(TOTAL, size);",""," // If paginator's 'axis' property is to be automatically determined, inherit host's property"," if (paginator._cAxis === undefined) {"," paginator._set(AXIS, host.get(AXIS));"," }"," },",""," /**"," * After host _uiDimensionsChange"," *"," * @method _afterHostUIDimensionsChange"," * @param {Event.Facade}"," * @protected"," */"," _afterHostUIDimensionsChange: function (e) {",""," var paginator = this,"," host = paginator._host,"," dims = host._getScrollDims(),"," widgetWidth = dims.offsetWidth,"," widgetHeight = dims.offsetHeight,"," pageNodes = paginator._getPageNodes();"," "," // Inefficient. Should not reinitialize every page every syncUI"," pageNodes.each(function (node, i) {"," var scrollWidth = node.get('scrollWidth'),"," scrollHeight = node.get('scrollHeight'),"," maxScrollX = Math.max(0, scrollWidth - widgetWidth), // Math.max to ensure we don't set it to a negative value"," maxScrollY = Math.max(0, scrollHeight - widgetHeight);",""," // Don't initialize any page _pageDims that already have been."," if (!paginator._pageDims[i]) {",""," paginator._pageDims[i] = {",""," // Current scrollX & scrollY positions (default to 0)"," scrollX: 0,"," scrollY: 0,",""," // Minimum scrollable values"," _minScrollX: 0,"," _minScrollY: 0,",""," // Maximum scrollable values"," maxScrollX: maxScrollX,"," maxScrollY: maxScrollY"," };",""," } else {"," paginator._pageDims[i].maxScrollX = maxScrollX;"," paginator._pageDims[i].maxScrollY = maxScrollY;"," }",""," });"," },",""," /**"," * Executed before host.scrollTo"," *"," * @method _beforeHostScrollTo"," * @param x {Number} The x-position to scroll to. (null for no movement)"," * @param y {Number} The y-position to scroll to. (null for no movement)"," * @param {Number} [duration] Duration, in ms, of the scroll animation (default is 0)"," * @param {String} [easing] An easing equation if duration is set"," * @param {String} [node] The node to move"," * @protected"," */"," _beforeHostScrollTo: function (x, y, duration, easing, node) {"," var paginator = this,"," host = paginator._host,"," gesture = host._gesture,"," index = paginator._cIndex,"," paginatorAxis = paginator._cAxis,"," pageNodes = this._getPageNodes(),"," gestureAxis;",""," if (gesture) {"," gestureAxis = gesture.axis;",""," // Null the opposite axis so it won't be modified by host.scrollTo"," if (gestureAxis === DIM_Y) {"," x = null;"," } else {"," y = null;"," }",""," // If they are scrolling against the specified axis, pull out the page's node to have its own offset"," if (paginatorAxis[gestureAxis] === false) {"," node = pageNodes.item(index);"," }",""," }",""," // Return the modified argument list"," return new Y.Do.AlterArgs(\"new args\", [x, y, duration, easing, node]);"," },",""," /**"," * Executed after host._gestureMoveEnd"," * Determines if the gesture should page prev or next (if at all)"," *"," * @method _afterHostGestureMoveEnd"," * @param {Event.Facade}"," * @protected"," */"," _afterHostGestureMoveEnd: function (e) {"," var paginator = this,"," host = paginator._host,"," gesture = host._gesture,"," paginatorAxis = paginator._cAxis,"," gestureAxis = gesture && gesture.axis;",""," if (paginatorAxis[gestureAxis]) {"," if (gesture[(gestureAxis === DIM_X ? 'deltaX' : 'deltaY')] > 0) {"," paginator[host.rtl ? 'prev' : 'next']();"," } else {"," paginator[host.rtl ? 'next' : 'prev']();"," }"," }"," },",""," /**"," * Executed before host._mousewheel"," * Prevents mousewheel events in some conditions"," *"," * @method _beforeHostMousewheel"," * @param {Event.Facade}"," * @protected"," */"," _beforeHostMousewheel: function (e) {"," var paginator = this,"," host = paginator._host,"," bb = host._bb,"," isForward = e.wheelDelta < 0, // down (negative) is forward. @TODO Should revisit."," paginatorAxis = paginator._cAxis;",""," // Set the axis for this event."," // @TODO: This is hacky, it's not a gesture. Find a better way"," host._gesture = {"," axis: DIM_Y"," };",""," // Only if the mousewheel event occurred on a DOM node inside the BB"," if (bb.contains(e.target) && paginatorAxis[DIM_Y]) {",""," if (isForward) {"," paginator.next();"," } else {"," paginator.prev();"," }",""," // prevent browser default behavior on mousewheel"," e.preventDefault();",""," // Block host._mousewheel from running"," return new Y.Do.Prevent();"," }"," },",""," /**"," * Executed before host._flick"," * Prevents flick events in some conditions"," *"," * @method _beforeHostFlick"," * @param {Event.Facade}"," * @protected"," */"," _beforeHostFlick: function (e) {"," var paginator = this,"," paginatorAxis = paginator.get(AXIS),"," flickAxis = e.flick.axis || false;",""," // Prevent flicks on the paginated axis"," if (paginatorAxis[flickAxis]) {"," return new Y.Do.Prevent();"," }"," },",""," /**"," * Executes after host's 'scrollEnd' event"," * Runs cleanup operations"," *"," * @method _afterHostScrollEnded"," * @param {Event.Facade}"," * @protected"," */"," _afterHostScrollEnded: function (e) {"," var paginator = this,"," host = paginator._host,"," index = paginator._cIndex,"," scrollX = host.get(SCROLL_X),"," scrollY = host.get(SCROLL_Y),"," paginatorAxis = paginator._cAxis;",""," if (paginatorAxis[DIM_Y]) {"," paginator._pageDims[index].scrollX = scrollX;"," } else {"," paginator._pageDims[index].scrollY = scrollY;"," }",""," paginator._optimize();"," },",""," /**"," * index attr change handler"," *"," * @method _afterIndexChange"," * @param {Event.Facade}"," * @protected"," */"," _afterIndexChange: function (e) {"," var paginator = this,"," host = paginator._host,"," index = e.newVal,"," pageDims = paginator._pageDims[index],"," hostAxis = host._cAxis,"," paginatorAxis = paginator._cAxis;",""," // Cache the new index value"," paginator._cIndex = index;",""," // For dual-axis instances, we need to hack some host properties to the"," // current page's max height/width and current stored offset"," if (hostAxis[DIM_X] && hostAxis[DIM_Y]) {"," if (paginatorAxis[DIM_Y]) {"," host._maxScrollX = pageDims.maxScrollX;"," host.set(SCROLL_X, pageDims.scrollX, { src: UI });"," }"," else if (paginatorAxis[DIM_X]) {"," host._maxScrollY = pageDims.maxScrollY;"," host.set(SCROLL_Y, pageDims.scrollY, { src: UI });"," }"," }",""," if (e.src !== UI) {"," paginator.scrollToIndex(index);"," }"," },",""," /**"," * Optimization: Hides the pages not near the viewport"," *"," * @method _optimize"," * @protected"," */"," _optimize: function () {",""," if (!this._optimizeMemory) {"," return false;"," }",""," var paginator = this,"," currentIndex = paginator._cIndex,"," pageNodes = paginator._getStage(currentIndex);",""," // Show the pages in/near the viewport & hide the rest"," paginator._showNodes(pageNodes.visible);"," paginator._hideNodes(pageNodes.hidden);"," },",""," /**"," * Optimization: Determines which nodes should be visible, and which should be hidden."," *"," * @method _getStage"," * @param index {Number} The page index # intended to be in focus."," * @returns {object}"," * @protected"," */"," _getStage: function (index) {"," var _pageBuffer = this._pageBuffer,"," pageCount = this.get(TOTAL),"," pageNodes = this._getPageNodes(),"," start = Math.max(0, index - _pageBuffer),"," end = Math.min(pageCount, index + 1 + _pageBuffer); // noninclusive",""," return {"," visible: pageNodes.splice(start, end - start),"," hidden: pageNodes"," };"," },",""," /**"," * A utility method to show node(s)"," *"," * @method _showNodes"," * @param nodeList {Object} The list of nodes to show"," * @protected"," */"," _showNodes: function (nodeList) {"," if (nodeList) {"," nodeList.removeClass(CLASS_HIDDEN).setStyle('visibility', '');"," }"," },",""," /**"," * A utility method to hide node(s)"," *"," * @method _hideNodes"," * @param nodeList {Object} The list of nodes to hide"," * @protected"," */"," _hideNodes: function (nodeList) {"," if (nodeList) {"," nodeList.addClass(CLASS_HIDDEN).setStyle('visibility', 'hidden');"," }"," },",""," /**"," * Gets a nodeList for the \"pages\""," *"," * @method _getPageNodes"," * @protected"," * @returns {nodeList}"," */"," _getPageNodes: function () {"," var paginator = this,"," host = paginator._host,"," cb = host._cb,"," pageSelector = paginator.get(SELECTOR),"," pageNodes = pageSelector ? cb.all(pageSelector) : cb.get('children');",""," return pageNodes;"," },",""," /**"," * Scroll to the next page, with animation"," *"," * @method next"," */"," next: function () {"," var paginator = this,"," index = paginator._cIndex,"," target = index + 1,"," total = this.get(TOTAL);",""," if (target >= total) {"," return;"," }",""," // Update the index"," paginator.set(INDEX, target);"," },",""," /**"," * Scroll to the previous page, with animation"," *"," * @method prev"," */"," prev: function () {"," var paginator = this,"," index = paginator._cIndex,"," target = index - 1;",""," if (target < 0) {"," return;"," }",""," // Update the index"," paginator.set(INDEX, target);"," },"," "," /** "," * Deprecated for 3.7.0."," * @deprecated"," */"," scrollTo: function () {"," return this.scrollToIndex.apply(this, arguments);"," },",""," /**"," * Scroll to a given page in the scrollview"," *"," * @method scrollToIndex"," * @param index {Number} The index of the page to scroll to"," * @param {Number} [duration] The number of ms the animation should last"," * @param {String} [easing] The timing function to use in the animation"," */"," scrollToIndex: function (index, duration, easing) {"," var paginator = this,"," host = paginator._host,"," pageNode = paginator._getPageNodes().item(index),"," scrollAxis = (paginator._cAxis[DIM_X] ? SCROLL_X : SCROLL_Y),"," scrollOffset = pageNode.get(scrollAxis === SCROLL_X ? 'offsetLeft' : 'offsetTop');",""," duration = (duration !== undefined) ? duration : PaginatorPlugin.TRANSITION.duration;"," easing = (easing !== undefined) ? duration : PaginatorPlugin.TRANSITION.easing;",""," // Set the index ATTR to the specified index value"," paginator.set(INDEX, index);",""," // Makes sure the viewport nodes are visible"," paginator._showNodes(pageNode);",""," // Scroll to the offset"," host.set(scrollAxis, scrollOffset, {"," duration: duration,"," easing: easing"," });"," },",""," /**"," * Setter for 'axis' attribute"," *"," * @method _axisSetter"," * @param val {Mixed} A string ('x', 'y', 'xy') to specify which axis/axes to allow scrolling on"," * @param name {String} The attribute name"," * @return {Object} An object to specify scrollability on the x & y axes"," * "," * @protected"," */"," _axisSetter: function (val, name) {",""," // Turn a string into an axis object"," if (Y.Lang.isString(val)) {"," return {"," x: val.match(/x/i) ? true : false,"," y: val.match(/y/i) ? true : false"," };"," }"," },"," ",""," /**"," * After listener for the axis attribute"," *"," * @method _afterAxisChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterAxisChange: function (e) {"," this._cAxis = e.newVal;"," }",""," // End prototype properties","","}, {"," "," // Static properties",""," /**"," * The identity of the plugin"," *"," * @property NAME"," * @type String"," * @default 'pluginScrollViewPaginator'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'pluginScrollViewPaginator',",""," /**"," * The namespace on which the plugin will reside"," *"," * @property NS"," * @type String"," * @default 'pages'"," * @static"," */"," NS: 'pages',",""," /**"," * The default attribute configuration for the plugin"," *"," * @property ATTRS"," * @type {Object}"," * @static"," */"," ATTRS: {",""," /**"," * Specifies ability to scroll on x, y, or x and y axis/axes. "," * If unspecified, it inherits from the host instance."," *"," * @attribute axis"," * @type String"," */"," axis: {"," setter: '_axisSetter',"," writeOnce: 'initOnly'"," },",""," /**"," * CSS selector for a page inside the scrollview. The scrollview"," * will snap to the closest page."," *"," * @attribute selector"," * @type {String}"," * @default null"," */"," selector: {"," value: null"," },",""," /**"," * The active page number for a paged scrollview"," *"," * @attribute index"," * @type {Number}"," * @default 0"," */"," index: {"," value: 0,"," validator: function (val) {"," // TODO: Remove this?"," // return val >= 0 && val < this.get(TOTAL);"," return true;"," }"," },",""," /**"," * The total number of pages"," *"," * @attribute total"," * @type {Number}"," * @default 0"," */"," total: {"," value: 0"," }"," },"," "," /**"," * The default snap to current duration and easing values used on scroll end."," *"," * @property SNAP_TO_CURRENT"," * @static"," */"," TRANSITION: {"," duration: 300,"," easing: 'ease-out'"," }",""," // End static properties","","});","","Y.namespace('Plugin').ScrollViewPaginator = PaginatorPlugin;","","}, '3.7.2', {\"requires\": [\"plugin\", \"classnamemanager\"]});"];+_yuitest_coverage["build/scrollview-paginator/scrollview-paginator.js"].code=["YUI.add('scrollview-paginator', function (Y, NAME) {","","/**"," * Provides a plugin that adds pagination support to ScrollView instances"," *"," * @module scrollview-paginator"," */","var getClassName = Y.ClassNameManager.getClassName,"," SCROLLVIEW = 'scrollview',"," CLASS_HIDDEN = getClassName(SCROLLVIEW, 'hidden'),"," CLASS_PAGED = getClassName(SCROLLVIEW, 'paged'),"," UI = (Y.ScrollView) ? Y.ScrollView.UI_SRC : 'ui',"," INDEX = 'index',"," SCROLL_X = 'scrollX',"," SCROLL_Y = 'scrollY',"," TOTAL = 'total',"," HOST = 'host',"," BOUNDING_BOX = 'boundingBox',"," CONTENT_BOX = 'contentBox',"," SELECTOR = 'selector',"," FLICK = 'flick',"," DRAG = 'drag',"," AXIS = 'axis',"," DIM_X = 'x',"," DIM_Y = 'y';","","/**"," * Scrollview plugin that adds support for paging"," *"," * @class ScrollViewPaginator"," * @namespace Plugin"," * @extends Plugin.Base"," * @constructor"," */","function PaginatorPlugin() {"," PaginatorPlugin.superclass.constructor.apply(this, arguments);","}","","Y.extend(PaginatorPlugin, Y.Plugin.Base, {",""," /**"," * Designated initializer"," *"," * @method initializer"," * @param {config} Configuration object for the plugin"," */"," initializer: function (config) {"," var paginator = this,"," host = paginator.get(HOST);",""," // Initialize & default"," paginator._pageDims = [];"," paginator._pageBuffer = 1;"," paginator._optimizeMemory = false;",""," // Cache some values"," paginator._host = host;"," paginator._bb = host._bb;"," paginator._cb = host._cb;"," paginator._cIndex = paginator.get(INDEX);"," paginator._cAxis = paginator.get(AXIS);",""," // Apply configs"," if (config._optimizeMemory) {"," paginator._optimizeMemory = config._optimizeMemory;"," }",""," if (config._pageBuffer) {"," paginator._pageBuffer = config._pageBuffer;"," }",""," // Attach event bindings"," paginator._bindAttrs();"," },",""," /**"," * "," *"," * @method _bindAttrs"," * @private"," */"," _bindAttrs: function () {"," var paginator = this;",""," // Event listeners"," paginator.after({"," 'indexChange': paginator._afterIndexChange,"," 'axisChange': paginator._afterAxisChange"," });",""," // Host method listeners"," paginator.beforeHostMethod('scrollTo', paginator._beforeHostScrollTo);"," paginator.beforeHostMethod('_mousewheel', paginator._beforeHostMousewheel);"," paginator.beforeHostMethod('_flick', paginator._beforeHostFlick);"," paginator.afterHostMethod('_onGestureMoveEnd', paginator._afterHostGestureMoveEnd);"," paginator.afterHostMethod('_uiDimensionsChange', paginator._afterHostUIDimensionsChange);"," paginator.afterHostMethod('syncUI', paginator._afterHostSyncUI);"," "," // Host event listeners"," paginator.afterHostEvent('render', paginator._afterHostRender);"," paginator.afterHostEvent('scrollEnd', paginator._afterHostScrollEnded);"," },",""," /**"," * After host render"," *"," * @method _afterHostRender"," * @param {Event.Facade}"," * @protected"," */"," _afterHostRender: function (e) {"," var paginator = this,"," bb = paginator._bb,"," host = paginator._host,"," index = paginator._cIndex,"," paginatorAxis = paginator._cAxis,"," pageNodes = paginator._getPageNodes(),"," size = pageNodes.size(),"," maxScrollX = paginator._pageDims[index].maxScrollX,"," maxScrollY = paginator._pageDims[index].maxScrollY;",""," if (paginatorAxis[DIM_Y]) {"," host._maxScrollX = maxScrollX;"," }"," else if (paginatorAxis[DIM_X]) {"," host._maxScrollY = maxScrollY;"," }",""," // Set the page count"," paginator.set(TOTAL, size);",""," // Jump to the index"," if (index !== 0) {"," paginator.scrollToIndex(index, 0);"," }",""," // Add the paginator class"," bb.addClass(CLASS_PAGED);",""," // Trigger the optimization process"," paginator._optimize();"," },",""," /**"," * After host syncUI"," *"," * @method _afterHostSyncUI"," * @param {Event.Facade}"," * @protected"," */"," _afterHostSyncUI: function (e) {"," var paginator = this,"," host = paginator._host,"," hostFlick = host.get(FLICK),"," pageNodes = paginator._getPageNodes(),"," size = pageNodes.size(),"," paginatorAxis;",""," // Set the page count"," paginator.set(TOTAL, size);",""," // If paginator's 'axis' property is to be automatically determined, inherit host's property"," if (paginator._cAxis === undefined) {"," paginator._set(AXIS, host.get(AXIS));"," }"," },",""," /**"," * After host _uiDimensionsChange"," *"," * @method _afterHostUIDimensionsChange"," * @param {Event.Facade}"," * @protected"," */"," _afterHostUIDimensionsChange: function (e) {",""," var paginator = this,"," host = paginator._host,"," dims = host._getScrollDims(),"," widgetWidth = dims.offsetWidth,"," widgetHeight = dims.offsetHeight,"," pageNodes = paginator._getPageNodes();"," "," // Inefficient. Should not reinitialize every page every syncUI"," pageNodes.each(function (node, i) {"," var scrollWidth = node.get('scrollWidth'),"," scrollHeight = node.get('scrollHeight'),"," maxScrollX = Math.max(0, scrollWidth - widgetWidth), // Math.max to ensure we don't set it to a negative value"," maxScrollY = Math.max(0, scrollHeight - widgetHeight);",""," // Don't initialize any page _pageDims that already have been."," if (!paginator._pageDims[i]) {",""," paginator._pageDims[i] = {",""," // Current scrollX & scrollY positions (default to 0)"," scrollX: 0,"," scrollY: 0,",""," // Minimum scrollable values"," _minScrollX: 0,"," _minScrollY: 0,",""," // Maximum scrollable values"," maxScrollX: maxScrollX,"," maxScrollY: maxScrollY"," };",""," } else {"," paginator._pageDims[i].maxScrollX = maxScrollX;"," paginator._pageDims[i].maxScrollY = maxScrollY;"," }",""," });"," },",""," /**"," * Executed before host.scrollTo"," *"," * @method _beforeHostScrollTo"," * @param x {Number} The x-position to scroll to. (null for no movement)"," * @param y {Number} The y-position to scroll to. (null for no movement)"," * @param {Number} [duration] Duration, in ms, of the scroll animation (default is 0)"," * @param {String} [easing] An easing equation if duration is set"," * @param {String} [node] The node to move"," * @protected"," */"," _beforeHostScrollTo: function (x, y, duration, easing, node) {"," var paginator = this,"," host = paginator._host,"," gesture = host._gesture,"," index = paginator._cIndex,"," paginatorAxis = paginator._cAxis,"," pageNodes = this._getPageNodes(),"," gestureAxis;",""," if (gesture) {"," gestureAxis = gesture.axis;",""," // Null the opposite axis so it won't be modified by host.scrollTo"," if (gestureAxis === DIM_Y) {"," x = null;"," } else {"," y = null;"," }",""," // If they are scrolling against the specified axis, pull out the page's node to have its own offset"," if (paginatorAxis[gestureAxis] === false) {"," node = pageNodes.item(index);"," }",""," }",""," // Return the modified argument list"," return new Y.Do.AlterArgs(\"new args\", [x, y, duration, easing, node]);"," },",""," /**"," * Executed after host._gestureMoveEnd"," * Determines if the gesture should page prev or next (if at all)"," *"," * @method _afterHostGestureMoveEnd"," * @param {Event.Facade}"," * @protected"," */"," _afterHostGestureMoveEnd: function (e) {"," var paginator = this,"," host = paginator._host,"," gesture = host._gesture,"," paginatorAxis = paginator._cAxis,"," gestureAxis = gesture && gesture.axis;",""," if (paginatorAxis[gestureAxis]) {"," if (gesture[(gestureAxis === DIM_X ? 'deltaX' : 'deltaY')] > 0) {"," paginator[host.rtl ? 'prev' : 'next']();"," } else {"," paginator[host.rtl ? 'next' : 'prev']();"," }"," }"," },",""," /**"," * Executed before host._mousewheel"," * Prevents mousewheel events in some conditions"," *"," * @method _beforeHostMousewheel"," * @param {Event.Facade}"," * @protected"," */"," _beforeHostMousewheel: function (e) {"," var paginator = this,"," host = paginator._host,"," bb = host._bb,"," isForward = e.wheelDelta < 0, // down (negative) is forward. @TODO Should revisit."," paginatorAxis = paginator._cAxis;",""," // Set the axis for this event."," // @TODO: This is hacky, it's not a gesture. Find a better way"," host._gesture = {"," axis: DIM_Y"," };",""," // Only if the mousewheel event occurred on a DOM node inside the BB"," if (bb.contains(e.target) && paginatorAxis[DIM_Y]) {",""," if (isForward) {"," paginator.next();"," } else {"," paginator.prev();"," }",""," // prevent browser default behavior on mousewheel"," e.preventDefault();",""," // Block host._mousewheel from running"," return new Y.Do.Prevent();"," }"," },",""," /**"," * Executed before host._flick"," * Prevents flick events in some conditions"," *"," * @method _beforeHostFlick"," * @param {Event.Facade}"," * @protected"," */"," _beforeHostFlick: function (e) {"," var paginator = this,"," paginatorAxis = paginator.get(AXIS),"," flickAxis = e.flick.axis || false;",""," // Prevent flicks on the paginated axis"," if (paginatorAxis[flickAxis]) {"," return new Y.Do.Prevent();"," }"," },",""," /**"," * Executes after host's 'scrollEnd' event"," * Runs cleanup operations"," *"," * @method _afterHostScrollEnded"," * @param {Event.Facade}"," * @protected"," */"," _afterHostScrollEnded: function (e) {"," var paginator = this,"," host = paginator._host,"," index = paginator._cIndex,"," scrollX = host.get(SCROLL_X),"," scrollY = host.get(SCROLL_Y),"," paginatorAxis = paginator._cAxis;",""," if (paginatorAxis[DIM_Y]) {"," paginator._pageDims[index].scrollX = scrollX;"," } else {"," paginator._pageDims[index].scrollY = scrollY;"," }",""," paginator._optimize();"," },",""," /**"," * index attr change handler"," *"," * @method _afterIndexChange"," * @param {Event.Facade}"," * @protected"," */"," _afterIndexChange: function (e) {"," var paginator = this,"," host = paginator._host,"," index = e.newVal,"," pageDims = paginator._pageDims[index],"," hostAxis = host._cAxis,"," paginatorAxis = paginator._cAxis;",""," // Cache the new index value"," paginator._cIndex = index;",""," // For dual-axis instances, we need to hack some host properties to the"," // current page's max height/width and current stored offset"," if (hostAxis[DIM_X] && hostAxis[DIM_Y]) {"," if (paginatorAxis[DIM_Y]) {"," host._maxScrollX = pageDims.maxScrollX;"," host.set(SCROLL_X, pageDims.scrollX, { src: UI });"," }"," else if (paginatorAxis[DIM_X]) {"," host._maxScrollY = pageDims.maxScrollY;"," host.set(SCROLL_Y, pageDims.scrollY, { src: UI });"," }"," }",""," if (e.src !== UI) {"," paginator.scrollToIndex(index);"," }"," },",""," /**"," * Optimization: Hides the pages not near the viewport"," *"," * @method _optimize"," * @protected"," */"," _optimize: function () {",""," if (!this._optimizeMemory) {"," return false;"," }",""," var paginator = this,"," currentIndex = paginator._cIndex,"," pageNodes = paginator._getStage(currentIndex);",""," // Show the pages in/near the viewport & hide the rest"," paginator._showNodes(pageNodes.visible);"," paginator._hideNodes(pageNodes.hidden);"," },",""," /**"," * Optimization: Determines which nodes should be visible, and which should be hidden."," *"," * @method _getStage"," * @param index {Number} The page index # intended to be in focus."," * @returns {object}"," * @protected"," */"," _getStage: function (index) {"," var _pageBuffer = this._pageBuffer,"," pageCount = this.get(TOTAL),"," pageNodes = this._getPageNodes(),"," start = Math.max(0, index - _pageBuffer),"," end = Math.min(pageCount, index + 1 + _pageBuffer); // noninclusive",""," return {"," visible: pageNodes.splice(start, end - start),"," hidden: pageNodes"," };"," },",""," /**"," * A utility method to show node(s)"," *"," * @method _showNodes"," * @param nodeList {Object} The list of nodes to show"," * @protected"," */"," _showNodes: function (nodeList) {"," if (nodeList) {"," nodeList.removeClass(CLASS_HIDDEN).setStyle('visibility', '');"," }"," },",""," /**"," * A utility method to hide node(s)"," *"," * @method _hideNodes"," * @param nodeList {Object} The list of nodes to hide"," * @protected"," */"," _hideNodes: function (nodeList) {"," if (nodeList) {"," nodeList.addClass(CLASS_HIDDEN).setStyle('visibility', 'hidden');"," }"," },",""," /**"," * Gets a nodeList for the \"pages\""," *"," * @method _getPageNodes"," * @protected"," * @returns {nodeList}"," */"," _getPageNodes: function () {"," var paginator = this,"," host = paginator._host,"," cb = host._cb,"," pageSelector = paginator.get(SELECTOR),"," pageNodes = pageSelector ? cb.all(pageSelector) : cb.get('children');",""," return pageNodes;"," },",""," /**"," * Scroll to the next page, with animation"," *"," * @method next"," */"," next: function () {"," var paginator = this,"," index = paginator._cIndex,"," target = index + 1,"," total = this.get(TOTAL);",""," if (target >= total) {"," return;"," }",""," // Update the index"," paginator.set(INDEX, target);"," },",""," /**"," * Scroll to the previous page, with animation"," *"," * @method prev"," */"," prev: function () {"," var paginator = this,"," index = paginator._cIndex,"," target = index - 1;",""," if (target < 0) {"," return;"," }",""," // Update the index"," paginator.set(INDEX, target);"," },"," "," /** "," * Deprecated for 3.7.0."," * @deprecated"," */"," scrollTo: function () {"," return this.scrollToIndex.apply(this, arguments);"," },",""," /**"," * Scroll to a given page in the scrollview"," *"," * @method scrollToIndex"," * @param index {Number} The index of the page to scroll to"," * @param {Number} [duration] The number of ms the animation should last"," * @param {String} [easing] The timing function to use in the animation"," */"," scrollToIndex: function (index, duration, easing) {"," var paginator = this,"," host = paginator._host,"," pageNode = paginator._getPageNodes().item(index),"," scrollAxis = (paginator._cAxis[DIM_X] ? SCROLL_X : SCROLL_Y),"," scrollOffset = pageNode.get(scrollAxis === SCROLL_X ? 'offsetLeft' : 'offsetTop');",""," duration = (duration !== undefined) ? duration : PaginatorPlugin.TRANSITION.duration;"," easing = (easing !== undefined) ? duration : PaginatorPlugin.TRANSITION.easing;",""," // Set the index ATTR to the specified index value"," paginator.set(INDEX, index);",""," // Makes sure the viewport nodes are visible"," paginator._showNodes(pageNode);",""," // Scroll to the offset"," host.set(scrollAxis, scrollOffset, {"," duration: duration,"," easing: easing"," });"," },",""," /**"," * Setter for 'axis' attribute"," *"," * @method _axisSetter"," * @param val {Mixed} A string ('x', 'y', 'xy') to specify which axis/axes to allow scrolling on"," * @param name {String} The attribute name"," * @return {Object} An object to specify scrollability on the x & y axes"," * "," * @protected"," */"," _axisSetter: function (val, name) {",""," // Turn a string into an axis object"," if (Y.Lang.isString(val)) {"," return {"," x: val.match(/x/i) ? true : false,"," y: val.match(/y/i) ? true : false"," };"," }"," },"," ",""," /**"," * After listener for the axis attribute"," *"," * @method _afterAxisChange"," * @param e {Event.Facade} The event facade"," * @protected"," */"," _afterAxisChange: function (e) {"," this._cAxis = e.newVal;"," }",""," // End prototype properties","","}, {"," "," // Static properties",""," /**"," * The identity of the plugin"," *"," * @property NAME"," * @type String"," * @default 'pluginScrollViewPaginator'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'pluginScrollViewPaginator',",""," /**"," * The namespace on which the plugin will reside"," *"," * @property NS"," * @type String"," * @default 'pages'"," * @static"," */"," NS: 'pages',",""," /**"," * The default attribute configuration for the plugin"," *"," * @property ATTRS"," * @type {Object}"," * @static"," */"," ATTRS: {",""," /**"," * Specifies ability to scroll on x, y, or x and y axis/axes. "," * If unspecified, it inherits from the host instance."," *"," * @attribute axis"," * @type String"," */"," axis: {"," setter: '_axisSetter',"," writeOnce: 'initOnly'"," },",""," /**"," * CSS selector for a page inside the scrollview. The scrollview"," * will snap to the closest page."," *"," * @attribute selector"," * @type {String}"," * @default null"," */"," selector: {"," value: null"," },",""," /**"," * The active page number for a paged scrollview"," *"," * @attribute index"," * @type {Number}"," * @default 0"," */"," index: {"," value: 0,"," validator: function (val) {"," // TODO: Remove this?"," // return val >= 0 && val < this.get(TOTAL);"," return true;"," }"," },",""," /**"," * The total number of pages"," *"," * @attribute total"," * @type {Number}"," * @default 0"," */"," total: {"," value: 0"," }"," },"," "," /**"," * The default snap to current duration and easing values used on scroll end."," *"," * @property SNAP_TO_CURRENT"," * @static"," */"," TRANSITION: {"," duration: 300,"," easing: 'ease-out'"," }",""," // End static properties","","});","","Y.namespace('Plugin').ScrollViewPaginator = PaginatorPlugin;","","}, '3.7.3', {\"requires\": [\"plugin\", \"classnamemanager\"]});"]; _yuitest_coverage["build/scrollview-paginator/scrollview-paginator.js"].lines = {"1":0,"8":0,"35":0,"36":0,"39":0,"48":0,"52":0,"53":0,"54":0,"57":0,"58":0,"59":0,"60":0,"61":0,"64":0,"65":0,"68":0,"69":0,"73":0,"83":0,"86":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"100":0,"101":0,"112":0,"122":0,"123":0,"125":0,"126":0,"130":0,"133":0,"134":0,"138":0,"141":0,"152":0,"160":0,"163":0,"164":0,"177":0,"185":0,"186":0,"192":0,"194":0,"210":0,"211":0,"229":0,"237":0,"238":0,"241":0,"242":0,"244":0,"248":0,"249":0,"255":0,"267":0,"273":0,"274":0,"275":0,"277":0,"291":0,"299":0,"304":0,"306":0,"307":0,"309":0,"313":0,"316":0,"329":0,"334":0,"335":0,"348":0,"355":0,"356":0,"358":0,"361":0,"372":0,"380":0,"384":0,"385":0,"386":0,"387":0,"389":0,"390":0,"391":0,"395":0,"396":0,"408":0,"409":0,"412":0,"417":0,"418":0,"430":0,"436":0,"450":0,"451":0,"463":0,"464":0,"476":0,"482":0,"491":0,"496":0,"497":0,"501":0,"510":0,"514":0,"515":0,"519":0,"527":0,"539":0,"545":0,"546":0,"549":0,"552":0,"555":0,"574":0,"575":0,"591":0,"667":0,"698":0}; _yuitest_coverage["build/scrollview-paginator/scrollview-paginator.js"].functions = {"PaginatorPlugin:35":0,"initializer:47":0,"_bindAttrs:82":0,"_afterHostRender:111":0,"_afterHostSyncUI:151":0,"(anonymous 2):185":0,"_afterHostUIDimensionsChange:175":0,"_beforeHostScrollTo:228":0,"_afterHostGestureMoveEnd:266":0,"_beforeHostMousewheel:290":0,"_beforeHostFlick:328":0,"_afterHostScrollEnded:347":0,"_afterIndexChange:371":0,"_optimize:406":0,"_getStage:429":0,"_showNodes:449":0,"_hideNodes:462":0,"_getPageNodes:475":0,"next:490":0,"prev:509":0,"scrollTo:526":0,"scrollToIndex:538":0,"_axisSetter:571":0,"_afterAxisChange:590":0,"validator:664":0,"(anonymous 1):1":0}; _yuitest_coverage["build/scrollview-paginator/scrollview-paginator.js"].coveredLines = 124;@@ -886,4 +886,4 @@ _yuitest_coverline("build/scrollview-paginator/scrollview-paginator.js", 698); Y.namespace('Plugin').ScrollViewPaginator = PaginatorPlugin; -}, '3.7.2', {"requires": ["plugin", "classnamemanager"]});+}, '3.7.3', {"requires": ["plugin", "classnamemanager"]});
bundle/scrollview-paginator/scrollview-paginator-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -703,4 +703,4 @@ Y.namespace('Plugin').ScrollViewPaginator = PaginatorPlugin; -}, '3.7.2', {"requires": ["plugin", "classnamemanager"]});+}, '3.7.3', {"requires": ["plugin", "classnamemanager"]});
bundle/scrollview-paginator/scrollview-paginator-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("scrollview-paginator",function(e,t){function w(){w.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="scrollview",i=n(r,"hidden"),s=n(r,"paged"),o=e.ScrollView?e.ScrollView.UI_SRC:"ui",u="index",a="scrollX",f="scrollY",l="total",c="host",h="boundingBox",p="contentBox",d="selector",v="flick",m="drag",g="axis",y="x",b="y";e.extend(w,e.Plugin.Base,{initializer:function(e){var t=this,n=t.get(c);t._pageDims=[],t._pageBuffer=1,t._optimizeMemory=!1,t._host=n,t._bb=n._bb,t._cb=n._cb,t._cIndex=t.get(u),t._cAxis=t.get(g),e._optimizeMemory&&(t._optimizeMemory=e._optimizeMemory),e._pageBuffer&&(t._pageBuffer=e._pageBuffer),t._bindAttrs()},_bindAttrs:function(){var e=this;e.after({indexChange:e._afterIndexChange,axisChange:e._afterAxisChange}),e.beforeHostMethod("scrollTo",e._beforeHostScrollTo),e.beforeHostMethod("_mousewheel",e._beforeHostMousewheel),e.beforeHostMethod("_flick",e._beforeHostFlick),e.afterHostMethod("_onGestureMoveEnd",e._afterHostGestureMoveEnd),e.afterHostMethod("_uiDimensionsChange",e._afterHostUIDimensionsChange),e.afterHostMethod("syncUI",e._afterHostSyncUI),e.afterHostEvent("render",e._afterHostRender),e.afterHostEvent("scrollEnd",e._afterHostScrollEnded)},_afterHostRender:function(e){var t=this,n=t._bb,r=t._host,i=t._cIndex,o=t._cAxis,u=t._getPageNodes(),a=u.size(),f=t._pageDims[i].maxScrollX,c=t._pageDims[i].maxScrollY;o[b]?r._maxScrollX=f:o[y]&&(r._maxScrollY=c),t.set(l,a),i!==0&&t.scrollToIndex(i,0),n.addClass(s),t._optimize()},_afterHostSyncUI:function(e){var t=this,n=t._host,r=n.get(v),i=t._getPageNodes(),s=i.size(),o;t.set(l,s),t._cAxis===undefined&&t._set(g,n.get(g))},_afterHostUIDimensionsChange:function(e){var t=this,n=t._host,r=n._getScrollDims(),i=r.offsetWidth,s=r.offsetHeight,o=t._getPageNodes();o.each(function(e,n){var r=e.get("scrollWidth"),o=e.get("scrollHeight"),u=Math.max(0,r-i),a=Math.max(0,o-s);t._pageDims[n]?(t._pageDims[n].maxScrollX=u,t._pageDims[n].maxScrollY=a):t._pageDims[n]={scrollX:0,scrollY:0,_minScrollX:0,_minScrollY:0,maxScrollX:u,maxScrollY:a}})},_beforeHostScrollTo:function(t,n,r,i,s){var o=this,u=o._host,a=u._gesture,f=o._cIndex,l=o._cAxis,c=this._getPageNodes(),h;return a&&(h=a.axis,h===b?t=null:n=null,l[h]===!1&&(s=c.item(f))),new e.Do.AlterArgs("new args",[t,n,r,i,s])},_afterHostGestureMoveEnd:function(e){var t=this,n=t._host,r=n._gesture,i=t._cAxis,s=r&&r.axis;i[s]&&(r[s===y?"deltaX":"deltaY"]>0?t[n.rtl?"prev":"next"]():t[n.rtl?"next":"prev"]())},_beforeHostMousewheel:function(t){var n=this,r=n._host,i=r._bb,s=t.wheelDelta<0,o=n._cAxis;r._gesture={axis:b};if(i.contains(t.target)&&o[b])return s?n.next():n.prev(),t.preventDefault(),new e.Do.Prevent},_beforeHostFlick:function(t){var n=this,r=n.get(g),i=t.flick.axis||!1;if(r[i])return new e.Do.Prevent},_afterHostScrollEnded:function(e){var t=this,n=t._host,r=t._cIndex,i=n.get(a),s=n.get(f),o=t._cAxis;o[b]?t._pageDims[r].scrollX=i:t._pageDims[r].scrollY=s,t._optimize()},_afterIndexChange:function(e){var t=this,n=t._host,r=e.newVal,i=t._pageDims[r],s=n._cAxis,u=t._cAxis;t._cIndex=r,s[y]&&s[b]&&(u[b]?(n._maxScrollX=i.maxScrollX,n.set(a,i.scrollX,{src:o})):u[y]&&(n._maxScrollY=i.maxScrollY,n.set(f,i.scrollY,{src:o}))),e.src!==o&&t.scrollToIndex(r)},_optimize:function(){if(!this._optimizeMemory)return!1;var e=this,t=e._cIndex,n=e._getStage(t);e._showNodes(n.visible),e._hideNodes(n.hidden)},_getStage:function(e){var t=this._pageBuffer,n=this.get(l),r=this._getPageNodes(),i=Math.max(0,e-t),s=Math.min(n,e+1+t);return{visible:r.splice(i,s-i),hidden:r}},_showNodes:function(e){e&&e.removeClass(i).setStyle("visibility","")},_hideNodes:function(e){e&&e.addClass(i).setStyle("visibility","hidden")},_getPageNodes:function(){var e=this,t=e._host,n=t._cb,r=e.get(d),i=r?n.all(r):n.get("children");return i},next:function(){var e=this,t=e._cIndex,n=t+1,r=this.get(l);if(n>=r)return;e.set(u,n)},prev:function(){var e=this,t=e._cIndex,n=t-1;if(n<0)return;e.set(u,n)},scrollTo:function(){return this.scrollToIndex.apply(this,arguments)},scrollToIndex:function(e,t,n){var r=this,i=r._host,s=r._getPageNodes().item(e),o=r._cAxis[y]?a:f,l=s.get(o===a?"offsetLeft":"offsetTop");t=t!==undefined?t:w.TRANSITION.duration,n=n!==undefined?t:w.TRANSITION.easing,r.set(u,e),r._showNodes(s),i.set(o,l,{duration:t,easing:n})},_axisSetter:function(t,n){if(e.Lang.isString(t))return{x:t.match(/x/i)?!0:!1,y:t.match(/y/i)?!0:!1}},_afterAxisChange:function(e){this._cAxis=e.newVal}},{NAME:"pluginScrollViewPaginator",NS:"pages",ATTRS:{axis:{setter:"_axisSetter",writeOnce:"initOnly"},selector:{value:null},index:{value:0,validator:function(e){return!0}},total:{value:0}},TRANSITION:{duration:300,easing:"ease-out"}}),e.namespace("Plugin").ScrollViewPaginator=w},"3.7.2",{requires:["plugin","classnamemanager"]});+YUI.add("scrollview-paginator",function(e,t){function w(){w.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r="scrollview",i=n(r,"hidden"),s=n(r,"paged"),o=e.ScrollView?e.ScrollView.UI_SRC:"ui",u="index",a="scrollX",f="scrollY",l="total",c="host",h="boundingBox",p="contentBox",d="selector",v="flick",m="drag",g="axis",y="x",b="y";e.extend(w,e.Plugin.Base,{initializer:function(e){var t=this,n=t.get(c);t._pageDims=[],t._pageBuffer=1,t._optimizeMemory=!1,t._host=n,t._bb=n._bb,t._cb=n._cb,t._cIndex=t.get(u),t._cAxis=t.get(g),e._optimizeMemory&&(t._optimizeMemory=e._optimizeMemory),e._pageBuffer&&(t._pageBuffer=e._pageBuffer),t._bindAttrs()},_bindAttrs:function(){var e=this;e.after({indexChange:e._afterIndexChange,axisChange:e._afterAxisChange}),e.beforeHostMethod("scrollTo",e._beforeHostScrollTo),e.beforeHostMethod("_mousewheel",e._beforeHostMousewheel),e.beforeHostMethod("_flick",e._beforeHostFlick),e.afterHostMethod("_onGestureMoveEnd",e._afterHostGestureMoveEnd),e.afterHostMethod("_uiDimensionsChange",e._afterHostUIDimensionsChange),e.afterHostMethod("syncUI",e._afterHostSyncUI),e.afterHostEvent("render",e._afterHostRender),e.afterHostEvent("scrollEnd",e._afterHostScrollEnded)},_afterHostRender:function(e){var t=this,n=t._bb,r=t._host,i=t._cIndex,o=t._cAxis,u=t._getPageNodes(),a=u.size(),f=t._pageDims[i].maxScrollX,c=t._pageDims[i].maxScrollY;o[b]?r._maxScrollX=f:o[y]&&(r._maxScrollY=c),t.set(l,a),i!==0&&t.scrollToIndex(i,0),n.addClass(s),t._optimize()},_afterHostSyncUI:function(e){var t=this,n=t._host,r=n.get(v),i=t._getPageNodes(),s=i.size(),o;t.set(l,s),t._cAxis===undefined&&t._set(g,n.get(g))},_afterHostUIDimensionsChange:function(e){var t=this,n=t._host,r=n._getScrollDims(),i=r.offsetWidth,s=r.offsetHeight,o=t._getPageNodes();o.each(function(e,n){var r=e.get("scrollWidth"),o=e.get("scrollHeight"),u=Math.max(0,r-i),a=Math.max(0,o-s);t._pageDims[n]?(t._pageDims[n].maxScrollX=u,t._pageDims[n].maxScrollY=a):t._pageDims[n]={scrollX:0,scrollY:0,_minScrollX:0,_minScrollY:0,maxScrollX:u,maxScrollY:a}})},_beforeHostScrollTo:function(t,n,r,i,s){var o=this,u=o._host,a=u._gesture,f=o._cIndex,l=o._cAxis,c=this._getPageNodes(),h;return a&&(h=a.axis,h===b?t=null:n=null,l[h]===!1&&(s=c.item(f))),new e.Do.AlterArgs("new args",[t,n,r,i,s])},_afterHostGestureMoveEnd:function(e){var t=this,n=t._host,r=n._gesture,i=t._cAxis,s=r&&r.axis;i[s]&&(r[s===y?"deltaX":"deltaY"]>0?t[n.rtl?"prev":"next"]():t[n.rtl?"next":"prev"]())},_beforeHostMousewheel:function(t){var n=this,r=n._host,i=r._bb,s=t.wheelDelta<0,o=n._cAxis;r._gesture={axis:b};if(i.contains(t.target)&&o[b])return s?n.next():n.prev(),t.preventDefault(),new e.Do.Prevent},_beforeHostFlick:function(t){var n=this,r=n.get(g),i=t.flick.axis||!1;if(r[i])return new e.Do.Prevent},_afterHostScrollEnded:function(e){var t=this,n=t._host,r=t._cIndex,i=n.get(a),s=n.get(f),o=t._cAxis;o[b]?t._pageDims[r].scrollX=i:t._pageDims[r].scrollY=s,t._optimize()},_afterIndexChange:function(e){var t=this,n=t._host,r=e.newVal,i=t._pageDims[r],s=n._cAxis,u=t._cAxis;t._cIndex=r,s[y]&&s[b]&&(u[b]?(n._maxScrollX=i.maxScrollX,n.set(a,i.scrollX,{src:o})):u[y]&&(n._maxScrollY=i.maxScrollY,n.set(f,i.scrollY,{src:o}))),e.src!==o&&t.scrollToIndex(r)},_optimize:function(){if(!this._optimizeMemory)return!1;var e=this,t=e._cIndex,n=e._getStage(t);e._showNodes(n.visible),e._hideNodes(n.hidden)},_getStage:function(e){var t=this._pageBuffer,n=this.get(l),r=this._getPageNodes(),i=Math.max(0,e-t),s=Math.min(n,e+1+t);return{visible:r.splice(i,s-i),hidden:r}},_showNodes:function(e){e&&e.removeClass(i).setStyle("visibility","")},_hideNodes:function(e){e&&e.addClass(i).setStyle("visibility","hidden")},_getPageNodes:function(){var e=this,t=e._host,n=t._cb,r=e.get(d),i=r?n.all(r):n.get("children");return i},next:function(){var e=this,t=e._cIndex,n=t+1,r=this.get(l);if(n>=r)return;e.set(u,n)},prev:function(){var e=this,t=e._cIndex,n=t-1;if(n<0)return;e.set(u,n)},scrollTo:function(){return this.scrollToIndex.apply(this,arguments)},scrollToIndex:function(e,t,n){var r=this,i=r._host,s=r._getPageNodes().item(e),o=r._cAxis[y]?a:f,l=s.get(o===a?"offsetLeft":"offsetTop");t=t!==undefined?t:w.TRANSITION.duration,n=n!==undefined?t:w.TRANSITION.easing,r.set(u,e),r._showNodes(s),i.set(o,l,{duration:t,easing:n})},_axisSetter:function(t,n){if(e.Lang.isString(t))return{x:t.match(/x/i)?!0:!1,y:t.match(/y/i)?!0:!1}},_afterAxisChange:function(e){this._cAxis=e.newVal}},{NAME:"pluginScrollViewPaginator",NS:"pages",ATTRS:{axis:{setter:"_axisSetter",writeOnce:"initOnly"},selector:{value:null},index:{value:0,validator:function(e){return!0}},total:{value:0}},TRANSITION:{duration:300,easing:"ease-out"}}),e.namespace("Plugin").ScrollViewPaginator=w},"3.7.3",{requires:["plugin","classnamemanager"]});
bundle/scrollview-paginator/scrollview-paginator.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -703,4 +703,4 @@ Y.namespace('Plugin').ScrollViewPaginator = PaginatorPlugin; -}, '3.7.2', {"requires": ["plugin", "classnamemanager"]});+}, '3.7.3', {"requires": ["plugin", "classnamemanager"]});
bundle/scrollview-scrollbars/assets/scrollview-scrollbars-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-scrollbars/assets/skins/night/scrollview-scrollbars-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-scrollbars/assets/skins/night/scrollview-scrollbars.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-scrollbars/assets/skins/sam/scrollview-scrollbars-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-scrollbars/assets/skins/sam/scrollview-scrollbars.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/scrollview-scrollbars/scrollview-scrollbars-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/scrollview-scrollbars/scrollview-scrollbars.js", code: [] };-_yuitest_coverage["build/scrollview-scrollbars/scrollview-scrollbars.js"].code=["YUI.add('scrollview-scrollbars', function (Y, NAME) {","","/**"," * Provides a plugin, which adds support for a scroll indicator to ScrollView instances"," *"," * @module scrollview"," * @submodule scrollview-scrollbars"," */","","var getClassName = Y.ClassNameManager.getClassName,"," _classNames,",""," Transition = Y.Transition,"," NATIVE_TRANSITIONS = Transition.useNative, "," SCROLLBAR = 'scrollbar',"," SCROLLVIEW = 'scrollview',",""," VERTICAL_NODE = \"verticalNode\","," HORIZONTAL_NODE = \"horizontalNode\",",""," CHILD_CACHE = \"childCache\",",""," TOP = \"top\","," LEFT = \"left\","," WIDTH = \"width\","," HEIGHT = \"height\","," SCROLL_WIDTH = \"scrollWidth\","," SCROLL_HEIGHT = \"scrollHeight\",",""," HORIZ_CACHE = \"_sbh\","," VERT_CACHE = \"_sbv\",",""," TRANSITION_PROPERTY = Transition._VENDOR_PREFIX + \"TransitionProperty\","," TRANSFORM = \"transform\",",""," TRANSLATE_X = \"translateX(\","," TRANSLATE_Y = \"translateY(\",",""," SCALE_X = \"scaleX(\","," SCALE_Y = \"scaleY(\","," "," SCROLL_X = \"scrollX\","," SCROLL_Y = \"scrollY\",",""," PX = \"px\","," CLOSE = \")\","," PX_CLOSE = PX + CLOSE;","","/**"," * ScrollView plugin that adds scroll indicators to ScrollView instances"," *"," * @class ScrollViewScrollbars"," * @namespace Plugin"," * @extends Plugin.Base"," * @constructor"," */","function ScrollbarsPlugin() {"," ScrollbarsPlugin.superclass.constructor.apply(this, arguments);","}","","ScrollbarsPlugin.CLASS_NAMES = {"," showing: getClassName(SCROLLVIEW, SCROLLBAR, 'showing'),"," scrollbar: getClassName(SCROLLVIEW, SCROLLBAR),"," scrollbarV: getClassName(SCROLLVIEW, SCROLLBAR, 'vert'),"," scrollbarH: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz'),"," scrollbarVB: getClassName(SCROLLVIEW, SCROLLBAR, 'vert', 'basic'),"," scrollbarHB: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz', 'basic'),"," child: getClassName(SCROLLVIEW, 'child'),"," first: getClassName(SCROLLVIEW, 'first'),"," middle: getClassName(SCROLLVIEW, 'middle'),"," last: getClassName(SCROLLVIEW, 'last')","};","","_classNames = ScrollbarsPlugin.CLASS_NAMES;","","/**"," * The identity of the plugin"," *"," * @property NAME"," * @type String"," * @default 'pluginScrollViewScrollbars'"," * @static"," */","ScrollbarsPlugin.NAME = 'pluginScrollViewScrollbars';"," ","/**"," * The namespace on which the plugin will reside."," *"," * @property NS"," * @type String"," * @default 'scrollbars'"," * @static"," */","ScrollbarsPlugin.NS = 'scrollbars';","","/**"," * HTML template for the scrollbar"," *"," * @property SCROLLBAR_TEMPLATE"," * @type Object"," * @static"," */","ScrollbarsPlugin.SCROLLBAR_TEMPLATE = ["," '<div>',"," '<span class=\"' + _classNames.child + ' ' + _classNames.first + '\"></span>',"," '<span class=\"' + _classNames.child + ' ' + _classNames.middle + '\"></span>',"," '<span class=\"' + _classNames.child + ' ' + _classNames.last + '\"></span>',"," '</div>'","].join('');","","/**"," * The default attribute configuration for the plugin"," *"," * @property ATTRS"," * @type Object"," * @static"," */","ScrollbarsPlugin.ATTRS = {"," "," /**"," * Vertical scrollbar node"," *"," * @attribute verticalNode"," * @type Y.Node"," */"," verticalNode: {"," setter: '_setNode',"," valueFn: '_defaultNode'"," },",""," /**"," * Horizontal scrollbar node"," *"," * @attribute horizontalNode"," * @type Y.Node"," */"," horizontalNode: {"," setter: '_setNode',"," valueFn: '_defaultNode'"," }","};","","Y.namespace(\"Plugin\").ScrollViewScrollbars = Y.extend(ScrollbarsPlugin, Y.Plugin.Base, {",""," /**"," * Designated initializer"," *"," * @method initializer"," */ "," initializer: function() {"," this._host = this.get(\"host\");",""," this.afterHostEvent('scrollEnd', this._hostScrollEnd);"," this.afterHostMethod('scrollTo', this._update);"," this.afterHostMethod('_uiDimensionsChange', this._hostDimensionsChange);"," },",""," /**"," * Set up the DOM nodes for the scrollbars. This method is invoked whenever the"," * host's _uiDimensionsChange fires, giving us the opportunity to remove un-needed"," * scrollbars, as well as add one if necessary."," *"," * @method _hostDimensionsChange"," * @protected"," */ "," _hostDimensionsChange: function() {"," var host = this._host,"," axis = host._cAxis;",""," this._dims = host._getScrollDims();",""," if (axis && axis.y) {"," this._renderBar(this.get(VERTICAL_NODE), true, 'vert');"," }",""," if (axis && axis.x) {"," this._renderBar(this.get(HORIZONTAL_NODE), true, 'horiz');"," }",""," this._update();",""," Y.later(500, this, 'flash', true);"," },",""," /**"," * Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar"," *"," * @method _hostScrollEnd"," * @param {Event.Facade} e The event facade."," * @protected"," */"," _hostScrollEnd : function(e) {"," if (!this._host._flicking) {"," this.flash();"," }"," },",""," /**"," * Adds or removes a scrollbar node from the document."," * "," * @method _renderBar"," * @private"," * @param {Node} bar The scrollbar node"," * @param {boolean} add true, to add the node, false to remove it"," */"," _renderBar: function(bar, add) {"," var inDoc = bar.inDoc(),"," bb = this._host._bb,"," className = bar.getData(\"isHoriz\") ? _classNames.scrollbarHB : _classNames.scrollbarVB;",""," if (add && !inDoc) {"," bb.append(bar);"," bar.toggleClass(className, this._basic);"," this._setChildCache(bar);"," } else if(!add && inDoc) {"," bar.remove();"," this._clearChildCache(bar);"," }"," },",""," /**"," * Caches scrollbar child element information,"," * to optimize _update implementation "," * "," * @method _setChildCache"," * @private"," * @param {Node} node"," */"," _setChildCache : function(node) {"," var c = node.get(\"children\"),"," fc = c.item(0),"," mc = c.item(1),"," lc = c.item(2),"," size = node.getData(\"isHoriz\") ? \"offsetWidth\" : \"offsetHeight\";",""," node.setStyle(TRANSITION_PROPERTY, TRANSFORM);"," mc.setStyle(TRANSITION_PROPERTY, TRANSFORM);"," lc.setStyle(TRANSITION_PROPERTY, TRANSFORM);",""," node.setData(CHILD_CACHE, {"," fc : fc,"," lc : lc,"," mc : mc,"," fcSize : fc && fc.get(size),"," lcSize : lc && lc.get(size)"," });"," },",""," /**"," * Clears child cache"," * "," * @method _clearChildCache"," * @private"," * @param {Node} node"," */"," _clearChildCache : function(node) {"," node.clearData(CHILD_CACHE);"," },",""," /**"," * Utility method, to move/resize either vertical or horizontal scrollbars"," *"," * @method _updateBar"," * @private"," *"," * @param {Node} scrollbar The scrollbar node."," * @param {Number} current The current scroll position."," * @param {Number} duration The transition duration."," * @param {boolean} horiz true if horizontal, false if vertical."," */"," _updateBar : function(scrollbar, current, duration, horiz) {",""," var host = this._host,"," basic = this._basic,"," cb = host._cb,",""," scrollbarSize = 0,"," scrollbarPos = 1,",""," childCache = scrollbar.getData(CHILD_CACHE),"," lastChild = childCache.lc,"," middleChild = childCache.mc,"," firstChildSize = childCache.fcSize,"," lastChildSize = childCache.lcSize,"," middleChildSize,"," lastChildPosition,",""," transition,"," translate,"," scale,",""," dim,"," dimOffset,"," dimCache,"," widgetSize,"," contentSize;",""," if (horiz) {"," dim = WIDTH;"," dimOffset = LEFT;"," dimCache = HORIZ_CACHE;"," widgetSize = this._dims.offsetWidth;"," contentSize = this._dims.scrollWidth;"," translate = TRANSLATE_X;"," scale = SCALE_X;"," current = (current !== undefined) ? current : host.get(SCROLL_X);"," } else {"," dim = HEIGHT;"," dimOffset = TOP;"," dimCache = VERT_CACHE;"," widgetSize = this._dims.offsetHeight;"," contentSize = this._dims.scrollHeight;"," translate = TRANSLATE_Y;"," scale = SCALE_Y;"," current = (current !== undefined) ? current : host.get(SCROLL_Y);"," }",""," scrollbarSize = Math.floor(widgetSize * (widgetSize/contentSize));"," scrollbarPos = Math.floor((current/(contentSize - widgetSize)) * (widgetSize - scrollbarSize));"," if (scrollbarSize > widgetSize) {"," scrollbarSize = 1;"," }",""," if (scrollbarPos > (widgetSize - scrollbarSize)) {"," scrollbarSize = scrollbarSize - (scrollbarPos - (widgetSize - scrollbarSize));"," } else if (scrollbarPos < 0) {"," scrollbarSize = scrollbarPos + scrollbarSize;"," scrollbarPos = 0;"," }",""," middleChildSize = (scrollbarSize - (firstChildSize + lastChildSize));",""," if (middleChildSize < 0) {"," middleChildSize = 0;"," }",""," if (middleChildSize === 0 && scrollbarPos !== 0) {"," scrollbarPos = widgetSize - (firstChildSize + lastChildSize) - 1;"," }",""," if (duration !== 0) {"," // Position Scrollbar"," transition = {"," duration : duration"," };",""," if (NATIVE_TRANSITIONS) {"," transition.transform = translate + scrollbarPos + PX_CLOSE;"," } else {"," transition[dimOffset] = scrollbarPos + PX;"," }",""," scrollbar.transition(transition);",""," } else {"," if (NATIVE_TRANSITIONS) {"," scrollbar.setStyle(TRANSFORM, translate + scrollbarPos + PX_CLOSE);"," } else {"," scrollbar.setStyle(dimOffset, scrollbarPos + PX);"," }"," }",""," // Resize Scrollbar Middle Child"," if (this[dimCache] !== middleChildSize) {"," this[dimCache] = middleChildSize;",""," if (middleChildSize > 0) {",""," if (duration !== 0) {"," transition = {"," duration : duration "," };",""," if(NATIVE_TRANSITIONS) {"," transition.transform = scale + middleChildSize + CLOSE;"," } else {"," transition[dim] = middleChildSize + PX;"," }",""," middleChild.transition(transition);"," } else {"," if (NATIVE_TRANSITIONS) {"," middleChild.setStyle(TRANSFORM, scale + middleChildSize + CLOSE);"," } else {"," middleChild.setStyle(dim, middleChildSize + PX);"," }"," }"," "," // Position Last Child"," if (!horiz || !basic) {",""," lastChildPosition = scrollbarSize - lastChildSize;"," "," if(duration !== 0) { "," transition = {"," duration : duration"," };"," "," if (NATIVE_TRANSITIONS) {"," transition.transform = translate + lastChildPosition + PX_CLOSE; "," } else {"," transition[dimOffset] = lastChildPosition; "," }",""," lastChild.transition(transition);"," } else {"," if (NATIVE_TRANSITIONS) {"," lastChild.setStyle(TRANSFORM, translate + lastChildPosition + PX_CLOSE); "," } else {"," lastChild.setStyle(dimOffset, lastChildPosition + PX); "," }"," }"," }"," }"," }"," },",""," /**"," * AOP method, invoked after the host's _uiScrollTo method, "," * to position and resize the scroll bars"," *"," * @method _update"," * @param x {Number} The current scrollX value"," * @param y {Number} The current scrollY value"," * @param duration {Number} Number of ms of animation (optional) - used when snapping to bounds "," * @param easing {String} Optional easing equation to use during the animation, if duration is set"," * @protected"," */"," _update: function(x, y, duration, easing) {",""," var vNode = this.get(VERTICAL_NODE),"," hNode = this.get(HORIZONTAL_NODE),"," host = this._host,"," axis = host._cAxis;",""," duration = (duration || 0)/1000;",""," if (!this._showing) {"," this.show();"," }",""," if (axis && axis.y && vNode) {"," this._updateBar(vNode, y, duration, false);"," }",""," if (axis && axis.x && hNode) {"," this._updateBar(hNode, x, duration, true);"," }"," },",""," /**"," * Show the scroll bar indicators"," *"," * @method show"," * @param animated {Boolean} Whether or not to animate the showing "," */"," show: function(animated) {"," this._show(true, animated);"," },",""," /**"," * Hide the scroll bar indicators"," *"," * @method hide"," * @param animated {Boolean} Whether or not to animate the hiding"," */"," hide: function(animated) {"," this._show(false, animated);"," },",""," /**"," * Internal hide/show implementation utility method"," *"," * @method _show"," * @param {boolean} show Whether to show or hide the scrollbar "," * @param {bolean} animated Whether or not to animate while showing/hide"," * @protected"," */"," _show : function(show, animated) {",""," var verticalNode = this.get(VERTICAL_NODE),"," horizontalNode = this.get(HORIZONTAL_NODE),",""," duration = (animated) ? 0.6 : 0,"," opacity = (show) ? 1 : 0,",""," transition;",""," this._showing = show;",""," if (this._flashTimer) {"," this._flashTimer.cancel();"," }",""," transition = {"," duration : duration,"," opacity : opacity"," };",""," if (verticalNode) {"," verticalNode.transition(transition);"," }",""," if (horizontalNode) {"," horizontalNode.transition(transition);"," }"," },",""," /**"," * Momentarily flash the scroll bars to indicate current scroll position"," *"," * @method flash"," */"," flash: function() {"," var host = this._host;",""," this.show(true);"," this._flashTimer = Y.later(800, this, 'hide', true);"," },",""," /**"," * Setter for the verticalNode and horizontalNode attributes"," *"," * @method _setNode"," * @param node {Node} The Y.Node instance for the scrollbar"," * @param name {String} The attribute name"," * @return {Node} The Y.Node instance for the scrollbar"," * "," * @protected"," */"," _setNode: function(node, name) {"," var horiz = (name === HORIZONTAL_NODE);"," node = Y.one(node);",""," if (node) {"," node.addClass(_classNames.scrollbar);"," node.addClass( (horiz) ? _classNames.scrollbarH : _classNames.scrollbarV );"," node.setData(\"isHoriz\", horiz);"," }",""," return node;"," },",""," /**"," * Creates default node instances for scrollbars"," *"," * @method _defaultNode"," * @return {Node} The Y.Node instance for the scrollbar"," * "," * @protected"," */"," _defaultNode: function() {"," return Y.Node.create(ScrollbarsPlugin.SCROLLBAR_TEMPLATE);"," }, ",""," _basic: Y.UA.ie && Y.UA.ie <= 8","","});","","","}, '3.7.2', {\"requires\": [\"classnamemanager\", \"transition\", \"plugin\"], \"skinnable\": true});"];+_yuitest_coverage["build/scrollview-scrollbars/scrollview-scrollbars.js"].code=["YUI.add('scrollview-scrollbars', function (Y, NAME) {","","/**"," * Provides a plugin, which adds support for a scroll indicator to ScrollView instances"," *"," * @module scrollview"," * @submodule scrollview-scrollbars"," */","","var getClassName = Y.ClassNameManager.getClassName,"," _classNames,",""," Transition = Y.Transition,"," NATIVE_TRANSITIONS = Transition.useNative,"," SCROLLBAR = 'scrollbar',"," SCROLLVIEW = 'scrollview',",""," VERTICAL_NODE = \"verticalNode\","," HORIZONTAL_NODE = \"horizontalNode\",",""," CHILD_CACHE = \"childCache\",",""," TOP = \"top\","," LEFT = \"left\","," WIDTH = \"width\","," HEIGHT = \"height\","," SCROLL_WIDTH = \"scrollWidth\","," SCROLL_HEIGHT = \"scrollHeight\",",""," HORIZ_CACHE = \"_sbh\","," VERT_CACHE = \"_sbv\",",""," TRANSITION_PROPERTY = Y.ScrollView._TRANSITION.PROPERTY,"," TRANSFORM = \"transform\",",""," TRANSLATE_X = \"translateX(\","," TRANSLATE_Y = \"translateY(\",",""," SCALE_X = \"scaleX(\","," SCALE_Y = \"scaleY(\","," "," SCROLL_X = \"scrollX\","," SCROLL_Y = \"scrollY\",",""," PX = \"px\","," CLOSE = \")\","," PX_CLOSE = PX + CLOSE;","","/**"," * ScrollView plugin that adds scroll indicators to ScrollView instances"," *"," * @class ScrollViewScrollbars"," * @namespace Plugin"," * @extends Plugin.Base"," * @constructor"," */","function ScrollbarsPlugin() {"," ScrollbarsPlugin.superclass.constructor.apply(this, arguments);","}","","ScrollbarsPlugin.CLASS_NAMES = {"," showing: getClassName(SCROLLVIEW, SCROLLBAR, 'showing'),"," scrollbar: getClassName(SCROLLVIEW, SCROLLBAR),"," scrollbarV: getClassName(SCROLLVIEW, SCROLLBAR, 'vert'),"," scrollbarH: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz'),"," scrollbarVB: getClassName(SCROLLVIEW, SCROLLBAR, 'vert', 'basic'),"," scrollbarHB: getClassName(SCROLLVIEW, SCROLLBAR, 'horiz', 'basic'),"," child: getClassName(SCROLLVIEW, 'child'),"," first: getClassName(SCROLLVIEW, 'first'),"," middle: getClassName(SCROLLVIEW, 'middle'),"," last: getClassName(SCROLLVIEW, 'last')","};","","_classNames = ScrollbarsPlugin.CLASS_NAMES;","","/**"," * The identity of the plugin"," *"," * @property NAME"," * @type String"," * @default 'pluginScrollViewScrollbars'"," * @static"," */","ScrollbarsPlugin.NAME = 'pluginScrollViewScrollbars';"," ","/**"," * The namespace on which the plugin will reside."," *"," * @property NS"," * @type String"," * @default 'scrollbars'"," * @static"," */","ScrollbarsPlugin.NS = 'scrollbars';","","/**"," * HTML template for the scrollbar"," *"," * @property SCROLLBAR_TEMPLATE"," * @type Object"," * @static"," */","ScrollbarsPlugin.SCROLLBAR_TEMPLATE = ["," '<div>',"," '<span class=\"' + _classNames.child + ' ' + _classNames.first + '\"></span>',"," '<span class=\"' + _classNames.child + ' ' + _classNames.middle + '\"></span>',"," '<span class=\"' + _classNames.child + ' ' + _classNames.last + '\"></span>',"," '</div>'","].join('');","","/**"," * The default attribute configuration for the plugin"," *"," * @property ATTRS"," * @type Object"," * @static"," */","ScrollbarsPlugin.ATTRS = {"," "," /**"," * Vertical scrollbar node"," *"," * @attribute verticalNode"," * @type Y.Node"," */"," verticalNode: {"," setter: '_setNode',"," valueFn: '_defaultNode'"," },",""," /**"," * Horizontal scrollbar node"," *"," * @attribute horizontalNode"," * @type Y.Node"," */"," horizontalNode: {"," setter: '_setNode',"," valueFn: '_defaultNode'"," }","};","","Y.namespace(\"Plugin\").ScrollViewScrollbars = Y.extend(ScrollbarsPlugin, Y.Plugin.Base, {",""," /**"," * Designated initializer"," *"," * @method initializer"," */ "," initializer: function() {"," this._host = this.get(\"host\");",""," this.afterHostEvent('scrollEnd', this._hostScrollEnd);"," this.afterHostMethod('scrollTo', this._update);"," this.afterHostMethod('_uiDimensionsChange', this._hostDimensionsChange);"," },",""," /**"," * Set up the DOM nodes for the scrollbars. This method is invoked whenever the"," * host's _uiDimensionsChange fires, giving us the opportunity to remove un-needed"," * scrollbars, as well as add one if necessary."," *"," * @method _hostDimensionsChange"," * @protected"," */ "," _hostDimensionsChange: function() {"," var host = this._host,"," axis = host._cAxis;",""," this._dims = host._getScrollDims();",""," if (axis && axis.y) {"," this._renderBar(this.get(VERTICAL_NODE), true, 'vert');"," }",""," if (axis && axis.x) {"," this._renderBar(this.get(HORIZONTAL_NODE), true, 'horiz');"," }",""," this._update();",""," Y.later(500, this, 'flash', true);"," },",""," /**"," * Handler for the scrollEnd event fired by the host. Default implementation flashes the scrollbar"," *"," * @method _hostScrollEnd"," * @param {Event.Facade} e The event facade."," * @protected"," */"," _hostScrollEnd : function(e) {"," if (!this._host._flicking) {"," this.flash();"," }"," },",""," /**"," * Adds or removes a scrollbar node from the document."," * "," * @method _renderBar"," * @private"," * @param {Node} bar The scrollbar node"," * @param {boolean} add true, to add the node, false to remove it"," */"," _renderBar: function(bar, add) {"," var inDoc = bar.inDoc(),"," bb = this._host._bb,"," className = bar.getData(\"isHoriz\") ? _classNames.scrollbarHB : _classNames.scrollbarVB;",""," if (add && !inDoc) {"," bb.append(bar);"," bar.toggleClass(className, this._basic);"," this._setChildCache(bar);"," } else if(!add && inDoc) {"," bar.remove();"," this._clearChildCache(bar);"," }"," },",""," /**"," * Caches scrollbar child element information,"," * to optimize _update implementation "," * "," * @method _setChildCache"," * @private"," * @param {Node} node"," */"," _setChildCache : function(node) {"," var c = node.get(\"children\"),"," fc = c.item(0),"," mc = c.item(1),"," lc = c.item(2),"," size = node.getData(\"isHoriz\") ? \"offsetWidth\" : \"offsetHeight\";",""," node.setStyle(TRANSITION_PROPERTY, TRANSFORM);"," mc.setStyle(TRANSITION_PROPERTY, TRANSFORM);"," lc.setStyle(TRANSITION_PROPERTY, TRANSFORM);",""," node.setData(CHILD_CACHE, {"," fc : fc,"," lc : lc,"," mc : mc,"," fcSize : fc && fc.get(size),"," lcSize : lc && lc.get(size)"," });"," },",""," /**"," * Clears child cache"," * "," * @method _clearChildCache"," * @private"," * @param {Node} node"," */"," _clearChildCache : function(node) {"," node.clearData(CHILD_CACHE);"," },",""," /**"," * Utility method, to move/resize either vertical or horizontal scrollbars"," *"," * @method _updateBar"," * @private"," *"," * @param {Node} scrollbar The scrollbar node."," * @param {Number} current The current scroll position."," * @param {Number} duration The transition duration."," * @param {boolean} horiz true if horizontal, false if vertical."," */"," _updateBar : function(scrollbar, current, duration, horiz) {",""," var host = this._host,"," basic = this._basic,"," cb = host._cb,",""," scrollbarSize = 0,"," scrollbarPos = 1,",""," childCache = scrollbar.getData(CHILD_CACHE),"," lastChild = childCache.lc,"," middleChild = childCache.mc,"," firstChildSize = childCache.fcSize,"," lastChildSize = childCache.lcSize,"," middleChildSize,"," lastChildPosition,",""," transition,"," translate,"," scale,",""," dim,"," dimOffset,"," dimCache,"," widgetSize,"," contentSize;",""," if (horiz) {"," dim = WIDTH;"," dimOffset = LEFT;"," dimCache = HORIZ_CACHE;"," widgetSize = this._dims.offsetWidth;"," contentSize = this._dims.scrollWidth;"," translate = TRANSLATE_X;"," scale = SCALE_X;"," current = (current !== undefined) ? current : host.get(SCROLL_X);"," } else {"," dim = HEIGHT;"," dimOffset = TOP;"," dimCache = VERT_CACHE;"," widgetSize = this._dims.offsetHeight;"," contentSize = this._dims.scrollHeight;"," translate = TRANSLATE_Y;"," scale = SCALE_Y;"," current = (current !== undefined) ? current : host.get(SCROLL_Y);"," }",""," scrollbarSize = Math.floor(widgetSize * (widgetSize/contentSize));"," scrollbarPos = Math.floor((current/(contentSize - widgetSize)) * (widgetSize - scrollbarSize));"," if (scrollbarSize > widgetSize) {"," scrollbarSize = 1;"," }",""," if (scrollbarPos > (widgetSize - scrollbarSize)) {"," scrollbarSize = scrollbarSize - (scrollbarPos - (widgetSize - scrollbarSize));"," } else if (scrollbarPos < 0) {"," scrollbarSize = scrollbarPos + scrollbarSize;"," scrollbarPos = 0;"," }",""," middleChildSize = (scrollbarSize - (firstChildSize + lastChildSize));",""," if (middleChildSize < 0) {"," middleChildSize = 0;"," }",""," if (middleChildSize === 0 && scrollbarPos !== 0) {"," scrollbarPos = widgetSize - (firstChildSize + lastChildSize) - 1;"," }",""," if (duration !== 0) {"," // Position Scrollbar"," transition = {"," duration : duration"," };",""," if (NATIVE_TRANSITIONS) {"," transition.transform = translate + scrollbarPos + PX_CLOSE;"," } else {"," transition[dimOffset] = scrollbarPos + PX;"," }",""," scrollbar.transition(transition);",""," } else {"," if (NATIVE_TRANSITIONS) {"," scrollbar.setStyle(TRANSFORM, translate + scrollbarPos + PX_CLOSE);"," } else {"," scrollbar.setStyle(dimOffset, scrollbarPos + PX);"," }"," }",""," // Resize Scrollbar Middle Child"," if (this[dimCache] !== middleChildSize) {"," this[dimCache] = middleChildSize;",""," if (middleChildSize > 0) {",""," if (duration !== 0) {"," transition = {"," duration : duration "," };",""," if(NATIVE_TRANSITIONS) {"," transition.transform = scale + middleChildSize + CLOSE;"," } else {"," transition[dim] = middleChildSize + PX;"," }",""," middleChild.transition(transition);"," } else {"," if (NATIVE_TRANSITIONS) {"," middleChild.setStyle(TRANSFORM, scale + middleChildSize + CLOSE);"," } else {"," middleChild.setStyle(dim, middleChildSize + PX);"," }"," }"," "," // Position Last Child"," if (!horiz || !basic) {",""," lastChildPosition = scrollbarSize - lastChildSize;"," "," if(duration !== 0) { "," transition = {"," duration : duration"," };"," "," if (NATIVE_TRANSITIONS) {"," transition.transform = translate + lastChildPosition + PX_CLOSE; "," } else {"," transition[dimOffset] = lastChildPosition; "," }",""," lastChild.transition(transition);"," } else {"," if (NATIVE_TRANSITIONS) {"," lastChild.setStyle(TRANSFORM, translate + lastChildPosition + PX_CLOSE); "," } else {"," lastChild.setStyle(dimOffset, lastChildPosition + PX); "," }"," }"," }"," }"," }"," },",""," /**"," * AOP method, invoked after the host's _uiScrollTo method, "," * to position and resize the scroll bars"," *"," * @method _update"," * @param x {Number} The current scrollX value"," * @param y {Number} The current scrollY value"," * @param duration {Number} Number of ms of animation (optional) - used when snapping to bounds "," * @param easing {String} Optional easing equation to use during the animation, if duration is set"," * @protected"," */"," _update: function(x, y, duration, easing) {",""," var vNode = this.get(VERTICAL_NODE),"," hNode = this.get(HORIZONTAL_NODE),"," host = this._host,"," axis = host._cAxis;",""," duration = (duration || 0)/1000;",""," if (!this._showing) {"," this.show();"," }",""," if (axis && axis.y && vNode) {"," this._updateBar(vNode, y, duration, false);"," }",""," if (axis && axis.x && hNode) {"," this._updateBar(hNode, x, duration, true);"," }"," },",""," /**"," * Show the scroll bar indicators"," *"," * @method show"," * @param animated {Boolean} Whether or not to animate the showing "," */"," show: function(animated) {"," this._show(true, animated);"," },",""," /**"," * Hide the scroll bar indicators"," *"," * @method hide"," * @param animated {Boolean} Whether or not to animate the hiding"," */"," hide: function(animated) {"," this._show(false, animated);"," },",""," /**"," * Internal hide/show implementation utility method"," *"," * @method _show"," * @param {boolean} show Whether to show or hide the scrollbar "," * @param {bolean} animated Whether or not to animate while showing/hide"," * @protected"," */"," _show : function(show, animated) {",""," var verticalNode = this.get(VERTICAL_NODE),"," horizontalNode = this.get(HORIZONTAL_NODE),",""," duration = (animated) ? 0.6 : 0,"," opacity = (show) ? 1 : 0,",""," transition;",""," this._showing = show;",""," if (this._flashTimer) {"," this._flashTimer.cancel();"," }",""," transition = {"," duration : duration,"," opacity : opacity"," };",""," if (verticalNode) {"," verticalNode.transition(transition);"," }",""," if (horizontalNode) {"," horizontalNode.transition(transition);"," }"," },",""," /**"," * Momentarily flash the scroll bars to indicate current scroll position"," *"," * @method flash"," */"," flash: function() {"," var host = this._host;",""," this.show(true);"," this._flashTimer = Y.later(800, this, 'hide', true);"," },",""," /**"," * Setter for the verticalNode and horizontalNode attributes"," *"," * @method _setNode"," * @param node {Node} The Y.Node instance for the scrollbar"," * @param name {String} The attribute name"," * @return {Node} The Y.Node instance for the scrollbar"," * "," * @protected"," */"," _setNode: function(node, name) {"," var horiz = (name === HORIZONTAL_NODE);"," node = Y.one(node);",""," if (node) {"," node.addClass(_classNames.scrollbar);"," node.addClass( (horiz) ? _classNames.scrollbarH : _classNames.scrollbarV );"," node.setData(\"isHoriz\", horiz);"," }",""," return node;"," },",""," /**"," * Creates default node instances for scrollbars"," *"," * @method _defaultNode"," * @return {Node} The Y.Node instance for the scrollbar"," * "," * @protected"," */"," _defaultNode: function() {"," return Y.Node.create(ScrollbarsPlugin.SCROLLBAR_TEMPLATE);"," }, ",""," _basic: Y.UA.ie && Y.UA.ie <= 8","","});","","","}, '3.7.3', {\"requires\": [\"classnamemanager\", \"transition\", \"plugin\"], \"skinnable\": true});"]; _yuitest_coverage["build/scrollview-scrollbars/scrollview-scrollbars.js"].lines = {"1":0,"10":0,"57":0,"58":0,"61":0,"74":0,"84":0,"94":0,"103":0,"118":0,"143":0,"151":0,"153":0,"154":0,"155":0,"167":0,"170":0,"172":0,"173":0,"176":0,"177":0,"180":0,"182":0,"193":0,"194":0,"207":0,"211":0,"212":0,"213":0,"214":0,"215":0,"216":0,"217":0,"230":0,"236":0,"237":0,"238":0,"240":0,"257":0,"273":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"304":0,"305":0,"306":0,"308":0,"309":0,"310":0,"311":0,"312":0,"313":0,"314":0,"315":0,"318":0,"319":0,"320":0,"321":0,"324":0,"325":0,"326":0,"327":0,"328":0,"331":0,"333":0,"334":0,"337":0,"338":0,"341":0,"343":0,"347":0,"348":0,"350":0,"353":0,"356":0,"357":0,"359":0,"364":0,"365":0,"367":0,"369":0,"370":0,"374":0,"375":0,"377":0,"380":0,"382":0,"383":0,"385":0,"390":0,"392":0,"394":0,"395":0,"399":0,"400":0,"402":0,"405":0,"407":0,"408":0,"410":0,"431":0,"436":0,"438":0,"439":0,"442":0,"443":0,"446":0,"447":0,"458":0,"468":0,"481":0,"489":0,"491":0,"492":0,"495":0,"500":0,"501":0,"504":0,"505":0,"515":0,"517":0,"518":0,"532":0,"533":0,"535":0,"536":0,"537":0,"538":0,"541":0,"553":0}; _yuitest_coverage["build/scrollview-scrollbars/scrollview-scrollbars.js"].functions = {"ScrollbarsPlugin:57":0,"initializer:150":0,"_hostDimensionsChange:166":0,"_hostScrollEnd:192":0,"_renderBar:206":0,"_setChildCache:229":0,"_clearChildCache:256":0,"_updateBar:271":0,"_update:429":0,"show:457":0,"hide:467":0,"_show:479":0,"flash:514":0,"_setNode:531":0,"_defaultNode:552":0,"(anonymous 1):1":0}; _yuitest_coverage["build/scrollview-scrollbars/scrollview-scrollbars.js"].coveredLines = 133;@@ -53,7 +53,7 @@ _classNames, Transition = Y.Transition,- NATIVE_TRANSITIONS = Transition.useNative, + NATIVE_TRANSITIONS = Transition.useNative, SCROLLBAR = 'scrollbar', SCROLLVIEW = 'scrollview', @@ -72,7 +72,7 @@ HORIZ_CACHE = "_sbh", VERT_CACHE = "_sbv", - TRANSITION_PROPERTY = Transition._VENDOR_PREFIX + "TransitionProperty",+ TRANSITION_PROPERTY = Y.ScrollView._TRANSITION.PROPERTY, TRANSFORM = "transform", TRANSLATE_X = "translateX(",@@ -746,4 +746,4 @@ }); -}, '3.7.2', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});+}, '3.7.3', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});
bundle/scrollview-scrollbars/scrollview-scrollbars-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,7 +17,7 @@ _classNames, Transition = Y.Transition,- NATIVE_TRANSITIONS = Transition.useNative, + NATIVE_TRANSITIONS = Transition.useNative, SCROLLBAR = 'scrollbar', SCROLLVIEW = 'scrollview', @@ -36,7 +36,7 @@ HORIZ_CACHE = "_sbh", VERT_CACHE = "_sbv", - TRANSITION_PROPERTY = Transition._VENDOR_PREFIX + "TransitionProperty",+ TRANSITION_PROPERTY = Y.ScrollView._TRANSITION.PROPERTY, TRANSFORM = "transform", TRANSLATE_X = "translateX(",@@ -564,4 +564,4 @@ }); -}, '3.7.2', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});+}, '3.7.3', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});
bundle/scrollview-scrollbars/scrollview-scrollbars-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("scrollview-scrollbars",function(e,t){function O(){O.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r,i=e.Transition,s=i.useNative,o="scrollbar",u="scrollview",a="verticalNode",f="horizontalNode",l="childCache",c="top",h="left",p="width",d="height",v="scrollWidth",m="scrollHeight",g="_sbh",y="_sbv",b=i._VENDOR_PREFIX+"TransitionProperty",w="transform",E="translateX(",S="translateY(",x="scaleX(",T="scaleY(",N="scrollX",C="scrollY",k="px",L=")",A=k+L;O.CLASS_NAMES={showing:n(u,o,"showing"),scrollbar:n(u,o),scrollbarV:n(u,o,"vert"),scrollbarH:n(u,o,"horiz"),scrollbarVB:n(u,o,"vert","basic"),scrollbarHB:n(u,o,"horiz","basic"),child:n(u,"child"),first:n(u,"first"),middle:n(u,"middle"),last:n(u,"last")},r=O.CLASS_NAMES,O.NAME="pluginScrollViewScrollbars",O.NS="scrollbars",O.SCROLLBAR_TEMPLATE=["<div>",'<span class="'+r.child+" "+r.first+'"></span>','<span class="'+r.child+" "+r.middle+'"></span>','<span class="'+r.child+" "+r.last+'"></span>',"</div>"].join(""),O.ATTRS={verticalNode:{setter:"_setNode",valueFn:"_defaultNode"},horizontalNode:{setter:"_setNode",valueFn:"_defaultNode"}},e.namespace("Plugin").ScrollViewScrollbars=e.extend(O,e.Plugin.Base,{initializer:function(){this._host=this.get("host"),this.afterHostEvent("scrollEnd",this._hostScrollEnd),this.afterHostMethod("scrollTo",this._update),this.afterHostMethod("_uiDimensionsChange",this._hostDimensionsChange)},_hostDimensionsChange:function(){var t=this._host,n=t._cAxis;this._dims=t._getScrollDims(),n&&n.y&&this._renderBar(this.get(a),!0,"vert"),n&&n.x&&this._renderBar(this.get(f),!0,"horiz"),this._update(),e.later(500,this,"flash",!0)},_hostScrollEnd:function(e){this._host._flicking||this.flash()},_renderBar:function(e,t){var n=e.inDoc(),i=this._host._bb,s=e.getData("isHoriz")?r.scrollbarHB:r.scrollbarVB;t&&!n?(i.append(e),e.toggleClass(s,this._basic),this._setChildCache(e)):!t&&n&&(e.remove(),this._clearChildCache(e))},_setChildCache:function(e){var t=e.get("children"),n=t.item(0),r=t.item(1),i=t.item(2),s=e.getData("isHoriz")?"offsetWidth":"offsetHeight";e.setStyle(b,w),r.setStyle(b,w),i.setStyle(b,w),e.setData(l,{fc:n,lc:i,mc:r,fcSize:n&&n.get(s),lcSize:i&&i.get(s)})},_clearChildCache:function(e){e.clearData(l)},_updateBar:function(e,t,n,r){var i=this._host,o=this._basic,u=i._cb,a=0,f=1,v=e.getData(l),m=v.lc,b=v.mc,O=v.fcSize,M=v.lcSize,_,D,P,H,B,j,F,I,q,R;r?(j=p,F=h,I=g,q=this._dims.offsetWidth,R=this._dims.scrollWidth,H=E,B=x,t=t!==undefined?t:i.get(N)):(j=d,F=c,I=y,q=this._dims.offsetHeight,R=this._dims.scrollHeight,H=S,B=T,t=t!==undefined?t:i.get(C)),a=Math.floor(q*(q/R)),f=Math.floor(t/(R-q)*(q-a)),a>q&&(a=1),f>q-a?a-=f-(q-a):f<0&&(a=f+a,f=0),_=a-(O+M),_<0&&(_=0),_===0&&f!==0&&(f=q-(O+M)-1),n!==0?(P={duration:n},s?P.transform=H+f+A:P[F]=f+k,e.transition(P)):s?e.setStyle(w,H+f+A):e.setStyle(F,f+k);if(this[I]!==_){this[I]=_;if(_>0){n!==0?(P={duration:n},s?P.transform=B+_+L:P[j]=_+k,b.transition(P)):s?b.setStyle(w,B+_+L):b.setStyle(j,_+k);if(!r||!o)D=a-M,n!==0?(P={duration:n},s?P.transform=H+D+A:P[F]=D,m.transition(P)):s?m.setStyle(w,H+D+A):m.setStyle(F,D+k)}}},_update:function(e,t,n,r){var i=this.get(a),s=this.get(f),o=this._host,u=o._cAxis;n=(n||0)/1e3,this._showing||this.show(),u&&u.y&&i&&this._updateBar(i,t,n,!1),u&&u.x&&s&&this._updateBar(s,e,n,!0)},show:function(e){this._show(!0,e)},hide:function(e){this._show(!1,e)},_show:function(e,t){var n=this.get(a),r=this.get(f),i=t?.6:0,s=e?1:0,o;this._showing=e,this._flashTimer&&this._flashTimer.cancel(),o={duration:i,opacity:s},n&&n.transition(o),r&&r.transition(o)},flash:function(){var t=this._host;this.show(!0),this._flashTimer=e.later(800,this,"hide",!0)},_setNode:function(t,n){var i=n===f;return t=e.one(t),t&&(t.addClass(r.scrollbar),t.addClass(i?r.scrollbarH:r.scrollbarV),t.setData("isHoriz",i)),t},_defaultNode:function(){return e.Node.create(O.SCROLLBAR_TEMPLATE)},_basic:e.UA.ie&&e.UA.ie<=8})},"3.7.2",{requires:["classnamemanager","transition","plugin"],skinnable:!0});+YUI.add("scrollview-scrollbars",function(e,t){function O(){O.superclass.constructor.apply(this,arguments)}var n=e.ClassNameManager.getClassName,r,i=e.Transition,s=i.useNative,o="scrollbar",u="scrollview",a="verticalNode",f="horizontalNode",l="childCache",c="top",h="left",p="width",d="height",v="scrollWidth",m="scrollHeight",g="_sbh",y="_sbv",b=e.ScrollView._TRANSITION.PROPERTY,w="transform",E="translateX(",S="translateY(",x="scaleX(",T="scaleY(",N="scrollX",C="scrollY",k="px",L=")",A=k+L;O.CLASS_NAMES={showing:n(u,o,"showing"),scrollbar:n(u,o),scrollbarV:n(u,o,"vert"),scrollbarH:n(u,o,"horiz"),scrollbarVB:n(u,o,"vert","basic"),scrollbarHB:n(u,o,"horiz","basic"),child:n(u,"child"),first:n(u,"first"),middle:n(u,"middle"),last:n(u,"last")},r=O.CLASS_NAMES,O.NAME="pluginScrollViewScrollbars",O.NS="scrollbars",O.SCROLLBAR_TEMPLATE=["<div>",'<span class="'+r.child+" "+r.first+'"></span>','<span class="'+r.child+" "+r.middle+'"></span>','<span class="'+r.child+" "+r.last+'"></span>',"</div>"].join(""),O.ATTRS={verticalNode:{setter:"_setNode",valueFn:"_defaultNode"},horizontalNode:{setter:"_setNode",valueFn:"_defaultNode"}},e.namespace("Plugin").ScrollViewScrollbars=e.extend(O,e.Plugin.Base,{initializer:function(){this._host=this.get("host"),this.afterHostEvent("scrollEnd",this._hostScrollEnd),this.afterHostMethod("scrollTo",this._update),this.afterHostMethod("_uiDimensionsChange",this._hostDimensionsChange)},_hostDimensionsChange:function(){var t=this._host,n=t._cAxis;this._dims=t._getScrollDims(),n&&n.y&&this._renderBar(this.get(a),!0,"vert"),n&&n.x&&this._renderBar(this.get(f),!0,"horiz"),this._update(),e.later(500,this,"flash",!0)},_hostScrollEnd:function(e){this._host._flicking||this.flash()},_renderBar:function(e,t){var n=e.inDoc(),i=this._host._bb,s=e.getData("isHoriz")?r.scrollbarHB:r.scrollbarVB;t&&!n?(i.append(e),e.toggleClass(s,this._basic),this._setChildCache(e)):!t&&n&&(e.remove(),this._clearChildCache(e))},_setChildCache:function(e){var t=e.get("children"),n=t.item(0),r=t.item(1),i=t.item(2),s=e.getData("isHoriz")?"offsetWidth":"offsetHeight";e.setStyle(b,w),r.setStyle(b,w),i.setStyle(b,w),e.setData(l,{fc:n,lc:i,mc:r,fcSize:n&&n.get(s),lcSize:i&&i.get(s)})},_clearChildCache:function(e){e.clearData(l)},_updateBar:function(e,t,n,r){var i=this._host,o=this._basic,u=i._cb,a=0,f=1,v=e.getData(l),m=v.lc,b=v.mc,O=v.fcSize,M=v.lcSize,_,D,P,H,B,j,F,I,q,R;r?(j=p,F=h,I=g,q=this._dims.offsetWidth,R=this._dims.scrollWidth,H=E,B=x,t=t!==undefined?t:i.get(N)):(j=d,F=c,I=y,q=this._dims.offsetHeight,R=this._dims.scrollHeight,H=S,B=T,t=t!==undefined?t:i.get(C)),a=Math.floor(q*(q/R)),f=Math.floor(t/(R-q)*(q-a)),a>q&&(a=1),f>q-a?a-=f-(q-a):f<0&&(a=f+a,f=0),_=a-(O+M),_<0&&(_=0),_===0&&f!==0&&(f=q-(O+M)-1),n!==0?(P={duration:n},s?P.transform=H+f+A:P[F]=f+k,e.transition(P)):s?e.setStyle(w,H+f+A):e.setStyle(F,f+k);if(this[I]!==_){this[I]=_;if(_>0){n!==0?(P={duration:n},s?P.transform=B+_+L:P[j]=_+k,b.transition(P)):s?b.setStyle(w,B+_+L):b.setStyle(j,_+k);if(!r||!o)D=a-M,n!==0?(P={duration:n},s?P.transform=H+D+A:P[F]=D,m.transition(P)):s?m.setStyle(w,H+D+A):m.setStyle(F,D+k)}}},_update:function(e,t,n,r){var i=this.get(a),s=this.get(f),o=this._host,u=o._cAxis;n=(n||0)/1e3,this._showing||this.show(),u&&u.y&&i&&this._updateBar(i,t,n,!1),u&&u.x&&s&&this._updateBar(s,e,n,!0)},show:function(e){this._show(!0,e)},hide:function(e){this._show(!1,e)},_show:function(e,t){var n=this.get(a),r=this.get(f),i=t?.6:0,s=e?1:0,o;this._showing=e,this._flashTimer&&this._flashTimer.cancel(),o={duration:i,opacity:s},n&&n.transition(o),r&&r.transition(o)},flash:function(){var t=this._host;this.show(!0),this._flashTimer=e.later(800,this,"hide",!0)},_setNode:function(t,n){var i=n===f;return t=e.one(t),t&&(t.addClass(r.scrollbar),t.addClass(i?r.scrollbarH:r.scrollbarV),t.setData("isHoriz",i)),t},_defaultNode:function(){return e.Node.create(O.SCROLLBAR_TEMPLATE)},_basic:e.UA.ie&&e.UA.ie<=8})},"3.7.3",{requires:["classnamemanager","transition","plugin"],skinnable:!0});
bundle/scrollview-scrollbars/scrollview-scrollbars.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,7 +17,7 @@ _classNames, Transition = Y.Transition,- NATIVE_TRANSITIONS = Transition.useNative, + NATIVE_TRANSITIONS = Transition.useNative, SCROLLBAR = 'scrollbar', SCROLLVIEW = 'scrollview', @@ -36,7 +36,7 @@ HORIZ_CACHE = "_sbh", VERT_CACHE = "_sbv", - TRANSITION_PROPERTY = Transition._VENDOR_PREFIX + "TransitionProperty",+ TRANSITION_PROPERTY = Y.ScrollView._TRANSITION.PROPERTY, TRANSFORM = "transform", TRANSLATE_X = "translateX(",@@ -564,4 +564,4 @@ }); -}, '3.7.2', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});+}, '3.7.3', {"requires": ["classnamemanager", "transition", "plugin"], "skinnable": true});
bundle/scrollview/scrollview-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/scrollview/scrollview.js", code: [] };-_yuitest_coverage["build/scrollview/scrollview.js"].code=["YUI.add('scrollview', function (Y, NAME) {","","/**"," * <p>"," * The scrollview module does not add any new classes. It simply plugs the ScrollViewScrollbars plugin into the "," * base ScrollView class implementation provided by the scrollview-base module, so that all scrollview instances "," * have scrollbars enabled."," * </p>"," *"," * <ul>"," * <li><a href=\"../classes/ScrollView.html\">ScrollView API documentation</a></li>"," * <li><a href=\"scrollview-base.html\">scrollview-base Module documentation</a></li>"," * </ul>"," *"," * @module scrollview"," */","","Y.Base.plug(Y.ScrollView, Y.Plugin.ScrollViewScrollbars);","","","}, '3.7.2', {\"requires\": [\"scrollview-base\", \"scrollview-scrollbars\"]});"];+_yuitest_coverage["build/scrollview/scrollview.js"].code=["YUI.add('scrollview', function (Y, NAME) {","","/**"," * <p>"," * The scrollview module does not add any new classes. It simply plugs the ScrollViewScrollbars plugin into the "," * base ScrollView class implementation provided by the scrollview-base module, so that all scrollview instances "," * have scrollbars enabled."," * </p>"," *"," * <ul>"," * <li><a href=\"../classes/ScrollView.html\">ScrollView API documentation</a></li>"," * <li><a href=\"scrollview-base.html\">scrollview-base Module documentation</a></li>"," * </ul>"," *"," * @module scrollview"," */","","Y.Base.plug(Y.ScrollView, Y.Plugin.ScrollViewScrollbars);","","","}, '3.7.3', {\"requires\": [\"scrollview-base\", \"scrollview-scrollbars\"]});"]; _yuitest_coverage["build/scrollview/scrollview.js"].lines = {"1":0,"18":0}; _yuitest_coverage["build/scrollview/scrollview.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/scrollview/scrollview.js"].coveredLines = 2;@@ -60,4 +60,4 @@ Y.Base.plug(Y.ScrollView, Y.Plugin.ScrollViewScrollbars); -}, '3.7.2', {"requires": ["scrollview-base", "scrollview-scrollbars"]});+}, '3.7.3', {"requires": ["scrollview-base", "scrollview-scrollbars"]});
bundle/scrollview/scrollview-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -24,4 +24,4 @@ Y.Base.plug(Y.ScrollView, Y.Plugin.ScrollViewScrollbars); -}, '3.7.2', {"requires": ["scrollview-base", "scrollview-scrollbars"]});+}, '3.7.3', {"requires": ["scrollview-base", "scrollview-scrollbars"]});
bundle/scrollview/scrollview-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("scrollview",function(e,t){e.Base.plug(e.ScrollView,e.Plugin.ScrollViewScrollbars)},"3.7.2",{requires:["scrollview-base","scrollview-scrollbars"]});+YUI.add("scrollview",function(e,t){e.Base.plug(e.ScrollView,e.Plugin.ScrollViewScrollbars)},"3.7.3",{requires:["scrollview-base","scrollview-scrollbars"]});
bundle/scrollview/scrollview.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -24,4 +24,4 @@ Y.Base.plug(Y.ScrollView, Y.Plugin.ScrollViewScrollbars); -}, '3.7.2', {"requires": ["scrollview-base", "scrollview-scrollbars"]});+}, '3.7.3', {"requires": ["scrollview-base", "scrollview-scrollbars"]});
bundle/selector-css2/selector-css2-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/selector-css2/selector-css2.js", code: [] };-_yuitest_coverage["build/selector-css2/selector-css2.js"].code=["YUI.add('selector-css2', function (Y, NAME) {","","/**"," * The selector module provides helper methods allowing CSS2 Selectors to be used with DOM elements."," * @module dom"," * @submodule selector-css2"," * @for Selector"," */","","/*"," * Provides helper methods for collecting and filtering DOM elements."," */","","var PARENT_NODE = 'parentNode',"," TAG_NAME = 'tagName',"," ATTRIBUTES = 'attributes',"," COMBINATOR = 'combinator',"," PSEUDOS = 'pseudos',",""," Selector = Y.Selector,",""," SelectorCSS2 = {"," _reRegExpTokens: /([\\^\\$\\?\\[\\]\\*\\+\\-\\.\\(\\)\\|\\\\])/,"," SORT_RESULTS: true,",""," // TODO: better detection, document specific"," _isXML: (function() {"," var isXML = (Y.config.doc.createElement('div').tagName !== 'DIV');"," return isXML;"," }()),",""," /**"," * Mapping of shorthand tokens to corresponding attribute selector "," * @property shorthand"," * @type object"," */"," shorthand: {"," '\\\\#(-?[_a-z0-9]+[-\\\\w\\\\uE000]*)': '[id=$1]',"," '\\\\.(-?[_a-z]+[-\\\\w\\\\uE000]*)': '[className~=$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(node, attr) { return Y.DOM.getAttribute(node, attr) !== ''; }, // Just test for existence of attribute"," '~=': '(?:^|\\\\s+){val}(?:\\\\s+|$)', // space-delimited"," '|=': '^{val}-?' // optional hyphen-delimited"," },",""," pseudos: {"," 'first-child': function(node) { "," return Y.DOM._children(node[PARENT_NODE])[0] === node; "," } "," },",""," _bruteQuery: function(selector, root, firstOnly) {"," var ret = [],"," nodes = [],"," tokens = Selector._tokenize(selector),"," token = tokens[tokens.length - 1],"," rootDoc = Y.DOM._getDoc(root),"," child,"," id,"," className,"," tagName;",""," if (token) {"," // prefilter nodes"," id = token.id;"," className = token.className;"," tagName = token.tagName || '*';",""," if (root.getElementsByTagName) { // non-IE lacks DOM api on doc frags"," // try ID first, unless no root.all && root not in document"," // (root.all works off document, but not getElementById)"," if (id && (root.all || (root.nodeType === 9 || Y.DOM.inDoc(root)))) {"," nodes = Y.DOM.allById(id, root);"," // try className"," } else if (className) {"," nodes = root.getElementsByClassName(className);"," } else { // default to tagName"," nodes = root.getElementsByTagName(tagName);"," }",""," } else { // brute getElementsByTagName()"," child = root.firstChild;"," while (child) {"," // only collect HTMLElements"," // match tag to supplement missing getElementsByTagName"," if (child.tagName && (tagName === '*' || child.tagName === tagName)) {"," nodes.push(child);"," }"," child = child.nextSibling || child.firstChild;"," }"," }"," if (nodes.length) {"," ret = Selector._filterNodes(nodes, tokens, firstOnly);"," }"," }",""," return ret;"," },"," "," _filterNodes: function(nodes, tokens, firstOnly) {"," var i = 0,"," j,"," len = tokens.length,"," n = len - 1,"," result = [],"," node = nodes[0],"," tmpNode = node,"," getters = Y.Selector.getters,"," operator,"," combinator,"," token,"," path,"," pass,"," value,"," tests,"," test;",""," for (i = 0; (tmpNode = node = nodes[i++]);) {"," n = len - 1;"," path = null;"," "," testLoop:"," while (tmpNode && tmpNode.tagName) {"," token = tokens[n];"," tests = token.tests;"," j = tests.length;"," if (j && !pass) {"," while ((test = tests[--j])) {"," operator = test[1];"," if (getters[test[0]]) {"," value = getters[test[0]](tmpNode, test[0]);"," } else {"," value = tmpNode[test[0]];"," if (test[0] === 'tagName' && !Selector._isXML) {"," value = value.toUpperCase(); "," }"," if (typeof value != 'string' && value !== undefined && value.toString) {"," value = value.toString(); // coerce for comparison"," } else if (value === undefined && tmpNode.getAttribute) {"," // use getAttribute for non-standard attributes"," value = tmpNode.getAttribute(test[0], 2); // 2 === force string for IE"," }"," }",""," if ((operator === '=' && value !== test[2]) || // fast path for equality"," (typeof operator !== 'string' && // protect against String.test monkey-patch (Moo)"," operator.test && !operator.test(value)) || // regex test"," (!operator.test && // protect against RegExp as function (webkit)"," typeof operator === 'function' && !operator(tmpNode, test[0], test[2]))) { // function test",""," // skip non element nodes or non-matching tags"," if ((tmpNode = tmpNode[path])) {"," while (tmpNode &&"," (!tmpNode.tagName ||"," (token.tagName && token.tagName !== tmpNode.tagName))"," ) {"," tmpNode = tmpNode[path]; "," }"," }"," continue testLoop;"," }"," }"," }",""," n--; // move to next token"," // now that we've passed the test, move up the tree by combinator"," if (!pass && (combinator = token.combinator)) {"," path = combinator.axis;"," tmpNode = tmpNode[path];",""," // skip non element nodes"," while (tmpNode && !tmpNode.tagName) {"," tmpNode = tmpNode[path]; "," }",""," if (combinator.direct) { // one pass only"," path = null; "," }",""," } else { // success if we made it this far"," result.push(node);"," if (firstOnly) {"," return result;"," }"," break;"," }"," }"," }"," node = tmpNode = null;"," return result;"," },",""," combinators: {"," ' ': {"," axis: 'parentNode'"," },",""," '>': {"," axis: 'parentNode',"," direct: true"," },","",""," '+': {"," axis: 'previousSibling',"," direct: true"," }"," },",""," _parsers: ["," {"," name: ATTRIBUTES,"," re: /^\\uE003(-?[a-z]+[\\w\\-]*)+([~\\|\\^\\$\\*!=]=?)?['\"]?([^\\uE004'\"]*)['\"]?\\uE004/i,"," fn: function(match, token) {"," var operator = match[2] || '',"," operators = Selector.operators,"," escVal = (match[3]) ? match[3].replace(/\\\\/g, '') : '',"," test;",""," // add prefiltering for ID and CLASS"," if ((match[1] === 'id' && operator === '=') ||"," (match[1] === 'className' &&"," Y.config.doc.documentElement.getElementsByClassName &&"," (operator === '~=' || operator === '='))) {"," token.prefilter = match[1];","",""," match[3] = escVal; ",""," // escape all but ID for prefilter, which may run through QSA (via Dom.allById)"," token[match[1]] = (match[1] === 'id') ? match[3] : escVal;",""," }",""," // add tests"," if (operator in operators) {"," test = operators[operator];"," if (typeof test === 'string') {"," match[3] = escVal.replace(Selector._reRegExpTokens, '\\\\$1');"," test = new RegExp(test.replace('{val}', match[3]));"," }"," match[2] = test;"," }"," if (!token.last || token.prefilter !== match[1]) {"," return match.slice(1);"," }"," }"," },"," {"," name: TAG_NAME,"," re: /^((?:-?[_a-z]+[\\w-]*)|\\*)/i,"," fn: function(match, token) {"," var tag = match[1];",""," if (!Selector._isXML) {"," tag = tag.toUpperCase();"," }",""," token.tagName = tag;",""," if (tag !== '*' && (!token.last || token.prefilter)) {"," return [TAG_NAME, '=', tag];"," }"," if (!token.prefilter) {"," token.prefilter = 'tagName';"," }"," }"," },"," {"," name: COMBINATOR,"," re: /^\\s*([>+~]|\\s)\\s*/,"," fn: function(match, token) {"," }"," },"," {"," name: PSEUDOS,"," re: /^:([\\-\\w]+)(?:\\uE005['\"]?([^\\uE005]*)['\"]?\\uE006)*/i,"," fn: function(match, token) {"," var test = Selector[PSEUDOS][match[1]];"," if (test) { // reorder match array and unescape special chars for tests"," if (match[2]) {"," match[2] = match[2].replace(/\\\\/g, '');"," }"," return [match[2], test]; "," } else { // selector token not supported (possibly missing CSS3 module)"," return false;"," }"," }"," }"," ],",""," _getToken: function(token) {"," return {"," tagName: null,"," id: null,"," className: null,"," attributes: {},"," combinator: null,"," tests: []"," };"," },",""," /*"," Break selector into token units per simple selector."," Combinator is attached to the previous token."," */"," _tokenize: function(selector) {"," selector = selector || '';"," selector = Selector._parseSelector(Y.Lang.trim(selector)); "," var token = Selector._getToken(), // one token per simple selector (left selector holds combinator)"," query = selector, // original query for debug report"," tokens = [], // array of tokens"," found = false, // whether or not any matches were found this pass"," match, // the regex match"," test,"," i, parser;",""," /*"," 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]'"," */"," outer:"," do {"," found = false; // reset after full pass"," for (i = 0; (parser = Selector._parsers[i++]);) {"," if ( (match = parser.re.exec(selector)) ) { // note assignment"," if (parser.name !== COMBINATOR ) {"," token.selector = selector;"," }"," selector = selector.replace(match[0], ''); // strip current match from selector"," if (!selector.length) {"," token.last = true;"," }",""," if (Selector._attrFilters[match[1]]) { // convert class to className, etc."," match[1] = Selector._attrFilters[match[1]];"," }",""," test = parser.fn(match, token);"," if (test === false) { // selector not supported"," found = false;"," break outer;"," } else if (test) {"," token.tests.push(test);"," }",""," if (!selector.length || parser.name === COMBINATOR) {"," tokens.push(token);"," token = Selector._getToken(token);"," if (parser.name === COMBINATOR) {"," token.combinator = Y.Selector.combinators[match[1]];"," }"," }"," found = true;"," }"," }"," } while (found && selector.length);",""," if (!found || selector.length) { // not fully parsed"," tokens = [];"," }"," return tokens;"," },",""," _replaceMarkers: function(selector) {"," selector = selector.replace(/\\[/g, '\\uE003');"," selector = selector.replace(/\\]/g, '\\uE004');",""," selector = selector.replace(/\\(/g, '\\uE005');"," selector = selector.replace(/\\)/g, '\\uE006');"," return selector;"," },",""," _replaceShorthand: function(selector) {"," var shorthand = Y.Selector.shorthand,"," re;",""," for (re in shorthand) {"," if (shorthand.hasOwnProperty(re)) {"," selector = selector.replace(new RegExp(re, 'gi'), shorthand[re]);"," }"," }",""," return selector;"," },",""," _parseSelector: function(selector) {"," var replaced = Y.Selector._replaceSelector(selector),"," selector = replaced.selector;",""," // replace shorthand (\".foo, #bar\") after pseudos and attrs"," // to avoid replacing unescaped chars"," selector = Y.Selector._replaceShorthand(selector);",""," selector = Y.Selector._restore('attr', selector, replaced.attrs);"," selector = Y.Selector._restore('pseudo', selector, replaced.pseudos);",""," // replace braces and parens before restoring escaped chars"," // to avoid replacing ecaped markers"," selector = Y.Selector._replaceMarkers(selector);"," selector = Y.Selector._restore('esc', selector, replaced.esc);",""," return selector;"," },",""," _attrFilters: {"," 'class': 'className',"," 'for': 'htmlFor'"," },",""," getters: {"," href: function(node, attr) {"," return Y.DOM.getAttribute(node, attr);"," },",""," id: function(node, attr) {"," return Y.DOM.getId(node);"," }"," }"," };","","Y.mix(Y.Selector, SelectorCSS2, true);","Y.Selector.getters.src = Y.Selector.getters.rel = Y.Selector.getters.href;","","// IE wants class with native queries","if (Y.Selector.useNative && Y.config.doc.querySelector) {"," Y.Selector.shorthand['\\\\.(-?[_a-z]+[-\\\\w]*)'] = '[class~=$1]';","}","","","","}, '3.7.2', {\"requires\": [\"selector-native\"]});"];+_yuitest_coverage["build/selector-css2/selector-css2.js"].code=["YUI.add('selector-css2', function (Y, NAME) {","","/**"," * The selector module provides helper methods allowing CSS2 Selectors to be used with DOM elements."," * @module dom"," * @submodule selector-css2"," * @for Selector"," */","","/*"," * Provides helper methods for collecting and filtering DOM elements."," */","","var PARENT_NODE = 'parentNode',"," TAG_NAME = 'tagName',"," ATTRIBUTES = 'attributes',"," COMBINATOR = 'combinator',"," PSEUDOS = 'pseudos',",""," Selector = Y.Selector,",""," SelectorCSS2 = {"," _reRegExpTokens: /([\\^\\$\\?\\[\\]\\*\\+\\-\\.\\(\\)\\|\\\\])/,"," SORT_RESULTS: true,",""," // TODO: better detection, document specific"," _isXML: (function() {"," var isXML = (Y.config.doc.createElement('div').tagName !== 'DIV');"," return isXML;"," }()),",""," /**"," * Mapping of shorthand tokens to corresponding attribute selector "," * @property shorthand"," * @type object"," */"," shorthand: {"," '\\\\#(-?[_a-z0-9]+[-\\\\w\\\\uE000]*)': '[id=$1]',"," '\\\\.(-?[_a-z]+[-\\\\w\\\\uE000]*)': '[className~=$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(node, attr) { return Y.DOM.getAttribute(node, attr) !== ''; }, // Just test for existence of attribute"," '~=': '(?:^|\\\\s+){val}(?:\\\\s+|$)', // space-delimited"," '|=': '^{val}-?' // optional hyphen-delimited"," },",""," pseudos: {"," 'first-child': function(node) { "," return Y.DOM._children(node[PARENT_NODE])[0] === node; "," } "," },",""," _bruteQuery: function(selector, root, firstOnly) {"," var ret = [],"," nodes = [],"," tokens = Selector._tokenize(selector),"," token = tokens[tokens.length - 1],"," rootDoc = Y.DOM._getDoc(root),"," child,"," id,"," className,"," tagName;",""," if (token) {"," // prefilter nodes"," id = token.id;"," className = token.className;"," tagName = token.tagName || '*';",""," if (root.getElementsByTagName) { // non-IE lacks DOM api on doc frags"," // try ID first, unless no root.all && root not in document"," // (root.all works off document, but not getElementById)"," if (id && (root.all || (root.nodeType === 9 || Y.DOM.inDoc(root)))) {"," nodes = Y.DOM.allById(id, root);"," // try className"," } else if (className) {"," nodes = root.getElementsByClassName(className);"," } else { // default to tagName"," nodes = root.getElementsByTagName(tagName);"," }",""," } else { // brute getElementsByTagName()"," child = root.firstChild;"," while (child) {"," // only collect HTMLElements"," // match tag to supplement missing getElementsByTagName"," if (child.tagName && (tagName === '*' || child.tagName === tagName)) {"," nodes.push(child);"," }"," child = child.nextSibling || child.firstChild;"," }"," }"," if (nodes.length) {"," ret = Selector._filterNodes(nodes, tokens, firstOnly);"," }"," }",""," return ret;"," },"," "," _filterNodes: function(nodes, tokens, firstOnly) {"," var i = 0,"," j,"," len = tokens.length,"," n = len - 1,"," result = [],"," node = nodes[0],"," tmpNode = node,"," getters = Y.Selector.getters,"," operator,"," combinator,"," token,"," path,"," pass,"," value,"," tests,"," test;",""," for (i = 0; (tmpNode = node = nodes[i++]);) {"," n = len - 1;"," path = null;"," "," testLoop:"," while (tmpNode && tmpNode.tagName) {"," token = tokens[n];"," tests = token.tests;"," j = tests.length;"," if (j && !pass) {"," while ((test = tests[--j])) {"," operator = test[1];"," if (getters[test[0]]) {"," value = getters[test[0]](tmpNode, test[0]);"," } else {"," value = tmpNode[test[0]];"," if (test[0] === 'tagName' && !Selector._isXML) {"," value = value.toUpperCase(); "," }"," if (typeof value != 'string' && value !== undefined && value.toString) {"," value = value.toString(); // coerce for comparison"," } else if (value === undefined && tmpNode.getAttribute) {"," // use getAttribute for non-standard attributes"," value = tmpNode.getAttribute(test[0], 2); // 2 === force string for IE"," }"," }",""," if ((operator === '=' && value !== test[2]) || // fast path for equality"," (typeof operator !== 'string' && // protect against String.test monkey-patch (Moo)"," operator.test && !operator.test(value)) || // regex test"," (!operator.test && // protect against RegExp as function (webkit)"," typeof operator === 'function' && !operator(tmpNode, test[0], test[2]))) { // function test",""," // skip non element nodes or non-matching tags"," if ((tmpNode = tmpNode[path])) {"," while (tmpNode &&"," (!tmpNode.tagName ||"," (token.tagName && token.tagName !== tmpNode.tagName))"," ) {"," tmpNode = tmpNode[path]; "," }"," }"," continue testLoop;"," }"," }"," }",""," n--; // move to next token"," // now that we've passed the test, move up the tree by combinator"," if (!pass && (combinator = token.combinator)) {"," path = combinator.axis;"," tmpNode = tmpNode[path];",""," // skip non element nodes"," while (tmpNode && !tmpNode.tagName) {"," tmpNode = tmpNode[path]; "," }",""," if (combinator.direct) { // one pass only"," path = null; "," }",""," } else { // success if we made it this far"," result.push(node);"," if (firstOnly) {"," return result;"," }"," break;"," }"," }"," }"," node = tmpNode = null;"," return result;"," },",""," combinators: {"," ' ': {"," axis: 'parentNode'"," },",""," '>': {"," axis: 'parentNode',"," direct: true"," },","",""," '+': {"," axis: 'previousSibling',"," direct: true"," }"," },",""," _parsers: ["," {"," name: ATTRIBUTES,"," re: /^\\uE003(-?[a-z]+[\\w\\-]*)+([~\\|\\^\\$\\*!=]=?)?['\"]?([^\\uE004'\"]*)['\"]?\\uE004/i,"," fn: function(match, token) {"," var operator = match[2] || '',"," operators = Selector.operators,"," escVal = (match[3]) ? match[3].replace(/\\\\/g, '') : '',"," test;",""," // add prefiltering for ID and CLASS"," if ((match[1] === 'id' && operator === '=') ||"," (match[1] === 'className' &&"," Y.config.doc.documentElement.getElementsByClassName &&"," (operator === '~=' || operator === '='))) {"," token.prefilter = match[1];","",""," match[3] = escVal; ",""," // escape all but ID for prefilter, which may run through QSA (via Dom.allById)"," token[match[1]] = (match[1] === 'id') ? match[3] : escVal;",""," }",""," // add tests"," if (operator in operators) {"," test = operators[operator];"," if (typeof test === 'string') {"," match[3] = escVal.replace(Selector._reRegExpTokens, '\\\\$1');"," test = new RegExp(test.replace('{val}', match[3]));"," }"," match[2] = test;"," }"," if (!token.last || token.prefilter !== match[1]) {"," return match.slice(1);"," }"," }"," },"," {"," name: TAG_NAME,"," re: /^((?:-?[_a-z]+[\\w-]*)|\\*)/i,"," fn: function(match, token) {"," var tag = match[1];",""," if (!Selector._isXML) {"," tag = tag.toUpperCase();"," }",""," token.tagName = tag;",""," if (tag !== '*' && (!token.last || token.prefilter)) {"," return [TAG_NAME, '=', tag];"," }"," if (!token.prefilter) {"," token.prefilter = 'tagName';"," }"," }"," },"," {"," name: COMBINATOR,"," re: /^\\s*([>+~]|\\s)\\s*/,"," fn: function(match, token) {"," }"," },"," {"," name: PSEUDOS,"," re: /^:([\\-\\w]+)(?:\\uE005['\"]?([^\\uE005]*)['\"]?\\uE006)*/i,"," fn: function(match, token) {"," var test = Selector[PSEUDOS][match[1]];"," if (test) { // reorder match array and unescape special chars for tests"," if (match[2]) {"," match[2] = match[2].replace(/\\\\/g, '');"," }"," return [match[2], test]; "," } else { // selector token not supported (possibly missing CSS3 module)"," return false;"," }"," }"," }"," ],",""," _getToken: function(token) {"," return {"," tagName: null,"," id: null,"," className: null,"," attributes: {},"," combinator: null,"," tests: []"," };"," },",""," /*"," Break selector into token units per simple selector."," Combinator is attached to the previous token."," */"," _tokenize: function(selector) {"," selector = selector || '';"," selector = Selector._parseSelector(Y.Lang.trim(selector)); "," var token = Selector._getToken(), // one token per simple selector (left selector holds combinator)"," query = selector, // original query for debug report"," tokens = [], // array of tokens"," found = false, // whether or not any matches were found this pass"," match, // the regex match"," test,"," i, parser;",""," /*"," 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]'"," */"," outer:"," do {"," found = false; // reset after full pass"," for (i = 0; (parser = Selector._parsers[i++]);) {"," if ( (match = parser.re.exec(selector)) ) { // note assignment"," if (parser.name !== COMBINATOR ) {"," token.selector = selector;"," }"," selector = selector.replace(match[0], ''); // strip current match from selector"," if (!selector.length) {"," token.last = true;"," }",""," if (Selector._attrFilters[match[1]]) { // convert class to className, etc."," match[1] = Selector._attrFilters[match[1]];"," }",""," test = parser.fn(match, token);"," if (test === false) { // selector not supported"," found = false;"," break outer;"," } else if (test) {"," token.tests.push(test);"," }",""," if (!selector.length || parser.name === COMBINATOR) {"," tokens.push(token);"," token = Selector._getToken(token);"," if (parser.name === COMBINATOR) {"," token.combinator = Y.Selector.combinators[match[1]];"," }"," }"," found = true;"," }"," }"," } while (found && selector.length);",""," if (!found || selector.length) { // not fully parsed"," tokens = [];"," }"," return tokens;"," },",""," _replaceMarkers: function(selector) {"," selector = selector.replace(/\\[/g, '\\uE003');"," selector = selector.replace(/\\]/g, '\\uE004');",""," selector = selector.replace(/\\(/g, '\\uE005');"," selector = selector.replace(/\\)/g, '\\uE006');"," return selector;"," },",""," _replaceShorthand: function(selector) {"," var shorthand = Y.Selector.shorthand,"," re;",""," for (re in shorthand) {"," if (shorthand.hasOwnProperty(re)) {"," selector = selector.replace(new RegExp(re, 'gi'), shorthand[re]);"," }"," }",""," return selector;"," },",""," _parseSelector: function(selector) {"," var replaced = Y.Selector._replaceSelector(selector),"," selector = replaced.selector;",""," // replace shorthand (\".foo, #bar\") after pseudos and attrs"," // to avoid replacing unescaped chars"," selector = Y.Selector._replaceShorthand(selector);",""," selector = Y.Selector._restore('attr', selector, replaced.attrs);"," selector = Y.Selector._restore('pseudo', selector, replaced.pseudos);",""," // replace braces and parens before restoring escaped chars"," // to avoid replacing ecaped markers"," selector = Y.Selector._replaceMarkers(selector);"," selector = Y.Selector._restore('esc', selector, replaced.esc);",""," return selector;"," },",""," _attrFilters: {"," 'class': 'className',"," 'for': 'htmlFor'"," },",""," getters: {"," href: function(node, attr) {"," return Y.DOM.getAttribute(node, attr);"," },",""," id: function(node, attr) {"," return Y.DOM.getId(node);"," }"," }"," };","","Y.mix(Y.Selector, SelectorCSS2, true);","Y.Selector.getters.src = Y.Selector.getters.rel = Y.Selector.getters.href;","","// IE wants class with native queries","if (Y.Selector.useNative && Y.config.doc.querySelector) {"," Y.Selector.shorthand['\\\\.(-?[_a-z]+[-\\\\w]*)'] = '[class~=$1]';","}","","","","}, '3.7.3', {\"requires\": [\"selector-native\"]});"]; _yuitest_coverage["build/selector-css2/selector-css2.js"].lines = {"1":0,"14":0,"28":0,"29":0,"49":0,"56":0,"61":0,"71":0,"73":0,"74":0,"75":0,"77":0,"80":0,"81":0,"83":0,"84":0,"86":0,"90":0,"91":0,"94":0,"95":0,"97":0,"100":0,"101":0,"105":0,"109":0,"126":0,"127":0,"128":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"141":0,"142":0,"143":0,"145":0,"146":0,"147":0,"149":0,"153":0,"160":0,"161":0,"165":0,"168":0,"173":0,"175":0,"176":0,"177":0,"180":0,"181":0,"184":0,"185":0,"189":0,"190":0,"191":0,"193":0,"197":0,"198":0,"223":0,"229":0,"233":0,"236":0,"239":0,"244":0,"245":0,"246":0,"247":0,"248":0,"250":0,"252":0,"253":0,"261":0,"263":0,"264":0,"267":0,"269":0,"270":0,"272":0,"273":0,"287":0,"288":0,"289":0,"290":0,"292":0,"294":0,"301":0,"316":0,"317":0,"318":0,"334":0,"335":0,"336":0,"337":0,"338":0,"339":0,"340":0,"342":0,"343":0,"344":0,"347":0,"348":0,"351":0,"352":0,"353":0,"354":0,"355":0,"356":0,"359":0,"360":0,"361":0,"362":0,"363":0,"366":0,"371":0,"372":0,"374":0,"378":0,"379":0,"381":0,"382":0,"383":0,"387":0,"390":0,"391":0,"392":0,"396":0,"400":0,"405":0,"407":0,"408":0,"412":0,"413":0,"415":0,"425":0,"429":0,"434":0,"435":0,"438":0,"439":0}; _yuitest_coverage["build/selector-css2/selector-css2.js"].functions = {"(anonymous 2):27":0,"\'\':49":0,"\'first-child\':55":0,"_bruteQuery:60":0,"_filterNodes:108":0,"fn:222":0,"fn:260":0,"fn:286":0,"_getToken:300":0,"_tokenize:315":0,"_replaceMarkers:377":0,"_replaceShorthand:386":0,"_parseSelector:399":0,"href:424":0,"id:428":0,"(anonymous 1):1":0}; _yuitest_coverage["build/selector-css2/selector-css2.js"].coveredLines = 146;@@ -642,4 +642,4 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]});
bundle/selector-css2/selector-css2-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -448,4 +448,4 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]});
bundle/selector-css2/selector-css2-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("selector-css2",function(e,t){var n="parentNode",r="tagName",i="attributes",s="combinator",o="pseudos",u=e.Selector,a={_reRegExpTokens:/([\^\$\?\[\]\*\+\-\.\(\)\|\\])/,SORT_RESULTS:!0,_isXML:function(){var t=e.config.doc.createElement("div").tagName!=="DIV";return t}(),shorthand:{"\\#(-?[_a-z0-9]+[-\\w\\uE000]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w\\uE000]*)":"[className~=$1]"},operators:{"":function(t,n){return e.DOM.getAttribute(t,n)!==""},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(t){return e.DOM._children(t[n])[0]===t}},_bruteQuery:function(t,n,r){var i=[],s=[],o=u._tokenize(t),a=o[o.length-1],f=e.DOM._getDoc(n),l,c,h,p;if(a){c=a.id,h=a.className,p=a.tagName||"*";if(n.getElementsByTagName)c&&(n.all||n.nodeType===9||e.DOM.inDoc(n))?s=e.DOM.allById(c,n):h?s=n.getElementsByClassName(h):s=n.getElementsByTagName(p);else{l=n.firstChild;while(l)l.tagName&&(p==="*"||l.tagName===p)&&s.push(l),l=l.nextSibling||l.firstChild}s.length&&(i=u._filterNodes(s,o,r))}return i},_filterNodes:function(t,n,r){var i=0,s,o=n.length,a=o-1,f=[],l=t[0],c=l,h=e.Selector.getters,p,d,v,m,g,y,b,w;for(i=0;c=l=t[i++];){a=o-1,m=null;e:while(c&&c.tagName){v=n[a],b=v.tests,s=b.length;if(s&&!g)while(w=b[--s]){p=w[1],h[w[0]]?y=h[w[0]](c,w[0]):(y=c[w[0]],w[0]==="tagName"&&!u._isXML&&(y=y.toUpperCase()),typeof y!="string"&&y!==undefined&&y.toString?y=y.toString():y===undefined&&c.getAttribute&&(y=c.getAttribute(w[0],2)));if(p==="="&&y!==w[2]||typeof p!="string"&&p.test&&!p.test(y)||!p.test&&typeof p=="function"&&!p(c,w[0],w[2])){if(c=c[m])while(c&&(!c.tagName||v.tagName&&v.tagName!==c.tagName))c=c[m];continue e}}a--;if(!!g||!(d=v.combinator)){f.push(l);if(r)return f;break}m=d.axis,c=c[m];while(c&&!c.tagName)c=c[m];d.direct&&(m=null)}}return l=c=null,f},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:!0},"+":{axis:"previousSibling",direct:!0}},_parsers:[{name:i,re:/^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i,fn:function(t,n){var r=t[2]||"",i=u.operators,s=t[3]?t[3].replace(/\\/g,""):"",o;if(t[1]==="id"&&r==="="||t[1]==="className"&&e.config.doc.documentElement.getElementsByClassName&&(r==="~="||r==="="))n.prefilter=t[1],t[3]=s,n[t[1]]=t[1]==="id"?t[3]:s;r in i&&(o=i[r],typeof o=="string"&&(t[3]=s.replace(u._reRegExpTokens,"\\$1"),o=new RegExp(o.replace("{val}",t[3]))),t[2]=o);if(!n.last||n.prefilter!==t[1])return t.slice(1)}},{name:r,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(e,t){var n=e[1];u._isXML||(n=n.toUpperCase()),t.tagName=n;if(n!=="*"&&(!t.last||t.prefilter))return[r,"=",n];t.prefilter||(t.prefilter="tagName")}},{name:s,re:/^\s*([>+~]|\s)\s*/,fn:function(e,t){}},{name:o,re:/^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i,fn:function(e,t){var n=u[o][e[1]];return n?(e[2]&&(e[2]=e[2].replace(/\\/g,"")),[e[2],n]):!1}}],_getToken:function(e){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]}},_tokenize:function(t){t=t||"",t=u._parseSelector(e.Lang.trim(t));var n=u._getToken(),r=t,i=[],o=!1,a,f,l,c;e:do{o=!1;for(l=0;c=u._parsers[l++];)if(a=c.re.exec(t)){c.name!==s&&(n.selector=t),t=t.replace(a[0],""),t.length||(n.last=!0),u._attrFilters[a[1]]&&(a[1]=u._attrFilters[a[1]]),f=c.fn(a,n);if(f===!1){o=!1;break e}f&&n.tests.push(f);if(!t.length||c.name===s)i.push(n),n=u._getToken(n),c.name===s&&(n.combinator=e.Selector.combinators[a[1]]);o=!0}}while(o&&t.length);if(!o||t.length)i=[];return i},_replaceMarkers:function(e){return e=e.replace(/\[/g,"\ue003"),e=e.replace(/\]/g,"\ue004"),e=e.replace(/\(/g,"\ue005"),e=e.replace(/\)/g,"\ue006"),e},_replaceShorthand:function(t){var n=e.Selector.shorthand,r;for(r in n)n.hasOwnProperty(r)&&(t=t.replace(new RegExp(r,"gi"),n[r]));return t},_parseSelector:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t=e.Selector._replaceShorthand(t),t=e.Selector._restore("attr",t,n.attrs),t=e.Selector._restore("pseudo",t,n.pseudos),t=e.Selector._replaceMarkers(t),t=e.Selector._restore("esc",t,n.esc),t},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(t,n){return e.DOM.getAttribute(t,n)},id:function(t,n){return e.DOM.getId(t)}}};e.mix(e.Selector,a,!0),e.Selector.getters.src=e.Selector.getters.rel=e.Selector.getters.href,e.Selector.useNative&&e.config.doc.querySelector&&(e.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]")},"3.7.2",{requires:["selector-native"]});+YUI.add("selector-css2",function(e,t){var n="parentNode",r="tagName",i="attributes",s="combinator",o="pseudos",u=e.Selector,a={_reRegExpTokens:/([\^\$\?\[\]\*\+\-\.\(\)\|\\])/,SORT_RESULTS:!0,_isXML:function(){var t=e.config.doc.createElement("div").tagName!=="DIV";return t}(),shorthand:{"\\#(-?[_a-z0-9]+[-\\w\\uE000]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w\\uE000]*)":"[className~=$1]"},operators:{"":function(t,n){return e.DOM.getAttribute(t,n)!==""},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(t){return e.DOM._children(t[n])[0]===t}},_bruteQuery:function(t,n,r){var i=[],s=[],o=u._tokenize(t),a=o[o.length-1],f=e.DOM._getDoc(n),l,c,h,p;if(a){c=a.id,h=a.className,p=a.tagName||"*";if(n.getElementsByTagName)c&&(n.all||n.nodeType===9||e.DOM.inDoc(n))?s=e.DOM.allById(c,n):h?s=n.getElementsByClassName(h):s=n.getElementsByTagName(p);else{l=n.firstChild;while(l)l.tagName&&(p==="*"||l.tagName===p)&&s.push(l),l=l.nextSibling||l.firstChild}s.length&&(i=u._filterNodes(s,o,r))}return i},_filterNodes:function(t,n,r){var i=0,s,o=n.length,a=o-1,f=[],l=t[0],c=l,h=e.Selector.getters,p,d,v,m,g,y,b,w;for(i=0;c=l=t[i++];){a=o-1,m=null;e:while(c&&c.tagName){v=n[a],b=v.tests,s=b.length;if(s&&!g)while(w=b[--s]){p=w[1],h[w[0]]?y=h[w[0]](c,w[0]):(y=c[w[0]],w[0]==="tagName"&&!u._isXML&&(y=y.toUpperCase()),typeof y!="string"&&y!==undefined&&y.toString?y=y.toString():y===undefined&&c.getAttribute&&(y=c.getAttribute(w[0],2)));if(p==="="&&y!==w[2]||typeof p!="string"&&p.test&&!p.test(y)||!p.test&&typeof p=="function"&&!p(c,w[0],w[2])){if(c=c[m])while(c&&(!c.tagName||v.tagName&&v.tagName!==c.tagName))c=c[m];continue e}}a--;if(!!g||!(d=v.combinator)){f.push(l);if(r)return f;break}m=d.axis,c=c[m];while(c&&!c.tagName)c=c[m];d.direct&&(m=null)}}return l=c=null,f},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:!0},"+":{axis:"previousSibling",direct:!0}},_parsers:[{name:i,re:/^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i,fn:function(t,n){var r=t[2]||"",i=u.operators,s=t[3]?t[3].replace(/\\/g,""):"",o;if(t[1]==="id"&&r==="="||t[1]==="className"&&e.config.doc.documentElement.getElementsByClassName&&(r==="~="||r==="="))n.prefilter=t[1],t[3]=s,n[t[1]]=t[1]==="id"?t[3]:s;r in i&&(o=i[r],typeof o=="string"&&(t[3]=s.replace(u._reRegExpTokens,"\\$1"),o=new RegExp(o.replace("{val}",t[3]))),t[2]=o);if(!n.last||n.prefilter!==t[1])return t.slice(1)}},{name:r,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(e,t){var n=e[1];u._isXML||(n=n.toUpperCase()),t.tagName=n;if(n!=="*"&&(!t.last||t.prefilter))return[r,"=",n];t.prefilter||(t.prefilter="tagName")}},{name:s,re:/^\s*([>+~]|\s)\s*/,fn:function(e,t){}},{name:o,re:/^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i,fn:function(e,t){var n=u[o][e[1]];return n?(e[2]&&(e[2]=e[2].replace(/\\/g,"")),[e[2],n]):!1}}],_getToken:function(e){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]}},_tokenize:function(t){t=t||"",t=u._parseSelector(e.Lang.trim(t));var n=u._getToken(),r=t,i=[],o=!1,a,f,l,c;e:do{o=!1;for(l=0;c=u._parsers[l++];)if(a=c.re.exec(t)){c.name!==s&&(n.selector=t),t=t.replace(a[0],""),t.length||(n.last=!0),u._attrFilters[a[1]]&&(a[1]=u._attrFilters[a[1]]),f=c.fn(a,n);if(f===!1){o=!1;break e}f&&n.tests.push(f);if(!t.length||c.name===s)i.push(n),n=u._getToken(n),c.name===s&&(n.combinator=e.Selector.combinators[a[1]]);o=!0}}while(o&&t.length);if(!o||t.length)i=[];return i},_replaceMarkers:function(e){return e=e.replace(/\[/g,"\ue003"),e=e.replace(/\]/g,"\ue004"),e=e.replace(/\(/g,"\ue005"),e=e.replace(/\)/g,"\ue006"),e},_replaceShorthand:function(t){var n=e.Selector.shorthand,r;for(r in n)n.hasOwnProperty(r)&&(t=t.replace(new RegExp(r,"gi"),n[r]));return t},_parseSelector:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t=e.Selector._replaceShorthand(t),t=e.Selector._restore("attr",t,n.attrs),t=e.Selector._restore("pseudo",t,n.pseudos),t=e.Selector._replaceMarkers(t),t=e.Selector._restore("esc",t,n.esc),t},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(t,n){return e.DOM.getAttribute(t,n)},id:function(t,n){return e.DOM.getId(t)}}};e.mix(e.Selector,a,!0),e.Selector.getters.src=e.Selector.getters.rel=e.Selector.getters.href,e.Selector.useNative&&e.config.doc.querySelector&&(e.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]")},"3.7.3",{requires:["selector-native"]});
bundle/selector-css2/selector-css2.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -447,4 +447,4 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]});
bundle/selector-css3/selector-css3-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/selector-css3/selector-css3.js", code: [] };-_yuitest_coverage["build/selector-css3/selector-css3.js"].code=["YUI.add('selector-css3', function (Y, NAME) {","","/**"," * The selector css3 module provides support for css3 selectors."," * @module dom"," * @submodule selector-css3"," * @for Selector"," */","","/*"," 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 ","*/","","Y.Selector._reNth = /^(?:([\\-]?\\d*)(n){1}|(odd|even)$)*([\\-+]?\\d*)$/;","","Y.Selector._getNth = function(node, expr, tag, reverse) {"," Y.Selector._reNth.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 = [],"," siblings = Y.DOM._children(node.parentNode, tag),"," op;",""," 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;","};","","Y.mix(Y.Selector.pseudos, {"," 'root': function(node) {"," return node === node.ownerDocument.documentElement;"," },",""," 'nth-child': function(node, expr) {"," return Y.Selector._getNth(node, expr);"," },",""," 'nth-last-child': function(node, expr) {"," return Y.Selector._getNth(node, expr, null, true);"," },",""," 'nth-of-type': function(node, expr) {"," return Y.Selector._getNth(node, expr, node.tagName);"," },"," "," 'nth-last-of-type': function(node, expr) {"," return Y.Selector._getNth(node, expr, node.tagName, true);"," },"," "," 'last-child': function(node) {"," var children = Y.DOM._children(node.parentNode);"," return children[children.length - 1] === node;"," },",""," 'first-of-type': function(node) {"," return Y.DOM._children(node.parentNode, node.tagName)[0] === node;"," },"," "," 'last-of-type': function(node) {"," var children = Y.DOM._children(node.parentNode, node.tagName);"," return children[children.length - 1] === node;"," },"," "," 'only-child': function(node) {"," var children = Y.DOM._children(node.parentNode);"," return children.length === 1 && children[0] === node;"," },",""," 'only-of-type': function(node) {"," var children = Y.DOM._children(node.parentNode, node.tagName);"," return children.length === 1 && children[0] === node;"," },",""," 'empty': function(node) {"," return node.childNodes.length === 0;"," },",""," 'not': function(node, expr) {"," return !Y.Selector.test(node, expr);"," },",""," 'contains': function(node, expr) {"," var text = node.innerText || node.textContent || '';"," return text.indexOf(expr) > -1;"," },",""," 'checked': function(node) {"," return (node.checked === true || node.selected === true);"," },",""," enabled: function(node) {"," return (node.disabled !== undefined && !node.disabled);"," },",""," disabled: function(node) {"," return (node.disabled);"," }","});","","Y.mix(Y.Selector.operators, {"," '^=': '^{val}', // Match starts with value"," '$=': '{val}$', // Match ends with value"," '*=': '{val}' // Match contains value as substring ","});","","Y.Selector.combinators['~'] = {"," axis: 'previousSibling'","};","","","}, '3.7.2', {\"requires\": [\"selector-native\", \"selector-css2\"]});"];+_yuitest_coverage["build/selector-css3/selector-css3.js"].code=["YUI.add('selector-css3', function (Y, NAME) {","","/**"," * The selector css3 module provides support for css3 selectors."," * @module dom"," * @submodule selector-css3"," * @for Selector"," */","","/*"," 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 ","*/","","Y.Selector._reNth = /^(?:([\\-]?\\d*)(n){1}|(odd|even)$)*([\\-+]?\\d*)$/;","","Y.Selector._getNth = function(node, expr, tag, reverse) {"," Y.Selector._reNth.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 = [],"," siblings = Y.DOM._children(node.parentNode, tag),"," op;",""," 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;","};","","Y.mix(Y.Selector.pseudos, {"," 'root': function(node) {"," return node === node.ownerDocument.documentElement;"," },",""," 'nth-child': function(node, expr) {"," return Y.Selector._getNth(node, expr);"," },",""," 'nth-last-child': function(node, expr) {"," return Y.Selector._getNth(node, expr, null, true);"," },",""," 'nth-of-type': function(node, expr) {"," return Y.Selector._getNth(node, expr, node.tagName);"," },"," "," 'nth-last-of-type': function(node, expr) {"," return Y.Selector._getNth(node, expr, node.tagName, true);"," },"," "," 'last-child': function(node) {"," var children = Y.DOM._children(node.parentNode);"," return children[children.length - 1] === node;"," },",""," 'first-of-type': function(node) {"," return Y.DOM._children(node.parentNode, node.tagName)[0] === node;"," },"," "," 'last-of-type': function(node) {"," var children = Y.DOM._children(node.parentNode, node.tagName);"," return children[children.length - 1] === node;"," },"," "," 'only-child': function(node) {"," var children = Y.DOM._children(node.parentNode);"," return children.length === 1 && children[0] === node;"," },",""," 'only-of-type': function(node) {"," var children = Y.DOM._children(node.parentNode, node.tagName);"," return children.length === 1 && children[0] === node;"," },",""," 'empty': function(node) {"," return node.childNodes.length === 0;"," },",""," 'not': function(node, expr) {"," return !Y.Selector.test(node, expr);"," },",""," 'contains': function(node, expr) {"," var text = node.innerText || node.textContent || '';"," return text.indexOf(expr) > -1;"," },",""," 'checked': function(node) {"," return (node.checked === true || node.selected === true);"," },",""," enabled: function(node) {"," return (node.disabled !== undefined && !node.disabled);"," },",""," disabled: function(node) {"," return (node.disabled);"," }","});","","Y.mix(Y.Selector.operators, {"," '^=': '^{val}', // Match starts with value"," '$=': '{val}$', // Match ends with value"," '*=': '{val}' // Match contains value as substring ","});","","Y.Selector.combinators['~'] = {"," axis: 'previousSibling'","};","","","}, '3.7.3', {\"requires\": [\"selector-native\", \"selector-css2\"]});"]; _yuitest_coverage["build/selector-css3/selector-css3.js"].lines = {"1":0,"17":0,"19":0,"20":0,"21":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"38":0,"39":0,"40":0,"43":0,"44":0,"46":0,"49":0,"50":0,"51":0,"54":0,"55":0,"56":0,"57":0,"61":0,"62":0,"63":0,"67":0,"70":0,"72":0,"76":0,"80":0,"84":0,"88":0,"92":0,"93":0,"97":0,"101":0,"102":0,"106":0,"107":0,"111":0,"112":0,"116":0,"120":0,"124":0,"125":0,"129":0,"133":0,"137":0,"141":0,"147":0}; _yuitest_coverage["build/selector-css3/selector-css3.js"].functions = {"_getNth:19":0,"\'root\':71":0,"\'nth-child\':75":0,"\'nth-last-child\':79":0,"\'nth-of-type\':83":0,"\'nth-last-of-type\':87":0,"\'last-child\':91":0,"\'first-of-type\':96":0,"\'last-of-type\':100":0,"\'only-child\':105":0,"\'only-of-type\':110":0,"\'empty\':115":0,"\'not\':119":0,"\'contains\':123":0,"\'checked\':128":0,"enabled:132":0,"disabled:136":0,"(anonymous 1):1":0}; _yuitest_coverage["build/selector-css3/selector-css3.js"].coveredLines = 53;@@ -259,4 +259,4 @@ }; -}, '3.7.2', {"requires": ["selector-native", "selector-css2"]});+}, '3.7.3', {"requires": ["selector-native", "selector-css2"]});
bundle/selector-css3/selector-css3-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -155,4 +155,4 @@ }; -}, '3.7.2', {"requires": ["selector-native", "selector-css2"]});+}, '3.7.3', {"requires": ["selector-native", "selector-css2"]});
bundle/selector-css3/selector-css3-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("selector-css3",function(e,t){e.Selector._reNth=/^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/,e.Selector._getNth=function(t,n,r,i){e.Selector._reNth.test(n);var s=parseInt(RegExp.$1,10),o=RegExp.$2,u=RegExp.$3,a=parseInt(RegExp.$4,10)||0,f=[],l=e.DOM._children(t.parentNode,r),c;u?(s=2,c="+",o="n",a=u==="odd"?1:0):isNaN(s)&&(s=o?1:0);if(s===0)return i&&(a=l.length-a+1),l[a-1]===t?!0:!1;s<0&&(i=!!i,s=Math.abs(s));if(!i){for(var h=a-1,p=l.length;h<p;h+=s)if(h>=0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h<p&&l[h]===t)return!0;return!1},e.mix(e.Selector.pseudos,{root:function(e){return e===e.ownerDocument.documentElement},"nth-child":function(t,n){return e.Selector._getNth(t,n)},"nth-last-child":function(t,n){return e.Selector._getNth(t,n,null,!0)},"nth-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName)},"nth-last-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName,!0)},"last-child":function(t){var n=e.DOM._children(t.parentNode);return n[n.length-1]===t},"first-of-type":function(t){return e.DOM._children(t.parentNode,t.tagName)[0]===t},"last-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n[n.length-1]===t},"only-child":function(t){var n=e.DOM._children(t.parentNode);return n.length===1&&n[0]===t},"only-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n.length===1&&n[0]===t},empty:function(e){return e.childNodes.length===0},not:function(t,n){return!e.Selector.test(t,n)},contains:function(e,t){var n=e.innerText||e.textContent||"";return n.indexOf(t)>-1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"3.7.2",{requires:["selector-native","selector-css2"]});+YUI.add("selector-css3",function(e,t){e.Selector._reNth=/^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/,e.Selector._getNth=function(t,n,r,i){e.Selector._reNth.test(n);var s=parseInt(RegExp.$1,10),o=RegExp.$2,u=RegExp.$3,a=parseInt(RegExp.$4,10)||0,f=[],l=e.DOM._children(t.parentNode,r),c;u?(s=2,c="+",o="n",a=u==="odd"?1:0):isNaN(s)&&(s=o?1:0);if(s===0)return i&&(a=l.length-a+1),l[a-1]===t?!0:!1;s<0&&(i=!!i,s=Math.abs(s));if(!i){for(var h=a-1,p=l.length;h<p;h+=s)if(h>=0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h<p&&l[h]===t)return!0;return!1},e.mix(e.Selector.pseudos,{root:function(e){return e===e.ownerDocument.documentElement},"nth-child":function(t,n){return e.Selector._getNth(t,n)},"nth-last-child":function(t,n){return e.Selector._getNth(t,n,null,!0)},"nth-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName)},"nth-last-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName,!0)},"last-child":function(t){var n=e.DOM._children(t.parentNode);return n[n.length-1]===t},"first-of-type":function(t){return e.DOM._children(t.parentNode,t.tagName)[0]===t},"last-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n[n.length-1]===t},"only-child":function(t){var n=e.DOM._children(t.parentNode);return n.length===1&&n[0]===t},"only-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n.length===1&&n[0]===t},empty:function(e){return e.childNodes.length===0},not:function(t,n){return!e.Selector.test(t,n)},contains:function(e,t){var n=e.innerText||e.textContent||"";return n.indexOf(t)>-1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"3.7.3",{requires:["selector-native","selector-css2"]});
bundle/selector-css3/selector-css3.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -155,4 +155,4 @@ }; -}, '3.7.2', {"requires": ["selector-native", "selector-css2"]});+}, '3.7.3', {"requires": ["selector-native", "selector-css2"]});
bundle/selector-native/selector-native-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/selector-native/selector-native.js", code: [] };-_yuitest_coverage["build/selector-native/selector-native.js"].code=["YUI.add('selector-native', function (Y, NAME) {","","(function(Y) {","/**"," * The selector-native module provides support for native querySelector"," * @module dom"," * @submodule selector-native"," * @for Selector"," */","","/**"," * Provides support for using CSS selectors to query the DOM "," * @class Selector "," * @static"," * @for Selector"," */","","Y.namespace('Selector'); // allow native module to standalone","","var COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition',"," OWNER_DOCUMENT = 'ownerDocument';","","var Selector = {"," _types: {"," esc: {"," token: '\\uE000',"," re: /\\\\[:\\[\\]\\(\\)#\\.\\'\\>+~\"]/gi"," },",""," attr: {"," token: '\\uE001',"," re: /(\\[[^\\]]*\\])/g"," },",""," pseudo: {"," token: '\\uE002',"," re: /(\\([^\\)]*\\))/g"," }"," },",""," useNative: true,",""," _escapeId: function(id) {"," if (id) {"," id = id.replace(/([:\\[\\]\\(\\)#\\.'<>+~\"])/g,'\\\\$1');"," }"," return id;"," },",""," _compare: ('sourceIndex' in Y.config.doc.documentElement) ?"," function(nodeA, nodeB) {"," var a = nodeA.sourceIndex,"," b = nodeB.sourceIndex;",""," if (a === b) {"," return 0;"," } else if (a > b) {"," return 1;"," }",""," return -1;",""," } : (Y.config.doc.documentElement[COMPARE_DOCUMENT_POSITION] ?"," function(nodeA, nodeB) {"," if (nodeA[COMPARE_DOCUMENT_POSITION](nodeB) & 4) {"," return -1;"," } else {"," return 1;"," }"," } :"," function(nodeA, nodeB) {"," var rangeA, rangeB, compare;"," if (nodeA && nodeB) {"," rangeA = nodeA[OWNER_DOCUMENT].createRange();"," rangeA.setStart(nodeA, 0);"," rangeB = nodeB[OWNER_DOCUMENT].createRange();"," rangeB.setStart(nodeB, 0);"," compare = rangeA.compareBoundaryPoints(1, rangeB); // 1 === Range.START_TO_END"," }",""," return compare;"," "," }),",""," _sort: function(nodes) {"," if (nodes) {"," nodes = Y.Array(nodes, 0, true);"," if (nodes.sort) {"," nodes.sort(Selector._compare);"," }"," }",""," return nodes;"," },",""," _deDupe: function(nodes) {"," var ret = [],"," i, node;",""," for (i = 0; (node = nodes[i++]);) {"," if (!node._found) {"," ret[ret.length] = node;"," node._found = true;"," }"," }",""," for (i = 0; (node = ret[i++]);) {"," node._found = null;"," node.removeAttribute('_found');"," }",""," return ret;"," },",""," /**"," * 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} root optional An HTMLElement to start the query from. Defaults to Y.config.doc"," * @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, skipNative) {"," root = root || Y.config.doc;"," var ret = [],"," useNative = (Y.Selector.useNative && Y.config.doc.querySelector && !skipNative),"," queries = [[selector, root]],"," query,"," result,"," i,"," fn = (useNative) ? Y.Selector._nativeQuery : Y.Selector._bruteQuery;",""," if (selector && fn) {"," // split group into seperate queries"," if (!skipNative && // already done if skipping"," (!useNative || root.tagName)) { // split native when element scoping is needed"," queries = Selector._splitQueries(selector, root);"," }",""," for (i = 0; (query = queries[i++]);) {"," result = fn(query[0], query[1], firstOnly);"," if (!firstOnly) { // coerce DOM Collection to Array"," result = Y.Array(result, 0, true);"," }"," if (result) {"," ret = ret.concat(result);"," }"," }",""," if (queries.length > 1) { // remove dupes and sort by doc order "," ret = Selector._sort(Selector._deDupe(ret));"," }"," }",""," return (firstOnly) ? (ret[0] || null) : ret;",""," },",""," _replaceSelector: function(selector) {"," var esc = Y.Selector._parse('esc', selector), // pull escaped colon, brackets, etc. "," attrs,"," pseudos;",""," // first replace escaped chars, which could be present in attrs or pseudos"," selector = Y.Selector._replace('esc', selector);",""," // then replace pseudos before attrs to avoid replacing :not([foo])"," pseudos = Y.Selector._parse('pseudo', selector);"," selector = Selector._replace('pseudo', selector);",""," attrs = Y.Selector._parse('attr', selector);"," selector = Y.Selector._replace('attr', selector);",""," return {"," esc: esc,"," attrs: attrs,"," pseudos: pseudos,"," selector: selector"," };"," },",""," _restoreSelector: function(replaced) {"," var selector = replaced.selector;"," selector = Y.Selector._restore('attr', selector, replaced.attrs);"," selector = Y.Selector._restore('pseudo', selector, replaced.pseudos);"," selector = Y.Selector._restore('esc', selector, replaced.esc);"," return selector;"," },",""," _replaceCommas: function(selector) {"," var replaced = Y.Selector._replaceSelector(selector),"," selector = replaced.selector;",""," if (selector) {"," selector = selector.replace(/,/g, '\\uE007');"," replaced.selector = selector;"," selector = Y.Selector._restoreSelector(replaced);"," }"," return selector;"," },",""," // allows element scoped queries to begin with combinator"," // e.g. query('> p', document.body) === query('body > p')"," _splitQueries: function(selector, node) {"," if (selector.indexOf(',') > -1) {"," selector = Y.Selector._replaceCommas(selector);"," }",""," var groups = selector.split('\\uE007'), // split on replaced comma token"," queries = [],"," prefix = '',"," id,"," i,"," len;",""," if (node) {"," // enforce for element scoping"," if (node.nodeType === 1) { // Elements only"," id = Y.Selector._escapeId(Y.DOM.getId(node));",""," if (!id) {"," id = Y.guid();"," Y.DOM.setId(node, id);"," }"," "," prefix = '[id=\"' + id + '\"] ';"," }",""," for (i = 0, len = groups.length; i < len; ++i) {"," selector = prefix + groups[i];"," queries.push([selector, node]);"," }"," }",""," return queries;"," },",""," _nativeQuery: function(selector, root, one) {"," if (Y.UA.webkit && selector.indexOf(':checked') > -1 &&"," (Y.Selector.pseudos && Y.Selector.pseudos.checked)) { // webkit (chrome, safari) fails to pick up \"selected\" with \"checked\""," return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query"," }"," try {"," return root['querySelector' + (one ? '' : 'All')](selector);"," } catch(e) { // fallback to brute if available"," return Y.Selector.query(selector, root, one, true); // redo with skipNative true"," }"," },",""," filter: function(nodes, selector) {"," var ret = [],"," i, node;",""," if (nodes && selector) {"," for (i = 0; (node = nodes[i++]);) {"," if (Y.Selector.test(node, selector)) {"," ret[ret.length] = node;"," }"," }"," } else {"," }",""," return ret;"," },",""," test: function(node, selector, root) {"," var ret = false,"," useFrag = false,"," groups,"," parent,"," item,"," items,"," frag,"," id,"," i, j, group;",""," if (node && node.tagName) { // only test HTMLElements",""," if (typeof selector == 'function') { // test with function"," ret = selector.call(node, node);"," } else { // test with query"," // we need a root if off-doc"," groups = selector.split(',');"," if (!root && !Y.DOM.inDoc(node)) {"," parent = node.parentNode;"," if (parent) { "," root = parent;"," } else { // only use frag when no parent to query"," frag = node[OWNER_DOCUMENT].createDocumentFragment();"," frag.appendChild(node);"," root = frag;"," useFrag = true;"," }"," }"," root = root || node[OWNER_DOCUMENT];",""," id = Y.Selector._escapeId(Y.DOM.getId(node));"," if (!id) {"," id = Y.guid();"," Y.DOM.setId(node, id);"," }",""," for (i = 0; (group = groups[i++]);) { // TODO: off-dom test"," group += '[id=\"' + id + '\"]';"," items = Y.Selector.query(group, root);",""," for (j = 0; item = items[j++];) {"," if (item === node) {"," ret = true;"," break;"," }"," }"," if (ret) {"," break;"," }"," }",""," if (useFrag) { // cleanup"," frag.removeChild(node);"," }"," };"," }",""," return ret;"," },",""," /**"," * A convenience function to emulate Y.Node's aNode.ancestor(selector)."," * @param {HTMLElement} element An HTMLElement to start the query from."," * @param {String} selector The CSS selector to test the node against."," * @return {HTMLElement} The ancestor node matching the selector, or null."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan "," * @static"," * @method ancestor"," */"," ancestor: function (element, selector, testSelf) {"," return Y.DOM.ancestor(element, function(n) {"," return Y.Selector.test(n, selector);"," }, testSelf);"," },",""," _parse: function(name, selector) {"," return selector.match(Y.Selector._types[name].re);"," },",""," _replace: function(name, selector) {"," var o = Y.Selector._types[name];"," return selector.replace(o.re, o.token);"," },",""," _restore: function(name, selector, items) {"," if (items) {"," var token = Y.Selector._types[name].token,"," i, len;"," for (i = 0, len = items.length; i < len; ++i) {"," selector = selector.replace(token, items[i]);"," }"," }"," return selector;"," }","};","","Y.mix(Y.Selector, Selector, true);","","})(Y);","","","}, '3.7.2', {\"requires\": [\"dom-base\"]});"];+_yuitest_coverage["build/selector-native/selector-native.js"].code=["YUI.add('selector-native', function (Y, NAME) {","","(function(Y) {","/**"," * The selector-native module provides support for native querySelector"," * @module dom"," * @submodule selector-native"," * @for Selector"," */","","/**"," * Provides support for using CSS selectors to query the DOM "," * @class Selector "," * @static"," * @for Selector"," */","","Y.namespace('Selector'); // allow native module to standalone","","var COMPARE_DOCUMENT_POSITION = 'compareDocumentPosition',"," OWNER_DOCUMENT = 'ownerDocument';","","var Selector = {"," _types: {"," esc: {"," token: '\\uE000',"," re: /\\\\[:\\[\\]\\(\\)#\\.\\'\\>+~\"]/gi"," },",""," attr: {"," token: '\\uE001',"," re: /(\\[[^\\]]*\\])/g"," },",""," pseudo: {"," token: '\\uE002',"," re: /(\\([^\\)]*\\))/g"," }"," },",""," useNative: true,",""," _escapeId: function(id) {"," if (id) {"," id = id.replace(/([:\\[\\]\\(\\)#\\.'<>+~\"])/g,'\\\\$1');"," }"," return id;"," },",""," _compare: ('sourceIndex' in Y.config.doc.documentElement) ?"," function(nodeA, nodeB) {"," var a = nodeA.sourceIndex,"," b = nodeB.sourceIndex;",""," if (a === b) {"," return 0;"," } else if (a > b) {"," return 1;"," }",""," return -1;",""," } : (Y.config.doc.documentElement[COMPARE_DOCUMENT_POSITION] ?"," function(nodeA, nodeB) {"," if (nodeA[COMPARE_DOCUMENT_POSITION](nodeB) & 4) {"," return -1;"," } else {"," return 1;"," }"," } :"," function(nodeA, nodeB) {"," var rangeA, rangeB, compare;"," if (nodeA && nodeB) {"," rangeA = nodeA[OWNER_DOCUMENT].createRange();"," rangeA.setStart(nodeA, 0);"," rangeB = nodeB[OWNER_DOCUMENT].createRange();"," rangeB.setStart(nodeB, 0);"," compare = rangeA.compareBoundaryPoints(1, rangeB); // 1 === Range.START_TO_END"," }",""," return compare;"," "," }),",""," _sort: function(nodes) {"," if (nodes) {"," nodes = Y.Array(nodes, 0, true);"," if (nodes.sort) {"," nodes.sort(Selector._compare);"," }"," }",""," return nodes;"," },",""," _deDupe: function(nodes) {"," var ret = [],"," i, node;",""," for (i = 0; (node = nodes[i++]);) {"," if (!node._found) {"," ret[ret.length] = node;"," node._found = true;"," }"," }",""," for (i = 0; (node = ret[i++]);) {"," node._found = null;"," node.removeAttribute('_found');"," }",""," return ret;"," },",""," /**"," * 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} root optional An HTMLElement to start the query from. Defaults to Y.config.doc"," * @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, skipNative) {"," root = root || Y.config.doc;"," var ret = [],"," useNative = (Y.Selector.useNative && Y.config.doc.querySelector && !skipNative),"," queries = [[selector, root]],"," query,"," result,"," i,"," fn = (useNative) ? Y.Selector._nativeQuery : Y.Selector._bruteQuery;",""," if (selector && fn) {"," // split group into seperate queries"," if (!skipNative && // already done if skipping"," (!useNative || root.tagName)) { // split native when element scoping is needed"," queries = Selector._splitQueries(selector, root);"," }",""," for (i = 0; (query = queries[i++]);) {"," result = fn(query[0], query[1], firstOnly);"," if (!firstOnly) { // coerce DOM Collection to Array"," result = Y.Array(result, 0, true);"," }"," if (result) {"," ret = ret.concat(result);"," }"," }",""," if (queries.length > 1) { // remove dupes and sort by doc order "," ret = Selector._sort(Selector._deDupe(ret));"," }"," }",""," return (firstOnly) ? (ret[0] || null) : ret;",""," },",""," _replaceSelector: function(selector) {"," var esc = Y.Selector._parse('esc', selector), // pull escaped colon, brackets, etc. "," attrs,"," pseudos;",""," // first replace escaped chars, which could be present in attrs or pseudos"," selector = Y.Selector._replace('esc', selector);",""," // then replace pseudos before attrs to avoid replacing :not([foo])"," pseudos = Y.Selector._parse('pseudo', selector);"," selector = Selector._replace('pseudo', selector);",""," attrs = Y.Selector._parse('attr', selector);"," selector = Y.Selector._replace('attr', selector);",""," return {"," esc: esc,"," attrs: attrs,"," pseudos: pseudos,"," selector: selector"," };"," },",""," _restoreSelector: function(replaced) {"," var selector = replaced.selector;"," selector = Y.Selector._restore('attr', selector, replaced.attrs);"," selector = Y.Selector._restore('pseudo', selector, replaced.pseudos);"," selector = Y.Selector._restore('esc', selector, replaced.esc);"," return selector;"," },",""," _replaceCommas: function(selector) {"," var replaced = Y.Selector._replaceSelector(selector),"," selector = replaced.selector;",""," if (selector) {"," selector = selector.replace(/,/g, '\\uE007');"," replaced.selector = selector;"," selector = Y.Selector._restoreSelector(replaced);"," }"," return selector;"," },",""," // allows element scoped queries to begin with combinator"," // e.g. query('> p', document.body) === query('body > p')"," _splitQueries: function(selector, node) {"," if (selector.indexOf(',') > -1) {"," selector = Y.Selector._replaceCommas(selector);"," }",""," var groups = selector.split('\\uE007'), // split on replaced comma token"," queries = [],"," prefix = '',"," id,"," i,"," len;",""," if (node) {"," // enforce for element scoping"," if (node.nodeType === 1) { // Elements only"," id = Y.Selector._escapeId(Y.DOM.getId(node));",""," if (!id) {"," id = Y.guid();"," Y.DOM.setId(node, id);"," }"," "," prefix = '[id=\"' + id + '\"] ';"," }",""," for (i = 0, len = groups.length; i < len; ++i) {"," selector = prefix + groups[i];"," queries.push([selector, node]);"," }"," }",""," return queries;"," },",""," _nativeQuery: function(selector, root, one) {"," if (Y.UA.webkit && selector.indexOf(':checked') > -1 &&"," (Y.Selector.pseudos && Y.Selector.pseudos.checked)) { // webkit (chrome, safari) fails to pick up \"selected\" with \"checked\""," return Y.Selector.query(selector, root, one, true); // redo with skipNative true to try brute query"," }"," try {"," return root['querySelector' + (one ? '' : 'All')](selector);"," } catch(e) { // fallback to brute if available"," return Y.Selector.query(selector, root, one, true); // redo with skipNative true"," }"," },",""," filter: function(nodes, selector) {"," var ret = [],"," i, node;",""," if (nodes && selector) {"," for (i = 0; (node = nodes[i++]);) {"," if (Y.Selector.test(node, selector)) {"," ret[ret.length] = node;"," }"," }"," } else {"," }",""," return ret;"," },",""," test: function(node, selector, root) {"," var ret = false,"," useFrag = false,"," groups,"," parent,"," item,"," items,"," frag,"," id,"," i, j, group;",""," if (node && node.tagName) { // only test HTMLElements",""," if (typeof selector == 'function') { // test with function"," ret = selector.call(node, node);"," } else { // test with query"," // we need a root if off-doc"," groups = selector.split(',');"," if (!root && !Y.DOM.inDoc(node)) {"," parent = node.parentNode;"," if (parent) { "," root = parent;"," } else { // only use frag when no parent to query"," frag = node[OWNER_DOCUMENT].createDocumentFragment();"," frag.appendChild(node);"," root = frag;"," useFrag = true;"," }"," }"," root = root || node[OWNER_DOCUMENT];",""," id = Y.Selector._escapeId(Y.DOM.getId(node));"," if (!id) {"," id = Y.guid();"," Y.DOM.setId(node, id);"," }",""," for (i = 0; (group = groups[i++]);) { // TODO: off-dom test"," group += '[id=\"' + id + '\"]';"," items = Y.Selector.query(group, root);",""," for (j = 0; item = items[j++];) {"," if (item === node) {"," ret = true;"," break;"," }"," }"," if (ret) {"," break;"," }"," }",""," if (useFrag) { // cleanup"," frag.removeChild(node);"," }"," };"," }",""," return ret;"," },",""," /**"," * A convenience function to emulate Y.Node's aNode.ancestor(selector)."," * @param {HTMLElement} element An HTMLElement to start the query from."," * @param {String} selector The CSS selector to test the node against."," * @return {HTMLElement} The ancestor node matching the selector, or null."," * @param {Boolean} testSelf optional Whether or not to include the element in the scan "," * @static"," * @method ancestor"," */"," ancestor: function (element, selector, testSelf) {"," return Y.DOM.ancestor(element, function(n) {"," return Y.Selector.test(n, selector);"," }, testSelf);"," },",""," _parse: function(name, selector) {"," return selector.match(Y.Selector._types[name].re);"," },",""," _replace: function(name, selector) {"," var o = Y.Selector._types[name];"," return selector.replace(o.re, o.token);"," },",""," _restore: function(name, selector, items) {"," if (items) {"," var token = Y.Selector._types[name].token,"," i, len;"," for (i = 0, len = items.length; i < len; ++i) {"," selector = selector.replace(token, items[i]);"," }"," }"," return selector;"," }","};","","Y.mix(Y.Selector, Selector, true);","","})(Y);","","","}, '3.7.3', {\"requires\": [\"dom-base\"]});"]; _yuitest_coverage["build/selector-native/selector-native.js"].lines = {"1":0,"3":0,"18":0,"20":0,"23":0,"44":0,"45":0,"47":0,"52":0,"55":0,"56":0,"57":0,"58":0,"61":0,"65":0,"66":0,"68":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"81":0,"86":0,"87":0,"88":0,"89":0,"93":0,"97":0,"100":0,"101":0,"102":0,"103":0,"107":0,"108":0,"109":0,"112":0,"126":0,"127":0,"135":0,"137":0,"139":0,"142":0,"143":0,"144":0,"145":0,"147":0,"148":0,"152":0,"153":0,"157":0,"162":0,"167":0,"170":0,"171":0,"173":0,"174":0,"176":0,"185":0,"186":0,"187":0,"188":0,"189":0,"193":0,"196":0,"197":0,"198":0,"199":0,"201":0,"207":0,"208":0,"211":0,"218":0,"220":0,"221":0,"223":0,"224":0,"225":0,"228":0,"231":0,"232":0,"233":0,"237":0,"241":0,"243":0,"245":0,"246":0,"248":0,"253":0,"256":0,"257":0,"258":0,"259":0,"265":0,"269":0,"279":0,"281":0,"282":0,"285":0,"286":0,"287":0,"288":0,"289":0,"291":0,"292":0,"293":0,"294":0,"297":0,"299":0,"300":0,"301":0,"302":0,"305":0,"306":0,"307":0,"309":0,"310":0,"311":0,"312":0,"315":0,"316":0,"320":0,"321":0,"323":0,"326":0,"339":0,"340":0,"345":0,"349":0,"350":0,"354":0,"355":0,"357":0,"358":0,"361":0,"365":0}; _yuitest_coverage["build/selector-native/selector-native.js"].functions = {"_escapeId:43":0,"(anonymous 3):51":0,"(anonymous 4):64":0,"}:71":0,"_sort:85":0,"_deDupe:96":0,"query:125":0,"_replaceSelector:161":0,"_restoreSelector:184":0,"_replaceCommas:192":0,"_splitQueries:206":0,"_nativeQuery:240":0,"filter:252":0,"test:268":0,"(anonymous 5):339":0,"ancestor:338":0,"_parse:344":0,"_replace:348":0,"_restore:353":0,"(anonymous 2):3":0,"(anonymous 1):1":0}; _yuitest_coverage["build/selector-native/selector-native.js"].coveredLines = 138;@@ -565,4 +565,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/selector-native/selector-native-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -378,4 +378,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/selector-native/selector-native-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("selector-native",function(e,t){(function(e){e.namespace("Selector");var t="compareDocumentPosition",n="ownerDocument",r={_types:{esc:{token:"\ue000",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"\ue001",re:/(\[[^\]]*\])/g},pseudo:{token:"\ue002",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(e){return e&&(e=e.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")),e},_compare:"sourceIndex"in e.config.doc.documentElement?function(e,t){var n=e.sourceIndex,r=t.sourceIndex;return n===r?0:n>r?1:-1}:e.config.doc.documentElement[t]?function(e,n){return e[t](n)&4?-1:1}:function(e,t){var r,i,s;return e&&t&&(r=e[n].createRange(),r.setStart(e,0),i=t[n].createRange(),i.setStart(t,0),s=r.compareBoundaryPoints(1,i)),s},_sort:function(t){return t&&(t=e.Array(t,0,!0),t.sort&&t.sort(r._compare)),t},_deDupe:function(e){var t=[],n,r;for(n=0;r=e[n++];)r._found||(t[t.length]=r,r._found=!0);for(n=0;r=t[n++];)r._found=null,r.removeAttribute("_found");return t},query:function(t,n,i,s){n=n||e.config.doc;var o=[],u=e.Selector.useNative&&e.config.doc.querySelector&&!s,a=[[t,n]],f,l,c,h=u?e.Selector._nativeQuery:e.Selector._bruteQuery;if(t&&h){!s&&(!u||n.tagName)&&(a=r._splitQueries(t,n));for(c=0;f=a[c++];)l=h(f[0],f[1],i),i||(l=e.Array(l,0,!0)),l&&(o=o.concat(l));a.length>1&&(o=r._sort(r._deDupe(o)))}return i?o[0]||null:o},_replaceSelector:function(t){var n=e.Selector._parse("esc",t),i,s;return t=e.Selector._replace("esc",t),s=e.Selector._parse("pseudo",t),t=r._replace("pseudo",t),i=e.Selector._parse("attr",t),t=e.Selector._replace("attr",t),{esc:n,attrs:i,pseudos:s,selector:t}},_restoreSelector:function(t){var n=t.selector;return n=e.Selector._restore("attr",n,t.attrs),n=e.Selector._restore("pseudo",n,t.pseudos),n=e.Selector._restore("esc",n,t.esc),n},_replaceCommas:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t&&(t=t.replace(/,/g,"\ue007"),n.selector=t,t=e.Selector._restoreSelector(n)),t},_splitQueries:function(t,n){t.indexOf(",")>-1&&(t=e.Selector._replaceCommas(t));var r=t.split("\ue007"),i=[],s="",o,u,a;if(n){n.nodeType===1&&(o=e.Selector._escapeId(e.DOM.getId(n)),o||(o=e.guid(),e.DOM.setId(n,o)),s='[id="'+o+'"] ');for(u=0,a=r.length;u<a;++u)t=s+r[u],i.push([t,n])}return i},_nativeQuery:function(t,n,r){if(e.UA.webkit&&t.indexOf(":checked")>-1&&e.Selector.pseudos&&e.Selector.pseudos.checked)return e.Selector.query(t,n,r,!0);try{return n["querySelector"+(r?"":"All")](t)}catch(i){return e.Selector.query(t,n,r,!0)}},filter:function(t,n){var r=[],i,s;if(t&&n)for(i=0;s=t[i++];)e.Selector.test(s,n)&&(r[r.length]=s);return r},test:function(t,r,i){var s=!1,o=!1,u,a,f,l,c,h,p,d,v;if(t&&t.tagName)if(typeof r=="function")s=r.call(t,t);else{u=r.split(","),!i&&!e.DOM.inDoc(t)&&(a=t.parentNode,a?i=a:(c=t[n].createDocumentFragment(),c.appendChild(t),i=c,o=!0)),i=i||t[n],h=e.Selector._escapeId(e.DOM.getId(t)),h||(h=e.guid(),e.DOM.setId(t,h));for(p=0;v=u[p++];){v+='[id="'+h+'"]',l=e.Selector.query(v,i);for(d=0;f=l[d++];)if(f===t){s=!0;break}if(s)break}o&&c.removeChild(t)}return s},ancestor:function(t,n,r){return e.DOM.ancestor(t,function(t){return e.Selector.test(t,n)},r)},_parse:function(t,n){return n.match(e.Selector._types[t].re)},_replace:function(t,n){var r=e.Selector._types[t];return n.replace(r.re,r.token)},_restore:function(t,n,r){if(r){var i=e.Selector._types[t].token,s,o;for(s=0,o=r.length;s<o;++s)n=n.replace(i,r[s])}return n}};e.mix(e.Selector,r,!0)})(e)},"3.7.2",{requires:["dom-base"]});+YUI.add("selector-native",function(e,t){(function(e){e.namespace("Selector");var t="compareDocumentPosition",n="ownerDocument",r={_types:{esc:{token:"\ue000",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"\ue001",re:/(\[[^\]]*\])/g},pseudo:{token:"\ue002",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(e){return e&&(e=e.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")),e},_compare:"sourceIndex"in e.config.doc.documentElement?function(e,t){var n=e.sourceIndex,r=t.sourceIndex;return n===r?0:n>r?1:-1}:e.config.doc.documentElement[t]?function(e,n){return e[t](n)&4?-1:1}:function(e,t){var r,i,s;return e&&t&&(r=e[n].createRange(),r.setStart(e,0),i=t[n].createRange(),i.setStart(t,0),s=r.compareBoundaryPoints(1,i)),s},_sort:function(t){return t&&(t=e.Array(t,0,!0),t.sort&&t.sort(r._compare)),t},_deDupe:function(e){var t=[],n,r;for(n=0;r=e[n++];)r._found||(t[t.length]=r,r._found=!0);for(n=0;r=t[n++];)r._found=null,r.removeAttribute("_found");return t},query:function(t,n,i,s){n=n||e.config.doc;var o=[],u=e.Selector.useNative&&e.config.doc.querySelector&&!s,a=[[t,n]],f,l,c,h=u?e.Selector._nativeQuery:e.Selector._bruteQuery;if(t&&h){!s&&(!u||n.tagName)&&(a=r._splitQueries(t,n));for(c=0;f=a[c++];)l=h(f[0],f[1],i),i||(l=e.Array(l,0,!0)),l&&(o=o.concat(l));a.length>1&&(o=r._sort(r._deDupe(o)))}return i?o[0]||null:o},_replaceSelector:function(t){var n=e.Selector._parse("esc",t),i,s;return t=e.Selector._replace("esc",t),s=e.Selector._parse("pseudo",t),t=r._replace("pseudo",t),i=e.Selector._parse("attr",t),t=e.Selector._replace("attr",t),{esc:n,attrs:i,pseudos:s,selector:t}},_restoreSelector:function(t){var n=t.selector;return n=e.Selector._restore("attr",n,t.attrs),n=e.Selector._restore("pseudo",n,t.pseudos),n=e.Selector._restore("esc",n,t.esc),n},_replaceCommas:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t&&(t=t.replace(/,/g,"\ue007"),n.selector=t,t=e.Selector._restoreSelector(n)),t},_splitQueries:function(t,n){t.indexOf(",")>-1&&(t=e.Selector._replaceCommas(t));var r=t.split("\ue007"),i=[],s="",o,u,a;if(n){n.nodeType===1&&(o=e.Selector._escapeId(e.DOM.getId(n)),o||(o=e.guid(),e.DOM.setId(n,o)),s='[id="'+o+'"] ');for(u=0,a=r.length;u<a;++u)t=s+r[u],i.push([t,n])}return i},_nativeQuery:function(t,n,r){if(e.UA.webkit&&t.indexOf(":checked")>-1&&e.Selector.pseudos&&e.Selector.pseudos.checked)return e.Selector.query(t,n,r,!0);try{return n["querySelector"+(r?"":"All")](t)}catch(i){return e.Selector.query(t,n,r,!0)}},filter:function(t,n){var r=[],i,s;if(t&&n)for(i=0;s=t[i++];)e.Selector.test(s,n)&&(r[r.length]=s);return r},test:function(t,r,i){var s=!1,o=!1,u,a,f,l,c,h,p,d,v;if(t&&t.tagName)if(typeof r=="function")s=r.call(t,t);else{u=r.split(","),!i&&!e.DOM.inDoc(t)&&(a=t.parentNode,a?i=a:(c=t[n].createDocumentFragment(),c.appendChild(t),i=c,o=!0)),i=i||t[n],h=e.Selector._escapeId(e.DOM.getId(t)),h||(h=e.guid(),e.DOM.setId(t,h));for(p=0;v=u[p++];){v+='[id="'+h+'"]',l=e.Selector.query(v,i);for(d=0;f=l[d++];)if(f===t){s=!0;break}if(s)break}o&&c.removeChild(t)}return s},ancestor:function(t,n,r){return e.DOM.ancestor(t,function(t){return e.Selector.test(t,n)},r)},_parse:function(t,n){return n.match(e.Selector._types[t].re)},_replace:function(t,n){var r=e.Selector._types[t];return n.replace(r.re,r.token)},_restore:function(t,n,r){if(r){var i=e.Selector._types[t].token,s,o;for(s=0,o=r.length;s<o;++s)n=n.replace(i,r[s])}return n}};e.mix(e.Selector,r,!0)})(e)},"3.7.3",{requires:["dom-base"]});
bundle/selector-native/selector-native.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -373,4 +373,4 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]});
bundle/selector/selector-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/selector/selector.js", code: [] };-_yuitest_coverage["build/selector/selector.js"].code=["YUI.add('selector', function (Y, NAME) {","","","","}, '3.7.2', {\"requires\": [\"selector-native\"]});"];+_yuitest_coverage["build/selector/selector.js"].code=["YUI.add('selector', function (Y, NAME) {","","","","}, '3.7.3', {\"requires\": [\"selector-native\"]});"]; _yuitest_coverage["build/selector/selector.js"].lines = {"1":0}; _yuitest_coverage["build/selector/selector.js"].functions = {}; _yuitest_coverage["build/selector/selector.js"].coveredLines = 1;@@ -42,4 +42,4 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]});
bundle/selector/selector-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,4 +8,4 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]});
bundle/selector/selector-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("selector",function(e,t){},"3.7.2",{requires:["selector-native"]});+YUI.add("selector",function(e,t){},"3.7.3",{requires:["selector-native"]});
bundle/selector/selector.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -8,4 +8,4 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]});
bundle/shim-plugin/shim-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/shim-plugin/shim-plugin.js", code: [] };-_yuitest_coverage["build/shim-plugin/shim-plugin.js"].code=["YUI.add('shim-plugin', function (Y, NAME) {",""," /**"," * Provides shimming support for Node via a Plugin."," * This fixes SELECT bleedthrough for IE6 & Mac scrollbars"," * @module shim-plugin"," */",""," /**"," * Node plugin which can be used to add shim support."," *"," * @class Plugin.Shim"," * @param {Object} User configuration object"," */"," function Shim(config) {"," this.init(config);"," }",""," /**"," * Default class used to mark the shim element"," *"," * @property CLASS_NAME"," * @type String"," * @static"," * @default \"yui-node-shim\""," */"," // TODO: use ClassNameManager"," Shim.CLASS_NAME = 'yui-node-shim';",""," /**"," * Default markup template used to generate the shim element."," * "," * @property TEMPLATE"," * @type String"," * @static"," */"," Shim.TEMPLATE = '<iframe class=\"' + Shim.CLASS_NAME +"," '\" frameborder=\"0\" title=\"Node Stacking Shim\"' +"," 'src=\"javascript:false\" tabindex=\"-1\" role=\"presentation\"' +"," 'style=\"position:absolute; z-index:-1;\"></iframe>';",""," Shim.prototype = {"," init: function(config) {"," this._host = config.host;"," this.initEvents();"," this.insert();"," this.sync();"," },",""," initEvents: function() {"," this._resizeHandle = this._host.on('resize', this.sync, this);"," },"," "," getShim: function() {"," return this._shim || ("," this._shim = Y.Node.create("," Shim.TEMPLATE,"," this._host.get('ownerDocument')"," )"," );"," },",""," insert: function() {"," var node = this._host;"," this._shim = node.insertBefore( this.getShim(),"," node.get('firstChild'));"," },",""," /**"," * Updates the size of the shim to fill its container"," * @method sync"," */"," sync: function() {"," var shim = this._shim,"," node = this._host;",""," if (shim) {"," shim.setAttrs({"," width: node.getStyle('width'),"," height: node.getStyle('height')"," });"," }"," },",""," /**"," * Removes the shim and destroys the plugin"," * @method destroy"," */"," destroy: function() {"," var shim = this._shim;"," if (shim) {"," shim.remove(true);"," }",""," this._resizeHandle.detach();"," }"," };",""," Shim.NAME = 'Shim';"," Shim.NS = 'shim';",""," Y.namespace('Plugin');"," Y.Plugin.Shim = Shim;","","","}, '3.7.2', {\"requires\": [\"node-style\", \"node-pluginhost\"]});"];+_yuitest_coverage["build/shim-plugin/shim-plugin.js"].code=["YUI.add('shim-plugin', function (Y, NAME) {",""," /**"," * Provides shimming support for Node via a Plugin."," * This fixes SELECT bleedthrough for IE6 & Mac scrollbars"," * @module shim-plugin"," */",""," /**"," * Node plugin which can be used to add shim support."," *"," * @class Plugin.Shim"," * @param {Object} User configuration object"," */"," function Shim(config) {"," this.init(config);"," }",""," /**"," * Default class used to mark the shim element"," *"," * @property CLASS_NAME"," * @type String"," * @static"," * @default \"yui-node-shim\""," */"," // TODO: use ClassNameManager"," Shim.CLASS_NAME = 'yui-node-shim';",""," /**"," * Default markup template used to generate the shim element."," * "," * @property TEMPLATE"," * @type String"," * @static"," */"," Shim.TEMPLATE = '<iframe class=\"' + Shim.CLASS_NAME +"," '\" frameborder=\"0\" title=\"Node Stacking Shim\"' +"," 'src=\"javascript:false\" tabindex=\"-1\" role=\"presentation\"' +"," 'style=\"position:absolute; z-index:-1;\"></iframe>';",""," Shim.prototype = {"," init: function(config) {"," this._host = config.host;"," this.initEvents();"," this.insert();"," this.sync();"," },",""," initEvents: function() {"," this._resizeHandle = this._host.on('resize', this.sync, this);"," },"," "," getShim: function() {"," return this._shim || ("," this._shim = Y.Node.create("," Shim.TEMPLATE,"," this._host.get('ownerDocument')"," )"," );"," },",""," insert: function() {"," var node = this._host;"," this._shim = node.insertBefore( this.getShim(),"," node.get('firstChild'));"," },",""," /**"," * Updates the size of the shim to fill its container"," * @method sync"," */"," sync: function() {"," var shim = this._shim,"," node = this._host;",""," if (shim) {"," shim.setAttrs({"," width: node.getStyle('width'),"," height: node.getStyle('height')"," });"," }"," },",""," /**"," * Removes the shim and destroys the plugin"," * @method destroy"," */"," destroy: function() {"," var shim = this._shim;"," if (shim) {"," shim.remove(true);"," }",""," this._resizeHandle.detach();"," }"," };",""," Shim.NAME = 'Shim';"," Shim.NS = 'shim';",""," Y.namespace('Plugin');"," Y.Plugin.Shim = Shim;","","","}, '3.7.3', {\"requires\": [\"node-style\", \"node-pluginhost\"]});"]; _yuitest_coverage["build/shim-plugin/shim-plugin.js"].lines = {"1":0,"15":0,"16":0,"28":0,"37":0,"42":0,"44":0,"45":0,"46":0,"47":0,"51":0,"55":0,"64":0,"65":0,"74":0,"77":0,"78":0,"90":0,"91":0,"92":0,"95":0,"99":0,"100":0,"102":0,"103":0}; _yuitest_coverage["build/shim-plugin/shim-plugin.js"].functions = {"Shim:15":0,"init:43":0,"initEvents:50":0,"getShim:54":0,"insert:63":0,"sync:73":0,"destroy:89":0,"(anonymous 1):1":0}; _yuitest_coverage["build/shim-plugin/shim-plugin.js"].coveredLines = 25;@@ -175,4 +175,4 @@ Y.Plugin.Shim = Shim; -}, '3.7.2', {"requires": ["node-style", "node-pluginhost"]});+}, '3.7.3', {"requires": ["node-style", "node-pluginhost"]});
bundle/shim-plugin/shim-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ Y.Plugin.Shim = Shim; -}, '3.7.2', {"requires": ["node-style", "node-pluginhost"]});+}, '3.7.3', {"requires": ["node-style", "node-pluginhost"]});
bundle/shim-plugin/shim-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("shim-plugin",function(e,t){function n(e){this.init(e)}n.CLASS_NAME="yui-node-shim",n.TEMPLATE='<iframe class="'+n.CLASS_NAME+'" frameborder="0" title="Node Stacking Shim"'+'src="javascript:false" tabindex="-1" role="presentation"'+'style="position:absolute; z-index:-1;"></iframe>',n.prototype={init:function(e){this._host=e.host,this.initEvents(),this.insert(),this.sync()},initEvents:function(){this._resizeHandle=this._host.on("resize",this.sync,this)},getShim:function(){return this._shim||(this._shim=e.Node.create(n.TEMPLATE,this._host.get("ownerDocument")))},insert:function(){var e=this._host;this._shim=e.insertBefore(this.getShim(),e.get("firstChild"))},sync:function(){var e=this._shim,t=this._host;e&&e.setAttrs({width:t.getStyle("width"),height:t.getStyle("height")})},destroy:function(){var e=this._shim;e&&e.remove(!0),this._resizeHandle.detach()}},n.NAME="Shim",n.NS="shim",e.namespace("Plugin"),e.Plugin.Shim=n},"3.7.2",{requires:["node-style","node-pluginhost"]});+YUI.add("shim-plugin",function(e,t){function n(e){this.init(e)}n.CLASS_NAME="yui-node-shim",n.TEMPLATE='<iframe class="'+n.CLASS_NAME+'" frameborder="0" title="Node Stacking Shim"'+'src="javascript:false" tabindex="-1" role="presentation"'+'style="position:absolute; z-index:-1;"></iframe>',n.prototype={init:function(e){this._host=e.host,this.initEvents(),this.insert(),this.sync()},initEvents:function(){this._resizeHandle=this._host.on("resize",this.sync,this)},getShim:function(){return this._shim||(this._shim=e.Node.create(n.TEMPLATE,this._host.get("ownerDocument")))},insert:function(){var e=this._host;this._shim=e.insertBefore(this.getShim(),e.get("firstChild"))},sync:function(){var e=this._shim,t=this._host;e&&e.setAttrs({width:t.getStyle("width"),height:t.getStyle("height")})},destroy:function(){var e=this._shim;e&&e.remove(!0),this._resizeHandle.detach()}},n.NAME="Shim",n.NS="shim",e.namespace("Plugin"),e.Plugin.Shim=n},"3.7.3",{requires:["node-style","node-pluginhost"]});
bundle/shim-plugin/shim-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -109,4 +109,4 @@ Y.Plugin.Shim = Shim; -}, '3.7.2', {"requires": ["node-style", "node-pluginhost"]});+}, '3.7.3', {"requires": ["node-style", "node-pluginhost"]});
bundle/simpleyui/simpleyui-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2579,10 +2579,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3351,7 +3351,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3466,13 +3466,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3561,7 +3554,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3614,7 +3621,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3733,10 +3740,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3805,6 +3818,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3816,14 +3830,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3843,7 +3857,7 @@ }; -}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */@@ -4369,14 +4383,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -4393,7 +4411,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -4487,6 +4505,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -4503,6 +4523,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -4514,13 +4539,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -4586,7 +4605,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -4684,7 +4703,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -4734,8 +4753,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -4822,6 +4843,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -4912,7 +4937,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -4970,9 +4994,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -4980,8 +5017,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -4997,7 +5032,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -5105,13 +5140,14 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -5237,7 +5273,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -5266,10 +5302,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -5431,8 +5465,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5444,8 +5478,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -5533,7 +5581,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -5643,7 +5691,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /**@@ -5720,8 +5768,8 @@ -}, '3.7.2', {"requires": ["yui-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"requires": ["yui-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('oop', function (Y, NAME) { /**@@ -6122,7 +6170,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -6248,7 +6296,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -6277,10 +6325,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -6442,8 +6488,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -6455,8 +6501,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('dom-core', function (Y, NAME) { var NODE_TYPE = 'nodeType',@@ -6711,7 +6771,7 @@ isWindow: function(obj) {- return !!(obj && obj.alert && obj.document);+ return !!(obj && obj.scrollTo && obj.document); }, _removeChildNodes: function(node) {@@ -6845,7 +6905,7 @@ Y.DOM = Y_DOM; -}, '3.7.2', {"requires": ["oop", "features"]});+}, '3.7.3', {"requires": ["oop", "features"]}); YUI.add('dom-base', function (Y, NAME) { /**@@ -7533,7 +7593,7 @@ }); -}, '3.7.2', {"requires": ["dom-core"]});+}, '3.7.3', {"requires": ["dom-core"]}); YUI.add('dom-style', function (Y, NAME) { (function(Y) {@@ -7873,7 +7933,7 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]}); YUI.add('dom-style-ie', function (Y, NAME) { (function(Y) {@@ -8179,7 +8239,7 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style"]});+}, '3.7.3', {"requires": ["dom-style"]}); YUI.add('dom-screen', function (Y, NAME) { (function(Y) {@@ -8790,7 +8850,7 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base", "dom-style"]});+}, '3.7.3', {"requires": ["dom-base", "dom-style"]}); YUI.add('selector-native', function (Y, NAME) { (function(Y) {@@ -9165,12 +9225,12 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]}); YUI.add('selector', function (Y, NAME) { -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]}); YUI.add('event-custom-base', function (Y, NAME) { /**@@ -11483,7 +11543,7 @@ **/ -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]}); YUI.add('event-custom-complex', function (Y, NAME) { @@ -11989,7 +12049,7 @@ FACADE_KEYS[key] = true; } -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]}); YUI.add('node-core', function (Y, NAME) { /**@@ -12700,7 +12760,9 @@ }, /**- * Nulls internal node references, removes any plugins and event listeners+ * Nulls internal node references, removes any plugins and event listeners.+ * Note that destroy() will not remove the node from its parent or from the DOM. For that+ * functionality, call remove(true). * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false)@@ -13586,7 +13648,7 @@ ]); -}, '3.7.2', {"requires": ["dom-core", "selector"]});+}, '3.7.3', {"requires": ["dom-core", "selector"]}); YUI.add('node-base', function (Y, NAME) { /**@@ -14744,7 +14806,7 @@ }); -}, '3.7.2', {"requires": ["event-base", "node-core", "dom-base"]});+}, '3.7.3', {"requires": ["event-base", "node-core", "dom-base"]}); (function () { var GLOBAL_ENV = YUI.Env; @@ -15144,7 +15206,8 @@ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; -var _eventenv = Y.Env.evt,+var YDOM = Y.DOM,+ _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add,@@ -15166,13 +15229,12 @@ shouldIterate = function(o) { try {- return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) &&- !o.tagName && !o.alert);+ // TODO: See if there's a more performant way to return true early on this, for the common case+ return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o)); } catch(ex) { Y.log("collection check failure", "warn", "event"); return false; }- }, // aliases to support DOM event subscription clean up when the last@@ -15538,7 +15600,7 @@ // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) {- oEl = Y.DOM.byId(el);+ oEl = YDOM.byId(el); } else { oEl = Y.Selector.query(el);@@ -15655,7 +15717,7 @@ // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) {- el = Y.DOM.byId(el);+ el = YDOM.byId(el); } else { el = Y.Selector.query(el); l = el.length;@@ -15729,7 +15791,7 @@ * @static */ generateId: function(el) {- return Y.DOM.generateID(el);+ return YDOM.generateID(el); }, /**@@ -15839,7 +15901,7 @@ if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // Y.log('avail: ' + el);@@ -15858,7 +15920,7 @@ if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready@@ -15909,9 +15971,8 @@ if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl);- i = 0; len = children.length;- for (; i < len; ++i) {+ for (i = 0; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child);@@ -16070,7 +16131,7 @@ Event._poll(); -})();+}()); /** * DOM event listener abstraction layer@@ -16125,7 +16186,7 @@ }; -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]}); YUI.add('pluginhost-base', function (Y, NAME) { /**@@ -16308,7 +16369,7 @@ Y.namespace("Plugin").Host = PluginHost; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('pluginhost-config', function (Y, NAME) { /**@@ -16438,7 +16499,7 @@ }; -}, '3.7.2', {"requires": ["pluginhost-base"]});+}, '3.7.3', {"requires": ["pluginhost-base"]}); YUI.add('event-delegate', function (Y, NAME) { /**@@ -16761,7 +16822,7 @@ Y.delegate = Y.Event.delegate = delegate; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]}); YUI.add('node-event-delegate', function (Y, NAME) { /**@@ -16815,7 +16876,7 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-delegate"]});+}, '3.7.3', {"requires": ["node-base", "event-delegate"]}); YUI.add('node-pluginhost', function (Y, NAME) { /**@@ -16901,7 +16962,7 @@ }; -}, '3.7.2', {"requires": ["node-base", "pluginhost"]});+}, '3.7.3', {"requires": ["node-base", "pluginhost"]}); YUI.add('node-screen', function (Y, NAME) { /**@@ -17141,7 +17202,7 @@ }; -}, '3.7.2', {"requires": ["dom-screen", "node-base"]});+}, '3.7.3', {"requires": ["dom-screen", "node-base"]}); YUI.add('node-style', function (Y, NAME) { (function(Y) {@@ -17247,7 +17308,7 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style", "node-base"]});+}, '3.7.3', {"requires": ["dom-style", "node-base"]}); YUI.add('querystring-stringify-simple', function (Y, NAME) { /*global Y */@@ -17308,7 +17369,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('io-base', function (Y, NAME) { /**@@ -17426,9 +17487,9 @@ use; if (alt === 'native') {- // Non-IE can use XHR level 2 and not rely on an+ // Non-IE and IE >= 10 can use XHR level 2 and not rely on an // external transport.- alt = Y.UA.ie ? 'xdr' : null;+ alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null; // Prevent "pre-flight" OPTIONS request by removing the // `X-Requested-With` HTTP header from CORS requests. This header@@ -18018,10 +18079,8 @@ // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft.- if (config.xdr && config.xdr.credentials) {- if (!Y.UA.ie) {- transaction.c.withCredentials = true;- }+ if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) {+ transaction.c.withCredentials = true; } // Using "null" with HTTP POST will result in a request@@ -18219,9 +18278,13 @@ Y.io._map = {}; var XHR = win && win.XMLHttpRequest, XDR = win && win.XDomainRequest,- AX = win && win.ActiveXObject;+ AX = win && win.ActiveXObject, + // Checks for the presence of the `withCredentials` in an XHR instance+ // object, which will be present if the environment supports CORS.+ SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest()); + Y.mix(Y.IO, { /** * The ID of the default IO transport, defaults to `xhr`@@ -18309,7 +18372,7 @@ -}, '3.7.2', {"requires": ["event-custom-base", "querystring-stringify-simple"]});+}, '3.7.3', {"requires": ["event-custom-base", "querystring-stringify-simple"]}); YUI.add('json-parse', function (Y, NAME) { /**@@ -18325,7 +18388,7 @@ * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p>- * + * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to@@ -18351,7 +18414,8 @@ // All internals kept private for security reasons function fromGlobal(ref) {- return (Y.config.win || this || {})[ref];+ var g = ((typeof global === 'object') ? global : undefined);+ return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref]; } @@ -18421,7 +18485,7 @@ * @private */ _UNSAFE = /[^\],:{}\s]/,- + /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval.@@ -18487,7 +18551,7 @@ // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);- + // Test for any remaining invalid characters if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']').@@ -18500,7 +18564,7 @@ throw new SyntaxError('JSON.parse'); };- + Y.namespace('JSON').parse = function (s,reviver) { if (typeof s !== 'string') { s += '';@@ -18539,7 +18603,7 @@ Y.JSON.useNativeParse = useNative; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('transition', function (Y, NAME) { /**@@ -18555,15 +18619,15 @@ DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,+ TRANSITION_CAMEL = 'transition',+ TRANSITION_PROPERTY_CAMEL = 'transitionProperty',+ TRANSFORM_CAMEL = 'transform', TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END,- TRANSFORM_CAMEL, EMPTY_OBJ = {}, @@ -18598,13 +18662,13 @@ Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- + if (m3) { str += '-' + m3.toLowerCase(); } return str;- }); + }); return property; };@@ -18614,30 +18678,37 @@ Transition.useNative = false; -Y.Array.each(VENDORS, function(val) { // then vendor specific- var property = val + TRANSITION_CAMEL;- if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- CAMEL_VENDOR_PREFIX = val;- VENDOR_PREFIX = Transition._toHyphen(val) + '-';+if ('transition' in DOCUMENT[DOCUMENT_ELEMENT].style) {+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+} else {+ Y.Array.each(VENDORS, function(val) { // then vendor specific+ var property = val + 'Transition';+ if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {+ CAMEL_VENDOR_PREFIX = val;+ VENDOR_PREFIX = Transition._toHyphen(val) + '-'; - Transition.useNative = true;- Transition.supported = true; // TODO: remove- Transition._VENDOR_PREFIX = val;- }-});+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+ Transition._VENDOR_PREFIX = val;+ }+ });+} -TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-TRANSITION_END = 'transitionend';-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+if (CAMEL_VENDOR_PREFIX) {+ TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition';+ TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';+ TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+} -TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;+TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';+TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';+TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';+TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; -TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+TRANSITION_END = 'transitionend';+ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END; Transition.fx = {}; Transition.toggles = {};@@ -18646,7 +18717,7 @@ Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; -Y.Node.DOM_EVENTS[TRANSITION_END] = 1; +Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; @@ -18702,7 +18773,7 @@ if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) {- val = config; + val = config; config = EMPTY_OBJ; } @@ -18715,7 +18786,7 @@ if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition }- } + } anim._count++; // properties per transition @@ -18774,7 +18845,7 @@ if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); - // when size is auto or % webkit starts from zero instead of computed + // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') {@@ -18789,7 +18860,7 @@ * @method run * @chainable * @private- */ + */ run: function(callback) { var anim = this, node = anim._node,@@ -18883,7 +18954,7 @@ Transition._hasEnd[uid] = true; }- + style.cssText += transitionText + duration + easing + delay + cssText; },@@ -18896,10 +18967,10 @@ data = { type: 'transition:end', config: config,- elapsedTime: elapsed + elapsedTime: elapsed }, - nodeInstance = Y.one(node); + nodeInstance = Y.one(node); anim._running = false; anim._callback = null;@@ -18985,7 +19056,7 @@ Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({@@ -19007,16 +19078,16 @@ * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. + * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) {- var + var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop;- + if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config;@@ -19031,7 +19102,7 @@ for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) {- config[prop] = fxConfig[prop]; + config[prop] = fxConfig[prop]; } } }@@ -19062,10 +19133,10 @@ callback = config; config = name; }- name = Transition.SHOW_TRANSITION; - } + name = Transition.SHOW_TRANSITION;+ } this.transition(name, config, callback);- } + } else if (name && !Y.Transition) { Y.log('unable to transition show; missing transition module', 'warn', 'node'); } return this; };@@ -19094,17 +19165,17 @@ callback = config; config = name; }- name = Transition.HIDE_TRANSITION; - } + name = Transition.HIDE_TRANSITION;+ } this.transition(name, config, callback); } else if (name && !Y.Transition) { Y.log('unable to transition hide; missing transition module', 'warn', 'node'); } else { this._hide();- } + } return this;-}; +}; -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({@@ -19211,7 +19282,7 @@ }, duration: 0.5, easing: 'ease-in',- + on: { start: function() { var overflow = this.getStyle('overflow');@@ -19227,7 +19298,7 @@ delete this._transitionOverflow; } }- } + } } }); @@ -19240,7 +19311,7 @@ -}, '3.7.2', {"requires": ["node-style"]});+}, '3.7.3', {"requires": ["node-style"]}); YUI.add('selector-css2', function (Y, NAME) { /**@@ -19685,7 +19756,7 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]}); YUI.add('selector-css3', function (Y, NAME) { /**@@ -19837,7 +19908,7 @@ }; -}, '3.7.2', {"requires": ["selector-native", "selector-css2"]});+}, '3.7.3', {"requires": ["selector-native", "selector-css2"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -19947,7 +20018,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('dump', function (Y, NAME) { /**@@ -20052,7 +20123,7 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('transition-timer', function (Y, NAME) { /**@@ -20386,12 +20457,12 @@ Y.Transition = Transition; -}, '3.7.2', {"requires": ["transition"]});+}, '3.7.3', {"requires": ["transition"]}); YUI.add('yui', function (Y, NAME) { // empty -}, '3.7.2', {"use": ["yui", "oop", "dom", "event-custom-base", "event-base", "pluginhost", "node", "event-delegate", "io-base", "json-parse", "transition", "selector-css3", "dom-style-ie", "querystring-stringify-simple"]});+}, '3.7.3', {"use": ["yui", "oop", "dom", "event-custom-base", "event-base", "pluginhost", "node", "event-delegate", "io-base", "json-parse", "transition", "selector-css3", "dom-style-ie", "querystring-stringify-simple"]}); var Y = YUI().use('*');
bundle/simpleyui/simpleyui-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.2",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&!e.alert&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++==1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.2",{use:["get","features","intl-base","yui-log","yui-later"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!n.gecko||!!n.opera}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var i;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,this._env||this._getEnv(),i=this._getTransaction(t,n),this._queue.push({callback:r,transaction:i}),this._next(),i},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(function(){e.callback&&e.callback.apply(this,arguments),i._pending=null,i._next()}))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._waiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._waiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout));for(i=0,s=n.length;i<s;++i)u=t.requests[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r)},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(o.onerror=c,o.onload=h,!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this._waiting+=1,this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._waiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._waiting-=1,this._next()}}},"3.7.2",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"})},"3.7.2",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.2",{requires:["yui-base"]}),YUI.add("yui",function(e,t){},"3.7.2",{use:["get","features","intl-base","yui-log","yui-later"]}),YUI.add("oop",function(e,t){function a(t,n,i,s,o){if(t&&t[o]&&t!==e)return t[o].call(t,n,i);switch(r.test(t)){case 1:return r[o](t,n,i);case 2:return r[o](e.Array(t,0,!0),n,i);default:return e.Object[o](t,n,i,s)}}var n=e.Lang,r=e.Array,i=Object.prototype,s="_~yuim~_",o=i.hasOwnProperty,u=i.toString;e.augment=function(t,n,r,i,s){var a=t.prototype,f=a&&n,l=n.prototype,c=a||t,h,p,d,v,m;return s=s?e.Array(s):[],f&&(p={},d={},v={},h=function(e,t){if(r||!(t in a))u.call(e)==="[object Function]"?(v[t]=e,p[t]=d[t]=function(){return m(this,e,arguments)}):p[t]=e},m=function(e,t,r){for(var i in v)o.call(v,i)&&e[i]===d[i]&&(e[i]=v[i]);return n.apply(e,s),t.apply(e,r)},i?e.Array.each(i,function(e){e in l&&h(l[e],e)}):e.Object.each(l,h,null,!0)),e.mix(c,p||l,r,i),f||n.apply(c,s),t},e.aggregate=function(t,n,r,i){return e.mix(t,n,r,i,0,!0)},e.extend=function(t,n,r,s){(!n||!t)&&e.error("extend failed, verify dependencies");var o=n.prototype,u=e.Object(o);return t.prototype=u,u.constructor=t,t.superclass=o,n!=Object&&o.constructor==i.constructor&&(o.constructor=n),r&&e.mix(u,r,!0),s&&e.mix(t,s,!0),t},e.each=function(e,t,n,r){return a(e,t,n,r,"each")},e.some=function(e,t,n,r){return a(e,t,n,r,"some")},e.clone=function(t,r,i,o,u,a){if(!n.isObject(t))return t;if(e.instanceOf(t,YUI))return t;var f,l=a||{},c,h=e.each;switch(n.type(t)){case"date":return new Date(t);case"regexp":return t;case"function":return t;case"array":f=[];break;default:if(t[s])return l[t[s]];c=e.guid(),f=r?{}:e.Object(t),t[s]=c,l[c]=t}return!t.addEventListener&&!t.attachEvent&&h(t,function(n,a){(a||a===0)&&(!i||i.call(o||this,n,a,this,t)!==!1)&&a!==s&&a!="prototype"&&(this[a]=e.clone(n,r,i,o,u||t,l))},f),a||(e.Object.each(l,function(e,t){if(e[s])try{delete e[s]}catch(n){e[s]=null}},this),l=null),f},e.bind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?i.concat(e.Array(arguments,0,!0)):arguments;return s.apply(r||s,o)}},e.rbind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?e.Array(arguments,0,!0).concat(i):arguments;return s.apply(r||s,o)}}},"3.7.2",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"})},"3.7.2",{requires:["yui-base"]}),YUI.add("dom-core",function(e,t){var n="nodeType",r="ownerDocument",i="documentElement",s="defaultView",o="parentWindow",u="tagName",a="parentNode",f="previousSibling",l="nextSibling",c="contains",h="compareDocumentPosition",p=[],d=function(){var t=e.config.doc.createElement("div"),n=t.appendChild(e.config.doc.createTextNode("")),r=!1;try{r=t.contains(n)}catch(i){}return r}(),v={byId:function(e,t){return v.allById(e,t)[0]||null},getId:function(e){var t;return e.id&&!e.id.tagName&&!e.id.item?t=e.id:e.attributes&&e.attributes.id&&(t=e.attributes.id.value),t},setId:function(e,t){e.setAttribute?e.setAttribute("id",t):e.id=t},ancestor:function(e,t,n,r){var i=null;return n&&(i=!t||t(e)?e:null),i||v.elementByAxis(e,a,t,null,r)},ancestors:function(e,t,n,r){var i=e,s=[];while(i=v.ancestor(i,t,n,r)){n=!1;if(i){s.unshift(i);if(r&&r(i))return s}}return s},elementByAxis:function(e,t,n,r,i){while(e&&(e=e[t])){if((r||e[u])&&(!n||n(e)))return e;if(i&&i(e))return null}return null},contains:function(e,t){var r=!1;if(!t||!e||!t[n]||!e[n])r=!1;else if(e[c]&&(t[n]===1||d))r=e[c](t);else if(e[h]){if(e===t||!!(e[h](t)&16))r=!0}else r=v._bruteContains(e,t);return r},inDoc:function(e,t){var n=!1,s;return e&&e.nodeType&&(t||(t=e[r]),s=t[i],s&&s.contains&&e.tagName?n=s.contains(e):n=v.contains(s,e)),n},allById:function(t,n){n=n||e.config.doc;var r=[],i=[],s,o;if(n.querySelectorAll)i=n.querySelectorAll('[id="'+t+'"]');else if(n.all){r=n.all(t);if(r){r.nodeName&&(r.id===t?(i.push(r),r=p):r=[r]);if(r.length)for(s=0;o=r[s++];)(o.id===t||o.attributes&&o.attributes.id&&o.attributes.id.value===t)&&i.push(o)}}else i=[v._getDoc(n).getElementById(t)];return i},isWindow:function(e){return!!(e&&e.alert&&e.document)},_removeChildNodes:function(e){while(e.firstChild)e.removeChild(e.firstChild)},siblings:function(e,t){var n=[],r=e;while(r=r[f])r[u]&&(!t||t(r))&&n.unshift(r);r=e;while(r=r[l])r[u]&&(!t||t(r))&&n.push(r);return n},_bruteContains:function(e,t){while(t){if(e===t)return!0;t=t.parentNode}return!1},_getRegExp:function(e,t){return t=t||"",v._regexCache=v._regexCache||{},v._regexCache[e+t]||(v._regexCache[e+t]=new RegExp(e,t)),v._regexCache[e+t]},_getDoc:function(t){var i=e.config.doc;return t&&(i=t[n]===9?t:t[r]||t.document||e.config.doc),i},_getWin:function(t){var n=v._getDoc(t);return n[s]||n[o]||e.config.win},_batch:function(e,t,n,r,i,s){t=typeof t=="string"?v[t]:t;var o,u=0,a,f;if(t&&e)while(a=e[u++])o=o=t.call(v,a,n,r,i,s),typeof o!="undefined"&&(f||(f=[]),f.push(o));return typeof f!="undefined"?f:e},generateID:function(t){var n=t.id;return n||(n=e.stamp(t),t.id=n),n}};e.DOM=v},"3.7.2",{requires:["oop","features"]}),YUI.add("dom-base",function(e,t){var n=e.config.doc.documentElement,r=e.DOM,i="tagName",s="ownerDocument",o="",u=e.Features.add,a=e.Features.test;e.mix(r,{getText:n.textContent!==undefined?function(e){var t="";return e&&(t=e.textContent),t||""}:function(e){var t="";return e&&(t=e.innerText||e.nodeValue),t||""},setText:n.textContent!==undefined?function(e,t){e&&(e.textContent=t)}:function(e,t){"innerText"in e?e.innerText=t:"nodeValue"in e&&(e.nodeValue=t)},CUSTOM_ATTRIBUTES:n.hasAttribute?{htmlFor:"for",className:"class"}:{"for":"htmlFor","class":"className"},setAttribute:function(e,t,n,i){e&&t&&e.setAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,e.setAttribute(t,n,i))},getAttribute:function(e,t,n){n=n!==undefined?n:2;var i="";return e&&t&&e.getAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,i=e.getAttribute(t,n),i===null&&(i="")),i},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(e){var t="",n;return e&&e[i]&&(n=r.VALUE_GETTERS[e[i].toLowerCase()],n?t=n(e):t=e.value),t===o&&(t=o),typeof t=="string"?t:""},setValue:function(e,t){var n;e&&e[i]&&(n=r.VALUE_SETTERS[e[i].toLowerCase()],n?n(e,t):e.value=t)},creators:{}}),u("value-set","select",{test:function(){var t=e.config.doc.createElement("select");return t.innerHTML="<option>1</option><option>2</option>",t.value="2",t.value&&t.value==="2"}}),a("value-set","select")||(r.VALUE_SETTERS.select=function(e,t){for(var n=0,i=e.getElementsByTagName("option"),s;s=i[n++];)if(r.getValue(s)===t){s.selected=!0;break}}),e.mix(r.VALUE_GETTERS,{button:function(e){return e.attributes&&e.attributes.value?e.attributes.value.value:""}}),e.mix(r.VALUE_SETTERS,{button:function(e,t){var n=e.attributes.value;n||(n=e[s].createAttribute("value"),e.setAttributeNode(n)),n.value=t}}),e.mix(r.VALUE_GETTERS,{option:function(e){var t=e.attributes;return t.value&&t.value.specified?e.value:e.text},select:function(e){var t=e.value,n=e.options;return n&&n.length&&(e.multiple||e.selectedIndex>-1&&(t=r.getValue(n[e.selectedIndex]))),t}});var f,l,c;e.mix(e.DOM,{hasClass:function(t,n){var r=e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)");return r.test(t.className)},addClass:function(t,n){e.DOM.hasClass(t,n)||(t.className=e.Lang.trim([t.className,n].join(" ")))},removeClass:function(t,n){n&&l(t,n)&&(t.className=e.Lang.trim(t.className.replace(e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)")," ")),l(t,n)&&c(t,n))},replaceClass:function(e,t,n){c(e,t),f(e,n)},toggleClass:function(e,t,n){var r=n!==undefined?n:!l(e,t);r?f(e,t):c(e,t)}}),l=e.DOM.hasClass,c=e.DOM.removeClass,f=e.DOM.addClass;var h=/<([a-z]+)/i,r=e.DOM,u=e.Features.add,a=e.Features.test,p={},d=function(t,n){var r=e.config.doc.createElement("div"),i=!0;r.innerHTML=t;if(!r.firstChild||r.firstChild.tagName!==n.toUpperCase())i=!1;return i},v=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,m="<table>",g="</table>";e.mix(e.DOM,{_fragClones:{},_create:function(e,t,n){n=n||"div";var i=r._fragClones[n];return i?i=i.cloneNode(!1):i=r._fragClones[n]=t.createElement(n),i.innerHTML=e,i},_children:function(e,t){var n=0,r=e.children,i,s,o;r&&r.tags&&(t?r=e.children.tags(t):s=r.tags("!").length);if(!r||!r.tags&&t||s){i=r||e.childNodes,r=[];while(o=i[n++])o.nodeType===1&&(!t||t===o.tagName)&&r.push(o)}return r||[]},create:function(t,n){typeof t=="string"&&(t=e.Lang.trim(t)),n=n||e.config.doc;var i=h.exec(t),s=r._create,o=p,u=null,a,f,l;return t!=undefined&&(i&&i[1]&&(a=o[i[1].toLowerCase()],typeof a=="function"?s=a:f=a),l=s(t,n,f).childNodes,l.length===1?u=l[0].parentNode.removeChild(l[0]):l[0]&&l[0].className==="yui3-big-dummy"?l.length===2?u=l[0].nextSibling:(l[0].parentNode.removeChild(l[0]),u=r._nl2frag(l,n)):u=r._nl2frag(l,n)),u},_nl2frag:function(t,n){var r=null,i,s;if(t&&(t.push||t.item)&&t[0]){n=n||t[0].ownerDocument,r=n.createDocumentFragment(),t.item&&(t=e.Array(t,0,!0));for(i=0,s=t.length;i<s;i++)r.appendChild(t[i])}return r},addHTML:function(t,n,i){var s=t.parentNode,o=0,u,a=n,f;if(n!=undefined)if(n.nodeType)f=n;else if(typeof n=="string"||typeof n=="number")a=f=r.create(n);else if(n[0]&&n[0].nodeType){f=e.config.doc.createDocumentFragment();while(u=n[o++])f.appendChild(u)}if(i)if(f&&i.parentNode)i.parentNode.insertBefore(f,i);else switch(i){case"replace":while(t.firstChild)t.removeChild(t.firstChild);f&&t.appendChild(f);break;case"before":f&&s.insertBefore(f,t);break;case"after":f&&(t.nextSibling?s.insertBefore(f,t.nextSibling):s.appendChild(f));break;default:f&&t.appendChild(f)}else f&&t.appendChild(f);return a},wrap:function(t,n){var r=n&&n.nodeType?n:e.DOM.create(n),i=r.getElementsByTagName("*");i.length&&(r=i[i.length-1]),t.parentNode&&t.parentNode.replaceChild(r,t),r.appendChild(t)},unwrap:function(e){var t=e.parentNode,n=t.lastChild,r=e,i;if(t){i=t.parentNode;if(i){e=t.firstChild;while(e!==n)r=e.nextSibling,i.insertBefore(e,t),e=r;i.replaceChild(n,t)}else t.removeChild(e)}}}),u("innerhtml","table",{test:function(){var t=e.config.doc.createElement("table");try{t.innerHTML="<tbody></tbody>"}catch(n){return!1}return t.firstChild&&t.firstChild.nodeName==="TBODY"}}),u("innerhtml-div","tr",{test:function(){return d("<tr></tr>","tr")}}),u("innerhtml-div","script",{test:function(){return d("<script></script>","script")}}),a("innerhtml","table")||(p.tbody=function(t,n){var i=r.create(m+t+g,n),s=e.DOM._children(i,"tbody")[0];return i.children.length>1&&s&&!v.test(t)&&s.parentNode.removeChild(s),i}),a("innerhtml-div","script")||(p.script=function(e,t){var n=t.createElement("div");return n.innerHTML="-"+e,n.removeChild(n.firstChild),n},p.link=p.style=p.script),a("innerhtml-div","tr")||(e.mix(p,{option:function(e,t){return r.create('<select><option class="yui3-big-dummy" selected></option>'+e+"</select>",t)},tr:function(e,t){return r.create("<tbody>"+e+"</tbody>",t)},td:function(e,t){return r.create("<tr>"+e+"</tr>",t)},col:function(e,t){return r.create("<colgroup>"+e+"</colgroup>",t)},tbody:"table"}),e.mix(p,{legend:"fieldset",th:p.td,thead:p.tbody,tfoot:p.tbody,caption:p.tbody,colgroup:p.tbody,optgroup:p.option})),r.creators=p,e.mix(e.DOM,{setWidth:function(t,n){e.DOM._setSize(t,"width",n)},setHeight:function(t,n){e.DOM._setSize(t,"height",n)},_setSize:function(e,t,n){n=n>0?n:0;var r=0;e.style[t]=n+"px",r=t==="height"?e.offsetHeight:e.offsetWidth,r>n&&(n-=r-n,n<0&&(n=0),e.style[t]=n+"px")}})},"3.7.2",{requires:["dom-core"]}),YUI.add("dom-style",function(e,t){(function(e){var t="documentElement",n="defaultView",r="ownerDocument",i="style",s="float",o="cssFloat",u="styleFloat",a="transparent",f="getComputedStyle",l="getBoundingClientRect",c=e.config.win,h=e.config.doc,p=undefined,d=e.DOM,v="transform",m="transformOrigin",g=["WebkitTransform","MozTransform","OTransform","msTransform"],y=/color$/i,b=/width|height|top|left|right|bottom|margin|padding/i;e.Array.each(g,function(e){e in h[t].style&&(v=e,m=e+"Origin")}),e.mix(d,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(e,t,n,r){r=r||e.style;var i=d.CUSTOM_STYLES;if(r){n===null||n===""?n="":!isNaN(new Number(n))&&b.test(t)&&(n+=d.DEFAULT_UNIT);if(t in i){if(i[t].set){i[t].set(e,n,r);return}typeof i[t]=="string"&&(t=i[t])}else t===""&&(t="cssText",n="");r[t]=n}},getStyle:function(e,t,n){n=n||e.style;var r=d.CUSTOM_STYLES,i="";if(n){if(t in r){if(r[t].get)return r[t].get(e,t,n);typeof r[t]=="string"&&(t=r[t])}i=n[t],i===""&&(i=d[f](e,t))}return i},setStyles:function(t,n){var r=t.style;e.each(n,function(e,n){d.setStyle(t,n,e,r)},d)},getComputedStyle:function(e,t){var s="",o=e[r],u;return e[i]&&o[n]&&o[n][f]&&(u=o[n][f](e,null),u&&(s=u[t])),s}}),h[t][i][o]!==p?d.CUSTOM_STYLES[s]=o:h[t][i][u]!==p&&(d.CUSTOM_STYLES[s]=u),e.UA.opera&&(d[f]=function(t,i){var s=t[r][n],o=s[f](t,"")[i];return y.test(i)&&(o=e.Color.toRGB(o)),o}),e.UA.webkit&&(d[f]=function(e,t){var i=e[r][n],s=i[f](e,"")[t];return s==="rgba(0, 0, 0, 0)"&&(s=a),s}),e.DOM._getAttrOffset=function(t,n){var r=e.DOM[f](t,n),i=t.offsetParent,s,o,u;return r==="auto"&&(s=e.DOM.getStyle(t,"position"),s==="static"||s==="relative"?r=0:i&&i[l]&&(o=i[l]()[n],u=t[l]()[n],n==="left"||n==="top"?r=u-o:r=o-t[l]()[n])),r},e.DOM._getOffset=function(e){var t,n=null;return e&&(t=d.getStyle(e,"position"),n=[parseInt(d[f](e,"left"),10),parseInt(d[f](e,"top"),10)],isNaN(n[0])&&(n[0]=parseInt(d.getStyle(e,"left"),10),isNaN(n[0])&&(n[0]=t==="relative"?0:e.offsetLeft||0)),isNaN(n[1])&&(n[1]=parseInt(d.getStyle(e,"top"),10),isNaN(n[1])&&(n[1]=t==="relative"?0:e.offsetTop||0))),n},d.CUSTOM_STYLES.transform={set:function(e,t,n){n[v]=t},get:function(e,t){return d[f](e,v)}},d.CUSTOM_STYLES.transformOrigin={set:function(e,t,n){n[m]=t},get:function(e,t){return d[f](e,m)}}})(e),function(e){var t=parseInt,n=RegExp;e.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(r){return e.Color.re_RGB.test(r)||(r=e.Color.toHex(r)),e.Color.re_hex.exec(r)&&(r="rgb("+[t(n.$1,16),t(n.$2,16),t(n.$3,16)].join(", ")+")"),r},toHex:function(t){t=e.Color.KEYWORDS[t]||t;if(e.Color.re_RGB.exec(t)){t=[Number(n.$1).toString(16),Number(n.$2).toString(16),Number(n.$3).toString(16)];for(var r=0;r<t.length;r++)t[r].length<2&&(t[r]="0"+t[r]);t=t.join("")}return t.length<6&&(t=t.replace(e.Color.re_hex3,"$1$1")),t!=="transparent"&&t.indexOf("#")<0&&(t="#"+t),t.toUpperCase()}}}(e)},"3.7.2",{requires:["dom-base"]}),YUI.add("dom-style-ie",function(e,t){(function(e){var t="hasLayout",n="px",r="filter",i="filters",s="opacity",o="auto",u="borderWidth",a="borderTopWidth",f="borderRightWidth",l="borderBottomWidth",c="borderLeftWidth",h="width",p="height",d="transparent",v="visible",m="getComputedStyle",g=undefined,y=e.config.doc.documentElement,b=e.Features.test,w=e.Features.add,E=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,S=e.UA.ie>=8,x=function(e){return e.currentStyle||e.style},T={CUSTOM_STYLES:{},get:function(t,r){var i="",o;return t&&(o=x(t)[r],r===s&&e.DOM.CUSTOM_STYLES[s]?i=e.DOM.CUSTOM_STYLES[s].get(t):!o||o.indexOf&&o.indexOf(n)>-1?i=o:e.DOM.IE.COMPUTED[r]?i=e.DOM.IE.COMPUTED[r](t,r):E.test(o)?i=T.getPixel(t,r)+n:i=o),i},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(e,t){var r=x(e)[t],i=t.charAt(0).toUpperCase()+t.substr(1),s="offset"+i,u="pixel"+i,a=T.sizeOffsets[t],f=e.ownerDocument.compatMode,l="";return r===o||r.indexOf("%")>-1?(l=e["offset"+i],f!=="BackCompat"&&(a[0]&&(l-=T.getPixel(e,"padding"+a[0]),l-=T.getBorderWidth(e,"border"+a[0]+"Width",1)),a[1]&&(l-=T.getPixel(e,"padding"+a[1]),l-=T.getBorderWidth(e,"border"+a[1]+"Width",1)))):(!e.style[u]&&!e.style[t]&&(e.style[t]=r),l=e.style[u]),l+n},borderMap:{thin:S?"1px":"2px",medium:S?"3px":"4px",thick:S?"5px":"6px"},getBorderWidth:function(e,t,r){var i=r?"":n,s=e.currentStyle[t];return s.indexOf(n)<0&&(T.borderMap[s]&&e.currentStyle.borderStyle!=="none"?s=T.borderMap[s]:s=0),r?parseFloat(s):s},getPixel:function(e,t){var n=null,r=x(e),i=r.right,s=r[t];return e.style.right=s,n=e.style.pixelRight,e.style.right=i,n},getMargin:function(e,t){var r,i=x(e);return i[t]==o?r=0:r=T.getPixel(e,t),r+n},getVisibility:function(e,t){var n;while((n=e.currentStyle)&&n[t]=="inherit")e=e.parentNode;return n?n[t]:v},getColor:function(t,n){var r=x(t)[n];return(!r||r===d)&&e.DOM.elementByAxis(t,"parentNode",null,function(e){r=x(e)[n];if(r&&r!==d)return t=e,!0}),e.Color.toRGB(r)},getBorderColor:function(t,n){var r=x(t),i=r[n]||r.color;return e.Color.toRGB(e.Color.toHex(i))}},N={};w("style","computedStyle",{test:function(){return"getComputedStyle"in e.config.win}}),w("style","opacity",{test:function(){return"opacity"in y.style}}),w("style","filter",{test:function(){return"filters"in y}}),!b("style","opacity")&&b("style","filter")&&(e.DOM.CUSTOM_STYLES[s]={get:function(e){var t=100;try{t=e[i]["DXImageTransform.Microsoft.Alpha"][s]}catch(n){try{t=e[i]("alpha")[s]}catch(r){}}return t/100},set:function(e,n,i){var o,u=x(e),a=u[r];i=i||e.style,n===""&&(o=s in u?u[s]:1,n=o),typeof a=="string"&&(i[r]=a.replace(/alpha([^)]*\))/gi,"")+(n<1?"alpha("+s+"="+n*100+")":""),i[r]||i.removeAttribute(r),u[t]||(i.zoom=1))}});try{e.config.doc.createElement("div").style.height="-1px"}catch(C){e.DOM.CUSTOM_STYLES.height={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.height=t}},e.DOM.CUSTOM_STYLES.width={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.width=t}}}b("style","computedStyle")||(N[h]=N[p]=T.getOffset,N.color=N.backgroundColor=T.getColor,N[u]=N[a]=N[f]=N[l]=N[c]=T.getBorderWidth,N.marginTop=N.marginRight=N.marginBottom=N.marginLeft=T.getMargin,N.visibility=T.getVisibility,N.borderColor=N.borderTopColor=N.borderRightColor=N.borderBottomColor=N.borderLeftColor=T.getBorderColor,e.DOM[m]=T.get,e.namespace("DOM.IE"),e.DOM.IE.COMPUTED=N,e.DOM.IE.ComputedStyle=T)})(e)},"3.7.2",{requires:["dom-style"]}),YUI.add("dom-screen",function(e,t){(function(e){var t="documentElement",n="compatMode",r="position",i="fixed",s="relative",o="left",u="top",a="BackCompat",f="medium",l="borderLeftWidth",c="borderTopWidth",h="getBoundingClientRect",p="getComputedStyle",d=e.DOM,v=/^t(?:able|d|h)$/i,m;e.UA.ie&&(e.config.doc[n]!=="BackCompat"?m=t:m="body"),e.mix(d,{winHeight:function(e){var t=d._getWinSize(e).height;return t},winWidth:function(e){var t=d._getWinSize(e).width;return t},docHeight:function(e){var t=d._getDocSize(e).height;return Math.max(t,d._getWinSize(e).height)},docWidth:function(e){var t=d._getDocSize(e).width;return Math.max(t,d._getWinSize(e).width)},docScrollX:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageXOffset:0;return Math.max(r[t].scrollLeft,r.body.scrollLeft,s)},docScrollY:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageYOffset:0;return Math.max(r[t].scrollTop,r.body.scrollTop,s)},getXY:function(){return e.config.doc[t][h]?function(r){var i=null,s,o,u,f,l,c,p,v,g,y;if(r&&r.tagName){p=r.ownerDocument,u=p[n],u!==a?y=p[t]:y=p.body,y.contains?g=y.contains(r):g=e.DOM.contains(y,r);if(g){v=p.defaultView,v&&"pageXOffset"in v?(s=v.pageXOffset,o=v.pageYOffset):(s=m?p[m].scrollLeft:d.docScrollX(r,p),o=m?p[m].scrollTop:d.docScrollY(r,p)),e.UA.ie&&(!p.documentMode||p.documentMode<8||u===a)&&(l=y.clientLeft,c=y.clientTop),f=r[h](),i=[f.left,f.top];if(l||c)i[0]-=l,i[1]-=c;if(o||s)if(!e.UA.ios||e.UA.ios>=4.2)i[0]+=s,i[1]+=o}else i=d._getOffset(r)}return i}:function(t){var n=null,s,o,u,a,f;if(t)if(d.inDoc(t)){n=[t.offsetLeft,t.offsetTop],s=t.ownerDocument,o=t,u=e.UA.gecko||e.UA.webkit>519?!0:!1;while(o=o.offsetParent)n[0]+=o.offsetLeft,n[1]+=o.offsetTop,u&&(n=d._calcBorders(o,n));if(d.getStyle(t,r)!=i){o=t;while(o=o.parentNode){a=o.scrollTop,f=o.scrollLeft,e.UA.gecko&&d.getStyle(o,"overflow")!=="visible"&&(n=d._calcBorders(o,n));if(a||f)n[0]-=f,n[1]-=a}n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n=d._getOffset(t);return n}}(),getScrollbarWidth:e.cached(function(){var t=e.config.doc,n=t.createElement("div"),r=t.getElementsByTagName("body")[0],i=.1;return r&&(n.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;",n.appendChild(t.createElement("p")).style.height="1px",r.insertBefore(n,r.firstChild),i=n.offsetWidth-n.clientWidth,r.removeChild(n)),i},null,.1),getX:function(e){return d.getXY(e)[0]},getY:function(e){return d.getXY(e)[1]},setXY:function(e,t,n){var i=d.setStyle,a,f,l,c;e&&t&&(a=d.getStyle(e,r),f=d._getOffset(e),a=="static"&&(a=s,i(e,r,a)),c=d.getXY(e),t[0]!==null&&i(e,o,t[0]-c[0]+f[0]+"px"),t[1]!==null&&i(e,u,t[1]-c[1]+f[1]+"px"),n||(l=d.getXY(e),(l[0]!==t[0]||l[1]!==t[1])&&d.setXY(e,t,!0)))},setX:function(e,t){return d.setXY(e,[t,null])},setY:function(e,t){return d.setXY(e,[null,t])},swapXY:function(e,t){var n=d.getXY(e);d.setXY(e,d.getXY(t)),d.setXY(t,n)},_calcBorders:function(t,n){var r=parseInt(d[p](t,c),10)||0,i=parseInt(d[p](t,l),10)||0;return e.UA.gecko&&v.test(t.tagName)&&(r=0,i=0),n[0]+=i,n[1]+=r,n},_getWinSize:function(r,i){i=i||r?d._getDoc(r):e.config.doc;var s=i.defaultView||i.parentWindow,o=i[n],u=s.innerHeight,a=s.innerWidth,f=i[t];return o&&!e.UA.opera&&(o!="CSS1Compat"&&(f=i.body),u=f.clientHeight,a=f.clientWidth),{height:u,width:a}},_getDocSize:function(r){var i=r?d._getDoc(r):e.config.doc,s=i[t];return i[n]!="CSS1Compat"&&(s=i.body),{height:s.scrollHeight,width:s.scrollWidth}}})})(e),function(e){var t="top",n="right",r="bottom",i="left",s=function(e,s){var o=Math.max(e[t],s[t]),u=Math.min(e[n],s[n]),a=Math.min(e[r],s[r]),f=Math.max(e[i],s[i]),l={};return l[t]=o,l[n]=u,l[r]=a,l[i]=f,l},o=e.DOM;e.mix(o,{region:function(e){var t=o.getXY(e),n=!1;return e&&t&&(n=o._getRegion(t[1],t[0]+e.offsetWidth,t[1]+e.offsetHeight,t[0])),n},intersect:function(u,a,f){var l=f||o.region(u),c={},h=a,p;if(h.tagName)c=o.region(h);else{if(!e.Lang.isObject(a))return!1;c=a}return p=s(c,l),{top:p[t],right:p[n],bottom:p[r],left:p[i],area:(p[r]-p[t])*(p[n]-p[i]),yoff:p[r]-p[t],xoff:p[n]-p[i],inRegion:o.inRegion(u,a,!1,f)}},inRegion:function(u,a,f,l){var c={},h=l||o.region(u),p=a,d;if(p.tagName)c=o.region(p);else{if(!e.Lang.isObject(a))return!1;c=a}return f?h[i]>=c[i]&&h[n]<=c[n]&&h[t]>=c[t]&&h[r]<=c[r]:(d=s(c,h),d[r]>=d[t]&&d[n]>=d[i]?!0:!1)},inViewportRegion:function(e,t,n){return o.inRegion(e,o.viewportRegion(e),t,n)},_getRegion:function(e,s,o,u){var a={};return a[t]=a[1]=e,a[i]=a[0]=u,a[r]=o,a[n]=s,a.width=a[n]-a[i],a.height=a[r]-a[t],a},viewportRegion:function(t){t=t||e.config.doc.documentElement;var n=!1,r,i;return t&&(r=o.docScrollX(t),i=o.docScrollY(t),n=o._getRegion(i,o.winWidth(t)+r,i+o.winHeight(t),r)),n}})}(e)},"3.7.2",{requires:["dom-base","dom-style"]}),YUI.add("selector-native",function(e,t){(function(e){e.namespace("Selector");var t="compareDocumentPosition",n="ownerDocument",r={_types:{esc:{token:"\ue000",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"\ue001",re:/(\[[^\]]*\])/g},pseudo:{token:"\ue002",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(e){return e&&(e=e.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")),e},_compare:"sourceIndex"in e.config.doc.documentElement?function(e,t){var n=e.sourceIndex,r=t.sourceIndex;return n===r?0:n>r?1:-1}:e.config.doc.documentElement[t]?function(e,n){return e[t](n)&4?-1:1}:function(e,t){var r,i,s;return e&&t&&(r=e[n].createRange(),r.setStart(e,0),i=t[n].createRange(),i.setStart(t,0),s=r.compareBoundaryPoints(1,i)),s},_sort:function(t){return t&&(t=e.Array(t,0,!0),t.sort&&t.sort(r._compare)),t},_deDupe:function(e){var t=[],n,r;for(n=0;r=e[n++];)r._found||(t[t.length]=r,r._found=!0);for(n=0;r=t[n++];)r._found=null,r.removeAttribute("_found");return t},query:function(t,n,i,s){n=n||e.config.doc;var o=[],u=e.Selector.useNative&&e.config.doc.querySelector&&!s,a=[[t,n]],f,l,c,h=u?e.Selector._nativeQuery:e.Selector._bruteQuery;if(t&&h){!s&&(!u||n.tagName)&&(a=r._splitQueries(t,n));for(c=0;f=a[c++];)l=h(f[0],f[1],i),i||(l=e.Array(l,0,!0)),l&&(o=o.concat(l));a.length>1&&(o=r._sort(r._deDupe(o)))}return i?o[0]||null:o},_replaceSelector:function(t){var n=e.Selector._parse("esc",t),i,s;return t=e.Selector._replace("esc",t),s=e.Selector._parse("pseudo",t),t=r._replace("pseudo",t),i=e.Selector._parse("attr",t),t=e.Selector._replace("attr",t),{esc:n,attrs:i,pseudos:s,selector:t}},_restoreSelector:function(t){var n=t.selector;return n=e.Selector._restore("attr",n,t.attrs),n=e.Selector._restore("pseudo",n,t.pseudos),n=e.Selector._restore("esc",n,t.esc),n},_replaceCommas:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t&&(t=t.replace(/,/g,"\ue007"),n.selector=t,t=e.Selector._restoreSelector(n)),t},_splitQueries:function(t,n){t.indexOf(",")>-1&&(t=e.Selector._replaceCommas(t));var r=t.split("\ue007"),i=[],s="",o,u,a;if(n){n.nodeType===1&&(o=e.Selector._escapeId(e.DOM.getId(n)),o||(o=e.guid(),e.DOM.setId(n,o)),s='[id="'+o+'"] ');for(u=0,a=r.length;u<a;++u)t=s+r[u],i.push([t,n])}return i},_nativeQuery:function(t,n,r){if(e.UA.webkit&&t.indexOf(":checked")>-1&&e.Selector.pseudos&&e.Selector.pseudos.checked)return e.Selector.query(t,n,r,!0);try{return n["querySelector"+(r?"":"All")](t)}catch(i){return e.Selector.query(t,n,r,!0)}},filter:function(t,n){var r=[],i,s;if(t&&n)for(i=0;s=t[i++];)e.Selector.test(s,n)&&(r[r.length]=s);return r},test:function(t,r,i){var s=!1,o=!1,u,a,f,l,c,h,p,d,v;if(t&&t.tagName)if(typeof r=="function")s=r.call(t,t);else{u=r.split(","),!i&&!e.DOM.inDoc(t)&&(a=t.parentNode,a?i=a:(c=t[n].createDocumentFragment(),c.appendChild(t),i=c,o=!0)),i=i||t[n],h=e.Selector._escapeId(e.DOM.getId(t)),h||(h=e.guid(),e.DOM.setId(t,h));for(p=0;v=u[p++];){v+='[id="'+h+'"]',l=e.Selector.query(v,i);for(d=0;f=l[d++];)if(f===t){s=!0;break}if(s)break}o&&c.removeChild(t)}return s},ancestor:function(t,n,r){return e.DOM.ancestor(t,function(t){return e.Selector.test(t,n)},r)},_parse:function(t,n){return n.match(e.Selector._types[t].re)},_replace:function(t,n){var r=e.Selector._types[t];return n.replace(r.re,r.token)},_restore:function(t,n,r){if(r){var i=e.Selector._types[t].token,s,o;for(s=0,o=r.length;s<o;++s)n=n.replace(i,r[s])}return n}};e.mix(e.Selector,r,!0)})(e)},"3.7.2",{requires:["dom-base"]}),YUI.add("selector",function(e,t){},"3.7.2",{requires:["selector-native"]}),YUI.add("event-custom-base",function(e,t){e.Env.evt={handles:{},plugins:{}};var n=0,r=1,i={objs:null,before:function(t,r,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(n,o,r,i)},after:function(t,n,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(r,o,n,i)},_inject:function(t,n,r,i){var s=e.stamp(r),o,u;return r._yuiaop||(r._yuiaop={}),o=r._yuiaop,o[i]||(o[i]=new e.Do.Method(r,i),r[i]=function(){return o[i].exec.apply(o[i],arguments)}),u=s+e.stamp(n)+i,o[i].register(u,n,t),new e.EventHandle(o[i],u)},detach:function(e){e.detach&&e.detach()},_unload:function(e,t){}};e.Do=i,i.Method=function(e,t){this.obj=e,this.methodName=t,this.method=e[t],this.before={},this.after={}},i.Method.prototype.register=function(e,t,n){n?this.after[e]=t:this.before[e]=t},i.Method.prototype._delete=function(e){delete this.before[e],delete this.after[e]},i.Method.prototype.exec=function(){var t=e.Array(arguments,0,!0),n,r,s,o=this.before,u=this.after,a=!1;for(n in o)if(o.hasOwnProperty(n)){r=o[n].apply(this.obj,t);if(r)switch(r.constructor){case i.Halt:return r.retVal;case i.AlterArgs:t=r.newArgs;break;case i.Prevent:a=!0;break;default:}}a||(r=this.method.apply(this.obj,t)),i.originalRetVal=r,i.currentRetVal=r;for(n in u)if(u.hasOwnProperty(n)){s=u[n].apply(this.obj,t);if(s&&s.constructor==i.Halt)return s.retVal;s&&s.constructor==i.AlterReturn&&(r=s.newRetVal,i.currentRetVal=r)}return r},i.AlterArgs=function(e,t){this.msg=e,this.newArgs=t},i.AlterReturn=function(e,t){this.msg=e,this.newRetVal=t},i.Halt=function(e,t){this.msg=e,this.retVal=t},i.Prevent=function(e){this.msg=e},i.Error=i.Halt;var s=e.Array,o="after",u=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],a=s.hash(u),f=Array.prototype.slice,l=9,c="yui:log",h=function(e,t,n){var r;for(r in t)a[r]&&(n||!(r in e))&&(e[r]=t[r]);return e};e.CustomEvent=function(t,n){this._kds=e.CustomEvent.keepDeprecatedSubs,n=n||{},this.id=e.stamp(this),this.type=t,this.context=e,this.logSystem=t==c,this.silent=this.logSystem,this._kds&&(this.subscribers={}),this._subscribers=[],this._kds&&(this.afters={}),this._afters=[],this.preventable=!0,this.bubbles=!0,this.signature=l,this.applyConfig(n,!0)},e.CustomEvent.keepDeprecatedSubs=!1,e.CustomEvent.mixConfigs=h,e.CustomEvent.prototype={constructor:e.CustomEvent,hasSubs:function(e){var t=this._subscribers.length,n=this._afters.length,r=this.sibling;return r&&(t+=r._subscribers.length,n+=r._afters.length),e?e=="after"?n:t:t+n},monitor:function(e){this.monitored=!0;var t=this.id+"|"+this.type+"_"+e,n=f.call(arguments,0);return n[0]=t,this.host.on.apply(this.host,n)},getSubs:function(){var e=this._subscribers,t=this._afters,n=this.sibling;return e=n?e.concat(n._subscribers):e.concat(),t=n?t.concat(n._afters):t.concat(),[e,t]},applyConfig:function(e,t){h(this,e,t)},_on:function(t,n,r,i){t||this.log("Invalid callback for CE: "+this.type);var s=new e.Subscriber(t,n,r,i);return this.fireOnce&&this.fired&&(this.async?setTimeout(e.bind(this._notify,this,s,this.firedWith),0):this._notify(s,this.firedWith)),i==o?this._afters.push(s):this._subscribers.push(s),this._kds&&(i==o?this.afters[s.id]=s:this.subscribers[s.id]=s),new e.EventHandle(this,s)},subscribe:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,!0)},on:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this.monitored&&this.host&&this.host._monitor("attach",this,{args:arguments}),this._on(e,t,n,!0)},after:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,o)},detach:function(e,t){if(e&&e.detach)return e.detach();var n,r,i=0,s=this._subscribers,o=this._afters;for(n=s.length;n>=0;n--)r=s[n],r&&(!e||e===r.fn)&&(this._delete(r,s,n),i++);for(n=o.length;n>=0;n--)r=o[n],r&&(!e||e===r.fn)&&(this._delete(r,o,n),i++);return i},unsubscribe:function(){return this.detach.apply(this,arguments)},_notify:function(e,t,n){this.log(this.type+"->"+"sub: "+e.id);var r;return r=e.notify(t,this),!1===r||this.stopped>1?(this.log(this.type+" cancelled by subscriber"),!1):!0},log:function(e,t){},fire:function(){if(this.fireOnce&&this.fired)return this.log("fireOnce event: "+this.type+" already fired"),!0;var e=f.call(arguments,0);return this.fired=!0,this.fireOnce&&(this.firedWith=e),this.emitFacade?this.fireComplex(e):this.fireSimple(e)},fireSimple:function(e){this.stopped=0,this.prevented=0;if(this.hasSubs()){var t=this.getSubs();this._procSubs(t[0],e),this._procSubs(t[1],e)}return this._broadcast(e),this.stopped?!1:!0},fireComplex:function(e){return this.log("Missing event-custom-complex needed to emit a facade for: "+this.type),e[0]=e[0]||{},this.fireSimple(e)},_procSubs:function(e,t,n){var r,i,s;for(i=0,s=e.length;i<s;i++){r=e[i];if(r&&r.fn){!1===this._notify(r,t,n)&&(this.stopped=2);if(this.stopped==2)return!1}}return!0},_broadcast:function(t){if(!this.stopped&&this.broadcast){var n=t.concat();n.unshift(this.type),this.host!==e&&e.fire.apply(e,n),this.broadcast==2&&e.Global.fire.apply(e.Global,n)}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},detachAll:function(){return this.detach()},_delete:function(e,t,n){var r=e._when;t||(t=r===o?this._afters:this._subscribers,n=s.indexOf(t,e,0)),e&&t[n]===e&&t.splice(n,1),this._kds&&(r===o?delete this.afters[e.id]:delete this.subscribers[e.id]),this.monitored&&this.host&&this.host._monitor("detach",this,{ce:this,sub:e}),e&&(e.deleted=!0)}},e.Subscriber=function(t,n,r,i){this.fn=t,this.context=n,this.id=e.stamp(this),this.args=r,this._when=i},e.Subscriber.prototype={constructor:e.Subscriber,_notify:function(e,t,n){if(this.deleted&&!this.postponed){if(!this.postponed)return delete this.postponed,null;delete this.fn,delete this.context}var r=this.args,i;switch(n.signature){case 0:i=this.fn.call(e,n.type,t,e);break;case 1:i=this.fn.call(e,t[0]||null,e);break;default:r||t?(t=t||[],r=r?t.concat(r):t,i=this.fn.apply(e,r)):i=this.fn.call(e)}return this.once&&n._delete(this),i},notify:function(t,n){var r=this.context,i=!0;r||(r=n.contextFn?n.contextFn():n.context);if(e.config&&e.config.throwFail)i=this._notify(r,t,n);else try{i=this._notify(r,t,n)}catch(s){e.error(this+" failed: "+s.message,s)}return i},contains:function(e,t){return t?this.fn==e&&this.context==t:this.fn==e},valueOf:function(){return this.id}},e.EventHandle=function(e,t){this.evt=e,this.sub=t},e.EventHandle.prototype={batch:function(t,n){t.call(n||this,this),e.Lang.isArray(this.evt)&&e.Array.each(this.evt,function(e){e.batch.call(n||e,t)})},detach:function(){var t=this.evt,n=0,r;if(t)if(e.Lang.isArray(t))for(r=0;r<t.length;r++)n+=t[r].detach();else t._delete(this.sub),n=1;return n},monitor:function(e){return this.evt.monitor.apply(this.evt,arguments)}};var p=e.Lang,d=":",v="|",m="~AFTER~",g=/(.*?)(:)(.*?)/,y=e.cached(function(e){return e.replace(g,"*$2$3")}),b=e.cached(function(e,t){return!t||typeof e!="string"||e.indexOf(d)>-1?e:t+d+e}),w=e.cached(function(e,t){var n=e,r,i,s;return p.isString(n)?(s=n.indexOf(m),s>-1&&(i=!0,n=n.substr(m.length)),s=n.indexOf(v),s>-1&&(r=n.substr(0,s),n=n.substr(s+1),n=="*"&&(n=null)),[r,t?b(n,t):n,i,n]):n}),E=function(t){var n=p.isObject(t)?t:{};this._yuievt=this._yuievt||{id:e.guid(),events:{},targets:{},config:n,chain:"chain"in n?n.chain:e.config.chain,bubbling:!1,defaults:{context:n.context||this,host:this,emitFacade:n.emitFacade,fireOnce:n.fireOnce,queuable:n.queuable,monitored:n.monitored,broadcast:n.broadcast,defaultTargetOnly:n.defaultTargetOnly,bubbles:"bubbles"in n?n.bubbles:!0}}};E.prototype={constructor:E,once:function(){var e=this.on.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},onceAfter:function(){var e=this.after.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},parseType:function(e,t){return w(e,t||this._yuievt.config.prefix)},on:function(t,n,r){var i=this._yuievt,s=w(t,i.config.prefix),o,u,a,l,c,h,d,v=e.Env.evt.handles,g,y,b,E=e.Node,S,x,T;this._monitor("attach",s[1],{args:arguments,category:s[0],after:s[2]});if(p.isObject(t))return p.isFunction(t)?e.Do.before.apply(e.Do,arguments):(o=n,u=r,a=f.call(arguments,0),l=[],p.isArray(t)&&(T=!0),g=t._after,delete t._after,e.each(t,function(e,t){p.isObject(e)&&(o=e.fn||(p.isFunction(e)?e:o),u=e.context||u);var n=g?m:"";a[0]=n+(T?e:t),a[1]=o,a[2]=u,l.push(this.on.apply(this,a))},this),i.chain?this:new e.EventHandle(l));h=s[0],g=s[2],b=s[3];if(E&&e.instanceOf(this,E)&&b in E.DOM_EVENTS)return a=f.call(arguments,0),a.splice(2,0,E.getDOMNode(this)),e.on.apply(e,a);t=s[1];if(e.instanceOf(this,YUI)){y=e.Env.evt.plugins[t],a=f.call(arguments,0),a[0]=b,E&&(S=a[2],e.instanceOf(S,e.NodeList)?S=e.NodeList.getDOMNodes(S):e.instanceOf(S,E)&&(S=E.getDOMNode(S)),x=b in E.DOM_EVENTS,x&&(a[2]=S));if(y)d=y.on.apply(e,a);else if(!t||x)d=e.Event._attach(a)}return d||(c=i.events[t]||this.publish(t),d=c._on(n,r,arguments.length>3?f.call(arguments,3):null,g?"after":!0)),h&&(v[h]=v[h]||{},v[h][t]=v[h][t]||[],v[h][t].push(d)),i.chain?this:d},subscribe:function(){return this.on.apply(this,arguments)},detach:function(t,n,r){var i=this._yuievt.events,s,o=e.Node,u=o&&e.instanceOf(this,o);if(!t&&this!==e){for(s in i)i.hasOwnProperty(s)&&i[s].detach(n,r);return u&&e.Event.purgeElement(o.getDOMNode(this)),this}var a=w(t,this._yuievt.config.prefix),l=p.isArray(a)?a[0]:null,c=a?a[3]:null,h,d=e.Env.evt.handles,v,m,g,y,b=function(e,t,n){var r=e[t],i,s;if(r)for(s=r.length-1;s>=0;--s)i=r[s].evt,(i.host===n||i.el===n)&&r[s].detach()};if(l){m=d[l],t=a[1],v=u?e.Node.getDOMNode(this):this;if(m){if(t)b(m,t,v);else for(s in m)m.hasOwnProperty(s)&&b(m,s,v);return this}}else{if(p.isObject(t)&&t.detach)return t.detach(),this;if(u&&(!c||c in o.DOM_EVENTS))return g=f.call(arguments,0),g[2]=o.getDOMNode(this),e.detach.apply(e,g),this}h=e.Env.evt.plugins[c];if(e.instanceOf(this,YUI)){g=f.call(arguments,0);if(h&&h.detach)return h.detach.apply(e,g),this;if(!t||!h&&o&&t in o.DOM_EVENTS)return g[0]=t,e.Event.detach.apply(e.Event,g),this}return y=i[a[1]],y&&y.detach(n,r),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(e){return this.detach(e)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(t,n){var r,i,s,o,u=this._yuievt,a=u.config.prefix;return p.isObject(t)?(s={},e.each(t,function(e,t){s[t]=this.publish(t,e||n)},this),s):(t=a?b(t,a):t,r=u.events,i=r[t],this._monitor("publish",t,{args:arguments}),i?n&&i.applyConfig(n,!0):(o=u.defaults,i=new e.CustomEvent(t,o),n&&i.applyConfig(n,!0),r[t]=i),r[t])},_monitor:function(e,t,n){var r,i,s;if(t){typeof t=="string"?(s=t,i=this.getEvent(t,!0)):(i=t,s=t.type);if(this._yuievt.config.monitored&&(!i||i.monitored)||i&&i.monitored)r=s+"_"+e,n.monitored=e,this.fire.call(this,r,n)}},fire:function(e){var t=p.isString(e),n=t?e:e&&e.type,r=this._yuievt,i=r.config.prefix,s,o,u,a=t?f.call(arguments,1):arguments;n=i?b(n,i):n,s=this.getEvent(n,!0),u=this.getSibling(n,s),u&&!s&&(s=this.publish(n)),this._monitor("fire",s||n,{args:a});if(!s){if(r.hasTargets)return this.bubble({type:n},a,this);o=!0}else s.sibling=u,o=s.fire.apply(s,a);return r.chain?this:o},getSibling:function(e,t){var n;return e.indexOf(d)>-1&&(e=y(e),n=this.getEvent(e,!0),n&&(n.applyConfig(t),n.bubbles=!1,n.broadcast=0)),n},getEvent:function(e,t){var n,r;return t||(n=this._yuievt.config.prefix,e=n?b(e,n):e),r=this._yuievt.events,r[e]||null},after:function(t,n){var r=f.call(arguments,0);switch(p.type(t)){case"function":return e.Do.after.apply(e.Do,arguments);case"array":case"object":r[0]._after=!0;break;default:r[0]=m+t}return this.on.apply(this,r)},before:function(){return this.on.apply(this,arguments)}},e.EventTarget=E,e.mix(e,E.prototype),E.call(e,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new E,e.Global=YUI.Env.globalEvents},"3.7.2",{requires:["oop"]}),YUI.add("event-custom-complex",function(e,t){var n,r,i,s={},o=e.CustomEvent.prototype,u=e.EventTarget.prototype,a=function(e,t){var n;for(n in t)r.hasOwnProperty(n)||(e[n]=t[n])};e.EventFacade=function(e,t){e=e||s,this._event=e,this.details=e.details,this.type=e.type,this._type=e.type,this.target=e.target,this.currentTarget=t,this.relatedTarget=e.relatedTarget},e.mix(e.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(e){this._event.halt(e),this.prevented=1,this.stopped=e?2:1}}),o.fireComplex=function(t){var n,r,i,s,o,u,a,f,l,c=this,h=c.host||c,p,d;if(c.stack&&c.queuable&&c.type!=c.stack.next.type)return c.log("queue "+c.type),c.stack.queue.push([c,t]),!0;n=c.stack||{id:c.id,next:c,silent:c.silent,stopped:0,prevented:0,bubbling:null,type:c.type,afterQueue:new e.Queue,defaultTargetOnly:c.defaultTargetOnly,queue:[]},f=c.getSubs(),c.stopped=c.type!==n.type?0:n.stopped,c.prevented=c.type!==n.type?0:n.prevented,c.target=c.target||h,c.stoppedFn&&(a=new e.EventTarget({fireOnce:!0,context:h}),c.events=a,a.on("stopped",c.stoppedFn)),c.currentTarget=h,c.details=t.slice(),c.log("Firing "+c.type),c._facade=null,r=c._getFacade(t),e.Lang.isObject(t[0])?t[0]=r:t.unshift(r),f[0]&&c._procSubs(f[0],t,r),c.bubbles&&h.bubble&&!c.stopped&&(d=n.bubbling,n.bubbling=c.type,n.type!=c.type&&(n.stopped=0,n.prevented=0),u=h.bubble(c,t,null,n),c.stopped=Math.max(c.stopped,n.stopped),c.prevented=Math.max(c.prevented,n.prevented),n.bubbling=d),c.prevented?c.preventedFn&&c.preventedFn.apply(h,t):c.defaultFn&&(!c.defaultTargetOnly&&!n.defaultTargetOnly||h===r.target)&&c.defaultFn.apply(h,t),c._broadcast(t);if(f[1]&&!c.prevented&&c.stopped<2)if(n.id===c.id||c.type!=h._yuievt.bubbling){c._procSubs(f[1],t,r);while(p=n.afterQueue.last())p()}else l=f[1],n.execDefaultCnt&&(l=e.merge(l),e.each(l,function(e){e.postponed=!0})),n.afterQueue.add(function(){c._procSubs(l,t,r)});c.target=null;if(n.id===c.id){s=n.queue;while(s.length)i=s.pop(),o=i[0],n.next=o,o.fire.apply(o,i[1]);c.stack=null}return u=!c.stopped,c.type!=h._yuievt.bubbling&&(n.stopped=0,n.prevented=0,c.stopped=0,c.prevented=0),c._facade=null,u},o._getFacade=function(){var t=this._facade,n,r=this.details;return t||(t=new e.EventFacade(this,this.currentTarget)),n=r&&r[0],e.Lang.isObject(n,!0)&&(a(t,n),t.type=n.type||t.type),t.details=this.details,t.target=this.originalTarget||this.target,t.currentTarget=this.currentTarget,t.stopped=0,t.prevented=0,this._facade=t,this._facade},o.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},o.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},o.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},o.halt=function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},u.addTarget=function(t){this._yuievt.targets[e.stamp(t)]=t,this._yuievt.hasTargets=!0},u.getTargets=function(){return e.Object.values(this._yuievt.targets)},u.removeTarget=function(t){delete this._yuievt.targets[e.stamp(t)]},u.bubble=function(e,t,n,r){var i=this._yuievt.targets,s=!0,o,u=e&&e.type,a,f,l,c,h=n||e&&e.target||this,p;if(!e||!e.stopped&&i)for(f in i)if(i.hasOwnProperty(f)){o=i[f],a=o.getEvent(u,!0),c=o.getSibling(u,a),c&&!a&&(a=o.publish(u)),p=o._yuievt.bubbling,o._yuievt.bubbling=u;if(!a)o._yuievt.hasTargets&&o.bubble(e,t,h,r);else{a.sibling=c,a.target=h,a.originalTarget=h,a.currentTarget=o,l=a.broadcast,a.broadcast=!1,a.emitFacade=!0,a.stack=r,s=s&&a.fire.apply(a,t||e.details||[]),a.broadcast=l,a.originalTarget=null;if(a.stopped)break}o._yuievt.bubbling=p}return s},n=new e.EventFacade,r={};for(i in n)r[i]=!0},"3.7.2",{requires:["event-custom-base"]}),YUI.add("node-core",function(e,t){var n=".",r="nodeName",i="nodeType",s="ownerDocument",o="tagName",u="_yuid",a={},f=Array.prototype.slice,l=e.DOM,c=function(t){if(!this.getDOMNode)return new c(t);if(typeof t=="string"){t=c._fromString(t);if(!t)return null}var n=t.nodeType!==9?t.uniqueID:t[u];n&&c._instances[n]&&c._instances[n]._node!==t&&(t[u]=null),n=n||e.stamp(t),n||(n=e.guid()),this[u]=n,this._node=t,this._stateProxy=t,this._initPlugins&&this._initPlugins()},h=function(t){var n=null;return t&&(n=typeof t=="string"?function(n){return e.Selector.test(n,t)}:function(n){return t(e.one(n))}),n};c.ATTRS={},c.DOM_EVENTS={},c._fromString=function(t){return t&&(t.indexOf("doc")===0?t=e.config.doc:t.indexOf("win")===0?t=e.config.win:t=e.Selector.query(t,null,!0)),t||null},c.NAME="node",c.re_aria=/^(?:role$|aria-)/,c.SHOW_TRANSITION="fadeIn",c.HIDE_TRANSITION="fadeOut",c._instances={},c.getDOMNode=function(e){return e?e.nodeType?e:e._node||null:null},c.scrubVal=function(t,n){if(t){if(typeof t=="object"||typeof t=="function")if(i in t||l.isWindow(t))t=e.one(t);else if(t.item&&!t._nodes||t[0]&&t[0][i])t=e.all(t)}else typeof t=="undefined"?t=n:t===null&&(t=null);return t},c.addMethod=function(e,t,n){e&&t&&typeof t=="function"&&(c.prototype[e]=function(){var e=f.call(arguments),n=this,r;return e[0]&&e[0]._node&&(e[0]=e[0]._node),e[1]&&e[1]._node&&(e[1]=e[1]._node),e.unshift(n._node),r=t.apply(n,e),r&&(r=c.scrubVal(r,n)),typeof r!="undefined"||(r=n),r})},c.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,c.addMethod(r,t[n],t)):e.Array.each(n,function(e){c.importMethod(t,e)})},c.one=function(t){var n=null,r,i;if(t){if(typeof t=="string"){t=c._fromString(t);if(!t)return null}else if(t.getDOMNode)return t;if(t.nodeType||e.DOM.isWindow(t)){i=t.uniqueID&&t.nodeType!==9?t.uniqueID:t._yuid,n=c._instances[i],r=n?n._node:null;if(!n||r&&t!==r)n=new c(t),t.nodeType!=11&&(c._instances[n[u]]=n)}}return n},c.DEFAULT_SETTER=function(t,r){var i=this._stateProxy,s;return t.indexOf(n)>-1?(s=t,t=t.split(n),e.Object.setValue(i,t,r)):typeof i[t]!="undefined"&&(i[t]=r),r},c.DEFAULT_GETTER=function(t){var r=this._stateProxy,i;return t.indexOf&&t.indexOf(n)>-1?i=e.Object.getValue(r,t.split(n)):typeof r[t]!="undefined"&&(i=r[t]),i},e.mix(c.prototype,{DATA_PREFIX:"data-",toString:function(){var e=this[u]+": not bound to a node",t=this._node,n,i,s;return t&&(n=t.attributes,i=n&&n.id?t.getAttribute("id"):null,s=n&&n.className?t.getAttribute("className"):null,e=t[r],i&&(e+="#"+i),s&&(e+="."+s.replace(" ",".")),e+=" "+this[u]),e},get:function(e){var t;return this._getAttr?t=this._getAttr(e):t=this._get(e),t?t=c.scrubVal(t,this):t===null&&(t=null),t},_get:function(e){var t=c.ATTRS[e],n;return t&&t.getter?n=t.getter.call(this):c.re_aria.test(e)?n=this._node.getAttribute(e,2):n=c.DEFAULT_GETTER.apply(this,arguments),n},set:function(e,t){var n=c.ATTRS[e];return this._setAttr?this._setAttr.apply(this,arguments):n&&n.setter?n.setter.call(this,t,e):c.re_aria.test(e)?this._node.setAttribute(e,t):c.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(t){return this._setAttrs?this._setAttrs(t):e.Object.each(t,function(e,t){this.set(t,e)},this),this},getAttrs:function(t){var n={};return this._getAttrs?this._getAttrs(t):e.Array.each(t,function(e,t){n[e]=this.get(e)},this),n},compareTo:function(e){var t=this._node;return e&&e._node&&(e=e._node),t===e},inDoc:function(e){var t=this._node;e=e?e._node||e:t[s];if(e.documentElement)return l.contains(e.documentElement,t)},getById:function(t){var n=this._node,r=l.byId(t,n[s]);return r&&l.contains(n,r)?r=e.one(r):r=null,r},ancestor:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.one(l.ancestor(this._node,h(t),n,h(r)))},ancestors:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.all(l.ancestors(this._node,h(t),n,h(r)))},previous:function(t,n){return e.one(l.elementByAxis(this._node,"previousSibling",h(t),n))},next:function(t,n){return e.one(l.elementByAxis(this._node,"nextSibling",h(t),n))},siblings:function(t){return e.all(l.siblings(this._node,h(t)))},one:function(t){return e.one(e.Selector.query(t,this._node,!0))},all:function(t){var n=e.all(e.Selector.query(t,this._node));return n._query=t,n._queryRoot=this._node,n},test:function(t){return e.Selector.test(this._node,t)},remove:function(e){var t=this._node;return t&&t.parentNode&&t.parentNode.removeChild(t),e&&this.destroy(),this},replace:function(e){var t=this._node;return typeof e=="string"&&(e=c.create(e)),t.parentNode.replaceChild(c.getDOMNode(e),t),this},replaceChild:function(t,n){return typeof t=="string"&&(t=l.create(t)),e.one(this._node.replaceChild(c.getDOMNode(t),c.getDOMNode(n)))},destroy:function(t){var n=e.config.doc.uniqueID?"uniqueID":"_yuid",r;this.purge(),this.unplug&&this.unplug(),this.clearData(),t&&e.NodeList.each(this.all("*"),function(t){r=c._instances[t[n]],r?r.destroy():e.Event.purgeElement(t)}),this._node=null,this._stateProxy=null,delete c._instances[this._yuid]},invoke:function(e,t,n,r,i,s){var o=this._node,u;return t&&t._node&&(t=t._node),n&&n._node&&(n=n._node),u=o[e](t,n,r,i,s),c.scrubVal(u,this)},swap:e.config.doc.documentElement.swapNode?function(e){this._node.swapNode(c.getDOMNode(e))}:function(e){e=c.getDOMNode(e);var t=this._node,n=e.parentNode,r=e.nextSibling;return r===t?n.insertBefore(t,e):e===t.nextSibling?n.insertBefore(e,t):(t.parentNode.replaceChild(e,t),l.addHTML(n,t,r)),this},hasMethod:function(e){var t=this._node;return!(!(t&&e in t&&typeof t[e]!="unknown")||typeof t[e]!="function"&&String(t[e]).indexOf("function")!==1)},isFragment:function(){return this.get("nodeType")===11},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),e.Node=c,e.one=c.one;var p=function(t){var n=[];t&&(typeof t=="string"?(this._query=t,t=e.Selector.query(t)):t.nodeType||l.isWindow(t)?t=[t]:t._node?t=[t._node]:t[0]&&t[0]._node?(e.Array.each(t,function(e){e._node&&n.push(e._node)}),t=n):t=e.Array(t,0,!0)),this._nodes=t||[]};p.NAME="NodeList",p.getDOMNodes=function(e){return e&&e._nodes?e._nodes:e},p.each=function(t,n,r){var i=t._nodes;i&&i.length&&e.Array.each(i,n,r||t)},p.addMethod=function(t,n,r){t&&n&&(p.prototype[t]=function(){var t=[],i=arguments;return e.Array.each(this._nodes,function(s){var o=s.uniqueID&&s.nodeType!==9?"uniqueID":"_yuid",u=e.Node._instances[s[o]],a,f;u||(u=p._getTempNode(s)),a=r||u,f=n.apply(a,i),f!==undefined&&f!==u&&(t[t.length]=f)}),t.length?t:this})},p.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,p.addMethod(n,t[n])):e.Array.each(n,function(e){p.importMethod(t,e)})},p._getTempNode=function(t){var n=p._tempNode;return n||(n=e.Node.create("<div></div>"),p._tempNode=n),n._node=t,n._stateProxy=t,n},e.mix(p.prototype,{_invoke:function(e,t,n){var r=n?[]:this;return this.each(function(i){var s=i[e].apply(i,t);n&&r.push(s)}),r},item:function(t){return e.one((this._nodes||[])[t])},each:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){return i=e.one(i),t.call(n||i,i,s,r)}),r},batch:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){var o=e.Node._instances[i[u]];return o||(o=p._getTempNode(i)),t.call(n||o,o,s,r)}),r},some:function(t,n){var r=this;return e.Array.some(this._nodes,function(i,s){return i=e.one(i),n=n||i,t.call(n,i,s,r)})},toFrag:function(){return e.one(e.DOM._nl2frag(this._nodes))},indexOf:function(t){return e.Array.indexOf(this._nodes,e.Node.getDOMNode(t))},filter:function(t){return e.all(e.Selector.filter(this._nodes,t))},modulus:function(t,n){n=n||0;var r=[];return p.each(this,function(e,i){i%t===n&&r.push(e)}),e.all(r)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var t,n=this._nodes,r=this._query,i=this._queryRoot;return r&&(i||n&&n[0]&&n[0].ownerDocument&&(i=n[0].ownerDocument),this._nodes=e.Selector.query(r,i)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e="",t=this[u]+": not bound to any nodes",n=this._nodes,i;return n&&n[0]&&(i=n[0],e+=i[r],i.id&&(e+="#"+i.id),i.className&&(e+="."+i.className.replace(" ",".")),n.length>1&&(e+="...["+n.length+" items]")),e||t},getDOMNodes:function(){return this._nodes}},!0),p.importMethod(e.Node.prototype,["destroy","empty","remove","set"]),p.prototype.get=function(t){var n=[],r=this._nodes,i=!1,s=p._getTempNode,o,u;return r[0]&&(o=e.Node._instances[r[0]._yuid]||s(r[0]),u=o._get(t),u&&u.nodeType&&(i=!0)),e.Array.each(r,function(r){o=e.Node._instances[r._yuid],o||(o=s(r)),u=o._get(t),i||(u=e.Node.scrubVal(u,o)),n.push(u)}),i?e.all(n):n},e.NodeList=p,e.all=function(e){return new p(e)},e.Node.all=e.all;var d=e.NodeList,v=Array.prototype,m={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};e.Object.each(m,function(t,n){d.prototype[n]=function(){var r=[],i=0,s,o;while(typeof (s=arguments[i++])!="undefined")r.push(s._node||s._nodes||s);return o=v[n].apply(this._nodes,r),t?o=e.all(o):o=e.Node.scrubVal(o),o}}),e.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(t){e.Node.prototype[t]=function(e,n,r){var i=this.invoke(t,e,n,r);return i}}),e.Node.prototype.removeAttribute=function(e){var t=this._node;return t&&t.removeAttribute(e,0),this},e.Node.importMethod(e.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),e.NodeList.importMethod(e.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"3.7.2",{requires:["dom-core","selector"]}),YUI.add("node-base",function(e,t){var n=["hasClass","addClass","removeClass","replaceClass","toggleClass"];e.Node.importMethod(e.DOM,n),e.NodeList.importMethod(e.Node.prototype,n);var r=e.Node,i=e.DOM;r.create=function(t,n){return n&&n._node&&(n=n._node),e.one(i.create(t,n))},e.mix(r.prototype,{create:r.create,insert:function(e,t){return this._insert(e,t),this},_insert:function(e,t){var n=this._node,r=null;return typeof t=="number"?t=this._node.childNodes[t]:t&&t._node&&(t=t._node),e&&typeof e!="string"&&(e=e._node||e._nodes||e),r=i.addHTML(n,e,t),r},prepend:function(e){return this.insert(e,0)},append:function(e){return this.insert(e,null)},appendChild:function(e){return r.scrubVal(this._insert(e))},insertBefore:function(t,n){return e.Node.scrubVal(this._insert(t,n))},appendTo:function(t){return e.one(t).append(this),this},setContent:function(e){return this._insert(e,"replace"),this},getContent:function(e){return this.get("innerHTML")}}),e.Node.prototype.setHTML=e.Node.prototype.setContent,e.Node.prototype.getHTML=e.Node.prototype.getContent,e.NodeList.importMethod(e.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent","setHTML","getHTML"]);var r=e.Node,i=e.DOM;r.ATTRS={text:{getter:function(){return i.getText(this._node)},setter:function(e){return i.setText(this._node,e),e}},"for":{getter:function(){return i.getAttribute(this._node,"for")},setter:function(e){return i.setAttribute(this._node,"for",e),e}},options:{getter:function(){return this._node.getElementsByTagName("option")}},children:{getter:function(){var t=this._node,n=t.children,r,i,s;if(!n){r=t.childNodes,n=[];for(i=0,s=r.length;i<s;++i)r[i].tagName&&(n[n.length]=r[i])}return e.all(n)}},value:{getter:function(){return i.getValue(this._node)},setter:function(e){return i.setValue(this._node,e),e}}},e.Node.importMethod(e.DOM,["setAttribute","getAttribute"]);var r=e.Node,s=e.NodeList;r.DOM_EVENTS={abort:1,beforeunload:1,blur:1,change:1,click:1,close:1,command:1,contextmenu:1,dblclick:1,DOMMouseScroll:1,drag:1,dragstart:1,dragenter:1,dragover:1,dragleave:1,dragend:1,drop:1,error:1,focus:1,key:1,keydown:1,keypress:1,keyup:1,load:1,message:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mousemultiwheel:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,orientationchange:1,reset:1,resize:1,select:1,selectstart:1,submit:1,scroll:1,textInput:1,unload:1},e.mix(r.DOM_EVENTS,e.Env.evt.plugins),e.augment(r,e.EventTarget),e.mix(r.prototype,{purge:function(t,n){return e.Event.purgeElement(this._node,t,n),this}}),e.mix(e.NodeList.prototype,{_prepEvtArgs:function(t,n,r){var i=e.Array(arguments,0,!0);return i.length<2?i[2]=this._nodes:i.splice(2,0,this._nodes),i[3]=r||this,i},on:function(t,n,r){return e.on.apply(e,this._prepEvtArgs.apply(this,arguments))},once:function(t,n,r){return e.once.apply(e,this._prepEvtArgs.apply(this,arguments))},after:function(t,n,r){return e.after.apply(e,this._prepEvtArgs.apply(this,arguments))},onceAfter:function(t,n,r){return e.onceAfter.apply(e,this._prepEvtArgs.apply(this,arguments))}}),s.importMethod(e.Node.prototype,["detach","detachAll"]),e.mix(e.Node.ATTRS,{offsetHeight:{setter:function(t){return e.DOM.setHeight(this._node,t),t},getter:function(){return this._node.offsetHeight}},offsetWidth:{setter:function(t){return e.DOM.setWidth(this._node,t),t},getter:function(){return this._node.offsetWidth}}}),e.mix(e.Node.prototype,{sizeTo:function(t,n){var r;arguments.length<2&&(r=e.one(t),t=r.get("offsetWidth"),n=r.get("offsetHeight")),this.setAttrs({offsetWidth:t,offsetHeight:n})}});var r=e.Node;e.mix(r.prototype,{show:function(e){return e=arguments[arguments.length-1],this.toggleView(!0,e),this},_show:function(){this.setStyle("display","")},_isHidden:function(){return e.DOM.getStyle(this._node,"display")==="none"},toggleView:function(e,t){return this._toggleView.apply(this,arguments),this},_toggleView:function(e,t){return t=arguments[arguments.length-1],typeof e!="boolean"&&(e=this._isHidden()?1:0),e?this._show():this._hide(),typeof t=="function"&&t.call(this),this},hide:function(e){return e=arguments[arguments.length-1],this.toggleView(!1,e),this},_hide:function(){this.setStyle("display","none")}}),e.NodeList.importMethod(e.Node.prototype,["show","hide","toggleView"]),e.config.doc.documentElement.hasAttribute||(e.Node.prototype.hasAttribute=function(e){return e==="value"&&this.get("value")!==""?!0:!!this._node.attributes[e]&&!!this._node.attributes[e].specified}),e.Node.prototype.focus=function(){try{this._node.focus()}catch(e){}return this},e.Node.ATTRS.type={setter:function(e){if(e==="hidden")try{this._node.type="hidden"}catch(t){this.setStyle("display","none"),this._inputType="hidden"}else try{this._node.type=e}catch(t){}return e},getter:function(){return this._inputType||this._node.type},_bypassProxy:!0},e.config.doc.createElement("form").elements.nodeType&&(e.Node.ATTRS.elements={getter:function(){return this.all("input, textarea, button, select")}}),e.mix(e.Node.prototype,{_initData:function(){"_data"in this||(this._data={})},getData:function(t){this._initData();var n=this._data,r=n;return arguments.length?t in n?r=n[t]:r=this._getDataAttribute(t):typeof n=="object"&&n!==null&&(r={},e.Object.each(n,function(e,t){r[t]=e}),r=this._getDataAttributes(r)),r},_getDataAttributes:function(e){e=e||{};var t=0,n=this._node.attributes,r=n.length,i=this.DATA_PREFIX,s=i.length,o;while(t<r)o=n[t].name,o.indexOf(i)===0&&(o=o.substr(s),o in e||(e[o]=this._getDataAttribute(o))),t+=1;return e},_getDataAttribute:function(e){var e=this.DATA_PREFIX+e,t=this._node,n=t.attributes,r=n&&n[e]&&n[e].value;return r},setData:function(e,t){return this._initData(),arguments.length>1?this._data[e]=t:this._data=e,this},clearData:function(e){return"_data"in this&&(typeof e!="undefined"?delete this._data[e]:delete this._data),this}}),e.mix(e.NodeList.prototype,{getData:function(e){var t=arguments.length?[e]:[];return this._invoke("getData",t,!0)},setData:function(e,t){var n=arguments.length>1?[e,t]:[e];return this._invoke("setData",n)},clearData:function(e){var t=arguments.length?[e]:[];return this._invoke("clearData",[e])}})},"3.7.2",{requires:["event-base","node-core","dom-base"]}),function(){var e=YUI.Env;e._ready||(e._ready=function(){e.DOMReady=!0,e.remove(YUI.config.doc,"DOMContentLoaded",e._ready)},e.add(YUI.config.doc,"DOMContentLoaded",e._ready))}(),YUI.add("event-base",function(e,t){e.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?e.fire("domready"):e.Do.before(function(){e.fire("domready")},YUI.Env,"_ready");var n=e.UA,r={},i={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},s=function(t){if(!t)return t;try{t&&3==t.nodeType&&(t=t.parentNode)}catch(n){return null}return e.one(t)},o=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||r,this.init()};e.extend(o,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,r=e.pageX,o=e.pageY,u,a=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=r,this.pageY=o,u=e.keyCode||e.charCode,n.webkit&&u in i&&(u=i[u]),this.keyCode=u,this.charCode=u,this.which=e.which||e.charCode||u,this.button=this.which,this.target=s(e.target),this.currentTarget=s(a),this.relatedTarget=s(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll")this.wheelDelta=e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1);this._touch&&this._touch(e,a,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),t.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),o.resolve=s,e.DOM2EventFacade=o,e.DOMEventFacade=o,function(){e.Env.evt.dom_wrappers={},e.Env.evt.dom_map={};var t=e.Env.evt,n=e.config,r=n.win,i=YUI.Env.add,s=YUI.Env.remove,o=function(){YUI.Env.windowLoaded=!0,e.Event._load(),s(r,"load",o)},u=function(){e.Event._unload()},a="domready",f="~yui|2|compat~",l=function(t){try{return t&&typeof t!="string"&&e.Lang.isNumber(t.length)&&!t.tagName&&!t.alert}catch(n){return!1}},c=e.CustomEvent.prototype._delete,h=function(t){var n=c.apply(this,arguments);return this.hasSubs()||e.Event._clean(this),n},p=function(){var n=!1,o=0,c=[],d=t.dom_wrappers,v=null,m=t.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){p._interval||(p._interval=setInterval(p._poll,p.POLL_INTERVAL))},onAvailable:function(t,n,r,i,s,u){var a=e.Array(t),f,l;for(f=0;f<a.length;f+=1)c.push({id:a[f],fn:n,obj:r,override:i,checkReady:s,compat:u});return o=this.POLL_RETRYS,setTimeout(p._poll,0),l=new e.EventHandle({_delete:function(){if(l.handle){l.handle.detach();return}var e,t;for(e=0;e<a.length;e++)for(t=0;t<c.length;t++)a[e]===c[t].id&&c.splice(t,1)}}),l},onContentReady:function(e,t,n,r,i){return p.onAvailable(e,t,n,r,!0,i)},attach:function(t,n,r,i){return p._attach(e.Array(arguments,0,!0))},_createWrapper:function(t,n,s,o,u){var a,f=e.stamp(t),l="event:"+f+n;return!1===u&&(l+="native"),s&&(l+="capture"),a=d[l],a||(a=e.publish(l,{silent:!0,bubbles:!1,contextFn:function(){return o?a.el:(a.nodeRef=a.nodeRef||e.one(a.el),a.nodeRef)}}),a.overrides={},a.el=t,a.key=l,a.domkey=f,a.type=n,a.fn=function(e){a.fire(p.getEvent(e,t,o||!1===u))},a.capture=s,t==r&&n=="load"&&(a.fireOnce=!0,v=l),a._delete=h,d[l]=a,m[f]=m[f]||{},m[f][l]=a,i(t,n,a.fn,s)),a},_attach:function(t,n){var i,s,o,u,a,c=!1,h,d=t[0],v=t[1],m=t[2]||r,g=n&&n.facade,y=n&&n.capture,b=n&&n.overrides;t[t.length-1]===f&&(i=!0);if(!v||!v.call)return!1;if(l(m))return s=[],e.each(m,function(e,r){t[2]=e,s.push(p._attach(t.slice(),n))}),new e.EventHandle(s);if(e.Lang.isString(m)){if(i)o=e.DOM.byId(m);else{o=e.Selector.query(m);switch(o.length){case 0:o=null;break;case 1:o=o[0];break;default:return t[2]=o,p._attach(t,n)}}if(!o)return h=p.onAvailable(m,function(){h.handle=p._attach(t,n)},p,!0,!1,i),h;m=o}return m?(e.Node&&e.instanceOf(m,e.Node)&&(m=e.Node.getDOMNode(m)),u=p._createWrapper(m,d,y,i,g),b&&e.mix(u.overrides,b),m==r&&d=="load"&&YUI.Env.windowLoaded&&(c=!0),i&&t.pop(),a=t[3],h=u._on(v,a,t.length>4?t.slice(4):null),c&&u.fire(),h):!1},detach:function(t,n,r,i){var s=e.Array(arguments,0,!0),o,u,a,c,h,v;s[s.length-1]===f&&(o=!0);if(t&&t.detach)return t.detach();typeof r=="string"&&(o?r=e.DOM.byId(r):(r=e.Selector.query(r),u=r.length,u<1?r=null:u==1&&(r=r[0])));if(!r)return!1;if(r.detach)return s.splice(2,1),r.detach.apply(r,s);if(l(r)){a=!0;for(c=0,u=r.length;c<u;++c)s[2]=r[c],a=e.Event.detach.apply(e.Event,s)&&a;return a}return!t||!n||!n.call?p.purgeElement(r,!1,t):(h="event:"+e.stamp(r)+t,v=d[h],v?v.detach(n):!1)},getEvent:function(t,n,i){var s=t||r.event;return i?s:new e.DOMEventFacade(s,n,d["event:"+e.stamp(n)+t.type])},generateId:function(t){return e.DOM.generateID(t)},_isValidCollection:l,_load:function(t){n||(n=!0,e.fire&&e.fire(a),p._poll())},_poll:function(){if(p.locked)return;if(e.UA.ie&&!YUI.Env.DOMReady){p.startInterval();return}p.locked=!0;var t,r,i,s,u,a,f=!n;f||(f=o>0),u=[],a=function(t,n){var r,i=n.override;try{n.compat?(n.override?i===!0?r=n.obj:r=i:r=t,n.fn.call(r,n.obj)):(r=n.obj||e.one(t),n.fn.apply(r,e.Lang.isArray(i)?i:[]))}catch(s){}};for(t=0,r=c.length;t<r;++t)i=c[t],i&&!i.checkReady&&(s=i.compat?e.DOM.byId(i.id):e.Selector.query(i.id,null,!0),s?(a(s,i),c[t]=null):u.push(i));for(t=0,r=c.length;t<r;++t){i=c[t];if(i&&i.checkReady){s=i.compat?e.DOM.byId(i.id):e.Selector.query(i.id,null,!0);if(s){if(n||s.get&&s.get("nextSibling")||s.nextSibling)a(s,i),c[t]=null}else u.push(i)}}o=u.length===0?0:o-1,f?p.startInterval():(clearInterval(p._interval),p._interval=null),p.locked=!1;return},purgeElement:function(t,n,r){var i=e.Lang.isString(t)?e.Selector.query(t,null,!0):t,s=p.getListeners(i,r),o,u,a,f;if(n&&i){s=s||[],a=e.Selector.query("*",i),o=0,u=a.length;for(;o<u;++o)f=p.getListeners(a[o],r),f&&(s=s.concat(f))}if(s)for(o=0,u=s.length;o<u;++o)s[o].detachAll()},_clean:function(t){var n=t.key,r=t.domkey;s(t.el,t.type,t.fn,t.capture),delete d[n],delete e._yuievt.events[n],m[r]&&(delete m[r][n],e.Object.size(m[r])||delete m[r])},getListeners:function(n,r){var i=e.stamp(n,!0),s=m[i],o=[],u=r?"event:"+i+r:null,a=t.plugins;return s?(u?(a[r]&&a[r].eventDef&&(u+="_synth"),s[u]&&o.push(s[u]),u+="native",s[u]&&o.push(s[u])):e.each(s,function(e,t){o.push(e)}),o.length?o:null):null},_unload:function(t){e.each(d,function(e,n){e.type=="unload"&&e.fire(t),e.detachAll()}),s(r,"unload",u)},nativeAdd:i,nativeRemove:s}}();e.Event=p,n.injected||YUI.Env.windowLoaded?o():i(r,"load",o),e.UA.ie&&e.on(a,p._poll);try{i(r,"unload",u)}catch(d){}p.Custom=e.CustomEvent,p.Subscriber=e.Subscriber,p.Target=e.EventTarget,p.Handle=e.EventHandle,p.Facade=e.EventFacade,p._poll()}(),e.Env.evt.plugins.available={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onAvailable.call(e.Event,r,n,i,s)}},e.Env.evt.plugins.contentready={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onContentReady.call(e.Event,r,n,i,s)}}},"3.7.2",{requires:["event-custom-base"]}),YUI.add("pluginhost-base",function(e,t){function r(){this._plugins={}}var n=e.Lang;r.prototype={plug:function(e,t){var r,i,s;if(n.isArray(e))for(r=0,i=e.length;r<i;r++)this.plug(e[r]);else e&&!n.isFunction(e)&&(t=e.cfg,e=e.fn),e&&e.NS&&(s=e.NS,t=t||{},t.host=this,this.hasPlugin(s)?this[s].setAttrs&&this[s].setAttrs(t):(this[s]=new e(t),this._plugins[s]=e));return this},unplug:function(e){var t=e,r=this._plugins;if(e)n.isFunction(e)&&(t=e.NS,t&&(!r[t]||r[t]!==e)&&(t=null)),t&&(this[t]&&(this[t].destroy&&this[t].destroy(),delete this[t]),r[t]&&delete r[t]);else for(t in this._plugins)this._plugins.hasOwnProperty(t)&&this.unplug(t);return this},hasPlugin:function(e){return this._plugins[e]&&this[e]},_initPlugins:function(e){this._plugins=this._plugins||{},this._initConfigPlugins&&this._initConfigPlugins(e)},_destroyPlugins:function(){this.unplug()}},e.namespace("Plugin").Host=r},"3.7.2",{requires:["yui-base"]}),YUI.add("pluginhost-config",function(e,t){var n=e.Plugin.Host,r=e.Lang;n.prototype._initConfigPlugins=function(t){var n=this._getClasses?this._getClasses():[this.constructor],r=[],i={},s,o,u,a,f;for(o=n.length-1;o>=0;o--)s=n[o],a=s._UNPLUG,a&&e.mix(i,a,!0),u=s._PLUG,u&&e.mix(r,u,!0);for(f in r)r.hasOwnProperty(f)&&(i[f]||this.plug(r[f]));t&&t.plugins&&this.plug(t.plugins)},n.plug=function(t,n,i){var s,o,u,a;if(t!==e.Base){t._PLUG=t._PLUG||{},r.isArray(n)||(i&&(n={fn:n,cfg:i}),n=[n]);for(o=0,u=n.length;o<u;o++)s=n[o],a=s.NAME||s.fn.NAME,t._PLUG[a]=s}},n.unplug=function(t,n){var i,s,o,u;if(t!==e.Base){t._UNPLUG=t._UNPLUG||{},r.isArray(n)||(n=[n]);for(s=0,o=n.length;s<o;s++)i=n[s],u=i.NAME,t._PLUG[u]?delete t._PLUG[u]:t._UNPLUG[u]=i}}},"3.7.2",{requires:["pluginhost-base"]}),YUI.add("event-delegate",function(e,t){function f(t,r,u,l){var c=n(arguments,0,!0),h=i(u)?u:null,p,d,v,m,g,y,b,w,E;if(s(t)){w=[];if(o(t))for(y=0,b=t.length;y<b;++y)c[0]=t[y],w.push(e.delegate.apply(e,c));else{c.unshift(null);for(y in t)t.hasOwnProperty(y)&&(c[0]=y,c[1]=t[y],w.push(e.delegate.apply(e,c)))}return new e.EventHandle(w)}p=t.split(/\|/),p.length>1&&(g=p.shift(),c[0]=t=p.shift()),d=e.Node.DOM_EVENTS[t],s(d)&&d.delegate&&(E=d.delegate.apply(d,arguments));if(!E){if(!t||!r||!u||!l)return;v=h?e.Selector.query(h,null,!0):u,!v&&i(u)&&(E=e.on("available",function(){e.mix(E,e.delegate.apply(e,c),!0)},u)),!E&&v&&(c.splice(2,2,v),E=e.Event._attach(c,{facade:!1}),E.sub.filter=l,E.sub._notify=f.notifySub)}return E&&g&&(m=a[g]||(a[g]={}),m=m[t]||(m[t]=[]),m.push(E)),E}var n=e.Array,r=e.Lang,i=r.isString,s=r.isObject,o=r.isArray,u=e.Selector.test,a=e.Env.evt.handles;f.notifySub=function(t,r,i){r=r.slice(),this.args&&r.push.apply(r,this.args);var s=f._applyFilter(this.filter,r,i),o,u,a,l;if(s){s=n(s),o=r[0]=new e.DOMEventFacade(r[0],i.el,i),o.container=e.one(i.el);for(u=0,a=s.length;u<a&&!o.stopped;++u){o.currentTarget=e.one(s[u]),l=this.fn.apply(this.context||o.currentTarget,r);if(l===!1)break}return l}},f.compileFilter=e.cached(function(e){return function(t,n){return u(t._node,e,n.currentTarget===n.target?null:n.currentTarget._node)}}),f._applyFilter=function(t,n,r){var s=n[0],o=r.el,a=s.target||s.srcElement,f=[],l=!1;a.nodeType===3&&(a=a.parentNode),n.unshift(a);if(i(t))while(a){l=a===o,u(a,t,l?null:o)&&f.push(a);if(l)break;a=a.parentNode}else{n[0]=e.one(a),n[1]=new e.DOMEventFacade(s,o,r);while(a){t.apply(n[0],n)&&f.push(a);if(a===o)break;a=a.parentNode,n[0]=e.one(a)}n[1]=s}return f.length<=1&&(f=f[0]),n.shift(),f},e.delegate=e.Event.delegate=f},"3.7.2",{requires:["node-base"]}),YUI.add("node-event-delegate",function(e,t){e.Node.prototype.delegate=function(t){var n=e.Array(arguments,0,!0),r=e.Lang.isObject(t)&&!e.Lang.isArray(t)?1:2;return n.splice(r,0,this._node),e.delegate.apply(e,n)}},"3.7.2",{requires:["node-base","event-delegate"]}),YUI.add("node-pluginhost",function(e,t){e.Node.plug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.plug.apply(e.Base,t),e.Node},e.Node.unplug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.unplug.apply(e.Base,t),e.Node},e.mix(e.Node,e.Plugin.Host,!1,null,1),e.NodeList.prototype.plug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.plug.apply(e.one(n),t)}),this},e.NodeList.prototype.unplug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.unplug.apply(e.one(n),t)}),this}},"3.7.2",{requires:["node-base","pluginhost"]}),YUI.add("node-screen",function(e,t){e.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(t){e.Node.ATTRS[t]={getter:function(){var n=Array.prototype.slice.call(arguments);return n.unshift(e.Node.getDOMNode(this)),e.DOM[t].apply(this,n)}}}),e.Node.ATTRS.scrollLeft={getter:function(){var t=e.Node.getDOMNode(this);return"scrollLeft"in t?t.scrollLeft:e.DOM.docScrollX(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollLeft"in n?n.scrollLeft=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(t,e.DOM.docScrollY(n)))}},e.Node.ATTRS.scrollTop={getter:function(){var t=e.Node.getDOMNode(this);return"scrollTop"in t?t.scrollTop:e.DOM.docScrollY(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollTop"in n?n.scrollTop=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(e.DOM.docScrollX(n),t))}},e.Node.importMethod(e.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),e.Node.ATTRS.region={getter:function(){var t=this.getDOMNode(),n;return t&&!t.tagName&&t.nodeType===9&&(t=t.documentElement),e.DOM.isWindow(t)?n=e.DOM.viewportRegion(t):n=e.DOM.region(t),n}},e.Node.ATTRS.viewportRegion={getter:function(){return e.DOM.viewportRegion(e.Node.getDOMNode(this))}},e.Node.importMethod(e.DOM,"inViewportRegion"),e.Node.prototype.intersect=function(t,n){var r=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.intersect(r,t,n)},e.Node.prototype.inRegion=function(t,n,r){var i=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.inRegion(i,t,n,r)}},"3.7.2",{requires:["dom-screen","node-base"]}),YUI.add("node-style",function(e,t){(function(e){e.mix(e.Node.prototype,{setStyle:function(t,n){return e.DOM.setStyle(this._node,t,n),this},setStyles:function(t){return e.DOM.setStyles(this._node,t),this},getStyle:function(t){return e.DOM.getStyle(this._node,t)},getComputedStyle:function(t){return e.DOM.getComputedStyle(this._node,t)}}),e.NodeList.importMethod(e.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"])})(e)},"3.7.2",{requires:["dom-style","node-base"]}),YUI.add("querystring-stringify-simple",function(e,t){var n=e.namespace("QueryString"),r=encodeURIComponent;n.stringify=function(t,n){var i=[],s=n&&n.arrayKey?!0:!1,o,u,a;for(o in t)if(t.hasOwnProperty(o))if(e.Lang.isArray(t[o]))for(u=0,a=t[o].length;u<a;u++)i.push(r(s?o+"[]":o)+"="+r(t[o][u]));else i.push(r(o)+"="+r(t[o]));return i.join("&")}},"3.7.2",{requires:["yui-base"]}),YUI.add("io-base",function(e,t){function o(t){var n=this;n._uid="io:"+s++,n._init(t),e.io._map[n._uid]=n}var n=["start","complete","end","success","failure","progress"],r=["status","statusText","responseText","responseXML"],i=e.config.win,s=0;o.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(t){var r=this,i,s;r.cfg=t||{},e.augment(r,e.EventTarget);for(i=0,s=n.length;i<s;++i)r.publish("io:"+n[i],e.merge({broadcast:1},t)),r.publish("io-trn:"+n[i],t)},_create:function(t,n){var r=this,s={id:e.Lang.isNumber(n)?n:r._id++,uid:r._uid},o=t.xdr?t.xdr.use:null,u=t.form&&t.form.upload?"iframe":null,a;return o==="native"&&(o=e.UA.ie?"xdr":null,r.setHeader("X-Requested-With")),a=o||u,s=a?e.merge(e.IO.customTransport(a),s):e.merge(e.IO.defaultTransport(),s),s.notify&&(t.notify=function(e,t,n){r.notify(e,t,n)}),a||i&&i.FormData&&t.data instanceof i.FormData&&(s.c.upload.onprogress=function(e){r.progress(s,e,t)},s.c.onload=function(e){r.load(s,e,t)},s.c.onerror=function(e){r.error(s,e,t)},s.upload=!0),s},_destroy:function(t){i&&!t.notify&&!t.xdr&&(u&&!t.upload?t.c.onreadystatechange=null:t.upload?(t.c.upload.onprogress=null,t.c.onload=null,t.c.onerror=null):e.UA.ie&&!t.e&&t.c.abort()),t=t.c=null},_evt:function(t,r,i){var s=this,o,u=i.arguments,a=s.cfg.emitFacade,f="io:"+t,l="io-trn:"+t;this.detach(l),r.e&&(r.c={status:0,statusText:r.e}),o=[a?{id:r.id,data:r.c,cfg:i,arguments:u}:r.id],a||(t===n[0]||t===n[2]?u&&o.push(u):(r.evt?o.push(r.evt):o.push(r.c),u&&o.push(u))),o.unshift(f),s.fire.apply(s,o),i.on&&(o[0]=l,s.once(l,i.on[t],i.context||e),s.fire.apply(s,o))},start:function(e,t){this._evt(n[0],e,t)},complete:function(e,t){this._evt(n[1],e,t)},end:function(e,t){this._evt(n[2],e,t),this._destroy(e)},success:function(e,t){this._evt(n[3],e,t),this.end(e,t)},failure:function(e,t){this._evt(n[4],e,t),this.end(e,t)},progress:function(e,t,r){e.evt=t,this._evt(n[5],e,r)},load:function(e,t,r){e.evt=t.target,this._evt(n[1],e,r)},error:function(e,t,r){e.evt=t,this._evt(n[4],e,r)},_retry:function(e,t,n){return this._destroy(e),n.xdr.use="flash",this.send(t,n,e.id)},_concat:function(e,t){return e+=(e.indexOf("?")===-1?"?":"&")+t,e},setHeader:function(e,t){t?this._headers[e]=t:delete this._headers[e]},_setHeaders:function(t,n){n=e.merge(this._headers,n),e.Object.each(n,function(e,r){e!=="disable"&&t.setRequestHeader(r,n[r])})},_startTimeout:function(e,t){var n=this;n._timeout[e.id]=setTimeout(function(){n._abort(e,"timeout")},t)},_clearTimeout:function(e){clearTimeout(this._timeout[e]),delete this._timeout[e]},_result:function(e,t){var n;try{n=e.c.status}catch(r){n=0}n>=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,l,c=this,h=t,p={};n=n?e.Object(n):{},s=c._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,l=n.data,e.Lang.isObject(l)&&!l.nodeType&&!s.upload&&(l=e.QueryString.stringify(l));if(n.form){if(n.form.upload)return c.upload(s,t,n);l=c._serialize(n.form,l)}if(l)switch(o){case"GET":case"HEAD":case"DELETE":h=c._concat(h,l),l="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return c.xdr(h,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){c._rS(s,n)});try{s.c.open(o,h,!f,n.username||null,n.password||null),c._setHeaders(s.c,n.headers||{}),c.start(s,n),n.xdr&&n.xdr.credentials&&(e.UA.ie||(s.c.withCredentials=!0)),s.c.send(l);if(f){for(u=0,a=r.length;u<a;++u)p[r[u]]=s.c[r[u]];return p.getAllResponseHeaders=function(){return s.c.getAllResponseHeaders()},p.getResponseHeader=function(e){return s.c.getResponseHeader(e)},c.complete(s,n),c._result(s,n),p}}catch(d){if(s.xdr)return c._retry(s,t,n);c.complete(s,n),c._result(s,n)}return n.timeout&&c._startTimeout(s,n.timeout),{id:s.id,abort:function(){return s.c?c._abort(s,"abort"):!1},isInProgress:function(){return s.c?s.c.readyState%4:!1},io:c}}},e.io=function(t,n){var r=e.io._map["io:0"]||new o;return r.send.apply(r,[t,n])},e.io.header=function(t,n){var r=e.io._map["io:0"]||new o;r.setHeader(t,n)},e.IO=o,e.io._map={};var u=i&&i.XMLHttpRequest,a=i&&i.XDomainRequest,f=i&&i.ActiveXObject;e.mix(e.IO,{_default:"xhr",defaultTransport:function(t){if(!t){var n={c:e.IO.transports[e.IO._default](),notify:e.IO._default==="xhr"?!1:!0};return n}e.IO._default=t},transports:{xhr:function(){return u?new XMLHttpRequest:f?new ActiveXObject("Microsoft.XMLHTTP"):null},xdr:function(){return a?new XDomainRequest:null},iframe:function(){return{}},flash:null,nodejs:null},customTransport:function(t){var n={c:e.IO.transports[t]()};return n[t==="xdr"||t==="flash"?"xdr":"notify"]=!0,n}}),e.mix(e.IO.prototype,{notify:function(e,t,n){var r=this;switch(e){case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e},e="failure";default:r[e].apply(r,[t,n])}}})},"3.7.2",{requires:["event-custom-base","querystring-stringify-simple"]}),YUI.add("json-parse",function(Y,NAME){function fromGlobal(e){return(Y.config.win||this||{})[e]}function workingNative(e,t){return e==="ok"?!0:t}var _JSON=fromGlobal("JSON"),Native=Object.prototype.toString.call(_JSON)==="[object JSON]"&&_JSON,useNative=!!Native,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_escapeException=function(e){return"\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4)},_revive=function(e,t){var n=function(e,r){var i,s,o=e[r];if(o&&typeof o=="object")for(i in o)o.hasOwnProperty(i)&&(s=n(o,i),s===undefined?delete o[i]:o[i]=s);return t.call(e,r,o)};return typeof t=="function"?n({"":e},""):e},_parse=function(s,reviver){s=s.replace(_UNICODE_EXCEPTIONS,_escapeException);if(!_UNSAFE.test(s.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,"")))return _revive(eval("("+s+")"),reviver);throw new SyntaxError("JSON.parse")};Y.namespace("JSON").parse=function(e,t){return typeof e!="string"&&(e+=""),Native&&Y.JSON.useNativeParse?Native.parse(e,t):_parse(e,t)};if(Native)try{useNative=Native.parse('{"ok":false}',workingNative).ok}catch(e){useNative=!1}Y.JSON.useNativeParse=useNative},"3.7.2",{requires:["yui-base"]}),YUI.add("transition",function(e,t){var n="",r="",i=e.config.doc,s="documentElement",o="transition",u="Transition",a,f,l,c,h,p,d,v,m={},g=["Webkit","Moz"],y={Webkit:"webkitTransitionEnd"},b=function(){this.init.apply(this,arguments)};b._toCamel=function(e){return e=e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()}),e},b._toHyphen=function(e){return e=e.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(e,t,n,r){var i=(t?"-"+t.toLowerCase():"")+n;return r&&(i+="-"+r.toLowerCase()),i}),e},b.SHOW_TRANSITION="fadeIn",b.HIDE_TRANSITION="fadeOut",b.useNative=!1,e.Array.each(g,function(e){var t=e+u;t in i[s].style&&(n=e,r=b._toHyphen(e)+"-",b.useNative=!0,b.supported=!0,b._VENDOR_PREFIX=e)}),u=n+u,a=n+"TransitionProperty",f=r+"transition-property",l=r+"transition-duration",c=r+"transition-timing-function",h=r+"transition-delay",p="transitionend",d="on"+n.toLowerCase()+"transitionend",p=y[n]||p,v=n+"Transform",b.fx={},b.toggles={},b._hasEnd={},b._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i,e.Node.DOM_EVENTS[p]=1,b.NAME="transition",b.DEFAULT_EASING="ease",b.DEFAULT_DURATION=.5,b.DEFAULT_DELAY=0,b._nodeAttrs={},b.prototype={constructor:b,init:function(e,t){var n=this;return n._node=e,!n._running&&t&&(n._config=t,e._transition=n,n._duration="duration"in t?t.duration:n.constructor.DEFAULT_DURATION,n._delay="delay"in t?t.delay:n.constructor.DEFAULT_DELAY,n._easing=t.easing||n.constructor.DEFAULT_EASING,n._count=0,n._running=!1),n},addProperty:function(t,n){var r=this,i=this._node,s=e.stamp(i),o=e.one(i),u=b._nodeAttrs[s],a,f,l,c,h;u||(u=b._nodeAttrs[s]={}),c=u[t],n&&n.value!==undefined?h=n.value:n!==undefined&&(h=n,n=m),typeof h=="function"&&(h=h.call(o,o)),c&&c.transition&&c.transition!==r&&c.transition._count--,r._count++,l=(typeof n.duration!="undefined"?n.duration:r._duration)||1e-4,u[t]={value:h,duration:l,delay:typeof n.delay!="undefined"?n.delay:r._delay,easing:n.easing||r._easing,transition:r},a=e.DOM.getComputedStyle(i,t),f=typeof h=="string"?a:parseFloat(a),b.useNative&&f===h&&setTimeout(function(){r._onNativeEnd.call(i,{propertyName:t,elapsedTime:l})},l*1e3)},removeProperty:function(t){var n=this,r=b._nodeAttrs[e.stamp(n._node)];r&&r[t]&&(delete r[t],n._count--)},initAttrs:function(t){var n,r=this._node;t.transform&&!t[v]&&(t[v]=t.transform,delete t.transform);for(n in t)t.hasOwnProperty(n)&&!b._reKeywords.test(n)&&(this.addProperty(n,t[n]),r.style[n]===""&&e.DOM.setStyle(r,n,e.DOM.getComputedStyle(r,n)))},run:function(t){var n=this,r=n._node,i=n._config,s={type:"transition:start",config:i};return n._running||(n._running=!0,i.on&&i.on.start&&i.on.start.call(e.one(r),s),n.initAttrs(n._config),n._callback=t,n._start()),n},_start:function(){this._runNative()},_prepDur:function(e){return e=parseFloat(e),e+"s"},_runNative:function(t){var n=this,r=n._node,i=e.stamp(r),s=r.style,o=r.ownerDocument.defaultView.getComputedStyle(r),u=b._nodeAttrs[i],a="",d=o[b._toCamel(f)],v=f+": ",m=l+": ",g=c+": ",y=h+": ",w,E,S;d!=="all"&&(v+=d+",",m+=o[b._toCamel(l)]+",",g+=o[b._toCamel(c)]+",",y+=o[b._toCamel(h)]+",");for(S in u)w=b._toHyphen(S),E=u[S],(E=u[S])&&E.transition===n&&(S in r.style?(m+=n._prepDur(E.duration)+",",y+=n._prepDur(E.delay)+",",g+=E.easing+",",v+=w+",",a+=w+": "+E.value+"; "):this.removeProperty(S));v=v.replace(/,$/,";"),m=m.replace(/,$/,";"),g=g.replace(/,$/,";"),y=y.replace(/,$/,";"),b._hasEnd[i]||(r.addEventListener(p,n._onNativeEnd,""),b._hasEnd[i]=!0),s.cssText+=v+m+g+y+a},_end:function(t){var n=this,r=n._node,i=n._callback,s=n._config,o={type:"transition:end",config:s,elapsedTime:t},u=e.one(r);n._running=!1,n._callback=null,r&&(s.on&&s.on.end?setTimeout(function(){s.on.end.call(u,o),i&&i.call(u,o)},1):i&&setTimeout(function(){i.call(u,o)},1))},_endNative:function(e){var t=this._node,n=t.ownerDocument.defaultView.getComputedStyle(t,"")[b._toCamel(f)];e=b._toHyphen(e),typeof n=="string"&&(n=n.replace(new RegExp("(?:^|,\\s)"+e+",?"),","),n=n.replace(/^,|,$/,""),t.style[u]=n)},_onNativeEnd:function(t){var n=this,r=e.stamp(n),i=t,s=b._toCamel(i.propertyName),o=i.elapsedTime,u=b._nodeAttrs[r],f=u[s],l=f?f.transition:null,c,h;l&&(l.removeProperty(s),l._endNative(s),h=l._config[s],c={type:"propertyEnd",propertyName:s,elapsedTime:o,config:h},h&&h.on&&h.on.end&&h.on.end.call(e.one(n),c),l._count<=0&&(l._end(o),n.style[a]=""))},destroy:function(){var e=this,t=e._node;t&&(t.removeEventListener(p,e._onNativeEnd,!1),e._node=null)}},e.Transition=b,e.TransitionNative=b,e.Node.prototype.transition=function(t,n,r){var i=b._nodeAttrs[e.stamp(this._node)],s=i?i.transition||null:null,o,u;if(typeof t=="string"){typeof n=="function"&&(r=n,n=null),o=b.fx[t];if(n&&typeof n!="boolean"){n=e.clone(n);for(u in o)o.hasOwnProperty(u)&&(u in n||(n[u]=o[u]))}else n=o}else r=n,n=t;return s&&!s._running?s.init(this,n):s=new b(this._node,n),s.run(r),this},e.Node.prototype.show=function(t,n,r){return this._show(),t&&e.Transition&&(typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.SHOW_TRANSITION),this.transition(t,n,r)),this};var w=function(e,t,n){return function(){t&&t.call(e),n&&n.apply(e._node,arguments)}};e.Node.prototype.hide=function(t,n,r){return t&&e.Transition?(typeof n=="function"&&(r=n,n=null),r=w(this,this._hide,r),typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.HIDE_TRANSITION),this.transition(t,n,r)):this._hide(),this},e.NodeList.prototype.transition=function(t,n){var r=this._nodes,i=0,s;while(s=r[i++])e.one(s).transition(t,n);return this},e.Node.prototype.toggleView=function(t,n,r){return this._toggles=this._toggles||[],r=arguments[arguments.length-1],typeof t=="boolean"&&(n=t,t=null),t=t||e.Transition.DEFAULT_TOGGLE,typeof n=="undefined"&&t in this._toggles&&(n=!this._toggles[t]),n=n?1:0,n?this._show():r=w(this,this._hide,r),this._toggles[t]=n,this.transition(e.Transition.toggles[t][n],r),this},e.NodeList.prototype.toggleView=function(t,n,r){var i=this._nodes,s=0,o;while(o=i[s++])e.one(o).toggleView(t,n,r);return this},e.mix(b.fx,{fadeOut:{opacity:0,duration:.5,easing:"ease-out"},fadeIn:{opacity:1,duration:.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:.75,easing:"ease-out"},sizeIn:{height:function(e){return e.get("scrollHeight")+"px"},width:function(e){return e.get("scrollWidth")+"px"},duration:.5,easing:"ease-in",on:{start:function(){var e=this.getStyle("overflow");e!=="hidden"&&(this.setStyle("overflow","hidden"),this._transitionOverflow=e)},end:function(){this._transitionOverflow&&(this.setStyle("overflow",this._transitionOverflow),delete this._transitionOverflow)}}}}),e.mix(b.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]}),b.DEFAULT_TOGGLE="fade"},"3.7.2",{requires:["node-style"]}),YUI.add("selector-css2",function(e,t){var n="parentNode",r="tagName",i="attributes",s="combinator",o="pseudos",u=e.Selector,a={_reRegExpTokens:/([\^\$\?\[\]\*\+\-\.\(\)\|\\])/,SORT_RESULTS:!0,_isXML:function(){var t=e.config.doc.createElement("div").tagName!=="DIV";return t}(),shorthand:{"\\#(-?[_a-z0-9]+[-\\w\\uE000]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w\\uE000]*)":"[className~=$1]"},operators:{"":function(t,n){return e.DOM.getAttribute(t,n)!==""},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(t){return e.DOM._children(t[n])[0]===t}},_bruteQuery:function(t,n,r){var i=[],s=[],o=u._tokenize(t),a=o[o.length-1],f=e.DOM._getDoc(n),l,c,h,p;if(a){c=a.id,h=a.className,p=a.tagName||"*";if(n.getElementsByTagName)c&&(n.all||n.nodeType===9||e.DOM.inDoc(n))?s=e.DOM.allById(c,n):h?s=n.getElementsByClassName(h):s=n.getElementsByTagName(p);else{l=n.firstChild;while(l)l.tagName&&(p==="*"||l.tagName===p)&&s.push(l),l=l.nextSibling||l.firstChild}s.length&&(i=u._filterNodes(s,o,r))}return i},_filterNodes:function(t,n,r){var i=0,s,o=n.length,a=o-1,f=[],l=t[0],c=l,h=e.Selector.getters,p,d,v,m,g,y,b,w;for(i=0;c=l=t[i++];){a=o-1,m=null;e:while(c&&c.tagName){v=n[a],b=v.tests,s=b.length;if(s&&!g)while(w=b[--s]){p=w[1],h[w[0]]?y=h[w[0]](c,w[0]):(y=c[w[0]],w[0]==="tagName"&&!u._isXML&&(y=y.toUpperCase()),typeof y!="string"&&y!==undefined&&y.toString?y=y.toString():y===undefined&&c.getAttribute&&(y=c.getAttribute(w[0],2)));if(p==="="&&y!==w[2]||typeof p!="string"&&p.test&&!p.test(y)||!p.test&&typeof p=="function"&&!p(c,w[0],w[2])){if(c=c[m])while(c&&(!c.tagName||v.tagName&&v.tagName!==c.tagName))c=c[m];continue e}}a--;if(!!g||!(d=v.combinator)){f.push(l);if(r)return f;break}m=d.axis,c=c[m];while(c&&!c.tagName)c=c[m];d.direct&&(m=null)}}return l=c=null,f},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:!0},"+":{axis:"previousSibling",direct:!0}},_parsers:[{name:i,re:/^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i,fn:function(t,n){var r=t[2]||"",i=u.operators,s=t[3]?t[3].replace(/\\/g,""):"",o;if(t[1]==="id"&&r==="="||t[1]==="className"&&e.config.doc.documentElement.getElementsByClassName&&(r==="~="||r==="="))n.prefilter=t[1],t[3]=s,n[t[1]]=t[1]==="id"?t[3]:s;r in i&&(o=i[r],typeof o=="string"&&(t[3]=s.replace(u._reRegExpTokens,"\\$1"),o=new RegExp(o.replace("{val}",t[3]))),t[2]=o);if(!n.last||n.prefilter!==t[1])return t.slice(1)}},{name:r,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(e,t){var n=e[1];u._isXML||(n=n.toUpperCase()),t.tagName=n;if(n!=="*"&&(!t.last||t.prefilter))return[r,"=",n];t.prefilter||(t.prefilter="tagName")}},{name:s,re:/^\s*([>+~]|\s)\s*/,fn:function(e,t){}},{name:o,re:/^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i,fn:function(e,t){var n=u[o][e[1]];return n?(e[2]&&(e[2]=e[2].replace(/\\/g,"")),[e[2],n]):!1}}],_getToken:function(e){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]}},_tokenize:function(t){t=t||"",t=u._parseSelector(e.Lang.trim(t));var n=u._getToken(),r=t,i=[],o=!1,a,f,l,c;e:do{o=!1;for(l=0;c=u._parsers[l++];)if(a=c.re.exec(t)){c.name!==s&&(n.selector=t),t=t.replace(a[0],""),t.length||(n.last=!0),u._attrFilters[a[1]]&&(a[1]=u._attrFilters[a[1]]),f=c.fn(a,n);if(f===!1){o=!1;break e}f&&n.tests.push(f);if(!t.length||c.name===s)i.push(n),n=u._getToken(n),c.name===s&&(n.combinator=e.Selector.combinators[a[1]]);o=!0}}while(o&&t.length);if(!o||t.length)i=[];return i},_replaceMarkers:function(e){return e=e.replace(/\[/g,"\ue003"),e=e.replace(/\]/g,"\ue004"),e=e.replace(/\(/g,"\ue005"),e=e.replace(/\)/g,"\ue006"),e},_replaceShorthand:function(t){var n=e.Selector.shorthand,r;for(r in n)n.hasOwnProperty(r)&&(t=t.replace(new RegExp(r,"gi"),n[r]));return t},_parseSelector:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t=e.Selector._replaceShorthand(t),t=e.Selector._restore("attr",t,n.attrs),t=e.Selector._restore("pseudo",t,n.pseudos),t=e.Selector._replaceMarkers(t),t=e.Selector._restore("esc",t,n.esc),t},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(t,n){return e.DOM.getAttribute(t,n)},id:function(t,n){return e.DOM.getId(t)}}};e.mix(e.Selector,a,!0),e.Selector.getters.src=e.Selector.getters.rel=e.Selector.getters.href,e.Selector.useNative&&e.config.doc.querySelector&&(e.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]")},"3.7.2",{requires:["selector-native"]}),YUI.add("selector-css3",function(e,t){e.Selector._reNth=/^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/,e.Selector._getNth=function(t,n,r,i){e.Selector._reNth.test(n);var s=parseInt(RegExp.$1,10),o=RegExp.$2,u=RegExp.$3,a=parseInt(RegExp.$4,10)||0,f=[],l=e.DOM._children(t.parentNode,r),c;u?(s=2,c="+",o="n",a=u==="odd"?1:0):isNaN(s)&&(s=o?1:0);if(s===0)return i&&(a=l.length-a+1),l[a-1]===t?!0:!1;s<0&&(i=!!i,s=Math.abs(s));if(!i){for(var h=a-1,p=l.length;h<p;h+=s)if(h>=0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h<p&&l[h]===t)return!0;return!1},e.mix(e.Selector.pseudos,{root:function(e){return e===e.ownerDocument.documentElement},"nth-child":function(t,n){return e.Selector._getNth(t,n)},"nth-last-child":function(t,n){return e.Selector._getNth(t,n,null,!0)},"nth-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName)},"nth-last-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName,!0)},"last-child":function(t){var n=e.DOM._children(t.parentNode);return n[n.length-1]===t},"first-of-type":function(t){return e.DOM._children(t.parentNode,t.tagName)[0]===t},"last-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n[n.length-1]===t},"only-child":function(t){var n=e.DOM._children(t.parentNode);return n.length===1&&n[0]===t},"only-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n.length===1&&n[0]===t},empty:function(e){return e.childNodes.length===0},not:function(t,n){return!e.Selector.test(t,n)},contains:function(e,t){var n=e.innerText||e.textContent||"";return n.indexOf(t)>-1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"3.7.2",{requires:["selector-native","selector-css2"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.2",{requires:["yui-base"]}),YUI.add("dump",function(e,t){var n=e.Lang,r="{...}",i="f(){...}",s=", ",o=" => ",u=function(e,t){var u,a,f=[],l=n.type(e);if(!n.isObject(e))return e+"";if(l=="date")return e;if(e.nodeType&&e.tagName)return e.tagName+"#"+e.id;if(e.document&&e.navigator)return"window";if(e.location&&e.body)return"document";if(l=="function")return i;t=n.isNumber(t)?t:3;if(l=="array"){f.push("[");for(u=0,a=e.length;u<a;u+=1)n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s);f.length>1&&f.pop(),f.push("]")}else if(l=="regexp")f.push(e.toString());else{f.push("{");for(u in e)if(e.hasOwnProperty(u))try{f.push(u+o),n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s)}catch(c){f.push("Error: "+c.message)}f.length>1&&f.pop(),f.push("}")}return f.join("")};e.dump=u,n.dump=u},"3.7.2",{requires:["yui-base"]}),YUI.add("transition-timer",function(e,t){var n=e.Transition;e.mix(n.prototype,{_start:function(){n.useNative?this._runNative():this._runTimer()},_runTimer:function(){var t=this;t._initAttrs(),n._running[e.stamp(t)]=t,t._startTime=new Date,n._startTimer()},_endTimer:function(){var t=this;delete n._running[e.stamp(t)],t._startTime=null},_runFrame:function(){var e=new Date-this._startTime;this._runAttrs(e)},_runAttrs:function(t){var r=this,i=r._node,s=r._config,o=e.stamp(i),u=n._nodeAttrs[o],a=n.behaviors,f=!1,l=!1,c,h,p,d,v,m,g,y,b;for(h in u)if((p=u[h])&&p.transition===r){g=p.duration,m=p.delay,v=(t-m)/1e3,y=t,c={type:"propertyEnd",propertyName:h,config:s,elapsedTime:v},d=b in a&&"set"in a[b]?a[b].set:n.DEFAULT_SETTER,f=y>=g,y>g&&(y=g);if(!m||t>=m)d(r,h,p.from,p.to,y-m,g-m,p.easing,p.unit),f&&(delete u[h],r._count--,s[h]&&s[h].on&&s[h].on.end&&s[h].on.end.call(e.one(i),c),!l&&r._count<=0&&(l=!0,r._end(v),r._endTimer()))}},_initAttrs:function(){var t=this,r=n.behaviors,i=e.stamp(t._node),s=n._nodeAttrs[i],o,u,a,f,l,c,h,p,d,v,m;for(c in s)(o=s[c])&&o.transition===t&&(u=o.duration*1e3,a=o.delay*1e3,f=o.easing,l=o.value,c in t._node.style||c in e.DOM.CUSTOM_STYLES?(v=c in r&&"get"in r[c]?r[c].get(t,c):n.DEFAULT_GETTER(t,c),p=n.RE_UNITS.exec(v),h=n.RE_UNITS.exec(l),v=p?p[1]:v,m=h?h[1]:l,d=h?h[2]:p?p[2]:"",!d&&n.RE_DEFAULT_UNIT.test(c)&&(d=n.DEFAULT_UNIT),typeof f=="string"&&(f.indexOf("cubic-bezier")>-1?f=f.substring(13,f.length-1).split(","):n.easings[f]&&(f=n.easings[f])),o.from=Number(v),o.to=Number(m),o.unit=d,o.easing=f,o.duration=u+a,o.delay=a):(delete s[c],t._count--))},destroy:function(){this.detachAll(),this._node=null}},!0),e.mix(e.Transition,{_runtimeAttrs:{},RE_DEFAULT_UNIT:/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,DEFAULT_UNIT:"px",intervalTime:20,behaviors:{left:{get:function(t,n){return e.DOM._getAttrOffset(t._node,n)}}},DEFAULT_SETTER:function(t,r,i,s,o,u,a,f){i=Number(i),s=Number(s);var l=t._node,c=n.cubicBezier(a,o/u);c=i+c[0]*(s-i);if(l){if(r in l.style||r in e.DOM.CUSTOM_STYLES)f=f||"",e.DOM.setStyle(l,r,c+f)}else t._end()},DEFAULT_GETTER:function(t,n){var r=t._node,i="";if(n in r.style||n in e.DOM.CUSTOM_STYLES)i=e.DOM.getComputedStyle(r,n);return i},_startTimer:function(){n._timer||(n._timer=setInterval(n._runFrame,n.intervalTime))},_stopTimer:function(){clearInterval(n._timer),n._timer=null},_runFrame:function(){var e=!0,t;for(t in n._running)n._running[t]._runFrame&&(e=!1,n._running[t]._runFrame());e&&n._stopTimer()},cubicBezier:function(e,t){var n=0,r=0,i=e[0],s=e[1],o=e[2],u=e[3],a=1,f=0,l=a-3*o+3*i-n,c=3*o-6*i+3*n,h=3*i-3*n,p=n,d=f-3*u+3*s-r,v=3*u-6*s+3*r,m=3*s-3*r,g=r,y=((l*t+c)*t+h)*t+p,b=((d*t+v)*t+m)*t+g;return[y,b]},easings:{ease:[.25,0,1,.25],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},_running:{},_timer:null,RE_UNITS:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/},!0),n.behaviors.top=n.behaviors.bottom=n.behaviors.right=n.behaviors.left,e.Transition=n},"3.7.2",{requires:["transition"]}),YUI.add("yui",function(e,t){},"3.7.2",{use:["yui","oop","dom","event-custom-base","event-base","pluginhost","node","event-delegate","io-base","json-parse","transition","selector-css3","dom-style-ie","querystring-stringify-simple"]});var Y=YUI().use("*");+typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.3",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&(!e.scrollTo||!e.document)&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++===1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0,winjs:typeof Windows!="undefined"&&!!Windows.System,touchEnabled:!1},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),r&&i&&!(s.chrome&&s.chrome<6)&&(s.touchEnabled="ontouchstart"in r||"msMaxTouchPoints"in i&&i.msMaxTouchPoints>0),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.3",{use:["get","features","intl-base","yui-log","yui-later"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.7.3",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","18",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","19",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.7.3",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.3",{requires:["yui-base"]}),YUI.add("yui",function(e,t){},"3.7.3",{use:["get","features","intl-base","yui-log","yui-later"]}),YUI.add("oop",function(e,t){function a(t,n,i,s,o){if(t&&t[o]&&t!==e)return t[o].call(t,n,i);switch(r.test(t)){case 1:return r[o](t,n,i);case 2:return r[o](e.Array(t,0,!0),n,i);default:return e.Object[o](t,n,i,s)}}var n=e.Lang,r=e.Array,i=Object.prototype,s="_~yuim~_",o=i.hasOwnProperty,u=i.toString;e.augment=function(t,n,r,i,s){var a=t.prototype,f=a&&n,l=n.prototype,c=a||t,h,p,d,v,m;return s=s?e.Array(s):[],f&&(p={},d={},v={},h=function(e,t){if(r||!(t in a))u.call(e)==="[object Function]"?(v[t]=e,p[t]=d[t]=function(){return m(this,e,arguments)}):p[t]=e},m=function(e,t,r){for(var i in v)o.call(v,i)&&e[i]===d[i]&&(e[i]=v[i]);return n.apply(e,s),t.apply(e,r)},i?e.Array.each(i,function(e){e in l&&h(l[e],e)}):e.Object.each(l,h,null,!0)),e.mix(c,p||l,r,i),f||n.apply(c,s),t},e.aggregate=function(t,n,r,i){return e.mix(t,n,r,i,0,!0)},e.extend=function(t,n,r,s){(!n||!t)&&e.error("extend failed, verify dependencies");var o=n.prototype,u=e.Object(o);return t.prototype=u,u.constructor=t,t.superclass=o,n!=Object&&o.constructor==i.constructor&&(o.constructor=n),r&&e.mix(u,r,!0),s&&e.mix(t,s,!0),t},e.each=function(e,t,n,r){return a(e,t,n,r,"each")},e.some=function(e,t,n,r){return a(e,t,n,r,"some")},e.clone=function(t,r,i,o,u,a){if(!n.isObject(t))return t;if(e.instanceOf(t,YUI))return t;var f,l=a||{},c,h=e.each;switch(n.type(t)){case"date":return new Date(t);case"regexp":return t;case"function":return t;case"array":f=[];break;default:if(t[s])return l[t[s]];c=e.guid(),f=r?{}:e.Object(t),t[s]=c,l[c]=t}return!t.addEventListener&&!t.attachEvent&&h(t,function(n,a){(a||a===0)&&(!i||i.call(o||this,n,a,this,t)!==!1)&&a!==s&&a!="prototype"&&(this[a]=e.clone(n,r,i,o,u||t,l))},f),a||(e.Object.each(l,function(e,t){if(e[s])try{delete e[s]}catch(n){e[s]=null}},this),l=null),f},e.bind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?i.concat(e.Array(arguments,0,!0)):arguments;return s.apply(r||s,o)}},e.rbind=function(t,r){var i=arguments.length>2?e.Array(arguments,2,!0):null;return function(){var s=n.isString(t)?r[t]:t,o=i?e.Array(arguments,0,!0).concat(i):arguments;return s.apply(r||s,o)}}},"3.7.3",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","18",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","19",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.7.3",{requires:["yui-base"]}),YUI.add("dom-core",function(e,t){var n="nodeType",r="ownerDocument",i="documentElement",s="defaultView",o="parentWindow",u="tagName",a="parentNode",f="previousSibling",l="nextSibling",c="contains",h="compareDocumentPosition",p=[],d=function(){var t=e.config.doc.createElement("div"),n=t.appendChild(e.config.doc.createTextNode("")),r=!1;try{r=t.contains(n)}catch(i){}return r}(),v={byId:function(e,t){return v.allById(e,t)[0]||null},getId:function(e){var t;return e.id&&!e.id.tagName&&!e.id.item?t=e.id:e.attributes&&e.attributes.id&&(t=e.attributes.id.value),t},setId:function(e,t){e.setAttribute?e.setAttribute("id",t):e.id=t},ancestor:function(e,t,n,r){var i=null;return n&&(i=!t||t(e)?e:null),i||v.elementByAxis(e,a,t,null,r)},ancestors:function(e,t,n,r){var i=e,s=[];while(i=v.ancestor(i,t,n,r)){n=!1;if(i){s.unshift(i);if(r&&r(i))return s}}return s},elementByAxis:function(e,t,n,r,i){while(e&&(e=e[t])){if((r||e[u])&&(!n||n(e)))return e;if(i&&i(e))return null}return null},contains:function(e,t){var r=!1;if(!t||!e||!t[n]||!e[n])r=!1;else if(e[c]&&(t[n]===1||d))r=e[c](t);else if(e[h]){if(e===t||!!(e[h](t)&16))r=!0}else r=v._bruteContains(e,t);return r},inDoc:function(e,t){var n=!1,s;return e&&e.nodeType&&(t||(t=e[r]),s=t[i],s&&s.contains&&e.tagName?n=s.contains(e):n=v.contains(s,e)),n},allById:function(t,n){n=n||e.config.doc;var r=[],i=[],s,o;if(n.querySelectorAll)i=n.querySelectorAll('[id="'+t+'"]');else if(n.all){r=n.all(t);if(r){r.nodeName&&(r.id===t?(i.push(r),r=p):r=[r]);if(r.length)for(s=0;o=r[s++];)(o.id===t||o.attributes&&o.attributes.id&&o.attributes.id.value===t)&&i.push(o)}}else i=[v._getDoc(n).getElementById(t)];return i},isWindow:function(e){return!!(e&&e.scrollTo&&e.document)},_removeChildNodes:function(e){while(e.firstChild)e.removeChild(e.firstChild)},siblings:function(e,t){var n=[],r=e;while(r=r[f])r[u]&&(!t||t(r))&&n.unshift(r);r=e;while(r=r[l])r[u]&&(!t||t(r))&&n.push(r);return n},_bruteContains:function(e,t){while(t){if(e===t)return!0;t=t.parentNode}return!1},_getRegExp:function(e,t){return t=t||"",v._regexCache=v._regexCache||{},v._regexCache[e+t]||(v._regexCache[e+t]=new RegExp(e,t)),v._regexCache[e+t]},_getDoc:function(t){var i=e.config.doc;return t&&(i=t[n]===9?t:t[r]||t.document||e.config.doc),i},_getWin:function(t){var n=v._getDoc(t);return n[s]||n[o]||e.config.win},_batch:function(e,t,n,r,i,s){t=typeof t=="string"?v[t]:t;var o,u=0,a,f;if(t&&e)while(a=e[u++])o=o=t.call(v,a,n,r,i,s),typeof o!="undefined"&&(f||(f=[]),f.push(o));return typeof f!="undefined"?f:e},generateID:function(t){var n=t.id;return n||(n=e.stamp(t),t.id=n),n}};e.DOM=v},"3.7.3",{requires:["oop","features"]}),YUI.add("dom-base",function(e,t){var n=e.config.doc.documentElement,r=e.DOM,i="tagName",s="ownerDocument",o="",u=e.Features.add,a=e.Features.test;e.mix(r,{getText:n.textContent!==undefined?function(e){var t="";return e&&(t=e.textContent),t||""}:function(e){var t="";return e&&(t=e.innerText||e.nodeValue),t||""},setText:n.textContent!==undefined?function(e,t){e&&(e.textContent=t)}:function(e,t){"innerText"in e?e.innerText=t:"nodeValue"in e&&(e.nodeValue=t)},CUSTOM_ATTRIBUTES:n.hasAttribute?{htmlFor:"for",className:"class"}:{"for":"htmlFor","class":"className"},setAttribute:function(e,t,n,i){e&&t&&e.setAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,e.setAttribute(t,n,i))},getAttribute:function(e,t,n){n=n!==undefined?n:2;var i="";return e&&t&&e.getAttribute&&(t=r.CUSTOM_ATTRIBUTES[t]||t,i=e.getAttribute(t,n),i===null&&(i="")),i},VALUE_SETTERS:{},VALUE_GETTERS:{},getValue:function(e){var t="",n;return e&&e[i]&&(n=r.VALUE_GETTERS[e[i].toLowerCase()],n?t=n(e):t=e.value),t===o&&(t=o),typeof t=="string"?t:""},setValue:function(e,t){var n;e&&e[i]&&(n=r.VALUE_SETTERS[e[i].toLowerCase()],n?n(e,t):e.value=t)},creators:{}}),u("value-set","select",{test:function(){var t=e.config.doc.createElement("select");return t.innerHTML="<option>1</option><option>2</option>",t.value="2",t.value&&t.value==="2"}}),a("value-set","select")||(r.VALUE_SETTERS.select=function(e,t){for(var n=0,i=e.getElementsByTagName("option"),s;s=i[n++];)if(r.getValue(s)===t){s.selected=!0;break}}),e.mix(r.VALUE_GETTERS,{button:function(e){return e.attributes&&e.attributes.value?e.attributes.value.value:""}}),e.mix(r.VALUE_SETTERS,{button:function(e,t){var n=e.attributes.value;n||(n=e[s].createAttribute("value"),e.setAttributeNode(n)),n.value=t}}),e.mix(r.VALUE_GETTERS,{option:function(e){var t=e.attributes;return t.value&&t.value.specified?e.value:e.text},select:function(e){var t=e.value,n=e.options;return n&&n.length&&(e.multiple||e.selectedIndex>-1&&(t=r.getValue(n[e.selectedIndex]))),t}});var f,l,c;e.mix(e.DOM,{hasClass:function(t,n){var r=e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)");return r.test(t.className)},addClass:function(t,n){e.DOM.hasClass(t,n)||(t.className=e.Lang.trim([t.className,n].join(" ")))},removeClass:function(t,n){n&&l(t,n)&&(t.className=e.Lang.trim(t.className.replace(e.DOM._getRegExp("(?:^|\\s+)"+n+"(?:\\s+|$)")," ")),l(t,n)&&c(t,n))},replaceClass:function(e,t,n){c(e,t),f(e,n)},toggleClass:function(e,t,n){var r=n!==undefined?n:!l(e,t);r?f(e,t):c(e,t)}}),l=e.DOM.hasClass,c=e.DOM.removeClass,f=e.DOM.addClass;var h=/<([a-z]+)/i,r=e.DOM,u=e.Features.add,a=e.Features.test,p={},d=function(t,n){var r=e.config.doc.createElement("div"),i=!0;r.innerHTML=t;if(!r.firstChild||r.firstChild.tagName!==n.toUpperCase())i=!1;return i},v=/(?:\/(?:thead|tfoot|tbody|caption|col|colgroup)>)+\s*<tbody/,m="<table>",g="</table>";e.mix(e.DOM,{_fragClones:{},_create:function(e,t,n){n=n||"div";var i=r._fragClones[n];return i?i=i.cloneNode(!1):i=r._fragClones[n]=t.createElement(n),i.innerHTML=e,i},_children:function(e,t){var n=0,r=e.children,i,s,o;r&&r.tags&&(t?r=e.children.tags(t):s=r.tags("!").length);if(!r||!r.tags&&t||s){i=r||e.childNodes,r=[];while(o=i[n++])o.nodeType===1&&(!t||t===o.tagName)&&r.push(o)}return r||[]},create:function(t,n){typeof t=="string"&&(t=e.Lang.trim(t)),n=n||e.config.doc;var i=h.exec(t),s=r._create,o=p,u=null,a,f,l;return t!=undefined&&(i&&i[1]&&(a=o[i[1].toLowerCase()],typeof a=="function"?s=a:f=a),l=s(t,n,f).childNodes,l.length===1?u=l[0].parentNode.removeChild(l[0]):l[0]&&l[0].className==="yui3-big-dummy"?l.length===2?u=l[0].nextSibling:(l[0].parentNode.removeChild(l[0]),u=r._nl2frag(l,n)):u=r._nl2frag(l,n)),u},_nl2frag:function(t,n){var r=null,i,s;if(t&&(t.push||t.item)&&t[0]){n=n||t[0].ownerDocument,r=n.createDocumentFragment(),t.item&&(t=e.Array(t,0,!0));for(i=0,s=t.length;i<s;i++)r.appendChild(t[i])}return r},addHTML:function(t,n,i){var s=t.parentNode,o=0,u,a=n,f;if(n!=undefined)if(n.nodeType)f=n;else if(typeof n=="string"||typeof n=="number")a=f=r.create(n);else if(n[0]&&n[0].nodeType){f=e.config.doc.createDocumentFragment();while(u=n[o++])f.appendChild(u)}if(i)if(f&&i.parentNode)i.parentNode.insertBefore(f,i);else switch(i){case"replace":while(t.firstChild)t.removeChild(t.firstChild);f&&t.appendChild(f);break;case"before":f&&s.insertBefore(f,t);break;case"after":f&&(t.nextSibling?s.insertBefore(f,t.nextSibling):s.appendChild(f));break;default:f&&t.appendChild(f)}else f&&t.appendChild(f);return a},wrap:function(t,n){var r=n&&n.nodeType?n:e.DOM.create(n),i=r.getElementsByTagName("*");i.length&&(r=i[i.length-1]),t.parentNode&&t.parentNode.replaceChild(r,t),r.appendChild(t)},unwrap:function(e){var t=e.parentNode,n=t.lastChild,r=e,i;if(t){i=t.parentNode;if(i){e=t.firstChild;while(e!==n)r=e.nextSibling,i.insertBefore(e,t),e=r;i.replaceChild(n,t)}else t.removeChild(e)}}}),u("innerhtml","table",{test:function(){var t=e.config.doc.createElement("table");try{t.innerHTML="<tbody></tbody>"}catch(n){return!1}return t.firstChild&&t.firstChild.nodeName==="TBODY"}}),u("innerhtml-div","tr",{test:function(){return d("<tr></tr>","tr")}}),u("innerhtml-div","script",{test:function(){return d("<script></script>","script")}}),a("innerhtml","table")||(p.tbody=function(t,n){var i=r.create(m+t+g,n),s=e.DOM._children(i,"tbody")[0];return i.children.length>1&&s&&!v.test(t)&&s.parentNode.removeChild(s),i}),a("innerhtml-div","script")||(p.script=function(e,t){var n=t.createElement("div");return n.innerHTML="-"+e,n.removeChild(n.firstChild),n},p.link=p.style=p.script),a("innerhtml-div","tr")||(e.mix(p,{option:function(e,t){return r.create('<select><option class="yui3-big-dummy" selected></option>'+e+"</select>",t)},tr:function(e,t){return r.create("<tbody>"+e+"</tbody>",t)},td:function(e,t){return r.create("<tr>"+e+"</tr>",t)},col:function(e,t){return r.create("<colgroup>"+e+"</colgroup>",t)},tbody:"table"}),e.mix(p,{legend:"fieldset",th:p.td,thead:p.tbody,tfoot:p.tbody,caption:p.tbody,colgroup:p.tbody,optgroup:p.option})),r.creators=p,e.mix(e.DOM,{setWidth:function(t,n){e.DOM._setSize(t,"width",n)},setHeight:function(t,n){e.DOM._setSize(t,"height",n)},_setSize:function(e,t,n){n=n>0?n:0;var r=0;e.style[t]=n+"px",r=t==="height"?e.offsetHeight:e.offsetWidth,r>n&&(n-=r-n,n<0&&(n=0),e.style[t]=n+"px")}})},"3.7.3",{requires:["dom-core"]}),YUI.add("dom-style",function(e,t){(function(e){var t="documentElement",n="defaultView",r="ownerDocument",i="style",s="float",o="cssFloat",u="styleFloat",a="transparent",f="getComputedStyle",l="getBoundingClientRect",c=e.config.win,h=e.config.doc,p=undefined,d=e.DOM,v="transform",m="transformOrigin",g=["WebkitTransform","MozTransform","OTransform","msTransform"],y=/color$/i,b=/width|height|top|left|right|bottom|margin|padding/i;e.Array.each(g,function(e){e in h[t].style&&(v=e,m=e+"Origin")}),e.mix(d,{DEFAULT_UNIT:"px",CUSTOM_STYLES:{},setStyle:function(e,t,n,r){r=r||e.style;var i=d.CUSTOM_STYLES;if(r){n===null||n===""?n="":!isNaN(new Number(n))&&b.test(t)&&(n+=d.DEFAULT_UNIT);if(t in i){if(i[t].set){i[t].set(e,n,r);return}typeof i[t]=="string"&&(t=i[t])}else t===""&&(t="cssText",n="");r[t]=n}},getStyle:function(e,t,n){n=n||e.style;var r=d.CUSTOM_STYLES,i="";if(n){if(t in r){if(r[t].get)return r[t].get(e,t,n);typeof r[t]=="string"&&(t=r[t])}i=n[t],i===""&&(i=d[f](e,t))}return i},setStyles:function(t,n){var r=t.style;e.each(n,function(e,n){d.setStyle(t,n,e,r)},d)},getComputedStyle:function(e,t){var s="",o=e[r],u;return e[i]&&o[n]&&o[n][f]&&(u=o[n][f](e,null),u&&(s=u[t])),s}}),h[t][i][o]!==p?d.CUSTOM_STYLES[s]=o:h[t][i][u]!==p&&(d.CUSTOM_STYLES[s]=u),e.UA.opera&&(d[f]=function(t,i){var s=t[r][n],o=s[f](t,"")[i];return y.test(i)&&(o=e.Color.toRGB(o)),o}),e.UA.webkit&&(d[f]=function(e,t){var i=e[r][n],s=i[f](e,"")[t];return s==="rgba(0, 0, 0, 0)"&&(s=a),s}),e.DOM._getAttrOffset=function(t,n){var r=e.DOM[f](t,n),i=t.offsetParent,s,o,u;return r==="auto"&&(s=e.DOM.getStyle(t,"position"),s==="static"||s==="relative"?r=0:i&&i[l]&&(o=i[l]()[n],u=t[l]()[n],n==="left"||n==="top"?r=u-o:r=o-t[l]()[n])),r},e.DOM._getOffset=function(e){var t,n=null;return e&&(t=d.getStyle(e,"position"),n=[parseInt(d[f](e,"left"),10),parseInt(d[f](e,"top"),10)],isNaN(n[0])&&(n[0]=parseInt(d.getStyle(e,"left"),10),isNaN(n[0])&&(n[0]=t==="relative"?0:e.offsetLeft||0)),isNaN(n[1])&&(n[1]=parseInt(d.getStyle(e,"top"),10),isNaN(n[1])&&(n[1]=t==="relative"?0:e.offsetTop||0))),n},d.CUSTOM_STYLES.transform={set:function(e,t,n){n[v]=t},get:function(e,t){return d[f](e,v)}},d.CUSTOM_STYLES.transformOrigin={set:function(e,t,n){n[m]=t},get:function(e,t){return d[f](e,m)}}})(e),function(e){var t=parseInt,n=RegExp;e.Color={KEYWORDS:{black:"000",silver:"c0c0c0",gray:"808080",white:"fff",maroon:"800000",red:"f00",purple:"800080",fuchsia:"f0f",green:"008000",lime:"0f0",olive:"808000",yellow:"ff0",navy:"000080",blue:"00f",teal:"008080",aqua:"0ff"},re_RGB:/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i,re_hex:/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i,re_hex3:/([0-9A-F])/gi,toRGB:function(r){return e.Color.re_RGB.test(r)||(r=e.Color.toHex(r)),e.Color.re_hex.exec(r)&&(r="rgb("+[t(n.$1,16),t(n.$2,16),t(n.$3,16)].join(", ")+")"),r},toHex:function(t){t=e.Color.KEYWORDS[t]||t;if(e.Color.re_RGB.exec(t)){t=[Number(n.$1).toString(16),Number(n.$2).toString(16),Number(n.$3).toString(16)];for(var r=0;r<t.length;r++)t[r].length<2&&(t[r]="0"+t[r]);t=t.join("")}return t.length<6&&(t=t.replace(e.Color.re_hex3,"$1$1")),t!=="transparent"&&t.indexOf("#")<0&&(t="#"+t),t.toUpperCase()}}}(e)},"3.7.3",{requires:["dom-base"]}),YUI.add("dom-style-ie",function(e,t){(function(e){var t="hasLayout",n="px",r="filter",i="filters",s="opacity",o="auto",u="borderWidth",a="borderTopWidth",f="borderRightWidth",l="borderBottomWidth",c="borderLeftWidth",h="width",p="height",d="transparent",v="visible",m="getComputedStyle",g=undefined,y=e.config.doc.documentElement,b=e.Features.test,w=e.Features.add,E=/^(\d[.\d]*)+(em|ex|px|gd|rem|vw|vh|vm|ch|mm|cm|in|pt|pc|deg|rad|ms|s|hz|khz|%){1}?/i,S=e.UA.ie>=8,x=function(e){return e.currentStyle||e.style},T={CUSTOM_STYLES:{},get:function(t,r){var i="",o;return t&&(o=x(t)[r],r===s&&e.DOM.CUSTOM_STYLES[s]?i=e.DOM.CUSTOM_STYLES[s].get(t):!o||o.indexOf&&o.indexOf(n)>-1?i=o:e.DOM.IE.COMPUTED[r]?i=e.DOM.IE.COMPUTED[r](t,r):E.test(o)?i=T.getPixel(t,r)+n:i=o),i},sizeOffsets:{width:["Left","Right"],height:["Top","Bottom"],top:["Top"],bottom:["Bottom"]},getOffset:function(e,t){var r=x(e)[t],i=t.charAt(0).toUpperCase()+t.substr(1),s="offset"+i,u="pixel"+i,a=T.sizeOffsets[t],f=e.ownerDocument.compatMode,l="";return r===o||r.indexOf("%")>-1?(l=e["offset"+i],f!=="BackCompat"&&(a[0]&&(l-=T.getPixel(e,"padding"+a[0]),l-=T.getBorderWidth(e,"border"+a[0]+"Width",1)),a[1]&&(l-=T.getPixel(e,"padding"+a[1]),l-=T.getBorderWidth(e,"border"+a[1]+"Width",1)))):(!e.style[u]&&!e.style[t]&&(e.style[t]=r),l=e.style[u]),l+n},borderMap:{thin:S?"1px":"2px",medium:S?"3px":"4px",thick:S?"5px":"6px"},getBorderWidth:function(e,t,r){var i=r?"":n,s=e.currentStyle[t];return s.indexOf(n)<0&&(T.borderMap[s]&&e.currentStyle.borderStyle!=="none"?s=T.borderMap[s]:s=0),r?parseFloat(s):s},getPixel:function(e,t){var n=null,r=x(e),i=r.right,s=r[t];return e.style.right=s,n=e.style.pixelRight,e.style.right=i,n},getMargin:function(e,t){var r,i=x(e);return i[t]==o?r=0:r=T.getPixel(e,t),r+n},getVisibility:function(e,t){var n;while((n=e.currentStyle)&&n[t]=="inherit")e=e.parentNode;return n?n[t]:v},getColor:function(t,n){var r=x(t)[n];return(!r||r===d)&&e.DOM.elementByAxis(t,"parentNode",null,function(e){r=x(e)[n];if(r&&r!==d)return t=e,!0}),e.Color.toRGB(r)},getBorderColor:function(t,n){var r=x(t),i=r[n]||r.color;return e.Color.toRGB(e.Color.toHex(i))}},N={};w("style","computedStyle",{test:function(){return"getComputedStyle"in e.config.win}}),w("style","opacity",{test:function(){return"opacity"in y.style}}),w("style","filter",{test:function(){return"filters"in y}}),!b("style","opacity")&&b("style","filter")&&(e.DOM.CUSTOM_STYLES[s]={get:function(e){var t=100;try{t=e[i]["DXImageTransform.Microsoft.Alpha"][s]}catch(n){try{t=e[i]("alpha")[s]}catch(r){}}return t/100},set:function(e,n,i){var o,u=x(e),a=u[r];i=i||e.style,n===""&&(o=s in u?u[s]:1,n=o),typeof a=="string"&&(i[r]=a.replace(/alpha([^)]*\))/gi,"")+(n<1?"alpha("+s+"="+n*100+")":""),i[r]||i.removeAttribute(r),u[t]||(i.zoom=1))}});try{e.config.doc.createElement("div").style.height="-1px"}catch(C){e.DOM.CUSTOM_STYLES.height={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.height=t}},e.DOM.CUSTOM_STYLES.width={set:function(e,t,n){var r=parseFloat(t);if(r>=0||t==="auto"||t==="")n.width=t}}}b("style","computedStyle")||(N[h]=N[p]=T.getOffset,N.color=N.backgroundColor=T.getColor,N[u]=N[a]=N[f]=N[l]=N[c]=T.getBorderWidth,N.marginTop=N.marginRight=N.marginBottom=N.marginLeft=T.getMargin,N.visibility=T.getVisibility,N.borderColor=N.borderTopColor=N.borderRightColor=N.borderBottomColor=N.borderLeftColor=T.getBorderColor,e.DOM[m]=T.get,e.namespace("DOM.IE"),e.DOM.IE.COMPUTED=N,e.DOM.IE.ComputedStyle=T)})(e)},"3.7.3",{requires:["dom-style"]}),YUI.add("dom-screen",function(e,t){(function(e){var t="documentElement",n="compatMode",r="position",i="fixed",s="relative",o="left",u="top",a="BackCompat",f="medium",l="borderLeftWidth",c="borderTopWidth",h="getBoundingClientRect",p="getComputedStyle",d=e.DOM,v=/^t(?:able|d|h)$/i,m;e.UA.ie&&(e.config.doc[n]!=="BackCompat"?m=t:m="body"),e.mix(d,{winHeight:function(e){var t=d._getWinSize(e).height;return t},winWidth:function(e){var t=d._getWinSize(e).width;return t},docHeight:function(e){var t=d._getDocSize(e).height;return Math.max(t,d._getWinSize(e).height)},docWidth:function(e){var t=d._getDocSize(e).width;return Math.max(t,d._getWinSize(e).width)},docScrollX:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageXOffset:0;return Math.max(r[t].scrollLeft,r.body.scrollLeft,s)},docScrollY:function(n,r){r=r||n?d._getDoc(n):e.config.doc;var i=r.defaultView,s=i?i.pageYOffset:0;return Math.max(r[t].scrollTop,r.body.scrollTop,s)},getXY:function(){return e.config.doc[t][h]?function(r){var i=null,s,o,u,f,l,c,p,v,g,y;if(r&&r.tagName){p=r.ownerDocument,u=p[n],u!==a?y=p[t]:y=p.body,y.contains?g=y.contains(r):g=e.DOM.contains(y,r);if(g){v=p.defaultView,v&&"pageXOffset"in v?(s=v.pageXOffset,o=v.pageYOffset):(s=m?p[m].scrollLeft:d.docScrollX(r,p),o=m?p[m].scrollTop:d.docScrollY(r,p)),e.UA.ie&&(!p.documentMode||p.documentMode<8||u===a)&&(l=y.clientLeft,c=y.clientTop),f=r[h](),i=[f.left,f.top];if(l||c)i[0]-=l,i[1]-=c;if(o||s)if(!e.UA.ios||e.UA.ios>=4.2)i[0]+=s,i[1]+=o}else i=d._getOffset(r)}return i}:function(t){var n=null,s,o,u,a,f;if(t)if(d.inDoc(t)){n=[t.offsetLeft,t.offsetTop],s=t.ownerDocument,o=t,u=e.UA.gecko||e.UA.webkit>519?!0:!1;while(o=o.offsetParent)n[0]+=o.offsetLeft,n[1]+=o.offsetTop,u&&(n=d._calcBorders(o,n));if(d.getStyle(t,r)!=i){o=t;while(o=o.parentNode){a=o.scrollTop,f=o.scrollLeft,e.UA.gecko&&d.getStyle(o,"overflow")!=="visible"&&(n=d._calcBorders(o,n));if(a||f)n[0]-=f,n[1]-=a}n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n[0]+=d.docScrollX(t,s),n[1]+=d.docScrollY(t,s)}else n=d._getOffset(t);return n}}(),getScrollbarWidth:e.cached(function(){var t=e.config.doc,n=t.createElement("div"),r=t.getElementsByTagName("body")[0],i=.1;return r&&(n.style.cssText="position:absolute;visibility:hidden;overflow:scroll;width:20px;",n.appendChild(t.createElement("p")).style.height="1px",r.insertBefore(n,r.firstChild),i=n.offsetWidth-n.clientWidth,r.removeChild(n)),i},null,.1),getX:function(e){return d.getXY(e)[0]},getY:function(e){return d.getXY(e)[1]},setXY:function(e,t,n){var i=d.setStyle,a,f,l,c;e&&t&&(a=d.getStyle(e,r),f=d._getOffset(e),a=="static"&&(a=s,i(e,r,a)),c=d.getXY(e),t[0]!==null&&i(e,o,t[0]-c[0]+f[0]+"px"),t[1]!==null&&i(e,u,t[1]-c[1]+f[1]+"px"),n||(l=d.getXY(e),(l[0]!==t[0]||l[1]!==t[1])&&d.setXY(e,t,!0)))},setX:function(e,t){return d.setXY(e,[t,null])},setY:function(e,t){return d.setXY(e,[null,t])},swapXY:function(e,t){var n=d.getXY(e);d.setXY(e,d.getXY(t)),d.setXY(t,n)},_calcBorders:function(t,n){var r=parseInt(d[p](t,c),10)||0,i=parseInt(d[p](t,l),10)||0;return e.UA.gecko&&v.test(t.tagName)&&(r=0,i=0),n[0]+=i,n[1]+=r,n},_getWinSize:function(r,i){i=i||r?d._getDoc(r):e.config.doc;var s=i.defaultView||i.parentWindow,o=i[n],u=s.innerHeight,a=s.innerWidth,f=i[t];return o&&!e.UA.opera&&(o!="CSS1Compat"&&(f=i.body),u=f.clientHeight,a=f.clientWidth),{height:u,width:a}},_getDocSize:function(r){var i=r?d._getDoc(r):e.config.doc,s=i[t];return i[n]!="CSS1Compat"&&(s=i.body),{height:s.scrollHeight,width:s.scrollWidth}}})})(e),function(e){var t="top",n="right",r="bottom",i="left",s=function(e,s){var o=Math.max(e[t],s[t]),u=Math.min(e[n],s[n]),a=Math.min(e[r],s[r]),f=Math.max(e[i],s[i]),l={};return l[t]=o,l[n]=u,l[r]=a,l[i]=f,l},o=e.DOM;e.mix(o,{region:function(e){var t=o.getXY(e),n=!1;return e&&t&&(n=o._getRegion(t[1],t[0]+e.offsetWidth,t[1]+e.offsetHeight,t[0])),n},intersect:function(u,a,f){var l=f||o.region(u),c={},h=a,p;if(h.tagName)c=o.region(h);else{if(!e.Lang.isObject(a))return!1;c=a}return p=s(c,l),{top:p[t],right:p[n],bottom:p[r],left:p[i],area:(p[r]-p[t])*(p[n]-p[i]),yoff:p[r]-p[t],xoff:p[n]-p[i],inRegion:o.inRegion(u,a,!1,f)}},inRegion:function(u,a,f,l){var c={},h=l||o.region(u),p=a,d;if(p.tagName)c=o.region(p);else{if(!e.Lang.isObject(a))return!1;c=a}return f?h[i]>=c[i]&&h[n]<=c[n]&&h[t]>=c[t]&&h[r]<=c[r]:(d=s(c,h),d[r]>=d[t]&&d[n]>=d[i]?!0:!1)},inViewportRegion:function(e,t,n){return o.inRegion(e,o.viewportRegion(e),t,n)},_getRegion:function(e,s,o,u){var a={};return a[t]=a[1]=e,a[i]=a[0]=u,a[r]=o,a[n]=s,a.width=a[n]-a[i],a.height=a[r]-a[t],a},viewportRegion:function(t){t=t||e.config.doc.documentElement;var n=!1,r,i;return t&&(r=o.docScrollX(t),i=o.docScrollY(t),n=o._getRegion(i,o.winWidth(t)+r,i+o.winHeight(t),r)),n}})}(e)},"3.7.3",{requires:["dom-base","dom-style"]}),YUI.add("selector-native",function(e,t){(function(e){e.namespace("Selector");var t="compareDocumentPosition",n="ownerDocument",r={_types:{esc:{token:"\ue000",re:/\\[:\[\]\(\)#\.\'\>+~"]/gi},attr:{token:"\ue001",re:/(\[[^\]]*\])/g},pseudo:{token:"\ue002",re:/(\([^\)]*\))/g}},useNative:!0,_escapeId:function(e){return e&&(e=e.replace(/([:\[\]\(\)#\.'<>+~"])/g,"\\$1")),e},_compare:"sourceIndex"in e.config.doc.documentElement?function(e,t){var n=e.sourceIndex,r=t.sourceIndex;return n===r?0:n>r?1:-1}:e.config.doc.documentElement[t]?function(e,n){return e[t](n)&4?-1:1}:function(e,t){var r,i,s;return e&&t&&(r=e[n].createRange(),r.setStart(e,0),i=t[n].createRange(),i.setStart(t,0),s=r.compareBoundaryPoints(1,i)),s},_sort:function(t){return t&&(t=e.Array(t,0,!0),t.sort&&t.sort(r._compare)),t},_deDupe:function(e){var t=[],n,r;for(n=0;r=e[n++];)r._found||(t[t.length]=r,r._found=!0);for(n=0;r=t[n++];)r._found=null,r.removeAttribute("_found");return t},query:function(t,n,i,s){n=n||e.config.doc;var o=[],u=e.Selector.useNative&&e.config.doc.querySelector&&!s,a=[[t,n]],f,l,c,h=u?e.Selector._nativeQuery:e.Selector._bruteQuery;if(t&&h){!s&&(!u||n.tagName)&&(a=r._splitQueries(t,n));for(c=0;f=a[c++];)l=h(f[0],f[1],i),i||(l=e.Array(l,0,!0)),l&&(o=o.concat(l));a.length>1&&(o=r._sort(r._deDupe(o)))}return i?o[0]||null:o},_replaceSelector:function(t){var n=e.Selector._parse("esc",t),i,s;return t=e.Selector._replace("esc",t),s=e.Selector._parse("pseudo",t),t=r._replace("pseudo",t),i=e.Selector._parse("attr",t),t=e.Selector._replace("attr",t),{esc:n,attrs:i,pseudos:s,selector:t}},_restoreSelector:function(t){var n=t.selector;return n=e.Selector._restore("attr",n,t.attrs),n=e.Selector._restore("pseudo",n,t.pseudos),n=e.Selector._restore("esc",n,t.esc),n},_replaceCommas:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t&&(t=t.replace(/,/g,"\ue007"),n.selector=t,t=e.Selector._restoreSelector(n)),t},_splitQueries:function(t,n){t.indexOf(",")>-1&&(t=e.Selector._replaceCommas(t));var r=t.split("\ue007"),i=[],s="",o,u,a;if(n){n.nodeType===1&&(o=e.Selector._escapeId(e.DOM.getId(n)),o||(o=e.guid(),e.DOM.setId(n,o)),s='[id="'+o+'"] ');for(u=0,a=r.length;u<a;++u)t=s+r[u],i.push([t,n])}return i},_nativeQuery:function(t,n,r){if(e.UA.webkit&&t.indexOf(":checked")>-1&&e.Selector.pseudos&&e.Selector.pseudos.checked)return e.Selector.query(t,n,r,!0);try{return n["querySelector"+(r?"":"All")](t)}catch(i){return e.Selector.query(t,n,r,!0)}},filter:function(t,n){var r=[],i,s;if(t&&n)for(i=0;s=t[i++];)e.Selector.test(s,n)&&(r[r.length]=s);return r},test:function(t,r,i){var s=!1,o=!1,u,a,f,l,c,h,p,d,v;if(t&&t.tagName)if(typeof r=="function")s=r.call(t,t);else{u=r.split(","),!i&&!e.DOM.inDoc(t)&&(a=t.parentNode,a?i=a:(c=t[n].createDocumentFragment(),c.appendChild(t),i=c,o=!0)),i=i||t[n],h=e.Selector._escapeId(e.DOM.getId(t)),h||(h=e.guid(),e.DOM.setId(t,h));for(p=0;v=u[p++];){v+='[id="'+h+'"]',l=e.Selector.query(v,i);for(d=0;f=l[d++];)if(f===t){s=!0;break}if(s)break}o&&c.removeChild(t)}return s},ancestor:function(t,n,r){return e.DOM.ancestor(t,function(t){return e.Selector.test(t,n)},r)},_parse:function(t,n){return n.match(e.Selector._types[t].re)},_replace:function(t,n){var r=e.Selector._types[t];return n.replace(r.re,r.token)},_restore:function(t,n,r){if(r){var i=e.Selector._types[t].token,s,o;for(s=0,o=r.length;s<o;++s)n=n.replace(i,r[s])}return n}};e.mix(e.Selector,r,!0)})(e)},"3.7.3",{requires:["dom-base"]}),YUI.add("selector",function(e,t){},"3.7.3",{requires:["selector-native"]}),YUI.add("event-custom-base",function(e,t){e.Env.evt={handles:{},plugins:{}};var n=0,r=1,i={objs:null,before:function(t,r,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(n,o,r,i)},after:function(t,n,i,s){var o=t,u;return s&&(u=[t,s].concat(e.Array(arguments,4,!0)),o=e.rbind.apply(e,u)),this._inject(r,o,n,i)},_inject:function(t,n,r,i){var s=e.stamp(r),o,u;return r._yuiaop||(r._yuiaop={}),o=r._yuiaop,o[i]||(o[i]=new e.Do.Method(r,i),r[i]=function(){return o[i].exec.apply(o[i],arguments)}),u=s+e.stamp(n)+i,o[i].register(u,n,t),new e.EventHandle(o[i],u)},detach:function(e){e.detach&&e.detach()},_unload:function(e,t){}};e.Do=i,i.Method=function(e,t){this.obj=e,this.methodName=t,this.method=e[t],this.before={},this.after={}},i.Method.prototype.register=function(e,t,n){n?this.after[e]=t:this.before[e]=t},i.Method.prototype._delete=function(e){delete this.before[e],delete this.after[e]},i.Method.prototype.exec=function(){var t=e.Array(arguments,0,!0),n,r,s,o=this.before,u=this.after,a=!1;for(n in o)if(o.hasOwnProperty(n)){r=o[n].apply(this.obj,t);if(r)switch(r.constructor){case i.Halt:return r.retVal;case i.AlterArgs:t=r.newArgs;break;case i.Prevent:a=!0;break;default:}}a||(r=this.method.apply(this.obj,t)),i.originalRetVal=r,i.currentRetVal=r;for(n in u)if(u.hasOwnProperty(n)){s=u[n].apply(this.obj,t);if(s&&s.constructor==i.Halt)return s.retVal;s&&s.constructor==i.AlterReturn&&(r=s.newRetVal,i.currentRetVal=r)}return r},i.AlterArgs=function(e,t){this.msg=e,this.newArgs=t},i.AlterReturn=function(e,t){this.msg=e,this.newRetVal=t},i.Halt=function(e,t){this.msg=e,this.retVal=t},i.Prevent=function(e){this.msg=e},i.Error=i.Halt;var s=e.Array,o="after",u=["broadcast","monitored","bubbles","context","contextFn","currentTarget","defaultFn","defaultTargetOnly","details","emitFacade","fireOnce","async","host","preventable","preventedFn","queuable","silent","stoppedFn","target","type"],a=s.hash(u),f=Array.prototype.slice,l=9,c="yui:log",h=function(e,t,n){var r;for(r in t)a[r]&&(n||!(r in e))&&(e[r]=t[r]);return e};e.CustomEvent=function(t,n){this._kds=e.CustomEvent.keepDeprecatedSubs,n=n||{},this.id=e.stamp(this),this.type=t,this.context=e,this.logSystem=t==c,this.silent=this.logSystem,this._kds&&(this.subscribers={}),this._subscribers=[],this._kds&&(this.afters={}),this._afters=[],this.preventable=!0,this.bubbles=!0,this.signature=l,this.applyConfig(n,!0)},e.CustomEvent.keepDeprecatedSubs=!1,e.CustomEvent.mixConfigs=h,e.CustomEvent.prototype={constructor:e.CustomEvent,hasSubs:function(e){var t=this._subscribers.length,n=this._afters.length,r=this.sibling;return r&&(t+=r._subscribers.length,n+=r._afters.length),e?e=="after"?n:t:t+n},monitor:function(e){this.monitored=!0;var t=this.id+"|"+this.type+"_"+e,n=f.call(arguments,0);return n[0]=t,this.host.on.apply(this.host,n)},getSubs:function(){var e=this._subscribers,t=this._afters,n=this.sibling;return e=n?e.concat(n._subscribers):e.concat(),t=n?t.concat(n._afters):t.concat(),[e,t]},applyConfig:function(e,t){h(this,e,t)},_on:function(t,n,r,i){t||this.log("Invalid callback for CE: "+this.type);var s=new e.Subscriber(t,n,r,i);return this.fireOnce&&this.fired&&(this.async?setTimeout(e.bind(this._notify,this,s,this.firedWith),0):this._notify(s,this.firedWith)),i==o?this._afters.push(s):this._subscribers.push(s),this._kds&&(i==o?this.afters[s.id]=s:this.subscribers[s.id]=s),new e.EventHandle(this,s)},subscribe:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,!0)},on:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this.monitored&&this.host&&this.host._monitor("attach",this,{args:arguments}),this._on(e,t,n,!0)},after:function(e,t){var n=arguments.length>2?f.call(arguments,2):null;return this._on(e,t,n,o)},detach:function(e,t){if(e&&e.detach)return e.detach();var n,r,i=0,s=this._subscribers,o=this._afters;for(n=s.length;n>=0;n--)r=s[n],r&&(!e||e===r.fn)&&(this._delete(r,s,n),i++);for(n=o.length;n>=0;n--)r=o[n],r&&(!e||e===r.fn)&&(this._delete(r,o,n),i++);return i},unsubscribe:function(){return this.detach.apply(this,arguments)},_notify:function(e,t,n){this.log(this.type+"->"+"sub: "+e.id);var r;return r=e.notify(t,this),!1===r||this.stopped>1?(this.log(this.type+" cancelled by subscriber"),!1):!0},log:function(e,t){},fire:function(){if(this.fireOnce&&this.fired)return this.log("fireOnce event: "+this.type+" already fired"),!0;var e=f.call(arguments,0);return this.fired=!0,this.fireOnce&&(this.firedWith=e),this.emitFacade?this.fireComplex(e):this.fireSimple(e)},fireSimple:function(e){this.stopped=0,this.prevented=0;if(this.hasSubs()){var t=this.getSubs();this._procSubs(t[0],e),this._procSubs(t[1],e)}return this._broadcast(e),this.stopped?!1:!0},fireComplex:function(e){return this.log("Missing event-custom-complex needed to emit a facade for: "+this.type),e[0]=e[0]||{},this.fireSimple(e)},_procSubs:function(e,t,n){var r,i,s;for(i=0,s=e.length;i<s;i++){r=e[i];if(r&&r.fn){!1===this._notify(r,t,n)&&(this.stopped=2);if(this.stopped==2)return!1}}return!0},_broadcast:function(t){if(!this.stopped&&this.broadcast){var n=t.concat();n.unshift(this.type),this.host!==e&&e.fire.apply(e,n),this.broadcast==2&&e.Global.fire.apply(e.Global,n)}},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},detachAll:function(){return this.detach()},_delete:function(e,t,n){var r=e._when;t||(t=r===o?this._afters:this._subscribers,n=s.indexOf(t,e,0)),e&&t[n]===e&&t.splice(n,1),this._kds&&(r===o?delete this.afters[e.id]:delete this.subscribers[e.id]),this.monitored&&this.host&&this.host._monitor("detach",this,{ce:this,sub:e}),e&&(e.deleted=!0)}},e.Subscriber=function(t,n,r,i){this.fn=t,this.context=n,this.id=e.stamp(this),this.args=r,this._when=i},e.Subscriber.prototype={constructor:e.Subscriber,_notify:function(e,t,n){if(this.deleted&&!this.postponed){if(!this.postponed)return delete this.postponed,null;delete this.fn,delete this.context}var r=this.args,i;switch(n.signature){case 0:i=this.fn.call(e,n.type,t,e);break;case 1:i=this.fn.call(e,t[0]||null,e);break;default:r||t?(t=t||[],r=r?t.concat(r):t,i=this.fn.apply(e,r)):i=this.fn.call(e)}return this.once&&n._delete(this),i},notify:function(t,n){var r=this.context,i=!0;r||(r=n.contextFn?n.contextFn():n.context);if(e.config&&e.config.throwFail)i=this._notify(r,t,n);else try{i=this._notify(r,t,n)}catch(s){e.error(this+" failed: "+s.message,s)}return i},contains:function(e,t){return t?this.fn==e&&this.context==t:this.fn==e},valueOf:function(){return this.id}},e.EventHandle=function(e,t){this.evt=e,this.sub=t},e.EventHandle.prototype={batch:function(t,n){t.call(n||this,this),e.Lang.isArray(this.evt)&&e.Array.each(this.evt,function(e){e.batch.call(n||e,t)})},detach:function(){var t=this.evt,n=0,r;if(t)if(e.Lang.isArray(t))for(r=0;r<t.length;r++)n+=t[r].detach();else t._delete(this.sub),n=1;return n},monitor:function(e){return this.evt.monitor.apply(this.evt,arguments)}};var p=e.Lang,d=":",v="|",m="~AFTER~",g=/(.*?)(:)(.*?)/,y=e.cached(function(e){return e.replace(g,"*$2$3")}),b=e.cached(function(e,t){return!t||typeof e!="string"||e.indexOf(d)>-1?e:t+d+e}),w=e.cached(function(e,t){var n=e,r,i,s;return p.isString(n)?(s=n.indexOf(m),s>-1&&(i=!0,n=n.substr(m.length)),s=n.indexOf(v),s>-1&&(r=n.substr(0,s),n=n.substr(s+1),n=="*"&&(n=null)),[r,t?b(n,t):n,i,n]):n}),E=function(t){var n=p.isObject(t)?t:{};this._yuievt=this._yuievt||{id:e.guid(),events:{},targets:{},config:n,chain:"chain"in n?n.chain:e.config.chain,bubbling:!1,defaults:{context:n.context||this,host:this,emitFacade:n.emitFacade,fireOnce:n.fireOnce,queuable:n.queuable,monitored:n.monitored,broadcast:n.broadcast,defaultTargetOnly:n.defaultTargetOnly,bubbles:"bubbles"in n?n.bubbles:!0}}};E.prototype={constructor:E,once:function(){var e=this.on.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},onceAfter:function(){var e=this.after.apply(this,arguments);return e.batch(function(e){e.sub&&(e.sub.once=!0)}),e},parseType:function(e,t){return w(e,t||this._yuievt.config.prefix)},on:function(t,n,r){var i=this._yuievt,s=w(t,i.config.prefix),o,u,a,l,c,h,d,v=e.Env.evt.handles,g,y,b,E=e.Node,S,x,T;this._monitor("attach",s[1],{args:arguments,category:s[0],after:s[2]});if(p.isObject(t))return p.isFunction(t)?e.Do.before.apply(e.Do,arguments):(o=n,u=r,a=f.call(arguments,0),l=[],p.isArray(t)&&(T=!0),g=t._after,delete t._after,e.each(t,function(e,t){p.isObject(e)&&(o=e.fn||(p.isFunction(e)?e:o),u=e.context||u);var n=g?m:"";a[0]=n+(T?e:t),a[1]=o,a[2]=u,l.push(this.on.apply(this,a))},this),i.chain?this:new e.EventHandle(l));h=s[0],g=s[2],b=s[3];if(E&&e.instanceOf(this,E)&&b in E.DOM_EVENTS)return a=f.call(arguments,0),a.splice(2,0,E.getDOMNode(this)),e.on.apply(e,a);t=s[1];if(e.instanceOf(this,YUI)){y=e.Env.evt.plugins[t],a=f.call(arguments,0),a[0]=b,E&&(S=a[2],e.instanceOf(S,e.NodeList)?S=e.NodeList.getDOMNodes(S):e.instanceOf(S,E)&&(S=E.getDOMNode(S)),x=b in E.DOM_EVENTS,x&&(a[2]=S));if(y)d=y.on.apply(e,a);else if(!t||x)d=e.Event._attach(a)}return d||(c=i.events[t]||this.publish(t),d=c._on(n,r,arguments.length>3?f.call(arguments,3):null,g?"after":!0)),h&&(v[h]=v[h]||{},v[h][t]=v[h][t]||[],v[h][t].push(d)),i.chain?this:d},subscribe:function(){return this.on.apply(this,arguments)},detach:function(t,n,r){var i=this._yuievt.events,s,o=e.Node,u=o&&e.instanceOf(this,o);if(!t&&this!==e){for(s in i)i.hasOwnProperty(s)&&i[s].detach(n,r);return u&&e.Event.purgeElement(o.getDOMNode(this)),this}var a=w(t,this._yuievt.config.prefix),l=p.isArray(a)?a[0]:null,c=a?a[3]:null,h,d=e.Env.evt.handles,v,m,g,y,b=function(e,t,n){var r=e[t],i,s;if(r)for(s=r.length-1;s>=0;--s)i=r[s].evt,(i.host===n||i.el===n)&&r[s].detach()};if(l){m=d[l],t=a[1],v=u?e.Node.getDOMNode(this):this;if(m){if(t)b(m,t,v);else for(s in m)m.hasOwnProperty(s)&&b(m,s,v);return this}}else{if(p.isObject(t)&&t.detach)return t.detach(),this;if(u&&(!c||c in o.DOM_EVENTS))return g=f.call(arguments,0),g[2]=o.getDOMNode(this),e.detach.apply(e,g),this}h=e.Env.evt.plugins[c];if(e.instanceOf(this,YUI)){g=f.call(arguments,0);if(h&&h.detach)return h.detach.apply(e,g),this;if(!t||!h&&o&&t in o.DOM_EVENTS)return g[0]=t,e.Event.detach.apply(e.Event,g),this}return y=i[a[1]],y&&y.detach(n,r),this},unsubscribe:function(){return this.detach.apply(this,arguments)},detachAll:function(e){return this.detach(e)},unsubscribeAll:function(){return this.detachAll.apply(this,arguments)},publish:function(t,n){var r,i,s,o,u=this._yuievt,a=u.config.prefix;return p.isObject(t)?(s={},e.each(t,function(e,t){s[t]=this.publish(t,e||n)},this),s):(t=a?b(t,a):t,r=u.events,i=r[t],this._monitor("publish",t,{args:arguments}),i?n&&i.applyConfig(n,!0):(o=u.defaults,i=new e.CustomEvent(t,o),n&&i.applyConfig(n,!0),r[t]=i),r[t])},_monitor:function(e,t,n){var r,i,s;if(t){typeof t=="string"?(s=t,i=this.getEvent(t,!0)):(i=t,s=t.type);if(this._yuievt.config.monitored&&(!i||i.monitored)||i&&i.monitored)r=s+"_"+e,n.monitored=e,this.fire.call(this,r,n)}},fire:function(e){var t=p.isString(e),n=t?e:e&&e.type,r=this._yuievt,i=r.config.prefix,s,o,u,a=t?f.call(arguments,1):arguments;n=i?b(n,i):n,s=this.getEvent(n,!0),u=this.getSibling(n,s),u&&!s&&(s=this.publish(n)),this._monitor("fire",s||n,{args:a});if(!s){if(r.hasTargets)return this.bubble({type:n},a,this);o=!0}else s.sibling=u,o=s.fire.apply(s,a);return r.chain?this:o},getSibling:function(e,t){var n;return e.indexOf(d)>-1&&(e=y(e),n=this.getEvent(e,!0),n&&(n.applyConfig(t),n.bubbles=!1,n.broadcast=0)),n},getEvent:function(e,t){var n,r;return t||(n=this._yuievt.config.prefix,e=n?b(e,n):e),r=this._yuievt.events,r[e]||null},after:function(t,n){var r=f.call(arguments,0);switch(p.type(t)){case"function":return e.Do.after.apply(e.Do,arguments);case"array":case"object":r[0]._after=!0;break;default:r[0]=m+t}return this.on.apply(this,r)},before:function(){return this.on.apply(this,arguments)}},e.EventTarget=E,e.mix(e,E.prototype),E.call(e,{bubbles:!1}),YUI.Env.globalEvents=YUI.Env.globalEvents||new E,e.Global=YUI.Env.globalEvents},"3.7.3",{requires:["oop"]}),YUI.add("event-custom-complex",function(e,t){var n,r,i,s={},o=e.CustomEvent.prototype,u=e.EventTarget.prototype,a=function(e,t){var n;for(n in t)r.hasOwnProperty(n)||(e[n]=t[n])};e.EventFacade=function(e,t){e=e||s,this._event=e,this.details=e.details,this.type=e.type,this._type=e.type,this.target=e.target,this.currentTarget=t,this.relatedTarget=e.relatedTarget},e.mix(e.EventFacade.prototype,{stopPropagation:function(){this._event.stopPropagation(),this.stopped=1},stopImmediatePropagation:function(){this._event.stopImmediatePropagation(),this.stopped=2},preventDefault:function(){this._event.preventDefault(),this.prevented=1},halt:function(e){this._event.halt(e),this.prevented=1,this.stopped=e?2:1}}),o.fireComplex=function(t){var n,r,i,s,o,u,a,f,l,c=this,h=c.host||c,p,d;if(c.stack&&c.queuable&&c.type!=c.stack.next.type)return c.log("queue "+c.type),c.stack.queue.push([c,t]),!0;n=c.stack||{id:c.id,next:c,silent:c.silent,stopped:0,prevented:0,bubbling:null,type:c.type,afterQueue:new e.Queue,defaultTargetOnly:c.defaultTargetOnly,queue:[]},f=c.getSubs(),c.stopped=c.type!==n.type?0:n.stopped,c.prevented=c.type!==n.type?0:n.prevented,c.target=c.target||h,c.stoppedFn&&(a=new e.EventTarget({fireOnce:!0,context:h}),c.events=a,a.on("stopped",c.stoppedFn)),c.currentTarget=h,c.details=t.slice(),c.log("Firing "+c.type),c._facade=null,r=c._getFacade(t),e.Lang.isObject(t[0])?t[0]=r:t.unshift(r),f[0]&&c._procSubs(f[0],t,r),c.bubbles&&h.bubble&&!c.stopped&&(d=n.bubbling,n.bubbling=c.type,n.type!=c.type&&(n.stopped=0,n.prevented=0),u=h.bubble(c,t,null,n),c.stopped=Math.max(c.stopped,n.stopped),c.prevented=Math.max(c.prevented,n.prevented),n.bubbling=d),c.prevented?c.preventedFn&&c.preventedFn.apply(h,t):c.defaultFn&&(!c.defaultTargetOnly&&!n.defaultTargetOnly||h===r.target)&&c.defaultFn.apply(h,t),c._broadcast(t);if(f[1]&&!c.prevented&&c.stopped<2)if(n.id===c.id||c.type!=h._yuievt.bubbling){c._procSubs(f[1],t,r);while(p=n.afterQueue.last())p()}else l=f[1],n.execDefaultCnt&&(l=e.merge(l),e.each(l,function(e){e.postponed=!0})),n.afterQueue.add(function(){c._procSubs(l,t,r)});c.target=null;if(n.id===c.id){s=n.queue;while(s.length)i=s.pop(),o=i[0],n.next=o,o.fire.apply(o,i[1]);c.stack=null}return u=!c.stopped,c.type!=h._yuievt.bubbling&&(n.stopped=0,n.prevented=0,c.stopped=0,c.prevented=0),c._facade=null,u},o._getFacade=function(){var t=this._facade,n,r=this.details;return t||(t=new e.EventFacade(this,this.currentTarget)),n=r&&r[0],e.Lang.isObject(n,!0)&&(a(t,n),t.type=n.type||t.type),t.details=this.details,t.target=this.originalTarget||this.target,t.currentTarget=this.currentTarget,t.stopped=0,t.prevented=0,this._facade=t,this._facade},o.stopPropagation=function(){this.stopped=1,this.stack&&(this.stack.stopped=1),this.events&&this.events.fire("stopped",this)},o.stopImmediatePropagation=function(){this.stopped=2,this.stack&&(this.stack.stopped=2),this.events&&this.events.fire("stopped",this)},o.preventDefault=function(){this.preventable&&(this.prevented=1,this.stack&&(this.stack.prevented=1))},o.halt=function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()},u.addTarget=function(t){this._yuievt.targets[e.stamp(t)]=t,this._yuievt.hasTargets=!0},u.getTargets=function(){return e.Object.values(this._yuievt.targets)},u.removeTarget=function(t){delete this._yuievt.targets[e.stamp(t)]},u.bubble=function(e,t,n,r){var i=this._yuievt.targets,s=!0,o,u=e&&e.type,a,f,l,c,h=n||e&&e.target||this,p;if(!e||!e.stopped&&i)for(f in i)if(i.hasOwnProperty(f)){o=i[f],a=o.getEvent(u,!0),c=o.getSibling(u,a),c&&!a&&(a=o.publish(u)),p=o._yuievt.bubbling,o._yuievt.bubbling=u;if(!a)o._yuievt.hasTargets&&o.bubble(e,t,h,r);else{a.sibling=c,a.target=h,a.originalTarget=h,a.currentTarget=o,l=a.broadcast,a.broadcast=!1,a.emitFacade=!0,a.stack=r,s=s&&a.fire.apply(a,t||e.details||[]),a.broadcast=l,a.originalTarget=null;if(a.stopped)break}o._yuievt.bubbling=p}return s},n=new e.EventFacade,r={};for(i in n)r[i]=!0},"3.7.3",{requires:["event-custom-base"]}),YUI.add("node-core",function(e,t){var n=".",r="nodeName",i="nodeType",s="ownerDocument",o="tagName",u="_yuid",a={},f=Array.prototype.slice,l=e.DOM,c=function(t){if(!this.getDOMNode)return new c(t);if(typeof t=="string"){t=c._fromString(t);if(!t)return null}var n=t.nodeType!==9?t.uniqueID:t[u];n&&c._instances[n]&&c._instances[n]._node!==t&&(t[u]=null),n=n||e.stamp(t),n||(n=e.guid()),this[u]=n,this._node=t,this._stateProxy=t,this._initPlugins&&this._initPlugins()},h=function(t){var n=null;return t&&(n=typeof t=="string"?function(n){return e.Selector.test(n,t)}:function(n){return t(e.one(n))}),n};c.ATTRS={},c.DOM_EVENTS={},c._fromString=function(t){return t&&(t.indexOf("doc")===0?t=e.config.doc:t.indexOf("win")===0?t=e.config.win:t=e.Selector.query(t,null,!0)),t||null},c.NAME="node",c.re_aria=/^(?:role$|aria-)/,c.SHOW_TRANSITION="fadeIn",c.HIDE_TRANSITION="fadeOut",c._instances={},c.getDOMNode=function(e){return e?e.nodeType?e:e._node||null:null},c.scrubVal=function(t,n){if(t){if(typeof t=="object"||typeof t=="function")if(i in t||l.isWindow(t))t=e.one(t);else if(t.item&&!t._nodes||t[0]&&t[0][i])t=e.all(t)}else typeof t=="undefined"?t=n:t===null&&(t=null);return t},c.addMethod=function(e,t,n){e&&t&&typeof t=="function"&&(c.prototype[e]=function(){var e=f.call(arguments),n=this,r;return e[0]&&e[0]._node&&(e[0]=e[0]._node),e[1]&&e[1]._node&&(e[1]=e[1]._node),e.unshift(n._node),r=t.apply(n,e),r&&(r=c.scrubVal(r,n)),typeof r!="undefined"||(r=n),r})},c.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,c.addMethod(r,t[n],t)):e.Array.each(n,function(e){c.importMethod(t,e)})},c.one=function(t){var n=null,r,i;if(t){if(typeof t=="string"){t=c._fromString(t);if(!t)return null}else if(t.getDOMNode)return t;if(t.nodeType||e.DOM.isWindow(t)){i=t.uniqueID&&t.nodeType!==9?t.uniqueID:t._yuid,n=c._instances[i],r=n?n._node:null;if(!n||r&&t!==r)n=new c(t),t.nodeType!=11&&(c._instances[n[u]]=n)}}return n},c.DEFAULT_SETTER=function(t,r){var i=this._stateProxy,s;return t.indexOf(n)>-1?(s=t,t=t.split(n),e.Object.setValue(i,t,r)):typeof i[t]!="undefined"&&(i[t]=r),r},c.DEFAULT_GETTER=function(t){var r=this._stateProxy,i;return t.indexOf&&t.indexOf(n)>-1?i=e.Object.getValue(r,t.split(n)):typeof r[t]!="undefined"&&(i=r[t]),i},e.mix(c.prototype,{DATA_PREFIX:"data-",toString:function(){var e=this[u]+": not bound to a node",t=this._node,n,i,s;return t&&(n=t.attributes,i=n&&n.id?t.getAttribute("id"):null,s=n&&n.className?t.getAttribute("className"):null,e=t[r],i&&(e+="#"+i),s&&(e+="."+s.replace(" ",".")),e+=" "+this[u]),e},get:function(e){var t;return this._getAttr?t=this._getAttr(e):t=this._get(e),t?t=c.scrubVal(t,this):t===null&&(t=null),t},_get:function(e){var t=c.ATTRS[e],n;return t&&t.getter?n=t.getter.call(this):c.re_aria.test(e)?n=this._node.getAttribute(e,2):n=c.DEFAULT_GETTER.apply(this,arguments),n},set:function(e,t){var n=c.ATTRS[e];return this._setAttr?this._setAttr.apply(this,arguments):n&&n.setter?n.setter.call(this,t,e):c.re_aria.test(e)?this._node.setAttribute(e,t):c.DEFAULT_SETTER.apply(this,arguments),this},setAttrs:function(t){return this._setAttrs?this._setAttrs(t):e.Object.each(t,function(e,t){this.set(t,e)},this),this},getAttrs:function(t){var n={};return this._getAttrs?this._getAttrs(t):e.Array.each(t,function(e,t){n[e]=this.get(e)},this),n},compareTo:function(e){var t=this._node;return e&&e._node&&(e=e._node),t===e},inDoc:function(e){var t=this._node;e=e?e._node||e:t[s];if(e.documentElement)return l.contains(e.documentElement,t)},getById:function(t){var n=this._node,r=l.byId(t,n[s]);return r&&l.contains(n,r)?r=e.one(r):r=null,r},ancestor:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.one(l.ancestor(this._node,h(t),n,h(r)))},ancestors:function(t,n,r){return arguments.length===2&&(typeof n=="string"||typeof n=="function")&&(r=n),e.all(l.ancestors(this._node,h(t),n,h(r)))},previous:function(t,n){return e.one(l.elementByAxis(this._node,"previousSibling",h(t),n))},next:function(t,n){return e.one(l.elementByAxis(this._node,"nextSibling",h(t),n))},siblings:function(t){return e.all(l.siblings(this._node,h(t)))},one:function(t){return e.one(e.Selector.query(t,this._node,!0))},all:function(t){var n=e.all(e.Selector.query(t,this._node));return n._query=t,n._queryRoot=this._node,n},test:function(t){return e.Selector.test(this._node,t)},remove:function(e){var t=this._node;return t&&t.parentNode&&t.parentNode.removeChild(t),e&&this.destroy(),this},replace:function(e){var t=this._node;return typeof e=="string"&&(e=c.create(e)),t.parentNode.replaceChild(c.getDOMNode(e),t),this},replaceChild:function(t,n){return typeof t=="string"&&(t=l.create(t)),e.one(this._node.replaceChild(c.getDOMNode(t),c.getDOMNode(n)))},destroy:function(t){var n=e.config.doc.uniqueID?"uniqueID":"_yuid",r;this.purge(),this.unplug&&this.unplug(),this.clearData(),t&&e.NodeList.each(this.all("*"),function(t){r=c._instances[t[n]],r?r.destroy():e.Event.purgeElement(t)}),this._node=null,this._stateProxy=null,delete c._instances[this._yuid]},invoke:function(e,t,n,r,i,s){var o=this._node,u;return t&&t._node&&(t=t._node),n&&n._node&&(n=n._node),u=o[e](t,n,r,i,s),c.scrubVal(u,this)},swap:e.config.doc.documentElement.swapNode?function(e){this._node.swapNode(c.getDOMNode(e))}:function(e){e=c.getDOMNode(e);var t=this._node,n=e.parentNode,r=e.nextSibling;return r===t?n.insertBefore(t,e):e===t.nextSibling?n.insertBefore(e,t):(t.parentNode.replaceChild(e,t),l.addHTML(n,t,r)),this},hasMethod:function(e){var t=this._node;return!(!(t&&e in t&&typeof t[e]!="unknown")||typeof t[e]!="function"&&String(t[e]).indexOf("function")!==1)},isFragment:function(){return this.get("nodeType")===11},empty:function(){return this.get("childNodes").remove().destroy(!0),this},getDOMNode:function(){return this._node}},!0),e.Node=c,e.one=c.one;var p=function(t){var n=[];t&&(typeof t=="string"?(this._query=t,t=e.Selector.query(t)):t.nodeType||l.isWindow(t)?t=[t]:t._node?t=[t._node]:t[0]&&t[0]._node?(e.Array.each(t,function(e){e._node&&n.push(e._node)}),t=n):t=e.Array(t,0,!0)),this._nodes=t||[]};p.NAME="NodeList",p.getDOMNodes=function(e){return e&&e._nodes?e._nodes:e},p.each=function(t,n,r){var i=t._nodes;i&&i.length&&e.Array.each(i,n,r||t)},p.addMethod=function(t,n,r){t&&n&&(p.prototype[t]=function(){var t=[],i=arguments;return e.Array.each(this._nodes,function(s){var o=s.uniqueID&&s.nodeType!==9?"uniqueID":"_yuid",u=e.Node._instances[s[o]],a,f;u||(u=p._getTempNode(s)),a=r||u,f=n.apply(a,i),f!==undefined&&f!==u&&(t[t.length]=f)}),t.length?t:this})},p.importMethod=function(t,n,r){typeof n=="string"?(r=r||n,p.addMethod(n,t[n])):e.Array.each(n,function(e){p.importMethod(t,e)})},p._getTempNode=function(t){var n=p._tempNode;return n||(n=e.Node.create("<div></div>"),p._tempNode=n),n._node=t,n._stateProxy=t,n},e.mix(p.prototype,{_invoke:function(e,t,n){var r=n?[]:this;return this.each(function(i){var s=i[e].apply(i,t);n&&r.push(s)}),r},item:function(t){return e.one((this._nodes||[])[t])},each:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){return i=e.one(i),t.call(n||i,i,s,r)}),r},batch:function(t,n){var r=this;return e.Array.each(this._nodes,function(i,s){var o=e.Node._instances[i[u]];return o||(o=p._getTempNode(i)),t.call(n||o,o,s,r)}),r},some:function(t,n){var r=this;return e.Array.some(this._nodes,function(i,s){return i=e.one(i),n=n||i,t.call(n,i,s,r)})},toFrag:function(){return e.one(e.DOM._nl2frag(this._nodes))},indexOf:function(t){return e.Array.indexOf(this._nodes,e.Node.getDOMNode(t))},filter:function(t){return e.all(e.Selector.filter(this._nodes,t))},modulus:function(t,n){n=n||0;var r=[];return p.each(this,function(e,i){i%t===n&&r.push(e)}),e.all(r)},odd:function(){return this.modulus(2,1)},even:function(){return this.modulus(2)},destructor:function(){},refresh:function(){var t,n=this._nodes,r=this._query,i=this._queryRoot;return r&&(i||n&&n[0]&&n[0].ownerDocument&&(i=n[0].ownerDocument),this._nodes=e.Selector.query(r,i)),this},size:function(){return this._nodes.length},isEmpty:function(){return this._nodes.length<1},toString:function(){var e="",t=this[u]+": not bound to any nodes",n=this._nodes,i;return n&&n[0]&&(i=n[0],e+=i[r],i.id&&(e+="#"+i.id),i.className&&(e+="."+i.className.replace(" ",".")),n.length>1&&(e+="...["+n.length+" items]")),e||t},getDOMNodes:function(){return this._nodes}},!0),p.importMethod(e.Node.prototype,["destroy","empty","remove","set"]),p.prototype.get=function(t){var n=[],r=this._nodes,i=!1,s=p._getTempNode,o,u;return r[0]&&(o=e.Node._instances[r[0]._yuid]||s(r[0]),u=o._get(t),u&&u.nodeType&&(i=!0)),e.Array.each(r,function(r){o=e.Node._instances[r._yuid],o||(o=s(r)),u=o._get(t),i||(u=e.Node.scrubVal(u,o)),n.push(u)}),i?e.all(n):n},e.NodeList=p,e.all=function(e){return new p(e)},e.Node.all=e.all;var d=e.NodeList,v=Array.prototype,m={concat:1,pop:0,push:0,shift:0,slice:1,splice:1,unshift:0};e.Object.each(m,function(t,n){d.prototype[n]=function(){var r=[],i=0,s,o;while(typeof (s=arguments[i++])!="undefined")r.push(s._node||s._nodes||s);return o=v[n].apply(this._nodes,r),t?o=e.all(o):o=e.Node.scrubVal(o),o}}),e.Array.each(["removeChild","hasChildNodes","cloneNode","hasAttribute","scrollIntoView","getElementsByTagName","focus","blur","submit","reset","select","createCaption"],function(t){e.Node.prototype[t]=function(e,n,r){var i=this.invoke(t,e,n,r);return i}}),e.Node.prototype.removeAttribute=function(e){var t=this._node;return t&&t.removeAttribute(e,0),this},e.Node.importMethod(e.DOM,["contains","setAttribute","getAttribute","wrap","unwrap","generateID"]),e.NodeList.importMethod(e.Node.prototype,["getAttribute","setAttribute","removeAttribute","unwrap","wrap","generateID"])},"3.7.3",{requires:["dom-core","selector"]}),YUI.add("node-base",function(e,t){var n=["hasClass","addClass","removeClass","replaceClass","toggleClass"];e.Node.importMethod(e.DOM,n),e.NodeList.importMethod(e.Node.prototype,n);var r=e.Node,i=e.DOM;r.create=function(t,n){return n&&n._node&&(n=n._node),e.one(i.create(t,n))},e.mix(r.prototype,{create:r.create,insert:function(e,t){return this._insert(e,t),this},_insert:function(e,t){var n=this._node,r=null;return typeof t=="number"?t=this._node.childNodes[t]:t&&t._node&&(t=t._node),e&&typeof e!="string"&&(e=e._node||e._nodes||e),r=i.addHTML(n,e,t),r},prepend:function(e){return this.insert(e,0)},append:function(e){return this.insert(e,null)},appendChild:function(e){return r.scrubVal(this._insert(e))},insertBefore:function(t,n){return e.Node.scrubVal(this._insert(t,n))},appendTo:function(t){return e.one(t).append(this),this},setContent:function(e){return this._insert(e,"replace"),this},getContent:function(e){return this.get("innerHTML")}}),e.Node.prototype.setHTML=e.Node.prototype.setContent,e.Node.prototype.getHTML=e.Node.prototype.getContent,e.NodeList.importMethod(e.Node.prototype,["append","insert","appendChild","insertBefore","prepend","setContent","getContent","setHTML","getHTML"]);var r=e.Node,i=e.DOM;r.ATTRS={text:{getter:function(){return i.getText(this._node)},setter:function(e){return i.setText(this._node,e),e}},"for":{getter:function(){return i.getAttribute(this._node,"for")},setter:function(e){return i.setAttribute(this._node,"for",e),e}},options:{getter:function(){return this._node.getElementsByTagName("option")}},children:{getter:function(){var t=this._node,n=t.children,r,i,s;if(!n){r=t.childNodes,n=[];for(i=0,s=r.length;i<s;++i)r[i].tagName&&(n[n.length]=r[i])}return e.all(n)}},value:{getter:function(){return i.getValue(this._node)},setter:function(e){return i.setValue(this._node,e),e}}},e.Node.importMethod(e.DOM,["setAttribute","getAttribute"]);var r=e.Node,s=e.NodeList;r.DOM_EVENTS={abort:1,beforeunload:1,blur:1,change:1,click:1,close:1,command:1,contextmenu:1,dblclick:1,DOMMouseScroll:1,drag:1,dragstart:1,dragenter:1,dragover:1,dragleave:1,dragend:1,drop:1,error:1,focus:1,key:1,keydown:1,keypress:1,keyup:1,load:1,message:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mousemultiwheel:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,orientationchange:1,reset:1,resize:1,select:1,selectstart:1,submit:1,scroll:1,textInput:1,unload:1},e.mix(r.DOM_EVENTS,e.Env.evt.plugins),e.augment(r,e.EventTarget),e.mix(r.prototype,{purge:function(t,n){return e.Event.purgeElement(this._node,t,n),this}}),e.mix(e.NodeList.prototype,{_prepEvtArgs:function(t,n,r){var i=e.Array(arguments,0,!0);return i.length<2?i[2]=this._nodes:i.splice(2,0,this._nodes),i[3]=r||this,i},on:function(t,n,r){return e.on.apply(e,this._prepEvtArgs.apply(this,arguments))},once:function(t,n,r){return e.once.apply(e,this._prepEvtArgs.apply(this,arguments))},after:function(t,n,r){return e.after.apply(e,this._prepEvtArgs.apply(this,arguments))},onceAfter:function(t,n,r){return e.onceAfter.apply(e,this._prepEvtArgs.apply(this,arguments))}}),s.importMethod(e.Node.prototype,["detach","detachAll"]),e.mix(e.Node.ATTRS,{offsetHeight:{setter:function(t){return e.DOM.setHeight(this._node,t),t},getter:function(){return this._node.offsetHeight}},offsetWidth:{setter:function(t){return e.DOM.setWidth(this._node,t),t},getter:function(){return this._node.offsetWidth}}}),e.mix(e.Node.prototype,{sizeTo:function(t,n){var r;arguments.length<2&&(r=e.one(t),t=r.get("offsetWidth"),n=r.get("offsetHeight")),this.setAttrs({offsetWidth:t,offsetHeight:n})}});var r=e.Node;e.mix(r.prototype,{show:function(e){return e=arguments[arguments.length-1],this.toggleView(!0,e),this},_show:function(){this.setStyle("display","")},_isHidden:function(){return e.DOM.getStyle(this._node,"display")==="none"},toggleView:function(e,t){return this._toggleView.apply(this,arguments),this},_toggleView:function(e,t){return t=arguments[arguments.length-1],typeof e!="boolean"&&(e=this._isHidden()?1:0),e?this._show():this._hide(),typeof t=="function"&&t.call(this),this},hide:function(e){return e=arguments[arguments.length-1],this.toggleView(!1,e),this},_hide:function(){this.setStyle("display","none")}}),e.NodeList.importMethod(e.Node.prototype,["show","hide","toggleView"]),e.config.doc.documentElement.hasAttribute||(e.Node.prototype.hasAttribute=function(e){return e==="value"&&this.get("value")!==""?!0:!!this._node.attributes[e]&&!!this._node.attributes[e].specified}),e.Node.prototype.focus=function(){try{this._node.focus()}catch(e){}return this},e.Node.ATTRS.type={setter:function(e){if(e==="hidden")try{this._node.type="hidden"}catch(t){this.setStyle("display","none"),this._inputType="hidden"}else try{this._node.type=e}catch(t){}return e},getter:function(){return this._inputType||this._node.type},_bypassProxy:!0},e.config.doc.createElement("form").elements.nodeType&&(e.Node.ATTRS.elements={getter:function(){return this.all("input, textarea, button, select")}}),e.mix(e.Node.prototype,{_initData:function(){"_data"in this||(this._data={})},getData:function(t){this._initData();var n=this._data,r=n;return arguments.length?t in n?r=n[t]:r=this._getDataAttribute(t):typeof n=="object"&&n!==null&&(r={},e.Object.each(n,function(e,t){r[t]=e}),r=this._getDataAttributes(r)),r},_getDataAttributes:function(e){e=e||{};var t=0,n=this._node.attributes,r=n.length,i=this.DATA_PREFIX,s=i.length,o;while(t<r)o=n[t].name,o.indexOf(i)===0&&(o=o.substr(s),o in e||(e[o]=this._getDataAttribute(o))),t+=1;return e},_getDataAttribute:function(e){var e=this.DATA_PREFIX+e,t=this._node,n=t.attributes,r=n&&n[e]&&n[e].value;return r},setData:function(e,t){return this._initData(),arguments.length>1?this._data[e]=t:this._data=e,this},clearData:function(e){return"_data"in this&&(typeof e!="undefined"?delete this._data[e]:delete this._data),this}}),e.mix(e.NodeList.prototype,{getData:function(e){var t=arguments.length?[e]:[];return this._invoke("getData",t,!0)},setData:function(e,t){var n=arguments.length>1?[e,t]:[e];return this._invoke("setData",n)},clearData:function(e){var t=arguments.length?[e]:[];return this._invoke("clearData",[e])}})},"3.7.3",{requires:["event-base","node-core","dom-base"]}),function(){var e=YUI.Env;e._ready||(e._ready=function(){e.DOMReady=!0,e.remove(YUI.config.doc,"DOMContentLoaded",e._ready)},e.add(YUI.config.doc,"DOMContentLoaded",e._ready))}(),YUI.add("event-base",function(e,t){e.publish("domready",{fireOnce:!0,async:!0}),YUI.Env.DOMReady?e.fire("domready"):e.Do.before(function(){e.fire("domready")},YUI.Env,"_ready");var n=e.UA,r={},i={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9,63272:46,63273:36,63275:35},s=function(t){if(!t)return t;try{t&&3==t.nodeType&&(t=t.parentNode)}catch(n){return null}return e.one(t)},o=function(e,t,n){this._event=e,this._currentTarget=t,this._wrapper=n||r,this.init()};e.extend(o,Object,{init:function(){var e=this._event,t=this._wrapper.overrides,r=e.pageX,o=e.pageY,u,a=this._currentTarget;this.altKey=e.altKey,this.ctrlKey=e.ctrlKey,this.metaKey=e.metaKey,this.shiftKey=e.shiftKey,this.type=t&&t.type||e.type,this.clientX=e.clientX,this.clientY=e.clientY,this.pageX=r,this.pageY=o,u=e.keyCode||e.charCode,n.webkit&&u in i&&(u=i[u]),this.keyCode=u,this.charCode=u,this.which=e.which||e.charCode||u,this.button=this.which,this.target=s(e.target),this.currentTarget=s(a),this.relatedTarget=s(e.relatedTarget);if(e.type=="mousewheel"||e.type=="DOMMouseScroll")this.wheelDelta=e.detail?e.detail*-1:Math.round(e.wheelDelta/80)||(e.wheelDelta<0?-1:1);this._touch&&this._touch(e,a,this._wrapper)},stopPropagation:function(){this._event.stopPropagation(),this._wrapper.stopped=1,this.stopped=1},stopImmediatePropagation:function(){var e=this._event;e.stopImmediatePropagation?e.stopImmediatePropagation():this.stopPropagation(),this._wrapper.stopped=2,this.stopped=2},preventDefault:function(e){var t=this._event;t.preventDefault(),t.returnValue=e||!1,this._wrapper.prevented=1,this.prevented=1},halt:function(e){e?this.stopImmediatePropagation():this.stopPropagation(),this.preventDefault()}}),o.resolve=s,e.DOM2EventFacade=o,e.DOMEventFacade=o,function(){e.Env.evt.dom_wrappers={},e.Env.evt.dom_map={};var t=e.DOM,n=e.Env.evt,r=e.config,i=r.win,s=YUI.Env.add,o=YUI.Env.remove,u=function(){YUI.Env.windowLoaded=!0,e.Event._load(),o(i,"load",u)},a=function(){e.Event._unload()},f="domready",l="~yui|2|compat~",c=function(n){try{return n&&typeof n!="string"&&e.Lang.isNumber(n.length)&&!n.tagName&&!t.isWindow(n)}catch(r){return!1}},h=e.CustomEvent.prototype._delete,p=function(t){var n=h.apply(this,arguments);return this.hasSubs()||e.Event._clean(this),n},d=function(){var r=!1,u=0,h=[],v=n.dom_wrappers,m=null,g=n.dom_map;return{POLL_RETRYS:1e3,POLL_INTERVAL:40,lastError:null,_interval:null,_dri:null,DOMReady:!1,startInterval:function(){d._interval||(d._interval=setInterval(d._poll,d.POLL_INTERVAL))},onAvailable:function(t,n,r,i,s,o){var a=e.Array(t),f,l;for(f=0;f<a.length;f+=1)h.push({id:a[f],fn:n,obj:r,override:i,checkReady:s,compat:o});return u=this.POLL_RETRYS,setTimeout(d._poll,0),l=new e.EventHandle({_delete:function(){if(l.handle){l.handle.detach();return}var e,t;for(e=0;e<a.length;e++)for(t=0;t<h.length;t++)a[e]===h[t].id&&h.splice(t,1)}}),l},onContentReady:function(e,t,n,r,i){return d.onAvailable(e,t,n,r,!0,i)},attach:function(t,n,r,i){return d._attach(e.Array(arguments,0,!0))},_createWrapper:function(t,n,r,o,u){var a,f=e.stamp(t),l="event:"+f+n;return!1===u&&(l+="native"),r&&(l+="capture"),a=v[l],a||(a=e.publish(l,{silent:!0,bubbles:!1,contextFn:function(){return o?a.el:(a.nodeRef=a.nodeRef||e.one(a.el),a.nodeRef)}}),a.overrides={},a.el=t,a.key=l,a.domkey=f,a.type=n,a.fn=function(e){a.fire(d.getEvent(e,t,o||!1===u))},a.capture=r,t==i&&n=="load"&&(a.fireOnce=!0,m=l),a._delete=p,v[l]=a,g[f]=g[f]||{},g[f][l]=a,s(t,n,a.fn,r)),a},_attach:function(n,r){var s,o,u,a,f,h=!1,p,v=n[0],m=n[1],g=n[2]||i,y=r&&r.facade,b=r&&r.capture,w=r&&r.overrides;n[n.length-1]===l&&(s=!0);if(!m||!m.call)return!1;if(c(g))return o=[],e.each(g,function(e,t){n[2]=e,o.push(d._attach(n.slice(),r))}),new e.EventHandle(o);if(e.Lang.isString(g)){if(s)u=t.byId(g);else{u=e.Selector.query(g);switch(u.length){case 0:u=null;break;case 1:u=u[0];break;default:return n[2]=u,d._attach(n,r)}}if(!u)return p=d.onAvailable(g,function(){p.handle=d._attach(n,r)},d,!0,!1,s),p;g=u}return g?(e.Node&&e.instanceOf(g,e.Node)&&(g=e.Node.getDOMNode(g)),a=d._createWrapper(g,v,b,s,y),w&&e.mix(a.overrides,w),g==i&&v=="load"&&YUI.Env.windowLoaded&&(h=!0),s&&n.pop(),f=n[3],p=a._on(m,f,n.length>4?n.slice(4):null),h&&a.fire(),p):!1},detach:function(n,r,i,s){var o=e.Array(arguments,0,!0),u,a,f,h,p,m;o[o.length-1]===l&&(u=!0);if(n&&n.detach)return n.detach();typeof i=="string"&&(u?i=t.byId(i):(i=e.Selector.query(i),a=i.length,a<1?i=null:a==1&&(i=i[0])));if(!i)return!1;if(i.detach)return o.splice(2,1),i.detach.apply(i,o);if(c(i)){f=!0;for(h=0,a=i.length;h<a;++h)o[2]=i[h],f=e.Event.detach.apply(e.Event,o)&&f;return f}return!n||!r||!r.call?d.purgeElement(i,!1,n):(p="event:"+e.stamp(i)+n,m=v[p],m?m.detach(r):!1)},getEvent:function(t,n,r){var s=t||i.event;return r?s:new e.DOMEventFacade(s,n,v["event:"+e.stamp(n)+t.type])},generateId:function(e){return t.generateID(e)},_isValidCollection:c,_load:function(t){r||(r=!0,e.fire&&e.fire(f),d._poll())},_poll:function(){if(d.locked)return;if(e.UA.ie&&!YUI.Env.DOMReady){d.startInterval();return}d.locked=!0;var n,i,s,o,a,f,l=!r;l||(l=u>0),a=[],f=function(t,n){var r,i=n.override;try{n.compat?(n.override?i===!0?r=n.obj:r=i:r=t,n.fn.call(r,n.obj)):(r=n.obj||e.one(t),n.fn.apply(r,e.Lang.isArray(i)?i:[]))}catch(s){}};for(n=0,i=h.length;n<i;++n)s=h[n],s&&!s.checkReady&&(o=s.compat?t.byId(s.id):e.Selector.query(s.id,null,!0),o?(f(o,s),h[n]=null):a.push(s));for(n=0,i=h.length;n<i;++n){s=h[n];if(s&&s.checkReady){o=s.compat?t.byId(s.id):e.Selector.query(s.id,null,!0);if(o){if(r||o.get&&o.get("nextSibling")||o.nextSibling)f(o,s),h[n]=null}else a.push(s)}}u=a.length===0?0:u-1,l?d.startInterval():(clearInterval(d._interval),d._interval=null),d.locked=!1;return},purgeElement:function(t,n,r){var i=e.Lang.isString(t)?e.Selector.query(t,null,!0):t,s=d.getListeners(i,r),o,u,a,f;if(n&&i){s=s||[],a=e.Selector.query("*",i),u=a.length;for(o=0;o<u;++o)f=d.getListeners(a[o],r),f&&(s=s.concat(f))}if(s)for(o=0,u=s.length;o<u;++o)s[o].detachAll()},_clean:function(t){var n=t.key,r=t.domkey;o(t.el,t.type,t.fn,t.capture),delete v[n],delete e._yuievt.events[n],g[r]&&(delete g[r][n],e.Object.size(g[r])||delete g[r])},getListeners:function(t,r){var i=e.stamp(t,!0),s=g[i],o=[],u=r?"event:"+i+r:null,a=n.plugins;return s?(u?(a[r]&&a[r].eventDef&&(u+="_synth"),s[u]&&o.push(s[u]),u+="native",s[u]&&o.push(s[u])):e.each(s,function(e,t){o.push(e)}),o.length?o:null):null},_unload:function(t){e.each(v,function(e,n){e.type=="unload"&&e.fire(t),e.detachAll()}),o(i,"unload",a)},nativeAdd:s,nativeRemove:o}}();e.Event=d,r.injected||YUI.Env.windowLoaded?u():s(i,"load",u),e.UA.ie&&e.on(f,d._poll);try{s(i,"unload",a)}catch(v){}d.Custom=e.CustomEvent,d.Subscriber=e.Subscriber,d.Target=e.EventTarget,d.Handle=e.EventHandle,d.Facade=e.EventFacade,d._poll()}(),e.Env.evt.plugins.available={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onAvailable.call(e.Event,r,n,i,s)}},e.Env.evt.plugins.contentready={on:function(t,n,r,i){var s=arguments.length>4?e.Array(arguments,4,!0):null;return e.Event.onContentReady.call(e.Event,r,n,i,s)}}},"3.7.3",{requires:["event-custom-base"]}),YUI.add("pluginhost-base",function(e,t){function r(){this._plugins={}}var n=e.Lang;r.prototype={plug:function(e,t){var r,i,s;if(n.isArray(e))for(r=0,i=e.length;r<i;r++)this.plug(e[r]);else e&&!n.isFunction(e)&&(t=e.cfg,e=e.fn),e&&e.NS&&(s=e.NS,t=t||{},t.host=this,this.hasPlugin(s)?this[s].setAttrs&&this[s].setAttrs(t):(this[s]=new e(t),this._plugins[s]=e));return this},unplug:function(e){var t=e,r=this._plugins;if(e)n.isFunction(e)&&(t=e.NS,t&&(!r[t]||r[t]!==e)&&(t=null)),t&&(this[t]&&(this[t].destroy&&this[t].destroy(),delete this[t]),r[t]&&delete r[t]);else for(t in this._plugins)this._plugins.hasOwnProperty(t)&&this.unplug(t);return this},hasPlugin:function(e){return this._plugins[e]&&this[e]},_initPlugins:function(e){this._plugins=this._plugins||{},this._initConfigPlugins&&this._initConfigPlugins(e)},_destroyPlugins:function(){this.unplug()}},e.namespace("Plugin").Host=r},"3.7.3",{requires:["yui-base"]}),YUI.add("pluginhost-config",function(e,t){var n=e.Plugin.Host,r=e.Lang;n.prototype._initConfigPlugins=function(t){var n=this._getClasses?this._getClasses():[this.constructor],r=[],i={},s,o,u,a,f;for(o=n.length-1;o>=0;o--)s=n[o],a=s._UNPLUG,a&&e.mix(i,a,!0),u=s._PLUG,u&&e.mix(r,u,!0);for(f in r)r.hasOwnProperty(f)&&(i[f]||this.plug(r[f]));t&&t.plugins&&this.plug(t.plugins)},n.plug=function(t,n,i){var s,o,u,a;if(t!==e.Base){t._PLUG=t._PLUG||{},r.isArray(n)||(i&&(n={fn:n,cfg:i}),n=[n]);for(o=0,u=n.length;o<u;o++)s=n[o],a=s.NAME||s.fn.NAME,t._PLUG[a]=s}},n.unplug=function(t,n){var i,s,o,u;if(t!==e.Base){t._UNPLUG=t._UNPLUG||{},r.isArray(n)||(n=[n]);for(s=0,o=n.length;s<o;s++)i=n[s],u=i.NAME,t._PLUG[u]?delete t._PLUG[u]:t._UNPLUG[u]=i}}},"3.7.3",{requires:["pluginhost-base"]}),YUI.add("event-delegate",function(e,t){function f(t,r,u,l){var c=n(arguments,0,!0),h=i(u)?u:null,p,d,v,m,g,y,b,w,E;if(s(t)){w=[];if(o(t))for(y=0,b=t.length;y<b;++y)c[0]=t[y],w.push(e.delegate.apply(e,c));else{c.unshift(null);for(y in t)t.hasOwnProperty(y)&&(c[0]=y,c[1]=t[y],w.push(e.delegate.apply(e,c)))}return new e.EventHandle(w)}p=t.split(/\|/),p.length>1&&(g=p.shift(),c[0]=t=p.shift()),d=e.Node.DOM_EVENTS[t],s(d)&&d.delegate&&(E=d.delegate.apply(d,arguments));if(!E){if(!t||!r||!u||!l)return;v=h?e.Selector.query(h,null,!0):u,!v&&i(u)&&(E=e.on("available",function(){e.mix(E,e.delegate.apply(e,c),!0)},u)),!E&&v&&(c.splice(2,2,v),E=e.Event._attach(c,{facade:!1}),E.sub.filter=l,E.sub._notify=f.notifySub)}return E&&g&&(m=a[g]||(a[g]={}),m=m[t]||(m[t]=[]),m.push(E)),E}var n=e.Array,r=e.Lang,i=r.isString,s=r.isObject,o=r.isArray,u=e.Selector.test,a=e.Env.evt.handles;f.notifySub=function(t,r,i){r=r.slice(),this.args&&r.push.apply(r,this.args);var s=f._applyFilter(this.filter,r,i),o,u,a,l;if(s){s=n(s),o=r[0]=new e.DOMEventFacade(r[0],i.el,i),o.container=e.one(i.el);for(u=0,a=s.length;u<a&&!o.stopped;++u){o.currentTarget=e.one(s[u]),l=this.fn.apply(this.context||o.currentTarget,r);if(l===!1)break}return l}},f.compileFilter=e.cached(function(e){return function(t,n){return u(t._node,e,n.currentTarget===n.target?null:n.currentTarget._node)}}),f._applyFilter=function(t,n,r){var s=n[0],o=r.el,a=s.target||s.srcElement,f=[],l=!1;a.nodeType===3&&(a=a.parentNode),n.unshift(a);if(i(t))while(a){l=a===o,u(a,t,l?null:o)&&f.push(a);if(l)break;a=a.parentNode}else{n[0]=e.one(a),n[1]=new e.DOMEventFacade(s,o,r);while(a){t.apply(n[0],n)&&f.push(a);if(a===o)break;a=a.parentNode,n[0]=e.one(a)}n[1]=s}return f.length<=1&&(f=f[0]),n.shift(),f},e.delegate=e.Event.delegate=f},"3.7.3",{requires:["node-base"]}),YUI.add("node-event-delegate",function(e,t){e.Node.prototype.delegate=function(t){var n=e.Array(arguments,0,!0),r=e.Lang.isObject(t)&&!e.Lang.isArray(t)?1:2;return n.splice(r,0,this._node),e.delegate.apply(e,n)}},"3.7.3",{requires:["node-base","event-delegate"]}),YUI.add("node-pluginhost",function(e,t){e.Node.plug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.plug.apply(e.Base,t),e.Node},e.Node.unplug=function(){var t=e.Array(arguments);return t.unshift(e.Node),e.Plugin.Host.unplug.apply(e.Base,t),e.Node},e.mix(e.Node,e.Plugin.Host,!1,null,1),e.NodeList.prototype.plug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.plug.apply(e.one(n),t)}),this},e.NodeList.prototype.unplug=function(){var t=arguments;return e.NodeList.each(this,function(n){e.Node.prototype.unplug.apply(e.one(n),t)}),this}},"3.7.3",{requires:["node-base","pluginhost"]}),YUI.add("node-screen",function(e,t){e.each(["winWidth","winHeight","docWidth","docHeight","docScrollX","docScrollY"],function(t){e.Node.ATTRS[t]={getter:function(){var n=Array.prototype.slice.call(arguments);return n.unshift(e.Node.getDOMNode(this)),e.DOM[t].apply(this,n)}}}),e.Node.ATTRS.scrollLeft={getter:function(){var t=e.Node.getDOMNode(this);return"scrollLeft"in t?t.scrollLeft:e.DOM.docScrollX(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollLeft"in n?n.scrollLeft=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(t,e.DOM.docScrollY(n)))}},e.Node.ATTRS.scrollTop={getter:function(){var t=e.Node.getDOMNode(this);return"scrollTop"in t?t.scrollTop:e.DOM.docScrollY(t)},setter:function(t){var n=e.Node.getDOMNode(this);n&&("scrollTop"in n?n.scrollTop=t:(n.document||n.nodeType===9)&&e.DOM._getWin(n).scrollTo(e.DOM.docScrollX(n),t))}},e.Node.importMethod(e.DOM,["getXY","setXY","getX","setX","getY","setY","swapXY"]),e.Node.ATTRS.region={getter:function(){var t=this.getDOMNode(),n;return t&&!t.tagName&&t.nodeType===9&&(t=t.documentElement),e.DOM.isWindow(t)?n=e.DOM.viewportRegion(t):n=e.DOM.region(t),n}},e.Node.ATTRS.viewportRegion={getter:function(){return e.DOM.viewportRegion(e.Node.getDOMNode(this))}},e.Node.importMethod(e.DOM,"inViewportRegion"),e.Node.prototype.intersect=function(t,n){var r=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.intersect(r,t,n)},e.Node.prototype.inRegion=function(t,n,r){var i=e.Node.getDOMNode(this);return e.instanceOf(t,e.Node)&&(t=e.Node.getDOMNode(t)),e.DOM.inRegion(i,t,n,r)}},"3.7.3",{requires:["dom-screen","node-base"]}),YUI.add("node-style",function(e,t){(function(e){e.mix(e.Node.prototype,{setStyle:function(t,n){return e.DOM.setStyle(this._node,t,n),this},setStyles:function(t){return e.DOM.setStyles(this._node,t),this},getStyle:function(t){return e.DOM.getStyle(this._node,t)},getComputedStyle:function(t){return e.DOM.getComputedStyle(this._node,t)}}),e.NodeList.importMethod(e.Node.prototype,["getStyle","getComputedStyle","setStyle","setStyles"])})(e)},"3.7.3",{requires:["dom-style","node-base"]}),YUI.add("querystring-stringify-simple",function(e,t){var n=e.namespace("QueryString"),r=encodeURIComponent;n.stringify=function(t,n){var i=[],s=n&&n.arrayKey?!0:!1,o,u,a;for(o in t)if(t.hasOwnProperty(o))if(e.Lang.isArray(t[o]))for(u=0,a=t[o].length;u<a;u++)i.push(r(s?o+"[]":o)+"="+r(t[o][u]));else i.push(r(o)+"="+r(t[o]));return i.join("&")}},"3.7.3",{requires:["yui-base"]}),YUI.add("io-base",function(e,t){function o(t){var n=this;n._uid="io:"+s++,n._init(t),e.io._map[n._uid]=n}var n=["start","complete","end","success","failure","progress"],r=["status","statusText","responseText","responseXML"],i=e.config.win,s=0;o.prototype={_id:0,_headers:{"X-Requested-With":"XMLHttpRequest"},_timeout:{},_init:function(t){var r=this,i,s;r.cfg=t||{},e.augment(r,e.EventTarget);for(i=0,s=n.length;i<s;++i)r.publish("io:"+n[i],e.merge({broadcast:1},t)),r.publish("io-trn:"+n[i],t)},_create:function(t,n){var r=this,s={id:e.Lang.isNumber(n)?n:r._id++,uid:r._uid},o=t.xdr?t.xdr.use:null,u=t.form&&t.form.upload?"iframe":null,a;return o==="native"&&(o=e.UA.ie&&!l?"xdr":null,r.setHeader("X-Requested-With")),a=o||u,s=a?e.merge(e.IO.customTransport(a),s):e.merge(e.IO.defaultTransport(),s),s.notify&&(t.notify=function(e,t,n){r.notify(e,t,n)}),a||i&&i.FormData&&t.data instanceof i.FormData&&(s.c.upload.onprogress=function(e){r.progress(s,e,t)},s.c.onload=function(e){r.load(s,e,t)},s.c.onerror=function(e){r.error(s,e,t)},s.upload=!0),s},_destroy:function(t){i&&!t.notify&&!t.xdr&&(u&&!t.upload?t.c.onreadystatechange=null:t.upload?(t.c.upload.onprogress=null,t.c.onload=null,t.c.onerror=null):e.UA.ie&&!t.e&&t.c.abort()),t=t.c=null},_evt:function(t,r,i){var s=this,o,u=i.arguments,a=s.cfg.emitFacade,f="io:"+t,l="io-trn:"+t;this.detach(l),r.e&&(r.c={status:0,statusText:r.e}),o=[a?{id:r.id,data:r.c,cfg:i,arguments:u}:r.id],a||(t===n[0]||t===n[2]?u&&o.push(u):(r.evt?o.push(r.evt):o.push(r.c),u&&o.push(u))),o.unshift(f),s.fire.apply(s,o),i.on&&(o[0]=l,s.once(l,i.on[t],i.context||e),s.fire.apply(s,o))},start:function(e,t){this._evt(n[0],e,t)},complete:function(e,t){this._evt(n[1],e,t)},end:function(e,t){this._evt(n[2],e,t),this._destroy(e)},success:function(e,t){this._evt(n[3],e,t),this.end(e,t)},failure:function(e,t){this._evt(n[4],e,t),this.end(e,t)},progress:function(e,t,r){e.evt=t,this._evt(n[5],e,r)},load:function(e,t,r){e.evt=t.target,this._evt(n[1],e,r)},error:function(e,t,r){e.evt=t,this._evt(n[4],e,r)},_retry:function(e,t,n){return this._destroy(e),n.xdr.use="flash",this.send(t,n,e.id)},_concat:function(e,t){return e+=(e.indexOf("?")===-1?"?":"&")+t,e},setHeader:function(e,t){t?this._headers[e]=t:delete this._headers[e]},_setHeaders:function(t,n){n=e.merge(this._headers,n),e.Object.each(n,function(e,r){e!=="disable"&&t.setRequestHeader(r,n[r])})},_startTimeout:function(e,t){var n=this;n._timeout[e.id]=setTimeout(function(){n._abort(e,"timeout")},t)},_clearTimeout:function(e){clearTimeout(this._timeout[e]),delete this._timeout[e]},_result:function(e,t){var n;try{n=e.c.status}catch(r){n=0}n>=200&&n<300||n===304||n===1223?this.success(e,t):this.failure(e,t)},_rS:function(e,t){var n=this;e.c.readyState===4&&(t.timeout&&n._clearTimeout(e.id),setTimeout(function(){n.complete(e,t),n._result(e,t)},0))},_abort:function(e,t){e&&e.c&&(e.e=t,e.c.abort())},send:function(t,n,i){var s,o,u,a,f,c,h=this,p=t,d={};n=n?e.Object(n):{},s=h._create(n,i),o=n.method?n.method.toUpperCase():"GET",f=n.sync,c=n.data,e.Lang.isObject(c)&&!c.nodeType&&!s.upload&&(c=e.QueryString.stringify(c));if(n.form){if(n.form.upload)return h.upload(s,t,n);c=h._serialize(n.form,c)}if(c)switch(o){case"GET":case"HEAD":case"DELETE":p=h._concat(p,c),c="";break;case"POST":case"PUT":n.headers=e.merge({"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},n.headers)}if(s.xdr)return h.xdr(p,s,n);if(s.notify)return s.c.send(s,t,n);!f&&!s.upload&&(s.c.onreadystatechange=function(){h._rS(s,n)});try{s.c.open(o,p,!f,n.username||null,n.password||null),h._setHeaders(s.c,n.headers||{}),h.start(s,n),n.xdr&&n.xdr.credentials&&l&&(s.c.withCredentials=!0),s.c.send(c);if(f){for(u=0,a=r.length;u<a;++u)d[r[u]]=s.c[r[u]];return d.getAllResponseHeaders=function(){return s.c.getAllResponseHeaders()},d.getResponseHeader=function(e){return s.c.getResponseHeader(e)},h.complete(s,n),h._result(s,n),d}}catch(v){if(s.xdr)return h._retry(s,t,n);h.complete(s,n),h._result(s,n)}return n.timeout&&h._startTimeout(s,n.timeout),{id:s.id,abort:function(){return s.c?h._abort(s,"abort"):!1},isInProgress:function(){return s.c?s.c.readyState%4:!1},io:h}}},e.io=function(t,n){var r=e.io._map["io:0"]||new o;return r.send.apply(r,[t,n])},e.io.header=function(t,n){var r=e.io._map["io:0"]||new o;r.setHeader(t,n)},e.IO=o,e.io._map={};var u=i&&i.XMLHttpRequest,a=i&&i.XDomainRequest,f=i&&i.ActiveXObject,l=u&&"withCredentials"in new XMLHttpRequest;e.mix(e.IO,{_default:"xhr",defaultTransport:function(t){if(!t){var n={c:e.IO.transports[e.IO._default](),notify:e.IO._default==="xhr"?!1:!0};return n}e.IO._default=t},transports:{xhr:function(){return u?new XMLHttpRequest:f?new ActiveXObject("Microsoft.XMLHTTP"):null},xdr:function(){return a?new XDomainRequest:null},iframe:function(){return{}},flash:null,nodejs:null},customTransport:function(t){var n={c:e.IO.transports[t]()};return n[t==="xdr"||t==="flash"?"xdr":"notify"]=!0,n}}),e.mix(e.IO.prototype,{notify:function(e,t,n){var r=this;switch(e){case"timeout":case"abort":case"transport error":t.c={status:0,statusText:e},e="failure";default:r[e].apply(r,[t,n])}}})},"3.7.3",{requires:["event-custom-base","querystring-stringify-simple"]}),YUI.add("json-parse",function(Y,NAME){function fromGlobal(e){var t=typeof global=="object"?global:undefined;return(Y.UA.nodejs&&t?t:Y.config.win||{})[e]}function workingNative(e,t){return e==="ok"?!0:t}var _JSON=fromGlobal("JSON"),Native=Object.prototype.toString.call(_JSON)==="[object JSON]"&&_JSON,useNative=!!Native,_UNICODE_EXCEPTIONS=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_ESCAPES=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,_VALUES=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,_BRACKETS=/(?:^|:|,)(?:\s*\[)+/g,_UNSAFE=/[^\],:{}\s]/,_escapeException=function(e){return"\\u"+("0000"+(+e.charCodeAt(0)).toString(16)).slice(-4)},_revive=function(e,t){var n=function(e,r){var i,s,o=e[r];if(o&&typeof o=="object")for(i in o)o.hasOwnProperty(i)&&(s=n(o,i),s===undefined?delete o[i]:o[i]=s);return t.call(e,r,o)};return typeof t=="function"?n({"":e},""):e},_parse=function(s,reviver){s=s.replace(_UNICODE_EXCEPTIONS,_escapeException);if(!_UNSAFE.test(s.replace(_ESCAPES,"@").replace(_VALUES,"]").replace(_BRACKETS,"")))return _revive(eval("("+s+")"),reviver);throw new SyntaxError("JSON.parse")};Y.namespace("JSON").parse=function(e,t){return typeof e!="string"&&(e+=""),Native&&Y.JSON.useNativeParse?Native.parse(e,t):_parse(e,t)};if(Native)try{useNative=Native.parse('{"ok":false}',workingNative).ok}catch(e){useNative=!1}Y.JSON.useNativeParse=useNative},"3.7.3",{requires:["yui-base"]}),YUI.add("transition",function(e,t){var n="",r="",i=e.config.doc,s="documentElement",o="transition",u="transition",a="transitionProperty",f="transform",l,c,h,p,d,v,m={},g=["Webkit","Moz"],y={Webkit:"webkitTransitionEnd"},b=function(){this.init.apply(this,arguments)};b._toCamel=function(e){return e=e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()}),e},b._toHyphen=function(e){return e=e.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(e,t,n,r){var i=(t?"-"+t.toLowerCase():"")+n;return r&&(i+="-"+r.toLowerCase()),i}),e},b.SHOW_TRANSITION="fadeIn",b.HIDE_TRANSITION="fadeOut",b.useNative=!1,"transition"in i[s].style?(b.useNative=!0,b.supported=!0):e.Array.each(g,function(e){var t=e+"Transition";t in i[s].style&&(n=e,r=b._toHyphen(e)+"-",b.useNative=!0,b.supported=!0,b._VENDOR_PREFIX=e)}),n&&(u=n+"Transition",a=n+"TransitionProperty",f=n+"Transform"),l=r+"transition-property",c=r+"transition-duration",h=r+"transition-timing-function",p=r+"transition-delay",d="transitionend",v="on"+n.toLowerCase()+"transitionend",d=y[n]||d,b.fx={},b.toggles={},b._hasEnd={},b._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i,e.Node.DOM_EVENTS[d]=1,b.NAME="transition",b.DEFAULT_EASING="ease",b.DEFAULT_DURATION=.5,b.DEFAULT_DELAY=0,b._nodeAttrs={},b.prototype={constructor:b,init:function(e,t){var n=this;return n._node=e,!n._running&&t&&(n._config=t,e._transition=n,n._duration="duration"in t?t.duration:n.constructor.DEFAULT_DURATION,n._delay="delay"in t?t.delay:n.constructor.DEFAULT_DELAY,n._easing=t.easing||n.constructor.DEFAULT_EASING,n._count=0,n._running=!1),n},addProperty:function(t,n){var r=this,i=this._node,s=e.stamp(i),o=e.one(i),u=b._nodeAttrs[s],a,f,l,c,h;u||(u=b._nodeAttrs[s]={}),c=u[t],n&&n.value!==undefined?h=n.value:n!==undefined&&(h=n,n=m),typeof h=="function"&&(h=h.call(o,o)),c&&c.transition&&c.transition!==r&&c.transition._count--,r._count++,l=(typeof n.duration!="undefined"?n.duration:r._duration)||1e-4,u[t]={value:h,duration:l,delay:typeof n.delay!="undefined"?n.delay:r._delay,easing:n.easing||r._easing,transition:r},a=e.DOM.getComputedStyle(i,t),f=typeof h=="string"?a:parseFloat(a),b.useNative&&f===h&&setTimeout(function(){r._onNativeEnd.call(i,{propertyName:t,elapsedTime:l})},l*1e3)},removeProperty:function(t){var n=this,r=b._nodeAttrs[e.stamp(n._node)];r&&r[t]&&(delete r[t],n._count--)},initAttrs:function(t){var n,r=this._node;t.transform&&!t[f]&&(t[f]=t.transform,delete t.transform);for(n in t)t.hasOwnProperty(n)&&!b._reKeywords.test(n)&&(this.addProperty(n,t[n]),r.style[n]===""&&e.DOM.setStyle(r,n,e.DOM.getComputedStyle(r,n)))},run:function(t){var n=this,r=n._node,i=n._config,s={type:"transition:start",config:i};return n._running||(n._running=!0,i.on&&i.on.start&&i.on.start.call(e.one(r),s),n.initAttrs(n._config),n._callback=t,n._start()),n},_start:function(){this._runNative()},_prepDur:function(e){return e=parseFloat(e),e+"s"},_runNative:function(t){var n=this,r=n._node,i=e.stamp(r),s=r.style,o=r.ownerDocument.defaultView.getComputedStyle(r),u=b._nodeAttrs[i],a="",f=o[b._toCamel(l)],v=l+": ",m=c+": ",g=h+": ",y=p+": ",w,E,S;f!=="all"&&(v+=f+",",m+=o[b._toCamel(c)]+",",g+=o[b._toCamel(h)]+",",y+=o[b._toCamel(p)]+",");for(S in u)w=b._toHyphen(S),E=u[S],(E=u[S])&&E.transition===n&&(S in r.style?(m+=n._prepDur(E.duration)+",",y+=n._prepDur(E.delay)+",",g+=E.easing+",",v+=w+",",a+=w+": "+E.value+"; "):this.removeProperty(S));v=v.replace(/,$/,";"),m=m.replace(/,$/,";"),g=g.replace(/,$/,";"),y=y.replace(/,$/,";"),b._hasEnd[i]||(r.addEventListener(d,n._onNativeEnd,""),b._hasEnd[i]=!0),s.cssText+=v+m+g+y+a},_end:function(t){var n=this,r=n._node,i=n._callback,s=n._config,o={type:"transition:end",config:s,elapsedTime:t},u=e.one(r);n._running=!1,n._callback=null,r&&(s.on&&s.on.end?setTimeout(function(){s.on.end.call(u,o),i&&i.call(u,o)},1):i&&setTimeout(function(){i.call(u,o)},1))},_endNative:function(e){var t=this._node,n=t.ownerDocument.defaultView.getComputedStyle(t,"")[b._toCamel(l)];e=b._toHyphen(e),typeof n=="string"&&(n=n.replace(new RegExp("(?:^|,\\s)"+e+",?"),","),n=n.replace(/^,|,$/,""),t.style[u]=n)},_onNativeEnd:function(t){var n=this,r=e.stamp(n),i=t,s=b._toCamel(i.propertyName),o=i.elapsedTime,u=b._nodeAttrs[r],f=u[s],l=f?f.transition:null,c,h;l&&(l.removeProperty(s),l._endNative(s),h=l._config[s],c={type:"propertyEnd",propertyName:s,elapsedTime:o,config:h},h&&h.on&&h.on.end&&h.on.end.call(e.one(n),c),l._count<=0&&(l._end(o),n.style[a]=""))},destroy:function(){var e=this,t=e._node;t&&(t.removeEventListener(d,e._onNativeEnd,!1),e._node=null)}},e.Transition=b,e.TransitionNative=b,e.Node.prototype.transition=function(t,n,r){var i=b._nodeAttrs[e.stamp(this._node)],s=i?i.transition||null:null,o,u;if(typeof t=="string"){typeof n=="function"&&(r=n,n=null),o=b.fx[t];if(n&&typeof n!="boolean"){n=e.clone(n);for(u in o)o.hasOwnProperty(u)&&(u in n||(n[u]=o[u]))}else n=o}else r=n,n=t;return s&&!s._running?s.init(this,n):s=new b(this._node,n),s.run(r),this},e.Node.prototype.show=function(t,n,r){return this._show(),t&&e.Transition&&(typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.SHOW_TRANSITION),this.transition(t,n,r)),this};var w=function(e,t,n){return function(){t&&t.call(e),n&&n.apply(e._node,arguments)}};e.Node.prototype.hide=function(t,n,r){return t&&e.Transition?(typeof n=="function"&&(r=n,n=null),r=w(this,this._hide,r),typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.HIDE_TRANSITION),this.transition(t,n,r)):this._hide(),this},e.NodeList.prototype.transition=function(t,n){var r=this._nodes,i=0,s;while(s=r[i++])e.one(s).transition(t,n);return this},e.Node.prototype.toggleView=function(t,n,r){return this._toggles=this._toggles||[],r=arguments[arguments.length-1],typeof t=="boolean"&&(n=t,t=null),t=t||e.Transition.DEFAULT_TOGGLE,typeof n=="undefined"&&t in this._toggles&&(n=!this._toggles[t]),n=n?1:0,n?this._show():r=w(this,this._hide,r),this._toggles[t]=n,this.transition(e.Transition.toggles[t][n],r),this},e.NodeList.prototype.toggleView=function(t,n,r){var i=this._nodes,s=0,o;while(o=i[s++])e.one(o).toggleView(t,n,r);return this},e.mix(b.fx,{fadeOut:{opacity:0,duration:.5,easing:"ease-out"},fadeIn:{opacity:1,duration:.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:.75,easing:"ease-out"},sizeIn:{height:function(e){return e.get("scrollHeight")+"px"},width:function(e){return e.get("scrollWidth")+"px"},duration:.5,easing:"ease-in",on:{start:function(){var e=this.getStyle("overflow");e!=="hidden"&&(this.setStyle("overflow","hidden"),this._transitionOverflow=e)},end:function(){this._transitionOverflow&&(this.setStyle("overflow",this._transitionOverflow),delete this._transitionOverflow)}}}}),e.mix(b.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]}),b.DEFAULT_TOGGLE="fade"},"3.7.3",{requires:["node-style"]}),YUI.add("selector-css2",function(e,t){var n="parentNode",r="tagName",i="attributes",s="combinator",o="pseudos",u=e.Selector,a={_reRegExpTokens:/([\^\$\?\[\]\*\+\-\.\(\)\|\\])/,SORT_RESULTS:!0,_isXML:function(){var t=e.config.doc.createElement("div").tagName!=="DIV";return t}(),shorthand:{"\\#(-?[_a-z0-9]+[-\\w\\uE000]*)":"[id=$1]","\\.(-?[_a-z]+[-\\w\\uE000]*)":"[className~=$1]"},operators:{"":function(t,n){return e.DOM.getAttribute(t,n)!==""},"~=":"(?:^|\\s+){val}(?:\\s+|$)","|=":"^{val}-?"},pseudos:{"first-child":function(t){return e.DOM._children(t[n])[0]===t}},_bruteQuery:function(t,n,r){var i=[],s=[],o=u._tokenize(t),a=o[o.length-1],f=e.DOM._getDoc(n),l,c,h,p;if(a){c=a.id,h=a.className,p=a.tagName||"*";if(n.getElementsByTagName)c&&(n.all||n.nodeType===9||e.DOM.inDoc(n))?s=e.DOM.allById(c,n):h?s=n.getElementsByClassName(h):s=n.getElementsByTagName(p);else{l=n.firstChild;while(l)l.tagName&&(p==="*"||l.tagName===p)&&s.push(l),l=l.nextSibling||l.firstChild}s.length&&(i=u._filterNodes(s,o,r))}return i},_filterNodes:function(t,n,r){var i=0,s,o=n.length,a=o-1,f=[],l=t[0],c=l,h=e.Selector.getters,p,d,v,m,g,y,b,w;for(i=0;c=l=t[i++];){a=o-1,m=null;e:while(c&&c.tagName){v=n[a],b=v.tests,s=b.length;if(s&&!g)while(w=b[--s]){p=w[1],h[w[0]]?y=h[w[0]](c,w[0]):(y=c[w[0]],w[0]==="tagName"&&!u._isXML&&(y=y.toUpperCase()),typeof y!="string"&&y!==undefined&&y.toString?y=y.toString():y===undefined&&c.getAttribute&&(y=c.getAttribute(w[0],2)));if(p==="="&&y!==w[2]||typeof p!="string"&&p.test&&!p.test(y)||!p.test&&typeof p=="function"&&!p(c,w[0],w[2])){if(c=c[m])while(c&&(!c.tagName||v.tagName&&v.tagName!==c.tagName))c=c[m];continue e}}a--;if(!!g||!(d=v.combinator)){f.push(l);if(r)return f;break}m=d.axis,c=c[m];while(c&&!c.tagName)c=c[m];d.direct&&(m=null)}}return l=c=null,f},combinators:{" ":{axis:"parentNode"},">":{axis:"parentNode",direct:!0},"+":{axis:"previousSibling",direct:!0}},_parsers:[{name:i,re:/^\uE003(-?[a-z]+[\w\-]*)+([~\|\^\$\*!=]=?)?['"]?([^\uE004'"]*)['"]?\uE004/i,fn:function(t,n){var r=t[2]||"",i=u.operators,s=t[3]?t[3].replace(/\\/g,""):"",o;if(t[1]==="id"&&r==="="||t[1]==="className"&&e.config.doc.documentElement.getElementsByClassName&&(r==="~="||r==="="))n.prefilter=t[1],t[3]=s,n[t[1]]=t[1]==="id"?t[3]:s;r in i&&(o=i[r],typeof o=="string"&&(t[3]=s.replace(u._reRegExpTokens,"\\$1"),o=new RegExp(o.replace("{val}",t[3]))),t[2]=o);if(!n.last||n.prefilter!==t[1])return t.slice(1)}},{name:r,re:/^((?:-?[_a-z]+[\w-]*)|\*)/i,fn:function(e,t){var n=e[1];u._isXML||(n=n.toUpperCase()),t.tagName=n;if(n!=="*"&&(!t.last||t.prefilter))return[r,"=",n];t.prefilter||(t.prefilter="tagName")}},{name:s,re:/^\s*([>+~]|\s)\s*/,fn:function(e,t){}},{name:o,re:/^:([\-\w]+)(?:\uE005['"]?([^\uE005]*)['"]?\uE006)*/i,fn:function(e,t){var n=u[o][e[1]];return n?(e[2]&&(e[2]=e[2].replace(/\\/g,"")),[e[2],n]):!1}}],_getToken:function(e){return{tagName:null,id:null,className:null,attributes:{},combinator:null,tests:[]}},_tokenize:function(t){t=t||"",t=u._parseSelector(e.Lang.trim(t));var n=u._getToken(),r=t,i=[],o=!1,a,f,l,c;e:do{o=!1;for(l=0;c=u._parsers[l++];)if(a=c.re.exec(t)){c.name!==s&&(n.selector=t),t=t.replace(a[0],""),t.length||(n.last=!0),u._attrFilters[a[1]]&&(a[1]=u._attrFilters[a[1]]),f=c.fn(a,n);if(f===!1){o=!1;break e}f&&n.tests.push(f);if(!t.length||c.name===s)i.push(n),n=u._getToken(n),c.name===s&&(n.combinator=e.Selector.combinators[a[1]]);o=!0}}while(o&&t.length);if(!o||t.length)i=[];return i},_replaceMarkers:function(e){return e=e.replace(/\[/g,"\ue003"),e=e.replace(/\]/g,"\ue004"),e=e.replace(/\(/g,"\ue005"),e=e.replace(/\)/g,"\ue006"),e},_replaceShorthand:function(t){var n=e.Selector.shorthand,r;for(r in n)n.hasOwnProperty(r)&&(t=t.replace(new RegExp(r,"gi"),n[r]));return t},_parseSelector:function(t){var n=e.Selector._replaceSelector(t),t=n.selector;return t=e.Selector._replaceShorthand(t),t=e.Selector._restore("attr",t,n.attrs),t=e.Selector._restore("pseudo",t,n.pseudos),t=e.Selector._replaceMarkers(t),t=e.Selector._restore("esc",t,n.esc),t},_attrFilters:{"class":"className","for":"htmlFor"},getters:{href:function(t,n){return e.DOM.getAttribute(t,n)},id:function(t,n){return e.DOM.getId(t)}}};e.mix(e.Selector,a,!0),e.Selector.getters.src=e.Selector.getters.rel=e.Selector.getters.href,e.Selector.useNative&&e.config.doc.querySelector&&(e.Selector.shorthand["\\.(-?[_a-z]+[-\\w]*)"]="[class~=$1]")},"3.7.3",{requires:["selector-native"]}),YUI.add("selector-css3",function(e,t){e.Selector._reNth=/^(?:([\-]?\d*)(n){1}|(odd|even)$)*([\-+]?\d*)$/,e.Selector._getNth=function(t,n,r,i){e.Selector._reNth.test(n);var s=parseInt(RegExp.$1,10),o=RegExp.$2,u=RegExp.$3,a=parseInt(RegExp.$4,10)||0,f=[],l=e.DOM._children(t.parentNode,r),c;u?(s=2,c="+",o="n",a=u==="odd"?1:0):isNaN(s)&&(s=o?1:0);if(s===0)return i&&(a=l.length-a+1),l[a-1]===t?!0:!1;s<0&&(i=!!i,s=Math.abs(s));if(!i){for(var h=a-1,p=l.length;h<p;h+=s)if(h>=0&&l[h]===t)return!0}else for(var h=l.length-a,p=l.length;h>=0;h-=s)if(h<p&&l[h]===t)return!0;return!1},e.mix(e.Selector.pseudos,{root:function(e){return e===e.ownerDocument.documentElement},"nth-child":function(t,n){return e.Selector._getNth(t,n)},"nth-last-child":function(t,n){return e.Selector._getNth(t,n,null,!0)},"nth-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName)},"nth-last-of-type":function(t,n){return e.Selector._getNth(t,n,t.tagName,!0)},"last-child":function(t){var n=e.DOM._children(t.parentNode);return n[n.length-1]===t},"first-of-type":function(t){return e.DOM._children(t.parentNode,t.tagName)[0]===t},"last-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n[n.length-1]===t},"only-child":function(t){var n=e.DOM._children(t.parentNode);return n.length===1&&n[0]===t},"only-of-type":function(t){var n=e.DOM._children(t.parentNode,t.tagName);return n.length===1&&n[0]===t},empty:function(e){return e.childNodes.length===0},not:function(t,n){return!e.Selector.test(t,n)},contains:function(e,t){var n=e.innerText||e.textContent||"";return n.indexOf(t)>-1},checked:function(e){return e.checked===!0||e.selected===!0},enabled:function(e){return e.disabled!==undefined&&!e.disabled},disabled:function(e){return e.disabled}}),e.mix(e.Selector.operators,{"^=":"^{val}","$=":"{val}$","*=":"{val}"}),e.Selector.combinators["~"]={axis:"previousSibling"}},"3.7.3",{requires:["selector-native","selector-css2"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.3",{requires:["yui-base"]}),YUI.add("dump",function(e,t){var n=e.Lang,r="{...}",i="f(){...}",s=", ",o=" => ",u=function(e,t){var u,a,f=[],l=n.type(e);if(!n.isObject(e))return e+"";if(l=="date")return e;if(e.nodeType&&e.tagName)return e.tagName+"#"+e.id;if(e.document&&e.navigator)return"window";if(e.location&&e.body)return"document";if(l=="function")return i;t=n.isNumber(t)?t:3;if(l=="array"){f.push("[");for(u=0,a=e.length;u<a;u+=1)n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s);f.length>1&&f.pop(),f.push("]")}else if(l=="regexp")f.push(e.toString());else{f.push("{");for(u in e)if(e.hasOwnProperty(u))try{f.push(u+o),n.isObject(e[u])?f.push(t>0?n.dump(e[u],t-1):r):f.push(e[u]),f.push(s)}catch(c){f.push("Error: "+c.message)}f.length>1&&f.pop(),f.push("}")}return f.join("")};e.dump=u,n.dump=u},"3.7.3",{requires:["yui-base"]}),YUI.add("transition-timer",function(e,t){var n=e.Transition;e.mix(n.prototype,{_start:function(){n.useNative?this._runNative():this._runTimer()},_runTimer:function(){var t=this;t._initAttrs(),n._running[e.stamp(t)]=t,t._startTime=new Date,n._startTimer()},_endTimer:function(){var t=this;delete n._running[e.stamp(t)],t._startTime=null},_runFrame:function(){var e=new Date-this._startTime;this._runAttrs(e)},_runAttrs:function(t){var r=this,i=r._node,s=r._config,o=e.stamp(i),u=n._nodeAttrs[o],a=n.behaviors,f=!1,l=!1,c,h,p,d,v,m,g,y,b;for(h in u)if((p=u[h])&&p.transition===r){g=p.duration,m=p.delay,v=(t-m)/1e3,y=t,c={type:"propertyEnd",propertyName:h,config:s,elapsedTime:v},d=b in a&&"set"in a[b]?a[b].set:n.DEFAULT_SETTER,f=y>=g,y>g&&(y=g);if(!m||t>=m)d(r,h,p.from,p.to,y-m,g-m,p.easing,p.unit),f&&(delete u[h],r._count--,s[h]&&s[h].on&&s[h].on.end&&s[h].on.end.call(e.one(i),c),!l&&r._count<=0&&(l=!0,r._end(v),r._endTimer()))}},_initAttrs:function(){var t=this,r=n.behaviors,i=e.stamp(t._node),s=n._nodeAttrs[i],o,u,a,f,l,c,h,p,d,v,m;for(c in s)(o=s[c])&&o.transition===t&&(u=o.duration*1e3,a=o.delay*1e3,f=o.easing,l=o.value,c in t._node.style||c in e.DOM.CUSTOM_STYLES?(v=c in r&&"get"in r[c]?r[c].get(t,c):n.DEFAULT_GETTER(t,c),p=n.RE_UNITS.exec(v),h=n.RE_UNITS.exec(l),v=p?p[1]:v,m=h?h[1]:l,d=h?h[2]:p?p[2]:"",!d&&n.RE_DEFAULT_UNIT.test(c)&&(d=n.DEFAULT_UNIT),typeof f=="string"&&(f.indexOf("cubic-bezier")>-1?f=f.substring(13,f.length-1).split(","):n.easings[f]&&(f=n.easings[f])),o.from=Number(v),o.to=Number(m),o.unit=d,o.easing=f,o.duration=u+a,o.delay=a):(delete s[c],t._count--))},destroy:function(){this.detachAll(),this._node=null}},!0),e.mix(e.Transition,{_runtimeAttrs:{},RE_DEFAULT_UNIT:/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,DEFAULT_UNIT:"px",intervalTime:20,behaviors:{left:{get:function(t,n){return e.DOM._getAttrOffset(t._node,n)}}},DEFAULT_SETTER:function(t,r,i,s,o,u,a,f){i=Number(i),s=Number(s);var l=t._node,c=n.cubicBezier(a,o/u);c=i+c[0]*(s-i);if(l){if(r in l.style||r in e.DOM.CUSTOM_STYLES)f=f||"",e.DOM.setStyle(l,r,c+f)}else t._end()},DEFAULT_GETTER:function(t,n){var r=t._node,i="";if(n in r.style||n in e.DOM.CUSTOM_STYLES)i=e.DOM.getComputedStyle(r,n);return i},_startTimer:function(){n._timer||(n._timer=setInterval(n._runFrame,n.intervalTime))},_stopTimer:function(){clearInterval(n._timer),n._timer=null},_runFrame:function(){var e=!0,t;for(t in n._running)n._running[t]._runFrame&&(e=!1,n._running[t]._runFrame());e&&n._stopTimer()},cubicBezier:function(e,t){var n=0,r=0,i=e[0],s=e[1],o=e[2],u=e[3],a=1,f=0,l=a-3*o+3*i-n,c=3*o-6*i+3*n,h=3*i-3*n,p=n,d=f-3*u+3*s-r,v=3*u-6*s+3*r,m=3*s-3*r,g=r,y=((l*t+c)*t+h)*t+p,b=((d*t+v)*t+m)*t+g;return[y,b]},easings:{ease:[.25,0,1,.25],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},_running:{},_timer:null,RE_UNITS:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/},!0),n.behaviors.top=n.behaviors.bottom=n.behaviors.right=n.behaviors.left,e.Transition=n},"3.7.3",{requires:["transition"]}),YUI.add("yui",function(e,t){},"3.7.3",{use:["yui","oop","dom","event-custom-base","event-base","pluginhost","node","event-delegate","io-base","json-parse","transition","selector-css3","dom-style-ie","querystring-stringify-simple"]});var Y=YUI().use("*");
bundle/simpleyui/simpleyui.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2560,10 +2560,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3332,7 +3332,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3447,13 +3447,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3542,7 +3535,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3595,7 +3602,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3714,10 +3721,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3786,6 +3799,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3797,14 +3811,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3824,7 +3838,7 @@ }; -}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */@@ -4338,14 +4352,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -4362,7 +4380,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -4452,6 +4470,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -4468,6 +4488,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -4479,13 +4504,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -4551,7 +4570,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -4649,7 +4668,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -4699,8 +4718,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -4787,6 +4808,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -4877,7 +4902,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -4935,9 +4959,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -4945,8 +4982,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -4962,7 +4997,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -5069,13 +5104,14 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -5200,7 +5236,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -5229,10 +5265,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -5394,8 +5428,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5407,8 +5441,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -5496,7 +5544,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -5606,7 +5654,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /**@@ -5683,8 +5731,8 @@ -}, '3.7.2', {"requires": ["yui-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"requires": ["yui-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('oop', function (Y, NAME) { /**@@ -6085,7 +6133,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -6210,7 +6258,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -6239,10 +6287,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -6404,8 +6450,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -6417,8 +6463,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('dom-core', function (Y, NAME) { var NODE_TYPE = 'nodeType',@@ -6673,7 +6733,7 @@ isWindow: function(obj) {- return !!(obj && obj.alert && obj.document);+ return !!(obj && obj.scrollTo && obj.document); }, _removeChildNodes: function(node) {@@ -6807,7 +6867,7 @@ Y.DOM = Y_DOM; -}, '3.7.2', {"requires": ["oop", "features"]});+}, '3.7.3', {"requires": ["oop", "features"]}); YUI.add('dom-base', function (Y, NAME) { /**@@ -7491,7 +7551,7 @@ }); -}, '3.7.2', {"requires": ["dom-core"]});+}, '3.7.3', {"requires": ["dom-core"]}); YUI.add('dom-style', function (Y, NAME) { (function(Y) {@@ -7831,7 +7891,7 @@ -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]}); YUI.add('dom-style-ie', function (Y, NAME) { (function(Y) {@@ -8134,7 +8194,7 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style"]});+}, '3.7.3', {"requires": ["dom-style"]}); YUI.add('dom-screen', function (Y, NAME) { (function(Y) {@@ -8739,7 +8799,7 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base", "dom-style"]});+}, '3.7.3', {"requires": ["dom-base", "dom-style"]}); YUI.add('selector-native', function (Y, NAME) { (function(Y) {@@ -9109,12 +9169,12 @@ })(Y); -}, '3.7.2', {"requires": ["dom-base"]});+}, '3.7.3', {"requires": ["dom-base"]}); YUI.add('selector', function (Y, NAME) { -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]}); YUI.add('event-custom-base', function (Y, NAME) { /**@@ -11415,7 +11475,7 @@ **/ -}, '3.7.2', {"requires": ["oop"]});+}, '3.7.3', {"requires": ["oop"]}); YUI.add('event-custom-complex', function (Y, NAME) { @@ -11920,7 +11980,7 @@ FACADE_KEYS[key] = true; } -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]}); YUI.add('node-core', function (Y, NAME) { /**@@ -12630,7 +12690,9 @@ }, /**- * Nulls internal node references, removes any plugins and event listeners+ * Nulls internal node references, removes any plugins and event listeners.+ * Note that destroy() will not remove the node from its parent or from the DOM. For that+ * functionality, call remove(true). * @method destroy * @param {Boolean} recursivePurge (optional) Whether or not to remove listeners from the * node's subtree (default is false)@@ -13513,7 +13575,7 @@ ]); -}, '3.7.2', {"requires": ["dom-core", "selector"]});+}, '3.7.3', {"requires": ["dom-core", "selector"]}); YUI.add('node-base', function (Y, NAME) { /**@@ -14669,7 +14731,7 @@ }); -}, '3.7.2', {"requires": ["event-base", "node-core", "dom-base"]});+}, '3.7.3', {"requires": ["event-base", "node-core", "dom-base"]}); (function () { var GLOBAL_ENV = YUI.Env; @@ -15069,7 +15131,8 @@ Y.Env.evt.dom_wrappers = {}; Y.Env.evt.dom_map = {}; -var _eventenv = Y.Env.evt,+var YDOM = Y.DOM,+ _eventenv = Y.Env.evt, config = Y.config, win = config.win, add = YUI.Env.add,@@ -15091,12 +15154,11 @@ shouldIterate = function(o) { try {- return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) &&- !o.tagName && !o.alert);+ // TODO: See if there's a more performant way to return true early on this, for the common case+ return (o && typeof o !== "string" && Y.Lang.isNumber(o.length) && !o.tagName && !YDOM.isWindow(o)); } catch(ex) { return false; }- }, // aliases to support DOM event subscription clean up when the last@@ -15460,7 +15522,7 @@ // oEl = (compat) ? Y.DOM.byId(el) : Y.Selector.query(el); if (compat) {- oEl = Y.DOM.byId(el);+ oEl = YDOM.byId(el); } else { oEl = Y.Selector.query(el);@@ -15574,7 +15636,7 @@ // el = (compat) ? Y.DOM.byId(el) : Y.all(el); if (compat) {- el = Y.DOM.byId(el);+ el = YDOM.byId(el); } else { el = Y.Selector.query(el); l = el.length;@@ -15648,7 +15710,7 @@ * @static */ generateId: function(el) {- return Y.DOM.generateID(el);+ return YDOM.generateID(el); }, /**@@ -15755,7 +15817,7 @@ if (item && !item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { executeItem(el, item);@@ -15772,7 +15834,7 @@ if (item && item.checkReady) { // el = (item.compat) ? Y.DOM.byId(item.id) : Y.one(item.id);- el = (item.compat) ? Y.DOM.byId(item.id) : Y.Selector.query(item.id, null, true);+ el = (item.compat) ? YDOM.byId(item.id) : Y.Selector.query(item.id, null, true); if (el) { // The element is available, but not necessarily ready@@ -15823,9 +15885,8 @@ if (recurse && oEl) { lis = lis || []; children = Y.Selector.query('*', oEl);- i = 0; len = children.length;- for (; i < len; ++i) {+ for (i = 0; i < len; ++i) { child = Event.getListeners(children[i], type); if (child) { lis = lis.concat(child);@@ -15983,7 +16044,7 @@ Event._poll(); -})();+}()); /** * DOM event listener abstraction layer@@ -16038,7 +16099,7 @@ }; -}, '3.7.2', {"requires": ["event-custom-base"]});+}, '3.7.3', {"requires": ["event-custom-base"]}); YUI.add('pluginhost-base', function (Y, NAME) { /**@@ -16219,7 +16280,7 @@ Y.namespace("Plugin").Host = PluginHost; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('pluginhost-config', function (Y, NAME) { /**@@ -16349,7 +16410,7 @@ }; -}, '3.7.2', {"requires": ["pluginhost-base"]});+}, '3.7.3', {"requires": ["pluginhost-base"]}); YUI.add('event-delegate', function (Y, NAME) { /**@@ -16671,7 +16732,7 @@ Y.delegate = Y.Event.delegate = delegate; -}, '3.7.2', {"requires": ["node-base"]});+}, '3.7.3', {"requires": ["node-base"]}); YUI.add('node-event-delegate', function (Y, NAME) { /**@@ -16725,7 +16786,7 @@ }; -}, '3.7.2', {"requires": ["node-base", "event-delegate"]});+}, '3.7.3', {"requires": ["node-base", "event-delegate"]}); YUI.add('node-pluginhost', function (Y, NAME) { /**@@ -16811,7 +16872,7 @@ }; -}, '3.7.2', {"requires": ["node-base", "pluginhost"]});+}, '3.7.3', {"requires": ["node-base", "pluginhost"]}); YUI.add('node-screen', function (Y, NAME) { /**@@ -17049,7 +17110,7 @@ }; -}, '3.7.2', {"requires": ["dom-screen", "node-base"]});+}, '3.7.3', {"requires": ["dom-screen", "node-base"]}); YUI.add('node-style', function (Y, NAME) { (function(Y) {@@ -17155,7 +17216,7 @@ })(Y); -}, '3.7.2', {"requires": ["dom-style", "node-base"]});+}, '3.7.3', {"requires": ["dom-style", "node-base"]}); YUI.add('querystring-stringify-simple', function (Y, NAME) { /*global Y */@@ -17216,7 +17277,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('io-base', function (Y, NAME) { /**@@ -17334,9 +17395,9 @@ use; if (alt === 'native') {- // Non-IE can use XHR level 2 and not rely on an+ // Non-IE and IE >= 10 can use XHR level 2 and not rely on an // external transport.- alt = Y.UA.ie ? 'xdr' : null;+ alt = Y.UA.ie && !SUPPORTS_CORS ? 'xdr' : null; // Prevent "pre-flight" OPTIONS request by removing the // `X-Requested-With` HTTP header from CORS requests. This header@@ -17925,10 +17986,8 @@ // Will work only in browsers that implement the // Cross-Origin Resource Sharing draft.- if (config.xdr && config.xdr.credentials) {- if (!Y.UA.ie) {- transaction.c.withCredentials = true;- }+ if (config.xdr && config.xdr.credentials && SUPPORTS_CORS) {+ transaction.c.withCredentials = true; } // Using "null" with HTTP POST will result in a request@@ -18125,9 +18184,13 @@ Y.io._map = {}; var XHR = win && win.XMLHttpRequest, XDR = win && win.XDomainRequest,- AX = win && win.ActiveXObject;+ AX = win && win.ActiveXObject, + // Checks for the presence of the `withCredentials` in an XHR instance+ // object, which will be present if the environment supports CORS.+ SUPPORTS_CORS = XHR && 'withCredentials' in (new XMLHttpRequest()); + Y.mix(Y.IO, { /** * The ID of the default IO transport, defaults to `xhr`@@ -18213,7 +18276,7 @@ -}, '3.7.2', {"requires": ["event-custom-base", "querystring-stringify-simple"]});+}, '3.7.3', {"requires": ["event-custom-base", "querystring-stringify-simple"]}); YUI.add('json-parse', function (Y, NAME) { /**@@ -18229,7 +18292,7 @@ * * <p>The <code>json</code> module is a rollup of <code>json-parse</code> and * <code>json-stringify</code>.</p>- * + * * <p>As their names suggest, <code>json-parse</code> adds support for parsing * JSON data (Y.JSON.parse) and <code>json-stringify</code> for serializing * JavaScript data into JSON strings (Y.JSON.stringify). You may choose to@@ -18255,7 +18318,8 @@ // All internals kept private for security reasons function fromGlobal(ref) {- return (Y.config.win || this || {})[ref];+ var g = ((typeof global === 'object') ? global : undefined);+ return ((Y.UA.nodejs && g) ? g : (Y.config.win || {}))[ref]; } @@ -18325,7 +18389,7 @@ * @private */ _UNSAFE = /[^\],:{}\s]/,- + /** * Replaces specific unicode characters with their appropriate \unnnn * format. Some browsers ignore certain characters during eval.@@ -18391,7 +18455,7 @@ // incorrectly by some browser implementations. // NOTE: This modifies the input if such characters are found! s = s.replace(_UNICODE_EXCEPTIONS, _escapeException);- + // Test for any remaining invalid characters if (!_UNSAFE.test(s.replace(_ESCAPES,'@'). replace(_VALUES,']').@@ -18404,7 +18468,7 @@ throw new SyntaxError('JSON.parse'); };- + Y.namespace('JSON').parse = function (s,reviver) { if (typeof s !== 'string') { s += '';@@ -18443,7 +18507,7 @@ Y.JSON.useNativeParse = useNative; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('transition', function (Y, NAME) { /**@@ -18459,15 +18523,15 @@ DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,+ TRANSITION_CAMEL = 'transition',+ TRANSITION_PROPERTY_CAMEL = 'transitionProperty',+ TRANSFORM_CAMEL = 'transform', TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END,- TRANSFORM_CAMEL, EMPTY_OBJ = {}, @@ -18502,13 +18566,13 @@ Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- + if (m3) { str += '-' + m3.toLowerCase(); } return str;- }); + }); return property; };@@ -18518,30 +18582,37 @@ Transition.useNative = false; -Y.Array.each(VENDORS, function(val) { // then vendor specific- var property = val + TRANSITION_CAMEL;- if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- CAMEL_VENDOR_PREFIX = val;- VENDOR_PREFIX = Transition._toHyphen(val) + '-';+if ('transition' in DOCUMENT[DOCUMENT_ELEMENT].style) {+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+} else {+ Y.Array.each(VENDORS, function(val) { // then vendor specific+ var property = val + 'Transition';+ if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {+ CAMEL_VENDOR_PREFIX = val;+ VENDOR_PREFIX = Transition._toHyphen(val) + '-'; - Transition.useNative = true;- Transition.supported = true; // TODO: remove- Transition._VENDOR_PREFIX = val;- }-});+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+ Transition._VENDOR_PREFIX = val;+ }+ });+} -TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-TRANSITION_END = 'transitionend';-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+if (CAMEL_VENDOR_PREFIX) {+ TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition';+ TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';+ TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+} -TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;+TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';+TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';+TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';+TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; -TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+TRANSITION_END = 'transitionend';+ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END; Transition.fx = {}; Transition.toggles = {};@@ -18550,7 +18621,7 @@ Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; -Y.Node.DOM_EVENTS[TRANSITION_END] = 1; +Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; @@ -18606,7 +18677,7 @@ if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) {- val = config; + val = config; config = EMPTY_OBJ; } @@ -18619,7 +18690,7 @@ if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition }- } + } anim._count++; // properties per transition @@ -18678,7 +18749,7 @@ if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); - // when size is auto or % webkit starts from zero instead of computed + // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') {@@ -18693,7 +18764,7 @@ * @method run * @chainable * @private- */ + */ run: function(callback) { var anim = this, node = anim._node,@@ -18787,7 +18858,7 @@ Transition._hasEnd[uid] = true; }- + style.cssText += transitionText + duration + easing + delay + cssText; },@@ -18800,10 +18871,10 @@ data = { type: 'transition:end', config: config,- elapsedTime: elapsed + elapsedTime: elapsed }, - nodeInstance = Y.one(node); + nodeInstance = Y.one(node); anim._running = false; anim._callback = null;@@ -18889,7 +18960,7 @@ Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({@@ -18911,16 +18982,16 @@ * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. + * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) {- var + var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop;- + if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config;@@ -18935,7 +19006,7 @@ for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) {- config[prop] = fxConfig[prop]; + config[prop] = fxConfig[prop]; } } }@@ -18966,10 +19037,10 @@ callback = config; config = name; }- name = Transition.SHOW_TRANSITION; - } + name = Transition.SHOW_TRANSITION;+ } this.transition(name, config, callback);- } + } return this; }; @@ -18997,16 +19068,16 @@ callback = config; config = name; }- name = Transition.HIDE_TRANSITION; - } + name = Transition.HIDE_TRANSITION;+ } this.transition(name, config, callback); } else { this._hide();- } + } return this;-}; +}; -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({@@ -19113,7 +19184,7 @@ }, duration: 0.5, easing: 'ease-in',- + on: { start: function() { var overflow = this.getStyle('overflow');@@ -19129,7 +19200,7 @@ delete this._transitionOverflow; } }- } + } } }); @@ -19142,7 +19213,7 @@ -}, '3.7.2', {"requires": ["node-style"]});+}, '3.7.3', {"requires": ["node-style"]}); YUI.add('selector-css2', function (Y, NAME) { /**@@ -19586,7 +19657,7 @@ -}, '3.7.2', {"requires": ["selector-native"]});+}, '3.7.3', {"requires": ["selector-native"]}); YUI.add('selector-css3', function (Y, NAME) { /**@@ -19738,7 +19809,7 @@ }; -}, '3.7.2', {"requires": ["selector-native", "selector-css2"]});+}, '3.7.3', {"requires": ["selector-native", "selector-css2"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -19848,7 +19919,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('dump', function (Y, NAME) { /**@@ -19953,7 +20024,7 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('transition-timer', function (Y, NAME) { /**@@ -20287,12 +20358,12 @@ Y.Transition = Transition; -}, '3.7.2', {"requires": ["transition"]});+}, '3.7.3', {"requires": ["transition"]}); YUI.add('yui', function (Y, NAME) { // empty -}, '3.7.2', {"use": ["yui", "oop", "dom", "event-custom-base", "event-base", "pluginhost", "node", "event-delegate", "io-base", "json-parse", "transition", "selector-css3", "dom-style-ie", "querystring-stringify-simple"]});+}, '3.7.3', {"use": ["yui", "oop", "dom", "event-custom-base", "event-base", "pluginhost", "node", "event-delegate", "io-base", "json-parse", "transition", "selector-css3", "dom-style-ie", "querystring-stringify-simple"]}); var Y = YUI().use('*');
bundle/slider-base/assets/skins/audio-light/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/audio-light/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/audio-light/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/audio/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/audio/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/audio/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/capsule-dark/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/capsule-dark/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/capsule-dark/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/capsule/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/capsule/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/capsule/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/night/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/night/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/night/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/round-dark/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/round-dark/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/round-dark/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/round/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/round/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/round/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/sam-dark/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/sam-dark/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/sam-dark/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/sam/slider-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/sam/slider-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/skins/sam/slider-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/slider-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/assets/slider-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-base/slider-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/slider-base/slider-base.js", code: [] };-_yuitest_coverage["build/slider-base/slider-base.js"].code=["YUI.add('slider-base', function (Y, NAME) {","","/**"," * Create a sliding value range input visualized as a draggable thumb on a"," * background element."," * "," * @module slider"," * @submodule slider-base"," */","","var INVALID_VALUE = Y.Attribute.INVALID_VALUE;","","/**"," * Create a slider to represent an input control capable of representing a"," * series of intermediate states based on the position of the slider's thumb."," * These states are typically aligned to a value algorithm whereby the thumb"," * position corresponds to a given value. Sliders may be oriented vertically or"," * horizontally, based on the <code>axis</code> configuration."," *"," * @class SliderBase"," * @extends Widget"," * @param config {Object} Configuration object"," * @constructor"," */","function SliderBase() {"," SliderBase.superclass.constructor.apply( this, arguments );","}","","Y.SliderBase = Y.extend( SliderBase, Y.Widget, {",""," // Y.Slider prototype",""," /**"," * Construction logic executed during Slider instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {"," /**"," * The configured axis, stored for fast lookup since it's a writeOnce"," * attribute. This is for use by extension classes. For"," * implementation code, use <code>get( "axis" )</code> for"," * authoritative source. Never write to this property."," *"," * @property axis"," * @type {String}"," * @protected"," */"," this.axis = this.get( 'axis' );",""," /**"," * Cached fast access map for DOM properties and attributes that"," * pertain to accessing dimensional or positioning information"," * according to the Slider's axis (e.g. "height" vs."," * "width"). Extension classes should add to this collection"," * for axis related strings if necessary."," *"," * @property _key"," * @type {Object}"," * @protected"," */"," this._key = {"," dim : ( this.axis === 'y' ) ? 'height' : 'width',"," minEdge: ( this.axis === 'y' ) ? 'top' : 'left',"," maxEdge: ( this.axis === 'y' ) ? 'bottom' : 'right',"," xyIndex: ( this.axis === 'y' ) ? 1 : 0"," };",""," /**"," * Signals that the thumb has moved. Payload includes the thumb's"," * pixel offset from the top/left edge of the rail, and if triggered by"," * dragging the thumb, the <code>drag:drag</code> event."," *"," * @event thumbMove"," * @param event {Event} The event object for the thumbMove with the"," * following extra properties:"," * <dl>"," * <dt>offset</dt>"," * <dd>Pixel offset from top/left of the slider to the new"," * thumb position</dd>"," * <dt>ddEvent (deprecated)</dt>"," * <dd><code>drag:drag</code> event from the thumb</dd>"," * <dt>originEvent</dt>"," * <dd><code>drag:drag</code> event from the thumb</dd>"," * </dl>"," */"," this.publish( 'thumbMove', {"," defaultFn: this._defThumbMoveFn,"," queuable : true"," } );"," },",""," /**"," * Create the DOM structure for the Slider."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var contentBox = this.get( 'contentBox' );",""," /**"," * The Node instance of the Slider's rail element. Do not write to"," * this property."," *"," * @property rail"," * @type {Node}"," */"," this.rail = this.renderRail();",""," this._uiSetRailLength( this.get( 'length' ) );",""," /**"," * The Node instance of the Slider's thumb element. Do not write to"," * this property."," *"," * @property thumb"," * @type {Node}"," */"," this.thumb = this.renderThumb();",""," this.rail.appendChild( this.thumb );"," // @TODO: insert( contentBox, 'replace' ) or setHTML?"," contentBox.appendChild( this.rail );",""," // <span class=\"yui3-slider-x\">"," contentBox.addClass( this.getClassName( this.axis ) );"," },",""," /**"," * Creates the Slider rail DOM subtree for insertion into the Slider's"," * <code>contentBox</code>. Override this method if you want to provide"," * the rail element (presumably from existing markup)."," *"," * @method renderRail"," * @return {Node} the rail node subtree"," */"," renderRail: function () {"," var minCapClass = this.getClassName( 'rail', 'cap', this._key.minEdge ),"," maxCapClass = this.getClassName( 'rail', 'cap', this._key.maxEdge );",""," return Y.Node.create("," Y.Lang.sub( this.RAIL_TEMPLATE, {"," railClass : this.getClassName( 'rail' ),"," railMinCapClass: minCapClass,"," railMaxCapClass: maxCapClass"," } ) );"," },",""," /**"," * Sets the rail length according to the <code>length</code> attribute."," *"," * @method _uiSetRailLength"," * @param length {String} the length to apply to the rail style"," * @protected"," */"," _uiSetRailLength: function ( length ) {"," this.rail.setStyle( this._key.dim, length );"," },",""," /**"," * Creates the Slider thumb DOM subtree for insertion into the Slider's"," * rail. Override this method if you want to provide the thumb element"," * (presumably from existing markup)."," *"," * @method renderThumb"," * @return {Node} the thumb node subtree"," */"," renderThumb: function () {"," this._initThumbUrl();",""," var imageUrl = this.get( 'thumbUrl' );",""," return Y.Node.create("," Y.Lang.sub( this.THUMB_TEMPLATE, {"," thumbClass : this.getClassName( 'thumb' ),"," thumbShadowClass: this.getClassName( 'thumb', 'shadow' ),"," thumbImageClass : this.getClassName( 'thumb', 'image' ),"," thumbShadowUrl : imageUrl,"," thumbImageUrl : imageUrl,"," thumbAriaLabelId: this.getClassName( 'label', Y.guid()) // get unique id for specifying a label for ARIA"," } ) );"," },"," "," /**"," * Gives focus to the thumb enabling keyboard access after clicking thumb"," *"," * @method _onThumbClick"," * @protected"," */"," _onThumbClick : function(e){"," this.thumb.focus();"," },"," "," "," /**"," * Creates the Y.DD.Drag instance used to handle the thumb movement and"," * binds Slider interaction to the configured value model."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," "," // Begin keyboard listeners ///////////////////////////////"," var boundingBox = this.get(\"boundingBox\"), //Y.one('body'),"," // Looking for a key event which will fire continously across browsers while the key is held down."," keyEvent = (!Y.UA.opera) ? \"down:\" : \"press:\", "," // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home"," keyEventSpec = keyEvent + \"38,40,33,34,35,36\","," // 37 , 39 = arrow left/right"," keyLeftRightSpec = keyEvent + \"37,39\","," // 37 , 39 = arrow left/right + meta (command/apple key) for mac"," keyLeftRightSpecMeta = keyEvent + \"37+meta,39+meta\";",""," boundingBox.on(\"key\", this._onDirectionKey, keyEventSpec, this);"," boundingBox.on(\"key\", this._onLeftRightKey, keyLeftRightSpec, this);"," boundingBox.on(\"key\", this._onLeftRightKeyMeta, keyLeftRightSpecMeta, this);"," // End keyboard listeners //////////////////////////////////",""," this.thumb.on('click', this._onThumbClick, this);",""," this._bindThumbDD();",""," this._bindValueLogic();",""," this.after( 'disabledChange', this._afterDisabledChange );"," this.after( 'lengthChange', this._afterLengthChange );"," "," },"," "," /**"," * increments Slider value by a minor increment"," *"," * @method _incrMinor"," * @protected"," */"," _incrMinor : function(){"," this.set('value', (this.get('value') + this.get('minorStep')));"," },"," "," /**"," * decrements Slider value by a minor increment"," *"," * @method _decrMinor"," * @protected"," */"," _decrMinor : function(){"," this.set('value', (this.get('value') - this.get('minorStep')));"," },"," "," /**"," * increments Slider value by a major increment"," *"," * @method _incrMajor"," * @protected"," */"," _incrMajor : function(){"," this.set('value', (this.get('value') + this.get('majorStep')));"," },"," "," /**"," * decrements Slider value by a major increment"," *"," * @method _decrMajor"," * @protected"," */"," _decrMajor : function(){"," this.set('value', (this.get('value') - this.get('majorStep')));"," },",""," /**"," * sets the Slider value to the min value. "," *"," * @method _setToMin"," * @protected"," */"," _setToMin : function(e){"," this.set('value', this.get('min'));"," },",""," /**"," * sets the Slider value to the max value. "," *"," * @method _setToMax"," * @protected"," */"," _setToMax : function(e){"," this.set('value', this.get('max'));"," },",""," /**"," * sets the Slider's value in response to key events."," * Left and right keys are in a separate method "," * in case an implementation wants to increment values"," * but needs left and right arrow keys for other purposes."," *"," * @method _onDirectionKey"," * @param e {Event} the key event"," * @protected"," */"," _onDirectionKey : function(e) {"," e.preventDefault();"," if(this.get('disabled') === false){"," switch (e.charCode) {"," case 38: // up"," this._incrMinor();"," break;"," case 40: // down"," this._decrMinor();"," break;"," case 36: // home"," this._setToMin();"," break;"," case 35: // end"," this._setToMax();"," break;"," case 33: // page up"," this._incrMajor();"," break;"," case 34: // page down"," this._decrMajor();"," break;"," }"," }"," },",""," /**"," * sets the Slider's value in response to left or right key events"," *"," * @method _onLeftRightKey"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKey : function(e) {"," e.preventDefault();"," if(this.get('disabled') === false){"," switch (e.charCode) {"," case 37: // left"," this._decrMinor();"," break;"," case 39: // right"," this._incrMinor();"," break;"," }"," }"," },",""," /**"," * sets the Slider's value in response to left or right key events when a meta (mac command/apple) key is also pressed"," *"," * @method _onLeftRightKeyMeta"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKeyMeta : function(e) {"," e.preventDefault();"," if(this.get('disabled') === false){"," switch (e.charCode) {"," case 37: // left + meta"," this._setToMin();"," break;"," case 39: // right + meta"," this._setToMax();"," break;"," }"," }"," },","","","","",""," /**"," * Makes the thumb draggable and constrains it to the rail."," *"," * @method _bindThumbDD"," * @protected"," */"," _bindThumbDD: function () {"," var config = { constrain: this.rail };"," "," // { constrain: rail, stickX: true }"," config[ 'stick' + this.axis.toUpperCase() ] = true;",""," /** "," * The DD.Drag instance linked to the thumb node."," *"," * @property _dd"," * @type {DD.Drag}"," * @protected"," */"," this._dd = new Y.DD.Drag( {"," node : this.thumb,"," bubble : false,"," on : {"," 'drag:start': Y.bind( this._onDragStart, this )"," },"," after : {"," 'drag:drag': Y.bind( this._afterDrag, this ),"," 'drag:end' : Y.bind( this._afterDragEnd, this )"," }"," } );",""," // Constrain the thumb to the rail"," this._dd.plug( Y.Plugin.DDConstrained, config );"," },",""," /**"," * Stub implementation. Override this (presumably in a class extension) to"," * initialize any value logic that depends on the presence of the Drag"," * instance."," *"," * @method _bindValueLogic"," * @protected"," */"," _bindValueLogic: function () {},",""," /**"," * Moves the thumb to pixel offset position along the rail."," *"," * @method _uiMoveThumb"," * @param offset {Number} the pixel offset to set as left or top style"," * @param [options] {Object} Details to send with the `thumbMove` event"," * @protected"," */"," _uiMoveThumb: function ( offset, options ) {"," if ( this.thumb ) {"," this.thumb.setStyle( this._key.minEdge, offset + 'px' );","",""," options || (options = {});"," options.offset = offset;",""," this.fire( 'thumbMove', options );"," }"," },",""," /**"," * Dispatches the <code>slideStart</code> event."," *"," * @method _onDragStart"," * @param e {Event} the <code>drag:start</code> event from the thumb"," * @protected"," */"," _onDragStart: function ( e ) {"," /**"," * Signals the beginning of a thumb drag operation. Payload includes"," * the thumb's drag:start event."," *"," * @event slideStart"," * @param event {Event} The event object for the slideStart with the"," * following extra properties:"," * <dl>"," * <dt>ddEvent (deprecated)</dt>"," * <dd><code>drag:start</code> event from the thumb</dd>"," * <dt>originEvent</dt>"," * <dd><code>drag:start</code> event from the thumb</dd>"," * </dl>"," */"," this.fire('slideStart', {"," ddEvent: e, // for backward compatibility"," originEvent: e"," });"," },",""," /**"," * Dispatches the <code>thumbMove</code> event."," *"," * @method _afterDrag"," * @param e {Event} the <code>drag:drag</code> event from the thumb"," * @protected"," */"," _afterDrag: function ( e ) {"," var thumbXY = e.info.xy[ this._key.xyIndex ],"," railXY = e.target.con._regionCache[ this._key.minEdge ];",""," this.fire( 'thumbMove', {"," offset : (thumbXY - railXY),"," ddEvent: e, // for backward compatibility"," originEvent: e"," } );"," },",""," /**"," * Dispatches the <code>slideEnd</code> event."," *"," * @method _onDragEnd"," * @param e {Event} the <code>drag:end</code> event from the thumb"," * @protected"," */"," _afterDragEnd: function ( e ) {"," /**"," * Signals the end of a thumb drag operation. Payload includes"," * the thumb's drag:end event."," *"," * @event slideEnd"," * @param event {Event} The event object for the slideEnd with the"," * following extra properties:"," * <dl>"," * <dt>ddEvent (deprecated)</dt>"," * <dd><code>drag:end</code> event from the thumb</dd>"," * <dt>originEvent</dt>"," * <dd><code>drag:end</code> event from the thumb</dd>"," * </dl>"," */"," this.fire('slideEnd', {"," ddEvent: e,"," originEvent: e"," });"," },",""," /**"," * Locks or unlocks the thumb."," *"," * @method _afterDisabledChange"," * @param e {Event} The disabledChange event object"," * @protected"," */"," _afterDisabledChange: function ( e ) {"," this._dd.set( 'lock', e.newVal );"," },",""," /**"," * Handles changes to the <code>length</code> attribute. By default, it"," * triggers an update to the UI."," *"," * @method _afterLengthChange"," * @param e {Event} The lengthChange event object"," * @protected"," */"," _afterLengthChange: function ( e ) {"," if ( this.get( 'rendered' ) ) {"," this._uiSetRailLength( e.newVal );",""," this.syncUI();"," }"," },",""," /**"," * Synchronizes the DOM state with the attribute settings."," *"," * @method syncUI"," */"," syncUI : function () {"," this._dd.con.resetCache();",""," this._syncThumbPosition();",""," // Forces a reflow of the bounding box to address IE8 inline-block"," // container not expanding correctly. bug 2527905"," //this.get('boundingBox').toggleClass('');"," this.thumb.set('aria-valuemin', this.get('min'));"," this.thumb.set('aria-valuemax', this.get('max'));",""," this._dd.set('lock', this.get('disabled'));"," },",""," /**"," * Stub implementation. Override this (presumably in a class extension) to"," * ensure the thumb is in the correct position according to the value"," * alogorithm."," * instance."," *"," * @method _syncThumbPosition"," * @protected"," */"," _syncThumbPosition: function () {},",""," /**"," * Validates the axis is "x" or "y" (case insensitive)."," * Converts to lower case for storage."," *"," * @method _setAxis"," * @param v {String} proposed value for the axis attribute"," * @return {String} lowercased first character of the input string"," * @protected"," */"," _setAxis : function (v) {"," v = ( v + '' ).toLowerCase();",""," return ( v === 'x' || v === 'y' ) ? v : INVALID_VALUE;"," },",""," /** "," * <p>Ensures the stored length value is a string with a quantity and unit."," * Unit will be defaulted to "px" if not included. Rejects"," * values less than or equal to 0 and those that don't at least start with"," * a number.</p>"," *"," * <p>Currently only pixel lengths are supported.</p>"," *"," * @method _setLength"," * @param v {String} proposed value for the length attribute"," * @return {String} the sanitized value"," * @protected"," */"," _setLength: function ( v ) {"," v = ( v + '' ).toLowerCase();",""," var length = parseFloat( v, 10 ),"," units = v.replace( /[\\d\\.\\-]/g, '' ) || this.DEF_UNIT;",""," return length > 0 ? ( length + units ) : INVALID_VALUE;"," },",""," /**"," * <p>Defaults the thumbURL attribute according to the current skin, or"," * "sam" if none can be determined. Horizontal Sliders will have"," * their <code>thumbUrl</code> attribute set to</p>"," * <p><code>"/<em>configured</em>/<em>yu</em>i/<em>builddi</em>r/slider-base/assets/skins/sam/thumb-x.png"</code></p>"," * <p>And vertical thumbs will get</p>"," * <p><code>"/<em>configured</em>/<em>yui</em>/<em>builddir</em>/slider-base/assets/skins/sam/thumb-y.png"</code></p>"," *"," * @method _initThumbUrl"," * @protected"," */"," _initThumbUrl: function () {"," if (!this.get('thumbUrl')) {"," var skin = this.getSkinName() || 'sam',"," base = Y.config.base;",""," // Unfortunate hack to avoid requesting image resources from the"," // combo service. The combo service does not serve images."," if (base.indexOf('http://yui.yahooapis.com/combo') === 0) {"," base = 'http://yui.yahooapis.com/' + Y.version + '/build/';"," }",""," // <img src=\"/path/to/build/slider-base/assets/skins/sam/thumb-x.png\">"," this.set('thumbUrl', base + 'slider-base/assets/skins/' +"," skin + '/thumb-' + this.axis + '.png');",""," }"," },",""," /**"," * Bounding box template that will contain the Slider's DOM subtree. <span>s are used to support inline-block styling."," *"," * @property BOUNDING_TEMPLATE"," * @type {String}"," * @default <span></span>"," */"," BOUNDING_TEMPLATE : '<span></span>',",""," /**"," * Content box template that will contain the Slider's rail and thumb."," *"," * @property CONTENT_TEMPLATE"," * @type {String}"," * @default <span></span>"," */"," CONTENT_TEMPLATE : '<span></span>',",""," /**"," * Rail template that will contain the end caps and the thumb."," * {placeholder}s are used for template substitution at render time."," *"," * @property RAIL_TEMPLATE"," * @type {String}"," * @default <span class=\"{railClass}\"><span class=\"{railMinCapClass}\"></span><span class=\"{railMaxCapClass}\"></span></span>"," */"," RAIL_TEMPLATE : '<span class=\"{railClass}\">' +"," '<span class=\"{railMinCapClass}\"></span>' +"," '<span class=\"{railMaxCapClass}\"></span>' +"," '</span>',",""," /**"," * Thumb template that will contain the thumb image and shadow. <img>"," * tags are used instead of background images to avoid a flicker bug in IE."," * {placeholder}s are used for template substitution at render time."," *"," * @property THUMB_TEMPLATE"," * @type {String}"," * @default <span class=\"{thumbClass}\" tabindex=\"-1\"><img src=\"{thumbShadowUrl}\" alt=\"Slider thumb shadow\" class=\"{thumbShadowClass}\"><img src=\"{thumbImageUrl}\" alt=\"Slider thumb\" class=\"{thumbImageClass}\"></span>"," */"," THUMB_TEMPLATE : '<span class=\"{thumbClass}\" aria-labelledby=\"{thumbAriaLabelId}\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\">' + // keyboard access jeff tabindex=\"-1\""," '<img src=\"{thumbShadowUrl}\" ' +"," 'alt=\"Slider thumb shadow\" ' +"," 'class=\"{thumbShadowClass}\">' +"," '<img src=\"{thumbImageUrl}\" ' +"," 'alt=\"Slider thumb\" ' +"," 'class=\"{thumbImageClass}\">' +"," '</span>'","","}, {",""," // Y.SliderBase static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'sliderBase'"," * @readOnly"," * @protected"," * @static"," */"," NAME : 'sliderBase',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS : {",""," /**"," * Axis upon which the Slider's thumb moves. "x" for"," * horizontal, "y" for vertical."," *"," * @attribute axis"," * @type {String}"," * @default "x""," * @writeOnce"," */"," axis : {"," value : 'x',"," writeOnce : true,"," setter : '_setAxis',"," lazyAdd : false"," },",""," /**"," * The length of the rail (exclusive of the end caps if positioned by"," * CSS). This corresponds to the movable range of the thumb."," *"," * @attribute length"," * @type {String | Number} e.g. \"200px\" or 200"," * @default 150px"," */"," length: {"," value: '150px',"," setter: '_setLength'"," },",""," /**"," * Path to the thumb image. This will be used as both the thumb and"," * shadow as a sprite. Defaults at render() to thumb-x.png or"," * thumb-y.png in the skin directory of the current skin."," *"," * @attribute thumbUrl"," * @type {String}"," * @default thumb-x.png or thumb-y.png in the sam skin directory of the"," * current build path for Slider"," */"," thumbUrl: {"," value: null,"," validator: Y.Lang.isString"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"widget\", \"dd-constrain\", \"event-key\"], \"skinnable\": true});"];+_yuitest_coverage["build/slider-base/slider-base.js"].code=["YUI.add('slider-base', function (Y, NAME) {","","/**"," * Create a sliding value range input visualized as a draggable thumb on a"," * background element."," * "," * @module slider"," * @submodule slider-base"," */","","var INVALID_VALUE = Y.Attribute.INVALID_VALUE;","","/**"," * Create a slider to represent an input control capable of representing a"," * series of intermediate states based on the position of the slider's thumb."," * These states are typically aligned to a value algorithm whereby the thumb"," * position corresponds to a given value. Sliders may be oriented vertically or"," * horizontally, based on the <code>axis</code> configuration."," *"," * @class SliderBase"," * @extends Widget"," * @param config {Object} Configuration object"," * @constructor"," */","function SliderBase() {"," SliderBase.superclass.constructor.apply( this, arguments );","}","","Y.SliderBase = Y.extend( SliderBase, Y.Widget, {",""," // Y.Slider prototype",""," /**"," * Construction logic executed during Slider instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {"," /**"," * The configured axis, stored for fast lookup since it's a writeOnce"," * attribute. This is for use by extension classes. For"," * implementation code, use <code>get( "axis" )</code> for"," * authoritative source. Never write to this property."," *"," * @property axis"," * @type {String}"," * @protected"," */"," this.axis = this.get( 'axis' );",""," /**"," * Cached fast access map for DOM properties and attributes that"," * pertain to accessing dimensional or positioning information"," * according to the Slider's axis (e.g. "height" vs."," * "width"). Extension classes should add to this collection"," * for axis related strings if necessary."," *"," * @property _key"," * @type {Object}"," * @protected"," */"," this._key = {"," dim : ( this.axis === 'y' ) ? 'height' : 'width',"," minEdge: ( this.axis === 'y' ) ? 'top' : 'left',"," maxEdge: ( this.axis === 'y' ) ? 'bottom' : 'right',"," xyIndex: ( this.axis === 'y' ) ? 1 : 0"," };",""," /**"," * Signals that the thumb has moved. Payload includes the thumb's"," * pixel offset from the top/left edge of the rail, and if triggered by"," * dragging the thumb, the <code>drag:drag</code> event."," *"," * @event thumbMove"," * @param event {Event} The event object for the thumbMove with the"," * following extra properties:"," * <dl>"," * <dt>offset</dt>"," * <dd>Pixel offset from top/left of the slider to the new"," * thumb position</dd>"," * <dt>ddEvent (deprecated)</dt>"," * <dd><code>drag:drag</code> event from the thumb</dd>"," * <dt>originEvent</dt>"," * <dd><code>drag:drag</code> event from the thumb</dd>"," * </dl>"," */"," this.publish( 'thumbMove', {"," defaultFn: this._defThumbMoveFn,"," queuable : true"," } );"," },",""," /**"," * Create the DOM structure for the Slider."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var contentBox = this.get( 'contentBox' );",""," /**"," * The Node instance of the Slider's rail element. Do not write to"," * this property."," *"," * @property rail"," * @type {Node}"," */"," this.rail = this.renderRail();",""," this._uiSetRailLength( this.get( 'length' ) );",""," /**"," * The Node instance of the Slider's thumb element. Do not write to"," * this property."," *"," * @property thumb"," * @type {Node}"," */"," this.thumb = this.renderThumb();",""," this.rail.appendChild( this.thumb );"," // @TODO: insert( contentBox, 'replace' ) or setHTML?"," contentBox.appendChild( this.rail );",""," // <span class=\"yui3-slider-x\">"," contentBox.addClass( this.getClassName( this.axis ) );"," },",""," /**"," * Creates the Slider rail DOM subtree for insertion into the Slider's"," * <code>contentBox</code>. Override this method if you want to provide"," * the rail element (presumably from existing markup)."," *"," * @method renderRail"," * @return {Node} the rail node subtree"," */"," renderRail: function () {"," var minCapClass = this.getClassName( 'rail', 'cap', this._key.minEdge ),"," maxCapClass = this.getClassName( 'rail', 'cap', this._key.maxEdge );",""," return Y.Node.create("," Y.Lang.sub( this.RAIL_TEMPLATE, {"," railClass : this.getClassName( 'rail' ),"," railMinCapClass: minCapClass,"," railMaxCapClass: maxCapClass"," } ) );"," },",""," /**"," * Sets the rail length according to the <code>length</code> attribute."," *"," * @method _uiSetRailLength"," * @param length {String} the length to apply to the rail style"," * @protected"," */"," _uiSetRailLength: function ( length ) {"," this.rail.setStyle( this._key.dim, length );"," },",""," /**"," * Creates the Slider thumb DOM subtree for insertion into the Slider's"," * rail. Override this method if you want to provide the thumb element"," * (presumably from existing markup)."," *"," * @method renderThumb"," * @return {Node} the thumb node subtree"," */"," renderThumb: function () {"," this._initThumbUrl();",""," var imageUrl = this.get( 'thumbUrl' );",""," return Y.Node.create("," Y.Lang.sub( this.THUMB_TEMPLATE, {"," thumbClass : this.getClassName( 'thumb' ),"," thumbShadowClass: this.getClassName( 'thumb', 'shadow' ),"," thumbImageClass : this.getClassName( 'thumb', 'image' ),"," thumbShadowUrl : imageUrl,"," thumbImageUrl : imageUrl,"," thumbAriaLabelId: this.getClassName( 'label', Y.guid()) // get unique id for specifying a label for ARIA"," } ) );"," },"," "," /**"," * Gives focus to the thumb enabling keyboard access after clicking thumb"," *"," * @method _onThumbClick"," * @protected"," */"," _onThumbClick : function(e){"," this.thumb.focus();"," },"," "," "," /**"," * Creates the Y.DD.Drag instance used to handle the thumb movement and"," * binds Slider interaction to the configured value model."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {"," "," // Begin keyboard listeners ///////////////////////////////"," var boundingBox = this.get(\"boundingBox\"), //Y.one('body'),"," // Looking for a key event which will fire continously across browsers while the key is held down."," keyEvent = (!Y.UA.opera) ? \"down:\" : \"press:\", "," // 38, 40 = arrow up/down, 33, 34 = page up/down, 35 , 36 = end/home"," keyEventSpec = keyEvent + \"38,40,33,34,35,36\","," // 37 , 39 = arrow left/right"," keyLeftRightSpec = keyEvent + \"37,39\","," // 37 , 39 = arrow left/right + meta (command/apple key) for mac"," keyLeftRightSpecMeta = keyEvent + \"37+meta,39+meta\";",""," boundingBox.on(\"key\", this._onDirectionKey, keyEventSpec, this);"," boundingBox.on(\"key\", this._onLeftRightKey, keyLeftRightSpec, this);"," boundingBox.on(\"key\", this._onLeftRightKeyMeta, keyLeftRightSpecMeta, this);"," // End keyboard listeners //////////////////////////////////",""," this.thumb.on('click', this._onThumbClick, this);",""," this._bindThumbDD();",""," this._bindValueLogic();",""," this.after( 'disabledChange', this._afterDisabledChange );"," this.after( 'lengthChange', this._afterLengthChange );"," "," },"," "," /**"," * increments Slider value by a minor increment"," *"," * @method _incrMinor"," * @protected"," */"," _incrMinor : function(){"," this.set('value', (this.get('value') + this.get('minorStep')));"," },"," "," /**"," * decrements Slider value by a minor increment"," *"," * @method _decrMinor"," * @protected"," */"," _decrMinor : function(){"," this.set('value', (this.get('value') - this.get('minorStep')));"," },"," "," /**"," * increments Slider value by a major increment"," *"," * @method _incrMajor"," * @protected"," */"," _incrMajor : function(){"," this.set('value', (this.get('value') + this.get('majorStep')));"," },"," "," /**"," * decrements Slider value by a major increment"," *"," * @method _decrMajor"," * @protected"," */"," _decrMajor : function(){"," this.set('value', (this.get('value') - this.get('majorStep')));"," },",""," /**"," * sets the Slider value to the min value. "," *"," * @method _setToMin"," * @protected"," */"," _setToMin : function(e){"," this.set('value', this.get('min'));"," },",""," /**"," * sets the Slider value to the max value. "," *"," * @method _setToMax"," * @protected"," */"," _setToMax : function(e){"," this.set('value', this.get('max'));"," },",""," /**"," * sets the Slider's value in response to key events."," * Left and right keys are in a separate method "," * in case an implementation wants to increment values"," * but needs left and right arrow keys for other purposes."," *"," * @method _onDirectionKey"," * @param e {Event} the key event"," * @protected"," */"," _onDirectionKey : function(e) {"," e.preventDefault();"," if(this.get('disabled') === false){"," switch (e.charCode) {"," case 38: // up"," this._incrMinor();"," break;"," case 40: // down"," this._decrMinor();"," break;"," case 36: // home"," this._setToMin();"," break;"," case 35: // end"," this._setToMax();"," break;"," case 33: // page up"," this._incrMajor();"," break;"," case 34: // page down"," this._decrMajor();"," break;"," }"," }"," },",""," /**"," * sets the Slider's value in response to left or right key events"," *"," * @method _onLeftRightKey"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKey : function(e) {"," e.preventDefault();"," if(this.get('disabled') === false){"," switch (e.charCode) {"," case 37: // left"," this._decrMinor();"," break;"," case 39: // right"," this._incrMinor();"," break;"," }"," }"," },",""," /**"," * sets the Slider's value in response to left or right key events when a meta (mac command/apple) key is also pressed"," *"," * @method _onLeftRightKeyMeta"," * @param e {Event} the key event"," * @protected"," */"," _onLeftRightKeyMeta : function(e) {"," e.preventDefault();"," if(this.get('disabled') === false){"," switch (e.charCode) {"," case 37: // left + meta"," this._setToMin();"," break;"," case 39: // right + meta"," this._setToMax();"," break;"," }"," }"," },","","","","",""," /**"," * Makes the thumb draggable and constrains it to the rail."," *"," * @method _bindThumbDD"," * @protected"," */"," _bindThumbDD: function () {"," var config = { constrain: this.rail };"," "," // { constrain: rail, stickX: true }"," config[ 'stick' + this.axis.toUpperCase() ] = true;",""," /** "," * The DD.Drag instance linked to the thumb node."," *"," * @property _dd"," * @type {DD.Drag}"," * @protected"," */"," this._dd = new Y.DD.Drag( {"," node : this.thumb,"," bubble : false,"," on : {"," 'drag:start': Y.bind( this._onDragStart, this )"," },"," after : {"," 'drag:drag': Y.bind( this._afterDrag, this ),"," 'drag:end' : Y.bind( this._afterDragEnd, this )"," }"," } );",""," // Constrain the thumb to the rail"," this._dd.plug( Y.Plugin.DDConstrained, config );"," },",""," /**"," * Stub implementation. Override this (presumably in a class extension) to"," * initialize any value logic that depends on the presence of the Drag"," * instance."," *"," * @method _bindValueLogic"," * @protected"," */"," _bindValueLogic: function () {},",""," /**"," * Moves the thumb to pixel offset position along the rail."," *"," * @method _uiMoveThumb"," * @param offset {Number} the pixel offset to set as left or top style"," * @param [options] {Object} Details to send with the `thumbMove` event"," * @protected"," */"," _uiMoveThumb: function ( offset, options ) {"," if ( this.thumb ) {"," this.thumb.setStyle( this._key.minEdge, offset + 'px' );","",""," options || (options = {});"," options.offset = offset;",""," this.fire( 'thumbMove', options );"," }"," },",""," /**"," * Dispatches the <code>slideStart</code> event."," *"," * @method _onDragStart"," * @param e {Event} the <code>drag:start</code> event from the thumb"," * @protected"," */"," _onDragStart: function ( e ) {"," /**"," * Signals the beginning of a thumb drag operation. Payload includes"," * the thumb's drag:start event."," *"," * @event slideStart"," * @param event {Event} The event object for the slideStart with the"," * following extra properties:"," * <dl>"," * <dt>ddEvent (deprecated)</dt>"," * <dd><code>drag:start</code> event from the thumb</dd>"," * <dt>originEvent</dt>"," * <dd><code>drag:start</code> event from the thumb</dd>"," * </dl>"," */"," this.fire('slideStart', {"," ddEvent: e, // for backward compatibility"," originEvent: e"," });"," },",""," /**"," * Dispatches the <code>thumbMove</code> event."," *"," * @method _afterDrag"," * @param e {Event} the <code>drag:drag</code> event from the thumb"," * @protected"," */"," _afterDrag: function ( e ) {"," var thumbXY = e.info.xy[ this._key.xyIndex ],"," railXY = e.target.con._regionCache[ this._key.minEdge ];",""," this.fire( 'thumbMove', {"," offset : (thumbXY - railXY),"," ddEvent: e, // for backward compatibility"," originEvent: e"," } );"," },",""," /**"," * Dispatches the <code>slideEnd</code> event."," *"," * @method _onDragEnd"," * @param e {Event} the <code>drag:end</code> event from the thumb"," * @protected"," */"," _afterDragEnd: function ( e ) {"," /**"," * Signals the end of a thumb drag operation. Payload includes"," * the thumb's drag:end event."," *"," * @event slideEnd"," * @param event {Event} The event object for the slideEnd with the"," * following extra properties:"," * <dl>"," * <dt>ddEvent (deprecated)</dt>"," * <dd><code>drag:end</code> event from the thumb</dd>"," * <dt>originEvent</dt>"," * <dd><code>drag:end</code> event from the thumb</dd>"," * </dl>"," */"," this.fire('slideEnd', {"," ddEvent: e,"," originEvent: e"," });"," },",""," /**"," * Locks or unlocks the thumb."," *"," * @method _afterDisabledChange"," * @param e {Event} The disabledChange event object"," * @protected"," */"," _afterDisabledChange: function ( e ) {"," this._dd.set( 'lock', e.newVal );"," },",""," /**"," * Handles changes to the <code>length</code> attribute. By default, it"," * triggers an update to the UI."," *"," * @method _afterLengthChange"," * @param e {Event} The lengthChange event object"," * @protected"," */"," _afterLengthChange: function ( e ) {"," if ( this.get( 'rendered' ) ) {"," this._uiSetRailLength( e.newVal );",""," this.syncUI();"," }"," },",""," /**"," * Synchronizes the DOM state with the attribute settings."," *"," * @method syncUI"," */"," syncUI : function () {"," this._dd.con.resetCache();",""," this._syncThumbPosition();",""," // Forces a reflow of the bounding box to address IE8 inline-block"," // container not expanding correctly. bug 2527905"," //this.get('boundingBox').toggleClass('');"," this.thumb.set('aria-valuemin', this.get('min'));"," this.thumb.set('aria-valuemax', this.get('max'));",""," this._dd.set('lock', this.get('disabled'));"," },",""," /**"," * Stub implementation. Override this (presumably in a class extension) to"," * ensure the thumb is in the correct position according to the value"," * alogorithm."," * instance."," *"," * @method _syncThumbPosition"," * @protected"," */"," _syncThumbPosition: function () {},",""," /**"," * Validates the axis is "x" or "y" (case insensitive)."," * Converts to lower case for storage."," *"," * @method _setAxis"," * @param v {String} proposed value for the axis attribute"," * @return {String} lowercased first character of the input string"," * @protected"," */"," _setAxis : function (v) {"," v = ( v + '' ).toLowerCase();",""," return ( v === 'x' || v === 'y' ) ? v : INVALID_VALUE;"," },",""," /** "," * <p>Ensures the stored length value is a string with a quantity and unit."," * Unit will be defaulted to "px" if not included. Rejects"," * values less than or equal to 0 and those that don't at least start with"," * a number.</p>"," *"," * <p>Currently only pixel lengths are supported.</p>"," *"," * @method _setLength"," * @param v {String} proposed value for the length attribute"," * @return {String} the sanitized value"," * @protected"," */"," _setLength: function ( v ) {"," v = ( v + '' ).toLowerCase();",""," var length = parseFloat( v, 10 ),"," units = v.replace( /[\\d\\.\\-]/g, '' ) || this.DEF_UNIT;",""," return length > 0 ? ( length + units ) : INVALID_VALUE;"," },",""," /**"," * <p>Defaults the thumbURL attribute according to the current skin, or"," * "sam" if none can be determined. Horizontal Sliders will have"," * their <code>thumbUrl</code> attribute set to</p>"," * <p><code>"/<em>configured</em>/<em>yu</em>i/<em>builddi</em>r/slider-base/assets/skins/sam/thumb-x.png"</code></p>"," * <p>And vertical thumbs will get</p>"," * <p><code>"/<em>configured</em>/<em>yui</em>/<em>builddir</em>/slider-base/assets/skins/sam/thumb-y.png"</code></p>"," *"," * @method _initThumbUrl"," * @protected"," */"," _initThumbUrl: function () {"," if (!this.get('thumbUrl')) {"," var skin = this.getSkinName() || 'sam',"," base = Y.config.base;",""," // Unfortunate hack to avoid requesting image resources from the"," // combo service. The combo service does not serve images."," if (base.indexOf('http://yui.yahooapis.com/combo') === 0) {"," base = 'http://yui.yahooapis.com/' + Y.version + '/build/';"," }",""," // <img src=\"/path/to/build/slider-base/assets/skins/sam/thumb-x.png\">"," this.set('thumbUrl', base + 'slider-base/assets/skins/' +"," skin + '/thumb-' + this.axis + '.png');",""," }"," },",""," /**"," * Bounding box template that will contain the Slider's DOM subtree. <span>s are used to support inline-block styling."," *"," * @property BOUNDING_TEMPLATE"," * @type {String}"," * @default <span></span>"," */"," BOUNDING_TEMPLATE : '<span></span>',",""," /**"," * Content box template that will contain the Slider's rail and thumb."," *"," * @property CONTENT_TEMPLATE"," * @type {String}"," * @default <span></span>"," */"," CONTENT_TEMPLATE : '<span></span>',",""," /**"," * Rail template that will contain the end caps and the thumb."," * {placeholder}s are used for template substitution at render time."," *"," * @property RAIL_TEMPLATE"," * @type {String}"," * @default <span class=\"{railClass}\"><span class=\"{railMinCapClass}\"></span><span class=\"{railMaxCapClass}\"></span></span>"," */"," RAIL_TEMPLATE : '<span class=\"{railClass}\">' +"," '<span class=\"{railMinCapClass}\"></span>' +"," '<span class=\"{railMaxCapClass}\"></span>' +"," '</span>',",""," /**"," * Thumb template that will contain the thumb image and shadow. <img>"," * tags are used instead of background images to avoid a flicker bug in IE."," * {placeholder}s are used for template substitution at render time."," *"," * @property THUMB_TEMPLATE"," * @type {String}"," * @default <span class=\"{thumbClass}\" tabindex=\"-1\"><img src=\"{thumbShadowUrl}\" alt=\"Slider thumb shadow\" class=\"{thumbShadowClass}\"><img src=\"{thumbImageUrl}\" alt=\"Slider thumb\" class=\"{thumbImageClass}\"></span>"," */"," THUMB_TEMPLATE : '<span class=\"{thumbClass}\" aria-labelledby=\"{thumbAriaLabelId}\" aria-valuetext=\"\" aria-valuemax=\"\" aria-valuemin=\"\" aria-valuenow=\"\" role=\"slider\" tabindex=\"0\">' + // keyboard access jeff tabindex=\"-1\""," '<img src=\"{thumbShadowUrl}\" ' +"," 'alt=\"Slider thumb shadow\" ' +"," 'class=\"{thumbShadowClass}\">' +"," '<img src=\"{thumbImageUrl}\" ' +"," 'alt=\"Slider thumb\" ' +"," 'class=\"{thumbImageClass}\">' +"," '</span>'","","}, {",""," // Y.SliderBase static properties",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'sliderBase'"," * @readOnly"," * @protected"," * @static"," */"," NAME : 'sliderBase',",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS : {",""," /**"," * Axis upon which the Slider's thumb moves. "x" for"," * horizontal, "y" for vertical."," *"," * @attribute axis"," * @type {String}"," * @default "x""," * @writeOnce"," */"," axis : {"," value : 'x',"," writeOnce : true,"," setter : '_setAxis',"," lazyAdd : false"," },",""," /**"," * The length of the rail (exclusive of the end caps if positioned by"," * CSS). This corresponds to the movable range of the thumb."," *"," * @attribute length"," * @type {String | Number} e.g. \"200px\" or 200"," * @default 150px"," */"," length: {"," value: '150px',"," setter: '_setLength'"," },",""," /**"," * Path to the thumb image. This will be used as both the thumb and"," * shadow as a sprite. Defaults at render() to thumb-x.png or"," * thumb-y.png in the skin directory of the current skin."," *"," * @attribute thumbUrl"," * @type {String}"," * @default thumb-x.png or thumb-y.png in the sam skin directory of the"," * current build path for Slider"," */"," thumbUrl: {"," value: null,"," validator: Y.Lang.isString"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"widget\", \"dd-constrain\", \"event-key\"], \"skinnable\": true});"]; _yuitest_coverage["build/slider-base/slider-base.js"].lines = {"1":0,"11":0,"25":0,"26":0,"29":0,"50":0,"63":0,"88":0,"101":0,"110":0,"112":0,"121":0,"123":0,"125":0,"128":0,"140":0,"143":0,"159":0,"171":0,"173":0,"175":0,"193":0,"207":0,"217":0,"218":0,"219":0,"222":0,"224":0,"226":0,"228":0,"229":0,"240":0,"250":0,"260":0,"270":0,"280":0,"290":0,"304":0,"305":0,"306":0,"308":0,"309":0,"311":0,"312":0,"314":0,"315":0,"317":0,"318":0,"320":0,"321":0,"323":0,"324":0,"337":0,"338":0,"339":0,"341":0,"342":0,"344":0,"345":0,"358":0,"359":0,"360":0,"362":0,"363":0,"365":0,"366":0,"382":0,"385":0,"394":0,"407":0,"429":0,"430":0,"433":0,"434":0,"436":0,"462":0,"476":0,"479":0,"508":0,"522":0,"534":0,"535":0,"537":0,"547":0,"549":0,"554":0,"555":0,"557":0,"581":0,"583":0,"600":0,"602":0,"605":0,"620":0,"621":0,"626":0,"627":0,"631":0}; _yuitest_coverage["build/slider-base/slider-base.js"].functions = {"SliderBase:25":0,"initializer:39":0,"renderUI:100":0,"renderRail:139":0,"_uiSetRailLength:158":0,"renderThumb:170":0,"_onThumbClick:192":0,"bindUI:204":0,"_incrMinor:239":0,"_decrMinor:249":0,"_incrMajor:259":0,"_decrMajor:269":0,"_setToMin:279":0,"_setToMax:289":0,"_onDirectionKey:303":0,"_onLeftRightKey:336":0,"_onLeftRightKeyMeta:357":0,"_bindThumbDD:381":0,"_uiMoveThumb:428":0,"_onDragStart:447":0,"_afterDrag:475":0,"_afterDragEnd:493":0,"_afterDisabledChange:521":0,"_afterLengthChange:533":0,"syncUI:546":0,"_setAxis:580":0,"_setLength:599":0,"_initThumbUrl:619":0,"(anonymous 1):1":0}; _yuitest_coverage["build/slider-base/slider-base.js"].coveredLines = 98;@@ -923,4 +923,4 @@ }); -}, '3.7.2', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});
bundle/slider-base/slider-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -765,4 +765,4 @@ }); -}, '3.7.2', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});
bundle/slider-base/slider-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("slider-base",function(e,t){function r(){r.superclass.constructor.apply(this,arguments)}var n=e.Attribute.INVALID_VALUE;e.SliderBase=e.extend(r,e.Widget,{initializer:function(){this.axis=this.get("axis"),this._key={dim:this.axis==="y"?"height":"width",minEdge:this.axis==="y"?"top":"left",maxEdge:this.axis==="y"?"bottom":"right",xyIndex:this.axis==="y"?1:0},this.publish("thumbMove",{defaultFn:this._defThumbMoveFn,queuable:!0})},renderUI:function(){var e=this.get("contentBox");this.rail=this.renderRail(),this._uiSetRailLength(this.get("length")),this.thumb=this.renderThumb(),this.rail.appendChild(this.thumb),e.appendChild(this.rail),e.addClass(this.getClassName(this.axis))},renderRail:function(){var t=this.getClassName("rail","cap",this._key.minEdge),n=this.getClassName("rail","cap",this._key.maxEdge);return e.Node.create(e.Lang.sub(this.RAIL_TEMPLATE,{railClass:this.getClassName("rail"),railMinCapClass:t,railMaxCapClass:n}))},_uiSetRailLength:function(e){this.rail.setStyle(this._key.dim,e)},renderThumb:function(){this._initThumbUrl();var t=this.get("thumbUrl");return e.Node.create(e.Lang.sub(this.THUMB_TEMPLATE,{thumbClass:this.getClassName("thumb"),thumbShadowClass:this.getClassName("thumb","shadow"),thumbImageClass:this.getClassName("thumb","image"),thumbShadowUrl:t,thumbImageUrl:t,thumbAriaLabelId:this.getClassName("label",e.guid())}))},_onThumbClick:function(e){this.thumb.focus()},bindUI:function(){var t=this.get("boundingBox"),n=e.UA.opera?"press:":"down:",r=n+"38,40,33,34,35,36",i=n+"37,39",s=n+"37+meta,39+meta";t.on("key",this._onDirectionKey,r,this),t.on("key",this._onLeftRightKey,i,this),t.on("key",this._onLeftRightKeyMeta,s,this),this.thumb.on("click",this._onThumbClick,this),this._bindThumbDD(),this._bindValueLogic(),this.after("disabledChange",this._afterDisabledChange),this.after("lengthChange",this._afterLengthChange)},_incrMinor:function(){this.set("value",this.get("value")+this.get("minorStep"))},_decrMinor:function(){this.set("value",this.get("value")-this.get("minorStep"))},_incrMajor:function(){this.set("value",this.get("value")+this.get("majorStep"))},_decrMajor:function(){this.set("value",this.get("value")-this.get("majorStep"))},_setToMin:function(e){this.set("value",this.get("min"))},_setToMax:function(e){this.set("value",this.get("max"))},_onDirectionKey:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 38:this._incrMinor();break;case 40:this._decrMinor();break;case 36:this._setToMin();break;case 35:this._setToMax();break;case 33:this._incrMajor();break;case 34:this._decrMajor()}},_onLeftRightKey:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 37:this._decrMinor();break;case 39:this._incrMinor()}},_onLeftRightKeyMeta:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 37:this._setToMin();break;case 39:this._setToMax()}},_bindThumbDD:function(){var t={constrain:this.rail};t["stick"+this.axis.toUpperCase()]=!0,this._dd=new e.DD.Drag({node:this.thumb,bubble:!1,on:{"drag:start":e.bind(this._onDragStart,this)},after:{"drag:drag":e.bind(this._afterDrag,this),"drag:end":e.bind(this._afterDragEnd,this)}}),this._dd.plug(e.Plugin.DDConstrained,t)},_bindValueLogic:function(){},_uiMoveThumb:function(e,t){this.thumb&&(this.thumb.setStyle(this._key.minEdge,e+"px"),t||(t={}),t.offset=e,this.fire("thumbMove",t))},_onDragStart:function(e){this.fire("slideStart",{ddEvent:e,originEvent:e})},_afterDrag:function(e){var t=e.info.xy[this._key.xyIndex],n=e.target.con._regionCache[this._key.minEdge];this.fire("thumbMove",{offset:t-n,ddEvent:e,originEvent:e})},_afterDragEnd:function(e){this.fire("slideEnd",{ddEvent:e,originEvent:e})},_afterDisabledChange:function(e){this._dd.set("lock",e.newVal)},_afterLengthChange:function(e){this.get("rendered")&&(this._uiSetRailLength(e.newVal),this.syncUI())},syncUI:function(){this._dd.con.resetCache(),this._syncThumbPosition(),this.thumb.set("aria-valuemin",this.get("min")),this.thumb.set("aria-valuemax",this.get("max")),this._dd.set("lock",this.get("disabled"))},_syncThumbPosition:function(){},_setAxis:function(e){return e=(e+"").toLowerCase(),e==="x"||e==="y"?e:n},_setLength:function(e){e=(e+"").toLowerCase();var t=parseFloat(e,10),r=e.replace(/[\d\.\-]/g,"")||this.DEF_UNIT;return t>0?t+r:n},_initThumbUrl:function(){if(!this.get("thumbUrl")){var t=this.getSkinName()||"sam",n=e.config.base;n.indexOf("http://yui.yahooapis.com/combo")===0&&(n="http://yui.yahooapis.com/"+e.version+"/build/"),this.set("thumbUrl",n+"slider-base/assets/skins/"+t+"/thumb-"+this.axis+".png")}},BOUNDING_TEMPLATE:"<span></span>",CONTENT_TEMPLATE:"<span></span>",RAIL_TEMPLATE:'<span class="{railClass}"><span class="{railMinCapClass}"></span><span class="{railMaxCapClass}"></span></span>',THUMB_TEMPLATE:'<span class="{thumbClass}" aria-labelledby="{thumbAriaLabelId}" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0"><img src="{thumbShadowUrl}" alt="Slider thumb shadow" class="{thumbShadowClass}"><img src="{thumbImageUrl}" alt="Slider thumb" class="{thumbImageClass}"></span>'},{NAME:"sliderBase",ATTRS:{axis:{value:"x",writeOnce:!0,setter:"_setAxis",lazyAdd:!1},length:{value:"150px",setter:"_setLength"},thumbUrl:{value:null,validator:e.Lang.isString}}})},"3.7.2",{requires:["widget","dd-constrain","event-key"],skinnable:!0});+YUI.add("slider-base",function(e,t){function r(){r.superclass.constructor.apply(this,arguments)}var n=e.Attribute.INVALID_VALUE;e.SliderBase=e.extend(r,e.Widget,{initializer:function(){this.axis=this.get("axis"),this._key={dim:this.axis==="y"?"height":"width",minEdge:this.axis==="y"?"top":"left",maxEdge:this.axis==="y"?"bottom":"right",xyIndex:this.axis==="y"?1:0},this.publish("thumbMove",{defaultFn:this._defThumbMoveFn,queuable:!0})},renderUI:function(){var e=this.get("contentBox");this.rail=this.renderRail(),this._uiSetRailLength(this.get("length")),this.thumb=this.renderThumb(),this.rail.appendChild(this.thumb),e.appendChild(this.rail),e.addClass(this.getClassName(this.axis))},renderRail:function(){var t=this.getClassName("rail","cap",this._key.minEdge),n=this.getClassName("rail","cap",this._key.maxEdge);return e.Node.create(e.Lang.sub(this.RAIL_TEMPLATE,{railClass:this.getClassName("rail"),railMinCapClass:t,railMaxCapClass:n}))},_uiSetRailLength:function(e){this.rail.setStyle(this._key.dim,e)},renderThumb:function(){this._initThumbUrl();var t=this.get("thumbUrl");return e.Node.create(e.Lang.sub(this.THUMB_TEMPLATE,{thumbClass:this.getClassName("thumb"),thumbShadowClass:this.getClassName("thumb","shadow"),thumbImageClass:this.getClassName("thumb","image"),thumbShadowUrl:t,thumbImageUrl:t,thumbAriaLabelId:this.getClassName("label",e.guid())}))},_onThumbClick:function(e){this.thumb.focus()},bindUI:function(){var t=this.get("boundingBox"),n=e.UA.opera?"press:":"down:",r=n+"38,40,33,34,35,36",i=n+"37,39",s=n+"37+meta,39+meta";t.on("key",this._onDirectionKey,r,this),t.on("key",this._onLeftRightKey,i,this),t.on("key",this._onLeftRightKeyMeta,s,this),this.thumb.on("click",this._onThumbClick,this),this._bindThumbDD(),this._bindValueLogic(),this.after("disabledChange",this._afterDisabledChange),this.after("lengthChange",this._afterLengthChange)},_incrMinor:function(){this.set("value",this.get("value")+this.get("minorStep"))},_decrMinor:function(){this.set("value",this.get("value")-this.get("minorStep"))},_incrMajor:function(){this.set("value",this.get("value")+this.get("majorStep"))},_decrMajor:function(){this.set("value",this.get("value")-this.get("majorStep"))},_setToMin:function(e){this.set("value",this.get("min"))},_setToMax:function(e){this.set("value",this.get("max"))},_onDirectionKey:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 38:this._incrMinor();break;case 40:this._decrMinor();break;case 36:this._setToMin();break;case 35:this._setToMax();break;case 33:this._incrMajor();break;case 34:this._decrMajor()}},_onLeftRightKey:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 37:this._decrMinor();break;case 39:this._incrMinor()}},_onLeftRightKeyMeta:function(e){e.preventDefault();if(this.get("disabled")===!1)switch(e.charCode){case 37:this._setToMin();break;case 39:this._setToMax()}},_bindThumbDD:function(){var t={constrain:this.rail};t["stick"+this.axis.toUpperCase()]=!0,this._dd=new e.DD.Drag({node:this.thumb,bubble:!1,on:{"drag:start":e.bind(this._onDragStart,this)},after:{"drag:drag":e.bind(this._afterDrag,this),"drag:end":e.bind(this._afterDragEnd,this)}}),this._dd.plug(e.Plugin.DDConstrained,t)},_bindValueLogic:function(){},_uiMoveThumb:function(e,t){this.thumb&&(this.thumb.setStyle(this._key.minEdge,e+"px"),t||(t={}),t.offset=e,this.fire("thumbMove",t))},_onDragStart:function(e){this.fire("slideStart",{ddEvent:e,originEvent:e})},_afterDrag:function(e){var t=e.info.xy[this._key.xyIndex],n=e.target.con._regionCache[this._key.minEdge];this.fire("thumbMove",{offset:t-n,ddEvent:e,originEvent:e})},_afterDragEnd:function(e){this.fire("slideEnd",{ddEvent:e,originEvent:e})},_afterDisabledChange:function(e){this._dd.set("lock",e.newVal)},_afterLengthChange:function(e){this.get("rendered")&&(this._uiSetRailLength(e.newVal),this.syncUI())},syncUI:function(){this._dd.con.resetCache(),this._syncThumbPosition(),this.thumb.set("aria-valuemin",this.get("min")),this.thumb.set("aria-valuemax",this.get("max")),this._dd.set("lock",this.get("disabled"))},_syncThumbPosition:function(){},_setAxis:function(e){return e=(e+"").toLowerCase(),e==="x"||e==="y"?e:n},_setLength:function(e){e=(e+"").toLowerCase();var t=parseFloat(e,10),r=e.replace(/[\d\.\-]/g,"")||this.DEF_UNIT;return t>0?t+r:n},_initThumbUrl:function(){if(!this.get("thumbUrl")){var t=this.getSkinName()||"sam",n=e.config.base;n.indexOf("http://yui.yahooapis.com/combo")===0&&(n="http://yui.yahooapis.com/"+e.version+"/build/"),this.set("thumbUrl",n+"slider-base/assets/skins/"+t+"/thumb-"+this.axis+".png")}},BOUNDING_TEMPLATE:"<span></span>",CONTENT_TEMPLATE:"<span></span>",RAIL_TEMPLATE:'<span class="{railClass}"><span class="{railMinCapClass}"></span><span class="{railMaxCapClass}"></span></span>',THUMB_TEMPLATE:'<span class="{thumbClass}" aria-labelledby="{thumbAriaLabelId}" aria-valuetext="" aria-valuemax="" aria-valuemin="" aria-valuenow="" role="slider" tabindex="0"><img src="{thumbShadowUrl}" alt="Slider thumb shadow" class="{thumbShadowClass}"><img src="{thumbImageUrl}" alt="Slider thumb" class="{thumbImageClass}"></span>'},{NAME:"sliderBase",ATTRS:{axis:{value:"x",writeOnce:!0,setter:"_setAxis",lazyAdd:!1},length:{value:"150px",setter:"_setLength"},thumbUrl:{value:null,validator:e.Lang.isString}}})},"3.7.3",{requires:["widget","dd-constrain","event-key"],skinnable:!0});
bundle/slider-base/slider-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -763,4 +763,4 @@ }); -}, '3.7.2', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "dd-constrain", "event-key"], "skinnable": true});
bundle/slider-value-range/assets/slider-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-value-range/assets/slider-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/slider-value-range/slider-value-range-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/slider-value-range/slider-value-range.js", code: [] };-_yuitest_coverage["build/slider-value-range/slider-value-range.js"].code=["YUI.add('slider-value-range', function (Y, NAME) {","","/**"," * Adds value support for Slider as a range of integers between a configured"," * minimum and maximum value. For use with <code>Y.Base.build(..)</code> to"," * add the plumbing to <code>Y.SliderBase</code>."," *"," * @module slider"," * @submodule slider-value-range"," */","","// Constants for compression or performance","var MIN = 'min',"," MAX = 'max',"," VALUE = 'value',","// MINORSTEP = 'minorStep',","// MAJORSTEP = 'majorStep',",""," round = Math.round;","","/**"," * One class of value algorithm that can be built onto SliderBase. By default,"," * values range between 0 and 100, but you can configure these on the"," * built Slider class by setting the <code>min</code> and <code>max</code>"," * configurations. Set the initial value (will cause the thumb to move to the"," * appropriate location on the rail) in configuration as well if appropriate."," *"," * @class SliderValueRange"," */","function SliderValueRange() {"," this._initSliderValueRange();","}","","Y.SliderValueRange = Y.mix( SliderValueRange, {",""," // Prototype properties and methods that will be added onto host class"," prototype: {",""," /**"," * Factor used to translate value -> position -> value."," *"," * @property _factor"," * @type {Number}"," * @protected"," */"," _factor: 1,",""," /**"," * Stub for construction logic. Override if extending this class and"," * you need to set something up during the initializer phase."," *"," * @method _initSliderValueRange"," * @protected"," */"," _initSliderValueRange: function () {},",""," /**"," * Override of stub method in SliderBase that is called at the end of"," * its bindUI stage of render(). Subscribes to internal events to"," * trigger UI and related state updates."," *"," * @method _bindValueLogic"," * @protected"," */"," _bindValueLogic: function () {"," this.after( {"," minChange : this._afterMinChange,"," maxChange : this._afterMaxChange,"," valueChange: this._afterValueChange"," } );"," },",""," /**"," * Move the thumb to appropriate position if necessary. Also resets"," * the cached offsets and recalculates the conversion factor to"," * translate position to value."," *"," * @method _syncThumbPosition"," * @protected"," */"," _syncThumbPosition: function () {"," this._calculateFactor();",""," this._setPosition( this.get( VALUE ) );"," },",""," /**"," * Calculates and caches"," * (range between max and min) / (rail length)"," * for fast runtime calculation of position -> value."," *"," * @method _calculateFactor"," * @protected"," */"," _calculateFactor: function () {"," var length = this.get( 'length' ),"," thumbSize = this.thumb.getStyle( this._key.dim ),"," min = this.get( MIN ),"," max = this.get( MAX );",""," // The default thumb width is based on Sam skin's thumb dimension."," // This attempts to allow for rendering off-DOM, then attaching"," // without the need to call syncUI(). It is still recommended"," // to call syncUI() in these cases though, just to be sure."," length = parseFloat( length ) || 150;"," thumbSize = parseFloat( thumbSize ) || 15;",""," this._factor = ( max - min ) / ( length - thumbSize );",""," },",""," /**"," * Dispatch the new position of the thumb into the value setting"," * operations."," *"," * @method _defThumbMoveFn"," * @param e { EventFacade } The host's thumbMove event"," * @protected"," */"," _defThumbMoveFn: function ( e ) {"," // To prevent set('value', x) from looping back around"," if (e.source !== 'set') {"," this.set(VALUE, this._offsetToValue(e.offset));"," }"," },",""," /**"," * <p>Converts a pixel position into a value. Calculates current"," * thumb offset from the leading edge of the rail multiplied by the"," * ratio of <code>(max - min) / (constraining dim)</code>.</p>"," *"," * <p>Override this if you want to use a different value mapping"," * algorithm.</p>"," *"," * @method _offsetToValue"," * @param offset { Number } X or Y pixel offset"," * @return { mixed } Value corresponding to the provided pixel offset"," * @protected"," */"," _offsetToValue: function ( offset ) {",""," var value = round( offset * this._factor ) + this.get( MIN );",""," return round( this._nearestValue( value ) );"," },",""," /**"," * Converts a value into a pixel offset for use in positioning"," * the thumb according to the reverse of the"," * <code>_offsetToValue( xy )</code> operation."," *"," * @method _valueToOffset"," * @param val { Number } The value to map to pixel X or Y position"," * @return { Number } The pixel offset "," * @protected"," */"," _valueToOffset: function ( value ) {"," var offset = round( ( value - this.get( MIN ) ) / this._factor );",""," return offset;"," },",""," /**"," * Returns the current value. Override this if you want to introduce"," * output formatting. Otherwise equivalent to slider.get( \"value\" );"," *"," * @method getValue"," * @return {Number}"," */"," getValue: function () {"," return this.get( VALUE );"," },",""," /**"," * Updates the current value. Override this if you want to introduce"," * input value parsing or preprocessing. Otherwise equivalent to"," * slider.set( \"value\", v );"," *"," * @method setValue"," * @param val {Number} The new value"," * @return {Slider}"," * @chainable"," */"," setValue: function ( val ) {"," return this.set( VALUE, val );"," },",""," /**"," * Update position according to new min value. If the new min results"," * in the current value being out of range, the value is set to the"," * closer of min or max."," *"," * @method _afterMinChange"," * @param e { EventFacade } The <code>min</code> attribute change event."," * @protected"," */"," _afterMinChange: function ( e ) {"," this._verifyValue();",""," this._syncThumbPosition();"," },",""," /**"," * Update position according to new max value. If the new max results"," * in the current value being out of range, the value is set to the"," * closer of min or max."," *"," * @method _afterMaxChange"," * @param e { EventFacade } The <code>max</code> attribute change event."," * @protected"," */"," _afterMaxChange: function ( e ) {"," this._verifyValue();",""," this._syncThumbPosition();"," },",""," /**"," * Verifies that the current value is within the min - max range. If"," * not, value is set to either min or max, depending on which is"," * closer."," *"," * @method _verifyValue"," * @protected"," */"," _verifyValue: function () {"," var value = this.get( VALUE ),"," nearest = this._nearestValue( value );",""," if ( value !== nearest ) {"," // @TODO Can/should valueChange, minChange, etc be queued"," // events? To make dd.set( 'min', n ); execute after minChange"," // subscribers before on/after valueChange subscribers."," this.set( VALUE, nearest );"," }"," },",""," /**"," * Propagate change to the thumb position unless the change originated"," * from the thumbMove event."," *"," * @method _afterValueChange"," * @param e { EventFacade } The <code>valueChange</code> event."," * @protected"," */"," _afterValueChange: function ( e ) {"," var val = e.newVal;"," this._setPosition( val, { source: 'set' } );"," this.thumb.set('aria-valuenow', val);"," this.thumb.set('aria-valuetext', val);"," },",""," /**"," * Positions the thumb in accordance with the translated value."," *"," * @method _setPosition"," * @param value {Number} Value to translate to a pixel position"," * @param [options] {Object} Details object to pass to `_uiMoveThumb`"," * @protected"," */"," _setPosition: function ( value, options ) {"," this._uiMoveThumb( this._valueToOffset( value ), options );"," },",""," /**"," * Validates new values assigned to <code>min</code> attribute. Numbers"," * are acceptable. Override this to enforce different rules."," *"," * @method _validateNewMin"," * @param value {Any} Value assigned to <code>min</code> attribute."," * @return {Boolean} True for numbers. False otherwise."," * @protected"," */"," _validateNewMin: function ( value ) {"," return Y.Lang.isNumber( value );"," },",""," /**"," * Validates new values assigned to <code>max</code> attribute. Numbers"," * are acceptable. Override this to enforce different rules."," *"," * @method _validateNewMax"," * @param value { mixed } Value assigned to <code>max</code> attribute."," * @return { Boolean } True for numbers. False otherwise."," * @protected"," */"," _validateNewMax: function ( value ) {"," return Y.Lang.isNumber( value );"," },",""," /**"," * Restricts new values assigned to <code>value</code> attribute to be"," * between the configured <code>min</code> and <code>max</code>."," * Rounds to nearest integer value."," *"," * @method _setNewValue"," * @param value { Number } Value assigned to <code>value</code> attribute"," * @return { Number } Normalized and constrained value"," * @protected"," */"," _setNewValue: function ( value ) {"," return round( this._nearestValue( value ) );"," },",""," /**"," * Returns the nearest valid value to the value input. If the provided"," * value is outside the min - max range, accounting for min > max"," * scenarios, the nearest of either min or max is returned. Otherwise,"," * the provided value is returned."," *"," * @method _nearestValue"," * @param value { mixed } Value to test against current min - max range"," * @return { Number } Current min, max, or value if within range"," * @protected"," */"," _nearestValue: function ( value ) {"," var min = this.get( MIN ),"," max = this.get( MAX ),"," tmp;",""," // Account for reverse value range (min > max)"," tmp = ( max > min ) ? max : min;"," min = ( max > min ) ? min : max;"," max = tmp;",""," return ( value < min ) ?"," min :"," ( value > max ) ?"," max :"," value;"," }",""," },",""," /**"," * Attributes that will be added onto host class."," *"," * @property ATTRS"," * @type {Object}"," * @static"," * @protected"," */"," ATTRS: {"," /**"," * The value associated with the farthest top, left position of the"," * rail. Can be greater than the configured <code>max</code> if you"," * want values to increase from right-to-left or bottom-to-top."," *"," * @attribute min"," * @type { Number }"," * @default 0"," */"," min: {"," value : 0,"," validator: '_validateNewMin'"," },",""," /**"," * The value associated with the farthest bottom, right position of"," * the rail. Can be less than the configured <code>min</code> if"," * you want values to increase from right-to-left or bottom-to-top."," *"," * @attribute max"," * @type { Number }"," * @default 100"," */"," max: {"," value : 100,"," validator: '_validateNewMax'"," },"," "," /**"," * amount to increment/decrement the Slider value"," * when the arrow up/down/left/right keys are pressed"," *"," * @attribute minorStep"," * @type {Number}"," * @default 1"," */"," minorStep : {"," value: 1"," },",""," /**"," * amount to increment/decrement the Slider value"," * when the page up/down keys are pressed"," *"," * @attribute majorStep"," * @type {Number}"," * @default 10"," */"," majorStep : {"," value: 10"," },",""," /**"," * The value associated with the thumb's current position on the"," * rail. Defaults to the value inferred from the thumb's current"," * position. Specifying value in the constructor will move the"," * thumb to the position that corresponds to the supplied value."," *"," * @attribute value"," * @type { Number }"," * @default (inferred from current thumb position)"," */"," value: {"," value : 0,"," setter: '_setNewValue'"," }"," }","}, true );","","","}, '3.7.2', {\"requires\": [\"slider-base\"]});"];+_yuitest_coverage["build/slider-value-range/slider-value-range.js"].code=["YUI.add('slider-value-range', function (Y, NAME) {","","/**"," * Adds value support for Slider as a range of integers between a configured"," * minimum and maximum value. For use with <code>Y.Base.build(..)</code> to"," * add the plumbing to <code>Y.SliderBase</code>."," *"," * @module slider"," * @submodule slider-value-range"," */","","// Constants for compression or performance","var MIN = 'min',"," MAX = 'max',"," VALUE = 'value',","// MINORSTEP = 'minorStep',","// MAJORSTEP = 'majorStep',",""," round = Math.round;","","/**"," * One class of value algorithm that can be built onto SliderBase. By default,"," * values range between 0 and 100, but you can configure these on the"," * built Slider class by setting the <code>min</code> and <code>max</code>"," * configurations. Set the initial value (will cause the thumb to move to the"," * appropriate location on the rail) in configuration as well if appropriate."," *"," * @class SliderValueRange"," */","function SliderValueRange() {"," this._initSliderValueRange();","}","","Y.SliderValueRange = Y.mix( SliderValueRange, {",""," // Prototype properties and methods that will be added onto host class"," prototype: {",""," /**"," * Factor used to translate value -> position -> value."," *"," * @property _factor"," * @type {Number}"," * @protected"," */"," _factor: 1,",""," /**"," * Stub for construction logic. Override if extending this class and"," * you need to set something up during the initializer phase."," *"," * @method _initSliderValueRange"," * @protected"," */"," _initSliderValueRange: function () {},",""," /**"," * Override of stub method in SliderBase that is called at the end of"," * its bindUI stage of render(). Subscribes to internal events to"," * trigger UI and related state updates."," *"," * @method _bindValueLogic"," * @protected"," */"," _bindValueLogic: function () {"," this.after( {"," minChange : this._afterMinChange,"," maxChange : this._afterMaxChange,"," valueChange: this._afterValueChange"," } );"," },",""," /**"," * Move the thumb to appropriate position if necessary. Also resets"," * the cached offsets and recalculates the conversion factor to"," * translate position to value."," *"," * @method _syncThumbPosition"," * @protected"," */"," _syncThumbPosition: function () {"," this._calculateFactor();",""," this._setPosition( this.get( VALUE ) );"," },",""," /**"," * Calculates and caches"," * (range between max and min) / (rail length)"," * for fast runtime calculation of position -> value."," *"," * @method _calculateFactor"," * @protected"," */"," _calculateFactor: function () {"," var length = this.get( 'length' ),"," thumbSize = this.thumb.getStyle( this._key.dim ),"," min = this.get( MIN ),"," max = this.get( MAX );",""," // The default thumb width is based on Sam skin's thumb dimension."," // This attempts to allow for rendering off-DOM, then attaching"," // without the need to call syncUI(). It is still recommended"," // to call syncUI() in these cases though, just to be sure."," length = parseFloat( length ) || 150;"," thumbSize = parseFloat( thumbSize ) || 15;",""," this._factor = ( max - min ) / ( length - thumbSize );",""," },",""," /**"," * Dispatch the new position of the thumb into the value setting"," * operations."," *"," * @method _defThumbMoveFn"," * @param e { EventFacade } The host's thumbMove event"," * @protected"," */"," _defThumbMoveFn: function ( e ) {"," // To prevent set('value', x) from looping back around"," if (e.source !== 'set') {"," this.set(VALUE, this._offsetToValue(e.offset));"," }"," },",""," /**"," * <p>Converts a pixel position into a value. Calculates current"," * thumb offset from the leading edge of the rail multiplied by the"," * ratio of <code>(max - min) / (constraining dim)</code>.</p>"," *"," * <p>Override this if you want to use a different value mapping"," * algorithm.</p>"," *"," * @method _offsetToValue"," * @param offset { Number } X or Y pixel offset"," * @return { mixed } Value corresponding to the provided pixel offset"," * @protected"," */"," _offsetToValue: function ( offset ) {",""," var value = round( offset * this._factor ) + this.get( MIN );",""," return round( this._nearestValue( value ) );"," },",""," /**"," * Converts a value into a pixel offset for use in positioning"," * the thumb according to the reverse of the"," * <code>_offsetToValue( xy )</code> operation."," *"," * @method _valueToOffset"," * @param val { Number } The value to map to pixel X or Y position"," * @return { Number } The pixel offset "," * @protected"," */"," _valueToOffset: function ( value ) {"," var offset = round( ( value - this.get( MIN ) ) / this._factor );",""," return offset;"," },",""," /**"," * Returns the current value. Override this if you want to introduce"," * output formatting. Otherwise equivalent to slider.get( \"value\" );"," *"," * @method getValue"," * @return {Number}"," */"," getValue: function () {"," return this.get( VALUE );"," },",""," /**"," * Updates the current value. Override this if you want to introduce"," * input value parsing or preprocessing. Otherwise equivalent to"," * slider.set( \"value\", v );"," *"," * @method setValue"," * @param val {Number} The new value"," * @return {Slider}"," * @chainable"," */"," setValue: function ( val ) {"," return this.set( VALUE, val );"," },",""," /**"," * Update position according to new min value. If the new min results"," * in the current value being out of range, the value is set to the"," * closer of min or max."," *"," * @method _afterMinChange"," * @param e { EventFacade } The <code>min</code> attribute change event."," * @protected"," */"," _afterMinChange: function ( e ) {"," this._verifyValue();",""," this._syncThumbPosition();"," },",""," /**"," * Update position according to new max value. If the new max results"," * in the current value being out of range, the value is set to the"," * closer of min or max."," *"," * @method _afterMaxChange"," * @param e { EventFacade } The <code>max</code> attribute change event."," * @protected"," */"," _afterMaxChange: function ( e ) {"," this._verifyValue();",""," this._syncThumbPosition();"," },",""," /**"," * Verifies that the current value is within the min - max range. If"," * not, value is set to either min or max, depending on which is"," * closer."," *"," * @method _verifyValue"," * @protected"," */"," _verifyValue: function () {"," var value = this.get( VALUE ),"," nearest = this._nearestValue( value );",""," if ( value !== nearest ) {"," // @TODO Can/should valueChange, minChange, etc be queued"," // events? To make dd.set( 'min', n ); execute after minChange"," // subscribers before on/after valueChange subscribers."," this.set( VALUE, nearest );"," }"," },",""," /**"," * Propagate change to the thumb position unless the change originated"," * from the thumbMove event."," *"," * @method _afterValueChange"," * @param e { EventFacade } The <code>valueChange</code> event."," * @protected"," */"," _afterValueChange: function ( e ) {"," var val = e.newVal;"," this._setPosition( val, { source: 'set' } );"," this.thumb.set('aria-valuenow', val);"," this.thumb.set('aria-valuetext', val);"," },",""," /**"," * Positions the thumb in accordance with the translated value."," *"," * @method _setPosition"," * @param value {Number} Value to translate to a pixel position"," * @param [options] {Object} Details object to pass to `_uiMoveThumb`"," * @protected"," */"," _setPosition: function ( value, options ) {"," this._uiMoveThumb( this._valueToOffset( value ), options );"," },",""," /**"," * Validates new values assigned to <code>min</code> attribute. Numbers"," * are acceptable. Override this to enforce different rules."," *"," * @method _validateNewMin"," * @param value {Any} Value assigned to <code>min</code> attribute."," * @return {Boolean} True for numbers. False otherwise."," * @protected"," */"," _validateNewMin: function ( value ) {"," return Y.Lang.isNumber( value );"," },",""," /**"," * Validates new values assigned to <code>max</code> attribute. Numbers"," * are acceptable. Override this to enforce different rules."," *"," * @method _validateNewMax"," * @param value { mixed } Value assigned to <code>max</code> attribute."," * @return { Boolean } True for numbers. False otherwise."," * @protected"," */"," _validateNewMax: function ( value ) {"," return Y.Lang.isNumber( value );"," },",""," /**"," * Restricts new values assigned to <code>value</code> attribute to be"," * between the configured <code>min</code> and <code>max</code>."," * Rounds to nearest integer value."," *"," * @method _setNewValue"," * @param value { Number } Value assigned to <code>value</code> attribute"," * @return { Number } Normalized and constrained value"," * @protected"," */"," _setNewValue: function ( value ) {"," return round( this._nearestValue( value ) );"," },",""," /**"," * Returns the nearest valid value to the value input. If the provided"," * value is outside the min - max range, accounting for min > max"," * scenarios, the nearest of either min or max is returned. Otherwise,"," * the provided value is returned."," *"," * @method _nearestValue"," * @param value { mixed } Value to test against current min - max range"," * @return { Number } Current min, max, or value if within range"," * @protected"," */"," _nearestValue: function ( value ) {"," var min = this.get( MIN ),"," max = this.get( MAX ),"," tmp;",""," // Account for reverse value range (min > max)"," tmp = ( max > min ) ? max : min;"," min = ( max > min ) ? min : max;"," max = tmp;",""," return ( value < min ) ?"," min :"," ( value > max ) ?"," max :"," value;"," }",""," },",""," /**"," * Attributes that will be added onto host class."," *"," * @property ATTRS"," * @type {Object}"," * @static"," * @protected"," */"," ATTRS: {"," /**"," * The value associated with the farthest top, left position of the"," * rail. Can be greater than the configured <code>max</code> if you"," * want values to increase from right-to-left or bottom-to-top."," *"," * @attribute min"," * @type { Number }"," * @default 0"," */"," min: {"," value : 0,"," validator: '_validateNewMin'"," },",""," /**"," * The value associated with the farthest bottom, right position of"," * the rail. Can be less than the configured <code>min</code> if"," * you want values to increase from right-to-left or bottom-to-top."," *"," * @attribute max"," * @type { Number }"," * @default 100"," */"," max: {"," value : 100,"," validator: '_validateNewMax'"," },"," "," /**"," * amount to increment/decrement the Slider value"," * when the arrow up/down/left/right keys are pressed"," *"," * @attribute minorStep"," * @type {Number}"," * @default 1"," */"," minorStep : {"," value: 1"," },",""," /**"," * amount to increment/decrement the Slider value"," * when the page up/down keys are pressed"," *"," * @attribute majorStep"," * @type {Number}"," * @default 10"," */"," majorStep : {"," value: 10"," },",""," /**"," * The value associated with the thumb's current position on the"," * rail. Defaults to the value inferred from the thumb's current"," * position. Specifying value in the constructor will move the"," * thumb to the position that corresponds to the supplied value."," *"," * @attribute value"," * @type { Number }"," * @default (inferred from current thumb position)"," */"," value: {"," value : 0,"," setter: '_setNewValue'"," }"," }","}, true );","","","}, '3.7.3', {\"requires\": [\"slider-base\"]});"]; _yuitest_coverage["build/slider-value-range/slider-value-range.js"].lines = {"1":0,"13":0,"30":0,"31":0,"34":0,"66":0,"82":0,"84":0,"96":0,"105":0,"106":0,"108":0,"122":0,"123":0,"142":0,"144":0,"158":0,"160":0,"171":0,"185":0,"198":0,"200":0,"213":0,"215":0,"227":0,"230":0,"234":0,"247":0,"248":0,"249":0,"250":0,"262":0,"275":0,"288":0,"302":0,"317":0,"322":0,"323":0,"324":0,"326":0}; _yuitest_coverage["build/slider-value-range/slider-value-range.js"].functions = {"SliderValueRange:30":0,"_bindValueLogic:65":0,"_syncThumbPosition:81":0,"_calculateFactor:95":0,"_defThumbMoveFn:120":0,"_offsetToValue:140":0,"_valueToOffset:157":0,"getValue:170":0,"setValue:184":0,"_afterMinChange:197":0,"_afterMaxChange:212":0,"_verifyValue:226":0,"_afterValueChange:246":0,"_setPosition:261":0,"_validateNewMin:274":0,"_validateNewMax:287":0,"_setNewValue:301":0,"_nearestValue:316":0,"(anonymous 1):1":0}; _yuitest_coverage["build/slider-value-range/slider-value-range.js"].coveredLines = 40;@@ -509,4 +509,4 @@ }, true ); -}, '3.7.2', {"requires": ["slider-base"]});+}, '3.7.3', {"requires": ["slider-base"]});
bundle/slider-value-range/slider-value-range-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -421,4 +421,4 @@ }, true ); -}, '3.7.2', {"requires": ["slider-base"]});+}, '3.7.3', {"requires": ["slider-base"]});
bundle/slider-value-range/slider-value-range-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("slider-value-range",function(e,t){function o(){this._initSliderValueRange()}var n="min",r="max",i="value",s=Math.round;e.SliderValueRange=e.mix(o,{prototype:{_factor:1,_initSliderValueRange:function(){},_bindValueLogic:function(){this.after({minChange:this._afterMinChange,maxChange:this._afterMaxChange,valueChange:this._afterValueChange})},_syncThumbPosition:function(){this._calculateFactor(),this._setPosition(this.get(i))},_calculateFactor:function(){var e=this.get("length"),t=this.thumb.getStyle(this._key.dim),i=this.get(n),s=this.get(r);e=parseFloat(e)||150,t=parseFloat(t)||15,this._factor=(s-i)/(e-t)},_defThumbMoveFn:function(e){e.source!=="set"&&this.set(i,this._offsetToValue(e.offset))},_offsetToValue:function(e){var t=s(e*this._factor)+this.get(n);return s(this._nearestValue(t))},_valueToOffset:function(e){var t=s((e-this.get(n))/this._factor);return t},getValue:function(){return this.get(i)},setValue:function(e){return this.set(i,e)},_afterMinChange:function(e){this._verifyValue(),this._syncThumbPosition()},_afterMaxChange:function(e){this._verifyValue(),this._syncThumbPosition()},_verifyValue:function(){var e=this.get(i),t=this._nearestValue(e);e!==t&&this.set(i,t)},_afterValueChange:function(e){var t=e.newVal;this._setPosition(t,{source:"set"}),this.thumb.set("aria-valuenow",t),this.thumb.set("aria-valuetext",t)},_setPosition:function(e,t){this._uiMoveThumb(this._valueToOffset(e),t)},_validateNewMin:function(t){return e.Lang.isNumber(t)},_validateNewMax:function(t){return e.Lang.isNumber(t)},_setNewValue:function(e){return s(this._nearestValue(e))},_nearestValue:function(e){var t=this.get(n),i=this.get(r),s;return s=i>t?i:t,t=i>t?t:i,i=s,e<t?t:e>i?i:e}},ATTRS:{min:{value:0,validator:"_validateNewMin"},max:{value:100,validator:"_validateNewMax"},minorStep:{value:1},majorStep:{value:10},value:{value:0,setter:"_setNewValue"}}},!0)},"3.7.2",{requires:["slider-base"]});+YUI.add("slider-value-range",function(e,t){function o(){this._initSliderValueRange()}var n="min",r="max",i="value",s=Math.round;e.SliderValueRange=e.mix(o,{prototype:{_factor:1,_initSliderValueRange:function(){},_bindValueLogic:function(){this.after({minChange:this._afterMinChange,maxChange:this._afterMaxChange,valueChange:this._afterValueChange})},_syncThumbPosition:function(){this._calculateFactor(),this._setPosition(this.get(i))},_calculateFactor:function(){var e=this.get("length"),t=this.thumb.getStyle(this._key.dim),i=this.get(n),s=this.get(r);e=parseFloat(e)||150,t=parseFloat(t)||15,this._factor=(s-i)/(e-t)},_defThumbMoveFn:function(e){e.source!=="set"&&this.set(i,this._offsetToValue(e.offset))},_offsetToValue:function(e){var t=s(e*this._factor)+this.get(n);return s(this._nearestValue(t))},_valueToOffset:function(e){var t=s((e-this.get(n))/this._factor);return t},getValue:function(){return this.get(i)},setValue:function(e){return this.set(i,e)},_afterMinChange:function(e){this._verifyValue(),this._syncThumbPosition()},_afterMaxChange:function(e){this._verifyValue(),this._syncThumbPosition()},_verifyValue:function(){var e=this.get(i),t=this._nearestValue(e);e!==t&&this.set(i,t)},_afterValueChange:function(e){var t=e.newVal;this._setPosition(t,{source:"set"}),this.thumb.set("aria-valuenow",t),this.thumb.set("aria-valuetext",t)},_setPosition:function(e,t){this._uiMoveThumb(this._valueToOffset(e),t)},_validateNewMin:function(t){return e.Lang.isNumber(t)},_validateNewMax:function(t){return e.Lang.isNumber(t)},_setNewValue:function(e){return s(this._nearestValue(e))},_nearestValue:function(e){var t=this.get(n),i=this.get(r),s;return s=i>t?i:t,t=i>t?t:i,i=s,e<t?t:e>i?i:e}},ATTRS:{min:{value:0,validator:"_validateNewMin"},max:{value:100,validator:"_validateNewMax"},minorStep:{value:1},majorStep:{value:10},value:{value:0,setter:"_setNewValue"}}},!0)},"3.7.3",{requires:["slider-base"]});
bundle/slider-value-range/slider-value-range.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -417,4 +417,4 @@ }, true ); -}, '3.7.2', {"requires": ["slider-base"]});+}, '3.7.3', {"requires": ["slider-base"]});
bundle/sortable-scroll/sortable-scroll-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/sortable-scroll/sortable-scroll.js", code: [] };-_yuitest_coverage["build/sortable-scroll/sortable-scroll.js"].code=["YUI.add('sortable-scroll', function (Y, NAME) {",""," "," /**"," * Plugin for sortable to handle scrolling lists."," * @module sortable"," * @submodule sortable-scroll"," */"," /**"," * Plugin for sortable to handle scrolling lists."," * @class SortScroll"," * @extends Base"," * @constructor"," * @namespace Plugin "," */"," "," var SortScroll = function() {"," SortScroll.superclass.constructor.apply(this, arguments);"," };",""," Y.extend(SortScroll, Y.Base, {"," initializer: function() {"," var host = this.get('host');"," host.plug(Y.Plugin.DDNodeScroll, {"," node: host.get('container')"," });"," host.delegate.on('drop:over', function(e) {"," if (this.dd.nodescroll && e.drag.nodescroll) {"," e.drag.nodescroll.set('parentScroll', Y.one(this.get('container')));"," }"," });"," }"," }, {"," ATTRS: {"," host: {"," value: ''"," }"," },"," /**"," * @property NAME"," * @default SortScroll"," * @readonly"," * @protected"," * @static"," * @description The name of the class."," * @type {String}"," */"," NAME: 'SortScroll',"," /**"," * @property NS"," * @default scroll"," * @readonly"," * @protected"," * @static"," * @description The scroll instance."," * @type {String}"," */"," NS: 'scroll'"," });","",""," Y.namespace('Y.Plugin');"," Y.Plugin.SortableScroll = SortScroll;","","","","}, '3.7.2', {\"requires\": [\"dd-scroll\", \"sortable\"]});"];+_yuitest_coverage["build/sortable-scroll/sortable-scroll.js"].code=["YUI.add('sortable-scroll', function (Y, NAME) {",""," "," /**"," * Plugin for sortable to handle scrolling lists."," * @module sortable"," * @submodule sortable-scroll"," */"," /**"," * Plugin for sortable to handle scrolling lists."," * @class SortScroll"," * @extends Base"," * @constructor"," * @namespace Plugin"," */"," "," var SortScroll = function() {"," SortScroll.superclass.constructor.apply(this, arguments);"," };",""," Y.extend(SortScroll, Y.Base, {"," initializer: function() {"," var host = this.get('host');"," host.plug(Y.Plugin.DDNodeScroll, {"," node: host.get('container')"," });"," host.delegate.on('drop:over', function(e) {"," if (this.dd.nodescroll && e.drag.nodescroll) {"," e.drag.nodescroll.set('parentScroll', Y.one(this.get('container')));"," }"," });"," }"," }, {"," ATTRS: {"," host: {"," value: ''"," }"," },"," /**"," * @property NAME"," * @default SortScroll"," * @readonly"," * @protected"," * @static"," * @description The name of the class."," * @type {String}"," */"," NAME: 'SortScroll',"," /**"," * @property NS"," * @default scroll"," * @readonly"," * @protected"," * @static"," * @description The scroll instance."," * @type {String}"," */"," NS: 'scroll'"," });","",""," Y.namespace('Y.Plugin');"," Y.Plugin.SortableScroll = SortScroll;","","","","}, '3.7.3', {\"requires\": [\"dd-scroll\", \"sortable\"]});"]; _yuitest_coverage["build/sortable-scroll/sortable-scroll.js"].lines = {"1":0,"17":0,"18":0,"21":0,"23":0,"24":0,"27":0,"28":0,"29":0,"62":0,"63":0}; _yuitest_coverage["build/sortable-scroll/sortable-scroll.js"].functions = {"SortScroll:17":0,"(anonymous 2):27":0,"initializer:22":0,"(anonymous 1):1":0}; _yuitest_coverage["build/sortable-scroll/sortable-scroll.js"].coveredLines = 11;@@ -51,7 +51,7 @@ * @class SortScroll * @extends Base * @constructor- * @namespace Plugin + * @namespace Plugin */ _yuitest_coverfunc("build/sortable-scroll/sortable-scroll.js", "(anonymous 1)", 1);@@ -118,4 +118,4 @@ -}, '3.7.2', {"requires": ["dd-scroll", "sortable"]});+}, '3.7.3', {"requires": ["dd-scroll", "sortable"]});
bundle/sortable-scroll/sortable-scroll-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,7 +17,7 @@ * @class SortScroll * @extends Base * @constructor- * @namespace Plugin + * @namespace Plugin */ var SortScroll = function() {@@ -70,4 +70,4 @@ -}, '3.7.2', {"requires": ["dd-scroll", "sortable"]});+}, '3.7.3', {"requires": ["dd-scroll", "sortable"]});
bundle/sortable-scroll/sortable-scroll-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("sortable-scroll",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(){var t=this.get("host");t.plug(e.Plugin.DDNodeScroll,{node:t.get("container")}),t.delegate.on("drop:over",function(t){this.dd.nodescroll&&t.drag.nodescroll&&t.drag.nodescroll.set("parentScroll",e.one(this.get("container")))})}},{ATTRS:{host:{value:""}},NAME:"SortScroll",NS:"scroll"}),e.namespace("Y.Plugin"),e.Plugin.SortableScroll=n},"3.7.2",{requires:["dd-scroll","sortable"]});+YUI.add("sortable-scroll",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)};e.extend(n,e.Base,{initializer:function(){var t=this.get("host");t.plug(e.Plugin.DDNodeScroll,{node:t.get("container")}),t.delegate.on("drop:over",function(t){this.dd.nodescroll&&t.drag.nodescroll&&t.drag.nodescroll.set("parentScroll",e.one(this.get("container")))})}},{ATTRS:{host:{value:""}},NAME:"SortScroll",NS:"scroll"}),e.namespace("Y.Plugin"),e.Plugin.SortableScroll=n},"3.7.3",{requires:["dd-scroll","sortable"]});
bundle/sortable-scroll/sortable-scroll.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -17,7 +17,7 @@ * @class SortScroll * @extends Base * @constructor- * @namespace Plugin + * @namespace Plugin */ var SortScroll = function() {@@ -70,4 +70,4 @@ -}, '3.7.2', {"requires": ["dd-scroll", "sortable"]});+}, '3.7.3', {"requires": ["dd-scroll", "sortable"]});
bundle/sortable/sortable-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,9 +32,9 @@ path: "build/sortable/sortable.js", code: [] };-_yuitest_coverage["build/sortable/sortable.js"].code=["YUI.add('sortable', function (Y, NAME) {","",""," /**"," * The class allows you to create a Drag & Drop reordered list."," * @module sortable"," */ "," /**"," * The class allows you to create a Drag & Drop reordered list."," * @class Sortable"," * @extends Base"," * @constructor"," */","",""," var Sortable = function(o) {"," Sortable.superclass.constructor.apply(this, arguments);"," },"," CURRENT_NODE = 'currentNode',"," OPACITY_NODE = 'opacityNode',"," CONT = 'container',"," ID = 'id',"," ZINDEX = 'zIndex',"," OPACITY = 'opacity',"," PARENT_NODE = 'parentNode',"," NODES = 'nodes',"," NODE = 'node';","",""," Y.extend(Sortable, Y.Base, {"," /**"," * @property delegate"," * @type DD.Delegate"," * @description A reference to the DD.Delegate instance."," */"," delegate: null,"," /**"," * @property drop"," * @type DD.Drop"," * @description A reference to the DD.Drop instance"," */"," drop: null,"," initializer: function() {"," var id = 'sortable-' + Y.guid(),"," delConfig = {"," container: this.get(CONT),"," nodes: this.get(NODES),"," target: true,"," invalid: this.get('invalid'),"," dragConfig: {"," groups: [ id ]"," }"," }, del;",""," if (this.get('handles')) {"," delConfig.handles = this.get('handles');"," }"," del = new Y.DD.Delegate(delConfig);",""," this.set(ID, id);",""," del.dd.plug(Y.Plugin.DDProxy, {"," moveOnEnd: false,"," cloneNode: true"," });",""," this.drop = new Y.DD.Drop({"," node: this.get(CONT),"," bubbleTarget: del,"," groups: del.dd.get('groups')"," });"," this.drop.on('drop:enter', Y.bind(this._onDropEnter, this));"," "," del.on({"," 'drag:start': Y.bind(this._onDragStart, this),"," 'drag:end': Y.bind(this._onDragEnd, this),"," 'drag:over': Y.bind(this._onDragOver, this),"," 'drag:drag': Y.bind(this._onDrag, this)"," });",""," this.delegate = del;"," Sortable.reg(this, id);"," },"," _up: null,"," _y: null,"," _onDrag: function(e) {"," if (e.pageY < this._y) {"," this._up = true; "," } else if (e.pageY > this._y) { "," this._up = false; "," } ",""," this._y = e.pageY;"," },"," /**"," * @private"," * @method _onDropEnter"," * @param Event e The Event Object"," * @description Handles the DropEnter event to append a new node to a target."," */"," _onDropEnter: function(e) {"," var dropNode = e.drop.get(NODE),"," dragNode = e.drag.get(NODE);",""," if (!dropNode.test(this.get(NODES)) &&"," !dragNode.get(PARENT_NODE).compareTo(dropNode)) {"," dropNode.append(dragNode);"," }"," },"," /**"," * @private"," * @method _onDragOver"," * @param Event e The Event Object"," * @description Handles the DragOver event that moves the object in the list or to another list."," */"," _onDragOver: function(e) {"," if (!e.drop.get(NODE).test(this.get(NODES))) {"," return;"," }"," if (e.drag.get(NODE) == e.drop.get(NODE)) {"," return;"," }"," // is drop a child of drag?"," if (e.drag.get(NODE).contains(e.drop.get(NODE))) {"," return;"," }"," var same = false, dir, oldNode, newNode, dropsort, dropNode,"," moveType = this.get('moveType').toLowerCase();",""," if (e.drag.get(NODE).get(PARENT_NODE).contains(e.drop.get(NODE))) {"," same = true;"," }"," if (same && moveType == 'move') {"," moveType = 'insert';"," }"," switch (moveType) {"," case 'insert':"," dir = ((this._up) ? 'before' : 'after');"," dropNode = e.drop.get(NODE);"," if (Y.Sortable._test(dropNode, this.get(CONT))) {"," dropNode.append(e.drag.get(NODE));"," } else {"," dropNode.insert(e.drag.get(NODE), dir);"," }"," break;"," case 'swap':"," Y.DD.DDM.swapNode(e.drag, e.drop);"," break;"," case 'move':"," case 'copy':"," dropsort = Y.Sortable.getSortable(e.drop.get(NODE).get(PARENT_NODE));",""," if (!dropsort) {"," return;"," }"," "," Y.DD.DDM.getDrop(e.drag.get(NODE)).addToGroup(dropsort.get(ID));",""," //Same List"," if (same) {"," Y.DD.DDM.swapNode(e.drag, e.drop);"," } else {"," if (this.get('moveType') == 'copy') {"," //New List"," oldNode = e.drag.get(NODE);"," newNode = oldNode.cloneNode(true);",""," newNode.set(ID, '');"," e.drag.set(NODE, newNode);"," dropsort.delegate.createDrop(newNode, [dropsort.get(ID)]);"," oldNode.setStyles({"," top: '',"," left: ''"," });"," }"," e.drop.get(NODE).insert(e.drag.get(NODE), 'before');"," }"," break;"," }",""," this.fire(moveType, { same: same, drag: e.drag, drop: e.drop });"," this.fire('moved', { same: same, drag: e.drag, drop: e.drop });"," },"," /**"," * @private"," * @method _onDragStart"," * @param Event e The Event Object"," * @description Handles the DragStart event and initializes some settings."," */"," _onDragStart: function(e) {"," var del = this.delegate,"," lastNode = del.get('lastNode');"," if (lastNode && lastNode.getDOMNode()) {"," lastNode.setStyle(ZINDEX, '');"," }"," del.get(this.get(OPACITY_NODE)).setStyle(OPACITY, this.get(OPACITY));"," del.get(CURRENT_NODE).setStyle(ZINDEX, '999');"," },"," /**"," * @private"," * @method _onDragEnd"," * @param Event e The Event Object"," * @description Handles the DragEnd event that cleans up the settings in the drag:start event."," */"," _onDragEnd: function(e) {"," this.delegate.get(this.get(OPACITY_NODE)).setStyle(OPACITY, 1);"," this.delegate.get(CURRENT_NODE).setStyles({"," top: '',"," left: ''"," });"," this.sync();"," },"," /**"," * @method plug"," * @param Class cls The class to plug"," * @param Object config The class config"," * @description Passthrough to the DD.Delegate.ddplug method"," * @chainable"," */"," plug: function(cls, config) {"," //I don't like this.. Not at all, need to discuss with the team"," if (cls && cls.NAME.substring(0, 4).toLowerCase() === 'sort') {"," this.constructor.superclass.plug.call(this, cls, config);"," } else {"," this.delegate.dd.plug(cls, config);"," }"," return this;"," },"," /**"," * @method sync"," * @description Passthrough to the DD.Delegate syncTargets method."," * @chainable"," */"," sync: function() {"," this.delegate.syncTargets();"," return this;"," },"," destructor: function() {"," this.drop.destroy();"," this.delegate.destroy();"," Sortable.unreg(this, this.get(ID));"," },"," /**"," * @method join"," * @param Sortable sel The Sortable list to join with"," * @param String type The type of join to do: full, inner, outer, none. Default: full"," * @description Join this Sortable with another Sortable instance."," * <ul>"," * <li>full: Exchange nodes with both lists.</li>"," * <li>inner: Items can go into this list from the joined list.</li>"," * <li>outer: Items can go out of the joined list into this list.</li>"," * <li>none: Removes the join.</li>"," * </ul>"," * @chainable"," */"," join: function(sel, type) {"," if (!(sel instanceof Y.Sortable)) {"," Y.error('Sortable: join needs a Sortable Instance');"," return this;"," }"," if (!type) {"," type = 'full';"," }"," type = type.toLowerCase();"," var method = '_join_' + type;",""," if (this[method]) {"," this[method](sel);"," }"," "," return this;"," },"," /**"," * @private"," * @method _join_none"," * @param Sortable sel The Sortable to remove the join from"," * @description Removes the join with the passed Sortable."," */"," _join_none: function(sel) {"," this.delegate.dd.removeFromGroup(sel.get(ID));"," sel.delegate.dd.removeFromGroup(this.get(ID));"," },"," /**"," * @private"," * @method _join_full"," * @param Sortable sel The Sortable list to join with"," * @description Joins both of the Sortables together."," */"," _join_full: function(sel) {"," this.delegate.dd.addToGroup(sel.get(ID));"," sel.delegate.dd.addToGroup(this.get(ID));"," },"," /**"," * @private"," * @method _join_outer"," * @param Sortable sel The Sortable list to join with"," * @description Allows this Sortable to accept items from the passed Sortable."," */"," _join_outer: function(sel) {"," this.delegate.dd.addToGroup(sel.get(ID));"," },"," /**"," * @private"," * @method _join_inner"," * @param Sortable sel The Sortable list to join with"," * @description Allows this Sortable to give items to the passed Sortable."," */"," _join_inner: function(sel) {"," sel.delegate.dd.addToGroup(this.get(ID));"," },"," /**"," * A custom callback to allow a user to extract some sort of id or any other data from the node to use in the \"ordering list\" and then that data should be returned from the callback."," * @method getOrdering"," * @param Function callback "," * @return Array"," */"," getOrdering: function(callback) {"," var ordering = [];",""," if (!Y.Lang.isFunction(callback)) {"," callback = function (node) {"," return node;"," };"," }",""," Y.one(this.get(CONT)).all(this.get(NODES)).each(function(node) {"," ordering.push(callback(node));"," });"," return ordering;"," }"," }, {"," NAME: 'sortable',"," ATTRS: {"," /**"," * @attribute handles"," * @description Drag handles to pass on to the internal DD.Delegate instance."," * @type Array"," */ "," handles: {"," value: false"," },"," /**"," * @attribute container"," * @description A selector query to get the container to listen for mousedown events on. All \"nodes\" should be a child of this container."," * @type String"," */ "," container: {"," value: 'body'"," },"," /**"," * @attribute nodes"," * @description A selector query to get the children of the \"container\" to make draggable elements from."," * @type String"," */ "," nodes: {"," value: '.dd-draggable'"," },"," /**"," * @attribute opacity"," * @description The opacity to change the proxy item to when dragging."," * @type String"," */ "," opacity: {"," value: '.75'"," },"," /**"," * @attribute opacityNode"," * @description The node to set opacity on when dragging (dragNode or currentNode). Default: currentNode."," * @type String"," */ "," opacityNode: {"," value: 'currentNode'"," },"," /**"," * @attribute id"," * @description The id of this Sortable, used to get a reference to this Sortable list from another list."," * @type String"," */ "," id: {"," value: null"," },"," /**"," * @attribute moveType"," * @description How should an item move to another list: insert, swap, move, copy. Default: insert"," * @type String"," */ "," moveType: {"," value: 'insert'"," },"," /**"," * @attribute invalid"," * @description A selector string to test if a list item is invalid and not sortable"," * @type String"," */ "," invalid: {"," value: ''"," }"," },"," /**"," * @static"," * @property _sortables"," * @private"," * @type Object"," * @description Hash map of all Sortables on the page."," */"," _sortables: {},"," /**"," * @static"," * @method _test"," * @param {Node} node The node instance to test."," * @param {String|Node} test The node instance or selector string to test against."," * @description Test a Node or a selector for the container"," */"," _test: function(node, test) {"," var ret;"," if (test instanceof Y.Node) {"," ret = (test === node);"," } else {"," ret = node.test(test);"," }"," return ret;"," },"," /**"," * @static"," * @method getSortable"," * @param {String|Node} node The node instance or selector string to use to find a Sortable instance."," * @description Get a Sortable instance back from a node reference or a selector string."," */"," getSortable: function(node) {"," var s = null,"," id = null;"," node = Y.one(node);"," id = node.get(ID);"," if(id && Y.Sortable._sortables[id]) {"," return Y.Sortable._sortables[id];"," }"," Y.Object.each(Y.Sortable._sortables, function(v) {"," if (Y.Sortable._test(node, v.get(CONT))) {"," s = v;"," }"," });"," return s;"," },"," /**"," * @static"," * @method reg"," * @param Sortable s A Sortable instance."," * @param String id (optional) The id of the sortable instance."," * @description Register a Sortable instance with the singleton to allow lookups later."," */"," reg: function(s, id) {"," if (!id) {"," id = s.get(ID);"," }"," Y.Sortable._sortables[id] = s;"," },"," /**"," * @static"," * @method unreg"," * @param Sortable s A Sortable instance."," * @param String id (optional) The id of the sortable instance."," * @description Unregister a Sortable instance with the singleton."," */"," unreg: function(s, id) {"," if (!id) {"," id = s.get(ID);"," }"," if (id && Y.Sortable._sortables[id]) {"," delete Y.Sortable._sortables[id];"," return;"," }"," Y.Object.each(Y.Sortable._sortables, function(v, k) {"," if (v === s) {"," delete Sortable._sortables[k];"," }"," });"," }"," });",""," Y.Sortable = Sortable;",""," /**"," * @event copy"," * @description A Sortable node was moved with a copy."," * @param {Event.Facade} event An Event Facade object"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event move"," * @description A Sortable node was moved with a move."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event insert"," * @description A Sortable node was moved with an insert."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event swap"," * @description A Sortable node was moved with a swap."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event moved"," * @description A Sortable node was moved."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */","","","","}, '3.7.2', {\"requires\": [\"dd-delegate\", \"dd-drop-plugin\", \"dd-proxy\"]});"];-_yuitest_coverage["build/sortable/sortable.js"].lines = {"1":0,"16":0,"17":0,"30":0,"44":0,"55":0,"56":0,"58":0,"60":0,"62":0,"67":0,"72":0,"74":0,"81":0,"82":0,"87":0,"88":0,"89":0,"90":0,"93":0,"102":0,"105":0,"107":0,"117":0,"118":0,"120":0,"121":0,"124":0,"125":0,"127":0,"130":0,"131":0,"133":0,"134":0,"136":0,"138":0,"139":0,"140":0,"141":0,"143":0,"145":0,"147":0,"148":0,"151":0,"153":0,"154":0,"157":0,"160":0,"161":0,"163":0,"165":0,"166":0,"168":0,"169":0,"170":0,"171":0,"176":0,"178":0,"181":0,"182":0,"191":0,"193":0,"194":0,"196":0,"197":0,"206":0,"207":0,"211":0,"222":0,"223":0,"225":0,"227":0,"235":0,"236":0,"239":0,"240":0,"241":0,"257":0,"258":0,"259":0,"261":0,"262":0,"264":0,"265":0,"267":0,"268":0,"271":0,"280":0,"281":0,"290":0,"291":0,"300":0,"309":0,"318":0,"320":0,"321":0,"322":0,"326":0,"327":0,"329":0,"415":0,"416":0,"417":0,"419":0,"421":0,"430":0,"432":0,"433":0,"434":0,"435":0,"437":0,"438":0,"439":0,"442":0,"452":0,"453":0,"455":0,"465":0,"466":0,"468":0,"469":0,"470":0,"472":0,"473":0,"474":0,"480":0};-_yuitest_coverage["build/sortable/sortable.js"].functions = {"Sortable:16":0,"initializer:43":0,"_onDrag:86":0,"_onDropEnter:101":0,"_onDragOver:116":0,"_onDragStart:190":0,"_onDragEnd:205":0,"plug:220":0,"sync:234":0,"destructor:238":0,"join:256":0,"_join_none:279":0,"_join_full:289":0,"_join_outer:299":0,"_join_inner:308":0,"callback:321":0,"(anonymous 2):326":0,"getOrdering:317":0,"_test:414":0,"(anonymous 3):437":0,"getSortable:429":0,"reg:451":0,"(anonymous 4):472":0,"unreg:464":0,"(anonymous 1):1":0};+_yuitest_coverage["build/sortable/sortable.js"].code=["YUI.add('sortable', function (Y, NAME) {","",""," /**"," * The class allows you to create a Drag & Drop reordered list."," * @module sortable"," */"," /**"," * The class allows you to create a Drag & Drop reordered list."," * @class Sortable"," * @extends Base"," * @constructor"," */","",""," var Sortable = function() {"," Sortable.superclass.constructor.apply(this, arguments);"," },"," CURRENT_NODE = 'currentNode',"," OPACITY_NODE = 'opacityNode',"," CONT = 'container',"," ID = 'id',"," ZINDEX = 'zIndex',"," OPACITY = 'opacity',"," PARENT_NODE = 'parentNode',"," NODES = 'nodes',"," NODE = 'node';","",""," Y.extend(Sortable, Y.Base, {"," /**"," * @property delegate"," * @type DD.Delegate"," * @description A reference to the DD.Delegate instance."," */"," delegate: null,"," /**"," * @property drop"," * @type DD.Drop"," * @description A reference to the DD.Drop instance"," */"," drop: null,"," initializer: function() {"," var id = 'sortable-' + Y.guid(),"," delConfig = {"," container: this.get(CONT),"," nodes: this.get(NODES),"," target: true,"," invalid: this.get('invalid'),"," dragConfig: {"," groups: [ id ]"," }"," }, del;",""," if (this.get('handles')) {"," delConfig.handles = this.get('handles');"," }"," del = new Y.DD.Delegate(delConfig);",""," this.set(ID, id);",""," del.dd.plug(Y.Plugin.DDProxy, {"," moveOnEnd: false,"," cloneNode: true"," });",""," this.drop = new Y.DD.Drop({"," node: this.get(CONT),"," bubbleTarget: del,"," groups: del.dd.get('groups')"," });"," this.drop.on('drop:enter', Y.bind(this._onDropEnter, this));"," "," del.on({"," 'drag:start': Y.bind(this._onDragStart, this),"," 'drag:end': Y.bind(this._onDragEnd, this),"," 'drag:over': Y.bind(this._onDragOver, this),"," 'drag:drag': Y.bind(this._onDrag, this)"," });",""," this.delegate = del;"," Sortable.reg(this, id);"," },"," _up: null,"," _y: null,"," _onDrag: function(e) {"," if (e.pageY < this._y) {"," this._up = true;"," } else if (e.pageY > this._y) {"," this._up = false;"," }",""," this._y = e.pageY;"," },"," /**"," * @private"," * @method _onDropEnter"," * @param Event e The Event Object"," * @description Handles the DropEnter event to append a new node to a target."," */"," _onDropEnter: function(e) {"," var dropNode = e.drop.get(NODE),"," dragNode = e.drag.get(NODE);",""," if (!dropNode.test(this.get(NODES)) &&"," !dragNode.get(PARENT_NODE).compareTo(dropNode)) {"," dropNode.append(dragNode);"," }"," },"," /**"," * @private"," * @method _onDragOver"," * @param Event e The Event Object"," * @description Handles the DragOver event that moves the object in the list or to another list."," */"," _onDragOver: function(e) {"," if (!e.drop.get(NODE).test(this.get(NODES))) {"," return;"," }"," if (e.drag.get(NODE) === e.drop.get(NODE)) {"," return;"," }"," // is drop a child of drag?"," if (e.drag.get(NODE).contains(e.drop.get(NODE))) {"," return;"," }"," var same = false, dir, oldNode, newNode, dropsort, dropNode,"," moveType = this.get('moveType').toLowerCase();",""," if (e.drag.get(NODE).get(PARENT_NODE).contains(e.drop.get(NODE))) {"," same = true;"," }"," if (same && moveType === 'move') {"," moveType = 'insert';"," }"," switch (moveType) {"," case 'insert':"," dir = ((this._up) ? 'before' : 'after');"," dropNode = e.drop.get(NODE);"," if (Y.Sortable._test(dropNode, this.get(CONT))) {"," dropNode.append(e.drag.get(NODE));"," } else {"," dropNode.insert(e.drag.get(NODE), dir);"," }"," break;"," case 'swap':"," Y.DD.DDM.swapNode(e.drag, e.drop);"," break;"," case 'move':"," case 'copy':"," dropsort = Y.Sortable.getSortable(e.drop.get(NODE).get(PARENT_NODE));",""," if (!dropsort) {"," return;"," }"," "," Y.DD.DDM.getDrop(e.drag.get(NODE)).addToGroup(dropsort.get(ID));",""," //Same List"," if (same) {"," Y.DD.DDM.swapNode(e.drag, e.drop);"," } else {"," if (this.get('moveType') === 'copy') {"," //New List"," oldNode = e.drag.get(NODE);"," newNode = oldNode.cloneNode(true);",""," newNode.set(ID, '');"," e.drag.set(NODE, newNode);"," dropsort.delegate.createDrop(newNode, [dropsort.get(ID)]);"," oldNode.setStyles({"," top: '',"," left: ''"," });"," }"," e.drop.get(NODE).insert(e.drag.get(NODE), 'before');"," }"," break;"," }",""," this.fire(moveType, { same: same, drag: e.drag, drop: e.drop });"," this.fire('moved', { same: same, drag: e.drag, drop: e.drop });"," },"," /**"," * @private"," * @method _onDragStart"," * @param Event e The Event Object"," * @description Handles the DragStart event and initializes some settings."," */"," _onDragStart: function() {"," var del = this.delegate,"," lastNode = del.get('lastNode');"," if (lastNode && lastNode.getDOMNode()) {"," lastNode.setStyle(ZINDEX, '');"," }"," del.get(this.get(OPACITY_NODE)).setStyle(OPACITY, this.get(OPACITY));"," del.get(CURRENT_NODE).setStyle(ZINDEX, '999');"," },"," /**"," * @private"," * @method _onDragEnd"," * @param Event e The Event Object"," * @description Handles the DragEnd event that cleans up the settings in the drag:start event."," */"," _onDragEnd: function() {"," this.delegate.get(this.get(OPACITY_NODE)).setStyle(OPACITY, 1);"," this.delegate.get(CURRENT_NODE).setStyles({"," top: '',"," left: ''"," });"," this.sync();"," },"," /**"," * @method plug"," * @param Class cls The class to plug"," * @param Object config The class config"," * @description Passthrough to the DD.Delegate.ddplug method"," * @chainable"," */"," plug: function(cls, config) {"," //I don't like this.. Not at all, need to discuss with the team"," if (cls && cls.NAME.substring(0, 4).toLowerCase() === 'sort') {"," this.constructor.superclass.plug.call(this, cls, config);"," } else {"," this.delegate.dd.plug(cls, config);"," }"," return this;"," },"," /**"," * @method sync"," * @description Passthrough to the DD.Delegate syncTargets method."," * @chainable"," */"," sync: function() {"," this.delegate.syncTargets();"," return this;"," },"," destructor: function() {"," this.drop.destroy();"," this.delegate.destroy();"," Sortable.unreg(this, this.get(ID));"," },"," /**"," * @method join"," * @param Sortable sel The Sortable list to join with"," * @param String type The type of join to do: full, inner, outer, none. Default: full"," * @description Join this Sortable with another Sortable instance."," * <ul>"," * <li>full: Exchange nodes with both lists.</li>"," * <li>inner: Items can go into this list from the joined list.</li>"," * <li>outer: Items can go out of the joined list into this list.</li>"," * <li>none: Removes the join.</li>"," * </ul>"," * @chainable"," */"," join: function(sel, type) {"," if (!(sel instanceof Y.Sortable)) {"," Y.error('Sortable: join needs a Sortable Instance');"," return this;"," }"," if (!type) {"," type = 'full';"," }"," type = type.toLowerCase();"," var method = '_join_' + type;",""," if (this[method]) {"," this[method](sel);"," }"," "," return this;"," },"," /**"," * @private"," * @method _join_none"," * @param Sortable sel The Sortable to remove the join from"," * @description Removes the join with the passed Sortable."," */"," _join_none: function(sel) {"," this.delegate.dd.removeFromGroup(sel.get(ID));"," sel.delegate.dd.removeFromGroup(this.get(ID));"," },"," /**"," * @private"," * @method _join_full"," * @param Sortable sel The Sortable list to join with"," * @description Joins both of the Sortables together."," */"," _join_full: function(sel) {"," this.delegate.dd.addToGroup(sel.get(ID));"," sel.delegate.dd.addToGroup(this.get(ID));"," },"," /**"," * @private"," * @method _join_outer"," * @param Sortable sel The Sortable list to join with"," * @description Allows this Sortable to accept items from the passed Sortable."," */"," _join_outer: function(sel) {"," this.delegate.dd.addToGroup(sel.get(ID));"," },"," /**"," * @private"," * @method _join_inner"," * @param Sortable sel The Sortable list to join with"," * @description Allows this Sortable to give items to the passed Sortable."," */"," _join_inner: function(sel) {"," sel.delegate.dd.addToGroup(this.get(ID));"," },"," /**"," * A custom callback to allow a user to extract some sort of id or any other data"," * from the node to use in the \"ordering list\" and then that data should be returned from the callback."," * @method getOrdering"," * @param Function callback"," * @return Array"," */"," getOrdering: function(callback) {"," var ordering = [];",""," if (!Y.Lang.isFunction(callback)) {"," callback = function (node) {"," return node;"," };"," }",""," Y.one(this.get(CONT)).all(this.get(NODES)).each(function(node) {"," ordering.push(callback(node));"," });"," return ordering;"," }"," }, {"," NAME: 'sortable',"," ATTRS: {"," /**"," * @attribute handles"," * @description Drag handles to pass on to the internal DD.Delegate instance."," * @type Array"," */"," handles: {"," value: false"," },"," /**"," * @attribute container"," * @description A selector query to get the container to listen for mousedown events on. All \"nodes\" should be a child of this container."," * @type String"," */"," container: {"," value: 'body'"," },"," /**"," * @attribute nodes"," * @description A selector query to get the children of the \"container\" to make draggable elements from."," * @type String"," */"," nodes: {"," value: '.dd-draggable'"," },"," /**"," * @attribute opacity"," * @description The opacity to change the proxy item to when dragging."," * @type String"," */"," opacity: {"," value: '.75'"," },"," /**"," * @attribute opacityNode"," * @description The node to set opacity on when dragging (dragNode or currentNode). Default: currentNode."," * @type String"," */"," opacityNode: {"," value: 'currentNode'"," },"," /**"," * @attribute id"," * @description The id of this Sortable, used to get a reference to this Sortable list from another list."," * @type String"," */"," id: {"," value: null"," },"," /**"," * @attribute moveType"," * @description How should an item move to another list: insert, swap, move, copy. Default: insert"," * @type String"," */"," moveType: {"," value: 'insert'"," },"," /**"," * @attribute invalid"," * @description A selector string to test if a list item is invalid and not sortable"," * @type String"," */"," invalid: {"," value: ''"," }"," },"," /**"," * @static"," * @property _sortables"," * @private"," * @type Object"," * @description Hash map of all Sortables on the page."," */"," _sortables: {},"," /**"," * @static"," * @method _test"," * @param {Node} node The node instance to test."," * @param {String|Node} test The node instance or selector string to test against."," * @description Test a Node or a selector for the container"," */"," _test: function(node, test) {"," var ret;"," if (test instanceof Y.Node) {"," ret = (test === node);"," } else {"," ret = node.test(test);"," }"," return ret;"," },"," /**"," * @static"," * @method getSortable"," * @param {String|Node} node The node instance or selector string to use to find a Sortable instance."," * @description Get a Sortable instance back from a node reference or a selector string."," */"," getSortable: function(node) {"," var s = null,"," id = null;"," node = Y.one(node);"," id = node.get(ID);"," if(id && Y.Sortable._sortables[id]) {"," return Y.Sortable._sortables[id];"," }"," Y.Object.each(Y.Sortable._sortables, function(v) {"," if (Y.Sortable._test(node, v.get(CONT))) {"," s = v;"," }"," });"," return s;"," },"," /**"," * @static"," * @method reg"," * @param Sortable s A Sortable instance."," * @param String id (optional) The id of the sortable instance."," * @description Register a Sortable instance with the singleton to allow lookups later."," */"," reg: function(s, id) {"," if (!id) {"," id = s.get(ID);"," }"," Y.Sortable._sortables[id] = s;"," },"," /**"," * @static"," * @method unreg"," * @param Sortable s A Sortable instance."," * @param String id (optional) The id of the sortable instance."," * @description Unregister a Sortable instance with the singleton."," */"," unreg: function(s, id) {"," if (!id) {"," id = s.get(ID);"," }"," if (id && Y.Sortable._sortables[id]) {"," delete Y.Sortable._sortables[id];"," return;"," }"," Y.Object.each(Y.Sortable._sortables, function(v, k) {"," if (v === s) {"," delete Sortable._sortables[k];"," }"," });"," }"," });",""," Y.Sortable = Sortable;",""," /**"," * @event copy"," * @description A Sortable node was moved with a copy."," * @param {Event.Facade} event An Event Facade object"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event move"," * @description A Sortable node was moved with a move."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event insert"," * @description A Sortable node was moved with an insert."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event swap"," * @description A Sortable node was moved with a swap."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */"," /**"," * @event moved"," * @description A Sortable node was moved."," * @param {Event.Facade} event An Event Facade object with the following specific property added:"," * @param {Boolean} event.same Moved to the same list."," * @param {DD.Drag} event.drag The drag instance."," * @param {DD.Drop} event.drop The drop instance."," * @type {Event.Custom}"," */","","","","}, '3.7.3', {\"requires\": [\"dd-delegate\", \"dd-drop-plugin\", \"dd-proxy\"]});"];+_yuitest_coverage["build/sortable/sortable.js"].lines = {"1":0,"16":0,"17":0,"30":0,"44":0,"55":0,"56":0,"58":0,"60":0,"62":0,"67":0,"72":0,"74":0,"81":0,"82":0,"87":0,"88":0,"89":0,"90":0,"93":0,"102":0,"105":0,"107":0,"117":0,"118":0,"120":0,"121":0,"124":0,"125":0,"127":0,"130":0,"131":0,"133":0,"134":0,"136":0,"138":0,"139":0,"140":0,"141":0,"143":0,"145":0,"147":0,"148":0,"151":0,"153":0,"154":0,"157":0,"160":0,"161":0,"163":0,"165":0,"166":0,"168":0,"169":0,"170":0,"171":0,"176":0,"178":0,"181":0,"182":0,"191":0,"193":0,"194":0,"196":0,"197":0,"206":0,"207":0,"211":0,"222":0,"223":0,"225":0,"227":0,"235":0,"236":0,"239":0,"240":0,"241":0,"257":0,"258":0,"259":0,"261":0,"262":0,"264":0,"265":0,"267":0,"268":0,"271":0,"280":0,"281":0,"290":0,"291":0,"300":0,"309":0,"319":0,"321":0,"322":0,"323":0,"327":0,"328":0,"330":0,"416":0,"417":0,"418":0,"420":0,"422":0,"431":0,"433":0,"434":0,"435":0,"436":0,"438":0,"439":0,"440":0,"443":0,"453":0,"454":0,"456":0,"466":0,"467":0,"469":0,"470":0,"471":0,"473":0,"474":0,"475":0,"481":0};+_yuitest_coverage["build/sortable/sortable.js"].functions = {"Sortable:16":0,"initializer:43":0,"_onDrag:86":0,"_onDropEnter:101":0,"_onDragOver:116":0,"_onDragStart:190":0,"_onDragEnd:205":0,"plug:220":0,"sync:234":0,"destructor:238":0,"join:256":0,"_join_none:279":0,"_join_full:289":0,"_join_outer:299":0,"_join_inner:308":0,"callback:322":0,"(anonymous 2):327":0,"getOrdering:318":0,"_test:415":0,"(anonymous 3):438":0,"getSortable:430":0,"reg:452":0,"(anonymous 4):473":0,"unreg:465":0,"(anonymous 1):1":0}; _yuitest_coverage["build/sortable/sortable.js"].coveredLines = 126; _yuitest_coverage["build/sortable/sortable.js"].coveredFunctions = 25; _yuitest_coverline("build/sortable/sortable.js", 1);@@ -44,7 +44,7 @@ /** * The class allows you to create a Drag & Drop reordered list. * @module sortable- */ + */ /** * The class allows you to create a Drag & Drop reordered list. * @class Sortable@@ -55,7 +55,7 @@ _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 1)", 1); _yuitest_coverline("build/sortable/sortable.js", 16);-var Sortable = function(o) {+var Sortable = function() { _yuitest_coverfunc("build/sortable/sortable.js", "Sortable", 16); _yuitest_coverline("build/sortable/sortable.js", 17); Sortable.superclass.constructor.apply(this, arguments);@@ -145,12 +145,12 @@ _yuitest_coverline("build/sortable/sortable.js", 87); if (e.pageY < this._y) { _yuitest_coverline("build/sortable/sortable.js", 88);-this._up = true; +this._up = true; } else {_yuitest_coverline("build/sortable/sortable.js", 89);-if (e.pageY > this._y) { +if (e.pageY > this._y) { _yuitest_coverline("build/sortable/sortable.js", 90);-this._up = false; - }} +this._up = false;+ }} _yuitest_coverline("build/sortable/sortable.js", 93); this._y = e.pageY;@@ -188,7 +188,7 @@ return; } _yuitest_coverline("build/sortable/sortable.js", 120);-if (e.drag.get(NODE) == e.drop.get(NODE)) {+if (e.drag.get(NODE) === e.drop.get(NODE)) { _yuitest_coverline("build/sortable/sortable.js", 121); return; }@@ -208,7 +208,7 @@ same = true; } _yuitest_coverline("build/sortable/sortable.js", 133);-if (same && moveType == 'move') {+if (same && moveType === 'move') { _yuitest_coverline("build/sortable/sortable.js", 134); moveType = 'insert'; }@@ -255,7 +255,7 @@ Y.DD.DDM.swapNode(e.drag, e.drop); } else { _yuitest_coverline("build/sortable/sortable.js", 163);-if (this.get('moveType') == 'copy') {+if (this.get('moveType') === 'copy') { //New List _yuitest_coverline("build/sortable/sortable.js", 165); oldNode = e.drag.get(NODE);@@ -292,7 +292,7 @@ * @param Event e The Event Object * @description Handles the DragStart event and initializes some settings. */- _onDragStart: function(e) {+ _onDragStart: function() { _yuitest_coverfunc("build/sortable/sortable.js", "_onDragStart", 190); _yuitest_coverline("build/sortable/sortable.js", 191); var del = this.delegate,@@ -313,7 +313,7 @@ * @param Event e The Event Object * @description Handles the DragEnd event that cleans up the settings in the drag:start event. */- _onDragEnd: function(e) {+ _onDragEnd: function() { _yuitest_coverfunc("build/sortable/sortable.js", "_onDragEnd", 205); _yuitest_coverline("build/sortable/sortable.js", 206); this.delegate.get(this.get(OPACITY_NODE)).setStyle(OPACITY, 1);@@ -457,33 +457,34 @@ sel.delegate.dd.addToGroup(this.get(ID)); }, /**- * A custom callback to allow a user to extract some sort of id or any other data from the node to use in the "ordering list" and then that data should be returned from the callback.+ * A custom callback to allow a user to extract some sort of id or any other data+ * from the node to use in the "ordering list" and then that data should be returned from the callback. * @method getOrdering- * @param Function callback + * @param Function callback * @return Array */ getOrdering: function(callback) {- _yuitest_coverfunc("build/sortable/sortable.js", "getOrdering", 317);-_yuitest_coverline("build/sortable/sortable.js", 318);+ _yuitest_coverfunc("build/sortable/sortable.js", "getOrdering", 318);+_yuitest_coverline("build/sortable/sortable.js", 319); var ordering = []; - _yuitest_coverline("build/sortable/sortable.js", 320);+ _yuitest_coverline("build/sortable/sortable.js", 321); if (!Y.Lang.isFunction(callback)) {- _yuitest_coverline("build/sortable/sortable.js", 321);+ _yuitest_coverline("build/sortable/sortable.js", 322); callback = function (node) {- _yuitest_coverfunc("build/sortable/sortable.js", "callback", 321);-_yuitest_coverline("build/sortable/sortable.js", 322);+ _yuitest_coverfunc("build/sortable/sortable.js", "callback", 322);+_yuitest_coverline("build/sortable/sortable.js", 323); return node; }; } - _yuitest_coverline("build/sortable/sortable.js", 326);+ _yuitest_coverline("build/sortable/sortable.js", 327); Y.one(this.get(CONT)).all(this.get(NODES)).each(function(node) {- _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 2)", 326);-_yuitest_coverline("build/sortable/sortable.js", 327);+ _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 2)", 327);+_yuitest_coverline("build/sortable/sortable.js", 328); ordering.push(callback(node)); });- _yuitest_coverline("build/sortable/sortable.js", 329);+ _yuitest_coverline("build/sortable/sortable.js", 330); return ordering; } }, {@@ -493,7 +494,7 @@ * @attribute handles * @description Drag handles to pass on to the internal DD.Delegate instance. * @type Array- */ + */ handles: { value: false },@@ -501,7 +502,7 @@ * @attribute container * @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container. * @type String- */ + */ container: { value: 'body' },@@ -509,7 +510,7 @@ * @attribute nodes * @description A selector query to get the children of the "container" to make draggable elements from. * @type String- */ + */ nodes: { value: '.dd-draggable' },@@ -517,7 +518,7 @@ * @attribute opacity * @description The opacity to change the proxy item to when dragging. * @type String- */ + */ opacity: { value: '.75' },@@ -525,7 +526,7 @@ * @attribute opacityNode * @description The node to set opacity on when dragging (dragNode or currentNode). Default: currentNode. * @type String- */ + */ opacityNode: { value: 'currentNode' },@@ -533,7 +534,7 @@ * @attribute id * @description The id of this Sortable, used to get a reference to this Sortable list from another list. * @type String- */ + */ id: { value: null },@@ -541,7 +542,7 @@ * @attribute moveType * @description How should an item move to another list: insert, swap, move, copy. Default: insert * @type String- */ + */ moveType: { value: 'insert' },@@ -549,7 +550,7 @@ * @attribute invalid * @description A selector string to test if a list item is invalid and not sortable * @type String- */ + */ invalid: { value: '' }@@ -570,18 +571,18 @@ * @description Test a Node or a selector for the container */ _test: function(node, test) {- _yuitest_coverfunc("build/sortable/sortable.js", "_test", 414);-_yuitest_coverline("build/sortable/sortable.js", 415);+ _yuitest_coverfunc("build/sortable/sortable.js", "_test", 415);+_yuitest_coverline("build/sortable/sortable.js", 416); var ret;- _yuitest_coverline("build/sortable/sortable.js", 416);+ _yuitest_coverline("build/sortable/sortable.js", 417); if (test instanceof Y.Node) {- _yuitest_coverline("build/sortable/sortable.js", 417);+ _yuitest_coverline("build/sortable/sortable.js", 418); ret = (test === node); } else {- _yuitest_coverline("build/sortable/sortable.js", 419);+ _yuitest_coverline("build/sortable/sortable.js", 420); ret = node.test(test); }- _yuitest_coverline("build/sortable/sortable.js", 421);+ _yuitest_coverline("build/sortable/sortable.js", 422); return ret; }, /**@@ -591,29 +592,29 @@ * @description Get a Sortable instance back from a node reference or a selector string. */ getSortable: function(node) {- _yuitest_coverfunc("build/sortable/sortable.js", "getSortable", 429);-_yuitest_coverline("build/sortable/sortable.js", 430);+ _yuitest_coverfunc("build/sortable/sortable.js", "getSortable", 430);+_yuitest_coverline("build/sortable/sortable.js", 431); var s = null, id = null;- _yuitest_coverline("build/sortable/sortable.js", 432);-node = Y.one(node); _yuitest_coverline("build/sortable/sortable.js", 433);-id = node.get(ID);+node = Y.one(node); _yuitest_coverline("build/sortable/sortable.js", 434);+id = node.get(ID);+ _yuitest_coverline("build/sortable/sortable.js", 435); if(id && Y.Sortable._sortables[id]) {- _yuitest_coverline("build/sortable/sortable.js", 435);+ _yuitest_coverline("build/sortable/sortable.js", 436); return Y.Sortable._sortables[id]; }- _yuitest_coverline("build/sortable/sortable.js", 437);+ _yuitest_coverline("build/sortable/sortable.js", 438); Y.Object.each(Y.Sortable._sortables, function(v) {- _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 3)", 437);-_yuitest_coverline("build/sortable/sortable.js", 438);+ _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 3)", 438);+_yuitest_coverline("build/sortable/sortable.js", 439); if (Y.Sortable._test(node, v.get(CONT))) {- _yuitest_coverline("build/sortable/sortable.js", 439);+ _yuitest_coverline("build/sortable/sortable.js", 440); s = v; } });- _yuitest_coverline("build/sortable/sortable.js", 442);+ _yuitest_coverline("build/sortable/sortable.js", 443); return s; }, /**@@ -624,13 +625,13 @@ * @description Register a Sortable instance with the singleton to allow lookups later. */ reg: function(s, id) {- _yuitest_coverfunc("build/sortable/sortable.js", "reg", 451);-_yuitest_coverline("build/sortable/sortable.js", 452);+ _yuitest_coverfunc("build/sortable/sortable.js", "reg", 452);+_yuitest_coverline("build/sortable/sortable.js", 453); if (!id) {- _yuitest_coverline("build/sortable/sortable.js", 453);+ _yuitest_coverline("build/sortable/sortable.js", 454); id = s.get(ID); }- _yuitest_coverline("build/sortable/sortable.js", 455);+ _yuitest_coverline("build/sortable/sortable.js", 456); Y.Sortable._sortables[id] = s; }, /**@@ -641,32 +642,32 @@ * @description Unregister a Sortable instance with the singleton. */ unreg: function(s, id) {- _yuitest_coverfunc("build/sortable/sortable.js", "unreg", 464);-_yuitest_coverline("build/sortable/sortable.js", 465);+ _yuitest_coverfunc("build/sortable/sortable.js", "unreg", 465);+_yuitest_coverline("build/sortable/sortable.js", 466); if (!id) {- _yuitest_coverline("build/sortable/sortable.js", 466);+ _yuitest_coverline("build/sortable/sortable.js", 467); id = s.get(ID); }- _yuitest_coverline("build/sortable/sortable.js", 468);+ _yuitest_coverline("build/sortable/sortable.js", 469); if (id && Y.Sortable._sortables[id]) {- _yuitest_coverline("build/sortable/sortable.js", 469);-delete Y.Sortable._sortables[id]; _yuitest_coverline("build/sortable/sortable.js", 470);+delete Y.Sortable._sortables[id];+ _yuitest_coverline("build/sortable/sortable.js", 471); return; }- _yuitest_coverline("build/sortable/sortable.js", 472);+ _yuitest_coverline("build/sortable/sortable.js", 473); Y.Object.each(Y.Sortable._sortables, function(v, k) {- _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 4)", 472);-_yuitest_coverline("build/sortable/sortable.js", 473);+ _yuitest_coverfunc("build/sortable/sortable.js", "(anonymous 4)", 473);+_yuitest_coverline("build/sortable/sortable.js", 474); if (v === s) {- _yuitest_coverline("build/sortable/sortable.js", 474);+ _yuitest_coverline("build/sortable/sortable.js", 475); delete Sortable._sortables[k]; } }); } }); - _yuitest_coverline("build/sortable/sortable.js", 480);+ _yuitest_coverline("build/sortable/sortable.js", 481); Y.Sortable = Sortable; /**@@ -717,4 +718,4 @@ -}, '3.7.2', {"requires": ["dd-delegate", "dd-drop-plugin", "dd-proxy"]});+}, '3.7.3', {"requires": ["dd-delegate", "dd-drop-plugin", "dd-proxy"]});
bundle/sortable/sortable-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -10,7 +10,7 @@ /** * The class allows you to create a Drag & Drop reordered list. * @module sortable- */ + */ /** * The class allows you to create a Drag & Drop reordered list. * @class Sortable@@ -19,7 +19,7 @@ */ - var Sortable = function(o) {+ var Sortable = function() { Sortable.superclass.constructor.apply(this, arguments); }, CURRENT_NODE = 'currentNode',@@ -91,10 +91,10 @@ _y: null, _onDrag: function(e) { if (e.pageY < this._y) {- this._up = true; - } else if (e.pageY > this._y) { - this._up = false; - } + this._up = true;+ } else if (e.pageY > this._y) {+ this._up = false;+ } this._y = e.pageY; },@@ -123,7 +123,7 @@ if (!e.drop.get(NODE).test(this.get(NODES))) { return; }- if (e.drag.get(NODE) == e.drop.get(NODE)) {+ if (e.drag.get(NODE) === e.drop.get(NODE)) { return; } // is drop a child of drag?@@ -136,7 +136,7 @@ if (e.drag.get(NODE).get(PARENT_NODE).contains(e.drop.get(NODE))) { same = true; }- if (same && moveType == 'move') {+ if (same && moveType === 'move') { moveType = 'insert'; } switch (moveType) {@@ -167,7 +167,7 @@ if (same) { Y.DD.DDM.swapNode(e.drag, e.drop); } else {- if (this.get('moveType') == 'copy') {+ if (this.get('moveType') === 'copy') { //New List oldNode = e.drag.get(NODE); newNode = oldNode.cloneNode(true);@@ -194,7 +194,7 @@ * @param Event e The Event Object * @description Handles the DragStart event and initializes some settings. */- _onDragStart: function(e) {+ _onDragStart: function() { var del = this.delegate, lastNode = del.get('lastNode'); if (lastNode && lastNode.getDOMNode()) {@@ -209,7 +209,7 @@ * @param Event e The Event Object * @description Handles the DragEnd event that cleans up the settings in the drag:start event. */- _onDragEnd: function(e) {+ _onDragEnd: function() { this.delegate.get(this.get(OPACITY_NODE)).setStyle(OPACITY, 1); this.delegate.get(CURRENT_NODE).setStyles({ top: '',@@ -316,9 +316,10 @@ sel.delegate.dd.addToGroup(this.get(ID)); }, /**- * A custom callback to allow a user to extract some sort of id or any other data from the node to use in the "ordering list" and then that data should be returned from the callback.+ * A custom callback to allow a user to extract some sort of id or any other data+ * from the node to use in the "ordering list" and then that data should be returned from the callback. * @method getOrdering- * @param Function callback + * @param Function callback * @return Array */ getOrdering: function(callback) {@@ -342,7 +343,7 @@ * @attribute handles * @description Drag handles to pass on to the internal DD.Delegate instance. * @type Array- */ + */ handles: { value: false },@@ -350,7 +351,7 @@ * @attribute container * @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container. * @type String- */ + */ container: { value: 'body' },@@ -358,7 +359,7 @@ * @attribute nodes * @description A selector query to get the children of the "container" to make draggable elements from. * @type String- */ + */ nodes: { value: '.dd-draggable' },@@ -366,7 +367,7 @@ * @attribute opacity * @description The opacity to change the proxy item to when dragging. * @type String- */ + */ opacity: { value: '.75' },@@ -374,7 +375,7 @@ * @attribute opacityNode * @description The node to set opacity on when dragging (dragNode or currentNode). Default: currentNode. * @type String- */ + */ opacityNode: { value: 'currentNode' },@@ -382,7 +383,7 @@ * @attribute id * @description The id of this Sortable, used to get a reference to this Sortable list from another list. * @type String- */ + */ id: { value: null },@@ -390,7 +391,7 @@ * @attribute moveType * @description How should an item move to another list: insert, swap, move, copy. Default: insert * @type String- */ + */ moveType: { value: 'insert' },@@ -398,7 +399,7 @@ * @attribute invalid * @description A selector string to test if a list item is invalid and not sortable * @type String- */ + */ invalid: { value: '' }@@ -534,4 +535,4 @@ -}, '3.7.2', {"requires": ["dd-delegate", "dd-drop-plugin", "dd-proxy"]});+}, '3.7.3', {"requires": ["dd-delegate", "dd-drop-plugin", "dd-proxy"]});
bundle/sortable/sortable-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("sortable",function(e,t){var n=function(e){n.superclass.constructor.apply(this,arguments)},r="currentNode",i="opacityNode",s="container",o="id",u="zIndex",a="opacity",f="parentNode",l="nodes",c="node";e.extend(n,e.Base,{delegate:null,drop:null,initializer:function(){var t="sortable-"+e.guid(),r={container:this.get(s),nodes:this.get(l),target:!0,invalid:this.get("invalid"),dragConfig:{groups:[t]}},i;this.get("handles")&&(r.handles=this.get("handles")),i=new e.DD.Delegate(r),this.set(o,t),i.dd.plug(e.Plugin.DDProxy,{moveOnEnd:!1,cloneNode:!0}),this.drop=new e.DD.Drop({node:this.get(s),bubbleTarget:i,groups:i.dd.get("groups")}),this.drop.on("drop:enter",e.bind(this._onDropEnter,this)),i.on({"drag:start":e.bind(this._onDragStart,this),"drag:end":e.bind(this._onDragEnd,this),"drag:over":e.bind(this._onDragOver,this),"drag:drag":e.bind(this._onDrag,this)}),this.delegate=i,n.reg(this,t)},_up:null,_y:null,_onDrag:function(e){e.pageY<this._y?this._up=!0:e.pageY>this._y&&(this._up=!1),this._y=e.pageY},_onDropEnter:function(e){var t=e.drop.get(c),n=e.drag.get(c);!t.test(this.get(l))&&!n.get(f).compareTo(t)&&t.append(n)},_onDragOver:function(t){if(!t.drop.get(c).test(this.get(l)))return;if(t.drag.get(c)==t.drop.get(c))return;if(t.drag.get(c).contains(t.drop.get(c)))return;var n=!1,r,i,u,a,h,p=this.get("moveType").toLowerCase();t.drag.get(c).get(f).contains(t.drop.get(c))&&(n=!0),n&&p=="move"&&(p="insert");switch(p){case"insert":r=this._up?"before":"after",h=t.drop.get(c),e.Sortable._test(h,this.get(s))?h.append(t.drag.get(c)):h.insert(t.drag.get(c),r);break;case"swap":e.DD.DDM.swapNode(t.drag,t.drop);break;case"move":case"copy":a=e.Sortable.getSortable(t.drop.get(c).get(f));if(!a)return;e.DD.DDM.getDrop(t.drag.get(c)).addToGroup(a.get(o)),n?e.DD.DDM.swapNode(t.drag,t.drop):(this.get("moveType")=="copy"&&(i=t.drag.get(c),u=i.cloneNode(!0),u.set(o,""),t.drag.set(c,u),a.delegate.createDrop(u,[a.get(o)]),i.setStyles({top:"",left:""})),t.drop.get(c).insert(t.drag.get(c),"before"))}this.fire(p,{same:n,drag:t.drag,drop:t.drop}),this.fire("moved",{same:n,drag:t.drag,drop:t.drop})},_onDragStart:function(e){var t=this.delegate,n=t.get("lastNode");n&&n.getDOMNode()&&n.setStyle(u,""),t.get(this.get(i)).setStyle(a,this.get(a)),t.get(r).setStyle(u,"999")},_onDragEnd:function(e){this.delegate.get(this.get(i)).setStyle(a,1),this.delegate.get(r).setStyles({top:"",left:""}),this.sync()},plug:function(e,t){return e&&e.NAME.substring(0,4).toLowerCase()==="sort"?this.constructor.superclass.plug.call(this,e,t):this.delegate.dd.plug(e,t),this},sync:function(){return this.delegate.syncTargets(),this},destructor:function(){this.drop.destroy(),this.delegate.destroy(),n.unreg(this,this.get(o))},join:function(t,n){if(t instanceof e.Sortable){n||(n="full"),n=n.toLowerCase();var r="_join_"+n;return this[r]&&this[r](t),this}return e.error("Sortable: join needs a Sortable Instance"),this},_join_none:function(e){this.delegate.dd.removeFromGroup(e.get(o)),e.delegate.dd.removeFromGroup(this.get(o))},_join_full:function(e){this.delegate.dd.addToGroup(e.get(o)),e.delegate.dd.addToGroup(this.get(o))},_join_outer:function(e){this.delegate.dd.addToGroup(e.get(o))},_join_inner:function(e){e.delegate.dd.addToGroup(this.get(o))},getOrdering:function(t){var n=[];return e.Lang.isFunction(t)||(t=function(e){return e}),e.one(this.get(s)).all(this.get(l)).each(function(e){n.push(t(e))}),n}},{NAME:"sortable",ATTRS:{handles:{value:!1},container:{value:"body"},nodes:{value:".dd-draggable"},opacity:{value:".75"},opacityNode:{value:"currentNode"},id:{value:null},moveType:{value:"insert"},invalid:{value:""}},_sortables:{},_test:function(t,n){var r;return n instanceof e.Node?r=n===t:r=t.test(n),r},getSortable:function(t){var n=null,r=null;return t=e.one(t),r=t.get(o),r&&e.Sortable._sortables[r]?e.Sortable._sortables[r]:(e.Object.each(e.Sortable._sortables,function(r){e.Sortable._test(t,r.get(s))&&(n=r)}),n)},reg:function(t,n){n||(n=t.get(o)),e.Sortable._sortables[n]=t},unreg:function(t,r){r||(r=t.get(o));if(r&&e.Sortable._sortables[r]){delete e.Sortable._sortables[r];return}e.Object.each(e.Sortable._sortables,function(e,r){e===t&&delete n._sortables[r]})}}),e.Sortable=n},"3.7.2",{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]});+YUI.add("sortable",function(e,t){var n=function(){n.superclass.constructor.apply(this,arguments)},r="currentNode",i="opacityNode",s="container",o="id",u="zIndex",a="opacity",f="parentNode",l="nodes",c="node";e.extend(n,e.Base,{delegate:null,drop:null,initializer:function(){var t="sortable-"+e.guid(),r={container:this.get(s),nodes:this.get(l),target:!0,invalid:this.get("invalid"),dragConfig:{groups:[t]}},i;this.get("handles")&&(r.handles=this.get("handles")),i=new e.DD.Delegate(r),this.set(o,t),i.dd.plug(e.Plugin.DDProxy,{moveOnEnd:!1,cloneNode:!0}),this.drop=new e.DD.Drop({node:this.get(s),bubbleTarget:i,groups:i.dd.get("groups")}),this.drop.on("drop:enter",e.bind(this._onDropEnter,this)),i.on({"drag:start":e.bind(this._onDragStart,this),"drag:end":e.bind(this._onDragEnd,this),"drag:over":e.bind(this._onDragOver,this),"drag:drag":e.bind(this._onDrag,this)}),this.delegate=i,n.reg(this,t)},_up:null,_y:null,_onDrag:function(e){e.pageY<this._y?this._up=!0:e.pageY>this._y&&(this._up=!1),this._y=e.pageY},_onDropEnter:function(e){var t=e.drop.get(c),n=e.drag.get(c);!t.test(this.get(l))&&!n.get(f).compareTo(t)&&t.append(n)},_onDragOver:function(t){if(!t.drop.get(c).test(this.get(l)))return;if(t.drag.get(c)===t.drop.get(c))return;if(t.drag.get(c).contains(t.drop.get(c)))return;var n=!1,r,i,u,a,h,p=this.get("moveType").toLowerCase();t.drag.get(c).get(f).contains(t.drop.get(c))&&(n=!0),n&&p==="move"&&(p="insert");switch(p){case"insert":r=this._up?"before":"after",h=t.drop.get(c),e.Sortable._test(h,this.get(s))?h.append(t.drag.get(c)):h.insert(t.drag.get(c),r);break;case"swap":e.DD.DDM.swapNode(t.drag,t.drop);break;case"move":case"copy":a=e.Sortable.getSortable(t.drop.get(c).get(f));if(!a)return;e.DD.DDM.getDrop(t.drag.get(c)).addToGroup(a.get(o)),n?e.DD.DDM.swapNode(t.drag,t.drop):(this.get("moveType")==="copy"&&(i=t.drag.get(c),u=i.cloneNode(!0),u.set(o,""),t.drag.set(c,u),a.delegate.createDrop(u,[a.get(o)]),i.setStyles({top:"",left:""})),t.drop.get(c).insert(t.drag.get(c),"before"))}this.fire(p,{same:n,drag:t.drag,drop:t.drop}),this.fire("moved",{same:n,drag:t.drag,drop:t.drop})},_onDragStart:function(){var e=this.delegate,t=e.get("lastNode");t&&t.getDOMNode()&&t.setStyle(u,""),e.get(this.get(i)).setStyle(a,this.get(a)),e.get(r).setStyle(u,"999")},_onDragEnd:function(){this.delegate.get(this.get(i)).setStyle(a,1),this.delegate.get(r).setStyles({top:"",left:""}),this.sync()},plug:function(e,t){return e&&e.NAME.substring(0,4).toLowerCase()==="sort"?this.constructor.superclass.plug.call(this,e,t):this.delegate.dd.plug(e,t),this},sync:function(){return this.delegate.syncTargets(),this},destructor:function(){this.drop.destroy(),this.delegate.destroy(),n.unreg(this,this.get(o))},join:function(t,n){if(t instanceof e.Sortable){n||(n="full"),n=n.toLowerCase();var r="_join_"+n;return this[r]&&this[r](t),this}return e.error("Sortable: join needs a Sortable Instance"),this},_join_none:function(e){this.delegate.dd.removeFromGroup(e.get(o)),e.delegate.dd.removeFromGroup(this.get(o))},_join_full:function(e){this.delegate.dd.addToGroup(e.get(o)),e.delegate.dd.addToGroup(this.get(o))},_join_outer:function(e){this.delegate.dd.addToGroup(e.get(o))},_join_inner:function(e){e.delegate.dd.addToGroup(this.get(o))},getOrdering:function(t){var n=[];return e.Lang.isFunction(t)||(t=function(e){return e}),e.one(this.get(s)).all(this.get(l)).each(function(e){n.push(t(e))}),n}},{NAME:"sortable",ATTRS:{handles:{value:!1},container:{value:"body"},nodes:{value:".dd-draggable"},opacity:{value:".75"},opacityNode:{value:"currentNode"},id:{value:null},moveType:{value:"insert"},invalid:{value:""}},_sortables:{},_test:function(t,n){var r;return n instanceof e.Node?r=n===t:r=t.test(n),r},getSortable:function(t){var n=null,r=null;return t=e.one(t),r=t.get(o),r&&e.Sortable._sortables[r]?e.Sortable._sortables[r]:(e.Object.each(e.Sortable._sortables,function(r){e.Sortable._test(t,r.get(s))&&(n=r)}),n)},reg:function(t,n){n||(n=t.get(o)),e.Sortable._sortables[n]=t},unreg:function(t,r){r||(r=t.get(o));if(r&&e.Sortable._sortables[r]){delete e.Sortable._sortables[r];return}e.Object.each(e.Sortable._sortables,function(e,r){e===t&&delete n._sortables[r]})}}),e.Sortable=n},"3.7.3",{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]});
bundle/sortable/sortable.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -10,7 +10,7 @@ /** * The class allows you to create a Drag & Drop reordered list. * @module sortable- */ + */ /** * The class allows you to create a Drag & Drop reordered list. * @class Sortable@@ -19,7 +19,7 @@ */ - var Sortable = function(o) {+ var Sortable = function() { Sortable.superclass.constructor.apply(this, arguments); }, CURRENT_NODE = 'currentNode',@@ -91,10 +91,10 @@ _y: null, _onDrag: function(e) { if (e.pageY < this._y) {- this._up = true; - } else if (e.pageY > this._y) { - this._up = false; - } + this._up = true;+ } else if (e.pageY > this._y) {+ this._up = false;+ } this._y = e.pageY; },@@ -123,7 +123,7 @@ if (!e.drop.get(NODE).test(this.get(NODES))) { return; }- if (e.drag.get(NODE) == e.drop.get(NODE)) {+ if (e.drag.get(NODE) === e.drop.get(NODE)) { return; } // is drop a child of drag?@@ -136,7 +136,7 @@ if (e.drag.get(NODE).get(PARENT_NODE).contains(e.drop.get(NODE))) { same = true; }- if (same && moveType == 'move') {+ if (same && moveType === 'move') { moveType = 'insert'; } switch (moveType) {@@ -166,7 +166,7 @@ if (same) { Y.DD.DDM.swapNode(e.drag, e.drop); } else {- if (this.get('moveType') == 'copy') {+ if (this.get('moveType') === 'copy') { //New List oldNode = e.drag.get(NODE); newNode = oldNode.cloneNode(true);@@ -193,7 +193,7 @@ * @param Event e The Event Object * @description Handles the DragStart event and initializes some settings. */- _onDragStart: function(e) {+ _onDragStart: function() { var del = this.delegate, lastNode = del.get('lastNode'); if (lastNode && lastNode.getDOMNode()) {@@ -208,7 +208,7 @@ * @param Event e The Event Object * @description Handles the DragEnd event that cleans up the settings in the drag:start event. */- _onDragEnd: function(e) {+ _onDragEnd: function() { this.delegate.get(this.get(OPACITY_NODE)).setStyle(OPACITY, 1); this.delegate.get(CURRENT_NODE).setStyles({ top: '',@@ -315,9 +315,10 @@ sel.delegate.dd.addToGroup(this.get(ID)); }, /**- * A custom callback to allow a user to extract some sort of id or any other data from the node to use in the "ordering list" and then that data should be returned from the callback.+ * A custom callback to allow a user to extract some sort of id or any other data+ * from the node to use in the "ordering list" and then that data should be returned from the callback. * @method getOrdering- * @param Function callback + * @param Function callback * @return Array */ getOrdering: function(callback) {@@ -341,7 +342,7 @@ * @attribute handles * @description Drag handles to pass on to the internal DD.Delegate instance. * @type Array- */ + */ handles: { value: false },@@ -349,7 +350,7 @@ * @attribute container * @description A selector query to get the container to listen for mousedown events on. All "nodes" should be a child of this container. * @type String- */ + */ container: { value: 'body' },@@ -357,7 +358,7 @@ * @attribute nodes * @description A selector query to get the children of the "container" to make draggable elements from. * @type String- */ + */ nodes: { value: '.dd-draggable' },@@ -365,7 +366,7 @@ * @attribute opacity * @description The opacity to change the proxy item to when dragging. * @type String- */ + */ opacity: { value: '.75' },@@ -373,7 +374,7 @@ * @attribute opacityNode * @description The node to set opacity on when dragging (dragNode or currentNode). Default: currentNode. * @type String- */ + */ opacityNode: { value: 'currentNode' },@@ -381,7 +382,7 @@ * @attribute id * @description The id of this Sortable, used to get a reference to this Sortable list from another list. * @type String- */ + */ id: { value: null },@@ -389,7 +390,7 @@ * @attribute moveType * @description How should an item move to another list: insert, swap, move, copy. Default: insert * @type String- */ + */ moveType: { value: 'insert' },@@ -397,7 +398,7 @@ * @attribute invalid * @description A selector string to test if a list item is invalid and not sortable * @type String- */ + */ invalid: { value: '' }@@ -533,4 +534,4 @@ -}, '3.7.2', {"requires": ["dd-delegate", "dd-drop-plugin", "dd-proxy"]});+}, '3.7.3', {"requires": ["dd-delegate", "dd-drop-plugin", "dd-proxy"]});
bundle/stylesheet/stylesheet-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/stylesheet/stylesheet.js", code: [] };-_yuitest_coverage["build/stylesheet/stylesheet.js"].code=["YUI.add('stylesheet', function (Y, NAME) {","","/**"," * The StyleSheet component is a module for creating and modifying CSS"," * stylesheets."," *"," * @module stylesheet"," */","var d = Y.config.doc,"," p = d.createElement('p'), // Have to hold the node (see notes)"," workerStyle = p.style, // worker style collection"," isString = Y.Lang.isString,"," selectors = {},"," sheets = {},"," floatAttr = ('cssFloat' in workerStyle) ? 'cssFloat' : 'styleFloat',"," _toCssText,"," _unsetOpacity,"," _unsetProperty,"," OPACITY = 'opacity',"," FLOAT = 'float',"," EMPTY = '';","","// Normalizes the removal of an assigned style for opacity. IE uses the filter","// property.","_unsetOpacity = (OPACITY in workerStyle) ?"," function (style) { style.opacity = EMPTY; } :"," function (style) { style.filter = EMPTY; };","","// 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 = EMPTY; // 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 (isString(style[prop])) {"," 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 = EMPTY;"," break;"," default :"," for (p in style) {"," if (p.indexOf(prop) === 0) {"," style[p] = EMPTY;"," }"," }"," }"," }"," } :"," function (style,prop) {"," if (prop !== floatAttr && prop.toLowerCase().indexOf(FLOAT) != -1) {"," prop = floatAttr;"," }"," if (isString(style[prop])) {"," if (prop === OPACITY) {"," _unsetOpacity(style);"," } else {"," style[prop] = EMPTY;"," }"," }"," };","","/**"," * Create an instance of StyleSheet to encapsulate a css stylesheet."," * The constructor can be called using function or constructor syntax."," * <pre><code>var sheet = Y.StyleSheet(..);</pre></code>"," * or"," * <pre><code>var sheet = new Y.StyleSheet(..);</pre></code>"," *"," * The first parameter passed can be any of the following things:"," * <ul>"," * <li>The desired string name to register a new empty sheet</li>"," * <li>The string name of an existing StyleSheet instance</li>"," * <li>The unique guid generated for an existing StyleSheet instance</li>"," * <li>The id of an existing <code><link></code> or <code><style></code> node</li>"," * <li>The node reference for an existing <code><link></code> or <code><style></code> node</li>"," * <li>The Y.Node instance wrapping an existing <code><link></code> or <code><style></code> node</li>"," * <li>A chunk of css text to create a new stylesheet from</li>"," * </ul>"," *"," * <p>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.</p>"," *"," * <p>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.</p>"," *"," * @class StyleSheet"," * @constructor"," * @param seed {String|HTMLElement|Node} a style or link node, its id, or a"," * name or guid of a StyleSheet, or a string of css text"," * @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 (!(Y.instanceOf(this, StyleSheet))) {"," return new StyleSheet(seed,name);"," }",""," // Extract the DOM node from Node instances"," if (seed) {"," if (Y.Node && seed instanceof Y.Node) {"," node = seed._node;"," } else if (seed.nodeName) {"," node = seed;"," // capture the DOM node if the string is an id"," } else if (isString(seed)) {"," if (seed && sheets[seed]) {"," return sheets[seed];"," }"," node = d.getElementById(seed.replace(/^#/,EMPTY));"," }",""," // Check for the StyleSheet in the static registry"," if (node && sheets[Y.stamp(node)]) {"," return sheets[Y.stamp(node)];"," }"," }","",""," // Create a style node if necessary"," if (!node || !/^(?:style|link)$/i.test(node.nodeName)) {"," node = d.createElement('style');"," node.type = 'text/css';"," }",""," if (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;"," }"," }",""," // Make sure the node is attached to the appropriate head element"," 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"," StyleSheet.register(Y.stamp(node),this);",""," // Register the instance by name if provided or defaulted from seed"," if (name) {"," StyleSheet.register(name,this);"," }",""," // Public API"," Y.mix(this,{"," /**"," * Get the unique stamp for this StyleSheet instance"," *"," * @method getId"," * @return {Number} the static id"," */"," getId : function () { return Y.stamp(node); },",""," /**"," * Enable all the rules in the sheet"," *"," * @method enable"," * @return {StyleSheet}"," * @chainable"," */"," 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}"," * @chainable"," */"," disable : function () { sheet.disabled = true; return this; },",""," /**"," * Returns false if the StyleSheet is disabled. Otherwise true."," *"," * @method isEnabled"," * @return {Boolean}"," */"," isEnabled : function () { return !sheet.disabled; },",""," /**"," * <p>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.</p>"," *"," * <p>The object properties in the second parameter must be the JavaScript"," * names of style properties. E.g. fontSize rather than font-size.</p>"," *"," * <p>The float style property will be set by any of "float","," * "styleFloat", or "cssFloat".</p>"," *"," * @method set"," * @param sel {String} the selector string to apply the changes to"," * @param css {Object} Object literal of style properties and new values"," * @return {StyleSheet}"," * @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;"," },",""," /**"," * <p>Unset style properties for a provided selector string, removing"," * their effect from the style cascade.</p>"," *"," * <p>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.</p>"," *"," * <p>The style property or properties in the second parameter must be the"," * JavaScript style property names. E.g. fontSize rather than font-size.</p>"," *"," * <p>The float style property will be unset by any of "float","," * "styleFloat", or "cssFloat".</p>"," *"," * @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}"," * @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) {"," css = Y.Array(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, selector;",""," if (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 (selector in cssRules) {"," if (cssRules.hasOwnProperty(selector)) {"," rule = cssRules[selector];"," css.push(rule.selectorText+\" {\"+rule.style.cssText+\"}\");"," }"," }"," return css.join(\"\\n\");"," }"," }"," });","","}","","_toCssText = function (css,base) {"," var f = css.styleFloat || css.cssFloat || css[FLOAT],"," trim = Y.Lang.trim,"," prop;",""," // A very difficult to repro/isolate IE 9 beta (and Platform Preview 7) bug"," // was reduced to this line throwing the error:"," // \"Invalid this pointer used as target for method call\""," // It appears that the style collection is corrupted. The error is"," // catchable, so in a best effort to work around it, replace the"," // p and workerStyle and try the assignment again."," try {"," workerStyle.cssText = base || EMPTY;"," } catch (e) {"," p = d.createElement('p');"," workerStyle = p.style;"," workerStyle.cssText = base || EMPTY;"," }",""," if (f && !css[floatAttr]) {"," css = Y.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] = trim(css[prop]);"," }"," catch (ex) {"," }"," }"," }"," return workerStyle.cssText;","};","","Y.mix(StyleSheet, {"," /**"," * <p>Converts an object literal of style properties and values into a string"," * of css text. This can then be assigned to el.style.cssText.</p>"," *"," * <p>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.</p>"," *"," * @method 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 (OPACITY in css) {"," css = Y.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 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));"," },",""," /**"," * <p>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".</p>"," *"," * <p>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.</p>"," *"," * @method isValidSelector"," * @param sel {String} the selector string"," * @return {Boolean}"," * @static"," */"," isValidSelector : function (sel) {"," var valid = false;",""," if (sel && 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,EMPTY)."," // class and id identifiers"," replace(/[.#]\\w[\\w\\-]*/g,EMPTY));"," }",""," valid = selectors[sel];"," }",""," return valid;"," }","},true);","","Y.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","*/","","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/stylesheet/stylesheet.js"].code=["YUI.add('stylesheet', function (Y, NAME) {","","/**"," * The StyleSheet component is a module for creating and modifying CSS"," * stylesheets."," *"," * @module stylesheet"," */","var d = Y.config.doc,"," p = d.createElement('p'), // Have to hold the node (see notes)"," workerStyle = p.style, // worker style collection"," isString = Y.Lang.isString,"," selectors = {},"," sheets = {},"," floatAttr = ('cssFloat' in workerStyle) ? 'cssFloat' : 'styleFloat',"," _toCssText,"," _unsetOpacity,"," _unsetProperty,"," OPACITY = 'opacity',"," FLOAT = 'float',"," EMPTY = '';","","// Normalizes the removal of an assigned style for opacity. IE uses the filter","// property.","_unsetOpacity = (OPACITY in workerStyle) ?"," function (style) { style.opacity = EMPTY; } :"," function (style) { style.filter = EMPTY; };","","// 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 = EMPTY; // 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 (isString(style[prop])) {"," 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 = EMPTY;"," break;"," default :"," for (p in style) {"," if (p.indexOf(prop) === 0) {"," style[p] = EMPTY;"," }"," }"," }"," }"," } :"," function (style,prop) {"," if (prop !== floatAttr && prop.toLowerCase().indexOf(FLOAT) != -1) {"," prop = floatAttr;"," }"," if (isString(style[prop])) {"," if (prop === OPACITY) {"," _unsetOpacity(style);"," } else {"," style[prop] = EMPTY;"," }"," }"," };","","/**"," * Create an instance of StyleSheet to encapsulate a css stylesheet."," * The constructor can be called using function or constructor syntax."," * <pre><code>var sheet = Y.StyleSheet(..);</pre></code>"," * or"," * <pre><code>var sheet = new Y.StyleSheet(..);</pre></code>"," *"," * The first parameter passed can be any of the following things:"," * <ul>"," * <li>The desired string name to register a new empty sheet</li>"," * <li>The string name of an existing StyleSheet instance</li>"," * <li>The unique guid generated for an existing StyleSheet instance</li>"," * <li>The id of an existing <code><link></code> or <code><style></code> node</li>"," * <li>The node reference for an existing <code><link></code> or <code><style></code> node</li>"," * <li>The Y.Node instance wrapping an existing <code><link></code> or <code><style></code> node</li>"," * <li>A chunk of css text to create a new stylesheet from</li>"," * </ul>"," *"," * <p>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.</p>"," *"," * <p>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.</p>"," *"," * @class StyleSheet"," * @constructor"," * @param seed {String|HTMLElement|Node} a style or link node, its id, or a"," * name or guid of a StyleSheet, or a string of css text"," * @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 (!(Y.instanceOf(this, StyleSheet))) {"," return new StyleSheet(seed,name);"," }",""," // Extract the DOM node from Node instances"," if (seed) {"," if (Y.Node && seed instanceof Y.Node) {"," node = seed._node;"," } else if (seed.nodeName) {"," node = seed;"," // capture the DOM node if the string is an id"," } else if (isString(seed)) {"," if (seed && sheets[seed]) {"," return sheets[seed];"," }"," node = d.getElementById(seed.replace(/^#/,EMPTY));"," }",""," // Check for the StyleSheet in the static registry"," if (node && sheets[Y.stamp(node)]) {"," return sheets[Y.stamp(node)];"," }"," }","",""," // Create a style node if necessary"," if (!node || !/^(?:style|link)$/i.test(node.nodeName)) {"," node = d.createElement('style');"," node.type = 'text/css';"," }",""," if (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;"," }"," }",""," // Make sure the node is attached to the appropriate head element"," 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"," StyleSheet.register(Y.stamp(node),this);",""," // Register the instance by name if provided or defaulted from seed"," if (name) {"," StyleSheet.register(name,this);"," }",""," // Public API"," Y.mix(this,{"," /**"," * Get the unique stamp for this StyleSheet instance"," *"," * @method getId"," * @return {Number} the static id"," */"," getId : function () { return Y.stamp(node); },",""," /**"," * Enable all the rules in the sheet"," *"," * @method enable"," * @return {StyleSheet}"," * @chainable"," */"," 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}"," * @chainable"," */"," disable : function () { sheet.disabled = true; return this; },",""," /**"," * Returns false if the StyleSheet is disabled. Otherwise true."," *"," * @method isEnabled"," * @return {Boolean}"," */"," isEnabled : function () { return !sheet.disabled; },",""," /**"," * <p>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.</p>"," *"," * <p>The object properties in the second parameter must be the JavaScript"," * names of style properties. E.g. fontSize rather than font-size.</p>"," *"," * <p>The float style property will be set by any of "float","," * "styleFloat", or "cssFloat".</p>"," *"," * @method set"," * @param sel {String} the selector string to apply the changes to"," * @param css {Object} Object literal of style properties and new values"," * @return {StyleSheet}"," * @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;"," },",""," /**"," * <p>Unset style properties for a provided selector string, removing"," * their effect from the style cascade.</p>"," *"," * <p>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.</p>"," *"," * <p>The style property or properties in the second parameter must be the"," * JavaScript style property names. E.g. fontSize rather than font-size.</p>"," *"," * <p>The float style property will be unset by any of "float","," * "styleFloat", or "cssFloat".</p>"," *"," * @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}"," * @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) {"," css = Y.Array(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, selector;",""," if (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 (selector in cssRules) {"," if (cssRules.hasOwnProperty(selector)) {"," rule = cssRules[selector];"," css.push(rule.selectorText+\" {\"+rule.style.cssText+\"}\");"," }"," }"," return css.join(\"\\n\");"," }"," }"," });","","}","","_toCssText = function (css,base) {"," var f = css.styleFloat || css.cssFloat || css[FLOAT],"," trim = Y.Lang.trim,"," prop;",""," // A very difficult to repro/isolate IE 9 beta (and Platform Preview 7) bug"," // was reduced to this line throwing the error:"," // \"Invalid this pointer used as target for method call\""," // It appears that the style collection is corrupted. The error is"," // catchable, so in a best effort to work around it, replace the"," // p and workerStyle and try the assignment again."," try {"," workerStyle.cssText = base || EMPTY;"," } catch (e) {"," p = d.createElement('p');"," workerStyle = p.style;"," workerStyle.cssText = base || EMPTY;"," }",""," if (f && !css[floatAttr]) {"," css = Y.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] = trim(css[prop]);"," }"," catch (ex) {"," }"," }"," }"," return workerStyle.cssText;","};","","Y.mix(StyleSheet, {"," /**"," * <p>Converts an object literal of style properties and values into a string"," * of css text. This can then be assigned to el.style.cssText.</p>"," *"," * <p>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.</p>"," *"," * @method 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 (OPACITY in css) {"," css = Y.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 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));"," },",""," /**"," * <p>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".</p>"," *"," * <p>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.</p>"," *"," * @method isValidSelector"," * @param sel {String} the selector string"," * @return {Boolean}"," * @static"," */"," isValidSelector : function (sel) {"," var valid = false;",""," if (sel && 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,EMPTY)."," // class and id identifiers"," replace(/[.#]\\w[\\w\\-]*/g,EMPTY));"," }",""," valid = selectors[sel];"," }",""," return valid;"," }","},true);","","Y.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","*/","","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/stylesheet/stylesheet.js"].lines = {"1":0,"9":0,"25":0,"26":0,"27":0,"32":0,"33":0,"34":0,"36":0,"37":0,"38":0,"40":0,"41":0,"43":0,"45":0,"48":0,"50":0,"51":0,"52":0,"59":0,"60":0,"62":0,"63":0,"64":0,"66":0,"107":0,"108":0,"118":0,"119":0,"123":0,"124":0,"125":0,"126":0,"127":0,"129":0,"130":0,"131":0,"133":0,"137":0,"138":0,"144":0,"145":0,"146":0,"149":0,"151":0,"154":0,"155":0,"157":0,"159":0,"160":0,"165":0,"166":0,"170":0,"177":0,"181":0,"185":0,"186":0,"187":0,"191":0,"192":0,"193":0,"199":0,"200":0,"201":0,"203":0,"204":0,"205":0,"207":0,"212":0,"215":0,"216":0,"220":0,"227":0,"236":0,"246":0,"254":0,"275":0,"280":0,"281":0,"282":0,"284":0,"288":0,"289":0,"295":0,"296":0,"298":0,"299":0,"303":0,"304":0,"309":0,"312":0,"336":0,"343":0,"344":0,"345":0,"347":0,"350":0,"351":0,"352":0,"354":0,"355":0,"356":0,"359":0,"360":0,"362":0,"366":0,"367":0,"368":0,"369":0,"370":0,"371":0,"372":0,"377":0,"393":0,"395":0,"398":0,"400":0,"402":0,"403":0,"404":0,"405":0,"406":0,"409":0,"416":0,"417":0,"427":0,"428":0,"430":0,"431":0,"432":0,"435":0,"436":0,"437":0,"438":0,"441":0,"442":0,"443":0,"446":0,"452":0,"455":0,"476":0,"477":0,"480":0,"482":0,"496":0,"517":0,"519":0,"521":0,"524":0,"540":0,"543":0,"547":0}; _yuitest_coverage["build/stylesheet/stylesheet.js"].functions = {"(anonymous 2):26":0,"}:27":0,"(anonymous 3):35":0,"}:58":0,"(anonymous 4):186":0,"}:187":0,"(anonymous 5):192":0,"}:193":0,"getId:227":0,"enable:236":0,"disable:246":0,"isEnabled:254":0,"set:274":0,"unset:335":0,"getCssText:392":0,"StyleSheet:107":0,"_toCssText:416":0,"_toCssText:475":0,"register:495":0,"isValidSelector:516":0,"(anonymous 1):1":0}; _yuitest_coverage["build/stylesheet/stylesheet.js"].coveredLines = 152;@@ -847,4 +847,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/stylesheet/stylesheet-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -645,4 +645,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/stylesheet/stylesheet-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("stylesheet",function(e,t){function v(t,r){var o,a,f,l={},h,p,m,g,y,b;if(!e.instanceOf(this,v))return new v(t,r);if(t){if(e.Node&&t instanceof e.Node)a=t._node;else if(t.nodeName)a=t;else if(s(t)){if(t&&u[t])return u[t];a=n.getElementById(t.replace(/^#/,d))}if(a&&u[e.stamp(a)])return u[e.stamp(a)]}if(!a||!/^(?:style|link)$/i.test(a.nodeName))a=n.createElement("style"),a.type="text/css";s(t)&&(t.indexOf("{")!=-1?a.styleSheet?a.styleSheet.cssText=t:a.appendChild(n.createTextNode(t)):r||(r=t));if(!a.parentNode||a.parentNode.nodeName.toLowerCase()!=="head")o=(a.ownerDocument||n).getElementsByTagName("head")[0],o.appendChild(a);f=a.sheet||a.styleSheet,h=f&&"cssRules"in f?"cssRules":"rules",m="deleteRule"in f?function(e){f.deleteRule(e)}:function(e){f.removeRule(e)},p="insertRule"in f?function(e,t,n){f.insertRule(e+" {"+t+"}",n)}:function(e,t,n){f.addRule(e,t,n)};for(g=f[h].length-1;g>=0;--g)y=f[h][g],b=y.selectorText,l[b]?(l[b].style.cssText+=";"+y.style.cssText,m(g)):l[b]=y;v.register(e.stamp(a),this),r&&v.register(r,this),e.mix(this,{getId:function(){return e.stamp(a)},enable:function(){return f.disabled=!1,this},disable:function(){return f.disabled=!0,this},isEnabled:function(){return!f.disabled},set:function(e,t){var n=l[e],r=e.split(/\s*,\s*/),i,s;if(r.length>1){for(i=r.length-1;i>=0;--i)this.set(r[i],t);return this}return v.isValidSelector(e)?(n?n.style.cssText=v.toCssText(t,n.style.cssText):(s=f[h].length,t=v.toCssText(t),t&&(p(e,t,s),l[e]=f[h][s])),this):this},unset:function(t,n){var r=l[t],s=t.split(/\s*,\s*/),o=!n,u,a;if(s.length>1){for(a=s.length-1;a>=0;--a)this.unset(s[a],n);return this}if(r){if(!o){n=e.Array(n),i.cssText=r.style.cssText;for(a=n.length-1;a>=0;--a)c(i,n[a]);i.cssText?r.style.cssText=i.cssText:o=!0}if(o){u=f[h];for(a=u.length-1;a>=0;--a)if(u[a]===r){delete l[t],m(a);break}}}return this},getCssText:function(e){var t,n,r;if(s(e))return t=l[e.split(/\s*,\s*/)[0]],t?t.style.cssText:null;n=[];for(r in l)l.hasOwnProperty(r)&&(t=l[r],n.push(t.selectorText+" {"+t.style.cssText+"}"));return n.join("\n")}})}var n=e.config.doc,r=n.createElement("p"),i=r.style,s=e.Lang.isString,o={},u={},a="cssFloat"in i?"cssFloat":"styleFloat",f,l,c,h="opacity",p="float",d="";l=h in i?function(e){e.opacity=d}:function(e){e.filter=d},i.border="1px solid red",i.border=d,c=i.borderLeft?function(e,t){var n;t!==a&&t.toLowerCase().indexOf(p)!=-1&&(t=a);if(s(e[t]))switch(t){case h:case"filter":l(e);break;case"font":e.font=e.fontStyle=e.fontVariant=e.fontWeight=e.fontSize=e.lineHeight=e.fontFamily=d;break;default:for(n in e)n.indexOf(t)===0&&(e[n]=d)}}:function(e,t){t!==a&&t.toLowerCase().indexOf(p)!=-1&&(t=a),s(e[t])&&(t===h?l(e):e[t]=d)},f=function(t,s){var o=t.styleFloat||t.cssFloat||t[p],u=e.Lang.trim,f;try{i.cssText=s||d}catch(l){r=n.createElement("p"),i=r.style,i.cssText=s||d}o&&!t[a]&&(t=e.merge(t),delete t.styleFloat,delete t.cssFloat,delete t[p],t[a]=o);for(f in t)if(t.hasOwnProperty(f))try{i[f]=u(t[f])}catch(c){}return i.cssText},e.mix(v,{toCssText:h in i?f:function(t,n){return h in t&&(t=e.merge(t,{filter:"alpha(opacity="+t.opacity*100+")"}),delete t.opacity),f(t,n)},register:function(e,t){return!!(e&&t instanceof v&&!u[e]&&(u[e]=t))},isValidSelector:function(e){var t=!1;return e&&s(e)&&(o.hasOwnProperty(e)||(o[e]=!/\S/.test(e.replace(/\s+|\s*[+~>]\s*/g," ").replace(/([^ ])\[.*?\]/g,"$1").replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,"$1").replace(/(?:^| )[a-z0-6]+/ig," ").replace(/\\./g,d).replace(/[.#]\w[\w\-]*/g,d))),t=o[e]),t}},!0),e.StyleSheet=v},"3.7.2",{requires:["yui-base"]});+YUI.add("stylesheet",function(e,t){function v(t,r){var o,a,f,l={},h,p,m,g,y,b;if(!e.instanceOf(this,v))return new v(t,r);if(t){if(e.Node&&t instanceof e.Node)a=t._node;else if(t.nodeName)a=t;else if(s(t)){if(t&&u[t])return u[t];a=n.getElementById(t.replace(/^#/,d))}if(a&&u[e.stamp(a)])return u[e.stamp(a)]}if(!a||!/^(?:style|link)$/i.test(a.nodeName))a=n.createElement("style"),a.type="text/css";s(t)&&(t.indexOf("{")!=-1?a.styleSheet?a.styleSheet.cssText=t:a.appendChild(n.createTextNode(t)):r||(r=t));if(!a.parentNode||a.parentNode.nodeName.toLowerCase()!=="head")o=(a.ownerDocument||n).getElementsByTagName("head")[0],o.appendChild(a);f=a.sheet||a.styleSheet,h=f&&"cssRules"in f?"cssRules":"rules",m="deleteRule"in f?function(e){f.deleteRule(e)}:function(e){f.removeRule(e)},p="insertRule"in f?function(e,t,n){f.insertRule(e+" {"+t+"}",n)}:function(e,t,n){f.addRule(e,t,n)};for(g=f[h].length-1;g>=0;--g)y=f[h][g],b=y.selectorText,l[b]?(l[b].style.cssText+=";"+y.style.cssText,m(g)):l[b]=y;v.register(e.stamp(a),this),r&&v.register(r,this),e.mix(this,{getId:function(){return e.stamp(a)},enable:function(){return f.disabled=!1,this},disable:function(){return f.disabled=!0,this},isEnabled:function(){return!f.disabled},set:function(e,t){var n=l[e],r=e.split(/\s*,\s*/),i,s;if(r.length>1){for(i=r.length-1;i>=0;--i)this.set(r[i],t);return this}return v.isValidSelector(e)?(n?n.style.cssText=v.toCssText(t,n.style.cssText):(s=f[h].length,t=v.toCssText(t),t&&(p(e,t,s),l[e]=f[h][s])),this):this},unset:function(t,n){var r=l[t],s=t.split(/\s*,\s*/),o=!n,u,a;if(s.length>1){for(a=s.length-1;a>=0;--a)this.unset(s[a],n);return this}if(r){if(!o){n=e.Array(n),i.cssText=r.style.cssText;for(a=n.length-1;a>=0;--a)c(i,n[a]);i.cssText?r.style.cssText=i.cssText:o=!0}if(o){u=f[h];for(a=u.length-1;a>=0;--a)if(u[a]===r){delete l[t],m(a);break}}}return this},getCssText:function(e){var t,n,r;if(s(e))return t=l[e.split(/\s*,\s*/)[0]],t?t.style.cssText:null;n=[];for(r in l)l.hasOwnProperty(r)&&(t=l[r],n.push(t.selectorText+" {"+t.style.cssText+"}"));return n.join("\n")}})}var n=e.config.doc,r=n.createElement("p"),i=r.style,s=e.Lang.isString,o={},u={},a="cssFloat"in i?"cssFloat":"styleFloat",f,l,c,h="opacity",p="float",d="";l=h in i?function(e){e.opacity=d}:function(e){e.filter=d},i.border="1px solid red",i.border=d,c=i.borderLeft?function(e,t){var n;t!==a&&t.toLowerCase().indexOf(p)!=-1&&(t=a);if(s(e[t]))switch(t){case h:case"filter":l(e);break;case"font":e.font=e.fontStyle=e.fontVariant=e.fontWeight=e.fontSize=e.lineHeight=e.fontFamily=d;break;default:for(n in e)n.indexOf(t)===0&&(e[n]=d)}}:function(e,t){t!==a&&t.toLowerCase().indexOf(p)!=-1&&(t=a),s(e[t])&&(t===h?l(e):e[t]=d)},f=function(t,s){var o=t.styleFloat||t.cssFloat||t[p],u=e.Lang.trim,f;try{i.cssText=s||d}catch(l){r=n.createElement("p"),i=r.style,i.cssText=s||d}o&&!t[a]&&(t=e.merge(t),delete t.styleFloat,delete t.cssFloat,delete t[p],t[a]=o);for(f in t)if(t.hasOwnProperty(f))try{i[f]=u(t[f])}catch(c){}return i.cssText},e.mix(v,{toCssText:h in i?f:function(t,n){return h in t&&(t=e.merge(t,{filter:"alpha(opacity="+t.opacity*100+")"}),delete t.opacity),f(t,n)},register:function(e,t){return!!(e&&t instanceof v&&!u[e]&&(u[e]=t))},isValidSelector:function(e){var t=!1;return e&&s(e)&&(o.hasOwnProperty(e)||(o[e]=!/\S/.test(e.replace(/\s+|\s*[+~>]\s*/g," ").replace(/([^ ])\[.*?\]/g,"$1").replace(/([^ ])::?[a-z][a-z\-]+[a-z](?:\(.*?\))?/ig,"$1").replace(/(?:^| )[a-z0-6]+/ig," ").replace(/\\./g,d).replace(/[.#]\w[\w\-]*/g,d))),t=o[e]),t}},!0),e.StyleSheet=v},"3.7.3",{requires:["yui-base"]});
bundle/stylesheet/stylesheet.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -641,4 +641,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/substitute/substitute-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/substitute/substitute.js", code: [] };-_yuitest_coverage["build/substitute/substitute.js"].code=["YUI.add('substitute', function (Y, NAME) {","","/**"," * String variable substitution and string formatting."," * If included, the substitute method is added to the YUI instance."," *"," * @module substitute"," */",""," var L = Y.Lang, DUMP = 'dump', SPACE = ' ', LBRACE = '{', RBRACE = '}',"," savedRegExp = /(~-(\\d+)-~)/g, lBraceRegExp = /\\{LBRACE\\}/g, rBraceRegExp = /\\{RBRACE\\}/g,",""," /**"," * The following methods are added to the YUI instance"," * @class YUI~substitute"," */",""," /**"," Does {placeholder} substitution on a string. The object passed as the"," second parameter provides values to replace the {placeholder}s."," {placeholder} token names must match property names of the object. For"," example",""," `var greeting = Y.substitute(\"Hello, {who}!\", { who: \"World\" });`",""," {placeholder} tokens that are undefined on the object map will be left in"," tact (leaving unsightly \"{placeholder}\"s in the output string). If your"," replacement strings *should* include curly braces, use `{LBRACE}` and"," `{RBRACE}` in your object map string value.",""," If a function is passed as a third argument, it will be called for each"," {placeholder} found. The {placeholder} name is passed as the first value"," and the value from the object map is passed as the second. If the"," {placeholder} contains a space, the first token will be used to identify"," the object map property and the remainder will be passed as a third"," argument to the function. See below for an example."," "," If the value in the object map for a given {placeholder} is an object and"," the `dump` module is loaded, the replacement value will be the string"," result of calling `Y.dump(...)` with the object as input. Include a"," numeric second token in the {placeholder} to configure the depth of the call"," to `Y.dump(...)`, e.g. \"{someObject 2}\". See the"," <a href=\"../classes/YUI.html#method_dump\">`dump`</a> method for details.",""," @method substitute"," @param {string} s The string that will be modified."," @param {object} o An object containing the replacement values."," @param {function} f An optional function that can be used to"," process each match. It receives the key,"," value, and any extra metadata included with"," the key inside of the braces."," @param {boolean} recurse if true, the replacement will be recursive,"," letting you have replacement tokens in replacement text."," The default is false."," @return {string} the substituted string.",""," @example",""," function getAttrVal(key, value, name) {"," // Return a string describing the named attribute and its value if"," // the first token is @. Otherwise, return the value from the"," // replacement object."," if (key === \"@\") {"," value += name + \" Value: \" + myObject.get(name);"," }"," return value;"," }",""," // Assuming myObject.set('foo', 'flowers'),"," // => \"Attr: foo Value: flowers\""," var attrVal = Y.substitute(\"{@ foo}\", { \"@\": \"Attr: \" }, getAttrVal);"," **/",""," substitute = function(s, o, f, recurse) {"," var i, j, k, key, v, meta, saved = [], token, dump,"," lidx = s.length;",""," for (;;) {"," i = s.lastIndexOf(LBRACE, lidx);"," if (i < 0) {"," break;"," }"," j = s.indexOf(RBRACE, i);"," if (i + 1 >= j) {"," break;"," }",""," //Extract key and meta info"," token = s.substring(i + 1, j);"," key = token;"," meta = null;"," k = key.indexOf(SPACE);"," if (k > -1) {"," meta = key.substring(k + 1);"," key = key.substring(0, k);"," }",""," // lookup the value"," v = o[key];",""," // if a substitution function was provided, execute it"," if (f) {"," v = f(key, v, meta);"," }",""," if (L.isObject(v)) {"," if (!Y.dump) {"," v = v.toString();"," } else {"," if (L.isArray(v)) {"," v = Y.dump(v, parseInt(meta, 10));"," } else {"," meta = meta || '';",""," // look for the keyword 'dump', if found force obj dump"," dump = meta.indexOf(DUMP);"," if (dump > -1) {"," meta = meta.substring(4);"," }",""," // use the toString if it is not the Object toString"," // and the 'dump' meta info was not found"," if (v.toString === Object.prototype.toString ||"," dump > -1) {"," v = Y.dump(v, parseInt(meta, 10));"," } else {"," v = v.toString();"," }"," }"," }"," } else if (L.isUndefined(v)) {"," // This {block} has no replace string. Save it for later."," v = '~-' + saved.length + '-~';"," saved.push(token);",""," // break;"," }",""," s = s.substring(0, i) + v + s.substring(j + 1);",""," if (!recurse) {"," lidx = i - 1;"," } "," }"," // restore saved {block}s and escaped braces",""," return s"," .replace(savedRegExp, function (str, p1, p2) {"," return LBRACE + saved[parseInt(p2,10)] + RBRACE;"," })"," .replace(lBraceRegExp, LBRACE)"," .replace(rBraceRegExp, RBRACE)"," ;"," };",""," Y.substitute = substitute;"," L.substitute = substitute;","","","","}, '3.7.2', {\"requires\": [\"yui-base\"], \"optional\": [\"dump\"]});"];+_yuitest_coverage["build/substitute/substitute.js"].code=["YUI.add('substitute', function (Y, NAME) {","","/**"," * String variable substitution and string formatting."," * If included, the substitute method is added to the YUI instance."," *"," * @module substitute"," */",""," var L = Y.Lang, DUMP = 'dump', SPACE = ' ', LBRACE = '{', RBRACE = '}',"," savedRegExp = /(~-(\\d+)-~)/g, lBraceRegExp = /\\{LBRACE\\}/g, rBraceRegExp = /\\{RBRACE\\}/g,",""," /**"," * The following methods are added to the YUI instance"," * @class YUI~substitute"," */",""," /**"," Does {placeholder} substitution on a string. The object passed as the"," second parameter provides values to replace the {placeholder}s."," {placeholder} token names must match property names of the object. For"," example",""," `var greeting = Y.substitute(\"Hello, {who}!\", { who: \"World\" });`",""," {placeholder} tokens that are undefined on the object map will be left in"," tact (leaving unsightly \"{placeholder}\"s in the output string). If your"," replacement strings *should* include curly braces, use `{LBRACE}` and"," `{RBRACE}` in your object map string value.",""," If a function is passed as a third argument, it will be called for each"," {placeholder} found. The {placeholder} name is passed as the first value"," and the value from the object map is passed as the second. If the"," {placeholder} contains a space, the first token will be used to identify"," the object map property and the remainder will be passed as a third"," argument to the function. See below for an example."," "," If the value in the object map for a given {placeholder} is an object and"," the `dump` module is loaded, the replacement value will be the string"," result of calling `Y.dump(...)` with the object as input. Include a"," numeric second token in the {placeholder} to configure the depth of the call"," to `Y.dump(...)`, e.g. \"{someObject 2}\". See the"," <a href=\"../classes/YUI.html#method_dump\">`dump`</a> method for details.",""," @method substitute"," @param {string} s The string that will be modified."," @param {object} o An object containing the replacement values."," @param {function} f An optional function that can be used to"," process each match. It receives the key,"," value, and any extra metadata included with"," the key inside of the braces."," @param {boolean} recurse if true, the replacement will be recursive,"," letting you have replacement tokens in replacement text."," The default is false."," @return {string} the substituted string.",""," @example",""," function getAttrVal(key, value, name) {"," // Return a string describing the named attribute and its value if"," // the first token is @. Otherwise, return the value from the"," // replacement object."," if (key === \"@\") {"," value += name + \" Value: \" + myObject.get(name);"," }"," return value;"," }",""," // Assuming myObject.set('foo', 'flowers'),"," // => \"Attr: foo Value: flowers\""," var attrVal = Y.substitute(\"{@ foo}\", { \"@\": \"Attr: \" }, getAttrVal);"," **/",""," substitute = function(s, o, f, recurse) {"," var i, j, k, key, v, meta, saved = [], token, dump,"," lidx = s.length;",""," for (;;) {"," i = s.lastIndexOf(LBRACE, lidx);"," if (i < 0) {"," break;"," }"," j = s.indexOf(RBRACE, i);"," if (i + 1 >= j) {"," break;"," }",""," //Extract key and meta info"," token = s.substring(i + 1, j);"," key = token;"," meta = null;"," k = key.indexOf(SPACE);"," if (k > -1) {"," meta = key.substring(k + 1);"," key = key.substring(0, k);"," }",""," // lookup the value"," v = o[key];",""," // if a substitution function was provided, execute it"," if (f) {"," v = f(key, v, meta);"," }",""," if (L.isObject(v)) {"," if (!Y.dump) {"," v = v.toString();"," } else {"," if (L.isArray(v)) {"," v = Y.dump(v, parseInt(meta, 10));"," } else {"," meta = meta || '';",""," // look for the keyword 'dump', if found force obj dump"," dump = meta.indexOf(DUMP);"," if (dump > -1) {"," meta = meta.substring(4);"," }",""," // use the toString if it is not the Object toString"," // and the 'dump' meta info was not found"," if (v.toString === Object.prototype.toString ||"," dump > -1) {"," v = Y.dump(v, parseInt(meta, 10));"," } else {"," v = v.toString();"," }"," }"," }"," } else if (L.isUndefined(v)) {"," // This {block} has no replace string. Save it for later."," v = '~-' + saved.length + '-~';"," saved.push(token);",""," // break;"," }",""," s = s.substring(0, i) + v + s.substring(j + 1);",""," if (!recurse) {"," lidx = i - 1;"," } "," }"," // restore saved {block}s and escaped braces",""," return s"," .replace(savedRegExp, function (str, p1, p2) {"," return LBRACE + saved[parseInt(p2,10)] + RBRACE;"," })"," .replace(lBraceRegExp, LBRACE)"," .replace(rBraceRegExp, RBRACE)"," ;"," };",""," Y.substitute = substitute;"," L.substitute = substitute;","","","","}, '3.7.3', {\"requires\": [\"yui-base\"], \"optional\": [\"dump\"]});"]; _yuitest_coverage["build/substitute/substitute.js"].lines = {"1":0,"10":0,"75":0,"78":0,"79":0,"80":0,"81":0,"83":0,"84":0,"85":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"99":0,"102":0,"103":0,"106":0,"107":0,"108":0,"110":0,"111":0,"113":0,"116":0,"117":0,"118":0,"123":0,"125":0,"127":0,"131":0,"133":0,"134":0,"139":0,"141":0,"142":0,"147":0,"149":0,"156":0,"157":0}; _yuitest_coverage["build/substitute/substitute.js"].functions = {"(anonymous 2):148":0,"substitute:74":0,"(anonymous 1):1":0}; _yuitest_coverage["build/substitute/substitute.js"].coveredLines = 42;@@ -242,4 +242,4 @@ -}, '3.7.2', {"requires": ["yui-base"], "optional": ["dump"]});+}, '3.7.3', {"requires": ["yui-base"], "optional": ["dump"]});
bundle/substitute/substitute-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -164,4 +164,4 @@ -}, '3.7.2', {"requires": ["yui-base"], "optional": ["dump"]});+}, '3.7.3', {"requires": ["yui-base"], "optional": ["dump"]});
bundle/substitute/substitute-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("substitute",function(e,t){var n=e.Lang,r="dump",i=" ",s="{",o="}",u=/(~-(\d+)-~)/g,a=/\{LBRACE\}/g,f=/\{RBRACE\}/g,l=function(t,l,c,h){var p,d,v,m,g,y,b=[],w,E,S=t.length;for(;;){p=t.lastIndexOf(s,S);if(p<0)break;d=t.indexOf(o,p);if(p+1>=d)break;w=t.substring(p+1,d),m=w,y=null,v=m.indexOf(i),v>-1&&(y=m.substring(v+1),m=m.substring(0,v)),g=l[m],c&&(g=c(m,g,y)),n.isObject(g)?e.dump?n.isArray(g)?g=e.dump(g,parseInt(y,10)):(y=y||"",E=y.indexOf(r),E>-1&&(y=y.substring(4)),g.toString===Object.prototype.toString||E>-1?g=e.dump(g,parseInt(y,10)):g=g.toString()):g=g.toString():n.isUndefined(g)&&(g="~-"+b.length+"-~",b.push(w)),t=t.substring(0,p)+g+t.substring(d+1),h||(S=p-1)}return t.replace(u,function(e,t,n){return s+b[parseInt(n,10)]+o}).replace(a,s).replace(f,o)};e.substitute=l,n.substitute=l},"3.7.2",{requires:["yui-base"],optional:["dump"]});+YUI.add("substitute",function(e,t){var n=e.Lang,r="dump",i=" ",s="{",o="}",u=/(~-(\d+)-~)/g,a=/\{LBRACE\}/g,f=/\{RBRACE\}/g,l=function(t,l,c,h){var p,d,v,m,g,y,b=[],w,E,S=t.length;for(;;){p=t.lastIndexOf(s,S);if(p<0)break;d=t.indexOf(o,p);if(p+1>=d)break;w=t.substring(p+1,d),m=w,y=null,v=m.indexOf(i),v>-1&&(y=m.substring(v+1),m=m.substring(0,v)),g=l[m],c&&(g=c(m,g,y)),n.isObject(g)?e.dump?n.isArray(g)?g=e.dump(g,parseInt(y,10)):(y=y||"",E=y.indexOf(r),E>-1&&(y=y.substring(4)),g.toString===Object.prototype.toString||E>-1?g=e.dump(g,parseInt(y,10)):g=g.toString()):g=g.toString():n.isUndefined(g)&&(g="~-"+b.length+"-~",b.push(w)),t=t.substring(0,p)+g+t.substring(d+1),h||(S=p-1)}return t.replace(u,function(e,t,n){return s+b[parseInt(n,10)]+o}).replace(a,s).replace(f,o)};e.substitute=l,n.substitute=l},"3.7.3",{requires:["yui-base"],optional:["dump"]});
bundle/substitute/substitute.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -164,4 +164,4 @@ -}, '3.7.2', {"requires": ["yui-base"], "optional": ["dump"]});+}, '3.7.3', {"requires": ["yui-base"], "optional": ["dump"]});
bundle/swf/swf-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/swf/swf.js", code: [] };-_yuitest_coverage["build/swf/swf.js"].code=["YUI.add('swf', function (Y, NAME) {","","/**"," * Embed a Flash applications in a standard manner and communicate with it"," * via External Interface."," * @module swf"," */",""," var Event = Y.Event,"," SWFDetect = Y.SWFDetect,"," Lang = Y.Lang,"," uA = Y.UA,"," Node = Y.Node,"," Escape = Y.Escape,",""," // private"," FLASH_CID = \"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\","," FLASH_TYPE = \"application/x-shockwave-flash\","," FLASH_VER = \"10.0.22\","," EXPRESS_INSTALL_URL = \"http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?\" + Math.random(),"," EVENT_HANDLER = \"SWF.eventHandler\","," possibleAttributes = {align:\"\", allowFullScreen:\"\", allowNetworking:\"\", allowScriptAccess:\"\", base:\"\", bgcolor:\"\", loop:\"\", menu:\"\", name:\"\", play: \"\", quality:\"\", salign:\"\", scale:\"\", tabindex:\"\", wmode:\"\"};",""," /**"," * The SWF utility is a tool for embedding Flash applications in HTML pages."," * @module swf"," * @title SWF Utility"," * @requires event-custom, node, swfdetect"," */",""," /**"," * Creates the SWF instance and keeps the configuration data"," *"," * @class SWF"," * @augments Y.Event.Target"," * @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. The p_oAttributes object allows the following additional properties:"," * <dl>"," * <dt>version : String</dt>"," * <dd>The minimum version of Flash required on the user's machine.</dd>"," * <dt>fixedAttributes : Object</dt>"," * <dd>An object literal containing one or more of the following String keys and their values: <code>align,"," * allowFullScreen, allowNetworking, allowScriptAccess, base, bgcolor, menu, name, quality, salign, scale,"," * tabindex, wmode.</code> event from the thumb</dd>"," * </dl>"," */","","function SWF (p_oElement /*:String*/, swfURL /*:String*/, p_oAttributes /*:Object*/ ) {",""," this._id = Y.guid(\"yuiswf\");","",""," var _id = this._id;"," var oElement = Node.one(p_oElement);"," "," var p_oAttributes = p_oAttributes || {};",""," var flashVersion = p_oAttributes.version || FLASH_VER;",""," var flashVersionSplit = (flashVersion + '').split(\".\");"," var isFlashVersionRight = SWFDetect.isFlashVersionAtLeast(parseInt(flashVersionSplit[0], 10), parseInt(flashVersionSplit[1], 10), parseInt(flashVersionSplit[2], 10));"," var canExpressInstall = (SWFDetect.isFlashVersionAtLeast(8,0,0));"," var shouldExpressInstall = canExpressInstall && !isFlashVersionRight && p_oAttributes.useExpressInstall;"," var flashURL = (shouldExpressInstall)?EXPRESS_INSTALL_URL:swfURL;"," var objstring = '<object ';"," var w, h;"," var flashvarstring = \"yId=\" + Y.id + \"&YUISwfId=\" + _id + \"&YUIBridgeCallback=\" + EVENT_HANDLER + \"&allowedDomain=\" + document.location.hostname;",""," Y.SWF._instances[_id] = this;"," if (oElement && (isFlashVersionRight || shouldExpressInstall) && flashURL) {"," objstring += 'id=\"' + _id + '\" ';"," if (uA.ie) {"," objstring += 'classid=\"' + FLASH_CID + '\" ';"," } else {"," objstring += 'type=\"' + FLASH_TYPE + '\" data=\"' + Escape.html(flashURL) + '\" ';"," }",""," w = \"100%\";"," h = \"100%\";",""," objstring += 'width=\"' + w + '\" height=\"' + h + '\">';",""," if (uA.ie) {"," objstring += '<param name=\"movie\" value=\"' + Escape.html(flashURL) + '\"/>';"," }",""," for (var attribute in p_oAttributes.fixedAttributes) {"," if (possibleAttributes.hasOwnProperty(attribute)) {"," objstring += '<param name=\"' + Escape.html(attribute) + '\" value=\"' + Escape.html(p_oAttributes.fixedAttributes[attribute]) + '\"/>';"," }"," }",""," for (var flashvar in p_oAttributes.flashVars) {"," var fvar = p_oAttributes.flashVars[flashvar];"," if (Lang.isString(fvar)) {"," flashvarstring += \"&\" + Escape.html(flashvar) + \"=\" + Escape.html(encodeURIComponent(fvar));"," }"," }",""," if (flashvarstring) {"," objstring += '<param name=\"flashVars\" value=\"' + flashvarstring + '\"/>';"," }",""," objstring += \"</object>\";"," //using innerHTML as setHTML/setContent causes some issues with ExternalInterface for IE versions of the player"," oElement.set(\"innerHTML\", objstring);"," "," this._swf = Node.one(\"#\" + _id);"," } else {"," /**"," * Fired when the Flash player version on the user's machine is"," * below the required value."," *"," * @event wrongflashversion"," */"," var event = {};"," event.type = \"wrongflashversion\";"," this.publish(\"wrongflashversion\", {fireOnce:true});"," this.fire(\"wrongflashversion\", event);"," }","}","","/**"," * @private"," * The static collection of all instances of the SWFs on the page."," * @property _instances"," * @type Object"," */","","SWF._instances = SWF._instances || {};","","/**"," * @private"," * 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."," */","SWF.eventHandler = function (swfid, event) {"," SWF._instances[swfid]._eventHandler(event);","};","","SWF.prototype = {"," /**"," * @private"," * Propagates a specific event from Flash to JS."," * @method _eventHandler"," * @param event {Object} The event to be propagated from Flash."," */"," _eventHandler: function(event) {"," if (event.type === \"swfReady\") {"," this.publish(\"swfReady\", {fireOnce:true});"," this.fire(\"swfReady\", event);"," } else if(event.type === \"log\") {"," } else {"," this.fire(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 {Array} the set of arguments to pass to the function."," */"," "," callSWF: function (func, args)"," {"," if (!args) { "," args= []; "," } "," if (this._swf._node[func]) {"," return(this._swf._node[func].apply(this._swf._node, 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;"," }","};","","Y.augment(SWF, Y.EventTarget);","","Y.SWF = SWF;","","","}, '3.7.2', {\"requires\": [\"event-custom\", \"node\", \"swfdetect\", \"escape\"]});"];+_yuitest_coverage["build/swf/swf.js"].code=["YUI.add('swf', function (Y, NAME) {","","/**"," * Embed a Flash applications in a standard manner and communicate with it"," * via External Interface."," * @module swf"," */",""," var Event = Y.Event,"," SWFDetect = Y.SWFDetect,"," Lang = Y.Lang,"," uA = Y.UA,"," Node = Y.Node,"," Escape = Y.Escape,",""," // private"," FLASH_CID = \"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\","," FLASH_TYPE = \"application/x-shockwave-flash\","," FLASH_VER = \"10.0.22\","," EXPRESS_INSTALL_URL = \"http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?\" + Math.random(),"," EVENT_HANDLER = \"SWF.eventHandler\","," possibleAttributes = {align:\"\", allowFullScreen:\"\", allowNetworking:\"\", allowScriptAccess:\"\", base:\"\", bgcolor:\"\", loop:\"\", menu:\"\", name:\"\", play: \"\", quality:\"\", salign:\"\", scale:\"\", tabindex:\"\", wmode:\"\"};",""," /**"," * The SWF utility is a tool for embedding Flash applications in HTML pages."," * @module swf"," * @title SWF Utility"," * @requires event-custom, node, swfdetect"," */",""," /**"," * Creates the SWF instance and keeps the configuration data"," *"," * @class SWF"," * @augments Y.Event.Target"," * @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. The p_oAttributes object allows the following additional properties:"," * <dl>"," * <dt>version : String</dt>"," * <dd>The minimum version of Flash required on the user's machine.</dd>"," * <dt>fixedAttributes : Object</dt>"," * <dd>An object literal containing one or more of the following String keys and their values: <code>align,"," * allowFullScreen, allowNetworking, allowScriptAccess, base, bgcolor, menu, name, quality, salign, scale,"," * tabindex, wmode.</code> event from the thumb</dd>"," * </dl>"," */","","function SWF (p_oElement /*:String*/, swfURL /*:String*/, p_oAttributes /*:Object*/ ) {",""," this._id = Y.guid(\"yuiswf\");","",""," var _id = this._id;"," var oElement = Node.one(p_oElement);"," "," var p_oAttributes = p_oAttributes || {};",""," var flashVersion = p_oAttributes.version || FLASH_VER;",""," var flashVersionSplit = (flashVersion + '').split(\".\");"," var isFlashVersionRight = SWFDetect.isFlashVersionAtLeast(parseInt(flashVersionSplit[0], 10), parseInt(flashVersionSplit[1], 10), parseInt(flashVersionSplit[2], 10));"," var canExpressInstall = (SWFDetect.isFlashVersionAtLeast(8,0,0));"," var shouldExpressInstall = canExpressInstall && !isFlashVersionRight && p_oAttributes.useExpressInstall;"," var flashURL = (shouldExpressInstall)?EXPRESS_INSTALL_URL:swfURL;"," var objstring = '<object ';"," var w, h;"," var flashvarstring = \"yId=\" + Y.id + \"&YUISwfId=\" + _id + \"&YUIBridgeCallback=\" + EVENT_HANDLER + \"&allowedDomain=\" + document.location.hostname;",""," Y.SWF._instances[_id] = this;"," if (oElement && (isFlashVersionRight || shouldExpressInstall) && flashURL) {"," objstring += 'id=\"' + _id + '\" ';"," if (uA.ie) {"," objstring += 'classid=\"' + FLASH_CID + '\" ';"," } else {"," objstring += 'type=\"' + FLASH_TYPE + '\" data=\"' + Escape.html(flashURL) + '\" ';"," }",""," w = \"100%\";"," h = \"100%\";",""," objstring += 'width=\"' + w + '\" height=\"' + h + '\">';",""," if (uA.ie) {"," objstring += '<param name=\"movie\" value=\"' + Escape.html(flashURL) + '\"/>';"," }",""," for (var attribute in p_oAttributes.fixedAttributes) {"," if (possibleAttributes.hasOwnProperty(attribute)) {"," objstring += '<param name=\"' + Escape.html(attribute) + '\" value=\"' + Escape.html(p_oAttributes.fixedAttributes[attribute]) + '\"/>';"," }"," }",""," for (var flashvar in p_oAttributes.flashVars) {"," var fvar = p_oAttributes.flashVars[flashvar];"," if (Lang.isString(fvar)) {"," flashvarstring += \"&\" + Escape.html(flashvar) + \"=\" + Escape.html(encodeURIComponent(fvar));"," }"," }",""," if (flashvarstring) {"," objstring += '<param name=\"flashVars\" value=\"' + flashvarstring + '\"/>';"," }",""," objstring += \"</object>\";"," //using innerHTML as setHTML/setContent causes some issues with ExternalInterface for IE versions of the player"," oElement.set(\"innerHTML\", objstring);"," "," this._swf = Node.one(\"#\" + _id);"," } else {"," /**"," * Fired when the Flash player version on the user's machine is"," * below the required value."," *"," * @event wrongflashversion"," */"," var event = {};"," event.type = \"wrongflashversion\";"," this.publish(\"wrongflashversion\", {fireOnce:true});"," this.fire(\"wrongflashversion\", event);"," }","}","","/**"," * @private"," * The static collection of all instances of the SWFs on the page."," * @property _instances"," * @type Object"," */","","SWF._instances = SWF._instances || {};","","/**"," * @private"," * 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."," */","SWF.eventHandler = function (swfid, event) {"," SWF._instances[swfid]._eventHandler(event);","};","","SWF.prototype = {"," /**"," * @private"," * Propagates a specific event from Flash to JS."," * @method _eventHandler"," * @param event {Object} The event to be propagated from Flash."," */"," _eventHandler: function(event) {"," if (event.type === \"swfReady\") {"," this.publish(\"swfReady\", {fireOnce:true});"," this.fire(\"swfReady\", event);"," } else if(event.type === \"log\") {"," } else {"," this.fire(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 {Array} the set of arguments to pass to the function."," */"," "," callSWF: function (func, args)"," {"," if (!args) { "," args= []; "," } "," if (this._swf._node[func]) {"," return(this._swf._node[func].apply(this._swf._node, 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;"," }","};","","Y.augment(SWF, Y.EventTarget);","","Y.SWF = SWF;","","","}, '3.7.3', {\"requires\": [\"event-custom\", \"node\", \"swfdetect\", \"escape\"]});"]; _yuitest_coverage["build/swf/swf.js"].lines = {"1":0,"9":0,"52":0,"54":0,"57":0,"58":0,"60":0,"62":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"73":0,"74":0,"75":0,"76":0,"77":0,"79":0,"82":0,"83":0,"85":0,"87":0,"88":0,"91":0,"92":0,"93":0,"97":0,"98":0,"99":0,"100":0,"104":0,"105":0,"108":0,"110":0,"112":0,"120":0,"121":0,"122":0,"123":0,"134":0,"144":0,"145":0,"148":0,"156":0,"157":0,"158":0,"159":0,"161":0,"175":0,"176":0,"178":0,"179":0,"181":0,"193":0,"197":0,"199":0}; _yuitest_coverage["build/swf/swf.js"].functions = {"SWF:52":0,"eventHandler:144":0,"_eventHandler:155":0,"callSWF:173":0,"toString:191":0,"(anonymous 1):1":0}; _yuitest_coverage["build/swf/swf.js"].coveredLines = 60;@@ -304,4 +304,4 @@ Y.SWF = SWF; -}, '3.7.2', {"requires": ["event-custom", "node", "swfdetect", "escape"]});+}, '3.7.3', {"requires": ["event-custom", "node", "swfdetect", "escape"]});
bundle/swf/swf-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -206,4 +206,4 @@ Y.SWF = SWF; -}, '3.7.2', {"requires": ["event-custom", "node", "swfdetect", "escape"]});+}, '3.7.3', {"requires": ["event-custom", "node", "swfdetect", "escape"]});
bundle/swf/swf-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("swf",function(e,t){function d(t,n,d){this._id=e.guid("yuiswf");var v=this._id,m=o.one(t),d=d||{},g=d.version||l,y=(g+"").split("."),b=r.isFlashVersionAtLeast(parseInt(y[0],10),parseInt(y[1],10),parseInt(y[2],10)),w=r.isFlashVersionAtLeast(8,0,0),E=w&&!b&&d.useExpressInstall,S=E?c:n,x="<object ",T,N,C="yId="+e.id+"&YUISwfId="+v+"&YUIBridgeCallback="+h+"&allowedDomain="+document.location.hostname;e.SWF._instances[v]=this;if(m&&(b||E)&&S){x+='id="'+v+'" ',s.ie?x+='classid="'+a+'" ':x+='type="'+f+'" data="'+u.html(S)+'" ',T="100%",N="100%",x+='width="'+T+'" height="'+N+'">',s.ie&&(x+='<param name="movie" value="'+u.html(S)+'"/>');for(var k in d.fixedAttributes)p.hasOwnProperty(k)&&(x+='<param name="'+u.html(k)+'" value="'+u.html(d.fixedAttributes[k])+'"/>');for(var L in d.flashVars){var A=d.flashVars[L];i.isString(A)&&(C+="&"+u.html(L)+"="+u.html(encodeURIComponent(A)))}C&&(x+='<param name="flashVars" value="'+C+'"/>'),x+="</object>",m.set("innerHTML",x),this._swf=o.one("#"+v)}else{var O={};O.type="wrongflashversion",this.publish("wrongflashversion",{fireOnce:!0}),this.fire("wrongflashversion",O)}}var n=e.Event,r=e.SWFDetect,i=e.Lang,s=e.UA,o=e.Node,u=e.Escape,a="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",f="application/x-shockwave-flash",l="10.0.22",c="http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+Math.random(),h="SWF.eventHandler",p={align:"",allowFullScreen:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",loop:"",menu:"",name:"",play:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};d._instances=d._instances||{},d.eventHandler=function(e,t){d._instances[e]._eventHandler(t)},d.prototype={_eventHandler:function(e){e.type==="swfReady"?(this.publish("swfReady",{fireOnce:!0}),this.fire("swfReady",e)):e.type!=="log"&&this.fire(e.type,e)},callSWF:function(e,t){return t||(t=[]),this._swf._node[e]?this._swf._node[e].apply(this._swf._node,t):null},toString:function(){return"SWF "+this._id}},e.augment(d,e.EventTarget),e.SWF=d},"3.7.2",{requires:["event-custom","node","swfdetect","escape"]});+YUI.add("swf",function(e,t){function d(t,n,d){this._id=e.guid("yuiswf");var v=this._id,m=o.one(t),d=d||{},g=d.version||l,y=(g+"").split("."),b=r.isFlashVersionAtLeast(parseInt(y[0],10),parseInt(y[1],10),parseInt(y[2],10)),w=r.isFlashVersionAtLeast(8,0,0),E=w&&!b&&d.useExpressInstall,S=E?c:n,x="<object ",T,N,C="yId="+e.id+"&YUISwfId="+v+"&YUIBridgeCallback="+h+"&allowedDomain="+document.location.hostname;e.SWF._instances[v]=this;if(m&&(b||E)&&S){x+='id="'+v+'" ',s.ie?x+='classid="'+a+'" ':x+='type="'+f+'" data="'+u.html(S)+'" ',T="100%",N="100%",x+='width="'+T+'" height="'+N+'">',s.ie&&(x+='<param name="movie" value="'+u.html(S)+'"/>');for(var k in d.fixedAttributes)p.hasOwnProperty(k)&&(x+='<param name="'+u.html(k)+'" value="'+u.html(d.fixedAttributes[k])+'"/>');for(var L in d.flashVars){var A=d.flashVars[L];i.isString(A)&&(C+="&"+u.html(L)+"="+u.html(encodeURIComponent(A)))}C&&(x+='<param name="flashVars" value="'+C+'"/>'),x+="</object>",m.set("innerHTML",x),this._swf=o.one("#"+v)}else{var O={};O.type="wrongflashversion",this.publish("wrongflashversion",{fireOnce:!0}),this.fire("wrongflashversion",O)}}var n=e.Event,r=e.SWFDetect,i=e.Lang,s=e.UA,o=e.Node,u=e.Escape,a="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000",f="application/x-shockwave-flash",l="10.0.22",c="http://fpdownload.macromedia.com/pub/flashplayer/update/current/swf/autoUpdater.swf?"+Math.random(),h="SWF.eventHandler",p={align:"",allowFullScreen:"",allowNetworking:"",allowScriptAccess:"",base:"",bgcolor:"",loop:"",menu:"",name:"",play:"",quality:"",salign:"",scale:"",tabindex:"",wmode:""};d._instances=d._instances||{},d.eventHandler=function(e,t){d._instances[e]._eventHandler(t)},d.prototype={_eventHandler:function(e){e.type==="swfReady"?(this.publish("swfReady",{fireOnce:!0}),this.fire("swfReady",e)):e.type!=="log"&&this.fire(e.type,e)},callSWF:function(e,t){return t||(t=[]),this._swf._node[e]?this._swf._node[e].apply(this._swf._node,t):null},toString:function(){return"SWF "+this._id}},e.augment(d,e.EventTarget),e.SWF=d},"3.7.3",{requires:["event-custom","node","swfdetect","escape"]});
bundle/swf/swf.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -205,4 +205,4 @@ Y.SWF = SWF; -}, '3.7.2', {"requires": ["event-custom", "node", "swfdetect", "escape"]});+}, '3.7.3', {"requires": ["event-custom", "node", "swfdetect", "escape"]});
bundle/swfdetect/swfdetect-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/swfdetect/swfdetect.js", code: [] };-_yuitest_coverage["build/swfdetect/swfdetect.js"].code=["YUI.add('swfdetect', function (Y, NAME) {","","/**"," * Utility for Flash version detection"," * @module swfdetect"," */","","// Shortcuts and helper methods","var version = 0,"," uA = Y.UA,"," lG = Y.Lang,"," sF = \"ShockwaveFlash\","," mF, eP, vS, ax6, ax;","","function makeInt(n) {"," return parseInt(n, 10);","}","","function parseFlashVersion (flashVer) {"," if (lG.isNumber(makeInt(flashVer[0]))) {"," uA.flashMajor = flashVer[0];"," }"," "," if (lG.isNumber(makeInt(flashVer[1]))) {"," uA.flashMinor = flashVer[1];"," }"," "," if (lG.isNumber(makeInt(flashVer[2]))) {"," uA.flashRev = flashVer[2];"," }","}","","if (uA.gecko || uA.webkit || uA.opera) {"," if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) {"," if ((eP = mF.enabledPlugin)) {"," vS = eP.description.replace(/\\s[rd]/g, '.').replace(/[A-Za-z\\s]+/g, '').split('.');"," parseFlashVersion(vS);"," }"," }","}","else if(uA.ie) {"," try"," {"," ax6 = new ActiveXObject(sF + \".\" + sF + \".6\");"," ax6.AllowScriptAccess = \"always\";"," }"," catch (e)"," {"," if(ax6 !== null)"," {"," version = 6.0;"," }"," }"," if (version === 0) {"," try"," {"," ax = new ActiveXObject(sF + \".\" + sF);"," vS = ax.GetVariable(\"$version\").replace(/[A-Za-z\\s]+/g, '').split(',');"," parseFlashVersion(vS);"," } catch (e2) {}"," }","}","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class SWFDetect"," * @constructor"," */",""," ","Y.SWFDetect = {",""," /**"," * Returns the version of either the Flash Player plugin (in Mozilla/WebKit/Opera browsers),"," * or the Flash Player ActiveX control (in IE), as a String of the form \"MM.mm.rr\", where"," * MM is the major version, mm is the minor version, and rr is the revision."," * @method getFlashVersion"," */ "," "," getFlashVersion : function () {"," return (String(uA.flashMajor) + \".\" + String(uA.flashMinor) + \".\" + String(uA.flashRev));"," },",""," /**"," * Checks whether the version of the Flash player installed on the user's machine is greater"," * than or equal to the one specified. If it is, this method returns true; it is false otherwise."," * @method isFlashVersionAtLeast"," * @return {Boolean} Whether the Flash player version is greater than or equal to the one specified."," * @param flashMajor {int} The Major version of the Flash player to compare against."," * @param flashMinor {int} The Minor version of the Flash player to compare against."," * @param flashRev {int} The Revision version of the Flash player to compare against."," */ "," isFlashVersionAtLeast : function (flashMajor, flashMinor, flashRev) {"," var uaMajor = makeInt(uA.flashMajor),"," uaMinor = makeInt(uA.flashMinor),"," uaRev = makeInt(uA.flashRev);"," "," flashMajor = makeInt(flashMajor || 0);"," flashMinor = makeInt(flashMinor || 0);"," flashRev = makeInt(flashRev || 0);",""," if (flashMajor === uaMajor) {"," if (flashMinor === uaMinor) {"," return flashRev <= uaRev;"," }"," return flashMinor < uaMinor;"," }"," return flashMajor < uaMajor;"," } ","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/swfdetect/swfdetect.js"].code=["YUI.add('swfdetect', function (Y, NAME) {","","/**"," * Utility for Flash version detection"," * @module swfdetect"," */","","// Shortcuts and helper methods","var version = 0,"," uA = Y.UA,"," lG = Y.Lang,"," sF = \"ShockwaveFlash\","," mF, eP, vS, ax6, ax;","","function makeInt(n) {"," return parseInt(n, 10);","}","","function parseFlashVersion (flashVer) {"," if (lG.isNumber(makeInt(flashVer[0]))) {"," uA.flashMajor = flashVer[0];"," }"," "," if (lG.isNumber(makeInt(flashVer[1]))) {"," uA.flashMinor = flashVer[1];"," }"," "," if (lG.isNumber(makeInt(flashVer[2]))) {"," uA.flashRev = flashVer[2];"," }","}","","if (uA.gecko || uA.webkit || uA.opera) {"," if ((mF = navigator.mimeTypes['application/x-shockwave-flash'])) {"," if ((eP = mF.enabledPlugin)) {"," vS = eP.description.replace(/\\s[rd]/g, '.').replace(/[A-Za-z\\s]+/g, '').split('.');"," parseFlashVersion(vS);"," }"," }","}","else if(uA.ie) {"," try"," {"," ax6 = new ActiveXObject(sF + \".\" + sF + \".6\");"," ax6.AllowScriptAccess = \"always\";"," }"," catch (e)"," {"," if(ax6 !== null)"," {"," version = 6.0;"," }"," }"," if (version === 0) {"," try"," {"," ax = new ActiveXObject(sF + \".\" + sF);"," vS = ax.GetVariable(\"$version\").replace(/[A-Za-z\\s]+/g, '').split(',');"," parseFlashVersion(vS);"," } catch (e2) {}"," }","}","","/** Create a calendar view to represent a single or multiple"," * month range of dates, rendered as a grid with date and"," * weekday labels."," * "," * @class SWFDetect"," * @constructor"," */",""," ","Y.SWFDetect = {",""," /**"," * Returns the version of either the Flash Player plugin (in Mozilla/WebKit/Opera browsers),"," * or the Flash Player ActiveX control (in IE), as a String of the form \"MM.mm.rr\", where"," * MM is the major version, mm is the minor version, and rr is the revision."," * @method getFlashVersion"," */ "," "," getFlashVersion : function () {"," return (String(uA.flashMajor) + \".\" + String(uA.flashMinor) + \".\" + String(uA.flashRev));"," },",""," /**"," * Checks whether the version of the Flash player installed on the user's machine is greater"," * than or equal to the one specified. If it is, this method returns true; it is false otherwise."," * @method isFlashVersionAtLeast"," * @return {Boolean} Whether the Flash player version is greater than or equal to the one specified."," * @param flashMajor {int} The Major version of the Flash player to compare against."," * @param flashMinor {int} The Minor version of the Flash player to compare against."," * @param flashRev {int} The Revision version of the Flash player to compare against."," */ "," isFlashVersionAtLeast : function (flashMajor, flashMinor, flashRev) {"," var uaMajor = makeInt(uA.flashMajor),"," uaMinor = makeInt(uA.flashMinor),"," uaRev = makeInt(uA.flashRev);"," "," flashMajor = makeInt(flashMajor || 0);"," flashMinor = makeInt(flashMinor || 0);"," flashRev = makeInt(flashRev || 0);",""," if (flashMajor === uaMajor) {"," if (flashMinor === uaMinor) {"," return flashRev <= uaRev;"," }"," return flashMinor < uaMinor;"," }"," return flashMajor < uaMajor;"," } ","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/swfdetect/swfdetect.js"].lines = {"1":0,"9":0,"15":0,"16":0,"19":0,"20":0,"21":0,"24":0,"25":0,"28":0,"29":0,"33":0,"34":0,"35":0,"36":0,"37":0,"41":0,"42":0,"44":0,"45":0,"49":0,"51":0,"54":0,"55":0,"57":0,"58":0,"59":0,"73":0,"83":0,"96":0,"100":0,"101":0,"102":0,"104":0,"105":0,"106":0,"108":0,"110":0}; _yuitest_coverage["build/swfdetect/swfdetect.js"].functions = {"makeInt:15":0,"parseFlashVersion:19":0,"getFlashVersion:82":0,"isFlashVersionAtLeast:95":0,"(anonymous 1):1":0}; _yuitest_coverage["build/swfdetect/swfdetect.js"].coveredLines = 38;@@ -194,4 +194,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/swfdetect/swfdetect-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -119,4 +119,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/swfdetect/swfdetect-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("swfdetect",function(e,t){function c(e){return parseInt(e,10)}function h(e){i.isNumber(c(e[0]))&&(r.flashMajor=e[0]),i.isNumber(c(e[1]))&&(r.flashMinor=e[1]),i.isNumber(c(e[2]))&&(r.flashRev=e[2])}var n=0,r=e.UA,i=e.Lang,s="ShockwaveFlash",o,u,a,f,l;if(r.gecko||r.webkit||r.opera){if(o=navigator.mimeTypes["application/x-shockwave-flash"])if(u=o.enabledPlugin)a=u.description.replace(/\s[rd]/g,".").replace(/[A-Za-z\s]+/g,"").split("."),h(a)}else if(r.ie){try{f=new ActiveXObject(s+"."+s+".6"),f.AllowScriptAccess="always"}catch(p){f!==null&&(n=6)}if(n===0)try{l=new ActiveXObject(s+"."+s),a=l.GetVariable("$version").replace(/[A-Za-z\s]+/g,"").split(","),h(a)}catch(d){}}e.SWFDetect={getFlashVersion:function(){return String(r.flashMajor)+"."+String(r.flashMinor)+"."+String(r.flashRev)},isFlashVersionAtLeast:function(e,t,n){var i=c(r.flashMajor),s=c(r.flashMinor),o=c(r.flashRev);return e=c(e||0),t=c(t||0),n=c(n||0),e===i?t===s?n<=o:t<s:e<i}}},"3.7.2",{requires:["yui-base"]});+YUI.add("swfdetect",function(e,t){function c(e){return parseInt(e,10)}function h(e){i.isNumber(c(e[0]))&&(r.flashMajor=e[0]),i.isNumber(c(e[1]))&&(r.flashMinor=e[1]),i.isNumber(c(e[2]))&&(r.flashRev=e[2])}var n=0,r=e.UA,i=e.Lang,s="ShockwaveFlash",o,u,a,f,l;if(r.gecko||r.webkit||r.opera){if(o=navigator.mimeTypes["application/x-shockwave-flash"])if(u=o.enabledPlugin)a=u.description.replace(/\s[rd]/g,".").replace(/[A-Za-z\s]+/g,"").split("."),h(a)}else if(r.ie){try{f=new ActiveXObject(s+"."+s+".6"),f.AllowScriptAccess="always"}catch(p){f!==null&&(n=6)}if(n===0)try{l=new ActiveXObject(s+"."+s),a=l.GetVariable("$version").replace(/[A-Za-z\s]+/g,"").split(","),h(a)}catch(d){}}e.SWFDetect={getFlashVersion:function(){return String(r.flashMajor)+"."+String(r.flashMinor)+"."+String(r.flashRev)},isFlashVersionAtLeast:function(e,t,n){var i=c(r.flashMajor),s=c(r.flashMinor),o=c(r.flashRev);return e=c(e||0),t=c(t||0),n=c(n||0),e===i?t===s?n<=o:t<s:e<i}}},"3.7.3",{requires:["yui-base"]});
bundle/swfdetect/swfdetect.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -118,4 +118,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/tabview-base/assets/tabview-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview-base/assets/tabview.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview-base/tabview-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/tabview-base/tabview-base.js", code: [] };-_yuitest_coverage["build/tabview-base/tabview-base.js"].code=["YUI.add('tabview-base', function (Y, NAME) {","","var getClassName = Y.ClassNameManager.getClassName,"," TABVIEW = 'tabview',"," TAB = 'tab',"," CONTENT = 'content',"," PANEL = 'panel',"," SELECTED = 'selected',"," EMPTY_OBJ = {},"," DOT = '.',",""," _classNames = {"," tabview: getClassName(TABVIEW),"," tabviewPanel: getClassName(TABVIEW, PANEL),"," tabviewList: getClassName(TABVIEW, 'list'),"," tab: getClassName(TAB),"," tabLabel: getClassName(TAB, 'label'),"," tabPanel: getClassName(TAB, PANEL),"," selectedTab: getClassName(TAB, SELECTED),"," selectedPanel: getClassName(TAB, PANEL, SELECTED)"," },",""," _queries = {"," tabview: DOT + _classNames.tabview,"," tabviewList: '> ul',"," tab: '> ul > li',"," tabLabel: '> ul > li > a',"," tabviewPanel: '> div',"," tabPanel: '> div > div',"," selectedTab: '> ul > ' + DOT + _classNames.selectedTab,"," selectedPanel: '> div ' + DOT + _classNames.selectedPanel"," },",""," TabviewBase = function(config) {"," this.init.apply(this, arguments);"," };","","TabviewBase.NAME = 'tabviewBase';","TabviewBase._queries = _queries;","TabviewBase._classNames = _classNames;","","Y.mix(TabviewBase.prototype, {"," init: function(config) {"," config = config || EMPTY_OBJ;"," this._node = config.host || Y.one(config.node);",""," this.refresh();"," },",""," initClassNames: function(index) {"," Y.Object.each(_queries, function(query, name) {"," // this === tabview._node"," if (_classNames[name]) {"," var result = this.all(query);"," "," if (index !== undefined) {"," result = result.item(index);"," }",""," if (result) {"," result.addClass(_classNames[name]);"," }"," }"," }, this._node);",""," this._node.addClass(_classNames.tabview);"," },",""," _select: function(index) {"," var node = this._node,"," oldItem = node.one(_queries.selectedTab),"," oldContent = node.one(_queries.selectedPanel),"," newItem = node.all(_queries.tab).item(index),"," newContent = node.all(_queries.tabPanel).item(index);",""," if (oldItem) {"," oldItem.removeClass(_classNames.selectedTab);"," }",""," if (oldContent) {"," oldContent.removeClass(_classNames.selectedPanel);"," }",""," if (newItem) {"," newItem.addClass(_classNames.selectedTab);"," }",""," if (newContent) {"," newContent.addClass(_classNames.selectedPanel);"," }"," },",""," initState: function() {"," var node = this._node,"," activeNode = node.one(_queries.selectedTab),"," activeIndex = activeNode ?"," node.all(_queries.tab).indexOf(activeNode) : 0;",""," this._select(activeIndex);"," },",""," // collapse extra space between list-items"," _scrubTextNodes: function() {"," this._node.one(_queries.tabviewList).get('childNodes').each(function(node) {"," if (node.get('nodeType') === 3) { // text node"," node.remove();"," }"," });"," },",""," // base renderer only enlivens existing markup"," refresh: function() {"," this._scrubTextNodes();"," this.initClassNames();"," this.initState();"," this.initEvents();"," },",""," tabEventName: 'click',",""," initEvents: function() {"," // TODO: detach prefix for delegate?"," // this._node.delegate('tabview|' + this.tabEventName),"," this._node.delegate(this.tabEventName,"," this.onTabEvent,"," _queries.tab,"," this"," );"," },",""," onTabEvent: function(e) {"," e.preventDefault();"," this._select(this._node.all(_queries.tab).indexOf(e.currentTarget));"," },",""," destroy: function() {"," this._node.detach(this.tabEventName);"," }","});","","Y.TabviewBase = TabviewBase;","","","}, '3.7.2', {\"requires\": [\"node-event-delegate\", \"classnamemanager\", \"skin-sam-tabview\"]});"];+_yuitest_coverage["build/tabview-base/tabview-base.js"].code=["YUI.add('tabview-base', function (Y, NAME) {","","var getClassName = Y.ClassNameManager.getClassName,"," TABVIEW = 'tabview',"," TAB = 'tab',"," CONTENT = 'content',"," PANEL = 'panel',"," SELECTED = 'selected',"," EMPTY_OBJ = {},"," DOT = '.',",""," _classNames = {"," tabview: getClassName(TABVIEW),"," tabviewPanel: getClassName(TABVIEW, PANEL),"," tabviewList: getClassName(TABVIEW, 'list'),"," tab: getClassName(TAB),"," tabLabel: getClassName(TAB, 'label'),"," tabPanel: getClassName(TAB, PANEL),"," selectedTab: getClassName(TAB, SELECTED),"," selectedPanel: getClassName(TAB, PANEL, SELECTED)"," },",""," _queries = {"," tabview: DOT + _classNames.tabview,"," tabviewList: '> ul',"," tab: '> ul > li',"," tabLabel: '> ul > li > a',"," tabviewPanel: '> div',"," tabPanel: '> div > div',"," selectedTab: '> ul > ' + DOT + _classNames.selectedTab,"," selectedPanel: '> div ' + DOT + _classNames.selectedPanel"," },",""," TabviewBase = function(config) {"," this.init.apply(this, arguments);"," };","","TabviewBase.NAME = 'tabviewBase';","TabviewBase._queries = _queries;","TabviewBase._classNames = _classNames;","","Y.mix(TabviewBase.prototype, {"," init: function(config) {"," config = config || EMPTY_OBJ;"," this._node = config.host || Y.one(config.node);",""," this.refresh();"," },",""," initClassNames: function(index) {"," Y.Object.each(_queries, function(query, name) {"," // this === tabview._node"," if (_classNames[name]) {"," var result = this.all(query);"," "," if (index !== undefined) {"," result = result.item(index);"," }",""," if (result) {"," result.addClass(_classNames[name]);"," }"," }"," }, this._node);",""," this._node.addClass(_classNames.tabview);"," },",""," _select: function(index) {"," var node = this._node,"," oldItem = node.one(_queries.selectedTab),"," oldContent = node.one(_queries.selectedPanel),"," newItem = node.all(_queries.tab).item(index),"," newContent = node.all(_queries.tabPanel).item(index);",""," if (oldItem) {"," oldItem.removeClass(_classNames.selectedTab);"," }",""," if (oldContent) {"," oldContent.removeClass(_classNames.selectedPanel);"," }",""," if (newItem) {"," newItem.addClass(_classNames.selectedTab);"," }",""," if (newContent) {"," newContent.addClass(_classNames.selectedPanel);"," }"," },",""," initState: function() {"," var node = this._node,"," activeNode = node.one(_queries.selectedTab),"," activeIndex = activeNode ?"," node.all(_queries.tab).indexOf(activeNode) : 0;",""," this._select(activeIndex);"," },",""," // collapse extra space between list-items"," _scrubTextNodes: function() {"," this._node.one(_queries.tabviewList).get('childNodes').each(function(node) {"," if (node.get('nodeType') === 3) { // text node"," node.remove();"," }"," });"," },",""," // base renderer only enlivens existing markup"," refresh: function() {"," this._scrubTextNodes();"," this.initClassNames();"," this.initState();"," this.initEvents();"," },",""," tabEventName: 'click',",""," initEvents: function() {"," // TODO: detach prefix for delegate?"," // this._node.delegate('tabview|' + this.tabEventName),"," this._node.delegate(this.tabEventName,"," this.onTabEvent,"," _queries.tab,"," this"," );"," },",""," onTabEvent: function(e) {"," e.preventDefault();"," this._select(this._node.all(_queries.tab).indexOf(e.currentTarget));"," },",""," destroy: function() {"," this._node.detach(this.tabEventName);"," }","});","","Y.TabviewBase = TabviewBase;","","","}, '3.7.3', {\"requires\": [\"node-event-delegate\", \"classnamemanager\", \"skin-sam-tabview\"]});"]; _yuitest_coverage["build/tabview-base/tabview-base.js"].lines = {"1":0,"3":0,"35":0,"38":0,"39":0,"40":0,"42":0,"44":0,"45":0,"47":0,"51":0,"53":0,"54":0,"56":0,"57":0,"60":0,"61":0,"66":0,"70":0,"76":0,"77":0,"80":0,"81":0,"84":0,"85":0,"88":0,"89":0,"94":0,"99":0,"104":0,"105":0,"106":0,"113":0,"114":0,"115":0,"116":0,"124":0,"132":0,"133":0,"137":0,"141":0}; _yuitest_coverage["build/tabview-base/tabview-base.js"].functions = {"TabviewBase:34":0,"init:43":0,"(anonymous 2):51":0,"initClassNames:50":0,"_select:69":0,"initState:93":0,"(anonymous 3):104":0,"_scrubTextNodes:103":0,"refresh:112":0,"initEvents:121":0,"onTabEvent:131":0,"destroy:136":0,"(anonymous 1):1":0}; _yuitest_coverage["build/tabview-base/tabview-base.js"].coveredLines = 41;@@ -234,4 +234,4 @@ Y.TabviewBase = TabviewBase; -}, '3.7.2', {"requires": ["node-event-delegate", "classnamemanager", "skin-sam-tabview"]});+}, '3.7.3', {"requires": ["node-event-delegate", "classnamemanager", "skin-sam-tabview"]});
bundle/tabview-base/tabview-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -147,4 +147,4 @@ Y.TabviewBase = TabviewBase; -}, '3.7.2', {"requires": ["node-event-delegate", "classnamemanager", "skin-sam-tabview"]});+}, '3.7.3', {"requires": ["node-event-delegate", "classnamemanager", "skin-sam-tabview"]});
bundle/tabview-base/tabview-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("tabview-base",function(e,t){var n=e.ClassNameManager.getClassName,r="tabview",i="tab",s="content",o="panel",u="selected",a={},f=".",l={tabview:n(r),tabviewPanel:n(r,o),tabviewList:n(r,"list"),tab:n(i),tabLabel:n(i,"label"),tabPanel:n(i,o),selectedTab:n(i,u),selectedPanel:n(i,o,u)},c={tabview:f+l.tabview,tabviewList:"> ul",tab:"> ul > li",tabLabel:"> ul > li > a",tabviewPanel:"> div",tabPanel:"> div > div",selectedTab:"> ul > "+f+l.selectedTab,selectedPanel:"> div "+f+l.selectedPanel},h=function(e){this.init.apply(this,arguments)};h.NAME="tabviewBase",h._queries=c,h._classNames=l,e.mix(h.prototype,{init:function(t){t=t||a,this._node=t.host||e.one(t.node),this.refresh()},initClassNames:function(t){e.Object.each(c,function(e,n){if(l[n]){var r=this.all(e);t!==undefined&&(r=r.item(t)),r&&r.addClass(l[n])}},this._node),this._node.addClass(l.tabview)},_select:function(e){var t=this._node,n=t.one(c.selectedTab),r=t.one(c.selectedPanel),i=t.all(c.tab).item(e),s=t.all(c.tabPanel).item(e);n&&n.removeClass(l.selectedTab),r&&r.removeClass(l.selectedPanel),i&&i.addClass(l.selectedTab),s&&s.addClass(l.selectedPanel)},initState:function(){var e=this._node,t=e.one(c.selectedTab),n=t?e.all(c.tab).indexOf(t):0;this._select(n)},_scrubTextNodes:function(){this._node.one(c.tabviewList).get("childNodes").each(function(e){e.get("nodeType")===3&&e.remove()})},refresh:function(){this._scrubTextNodes(),this.initClassNames(),this.initState(),this.initEvents()},tabEventName:"click",initEvents:function(){this._node.delegate(this.tabEventName,this.onTabEvent,c.tab,this)},onTabEvent:function(e){e.preventDefault(),this._select(this._node.all(c.tab).indexOf(e.currentTarget))},destroy:function(){this._node.detach(this.tabEventName)}}),e.TabviewBase=h},"3.7.2",{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]});+YUI.add("tabview-base",function(e,t){var n=e.ClassNameManager.getClassName,r="tabview",i="tab",s="content",o="panel",u="selected",a={},f=".",l={tabview:n(r),tabviewPanel:n(r,o),tabviewList:n(r,"list"),tab:n(i),tabLabel:n(i,"label"),tabPanel:n(i,o),selectedTab:n(i,u),selectedPanel:n(i,o,u)},c={tabview:f+l.tabview,tabviewList:"> ul",tab:"> ul > li",tabLabel:"> ul > li > a",tabviewPanel:"> div",tabPanel:"> div > div",selectedTab:"> ul > "+f+l.selectedTab,selectedPanel:"> div "+f+l.selectedPanel},h=function(e){this.init.apply(this,arguments)};h.NAME="tabviewBase",h._queries=c,h._classNames=l,e.mix(h.prototype,{init:function(t){t=t||a,this._node=t.host||e.one(t.node),this.refresh()},initClassNames:function(t){e.Object.each(c,function(e,n){if(l[n]){var r=this.all(e);t!==undefined&&(r=r.item(t)),r&&r.addClass(l[n])}},this._node),this._node.addClass(l.tabview)},_select:function(e){var t=this._node,n=t.one(c.selectedTab),r=t.one(c.selectedPanel),i=t.all(c.tab).item(e),s=t.all(c.tabPanel).item(e);n&&n.removeClass(l.selectedTab),r&&r.removeClass(l.selectedPanel),i&&i.addClass(l.selectedTab),s&&s.addClass(l.selectedPanel)},initState:function(){var e=this._node,t=e.one(c.selectedTab),n=t?e.all(c.tab).indexOf(t):0;this._select(n)},_scrubTextNodes:function(){this._node.one(c.tabviewList).get("childNodes").each(function(e){e.get("nodeType")===3&&e.remove()})},refresh:function(){this._scrubTextNodes(),this.initClassNames(),this.initState(),this.initEvents()},tabEventName:"click",initEvents:function(){this._node.delegate(this.tabEventName,this.onTabEvent,c.tab,this)},onTabEvent:function(e){e.preventDefault(),this._select(this._node.all(c.tab).indexOf(e.currentTarget))},destroy:function(){this._node.detach(this.tabEventName)}}),e.TabviewBase=h},"3.7.3",{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]});
bundle/tabview-base/tabview-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -147,4 +147,4 @@ Y.TabviewBase = TabviewBase; -}, '3.7.2', {"requires": ["node-event-delegate", "classnamemanager", "skin-sam-tabview"]});+}, '3.7.3', {"requires": ["node-event-delegate", "classnamemanager", "skin-sam-tabview"]});
bundle/tabview-plugin/assets/tabview-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview-plugin/assets/tabview.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview-plugin/tabview-plugin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/tabview-plugin/tabview-plugin.js", code: [] };-_yuitest_coverage["build/tabview-plugin/tabview-plugin.js"].code=["YUI.add('tabview-plugin', function (Y, NAME) {","","function TabviewPlugin() {"," TabviewPlugin.superclass.constructor.apply(this, arguments);","};","","TabviewPlugin.NAME = 'tabviewPlugin';","TabviewPlugin.NS = 'tabs';","","Y.extend(TabviewPlugin, Y.TabviewBase);","","Y.namespace('Plugin');","Y.Plugin.Tabview = TabviewPlugin;","","","}, '3.7.2', {\"requires\": [\"tabview-base\"]});"];+_yuitest_coverage["build/tabview-plugin/tabview-plugin.js"].code=["YUI.add('tabview-plugin', function (Y, NAME) {","","function TabviewPlugin() {"," TabviewPlugin.superclass.constructor.apply(this, arguments);","};","","TabviewPlugin.NAME = 'tabviewPlugin';","TabviewPlugin.NS = 'tabs';","","Y.extend(TabviewPlugin, Y.TabviewBase);","","Y.namespace('Plugin');","Y.Plugin.Tabview = TabviewPlugin;","","","}, '3.7.3', {\"requires\": [\"tabview-base\"]});"]; _yuitest_coverage["build/tabview-plugin/tabview-plugin.js"].lines = {"1":0,"3":0,"4":0,"5":0,"7":0,"8":0,"10":0,"12":0,"13":0}; _yuitest_coverage["build/tabview-plugin/tabview-plugin.js"].functions = {"TabviewPlugin:3":0,"(anonymous 1):1":0}; _yuitest_coverage["build/tabview-plugin/tabview-plugin.js"].coveredLines = 9;@@ -63,4 +63,4 @@ Y.Plugin.Tabview = TabviewPlugin; -}, '3.7.2', {"requires": ["tabview-base"]});+}, '3.7.3', {"requires": ["tabview-base"]});
bundle/tabview-plugin/tabview-plugin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,4 +19,4 @@ Y.Plugin.Tabview = TabviewPlugin; -}, '3.7.2', {"requires": ["tabview-base"]});+}, '3.7.3', {"requires": ["tabview-base"]});
bundle/tabview-plugin/tabview-plugin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("tabview-plugin",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}n.NAME="tabviewPlugin",n.NS="tabs",e.extend(n,e.TabviewBase),e.namespace("Plugin"),e.Plugin.Tabview=n},"3.7.2",{requires:["tabview-base"]});+YUI.add("tabview-plugin",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}n.NAME="tabviewPlugin",n.NS="tabs",e.extend(n,e.TabviewBase),e.namespace("Plugin"),e.Plugin.Tabview=n},"3.7.3",{requires:["tabview-base"]});
bundle/tabview-plugin/tabview-plugin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,4 +19,4 @@ Y.Plugin.Tabview = TabviewPlugin; -}, '3.7.2', {"requires": ["tabview-base"]});+}, '3.7.3', {"requires": ["tabview-base"]});
bundle/tabview/assets/skins/night/tabview-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview/assets/skins/night/tabview.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview/assets/skins/sam/tabview-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview/assets/skins/sam/tabview.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview/assets/tabview-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview/assets/tabview.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/tabview/tabview-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/tabview/tabview.js", code: [] };-_yuitest_coverage["build/tabview/tabview.js"].code=["YUI.add('tabview', function (Y, NAME) {","","/**"," * The TabView module "," *"," * @module tabview"," */","","var _queries = Y.TabviewBase._queries,"," _classNames = Y.TabviewBase._classNames,"," DOT = '.',"," getClassName = Y.ClassNameManager.getClassName,",""," /**"," * Provides a tabbed widget interface "," * @param config {Object} Object literal specifying tabview configuration properties."," *"," * @class TabView"," * @constructor"," * @extends Widget"," * @uses WidgetParent"," */"," TabView = Y.Base.create('tabView', Y.Widget, [Y.WidgetParent], {"," _afterChildAdded: function(e) {"," this.get('contentBox').focusManager.refresh();"," },",""," _defListNodeValueFn: function() {"," return Y.Node.create(TabView.LIST_TEMPLATE);"," },",""," _defPanelNodeValueFn: function() {"," return Y.Node.create(TabView.PANEL_TEMPLATE);"," },",""," _afterChildRemoved: function(e) { // update the selected tab when removed"," var i = e.index,"," selection = this.get('selection');",""," if (!selection) { // select previous item if selection removed"," selection = this.item(i - 1) || this.item(0);"," if (selection) {"," selection.set('selected', 1);"," }"," }",""," this.get('contentBox').focusManager.refresh();"," },",""," _initAria: function() {"," var contentBox = this.get('contentBox'),"," tablist = contentBox.one(_queries.tabviewList);",""," if (tablist) {"," tablist.setAttrs({"," //'aria-labelledby': "," role: 'tablist'"," });"," }"," },",""," bindUI: function() {"," // Use the Node Focus Manager to add keyboard support:"," // Pressing the left and right arrow keys will move focus"," // among each of the tabs.",""," this.get('contentBox').plug(Y.Plugin.NodeFocusManager, {"," descendants: DOT + _classNames.tabLabel,"," keys: { next: 'down:39', // Right arrow"," previous: 'down:37' }, // Left arrow"," circular: true"," });",""," this.after('render', this._setDefSelection);"," this.after('addChild', this._afterChildAdded);"," this.after('removeChild', this._afterChildRemoved);"," },"," "," renderUI: function() {"," var contentBox = this.get('contentBox'); "," this._renderListBox(contentBox);"," this._renderPanelBox(contentBox);"," this._childrenContainer = this.get('listNode');"," this._renderTabs(contentBox);"," },",""," _setDefSelection: function(contentBox) {"," // If no tab is selected, select the first tab."," var selection = this.get('selection') || this.item(0);",""," this.some(function(tab) {"," if (tab.get('selected')) {"," selection = tab;"," return true;"," }"," });"," if (selection) {"," // TODO: why both needed? (via widgetParent/Child)?"," this.set('selection', selection);"," selection.set('selected', 1);"," }"," },",""," _renderListBox: function(contentBox) {"," var node = this.get('listNode');"," if (!node.inDoc()) {"," contentBox.append(node);"," }"," },",""," _renderPanelBox: function(contentBox) {"," var node = this.get('panelNode');"," if (!node.inDoc()) {"," contentBox.append(node);"," }"," },",""," _renderTabs: function(contentBox) {"," var tabs = contentBox.all(_queries.tab),"," panelNode = this.get('panelNode'),"," panels = (panelNode) ? this.get('panelNode').get('children') : null,"," tabview = this;",""," if (tabs) { // add classNames and fill in Tab fields from markup when possible"," tabs.addClass(_classNames.tab);"," contentBox.all(_queries.tabLabel).addClass(_classNames.tabLabel);"," contentBox.all(_queries.tabPanel).addClass(_classNames.tabPanel);",""," tabs.each(function(node, i) {"," var panelNode = (panels) ? panels.item(i) : null;"," tabview.add({"," boundingBox: node,"," contentBox: node.one(DOT + _classNames.tabLabel),"," label: node.one(DOT + _classNames.tabLabel).get('text'),"," panelNode: panelNode"," });"," });"," }"," }","}, {",""," LIST_TEMPLATE: '<ul class=\"' + _classNames.tabviewList + '\"></ul>',"," PANEL_TEMPLATE: '<div class=\"' + _classNames.tabviewPanel + '\"></div>',",""," ATTRS: {"," defaultChildType: { "," value: 'Tab'"," },",""," listNode: {"," setter: function(node) {"," node = Y.one(node);"," if (node) {"," node.addClass(_classNames.tabviewList);"," }"," return node;"," },",""," valueFn: '_defListNodeValueFn'"," },",""," panelNode: {"," setter: function(node) {"," node = Y.one(node);"," if (node) {"," node.addClass(_classNames.tabviewPanel);"," }"," return node;"," },",""," valueFn: '_defPanelNodeValueFn'"," },",""," tabIndex: {"," value: null"," //validator: '_validTabIndex'"," }"," },",""," HTML_PARSER: {"," listNode: _queries.tabviewList,"," panelNode: _queries.tabviewPanel"," }","});","","Y.TabView = TabView;","var Lang = Y.Lang,"," _queries = Y.TabviewBase._queries,"," _classNames = Y.TabviewBase._classNames,"," getClassName = Y.ClassNameManager.getClassName;","","/**"," * Provides Tab instances for use with TabView"," * @param config {Object} Object literal specifying tabview configuration properties."," *"," * @class Tab"," * @constructor"," * @extends Widget"," * @uses WidgetChild"," */","Y.Tab = Y.Base.create('tab', Y.Widget, [Y.WidgetChild], {"," BOUNDING_TEMPLATE: '<li class=\"' + _classNames.tab + '\"></li>',"," CONTENT_TEMPLATE: '<a class=\"' + _classNames.tabLabel + '\"></a>',"," PANEL_TEMPLATE: '<div class=\"' + _classNames.tabPanel + '\"></div>',",""," _uiSetSelectedPanel: function(selected) {"," this.get('panelNode').toggleClass(_classNames.selectedPanel, selected);"," },",""," _afterTabSelectedChange: function(event) {"," this._uiSetSelectedPanel(event.newVal);"," },",""," _afterParentChange: function(e) {"," if (!e.newVal) {"," this._remove();"," } else {"," this._add();"," }"," },",""," _initAria: function() {"," var anchor = this.get('contentBox'),"," id = anchor.get('id'),"," panel = this.get('panelNode');"," "," if (!id) {"," id = Y.guid();"," anchor.set('id', id);"," }"," // Apply the ARIA roles, states and properties to each tab"," anchor.set('role', 'tab');"," anchor.get('parentNode').set('role', 'presentation');"," "," "," // Apply the ARIA roles, states and properties to each panel"," panel.setAttrs({"," role: 'tabpanel',"," 'aria-labelledby': id"," });"," },",""," syncUI: function() {"," this.set('label', this.get('label'));"," this.set('content', this.get('content'));"," this._uiSetSelectedPanel(this.get('selected'));"," },",""," bindUI: function() {"," this.after('selectedChange', this._afterTabSelectedChange);"," this.after('parentChange', this._afterParentChange);"," },",""," renderUI: function() {"," this._renderPanel();"," this._initAria();"," },",""," _renderPanel: function() {"," this.get('parent').get('panelNode')"," .appendChild(this.get('panelNode'));"," },",""," _add: function() {"," var parent = this.get('parent').get('contentBox'),"," list = parent.get('listNode'),"," panel = parent.get('panelNode');",""," if (list) {"," list.appendChild(this.get('boundingBox'));"," }",""," if (panel) {"," panel.appendChild(this.get('panelNode'));"," }"," },"," "," _remove: function() {"," this.get('boundingBox').remove();"," this.get('panelNode').remove();"," },",""," _onActivate: function(e) {"," if (e.target === this) {"," // Prevent the browser from navigating to the URL specified by the "," // anchor's href attribute."," e.domEvent.preventDefault();"," e.target.set('selected', 1);"," }"," },"," "," initializer: function() {"," this.publish(this.get('triggerEvent'), { "," defaultFn: this._onActivate"," });"," },",""," _defLabelSetter: function(label) {"," this.get('contentBox').setContent(label);"," return label;"," },",""," _defContentSetter: function(content) {"," this.get('panelNode').setContent(content);"," return content;"," },",""," _defContentGetter: function(content) {"," return this.get('panelNode').getContent();"," },",""," // find panel by ID mapping from label href"," _defPanelNodeValueFn: function() {"," var href = this.get('contentBox').get('href') || '',"," parent = this.get('parent'),"," hashIndex = href.indexOf('#'),"," panel;",""," href = href.substr(hashIndex);",""," if (href.charAt(0) === '#') { // in-page nav, find by ID"," panel = Y.one(href);"," if (panel) {"," panel.addClass(_classNames.tabPanel);"," }"," }",""," // use the one found by id, or else try matching indices"," if (!panel && parent) {"," panel = parent.get('panelNode')"," .get('children').item(this.get('index'));"," }",""," if (!panel) { // create if none found"," panel = Y.Node.create(this.PANEL_TEMPLATE);"," }"," return panel;"," }","}, {"," ATTRS: {"," /**"," * @attribute triggerEvent"," * @default \"click\" "," * @type String"," */"," triggerEvent: {"," value: 'click'"," },",""," /**"," * @attribute label"," * @type HTML"," */"," label: { "," setter: '_defLabelSetter',"," validator: Lang.isString"," },",""," /**"," * @attribute content"," * @type HTML"," */"," content: {"," setter: '_defContentSetter',"," getter: '_defContentGetter'"," },",""," /**"," * @attribute panelNode"," * @type Y.Node"," */"," panelNode: {"," setter: function(node) {"," node = Y.one(node);"," if (node) {"," node.addClass(_classNames.tabPanel);"," }"," return node;"," },"," valueFn: '_defPanelNodeValueFn'"," },"," "," tabIndex: {"," value: null,"," validator: '_validTabIndex'"," } ",""," },",""," HTML_PARSER: {"," selected: function(contentBox) {"," var ret = (this.get('boundingBox').hasClass(_classNames.selectedTab)) ?"," 1 : 0;"," return ret;"," }"," }","","});","","","}, '3.7.2', {\"requires\": [\"widget\", \"widget-parent\", \"widget-child\", \"tabview-base\", \"node-pluginhost\", \"node-focusmanager\"], \"skinnable\": true});"];+_yuitest_coverage["build/tabview/tabview.js"].code=["YUI.add('tabview', function (Y, NAME) {","","/**"," * The TabView module "," *"," * @module tabview"," */","","var _queries = Y.TabviewBase._queries,"," _classNames = Y.TabviewBase._classNames,"," DOT = '.',"," getClassName = Y.ClassNameManager.getClassName,",""," /**"," * Provides a tabbed widget interface "," * @param config {Object} Object literal specifying tabview configuration properties."," *"," * @class TabView"," * @constructor"," * @extends Widget"," * @uses WidgetParent"," */"," TabView = Y.Base.create('tabView', Y.Widget, [Y.WidgetParent], {"," _afterChildAdded: function(e) {"," this.get('contentBox').focusManager.refresh();"," },",""," _defListNodeValueFn: function() {"," return Y.Node.create(TabView.LIST_TEMPLATE);"," },",""," _defPanelNodeValueFn: function() {"," return Y.Node.create(TabView.PANEL_TEMPLATE);"," },",""," _afterChildRemoved: function(e) { // update the selected tab when removed"," var i = e.index,"," selection = this.get('selection');",""," if (!selection) { // select previous item if selection removed"," selection = this.item(i - 1) || this.item(0);"," if (selection) {"," selection.set('selected', 1);"," }"," }",""," this.get('contentBox').focusManager.refresh();"," },",""," _initAria: function() {"," var contentBox = this.get('contentBox'),"," tablist = contentBox.one(_queries.tabviewList);",""," if (tablist) {"," tablist.setAttrs({"," //'aria-labelledby': "," role: 'tablist'"," });"," }"," },",""," bindUI: function() {"," // Use the Node Focus Manager to add keyboard support:"," // Pressing the left and right arrow keys will move focus"," // among each of the tabs.",""," this.get('contentBox').plug(Y.Plugin.NodeFocusManager, {"," descendants: DOT + _classNames.tabLabel,"," keys: { next: 'down:39', // Right arrow"," previous: 'down:37' }, // Left arrow"," circular: true"," });",""," this.after('render', this._setDefSelection);"," this.after('addChild', this._afterChildAdded);"," this.after('removeChild', this._afterChildRemoved);"," },"," "," renderUI: function() {"," var contentBox = this.get('contentBox'); "," this._renderListBox(contentBox);"," this._renderPanelBox(contentBox);"," this._childrenContainer = this.get('listNode');"," this._renderTabs(contentBox);"," },",""," _setDefSelection: function(contentBox) {"," // If no tab is selected, select the first tab."," var selection = this.get('selection') || this.item(0);",""," this.some(function(tab) {"," if (tab.get('selected')) {"," selection = tab;"," return true;"," }"," });"," if (selection) {"," // TODO: why both needed? (via widgetParent/Child)?"," this.set('selection', selection);"," selection.set('selected', 1);"," }"," },",""," _renderListBox: function(contentBox) {"," var node = this.get('listNode');"," if (!node.inDoc()) {"," contentBox.append(node);"," }"," },",""," _renderPanelBox: function(contentBox) {"," var node = this.get('panelNode');"," if (!node.inDoc()) {"," contentBox.append(node);"," }"," },",""," _renderTabs: function(contentBox) {"," var tabs = contentBox.all(_queries.tab),"," panelNode = this.get('panelNode'),"," panels = (panelNode) ? this.get('panelNode').get('children') : null,"," tabview = this;",""," if (tabs) { // add classNames and fill in Tab fields from markup when possible"," tabs.addClass(_classNames.tab);"," contentBox.all(_queries.tabLabel).addClass(_classNames.tabLabel);"," contentBox.all(_queries.tabPanel).addClass(_classNames.tabPanel);",""," tabs.each(function(node, i) {"," var panelNode = (panels) ? panels.item(i) : null;"," tabview.add({"," boundingBox: node,"," contentBox: node.one(DOT + _classNames.tabLabel),"," label: node.one(DOT + _classNames.tabLabel).get('text'),"," panelNode: panelNode"," });"," });"," }"," }","}, {",""," LIST_TEMPLATE: '<ul class=\"' + _classNames.tabviewList + '\"></ul>',"," PANEL_TEMPLATE: '<div class=\"' + _classNames.tabviewPanel + '\"></div>',",""," ATTRS: {"," defaultChildType: { "," value: 'Tab'"," },",""," listNode: {"," setter: function(node) {"," node = Y.one(node);"," if (node) {"," node.addClass(_classNames.tabviewList);"," }"," return node;"," },",""," valueFn: '_defListNodeValueFn'"," },",""," panelNode: {"," setter: function(node) {"," node = Y.one(node);"," if (node) {"," node.addClass(_classNames.tabviewPanel);"," }"," return node;"," },",""," valueFn: '_defPanelNodeValueFn'"," },",""," tabIndex: {"," value: null"," //validator: '_validTabIndex'"," }"," },",""," HTML_PARSER: {"," listNode: _queries.tabviewList,"," panelNode: _queries.tabviewPanel"," }","});","","Y.TabView = TabView;","var Lang = Y.Lang,"," _queries = Y.TabviewBase._queries,"," _classNames = Y.TabviewBase._classNames,"," getClassName = Y.ClassNameManager.getClassName;","","/**"," * Provides Tab instances for use with TabView"," * @param config {Object} Object literal specifying tabview configuration properties."," *"," * @class Tab"," * @constructor"," * @extends Widget"," * @uses WidgetChild"," */","Y.Tab = Y.Base.create('tab', Y.Widget, [Y.WidgetChild], {"," BOUNDING_TEMPLATE: '<li class=\"' + _classNames.tab + '\"></li>',"," CONTENT_TEMPLATE: '<a class=\"' + _classNames.tabLabel + '\"></a>',"," PANEL_TEMPLATE: '<div class=\"' + _classNames.tabPanel + '\"></div>',",""," _uiSetSelectedPanel: function(selected) {"," this.get('panelNode').toggleClass(_classNames.selectedPanel, selected);"," },",""," _afterTabSelectedChange: function(event) {"," this._uiSetSelectedPanel(event.newVal);"," },",""," _afterParentChange: function(e) {"," if (!e.newVal) {"," this._remove();"," } else {"," this._add();"," }"," },",""," _initAria: function() {"," var anchor = this.get('contentBox'),"," id = anchor.get('id'),"," panel = this.get('panelNode');"," "," if (!id) {"," id = Y.guid();"," anchor.set('id', id);"," }"," // Apply the ARIA roles, states and properties to each tab"," anchor.set('role', 'tab');"," anchor.get('parentNode').set('role', 'presentation');"," "," "," // Apply the ARIA roles, states and properties to each panel"," panel.setAttrs({"," role: 'tabpanel',"," 'aria-labelledby': id"," });"," },",""," syncUI: function() {"," this.set('label', this.get('label'));"," this.set('content', this.get('content'));"," this._uiSetSelectedPanel(this.get('selected'));"," },",""," bindUI: function() {"," this.after('selectedChange', this._afterTabSelectedChange);"," this.after('parentChange', this._afterParentChange);"," },",""," renderUI: function() {"," this._renderPanel();"," this._initAria();"," },",""," _renderPanel: function() {"," this.get('parent').get('panelNode')"," .appendChild(this.get('panelNode'));"," },",""," _add: function() {"," var parent = this.get('parent').get('contentBox'),"," list = parent.get('listNode'),"," panel = parent.get('panelNode');",""," if (list) {"," list.appendChild(this.get('boundingBox'));"," }",""," if (panel) {"," panel.appendChild(this.get('panelNode'));"," }"," },"," "," _remove: function() {"," this.get('boundingBox').remove();"," this.get('panelNode').remove();"," },",""," _onActivate: function(e) {"," if (e.target === this) {"," // Prevent the browser from navigating to the URL specified by the "," // anchor's href attribute."," e.domEvent.preventDefault();"," e.target.set('selected', 1);"," }"," },"," "," initializer: function() {"," this.publish(this.get('triggerEvent'), { "," defaultFn: this._onActivate"," });"," },",""," _defLabelSetter: function(label) {"," this.get('contentBox').setContent(label);"," return label;"," },",""," _defContentSetter: function(content) {"," this.get('panelNode').setContent(content);"," return content;"," },",""," _defContentGetter: function(content) {"," return this.get('panelNode').getContent();"," },",""," // find panel by ID mapping from label href"," _defPanelNodeValueFn: function() {"," var href = this.get('contentBox').get('href') || '',"," parent = this.get('parent'),"," hashIndex = href.indexOf('#'),"," panel;",""," href = href.substr(hashIndex);",""," if (href.charAt(0) === '#') { // in-page nav, find by ID"," panel = Y.one(href);"," if (panel) {"," panel.addClass(_classNames.tabPanel);"," }"," }",""," // use the one found by id, or else try matching indices"," if (!panel && parent) {"," panel = parent.get('panelNode')"," .get('children').item(this.get('index'));"," }",""," if (!panel) { // create if none found"," panel = Y.Node.create(this.PANEL_TEMPLATE);"," }"," return panel;"," }","}, {"," ATTRS: {"," /**"," * @attribute triggerEvent"," * @default \"click\" "," * @type String"," */"," triggerEvent: {"," value: 'click'"," },",""," /**"," * @attribute label"," * @type HTML"," */"," label: { "," setter: '_defLabelSetter',"," validator: Lang.isString"," },",""," /**"," * @attribute content"," * @type HTML"," */"," content: {"," setter: '_defContentSetter',"," getter: '_defContentGetter'"," },",""," /**"," * @attribute panelNode"," * @type Y.Node"," */"," panelNode: {"," setter: function(node) {"," node = Y.one(node);"," if (node) {"," node.addClass(_classNames.tabPanel);"," }"," return node;"," },"," valueFn: '_defPanelNodeValueFn'"," },"," "," tabIndex: {"," value: null,"," validator: '_validTabIndex'"," } ",""," },",""," HTML_PARSER: {"," selected: function(contentBox) {"," var ret = (this.get('boundingBox').hasClass(_classNames.selectedTab)) ?"," 1 : 0;"," return ret;"," }"," }","","});","","","}, '3.7.3', {\"requires\": [\"widget\", \"widget-parent\", \"widget-child\", \"tabview-base\", \"node-pluginhost\", \"node-focusmanager\"], \"skinnable\": true});"]; _yuitest_coverage["build/tabview/tabview.js"].lines = {"1":0,"9":0,"25":0,"29":0,"33":0,"37":0,"40":0,"41":0,"42":0,"43":0,"47":0,"51":0,"54":0,"55":0,"67":0,"74":0,"75":0,"76":0,"80":0,"81":0,"82":0,"83":0,"84":0,"89":0,"91":0,"92":0,"93":0,"94":0,"97":0,"99":0,"100":0,"105":0,"106":0,"107":0,"112":0,"113":0,"114":0,"119":0,"124":0,"125":0,"126":0,"127":0,"129":0,"130":0,"131":0,"152":0,"153":0,"154":0,"156":0,"164":0,"165":0,"166":0,"168":0,"186":0,"187":0,"201":0,"207":0,"211":0,"215":0,"216":0,"218":0,"223":0,"227":0,"228":0,"229":0,"232":0,"233":0,"237":0,"244":0,"245":0,"246":0,"250":0,"251":0,"255":0,"256":0,"260":0,"265":0,"269":0,"270":0,"273":0,"274":0,"279":0,"280":0,"284":0,"287":0,"288":0,"293":0,"299":0,"300":0,"304":0,"305":0,"309":0,"314":0,"319":0,"321":0,"322":0,"323":0,"324":0,"329":0,"330":0,"334":0,"335":0,"337":0,"374":0,"375":0,"376":0,"378":0,"392":0,"394":0}; _yuitest_coverage["build/tabview/tabview.js"].functions = {"_afterChildAdded:24":0,"_defListNodeValueFn:28":0,"_defPanelNodeValueFn:32":0,"_afterChildRemoved:36":0,"_initAria:50":0,"bindUI:62":0,"renderUI:79":0,"(anonymous 2):91":0,"_setDefSelection:87":0,"_renderListBox:104":0,"_renderPanelBox:111":0,"(anonymous 3):129":0,"_renderTabs:118":0,"setter:151":0,"setter:163":0,"_uiSetSelectedPanel:206":0,"_afterTabSelectedChange:210":0,"_afterParentChange:214":0,"_initAria:222":0,"syncUI:243":0,"bindUI:249":0,"renderUI:254":0,"_renderPanel:259":0,"_add:264":0,"_remove:278":0,"_onActivate:283":0,"initializer:292":0,"_defLabelSetter:298":0,"_defContentSetter:303":0,"_defContentGetter:308":0,"_defPanelNodeValueFn:313":0,"setter:373":0,"selected:391":0,"(anonymous 1):1":0}; _yuitest_coverage["build/tabview/tabview.js"].coveredLines = 109;@@ -580,4 +580,4 @@ }); -}, '3.7.2', {"requires": ["widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager"], "skinnable": true});
bundle/tabview/tabview-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -404,4 +404,4 @@ }); -}, '3.7.2', {"requires": ["widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager"], "skinnable": true});
bundle/tabview/tabview-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("tabview",function(e,t){var n=e.TabviewBase._queries,r=e.TabviewBase._classNames,i=".",s=e.ClassNameManager.getClassName,o=e.Base.create("tabView",e.Widget,[e.WidgetParent],{_afterChildAdded:function(e){this.get("contentBox").focusManager.refresh()},_defListNodeValueFn:function(){return e.Node.create(o.LIST_TEMPLATE)},_defPanelNodeValueFn:function(){return e.Node.create(o.PANEL_TEMPLATE)},_afterChildRemoved:function(e){var t=e.index,n=this.get("selection");n||(n=this.item(t-1)||this.item(0),n&&n.set("selected",1)),this.get("contentBox").focusManager.refresh()},_initAria:function(){var e=this.get("contentBox"),t=e.one(n.tabviewList);t&&t.setAttrs({role:"tablist"})},bindUI:function(){this.get("contentBox").plug(e.Plugin.NodeFocusManager,{descendants:i+r.tabLabel,keys:{next:"down:39",previous:"down:37"},circular:!0}),this.after("render",this._setDefSelection),this.after("addChild",this._afterChildAdded),this.after("removeChild",this._afterChildRemoved)},renderUI:function(){var e=this.get("contentBox");this._renderListBox(e),this._renderPanelBox(e),this._childrenContainer=this.get("listNode"),this._renderTabs(e)},_setDefSelection:function(e){var t=this.get("selection")||this.item(0);this.some(function(e){if(e.get("selected"))return t=e,!0}),t&&(this.set("selection",t),t.set("selected",1))},_renderListBox:function(e){var t=this.get("listNode");t.inDoc()||e.append(t)},_renderPanelBox:function(e){var t=this.get("panelNode");t.inDoc()||e.append(t)},_renderTabs:function(e){var t=e.all(n.tab),s=this.get("panelNode"),o=s?this.get("panelNode").get("children"):null,u=this;t&&(t.addClass(r.tab),e.all(n.tabLabel).addClass(r.tabLabel),e.all(n.tabPanel).addClass(r.tabPanel),t.each(function(e,t){var n=o?o.item(t):null;u.add({boundingBox:e,contentBox:e.one(i+r.tabLabel),label:e.one(i+r.tabLabel).get("text"),panelNode:n})}))}},{LIST_TEMPLATE:'<ul class="'+r.tabviewList+'"></ul>',PANEL_TEMPLATE:'<div class="'+r.tabviewPanel+'"></div>',ATTRS:{defaultChildType:{value:"Tab"},listNode:{setter:function(t){return t=e.one(t),t&&t.addClass(r.tabviewList),t},valueFn:"_defListNodeValueFn"},panelNode:{setter:function(t){return t=e.one(t),t&&t.addClass(r.tabviewPanel),t},valueFn:"_defPanelNodeValueFn"},tabIndex:{value:null}},HTML_PARSER:{listNode:n.tabviewList,panelNode:n.tabviewPanel}});e.TabView=o;var u=e.Lang,n=e.TabviewBase._queries,r=e.TabviewBase._classNames,s=e.ClassNameManager.getClassName;e.Tab=e.Base.create("tab",e.Widget,[e.WidgetChild],{BOUNDING_TEMPLATE:'<li class="'+r.tab+'"></li>',CONTENT_TEMPLATE:'<a class="'+r.tabLabel+'"></a>',PANEL_TEMPLATE:'<div class="'+r.tabPanel+'"></div>',_uiSetSelectedPanel:function(e){this.get("panelNode").toggleClass(r.selectedPanel,e)},_afterTabSelectedChange:function(e){this._uiSetSelectedPanel(e.newVal)},_afterParentChange:function(e){e.newVal?this._add():this._remove()},_initAria:function(){var t=this.get("contentBox"),n=t.get("id"),r=this.get("panelNode");n||(n=e.guid(),t.set("id",n)),t.set("role","tab"),t.get("parentNode").set("role","presentation"),r.setAttrs({role:"tabpanel","aria-labelledby":n})},syncUI:function(){this.set("label",this.get("label")),this.set("content",this.get("content")),this._uiSetSelectedPanel(this.get("selected"))},bindUI:function(){this.after("selectedChange",this._afterTabSelectedChange),this.after("parentChange",this._afterParentChange)},renderUI:function(){this._renderPanel(),this._initAria()},_renderPanel:function(){this.get("parent").get("panelNode").appendChild(this.get("panelNode"))},_add:function(){var e=this.get("parent").get("contentBox"),t=e.get("listNode"),n=e.get("panelNode");t&&t.appendChild(this.get("boundingBox")),n&&n.appendChild(this.get("panelNode"))},_remove:function(){this.get("boundingBox").remove(),this.get("panelNode").remove()},_onActivate:function(e){e.target===this&&(e.domEvent.preventDefault(),e.target.set("selected",1))},initializer:function(){this.publish(this.get("triggerEvent"),{defaultFn:this._onActivate})},_defLabelSetter:function(e){return this.get("contentBox").setContent(e),e},_defContentSetter:function(e){return this.get("panelNode").setContent(e),e},_defContentGetter:function(e){return this.get("panelNode").getContent()},_defPanelNodeValueFn:function(){var t=this.get("contentBox").get("href")||"",n=this.get("parent"),i=t.indexOf("#"),s;return t=t.substr(i),t.charAt(0)==="#"&&(s=e.one(t),s&&s.addClass(r.tabPanel)),!s&&n&&(s=n.get("panelNode").get("children").item(this.get("index"))),s||(s=e.Node.create(this.PANEL_TEMPLATE)),s}},{ATTRS:{triggerEvent:{value:"click"},label:{setter:"_defLabelSetter",validator:u.isString},content:{setter:"_defContentSetter",getter:"_defContentGetter"},panelNode:{setter:function(t){return t=e.one(t),t&&t.addClass(r.tabPanel),t},valueFn:"_defPanelNodeValueFn"},tabIndex:{value:null,validator:"_validTabIndex"}},HTML_PARSER:{selected:function(e){var t=this.get("boundingBox").hasClass(r.selectedTab)?1:0;return t}}})},"3.7.2",{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0});+YUI.add("tabview",function(e,t){var n=e.TabviewBase._queries,r=e.TabviewBase._classNames,i=".",s=e.ClassNameManager.getClassName,o=e.Base.create("tabView",e.Widget,[e.WidgetParent],{_afterChildAdded:function(e){this.get("contentBox").focusManager.refresh()},_defListNodeValueFn:function(){return e.Node.create(o.LIST_TEMPLATE)},_defPanelNodeValueFn:function(){return e.Node.create(o.PANEL_TEMPLATE)},_afterChildRemoved:function(e){var t=e.index,n=this.get("selection");n||(n=this.item(t-1)||this.item(0),n&&n.set("selected",1)),this.get("contentBox").focusManager.refresh()},_initAria:function(){var e=this.get("contentBox"),t=e.one(n.tabviewList);t&&t.setAttrs({role:"tablist"})},bindUI:function(){this.get("contentBox").plug(e.Plugin.NodeFocusManager,{descendants:i+r.tabLabel,keys:{next:"down:39",previous:"down:37"},circular:!0}),this.after("render",this._setDefSelection),this.after("addChild",this._afterChildAdded),this.after("removeChild",this._afterChildRemoved)},renderUI:function(){var e=this.get("contentBox");this._renderListBox(e),this._renderPanelBox(e),this._childrenContainer=this.get("listNode"),this._renderTabs(e)},_setDefSelection:function(e){var t=this.get("selection")||this.item(0);this.some(function(e){if(e.get("selected"))return t=e,!0}),t&&(this.set("selection",t),t.set("selected",1))},_renderListBox:function(e){var t=this.get("listNode");t.inDoc()||e.append(t)},_renderPanelBox:function(e){var t=this.get("panelNode");t.inDoc()||e.append(t)},_renderTabs:function(e){var t=e.all(n.tab),s=this.get("panelNode"),o=s?this.get("panelNode").get("children"):null,u=this;t&&(t.addClass(r.tab),e.all(n.tabLabel).addClass(r.tabLabel),e.all(n.tabPanel).addClass(r.tabPanel),t.each(function(e,t){var n=o?o.item(t):null;u.add({boundingBox:e,contentBox:e.one(i+r.tabLabel),label:e.one(i+r.tabLabel).get("text"),panelNode:n})}))}},{LIST_TEMPLATE:'<ul class="'+r.tabviewList+'"></ul>',PANEL_TEMPLATE:'<div class="'+r.tabviewPanel+'"></div>',ATTRS:{defaultChildType:{value:"Tab"},listNode:{setter:function(t){return t=e.one(t),t&&t.addClass(r.tabviewList),t},valueFn:"_defListNodeValueFn"},panelNode:{setter:function(t){return t=e.one(t),t&&t.addClass(r.tabviewPanel),t},valueFn:"_defPanelNodeValueFn"},tabIndex:{value:null}},HTML_PARSER:{listNode:n.tabviewList,panelNode:n.tabviewPanel}});e.TabView=o;var u=e.Lang,n=e.TabviewBase._queries,r=e.TabviewBase._classNames,s=e.ClassNameManager.getClassName;e.Tab=e.Base.create("tab",e.Widget,[e.WidgetChild],{BOUNDING_TEMPLATE:'<li class="'+r.tab+'"></li>',CONTENT_TEMPLATE:'<a class="'+r.tabLabel+'"></a>',PANEL_TEMPLATE:'<div class="'+r.tabPanel+'"></div>',_uiSetSelectedPanel:function(e){this.get("panelNode").toggleClass(r.selectedPanel,e)},_afterTabSelectedChange:function(e){this._uiSetSelectedPanel(e.newVal)},_afterParentChange:function(e){e.newVal?this._add():this._remove()},_initAria:function(){var t=this.get("contentBox"),n=t.get("id"),r=this.get("panelNode");n||(n=e.guid(),t.set("id",n)),t.set("role","tab"),t.get("parentNode").set("role","presentation"),r.setAttrs({role:"tabpanel","aria-labelledby":n})},syncUI:function(){this.set("label",this.get("label")),this.set("content",this.get("content")),this._uiSetSelectedPanel(this.get("selected"))},bindUI:function(){this.after("selectedChange",this._afterTabSelectedChange),this.after("parentChange",this._afterParentChange)},renderUI:function(){this._renderPanel(),this._initAria()},_renderPanel:function(){this.get("parent").get("panelNode").appendChild(this.get("panelNode"))},_add:function(){var e=this.get("parent").get("contentBox"),t=e.get("listNode"),n=e.get("panelNode");t&&t.appendChild(this.get("boundingBox")),n&&n.appendChild(this.get("panelNode"))},_remove:function(){this.get("boundingBox").remove(),this.get("panelNode").remove()},_onActivate:function(e){e.target===this&&(e.domEvent.preventDefault(),e.target.set("selected",1))},initializer:function(){this.publish(this.get("triggerEvent"),{defaultFn:this._onActivate})},_defLabelSetter:function(e){return this.get("contentBox").setContent(e),e},_defContentSetter:function(e){return this.get("panelNode").setContent(e),e},_defContentGetter:function(e){return this.get("panelNode").getContent()},_defPanelNodeValueFn:function(){var t=this.get("contentBox").get("href")||"",n=this.get("parent"),i=t.indexOf("#"),s;return t=t.substr(i),t.charAt(0)==="#"&&(s=e.one(t),s&&s.addClass(r.tabPanel)),!s&&n&&(s=n.get("panelNode").get("children").item(this.get("index"))),s||(s=e.Node.create(this.PANEL_TEMPLATE)),s}},{ATTRS:{triggerEvent:{value:"click"},label:{setter:"_defLabelSetter",validator:u.isString},content:{setter:"_defContentSetter",getter:"_defContentGetter"},panelNode:{setter:function(t){return t=e.one(t),t&&t.addClass(r.tabPanel),t},valueFn:"_defPanelNodeValueFn"},tabIndex:{value:null,validator:"_validTabIndex"}},HTML_PARSER:{selected:function(e){var t=this.get("boundingBox").hasClass(r.selectedTab)?1:0;return t}}})},"3.7.3",{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0});
bundle/tabview/tabview.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -404,4 +404,4 @@ }); -}, '3.7.2', {"requires": ["widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager"], "skinnable": true});+}, '3.7.3', {"requires": ["widget", "widget-parent", "widget-child", "tabview-base", "node-pluginhost", "node-focusmanager"], "skinnable": true});
bundle/test-console/assets/skins/sam/test-console-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/test-console/assets/skins/sam/test-console.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/test-console/assets/test-console-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/test-console/test-console-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/test-console/test-console.js", code: [] };-_yuitest_coverage["build/test-console/test-console.js"].code=["YUI.add('test-console', function (Y, NAME) {","","/**","Provides a specialized log console widget that's pre-configured to display YUI","Test output with no extra configuration.","","@example",""," <div id=\"log\" class=\"yui3-skin-sam\"></div>",""," <script>"," YUI().use('test-console', function (Y) {"," // ... set up your test cases here ...",""," // Render the console inside the #log div, then run the tests."," new Y.Test.Console().render('#log');"," Y.Test.Runner.run();"," });"," </script>","","@module test-console","@namespace Test","@class Console","@extends Console","@constructor","","@param {Object} [config] Config attributes."," @param {Object} [config.filters] Category filter configuration.","","@since 3.5.0","**/","","function TestConsole() {"," TestConsole.superclass.constructor.apply(this, arguments);","}","","Y.namespace('Test').Console = Y.extend(TestConsole, Y.Console, {"," initializer: function (config) {"," this.on('entry', this._onEntry);",""," this.plug(Y.Plugin.ConsoleFilters, {"," category: Y.merge({"," info : true,"," pass : false,"," fail : true,"," status: false"," }, (config && config.filters) || {}),",""," defaultVisibility: false,",""," source: {"," TestRunner: true"," }"," });",""," Y.Test.Runner.on('complete', Y.bind(this._parseCoverage, this));"," },",""," // -- Protected Coverage Parser ---------------------------------------------"," /**"," * Parses YUITest coverage results if they are available and logs them."," * @method _parseCoverage"," * @private"," */"," _parseCoverage: function() {"," var coverage = Y.Test.Runner.getCoverage();"," if (!coverage) {"," return;"," }",""," var cov = {"," lines: {"," hit: 0,"," miss: 0,"," total: 0,"," percent: 0"," },"," functions: {"," hit: 0,"," miss: 0,"," total: 0,"," percent: 0"," }"," };",""," Y.Object.each(coverage, function(info) {"," cov.lines.total += info.coveredLines;"," cov.lines.hit += info.calledLines;"," cov.lines.miss += (info.coveredLines - info.calledLines);"," cov.lines.percent = Math.floor((cov.lines.hit / cov.lines.total) * 100);"," "," cov.functions.total += info.coveredFunctions;"," cov.functions.hit += info.calledFunctions;"," cov.functions.miss += (info.coveredFunctions - info.calledFunctions);"," cov.functions.percent = Math.floor((cov.functions.hit / cov.functions.total) * 100);"," });",""," "," var coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\\n';"," coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%';",""," this.log('Coverage: ' + coverageLog, 'info', 'TestRunner');"," },",""," // -- Protected Event Handlers ---------------------------------------------"," _onEntry: function (e) {"," var msg = e.message;",""," if (msg.category === 'info'"," && /\\s(?:case|suite)\\s|yuitests\\d+|began/.test(msg.message)) {"," msg.category = 'status';"," } else if (msg.category === 'fail') {"," this.printBuffer();"," }"," }","}, {"," NAME: 'testConsole',",""," ATTRS: {"," entryTemplate: {"," value:"," '<div class=\"{entry_class} {cat_class} {src_class}\">' +"," '<div class=\"{entry_content_class}\">{message}</div>' +"," '</div>'"," },",""," height: {"," value: '350px'"," },",""," newestOnTop: {"," value: false"," },",""," style: {"," value: 'block'"," },",""," width: {"," value: Y.UA.ie && Y.UA.ie < 9 ? '100%' : 'inherit'"," }"," }","});","","","}, '3.7.2', {\"requires\": [\"console-filters\", \"test\"], \"skinnable\": true});"];-_yuitest_coverage["build/test-console/test-console.js"].lines = {"1":0,"33":0,"34":0,"37":0,"39":0,"41":0,"56":0,"66":0,"67":0,"68":0,"71":0,"86":0,"87":0,"88":0,"89":0,"90":0,"92":0,"93":0,"94":0,"95":0,"99":0,"100":0,"102":0,"107":0,"109":0,"111":0,"112":0,"113":0};-_yuitest_coverage["build/test-console/test-console.js"].functions = {"TestConsole:33":0,"initializer:38":0,"(anonymous 2):86":0,"_parseCoverage:65":0,"_onEntry:106":0,"(anonymous 1):1":0};-_yuitest_coverage["build/test-console/test-console.js"].coveredLines = 28;-_yuitest_coverage["build/test-console/test-console.js"].coveredFunctions = 6;+_yuitest_coverage["build/test-console/test-console.js"].code=["YUI.add('test-console', function (Y, NAME) {","","/**","Provides a specialized log console widget that's pre-configured to display YUI","Test output with no extra configuration.","","@example",""," <div id=\"log\" class=\"yui3-skin-sam\"></div>",""," <script>"," YUI().use('test-console', function (Y) {"," // ... set up your test cases here ...",""," // Render the console inside the #log div, then run the tests."," new Y.Test.Console().render('#log');"," Y.Test.Runner.run();"," });"," </script>","","@module test-console","@namespace Test","@class Console","@extends Console","@constructor","","@param {Object} [config] Config attributes."," @param {Object} [config.filters] Category filter configuration.","","@since 3.5.0","**/","","function TestConsole() {"," TestConsole.superclass.constructor.apply(this, arguments);","}","","Y.namespace('Test').Console = Y.extend(TestConsole, Y.Console, {"," initializer: function (config) {"," this.on('entry', this._onEntry);",""," this.plug(Y.Plugin.ConsoleFilters, {"," category: Y.merge({"," info : true,"," pass : false,"," fail : true,"," status: false"," }, (config && config.filters) || {}),",""," defaultVisibility: false,",""," source: {"," TestRunner: true"," }"," });",""," Y.Test.Runner.on('complete', Y.bind(this._parseCoverage, this));"," },",""," // -- Protected Coverage Parser ---------------------------------------------"," /**"," * Scans the coverage data to determine if it's an Istanbul coverage object."," * @method _isIstanbul"," * @param {Object} json The coverage data to scan"," * @return {Boolean} True if this is Istanbul Coverage"," */"," _isIstanbul: function(json) {"," var first = Object.keys(json)[0],"," ret = false;",""," if (json[first].s !== undefined && json[first].fnMap !== undefined) {"," ret = true;"," } ",""," if (json.s !== undefined && json.fnMap !== undefined) {"," ret = true;"," } "," return ret;"," },"," /**"," * Parses and logs a summary of YUITest coverage data."," * @method parseYUITest"," * @param {Object} coverage The YUITest Coverage JSON data"," */"," parseYUITestCoverage: function (coverage) {"," var cov = {"," lines: {"," hit: 0,"," miss: 0,"," total: 0,"," percent: 0"," },"," functions: {"," hit: 0,"," miss: 0,"," total: 0,"," percent: 0"," }"," }, coverageLog;",""," Y.Object.each(coverage, function(info) {"," cov.lines.total += info.coveredLines;"," cov.lines.hit += info.calledLines;"," cov.lines.miss += (info.coveredLines - info.calledLines);"," cov.lines.percent = Math.floor((cov.lines.hit / cov.lines.total) * 100);"," "," cov.functions.total += info.coveredFunctions;"," cov.functions.hit += info.calledFunctions;"," cov.functions.miss += (info.coveredFunctions - info.calledFunctions);"," cov.functions.percent = Math.floor((cov.functions.hit / cov.functions.total) * 100);"," });",""," "," coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\\n';"," coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%';",""," this.log('Coverage: ' + coverageLog, 'info', 'TestRunner');"," },"," /**"," * Generates a generic summary object used for Istanbul conversions."," * @method _blankSummary"," * @return {Object} Generic summary object"," */"," _blankSummary: function () {"," return {"," lines: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," },"," statements: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," },"," functions: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," },"," branches: {"," total: 0,"," covered: 0,"," pct: 'Unknown'"," }"," };"," },"," /**"," * Calculates line numbers from statement coverage"," * @method _addDerivedInfoForFile"," * @private"," * @param {Object} fileCoverage JSON coverage data"," */"," _addDerivedInfoForFile: function (fileCoverage) {"," var statementMap = fileCoverage.statementMap,"," statements = fileCoverage.s,"," lineMap;",""," if (!fileCoverage.l) {"," fileCoverage.l = lineMap = {};"," Y.Object.each(statements, function (value, st) {"," var line = statementMap[st].start.line,"," count = statements[st],"," prevVal = lineMap[line];"," if (typeof prevVal === 'undefined' || prevVal < count) {"," lineMap[line] = count;"," }"," });"," }"," },"," /**"," * Generic percent calculator"," * @method _percent"," * @param {Number} covered The covered amount"," * @param {Number} total The total"," * @private"," */"," _percent: function (covered, total) {"," var tmp, pct = 100.00;"," if (total > 0) {"," tmp = 1000 * 100 * covered / total + 5;"," pct = Math.floor(tmp / 10) / 100;"," }"," return pct;"," },"," /**"," * Summarize simple properties in the coverage data"," * @method _computSimpleTotals"," * @private"," * @param {Object} fileCoverage JSON coverage data"," * @param {String} property The property to summarize"," */"," _computeSimpleTotals: function (fileCoverage, property) {"," var stats = fileCoverage[property],"," ret = { total: 0, covered: 0 };",""," Y.Object.each(stats, function(val) {"," ret.total += 1;"," if (val) {"," ret.covered += 1;"," } "," }); "," ret.pct = this._percent(ret.covered, ret.total);"," return ret;"," },"," /**"," * Noramlizes branch data from Istanbul"," * @method _computeBranchTotals"," * @private"," * @param {Object} fileCoverage JSON coverage data"," */"," _computeBranchTotals: function (fileCoverage) {"," var stats = fileCoverage.b,"," ret = { total: 0, covered: 0 };",""," Y.Object.each(stats, function (branches) {"," var covered = Y.Array.filter(branches, function (num) { return num > 0; }); "," ret.total += branches.length;"," ret.covered += covered.length;"," }); "," ret.pct = this._percent(ret.covered, ret.total);"," return ret;"," },"," /**"," * Takes an Istanbul coverage object, normalizes it and prints a log with a summary"," * @method parseInstanbul"," * @param {Object} coverage The coverage object to normalize and log"," */"," parseIstanbul: function (coverage) {"," var self = this,"," str = 'Coverage Report:\\n';",""," Y.Object.each(coverage, function(fileCoverage, file) {"," var ret = self._blankSummary();",""," self._addDerivedInfoForFile(fileCoverage);"," ret.lines = self._computeSimpleTotals(fileCoverage, 'l');"," ret.functions = self._computeSimpleTotals(fileCoverage, 'f');"," ret.statements = self._computeSimpleTotals(fileCoverage, 's');"," ret.branches = self._computeBranchTotals(fileCoverage);"," str += file + ':\\n';"," Y.Array.each(['lines','functions','statements','branches'], function(key) {"," str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\\n';"," });",""," });"," this.log(str, 'info', 'TestRunner');",""," },"," /**"," * Parses YUITest or Istanbul coverage results if they are available and logs them."," * @method _parseCoverage"," * @private"," */"," _parseCoverage: function() {"," var coverage = Y.Test.Runner.getCoverage();"," if (!coverage) {"," return;"," }"," if (this._isIstanbul(coverage)) {"," this.parseIstanbul(coverage);"," } else {"," this.parseYUITestCoverage(coverage);"," }"," },",""," // -- Protected Event Handlers ---------------------------------------------"," _onEntry: function (e) {"," var msg = e.message;",""," if (msg.category === 'info'"," && /\\s(?:case|suite)\\s|yuitests\\d+|began/.test(msg.message)) {"," msg.category = 'status';"," } else if (msg.category === 'fail') {"," this.printBuffer();"," }"," }","}, {"," NAME: 'testConsole',",""," ATTRS: {"," entryTemplate: {"," value:"," '<div class=\"{entry_class} {cat_class} {src_class}\">' +"," '<div class=\"{entry_content_class}\">{message}</div>' +"," '</div>'"," },",""," height: {"," value: '350px'"," },",""," newestOnTop: {"," value: false"," },",""," style: {"," value: 'block'"," },",""," width: {"," value: Y.UA.ie && Y.UA.ie < 9 ? '100%' : 'inherit'"," }"," }","});","","","}, '3.7.3', {\"requires\": [\"console-filters\", \"test\", \"array-extras\"], \"skinnable\": true});"];+_yuitest_coverage["build/test-console/test-console.js"].lines = {"1":0,"33":0,"34":0,"37":0,"39":0,"41":0,"56":0,"67":0,"70":0,"71":0,"74":0,"75":0,"77":0,"85":0,"100":0,"101":0,"102":0,"103":0,"104":0,"106":0,"107":0,"108":0,"109":0,"113":0,"114":0,"116":0,"124":0,"154":0,"158":0,"159":0,"160":0,"161":0,"164":0,"165":0,"178":0,"179":0,"180":0,"181":0,"183":0,"193":0,"196":0,"197":0,"198":0,"199":0,"202":0,"203":0,"212":0,"215":0,"216":0,"217":0,"218":0,"220":0,"221":0,"229":0,"232":0,"233":0,"235":0,"236":0,"237":0,"238":0,"239":0,"240":0,"241":0,"242":0,"246":0,"255":0,"256":0,"257":0,"259":0,"260":0,"262":0,"268":0,"270":0,"272":0,"273":0,"274":0};+_yuitest_coverage["build/test-console/test-console.js"].functions = {"TestConsole:33":0,"initializer:38":0,"_isIstanbul:66":0,"(anonymous 2):100":0,"parseYUITestCoverage:84":0,"_blankSummary:123":0,"(anonymous 3):160":0,"_addDerivedInfoForFile:153":0,"_percent:177":0,"(anonymous 4):196":0,"_computeSimpleTotals:192":0,"(anonymous 6):216":0,"(anonymous 5):215":0,"_computeBranchTotals:211":0,"(anonymous 8):241":0,"(anonymous 7):232":0,"parseIstanbul:228":0,"_parseCoverage:254":0,"_onEntry:267":0,"(anonymous 1):1":0};+_yuitest_coverage["build/test-console/test-console.js"].coveredLines = 76;+_yuitest_coverage["build/test-console/test-console.js"].coveredFunctions = 20; _yuitest_coverline("build/test-console/test-console.js", 1); YUI.add('test-console', function (Y, NAME) { @@ -107,21 +107,39 @@ // -- Protected Coverage Parser --------------------------------------------- /**- * Parses YUITest coverage results if they are available and logs them.- * @method _parseCoverage- * @private+ * Scans the coverage data to determine if it's an Istanbul coverage object.+ * @method _isIstanbul+ * @param {Object} json The coverage data to scan+ * @return {Boolean} True if this is Istanbul Coverage */- _parseCoverage: function() {- _yuitest_coverfunc("build/test-console/test-console.js", "_parseCoverage", 65);-_yuitest_coverline("build/test-console/test-console.js", 66);-var coverage = Y.Test.Runner.getCoverage();- _yuitest_coverline("build/test-console/test-console.js", 67);-if (!coverage) {- _yuitest_coverline("build/test-console/test-console.js", 68);-return;- }+ _isIstanbul: function(json) {+ _yuitest_coverfunc("build/test-console/test-console.js", "_isIstanbul", 66);+_yuitest_coverline("build/test-console/test-console.js", 67);+var first = Object.keys(json)[0],+ ret = false; - _yuitest_coverline("build/test-console/test-console.js", 71);+ _yuitest_coverline("build/test-console/test-console.js", 70);+if (json[first].s !== undefined && json[first].fnMap !== undefined) {+ _yuitest_coverline("build/test-console/test-console.js", 71);+ret = true;+ } ++ _yuitest_coverline("build/test-console/test-console.js", 74);+if (json.s !== undefined && json.fnMap !== undefined) {+ _yuitest_coverline("build/test-console/test-console.js", 75);+ret = true;+ } + _yuitest_coverline("build/test-console/test-console.js", 77);+return ret;+ },+ /**+ * Parses and logs a summary of YUITest coverage data.+ * @method parseYUITest+ * @param {Object} coverage The YUITest Coverage JSON data+ */+ parseYUITestCoverage: function (coverage) {+ _yuitest_coverfunc("build/test-console/test-console.js", "parseYUITestCoverage", 84);+_yuitest_coverline("build/test-console/test-console.js", 85); var cov = { lines: { hit: 0,@@ -135,54 +153,259 @@ total: 0, percent: 0 }- };+ }, coverageLog; - _yuitest_coverline("build/test-console/test-console.js", 86);+ _yuitest_coverline("build/test-console/test-console.js", 100); Y.Object.each(coverage, function(info) {- _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 2)", 86);-_yuitest_coverline("build/test-console/test-console.js", 87);+ _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 2)", 100);+_yuitest_coverline("build/test-console/test-console.js", 101); cov.lines.total += info.coveredLines;- _yuitest_coverline("build/test-console/test-console.js", 88);+ _yuitest_coverline("build/test-console/test-console.js", 102); cov.lines.hit += info.calledLines;- _yuitest_coverline("build/test-console/test-console.js", 89);+ _yuitest_coverline("build/test-console/test-console.js", 103); cov.lines.miss += (info.coveredLines - info.calledLines);- _yuitest_coverline("build/test-console/test-console.js", 90);+ _yuitest_coverline("build/test-console/test-console.js", 104); cov.lines.percent = Math.floor((cov.lines.hit / cov.lines.total) * 100); - _yuitest_coverline("build/test-console/test-console.js", 92);+ _yuitest_coverline("build/test-console/test-console.js", 106); cov.functions.total += info.coveredFunctions;- _yuitest_coverline("build/test-console/test-console.js", 93);+ _yuitest_coverline("build/test-console/test-console.js", 107); cov.functions.hit += info.calledFunctions;- _yuitest_coverline("build/test-console/test-console.js", 94);+ _yuitest_coverline("build/test-console/test-console.js", 108); cov.functions.miss += (info.coveredFunctions - info.calledFunctions);- _yuitest_coverline("build/test-console/test-console.js", 95);+ _yuitest_coverline("build/test-console/test-console.js", 109); cov.functions.percent = Math.floor((cov.functions.hit / cov.functions.total) * 100); }); - _yuitest_coverline("build/test-console/test-console.js", 99);-var coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n';- _yuitest_coverline("build/test-console/test-console.js", 100);+ _yuitest_coverline("build/test-console/test-console.js", 113);+coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n';+ _yuitest_coverline("build/test-console/test-console.js", 114); coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%'; - _yuitest_coverline("build/test-console/test-console.js", 102);+ _yuitest_coverline("build/test-console/test-console.js", 116); this.log('Coverage: ' + coverageLog, 'info', 'TestRunner'); },+ /**+ * Generates a generic summary object used for Istanbul conversions.+ * @method _blankSummary+ * @return {Object} Generic summary object+ */+ _blankSummary: function () {+ _yuitest_coverfunc("build/test-console/test-console.js", "_blankSummary", 123);+_yuitest_coverline("build/test-console/test-console.js", 124);+return {+ lines: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ statements: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ functions: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ branches: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ }+ };+ },+ /**+ * Calculates line numbers from statement coverage+ * @method _addDerivedInfoForFile+ * @private+ * @param {Object} fileCoverage JSON coverage data+ */+ _addDerivedInfoForFile: function (fileCoverage) {+ _yuitest_coverfunc("build/test-console/test-console.js", "_addDerivedInfoForFile", 153);+_yuitest_coverline("build/test-console/test-console.js", 154);+var statementMap = fileCoverage.statementMap,+ statements = fileCoverage.s,+ lineMap; + _yuitest_coverline("build/test-console/test-console.js", 158);+if (!fileCoverage.l) {+ _yuitest_coverline("build/test-console/test-console.js", 159);+fileCoverage.l = lineMap = {};+ _yuitest_coverline("build/test-console/test-console.js", 160);+Y.Object.each(statements, function (value, st) {+ _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 3)", 160);+_yuitest_coverline("build/test-console/test-console.js", 161);+var line = statementMap[st].start.line,+ count = statements[st],+ prevVal = lineMap[line];+ _yuitest_coverline("build/test-console/test-console.js", 164);+if (typeof prevVal === 'undefined' || prevVal < count) {+ _yuitest_coverline("build/test-console/test-console.js", 165);+lineMap[line] = count;+ }+ });+ }+ },+ /**+ * Generic percent calculator+ * @method _percent+ * @param {Number} covered The covered amount+ * @param {Number} total The total+ * @private+ */+ _percent: function (covered, total) {+ _yuitest_coverfunc("build/test-console/test-console.js", "_percent", 177);+_yuitest_coverline("build/test-console/test-console.js", 178);+var tmp, pct = 100.00;+ _yuitest_coverline("build/test-console/test-console.js", 179);+if (total > 0) {+ _yuitest_coverline("build/test-console/test-console.js", 180);+tmp = 1000 * 100 * covered / total + 5;+ _yuitest_coverline("build/test-console/test-console.js", 181);+pct = Math.floor(tmp / 10) / 100;+ }+ _yuitest_coverline("build/test-console/test-console.js", 183);+return pct;+ },+ /**+ * Summarize simple properties in the coverage data+ * @method _computSimpleTotals+ * @private+ * @param {Object} fileCoverage JSON coverage data+ * @param {String} property The property to summarize+ */+ _computeSimpleTotals: function (fileCoverage, property) {+ _yuitest_coverfunc("build/test-console/test-console.js", "_computeSimpleTotals", 192);+_yuitest_coverline("build/test-console/test-console.js", 193);+var stats = fileCoverage[property],+ ret = { total: 0, covered: 0 };++ _yuitest_coverline("build/test-console/test-console.js", 196);+Y.Object.each(stats, function(val) {+ _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 4)", 196);+_yuitest_coverline("build/test-console/test-console.js", 197);+ret.total += 1;+ _yuitest_coverline("build/test-console/test-console.js", 198);+if (val) {+ _yuitest_coverline("build/test-console/test-console.js", 199);+ret.covered += 1;+ } + }); + _yuitest_coverline("build/test-console/test-console.js", 202);+ret.pct = this._percent(ret.covered, ret.total);+ _yuitest_coverline("build/test-console/test-console.js", 203);+return ret;+ },+ /**+ * Noramlizes branch data from Istanbul+ * @method _computeBranchTotals+ * @private+ * @param {Object} fileCoverage JSON coverage data+ */+ _computeBranchTotals: function (fileCoverage) {+ _yuitest_coverfunc("build/test-console/test-console.js", "_computeBranchTotals", 211);+_yuitest_coverline("build/test-console/test-console.js", 212);+var stats = fileCoverage.b,+ ret = { total: 0, covered: 0 };++ _yuitest_coverline("build/test-console/test-console.js", 215);+Y.Object.each(stats, function (branches) {+ _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 5)", 215);+_yuitest_coverline("build/test-console/test-console.js", 216);+var covered = Y.Array.filter(branches, function (num) { _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 6)", 216);+return num > 0; }); + _yuitest_coverline("build/test-console/test-console.js", 217);+ret.total += branches.length;+ _yuitest_coverline("build/test-console/test-console.js", 218);+ret.covered += covered.length;+ }); + _yuitest_coverline("build/test-console/test-console.js", 220);+ret.pct = this._percent(ret.covered, ret.total);+ _yuitest_coverline("build/test-console/test-console.js", 221);+return ret;+ },+ /**+ * Takes an Istanbul coverage object, normalizes it and prints a log with a summary+ * @method parseInstanbul+ * @param {Object} coverage The coverage object to normalize and log+ */+ parseIstanbul: function (coverage) {+ _yuitest_coverfunc("build/test-console/test-console.js", "parseIstanbul", 228);+_yuitest_coverline("build/test-console/test-console.js", 229);+var self = this,+ str = 'Coverage Report:\n';++ _yuitest_coverline("build/test-console/test-console.js", 232);+Y.Object.each(coverage, function(fileCoverage, file) {+ _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 7)", 232);+_yuitest_coverline("build/test-console/test-console.js", 233);+var ret = self._blankSummary();++ _yuitest_coverline("build/test-console/test-console.js", 235);+self._addDerivedInfoForFile(fileCoverage);+ _yuitest_coverline("build/test-console/test-console.js", 236);+ret.lines = self._computeSimpleTotals(fileCoverage, 'l');+ _yuitest_coverline("build/test-console/test-console.js", 237);+ret.functions = self._computeSimpleTotals(fileCoverage, 'f');+ _yuitest_coverline("build/test-console/test-console.js", 238);+ret.statements = self._computeSimpleTotals(fileCoverage, 's');+ _yuitest_coverline("build/test-console/test-console.js", 239);+ret.branches = self._computeBranchTotals(fileCoverage);+ _yuitest_coverline("build/test-console/test-console.js", 240);+str += file + ':\n';+ _yuitest_coverline("build/test-console/test-console.js", 241);+Y.Array.each(['lines','functions','statements','branches'], function(key) {+ _yuitest_coverfunc("build/test-console/test-console.js", "(anonymous 8)", 241);+_yuitest_coverline("build/test-console/test-console.js", 242);+str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\n';+ });++ });+ _yuitest_coverline("build/test-console/test-console.js", 246);+this.log(str, 'info', 'TestRunner');++ },+ /**+ * Parses YUITest or Istanbul coverage results if they are available and logs them.+ * @method _parseCoverage+ * @private+ */+ _parseCoverage: function() {+ _yuitest_coverfunc("build/test-console/test-console.js", "_parseCoverage", 254);+_yuitest_coverline("build/test-console/test-console.js", 255);+var coverage = Y.Test.Runner.getCoverage();+ _yuitest_coverline("build/test-console/test-console.js", 256);+if (!coverage) {+ _yuitest_coverline("build/test-console/test-console.js", 257);+return;+ }+ _yuitest_coverline("build/test-console/test-console.js", 259);+if (this._isIstanbul(coverage)) {+ _yuitest_coverline("build/test-console/test-console.js", 260);+this.parseIstanbul(coverage);+ } else {+ _yuitest_coverline("build/test-console/test-console.js", 262);+this.parseYUITestCoverage(coverage);+ }+ },+ // -- Protected Event Handlers --------------------------------------------- _onEntry: function (e) {- _yuitest_coverfunc("build/test-console/test-console.js", "_onEntry", 106);-_yuitest_coverline("build/test-console/test-console.js", 107);+ _yuitest_coverfunc("build/test-console/test-console.js", "_onEntry", 267);+_yuitest_coverline("build/test-console/test-console.js", 268); var msg = e.message; - _yuitest_coverline("build/test-console/test-console.js", 109);+ _yuitest_coverline("build/test-console/test-console.js", 270); if (msg.category === 'info' && /\s(?:case|suite)\s|yuitests\d+|began/.test(msg.message)) {- _yuitest_coverline("build/test-console/test-console.js", 111);+ _yuitest_coverline("build/test-console/test-console.js", 272); msg.category = 'status';- } else {_yuitest_coverline("build/test-console/test-console.js", 112);+ } else {_yuitest_coverline("build/test-console/test-console.js", 273); if (msg.category === 'fail') {- _yuitest_coverline("build/test-console/test-console.js", 113);+ _yuitest_coverline("build/test-console/test-console.js", 274); this.printBuffer(); }} }@@ -216,4 +439,4 @@ }); -}, '3.7.2', {"requires": ["console-filters", "test"], "skinnable": true});+}, '3.7.3', {"requires": ["console-filters", "test", "array-extras"], "skinnable": true});
bundle/test-console/test-console-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -64,16 +64,30 @@ // -- Protected Coverage Parser --------------------------------------------- /**- * Parses YUITest coverage results if they are available and logs them.- * @method _parseCoverage- * @private+ * Scans the coverage data to determine if it's an Istanbul coverage object.+ * @method _isIstanbul+ * @param {Object} json The coverage data to scan+ * @return {Boolean} True if this is Istanbul Coverage */- _parseCoverage: function() {- var coverage = Y.Test.Runner.getCoverage();- if (!coverage) {- return;- }+ _isIstanbul: function(json) {+ var first = Object.keys(json)[0],+ ret = false; + if (json[first].s !== undefined && json[first].fnMap !== undefined) {+ ret = true;+ } ++ if (json.s !== undefined && json.fnMap !== undefined) {+ ret = true;+ } + return ret;+ },+ /**+ * Parses and logs a summary of YUITest coverage data.+ * @method parseYUITest+ * @param {Object} coverage The YUITest Coverage JSON data+ */+ parseYUITestCoverage: function (coverage) { var cov = { lines: { hit: 0,@@ -87,7 +101,7 @@ total: 0, percent: 0 }- };+ }, coverageLog; Y.Object.each(coverage, function(info) { cov.lines.total += info.coveredLines;@@ -102,12 +116,159 @@ }); - var coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n';+ coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n'; coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%'; this.log('Coverage: ' + coverageLog, 'info', 'TestRunner'); },+ /**+ * Generates a generic summary object used for Istanbul conversions.+ * @method _blankSummary+ * @return {Object} Generic summary object+ */+ _blankSummary: function () {+ return {+ lines: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ statements: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ functions: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ branches: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ }+ };+ },+ /**+ * Calculates line numbers from statement coverage+ * @method _addDerivedInfoForFile+ * @private+ * @param {Object} fileCoverage JSON coverage data+ */+ _addDerivedInfoForFile: function (fileCoverage) {+ var statementMap = fileCoverage.statementMap,+ statements = fileCoverage.s,+ lineMap; + if (!fileCoverage.l) {+ fileCoverage.l = lineMap = {};+ Y.Object.each(statements, function (value, st) {+ var line = statementMap[st].start.line,+ count = statements[st],+ prevVal = lineMap[line];+ if (typeof prevVal === 'undefined' || prevVal < count) {+ lineMap[line] = count;+ }+ });+ }+ },+ /**+ * Generic percent calculator+ * @method _percent+ * @param {Number} covered The covered amount+ * @param {Number} total The total+ * @private+ */+ _percent: function (covered, total) {+ var tmp, pct = 100.00;+ if (total > 0) {+ tmp = 1000 * 100 * covered / total + 5;+ pct = Math.floor(tmp / 10) / 100;+ }+ return pct;+ },+ /**+ * Summarize simple properties in the coverage data+ * @method _computSimpleTotals+ * @private+ * @param {Object} fileCoverage JSON coverage data+ * @param {String} property The property to summarize+ */+ _computeSimpleTotals: function (fileCoverage, property) {+ var stats = fileCoverage[property],+ ret = { total: 0, covered: 0 };++ Y.Object.each(stats, function(val) {+ ret.total += 1;+ if (val) {+ ret.covered += 1;+ } + }); + ret.pct = this._percent(ret.covered, ret.total);+ return ret;+ },+ /**+ * Noramlizes branch data from Istanbul+ * @method _computeBranchTotals+ * @private+ * @param {Object} fileCoverage JSON coverage data+ */+ _computeBranchTotals: function (fileCoverage) {+ var stats = fileCoverage.b,+ ret = { total: 0, covered: 0 };++ Y.Object.each(stats, function (branches) {+ var covered = Y.Array.filter(branches, function (num) { return num > 0; }); + ret.total += branches.length;+ ret.covered += covered.length;+ }); + ret.pct = this._percent(ret.covered, ret.total);+ return ret;+ },+ /**+ * Takes an Istanbul coverage object, normalizes it and prints a log with a summary+ * @method parseInstanbul+ * @param {Object} coverage The coverage object to normalize and log+ */+ parseIstanbul: function (coverage) {+ var self = this,+ str = 'Coverage Report:\n';++ Y.Object.each(coverage, function(fileCoverage, file) {+ var ret = self._blankSummary();++ self._addDerivedInfoForFile(fileCoverage);+ ret.lines = self._computeSimpleTotals(fileCoverage, 'l');+ ret.functions = self._computeSimpleTotals(fileCoverage, 'f');+ ret.statements = self._computeSimpleTotals(fileCoverage, 's');+ ret.branches = self._computeBranchTotals(fileCoverage);+ str += file + ':\n';+ Y.Array.each(['lines','functions','statements','branches'], function(key) {+ str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\n';+ });++ });+ this.log(str, 'info', 'TestRunner');++ },+ /**+ * Parses YUITest or Istanbul coverage results if they are available and logs them.+ * @method _parseCoverage+ * @private+ */+ _parseCoverage: function() {+ var coverage = Y.Test.Runner.getCoverage();+ if (!coverage) {+ return;+ }+ if (this._isIstanbul(coverage)) {+ this.parseIstanbul(coverage);+ } else {+ this.parseYUITestCoverage(coverage);+ }+ },+ // -- Protected Event Handlers --------------------------------------------- _onEntry: function (e) { var msg = e.message;@@ -149,4 +310,4 @@ }); -}, '3.7.2', {"requires": ["console-filters", "test"], "skinnable": true});+}, '3.7.3', {"requires": ["console-filters", "test", "array-extras"], "skinnable": true});
bundle/test-console/test-console-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("test-console",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.namespace("Test").Console=e.extend(n,e.Console,{initializer:function(t){this.on("entry",this._onEntry),this.plug(e.Plugin.ConsoleFilters,{category:e.merge({info:!0,pass:!1,fail:!0,status:!1},t&&t.filters||{}),defaultVisibility:!1,source:{TestRunner:!0}}),e.Test.Runner.on("complete",e.bind(this._parseCoverage,this))},_parseCoverage:function(){var t=e.Test.Runner.getCoverage();if(!t)return;var n={lines:{hit:0,miss:0,total:0,percent:0},functions:{hit:0,miss:0,total:0,percent:0}};e.Object.each(t,function(e){n.lines.total+=e.coveredLines,n.lines.hit+=e.calledLines,n.lines.miss+=e.coveredLines-e.calledLines,n.lines.percent=Math.floor(n.lines.hit/n.lines.total*100),n.functions.total+=e.coveredFunctions,n.functions.hit+=e.calledFunctions,n.functions.miss+=e.coveredFunctions-e.calledFunctions,n.functions.percent=Math.floor(n.functions.hit/n.functions.total*100)});var r="Lines: Hit:"+n.lines.hit+" Missed:"+n.lines.miss+" Total:"+n.lines.total+" Percent:"+n.lines.percent+"%\n";r+="Functions: Hit:"+n.functions.hit+" Missed:"+n.functions.miss+" Total:"+n.functions.total+" Percent:"+n.functions.percent+"%",this.log("Coverage: "+r,"info","TestRunner")},_onEntry:function(e){var t=e.message;t.category==="info"&&/\s(?:case|suite)\s|yuitests\d+|began/.test(t.message)?t.category="status":t.category==="fail"&&this.printBuffer()}},{NAME:"testConsole",ATTRS:{entryTemplate:{value:'<div class="{entry_class} {cat_class} {src_class}"><div class="{entry_content_class}">{message}</div></div>'},height:{value:"350px"},newestOnTop:{value:!1},style:{value:"block"},width:{value:e.UA.ie&&e.UA.ie<9?"100%":"inherit"}}})},"3.7.2",{requires:["console-filters","test"],skinnable:!0});+YUI.add("test-console",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.namespace("Test").Console=e.extend(n,e.Console,{initializer:function(t){this.on("entry",this._onEntry),this.plug(e.Plugin.ConsoleFilters,{category:e.merge({info:!0,pass:!1,fail:!0,status:!1},t&&t.filters||{}),defaultVisibility:!1,source:{TestRunner:!0}}),e.Test.Runner.on("complete",e.bind(this._parseCoverage,this))},_isIstanbul:function(e){var t=Object.keys(e)[0],n=!1;return e[t].s!==undefined&&e[t].fnMap!==undefined&&(n=!0),e.s!==undefined&&e.fnMap!==undefined&&(n=!0),n},parseYUITestCoverage:function(t){var n={lines:{hit:0,miss:0,total:0,percent:0},functions:{hit:0,miss:0,total:0,percent:0}},r;e.Object.each(t,function(e){n.lines.total+=e.coveredLines,n.lines.hit+=e.calledLines,n.lines.miss+=e.coveredLines-e.calledLines,n.lines.percent=Math.floor(n.lines.hit/n.lines.total*100),n.functions.total+=e.coveredFunctions,n.functions.hit+=e.calledFunctions,n.functions.miss+=e.coveredFunctions-e.calledFunctions,n.functions.percent=Math.floor(n.functions.hit/n.functions.total*100)}),r="Lines: Hit:"+n.lines.hit+" Missed:"+n.lines.miss+" Total:"+n.lines.total+" Percent:"+n.lines.percent+"%\n",r+="Functions: Hit:"+n.functions.hit+" Missed:"+n.functions.miss+" Total:"+n.functions.total+" Percent:"+n.functions.percent+"%",this.log("Coverage: "+r,"info","TestRunner")},_blankSummary:function(){return{lines:{total:0,covered:0,pct:"Unknown"},statements:{total:0,covered:0,pct:"Unknown"},functions:{total:0,covered:0,pct:"Unknown"},branches:{total:0,covered:0,pct:"Unknown"}}},_addDerivedInfoForFile:function(t){var n=t.statementMap,r=t.s,i;t.l||(t.l=i={},e.Object.each(r,function(e,t){var s=n[t].start.line,o=r[t],u=i[s];if(typeof u=="undefined"||u<o)i[s]=o}))},_percent:function(e,t){var n,r=100;return t>0&&(n=1e5*e/t+5,r=Math.floor(n/10)/100),r},_computeSimpleTotals:function(t,n){var r=t[n],i={total:0,covered:0};return e.Object.each(r,function(e){i.total+=1,e&&(i.covered+=1)}),i.pct=this._percent(i.covered,i.total),i},_computeBranchTotals:function(t){var n=t.b,r={total:0,covered:0};return e.Object.each(n,function(t){var n=e.Array.filter(t,function(e){return e>0});r.total+=t.length,r.covered+=n.length}),r.pct=this._percent(r.covered,r.total),r},parseIstanbul:function(t){var n=this,r="Coverage Report:\n";e.Object.each(t,function(t,i){var s=n._blankSummary();n._addDerivedInfoForFile(t),s.lines=n._computeSimpleTotals(t,"l"),s.functions=n._computeSimpleTotals(t,"f"),s.statements=n._computeSimpleTotals(t,"s"),s.branches=n._computeBranchTotals(t),r+=i+":\n",e.Array.each(["lines","functions","statements","branches"],function(e){r+=" "+e+": "+s[e].covered+"/"+s[e].total+" : "+s[e].pct+"%\n"})}),this.log(r,"info","TestRunner")},_parseCoverage:function(){var t=e.Test.Runner.getCoverage();if(!t)return;this._isIstanbul(t)?this.parseIstanbul(t):this.parseYUITestCoverage(t)},_onEntry:function(e){var t=e.message;t.category==="info"&&/\s(?:case|suite)\s|yuitests\d+|began/.test(t.message)?t.category="status":t.category==="fail"&&this.printBuffer()}},{NAME:"testConsole",ATTRS:{entryTemplate:{value:'<div class="{entry_class} {cat_class} {src_class}"><div class="{entry_content_class}">{message}</div></div>'},height:{value:"350px"},newestOnTop:{value:!1},style:{value:"block"},width:{value:e.UA.ie&&e.UA.ie<9?"100%":"inherit"}}})},"3.7.3",{requires:["console-filters","test","array-extras"],skinnable:!0});
bundle/test-console/test-console.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -64,16 +64,30 @@ // -- Protected Coverage Parser --------------------------------------------- /**- * Parses YUITest coverage results if they are available and logs them.- * @method _parseCoverage- * @private+ * Scans the coverage data to determine if it's an Istanbul coverage object.+ * @method _isIstanbul+ * @param {Object} json The coverage data to scan+ * @return {Boolean} True if this is Istanbul Coverage */- _parseCoverage: function() {- var coverage = Y.Test.Runner.getCoverage();- if (!coverage) {- return;- }+ _isIstanbul: function(json) {+ var first = Object.keys(json)[0],+ ret = false; + if (json[first].s !== undefined && json[first].fnMap !== undefined) {+ ret = true;+ } ++ if (json.s !== undefined && json.fnMap !== undefined) {+ ret = true;+ } + return ret;+ },+ /**+ * Parses and logs a summary of YUITest coverage data.+ * @method parseYUITest+ * @param {Object} coverage The YUITest Coverage JSON data+ */+ parseYUITestCoverage: function (coverage) { var cov = { lines: { hit: 0,@@ -87,7 +101,7 @@ total: 0, percent: 0 }- };+ }, coverageLog; Y.Object.each(coverage, function(info) { cov.lines.total += info.coveredLines;@@ -102,12 +116,159 @@ }); - var coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n';+ coverageLog = 'Lines: Hit:' + cov.lines.hit + ' Missed:' + cov.lines.miss + ' Total:' + cov.lines.total + ' Percent:' + cov.lines.percent + '%\n'; coverageLog += 'Functions: Hit:' + cov.functions.hit + ' Missed:' + cov.functions.miss + ' Total:' + cov.functions.total + ' Percent:' + cov.functions.percent + '%'; this.log('Coverage: ' + coverageLog, 'info', 'TestRunner'); },+ /**+ * Generates a generic summary object used for Istanbul conversions.+ * @method _blankSummary+ * @return {Object} Generic summary object+ */+ _blankSummary: function () {+ return {+ lines: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ statements: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ functions: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ },+ branches: {+ total: 0,+ covered: 0,+ pct: 'Unknown'+ }+ };+ },+ /**+ * Calculates line numbers from statement coverage+ * @method _addDerivedInfoForFile+ * @private+ * @param {Object} fileCoverage JSON coverage data+ */+ _addDerivedInfoForFile: function (fileCoverage) {+ var statementMap = fileCoverage.statementMap,+ statements = fileCoverage.s,+ lineMap; + if (!fileCoverage.l) {+ fileCoverage.l = lineMap = {};+ Y.Object.each(statements, function (value, st) {+ var line = statementMap[st].start.line,+ count = statements[st],+ prevVal = lineMap[line];+ if (typeof prevVal === 'undefined' || prevVal < count) {+ lineMap[line] = count;+ }+ });+ }+ },+ /**+ * Generic percent calculator+ * @method _percent+ * @param {Number} covered The covered amount+ * @param {Number} total The total+ * @private+ */+ _percent: function (covered, total) {+ var tmp, pct = 100.00;+ if (total > 0) {+ tmp = 1000 * 100 * covered / total + 5;+ pct = Math.floor(tmp / 10) / 100;+ }+ return pct;+ },+ /**+ * Summarize simple properties in the coverage data+ * @method _computSimpleTotals+ * @private+ * @param {Object} fileCoverage JSON coverage data+ * @param {String} property The property to summarize+ */+ _computeSimpleTotals: function (fileCoverage, property) {+ var stats = fileCoverage[property],+ ret = { total: 0, covered: 0 };++ Y.Object.each(stats, function(val) {+ ret.total += 1;+ if (val) {+ ret.covered += 1;+ } + }); + ret.pct = this._percent(ret.covered, ret.total);+ return ret;+ },+ /**+ * Noramlizes branch data from Istanbul+ * @method _computeBranchTotals+ * @private+ * @param {Object} fileCoverage JSON coverage data+ */+ _computeBranchTotals: function (fileCoverage) {+ var stats = fileCoverage.b,+ ret = { total: 0, covered: 0 };++ Y.Object.each(stats, function (branches) {+ var covered = Y.Array.filter(branches, function (num) { return num > 0; }); + ret.total += branches.length;+ ret.covered += covered.length;+ }); + ret.pct = this._percent(ret.covered, ret.total);+ return ret;+ },+ /**+ * Takes an Istanbul coverage object, normalizes it and prints a log with a summary+ * @method parseInstanbul+ * @param {Object} coverage The coverage object to normalize and log+ */+ parseIstanbul: function (coverage) {+ var self = this,+ str = 'Coverage Report:\n';++ Y.Object.each(coverage, function(fileCoverage, file) {+ var ret = self._blankSummary();++ self._addDerivedInfoForFile(fileCoverage);+ ret.lines = self._computeSimpleTotals(fileCoverage, 'l');+ ret.functions = self._computeSimpleTotals(fileCoverage, 'f');+ ret.statements = self._computeSimpleTotals(fileCoverage, 's');+ ret.branches = self._computeBranchTotals(fileCoverage);+ str += file + ':\n';+ Y.Array.each(['lines','functions','statements','branches'], function(key) {+ str += ' ' + key +': ' + ret[key].covered + '/' + ret[key].total + ' : ' + ret[key].pct + '%\n';+ });++ });+ this.log(str, 'info', 'TestRunner');++ },+ /**+ * Parses YUITest or Istanbul coverage results if they are available and logs them.+ * @method _parseCoverage+ * @private+ */+ _parseCoverage: function() {+ var coverage = Y.Test.Runner.getCoverage();+ if (!coverage) {+ return;+ }+ if (this._isIstanbul(coverage)) {+ this.parseIstanbul(coverage);+ } else {+ this.parseYUITestCoverage(coverage);+ }+ },+ // -- Protected Event Handlers --------------------------------------------- _onEntry: function (e) { var msg = e.message;@@ -149,4 +310,4 @@ }); -}, '3.7.2', {"requires": ["console-filters", "test"], "skinnable": true});+}, '3.7.3', {"requires": ["console-filters", "test", "array-extras"], "skinnable": true});
bundle/test/test-coverage.js view
@@ -1,4839 +1,4851 @@ /*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-if (typeof _yuitest_coverage == "undefined"){- _yuitest_coverage = {};- _yuitest_coverline = function(src, line){- var coverage = _yuitest_coverage[src];- if (!coverage.lines[line]){- coverage.calledLines++;- }- coverage.lines[line]++;- };- _yuitest_coverfunc = function(src, name, line){- var coverage = _yuitest_coverage[src],- funcId = name + ":" + line;- if (!coverage.functions[funcId]){- coverage.calledFunctions++;- }- coverage.functions[funcId]++;- };-}-_yuitest_coverage["build/test/test.js"] = {- lines: {},- functions: {},- coveredLines: 0,- calledLines: 0,- coveredFunctions: 0,- calledFunctions: 0,- path: "build/test/test.js",- code: []-};-_yuitest_coverage["build/test/test.js"].code=["YUI.add('test', function (Y, NAME) {","","","","/**"," * YUI Test Framework"," * @module test"," * @main test"," */","","/*"," * The root namespace for YUI Test."," */","","//So we only ever have one YUITest object that's shared","if (YUI.YUITest) {"," Y.Test = YUI.YUITest;","} else { //Ends after the YUITest definitions",""," //Make this global for back compat"," YUITest = {"," version: \"3.7.2\","," guid: function(pre) {"," return Y.guid(pre);"," }"," };","","Y.namespace('Test');","","","//Using internal YUI methods here","YUITest.Object = Y.Object;","YUITest.Array = Y.Array;","YUITest.Util = {"," mix: Y.mix,"," JSON: Y.JSON","};","","/**"," * Simple custom event implementation."," * @namespace Test"," * @module test"," * @class EventTarget"," * @constructor"," */","YUITest.EventTarget = function(){",""," /**"," * Event handlers for the various events."," * @type Object"," * @private"," * @property _handlers"," * @static"," */"," this._handlers = {};","","};"," ","YUITest.EventTarget.prototype = {",""," //restore prototype"," constructor: YUITest.EventTarget,"," "," //-------------------------------------------------------------------------"," // Event Handling"," //-------------------------------------------------------------------------"," "," /**"," * Adds a listener for a given event type."," * @param {String} type The type of event to add a listener for."," * @param {Function} listener The function to call when the event occurs."," * @return {void}"," * @method attach"," */"," attach: function(type, listener){"," if (typeof this._handlers[type] == \"undefined\"){"," this._handlers[type] = [];"," }",""," this._handlers[type].push(listener);"," },"," "," /**"," * Adds a listener for a given event type."," * @param {String} type The type of event to add a listener for."," * @param {Function} listener The function to call when the event occurs."," * @return {void}"," * @method subscribe"," * @deprecated"," */"," subscribe: function(type, listener){"," this.attach.apply(this, arguments);"," },"," "," /**"," * Fires an event based on the passed-in object."," * @param {Object|String} event An object with at least a 'type' attribute"," * or a string indicating the event name."," * @return {void}"," * @method fire"," */ "," fire: function(event){"," if (typeof event == \"string\"){"," event = { type: event };"," }"," if (!event.target){"," event.target = this;"," }"," "," if (!event.type){"," throw new Error(\"Event object missing 'type' property.\");"," }"," "," if (this._handlers[event.type] instanceof Array){"," var handlers = this._handlers[event.type];"," for (var i=0, len=handlers.length; i < len; i++){"," handlers[i].call(this, event);"," }"," } "," },",""," /**"," * Removes a listener for a given event type."," * @param {String} type The type of event to remove a listener from."," * @param {Function} listener The function to remove from the event."," * @return {void}"," * @method detach"," */"," detach: function(type, listener){"," if (this._handlers[type] instanceof Array){"," var handlers = this._handlers[type];"," for (var i=0, len=handlers.length; i < len; i++){"," if (handlers[i] === listener){"," handlers.splice(i, 1);"," break;"," }"," }"," } "," },"," "," /**"," * Removes a listener for a given event type."," * @param {String} type The type of event to remove a listener from."," * @param {Function} listener The function to remove from the event."," * @return {void}"," * @method unsubscribe"," * @deprecated"," */"," unsubscribe: function(type, listener){"," this.detach.apply(this, arguments); "," } ","","};",""," ","/**"," * A test suite that can contain a collection of TestCase and TestSuite objects."," * @param {String||Object} data The name of the test suite or an object containing"," * a name property as well as setUp and tearDown methods."," * @namespace Test"," * @module test"," * @class TestSuite"," * @constructor"," */","YUITest.TestSuite = function (data) {",""," /**"," * The name of the test suite."," * @type String"," * @property name"," */"," this.name = \"\";",""," /**"," * Array of test suites and test cases."," * @type Array"," * @property items"," * @private"," */"," this.items = [];",""," //initialize the properties"," if (typeof data == \"string\"){"," this.name = data;"," } else if (data instanceof Object){"," for (var prop in data){"," if (data.hasOwnProperty(prop)){"," this[prop] = data[prop];"," }"," }"," }",""," //double-check name"," if (this.name === \"\" || !this.name) {"," this.name = YUITest.guid(\"testSuite_\");"," }","","};"," ","YUITest.TestSuite.prototype = {"," "," //restore constructor"," constructor: YUITest.TestSuite,"," "," /**"," * Adds a test suite or test case to the test suite."," * @param {Test.TestSuite||YUITest.TestCase} testObject The test suite or test case to add."," * @return {Void}"," * @method add"," */"," add : function (testObject) {"," if (testObject instanceof YUITest.TestSuite || testObject instanceof YUITest.TestCase) {"," this.items.push(testObject);"," }"," return this;"," },"," "," //-------------------------------------------------------------------------"," // Stub Methods"," //-------------------------------------------------------------------------",""," /**"," * Function to run before each test is executed."," * @return {Void}"," * @method setUp"," */"," setUp : function () {"," },"," "," /**"," * Function to run after each test is executed."," * @return {Void}"," * @method tearDown"," */"," tearDown: function () {"," }"," ","};","/**"," * Test case containing various tests to run."," * @param template An object containing any number of test methods, other methods,"," * an optional name, and anything else the test case needs."," * @module test"," * @class TestCase"," * @namespace Test"," * @constructor"," */","","","","YUITest.TestCase = function (template) {"," "," /*"," * Special rules for the test case. Possible subobjects"," * are fail, for tests that should fail, and error, for"," * tests that should throw an error."," */"," this._should = {};"," "," //copy over all properties from the template to this object"," for (var prop in template) {"," this[prop] = template[prop];"," } "," "," //check for a valid name"," if (typeof this.name != \"string\") {"," this.name = YUITest.guid(\"testCase_\");"," }","","};",""," ","YUITest.TestCase.prototype = { ",""," //restore constructor"," constructor: YUITest.TestCase,"," "," /**"," * Method to call from an async init method to"," * restart the test case. When called, returns a function"," * that should be called when tests are ready to continue."," * @method callback"," * @return {Function} The function to call as a callback."," */"," callback: function(){"," return YUITest.TestRunner.callback.apply(YUITest.TestRunner,arguments);"," },",""," /**"," * Resumes a paused test and runs the given function."," * @param {Function} segment (Optional) The function to run."," * If omitted, the test automatically passes."," * @return {Void}"," * @method resume"," */"," resume : function (segment) {"," YUITest.TestRunner.resume(segment);"," },",""," /**"," * Causes the test case to wait a specified amount of time and then"," * continue executing the given code."," * @param {Function} segment (Optional) The function to run after the delay."," * If omitted, the TestRunner will wait until resume() is called."," * @param {int} delay (Optional) The number of milliseconds to wait before running"," * the function. If omitted, defaults to zero."," * @return {Void}"," * @method wait"," */"," wait : function (segment, delay){"," "," var actualDelay = (typeof segment == \"number\" ? segment : delay);"," actualDelay = (typeof actualDelay == \"number\" ? actualDelay : 10000);"," "," if (typeof segment == \"function\"){"," throw new YUITest.Wait(segment, actualDelay);"," } else {"," throw new YUITest.Wait(function(){"," YUITest.Assert.fail(\"Timeout: wait() called but resume() never called.\");"," }, actualDelay);"," }"," },"," "," //-------------------------------------------------------------------------"," // Assertion Methods"," //-------------------------------------------------------------------------",""," /**"," * Asserts that a given condition is true. If not, then a YUITest.AssertionError object is thrown"," * and the test fails."," * @method assert"," * @param {Boolean} condition The condition to test."," * @param {String} message The message to display if the assertion fails."," */"," assert : function (condition, message){"," YUITest.Assert._increment();"," if (!condition){"," throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, \"Assertion failed.\"));"," } "," },"," "," /**"," * Forces an assertion error to occur. Shortcut for YUITest.Assert.fail()."," * @method fail"," * @param {String} message (Optional) The message to display with the failure."," */"," fail: function (message) { "," YUITest.Assert.fail(message);"," },"," "," //-------------------------------------------------------------------------"," // Stub Methods"," //-------------------------------------------------------------------------",""," /**"," * Function to run once before tests start to run."," * This executes before the first call to setUp()."," * @method init"," */"," init: function(){"," //noop"," },"," "," /**"," * Function to run once after tests finish running."," * This executes after the last call to tearDown()."," * @method destroy"," */"," destroy: function(){"," //noop"," },",""," /**"," * Function to run before each test is executed."," * @return {Void}"," * @method setUp"," */"," setUp : function () {"," //noop"," },"," "," /**"," * Function to run after each test is executed."," * @return {Void}"," * @method tearDown"," */"," tearDown: function () { "," //noop"," }","};","/**"," * An object object containing test result formatting methods."," * @namespace Test"," * @module test"," * @class TestFormat"," * @static"," */","YUITest.TestFormat = function(){"," "," /* (intentionally not documented)"," * Basic XML escaping method. Replaces quotes, less-than, greater-than,"," * apostrophe, and ampersand characters with their corresponding entities."," * @param {String} text The text to encode."," * @return {String} The XML-escaped text."," */"," function xmlEscape(text){"," "," return text.replace(/[<>\"'&]/g, function(value){"," switch(value){"," case \"<\": return \"<\";"," case \">\": return \">\";"," case \"\\\"\": return \""\";"," case \"'\": return \"'\";"," case \"&\": return \"&\";"," }"," });"," "," }"," "," "," return {"," "," /**"," * Returns test results formatted as a JSON string. Requires JSON utility."," * @param {Object} result The results object created by TestRunner."," * @return {String} A JSON-formatted string of results."," * @method JSON"," * @static"," */"," JSON: function(results) {"," return YUITest.Util.JSON.stringify(results);"," },"," "," /**"," * Returns test results formatted as an XML string."," * @param {Object} result The results object created by TestRunner."," * @return {String} An XML-formatted string of results."," * @method XML"," * @static"," */"," XML: function(results) {",""," function serializeToXML(results){"," var xml = \"<\" + results.type + \" name=\\\"\" + xmlEscape(results.name) + \"\\\"\";"," "," if (typeof(results.duration)==\"number\"){"," xml += \" duration=\\\"\" + results.duration + \"\\\"\";"," }"," "," if (results.type == \"test\"){"," xml += \" result=\\\"\" + results.result + \"\\\" message=\\\"\" + xmlEscape(results.message) + \"\\\">\";"," } else {"," xml += \" passed=\\\"\" + results.passed + \"\\\" failed=\\\"\" + results.failed + \"\\\" ignored=\\\"\" + results.ignored + \"\\\" total=\\\"\" + results.total + \"\\\">\";"," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToXML(results[prop]);"," }"," }"," } "," }",""," xml += \"</\" + results.type + \">\";"," "," return xml; "," }",""," return \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + serializeToXML(results);",""," },","",""," /**"," * Returns test results formatted in JUnit XML format."," * @param {Object} result The results object created by TestRunner."," * @return {String} An XML-formatted string of results."," * @method JUnitXML"," * @static"," */"," JUnitXML: function(results) {",""," function serializeToJUnitXML(results){"," var xml = \"\";"," "," switch (results.type){"," //equivalent to testcase in JUnit"," case \"test\":"," if (results.result != \"ignore\"){"," xml = \"<testcase name=\\\"\" + xmlEscape(results.name) + \"\\\" time=\\\"\" + (results.duration/1000) + \"\\\">\";"," if (results.result == \"fail\"){"," xml += \"<failure message=\\\"\" + xmlEscape(results.message) + \"\\\"><![CDATA[\" + results.message + \"]]></failure>\";"," }"," xml+= \"</testcase>\";"," }"," break;"," "," //equivalent to testsuite in JUnit"," case \"testcase\":"," "," xml = \"<testsuite name=\\\"\" + xmlEscape(results.name) + \"\\\" tests=\\\"\" + results.total + \"\\\" failures=\\\"\" + results.failed + \"\\\" time=\\\"\" + (results.duration/1000) + \"\\\">\";"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToJUnitXML(results[prop]);"," }"," }"," } "," "," xml += \"</testsuite>\";"," break;"," "," //no JUnit equivalent, don't output anything"," case \"testsuite\":"," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToJUnitXML(results[prop]);"," }"," }"," } "," break;"," "," //top-level, equivalent to testsuites in JUnit"," case \"report\":"," "," xml = \"<testsuites>\";"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToJUnitXML(results[prop]);"," }"," }"," } "," "," xml += \"</testsuites>\"; "," "," //no default"," }"," "," return xml;"," "," }",""," return \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + serializeToJUnitXML(results);"," },"," "," /**"," * Returns test results formatted in TAP format."," * For more information, see <a href=\"http://testanything.org/\">Test Anything Protocol</a>."," * @param {Object} result The results object created by TestRunner."," * @return {String} A TAP-formatted string of results."," * @method TAP"," * @static"," */"," TAP: function(results) {"," "," var currentTestNum = 1;",""," function serializeToTAP(results){"," var text = \"\";"," "," switch (results.type){",""," case \"test\":"," if (results.result != \"ignore\"){",""," text = \"ok \" + (currentTestNum++) + \" - \" + results.name;"," "," if (results.result == \"fail\"){"," text = \"not \" + text + \" - \" + results.message;"," }"," "," text += \"\\n\";"," } else {"," text = \"#Ignored test \" + results.name + \"\\n\";"," }"," break;"," "," case \"testcase\":"," "," text = \"#Begin testcase \" + results.name + \"(\" + results.failed + \" failed of \" + results.total + \")\\n\";"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," text += serializeToTAP(results[prop]);"," }"," }"," } "," "," text += \"#End testcase \" + results.name + \"\\n\";"," "," "," break;"," "," case \"testsuite\":",""," text = \"#Begin testsuite \" + results.name + \"(\" + results.failed + \" failed of \" + results.total + \")\\n\"; "," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," text += serializeToTAP(results[prop]);"," }"," }"," } ",""," text += \"#End testsuite \" + results.name + \"\\n\";"," break;",""," case \"report\":"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," text += serializeToTAP(results[prop]);"," }"," }"," } "," "," //no default"," }"," "," return text;"," "," }",""," return \"1..\" + results.total + \"\\n\" + serializeToTAP(results);"," }"," "," };","}();"," "," /**"," * An object capable of sending test results to a server."," * @param {String} url The URL to submit the results to."," * @param {Function} format (Optiona) A function that outputs the results in a specific format."," * Default is YUITest.TestFormat.XML."," * @constructor"," * @namespace Test"," * @module test"," * @class Reporter"," */"," YUITest.Reporter = function(url, format) {"," "," /**"," * The URL to submit the data to."," * @type String"," * @property url"," */"," this.url = url;"," "," /**"," * The formatting function to call when submitting the data."," * @type Function"," * @property format"," */"," this.format = format || YUITest.TestFormat.XML;"," "," /**"," * Extra fields to submit with the request."," * @type Object"," * @property _fields"," * @private"," */"," this._fields = new Object();"," "," /**"," * The form element used to submit the results."," * @type HTMLFormElement"," * @property _form"," * @private"," */"," this._form = null;"," "," /**"," * Iframe used as a target for form submission."," * @type HTMLIFrameElement"," * @property _iframe"," * @private"," */"," this._iframe = null;"," };"," "," YUITest.Reporter.prototype = {"," "," //restore missing constructor"," constructor: YUITest.Reporter,"," "," /**"," * Adds a field to the form that submits the results."," * @param {String} name The name of the field."," * @param {Variant} value The value of the field."," * @return {Void}"," * @method addField"," */"," addField : function (name, value){"," this._fields[name] = value; "," },"," "," /**"," * Removes all previous defined fields."," * @return {Void}"," * @method clearFields"," */"," clearFields : function(){"," this._fields = new Object();"," },"," "," /**"," * Cleans up the memory associated with the TestReporter, removing DOM elements"," * that were created."," * @return {Void}"," * @method destroy"," */"," destroy : function() {"," if (this._form){"," this._form.parentNode.removeChild(this._form);"," this._form = null;"," } "," if (this._iframe){"," this._iframe.parentNode.removeChild(this._iframe);"," this._iframe = null;"," }"," this._fields = null;"," },"," "," /**"," * Sends the report to the server."," * @param {Object} results The results object created by TestRunner."," * @return {Void}"," * @method report"," */"," report : function(results){"," "," //if the form hasn't been created yet, create it"," if (!this._form){"," this._form = document.createElement(\"form\");"," this._form.method = \"post\";"," this._form.style.visibility = \"hidden\";"," this._form.style.position = \"absolute\";"," this._form.style.top = 0;"," document.body.appendChild(this._form);"," "," //IE won't let you assign a name using the DOM, must do it the hacky way"," try {"," this._iframe = document.createElement(\"<iframe name=\\\"yuiTestTarget\\\" />\");"," } catch (ex){"," this._iframe = document.createElement(\"iframe\");"," this._iframe.name = \"yuiTestTarget\";"," }"," "," this._iframe.src = \"javascript:false\";"," this._iframe.style.visibility = \"hidden\";"," this._iframe.style.position = \"absolute\";"," this._iframe.style.top = 0;"," document.body.appendChild(this._iframe);"," "," this._form.target = \"yuiTestTarget\";"," }"," "," //set the form's action"," this._form.action = this.url;"," "," //remove any existing fields"," while(this._form.hasChildNodes()){"," this._form.removeChild(this._form.lastChild);"," }"," "," //create default fields"," this._fields.results = this.format(results);"," this._fields.useragent = navigator.userAgent;"," this._fields.timestamp = (new Date()).toLocaleString();"," "," //add fields to the form"," for (var prop in this._fields){"," var value = this._fields[prop];"," if (this._fields.hasOwnProperty(prop) && (typeof value != \"function\")){"," var input = document.createElement(\"input\");"," input.type = \"hidden\";"," input.name = prop;"," input.value = value;"," this._form.appendChild(input);"," }"," }"," "," //remove default fields"," delete this._fields.results;"," delete this._fields.useragent;"," delete this._fields.timestamp;"," "," if (arguments[1] !== false){"," this._form.submit();"," }"," "," }"," "," };"," "," /**"," * Runs test suites and test cases, providing events to allowing for the"," * interpretation of test results."," * @namespace Test"," * @module test"," * @class TestRunner"," * @static"," */"," YUITest.TestRunner = function(){",""," /*(intentionally not documented)"," * Determines if any of the array of test groups appears"," * in the given TestRunner filter."," * @param {Array} testGroups The array of test groups to"," * search for."," * @param {String} filter The TestRunner groups filter."," */"," function inGroups(testGroups, filter){"," if (!filter.length){"," return true;"," } else { "," if (testGroups){"," for (var i=0, len=testGroups.length; i < len; i++){"," if (filter.indexOf(\",\" + testGroups[i] + \",\") > -1){"," return true;"," }"," }"," }"," return false;"," }"," }"," "," /**"," * A node in the test tree structure. May represent a TestSuite, TestCase, or"," * test function."," * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function."," * @module test"," * @class TestNode"," * @constructor"," * @private"," */"," function TestNode(testObject){"," "," /**"," * The TestSuite, TestCase, or test function represented by this node."," * @type Variant"," * @property testObject"," */"," this.testObject = testObject;"," "," /**"," * Pointer to this node's first child."," * @type TestNode"," * @property firstChild"," */ "," this.firstChild = null;"," "," /**"," * Pointer to this node's last child."," * @type TestNode"," * @property lastChild"," */ "," this.lastChild = null;"," "," /**"," * Pointer to this node's parent."," * @type TestNode"," * @property parent"," */ "," this.parent = null; "," "," /**"," * Pointer to this node's next sibling."," * @type TestNode"," * @property next"," */ "," this.next = null;"," "," /**"," * Test results for this test object."," * @type object"," * @property results"," */ "," this.results = new YUITest.Results();"," "," //initialize results"," if (testObject instanceof YUITest.TestSuite){"," this.results.type = \"testsuite\";"," this.results.name = testObject.name;"," } else if (testObject instanceof YUITest.TestCase){"," this.results.type = \"testcase\";"," this.results.name = testObject.name;"," }"," "," }"," "," TestNode.prototype = {"," "," /**"," * Appends a new test object (TestSuite, TestCase, or test function name) as a child"," * of this node."," * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function."," * @return {Void}"," * @method appendChild"," */"," appendChild : function (testObject){"," var node = new TestNode(testObject);"," if (this.firstChild === null){"," this.firstChild = this.lastChild = node;"," } else {"," this.lastChild.next = node;"," this.lastChild = node;"," }"," node.parent = this;"," return node;"," } "," };"," "," /**"," * Runs test suites and test cases, providing events to allowing for the"," * interpretation of test results."," * @namespace Test"," * @module test"," * @class Runner"," * @static"," */"," function TestRunner(){"," "," //inherit from EventTarget"," YUITest.EventTarget.call(this);"," "," /**"," * Suite on which to attach all TestSuites and TestCases to be run."," * @type YUITest.TestSuite"," * @property masterSuite"," * @static"," * @private"," */"," this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));"," "," /**"," * Pointer to the current node in the test tree."," * @type TestNode"," * @private"," * @property _cur"," * @static"," */"," this._cur = null;"," "," /**"," * Pointer to the root node in the test tree."," * @type TestNode"," * @private"," * @property _root"," * @static"," */"," this._root = null;"," "," /**"," * Indicates if the TestRunner will log events or not."," * @type Boolean"," * @property _log"," * @private"," * @static"," */"," this._log = true;"," "," /**"," * Indicates if the TestRunner is waiting as a result of"," * wait() being called."," * @type Boolean"," * @property _waiting"," * @private"," * @static"," */"," this._waiting = false;"," "," /**"," * Indicates if the TestRunner is currently running tests."," * @type Boolean"," * @private"," * @property _running"," * @static"," */"," this._running = false;"," "," /**"," * Holds copy of the results object generated when all tests are"," * complete."," * @type Object"," * @private"," * @property _lastResults"," * @static"," */"," this._lastResults = null; "," "," /**"," * Data object that is passed around from method to method."," * @type Object"," * @private"," * @property _data"," * @static"," */"," this._context = null;"," "," /**"," * The list of test groups to run. The list is represented"," * by a comma delimited string with commas at the start and"," * end."," * @type String"," * @private"," * @property _groups"," * @static"," */"," this._groups = \"\";",""," }"," "," TestRunner.prototype = YUITest.Util.mix(new YUITest.EventTarget(), {"," "," /**"," * If true, YUITest will not fire an error for tests with no Asserts."," * @prop _ignoreEmpty"," * @private"," * @type Boolean"," * @static"," */"," _ignoreEmpty: false,",""," //restore prototype"," constructor: YUITest.TestRunner,"," "," //-------------------------------------------------------------------------"," // Constants"," //-------------------------------------------------------------------------"," "," /**"," * Fires when a test case is opened but before the first "," * test is executed."," * @event testcasebegin"," * @static"," */ "," TEST_CASE_BEGIN_EVENT : \"testcasebegin\","," "," /**"," * Fires when all tests in a test case have been executed."," * @event testcasecomplete"," * @static"," */ "," TEST_CASE_COMPLETE_EVENT : \"testcasecomplete\","," "," /**"," * Fires when a test suite is opened but before the first "," * test is executed."," * @event testsuitebegin"," * @static"," */ "," TEST_SUITE_BEGIN_EVENT : \"testsuitebegin\","," "," /**"," * Fires when all test cases in a test suite have been"," * completed."," * @event testsuitecomplete"," * @static"," */ "," TEST_SUITE_COMPLETE_EVENT : \"testsuitecomplete\","," "," /**"," * Fires when a test has passed."," * @event pass"," * @static"," */ "," TEST_PASS_EVENT : \"pass\","," "," /**"," * Fires when a test has failed."," * @event fail"," * @static"," */ "," TEST_FAIL_EVENT : \"fail\","," "," /**"," * Fires when a non-test method has an error."," * @event error"," * @static"," */ "," ERROR_EVENT : \"error\","," "," /**"," * Fires when a test has been ignored."," * @event ignore"," * @static"," */ "," TEST_IGNORE_EVENT : \"ignore\","," "," /**"," * Fires when all test suites and test cases have been completed."," * @event complete"," * @static"," */ "," COMPLETE_EVENT : \"complete\","," "," /**"," * Fires when the run() method is called."," * @event begin"," * @static"," */ "," BEGIN_EVENT : \"begin\", ",""," //-------------------------------------------------------------------------"," // Test Tree-Related Methods"," //-------------------------------------------------------------------------"," "," /**"," * Adds a test case to the test tree as a child of the specified node."," * @param {TestNode} parentNode The node to add the test case to as a child."," * @param {Test.TestCase} testCase The test case to add."," * @return {Void}"," * @static"," * @private"," * @method _addTestCaseToTestTree"," */"," _addTestCaseToTestTree : function (parentNode, testCase){"," "," //add the test suite"," var node = parentNode.appendChild(testCase),"," prop,"," testName;"," "," //iterate over the items in the test case"," for (prop in testCase){"," if ((prop.indexOf(\"test\") === 0 || prop.indexOf(\" \") > -1) && typeof testCase[prop] == \"function\"){"," node.appendChild(prop);"," }"," }"," "," },"," "," /**"," * Adds a test suite to the test tree as a child of the specified node."," * @param {TestNode} parentNode The node to add the test suite to as a child."," * @param {Test.TestSuite} testSuite The test suite to add."," * @return {Void}"," * @static"," * @private"," * @method _addTestSuiteToTestTree"," */"," _addTestSuiteToTestTree : function (parentNode, testSuite) {"," "," //add the test suite"," var node = parentNode.appendChild(testSuite);"," "," //iterate over the items in the master suite"," for (var i=0; i < testSuite.items.length; i++){"," if (testSuite.items[i] instanceof YUITest.TestSuite) {"," this._addTestSuiteToTestTree(node, testSuite.items[i]);"," } else if (testSuite.items[i] instanceof YUITest.TestCase) {"," this._addTestCaseToTestTree(node, testSuite.items[i]);"," } "," } "," },"," "," /**"," * Builds the test tree based on items in the master suite. The tree is a hierarchical"," * representation of the test suites, test cases, and test functions. The resulting tree"," * is stored in _root and the pointer _cur is set to the root initially."," * @return {Void}"," * @static"," * @private"," * @method _buildTestTree"," */"," _buildTestTree : function () {"," "," this._root = new TestNode(this.masterSuite);"," //this._cur = this._root;"," "," //iterate over the items in the master suite"," for (var i=0; i < this.masterSuite.items.length; i++){"," if (this.masterSuite.items[i] instanceof YUITest.TestSuite) {"," this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);"," } else if (this.masterSuite.items[i] instanceof YUITest.TestCase) {"," this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);"," } "," } "," "," }, "," "," //-------------------------------------------------------------------------"," // Private Methods"," //-------------------------------------------------------------------------"," "," /**"," * Handles the completion of a test object's tests. Tallies test results "," * from one level up to the next."," * @param {TestNode} node The TestNode representing the test object."," * @return {Void}"," * @method _handleTestObjectComplete"," * @private"," */"," _handleTestObjectComplete : function (node) {"," var parentNode;"," "," if (node && (typeof node.testObject == \"object\")) {"," parentNode = node.parent;"," "," if (parentNode){"," parentNode.results.include(node.results); "," parentNode.results[node.testObject.name] = node.results;"," }"," "," if (node.testObject instanceof YUITest.TestSuite){"," this._execNonTestMethod(node, \"tearDown\", false);"," node.results.duration = (new Date()) - node._start;"," this.fire({ type: this.TEST_SUITE_COMPLETE_EVENT, testSuite: node.testObject, results: node.results});"," } else if (node.testObject instanceof YUITest.TestCase){"," this._execNonTestMethod(node, \"destroy\", false);"," node.results.duration = (new Date()) - node._start;"," this.fire({ type: this.TEST_CASE_COMPLETE_EVENT, testCase: node.testObject, results: node.results});"," } "," } "," }, "," "," //-------------------------------------------------------------------------"," // Navigation Methods"," //-------------------------------------------------------------------------"," "," /**"," * Retrieves the next node in the test tree."," * @return {TestNode} The next node in the test tree or null if the end is reached."," * @private"," * @static"," * @method _next"," */"," _next : function () {"," "," if (this._cur === null){"," this._cur = this._root;"," } else if (this._cur.firstChild) {"," this._cur = this._cur.firstChild;"," } else if (this._cur.next) {"," this._cur = this._cur.next; "," } else {"," while (this._cur && !this._cur.next && this._cur !== this._root){"," this._handleTestObjectComplete(this._cur);"," this._cur = this._cur.parent;"," }"," "," this._handleTestObjectComplete(this._cur); "," "," if (this._cur == this._root){"," this._cur.results.type = \"report\";"," this._cur.results.timestamp = (new Date()).toLocaleString();"," this._cur.results.duration = (new Date()) - this._cur._start; "," this._lastResults = this._cur.results;"," this._running = false; "," this.fire({ type: this.COMPLETE_EVENT, results: this._lastResults});"," this._cur = null;"," } else if (this._cur) {"," this._cur = this._cur.next; "," }"," }"," "," return this._cur;"," },"," "," /**"," * Executes a non-test method (init, setUp, tearDown, destroy)"," * and traps an errors. If an error occurs, an error event is"," * fired."," * @param {Object} node The test node in the testing tree."," * @param {String} methodName The name of the method to execute."," * @param {Boolean} allowAsync Determines if the method can be called asynchronously."," * @return {Boolean} True if an async method was called, false if not."," * @method _execNonTestMethod"," * @private"," */"," _execNonTestMethod: function(node, methodName, allowAsync){"," var testObject = node.testObject,"," event = { type: this.ERROR_EVENT };"," try {"," if (allowAsync && testObject[\"async:\" + methodName]){"," testObject[\"async:\" + methodName](this._context);"," return true;"," } else {"," testObject[methodName](this._context);"," }"," } catch (ex){"," node.results.errors++;"," event.error = ex;"," event.methodName = methodName;"," if (testObject instanceof YUITest.TestCase){"," event.testCase = testObject;"," } else {"," event.testSuite = testSuite;"," }"," "," this.fire(event);"," } ",""," return false;"," },"," "," /**"," * Runs a test case or test suite, returning the results."," * @param {Test.TestCase|YUITest.TestSuite} testObject The test case or test suite to run."," * @return {Object} Results of the execution with properties passed, failed, and total."," * @private"," * @method _run"," * @static"," */"," _run : function () {"," "," //flag to indicate if the TestRunner should wait before continuing"," var shouldWait = false;"," "," //get the next test node"," var node = this._next();"," "," if (node !== null) {"," "," //set flag to say the testrunner is running"," this._running = true;"," "," //eliminate last results"," this._lastResult = null; "," "," var testObject = node.testObject;"," "," //figure out what to do"," if (typeof testObject == \"object\" && testObject !== null){"," if (testObject instanceof YUITest.TestSuite){"," this.fire({ type: this.TEST_SUITE_BEGIN_EVENT, testSuite: testObject });"," node._start = new Date();"," this._execNonTestMethod(node, \"setUp\" ,false);"," } else if (testObject instanceof YUITest.TestCase){"," this.fire({ type: this.TEST_CASE_BEGIN_EVENT, testCase: testObject });"," node._start = new Date();"," "," //regular or async init"," /*try {"," if (testObject[\"async:init\"]){"," testObject[\"async:init\"](this._context);"," return;"," } else {"," testObject.init(this._context);"," }"," } catch (ex){"," node.results.errors++;"," this.fire({ type: this.ERROR_EVENT, error: ex, testCase: testObject, methodName: \"init\" });"," }*/"," if(this._execNonTestMethod(node, \"init\", true)){"," return;"," }"," }"," "," //some environments don't support setTimeout"," if (typeof setTimeout != \"undefined\"){ "," setTimeout(function(){"," YUITest.TestRunner._run();"," }, 0);"," } else {"," this._run();"," }"," } else {"," this._runTest(node);"," }"," "," }"," },"," "," _resumeTest : function (segment) {"," "," //get relevant information"," var node = this._cur; "," "," //we know there's no more waiting now"," this._waiting = false;"," "," //if there's no node, it probably means a wait() was called after resume()"," if (!node){"," //TODO: Handle in some way?"," //console.log(\"wait() called after resume()\");"," //this.fire(\"error\", { testCase: \"(unknown)\", test: \"(unknown)\", error: new Error(\"wait() called after resume()\")} );"," return;"," }"," "," var testName = node.testObject;"," var testCase = node.parent.testObject;"," "," //cancel other waits if available"," if (testCase.__yui_wait){"," clearTimeout(testCase.__yui_wait);"," delete testCase.__yui_wait;"," }",""," //get the \"should\" test cases"," var shouldFail = testName.indexOf(\"fail:\") === 0 ||"," (testCase._should.fail || {})[testName];"," var shouldError = (testCase._should.error || {})[testName];"," "," //variable to hold whether or not the test failed"," var failed = false;"," var error = null;"," "," //try the test"," try {"," "," //run the test"," segment.call(testCase, this._context); "," "," //if the test hasn't already failed and doesn't have any asserts..."," if(YUITest.Assert._getCount() == 0 && !this._ignoreEmpty){"," throw new YUITest.AssertionError(\"Test has no asserts.\");"," } "," //if it should fail, and it got here, then it's a fail because it didn't"," else if (shouldFail){"," error = new YUITest.ShouldFail();"," failed = true;"," } else if (shouldError){"," error = new YUITest.ShouldError();"," failed = true;"," }"," "," } catch (thrown){",""," //cancel any pending waits, the test already failed"," if (testCase.__yui_wait){"," clearTimeout(testCase.__yui_wait);"," delete testCase.__yui_wait;"," } "," "," //figure out what type of error it was"," if (thrown instanceof YUITest.AssertionError) {"," if (!shouldFail){"," error = thrown;"," failed = true;"," }"," } else if (thrown instanceof YUITest.Wait){"," "," if (typeof thrown.segment == \"function\"){"," if (typeof thrown.delay == \"number\"){"," "," //some environments don't support setTimeout"," if (typeof setTimeout != \"undefined\"){"," testCase.__yui_wait = setTimeout(function(){"," YUITest.TestRunner._resumeTest(thrown.segment);"," }, thrown.delay);"," this._waiting = true;"," } else {"," throw new Error(\"Asynchronous tests not supported in this environment.\");"," }"," }"," }"," "," return;"," "," } else {"," //first check to see if it should error"," if (!shouldError) { "," error = new YUITest.UnexpectedError(thrown);"," failed = true;"," } else {"," //check to see what type of data we have"," if (typeof shouldError == \"string\"){"," "," //if it's a string, check the error message"," if (thrown.message != shouldError){"," error = new YUITest.UnexpectedError(thrown);"," failed = true; "," }"," } else if (typeof shouldError == \"function\"){"," "," //if it's a function, see if the error is an instance of it"," if (!(thrown instanceof shouldError)){"," error = new YUITest.UnexpectedError(thrown);"," failed = true;"," }"," "," } else if (typeof shouldError == \"object\" && shouldError !== null){"," "," //if it's an object, check the instance and message"," if (!(thrown instanceof shouldError.constructor) || "," thrown.message != shouldError.message){"," error = new YUITest.UnexpectedError(thrown);"," failed = true; "," }"," "," }"," "," }"," }"," "," }"," "," //fire appropriate event"," if (failed) {"," this.fire({ type: this.TEST_FAIL_EVENT, testCase: testCase, testName: testName, error: error });"," } else {"," this.fire({ type: this.TEST_PASS_EVENT, testCase: testCase, testName: testName });"," }"," "," //run the tear down"," this._execNonTestMethod(node.parent, \"tearDown\", false);"," "," //reset the assert count"," YUITest.Assert._reset();"," "," //calculate duration"," var duration = (new Date()) - node._start;"," "," //update results"," node.parent.results[testName] = { "," result: failed ? \"fail\" : \"pass\","," message: error ? error.getMessage() : \"Test passed\","," type: \"test\","," name: testName,"," duration: duration"," };"," "," if (failed){"," node.parent.results.failed++;"," } else {"," node.parent.results.passed++;"," }"," node.parent.results.total++;"," "," //set timeout not supported in all environments"," if (typeof setTimeout != \"undefined\"){"," setTimeout(function(){"," YUITest.TestRunner._run();"," }, 0);"," } else {"," this._run();"," }"," "," },"," "," /**"," * Handles an error as if it occurred within the currently executing"," * test. This is for mock methods that may be called asynchronously"," * and therefore out of the scope of the TestRunner. Previously, this"," * error would bubble up to the browser. Now, this method is used"," * to tell TestRunner about the error. This should never be called"," * by anyplace other than the Mock object."," * @param {Error} error The error object."," * @return {Void}"," * @method _handleError"," * @private"," * @static"," */"," _handleError: function(error){"," "," if (this._waiting){"," this._resumeTest(function(){"," throw error;"," });"," } else {"," throw error;"," } "," "," },"," "," /**"," * Runs a single test based on the data provided in the node."," * @method _runTest"," * @param {TestNode} node The TestNode representing the test to run."," * @return {Void}"," * @static"," * @private"," */"," _runTest : function (node) {"," "," //get relevant information"," var testName = node.testObject,"," testCase = node.parent.testObject,"," test = testCase[testName],"," "," //get the \"should\" test cases"," shouldIgnore = testName.indexOf(\"ignore:\") === 0 ||"," !inGroups(testCase.groups, this._groups) ||"," (testCase._should.ignore || {})[testName]; //deprecated"," "," //figure out if the test should be ignored or not"," if (shouldIgnore){"," "," //update results"," node.parent.results[testName] = { "," result: \"ignore\","," message: \"Test ignored\","," type: \"test\","," name: testName.indexOf(\"ignore:\") === 0 ? testName.substring(7) : testName"," };"," "," node.parent.results.ignored++;"," node.parent.results.total++;"," "," this.fire({ type: this.TEST_IGNORE_EVENT, testCase: testCase, testName: testName });"," "," //some environments don't support setTimeout"," if (typeof setTimeout != \"undefined\"){ "," setTimeout(function(){"," YUITest.TestRunner._run();"," }, 0); "," } else {"," this._run();"," }"," "," } else {"," "," //mark the start time"," node._start = new Date();"," "," //run the setup"," this._execNonTestMethod(node.parent, \"setUp\", false);"," "," //now call the body of the test"," this._resumeTest(test); "," }"," "," }, ",""," //-------------------------------------------------------------------------"," // Misc Methods"," //------------------------------------------------------------------------- ",""," /**"," * Retrieves the name of the current result set."," * @return {String} The name of the result set."," * @method getName"," */"," getName: function(){"," return this.masterSuite.name;"," }, ",""," /**"," * The name assigned to the master suite of the TestRunner. This is the name"," * that is output as the root's name when results are retrieved."," * @param {String} name The name of the result set."," * @return {Void}"," * @method setName"," */"," setName: function(name){"," this.masterSuite.name = name;"," }, "," "," //-------------------------------------------------------------------------"," // Public Methods"," //------------------------------------------------------------------------- "," "," /**"," * Adds a test suite or test case to the list of test objects to run."," * @param testObject Either a TestCase or a TestSuite that should be run."," * @return {Void}"," * @method add"," * @static"," */"," add : function (testObject) {"," this.masterSuite.add(testObject);"," return this;"," },"," "," /**"," * Removes all test objects from the runner."," * @return {Void}"," * @method clear"," * @static"," */"," clear : function () {"," this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));"," },"," "," /**"," * Indicates if the TestRunner is waiting for a test to resume"," * @return {Boolean} True if the TestRunner is waiting, false if not."," * @method isWaiting"," * @static"," */"," isWaiting: function() {"," return this._waiting;"," },"," "," /**"," * Indicates that the TestRunner is busy running tests and therefore can't"," * be stopped and results cannot be gathered."," * @return {Boolean} True if the TestRunner is running, false if not."," * @method isRunning"," */"," isRunning: function(){"," return this._running;"," },"," "," /**"," * Returns the last complete results set from the TestRunner. Null is returned"," * if the TestRunner is running or no tests have been run."," * @param {Function} format (Optional) A test format to return the results in."," * @return {Object|String} Either the results object or, if a test format is "," * passed as the argument, a string representing the results in a specific"," * format."," * @method getResults"," */"," getResults: function(format){"," if (!this._running && this._lastResults){"," if (typeof format == \"function\"){"," return format(this._lastResults); "," } else {"," return this._lastResults;"," }"," } else {"," return null;"," }"," }, "," "," /**"," * Returns the coverage report for the files that have been executed."," * This returns only coverage information for files that have been"," * instrumented using YUI Test Coverage and only those that were run"," * in the same pass."," * @param {Function} format (Optional) A coverage format to return results in."," * @return {Object|String} Either the coverage object or, if a coverage"," * format is specified, a string representing the results in that format."," * @method getCoverage"," */"," getCoverage: function(format){"," if (!this._running && typeof _yuitest_coverage == \"object\"){"," if (typeof format == \"function\"){"," return format(_yuitest_coverage); "," } else {"," return _yuitest_coverage;"," }"," } else {"," return null;"," } "," },"," "," /**"," * Used to continue processing when a method marked with"," * \"async:\" is executed. This should not be used in test"," * methods, only in init(). Each argument is a string, and"," * when the returned function is executed, the arguments"," * are assigned to the context data object using the string"," * as the key name (value is the argument itself)."," * @private"," * @return {Function} A callback function."," * @method callback"," */"," callback: function(){"," var names = arguments,"," data = this._context,"," that = this;"," "," return function(){"," for (var i=0; i < arguments.length; i++){"," data[names[i]] = arguments[i];"," }"," that._run();"," };"," },"," "," /**"," * Resumes the TestRunner after wait() was called."," * @param {Function} segment The function to run as the rest"," * of the haulted test."," * @return {Void}"," * @method resume"," * @static"," */"," resume : function (segment) {"," if (this._waiting){"," this._resumeTest(segment || function(){});"," } else {"," throw new Error(\"resume() called without wait().\");"," }"," },"," "," /**"," * Runs the test suite."," * @param {Object|Boolean} options (Optional) Options for the runner:"," * <code>oldMode</code> indicates the TestRunner should work in the YUI <= 2.8 way"," * of internally managing test suites. <code>groups</code> is an array"," * of test groups indicating which tests to run."," * @return {Void}"," * @method run"," * @static"," */"," run : function (options) {",""," options = options || {};"," "," //pointer to runner to avoid scope issues "," var runner = YUITest.TestRunner,"," oldMode = options.oldMode;"," "," "," //if there's only one suite on the masterSuite, move it up"," if (!oldMode && this.masterSuite.items.length == 1 && this.masterSuite.items[0] instanceof YUITest.TestSuite){"," this.masterSuite = this.masterSuite.items[0];"," } "," "," //determine if there are any groups to filter on"," runner._groups = (options.groups instanceof Array) ? \",\" + options.groups.join(\",\") + \",\" : \"\";"," "," //initialize the runner"," runner._buildTestTree();"," runner._context = {};"," runner._root._start = new Date();"," "," //fire the begin event"," runner.fire(runner.BEGIN_EVENT);"," "," //begin the testing"," runner._run();"," } "," });"," "," return new TestRunner();"," "," }();","","/**"," * The ArrayAssert object provides functions to test JavaScript array objects"," * for a variety of cases."," * @namespace Test"," * @module test"," * @class ArrayAssert"," * @static"," */"," ","YUITest.ArrayAssert = {",""," //========================================================================="," // Private methods"," //========================================================================="," "," /**"," * Simple indexOf() implementation for an array. Defers to native"," * if available."," * @param {Array} haystack The array to search."," * @param {Variant} needle The value to locate."," * @return {int} The index of the needle if found or -1 if not."," * @method _indexOf"," * @private"," */"," _indexOf: function(haystack, needle){"," if (haystack.indexOf){"," return haystack.indexOf(needle);"," } else {"," for (var i=0; i < haystack.length; i++){"," if (haystack[i] === needle){"," return i;"," }"," }"," return -1;"," }"," },"," "," /**"," * Simple some() implementation for an array. Defers to native"," * if available."," * @param {Array} haystack The array to search."," * @param {Function} matcher The function to run on each value."," * @return {Boolean} True if any value, when run through the matcher,"," * returns true."," * @method _some"," * @private"," */"," _some: function(haystack, matcher){"," if (haystack.some){"," return haystack.some(matcher);"," } else {"," for (var i=0; i < haystack.length; i++){"," if (matcher(haystack[i])){"," return true;"," }"," }"," return false;"," }"," }, ",""," /**"," * Asserts that a value is present in an array. This uses the triple equals "," * sign so no type coercion may occur."," * @param {Object} needle The value that is expected in the array."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method contains"," * @static"," */"," contains : function (needle, haystack, "," message) {"," "," YUITest.Assert._increment(); ",""," if (this._indexOf(haystack, needle) == -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value \" + needle + \" (\" + (typeof needle) + \") not found in array [\" + haystack + \"].\"));"," }"," },",""," /**"," * Asserts that a set of values are present in an array. This uses the triple equals "," * sign so no type coercion may occur. For this assertion to pass, all values must"," * be found."," * @param {Object[]} needles An array of values that are expected in the array."," * @param {Array} haystack An array of values to check."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method containsItems"," * @static"," */"," containsItems : function (needles, haystack, "," message) {"," YUITest.Assert._increment(); ",""," //begin checking values"," for (var i=0; i < needles.length; i++){"," if (this._indexOf(haystack, needles[i]) == -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value \" + needles[i] + \" (\" + (typeof needles[i]) + \") not found in array [\" + haystack + \"].\"));"," }"," }"," },",""," /**"," * Asserts that a value matching some condition is present in an array. This uses"," * a function to determine a match."," * @param {Function} matcher A function that returns true if the items matches or false if not."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method containsMatch"," * @static"," */"," containsMatch : function (matcher, haystack, "," message) {"," "," YUITest.Assert._increment(); "," //check for valid matcher"," if (typeof matcher != \"function\"){"," throw new TypeError(\"ArrayAssert.containsMatch(): First argument must be a function.\");"," }"," "," if (!this._some(haystack, matcher)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"No match found in array [\" + haystack + \"].\"));"," }"," },",""," /**"," * Asserts that a value is not present in an array. This uses the triple equals "," * Asserts that a value is not present in an array. This uses the triple equals "," * sign so no type coercion may occur."," * @param {Object} needle The value that is expected in the array."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method doesNotContain"," * @static"," */"," doesNotContain : function (needle, haystack, "," message) {"," "," YUITest.Assert._increment(); ",""," if (this._indexOf(haystack, needle) > -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value found in array [\" + haystack + \"].\"));"," }"," },",""," /**"," * Asserts that a set of values are not present in an array. This uses the triple equals "," * sign so no type coercion may occur. For this assertion to pass, all values must"," * not be found."," * @param {Object[]} needles An array of values that are not expected in the array."," * @param {Array} haystack An array of values to check."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method doesNotContainItems"," * @static"," */"," doesNotContainItems : function (needles, haystack, "," message) {",""," YUITest.Assert._increment(); ",""," for (var i=0; i < needles.length; i++){"," if (this._indexOf(haystack, needles[i]) > -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value found in array [\" + haystack + \"].\"));"," }"," }",""," },"," "," /**"," * Asserts that no values matching a condition are present in an array. This uses"," * a function to determine a match."," * @param {Function} matcher A function that returns true if the item matches or false if not."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method doesNotContainMatch"," * @static"," */"," doesNotContainMatch : function (matcher, haystack, "," message) {"," "," YUITest.Assert._increment(); "," "," //check for valid matcher"," if (typeof matcher != \"function\"){"," throw new TypeError(\"ArrayAssert.doesNotContainMatch(): First argument must be a function.\");"," }"," "," if (this._some(haystack, matcher)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value found in array [\" + haystack + \"].\"));"," }"," },"," "," /**"," * Asserts that the given value is contained in an array at the specified index."," * This uses the triple equals sign so no type coercion will occur."," * @param {Object} needle The value to look for."," * @param {Array} haystack The array to search in."," * @param {int} index The index at which the value should exist."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method indexOf"," * @static"," */"," indexOf : function (needle, haystack, index, message) {"," "," YUITest.Assert._increment(); ",""," //try to find the value in the array"," for (var i=0; i < haystack.length; i++){"," if (haystack[i] === needle){"," if (index != i){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value exists at index \" + i + \" but should be at index \" + index + \".\")); "," }"," return;"," }"," }"," "," //if it makes it here, it wasn't found at all"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value doesn't exist in array [\" + haystack + \"].\"));"," },"," "," /**"," * Asserts that the values in an array are equal, and in the same position,"," * as values in another array. This uses the double equals sign"," * so type coercion may occur. Note that the array objects themselves"," * need not be the same for this test to pass."," * @param {Array} expected An array of the expected values."," * @param {Array} actual Any array of the actual values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method itemsAreEqual"," * @static"," */"," itemsAreEqual : function (expected, actual, "," message) {"," "," YUITest.Assert._increment(); "," "," //first make sure they're array-like (this can probably be improved)"," if (typeof expected != \"object\" || typeof actual != \"object\"){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value should be an array.\"));"," }"," "," //next check array length"," if (expected.length != actual.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should have a length of \" + expected.length + \" but has a length of \" + actual.length + \".\"));"," }"," "," //begin checking values"," for (var i=0; i < expected.length; i++){"," if (expected[i] != actual[i]){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values in position \" + i + \" are not equal.\"), expected[i], actual[i]);"," }"," }"," },"," "," /**"," * Asserts that the values in an array are equivalent, and in the same position,"," * as values in another array. This uses a function to determine if the values"," * are equivalent. Note that the array objects themselves"," * need not be the same for this test to pass."," * @param {Array} expected An array of the expected values."," * @param {Array} actual Any array of the actual values."," * @param {Function} comparator A function that returns true if the values are equivalent"," * or false if not."," * @param {String} message (Optional) The message to display if the assertion fails."," * @return {Void}"," * @method itemsAreEquivalent"," * @static"," */"," itemsAreEquivalent : function (expected, actual, "," comparator, message) {"," "," YUITest.Assert._increment(); ",""," //make sure the comparator is valid"," if (typeof comparator != \"function\"){"," throw new TypeError(\"ArrayAssert.itemsAreEquivalent(): Third argument must be a function.\");"," }"," "," //first check array length"," if (expected.length != actual.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should have a length of \" + expected.length + \" but has a length of \" + actual.length));"," }"," "," //begin checking values"," for (var i=0; i < expected.length; i++){"," if (!comparator(expected[i], actual[i])){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values in position \" + i + \" are not equivalent.\"), expected[i], actual[i]);"," }"," }"," },"," "," /**"," * Asserts that an array is empty."," * @param {Array} actual The array to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isEmpty"," * @static"," */"," isEmpty : function (actual, message) { "," YUITest.Assert._increment(); "," if (actual.length > 0){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should be empty.\"));"," }"," }, "," "," /**"," * Asserts that an array is not empty."," * @param {Array} actual The array to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotEmpty"," * @static"," */"," isNotEmpty : function (actual, message) { "," YUITest.Assert._increment(); "," if (actual.length === 0){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should not be empty.\"));"," }"," }, "," "," /**"," * Asserts that the values in an array are the same, and in the same position,"," * as values in another array. This uses the triple equals sign"," * so no type coercion will occur. Note that the array objects themselves"," * need not be the same for this test to pass."," * @param {Array} expected An array of the expected values."," * @param {Array} actual Any array of the actual values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method itemsAreSame"," * @static"," */"," itemsAreSame : function (expected, actual, "," message) {"," "," YUITest.Assert._increment(); ",""," //first check array length"," if (expected.length != actual.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should have a length of \" + expected.length + \" but has a length of \" + actual.length));"," }"," "," //begin checking values"," for (var i=0; i < expected.length; i++){"," if (expected[i] !== actual[i]){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values in position \" + i + \" are not the same.\"), expected[i], actual[i]);"," }"," }"," },"," "," /**"," * Asserts that the given value is contained in an array at the specified index,"," * starting from the back of the array."," * This uses the triple equals sign so no type coercion will occur."," * @param {Object} needle The value to look for."," * @param {Array} haystack The array to search in."," * @param {int} index The index at which the value should exist."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method lastIndexOf"," * @static"," */"," lastIndexOf : function (needle, haystack, index, message) {"," "," //try to find the value in the array"," for (var i=haystack.length; i >= 0; i--){"," if (haystack[i] === needle){"," if (index != i){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value exists at index \" + i + \" but should be at index \" + index + \".\")); "," }"," return;"," }"," }"," "," //if it makes it here, it wasn't found at all"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value doesn't exist in array.\")); "," }"," ","};"," ","/**"," * The Assert object provides functions to test JavaScript values against"," * known and expected results. Whenever a comparison (assertion) fails,"," * an error is thrown."," * @namespace Test"," * @module test"," * @class Assert"," * @static"," */","YUITest.Assert = {",""," /**"," * The number of assertions performed."," * @property _asserts"," * @type int"," * @private"," */"," _asserts: 0,",""," //-------------------------------------------------------------------------"," // Helper Methods"," //-------------------------------------------------------------------------"," "," /**"," * Formats a message so that it can contain the original assertion message"," * in addition to the custom message."," * @param {String} customMessage The message passed in by the developer."," * @param {String} defaultMessage The message created by the error by default."," * @return {String} The final error message, containing either or both."," * @protected"," * @static"," * @method _formatMessage"," */"," _formatMessage : function (customMessage, defaultMessage) {"," if (typeof customMessage == \"string\" && customMessage.length > 0){"," return customMessage.replace(\"{message}\", defaultMessage);"," } else {"," return defaultMessage;"," } "," },"," "," /**"," * Returns the number of assertions that have been performed."," * @method _getCount"," * @protected"," * @static"," */"," _getCount: function(){"," return this._asserts;"," },"," "," /**"," * Increments the number of assertions that have been performed."," * @method _increment"," * @protected"," * @static"," */"," _increment: function(){"," this._asserts++;"," },"," "," /**"," * Resets the number of assertions that have been performed to 0."," * @method _reset"," * @protected"," * @static"," */"," _reset: function(){"," this._asserts = 0;"," },"," "," //-------------------------------------------------------------------------"," // Generic Assertion Methods"," //-------------------------------------------------------------------------"," "," /** "," * Forces an assertion error to occur."," * @param {String} message (Optional) The message to display with the failure."," * @method fail"," * @static"," */"," fail : function (message) {"," throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, \"Test force-failed.\"));"," }, "," "," /** "," * A marker that the test should pass."," * @method pass"," * @static"," */"," pass : function (message) {"," YUITest.Assert._increment();"," }, "," "," //-------------------------------------------------------------------------"," // Equality Assertion Methods"," //------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is equal to another. This uses the double equals sign"," * so type coercion may occur."," * @param {Object} expected The expected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areEqual"," * @static"," */"," areEqual : function (expected, actual, message) {"," YUITest.Assert._increment();"," if (expected != actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values should be equal.\"), expected, actual);"," }"," },"," "," /**"," * Asserts that a value is not equal to another. This uses the double equals sign"," * so type coercion may occur."," * @param {Object} unexpected The unexpected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areNotEqual"," * @static"," */"," areNotEqual : function (unexpected, actual, "," message) {"," YUITest.Assert._increment();"," if (unexpected == actual) {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be equal.\"), unexpected);"," }"," },"," "," /**"," * Asserts that a value is not the same as another. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} unexpected The unexpected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areNotSame"," * @static"," */"," areNotSame : function (unexpected, actual, message) {"," YUITest.Assert._increment();"," if (unexpected === actual) {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be the same.\"), unexpected);"," }"," },",""," /**"," * Asserts that a value is the same as another. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} expected The expected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areSame"," * @static"," */"," areSame : function (expected, actual, message) {"," YUITest.Assert._increment();"," if (expected !== actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values should be the same.\"), expected, actual);"," }"," }, "," "," //-------------------------------------------------------------------------"," // Boolean Assertion Methods"," //------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is false. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isFalse"," * @static"," */"," isFalse : function (actual, message) {"," YUITest.Assert._increment();"," if (false !== actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be false.\"), false, actual);"," }"," },"," "," /**"," * Asserts that a value is true. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isTrue"," * @static"," */"," isTrue : function (actual, message) {"," YUITest.Assert._increment();"," if (true !== actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be true.\"), true, actual);"," }",""," },"," "," //-------------------------------------------------------------------------"," // Special Value Assertion Methods"," //------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is not a number."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNaN"," * @static"," */"," isNaN : function (actual, message){"," YUITest.Assert._increment();"," if (!isNaN(actual)){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be NaN.\"), NaN, actual);"," } "," },"," "," /**"," * Asserts that a value is not the special NaN value."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotNaN"," * @static"," */"," isNotNaN : function (actual, message){"," YUITest.Assert._increment();"," if (isNaN(actual)){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be NaN.\"), NaN);"," } "," },"," "," /**"," * Asserts that a value is not null. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotNull"," * @static"," */"," isNotNull : function (actual, message) {"," YUITest.Assert._increment();"," if (actual === null) {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be null.\"), null);"," }"," },",""," /**"," * Asserts that a value is not undefined. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotUndefined"," * @static"," */"," isNotUndefined : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual == \"undefined\") {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should not be undefined.\"), undefined);"," }"," },",""," /**"," * Asserts that a value is null. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNull"," * @static"," */"," isNull : function (actual, message) {"," YUITest.Assert._increment();"," if (actual !== null) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be null.\"), null, actual);"," }"," },"," "," /**"," * Asserts that a value is undefined. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isUndefined"," * @static"," */"," isUndefined : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"undefined\") {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be undefined.\"), undefined, actual);"," }"," }, "," "," //--------------------------------------------------------------------------"," // Instance Assertion Methods"," //-------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is an array."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isArray"," * @static"," */"," isArray : function (actual, message) {"," YUITest.Assert._increment();"," var shouldFail = false;"," if (Array.isArray){"," shouldFail = !Array.isArray(actual);"," } else {"," shouldFail = Object.prototype.toString.call(actual) != \"[object Array]\";"," }"," if (shouldFail){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be an array.\"), actual);"," } "," },"," "," /**"," * Asserts that a value is a Boolean."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isBoolean"," * @static"," */"," isBoolean : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"boolean\"){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a Boolean.\"), actual);"," } "," },"," "," /**"," * Asserts that a value is a function."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isFunction"," * @static"," */"," isFunction : function (actual, message) {"," YUITest.Assert._increment();"," if (!(actual instanceof Function)){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a function.\"), actual);"," } "," },"," "," /**"," * Asserts that a value is an instance of a particular object. This may return"," * incorrect results when comparing objects from one frame to constructors in"," * another frame. For best results, don't use in a cross-frame manner."," * @param {Function} expected The function that the object should be an instance of."," * @param {Object} actual The object to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isInstanceOf"," * @static"," */"," isInstanceOf : function (expected, actual, message) {"," YUITest.Assert._increment();"," if (!(actual instanceof expected)){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value isn't an instance of expected type.\"), expected, actual);"," }"," },"," "," /**"," * Asserts that a value is a number."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNumber"," * @static"," */"," isNumber : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"number\"){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a number.\"), actual);"," } "," }, "," "," /**"," * Asserts that a value is an object."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isObject"," * @static"," */"," isObject : function (actual, message) {"," YUITest.Assert._increment();"," if (!actual || (typeof actual != \"object\" && typeof actual != \"function\")){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be an object.\"), actual);"," }"," },"," "," /**"," * Asserts that a value is a string."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isString"," * @static"," */"," isString : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"string\"){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a string.\"), actual);"," }"," },"," "," /**"," * Asserts that a value is of a particular type. "," * @param {String} expectedType The expected type of the variable."," * @param {Object} actualValue The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isTypeOf"," * @static"," */"," isTypeOf : function (expectedType, actualValue, message){"," YUITest.Assert._increment();"," if (typeof actualValue != expectedType){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be of type \" + expectedType + \".\"), expectedType, typeof actualValue);"," }"," },"," "," //--------------------------------------------------------------------------"," // Error Detection Methods"," //-------------------------------------------------------------------------- "," "," /**"," * Asserts that executing a particular method should throw an error of"," * a specific type. This is a replacement for _should.error."," * @param {String|Function|Object} expectedError If a string, this"," * is the error message that the error must have; if a function, this"," * is the constructor that should have been used to create the thrown"," * error; if an object, this is an instance of a particular error type"," * with a specific error message (both must match)."," * @param {Function} method The method to execute that should throw the error."," * @param {String} message (Optional) The message to display if the assertion"," * fails."," * @method throwsError"," * @return {void}"," * @static"," */"," throwsError: function(expectedError, method, message){"," YUITest.Assert._increment();"," var error = false;"," "," try {"," method(); "," } catch (thrown) {"," "," //check to see what type of data we have"," if (typeof expectedError == \"string\"){"," "," //if it's a string, check the error message"," if (thrown.message != expectedError){"," error = true;"," }"," } else if (typeof expectedError == \"function\"){"," "," //if it's a function, see if the error is an instance of it"," if (!(thrown instanceof expectedError)){"," error = true;"," }"," "," } else if (typeof expectedError == \"object\" && expectedError !== null){"," "," //if it's an object, check the instance and message"," if (!(thrown instanceof expectedError.constructor) || "," thrown.message != expectedError.message){"," error = true;"," }"," "," } else { //if it gets here, the argument could be wrong"," error = true;"," }"," "," if (error){"," throw new YUITest.UnexpectedError(thrown); "," } else {"," return;"," }"," }"," "," //if it reaches here, the error wasn't thrown, which is a bad thing"," throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, \"Error should have been thrown.\"));"," }","","};","/**"," * Error is thrown whenever an assertion fails. It provides methods"," * to more easily get at error information and also provides a base class"," * from which more specific assertion errors can be derived."," *"," * @param {String} message The message to display when the error occurs."," * @namespace Test"," * @module test"," * @class AssertionError"," * @constructor"," */ ","YUITest.AssertionError = function (message){"," "," /**"," * Error message. Must be duplicated to ensure browser receives it."," * @type String"," * @property message"," */"," this.message = message;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"Assert Error\";","};","","YUITest.AssertionError.prototype = {",""," //restore constructor"," constructor: YUITest.AssertionError,",""," /**"," * Returns a fully formatted error for an assertion failure. This should"," * be overridden by all subclasses to provide specific information."," * @method getMessage"," * @return {String} A string describing the error."," */"," getMessage : function () {"," return this.message;"," },"," "," /**"," * Returns a string representation of the error."," * @method toString"," * @return {String} A string representation of the error."," */"," toString : function () {"," return this.name + \": \" + this.getMessage();"," }","","};/**"," * ComparisonFailure is subclass of Error that is thrown whenever"," * a comparison between two values fails. It provides mechanisms to retrieve"," * both the expected and actual value."," *"," * @param {String} message The message to display when the error occurs."," * @param {Object} expected The expected value."," * @param {Object} actual The actual value that caused the assertion to fail."," * @namespace Test "," * @extends AssertionError"," * @module test"," * @class ComparisonFailure"," * @constructor"," */ ","YUITest.ComparisonFailure = function (message, expected, actual){",""," //call superclass"," YUITest.AssertionError.call(this, message);"," "," /**"," * The expected value."," * @type Object"," * @property expected"," */"," this.expected = expected;"," "," /**"," * The actual value."," * @type Object"," * @property actual"," */"," this.actual = actual;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"ComparisonFailure\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.ComparisonFailure.prototype = new YUITest.AssertionError;","","//restore constructor","YUITest.ComparisonFailure.prototype.constructor = YUITest.ComparisonFailure;","","/**"," * Returns a fully formatted error for an assertion failure. This message"," * provides information about the expected and actual values."," * @method getMessage"," * @return {String} A string describing the error."," */","YUITest.ComparisonFailure.prototype.getMessage = function(){"," return this.message + \"\\nExpected: \" + this.expected + \" (\" + (typeof this.expected) + \")\" +"," \"\\nActual: \" + this.actual + \" (\" + (typeof this.actual) + \")\";","};","/**"," * An object object containing coverage result formatting methods."," * @namespace Test"," * @module test"," * @class CoverageFormat"," * @static"," */","YUITest.CoverageFormat = {",""," /**"," * Returns the coverage report in JSON format. This is the straight"," * JSON representation of the native coverage report."," * @param {Object} coverage The coverage report object."," * @return {String} A JSON-formatted string of coverage data."," * @method JSON"," * @namespace Test.CoverageFormat"," */"," JSON: function(coverage){"," return YUITest.Util.JSON.stringify(coverage);"," },"," "," /**"," * Returns the coverage report in a JSON format compatible with"," * Xdebug. See <a href=\"http://www.xdebug.com/docs/code_coverage\">Xdebug Documentation</a>"," * for more information. Note: function coverage is not available"," * in this format."," * @param {Object} coverage The coverage report object."," * @return {String} A JSON-formatted string of coverage data."," * @method XdebugJSON"," * @namespace Test.CoverageFormat"," */ "," XdebugJSON: function(coverage){"," "," var report = {};"," for (var prop in coverage){"," if (coverage.hasOwnProperty(prop)){"," report[prop] = coverage[prop].lines;"," }"," }",""," return YUITest.Util.JSON.stringify(coverage);"," }","","};","","/**"," * The DateAssert object provides functions to test JavaScript Date objects"," * for a variety of cases."," * @namespace Test"," * @module test"," * @class DateAssert"," * @static"," */"," ","YUITest.DateAssert = {",""," /**"," * Asserts that a date's month, day, and year are equal to another date's."," * @param {Date} expected The expected date."," * @param {Date} actual The actual date to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method datesAreEqual"," * @static"," */"," datesAreEqual : function (expected, actual, message){"," YUITest.Assert._increment(); "," if (expected instanceof Date && actual instanceof Date){"," var msg = \"\";"," "," //check years first"," if (expected.getFullYear() != actual.getFullYear()){"," msg = \"Years should be equal.\";"," }"," "," //now check months"," if (expected.getMonth() != actual.getMonth()){"," msg = \"Months should be equal.\";"," } "," "," //last, check the day of the month"," if (expected.getDate() != actual.getDate()){"," msg = \"Days of month should be equal.\";"," } "," "," if (msg.length){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);"," }"," } else {"," throw new TypeError(\"YUITest.DateAssert.datesAreEqual(): Expected and actual values must be Date objects.\");"," }"," },",""," /**"," * Asserts that a date's hour, minutes, and seconds are equal to another date's."," * @param {Date} expected The expected date."," * @param {Date} actual The actual date to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method timesAreEqual"," * @static"," */"," timesAreEqual : function (expected, actual, message){"," YUITest.Assert._increment();"," if (expected instanceof Date && actual instanceof Date){"," var msg = \"\";"," "," //check hours first"," if (expected.getHours() != actual.getHours()){"," msg = \"Hours should be equal.\";"," }"," "," //now check minutes"," if (expected.getMinutes() != actual.getMinutes()){"," msg = \"Minutes should be equal.\";"," } "," "," //last, check the seconds"," if (expected.getSeconds() != actual.getSeconds()){"," msg = \"Seconds should be equal.\";"," } "," "," if (msg.length){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);"," }"," } else {"," throw new TypeError(\"YUITest.DateAssert.timesAreEqual(): Expected and actual values must be Date objects.\");"," }"," }"," ","};/**"," * Creates a new mock object."," * @namespace Test"," * @module test"," * @class Mock"," * @constructor"," * @param {Object} template (Optional) An object whose methods"," * should be stubbed out on the mock object."," */","YUITest.Mock = function(template){",""," //use blank object is nothing is passed in"," template = template || {};"," "," var mock,"," name;"," "," //try to create mock that keeps prototype chain intact"," //fails in the case of ActiveX objects"," try {"," function f(){}"," f.prototype = template;"," mock = new f();"," } catch (ex) {"," mock = {};"," }",""," //create stubs for all methods"," for (name in template){"," if (template.hasOwnProperty(name)){"," if (typeof template[name] == \"function\"){"," mock[name] = function(name){"," return function(){"," YUITest.Assert.fail(\"Method \" + name + \"() was called but was not expected to be.\");"," };"," }(name);"," }"," }"," }",""," //return it"," return mock; ","};"," ","/**"," * Assigns an expectation to a mock object. This is used to create"," * methods and properties on the mock object that are monitored for"," * calls and changes, respectively."," * @param {Object} mock The object to add the expectation to."," * @param {Object} expectation An object defining the expectation. For"," * properties, the keys \"property\" and \"value\" are required. For a"," * method the \"method\" key defines the method's name, the optional \"args\""," * key provides an array of argument types. The \"returns\" key provides"," * an optional return value. An optional \"run\" key provides a function"," * to be used as the method body. The return value of a mocked method is"," * determined first by the \"returns\" key, then the \"run\" function's return"," * value. If neither \"returns\" nor \"run\" is provided undefined is returned."," * An optional 'error' key defines an error type to be thrown in all cases."," * The \"callCount\" key provides an optional number of times the method is"," * expected to be called (the default is 1)."," * @return {void}"," * @method expect"," * @static"," */ ","YUITest.Mock.expect = function(mock /*:Object*/, expectation /*:Object*/){",""," //make sure there's a place to store the expectations"," if (!mock.__expectations) {"," mock.__expectations = {};"," }",""," //method expectation"," if (expectation.method){"," var name = expectation.method,"," args = expectation.args || [],"," result = expectation.returns,"," callCount = (typeof expectation.callCount == \"number\") ? expectation.callCount : 1,"," error = expectation.error,"," run = expectation.run || function(){},"," runResult,"," i;",""," //save expectations"," mock.__expectations[name] = expectation;"," expectation.callCount = callCount;"," expectation.actualCallCount = 0;"," "," //process arguments"," for (i=0; i < args.length; i++){"," if (!(args[i] instanceof YUITest.Mock.Value)){"," args[i] = YUITest.Mock.Value(YUITest.Assert.areSame, [args[i]], \"Argument \" + i + \" of \" + name + \"() is incorrect.\");"," } "," }"," "," //if the method is expected to be called"," if (callCount > 0){"," mock[name] = function(){ "," try {"," expectation.actualCallCount++;"," YUITest.Assert.areEqual(args.length, arguments.length, \"Method \" + name + \"() passed incorrect number of arguments.\");"," for (var i=0, len=args.length; i < len; i++){"," args[i].verify(arguments[i]);"," } ",""," runResult = run.apply(this, arguments);"," "," if (error){"," throw error;"," }"," } catch (ex){"," //route through TestRunner for proper handling"," YUITest.TestRunner._handleError(ex);"," }",""," // Any value provided for 'returns' overrides any value returned"," // by our 'run' function. "," return expectation.hasOwnProperty('returns') ? result : runResult;"," };"," } else {"," "," //method should fail if called when not expected"," mock[name] = function(){"," try {"," YUITest.Assert.fail(\"Method \" + name + \"() should not have been called.\");"," } catch (ex){"," //route through TestRunner for proper handling"," YUITest.TestRunner._handleError(ex);"," } "," };"," }"," } else if (expectation.property){"," //save expectations"," mock.__expectations[expectation.property] = expectation;"," }","};","","/**"," * Verifies that all expectations of a mock object have been met and"," * throws an assertion error if not."," * @param {Object} mock The object to verify.."," * @return {void}"," * @method verify"," * @static"," */ ","YUITest.Mock.verify = function(mock){ "," try {"," "," for (var name in mock.__expectations){"," if (mock.__expectations.hasOwnProperty(name)){"," var expectation = mock.__expectations[name];"," if (expectation.method) {"," YUITest.Assert.areEqual(expectation.callCount, expectation.actualCallCount, \"Method \" + expectation.method + \"() wasn't called the expected number of times.\");"," } else if (expectation.property){"," YUITest.Assert.areEqual(expectation.value, mock[expectation.property], \"Property \" + expectation.property + \" wasn't set to the correct value.\"); "," } "," }"," }",""," } catch (ex){"," //route through TestRunner for proper handling"," YUITest.TestRunner._handleError(ex);"," }","};","","/**"," * Creates a new value matcher."," * @param {Function} method The function to call on the value."," * @param {Array} originalArgs (Optional) Array of arguments to pass to the method."," * @param {String} message (Optional) Message to display in case of failure."," * @namespace Test.Mock"," * @module test"," * @class Value"," * @constructor"," */","YUITest.Mock.Value = function(method, originalArgs, message){"," if (this instanceof YUITest.Mock.Value){"," this.verify = function(value){"," var args = [].concat(originalArgs || []);"," args.push(value);"," args.push(message);"," method.apply(null, args);"," };"," } else {"," return new YUITest.Mock.Value(method, originalArgs, message);"," }","};","","/**"," * Predefined matcher to match any value."," * @property Any"," * @static"," * @type Function"," */","YUITest.Mock.Value.Any = YUITest.Mock.Value(function(){});","","/**"," * Predefined matcher to match boolean values."," * @property Boolean"," * @static"," * @type Function"," */","YUITest.Mock.Value.Boolean = YUITest.Mock.Value(YUITest.Assert.isBoolean);","","/**"," * Predefined matcher to match number values."," * @property Number"," * @static"," * @type Function"," */","YUITest.Mock.Value.Number = YUITest.Mock.Value(YUITest.Assert.isNumber);","","/**"," * Predefined matcher to match string values."," * @property String"," * @static"," * @type Function"," */","YUITest.Mock.Value.String = YUITest.Mock.Value(YUITest.Assert.isString);","","/**"," * Predefined matcher to match object values."," * @property Object"," * @static"," * @type Function"," */","YUITest.Mock.Value.Object = YUITest.Mock.Value(YUITest.Assert.isObject);","","/**"," * Predefined matcher to match function values."," * @property Function"," * @static"," * @type Function"," */","YUITest.Mock.Value.Function = YUITest.Mock.Value(YUITest.Assert.isFunction);","","/**"," * The ObjectAssert object provides functions to test JavaScript objects"," * for a variety of cases."," * @namespace Test"," * @module test"," * @class ObjectAssert"," * @static"," */","YUITest.ObjectAssert = {",""," /**"," * Asserts that an object has all of the same properties"," * and property values as the other."," * @param {Object} expected The object with all expected properties and values."," * @param {Object} actual The object to inspect."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areEqual"," * @static"," * @deprecated"," */"," areEqual: function(expected, actual, message) {"," YUITest.Assert._increment(); "," "," var expectedKeys = YUITest.Object.keys(expected),"," actualKeys = YUITest.Object.keys(actual);"," "," //first check keys array length"," if (expectedKeys.length != actualKeys.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Object should have \" + expectedKeys.length + \" keys but has \" + actualKeys.length));"," }"," "," //then check values"," for (var name in expected){"," if (expected.hasOwnProperty(name)){"," if (expected[name] != actual[name]){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values should be equal for property \" + name), expected[name], actual[name]);"," } "," }"," } "," },"," "," /**"," * Asserts that an object has a property with the given name."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method hasKey"," * @static"," * @deprecated Use ownsOrInheritsKey() instead"," */ "," hasKey: function (propertyName, object, message) {"," YUITest.ObjectAssert.ownsOrInheritsKey(propertyName, object, message); "," },"," "," /**"," * Asserts that an object has all properties of a reference object."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method hasKeys"," * @static"," * @deprecated Use ownsOrInheritsKeys() instead"," */ "," hasKeys: function (properties, object, message) {"," YUITest.ObjectAssert.ownsOrInheritsKeys(properties, object, message);"," },"," "," /**"," * Asserts that a property with the given name exists on an object's prototype."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method inheritsKey"," * @static"," */ "," inheritsKey: function (propertyName, object, message) {"," YUITest.Assert._increment(); "," if (!(propertyName in object && !object.hasOwnProperty(propertyName))){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + propertyName + \"' not found on object instance.\"));"," } "," },"," "," /**"," * Asserts that all properties exist on an object prototype."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method inheritsKeys"," * @static"," */ "," inheritsKeys: function (properties, object, message) {"," YUITest.Assert._increment(); "," for (var i=0; i < properties.length; i++){"," if (!(propertyName in object && !object.hasOwnProperty(properties[i]))){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + properties[i] + \"' not found on object instance.\"));"," } "," }"," },"," "," /**"," * Asserts that a property with the given name exists on an object instance (not on its prototype)."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsKey"," * @static"," */ "," ownsKey: function (propertyName, object, message) {"," YUITest.Assert._increment(); "," if (!object.hasOwnProperty(propertyName)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + propertyName + \"' not found on object instance.\"));"," } "," },"," "," /**"," * Asserts that all properties exist on an object instance (not on its prototype)."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsKeys"," * @static"," */ "," ownsKeys: function (properties, object, message) {"," YUITest.Assert._increment(); "," for (var i=0; i < properties.length; i++){"," if (!object.hasOwnProperty(properties[i])){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + properties[i] + \"' not found on object instance.\"));"," } "," }"," },"," "," /**"," * Asserts that an object owns no properties."," * @param {Object} object The object to check."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsNoKeys"," * @static"," */ "," ownsNoKeys : function (object, message) {"," YUITest.Assert._increment(); "," var count = 0,"," name;"," for (name in object){"," if (object.hasOwnProperty(name)){"," count++;"," }"," }"," "," if (count !== 0){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Object owns \" + count + \" properties but should own none.\")); "," }",""," },",""," /**"," * Asserts that an object has a property with the given name."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsOrInheritsKey"," * @static"," */ "," ownsOrInheritsKey: function (propertyName, object, message) {"," YUITest.Assert._increment(); "," if (!(propertyName in object)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + propertyName + \"' not found on object.\"));"," } "," },"," "," /**"," * Asserts that an object has all properties of a reference object."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsOrInheritsKeys"," * @static"," */ "," ownsOrInheritsKeys: function (properties, object, message) {"," YUITest.Assert._increment(); "," for (var i=0; i < properties.length; i++){"," if (!(properties[i] in object)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + properties[i] + \"' not found on object.\"));"," } "," }"," } ","};","/**"," * Convenience type for storing and aggregating"," * test result information."," * @private"," * @namespace Test"," * @module test"," * @class Results"," * @constructor"," * @param {String} name The name of the test."," */","YUITest.Results = function(name){",""," /**"," * Name of the test, test case, or test suite."," * @type String"," * @property name"," */"," this.name = name;"," "," /**"," * Number of passed tests."," * @type int"," * @property passed"," */"," this.passed = 0;"," "," /**"," * Number of failed tests."," * @type int"," * @property failed"," */"," this.failed = 0;"," "," /**"," * Number of errors that occur in non-test methods."," * @type int"," * @property errors"," */"," this.errors = 0;"," "," /**"," * Number of ignored tests."," * @type int"," * @property ignored"," */"," this.ignored = 0;"," "," /**"," * Number of total tests."," * @type int"," * @property total"," */"," this.total = 0;"," "," /**"," * Amount of time (ms) it took to complete testing."," * @type int"," * @property duration"," */"," this.duration = 0;","};","","/**"," * Includes results from another results object into this one."," * @param {Test.Results} result The results object to include."," * @method include"," * @return {void}"," */","YUITest.Results.prototype.include = function(results){"," this.passed += results.passed;"," this.failed += results.failed;"," this.ignored += results.ignored;"," this.total += results.total;"," this.errors += results.errors;","};","/**"," * ShouldError is subclass of Error that is thrown whenever"," * a test is expected to throw an error but doesn't."," *"," * @param {String} message The message to display when the error occurs."," * @namespace Test "," * @extends AssertionError"," * @module test"," * @class ShouldError"," * @constructor"," */ ","YUITest.ShouldError = function (message){",""," //call superclass"," YUITest.AssertionError.call(this, message || \"This test should have thrown an error but didn't.\");"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"ShouldError\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.ShouldError.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.ShouldError.prototype.constructor = YUITest.ShouldError;","/**"," * ShouldFail is subclass of AssertionError that is thrown whenever"," * a test was expected to fail but did not."," *"," * @param {String} message The message to display when the error occurs."," * @namespace Test "," * @extends YUITest.AssertionError"," * @module test"," * @class ShouldFail"," * @constructor"," */ ","YUITest.ShouldFail = function (message){",""," //call superclass"," YUITest.AssertionError.call(this, message || \"This test should fail but didn't.\");"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"ShouldFail\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.ShouldFail.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.ShouldFail.prototype.constructor = YUITest.ShouldFail;","/**"," * UnexpectedError is subclass of AssertionError that is thrown whenever"," * an error occurs within the course of a test and the test was not expected"," * to throw an error."," *"," * @param {Error} cause The unexpected error that caused this error to be "," * thrown."," * @namespace Test "," * @extends YUITest.AssertionError"," * @module test"," * @class UnexpectedError"," * @constructor"," */ ","YUITest.UnexpectedError = function (cause){",""," //call superclass"," YUITest.AssertionError.call(this, \"Unexpected error: \" + cause.message);"," "," /**"," * The unexpected error that occurred."," * @type Error"," * @property cause"," */"," this.cause = cause;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"UnexpectedError\";"," "," /**"," * Stack information for the error (if provided)."," * @type String"," * @property stack"," */"," this.stack = cause.stack;"," ","};","","//inherit from YUITest.AssertionError","YUITest.UnexpectedError.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.UnexpectedError.prototype.constructor = YUITest.UnexpectedError;","/**"," * UnexpectedValue is subclass of Error that is thrown whenever"," * a value was unexpected in its scope. This typically means that a test"," * was performed to determine that a value was *not* equal to a certain"," * value."," *"," * @param {String} message The message to display when the error occurs."," * @param {Object} unexpected The unexpected value."," * @namespace Test "," * @extends AssertionError"," * @module test"," * @class UnexpectedValue"," * @constructor"," */ ","YUITest.UnexpectedValue = function (message, unexpected){",""," //call superclass"," YUITest.AssertionError.call(this, message);"," "," /**"," * The unexpected value."," * @type Object"," * @property unexpected"," */"," this.unexpected = unexpected;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"UnexpectedValue\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.UnexpectedValue.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.UnexpectedValue.prototype.constructor = YUITest.UnexpectedValue;","","/**"," * Returns a fully formatted error for an assertion failure. This message"," * provides information about the expected and actual values."," * @method getMessage"," * @return {String} A string describing the error."," */","YUITest.UnexpectedValue.prototype.getMessage = function(){"," return this.message + \"\\nUnexpected: \" + this.unexpected + \" (\" + (typeof this.unexpected) + \") \";","};","","/**"," * Represents a stoppage in test execution to wait for an amount of time before"," * continuing."," * @param {Function} segment A function to run when the wait is over."," * @param {int} delay The number of milliseconds to wait before running the code."," * @module test"," * @class Wait"," * @namespace Test"," * @constructor"," *"," */","YUITest.Wait = function (segment, delay) {"," "," /**"," * The segment of code to run when the wait is over."," * @type Function"," * @property segment"," */"," this.segment = (typeof segment == \"function\" ? segment : null);",""," /**"," * The delay before running the segment of code."," * @type int"," * @property delay"," */"," this.delay = (typeof delay == \"number\" ? delay : 0); ","};","","","//Setting up our aliases..","Y.Test = YUITest;","Y.Object.each(YUITest, function(item, name) {"," var name = name.replace('Test', '');"," Y.Test[name] = item;","});","","} //End of else in top wrapper","","Y.Assert = YUITest.Assert;","Y.Assert.Error = Y.Test.AssertionError;","Y.Assert.ComparisonFailure = Y.Test.ComparisonFailure;","Y.Assert.UnexpectedValue = Y.Test.UnexpectedValue;","Y.Mock = Y.Test.Mock;","Y.ObjectAssert = Y.Test.ObjectAssert;","Y.ArrayAssert = Y.Test.ArrayAssert;","Y.DateAssert = Y.Test.DateAssert;","Y.Test.ResultsFormat = Y.Test.TestFormat;","","var itemsAreEqual = Y.Test.ArrayAssert.itemsAreEqual;","","Y.Test.ArrayAssert.itemsAreEqual = function(expected, actual, message) {"," return itemsAreEqual.call(this, Y.Array(expected), Y.Array(actual), message);","};","","","/**"," * Asserts that a given condition is true. If not, then a Y.Assert.Error object is thrown"," * and the test fails."," * @method assert"," * @param {Boolean} condition The condition to test."," * @param {String} message The message to display if the assertion fails."," * @for YUI"," * @static"," */","Y.assert = function(condition, message){"," Y.Assert._increment();"," if (!condition){"," throw new Y.Assert.Error(Y.Assert._formatMessage(message, \"Assertion failed.\"));"," }","};","","/**"," * Forces an assertion error to occur. Shortcut for Y.Assert.fail()."," * @method fail"," * @param {String} message (Optional) The message to display with the failure."," * @for YUI"," * @static"," */","Y.fail = Y.Assert.fail; ","","Y.Test.Runner.once = Y.Test.Runner.subscribe;","","Y.Test.Runner.disableLogging = function() {"," Y.Test.Runner._log = false;","};","","Y.Test.Runner.enableLogging = function() {"," Y.Test.Runner._log = true;","};","","Y.Test.Runner._ignoreEmpty = true;","Y.Test.Runner._log = true;","","Y.Test.Runner.on = Y.Test.Runner.attach;","","//Only allow one instance of YUITest","if (!YUI.YUITest) {",""," if (Y.config.win) {"," Y.config.win.YUITest = YUITest;"," }",""," YUI.YUITest = Y.Test;",""," "," //Only setup the listeners once."," var logEvent = function(event) {"," "," //data variables"," var message = \"\";"," var messageType = \"\";"," "," switch(event.type){"," case this.BEGIN_EVENT:"," message = \"Testing began at \" + (new Date()).toString() + \".\";"," messageType = \"info\";"," break;"," "," case this.COMPLETE_EVENT:"," message = Y.Lang.sub(\"Testing completed at \" +"," (new Date()).toString() + \".\\n\" +"," \"Passed:{passed} Failed:{failed} \" +"," \"Total:{total} ({ignored} ignored)\","," event.results);"," messageType = \"info\";"," break;"," "," case this.TEST_FAIL_EVENT:"," message = event.testName + \": failed.\\n\" + event.error.getMessage();"," messageType = \"fail\";"," break;"," "," case this.TEST_IGNORE_EVENT:"," message = event.testName + \": ignored.\";"," messageType = \"ignore\";"," break;"," "," case this.TEST_PASS_EVENT:"," message = event.testName + \": passed.\";"," messageType = \"pass\";"," break;"," "," case this.TEST_SUITE_BEGIN_EVENT:"," message = \"Test suite \\\"\" + event.testSuite.name + \"\\\" started.\";"," messageType = \"info\";"," break;"," "," case this.TEST_SUITE_COMPLETE_EVENT:"," message = Y.Lang.sub(\"Test suite \\\"\" +"," event.testSuite.name + \"\\\" completed\" + \".\\n\" +"," \"Passed:{passed} Failed:{failed} \" +"," \"Total:{total} ({ignored} ignored)\","," event.results);"," messageType = \"info\";"," break;"," "," case this.TEST_CASE_BEGIN_EVENT:"," message = \"Test case \\\"\" + event.testCase.name + \"\\\" started.\";"," messageType = \"info\";"," break;"," "," case this.TEST_CASE_COMPLETE_EVENT:"," message = Y.Lang.sub(\"Test case \\\"\" +"," event.testCase.name + \"\\\" completed.\\n\" +"," \"Passed:{passed} Failed:{failed} \" +"," \"Total:{total} ({ignored} ignored)\","," event.results);"," messageType = \"info\";"," break;"," default:"," message = \"Unexpected event \" + event.type;"," message = \"info\";"," }"," "," if (Y.Test.Runner._log) {"," Y.log(message, messageType, \"TestRunner\");"," }"," };",""," var i, name;",""," for (i in Y.Test.Runner) {"," name = Y.Test.Runner[i];"," if (i.indexOf('_EVENT') > -1) {"," Y.Test.Runner.subscribe(name, logEvent);"," }"," };","","} //End if for YUI.YUITest","","","}, '3.7.2', {\"requires\": [\"event-simulate\", \"event-custom\", \"json-stringify\"]});"];-_yuitest_coverage["build/test/test.js"].lines = {"1":0,"16":0,"17":0,"21":0,"24":0,"28":0,"32":0,"33":0,"34":0,"46":0,"55":0,"59":0,"76":0,"77":0,"80":0,"92":0,"103":0,"104":0,"106":0,"107":0,"110":0,"111":0,"114":0,"115":0,"116":0,"117":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"150":0,"165":0,"172":0,"180":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"194":0,"195":0,"200":0,"212":0,"213":0,"215":0,"251":0,"258":0,"261":0,"262":0,"266":0,"267":0,"273":0,"286":0,"297":0,"312":0,"313":0,"315":0,"316":0,"318":0,"319":0,"336":0,"337":0,"338":0,"348":0,"398":0,"406":0,"408":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"421":0,"431":0,"443":0,"444":0,"446":0,"447":0,"450":0,"451":0,"453":0,"454":0,"455":0,"456":0,"457":0,"463":0,"465":0,"468":0,"482":0,"483":0,"485":0,"488":0,"489":0,"490":0,"491":0,"493":0,"495":0,"500":0,"502":0,"503":0,"504":0,"505":0,"510":0,"511":0,"515":0,"516":0,"517":0,"518":0,"522":0,"527":0,"529":0,"530":0,"531":0,"532":0,"537":0,"542":0,"546":0,"559":0,"561":0,"562":0,"564":0,"567":0,"569":0,"571":0,"572":0,"575":0,"577":0,"579":0,"583":0,"585":0,"586":0,"587":0,"588":0,"593":0,"596":0,"600":0,"602":0,"603":0,"604":0,"605":0,"610":0,"611":0,"615":0,"616":0,"617":0,"618":0,"626":0,"630":0,"646":0,"653":0,"660":0,"668":0,"676":0,"684":0,"687":0,"700":0,"709":0,"719":0,"720":0,"721":0,"723":0,"724":0,"725":0,"727":0,"739":0,"740":0,"741":0,"742":0,"743":0,"744":0,"745":0,"748":0,"749":0,"751":0,"752":0,"755":0,"756":0,"757":0,"758":0,"759":0,"761":0,"765":0,"768":0,"769":0,"773":0,"774":0,"775":0,"778":0,"779":0,"780":0,"781":0,"782":0,"783":0,"784":0,"785":0,"790":0,"791":0,"792":0,"794":0,"795":0,"810":0,"819":0,"820":0,"821":0,"823":0,"824":0,"825":0,"826":0,"830":0,"843":0,"850":0,"857":0,"864":0,"871":0,"878":0,"885":0,"888":0,"889":0,"890":0,"891":0,"892":0,"893":0,"898":0,"908":0,"909":0,"910":0,"912":0,"913":0,"915":0,"916":0,"928":0,"931":0,"940":0,"949":0,"958":0,"967":0,"977":0,"986":0,"996":0,"1005":0,"1016":0,"1020":0,"1127":0,"1132":0,"1133":0,"1134":0,"1152":0,"1155":0,"1156":0,"1157":0,"1158":0,"1159":0,"1175":0,"1179":0,"1180":0,"1181":0,"1182":0,"1183":0,"1202":0,"1204":0,"1205":0,"1207":0,"1208":0,"1209":0,"1212":0,"1213":0,"1214":0,"1215":0,"1216":0,"1217":0,"1218":0,"1219":0,"1237":0,"1238":0,"1239":0,"1240":0,"1241":0,"1242":0,"1244":0,"1245":0,"1246":0,"1249":0,"1251":0,"1252":0,"1253":0,"1254":0,"1255":0,"1256":0,"1257":0,"1258":0,"1259":0,"1260":0,"1264":0,"1279":0,"1281":0,"1282":0,"1283":0,"1284":0,"1286":0,"1289":0,"1290":0,"1291":0,"1292":0,"1293":0,"1295":0,"1298":0,"1301":0,"1315":0,"1318":0,"1320":0,"1323":0,"1326":0,"1328":0,"1331":0,"1332":0,"1333":0,"1334":0,"1335":0,"1336":0,"1337":0,"1338":0,"1352":0,"1353":0,"1358":0,"1359":0,"1360":0,"1363":0,"1366":0,"1375":0,"1378":0,"1381":0,"1385":0,"1388":0,"1389":0,"1392":0,"1393":0,"1394":0,"1398":0,"1400":0,"1403":0,"1404":0,"1407":0,"1410":0,"1413":0,"1414":0,"1417":0,"1418":0,"1419":0,"1420":0,"1421":0,"1422":0,"1428":0,"1429":0,"1430":0,"1434":0,"1435":0,"1436":0,"1437":0,"1439":0,"1441":0,"1442":0,"1445":0,"1446":0,"1447":0,"1449":0,"1451":0,"1456":0,"1460":0,"1461":0,"1462":0,"1465":0,"1468":0,"1469":0,"1470":0,"1472":0,"1475":0,"1476":0,"1477":0,"1480":0,"1483":0,"1485":0,"1486":0,"1497":0,"1498":0,"1500":0,"1504":0,"1507":0,"1510":0,"1513":0,"1521":0,"1522":0,"1524":0,"1526":0,"1529":0,"1530":0,"1531":0,"1534":0,"1554":0,"1555":0,"1556":0,"1559":0,"1575":0,"1585":0,"1588":0,"1595":0,"1596":0,"1598":0,"1601":0,"1602":0,"1603":0,"1606":0,"1612":0,"1615":0,"1618":0,"1633":0,"1644":0,"1659":0,"1660":0,"1670":0,"1680":0,"1690":0,"1703":0,"1704":0,"1705":0,"1707":0,"1710":0,"1725":0,"1726":0,"1727":0,"1729":0,"1732":0,"1748":0,"1752":0,"1753":0,"1754":0,"1756":0,"1769":0,"1770":0,"1772":0,"1788":0,"1791":0,"1796":0,"1797":0,"1801":0,"1804":0,"1805":0,"1806":0,"1809":0,"1812":0,"1816":0,"1829":0,"1845":0,"1846":0,"1848":0,"1849":0,"1850":0,"1853":0,"1868":0,"1869":0,"1871":0,"1872":0,"1873":0,"1876":0,"1892":0,"1894":0,"1895":0,"1911":0,"1914":0,"1915":0,"1916":0,"1933":0,"1935":0,"1936":0,"1939":0,"1940":0,"1957":0,"1959":0,"1960":0,"1977":0,"1979":0,"1980":0,"1981":0,"1999":0,"2002":0,"2003":0,"2006":0,"2007":0,"2023":0,"2026":0,"2027":0,"2028":0,"2029":0,"2031":0,"2036":0,"2053":0,"2056":0,"2057":0,"2061":0,"2062":0,"2066":0,"2067":0,"2068":0,"2090":0,"2093":0,"2094":0,"2098":0,"2099":0,"2103":0,"2104":0,"2105":0,"2118":0,"2119":0,"2120":0,"2132":0,"2133":0,"2134":0,"2152":0,"2155":0,"2156":0,"2160":0,"2161":0,"2162":0,"2181":0,"2182":0,"2183":0,"2184":0,"2186":0,"2191":0,"2205":0,"2230":0,"2231":0,"2233":0,"2244":0,"2254":0,"2264":0,"2278":0,"2287":0,"2304":0,"2305":0,"2306":0,"2321":0,"2322":0,"2323":0,"2337":0,"2338":0,"2339":0,"2353":0,"2354":0,"2355":0,"2372":0,"2373":0,"2374":0,"2387":0,"2388":0,"2389":0,"2406":0,"2407":0,"2408":0,"2420":0,"2421":0,"2422":0,"2435":0,"2436":0,"2437":0,"2450":0,"2451":0,"2452":0,"2465":0,"2466":0,"2467":0,"2480":0,"2481":0,"2482":0,"2498":0,"2499":0,"2500":0,"2501":0,"2503":0,"2505":0,"2506":0,"2518":0,"2519":0,"2520":0,"2532":0,"2533":0,"2534":0,"2549":0,"2550":0,"2551":0,"2563":0,"2564":0,"2565":0,"2577":0,"2578":0,"2579":0,"2591":0,"2592":0,"2593":0,"2606":0,"2607":0,"2608":0,"2632":0,"2633":0,"2635":0,"2636":0,"2640":0,"2643":0,"2644":0,"2646":0,"2649":0,"2650":0,"2653":0,"2656":0,"2658":0,"2662":0,"2665":0,"2666":0,"2668":0,"2673":0,"2688":0,"2695":0,"2702":0,"2705":0,"2717":0,"2726":0,"2743":0,"2746":0,"2753":0,"2760":0,"2767":0,"2772":0,"2775":0,"2783":0,"2784":0,"2794":0,"2805":0,"2820":0,"2821":0,"2822":0,"2823":0,"2827":0,"2841":0,"2852":0,"2853":0,"2854":0,"2857":0,"2858":0,"2862":0,"2863":0,"2867":0,"2868":0,"2871":0,"2872":0,"2875":0,"2888":0,"2889":0,"2890":0,"2893":0,"2894":0,"2898":0,"2899":0,"2903":0,"2904":0,"2907":0,"2908":0,"2911":0,"2924":0,"2927":0,"2929":0,"2934":0,"2935":0,"2936":0,"2937":0,"2939":0,"2943":0,"2944":0,"2945":0,"2946":0,"2947":0,"2948":0,"2956":0,"2979":0,"2982":0,"2983":0,"2987":0,"2988":0,"2998":0,"2999":0,"3000":0,"3003":0,"3004":0,"3005":0,"3010":0,"3011":0,"3012":0,"3013":0,"3014":0,"3015":0,"3016":0,"3019":0,"3021":0,"3022":0,"3026":0,"3031":0,"3036":0,"3037":0,"3038":0,"3041":0,"3045":0,"3047":0,"3059":0,"3060":0,"3062":0,"3063":0,"3064":0,"3065":0,"3066":0,"3067":0,"3068":0,"3075":0,"3089":0,"3090":0,"3091":0,"3092":0,"3093":0,"3094":0,"3095":0,"3098":0,"3108":0,"3116":0,"3124":0,"3132":0,"3140":0,"3148":0,"3158":0,"3171":0,"3173":0,"3177":0,"3178":0,"3182":0,"3183":0,"3184":0,"3185":0,"3201":0,"3214":0,"3226":0,"3227":0,"3228":0,"3241":0,"3242":0,"3243":0,"3244":0,"3258":0,"3259":0,"3260":0,"3273":0,"3274":0,"3275":0,"3276":0,"3289":0,"3290":0,"3292":0,"3293":0,"3294":0,"3298":0,"3299":0,"3313":0,"3314":0,"3315":0,"3328":0,"3329":0,"3330":0,"3331":0,"3346":0,"3353":0,"3360":0,"3367":0,"3374":0,"3381":0,"3388":0,"3395":0,"3404":0,"3405":0,"3406":0,"3407":0,"3408":0,"3409":0,"3422":0,"3425":0,"3432":0,"3437":0,"3440":0,"3452":0,"3455":0,"3462":0,"3467":0,"3470":0,"3484":0,"3487":0,"3494":0,"3501":0,"3508":0,"3513":0,"3516":0,"3531":0,"3534":0,"3541":0,"3548":0,"3553":0,"3556":0,"3564":0,"3565":0,"3579":0,"3586":0,"3593":0,"3598":0,"3599":0,"3600":0,"3601":0,"3606":0,"3607":0,"3608":0,"3609":0,"3610":0,"3611":0,"3612":0,"3613":0,"3614":0,"3616":0,"3618":0,"3619":0,"3632":0,"3633":0,"3634":0,"3635":0,"3646":0,"3648":0,"3650":0,"3651":0,"3654":0,"3655":0,"3658":0,"3659":0,"3661":0,"3664":0,"3666":0,"3667":0,"3670":0,"3674":0,"3677":0,"3678":0,"3680":0,"3682":0,"3683":0,"3684":0,"3687":0,"3692":0,"3693":0,"3696":0,"3697":0,"3698":0,"3701":0,"3702":0,"3703":0,"3706":0,"3707":0,"3708":0,"3711":0,"3712":0,"3713":0,"3716":0,"3721":0,"3722":0,"3725":0,"3726":0,"3727":0,"3730":0,"3735":0,"3736":0,"3738":0,"3739":0,"3742":0,"3743":0,"3747":0,"3749":0,"3750":0,"3751":0,"3752":0,"3754":0};-_yuitest_coverage["build/test/test.js"].functions = {"guid:23":0,"EventTarget:46":0,"attach:75":0,"subscribe:91":0,"fire:102":0,"detach:129":0,"unsubscribe:149":0,"TestSuite:165":0,"add:211":0,"TestCase:251":0,"callback:285":0,"resume:296":0,"(anonymous 2):318":0,"wait:310":0,"assert:335":0,"fail:347":0,"(anonymous 3):408":0,"xmlEscape:406":0,"JSON:430":0,"serializeToXML:443":0,"XML:441":0,"serializeToJUnitXML:482":0,"JUnitXML:480":0,"serializeToTAP:561":0,"TAP:557":0,"TestFormat:398":0,"Reporter:646":0,"addField:699":0,"clearFields:708":0,"destroy:718":0,"report:736":0,"inGroups:819":0,"TestNode:843":0,"appendChild:907":0,"TestRunner:928":0,"_addTestCaseToTestTree:1124":0,"_addTestSuiteToTestTree:1149":0,"_buildTestTree:1173":0,"_handleTestObjectComplete:1201":0,"_next:1235":0,"_execNonTestMethod:1278":0,"(anonymous 4):1359":0,"_run:1312":0,"(anonymous 5):1446":0,"(anonymous 6):1530":0,"_resumeTest:1372":0,"(anonymous 7):1555":0,"_handleError:1552":0,"(anonymous 8):1602":0,"_runTest:1572":0,"getName:1632":0,"setName:1643":0,"add:1658":0,"clear:1669":0,"isWaiting:1679":0,"isRunning:1689":0,"getResults:1702":0,"getCoverage:1724":0,"(anonymous 9):1752":0,"callback:1747":0,"resume:1768":0,"run:1786":0,"TestRunner:810":0,"_indexOf:1844":0,"_some:1867":0,"contains:1889":0,"containsItems:1909":0,"containsMatch:1930":0,"doesNotContain:1954":0,"doesNotContainItems:1974":0,"doesNotContainMatch:1996":0,"indexOf:2021":0,"itemsAreEqual:2050":0,"itemsAreEquivalent:2087":0,"isEmpty:2117":0,"isNotEmpty:2131":0,"itemsAreSame:2149":0,"lastIndexOf:2178":0,"_formatMessage:2229":0,"_getCount:2243":0,"_increment:2253":0,"_reset:2263":0,"fail:2277":0,"pass:2286":0,"areEqual:2303":0,"areNotEqual:2319":0,"areNotSame:2336":0,"areSame:2352":0,"isFalse:2371":0,"isTrue:2386":0,"isNaN:2405":0,"isNotNaN:2419":0,"isNotNull:2434":0,"isNotUndefined:2449":0,"isNull:2464":0,"isUndefined:2479":0,"isArray:2497":0,"isBoolean:2517":0,"isFunction:2531":0,"isInstanceOf:2548":0,"isNumber:2562":0,"isObject:2576":0,"isString:2590":0,"isTypeOf:2605":0,"throwsError:2631":0,"AssertionError:2688":0,"getMessage:2716":0,"toString:2725":0,"ComparisonFailure:2743":0,"getMessage:2783":0,"JSON:2804":0,"XdebugJSON:2818":0,"datesAreEqual:2851":0,"timesAreEqual:2887":0,"(anonymous 11):2947":0,"]:2946":0,"Mock:2924":0,"]:3011":0,"]:3036":0,"expect:2979":0,"verify:3059":0,"verify:3091":0,"Value:3089":0,"areEqual:3170":0,"hasKey:3200":0,"hasKeys:3213":0,"inheritsKey:3225":0,"inheritsKeys:3240":0,"ownsKey:3257":0,"ownsKeys:3272":0,"ownsNoKeys:3288":0,"ownsOrInheritsKey:3312":0,"ownsOrInheritsKeys:3327":0,"Results:3346":0,"include:3404":0,"ShouldError:3422":0,"ShouldFail:3452":0,"UnexpectedError:3484":0,"UnexpectedValue:3531":0,"getMessage:3564":0,"Wait:3579":0,"(anonymous 14):3599":0,"itemsAreEqual:3618":0,"assert:3632":0,"disableLogging:3650":0,"enableLogging:3654":0,"logEvent:3674":0,"(anonymous 1):1":0};-_yuitest_coverage["build/test/test.js"].coveredLines = 893;-_yuitest_coverage["build/test/test.js"].coveredFunctions = 148;-_yuitest_coverline("build/test/test.js", 1);-YUI.add('test', function (Y, NAME) {----/**- * YUI Test Framework- * @module test- * @main test- */--/*- * The root namespace for YUI Test.- */--//So we only ever have one YUITest object that's shared-_yuitest_coverfunc("build/test/test.js", "(anonymous 1)", 1);-_yuitest_coverline("build/test/test.js", 16);-if (YUI.YUITest) {- _yuitest_coverline("build/test/test.js", 17);-Y.Test = YUI.YUITest;-} else { //Ends after the YUITest definitions-- //Make this global for back compat- _yuitest_coverline("build/test/test.js", 21);-YUITest = {- version: "3.7.2",- guid: function(pre) {- _yuitest_coverfunc("build/test/test.js", "guid", 23);-_yuitest_coverline("build/test/test.js", 24);-return Y.guid(pre);- }- };--_yuitest_coverline("build/test/test.js", 28);-Y.namespace('Test');---//Using internal YUI methods here-_yuitest_coverline("build/test/test.js", 32);-YUITest.Object = Y.Object;-_yuitest_coverline("build/test/test.js", 33);-YUITest.Array = Y.Array;-_yuitest_coverline("build/test/test.js", 34);-YUITest.Util = {- mix: Y.mix,- JSON: Y.JSON-};--/**- * Simple custom event implementation.- * @namespace Test- * @module test- * @class EventTarget- * @constructor- */-_yuitest_coverline("build/test/test.js", 46);-YUITest.EventTarget = function(){-- /**- * Event handlers for the various events.- * @type Object- * @private- * @property _handlers- * @static- */- _yuitest_coverfunc("build/test/test.js", "EventTarget", 46);-_yuitest_coverline("build/test/test.js", 55);-this._handlers = {};--};- -_yuitest_coverline("build/test/test.js", 59);-YUITest.EventTarget.prototype = {-- //restore prototype- constructor: YUITest.EventTarget,- - //-------------------------------------------------------------------------- // Event Handling- //-------------------------------------------------------------------------- - /**- * Adds a listener for a given event type.- * @param {String} type The type of event to add a listener for.- * @param {Function} listener The function to call when the event occurs.- * @return {void}- * @method attach- */- attach: function(type, listener){- _yuitest_coverfunc("build/test/test.js", "attach", 75);-_yuitest_coverline("build/test/test.js", 76);-if (typeof this._handlers[type] == "undefined"){- _yuitest_coverline("build/test/test.js", 77);-this._handlers[type] = [];- }-- _yuitest_coverline("build/test/test.js", 80);-this._handlers[type].push(listener);- },- - /**- * Adds a listener for a given event type.- * @param {String} type The type of event to add a listener for.- * @param {Function} listener The function to call when the event occurs.- * @return {void}- * @method subscribe- * @deprecated- */- subscribe: function(type, listener){- _yuitest_coverfunc("build/test/test.js", "subscribe", 91);-_yuitest_coverline("build/test/test.js", 92);-this.attach.apply(this, arguments);- },- - /**- * Fires an event based on the passed-in object.- * @param {Object|String} event An object with at least a 'type' attribute- * or a string indicating the event name.- * @return {void}- * @method fire- */ - fire: function(event){- _yuitest_coverfunc("build/test/test.js", "fire", 102);-_yuitest_coverline("build/test/test.js", 103);-if (typeof event == "string"){- _yuitest_coverline("build/test/test.js", 104);-event = { type: event };- }- _yuitest_coverline("build/test/test.js", 106);-if (!event.target){- _yuitest_coverline("build/test/test.js", 107);-event.target = this;- }- - _yuitest_coverline("build/test/test.js", 110);-if (!event.type){- _yuitest_coverline("build/test/test.js", 111);-throw new Error("Event object missing 'type' property.");- }- - _yuitest_coverline("build/test/test.js", 114);-if (this._handlers[event.type] instanceof Array){- _yuitest_coverline("build/test/test.js", 115);-var handlers = this._handlers[event.type];- _yuitest_coverline("build/test/test.js", 116);-for (var i=0, len=handlers.length; i < len; i++){- _yuitest_coverline("build/test/test.js", 117);-handlers[i].call(this, event);- }- } - },-- /**- * Removes a listener for a given event type.- * @param {String} type The type of event to remove a listener from.- * @param {Function} listener The function to remove from the event.- * @return {void}- * @method detach- */- detach: function(type, listener){- _yuitest_coverfunc("build/test/test.js", "detach", 129);-_yuitest_coverline("build/test/test.js", 130);-if (this._handlers[type] instanceof Array){- _yuitest_coverline("build/test/test.js", 131);-var handlers = this._handlers[type];- _yuitest_coverline("build/test/test.js", 132);-for (var i=0, len=handlers.length; i < len; i++){- _yuitest_coverline("build/test/test.js", 133);-if (handlers[i] === listener){- _yuitest_coverline("build/test/test.js", 134);-handlers.splice(i, 1);- _yuitest_coverline("build/test/test.js", 135);-break;- }- }- } - },- - /**- * Removes a listener for a given event type.- * @param {String} type The type of event to remove a listener from.- * @param {Function} listener The function to remove from the event.- * @return {void}- * @method unsubscribe- * @deprecated- */- unsubscribe: function(type, listener){- _yuitest_coverfunc("build/test/test.js", "unsubscribe", 149);-_yuitest_coverline("build/test/test.js", 150);-this.detach.apply(this, arguments); - } --};-- -/**- * A test suite that can contain a collection of TestCase and TestSuite objects.- * @param {String||Object} data The name of the test suite or an object containing- * a name property as well as setUp and tearDown methods.- * @namespace Test- * @module test- * @class TestSuite- * @constructor- */-_yuitest_coverline("build/test/test.js", 165);-YUITest.TestSuite = function (data) {-- /**- * The name of the test suite.- * @type String- * @property name- */- _yuitest_coverfunc("build/test/test.js", "TestSuite", 165);-_yuitest_coverline("build/test/test.js", 172);-this.name = "";-- /**- * Array of test suites and test cases.- * @type Array- * @property items- * @private- */- _yuitest_coverline("build/test/test.js", 180);-this.items = [];-- //initialize the properties- _yuitest_coverline("build/test/test.js", 183);-if (typeof data == "string"){- _yuitest_coverline("build/test/test.js", 184);-this.name = data;- } else {_yuitest_coverline("build/test/test.js", 185);-if (data instanceof Object){- _yuitest_coverline("build/test/test.js", 186);-for (var prop in data){- _yuitest_coverline("build/test/test.js", 187);-if (data.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 188);-this[prop] = data[prop];- }- }- }}-- //double-check name- _yuitest_coverline("build/test/test.js", 194);-if (this.name === "" || !this.name) {- _yuitest_coverline("build/test/test.js", 195);-this.name = YUITest.guid("testSuite_");- }--};- -_yuitest_coverline("build/test/test.js", 200);-YUITest.TestSuite.prototype = {- - //restore constructor- constructor: YUITest.TestSuite,- - /**- * Adds a test suite or test case to the test suite.- * @param {Test.TestSuite||YUITest.TestCase} testObject The test suite or test case to add.- * @return {Void}- * @method add- */- add : function (testObject) {- _yuitest_coverfunc("build/test/test.js", "add", 211);-_yuitest_coverline("build/test/test.js", 212);-if (testObject instanceof YUITest.TestSuite || testObject instanceof YUITest.TestCase) {- _yuitest_coverline("build/test/test.js", 213);-this.items.push(testObject);- }- _yuitest_coverline("build/test/test.js", 215);-return this;- },- - //-------------------------------------------------------------------------- // Stub Methods- //--------------------------------------------------------------------------- /**- * Function to run before each test is executed.- * @return {Void}- * @method setUp- */- setUp : function () {- },- - /**- * Function to run after each test is executed.- * @return {Void}- * @method tearDown- */- tearDown: function () {- }- -};-/**- * Test case containing various tests to run.- * @param template An object containing any number of test methods, other methods,- * an optional name, and anything else the test case needs.- * @module test- * @class TestCase- * @namespace Test- * @constructor- */----_yuitest_coverline("build/test/test.js", 251);-YUITest.TestCase = function (template) {- - /*- * Special rules for the test case. Possible subobjects- * are fail, for tests that should fail, and error, for- * tests that should throw an error.- */- _yuitest_coverfunc("build/test/test.js", "TestCase", 251);-_yuitest_coverline("build/test/test.js", 258);-this._should = {};- - //copy over all properties from the template to this object- _yuitest_coverline("build/test/test.js", 261);-for (var prop in template) {- _yuitest_coverline("build/test/test.js", 262);-this[prop] = template[prop];- } - - //check for a valid name- _yuitest_coverline("build/test/test.js", 266);-if (typeof this.name != "string") {- _yuitest_coverline("build/test/test.js", 267);-this.name = YUITest.guid("testCase_");- }--};-- -_yuitest_coverline("build/test/test.js", 273);-YUITest.TestCase.prototype = { -- //restore constructor- constructor: YUITest.TestCase,- - /**- * Method to call from an async init method to- * restart the test case. When called, returns a function- * that should be called when tests are ready to continue.- * @method callback- * @return {Function} The function to call as a callback.- */- callback: function(){- _yuitest_coverfunc("build/test/test.js", "callback", 285);-_yuitest_coverline("build/test/test.js", 286);-return YUITest.TestRunner.callback.apply(YUITest.TestRunner,arguments);- },-- /**- * Resumes a paused test and runs the given function.- * @param {Function} segment (Optional) The function to run.- * If omitted, the test automatically passes.- * @return {Void}- * @method resume- */- resume : function (segment) {- _yuitest_coverfunc("build/test/test.js", "resume", 296);-_yuitest_coverline("build/test/test.js", 297);-YUITest.TestRunner.resume(segment);- },-- /**- * Causes the test case to wait a specified amount of time and then- * continue executing the given code.- * @param {Function} segment (Optional) The function to run after the delay.- * If omitted, the TestRunner will wait until resume() is called.- * @param {int} delay (Optional) The number of milliseconds to wait before running- * the function. If omitted, defaults to zero.- * @return {Void}- * @method wait- */- wait : function (segment, delay){- - _yuitest_coverfunc("build/test/test.js", "wait", 310);-_yuitest_coverline("build/test/test.js", 312);-var actualDelay = (typeof segment == "number" ? segment : delay);- _yuitest_coverline("build/test/test.js", 313);-actualDelay = (typeof actualDelay == "number" ? actualDelay : 10000);- - _yuitest_coverline("build/test/test.js", 315);-if (typeof segment == "function"){- _yuitest_coverline("build/test/test.js", 316);-throw new YUITest.Wait(segment, actualDelay);- } else {- _yuitest_coverline("build/test/test.js", 318);-throw new YUITest.Wait(function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 2)", 318);-_yuitest_coverline("build/test/test.js", 319);-YUITest.Assert.fail("Timeout: wait() called but resume() never called.");- }, actualDelay);- }- },- - //-------------------------------------------------------------------------- // Assertion Methods- //--------------------------------------------------------------------------- /**- * Asserts that a given condition is true. If not, then a YUITest.AssertionError object is thrown- * and the test fails.- * @method assert- * @param {Boolean} condition The condition to test.- * @param {String} message The message to display if the assertion fails.- */- assert : function (condition, message){- _yuitest_coverfunc("build/test/test.js", "assert", 335);-_yuitest_coverline("build/test/test.js", 336);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 337);-if (!condition){- _yuitest_coverline("build/test/test.js", 338);-throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Assertion failed."));- } - },- - /**- * Forces an assertion error to occur. Shortcut for YUITest.Assert.fail().- * @method fail- * @param {String} message (Optional) The message to display with the failure.- */- fail: function (message) { - _yuitest_coverfunc("build/test/test.js", "fail", 347);-_yuitest_coverline("build/test/test.js", 348);-YUITest.Assert.fail(message);- },- - //-------------------------------------------------------------------------- // Stub Methods- //--------------------------------------------------------------------------- /**- * Function to run once before tests start to run.- * This executes before the first call to setUp().- * @method init- */- init: function(){- //noop- },- - /**- * Function to run once after tests finish running.- * This executes after the last call to tearDown().- * @method destroy- */- destroy: function(){- //noop- },-- /**- * Function to run before each test is executed.- * @return {Void}- * @method setUp- */- setUp : function () {- //noop- },- - /**- * Function to run after each test is executed.- * @return {Void}- * @method tearDown- */- tearDown: function () { - //noop- }-};-/**- * An object object containing test result formatting methods.- * @namespace Test- * @module test- * @class TestFormat- * @static- */-_yuitest_coverline("build/test/test.js", 398);-YUITest.TestFormat = function(){- - /* (intentionally not documented)- * Basic XML escaping method. Replaces quotes, less-than, greater-than,- * apostrophe, and ampersand characters with their corresponding entities.- * @param {String} text The text to encode.- * @return {String} The XML-escaped text.- */- _yuitest_coverfunc("build/test/test.js", "TestFormat", 398);-_yuitest_coverline("build/test/test.js", 406);-function xmlEscape(text){- - _yuitest_coverfunc("build/test/test.js", "xmlEscape", 406);-_yuitest_coverline("build/test/test.js", 408);-return text.replace(/[<>"'&]/g, function(value){- _yuitest_coverfunc("build/test/test.js", "(anonymous 3)", 408);-_yuitest_coverline("build/test/test.js", 409);-switch(value){- case "<": _yuitest_coverline("build/test/test.js", 410);-return "<";- case ">": _yuitest_coverline("build/test/test.js", 411);-return ">";- case "\"": _yuitest_coverline("build/test/test.js", 412);-return """;- case "'": _yuitest_coverline("build/test/test.js", 413);-return "'";- case "&": _yuitest_coverline("build/test/test.js", 414);-return "&";- }- });- - }- - - _yuitest_coverline("build/test/test.js", 421);-return {- - /**- * Returns test results formatted as a JSON string. Requires JSON utility.- * @param {Object} result The results object created by TestRunner.- * @return {String} A JSON-formatted string of results.- * @method JSON- * @static- */- JSON: function(results) {- _yuitest_coverfunc("build/test/test.js", "JSON", 430);-_yuitest_coverline("build/test/test.js", 431);-return YUITest.Util.JSON.stringify(results);- },- - /**- * Returns test results formatted as an XML string.- * @param {Object} result The results object created by TestRunner.- * @return {String} An XML-formatted string of results.- * @method XML- * @static- */- XML: function(results) {-- _yuitest_coverfunc("build/test/test.js", "XML", 441);-_yuitest_coverline("build/test/test.js", 443);-function serializeToXML(results){- _yuitest_coverfunc("build/test/test.js", "serializeToXML", 443);-_yuitest_coverline("build/test/test.js", 444);-var xml = "<" + results.type + " name=\"" + xmlEscape(results.name) + "\"";- - _yuitest_coverline("build/test/test.js", 446);-if (typeof(results.duration)=="number"){- _yuitest_coverline("build/test/test.js", 447);-xml += " duration=\"" + results.duration + "\"";- }- - _yuitest_coverline("build/test/test.js", 450);-if (results.type == "test"){- _yuitest_coverline("build/test/test.js", 451);-xml += " result=\"" + results.result + "\" message=\"" + xmlEscape(results.message) + "\">";- } else {- _yuitest_coverline("build/test/test.js", 453);-xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">";- _yuitest_coverline("build/test/test.js", 454);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 455);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 456);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 457);-xml += serializeToXML(results[prop]);- }- }- } - }-- _yuitest_coverline("build/test/test.js", 463);-xml += "</" + results.type + ">";- - _yuitest_coverline("build/test/test.js", 465);-return xml; - }-- _yuitest_coverline("build/test/test.js", 468);-return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + serializeToXML(results);-- },--- /**- * Returns test results formatted in JUnit XML format.- * @param {Object} result The results object created by TestRunner.- * @return {String} An XML-formatted string of results.- * @method JUnitXML- * @static- */- JUnitXML: function(results) {-- _yuitest_coverfunc("build/test/test.js", "JUnitXML", 480);-_yuitest_coverline("build/test/test.js", 482);-function serializeToJUnitXML(results){- _yuitest_coverfunc("build/test/test.js", "serializeToJUnitXML", 482);-_yuitest_coverline("build/test/test.js", 483);-var xml = "";- - _yuitest_coverline("build/test/test.js", 485);-switch (results.type){- //equivalent to testcase in JUnit- case "test":- _yuitest_coverline("build/test/test.js", 488);-if (results.result != "ignore"){- _yuitest_coverline("build/test/test.js", 489);-xml = "<testcase name=\"" + xmlEscape(results.name) + "\" time=\"" + (results.duration/1000) + "\">";- _yuitest_coverline("build/test/test.js", 490);-if (results.result == "fail"){- _yuitest_coverline("build/test/test.js", 491);-xml += "<failure message=\"" + xmlEscape(results.message) + "\"><![CDATA[" + results.message + "]]></failure>";- }- _yuitest_coverline("build/test/test.js", 493);-xml+= "</testcase>";- }- _yuitest_coverline("build/test/test.js", 495);-break;- - //equivalent to testsuite in JUnit- case "testcase":- - _yuitest_coverline("build/test/test.js", 500);-xml = "<testsuite name=\"" + xmlEscape(results.name) + "\" tests=\"" + results.total + "\" failures=\"" + results.failed + "\" time=\"" + (results.duration/1000) + "\">";- - _yuitest_coverline("build/test/test.js", 502);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 503);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 504);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 505);-xml += serializeToJUnitXML(results[prop]);- }- }- } - - _yuitest_coverline("build/test/test.js", 510);-xml += "</testsuite>";- _yuitest_coverline("build/test/test.js", 511);-break;- - //no JUnit equivalent, don't output anything- case "testsuite":- _yuitest_coverline("build/test/test.js", 515);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 516);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 517);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 518);-xml += serializeToJUnitXML(results[prop]);- }- }- } - _yuitest_coverline("build/test/test.js", 522);-break;- - //top-level, equivalent to testsuites in JUnit- case "report":- - _yuitest_coverline("build/test/test.js", 527);-xml = "<testsuites>";- - _yuitest_coverline("build/test/test.js", 529);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 530);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 531);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 532);-xml += serializeToJUnitXML(results[prop]);- }- }- } - - _yuitest_coverline("build/test/test.js", 537);-xml += "</testsuites>"; - - //no default- }- - _yuitest_coverline("build/test/test.js", 542);-return xml;- - }-- _yuitest_coverline("build/test/test.js", 546);-return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + serializeToJUnitXML(results);- },- - /**- * Returns test results formatted in TAP format.- * For more information, see <a href="http://testanything.org/">Test Anything Protocol</a>.- * @param {Object} result The results object created by TestRunner.- * @return {String} A TAP-formatted string of results.- * @method TAP- * @static- */- TAP: function(results) {- - _yuitest_coverfunc("build/test/test.js", "TAP", 557);-_yuitest_coverline("build/test/test.js", 559);-var currentTestNum = 1;-- _yuitest_coverline("build/test/test.js", 561);-function serializeToTAP(results){- _yuitest_coverfunc("build/test/test.js", "serializeToTAP", 561);-_yuitest_coverline("build/test/test.js", 562);-var text = "";- - _yuitest_coverline("build/test/test.js", 564);-switch (results.type){-- case "test":- _yuitest_coverline("build/test/test.js", 567);-if (results.result != "ignore"){-- _yuitest_coverline("build/test/test.js", 569);-text = "ok " + (currentTestNum++) + " - " + results.name;- - _yuitest_coverline("build/test/test.js", 571);-if (results.result == "fail"){- _yuitest_coverline("build/test/test.js", 572);-text = "not " + text + " - " + results.message;- }- - _yuitest_coverline("build/test/test.js", 575);-text += "\n";- } else {- _yuitest_coverline("build/test/test.js", 577);-text = "#Ignored test " + results.name + "\n";- }- _yuitest_coverline("build/test/test.js", 579);-break;- - case "testcase":- - _yuitest_coverline("build/test/test.js", 583);-text = "#Begin testcase " + results.name + "(" + results.failed + " failed of " + results.total + ")\n";- - _yuitest_coverline("build/test/test.js", 585);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 586);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 587);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 588);-text += serializeToTAP(results[prop]);- }- }- } - - _yuitest_coverline("build/test/test.js", 593);-text += "#End testcase " + results.name + "\n";- - - _yuitest_coverline("build/test/test.js", 596);-break;- - case "testsuite":-- _yuitest_coverline("build/test/test.js", 600);-text = "#Begin testsuite " + results.name + "(" + results.failed + " failed of " + results.total + ")\n"; - - _yuitest_coverline("build/test/test.js", 602);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 603);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 604);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 605);-text += serializeToTAP(results[prop]);- }- }- } -- _yuitest_coverline("build/test/test.js", 610);-text += "#End testsuite " + results.name + "\n";- _yuitest_coverline("build/test/test.js", 611);-break;-- case "report":- - _yuitest_coverline("build/test/test.js", 615);-for (var prop in results){- _yuitest_coverline("build/test/test.js", 616);-if (results.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 617);-if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){- _yuitest_coverline("build/test/test.js", 618);-text += serializeToTAP(results[prop]);- }- }- } - - //no default- }- - _yuitest_coverline("build/test/test.js", 626);-return text;- - }-- _yuitest_coverline("build/test/test.js", 630);-return "1.." + results.total + "\n" + serializeToTAP(results);- }- - };-}();- - /**- * An object capable of sending test results to a server.- * @param {String} url The URL to submit the results to.- * @param {Function} format (Optiona) A function that outputs the results in a specific format.- * Default is YUITest.TestFormat.XML.- * @constructor- * @namespace Test- * @module test- * @class Reporter- */- _yuitest_coverline("build/test/test.js", 646);-YUITest.Reporter = function(url, format) {- - /**- * The URL to submit the data to.- * @type String- * @property url- */- _yuitest_coverfunc("build/test/test.js", "Reporter", 646);-_yuitest_coverline("build/test/test.js", 653);-this.url = url;- - /**- * The formatting function to call when submitting the data.- * @type Function- * @property format- */- _yuitest_coverline("build/test/test.js", 660);-this.format = format || YUITest.TestFormat.XML;- - /**- * Extra fields to submit with the request.- * @type Object- * @property _fields- * @private- */- _yuitest_coverline("build/test/test.js", 668);-this._fields = new Object();- - /**- * The form element used to submit the results.- * @type HTMLFormElement- * @property _form- * @private- */- _yuitest_coverline("build/test/test.js", 676);-this._form = null;- - /**- * Iframe used as a target for form submission.- * @type HTMLIFrameElement- * @property _iframe- * @private- */- _yuitest_coverline("build/test/test.js", 684);-this._iframe = null;- };- - _yuitest_coverline("build/test/test.js", 687);-YUITest.Reporter.prototype = {- - //restore missing constructor- constructor: YUITest.Reporter,- - /**- * Adds a field to the form that submits the results.- * @param {String} name The name of the field.- * @param {Variant} value The value of the field.- * @return {Void}- * @method addField- */- addField : function (name, value){- _yuitest_coverfunc("build/test/test.js", "addField", 699);-_yuitest_coverline("build/test/test.js", 700);-this._fields[name] = value; - },- - /**- * Removes all previous defined fields.- * @return {Void}- * @method clearFields- */- clearFields : function(){- _yuitest_coverfunc("build/test/test.js", "clearFields", 708);-_yuitest_coverline("build/test/test.js", 709);-this._fields = new Object();- },- - /**- * Cleans up the memory associated with the TestReporter, removing DOM elements- * that were created.- * @return {Void}- * @method destroy- */- destroy : function() {- _yuitest_coverfunc("build/test/test.js", "destroy", 718);-_yuitest_coverline("build/test/test.js", 719);-if (this._form){- _yuitest_coverline("build/test/test.js", 720);-this._form.parentNode.removeChild(this._form);- _yuitest_coverline("build/test/test.js", 721);-this._form = null;- } - _yuitest_coverline("build/test/test.js", 723);-if (this._iframe){- _yuitest_coverline("build/test/test.js", 724);-this._iframe.parentNode.removeChild(this._iframe);- _yuitest_coverline("build/test/test.js", 725);-this._iframe = null;- }- _yuitest_coverline("build/test/test.js", 727);-this._fields = null;- },- - /**- * Sends the report to the server.- * @param {Object} results The results object created by TestRunner.- * @return {Void}- * @method report- */- report : function(results){- - //if the form hasn't been created yet, create it- _yuitest_coverfunc("build/test/test.js", "report", 736);-_yuitest_coverline("build/test/test.js", 739);-if (!this._form){- _yuitest_coverline("build/test/test.js", 740);-this._form = document.createElement("form");- _yuitest_coverline("build/test/test.js", 741);-this._form.method = "post";- _yuitest_coverline("build/test/test.js", 742);-this._form.style.visibility = "hidden";- _yuitest_coverline("build/test/test.js", 743);-this._form.style.position = "absolute";- _yuitest_coverline("build/test/test.js", 744);-this._form.style.top = 0;- _yuitest_coverline("build/test/test.js", 745);-document.body.appendChild(this._form);- - //IE won't let you assign a name using the DOM, must do it the hacky way- _yuitest_coverline("build/test/test.js", 748);-try {- _yuitest_coverline("build/test/test.js", 749);-this._iframe = document.createElement("<iframe name=\"yuiTestTarget\" />");- } catch (ex){- _yuitest_coverline("build/test/test.js", 751);-this._iframe = document.createElement("iframe");- _yuitest_coverline("build/test/test.js", 752);-this._iframe.name = "yuiTestTarget";- }- - _yuitest_coverline("build/test/test.js", 755);-this._iframe.src = "javascript:false";- _yuitest_coverline("build/test/test.js", 756);-this._iframe.style.visibility = "hidden";- _yuitest_coverline("build/test/test.js", 757);-this._iframe.style.position = "absolute";- _yuitest_coverline("build/test/test.js", 758);-this._iframe.style.top = 0;- _yuitest_coverline("build/test/test.js", 759);-document.body.appendChild(this._iframe);- - _yuitest_coverline("build/test/test.js", 761);-this._form.target = "yuiTestTarget";- }- - //set the form's action- _yuitest_coverline("build/test/test.js", 765);-this._form.action = this.url;- - //remove any existing fields- _yuitest_coverline("build/test/test.js", 768);-while(this._form.hasChildNodes()){- _yuitest_coverline("build/test/test.js", 769);-this._form.removeChild(this._form.lastChild);- }- - //create default fields- _yuitest_coverline("build/test/test.js", 773);-this._fields.results = this.format(results);- _yuitest_coverline("build/test/test.js", 774);-this._fields.useragent = navigator.userAgent;- _yuitest_coverline("build/test/test.js", 775);-this._fields.timestamp = (new Date()).toLocaleString();- - //add fields to the form- _yuitest_coverline("build/test/test.js", 778);-for (var prop in this._fields){- _yuitest_coverline("build/test/test.js", 779);-var value = this._fields[prop];- _yuitest_coverline("build/test/test.js", 780);-if (this._fields.hasOwnProperty(prop) && (typeof value != "function")){- _yuitest_coverline("build/test/test.js", 781);-var input = document.createElement("input");- _yuitest_coverline("build/test/test.js", 782);-input.type = "hidden";- _yuitest_coverline("build/test/test.js", 783);-input.name = prop;- _yuitest_coverline("build/test/test.js", 784);-input.value = value;- _yuitest_coverline("build/test/test.js", 785);-this._form.appendChild(input);- }- }- - //remove default fields- _yuitest_coverline("build/test/test.js", 790);-delete this._fields.results;- _yuitest_coverline("build/test/test.js", 791);-delete this._fields.useragent;- _yuitest_coverline("build/test/test.js", 792);-delete this._fields.timestamp;- - _yuitest_coverline("build/test/test.js", 794);-if (arguments[1] !== false){- _yuitest_coverline("build/test/test.js", 795);-this._form.submit();- }- - }- - };- - /**- * Runs test suites and test cases, providing events to allowing for the- * interpretation of test results.- * @namespace Test- * @module test- * @class TestRunner- * @static- */- _yuitest_coverline("build/test/test.js", 810);-YUITest.TestRunner = function(){-- /*(intentionally not documented)- * Determines if any of the array of test groups appears- * in the given TestRunner filter.- * @param {Array} testGroups The array of test groups to- * search for.- * @param {String} filter The TestRunner groups filter.- */- _yuitest_coverfunc("build/test/test.js", "TestRunner", 810);-_yuitest_coverline("build/test/test.js", 819);-function inGroups(testGroups, filter){- _yuitest_coverfunc("build/test/test.js", "inGroups", 819);-_yuitest_coverline("build/test/test.js", 820);-if (!filter.length){- _yuitest_coverline("build/test/test.js", 821);-return true;- } else { - _yuitest_coverline("build/test/test.js", 823);-if (testGroups){- _yuitest_coverline("build/test/test.js", 824);-for (var i=0, len=testGroups.length; i < len; i++){- _yuitest_coverline("build/test/test.js", 825);-if (filter.indexOf("," + testGroups[i] + ",") > -1){- _yuitest_coverline("build/test/test.js", 826);-return true;- }- }- }- _yuitest_coverline("build/test/test.js", 830);-return false;- }- }- - /**- * A node in the test tree structure. May represent a TestSuite, TestCase, or- * test function.- * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.- * @module test- * @class TestNode- * @constructor- * @private- */- _yuitest_coverline("build/test/test.js", 843);-function TestNode(testObject){- - /**- * The TestSuite, TestCase, or test function represented by this node.- * @type Variant- * @property testObject- */- _yuitest_coverfunc("build/test/test.js", "TestNode", 843);-_yuitest_coverline("build/test/test.js", 850);-this.testObject = testObject;- - /**- * Pointer to this node's first child.- * @type TestNode- * @property firstChild- */ - _yuitest_coverline("build/test/test.js", 857);-this.firstChild = null;- - /**- * Pointer to this node's last child.- * @type TestNode- * @property lastChild- */ - _yuitest_coverline("build/test/test.js", 864);-this.lastChild = null;- - /**- * Pointer to this node's parent.- * @type TestNode- * @property parent- */ - _yuitest_coverline("build/test/test.js", 871);-this.parent = null; - - /**- * Pointer to this node's next sibling.- * @type TestNode- * @property next- */ - _yuitest_coverline("build/test/test.js", 878);-this.next = null;- - /**- * Test results for this test object.- * @type object- * @property results- */ - _yuitest_coverline("build/test/test.js", 885);-this.results = new YUITest.Results();- - //initialize results- _yuitest_coverline("build/test/test.js", 888);-if (testObject instanceof YUITest.TestSuite){- _yuitest_coverline("build/test/test.js", 889);-this.results.type = "testsuite";- _yuitest_coverline("build/test/test.js", 890);-this.results.name = testObject.name;- } else {_yuitest_coverline("build/test/test.js", 891);-if (testObject instanceof YUITest.TestCase){- _yuitest_coverline("build/test/test.js", 892);-this.results.type = "testcase";- _yuitest_coverline("build/test/test.js", 893);-this.results.name = testObject.name;- }}- - }- - _yuitest_coverline("build/test/test.js", 898);-TestNode.prototype = {- - /**- * Appends a new test object (TestSuite, TestCase, or test function name) as a child- * of this node.- * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.- * @return {Void}- * @method appendChild- */- appendChild : function (testObject){- _yuitest_coverfunc("build/test/test.js", "appendChild", 907);-_yuitest_coverline("build/test/test.js", 908);-var node = new TestNode(testObject);- _yuitest_coverline("build/test/test.js", 909);-if (this.firstChild === null){- _yuitest_coverline("build/test/test.js", 910);-this.firstChild = this.lastChild = node;- } else {- _yuitest_coverline("build/test/test.js", 912);-this.lastChild.next = node;- _yuitest_coverline("build/test/test.js", 913);-this.lastChild = node;- }- _yuitest_coverline("build/test/test.js", 915);-node.parent = this;- _yuitest_coverline("build/test/test.js", 916);-return node;- } - };- - /**- * Runs test suites and test cases, providing events to allowing for the- * interpretation of test results.- * @namespace Test- * @module test- * @class Runner- * @static- */- _yuitest_coverline("build/test/test.js", 928);-function TestRunner(){- - //inherit from EventTarget- _yuitest_coverfunc("build/test/test.js", "TestRunner", 928);-_yuitest_coverline("build/test/test.js", 931);-YUITest.EventTarget.call(this);- - /**- * Suite on which to attach all TestSuites and TestCases to be run.- * @type YUITest.TestSuite- * @property masterSuite- * @static- * @private- */- _yuitest_coverline("build/test/test.js", 940);-this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));- - /**- * Pointer to the current node in the test tree.- * @type TestNode- * @private- * @property _cur- * @static- */- _yuitest_coverline("build/test/test.js", 949);-this._cur = null;- - /**- * Pointer to the root node in the test tree.- * @type TestNode- * @private- * @property _root- * @static- */- _yuitest_coverline("build/test/test.js", 958);-this._root = null;- - /**- * Indicates if the TestRunner will log events or not.- * @type Boolean- * @property _log- * @private- * @static- */- _yuitest_coverline("build/test/test.js", 967);-this._log = true;- - /**- * Indicates if the TestRunner is waiting as a result of- * wait() being called.- * @type Boolean- * @property _waiting- * @private- * @static- */- _yuitest_coverline("build/test/test.js", 977);-this._waiting = false;- - /**- * Indicates if the TestRunner is currently running tests.- * @type Boolean- * @private- * @property _running- * @static- */- _yuitest_coverline("build/test/test.js", 986);-this._running = false;- - /**- * Holds copy of the results object generated when all tests are- * complete.- * @type Object- * @private- * @property _lastResults- * @static- */- _yuitest_coverline("build/test/test.js", 996);-this._lastResults = null; - - /**- * Data object that is passed around from method to method.- * @type Object- * @private- * @property _data- * @static- */- _yuitest_coverline("build/test/test.js", 1005);-this._context = null;- - /**- * The list of test groups to run. The list is represented- * by a comma delimited string with commas at the start and- * end.- * @type String- * @private- * @property _groups- * @static- */- _yuitest_coverline("build/test/test.js", 1016);-this._groups = "";-- }- - _yuitest_coverline("build/test/test.js", 1020);-TestRunner.prototype = YUITest.Util.mix(new YUITest.EventTarget(), {- - /**- * If true, YUITest will not fire an error for tests with no Asserts.- * @prop _ignoreEmpty- * @private- * @type Boolean- * @static- */- _ignoreEmpty: false,-- //restore prototype- constructor: YUITest.TestRunner,- - //-------------------------------------------------------------------------- // Constants- //-------------------------------------------------------------------------- - /**- * Fires when a test case is opened but before the first - * test is executed.- * @event testcasebegin- * @static- */ - TEST_CASE_BEGIN_EVENT : "testcasebegin",- - /**- * Fires when all tests in a test case have been executed.- * @event testcasecomplete- * @static- */ - TEST_CASE_COMPLETE_EVENT : "testcasecomplete",- - /**- * Fires when a test suite is opened but before the first - * test is executed.- * @event testsuitebegin- * @static- */ - TEST_SUITE_BEGIN_EVENT : "testsuitebegin",- - /**- * Fires when all test cases in a test suite have been- * completed.- * @event testsuitecomplete- * @static- */ - TEST_SUITE_COMPLETE_EVENT : "testsuitecomplete",- - /**- * Fires when a test has passed.- * @event pass- * @static- */ - TEST_PASS_EVENT : "pass",- - /**- * Fires when a test has failed.- * @event fail- * @static- */ - TEST_FAIL_EVENT : "fail",- - /**- * Fires when a non-test method has an error.- * @event error- * @static- */ - ERROR_EVENT : "error",- - /**- * Fires when a test has been ignored.- * @event ignore- * @static- */ - TEST_IGNORE_EVENT : "ignore",- - /**- * Fires when all test suites and test cases have been completed.- * @event complete- * @static- */ - COMPLETE_EVENT : "complete",- - /**- * Fires when the run() method is called.- * @event begin- * @static- */ - BEGIN_EVENT : "begin", -- //-------------------------------------------------------------------------- // Test Tree-Related Methods- //-------------------------------------------------------------------------- - /**- * Adds a test case to the test tree as a child of the specified node.- * @param {TestNode} parentNode The node to add the test case to as a child.- * @param {Test.TestCase} testCase The test case to add.- * @return {Void}- * @static- * @private- * @method _addTestCaseToTestTree- */- _addTestCaseToTestTree : function (parentNode, testCase){- - //add the test suite- _yuitest_coverfunc("build/test/test.js", "_addTestCaseToTestTree", 1124);-_yuitest_coverline("build/test/test.js", 1127);-var node = parentNode.appendChild(testCase),- prop,- testName;- - //iterate over the items in the test case- _yuitest_coverline("build/test/test.js", 1132);-for (prop in testCase){- _yuitest_coverline("build/test/test.js", 1133);-if ((prop.indexOf("test") === 0 || prop.indexOf(" ") > -1) && typeof testCase[prop] == "function"){- _yuitest_coverline("build/test/test.js", 1134);-node.appendChild(prop);- }- }- - },- - /**- * Adds a test suite to the test tree as a child of the specified node.- * @param {TestNode} parentNode The node to add the test suite to as a child.- * @param {Test.TestSuite} testSuite The test suite to add.- * @return {Void}- * @static- * @private- * @method _addTestSuiteToTestTree- */- _addTestSuiteToTestTree : function (parentNode, testSuite) {- - //add the test suite- _yuitest_coverfunc("build/test/test.js", "_addTestSuiteToTestTree", 1149);-_yuitest_coverline("build/test/test.js", 1152);-var node = parentNode.appendChild(testSuite);- - //iterate over the items in the master suite- _yuitest_coverline("build/test/test.js", 1155);-for (var i=0; i < testSuite.items.length; i++){- _yuitest_coverline("build/test/test.js", 1156);-if (testSuite.items[i] instanceof YUITest.TestSuite) {- _yuitest_coverline("build/test/test.js", 1157);-this._addTestSuiteToTestTree(node, testSuite.items[i]);- } else {_yuitest_coverline("build/test/test.js", 1158);-if (testSuite.items[i] instanceof YUITest.TestCase) {- _yuitest_coverline("build/test/test.js", 1159);-this._addTestCaseToTestTree(node, testSuite.items[i]);- }} - } - },- - /**- * Builds the test tree based on items in the master suite. The tree is a hierarchical- * representation of the test suites, test cases, and test functions. The resulting tree- * is stored in _root and the pointer _cur is set to the root initially.- * @return {Void}- * @static- * @private- * @method _buildTestTree- */- _buildTestTree : function () {- - _yuitest_coverfunc("build/test/test.js", "_buildTestTree", 1173);-_yuitest_coverline("build/test/test.js", 1175);-this._root = new TestNode(this.masterSuite);- //this._cur = this._root;- - //iterate over the items in the master suite- _yuitest_coverline("build/test/test.js", 1179);-for (var i=0; i < this.masterSuite.items.length; i++){- _yuitest_coverline("build/test/test.js", 1180);-if (this.masterSuite.items[i] instanceof YUITest.TestSuite) {- _yuitest_coverline("build/test/test.js", 1181);-this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);- } else {_yuitest_coverline("build/test/test.js", 1182);-if (this.masterSuite.items[i] instanceof YUITest.TestCase) {- _yuitest_coverline("build/test/test.js", 1183);-this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);- }} - } - - }, - - //-------------------------------------------------------------------------- // Private Methods- //-------------------------------------------------------------------------- - /**- * Handles the completion of a test object's tests. Tallies test results - * from one level up to the next.- * @param {TestNode} node The TestNode representing the test object.- * @return {Void}- * @method _handleTestObjectComplete- * @private- */- _handleTestObjectComplete : function (node) {- _yuitest_coverfunc("build/test/test.js", "_handleTestObjectComplete", 1201);-_yuitest_coverline("build/test/test.js", 1202);-var parentNode;- - _yuitest_coverline("build/test/test.js", 1204);-if (node && (typeof node.testObject == "object")) {- _yuitest_coverline("build/test/test.js", 1205);-parentNode = node.parent;- - _yuitest_coverline("build/test/test.js", 1207);-if (parentNode){- _yuitest_coverline("build/test/test.js", 1208);-parentNode.results.include(node.results); - _yuitest_coverline("build/test/test.js", 1209);-parentNode.results[node.testObject.name] = node.results;- }- - _yuitest_coverline("build/test/test.js", 1212);-if (node.testObject instanceof YUITest.TestSuite){- _yuitest_coverline("build/test/test.js", 1213);-this._execNonTestMethod(node, "tearDown", false);- _yuitest_coverline("build/test/test.js", 1214);-node.results.duration = (new Date()) - node._start;- _yuitest_coverline("build/test/test.js", 1215);-this.fire({ type: this.TEST_SUITE_COMPLETE_EVENT, testSuite: node.testObject, results: node.results});- } else {_yuitest_coverline("build/test/test.js", 1216);-if (node.testObject instanceof YUITest.TestCase){- _yuitest_coverline("build/test/test.js", 1217);-this._execNonTestMethod(node, "destroy", false);- _yuitest_coverline("build/test/test.js", 1218);-node.results.duration = (new Date()) - node._start;- _yuitest_coverline("build/test/test.js", 1219);-this.fire({ type: this.TEST_CASE_COMPLETE_EVENT, testCase: node.testObject, results: node.results});- }} - } - }, - - //-------------------------------------------------------------------------- // Navigation Methods- //-------------------------------------------------------------------------- - /**- * Retrieves the next node in the test tree.- * @return {TestNode} The next node in the test tree or null if the end is reached.- * @private- * @static- * @method _next- */- _next : function () {- - _yuitest_coverfunc("build/test/test.js", "_next", 1235);-_yuitest_coverline("build/test/test.js", 1237);-if (this._cur === null){- _yuitest_coverline("build/test/test.js", 1238);-this._cur = this._root;- } else {_yuitest_coverline("build/test/test.js", 1239);-if (this._cur.firstChild) {- _yuitest_coverline("build/test/test.js", 1240);-this._cur = this._cur.firstChild;- } else {_yuitest_coverline("build/test/test.js", 1241);-if (this._cur.next) {- _yuitest_coverline("build/test/test.js", 1242);-this._cur = this._cur.next; - } else {- _yuitest_coverline("build/test/test.js", 1244);-while (this._cur && !this._cur.next && this._cur !== this._root){- _yuitest_coverline("build/test/test.js", 1245);-this._handleTestObjectComplete(this._cur);- _yuitest_coverline("build/test/test.js", 1246);-this._cur = this._cur.parent;- }- - _yuitest_coverline("build/test/test.js", 1249);-this._handleTestObjectComplete(this._cur); - - _yuitest_coverline("build/test/test.js", 1251);-if (this._cur == this._root){- _yuitest_coverline("build/test/test.js", 1252);-this._cur.results.type = "report";- _yuitest_coverline("build/test/test.js", 1253);-this._cur.results.timestamp = (new Date()).toLocaleString();- _yuitest_coverline("build/test/test.js", 1254);-this._cur.results.duration = (new Date()) - this._cur._start; - _yuitest_coverline("build/test/test.js", 1255);-this._lastResults = this._cur.results;- _yuitest_coverline("build/test/test.js", 1256);-this._running = false; - _yuitest_coverline("build/test/test.js", 1257);-this.fire({ type: this.COMPLETE_EVENT, results: this._lastResults});- _yuitest_coverline("build/test/test.js", 1258);-this._cur = null;- } else {_yuitest_coverline("build/test/test.js", 1259);-if (this._cur) {- _yuitest_coverline("build/test/test.js", 1260);-this._cur = this._cur.next; - }}- }}}- - _yuitest_coverline("build/test/test.js", 1264);-return this._cur;- },- - /**- * Executes a non-test method (init, setUp, tearDown, destroy)- * and traps an errors. If an error occurs, an error event is- * fired.- * @param {Object} node The test node in the testing tree.- * @param {String} methodName The name of the method to execute.- * @param {Boolean} allowAsync Determines if the method can be called asynchronously.- * @return {Boolean} True if an async method was called, false if not.- * @method _execNonTestMethod- * @private- */- _execNonTestMethod: function(node, methodName, allowAsync){- _yuitest_coverfunc("build/test/test.js", "_execNonTestMethod", 1278);-_yuitest_coverline("build/test/test.js", 1279);-var testObject = node.testObject,- event = { type: this.ERROR_EVENT };- _yuitest_coverline("build/test/test.js", 1281);-try {- _yuitest_coverline("build/test/test.js", 1282);-if (allowAsync && testObject["async:" + methodName]){- _yuitest_coverline("build/test/test.js", 1283);-testObject["async:" + methodName](this._context);- _yuitest_coverline("build/test/test.js", 1284);-return true;- } else {- _yuitest_coverline("build/test/test.js", 1286);-testObject[methodName](this._context);- }- } catch (ex){- _yuitest_coverline("build/test/test.js", 1289);-node.results.errors++;- _yuitest_coverline("build/test/test.js", 1290);-event.error = ex;- _yuitest_coverline("build/test/test.js", 1291);-event.methodName = methodName;- _yuitest_coverline("build/test/test.js", 1292);-if (testObject instanceof YUITest.TestCase){- _yuitest_coverline("build/test/test.js", 1293);-event.testCase = testObject;- } else {- _yuitest_coverline("build/test/test.js", 1295);-event.testSuite = testSuite;- }- - _yuitest_coverline("build/test/test.js", 1298);-this.fire(event);- } -- _yuitest_coverline("build/test/test.js", 1301);-return false;- },- - /**- * Runs a test case or test suite, returning the results.- * @param {Test.TestCase|YUITest.TestSuite} testObject The test case or test suite to run.- * @return {Object} Results of the execution with properties passed, failed, and total.- * @private- * @method _run- * @static- */- _run : function () {- - //flag to indicate if the TestRunner should wait before continuing- _yuitest_coverfunc("build/test/test.js", "_run", 1312);-_yuitest_coverline("build/test/test.js", 1315);-var shouldWait = false;- - //get the next test node- _yuitest_coverline("build/test/test.js", 1318);-var node = this._next();- - _yuitest_coverline("build/test/test.js", 1320);-if (node !== null) {- - //set flag to say the testrunner is running- _yuitest_coverline("build/test/test.js", 1323);-this._running = true;- - //eliminate last results- _yuitest_coverline("build/test/test.js", 1326);-this._lastResult = null; - - _yuitest_coverline("build/test/test.js", 1328);-var testObject = node.testObject;- - //figure out what to do- _yuitest_coverline("build/test/test.js", 1331);-if (typeof testObject == "object" && testObject !== null){- _yuitest_coverline("build/test/test.js", 1332);-if (testObject instanceof YUITest.TestSuite){- _yuitest_coverline("build/test/test.js", 1333);-this.fire({ type: this.TEST_SUITE_BEGIN_EVENT, testSuite: testObject });- _yuitest_coverline("build/test/test.js", 1334);-node._start = new Date();- _yuitest_coverline("build/test/test.js", 1335);-this._execNonTestMethod(node, "setUp" ,false);- } else {_yuitest_coverline("build/test/test.js", 1336);-if (testObject instanceof YUITest.TestCase){- _yuitest_coverline("build/test/test.js", 1337);-this.fire({ type: this.TEST_CASE_BEGIN_EVENT, testCase: testObject });- _yuitest_coverline("build/test/test.js", 1338);-node._start = new Date();- - //regular or async init- /*try {- if (testObject["async:init"]){- testObject["async:init"](this._context);- return;- } else {- testObject.init(this._context);- }- } catch (ex){- node.results.errors++;- this.fire({ type: this.ERROR_EVENT, error: ex, testCase: testObject, methodName: "init" });- }*/- _yuitest_coverline("build/test/test.js", 1352);-if(this._execNonTestMethod(node, "init", true)){- _yuitest_coverline("build/test/test.js", 1353);-return;- }- }}- - //some environments don't support setTimeout- _yuitest_coverline("build/test/test.js", 1358);-if (typeof setTimeout != "undefined"){ - _yuitest_coverline("build/test/test.js", 1359);-setTimeout(function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 4)", 1359);-_yuitest_coverline("build/test/test.js", 1360);-YUITest.TestRunner._run();- }, 0);- } else {- _yuitest_coverline("build/test/test.js", 1363);-this._run();- }- } else {- _yuitest_coverline("build/test/test.js", 1366);-this._runTest(node);- }- - }- },- - _resumeTest : function (segment) {- - //get relevant information- _yuitest_coverfunc("build/test/test.js", "_resumeTest", 1372);-_yuitest_coverline("build/test/test.js", 1375);-var node = this._cur; - - //we know there's no more waiting now- _yuitest_coverline("build/test/test.js", 1378);-this._waiting = false;- - //if there's no node, it probably means a wait() was called after resume()- _yuitest_coverline("build/test/test.js", 1381);-if (!node){- //TODO: Handle in some way?- //console.log("wait() called after resume()");- //this.fire("error", { testCase: "(unknown)", test: "(unknown)", error: new Error("wait() called after resume()")} );- _yuitest_coverline("build/test/test.js", 1385);-return;- }- - _yuitest_coverline("build/test/test.js", 1388);-var testName = node.testObject;- _yuitest_coverline("build/test/test.js", 1389);-var testCase = node.parent.testObject;- - //cancel other waits if available- _yuitest_coverline("build/test/test.js", 1392);-if (testCase.__yui_wait){- _yuitest_coverline("build/test/test.js", 1393);-clearTimeout(testCase.__yui_wait);- _yuitest_coverline("build/test/test.js", 1394);-delete testCase.__yui_wait;- }-- //get the "should" test cases- _yuitest_coverline("build/test/test.js", 1398);-var shouldFail = testName.indexOf("fail:") === 0 ||- (testCase._should.fail || {})[testName];- _yuitest_coverline("build/test/test.js", 1400);-var shouldError = (testCase._should.error || {})[testName];- - //variable to hold whether or not the test failed- _yuitest_coverline("build/test/test.js", 1403);-var failed = false;- _yuitest_coverline("build/test/test.js", 1404);-var error = null;- - //try the test- _yuitest_coverline("build/test/test.js", 1407);-try {- - //run the test- _yuitest_coverline("build/test/test.js", 1410);-segment.call(testCase, this._context); - - //if the test hasn't already failed and doesn't have any asserts...- _yuitest_coverline("build/test/test.js", 1413);-if(YUITest.Assert._getCount() == 0 && !this._ignoreEmpty){- _yuitest_coverline("build/test/test.js", 1414);-throw new YUITest.AssertionError("Test has no asserts.");- } - //if it should fail, and it got here, then it's a fail because it didn't- else {_yuitest_coverline("build/test/test.js", 1417);-if (shouldFail){- _yuitest_coverline("build/test/test.js", 1418);-error = new YUITest.ShouldFail();- _yuitest_coverline("build/test/test.js", 1419);-failed = true;- } else {_yuitest_coverline("build/test/test.js", 1420);-if (shouldError){- _yuitest_coverline("build/test/test.js", 1421);-error = new YUITest.ShouldError();- _yuitest_coverline("build/test/test.js", 1422);-failed = true;- }}}- - } catch (thrown){-- //cancel any pending waits, the test already failed- _yuitest_coverline("build/test/test.js", 1428);-if (testCase.__yui_wait){- _yuitest_coverline("build/test/test.js", 1429);-clearTimeout(testCase.__yui_wait);- _yuitest_coverline("build/test/test.js", 1430);-delete testCase.__yui_wait;- } - - //figure out what type of error it was- _yuitest_coverline("build/test/test.js", 1434);-if (thrown instanceof YUITest.AssertionError) {- _yuitest_coverline("build/test/test.js", 1435);-if (!shouldFail){- _yuitest_coverline("build/test/test.js", 1436);-error = thrown;- _yuitest_coverline("build/test/test.js", 1437);-failed = true;- }- } else {_yuitest_coverline("build/test/test.js", 1439);-if (thrown instanceof YUITest.Wait){- - _yuitest_coverline("build/test/test.js", 1441);-if (typeof thrown.segment == "function"){- _yuitest_coverline("build/test/test.js", 1442);-if (typeof thrown.delay == "number"){- - //some environments don't support setTimeout- _yuitest_coverline("build/test/test.js", 1445);-if (typeof setTimeout != "undefined"){- _yuitest_coverline("build/test/test.js", 1446);-testCase.__yui_wait = setTimeout(function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 5)", 1446);-_yuitest_coverline("build/test/test.js", 1447);-YUITest.TestRunner._resumeTest(thrown.segment);- }, thrown.delay);- _yuitest_coverline("build/test/test.js", 1449);-this._waiting = true;- } else {- _yuitest_coverline("build/test/test.js", 1451);-throw new Error("Asynchronous tests not supported in this environment.");- }- }- }- - _yuitest_coverline("build/test/test.js", 1456);-return;- - } else {- //first check to see if it should error- _yuitest_coverline("build/test/test.js", 1460);-if (!shouldError) { - _yuitest_coverline("build/test/test.js", 1461);-error = new YUITest.UnexpectedError(thrown);- _yuitest_coverline("build/test/test.js", 1462);-failed = true;- } else {- //check to see what type of data we have- _yuitest_coverline("build/test/test.js", 1465);-if (typeof shouldError == "string"){- - //if it's a string, check the error message- _yuitest_coverline("build/test/test.js", 1468);-if (thrown.message != shouldError){- _yuitest_coverline("build/test/test.js", 1469);-error = new YUITest.UnexpectedError(thrown);- _yuitest_coverline("build/test/test.js", 1470);-failed = true; - }- } else {_yuitest_coverline("build/test/test.js", 1472);-if (typeof shouldError == "function"){- - //if it's a function, see if the error is an instance of it- _yuitest_coverline("build/test/test.js", 1475);-if (!(thrown instanceof shouldError)){- _yuitest_coverline("build/test/test.js", 1476);-error = new YUITest.UnexpectedError(thrown);- _yuitest_coverline("build/test/test.js", 1477);-failed = true;- }- - } else {_yuitest_coverline("build/test/test.js", 1480);-if (typeof shouldError == "object" && shouldError !== null){- - //if it's an object, check the instance and message- _yuitest_coverline("build/test/test.js", 1483);-if (!(thrown instanceof shouldError.constructor) || - thrown.message != shouldError.message){- _yuitest_coverline("build/test/test.js", 1485);-error = new YUITest.UnexpectedError(thrown);- _yuitest_coverline("build/test/test.js", 1486);-failed = true; - }- - }}}- - }- }}- - }- - //fire appropriate event- _yuitest_coverline("build/test/test.js", 1497);-if (failed) {- _yuitest_coverline("build/test/test.js", 1498);-this.fire({ type: this.TEST_FAIL_EVENT, testCase: testCase, testName: testName, error: error });- } else {- _yuitest_coverline("build/test/test.js", 1500);-this.fire({ type: this.TEST_PASS_EVENT, testCase: testCase, testName: testName });- }- - //run the tear down- _yuitest_coverline("build/test/test.js", 1504);-this._execNonTestMethod(node.parent, "tearDown", false);- - //reset the assert count- _yuitest_coverline("build/test/test.js", 1507);-YUITest.Assert._reset();- - //calculate duration- _yuitest_coverline("build/test/test.js", 1510);-var duration = (new Date()) - node._start;- - //update results- _yuitest_coverline("build/test/test.js", 1513);-node.parent.results[testName] = { - result: failed ? "fail" : "pass",- message: error ? error.getMessage() : "Test passed",- type: "test",- name: testName,- duration: duration- };- - _yuitest_coverline("build/test/test.js", 1521);-if (failed){- _yuitest_coverline("build/test/test.js", 1522);-node.parent.results.failed++;- } else {- _yuitest_coverline("build/test/test.js", 1524);-node.parent.results.passed++;- }- _yuitest_coverline("build/test/test.js", 1526);-node.parent.results.total++;- - //set timeout not supported in all environments- _yuitest_coverline("build/test/test.js", 1529);-if (typeof setTimeout != "undefined"){- _yuitest_coverline("build/test/test.js", 1530);-setTimeout(function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 6)", 1530);-_yuitest_coverline("build/test/test.js", 1531);-YUITest.TestRunner._run();- }, 0);- } else {- _yuitest_coverline("build/test/test.js", 1534);-this._run();- }- - },- - /**- * Handles an error as if it occurred within the currently executing- * test. This is for mock methods that may be called asynchronously- * and therefore out of the scope of the TestRunner. Previously, this- * error would bubble up to the browser. Now, this method is used- * to tell TestRunner about the error. This should never be called- * by anyplace other than the Mock object.- * @param {Error} error The error object.- * @return {Void}- * @method _handleError- * @private- * @static- */- _handleError: function(error){- - _yuitest_coverfunc("build/test/test.js", "_handleError", 1552);-_yuitest_coverline("build/test/test.js", 1554);-if (this._waiting){- _yuitest_coverline("build/test/test.js", 1555);-this._resumeTest(function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 7)", 1555);-_yuitest_coverline("build/test/test.js", 1556);-throw error;- });- } else {- _yuitest_coverline("build/test/test.js", 1559);-throw error;- } - - },- - /**- * Runs a single test based on the data provided in the node.- * @method _runTest- * @param {TestNode} node The TestNode representing the test to run.- * @return {Void}- * @static- * @private- */- _runTest : function (node) {- - //get relevant information- _yuitest_coverfunc("build/test/test.js", "_runTest", 1572);-_yuitest_coverline("build/test/test.js", 1575);-var testName = node.testObject,- testCase = node.parent.testObject,- test = testCase[testName],- - //get the "should" test cases- shouldIgnore = testName.indexOf("ignore:") === 0 ||- !inGroups(testCase.groups, this._groups) ||- (testCase._should.ignore || {})[testName]; //deprecated- - //figure out if the test should be ignored or not- _yuitest_coverline("build/test/test.js", 1585);-if (shouldIgnore){- - //update results- _yuitest_coverline("build/test/test.js", 1588);-node.parent.results[testName] = { - result: "ignore",- message: "Test ignored",- type: "test",- name: testName.indexOf("ignore:") === 0 ? testName.substring(7) : testName- };- - _yuitest_coverline("build/test/test.js", 1595);-node.parent.results.ignored++;- _yuitest_coverline("build/test/test.js", 1596);-node.parent.results.total++;- - _yuitest_coverline("build/test/test.js", 1598);-this.fire({ type: this.TEST_IGNORE_EVENT, testCase: testCase, testName: testName });- - //some environments don't support setTimeout- _yuitest_coverline("build/test/test.js", 1601);-if (typeof setTimeout != "undefined"){ - _yuitest_coverline("build/test/test.js", 1602);-setTimeout(function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 8)", 1602);-_yuitest_coverline("build/test/test.js", 1603);-YUITest.TestRunner._run();- }, 0); - } else {- _yuitest_coverline("build/test/test.js", 1606);-this._run();- }- - } else {- - //mark the start time- _yuitest_coverline("build/test/test.js", 1612);-node._start = new Date();- - //run the setup- _yuitest_coverline("build/test/test.js", 1615);-this._execNonTestMethod(node.parent, "setUp", false);- - //now call the body of the test- _yuitest_coverline("build/test/test.js", 1618);-this._resumeTest(test); - }- - }, -- //-------------------------------------------------------------------------- // Misc Methods- //------------------------------------------------------------------------- -- /**- * Retrieves the name of the current result set.- * @return {String} The name of the result set.- * @method getName- */- getName: function(){- _yuitest_coverfunc("build/test/test.js", "getName", 1632);-_yuitest_coverline("build/test/test.js", 1633);-return this.masterSuite.name;- }, -- /**- * The name assigned to the master suite of the TestRunner. This is the name- * that is output as the root's name when results are retrieved.- * @param {String} name The name of the result set.- * @return {Void}- * @method setName- */- setName: function(name){- _yuitest_coverfunc("build/test/test.js", "setName", 1643);-_yuitest_coverline("build/test/test.js", 1644);-this.masterSuite.name = name;- }, - - //-------------------------------------------------------------------------- // Public Methods- //------------------------------------------------------------------------- - - /**- * Adds a test suite or test case to the list of test objects to run.- * @param testObject Either a TestCase or a TestSuite that should be run.- * @return {Void}- * @method add- * @static- */- add : function (testObject) {- _yuitest_coverfunc("build/test/test.js", "add", 1658);-_yuitest_coverline("build/test/test.js", 1659);-this.masterSuite.add(testObject);- _yuitest_coverline("build/test/test.js", 1660);-return this;- },- - /**- * Removes all test objects from the runner.- * @return {Void}- * @method clear- * @static- */- clear : function () {- _yuitest_coverfunc("build/test/test.js", "clear", 1669);-_yuitest_coverline("build/test/test.js", 1670);-this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));- },- - /**- * Indicates if the TestRunner is waiting for a test to resume- * @return {Boolean} True if the TestRunner is waiting, false if not.- * @method isWaiting- * @static- */- isWaiting: function() {- _yuitest_coverfunc("build/test/test.js", "isWaiting", 1679);-_yuitest_coverline("build/test/test.js", 1680);-return this._waiting;- },- - /**- * Indicates that the TestRunner is busy running tests and therefore can't- * be stopped and results cannot be gathered.- * @return {Boolean} True if the TestRunner is running, false if not.- * @method isRunning- */- isRunning: function(){- _yuitest_coverfunc("build/test/test.js", "isRunning", 1689);-_yuitest_coverline("build/test/test.js", 1690);-return this._running;- },- - /**- * Returns the last complete results set from the TestRunner. Null is returned- * if the TestRunner is running or no tests have been run.- * @param {Function} format (Optional) A test format to return the results in.- * @return {Object|String} Either the results object or, if a test format is - * passed as the argument, a string representing the results in a specific- * format.- * @method getResults- */- getResults: function(format){- _yuitest_coverfunc("build/test/test.js", "getResults", 1702);-_yuitest_coverline("build/test/test.js", 1703);-if (!this._running && this._lastResults){- _yuitest_coverline("build/test/test.js", 1704);-if (typeof format == "function"){- _yuitest_coverline("build/test/test.js", 1705);-return format(this._lastResults); - } else {- _yuitest_coverline("build/test/test.js", 1707);-return this._lastResults;- }- } else {- _yuitest_coverline("build/test/test.js", 1710);-return null;- }- }, - - /**- * Returns the coverage report for the files that have been executed.- * This returns only coverage information for files that have been- * instrumented using YUI Test Coverage and only those that were run- * in the same pass.- * @param {Function} format (Optional) A coverage format to return results in.- * @return {Object|String} Either the coverage object or, if a coverage- * format is specified, a string representing the results in that format.- * @method getCoverage- */- getCoverage: function(format){- _yuitest_coverfunc("build/test/test.js", "getCoverage", 1724);-_yuitest_coverline("build/test/test.js", 1725);-if (!this._running && typeof _yuitest_coverage == "object"){- _yuitest_coverline("build/test/test.js", 1726);-if (typeof format == "function"){- _yuitest_coverline("build/test/test.js", 1727);-return format(_yuitest_coverage); - } else {- _yuitest_coverline("build/test/test.js", 1729);-return _yuitest_coverage;- }- } else {- _yuitest_coverline("build/test/test.js", 1732);-return null;- } - },- - /**- * Used to continue processing when a method marked with- * "async:" is executed. This should not be used in test- * methods, only in init(). Each argument is a string, and- * when the returned function is executed, the arguments- * are assigned to the context data object using the string- * as the key name (value is the argument itself).- * @private- * @return {Function} A callback function.- * @method callback- */- callback: function(){- _yuitest_coverfunc("build/test/test.js", "callback", 1747);-_yuitest_coverline("build/test/test.js", 1748);-var names = arguments,- data = this._context,- that = this;- - _yuitest_coverline("build/test/test.js", 1752);-return function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 9)", 1752);-_yuitest_coverline("build/test/test.js", 1753);-for (var i=0; i < arguments.length; i++){- _yuitest_coverline("build/test/test.js", 1754);-data[names[i]] = arguments[i];- }- _yuitest_coverline("build/test/test.js", 1756);-that._run();- };- },- - /**- * Resumes the TestRunner after wait() was called.- * @param {Function} segment The function to run as the rest- * of the haulted test.- * @return {Void}- * @method resume- * @static- */- resume : function (segment) {- _yuitest_coverfunc("build/test/test.js", "resume", 1768);-_yuitest_coverline("build/test/test.js", 1769);-if (this._waiting){- _yuitest_coverline("build/test/test.js", 1770);-this._resumeTest(segment || function(){});- } else {- _yuitest_coverline("build/test/test.js", 1772);-throw new Error("resume() called without wait().");- }- },- - /**- * Runs the test suite.- * @param {Object|Boolean} options (Optional) Options for the runner:- * <code>oldMode</code> indicates the TestRunner should work in the YUI <= 2.8 way- * of internally managing test suites. <code>groups</code> is an array- * of test groups indicating which tests to run.- * @return {Void}- * @method run- * @static- */- run : function (options) {-- _yuitest_coverfunc("build/test/test.js", "run", 1786);-_yuitest_coverline("build/test/test.js", 1788);-options = options || {};- - //pointer to runner to avoid scope issues - _yuitest_coverline("build/test/test.js", 1791);-var runner = YUITest.TestRunner,- oldMode = options.oldMode;- - - //if there's only one suite on the masterSuite, move it up- _yuitest_coverline("build/test/test.js", 1796);-if (!oldMode && this.masterSuite.items.length == 1 && this.masterSuite.items[0] instanceof YUITest.TestSuite){- _yuitest_coverline("build/test/test.js", 1797);-this.masterSuite = this.masterSuite.items[0];- } - - //determine if there are any groups to filter on- _yuitest_coverline("build/test/test.js", 1801);-runner._groups = (options.groups instanceof Array) ? "," + options.groups.join(",") + "," : "";- - //initialize the runner- _yuitest_coverline("build/test/test.js", 1804);-runner._buildTestTree();- _yuitest_coverline("build/test/test.js", 1805);-runner._context = {};- _yuitest_coverline("build/test/test.js", 1806);-runner._root._start = new Date();- - //fire the begin event- _yuitest_coverline("build/test/test.js", 1809);-runner.fire(runner.BEGIN_EVENT);- - //begin the testing- _yuitest_coverline("build/test/test.js", 1812);-runner._run();- } - });- - _yuitest_coverline("build/test/test.js", 1816);-return new TestRunner();- - }();--/**- * The ArrayAssert object provides functions to test JavaScript array objects- * for a variety of cases.- * @namespace Test- * @module test- * @class ArrayAssert- * @static- */- -_yuitest_coverline("build/test/test.js", 1829);-YUITest.ArrayAssert = {-- //=========================================================================- // Private methods- //=========================================================================- - /**- * Simple indexOf() implementation for an array. Defers to native- * if available.- * @param {Array} haystack The array to search.- * @param {Variant} needle The value to locate.- * @return {int} The index of the needle if found or -1 if not.- * @method _indexOf- * @private- */- _indexOf: function(haystack, needle){- _yuitest_coverfunc("build/test/test.js", "_indexOf", 1844);-_yuitest_coverline("build/test/test.js", 1845);-if (haystack.indexOf){- _yuitest_coverline("build/test/test.js", 1846);-return haystack.indexOf(needle);- } else {- _yuitest_coverline("build/test/test.js", 1848);-for (var i=0; i < haystack.length; i++){- _yuitest_coverline("build/test/test.js", 1849);-if (haystack[i] === needle){- _yuitest_coverline("build/test/test.js", 1850);-return i;- }- }- _yuitest_coverline("build/test/test.js", 1853);-return -1;- }- },- - /**- * Simple some() implementation for an array. Defers to native- * if available.- * @param {Array} haystack The array to search.- * @param {Function} matcher The function to run on each value.- * @return {Boolean} True if any value, when run through the matcher,- * returns true.- * @method _some- * @private- */- _some: function(haystack, matcher){- _yuitest_coverfunc("build/test/test.js", "_some", 1867);-_yuitest_coverline("build/test/test.js", 1868);-if (haystack.some){- _yuitest_coverline("build/test/test.js", 1869);-return haystack.some(matcher);- } else {- _yuitest_coverline("build/test/test.js", 1871);-for (var i=0; i < haystack.length; i++){- _yuitest_coverline("build/test/test.js", 1872);-if (matcher(haystack[i])){- _yuitest_coverline("build/test/test.js", 1873);-return true;- }- }- _yuitest_coverline("build/test/test.js", 1876);-return false;- }- }, -- /**- * Asserts that a value is present in an array. This uses the triple equals - * sign so no type coercion may occur.- * @param {Object} needle The value that is expected in the array.- * @param {Array} haystack An array of values.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method contains- * @static- */- contains : function (needle, haystack, - message) {- - _yuitest_coverfunc("build/test/test.js", "contains", 1889);-_yuitest_coverline("build/test/test.js", 1892);-YUITest.Assert._increment(); -- _yuitest_coverline("build/test/test.js", 1894);-if (this._indexOf(haystack, needle) == -1){- _yuitest_coverline("build/test/test.js", 1895);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value " + needle + " (" + (typeof needle) + ") not found in array [" + haystack + "]."));- }- },-- /**- * Asserts that a set of values are present in an array. This uses the triple equals - * sign so no type coercion may occur. For this assertion to pass, all values must- * be found.- * @param {Object[]} needles An array of values that are expected in the array.- * @param {Array} haystack An array of values to check.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method containsItems- * @static- */- containsItems : function (needles, haystack, - message) {- _yuitest_coverfunc("build/test/test.js", "containsItems", 1909);-_yuitest_coverline("build/test/test.js", 1911);-YUITest.Assert._increment(); -- //begin checking values- _yuitest_coverline("build/test/test.js", 1914);-for (var i=0; i < needles.length; i++){- _yuitest_coverline("build/test/test.js", 1915);-if (this._indexOf(haystack, needles[i]) == -1){- _yuitest_coverline("build/test/test.js", 1916);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value " + needles[i] + " (" + (typeof needles[i]) + ") not found in array [" + haystack + "]."));- }- }- },-- /**- * Asserts that a value matching some condition is present in an array. This uses- * a function to determine a match.- * @param {Function} matcher A function that returns true if the items matches or false if not.- * @param {Array} haystack An array of values.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method containsMatch- * @static- */- containsMatch : function (matcher, haystack, - message) {- - _yuitest_coverfunc("build/test/test.js", "containsMatch", 1930);-_yuitest_coverline("build/test/test.js", 1933);-YUITest.Assert._increment(); - //check for valid matcher- _yuitest_coverline("build/test/test.js", 1935);-if (typeof matcher != "function"){- _yuitest_coverline("build/test/test.js", 1936);-throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");- }- - _yuitest_coverline("build/test/test.js", 1939);-if (!this._some(haystack, matcher)){- _yuitest_coverline("build/test/test.js", 1940);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "No match found in array [" + haystack + "]."));- }- },-- /**- * Asserts that a value is not present in an array. This uses the triple equals - * Asserts that a value is not present in an array. This uses the triple equals - * sign so no type coercion may occur.- * @param {Object} needle The value that is expected in the array.- * @param {Array} haystack An array of values.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method doesNotContain- * @static- */- doesNotContain : function (needle, haystack, - message) {- - _yuitest_coverfunc("build/test/test.js", "doesNotContain", 1954);-_yuitest_coverline("build/test/test.js", 1957);-YUITest.Assert._increment(); -- _yuitest_coverline("build/test/test.js", 1959);-if (this._indexOf(haystack, needle) > -1){- _yuitest_coverline("build/test/test.js", 1960);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));- }- },-- /**- * Asserts that a set of values are not present in an array. This uses the triple equals - * sign so no type coercion may occur. For this assertion to pass, all values must- * not be found.- * @param {Object[]} needles An array of values that are not expected in the array.- * @param {Array} haystack An array of values to check.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method doesNotContainItems- * @static- */- doesNotContainItems : function (needles, haystack, - message) {-- _yuitest_coverfunc("build/test/test.js", "doesNotContainItems", 1974);-_yuitest_coverline("build/test/test.js", 1977);-YUITest.Assert._increment(); -- _yuitest_coverline("build/test/test.js", 1979);-for (var i=0; i < needles.length; i++){- _yuitest_coverline("build/test/test.js", 1980);-if (this._indexOf(haystack, needles[i]) > -1){- _yuitest_coverline("build/test/test.js", 1981);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));- }- }-- },- - /**- * Asserts that no values matching a condition are present in an array. This uses- * a function to determine a match.- * @param {Function} matcher A function that returns true if the item matches or false if not.- * @param {Array} haystack An array of values.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method doesNotContainMatch- * @static- */- doesNotContainMatch : function (matcher, haystack, - message) {- - _yuitest_coverfunc("build/test/test.js", "doesNotContainMatch", 1996);-_yuitest_coverline("build/test/test.js", 1999);-YUITest.Assert._increment(); - - //check for valid matcher- _yuitest_coverline("build/test/test.js", 2002);-if (typeof matcher != "function"){- _yuitest_coverline("build/test/test.js", 2003);-throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");- }- - _yuitest_coverline("build/test/test.js", 2006);-if (this._some(haystack, matcher)){- _yuitest_coverline("build/test/test.js", 2007);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));- }- },- - /**- * Asserts that the given value is contained in an array at the specified index.- * This uses the triple equals sign so no type coercion will occur.- * @param {Object} needle The value to look for.- * @param {Array} haystack The array to search in.- * @param {int} index The index at which the value should exist.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method indexOf- * @static- */- indexOf : function (needle, haystack, index, message) {- - _yuitest_coverfunc("build/test/test.js", "indexOf", 2021);-_yuitest_coverline("build/test/test.js", 2023);-YUITest.Assert._increment(); -- //try to find the value in the array- _yuitest_coverline("build/test/test.js", 2026);-for (var i=0; i < haystack.length; i++){- _yuitest_coverline("build/test/test.js", 2027);-if (haystack[i] === needle){- _yuitest_coverline("build/test/test.js", 2028);-if (index != i){- _yuitest_coverline("build/test/test.js", 2029);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value exists at index " + i + " but should be at index " + index + ".")); - }- _yuitest_coverline("build/test/test.js", 2031);-return;- }- }- - //if it makes it here, it wasn't found at all- _yuitest_coverline("build/test/test.js", 2036);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value doesn't exist in array [" + haystack + "]."));- },- - /**- * Asserts that the values in an array are equal, and in the same position,- * as values in another array. This uses the double equals sign- * so type coercion may occur. Note that the array objects themselves- * need not be the same for this test to pass.- * @param {Array} expected An array of the expected values.- * @param {Array} actual Any array of the actual values.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method itemsAreEqual- * @static- */- itemsAreEqual : function (expected, actual, - message) {- - _yuitest_coverfunc("build/test/test.js", "itemsAreEqual", 2050);-_yuitest_coverline("build/test/test.js", 2053);-YUITest.Assert._increment(); - - //first make sure they're array-like (this can probably be improved)- _yuitest_coverline("build/test/test.js", 2056);-if (typeof expected != "object" || typeof actual != "object"){- _yuitest_coverline("build/test/test.js", 2057);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value should be an array."));- }- - //next check array length- _yuitest_coverline("build/test/test.js", 2061);-if (expected.length != actual.length){- _yuitest_coverline("build/test/test.js", 2062);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length + "."));- }- - //begin checking values- _yuitest_coverline("build/test/test.js", 2066);-for (var i=0; i < expected.length; i++){- _yuitest_coverline("build/test/test.js", 2067);-if (expected[i] != actual[i]){- _yuitest_coverline("build/test/test.js", 2068);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not equal."), expected[i], actual[i]);- }- }- },- - /**- * Asserts that the values in an array are equivalent, and in the same position,- * as values in another array. This uses a function to determine if the values- * are equivalent. Note that the array objects themselves- * need not be the same for this test to pass.- * @param {Array} expected An array of the expected values.- * @param {Array} actual Any array of the actual values.- * @param {Function} comparator A function that returns true if the values are equivalent- * or false if not.- * @param {String} message (Optional) The message to display if the assertion fails.- * @return {Void}- * @method itemsAreEquivalent- * @static- */- itemsAreEquivalent : function (expected, actual, - comparator, message) {- - _yuitest_coverfunc("build/test/test.js", "itemsAreEquivalent", 2087);-_yuitest_coverline("build/test/test.js", 2090);-YUITest.Assert._increment(); -- //make sure the comparator is valid- _yuitest_coverline("build/test/test.js", 2093);-if (typeof comparator != "function"){- _yuitest_coverline("build/test/test.js", 2094);-throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");- }- - //first check array length- _yuitest_coverline("build/test/test.js", 2098);-if (expected.length != actual.length){- _yuitest_coverline("build/test/test.js", 2099);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length));- }- - //begin checking values- _yuitest_coverline("build/test/test.js", 2103);-for (var i=0; i < expected.length; i++){- _yuitest_coverline("build/test/test.js", 2104);-if (!comparator(expected[i], actual[i])){- _yuitest_coverline("build/test/test.js", 2105);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not equivalent."), expected[i], actual[i]);- }- }- },- - /**- * Asserts that an array is empty.- * @param {Array} actual The array to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isEmpty- * @static- */- isEmpty : function (actual, message) { - _yuitest_coverfunc("build/test/test.js", "isEmpty", 2117);-_yuitest_coverline("build/test/test.js", 2118);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 2119);-if (actual.length > 0){- _yuitest_coverline("build/test/test.js", 2120);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should be empty."));- }- }, - - /**- * Asserts that an array is not empty.- * @param {Array} actual The array to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNotEmpty- * @static- */- isNotEmpty : function (actual, message) { - _yuitest_coverfunc("build/test/test.js", "isNotEmpty", 2131);-_yuitest_coverline("build/test/test.js", 2132);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 2133);-if (actual.length === 0){- _yuitest_coverline("build/test/test.js", 2134);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should not be empty."));- }- }, - - /**- * Asserts that the values in an array are the same, and in the same position,- * as values in another array. This uses the triple equals sign- * so no type coercion will occur. Note that the array objects themselves- * need not be the same for this test to pass.- * @param {Array} expected An array of the expected values.- * @param {Array} actual Any array of the actual values.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method itemsAreSame- * @static- */- itemsAreSame : function (expected, actual, - message) {- - _yuitest_coverfunc("build/test/test.js", "itemsAreSame", 2149);-_yuitest_coverline("build/test/test.js", 2152);-YUITest.Assert._increment(); -- //first check array length- _yuitest_coverline("build/test/test.js", 2155);-if (expected.length != actual.length){- _yuitest_coverline("build/test/test.js", 2156);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length));- }- - //begin checking values- _yuitest_coverline("build/test/test.js", 2160);-for (var i=0; i < expected.length; i++){- _yuitest_coverline("build/test/test.js", 2161);-if (expected[i] !== actual[i]){- _yuitest_coverline("build/test/test.js", 2162);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not the same."), expected[i], actual[i]);- }- }- },- - /**- * Asserts that the given value is contained in an array at the specified index,- * starting from the back of the array.- * This uses the triple equals sign so no type coercion will occur.- * @param {Object} needle The value to look for.- * @param {Array} haystack The array to search in.- * @param {int} index The index at which the value should exist.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method lastIndexOf- * @static- */- lastIndexOf : function (needle, haystack, index, message) {- - //try to find the value in the array- _yuitest_coverfunc("build/test/test.js", "lastIndexOf", 2178);-_yuitest_coverline("build/test/test.js", 2181);-for (var i=haystack.length; i >= 0; i--){- _yuitest_coverline("build/test/test.js", 2182);-if (haystack[i] === needle){- _yuitest_coverline("build/test/test.js", 2183);-if (index != i){- _yuitest_coverline("build/test/test.js", 2184);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value exists at index " + i + " but should be at index " + index + ".")); - }- _yuitest_coverline("build/test/test.js", 2186);-return;- }- }- - //if it makes it here, it wasn't found at all- _yuitest_coverline("build/test/test.js", 2191);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value doesn't exist in array.")); - }- -};- -/**- * The Assert object provides functions to test JavaScript values against- * known and expected results. Whenever a comparison (assertion) fails,- * an error is thrown.- * @namespace Test- * @module test- * @class Assert- * @static- */-_yuitest_coverline("build/test/test.js", 2205);-YUITest.Assert = {-- /**- * The number of assertions performed.- * @property _asserts- * @type int- * @private- */- _asserts: 0,-- //-------------------------------------------------------------------------- // Helper Methods- //-------------------------------------------------------------------------- - /**- * Formats a message so that it can contain the original assertion message- * in addition to the custom message.- * @param {String} customMessage The message passed in by the developer.- * @param {String} defaultMessage The message created by the error by default.- * @return {String} The final error message, containing either or both.- * @protected- * @static- * @method _formatMessage- */- _formatMessage : function (customMessage, defaultMessage) {- _yuitest_coverfunc("build/test/test.js", "_formatMessage", 2229);-_yuitest_coverline("build/test/test.js", 2230);-if (typeof customMessage == "string" && customMessage.length > 0){- _yuitest_coverline("build/test/test.js", 2231);-return customMessage.replace("{message}", defaultMessage);- } else {- _yuitest_coverline("build/test/test.js", 2233);-return defaultMessage;- } - },- - /**- * Returns the number of assertions that have been performed.- * @method _getCount- * @protected- * @static- */- _getCount: function(){- _yuitest_coverfunc("build/test/test.js", "_getCount", 2243);-_yuitest_coverline("build/test/test.js", 2244);-return this._asserts;- },- - /**- * Increments the number of assertions that have been performed.- * @method _increment- * @protected- * @static- */- _increment: function(){- _yuitest_coverfunc("build/test/test.js", "_increment", 2253);-_yuitest_coverline("build/test/test.js", 2254);-this._asserts++;- },- - /**- * Resets the number of assertions that have been performed to 0.- * @method _reset- * @protected- * @static- */- _reset: function(){- _yuitest_coverfunc("build/test/test.js", "_reset", 2263);-_yuitest_coverline("build/test/test.js", 2264);-this._asserts = 0;- },- - //-------------------------------------------------------------------------- // Generic Assertion Methods- //-------------------------------------------------------------------------- - /** - * Forces an assertion error to occur.- * @param {String} message (Optional) The message to display with the failure.- * @method fail- * @static- */- fail : function (message) {- _yuitest_coverfunc("build/test/test.js", "fail", 2277);-_yuitest_coverline("build/test/test.js", 2278);-throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Test force-failed."));- }, - - /** - * A marker that the test should pass.- * @method pass- * @static- */- pass : function (message) {- _yuitest_coverfunc("build/test/test.js", "pass", 2286);-_yuitest_coverline("build/test/test.js", 2287);-YUITest.Assert._increment();- }, - - //-------------------------------------------------------------------------- // Equality Assertion Methods- //------------------------------------------------------------------------- - - /**- * Asserts that a value is equal to another. This uses the double equals sign- * so type coercion may occur.- * @param {Object} expected The expected value.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method areEqual- * @static- */- areEqual : function (expected, actual, message) {- _yuitest_coverfunc("build/test/test.js", "areEqual", 2303);-_yuitest_coverline("build/test/test.js", 2304);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2305);-if (expected != actual) {- _yuitest_coverline("build/test/test.js", 2306);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal."), expected, actual);- }- },- - /**- * Asserts that a value is not equal to another. This uses the double equals sign- * so type coercion may occur.- * @param {Object} unexpected The unexpected value.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method areNotEqual- * @static- */- areNotEqual : function (unexpected, actual, - message) {- _yuitest_coverfunc("build/test/test.js", "areNotEqual", 2319);-_yuitest_coverline("build/test/test.js", 2321);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2322);-if (unexpected == actual) {- _yuitest_coverline("build/test/test.js", 2323);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be equal."), unexpected);- }- },- - /**- * Asserts that a value is not the same as another. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} unexpected The unexpected value.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method areNotSame- * @static- */- areNotSame : function (unexpected, actual, message) {- _yuitest_coverfunc("build/test/test.js", "areNotSame", 2336);-_yuitest_coverline("build/test/test.js", 2337);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2338);-if (unexpected === actual) {- _yuitest_coverline("build/test/test.js", 2339);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be the same."), unexpected);- }- },-- /**- * Asserts that a value is the same as another. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} expected The expected value.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method areSame- * @static- */- areSame : function (expected, actual, message) {- _yuitest_coverfunc("build/test/test.js", "areSame", 2352);-_yuitest_coverline("build/test/test.js", 2353);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2354);-if (expected !== actual) {- _yuitest_coverline("build/test/test.js", 2355);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be the same."), expected, actual);- }- }, - - //-------------------------------------------------------------------------- // Boolean Assertion Methods- //------------------------------------------------------------------------- - - /**- * Asserts that a value is false. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isFalse- * @static- */- isFalse : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isFalse", 2371);-_yuitest_coverline("build/test/test.js", 2372);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2373);-if (false !== actual) {- _yuitest_coverline("build/test/test.js", 2374);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be false."), false, actual);- }- },- - /**- * Asserts that a value is true. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isTrue- * @static- */- isTrue : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isTrue", 2386);-_yuitest_coverline("build/test/test.js", 2387);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2388);-if (true !== actual) {- _yuitest_coverline("build/test/test.js", 2389);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be true."), true, actual);- }-- },- - //-------------------------------------------------------------------------- // Special Value Assertion Methods- //------------------------------------------------------------------------- - - /**- * Asserts that a value is not a number.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNaN- * @static- */- isNaN : function (actual, message){- _yuitest_coverfunc("build/test/test.js", "isNaN", 2405);-_yuitest_coverline("build/test/test.js", 2406);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2407);-if (!isNaN(actual)){- _yuitest_coverline("build/test/test.js", 2408);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be NaN."), NaN, actual);- } - },- - /**- * Asserts that a value is not the special NaN value.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNotNaN- * @static- */- isNotNaN : function (actual, message){- _yuitest_coverfunc("build/test/test.js", "isNotNaN", 2419);-_yuitest_coverline("build/test/test.js", 2420);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2421);-if (isNaN(actual)){- _yuitest_coverline("build/test/test.js", 2422);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be NaN."), NaN);- } - },- - /**- * Asserts that a value is not null. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNotNull- * @static- */- isNotNull : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isNotNull", 2434);-_yuitest_coverline("build/test/test.js", 2435);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2436);-if (actual === null) {- _yuitest_coverline("build/test/test.js", 2437);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be null."), null);- }- },-- /**- * Asserts that a value is not undefined. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNotUndefined- * @static- */- isNotUndefined : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isNotUndefined", 2449);-_yuitest_coverline("build/test/test.js", 2450);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2451);-if (typeof actual == "undefined") {- _yuitest_coverline("build/test/test.js", 2452);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should not be undefined."), undefined);- }- },-- /**- * Asserts that a value is null. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNull- * @static- */- isNull : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isNull", 2464);-_yuitest_coverline("build/test/test.js", 2465);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2466);-if (actual !== null) {- _yuitest_coverline("build/test/test.js", 2467);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be null."), null, actual);- }- },- - /**- * Asserts that a value is undefined. This uses the triple equals sign- * so no type coercion may occur.- * @param {Object} actual The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isUndefined- * @static- */- isUndefined : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isUndefined", 2479);-_yuitest_coverline("build/test/test.js", 2480);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2481);-if (typeof actual != "undefined") {- _yuitest_coverline("build/test/test.js", 2482);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be undefined."), undefined, actual);- }- }, - - //--------------------------------------------------------------------------- // Instance Assertion Methods- //-------------------------------------------------------------------------- - - /**- * Asserts that a value is an array.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isArray- * @static- */- isArray : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isArray", 2497);-_yuitest_coverline("build/test/test.js", 2498);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2499);-var shouldFail = false;- _yuitest_coverline("build/test/test.js", 2500);-if (Array.isArray){- _yuitest_coverline("build/test/test.js", 2501);-shouldFail = !Array.isArray(actual);- } else {- _yuitest_coverline("build/test/test.js", 2503);-shouldFail = Object.prototype.toString.call(actual) != "[object Array]";- }- _yuitest_coverline("build/test/test.js", 2505);-if (shouldFail){- _yuitest_coverline("build/test/test.js", 2506);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an array."), actual);- } - },- - /**- * Asserts that a value is a Boolean.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isBoolean- * @static- */- isBoolean : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isBoolean", 2517);-_yuitest_coverline("build/test/test.js", 2518);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2519);-if (typeof actual != "boolean"){- _yuitest_coverline("build/test/test.js", 2520);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a Boolean."), actual);- } - },- - /**- * Asserts that a value is a function.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isFunction- * @static- */- isFunction : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isFunction", 2531);-_yuitest_coverline("build/test/test.js", 2532);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2533);-if (!(actual instanceof Function)){- _yuitest_coverline("build/test/test.js", 2534);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a function."), actual);- } - },- - /**- * Asserts that a value is an instance of a particular object. This may return- * incorrect results when comparing objects from one frame to constructors in- * another frame. For best results, don't use in a cross-frame manner.- * @param {Function} expected The function that the object should be an instance of.- * @param {Object} actual The object to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isInstanceOf- * @static- */- isInstanceOf : function (expected, actual, message) {- _yuitest_coverfunc("build/test/test.js", "isInstanceOf", 2548);-_yuitest_coverline("build/test/test.js", 2549);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2550);-if (!(actual instanceof expected)){- _yuitest_coverline("build/test/test.js", 2551);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value isn't an instance of expected type."), expected, actual);- }- },- - /**- * Asserts that a value is a number.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isNumber- * @static- */- isNumber : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isNumber", 2562);-_yuitest_coverline("build/test/test.js", 2563);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2564);-if (typeof actual != "number"){- _yuitest_coverline("build/test/test.js", 2565);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a number."), actual);- } - }, - - /**- * Asserts that a value is an object.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isObject- * @static- */- isObject : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isObject", 2576);-_yuitest_coverline("build/test/test.js", 2577);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2578);-if (!actual || (typeof actual != "object" && typeof actual != "function")){- _yuitest_coverline("build/test/test.js", 2579);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an object."), actual);- }- },- - /**- * Asserts that a value is a string.- * @param {Object} actual The value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isString- * @static- */- isString : function (actual, message) {- _yuitest_coverfunc("build/test/test.js", "isString", 2590);-_yuitest_coverline("build/test/test.js", 2591);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2592);-if (typeof actual != "string"){- _yuitest_coverline("build/test/test.js", 2593);-throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a string."), actual);- }- },- - /**- * Asserts that a value is of a particular type. - * @param {String} expectedType The expected type of the variable.- * @param {Object} actualValue The actual value to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method isTypeOf- * @static- */- isTypeOf : function (expectedType, actualValue, message){- _yuitest_coverfunc("build/test/test.js", "isTypeOf", 2605);-_yuitest_coverline("build/test/test.js", 2606);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2607);-if (typeof actualValue != expectedType){- _yuitest_coverline("build/test/test.js", 2608);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be of type " + expectedType + "."), expectedType, typeof actualValue);- }- },- - //--------------------------------------------------------------------------- // Error Detection Methods- //-------------------------------------------------------------------------- - - /**- * Asserts that executing a particular method should throw an error of- * a specific type. This is a replacement for _should.error.- * @param {String|Function|Object} expectedError If a string, this- * is the error message that the error must have; if a function, this- * is the constructor that should have been used to create the thrown- * error; if an object, this is an instance of a particular error type- * with a specific error message (both must match).- * @param {Function} method The method to execute that should throw the error.- * @param {String} message (Optional) The message to display if the assertion- * fails.- * @method throwsError- * @return {void}- * @static- */- throwsError: function(expectedError, method, message){- _yuitest_coverfunc("build/test/test.js", "throwsError", 2631);-_yuitest_coverline("build/test/test.js", 2632);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2633);-var error = false;- - _yuitest_coverline("build/test/test.js", 2635);-try {- _yuitest_coverline("build/test/test.js", 2636);-method(); - } catch (thrown) {- - //check to see what type of data we have- _yuitest_coverline("build/test/test.js", 2640);-if (typeof expectedError == "string"){- - //if it's a string, check the error message- _yuitest_coverline("build/test/test.js", 2643);-if (thrown.message != expectedError){- _yuitest_coverline("build/test/test.js", 2644);-error = true;- }- } else {_yuitest_coverline("build/test/test.js", 2646);-if (typeof expectedError == "function"){- - //if it's a function, see if the error is an instance of it- _yuitest_coverline("build/test/test.js", 2649);-if (!(thrown instanceof expectedError)){- _yuitest_coverline("build/test/test.js", 2650);-error = true;- }- - } else {_yuitest_coverline("build/test/test.js", 2653);-if (typeof expectedError == "object" && expectedError !== null){- - //if it's an object, check the instance and message- _yuitest_coverline("build/test/test.js", 2656);-if (!(thrown instanceof expectedError.constructor) || - thrown.message != expectedError.message){- _yuitest_coverline("build/test/test.js", 2658);-error = true;- }- - } else { //if it gets here, the argument could be wrong- _yuitest_coverline("build/test/test.js", 2662);-error = true;- }}}- - _yuitest_coverline("build/test/test.js", 2665);-if (error){- _yuitest_coverline("build/test/test.js", 2666);-throw new YUITest.UnexpectedError(thrown); - } else {- _yuitest_coverline("build/test/test.js", 2668);-return;- }- }- - //if it reaches here, the error wasn't thrown, which is a bad thing- _yuitest_coverline("build/test/test.js", 2673);-throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Error should have been thrown."));- }--};-/**- * Error is thrown whenever an assertion fails. It provides methods- * to more easily get at error information and also provides a base class- * from which more specific assertion errors can be derived.- *- * @param {String} message The message to display when the error occurs.- * @namespace Test- * @module test- * @class AssertionError- * @constructor- */ -_yuitest_coverline("build/test/test.js", 2688);-YUITest.AssertionError = function (message){- - /**- * Error message. Must be duplicated to ensure browser receives it.- * @type String- * @property message- */- _yuitest_coverfunc("build/test/test.js", "AssertionError", 2688);-_yuitest_coverline("build/test/test.js", 2695);-this.message = message;- - /**- * The name of the error that occurred.- * @type String- * @property name- */- _yuitest_coverline("build/test/test.js", 2702);-this.name = "Assert Error";-};--_yuitest_coverline("build/test/test.js", 2705);-YUITest.AssertionError.prototype = {-- //restore constructor- constructor: YUITest.AssertionError,-- /**- * Returns a fully formatted error for an assertion failure. This should- * be overridden by all subclasses to provide specific information.- * @method getMessage- * @return {String} A string describing the error.- */- getMessage : function () {- _yuitest_coverfunc("build/test/test.js", "getMessage", 2716);-_yuitest_coverline("build/test/test.js", 2717);-return this.message;- },- - /**- * Returns a string representation of the error.- * @method toString- * @return {String} A string representation of the error.- */- toString : function () {- _yuitest_coverfunc("build/test/test.js", "toString", 2725);-_yuitest_coverline("build/test/test.js", 2726);-return this.name + ": " + this.getMessage();- }--};/**- * ComparisonFailure is subclass of Error that is thrown whenever- * a comparison between two values fails. It provides mechanisms to retrieve- * both the expected and actual value.- *- * @param {String} message The message to display when the error occurs.- * @param {Object} expected The expected value.- * @param {Object} actual The actual value that caused the assertion to fail.- * @namespace Test - * @extends AssertionError- * @module test- * @class ComparisonFailure- * @constructor- */ -_yuitest_coverline("build/test/test.js", 2743);-YUITest.ComparisonFailure = function (message, expected, actual){-- //call superclass- _yuitest_coverfunc("build/test/test.js", "ComparisonFailure", 2743);-_yuitest_coverline("build/test/test.js", 2746);-YUITest.AssertionError.call(this, message);- - /**- * The expected value.- * @type Object- * @property expected- */- _yuitest_coverline("build/test/test.js", 2753);-this.expected = expected;- - /**- * The actual value.- * @type Object- * @property actual- */- _yuitest_coverline("build/test/test.js", 2760);-this.actual = actual;- - /**- * The name of the error that occurred.- * @type String- * @property name- */- _yuitest_coverline("build/test/test.js", 2767);-this.name = "ComparisonFailure";- -};--//inherit from YUITest.AssertionError-_yuitest_coverline("build/test/test.js", 2772);-YUITest.ComparisonFailure.prototype = new YUITest.AssertionError;--//restore constructor-_yuitest_coverline("build/test/test.js", 2775);-YUITest.ComparisonFailure.prototype.constructor = YUITest.ComparisonFailure;--/**- * Returns a fully formatted error for an assertion failure. This message- * provides information about the expected and actual values.- * @method getMessage- * @return {String} A string describing the error.- */-_yuitest_coverline("build/test/test.js", 2783);-YUITest.ComparisonFailure.prototype.getMessage = function(){- _yuitest_coverfunc("build/test/test.js", "getMessage", 2783);-_yuitest_coverline("build/test/test.js", 2784);-return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")" +- "\nActual: " + this.actual + " (" + (typeof this.actual) + ")";-};-/**- * An object object containing coverage result formatting methods.- * @namespace Test- * @module test- * @class CoverageFormat- * @static- */-_yuitest_coverline("build/test/test.js", 2794);-YUITest.CoverageFormat = {-- /**- * Returns the coverage report in JSON format. This is the straight- * JSON representation of the native coverage report.- * @param {Object} coverage The coverage report object.- * @return {String} A JSON-formatted string of coverage data.- * @method JSON- * @namespace Test.CoverageFormat- */- JSON: function(coverage){- _yuitest_coverfunc("build/test/test.js", "JSON", 2804);-_yuitest_coverline("build/test/test.js", 2805);-return YUITest.Util.JSON.stringify(coverage);- },- - /**- * Returns the coverage report in a JSON format compatible with- * Xdebug. See <a href="http://www.xdebug.com/docs/code_coverage">Xdebug Documentation</a>- * for more information. Note: function coverage is not available- * in this format.- * @param {Object} coverage The coverage report object.- * @return {String} A JSON-formatted string of coverage data.- * @method XdebugJSON- * @namespace Test.CoverageFormat- */ - XdebugJSON: function(coverage){- - _yuitest_coverfunc("build/test/test.js", "XdebugJSON", 2818);-_yuitest_coverline("build/test/test.js", 2820);-var report = {};- _yuitest_coverline("build/test/test.js", 2821);-for (var prop in coverage){- _yuitest_coverline("build/test/test.js", 2822);-if (coverage.hasOwnProperty(prop)){- _yuitest_coverline("build/test/test.js", 2823);-report[prop] = coverage[prop].lines;- }- }-- _yuitest_coverline("build/test/test.js", 2827);-return YUITest.Util.JSON.stringify(coverage);- }--};--/**- * The DateAssert object provides functions to test JavaScript Date objects- * for a variety of cases.- * @namespace Test- * @module test- * @class DateAssert- * @static- */- -_yuitest_coverline("build/test/test.js", 2841);-YUITest.DateAssert = {-- /**- * Asserts that a date's month, day, and year are equal to another date's.- * @param {Date} expected The expected date.- * @param {Date} actual The actual date to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method datesAreEqual- * @static- */- datesAreEqual : function (expected, actual, message){- _yuitest_coverfunc("build/test/test.js", "datesAreEqual", 2851);-_yuitest_coverline("build/test/test.js", 2852);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 2853);-if (expected instanceof Date && actual instanceof Date){- _yuitest_coverline("build/test/test.js", 2854);-var msg = "";- - //check years first- _yuitest_coverline("build/test/test.js", 2857);-if (expected.getFullYear() != actual.getFullYear()){- _yuitest_coverline("build/test/test.js", 2858);-msg = "Years should be equal.";- }- - //now check months- _yuitest_coverline("build/test/test.js", 2862);-if (expected.getMonth() != actual.getMonth()){- _yuitest_coverline("build/test/test.js", 2863);-msg = "Months should be equal.";- } - - //last, check the day of the month- _yuitest_coverline("build/test/test.js", 2867);-if (expected.getDate() != actual.getDate()){- _yuitest_coverline("build/test/test.js", 2868);-msg = "Days of month should be equal.";- } - - _yuitest_coverline("build/test/test.js", 2871);-if (msg.length){- _yuitest_coverline("build/test/test.js", 2872);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);- }- } else {- _yuitest_coverline("build/test/test.js", 2875);-throw new TypeError("YUITest.DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");- }- },-- /**- * Asserts that a date's hour, minutes, and seconds are equal to another date's.- * @param {Date} expected The expected date.- * @param {Date} actual The actual date to test.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method timesAreEqual- * @static- */- timesAreEqual : function (expected, actual, message){- _yuitest_coverfunc("build/test/test.js", "timesAreEqual", 2887);-_yuitest_coverline("build/test/test.js", 2888);-YUITest.Assert._increment();- _yuitest_coverline("build/test/test.js", 2889);-if (expected instanceof Date && actual instanceof Date){- _yuitest_coverline("build/test/test.js", 2890);-var msg = "";- - //check hours first- _yuitest_coverline("build/test/test.js", 2893);-if (expected.getHours() != actual.getHours()){- _yuitest_coverline("build/test/test.js", 2894);-msg = "Hours should be equal.";- }- - //now check minutes- _yuitest_coverline("build/test/test.js", 2898);-if (expected.getMinutes() != actual.getMinutes()){- _yuitest_coverline("build/test/test.js", 2899);-msg = "Minutes should be equal.";- } - - //last, check the seconds- _yuitest_coverline("build/test/test.js", 2903);-if (expected.getSeconds() != actual.getSeconds()){- _yuitest_coverline("build/test/test.js", 2904);-msg = "Seconds should be equal.";- } - - _yuitest_coverline("build/test/test.js", 2907);-if (msg.length){- _yuitest_coverline("build/test/test.js", 2908);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);- }- } else {- _yuitest_coverline("build/test/test.js", 2911);-throw new TypeError("YUITest.DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");- }- }- -};/**- * Creates a new mock object.- * @namespace Test- * @module test- * @class Mock- * @constructor- * @param {Object} template (Optional) An object whose methods- * should be stubbed out on the mock object.- */-_yuitest_coverline("build/test/test.js", 2924);-YUITest.Mock = function(template){-- //use blank object is nothing is passed in- _yuitest_coverfunc("build/test/test.js", "Mock", 2924);-_yuitest_coverline("build/test/test.js", 2927);-template = template || {};- - _yuitest_coverline("build/test/test.js", 2929);-var mock,- name;- - //try to create mock that keeps prototype chain intact- //fails in the case of ActiveX objects- _yuitest_coverline("build/test/test.js", 2934);-try {- _yuitest_coverline("build/test/test.js", 2935);-function f(){}- _yuitest_coverline("build/test/test.js", 2936);-f.prototype = template;- _yuitest_coverline("build/test/test.js", 2937);-mock = new f();- } catch (ex) {- _yuitest_coverline("build/test/test.js", 2939);-mock = {};- }-- //create stubs for all methods- _yuitest_coverline("build/test/test.js", 2943);-for (name in template){- _yuitest_coverline("build/test/test.js", 2944);-if (template.hasOwnProperty(name)){- _yuitest_coverline("build/test/test.js", 2945);-if (typeof template[name] == "function"){- _yuitest_coverline("build/test/test.js", 2946);-mock[name] = function(name){- _yuitest_coverfunc("build/test/test.js", "]", 2946);-_yuitest_coverline("build/test/test.js", 2947);-return function(){- _yuitest_coverfunc("build/test/test.js", "(anonymous 11)", 2947);-_yuitest_coverline("build/test/test.js", 2948);-YUITest.Assert.fail("Method " + name + "() was called but was not expected to be.");- };- }(name);- }- }- }-- //return it- _yuitest_coverline("build/test/test.js", 2956);-return mock; -};- -/**- * Assigns an expectation to a mock object. This is used to create- * methods and properties on the mock object that are monitored for- * calls and changes, respectively.- * @param {Object} mock The object to add the expectation to.- * @param {Object} expectation An object defining the expectation. For- * properties, the keys "property" and "value" are required. For a- * method the "method" key defines the method's name, the optional "args"- * key provides an array of argument types. The "returns" key provides- * an optional return value. An optional "run" key provides a function- * to be used as the method body. The return value of a mocked method is- * determined first by the "returns" key, then the "run" function's return- * value. If neither "returns" nor "run" is provided undefined is returned.- * An optional 'error' key defines an error type to be thrown in all cases.- * The "callCount" key provides an optional number of times the method is- * expected to be called (the default is 1).- * @return {void}- * @method expect- * @static- */ -_yuitest_coverline("build/test/test.js", 2979);-YUITest.Mock.expect = function(mock /*:Object*/, expectation /*:Object*/){-- //make sure there's a place to store the expectations- _yuitest_coverfunc("build/test/test.js", "expect", 2979);-_yuitest_coverline("build/test/test.js", 2982);-if (!mock.__expectations) {- _yuitest_coverline("build/test/test.js", 2983);-mock.__expectations = {};- }-- //method expectation- _yuitest_coverline("build/test/test.js", 2987);-if (expectation.method){- _yuitest_coverline("build/test/test.js", 2988);-var name = expectation.method,- args = expectation.args || [],- result = expectation.returns,- callCount = (typeof expectation.callCount == "number") ? expectation.callCount : 1,- error = expectation.error,- run = expectation.run || function(){},- runResult,- i;-- //save expectations- _yuitest_coverline("build/test/test.js", 2998);-mock.__expectations[name] = expectation;- _yuitest_coverline("build/test/test.js", 2999);-expectation.callCount = callCount;- _yuitest_coverline("build/test/test.js", 3000);-expectation.actualCallCount = 0;- - //process arguments- _yuitest_coverline("build/test/test.js", 3003);-for (i=0; i < args.length; i++){- _yuitest_coverline("build/test/test.js", 3004);-if (!(args[i] instanceof YUITest.Mock.Value)){- _yuitest_coverline("build/test/test.js", 3005);-args[i] = YUITest.Mock.Value(YUITest.Assert.areSame, [args[i]], "Argument " + i + " of " + name + "() is incorrect.");- } - }- - //if the method is expected to be called- _yuitest_coverline("build/test/test.js", 3010);-if (callCount > 0){- _yuitest_coverline("build/test/test.js", 3011);-mock[name] = function(){ - _yuitest_coverfunc("build/test/test.js", "]", 3011);-_yuitest_coverline("build/test/test.js", 3012);-try {- _yuitest_coverline("build/test/test.js", 3013);-expectation.actualCallCount++;- _yuitest_coverline("build/test/test.js", 3014);-YUITest.Assert.areEqual(args.length, arguments.length, "Method " + name + "() passed incorrect number of arguments.");- _yuitest_coverline("build/test/test.js", 3015);-for (var i=0, len=args.length; i < len; i++){- _yuitest_coverline("build/test/test.js", 3016);-args[i].verify(arguments[i]);- } -- _yuitest_coverline("build/test/test.js", 3019);-runResult = run.apply(this, arguments);- - _yuitest_coverline("build/test/test.js", 3021);-if (error){- _yuitest_coverline("build/test/test.js", 3022);-throw error;- }- } catch (ex){- //route through TestRunner for proper handling- _yuitest_coverline("build/test/test.js", 3026);-YUITest.TestRunner._handleError(ex);- }-- // Any value provided for 'returns' overrides any value returned- // by our 'run' function. - _yuitest_coverline("build/test/test.js", 3031);-return expectation.hasOwnProperty('returns') ? result : runResult;- };- } else {- - //method should fail if called when not expected- _yuitest_coverline("build/test/test.js", 3036);-mock[name] = function(){- _yuitest_coverfunc("build/test/test.js", "]", 3036);-_yuitest_coverline("build/test/test.js", 3037);-try {- _yuitest_coverline("build/test/test.js", 3038);-YUITest.Assert.fail("Method " + name + "() should not have been called.");- } catch (ex){- //route through TestRunner for proper handling- _yuitest_coverline("build/test/test.js", 3041);-YUITest.TestRunner._handleError(ex);- } - };- }- } else {_yuitest_coverline("build/test/test.js", 3045);-if (expectation.property){- //save expectations- _yuitest_coverline("build/test/test.js", 3047);-mock.__expectations[expectation.property] = expectation;- }}-};--/**- * Verifies that all expectations of a mock object have been met and- * throws an assertion error if not.- * @param {Object} mock The object to verify..- * @return {void}- * @method verify- * @static- */ -_yuitest_coverline("build/test/test.js", 3059);-YUITest.Mock.verify = function(mock){ - _yuitest_coverfunc("build/test/test.js", "verify", 3059);-_yuitest_coverline("build/test/test.js", 3060);-try {- - _yuitest_coverline("build/test/test.js", 3062);-for (var name in mock.__expectations){- _yuitest_coverline("build/test/test.js", 3063);-if (mock.__expectations.hasOwnProperty(name)){- _yuitest_coverline("build/test/test.js", 3064);-var expectation = mock.__expectations[name];- _yuitest_coverline("build/test/test.js", 3065);-if (expectation.method) {- _yuitest_coverline("build/test/test.js", 3066);-YUITest.Assert.areEqual(expectation.callCount, expectation.actualCallCount, "Method " + expectation.method + "() wasn't called the expected number of times.");- } else {_yuitest_coverline("build/test/test.js", 3067);-if (expectation.property){- _yuitest_coverline("build/test/test.js", 3068);-YUITest.Assert.areEqual(expectation.value, mock[expectation.property], "Property " + expectation.property + " wasn't set to the correct value."); - }} - }- }-- } catch (ex){- //route through TestRunner for proper handling- _yuitest_coverline("build/test/test.js", 3075);-YUITest.TestRunner._handleError(ex);- }-};--/**- * Creates a new value matcher.- * @param {Function} method The function to call on the value.- * @param {Array} originalArgs (Optional) Array of arguments to pass to the method.- * @param {String} message (Optional) Message to display in case of failure.- * @namespace Test.Mock- * @module test- * @class Value- * @constructor- */-_yuitest_coverline("build/test/test.js", 3089);-YUITest.Mock.Value = function(method, originalArgs, message){- _yuitest_coverfunc("build/test/test.js", "Value", 3089);-_yuitest_coverline("build/test/test.js", 3090);-if (this instanceof YUITest.Mock.Value){- _yuitest_coverline("build/test/test.js", 3091);-this.verify = function(value){- _yuitest_coverfunc("build/test/test.js", "verify", 3091);-_yuitest_coverline("build/test/test.js", 3092);-var args = [].concat(originalArgs || []);- _yuitest_coverline("build/test/test.js", 3093);-args.push(value);- _yuitest_coverline("build/test/test.js", 3094);-args.push(message);- _yuitest_coverline("build/test/test.js", 3095);-method.apply(null, args);- };- } else {- _yuitest_coverline("build/test/test.js", 3098);-return new YUITest.Mock.Value(method, originalArgs, message);- }-};--/**- * Predefined matcher to match any value.- * @property Any- * @static- * @type Function- */-_yuitest_coverline("build/test/test.js", 3108);-YUITest.Mock.Value.Any = YUITest.Mock.Value(function(){});--/**- * Predefined matcher to match boolean values.- * @property Boolean- * @static- * @type Function- */-_yuitest_coverline("build/test/test.js", 3116);-YUITest.Mock.Value.Boolean = YUITest.Mock.Value(YUITest.Assert.isBoolean);--/**- * Predefined matcher to match number values.- * @property Number- * @static- * @type Function- */-_yuitest_coverline("build/test/test.js", 3124);-YUITest.Mock.Value.Number = YUITest.Mock.Value(YUITest.Assert.isNumber);--/**- * Predefined matcher to match string values.- * @property String- * @static- * @type Function- */-_yuitest_coverline("build/test/test.js", 3132);-YUITest.Mock.Value.String = YUITest.Mock.Value(YUITest.Assert.isString);--/**- * Predefined matcher to match object values.- * @property Object- * @static- * @type Function- */-_yuitest_coverline("build/test/test.js", 3140);-YUITest.Mock.Value.Object = YUITest.Mock.Value(YUITest.Assert.isObject);--/**- * Predefined matcher to match function values.- * @property Function- * @static- * @type Function- */-_yuitest_coverline("build/test/test.js", 3148);-YUITest.Mock.Value.Function = YUITest.Mock.Value(YUITest.Assert.isFunction);--/**- * The ObjectAssert object provides functions to test JavaScript objects- * for a variety of cases.- * @namespace Test- * @module test- * @class ObjectAssert- * @static- */-_yuitest_coverline("build/test/test.js", 3158);-YUITest.ObjectAssert = {-- /**- * Asserts that an object has all of the same properties- * and property values as the other.- * @param {Object} expected The object with all expected properties and values.- * @param {Object} actual The object to inspect.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method areEqual- * @static- * @deprecated- */- areEqual: function(expected, actual, message) {- _yuitest_coverfunc("build/test/test.js", "areEqual", 3170);-_yuitest_coverline("build/test/test.js", 3171);-YUITest.Assert._increment(); - - _yuitest_coverline("build/test/test.js", 3173);-var expectedKeys = YUITest.Object.keys(expected),- actualKeys = YUITest.Object.keys(actual);- - //first check keys array length- _yuitest_coverline("build/test/test.js", 3177);-if (expectedKeys.length != actualKeys.length){- _yuitest_coverline("build/test/test.js", 3178);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Object should have " + expectedKeys.length + " keys but has " + actualKeys.length));- }- - //then check values- _yuitest_coverline("build/test/test.js", 3182);-for (var name in expected){- _yuitest_coverline("build/test/test.js", 3183);-if (expected.hasOwnProperty(name)){- _yuitest_coverline("build/test/test.js", 3184);-if (expected[name] != actual[name]){- _yuitest_coverline("build/test/test.js", 3185);-throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal for property " + name), expected[name], actual[name]);- } - }- } - },- - /**- * Asserts that an object has a property with the given name.- * @param {String} propertyName The name of the property to test.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method hasKey- * @static- * @deprecated Use ownsOrInheritsKey() instead- */ - hasKey: function (propertyName, object, message) {- _yuitest_coverfunc("build/test/test.js", "hasKey", 3200);-_yuitest_coverline("build/test/test.js", 3201);-YUITest.ObjectAssert.ownsOrInheritsKey(propertyName, object, message); - },- - /**- * Asserts that an object has all properties of a reference object.- * @param {Array} properties An array of property names that should be on the object.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method hasKeys- * @static- * @deprecated Use ownsOrInheritsKeys() instead- */ - hasKeys: function (properties, object, message) {- _yuitest_coverfunc("build/test/test.js", "hasKeys", 3213);-_yuitest_coverline("build/test/test.js", 3214);-YUITest.ObjectAssert.ownsOrInheritsKeys(properties, object, message);- },- - /**- * Asserts that a property with the given name exists on an object's prototype.- * @param {String} propertyName The name of the property to test.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method inheritsKey- * @static- */ - inheritsKey: function (propertyName, object, message) {- _yuitest_coverfunc("build/test/test.js", "inheritsKey", 3225);-_yuitest_coverline("build/test/test.js", 3226);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3227);-if (!(propertyName in object && !object.hasOwnProperty(propertyName))){- _yuitest_coverline("build/test/test.js", 3228);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object instance."));- } - },- - /**- * Asserts that all properties exist on an object prototype.- * @param {Array} properties An array of property names that should be on the object.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method inheritsKeys- * @static- */ - inheritsKeys: function (properties, object, message) {- _yuitest_coverfunc("build/test/test.js", "inheritsKeys", 3240);-_yuitest_coverline("build/test/test.js", 3241);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3242);-for (var i=0; i < properties.length; i++){- _yuitest_coverline("build/test/test.js", 3243);-if (!(propertyName in object && !object.hasOwnProperty(properties[i]))){- _yuitest_coverline("build/test/test.js", 3244);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object instance."));- } - }- },- - /**- * Asserts that a property with the given name exists on an object instance (not on its prototype).- * @param {String} propertyName The name of the property to test.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method ownsKey- * @static- */ - ownsKey: function (propertyName, object, message) {- _yuitest_coverfunc("build/test/test.js", "ownsKey", 3257);-_yuitest_coverline("build/test/test.js", 3258);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3259);-if (!object.hasOwnProperty(propertyName)){- _yuitest_coverline("build/test/test.js", 3260);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object instance."));- } - },- - /**- * Asserts that all properties exist on an object instance (not on its prototype).- * @param {Array} properties An array of property names that should be on the object.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method ownsKeys- * @static- */ - ownsKeys: function (properties, object, message) {- _yuitest_coverfunc("build/test/test.js", "ownsKeys", 3272);-_yuitest_coverline("build/test/test.js", 3273);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3274);-for (var i=0; i < properties.length; i++){- _yuitest_coverline("build/test/test.js", 3275);-if (!object.hasOwnProperty(properties[i])){- _yuitest_coverline("build/test/test.js", 3276);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object instance."));- } - }- },- - /**- * Asserts that an object owns no properties.- * @param {Object} object The object to check.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method ownsNoKeys- * @static- */ - ownsNoKeys : function (object, message) {- _yuitest_coverfunc("build/test/test.js", "ownsNoKeys", 3288);-_yuitest_coverline("build/test/test.js", 3289);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3290);-var count = 0,- name;- _yuitest_coverline("build/test/test.js", 3292);-for (name in object){- _yuitest_coverline("build/test/test.js", 3293);-if (object.hasOwnProperty(name)){- _yuitest_coverline("build/test/test.js", 3294);-count++;- }- }- - _yuitest_coverline("build/test/test.js", 3298);-if (count !== 0){- _yuitest_coverline("build/test/test.js", 3299);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Object owns " + count + " properties but should own none.")); - }-- },-- /**- * Asserts that an object has a property with the given name.- * @param {String} propertyName The name of the property to test.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method ownsOrInheritsKey- * @static- */ - ownsOrInheritsKey: function (propertyName, object, message) {- _yuitest_coverfunc("build/test/test.js", "ownsOrInheritsKey", 3312);-_yuitest_coverline("build/test/test.js", 3313);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3314);-if (!(propertyName in object)){- _yuitest_coverline("build/test/test.js", 3315);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object."));- } - },- - /**- * Asserts that an object has all properties of a reference object.- * @param {Array} properties An array of property names that should be on the object.- * @param {Object} object The object to search.- * @param {String} message (Optional) The message to display if the assertion fails.- * @method ownsOrInheritsKeys- * @static- */ - ownsOrInheritsKeys: function (properties, object, message) {- _yuitest_coverfunc("build/test/test.js", "ownsOrInheritsKeys", 3327);-_yuitest_coverline("build/test/test.js", 3328);-YUITest.Assert._increment(); - _yuitest_coverline("build/test/test.js", 3329);-for (var i=0; i < properties.length; i++){- _yuitest_coverline("build/test/test.js", 3330);-if (!(properties[i] in object)){- _yuitest_coverline("build/test/test.js", 3331);-YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object."));- } - }- } -};-/**- * Convenience type for storing and aggregating- * test result information.- * @private- * @namespace Test- * @module test- * @class Results- * @constructor- * @param {String} name The name of the test.- */-_yuitest_coverline("build/test/test.js", 3346);-YUITest.Results = function(name){-- /**- * Name of the test, test case, or test suite.- * @type String- * @property name- */- _yuitest_coverfunc("build/test/test.js", "Results", 3346);-_yuitest_coverline("build/test/test.js", 3353);-this.name = name;- - /**- * Number of passed tests.- * @type int- * @property passed- */- _yuitest_coverline("build/test/test.js", 3360);-this.passed = 0;- - /**- * Number of failed tests.- * @type int- * @property failed- */- _yuitest_coverline("build/test/test.js", 3367);-this.failed = 0;- - /**- * Number of errors that occur in non-test methods.- * @type int- * @property errors- */- _yuitest_coverline("build/test/test.js", 3374);-this.errors = 0;- - /**- * Number of ignored tests.- * @type int- * @property ignored- */- _yuitest_coverline("build/test/test.js", 3381);-this.ignored = 0;- - /**- * Number of total tests.- * @type int- * @property total- */- _yuitest_coverline("build/test/test.js", 3388);-this.total = 0;- - /**- * Amount of time (ms) it took to complete testing.- * @type int- * @property duration- */- _yuitest_coverline("build/test/test.js", 3395);-this.duration = 0;-};--/**- * Includes results from another results object into this one.- * @param {Test.Results} result The results object to include.- * @method include- * @return {void}- */-_yuitest_coverline("build/test/test.js", 3404);-YUITest.Results.prototype.include = function(results){- _yuitest_coverfunc("build/test/test.js", "include", 3404);-_yuitest_coverline("build/test/test.js", 3405);-this.passed += results.passed;- _yuitest_coverline("build/test/test.js", 3406);-this.failed += results.failed;- _yuitest_coverline("build/test/test.js", 3407);-this.ignored += results.ignored;- _yuitest_coverline("build/test/test.js", 3408);-this.total += results.total;- _yuitest_coverline("build/test/test.js", 3409);-this.errors += results.errors;-};-/**- * ShouldError is subclass of Error that is thrown whenever- * a test is expected to throw an error but doesn't.- *- * @param {String} message The message to display when the error occurs.- * @namespace Test - * @extends AssertionError- * @module test- * @class ShouldError- * @constructor- */ -_yuitest_coverline("build/test/test.js", 3422);-YUITest.ShouldError = function (message){-- //call superclass- _yuitest_coverfunc("build/test/test.js", "ShouldError", 3422);-_yuitest_coverline("build/test/test.js", 3425);-YUITest.AssertionError.call(this, message || "This test should have thrown an error but didn't.");- - /**- * The name of the error that occurred.- * @type String- * @property name- */- _yuitest_coverline("build/test/test.js", 3432);-this.name = "ShouldError";- -};--//inherit from YUITest.AssertionError-_yuitest_coverline("build/test/test.js", 3437);-YUITest.ShouldError.prototype = new YUITest.AssertionError();--//restore constructor-_yuitest_coverline("build/test/test.js", 3440);-YUITest.ShouldError.prototype.constructor = YUITest.ShouldError;-/**- * ShouldFail is subclass of AssertionError that is thrown whenever- * a test was expected to fail but did not.- *- * @param {String} message The message to display when the error occurs.- * @namespace Test - * @extends YUITest.AssertionError- * @module test- * @class ShouldFail- * @constructor- */ -_yuitest_coverline("build/test/test.js", 3452);-YUITest.ShouldFail = function (message){-- //call superclass- _yuitest_coverfunc("build/test/test.js", "ShouldFail", 3452);-_yuitest_coverline("build/test/test.js", 3455);-YUITest.AssertionError.call(this, message || "This test should fail but didn't.");- - /**- * The name of the error that occurred.- * @type String- * @property name- */- _yuitest_coverline("build/test/test.js", 3462);-this.name = "ShouldFail";- -};--//inherit from YUITest.AssertionError-_yuitest_coverline("build/test/test.js", 3467);-YUITest.ShouldFail.prototype = new YUITest.AssertionError();--//restore constructor-_yuitest_coverline("build/test/test.js", 3470);-YUITest.ShouldFail.prototype.constructor = YUITest.ShouldFail;-/**- * UnexpectedError is subclass of AssertionError that is thrown whenever- * an error occurs within the course of a test and the test was not expected- * to throw an error.- *- * @param {Error} cause The unexpected error that caused this error to be - * thrown.- * @namespace Test - * @extends YUITest.AssertionError- * @module test- * @class UnexpectedError- * @constructor- */ -_yuitest_coverline("build/test/test.js", 3484);-YUITest.UnexpectedError = function (cause){-- //call superclass- _yuitest_coverfunc("build/test/test.js", "UnexpectedError", 3484);-_yuitest_coverline("build/test/test.js", 3487);-YUITest.AssertionError.call(this, "Unexpected error: " + cause.message);- - /**- * The unexpected error that occurred.- * @type Error- * @property cause- */- _yuitest_coverline("build/test/test.js", 3494);-this.cause = cause;- - /**- * The name of the error that occurred.- * @type String- * @property name- */- _yuitest_coverline("build/test/test.js", 3501);-this.name = "UnexpectedError";- - /**- * Stack information for the error (if provided).- * @type String- * @property stack- */- _yuitest_coverline("build/test/test.js", 3508);-this.stack = cause.stack;- -};--//inherit from YUITest.AssertionError-_yuitest_coverline("build/test/test.js", 3513);-YUITest.UnexpectedError.prototype = new YUITest.AssertionError();--//restore constructor-_yuitest_coverline("build/test/test.js", 3516);-YUITest.UnexpectedError.prototype.constructor = YUITest.UnexpectedError;-/**- * UnexpectedValue is subclass of Error that is thrown whenever- * a value was unexpected in its scope. This typically means that a test- * was performed to determine that a value was *not* equal to a certain- * value.- *- * @param {String} message The message to display when the error occurs.- * @param {Object} unexpected The unexpected value.- * @namespace Test - * @extends AssertionError- * @module test- * @class UnexpectedValue- * @constructor- */ -_yuitest_coverline("build/test/test.js", 3531);-YUITest.UnexpectedValue = function (message, unexpected){-- //call superclass- _yuitest_coverfunc("build/test/test.js", "UnexpectedValue", 3531);-_yuitest_coverline("build/test/test.js", 3534);-YUITest.AssertionError.call(this, message);- - /**- * The unexpected value.- * @type Object- * @property unexpected- */- _yuitest_coverline("build/test/test.js", 3541);-this.unexpected = unexpected;- - /**- * The name of the error that occurred.- * @type String- * @property name- */- _yuitest_coverline("build/test/test.js", 3548);-this.name = "UnexpectedValue";- -};--//inherit from YUITest.AssertionError-_yuitest_coverline("build/test/test.js", 3553);-YUITest.UnexpectedValue.prototype = new YUITest.AssertionError();--//restore constructor-_yuitest_coverline("build/test/test.js", 3556);-YUITest.UnexpectedValue.prototype.constructor = YUITest.UnexpectedValue;--/**- * Returns a fully formatted error for an assertion failure. This message- * provides information about the expected and actual values.- * @method getMessage- * @return {String} A string describing the error.- */-_yuitest_coverline("build/test/test.js", 3564);-YUITest.UnexpectedValue.prototype.getMessage = function(){- _yuitest_coverfunc("build/test/test.js", "getMessage", 3564);-_yuitest_coverline("build/test/test.js", 3565);-return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";-};--/**- * Represents a stoppage in test execution to wait for an amount of time before- * continuing.- * @param {Function} segment A function to run when the wait is over.- * @param {int} delay The number of milliseconds to wait before running the code.- * @module test- * @class Wait- * @namespace Test- * @constructor- *- */-_yuitest_coverline("build/test/test.js", 3579);-YUITest.Wait = function (segment, delay) {- - /**- * The segment of code to run when the wait is over.- * @type Function- * @property segment- */- _yuitest_coverfunc("build/test/test.js", "Wait", 3579);-_yuitest_coverline("build/test/test.js", 3586);-this.segment = (typeof segment == "function" ? segment : null);-- /**- * The delay before running the segment of code.- * @type int- * @property delay- */- _yuitest_coverline("build/test/test.js", 3593);-this.delay = (typeof delay == "number" ? delay : 0); -};---//Setting up our aliases..-_yuitest_coverline("build/test/test.js", 3598);-Y.Test = YUITest;-_yuitest_coverline("build/test/test.js", 3599);-Y.Object.each(YUITest, function(item, name) {- _yuitest_coverfunc("build/test/test.js", "(anonymous 14)", 3599);-_yuitest_coverline("build/test/test.js", 3600);-var name = name.replace('Test', '');- _yuitest_coverline("build/test/test.js", 3601);-Y.Test[name] = item;-});--} //End of else in top wrapper--_yuitest_coverline("build/test/test.js", 3606);-Y.Assert = YUITest.Assert;-_yuitest_coverline("build/test/test.js", 3607);-Y.Assert.Error = Y.Test.AssertionError;-_yuitest_coverline("build/test/test.js", 3608);-Y.Assert.ComparisonFailure = Y.Test.ComparisonFailure;-_yuitest_coverline("build/test/test.js", 3609);-Y.Assert.UnexpectedValue = Y.Test.UnexpectedValue;-_yuitest_coverline("build/test/test.js", 3610);-Y.Mock = Y.Test.Mock;-_yuitest_coverline("build/test/test.js", 3611);-Y.ObjectAssert = Y.Test.ObjectAssert;-_yuitest_coverline("build/test/test.js", 3612);-Y.ArrayAssert = Y.Test.ArrayAssert;-_yuitest_coverline("build/test/test.js", 3613);-Y.DateAssert = Y.Test.DateAssert;-_yuitest_coverline("build/test/test.js", 3614);-Y.Test.ResultsFormat = Y.Test.TestFormat;--_yuitest_coverline("build/test/test.js", 3616);-var itemsAreEqual = Y.Test.ArrayAssert.itemsAreEqual;--_yuitest_coverline("build/test/test.js", 3618);-Y.Test.ArrayAssert.itemsAreEqual = function(expected, actual, message) {- _yuitest_coverfunc("build/test/test.js", "itemsAreEqual", 3618);-_yuitest_coverline("build/test/test.js", 3619);-return itemsAreEqual.call(this, Y.Array(expected), Y.Array(actual), message);-};---/**- * Asserts that a given condition is true. If not, then a Y.Assert.Error object is thrown- * and the test fails.- * @method assert- * @param {Boolean} condition The condition to test.- * @param {String} message The message to display if the assertion fails.- * @for YUI- * @static- */-_yuitest_coverline("build/test/test.js", 3632);-Y.assert = function(condition, message){- _yuitest_coverfunc("build/test/test.js", "assert", 3632);-_yuitest_coverline("build/test/test.js", 3633);-Y.Assert._increment();- _yuitest_coverline("build/test/test.js", 3634);-if (!condition){- _yuitest_coverline("build/test/test.js", 3635);-throw new Y.Assert.Error(Y.Assert._formatMessage(message, "Assertion failed."));- }-};--/**- * Forces an assertion error to occur. Shortcut for Y.Assert.fail().- * @method fail- * @param {String} message (Optional) The message to display with the failure.- * @for YUI- * @static- */-_yuitest_coverline("build/test/test.js", 3646);-Y.fail = Y.Assert.fail; --_yuitest_coverline("build/test/test.js", 3648);-Y.Test.Runner.once = Y.Test.Runner.subscribe;--_yuitest_coverline("build/test/test.js", 3650);-Y.Test.Runner.disableLogging = function() {- _yuitest_coverfunc("build/test/test.js", "disableLogging", 3650);-_yuitest_coverline("build/test/test.js", 3651);-Y.Test.Runner._log = false;-};--_yuitest_coverline("build/test/test.js", 3654);-Y.Test.Runner.enableLogging = function() {- _yuitest_coverfunc("build/test/test.js", "enableLogging", 3654);-_yuitest_coverline("build/test/test.js", 3655);-Y.Test.Runner._log = true;-};--_yuitest_coverline("build/test/test.js", 3658);-Y.Test.Runner._ignoreEmpty = true;-_yuitest_coverline("build/test/test.js", 3659);-Y.Test.Runner._log = true;--_yuitest_coverline("build/test/test.js", 3661);-Y.Test.Runner.on = Y.Test.Runner.attach;--//Only allow one instance of YUITest-_yuitest_coverline("build/test/test.js", 3664);-if (!YUI.YUITest) {-- _yuitest_coverline("build/test/test.js", 3666);-if (Y.config.win) {- _yuitest_coverline("build/test/test.js", 3667);-Y.config.win.YUITest = YUITest;- }-- _yuitest_coverline("build/test/test.js", 3670);-YUI.YUITest = Y.Test;-- - //Only setup the listeners once.- _yuitest_coverline("build/test/test.js", 3674);-var logEvent = function(event) {- - //data variables- _yuitest_coverfunc("build/test/test.js", "logEvent", 3674);-_yuitest_coverline("build/test/test.js", 3677);-var message = "";- _yuitest_coverline("build/test/test.js", 3678);-var messageType = "";- - _yuitest_coverline("build/test/test.js", 3680);-switch(event.type){- case this.BEGIN_EVENT:- _yuitest_coverline("build/test/test.js", 3682);-message = "Testing began at " + (new Date()).toString() + ".";- _yuitest_coverline("build/test/test.js", 3683);-messageType = "info";- _yuitest_coverline("build/test/test.js", 3684);-break;- - case this.COMPLETE_EVENT:- _yuitest_coverline("build/test/test.js", 3687);-message = Y.Lang.sub("Testing completed at " +- (new Date()).toString() + ".\n" +- "Passed:{passed} Failed:{failed} " +- "Total:{total} ({ignored} ignored)",- event.results);- _yuitest_coverline("build/test/test.js", 3692);-messageType = "info";- _yuitest_coverline("build/test/test.js", 3693);-break;- - case this.TEST_FAIL_EVENT:- _yuitest_coverline("build/test/test.js", 3696);-message = event.testName + ": failed.\n" + event.error.getMessage();- _yuitest_coverline("build/test/test.js", 3697);-messageType = "fail";- _yuitest_coverline("build/test/test.js", 3698);-break;- - case this.TEST_IGNORE_EVENT:- _yuitest_coverline("build/test/test.js", 3701);-message = event.testName + ": ignored.";- _yuitest_coverline("build/test/test.js", 3702);-messageType = "ignore";- _yuitest_coverline("build/test/test.js", 3703);-break;- - case this.TEST_PASS_EVENT:- _yuitest_coverline("build/test/test.js", 3706);-message = event.testName + ": passed.";- _yuitest_coverline("build/test/test.js", 3707);-messageType = "pass";- _yuitest_coverline("build/test/test.js", 3708);-break;- - case this.TEST_SUITE_BEGIN_EVENT:- _yuitest_coverline("build/test/test.js", 3711);-message = "Test suite \"" + event.testSuite.name + "\" started.";- _yuitest_coverline("build/test/test.js", 3712);-messageType = "info";- _yuitest_coverline("build/test/test.js", 3713);-break;- - case this.TEST_SUITE_COMPLETE_EVENT:- _yuitest_coverline("build/test/test.js", 3716);-message = Y.Lang.sub("Test suite \"" +- event.testSuite.name + "\" completed" + ".\n" +- "Passed:{passed} Failed:{failed} " +- "Total:{total} ({ignored} ignored)",- event.results);- _yuitest_coverline("build/test/test.js", 3721);-messageType = "info";- _yuitest_coverline("build/test/test.js", 3722);-break;- - case this.TEST_CASE_BEGIN_EVENT:- _yuitest_coverline("build/test/test.js", 3725);-message = "Test case \"" + event.testCase.name + "\" started.";- _yuitest_coverline("build/test/test.js", 3726);-messageType = "info";- _yuitest_coverline("build/test/test.js", 3727);-break;- - case this.TEST_CASE_COMPLETE_EVENT:- _yuitest_coverline("build/test/test.js", 3730);-message = Y.Lang.sub("Test case \"" +- event.testCase.name + "\" completed.\n" +- "Passed:{passed} Failed:{failed} " +- "Total:{total} ({ignored} ignored)",- event.results);- _yuitest_coverline("build/test/test.js", 3735);-messageType = "info";- _yuitest_coverline("build/test/test.js", 3736);-break;- default:- _yuitest_coverline("build/test/test.js", 3738);-message = "Unexpected event " + event.type;- _yuitest_coverline("build/test/test.js", 3739);-message = "info";- }- - _yuitest_coverline("build/test/test.js", 3742);-if (Y.Test.Runner._log) {- _yuitest_coverline("build/test/test.js", 3743);-Y.log(message, messageType, "TestRunner");- }- };-- _yuitest_coverline("build/test/test.js", 3747);-var i, name;-- _yuitest_coverline("build/test/test.js", 3749);-for (i in Y.Test.Runner) {- _yuitest_coverline("build/test/test.js", 3750);-name = Y.Test.Runner[i];- _yuitest_coverline("build/test/test.js", 3751);-if (i.indexOf('_EVENT') > -1) {- _yuitest_coverline("build/test/test.js", 3752);-Y.Test.Runner.subscribe(name, logEvent);- }- }_yuitest_coverline("build/test/test.js", 3754);-;--} //End if for YUI.YUITest---}, '3.7.2', {"requires": ["event-simulate", "event-custom", "json-stringify"]});+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/test/test.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/test/test.js",+ code: []+};+_yuitest_coverage["build/test/test.js"].code=["YUI.add('test', function (Y, NAME) {","","","","/**"," * YUI Test Framework"," * @module test"," * @main test"," */","","/*"," * The root namespace for YUI Test."," */","","//So we only ever have one YUITest object that's shared","if (YUI.YUITest) {"," Y.Test = YUI.YUITest;","} else { //Ends after the YUITest definitions",""," //Make this global for back compat"," YUITest = {"," version: \"3.7.3\","," guid: function(pre) {"," return Y.guid(pre);"," }"," };","","Y.namespace('Test');","","","//Using internal YUI methods here","YUITest.Object = Y.Object;","YUITest.Array = Y.Array;","YUITest.Util = {"," mix: Y.mix,"," JSON: Y.JSON","};","","/**"," * Simple custom event implementation."," * @namespace Test"," * @module test"," * @class EventTarget"," * @constructor"," */","YUITest.EventTarget = function(){",""," /**"," * Event handlers for the various events."," * @type Object"," * @private"," * @property _handlers"," * @static"," */"," this._handlers = {};","","};"," ","YUITest.EventTarget.prototype = {",""," //restore prototype"," constructor: YUITest.EventTarget,"," "," //-------------------------------------------------------------------------"," // Event Handling"," //-------------------------------------------------------------------------"," "," /**"," * Adds a listener for a given event type."," * @param {String} type The type of event to add a listener for."," * @param {Function} listener The function to call when the event occurs."," * @return {void}"," * @method attach"," */"," attach: function(type, listener){"," if (typeof this._handlers[type] == \"undefined\"){"," this._handlers[type] = [];"," }",""," this._handlers[type].push(listener);"," },"," "," /**"," * Adds a listener for a given event type."," * @param {String} type The type of event to add a listener for."," * @param {Function} listener The function to call when the event occurs."," * @return {void}"," * @method subscribe"," * @deprecated"," */"," subscribe: function(type, listener){"," this.attach.apply(this, arguments);"," },"," "," /**"," * Fires an event based on the passed-in object."," * @param {Object|String} event An object with at least a 'type' attribute"," * or a string indicating the event name."," * @return {void}"," * @method fire"," */ "," fire: function(event){"," if (typeof event == \"string\"){"," event = { type: event };"," }"," if (!event.target){"," event.target = this;"," }"," "," if (!event.type){"," throw new Error(\"Event object missing 'type' property.\");"," }"," "," if (this._handlers[event.type] instanceof Array){"," var handlers = this._handlers[event.type];"," for (var i=0, len=handlers.length; i < len; i++){"," handlers[i].call(this, event);"," }"," } "," },",""," /**"," * Removes a listener for a given event type."," * @param {String} type The type of event to remove a listener from."," * @param {Function} listener The function to remove from the event."," * @return {void}"," * @method detach"," */"," detach: function(type, listener){"," if (this._handlers[type] instanceof Array){"," var handlers = this._handlers[type];"," for (var i=0, len=handlers.length; i < len; i++){"," if (handlers[i] === listener){"," handlers.splice(i, 1);"," break;"," }"," }"," } "," },"," "," /**"," * Removes a listener for a given event type."," * @param {String} type The type of event to remove a listener from."," * @param {Function} listener The function to remove from the event."," * @return {void}"," * @method unsubscribe"," * @deprecated"," */"," unsubscribe: function(type, listener){"," this.detach.apply(this, arguments); "," } ","","};",""," ","/**"," * A test suite that can contain a collection of TestCase and TestSuite objects."," * @param {String||Object} data The name of the test suite or an object containing"," * a name property as well as setUp and tearDown methods."," * @namespace Test"," * @module test"," * @class TestSuite"," * @constructor"," */","YUITest.TestSuite = function (data) {",""," /**"," * The name of the test suite."," * @type String"," * @property name"," */"," this.name = \"\";",""," /**"," * Array of test suites and test cases."," * @type Array"," * @property items"," * @private"," */"," this.items = [];",""," //initialize the properties"," if (typeof data == \"string\"){"," this.name = data;"," } else if (data instanceof Object){"," for (var prop in data){"," if (data.hasOwnProperty(prop)){"," this[prop] = data[prop];"," }"," }"," }",""," //double-check name"," if (this.name === \"\" || !this.name) {"," this.name = YUITest.guid(\"testSuite_\");"," }","","};"," ","YUITest.TestSuite.prototype = {"," "," //restore constructor"," constructor: YUITest.TestSuite,"," "," /**"," * Adds a test suite or test case to the test suite."," * @param {Test.TestSuite||YUITest.TestCase} testObject The test suite or test case to add."," * @return {Void}"," * @method add"," */"," add : function (testObject) {"," if (testObject instanceof YUITest.TestSuite || testObject instanceof YUITest.TestCase) {"," this.items.push(testObject);"," }"," return this;"," },"," "," //-------------------------------------------------------------------------"," // Stub Methods"," //-------------------------------------------------------------------------",""," /**"," * Function to run before each test is executed."," * @return {Void}"," * @method setUp"," */"," setUp : function () {"," },"," "," /**"," * Function to run after each test is executed."," * @return {Void}"," * @method tearDown"," */"," tearDown: function () {"," }"," ","};","/**"," * Test case containing various tests to run."," * @param template An object containing any number of test methods, other methods,"," * an optional name, and anything else the test case needs."," * @module test"," * @class TestCase"," * @namespace Test"," * @constructor"," */","","","","YUITest.TestCase = function (template) {"," "," /*"," * Special rules for the test case. Possible subobjects"," * are fail, for tests that should fail, and error, for"," * tests that should throw an error."," */"," this._should = {};"," "," //copy over all properties from the template to this object"," for (var prop in template) {"," this[prop] = template[prop];"," } "," "," //check for a valid name"," if (typeof this.name != \"string\") {"," this.name = YUITest.guid(\"testCase_\");"," }","","};",""," ","YUITest.TestCase.prototype = { ",""," //restore constructor"," constructor: YUITest.TestCase,"," "," /**"," * Method to call from an async init method to"," * restart the test case. When called, returns a function"," * that should be called when tests are ready to continue."," * @method callback"," * @return {Function} The function to call as a callback."," */"," callback: function(){"," return YUITest.TestRunner.callback.apply(YUITest.TestRunner,arguments);"," },",""," /**"," * Resumes a paused test and runs the given function."," * @param {Function} segment (Optional) The function to run."," * If omitted, the test automatically passes."," * @return {Void}"," * @method resume"," */"," resume : function (segment) {"," YUITest.TestRunner.resume(segment);"," },",""," /**"," * Causes the test case to wait a specified amount of time and then"," * continue executing the given code."," * @param {Function} segment (Optional) The function to run after the delay."," * If omitted, the TestRunner will wait until resume() is called."," * @param {int} delay (Optional) The number of milliseconds to wait before running"," * the function. If omitted, defaults to zero."," * @return {Void}"," * @method wait"," */"," wait : function (segment, delay){"," "," var actualDelay = (typeof segment == \"number\" ? segment : delay);"," actualDelay = (typeof actualDelay == \"number\" ? actualDelay : 10000);"," "," if (typeof segment == \"function\"){"," throw new YUITest.Wait(segment, actualDelay);"," } else {"," throw new YUITest.Wait(function(){"," YUITest.Assert.fail(\"Timeout: wait() called but resume() never called.\");"," }, actualDelay);"," }"," },"," "," //-------------------------------------------------------------------------"," // Assertion Methods"," //-------------------------------------------------------------------------",""," /**"," * Asserts that a given condition is true. If not, then a YUITest.AssertionError object is thrown"," * and the test fails."," * @method assert"," * @param {Boolean} condition The condition to test."," * @param {String} message The message to display if the assertion fails."," */"," assert : function (condition, message){"," YUITest.Assert._increment();"," if (!condition){"," throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, \"Assertion failed.\"));"," } "," },"," "," /**"," * Forces an assertion error to occur. Shortcut for YUITest.Assert.fail()."," * @method fail"," * @param {String} message (Optional) The message to display with the failure."," */"," fail: function (message) { "," YUITest.Assert.fail(message);"," },"," "," //-------------------------------------------------------------------------"," // Stub Methods"," //-------------------------------------------------------------------------",""," /**"," * Function to run once before tests start to run."," * This executes before the first call to setUp()."," * @method init"," */"," init: function(){"," //noop"," },"," "," /**"," * Function to run once after tests finish running."," * This executes after the last call to tearDown()."," * @method destroy"," */"," destroy: function(){"," //noop"," },",""," /**"," * Function to run before each test is executed."," * @return {Void}"," * @method setUp"," */"," setUp : function () {"," //noop"," },"," "," /**"," * Function to run after each test is executed."," * @return {Void}"," * @method tearDown"," */"," tearDown: function () { "," //noop"," }","};","/**"," * An object object containing test result formatting methods."," * @namespace Test"," * @module test"," * @class TestFormat"," * @static"," */","YUITest.TestFormat = function(){"," "," /* (intentionally not documented)"," * Basic XML escaping method. Replaces quotes, less-than, greater-than,"," * apostrophe, and ampersand characters with their corresponding entities."," * @param {String} text The text to encode."," * @return {String} The XML-escaped text."," */"," function xmlEscape(text){"," "," return text.replace(/[<>\"'&]/g, function(value){"," switch(value){"," case \"<\": return \"<\";"," case \">\": return \">\";"," case \"\\\"\": return \""\";"," case \"'\": return \"'\";"," case \"&\": return \"&\";"," }"," });"," "," }"," "," "," return {"," "," /**"," * Returns test results formatted as a JSON string. Requires JSON utility."," * @param {Object} result The results object created by TestRunner."," * @return {String} A JSON-formatted string of results."," * @method JSON"," * @static"," */"," JSON: function(results) {"," return YUITest.Util.JSON.stringify(results);"," },"," "," /**"," * Returns test results formatted as an XML string."," * @param {Object} result The results object created by TestRunner."," * @return {String} An XML-formatted string of results."," * @method XML"," * @static"," */"," XML: function(results) {",""," function serializeToXML(results){"," var xml = \"<\" + results.type + \" name=\\\"\" + xmlEscape(results.name) + \"\\\"\";"," "," if (typeof(results.duration)==\"number\"){"," xml += \" duration=\\\"\" + results.duration + \"\\\"\";"," }"," "," if (results.type == \"test\"){"," xml += \" result=\\\"\" + results.result + \"\\\" message=\\\"\" + xmlEscape(results.message) + \"\\\">\";"," } else {"," xml += \" passed=\\\"\" + results.passed + \"\\\" failed=\\\"\" + results.failed + \"\\\" ignored=\\\"\" + results.ignored + \"\\\" total=\\\"\" + results.total + \"\\\">\";"," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToXML(results[prop]);"," }"," }"," } "," }",""," xml += \"</\" + results.type + \">\";"," "," return xml; "," }",""," return \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + serializeToXML(results);",""," },","",""," /**"," * Returns test results formatted in JUnit XML format."," * @param {Object} result The results object created by TestRunner."," * @return {String} An XML-formatted string of results."," * @method JUnitXML"," * @static"," */"," JUnitXML: function(results) {",""," function serializeToJUnitXML(results){"," var xml = \"\";"," "," switch (results.type){"," //equivalent to testcase in JUnit"," case \"test\":"," if (results.result != \"ignore\"){"," xml = \"<testcase name=\\\"\" + xmlEscape(results.name) + \"\\\" time=\\\"\" + (results.duration/1000) + \"\\\">\";"," if (results.result == \"fail\"){"," xml += \"<failure message=\\\"\" + xmlEscape(results.message) + \"\\\"><![CDATA[\" + results.message + \"]]></failure>\";"," }"," xml+= \"</testcase>\";"," }"," break;"," "," //equivalent to testsuite in JUnit"," case \"testcase\":"," "," xml = \"<testsuite name=\\\"\" + xmlEscape(results.name) + \"\\\" tests=\\\"\" + results.total + \"\\\" failures=\\\"\" + results.failed + \"\\\" time=\\\"\" + (results.duration/1000) + \"\\\">\";"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToJUnitXML(results[prop]);"," }"," }"," } "," "," xml += \"</testsuite>\";"," break;"," "," //no JUnit equivalent, don't output anything"," case \"testsuite\":"," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToJUnitXML(results[prop]);"," }"," }"," } "," break;"," "," //top-level, equivalent to testsuites in JUnit"," case \"report\":"," "," xml = \"<testsuites>\";"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," xml += serializeToJUnitXML(results[prop]);"," }"," }"," } "," "," xml += \"</testsuites>\"; "," "," //no default"," }"," "," return xml;"," "," }",""," return \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\" + serializeToJUnitXML(results);"," },"," "," /**"," * Returns test results formatted in TAP format."," * For more information, see <a href=\"http://testanything.org/\">Test Anything Protocol</a>."," * @param {Object} result The results object created by TestRunner."," * @return {String} A TAP-formatted string of results."," * @method TAP"," * @static"," */"," TAP: function(results) {"," "," var currentTestNum = 1;",""," function serializeToTAP(results){"," var text = \"\";"," "," switch (results.type){",""," case \"test\":"," if (results.result != \"ignore\"){",""," text = \"ok \" + (currentTestNum++) + \" - \" + results.name;"," "," if (results.result == \"fail\"){"," text = \"not \" + text + \" - \" + results.message;"," }"," "," text += \"\\n\";"," } else {"," text = \"#Ignored test \" + results.name + \"\\n\";"," }"," break;"," "," case \"testcase\":"," "," text = \"#Begin testcase \" + results.name + \"(\" + results.failed + \" failed of \" + results.total + \")\\n\";"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," text += serializeToTAP(results[prop]);"," }"," }"," } "," "," text += \"#End testcase \" + results.name + \"\\n\";"," "," "," break;"," "," case \"testsuite\":",""," text = \"#Begin testsuite \" + results.name + \"(\" + results.failed + \" failed of \" + results.total + \")\\n\"; "," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," text += serializeToTAP(results[prop]);"," }"," }"," } ",""," text += \"#End testsuite \" + results.name + \"\\n\";"," break;",""," case \"report\":"," "," for (var prop in results){"," if (results.hasOwnProperty(prop)){"," if (results[prop] && typeof results[prop] == \"object\" && !(results[prop] instanceof Array)){"," text += serializeToTAP(results[prop]);"," }"," }"," } "," "," //no default"," }"," "," return text;"," "," }",""," return \"1..\" + results.total + \"\\n\" + serializeToTAP(results);"," }"," "," };","}();"," "," /**"," * An object capable of sending test results to a server."," * @param {String} url The URL to submit the results to."," * @param {Function} format (Optiona) A function that outputs the results in a specific format."," * Default is YUITest.TestFormat.XML."," * @constructor"," * @namespace Test"," * @module test"," * @class Reporter"," */"," YUITest.Reporter = function(url, format) {"," "," /**"," * The URL to submit the data to."," * @type String"," * @property url"," */"," this.url = url;"," "," /**"," * The formatting function to call when submitting the data."," * @type Function"," * @property format"," */"," this.format = format || YUITest.TestFormat.XML;"," "," /**"," * Extra fields to submit with the request."," * @type Object"," * @property _fields"," * @private"," */"," this._fields = new Object();"," "," /**"," * The form element used to submit the results."," * @type HTMLFormElement"," * @property _form"," * @private"," */"," this._form = null;"," "," /**"," * Iframe used as a target for form submission."," * @type HTMLIFrameElement"," * @property _iframe"," * @private"," */"," this._iframe = null;"," };"," "," YUITest.Reporter.prototype = {"," "," //restore missing constructor"," constructor: YUITest.Reporter,"," "," /**"," * Adds a field to the form that submits the results."," * @param {String} name The name of the field."," * @param {Variant} value The value of the field."," * @return {Void}"," * @method addField"," */"," addField : function (name, value){"," this._fields[name] = value; "," },"," "," /**"," * Removes all previous defined fields."," * @return {Void}"," * @method clearFields"," */"," clearFields : function(){"," this._fields = new Object();"," },"," "," /**"," * Cleans up the memory associated with the TestReporter, removing DOM elements"," * that were created."," * @return {Void}"," * @method destroy"," */"," destroy : function() {"," if (this._form){"," this._form.parentNode.removeChild(this._form);"," this._form = null;"," } "," if (this._iframe){"," this._iframe.parentNode.removeChild(this._iframe);"," this._iframe = null;"," }"," this._fields = null;"," },"," "," /**"," * Sends the report to the server."," * @param {Object} results The results object created by TestRunner."," * @return {Void}"," * @method report"," */"," report : function(results){"," "," //if the form hasn't been created yet, create it"," if (!this._form){"," this._form = document.createElement(\"form\");"," this._form.method = \"post\";"," this._form.style.visibility = \"hidden\";"," this._form.style.position = \"absolute\";"," this._form.style.top = 0;"," document.body.appendChild(this._form);"," "," //IE won't let you assign a name using the DOM, must do it the hacky way"," try {"," this._iframe = document.createElement(\"<iframe name=\\\"yuiTestTarget\\\" />\");"," } catch (ex){"," this._iframe = document.createElement(\"iframe\");"," this._iframe.name = \"yuiTestTarget\";"," }"," "," this._iframe.src = \"javascript:false\";"," this._iframe.style.visibility = \"hidden\";"," this._iframe.style.position = \"absolute\";"," this._iframe.style.top = 0;"," document.body.appendChild(this._iframe);"," "," this._form.target = \"yuiTestTarget\";"," }"," "," //set the form's action"," this._form.action = this.url;"," "," //remove any existing fields"," while(this._form.hasChildNodes()){"," this._form.removeChild(this._form.lastChild);"," }"," "," //create default fields"," this._fields.results = this.format(results);"," this._fields.useragent = navigator.userAgent;"," this._fields.timestamp = (new Date()).toLocaleString();"," "," //add fields to the form"," for (var prop in this._fields){"," var value = this._fields[prop];"," if (this._fields.hasOwnProperty(prop) && (typeof value != \"function\")){"," var input = document.createElement(\"input\");"," input.type = \"hidden\";"," input.name = prop;"," input.value = value;"," this._form.appendChild(input);"," }"," }"," "," //remove default fields"," delete this._fields.results;"," delete this._fields.useragent;"," delete this._fields.timestamp;"," "," if (arguments[1] !== false){"," this._form.submit();"," }"," "," }"," "," };"," "," /**"," * Runs test suites and test cases, providing events to allowing for the"," * interpretation of test results."," * @namespace Test"," * @module test"," * @class TestRunner"," * @static"," */"," YUITest.TestRunner = function(){",""," /*(intentionally not documented)"," * Determines if any of the array of test groups appears"," * in the given TestRunner filter."," * @param {Array} testGroups The array of test groups to"," * search for."," * @param {String} filter The TestRunner groups filter."," */"," function inGroups(testGroups, filter){"," if (!filter.length){"," return true;"," } else { "," if (testGroups){"," for (var i=0, len=testGroups.length; i < len; i++){"," if (filter.indexOf(\",\" + testGroups[i] + \",\") > -1){"," return true;"," }"," }"," }"," return false;"," }"," }"," "," /**"," * A node in the test tree structure. May represent a TestSuite, TestCase, or"," * test function."," * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function."," * @module test"," * @class TestNode"," * @constructor"," * @private"," */"," function TestNode(testObject){"," "," /**"," * The TestSuite, TestCase, or test function represented by this node."," * @type Variant"," * @property testObject"," */"," this.testObject = testObject;"," "," /**"," * Pointer to this node's first child."," * @type TestNode"," * @property firstChild"," */ "," this.firstChild = null;"," "," /**"," * Pointer to this node's last child."," * @type TestNode"," * @property lastChild"," */ "," this.lastChild = null;"," "," /**"," * Pointer to this node's parent."," * @type TestNode"," * @property parent"," */ "," this.parent = null; "," "," /**"," * Pointer to this node's next sibling."," * @type TestNode"," * @property next"," */ "," this.next = null;"," "," /**"," * Test results for this test object."," * @type object"," * @property results"," */ "," this.results = new YUITest.Results();"," "," //initialize results"," if (testObject instanceof YUITest.TestSuite){"," this.results.type = \"testsuite\";"," this.results.name = testObject.name;"," } else if (testObject instanceof YUITest.TestCase){"," this.results.type = \"testcase\";"," this.results.name = testObject.name;"," }"," "," }"," "," TestNode.prototype = {"," "," /**"," * Appends a new test object (TestSuite, TestCase, or test function name) as a child"," * of this node."," * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function."," * @return {Void}"," * @method appendChild"," */"," appendChild : function (testObject){"," var node = new TestNode(testObject);"," if (this.firstChild === null){"," this.firstChild = this.lastChild = node;"," } else {"," this.lastChild.next = node;"," this.lastChild = node;"," }"," node.parent = this;"," return node;"," } "," };"," "," /**"," * Runs test suites and test cases, providing events to allowing for the"," * interpretation of test results."," * @namespace Test"," * @module test"," * @class Runner"," * @static"," */"," function TestRunner(){"," "," //inherit from EventTarget"," YUITest.EventTarget.call(this);"," "," /**"," * Suite on which to attach all TestSuites and TestCases to be run."," * @type YUITest.TestSuite"," * @property masterSuite"," * @static"," * @private"," */"," this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));"," "," /**"," * Pointer to the current node in the test tree."," * @type TestNode"," * @private"," * @property _cur"," * @static"," */"," this._cur = null;"," "," /**"," * Pointer to the root node in the test tree."," * @type TestNode"," * @private"," * @property _root"," * @static"," */"," this._root = null;"," "," /**"," * Indicates if the TestRunner will log events or not."," * @type Boolean"," * @property _log"," * @private"," * @static"," */"," this._log = true;"," "," /**"," * Indicates if the TestRunner is waiting as a result of"," * wait() being called."," * @type Boolean"," * @property _waiting"," * @private"," * @static"," */"," this._waiting = false;"," "," /**"," * Indicates if the TestRunner is currently running tests."," * @type Boolean"," * @private"," * @property _running"," * @static"," */"," this._running = false;"," "," /**"," * Holds copy of the results object generated when all tests are"," * complete."," * @type Object"," * @private"," * @property _lastResults"," * @static"," */"," this._lastResults = null; "," "," /**"," * Data object that is passed around from method to method."," * @type Object"," * @private"," * @property _data"," * @static"," */"," this._context = null;"," "," /**"," * The list of test groups to run. The list is represented"," * by a comma delimited string with commas at the start and"," * end."," * @type String"," * @private"," * @property _groups"," * @static"," */"," this._groups = \"\";",""," }"," "," TestRunner.prototype = YUITest.Util.mix(new YUITest.EventTarget(), {"," "," /**"," * If true, YUITest will not fire an error for tests with no Asserts."," * @prop _ignoreEmpty"," * @private"," * @type Boolean"," * @static"," */"," _ignoreEmpty: false,",""," //restore prototype"," constructor: YUITest.TestRunner,"," "," //-------------------------------------------------------------------------"," // Constants"," //-------------------------------------------------------------------------"," "," /**"," * Fires when a test case is opened but before the first "," * test is executed."," * @event testcasebegin"," * @static"," */ "," TEST_CASE_BEGIN_EVENT : \"testcasebegin\","," "," /**"," * Fires when all tests in a test case have been executed."," * @event testcasecomplete"," * @static"," */ "," TEST_CASE_COMPLETE_EVENT : \"testcasecomplete\","," "," /**"," * Fires when a test suite is opened but before the first "," * test is executed."," * @event testsuitebegin"," * @static"," */ "," TEST_SUITE_BEGIN_EVENT : \"testsuitebegin\","," "," /**"," * Fires when all test cases in a test suite have been"," * completed."," * @event testsuitecomplete"," * @static"," */ "," TEST_SUITE_COMPLETE_EVENT : \"testsuitecomplete\","," "," /**"," * Fires when a test has passed."," * @event pass"," * @static"," */ "," TEST_PASS_EVENT : \"pass\","," "," /**"," * Fires when a test has failed."," * @event fail"," * @static"," */ "," TEST_FAIL_EVENT : \"fail\","," "," /**"," * Fires when a non-test method has an error."," * @event error"," * @static"," */ "," ERROR_EVENT : \"error\","," "," /**"," * Fires when a test has been ignored."," * @event ignore"," * @static"," */ "," TEST_IGNORE_EVENT : \"ignore\","," "," /**"," * Fires when all test suites and test cases have been completed."," * @event complete"," * @static"," */ "," COMPLETE_EVENT : \"complete\","," "," /**"," * Fires when the run() method is called."," * @event begin"," * @static"," */ "," BEGIN_EVENT : \"begin\", ",""," //-------------------------------------------------------------------------"," // Test Tree-Related Methods"," //-------------------------------------------------------------------------"," "," /**"," * Adds a test case to the test tree as a child of the specified node."," * @param {TestNode} parentNode The node to add the test case to as a child."," * @param {Test.TestCase} testCase The test case to add."," * @return {Void}"," * @static"," * @private"," * @method _addTestCaseToTestTree"," */"," _addTestCaseToTestTree : function (parentNode, testCase){"," "," //add the test suite"," var node = parentNode.appendChild(testCase),"," prop,"," testName;"," "," //iterate over the items in the test case"," for (prop in testCase){"," if ((prop.indexOf(\"test\") === 0 || prop.indexOf(\" \") > -1) && typeof testCase[prop] == \"function\"){"," node.appendChild(prop);"," }"," }"," "," },"," "," /**"," * Adds a test suite to the test tree as a child of the specified node."," * @param {TestNode} parentNode The node to add the test suite to as a child."," * @param {Test.TestSuite} testSuite The test suite to add."," * @return {Void}"," * @static"," * @private"," * @method _addTestSuiteToTestTree"," */"," _addTestSuiteToTestTree : function (parentNode, testSuite) {"," "," //add the test suite"," var node = parentNode.appendChild(testSuite);"," "," //iterate over the items in the master suite"," for (var i=0; i < testSuite.items.length; i++){"," if (testSuite.items[i] instanceof YUITest.TestSuite) {"," this._addTestSuiteToTestTree(node, testSuite.items[i]);"," } else if (testSuite.items[i] instanceof YUITest.TestCase) {"," this._addTestCaseToTestTree(node, testSuite.items[i]);"," } "," } "," },"," "," /**"," * Builds the test tree based on items in the master suite. The tree is a hierarchical"," * representation of the test suites, test cases, and test functions. The resulting tree"," * is stored in _root and the pointer _cur is set to the root initially."," * @return {Void}"," * @static"," * @private"," * @method _buildTestTree"," */"," _buildTestTree : function () {"," "," this._root = new TestNode(this.masterSuite);"," //this._cur = this._root;"," "," //iterate over the items in the master suite"," for (var i=0; i < this.masterSuite.items.length; i++){"," if (this.masterSuite.items[i] instanceof YUITest.TestSuite) {"," this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);"," } else if (this.masterSuite.items[i] instanceof YUITest.TestCase) {"," this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);"," } "," } "," "," }, "," "," //-------------------------------------------------------------------------"," // Private Methods"," //-------------------------------------------------------------------------"," "," /**"," * Handles the completion of a test object's tests. Tallies test results "," * from one level up to the next."," * @param {TestNode} node The TestNode representing the test object."," * @return {Void}"," * @method _handleTestObjectComplete"," * @private"," */"," _handleTestObjectComplete : function (node) {"," var parentNode;"," "," if (node && (typeof node.testObject == \"object\")) {"," parentNode = node.parent;"," "," if (parentNode){"," parentNode.results.include(node.results); "," parentNode.results[node.testObject.name] = node.results;"," }"," "," if (node.testObject instanceof YUITest.TestSuite){"," this._execNonTestMethod(node, \"tearDown\", false);"," node.results.duration = (new Date()) - node._start;"," this.fire({ type: this.TEST_SUITE_COMPLETE_EVENT, testSuite: node.testObject, results: node.results});"," } else if (node.testObject instanceof YUITest.TestCase){"," this._execNonTestMethod(node, \"destroy\", false);"," node.results.duration = (new Date()) - node._start;"," this.fire({ type: this.TEST_CASE_COMPLETE_EVENT, testCase: node.testObject, results: node.results});"," } "," } "," }, "," "," //-------------------------------------------------------------------------"," // Navigation Methods"," //-------------------------------------------------------------------------"," "," /**"," * Retrieves the next node in the test tree."," * @return {TestNode} The next node in the test tree or null if the end is reached."," * @private"," * @static"," * @method _next"," */"," _next : function () {"," "," if (this._cur === null){"," this._cur = this._root;"," } else if (this._cur.firstChild) {"," this._cur = this._cur.firstChild;"," } else if (this._cur.next) {"," this._cur = this._cur.next; "," } else {"," while (this._cur && !this._cur.next && this._cur !== this._root){"," this._handleTestObjectComplete(this._cur);"," this._cur = this._cur.parent;"," }"," "," this._handleTestObjectComplete(this._cur); "," "," if (this._cur == this._root){"," this._cur.results.type = \"report\";"," this._cur.results.timestamp = (new Date()).toLocaleString();"," this._cur.results.duration = (new Date()) - this._cur._start; "," this._lastResults = this._cur.results;"," this._running = false; "," this.fire({ type: this.COMPLETE_EVENT, results: this._lastResults});"," this._cur = null;"," } else if (this._cur) {"," this._cur = this._cur.next; "," }"," }"," "," return this._cur;"," },"," "," /**"," * Executes a non-test method (init, setUp, tearDown, destroy)"," * and traps an errors. If an error occurs, an error event is"," * fired."," * @param {Object} node The test node in the testing tree."," * @param {String} methodName The name of the method to execute."," * @param {Boolean} allowAsync Determines if the method can be called asynchronously."," * @return {Boolean} True if an async method was called, false if not."," * @method _execNonTestMethod"," * @private"," */"," _execNonTestMethod: function(node, methodName, allowAsync){"," var testObject = node.testObject,"," event = { type: this.ERROR_EVENT };"," try {"," if (allowAsync && testObject[\"async:\" + methodName]){"," testObject[\"async:\" + methodName](this._context);"," return true;"," } else {"," testObject[methodName](this._context);"," }"," } catch (ex){"," node.results.errors++;"," event.error = ex;"," event.methodName = methodName;"," if (testObject instanceof YUITest.TestCase){"," event.testCase = testObject;"," } else {"," event.testSuite = testSuite;"," }"," "," this.fire(event);"," } ",""," return false;"," },"," "," /**"," * Runs a test case or test suite, returning the results."," * @param {Test.TestCase|YUITest.TestSuite} testObject The test case or test suite to run."," * @return {Object} Results of the execution with properties passed, failed, and total."," * @private"," * @method _run"," * @static"," */"," _run : function () {"," "," //flag to indicate if the TestRunner should wait before continuing"," var shouldWait = false;"," "," //get the next test node"," var node = this._next();"," "," if (node !== null) {"," "," //set flag to say the testrunner is running"," this._running = true;"," "," //eliminate last results"," this._lastResult = null; "," "," var testObject = node.testObject;"," "," //figure out what to do"," if (typeof testObject == \"object\" && testObject !== null){"," if (testObject instanceof YUITest.TestSuite){"," this.fire({ type: this.TEST_SUITE_BEGIN_EVENT, testSuite: testObject });"," node._start = new Date();"," this._execNonTestMethod(node, \"setUp\" ,false);"," } else if (testObject instanceof YUITest.TestCase){"," this.fire({ type: this.TEST_CASE_BEGIN_EVENT, testCase: testObject });"," node._start = new Date();"," "," //regular or async init"," /*try {"," if (testObject[\"async:init\"]){"," testObject[\"async:init\"](this._context);"," return;"," } else {"," testObject.init(this._context);"," }"," } catch (ex){"," node.results.errors++;"," this.fire({ type: this.ERROR_EVENT, error: ex, testCase: testObject, methodName: \"init\" });"," }*/"," if(this._execNonTestMethod(node, \"init\", true)){"," return;"," }"," }"," "," //some environments don't support setTimeout"," if (typeof setTimeout != \"undefined\"){ "," setTimeout(function(){"," YUITest.TestRunner._run();"," }, 0);"," } else {"," this._run();"," }"," } else {"," this._runTest(node);"," }"," "," }"," },"," "," _resumeTest : function (segment) {"," "," //get relevant information"," var node = this._cur; "," "," //we know there's no more waiting now"," this._waiting = false;"," "," //if there's no node, it probably means a wait() was called after resume()"," if (!node){"," //TODO: Handle in some way?"," //console.log(\"wait() called after resume()\");"," //this.fire(\"error\", { testCase: \"(unknown)\", test: \"(unknown)\", error: new Error(\"wait() called after resume()\")} );"," return;"," }"," "," var testName = node.testObject;"," var testCase = node.parent.testObject;"," "," //cancel other waits if available"," if (testCase.__yui_wait){"," clearTimeout(testCase.__yui_wait);"," delete testCase.__yui_wait;"," }",""," //get the \"should\" test cases"," var shouldFail = testName.indexOf(\"fail:\") === 0 ||"," (testCase._should.fail || {})[testName];"," var shouldError = (testCase._should.error || {})[testName];"," "," //variable to hold whether or not the test failed"," var failed = false;"," var error = null;"," "," //try the test"," try {"," "," //run the test"," segment.call(testCase, this._context); "," "," //if the test hasn't already failed and doesn't have any asserts..."," if(YUITest.Assert._getCount() == 0 && !this._ignoreEmpty){"," throw new YUITest.AssertionError(\"Test has no asserts.\");"," } "," //if it should fail, and it got here, then it's a fail because it didn't"," else if (shouldFail){"," error = new YUITest.ShouldFail();"," failed = true;"," } else if (shouldError){"," error = new YUITest.ShouldError();"," failed = true;"," }"," "," } catch (thrown){",""," //cancel any pending waits, the test already failed"," if (testCase.__yui_wait){"," clearTimeout(testCase.__yui_wait);"," delete testCase.__yui_wait;"," } "," "," //figure out what type of error it was"," if (thrown instanceof YUITest.AssertionError) {"," if (!shouldFail){"," error = thrown;"," failed = true;"," }"," } else if (thrown instanceof YUITest.Wait){"," "," if (typeof thrown.segment == \"function\"){"," if (typeof thrown.delay == \"number\"){"," "," //some environments don't support setTimeout"," if (typeof setTimeout != \"undefined\"){"," testCase.__yui_wait = setTimeout(function(){"," YUITest.TestRunner._resumeTest(thrown.segment);"," }, thrown.delay);"," this._waiting = true;"," } else {"," throw new Error(\"Asynchronous tests not supported in this environment.\");"," }"," }"," }"," "," return;"," "," } else {"," //first check to see if it should error"," if (!shouldError) { "," error = new YUITest.UnexpectedError(thrown);"," failed = true;"," } else {"," //check to see what type of data we have"," if (typeof shouldError == \"string\"){"," "," //if it's a string, check the error message"," if (thrown.message != shouldError){"," error = new YUITest.UnexpectedError(thrown);"," failed = true; "," }"," } else if (typeof shouldError == \"function\"){"," "," //if it's a function, see if the error is an instance of it"," if (!(thrown instanceof shouldError)){"," error = new YUITest.UnexpectedError(thrown);"," failed = true;"," }"," "," } else if (typeof shouldError == \"object\" && shouldError !== null){"," "," //if it's an object, check the instance and message"," if (!(thrown instanceof shouldError.constructor) || "," thrown.message != shouldError.message){"," error = new YUITest.UnexpectedError(thrown);"," failed = true; "," }"," "," }"," "," }"," }"," "," }"," "," //fire appropriate event"," if (failed) {"," this.fire({ type: this.TEST_FAIL_EVENT, testCase: testCase, testName: testName, error: error });"," } else {"," this.fire({ type: this.TEST_PASS_EVENT, testCase: testCase, testName: testName });"," }"," "," //run the tear down"," this._execNonTestMethod(node.parent, \"tearDown\", false);"," "," //reset the assert count"," YUITest.Assert._reset();"," "," //calculate duration"," var duration = (new Date()) - node._start;"," "," //update results"," node.parent.results[testName] = { "," result: failed ? \"fail\" : \"pass\","," message: error ? error.getMessage() : \"Test passed\","," type: \"test\","," name: testName,"," duration: duration"," };"," "," if (failed){"," node.parent.results.failed++;"," } else {"," node.parent.results.passed++;"," }"," node.parent.results.total++;"," "," //set timeout not supported in all environments"," if (typeof setTimeout != \"undefined\"){"," setTimeout(function(){"," YUITest.TestRunner._run();"," }, 0);"," } else {"," this._run();"," }"," "," },"," "," /**"," * Handles an error as if it occurred within the currently executing"," * test. This is for mock methods that may be called asynchronously"," * and therefore out of the scope of the TestRunner. Previously, this"," * error would bubble up to the browser. Now, this method is used"," * to tell TestRunner about the error. This should never be called"," * by anyplace other than the Mock object."," * @param {Error} error The error object."," * @return {Void}"," * @method _handleError"," * @private"," * @static"," */"," _handleError: function(error){"," "," if (this._waiting){"," this._resumeTest(function(){"," throw error;"," });"," } else {"," throw error;"," } "," "," },"," "," /**"," * Runs a single test based on the data provided in the node."," * @method _runTest"," * @param {TestNode} node The TestNode representing the test to run."," * @return {Void}"," * @static"," * @private"," */"," _runTest : function (node) {"," "," //get relevant information"," var testName = node.testObject,"," testCase = node.parent.testObject,"," test = testCase[testName],"," "," //get the \"should\" test cases"," shouldIgnore = testName.indexOf(\"ignore:\") === 0 ||"," !inGroups(testCase.groups, this._groups) ||"," (testCase._should.ignore || {})[testName]; //deprecated"," "," //figure out if the test should be ignored or not"," if (shouldIgnore){"," "," //update results"," node.parent.results[testName] = { "," result: \"ignore\","," message: \"Test ignored\","," type: \"test\","," name: testName.indexOf(\"ignore:\") === 0 ? testName.substring(7) : testName"," };"," "," node.parent.results.ignored++;"," node.parent.results.total++;"," "," this.fire({ type: this.TEST_IGNORE_EVENT, testCase: testCase, testName: testName });"," "," //some environments don't support setTimeout"," if (typeof setTimeout != \"undefined\"){ "," setTimeout(function(){"," YUITest.TestRunner._run();"," }, 0); "," } else {"," this._run();"," }"," "," } else {"," "," //mark the start time"," node._start = new Date();"," "," //run the setup"," this._execNonTestMethod(node.parent, \"setUp\", false);"," "," //now call the body of the test"," this._resumeTest(test); "," }"," "," }, ",""," //-------------------------------------------------------------------------"," // Misc Methods"," //------------------------------------------------------------------------- ",""," /**"," * Retrieves the name of the current result set."," * @return {String} The name of the result set."," * @method getName"," */"," getName: function(){"," return this.masterSuite.name;"," }, ",""," /**"," * The name assigned to the master suite of the TestRunner. This is the name"," * that is output as the root's name when results are retrieved."," * @param {String} name The name of the result set."," * @return {Void}"," * @method setName"," */"," setName: function(name){"," this.masterSuite.name = name;"," }, "," "," //-------------------------------------------------------------------------"," // Public Methods"," //------------------------------------------------------------------------- "," "," /**"," * Adds a test suite or test case to the list of test objects to run."," * @param testObject Either a TestCase or a TestSuite that should be run."," * @return {Void}"," * @method add"," * @static"," */"," add : function (testObject) {"," this.masterSuite.add(testObject);"," return this;"," },"," "," /**"," * Removes all test objects from the runner."," * @return {Void}"," * @method clear"," * @static"," */"," clear : function () {"," this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));"," },"," "," /**"," * Indicates if the TestRunner is waiting for a test to resume"," * @return {Boolean} True if the TestRunner is waiting, false if not."," * @method isWaiting"," * @static"," */"," isWaiting: function() {"," return this._waiting;"," },"," "," /**"," * Indicates that the TestRunner is busy running tests and therefore can't"," * be stopped and results cannot be gathered."," * @return {Boolean} True if the TestRunner is running, false if not."," * @method isRunning"," */"," isRunning: function(){"," return this._running;"," },"," "," /**"," * Returns the last complete results set from the TestRunner. Null is returned"," * if the TestRunner is running or no tests have been run."," * @param {Function} format (Optional) A test format to return the results in."," * @return {Object|String} Either the results object or, if a test format is "," * passed as the argument, a string representing the results in a specific"," * format."," * @method getResults"," */"," getResults: function(format){"," if (!this._running && this._lastResults){"," if (typeof format == \"function\"){"," return format(this._lastResults); "," } else {"," return this._lastResults;"," }"," } else {"," return null;"," }"," }, "," "," /**"," * Returns the coverage report for the files that have been executed."," * This returns only coverage information for files that have been"," * instrumented using YUI Test Coverage and only those that were run"," * in the same pass."," * @param {Function} format (Optional) A coverage format to return results in."," * @return {Object|String} Either the coverage object or, if a coverage"," * format is specified, a string representing the results in that format."," * @method getCoverage"," */"," getCoverage: function(format) {"," var covObject = null;"," if (typeof _yuitest_coverage === \"object\") {"," covObject = _yuitest_coverage;"," }"," if (typeof __coverage__ === \"object\") {"," covObject = __coverage__;"," }"," if (!this._running && typeof covObject == \"object\"){"," if (typeof format == \"function\") {"," return format(covObject); "," } else {"," return covObject;"," }"," } else {"," return null;"," } "," },"," "," /**"," * Used to continue processing when a method marked with"," * \"async:\" is executed. This should not be used in test"," * methods, only in init(). Each argument is a string, and"," * when the returned function is executed, the arguments"," * are assigned to the context data object using the string"," * as the key name (value is the argument itself)."," * @private"," * @return {Function} A callback function."," * @method callback"," */"," callback: function(){"," var names = arguments,"," data = this._context,"," that = this;"," "," return function(){"," for (var i=0; i < arguments.length; i++){"," data[names[i]] = arguments[i];"," }"," that._run();"," };"," },"," "," /**"," * Resumes the TestRunner after wait() was called."," * @param {Function} segment The function to run as the rest"," * of the haulted test."," * @return {Void}"," * @method resume"," * @static"," */"," resume : function (segment) {"," if (this._waiting){"," this._resumeTest(segment || function(){});"," } else {"," throw new Error(\"resume() called without wait().\");"," }"," },"," "," /**"," * Runs the test suite."," * @param {Object|Boolean} options (Optional) Options for the runner:"," * <code>oldMode</code> indicates the TestRunner should work in the YUI <= 2.8 way"," * of internally managing test suites. <code>groups</code> is an array"," * of test groups indicating which tests to run."," * @return {Void}"," * @method run"," * @static"," */"," run : function (options) {",""," options = options || {};"," "," //pointer to runner to avoid scope issues "," var runner = YUITest.TestRunner,"," oldMode = options.oldMode;"," "," "," //if there's only one suite on the masterSuite, move it up"," if (!oldMode && this.masterSuite.items.length == 1 && this.masterSuite.items[0] instanceof YUITest.TestSuite){"," this.masterSuite = this.masterSuite.items[0];"," } "," "," //determine if there are any groups to filter on"," runner._groups = (options.groups instanceof Array) ? \",\" + options.groups.join(\",\") + \",\" : \"\";"," "," //initialize the runner"," runner._buildTestTree();"," runner._context = {};"," runner._root._start = new Date();"," "," //fire the begin event"," runner.fire(runner.BEGIN_EVENT);"," "," //begin the testing"," runner._run();"," } "," });"," "," return new TestRunner();"," "," }();","","/**"," * The ArrayAssert object provides functions to test JavaScript array objects"," * for a variety of cases."," * @namespace Test"," * @module test"," * @class ArrayAssert"," * @static"," */"," ","YUITest.ArrayAssert = {",""," //========================================================================="," // Private methods"," //========================================================================="," "," /**"," * Simple indexOf() implementation for an array. Defers to native"," * if available."," * @param {Array} haystack The array to search."," * @param {Variant} needle The value to locate."," * @return {int} The index of the needle if found or -1 if not."," * @method _indexOf"," * @private"," */"," _indexOf: function(haystack, needle){"," if (haystack.indexOf){"," return haystack.indexOf(needle);"," } else {"," for (var i=0; i < haystack.length; i++){"," if (haystack[i] === needle){"," return i;"," }"," }"," return -1;"," }"," },"," "," /**"," * Simple some() implementation for an array. Defers to native"," * if available."," * @param {Array} haystack The array to search."," * @param {Function} matcher The function to run on each value."," * @return {Boolean} True if any value, when run through the matcher,"," * returns true."," * @method _some"," * @private"," */"," _some: function(haystack, matcher){"," if (haystack.some){"," return haystack.some(matcher);"," } else {"," for (var i=0; i < haystack.length; i++){"," if (matcher(haystack[i])){"," return true;"," }"," }"," return false;"," }"," }, ",""," /**"," * Asserts that a value is present in an array. This uses the triple equals "," * sign so no type coercion may occur."," * @param {Object} needle The value that is expected in the array."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method contains"," * @static"," */"," contains : function (needle, haystack, "," message) {"," "," YUITest.Assert._increment(); ",""," if (this._indexOf(haystack, needle) == -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value \" + needle + \" (\" + (typeof needle) + \") not found in array [\" + haystack + \"].\"));"," }"," },",""," /**"," * Asserts that a set of values are present in an array. This uses the triple equals "," * sign so no type coercion may occur. For this assertion to pass, all values must"," * be found."," * @param {Object[]} needles An array of values that are expected in the array."," * @param {Array} haystack An array of values to check."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method containsItems"," * @static"," */"," containsItems : function (needles, haystack, "," message) {"," YUITest.Assert._increment(); ",""," //begin checking values"," for (var i=0; i < needles.length; i++){"," if (this._indexOf(haystack, needles[i]) == -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value \" + needles[i] + \" (\" + (typeof needles[i]) + \") not found in array [\" + haystack + \"].\"));"," }"," }"," },",""," /**"," * Asserts that a value matching some condition is present in an array. This uses"," * a function to determine a match."," * @param {Function} matcher A function that returns true if the items matches or false if not."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method containsMatch"," * @static"," */"," containsMatch : function (matcher, haystack, "," message) {"," "," YUITest.Assert._increment(); "," //check for valid matcher"," if (typeof matcher != \"function\"){"," throw new TypeError(\"ArrayAssert.containsMatch(): First argument must be a function.\");"," }"," "," if (!this._some(haystack, matcher)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"No match found in array [\" + haystack + \"].\"));"," }"," },",""," /**"," * Asserts that a value is not present in an array. This uses the triple equals "," * Asserts that a value is not present in an array. This uses the triple equals "," * sign so no type coercion may occur."," * @param {Object} needle The value that is expected in the array."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method doesNotContain"," * @static"," */"," doesNotContain : function (needle, haystack, "," message) {"," "," YUITest.Assert._increment(); ",""," if (this._indexOf(haystack, needle) > -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value found in array [\" + haystack + \"].\"));"," }"," },",""," /**"," * Asserts that a set of values are not present in an array. This uses the triple equals "," * sign so no type coercion may occur. For this assertion to pass, all values must"," * not be found."," * @param {Object[]} needles An array of values that are not expected in the array."," * @param {Array} haystack An array of values to check."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method doesNotContainItems"," * @static"," */"," doesNotContainItems : function (needles, haystack, "," message) {",""," YUITest.Assert._increment(); ",""," for (var i=0; i < needles.length; i++){"," if (this._indexOf(haystack, needles[i]) > -1){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value found in array [\" + haystack + \"].\"));"," }"," }",""," },"," "," /**"," * Asserts that no values matching a condition are present in an array. This uses"," * a function to determine a match."," * @param {Function} matcher A function that returns true if the item matches or false if not."," * @param {Array} haystack An array of values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method doesNotContainMatch"," * @static"," */"," doesNotContainMatch : function (matcher, haystack, "," message) {"," "," YUITest.Assert._increment(); "," "," //check for valid matcher"," if (typeof matcher != \"function\"){"," throw new TypeError(\"ArrayAssert.doesNotContainMatch(): First argument must be a function.\");"," }"," "," if (this._some(haystack, matcher)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value found in array [\" + haystack + \"].\"));"," }"," },"," "," /**"," * Asserts that the given value is contained in an array at the specified index."," * This uses the triple equals sign so no type coercion will occur."," * @param {Object} needle The value to look for."," * @param {Array} haystack The array to search in."," * @param {int} index The index at which the value should exist."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method indexOf"," * @static"," */"," indexOf : function (needle, haystack, index, message) {"," "," YUITest.Assert._increment(); ",""," //try to find the value in the array"," for (var i=0; i < haystack.length; i++){"," if (haystack[i] === needle){"," if (index != i){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value exists at index \" + i + \" but should be at index \" + index + \".\")); "," }"," return;"," }"," }"," "," //if it makes it here, it wasn't found at all"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value doesn't exist in array [\" + haystack + \"].\"));"," },"," "," /**"," * Asserts that the values in an array are equal, and in the same position,"," * as values in another array. This uses the double equals sign"," * so type coercion may occur. Note that the array objects themselves"," * need not be the same for this test to pass."," * @param {Array} expected An array of the expected values."," * @param {Array} actual Any array of the actual values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method itemsAreEqual"," * @static"," */"," itemsAreEqual : function (expected, actual, "," message) {"," "," YUITest.Assert._increment(); "," "," //first make sure they're array-like (this can probably be improved)"," if (typeof expected != \"object\" || typeof actual != \"object\"){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value should be an array.\"));"," }"," "," //next check array length"," if (expected.length != actual.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should have a length of \" + expected.length + \" but has a length of \" + actual.length + \".\"));"," }"," "," //begin checking values"," for (var i=0; i < expected.length; i++){"," if (expected[i] != actual[i]){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values in position \" + i + \" are not equal.\"), expected[i], actual[i]);"," }"," }"," },"," "," /**"," * Asserts that the values in an array are equivalent, and in the same position,"," * as values in another array. This uses a function to determine if the values"," * are equivalent. Note that the array objects themselves"," * need not be the same for this test to pass."," * @param {Array} expected An array of the expected values."," * @param {Array} actual Any array of the actual values."," * @param {Function} comparator A function that returns true if the values are equivalent"," * or false if not."," * @param {String} message (Optional) The message to display if the assertion fails."," * @return {Void}"," * @method itemsAreEquivalent"," * @static"," */"," itemsAreEquivalent : function (expected, actual, "," comparator, message) {"," "," YUITest.Assert._increment(); ",""," //make sure the comparator is valid"," if (typeof comparator != \"function\"){"," throw new TypeError(\"ArrayAssert.itemsAreEquivalent(): Third argument must be a function.\");"," }"," "," //first check array length"," if (expected.length != actual.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should have a length of \" + expected.length + \" but has a length of \" + actual.length));"," }"," "," //begin checking values"," for (var i=0; i < expected.length; i++){"," if (!comparator(expected[i], actual[i])){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values in position \" + i + \" are not equivalent.\"), expected[i], actual[i]);"," }"," }"," },"," "," /**"," * Asserts that an array is empty."," * @param {Array} actual The array to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isEmpty"," * @static"," */"," isEmpty : function (actual, message) { "," YUITest.Assert._increment(); "," if (actual.length > 0){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should be empty.\"));"," }"," }, "," "," /**"," * Asserts that an array is not empty."," * @param {Array} actual The array to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotEmpty"," * @static"," */"," isNotEmpty : function (actual, message) { "," YUITest.Assert._increment(); "," if (actual.length === 0){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should not be empty.\"));"," }"," }, "," "," /**"," * Asserts that the values in an array are the same, and in the same position,"," * as values in another array. This uses the triple equals sign"," * so no type coercion will occur. Note that the array objects themselves"," * need not be the same for this test to pass."," * @param {Array} expected An array of the expected values."," * @param {Array} actual Any array of the actual values."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method itemsAreSame"," * @static"," */"," itemsAreSame : function (expected, actual, "," message) {"," "," YUITest.Assert._increment(); ",""," //first check array length"," if (expected.length != actual.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Array should have a length of \" + expected.length + \" but has a length of \" + actual.length));"," }"," "," //begin checking values"," for (var i=0; i < expected.length; i++){"," if (expected[i] !== actual[i]){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values in position \" + i + \" are not the same.\"), expected[i], actual[i]);"," }"," }"," },"," "," /**"," * Asserts that the given value is contained in an array at the specified index,"," * starting from the back of the array."," * This uses the triple equals sign so no type coercion will occur."," * @param {Object} needle The value to look for."," * @param {Array} haystack The array to search in."," * @param {int} index The index at which the value should exist."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method lastIndexOf"," * @static"," */"," lastIndexOf : function (needle, haystack, index, message) {"," "," //try to find the value in the array"," for (var i=haystack.length; i >= 0; i--){"," if (haystack[i] === needle){"," if (index != i){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value exists at index \" + i + \" but should be at index \" + index + \".\")); "," }"," return;"," }"," }"," "," //if it makes it here, it wasn't found at all"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Value doesn't exist in array.\")); "," }"," ","};"," ","/**"," * The Assert object provides functions to test JavaScript values against"," * known and expected results. Whenever a comparison (assertion) fails,"," * an error is thrown."," * @namespace Test"," * @module test"," * @class Assert"," * @static"," */","YUITest.Assert = {",""," /**"," * The number of assertions performed."," * @property _asserts"," * @type int"," * @private"," */"," _asserts: 0,",""," //-------------------------------------------------------------------------"," // Helper Methods"," //-------------------------------------------------------------------------"," "," /**"," * Formats a message so that it can contain the original assertion message"," * in addition to the custom message."," * @param {String} customMessage The message passed in by the developer."," * @param {String} defaultMessage The message created by the error by default."," * @return {String} The final error message, containing either or both."," * @protected"," * @static"," * @method _formatMessage"," */"," _formatMessage : function (customMessage, defaultMessage) {"," if (typeof customMessage == \"string\" && customMessage.length > 0){"," return customMessage.replace(\"{message}\", defaultMessage);"," } else {"," return defaultMessage;"," } "," },"," "," /**"," * Returns the number of assertions that have been performed."," * @method _getCount"," * @protected"," * @static"," */"," _getCount: function(){"," return this._asserts;"," },"," "," /**"," * Increments the number of assertions that have been performed."," * @method _increment"," * @protected"," * @static"," */"," _increment: function(){"," this._asserts++;"," },"," "," /**"," * Resets the number of assertions that have been performed to 0."," * @method _reset"," * @protected"," * @static"," */"," _reset: function(){"," this._asserts = 0;"," },"," "," //-------------------------------------------------------------------------"," // Generic Assertion Methods"," //-------------------------------------------------------------------------"," "," /** "," * Forces an assertion error to occur."," * @param {String} message (Optional) The message to display with the failure."," * @method fail"," * @static"," */"," fail : function (message) {"," throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, \"Test force-failed.\"));"," }, "," "," /** "," * A marker that the test should pass."," * @method pass"," * @static"," */"," pass : function (message) {"," YUITest.Assert._increment();"," }, "," "," //-------------------------------------------------------------------------"," // Equality Assertion Methods"," //------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is equal to another. This uses the double equals sign"," * so type coercion may occur."," * @param {Object} expected The expected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areEqual"," * @static"," */"," areEqual : function (expected, actual, message) {"," YUITest.Assert._increment();"," if (expected != actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values should be equal.\"), expected, actual);"," }"," },"," "," /**"," * Asserts that a value is not equal to another. This uses the double equals sign"," * so type coercion may occur."," * @param {Object} unexpected The unexpected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areNotEqual"," * @static"," */"," areNotEqual : function (unexpected, actual, "," message) {"," YUITest.Assert._increment();"," if (unexpected == actual) {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be equal.\"), unexpected);"," }"," },"," "," /**"," * Asserts that a value is not the same as another. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} unexpected The unexpected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areNotSame"," * @static"," */"," areNotSame : function (unexpected, actual, message) {"," YUITest.Assert._increment();"," if (unexpected === actual) {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be the same.\"), unexpected);"," }"," },",""," /**"," * Asserts that a value is the same as another. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} expected The expected value."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areSame"," * @static"," */"," areSame : function (expected, actual, message) {"," YUITest.Assert._increment();"," if (expected !== actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values should be the same.\"), expected, actual);"," }"," }, "," "," //-------------------------------------------------------------------------"," // Boolean Assertion Methods"," //------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is false. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isFalse"," * @static"," */"," isFalse : function (actual, message) {"," YUITest.Assert._increment();"," if (false !== actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be false.\"), false, actual);"," }"," },"," "," /**"," * Asserts that a value is true. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isTrue"," * @static"," */"," isTrue : function (actual, message) {"," YUITest.Assert._increment();"," if (true !== actual) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be true.\"), true, actual);"," }",""," },"," "," //-------------------------------------------------------------------------"," // Special Value Assertion Methods"," //------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is not a number."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNaN"," * @static"," */"," isNaN : function (actual, message){"," YUITest.Assert._increment();"," if (!isNaN(actual)){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be NaN.\"), NaN, actual);"," } "," },"," "," /**"," * Asserts that a value is not the special NaN value."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotNaN"," * @static"," */"," isNotNaN : function (actual, message){"," YUITest.Assert._increment();"," if (isNaN(actual)){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be NaN.\"), NaN);"," } "," },"," "," /**"," * Asserts that a value is not null. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotNull"," * @static"," */"," isNotNull : function (actual, message) {"," YUITest.Assert._increment();"," if (actual === null) {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Values should not be null.\"), null);"," }"," },",""," /**"," * Asserts that a value is not undefined. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNotUndefined"," * @static"," */"," isNotUndefined : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual == \"undefined\") {"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should not be undefined.\"), undefined);"," }"," },",""," /**"," * Asserts that a value is null. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNull"," * @static"," */"," isNull : function (actual, message) {"," YUITest.Assert._increment();"," if (actual !== null) {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be null.\"), null, actual);"," }"," },"," "," /**"," * Asserts that a value is undefined. This uses the triple equals sign"," * so no type coercion may occur."," * @param {Object} actual The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isUndefined"," * @static"," */"," isUndefined : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"undefined\") {"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be undefined.\"), undefined, actual);"," }"," }, "," "," //--------------------------------------------------------------------------"," // Instance Assertion Methods"," //-------------------------------------------------------------------------- "," "," /**"," * Asserts that a value is an array."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isArray"," * @static"," */"," isArray : function (actual, message) {"," YUITest.Assert._increment();"," var shouldFail = false;"," if (Array.isArray){"," shouldFail = !Array.isArray(actual);"," } else {"," shouldFail = Object.prototype.toString.call(actual) != \"[object Array]\";"," }"," if (shouldFail){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be an array.\"), actual);"," } "," },"," "," /**"," * Asserts that a value is a Boolean."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isBoolean"," * @static"," */"," isBoolean : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"boolean\"){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a Boolean.\"), actual);"," } "," },"," "," /**"," * Asserts that a value is a function."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isFunction"," * @static"," */"," isFunction : function (actual, message) {"," YUITest.Assert._increment();"," if (!(actual instanceof Function)){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a function.\"), actual);"," } "," },"," "," /**"," * Asserts that a value is an instance of a particular object. This may return"," * incorrect results when comparing objects from one frame to constructors in"," * another frame. For best results, don't use in a cross-frame manner."," * @param {Function} expected The function that the object should be an instance of."," * @param {Object} actual The object to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isInstanceOf"," * @static"," */"," isInstanceOf : function (expected, actual, message) {"," YUITest.Assert._increment();"," if (!(actual instanceof expected)){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value isn't an instance of expected type.\"), expected, actual);"," }"," },"," "," /**"," * Asserts that a value is a number."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isNumber"," * @static"," */"," isNumber : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"number\"){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a number.\"), actual);"," } "," }, "," "," /**"," * Asserts that a value is an object."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isObject"," * @static"," */"," isObject : function (actual, message) {"," YUITest.Assert._increment();"," if (!actual || (typeof actual != \"object\" && typeof actual != \"function\")){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be an object.\"), actual);"," }"," },"," "," /**"," * Asserts that a value is a string."," * @param {Object} actual The value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isString"," * @static"," */"," isString : function (actual, message) {"," YUITest.Assert._increment();"," if (typeof actual != \"string\"){"," throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, \"Value should be a string.\"), actual);"," }"," },"," "," /**"," * Asserts that a value is of a particular type. "," * @param {String} expectedType The expected type of the variable."," * @param {Object} actualValue The actual value to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method isTypeOf"," * @static"," */"," isTypeOf : function (expectedType, actualValue, message){"," YUITest.Assert._increment();"," if (typeof actualValue != expectedType){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Value should be of type \" + expectedType + \".\"), expectedType, typeof actualValue);"," }"," },"," "," //--------------------------------------------------------------------------"," // Error Detection Methods"," //-------------------------------------------------------------------------- "," "," /**"," * Asserts that executing a particular method should throw an error of"," * a specific type. This is a replacement for _should.error."," * @param {String|Function|Object} expectedError If a string, this"," * is the error message that the error must have; if a function, this"," * is the constructor that should have been used to create the thrown"," * error; if an object, this is an instance of a particular error type"," * with a specific error message (both must match)."," * @param {Function} method The method to execute that should throw the error."," * @param {String} message (Optional) The message to display if the assertion"," * fails."," * @method throwsError"," * @return {void}"," * @static"," */"," throwsError: function(expectedError, method, message){"," YUITest.Assert._increment();"," var error = false;"," "," try {"," method(); "," } catch (thrown) {"," "," //check to see what type of data we have"," if (typeof expectedError == \"string\"){"," "," //if it's a string, check the error message"," if (thrown.message != expectedError){"," error = true;"," }"," } else if (typeof expectedError == \"function\"){"," "," //if it's a function, see if the error is an instance of it"," if (!(thrown instanceof expectedError)){"," error = true;"," }"," "," } else if (typeof expectedError == \"object\" && expectedError !== null){"," "," //if it's an object, check the instance and message"," if (!(thrown instanceof expectedError.constructor) || "," thrown.message != expectedError.message){"," error = true;"," }"," "," } else { //if it gets here, the argument could be wrong"," error = true;"," }"," "," if (error){"," throw new YUITest.UnexpectedError(thrown); "," } else {"," return;"," }"," }"," "," //if it reaches here, the error wasn't thrown, which is a bad thing"," throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, \"Error should have been thrown.\"));"," }","","};","/**"," * Error is thrown whenever an assertion fails. It provides methods"," * to more easily get at error information and also provides a base class"," * from which more specific assertion errors can be derived."," *"," * @param {String} message The message to display when the error occurs."," * @namespace Test"," * @module test"," * @class AssertionError"," * @constructor"," */ ","YUITest.AssertionError = function (message){"," "," /**"," * Error message. Must be duplicated to ensure browser receives it."," * @type String"," * @property message"," */"," this.message = message;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"Assert Error\";","};","","YUITest.AssertionError.prototype = {",""," //restore constructor"," constructor: YUITest.AssertionError,",""," /**"," * Returns a fully formatted error for an assertion failure. This should"," * be overridden by all subclasses to provide specific information."," * @method getMessage"," * @return {String} A string describing the error."," */"," getMessage : function () {"," return this.message;"," },"," "," /**"," * Returns a string representation of the error."," * @method toString"," * @return {String} A string representation of the error."," */"," toString : function () {"," return this.name + \": \" + this.getMessage();"," }","","};/**"," * ComparisonFailure is subclass of Error that is thrown whenever"," * a comparison between two values fails. It provides mechanisms to retrieve"," * both the expected and actual value."," *"," * @param {String} message The message to display when the error occurs."," * @param {Object} expected The expected value."," * @param {Object} actual The actual value that caused the assertion to fail."," * @namespace Test "," * @extends AssertionError"," * @module test"," * @class ComparisonFailure"," * @constructor"," */ ","YUITest.ComparisonFailure = function (message, expected, actual){",""," //call superclass"," YUITest.AssertionError.call(this, message);"," "," /**"," * The expected value."," * @type Object"," * @property expected"," */"," this.expected = expected;"," "," /**"," * The actual value."," * @type Object"," * @property actual"," */"," this.actual = actual;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"ComparisonFailure\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.ComparisonFailure.prototype = new YUITest.AssertionError;","","//restore constructor","YUITest.ComparisonFailure.prototype.constructor = YUITest.ComparisonFailure;","","/**"," * Returns a fully formatted error for an assertion failure. This message"," * provides information about the expected and actual values."," * @method getMessage"," * @return {String} A string describing the error."," */","YUITest.ComparisonFailure.prototype.getMessage = function(){"," return this.message + \"\\nExpected: \" + this.expected + \" (\" + (typeof this.expected) + \")\" +"," \"\\nActual: \" + this.actual + \" (\" + (typeof this.actual) + \")\";","};","/**"," * An object object containing coverage result formatting methods."," * @namespace Test"," * @module test"," * @class CoverageFormat"," * @static"," */","YUITest.CoverageFormat = {",""," /**"," * Returns the coverage report in JSON format. This is the straight"," * JSON representation of the native coverage report."," * @param {Object} coverage The coverage report object."," * @return {String} A JSON-formatted string of coverage data."," * @method JSON"," * @namespace Test.CoverageFormat"," */"," JSON: function(coverage){"," return YUITest.Util.JSON.stringify(coverage);"," },"," "," /**"," * Returns the coverage report in a JSON format compatible with"," * Xdebug. See <a href=\"http://www.xdebug.com/docs/code_coverage\">Xdebug Documentation</a>"," * for more information. Note: function coverage is not available"," * in this format."," * @param {Object} coverage The coverage report object."," * @return {String} A JSON-formatted string of coverage data."," * @method XdebugJSON"," * @namespace Test.CoverageFormat"," */ "," XdebugJSON: function(coverage){"," "," var report = {};"," for (var prop in coverage){"," if (coverage.hasOwnProperty(prop)){"," report[prop] = coverage[prop].lines;"," }"," }",""," return YUITest.Util.JSON.stringify(coverage);"," }","","};","","/**"," * The DateAssert object provides functions to test JavaScript Date objects"," * for a variety of cases."," * @namespace Test"," * @module test"," * @class DateAssert"," * @static"," */"," ","YUITest.DateAssert = {",""," /**"," * Asserts that a date's month, day, and year are equal to another date's."," * @param {Date} expected The expected date."," * @param {Date} actual The actual date to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method datesAreEqual"," * @static"," */"," datesAreEqual : function (expected, actual, message){"," YUITest.Assert._increment(); "," if (expected instanceof Date && actual instanceof Date){"," var msg = \"\";"," "," //check years first"," if (expected.getFullYear() != actual.getFullYear()){"," msg = \"Years should be equal.\";"," }"," "," //now check months"," if (expected.getMonth() != actual.getMonth()){"," msg = \"Months should be equal.\";"," } "," "," //last, check the day of the month"," if (expected.getDate() != actual.getDate()){"," msg = \"Days of month should be equal.\";"," } "," "," if (msg.length){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);"," }"," } else {"," throw new TypeError(\"YUITest.DateAssert.datesAreEqual(): Expected and actual values must be Date objects.\");"," }"," },",""," /**"," * Asserts that a date's hour, minutes, and seconds are equal to another date's."," * @param {Date} expected The expected date."," * @param {Date} actual The actual date to test."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method timesAreEqual"," * @static"," */"," timesAreEqual : function (expected, actual, message){"," YUITest.Assert._increment();"," if (expected instanceof Date && actual instanceof Date){"," var msg = \"\";"," "," //check hours first"," if (expected.getHours() != actual.getHours()){"," msg = \"Hours should be equal.\";"," }"," "," //now check minutes"," if (expected.getMinutes() != actual.getMinutes()){"," msg = \"Minutes should be equal.\";"," } "," "," //last, check the seconds"," if (expected.getSeconds() != actual.getSeconds()){"," msg = \"Seconds should be equal.\";"," } "," "," if (msg.length){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);"," }"," } else {"," throw new TypeError(\"YUITest.DateAssert.timesAreEqual(): Expected and actual values must be Date objects.\");"," }"," }"," ","};/**"," * Creates a new mock object."," * @namespace Test"," * @module test"," * @class Mock"," * @constructor"," * @param {Object} template (Optional) An object whose methods"," * should be stubbed out on the mock object."," */","YUITest.Mock = function(template){",""," //use blank object is nothing is passed in"," template = template || {};"," "," var mock,"," name;"," "," //try to create mock that keeps prototype chain intact"," //fails in the case of ActiveX objects"," try {"," function f(){}"," f.prototype = template;"," mock = new f();"," } catch (ex) {"," mock = {};"," }",""," //create stubs for all methods"," for (name in template){"," if (template.hasOwnProperty(name)){"," if (typeof template[name] == \"function\"){"," mock[name] = function(name){"," return function(){"," YUITest.Assert.fail(\"Method \" + name + \"() was called but was not expected to be.\");"," };"," }(name);"," }"," }"," }",""," //return it"," return mock; ","};"," ","/**"," * Assigns an expectation to a mock object. This is used to create"," * methods and properties on the mock object that are monitored for"," * calls and changes, respectively."," * @param {Object} mock The object to add the expectation to."," * @param {Object} expectation An object defining the expectation. For"," * properties, the keys \"property\" and \"value\" are required. For a"," * method the \"method\" key defines the method's name, the optional \"args\""," * key provides an array of argument types. The \"returns\" key provides"," * an optional return value. An optional \"run\" key provides a function"," * to be used as the method body. The return value of a mocked method is"," * determined first by the \"returns\" key, then the \"run\" function's return"," * value. If neither \"returns\" nor \"run\" is provided undefined is returned."," * An optional 'error' key defines an error type to be thrown in all cases."," * The \"callCount\" key provides an optional number of times the method is"," * expected to be called (the default is 1)."," * @return {void}"," * @method expect"," * @static"," */ ","YUITest.Mock.expect = function(mock /*:Object*/, expectation /*:Object*/){",""," //make sure there's a place to store the expectations"," if (!mock.__expectations) {"," mock.__expectations = {};"," }",""," //method expectation"," if (expectation.method){"," var name = expectation.method,"," args = expectation.args || [],"," result = expectation.returns,"," callCount = (typeof expectation.callCount == \"number\") ? expectation.callCount : 1,"," error = expectation.error,"," run = expectation.run || function(){},"," runResult,"," i;",""," //save expectations"," mock.__expectations[name] = expectation;"," expectation.callCount = callCount;"," expectation.actualCallCount = 0;"," "," //process arguments"," for (i=0; i < args.length; i++){"," if (!(args[i] instanceof YUITest.Mock.Value)){"," args[i] = YUITest.Mock.Value(YUITest.Assert.areSame, [args[i]], \"Argument \" + i + \" of \" + name + \"() is incorrect.\");"," } "," }"," "," //if the method is expected to be called"," if (callCount > 0){"," mock[name] = function(){ "," try {"," expectation.actualCallCount++;"," YUITest.Assert.areEqual(args.length, arguments.length, \"Method \" + name + \"() passed incorrect number of arguments.\");"," for (var i=0, len=args.length; i < len; i++){"," args[i].verify(arguments[i]);"," } ",""," runResult = run.apply(this, arguments);"," "," if (error){"," throw error;"," }"," } catch (ex){"," //route through TestRunner for proper handling"," YUITest.TestRunner._handleError(ex);"," }",""," // Any value provided for 'returns' overrides any value returned"," // by our 'run' function. "," return expectation.hasOwnProperty('returns') ? result : runResult;"," };"," } else {"," "," //method should fail if called when not expected"," mock[name] = function(){"," try {"," YUITest.Assert.fail(\"Method \" + name + \"() should not have been called.\");"," } catch (ex){"," //route through TestRunner for proper handling"," YUITest.TestRunner._handleError(ex);"," } "," };"," }"," } else if (expectation.property){"," //save expectations"," mock.__expectations[expectation.property] = expectation;"," }","};","","/**"," * Verifies that all expectations of a mock object have been met and"," * throws an assertion error if not."," * @param {Object} mock The object to verify.."," * @return {void}"," * @method verify"," * @static"," */ ","YUITest.Mock.verify = function(mock){ "," try {"," "," for (var name in mock.__expectations){"," if (mock.__expectations.hasOwnProperty(name)){"," var expectation = mock.__expectations[name];"," if (expectation.method) {"," YUITest.Assert.areEqual(expectation.callCount, expectation.actualCallCount, \"Method \" + expectation.method + \"() wasn't called the expected number of times.\");"," } else if (expectation.property){"," YUITest.Assert.areEqual(expectation.value, mock[expectation.property], \"Property \" + expectation.property + \" wasn't set to the correct value.\"); "," } "," }"," }",""," } catch (ex){"," //route through TestRunner for proper handling"," YUITest.TestRunner._handleError(ex);"," }","};","","/**"," * Creates a new value matcher."," * @param {Function} method The function to call on the value."," * @param {Array} originalArgs (Optional) Array of arguments to pass to the method."," * @param {String} message (Optional) Message to display in case of failure."," * @namespace Test.Mock"," * @module test"," * @class Value"," * @constructor"," */","YUITest.Mock.Value = function(method, originalArgs, message){"," if (this instanceof YUITest.Mock.Value){"," this.verify = function(value){"," var args = [].concat(originalArgs || []);"," args.push(value);"," args.push(message);"," method.apply(null, args);"," };"," } else {"," return new YUITest.Mock.Value(method, originalArgs, message);"," }","};","","/**"," * Predefined matcher to match any value."," * @property Any"," * @static"," * @type Function"," */","YUITest.Mock.Value.Any = YUITest.Mock.Value(function(){});","","/**"," * Predefined matcher to match boolean values."," * @property Boolean"," * @static"," * @type Function"," */","YUITest.Mock.Value.Boolean = YUITest.Mock.Value(YUITest.Assert.isBoolean);","","/**"," * Predefined matcher to match number values."," * @property Number"," * @static"," * @type Function"," */","YUITest.Mock.Value.Number = YUITest.Mock.Value(YUITest.Assert.isNumber);","","/**"," * Predefined matcher to match string values."," * @property String"," * @static"," * @type Function"," */","YUITest.Mock.Value.String = YUITest.Mock.Value(YUITest.Assert.isString);","","/**"," * Predefined matcher to match object values."," * @property Object"," * @static"," * @type Function"," */","YUITest.Mock.Value.Object = YUITest.Mock.Value(YUITest.Assert.isObject);","","/**"," * Predefined matcher to match function values."," * @property Function"," * @static"," * @type Function"," */","YUITest.Mock.Value.Function = YUITest.Mock.Value(YUITest.Assert.isFunction);","","/**"," * The ObjectAssert object provides functions to test JavaScript objects"," * for a variety of cases."," * @namespace Test"," * @module test"," * @class ObjectAssert"," * @static"," */","YUITest.ObjectAssert = {",""," /**"," * Asserts that an object has all of the same properties"," * and property values as the other."," * @param {Object} expected The object with all expected properties and values."," * @param {Object} actual The object to inspect."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method areEqual"," * @static"," * @deprecated"," */"," areEqual: function(expected, actual, message) {"," YUITest.Assert._increment(); "," "," var expectedKeys = YUITest.Object.keys(expected),"," actualKeys = YUITest.Object.keys(actual);"," "," //first check keys array length"," if (expectedKeys.length != actualKeys.length){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Object should have \" + expectedKeys.length + \" keys but has \" + actualKeys.length));"," }"," "," //then check values"," for (var name in expected){"," if (expected.hasOwnProperty(name)){"," if (expected[name] != actual[name]){"," throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, \"Values should be equal for property \" + name), expected[name], actual[name]);"," } "," }"," } "," },"," "," /**"," * Asserts that an object has a property with the given name."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method hasKey"," * @static"," * @deprecated Use ownsOrInheritsKey() instead"," */ "," hasKey: function (propertyName, object, message) {"," YUITest.ObjectAssert.ownsOrInheritsKey(propertyName, object, message); "," },"," "," /**"," * Asserts that an object has all properties of a reference object."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method hasKeys"," * @static"," * @deprecated Use ownsOrInheritsKeys() instead"," */ "," hasKeys: function (properties, object, message) {"," YUITest.ObjectAssert.ownsOrInheritsKeys(properties, object, message);"," },"," "," /**"," * Asserts that a property with the given name exists on an object's prototype."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method inheritsKey"," * @static"," */ "," inheritsKey: function (propertyName, object, message) {"," YUITest.Assert._increment(); "," if (!(propertyName in object && !object.hasOwnProperty(propertyName))){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + propertyName + \"' not found on object instance.\"));"," } "," },"," "," /**"," * Asserts that all properties exist on an object prototype."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method inheritsKeys"," * @static"," */ "," inheritsKeys: function (properties, object, message) {"," YUITest.Assert._increment(); "," for (var i=0; i < properties.length; i++){"," if (!(propertyName in object && !object.hasOwnProperty(properties[i]))){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + properties[i] + \"' not found on object instance.\"));"," } "," }"," },"," "," /**"," * Asserts that a property with the given name exists on an object instance (not on its prototype)."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsKey"," * @static"," */ "," ownsKey: function (propertyName, object, message) {"," YUITest.Assert._increment(); "," if (!object.hasOwnProperty(propertyName)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + propertyName + \"' not found on object instance.\"));"," } "," },"," "," /**"," * Asserts that all properties exist on an object instance (not on its prototype)."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsKeys"," * @static"," */ "," ownsKeys: function (properties, object, message) {"," YUITest.Assert._increment(); "," for (var i=0; i < properties.length; i++){"," if (!object.hasOwnProperty(properties[i])){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + properties[i] + \"' not found on object instance.\"));"," } "," }"," },"," "," /**"," * Asserts that an object owns no properties."," * @param {Object} object The object to check."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsNoKeys"," * @static"," */ "," ownsNoKeys : function (object, message) {"," YUITest.Assert._increment(); "," var count = 0,"," name;"," for (name in object){"," if (object.hasOwnProperty(name)){"," count++;"," }"," }"," "," if (count !== 0){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Object owns \" + count + \" properties but should own none.\")); "," }",""," },",""," /**"," * Asserts that an object has a property with the given name."," * @param {String} propertyName The name of the property to test."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsOrInheritsKey"," * @static"," */ "," ownsOrInheritsKey: function (propertyName, object, message) {"," YUITest.Assert._increment(); "," if (!(propertyName in object)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + propertyName + \"' not found on object.\"));"," } "," },"," "," /**"," * Asserts that an object has all properties of a reference object."," * @param {Array} properties An array of property names that should be on the object."," * @param {Object} object The object to search."," * @param {String} message (Optional) The message to display if the assertion fails."," * @method ownsOrInheritsKeys"," * @static"," */ "," ownsOrInheritsKeys: function (properties, object, message) {"," YUITest.Assert._increment(); "," for (var i=0; i < properties.length; i++){"," if (!(properties[i] in object)){"," YUITest.Assert.fail(YUITest.Assert._formatMessage(message, \"Property '\" + properties[i] + \"' not found on object.\"));"," } "," }"," } ","};","/**"," * Convenience type for storing and aggregating"," * test result information."," * @private"," * @namespace Test"," * @module test"," * @class Results"," * @constructor"," * @param {String} name The name of the test."," */","YUITest.Results = function(name){",""," /**"," * Name of the test, test case, or test suite."," * @type String"," * @property name"," */"," this.name = name;"," "," /**"," * Number of passed tests."," * @type int"," * @property passed"," */"," this.passed = 0;"," "," /**"," * Number of failed tests."," * @type int"," * @property failed"," */"," this.failed = 0;"," "," /**"," * Number of errors that occur in non-test methods."," * @type int"," * @property errors"," */"," this.errors = 0;"," "," /**"," * Number of ignored tests."," * @type int"," * @property ignored"," */"," this.ignored = 0;"," "," /**"," * Number of total tests."," * @type int"," * @property total"," */"," this.total = 0;"," "," /**"," * Amount of time (ms) it took to complete testing."," * @type int"," * @property duration"," */"," this.duration = 0;","};","","/**"," * Includes results from another results object into this one."," * @param {Test.Results} result The results object to include."," * @method include"," * @return {void}"," */","YUITest.Results.prototype.include = function(results){"," this.passed += results.passed;"," this.failed += results.failed;"," this.ignored += results.ignored;"," this.total += results.total;"," this.errors += results.errors;","};","/**"," * ShouldError is subclass of Error that is thrown whenever"," * a test is expected to throw an error but doesn't."," *"," * @param {String} message The message to display when the error occurs."," * @namespace Test "," * @extends AssertionError"," * @module test"," * @class ShouldError"," * @constructor"," */ ","YUITest.ShouldError = function (message){",""," //call superclass"," YUITest.AssertionError.call(this, message || \"This test should have thrown an error but didn't.\");"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"ShouldError\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.ShouldError.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.ShouldError.prototype.constructor = YUITest.ShouldError;","/**"," * ShouldFail is subclass of AssertionError that is thrown whenever"," * a test was expected to fail but did not."," *"," * @param {String} message The message to display when the error occurs."," * @namespace Test "," * @extends YUITest.AssertionError"," * @module test"," * @class ShouldFail"," * @constructor"," */ ","YUITest.ShouldFail = function (message){",""," //call superclass"," YUITest.AssertionError.call(this, message || \"This test should fail but didn't.\");"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"ShouldFail\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.ShouldFail.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.ShouldFail.prototype.constructor = YUITest.ShouldFail;","/**"," * UnexpectedError is subclass of AssertionError that is thrown whenever"," * an error occurs within the course of a test and the test was not expected"," * to throw an error."," *"," * @param {Error} cause The unexpected error that caused this error to be "," * thrown."," * @namespace Test "," * @extends YUITest.AssertionError"," * @module test"," * @class UnexpectedError"," * @constructor"," */ ","YUITest.UnexpectedError = function (cause){",""," //call superclass"," YUITest.AssertionError.call(this, \"Unexpected error: \" + cause.message);"," "," /**"," * The unexpected error that occurred."," * @type Error"," * @property cause"," */"," this.cause = cause;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"UnexpectedError\";"," "," /**"," * Stack information for the error (if provided)."," * @type String"," * @property stack"," */"," this.stack = cause.stack;"," ","};","","//inherit from YUITest.AssertionError","YUITest.UnexpectedError.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.UnexpectedError.prototype.constructor = YUITest.UnexpectedError;","/**"," * UnexpectedValue is subclass of Error that is thrown whenever"," * a value was unexpected in its scope. This typically means that a test"," * was performed to determine that a value was *not* equal to a certain"," * value."," *"," * @param {String} message The message to display when the error occurs."," * @param {Object} unexpected The unexpected value."," * @namespace Test "," * @extends AssertionError"," * @module test"," * @class UnexpectedValue"," * @constructor"," */ ","YUITest.UnexpectedValue = function (message, unexpected){",""," //call superclass"," YUITest.AssertionError.call(this, message);"," "," /**"," * The unexpected value."," * @type Object"," * @property unexpected"," */"," this.unexpected = unexpected;"," "," /**"," * The name of the error that occurred."," * @type String"," * @property name"," */"," this.name = \"UnexpectedValue\";"," ","};","","//inherit from YUITest.AssertionError","YUITest.UnexpectedValue.prototype = new YUITest.AssertionError();","","//restore constructor","YUITest.UnexpectedValue.prototype.constructor = YUITest.UnexpectedValue;","","/**"," * Returns a fully formatted error for an assertion failure. This message"," * provides information about the expected and actual values."," * @method getMessage"," * @return {String} A string describing the error."," */","YUITest.UnexpectedValue.prototype.getMessage = function(){"," return this.message + \"\\nUnexpected: \" + this.unexpected + \" (\" + (typeof this.unexpected) + \") \";","};","","/**"," * Represents a stoppage in test execution to wait for an amount of time before"," * continuing."," * @param {Function} segment A function to run when the wait is over."," * @param {int} delay The number of milliseconds to wait before running the code."," * @module test"," * @class Wait"," * @namespace Test"," * @constructor"," *"," */","YUITest.Wait = function (segment, delay) {"," "," /**"," * The segment of code to run when the wait is over."," * @type Function"," * @property segment"," */"," this.segment = (typeof segment == \"function\" ? segment : null);",""," /**"," * The delay before running the segment of code."," * @type int"," * @property delay"," */"," this.delay = (typeof delay == \"number\" ? delay : 0); ","};","","","//Setting up our aliases..","Y.Test = YUITest;","Y.Object.each(YUITest, function(item, name) {"," var name = name.replace('Test', '');"," Y.Test[name] = item;","});","","} //End of else in top wrapper","","Y.Assert = YUITest.Assert;","Y.Assert.Error = Y.Test.AssertionError;","Y.Assert.ComparisonFailure = Y.Test.ComparisonFailure;","Y.Assert.UnexpectedValue = Y.Test.UnexpectedValue;","Y.Mock = Y.Test.Mock;","Y.ObjectAssert = Y.Test.ObjectAssert;","Y.ArrayAssert = Y.Test.ArrayAssert;","Y.DateAssert = Y.Test.DateAssert;","Y.Test.ResultsFormat = Y.Test.TestFormat;","","var itemsAreEqual = Y.Test.ArrayAssert.itemsAreEqual;","","Y.Test.ArrayAssert.itemsAreEqual = function(expected, actual, message) {"," return itemsAreEqual.call(this, Y.Array(expected), Y.Array(actual), message);","};","","","/**"," * Asserts that a given condition is true. If not, then a Y.Assert.Error object is thrown"," * and the test fails."," * @method assert"," * @param {Boolean} condition The condition to test."," * @param {String} message The message to display if the assertion fails."," * @for YUI"," * @static"," */","Y.assert = function(condition, message){"," Y.Assert._increment();"," if (!condition){"," throw new Y.Assert.Error(Y.Assert._formatMessage(message, \"Assertion failed.\"));"," }","};","","/**"," * Forces an assertion error to occur. Shortcut for Y.Assert.fail()."," * @method fail"," * @param {String} message (Optional) The message to display with the failure."," * @for YUI"," * @static"," */","Y.fail = Y.Assert.fail; ","","Y.Test.Runner.once = Y.Test.Runner.subscribe;","","Y.Test.Runner.disableLogging = function() {"," Y.Test.Runner._log = false;","};","","Y.Test.Runner.enableLogging = function() {"," Y.Test.Runner._log = true;","};","","Y.Test.Runner._ignoreEmpty = true;","Y.Test.Runner._log = true;","","Y.Test.Runner.on = Y.Test.Runner.attach;","","//Only allow one instance of YUITest","if (!YUI.YUITest) {",""," if (Y.config.win) {"," Y.config.win.YUITest = YUITest;"," }",""," YUI.YUITest = Y.Test;",""," "," //Only setup the listeners once."," var logEvent = function(event) {"," "," //data variables"," var message = \"\";"," var messageType = \"\";"," "," switch(event.type){"," case this.BEGIN_EVENT:"," message = \"Testing began at \" + (new Date()).toString() + \".\";"," messageType = \"info\";"," break;"," "," case this.COMPLETE_EVENT:"," message = Y.Lang.sub(\"Testing completed at \" +"," (new Date()).toString() + \".\\n\" +"," \"Passed:{passed} Failed:{failed} \" +"," \"Total:{total} ({ignored} ignored)\","," event.results);"," messageType = \"info\";"," break;"," "," case this.TEST_FAIL_EVENT:"," message = event.testName + \": failed.\\n\" + event.error.getMessage();"," messageType = \"fail\";"," break;"," "," case this.TEST_IGNORE_EVENT:"," message = event.testName + \": ignored.\";"," messageType = \"ignore\";"," break;"," "," case this.TEST_PASS_EVENT:"," message = event.testName + \": passed.\";"," messageType = \"pass\";"," break;"," "," case this.TEST_SUITE_BEGIN_EVENT:"," message = \"Test suite \\\"\" + event.testSuite.name + \"\\\" started.\";"," messageType = \"info\";"," break;"," "," case this.TEST_SUITE_COMPLETE_EVENT:"," message = Y.Lang.sub(\"Test suite \\\"\" +"," event.testSuite.name + \"\\\" completed\" + \".\\n\" +"," \"Passed:{passed} Failed:{failed} \" +"," \"Total:{total} ({ignored} ignored)\","," event.results);"," messageType = \"info\";"," break;"," "," case this.TEST_CASE_BEGIN_EVENT:"," message = \"Test case \\\"\" + event.testCase.name + \"\\\" started.\";"," messageType = \"info\";"," break;"," "," case this.TEST_CASE_COMPLETE_EVENT:"," message = Y.Lang.sub(\"Test case \\\"\" +"," event.testCase.name + \"\\\" completed.\\n\" +"," \"Passed:{passed} Failed:{failed} \" +"," \"Total:{total} ({ignored} ignored)\","," event.results);"," messageType = \"info\";"," break;"," default:"," message = \"Unexpected event \" + event.type;"," messageType = \"info\";"," }"," "," if (Y.Test.Runner._log) {"," Y.log(message, messageType, \"TestRunner\");"," }"," };",""," var i, name;",""," for (i in Y.Test.Runner) {"," name = Y.Test.Runner[i];"," if (i.indexOf('_EVENT') > -1) {"," Y.Test.Runner.subscribe(name, logEvent);"," }"," };","","} //End if for YUI.YUITest","","","}, '3.7.3', {\"requires\": [\"event-simulate\", \"event-custom\", \"json-stringify\"]});"];+_yuitest_coverage["build/test/test.js"].lines = {"1":0,"16":0,"17":0,"21":0,"24":0,"28":0,"32":0,"33":0,"34":0,"46":0,"55":0,"59":0,"76":0,"77":0,"80":0,"92":0,"103":0,"104":0,"106":0,"107":0,"110":0,"111":0,"114":0,"115":0,"116":0,"117":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"150":0,"165":0,"172":0,"180":0,"183":0,"184":0,"185":0,"186":0,"187":0,"188":0,"194":0,"195":0,"200":0,"212":0,"213":0,"215":0,"251":0,"258":0,"261":0,"262":0,"266":0,"267":0,"273":0,"286":0,"297":0,"312":0,"313":0,"315":0,"316":0,"318":0,"319":0,"336":0,"337":0,"338":0,"348":0,"398":0,"406":0,"408":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"421":0,"431":0,"443":0,"444":0,"446":0,"447":0,"450":0,"451":0,"453":0,"454":0,"455":0,"456":0,"457":0,"463":0,"465":0,"468":0,"482":0,"483":0,"485":0,"488":0,"489":0,"490":0,"491":0,"493":0,"495":0,"500":0,"502":0,"503":0,"504":0,"505":0,"510":0,"511":0,"515":0,"516":0,"517":0,"518":0,"522":0,"527":0,"529":0,"530":0,"531":0,"532":0,"537":0,"542":0,"546":0,"559":0,"561":0,"562":0,"564":0,"567":0,"569":0,"571":0,"572":0,"575":0,"577":0,"579":0,"583":0,"585":0,"586":0,"587":0,"588":0,"593":0,"596":0,"600":0,"602":0,"603":0,"604":0,"605":0,"610":0,"611":0,"615":0,"616":0,"617":0,"618":0,"626":0,"630":0,"646":0,"653":0,"660":0,"668":0,"676":0,"684":0,"687":0,"700":0,"709":0,"719":0,"720":0,"721":0,"723":0,"724":0,"725":0,"727":0,"739":0,"740":0,"741":0,"742":0,"743":0,"744":0,"745":0,"748":0,"749":0,"751":0,"752":0,"755":0,"756":0,"757":0,"758":0,"759":0,"761":0,"765":0,"768":0,"769":0,"773":0,"774":0,"775":0,"778":0,"779":0,"780":0,"781":0,"782":0,"783":0,"784":0,"785":0,"790":0,"791":0,"792":0,"794":0,"795":0,"810":0,"819":0,"820":0,"821":0,"823":0,"824":0,"825":0,"826":0,"830":0,"843":0,"850":0,"857":0,"864":0,"871":0,"878":0,"885":0,"888":0,"889":0,"890":0,"891":0,"892":0,"893":0,"898":0,"908":0,"909":0,"910":0,"912":0,"913":0,"915":0,"916":0,"928":0,"931":0,"940":0,"949":0,"958":0,"967":0,"977":0,"986":0,"996":0,"1005":0,"1016":0,"1020":0,"1127":0,"1132":0,"1133":0,"1134":0,"1152":0,"1155":0,"1156":0,"1157":0,"1158":0,"1159":0,"1175":0,"1179":0,"1180":0,"1181":0,"1182":0,"1183":0,"1202":0,"1204":0,"1205":0,"1207":0,"1208":0,"1209":0,"1212":0,"1213":0,"1214":0,"1215":0,"1216":0,"1217":0,"1218":0,"1219":0,"1237":0,"1238":0,"1239":0,"1240":0,"1241":0,"1242":0,"1244":0,"1245":0,"1246":0,"1249":0,"1251":0,"1252":0,"1253":0,"1254":0,"1255":0,"1256":0,"1257":0,"1258":0,"1259":0,"1260":0,"1264":0,"1279":0,"1281":0,"1282":0,"1283":0,"1284":0,"1286":0,"1289":0,"1290":0,"1291":0,"1292":0,"1293":0,"1295":0,"1298":0,"1301":0,"1315":0,"1318":0,"1320":0,"1323":0,"1326":0,"1328":0,"1331":0,"1332":0,"1333":0,"1334":0,"1335":0,"1336":0,"1337":0,"1338":0,"1352":0,"1353":0,"1358":0,"1359":0,"1360":0,"1363":0,"1366":0,"1375":0,"1378":0,"1381":0,"1385":0,"1388":0,"1389":0,"1392":0,"1393":0,"1394":0,"1398":0,"1400":0,"1403":0,"1404":0,"1407":0,"1410":0,"1413":0,"1414":0,"1417":0,"1418":0,"1419":0,"1420":0,"1421":0,"1422":0,"1428":0,"1429":0,"1430":0,"1434":0,"1435":0,"1436":0,"1437":0,"1439":0,"1441":0,"1442":0,"1445":0,"1446":0,"1447":0,"1449":0,"1451":0,"1456":0,"1460":0,"1461":0,"1462":0,"1465":0,"1468":0,"1469":0,"1470":0,"1472":0,"1475":0,"1476":0,"1477":0,"1480":0,"1483":0,"1485":0,"1486":0,"1497":0,"1498":0,"1500":0,"1504":0,"1507":0,"1510":0,"1513":0,"1521":0,"1522":0,"1524":0,"1526":0,"1529":0,"1530":0,"1531":0,"1534":0,"1554":0,"1555":0,"1556":0,"1559":0,"1575":0,"1585":0,"1588":0,"1595":0,"1596":0,"1598":0,"1601":0,"1602":0,"1603":0,"1606":0,"1612":0,"1615":0,"1618":0,"1633":0,"1644":0,"1659":0,"1660":0,"1670":0,"1680":0,"1690":0,"1703":0,"1704":0,"1705":0,"1707":0,"1710":0,"1725":0,"1726":0,"1727":0,"1729":0,"1730":0,"1732":0,"1733":0,"1734":0,"1736":0,"1739":0,"1755":0,"1759":0,"1760":0,"1761":0,"1763":0,"1776":0,"1777":0,"1779":0,"1795":0,"1798":0,"1803":0,"1804":0,"1808":0,"1811":0,"1812":0,"1813":0,"1816":0,"1819":0,"1823":0,"1836":0,"1852":0,"1853":0,"1855":0,"1856":0,"1857":0,"1860":0,"1875":0,"1876":0,"1878":0,"1879":0,"1880":0,"1883":0,"1899":0,"1901":0,"1902":0,"1918":0,"1921":0,"1922":0,"1923":0,"1940":0,"1942":0,"1943":0,"1946":0,"1947":0,"1964":0,"1966":0,"1967":0,"1984":0,"1986":0,"1987":0,"1988":0,"2006":0,"2009":0,"2010":0,"2013":0,"2014":0,"2030":0,"2033":0,"2034":0,"2035":0,"2036":0,"2038":0,"2043":0,"2060":0,"2063":0,"2064":0,"2068":0,"2069":0,"2073":0,"2074":0,"2075":0,"2097":0,"2100":0,"2101":0,"2105":0,"2106":0,"2110":0,"2111":0,"2112":0,"2125":0,"2126":0,"2127":0,"2139":0,"2140":0,"2141":0,"2159":0,"2162":0,"2163":0,"2167":0,"2168":0,"2169":0,"2188":0,"2189":0,"2190":0,"2191":0,"2193":0,"2198":0,"2212":0,"2237":0,"2238":0,"2240":0,"2251":0,"2261":0,"2271":0,"2285":0,"2294":0,"2311":0,"2312":0,"2313":0,"2328":0,"2329":0,"2330":0,"2344":0,"2345":0,"2346":0,"2360":0,"2361":0,"2362":0,"2379":0,"2380":0,"2381":0,"2394":0,"2395":0,"2396":0,"2413":0,"2414":0,"2415":0,"2427":0,"2428":0,"2429":0,"2442":0,"2443":0,"2444":0,"2457":0,"2458":0,"2459":0,"2472":0,"2473":0,"2474":0,"2487":0,"2488":0,"2489":0,"2505":0,"2506":0,"2507":0,"2508":0,"2510":0,"2512":0,"2513":0,"2525":0,"2526":0,"2527":0,"2539":0,"2540":0,"2541":0,"2556":0,"2557":0,"2558":0,"2570":0,"2571":0,"2572":0,"2584":0,"2585":0,"2586":0,"2598":0,"2599":0,"2600":0,"2613":0,"2614":0,"2615":0,"2639":0,"2640":0,"2642":0,"2643":0,"2647":0,"2650":0,"2651":0,"2653":0,"2656":0,"2657":0,"2660":0,"2663":0,"2665":0,"2669":0,"2672":0,"2673":0,"2675":0,"2680":0,"2695":0,"2702":0,"2709":0,"2712":0,"2724":0,"2733":0,"2750":0,"2753":0,"2760":0,"2767":0,"2774":0,"2779":0,"2782":0,"2790":0,"2791":0,"2801":0,"2812":0,"2827":0,"2828":0,"2829":0,"2830":0,"2834":0,"2848":0,"2859":0,"2860":0,"2861":0,"2864":0,"2865":0,"2869":0,"2870":0,"2874":0,"2875":0,"2878":0,"2879":0,"2882":0,"2895":0,"2896":0,"2897":0,"2900":0,"2901":0,"2905":0,"2906":0,"2910":0,"2911":0,"2914":0,"2915":0,"2918":0,"2931":0,"2934":0,"2936":0,"2941":0,"2942":0,"2943":0,"2944":0,"2946":0,"2950":0,"2951":0,"2952":0,"2953":0,"2954":0,"2955":0,"2963":0,"2986":0,"2989":0,"2990":0,"2994":0,"2995":0,"3005":0,"3006":0,"3007":0,"3010":0,"3011":0,"3012":0,"3017":0,"3018":0,"3019":0,"3020":0,"3021":0,"3022":0,"3023":0,"3026":0,"3028":0,"3029":0,"3033":0,"3038":0,"3043":0,"3044":0,"3045":0,"3048":0,"3052":0,"3054":0,"3066":0,"3067":0,"3069":0,"3070":0,"3071":0,"3072":0,"3073":0,"3074":0,"3075":0,"3082":0,"3096":0,"3097":0,"3098":0,"3099":0,"3100":0,"3101":0,"3102":0,"3105":0,"3115":0,"3123":0,"3131":0,"3139":0,"3147":0,"3155":0,"3165":0,"3178":0,"3180":0,"3184":0,"3185":0,"3189":0,"3190":0,"3191":0,"3192":0,"3208":0,"3221":0,"3233":0,"3234":0,"3235":0,"3248":0,"3249":0,"3250":0,"3251":0,"3265":0,"3266":0,"3267":0,"3280":0,"3281":0,"3282":0,"3283":0,"3296":0,"3297":0,"3299":0,"3300":0,"3301":0,"3305":0,"3306":0,"3320":0,"3321":0,"3322":0,"3335":0,"3336":0,"3337":0,"3338":0,"3353":0,"3360":0,"3367":0,"3374":0,"3381":0,"3388":0,"3395":0,"3402":0,"3411":0,"3412":0,"3413":0,"3414":0,"3415":0,"3416":0,"3429":0,"3432":0,"3439":0,"3444":0,"3447":0,"3459":0,"3462":0,"3469":0,"3474":0,"3477":0,"3491":0,"3494":0,"3501":0,"3508":0,"3515":0,"3520":0,"3523":0,"3538":0,"3541":0,"3548":0,"3555":0,"3560":0,"3563":0,"3571":0,"3572":0,"3586":0,"3593":0,"3600":0,"3605":0,"3606":0,"3607":0,"3608":0,"3613":0,"3614":0,"3615":0,"3616":0,"3617":0,"3618":0,"3619":0,"3620":0,"3621":0,"3623":0,"3625":0,"3626":0,"3639":0,"3640":0,"3641":0,"3642":0,"3653":0,"3655":0,"3657":0,"3658":0,"3661":0,"3662":0,"3665":0,"3666":0,"3668":0,"3671":0,"3673":0,"3674":0,"3677":0,"3681":0,"3684":0,"3685":0,"3687":0,"3689":0,"3690":0,"3691":0,"3694":0,"3699":0,"3700":0,"3703":0,"3704":0,"3705":0,"3708":0,"3709":0,"3710":0,"3713":0,"3714":0,"3715":0,"3718":0,"3719":0,"3720":0,"3723":0,"3728":0,"3729":0,"3732":0,"3733":0,"3734":0,"3737":0,"3742":0,"3743":0,"3745":0,"3746":0,"3749":0,"3750":0,"3754":0,"3756":0,"3757":0,"3758":0,"3759":0,"3761":0};+_yuitest_coverage["build/test/test.js"].functions = {"guid:23":0,"EventTarget:46":0,"attach:75":0,"subscribe:91":0,"fire:102":0,"detach:129":0,"unsubscribe:149":0,"TestSuite:165":0,"add:211":0,"TestCase:251":0,"callback:285":0,"resume:296":0,"(anonymous 2):318":0,"wait:310":0,"assert:335":0,"fail:347":0,"(anonymous 3):408":0,"xmlEscape:406":0,"JSON:430":0,"serializeToXML:443":0,"XML:441":0,"serializeToJUnitXML:482":0,"JUnitXML:480":0,"serializeToTAP:561":0,"TAP:557":0,"TestFormat:398":0,"Reporter:646":0,"addField:699":0,"clearFields:708":0,"destroy:718":0,"report:736":0,"inGroups:819":0,"TestNode:843":0,"appendChild:907":0,"TestRunner:928":0,"_addTestCaseToTestTree:1124":0,"_addTestSuiteToTestTree:1149":0,"_buildTestTree:1173":0,"_handleTestObjectComplete:1201":0,"_next:1235":0,"_execNonTestMethod:1278":0,"(anonymous 4):1359":0,"_run:1312":0,"(anonymous 5):1446":0,"(anonymous 6):1530":0,"_resumeTest:1372":0,"(anonymous 7):1555":0,"_handleError:1552":0,"(anonymous 8):1602":0,"_runTest:1572":0,"getName:1632":0,"setName:1643":0,"add:1658":0,"clear:1669":0,"isWaiting:1679":0,"isRunning:1689":0,"getResults:1702":0,"getCoverage:1724":0,"(anonymous 9):1759":0,"callback:1754":0,"resume:1775":0,"run:1793":0,"TestRunner:810":0,"_indexOf:1851":0,"_some:1874":0,"contains:1896":0,"containsItems:1916":0,"containsMatch:1937":0,"doesNotContain:1961":0,"doesNotContainItems:1981":0,"doesNotContainMatch:2003":0,"indexOf:2028":0,"itemsAreEqual:2057":0,"itemsAreEquivalent:2094":0,"isEmpty:2124":0,"isNotEmpty:2138":0,"itemsAreSame:2156":0,"lastIndexOf:2185":0,"_formatMessage:2236":0,"_getCount:2250":0,"_increment:2260":0,"_reset:2270":0,"fail:2284":0,"pass:2293":0,"areEqual:2310":0,"areNotEqual:2326":0,"areNotSame:2343":0,"areSame:2359":0,"isFalse:2378":0,"isTrue:2393":0,"isNaN:2412":0,"isNotNaN:2426":0,"isNotNull:2441":0,"isNotUndefined:2456":0,"isNull:2471":0,"isUndefined:2486":0,"isArray:2504":0,"isBoolean:2524":0,"isFunction:2538":0,"isInstanceOf:2555":0,"isNumber:2569":0,"isObject:2583":0,"isString:2597":0,"isTypeOf:2612":0,"throwsError:2638":0,"AssertionError:2695":0,"getMessage:2723":0,"toString:2732":0,"ComparisonFailure:2750":0,"getMessage:2790":0,"JSON:2811":0,"XdebugJSON:2825":0,"datesAreEqual:2858":0,"timesAreEqual:2894":0,"(anonymous 11):2954":0,"]:2953":0,"Mock:2931":0,"]:3018":0,"]:3043":0,"expect:2986":0,"verify:3066":0,"verify:3098":0,"Value:3096":0,"areEqual:3177":0,"hasKey:3207":0,"hasKeys:3220":0,"inheritsKey:3232":0,"inheritsKeys:3247":0,"ownsKey:3264":0,"ownsKeys:3279":0,"ownsNoKeys:3295":0,"ownsOrInheritsKey:3319":0,"ownsOrInheritsKeys:3334":0,"Results:3353":0,"include:3411":0,"ShouldError:3429":0,"ShouldFail:3459":0,"UnexpectedError:3491":0,"UnexpectedValue:3538":0,"getMessage:3571":0,"Wait:3586":0,"(anonymous 14):3606":0,"itemsAreEqual:3625":0,"assert:3639":0,"disableLogging:3657":0,"enableLogging:3661":0,"logEvent:3681":0,"(anonymous 1):1":0};+_yuitest_coverage["build/test/test.js"].coveredLines = 898;+_yuitest_coverage["build/test/test.js"].coveredFunctions = 148;+_yuitest_coverline("build/test/test.js", 1);+YUI.add('test', function (Y, NAME) {++++/**+ * YUI Test Framework+ * @module test+ * @main test+ */++/*+ * The root namespace for YUI Test.+ */++//So we only ever have one YUITest object that's shared+_yuitest_coverfunc("build/test/test.js", "(anonymous 1)", 1);+_yuitest_coverline("build/test/test.js", 16);+if (YUI.YUITest) {+ _yuitest_coverline("build/test/test.js", 17);+Y.Test = YUI.YUITest;+} else { //Ends after the YUITest definitions++ //Make this global for back compat+ _yuitest_coverline("build/test/test.js", 21);+YUITest = {+ version: "3.7.3",+ guid: function(pre) {+ _yuitest_coverfunc("build/test/test.js", "guid", 23);+_yuitest_coverline("build/test/test.js", 24);+return Y.guid(pre);+ }+ };++_yuitest_coverline("build/test/test.js", 28);+Y.namespace('Test');+++//Using internal YUI methods here+_yuitest_coverline("build/test/test.js", 32);+YUITest.Object = Y.Object;+_yuitest_coverline("build/test/test.js", 33);+YUITest.Array = Y.Array;+_yuitest_coverline("build/test/test.js", 34);+YUITest.Util = {+ mix: Y.mix,+ JSON: Y.JSON+};++/**+ * Simple custom event implementation.+ * @namespace Test+ * @module test+ * @class EventTarget+ * @constructor+ */+_yuitest_coverline("build/test/test.js", 46);+YUITest.EventTarget = function(){++ /**+ * Event handlers for the various events.+ * @type Object+ * @private+ * @property _handlers+ * @static+ */+ _yuitest_coverfunc("build/test/test.js", "EventTarget", 46);+_yuitest_coverline("build/test/test.js", 55);+this._handlers = {};++};+ +_yuitest_coverline("build/test/test.js", 59);+YUITest.EventTarget.prototype = {++ //restore prototype+ constructor: YUITest.EventTarget,+ + //-------------------------------------------------------------------------+ // Event Handling+ //-------------------------------------------------------------------------+ + /**+ * Adds a listener for a given event type.+ * @param {String} type The type of event to add a listener for.+ * @param {Function} listener The function to call when the event occurs.+ * @return {void}+ * @method attach+ */+ attach: function(type, listener){+ _yuitest_coverfunc("build/test/test.js", "attach", 75);+_yuitest_coverline("build/test/test.js", 76);+if (typeof this._handlers[type] == "undefined"){+ _yuitest_coverline("build/test/test.js", 77);+this._handlers[type] = [];+ }++ _yuitest_coverline("build/test/test.js", 80);+this._handlers[type].push(listener);+ },+ + /**+ * Adds a listener for a given event type.+ * @param {String} type The type of event to add a listener for.+ * @param {Function} listener The function to call when the event occurs.+ * @return {void}+ * @method subscribe+ * @deprecated+ */+ subscribe: function(type, listener){+ _yuitest_coverfunc("build/test/test.js", "subscribe", 91);+_yuitest_coverline("build/test/test.js", 92);+this.attach.apply(this, arguments);+ },+ + /**+ * Fires an event based on the passed-in object.+ * @param {Object|String} event An object with at least a 'type' attribute+ * or a string indicating the event name.+ * @return {void}+ * @method fire+ */ + fire: function(event){+ _yuitest_coverfunc("build/test/test.js", "fire", 102);+_yuitest_coverline("build/test/test.js", 103);+if (typeof event == "string"){+ _yuitest_coverline("build/test/test.js", 104);+event = { type: event };+ }+ _yuitest_coverline("build/test/test.js", 106);+if (!event.target){+ _yuitest_coverline("build/test/test.js", 107);+event.target = this;+ }+ + _yuitest_coverline("build/test/test.js", 110);+if (!event.type){+ _yuitest_coverline("build/test/test.js", 111);+throw new Error("Event object missing 'type' property.");+ }+ + _yuitest_coverline("build/test/test.js", 114);+if (this._handlers[event.type] instanceof Array){+ _yuitest_coverline("build/test/test.js", 115);+var handlers = this._handlers[event.type];+ _yuitest_coverline("build/test/test.js", 116);+for (var i=0, len=handlers.length; i < len; i++){+ _yuitest_coverline("build/test/test.js", 117);+handlers[i].call(this, event);+ }+ } + },++ /**+ * Removes a listener for a given event type.+ * @param {String} type The type of event to remove a listener from.+ * @param {Function} listener The function to remove from the event.+ * @return {void}+ * @method detach+ */+ detach: function(type, listener){+ _yuitest_coverfunc("build/test/test.js", "detach", 129);+_yuitest_coverline("build/test/test.js", 130);+if (this._handlers[type] instanceof Array){+ _yuitest_coverline("build/test/test.js", 131);+var handlers = this._handlers[type];+ _yuitest_coverline("build/test/test.js", 132);+for (var i=0, len=handlers.length; i < len; i++){+ _yuitest_coverline("build/test/test.js", 133);+if (handlers[i] === listener){+ _yuitest_coverline("build/test/test.js", 134);+handlers.splice(i, 1);+ _yuitest_coverline("build/test/test.js", 135);+break;+ }+ }+ } + },+ + /**+ * Removes a listener for a given event type.+ * @param {String} type The type of event to remove a listener from.+ * @param {Function} listener The function to remove from the event.+ * @return {void}+ * @method unsubscribe+ * @deprecated+ */+ unsubscribe: function(type, listener){+ _yuitest_coverfunc("build/test/test.js", "unsubscribe", 149);+_yuitest_coverline("build/test/test.js", 150);+this.detach.apply(this, arguments); + } ++};++ +/**+ * A test suite that can contain a collection of TestCase and TestSuite objects.+ * @param {String||Object} data The name of the test suite or an object containing+ * a name property as well as setUp and tearDown methods.+ * @namespace Test+ * @module test+ * @class TestSuite+ * @constructor+ */+_yuitest_coverline("build/test/test.js", 165);+YUITest.TestSuite = function (data) {++ /**+ * The name of the test suite.+ * @type String+ * @property name+ */+ _yuitest_coverfunc("build/test/test.js", "TestSuite", 165);+_yuitest_coverline("build/test/test.js", 172);+this.name = "";++ /**+ * Array of test suites and test cases.+ * @type Array+ * @property items+ * @private+ */+ _yuitest_coverline("build/test/test.js", 180);+this.items = [];++ //initialize the properties+ _yuitest_coverline("build/test/test.js", 183);+if (typeof data == "string"){+ _yuitest_coverline("build/test/test.js", 184);+this.name = data;+ } else {_yuitest_coverline("build/test/test.js", 185);+if (data instanceof Object){+ _yuitest_coverline("build/test/test.js", 186);+for (var prop in data){+ _yuitest_coverline("build/test/test.js", 187);+if (data.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 188);+this[prop] = data[prop];+ }+ }+ }}++ //double-check name+ _yuitest_coverline("build/test/test.js", 194);+if (this.name === "" || !this.name) {+ _yuitest_coverline("build/test/test.js", 195);+this.name = YUITest.guid("testSuite_");+ }++};+ +_yuitest_coverline("build/test/test.js", 200);+YUITest.TestSuite.prototype = {+ + //restore constructor+ constructor: YUITest.TestSuite,+ + /**+ * Adds a test suite or test case to the test suite.+ * @param {Test.TestSuite||YUITest.TestCase} testObject The test suite or test case to add.+ * @return {Void}+ * @method add+ */+ add : function (testObject) {+ _yuitest_coverfunc("build/test/test.js", "add", 211);+_yuitest_coverline("build/test/test.js", 212);+if (testObject instanceof YUITest.TestSuite || testObject instanceof YUITest.TestCase) {+ _yuitest_coverline("build/test/test.js", 213);+this.items.push(testObject);+ }+ _yuitest_coverline("build/test/test.js", 215);+return this;+ },+ + //-------------------------------------------------------------------------+ // Stub Methods+ //-------------------------------------------------------------------------++ /**+ * Function to run before each test is executed.+ * @return {Void}+ * @method setUp+ */+ setUp : function () {+ },+ + /**+ * Function to run after each test is executed.+ * @return {Void}+ * @method tearDown+ */+ tearDown: function () {+ }+ +};+/**+ * Test case containing various tests to run.+ * @param template An object containing any number of test methods, other methods,+ * an optional name, and anything else the test case needs.+ * @module test+ * @class TestCase+ * @namespace Test+ * @constructor+ */++++_yuitest_coverline("build/test/test.js", 251);+YUITest.TestCase = function (template) {+ + /*+ * Special rules for the test case. Possible subobjects+ * are fail, for tests that should fail, and error, for+ * tests that should throw an error.+ */+ _yuitest_coverfunc("build/test/test.js", "TestCase", 251);+_yuitest_coverline("build/test/test.js", 258);+this._should = {};+ + //copy over all properties from the template to this object+ _yuitest_coverline("build/test/test.js", 261);+for (var prop in template) {+ _yuitest_coverline("build/test/test.js", 262);+this[prop] = template[prop];+ } + + //check for a valid name+ _yuitest_coverline("build/test/test.js", 266);+if (typeof this.name != "string") {+ _yuitest_coverline("build/test/test.js", 267);+this.name = YUITest.guid("testCase_");+ }++};++ +_yuitest_coverline("build/test/test.js", 273);+YUITest.TestCase.prototype = { ++ //restore constructor+ constructor: YUITest.TestCase,+ + /**+ * Method to call from an async init method to+ * restart the test case. When called, returns a function+ * that should be called when tests are ready to continue.+ * @method callback+ * @return {Function} The function to call as a callback.+ */+ callback: function(){+ _yuitest_coverfunc("build/test/test.js", "callback", 285);+_yuitest_coverline("build/test/test.js", 286);+return YUITest.TestRunner.callback.apply(YUITest.TestRunner,arguments);+ },++ /**+ * Resumes a paused test and runs the given function.+ * @param {Function} segment (Optional) The function to run.+ * If omitted, the test automatically passes.+ * @return {Void}+ * @method resume+ */+ resume : function (segment) {+ _yuitest_coverfunc("build/test/test.js", "resume", 296);+_yuitest_coverline("build/test/test.js", 297);+YUITest.TestRunner.resume(segment);+ },++ /**+ * Causes the test case to wait a specified amount of time and then+ * continue executing the given code.+ * @param {Function} segment (Optional) The function to run after the delay.+ * If omitted, the TestRunner will wait until resume() is called.+ * @param {int} delay (Optional) The number of milliseconds to wait before running+ * the function. If omitted, defaults to zero.+ * @return {Void}+ * @method wait+ */+ wait : function (segment, delay){+ + _yuitest_coverfunc("build/test/test.js", "wait", 310);+_yuitest_coverline("build/test/test.js", 312);+var actualDelay = (typeof segment == "number" ? segment : delay);+ _yuitest_coverline("build/test/test.js", 313);+actualDelay = (typeof actualDelay == "number" ? actualDelay : 10000);+ + _yuitest_coverline("build/test/test.js", 315);+if (typeof segment == "function"){+ _yuitest_coverline("build/test/test.js", 316);+throw new YUITest.Wait(segment, actualDelay);+ } else {+ _yuitest_coverline("build/test/test.js", 318);+throw new YUITest.Wait(function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 2)", 318);+_yuitest_coverline("build/test/test.js", 319);+YUITest.Assert.fail("Timeout: wait() called but resume() never called.");+ }, actualDelay);+ }+ },+ + //-------------------------------------------------------------------------+ // Assertion Methods+ //-------------------------------------------------------------------------++ /**+ * Asserts that a given condition is true. If not, then a YUITest.AssertionError object is thrown+ * and the test fails.+ * @method assert+ * @param {Boolean} condition The condition to test.+ * @param {String} message The message to display if the assertion fails.+ */+ assert : function (condition, message){+ _yuitest_coverfunc("build/test/test.js", "assert", 335);+_yuitest_coverline("build/test/test.js", 336);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 337);+if (!condition){+ _yuitest_coverline("build/test/test.js", 338);+throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Assertion failed."));+ } + },+ + /**+ * Forces an assertion error to occur. Shortcut for YUITest.Assert.fail().+ * @method fail+ * @param {String} message (Optional) The message to display with the failure.+ */+ fail: function (message) { + _yuitest_coverfunc("build/test/test.js", "fail", 347);+_yuitest_coverline("build/test/test.js", 348);+YUITest.Assert.fail(message);+ },+ + //-------------------------------------------------------------------------+ // Stub Methods+ //-------------------------------------------------------------------------++ /**+ * Function to run once before tests start to run.+ * This executes before the first call to setUp().+ * @method init+ */+ init: function(){+ //noop+ },+ + /**+ * Function to run once after tests finish running.+ * This executes after the last call to tearDown().+ * @method destroy+ */+ destroy: function(){+ //noop+ },++ /**+ * Function to run before each test is executed.+ * @return {Void}+ * @method setUp+ */+ setUp : function () {+ //noop+ },+ + /**+ * Function to run after each test is executed.+ * @return {Void}+ * @method tearDown+ */+ tearDown: function () { + //noop+ }+};+/**+ * An object object containing test result formatting methods.+ * @namespace Test+ * @module test+ * @class TestFormat+ * @static+ */+_yuitest_coverline("build/test/test.js", 398);+YUITest.TestFormat = function(){+ + /* (intentionally not documented)+ * Basic XML escaping method. Replaces quotes, less-than, greater-than,+ * apostrophe, and ampersand characters with their corresponding entities.+ * @param {String} text The text to encode.+ * @return {String} The XML-escaped text.+ */+ _yuitest_coverfunc("build/test/test.js", "TestFormat", 398);+_yuitest_coverline("build/test/test.js", 406);+function xmlEscape(text){+ + _yuitest_coverfunc("build/test/test.js", "xmlEscape", 406);+_yuitest_coverline("build/test/test.js", 408);+return text.replace(/[<>"'&]/g, function(value){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 3)", 408);+_yuitest_coverline("build/test/test.js", 409);+switch(value){+ case "<": _yuitest_coverline("build/test/test.js", 410);+return "<";+ case ">": _yuitest_coverline("build/test/test.js", 411);+return ">";+ case "\"": _yuitest_coverline("build/test/test.js", 412);+return """;+ case "'": _yuitest_coverline("build/test/test.js", 413);+return "'";+ case "&": _yuitest_coverline("build/test/test.js", 414);+return "&";+ }+ });+ + }+ + + _yuitest_coverline("build/test/test.js", 421);+return {+ + /**+ * Returns test results formatted as a JSON string. Requires JSON utility.+ * @param {Object} result The results object created by TestRunner.+ * @return {String} A JSON-formatted string of results.+ * @method JSON+ * @static+ */+ JSON: function(results) {+ _yuitest_coverfunc("build/test/test.js", "JSON", 430);+_yuitest_coverline("build/test/test.js", 431);+return YUITest.Util.JSON.stringify(results);+ },+ + /**+ * Returns test results formatted as an XML string.+ * @param {Object} result The results object created by TestRunner.+ * @return {String} An XML-formatted string of results.+ * @method XML+ * @static+ */+ XML: function(results) {++ _yuitest_coverfunc("build/test/test.js", "XML", 441);+_yuitest_coverline("build/test/test.js", 443);+function serializeToXML(results){+ _yuitest_coverfunc("build/test/test.js", "serializeToXML", 443);+_yuitest_coverline("build/test/test.js", 444);+var xml = "<" + results.type + " name=\"" + xmlEscape(results.name) + "\"";+ + _yuitest_coverline("build/test/test.js", 446);+if (typeof(results.duration)=="number"){+ _yuitest_coverline("build/test/test.js", 447);+xml += " duration=\"" + results.duration + "\"";+ }+ + _yuitest_coverline("build/test/test.js", 450);+if (results.type == "test"){+ _yuitest_coverline("build/test/test.js", 451);+xml += " result=\"" + results.result + "\" message=\"" + xmlEscape(results.message) + "\">";+ } else {+ _yuitest_coverline("build/test/test.js", 453);+xml += " passed=\"" + results.passed + "\" failed=\"" + results.failed + "\" ignored=\"" + results.ignored + "\" total=\"" + results.total + "\">";+ _yuitest_coverline("build/test/test.js", 454);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 455);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 456);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 457);+xml += serializeToXML(results[prop]);+ }+ }+ } + }++ _yuitest_coverline("build/test/test.js", 463);+xml += "</" + results.type + ">";+ + _yuitest_coverline("build/test/test.js", 465);+return xml; + }++ _yuitest_coverline("build/test/test.js", 468);+return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + serializeToXML(results);++ },+++ /**+ * Returns test results formatted in JUnit XML format.+ * @param {Object} result The results object created by TestRunner.+ * @return {String} An XML-formatted string of results.+ * @method JUnitXML+ * @static+ */+ JUnitXML: function(results) {++ _yuitest_coverfunc("build/test/test.js", "JUnitXML", 480);+_yuitest_coverline("build/test/test.js", 482);+function serializeToJUnitXML(results){+ _yuitest_coverfunc("build/test/test.js", "serializeToJUnitXML", 482);+_yuitest_coverline("build/test/test.js", 483);+var xml = "";+ + _yuitest_coverline("build/test/test.js", 485);+switch (results.type){+ //equivalent to testcase in JUnit+ case "test":+ _yuitest_coverline("build/test/test.js", 488);+if (results.result != "ignore"){+ _yuitest_coverline("build/test/test.js", 489);+xml = "<testcase name=\"" + xmlEscape(results.name) + "\" time=\"" + (results.duration/1000) + "\">";+ _yuitest_coverline("build/test/test.js", 490);+if (results.result == "fail"){+ _yuitest_coverline("build/test/test.js", 491);+xml += "<failure message=\"" + xmlEscape(results.message) + "\"><![CDATA[" + results.message + "]]></failure>";+ }+ _yuitest_coverline("build/test/test.js", 493);+xml+= "</testcase>";+ }+ _yuitest_coverline("build/test/test.js", 495);+break;+ + //equivalent to testsuite in JUnit+ case "testcase":+ + _yuitest_coverline("build/test/test.js", 500);+xml = "<testsuite name=\"" + xmlEscape(results.name) + "\" tests=\"" + results.total + "\" failures=\"" + results.failed + "\" time=\"" + (results.duration/1000) + "\">";+ + _yuitest_coverline("build/test/test.js", 502);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 503);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 504);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 505);+xml += serializeToJUnitXML(results[prop]);+ }+ }+ } + + _yuitest_coverline("build/test/test.js", 510);+xml += "</testsuite>";+ _yuitest_coverline("build/test/test.js", 511);+break;+ + //no JUnit equivalent, don't output anything+ case "testsuite":+ _yuitest_coverline("build/test/test.js", 515);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 516);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 517);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 518);+xml += serializeToJUnitXML(results[prop]);+ }+ }+ } + _yuitest_coverline("build/test/test.js", 522);+break;+ + //top-level, equivalent to testsuites in JUnit+ case "report":+ + _yuitest_coverline("build/test/test.js", 527);+xml = "<testsuites>";+ + _yuitest_coverline("build/test/test.js", 529);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 530);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 531);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 532);+xml += serializeToJUnitXML(results[prop]);+ }+ }+ } + + _yuitest_coverline("build/test/test.js", 537);+xml += "</testsuites>"; + + //no default+ }+ + _yuitest_coverline("build/test/test.js", 542);+return xml;+ + }++ _yuitest_coverline("build/test/test.js", 546);+return "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + serializeToJUnitXML(results);+ },+ + /**+ * Returns test results formatted in TAP format.+ * For more information, see <a href="http://testanything.org/">Test Anything Protocol</a>.+ * @param {Object} result The results object created by TestRunner.+ * @return {String} A TAP-formatted string of results.+ * @method TAP+ * @static+ */+ TAP: function(results) {+ + _yuitest_coverfunc("build/test/test.js", "TAP", 557);+_yuitest_coverline("build/test/test.js", 559);+var currentTestNum = 1;++ _yuitest_coverline("build/test/test.js", 561);+function serializeToTAP(results){+ _yuitest_coverfunc("build/test/test.js", "serializeToTAP", 561);+_yuitest_coverline("build/test/test.js", 562);+var text = "";+ + _yuitest_coverline("build/test/test.js", 564);+switch (results.type){++ case "test":+ _yuitest_coverline("build/test/test.js", 567);+if (results.result != "ignore"){++ _yuitest_coverline("build/test/test.js", 569);+text = "ok " + (currentTestNum++) + " - " + results.name;+ + _yuitest_coverline("build/test/test.js", 571);+if (results.result == "fail"){+ _yuitest_coverline("build/test/test.js", 572);+text = "not " + text + " - " + results.message;+ }+ + _yuitest_coverline("build/test/test.js", 575);+text += "\n";+ } else {+ _yuitest_coverline("build/test/test.js", 577);+text = "#Ignored test " + results.name + "\n";+ }+ _yuitest_coverline("build/test/test.js", 579);+break;+ + case "testcase":+ + _yuitest_coverline("build/test/test.js", 583);+text = "#Begin testcase " + results.name + "(" + results.failed + " failed of " + results.total + ")\n";+ + _yuitest_coverline("build/test/test.js", 585);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 586);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 587);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 588);+text += serializeToTAP(results[prop]);+ }+ }+ } + + _yuitest_coverline("build/test/test.js", 593);+text += "#End testcase " + results.name + "\n";+ + + _yuitest_coverline("build/test/test.js", 596);+break;+ + case "testsuite":++ _yuitest_coverline("build/test/test.js", 600);+text = "#Begin testsuite " + results.name + "(" + results.failed + " failed of " + results.total + ")\n"; + + _yuitest_coverline("build/test/test.js", 602);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 603);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 604);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 605);+text += serializeToTAP(results[prop]);+ }+ }+ } ++ _yuitest_coverline("build/test/test.js", 610);+text += "#End testsuite " + results.name + "\n";+ _yuitest_coverline("build/test/test.js", 611);+break;++ case "report":+ + _yuitest_coverline("build/test/test.js", 615);+for (var prop in results){+ _yuitest_coverline("build/test/test.js", 616);+if (results.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 617);+if (results[prop] && typeof results[prop] == "object" && !(results[prop] instanceof Array)){+ _yuitest_coverline("build/test/test.js", 618);+text += serializeToTAP(results[prop]);+ }+ }+ } + + //no default+ }+ + _yuitest_coverline("build/test/test.js", 626);+return text;+ + }++ _yuitest_coverline("build/test/test.js", 630);+return "1.." + results.total + "\n" + serializeToTAP(results);+ }+ + };+}();+ + /**+ * An object capable of sending test results to a server.+ * @param {String} url The URL to submit the results to.+ * @param {Function} format (Optiona) A function that outputs the results in a specific format.+ * Default is YUITest.TestFormat.XML.+ * @constructor+ * @namespace Test+ * @module test+ * @class Reporter+ */+ _yuitest_coverline("build/test/test.js", 646);+YUITest.Reporter = function(url, format) {+ + /**+ * The URL to submit the data to.+ * @type String+ * @property url+ */+ _yuitest_coverfunc("build/test/test.js", "Reporter", 646);+_yuitest_coverline("build/test/test.js", 653);+this.url = url;+ + /**+ * The formatting function to call when submitting the data.+ * @type Function+ * @property format+ */+ _yuitest_coverline("build/test/test.js", 660);+this.format = format || YUITest.TestFormat.XML;+ + /**+ * Extra fields to submit with the request.+ * @type Object+ * @property _fields+ * @private+ */+ _yuitest_coverline("build/test/test.js", 668);+this._fields = new Object();+ + /**+ * The form element used to submit the results.+ * @type HTMLFormElement+ * @property _form+ * @private+ */+ _yuitest_coverline("build/test/test.js", 676);+this._form = null;+ + /**+ * Iframe used as a target for form submission.+ * @type HTMLIFrameElement+ * @property _iframe+ * @private+ */+ _yuitest_coverline("build/test/test.js", 684);+this._iframe = null;+ };+ + _yuitest_coverline("build/test/test.js", 687);+YUITest.Reporter.prototype = {+ + //restore missing constructor+ constructor: YUITest.Reporter,+ + /**+ * Adds a field to the form that submits the results.+ * @param {String} name The name of the field.+ * @param {Variant} value The value of the field.+ * @return {Void}+ * @method addField+ */+ addField : function (name, value){+ _yuitest_coverfunc("build/test/test.js", "addField", 699);+_yuitest_coverline("build/test/test.js", 700);+this._fields[name] = value; + },+ + /**+ * Removes all previous defined fields.+ * @return {Void}+ * @method clearFields+ */+ clearFields : function(){+ _yuitest_coverfunc("build/test/test.js", "clearFields", 708);+_yuitest_coverline("build/test/test.js", 709);+this._fields = new Object();+ },+ + /**+ * Cleans up the memory associated with the TestReporter, removing DOM elements+ * that were created.+ * @return {Void}+ * @method destroy+ */+ destroy : function() {+ _yuitest_coverfunc("build/test/test.js", "destroy", 718);+_yuitest_coverline("build/test/test.js", 719);+if (this._form){+ _yuitest_coverline("build/test/test.js", 720);+this._form.parentNode.removeChild(this._form);+ _yuitest_coverline("build/test/test.js", 721);+this._form = null;+ } + _yuitest_coverline("build/test/test.js", 723);+if (this._iframe){+ _yuitest_coverline("build/test/test.js", 724);+this._iframe.parentNode.removeChild(this._iframe);+ _yuitest_coverline("build/test/test.js", 725);+this._iframe = null;+ }+ _yuitest_coverline("build/test/test.js", 727);+this._fields = null;+ },+ + /**+ * Sends the report to the server.+ * @param {Object} results The results object created by TestRunner.+ * @return {Void}+ * @method report+ */+ report : function(results){+ + //if the form hasn't been created yet, create it+ _yuitest_coverfunc("build/test/test.js", "report", 736);+_yuitest_coverline("build/test/test.js", 739);+if (!this._form){+ _yuitest_coverline("build/test/test.js", 740);+this._form = document.createElement("form");+ _yuitest_coverline("build/test/test.js", 741);+this._form.method = "post";+ _yuitest_coverline("build/test/test.js", 742);+this._form.style.visibility = "hidden";+ _yuitest_coverline("build/test/test.js", 743);+this._form.style.position = "absolute";+ _yuitest_coverline("build/test/test.js", 744);+this._form.style.top = 0;+ _yuitest_coverline("build/test/test.js", 745);+document.body.appendChild(this._form);+ + //IE won't let you assign a name using the DOM, must do it the hacky way+ _yuitest_coverline("build/test/test.js", 748);+try {+ _yuitest_coverline("build/test/test.js", 749);+this._iframe = document.createElement("<iframe name=\"yuiTestTarget\" />");+ } catch (ex){+ _yuitest_coverline("build/test/test.js", 751);+this._iframe = document.createElement("iframe");+ _yuitest_coverline("build/test/test.js", 752);+this._iframe.name = "yuiTestTarget";+ }+ + _yuitest_coverline("build/test/test.js", 755);+this._iframe.src = "javascript:false";+ _yuitest_coverline("build/test/test.js", 756);+this._iframe.style.visibility = "hidden";+ _yuitest_coverline("build/test/test.js", 757);+this._iframe.style.position = "absolute";+ _yuitest_coverline("build/test/test.js", 758);+this._iframe.style.top = 0;+ _yuitest_coverline("build/test/test.js", 759);+document.body.appendChild(this._iframe);+ + _yuitest_coverline("build/test/test.js", 761);+this._form.target = "yuiTestTarget";+ }+ + //set the form's action+ _yuitest_coverline("build/test/test.js", 765);+this._form.action = this.url;+ + //remove any existing fields+ _yuitest_coverline("build/test/test.js", 768);+while(this._form.hasChildNodes()){+ _yuitest_coverline("build/test/test.js", 769);+this._form.removeChild(this._form.lastChild);+ }+ + //create default fields+ _yuitest_coverline("build/test/test.js", 773);+this._fields.results = this.format(results);+ _yuitest_coverline("build/test/test.js", 774);+this._fields.useragent = navigator.userAgent;+ _yuitest_coverline("build/test/test.js", 775);+this._fields.timestamp = (new Date()).toLocaleString();+ + //add fields to the form+ _yuitest_coverline("build/test/test.js", 778);+for (var prop in this._fields){+ _yuitest_coverline("build/test/test.js", 779);+var value = this._fields[prop];+ _yuitest_coverline("build/test/test.js", 780);+if (this._fields.hasOwnProperty(prop) && (typeof value != "function")){+ _yuitest_coverline("build/test/test.js", 781);+var input = document.createElement("input");+ _yuitest_coverline("build/test/test.js", 782);+input.type = "hidden";+ _yuitest_coverline("build/test/test.js", 783);+input.name = prop;+ _yuitest_coverline("build/test/test.js", 784);+input.value = value;+ _yuitest_coverline("build/test/test.js", 785);+this._form.appendChild(input);+ }+ }+ + //remove default fields+ _yuitest_coverline("build/test/test.js", 790);+delete this._fields.results;+ _yuitest_coverline("build/test/test.js", 791);+delete this._fields.useragent;+ _yuitest_coverline("build/test/test.js", 792);+delete this._fields.timestamp;+ + _yuitest_coverline("build/test/test.js", 794);+if (arguments[1] !== false){+ _yuitest_coverline("build/test/test.js", 795);+this._form.submit();+ }+ + }+ + };+ + /**+ * Runs test suites and test cases, providing events to allowing for the+ * interpretation of test results.+ * @namespace Test+ * @module test+ * @class TestRunner+ * @static+ */+ _yuitest_coverline("build/test/test.js", 810);+YUITest.TestRunner = function(){++ /*(intentionally not documented)+ * Determines if any of the array of test groups appears+ * in the given TestRunner filter.+ * @param {Array} testGroups The array of test groups to+ * search for.+ * @param {String} filter The TestRunner groups filter.+ */+ _yuitest_coverfunc("build/test/test.js", "TestRunner", 810);+_yuitest_coverline("build/test/test.js", 819);+function inGroups(testGroups, filter){+ _yuitest_coverfunc("build/test/test.js", "inGroups", 819);+_yuitest_coverline("build/test/test.js", 820);+if (!filter.length){+ _yuitest_coverline("build/test/test.js", 821);+return true;+ } else { + _yuitest_coverline("build/test/test.js", 823);+if (testGroups){+ _yuitest_coverline("build/test/test.js", 824);+for (var i=0, len=testGroups.length; i < len; i++){+ _yuitest_coverline("build/test/test.js", 825);+if (filter.indexOf("," + testGroups[i] + ",") > -1){+ _yuitest_coverline("build/test/test.js", 826);+return true;+ }+ }+ }+ _yuitest_coverline("build/test/test.js", 830);+return false;+ }+ }+ + /**+ * A node in the test tree structure. May represent a TestSuite, TestCase, or+ * test function.+ * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.+ * @module test+ * @class TestNode+ * @constructor+ * @private+ */+ _yuitest_coverline("build/test/test.js", 843);+function TestNode(testObject){+ + /**+ * The TestSuite, TestCase, or test function represented by this node.+ * @type Variant+ * @property testObject+ */+ _yuitest_coverfunc("build/test/test.js", "TestNode", 843);+_yuitest_coverline("build/test/test.js", 850);+this.testObject = testObject;+ + /**+ * Pointer to this node's first child.+ * @type TestNode+ * @property firstChild+ */ + _yuitest_coverline("build/test/test.js", 857);+this.firstChild = null;+ + /**+ * Pointer to this node's last child.+ * @type TestNode+ * @property lastChild+ */ + _yuitest_coverline("build/test/test.js", 864);+this.lastChild = null;+ + /**+ * Pointer to this node's parent.+ * @type TestNode+ * @property parent+ */ + _yuitest_coverline("build/test/test.js", 871);+this.parent = null; + + /**+ * Pointer to this node's next sibling.+ * @type TestNode+ * @property next+ */ + _yuitest_coverline("build/test/test.js", 878);+this.next = null;+ + /**+ * Test results for this test object.+ * @type object+ * @property results+ */ + _yuitest_coverline("build/test/test.js", 885);+this.results = new YUITest.Results();+ + //initialize results+ _yuitest_coverline("build/test/test.js", 888);+if (testObject instanceof YUITest.TestSuite){+ _yuitest_coverline("build/test/test.js", 889);+this.results.type = "testsuite";+ _yuitest_coverline("build/test/test.js", 890);+this.results.name = testObject.name;+ } else {_yuitest_coverline("build/test/test.js", 891);+if (testObject instanceof YUITest.TestCase){+ _yuitest_coverline("build/test/test.js", 892);+this.results.type = "testcase";+ _yuitest_coverline("build/test/test.js", 893);+this.results.name = testObject.name;+ }}+ + }+ + _yuitest_coverline("build/test/test.js", 898);+TestNode.prototype = {+ + /**+ * Appends a new test object (TestSuite, TestCase, or test function name) as a child+ * of this node.+ * @param {Variant} testObject A TestSuite, TestCase, or the name of a test function.+ * @return {Void}+ * @method appendChild+ */+ appendChild : function (testObject){+ _yuitest_coverfunc("build/test/test.js", "appendChild", 907);+_yuitest_coverline("build/test/test.js", 908);+var node = new TestNode(testObject);+ _yuitest_coverline("build/test/test.js", 909);+if (this.firstChild === null){+ _yuitest_coverline("build/test/test.js", 910);+this.firstChild = this.lastChild = node;+ } else {+ _yuitest_coverline("build/test/test.js", 912);+this.lastChild.next = node;+ _yuitest_coverline("build/test/test.js", 913);+this.lastChild = node;+ }+ _yuitest_coverline("build/test/test.js", 915);+node.parent = this;+ _yuitest_coverline("build/test/test.js", 916);+return node;+ } + };+ + /**+ * Runs test suites and test cases, providing events to allowing for the+ * interpretation of test results.+ * @namespace Test+ * @module test+ * @class Runner+ * @static+ */+ _yuitest_coverline("build/test/test.js", 928);+function TestRunner(){+ + //inherit from EventTarget+ _yuitest_coverfunc("build/test/test.js", "TestRunner", 928);+_yuitest_coverline("build/test/test.js", 931);+YUITest.EventTarget.call(this);+ + /**+ * Suite on which to attach all TestSuites and TestCases to be run.+ * @type YUITest.TestSuite+ * @property masterSuite+ * @static+ * @private+ */+ _yuitest_coverline("build/test/test.js", 940);+this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));+ + /**+ * Pointer to the current node in the test tree.+ * @type TestNode+ * @private+ * @property _cur+ * @static+ */+ _yuitest_coverline("build/test/test.js", 949);+this._cur = null;+ + /**+ * Pointer to the root node in the test tree.+ * @type TestNode+ * @private+ * @property _root+ * @static+ */+ _yuitest_coverline("build/test/test.js", 958);+this._root = null;+ + /**+ * Indicates if the TestRunner will log events or not.+ * @type Boolean+ * @property _log+ * @private+ * @static+ */+ _yuitest_coverline("build/test/test.js", 967);+this._log = true;+ + /**+ * Indicates if the TestRunner is waiting as a result of+ * wait() being called.+ * @type Boolean+ * @property _waiting+ * @private+ * @static+ */+ _yuitest_coverline("build/test/test.js", 977);+this._waiting = false;+ + /**+ * Indicates if the TestRunner is currently running tests.+ * @type Boolean+ * @private+ * @property _running+ * @static+ */+ _yuitest_coverline("build/test/test.js", 986);+this._running = false;+ + /**+ * Holds copy of the results object generated when all tests are+ * complete.+ * @type Object+ * @private+ * @property _lastResults+ * @static+ */+ _yuitest_coverline("build/test/test.js", 996);+this._lastResults = null; + + /**+ * Data object that is passed around from method to method.+ * @type Object+ * @private+ * @property _data+ * @static+ */+ _yuitest_coverline("build/test/test.js", 1005);+this._context = null;+ + /**+ * The list of test groups to run. The list is represented+ * by a comma delimited string with commas at the start and+ * end.+ * @type String+ * @private+ * @property _groups+ * @static+ */+ _yuitest_coverline("build/test/test.js", 1016);+this._groups = "";++ }+ + _yuitest_coverline("build/test/test.js", 1020);+TestRunner.prototype = YUITest.Util.mix(new YUITest.EventTarget(), {+ + /**+ * If true, YUITest will not fire an error for tests with no Asserts.+ * @prop _ignoreEmpty+ * @private+ * @type Boolean+ * @static+ */+ _ignoreEmpty: false,++ //restore prototype+ constructor: YUITest.TestRunner,+ + //-------------------------------------------------------------------------+ // Constants+ //-------------------------------------------------------------------------+ + /**+ * Fires when a test case is opened but before the first + * test is executed.+ * @event testcasebegin+ * @static+ */ + TEST_CASE_BEGIN_EVENT : "testcasebegin",+ + /**+ * Fires when all tests in a test case have been executed.+ * @event testcasecomplete+ * @static+ */ + TEST_CASE_COMPLETE_EVENT : "testcasecomplete",+ + /**+ * Fires when a test suite is opened but before the first + * test is executed.+ * @event testsuitebegin+ * @static+ */ + TEST_SUITE_BEGIN_EVENT : "testsuitebegin",+ + /**+ * Fires when all test cases in a test suite have been+ * completed.+ * @event testsuitecomplete+ * @static+ */ + TEST_SUITE_COMPLETE_EVENT : "testsuitecomplete",+ + /**+ * Fires when a test has passed.+ * @event pass+ * @static+ */ + TEST_PASS_EVENT : "pass",+ + /**+ * Fires when a test has failed.+ * @event fail+ * @static+ */ + TEST_FAIL_EVENT : "fail",+ + /**+ * Fires when a non-test method has an error.+ * @event error+ * @static+ */ + ERROR_EVENT : "error",+ + /**+ * Fires when a test has been ignored.+ * @event ignore+ * @static+ */ + TEST_IGNORE_EVENT : "ignore",+ + /**+ * Fires when all test suites and test cases have been completed.+ * @event complete+ * @static+ */ + COMPLETE_EVENT : "complete",+ + /**+ * Fires when the run() method is called.+ * @event begin+ * @static+ */ + BEGIN_EVENT : "begin", ++ //-------------------------------------------------------------------------+ // Test Tree-Related Methods+ //-------------------------------------------------------------------------+ + /**+ * Adds a test case to the test tree as a child of the specified node.+ * @param {TestNode} parentNode The node to add the test case to as a child.+ * @param {Test.TestCase} testCase The test case to add.+ * @return {Void}+ * @static+ * @private+ * @method _addTestCaseToTestTree+ */+ _addTestCaseToTestTree : function (parentNode, testCase){+ + //add the test suite+ _yuitest_coverfunc("build/test/test.js", "_addTestCaseToTestTree", 1124);+_yuitest_coverline("build/test/test.js", 1127);+var node = parentNode.appendChild(testCase),+ prop,+ testName;+ + //iterate over the items in the test case+ _yuitest_coverline("build/test/test.js", 1132);+for (prop in testCase){+ _yuitest_coverline("build/test/test.js", 1133);+if ((prop.indexOf("test") === 0 || prop.indexOf(" ") > -1) && typeof testCase[prop] == "function"){+ _yuitest_coverline("build/test/test.js", 1134);+node.appendChild(prop);+ }+ }+ + },+ + /**+ * Adds a test suite to the test tree as a child of the specified node.+ * @param {TestNode} parentNode The node to add the test suite to as a child.+ * @param {Test.TestSuite} testSuite The test suite to add.+ * @return {Void}+ * @static+ * @private+ * @method _addTestSuiteToTestTree+ */+ _addTestSuiteToTestTree : function (parentNode, testSuite) {+ + //add the test suite+ _yuitest_coverfunc("build/test/test.js", "_addTestSuiteToTestTree", 1149);+_yuitest_coverline("build/test/test.js", 1152);+var node = parentNode.appendChild(testSuite);+ + //iterate over the items in the master suite+ _yuitest_coverline("build/test/test.js", 1155);+for (var i=0; i < testSuite.items.length; i++){+ _yuitest_coverline("build/test/test.js", 1156);+if (testSuite.items[i] instanceof YUITest.TestSuite) {+ _yuitest_coverline("build/test/test.js", 1157);+this._addTestSuiteToTestTree(node, testSuite.items[i]);+ } else {_yuitest_coverline("build/test/test.js", 1158);+if (testSuite.items[i] instanceof YUITest.TestCase) {+ _yuitest_coverline("build/test/test.js", 1159);+this._addTestCaseToTestTree(node, testSuite.items[i]);+ }} + } + },+ + /**+ * Builds the test tree based on items in the master suite. The tree is a hierarchical+ * representation of the test suites, test cases, and test functions. The resulting tree+ * is stored in _root and the pointer _cur is set to the root initially.+ * @return {Void}+ * @static+ * @private+ * @method _buildTestTree+ */+ _buildTestTree : function () {+ + _yuitest_coverfunc("build/test/test.js", "_buildTestTree", 1173);+_yuitest_coverline("build/test/test.js", 1175);+this._root = new TestNode(this.masterSuite);+ //this._cur = this._root;+ + //iterate over the items in the master suite+ _yuitest_coverline("build/test/test.js", 1179);+for (var i=0; i < this.masterSuite.items.length; i++){+ _yuitest_coverline("build/test/test.js", 1180);+if (this.masterSuite.items[i] instanceof YUITest.TestSuite) {+ _yuitest_coverline("build/test/test.js", 1181);+this._addTestSuiteToTestTree(this._root, this.masterSuite.items[i]);+ } else {_yuitest_coverline("build/test/test.js", 1182);+if (this.masterSuite.items[i] instanceof YUITest.TestCase) {+ _yuitest_coverline("build/test/test.js", 1183);+this._addTestCaseToTestTree(this._root, this.masterSuite.items[i]);+ }} + } + + }, + + //-------------------------------------------------------------------------+ // Private Methods+ //-------------------------------------------------------------------------+ + /**+ * Handles the completion of a test object's tests. Tallies test results + * from one level up to the next.+ * @param {TestNode} node The TestNode representing the test object.+ * @return {Void}+ * @method _handleTestObjectComplete+ * @private+ */+ _handleTestObjectComplete : function (node) {+ _yuitest_coverfunc("build/test/test.js", "_handleTestObjectComplete", 1201);+_yuitest_coverline("build/test/test.js", 1202);+var parentNode;+ + _yuitest_coverline("build/test/test.js", 1204);+if (node && (typeof node.testObject == "object")) {+ _yuitest_coverline("build/test/test.js", 1205);+parentNode = node.parent;+ + _yuitest_coverline("build/test/test.js", 1207);+if (parentNode){+ _yuitest_coverline("build/test/test.js", 1208);+parentNode.results.include(node.results); + _yuitest_coverline("build/test/test.js", 1209);+parentNode.results[node.testObject.name] = node.results;+ }+ + _yuitest_coverline("build/test/test.js", 1212);+if (node.testObject instanceof YUITest.TestSuite){+ _yuitest_coverline("build/test/test.js", 1213);+this._execNonTestMethod(node, "tearDown", false);+ _yuitest_coverline("build/test/test.js", 1214);+node.results.duration = (new Date()) - node._start;+ _yuitest_coverline("build/test/test.js", 1215);+this.fire({ type: this.TEST_SUITE_COMPLETE_EVENT, testSuite: node.testObject, results: node.results});+ } else {_yuitest_coverline("build/test/test.js", 1216);+if (node.testObject instanceof YUITest.TestCase){+ _yuitest_coverline("build/test/test.js", 1217);+this._execNonTestMethod(node, "destroy", false);+ _yuitest_coverline("build/test/test.js", 1218);+node.results.duration = (new Date()) - node._start;+ _yuitest_coverline("build/test/test.js", 1219);+this.fire({ type: this.TEST_CASE_COMPLETE_EVENT, testCase: node.testObject, results: node.results});+ }} + } + }, + + //-------------------------------------------------------------------------+ // Navigation Methods+ //-------------------------------------------------------------------------+ + /**+ * Retrieves the next node in the test tree.+ * @return {TestNode} The next node in the test tree or null if the end is reached.+ * @private+ * @static+ * @method _next+ */+ _next : function () {+ + _yuitest_coverfunc("build/test/test.js", "_next", 1235);+_yuitest_coverline("build/test/test.js", 1237);+if (this._cur === null){+ _yuitest_coverline("build/test/test.js", 1238);+this._cur = this._root;+ } else {_yuitest_coverline("build/test/test.js", 1239);+if (this._cur.firstChild) {+ _yuitest_coverline("build/test/test.js", 1240);+this._cur = this._cur.firstChild;+ } else {_yuitest_coverline("build/test/test.js", 1241);+if (this._cur.next) {+ _yuitest_coverline("build/test/test.js", 1242);+this._cur = this._cur.next; + } else {+ _yuitest_coverline("build/test/test.js", 1244);+while (this._cur && !this._cur.next && this._cur !== this._root){+ _yuitest_coverline("build/test/test.js", 1245);+this._handleTestObjectComplete(this._cur);+ _yuitest_coverline("build/test/test.js", 1246);+this._cur = this._cur.parent;+ }+ + _yuitest_coverline("build/test/test.js", 1249);+this._handleTestObjectComplete(this._cur); + + _yuitest_coverline("build/test/test.js", 1251);+if (this._cur == this._root){+ _yuitest_coverline("build/test/test.js", 1252);+this._cur.results.type = "report";+ _yuitest_coverline("build/test/test.js", 1253);+this._cur.results.timestamp = (new Date()).toLocaleString();+ _yuitest_coverline("build/test/test.js", 1254);+this._cur.results.duration = (new Date()) - this._cur._start; + _yuitest_coverline("build/test/test.js", 1255);+this._lastResults = this._cur.results;+ _yuitest_coverline("build/test/test.js", 1256);+this._running = false; + _yuitest_coverline("build/test/test.js", 1257);+this.fire({ type: this.COMPLETE_EVENT, results: this._lastResults});+ _yuitest_coverline("build/test/test.js", 1258);+this._cur = null;+ } else {_yuitest_coverline("build/test/test.js", 1259);+if (this._cur) {+ _yuitest_coverline("build/test/test.js", 1260);+this._cur = this._cur.next; + }}+ }}}+ + _yuitest_coverline("build/test/test.js", 1264);+return this._cur;+ },+ + /**+ * Executes a non-test method (init, setUp, tearDown, destroy)+ * and traps an errors. If an error occurs, an error event is+ * fired.+ * @param {Object} node The test node in the testing tree.+ * @param {String} methodName The name of the method to execute.+ * @param {Boolean} allowAsync Determines if the method can be called asynchronously.+ * @return {Boolean} True if an async method was called, false if not.+ * @method _execNonTestMethod+ * @private+ */+ _execNonTestMethod: function(node, methodName, allowAsync){+ _yuitest_coverfunc("build/test/test.js", "_execNonTestMethod", 1278);+_yuitest_coverline("build/test/test.js", 1279);+var testObject = node.testObject,+ event = { type: this.ERROR_EVENT };+ _yuitest_coverline("build/test/test.js", 1281);+try {+ _yuitest_coverline("build/test/test.js", 1282);+if (allowAsync && testObject["async:" + methodName]){+ _yuitest_coverline("build/test/test.js", 1283);+testObject["async:" + methodName](this._context);+ _yuitest_coverline("build/test/test.js", 1284);+return true;+ } else {+ _yuitest_coverline("build/test/test.js", 1286);+testObject[methodName](this._context);+ }+ } catch (ex){+ _yuitest_coverline("build/test/test.js", 1289);+node.results.errors++;+ _yuitest_coverline("build/test/test.js", 1290);+event.error = ex;+ _yuitest_coverline("build/test/test.js", 1291);+event.methodName = methodName;+ _yuitest_coverline("build/test/test.js", 1292);+if (testObject instanceof YUITest.TestCase){+ _yuitest_coverline("build/test/test.js", 1293);+event.testCase = testObject;+ } else {+ _yuitest_coverline("build/test/test.js", 1295);+event.testSuite = testSuite;+ }+ + _yuitest_coverline("build/test/test.js", 1298);+this.fire(event);+ } ++ _yuitest_coverline("build/test/test.js", 1301);+return false;+ },+ + /**+ * Runs a test case or test suite, returning the results.+ * @param {Test.TestCase|YUITest.TestSuite} testObject The test case or test suite to run.+ * @return {Object} Results of the execution with properties passed, failed, and total.+ * @private+ * @method _run+ * @static+ */+ _run : function () {+ + //flag to indicate if the TestRunner should wait before continuing+ _yuitest_coverfunc("build/test/test.js", "_run", 1312);+_yuitest_coverline("build/test/test.js", 1315);+var shouldWait = false;+ + //get the next test node+ _yuitest_coverline("build/test/test.js", 1318);+var node = this._next();+ + _yuitest_coverline("build/test/test.js", 1320);+if (node !== null) {+ + //set flag to say the testrunner is running+ _yuitest_coverline("build/test/test.js", 1323);+this._running = true;+ + //eliminate last results+ _yuitest_coverline("build/test/test.js", 1326);+this._lastResult = null; + + _yuitest_coverline("build/test/test.js", 1328);+var testObject = node.testObject;+ + //figure out what to do+ _yuitest_coverline("build/test/test.js", 1331);+if (typeof testObject == "object" && testObject !== null){+ _yuitest_coverline("build/test/test.js", 1332);+if (testObject instanceof YUITest.TestSuite){+ _yuitest_coverline("build/test/test.js", 1333);+this.fire({ type: this.TEST_SUITE_BEGIN_EVENT, testSuite: testObject });+ _yuitest_coverline("build/test/test.js", 1334);+node._start = new Date();+ _yuitest_coverline("build/test/test.js", 1335);+this._execNonTestMethod(node, "setUp" ,false);+ } else {_yuitest_coverline("build/test/test.js", 1336);+if (testObject instanceof YUITest.TestCase){+ _yuitest_coverline("build/test/test.js", 1337);+this.fire({ type: this.TEST_CASE_BEGIN_EVENT, testCase: testObject });+ _yuitest_coverline("build/test/test.js", 1338);+node._start = new Date();+ + //regular or async init+ /*try {+ if (testObject["async:init"]){+ testObject["async:init"](this._context);+ return;+ } else {+ testObject.init(this._context);+ }+ } catch (ex){+ node.results.errors++;+ this.fire({ type: this.ERROR_EVENT, error: ex, testCase: testObject, methodName: "init" });+ }*/+ _yuitest_coverline("build/test/test.js", 1352);+if(this._execNonTestMethod(node, "init", true)){+ _yuitest_coverline("build/test/test.js", 1353);+return;+ }+ }}+ + //some environments don't support setTimeout+ _yuitest_coverline("build/test/test.js", 1358);+if (typeof setTimeout != "undefined"){ + _yuitest_coverline("build/test/test.js", 1359);+setTimeout(function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 4)", 1359);+_yuitest_coverline("build/test/test.js", 1360);+YUITest.TestRunner._run();+ }, 0);+ } else {+ _yuitest_coverline("build/test/test.js", 1363);+this._run();+ }+ } else {+ _yuitest_coverline("build/test/test.js", 1366);+this._runTest(node);+ }+ + }+ },+ + _resumeTest : function (segment) {+ + //get relevant information+ _yuitest_coverfunc("build/test/test.js", "_resumeTest", 1372);+_yuitest_coverline("build/test/test.js", 1375);+var node = this._cur; + + //we know there's no more waiting now+ _yuitest_coverline("build/test/test.js", 1378);+this._waiting = false;+ + //if there's no node, it probably means a wait() was called after resume()+ _yuitest_coverline("build/test/test.js", 1381);+if (!node){+ //TODO: Handle in some way?+ //console.log("wait() called after resume()");+ //this.fire("error", { testCase: "(unknown)", test: "(unknown)", error: new Error("wait() called after resume()")} );+ _yuitest_coverline("build/test/test.js", 1385);+return;+ }+ + _yuitest_coverline("build/test/test.js", 1388);+var testName = node.testObject;+ _yuitest_coverline("build/test/test.js", 1389);+var testCase = node.parent.testObject;+ + //cancel other waits if available+ _yuitest_coverline("build/test/test.js", 1392);+if (testCase.__yui_wait){+ _yuitest_coverline("build/test/test.js", 1393);+clearTimeout(testCase.__yui_wait);+ _yuitest_coverline("build/test/test.js", 1394);+delete testCase.__yui_wait;+ }++ //get the "should" test cases+ _yuitest_coverline("build/test/test.js", 1398);+var shouldFail = testName.indexOf("fail:") === 0 ||+ (testCase._should.fail || {})[testName];+ _yuitest_coverline("build/test/test.js", 1400);+var shouldError = (testCase._should.error || {})[testName];+ + //variable to hold whether or not the test failed+ _yuitest_coverline("build/test/test.js", 1403);+var failed = false;+ _yuitest_coverline("build/test/test.js", 1404);+var error = null;+ + //try the test+ _yuitest_coverline("build/test/test.js", 1407);+try {+ + //run the test+ _yuitest_coverline("build/test/test.js", 1410);+segment.call(testCase, this._context); + + //if the test hasn't already failed and doesn't have any asserts...+ _yuitest_coverline("build/test/test.js", 1413);+if(YUITest.Assert._getCount() == 0 && !this._ignoreEmpty){+ _yuitest_coverline("build/test/test.js", 1414);+throw new YUITest.AssertionError("Test has no asserts.");+ } + //if it should fail, and it got here, then it's a fail because it didn't+ else {_yuitest_coverline("build/test/test.js", 1417);+if (shouldFail){+ _yuitest_coverline("build/test/test.js", 1418);+error = new YUITest.ShouldFail();+ _yuitest_coverline("build/test/test.js", 1419);+failed = true;+ } else {_yuitest_coverline("build/test/test.js", 1420);+if (shouldError){+ _yuitest_coverline("build/test/test.js", 1421);+error = new YUITest.ShouldError();+ _yuitest_coverline("build/test/test.js", 1422);+failed = true;+ }}}+ + } catch (thrown){++ //cancel any pending waits, the test already failed+ _yuitest_coverline("build/test/test.js", 1428);+if (testCase.__yui_wait){+ _yuitest_coverline("build/test/test.js", 1429);+clearTimeout(testCase.__yui_wait);+ _yuitest_coverline("build/test/test.js", 1430);+delete testCase.__yui_wait;+ } + + //figure out what type of error it was+ _yuitest_coverline("build/test/test.js", 1434);+if (thrown instanceof YUITest.AssertionError) {+ _yuitest_coverline("build/test/test.js", 1435);+if (!shouldFail){+ _yuitest_coverline("build/test/test.js", 1436);+error = thrown;+ _yuitest_coverline("build/test/test.js", 1437);+failed = true;+ }+ } else {_yuitest_coverline("build/test/test.js", 1439);+if (thrown instanceof YUITest.Wait){+ + _yuitest_coverline("build/test/test.js", 1441);+if (typeof thrown.segment == "function"){+ _yuitest_coverline("build/test/test.js", 1442);+if (typeof thrown.delay == "number"){+ + //some environments don't support setTimeout+ _yuitest_coverline("build/test/test.js", 1445);+if (typeof setTimeout != "undefined"){+ _yuitest_coverline("build/test/test.js", 1446);+testCase.__yui_wait = setTimeout(function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 5)", 1446);+_yuitest_coverline("build/test/test.js", 1447);+YUITest.TestRunner._resumeTest(thrown.segment);+ }, thrown.delay);+ _yuitest_coverline("build/test/test.js", 1449);+this._waiting = true;+ } else {+ _yuitest_coverline("build/test/test.js", 1451);+throw new Error("Asynchronous tests not supported in this environment.");+ }+ }+ }+ + _yuitest_coverline("build/test/test.js", 1456);+return;+ + } else {+ //first check to see if it should error+ _yuitest_coverline("build/test/test.js", 1460);+if (!shouldError) { + _yuitest_coverline("build/test/test.js", 1461);+error = new YUITest.UnexpectedError(thrown);+ _yuitest_coverline("build/test/test.js", 1462);+failed = true;+ } else {+ //check to see what type of data we have+ _yuitest_coverline("build/test/test.js", 1465);+if (typeof shouldError == "string"){+ + //if it's a string, check the error message+ _yuitest_coverline("build/test/test.js", 1468);+if (thrown.message != shouldError){+ _yuitest_coverline("build/test/test.js", 1469);+error = new YUITest.UnexpectedError(thrown);+ _yuitest_coverline("build/test/test.js", 1470);+failed = true; + }+ } else {_yuitest_coverline("build/test/test.js", 1472);+if (typeof shouldError == "function"){+ + //if it's a function, see if the error is an instance of it+ _yuitest_coverline("build/test/test.js", 1475);+if (!(thrown instanceof shouldError)){+ _yuitest_coverline("build/test/test.js", 1476);+error = new YUITest.UnexpectedError(thrown);+ _yuitest_coverline("build/test/test.js", 1477);+failed = true;+ }+ + } else {_yuitest_coverline("build/test/test.js", 1480);+if (typeof shouldError == "object" && shouldError !== null){+ + //if it's an object, check the instance and message+ _yuitest_coverline("build/test/test.js", 1483);+if (!(thrown instanceof shouldError.constructor) || + thrown.message != shouldError.message){+ _yuitest_coverline("build/test/test.js", 1485);+error = new YUITest.UnexpectedError(thrown);+ _yuitest_coverline("build/test/test.js", 1486);+failed = true; + }+ + }}}+ + }+ }}+ + }+ + //fire appropriate event+ _yuitest_coverline("build/test/test.js", 1497);+if (failed) {+ _yuitest_coverline("build/test/test.js", 1498);+this.fire({ type: this.TEST_FAIL_EVENT, testCase: testCase, testName: testName, error: error });+ } else {+ _yuitest_coverline("build/test/test.js", 1500);+this.fire({ type: this.TEST_PASS_EVENT, testCase: testCase, testName: testName });+ }+ + //run the tear down+ _yuitest_coverline("build/test/test.js", 1504);+this._execNonTestMethod(node.parent, "tearDown", false);+ + //reset the assert count+ _yuitest_coverline("build/test/test.js", 1507);+YUITest.Assert._reset();+ + //calculate duration+ _yuitest_coverline("build/test/test.js", 1510);+var duration = (new Date()) - node._start;+ + //update results+ _yuitest_coverline("build/test/test.js", 1513);+node.parent.results[testName] = { + result: failed ? "fail" : "pass",+ message: error ? error.getMessage() : "Test passed",+ type: "test",+ name: testName,+ duration: duration+ };+ + _yuitest_coverline("build/test/test.js", 1521);+if (failed){+ _yuitest_coverline("build/test/test.js", 1522);+node.parent.results.failed++;+ } else {+ _yuitest_coverline("build/test/test.js", 1524);+node.parent.results.passed++;+ }+ _yuitest_coverline("build/test/test.js", 1526);+node.parent.results.total++;+ + //set timeout not supported in all environments+ _yuitest_coverline("build/test/test.js", 1529);+if (typeof setTimeout != "undefined"){+ _yuitest_coverline("build/test/test.js", 1530);+setTimeout(function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 6)", 1530);+_yuitest_coverline("build/test/test.js", 1531);+YUITest.TestRunner._run();+ }, 0);+ } else {+ _yuitest_coverline("build/test/test.js", 1534);+this._run();+ }+ + },+ + /**+ * Handles an error as if it occurred within the currently executing+ * test. This is for mock methods that may be called asynchronously+ * and therefore out of the scope of the TestRunner. Previously, this+ * error would bubble up to the browser. Now, this method is used+ * to tell TestRunner about the error. This should never be called+ * by anyplace other than the Mock object.+ * @param {Error} error The error object.+ * @return {Void}+ * @method _handleError+ * @private+ * @static+ */+ _handleError: function(error){+ + _yuitest_coverfunc("build/test/test.js", "_handleError", 1552);+_yuitest_coverline("build/test/test.js", 1554);+if (this._waiting){+ _yuitest_coverline("build/test/test.js", 1555);+this._resumeTest(function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 7)", 1555);+_yuitest_coverline("build/test/test.js", 1556);+throw error;+ });+ } else {+ _yuitest_coverline("build/test/test.js", 1559);+throw error;+ } + + },+ + /**+ * Runs a single test based on the data provided in the node.+ * @method _runTest+ * @param {TestNode} node The TestNode representing the test to run.+ * @return {Void}+ * @static+ * @private+ */+ _runTest : function (node) {+ + //get relevant information+ _yuitest_coverfunc("build/test/test.js", "_runTest", 1572);+_yuitest_coverline("build/test/test.js", 1575);+var testName = node.testObject,+ testCase = node.parent.testObject,+ test = testCase[testName],+ + //get the "should" test cases+ shouldIgnore = testName.indexOf("ignore:") === 0 ||+ !inGroups(testCase.groups, this._groups) ||+ (testCase._should.ignore || {})[testName]; //deprecated+ + //figure out if the test should be ignored or not+ _yuitest_coverline("build/test/test.js", 1585);+if (shouldIgnore){+ + //update results+ _yuitest_coverline("build/test/test.js", 1588);+node.parent.results[testName] = { + result: "ignore",+ message: "Test ignored",+ type: "test",+ name: testName.indexOf("ignore:") === 0 ? testName.substring(7) : testName+ };+ + _yuitest_coverline("build/test/test.js", 1595);+node.parent.results.ignored++;+ _yuitest_coverline("build/test/test.js", 1596);+node.parent.results.total++;+ + _yuitest_coverline("build/test/test.js", 1598);+this.fire({ type: this.TEST_IGNORE_EVENT, testCase: testCase, testName: testName });+ + //some environments don't support setTimeout+ _yuitest_coverline("build/test/test.js", 1601);+if (typeof setTimeout != "undefined"){ + _yuitest_coverline("build/test/test.js", 1602);+setTimeout(function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 8)", 1602);+_yuitest_coverline("build/test/test.js", 1603);+YUITest.TestRunner._run();+ }, 0); + } else {+ _yuitest_coverline("build/test/test.js", 1606);+this._run();+ }+ + } else {+ + //mark the start time+ _yuitest_coverline("build/test/test.js", 1612);+node._start = new Date();+ + //run the setup+ _yuitest_coverline("build/test/test.js", 1615);+this._execNonTestMethod(node.parent, "setUp", false);+ + //now call the body of the test+ _yuitest_coverline("build/test/test.js", 1618);+this._resumeTest(test); + }+ + }, ++ //-------------------------------------------------------------------------+ // Misc Methods+ //------------------------------------------------------------------------- ++ /**+ * Retrieves the name of the current result set.+ * @return {String} The name of the result set.+ * @method getName+ */+ getName: function(){+ _yuitest_coverfunc("build/test/test.js", "getName", 1632);+_yuitest_coverline("build/test/test.js", 1633);+return this.masterSuite.name;+ }, ++ /**+ * The name assigned to the master suite of the TestRunner. This is the name+ * that is output as the root's name when results are retrieved.+ * @param {String} name The name of the result set.+ * @return {Void}+ * @method setName+ */+ setName: function(name){+ _yuitest_coverfunc("build/test/test.js", "setName", 1643);+_yuitest_coverline("build/test/test.js", 1644);+this.masterSuite.name = name;+ }, + + //-------------------------------------------------------------------------+ // Public Methods+ //------------------------------------------------------------------------- + + /**+ * Adds a test suite or test case to the list of test objects to run.+ * @param testObject Either a TestCase or a TestSuite that should be run.+ * @return {Void}+ * @method add+ * @static+ */+ add : function (testObject) {+ _yuitest_coverfunc("build/test/test.js", "add", 1658);+_yuitest_coverline("build/test/test.js", 1659);+this.masterSuite.add(testObject);+ _yuitest_coverline("build/test/test.js", 1660);+return this;+ },+ + /**+ * Removes all test objects from the runner.+ * @return {Void}+ * @method clear+ * @static+ */+ clear : function () {+ _yuitest_coverfunc("build/test/test.js", "clear", 1669);+_yuitest_coverline("build/test/test.js", 1670);+this.masterSuite = new YUITest.TestSuite(YUITest.guid('testSuite_'));+ },+ + /**+ * Indicates if the TestRunner is waiting for a test to resume+ * @return {Boolean} True if the TestRunner is waiting, false if not.+ * @method isWaiting+ * @static+ */+ isWaiting: function() {+ _yuitest_coverfunc("build/test/test.js", "isWaiting", 1679);+_yuitest_coverline("build/test/test.js", 1680);+return this._waiting;+ },+ + /**+ * Indicates that the TestRunner is busy running tests and therefore can't+ * be stopped and results cannot be gathered.+ * @return {Boolean} True if the TestRunner is running, false if not.+ * @method isRunning+ */+ isRunning: function(){+ _yuitest_coverfunc("build/test/test.js", "isRunning", 1689);+_yuitest_coverline("build/test/test.js", 1690);+return this._running;+ },+ + /**+ * Returns the last complete results set from the TestRunner. Null is returned+ * if the TestRunner is running or no tests have been run.+ * @param {Function} format (Optional) A test format to return the results in.+ * @return {Object|String} Either the results object or, if a test format is + * passed as the argument, a string representing the results in a specific+ * format.+ * @method getResults+ */+ getResults: function(format){+ _yuitest_coverfunc("build/test/test.js", "getResults", 1702);+_yuitest_coverline("build/test/test.js", 1703);+if (!this._running && this._lastResults){+ _yuitest_coverline("build/test/test.js", 1704);+if (typeof format == "function"){+ _yuitest_coverline("build/test/test.js", 1705);+return format(this._lastResults); + } else {+ _yuitest_coverline("build/test/test.js", 1707);+return this._lastResults;+ }+ } else {+ _yuitest_coverline("build/test/test.js", 1710);+return null;+ }+ }, + + /**+ * Returns the coverage report for the files that have been executed.+ * This returns only coverage information for files that have been+ * instrumented using YUI Test Coverage and only those that were run+ * in the same pass.+ * @param {Function} format (Optional) A coverage format to return results in.+ * @return {Object|String} Either the coverage object or, if a coverage+ * format is specified, a string representing the results in that format.+ * @method getCoverage+ */+ getCoverage: function(format) {+ _yuitest_coverfunc("build/test/test.js", "getCoverage", 1724);+_yuitest_coverline("build/test/test.js", 1725);+var covObject = null;+ _yuitest_coverline("build/test/test.js", 1726);+if (typeof _yuitest_coverage === "object") {+ _yuitest_coverline("build/test/test.js", 1727);+covObject = _yuitest_coverage;+ }+ _yuitest_coverline("build/test/test.js", 1729);+if (typeof __coverage__ === "object") {+ _yuitest_coverline("build/test/test.js", 1730);+covObject = __coverage__;+ }+ _yuitest_coverline("build/test/test.js", 1732);+if (!this._running && typeof covObject == "object"){+ _yuitest_coverline("build/test/test.js", 1733);+if (typeof format == "function") {+ _yuitest_coverline("build/test/test.js", 1734);+return format(covObject); + } else {+ _yuitest_coverline("build/test/test.js", 1736);+return covObject;+ }+ } else {+ _yuitest_coverline("build/test/test.js", 1739);+return null;+ } + },+ + /**+ * Used to continue processing when a method marked with+ * "async:" is executed. This should not be used in test+ * methods, only in init(). Each argument is a string, and+ * when the returned function is executed, the arguments+ * are assigned to the context data object using the string+ * as the key name (value is the argument itself).+ * @private+ * @return {Function} A callback function.+ * @method callback+ */+ callback: function(){+ _yuitest_coverfunc("build/test/test.js", "callback", 1754);+_yuitest_coverline("build/test/test.js", 1755);+var names = arguments,+ data = this._context,+ that = this;+ + _yuitest_coverline("build/test/test.js", 1759);+return function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 9)", 1759);+_yuitest_coverline("build/test/test.js", 1760);+for (var i=0; i < arguments.length; i++){+ _yuitest_coverline("build/test/test.js", 1761);+data[names[i]] = arguments[i];+ }+ _yuitest_coverline("build/test/test.js", 1763);+that._run();+ };+ },+ + /**+ * Resumes the TestRunner after wait() was called.+ * @param {Function} segment The function to run as the rest+ * of the haulted test.+ * @return {Void}+ * @method resume+ * @static+ */+ resume : function (segment) {+ _yuitest_coverfunc("build/test/test.js", "resume", 1775);+_yuitest_coverline("build/test/test.js", 1776);+if (this._waiting){+ _yuitest_coverline("build/test/test.js", 1777);+this._resumeTest(segment || function(){});+ } else {+ _yuitest_coverline("build/test/test.js", 1779);+throw new Error("resume() called without wait().");+ }+ },+ + /**+ * Runs the test suite.+ * @param {Object|Boolean} options (Optional) Options for the runner:+ * <code>oldMode</code> indicates the TestRunner should work in the YUI <= 2.8 way+ * of internally managing test suites. <code>groups</code> is an array+ * of test groups indicating which tests to run.+ * @return {Void}+ * @method run+ * @static+ */+ run : function (options) {++ _yuitest_coverfunc("build/test/test.js", "run", 1793);+_yuitest_coverline("build/test/test.js", 1795);+options = options || {};+ + //pointer to runner to avoid scope issues + _yuitest_coverline("build/test/test.js", 1798);+var runner = YUITest.TestRunner,+ oldMode = options.oldMode;+ + + //if there's only one suite on the masterSuite, move it up+ _yuitest_coverline("build/test/test.js", 1803);+if (!oldMode && this.masterSuite.items.length == 1 && this.masterSuite.items[0] instanceof YUITest.TestSuite){+ _yuitest_coverline("build/test/test.js", 1804);+this.masterSuite = this.masterSuite.items[0];+ } + + //determine if there are any groups to filter on+ _yuitest_coverline("build/test/test.js", 1808);+runner._groups = (options.groups instanceof Array) ? "," + options.groups.join(",") + "," : "";+ + //initialize the runner+ _yuitest_coverline("build/test/test.js", 1811);+runner._buildTestTree();+ _yuitest_coverline("build/test/test.js", 1812);+runner._context = {};+ _yuitest_coverline("build/test/test.js", 1813);+runner._root._start = new Date();+ + //fire the begin event+ _yuitest_coverline("build/test/test.js", 1816);+runner.fire(runner.BEGIN_EVENT);+ + //begin the testing+ _yuitest_coverline("build/test/test.js", 1819);+runner._run();+ } + });+ + _yuitest_coverline("build/test/test.js", 1823);+return new TestRunner();+ + }();++/**+ * The ArrayAssert object provides functions to test JavaScript array objects+ * for a variety of cases.+ * @namespace Test+ * @module test+ * @class ArrayAssert+ * @static+ */+ +_yuitest_coverline("build/test/test.js", 1836);+YUITest.ArrayAssert = {++ //=========================================================================+ // Private methods+ //=========================================================================+ + /**+ * Simple indexOf() implementation for an array. Defers to native+ * if available.+ * @param {Array} haystack The array to search.+ * @param {Variant} needle The value to locate.+ * @return {int} The index of the needle if found or -1 if not.+ * @method _indexOf+ * @private+ */+ _indexOf: function(haystack, needle){+ _yuitest_coverfunc("build/test/test.js", "_indexOf", 1851);+_yuitest_coverline("build/test/test.js", 1852);+if (haystack.indexOf){+ _yuitest_coverline("build/test/test.js", 1853);+return haystack.indexOf(needle);+ } else {+ _yuitest_coverline("build/test/test.js", 1855);+for (var i=0; i < haystack.length; i++){+ _yuitest_coverline("build/test/test.js", 1856);+if (haystack[i] === needle){+ _yuitest_coverline("build/test/test.js", 1857);+return i;+ }+ }+ _yuitest_coverline("build/test/test.js", 1860);+return -1;+ }+ },+ + /**+ * Simple some() implementation for an array. Defers to native+ * if available.+ * @param {Array} haystack The array to search.+ * @param {Function} matcher The function to run on each value.+ * @return {Boolean} True if any value, when run through the matcher,+ * returns true.+ * @method _some+ * @private+ */+ _some: function(haystack, matcher){+ _yuitest_coverfunc("build/test/test.js", "_some", 1874);+_yuitest_coverline("build/test/test.js", 1875);+if (haystack.some){+ _yuitest_coverline("build/test/test.js", 1876);+return haystack.some(matcher);+ } else {+ _yuitest_coverline("build/test/test.js", 1878);+for (var i=0; i < haystack.length; i++){+ _yuitest_coverline("build/test/test.js", 1879);+if (matcher(haystack[i])){+ _yuitest_coverline("build/test/test.js", 1880);+return true;+ }+ }+ _yuitest_coverline("build/test/test.js", 1883);+return false;+ }+ }, ++ /**+ * Asserts that a value is present in an array. This uses the triple equals + * sign so no type coercion may occur.+ * @param {Object} needle The value that is expected in the array.+ * @param {Array} haystack An array of values.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method contains+ * @static+ */+ contains : function (needle, haystack, + message) {+ + _yuitest_coverfunc("build/test/test.js", "contains", 1896);+_yuitest_coverline("build/test/test.js", 1899);+YUITest.Assert._increment(); ++ _yuitest_coverline("build/test/test.js", 1901);+if (this._indexOf(haystack, needle) == -1){+ _yuitest_coverline("build/test/test.js", 1902);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value " + needle + " (" + (typeof needle) + ") not found in array [" + haystack + "]."));+ }+ },++ /**+ * Asserts that a set of values are present in an array. This uses the triple equals + * sign so no type coercion may occur. For this assertion to pass, all values must+ * be found.+ * @param {Object[]} needles An array of values that are expected in the array.+ * @param {Array} haystack An array of values to check.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method containsItems+ * @static+ */+ containsItems : function (needles, haystack, + message) {+ _yuitest_coverfunc("build/test/test.js", "containsItems", 1916);+_yuitest_coverline("build/test/test.js", 1918);+YUITest.Assert._increment(); ++ //begin checking values+ _yuitest_coverline("build/test/test.js", 1921);+for (var i=0; i < needles.length; i++){+ _yuitest_coverline("build/test/test.js", 1922);+if (this._indexOf(haystack, needles[i]) == -1){+ _yuitest_coverline("build/test/test.js", 1923);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value " + needles[i] + " (" + (typeof needles[i]) + ") not found in array [" + haystack + "]."));+ }+ }+ },++ /**+ * Asserts that a value matching some condition is present in an array. This uses+ * a function to determine a match.+ * @param {Function} matcher A function that returns true if the items matches or false if not.+ * @param {Array} haystack An array of values.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method containsMatch+ * @static+ */+ containsMatch : function (matcher, haystack, + message) {+ + _yuitest_coverfunc("build/test/test.js", "containsMatch", 1937);+_yuitest_coverline("build/test/test.js", 1940);+YUITest.Assert._increment(); + //check for valid matcher+ _yuitest_coverline("build/test/test.js", 1942);+if (typeof matcher != "function"){+ _yuitest_coverline("build/test/test.js", 1943);+throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");+ }+ + _yuitest_coverline("build/test/test.js", 1946);+if (!this._some(haystack, matcher)){+ _yuitest_coverline("build/test/test.js", 1947);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "No match found in array [" + haystack + "]."));+ }+ },++ /**+ * Asserts that a value is not present in an array. This uses the triple equals + * Asserts that a value is not present in an array. This uses the triple equals + * sign so no type coercion may occur.+ * @param {Object} needle The value that is expected in the array.+ * @param {Array} haystack An array of values.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method doesNotContain+ * @static+ */+ doesNotContain : function (needle, haystack, + message) {+ + _yuitest_coverfunc("build/test/test.js", "doesNotContain", 1961);+_yuitest_coverline("build/test/test.js", 1964);+YUITest.Assert._increment(); ++ _yuitest_coverline("build/test/test.js", 1966);+if (this._indexOf(haystack, needle) > -1){+ _yuitest_coverline("build/test/test.js", 1967);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));+ }+ },++ /**+ * Asserts that a set of values are not present in an array. This uses the triple equals + * sign so no type coercion may occur. For this assertion to pass, all values must+ * not be found.+ * @param {Object[]} needles An array of values that are not expected in the array.+ * @param {Array} haystack An array of values to check.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method doesNotContainItems+ * @static+ */+ doesNotContainItems : function (needles, haystack, + message) {++ _yuitest_coverfunc("build/test/test.js", "doesNotContainItems", 1981);+_yuitest_coverline("build/test/test.js", 1984);+YUITest.Assert._increment(); ++ _yuitest_coverline("build/test/test.js", 1986);+for (var i=0; i < needles.length; i++){+ _yuitest_coverline("build/test/test.js", 1987);+if (this._indexOf(haystack, needles[i]) > -1){+ _yuitest_coverline("build/test/test.js", 1988);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));+ }+ }++ },+ + /**+ * Asserts that no values matching a condition are present in an array. This uses+ * a function to determine a match.+ * @param {Function} matcher A function that returns true if the item matches or false if not.+ * @param {Array} haystack An array of values.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method doesNotContainMatch+ * @static+ */+ doesNotContainMatch : function (matcher, haystack, + message) {+ + _yuitest_coverfunc("build/test/test.js", "doesNotContainMatch", 2003);+_yuitest_coverline("build/test/test.js", 2006);+YUITest.Assert._increment(); + + //check for valid matcher+ _yuitest_coverline("build/test/test.js", 2009);+if (typeof matcher != "function"){+ _yuitest_coverline("build/test/test.js", 2010);+throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");+ }+ + _yuitest_coverline("build/test/test.js", 2013);+if (this._some(haystack, matcher)){+ _yuitest_coverline("build/test/test.js", 2014);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value found in array [" + haystack + "]."));+ }+ },+ + /**+ * Asserts that the given value is contained in an array at the specified index.+ * This uses the triple equals sign so no type coercion will occur.+ * @param {Object} needle The value to look for.+ * @param {Array} haystack The array to search in.+ * @param {int} index The index at which the value should exist.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method indexOf+ * @static+ */+ indexOf : function (needle, haystack, index, message) {+ + _yuitest_coverfunc("build/test/test.js", "indexOf", 2028);+_yuitest_coverline("build/test/test.js", 2030);+YUITest.Assert._increment(); ++ //try to find the value in the array+ _yuitest_coverline("build/test/test.js", 2033);+for (var i=0; i < haystack.length; i++){+ _yuitest_coverline("build/test/test.js", 2034);+if (haystack[i] === needle){+ _yuitest_coverline("build/test/test.js", 2035);+if (index != i){+ _yuitest_coverline("build/test/test.js", 2036);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value exists at index " + i + " but should be at index " + index + ".")); + }+ _yuitest_coverline("build/test/test.js", 2038);+return;+ }+ }+ + //if it makes it here, it wasn't found at all+ _yuitest_coverline("build/test/test.js", 2043);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value doesn't exist in array [" + haystack + "]."));+ },+ + /**+ * Asserts that the values in an array are equal, and in the same position,+ * as values in another array. This uses the double equals sign+ * so type coercion may occur. Note that the array objects themselves+ * need not be the same for this test to pass.+ * @param {Array} expected An array of the expected values.+ * @param {Array} actual Any array of the actual values.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method itemsAreEqual+ * @static+ */+ itemsAreEqual : function (expected, actual, + message) {+ + _yuitest_coverfunc("build/test/test.js", "itemsAreEqual", 2057);+_yuitest_coverline("build/test/test.js", 2060);+YUITest.Assert._increment(); + + //first make sure they're array-like (this can probably be improved)+ _yuitest_coverline("build/test/test.js", 2063);+if (typeof expected != "object" || typeof actual != "object"){+ _yuitest_coverline("build/test/test.js", 2064);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value should be an array."));+ }+ + //next check array length+ _yuitest_coverline("build/test/test.js", 2068);+if (expected.length != actual.length){+ _yuitest_coverline("build/test/test.js", 2069);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length + "."));+ }+ + //begin checking values+ _yuitest_coverline("build/test/test.js", 2073);+for (var i=0; i < expected.length; i++){+ _yuitest_coverline("build/test/test.js", 2074);+if (expected[i] != actual[i]){+ _yuitest_coverline("build/test/test.js", 2075);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not equal."), expected[i], actual[i]);+ }+ }+ },+ + /**+ * Asserts that the values in an array are equivalent, and in the same position,+ * as values in another array. This uses a function to determine if the values+ * are equivalent. Note that the array objects themselves+ * need not be the same for this test to pass.+ * @param {Array} expected An array of the expected values.+ * @param {Array} actual Any array of the actual values.+ * @param {Function} comparator A function that returns true if the values are equivalent+ * or false if not.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @return {Void}+ * @method itemsAreEquivalent+ * @static+ */+ itemsAreEquivalent : function (expected, actual, + comparator, message) {+ + _yuitest_coverfunc("build/test/test.js", "itemsAreEquivalent", 2094);+_yuitest_coverline("build/test/test.js", 2097);+YUITest.Assert._increment(); ++ //make sure the comparator is valid+ _yuitest_coverline("build/test/test.js", 2100);+if (typeof comparator != "function"){+ _yuitest_coverline("build/test/test.js", 2101);+throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");+ }+ + //first check array length+ _yuitest_coverline("build/test/test.js", 2105);+if (expected.length != actual.length){+ _yuitest_coverline("build/test/test.js", 2106);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length));+ }+ + //begin checking values+ _yuitest_coverline("build/test/test.js", 2110);+for (var i=0; i < expected.length; i++){+ _yuitest_coverline("build/test/test.js", 2111);+if (!comparator(expected[i], actual[i])){+ _yuitest_coverline("build/test/test.js", 2112);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not equivalent."), expected[i], actual[i]);+ }+ }+ },+ + /**+ * Asserts that an array is empty.+ * @param {Array} actual The array to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isEmpty+ * @static+ */+ isEmpty : function (actual, message) { + _yuitest_coverfunc("build/test/test.js", "isEmpty", 2124);+_yuitest_coverline("build/test/test.js", 2125);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 2126);+if (actual.length > 0){+ _yuitest_coverline("build/test/test.js", 2127);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should be empty."));+ }+ }, + + /**+ * Asserts that an array is not empty.+ * @param {Array} actual The array to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNotEmpty+ * @static+ */+ isNotEmpty : function (actual, message) { + _yuitest_coverfunc("build/test/test.js", "isNotEmpty", 2138);+_yuitest_coverline("build/test/test.js", 2139);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 2140);+if (actual.length === 0){+ _yuitest_coverline("build/test/test.js", 2141);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should not be empty."));+ }+ }, + + /**+ * Asserts that the values in an array are the same, and in the same position,+ * as values in another array. This uses the triple equals sign+ * so no type coercion will occur. Note that the array objects themselves+ * need not be the same for this test to pass.+ * @param {Array} expected An array of the expected values.+ * @param {Array} actual Any array of the actual values.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method itemsAreSame+ * @static+ */+ itemsAreSame : function (expected, actual, + message) {+ + _yuitest_coverfunc("build/test/test.js", "itemsAreSame", 2156);+_yuitest_coverline("build/test/test.js", 2159);+YUITest.Assert._increment(); ++ //first check array length+ _yuitest_coverline("build/test/test.js", 2162);+if (expected.length != actual.length){+ _yuitest_coverline("build/test/test.js", 2163);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Array should have a length of " + expected.length + " but has a length of " + actual.length));+ }+ + //begin checking values+ _yuitest_coverline("build/test/test.js", 2167);+for (var i=0; i < expected.length; i++){+ _yuitest_coverline("build/test/test.js", 2168);+if (expected[i] !== actual[i]){+ _yuitest_coverline("build/test/test.js", 2169);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values in position " + i + " are not the same."), expected[i], actual[i]);+ }+ }+ },+ + /**+ * Asserts that the given value is contained in an array at the specified index,+ * starting from the back of the array.+ * This uses the triple equals sign so no type coercion will occur.+ * @param {Object} needle The value to look for.+ * @param {Array} haystack The array to search in.+ * @param {int} index The index at which the value should exist.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method lastIndexOf+ * @static+ */+ lastIndexOf : function (needle, haystack, index, message) {+ + //try to find the value in the array+ _yuitest_coverfunc("build/test/test.js", "lastIndexOf", 2185);+_yuitest_coverline("build/test/test.js", 2188);+for (var i=haystack.length; i >= 0; i--){+ _yuitest_coverline("build/test/test.js", 2189);+if (haystack[i] === needle){+ _yuitest_coverline("build/test/test.js", 2190);+if (index != i){+ _yuitest_coverline("build/test/test.js", 2191);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value exists at index " + i + " but should be at index " + index + ".")); + }+ _yuitest_coverline("build/test/test.js", 2193);+return;+ }+ }+ + //if it makes it here, it wasn't found at all+ _yuitest_coverline("build/test/test.js", 2198);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Value doesn't exist in array.")); + }+ +};+ +/**+ * The Assert object provides functions to test JavaScript values against+ * known and expected results. Whenever a comparison (assertion) fails,+ * an error is thrown.+ * @namespace Test+ * @module test+ * @class Assert+ * @static+ */+_yuitest_coverline("build/test/test.js", 2212);+YUITest.Assert = {++ /**+ * The number of assertions performed.+ * @property _asserts+ * @type int+ * @private+ */+ _asserts: 0,++ //-------------------------------------------------------------------------+ // Helper Methods+ //-------------------------------------------------------------------------+ + /**+ * Formats a message so that it can contain the original assertion message+ * in addition to the custom message.+ * @param {String} customMessage The message passed in by the developer.+ * @param {String} defaultMessage The message created by the error by default.+ * @return {String} The final error message, containing either or both.+ * @protected+ * @static+ * @method _formatMessage+ */+ _formatMessage : function (customMessage, defaultMessage) {+ _yuitest_coverfunc("build/test/test.js", "_formatMessage", 2236);+_yuitest_coverline("build/test/test.js", 2237);+if (typeof customMessage == "string" && customMessage.length > 0){+ _yuitest_coverline("build/test/test.js", 2238);+return customMessage.replace("{message}", defaultMessage);+ } else {+ _yuitest_coverline("build/test/test.js", 2240);+return defaultMessage;+ } + },+ + /**+ * Returns the number of assertions that have been performed.+ * @method _getCount+ * @protected+ * @static+ */+ _getCount: function(){+ _yuitest_coverfunc("build/test/test.js", "_getCount", 2250);+_yuitest_coverline("build/test/test.js", 2251);+return this._asserts;+ },+ + /**+ * Increments the number of assertions that have been performed.+ * @method _increment+ * @protected+ * @static+ */+ _increment: function(){+ _yuitest_coverfunc("build/test/test.js", "_increment", 2260);+_yuitest_coverline("build/test/test.js", 2261);+this._asserts++;+ },+ + /**+ * Resets the number of assertions that have been performed to 0.+ * @method _reset+ * @protected+ * @static+ */+ _reset: function(){+ _yuitest_coverfunc("build/test/test.js", "_reset", 2270);+_yuitest_coverline("build/test/test.js", 2271);+this._asserts = 0;+ },+ + //-------------------------------------------------------------------------+ // Generic Assertion Methods+ //-------------------------------------------------------------------------+ + /** + * Forces an assertion error to occur.+ * @param {String} message (Optional) The message to display with the failure.+ * @method fail+ * @static+ */+ fail : function (message) {+ _yuitest_coverfunc("build/test/test.js", "fail", 2284);+_yuitest_coverline("build/test/test.js", 2285);+throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Test force-failed."));+ }, + + /** + * A marker that the test should pass.+ * @method pass+ * @static+ */+ pass : function (message) {+ _yuitest_coverfunc("build/test/test.js", "pass", 2293);+_yuitest_coverline("build/test/test.js", 2294);+YUITest.Assert._increment();+ }, + + //-------------------------------------------------------------------------+ // Equality Assertion Methods+ //------------------------------------------------------------------------- + + /**+ * Asserts that a value is equal to another. This uses the double equals sign+ * so type coercion may occur.+ * @param {Object} expected The expected value.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method areEqual+ * @static+ */+ areEqual : function (expected, actual, message) {+ _yuitest_coverfunc("build/test/test.js", "areEqual", 2310);+_yuitest_coverline("build/test/test.js", 2311);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2312);+if (expected != actual) {+ _yuitest_coverline("build/test/test.js", 2313);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal."), expected, actual);+ }+ },+ + /**+ * Asserts that a value is not equal to another. This uses the double equals sign+ * so type coercion may occur.+ * @param {Object} unexpected The unexpected value.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method areNotEqual+ * @static+ */+ areNotEqual : function (unexpected, actual, + message) {+ _yuitest_coverfunc("build/test/test.js", "areNotEqual", 2326);+_yuitest_coverline("build/test/test.js", 2328);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2329);+if (unexpected == actual) {+ _yuitest_coverline("build/test/test.js", 2330);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be equal."), unexpected);+ }+ },+ + /**+ * Asserts that a value is not the same as another. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} unexpected The unexpected value.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method areNotSame+ * @static+ */+ areNotSame : function (unexpected, actual, message) {+ _yuitest_coverfunc("build/test/test.js", "areNotSame", 2343);+_yuitest_coverline("build/test/test.js", 2344);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2345);+if (unexpected === actual) {+ _yuitest_coverline("build/test/test.js", 2346);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be the same."), unexpected);+ }+ },++ /**+ * Asserts that a value is the same as another. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} expected The expected value.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method areSame+ * @static+ */+ areSame : function (expected, actual, message) {+ _yuitest_coverfunc("build/test/test.js", "areSame", 2359);+_yuitest_coverline("build/test/test.js", 2360);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2361);+if (expected !== actual) {+ _yuitest_coverline("build/test/test.js", 2362);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be the same."), expected, actual);+ }+ }, + + //-------------------------------------------------------------------------+ // Boolean Assertion Methods+ //------------------------------------------------------------------------- + + /**+ * Asserts that a value is false. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isFalse+ * @static+ */+ isFalse : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isFalse", 2378);+_yuitest_coverline("build/test/test.js", 2379);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2380);+if (false !== actual) {+ _yuitest_coverline("build/test/test.js", 2381);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be false."), false, actual);+ }+ },+ + /**+ * Asserts that a value is true. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isTrue+ * @static+ */+ isTrue : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isTrue", 2393);+_yuitest_coverline("build/test/test.js", 2394);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2395);+if (true !== actual) {+ _yuitest_coverline("build/test/test.js", 2396);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be true."), true, actual);+ }++ },+ + //-------------------------------------------------------------------------+ // Special Value Assertion Methods+ //------------------------------------------------------------------------- + + /**+ * Asserts that a value is not a number.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNaN+ * @static+ */+ isNaN : function (actual, message){+ _yuitest_coverfunc("build/test/test.js", "isNaN", 2412);+_yuitest_coverline("build/test/test.js", 2413);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2414);+if (!isNaN(actual)){+ _yuitest_coverline("build/test/test.js", 2415);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be NaN."), NaN, actual);+ } + },+ + /**+ * Asserts that a value is not the special NaN value.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNotNaN+ * @static+ */+ isNotNaN : function (actual, message){+ _yuitest_coverfunc("build/test/test.js", "isNotNaN", 2426);+_yuitest_coverline("build/test/test.js", 2427);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2428);+if (isNaN(actual)){+ _yuitest_coverline("build/test/test.js", 2429);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be NaN."), NaN);+ } + },+ + /**+ * Asserts that a value is not null. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNotNull+ * @static+ */+ isNotNull : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isNotNull", 2441);+_yuitest_coverline("build/test/test.js", 2442);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2443);+if (actual === null) {+ _yuitest_coverline("build/test/test.js", 2444);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Values should not be null."), null);+ }+ },++ /**+ * Asserts that a value is not undefined. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNotUndefined+ * @static+ */+ isNotUndefined : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isNotUndefined", 2456);+_yuitest_coverline("build/test/test.js", 2457);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2458);+if (typeof actual == "undefined") {+ _yuitest_coverline("build/test/test.js", 2459);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should not be undefined."), undefined);+ }+ },++ /**+ * Asserts that a value is null. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNull+ * @static+ */+ isNull : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isNull", 2471);+_yuitest_coverline("build/test/test.js", 2472);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2473);+if (actual !== null) {+ _yuitest_coverline("build/test/test.js", 2474);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be null."), null, actual);+ }+ },+ + /**+ * Asserts that a value is undefined. This uses the triple equals sign+ * so no type coercion may occur.+ * @param {Object} actual The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isUndefined+ * @static+ */+ isUndefined : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isUndefined", 2486);+_yuitest_coverline("build/test/test.js", 2487);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2488);+if (typeof actual != "undefined") {+ _yuitest_coverline("build/test/test.js", 2489);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be undefined."), undefined, actual);+ }+ }, + + //--------------------------------------------------------------------------+ // Instance Assertion Methods+ //-------------------------------------------------------------------------- + + /**+ * Asserts that a value is an array.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isArray+ * @static+ */+ isArray : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isArray", 2504);+_yuitest_coverline("build/test/test.js", 2505);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2506);+var shouldFail = false;+ _yuitest_coverline("build/test/test.js", 2507);+if (Array.isArray){+ _yuitest_coverline("build/test/test.js", 2508);+shouldFail = !Array.isArray(actual);+ } else {+ _yuitest_coverline("build/test/test.js", 2510);+shouldFail = Object.prototype.toString.call(actual) != "[object Array]";+ }+ _yuitest_coverline("build/test/test.js", 2512);+if (shouldFail){+ _yuitest_coverline("build/test/test.js", 2513);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an array."), actual);+ } + },+ + /**+ * Asserts that a value is a Boolean.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isBoolean+ * @static+ */+ isBoolean : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isBoolean", 2524);+_yuitest_coverline("build/test/test.js", 2525);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2526);+if (typeof actual != "boolean"){+ _yuitest_coverline("build/test/test.js", 2527);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a Boolean."), actual);+ } + },+ + /**+ * Asserts that a value is a function.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isFunction+ * @static+ */+ isFunction : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isFunction", 2538);+_yuitest_coverline("build/test/test.js", 2539);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2540);+if (!(actual instanceof Function)){+ _yuitest_coverline("build/test/test.js", 2541);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a function."), actual);+ } + },+ + /**+ * Asserts that a value is an instance of a particular object. This may return+ * incorrect results when comparing objects from one frame to constructors in+ * another frame. For best results, don't use in a cross-frame manner.+ * @param {Function} expected The function that the object should be an instance of.+ * @param {Object} actual The object to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isInstanceOf+ * @static+ */+ isInstanceOf : function (expected, actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isInstanceOf", 2555);+_yuitest_coverline("build/test/test.js", 2556);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2557);+if (!(actual instanceof expected)){+ _yuitest_coverline("build/test/test.js", 2558);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value isn't an instance of expected type."), expected, actual);+ }+ },+ + /**+ * Asserts that a value is a number.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isNumber+ * @static+ */+ isNumber : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isNumber", 2569);+_yuitest_coverline("build/test/test.js", 2570);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2571);+if (typeof actual != "number"){+ _yuitest_coverline("build/test/test.js", 2572);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a number."), actual);+ } + }, + + /**+ * Asserts that a value is an object.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isObject+ * @static+ */+ isObject : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isObject", 2583);+_yuitest_coverline("build/test/test.js", 2584);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2585);+if (!actual || (typeof actual != "object" && typeof actual != "function")){+ _yuitest_coverline("build/test/test.js", 2586);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be an object."), actual);+ }+ },+ + /**+ * Asserts that a value is a string.+ * @param {Object} actual The value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isString+ * @static+ */+ isString : function (actual, message) {+ _yuitest_coverfunc("build/test/test.js", "isString", 2597);+_yuitest_coverline("build/test/test.js", 2598);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2599);+if (typeof actual != "string"){+ _yuitest_coverline("build/test/test.js", 2600);+throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(message, "Value should be a string."), actual);+ }+ },+ + /**+ * Asserts that a value is of a particular type. + * @param {String} expectedType The expected type of the variable.+ * @param {Object} actualValue The actual value to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method isTypeOf+ * @static+ */+ isTypeOf : function (expectedType, actualValue, message){+ _yuitest_coverfunc("build/test/test.js", "isTypeOf", 2612);+_yuitest_coverline("build/test/test.js", 2613);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2614);+if (typeof actualValue != expectedType){+ _yuitest_coverline("build/test/test.js", 2615);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Value should be of type " + expectedType + "."), expectedType, typeof actualValue);+ }+ },+ + //--------------------------------------------------------------------------+ // Error Detection Methods+ //-------------------------------------------------------------------------- + + /**+ * Asserts that executing a particular method should throw an error of+ * a specific type. This is a replacement for _should.error.+ * @param {String|Function|Object} expectedError If a string, this+ * is the error message that the error must have; if a function, this+ * is the constructor that should have been used to create the thrown+ * error; if an object, this is an instance of a particular error type+ * with a specific error message (both must match).+ * @param {Function} method The method to execute that should throw the error.+ * @param {String} message (Optional) The message to display if the assertion+ * fails.+ * @method throwsError+ * @return {void}+ * @static+ */+ throwsError: function(expectedError, method, message){+ _yuitest_coverfunc("build/test/test.js", "throwsError", 2638);+_yuitest_coverline("build/test/test.js", 2639);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2640);+var error = false;+ + _yuitest_coverline("build/test/test.js", 2642);+try {+ _yuitest_coverline("build/test/test.js", 2643);+method(); + } catch (thrown) {+ + //check to see what type of data we have+ _yuitest_coverline("build/test/test.js", 2647);+if (typeof expectedError == "string"){+ + //if it's a string, check the error message+ _yuitest_coverline("build/test/test.js", 2650);+if (thrown.message != expectedError){+ _yuitest_coverline("build/test/test.js", 2651);+error = true;+ }+ } else {_yuitest_coverline("build/test/test.js", 2653);+if (typeof expectedError == "function"){+ + //if it's a function, see if the error is an instance of it+ _yuitest_coverline("build/test/test.js", 2656);+if (!(thrown instanceof expectedError)){+ _yuitest_coverline("build/test/test.js", 2657);+error = true;+ }+ + } else {_yuitest_coverline("build/test/test.js", 2660);+if (typeof expectedError == "object" && expectedError !== null){+ + //if it's an object, check the instance and message+ _yuitest_coverline("build/test/test.js", 2663);+if (!(thrown instanceof expectedError.constructor) || + thrown.message != expectedError.message){+ _yuitest_coverline("build/test/test.js", 2665);+error = true;+ }+ + } else { //if it gets here, the argument could be wrong+ _yuitest_coverline("build/test/test.js", 2669);+error = true;+ }}}+ + _yuitest_coverline("build/test/test.js", 2672);+if (error){+ _yuitest_coverline("build/test/test.js", 2673);+throw new YUITest.UnexpectedError(thrown); + } else {+ _yuitest_coverline("build/test/test.js", 2675);+return;+ }+ }+ + //if it reaches here, the error wasn't thrown, which is a bad thing+ _yuitest_coverline("build/test/test.js", 2680);+throw new YUITest.AssertionError(YUITest.Assert._formatMessage(message, "Error should have been thrown."));+ }++};+/**+ * Error is thrown whenever an assertion fails. It provides methods+ * to more easily get at error information and also provides a base class+ * from which more specific assertion errors can be derived.+ *+ * @param {String} message The message to display when the error occurs.+ * @namespace Test+ * @module test+ * @class AssertionError+ * @constructor+ */ +_yuitest_coverline("build/test/test.js", 2695);+YUITest.AssertionError = function (message){+ + /**+ * Error message. Must be duplicated to ensure browser receives it.+ * @type String+ * @property message+ */+ _yuitest_coverfunc("build/test/test.js", "AssertionError", 2695);+_yuitest_coverline("build/test/test.js", 2702);+this.message = message;+ + /**+ * The name of the error that occurred.+ * @type String+ * @property name+ */+ _yuitest_coverline("build/test/test.js", 2709);+this.name = "Assert Error";+};++_yuitest_coverline("build/test/test.js", 2712);+YUITest.AssertionError.prototype = {++ //restore constructor+ constructor: YUITest.AssertionError,++ /**+ * Returns a fully formatted error for an assertion failure. This should+ * be overridden by all subclasses to provide specific information.+ * @method getMessage+ * @return {String} A string describing the error.+ */+ getMessage : function () {+ _yuitest_coverfunc("build/test/test.js", "getMessage", 2723);+_yuitest_coverline("build/test/test.js", 2724);+return this.message;+ },+ + /**+ * Returns a string representation of the error.+ * @method toString+ * @return {String} A string representation of the error.+ */+ toString : function () {+ _yuitest_coverfunc("build/test/test.js", "toString", 2732);+_yuitest_coverline("build/test/test.js", 2733);+return this.name + ": " + this.getMessage();+ }++};/**+ * ComparisonFailure is subclass of Error that is thrown whenever+ * a comparison between two values fails. It provides mechanisms to retrieve+ * both the expected and actual value.+ *+ * @param {String} message The message to display when the error occurs.+ * @param {Object} expected The expected value.+ * @param {Object} actual The actual value that caused the assertion to fail.+ * @namespace Test + * @extends AssertionError+ * @module test+ * @class ComparisonFailure+ * @constructor+ */ +_yuitest_coverline("build/test/test.js", 2750);+YUITest.ComparisonFailure = function (message, expected, actual){++ //call superclass+ _yuitest_coverfunc("build/test/test.js", "ComparisonFailure", 2750);+_yuitest_coverline("build/test/test.js", 2753);+YUITest.AssertionError.call(this, message);+ + /**+ * The expected value.+ * @type Object+ * @property expected+ */+ _yuitest_coverline("build/test/test.js", 2760);+this.expected = expected;+ + /**+ * The actual value.+ * @type Object+ * @property actual+ */+ _yuitest_coverline("build/test/test.js", 2767);+this.actual = actual;+ + /**+ * The name of the error that occurred.+ * @type String+ * @property name+ */+ _yuitest_coverline("build/test/test.js", 2774);+this.name = "ComparisonFailure";+ +};++//inherit from YUITest.AssertionError+_yuitest_coverline("build/test/test.js", 2779);+YUITest.ComparisonFailure.prototype = new YUITest.AssertionError;++//restore constructor+_yuitest_coverline("build/test/test.js", 2782);+YUITest.ComparisonFailure.prototype.constructor = YUITest.ComparisonFailure;++/**+ * Returns a fully formatted error for an assertion failure. This message+ * provides information about the expected and actual values.+ * @method getMessage+ * @return {String} A string describing the error.+ */+_yuitest_coverline("build/test/test.js", 2790);+YUITest.ComparisonFailure.prototype.getMessage = function(){+ _yuitest_coverfunc("build/test/test.js", "getMessage", 2790);+_yuitest_coverline("build/test/test.js", 2791);+return this.message + "\nExpected: " + this.expected + " (" + (typeof this.expected) + ")" ++ "\nActual: " + this.actual + " (" + (typeof this.actual) + ")";+};+/**+ * An object object containing coverage result formatting methods.+ * @namespace Test+ * @module test+ * @class CoverageFormat+ * @static+ */+_yuitest_coverline("build/test/test.js", 2801);+YUITest.CoverageFormat = {++ /**+ * Returns the coverage report in JSON format. This is the straight+ * JSON representation of the native coverage report.+ * @param {Object} coverage The coverage report object.+ * @return {String} A JSON-formatted string of coverage data.+ * @method JSON+ * @namespace Test.CoverageFormat+ */+ JSON: function(coverage){+ _yuitest_coverfunc("build/test/test.js", "JSON", 2811);+_yuitest_coverline("build/test/test.js", 2812);+return YUITest.Util.JSON.stringify(coverage);+ },+ + /**+ * Returns the coverage report in a JSON format compatible with+ * Xdebug. See <a href="http://www.xdebug.com/docs/code_coverage">Xdebug Documentation</a>+ * for more information. Note: function coverage is not available+ * in this format.+ * @param {Object} coverage The coverage report object.+ * @return {String} A JSON-formatted string of coverage data.+ * @method XdebugJSON+ * @namespace Test.CoverageFormat+ */ + XdebugJSON: function(coverage){+ + _yuitest_coverfunc("build/test/test.js", "XdebugJSON", 2825);+_yuitest_coverline("build/test/test.js", 2827);+var report = {};+ _yuitest_coverline("build/test/test.js", 2828);+for (var prop in coverage){+ _yuitest_coverline("build/test/test.js", 2829);+if (coverage.hasOwnProperty(prop)){+ _yuitest_coverline("build/test/test.js", 2830);+report[prop] = coverage[prop].lines;+ }+ }++ _yuitest_coverline("build/test/test.js", 2834);+return YUITest.Util.JSON.stringify(coverage);+ }++};++/**+ * The DateAssert object provides functions to test JavaScript Date objects+ * for a variety of cases.+ * @namespace Test+ * @module test+ * @class DateAssert+ * @static+ */+ +_yuitest_coverline("build/test/test.js", 2848);+YUITest.DateAssert = {++ /**+ * Asserts that a date's month, day, and year are equal to another date's.+ * @param {Date} expected The expected date.+ * @param {Date} actual The actual date to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method datesAreEqual+ * @static+ */+ datesAreEqual : function (expected, actual, message){+ _yuitest_coverfunc("build/test/test.js", "datesAreEqual", 2858);+_yuitest_coverline("build/test/test.js", 2859);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 2860);+if (expected instanceof Date && actual instanceof Date){+ _yuitest_coverline("build/test/test.js", 2861);+var msg = "";+ + //check years first+ _yuitest_coverline("build/test/test.js", 2864);+if (expected.getFullYear() != actual.getFullYear()){+ _yuitest_coverline("build/test/test.js", 2865);+msg = "Years should be equal.";+ }+ + //now check months+ _yuitest_coverline("build/test/test.js", 2869);+if (expected.getMonth() != actual.getMonth()){+ _yuitest_coverline("build/test/test.js", 2870);+msg = "Months should be equal.";+ } + + //last, check the day of the month+ _yuitest_coverline("build/test/test.js", 2874);+if (expected.getDate() != actual.getDate()){+ _yuitest_coverline("build/test/test.js", 2875);+msg = "Days of month should be equal.";+ } + + _yuitest_coverline("build/test/test.js", 2878);+if (msg.length){+ _yuitest_coverline("build/test/test.js", 2879);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);+ }+ } else {+ _yuitest_coverline("build/test/test.js", 2882);+throw new TypeError("YUITest.DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");+ }+ },++ /**+ * Asserts that a date's hour, minutes, and seconds are equal to another date's.+ * @param {Date} expected The expected date.+ * @param {Date} actual The actual date to test.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method timesAreEqual+ * @static+ */+ timesAreEqual : function (expected, actual, message){+ _yuitest_coverfunc("build/test/test.js", "timesAreEqual", 2894);+_yuitest_coverline("build/test/test.js", 2895);+YUITest.Assert._increment();+ _yuitest_coverline("build/test/test.js", 2896);+if (expected instanceof Date && actual instanceof Date){+ _yuitest_coverline("build/test/test.js", 2897);+var msg = "";+ + //check hours first+ _yuitest_coverline("build/test/test.js", 2900);+if (expected.getHours() != actual.getHours()){+ _yuitest_coverline("build/test/test.js", 2901);+msg = "Hours should be equal.";+ }+ + //now check minutes+ _yuitest_coverline("build/test/test.js", 2905);+if (expected.getMinutes() != actual.getMinutes()){+ _yuitest_coverline("build/test/test.js", 2906);+msg = "Minutes should be equal.";+ } + + //last, check the seconds+ _yuitest_coverline("build/test/test.js", 2910);+if (expected.getSeconds() != actual.getSeconds()){+ _yuitest_coverline("build/test/test.js", 2911);+msg = "Seconds should be equal.";+ } + + _yuitest_coverline("build/test/test.js", 2914);+if (msg.length){+ _yuitest_coverline("build/test/test.js", 2915);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, msg), expected, actual);+ }+ } else {+ _yuitest_coverline("build/test/test.js", 2918);+throw new TypeError("YUITest.DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");+ }+ }+ +};/**+ * Creates a new mock object.+ * @namespace Test+ * @module test+ * @class Mock+ * @constructor+ * @param {Object} template (Optional) An object whose methods+ * should be stubbed out on the mock object.+ */+_yuitest_coverline("build/test/test.js", 2931);+YUITest.Mock = function(template){++ //use blank object is nothing is passed in+ _yuitest_coverfunc("build/test/test.js", "Mock", 2931);+_yuitest_coverline("build/test/test.js", 2934);+template = template || {};+ + _yuitest_coverline("build/test/test.js", 2936);+var mock,+ name;+ + //try to create mock that keeps prototype chain intact+ //fails in the case of ActiveX objects+ _yuitest_coverline("build/test/test.js", 2941);+try {+ _yuitest_coverline("build/test/test.js", 2942);+function f(){}+ _yuitest_coverline("build/test/test.js", 2943);+f.prototype = template;+ _yuitest_coverline("build/test/test.js", 2944);+mock = new f();+ } catch (ex) {+ _yuitest_coverline("build/test/test.js", 2946);+mock = {};+ }++ //create stubs for all methods+ _yuitest_coverline("build/test/test.js", 2950);+for (name in template){+ _yuitest_coverline("build/test/test.js", 2951);+if (template.hasOwnProperty(name)){+ _yuitest_coverline("build/test/test.js", 2952);+if (typeof template[name] == "function"){+ _yuitest_coverline("build/test/test.js", 2953);+mock[name] = function(name){+ _yuitest_coverfunc("build/test/test.js", "]", 2953);+_yuitest_coverline("build/test/test.js", 2954);+return function(){+ _yuitest_coverfunc("build/test/test.js", "(anonymous 11)", 2954);+_yuitest_coverline("build/test/test.js", 2955);+YUITest.Assert.fail("Method " + name + "() was called but was not expected to be.");+ };+ }(name);+ }+ }+ }++ //return it+ _yuitest_coverline("build/test/test.js", 2963);+return mock; +};+ +/**+ * Assigns an expectation to a mock object. This is used to create+ * methods and properties on the mock object that are monitored for+ * calls and changes, respectively.+ * @param {Object} mock The object to add the expectation to.+ * @param {Object} expectation An object defining the expectation. For+ * properties, the keys "property" and "value" are required. For a+ * method the "method" key defines the method's name, the optional "args"+ * key provides an array of argument types. The "returns" key provides+ * an optional return value. An optional "run" key provides a function+ * to be used as the method body. The return value of a mocked method is+ * determined first by the "returns" key, then the "run" function's return+ * value. If neither "returns" nor "run" is provided undefined is returned.+ * An optional 'error' key defines an error type to be thrown in all cases.+ * The "callCount" key provides an optional number of times the method is+ * expected to be called (the default is 1).+ * @return {void}+ * @method expect+ * @static+ */ +_yuitest_coverline("build/test/test.js", 2986);+YUITest.Mock.expect = function(mock /*:Object*/, expectation /*:Object*/){++ //make sure there's a place to store the expectations+ _yuitest_coverfunc("build/test/test.js", "expect", 2986);+_yuitest_coverline("build/test/test.js", 2989);+if (!mock.__expectations) {+ _yuitest_coverline("build/test/test.js", 2990);+mock.__expectations = {};+ }++ //method expectation+ _yuitest_coverline("build/test/test.js", 2994);+if (expectation.method){+ _yuitest_coverline("build/test/test.js", 2995);+var name = expectation.method,+ args = expectation.args || [],+ result = expectation.returns,+ callCount = (typeof expectation.callCount == "number") ? expectation.callCount : 1,+ error = expectation.error,+ run = expectation.run || function(){},+ runResult,+ i;++ //save expectations+ _yuitest_coverline("build/test/test.js", 3005);+mock.__expectations[name] = expectation;+ _yuitest_coverline("build/test/test.js", 3006);+expectation.callCount = callCount;+ _yuitest_coverline("build/test/test.js", 3007);+expectation.actualCallCount = 0;+ + //process arguments+ _yuitest_coverline("build/test/test.js", 3010);+for (i=0; i < args.length; i++){+ _yuitest_coverline("build/test/test.js", 3011);+if (!(args[i] instanceof YUITest.Mock.Value)){+ _yuitest_coverline("build/test/test.js", 3012);+args[i] = YUITest.Mock.Value(YUITest.Assert.areSame, [args[i]], "Argument " + i + " of " + name + "() is incorrect.");+ } + }+ + //if the method is expected to be called+ _yuitest_coverline("build/test/test.js", 3017);+if (callCount > 0){+ _yuitest_coverline("build/test/test.js", 3018);+mock[name] = function(){ + _yuitest_coverfunc("build/test/test.js", "]", 3018);+_yuitest_coverline("build/test/test.js", 3019);+try {+ _yuitest_coverline("build/test/test.js", 3020);+expectation.actualCallCount++;+ _yuitest_coverline("build/test/test.js", 3021);+YUITest.Assert.areEqual(args.length, arguments.length, "Method " + name + "() passed incorrect number of arguments.");+ _yuitest_coverline("build/test/test.js", 3022);+for (var i=0, len=args.length; i < len; i++){+ _yuitest_coverline("build/test/test.js", 3023);+args[i].verify(arguments[i]);+ } ++ _yuitest_coverline("build/test/test.js", 3026);+runResult = run.apply(this, arguments);+ + _yuitest_coverline("build/test/test.js", 3028);+if (error){+ _yuitest_coverline("build/test/test.js", 3029);+throw error;+ }+ } catch (ex){+ //route through TestRunner for proper handling+ _yuitest_coverline("build/test/test.js", 3033);+YUITest.TestRunner._handleError(ex);+ }++ // Any value provided for 'returns' overrides any value returned+ // by our 'run' function. + _yuitest_coverline("build/test/test.js", 3038);+return expectation.hasOwnProperty('returns') ? result : runResult;+ };+ } else {+ + //method should fail if called when not expected+ _yuitest_coverline("build/test/test.js", 3043);+mock[name] = function(){+ _yuitest_coverfunc("build/test/test.js", "]", 3043);+_yuitest_coverline("build/test/test.js", 3044);+try {+ _yuitest_coverline("build/test/test.js", 3045);+YUITest.Assert.fail("Method " + name + "() should not have been called.");+ } catch (ex){+ //route through TestRunner for proper handling+ _yuitest_coverline("build/test/test.js", 3048);+YUITest.TestRunner._handleError(ex);+ } + };+ }+ } else {_yuitest_coverline("build/test/test.js", 3052);+if (expectation.property){+ //save expectations+ _yuitest_coverline("build/test/test.js", 3054);+mock.__expectations[expectation.property] = expectation;+ }}+};++/**+ * Verifies that all expectations of a mock object have been met and+ * throws an assertion error if not.+ * @param {Object} mock The object to verify..+ * @return {void}+ * @method verify+ * @static+ */ +_yuitest_coverline("build/test/test.js", 3066);+YUITest.Mock.verify = function(mock){ + _yuitest_coverfunc("build/test/test.js", "verify", 3066);+_yuitest_coverline("build/test/test.js", 3067);+try {+ + _yuitest_coverline("build/test/test.js", 3069);+for (var name in mock.__expectations){+ _yuitest_coverline("build/test/test.js", 3070);+if (mock.__expectations.hasOwnProperty(name)){+ _yuitest_coverline("build/test/test.js", 3071);+var expectation = mock.__expectations[name];+ _yuitest_coverline("build/test/test.js", 3072);+if (expectation.method) {+ _yuitest_coverline("build/test/test.js", 3073);+YUITest.Assert.areEqual(expectation.callCount, expectation.actualCallCount, "Method " + expectation.method + "() wasn't called the expected number of times.");+ } else {_yuitest_coverline("build/test/test.js", 3074);+if (expectation.property){+ _yuitest_coverline("build/test/test.js", 3075);+YUITest.Assert.areEqual(expectation.value, mock[expectation.property], "Property " + expectation.property + " wasn't set to the correct value."); + }} + }+ }++ } catch (ex){+ //route through TestRunner for proper handling+ _yuitest_coverline("build/test/test.js", 3082);+YUITest.TestRunner._handleError(ex);+ }+};++/**+ * Creates a new value matcher.+ * @param {Function} method The function to call on the value.+ * @param {Array} originalArgs (Optional) Array of arguments to pass to the method.+ * @param {String} message (Optional) Message to display in case of failure.+ * @namespace Test.Mock+ * @module test+ * @class Value+ * @constructor+ */+_yuitest_coverline("build/test/test.js", 3096);+YUITest.Mock.Value = function(method, originalArgs, message){+ _yuitest_coverfunc("build/test/test.js", "Value", 3096);+_yuitest_coverline("build/test/test.js", 3097);+if (this instanceof YUITest.Mock.Value){+ _yuitest_coverline("build/test/test.js", 3098);+this.verify = function(value){+ _yuitest_coverfunc("build/test/test.js", "verify", 3098);+_yuitest_coverline("build/test/test.js", 3099);+var args = [].concat(originalArgs || []);+ _yuitest_coverline("build/test/test.js", 3100);+args.push(value);+ _yuitest_coverline("build/test/test.js", 3101);+args.push(message);+ _yuitest_coverline("build/test/test.js", 3102);+method.apply(null, args);+ };+ } else {+ _yuitest_coverline("build/test/test.js", 3105);+return new YUITest.Mock.Value(method, originalArgs, message);+ }+};++/**+ * Predefined matcher to match any value.+ * @property Any+ * @static+ * @type Function+ */+_yuitest_coverline("build/test/test.js", 3115);+YUITest.Mock.Value.Any = YUITest.Mock.Value(function(){});++/**+ * Predefined matcher to match boolean values.+ * @property Boolean+ * @static+ * @type Function+ */+_yuitest_coverline("build/test/test.js", 3123);+YUITest.Mock.Value.Boolean = YUITest.Mock.Value(YUITest.Assert.isBoolean);++/**+ * Predefined matcher to match number values.+ * @property Number+ * @static+ * @type Function+ */+_yuitest_coverline("build/test/test.js", 3131);+YUITest.Mock.Value.Number = YUITest.Mock.Value(YUITest.Assert.isNumber);++/**+ * Predefined matcher to match string values.+ * @property String+ * @static+ * @type Function+ */+_yuitest_coverline("build/test/test.js", 3139);+YUITest.Mock.Value.String = YUITest.Mock.Value(YUITest.Assert.isString);++/**+ * Predefined matcher to match object values.+ * @property Object+ * @static+ * @type Function+ */+_yuitest_coverline("build/test/test.js", 3147);+YUITest.Mock.Value.Object = YUITest.Mock.Value(YUITest.Assert.isObject);++/**+ * Predefined matcher to match function values.+ * @property Function+ * @static+ * @type Function+ */+_yuitest_coverline("build/test/test.js", 3155);+YUITest.Mock.Value.Function = YUITest.Mock.Value(YUITest.Assert.isFunction);++/**+ * The ObjectAssert object provides functions to test JavaScript objects+ * for a variety of cases.+ * @namespace Test+ * @module test+ * @class ObjectAssert+ * @static+ */+_yuitest_coverline("build/test/test.js", 3165);+YUITest.ObjectAssert = {++ /**+ * Asserts that an object has all of the same properties+ * and property values as the other.+ * @param {Object} expected The object with all expected properties and values.+ * @param {Object} actual The object to inspect.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method areEqual+ * @static+ * @deprecated+ */+ areEqual: function(expected, actual, message) {+ _yuitest_coverfunc("build/test/test.js", "areEqual", 3177);+_yuitest_coverline("build/test/test.js", 3178);+YUITest.Assert._increment(); + + _yuitest_coverline("build/test/test.js", 3180);+var expectedKeys = YUITest.Object.keys(expected),+ actualKeys = YUITest.Object.keys(actual);+ + //first check keys array length+ _yuitest_coverline("build/test/test.js", 3184);+if (expectedKeys.length != actualKeys.length){+ _yuitest_coverline("build/test/test.js", 3185);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Object should have " + expectedKeys.length + " keys but has " + actualKeys.length));+ }+ + //then check values+ _yuitest_coverline("build/test/test.js", 3189);+for (var name in expected){+ _yuitest_coverline("build/test/test.js", 3190);+if (expected.hasOwnProperty(name)){+ _yuitest_coverline("build/test/test.js", 3191);+if (expected[name] != actual[name]){+ _yuitest_coverline("build/test/test.js", 3192);+throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(message, "Values should be equal for property " + name), expected[name], actual[name]);+ } + }+ } + },+ + /**+ * Asserts that an object has a property with the given name.+ * @param {String} propertyName The name of the property to test.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method hasKey+ * @static+ * @deprecated Use ownsOrInheritsKey() instead+ */ + hasKey: function (propertyName, object, message) {+ _yuitest_coverfunc("build/test/test.js", "hasKey", 3207);+_yuitest_coverline("build/test/test.js", 3208);+YUITest.ObjectAssert.ownsOrInheritsKey(propertyName, object, message); + },+ + /**+ * Asserts that an object has all properties of a reference object.+ * @param {Array} properties An array of property names that should be on the object.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method hasKeys+ * @static+ * @deprecated Use ownsOrInheritsKeys() instead+ */ + hasKeys: function (properties, object, message) {+ _yuitest_coverfunc("build/test/test.js", "hasKeys", 3220);+_yuitest_coverline("build/test/test.js", 3221);+YUITest.ObjectAssert.ownsOrInheritsKeys(properties, object, message);+ },+ + /**+ * Asserts that a property with the given name exists on an object's prototype.+ * @param {String} propertyName The name of the property to test.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method inheritsKey+ * @static+ */ + inheritsKey: function (propertyName, object, message) {+ _yuitest_coverfunc("build/test/test.js", "inheritsKey", 3232);+_yuitest_coverline("build/test/test.js", 3233);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3234);+if (!(propertyName in object && !object.hasOwnProperty(propertyName))){+ _yuitest_coverline("build/test/test.js", 3235);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object instance."));+ } + },+ + /**+ * Asserts that all properties exist on an object prototype.+ * @param {Array} properties An array of property names that should be on the object.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method inheritsKeys+ * @static+ */ + inheritsKeys: function (properties, object, message) {+ _yuitest_coverfunc("build/test/test.js", "inheritsKeys", 3247);+_yuitest_coverline("build/test/test.js", 3248);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3249);+for (var i=0; i < properties.length; i++){+ _yuitest_coverline("build/test/test.js", 3250);+if (!(propertyName in object && !object.hasOwnProperty(properties[i]))){+ _yuitest_coverline("build/test/test.js", 3251);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object instance."));+ } + }+ },+ + /**+ * Asserts that a property with the given name exists on an object instance (not on its prototype).+ * @param {String} propertyName The name of the property to test.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method ownsKey+ * @static+ */ + ownsKey: function (propertyName, object, message) {+ _yuitest_coverfunc("build/test/test.js", "ownsKey", 3264);+_yuitest_coverline("build/test/test.js", 3265);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3266);+if (!object.hasOwnProperty(propertyName)){+ _yuitest_coverline("build/test/test.js", 3267);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object instance."));+ } + },+ + /**+ * Asserts that all properties exist on an object instance (not on its prototype).+ * @param {Array} properties An array of property names that should be on the object.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method ownsKeys+ * @static+ */ + ownsKeys: function (properties, object, message) {+ _yuitest_coverfunc("build/test/test.js", "ownsKeys", 3279);+_yuitest_coverline("build/test/test.js", 3280);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3281);+for (var i=0; i < properties.length; i++){+ _yuitest_coverline("build/test/test.js", 3282);+if (!object.hasOwnProperty(properties[i])){+ _yuitest_coverline("build/test/test.js", 3283);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object instance."));+ } + }+ },+ + /**+ * Asserts that an object owns no properties.+ * @param {Object} object The object to check.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method ownsNoKeys+ * @static+ */ + ownsNoKeys : function (object, message) {+ _yuitest_coverfunc("build/test/test.js", "ownsNoKeys", 3295);+_yuitest_coverline("build/test/test.js", 3296);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3297);+var count = 0,+ name;+ _yuitest_coverline("build/test/test.js", 3299);+for (name in object){+ _yuitest_coverline("build/test/test.js", 3300);+if (object.hasOwnProperty(name)){+ _yuitest_coverline("build/test/test.js", 3301);+count++;+ }+ }+ + _yuitest_coverline("build/test/test.js", 3305);+if (count !== 0){+ _yuitest_coverline("build/test/test.js", 3306);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Object owns " + count + " properties but should own none.")); + }++ },++ /**+ * Asserts that an object has a property with the given name.+ * @param {String} propertyName The name of the property to test.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method ownsOrInheritsKey+ * @static+ */ + ownsOrInheritsKey: function (propertyName, object, message) {+ _yuitest_coverfunc("build/test/test.js", "ownsOrInheritsKey", 3319);+_yuitest_coverline("build/test/test.js", 3320);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3321);+if (!(propertyName in object)){+ _yuitest_coverline("build/test/test.js", 3322);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + propertyName + "' not found on object."));+ } + },+ + /**+ * Asserts that an object has all properties of a reference object.+ * @param {Array} properties An array of property names that should be on the object.+ * @param {Object} object The object to search.+ * @param {String} message (Optional) The message to display if the assertion fails.+ * @method ownsOrInheritsKeys+ * @static+ */ + ownsOrInheritsKeys: function (properties, object, message) {+ _yuitest_coverfunc("build/test/test.js", "ownsOrInheritsKeys", 3334);+_yuitest_coverline("build/test/test.js", 3335);+YUITest.Assert._increment(); + _yuitest_coverline("build/test/test.js", 3336);+for (var i=0; i < properties.length; i++){+ _yuitest_coverline("build/test/test.js", 3337);+if (!(properties[i] in object)){+ _yuitest_coverline("build/test/test.js", 3338);+YUITest.Assert.fail(YUITest.Assert._formatMessage(message, "Property '" + properties[i] + "' not found on object."));+ } + }+ } +};+/**+ * Convenience type for storing and aggregating+ * test result information.+ * @private+ * @namespace Test+ * @module test+ * @class Results+ * @constructor+ * @param {String} name The name of the test.+ */+_yuitest_coverline("build/test/test.js", 3353);+YUITest.Results = function(name){++ /**+ * Name of the test, test case, or test suite.+ * @type String+ * @property name+ */+ _yuitest_coverfunc("build/test/test.js", "Results", 3353);+_yuitest_coverline("build/test/test.js", 3360);+this.name = name;+ + /**+ * Number of passed tests.+ * @type int+ * @property passed+ */+ _yuitest_coverline("build/test/test.js", 3367);+this.passed = 0;+ + /**+ * Number of failed tests.+ * @type int+ * @property failed+ */+ _yuitest_coverline("build/test/test.js", 3374);+this.failed = 0;+ + /**+ * Number of errors that occur in non-test methods.+ * @type int+ * @property errors+ */+ _yuitest_coverline("build/test/test.js", 3381);+this.errors = 0;+ + /**+ * Number of ignored tests.+ * @type int+ * @property ignored+ */+ _yuitest_coverline("build/test/test.js", 3388);+this.ignored = 0;+ + /**+ * Number of total tests.+ * @type int+ * @property total+ */+ _yuitest_coverline("build/test/test.js", 3395);+this.total = 0;+ + /**+ * Amount of time (ms) it took to complete testing.+ * @type int+ * @property duration+ */+ _yuitest_coverline("build/test/test.js", 3402);+this.duration = 0;+};++/**+ * Includes results from another results object into this one.+ * @param {Test.Results} result The results object to include.+ * @method include+ * @return {void}+ */+_yuitest_coverline("build/test/test.js", 3411);+YUITest.Results.prototype.include = function(results){+ _yuitest_coverfunc("build/test/test.js", "include", 3411);+_yuitest_coverline("build/test/test.js", 3412);+this.passed += results.passed;+ _yuitest_coverline("build/test/test.js", 3413);+this.failed += results.failed;+ _yuitest_coverline("build/test/test.js", 3414);+this.ignored += results.ignored;+ _yuitest_coverline("build/test/test.js", 3415);+this.total += results.total;+ _yuitest_coverline("build/test/test.js", 3416);+this.errors += results.errors;+};+/**+ * ShouldError is subclass of Error that is thrown whenever+ * a test is expected to throw an error but doesn't.+ *+ * @param {String} message The message to display when the error occurs.+ * @namespace Test + * @extends AssertionError+ * @module test+ * @class ShouldError+ * @constructor+ */ +_yuitest_coverline("build/test/test.js", 3429);+YUITest.ShouldError = function (message){++ //call superclass+ _yuitest_coverfunc("build/test/test.js", "ShouldError", 3429);+_yuitest_coverline("build/test/test.js", 3432);+YUITest.AssertionError.call(this, message || "This test should have thrown an error but didn't.");+ + /**+ * The name of the error that occurred.+ * @type String+ * @property name+ */+ _yuitest_coverline("build/test/test.js", 3439);+this.name = "ShouldError";+ +};++//inherit from YUITest.AssertionError+_yuitest_coverline("build/test/test.js", 3444);+YUITest.ShouldError.prototype = new YUITest.AssertionError();++//restore constructor+_yuitest_coverline("build/test/test.js", 3447);+YUITest.ShouldError.prototype.constructor = YUITest.ShouldError;+/**+ * ShouldFail is subclass of AssertionError that is thrown whenever+ * a test was expected to fail but did not.+ *+ * @param {String} message The message to display when the error occurs.+ * @namespace Test + * @extends YUITest.AssertionError+ * @module test+ * @class ShouldFail+ * @constructor+ */ +_yuitest_coverline("build/test/test.js", 3459);+YUITest.ShouldFail = function (message){++ //call superclass+ _yuitest_coverfunc("build/test/test.js", "ShouldFail", 3459);+_yuitest_coverline("build/test/test.js", 3462);+YUITest.AssertionError.call(this, message || "This test should fail but didn't.");+ + /**+ * The name of the error that occurred.+ * @type String+ * @property name+ */+ _yuitest_coverline("build/test/test.js", 3469);+this.name = "ShouldFail";+ +};++//inherit from YUITest.AssertionError+_yuitest_coverline("build/test/test.js", 3474);+YUITest.ShouldFail.prototype = new YUITest.AssertionError();++//restore constructor+_yuitest_coverline("build/test/test.js", 3477);+YUITest.ShouldFail.prototype.constructor = YUITest.ShouldFail;+/**+ * UnexpectedError is subclass of AssertionError that is thrown whenever+ * an error occurs within the course of a test and the test was not expected+ * to throw an error.+ *+ * @param {Error} cause The unexpected error that caused this error to be + * thrown.+ * @namespace Test + * @extends YUITest.AssertionError+ * @module test+ * @class UnexpectedError+ * @constructor+ */ +_yuitest_coverline("build/test/test.js", 3491);+YUITest.UnexpectedError = function (cause){++ //call superclass+ _yuitest_coverfunc("build/test/test.js", "UnexpectedError", 3491);+_yuitest_coverline("build/test/test.js", 3494);+YUITest.AssertionError.call(this, "Unexpected error: " + cause.message);+ + /**+ * The unexpected error that occurred.+ * @type Error+ * @property cause+ */+ _yuitest_coverline("build/test/test.js", 3501);+this.cause = cause;+ + /**+ * The name of the error that occurred.+ * @type String+ * @property name+ */+ _yuitest_coverline("build/test/test.js", 3508);+this.name = "UnexpectedError";+ + /**+ * Stack information for the error (if provided).+ * @type String+ * @property stack+ */+ _yuitest_coverline("build/test/test.js", 3515);+this.stack = cause.stack;+ +};++//inherit from YUITest.AssertionError+_yuitest_coverline("build/test/test.js", 3520);+YUITest.UnexpectedError.prototype = new YUITest.AssertionError();++//restore constructor+_yuitest_coverline("build/test/test.js", 3523);+YUITest.UnexpectedError.prototype.constructor = YUITest.UnexpectedError;+/**+ * UnexpectedValue is subclass of Error that is thrown whenever+ * a value was unexpected in its scope. This typically means that a test+ * was performed to determine that a value was *not* equal to a certain+ * value.+ *+ * @param {String} message The message to display when the error occurs.+ * @param {Object} unexpected The unexpected value.+ * @namespace Test + * @extends AssertionError+ * @module test+ * @class UnexpectedValue+ * @constructor+ */ +_yuitest_coverline("build/test/test.js", 3538);+YUITest.UnexpectedValue = function (message, unexpected){++ //call superclass+ _yuitest_coverfunc("build/test/test.js", "UnexpectedValue", 3538);+_yuitest_coverline("build/test/test.js", 3541);+YUITest.AssertionError.call(this, message);+ + /**+ * The unexpected value.+ * @type Object+ * @property unexpected+ */+ _yuitest_coverline("build/test/test.js", 3548);+this.unexpected = unexpected;+ + /**+ * The name of the error that occurred.+ * @type String+ * @property name+ */+ _yuitest_coverline("build/test/test.js", 3555);+this.name = "UnexpectedValue";+ +};++//inherit from YUITest.AssertionError+_yuitest_coverline("build/test/test.js", 3560);+YUITest.UnexpectedValue.prototype = new YUITest.AssertionError();++//restore constructor+_yuitest_coverline("build/test/test.js", 3563);+YUITest.UnexpectedValue.prototype.constructor = YUITest.UnexpectedValue;++/**+ * Returns a fully formatted error for an assertion failure. This message+ * provides information about the expected and actual values.+ * @method getMessage+ * @return {String} A string describing the error.+ */+_yuitest_coverline("build/test/test.js", 3571);+YUITest.UnexpectedValue.prototype.getMessage = function(){+ _yuitest_coverfunc("build/test/test.js", "getMessage", 3571);+_yuitest_coverline("build/test/test.js", 3572);+return this.message + "\nUnexpected: " + this.unexpected + " (" + (typeof this.unexpected) + ") ";+};++/**+ * Represents a stoppage in test execution to wait for an amount of time before+ * continuing.+ * @param {Function} segment A function to run when the wait is over.+ * @param {int} delay The number of milliseconds to wait before running the code.+ * @module test+ * @class Wait+ * @namespace Test+ * @constructor+ *+ */+_yuitest_coverline("build/test/test.js", 3586);+YUITest.Wait = function (segment, delay) {+ + /**+ * The segment of code to run when the wait is over.+ * @type Function+ * @property segment+ */+ _yuitest_coverfunc("build/test/test.js", "Wait", 3586);+_yuitest_coverline("build/test/test.js", 3593);+this.segment = (typeof segment == "function" ? segment : null);++ /**+ * The delay before running the segment of code.+ * @type int+ * @property delay+ */+ _yuitest_coverline("build/test/test.js", 3600);+this.delay = (typeof delay == "number" ? delay : 0); +};+++//Setting up our aliases..+_yuitest_coverline("build/test/test.js", 3605);+Y.Test = YUITest;+_yuitest_coverline("build/test/test.js", 3606);+Y.Object.each(YUITest, function(item, name) {+ _yuitest_coverfunc("build/test/test.js", "(anonymous 14)", 3606);+_yuitest_coverline("build/test/test.js", 3607);+var name = name.replace('Test', '');+ _yuitest_coverline("build/test/test.js", 3608);+Y.Test[name] = item;+});++} //End of else in top wrapper++_yuitest_coverline("build/test/test.js", 3613);+Y.Assert = YUITest.Assert;+_yuitest_coverline("build/test/test.js", 3614);+Y.Assert.Error = Y.Test.AssertionError;+_yuitest_coverline("build/test/test.js", 3615);+Y.Assert.ComparisonFailure = Y.Test.ComparisonFailure;+_yuitest_coverline("build/test/test.js", 3616);+Y.Assert.UnexpectedValue = Y.Test.UnexpectedValue;+_yuitest_coverline("build/test/test.js", 3617);+Y.Mock = Y.Test.Mock;+_yuitest_coverline("build/test/test.js", 3618);+Y.ObjectAssert = Y.Test.ObjectAssert;+_yuitest_coverline("build/test/test.js", 3619);+Y.ArrayAssert = Y.Test.ArrayAssert;+_yuitest_coverline("build/test/test.js", 3620);+Y.DateAssert = Y.Test.DateAssert;+_yuitest_coverline("build/test/test.js", 3621);+Y.Test.ResultsFormat = Y.Test.TestFormat;++_yuitest_coverline("build/test/test.js", 3623);+var itemsAreEqual = Y.Test.ArrayAssert.itemsAreEqual;++_yuitest_coverline("build/test/test.js", 3625);+Y.Test.ArrayAssert.itemsAreEqual = function(expected, actual, message) {+ _yuitest_coverfunc("build/test/test.js", "itemsAreEqual", 3625);+_yuitest_coverline("build/test/test.js", 3626);+return itemsAreEqual.call(this, Y.Array(expected), Y.Array(actual), message);+};+++/**+ * Asserts that a given condition is true. If not, then a Y.Assert.Error object is thrown+ * and the test fails.+ * @method assert+ * @param {Boolean} condition The condition to test.+ * @param {String} message The message to display if the assertion fails.+ * @for YUI+ * @static+ */+_yuitest_coverline("build/test/test.js", 3639);+Y.assert = function(condition, message){+ _yuitest_coverfunc("build/test/test.js", "assert", 3639);+_yuitest_coverline("build/test/test.js", 3640);+Y.Assert._increment();+ _yuitest_coverline("build/test/test.js", 3641);+if (!condition){+ _yuitest_coverline("build/test/test.js", 3642);+throw new Y.Assert.Error(Y.Assert._formatMessage(message, "Assertion failed."));+ }+};++/**+ * Forces an assertion error to occur. Shortcut for Y.Assert.fail().+ * @method fail+ * @param {String} message (Optional) The message to display with the failure.+ * @for YUI+ * @static+ */+_yuitest_coverline("build/test/test.js", 3653);+Y.fail = Y.Assert.fail; ++_yuitest_coverline("build/test/test.js", 3655);+Y.Test.Runner.once = Y.Test.Runner.subscribe;++_yuitest_coverline("build/test/test.js", 3657);+Y.Test.Runner.disableLogging = function() {+ _yuitest_coverfunc("build/test/test.js", "disableLogging", 3657);+_yuitest_coverline("build/test/test.js", 3658);+Y.Test.Runner._log = false;+};++_yuitest_coverline("build/test/test.js", 3661);+Y.Test.Runner.enableLogging = function() {+ _yuitest_coverfunc("build/test/test.js", "enableLogging", 3661);+_yuitest_coverline("build/test/test.js", 3662);+Y.Test.Runner._log = true;+};++_yuitest_coverline("build/test/test.js", 3665);+Y.Test.Runner._ignoreEmpty = true;+_yuitest_coverline("build/test/test.js", 3666);+Y.Test.Runner._log = true;++_yuitest_coverline("build/test/test.js", 3668);+Y.Test.Runner.on = Y.Test.Runner.attach;++//Only allow one instance of YUITest+_yuitest_coverline("build/test/test.js", 3671);+if (!YUI.YUITest) {++ _yuitest_coverline("build/test/test.js", 3673);+if (Y.config.win) {+ _yuitest_coverline("build/test/test.js", 3674);+Y.config.win.YUITest = YUITest;+ }++ _yuitest_coverline("build/test/test.js", 3677);+YUI.YUITest = Y.Test;++ + //Only setup the listeners once.+ _yuitest_coverline("build/test/test.js", 3681);+var logEvent = function(event) {+ + //data variables+ _yuitest_coverfunc("build/test/test.js", "logEvent", 3681);+_yuitest_coverline("build/test/test.js", 3684);+var message = "";+ _yuitest_coverline("build/test/test.js", 3685);+var messageType = "";+ + _yuitest_coverline("build/test/test.js", 3687);+switch(event.type){+ case this.BEGIN_EVENT:+ _yuitest_coverline("build/test/test.js", 3689);+message = "Testing began at " + (new Date()).toString() + ".";+ _yuitest_coverline("build/test/test.js", 3690);+messageType = "info";+ _yuitest_coverline("build/test/test.js", 3691);+break;+ + case this.COMPLETE_EVENT:+ _yuitest_coverline("build/test/test.js", 3694);+message = Y.Lang.sub("Testing completed at " ++ (new Date()).toString() + ".\n" ++ "Passed:{passed} Failed:{failed} " ++ "Total:{total} ({ignored} ignored)",+ event.results);+ _yuitest_coverline("build/test/test.js", 3699);+messageType = "info";+ _yuitest_coverline("build/test/test.js", 3700);+break;+ + case this.TEST_FAIL_EVENT:+ _yuitest_coverline("build/test/test.js", 3703);+message = event.testName + ": failed.\n" + event.error.getMessage();+ _yuitest_coverline("build/test/test.js", 3704);+messageType = "fail";+ _yuitest_coverline("build/test/test.js", 3705);+break;+ + case this.TEST_IGNORE_EVENT:+ _yuitest_coverline("build/test/test.js", 3708);+message = event.testName + ": ignored.";+ _yuitest_coverline("build/test/test.js", 3709);+messageType = "ignore";+ _yuitest_coverline("build/test/test.js", 3710);+break;+ + case this.TEST_PASS_EVENT:+ _yuitest_coverline("build/test/test.js", 3713);+message = event.testName + ": passed.";+ _yuitest_coverline("build/test/test.js", 3714);+messageType = "pass";+ _yuitest_coverline("build/test/test.js", 3715);+break;+ + case this.TEST_SUITE_BEGIN_EVENT:+ _yuitest_coverline("build/test/test.js", 3718);+message = "Test suite \"" + event.testSuite.name + "\" started.";+ _yuitest_coverline("build/test/test.js", 3719);+messageType = "info";+ _yuitest_coverline("build/test/test.js", 3720);+break;+ + case this.TEST_SUITE_COMPLETE_EVENT:+ _yuitest_coverline("build/test/test.js", 3723);+message = Y.Lang.sub("Test suite \"" ++ event.testSuite.name + "\" completed" + ".\n" ++ "Passed:{passed} Failed:{failed} " ++ "Total:{total} ({ignored} ignored)",+ event.results);+ _yuitest_coverline("build/test/test.js", 3728);+messageType = "info";+ _yuitest_coverline("build/test/test.js", 3729);+break;+ + case this.TEST_CASE_BEGIN_EVENT:+ _yuitest_coverline("build/test/test.js", 3732);+message = "Test case \"" + event.testCase.name + "\" started.";+ _yuitest_coverline("build/test/test.js", 3733);+messageType = "info";+ _yuitest_coverline("build/test/test.js", 3734);+break;+ + case this.TEST_CASE_COMPLETE_EVENT:+ _yuitest_coverline("build/test/test.js", 3737);+message = Y.Lang.sub("Test case \"" ++ event.testCase.name + "\" completed.\n" ++ "Passed:{passed} Failed:{failed} " ++ "Total:{total} ({ignored} ignored)",+ event.results);+ _yuitest_coverline("build/test/test.js", 3742);+messageType = "info";+ _yuitest_coverline("build/test/test.js", 3743);+break;+ default:+ _yuitest_coverline("build/test/test.js", 3745);+message = "Unexpected event " + event.type;+ _yuitest_coverline("build/test/test.js", 3746);+messageType = "info";+ }+ + _yuitest_coverline("build/test/test.js", 3749);+if (Y.Test.Runner._log) {+ _yuitest_coverline("build/test/test.js", 3750);+Y.log(message, messageType, "TestRunner");+ }+ };++ _yuitest_coverline("build/test/test.js", 3754);+var i, name;++ _yuitest_coverline("build/test/test.js", 3756);+for (i in Y.Test.Runner) {+ _yuitest_coverline("build/test/test.js", 3757);+name = Y.Test.Runner[i];+ _yuitest_coverline("build/test/test.js", 3758);+if (i.indexOf('_EVENT') > -1) {+ _yuitest_coverline("build/test/test.js", 3759);+Y.Test.Runner.subscribe(name, logEvent);+ }+ }_yuitest_coverline("build/test/test.js", 3761);+;++} //End if for YUI.YUITest+++}, '3.7.3', {"requires": ["event-simulate", "event-custom", "json-stringify"]});
bundle/test/test-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -25,7 +25,7 @@ //Make this global for back compat YUITest = { - version: "3.7.2", + version: "3.7.3", guid: function(pre) { return Y.guid(pre); } @@ -1727,12 +1727,19 @@ * format is specified, a string representing the results in that format. * @method getCoverage */- getCoverage: function(format){- if (!this._running && typeof _yuitest_coverage == "object"){- if (typeof format == "function"){- return format(_yuitest_coverage); + getCoverage: function(format) {+ var covObject = null;+ if (typeof _yuitest_coverage === "object") {+ covObject = _yuitest_coverage;+ }+ if (typeof __coverage__ === "object") {+ covObject = __coverage__;+ }+ if (!this._running && typeof covObject == "object"){+ if (typeof format == "function") {+ return format(covObject); } else {- return _yuitest_coverage;+ return covObject; } } else { return null;@@ -3742,7 +3749,7 @@ break; default: message = "Unexpected event " + event.type;- message = "info";+ messageType = "info"; } if (Y.Test.Runner._log) {@@ -3762,4 +3769,4 @@ } //End if for YUI.YUITest -}, '3.7.2', {"requires": ["event-simulate", "event-custom", "json-stringify"]});+}, '3.7.3', {"requires": ["event-simulate", "event-custom", "json-stringify"]});
bundle/test/test-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("test",function(e,t){YUI.YUITest?e.Test=YUI.YUITest:(YUITest={version:"3.7.2",guid:function(t){return e.guid(t)}},e.namespace("Test"),YUITest.Object=e.Object,YUITest.Array=e.Array,YUITest.Util={mix:e.mix,JSON:e.JSON},YUITest.EventTarget=function(){this._handlers={}},YUITest.EventTarget.prototype={constructor:YUITest.EventTarget,attach:function(e,t){typeof this._handlers[e]=="undefined"&&(this._handlers[e]=[]),this._handlers[e].push(t)},subscribe:function(e,t){this.attach.apply(this,arguments)},fire:function(e){typeof e=="string"&&(e={type:e}),e.target||(e.target=this);if(!e.type)throw new Error("Event object missing 'type' property.");if(this._handlers[e.type]instanceof Array){var t=this._handlers[e.type];for(var n=0,r=t.length;n<r;n++)t[n].call(this,e)}},detach:function(e,t){if(this._handlers[e]instanceof Array){var n=this._handlers[e];for(var r=0,i=n.length;r<i;r++)if(n[r]===t){n.splice(r,1);break}}},unsubscribe:function(e,t){this.detach.apply(this,arguments)}},YUITest.TestSuite=function(e){this.name="",this.items=[];if(typeof e=="string")this.name=e;else if(e instanceof Object)for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);if(this.name===""||!this.name)this.name=YUITest.guid("testSuite_")},YUITest.TestSuite.prototype={constructor:YUITest.TestSuite,add:function(e){return(e instanceof YUITest.TestSuite||e instanceof YUITest.TestCase)&&this.items.push(e),this},setUp:function(){},tearDown:function(){}},YUITest.TestCase=function(e){this._should={};for(var t in e)this[t]=e[t];typeof this.name!="string"&&(this.name=YUITest.guid("testCase_"))},YUITest.TestCase.prototype={constructor:YUITest.TestCase,callback:function(){return YUITest.TestRunner.callback.apply(YUITest.TestRunner,arguments)},resume:function(e){YUITest.TestRunner.resume(e)},wait:function(e,t){var n=typeof e=="number"?e:t;throw n=typeof n=="number"?n:1e4,typeof e=="function"?new YUITest.Wait(e,n):new YUITest.Wait(function(){YUITest.Assert.fail("Timeout: wait() called but resume() never called.")},n)},assert:function(e,t){YUITest.Assert._increment();if(!e)throw new YUITest.AssertionError(YUITest.Assert._formatMessage(t,"Assertion failed."))},fail:function(e){YUITest.Assert.fail(e)},init:function(){},destroy:function(){},setUp:function(){},tearDown:function(){}},YUITest.TestFormat=function(){function e(e){return e.replace(/[<>"'&]/g,function(e){switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}})}return{JSON:function(e){return YUITest.Util.JSON.stringify(e)},XML:function(t){function n(t){var r="<"+t.type+' name="'+e(t.name)+'"';typeof t.duration=="number"&&(r+=' duration="'+t.duration+'"');if(t.type=="test")r+=' result="'+t.result+'" message="'+e(t.message)+'">';else{r+=' passed="'+t.passed+'" failed="'+t.failed+'" ignored="'+t.ignored+'" total="'+t.total+'">';for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]))}return r+="</"+t.type+">",r}return'<?xml version="1.0" encoding="UTF-8"?>'+n(t)},JUnitXML:function(t){function n(t){var r="";switch(t.type){case"test":t.result!="ignore"&&(r='<testcase name="'+e(t.name)+'" time="'+t.duration/1e3+'">',t.result=="fail"&&(r+='<failure message="'+e(t.message)+'"><![CDATA['+t.message+"]]></failure>"),r+="</testcase>");break;case"testcase":r='<testsuite name="'+e(t.name)+'" tests="'+t.total+'" failures="'+t.failed+'" time="'+t.duration/1e3+'">';for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]));r+="</testsuite>";break;case"testsuite":for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]));break;case"report":r="<testsuites>";for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]));r+="</testsuites>"}return r}return'<?xml version="1.0" encoding="UTF-8"?>'+n(t)},TAP:function(e){function n(e){var r="";switch(e.type){case"test":e.result!="ignore"?(r="ok "+t++ +" - "+e.name,e.result=="fail"&&(r="not "+r+" - "+e.message),r+="\n"):r="#Ignored test "+e.name+"\n";break;case"testcase":r="#Begin testcase "+e.name+"("+e.failed+" failed of "+e.total+")\n";for(var i in e)e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"&&!(e[i]instanceof Array)&&(r+=n(e[i]));r+="#End testcase "+e.name+"\n";break;case"testsuite":r="#Begin testsuite "+e.name+"("+e.failed+" failed of "+e.total+")\n";for(var i in e)e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"&&!(e[i]instanceof Array)&&(r+=n(e[i]));r+="#End testsuite "+e.name+"\n";break;case"report":for(var i in e)e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"&&!(e[i]instanceof Array)&&(r+=n(e[i]))}return r}var t=1;return"1.."+e.total+"\n"+n(e)}}}(),YUITest.Reporter=function(e,t){this.url=e,this.format=t||YUITest.TestFormat.XML,this._fields=new Object,this._form=null,this._iframe=null},YUITest.Reporter.prototype={constructor:YUITest.Reporter,addField:function(e,t){this._fields[e]=t},clearFields:function(){this._fields=new Object},destroy:function(){this._form&&(this._form.parentNode.removeChild(this._form),this._form=null),this._iframe&&(this._iframe.parentNode.removeChild(this._iframe),this._iframe=null),this._fields=null},report:function(e){if(!this._form){this._form=document.createElement("form"),this._form.method="post",this._form.style.visibility="hidden",this._form.style.position="absolute",this._form.style.top=0,document.body.appendChild(this._form);try{this._iframe=document.createElement('<iframe name="yuiTestTarget" />')}catch(t){this._iframe=document.createElement("iframe"),this._iframe.name="yuiTestTarget"}this._iframe.src="javascript:false",this._iframe.style.visibility="hidden",this._iframe.style.position="absolute",this._iframe.style.top=0,document.body.appendChild(this._iframe),this._form.target="yuiTestTarget"}this._form.action=this.url;while(this._form.hasChildNodes())this._form.removeChild(this._form.lastChild);this._fields.results=this.format(e),this._fields.useragent=navigator.userAgent,this._fields.timestamp=(new Date).toLocaleString();for(var n in this._fields){var r=this._fields[n];if(this._fields.hasOwnProperty(n)&&typeof r!="function"){var i=document.createElement("input");i.type="hidden",i.name=n,i.value=r,this._form.appendChild(i)}}delete this._fields.results,delete this._fields.useragent,delete this._fields.timestamp,arguments[1]!==!1&&this._form.submit()}},YUITest.TestRunner=function(){function e(e,t){if(!t.length)return!0;if(e)for(var n=0,r=e.length;n<r;n++)if(t.indexOf(","+e[n]+",")>-1)return!0;return!1}function t(e){this.testObject=e,this.firstChild=null,this.lastChild=null,this.parent=null,this.next=null,this.results=new YUITest.Results,e instanceof YUITest.TestSuite?(this.results.type="testsuite",this.results.name=e.name):e instanceof YUITest.TestCase&&(this.results.type="testcase",this.results.name=e.name)}function n(){YUITest.EventTarget.call(this),this.masterSuite=new YUITest.TestSuite(YUITest.guid("testSuite_")),this._cur=null,this._root=null,this._log=!0,this._waiting=!1,this._running=!1,this._lastResults=null,this._context=null,this._groups=""}return t.prototype={appendChild:function(e){var n=new t(e);return this.firstChild===null?this.firstChild=this.lastChild=n:(this.lastChild.next=n,this.lastChild=n),n.parent=this,n}},n.prototype=YUITest.Util.mix(new YUITest.EventTarget,{_ignoreEmpty:!1,constructor:YUITest.TestRunner,TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",ERROR_EVENT:"error",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(e,t){var n=e.appendChild(t),r,i;for(r in t)(r.indexOf("test")===0||r.indexOf(" ")>-1)&&typeof t[r]=="function"&&n.appendChild(r)},_addTestSuiteToTestTree:function(e,t){var n=e.appendChild(t);for(var r=0;r<t.items.length;r++)t.items[r]instanceof YUITest.TestSuite?this._addTestSuiteToTestTree(n,t.items[r]):t.items[r]instanceof YUITest.TestCase&&this._addTestCaseToTestTree(n,t.items[r])},_buildTestTree:function(){this._root=new t(this.masterSuite);for(var e=0;e<this.masterSuite.items.length;e++)this.masterSuite.items[e]instanceof YUITest.TestSuite?this._addTestSuiteToTestTree(this._root,this.masterSuite.items[e]):this.masterSuite.items[e]instanceof YUITest.TestCase&&this._addTestCaseToTestTree(this._root,this.masterSuite.items[e])},_handleTestObjectComplete:function(e){var t;e&&typeof e.testObject=="object"&&(t=e.parent,t&&(t.results.include(e.results),t.results[e.testObject.name]=e.results),e.testObject instanceof YUITest.TestSuite?(this._execNonTestMethod(e,"tearDown",!1),e.results.duration=new Date-e._start,this.fire({type:this.TEST_SUITE_COMPLETE_EVENT,testSuite:e.testObject,results:e.results})):e.testObject instanceof YUITest.TestCase&&(this._execNonTestMethod(e,"destroy",!1),e.results.duration=new Date-e._start,this.fire({type:this.TEST_CASE_COMPLETE_EVENT,testCase:e.testObject,results:e.results})))},_next:function(){if(this._cur===null)this._cur=this._root;else if(this._cur.firstChild)this._cur=this._cur.firstChild;else if(this._cur.next)this._cur=this._cur.next;else{while(this._cur&&!this._cur.next&&this._cur!==this._root)this._handleTestObjectComplete(this._cur),this._cur=this._cur.parent;this._handleTestObjectComplete(this._cur),this._cur==this._root?(this._cur.results.type="report",this._cur.results.timestamp=(new Date).toLocaleString(),this._cur.results.duration=new Date-this._cur._start,this._lastResults=this._cur.results,this._running=!1,this.fire({type:this.COMPLETE_EVENT,results:this._lastResults}),this._cur=null):this._cur&&(this._cur=this._cur.next)}return this._cur},_execNonTestMethod:function(e,t,n){var r=e.testObject,i={type:this.ERROR_EVENT};try{if(n&&r["async:"+t])return r["async:"+t](this._context),!0;r[t](this._context)}catch(s){e.results.errors++,i.error=s,i.methodName=t,r instanceof YUITest.TestCase?i.testCase=r:i.testSuite=testSuite,this.fire(i)}return!1},_run:function(){var e=!1,t=this._next();if(t!==null){this._running=!0,this._lastResult=null;var n=t.testObject;if(typeof n=="object"&&n!==null){if(n instanceof YUITest.TestSuite)this.fire({type:this.TEST_SUITE_BEGIN_EVENT,testSuite:n}),t._start=new Date,this._execNonTestMethod(t,"setUp",!1);else if(n instanceof YUITest.TestCase){this.fire({type:this.TEST_CASE_BEGIN_EVENT,testCase:n}),t._start=new Date;if(this._execNonTestMethod(t,"init",!0))return}typeof setTimeout!="undefined"?setTimeout(function(){YUITest.TestRunner._run()},0):this._run()}else this._runTest(t)}},_resumeTest:function(e){var t=this._cur;this._waiting=!1;if(!t)return;var n=t.testObject,r=t.parent.testObject;r.__yui_wait&&(clearTimeout(r.__yui_wait),delete r.__yui_wait);var i=n.indexOf("fail:")===0||(r._should.fail||{})[n],s=(r._should.error||{})[n],o=!1,u=null;try{e.call(r,this._context);if(YUITest.Assert._getCount()==0&&!this._ignoreEmpty)throw new YUITest.AssertionError("Test has no asserts.");i?(u=new YUITest.ShouldFail,o=!0):s&&(u=new YUITest.ShouldError,o=!0)}catch(a){r.__yui_wait&&(clearTimeout(r.__yui_wait),delete r.__yui_wait);if(a instanceof YUITest.AssertionError)i||(u=a,o=!0);else{if(a instanceof YUITest.Wait){if(typeof a.segment=="function"&&typeof a.delay=="number"){if(typeof setTimeout=="undefined")throw new Error("Asynchronous tests not supported in this environment.");r.__yui_wait=setTimeout(function(){YUITest.TestRunner._resumeTest(a.segment)},a.delay),this._waiting=!0}return}s?typeof s=="string"?a.message!=s&&(u=new YUITest.UnexpectedError(a),o=!0):typeof s=="function"?a instanceof s||(u=new YUITest.UnexpectedError(a),o=!0):typeof s=="object"&&s!==null&&(!(a instanceof s.constructor)||a.message!=s.message)&&(u=new YUITest.UnexpectedError(a),o=!0):(u=new YUITest.UnexpectedError(a),o=!0)}}o?this.fire({type:this.TEST_FAIL_EVENT,testCase:r,testName:n,error:u}):this.fire({type:this.TEST_PASS_EVENT,testCase:r,testName:n}),this._execNonTestMethod(t.parent,"tearDown",!1),YUITest.Assert._reset();var f=new Date-t._start;t.parent.results[n]={result:o?"fail":"pass",message:u?u.getMessage():"Test passed",type:"test",name:n,duration:f},o?t.parent.results.failed++:t.parent.results.passed++,t.parent.results.total++,typeof setTimeout!="undefined"?setTimeout(function(){YUITest.TestRunner._run()},0):this._run()},_handleError:function(e){if(!this._waiting)throw e;this._resumeTest(function(){throw e})},_runTest:function(t){var n=t.testObject,r=t.parent.testObject,i=r[n],s=n.indexOf("ignore:")===0||!e(r.groups,this._groups)||(r._should.ignore||{})[n];s?(t.parent.results[n]={result:"ignore",message:"Test ignored",type:"test",name:n.indexOf("ignore:")===0?n.substring(7):n},t.parent.results.ignored++,t.parent.results.total++,this.fire({type:this.TEST_IGNORE_EVENT,testCase:r,testName:n}),typeof setTimeout!="undefined"?setTimeout(function(){YUITest.TestRunner._run()},0):this._run()):(t._start=new Date,this._execNonTestMethod(t.parent,"setUp",!1),this._resumeTest(i))},getName:function(){return this.masterSuite.name},setName:function(e){this.masterSuite.name=e},add:function(e){return this.masterSuite.add(e),this},clear:function(){this.masterSuite=new YUITest.TestSuite(YUITest.guid("testSuite_"))},isWaiting:function(){return this._waiting},isRunning:function(){return this._running},getResults:function(e){return!this._running&&this._lastResults?typeof e=="function"?e(this._lastResults):this._lastResults:null},getCoverage:function(e){return!this._running&&typeof _yuitest_coverage=="object"?typeof e=="function"?e(_yuitest_coverage):_yuitest_coverage:null},callback:function(){var e=arguments,t=this._context,n=this;return function(){for(var r=0;r<arguments.length;r++)t[e[r]]=arguments[r];n._run()}},resume:function(e){if(!this._waiting)throw new Error("resume() called without wait().");this._resumeTest(e||function(){})},run:function(e){e=e||{};var t=YUITest.TestRunner,n=e.oldMode;!n&&this.masterSuite.items.length==1&&this.masterSuite.items[0]instanceof YUITest.TestSuite&&(this.masterSuite=this.masterSuite.items[0]),t._groups=e.groups instanceof Array?","+e.groups.join(",")+",":"",t._buildTestTree(),t._context={},t._root._start=new Date,t.fire(t.BEGIN_EVENT),t._run()}}),new n}(),YUITest.ArrayAssert={_indexOf:function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},_some:function(e,t){if(e.some)return e.some(t);for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1},contains:function(e,t,n){YUITest.Assert._increment(),this._indexOf(t,e)==-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value "+e+" ("+typeof e+") not found in array ["+t+"]."))},containsItems:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)this._indexOf(t,e[r])==-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value "+e[r]+" ("+typeof e[r]+") not found in array ["+t+"]."))},containsMatch:function(e,t,n){YUITest.Assert._increment();if(typeof e!="function")throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");this._some(t,e)||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"No match found in array ["+t+"]."))},doesNotContain:function(e,t,n){YUITest.Assert._increment(),this._indexOf(t,e)>-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value found in array ["+t+"]."))},doesNotContainItems:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)this._indexOf(t,e[r])>-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value found in array ["+t+"]."))},doesNotContainMatch:function(e,t,n){YUITest.Assert._increment();if(typeof e!="function")throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");this._some(t,e)&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value found in array ["+t+"]."))},indexOf:function(e,t,n,r){YUITest.Assert._increment();for(var i=0;i<t.length;i++)if(t[i]===e){n!=i&&YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value exists at index "+i+" but should be at index "+n+"."));return}YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value doesn't exist in array ["+t+"]."))},itemsAreEqual:function(e,t,n){YUITest.Assert._increment(),(typeof e!="object"||typeof t!="object")&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value should be an array.")),e.length!=t.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Array should have a length of "+e.length+" but has a length of "+t.length+"."));for(var r=0;r<e.length;r++)if(e[r]!=t[r])throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values in position "+r+" are not equal."),e[r],t[r])},itemsAreEquivalent:function(e,t,n,r){YUITest.Assert._increment();if(typeof n!="function")throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");e.length!=t.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Array should have a length of "+e.length+" but has a length of "+t.length));for(var i=0;i<e.length;i++)if(!n(e[i],t[i]))throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(r,"Values in position "+i+" are not equivalent."),e[i],t[i])},isEmpty:function(e,t){YUITest.Assert._increment(),e.length>0&&YUITest.Assert.fail(YUITest.Assert._formatMessage(t,"Array should be empty."))},isNotEmpty:function(e,t){YUITest.Assert._increment(),e.length===0&&YUITest.Assert.fail(YUITest.Assert._formatMessage(t,"Array should not be empty."))},itemsAreSame:function(e,t,n){YUITest.Assert._increment(),e.length!=t.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Array should have a length of "+e.length+" but has a length of "+t.length));for(var r=0;r<e.length;r++)if(e[r]!==t[r])throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values in position "+r+" are not the same."),e[r],t[r])},lastIndexOf:function(e,t,n,r){for(var i=t.length;i>=0;i--)if(t[i]===e){n!=i&&YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value exists at index "+i+" but should be at index "+n+"."));return}YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value doesn't exist in array."))}},YUITest.Assert={_asserts:0,_formatMessage:function(e,t){return typeof e=="string"&&e.length>0?e.replace("{message}",t):t},_getCount:function(){return this._asserts},_increment:function(){this._asserts++},_reset:function(){this._asserts=0},fail:function(e){throw new YUITest.AssertionError(YUITest.Assert._formatMessage(e,"Test force-failed."))},pass:function(e){YUITest.Assert._increment()},areEqual:function(e,t,n){YUITest.Assert._increment();if(e!=t)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values should be equal."),e,t)},areNotEqual:function(e,t,n){YUITest.Assert._increment();if(e==t)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(n,"Values should not be equal."),e)},areNotSame:function(e,t,n){YUITest.Assert._increment();if(e===t)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(n,"Values should not be the same."),e)},areSame:function(e,t,n){YUITest.Assert._increment();if(e!==t)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values should be the same."),e,t)},isFalse:function(e,t){YUITest.Assert._increment();if(!1!==e)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be false."),!1,e)},isTrue:function(e,t){YUITest.Assert._increment();if(!0!==e)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be true."),!0,e)},isNaN:function(e,t){YUITest.Assert._increment();if(!isNaN(e))throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be NaN."),NaN,e)},isNotNaN:function(e,t){YUITest.Assert._increment();if(isNaN(e))throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Values should not be NaN."),NaN)},isNotNull:function(e,t){YUITest.Assert._increment();if(e===null)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Values should not be null."),null)},isNotUndefined:function(e,t){YUITest.Assert._increment();if(typeof e=="undefined")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should not be undefined."),undefined)},isNull:function(e,t){YUITest.Assert._increment();if(e!==null)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be null."),null,e)},isUndefined:function(e,t){YUITest.Assert._increment();if(typeof e!="undefined")throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be undefined."),undefined,e)},isArray:function(e,t){YUITest.Assert._increment();var n=!1;Array.isArray?n=!Array.isArray(e):n=Object.prototype.toString.call(e)!="[object Array]";if(n)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be an array."),e)},isBoolean:function(e,t){YUITest.Assert._increment();if(typeof e!="boolean")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a Boolean."),e)},isFunction:function(e,t){YUITest.Assert._increment();if(!(e instanceof Function))throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a function."),e)},isInstanceOf:function(e,t,n){YUITest.Assert._increment();if(!(t instanceof e))throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Value isn't an instance of expected type."),e,t)},isNumber:function(e,t){YUITest.Assert._increment();if(typeof e!="number")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a number."),e)},isObject:function(e,t){YUITest.Assert._increment();if(!e||typeof e!="object"&&typeof e!="function")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be an object."),e)},isString:function(e,t){YUITest.Assert._increment();if(typeof e!="string")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a string."),e)},isTypeOf:function(e,t,n){YUITest.Assert._increment();if(typeof t!=e)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Value should be of type "+e+"."),e,typeof t)},throwsError:function(e,t,n){YUITest.Assert._increment();var r=!1;try{t()}catch(i){if(typeof e=="string")i.message!=e&&(r=!0);else if(typeof e=="function")i instanceof e||(r=!0);else if(typeof e=="object"&&e!==null){if(!(i instanceof e.constructor)||i.message!=e.message)r=!0}else r=!0;if(r)throw new YUITest.UnexpectedError(i);return}throw new YUITest.AssertionError(YUITest.Assert._formatMessage(n,"Error should have been thrown."))}},YUITest.AssertionError=function(e){this.message=e,this.name="Assert Error"},YUITest.AssertionError.prototype={constructor:YUITest.AssertionError,getMessage:function(){return this.message},toString:function(){return this.name+": "+this.getMessage()}},YUITest.ComparisonFailure=function(e,t,n){YUITest.AssertionError.call(this,e),this.expected=t,this.actual=n,this.name="ComparisonFailure"},YUITest.ComparisonFailure.prototype=new YUITest.AssertionError,YUITest.ComparisonFailure.prototype.constructor=YUITest.ComparisonFailure,YUITest.ComparisonFailure.prototype.getMessage=function(){return this.message+"\nExpected: "+this.expected+" ("+typeof this.expected+")"+"\nActual: "+this.actual+" ("+typeof this.actual+")"},YUITest.CoverageFormat={JSON:function(e){return YUITest.Util.JSON.stringify(e)},XdebugJSON:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n].lines);return YUITest.Util.JSON.stringify(e)}},YUITest.DateAssert={datesAreEqual:function(e,t,n){YUITest.Assert._increment();if(!(e instanceof Date&&t instanceof Date))throw new TypeError("YUITest.DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");var r="";e.getFullYear()!=t.getFullYear()&&(r="Years should be equal."),e.getMonth()!=t.getMonth()&&(r="Months should be equal."),e.getDate()!=t.getDate()&&(r="Days of month should be equal.");if(r.length)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,r),e,t)},timesAreEqual:function(e,t,n){YUITest.Assert._increment();if(!(e instanceof Date&&t instanceof Date))throw new TypeError("YUITest.DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");var r="";e.getHours()!=t.getHours()&&(r="Hours should be equal."),e.getMinutes()!=t.getMinutes()&&(r="Minutes should be equal."),e.getSeconds()!=t.getSeconds()&&(r="Seconds should be equal.");if(r.length)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,r),e,t)}},YUITest.Mock=function(e){e=e||{};var t,n;try{function r(){}r.prototype=e,t=new r}catch(i){t={}}for(n in e)e.hasOwnProperty(n)&&typeof e[n]=="function"&&(t[n]=function(e){return function(){YUITest.Assert.fail("Method "+e+"() was called but was not expected to be.")}}(n));return t},YUITest.Mock.expect=function(e,t){e.__expectations||(e.__expectations={});if(t.method){var n=t.method,r=t.args||[],i=t.returns,s=typeof t.callCount=="number"?t.callCount:1,o=t.error,u=t.run||function(){},a,f;e.__expectations[n]=t,t.callCount=s,t.actualCallCount=0;for(f=0;f<r.length;f++)r[f]instanceof YUITest.Mock.Value||(r[f]=YUITest.Mock.Value(YUITest.Assert.areSame,[r[f]],"Argument "+f+" of "+n+"() is incorrect."));s>0?e[n]=function(){try{t.actualCallCount++,YUITest.Assert.areEqual(r.length,arguments.length,"Method "+n+"() passed incorrect number of arguments.");for(var e=0,s=r.length;e<s;e++)r[e].verify(arguments[e]);a=u.apply(this,arguments);if(o)throw o}catch(f){YUITest.TestRunner._handleError(f)}return t.hasOwnProperty("returns")?i:a}:e[n]=function(){try{YUITest.Assert.fail("Method "+n+"() should not have been called.")}catch(e){YUITest.TestRunner._handleError(e)}}}else t.property&&(e.__expectations[t.property]=t)},YUITest.Mock.verify=function(e){try{for(var t in e.__expectations)if(e.__expectations.hasOwnProperty(t)){var n=e.__expectations[t];n.method?YUITest.Assert.areEqual(n.callCount,n.actualCallCount,"Method "+n.method+"() wasn't called the expected number of times."):n.property&&YUITest.Assert.areEqual(n.value,e[n.property],"Property "+n.property+" wasn't set to the correct value.")}}catch(r){YUITest.TestRunner._handleError(r)}},YUITest.Mock.Value=function(e,t,n){if(!(this instanceof YUITest.Mock.Value))return new YUITest.Mock.Value(e,t,n);this.verify=function(r){var i=[].concat(t||[]);i.push(r),i.push(n),e.apply(null,i)}},YUITest.Mock.Value.Any=YUITest.Mock.Value(function(){}),YUITest.Mock.Value.Boolean=YUITest.Mock.Value(YUITest.Assert.isBoolean),YUITest.Mock.Value.Number=YUITest.Mock.Value(YUITest.Assert.isNumber),YUITest.Mock.Value.String=YUITest.Mock.Value(YUITest.Assert.isString),YUITest.Mock.Value.Object=YUITest.Mock.Value(YUITest.Assert.isObject),YUITest.Mock.Value.Function=YUITest.Mock.Value(YUITest.Assert.isFunction),YUITest.ObjectAssert={areEqual:function(e,t,n){YUITest.Assert._increment();var r=YUITest.Object.keys(e),i=YUITest.Object.keys(t);r.length!=i.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Object should have "+r.length+" keys but has "+i.length));for(var s in e)if(e.hasOwnProperty(s)&&e[s]!=t[s])throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values should be equal for property "+s),e[s],t[s])},hasKey:function(e,t,n){YUITest.ObjectAssert.ownsOrInheritsKey(e,t,n)},hasKeys:function(e,t,n){YUITest.ObjectAssert.ownsOrInheritsKeys(e,t,n)},inheritsKey:function(e,t,n){YUITest.Assert._increment(),e in t&&!t.hasOwnProperty(e)||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e+"' not found on object instance."))},inheritsKeys:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)propertyName in t&&!t.hasOwnProperty(e[r])||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e[r]+"' not found on object instance."))},ownsKey:function(e,t,n){YUITest.Assert._increment(),t.hasOwnProperty(e)||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e+"' not found on object instance."))},ownsKeys:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)t.hasOwnProperty(e[r])||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e[r]+"' not found on object instance."))},ownsNoKeys:function(e,t){YUITest.Assert._increment();var n=0,r;for(r in e)e.hasOwnProperty(r)&&n++;n!==0&&YUITest.Assert.fail(YUITest.Assert._formatMessage(t,"Object owns "+n+" properties but should own none."))},ownsOrInheritsKey:function(e,t,n){YUITest.Assert._increment(),e in t||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e+"' not found on object."))},ownsOrInheritsKeys:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)e[r]in t||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e[r]+"' not found on object."))}},YUITest.Results=function(e){this.name=e,this.passed=0,this.failed=0,this.errors=0,this.ignored=0,this.total=0,this.duration=0},YUITest.Results.prototype.include=function(e){this.passed+=e.passed,this.failed+=e.failed,this.ignored+=e.ignored,this.total+=e.total,this.errors+=e.errors},YUITest.ShouldError=function(e){YUITest.AssertionError.call(this,e||"This test should have thrown an error but didn't."),this.name="ShouldError"},YUITest.ShouldError.prototype=new YUITest.AssertionError,YUITest.ShouldError.prototype.constructor=YUITest.ShouldError,YUITest.ShouldFail=function(e){YUITest.AssertionError.call(this,e||"This test should fail but didn't."),this.name="ShouldFail"},YUITest.ShouldFail.prototype=new YUITest.AssertionError,YUITest.ShouldFail.prototype.constructor=YUITest.ShouldFail,YUITest.UnexpectedError=function(e){YUITest.AssertionError.call(this,"Unexpected error: "+e.message),this.cause=e,this.name="UnexpectedError",this.stack=e.stack},YUITest.UnexpectedError.prototype=new YUITest.AssertionError,YUITest.UnexpectedError.prototype.constructor=YUITest.UnexpectedError,YUITest.UnexpectedValue=function(e,t){YUITest.AssertionError.call(this,e),this.unexpected=t,this.name="UnexpectedValue"},YUITest.UnexpectedValue.prototype=new YUITest.AssertionError,YUITest.UnexpectedValue.prototype.constructor=YUITest.UnexpectedValue,YUITest.UnexpectedValue.prototype.getMessage=function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+typeof this.unexpected+") "},YUITest.Wait=function(e,t){this.segment=typeof e=="function"?e:null,this.delay=typeof t=="number"?t:0},e.Test=YUITest,e.Object.each(YUITest,function(t,n){var n=n.replace("Test","");e.Test[n]=t})),e.Assert=YUITest.Assert,e.Assert.Error=e.Test.AssertionError,e.Assert.ComparisonFailure=e.Test.ComparisonFailure,e.Assert.UnexpectedValue=e.Test.UnexpectedValue,e.Mock=e.Test.Mock,e.ObjectAssert=e.Test.ObjectAssert,e.ArrayAssert=e.Test.ArrayAssert,e.DateAssert=e.Test.DateAssert,e.Test.ResultsFormat=e.Test.TestFormat;var n=e.Test.ArrayAssert.itemsAreEqual;e.Test.ArrayAssert.itemsAreEqual=function(t,r,i){return n.call(this,e.Array(t),e.Array(r),i)},e.assert=function(t,n){e.Assert._increment();if(!t)throw new e.Assert.Error(e.Assert._formatMessage(n,"Assertion failed."))},e.fail=e.Assert.fail,e.Test.Runner.once=e.Test.Runner.subscribe,e.Test.Runner.disableLogging=function(){e.Test.Runner._log=!1},e.Test.Runner.enableLogging=function(){e.Test.Runner._log=!0},e.Test.Runner._ignoreEmpty=!0,e.Test.Runner._log=!0,e.Test.Runner.on=e.Test.Runner.attach;if(!YUI.YUITest){e.config.win&&(e.config.win.YUITest=YUITest),YUI.YUITest=e.Test;var r=function(t){var n="",r="";switch(t.type){case this.BEGIN_EVENT:n="Testing began at "+(new Date).toString()+".",r="info";break;case this.COMPLETE_EVENT:n=e.Lang.sub("Testing completed at "+(new Date).toString()+".\n"+"Passed:{passed} Failed:{failed} "+"Total:{total} ({ignored} ignored)",t.results),r="info";break;case this.TEST_FAIL_EVENT:n=t.testName+": failed.\n"+t.error.getMessage(),r="fail";break;case this.TEST_IGNORE_EVENT:n=t.testName+": ignored.",r="ignore";break;case this.TEST_PASS_EVENT:n=t.testName+": passed.",r="pass";break;case this.TEST_SUITE_BEGIN_EVENT:n='Test suite "'+t.testSuite.name+'" started.',r="info";break;case this.TEST_SUITE_COMPLETE_EVENT:n=e.Lang.sub('Test suite "'+t.testSuite.name+'" completed'+".\n"+"Passed:{passed} Failed:{failed} "+"Total:{total} ({ignored} ignored)",t.results),r="info";break;case this.TEST_CASE_BEGIN_EVENT:n='Test case "'+t.testCase.name+'" started.',r="info";break;case this.TEST_CASE_COMPLETE_EVENT:n=e.Lang.sub('Test case "'+t.testCase.name+'" completed.\n'+"Passed:{passed} Failed:{failed} "+"Total:{total} ({ignored} ignored)",t.results),r="info";break;default:n="Unexpected event "+t.type,n="info"}e.Test.Runner._log&&e.log(n,r,"TestRunner")},i,s;for(i in e.Test.Runner)s=e.Test.Runner[i],i.indexOf("_EVENT")>-1&&e.Test.Runner.subscribe(s,r)}},"3.7.2",{requires:["event-simulate","event-custom","json-stringify"]});+YUI.add("test",function(e,t){YUI.YUITest?e.Test=YUI.YUITest:(YUITest={version:"3.7.3",guid:function(t){return e.guid(t)}},e.namespace("Test"),YUITest.Object=e.Object,YUITest.Array=e.Array,YUITest.Util={mix:e.mix,JSON:e.JSON},YUITest.EventTarget=function(){this._handlers={}},YUITest.EventTarget.prototype={constructor:YUITest.EventTarget,attach:function(e,t){typeof this._handlers[e]=="undefined"&&(this._handlers[e]=[]),this._handlers[e].push(t)},subscribe:function(e,t){this.attach.apply(this,arguments)},fire:function(e){typeof e=="string"&&(e={type:e}),e.target||(e.target=this);if(!e.type)throw new Error("Event object missing 'type' property.");if(this._handlers[e.type]instanceof Array){var t=this._handlers[e.type];for(var n=0,r=t.length;n<r;n++)t[n].call(this,e)}},detach:function(e,t){if(this._handlers[e]instanceof Array){var n=this._handlers[e];for(var r=0,i=n.length;r<i;r++)if(n[r]===t){n.splice(r,1);break}}},unsubscribe:function(e,t){this.detach.apply(this,arguments)}},YUITest.TestSuite=function(e){this.name="",this.items=[];if(typeof e=="string")this.name=e;else if(e instanceof Object)for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);if(this.name===""||!this.name)this.name=YUITest.guid("testSuite_")},YUITest.TestSuite.prototype={constructor:YUITest.TestSuite,add:function(e){return(e instanceof YUITest.TestSuite||e instanceof YUITest.TestCase)&&this.items.push(e),this},setUp:function(){},tearDown:function(){}},YUITest.TestCase=function(e){this._should={};for(var t in e)this[t]=e[t];typeof this.name!="string"&&(this.name=YUITest.guid("testCase_"))},YUITest.TestCase.prototype={constructor:YUITest.TestCase,callback:function(){return YUITest.TestRunner.callback.apply(YUITest.TestRunner,arguments)},resume:function(e){YUITest.TestRunner.resume(e)},wait:function(e,t){var n=typeof e=="number"?e:t;throw n=typeof n=="number"?n:1e4,typeof e=="function"?new YUITest.Wait(e,n):new YUITest.Wait(function(){YUITest.Assert.fail("Timeout: wait() called but resume() never called.")},n)},assert:function(e,t){YUITest.Assert._increment();if(!e)throw new YUITest.AssertionError(YUITest.Assert._formatMessage(t,"Assertion failed."))},fail:function(e){YUITest.Assert.fail(e)},init:function(){},destroy:function(){},setUp:function(){},tearDown:function(){}},YUITest.TestFormat=function(){function e(e){return e.replace(/[<>"'&]/g,function(e){switch(e){case"<":return"<";case">":return">";case'"':return""";case"'":return"'";case"&":return"&"}})}return{JSON:function(e){return YUITest.Util.JSON.stringify(e)},XML:function(t){function n(t){var r="<"+t.type+' name="'+e(t.name)+'"';typeof t.duration=="number"&&(r+=' duration="'+t.duration+'"');if(t.type=="test")r+=' result="'+t.result+'" message="'+e(t.message)+'">';else{r+=' passed="'+t.passed+'" failed="'+t.failed+'" ignored="'+t.ignored+'" total="'+t.total+'">';for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]))}return r+="</"+t.type+">",r}return'<?xml version="1.0" encoding="UTF-8"?>'+n(t)},JUnitXML:function(t){function n(t){var r="";switch(t.type){case"test":t.result!="ignore"&&(r='<testcase name="'+e(t.name)+'" time="'+t.duration/1e3+'">',t.result=="fail"&&(r+='<failure message="'+e(t.message)+'"><![CDATA['+t.message+"]]></failure>"),r+="</testcase>");break;case"testcase":r='<testsuite name="'+e(t.name)+'" tests="'+t.total+'" failures="'+t.failed+'" time="'+t.duration/1e3+'">';for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]));r+="</testsuite>";break;case"testsuite":for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]));break;case"report":r="<testsuites>";for(var i in t)t.hasOwnProperty(i)&&t[i]&&typeof t[i]=="object"&&!(t[i]instanceof Array)&&(r+=n(t[i]));r+="</testsuites>"}return r}return'<?xml version="1.0" encoding="UTF-8"?>'+n(t)},TAP:function(e){function n(e){var r="";switch(e.type){case"test":e.result!="ignore"?(r="ok "+t++ +" - "+e.name,e.result=="fail"&&(r="not "+r+" - "+e.message),r+="\n"):r="#Ignored test "+e.name+"\n";break;case"testcase":r="#Begin testcase "+e.name+"("+e.failed+" failed of "+e.total+")\n";for(var i in e)e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"&&!(e[i]instanceof Array)&&(r+=n(e[i]));r+="#End testcase "+e.name+"\n";break;case"testsuite":r="#Begin testsuite "+e.name+"("+e.failed+" failed of "+e.total+")\n";for(var i in e)e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"&&!(e[i]instanceof Array)&&(r+=n(e[i]));r+="#End testsuite "+e.name+"\n";break;case"report":for(var i in e)e.hasOwnProperty(i)&&e[i]&&typeof e[i]=="object"&&!(e[i]instanceof Array)&&(r+=n(e[i]))}return r}var t=1;return"1.."+e.total+"\n"+n(e)}}}(),YUITest.Reporter=function(e,t){this.url=e,this.format=t||YUITest.TestFormat.XML,this._fields=new Object,this._form=null,this._iframe=null},YUITest.Reporter.prototype={constructor:YUITest.Reporter,addField:function(e,t){this._fields[e]=t},clearFields:function(){this._fields=new Object},destroy:function(){this._form&&(this._form.parentNode.removeChild(this._form),this._form=null),this._iframe&&(this._iframe.parentNode.removeChild(this._iframe),this._iframe=null),this._fields=null},report:function(e){if(!this._form){this._form=document.createElement("form"),this._form.method="post",this._form.style.visibility="hidden",this._form.style.position="absolute",this._form.style.top=0,document.body.appendChild(this._form);try{this._iframe=document.createElement('<iframe name="yuiTestTarget" />')}catch(t){this._iframe=document.createElement("iframe"),this._iframe.name="yuiTestTarget"}this._iframe.src="javascript:false",this._iframe.style.visibility="hidden",this._iframe.style.position="absolute",this._iframe.style.top=0,document.body.appendChild(this._iframe),this._form.target="yuiTestTarget"}this._form.action=this.url;while(this._form.hasChildNodes())this._form.removeChild(this._form.lastChild);this._fields.results=this.format(e),this._fields.useragent=navigator.userAgent,this._fields.timestamp=(new Date).toLocaleString();for(var n in this._fields){var r=this._fields[n];if(this._fields.hasOwnProperty(n)&&typeof r!="function"){var i=document.createElement("input");i.type="hidden",i.name=n,i.value=r,this._form.appendChild(i)}}delete this._fields.results,delete this._fields.useragent,delete this._fields.timestamp,arguments[1]!==!1&&this._form.submit()}},YUITest.TestRunner=function(){function e(e,t){if(!t.length)return!0;if(e)for(var n=0,r=e.length;n<r;n++)if(t.indexOf(","+e[n]+",")>-1)return!0;return!1}function t(e){this.testObject=e,this.firstChild=null,this.lastChild=null,this.parent=null,this.next=null,this.results=new YUITest.Results,e instanceof YUITest.TestSuite?(this.results.type="testsuite",this.results.name=e.name):e instanceof YUITest.TestCase&&(this.results.type="testcase",this.results.name=e.name)}function n(){YUITest.EventTarget.call(this),this.masterSuite=new YUITest.TestSuite(YUITest.guid("testSuite_")),this._cur=null,this._root=null,this._log=!0,this._waiting=!1,this._running=!1,this._lastResults=null,this._context=null,this._groups=""}return t.prototype={appendChild:function(e){var n=new t(e);return this.firstChild===null?this.firstChild=this.lastChild=n:(this.lastChild.next=n,this.lastChild=n),n.parent=this,n}},n.prototype=YUITest.Util.mix(new YUITest.EventTarget,{_ignoreEmpty:!1,constructor:YUITest.TestRunner,TEST_CASE_BEGIN_EVENT:"testcasebegin",TEST_CASE_COMPLETE_EVENT:"testcasecomplete",TEST_SUITE_BEGIN_EVENT:"testsuitebegin",TEST_SUITE_COMPLETE_EVENT:"testsuitecomplete",TEST_PASS_EVENT:"pass",TEST_FAIL_EVENT:"fail",ERROR_EVENT:"error",TEST_IGNORE_EVENT:"ignore",COMPLETE_EVENT:"complete",BEGIN_EVENT:"begin",_addTestCaseToTestTree:function(e,t){var n=e.appendChild(t),r,i;for(r in t)(r.indexOf("test")===0||r.indexOf(" ")>-1)&&typeof t[r]=="function"&&n.appendChild(r)},_addTestSuiteToTestTree:function(e,t){var n=e.appendChild(t);for(var r=0;r<t.items.length;r++)t.items[r]instanceof YUITest.TestSuite?this._addTestSuiteToTestTree(n,t.items[r]):t.items[r]instanceof YUITest.TestCase&&this._addTestCaseToTestTree(n,t.items[r])},_buildTestTree:function(){this._root=new t(this.masterSuite);for(var e=0;e<this.masterSuite.items.length;e++)this.masterSuite.items[e]instanceof YUITest.TestSuite?this._addTestSuiteToTestTree(this._root,this.masterSuite.items[e]):this.masterSuite.items[e]instanceof YUITest.TestCase&&this._addTestCaseToTestTree(this._root,this.masterSuite.items[e])},_handleTestObjectComplete:function(e){var t;e&&typeof e.testObject=="object"&&(t=e.parent,t&&(t.results.include(e.results),t.results[e.testObject.name]=e.results),e.testObject instanceof YUITest.TestSuite?(this._execNonTestMethod(e,"tearDown",!1),e.results.duration=new Date-e._start,this.fire({type:this.TEST_SUITE_COMPLETE_EVENT,testSuite:e.testObject,results:e.results})):e.testObject instanceof YUITest.TestCase&&(this._execNonTestMethod(e,"destroy",!1),e.results.duration=new Date-e._start,this.fire({type:this.TEST_CASE_COMPLETE_EVENT,testCase:e.testObject,results:e.results})))},_next:function(){if(this._cur===null)this._cur=this._root;else if(this._cur.firstChild)this._cur=this._cur.firstChild;else if(this._cur.next)this._cur=this._cur.next;else{while(this._cur&&!this._cur.next&&this._cur!==this._root)this._handleTestObjectComplete(this._cur),this._cur=this._cur.parent;this._handleTestObjectComplete(this._cur),this._cur==this._root?(this._cur.results.type="report",this._cur.results.timestamp=(new Date).toLocaleString(),this._cur.results.duration=new Date-this._cur._start,this._lastResults=this._cur.results,this._running=!1,this.fire({type:this.COMPLETE_EVENT,results:this._lastResults}),this._cur=null):this._cur&&(this._cur=this._cur.next)}return this._cur},_execNonTestMethod:function(e,t,n){var r=e.testObject,i={type:this.ERROR_EVENT};try{if(n&&r["async:"+t])return r["async:"+t](this._context),!0;r[t](this._context)}catch(s){e.results.errors++,i.error=s,i.methodName=t,r instanceof YUITest.TestCase?i.testCase=r:i.testSuite=testSuite,this.fire(i)}return!1},_run:function(){var e=!1,t=this._next();if(t!==null){this._running=!0,this._lastResult=null;var n=t.testObject;if(typeof n=="object"&&n!==null){if(n instanceof YUITest.TestSuite)this.fire({type:this.TEST_SUITE_BEGIN_EVENT,testSuite:n}),t._start=new Date,this._execNonTestMethod(t,"setUp",!1);else if(n instanceof YUITest.TestCase){this.fire({type:this.TEST_CASE_BEGIN_EVENT,testCase:n}),t._start=new Date;if(this._execNonTestMethod(t,"init",!0))return}typeof setTimeout!="undefined"?setTimeout(function(){YUITest.TestRunner._run()},0):this._run()}else this._runTest(t)}},_resumeTest:function(e){var t=this._cur;this._waiting=!1;if(!t)return;var n=t.testObject,r=t.parent.testObject;r.__yui_wait&&(clearTimeout(r.__yui_wait),delete r.__yui_wait);var i=n.indexOf("fail:")===0||(r._should.fail||{})[n],s=(r._should.error||{})[n],o=!1,u=null;try{e.call(r,this._context);if(YUITest.Assert._getCount()==0&&!this._ignoreEmpty)throw new YUITest.AssertionError("Test has no asserts.");i?(u=new YUITest.ShouldFail,o=!0):s&&(u=new YUITest.ShouldError,o=!0)}catch(a){r.__yui_wait&&(clearTimeout(r.__yui_wait),delete r.__yui_wait);if(a instanceof YUITest.AssertionError)i||(u=a,o=!0);else{if(a instanceof YUITest.Wait){if(typeof a.segment=="function"&&typeof a.delay=="number"){if(typeof setTimeout=="undefined")throw new Error("Asynchronous tests not supported in this environment.");r.__yui_wait=setTimeout(function(){YUITest.TestRunner._resumeTest(a.segment)},a.delay),this._waiting=!0}return}s?typeof s=="string"?a.message!=s&&(u=new YUITest.UnexpectedError(a),o=!0):typeof s=="function"?a instanceof s||(u=new YUITest.UnexpectedError(a),o=!0):typeof s=="object"&&s!==null&&(!(a instanceof s.constructor)||a.message!=s.message)&&(u=new YUITest.UnexpectedError(a),o=!0):(u=new YUITest.UnexpectedError(a),o=!0)}}o?this.fire({type:this.TEST_FAIL_EVENT,testCase:r,testName:n,error:u}):this.fire({type:this.TEST_PASS_EVENT,testCase:r,testName:n}),this._execNonTestMethod(t.parent,"tearDown",!1),YUITest.Assert._reset();var f=new Date-t._start;t.parent.results[n]={result:o?"fail":"pass",message:u?u.getMessage():"Test passed",type:"test",name:n,duration:f},o?t.parent.results.failed++:t.parent.results.passed++,t.parent.results.total++,typeof setTimeout!="undefined"?setTimeout(function(){YUITest.TestRunner._run()},0):this._run()},_handleError:function(e){if(!this._waiting)throw e;this._resumeTest(function(){throw e})},_runTest:function(t){var n=t.testObject,r=t.parent.testObject,i=r[n],s=n.indexOf("ignore:")===0||!e(r.groups,this._groups)||(r._should.ignore||{})[n];s?(t.parent.results[n]={result:"ignore",message:"Test ignored",type:"test",name:n.indexOf("ignore:")===0?n.substring(7):n},t.parent.results.ignored++,t.parent.results.total++,this.fire({type:this.TEST_IGNORE_EVENT,testCase:r,testName:n}),typeof setTimeout!="undefined"?setTimeout(function(){YUITest.TestRunner._run()},0):this._run()):(t._start=new Date,this._execNonTestMethod(t.parent,"setUp",!1),this._resumeTest(i))},getName:function(){return this.masterSuite.name},setName:function(e){this.masterSuite.name=e},add:function(e){return this.masterSuite.add(e),this},clear:function(){this.masterSuite=new YUITest.TestSuite(YUITest.guid("testSuite_"))},isWaiting:function(){return this._waiting},isRunning:function(){return this._running},getResults:function(e){return!this._running&&this._lastResults?typeof e=="function"?e(this._lastResults):this._lastResults:null},getCoverage:function(e){var t=null;return typeof _yuitest_coverage=="object"&&(t=_yuitest_coverage),typeof __coverage__=="object"&&(t=__coverage__),!this._running&&typeof t=="object"?typeof e=="function"?e(t):t:null},callback:function(){var e=arguments,t=this._context,n=this;return function(){for(var r=0;r<arguments.length;r++)t[e[r]]=arguments[r];n._run()}},resume:function(e){if(!this._waiting)throw new Error("resume() called without wait().");this._resumeTest(e||function(){})},run:function(e){e=e||{};var t=YUITest.TestRunner,n=e.oldMode;!n&&this.masterSuite.items.length==1&&this.masterSuite.items[0]instanceof YUITest.TestSuite&&(this.masterSuite=this.masterSuite.items[0]),t._groups=e.groups instanceof Array?","+e.groups.join(",")+",":"",t._buildTestTree(),t._context={},t._root._start=new Date,t.fire(t.BEGIN_EVENT),t._run()}}),new n}(),YUITest.ArrayAssert={_indexOf:function(e,t){if(e.indexOf)return e.indexOf(t);for(var n=0;n<e.length;n++)if(e[n]===t)return n;return-1},_some:function(e,t){if(e.some)return e.some(t);for(var n=0;n<e.length;n++)if(t(e[n]))return!0;return!1},contains:function(e,t,n){YUITest.Assert._increment(),this._indexOf(t,e)==-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value "+e+" ("+typeof e+") not found in array ["+t+"]."))},containsItems:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)this._indexOf(t,e[r])==-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value "+e[r]+" ("+typeof e[r]+") not found in array ["+t+"]."))},containsMatch:function(e,t,n){YUITest.Assert._increment();if(typeof e!="function")throw new TypeError("ArrayAssert.containsMatch(): First argument must be a function.");this._some(t,e)||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"No match found in array ["+t+"]."))},doesNotContain:function(e,t,n){YUITest.Assert._increment(),this._indexOf(t,e)>-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value found in array ["+t+"]."))},doesNotContainItems:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)this._indexOf(t,e[r])>-1&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value found in array ["+t+"]."))},doesNotContainMatch:function(e,t,n){YUITest.Assert._increment();if(typeof e!="function")throw new TypeError("ArrayAssert.doesNotContainMatch(): First argument must be a function.");this._some(t,e)&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value found in array ["+t+"]."))},indexOf:function(e,t,n,r){YUITest.Assert._increment();for(var i=0;i<t.length;i++)if(t[i]===e){n!=i&&YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value exists at index "+i+" but should be at index "+n+"."));return}YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value doesn't exist in array ["+t+"]."))},itemsAreEqual:function(e,t,n){YUITest.Assert._increment(),(typeof e!="object"||typeof t!="object")&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Value should be an array.")),e.length!=t.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Array should have a length of "+e.length+" but has a length of "+t.length+"."));for(var r=0;r<e.length;r++)if(e[r]!=t[r])throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values in position "+r+" are not equal."),e[r],t[r])},itemsAreEquivalent:function(e,t,n,r){YUITest.Assert._increment();if(typeof n!="function")throw new TypeError("ArrayAssert.itemsAreEquivalent(): Third argument must be a function.");e.length!=t.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Array should have a length of "+e.length+" but has a length of "+t.length));for(var i=0;i<e.length;i++)if(!n(e[i],t[i]))throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(r,"Values in position "+i+" are not equivalent."),e[i],t[i])},isEmpty:function(e,t){YUITest.Assert._increment(),e.length>0&&YUITest.Assert.fail(YUITest.Assert._formatMessage(t,"Array should be empty."))},isNotEmpty:function(e,t){YUITest.Assert._increment(),e.length===0&&YUITest.Assert.fail(YUITest.Assert._formatMessage(t,"Array should not be empty."))},itemsAreSame:function(e,t,n){YUITest.Assert._increment(),e.length!=t.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Array should have a length of "+e.length+" but has a length of "+t.length));for(var r=0;r<e.length;r++)if(e[r]!==t[r])throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values in position "+r+" are not the same."),e[r],t[r])},lastIndexOf:function(e,t,n,r){for(var i=t.length;i>=0;i--)if(t[i]===e){n!=i&&YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value exists at index "+i+" but should be at index "+n+"."));return}YUITest.Assert.fail(YUITest.Assert._formatMessage(r,"Value doesn't exist in array."))}},YUITest.Assert={_asserts:0,_formatMessage:function(e,t){return typeof e=="string"&&e.length>0?e.replace("{message}",t):t},_getCount:function(){return this._asserts},_increment:function(){this._asserts++},_reset:function(){this._asserts=0},fail:function(e){throw new YUITest.AssertionError(YUITest.Assert._formatMessage(e,"Test force-failed."))},pass:function(e){YUITest.Assert._increment()},areEqual:function(e,t,n){YUITest.Assert._increment();if(e!=t)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values should be equal."),e,t)},areNotEqual:function(e,t,n){YUITest.Assert._increment();if(e==t)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(n,"Values should not be equal."),e)},areNotSame:function(e,t,n){YUITest.Assert._increment();if(e===t)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(n,"Values should not be the same."),e)},areSame:function(e,t,n){YUITest.Assert._increment();if(e!==t)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values should be the same."),e,t)},isFalse:function(e,t){YUITest.Assert._increment();if(!1!==e)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be false."),!1,e)},isTrue:function(e,t){YUITest.Assert._increment();if(!0!==e)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be true."),!0,e)},isNaN:function(e,t){YUITest.Assert._increment();if(!isNaN(e))throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be NaN."),NaN,e)},isNotNaN:function(e,t){YUITest.Assert._increment();if(isNaN(e))throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Values should not be NaN."),NaN)},isNotNull:function(e,t){YUITest.Assert._increment();if(e===null)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Values should not be null."),null)},isNotUndefined:function(e,t){YUITest.Assert._increment();if(typeof e=="undefined")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should not be undefined."),undefined)},isNull:function(e,t){YUITest.Assert._increment();if(e!==null)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be null."),null,e)},isUndefined:function(e,t){YUITest.Assert._increment();if(typeof e!="undefined")throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(t,"Value should be undefined."),undefined,e)},isArray:function(e,t){YUITest.Assert._increment();var n=!1;Array.isArray?n=!Array.isArray(e):n=Object.prototype.toString.call(e)!="[object Array]";if(n)throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be an array."),e)},isBoolean:function(e,t){YUITest.Assert._increment();if(typeof e!="boolean")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a Boolean."),e)},isFunction:function(e,t){YUITest.Assert._increment();if(!(e instanceof Function))throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a function."),e)},isInstanceOf:function(e,t,n){YUITest.Assert._increment();if(!(t instanceof e))throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Value isn't an instance of expected type."),e,t)},isNumber:function(e,t){YUITest.Assert._increment();if(typeof e!="number")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a number."),e)},isObject:function(e,t){YUITest.Assert._increment();if(!e||typeof e!="object"&&typeof e!="function")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be an object."),e)},isString:function(e,t){YUITest.Assert._increment();if(typeof e!="string")throw new YUITest.UnexpectedValue(YUITest.Assert._formatMessage(t,"Value should be a string."),e)},isTypeOf:function(e,t,n){YUITest.Assert._increment();if(typeof t!=e)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Value should be of type "+e+"."),e,typeof t)},throwsError:function(e,t,n){YUITest.Assert._increment();var r=!1;try{t()}catch(i){if(typeof e=="string")i.message!=e&&(r=!0);else if(typeof e=="function")i instanceof e||(r=!0);else if(typeof e=="object"&&e!==null){if(!(i instanceof e.constructor)||i.message!=e.message)r=!0}else r=!0;if(r)throw new YUITest.UnexpectedError(i);return}throw new YUITest.AssertionError(YUITest.Assert._formatMessage(n,"Error should have been thrown."))}},YUITest.AssertionError=function(e){this.message=e,this.name="Assert Error"},YUITest.AssertionError.prototype={constructor:YUITest.AssertionError,getMessage:function(){return this.message},toString:function(){return this.name+": "+this.getMessage()}},YUITest.ComparisonFailure=function(e,t,n){YUITest.AssertionError.call(this,e),this.expected=t,this.actual=n,this.name="ComparisonFailure"},YUITest.ComparisonFailure.prototype=new YUITest.AssertionError,YUITest.ComparisonFailure.prototype.constructor=YUITest.ComparisonFailure,YUITest.ComparisonFailure.prototype.getMessage=function(){return this.message+"\nExpected: "+this.expected+" ("+typeof this.expected+")"+"\nActual: "+this.actual+" ("+typeof this.actual+")"},YUITest.CoverageFormat={JSON:function(e){return YUITest.Util.JSON.stringify(e)},XdebugJSON:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n].lines);return YUITest.Util.JSON.stringify(e)}},YUITest.DateAssert={datesAreEqual:function(e,t,n){YUITest.Assert._increment();if(!(e instanceof Date&&t instanceof Date))throw new TypeError("YUITest.DateAssert.datesAreEqual(): Expected and actual values must be Date objects.");var r="";e.getFullYear()!=t.getFullYear()&&(r="Years should be equal."),e.getMonth()!=t.getMonth()&&(r="Months should be equal."),e.getDate()!=t.getDate()&&(r="Days of month should be equal.");if(r.length)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,r),e,t)},timesAreEqual:function(e,t,n){YUITest.Assert._increment();if(!(e instanceof Date&&t instanceof Date))throw new TypeError("YUITest.DateAssert.timesAreEqual(): Expected and actual values must be Date objects.");var r="";e.getHours()!=t.getHours()&&(r="Hours should be equal."),e.getMinutes()!=t.getMinutes()&&(r="Minutes should be equal."),e.getSeconds()!=t.getSeconds()&&(r="Seconds should be equal.");if(r.length)throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,r),e,t)}},YUITest.Mock=function(e){e=e||{};var t,n;try{function r(){}r.prototype=e,t=new r}catch(i){t={}}for(n in e)e.hasOwnProperty(n)&&typeof e[n]=="function"&&(t[n]=function(e){return function(){YUITest.Assert.fail("Method "+e+"() was called but was not expected to be.")}}(n));return t},YUITest.Mock.expect=function(e,t){e.__expectations||(e.__expectations={});if(t.method){var n=t.method,r=t.args||[],i=t.returns,s=typeof t.callCount=="number"?t.callCount:1,o=t.error,u=t.run||function(){},a,f;e.__expectations[n]=t,t.callCount=s,t.actualCallCount=0;for(f=0;f<r.length;f++)r[f]instanceof YUITest.Mock.Value||(r[f]=YUITest.Mock.Value(YUITest.Assert.areSame,[r[f]],"Argument "+f+" of "+n+"() is incorrect."));s>0?e[n]=function(){try{t.actualCallCount++,YUITest.Assert.areEqual(r.length,arguments.length,"Method "+n+"() passed incorrect number of arguments.");for(var e=0,s=r.length;e<s;e++)r[e].verify(arguments[e]);a=u.apply(this,arguments);if(o)throw o}catch(f){YUITest.TestRunner._handleError(f)}return t.hasOwnProperty("returns")?i:a}:e[n]=function(){try{YUITest.Assert.fail("Method "+n+"() should not have been called.")}catch(e){YUITest.TestRunner._handleError(e)}}}else t.property&&(e.__expectations[t.property]=t)},YUITest.Mock.verify=function(e){try{for(var t in e.__expectations)if(e.__expectations.hasOwnProperty(t)){var n=e.__expectations[t];n.method?YUITest.Assert.areEqual(n.callCount,n.actualCallCount,"Method "+n.method+"() wasn't called the expected number of times."):n.property&&YUITest.Assert.areEqual(n.value,e[n.property],"Property "+n.property+" wasn't set to the correct value.")}}catch(r){YUITest.TestRunner._handleError(r)}},YUITest.Mock.Value=function(e,t,n){if(!(this instanceof YUITest.Mock.Value))return new YUITest.Mock.Value(e,t,n);this.verify=function(r){var i=[].concat(t||[]);i.push(r),i.push(n),e.apply(null,i)}},YUITest.Mock.Value.Any=YUITest.Mock.Value(function(){}),YUITest.Mock.Value.Boolean=YUITest.Mock.Value(YUITest.Assert.isBoolean),YUITest.Mock.Value.Number=YUITest.Mock.Value(YUITest.Assert.isNumber),YUITest.Mock.Value.String=YUITest.Mock.Value(YUITest.Assert.isString),YUITest.Mock.Value.Object=YUITest.Mock.Value(YUITest.Assert.isObject),YUITest.Mock.Value.Function=YUITest.Mock.Value(YUITest.Assert.isFunction),YUITest.ObjectAssert={areEqual:function(e,t,n){YUITest.Assert._increment();var r=YUITest.Object.keys(e),i=YUITest.Object.keys(t);r.length!=i.length&&YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Object should have "+r.length+" keys but has "+i.length));for(var s in e)if(e.hasOwnProperty(s)&&e[s]!=t[s])throw new YUITest.ComparisonFailure(YUITest.Assert._formatMessage(n,"Values should be equal for property "+s),e[s],t[s])},hasKey:function(e,t,n){YUITest.ObjectAssert.ownsOrInheritsKey(e,t,n)},hasKeys:function(e,t,n){YUITest.ObjectAssert.ownsOrInheritsKeys(e,t,n)},inheritsKey:function(e,t,n){YUITest.Assert._increment(),e in t&&!t.hasOwnProperty(e)||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e+"' not found on object instance."))},inheritsKeys:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)propertyName in t&&!t.hasOwnProperty(e[r])||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e[r]+"' not found on object instance."))},ownsKey:function(e,t,n){YUITest.Assert._increment(),t.hasOwnProperty(e)||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e+"' not found on object instance."))},ownsKeys:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)t.hasOwnProperty(e[r])||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e[r]+"' not found on object instance."))},ownsNoKeys:function(e,t){YUITest.Assert._increment();var n=0,r;for(r in e)e.hasOwnProperty(r)&&n++;n!==0&&YUITest.Assert.fail(YUITest.Assert._formatMessage(t,"Object owns "+n+" properties but should own none."))},ownsOrInheritsKey:function(e,t,n){YUITest.Assert._increment(),e in t||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e+"' not found on object."))},ownsOrInheritsKeys:function(e,t,n){YUITest.Assert._increment();for(var r=0;r<e.length;r++)e[r]in t||YUITest.Assert.fail(YUITest.Assert._formatMessage(n,"Property '"+e[r]+"' not found on object."))}},YUITest.Results=function(e){this.name=e,this.passed=0,this.failed=0,this.errors=0,this.ignored=0,this.total=0,this.duration=0},YUITest.Results.prototype.include=function(e){this.passed+=e.passed,this.failed+=e.failed,this.ignored+=e.ignored,this.total+=e.total,this.errors+=e.errors},YUITest.ShouldError=function(e){YUITest.AssertionError.call(this,e||"This test should have thrown an error but didn't."),this.name="ShouldError"},YUITest.ShouldError.prototype=new YUITest.AssertionError,YUITest.ShouldError.prototype.constructor=YUITest.ShouldError,YUITest.ShouldFail=function(e){YUITest.AssertionError.call(this,e||"This test should fail but didn't."),this.name="ShouldFail"},YUITest.ShouldFail.prototype=new YUITest.AssertionError,YUITest.ShouldFail.prototype.constructor=YUITest.ShouldFail,YUITest.UnexpectedError=function(e){YUITest.AssertionError.call(this,"Unexpected error: "+e.message),this.cause=e,this.name="UnexpectedError",this.stack=e.stack},YUITest.UnexpectedError.prototype=new YUITest.AssertionError,YUITest.UnexpectedError.prototype.constructor=YUITest.UnexpectedError,YUITest.UnexpectedValue=function(e,t){YUITest.AssertionError.call(this,e),this.unexpected=t,this.name="UnexpectedValue"},YUITest.UnexpectedValue.prototype=new YUITest.AssertionError,YUITest.UnexpectedValue.prototype.constructor=YUITest.UnexpectedValue,YUITest.UnexpectedValue.prototype.getMessage=function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+typeof this.unexpected+") "},YUITest.Wait=function(e,t){this.segment=typeof e=="function"?e:null,this.delay=typeof t=="number"?t:0},e.Test=YUITest,e.Object.each(YUITest,function(t,n){var n=n.replace("Test","");e.Test[n]=t})),e.Assert=YUITest.Assert,e.Assert.Error=e.Test.AssertionError,e.Assert.ComparisonFailure=e.Test.ComparisonFailure,e.Assert.UnexpectedValue=e.Test.UnexpectedValue,e.Mock=e.Test.Mock,e.ObjectAssert=e.Test.ObjectAssert,e.ArrayAssert=e.Test.ArrayAssert,e.DateAssert=e.Test.DateAssert,e.Test.ResultsFormat=e.Test.TestFormat;var n=e.Test.ArrayAssert.itemsAreEqual;e.Test.ArrayAssert.itemsAreEqual=function(t,r,i){return n.call(this,e.Array(t),e.Array(r),i)},e.assert=function(t,n){e.Assert._increment();if(!t)throw new e.Assert.Error(e.Assert._formatMessage(n,"Assertion failed."))},e.fail=e.Assert.fail,e.Test.Runner.once=e.Test.Runner.subscribe,e.Test.Runner.disableLogging=function(){e.Test.Runner._log=!1},e.Test.Runner.enableLogging=function(){e.Test.Runner._log=!0},e.Test.Runner._ignoreEmpty=!0,e.Test.Runner._log=!0,e.Test.Runner.on=e.Test.Runner.attach;if(!YUI.YUITest){e.config.win&&(e.config.win.YUITest=YUITest),YUI.YUITest=e.Test;var r=function(t){var n="",r="";switch(t.type){case this.BEGIN_EVENT:n="Testing began at "+(new Date).toString()+".",r="info";break;case this.COMPLETE_EVENT:n=e.Lang.sub("Testing completed at "+(new Date).toString()+".\n"+"Passed:{passed} Failed:{failed} "+"Total:{total} ({ignored} ignored)",t.results),r="info";break;case this.TEST_FAIL_EVENT:n=t.testName+": failed.\n"+t.error.getMessage(),r="fail";break;case this.TEST_IGNORE_EVENT:n=t.testName+": ignored.",r="ignore";break;case this.TEST_PASS_EVENT:n=t.testName+": passed.",r="pass";break;case this.TEST_SUITE_BEGIN_EVENT:n='Test suite "'+t.testSuite.name+'" started.',r="info";break;case this.TEST_SUITE_COMPLETE_EVENT:n=e.Lang.sub('Test suite "'+t.testSuite.name+'" completed'+".\n"+"Passed:{passed} Failed:{failed} "+"Total:{total} ({ignored} ignored)",t.results),r="info";break;case this.TEST_CASE_BEGIN_EVENT:n='Test case "'+t.testCase.name+'" started.',r="info";break;case this.TEST_CASE_COMPLETE_EVENT:n=e.Lang.sub('Test case "'+t.testCase.name+'" completed.\n'+"Passed:{passed} Failed:{failed} "+"Total:{total} ({ignored} ignored)",t.results),r="info";break;default:n="Unexpected event "+t.type,r="info"}e.Test.Runner._log&&e.log(n,r,"TestRunner")},i,s;for(i in e.Test.Runner)s=e.Test.Runner[i],i.indexOf("_EVENT")>-1&&e.Test.Runner.subscribe(s,r)}},"3.7.3",{requires:["event-simulate","event-custom","json-stringify"]});
bundle/test/test.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -25,7 +25,7 @@ //Make this global for back compat YUITest = { - version: "3.7.2", + version: "3.7.3", guid: function(pre) { return Y.guid(pre); } @@ -1727,12 +1727,19 @@ * format is specified, a string representing the results in that format. * @method getCoverage */- getCoverage: function(format){- if (!this._running && typeof _yuitest_coverage == "object"){- if (typeof format == "function"){- return format(_yuitest_coverage); + getCoverage: function(format) {+ var covObject = null;+ if (typeof _yuitest_coverage === "object") {+ covObject = _yuitest_coverage;+ }+ if (typeof __coverage__ === "object") {+ covObject = __coverage__;+ }+ if (!this._running && typeof covObject == "object"){+ if (typeof format == "function") {+ return format(covObject); } else {- return _yuitest_coverage;+ return covObject; } } else { return null;@@ -3742,7 +3749,7 @@ break; default: message = "Unexpected event " + event.type;- message = "info";+ messageType = "info"; } if (Y.Test.Runner._log) {@@ -3762,4 +3769,4 @@ } //End if for YUI.YUITest -}, '3.7.2', {"requires": ["event-simulate", "event-custom", "json-stringify"]});+}, '3.7.3', {"requires": ["event-simulate", "event-custom", "json-stringify"]});
bundle/text-accentfold/text-accentfold-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/text-accentfold/text-accentfold.js", code: [] };-_yuitest_coverage["build/text-accentfold/text-accentfold.js"].code=["YUI.add('text-accentfold', function (Y, NAME) {","","/**"," * Text utilities."," *"," * @module text"," * @since 3.3.0"," */","","/**"," * Provides a basic accent folding implementation that converts common accented"," * letters (like \"á\") to their non-accented forms (like \"a\")."," *"," * @module text"," * @submodule text-accentfold"," */","","/**"," * <p>"," * Provides a basic accent folding implementation that converts common accented"," * letters (like \"á\") to their non-accented forms (like \"a\")."," * </p>"," *"," * <p>"," * This implementation is not comprehensive, and should only be used as a last"," * resort when accent folding can't be done on the server. A comprehensive"," * accent folding implementation would require much more character data to be"," * sent to the browser, resulting in a significant performance penalty. This"," * implementation strives for a compromise between usefulness and performance."," * </p>"," *"," * <p>"," * Accent folding is a destructive operation that can't be reversed, and may"," * change or destroy the actual meaning of the text depending on the language."," * It should not be used on strings that will later be displayed to a user,"," * unless this is done with the understanding that linguistic meaning may be"," * lost and that you may in fact confuse or insult the user by doing so."," * </p>"," *"," * <p>"," * When used for matching, accent folding is likely to produce erroneous matches"," * for languages in which characters with diacritics are considered different"," * from their base characters, or where correct folding would map to other"," * character sequences than just stripped characters. For example, in German"," * \"ü\" is a character that's clearly different from \"u\" and should match \"ue\""," * instead. The word \"betrügen\" means \"to defraud\", while \"betrugen\" is the past"," * tense of \"to behave\". The name \"Müller\" is expected to match \"Mueller\", but"," * not \"Muller\". On the other hand, accent folding falls short for languages"," * where different base characters are expected to match. In Japanese, for"," * example, hiragana and katakana characters with the same pronunciation (\"あ\""," * and \"ア\") are commonly treated as equivalent for lookups, but accent folding"," * treats them as different."," * </p>"," *"," * @class Text.AccentFold"," * @static"," */","","var YArray = Y.Array,"," Text = Y.Text,"," FoldData = Text.Data.AccentFold,","","AccentFold = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," * Returns <code>true</code> if the specified string contains one or more"," * characters that can be folded, <code>false</code> otherwise."," *"," * @method canFold"," * @param {String} string String to test."," * @return {Boolean}"," * @static"," */"," canFold: function (string) {"," var letter;",""," for (letter in FoldData) {"," if (FoldData.hasOwnProperty(letter) &&"," string.search(FoldData[letter]) !== -1) {"," return true;"," }"," }",""," return false;"," },",""," /**"," * Compares the accent-folded versions of two strings and returns"," * <code>true</code> if they're the same, <code>false</code> otherwise. If"," * a custom comparison function is supplied, the accent-folded strings will"," * be passed to that function for comparison."," *"," * @method compare"," * @param {String} a First string to compare."," * @param {String} b Second string to compare."," * @param {Function} func (optional) Custom comparison function. Should"," * return a truthy or falsy value."," * @return {Boolean} Results of the comparison."," * @static"," */"," compare: function (a, b, func) {"," var aFolded = AccentFold.fold(a),"," bFolded = AccentFold.fold(b);",""," return func ? !!func(aFolded, bFolded) : aFolded === bFolded;"," },",""," /**"," * <p>"," * Returns a copy of <em>haystack</em> containing only the strings for which"," * the supplied function returns <code>true</code>."," * </p>"," *"," * <p>"," * While comparisons will be made using accent-folded strings, the returned"," * array of matches will contain the original strings that were passed in."," * </p>"," *"," * @method filter"," * @param {Array} haystack Array of strings to filter."," * @param {Function} func Comparison function. Will receive an accent-folded"," * haystack string as an argument, and should return a truthy or falsy"," * value."," * @return {Array} Filtered copy of <em>haystack</em>."," * @static"," */"," filter: function (haystack, func) {"," return YArray.filter(haystack, function (item) {"," return func(AccentFold.fold(item));"," });"," },",""," /**"," * Accent-folds the specified string or array of strings and returns a copy"," * in which common accented letters have been converted to their closest"," * non-accented, lowercase forms."," *"," * @method fold"," * @param {String|Array} input String or array of strings to be folded."," * @return {String|Array} Folded string or array of strings."," * @static"," */"," fold: function (input) {"," if (Y.Lang.isArray(input)) {"," return YArray.map(input, AccentFold.fold);"," }",""," input = input.toLowerCase();",""," Y.Object.each(FoldData, function (regex, letter) {"," input = input.replace(regex, letter);"," });",""," return input;"," }","};","","Text.AccentFold = AccentFold;","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"text-data-accentfold\"]});"];+_yuitest_coverage["build/text-accentfold/text-accentfold.js"].code=["YUI.add('text-accentfold', function (Y, NAME) {","","/**"," * Text utilities."," *"," * @module text"," * @since 3.3.0"," */","","/**"," * Provides a basic accent folding implementation that converts common accented"," * letters (like \"á\") to their non-accented forms (like \"a\")."," *"," * @module text"," * @submodule text-accentfold"," */","","/**"," * <p>"," * Provides a basic accent folding implementation that converts common accented"," * letters (like \"á\") to their non-accented forms (like \"a\")."," * </p>"," *"," * <p>"," * This implementation is not comprehensive, and should only be used as a last"," * resort when accent folding can't be done on the server. A comprehensive"," * accent folding implementation would require much more character data to be"," * sent to the browser, resulting in a significant performance penalty. This"," * implementation strives for a compromise between usefulness and performance."," * </p>"," *"," * <p>"," * Accent folding is a destructive operation that can't be reversed, and may"," * change or destroy the actual meaning of the text depending on the language."," * It should not be used on strings that will later be displayed to a user,"," * unless this is done with the understanding that linguistic meaning may be"," * lost and that you may in fact confuse or insult the user by doing so."," * </p>"," *"," * <p>"," * When used for matching, accent folding is likely to produce erroneous matches"," * for languages in which characters with diacritics are considered different"," * from their base characters, or where correct folding would map to other"," * character sequences than just stripped characters. For example, in German"," * \"ü\" is a character that's clearly different from \"u\" and should match \"ue\""," * instead. The word \"betrügen\" means \"to defraud\", while \"betrugen\" is the past"," * tense of \"to behave\". The name \"Müller\" is expected to match \"Mueller\", but"," * not \"Muller\". On the other hand, accent folding falls short for languages"," * where different base characters are expected to match. In Japanese, for"," * example, hiragana and katakana characters with the same pronunciation (\"あ\""," * and \"ア\") are commonly treated as equivalent for lookups, but accent folding"," * treats them as different."," * </p>"," *"," * @class Text.AccentFold"," * @static"," */","","var YArray = Y.Array,"," Text = Y.Text,"," FoldData = Text.Data.AccentFold,","","AccentFold = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," * Returns <code>true</code> if the specified string contains one or more"," * characters that can be folded, <code>false</code> otherwise."," *"," * @method canFold"," * @param {String} string String to test."," * @return {Boolean}"," * @static"," */"," canFold: function (string) {"," var letter;",""," for (letter in FoldData) {"," if (FoldData.hasOwnProperty(letter) &&"," string.search(FoldData[letter]) !== -1) {"," return true;"," }"," }",""," return false;"," },",""," /**"," * Compares the accent-folded versions of two strings and returns"," * <code>true</code> if they're the same, <code>false</code> otherwise. If"," * a custom comparison function is supplied, the accent-folded strings will"," * be passed to that function for comparison."," *"," * @method compare"," * @param {String} a First string to compare."," * @param {String} b Second string to compare."," * @param {Function} func (optional) Custom comparison function. Should"," * return a truthy or falsy value."," * @return {Boolean} Results of the comparison."," * @static"," */"," compare: function (a, b, func) {"," var aFolded = AccentFold.fold(a),"," bFolded = AccentFold.fold(b);",""," return func ? !!func(aFolded, bFolded) : aFolded === bFolded;"," },",""," /**"," * <p>"," * Returns a copy of <em>haystack</em> containing only the strings for which"," * the supplied function returns <code>true</code>."," * </p>"," *"," * <p>"," * While comparisons will be made using accent-folded strings, the returned"," * array of matches will contain the original strings that were passed in."," * </p>"," *"," * @method filter"," * @param {Array} haystack Array of strings to filter."," * @param {Function} func Comparison function. Will receive an accent-folded"," * haystack string as an argument, and should return a truthy or falsy"," * value."," * @return {Array} Filtered copy of <em>haystack</em>."," * @static"," */"," filter: function (haystack, func) {"," return YArray.filter(haystack, function (item) {"," return func(AccentFold.fold(item));"," });"," },",""," /**"," * Accent-folds the specified string or array of strings and returns a copy"," * in which common accented letters have been converted to their closest"," * non-accented, lowercase forms."," *"," * @method fold"," * @param {String|Array} input String or array of strings to be folded."," * @return {String|Array} Folded string or array of strings."," * @static"," */"," fold: function (input) {"," if (Y.Lang.isArray(input)) {"," return YArray.map(input, AccentFold.fold);"," }",""," input = input.toLowerCase();",""," Y.Object.each(FoldData, function (regex, letter) {"," input = input.replace(regex, letter);"," });",""," return input;"," }","};","","Text.AccentFold = AccentFold;","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"text-data-accentfold\"]});"]; _yuitest_coverage["build/text-accentfold/text-accentfold.js"].lines = {"1":0,"59":0,"76":0,"78":0,"79":0,"81":0,"85":0,"103":0,"106":0,"129":0,"130":0,"145":0,"146":0,"149":0,"151":0,"152":0,"155":0,"159":0}; _yuitest_coverage["build/text-accentfold/text-accentfold.js"].functions = {"canFold:75":0,"compare:102":0,"(anonymous 2):129":0,"filter:128":0,"(anonymous 3):151":0,"fold:144":0,"(anonymous 1):1":0}; _yuitest_coverage["build/text-accentfold/text-accentfold.js"].coveredLines = 18;@@ -223,4 +223,4 @@ Text.AccentFold = AccentFold; -}, '3.7.2', {"requires": ["array-extras", "text-data-accentfold"]});+}, '3.7.3', {"requires": ["array-extras", "text-data-accentfold"]});
bundle/text-accentfold/text-accentfold-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -165,4 +165,4 @@ Text.AccentFold = AccentFold; -}, '3.7.2', {"requires": ["array-extras", "text-data-accentfold"]});+}, '3.7.3', {"requires": ["array-extras", "text-data-accentfold"]});
bundle/text-accentfold/text-accentfold-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("text-accentfold",function(e,t){var n=e.Array,r=e.Text,i=r.Data.AccentFold,s={canFold:function(e){var t;for(t in i)if(i.hasOwnProperty(t)&&e.search(i[t])!==-1)return!0;return!1},compare:function(e,t,n){var r=s.fold(e),i=s.fold(t);return n?!!n(r,i):r===i},filter:function(e,t){return n.filter(e,function(e){return t(s.fold(e))})},fold:function(t){return e.Lang.isArray(t)?n.map(t,s.fold):(t=t.toLowerCase(),e.Object.each(i,function(e,n){t=t.replace(e,n)}),t)}};r.AccentFold=s},"3.7.2",{requires:["array-extras","text-data-accentfold"]});+YUI.add("text-accentfold",function(e,t){var n=e.Array,r=e.Text,i=r.Data.AccentFold,s={canFold:function(e){var t;for(t in i)if(i.hasOwnProperty(t)&&e.search(i[t])!==-1)return!0;return!1},compare:function(e,t,n){var r=s.fold(e),i=s.fold(t);return n?!!n(r,i):r===i},filter:function(e,t){return n.filter(e,function(e){return t(s.fold(e))})},fold:function(t){return e.Lang.isArray(t)?n.map(t,s.fold):(t=t.toLowerCase(),e.Object.each(i,function(e,n){t=t.replace(e,n)}),t)}};r.AccentFold=s},"3.7.3",{requires:["array-extras","text-data-accentfold"]});
bundle/text-accentfold/text-accentfold.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -165,4 +165,4 @@ Text.AccentFold = AccentFold; -}, '3.7.2', {"requires": ["array-extras", "text-data-accentfold"]});+}, '3.7.3', {"requires": ["array-extras", "text-data-accentfold"]});
bundle/text-data-accentfold/text-data-accentfold-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/text-data-accentfold/text-data-accentfold.js", code: [] };-_yuitest_coverage["build/text-data-accentfold/text-data-accentfold.js"].code=["YUI.add('text-data-accentfold', function (Y, NAME) {","","// The following tool was very helpful in creating these mappings:","// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:toNFKD%3D/^a/:]&abb=on","","Y.namespace('Text.Data').AccentFold = {"," 0: /[\\u2070\\u2080\\u24EA\\uFF10]/gi,"," 1: /[\\u00B9\\u2081\\u2460\\uFF11]/gi,"," 2: /[\\u00B2\\u2082\\u2461\\uFF12]/gi,"," 3: /[\\u00B3\\u2083\\u2462\\uFF13]/gi,"," 4: /[\\u2074\\u2084\\u2463\\uFF14]/gi,"," 5: /[\\u2075\\u2085\\u2464\\uFF15]/gi,"," 6: /[\\u2076\\u2086\\u2465\\uFF16]/gi,"," 7: /[\\u2077\\u2087\\u2466\\uFF17]/gi,"," 8: /[\\u2078\\u2088\\u2467\\uFF18]/gi,"," 9: /[\\u2079\\u2089\\u2468\\uFF19]/gi,"," a: /[\\u00AA\\u00E0-\\u00E5\\u0101\\u0103\\u0105\\u01CE\\u01DF\\u01E1\\u01FB\\u0201\\u0203\\u0227\\u1D43\\u1E01\\u1E9A\\u1EA1\\u1EA3\\u1EA5\\u1EA7\\u1EA9\\u1EAB\\u1EAD\\u1EAF\\u1EB1\\u1EB3\\u1EB5\\u1EB7\\u24D0\\uFF41]/gi,"," b: /[\\u1D47\\u1E03\\u1E05\\u1E07\\u24D1\\uFF42]/gi,"," c: /[\\u00E7\\u0107\\u0109\\u010B\\u010D\\u1D9C\\u1E09\\u24D2\\uFF43]/gi,"," d: /[\\u010F\\u1D48\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u217E\\u24D3\\uFF44]/gi,"," e: /[\\u00E8-\\u00EB\\u0113\\u0115\\u0117\\u0119\\u011B\\u0205\\u0207\\u0229\\u1D49\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1EB9\\u1EBB\\u1EBD\\u1EBF\\u1EC1\\u1EC3\\u1EC5\\u1EC7\\u2091\\u212F\\u24D4\\uFF45]/gi,"," f: /[\\u1DA0\\u1E1F\\u24D5\\uFF46]/gi,"," g: /[\\u011D\\u011F\\u0121\\u0123\\u01E7\\u01F5\\u1D4D\\u1E21\\u210A\\u24D6\\uFF47]/gi,"," h: /[\\u0125\\u021F\\u02B0\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E96\\u210E\\u24D7\\uFF48]/gi,"," i: /[\\u00EC-\\u00EF\\u0129\\u012B\\u012D\\u012F\\u0133\\u01D0\\u0209\\u020B\\u1D62\\u1E2D\\u1E2F\\u1EC9\\u1ECB\\u2071\\u2139\\u2170\\u24D8\\uFF49]/gi,"," j: /[\\u0135\\u01F0\\u02B2\\u24D9\\u2C7C\\uFF4A]/gi,"," k: /[\\u0137\\u01E9\\u1D4F\\u1E31\\u1E33\\u1E35\\u24DA\\uFF4B]/gi,"," l: /[\\u013A\\u013C\\u013E\\u0140\\u01C9\\u02E1\\u1E37\\u1E39\\u1E3B\\u1E3D\\u2113\\u217C\\u24DB\\uFF4C]/gi,"," m: /[\\u1D50\\u1E3F\\u1E41\\u1E43\\u217F\\u24DC\\uFF4D]/gi,"," n: /[\\u00F1\\u0144\\u0146\\u0148\\u01F9\\u1E45\\u1E47\\u1E49\\u1E4B\\u207F\\u24DD\\uFF4E]/gi,"," o: /[\\u00BA\\u00F2-\\u00F6\\u014D\\u014F\\u0151\\u01A1\\u01D2\\u01EB\\u01ED\\u020D\\u020F\\u022B\\u022D\\u022F\\u0231\\u1D52\\u1E4D\\u1E4F\\u1E51\\u1E53\\u1ECD\\u1ECF\\u1ED1\\u1ED3\\u1ED5\\u1ED7\\u1ED9\\u1EDB\\u1EDD\\u1EDF\\u1EE1\\u1EE3\\u2092\\u2134\\u24DE\\uFF4F]/gi,"," p: /[\\u1D56\\u1E55\\u1E57\\u24DF\\uFF50]/gi,"," q: /[\\u02A0\\u24E0\\uFF51]/gi,"," r: /[\\u0155\\u0157\\u0159\\u0211\\u0213\\u02B3\\u1D63\\u1E59\\u1E5B\\u1E5D\\u1E5F\\u24E1\\uFF52]/gi,"," s: /[\\u015B\\u015D\\u015F\\u0161\\u017F\\u0219\\u02E2\\u1E61\\u1E63\\u1E65\\u1E67\\u1E69\\u1E9B\\u24E2\\uFF53]/gi,"," t: /[\\u0163\\u0165\\u021B\\u1D57\\u1E6B\\u1E6D\\u1E6F\\u1E71\\u1E97\\u24E3\\uFF54]/gi,"," u: /[\\u00F9-\\u00FC\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u01B0\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u0215\\u0217\\u1D58\\u1D64\\u1E73\\u1E75\\u1E77\\u1E79\\u1E7B\\u1EE5\\u1EE7\\u1EE9\\u1EEB\\u1EED\\u1EEF\\u1EF1\\u24E4\\uFF55]/gi,"," v: /[\\u1D5B\\u1D65\\u1E7D\\u1E7F\\u2174\\u24E5\\uFF56]/gi,"," w: /[\\u0175\\u02B7\\u1E81\\u1E83\\u1E85\\u1E87\\u1E89\\u1E98\\u24E6\\uFF57]/gi,"," x: /[\\u02E3\\u1E8B\\u1E8D\\u2093\\u2179\\u24E7\\uFF58]/gi,"," y: /[\\u00FD\\u00FF\\u0177\\u0233\\u02B8\\u1E8F\\u1E99\\u1EF3\\u1EF5\\u1EF7\\u1EF9\\u24E8\\uFF59]/gi,"," z: /[\\u017A\\u017C\\u017E\\u1DBB\\u1E91\\u1E93\\u1E95\\u24E9\\uFF5A]/gi","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/text-data-accentfold/text-data-accentfold.js"].code=["YUI.add('text-data-accentfold', function (Y, NAME) {","","// The following tool was very helpful in creating these mappings:","// http://unicode.org/cldr/utility/list-unicodeset.jsp?a=[:toNFKD%3D/^a/:]&abb=on","","Y.namespace('Text.Data').AccentFold = {"," 0: /[\\u2070\\u2080\\u24EA\\uFF10]/gi,"," 1: /[\\u00B9\\u2081\\u2460\\uFF11]/gi,"," 2: /[\\u00B2\\u2082\\u2461\\uFF12]/gi,"," 3: /[\\u00B3\\u2083\\u2462\\uFF13]/gi,"," 4: /[\\u2074\\u2084\\u2463\\uFF14]/gi,"," 5: /[\\u2075\\u2085\\u2464\\uFF15]/gi,"," 6: /[\\u2076\\u2086\\u2465\\uFF16]/gi,"," 7: /[\\u2077\\u2087\\u2466\\uFF17]/gi,"," 8: /[\\u2078\\u2088\\u2467\\uFF18]/gi,"," 9: /[\\u2079\\u2089\\u2468\\uFF19]/gi,"," a: /[\\u00AA\\u00E0-\\u00E5\\u0101\\u0103\\u0105\\u01CE\\u01DF\\u01E1\\u01FB\\u0201\\u0203\\u0227\\u1D43\\u1E01\\u1E9A\\u1EA1\\u1EA3\\u1EA5\\u1EA7\\u1EA9\\u1EAB\\u1EAD\\u1EAF\\u1EB1\\u1EB3\\u1EB5\\u1EB7\\u24D0\\uFF41]/gi,"," b: /[\\u1D47\\u1E03\\u1E05\\u1E07\\u24D1\\uFF42]/gi,"," c: /[\\u00E7\\u0107\\u0109\\u010B\\u010D\\u1D9C\\u1E09\\u24D2\\uFF43]/gi,"," d: /[\\u010F\\u1D48\\u1E0B\\u1E0D\\u1E0F\\u1E11\\u1E13\\u217E\\u24D3\\uFF44]/gi,"," e: /[\\u00E8-\\u00EB\\u0113\\u0115\\u0117\\u0119\\u011B\\u0205\\u0207\\u0229\\u1D49\\u1E15\\u1E17\\u1E19\\u1E1B\\u1E1D\\u1EB9\\u1EBB\\u1EBD\\u1EBF\\u1EC1\\u1EC3\\u1EC5\\u1EC7\\u2091\\u212F\\u24D4\\uFF45]/gi,"," f: /[\\u1DA0\\u1E1F\\u24D5\\uFF46]/gi,"," g: /[\\u011D\\u011F\\u0121\\u0123\\u01E7\\u01F5\\u1D4D\\u1E21\\u210A\\u24D6\\uFF47]/gi,"," h: /[\\u0125\\u021F\\u02B0\\u1E23\\u1E25\\u1E27\\u1E29\\u1E2B\\u1E96\\u210E\\u24D7\\uFF48]/gi,"," i: /[\\u00EC-\\u00EF\\u0129\\u012B\\u012D\\u012F\\u0133\\u01D0\\u0209\\u020B\\u1D62\\u1E2D\\u1E2F\\u1EC9\\u1ECB\\u2071\\u2139\\u2170\\u24D8\\uFF49]/gi,"," j: /[\\u0135\\u01F0\\u02B2\\u24D9\\u2C7C\\uFF4A]/gi,"," k: /[\\u0137\\u01E9\\u1D4F\\u1E31\\u1E33\\u1E35\\u24DA\\uFF4B]/gi,"," l: /[\\u013A\\u013C\\u013E\\u0140\\u01C9\\u02E1\\u1E37\\u1E39\\u1E3B\\u1E3D\\u2113\\u217C\\u24DB\\uFF4C]/gi,"," m: /[\\u1D50\\u1E3F\\u1E41\\u1E43\\u217F\\u24DC\\uFF4D]/gi,"," n: /[\\u00F1\\u0144\\u0146\\u0148\\u01F9\\u1E45\\u1E47\\u1E49\\u1E4B\\u207F\\u24DD\\uFF4E]/gi,"," o: /[\\u00BA\\u00F2-\\u00F6\\u014D\\u014F\\u0151\\u01A1\\u01D2\\u01EB\\u01ED\\u020D\\u020F\\u022B\\u022D\\u022F\\u0231\\u1D52\\u1E4D\\u1E4F\\u1E51\\u1E53\\u1ECD\\u1ECF\\u1ED1\\u1ED3\\u1ED5\\u1ED7\\u1ED9\\u1EDB\\u1EDD\\u1EDF\\u1EE1\\u1EE3\\u2092\\u2134\\u24DE\\uFF4F]/gi,"," p: /[\\u1D56\\u1E55\\u1E57\\u24DF\\uFF50]/gi,"," q: /[\\u02A0\\u24E0\\uFF51]/gi,"," r: /[\\u0155\\u0157\\u0159\\u0211\\u0213\\u02B3\\u1D63\\u1E59\\u1E5B\\u1E5D\\u1E5F\\u24E1\\uFF52]/gi,"," s: /[\\u015B\\u015D\\u015F\\u0161\\u017F\\u0219\\u02E2\\u1E61\\u1E63\\u1E65\\u1E67\\u1E69\\u1E9B\\u24E2\\uFF53]/gi,"," t: /[\\u0163\\u0165\\u021B\\u1D57\\u1E6B\\u1E6D\\u1E6F\\u1E71\\u1E97\\u24E3\\uFF54]/gi,"," u: /[\\u00F9-\\u00FC\\u0169\\u016B\\u016D\\u016F\\u0171\\u0173\\u01B0\\u01D4\\u01D6\\u01D8\\u01DA\\u01DC\\u0215\\u0217\\u1D58\\u1D64\\u1E73\\u1E75\\u1E77\\u1E79\\u1E7B\\u1EE5\\u1EE7\\u1EE9\\u1EEB\\u1EED\\u1EEF\\u1EF1\\u24E4\\uFF55]/gi,"," v: /[\\u1D5B\\u1D65\\u1E7D\\u1E7F\\u2174\\u24E5\\uFF56]/gi,"," w: /[\\u0175\\u02B7\\u1E81\\u1E83\\u1E85\\u1E87\\u1E89\\u1E98\\u24E6\\uFF57]/gi,"," x: /[\\u02E3\\u1E8B\\u1E8D\\u2093\\u2179\\u24E7\\uFF58]/gi,"," y: /[\\u00FD\\u00FF\\u0177\\u0233\\u02B8\\u1E8F\\u1E99\\u1EF3\\u1EF5\\u1EF7\\u1EF9\\u24E8\\uFF59]/gi,"," z: /[\\u017A\\u017C\\u017E\\u1DBB\\u1E91\\u1E93\\u1E95\\u24E9\\uFF5A]/gi","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/text-data-accentfold/text-data-accentfold.js"].lines = {"1":0,"6":0}; _yuitest_coverage["build/text-data-accentfold/text-data-accentfold.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/text-data-accentfold/text-data-accentfold.js"].coveredLines = 2;@@ -85,4 +85,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/text-data-accentfold/text-data-accentfold-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -49,4 +49,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/text-data-accentfold/text-data-accentfold-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("text-data-accentfold",function(e,t){e.namespace("Text.Data").AccentFold={0:/[\u2070\u2080\u24EA\uFF10]/gi,1:/[\u00B9\u2081\u2460\uFF11]/gi,2:/[\u00B2\u2082\u2461\uFF12]/gi,3:/[\u00B3\u2083\u2462\uFF13]/gi,4:/[\u2074\u2084\u2463\uFF14]/gi,5:/[\u2075\u2085\u2464\uFF15]/gi,6:/[\u2076\u2086\u2465\uFF16]/gi,7:/[\u2077\u2087\u2466\uFF17]/gi,8:/[\u2078\u2088\u2467\uFF18]/gi,9:/[\u2079\u2089\u2468\uFF19]/gi,a:/[\u00AA\u00E0-\u00E5\u0101\u0103\u0105\u01CE\u01DF\u01E1\u01FB\u0201\u0203\u0227\u1D43\u1E01\u1E9A\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u24D0\uFF41]/gi,b:/[\u1D47\u1E03\u1E05\u1E07\u24D1\uFF42]/gi,c:/[\u00E7\u0107\u0109\u010B\u010D\u1D9C\u1E09\u24D2\uFF43]/gi,d:/[\u010F\u1D48\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u217E\u24D3\uFF44]/gi,e:/[\u00E8-\u00EB\u0113\u0115\u0117\u0119\u011B\u0205\u0207\u0229\u1D49\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u2091\u212F\u24D4\uFF45]/gi,f:/[\u1DA0\u1E1F\u24D5\uFF46]/gi,g:/[\u011D\u011F\u0121\u0123\u01E7\u01F5\u1D4D\u1E21\u210A\u24D6\uFF47]/gi,h:/[\u0125\u021F\u02B0\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E96\u210E\u24D7\uFF48]/gi,i:/[\u00EC-\u00EF\u0129\u012B\u012D\u012F\u0133\u01D0\u0209\u020B\u1D62\u1E2D\u1E2F\u1EC9\u1ECB\u2071\u2139\u2170\u24D8\uFF49]/gi,j:/[\u0135\u01F0\u02B2\u24D9\u2C7C\uFF4A]/gi,k:/[\u0137\u01E9\u1D4F\u1E31\u1E33\u1E35\u24DA\uFF4B]/gi,l:/[\u013A\u013C\u013E\u0140\u01C9\u02E1\u1E37\u1E39\u1E3B\u1E3D\u2113\u217C\u24DB\uFF4C]/gi,m:/[\u1D50\u1E3F\u1E41\u1E43\u217F\u24DC\uFF4D]/gi,n:/[\u00F1\u0144\u0146\u0148\u01F9\u1E45\u1E47\u1E49\u1E4B\u207F\u24DD\uFF4E]/gi,o:/[\u00BA\u00F2-\u00F6\u014D\u014F\u0151\u01A1\u01D2\u01EB\u01ED\u020D\u020F\u022B\u022D\u022F\u0231\u1D52\u1E4D\u1E4F\u1E51\u1E53\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u2092\u2134\u24DE\uFF4F]/gi,p:/[\u1D56\u1E55\u1E57\u24DF\uFF50]/gi,q:/[\u02A0\u24E0\uFF51]/gi,r:/[\u0155\u0157\u0159\u0211\u0213\u02B3\u1D63\u1E59\u1E5B\u1E5D\u1E5F\u24E1\uFF52]/gi,s:/[\u015B\u015D\u015F\u0161\u017F\u0219\u02E2\u1E61\u1E63\u1E65\u1E67\u1E69\u1E9B\u24E2\uFF53]/gi,t:/[\u0163\u0165\u021B\u1D57\u1E6B\u1E6D\u1E6F\u1E71\u1E97\u24E3\uFF54]/gi,u:/[\u00F9-\u00FC\u0169\u016B\u016D\u016F\u0171\u0173\u01B0\u01D4\u01D6\u01D8\u01DA\u01DC\u0215\u0217\u1D58\u1D64\u1E73\u1E75\u1E77\u1E79\u1E7B\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u24E4\uFF55]/gi,v:/[\u1D5B\u1D65\u1E7D\u1E7F\u2174\u24E5\uFF56]/gi,w:/[\u0175\u02B7\u1E81\u1E83\u1E85\u1E87\u1E89\u1E98\u24E6\uFF57]/gi,x:/[\u02E3\u1E8B\u1E8D\u2093\u2179\u24E7\uFF58]/gi,y:/[\u00FD\u00FF\u0177\u0233\u02B8\u1E8F\u1E99\u1EF3\u1EF5\u1EF7\u1EF9\u24E8\uFF59]/gi,z:/[\u017A\u017C\u017E\u1DBB\u1E91\u1E93\u1E95\u24E9\uFF5A]/gi}},"3.7.2",{requires:["yui-base"]});+YUI.add("text-data-accentfold",function(e,t){e.namespace("Text.Data").AccentFold={0:/[\u2070\u2080\u24EA\uFF10]/gi,1:/[\u00B9\u2081\u2460\uFF11]/gi,2:/[\u00B2\u2082\u2461\uFF12]/gi,3:/[\u00B3\u2083\u2462\uFF13]/gi,4:/[\u2074\u2084\u2463\uFF14]/gi,5:/[\u2075\u2085\u2464\uFF15]/gi,6:/[\u2076\u2086\u2465\uFF16]/gi,7:/[\u2077\u2087\u2466\uFF17]/gi,8:/[\u2078\u2088\u2467\uFF18]/gi,9:/[\u2079\u2089\u2468\uFF19]/gi,a:/[\u00AA\u00E0-\u00E5\u0101\u0103\u0105\u01CE\u01DF\u01E1\u01FB\u0201\u0203\u0227\u1D43\u1E01\u1E9A\u1EA1\u1EA3\u1EA5\u1EA7\u1EA9\u1EAB\u1EAD\u1EAF\u1EB1\u1EB3\u1EB5\u1EB7\u24D0\uFF41]/gi,b:/[\u1D47\u1E03\u1E05\u1E07\u24D1\uFF42]/gi,c:/[\u00E7\u0107\u0109\u010B\u010D\u1D9C\u1E09\u24D2\uFF43]/gi,d:/[\u010F\u1D48\u1E0B\u1E0D\u1E0F\u1E11\u1E13\u217E\u24D3\uFF44]/gi,e:/[\u00E8-\u00EB\u0113\u0115\u0117\u0119\u011B\u0205\u0207\u0229\u1D49\u1E15\u1E17\u1E19\u1E1B\u1E1D\u1EB9\u1EBB\u1EBD\u1EBF\u1EC1\u1EC3\u1EC5\u1EC7\u2091\u212F\u24D4\uFF45]/gi,f:/[\u1DA0\u1E1F\u24D5\uFF46]/gi,g:/[\u011D\u011F\u0121\u0123\u01E7\u01F5\u1D4D\u1E21\u210A\u24D6\uFF47]/gi,h:/[\u0125\u021F\u02B0\u1E23\u1E25\u1E27\u1E29\u1E2B\u1E96\u210E\u24D7\uFF48]/gi,i:/[\u00EC-\u00EF\u0129\u012B\u012D\u012F\u0133\u01D0\u0209\u020B\u1D62\u1E2D\u1E2F\u1EC9\u1ECB\u2071\u2139\u2170\u24D8\uFF49]/gi,j:/[\u0135\u01F0\u02B2\u24D9\u2C7C\uFF4A]/gi,k:/[\u0137\u01E9\u1D4F\u1E31\u1E33\u1E35\u24DA\uFF4B]/gi,l:/[\u013A\u013C\u013E\u0140\u01C9\u02E1\u1E37\u1E39\u1E3B\u1E3D\u2113\u217C\u24DB\uFF4C]/gi,m:/[\u1D50\u1E3F\u1E41\u1E43\u217F\u24DC\uFF4D]/gi,n:/[\u00F1\u0144\u0146\u0148\u01F9\u1E45\u1E47\u1E49\u1E4B\u207F\u24DD\uFF4E]/gi,o:/[\u00BA\u00F2-\u00F6\u014D\u014F\u0151\u01A1\u01D2\u01EB\u01ED\u020D\u020F\u022B\u022D\u022F\u0231\u1D52\u1E4D\u1E4F\u1E51\u1E53\u1ECD\u1ECF\u1ED1\u1ED3\u1ED5\u1ED7\u1ED9\u1EDB\u1EDD\u1EDF\u1EE1\u1EE3\u2092\u2134\u24DE\uFF4F]/gi,p:/[\u1D56\u1E55\u1E57\u24DF\uFF50]/gi,q:/[\u02A0\u24E0\uFF51]/gi,r:/[\u0155\u0157\u0159\u0211\u0213\u02B3\u1D63\u1E59\u1E5B\u1E5D\u1E5F\u24E1\uFF52]/gi,s:/[\u015B\u015D\u015F\u0161\u017F\u0219\u02E2\u1E61\u1E63\u1E65\u1E67\u1E69\u1E9B\u24E2\uFF53]/gi,t:/[\u0163\u0165\u021B\u1D57\u1E6B\u1E6D\u1E6F\u1E71\u1E97\u24E3\uFF54]/gi,u:/[\u00F9-\u00FC\u0169\u016B\u016D\u016F\u0171\u0173\u01B0\u01D4\u01D6\u01D8\u01DA\u01DC\u0215\u0217\u1D58\u1D64\u1E73\u1E75\u1E77\u1E79\u1E7B\u1EE5\u1EE7\u1EE9\u1EEB\u1EED\u1EEF\u1EF1\u24E4\uFF55]/gi,v:/[\u1D5B\u1D65\u1E7D\u1E7F\u2174\u24E5\uFF56]/gi,w:/[\u0175\u02B7\u1E81\u1E83\u1E85\u1E87\u1E89\u1E98\u24E6\uFF57]/gi,x:/[\u02E3\u1E8B\u1E8D\u2093\u2179\u24E7\uFF58]/gi,y:/[\u00FD\u00FF\u0177\u0233\u02B8\u1E8F\u1E99\u1EF3\u1EF5\u1EF7\u1EF9\u24E8\uFF59]/gi,z:/[\u017A\u017C\u017E\u1DBB\u1E91\u1E93\u1E95\u24E9\uFF5A]/gi}},"3.7.3",{requires:["yui-base"]});
bundle/text-data-accentfold/text-data-accentfold.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -49,4 +49,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/text-data-wordbreak/text-data-wordbreak-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/text-data-wordbreak/text-data-wordbreak.js", code: [] };-_yuitest_coverage["build/text-data-wordbreak/text-data-wordbreak.js"].code=["YUI.add('text-data-wordbreak', function (Y, NAME) {","","Y.namespace('Text.Data').WordBreak = {"," // The UnicodeSet utility is helpful for enumerating the specific code"," // points covered by each of these regular expressions:"," // http://unicode.org/cldr/utility/list-unicodeset.jsp"," //"," // The code sets from which these regexes were derived can be generated"," // by the UnicodeSet utility using the links here:"," // http://unicode.org/cldr/utility/properties.jsp?a=Word_Break#Word_Break","",""," aletter : '[A-Za-z\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F3\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BC0-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u24B6-\\u24E9\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u303B\\u303C\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790\\uA791\\uA7A0-\\uA7A9\\uA7FA-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]',"," midnumlet : \"['\\\\.\\u2018\\u2019\\u2024\\uFE52\\uFF07\\uFF0E]\","," midletter : '[:\\u00B7\\u00B7\\u05F4\\u2027\\uFE13\\uFE55\\uFF1A]',"," midnum : '[,;;\\u0589\\u060C\\u060D\\u066C\\u07F8\\u2044\\uFE10\\uFE14\\uFE50\\uFE54\\uFF0C\\uFF1B]',"," numeric : '[0-9\\u0660-\\u0669\\u066B\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9]',"," cr : '\\\\r',"," lf : '\\\\n',"," newline : '[\\u000B\\u000C\\u0085\\u2028\\u2029]',"," extend : '[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B6-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAA\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFF9E\\uFF9F]',"," format : '[\\u00AD\\u0600-\\u0603\\u06DD\\u070F\\u17B4\\u17B5\\u200E\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u206A-\\u206F\\uFEFF\\uFFF9-\\uFFFB]',"," katakana : '[\\u3031-\\u3035\\u309B\\u309C\\u30A0-\\u30FA\\u30FC-\\u30FF\\u31F0-\\u31FF\\u32D0-\\u32FE\\u3300-\\u3357\\uFF66-\\uFF9D]',"," extendnumlet: '[_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]',"," punctuation : '[!-#%-*,-\\\\/:;?@\\\\[-\\\\]_{}\\u00A1\\u00AB\\u00B7\\u00BB\\u00BF;\\u00B7\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1361-\\u1368\\u1400\\u166D\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u3008\\u3009\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30\\u2E31\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]'","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/text-data-wordbreak/text-data-wordbreak.js"].code=["YUI.add('text-data-wordbreak', function (Y, NAME) {","","Y.namespace('Text.Data').WordBreak = {"," // The UnicodeSet utility is helpful for enumerating the specific code"," // points covered by each of these regular expressions:"," // http://unicode.org/cldr/utility/list-unicodeset.jsp"," //"," // The code sets from which these regexes were derived can be generated"," // by the UnicodeSet utility using the links here:"," // http://unicode.org/cldr/utility/properties.jsp?a=Word_Break#Word_Break","",""," aletter : '[A-Za-z\\u00AA\\u00B5\\u00BA\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F3\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097F\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u10A0-\\u10C5\\u10D0-\\u10FA\\u10FC\\u1100-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F0\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191C\\u1A00-\\u1A16\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BC0-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u24B6-\\u24E9\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2D00-\\u2D25\\u2D30-\\u2D65\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u303B\\u303C\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA697\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790\\uA791\\uA7A0-\\uA7A9\\uA7FA-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFFA0-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]',"," midnumlet : \"['\\\\.\\u2018\\u2019\\u2024\\uFE52\\uFF07\\uFF0E]\","," midletter : '[:\\u00B7\\u00B7\\u05F4\\u2027\\uFE13\\uFE55\\uFF1A]',"," midnum : '[,;;\\u0589\\u060C\\u060D\\u066C\\u07F8\\u2044\\uFE10\\uFE14\\uFE50\\uFE54\\uFF0C\\uFF1B]',"," numeric : '[0-9\\u0660-\\u0669\\u066B\\u06F0-\\u06F9\\u07C0-\\u07C9\\u0966-\\u096F\\u09E6-\\u09EF\\u0A66-\\u0A6F\\u0AE6-\\u0AEF\\u0B66-\\u0B6F\\u0BE6-\\u0BEF\\u0C66-\\u0C6F\\u0CE6-\\u0CEF\\u0D66-\\u0D6F\\u0E50-\\u0E59\\u0ED0-\\u0ED9\\u0F20-\\u0F29\\u1040-\\u1049\\u1090-\\u1099\\u17E0-\\u17E9\\u1810-\\u1819\\u1946-\\u194F\\u19D0-\\u19D9\\u1A80-\\u1A89\\u1A90-\\u1A99\\u1B50-\\u1B59\\u1BB0-\\u1BB9\\u1C40-\\u1C49\\u1C50-\\u1C59\\uA620-\\uA629\\uA8D0-\\uA8D9\\uA900-\\uA909\\uA9D0-\\uA9D9\\uAA50-\\uAA59\\uABF0-\\uABF9]',"," cr : '\\\\r',"," lf : '\\\\n',"," newline : '[\\u000B\\u000C\\u0085\\u2028\\u2029]',"," extend : '[\\u0300-\\u036F\\u0483-\\u0489\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u0610-\\u061A\\u064B-\\u065F\\u0670\\u06D6-\\u06DC\\u06DF-\\u06E4\\u06E7\\u06E8\\u06EA-\\u06ED\\u0711\\u0730-\\u074A\\u07A6-\\u07B0\\u07EB-\\u07F3\\u0816-\\u0819\\u081B-\\u0823\\u0825-\\u0827\\u0829-\\u082D\\u0859-\\u085B\\u0900-\\u0903\\u093A-\\u093C\\u093E-\\u094F\\u0951-\\u0957\\u0962\\u0963\\u0981-\\u0983\\u09BC\\u09BE-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CD\\u09D7\\u09E2\\u09E3\\u0A01-\\u0A03\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A70\\u0A71\\u0A75\\u0A81-\\u0A83\\u0ABC\\u0ABE-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AE2\\u0AE3\\u0B01-\\u0B03\\u0B3C\\u0B3E-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B62\\u0B63\\u0B82\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD7\\u0C01-\\u0C03\\u0C3E-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C62\\u0C63\\u0C82\\u0C83\\u0CBC\\u0CBE-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CE2\\u0CE3\\u0D02\\u0D03\\u0D3E-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4D\\u0D57\\u0D62\\u0D63\\u0D82\\u0D83\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DF2\\u0DF3\\u0E31\\u0E34-\\u0E3A\\u0E47-\\u0E4E\\u0EB1\\u0EB4-\\u0EB9\\u0EBB\\u0EBC\\u0EC8-\\u0ECD\\u0F18\\u0F19\\u0F35\\u0F37\\u0F39\\u0F3E\\u0F3F\\u0F71-\\u0F84\\u0F86\\u0F87\\u0F8D-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u102B-\\u103E\\u1056-\\u1059\\u105E-\\u1060\\u1062-\\u1064\\u1067-\\u106D\\u1071-\\u1074\\u1082-\\u108D\\u108F\\u109A-\\u109D\\u135D-\\u135F\\u1712-\\u1714\\u1732-\\u1734\\u1752\\u1753\\u1772\\u1773\\u17B6-\\u17D3\\u17DD\\u180B-\\u180D\\u18A9\\u1920-\\u192B\\u1930-\\u193B\\u19B0-\\u19C0\\u19C8\\u19C9\\u1A17-\\u1A1B\\u1A55-\\u1A5E\\u1A60-\\u1A7C\\u1A7F\\u1B00-\\u1B04\\u1B34-\\u1B44\\u1B6B-\\u1B73\\u1B80-\\u1B82\\u1BA1-\\u1BAA\\u1BE6-\\u1BF3\\u1C24-\\u1C37\\u1CD0-\\u1CD2\\u1CD4-\\u1CE8\\u1CED\\u1CF2\\u1DC0-\\u1DE6\\u1DFC-\\u1DFF\\u200C\\u200D\\u20D0-\\u20F0\\u2CEF-\\u2CF1\\u2D7F\\u2DE0-\\u2DFF\\u302A-\\u302F\\u3099\\u309A\\uA66F-\\uA672\\uA67C\\uA67D\\uA6F0\\uA6F1\\uA802\\uA806\\uA80B\\uA823-\\uA827\\uA880\\uA881\\uA8B4-\\uA8C4\\uA8E0-\\uA8F1\\uA926-\\uA92D\\uA947-\\uA953\\uA980-\\uA983\\uA9B3-\\uA9C0\\uAA29-\\uAA36\\uAA43\\uAA4C\\uAA4D\\uAA7B\\uAAB0\\uAAB2-\\uAAB4\\uAAB7\\uAAB8\\uAABE\\uAABF\\uAAC1\\uABE3-\\uABEA\\uABEC\\uABED\\uFB1E\\uFE00-\\uFE0F\\uFE20-\\uFE26\\uFF9E\\uFF9F]',"," format : '[\\u00AD\\u0600-\\u0603\\u06DD\\u070F\\u17B4\\u17B5\\u200E\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u206A-\\u206F\\uFEFF\\uFFF9-\\uFFFB]',"," katakana : '[\\u3031-\\u3035\\u309B\\u309C\\u30A0-\\u30FA\\u30FC-\\u30FF\\u31F0-\\u31FF\\u32D0-\\u32FE\\u3300-\\u3357\\uFF66-\\uFF9D]',"," extendnumlet: '[_\\u203F\\u2040\\u2054\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFF3F]',"," punctuation : '[!-#%-*,-\\\\/:;?@\\\\[-\\\\]_{}\\u00A1\\u00AB\\u00B7\\u00BB\\u00BF;\\u00B7\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061E\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1361-\\u1368\\u1400\\u166D\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u3008\\u3009\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30\\u2E31\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]'","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/text-data-wordbreak/text-data-wordbreak.js"].lines = {"1":0,"3":0}; _yuitest_coverage["build/text-data-wordbreak/text-data-wordbreak.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/text-data-wordbreak/text-data-wordbreak.js"].coveredLines = 2;@@ -68,4 +68,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/text-data-wordbreak/text-data-wordbreak-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,4 +32,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/text-data-wordbreak/text-data-wordbreak-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("text-data-wordbreak",function(e,t){e.namespace("Text.Data").WordBreak={aletter:"[A-Za-z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]",midnumlet:"['\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",midletter:"[:\u00b7\u00b7\u05f4\u2027\ufe13\ufe55\uff1a]",midnum:"[,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",numeric:"[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",cr:"\\r",lf:"\\n",newline:"[\f\u0085\u2028\u2029]",extend:"[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",format:"[\u00ad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",katakana:"[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",extendnumlet:"[_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f]",punctuation:"[!-#%-*,-\\/:;?@\\[-\\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]"}},"3.7.2",{requires:["yui-base"]});+YUI.add("text-data-wordbreak",function(e,t){e.namespace("Text.Data").WordBreak={aletter:"[A-Za-z\u00aa\u00b5\u00ba\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f3\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u10a0-\u10c5\u10d0-\u10fa\u10fc\u1100-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1a00-\u1a16\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bc0-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u24b6-\u24e9\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2d00-\u2d25\u2d30-\u2d65\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005\u303b\u303c\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790\ua791\ua7a0-\ua7a9\ua7fa-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uffa0-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]",midnumlet:"['\\.\u2018\u2019\u2024\ufe52\uff07\uff0e]",midletter:"[:\u00b7\u00b7\u05f4\u2027\ufe13\ufe55\uff1a]",midnum:"[,;;\u0589\u060c\u060d\u066c\u07f8\u2044\ufe10\ufe14\ufe50\ufe54\uff0c\uff1b]",numeric:"[0-9\u0660-\u0669\u066b\u06f0-\u06f9\u07c0-\u07c9\u0966-\u096f\u09e6-\u09ef\u0a66-\u0a6f\u0ae6-\u0aef\u0b66-\u0b6f\u0be6-\u0bef\u0c66-\u0c6f\u0ce6-\u0cef\u0d66-\u0d6f\u0e50-\u0e59\u0ed0-\u0ed9\u0f20-\u0f29\u1040-\u1049\u1090-\u1099\u17e0-\u17e9\u1810-\u1819\u1946-\u194f\u19d0-\u19d9\u1a80-\u1a89\u1a90-\u1a99\u1b50-\u1b59\u1bb0-\u1bb9\u1c40-\u1c49\u1c50-\u1c59\ua620-\ua629\ua8d0-\ua8d9\ua900-\ua909\ua9d0-\ua9d9\uaa50-\uaa59\uabf0-\uabf9]",cr:"\\r",lf:"\\n",newline:"[\f\u0085\u2028\u2029]",extend:"[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f\u109a-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b6-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u192b\u1930-\u193b\u19b0-\u19c0\u19c8\u19c9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f\u1b00-\u1b04\u1b34-\u1b44\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1baa\u1be6-\u1bf3\u1c24-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe3-\uabea\uabec\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]",format:"[\u00ad\u0600-\u0603\u06dd\u070f\u17b4\u17b5\u200e\u200f\u202a-\u202e\u2060-\u2064\u206a-\u206f\ufeff\ufff9-\ufffb]",katakana:"[\u3031-\u3035\u309b\u309c\u30a0-\u30fa\u30fc-\u30ff\u31f0-\u31ff\u32d0-\u32fe\u3300-\u3357\uff66-\uff9d]",extendnumlet:"[_\u203f\u2040\u2054\ufe33\ufe34\ufe4d-\ufe4f\uff3f]",punctuation:"[!-#%-*,-\\/:;?@\\[-\\]_{}\u00a1\u00ab\u00b7\u00bb\u00bf;\u00b7\u055a-\u055f\u0589\u058a\u05be\u05c0\u05c3\u05c6\u05f3\u05f4\u0609\u060a\u060c\u060d\u061b\u061e\u061f\u066a-\u066d\u06d4\u0700-\u070d\u07f7-\u07f9\u0830-\u083e\u085e\u0964\u0965\u0970\u0df4\u0e4f\u0e5a\u0e5b\u0f04-\u0f12\u0f3a-\u0f3d\u0f85\u0fd0-\u0fd4\u0fd9\u0fda\u104a-\u104f\u10fb\u1361-\u1368\u1400\u166d\u166e\u169b\u169c\u16eb-\u16ed\u1735\u1736\u17d4-\u17d6\u17d8-\u17da\u1800-\u180a\u1944\u1945\u1a1e\u1a1f\u1aa0-\u1aa6\u1aa8-\u1aad\u1b5a-\u1b60\u1bfc-\u1bff\u1c3b-\u1c3f\u1c7e\u1c7f\u1cd3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205e\u207d\u207e\u208d\u208e\u3008\u3009\u2768-\u2775\u27c5\u27c6\u27e6-\u27ef\u2983-\u2998\u29d8-\u29db\u29fc\u29fd\u2cf9-\u2cfc\u2cfe\u2cff\u2d70\u2e00-\u2e2e\u2e30\u2e31\u3001-\u3003\u3008-\u3011\u3014-\u301f\u3030\u303d\u30a0\u30fb\ua4fe\ua4ff\ua60d-\ua60f\ua673\ua67e\ua6f2-\ua6f7\ua874-\ua877\ua8ce\ua8cf\ua8f8-\ua8fa\ua92e\ua92f\ua95f\ua9c1-\ua9cd\ua9de\ua9df\uaa5c-\uaa5f\uaade\uaadf\uabeb\ufd3e\ufd3f\ufe10-\ufe19\ufe30-\ufe52\ufe54-\ufe61\ufe63\ufe68\ufe6a\ufe6b\uff01-\uff03\uff05-\uff0a\uff0c-\uff0f\uff1a\uff1b\uff1f\uff20\uff3b-\uff3d\uff3f\uff5b\uff5d\uff5f-\uff65]"}},"3.7.3",{requires:["yui-base"]});
bundle/text-data-wordbreak/text-data-wordbreak.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,4 +32,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/text-wordbreak/text-wordbreak-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/text-wordbreak/text-wordbreak.js", code: [] };-_yuitest_coverage["build/text-wordbreak/text-wordbreak.js"].code=["YUI.add('text-wordbreak', function (Y, NAME) {","","/**"," * Provides utility methods for splitting strings on word breaks and determining"," * whether a character index represents a word boundary."," *"," * @module text"," * @submodule text-wordbreak"," */","","/**"," * <p>"," * Provides utility methods for splitting strings on word breaks and determining"," * whether a character index represents a word boundary, using the generic word"," * breaking algorithm defined in the Unicode Text Segmentation guidelines"," * (<a href=\"http://unicode.org/reports/tr29/#Word_Boundaries\">Unicode Standard"," * Annex #29</a>)."," * </p>"," *"," * <p>"," * This algorithm provides a reasonable default for many languages. However, it"," * does not cover language or context specific requirements, and it does not"," * provide meaningful results at all for languages that don't use spaces between"," * words, such as Chinese, Japanese, Thai, Lao, Khmer, and others. Server-based"," * word breaking services usually provide significantly better results with"," * better performance."," * </p>"," *"," * @class Text.WordBreak"," * @static"," */","","var Text = Y.Text,"," WBData = Text.Data.WordBreak,","","// Constants representing code point classifications.","ALETTER = 0,","MIDNUMLET = 1,","MIDLETTER = 2,","MIDNUM = 3,","NUMERIC = 4,","CR = 5,","LF = 6,","NEWLINE = 7,","EXTEND = 8,","FORMAT = 9,","KATAKANA = 10,","EXTENDNUMLET = 11,","OTHER = 12,","","// RegExp objects generated from code point data. Each regex matches a single","// character against a set of Unicode code points. The index of each item in","// this array must match its corresponding code point constant value defined","// above.","SETS = ["," new RegExp(WBData.aletter),"," new RegExp(WBData.midnumlet),"," new RegExp(WBData.midletter),"," new RegExp(WBData.midnum),"," new RegExp(WBData.numeric),"," new RegExp(WBData.cr),"," new RegExp(WBData.lf),"," new RegExp(WBData.newline),"," new RegExp(WBData.extend),"," new RegExp(WBData.format),"," new RegExp(WBData.katakana),"," new RegExp(WBData.extendnumlet)","],","","EMPTY_STRING = '',","PUNCTUATION = new RegExp('^' + WBData.punctuation + '$'),","WHITESPACE = /\\s/,","","WordBreak = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," * Splits the specified string into an array of individual words."," *"," * @method getWords"," * @param {String} string String to split."," * @param {Object} options (optional) Options object containing zero or more"," * of the following properties:"," *"," * <dl>"," * <dt>ignoreCase (Boolean)</dt>"," * <dd>"," * If <code>true</code>, the string will be converted to lowercase"," * before being split. Default is <code>false</code>."," * </dd>"," *"," * <dt>includePunctuation (Boolean)</dt>"," * <dd>"," * If <code>true</code>, the returned array will include punctuation"," * characters. Default is <code>false</code>."," * </dd>"," *"," * <dt>includeWhitespace (Boolean)</dt>"," * <dd>"," * If <code>true</code>, the returned array will include whitespace"," * characters. Default is <code>false</code>."," * </dd>"," * </dl>"," * @return {Array} Array of words."," * @static"," */"," getWords: function (string, options) {"," var i = 0,"," map = WordBreak._classify(string),"," len = map.length,"," word = [],"," words = [],"," chr,"," includePunctuation,"," includeWhitespace;",""," if (!options) {"," options = {};"," }",""," if (options.ignoreCase) {"," string = string.toLowerCase();"," }",""," includePunctuation = options.includePunctuation;"," includeWhitespace = options.includeWhitespace;",""," // Loop through each character in the classification map and determine"," // whether it precedes a word boundary, building an array of distinct"," // words as we go."," for (; i < len; ++i) {"," chr = string.charAt(i);",""," // Append this character to the current word."," word.push(chr);",""," // If there's a word boundary between the current character and the"," // next character, append the current word to the words array and"," // start building a new word. "," if (WordBreak._isWordBoundary(map, i)) {"," word = word.join(EMPTY_STRING);",""," if (word &&"," (includeWhitespace || !WHITESPACE.test(word)) &&"," (includePunctuation || !PUNCTUATION.test(word))) {"," words.push(word);"," }",""," word = [];"," }"," }",""," return words;"," },",""," /**"," * Returns an array containing only unique words from the specified string."," * For example, the string <code>'foo bar baz foo'</code> would result in"," * the array <code>['foo', 'bar', 'baz']</code>."," *"," * @method getUniqueWords"," * @param {String} string String to split."," * @param {Object} options (optional) Options (see <code>getWords()</code>"," * for details)."," * @return {Array} Array of unique words."," * @static"," */"," getUniqueWords: function (string, options) {"," return Y.Array.unique(WordBreak.getWords(string, options));"," },",""," /**"," * <p>"," * Returns <code>true</code> if there is a word boundary between the"," * specified character index and the next character index (or the end of the"," * string)."," * </p>"," *"," * <p>"," * Note that there are always word breaks at the beginning and end of a"," * string, so <code>isWordBoundary('', 0)</code> and"," * <code>isWordBoundary('a', 0)</code> will both return <code>true</code>."," * </p>"," *"," * @method isWordBoundary"," * @param {String} string String to test."," * @param {Number} index Character index to test within the string."," * @return {Boolean} <code>true</code> for a word boundary,"," * <code>false</code> otherwise."," * @static"," */"," isWordBoundary: function (string, index) {"," return WordBreak._isWordBoundary(WordBreak._classify(string), index);"," },",""," // -- Protected Static Methods ---------------------------------------------",""," /**"," * Returns a character classification map for the specified string."," *"," * @method _classify"," * @param {String} string String to classify."," * @return {Array} Classification map."," * @protected"," * @static"," */"," _classify: function (string) {"," var chr,"," map = [],"," i = 0,"," j,"," set,"," stringLength = string.length,"," setsLength = SETS.length,"," type;",""," for (; i < stringLength; ++i) {"," chr = string.charAt(i);"," type = OTHER;",""," for (j = 0; j < setsLength; ++j) {"," set = SETS[j];",""," if (set && set.test(chr)) {"," type = j;"," break;"," }"," }",""," map.push(type);"," }",""," return map;"," },",""," /**"," * <p>"," * Returns <code>true</code> if there is a word boundary between the"," * specified character index and the next character index (or the end of the"," * string)."," * </p>"," *"," * <p>"," * Note that there are always word breaks at the beginning and end of a"," * string, so <code>_isWordBoundary('', 0)</code> and"," * <code>_isWordBoundary('a', 0)</code> will both return <code>true</code>."," * </p>"," *"," * @method _isWordBoundary"," * @param {Array} map Character classification map generated by"," * <code>_classify</code>."," * @param {Number} index Character index to test."," * @return {Boolean}"," * @protected"," * @static"," */"," _isWordBoundary: function (map, index) {"," var prevType,"," type = map[index],"," nextType = map[index + 1],"," nextNextType;",""," if (index < 0 || (index > map.length - 1 && index !== 0)) {"," return false;"," }",""," // WB5. Don't break between most letters."," if (type === ALETTER && nextType === ALETTER) {"," return false;"," }",""," nextNextType = map[index + 2];",""," // WB6. Don't break letters across certain punctuation."," if (type === ALETTER &&"," (nextType === MIDLETTER || nextType === MIDNUMLET) &&"," nextNextType === ALETTER) {"," return false;"," }",""," prevType = map[index - 1];",""," // WB7. Don't break letters across certain punctuation."," if ((type === MIDLETTER || type === MIDNUMLET) &&"," nextType === ALETTER &&"," prevType === ALETTER) {"," return false;"," }",""," // WB8/WB9/WB10. Don't break inside sequences of digits or digits"," // adjacent to letters."," if ((type === NUMERIC || type === ALETTER) &&"," (nextType === NUMERIC || nextType === ALETTER)) {"," return false;"," }",""," // WB11. Don't break inside numeric sequences like \"3.2\" or"," // \"3,456.789\"."," if ((type === MIDNUM || type === MIDNUMLET) &&"," nextType === NUMERIC &&"," prevType === NUMERIC) {"," return false;"," }",""," // WB12. Don't break inside numeric sequences like \"3.2\" or"," // \"3,456.789\"."," if (type === NUMERIC &&"," (nextType === MIDNUM || nextType === MIDNUMLET) &&"," nextNextType === NUMERIC) {"," return false;"," }",""," // WB4. Ignore format and extend characters."," if (type === EXTEND || type === FORMAT ||"," prevType === EXTEND || prevType === FORMAT ||"," nextType === EXTEND || nextType === FORMAT) {"," return false;"," }",""," // WB3. Don't break inside CRLF."," if (type === CR && nextType === LF) {"," return false;"," }",""," // WB3a. Break before newlines (including CR and LF)."," if (type === NEWLINE || type === CR || type === LF) {"," return true;"," }",""," // WB3b. Break after newlines (including CR and LF)."," if (nextType === NEWLINE || nextType === CR || nextType === LF) {"," return true;"," }",""," // WB13. Don't break between Katakana characters."," if (type === KATAKANA && nextType === KATAKANA) {"," return false;"," }",""," // WB13a. Don't break from extenders."," if (nextType === EXTENDNUMLET &&"," (type === ALETTER || type === NUMERIC || type === KATAKANA ||"," type === EXTENDNUMLET)) {"," return false;"," }",""," // WB13b. Don't break from extenders."," if (type === EXTENDNUMLET &&"," (nextType === ALETTER || nextType === NUMERIC ||"," nextType === KATAKANA)) {"," return false;"," }",""," // Break after any character not covered by the rules above."," return true;"," }","};","","Text.WordBreak = WordBreak;","","","}, '3.7.2', {\"requires\": [\"array-extras\", \"text-data-wordbreak\"]});"];+_yuitest_coverage["build/text-wordbreak/text-wordbreak.js"].code=["YUI.add('text-wordbreak', function (Y, NAME) {","","/**"," * Provides utility methods for splitting strings on word breaks and determining"," * whether a character index represents a word boundary."," *"," * @module text"," * @submodule text-wordbreak"," */","","/**"," * <p>"," * Provides utility methods for splitting strings on word breaks and determining"," * whether a character index represents a word boundary, using the generic word"," * breaking algorithm defined in the Unicode Text Segmentation guidelines"," * (<a href=\"http://unicode.org/reports/tr29/#Word_Boundaries\">Unicode Standard"," * Annex #29</a>)."," * </p>"," *"," * <p>"," * This algorithm provides a reasonable default for many languages. However, it"," * does not cover language or context specific requirements, and it does not"," * provide meaningful results at all for languages that don't use spaces between"," * words, such as Chinese, Japanese, Thai, Lao, Khmer, and others. Server-based"," * word breaking services usually provide significantly better results with"," * better performance."," * </p>"," *"," * @class Text.WordBreak"," * @static"," */","","var Text = Y.Text,"," WBData = Text.Data.WordBreak,","","// Constants representing code point classifications.","ALETTER = 0,","MIDNUMLET = 1,","MIDLETTER = 2,","MIDNUM = 3,","NUMERIC = 4,","CR = 5,","LF = 6,","NEWLINE = 7,","EXTEND = 8,","FORMAT = 9,","KATAKANA = 10,","EXTENDNUMLET = 11,","OTHER = 12,","","// RegExp objects generated from code point data. Each regex matches a single","// character against a set of Unicode code points. The index of each item in","// this array must match its corresponding code point constant value defined","// above.","SETS = ["," new RegExp(WBData.aletter),"," new RegExp(WBData.midnumlet),"," new RegExp(WBData.midletter),"," new RegExp(WBData.midnum),"," new RegExp(WBData.numeric),"," new RegExp(WBData.cr),"," new RegExp(WBData.lf),"," new RegExp(WBData.newline),"," new RegExp(WBData.extend),"," new RegExp(WBData.format),"," new RegExp(WBData.katakana),"," new RegExp(WBData.extendnumlet)","],","","EMPTY_STRING = '',","PUNCTUATION = new RegExp('^' + WBData.punctuation + '$'),","WHITESPACE = /\\s/,","","WordBreak = {"," // -- Public Static Methods ------------------------------------------------",""," /**"," * Splits the specified string into an array of individual words."," *"," * @method getWords"," * @param {String} string String to split."," * @param {Object} options (optional) Options object containing zero or more"," * of the following properties:"," *"," * <dl>"," * <dt>ignoreCase (Boolean)</dt>"," * <dd>"," * If <code>true</code>, the string will be converted to lowercase"," * before being split. Default is <code>false</code>."," * </dd>"," *"," * <dt>includePunctuation (Boolean)</dt>"," * <dd>"," * If <code>true</code>, the returned array will include punctuation"," * characters. Default is <code>false</code>."," * </dd>"," *"," * <dt>includeWhitespace (Boolean)</dt>"," * <dd>"," * If <code>true</code>, the returned array will include whitespace"," * characters. Default is <code>false</code>."," * </dd>"," * </dl>"," * @return {Array} Array of words."," * @static"," */"," getWords: function (string, options) {"," var i = 0,"," map = WordBreak._classify(string),"," len = map.length,"," word = [],"," words = [],"," chr,"," includePunctuation,"," includeWhitespace;",""," if (!options) {"," options = {};"," }",""," if (options.ignoreCase) {"," string = string.toLowerCase();"," }",""," includePunctuation = options.includePunctuation;"," includeWhitespace = options.includeWhitespace;",""," // Loop through each character in the classification map and determine"," // whether it precedes a word boundary, building an array of distinct"," // words as we go."," for (; i < len; ++i) {"," chr = string.charAt(i);",""," // Append this character to the current word."," word.push(chr);",""," // If there's a word boundary between the current character and the"," // next character, append the current word to the words array and"," // start building a new word. "," if (WordBreak._isWordBoundary(map, i)) {"," word = word.join(EMPTY_STRING);",""," if (word &&"," (includeWhitespace || !WHITESPACE.test(word)) &&"," (includePunctuation || !PUNCTUATION.test(word))) {"," words.push(word);"," }",""," word = [];"," }"," }",""," return words;"," },",""," /**"," * Returns an array containing only unique words from the specified string."," * For example, the string <code>'foo bar baz foo'</code> would result in"," * the array <code>['foo', 'bar', 'baz']</code>."," *"," * @method getUniqueWords"," * @param {String} string String to split."," * @param {Object} options (optional) Options (see <code>getWords()</code>"," * for details)."," * @return {Array} Array of unique words."," * @static"," */"," getUniqueWords: function (string, options) {"," return Y.Array.unique(WordBreak.getWords(string, options));"," },",""," /**"," * <p>"," * Returns <code>true</code> if there is a word boundary between the"," * specified character index and the next character index (or the end of the"," * string)."," * </p>"," *"," * <p>"," * Note that there are always word breaks at the beginning and end of a"," * string, so <code>isWordBoundary('', 0)</code> and"," * <code>isWordBoundary('a', 0)</code> will both return <code>true</code>."," * </p>"," *"," * @method isWordBoundary"," * @param {String} string String to test."," * @param {Number} index Character index to test within the string."," * @return {Boolean} <code>true</code> for a word boundary,"," * <code>false</code> otherwise."," * @static"," */"," isWordBoundary: function (string, index) {"," return WordBreak._isWordBoundary(WordBreak._classify(string), index);"," },",""," // -- Protected Static Methods ---------------------------------------------",""," /**"," * Returns a character classification map for the specified string."," *"," * @method _classify"," * @param {String} string String to classify."," * @return {Array} Classification map."," * @protected"," * @static"," */"," _classify: function (string) {"," var chr,"," map = [],"," i = 0,"," j,"," set,"," stringLength = string.length,"," setsLength = SETS.length,"," type;",""," for (; i < stringLength; ++i) {"," chr = string.charAt(i);"," type = OTHER;",""," for (j = 0; j < setsLength; ++j) {"," set = SETS[j];",""," if (set && set.test(chr)) {"," type = j;"," break;"," }"," }",""," map.push(type);"," }",""," return map;"," },",""," /**"," * <p>"," * Returns <code>true</code> if there is a word boundary between the"," * specified character index and the next character index (or the end of the"," * string)."," * </p>"," *"," * <p>"," * Note that there are always word breaks at the beginning and end of a"," * string, so <code>_isWordBoundary('', 0)</code> and"," * <code>_isWordBoundary('a', 0)</code> will both return <code>true</code>."," * </p>"," *"," * @method _isWordBoundary"," * @param {Array} map Character classification map generated by"," * <code>_classify</code>."," * @param {Number} index Character index to test."," * @return {Boolean}"," * @protected"," * @static"," */"," _isWordBoundary: function (map, index) {"," var prevType,"," type = map[index],"," nextType = map[index + 1],"," nextNextType;",""," if (index < 0 || (index > map.length - 1 && index !== 0)) {"," return false;"," }",""," // WB5. Don't break between most letters."," if (type === ALETTER && nextType === ALETTER) {"," return false;"," }",""," nextNextType = map[index + 2];",""," // WB6. Don't break letters across certain punctuation."," if (type === ALETTER &&"," (nextType === MIDLETTER || nextType === MIDNUMLET) &&"," nextNextType === ALETTER) {"," return false;"," }",""," prevType = map[index - 1];",""," // WB7. Don't break letters across certain punctuation."," if ((type === MIDLETTER || type === MIDNUMLET) &&"," nextType === ALETTER &&"," prevType === ALETTER) {"," return false;"," }",""," // WB8/WB9/WB10. Don't break inside sequences of digits or digits"," // adjacent to letters."," if ((type === NUMERIC || type === ALETTER) &&"," (nextType === NUMERIC || nextType === ALETTER)) {"," return false;"," }",""," // WB11. Don't break inside numeric sequences like \"3.2\" or"," // \"3,456.789\"."," if ((type === MIDNUM || type === MIDNUMLET) &&"," nextType === NUMERIC &&"," prevType === NUMERIC) {"," return false;"," }",""," // WB12. Don't break inside numeric sequences like \"3.2\" or"," // \"3,456.789\"."," if (type === NUMERIC &&"," (nextType === MIDNUM || nextType === MIDNUMLET) &&"," nextNextType === NUMERIC) {"," return false;"," }",""," // WB4. Ignore format and extend characters."," if (type === EXTEND || type === FORMAT ||"," prevType === EXTEND || prevType === FORMAT ||"," nextType === EXTEND || nextType === FORMAT) {"," return false;"," }",""," // WB3. Don't break inside CRLF."," if (type === CR && nextType === LF) {"," return false;"," }",""," // WB3a. Break before newlines (including CR and LF)."," if (type === NEWLINE || type === CR || type === LF) {"," return true;"," }",""," // WB3b. Break after newlines (including CR and LF)."," if (nextType === NEWLINE || nextType === CR || nextType === LF) {"," return true;"," }",""," // WB13. Don't break between Katakana characters."," if (type === KATAKANA && nextType === KATAKANA) {"," return false;"," }",""," // WB13a. Don't break from extenders."," if (nextType === EXTENDNUMLET &&"," (type === ALETTER || type === NUMERIC || type === KATAKANA ||"," type === EXTENDNUMLET)) {"," return false;"," }",""," // WB13b. Don't break from extenders."," if (type === EXTENDNUMLET &&"," (nextType === ALETTER || nextType === NUMERIC ||"," nextType === KATAKANA)) {"," return false;"," }",""," // Break after any character not covered by the rules above."," return true;"," }","};","","Text.WordBreak = WordBreak;","","","}, '3.7.3', {\"requires\": [\"array-extras\", \"text-data-wordbreak\"]});"]; _yuitest_coverage["build/text-wordbreak/text-wordbreak.js"].lines = {"1":0,"33":0,"108":0,"117":0,"118":0,"121":0,"122":0,"125":0,"126":0,"131":0,"132":0,"135":0,"140":0,"141":0,"143":0,"146":0,"149":0,"153":0,"169":0,"193":0,"208":0,"217":0,"218":0,"219":0,"221":0,"222":0,"224":0,"225":0,"226":0,"230":0,"233":0,"258":0,"263":0,"264":0,"268":0,"269":0,"272":0,"275":0,"278":0,"281":0,"284":0,"287":0,"292":0,"294":0,"299":0,"302":0,"307":0,"310":0,"314":0,"317":0,"321":0,"322":0,"326":0,"327":0,"331":0,"332":0,"336":0,"337":0,"341":0,"344":0,"348":0,"351":0,"355":0,"359":0}; _yuitest_coverage["build/text-wordbreak/text-wordbreak.js"].functions = {"getWords:107":0,"getUniqueWords:168":0,"isWordBoundary:192":0,"_classify:207":0,"_isWordBoundary:257":0,"(anonymous 1):1":0}; _yuitest_coverage["build/text-wordbreak/text-wordbreak.js"].coveredLines = 64;@@ -468,4 +468,4 @@ Text.WordBreak = WordBreak; -}, '3.7.2', {"requires": ["array-extras", "text-data-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-data-wordbreak"]});
bundle/text-wordbreak/text-wordbreak-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -366,4 +366,4 @@ Text.WordBreak = WordBreak; -}, '3.7.2', {"requires": ["array-extras", "text-data-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-data-wordbreak"]});
bundle/text-wordbreak/text-wordbreak-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("text-wordbreak",function(e,t){var n=e.Text,r=n.Data.WordBreak,i=0,s=1,o=2,u=3,a=4,f=5,l=6,c=7,h=8,p=9,d=10,v=11,m=12,g=[new RegExp(r.aletter),new RegExp(r.midnumlet),new RegExp(r.midletter),new RegExp(r.midnum),new RegExp(r.numeric),new RegExp(r.cr),new RegExp(r.lf),new RegExp(r.newline),new RegExp(r.extend),new RegExp(r.format),new RegExp(r.katakana),new RegExp(r.extendnumlet)],y="",b=new RegExp("^"+r.punctuation+"$"),w=/\s/,E={getWords:function(e,t){var n=0,r=E._classify(e),i=r.length,s=[],o=[],u,a,f;t||(t={}),t.ignoreCase&&(e=e.toLowerCase()),a=t.includePunctuation,f=t.includeWhitespace;for(;n<i;++n)u=e.charAt(n),s.push(u),E._isWordBoundary(r,n)&&(s=s.join(y),s&&(f||!w.test(s))&&(a||!b.test(s))&&o.push(s),s=[]);return o},getUniqueWords:function(t,n){return e.Array.unique(E.getWords(t,n))},isWordBoundary:function(e,t){return E._isWordBoundary(E._classify(e),t)},_classify:function(e){var t,n=[],r=0,i,s,o=e.length,u=g.length,a;for(;r<o;++r){t=e.charAt(r),a=m;for(i=0;i<u;++i){s=g[i];if(s&&s.test(t)){a=i;break}}n.push(a)}return n},_isWordBoundary:function(e,t){var n,r=e[t],m=e[t+1],g;return t<0||t>e.length-1&&t!==0?!1:r===i&&m===i?!1:(g=e[t+2],r!==i||m!==o&&m!==s||g!==i?(n=e[t-1],r!==o&&r!==s||m!==i||n!==i?r!==a&&r!==i||m!==a&&m!==i?r!==u&&r!==s||m!==a||n!==a?r!==a||m!==u&&m!==s||g!==a?r===h||r===p||n===h||n===p||m===h||m===p?!1:r===f&&m===l?!1:r===c||r===f||r===l?!0:m===c||m===f||m===l?!0:r===d&&m===d?!1:m!==v||r!==i&&r!==a&&r!==d&&r!==v?r!==v||m!==i&&m!==a&&m!==d?!0:!1:!1:!1:!1:!1:!1):!1)}};n.WordBreak=E},"3.7.2",{requires:["array-extras","text-data-wordbreak"]});+YUI.add("text-wordbreak",function(e,t){var n=e.Text,r=n.Data.WordBreak,i=0,s=1,o=2,u=3,a=4,f=5,l=6,c=7,h=8,p=9,d=10,v=11,m=12,g=[new RegExp(r.aletter),new RegExp(r.midnumlet),new RegExp(r.midletter),new RegExp(r.midnum),new RegExp(r.numeric),new RegExp(r.cr),new RegExp(r.lf),new RegExp(r.newline),new RegExp(r.extend),new RegExp(r.format),new RegExp(r.katakana),new RegExp(r.extendnumlet)],y="",b=new RegExp("^"+r.punctuation+"$"),w=/\s/,E={getWords:function(e,t){var n=0,r=E._classify(e),i=r.length,s=[],o=[],u,a,f;t||(t={}),t.ignoreCase&&(e=e.toLowerCase()),a=t.includePunctuation,f=t.includeWhitespace;for(;n<i;++n)u=e.charAt(n),s.push(u),E._isWordBoundary(r,n)&&(s=s.join(y),s&&(f||!w.test(s))&&(a||!b.test(s))&&o.push(s),s=[]);return o},getUniqueWords:function(t,n){return e.Array.unique(E.getWords(t,n))},isWordBoundary:function(e,t){return E._isWordBoundary(E._classify(e),t)},_classify:function(e){var t,n=[],r=0,i,s,o=e.length,u=g.length,a;for(;r<o;++r){t=e.charAt(r),a=m;for(i=0;i<u;++i){s=g[i];if(s&&s.test(t)){a=i;break}}n.push(a)}return n},_isWordBoundary:function(e,t){var n,r=e[t],m=e[t+1],g;return t<0||t>e.length-1&&t!==0?!1:r===i&&m===i?!1:(g=e[t+2],r!==i||m!==o&&m!==s||g!==i?(n=e[t-1],r!==o&&r!==s||m!==i||n!==i?r!==a&&r!==i||m!==a&&m!==i?r!==u&&r!==s||m!==a||n!==a?r!==a||m!==u&&m!==s||g!==a?r===h||r===p||n===h||n===p||m===h||m===p?!1:r===f&&m===l?!1:r===c||r===f||r===l?!0:m===c||m===f||m===l?!0:r===d&&m===d?!1:m!==v||r!==i&&r!==a&&r!==d&&r!==v?r!==v||m!==i&&m!==a&&m!==d?!0:!1:!1:!1:!1:!1:!1):!1)}};n.WordBreak=E},"3.7.3",{requires:["array-extras","text-data-wordbreak"]});
bundle/text-wordbreak/text-wordbreak.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -365,4 +365,4 @@ Text.WordBreak = WordBreak; -}, '3.7.2', {"requires": ["array-extras", "text-data-wordbreak"]});+}, '3.7.3', {"requires": ["array-extras", "text-data-wordbreak"]});
− bundle/transition-native/transition-native-debug.js
@@ -1,718 +0,0 @@-/*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('transition-native', function(Y) {--/**-* Provides the transition method for Node.-* Transition has no API of its own, but adds the transition method to Node.-*-* @module transition-* @requires node-style-*/--var CAMEL_VENDOR_PREFIX = '',- VENDOR_PREFIX = '',- DOCUMENT = Y.config.doc,- DOCUMENT_ELEMENT = 'documentElement',- TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,- TRANSITION_PROPERTY,- TRANSITION_DURATION,- TRANSITION_TIMING_FUNCTION,- TRANSITION_DELAY,- TRANSITION_END,- ON_TRANSITION_END,- TRANSFORM_CAMEL,-- EMPTY_OBJ = {},-- VENDORS = [- 'Webkit',- 'Moz'- ],-- VENDOR_TRANSITION_END = {- Webkit: 'webkitTransitionEnd'- },--/**- * A class for constructing transition instances.- * Adds the "transition" method to Node.- * @class Transition- * @constructor- */--Transition = function() {- this.init.apply(this, arguments);-};--Transition._toCamel = function(property) {- property = property.replace(/-([a-z])/gi, function(m0, m1) {- return m1.toUpperCase();- });-- return property;-};--Transition._toHyphen = function(property) {- property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {- var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- - if (m3) {- str += '-' + m3.toLowerCase();- }-- return str;- }); -- return property;-};--Transition.SHOW_TRANSITION = 'fadeIn';-Transition.HIDE_TRANSITION = 'fadeOut';--Transition.useNative = false;--Y.Array.each(VENDORS, function(val) { // then vendor specific- var property = val + TRANSITION_CAMEL;- if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- CAMEL_VENDOR_PREFIX = val;- VENDOR_PREFIX = Transition._toHyphen(val) + '-';-- Transition.useNative = true;- Transition.supported = true; // TODO: remove- }-});--TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-TRANSITION_END = 'transitionend';-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';--TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;--TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';--Transition.fx = {};-Transition.toggles = {};--Transition._hasEnd = {};--Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;--Y.Node.DOM_EVENTS[TRANSITION_END] = 1; --Transition.NAME = 'transition';--Transition.DEFAULT_EASING = 'ease';-Transition.DEFAULT_DURATION = 0.5;-Transition.DEFAULT_DELAY = 0;--Transition._nodeAttrs = {};--Transition.prototype = {- constructor: Transition,- init: function(node, config) {- var anim = this;- anim._node = node;- if (!anim._running && config) {- anim._config = config;- node._transition = anim; // cache for reuse-- anim._duration = ('duration' in config) ?- config.duration: anim.constructor.DEFAULT_DURATION;-- anim._delay = ('delay' in config) ?- config.delay: anim.constructor.DEFAULT_DELAY;-- anim._easing = config.easing || anim.constructor.DEFAULT_EASING;- anim._count = 0; // track number of animated properties- anim._running = false;-- }-- return anim;- },-- addProperty: function(prop, config) {- var anim = this,- node = this._node,- uid = Y.stamp(node),- nodeInstance = Y.one(node),- attrs = Transition._nodeAttrs[uid],- computed,- compareVal,- dur,- attr,- val;-- if (!attrs) {- attrs = Transition._nodeAttrs[uid] = {};- }-- attr = attrs[prop];-- // might just be a value- if (config && config.value !== undefined) {- val = config.value;- } else if (config !== undefined) {- val = config; - config = EMPTY_OBJ;- }-- if (typeof val === 'function') {- val = val.call(nodeInstance, nodeInstance);- }-- if (attr && attr.transition) {- // take control if another transition owns this property- if (attr.transition !== anim) {- attr.transition._count--; // remapping attr to this transition- }- } -- anim._count++; // properties per transition-- // make 0 async and fire events- dur = ((typeof config.duration != 'undefined') ? config.duration :- anim._duration) || 0.0001;-- attrs[prop] = {- value: val,- duration: dur,- delay: (typeof config.delay != 'undefined') ? config.delay :- anim._delay,-- easing: config.easing || anim._easing,-- transition: anim- };-- // native end event doesnt fire when setting to same value- // supplementing with timer- // val may be a string or number (height: 0, etc), but computedStyle is always string- computed = Y.DOM.getComputedStyle(node, prop);- compareVal = (typeof val === 'string') ? computed : parseFloat(computed);-- if (Transition.useNative && compareVal === val) {- setTimeout(function() {- anim._onNativeEnd.call(node, {- propertyName: prop,- elapsedTime: dur- });- }, dur * 1000);- }- },-- removeProperty: function(prop) {- var anim = this,- attrs = Transition._nodeAttrs[Y.stamp(anim._node)];-- if (attrs && attrs[prop]) {- delete attrs[prop];- anim._count--;- }-- },-- initAttrs: function(config) {- var attr,- node = this._node;-- if (config.transform && !config[TRANSFORM_CAMEL]) {- config[TRANSFORM_CAMEL] = config.transform;- delete config.transform; // TODO: copy- }-- for (attr in config) {- if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {- this.addProperty(attr, config[attr]);-- // when size is auto or % webkit starts from zero instead of computed - // (https://bugs.webkit.org/show_bug.cgi?id=16020)- // TODO: selective set- if (node.style[attr] === '') {- Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr));- }- }- }- },-- /**- * Starts or an animation.- * @method run- * @chainable- * @private- */ - run: function(callback) {- var anim = this,- node = anim._node,- config = anim._config,- data = {- type: 'transition:start',- config: config- };--- if (!anim._running) {- anim._running = true;-- //anim._node.fire('transition:start', data);-- if (config.on && config.on.start) {- config.on.start.call(Y.one(node), data);- }-- anim.initAttrs(anim._config);-- anim._callback = callback;- anim._start();- }--- return anim;- },-- _start: function() {- this._runNative();- },-- _prepDur: function(dur) {- dur = parseFloat(dur);-- return dur + 's';- },-- _runNative: function(time) {- var anim = this,- node = anim._node,- uid = Y.stamp(node),- style = node.style,- computed = getComputedStyle(node),- attrs = Transition._nodeAttrs[uid],- cssText = '',- cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)],-- transitionText = TRANSITION_PROPERTY + ': ',- duration = TRANSITION_DURATION + ': ',- easing = TRANSITION_TIMING_FUNCTION + ': ',- delay = TRANSITION_DELAY + ': ',- hyphy,- attr,- name;-- // preserve existing transitions- if (cssTransition !== 'all') {- transitionText += cssTransition + ',';- duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';- easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';- delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ',';-- }-- // run transitions mapped to this instance- for (name in attrs) {- hyphy = Transition._toHyphen(name);- attr = attrs[name];- if ((attr = attrs[name]) && attr.transition === anim) {- if (name in node.style) { // only native styles allowed- duration += anim._prepDur(attr.duration) + ',';- delay += anim._prepDur(attr.delay) + ',';- easing += (attr.easing) + ',';-- transitionText += hyphy + ',';- cssText += hyphy + ': ' + attr.value + '; ';- } else {- this.removeProperty(name);- }- }- }-- transitionText = transitionText.replace(/,$/, ';');- duration = duration.replace(/,$/, ';');- easing = easing.replace(/,$/, ';');- delay = delay.replace(/,$/, ';');-- // only one native end event per node- if (!Transition._hasEnd[uid]) {- //anim._detach = Y.on(TRANSITION_END, anim._onNativeEnd, node);- //node[ON_TRANSITION_END] = anim._onNativeEnd;- node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');- Transition._hasEnd[uid] = true;-- }- - //setTimeout(function() { // allow updates to apply (size fix, onstart, etc)- style.cssText += transitionText + duration + easing + delay + cssText;- //}, 1);-- },-- _end: function(elapsed) {- var anim = this,- node = anim._node,- callback = anim._callback,- config = anim._config,- data = {- type: 'transition:end',- config: config,- elapsedTime: elapsed - },-- nodeInstance = Y.one(node); -- anim._running = false;- anim._callback = null;-- if (node) {- if (config.on && config.on.end) {- setTimeout(function() { // IE: allow previous update to finish- config.on.end.call(nodeInstance, data);-- // nested to ensure proper fire order- if (callback) {- callback.call(nodeInstance, data);- }-- }, 1);- } else if (callback) {- setTimeout(function() { // IE: allow previous update to finish- callback.call(nodeInstance, data);- }, 1);- }- //node.fire('transition:end', data);- }-- },-- _endNative: function(name) {- var node = this._node,- value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)];-- if (typeof value === 'string') {- value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ',');- value = value.replace(/^,|,$/, '');- node.style[TRANSITION_CAMEL] = value;- }- },-- _onNativeEnd: function(e) {- var node = this,- uid = Y.stamp(node),- event = e,//e._event,- name = Transition._toCamel(event.propertyName),- elapsed = event.elapsedTime,- attrs = Transition._nodeAttrs[uid],- attr = attrs[name],- anim = (attr) ? attr.transition : null,- data,- config;-- if (anim) {- anim.removeProperty(name);- anim._endNative(name);- config = anim._config[name];-- data = {- type: 'propertyEnd',- propertyName: name,- elapsedTime: elapsed,- config: config- };-- if (config && config.on && config.on.end) {- config.on.end.call(Y.one(node), data);- }-- //node.fire('transition:propertyEnd', data);-- if (anim._count <= 0) { // after propertyEnd fires- anim._end(elapsed);- }- }- },-- destroy: function() {- var anim = this,- node = anim._node;- /*- if (anim._detach) {- anim._detach.detach();- }- */- //anim._node[ON_TRANSITION_END] = null;- if (node) {- node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);- anim._node = null;- }- }-};--Y.Transition = Transition;-Y.TransitionNative = Transition; // TODO: remove--/** - * Animate one or more css properties to a given value. Requires the "transition" module.- * <pre>example usage:- * Y.one('#demo').transition({- * duration: 1, // in seconds, default is 0.5- * easing: 'ease-out', // default is 'ease'- * delay: '1', // delay start for 1 second, default is 0- *- * height: '10px',- * width: '10px',- *- * opacity: { // per property- * value: 0,- * duration: 2,- * delay: 2,- * easing: 'ease-in'- * }- * });- * </pre>- * @for Node- * @method transition- * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. - * @chainable-*/-Y.Node.prototype.transition = function(name, config, callback) {- var - transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)],- anim = (transitionAttrs) ? transitionAttrs.transition || null : null,- fxConfig,- prop;- - if (typeof name === 'string') { // named effect, pull config from registry- if (typeof config === 'function') {- callback = config;- config = null;- }-- fxConfig = Transition.fx[name];-- if (config && typeof config !== 'boolean') {- config = Y.clone(config);-- for (prop in fxConfig) {- if (fxConfig.hasOwnProperty(prop)) {- if (! (prop in config)) {- config[prop] = fxConfig[prop]; - }- }- }- } else {- config = fxConfig;- }-- } else { // name is a config, config is a callback or undefined- callback = config;- config = name;- }-- if (anim && !anim._running) {- anim.init(this, config);- } else {- anim = new Transition(this._node, config);- }-- anim.run(callback);- return this;-};--Y.Node.prototype.show = function(name, config, callback) {- this._show(); // show prior to transition- if (name && Y.Transition) {- if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default- if (typeof config === 'function') {- callback = config;- config = name;- }- name = Transition.SHOW_TRANSITION; - } - this.transition(name, config, callback);- } - else if (name && !Y.Transition) { Y.log('unable to transition show; missing transition module', 'warn', 'node'); }- return this;-};--var _wrapCallBack = function(anim, fn, callback) {- return function() {- if (fn) {- fn.call(anim);- }- if (callback) {- callback.apply(anim._node, arguments);- }- };-};--Y.Node.prototype.hide = function(name, config, callback) {- if (name && Y.Transition) {- if (typeof config === 'function') {- callback = config;- config = null;- }-- callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback- if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default- if (typeof config === 'function') {- callback = config;- config = name;- }- name = Transition.HIDE_TRANSITION; - } - this.transition(name, config, callback);- } else if (name && !Y.Transition) { Y.log('unable to transition hide; missing transition module', 'warn', 'node'); // end if on nex- } else {- this._hide();- } - return this;-}; --/** - * Animate one or more css properties to a given value. Requires the "transition" module.- * <pre>example usage:- * Y.all('.demo').transition({- * duration: 1, // in seconds, default is 0.5- * easing: 'ease-out', // default is 'ease'- * delay: '1', // delay start for 1 second, default is 0- *- * height: '10px',- * width: '10px',- *- * opacity: { // per property- * value: 0,- * duration: 2,- * delay: 2,- * easing: 'ease-in'- * }- * });- * </pre>- * @for NodeList- * @method transition- * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. The callback fires- * once per item in the NodeList.- * @chainable-*/-Y.NodeList.prototype.transition = function(config, callback) {- var nodes = this._nodes,- i = 0,- node;-- while ((node = nodes[i++])) {- Y.one(node).transition(config, callback);- }-- return this;-};--Y.Node.prototype.toggleView = function(name, on, callback) {- this._toggles = this._toggles || [];- callback = arguments[arguments.length - 1];-- if (typeof name == 'boolean') { // no transition, just toggle- on = name;- name = null;- }-- name = name || Y.Transition.DEFAULT_TOGGLE;-- if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle- on = ! this._toggles[name];- }-- on = (on) ? 1 : 0;- if (on) {- this._show();- } else {- callback = _wrapCallBack(this, this._hide, callback);- }-- this._toggles[name] = on;- this.transition(Y.Transition.toggles[name][on], callback);-- return this;-};--Y.NodeList.prototype.toggleView = function(name, on, callback) {- var nodes = this._nodes,- i = 0,- node;-- while ((node = nodes[i++])) {- Y.one(node).toggleView(name, on, callback);- }-- return this;-};--Y.mix(Transition.fx, {- fadeOut: {- opacity: 0,- duration: 0.5,- easing: 'ease-out'- },-- fadeIn: {- opacity: 1,- duration: 0.5,- easing: 'ease-in'- },-- sizeOut: {- height: 0,- width: 0,- duration: 0.75,- easing: 'ease-out'- },-- sizeIn: {- height: function(node) {- return node.get('scrollHeight') + 'px';- },- width: function(node) {- return node.get('scrollWidth') + 'px';- },- duration: 0.5,- easing: 'ease-in',- - on: {- start: function() {- var overflow = this.getStyle('overflow');- if (overflow !== 'hidden') { // enable scrollHeight/Width- this.setStyle('overflow', 'hidden');- this._transitionOverflow = overflow;- }- },-- end: function() {- if (this._transitionOverflow) { // revert overridden value- this.setStyle('overflow', this._transitionOverflow);- delete this._transitionOverflow;- }- }- } - }-});--Y.mix(Transition.toggles, {- size: ['sizeOut', 'sizeIn'],- fade: ['fadeOut', 'fadeIn']-});--Transition.DEFAULT_TOGGLE = 'fade';----}, '3.7.2' ,{requires:['node-base']});
− bundle/transition-native/transition-native-min.js
@@ -1,8 +0,0 @@-/*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add("transition-native",function(b){var i="",h="",f=b.config.doc,r="documentElement",s="transition",k="Transition",m,j,p,a,n,c,l,t,q={},g=["Webkit","Moz"],e={Webkit:"webkitTransitionEnd"},d=function(){this.init.apply(this,arguments);};d._toCamel=function(u){u=u.replace(/-([a-z])/gi,function(w,v){return v.toUpperCase();});return u;};d._toHyphen=function(u){u=u.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(y,x,w,v){var z=((x)?"-"+x.toLowerCase():"")+w;if(v){z+="-"+v.toLowerCase();}return z;});return u;};d.SHOW_TRANSITION="fadeIn";d.HIDE_TRANSITION="fadeOut";d.useNative=false;b.Array.each(g,function(v){var u=v+k;if(u in f[r].style){i=v;h=d._toHyphen(v)+"-";d.useNative=true;d.supported=true;}});k=i+k;m=i+"TransitionProperty";j=h+"transition-property";p=h+"transition-duration";a=h+"transition-timing-function";n=h+"transition-delay";c="transitionend";l="on"+i.toLowerCase()+"transitionend";c=e[i]||c;t=i+"Transform";d.fx={};d.toggles={};d._hasEnd={};d._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;b.Node.DOM_EVENTS[c]=1;d.NAME="transition";d.DEFAULT_EASING="ease";d.DEFAULT_DURATION=0.5;d.DEFAULT_DELAY=0;d._nodeAttrs={};d.prototype={constructor:d,init:function(v,u){var w=this;w._node=v;if(!w._running&&u){w._config=u;v._transition=w;w._duration=("duration" in u)?u.duration:w.constructor.DEFAULT_DURATION;w._delay=("delay" in u)?u.delay:w.constructor.DEFAULT_DELAY;w._easing=u.easing||w.constructor.DEFAULT_EASING;w._count=0;w._running=false;}return w;},addProperty:function(v,x){var A=this,y=this._node,C=b.stamp(y),B=b.one(y),F=d._nodeAttrs[C],z,E,u,D,w;if(!F){F=d._nodeAttrs[C]={};}D=F[v];if(x&&x.value!==undefined){w=x.value;}else{if(x!==undefined){w=x;x=q;}}if(typeof w==="function"){w=w.call(B,B);}if(D&&D.transition){if(D.transition!==A){D.transition._count--;}}A._count++;u=((typeof x.duration!="undefined")?x.duration:A._duration)||0.0001;F[v]={value:w,duration:u,delay:(typeof x.delay!="undefined")?x.delay:A._delay,easing:x.easing||A._easing,transition:A};z=b.DOM.getComputedStyle(y,v);E=(typeof w==="string")?z:parseFloat(z);if(d.useNative&&E===w){setTimeout(function(){A._onNativeEnd.call(y,{propertyName:v,elapsedTime:u});},u*1000);}},removeProperty:function(w){var v=this,u=d._nodeAttrs[b.stamp(v._node)];if(u&&u[w]){delete u[w];v._count--;}},initAttrs:function(v){var u,w=this._node;if(v.transform&&!v[t]){v[t]=v.transform;delete v.transform;}for(u in v){if(v.hasOwnProperty(u)&&!d._reKeywords.test(u)){this.addProperty(u,v[u]);if(w.style[u]===""){b.DOM.setStyle(w,u,b.DOM.getComputedStyle(w,u));}}}},run:function(y){var x=this,v=x._node,u=x._config,w={type:"transition:start",config:u};if(!x._running){x._running=true;if(u.on&&u.on.start){u.on.start.call(b.one(v),w);}x.initAttrs(x._config);x._callback=y;x._start();}return x;},_start:function(){this._runNative();},_prepDur:function(u){u=parseFloat(u);return u+"s";},_runNative:function(w){var C=this,x=C._node,E=b.stamp(x),v=x.style,A=getComputedStyle(x),I=d._nodeAttrs[E],y="",J=A[d._toCamel(j)],H=j+": ",B=p+": ",G=a+": ",D=n+": ",z,F,u;if(J!=="all"){H+=J+",";B+=A[d._toCamel(p)]+",";G+=A[d._toCamel(a)]+",";D+=A[d._toCamel(n)]+",";}for(u in I){z=d._toHyphen(u);F=I[u];if((F=I[u])&&F.transition===C){if(u in x.style){B+=C._prepDur(F.duration)+",";D+=C._prepDur(F.delay)+",";G+=(F.easing)+",";H+=z+",";y+=z+": "+F.value+"; ";}else{this.removeProperty(u);}}}H=H.replace(/,$/,";");B=B.replace(/,$/,";");G=G.replace(/,$/,";");D=D.replace(/,$/,";");if(!d._hasEnd[E]){x.addEventListener(c,C._onNativeEnd,"");d._hasEnd[E]=true;}v.cssText+=H+B+G+D+y;},_end:function(u){var y=this,w=y._node,A=y._callback,v=y._config,x={type:"transition:end",config:v,elapsedTime:u},z=b.one(w);y._running=false;y._callback=null;if(w){if(v.on&&v.on.end){setTimeout(function(){v.on.end.call(z,x);if(A){A.call(z,x);}},1);}else{if(A){setTimeout(function(){A.call(z,x);},1);}}}},_endNative:function(u){var v=this._node,w=v.ownerDocument.defaultView.getComputedStyle(v,"")[d._toCamel(j)];if(typeof w==="string"){w=w.replace(new RegExp("(?:^|,\\s)"+u+",?"),",");w=w.replace(/^,|,$/,"");v.style[k]=w;}},_onNativeEnd:function(B){var x=this,A=b.stamp(x),u=B,v=d._toCamel(u.propertyName),E=u.elapsedTime,D=d._nodeAttrs[A],C=D[v],y=(C)?C.transition:null,z,w;if(y){y.removeProperty(v);y._endNative(v);w=y._config[v];z={type:"propertyEnd",propertyName:v,elapsedTime:E,config:w};if(w&&w.on&&w.on.end){w.on.end.call(b.one(x),z);}if(y._count<=0){y._end(E);}}},destroy:function(){var v=this,u=v._node;if(u){u.removeEventListener(c,v._onNativeEnd,false);v._node=null;}}};b.Transition=d;b.TransitionNative=d;b.Node.prototype.transition=function(w,v,A){var u=d._nodeAttrs[b.stamp(this._node)],y=(u)?u.transition||null:null,x,z;if(typeof w==="string"){if(typeof v==="function"){A=v;v=null;}x=d.fx[w];if(v&&typeof v!=="boolean"){v=b.clone(v);for(z in x){if(x.hasOwnProperty(z)){if(!(z in v)){v[z]=x[z];}}}}else{v=x;}}else{A=v;v=w;}if(y&&!y._running){y.init(this,v);}else{y=new d(this._node,v);}y.run(A);return this;};b.Node.prototype.show=function(v,u,w){this._show();if(v&&b.Transition){if(typeof v!=="string"&&!v.push){if(typeof u==="function"){w=u;u=v;}v=d.SHOW_TRANSITION;}this.transition(v,u,w);}return this;};var o=function(v,u,w){return function(){if(u){u.call(v);}if(w){w.apply(v._node,arguments);}};};b.Node.prototype.hide=function(v,u,w){if(v&&b.Transition){if(typeof u==="function"){w=u;u=null;}w=o(this,this._hide,w);if(typeof v!=="string"&&!v.push){if(typeof u==="function"){w=u;u=v;}v=d.HIDE_TRANSITION;}this.transition(v,u,w);}else{this._hide();}return this;};b.NodeList.prototype.transition=function(v,y){var u=this._nodes,w=0,x;while((x=u[w++])){b.one(x).transition(v,y);}return this;};b.Node.prototype.toggleView=function(v,u,w){this._toggles=this._toggles||[];w=arguments[arguments.length-1];if(typeof v=="boolean"){u=v;v=null;}v=v||b.Transition.DEFAULT_TOGGLE;if(typeof u=="undefined"&&v in this._toggles){u=!this._toggles[v];}u=(u)?1:0;if(u){this._show();}else{w=o(this,this._hide,w);}this._toggles[v]=u;this.transition(b.Transition.toggles[v][u],w);-return this;};b.NodeList.prototype.toggleView=function(w,u,z){var v=this._nodes,x=0,y;while((y=v[x++])){b.one(y).toggleView(w,u,z);}return this;};b.mix(d.fx,{fadeOut:{opacity:0,duration:0.5,easing:"ease-out"},fadeIn:{opacity:1,duration:0.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:0.75,easing:"ease-out"},sizeIn:{height:function(u){return u.get("scrollHeight")+"px";},width:function(u){return u.get("scrollWidth")+"px";},duration:0.5,easing:"ease-in",on:{start:function(){var u=this.getStyle("overflow");if(u!=="hidden"){this.setStyle("overflow","hidden");this._transitionOverflow=u;}},end:function(){if(this._transitionOverflow){this.setStyle("overflow",this._transitionOverflow);delete this._transitionOverflow;}}}}});b.mix(d.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]});d.DEFAULT_TOGGLE="fade";},"3.7.2",{requires:["node-base"]});
− bundle/transition-native/transition-native.js
@@ -1,716 +0,0 @@-/*-YUI 3.7.2 (build 5639)-Copyright 2012 Yahoo! Inc. All rights reserved.-Licensed under the BSD License.-http://yuilibrary.com/license/-*/-YUI.add('transition-native', function(Y) {--/**-* Provides the transition method for Node.-* Transition has no API of its own, but adds the transition method to Node.-*-* @module transition-* @requires node-style-*/--var CAMEL_VENDOR_PREFIX = '',- VENDOR_PREFIX = '',- DOCUMENT = Y.config.doc,- DOCUMENT_ELEMENT = 'documentElement',- TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,- TRANSITION_PROPERTY,- TRANSITION_DURATION,- TRANSITION_TIMING_FUNCTION,- TRANSITION_DELAY,- TRANSITION_END,- ON_TRANSITION_END,- TRANSFORM_CAMEL,-- EMPTY_OBJ = {},-- VENDORS = [- 'Webkit',- 'Moz'- ],-- VENDOR_TRANSITION_END = {- Webkit: 'webkitTransitionEnd'- },--/**- * A class for constructing transition instances.- * Adds the "transition" method to Node.- * @class Transition- * @constructor- */--Transition = function() {- this.init.apply(this, arguments);-};--Transition._toCamel = function(property) {- property = property.replace(/-([a-z])/gi, function(m0, m1) {- return m1.toUpperCase();- });-- return property;-};--Transition._toHyphen = function(property) {- property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {- var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- - if (m3) {- str += '-' + m3.toLowerCase();- }-- return str;- }); -- return property;-};--Transition.SHOW_TRANSITION = 'fadeIn';-Transition.HIDE_TRANSITION = 'fadeOut';--Transition.useNative = false;--Y.Array.each(VENDORS, function(val) { // then vendor specific- var property = val + TRANSITION_CAMEL;- if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- CAMEL_VENDOR_PREFIX = val;- VENDOR_PREFIX = Transition._toHyphen(val) + '-';-- Transition.useNative = true;- Transition.supported = true; // TODO: remove- }-});--TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-TRANSITION_END = 'transitionend';-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';--TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;--TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';--Transition.fx = {};-Transition.toggles = {};--Transition._hasEnd = {};--Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;--Y.Node.DOM_EVENTS[TRANSITION_END] = 1; --Transition.NAME = 'transition';--Transition.DEFAULT_EASING = 'ease';-Transition.DEFAULT_DURATION = 0.5;-Transition.DEFAULT_DELAY = 0;--Transition._nodeAttrs = {};--Transition.prototype = {- constructor: Transition,- init: function(node, config) {- var anim = this;- anim._node = node;- if (!anim._running && config) {- anim._config = config;- node._transition = anim; // cache for reuse-- anim._duration = ('duration' in config) ?- config.duration: anim.constructor.DEFAULT_DURATION;-- anim._delay = ('delay' in config) ?- config.delay: anim.constructor.DEFAULT_DELAY;-- anim._easing = config.easing || anim.constructor.DEFAULT_EASING;- anim._count = 0; // track number of animated properties- anim._running = false;-- }-- return anim;- },-- addProperty: function(prop, config) {- var anim = this,- node = this._node,- uid = Y.stamp(node),- nodeInstance = Y.one(node),- attrs = Transition._nodeAttrs[uid],- computed,- compareVal,- dur,- attr,- val;-- if (!attrs) {- attrs = Transition._nodeAttrs[uid] = {};- }-- attr = attrs[prop];-- // might just be a value- if (config && config.value !== undefined) {- val = config.value;- } else if (config !== undefined) {- val = config; - config = EMPTY_OBJ;- }-- if (typeof val === 'function') {- val = val.call(nodeInstance, nodeInstance);- }-- if (attr && attr.transition) {- // take control if another transition owns this property- if (attr.transition !== anim) {- attr.transition._count--; // remapping attr to this transition- }- } -- anim._count++; // properties per transition-- // make 0 async and fire events- dur = ((typeof config.duration != 'undefined') ? config.duration :- anim._duration) || 0.0001;-- attrs[prop] = {- value: val,- duration: dur,- delay: (typeof config.delay != 'undefined') ? config.delay :- anim._delay,-- easing: config.easing || anim._easing,-- transition: anim- };-- // native end event doesnt fire when setting to same value- // supplementing with timer- // val may be a string or number (height: 0, etc), but computedStyle is always string- computed = Y.DOM.getComputedStyle(node, prop);- compareVal = (typeof val === 'string') ? computed : parseFloat(computed);-- if (Transition.useNative && compareVal === val) {- setTimeout(function() {- anim._onNativeEnd.call(node, {- propertyName: prop,- elapsedTime: dur- });- }, dur * 1000);- }- },-- removeProperty: function(prop) {- var anim = this,- attrs = Transition._nodeAttrs[Y.stamp(anim._node)];-- if (attrs && attrs[prop]) {- delete attrs[prop];- anim._count--;- }-- },-- initAttrs: function(config) {- var attr,- node = this._node;-- if (config.transform && !config[TRANSFORM_CAMEL]) {- config[TRANSFORM_CAMEL] = config.transform;- delete config.transform; // TODO: copy- }-- for (attr in config) {- if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {- this.addProperty(attr, config[attr]);-- // when size is auto or % webkit starts from zero instead of computed - // (https://bugs.webkit.org/show_bug.cgi?id=16020)- // TODO: selective set- if (node.style[attr] === '') {- Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr));- }- }- }- },-- /**- * Starts or an animation.- * @method run- * @chainable- * @private- */ - run: function(callback) {- var anim = this,- node = anim._node,- config = anim._config,- data = {- type: 'transition:start',- config: config- };--- if (!anim._running) {- anim._running = true;-- //anim._node.fire('transition:start', data);-- if (config.on && config.on.start) {- config.on.start.call(Y.one(node), data);- }-- anim.initAttrs(anim._config);-- anim._callback = callback;- anim._start();- }--- return anim;- },-- _start: function() {- this._runNative();- },-- _prepDur: function(dur) {- dur = parseFloat(dur);-- return dur + 's';- },-- _runNative: function(time) {- var anim = this,- node = anim._node,- uid = Y.stamp(node),- style = node.style,- computed = getComputedStyle(node),- attrs = Transition._nodeAttrs[uid],- cssText = '',- cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)],-- transitionText = TRANSITION_PROPERTY + ': ',- duration = TRANSITION_DURATION + ': ',- easing = TRANSITION_TIMING_FUNCTION + ': ',- delay = TRANSITION_DELAY + ': ',- hyphy,- attr,- name;-- // preserve existing transitions- if (cssTransition !== 'all') {- transitionText += cssTransition + ',';- duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';- easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';- delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ',';-- }-- // run transitions mapped to this instance- for (name in attrs) {- hyphy = Transition._toHyphen(name);- attr = attrs[name];- if ((attr = attrs[name]) && attr.transition === anim) {- if (name in node.style) { // only native styles allowed- duration += anim._prepDur(attr.duration) + ',';- delay += anim._prepDur(attr.delay) + ',';- easing += (attr.easing) + ',';-- transitionText += hyphy + ',';- cssText += hyphy + ': ' + attr.value + '; ';- } else {- this.removeProperty(name);- }- }- }-- transitionText = transitionText.replace(/,$/, ';');- duration = duration.replace(/,$/, ';');- easing = easing.replace(/,$/, ';');- delay = delay.replace(/,$/, ';');-- // only one native end event per node- if (!Transition._hasEnd[uid]) {- //anim._detach = Y.on(TRANSITION_END, anim._onNativeEnd, node);- //node[ON_TRANSITION_END] = anim._onNativeEnd;- node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');- Transition._hasEnd[uid] = true;-- }- - //setTimeout(function() { // allow updates to apply (size fix, onstart, etc)- style.cssText += transitionText + duration + easing + delay + cssText;- //}, 1);-- },-- _end: function(elapsed) {- var anim = this,- node = anim._node,- callback = anim._callback,- config = anim._config,- data = {- type: 'transition:end',- config: config,- elapsedTime: elapsed - },-- nodeInstance = Y.one(node); -- anim._running = false;- anim._callback = null;-- if (node) {- if (config.on && config.on.end) {- setTimeout(function() { // IE: allow previous update to finish- config.on.end.call(nodeInstance, data);-- // nested to ensure proper fire order- if (callback) {- callback.call(nodeInstance, data);- }-- }, 1);- } else if (callback) {- setTimeout(function() { // IE: allow previous update to finish- callback.call(nodeInstance, data);- }, 1);- }- //node.fire('transition:end', data);- }-- },-- _endNative: function(name) {- var node = this._node,- value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)];-- if (typeof value === 'string') {- value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ',');- value = value.replace(/^,|,$/, '');- node.style[TRANSITION_CAMEL] = value;- }- },-- _onNativeEnd: function(e) {- var node = this,- uid = Y.stamp(node),- event = e,//e._event,- name = Transition._toCamel(event.propertyName),- elapsed = event.elapsedTime,- attrs = Transition._nodeAttrs[uid],- attr = attrs[name],- anim = (attr) ? attr.transition : null,- data,- config;-- if (anim) {- anim.removeProperty(name);- anim._endNative(name);- config = anim._config[name];-- data = {- type: 'propertyEnd',- propertyName: name,- elapsedTime: elapsed,- config: config- };-- if (config && config.on && config.on.end) {- config.on.end.call(Y.one(node), data);- }-- //node.fire('transition:propertyEnd', data);-- if (anim._count <= 0) { // after propertyEnd fires- anim._end(elapsed);- }- }- },-- destroy: function() {- var anim = this,- node = anim._node;- /*- if (anim._detach) {- anim._detach.detach();- }- */- //anim._node[ON_TRANSITION_END] = null;- if (node) {- node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);- anim._node = null;- }- }-};--Y.Transition = Transition;-Y.TransitionNative = Transition; // TODO: remove--/** - * Animate one or more css properties to a given value. Requires the "transition" module.- * <pre>example usage:- * Y.one('#demo').transition({- * duration: 1, // in seconds, default is 0.5- * easing: 'ease-out', // default is 'ease'- * delay: '1', // delay start for 1 second, default is 0- *- * height: '10px',- * width: '10px',- *- * opacity: { // per property- * value: 0,- * duration: 2,- * delay: 2,- * easing: 'ease-in'- * }- * });- * </pre>- * @for Node- * @method transition- * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. - * @chainable-*/-Y.Node.prototype.transition = function(name, config, callback) {- var - transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)],- anim = (transitionAttrs) ? transitionAttrs.transition || null : null,- fxConfig,- prop;- - if (typeof name === 'string') { // named effect, pull config from registry- if (typeof config === 'function') {- callback = config;- config = null;- }-- fxConfig = Transition.fx[name];-- if (config && typeof config !== 'boolean') {- config = Y.clone(config);-- for (prop in fxConfig) {- if (fxConfig.hasOwnProperty(prop)) {- if (! (prop in config)) {- config[prop] = fxConfig[prop]; - }- }- }- } else {- config = fxConfig;- }-- } else { // name is a config, config is a callback or undefined- callback = config;- config = name;- }-- if (anim && !anim._running) {- anim.init(this, config);- } else {- anim = new Transition(this._node, config);- }-- anim.run(callback);- return this;-};--Y.Node.prototype.show = function(name, config, callback) {- this._show(); // show prior to transition- if (name && Y.Transition) {- if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default- if (typeof config === 'function') {- callback = config;- config = name;- }- name = Transition.SHOW_TRANSITION; - } - this.transition(name, config, callback);- } - return this;-};--var _wrapCallBack = function(anim, fn, callback) {- return function() {- if (fn) {- fn.call(anim);- }- if (callback) {- callback.apply(anim._node, arguments);- }- };-};--Y.Node.prototype.hide = function(name, config, callback) {- if (name && Y.Transition) {- if (typeof config === 'function') {- callback = config;- config = null;- }-- callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback- if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default- if (typeof config === 'function') {- callback = config;- config = name;- }- name = Transition.HIDE_TRANSITION; - } - this.transition(name, config, callback);- } else {- this._hide();- } - return this;-}; --/** - * Animate one or more css properties to a given value. Requires the "transition" module.- * <pre>example usage:- * Y.all('.demo').transition({- * duration: 1, // in seconds, default is 0.5- * easing: 'ease-out', // default is 'ease'- * delay: '1', // delay start for 1 second, default is 0- *- * height: '10px',- * width: '10px',- *- * opacity: { // per property- * value: 0,- * duration: 2,- * delay: 2,- * easing: 'ease-in'- * }- * });- * </pre>- * @for NodeList- * @method transition- * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. The callback fires- * once per item in the NodeList.- * @chainable-*/-Y.NodeList.prototype.transition = function(config, callback) {- var nodes = this._nodes,- i = 0,- node;-- while ((node = nodes[i++])) {- Y.one(node).transition(config, callback);- }-- return this;-};--Y.Node.prototype.toggleView = function(name, on, callback) {- this._toggles = this._toggles || [];- callback = arguments[arguments.length - 1];-- if (typeof name == 'boolean') { // no transition, just toggle- on = name;- name = null;- }-- name = name || Y.Transition.DEFAULT_TOGGLE;-- if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle- on = ! this._toggles[name];- }-- on = (on) ? 1 : 0;- if (on) {- this._show();- } else {- callback = _wrapCallBack(this, this._hide, callback);- }-- this._toggles[name] = on;- this.transition(Y.Transition.toggles[name][on], callback);-- return this;-};--Y.NodeList.prototype.toggleView = function(name, on, callback) {- var nodes = this._nodes,- i = 0,- node;-- while ((node = nodes[i++])) {- Y.one(node).toggleView(name, on, callback);- }-- return this;-};--Y.mix(Transition.fx, {- fadeOut: {- opacity: 0,- duration: 0.5,- easing: 'ease-out'- },-- fadeIn: {- opacity: 1,- duration: 0.5,- easing: 'ease-in'- },-- sizeOut: {- height: 0,- width: 0,- duration: 0.75,- easing: 'ease-out'- },-- sizeIn: {- height: function(node) {- return node.get('scrollHeight') + 'px';- },- width: function(node) {- return node.get('scrollWidth') + 'px';- },- duration: 0.5,- easing: 'ease-in',- - on: {- start: function() {- var overflow = this.getStyle('overflow');- if (overflow !== 'hidden') { // enable scrollHeight/Width- this.setStyle('overflow', 'hidden');- this._transitionOverflow = overflow;- }- },-- end: function() {- if (this._transitionOverflow) { // revert overridden value- this.setStyle('overflow', this._transitionOverflow);- delete this._transitionOverflow;- }- }- } - }-});--Y.mix(Transition.toggles, {- size: ['sizeOut', 'sizeIn'],- fade: ['fadeOut', 'fadeIn']-});--Transition.DEFAULT_TOGGLE = 'fade';----}, '3.7.2' ,{requires:['node-base']});
bundle/transition-timer/transition-timer-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/transition-timer/transition-timer.js", code: [] };-_yuitest_coverage["build/transition-timer/transition-timer.js"].code=["YUI.add('transition-timer', function (Y, NAME) {","","/**","* Provides the base Transition class, for animating numeric properties.","*","* @module transition","* @submodule transition-timer","*/","","","var Transition = Y.Transition;","","Y.mix(Transition.prototype, {"," _start: function() {"," if (Transition.useNative) {"," this._runNative();"," } else {"," this._runTimer();"," }"," },",""," _runTimer: function() {"," var anim = this;"," anim._initAttrs();",""," Transition._running[Y.stamp(anim)] = anim;"," anim._startTime = new Date();"," Transition._startTimer();"," },",""," _endTimer: function() {"," var anim = this;"," delete Transition._running[Y.stamp(anim)];"," anim._startTime = null;"," },",""," _runFrame: function() {"," var t = new Date() - this._startTime;"," this._runAttrs(t);"," },",""," _runAttrs: function(time) {"," var anim = this,"," node = anim._node,"," config = anim._config,"," uid = Y.stamp(node),"," attrs = Transition._nodeAttrs[uid],"," customAttr = Transition.behaviors,"," done = false,"," allDone = false,"," data,"," name,"," attribute,"," setter,"," elapsed,"," delay,"," d,"," t,"," i;",""," for (name in attrs) {"," if ((attribute = attrs[name]) && attribute.transition === anim) {"," d = attribute.duration;"," delay = attribute.delay;"," elapsed = (time - delay) / 1000;"," t = time;"," data = {"," type: 'propertyEnd',"," propertyName: name,"," config: config,"," elapsedTime: elapsed"," };",""," setter = (i in customAttr && 'set' in customAttr[i]) ?"," customAttr[i].set : Transition.DEFAULT_SETTER;",""," done = (t >= d);",""," if (t > d) {"," t = d;"," }",""," if (!delay || time >= delay) {"," setter(anim, name, attribute.from, attribute.to, t - delay, d - delay,"," attribute.easing, attribute.unit); ",""," if (done) {"," delete attrs[name];"," anim._count--;",""," if (config[name] && config[name].on && config[name].on.end) {"," config[name].on.end.call(Y.one(node), data);"," }",""," //node.fire('transition:propertyEnd', data);",""," if (!allDone && anim._count <= 0) {"," allDone = true;"," anim._end(elapsed);"," anim._endTimer();"," }"," }"," }",""," }"," }"," },",""," _initAttrs: function() {"," var anim = this,"," customAttr = Transition.behaviors,"," uid = Y.stamp(anim._node),"," attrs = Transition._nodeAttrs[uid],"," attribute,"," duration,"," delay,"," easing,"," val,"," name,"," mTo,"," mFrom,"," unit, begin, end;",""," for (name in attrs) {"," if ((attribute = attrs[name]) && attribute.transition === anim) {"," duration = attribute.duration * 1000;"," delay = attribute.delay * 1000;"," easing = attribute.easing;"," val = attribute.value;",""," // only allow supported properties"," if (name in anim._node.style || name in Y.DOM.CUSTOM_STYLES) {"," begin = (name in customAttr && 'get' in customAttr[name]) ?"," customAttr[name].get(anim, name) : Transition.DEFAULT_GETTER(anim, name);",""," mFrom = Transition.RE_UNITS.exec(begin);"," mTo = Transition.RE_UNITS.exec(val);",""," begin = mFrom ? mFrom[1] : begin;"," end = mTo ? mTo[1] : val;"," unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units",""," if (!unit && Transition.RE_DEFAULT_UNIT.test(name)) {"," unit = Transition.DEFAULT_UNIT;"," }",""," if (typeof easing === 'string') {"," if (easing.indexOf('cubic-bezier') > -1) {"," easing = easing.substring(13, easing.length - 1).split(',');"," } else if (Transition.easings[easing]) {"," easing = Transition.easings[easing];"," }"," }",""," attribute.from = Number(begin);"," attribute.to = Number(end);"," attribute.unit = unit;"," attribute.easing = easing;"," attribute.duration = duration + delay;"," attribute.delay = delay;"," } else {"," delete attrs[name];"," anim._count--;"," }"," }"," }"," },",""," destroy: function() {"," this.detachAll();"," this._node = null;"," }","}, true);","","Y.mix(Y.Transition, {"," _runtimeAttrs: {},"," /*"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," RE_DEFAULT_UNIT: /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,",""," /*"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," DEFAULT_UNIT: 'px',",""," /*"," * Time in milliseconds passed to setInterval for frame processing "," *"," * @property intervalTime"," * @default 20"," * @static"," */"," intervalTime: 20,",""," /*"," * Bucket for custom getters and setters"," *"," * @property behaviors"," * @static"," */"," behaviors: {"," left: {"," get: function(anim, attr) {"," return Y.DOM._getAttrOffset(anim._node, attr);"," }"," }"," },",""," /*"," * The default setter to use when setting object properties."," *"," * @property DEFAULT_SETTER"," * @static"," */"," DEFAULT_SETTER: function(anim, att, from, to, elapsed, duration, fn, unit) {"," from = Number(from);"," to = Number(to);",""," var node = anim._node,"," val = Transition.cubicBezier(fn, elapsed / duration);",""," val = from + val[0] * (to - from);",""," if (node) {"," if (att in node.style || att in Y.DOM.CUSTOM_STYLES) {"," unit = unit || '';"," Y.DOM.setStyle(node, att, val + unit);"," }"," } else {"," anim._end();"," }"," },",""," /*"," * The default getter to use when getting object properties."," *"," * @property DEFAULT_GETTER"," * @static"," */"," DEFAULT_GETTER: function(anim, att) {"," var node = anim._node,"," val = '';",""," if (att in node.style || att in Y.DOM.CUSTOM_STYLES) {"," val = Y.DOM.getComputedStyle(node, att);"," }",""," return val;"," },",""," _startTimer: function() {"," if (!Transition._timer) {"," Transition._timer = setInterval(Transition._runFrame, Transition.intervalTime);"," }"," },",""," _stopTimer: function() {"," clearInterval(Transition._timer);"," Transition._timer = null;"," },",""," /*"," * Called per Interval to handle each animation frame."," * @method _runFrame"," * @private"," * @static"," */ "," _runFrame: function() {"," var done = true,"," anim;"," for (anim in Transition._running) {"," if (Transition._running[anim]._runFrame) {"," done = false;"," Transition._running[anim]._runFrame();"," }"," }",""," if (done) {"," Transition._stopTimer();"," }"," },",""," cubicBezier: function(p, t) {"," var x0 = 0,"," y0 = 0,"," x1 = p[0],"," y1 = p[1],"," x2 = p[2],"," y2 = p[3],"," x3 = 1,"," y3 = 0,",""," A = x3 - 3 * x2 + 3 * x1 - x0,"," B = 3 * x2 - 6 * x1 + 3 * x0,"," C = 3 * x1 - 3 * x0,"," D = x0,"," E = y3 - 3 * y2 + 3 * y1 - y0,"," F = 3 * y2 - 6 * y1 + 3 * y0,"," G = 3 * y1 - 3 * y0,"," H = y0,",""," x = (((A*t) + B)*t + C)*t + D,"," y = (((E*t) + F)*t + G)*t + H;",""," return [x, y];"," },",""," easings: {"," ease: [0.25, 0, 1, 0.25],"," linear: [0, 0, 1, 1],"," 'ease-in': [0.42, 0, 1, 1],"," 'ease-out': [0, 0, 0.58, 1],"," 'ease-in-out': [0.42, 0, 0.58, 1]"," },",""," _running: {},"," _timer: null,",""," RE_UNITS: /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/","}, true); ","","Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left;","","Y.Transition = Transition;","","","}, '3.7.2', {\"requires\": [\"transition\"]});"];+_yuitest_coverage["build/transition-timer/transition-timer.js"].code=["YUI.add('transition-timer', function (Y, NAME) {","","/**","* Provides the base Transition class, for animating numeric properties.","*","* @module transition","* @submodule transition-timer","*/","","","var Transition = Y.Transition;","","Y.mix(Transition.prototype, {"," _start: function() {"," if (Transition.useNative) {"," this._runNative();"," } else {"," this._runTimer();"," }"," },",""," _runTimer: function() {"," var anim = this;"," anim._initAttrs();",""," Transition._running[Y.stamp(anim)] = anim;"," anim._startTime = new Date();"," Transition._startTimer();"," },",""," _endTimer: function() {"," var anim = this;"," delete Transition._running[Y.stamp(anim)];"," anim._startTime = null;"," },",""," _runFrame: function() {"," var t = new Date() - this._startTime;"," this._runAttrs(t);"," },",""," _runAttrs: function(time) {"," var anim = this,"," node = anim._node,"," config = anim._config,"," uid = Y.stamp(node),"," attrs = Transition._nodeAttrs[uid],"," customAttr = Transition.behaviors,"," done = false,"," allDone = false,"," data,"," name,"," attribute,"," setter,"," elapsed,"," delay,"," d,"," t,"," i;",""," for (name in attrs) {"," if ((attribute = attrs[name]) && attribute.transition === anim) {"," d = attribute.duration;"," delay = attribute.delay;"," elapsed = (time - delay) / 1000;"," t = time;"," data = {"," type: 'propertyEnd',"," propertyName: name,"," config: config,"," elapsedTime: elapsed"," };",""," setter = (i in customAttr && 'set' in customAttr[i]) ?"," customAttr[i].set : Transition.DEFAULT_SETTER;",""," done = (t >= d);",""," if (t > d) {"," t = d;"," }",""," if (!delay || time >= delay) {"," setter(anim, name, attribute.from, attribute.to, t - delay, d - delay,"," attribute.easing, attribute.unit); ",""," if (done) {"," delete attrs[name];"," anim._count--;",""," if (config[name] && config[name].on && config[name].on.end) {"," config[name].on.end.call(Y.one(node), data);"," }",""," //node.fire('transition:propertyEnd', data);",""," if (!allDone && anim._count <= 0) {"," allDone = true;"," anim._end(elapsed);"," anim._endTimer();"," }"," }"," }",""," }"," }"," },",""," _initAttrs: function() {"," var anim = this,"," customAttr = Transition.behaviors,"," uid = Y.stamp(anim._node),"," attrs = Transition._nodeAttrs[uid],"," attribute,"," duration,"," delay,"," easing,"," val,"," name,"," mTo,"," mFrom,"," unit, begin, end;",""," for (name in attrs) {"," if ((attribute = attrs[name]) && attribute.transition === anim) {"," duration = attribute.duration * 1000;"," delay = attribute.delay * 1000;"," easing = attribute.easing;"," val = attribute.value;",""," // only allow supported properties"," if (name in anim._node.style || name in Y.DOM.CUSTOM_STYLES) {"," begin = (name in customAttr && 'get' in customAttr[name]) ?"," customAttr[name].get(anim, name) : Transition.DEFAULT_GETTER(anim, name);",""," mFrom = Transition.RE_UNITS.exec(begin);"," mTo = Transition.RE_UNITS.exec(val);",""," begin = mFrom ? mFrom[1] : begin;"," end = mTo ? mTo[1] : val;"," unit = mTo ? mTo[2] : mFrom ? mFrom[2] : ''; // one might be zero TODO: mixed units",""," if (!unit && Transition.RE_DEFAULT_UNIT.test(name)) {"," unit = Transition.DEFAULT_UNIT;"," }",""," if (typeof easing === 'string') {"," if (easing.indexOf('cubic-bezier') > -1) {"," easing = easing.substring(13, easing.length - 1).split(',');"," } else if (Transition.easings[easing]) {"," easing = Transition.easings[easing];"," }"," }",""," attribute.from = Number(begin);"," attribute.to = Number(end);"," attribute.unit = unit;"," attribute.easing = easing;"," attribute.duration = duration + delay;"," attribute.delay = delay;"," } else {"," delete attrs[name];"," anim._count--;"," }"," }"," }"," },",""," destroy: function() {"," this.detachAll();"," this._node = null;"," }","}, true);","","Y.mix(Y.Transition, {"," _runtimeAttrs: {},"," /*"," * Regex of properties that should use the default unit."," *"," * @property RE_DEFAULT_UNIT"," * @static"," */"," RE_DEFAULT_UNIT: /^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,",""," /*"," * The default unit to use with properties that pass the RE_DEFAULT_UNIT test."," *"," * @property DEFAULT_UNIT"," * @static"," */"," DEFAULT_UNIT: 'px',",""," /*"," * Time in milliseconds passed to setInterval for frame processing "," *"," * @property intervalTime"," * @default 20"," * @static"," */"," intervalTime: 20,",""," /*"," * Bucket for custom getters and setters"," *"," * @property behaviors"," * @static"," */"," behaviors: {"," left: {"," get: function(anim, attr) {"," return Y.DOM._getAttrOffset(anim._node, attr);"," }"," }"," },",""," /*"," * The default setter to use when setting object properties."," *"," * @property DEFAULT_SETTER"," * @static"," */"," DEFAULT_SETTER: function(anim, att, from, to, elapsed, duration, fn, unit) {"," from = Number(from);"," to = Number(to);",""," var node = anim._node,"," val = Transition.cubicBezier(fn, elapsed / duration);",""," val = from + val[0] * (to - from);",""," if (node) {"," if (att in node.style || att in Y.DOM.CUSTOM_STYLES) {"," unit = unit || '';"," Y.DOM.setStyle(node, att, val + unit);"," }"," } else {"," anim._end();"," }"," },",""," /*"," * The default getter to use when getting object properties."," *"," * @property DEFAULT_GETTER"," * @static"," */"," DEFAULT_GETTER: function(anim, att) {"," var node = anim._node,"," val = '';",""," if (att in node.style || att in Y.DOM.CUSTOM_STYLES) {"," val = Y.DOM.getComputedStyle(node, att);"," }",""," return val;"," },",""," _startTimer: function() {"," if (!Transition._timer) {"," Transition._timer = setInterval(Transition._runFrame, Transition.intervalTime);"," }"," },",""," _stopTimer: function() {"," clearInterval(Transition._timer);"," Transition._timer = null;"," },",""," /*"," * Called per Interval to handle each animation frame."," * @method _runFrame"," * @private"," * @static"," */ "," _runFrame: function() {"," var done = true,"," anim;"," for (anim in Transition._running) {"," if (Transition._running[anim]._runFrame) {"," done = false;"," Transition._running[anim]._runFrame();"," }"," }",""," if (done) {"," Transition._stopTimer();"," }"," },",""," cubicBezier: function(p, t) {"," var x0 = 0,"," y0 = 0,"," x1 = p[0],"," y1 = p[1],"," x2 = p[2],"," y2 = p[3],"," x3 = 1,"," y3 = 0,",""," A = x3 - 3 * x2 + 3 * x1 - x0,"," B = 3 * x2 - 6 * x1 + 3 * x0,"," C = 3 * x1 - 3 * x0,"," D = x0,"," E = y3 - 3 * y2 + 3 * y1 - y0,"," F = 3 * y2 - 6 * y1 + 3 * y0,"," G = 3 * y1 - 3 * y0,"," H = y0,",""," x = (((A*t) + B)*t + C)*t + D,"," y = (((E*t) + F)*t + G)*t + H;",""," return [x, y];"," },",""," easings: {"," ease: [0.25, 0, 1, 0.25],"," linear: [0, 0, 1, 1],"," 'ease-in': [0.42, 0, 1, 1],"," 'ease-out': [0, 0, 0.58, 1],"," 'ease-in-out': [0.42, 0, 0.58, 1]"," },",""," _running: {},"," _timer: null,",""," RE_UNITS: /^(-?\\d*\\.?\\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/","}, true); ","","Transition.behaviors.top = Transition.behaviors.bottom = Transition.behaviors.right = Transition.behaviors.left;","","Y.Transition = Transition;","","","}, '3.7.3', {\"requires\": [\"transition\"]});"]; _yuitest_coverage["build/transition-timer/transition-timer.js"].lines = {"1":0,"11":0,"13":0,"15":0,"16":0,"18":0,"23":0,"24":0,"26":0,"27":0,"28":0,"32":0,"33":0,"34":0,"38":0,"39":0,"43":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"74":0,"77":0,"79":0,"80":0,"83":0,"84":0,"87":0,"88":0,"89":0,"91":0,"92":0,"97":0,"98":0,"99":0,"100":0,"110":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"132":0,"133":0,"136":0,"137":0,"139":0,"140":0,"141":0,"143":0,"144":0,"147":0,"148":0,"149":0,"150":0,"151":0,"155":0,"156":0,"157":0,"158":0,"159":0,"160":0,"162":0,"163":0,"170":0,"171":0,"175":0,"211":0,"223":0,"224":0,"226":0,"229":0,"231":0,"232":0,"233":0,"234":0,"237":0,"248":0,"251":0,"252":0,"255":0,"259":0,"260":0,"265":0,"266":0,"276":0,"278":0,"279":0,"280":0,"281":0,"285":0,"286":0,"291":0,"312":0,"329":0,"331":0}; _yuitest_coverage["build/transition-timer/transition-timer.js"].functions = {"_start:14":0,"_runTimer:22":0,"_endTimer:31":0,"_runFrame:37":0,"_runAttrs:42":0,"_initAttrs:109":0,"destroy:169":0,"get:210":0,"DEFAULT_SETTER:222":0,"DEFAULT_GETTER:247":0,"_startTimer:258":0,"_stopTimer:264":0,"_runFrame:275":0,"cubicBezier:290":0,"(anonymous 1):1":0}; _yuitest_coverage["build/transition-timer/transition-timer.js"].coveredLines = 100;@@ -485,4 +485,4 @@ Y.Transition = Transition; -}, '3.7.2', {"requires": ["transition"]});+}, '3.7.3', {"requires": ["transition"]});
bundle/transition-timer/transition-timer-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -337,4 +337,4 @@ Y.Transition = Transition; -}, '3.7.2', {"requires": ["transition"]});+}, '3.7.3', {"requires": ["transition"]});
bundle/transition-timer/transition-timer-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("transition-timer",function(e,t){var n=e.Transition;e.mix(n.prototype,{_start:function(){n.useNative?this._runNative():this._runTimer()},_runTimer:function(){var t=this;t._initAttrs(),n._running[e.stamp(t)]=t,t._startTime=new Date,n._startTimer()},_endTimer:function(){var t=this;delete n._running[e.stamp(t)],t._startTime=null},_runFrame:function(){var e=new Date-this._startTime;this._runAttrs(e)},_runAttrs:function(t){var r=this,i=r._node,s=r._config,o=e.stamp(i),u=n._nodeAttrs[o],a=n.behaviors,f=!1,l=!1,c,h,p,d,v,m,g,y,b;for(h in u)if((p=u[h])&&p.transition===r){g=p.duration,m=p.delay,v=(t-m)/1e3,y=t,c={type:"propertyEnd",propertyName:h,config:s,elapsedTime:v},d=b in a&&"set"in a[b]?a[b].set:n.DEFAULT_SETTER,f=y>=g,y>g&&(y=g);if(!m||t>=m)d(r,h,p.from,p.to,y-m,g-m,p.easing,p.unit),f&&(delete u[h],r._count--,s[h]&&s[h].on&&s[h].on.end&&s[h].on.end.call(e.one(i),c),!l&&r._count<=0&&(l=!0,r._end(v),r._endTimer()))}},_initAttrs:function(){var t=this,r=n.behaviors,i=e.stamp(t._node),s=n._nodeAttrs[i],o,u,a,f,l,c,h,p,d,v,m;for(c in s)(o=s[c])&&o.transition===t&&(u=o.duration*1e3,a=o.delay*1e3,f=o.easing,l=o.value,c in t._node.style||c in e.DOM.CUSTOM_STYLES?(v=c in r&&"get"in r[c]?r[c].get(t,c):n.DEFAULT_GETTER(t,c),p=n.RE_UNITS.exec(v),h=n.RE_UNITS.exec(l),v=p?p[1]:v,m=h?h[1]:l,d=h?h[2]:p?p[2]:"",!d&&n.RE_DEFAULT_UNIT.test(c)&&(d=n.DEFAULT_UNIT),typeof f=="string"&&(f.indexOf("cubic-bezier")>-1?f=f.substring(13,f.length-1).split(","):n.easings[f]&&(f=n.easings[f])),o.from=Number(v),o.to=Number(m),o.unit=d,o.easing=f,o.duration=u+a,o.delay=a):(delete s[c],t._count--))},destroy:function(){this.detachAll(),this._node=null}},!0),e.mix(e.Transition,{_runtimeAttrs:{},RE_DEFAULT_UNIT:/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,DEFAULT_UNIT:"px",intervalTime:20,behaviors:{left:{get:function(t,n){return e.DOM._getAttrOffset(t._node,n)}}},DEFAULT_SETTER:function(t,r,i,s,o,u,a,f){i=Number(i),s=Number(s);var l=t._node,c=n.cubicBezier(a,o/u);c=i+c[0]*(s-i);if(l){if(r in l.style||r in e.DOM.CUSTOM_STYLES)f=f||"",e.DOM.setStyle(l,r,c+f)}else t._end()},DEFAULT_GETTER:function(t,n){var r=t._node,i="";if(n in r.style||n in e.DOM.CUSTOM_STYLES)i=e.DOM.getComputedStyle(r,n);return i},_startTimer:function(){n._timer||(n._timer=setInterval(n._runFrame,n.intervalTime))},_stopTimer:function(){clearInterval(n._timer),n._timer=null},_runFrame:function(){var e=!0,t;for(t in n._running)n._running[t]._runFrame&&(e=!1,n._running[t]._runFrame());e&&n._stopTimer()},cubicBezier:function(e,t){var n=0,r=0,i=e[0],s=e[1],o=e[2],u=e[3],a=1,f=0,l=a-3*o+3*i-n,c=3*o-6*i+3*n,h=3*i-3*n,p=n,d=f-3*u+3*s-r,v=3*u-6*s+3*r,m=3*s-3*r,g=r,y=((l*t+c)*t+h)*t+p,b=((d*t+v)*t+m)*t+g;return[y,b]},easings:{ease:[.25,0,1,.25],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},_running:{},_timer:null,RE_UNITS:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/},!0),n.behaviors.top=n.behaviors.bottom=n.behaviors.right=n.behaviors.left,e.Transition=n},"3.7.2",{requires:["transition"]});+YUI.add("transition-timer",function(e,t){var n=e.Transition;e.mix(n.prototype,{_start:function(){n.useNative?this._runNative():this._runTimer()},_runTimer:function(){var t=this;t._initAttrs(),n._running[e.stamp(t)]=t,t._startTime=new Date,n._startTimer()},_endTimer:function(){var t=this;delete n._running[e.stamp(t)],t._startTime=null},_runFrame:function(){var e=new Date-this._startTime;this._runAttrs(e)},_runAttrs:function(t){var r=this,i=r._node,s=r._config,o=e.stamp(i),u=n._nodeAttrs[o],a=n.behaviors,f=!1,l=!1,c,h,p,d,v,m,g,y,b;for(h in u)if((p=u[h])&&p.transition===r){g=p.duration,m=p.delay,v=(t-m)/1e3,y=t,c={type:"propertyEnd",propertyName:h,config:s,elapsedTime:v},d=b in a&&"set"in a[b]?a[b].set:n.DEFAULT_SETTER,f=y>=g,y>g&&(y=g);if(!m||t>=m)d(r,h,p.from,p.to,y-m,g-m,p.easing,p.unit),f&&(delete u[h],r._count--,s[h]&&s[h].on&&s[h].on.end&&s[h].on.end.call(e.one(i),c),!l&&r._count<=0&&(l=!0,r._end(v),r._endTimer()))}},_initAttrs:function(){var t=this,r=n.behaviors,i=e.stamp(t._node),s=n._nodeAttrs[i],o,u,a,f,l,c,h,p,d,v,m;for(c in s)(o=s[c])&&o.transition===t&&(u=o.duration*1e3,a=o.delay*1e3,f=o.easing,l=o.value,c in t._node.style||c in e.DOM.CUSTOM_STYLES?(v=c in r&&"get"in r[c]?r[c].get(t,c):n.DEFAULT_GETTER(t,c),p=n.RE_UNITS.exec(v),h=n.RE_UNITS.exec(l),v=p?p[1]:v,m=h?h[1]:l,d=h?h[2]:p?p[2]:"",!d&&n.RE_DEFAULT_UNIT.test(c)&&(d=n.DEFAULT_UNIT),typeof f=="string"&&(f.indexOf("cubic-bezier")>-1?f=f.substring(13,f.length-1).split(","):n.easings[f]&&(f=n.easings[f])),o.from=Number(v),o.to=Number(m),o.unit=d,o.easing=f,o.duration=u+a,o.delay=a):(delete s[c],t._count--))},destroy:function(){this.detachAll(),this._node=null}},!0),e.mix(e.Transition,{_runtimeAttrs:{},RE_DEFAULT_UNIT:/^width|height|top|right|bottom|left|margin.*|padding.*|border.*$/i,DEFAULT_UNIT:"px",intervalTime:20,behaviors:{left:{get:function(t,n){return e.DOM._getAttrOffset(t._node,n)}}},DEFAULT_SETTER:function(t,r,i,s,o,u,a,f){i=Number(i),s=Number(s);var l=t._node,c=n.cubicBezier(a,o/u);c=i+c[0]*(s-i);if(l){if(r in l.style||r in e.DOM.CUSTOM_STYLES)f=f||"",e.DOM.setStyle(l,r,c+f)}else t._end()},DEFAULT_GETTER:function(t,n){var r=t._node,i="";if(n in r.style||n in e.DOM.CUSTOM_STYLES)i=e.DOM.getComputedStyle(r,n);return i},_startTimer:function(){n._timer||(n._timer=setInterval(n._runFrame,n.intervalTime))},_stopTimer:function(){clearInterval(n._timer),n._timer=null},_runFrame:function(){var e=!0,t;for(t in n._running)n._running[t]._runFrame&&(e=!1,n._running[t]._runFrame());e&&n._stopTimer()},cubicBezier:function(e,t){var n=0,r=0,i=e[0],s=e[1],o=e[2],u=e[3],a=1,f=0,l=a-3*o+3*i-n,c=3*o-6*i+3*n,h=3*i-3*n,p=n,d=f-3*u+3*s-r,v=3*u-6*s+3*r,m=3*s-3*r,g=r,y=((l*t+c)*t+h)*t+p,b=((d*t+v)*t+m)*t+g;return[y,b]},easings:{ease:[.25,0,1,.25],linear:[0,0,1,1],"ease-in":[.42,0,1,1],"ease-out":[0,0,.58,1],"ease-in-out":[.42,0,.58,1]},_running:{},_timer:null,RE_UNITS:/^(-?\d*\.?\d*){1}(em|ex|px|in|cm|mm|pt|pc|%)*$/},!0),n.behaviors.top=n.behaviors.bottom=n.behaviors.right=n.behaviors.left,e.Transition=n},"3.7.3",{requires:["transition"]});
bundle/transition-timer/transition-timer.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -337,4 +337,4 @@ Y.Transition = Transition; -}, '3.7.2', {"requires": ["transition"]});+}, '3.7.3', {"requires": ["transition"]});
bundle/transition/transition-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/transition/transition.js", code: [] };-_yuitest_coverage["build/transition/transition.js"].code=["YUI.add('transition', function (Y, NAME) {","","/**","* Provides the transition method for Node.","* Transition has no API of its own, but adds the transition method to Node.","*","* @module transition","* @requires node-style","*/","","var CAMEL_VENDOR_PREFIX = '',"," VENDOR_PREFIX = '',"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," TRANSITION = 'transition',"," TRANSITION_CAMEL = 'Transition',"," TRANSITION_PROPERTY_CAMEL,"," TRANSITION_PROPERTY,"," TRANSITION_DURATION,"," TRANSITION_TIMING_FUNCTION,"," TRANSITION_DELAY,"," TRANSITION_END,"," ON_TRANSITION_END,"," TRANSFORM_CAMEL,",""," EMPTY_OBJ = {},",""," VENDORS = ["," 'Webkit',"," 'Moz'"," ],",""," VENDOR_TRANSITION_END = {"," Webkit: 'webkitTransitionEnd'"," },","","/**"," * A class for constructing transition instances."," * Adds the \"transition\" method to Node."," * @class Transition"," * @constructor"," */","","Transition = function() {"," this.init.apply(this, arguments);","};","","Transition._toCamel = function(property) {"," property = property.replace(/-([a-z])/gi, function(m0, m1) {"," return m1.toUpperCase();"," });",""," return property;","};","","Transition._toHyphen = function(property) {"," property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {"," var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;"," "," if (m3) {"," str += '-' + m3.toLowerCase();"," }",""," return str;"," }); ",""," return property;","};","","Transition.SHOW_TRANSITION = 'fadeIn';","Transition.HIDE_TRANSITION = 'fadeOut';","","Transition.useNative = false;","","Y.Array.each(VENDORS, function(val) { // then vendor specific"," var property = val + TRANSITION_CAMEL;"," if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {"," CAMEL_VENDOR_PREFIX = val;"," VENDOR_PREFIX = Transition._toHyphen(val) + '-';",""," Transition.useNative = true;"," Transition.supported = true; // TODO: remove"," Transition._VENDOR_PREFIX = val;"," }","});","","TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;","TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';","TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';","TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';","TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';","TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';","TRANSITION_END = 'transitionend';","ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';","","TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;","","TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';","","Transition.fx = {};","Transition.toggles = {};","","Transition._hasEnd = {};","","Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;","","Y.Node.DOM_EVENTS[TRANSITION_END] = 1; ","","Transition.NAME = 'transition';","","Transition.DEFAULT_EASING = 'ease';","Transition.DEFAULT_DURATION = 0.5;","Transition.DEFAULT_DELAY = 0;","","Transition._nodeAttrs = {};","","Transition.prototype = {"," constructor: Transition,"," init: function(node, config) {"," var anim = this;"," anim._node = node;"," if (!anim._running && config) {"," anim._config = config;"," node._transition = anim; // cache for reuse",""," anim._duration = ('duration' in config) ?"," config.duration: anim.constructor.DEFAULT_DURATION;",""," anim._delay = ('delay' in config) ?"," config.delay: anim.constructor.DEFAULT_DELAY;",""," anim._easing = config.easing || anim.constructor.DEFAULT_EASING;"," anim._count = 0; // track number of animated properties"," anim._running = false;",""," }",""," return anim;"," },",""," addProperty: function(prop, config) {"," var anim = this,"," node = this._node,"," uid = Y.stamp(node),"," nodeInstance = Y.one(node),"," attrs = Transition._nodeAttrs[uid],"," computed,"," compareVal,"," dur,"," attr,"," val;",""," if (!attrs) {"," attrs = Transition._nodeAttrs[uid] = {};"," }",""," attr = attrs[prop];",""," // might just be a value"," if (config && config.value !== undefined) {"," val = config.value;"," } else if (config !== undefined) {"," val = config; "," config = EMPTY_OBJ;"," }",""," if (typeof val === 'function') {"," val = val.call(nodeInstance, nodeInstance);"," }",""," if (attr && attr.transition) {"," // take control if another transition owns this property"," if (attr.transition !== anim) {"," attr.transition._count--; // remapping attr to this transition"," }"," } ",""," anim._count++; // properties per transition",""," // make 0 async and fire events"," dur = ((typeof config.duration != 'undefined') ? config.duration :"," anim._duration) || 0.0001;",""," attrs[prop] = {"," value: val,"," duration: dur,"," delay: (typeof config.delay != 'undefined') ? config.delay :"," anim._delay,",""," easing: config.easing || anim._easing,",""," transition: anim"," };",""," // native end event doesnt fire when setting to same value"," // supplementing with timer"," // val may be a string or number (height: 0, etc), but computedStyle is always string"," computed = Y.DOM.getComputedStyle(node, prop);"," compareVal = (typeof val === 'string') ? computed : parseFloat(computed);",""," if (Transition.useNative && compareVal === val) {"," setTimeout(function() {"," anim._onNativeEnd.call(node, {"," propertyName: prop,"," elapsedTime: dur"," });"," }, dur * 1000);"," }"," },",""," removeProperty: function(prop) {"," var anim = this,"," attrs = Transition._nodeAttrs[Y.stamp(anim._node)];",""," if (attrs && attrs[prop]) {"," delete attrs[prop];"," anim._count--;"," }",""," },",""," initAttrs: function(config) {"," var attr,"," node = this._node;",""," if (config.transform && !config[TRANSFORM_CAMEL]) {"," config[TRANSFORM_CAMEL] = config.transform;"," delete config.transform; // TODO: copy"," }",""," for (attr in config) {"," if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {"," this.addProperty(attr, config[attr]);",""," // when size is auto or % webkit starts from zero instead of computed "," // (https://bugs.webkit.org/show_bug.cgi?id=16020)"," // TODO: selective set"," if (node.style[attr] === '') {"," Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr));"," }"," }"," }"," },",""," /**"," * Starts or an animation."," * @method run"," * @chainable"," * @private"," */ "," run: function(callback) {"," var anim = this,"," node = anim._node,"," config = anim._config,"," data = {"," type: 'transition:start',"," config: config"," };","",""," if (!anim._running) {"," anim._running = true;",""," if (config.on && config.on.start) {"," config.on.start.call(Y.one(node), data);"," }",""," anim.initAttrs(anim._config);",""," anim._callback = callback;"," anim._start();"," }","",""," return anim;"," },",""," _start: function() {"," this._runNative();"," },",""," _prepDur: function(dur) {"," dur = parseFloat(dur);",""," return dur + 's';"," },",""," _runNative: function(time) {"," var anim = this,"," node = anim._node,"," uid = Y.stamp(node),"," style = node.style,"," computed = node.ownerDocument.defaultView.getComputedStyle(node),"," attrs = Transition._nodeAttrs[uid],"," cssText = '',"," cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)],",""," transitionText = TRANSITION_PROPERTY + ': ',"," duration = TRANSITION_DURATION + ': ',"," easing = TRANSITION_TIMING_FUNCTION + ': ',"," delay = TRANSITION_DELAY + ': ',"," hyphy,"," attr,"," name;",""," // preserve existing transitions"," if (cssTransition !== 'all') {"," transitionText += cssTransition + ',';"," duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';"," easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';"," delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ',';",""," }",""," // run transitions mapped to this instance"," for (name in attrs) {"," hyphy = Transition._toHyphen(name);"," attr = attrs[name];"," if ((attr = attrs[name]) && attr.transition === anim) {"," if (name in node.style) { // only native styles allowed"," duration += anim._prepDur(attr.duration) + ',';"," delay += anim._prepDur(attr.delay) + ',';"," easing += (attr.easing) + ',';",""," transitionText += hyphy + ',';"," cssText += hyphy + ': ' + attr.value + '; ';"," } else {"," this.removeProperty(name);"," }"," }"," }",""," transitionText = transitionText.replace(/,$/, ';');"," duration = duration.replace(/,$/, ';');"," easing = easing.replace(/,$/, ';');"," delay = delay.replace(/,$/, ';');",""," // only one native end event per node"," if (!Transition._hasEnd[uid]) {"," node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');"," Transition._hasEnd[uid] = true;",""," }"," "," style.cssText += transitionText + duration + easing + delay + cssText;",""," },",""," _end: function(elapsed) {"," var anim = this,"," node = anim._node,"," callback = anim._callback,"," config = anim._config,"," data = {"," type: 'transition:end',"," config: config,"," elapsedTime: elapsed "," },",""," nodeInstance = Y.one(node); ",""," anim._running = false;"," anim._callback = null;",""," if (node) {"," if (config.on && config.on.end) {"," setTimeout(function() { // IE: allow previous update to finish"," config.on.end.call(nodeInstance, data);",""," // nested to ensure proper fire order"," if (callback) {"," callback.call(nodeInstance, data);"," }",""," }, 1);"," } else if (callback) {"," setTimeout(function() { // IE: allow previous update to finish"," callback.call(nodeInstance, data);"," }, 1);"," }"," }",""," },",""," _endNative: function(name) {"," var node = this._node,"," value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)];",""," name = Transition._toHyphen(name);"," if (typeof value === 'string') {"," value = value.replace(new RegExp('(?:^|,\\\\s)' + name + ',?'), ',');"," value = value.replace(/^,|,$/, '');"," node.style[TRANSITION_CAMEL] = value;"," }"," },",""," _onNativeEnd: function(e) {"," var node = this,"," uid = Y.stamp(node),"," event = e,//e._event,"," name = Transition._toCamel(event.propertyName),"," elapsed = event.elapsedTime,"," attrs = Transition._nodeAttrs[uid],"," attr = attrs[name],"," anim = (attr) ? attr.transition : null,"," data,"," config;",""," if (anim) {"," anim.removeProperty(name);"," anim._endNative(name);"," config = anim._config[name];",""," data = {"," type: 'propertyEnd',"," propertyName: name,"," elapsedTime: elapsed,"," config: config"," };",""," if (config && config.on && config.on.end) {"," config.on.end.call(Y.one(node), data);"," }",""," if (anim._count <= 0) { // after propertyEnd fires"," anim._end(elapsed);"," node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style"," }"," }"," },",""," destroy: function() {"," var anim = this,"," node = anim._node;",""," if (node) {"," node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);"," anim._node = null;"," }"," }","};","","Y.Transition = Transition;","Y.TransitionNative = Transition; // TODO: remove","","/** "," * Animate one or more css properties to a given value. Requires the \"transition\" module."," * <pre>example usage:"," * Y.one('#demo').transition({"," * duration: 1, // in seconds, default is 0.5"," * easing: 'ease-out', // default is 'ease'"," * delay: '1', // delay start for 1 second, default is 0"," *"," * height: '10px',"," * width: '10px',"," *"," * opacity: { // per property"," * value: 0,"," * duration: 2,"," * delay: 2,"," * easing: 'ease-in'"," * }"," * });"," * </pre>"," * @for Node"," * @method transition"," * @param {Object} config An object containing one or more style properties, a duration and an easing."," * @param {Function} callback A function to run after the transition has completed. "," * @chainable","*/","Y.Node.prototype.transition = function(name, config, callback) {"," var "," transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)],"," anim = (transitionAttrs) ? transitionAttrs.transition || null : null,"," fxConfig,"," prop;"," "," if (typeof name === 'string') { // named effect, pull config from registry"," if (typeof config === 'function') {"," callback = config;"," config = null;"," }",""," fxConfig = Transition.fx[name];",""," if (config && typeof config !== 'boolean') {"," config = Y.clone(config);",""," for (prop in fxConfig) {"," if (fxConfig.hasOwnProperty(prop)) {"," if (! (prop in config)) {"," config[prop] = fxConfig[prop]; "," }"," }"," }"," } else {"," config = fxConfig;"," }",""," } else { // name is a config, config is a callback or undefined"," callback = config;"," config = name;"," }",""," if (anim && !anim._running) {"," anim.init(this, config);"," } else {"," anim = new Transition(this._node, config);"," }",""," anim.run(callback);"," return this;","};","","Y.Node.prototype.show = function(name, config, callback) {"," this._show(); // show prior to transition"," if (name && Y.Transition) {"," if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default"," if (typeof config === 'function') {"," callback = config;"," config = name;"," }"," name = Transition.SHOW_TRANSITION; "," } "," this.transition(name, config, callback);"," } "," return this;","};","","var _wrapCallBack = function(anim, fn, callback) {"," return function() {"," if (fn) {"," fn.call(anim);"," }"," if (callback) {"," callback.apply(anim._node, arguments);"," }"," };","};","","Y.Node.prototype.hide = function(name, config, callback) {"," if (name && Y.Transition) {"," if (typeof config === 'function') {"," callback = config;"," config = null;"," }",""," callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback"," if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default"," if (typeof config === 'function') {"," callback = config;"," config = name;"," }"," name = Transition.HIDE_TRANSITION; "," } "," this.transition(name, config, callback);"," } else {"," this._hide();"," } "," return this;","}; ","","/** "," * Animate one or more css properties to a given value. Requires the \"transition\" module."," * <pre>example usage:"," * Y.all('.demo').transition({"," * duration: 1, // in seconds, default is 0.5"," * easing: 'ease-out', // default is 'ease'"," * delay: '1', // delay start for 1 second, default is 0"," *"," * height: '10px',"," * width: '10px',"," *"," * opacity: { // per property"," * value: 0,"," * duration: 2,"," * delay: 2,"," * easing: 'ease-in'"," * }"," * });"," * </pre>"," * @for NodeList"," * @method transition"," * @param {Object} config An object containing one or more style properties, a duration and an easing."," * @param {Function} callback A function to run after the transition has completed. The callback fires"," * once per item in the NodeList."," * @chainable","*/","Y.NodeList.prototype.transition = function(config, callback) {"," var nodes = this._nodes,"," i = 0,"," node;",""," while ((node = nodes[i++])) {"," Y.one(node).transition(config, callback);"," }",""," return this;","};","","Y.Node.prototype.toggleView = function(name, on, callback) {"," this._toggles = this._toggles || [];"," callback = arguments[arguments.length - 1];",""," if (typeof name == 'boolean') { // no transition, just toggle"," on = name;"," name = null;"," }",""," name = name || Y.Transition.DEFAULT_TOGGLE;",""," if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle"," on = ! this._toggles[name];"," }",""," on = (on) ? 1 : 0;"," if (on) {"," this._show();"," } else {"," callback = _wrapCallBack(this, this._hide, callback);"," }",""," this._toggles[name] = on;"," this.transition(Y.Transition.toggles[name][on], callback);",""," return this;","};","","Y.NodeList.prototype.toggleView = function(name, on, callback) {"," var nodes = this._nodes,"," i = 0,"," node;",""," while ((node = nodes[i++])) {"," Y.one(node).toggleView(name, on, callback);"," }",""," return this;","};","","Y.mix(Transition.fx, {"," fadeOut: {"," opacity: 0,"," duration: 0.5,"," easing: 'ease-out'"," },",""," fadeIn: {"," opacity: 1,"," duration: 0.5,"," easing: 'ease-in'"," },",""," sizeOut: {"," height: 0,"," width: 0,"," duration: 0.75,"," easing: 'ease-out'"," },",""," sizeIn: {"," height: function(node) {"," return node.get('scrollHeight') + 'px';"," },"," width: function(node) {"," return node.get('scrollWidth') + 'px';"," },"," duration: 0.5,"," easing: 'ease-in',"," "," on: {"," start: function() {"," var overflow = this.getStyle('overflow');"," if (overflow !== 'hidden') { // enable scrollHeight/Width"," this.setStyle('overflow', 'hidden');"," this._transitionOverflow = overflow;"," }"," },",""," end: function() {"," if (this._transitionOverflow) { // revert overridden value"," this.setStyle('overflow', this._transitionOverflow);"," delete this._transitionOverflow;"," }"," }"," } "," }","});","","Y.mix(Transition.toggles, {"," size: ['sizeOut', 'sizeIn'],"," fade: ['fadeOut', 'fadeIn']","});","","Transition.DEFAULT_TOGGLE = 'fade';","","","","}, '3.7.2', {\"requires\": [\"node-style\"]});"];-_yuitest_coverage["build/transition/transition.js"].lines = {"1":0,"11":0,"45":0,"48":0,"49":0,"50":0,"53":0,"56":0,"57":0,"58":0,"60":0,"61":0,"64":0,"67":0,"70":0,"71":0,"73":0,"75":0,"76":0,"77":0,"78":0,"79":0,"81":0,"82":0,"83":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"96":0,"98":0,"100":0,"101":0,"103":0,"105":0,"107":0,"109":0,"111":0,"112":0,"113":0,"115":0,"117":0,"120":0,"121":0,"122":0,"123":0,"124":0,"126":0,"129":0,"132":0,"133":0,"134":0,"138":0,"142":0,"153":0,"154":0,"157":0,"160":0,"161":0,"162":0,"163":0,"164":0,"167":0,"168":0,"171":0,"173":0,"174":0,"178":0,"181":0,"184":0,"198":0,"199":0,"201":0,"202":0,"203":0,"212":0,"215":0,"216":0,"217":0,"223":0,"226":0,"227":0,"228":0,"231":0,"232":0,"233":0,"238":0,"239":0,"252":0,"261":0,"262":0,"264":0,"265":0,"268":0,"270":0,"271":0,"275":0,"279":0,"283":0,"285":0,"289":0,"307":0,"308":0,"309":0,"310":0,"311":0,"316":0,"317":0,"318":0,"319":0,"320":0,"321":0,"322":0,"323":0,"325":0,"326":0,"328":0,"333":0,"334":0,"335":0,"336":0,"339":0,"340":0,"341":0,"345":0,"350":0,"362":0,"363":0,"365":0,"366":0,"367":0,"368":0,"371":0,"372":0,"376":0,"377":0,"378":0,"386":0,"389":0,"390":0,"391":0,"392":0,"393":0,"398":0,"409":0,"410":0,"411":0,"412":0,"414":0,"421":0,"422":0,"425":0,"426":0,"427":0,"433":0,"436":0,"437":0,"438":0,"443":0,"444":0,"471":0,"472":0,"478":0,"479":0,"480":0,"481":0,"484":0,"486":0,"487":0,"489":0,"490":0,"491":0,"492":0,"497":0,"501":0,"502":0,"505":0,"506":0,"508":0,"511":0,"512":0,"515":0,"516":0,"517":0,"518":0,"519":0,"520":0,"521":0,"523":0,"525":0,"527":0,"530":0,"531":0,"532":0,"533":0,"535":0,"536":0,"541":0,"542":0,"543":0,"544":0,"545":0,"548":0,"549":0,"550":0,"551":0,"552":0,"554":0,"556":0,"558":0,"560":0,"589":0,"590":0,"594":0,"595":0,"598":0,"601":0,"602":0,"603":0,"605":0,"606":0,"607":0,"610":0,"612":0,"613":0,"616":0,"617":0,"618":0,"620":0,"623":0,"624":0,"626":0,"629":0,"630":0,"634":0,"635":0,"638":0,"641":0,"663":0,"666":0,"673":0,"674":0,"675":0,"676":0,"681":0,"682":0,"683":0,"690":0,"695":0};-_yuitest_coverage["build/transition/transition.js"].functions = {"Transition:44":0,"(anonymous 2):49":0,"_toCamel:48":0,"(anonymous 3):57":0,"_toHyphen:56":0,"(anonymous 4):75":0,"init:119":0,"(anonymous 5):202":0,"addProperty:141":0,"removeProperty:211":0,"initAttrs:222":0,"run:251":0,"_start:278":0,"_prepDur:282":0,"_runNative:288":0,"(anonymous 6):367":0,"(anonymous 7):377":0,"_end:349":0,"_endNative:385":0,"_onNativeEnd:397":0,"destroy:432":0,"transition:471":0,"show:515":0,"(anonymous 8):531":0,"_wrapCallBack:530":0,"hide:541":0,"transition:589":0,"toggleView:601":0,"toggleView:629":0,"height:662":0,"width:665":0,"start:672":0,"end:680":0,"(anonymous 1):1":0};-_yuitest_coverage["build/transition/transition.js"].coveredLines = 253;+_yuitest_coverage["build/transition/transition.js"].code=["YUI.add('transition', function (Y, NAME) {","","/**","* Provides the transition method for Node.","* Transition has no API of its own, but adds the transition method to Node.","*","* @module transition","* @requires node-style","*/","","var CAMEL_VENDOR_PREFIX = '',"," VENDOR_PREFIX = '',"," DOCUMENT = Y.config.doc,"," DOCUMENT_ELEMENT = 'documentElement',"," TRANSITION = 'transition',"," TRANSITION_CAMEL = 'transition',"," TRANSITION_PROPERTY_CAMEL = 'transitionProperty',"," TRANSFORM_CAMEL = 'transform',"," TRANSITION_PROPERTY,"," TRANSITION_DURATION,"," TRANSITION_TIMING_FUNCTION,"," TRANSITION_DELAY,"," TRANSITION_END,"," ON_TRANSITION_END,",""," EMPTY_OBJ = {},",""," VENDORS = ["," 'Webkit',"," 'Moz'"," ],",""," VENDOR_TRANSITION_END = {"," Webkit: 'webkitTransitionEnd'"," },","","/**"," * A class for constructing transition instances."," * Adds the \"transition\" method to Node."," * @class Transition"," * @constructor"," */","","Transition = function() {"," this.init.apply(this, arguments);","};","","Transition._toCamel = function(property) {"," property = property.replace(/-([a-z])/gi, function(m0, m1) {"," return m1.toUpperCase();"," });",""," return property;","};","","Transition._toHyphen = function(property) {"," property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) {"," var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;",""," if (m3) {"," str += '-' + m3.toLowerCase();"," }",""," return str;"," });",""," return property;","};","","Transition.SHOW_TRANSITION = 'fadeIn';","Transition.HIDE_TRANSITION = 'fadeOut';","","Transition.useNative = false;","","if ('transition' in DOCUMENT[DOCUMENT_ELEMENT].style) {"," Transition.useNative = true;"," Transition.supported = true; // TODO: remove","} else {"," Y.Array.each(VENDORS, function(val) { // then vendor specific"," var property = val + 'Transition';"," if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {"," CAMEL_VENDOR_PREFIX = val;"," VENDOR_PREFIX = Transition._toHyphen(val) + '-';",""," Transition.useNative = true;"," Transition.supported = true; // TODO: remove"," Transition._VENDOR_PREFIX = val;"," }"," });","}","","if (CAMEL_VENDOR_PREFIX) {"," TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition';"," TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';"," TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';","}","","TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';","TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';","TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';","TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';","","TRANSITION_END = 'transitionend';","ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';","TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;","","Transition.fx = {};","Transition.toggles = {};","","Transition._hasEnd = {};","","Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i;","","Y.Node.DOM_EVENTS[TRANSITION_END] = 1;","","Transition.NAME = 'transition';","","Transition.DEFAULT_EASING = 'ease';","Transition.DEFAULT_DURATION = 0.5;","Transition.DEFAULT_DELAY = 0;","","Transition._nodeAttrs = {};","","Transition.prototype = {"," constructor: Transition,"," init: function(node, config) {"," var anim = this;"," anim._node = node;"," if (!anim._running && config) {"," anim._config = config;"," node._transition = anim; // cache for reuse",""," anim._duration = ('duration' in config) ?"," config.duration: anim.constructor.DEFAULT_DURATION;",""," anim._delay = ('delay' in config) ?"," config.delay: anim.constructor.DEFAULT_DELAY;",""," anim._easing = config.easing || anim.constructor.DEFAULT_EASING;"," anim._count = 0; // track number of animated properties"," anim._running = false;",""," }",""," return anim;"," },",""," addProperty: function(prop, config) {"," var anim = this,"," node = this._node,"," uid = Y.stamp(node),"," nodeInstance = Y.one(node),"," attrs = Transition._nodeAttrs[uid],"," computed,"," compareVal,"," dur,"," attr,"," val;",""," if (!attrs) {"," attrs = Transition._nodeAttrs[uid] = {};"," }",""," attr = attrs[prop];",""," // might just be a value"," if (config && config.value !== undefined) {"," val = config.value;"," } else if (config !== undefined) {"," val = config;"," config = EMPTY_OBJ;"," }",""," if (typeof val === 'function') {"," val = val.call(nodeInstance, nodeInstance);"," }",""," if (attr && attr.transition) {"," // take control if another transition owns this property"," if (attr.transition !== anim) {"," attr.transition._count--; // remapping attr to this transition"," }"," }",""," anim._count++; // properties per transition",""," // make 0 async and fire events"," dur = ((typeof config.duration != 'undefined') ? config.duration :"," anim._duration) || 0.0001;",""," attrs[prop] = {"," value: val,"," duration: dur,"," delay: (typeof config.delay != 'undefined') ? config.delay :"," anim._delay,",""," easing: config.easing || anim._easing,",""," transition: anim"," };",""," // native end event doesnt fire when setting to same value"," // supplementing with timer"," // val may be a string or number (height: 0, etc), but computedStyle is always string"," computed = Y.DOM.getComputedStyle(node, prop);"," compareVal = (typeof val === 'string') ? computed : parseFloat(computed);",""," if (Transition.useNative && compareVal === val) {"," setTimeout(function() {"," anim._onNativeEnd.call(node, {"," propertyName: prop,"," elapsedTime: dur"," });"," }, dur * 1000);"," }"," },",""," removeProperty: function(prop) {"," var anim = this,"," attrs = Transition._nodeAttrs[Y.stamp(anim._node)];",""," if (attrs && attrs[prop]) {"," delete attrs[prop];"," anim._count--;"," }",""," },",""," initAttrs: function(config) {"," var attr,"," node = this._node;",""," if (config.transform && !config[TRANSFORM_CAMEL]) {"," config[TRANSFORM_CAMEL] = config.transform;"," delete config.transform; // TODO: copy"," }",""," for (attr in config) {"," if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {"," this.addProperty(attr, config[attr]);",""," // when size is auto or % webkit starts from zero instead of computed"," // (https://bugs.webkit.org/show_bug.cgi?id=16020)"," // TODO: selective set"," if (node.style[attr] === '') {"," Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr));"," }"," }"," }"," },",""," /**"," * Starts or an animation."," * @method run"," * @chainable"," * @private"," */"," run: function(callback) {"," var anim = this,"," node = anim._node,"," config = anim._config,"," data = {"," type: 'transition:start',"," config: config"," };","",""," if (!anim._running) {"," anim._running = true;",""," if (config.on && config.on.start) {"," config.on.start.call(Y.one(node), data);"," }",""," anim.initAttrs(anim._config);",""," anim._callback = callback;"," anim._start();"," }","",""," return anim;"," },",""," _start: function() {"," this._runNative();"," },",""," _prepDur: function(dur) {"," dur = parseFloat(dur) * 1000;",""," return dur + 'ms';"," },",""," _runNative: function(time) {"," var anim = this,"," node = anim._node,"," uid = Y.stamp(node),"," style = node.style,"," computed = node.ownerDocument.defaultView.getComputedStyle(node),"," attrs = Transition._nodeAttrs[uid],"," cssText = '',"," cssTransition = computed[Transition._toCamel(TRANSITION_PROPERTY)],",""," transitionText = TRANSITION_PROPERTY + ': ',"," duration = TRANSITION_DURATION + ': ',"," easing = TRANSITION_TIMING_FUNCTION + ': ',"," delay = TRANSITION_DELAY + ': ',"," hyphy,"," attr,"," name;",""," // preserve existing transitions"," if (cssTransition !== 'all') {"," transitionText += cssTransition + ',';"," duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';"," easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';"," delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ',';",""," }",""," // run transitions mapped to this instance"," for (name in attrs) {"," hyphy = Transition._toHyphen(name);"," attr = attrs[name];"," if ((attr = attrs[name]) && attr.transition === anim) {"," if (name in node.style) { // only native styles allowed"," duration += anim._prepDur(attr.duration) + ',';"," delay += anim._prepDur(attr.delay) + ',';"," easing += (attr.easing) + ',';",""," transitionText += hyphy + ',';"," cssText += hyphy + ': ' + attr.value + '; ';"," } else {"," this.removeProperty(name);"," }"," }"," }",""," transitionText = transitionText.replace(/,$/, ';');"," duration = duration.replace(/,$/, ';');"," easing = easing.replace(/,$/, ';');"," delay = delay.replace(/,$/, ';');",""," // only one native end event per node"," if (!Transition._hasEnd[uid]) {"," node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');"," Transition._hasEnd[uid] = true;",""," }",""," style.cssText += transitionText + duration + easing + delay + cssText;",""," },",""," _end: function(elapsed) {"," var anim = this,"," node = anim._node,"," callback = anim._callback,"," config = anim._config,"," data = {"," type: 'transition:end',"," config: config,"," elapsedTime: elapsed"," },",""," nodeInstance = Y.one(node);",""," anim._running = false;"," anim._callback = null;",""," if (node) {"," if (config.on && config.on.end) {"," setTimeout(function() { // IE: allow previous update to finish"," config.on.end.call(nodeInstance, data);",""," // nested to ensure proper fire order"," if (callback) {"," callback.call(nodeInstance, data);"," }",""," }, 1);"," } else if (callback) {"," setTimeout(function() { // IE: allow previous update to finish"," callback.call(nodeInstance, data);"," }, 1);"," }"," }",""," },",""," _endNative: function(name) {"," var node = this._node,"," value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)];",""," name = Transition._toHyphen(name);"," if (typeof value === 'string') {"," value = value.replace(new RegExp('(?:^|,\\\\s)' + name + ',?'), ',');"," value = value.replace(/^,|,$/, '');"," node.style[TRANSITION_CAMEL] = value;"," }"," },",""," _onNativeEnd: function(e) {"," var node = this,"," uid = Y.stamp(node),"," event = e,//e._event,"," name = Transition._toCamel(event.propertyName),"," elapsed = event.elapsedTime,"," attrs = Transition._nodeAttrs[uid],"," attr = attrs[name],"," anim = (attr) ? attr.transition : null,"," data,"," config;",""," if (anim) {"," anim.removeProperty(name);"," anim._endNative(name);"," config = anim._config[name];",""," data = {"," type: 'propertyEnd',"," propertyName: name,"," elapsedTime: elapsed,"," config: config"," };",""," if (config && config.on && config.on.end) {"," config.on.end.call(Y.one(node), data);"," }",""," if (anim._count <= 0) { // after propertyEnd fires"," anim._end(elapsed);"," node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style"," }"," }"," },",""," destroy: function() {"," var anim = this,"," node = anim._node;",""," if (node) {"," node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);"," anim._node = null;"," }"," }","};","","Y.Transition = Transition;","Y.TransitionNative = Transition; // TODO: remove","","/**"," * Animate one or more css properties to a given value. Requires the \"transition\" module."," * <pre>example usage:"," * Y.one('#demo').transition({"," * duration: 1, // in seconds, default is 0.5"," * easing: 'ease-out', // default is 'ease'"," * delay: '1', // delay start for 1 second, default is 0"," *"," * height: '10px',"," * width: '10px',"," *"," * opacity: { // per property"," * value: 0,"," * duration: 2,"," * delay: 2,"," * easing: 'ease-in'"," * }"," * });"," * </pre>"," * @for Node"," * @method transition"," * @param {Object} config An object containing one or more style properties, a duration and an easing."," * @param {Function} callback A function to run after the transition has completed."," * @chainable","*/","Y.Node.prototype.transition = function(name, config, callback) {"," var"," transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)],"," anim = (transitionAttrs) ? transitionAttrs.transition || null : null,"," fxConfig,"," prop;",""," if (typeof name === 'string') { // named effect, pull config from registry"," if (typeof config === 'function') {"," callback = config;"," config = null;"," }",""," fxConfig = Transition.fx[name];",""," if (config && typeof config !== 'boolean') {"," config = Y.clone(config);",""," for (prop in fxConfig) {"," if (fxConfig.hasOwnProperty(prop)) {"," if (! (prop in config)) {"," config[prop] = fxConfig[prop];"," }"," }"," }"," } else {"," config = fxConfig;"," }",""," } else { // name is a config, config is a callback or undefined"," callback = config;"," config = name;"," }",""," if (anim && !anim._running) {"," anim.init(this, config);"," } else {"," anim = new Transition(this._node, config);"," }",""," anim.run(callback);"," return this;","};","","Y.Node.prototype.show = function(name, config, callback) {"," this._show(); // show prior to transition"," if (name && Y.Transition) {"," if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default"," if (typeof config === 'function') {"," callback = config;"," config = name;"," }"," name = Transition.SHOW_TRANSITION;"," }"," this.transition(name, config, callback);"," }"," return this;","};","","var _wrapCallBack = function(anim, fn, callback) {"," return function() {"," if (fn) {"," fn.call(anim);"," }"," if (callback) {"," callback.apply(anim._node, arguments);"," }"," };","};","","Y.Node.prototype.hide = function(name, config, callback) {"," if (name && Y.Transition) {"," if (typeof config === 'function') {"," callback = config;"," config = null;"," }",""," callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback"," if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default"," if (typeof config === 'function') {"," callback = config;"," config = name;"," }"," name = Transition.HIDE_TRANSITION;"," }"," this.transition(name, config, callback);"," } else {"," this._hide();"," }"," return this;","};","","/**"," * Animate one or more css properties to a given value. Requires the \"transition\" module."," * <pre>example usage:"," * Y.all('.demo').transition({"," * duration: 1, // in seconds, default is 0.5"," * easing: 'ease-out', // default is 'ease'"," * delay: '1', // delay start for 1 second, default is 0"," *"," * height: '10px',"," * width: '10px',"," *"," * opacity: { // per property"," * value: 0,"," * duration: 2,"," * delay: 2,"," * easing: 'ease-in'"," * }"," * });"," * </pre>"," * @for NodeList"," * @method transition"," * @param {Object} config An object containing one or more style properties, a duration and an easing."," * @param {Function} callback A function to run after the transition has completed. The callback fires"," * once per item in the NodeList."," * @chainable","*/","Y.NodeList.prototype.transition = function(config, callback) {"," var nodes = this._nodes,"," i = 0,"," node;",""," while ((node = nodes[i++])) {"," Y.one(node).transition(config, callback);"," }",""," return this;","};","","Y.Node.prototype.toggleView = function(name, on, callback) {"," this._toggles = this._toggles || [];"," callback = arguments[arguments.length - 1];",""," if (typeof name == 'boolean') { // no transition, just toggle"," on = name;"," name = null;"," }",""," name = name || Y.Transition.DEFAULT_TOGGLE;",""," if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle"," on = ! this._toggles[name];"," }",""," on = (on) ? 1 : 0;"," if (on) {"," this._show();"," } else {"," callback = _wrapCallBack(this, this._hide, callback);"," }",""," this._toggles[name] = on;"," this.transition(Y.Transition.toggles[name][on], callback);",""," return this;","};","","Y.NodeList.prototype.toggleView = function(name, on, callback) {"," var nodes = this._nodes,"," i = 0,"," node;",""," while ((node = nodes[i++])) {"," Y.one(node).toggleView(name, on, callback);"," }",""," return this;","};","","Y.mix(Transition.fx, {"," fadeOut: {"," opacity: 0,"," duration: 0.5,"," easing: 'ease-out'"," },",""," fadeIn: {"," opacity: 1,"," duration: 0.5,"," easing: 'ease-in'"," },",""," sizeOut: {"," height: 0,"," width: 0,"," duration: 0.75,"," easing: 'ease-out'"," },",""," sizeIn: {"," height: function(node) {"," return node.get('scrollHeight') + 'px';"," },"," width: function(node) {"," return node.get('scrollWidth') + 'px';"," },"," duration: 0.5,"," easing: 'ease-in',",""," on: {"," start: function() {"," var overflow = this.getStyle('overflow');"," if (overflow !== 'hidden') { // enable scrollHeight/Width"," this.setStyle('overflow', 'hidden');"," this._transitionOverflow = overflow;"," }"," },",""," end: function() {"," if (this._transitionOverflow) { // revert overridden value"," this.setStyle('overflow', this._transitionOverflow);"," delete this._transitionOverflow;"," }"," }"," }"," }","});","","Y.mix(Transition.toggles, {"," size: ['sizeOut', 'sizeIn'],"," fade: ['fadeOut', 'fadeIn']","});","","Transition.DEFAULT_TOGGLE = 'fade';","","","","}, '3.7.3', {\"requires\": [\"node-style\"]});"];+_yuitest_coverage["build/transition/transition.js"].lines = {"1":0,"11":0,"45":0,"48":0,"49":0,"50":0,"53":0,"56":0,"57":0,"58":0,"60":0,"61":0,"64":0,"67":0,"70":0,"71":0,"73":0,"75":0,"76":0,"77":0,"79":0,"80":0,"81":0,"82":0,"83":0,"85":0,"86":0,"87":0,"92":0,"93":0,"94":0,"95":0,"98":0,"99":0,"100":0,"101":0,"103":0,"104":0,"105":0,"107":0,"108":0,"110":0,"112":0,"114":0,"116":0,"118":0,"119":0,"120":0,"122":0,"124":0,"127":0,"128":0,"129":0,"130":0,"131":0,"133":0,"136":0,"139":0,"140":0,"141":0,"145":0,"149":0,"160":0,"161":0,"164":0,"167":0,"168":0,"169":0,"170":0,"171":0,"174":0,"175":0,"178":0,"180":0,"181":0,"185":0,"188":0,"191":0,"205":0,"206":0,"208":0,"209":0,"210":0,"219":0,"222":0,"223":0,"224":0,"230":0,"233":0,"234":0,"235":0,"238":0,"239":0,"240":0,"245":0,"246":0,"259":0,"268":0,"269":0,"271":0,"272":0,"275":0,"277":0,"278":0,"282":0,"286":0,"290":0,"292":0,"296":0,"314":0,"315":0,"316":0,"317":0,"318":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"330":0,"332":0,"333":0,"335":0,"340":0,"341":0,"342":0,"343":0,"346":0,"347":0,"348":0,"352":0,"357":0,"369":0,"370":0,"372":0,"373":0,"374":0,"375":0,"378":0,"379":0,"383":0,"384":0,"385":0,"393":0,"396":0,"397":0,"398":0,"399":0,"400":0,"405":0,"416":0,"417":0,"418":0,"419":0,"421":0,"428":0,"429":0,"432":0,"433":0,"434":0,"440":0,"443":0,"444":0,"445":0,"450":0,"451":0,"478":0,"479":0,"485":0,"486":0,"487":0,"488":0,"491":0,"493":0,"494":0,"496":0,"497":0,"498":0,"499":0,"504":0,"508":0,"509":0,"512":0,"513":0,"515":0,"518":0,"519":0,"522":0,"523":0,"524":0,"525":0,"526":0,"527":0,"528":0,"530":0,"532":0,"534":0,"537":0,"538":0,"539":0,"540":0,"542":0,"543":0,"548":0,"549":0,"550":0,"551":0,"552":0,"555":0,"556":0,"557":0,"558":0,"559":0,"561":0,"563":0,"565":0,"567":0,"596":0,"597":0,"601":0,"602":0,"605":0,"608":0,"609":0,"610":0,"612":0,"613":0,"614":0,"617":0,"619":0,"620":0,"623":0,"624":0,"625":0,"627":0,"630":0,"631":0,"633":0,"636":0,"637":0,"641":0,"642":0,"645":0,"648":0,"670":0,"673":0,"680":0,"681":0,"682":0,"683":0,"688":0,"689":0,"690":0,"697":0,"702":0};+_yuitest_coverage["build/transition/transition.js"].functions = {"Transition:44":0,"(anonymous 2):49":0,"_toCamel:48":0,"(anonymous 3):57":0,"_toHyphen:56":0,"(anonymous 4):79":0,"init:126":0,"(anonymous 5):209":0,"addProperty:148":0,"removeProperty:218":0,"initAttrs:229":0,"run:258":0,"_start:285":0,"_prepDur:289":0,"_runNative:295":0,"(anonymous 6):374":0,"(anonymous 7):384":0,"_end:356":0,"_endNative:392":0,"_onNativeEnd:404":0,"destroy:439":0,"transition:478":0,"show:522":0,"(anonymous 8):538":0,"_wrapCallBack:537":0,"hide:548":0,"transition:596":0,"toggleView:608":0,"toggleView:636":0,"height:669":0,"width:672":0,"start:679":0,"end:687":0,"(anonymous 1):1":0};+_yuitest_coverage["build/transition/transition.js"].coveredLines = 257; _yuitest_coverage["build/transition/transition.js"].coveredFunctions = 34; _yuitest_coverline("build/transition/transition.js", 1); YUI.add('transition', function (Y, NAME) {@@ -55,15 +55,15 @@ DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,+ TRANSITION_CAMEL = 'transition',+ TRANSITION_PROPERTY_CAMEL = 'transitionProperty',+ TRANSFORM_CAMEL = 'transform', TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END,- TRANSFORM_CAMEL, EMPTY_OBJ = {}, @@ -111,7 +111,7 @@ _yuitest_coverfunc("build/transition/transition.js", "(anonymous 3)", 57); _yuitest_coverline("build/transition/transition.js", 58); var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- + _yuitest_coverline("build/transition/transition.js", 60); if (m3) { _yuitest_coverline("build/transition/transition.js", 61);@@ -120,7 +120,7 @@ _yuitest_coverline("build/transition/transition.js", 64); return str;- }); + }); _yuitest_coverline("build/transition/transition.js", 67); return property;@@ -135,116 +135,127 @@ Transition.useNative = false; _yuitest_coverline("build/transition/transition.js", 75);-Y.Array.each(VENDORS, function(val) { // then vendor specific- _yuitest_coverfunc("build/transition/transition.js", "(anonymous 4)", 75);-_yuitest_coverline("build/transition/transition.js", 76);-var property = val + TRANSITION_CAMEL;+if ('transition' in DOCUMENT[DOCUMENT_ELEMENT].style) {+ _yuitest_coverline("build/transition/transition.js", 76);+Transition.useNative = true; _yuitest_coverline("build/transition/transition.js", 77);+Transition.supported = true; // TODO: remove+} else {+ _yuitest_coverline("build/transition/transition.js", 79);+Y.Array.each(VENDORS, function(val) { // then vendor specific+ _yuitest_coverfunc("build/transition/transition.js", "(anonymous 4)", 79);+_yuitest_coverline("build/transition/transition.js", 80);+var property = val + 'Transition';+ _yuitest_coverline("build/transition/transition.js", 81); if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- _yuitest_coverline("build/transition/transition.js", 78);+ _yuitest_coverline("build/transition/transition.js", 82); CAMEL_VENDOR_PREFIX = val;- _yuitest_coverline("build/transition/transition.js", 79);-VENDOR_PREFIX = Transition._toHyphen(val) + '-';+ _yuitest_coverline("build/transition/transition.js", 83);+VENDOR_PREFIX = Transition._toHyphen(val) + '-'; - _yuitest_coverline("build/transition/transition.js", 81);+ _yuitest_coverline("build/transition/transition.js", 85); Transition.useNative = true;- _yuitest_coverline("build/transition/transition.js", 82);+ _yuitest_coverline("build/transition/transition.js", 86); Transition.supported = true; // TODO: remove- _yuitest_coverline("build/transition/transition.js", 83);+ _yuitest_coverline("build/transition/transition.js", 87); Transition._VENDOR_PREFIX = val;- }-});+ }+ });+} -_yuitest_coverline("build/transition/transition.js", 87);-TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-_yuitest_coverline("build/transition/transition.js", 88);-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-_yuitest_coverline("build/transition/transition.js", 89);-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-_yuitest_coverline("build/transition/transition.js", 90);-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-_yuitest_coverline("build/transition/transition.js", 91);-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function'; _yuitest_coverline("build/transition/transition.js", 92);-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-_yuitest_coverline("build/transition/transition.js", 93);-TRANSITION_END = 'transitionend';-_yuitest_coverline("build/transition/transition.js", 94);-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';--_yuitest_coverline("build/transition/transition.js", 96);-TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;+if (CAMEL_VENDOR_PREFIX) {+ _yuitest_coverline("build/transition/transition.js", 93);+TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition';+ _yuitest_coverline("build/transition/transition.js", 94);+TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';+ _yuitest_coverline("build/transition/transition.js", 95);+TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+} _yuitest_coverline("build/transition/transition.js", 98);-TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';-+TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';+_yuitest_coverline("build/transition/transition.js", 99);+TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration'; _yuitest_coverline("build/transition/transition.js", 100);-Transition.fx = {};+TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function'; _yuitest_coverline("build/transition/transition.js", 101);-Transition.toggles = {};+TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; _yuitest_coverline("build/transition/transition.js", 103);+TRANSITION_END = 'transitionend';+_yuitest_coverline("build/transition/transition.js", 104);+ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+_yuitest_coverline("build/transition/transition.js", 105);+TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;++_yuitest_coverline("build/transition/transition.js", 107);+Transition.fx = {};+_yuitest_coverline("build/transition/transition.js", 108);+Transition.toggles = {};++_yuitest_coverline("build/transition/transition.js", 110); Transition._hasEnd = {}; -_yuitest_coverline("build/transition/transition.js", 105);+_yuitest_coverline("build/transition/transition.js", 112); Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; -_yuitest_coverline("build/transition/transition.js", 107);-Y.Node.DOM_EVENTS[TRANSITION_END] = 1; +_yuitest_coverline("build/transition/transition.js", 114);+Y.Node.DOM_EVENTS[TRANSITION_END] = 1; -_yuitest_coverline("build/transition/transition.js", 109);+_yuitest_coverline("build/transition/transition.js", 116); Transition.NAME = 'transition'; -_yuitest_coverline("build/transition/transition.js", 111);+_yuitest_coverline("build/transition/transition.js", 118); Transition.DEFAULT_EASING = 'ease';-_yuitest_coverline("build/transition/transition.js", 112);+_yuitest_coverline("build/transition/transition.js", 119); Transition.DEFAULT_DURATION = 0.5;-_yuitest_coverline("build/transition/transition.js", 113);+_yuitest_coverline("build/transition/transition.js", 120); Transition.DEFAULT_DELAY = 0; -_yuitest_coverline("build/transition/transition.js", 115);+_yuitest_coverline("build/transition/transition.js", 122); Transition._nodeAttrs = {}; -_yuitest_coverline("build/transition/transition.js", 117);+_yuitest_coverline("build/transition/transition.js", 124); Transition.prototype = { constructor: Transition, init: function(node, config) {- _yuitest_coverfunc("build/transition/transition.js", "init", 119);-_yuitest_coverline("build/transition/transition.js", 120);+ _yuitest_coverfunc("build/transition/transition.js", "init", 126);+_yuitest_coverline("build/transition/transition.js", 127); var anim = this;- _yuitest_coverline("build/transition/transition.js", 121);+ _yuitest_coverline("build/transition/transition.js", 128); anim._node = node;- _yuitest_coverline("build/transition/transition.js", 122);+ _yuitest_coverline("build/transition/transition.js", 129); if (!anim._running && config) {- _yuitest_coverline("build/transition/transition.js", 123);+ _yuitest_coverline("build/transition/transition.js", 130); anim._config = config;- _yuitest_coverline("build/transition/transition.js", 124);+ _yuitest_coverline("build/transition/transition.js", 131); node._transition = anim; // cache for reuse - _yuitest_coverline("build/transition/transition.js", 126);+ _yuitest_coverline("build/transition/transition.js", 133); anim._duration = ('duration' in config) ? config.duration: anim.constructor.DEFAULT_DURATION; - _yuitest_coverline("build/transition/transition.js", 129);+ _yuitest_coverline("build/transition/transition.js", 136); anim._delay = ('delay' in config) ? config.delay: anim.constructor.DEFAULT_DELAY; - _yuitest_coverline("build/transition/transition.js", 132);+ _yuitest_coverline("build/transition/transition.js", 139); anim._easing = config.easing || anim.constructor.DEFAULT_EASING;- _yuitest_coverline("build/transition/transition.js", 133);+ _yuitest_coverline("build/transition/transition.js", 140); anim._count = 0; // track number of animated properties- _yuitest_coverline("build/transition/transition.js", 134);+ _yuitest_coverline("build/transition/transition.js", 141); anim._running = false; } - _yuitest_coverline("build/transition/transition.js", 138);+ _yuitest_coverline("build/transition/transition.js", 145); return anim; }, addProperty: function(prop, config) {- _yuitest_coverfunc("build/transition/transition.js", "addProperty", 141);-_yuitest_coverline("build/transition/transition.js", 142);+ _yuitest_coverfunc("build/transition/transition.js", "addProperty", 148);+_yuitest_coverline("build/transition/transition.js", 149); var anim = this, node = this._node, uid = Y.stamp(node),@@ -256,53 +267,53 @@ attr, val; - _yuitest_coverline("build/transition/transition.js", 153);+ _yuitest_coverline("build/transition/transition.js", 160); if (!attrs) {- _yuitest_coverline("build/transition/transition.js", 154);+ _yuitest_coverline("build/transition/transition.js", 161); attrs = Transition._nodeAttrs[uid] = {}; } - _yuitest_coverline("build/transition/transition.js", 157);+ _yuitest_coverline("build/transition/transition.js", 164); attr = attrs[prop]; // might just be a value- _yuitest_coverline("build/transition/transition.js", 160);+ _yuitest_coverline("build/transition/transition.js", 167); if (config && config.value !== undefined) {- _yuitest_coverline("build/transition/transition.js", 161);+ _yuitest_coverline("build/transition/transition.js", 168); val = config.value;- } else {_yuitest_coverline("build/transition/transition.js", 162);+ } else {_yuitest_coverline("build/transition/transition.js", 169); if (config !== undefined) {- _yuitest_coverline("build/transition/transition.js", 163);-val = config; - _yuitest_coverline("build/transition/transition.js", 164);+ _yuitest_coverline("build/transition/transition.js", 170);+val = config;+ _yuitest_coverline("build/transition/transition.js", 171); config = EMPTY_OBJ; }} - _yuitest_coverline("build/transition/transition.js", 167);+ _yuitest_coverline("build/transition/transition.js", 174); if (typeof val === 'function') {- _yuitest_coverline("build/transition/transition.js", 168);+ _yuitest_coverline("build/transition/transition.js", 175); val = val.call(nodeInstance, nodeInstance); } - _yuitest_coverline("build/transition/transition.js", 171);+ _yuitest_coverline("build/transition/transition.js", 178); if (attr && attr.transition) { // take control if another transition owns this property- _yuitest_coverline("build/transition/transition.js", 173);+ _yuitest_coverline("build/transition/transition.js", 180); if (attr.transition !== anim) {- _yuitest_coverline("build/transition/transition.js", 174);+ _yuitest_coverline("build/transition/transition.js", 181); attr.transition._count--; // remapping attr to this transition }- } + } - _yuitest_coverline("build/transition/transition.js", 178);+ _yuitest_coverline("build/transition/transition.js", 185); anim._count++; // properties per transition // make 0 async and fire events- _yuitest_coverline("build/transition/transition.js", 181);+ _yuitest_coverline("build/transition/transition.js", 188); dur = ((typeof config.duration != 'undefined') ? config.duration : anim._duration) || 0.0001; - _yuitest_coverline("build/transition/transition.js", 184);+ _yuitest_coverline("build/transition/transition.js", 191); attrs[prop] = { value: val, duration: dur,@@ -317,17 +328,17 @@ // native end event doesnt fire when setting to same value // supplementing with timer // val may be a string or number (height: 0, etc), but computedStyle is always string- _yuitest_coverline("build/transition/transition.js", 198);+ _yuitest_coverline("build/transition/transition.js", 205); computed = Y.DOM.getComputedStyle(node, prop);- _yuitest_coverline("build/transition/transition.js", 199);+ _yuitest_coverline("build/transition/transition.js", 206); compareVal = (typeof val === 'string') ? computed : parseFloat(computed); - _yuitest_coverline("build/transition/transition.js", 201);+ _yuitest_coverline("build/transition/transition.js", 208); if (Transition.useNative && compareVal === val) {- _yuitest_coverline("build/transition/transition.js", 202);+ _yuitest_coverline("build/transition/transition.js", 209); setTimeout(function() {- _yuitest_coverfunc("build/transition/transition.js", "(anonymous 5)", 202);-_yuitest_coverline("build/transition/transition.js", 203);+ _yuitest_coverfunc("build/transition/transition.js", "(anonymous 5)", 209);+_yuitest_coverline("build/transition/transition.js", 210); anim._onNativeEnd.call(node, { propertyName: prop, elapsedTime: dur@@ -337,48 +348,48 @@ }, removeProperty: function(prop) {- _yuitest_coverfunc("build/transition/transition.js", "removeProperty", 211);-_yuitest_coverline("build/transition/transition.js", 212);+ _yuitest_coverfunc("build/transition/transition.js", "removeProperty", 218);+_yuitest_coverline("build/transition/transition.js", 219); var anim = this, attrs = Transition._nodeAttrs[Y.stamp(anim._node)]; - _yuitest_coverline("build/transition/transition.js", 215);+ _yuitest_coverline("build/transition/transition.js", 222); if (attrs && attrs[prop]) {- _yuitest_coverline("build/transition/transition.js", 216);+ _yuitest_coverline("build/transition/transition.js", 223); delete attrs[prop];- _yuitest_coverline("build/transition/transition.js", 217);+ _yuitest_coverline("build/transition/transition.js", 224); anim._count--; } }, initAttrs: function(config) {- _yuitest_coverfunc("build/transition/transition.js", "initAttrs", 222);-_yuitest_coverline("build/transition/transition.js", 223);+ _yuitest_coverfunc("build/transition/transition.js", "initAttrs", 229);+_yuitest_coverline("build/transition/transition.js", 230); var attr, node = this._node; - _yuitest_coverline("build/transition/transition.js", 226);+ _yuitest_coverline("build/transition/transition.js", 233); if (config.transform && !config[TRANSFORM_CAMEL]) {- _yuitest_coverline("build/transition/transition.js", 227);+ _yuitest_coverline("build/transition/transition.js", 234); config[TRANSFORM_CAMEL] = config.transform;- _yuitest_coverline("build/transition/transition.js", 228);+ _yuitest_coverline("build/transition/transition.js", 235); delete config.transform; // TODO: copy } - _yuitest_coverline("build/transition/transition.js", 231);+ _yuitest_coverline("build/transition/transition.js", 238); for (attr in config) {- _yuitest_coverline("build/transition/transition.js", 232);+ _yuitest_coverline("build/transition/transition.js", 239); if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) {- _yuitest_coverline("build/transition/transition.js", 233);+ _yuitest_coverline("build/transition/transition.js", 240); this.addProperty(attr, config[attr]); - // when size is auto or % webkit starts from zero instead of computed + // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set- _yuitest_coverline("build/transition/transition.js", 238);+ _yuitest_coverline("build/transition/transition.js", 245); if (node.style[attr] === '') {- _yuitest_coverline("build/transition/transition.js", 239);+ _yuitest_coverline("build/transition/transition.js", 246); Y.DOM.setStyle(node, attr, Y.DOM.getComputedStyle(node, attr)); } }@@ -390,10 +401,10 @@ * @method run * @chainable * @private- */ + */ run: function(callback) {- _yuitest_coverfunc("build/transition/transition.js", "run", 251);-_yuitest_coverline("build/transition/transition.js", 252);+ _yuitest_coverfunc("build/transition/transition.js", "run", 258);+_yuitest_coverline("build/transition/transition.js", 259); var anim = this, node = anim._node, config = anim._config,@@ -403,49 +414,49 @@ }; - _yuitest_coverline("build/transition/transition.js", 261);+ _yuitest_coverline("build/transition/transition.js", 268); if (!anim._running) {- _yuitest_coverline("build/transition/transition.js", 262);+ _yuitest_coverline("build/transition/transition.js", 269); anim._running = true; - _yuitest_coverline("build/transition/transition.js", 264);+ _yuitest_coverline("build/transition/transition.js", 271); if (config.on && config.on.start) {- _yuitest_coverline("build/transition/transition.js", 265);+ _yuitest_coverline("build/transition/transition.js", 272); config.on.start.call(Y.one(node), data); } - _yuitest_coverline("build/transition/transition.js", 268);+ _yuitest_coverline("build/transition/transition.js", 275); anim.initAttrs(anim._config); - _yuitest_coverline("build/transition/transition.js", 270);+ _yuitest_coverline("build/transition/transition.js", 277); anim._callback = callback;- _yuitest_coverline("build/transition/transition.js", 271);+ _yuitest_coverline("build/transition/transition.js", 278); anim._start(); } - _yuitest_coverline("build/transition/transition.js", 275);+ _yuitest_coverline("build/transition/transition.js", 282); return anim; }, _start: function() {- _yuitest_coverfunc("build/transition/transition.js", "_start", 278);-_yuitest_coverline("build/transition/transition.js", 279);+ _yuitest_coverfunc("build/transition/transition.js", "_start", 285);+_yuitest_coverline("build/transition/transition.js", 286); this._runNative(); }, _prepDur: function(dur) {- _yuitest_coverfunc("build/transition/transition.js", "_prepDur", 282);-_yuitest_coverline("build/transition/transition.js", 283);-dur = parseFloat(dur);+ _yuitest_coverfunc("build/transition/transition.js", "_prepDur", 289);+_yuitest_coverline("build/transition/transition.js", 290);+dur = parseFloat(dur) * 1000; - _yuitest_coverline("build/transition/transition.js", 285);-return dur + 's';+ _yuitest_coverline("build/transition/transition.js", 292);+return dur + 'ms'; }, _runNative: function(time) {- _yuitest_coverfunc("build/transition/transition.js", "_runNative", 288);-_yuitest_coverline("build/transition/transition.js", 289);+ _yuitest_coverfunc("build/transition/transition.js", "_runNative", 295);+_yuitest_coverline("build/transition/transition.js", 296); var anim = this, node = anim._node, uid = Y.stamp(node),@@ -464,75 +475,75 @@ name; // preserve existing transitions- _yuitest_coverline("build/transition/transition.js", 307);+ _yuitest_coverline("build/transition/transition.js", 314); if (cssTransition !== 'all') {- _yuitest_coverline("build/transition/transition.js", 308);+ _yuitest_coverline("build/transition/transition.js", 315); transitionText += cssTransition + ',';- _yuitest_coverline("build/transition/transition.js", 309);+ _yuitest_coverline("build/transition/transition.js", 316); duration += computed[Transition._toCamel(TRANSITION_DURATION)] + ',';- _yuitest_coverline("build/transition/transition.js", 310);+ _yuitest_coverline("build/transition/transition.js", 317); easing += computed[Transition._toCamel(TRANSITION_TIMING_FUNCTION)] + ',';- _yuitest_coverline("build/transition/transition.js", 311);+ _yuitest_coverline("build/transition/transition.js", 318); delay += computed[Transition._toCamel(TRANSITION_DELAY)] + ','; } // run transitions mapped to this instance- _yuitest_coverline("build/transition/transition.js", 316);+ _yuitest_coverline("build/transition/transition.js", 323); for (name in attrs) {- _yuitest_coverline("build/transition/transition.js", 317);+ _yuitest_coverline("build/transition/transition.js", 324); hyphy = Transition._toHyphen(name);- _yuitest_coverline("build/transition/transition.js", 318);+ _yuitest_coverline("build/transition/transition.js", 325); attr = attrs[name];- _yuitest_coverline("build/transition/transition.js", 319);+ _yuitest_coverline("build/transition/transition.js", 326); if ((attr = attrs[name]) && attr.transition === anim) {- _yuitest_coverline("build/transition/transition.js", 320);+ _yuitest_coverline("build/transition/transition.js", 327); if (name in node.style) { // only native styles allowed- _yuitest_coverline("build/transition/transition.js", 321);+ _yuitest_coverline("build/transition/transition.js", 328); duration += anim._prepDur(attr.duration) + ',';- _yuitest_coverline("build/transition/transition.js", 322);+ _yuitest_coverline("build/transition/transition.js", 329); delay += anim._prepDur(attr.delay) + ',';- _yuitest_coverline("build/transition/transition.js", 323);+ _yuitest_coverline("build/transition/transition.js", 330); easing += (attr.easing) + ','; - _yuitest_coverline("build/transition/transition.js", 325);+ _yuitest_coverline("build/transition/transition.js", 332); transitionText += hyphy + ',';- _yuitest_coverline("build/transition/transition.js", 326);+ _yuitest_coverline("build/transition/transition.js", 333); cssText += hyphy + ': ' + attr.value + '; '; } else {- _yuitest_coverline("build/transition/transition.js", 328);+ _yuitest_coverline("build/transition/transition.js", 335); this.removeProperty(name); } } } - _yuitest_coverline("build/transition/transition.js", 333);+ _yuitest_coverline("build/transition/transition.js", 340); transitionText = transitionText.replace(/,$/, ';');- _yuitest_coverline("build/transition/transition.js", 334);+ _yuitest_coverline("build/transition/transition.js", 341); duration = duration.replace(/,$/, ';');- _yuitest_coverline("build/transition/transition.js", 335);+ _yuitest_coverline("build/transition/transition.js", 342); easing = easing.replace(/,$/, ';');- _yuitest_coverline("build/transition/transition.js", 336);+ _yuitest_coverline("build/transition/transition.js", 343); delay = delay.replace(/,$/, ';'); // only one native end event per node- _yuitest_coverline("build/transition/transition.js", 339);+ _yuitest_coverline("build/transition/transition.js", 346); if (!Transition._hasEnd[uid]) {- _yuitest_coverline("build/transition/transition.js", 340);+ _yuitest_coverline("build/transition/transition.js", 347); node.addEventListener(TRANSITION_END, anim._onNativeEnd, '');- _yuitest_coverline("build/transition/transition.js", 341);+ _yuitest_coverline("build/transition/transition.js", 348); Transition._hasEnd[uid] = true; }- - _yuitest_coverline("build/transition/transition.js", 345);++ _yuitest_coverline("build/transition/transition.js", 352); style.cssText += transitionText + duration + easing + delay + cssText; }, _end: function(elapsed) {- _yuitest_coverfunc("build/transition/transition.js", "_end", 349);-_yuitest_coverline("build/transition/transition.js", 350);+ _yuitest_coverfunc("build/transition/transition.js", "_end", 356);+_yuitest_coverline("build/transition/transition.js", 357); var anim = this, node = anim._node, callback = anim._callback,@@ -540,40 +551,40 @@ data = { type: 'transition:end', config: config,- elapsedTime: elapsed + elapsedTime: elapsed }, - nodeInstance = Y.one(node); + nodeInstance = Y.one(node); - _yuitest_coverline("build/transition/transition.js", 362);+ _yuitest_coverline("build/transition/transition.js", 369); anim._running = false;- _yuitest_coverline("build/transition/transition.js", 363);+ _yuitest_coverline("build/transition/transition.js", 370); anim._callback = null; - _yuitest_coverline("build/transition/transition.js", 365);+ _yuitest_coverline("build/transition/transition.js", 372); if (node) {- _yuitest_coverline("build/transition/transition.js", 366);+ _yuitest_coverline("build/transition/transition.js", 373); if (config.on && config.on.end) {- _yuitest_coverline("build/transition/transition.js", 367);+ _yuitest_coverline("build/transition/transition.js", 374); setTimeout(function() { // IE: allow previous update to finish- _yuitest_coverfunc("build/transition/transition.js", "(anonymous 6)", 367);-_yuitest_coverline("build/transition/transition.js", 368);+ _yuitest_coverfunc("build/transition/transition.js", "(anonymous 6)", 374);+_yuitest_coverline("build/transition/transition.js", 375); config.on.end.call(nodeInstance, data); // nested to ensure proper fire order- _yuitest_coverline("build/transition/transition.js", 371);+ _yuitest_coverline("build/transition/transition.js", 378); if (callback) {- _yuitest_coverline("build/transition/transition.js", 372);+ _yuitest_coverline("build/transition/transition.js", 379); callback.call(nodeInstance, data); } }, 1);- } else {_yuitest_coverline("build/transition/transition.js", 376);+ } else {_yuitest_coverline("build/transition/transition.js", 383); if (callback) {- _yuitest_coverline("build/transition/transition.js", 377);+ _yuitest_coverline("build/transition/transition.js", 384); setTimeout(function() { // IE: allow previous update to finish- _yuitest_coverfunc("build/transition/transition.js", "(anonymous 7)", 377);-_yuitest_coverline("build/transition/transition.js", 378);+ _yuitest_coverfunc("build/transition/transition.js", "(anonymous 7)", 384);+_yuitest_coverline("build/transition/transition.js", 385); callback.call(nodeInstance, data); }, 1); }}@@ -582,27 +593,27 @@ }, _endNative: function(name) {- _yuitest_coverfunc("build/transition/transition.js", "_endNative", 385);-_yuitest_coverline("build/transition/transition.js", 386);+ _yuitest_coverfunc("build/transition/transition.js", "_endNative", 392);+_yuitest_coverline("build/transition/transition.js", 393); var node = this._node, value = node.ownerDocument.defaultView.getComputedStyle(node, '')[Transition._toCamel(TRANSITION_PROPERTY)]; - _yuitest_coverline("build/transition/transition.js", 389);+ _yuitest_coverline("build/transition/transition.js", 396); name = Transition._toHyphen(name);- _yuitest_coverline("build/transition/transition.js", 390);+ _yuitest_coverline("build/transition/transition.js", 397); if (typeof value === 'string') {- _yuitest_coverline("build/transition/transition.js", 391);+ _yuitest_coverline("build/transition/transition.js", 398); value = value.replace(new RegExp('(?:^|,\\s)' + name + ',?'), ',');- _yuitest_coverline("build/transition/transition.js", 392);+ _yuitest_coverline("build/transition/transition.js", 399); value = value.replace(/^,|,$/, '');- _yuitest_coverline("build/transition/transition.js", 393);+ _yuitest_coverline("build/transition/transition.js", 400); node.style[TRANSITION_CAMEL] = value; } }, _onNativeEnd: function(e) {- _yuitest_coverfunc("build/transition/transition.js", "_onNativeEnd", 397);-_yuitest_coverline("build/transition/transition.js", 398);+ _yuitest_coverfunc("build/transition/transition.js", "_onNativeEnd", 404);+_yuitest_coverline("build/transition/transition.js", 405); var node = this, uid = Y.stamp(node), event = e,//e._event,@@ -614,16 +625,16 @@ data, config; - _yuitest_coverline("build/transition/transition.js", 409);+ _yuitest_coverline("build/transition/transition.js", 416); if (anim) {- _yuitest_coverline("build/transition/transition.js", 410);+ _yuitest_coverline("build/transition/transition.js", 417); anim.removeProperty(name);- _yuitest_coverline("build/transition/transition.js", 411);+ _yuitest_coverline("build/transition/transition.js", 418); anim._endNative(name);- _yuitest_coverline("build/transition/transition.js", 412);+ _yuitest_coverline("build/transition/transition.js", 419); config = anim._config[name]; - _yuitest_coverline("build/transition/transition.js", 414);+ _yuitest_coverline("build/transition/transition.js", 421); data = { type: 'propertyEnd', propertyName: name,@@ -631,44 +642,44 @@ config: config }; - _yuitest_coverline("build/transition/transition.js", 421);+ _yuitest_coverline("build/transition/transition.js", 428); if (config && config.on && config.on.end) {- _yuitest_coverline("build/transition/transition.js", 422);+ _yuitest_coverline("build/transition/transition.js", 429); config.on.end.call(Y.one(node), data); } - _yuitest_coverline("build/transition/transition.js", 425);+ _yuitest_coverline("build/transition/transition.js", 432); if (anim._count <= 0) { // after propertyEnd fires- _yuitest_coverline("build/transition/transition.js", 426);+ _yuitest_coverline("build/transition/transition.js", 433); anim._end(elapsed);- _yuitest_coverline("build/transition/transition.js", 427);+ _yuitest_coverline("build/transition/transition.js", 434); node.style[TRANSITION_PROPERTY_CAMEL] = ''; // clean up style } } }, destroy: function() {- _yuitest_coverfunc("build/transition/transition.js", "destroy", 432);-_yuitest_coverline("build/transition/transition.js", 433);+ _yuitest_coverfunc("build/transition/transition.js", "destroy", 439);+_yuitest_coverline("build/transition/transition.js", 440); var anim = this, node = anim._node; - _yuitest_coverline("build/transition/transition.js", 436);+ _yuitest_coverline("build/transition/transition.js", 443); if (node) {- _yuitest_coverline("build/transition/transition.js", 437);+ _yuitest_coverline("build/transition/transition.js", 444); node.removeEventListener(TRANSITION_END, anim._onNativeEnd, false);- _yuitest_coverline("build/transition/transition.js", 438);+ _yuitest_coverline("build/transition/transition.js", 445); anim._node = null; } } }; -_yuitest_coverline("build/transition/transition.js", 443);+_yuitest_coverline("build/transition/transition.js", 450); Y.Transition = Transition;-_yuitest_coverline("build/transition/transition.js", 444);+_yuitest_coverline("build/transition/transition.js", 451); Y.TransitionNative = Transition; // TODO: remove -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({@@ -690,158 +701,158 @@ * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. + * @param {Function} callback A function to run after the transition has completed. * @chainable */-_yuitest_coverline("build/transition/transition.js", 471);+_yuitest_coverline("build/transition/transition.js", 478); Y.Node.prototype.transition = function(name, config, callback) {- _yuitest_coverfunc("build/transition/transition.js", "transition", 471);-_yuitest_coverline("build/transition/transition.js", 472);-var + _yuitest_coverfunc("build/transition/transition.js", "transition", 478);+_yuitest_coverline("build/transition/transition.js", 479);+var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop;- - _yuitest_coverline("build/transition/transition.js", 478);++ _yuitest_coverline("build/transition/transition.js", 485); if (typeof name === 'string') { // named effect, pull config from registry- _yuitest_coverline("build/transition/transition.js", 479);+ _yuitest_coverline("build/transition/transition.js", 486); if (typeof config === 'function') {- _yuitest_coverline("build/transition/transition.js", 480);+ _yuitest_coverline("build/transition/transition.js", 487); callback = config;- _yuitest_coverline("build/transition/transition.js", 481);+ _yuitest_coverline("build/transition/transition.js", 488); config = null; } - _yuitest_coverline("build/transition/transition.js", 484);+ _yuitest_coverline("build/transition/transition.js", 491); fxConfig = Transition.fx[name]; - _yuitest_coverline("build/transition/transition.js", 486);+ _yuitest_coverline("build/transition/transition.js", 493); if (config && typeof config !== 'boolean') {- _yuitest_coverline("build/transition/transition.js", 487);+ _yuitest_coverline("build/transition/transition.js", 494); config = Y.clone(config); - _yuitest_coverline("build/transition/transition.js", 489);+ _yuitest_coverline("build/transition/transition.js", 496); for (prop in fxConfig) {- _yuitest_coverline("build/transition/transition.js", 490);+ _yuitest_coverline("build/transition/transition.js", 497); if (fxConfig.hasOwnProperty(prop)) {- _yuitest_coverline("build/transition/transition.js", 491);+ _yuitest_coverline("build/transition/transition.js", 498); if (! (prop in config)) {- _yuitest_coverline("build/transition/transition.js", 492);-config[prop] = fxConfig[prop]; + _yuitest_coverline("build/transition/transition.js", 499);+config[prop] = fxConfig[prop]; } } } } else {- _yuitest_coverline("build/transition/transition.js", 497);+ _yuitest_coverline("build/transition/transition.js", 504); config = fxConfig; } } else { // name is a config, config is a callback or undefined- _yuitest_coverline("build/transition/transition.js", 501);+ _yuitest_coverline("build/transition/transition.js", 508); callback = config;- _yuitest_coverline("build/transition/transition.js", 502);+ _yuitest_coverline("build/transition/transition.js", 509); config = name; } - _yuitest_coverline("build/transition/transition.js", 505);+ _yuitest_coverline("build/transition/transition.js", 512); if (anim && !anim._running) {- _yuitest_coverline("build/transition/transition.js", 506);+ _yuitest_coverline("build/transition/transition.js", 513); anim.init(this, config); } else {- _yuitest_coverline("build/transition/transition.js", 508);+ _yuitest_coverline("build/transition/transition.js", 515); anim = new Transition(this._node, config); } - _yuitest_coverline("build/transition/transition.js", 511);+ _yuitest_coverline("build/transition/transition.js", 518); anim.run(callback);- _yuitest_coverline("build/transition/transition.js", 512);+ _yuitest_coverline("build/transition/transition.js", 519); return this; }; -_yuitest_coverline("build/transition/transition.js", 515);+_yuitest_coverline("build/transition/transition.js", 522); Y.Node.prototype.show = function(name, config, callback) {- _yuitest_coverfunc("build/transition/transition.js", "show", 515);-_yuitest_coverline("build/transition/transition.js", 516);+ _yuitest_coverfunc("build/transition/transition.js", "show", 522);+_yuitest_coverline("build/transition/transition.js", 523); this._show(); // show prior to transition- _yuitest_coverline("build/transition/transition.js", 517);+ _yuitest_coverline("build/transition/transition.js", 524); if (name && Y.Transition) {- _yuitest_coverline("build/transition/transition.js", 518);+ _yuitest_coverline("build/transition/transition.js", 525); if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default- _yuitest_coverline("build/transition/transition.js", 519);+ _yuitest_coverline("build/transition/transition.js", 526); if (typeof config === 'function') {- _yuitest_coverline("build/transition/transition.js", 520);+ _yuitest_coverline("build/transition/transition.js", 527); callback = config;- _yuitest_coverline("build/transition/transition.js", 521);+ _yuitest_coverline("build/transition/transition.js", 528); config = name; }- _yuitest_coverline("build/transition/transition.js", 523);-name = Transition.SHOW_TRANSITION; - } - _yuitest_coverline("build/transition/transition.js", 525);+ _yuitest_coverline("build/transition/transition.js", 530);+name = Transition.SHOW_TRANSITION;+ }+ _yuitest_coverline("build/transition/transition.js", 532); this.transition(name, config, callback);- } - _yuitest_coverline("build/transition/transition.js", 527);+ }+ _yuitest_coverline("build/transition/transition.js", 534); return this; }; -_yuitest_coverline("build/transition/transition.js", 530);+_yuitest_coverline("build/transition/transition.js", 537); var _wrapCallBack = function(anim, fn, callback) {- _yuitest_coverfunc("build/transition/transition.js", "_wrapCallBack", 530);-_yuitest_coverline("build/transition/transition.js", 531);+ _yuitest_coverfunc("build/transition/transition.js", "_wrapCallBack", 537);+_yuitest_coverline("build/transition/transition.js", 538); return function() {- _yuitest_coverfunc("build/transition/transition.js", "(anonymous 8)", 531);-_yuitest_coverline("build/transition/transition.js", 532);+ _yuitest_coverfunc("build/transition/transition.js", "(anonymous 8)", 538);+_yuitest_coverline("build/transition/transition.js", 539); if (fn) {- _yuitest_coverline("build/transition/transition.js", 533);+ _yuitest_coverline("build/transition/transition.js", 540); fn.call(anim); }- _yuitest_coverline("build/transition/transition.js", 535);+ _yuitest_coverline("build/transition/transition.js", 542); if (callback) {- _yuitest_coverline("build/transition/transition.js", 536);+ _yuitest_coverline("build/transition/transition.js", 543); callback.apply(anim._node, arguments); } }; }; -_yuitest_coverline("build/transition/transition.js", 541);+_yuitest_coverline("build/transition/transition.js", 548); Y.Node.prototype.hide = function(name, config, callback) {- _yuitest_coverfunc("build/transition/transition.js", "hide", 541);-_yuitest_coverline("build/transition/transition.js", 542);+ _yuitest_coverfunc("build/transition/transition.js", "hide", 548);+_yuitest_coverline("build/transition/transition.js", 549); if (name && Y.Transition) {- _yuitest_coverline("build/transition/transition.js", 543);+ _yuitest_coverline("build/transition/transition.js", 550); if (typeof config === 'function') {- _yuitest_coverline("build/transition/transition.js", 544);+ _yuitest_coverline("build/transition/transition.js", 551); callback = config;- _yuitest_coverline("build/transition/transition.js", 545);+ _yuitest_coverline("build/transition/transition.js", 552); config = null; } - _yuitest_coverline("build/transition/transition.js", 548);+ _yuitest_coverline("build/transition/transition.js", 555); callback = _wrapCallBack(this, this._hide, callback); // wrap with existing callback- _yuitest_coverline("build/transition/transition.js", 549);+ _yuitest_coverline("build/transition/transition.js", 556); if (typeof name !== 'string' && !name.push) { // named effect or array of effects supercedes default- _yuitest_coverline("build/transition/transition.js", 550);+ _yuitest_coverline("build/transition/transition.js", 557); if (typeof config === 'function') {- _yuitest_coverline("build/transition/transition.js", 551);+ _yuitest_coverline("build/transition/transition.js", 558); callback = config;- _yuitest_coverline("build/transition/transition.js", 552);+ _yuitest_coverline("build/transition/transition.js", 559); config = name; }- _yuitest_coverline("build/transition/transition.js", 554);-name = Transition.HIDE_TRANSITION; - } - _yuitest_coverline("build/transition/transition.js", 556);+ _yuitest_coverline("build/transition/transition.js", 561);+name = Transition.HIDE_TRANSITION;+ }+ _yuitest_coverline("build/transition/transition.js", 563); this.transition(name, config, callback); } else {- _yuitest_coverline("build/transition/transition.js", 558);+ _yuitest_coverline("build/transition/transition.js", 565); this._hide();- } - _yuitest_coverline("build/transition/transition.js", 560);+ }+ _yuitest_coverline("build/transition/transition.js", 567); return this;-}; +}; -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({@@ -867,88 +878,88 @@ * once per item in the NodeList. * @chainable */-_yuitest_coverline("build/transition/transition.js", 589);+_yuitest_coverline("build/transition/transition.js", 596); Y.NodeList.prototype.transition = function(config, callback) {- _yuitest_coverfunc("build/transition/transition.js", "transition", 589);-_yuitest_coverline("build/transition/transition.js", 590);+ _yuitest_coverfunc("build/transition/transition.js", "transition", 596);+_yuitest_coverline("build/transition/transition.js", 597); var nodes = this._nodes, i = 0, node; - _yuitest_coverline("build/transition/transition.js", 594);+ _yuitest_coverline("build/transition/transition.js", 601); while ((node = nodes[i++])) {- _yuitest_coverline("build/transition/transition.js", 595);+ _yuitest_coverline("build/transition/transition.js", 602); Y.one(node).transition(config, callback); } - _yuitest_coverline("build/transition/transition.js", 598);+ _yuitest_coverline("build/transition/transition.js", 605); return this; }; -_yuitest_coverline("build/transition/transition.js", 601);+_yuitest_coverline("build/transition/transition.js", 608); Y.Node.prototype.toggleView = function(name, on, callback) {- _yuitest_coverfunc("build/transition/transition.js", "toggleView", 601);-_yuitest_coverline("build/transition/transition.js", 602);+ _yuitest_coverfunc("build/transition/transition.js", "toggleView", 608);+_yuitest_coverline("build/transition/transition.js", 609); this._toggles = this._toggles || [];- _yuitest_coverline("build/transition/transition.js", 603);+ _yuitest_coverline("build/transition/transition.js", 610); callback = arguments[arguments.length - 1]; - _yuitest_coverline("build/transition/transition.js", 605);+ _yuitest_coverline("build/transition/transition.js", 612); if (typeof name == 'boolean') { // no transition, just toggle- _yuitest_coverline("build/transition/transition.js", 606);+ _yuitest_coverline("build/transition/transition.js", 613); on = name;- _yuitest_coverline("build/transition/transition.js", 607);+ _yuitest_coverline("build/transition/transition.js", 614); name = null; } - _yuitest_coverline("build/transition/transition.js", 610);+ _yuitest_coverline("build/transition/transition.js", 617); name = name || Y.Transition.DEFAULT_TOGGLE; - _yuitest_coverline("build/transition/transition.js", 612);+ _yuitest_coverline("build/transition/transition.js", 619); if (typeof on == 'undefined' && name in this._toggles) { // reverse current toggle- _yuitest_coverline("build/transition/transition.js", 613);+ _yuitest_coverline("build/transition/transition.js", 620); on = ! this._toggles[name]; } - _yuitest_coverline("build/transition/transition.js", 616);+ _yuitest_coverline("build/transition/transition.js", 623); on = (on) ? 1 : 0;- _yuitest_coverline("build/transition/transition.js", 617);+ _yuitest_coverline("build/transition/transition.js", 624); if (on) {- _yuitest_coverline("build/transition/transition.js", 618);+ _yuitest_coverline("build/transition/transition.js", 625); this._show(); } else {- _yuitest_coverline("build/transition/transition.js", 620);+ _yuitest_coverline("build/transition/transition.js", 627); callback = _wrapCallBack(this, this._hide, callback); } - _yuitest_coverline("build/transition/transition.js", 623);+ _yuitest_coverline("build/transition/transition.js", 630); this._toggles[name] = on;- _yuitest_coverline("build/transition/transition.js", 624);+ _yuitest_coverline("build/transition/transition.js", 631); this.transition(Y.Transition.toggles[name][on], callback); - _yuitest_coverline("build/transition/transition.js", 626);+ _yuitest_coverline("build/transition/transition.js", 633); return this; }; -_yuitest_coverline("build/transition/transition.js", 629);+_yuitest_coverline("build/transition/transition.js", 636); Y.NodeList.prototype.toggleView = function(name, on, callback) {- _yuitest_coverfunc("build/transition/transition.js", "toggleView", 629);-_yuitest_coverline("build/transition/transition.js", 630);+ _yuitest_coverfunc("build/transition/transition.js", "toggleView", 636);+_yuitest_coverline("build/transition/transition.js", 637); var nodes = this._nodes, i = 0, node; - _yuitest_coverline("build/transition/transition.js", 634);+ _yuitest_coverline("build/transition/transition.js", 641); while ((node = nodes[i++])) {- _yuitest_coverline("build/transition/transition.js", 635);+ _yuitest_coverline("build/transition/transition.js", 642); Y.one(node).toggleView(name, on, callback); } - _yuitest_coverline("build/transition/transition.js", 638);+ _yuitest_coverline("build/transition/transition.js", 645); return this; }; -_yuitest_coverline("build/transition/transition.js", 641);+_yuitest_coverline("build/transition/transition.js", 648); Y.mix(Transition.fx, { fadeOut: { opacity: 0,@@ -971,55 +982,55 @@ sizeIn: { height: function(node) {- _yuitest_coverfunc("build/transition/transition.js", "height", 662);-_yuitest_coverline("build/transition/transition.js", 663);+ _yuitest_coverfunc("build/transition/transition.js", "height", 669);+_yuitest_coverline("build/transition/transition.js", 670); return node.get('scrollHeight') + 'px'; }, width: function(node) {- _yuitest_coverfunc("build/transition/transition.js", "width", 665);-_yuitest_coverline("build/transition/transition.js", 666);+ _yuitest_coverfunc("build/transition/transition.js", "width", 672);+_yuitest_coverline("build/transition/transition.js", 673); return node.get('scrollWidth') + 'px'; }, duration: 0.5, easing: 'ease-in',- + on: { start: function() {- _yuitest_coverfunc("build/transition/transition.js", "start", 672);-_yuitest_coverline("build/transition/transition.js", 673);+ _yuitest_coverfunc("build/transition/transition.js", "start", 679);+_yuitest_coverline("build/transition/transition.js", 680); var overflow = this.getStyle('overflow');- _yuitest_coverline("build/transition/transition.js", 674);+ _yuitest_coverline("build/transition/transition.js", 681); if (overflow !== 'hidden') { // enable scrollHeight/Width- _yuitest_coverline("build/transition/transition.js", 675);+ _yuitest_coverline("build/transition/transition.js", 682); this.setStyle('overflow', 'hidden');- _yuitest_coverline("build/transition/transition.js", 676);+ _yuitest_coverline("build/transition/transition.js", 683); this._transitionOverflow = overflow; } }, end: function() {- _yuitest_coverfunc("build/transition/transition.js", "end", 680);-_yuitest_coverline("build/transition/transition.js", 681);+ _yuitest_coverfunc("build/transition/transition.js", "end", 687);+_yuitest_coverline("build/transition/transition.js", 688); if (this._transitionOverflow) { // revert overridden value- _yuitest_coverline("build/transition/transition.js", 682);+ _yuitest_coverline("build/transition/transition.js", 689); this.setStyle('overflow', this._transitionOverflow);- _yuitest_coverline("build/transition/transition.js", 683);+ _yuitest_coverline("build/transition/transition.js", 690); delete this._transitionOverflow; } }- } + } } }); -_yuitest_coverline("build/transition/transition.js", 690);+_yuitest_coverline("build/transition/transition.js", 697); Y.mix(Transition.toggles, { size: ['sizeOut', 'sizeIn'], fade: ['fadeOut', 'fadeIn'] }); -_yuitest_coverline("build/transition/transition.js", 695);+_yuitest_coverline("build/transition/transition.js", 702); Transition.DEFAULT_TOGGLE = 'fade'; -}, '3.7.2', {"requires": ["node-style"]});+}, '3.7.3', {"requires": ["node-style"]});
bundle/transition/transition-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,15 +19,15 @@ DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,+ TRANSITION_CAMEL = 'transition',+ TRANSITION_PROPERTY_CAMEL = 'transitionProperty',+ TRANSFORM_CAMEL = 'transform', TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END,- TRANSFORM_CAMEL, EMPTY_OBJ = {}, @@ -62,13 +62,13 @@ Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- + if (m3) { str += '-' + m3.toLowerCase(); } return str;- }); + }); return property; };@@ -78,30 +78,37 @@ Transition.useNative = false; -Y.Array.each(VENDORS, function(val) { // then vendor specific- var property = val + TRANSITION_CAMEL;- if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- CAMEL_VENDOR_PREFIX = val;- VENDOR_PREFIX = Transition._toHyphen(val) + '-';+if ('transition' in DOCUMENT[DOCUMENT_ELEMENT].style) {+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+} else {+ Y.Array.each(VENDORS, function(val) { // then vendor specific+ var property = val + 'Transition';+ if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {+ CAMEL_VENDOR_PREFIX = val;+ VENDOR_PREFIX = Transition._toHyphen(val) + '-'; - Transition.useNative = true;- Transition.supported = true; // TODO: remove- Transition._VENDOR_PREFIX = val;- }-});+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+ Transition._VENDOR_PREFIX = val;+ }+ });+} -TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-TRANSITION_END = 'transitionend';-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+if (CAMEL_VENDOR_PREFIX) {+ TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition';+ TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';+ TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+} -TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;+TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';+TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';+TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';+TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; -TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+TRANSITION_END = 'transitionend';+ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END; Transition.fx = {}; Transition.toggles = {};@@ -110,7 +117,7 @@ Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; -Y.Node.DOM_EVENTS[TRANSITION_END] = 1; +Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; @@ -166,7 +173,7 @@ if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) {- val = config; + val = config; config = EMPTY_OBJ; } @@ -179,7 +186,7 @@ if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition }- } + } anim._count++; // properties per transition @@ -238,7 +245,7 @@ if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); - // when size is auto or % webkit starts from zero instead of computed + // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') {@@ -253,7 +260,7 @@ * @method run * @chainable * @private- */ + */ run: function(callback) { var anim = this, node = anim._node,@@ -286,9 +293,9 @@ }, _prepDur: function(dur) {- dur = parseFloat(dur);+ dur = parseFloat(dur) * 1000; - return dur + 's';+ return dur + 'ms'; }, _runNative: function(time) {@@ -347,7 +354,7 @@ Transition._hasEnd[uid] = true; }- + style.cssText += transitionText + duration + easing + delay + cssText; },@@ -360,10 +367,10 @@ data = { type: 'transition:end', config: config,- elapsedTime: elapsed + elapsedTime: elapsed }, - nodeInstance = Y.one(node); + nodeInstance = Y.one(node); anim._running = false; anim._callback = null;@@ -449,7 +456,7 @@ Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({@@ -471,16 +478,16 @@ * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. + * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) {- var + var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop;- + if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config;@@ -495,7 +502,7 @@ for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) {- config[prop] = fxConfig[prop]; + config[prop] = fxConfig[prop]; } } }@@ -526,10 +533,10 @@ callback = config; config = name; }- name = Transition.SHOW_TRANSITION; - } + name = Transition.SHOW_TRANSITION;+ } this.transition(name, config, callback);- } + } else if (name && !Y.Transition) { Y.log('unable to transition show; missing transition module', 'warn', 'node'); } return this; };@@ -558,17 +565,17 @@ callback = config; config = name; }- name = Transition.HIDE_TRANSITION; - } + name = Transition.HIDE_TRANSITION;+ } this.transition(name, config, callback); } else if (name && !Y.Transition) { Y.log('unable to transition hide; missing transition module', 'warn', 'node'); } else { this._hide();- } + } return this;-}; +}; -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({@@ -675,7 +682,7 @@ }, duration: 0.5, easing: 'ease-in',- + on: { start: function() { var overflow = this.getStyle('overflow');@@ -691,7 +698,7 @@ delete this._transitionOverflow; } }- } + } } }); @@ -704,4 +711,4 @@ -}, '3.7.2', {"requires": ["node-style"]});+}, '3.7.3', {"requires": ["node-style"]});
bundle/transition/transition-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("transition",function(e,t){var n="",r="",i=e.config.doc,s="documentElement",o="transition",u="Transition",a,f,l,c,h,p,d,v,m={},g=["Webkit","Moz"],y={Webkit:"webkitTransitionEnd"},b=function(){this.init.apply(this,arguments)};b._toCamel=function(e){return e=e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()}),e},b._toHyphen=function(e){return e=e.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(e,t,n,r){var i=(t?"-"+t.toLowerCase():"")+n;return r&&(i+="-"+r.toLowerCase()),i}),e},b.SHOW_TRANSITION="fadeIn",b.HIDE_TRANSITION="fadeOut",b.useNative=!1,e.Array.each(g,function(e){var t=e+u;t in i[s].style&&(n=e,r=b._toHyphen(e)+"-",b.useNative=!0,b.supported=!0,b._VENDOR_PREFIX=e)}),u=n+u,a=n+"TransitionProperty",f=r+"transition-property",l=r+"transition-duration",c=r+"transition-timing-function",h=r+"transition-delay",p="transitionend",d="on"+n.toLowerCase()+"transitionend",p=y[n]||p,v=n+"Transform",b.fx={},b.toggles={},b._hasEnd={},b._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i,e.Node.DOM_EVENTS[p]=1,b.NAME="transition",b.DEFAULT_EASING="ease",b.DEFAULT_DURATION=.5,b.DEFAULT_DELAY=0,b._nodeAttrs={},b.prototype={constructor:b,init:function(e,t){var n=this;return n._node=e,!n._running&&t&&(n._config=t,e._transition=n,n._duration="duration"in t?t.duration:n.constructor.DEFAULT_DURATION,n._delay="delay"in t?t.delay:n.constructor.DEFAULT_DELAY,n._easing=t.easing||n.constructor.DEFAULT_EASING,n._count=0,n._running=!1),n},addProperty:function(t,n){var r=this,i=this._node,s=e.stamp(i),o=e.one(i),u=b._nodeAttrs[s],a,f,l,c,h;u||(u=b._nodeAttrs[s]={}),c=u[t],n&&n.value!==undefined?h=n.value:n!==undefined&&(h=n,n=m),typeof h=="function"&&(h=h.call(o,o)),c&&c.transition&&c.transition!==r&&c.transition._count--,r._count++,l=(typeof n.duration!="undefined"?n.duration:r._duration)||1e-4,u[t]={value:h,duration:l,delay:typeof n.delay!="undefined"?n.delay:r._delay,easing:n.easing||r._easing,transition:r},a=e.DOM.getComputedStyle(i,t),f=typeof h=="string"?a:parseFloat(a),b.useNative&&f===h&&setTimeout(function(){r._onNativeEnd.call(i,{propertyName:t,elapsedTime:l})},l*1e3)},removeProperty:function(t){var n=this,r=b._nodeAttrs[e.stamp(n._node)];r&&r[t]&&(delete r[t],n._count--)},initAttrs:function(t){var n,r=this._node;t.transform&&!t[v]&&(t[v]=t.transform,delete t.transform);for(n in t)t.hasOwnProperty(n)&&!b._reKeywords.test(n)&&(this.addProperty(n,t[n]),r.style[n]===""&&e.DOM.setStyle(r,n,e.DOM.getComputedStyle(r,n)))},run:function(t){var n=this,r=n._node,i=n._config,s={type:"transition:start",config:i};return n._running||(n._running=!0,i.on&&i.on.start&&i.on.start.call(e.one(r),s),n.initAttrs(n._config),n._callback=t,n._start()),n},_start:function(){this._runNative()},_prepDur:function(e){return e=parseFloat(e),e+"s"},_runNative:function(t){var n=this,r=n._node,i=e.stamp(r),s=r.style,o=r.ownerDocument.defaultView.getComputedStyle(r),u=b._nodeAttrs[i],a="",d=o[b._toCamel(f)],v=f+": ",m=l+": ",g=c+": ",y=h+": ",w,E,S;d!=="all"&&(v+=d+",",m+=o[b._toCamel(l)]+",",g+=o[b._toCamel(c)]+",",y+=o[b._toCamel(h)]+",");for(S in u)w=b._toHyphen(S),E=u[S],(E=u[S])&&E.transition===n&&(S in r.style?(m+=n._prepDur(E.duration)+",",y+=n._prepDur(E.delay)+",",g+=E.easing+",",v+=w+",",a+=w+": "+E.value+"; "):this.removeProperty(S));v=v.replace(/,$/,";"),m=m.replace(/,$/,";"),g=g.replace(/,$/,";"),y=y.replace(/,$/,";"),b._hasEnd[i]||(r.addEventListener(p,n._onNativeEnd,""),b._hasEnd[i]=!0),s.cssText+=v+m+g+y+a},_end:function(t){var n=this,r=n._node,i=n._callback,s=n._config,o={type:"transition:end",config:s,elapsedTime:t},u=e.one(r);n._running=!1,n._callback=null,r&&(s.on&&s.on.end?setTimeout(function(){s.on.end.call(u,o),i&&i.call(u,o)},1):i&&setTimeout(function(){i.call(u,o)},1))},_endNative:function(e){var t=this._node,n=t.ownerDocument.defaultView.getComputedStyle(t,"")[b._toCamel(f)];e=b._toHyphen(e),typeof n=="string"&&(n=n.replace(new RegExp("(?:^|,\\s)"+e+",?"),","),n=n.replace(/^,|,$/,""),t.style[u]=n)},_onNativeEnd:function(t){var n=this,r=e.stamp(n),i=t,s=b._toCamel(i.propertyName),o=i.elapsedTime,u=b._nodeAttrs[r],f=u[s],l=f?f.transition:null,c,h;l&&(l.removeProperty(s),l._endNative(s),h=l._config[s],c={type:"propertyEnd",propertyName:s,elapsedTime:o,config:h},h&&h.on&&h.on.end&&h.on.end.call(e.one(n),c),l._count<=0&&(l._end(o),n.style[a]=""))},destroy:function(){var e=this,t=e._node;t&&(t.removeEventListener(p,e._onNativeEnd,!1),e._node=null)}},e.Transition=b,e.TransitionNative=b,e.Node.prototype.transition=function(t,n,r){var i=b._nodeAttrs[e.stamp(this._node)],s=i?i.transition||null:null,o,u;if(typeof t=="string"){typeof n=="function"&&(r=n,n=null),o=b.fx[t];if(n&&typeof n!="boolean"){n=e.clone(n);for(u in o)o.hasOwnProperty(u)&&(u in n||(n[u]=o[u]))}else n=o}else r=n,n=t;return s&&!s._running?s.init(this,n):s=new b(this._node,n),s.run(r),this},e.Node.prototype.show=function(t,n,r){return this._show(),t&&e.Transition&&(typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.SHOW_TRANSITION),this.transition(t,n,r)),this};var w=function(e,t,n){return function(){t&&t.call(e),n&&n.apply(e._node,arguments)}};e.Node.prototype.hide=function(t,n,r){return t&&e.Transition?(typeof n=="function"&&(r=n,n=null),r=w(this,this._hide,r),typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.HIDE_TRANSITION),this.transition(t,n,r)):this._hide(),this},e.NodeList.prototype.transition=function(t,n){var r=this._nodes,i=0,s;while(s=r[i++])e.one(s).transition(t,n);return this},e.Node.prototype.toggleView=function(t,n,r){return this._toggles=this._toggles||[],r=arguments[arguments.length-1],typeof t=="boolean"&&(n=t,t=null),t=t||e.Transition.DEFAULT_TOGGLE,typeof n=="undefined"&&t in this._toggles&&(n=!this._toggles[t]),n=n?1:0,n?this._show():r=w(this,this._hide,r),this._toggles[t]=n,this.transition(e.Transition.toggles[t][n],r),this},e.NodeList.prototype.toggleView=function(t,n,r){var i=this._nodes,s=0,o;while(o=i[s++])e.one(o).toggleView(t,n,r);return this},e.mix(b.fx,{fadeOut:{opacity:0,duration:.5,easing:"ease-out"},fadeIn:{opacity:1,duration:.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:.75,easing:"ease-out"},sizeIn:{height:function(e){return e.get("scrollHeight")+"px"},width:function(e){return e.get("scrollWidth")+"px"},duration:.5,easing:"ease-in",on:{start:function(){var e=this.getStyle("overflow");e!=="hidden"&&(this.setStyle("overflow","hidden"),this._transitionOverflow=e)},end:function(){this._transitionOverflow&&(this.setStyle("overflow",this._transitionOverflow),delete this._transitionOverflow)}}}}),e.mix(b.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]}),b.DEFAULT_TOGGLE="fade"},"3.7.2",{requires:["node-style"]});+YUI.add("transition",function(e,t){var n="",r="",i=e.config.doc,s="documentElement",o="transition",u="transition",a="transitionProperty",f="transform",l,c,h,p,d,v,m={},g=["Webkit","Moz"],y={Webkit:"webkitTransitionEnd"},b=function(){this.init.apply(this,arguments)};b._toCamel=function(e){return e=e.replace(/-([a-z])/gi,function(e,t){return t.toUpperCase()}),e},b._toHyphen=function(e){return e=e.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g,function(e,t,n,r){var i=(t?"-"+t.toLowerCase():"")+n;return r&&(i+="-"+r.toLowerCase()),i}),e},b.SHOW_TRANSITION="fadeIn",b.HIDE_TRANSITION="fadeOut",b.useNative=!1,"transition"in i[s].style?(b.useNative=!0,b.supported=!0):e.Array.each(g,function(e){var t=e+"Transition";t in i[s].style&&(n=e,r=b._toHyphen(e)+"-",b.useNative=!0,b.supported=!0,b._VENDOR_PREFIX=e)}),n&&(u=n+"Transition",a=n+"TransitionProperty",f=n+"Transform"),l=r+"transition-property",c=r+"transition-duration",h=r+"transition-timing-function",p=r+"transition-delay",d="transitionend",v="on"+n.toLowerCase()+"transitionend",d=y[n]||d,b.fx={},b.toggles={},b._hasEnd={},b._reKeywords=/^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i,e.Node.DOM_EVENTS[d]=1,b.NAME="transition",b.DEFAULT_EASING="ease",b.DEFAULT_DURATION=.5,b.DEFAULT_DELAY=0,b._nodeAttrs={},b.prototype={constructor:b,init:function(e,t){var n=this;return n._node=e,!n._running&&t&&(n._config=t,e._transition=n,n._duration="duration"in t?t.duration:n.constructor.DEFAULT_DURATION,n._delay="delay"in t?t.delay:n.constructor.DEFAULT_DELAY,n._easing=t.easing||n.constructor.DEFAULT_EASING,n._count=0,n._running=!1),n},addProperty:function(t,n){var r=this,i=this._node,s=e.stamp(i),o=e.one(i),u=b._nodeAttrs[s],a,f,l,c,h;u||(u=b._nodeAttrs[s]={}),c=u[t],n&&n.value!==undefined?h=n.value:n!==undefined&&(h=n,n=m),typeof h=="function"&&(h=h.call(o,o)),c&&c.transition&&c.transition!==r&&c.transition._count--,r._count++,l=(typeof n.duration!="undefined"?n.duration:r._duration)||1e-4,u[t]={value:h,duration:l,delay:typeof n.delay!="undefined"?n.delay:r._delay,easing:n.easing||r._easing,transition:r},a=e.DOM.getComputedStyle(i,t),f=typeof h=="string"?a:parseFloat(a),b.useNative&&f===h&&setTimeout(function(){r._onNativeEnd.call(i,{propertyName:t,elapsedTime:l})},l*1e3)},removeProperty:function(t){var n=this,r=b._nodeAttrs[e.stamp(n._node)];r&&r[t]&&(delete r[t],n._count--)},initAttrs:function(t){var n,r=this._node;t.transform&&!t[f]&&(t[f]=t.transform,delete t.transform);for(n in t)t.hasOwnProperty(n)&&!b._reKeywords.test(n)&&(this.addProperty(n,t[n]),r.style[n]===""&&e.DOM.setStyle(r,n,e.DOM.getComputedStyle(r,n)))},run:function(t){var n=this,r=n._node,i=n._config,s={type:"transition:start",config:i};return n._running||(n._running=!0,i.on&&i.on.start&&i.on.start.call(e.one(r),s),n.initAttrs(n._config),n._callback=t,n._start()),n},_start:function(){this._runNative()},_prepDur:function(e){return e=parseFloat(e)*1e3,e+"ms"},_runNative:function(t){var n=this,r=n._node,i=e.stamp(r),s=r.style,o=r.ownerDocument.defaultView.getComputedStyle(r),u=b._nodeAttrs[i],a="",f=o[b._toCamel(l)],v=l+": ",m=c+": ",g=h+": ",y=p+": ",w,E,S;f!=="all"&&(v+=f+",",m+=o[b._toCamel(c)]+",",g+=o[b._toCamel(h)]+",",y+=o[b._toCamel(p)]+",");for(S in u)w=b._toHyphen(S),E=u[S],(E=u[S])&&E.transition===n&&(S in r.style?(m+=n._prepDur(E.duration)+",",y+=n._prepDur(E.delay)+",",g+=E.easing+",",v+=w+",",a+=w+": "+E.value+"; "):this.removeProperty(S));v=v.replace(/,$/,";"),m=m.replace(/,$/,";"),g=g.replace(/,$/,";"),y=y.replace(/,$/,";"),b._hasEnd[i]||(r.addEventListener(d,n._onNativeEnd,""),b._hasEnd[i]=!0),s.cssText+=v+m+g+y+a},_end:function(t){var n=this,r=n._node,i=n._callback,s=n._config,o={type:"transition:end",config:s,elapsedTime:t},u=e.one(r);n._running=!1,n._callback=null,r&&(s.on&&s.on.end?setTimeout(function(){s.on.end.call(u,o),i&&i.call(u,o)},1):i&&setTimeout(function(){i.call(u,o)},1))},_endNative:function(e){var t=this._node,n=t.ownerDocument.defaultView.getComputedStyle(t,"")[b._toCamel(l)];e=b._toHyphen(e),typeof n=="string"&&(n=n.replace(new RegExp("(?:^|,\\s)"+e+",?"),","),n=n.replace(/^,|,$/,""),t.style[u]=n)},_onNativeEnd:function(t){var n=this,r=e.stamp(n),i=t,s=b._toCamel(i.propertyName),o=i.elapsedTime,u=b._nodeAttrs[r],f=u[s],l=f?f.transition:null,c,h;l&&(l.removeProperty(s),l._endNative(s),h=l._config[s],c={type:"propertyEnd",propertyName:s,elapsedTime:o,config:h},h&&h.on&&h.on.end&&h.on.end.call(e.one(n),c),l._count<=0&&(l._end(o),n.style[a]=""))},destroy:function(){var e=this,t=e._node;t&&(t.removeEventListener(d,e._onNativeEnd,!1),e._node=null)}},e.Transition=b,e.TransitionNative=b,e.Node.prototype.transition=function(t,n,r){var i=b._nodeAttrs[e.stamp(this._node)],s=i?i.transition||null:null,o,u;if(typeof t=="string"){typeof n=="function"&&(r=n,n=null),o=b.fx[t];if(n&&typeof n!="boolean"){n=e.clone(n);for(u in o)o.hasOwnProperty(u)&&(u in n||(n[u]=o[u]))}else n=o}else r=n,n=t;return s&&!s._running?s.init(this,n):s=new b(this._node,n),s.run(r),this},e.Node.prototype.show=function(t,n,r){return this._show(),t&&e.Transition&&(typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.SHOW_TRANSITION),this.transition(t,n,r)),this};var w=function(e,t,n){return function(){t&&t.call(e),n&&n.apply(e._node,arguments)}};e.Node.prototype.hide=function(t,n,r){return t&&e.Transition?(typeof n=="function"&&(r=n,n=null),r=w(this,this._hide,r),typeof t!="string"&&!t.push&&(typeof n=="function"&&(r=n,n=t),t=b.HIDE_TRANSITION),this.transition(t,n,r)):this._hide(),this},e.NodeList.prototype.transition=function(t,n){var r=this._nodes,i=0,s;while(s=r[i++])e.one(s).transition(t,n);return this},e.Node.prototype.toggleView=function(t,n,r){return this._toggles=this._toggles||[],r=arguments[arguments.length-1],typeof t=="boolean"&&(n=t,t=null),t=t||e.Transition.DEFAULT_TOGGLE,typeof n=="undefined"&&t in this._toggles&&(n=!this._toggles[t]),n=n?1:0,n?this._show():r=w(this,this._hide,r),this._toggles[t]=n,this.transition(e.Transition.toggles[t][n],r),this},e.NodeList.prototype.toggleView=function(t,n,r){var i=this._nodes,s=0,o;while(o=i[s++])e.one(o).toggleView(t,n,r);return this},e.mix(b.fx,{fadeOut:{opacity:0,duration:.5,easing:"ease-out"},fadeIn:{opacity:1,duration:.5,easing:"ease-in"},sizeOut:{height:0,width:0,duration:.75,easing:"ease-out"},sizeIn:{height:function(e){return e.get("scrollHeight")+"px"},width:function(e){return e.get("scrollWidth")+"px"},duration:.5,easing:"ease-in",on:{start:function(){var e=this.getStyle("overflow");e!=="hidden"&&(this.setStyle("overflow","hidden"),this._transitionOverflow=e)},end:function(){this._transitionOverflow&&(this.setStyle("overflow",this._transitionOverflow),delete this._transitionOverflow)}}}}),e.mix(b.toggles,{size:["sizeOut","sizeIn"],fade:["fadeOut","fadeIn"]}),b.DEFAULT_TOGGLE="fade"},"3.7.3",{requires:["node-style"]});
bundle/transition/transition.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -19,15 +19,15 @@ DOCUMENT = Y.config.doc, DOCUMENT_ELEMENT = 'documentElement', TRANSITION = 'transition',- TRANSITION_CAMEL = 'Transition',- TRANSITION_PROPERTY_CAMEL,+ TRANSITION_CAMEL = 'transition',+ TRANSITION_PROPERTY_CAMEL = 'transitionProperty',+ TRANSFORM_CAMEL = 'transform', TRANSITION_PROPERTY, TRANSITION_DURATION, TRANSITION_TIMING_FUNCTION, TRANSITION_DELAY, TRANSITION_END, ON_TRANSITION_END,- TRANSFORM_CAMEL, EMPTY_OBJ = {}, @@ -62,13 +62,13 @@ Transition._toHyphen = function(property) { property = property.replace(/([A-Z]?)([a-z]+)([A-Z]?)/g, function(m0, m1, m2, m3) { var str = ((m1) ? '-' + m1.toLowerCase() : '') + m2;- + if (m3) { str += '-' + m3.toLowerCase(); } return str;- }); + }); return property; };@@ -78,30 +78,37 @@ Transition.useNative = false; -Y.Array.each(VENDORS, function(val) { // then vendor specific- var property = val + TRANSITION_CAMEL;- if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {- CAMEL_VENDOR_PREFIX = val;- VENDOR_PREFIX = Transition._toHyphen(val) + '-';+if ('transition' in DOCUMENT[DOCUMENT_ELEMENT].style) {+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+} else {+ Y.Array.each(VENDORS, function(val) { // then vendor specific+ var property = val + 'Transition';+ if (property in DOCUMENT[DOCUMENT_ELEMENT].style) {+ CAMEL_VENDOR_PREFIX = val;+ VENDOR_PREFIX = Transition._toHyphen(val) + '-'; - Transition.useNative = true;- Transition.supported = true; // TODO: remove- Transition._VENDOR_PREFIX = val;- }-});+ Transition.useNative = true;+ Transition.supported = true; // TODO: remove+ Transition._VENDOR_PREFIX = val;+ }+ });+} -TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + TRANSITION_CAMEL;-TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';-TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';-TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';-TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';-TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay';-TRANSITION_END = 'transitionend';-ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+if (CAMEL_VENDOR_PREFIX) {+ TRANSITION_CAMEL = CAMEL_VENDOR_PREFIX + 'Transition';+ TRANSITION_PROPERTY_CAMEL = CAMEL_VENDOR_PREFIX + 'TransitionProperty';+ TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+} -TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END;+TRANSITION_PROPERTY = VENDOR_PREFIX + 'transition-property';+TRANSITION_DURATION = VENDOR_PREFIX + 'transition-duration';+TRANSITION_TIMING_FUNCTION = VENDOR_PREFIX + 'transition-timing-function';+TRANSITION_DELAY = VENDOR_PREFIX + 'transition-delay'; -TRANSFORM_CAMEL = CAMEL_VENDOR_PREFIX + 'Transform';+TRANSITION_END = 'transitionend';+ON_TRANSITION_END = 'on' + CAMEL_VENDOR_PREFIX.toLowerCase() + 'transitionend';+TRANSITION_END = VENDOR_TRANSITION_END[CAMEL_VENDOR_PREFIX] || TRANSITION_END; Transition.fx = {}; Transition.toggles = {};@@ -110,7 +117,7 @@ Transition._reKeywords = /^(?:node|duration|iterations|easing|delay|on|onstart|onend)$/i; -Y.Node.DOM_EVENTS[TRANSITION_END] = 1; +Y.Node.DOM_EVENTS[TRANSITION_END] = 1; Transition.NAME = 'transition'; @@ -166,7 +173,7 @@ if (config && config.value !== undefined) { val = config.value; } else if (config !== undefined) {- val = config; + val = config; config = EMPTY_OBJ; } @@ -179,7 +186,7 @@ if (attr.transition !== anim) { attr.transition._count--; // remapping attr to this transition }- } + } anim._count++; // properties per transition @@ -238,7 +245,7 @@ if (config.hasOwnProperty(attr) && !Transition._reKeywords.test(attr)) { this.addProperty(attr, config[attr]); - // when size is auto or % webkit starts from zero instead of computed + // when size is auto or % webkit starts from zero instead of computed // (https://bugs.webkit.org/show_bug.cgi?id=16020) // TODO: selective set if (node.style[attr] === '') {@@ -253,7 +260,7 @@ * @method run * @chainable * @private- */ + */ run: function(callback) { var anim = this, node = anim._node,@@ -286,9 +293,9 @@ }, _prepDur: function(dur) {- dur = parseFloat(dur);+ dur = parseFloat(dur) * 1000; - return dur + 's';+ return dur + 'ms'; }, _runNative: function(time) {@@ -347,7 +354,7 @@ Transition._hasEnd[uid] = true; }- + style.cssText += transitionText + duration + easing + delay + cssText; },@@ -360,10 +367,10 @@ data = { type: 'transition:end', config: config,- elapsedTime: elapsed + elapsedTime: elapsed }, - nodeInstance = Y.one(node); + nodeInstance = Y.one(node); anim._running = false; anim._callback = null;@@ -449,7 +456,7 @@ Y.Transition = Transition; Y.TransitionNative = Transition; // TODO: remove -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.one('#demo').transition({@@ -471,16 +478,16 @@ * @for Node * @method transition * @param {Object} config An object containing one or more style properties, a duration and an easing.- * @param {Function} callback A function to run after the transition has completed. + * @param {Function} callback A function to run after the transition has completed. * @chainable */ Y.Node.prototype.transition = function(name, config, callback) {- var + var transitionAttrs = Transition._nodeAttrs[Y.stamp(this._node)], anim = (transitionAttrs) ? transitionAttrs.transition || null : null, fxConfig, prop;- + if (typeof name === 'string') { // named effect, pull config from registry if (typeof config === 'function') { callback = config;@@ -495,7 +502,7 @@ for (prop in fxConfig) { if (fxConfig.hasOwnProperty(prop)) { if (! (prop in config)) {- config[prop] = fxConfig[prop]; + config[prop] = fxConfig[prop]; } } }@@ -526,10 +533,10 @@ callback = config; config = name; }- name = Transition.SHOW_TRANSITION; - } + name = Transition.SHOW_TRANSITION;+ } this.transition(name, config, callback);- } + } return this; }; @@ -557,16 +564,16 @@ callback = config; config = name; }- name = Transition.HIDE_TRANSITION; - } + name = Transition.HIDE_TRANSITION;+ } this.transition(name, config, callback); } else { this._hide();- } + } return this;-}; +}; -/** +/** * Animate one or more css properties to a given value. Requires the "transition" module. * <pre>example usage: * Y.all('.demo').transition({@@ -673,7 +680,7 @@ }, duration: 0.5, easing: 'ease-in',- + on: { start: function() { var overflow = this.getStyle('overflow');@@ -689,7 +696,7 @@ delete this._transitionOverflow; } }- } + } } }); @@ -702,4 +709,4 @@ -}, '3.7.2', {"requires": ["node-style"]});+}, '3.7.3', {"requires": ["node-style"]});
bundle/uploader-deprecated/uploader-deprecated-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "/build/uploader-deprecated/uploader-deprecated.js", code: [] };-_yuitest_coverage["/build/uploader-deprecated/uploader-deprecated.js"].code=["YUI.add('uploader-deprecated', function(Y) {","","/**"," * Attention: this is the 3.4.1 `uploader` module has been deprecated in favor of a new "," * uploader with an HTML5 layer. Please refer to the new Uploader User Guide for migration "," * information."," * "," * This module uses Flash player transport to upload files to the server, with support for "," * file filtering, multiple file uploads and progress monitoring."," * @module uploader-deprecated"," * @deprecated"," */"," ","var Event = Y.Event,"," Node = Y.Node;","","var SWFURL = Y.Env.cdn + \"uploader-deprecated/assets/uploader.swf\";","","/*"," * <p><strong><span style=\"color:#ff0000;\">Attention: this is the 3.4.1 uploader module, which has "," * been deprecated in favor of a new uploader with an HTML5 layer. Please refer to the new "," * Uploader User Guide for migration information.</span></strong></p>"," * <p>The Uploader widget is a tool for uploading files to the server.</p>"," * @module uploader-deprecated"," * @title Uploader"," * @requires base, node, event, swf"," */","","/*"," * <p><strong><span style=\"color:#ff0000;\">Attention: this is the 3.4.1 uploader module, which has "," * been deprecated in favor of a new uploader with an HTML5 layer. Please refer to the new "," * Uploader User Guide for migration information.</span></strong></p>"," * <p>Creates the Uploader instance and keeps the initialization data.</p>"," *"," * @class Uploader"," * @extends Y.Base"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Uploader. The following parameters are available:"," * <dl>"," * <dt>boundingBox : String|Node (required)</dt>"," * <dd></dd>"," * <dt>buttonSkin : String (optional)</dt>"," * <dd></dd>"," * <dt>transparent : String (optional)</dt>"," * <dd></dd>"," * <dt>swfURL : String (optional)</dt>"," * <dd></dd>"," * </dl>"," * @deprecated"," */"," ","function Uploader (config /*Object*/) {"," "," Uploader.superclass.constructor.apply(this, arguments);",""," if (config.hasOwnProperty(\"boundingBox\")) {"," this.set(\"boundingBox\", config.boundingBox);"," };",""," if (config.hasOwnProperty(\"buttonSkin\")) {"," this.set(\"buttonSkin\", config.buttonSkin);"," };"," if (config.hasOwnProperty(\"transparent\")) {"," this.set(\"transparent\", config.transparent);"," };"," if (config.hasOwnProperty(\"swfURL\")) {"," this.set(\"swfURL\", config.swfURL);"," };","};","","","Y.extend(Uploader, Y.Base, {"," "," /*"," * The reference to the instance of Y.SWF that encapsulates the instance of the Flash player with uploader logic."," *"," * @private"," * @property uploaderswf"," * @type {SWF}"," * @default null"," * @deprecated"," */"," uploaderswf:null,",""," /*"," * The id of this instance of uploader."," *"," * @private"," * @property _id"," * @type {String}"," * @deprecated"," */"," _id:\"\",",""," /*"," * Construction logic executed during Uploader instantiation."," *"," * @method initializer"," * @protected"," * @deprecated"," */"," initializer : function () {"," "," this._id = Y.guid(\"uploader\");"," var oElement = Node.one(this.get(\"boundingBox\"));",""," var params = {version: \"10.0.45\","," fixedAttributes: {allowScriptAccess:\"always\", allowNetworking:\"all\", scale: \"noscale\"},"," flashVars: {}};",""," if (this.get(\"buttonSkin\") != \"\") {"," params.flashVars[\"buttonSkin\"] = this.get(\"buttonSkin\");"," }"," if (this.get(\"transparent\")) {"," params.fixedAttributes[\"wmode\"] = \"transparent\";"," }",""," this.uploaderswf = new Y.SWF(oElement, this.get(\"swfURL\"), params);",""," var upswf = this.uploaderswf;"," var relEvent = Y.bind(this._relayEvent, this);",""," /*"," * Announces that the uploader is ready and available for calling methods"," * and setting properties"," *"," * @event uploaderReady"," * @param event {Event} The event object for the uploaderReady."," * @deprecated"," */"," upswf.on (\"swfReady\", Y.bind(this._initializeUploader, this));"," "," /*"," * Fired when the mouse button is clicked on the Uploader's 'Browse' button."," *"," * @event click"," * @param event {Event} The event object for the click."," * @deprecated"," */"," upswf.on (\"click\", relEvent);",""," /*"," * Fires when the user has finished selecting a set of files to be uploaded."," *"," * @event fileselect"," * @param event {Event} The event object for the fileSelect."," * <dl>"," * <dt>fileList</dt>"," * <dd>The file list Object with entries in the following format: "," fileList[fileID] = {id: fileID, name: fileName, cDate: fileCDate, mDate: fileMDate, size: fileSize}</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"fileselect\", relEvent);",""," /*"," * Fired when the mouse button is pressed on the Uploader's 'Browse' button."," *"," * @event mousedown"," * @param event {Event} The event object for the mousedown."," * @deprecated"," */"," upswf.on (\"mousedown\", relEvent);",""," /*"," * Fired when the mouse button is raised on the Uploader's 'Browse' button."," *"," * @event mouseup"," * @param event {Event} The event object for the mouseup."," * @deprecated"," */"," upswf.on (\"mouseup\", relEvent);",""," /*"," * Fired when the mouse leaves the Uploader's 'Browse' button."," *"," * @event mouseleave"," * @param event {Event} The event object for the mouseleave."," * @deprecated"," */"," upswf.on (\"mouseleave\", relEvent);",""," /*"," * Fired when the mouse enters the Uploader's 'Browse' button."," *"," * @event mouseenter"," * @param event {Event} The event object for the mouseenter."," * @deprecated"," */"," upswf.on (\"mouseenter\", relEvent);",""," /*"," * Announces that the uploader is ready and available for calling methods"," * and setting properties"," *"," * @event uploadcancel"," * @param event {Event} The event object for the uploaderReady."," * <dl>"," * <dt>ddEvent</dt>"," * <dd><code>drag:start</code> event from the thumb</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadcancel\", relEvent);",""," /*"," * Fires when a specific file's upload is cancelled."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the uploadcancel."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file whose upload has been cancelled.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadcomplete\", relEvent);",""," /*"," * If the server has sent a response to the file upload, this event is"," * fired and the response is added to its payload."," *"," * @event uploadcompletedata"," * @param event {Event} The event object for the uploadcompletedata."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file for which the response is being provided.</dd>"," * <dt>data</dt>"," * <dd>The content of the server response.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadcompletedata\", relEvent);",""," /*"," * Provides error information if an error has occurred during the upload."," *"," * @event uploaderror"," * @param event {Event} The event object for the uploadeerror."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file for which the upload error has occurred.</dd>"," * <dt>status</dt>"," * <dd>Relevant error information.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploaderror\", relEvent);",""," /*"," * Provides progress information on a specific file upload."," *"," * @event uploadprogress"," * @param event {Event} The event object for the uploadprogress."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file for which the progress information is being provided.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file that is being uploaded.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadprogress\", relEvent);",""," /*"," * Announces that the upload has been started for a specific file."," *"," * @event uploadstart"," * @param event {Event} The event object for the uploadstart."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file whose upload has been started.</dd>"," * </dl>"," * @deprecated"," */ "," upswf.on (\"uploadstart\", relEvent);"," },",""," /*"," * Removes a specific file from the upload queue."," *"," * @method removeFile"," * @param fileID {String} The ID of the file to be removed"," * @return {Object} The updated file list, which is an object of the format:"," * fileList[fileID] = {id: fileID, name: fileName, cDate: fileCDate, mDate: fileMDate, size: fileSize}"," * @deprecated"," */"," removeFile : function (fileID /*String*/) {"," return this.uploaderswf.callSWF(\"removeFile\", [fileID]);"," },"," "," /*"," * Clears the upload queue."," *"," * @method clearFileList"," * @return {Boolean} This method always returns true."," * @deprecated"," */"," clearFileList : function () {"," return this.uploaderswf.callSWF(\"clearFileList\", []);"," },",""," /*"," * Starts the upload of a specific file."," *"," * @method upload"," * @param fileID {String} The ID of the file to be uploaded."," * @param url {String} The URL to upload the file to."," * @param method {String} (optional) The HTTP method to use for sending additional variables, either 'GET' or 'POST' ('GET' by default)"," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param postFileVarName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," * @return {Boolean} This method always returns true."," * @deprecated"," */"," upload : function (fileID /*String*/, url /*String*/, method /*String*/, postVars /*Object*/, postFileVarName /*String*/) {"," if (Y.Lang.isArray(fileID)) {"," return this.uploaderswf.callSWF(\"uploadThese\", [fileID, url, method, postVars, postFileVarName]);"," }"," else if (Y.Lang.isString(fileID)) {"," return this.uploaderswf.callSWF(\"upload\", [fileID, url, method, postVars, postFileVarName]);"," "," }"," },",""," /*"," * Starts the upload of a set of files, as specified in the first argument. "," * The upload queue is managed automatically."," *"," * @method uploadThese"," * @param fileIDs {Array} The array of IDs of the files to be uploaded."," * @param url {String} The URL to upload the files to."," * @param method {String} (optional) The HTTP method to use for sending additional variables, either 'GET' or 'POST' ('GET' by default)"," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param postFileVarName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," * @deprecated"," */"," uploadThese : function (fileIDs /*Array*/, url /*String*/, method /*String*/, postVars /*Object*/, postFileVarName /*String*/) {"," return this.uploaderswf.callSWF(\"uploadThese\", [fileIDs, url, method, postVars, postFileVarName]);"," },",""," /*"," * Starts the upload of the files in the upload queue. "," * The upload queue is managed automatically."," *"," * @method uploadAll"," * @param url {String} The URL to upload the files to."," * @param method {String} (optional) The HTTP method to use for sending additional variables, either 'GET' or 'POST' ('GET' by default)"," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param postFileVarName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)."," * @deprecated"," */ "," uploadAll : function (url /*String*/, method /*String*/, postVars /*Object*/, postFileVarName /*String*/) {"," return this.uploaderswf.callSWF(\"uploadAll\", [url, method, postVars,postFileVarName]);"," },",""," /*"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancel"," * @param fileID {String} (optional) The ID of the file whose upload should be cancelled. If no ID is specified, all uploads are cancelled."," * @deprecated"," */ "," cancel : function (fileID /*String*/) {"," return this.uploaderswf.callSWF(\"cancel\", [fileID]);"," },",""," /*"," * @private"," * Setter for the 'log' property."," * @method setAllowLogging"," * @param value {Boolean} The value for the 'log' property."," * @deprecated"," */"," setAllowLogging : function (value /*Boolean*/) {"," this.uploaderswf.callSWF(\"setAllowLogging\", [value]);"," },",""," /*"," * @private"," * Setter for the 'multiFiles' property."," * @method setAllowMultipleFiles"," * @param value {Boolean} The value for the 'multiFiles' property."," * @deprecated"," */"," setAllowMultipleFiles : function (value /*Boolean*/) {"," this.uploaderswf.callSWF(\"setAllowMultipleFiles\", [value]);"," },",""," /*"," * @private"," * Setter for the 'simLimit' property."," * @method setSimUploadLimit"," * @param value {Boolean} The value for the 'simLimit' property."," * @deprecated"," */"," setSimUploadLimit : function (value /*int*/) {"," this.uploaderswf.callSWF(\"setSimUploadLimit\", [value]);"," },",""," /*"," * @private"," * Setter for the 'fileFilters' property."," * @method setFileFilters"," * @param value {Boolean} The value for the 'fileFilters' property."," * @deprecated"," */ "," setFileFilters : function (fileFilters /*Array*/) {"," this.uploaderswf.callSWF(\"setFileFilters\", [fileFilters]);"," },",""," /*"," * Enables the uploader user input (mouse clicks on the 'Browse' button). If the button skin "," * is applied, the sprite is reset from the \"disabled\" state."," *"," * @method enable"," * @deprecated"," */ "," enable : function () {"," this.uploaderswf.callSWF(\"enable\");"," },",""," /*"," * Disables the uploader user input (mouse clicks on the 'Browse' button). If the button skin "," * is applied, the sprite is set to the 'disabled' state."," *"," * @method enable"," * @deprecated"," */ "," disable : function () {"," this.uploaderswf.callSWF(\"disable\");"," },",""," /*"," * @private"," * Called when the uploader SWF is initialized"," * @method _initializeUploader"," * @param event {Object} The event to be propagated from Flash."," * @deprecated"," */"," _initializeUploader: function (event) {"," this.publish(\"uploaderReady\", {fireOnce:true});"," this.fire(\"uploaderReady\", {});"," },",""," /*"," * @private"," * Called when an event is dispatched from Uploader"," * @method _relayEvent"," * @param event {Object} The event to be propagated from Flash."," * @deprecated"," */ "," _relayEvent: function (event) {"," this.fire(event.type, event);"," },"," "," toString: function()"," {"," return \"Uploader \" + this._id;"," }","","},","{"," ATTRS: {"," /*"," * The flag that allows Flash player to "," * output debug messages to its trace stack "," * (if the Flash debug player is used)."," *"," * @attribute log"," * @type {Boolean}"," * @default false"," * @deprecated"," */"," log: {"," value: false,"," setter : \"setAllowLogging\""," },",""," /*"," * The flag that allows the user to select"," * more than one files during the 'Browse'"," * dialog (using 'Shift' or 'Ctrl' keys)."," *"," * @attribute multiFiles"," * @type {Boolean}"," * @default false"," * @deprecated"," */"," multiFiles : {"," value: false,"," setter : \"setAllowMultipleFiles\""," },"," "," /*"," * The number of files that can be uploaded"," * simultaneously if the automatic queue management"," * is used. This value can be in the range between 2"," * and 5."," *"," * @attribute simLimit"," * @type {Number}"," * @default 2"," * @deprecated"," */"," simLimit : {"," value: 2,"," setter : \"setSimUploadLimit\""," },",""," /*"," * The array of filters on file extensions for"," * the 'Browse' dialog. These filters only provide"," * convenience for the user and do not strictly"," * limit the selection to certain file extensions."," * Each item in the array must contain a 'description'"," * property, and an 'extensions' property that must be"," * in the form \"*.ext;*.ext;*.ext;...\""," *"," * @attribute fileFilters"," * @type {Array}"," * @default []"," * @deprecated"," */"," fileFilters : {"," value: [],"," setter : \"setFileFilters\""," },"," "," /*"," * The Node containing the uploader's 'Browse' button."," *"," * @attribute boundingBox"," * @type {Node}"," * @default null"," * @writeOnce"," * @deprecated"," */"," boundingBox : {"," value: null,"," writeOnce: 'initOnly'"," },"," "," /*"," * The URL of the image sprite for skinning the uploader's 'Browse' button."," *"," * @attribute buttonSkin"," * @type {String}"," * @default null"," * @writeOnce"," * @deprecated"," */"," buttonSkin : {"," value: null,"," writeOnce: 'initOnly'"," },"," "," /*"," * The flag indicating whether the uploader is rendered "," * with a transparent background."," *"," * @attribute transparent"," * @type {Boolean}"," * @default true"," * @writeOnce"," * @deprecated"," */"," transparent : {"," value: true,"," writeOnce: 'initOnly'"," },"," "," /*"," * The URL of the uploader's SWF."," *"," * @attribute swfURL"," * @type {String}"," * @default \"assets/uploader.swf\""," * @writeOnce"," * @deprecated"," */"," swfURL : {"," value : SWFURL,"," writeOnce: 'initOnly'"," }"," "," }","}",");","Y.Uploader = Uploader;","","","}, '3.7.2' ,{requires:['swf', 'base', 'node', 'event-custom']});"];+_yuitest_coverage["/build/uploader-deprecated/uploader-deprecated.js"].code=["YUI.add('uploader-deprecated', function(Y) {","","/**"," * Attention: this is the 3.4.1 `uploader` module has been deprecated in favor of a new "," * uploader with an HTML5 layer. Please refer to the new Uploader User Guide for migration "," * information."," * "," * This module uses Flash player transport to upload files to the server, with support for "," * file filtering, multiple file uploads and progress monitoring."," * @module uploader-deprecated"," * @deprecated"," */"," ","var Event = Y.Event,"," Node = Y.Node;","","var SWFURL = Y.Env.cdn + \"uploader-deprecated/assets/uploader.swf\";","","/*"," * <p><strong><span style=\"color:#ff0000;\">Attention: this is the 3.4.1 uploader module, which has "," * been deprecated in favor of a new uploader with an HTML5 layer. Please refer to the new "," * Uploader User Guide for migration information.</span></strong></p>"," * <p>The Uploader widget is a tool for uploading files to the server.</p>"," * @module uploader-deprecated"," * @title Uploader"," * @requires base, node, event, swf"," */","","/*"," * <p><strong><span style=\"color:#ff0000;\">Attention: this is the 3.4.1 uploader module, which has "," * been deprecated in favor of a new uploader with an HTML5 layer. Please refer to the new "," * Uploader User Guide for migration information.</span></strong></p>"," * <p>Creates the Uploader instance and keeps the initialization data.</p>"," *"," * @class Uploader"," * @extends Y.Base"," * @constructor"," * @param {Object} config (optional) Configuration parameters for the Uploader. The following parameters are available:"," * <dl>"," * <dt>boundingBox : String|Node (required)</dt>"," * <dd></dd>"," * <dt>buttonSkin : String (optional)</dt>"," * <dd></dd>"," * <dt>transparent : String (optional)</dt>"," * <dd></dd>"," * <dt>swfURL : String (optional)</dt>"," * <dd></dd>"," * </dl>"," * @deprecated"," */"," ","function Uploader (config /*Object*/) {"," "," Uploader.superclass.constructor.apply(this, arguments);",""," if (config.hasOwnProperty(\"boundingBox\")) {"," this.set(\"boundingBox\", config.boundingBox);"," };",""," if (config.hasOwnProperty(\"buttonSkin\")) {"," this.set(\"buttonSkin\", config.buttonSkin);"," };"," if (config.hasOwnProperty(\"transparent\")) {"," this.set(\"transparent\", config.transparent);"," };"," if (config.hasOwnProperty(\"swfURL\")) {"," this.set(\"swfURL\", config.swfURL);"," };","};","","","Y.extend(Uploader, Y.Base, {"," "," /*"," * The reference to the instance of Y.SWF that encapsulates the instance of the Flash player with uploader logic."," *"," * @private"," * @property uploaderswf"," * @type {SWF}"," * @default null"," * @deprecated"," */"," uploaderswf:null,",""," /*"," * The id of this instance of uploader."," *"," * @private"," * @property _id"," * @type {String}"," * @deprecated"," */"," _id:\"\",",""," /*"," * Construction logic executed during Uploader instantiation."," *"," * @method initializer"," * @protected"," * @deprecated"," */"," initializer : function () {"," "," this._id = Y.guid(\"uploader\");"," var oElement = Node.one(this.get(\"boundingBox\"));",""," var params = {version: \"10.0.45\","," fixedAttributes: {allowScriptAccess:\"always\", allowNetworking:\"all\", scale: \"noscale\"},"," flashVars: {}};",""," if (this.get(\"buttonSkin\") != \"\") {"," params.flashVars[\"buttonSkin\"] = this.get(\"buttonSkin\");"," }"," if (this.get(\"transparent\")) {"," params.fixedAttributes[\"wmode\"] = \"transparent\";"," }",""," this.uploaderswf = new Y.SWF(oElement, this.get(\"swfURL\"), params);",""," var upswf = this.uploaderswf;"," var relEvent = Y.bind(this._relayEvent, this);",""," /*"," * Announces that the uploader is ready and available for calling methods"," * and setting properties"," *"," * @event uploaderReady"," * @param event {Event} The event object for the uploaderReady."," * @deprecated"," */"," upswf.on (\"swfReady\", Y.bind(this._initializeUploader, this));"," "," /*"," * Fired when the mouse button is clicked on the Uploader's 'Browse' button."," *"," * @event click"," * @param event {Event} The event object for the click."," * @deprecated"," */"," upswf.on (\"click\", relEvent);",""," /*"," * Fires when the user has finished selecting a set of files to be uploaded."," *"," * @event fileselect"," * @param event {Event} The event object for the fileSelect."," * <dl>"," * <dt>fileList</dt>"," * <dd>The file list Object with entries in the following format: "," fileList[fileID] = {id: fileID, name: fileName, cDate: fileCDate, mDate: fileMDate, size: fileSize}</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"fileselect\", relEvent);",""," /*"," * Fired when the mouse button is pressed on the Uploader's 'Browse' button."," *"," * @event mousedown"," * @param event {Event} The event object for the mousedown."," * @deprecated"," */"," upswf.on (\"mousedown\", relEvent);",""," /*"," * Fired when the mouse button is raised on the Uploader's 'Browse' button."," *"," * @event mouseup"," * @param event {Event} The event object for the mouseup."," * @deprecated"," */"," upswf.on (\"mouseup\", relEvent);",""," /*"," * Fired when the mouse leaves the Uploader's 'Browse' button."," *"," * @event mouseleave"," * @param event {Event} The event object for the mouseleave."," * @deprecated"," */"," upswf.on (\"mouseleave\", relEvent);",""," /*"," * Fired when the mouse enters the Uploader's 'Browse' button."," *"," * @event mouseenter"," * @param event {Event} The event object for the mouseenter."," * @deprecated"," */"," upswf.on (\"mouseenter\", relEvent);",""," /*"," * Announces that the uploader is ready and available for calling methods"," * and setting properties"," *"," * @event uploadcancel"," * @param event {Event} The event object for the uploaderReady."," * <dl>"," * <dt>ddEvent</dt>"," * <dd><code>drag:start</code> event from the thumb</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadcancel\", relEvent);",""," /*"," * Fires when a specific file's upload is cancelled."," *"," * @event uploadcomplete"," * @param event {Event} The event object for the uploadcancel."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file whose upload has been cancelled.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadcomplete\", relEvent);",""," /*"," * If the server has sent a response to the file upload, this event is"," * fired and the response is added to its payload."," *"," * @event uploadcompletedata"," * @param event {Event} The event object for the uploadcompletedata."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file for which the response is being provided.</dd>"," * <dt>data</dt>"," * <dd>The content of the server response.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadcompletedata\", relEvent);",""," /*"," * Provides error information if an error has occurred during the upload."," *"," * @event uploaderror"," * @param event {Event} The event object for the uploadeerror."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file for which the upload error has occurred.</dd>"," * <dt>status</dt>"," * <dd>Relevant error information.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploaderror\", relEvent);",""," /*"," * Provides progress information on a specific file upload."," *"," * @event uploadprogress"," * @param event {Event} The event object for the uploadprogress."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file for which the progress information is being provided.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded.</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file that is being uploaded.</dd>"," * </dl>"," * @deprecated"," */"," upswf.on (\"uploadprogress\", relEvent);",""," /*"," * Announces that the upload has been started for a specific file."," *"," * @event uploadstart"," * @param event {Event} The event object for the uploadstart."," * <dl>"," * <dt>id</dt>"," * <dd>The id of the file whose upload has been started.</dd>"," * </dl>"," * @deprecated"," */ "," upswf.on (\"uploadstart\", relEvent);"," },",""," /*"," * Removes a specific file from the upload queue."," *"," * @method removeFile"," * @param fileID {String} The ID of the file to be removed"," * @return {Object} The updated file list, which is an object of the format:"," * fileList[fileID] = {id: fileID, name: fileName, cDate: fileCDate, mDate: fileMDate, size: fileSize}"," * @deprecated"," */"," removeFile : function (fileID /*String*/) {"," return this.uploaderswf.callSWF(\"removeFile\", [fileID]);"," },"," "," /*"," * Clears the upload queue."," *"," * @method clearFileList"," * @return {Boolean} This method always returns true."," * @deprecated"," */"," clearFileList : function () {"," return this.uploaderswf.callSWF(\"clearFileList\", []);"," },",""," /*"," * Starts the upload of a specific file."," *"," * @method upload"," * @param fileID {String} The ID of the file to be uploaded."," * @param url {String} The URL to upload the file to."," * @param method {String} (optional) The HTTP method to use for sending additional variables, either 'GET' or 'POST' ('GET' by default)"," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param postFileVarName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," * @return {Boolean} This method always returns true."," * @deprecated"," */"," upload : function (fileID /*String*/, url /*String*/, method /*String*/, postVars /*Object*/, postFileVarName /*String*/) {"," if (Y.Lang.isArray(fileID)) {"," return this.uploaderswf.callSWF(\"uploadThese\", [fileID, url, method, postVars, postFileVarName]);"," }"," else if (Y.Lang.isString(fileID)) {"," return this.uploaderswf.callSWF(\"upload\", [fileID, url, method, postVars, postFileVarName]);"," "," }"," },",""," /*"," * Starts the upload of a set of files, as specified in the first argument. "," * The upload queue is managed automatically."," *"," * @method uploadThese"," * @param fileIDs {Array} The array of IDs of the files to be uploaded."," * @param url {String} The URL to upload the files to."," * @param method {String} (optional) The HTTP method to use for sending additional variables, either 'GET' or 'POST' ('GET' by default)"," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param postFileVarName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)"," * @deprecated"," */"," uploadThese : function (fileIDs /*Array*/, url /*String*/, method /*String*/, postVars /*Object*/, postFileVarName /*String*/) {"," return this.uploaderswf.callSWF(\"uploadThese\", [fileIDs, url, method, postVars, postFileVarName]);"," },",""," /*"," * Starts the upload of the files in the upload queue. "," * The upload queue is managed automatically."," *"," * @method uploadAll"," * @param url {String} The URL to upload the files to."," * @param method {String} (optional) The HTTP method to use for sending additional variables, either 'GET' or 'POST' ('GET' by default)"," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * @param postFileVarName {String} (optional) The name of the POST variable that should contain the uploaded file ('Filedata' by default)."," * @deprecated"," */ "," uploadAll : function (url /*String*/, method /*String*/, postVars /*Object*/, postFileVarName /*String*/) {"," return this.uploaderswf.callSWF(\"uploadAll\", [url, method, postVars,postFileVarName]);"," },",""," /*"," * Cancels the upload of a specific file, if currently in progress."," *"," * @method cancel"," * @param fileID {String} (optional) The ID of the file whose upload should be cancelled. If no ID is specified, all uploads are cancelled."," * @deprecated"," */ "," cancel : function (fileID /*String*/) {"," return this.uploaderswf.callSWF(\"cancel\", [fileID]);"," },",""," /*"," * @private"," * Setter for the 'log' property."," * @method setAllowLogging"," * @param value {Boolean} The value for the 'log' property."," * @deprecated"," */"," setAllowLogging : function (value /*Boolean*/) {"," this.uploaderswf.callSWF(\"setAllowLogging\", [value]);"," },",""," /*"," * @private"," * Setter for the 'multiFiles' property."," * @method setAllowMultipleFiles"," * @param value {Boolean} The value for the 'multiFiles' property."," * @deprecated"," */"," setAllowMultipleFiles : function (value /*Boolean*/) {"," this.uploaderswf.callSWF(\"setAllowMultipleFiles\", [value]);"," },",""," /*"," * @private"," * Setter for the 'simLimit' property."," * @method setSimUploadLimit"," * @param value {Boolean} The value for the 'simLimit' property."," * @deprecated"," */"," setSimUploadLimit : function (value /*int*/) {"," this.uploaderswf.callSWF(\"setSimUploadLimit\", [value]);"," },",""," /*"," * @private"," * Setter for the 'fileFilters' property."," * @method setFileFilters"," * @param value {Boolean} The value for the 'fileFilters' property."," * @deprecated"," */ "," setFileFilters : function (fileFilters /*Array*/) {"," this.uploaderswf.callSWF(\"setFileFilters\", [fileFilters]);"," },",""," /*"," * Enables the uploader user input (mouse clicks on the 'Browse' button). If the button skin "," * is applied, the sprite is reset from the \"disabled\" state."," *"," * @method enable"," * @deprecated"," */ "," enable : function () {"," this.uploaderswf.callSWF(\"enable\");"," },",""," /*"," * Disables the uploader user input (mouse clicks on the 'Browse' button). If the button skin "," * is applied, the sprite is set to the 'disabled' state."," *"," * @method enable"," * @deprecated"," */ "," disable : function () {"," this.uploaderswf.callSWF(\"disable\");"," },",""," /*"," * @private"," * Called when the uploader SWF is initialized"," * @method _initializeUploader"," * @param event {Object} The event to be propagated from Flash."," * @deprecated"," */"," _initializeUploader: function (event) {"," this.publish(\"uploaderReady\", {fireOnce:true});"," this.fire(\"uploaderReady\", {});"," },",""," /*"," * @private"," * Called when an event is dispatched from Uploader"," * @method _relayEvent"," * @param event {Object} The event to be propagated from Flash."," * @deprecated"," */ "," _relayEvent: function (event) {"," this.fire(event.type, event);"," },"," "," toString: function()"," {"," return \"Uploader \" + this._id;"," }","","},","{"," ATTRS: {"," /*"," * The flag that allows Flash player to "," * output debug messages to its trace stack "," * (if the Flash debug player is used)."," *"," * @attribute log"," * @type {Boolean}"," * @default false"," * @deprecated"," */"," log: {"," value: false,"," setter : \"setAllowLogging\""," },",""," /*"," * The flag that allows the user to select"," * more than one files during the 'Browse'"," * dialog (using 'Shift' or 'Ctrl' keys)."," *"," * @attribute multiFiles"," * @type {Boolean}"," * @default false"," * @deprecated"," */"," multiFiles : {"," value: false,"," setter : \"setAllowMultipleFiles\""," },"," "," /*"," * The number of files that can be uploaded"," * simultaneously if the automatic queue management"," * is used. This value can be in the range between 2"," * and 5."," *"," * @attribute simLimit"," * @type {Number}"," * @default 2"," * @deprecated"," */"," simLimit : {"," value: 2,"," setter : \"setSimUploadLimit\""," },",""," /*"," * The array of filters on file extensions for"," * the 'Browse' dialog. These filters only provide"," * convenience for the user and do not strictly"," * limit the selection to certain file extensions."," * Each item in the array must contain a 'description'"," * property, and an 'extensions' property that must be"," * in the form \"*.ext;*.ext;*.ext;...\""," *"," * @attribute fileFilters"," * @type {Array}"," * @default []"," * @deprecated"," */"," fileFilters : {"," value: [],"," setter : \"setFileFilters\""," },"," "," /*"," * The Node containing the uploader's 'Browse' button."," *"," * @attribute boundingBox"," * @type {Node}"," * @default null"," * @writeOnce"," * @deprecated"," */"," boundingBox : {"," value: null,"," writeOnce: 'initOnly'"," },"," "," /*"," * The URL of the image sprite for skinning the uploader's 'Browse' button."," *"," * @attribute buttonSkin"," * @type {String}"," * @default null"," * @writeOnce"," * @deprecated"," */"," buttonSkin : {"," value: null,"," writeOnce: 'initOnly'"," },"," "," /*"," * The flag indicating whether the uploader is rendered "," * with a transparent background."," *"," * @attribute transparent"," * @type {Boolean}"," * @default true"," * @writeOnce"," * @deprecated"," */"," transparent : {"," value: true,"," writeOnce: 'initOnly'"," },"," "," /*"," * The URL of the uploader's SWF."," *"," * @attribute swfURL"," * @type {String}"," * @default \"assets/uploader.swf\""," * @writeOnce"," * @deprecated"," */"," swfURL : {"," value : SWFURL,"," writeOnce: 'initOnly'"," }"," "," }","}",");","Y.Uploader = Uploader;","","","}, '3.7.3' ,{requires:['swf', 'base', 'node', 'event-custom']});"]; _yuitest_coverage["/build/uploader-deprecated/uploader-deprecated.js"].lines = {"1":0,"14":0,"17":0,"52":0,"54":0,"56":0,"57":0,"58":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"72":0,"104":0,"105":0,"107":0,"111":0,"112":0,"114":0,"115":0,"118":0,"120":0,"121":0,"131":0,"140":0,"154":0,"163":0,"172":0,"181":0,"190":0,"204":0,"217":0,"233":0,"248":0,"265":0,"278":0,"291":0,"302":0,"318":0,"319":0,"321":0,"322":0,"340":0,"355":0,"366":0,"377":0,"388":0,"399":0,"410":0,"421":0,"432":0,"443":0,"444":0,"455":0,"460":0,"591":0}; _yuitest_coverage["/build/uploader-deprecated/uploader-deprecated.js"].functions = {"Uploader:52":0,"initializer:102":0,"removeFile:290":0,"clearFileList:301":0,"upload:317":0,"uploadThese:339":0,"uploadAll:354":0,"cancel:365":0,"setAllowLogging:376":0,"setAllowMultipleFiles:387":0,"setSimUploadLimit:398":0,"setFileFilters:409":0,"enable:420":0,"disable:431":0,"_initializeUploader:442":0,"_relayEvent:454":0,"toString:458":0,"(anonymous 1):1":0}; _yuitest_coverage["/build/uploader-deprecated/uploader-deprecated.js"].coveredLines = 62;@@ -710,4 +710,4 @@ Y.Uploader = Uploader; -}, '3.7.2' ,{requires:['swf', 'base', 'node', 'event-custom']});+}, '3.7.3' ,{requires:['swf', 'base', 'node', 'event-custom']});
bundle/uploader-deprecated/uploader-deprecated-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -599,4 +599,4 @@ Y.Uploader = Uploader; -}, '3.7.2' ,{requires:['swf', 'base', 'node', 'event-custom']});+}, '3.7.3' ,{requires:['swf', 'base', 'node', 'event-custom']});
bundle/uploader-deprecated/uploader-deprecated-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("uploader-deprecated",function(e){var b=e.Event,c=e.Node;var a=e.Env.cdn+"uploader-deprecated/assets/uploader.swf";function d(f){d.superclass.constructor.apply(this,arguments);if(f.hasOwnProperty("boundingBox")){this.set("boundingBox",f.boundingBox);}if(f.hasOwnProperty("buttonSkin")){this.set("buttonSkin",f.buttonSkin);}if(f.hasOwnProperty("transparent")){this.set("transparent",f.transparent);}if(f.hasOwnProperty("swfURL")){this.set("swfURL",f.swfURL);}}e.extend(d,e.Base,{uploaderswf:null,_id:"",initializer:function(){this._id=e.guid("uploader");var f=c.one(this.get("boundingBox"));var i={version:"10.0.45",fixedAttributes:{allowScriptAccess:"always",allowNetworking:"all",scale:"noscale"},flashVars:{}};if(this.get("buttonSkin")!=""){i.flashVars["buttonSkin"]=this.get("buttonSkin");}if(this.get("transparent")){i.fixedAttributes["wmode"]="transparent";}this.uploaderswf=new e.SWF(f,this.get("swfURL"),i);var h=this.uploaderswf;var g=e.bind(this._relayEvent,this);h.on("swfReady",e.bind(this._initializeUploader,this));h.on("click",g);h.on("fileselect",g);h.on("mousedown",g);h.on("mouseup",g);h.on("mouseleave",g);h.on("mouseenter",g);h.on("uploadcancel",g);h.on("uploadcomplete",g);h.on("uploadcompletedata",g);h.on("uploaderror",g);h.on("uploadprogress",g);h.on("uploadstart",g);},removeFile:function(f){return this.uploaderswf.callSWF("removeFile",[f]);},clearFileList:function(){return this.uploaderswf.callSWF("clearFileList",[]);},upload:function(f,h,j,g,i){if(e.Lang.isArray(f)){return this.uploaderswf.callSWF("uploadThese",[f,h,j,g,i]);}else{if(e.Lang.isString(f)){return this.uploaderswf.callSWF("upload",[f,h,j,g,i]);}}},uploadThese:function(h,g,j,f,i){return this.uploaderswf.callSWF("uploadThese",[h,g,j,f,i]);},uploadAll:function(g,i,f,h){return this.uploaderswf.callSWF("uploadAll",[g,i,f,h]);},cancel:function(f){return this.uploaderswf.callSWF("cancel",[f]);},setAllowLogging:function(f){this.uploaderswf.callSWF("setAllowLogging",[f]);},setAllowMultipleFiles:function(f){this.uploaderswf.callSWF("setAllowMultipleFiles",[f]);},setSimUploadLimit:function(f){this.uploaderswf.callSWF("setSimUploadLimit",[f]);},setFileFilters:function(f){this.uploaderswf.callSWF("setFileFilters",[f]);},enable:function(){this.uploaderswf.callSWF("enable");},disable:function(){this.uploaderswf.callSWF("disable");},_initializeUploader:function(f){this.publish("uploaderReady",{fireOnce:true});this.fire("uploaderReady",{});},_relayEvent:function(f){this.fire(f.type,f);},toString:function(){return"Uploader "+this._id;}},{ATTRS:{log:{value:false,setter:"setAllowLogging"},multiFiles:{value:false,setter:"setAllowMultipleFiles"},simLimit:{value:2,setter:"setSimUploadLimit"},fileFilters:{value:[],setter:"setFileFilters"},boundingBox:{value:null,writeOnce:"initOnly"},buttonSkin:{value:null,writeOnce:"initOnly"},transparent:{value:true,writeOnce:"initOnly"},swfURL:{value:a,writeOnce:"initOnly"}}});e.Uploader=d;},"3.7.2",{requires:["swf","base","node","event-custom"]});+YUI.add("uploader-deprecated",function(e){var b=e.Event,c=e.Node;var a=e.Env.cdn+"uploader-deprecated/assets/uploader.swf";function d(f){d.superclass.constructor.apply(this,arguments);if(f.hasOwnProperty("boundingBox")){this.set("boundingBox",f.boundingBox);}if(f.hasOwnProperty("buttonSkin")){this.set("buttonSkin",f.buttonSkin);}if(f.hasOwnProperty("transparent")){this.set("transparent",f.transparent);}if(f.hasOwnProperty("swfURL")){this.set("swfURL",f.swfURL);}}e.extend(d,e.Base,{uploaderswf:null,_id:"",initializer:function(){this._id=e.guid("uploader");var f=c.one(this.get("boundingBox"));var i={version:"10.0.45",fixedAttributes:{allowScriptAccess:"always",allowNetworking:"all",scale:"noscale"},flashVars:{}};if(this.get("buttonSkin")!=""){i.flashVars["buttonSkin"]=this.get("buttonSkin");}if(this.get("transparent")){i.fixedAttributes["wmode"]="transparent";}this.uploaderswf=new e.SWF(f,this.get("swfURL"),i);var h=this.uploaderswf;var g=e.bind(this._relayEvent,this);h.on("swfReady",e.bind(this._initializeUploader,this));h.on("click",g);h.on("fileselect",g);h.on("mousedown",g);h.on("mouseup",g);h.on("mouseleave",g);h.on("mouseenter",g);h.on("uploadcancel",g);h.on("uploadcomplete",g);h.on("uploadcompletedata",g);h.on("uploaderror",g);h.on("uploadprogress",g);h.on("uploadstart",g);},removeFile:function(f){return this.uploaderswf.callSWF("removeFile",[f]);},clearFileList:function(){return this.uploaderswf.callSWF("clearFileList",[]);},upload:function(f,h,j,g,i){if(e.Lang.isArray(f)){return this.uploaderswf.callSWF("uploadThese",[f,h,j,g,i]);}else{if(e.Lang.isString(f)){return this.uploaderswf.callSWF("upload",[f,h,j,g,i]);}}},uploadThese:function(h,g,j,f,i){return this.uploaderswf.callSWF("uploadThese",[h,g,j,f,i]);},uploadAll:function(g,i,f,h){return this.uploaderswf.callSWF("uploadAll",[g,i,f,h]);},cancel:function(f){return this.uploaderswf.callSWF("cancel",[f]);},setAllowLogging:function(f){this.uploaderswf.callSWF("setAllowLogging",[f]);},setAllowMultipleFiles:function(f){this.uploaderswf.callSWF("setAllowMultipleFiles",[f]);},setSimUploadLimit:function(f){this.uploaderswf.callSWF("setSimUploadLimit",[f]);},setFileFilters:function(f){this.uploaderswf.callSWF("setFileFilters",[f]);},enable:function(){this.uploaderswf.callSWF("enable");},disable:function(){this.uploaderswf.callSWF("disable");},_initializeUploader:function(f){this.publish("uploaderReady",{fireOnce:true});this.fire("uploaderReady",{});},_relayEvent:function(f){this.fire(f.type,f);},toString:function(){return"Uploader "+this._id;}},{ATTRS:{log:{value:false,setter:"setAllowLogging"},multiFiles:{value:false,setter:"setAllowMultipleFiles"},simLimit:{value:2,setter:"setSimUploadLimit"},fileFilters:{value:[],setter:"setFileFilters"},boundingBox:{value:null,writeOnce:"initOnly"},buttonSkin:{value:null,writeOnce:"initOnly"},transparent:{value:true,writeOnce:"initOnly"},swfURL:{value:a,writeOnce:"initOnly"}}});e.Uploader=d;},"3.7.3",{requires:["swf","base","node","event-custom"]});
bundle/uploader-deprecated/uploader-deprecated.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -597,4 +597,4 @@ Y.Uploader = Uploader; -}, '3.7.2' ,{requires:['swf', 'base', 'node', 'event-custom']});+}, '3.7.3' ,{requires:['swf', 'base', 'node', 'event-custom']});
bundle/uploader-flash/assets/uploader-flash-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/uploader-flash/uploader-flash-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/uploader-flash/uploader-flash.js", code: [] };-_yuitest_coverage["build/uploader-flash/uploader-flash.js"].code=["YUI.add('uploader-flash', function (Y, NAME) {","",""," /**"," * This module provides a UI for file selection and multiple file upload capability using"," * Flash as a transport engine."," * The supported features include: automatic upload queue management, upload progress"," * tracking, file filtering, server response retrieval and error reporting."," *"," * @module uploader-flash"," */ ","","// Shorthands for external modules","var substitute = Y.substitute,"," UploaderQueue = Y.Uploader.Queue,"," getCN = Y.ClassNameManager.getClassName,"," UPLOADER = 'uploader',"," SELECT_FILES = getCN(UPLOADER, 'selectfiles-button');","",""," /**"," * This module provides a UI for file selection and multiple file upload capability"," * using Flash as a transport engine."," * @class UploaderFlash"," * @extends Widget"," * @constructor"," * @param {Object} config Configuration object."," */","","function UploaderFlash(config) {"," UploaderFlash.superclass.constructor.apply ( this, arguments );","}","","","","Y.UploaderFlash = Y.extend(UploaderFlash, Y.Widget, {",""," /**"," * Stored value of the current button state (based on "," * mouse events dispatched by the Flash player)"," * @property _buttonState"," * @type {String}"," * @protected"," */"," _buttonState: \"up\",",""," /**"," * Stored value of the current button focus state (based "," * on keyboard and mouse events)."," * @property _buttonFocus"," * @type {Boolean}"," * @protected"," */"," _buttonFocus: false,",""," /**"," * Stored value of the unique id for the container that holds the "," * Flash uploader."," *"," * @property _swfContainerId"," * @type {String}"," * @protected"," */"," _swfContainerId: null,",""," /**"," * Stored reference to the instance of SWF used to host the"," * Flash uploader."," *"," * @property _swfReference"," * @type {SWF}"," * @protected"," */"," _swfReference: null,",""," /**"," * Stored reference to the instance of Uploader.Queue used to manage"," * the upload process. This is a read-only property that only exists"," * during an active upload process. Only one queue can be active at"," * a time; if an upload start is attempted while a queue is active,"," * it will be ignored."," *"," * @property queue"," * @type {Y.Uploader.Queue}"," */"," queue: null,",""," /**"," * Stored event bindings for keyboard navigation to and from the uploader."," *"," * @property _tabElementBindings"," * @type {Object}"," * @protected"," */"," _tabElementBindings: null,","","","/**"," * Construction logic executed during UploaderFlash instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {",""," // Assign protected variable values"," this._swfContainerId = Y.guid(\"uploader\");"," this._swfReference = null;"," this.queue = null;"," this._buttonState = \"up\";"," this._buttonFocus = null;"," this._tabElementBindings = null;"," this._fileList = [];",""," // Publish available events",""," /**"," * Signals that files have been selected. "," *"," * @event fileselect"," * @param event {Event} The event object for the `fileselect` with the"," * following payload:"," * <dl>"," * <dt>fileList</dt>"," * <dd>An `Array` of files selected by the user, encapsulated"," * in Y.FileFlash objects.</dd>"," * </dl>"," */"," this.publish(\"fileselect\");",""," /**"," * Signals that an upload of multiple files has been started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart`."," */"," this.publish(\"uploadstart\");",""," /**"," * Signals that an upload of a specific file has started. "," *"," * @event fileuploadstart"," * @param event {Event} The event object for the `fileuploadstart` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>A reference to the Y.File that dispatched the event.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by Y.File.</dd>"," * </dl>"," */"," this.publish(\"fileuploadstart\");",""," /**"," * Reports on upload progress of a specific file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by the SWF uploader</dd>"," * </dl>"," */"," this.publish(\"uploadprogress\");",""," /**"," * Reports on the total upload progress of the file list. "," *"," * @event totaluploadprogress"," * @param event {Event} The event object for the `totaluploadprogress` with the"," * following payload:"," * <dl>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file list that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file list</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file list that has been uploaded, out of 100</dd>"," * </dl>"," */"," this.publish(\"totaluploadprogress\");",""," /**"," * Signals that a single file upload has been completed. "," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>The pointer to the instance of `Y.File` whose upload has been completed.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the SWF Uploader</dd>"," * <dt>data</dt>"," * <dd>Data returned by the server.</dd>"," * </dl>"," */"," this.publish(\"uploadcomplete\");",""," /**"," * Signals that the upload process of the entire file list has been completed. "," *"," * @event alluploadscomplete"," * @param event {Event} The event object for the `alluploadscomplete`."," */"," this.publish(\"alluploadscomplete\");",""," /**"," * Signals that a error has occurred in a specific file's upload process. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original error event fired by the SWF Uploader. </dd>"," * <dt>file</dt>"," * <dd>The pointer at the instance of Y.FileFlash that returned the error.</dd>"," * <dt>source</dt>"," * <dd>The source of the upload error, either \"io\" or \"http\"</dd> "," * <dt>message</dt>"," * <dd>The message that accompanied the error. Corresponds to the text of"," * the error in cases where source is \"io\", and to the HTTP status for"," cases where source is \"http\".</dd> "," * </dl>"," */"," this.publish(\"uploaderror\");",""," /**"," * Signals that a mouse has begun hovering over the `Select Files` button. "," *"," * @event mouseenter"," * @param event {Event} The event object for the `mouseenter` event."," */"," this.publish(\"mouseenter\");",""," /**"," * Signals that a mouse has stopped hovering over the `Select Files` button. "," *"," * @event mouseleave"," * @param event {Event} The event object for the `mouseleave` event."," */"," this.publish(\"mouseleave\");",""," /**"," * Signals that a mouse button has been pressed over the `Select Files` button. "," *"," * @event mousedown"," * @param event {Event} The event object for the `mousedown` event."," */"," this.publish(\"mousedown\");",""," /**"," * Signals that a mouse button has been released over the `Select Files` button. "," *"," * @event mouseup"," * @param event {Event} The event object for the `mouseup` event."," */"," this.publish(\"mouseup\");",""," /**"," * Signals that a mouse has been clicked over the `Select Files` button. "," *"," * @event click"," * @param event {Event} The event object for the `click` event."," */"," this.publish(\"click\");"," },",""," /**"," * Creates the DOM structure for the UploaderFlash."," * UploaderFlash's DOM structure consists of two layers: the base \"Select Files\""," * button that can be replaced by the developer's widget of choice; and a transparent"," * Flash overlay positoned above the button that captures all input events."," * The `position` style attribute of the `boundingBox` of the `Uploader` widget"," * is forced to be `relative`, in order to accommodate the Flash player overlay"," * (which is `position`ed `absolute`ly)."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var boundingBox = this.get(\"boundingBox\"),"," contentBox = this.get('contentBox'),"," selFilesButton = this.get(\"selectFilesButton\");"," "," boundingBox.setStyle(\"position\", \"relative\");"," selFilesButton.setStyles({width: \"100%\", height: \"100%\"});"," contentBox.append(selFilesButton);"," contentBox.append(Y.Node.create(substitute(UploaderFlash.FLASH_CONTAINER, "," {swfContainerId: this._swfContainerId})));"," var flashContainer = Y.one(\"#\" + this._swfContainerId);"," var params = {version: \"10.0.45\","," fixedAttributes: {wmode: \"transparent\", "," allowScriptAccess:\"always\", "," allowNetworking:\"all\", "," scale: \"noscale\""," }"," };"," this._swfReference = new Y.SWF(flashContainer, this.get(\"swfURL\"), params);"," },",""," /**"," * Binds handlers to the UploaderFlash UI events and propagates attribute"," * values to the Flash player."," * The propagation of initial values is set to occur once the Flash player "," * instance is ready (as indicated by the `swfReady` event.)"," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {",""," this._swfReference.on(\"swfReady\", function () {"," this._setMultipleFiles();"," this._setFileFilters();"," this._triggerEnabled();"," this._attachTabElements();"," this.after(\"multipleFilesChange\", this._setMultipleFiles, this);"," this.after(\"fileFiltersChange\", this._setFileFilters, this);"," this.after(\"enabledChange\", this._triggerEnabled, this);"," this.after(\"tabElementsChange\", this._attachTabElements);"," }, this);"," "," this._swfReference.on(\"fileselect\", this._updateFileList, this);","","",""," // this._swfReference.on(\"trace\", function (ev) {console.log(ev.message);});",""," this._swfReference.on(\"mouseenter\", function () {"," this.fire(\"mouseenter\");"," this._setButtonClass(\"hover\", true);"," if (this._buttonState == \"down\") {"," this._setButtonClass(\"active\", true);"," }"," }, this);"," this._swfReference.on(\"mouseleave\", function () {"," this.fire(\"mouseleave\");"," this._setButtonClass(\"hover\", false);"," this._setButtonClass(\"active\", false);"," "," }, this);"," this._swfReference.on(\"mousedown\", function () {"," this.fire(\"mousedown\");"," this._buttonState = \"down\";"," this._setButtonClass(\"active\", true);"," }, this);"," this._swfReference.on(\"mouseup\", function () {"," this.fire(\"mouseup\");"," this._buttonState = \"up\";"," this._setButtonClass(\"active\", false);"," }, this);"," this._swfReference.on(\"click\", function () {"," this.fire(\"click\");"," this._buttonFocus = true;"," this._setButtonClass(\"focus\", true);"," Y.one(\"body\").focus();"," this._swfReference._swf.focus();"," }, this);"," },",""," /**"," * Attaches keyboard bindings to enabling tabbing to and from the instance of the Flash"," * player in the Uploader widget. If the previous and next elements are specified, the"," * keyboard bindings enable the user to tab from the `tabElements[\"from\"]` node to the "," * Flash-powered \"Select Files\" button, and to the `tabElements[\"to\"]` node. "," *"," * @method _attachTabElements"," * @protected"," * @param ev {Event} Optional event payload if called as a `tabElementsChange` handler."," */"," _attachTabElements : function (ev) {"," if (this.get(\"tabElements\") !== null && this.get(\"tabElements\").from !== null && this.get(\"tabElements\").to !== null) {",""," if (this._tabElementBindings !== null) {"," this._tabElementBindings.from.detach();"," this._tabElementBindings.to.detach();"," this._tabElementBindings.tabback.detach();"," this._tabElementBindings.tabforward.detach();"," this._tabElementBindings.focus.detach();"," this._tabElementBindings.blur.detach();"," }"," else {"," this._tabElementBindings = {};"," }",""," var fromElement = Y.one(this.get(\"tabElements\").from);"," var toElement = Y.one(this.get(\"tabElements\").to);","",""," this._tabElementBindings.from = fromElement.on(\"keydown\", function (ev) { "," if (ev.keyCode == 9 && !ev.shiftKey) {"," ev.preventDefault();"," this._swfReference._swf.setAttribute(\"tabindex\", 0); "," this._swfReference._swf.setAttribute(\"role\", \"button\");"," this._swfReference._swf.setAttribute(\"aria-label\", this.get(\"selectButtonLabel\"));"," this._swfReference._swf.focus();"," }"," }, this);"," this._tabElementBindings.to = toElement.on(\"keydown\", function (ev) { "," if (ev.keyCode == 9 && ev.shiftKey) {"," ev.preventDefault();"," this._swfReference._swf.setAttribute(\"tabindex\", 0); "," this._swfReference._swf.setAttribute(\"role\", \"button\");"," this._swfReference._swf.setAttribute(\"aria-label\", this.get(\"selectButtonLabel\"));"," this._swfReference._swf.focus();"," }"," }, this);"," this._tabElementBindings.tabback = this._swfReference.on(\"tabback\", function (ev) {this._swfReference._swf.blur(); setTimeout(function () {fromElement.focus();}, 30);}, this);"," this._tabElementBindings.tabforward = this._swfReference.on(\"tabforward\", function (ev) {this._swfReference._swf.blur(); setTimeout(function () {toElement.focus();}, 30);}, this);",""," this._tabElementBindings.focus = this._swfReference._swf.on(\"focus\", function (ev) {this._buttonFocus = true; this._setButtonClass(\"focus\", true);}, this);"," this._tabElementBindings.blur = this._swfReference._swf.on(\"blur\", function (ev) {this._buttonFocus = false; this._setButtonClass(\"focus\", false);}, this);"," }"," else if (this._tabElementBindings !== null) {"," this._tabElementBindings.from.detach();"," this._tabElementBindings.to.detach();"," this._tabElementBindings.tabback.detach();"," this._tabElementBindings.tabforward.detach();"," this._tabElementBindings.focus.detach();"," this._tabElementBindings.blur.detach();"," }"," },","",""," /**"," * Adds or removes a specified state CSS class to the underlying uploader button. "," *"," * @method _setButtonClass"," * @protected"," * @param state {String} The name of the state enumerated in `buttonClassNames` attribute"," * from which to derive the needed class name."," * @param add {Boolean} A Boolean indicating whether to add or remove the class."," */"," _setButtonClass : function (state, add) {"," if (add) {"," this.get(\"selectFilesButton\").addClass(this.get(\"buttonClassNames\")[state]);"," }"," else {"," this.get(\"selectFilesButton\").removeClass(this.get(\"buttonClassNames\")[state]);"," }"," },","",""," /**"," * Syncs the state of the `fileFilters` attribute between the instance of UploaderFlash"," * and the Flash player."," * "," * @method _setFileFilters"," * @private"," */"," _setFileFilters : function () {"," if (this._swfReference && this.get(\"fileFilters\").length > 0) {"," this._swfReference.callSWF(\"setFileFilters\", [this.get(\"fileFilters\")]);"," } ",""," },","","",""," /**"," * Syncs the state of the `multipleFiles` attribute between this class"," * and the Flash uploader."," * "," * @method _setMultipleFiles"," * @private"," */"," _setMultipleFiles : function () {"," if (this._swfReference) {"," this._swfReference.callSWF(\"setAllowMultipleFiles\", [this.get(\"multipleFiles\")]);"," }"," },",""," /**"," * Syncs the state of the `enabled` attribute between this class"," * and the Flash uploader."," * "," * @method _triggerEnabled"," * @private"," */"," _triggerEnabled : function () {"," if (this.get(\"enabled\")) {"," this._swfReference.callSWF(\"enable\");"," this._swfReference._swf.setAttribute(\"aria-disabled\", \"false\");"," this._setButtonClass(\"disabled\", false);"," }"," else {"," this._swfReference.callSWF(\"disable\");"," this._swfReference._swf.setAttribute(\"aria-disabled\", \"true\");"," this._setButtonClass(\"disabled\", true);"," }"," },",""," /**"," * Getter for the `fileList` attribute"," * "," * @method _getFileList"," * @private"," */"," _getFileList : function (arr) {"," return this._fileList.concat();"," },",""," /**"," * Setter for the `fileList` attribute"," * "," * @method _setFileList"," * @private"," */"," _setFileList : function (val) {"," this._fileList = val.concat();"," return this._fileList.concat();"," },",""," /**"," * Adjusts the content of the `fileList` based on the results of file selection"," * and the `appendNewFiles` attribute. If the `appendNewFiles` attribute is true,"," * then selected files are appended to the existing list; otherwise, the list is"," * cleared and populated with the newly selected files."," * "," * @method _updateFileList"," * @param ev {Event} The file selection event received from the uploader."," * @private"," */"," _updateFileList : function (ev) {"," "," Y.one(\"body\").focus();"," this._swfReference._swf.focus();","",""," var newfiles = ev.fileList,"," fileConfObjects = [],"," parsedFiles = [],"," swfRef = this._swfReference,"," filterFunc = this.get(\"fileFilterFunction\");"," "," Y.each(newfiles, function (value) {"," var newFileConf = {};"," newFileConf.id = value.fileId;"," newFileConf.name = value.fileReference.name;"," newFileConf.size = value.fileReference.size;"," newFileConf.type = value.fileReference.type;"," newFileConf.dateCreated = value.fileReference.creationDate;"," newFileConf.dateModified = value.fileReference.modificationDate;"," newFileConf.uploader = swfRef;",""," fileConfObjects.push(newFileConf);"," });",""," if (filterFunc) {"," Y.each(fileConfObjects, function (value) {"," var newfile = new Y.FileFlash(value);"," if (filterFunc(newfile)) {"," parsedFiles.push(newfile);"," }"," });"," }"," else {"," Y.each(fileConfObjects, function (value) {"," parsedFiles.push(new Y.FileFlash(value));"," });"," }",""," if (parsedFiles.length > 0) {"," var oldfiles = this.get(\"fileList\");",""," this.set(\"fileList\", "," this.get(\"appendNewFiles\") ? oldfiles.concat(parsedFiles) : parsedFiles );",""," this.fire(\"fileselect\", {fileList: parsedFiles});"," }",""," },","","",""," /**"," * Handles and retransmits events fired by `Y.FileFlash` and `Y.Uploader.Queue`."," * "," * @method _uploadEventHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadEventHandler : function (event) {"," "," switch (event.type) {"," case \"file:uploadstart\":"," this.fire(\"fileuploadstart\", event);"," break;"," case \"file:uploadprogress\":"," this.fire(\"uploadprogress\", event);"," break;"," case \"uploaderqueue:totaluploadprogress\":"," this.fire(\"totaluploadprogress\", event);"," break;"," case \"file:uploadcomplete\":"," this.fire(\"uploadcomplete\", event);"," break;"," case \"uploaderqueue:alluploadscomplete\":"," this.queue = null;"," this.fire(\"alluploadscomplete\", event);"," break;"," case \"file:uploaderror\":"," case \"uploaderqueue:uploaderror\":"," this.fire(\"uploaderror\", event);"," break;"," case \"file:uploadcancel\":"," case \"uploaderqueue:uploadcancel\":"," this.fire(\"uploadcancel\", event);"," break;"," } ",""," },","","",""," /**"," * Starts the upload of a specific file."," *"," * @method upload"," * @param file {Y.FileFlash} Reference to the instance of the file to be uploaded."," * @param url {String} The URL to upload the file to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */",""," upload : function (file, url, postvars) {"," "," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\"),"," fileId = file.get(\"id\");",""," postVars = postVars.hasOwnProperty(fileId) ? postVars[fileId] : postVars;",""," if (file instanceof Y.FileFlash) {"," "," file.on(\"uploadstart\", this._uploadEventHandler, this);"," file.on(\"uploadprogress\", this._uploadEventHandler, this);"," file.on(\"uploadcomplete\", this._uploadEventHandler, this);"," file.on(\"uploaderror\", this._uploadEventHandler, this);"," file.on(\"uploadcancel\", this._uploadEventHandler, this);",""," file.startUpload(uploadURL, postVars, this.get(\"fileFieldName\"));"," }"," },",""," /**"," * Starts the upload of all files on the file list, using an automated queue."," *"," * @method uploadAll"," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadAll : function (url, postvars) {"," this.uploadThese(this.get(\"fileList\"), url, postvars);"," },",""," /**"," * Starts the upload of the files specified in the first argument, using an automated queue."," *"," * @method uploadThese"," * @param files {Array} The list of files to upload."," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadThese : function (files, url, postvars) {"," if (!this.queue) {"," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\");",""," this.queue = new UploaderQueue({simUploads: this.get(\"simLimit\"), "," errorAction: this.get(\"errorAction\"),"," fileFieldName: this.get(\"fileFieldName\"),"," fileList: files,"," uploadURL: uploadURL,"," perFileParameters: postVars,"," retryCount: this.get(\"retryCount\")"," });"," this.queue.on(\"uploadstart\", this._uploadEventHandler, this);"," this.queue.on(\"uploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"totaluploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"uploadcomplete\", this._uploadEventHandler, this);"," this.queue.on(\"alluploadscomplete\", this._uploadEventHandler, this);"," this.queue.on(\"alluploadscancelled\", function (ev) {this.queue = null;}, this);"," this.queue.on(\"uploaderror\", this._uploadEventHandler, this);"," this.queue.startUpload(); "," "," this.fire(\"uploadstart\"); "," }"," }","},","","{"," /**"," * The template for the Flash player container. Since the Flash player container needs"," * to completely overlay the &lquot;Select Files&rqot; control, it's positioned absolutely,"," * with width and height set to 100% of the parent."," *"," * @property FLASH_CONTAINER"," * @type {String}"," * @static"," * @default \"<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin: 0; padding: 0; border: 0; width:100%; height:100%'></div>\""," */"," FLASH_CONTAINER: \"<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin: 0; padding: 0; border: 0; width:100%; height:100%'></div>\",",""," /**"," * The template for the \"Select Files\" button."," *"," * @property SELECT_FILES_BUTTON"," * @type {String}"," * @static"," * @default \"<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>\""," */"," SELECT_FILES_BUTTON: \"<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>\",",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The UploaderFlash value is `\"flash\"`."," * "," * @property TYPE"," * @type {String}"," * @static"," */"," TYPE: \"flash\",",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'uploader'"," * @readOnly"," * @protected"," * @static"," */"," NAME: \"uploader\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A Boolean indicating whether newly selected files should be appended "," * to the existing file list, or whether they should replace it."," *"," * @attribute appendNewFiles"," * @type {Boolean}"," * @default true"," */"," appendNewFiles : {"," value: true"," },",""," /**"," * The names of CSS classes that correspond to different button states"," * of the \"Select Files\" control. These classes are assigned to the "," * \"Select Files\" control based on the mouse states reported by the"," * Flash player. The keys for the class names are:"," * <ul>"," * <li> <strong>`hover`</strong>: the class corresponding to mouse hovering over"," * the \"Select Files\" button.</li>"," * <li> <strong>`active`</strong>: the class corresponding to mouse down state of"," * the \"Select Files\" button.</li>"," * <li> <strong>`disabled`</strong>: the class corresponding to the disabled state"," * of the \"Select Files\" button.</li>"," * <li> <strong>`focus`</strong>: the class corresponding to the focused state of"," * the \"Select Files\" button.</li>"," * </ul>"," * @attribute buttonClassNames"," * @type {Object}"," * @default { hover: \"yui3-button-hover\","," * active: \"yui3-button-active\","," * disabled: \"yui3-button-disabled\","," * focus: \"yui3-button-selected\""," * }"," */"," buttonClassNames: {"," value: {"," \"hover\": \"yui3-button-hover\","," \"active\": \"yui3-button-active\","," \"disabled\": \"yui3-button-disabled\","," \"focus\": \"yui3-button-selected\""," }"," },",""," /**"," * A Boolean indicating whether the uploader is enabled or disabled for user input."," *"," * @attribute enabled"," * @type {Boolean}"," * @default true"," */"," enabled : {"," value: true"," },",""," /**"," * The action performed when an upload error occurs for a specific file being uploaded."," * The possible values are: "," * <ul>"," * <li> <strong>`UploaderQueue.CONTINUE`</strong>: the error is ignored and the upload process is continued.</li>"," * <li> <strong>`UploaderQueue.STOP`</strong>: the upload process is stopped as soon as any other parallel file"," * uploads are finished.</li>"," * <li> <strong>`UploaderQueue.RESTART_ASAP`</strong>: the file is added back to the front of the queue.</li>"," * <li> <strong>`UploaderQueue.RESTART_AFTER`</strong>: the file is added to the back of the queue.</li>"," * </ul>"," * @attribute errorAction"," * @type {String}"," * @default UploaderQueue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val, name) {"," return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER); "," }"," },",""," /**"," * An array indicating what fileFilters should be applied to the file"," * selection dialog. Each element in the array should be an object with"," * the following key-value pairs:"," * {"," * description : String "," extensions: String of the form &lquot;*.ext1;*.ext2;*.ext3;...&rquot;"," * }"," * @attribute fileFilters"," * @type {Array}"," * @default []"," */"," fileFilters: {"," value: []"," },",""," /**"," * A filtering function that is applied to every file selected by the user."," * The function receives the `Y.File` object and must return a Boolean value."," * If a `false` value is returned, the file in question is not added to the"," * list of files to be uploaded."," * Use this function to put limits on file sizes or check the file names for"," * correct extension, but make sure that a server-side check is also performed,"," * since any client-side restrictions are only advisory and can be circumvented."," *"," * @attribute fileFilterFunction"," * @type {Function}"," * @default null"," */"," fileFilterFunction: {"," value: null"," },"," "," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */"," fileFieldName: {"," value: \"Filedata\""," },",""," /**"," * The array of files to be uploaded. All elements in the array"," * must be instances of `Y.FileFlash` and be instantiated with a `fileId`"," * retrieved from an instance of the uploader."," *"," * @attribute fileList"," * @type {Array}"," * @default []"," */"," fileList: {"," value: [],"," getter: \"_getFileList\","," setter: \"_setFileList\""," },",""," /**"," * A Boolean indicating whether multiple file selection is enabled."," *"," * @attribute multipleFiles"," * @type {Boolean}"," * @default false"," */"," multipleFiles: {"," value: false"," },",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file. This attribute is only used if no POST variables are specifed"," * in the upload method call."," *"," * @attribute postVarsPerFile"," * @type {Object}"," * @default {}"," */"," postVarsPerFile: {"," value: {}"," },",""," /**"," * The label for the \"Select Files\" widget. This is the value that replaces the"," * `{selectButtonLabel}` token in the `SELECT_FILES_BUTTON` template."," * "," * @attribute selectButtonLabel"," * @type {String}"," * @default \"Select Files\""," */"," selectButtonLabel: {"," value: \"Select Files\""," },",""," /**"," * The widget that serves as the \"Select Files\" control for the file uploader"," * "," *"," * @attribute selectFilesButton"," * @type {Node | Widget}"," * @default A standard HTML button with YUI CSS Button skin."," */"," selectFilesButton : {"," valueFn: function () {"," return Y.Node.create(substitute(Y.UploaderFlash.SELECT_FILES_BUTTON, {selectButtonLabel: this.get(\"selectButtonLabel\")}));"," }"," },"," "," /**"," * The number of files that can be uploaded"," * simultaneously if the automatic queue management"," * is used. This value can be in the range between 2"," * and 5."," *"," * @attribute simLimit"," * @type {Number}"," * @default 2"," */"," simLimit: {"," value: 2,"," validator: function (val, name) {"," return (val >= 2 && val <= 5);"," }"," },",""," /**"," * The URL to the SWF file of the flash uploader. A copy local to"," * the server that hosts the page on which the uploader appears is"," * recommended."," *"," * @attribute swfURL"," * @type {String}"," * @default \"CDN Prefix + uploader/assets/flashuploader.swf\" with a "," * random GET parameter for IE (to prevent buggy behavior when the SWF "," * is cached)."," */"," swfURL: {"," valueFn: function () {"," var prefix = Y.Env.cdn + \"uploader/assets/flashuploader.swf\";",""," if (Y.UA.ie > 0) {"," return (prefix + \"?t=\" + Y.guid(\"uploader\"));"," }"," return prefix;"," }"," },",""," /**"," * The id's or `Node` references of the DOM elements that precede"," * and follow the `Select Files` button in the tab order. Specifying"," * these allows keyboard navigation to and from the Flash player"," * layer of the uploader."," * The two keys corresponding to the DOM elements are:"," <ul>"," * <li> `from`: the id or the `Node` reference corresponding to the"," * DOM element that precedes the `Select Files` button in the tab order.</li>"," * <li> `to`: the id or the `Node` reference corresponding to the"," * DOM element that follows the `Select Files` button in the tab order.</li>"," * </ul>"," * @attribute tabElements"," * @type {Object}"," * @default null"," */"," tabElements: {"," value: null"," },",""," /**"," * The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */"," uploadURL: {"," value: \"\""," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */ "," retryCount: {"," value: 3"," }"," }","});","","Y.UploaderFlash.Queue = UploaderQueue;","","","","","}, '3.7.2', {\"requires\": [\"swf\", \"widget\", \"substitute\", \"base\", \"cssbutton\", \"node\", \"event-custom\", \"file-flash\", \"uploader-queue\"]});"];+_yuitest_coverage["build/uploader-flash/uploader-flash.js"].code=["YUI.add('uploader-flash', function (Y, NAME) {","",""," /**"," * This module provides a UI for file selection and multiple file upload capability using"," * Flash as a transport engine."," * The supported features include: automatic upload queue management, upload progress"," * tracking, file filtering, server response retrieval and error reporting."," *"," * @module uploader-flash"," */ ","","// Shorthands for external modules","var substitute = Y.substitute,"," UploaderQueue = Y.Uploader.Queue,"," getCN = Y.ClassNameManager.getClassName,"," UPLOADER = 'uploader',"," SELECT_FILES = getCN(UPLOADER, 'selectfiles-button');","",""," /**"," * This module provides a UI for file selection and multiple file upload capability"," * using Flash as a transport engine."," * @class UploaderFlash"," * @extends Widget"," * @constructor"," * @param {Object} config Configuration object."," */","","function UploaderFlash(config) {"," UploaderFlash.superclass.constructor.apply ( this, arguments );","}","","","","Y.UploaderFlash = Y.extend(UploaderFlash, Y.Widget, {",""," /**"," * Stored value of the current button state (based on "," * mouse events dispatched by the Flash player)"," * @property _buttonState"," * @type {String}"," * @protected"," */"," _buttonState: \"up\",",""," /**"," * Stored value of the current button focus state (based "," * on keyboard and mouse events)."," * @property _buttonFocus"," * @type {Boolean}"," * @protected"," */"," _buttonFocus: false,",""," /**"," * Stored value of the unique id for the container that holds the "," * Flash uploader."," *"," * @property _swfContainerId"," * @type {String}"," * @protected"," */"," _swfContainerId: null,",""," /**"," * Stored reference to the instance of SWF used to host the"," * Flash uploader."," *"," * @property _swfReference"," * @type {SWF}"," * @protected"," */"," _swfReference: null,",""," /**"," * Stored reference to the instance of Uploader.Queue used to manage"," * the upload process. This is a read-only property that only exists"," * during an active upload process. Only one queue can be active at"," * a time; if an upload start is attempted while a queue is active,"," * it will be ignored."," *"," * @property queue"," * @type {Y.Uploader.Queue}"," */"," queue: null,",""," /**"," * Stored event bindings for keyboard navigation to and from the uploader."," *"," * @property _tabElementBindings"," * @type {Object}"," * @protected"," */"," _tabElementBindings: null,","","","/**"," * Construction logic executed during UploaderFlash instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {",""," // Assign protected variable values"," this._swfContainerId = Y.guid(\"uploader\");"," this._swfReference = null;"," this.queue = null;"," this._buttonState = \"up\";"," this._buttonFocus = null;"," this._tabElementBindings = null;"," this._fileList = [];",""," // Publish available events",""," /**"," * Signals that files have been selected. "," *"," * @event fileselect"," * @param event {Event} The event object for the `fileselect` with the"," * following payload:"," * <dl>"," * <dt>fileList</dt>"," * <dd>An `Array` of files selected by the user, encapsulated"," * in Y.FileFlash objects.</dd>"," * </dl>"," */"," this.publish(\"fileselect\");",""," /**"," * Signals that an upload of multiple files has been started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart`."," */"," this.publish(\"uploadstart\");",""," /**"," * Signals that an upload of a specific file has started. "," *"," * @event fileuploadstart"," * @param event {Event} The event object for the `fileuploadstart` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>A reference to the Y.File that dispatched the event.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by Y.File.</dd>"," * </dl>"," */"," this.publish(\"fileuploadstart\");",""," /**"," * Reports on upload progress of a specific file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by the SWF uploader</dd>"," * </dl>"," */"," this.publish(\"uploadprogress\");",""," /**"," * Reports on the total upload progress of the file list. "," *"," * @event totaluploadprogress"," * @param event {Event} The event object for the `totaluploadprogress` with the"," * following payload:"," * <dl>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file list that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file list</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file list that has been uploaded, out of 100</dd>"," * </dl>"," */"," this.publish(\"totaluploadprogress\");",""," /**"," * Signals that a single file upload has been completed. "," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>The pointer to the instance of `Y.File` whose upload has been completed.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the SWF Uploader</dd>"," * <dt>data</dt>"," * <dd>Data returned by the server.</dd>"," * </dl>"," */"," this.publish(\"uploadcomplete\");",""," /**"," * Signals that the upload process of the entire file list has been completed. "," *"," * @event alluploadscomplete"," * @param event {Event} The event object for the `alluploadscomplete`."," */"," this.publish(\"alluploadscomplete\");",""," /**"," * Signals that a error has occurred in a specific file's upload process. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original error event fired by the SWF Uploader. </dd>"," * <dt>file</dt>"," * <dd>The pointer at the instance of Y.FileFlash that returned the error.</dd>"," * <dt>source</dt>"," * <dd>The source of the upload error, either \"io\" or \"http\"</dd> "," * <dt>message</dt>"," * <dd>The message that accompanied the error. Corresponds to the text of"," * the error in cases where source is \"io\", and to the HTTP status for"," cases where source is \"http\".</dd> "," * </dl>"," */"," this.publish(\"uploaderror\");",""," /**"," * Signals that a mouse has begun hovering over the `Select Files` button. "," *"," * @event mouseenter"," * @param event {Event} The event object for the `mouseenter` event."," */"," this.publish(\"mouseenter\");",""," /**"," * Signals that a mouse has stopped hovering over the `Select Files` button. "," *"," * @event mouseleave"," * @param event {Event} The event object for the `mouseleave` event."," */"," this.publish(\"mouseleave\");",""," /**"," * Signals that a mouse button has been pressed over the `Select Files` button. "," *"," * @event mousedown"," * @param event {Event} The event object for the `mousedown` event."," */"," this.publish(\"mousedown\");",""," /**"," * Signals that a mouse button has been released over the `Select Files` button. "," *"," * @event mouseup"," * @param event {Event} The event object for the `mouseup` event."," */"," this.publish(\"mouseup\");",""," /**"," * Signals that a mouse has been clicked over the `Select Files` button. "," *"," * @event click"," * @param event {Event} The event object for the `click` event."," */"," this.publish(\"click\");"," },",""," /**"," * Creates the DOM structure for the UploaderFlash."," * UploaderFlash's DOM structure consists of two layers: the base \"Select Files\""," * button that can be replaced by the developer's widget of choice; and a transparent"," * Flash overlay positoned above the button that captures all input events."," * The `position` style attribute of the `boundingBox` of the `Uploader` widget"," * is forced to be `relative`, in order to accommodate the Flash player overlay"," * (which is `position`ed `absolute`ly)."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var boundingBox = this.get(\"boundingBox\"),"," contentBox = this.get('contentBox'),"," selFilesButton = this.get(\"selectFilesButton\");"," "," boundingBox.setStyle(\"position\", \"relative\");"," selFilesButton.setStyles({width: \"100%\", height: \"100%\"});"," contentBox.append(selFilesButton);"," contentBox.append(Y.Node.create(substitute(UploaderFlash.FLASH_CONTAINER, "," {swfContainerId: this._swfContainerId})));"," var flashContainer = Y.one(\"#\" + this._swfContainerId);"," var params = {version: \"10.0.45\","," fixedAttributes: {wmode: \"transparent\", "," allowScriptAccess:\"always\", "," allowNetworking:\"all\", "," scale: \"noscale\""," }"," };"," this._swfReference = new Y.SWF(flashContainer, this.get(\"swfURL\"), params);"," },",""," /**"," * Binds handlers to the UploaderFlash UI events and propagates attribute"," * values to the Flash player."," * The propagation of initial values is set to occur once the Flash player "," * instance is ready (as indicated by the `swfReady` event.)"," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {",""," this._swfReference.on(\"swfReady\", function () {"," this._setMultipleFiles();"," this._setFileFilters();"," this._triggerEnabled();"," this._attachTabElements();"," this.after(\"multipleFilesChange\", this._setMultipleFiles, this);"," this.after(\"fileFiltersChange\", this._setFileFilters, this);"," this.after(\"enabledChange\", this._triggerEnabled, this);"," this.after(\"tabElementsChange\", this._attachTabElements);"," }, this);"," "," this._swfReference.on(\"fileselect\", this._updateFileList, this);","","",""," // this._swfReference.on(\"trace\", function (ev) {console.log(ev.message);});",""," this._swfReference.on(\"mouseenter\", function () {"," this.fire(\"mouseenter\");"," this._setButtonClass(\"hover\", true);"," if (this._buttonState == \"down\") {"," this._setButtonClass(\"active\", true);"," }"," }, this);"," this._swfReference.on(\"mouseleave\", function () {"," this.fire(\"mouseleave\");"," this._setButtonClass(\"hover\", false);"," this._setButtonClass(\"active\", false);"," "," }, this);"," this._swfReference.on(\"mousedown\", function () {"," this.fire(\"mousedown\");"," this._buttonState = \"down\";"," this._setButtonClass(\"active\", true);"," }, this);"," this._swfReference.on(\"mouseup\", function () {"," this.fire(\"mouseup\");"," this._buttonState = \"up\";"," this._setButtonClass(\"active\", false);"," }, this);"," this._swfReference.on(\"click\", function () {"," this.fire(\"click\");"," this._buttonFocus = true;"," this._setButtonClass(\"focus\", true);"," Y.one(\"body\").focus();"," this._swfReference._swf.focus();"," }, this);"," },",""," /**"," * Attaches keyboard bindings to enabling tabbing to and from the instance of the Flash"," * player in the Uploader widget. If the previous and next elements are specified, the"," * keyboard bindings enable the user to tab from the `tabElements[\"from\"]` node to the "," * Flash-powered \"Select Files\" button, and to the `tabElements[\"to\"]` node. "," *"," * @method _attachTabElements"," * @protected"," * @param ev {Event} Optional event payload if called as a `tabElementsChange` handler."," */"," _attachTabElements : function (ev) {"," if (this.get(\"tabElements\") !== null && this.get(\"tabElements\").from !== null && this.get(\"tabElements\").to !== null) {",""," if (this._tabElementBindings !== null) {"," this._tabElementBindings.from.detach();"," this._tabElementBindings.to.detach();"," this._tabElementBindings.tabback.detach();"," this._tabElementBindings.tabforward.detach();"," this._tabElementBindings.focus.detach();"," this._tabElementBindings.blur.detach();"," }"," else {"," this._tabElementBindings = {};"," }",""," var fromElement = Y.one(this.get(\"tabElements\").from);"," var toElement = Y.one(this.get(\"tabElements\").to);","",""," this._tabElementBindings.from = fromElement.on(\"keydown\", function (ev) { "," if (ev.keyCode == 9 && !ev.shiftKey) {"," ev.preventDefault();"," this._swfReference._swf.setAttribute(\"tabindex\", 0); "," this._swfReference._swf.setAttribute(\"role\", \"button\");"," this._swfReference._swf.setAttribute(\"aria-label\", this.get(\"selectButtonLabel\"));"," this._swfReference._swf.focus();"," }"," }, this);"," this._tabElementBindings.to = toElement.on(\"keydown\", function (ev) { "," if (ev.keyCode == 9 && ev.shiftKey) {"," ev.preventDefault();"," this._swfReference._swf.setAttribute(\"tabindex\", 0); "," this._swfReference._swf.setAttribute(\"role\", \"button\");"," this._swfReference._swf.setAttribute(\"aria-label\", this.get(\"selectButtonLabel\"));"," this._swfReference._swf.focus();"," }"," }, this);"," this._tabElementBindings.tabback = this._swfReference.on(\"tabback\", function (ev) {this._swfReference._swf.blur(); setTimeout(function () {fromElement.focus();}, 30);}, this);"," this._tabElementBindings.tabforward = this._swfReference.on(\"tabforward\", function (ev) {this._swfReference._swf.blur(); setTimeout(function () {toElement.focus();}, 30);}, this);",""," this._tabElementBindings.focus = this._swfReference._swf.on(\"focus\", function (ev) {this._buttonFocus = true; this._setButtonClass(\"focus\", true);}, this);"," this._tabElementBindings.blur = this._swfReference._swf.on(\"blur\", function (ev) {this._buttonFocus = false; this._setButtonClass(\"focus\", false);}, this);"," }"," else if (this._tabElementBindings !== null) {"," this._tabElementBindings.from.detach();"," this._tabElementBindings.to.detach();"," this._tabElementBindings.tabback.detach();"," this._tabElementBindings.tabforward.detach();"," this._tabElementBindings.focus.detach();"," this._tabElementBindings.blur.detach();"," }"," },","",""," /**"," * Adds or removes a specified state CSS class to the underlying uploader button. "," *"," * @method _setButtonClass"," * @protected"," * @param state {String} The name of the state enumerated in `buttonClassNames` attribute"," * from which to derive the needed class name."," * @param add {Boolean} A Boolean indicating whether to add or remove the class."," */"," _setButtonClass : function (state, add) {"," if (add) {"," this.get(\"selectFilesButton\").addClass(this.get(\"buttonClassNames\")[state]);"," }"," else {"," this.get(\"selectFilesButton\").removeClass(this.get(\"buttonClassNames\")[state]);"," }"," },","",""," /**"," * Syncs the state of the `fileFilters` attribute between the instance of UploaderFlash"," * and the Flash player."," * "," * @method _setFileFilters"," * @private"," */"," _setFileFilters : function () {"," if (this._swfReference && this.get(\"fileFilters\").length > 0) {"," this._swfReference.callSWF(\"setFileFilters\", [this.get(\"fileFilters\")]);"," } ",""," },","","",""," /**"," * Syncs the state of the `multipleFiles` attribute between this class"," * and the Flash uploader."," * "," * @method _setMultipleFiles"," * @private"," */"," _setMultipleFiles : function () {"," if (this._swfReference) {"," this._swfReference.callSWF(\"setAllowMultipleFiles\", [this.get(\"multipleFiles\")]);"," }"," },",""," /**"," * Syncs the state of the `enabled` attribute between this class"," * and the Flash uploader."," * "," * @method _triggerEnabled"," * @private"," */"," _triggerEnabled : function () {"," if (this.get(\"enabled\")) {"," this._swfReference.callSWF(\"enable\");"," this._swfReference._swf.setAttribute(\"aria-disabled\", \"false\");"," this._setButtonClass(\"disabled\", false);"," }"," else {"," this._swfReference.callSWF(\"disable\");"," this._swfReference._swf.setAttribute(\"aria-disabled\", \"true\");"," this._setButtonClass(\"disabled\", true);"," }"," },",""," /**"," * Getter for the `fileList` attribute"," * "," * @method _getFileList"," * @private"," */"," _getFileList : function (arr) {"," return this._fileList.concat();"," },",""," /**"," * Setter for the `fileList` attribute"," * "," * @method _setFileList"," * @private"," */"," _setFileList : function (val) {"," this._fileList = val.concat();"," return this._fileList.concat();"," },",""," /**"," * Adjusts the content of the `fileList` based on the results of file selection"," * and the `appendNewFiles` attribute. If the `appendNewFiles` attribute is true,"," * then selected files are appended to the existing list; otherwise, the list is"," * cleared and populated with the newly selected files."," * "," * @method _updateFileList"," * @param ev {Event} The file selection event received from the uploader."," * @private"," */"," _updateFileList : function (ev) {"," "," Y.one(\"body\").focus();"," this._swfReference._swf.focus();","",""," var newfiles = ev.fileList,"," fileConfObjects = [],"," parsedFiles = [],"," swfRef = this._swfReference,"," filterFunc = this.get(\"fileFilterFunction\");"," "," Y.each(newfiles, function (value) {"," var newFileConf = {};"," newFileConf.id = value.fileId;"," newFileConf.name = value.fileReference.name;"," newFileConf.size = value.fileReference.size;"," newFileConf.type = value.fileReference.type;"," newFileConf.dateCreated = value.fileReference.creationDate;"," newFileConf.dateModified = value.fileReference.modificationDate;"," newFileConf.uploader = swfRef;",""," fileConfObjects.push(newFileConf);"," });",""," if (filterFunc) {"," Y.each(fileConfObjects, function (value) {"," var newfile = new Y.FileFlash(value);"," if (filterFunc(newfile)) {"," parsedFiles.push(newfile);"," }"," });"," }"," else {"," Y.each(fileConfObjects, function (value) {"," parsedFiles.push(new Y.FileFlash(value));"," });"," }",""," if (parsedFiles.length > 0) {"," var oldfiles = this.get(\"fileList\");",""," this.set(\"fileList\", "," this.get(\"appendNewFiles\") ? oldfiles.concat(parsedFiles) : parsedFiles );",""," this.fire(\"fileselect\", {fileList: parsedFiles});"," }",""," },","","",""," /**"," * Handles and retransmits events fired by `Y.FileFlash` and `Y.Uploader.Queue`."," * "," * @method _uploadEventHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadEventHandler : function (event) {"," "," switch (event.type) {"," case \"file:uploadstart\":"," this.fire(\"fileuploadstart\", event);"," break;"," case \"file:uploadprogress\":"," this.fire(\"uploadprogress\", event);"," break;"," case \"uploaderqueue:totaluploadprogress\":"," this.fire(\"totaluploadprogress\", event);"," break;"," case \"file:uploadcomplete\":"," this.fire(\"uploadcomplete\", event);"," break;"," case \"uploaderqueue:alluploadscomplete\":"," this.queue = null;"," this.fire(\"alluploadscomplete\", event);"," break;"," case \"file:uploaderror\":"," case \"uploaderqueue:uploaderror\":"," this.fire(\"uploaderror\", event);"," break;"," case \"file:uploadcancel\":"," case \"uploaderqueue:uploadcancel\":"," this.fire(\"uploadcancel\", event);"," break;"," } ",""," },","","",""," /**"," * Starts the upload of a specific file."," *"," * @method upload"," * @param file {Y.FileFlash} Reference to the instance of the file to be uploaded."," * @param url {String} The URL to upload the file to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */",""," upload : function (file, url, postvars) {"," "," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\"),"," fileId = file.get(\"id\");",""," postVars = postVars.hasOwnProperty(fileId) ? postVars[fileId] : postVars;",""," if (file instanceof Y.FileFlash) {"," "," file.on(\"uploadstart\", this._uploadEventHandler, this);"," file.on(\"uploadprogress\", this._uploadEventHandler, this);"," file.on(\"uploadcomplete\", this._uploadEventHandler, this);"," file.on(\"uploaderror\", this._uploadEventHandler, this);"," file.on(\"uploadcancel\", this._uploadEventHandler, this);",""," file.startUpload(uploadURL, postVars, this.get(\"fileFieldName\"));"," }"," },",""," /**"," * Starts the upload of all files on the file list, using an automated queue."," *"," * @method uploadAll"," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadAll : function (url, postvars) {"," this.uploadThese(this.get(\"fileList\"), url, postvars);"," },",""," /**"," * Starts the upload of the files specified in the first argument, using an automated queue."," *"," * @method uploadThese"," * @param files {Array} The list of files to upload."," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadThese : function (files, url, postvars) {"," if (!this.queue) {"," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\");",""," this.queue = new UploaderQueue({simUploads: this.get(\"simLimit\"), "," errorAction: this.get(\"errorAction\"),"," fileFieldName: this.get(\"fileFieldName\"),"," fileList: files,"," uploadURL: uploadURL,"," perFileParameters: postVars,"," retryCount: this.get(\"retryCount\")"," });"," this.queue.on(\"uploadstart\", this._uploadEventHandler, this);"," this.queue.on(\"uploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"totaluploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"uploadcomplete\", this._uploadEventHandler, this);"," this.queue.on(\"alluploadscomplete\", this._uploadEventHandler, this);"," this.queue.on(\"alluploadscancelled\", function (ev) {this.queue = null;}, this);"," this.queue.on(\"uploaderror\", this._uploadEventHandler, this);"," this.queue.startUpload(); "," "," this.fire(\"uploadstart\"); "," }"," }","},","","{"," /**"," * The template for the Flash player container. Since the Flash player container needs"," * to completely overlay the &lquot;Select Files&rqot; control, it's positioned absolutely,"," * with width and height set to 100% of the parent."," *"," * @property FLASH_CONTAINER"," * @type {String}"," * @static"," * @default \"<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin: 0; padding: 0; border: 0; width:100%; height:100%'></div>\""," */"," FLASH_CONTAINER: \"<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin: 0; padding: 0; border: 0; width:100%; height:100%'></div>\",",""," /**"," * The template for the \"Select Files\" button."," *"," * @property SELECT_FILES_BUTTON"," * @type {String}"," * @static"," * @default \"<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>\""," */"," SELECT_FILES_BUTTON: \"<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>\",",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The UploaderFlash value is `\"flash\"`."," * "," * @property TYPE"," * @type {String}"," * @static"," */"," TYPE: \"flash\",",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'uploader'"," * @readOnly"," * @protected"," * @static"," */"," NAME: \"uploader\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A Boolean indicating whether newly selected files should be appended "," * to the existing file list, or whether they should replace it."," *"," * @attribute appendNewFiles"," * @type {Boolean}"," * @default true"," */"," appendNewFiles : {"," value: true"," },",""," /**"," * The names of CSS classes that correspond to different button states"," * of the \"Select Files\" control. These classes are assigned to the "," * \"Select Files\" control based on the mouse states reported by the"," * Flash player. The keys for the class names are:"," * <ul>"," * <li> <strong>`hover`</strong>: the class corresponding to mouse hovering over"," * the \"Select Files\" button.</li>"," * <li> <strong>`active`</strong>: the class corresponding to mouse down state of"," * the \"Select Files\" button.</li>"," * <li> <strong>`disabled`</strong>: the class corresponding to the disabled state"," * of the \"Select Files\" button.</li>"," * <li> <strong>`focus`</strong>: the class corresponding to the focused state of"," * the \"Select Files\" button.</li>"," * </ul>"," * @attribute buttonClassNames"," * @type {Object}"," * @default { hover: \"yui3-button-hover\","," * active: \"yui3-button-active\","," * disabled: \"yui3-button-disabled\","," * focus: \"yui3-button-selected\""," * }"," */"," buttonClassNames: {"," value: {"," \"hover\": \"yui3-button-hover\","," \"active\": \"yui3-button-active\","," \"disabled\": \"yui3-button-disabled\","," \"focus\": \"yui3-button-selected\""," }"," },",""," /**"," * A Boolean indicating whether the uploader is enabled or disabled for user input."," *"," * @attribute enabled"," * @type {Boolean}"," * @default true"," */"," enabled : {"," value: true"," },",""," /**"," * The action performed when an upload error occurs for a specific file being uploaded."," * The possible values are: "," * <ul>"," * <li> <strong>`UploaderQueue.CONTINUE`</strong>: the error is ignored and the upload process is continued.</li>"," * <li> <strong>`UploaderQueue.STOP`</strong>: the upload process is stopped as soon as any other parallel file"," * uploads are finished.</li>"," * <li> <strong>`UploaderQueue.RESTART_ASAP`</strong>: the file is added back to the front of the queue.</li>"," * <li> <strong>`UploaderQueue.RESTART_AFTER`</strong>: the file is added to the back of the queue.</li>"," * </ul>"," * @attribute errorAction"," * @type {String}"," * @default UploaderQueue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val, name) {"," return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER); "," }"," },",""," /**"," * An array indicating what fileFilters should be applied to the file"," * selection dialog. Each element in the array should be an object with"," * the following key-value pairs:"," * {"," * description : String "," extensions: String of the form &lquot;*.ext1;*.ext2;*.ext3;...&rquot;"," * }"," * @attribute fileFilters"," * @type {Array}"," * @default []"," */"," fileFilters: {"," value: []"," },",""," /**"," * A filtering function that is applied to every file selected by the user."," * The function receives the `Y.File` object and must return a Boolean value."," * If a `false` value is returned, the file in question is not added to the"," * list of files to be uploaded."," * Use this function to put limits on file sizes or check the file names for"," * correct extension, but make sure that a server-side check is also performed,"," * since any client-side restrictions are only advisory and can be circumvented."," *"," * @attribute fileFilterFunction"," * @type {Function}"," * @default null"," */"," fileFilterFunction: {"," value: null"," },"," "," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */"," fileFieldName: {"," value: \"Filedata\""," },",""," /**"," * The array of files to be uploaded. All elements in the array"," * must be instances of `Y.FileFlash` and be instantiated with a `fileId`"," * retrieved from an instance of the uploader."," *"," * @attribute fileList"," * @type {Array}"," * @default []"," */"," fileList: {"," value: [],"," getter: \"_getFileList\","," setter: \"_setFileList\""," },",""," /**"," * A Boolean indicating whether multiple file selection is enabled."," *"," * @attribute multipleFiles"," * @type {Boolean}"," * @default false"," */"," multipleFiles: {"," value: false"," },",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file. This attribute is only used if no POST variables are specifed"," * in the upload method call."," *"," * @attribute postVarsPerFile"," * @type {Object}"," * @default {}"," */"," postVarsPerFile: {"," value: {}"," },",""," /**"," * The label for the \"Select Files\" widget. This is the value that replaces the"," * `{selectButtonLabel}` token in the `SELECT_FILES_BUTTON` template."," * "," * @attribute selectButtonLabel"," * @type {String}"," * @default \"Select Files\""," */"," selectButtonLabel: {"," value: \"Select Files\""," },",""," /**"," * The widget that serves as the \"Select Files\" control for the file uploader"," * "," *"," * @attribute selectFilesButton"," * @type {Node | Widget}"," * @default A standard HTML button with YUI CSS Button skin."," */"," selectFilesButton : {"," valueFn: function () {"," return Y.Node.create(substitute(Y.UploaderFlash.SELECT_FILES_BUTTON, {selectButtonLabel: this.get(\"selectButtonLabel\")}));"," }"," },"," "," /**"," * The number of files that can be uploaded"," * simultaneously if the automatic queue management"," * is used. This value can be in the range between 2"," * and 5."," *"," * @attribute simLimit"," * @type {Number}"," * @default 2"," */"," simLimit: {"," value: 2,"," validator: function (val, name) {"," return (val >= 2 && val <= 5);"," }"," },",""," /**"," * The URL to the SWF file of the flash uploader. A copy local to"," * the server that hosts the page on which the uploader appears is"," * recommended."," *"," * @attribute swfURL"," * @type {String}"," * @default \"CDN Prefix + uploader/assets/flashuploader.swf\" with a "," * random GET parameter for IE (to prevent buggy behavior when the SWF "," * is cached)."," */"," swfURL: {"," valueFn: function () {"," var prefix = Y.Env.cdn + \"uploader/assets/flashuploader.swf\";",""," if (Y.UA.ie > 0) {"," return (prefix + \"?t=\" + Y.guid(\"uploader\"));"," }"," return prefix;"," }"," },",""," /**"," * The id's or `Node` references of the DOM elements that precede"," * and follow the `Select Files` button in the tab order. Specifying"," * these allows keyboard navigation to and from the Flash player"," * layer of the uploader."," * The two keys corresponding to the DOM elements are:"," <ul>"," * <li> `from`: the id or the `Node` reference corresponding to the"," * DOM element that precedes the `Select Files` button in the tab order.</li>"," * <li> `to`: the id or the `Node` reference corresponding to the"," * DOM element that follows the `Select Files` button in the tab order.</li>"," * </ul>"," * @attribute tabElements"," * @type {Object}"," * @default null"," */"," tabElements: {"," value: null"," },",""," /**"," * The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */"," uploadURL: {"," value: \"\""," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */ "," retryCount: {"," value: 3"," }"," }","});","","Y.UploaderFlash.Queue = UploaderQueue;","","","","","}, '3.7.3', {\"requires\": [\"swf\", \"widget\", \"substitute\", \"base\", \"cssbutton\", \"node\", \"event-custom\", \"file-flash\", \"uploader-queue\"]});"]; _yuitest_coverage["build/uploader-flash/uploader-flash.js"].lines = {"1":0,"14":0,"30":0,"31":0,"36":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"129":0,"137":0,"152":0,"171":0,"188":0,"205":0,"213":0,"234":0,"242":0,"250":0,"258":0,"266":0,"274":0,"290":0,"294":0,"295":0,"296":0,"297":0,"299":0,"300":0,"307":0,"321":0,"322":0,"323":0,"324":0,"325":0,"326":0,"327":0,"328":0,"329":0,"332":0,"338":0,"339":0,"340":0,"341":0,"342":0,"345":0,"346":0,"347":0,"348":0,"351":0,"352":0,"353":0,"354":0,"356":0,"357":0,"358":0,"359":0,"361":0,"362":0,"363":0,"364":0,"365":0,"366":0,"381":0,"383":0,"384":0,"385":0,"386":0,"387":0,"388":0,"389":0,"392":0,"395":0,"396":0,"399":0,"400":0,"401":0,"402":0,"403":0,"404":0,"405":0,"408":0,"409":0,"410":0,"411":0,"412":0,"413":0,"414":0,"417":0,"418":0,"420":0,"421":0,"423":0,"424":0,"425":0,"426":0,"427":0,"428":0,"429":0,"444":0,"445":0,"448":0,"461":0,"462":0,"477":0,"478":0,"490":0,"491":0,"492":0,"493":0,"496":0,"497":0,"498":0,"509":0,"519":0,"520":0,"535":0,"536":0,"539":0,"545":0,"546":0,"547":0,"548":0,"549":0,"550":0,"551":0,"552":0,"553":0,"555":0,"558":0,"559":0,"560":0,"561":0,"562":0,"567":0,"568":0,"572":0,"573":0,"575":0,"578":0,"594":0,"596":0,"597":0,"599":0,"600":0,"602":0,"603":0,"605":0,"606":0,"608":0,"609":0,"610":0,"613":0,"614":0,"617":0,"618":0,"637":0,"641":0,"643":0,"645":0,"646":0,"647":0,"648":0,"649":0,"651":0,"664":0,"677":0,"678":0,"681":0,"689":0,"690":0,"691":0,"692":0,"693":0,"694":0,"695":0,"696":0,"698":0,"831":0,"942":0,"959":0,"976":0,"978":0,"979":0,"981":0,"1030":0}; _yuitest_coverage["build/uploader-flash/uploader-flash.js"].functions = {"UploaderFlash:30":0,"initializer:104":0,"renderUI:289":0,"(anonymous 2):321":0,"(anonymous 3):338":0,"(anonymous 4):345":0,"(anonymous 5):351":0,"(anonymous 6):356":0,"(anonymous 7):361":0,"bindUI:319":0,"(anonymous 8):399":0,"(anonymous 9):408":0,"(anonymous 11):417":0,"(anonymous 10):417":0,"(anonymous 13):418":0,"(anonymous 12):418":0,"(anonymous 14):420":0,"(anonymous 15):421":0,"_attachTabElements:380":0,"_setButtonClass:443":0,"_setFileFilters:460":0,"_setMultipleFiles:476":0,"_triggerEnabled:489":0,"_getFileList:508":0,"_setFileList:518":0,"(anonymous 16):545":0,"(anonymous 17):559":0,"(anonymous 18):567":0,"_updateFileList:533":0,"_uploadEventHandler:592":0,"upload:635":0,"uploadAll:663":0,"(anonymous 19):694":0,"uploadThese:676":0,"validator:830":0,"valueFn:941":0,"validator:958":0,"valueFn:975":0,"(anonymous 1):1":0}; _yuitest_coverage["build/uploader-flash/uploader-flash.js"].coveredLines = 189;@@ -1299,4 +1299,4 @@ -}, '3.7.2', {"requires": ["swf", "widget", "substitute", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue"]});+}, '3.7.3', {"requires": ["swf", "widget", "substitute", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue"]});
bundle/uploader-flash/uploader-flash-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1038,4 +1038,4 @@ -}, '3.7.2', {"requires": ["swf", "widget", "substitute", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue"]});+}, '3.7.3', {"requires": ["swf", "widget", "substitute", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue"]});
bundle/uploader-flash/uploader-flash-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("uploader-flash",function(e,t){function u(e){u.superclass.constructor.apply(this,arguments)}var n=e.substitute,r=e.Uploader.Queue,i=e.ClassNameManager.getClassName,s="uploader",o=i(s,"selectfiles-button");e.UploaderFlash=e.extend(u,e.Widget,{_buttonState:"up",_buttonFocus:!1,_swfContainerId:null,_swfReference:null,queue:null,_tabElementBindings:null,initializer:function(){this._swfContainerId=e.guid("uploader"),this._swfReference=null,this.queue=null,this._buttonState="up",this._buttonFocus=null,this._tabElementBindings=null,this._fileList=[],this.publish("fileselect"),this.publish("uploadstart"),this.publish("fileuploadstart"),this.publish("uploadprogress"),this.publish("totaluploadprogress"),this.publish("uploadcomplete"),this.publish("alluploadscomplete"),this.publish("uploaderror"),this.publish("mouseenter"),this.publish("mouseleave"),this.publish("mousedown"),this.publish("mouseup"),this.publish("click")},renderUI:function(){var t=this.get("boundingBox"),r=this.get("contentBox"),i=this.get("selectFilesButton");t.setStyle("position","relative"),i.setStyles({width:"100%",height:"100%"}),r.append(i),r.append(e.Node.create(n(u.FLASH_CONTAINER,{swfContainerId:this._swfContainerId})));var s=e.one("#"+this._swfContainerId),o={version:"10.0.45",fixedAttributes:{wmode:"transparent",allowScriptAccess:"always",allowNetworking:"all",scale:"noscale"}};this._swfReference=new e.SWF(s,this.get("swfURL"),o)},bindUI:function(){this._swfReference.on("swfReady",function(){this._setMultipleFiles(),this._setFileFilters(),this._triggerEnabled(),this._attachTabElements(),this.after("multipleFilesChange",this._setMultipleFiles,this),this.after("fileFiltersChange",this._setFileFilters,this),this.after("enabledChange",this._triggerEnabled,this),this.after("tabElementsChange",this._attachTabElements)},this),this._swfReference.on("fileselect",this._updateFileList,this),this._swfReference.on("mouseenter",function(){this.fire("mouseenter"),this._setButtonClass("hover",!0),this._buttonState=="down"&&this._setButtonClass("active",!0)},this),this._swfReference.on("mouseleave",function(){this.fire("mouseleave"),this._setButtonClass("hover",!1),this._setButtonClass("active",!1)},this),this._swfReference.on("mousedown",function(){this.fire("mousedown"),this._buttonState="down",this._setButtonClass("active",!0)},this),this._swfReference.on("mouseup",function(){this.fire("mouseup"),this._buttonState="up",this._setButtonClass("active",!1)},this),this._swfReference.on("click",function(){this.fire("click"),this._buttonFocus=!0,this._setButtonClass("focus",!0),e.one("body").focus(),this._swfReference._swf.focus()},this)},_attachTabElements:function(t){if(this.get("tabElements")!==null&&this.get("tabElements").from!==null&&this.get("tabElements").to!==null){this._tabElementBindings!==null?(this._tabElementBindings.from.detach(),this._tabElementBindings.to.detach(),this._tabElementBindings.tabback.detach(),this._tabElementBindings.tabforward.detach(),this._tabElementBindings.focus.detach(),this._tabElementBindings.blur.detach()):this._tabElementBindings={};var n=e.one(this.get("tabElements").from),r=e.one(this.get("tabElements").to);this._tabElementBindings.from=n.on("keydown",function(e){e.keyCode==9&&!e.shiftKey&&(e.preventDefault(),this._swfReference._swf.setAttribute("tabindex",0),this._swfReference._swf.setAttribute("role","button"),this._swfReference._swf.setAttribute("aria-label",this.get("selectButtonLabel")),this._swfReference._swf.focus())},this),this._tabElementBindings.to=r.on("keydown",function(e){e.keyCode==9&&e.shiftKey&&(e.preventDefault(),this._swfReference._swf.setAttribute("tabindex",0),this._swfReference._swf.setAttribute("role","button"),this._swfReference._swf.setAttribute("aria-label",this.get("selectButtonLabel")),this._swfReference._swf.focus())},this),this._tabElementBindings.tabback=this._swfReference.on("tabback",function(e){this._swfReference._swf.blur(),setTimeout(function(){n.focus()},30)},this),this._tabElementBindings.tabforward=this._swfReference.on("tabforward",function(e){this._swfReference._swf.blur(),setTimeout(function(){r.focus()},30)},this),this._tabElementBindings.focus=this._swfReference._swf.on("focus",function(e){this._buttonFocus=!0,this._setButtonClass("focus",!0)},this),this._tabElementBindings.blur=this._swfReference._swf.on("blur",function(e){this._buttonFocus=!1,this._setButtonClass("focus",!1)},this)}else this._tabElementBindings!==null&&(this._tabElementBindings.from.detach(),this._tabElementBindings.to.detach(),this._tabElementBindings.tabback.detach(),this._tabElementBindings.tabforward.detach(),this._tabElementBindings.focus.detach(),this._tabElementBindings.blur.detach())},_setButtonClass:function(e,t){t?this.get("selectFilesButton").addClass(this.get("buttonClassNames")[e]):this.get("selectFilesButton").removeClass(this.get("buttonClassNames")[e])},_setFileFilters:function(){this._swfReference&&this.get("fileFilters").length>0&&this._swfReference.callSWF("setFileFilters",[this.get("fileFilters")])},_setMultipleFiles:function(){this._swfReference&&this._swfReference.callSWF("setAllowMultipleFiles",[this.get("multipleFiles")])},_triggerEnabled:function(){this.get("enabled")?(this._swfReference.callSWF("enable"),this._swfReference._swf.setAttribute("aria-disabled","false"),this._setButtonClass("disabled",!1)):(this._swfReference.callSWF("disable"),this._swfReference._swf.setAttribute("aria-disabled","true"),this._setButtonClass("disabled",!0))},_getFileList:function(e){return this._fileList.concat()},_setFileList:function(e){return this._fileList=e.concat(),this._fileList.concat()},_updateFileList:function(t){e.one("body").focus(),this._swfReference._swf.focus();var n=t.fileList,r=[],i=[],s=this._swfReference,o=this.get("fileFilterFunction");e.each(n,function(e){var t={};t.id=e.fileId,t.name=e.fileReference.name,t.size=e.fileReference.size,t.type=e.fileReference.type,t.dateCreated=e.fileReference.creationDate,t.dateModified=e.fileReference.modificationDate,t.uploader=s,r.push(t)}),o?e.each(r,function(t){var n=new e.FileFlash(t);o(n)&&i.push(n)}):e.each(r,function(t){i.push(new e.FileFlash(t))});if(i.length>0){var u=this.get("fileList");this.set("fileList",this.get("appendNewFiles")?u.concat(i):i),this.fire("fileselect",{fileList:i})}},_uploadEventHandler:function(e){switch(e.type){case"file:uploadstart":this.fire("fileuploadstart",e);break;case"file:uploadprogress":this.fire("uploadprogress",e);break;case"uploaderqueue:totaluploadprogress":this.fire("totaluploadprogress",e);break;case"file:uploadcomplete":this.fire("uploadcomplete",e);break;case"uploaderqueue:alluploadscomplete":this.queue=null,this.fire("alluploadscomplete",e);break;case"file:uploaderror":case"uploaderqueue:uploaderror":this.fire("uploaderror",e);break;case"file:uploadcancel":case"uploaderqueue:uploadcancel":this.fire("uploadcancel",e)}},upload:function(t,n,r){var i=n||this.get("uploadURL"),s=r||this.get("postVarsPerFile"),o=t.get("id");s=s.hasOwnProperty(o)?s[o]:s,t instanceof e.FileFlash&&(t.on("uploadstart",this._uploadEventHandler,this),t.on("uploadprogress",this._uploadEventHandler,this),t.on("uploadcomplete",this._uploadEventHandler,this),t.on("uploaderror",this._uploadEventHandler,this),t.on("uploadcancel",this._uploadEventHandler,this),t.startUpload(i,s,this.get("fileFieldName")))},uploadAll:function(e,t){this.uploadThese(this.get("fileList"),e,t)},uploadThese:function(e,t,n){if(!this.queue){var i=t||this.get("uploadURL"),s=n||this.get("postVarsPerFile");this.queue=new r({simUploads:this.get("simLimit"),errorAction:this.get("errorAction"),fileFieldName:this.get("fileFieldName"),fileList:e,uploadURL:i,perFileParameters:s,retryCount:this.get("retryCount")}),this.queue.on("uploadstart",this._uploadEventHandler,this),this.queue.on("uploadprogress",this._uploadEventHandler,this),this.queue.on("totaluploadprogress",this._uploadEventHandler,this),this.queue.on("uploadcomplete",this._uploadEventHandler,this),this.queue.on("alluploadscomplete",this._uploadEventHandler,this),this.queue.on("alluploadscancelled",function(e){this.queue=null},this),this.queue.on("uploaderror",this._uploadEventHandler,this),this.queue.startUpload(),this.fire("uploadstart")}}},{FLASH_CONTAINER:"<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin: 0; padding: 0; border: 0; width:100%; height:100%'></div>",SELECT_FILES_BUTTON:"<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>",TYPE:"flash",NAME:"uploader",ATTRS:{appendNewFiles:{value:!0},buttonClassNames:{value:{hover:"yui3-button-hover",active:"yui3-button-active",disabled:"yui3-button-disabled",focus:"yui3-button-selected"}},enabled:{value:!0},errorAction:{value:"continue",validator:function(e,t){return e===r.CONTINUE||e===r.STOP||e===r.RESTART_ASAP||e===r.RESTART_AFTER}},fileFilters:{value:[]},fileFilterFunction:{value:null},fileFieldName:{value:"Filedata"},fileList:{value:[],getter:"_getFileList",setter:"_setFileList"},multipleFiles:{value:!1},postVarsPerFile:{value:{}},selectButtonLabel:{value:"Select Files"},selectFilesButton:{valueFn:function(){return e.Node.create(n(e.UploaderFlash.SELECT_FILES_BUTTON,{selectButtonLabel:this.get("selectButtonLabel")}))}},simLimit:{value:2,validator:function(e,t){return e>=2&&e<=5}},swfURL:{valueFn:function(){var t=e.Env.cdn+"uploader/assets/flashuploader.swf";return e.UA.ie>0?t+"?t="+e.guid("uploader"):t}},tabElements:{value:null},uploadURL:{value:""},retryCount:{value:3}}}),e.UploaderFlash.Queue=r},"3.7.2",{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]});+YUI.add("uploader-flash",function(e,t){function u(e){u.superclass.constructor.apply(this,arguments)}var n=e.substitute,r=e.Uploader.Queue,i=e.ClassNameManager.getClassName,s="uploader",o=i(s,"selectfiles-button");e.UploaderFlash=e.extend(u,e.Widget,{_buttonState:"up",_buttonFocus:!1,_swfContainerId:null,_swfReference:null,queue:null,_tabElementBindings:null,initializer:function(){this._swfContainerId=e.guid("uploader"),this._swfReference=null,this.queue=null,this._buttonState="up",this._buttonFocus=null,this._tabElementBindings=null,this._fileList=[],this.publish("fileselect"),this.publish("uploadstart"),this.publish("fileuploadstart"),this.publish("uploadprogress"),this.publish("totaluploadprogress"),this.publish("uploadcomplete"),this.publish("alluploadscomplete"),this.publish("uploaderror"),this.publish("mouseenter"),this.publish("mouseleave"),this.publish("mousedown"),this.publish("mouseup"),this.publish("click")},renderUI:function(){var t=this.get("boundingBox"),r=this.get("contentBox"),i=this.get("selectFilesButton");t.setStyle("position","relative"),i.setStyles({width:"100%",height:"100%"}),r.append(i),r.append(e.Node.create(n(u.FLASH_CONTAINER,{swfContainerId:this._swfContainerId})));var s=e.one("#"+this._swfContainerId),o={version:"10.0.45",fixedAttributes:{wmode:"transparent",allowScriptAccess:"always",allowNetworking:"all",scale:"noscale"}};this._swfReference=new e.SWF(s,this.get("swfURL"),o)},bindUI:function(){this._swfReference.on("swfReady",function(){this._setMultipleFiles(),this._setFileFilters(),this._triggerEnabled(),this._attachTabElements(),this.after("multipleFilesChange",this._setMultipleFiles,this),this.after("fileFiltersChange",this._setFileFilters,this),this.after("enabledChange",this._triggerEnabled,this),this.after("tabElementsChange",this._attachTabElements)},this),this._swfReference.on("fileselect",this._updateFileList,this),this._swfReference.on("mouseenter",function(){this.fire("mouseenter"),this._setButtonClass("hover",!0),this._buttonState=="down"&&this._setButtonClass("active",!0)},this),this._swfReference.on("mouseleave",function(){this.fire("mouseleave"),this._setButtonClass("hover",!1),this._setButtonClass("active",!1)},this),this._swfReference.on("mousedown",function(){this.fire("mousedown"),this._buttonState="down",this._setButtonClass("active",!0)},this),this._swfReference.on("mouseup",function(){this.fire("mouseup"),this._buttonState="up",this._setButtonClass("active",!1)},this),this._swfReference.on("click",function(){this.fire("click"),this._buttonFocus=!0,this._setButtonClass("focus",!0),e.one("body").focus(),this._swfReference._swf.focus()},this)},_attachTabElements:function(t){if(this.get("tabElements")!==null&&this.get("tabElements").from!==null&&this.get("tabElements").to!==null){this._tabElementBindings!==null?(this._tabElementBindings.from.detach(),this._tabElementBindings.to.detach(),this._tabElementBindings.tabback.detach(),this._tabElementBindings.tabforward.detach(),this._tabElementBindings.focus.detach(),this._tabElementBindings.blur.detach()):this._tabElementBindings={};var n=e.one(this.get("tabElements").from),r=e.one(this.get("tabElements").to);this._tabElementBindings.from=n.on("keydown",function(e){e.keyCode==9&&!e.shiftKey&&(e.preventDefault(),this._swfReference._swf.setAttribute("tabindex",0),this._swfReference._swf.setAttribute("role","button"),this._swfReference._swf.setAttribute("aria-label",this.get("selectButtonLabel")),this._swfReference._swf.focus())},this),this._tabElementBindings.to=r.on("keydown",function(e){e.keyCode==9&&e.shiftKey&&(e.preventDefault(),this._swfReference._swf.setAttribute("tabindex",0),this._swfReference._swf.setAttribute("role","button"),this._swfReference._swf.setAttribute("aria-label",this.get("selectButtonLabel")),this._swfReference._swf.focus())},this),this._tabElementBindings.tabback=this._swfReference.on("tabback",function(e){this._swfReference._swf.blur(),setTimeout(function(){n.focus()},30)},this),this._tabElementBindings.tabforward=this._swfReference.on("tabforward",function(e){this._swfReference._swf.blur(),setTimeout(function(){r.focus()},30)},this),this._tabElementBindings.focus=this._swfReference._swf.on("focus",function(e){this._buttonFocus=!0,this._setButtonClass("focus",!0)},this),this._tabElementBindings.blur=this._swfReference._swf.on("blur",function(e){this._buttonFocus=!1,this._setButtonClass("focus",!1)},this)}else this._tabElementBindings!==null&&(this._tabElementBindings.from.detach(),this._tabElementBindings.to.detach(),this._tabElementBindings.tabback.detach(),this._tabElementBindings.tabforward.detach(),this._tabElementBindings.focus.detach(),this._tabElementBindings.blur.detach())},_setButtonClass:function(e,t){t?this.get("selectFilesButton").addClass(this.get("buttonClassNames")[e]):this.get("selectFilesButton").removeClass(this.get("buttonClassNames")[e])},_setFileFilters:function(){this._swfReference&&this.get("fileFilters").length>0&&this._swfReference.callSWF("setFileFilters",[this.get("fileFilters")])},_setMultipleFiles:function(){this._swfReference&&this._swfReference.callSWF("setAllowMultipleFiles",[this.get("multipleFiles")])},_triggerEnabled:function(){this.get("enabled")?(this._swfReference.callSWF("enable"),this._swfReference._swf.setAttribute("aria-disabled","false"),this._setButtonClass("disabled",!1)):(this._swfReference.callSWF("disable"),this._swfReference._swf.setAttribute("aria-disabled","true"),this._setButtonClass("disabled",!0))},_getFileList:function(e){return this._fileList.concat()},_setFileList:function(e){return this._fileList=e.concat(),this._fileList.concat()},_updateFileList:function(t){e.one("body").focus(),this._swfReference._swf.focus();var n=t.fileList,r=[],i=[],s=this._swfReference,o=this.get("fileFilterFunction");e.each(n,function(e){var t={};t.id=e.fileId,t.name=e.fileReference.name,t.size=e.fileReference.size,t.type=e.fileReference.type,t.dateCreated=e.fileReference.creationDate,t.dateModified=e.fileReference.modificationDate,t.uploader=s,r.push(t)}),o?e.each(r,function(t){var n=new e.FileFlash(t);o(n)&&i.push(n)}):e.each(r,function(t){i.push(new e.FileFlash(t))});if(i.length>0){var u=this.get("fileList");this.set("fileList",this.get("appendNewFiles")?u.concat(i):i),this.fire("fileselect",{fileList:i})}},_uploadEventHandler:function(e){switch(e.type){case"file:uploadstart":this.fire("fileuploadstart",e);break;case"file:uploadprogress":this.fire("uploadprogress",e);break;case"uploaderqueue:totaluploadprogress":this.fire("totaluploadprogress",e);break;case"file:uploadcomplete":this.fire("uploadcomplete",e);break;case"uploaderqueue:alluploadscomplete":this.queue=null,this.fire("alluploadscomplete",e);break;case"file:uploaderror":case"uploaderqueue:uploaderror":this.fire("uploaderror",e);break;case"file:uploadcancel":case"uploaderqueue:uploadcancel":this.fire("uploadcancel",e)}},upload:function(t,n,r){var i=n||this.get("uploadURL"),s=r||this.get("postVarsPerFile"),o=t.get("id");s=s.hasOwnProperty(o)?s[o]:s,t instanceof e.FileFlash&&(t.on("uploadstart",this._uploadEventHandler,this),t.on("uploadprogress",this._uploadEventHandler,this),t.on("uploadcomplete",this._uploadEventHandler,this),t.on("uploaderror",this._uploadEventHandler,this),t.on("uploadcancel",this._uploadEventHandler,this),t.startUpload(i,s,this.get("fileFieldName")))},uploadAll:function(e,t){this.uploadThese(this.get("fileList"),e,t)},uploadThese:function(e,t,n){if(!this.queue){var i=t||this.get("uploadURL"),s=n||this.get("postVarsPerFile");this.queue=new r({simUploads:this.get("simLimit"),errorAction:this.get("errorAction"),fileFieldName:this.get("fileFieldName"),fileList:e,uploadURL:i,perFileParameters:s,retryCount:this.get("retryCount")}),this.queue.on("uploadstart",this._uploadEventHandler,this),this.queue.on("uploadprogress",this._uploadEventHandler,this),this.queue.on("totaluploadprogress",this._uploadEventHandler,this),this.queue.on("uploadcomplete",this._uploadEventHandler,this),this.queue.on("alluploadscomplete",this._uploadEventHandler,this),this.queue.on("alluploadscancelled",function(e){this.queue=null},this),this.queue.on("uploaderror",this._uploadEventHandler,this),this.queue.startUpload(),this.fire("uploadstart")}}},{FLASH_CONTAINER:"<div id='{swfContainerId}' style='position:absolute; top:0px; left: 0px; margin: 0; padding: 0; border: 0; width:100%; height:100%'></div>",SELECT_FILES_BUTTON:"<button type='button' class='yui3-button' tabindex='-1'>{selectButtonLabel}</button>",TYPE:"flash",NAME:"uploader",ATTRS:{appendNewFiles:{value:!0},buttonClassNames:{value:{hover:"yui3-button-hover",active:"yui3-button-active",disabled:"yui3-button-disabled",focus:"yui3-button-selected"}},enabled:{value:!0},errorAction:{value:"continue",validator:function(e,t){return e===r.CONTINUE||e===r.STOP||e===r.RESTART_ASAP||e===r.RESTART_AFTER}},fileFilters:{value:[]},fileFilterFunction:{value:null},fileFieldName:{value:"Filedata"},fileList:{value:[],getter:"_getFileList",setter:"_setFileList"},multipleFiles:{value:!1},postVarsPerFile:{value:{}},selectButtonLabel:{value:"Select Files"},selectFilesButton:{valueFn:function(){return e.Node.create(n(e.UploaderFlash.SELECT_FILES_BUTTON,{selectButtonLabel:this.get("selectButtonLabel")}))}},simLimit:{value:2,validator:function(e,t){return e>=2&&e<=5}},swfURL:{valueFn:function(){var t=e.Env.cdn+"uploader/assets/flashuploader.swf";return e.UA.ie>0?t+"?t="+e.guid("uploader"):t}},tabElements:{value:null},uploadURL:{value:""},retryCount:{value:3}}}),e.UploaderFlash.Queue=r},"3.7.3",{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]});
bundle/uploader-flash/uploader-flash.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1038,4 +1038,4 @@ -}, '3.7.2', {"requires": ["swf", "widget", "substitute", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue"]});+}, '3.7.3', {"requires": ["swf", "widget", "substitute", "base", "cssbutton", "node", "event-custom", "file-flash", "uploader-queue"]});
bundle/uploader-html5/assets/uploader-flash-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/uploader-html5/uploader-html5-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/uploader-html5/uploader-html5.js", code: [] };-_yuitest_coverage["build/uploader-html5/uploader-html5.js"].code=["YUI.add('uploader-html5', function (Y, NAME) {","",""," /**"," * This module provides a UI for file selection and multiple file upload capability using"," * HTML5 XMLHTTPRequest Level 2 as a transport engine."," * The supported features include: automatic upload queue management, upload progress"," * tracking, drag-and-drop support, server response retrieval and error reporting."," *"," * @module uploader-html5"," */ ","","// Shorthands for the external modules","var substitute = Y.substitute,"," UploaderQueue = Y.Uploader.Queue;",""," /**"," * This module provides a UI for file selection and multiple file upload capability using"," * HTML5 XMLHTTPRequest Level 2 as a transport engine."," * @class UploaderHTML5"," * @extends Widget"," * @constructor"," */","","function UploaderHTML5(config) {"," UploaderHTML5.superclass.constructor.apply ( this, arguments );","}","","","","Y.UploaderHTML5 = Y.extend( UploaderHTML5, Y.Widget, {",""," /**"," * Stored reference to the instance of the file input field used to "," * initiate the file selection dialog."," *"," * @property _fileInputField"," * @type {Node}"," * @protected"," */"," _fileInputField: null,",""," /**"," * Stored reference to the click event binding of the `Select Files`"," * button."," *"," * @property _buttonBinding"," * @type {EventHandle}"," * @protected"," */"," _buttonBinding: null,",""," /**"," * Stored reference to the instance of Uploader.Queue used to manage"," * the upload process. This is a read-only property that only exists"," * during an active upload process. Only one queue can be active at"," * a time; if an upload start is attempted while a queue is active,"," * it will be ignored."," *"," * @property queue"," * @type {Y.Uploader.Queue}"," */"," queue: null,",""," // Y.UploaderHTML5 prototype",""," /**"," * Construction logic executed during UploaderHTML5 instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {",""," this._fileInputField = null;"," this.queue = null;"," this._buttonBinding = null;"," this._fileList = [];",""," // Publish available events",""," /**"," * Signals that files have been selected. "," *"," * @event fileselect"," * @param event {Event} The event object for the `fileselect` with the"," * following payload:"," * <dl>"," * <dt>fileList</dt>"," * <dd>An `Array` of files selected by the user, encapsulated"," * in Y.FileHTML5 objects.</dd>"," * </dl>"," */"," this.publish(\"fileselect\");",""," /**"," * Signals that an upload of multiple files has been started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart`."," */"," this.publish(\"uploadstart\");",""," /**"," * Signals that an upload of a specific file has started. "," *"," * @event fileuploadstart"," * @param event {Event} The event object for the `fileuploadstart` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>A reference to the Y.File that dispatched the event.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by Y.File.</dd>"," * </dl>"," */"," this.publish(\"fileuploadstart\");",""," /**"," * Reports on upload progress of a specific file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>The pointer to the instance of `Y.File` that dispatched the event.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by the HTML5 uploader</dd>"," * </dl>"," */"," this.publish(\"uploadprogress\");",""," /**"," * Reports on the total upload progress of the file list. "," *"," * @event totaluploadprogress"," * @param event {Event} The event object for the `totaluploadprogress` with the"," * following payload:"," * <dl>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file list that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file list</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file list that has been uploaded, out of 100</dd>"," * </dl>"," */"," this.publish(\"totaluploadprogress\");",""," /**"," * Signals that a single file upload has been completed. "," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>The pointer to the instance of `Y.File` whose upload has been completed.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the SWF Uploader</dd>"," * <dt>data</dt>"," * <dd>Data returned by the server.</dd>"," * </dl>"," */"," this.publish(\"uploadcomplete\");",""," /**"," * Signals that the upload process of the entire file list has been completed. "," *"," * @event alluploadscomplete"," * @param event {Event} The event object for the `alluploadscomplete`."," */"," this.publish(\"alluploadscomplete\");",""," /**"," * Signals that a error has occurred in a specific file's upload process. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original error event fired by the HTML5 Uploader. </dd>"," * <dt>file</dt>"," * <dd>The pointer at the instance of Y.File that returned the error.</dd> "," * <dt>status</dt>"," * <dd>The status reported by the XMLHttpRequest object.</dd>"," * <dt>statusText</dt>"," * <dd>The statusText reported by the XMLHttpRequest object.</dd> "," * </dl>"," */"," this.publish(\"uploaderror\");",""," /**"," * Signals that a dragged object has entered into the uploader's associated drag-and-drop area. "," *"," * @event dragenter"," * @param event {Event} The event object for the `dragenter`."," */"," this.publish(\"dragenter\");",""," /**"," * Signals that an object has been dragged over the uploader's associated drag-and-drop area. "," *"," * @event dragover"," * @param event {Event} The event object for the `dragover`."," */"," this.publish(\"dragover\");",""," /**"," * Signals that an object has been dragged off of the uploader's associated drag-and-drop area. "," *"," * @event dragleave"," * @param event {Event} The event object for the `dragleave`."," */"," this.publish(\"dragleave\");",""," /**"," * Signals that an object has been dropped over the uploader's associated drag-and-drop area. "," *"," * @event drop"," * @param event {Event} The event object for the `drop`."," */"," this.publish(\"drop\");"," "," },",""," /**"," * Create the DOM structure for the UploaderHTML5."," * UploaderHTML5's DOM structure consists of a \"Select Files\" button that can "," * be replaced by the developer's widget of choice; and a hidden file input field"," * that is used to instantiate the File Select dialog."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var boundingBox = this.get(\"boundingBox\"),"," contentBox = this.get('contentBox'),"," selButton = this.get(\"selectFilesButton\");",""," selButton.setStyles({width:\"100%\", height:\"100%\"});"," contentBox.append(selButton);"," this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);"," contentBox.append(this._fileInputField);"," },",""," /**"," * Binds to the UploaderHTML5 UI and subscribes to the necessary events."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {",""," this._bindSelectButton();"," this._setMultipleFiles();"," this._setFileFilters();"," this._bindDropArea();"," this._triggerEnabled();",""," this.after(\"multipleFilesChange\", this._setMultipleFiles, this);"," this.after(\"fileFiltersChange\", this._setFileFilters, this);"," this.after(\"enabledChange\", this._triggerEnabled, this);"," this.after(\"selectFilesButtonChange\", this._bindSelectButton, this);"," this.after(\"dragAndDropAreaChange\", this._bindDropArea, this);"," this.after(\"tabIndexChange\", function (ev) {this.get(\"selectFilesButton\").set(\"tabIndex\", this.get(\"tabIndex\"));}, this);"," this._fileInputField.on(\"change\", this._updateFileList, this);",""," this.get(\"selectFilesButton\").set(\"tabIndex\", this.get(\"tabIndex\"));"," },","",""," /**"," * Recreates the file field to null out the previous list of files and"," * thus allow for an identical file list selection."," * "," * @method _rebindFileField"," * @protected"," */"," _rebindFileField : function () {"," this._fileInputField.remove(true);"," this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);"," this.get(\"contentBox\").append(this._fileInputField);"," this._fileInputField.on(\"change\", this._updateFileList, this);"," this._setMultipleFiles();"," this._setFileFilters();"," },","",""," /**"," * Binds the specified drop area's drag and drop events to the"," * uploader's custom handler."," * "," * @method _bindDropArea"," * @protected"," */"," _bindDropArea : function (event) {"," var ev = event || {prevVal: null};",""," if (ev.prevVal !== null) {"," ev.prevVal.detach('drop', this._ddEventHandler);"," ev.prevVal.detach('dragenter', this._ddEventHandler);"," ev.prevVal.detach('dragover', this._ddEventHandler);"," ev.prevVal.detach('dragleave', this._ddEventHandler);"," }",""," var ddArea = this.get(\"dragAndDropArea\");",""," if (ddArea !== null) {"," ddArea.on('drop', this._ddEventHandler, this);"," ddArea.on('dragenter', this._ddEventHandler, this);"," ddArea.on('dragover', this._ddEventHandler, this);"," ddArea.on('dragleave', this._ddEventHandler, this);"," }"," },",""," /**"," * Binds the instantiation of the file select dialog to the current file select"," * control."," * "," * @method _bindSelectButton"," * @protected"," */"," _bindSelectButton : function () {"," this._buttonBinding = this.get(\"selectFilesButton\").on(\"click\", this.openFileSelectDialog, this);"," },",""," /**"," * Handles the drag and drop events from the uploader's specified drop"," * area."," * "," * @method _ddEventHandler"," * @protected"," */"," _ddEventHandler : function (event) {",""," event.stopPropagation();"," event.preventDefault(); "," "," switch (event.type) {"," case \"dragenter\":"," this.fire(\"dragenter\"); "," break;"," case \"dragover\":"," this.fire(\"dragover\");"," break;"," case \"dragleave\": "," this.fire(\"dragleave\");"," break;"," case \"drop\":",""," var newfiles = event._event.dataTransfer.files,"," parsedFiles = [],"," filterFunc = this.get(\"fileFilterFunction\");"," "," if (filterFunc) {"," Y.each(newfiles, function (value) {"," var newfile = new Y.FileHTML5(value);"," if (filterFunc(newfile)) {"," parsedFiles.push(newfile);"," }"," });"," }"," else {"," Y.each(newfiles, function (value) {"," parsedFiles.push(new Y.FileHTML5(value));"," });"," }",""," if (parsedFiles.length > 0) {"," var oldfiles = this.get(\"fileList\");"," this.set(\"fileList\", "," this.get(\"appendNewFiles\") ? oldfiles.concat(parsedFiles) : parsedFiles);"," this.fire(\"fileselect\", {fileList: parsedFiles});"," }",""," this.fire(\"drop\");"," break;"," }"," },",""," /**"," * Adds or removes a specified state CSS class to the underlying uploader button. "," *"," * @method _setButtonClass"," * @protected"," * @param state {String} The name of the state enumerated in `buttonClassNames` attribute"," * from which to derive the needed class name."," * @param add {Boolean} A Boolean indicating whether to add or remove the class."," */"," _setButtonClass : function (state, add) {"," if (add) {"," this.get(\"selectFilesButton\").addClass(this.get(\"buttonClassNames\")[state]);"," }"," else {"," this.get(\"selectFilesButton\").removeClass(this.get(\"buttonClassNames\")[state]);"," }"," },",""," /**"," * Syncs the state of the `multipleFiles` attribute between this class"," * and the file input field."," * "," * @method _setMultipleFiles"," * @protected"," */"," _setMultipleFiles : function () {"," if (this.get(\"multipleFiles\") === true) {"," this._fileInputField.set(\"multiple\", \"multiple\");"," }"," else {"," this._fileInputField.set(\"multiple\", \"\");"," }"," },",""," /**"," * Syncs the state of the `fileFilters` attribute between this class"," * and the file input field."," * "," * @method _setFileFilters"," * @protected"," */"," _setFileFilters : function () {"," if (this.get(\"fileFilters\").length > 0) {"," this._fileInputField.set(\"accept\", this.get(\"fileFilters\").join(\",\"));"," }"," else {"," this._fileInputField.set(\"accept\", \"\");"," }"," },","",""," /**"," * Syncs the state of the `enabled` attribute between this class"," * and the underlying button."," * "," * @method _triggerEnabled"," * @private"," */"," _triggerEnabled : function () {"," if (this.get(\"enabled\") && this._buttonBinding === null) {"," this._bindSelectButton();"," this._setButtonClass(\"disabled\", false);"," this.get(\"selectFilesButton\").setAttribute(\"aria-disabled\", \"false\");"," }"," else if (!this.get(\"enabled\") && this._buttonBinding) {"," this._buttonBinding.detach();"," this._buttonBinding = null;"," this._setButtonClass(\"disabled\", true);"," this.get(\"selectFilesButton\").setAttribute(\"aria-disabled\", \"true\");"," }"," },",""," /**"," * Getter for the `fileList` attribute"," * "," * @method _getFileList"," * @private"," */"," _getFileList : function (arr) {"," return this._fileList.concat();"," },",""," /**"," * Setter for the `fileList` attribute"," * "," * @method _setFileList"," * @private"," */"," _setFileList : function (val) {"," this._fileList = val.concat();"," return this._fileList.concat();"," },",""," /**"," * Adjusts the content of the `fileList` based on the results of file selection"," * and the `appendNewFiles` attribute. If the `appendNewFiles` attribute is true,"," * then selected files are appended to the existing list; otherwise, the list is"," * cleared and populated with the newly selected files."," * "," * @method _updateFileList"," * @param ev {Event} The file selection event received from the uploader."," * @protected"," */"," _updateFileList : function (ev) {"," var newfiles = ev.target.getDOMNode().files,"," parsedFiles = [],"," filterFunc = this.get(\"fileFilterFunction\");",""," if (filterFunc) {"," Y.each(newfiles, function (value) {"," var newfile = new Y.FileHTML5(value);"," if (filterFunc(newfile)) {"," parsedFiles.push(newfile);"," }"," });"," }"," else {"," Y.each(newfiles, function (value) {"," parsedFiles.push(new Y.FileHTML5(value));"," });"," }",""," if (parsedFiles.length > 0) {"," var oldfiles = this.get(\"fileList\");",""," this.set(\"fileList\", "," this.get(\"appendNewFiles\") ? oldfiles.concat(parsedFiles) : parsedFiles );",""," this.fire(\"fileselect\", {fileList: parsedFiles});"," }",""," this._rebindFileField();"," },","",""," /**"," * Handles and retransmits events fired by `Y.File` and `Y.Uploader.Queue`."," * "," * @method _uploadEventHandler"," * @param event The event dispatched during the upload process."," * @protected"," */"," _uploadEventHandler : function (event) {"," "," switch (event.type) {"," case \"file:uploadstart\":"," this.fire(\"fileuploadstart\", event);"," break;"," case \"file:uploadprogress\":"," this.fire(\"uploadprogress\", event);"," break;"," case \"uploaderqueue:totaluploadprogress\":"," this.fire(\"totaluploadprogress\", event);"," break;"," case \"file:uploadcomplete\":"," this.fire(\"uploadcomplete\", event);"," break;"," case \"uploaderqueue:alluploadscomplete\":"," this.queue = null;"," this.fire(\"alluploadscomplete\", event);"," break;"," case \"file:uploaderror\":"," case \"uploaderqueue:uploaderror\":"," this.fire(\"uploaderror\", event);"," break;"," case \"file:uploadcancel\":"," case \"uploaderqueue:uploadcancel\":"," this.fire(\"uploadcancel\", event);"," break;"," } ",""," },",""," /**"," * Opens the File Selection dialog by simulating a click on the file input field."," * "," * @method openFileSelectDialog"," */"," openFileSelectDialog : function () {"," var fileDomNode = this._fileInputField.getDOMNode();"," if (fileDomNode.click) {"," fileDomNode.click();"," } "," },",""," /**"," * Starts the upload of a specific file."," *"," * @method upload"," * @param file {Y.File} Reference to the instance of the file to be uploaded."," * @param url {String} The URL to upload the file to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," upload : function (file, url, postvars) {"," "," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\"),"," fileId = file.get(\"id\");",""," postVars = postVars.hasOwnProperty(fileId) ? postVars[fileId] : postVars;",""," if (file instanceof Y.FileHTML5) {"," "," file.on(\"uploadstart\", this._uploadEventHandler, this);"," file.on(\"uploadprogress\", this._uploadEventHandler, this);"," file.on(\"uploadcomplete\", this._uploadEventHandler, this);"," file.on(\"uploaderror\", this._uploadEventHandler, this);"," file.on(\"uploadcancel\", this._uploadEventHandler, this);",""," file.startUpload(uploadURL, postVars, this.get(\"fileFieldName\"));"," }"," },",""," /**"," * Starts the upload of all files on the file list, using an automated queue."," *"," * @method uploadAll"," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadAll : function (url, postvars) {"," this.uploadThese(this.get(\"fileList\"), url, postvars);"," },",""," /**"," * Starts the upload of the files specified in the first argument, using an automated queue."," *"," * @method uploadThese"," * @param files {Array} The list of files to upload."," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadThese : function (files, url, postvars) {"," if (!this.queue) {"," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\");",""," this.queue = new UploaderQueue({simUploads: this.get(\"simLimit\"), "," errorAction: this.get(\"errorAction\"),"," fileFieldName: this.get(\"fileFieldName\"),"," fileList: files,"," uploadURL: uploadURL,"," perFileParameters: postVars,"," retryCount: this.get(\"retryCount\"),"," uploadHeaders: this.get(\"uploadHeaders\"),"," withCredentials: this.get(\"withCredentials\")"," });"," this.queue.on(\"uploadstart\", this._uploadEventHandler, this);"," this.queue.on(\"uploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"totaluploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"uploadcomplete\", this._uploadEventHandler, this);"," this.queue.on(\"alluploadscomplete\", this._uploadEventHandler, this);"," this.queue.on(\"uploadcancel\", this._uploadEventHandler, this);"," this.queue.on(\"uploaderror\", this._uploadEventHandler, this);"," this.queue.startUpload(); "," "," this.fire(\"uploadstart\"); "," }"," else if (this.queue._currentState === UploaderQueue.UPLOADING) {"," this.queue.set(\"perFileParameters\", this.get(\"postVarsPerFile\"));"," Y.each(files, function (file) {"," this.queue.addToQueueBottom(file);"," }, this);"," }"," }","},","","{"," /**"," * The template for the hidden file input field container. The file input field will only"," * accept clicks if its visibility is set to hidden (and will not if it's `display` value"," * is set to `none`)"," *"," * @property HTML5FILEFIELD_TEMPLATE"," * @type {String}"," * @static"," */"," HTML5FILEFIELD_TEMPLATE: \"<input type='file' style='visibility:hidden; width:0px; height: 0px;'>\","," "," /**"," * The template for the \"Select Files\" button."," *"," * @property SELECT_FILES_BUTTON"," * @type {String}"," * @static"," * @default \"<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>\""," */ "," SELECT_FILES_BUTTON: \"<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>\",",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The UploaderHTML5 value is `\"html5\"`."," * "," * @property TYPE"," * @type {String}"," * @static"," */"," TYPE: \"html5\",",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'uploader'"," * @readOnly"," * @protected"," * @static"," */"," NAME: \"uploader\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A Boolean indicating whether newly selected files should be appended "," * to the existing file list, or whether they should replace it."," *"," * @attribute appendNewFiles"," * @type {Boolean}"," * @default true"," */"," appendNewFiles : {"," value: true"," },",""," /**"," * The names of CSS classes that correspond to different button states"," * of the \"Select Files\" control. These classes are assigned to the "," * \"Select Files\" control based on the configuration of the uploader."," * Currently, the only class name used is that corresponding to the "," * `disabled` state of the uploader. Other button states should be managed"," * directly via CSS selectors."," * <ul>"," * <li> <strong>`disabled`</strong>: the class corresponding to the disabled state"," * of the \"Select Files\" button.</li>"," * </ul>"," * @attribute buttonClassNames"," * @type {Object}"," * @default {"," * disabled: \"yui3-button-disabled\""," * }"," */"," buttonClassNames: {"," value: {"," \"hover\": \"yui3-button-hover\","," \"active\": \"yui3-button-active\","," \"disabled\": \"yui3-button-disabled\","," \"focus\": \"yui3-button-selected\""," }"," },",""," /**"," * The node that serves as the drop target for files."," *"," * @attribute dragAndDropArea"," * @type {Node}"," * @default null"," */"," dragAndDropArea: {"," value: null,"," setter: function (val) {"," return Y.one(val);"," }"," },",""," /**"," * A Boolean indicating whether the uploader is enabled or disabled for user input."," *"," * @attribute enabled"," * @type {Boolean}"," * @default true"," */"," enabled : {"," value: true"," },",""," /**"," * The action performed when an upload error occurs for a specific file being uploaded."," * The possible values are: "," * <ul>"," * <li> <strong>`UploaderQueue.CONTINUE`</strong>: the error is ignored and the upload process is continued.</li>"," * <li> <strong>`UploaderQueue.STOP`</strong>: the upload process is stopped as soon as any other parallel file"," * uploads are finished.</li>"," * <li> <strong>`UploaderQueue.RESTART_ASAP`</strong>: the file is added back to the front of the queue.</li>"," * <li> <strong>`UploaderQueue.RESTART_AFTER`</strong>: the file is added to the back of the queue.</li>"," * </ul>"," * @attribute errorAction"," * @type {String}"," * @default UploaderQueue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val, name) {"," return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER); }"," },",""," /**"," * An array indicating what fileFilters should be applied to the file"," * selection dialog. Each element in the array should be a string"," * indicating the Media (MIME) type for the files that should be supported"," * for selection. The Media type strings should be properly formatted"," * or this parameter will be ignored. Examples of valid strings include: "," * \"audio/*\", \"video/*\", \"application/pdf\", etc. More information"," * on valid Media type strings is available here: "," * http://www.iana.org/assignments/media-types/index.html"," * @attribute fileFilters"," * @type {Array}"," * @default []"," */"," fileFilters: {"," value: []"," },",""," /**"," * A filtering function that is applied to every file selected by the user."," * The function receives the `Y.File` object and must return a Boolean value."," * If a `false` value is returned, the file in question is not added to the"," * list of files to be uploaded."," * Use this function to put limits on file sizes or check the file names for"," * correct extension, but make sure that a server-side check is also performed,"," * since any client-side restrictions are only advisory and can be circumvented."," *"," * @attribute fileFilterFunction"," * @type {Function}"," * @default null"," */"," fileFilterFunction: {"," value: null"," },",""," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */"," fileFieldName: {"," value: \"Filedata\" "," },",""," /**"," * The array of files to be uploaded. All elements in the array"," * must be instances of `Y.File` and be instantiated with an instance"," * of native JavaScript File() class."," *"," * @attribute fileList"," * @type {Array}"," * @default []"," */"," fileList: {"," value: [],"," getter: \"_getFileList\","," setter: \"_setFileList\""," },",""," /**"," * A Boolean indicating whether multiple file selection is enabled."," *"," * @attribute multipleFiles"," * @type {Boolean}"," * @default false"," */"," multipleFiles: {"," value: false"," },",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file. This attribute is only used if no POST variables are specifed"," * in the upload method call."," *"," * @attribute postVarsPerFile"," * @type {Object}"," * @default {}"," */"," postVarsPerFile: {"," value: {}"," },",""," /**"," * The label for the \"Select Files\" widget. This is the value that replaces the"," * `{selectButtonLabel}` token in the `SELECT_FILES_BUTTON` template."," * "," * @attribute selectButtonLabel"," * @type {String}"," * @default \"Select Files\""," */"," selectButtonLabel: {"," value: \"Select Files\""," },",""," /**"," * The widget that serves as the \"Select Files control for the file uploader"," * "," *"," * @attribute selectFilesButton"," * @type {Node | Widget}"," * @default A standard HTML button with YUI CSS Button skin."," */"," selectFilesButton : {"," valueFn: function () {"," return Y.Node.create(substitute(Y.UploaderHTML5.SELECT_FILES_BUTTON, {selectButtonLabel: this.get(\"selectButtonLabel\"),"," tabIndex: this.get(\"tabIndex\")}));"," }"," },",""," /**"," * The number of files that can be uploaded"," * simultaneously if the automatic queue management"," * is used. This value can be in the range between 2"," * and 5."," *"," * @attribute simLimit"," * @type {Number}"," * @default 2"," */"," simLimit: {"," value: 2,"," validator: function (val, name) {"," return (val >= 1 && val <= 5);"," }"," },",""," /**"," * The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */"," uploadURL: {"," value: \"\""," },",""," /**"," * Additional HTTP headers that should be included"," * in the upload request."," *"," *"," * @attribute uploadHeaders"," * @type {Object}"," * @default {}"," */ "," uploadHeaders: {"," value: {}"," },",""," /**"," * A Boolean that specifies whether the file should be"," * uploaded with the appropriate user credentials for the"," * domain. "," *"," * @attribute withCredentials"," * @type {Boolean}"," * @default true"," */ "," withCredentials: {"," value: true"," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */ "," retryCount: {"," value: 3"," }"," }","});","","Y.UploaderHTML5.Queue = UploaderQueue;","","","","}, '3.7.2', {\"requires\": [\"widget\", \"node-event-simulate\", \"substitute\", \"file-html5\", \"uploader-queue\"]});"];+_yuitest_coverage["build/uploader-html5/uploader-html5.js"].code=["YUI.add('uploader-html5', function (Y, NAME) {","",""," /**"," * This module provides a UI for file selection and multiple file upload capability using"," * HTML5 XMLHTTPRequest Level 2 as a transport engine."," * The supported features include: automatic upload queue management, upload progress"," * tracking, drag-and-drop support, server response retrieval and error reporting."," *"," * @module uploader-html5"," */ ","","// Shorthands for the external modules","var substitute = Y.substitute,"," UploaderQueue = Y.Uploader.Queue;",""," /**"," * This module provides a UI for file selection and multiple file upload capability using"," * HTML5 XMLHTTPRequest Level 2 as a transport engine."," * @class UploaderHTML5"," * @extends Widget"," * @constructor"," */","","function UploaderHTML5(config) {"," UploaderHTML5.superclass.constructor.apply ( this, arguments );","}","","","","Y.UploaderHTML5 = Y.extend( UploaderHTML5, Y.Widget, {",""," /**"," * Stored reference to the instance of the file input field used to "," * initiate the file selection dialog."," *"," * @property _fileInputField"," * @type {Node}"," * @protected"," */"," _fileInputField: null,",""," /**"," * Stored reference to the click event binding of the `Select Files`"," * button."," *"," * @property _buttonBinding"," * @type {EventHandle}"," * @protected"," */"," _buttonBinding: null,",""," /**"," * Stored reference to the instance of Uploader.Queue used to manage"," * the upload process. This is a read-only property that only exists"," * during an active upload process. Only one queue can be active at"," * a time; if an upload start is attempted while a queue is active,"," * it will be ignored."," *"," * @property queue"," * @type {Y.Uploader.Queue}"," */"," queue: null,",""," // Y.UploaderHTML5 prototype",""," /**"," * Construction logic executed during UploaderHTML5 instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function () {",""," this._fileInputField = null;"," this.queue = null;"," this._buttonBinding = null;"," this._fileList = [];",""," // Publish available events",""," /**"," * Signals that files have been selected. "," *"," * @event fileselect"," * @param event {Event} The event object for the `fileselect` with the"," * following payload:"," * <dl>"," * <dt>fileList</dt>"," * <dd>An `Array` of files selected by the user, encapsulated"," * in Y.FileHTML5 objects.</dd>"," * </dl>"," */"," this.publish(\"fileselect\");",""," /**"," * Signals that an upload of multiple files has been started. "," *"," * @event uploadstart"," * @param event {Event} The event object for the `uploadstart`."," */"," this.publish(\"uploadstart\");",""," /**"," * Signals that an upload of a specific file has started. "," *"," * @event fileuploadstart"," * @param event {Event} The event object for the `fileuploadstart` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>A reference to the Y.File that dispatched the event.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by Y.File.</dd>"," * </dl>"," */"," this.publish(\"fileuploadstart\");",""," /**"," * Reports on upload progress of a specific file. "," *"," * @event uploadprogress"," * @param event {Event} The event object for the `uploadprogress` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>The pointer to the instance of `Y.File` that dispatched the event.</dd>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file that has been uploaded, out of 100</dd>"," * <dt>originEvent</dt>"," * <dd>The original event dispatched by the HTML5 uploader</dd>"," * </dl>"," */"," this.publish(\"uploadprogress\");",""," /**"," * Reports on the total upload progress of the file list. "," *"," * @event totaluploadprogress"," * @param event {Event} The event object for the `totaluploadprogress` with the"," * following payload:"," * <dl>"," * <dt>bytesLoaded</dt>"," * <dd>The number of bytes of the file list that has been uploaded</dd>"," * <dt>bytesTotal</dt>"," * <dd>The total number of bytes in the file list</dd>"," * <dt>percentLoaded</dt>"," * <dd>The fraction of the file list that has been uploaded, out of 100</dd>"," * </dl>"," */"," this.publish(\"totaluploadprogress\");",""," /**"," * Signals that a single file upload has been completed. "," *"," * @event uploadcomplete"," * @param event {Event} The event object for the `uploadcomplete` with the"," * following payload:"," * <dl>"," * <dt>file</dt>"," * <dd>The pointer to the instance of `Y.File` whose upload has been completed.</dd>"," * <dt>originEvent</dt>"," * <dd>The original event fired by the SWF Uploader</dd>"," * <dt>data</dt>"," * <dd>Data returned by the server.</dd>"," * </dl>"," */"," this.publish(\"uploadcomplete\");",""," /**"," * Signals that the upload process of the entire file list has been completed. "," *"," * @event alluploadscomplete"," * @param event {Event} The event object for the `alluploadscomplete`."," */"," this.publish(\"alluploadscomplete\");",""," /**"," * Signals that a error has occurred in a specific file's upload process. "," *"," * @event uploaderror"," * @param event {Event} The event object for the `uploaderror` with the"," * following payload:"," * <dl>"," * <dt>originEvent</dt>"," * <dd>The original error event fired by the HTML5 Uploader. </dd>"," * <dt>file</dt>"," * <dd>The pointer at the instance of Y.File that returned the error.</dd> "," * <dt>status</dt>"," * <dd>The status reported by the XMLHttpRequest object.</dd>"," * <dt>statusText</dt>"," * <dd>The statusText reported by the XMLHttpRequest object.</dd> "," * </dl>"," */"," this.publish(\"uploaderror\");",""," /**"," * Signals that a dragged object has entered into the uploader's associated drag-and-drop area. "," *"," * @event dragenter"," * @param event {Event} The event object for the `dragenter`."," */"," this.publish(\"dragenter\");",""," /**"," * Signals that an object has been dragged over the uploader's associated drag-and-drop area. "," *"," * @event dragover"," * @param event {Event} The event object for the `dragover`."," */"," this.publish(\"dragover\");",""," /**"," * Signals that an object has been dragged off of the uploader's associated drag-and-drop area. "," *"," * @event dragleave"," * @param event {Event} The event object for the `dragleave`."," */"," this.publish(\"dragleave\");",""," /**"," * Signals that an object has been dropped over the uploader's associated drag-and-drop area. "," *"," * @event drop"," * @param event {Event} The event object for the `drop`."," */"," this.publish(\"drop\");"," "," },",""," /**"," * Create the DOM structure for the UploaderHTML5."," * UploaderHTML5's DOM structure consists of a \"Select Files\" button that can "," * be replaced by the developer's widget of choice; and a hidden file input field"," * that is used to instantiate the File Select dialog."," *"," * @method renderUI"," * @protected"," */"," renderUI : function () {"," var boundingBox = this.get(\"boundingBox\"),"," contentBox = this.get('contentBox'),"," selButton = this.get(\"selectFilesButton\");",""," selButton.setStyles({width:\"100%\", height:\"100%\"});"," contentBox.append(selButton);"," this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);"," contentBox.append(this._fileInputField);"," },",""," /**"," * Binds to the UploaderHTML5 UI and subscribes to the necessary events."," *"," * @method bindUI"," * @protected"," */"," bindUI : function () {",""," this._bindSelectButton();"," this._setMultipleFiles();"," this._setFileFilters();"," this._bindDropArea();"," this._triggerEnabled();",""," this.after(\"multipleFilesChange\", this._setMultipleFiles, this);"," this.after(\"fileFiltersChange\", this._setFileFilters, this);"," this.after(\"enabledChange\", this._triggerEnabled, this);"," this.after(\"selectFilesButtonChange\", this._bindSelectButton, this);"," this.after(\"dragAndDropAreaChange\", this._bindDropArea, this);"," this.after(\"tabIndexChange\", function (ev) {this.get(\"selectFilesButton\").set(\"tabIndex\", this.get(\"tabIndex\"));}, this);"," this._fileInputField.on(\"change\", this._updateFileList, this);",""," this.get(\"selectFilesButton\").set(\"tabIndex\", this.get(\"tabIndex\"));"," },","",""," /**"," * Recreates the file field to null out the previous list of files and"," * thus allow for an identical file list selection."," * "," * @method _rebindFileField"," * @protected"," */"," _rebindFileField : function () {"," this._fileInputField.remove(true);"," this._fileInputField = Y.Node.create(UploaderHTML5.HTML5FILEFIELD_TEMPLATE);"," this.get(\"contentBox\").append(this._fileInputField);"," this._fileInputField.on(\"change\", this._updateFileList, this);"," this._setMultipleFiles();"," this._setFileFilters();"," },","",""," /**"," * Binds the specified drop area's drag and drop events to the"," * uploader's custom handler."," * "," * @method _bindDropArea"," * @protected"," */"," _bindDropArea : function (event) {"," var ev = event || {prevVal: null};",""," if (ev.prevVal !== null) {"," ev.prevVal.detach('drop', this._ddEventHandler);"," ev.prevVal.detach('dragenter', this._ddEventHandler);"," ev.prevVal.detach('dragover', this._ddEventHandler);"," ev.prevVal.detach('dragleave', this._ddEventHandler);"," }",""," var ddArea = this.get(\"dragAndDropArea\");",""," if (ddArea !== null) {"," ddArea.on('drop', this._ddEventHandler, this);"," ddArea.on('dragenter', this._ddEventHandler, this);"," ddArea.on('dragover', this._ddEventHandler, this);"," ddArea.on('dragleave', this._ddEventHandler, this);"," }"," },",""," /**"," * Binds the instantiation of the file select dialog to the current file select"," * control."," * "," * @method _bindSelectButton"," * @protected"," */"," _bindSelectButton : function () {"," this._buttonBinding = this.get(\"selectFilesButton\").on(\"click\", this.openFileSelectDialog, this);"," },",""," /**"," * Handles the drag and drop events from the uploader's specified drop"," * area."," * "," * @method _ddEventHandler"," * @protected"," */"," _ddEventHandler : function (event) {",""," event.stopPropagation();"," event.preventDefault(); "," "," switch (event.type) {"," case \"dragenter\":"," this.fire(\"dragenter\"); "," break;"," case \"dragover\":"," this.fire(\"dragover\");"," break;"," case \"dragleave\": "," this.fire(\"dragleave\");"," break;"," case \"drop\":",""," var newfiles = event._event.dataTransfer.files,"," parsedFiles = [],"," filterFunc = this.get(\"fileFilterFunction\");"," "," if (filterFunc) {"," Y.each(newfiles, function (value) {"," var newfile = new Y.FileHTML5(value);"," if (filterFunc(newfile)) {"," parsedFiles.push(newfile);"," }"," });"," }"," else {"," Y.each(newfiles, function (value) {"," parsedFiles.push(new Y.FileHTML5(value));"," });"," }",""," if (parsedFiles.length > 0) {"," var oldfiles = this.get(\"fileList\");"," this.set(\"fileList\", "," this.get(\"appendNewFiles\") ? oldfiles.concat(parsedFiles) : parsedFiles);"," this.fire(\"fileselect\", {fileList: parsedFiles});"," }",""," this.fire(\"drop\");"," break;"," }"," },",""," /**"," * Adds or removes a specified state CSS class to the underlying uploader button. "," *"," * @method _setButtonClass"," * @protected"," * @param state {String} The name of the state enumerated in `buttonClassNames` attribute"," * from which to derive the needed class name."," * @param add {Boolean} A Boolean indicating whether to add or remove the class."," */"," _setButtonClass : function (state, add) {"," if (add) {"," this.get(\"selectFilesButton\").addClass(this.get(\"buttonClassNames\")[state]);"," }"," else {"," this.get(\"selectFilesButton\").removeClass(this.get(\"buttonClassNames\")[state]);"," }"," },",""," /**"," * Syncs the state of the `multipleFiles` attribute between this class"," * and the file input field."," * "," * @method _setMultipleFiles"," * @protected"," */"," _setMultipleFiles : function () {"," if (this.get(\"multipleFiles\") === true) {"," this._fileInputField.set(\"multiple\", \"multiple\");"," }"," else {"," this._fileInputField.set(\"multiple\", \"\");"," }"," },",""," /**"," * Syncs the state of the `fileFilters` attribute between this class"," * and the file input field."," * "," * @method _setFileFilters"," * @protected"," */"," _setFileFilters : function () {"," if (this.get(\"fileFilters\").length > 0) {"," this._fileInputField.set(\"accept\", this.get(\"fileFilters\").join(\",\"));"," }"," else {"," this._fileInputField.set(\"accept\", \"\");"," }"," },","",""," /**"," * Syncs the state of the `enabled` attribute between this class"," * and the underlying button."," * "," * @method _triggerEnabled"," * @private"," */"," _triggerEnabled : function () {"," if (this.get(\"enabled\") && this._buttonBinding === null) {"," this._bindSelectButton();"," this._setButtonClass(\"disabled\", false);"," this.get(\"selectFilesButton\").setAttribute(\"aria-disabled\", \"false\");"," }"," else if (!this.get(\"enabled\") && this._buttonBinding) {"," this._buttonBinding.detach();"," this._buttonBinding = null;"," this._setButtonClass(\"disabled\", true);"," this.get(\"selectFilesButton\").setAttribute(\"aria-disabled\", \"true\");"," }"," },",""," /**"," * Getter for the `fileList` attribute"," * "," * @method _getFileList"," * @private"," */"," _getFileList : function (arr) {"," return this._fileList.concat();"," },",""," /**"," * Setter for the `fileList` attribute"," * "," * @method _setFileList"," * @private"," */"," _setFileList : function (val) {"," this._fileList = val.concat();"," return this._fileList.concat();"," },",""," /**"," * Adjusts the content of the `fileList` based on the results of file selection"," * and the `appendNewFiles` attribute. If the `appendNewFiles` attribute is true,"," * then selected files are appended to the existing list; otherwise, the list is"," * cleared and populated with the newly selected files."," * "," * @method _updateFileList"," * @param ev {Event} The file selection event received from the uploader."," * @protected"," */"," _updateFileList : function (ev) {"," var newfiles = ev.target.getDOMNode().files,"," parsedFiles = [],"," filterFunc = this.get(\"fileFilterFunction\");",""," if (filterFunc) {"," Y.each(newfiles, function (value) {"," var newfile = new Y.FileHTML5(value);"," if (filterFunc(newfile)) {"," parsedFiles.push(newfile);"," }"," });"," }"," else {"," Y.each(newfiles, function (value) {"," parsedFiles.push(new Y.FileHTML5(value));"," });"," }",""," if (parsedFiles.length > 0) {"," var oldfiles = this.get(\"fileList\");",""," this.set(\"fileList\", "," this.get(\"appendNewFiles\") ? oldfiles.concat(parsedFiles) : parsedFiles );",""," this.fire(\"fileselect\", {fileList: parsedFiles});"," }",""," this._rebindFileField();"," },","",""," /**"," * Handles and retransmits events fired by `Y.File` and `Y.Uploader.Queue`."," * "," * @method _uploadEventHandler"," * @param event The event dispatched during the upload process."," * @protected"," */"," _uploadEventHandler : function (event) {"," "," switch (event.type) {"," case \"file:uploadstart\":"," this.fire(\"fileuploadstart\", event);"," break;"," case \"file:uploadprogress\":"," this.fire(\"uploadprogress\", event);"," break;"," case \"uploaderqueue:totaluploadprogress\":"," this.fire(\"totaluploadprogress\", event);"," break;"," case \"file:uploadcomplete\":"," this.fire(\"uploadcomplete\", event);"," break;"," case \"uploaderqueue:alluploadscomplete\":"," this.queue = null;"," this.fire(\"alluploadscomplete\", event);"," break;"," case \"file:uploaderror\":"," case \"uploaderqueue:uploaderror\":"," this.fire(\"uploaderror\", event);"," break;"," case \"file:uploadcancel\":"," case \"uploaderqueue:uploadcancel\":"," this.fire(\"uploadcancel\", event);"," break;"," } ",""," },",""," /**"," * Opens the File Selection dialog by simulating a click on the file input field."," * "," * @method openFileSelectDialog"," */"," openFileSelectDialog : function () {"," var fileDomNode = this._fileInputField.getDOMNode();"," if (fileDomNode.click) {"," fileDomNode.click();"," } "," },",""," /**"," * Starts the upload of a specific file."," *"," * @method upload"," * @param file {Y.File} Reference to the instance of the file to be uploaded."," * @param url {String} The URL to upload the file to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," upload : function (file, url, postvars) {"," "," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\"),"," fileId = file.get(\"id\");",""," postVars = postVars.hasOwnProperty(fileId) ? postVars[fileId] : postVars;",""," if (file instanceof Y.FileHTML5) {"," "," file.on(\"uploadstart\", this._uploadEventHandler, this);"," file.on(\"uploadprogress\", this._uploadEventHandler, this);"," file.on(\"uploadcomplete\", this._uploadEventHandler, this);"," file.on(\"uploaderror\", this._uploadEventHandler, this);"," file.on(\"uploadcancel\", this._uploadEventHandler, this);",""," file.startUpload(uploadURL, postVars, this.get(\"fileFieldName\"));"," }"," },",""," /**"," * Starts the upload of all files on the file list, using an automated queue."," *"," * @method uploadAll"," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadAll : function (url, postvars) {"," this.uploadThese(this.get(\"fileList\"), url, postvars);"," },",""," /**"," * Starts the upload of the files specified in the first argument, using an automated queue."," *"," * @method uploadThese"," * @param files {Array} The list of files to upload."," * @param url {String} The URL to upload the files to."," * @param postVars {Object} (optional) A set of key-value pairs to send as variables along with the file upload HTTP request."," * If not specified, the values from the attribute `postVarsPerFile` are used instead. "," */"," uploadThese : function (files, url, postvars) {"," if (!this.queue) {"," var uploadURL = url || this.get(\"uploadURL\"),"," postVars = postvars || this.get(\"postVarsPerFile\");",""," this.queue = new UploaderQueue({simUploads: this.get(\"simLimit\"), "," errorAction: this.get(\"errorAction\"),"," fileFieldName: this.get(\"fileFieldName\"),"," fileList: files,"," uploadURL: uploadURL,"," perFileParameters: postVars,"," retryCount: this.get(\"retryCount\"),"," uploadHeaders: this.get(\"uploadHeaders\"),"," withCredentials: this.get(\"withCredentials\")"," });"," this.queue.on(\"uploadstart\", this._uploadEventHandler, this);"," this.queue.on(\"uploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"totaluploadprogress\", this._uploadEventHandler, this);"," this.queue.on(\"uploadcomplete\", this._uploadEventHandler, this);"," this.queue.on(\"alluploadscomplete\", this._uploadEventHandler, this);"," this.queue.on(\"uploadcancel\", this._uploadEventHandler, this);"," this.queue.on(\"uploaderror\", this._uploadEventHandler, this);"," this.queue.startUpload(); "," "," this.fire(\"uploadstart\"); "," }"," else if (this.queue._currentState === UploaderQueue.UPLOADING) {"," this.queue.set(\"perFileParameters\", this.get(\"postVarsPerFile\"));"," Y.each(files, function (file) {"," this.queue.addToQueueBottom(file);"," }, this);"," }"," }","},","","{"," /**"," * The template for the hidden file input field container. The file input field will only"," * accept clicks if its visibility is set to hidden (and will not if it's `display` value"," * is set to `none`)"," *"," * @property HTML5FILEFIELD_TEMPLATE"," * @type {String}"," * @static"," */"," HTML5FILEFIELD_TEMPLATE: \"<input type='file' style='visibility:hidden; width:0px; height: 0px;'>\","," "," /**"," * The template for the \"Select Files\" button."," *"," * @property SELECT_FILES_BUTTON"," * @type {String}"," * @static"," * @default \"<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>\""," */ "," SELECT_FILES_BUTTON: \"<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>\",",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The UploaderHTML5 value is `\"html5\"`."," * "," * @property TYPE"," * @type {String}"," * @static"," */"," TYPE: \"html5\",",""," /**"," * The identity of the widget."," *"," * @property NAME"," * @type String"," * @default 'uploader'"," * @readOnly"," * @protected"," * @static"," */"," NAME: \"uploader\",",""," /**"," * Static property used to define the default attribute configuration of"," * the Widget."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {",""," /**"," * A Boolean indicating whether newly selected files should be appended "," * to the existing file list, or whether they should replace it."," *"," * @attribute appendNewFiles"," * @type {Boolean}"," * @default true"," */"," appendNewFiles : {"," value: true"," },",""," /**"," * The names of CSS classes that correspond to different button states"," * of the \"Select Files\" control. These classes are assigned to the "," * \"Select Files\" control based on the configuration of the uploader."," * Currently, the only class name used is that corresponding to the "," * `disabled` state of the uploader. Other button states should be managed"," * directly via CSS selectors."," * <ul>"," * <li> <strong>`disabled`</strong>: the class corresponding to the disabled state"," * of the \"Select Files\" button.</li>"," * </ul>"," * @attribute buttonClassNames"," * @type {Object}"," * @default {"," * disabled: \"yui3-button-disabled\""," * }"," */"," buttonClassNames: {"," value: {"," \"hover\": \"yui3-button-hover\","," \"active\": \"yui3-button-active\","," \"disabled\": \"yui3-button-disabled\","," \"focus\": \"yui3-button-selected\""," }"," },",""," /**"," * The node that serves as the drop target for files."," *"," * @attribute dragAndDropArea"," * @type {Node}"," * @default null"," */"," dragAndDropArea: {"," value: null,"," setter: function (val) {"," return Y.one(val);"," }"," },",""," /**"," * A Boolean indicating whether the uploader is enabled or disabled for user input."," *"," * @attribute enabled"," * @type {Boolean}"," * @default true"," */"," enabled : {"," value: true"," },",""," /**"," * The action performed when an upload error occurs for a specific file being uploaded."," * The possible values are: "," * <ul>"," * <li> <strong>`UploaderQueue.CONTINUE`</strong>: the error is ignored and the upload process is continued.</li>"," * <li> <strong>`UploaderQueue.STOP`</strong>: the upload process is stopped as soon as any other parallel file"," * uploads are finished.</li>"," * <li> <strong>`UploaderQueue.RESTART_ASAP`</strong>: the file is added back to the front of the queue.</li>"," * <li> <strong>`UploaderQueue.RESTART_AFTER`</strong>: the file is added to the back of the queue.</li>"," * </ul>"," * @attribute errorAction"," * @type {String}"," * @default UploaderQueue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val, name) {"," return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER); }"," },",""," /**"," * An array indicating what fileFilters should be applied to the file"," * selection dialog. Each element in the array should be a string"," * indicating the Media (MIME) type for the files that should be supported"," * for selection. The Media type strings should be properly formatted"," * or this parameter will be ignored. Examples of valid strings include: "," * \"audio/*\", \"video/*\", \"application/pdf\", etc. More information"," * on valid Media type strings is available here: "," * http://www.iana.org/assignments/media-types/index.html"," * @attribute fileFilters"," * @type {Array}"," * @default []"," */"," fileFilters: {"," value: []"," },",""," /**"," * A filtering function that is applied to every file selected by the user."," * The function receives the `Y.File` object and must return a Boolean value."," * If a `false` value is returned, the file in question is not added to the"," * list of files to be uploaded."," * Use this function to put limits on file sizes or check the file names for"," * correct extension, but make sure that a server-side check is also performed,"," * since any client-side restrictions are only advisory and can be circumvented."," *"," * @attribute fileFilterFunction"," * @type {Function}"," * @default null"," */"," fileFilterFunction: {"," value: null"," },",""," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */"," fileFieldName: {"," value: \"Filedata\" "," },",""," /**"," * The array of files to be uploaded. All elements in the array"," * must be instances of `Y.File` and be instantiated with an instance"," * of native JavaScript File() class."," *"," * @attribute fileList"," * @type {Array}"," * @default []"," */"," fileList: {"," value: [],"," getter: \"_getFileList\","," setter: \"_setFileList\""," },",""," /**"," * A Boolean indicating whether multiple file selection is enabled."," *"," * @attribute multipleFiles"," * @type {Boolean}"," * @default false"," */"," multipleFiles: {"," value: false"," },",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file. This attribute is only used if no POST variables are specifed"," * in the upload method call."," *"," * @attribute postVarsPerFile"," * @type {Object}"," * @default {}"," */"," postVarsPerFile: {"," value: {}"," },",""," /**"," * The label for the \"Select Files\" widget. This is the value that replaces the"," * `{selectButtonLabel}` token in the `SELECT_FILES_BUTTON` template."," * "," * @attribute selectButtonLabel"," * @type {String}"," * @default \"Select Files\""," */"," selectButtonLabel: {"," value: \"Select Files\""," },",""," /**"," * The widget that serves as the \"Select Files control for the file uploader"," * "," *"," * @attribute selectFilesButton"," * @type {Node | Widget}"," * @default A standard HTML button with YUI CSS Button skin."," */"," selectFilesButton : {"," valueFn: function () {"," return Y.Node.create(substitute(Y.UploaderHTML5.SELECT_FILES_BUTTON, {selectButtonLabel: this.get(\"selectButtonLabel\"),"," tabIndex: this.get(\"tabIndex\")}));"," }"," },",""," /**"," * The number of files that can be uploaded"," * simultaneously if the automatic queue management"," * is used. This value can be in the range between 2"," * and 5."," *"," * @attribute simLimit"," * @type {Number}"," * @default 2"," */"," simLimit: {"," value: 2,"," validator: function (val, name) {"," return (val >= 1 && val <= 5);"," }"," },",""," /**"," * The URL to which file upload requested are POSTed. Only used if a different url is not passed to the upload method call."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */"," uploadURL: {"," value: \"\""," },",""," /**"," * Additional HTTP headers that should be included"," * in the upload request."," *"," *"," * @attribute uploadHeaders"," * @type {Object}"," * @default {}"," */ "," uploadHeaders: {"," value: {}"," },",""," /**"," * A Boolean that specifies whether the file should be"," * uploaded with the appropriate user credentials for the"," * domain. "," *"," * @attribute withCredentials"," * @type {Boolean}"," * @default true"," */ "," withCredentials: {"," value: true"," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */ "," retryCount: {"," value: 3"," }"," }","});","","Y.UploaderHTML5.Queue = UploaderQueue;","","","","}, '3.7.3', {\"requires\": [\"widget\", \"node-event-simulate\", \"substitute\", \"file-html5\", \"uploader-queue\"]});"]; _yuitest_coverage["build/uploader-html5/uploader-html5.js"].lines = {"1":0,"14":0,"25":0,"26":0,"31":0,"75":0,"76":0,"77":0,"78":0,"94":0,"102":0,"117":0,"138":0,"155":0,"172":0,"180":0,"199":0,"207":0,"215":0,"223":0,"231":0,"245":0,"249":0,"250":0,"251":0,"252":0,"263":0,"264":0,"265":0,"266":0,"267":0,"269":0,"270":0,"271":0,"272":0,"273":0,"274":0,"275":0,"277":0,"289":0,"290":0,"291":0,"292":0,"293":0,"294":0,"306":0,"308":0,"309":0,"310":0,"311":0,"312":0,"315":0,"317":0,"318":0,"319":0,"320":0,"321":0,"333":0,"345":0,"346":0,"348":0,"350":0,"351":0,"353":0,"354":0,"356":0,"357":0,"360":0,"364":0,"365":0,"366":0,"367":0,"368":0,"373":0,"374":0,"378":0,"379":0,"380":0,"382":0,"385":0,"386":0,"400":0,"401":0,"404":0,"416":0,"417":0,"420":0,"432":0,"433":0,"436":0,"449":0,"450":0,"451":0,"452":0,"454":0,"455":0,"456":0,"457":0,"458":0,"469":0,"479":0,"480":0,"494":0,"498":0,"499":0,"500":0,"501":0,"502":0,"507":0,"508":0,"512":0,"513":0,"515":0,"518":0,"521":0,"534":0,"536":0,"537":0,"539":0,"540":0,"542":0,"543":0,"545":0,"546":0,"548":0,"549":0,"550":0,"553":0,"554":0,"557":0,"558":0,"569":0,"570":0,"571":0,"586":0,"590":0,"592":0,"594":0,"595":0,"596":0,"597":0,"598":0,"600":0,"613":0,"626":0,"627":0,"630":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"649":0,"651":0,"652":0,"653":0,"654":0,"763":0,"795":0,"906":0,"924":0,"979":0}; _yuitest_coverage["build/uploader-html5/uploader-html5.js"].functions = {"UploaderHTML5:25":0,"initializer:73":0,"renderUI:244":0,"(anonymous 2):274":0,"bindUI:261":0,"_rebindFileField:288":0,"_bindDropArea:305":0,"_bindSelectButton:332":0,"(anonymous 3):365":0,"(anonymous 4):373":0,"_ddEventHandler:343":0,"_setButtonClass:399":0,"_setMultipleFiles:415":0,"_setFileFilters:431":0,"_triggerEnabled:448":0,"_getFileList:468":0,"_setFileList:478":0,"(anonymous 5):499":0,"(anonymous 6):507":0,"_updateFileList:493":0,"_uploadEventHandler:532":0,"openFileSelectDialog:568":0,"upload:584":0,"uploadAll:612":0,"(anonymous 7):653":0,"uploadThese:625":0,"setter:762":0,"validator:794":0,"valueFn:905":0,"validator:923":0,"(anonymous 1):1":0}; _yuitest_coverage["build/uploader-html5/uploader-html5.js"].coveredLines = 165;@@ -1215,4 +1215,4 @@ -}, '3.7.2', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});+}, '3.7.3', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});
bundle/uploader-html5/uploader-html5-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -986,4 +986,4 @@ -}, '3.7.2', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});+}, '3.7.3', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});
bundle/uploader-html5/uploader-html5-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("uploader-html5",function(e,t){function i(e){i.superclass.constructor.apply(this,arguments)}var n=e.substitute,r=e.Uploader.Queue;e.UploaderHTML5=e.extend(i,e.Widget,{_fileInputField:null,_buttonBinding:null,queue:null,initializer:function(){this._fileInputField=null,this.queue=null,this._buttonBinding=null,this._fileList=[],this.publish("fileselect"),this.publish("uploadstart"),this.publish("fileuploadstart"),this.publish("uploadprogress"),this.publish("totaluploadprogress"),this.publish("uploadcomplete"),this.publish("alluploadscomplete"),this.publish("uploaderror"),this.publish("dragenter"),this.publish("dragover"),this.publish("dragleave"),this.publish("drop")},renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("selectFilesButton");r.setStyles({width:"100%",height:"100%"}),n.append(r),this._fileInputField=e.Node.create(i.HTML5FILEFIELD_TEMPLATE),n.append(this._fileInputField)},bindUI:function(){this._bindSelectButton(),this._setMultipleFiles(),this._setFileFilters(),this._bindDropArea(),this._triggerEnabled(),this.after("multipleFilesChange",this._setMultipleFiles,this),this.after("fileFiltersChange",this._setFileFilters,this),this.after("enabledChange",this._triggerEnabled,this),this.after("selectFilesButtonChange",this._bindSelectButton,this),this.after("dragAndDropAreaChange",this._bindDropArea,this),this.after("tabIndexChange",function(e){this.get("selectFilesButton").set("tabIndex",this.get("tabIndex"))},this),this._fileInputField.on("change",this._updateFileList,this),this.get("selectFilesButton").set("tabIndex",this.get("tabIndex"))},_rebindFileField:function(){this._fileInputField.remove(!0),this._fileInputField=e.Node.create(i.HTML5FILEFIELD_TEMPLATE),this.get("contentBox").append(this._fileInputField),this._fileInputField.on("change",this._updateFileList,this),this._setMultipleFiles(),this._setFileFilters()},_bindDropArea:function(e){var t=e||{prevVal:null};t.prevVal!==null&&(t.prevVal.detach("drop",this._ddEventHandler),t.prevVal.detach("dragenter",this._ddEventHandler),t.prevVal.detach("dragover",this._ddEventHandler),t.prevVal.detach("dragleave",this._ddEventHandler));var n=this.get("dragAndDropArea");n!==null&&(n.on("drop",this._ddEventHandler,this),n.on("dragenter",this._ddEventHandler,this),n.on("dragover",this._ddEventHandler,this),n.on("dragleave",this._ddEventHandler,this))},_bindSelectButton:function(){this._buttonBinding=this.get("selectFilesButton").on("click",this.openFileSelectDialog,this)},_ddEventHandler:function(t){t.stopPropagation(),t.preventDefault();switch(t.type){case"dragenter":this.fire("dragenter");break;case"dragover":this.fire("dragover");break;case"dragleave":this.fire("dragleave");break;case"drop":var n=t._event.dataTransfer.files,r=[],i=this.get("fileFilterFunction");i?e.each(n,function(t){var n=new e.FileHTML5(t);i(n)&&r.push(n)}):e.each(n,function(t){r.push(new e.FileHTML5(t))});if(r.length>0){var s=this.get("fileList");this.set("fileList",this.get("appendNewFiles")?s.concat(r):r),this.fire("fileselect",{fileList:r})}this.fire("drop")}},_setButtonClass:function(e,t){t?this.get("selectFilesButton").addClass(this.get("buttonClassNames")[e]):this.get("selectFilesButton").removeClass(this.get("buttonClassNames")[e])},_setMultipleFiles:function(){this.get("multipleFiles")===!0?this._fileInputField.set("multiple","multiple"):this._fileInputField.set("multiple","")},_setFileFilters:function(){this.get("fileFilters").length>0?this._fileInputField.set("accept",this.get("fileFilters").join(",")):this._fileInputField.set("accept","")},_triggerEnabled:function(){this.get("enabled")&&this._buttonBinding===null?(this._bindSelectButton(),this._setButtonClass("disabled",!1),this.get("selectFilesButton").setAttribute("aria-disabled","false")):!this.get("enabled")&&this._buttonBinding&&(this._buttonBinding.detach(),this._buttonBinding=null,this._setButtonClass("disabled",!0),this.get("selectFilesButton").setAttribute("aria-disabled","true"))},_getFileList:function(e){return this._fileList.concat()},_setFileList:function(e){return this._fileList=e.concat(),this._fileList.concat()},_updateFileList:function(t){var n=t.target.getDOMNode().files,r=[],i=this.get("fileFilterFunction");i?e.each(n,function(t){var n=new e.FileHTML5(t);i(n)&&r.push(n)}):e.each(n,function(t){r.push(new e.FileHTML5(t))});if(r.length>0){var s=this.get("fileList");this.set("fileList",this.get("appendNewFiles")?s.concat(r):r),this.fire("fileselect",{fileList:r})}this._rebindFileField()},_uploadEventHandler:function(e){switch(e.type){case"file:uploadstart":this.fire("fileuploadstart",e);break;case"file:uploadprogress":this.fire("uploadprogress",e);break;case"uploaderqueue:totaluploadprogress":this.fire("totaluploadprogress",e);break;case"file:uploadcomplete":this.fire("uploadcomplete",e);break;case"uploaderqueue:alluploadscomplete":this.queue=null,this.fire("alluploadscomplete",e);break;case"file:uploaderror":case"uploaderqueue:uploaderror":this.fire("uploaderror",e);break;case"file:uploadcancel":case"uploaderqueue:uploadcancel":this.fire("uploadcancel",e)}},openFileSelectDialog:function(){var e=this._fileInputField.getDOMNode();e.click&&e.click()},upload:function(t,n,r){var i=n||this.get("uploadURL"),s=r||this.get("postVarsPerFile"),o=t.get("id");s=s.hasOwnProperty(o)?s[o]:s,t instanceof e.FileHTML5&&(t.on("uploadstart",this._uploadEventHandler,this),t.on("uploadprogress",this._uploadEventHandler,this),t.on("uploadcomplete",this._uploadEventHandler,this),t.on("uploaderror",this._uploadEventHandler,this),t.on("uploadcancel",this._uploadEventHandler,this),t.startUpload(i,s,this.get("fileFieldName")))},uploadAll:function(e,t){this.uploadThese(this.get("fileList"),e,t)},uploadThese:function(t,n,i){if(!this.queue){var s=n||this.get("uploadURL"),o=i||this.get("postVarsPerFile");this.queue=new r({simUploads:this.get("simLimit"),errorAction:this.get("errorAction"),fileFieldName:this.get("fileFieldName"),fileList:t,uploadURL:s,perFileParameters:o,retryCount:this.get("retryCount"),uploadHeaders:this.get("uploadHeaders"),withCredentials:this.get("withCredentials")}),this.queue.on("uploadstart",this._uploadEventHandler,this),this.queue.on("uploadprogress",this._uploadEventHandler,this),this.queue.on("totaluploadprogress",this._uploadEventHandler,this),this.queue.on("uploadcomplete",this._uploadEventHandler,this),this.queue.on("alluploadscomplete",this._uploadEventHandler,this),this.queue.on("uploadcancel",this._uploadEventHandler,this),this.queue.on("uploaderror",this._uploadEventHandler,this),this.queue.startUpload(),this.fire("uploadstart")}else this.queue._currentState===r.UPLOADING&&(this.queue.set("perFileParameters",this.get("postVarsPerFile")),e.each(t,function(e){this.queue.addToQueueBottom(e)},this))}},{HTML5FILEFIELD_TEMPLATE:"<input type='file' style='visibility:hidden; width:0px; height: 0px;'>",SELECT_FILES_BUTTON:"<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>",TYPE:"html5",NAME:"uploader",ATTRS:{appendNewFiles:{value:!0},buttonClassNames:{value:{hover:"yui3-button-hover",active:"yui3-button-active",disabled:"yui3-button-disabled",focus:"yui3-button-selected"}},dragAndDropArea:{value:null,setter:function(t){return e.one(t)}},enabled:{value:!0},errorAction:{value:"continue",validator:function(e,t){return e===r.CONTINUE||e===r.STOP||e===r.RESTART_ASAP||e===r.RESTART_AFTER}},fileFilters:{value:[]},fileFilterFunction:{value:null},fileFieldName:{value:"Filedata"},fileList:{value:[],getter:"_getFileList",setter:"_setFileList"},multipleFiles:{value:!1},postVarsPerFile:{value:{}},selectButtonLabel:{value:"Select Files"},selectFilesButton:{valueFn:function(){return e.Node.create(n(e.UploaderHTML5.SELECT_FILES_BUTTON,{selectButtonLabel:this.get("selectButtonLabel"),tabIndex:this.get("tabIndex")}))}},simLimit:{value:2,validator:function(e,t){return e>=1&&e<=5}},uploadURL:{value:""},uploadHeaders:{value:{}},withCredentials:{value:!0},retryCount:{value:3}}}),e.UploaderHTML5.Queue=r},"3.7.2",{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]});+YUI.add("uploader-html5",function(e,t){function i(e){i.superclass.constructor.apply(this,arguments)}var n=e.substitute,r=e.Uploader.Queue;e.UploaderHTML5=e.extend(i,e.Widget,{_fileInputField:null,_buttonBinding:null,queue:null,initializer:function(){this._fileInputField=null,this.queue=null,this._buttonBinding=null,this._fileList=[],this.publish("fileselect"),this.publish("uploadstart"),this.publish("fileuploadstart"),this.publish("uploadprogress"),this.publish("totaluploadprogress"),this.publish("uploadcomplete"),this.publish("alluploadscomplete"),this.publish("uploaderror"),this.publish("dragenter"),this.publish("dragover"),this.publish("dragleave"),this.publish("drop")},renderUI:function(){var t=this.get("boundingBox"),n=this.get("contentBox"),r=this.get("selectFilesButton");r.setStyles({width:"100%",height:"100%"}),n.append(r),this._fileInputField=e.Node.create(i.HTML5FILEFIELD_TEMPLATE),n.append(this._fileInputField)},bindUI:function(){this._bindSelectButton(),this._setMultipleFiles(),this._setFileFilters(),this._bindDropArea(),this._triggerEnabled(),this.after("multipleFilesChange",this._setMultipleFiles,this),this.after("fileFiltersChange",this._setFileFilters,this),this.after("enabledChange",this._triggerEnabled,this),this.after("selectFilesButtonChange",this._bindSelectButton,this),this.after("dragAndDropAreaChange",this._bindDropArea,this),this.after("tabIndexChange",function(e){this.get("selectFilesButton").set("tabIndex",this.get("tabIndex"))},this),this._fileInputField.on("change",this._updateFileList,this),this.get("selectFilesButton").set("tabIndex",this.get("tabIndex"))},_rebindFileField:function(){this._fileInputField.remove(!0),this._fileInputField=e.Node.create(i.HTML5FILEFIELD_TEMPLATE),this.get("contentBox").append(this._fileInputField),this._fileInputField.on("change",this._updateFileList,this),this._setMultipleFiles(),this._setFileFilters()},_bindDropArea:function(e){var t=e||{prevVal:null};t.prevVal!==null&&(t.prevVal.detach("drop",this._ddEventHandler),t.prevVal.detach("dragenter",this._ddEventHandler),t.prevVal.detach("dragover",this._ddEventHandler),t.prevVal.detach("dragleave",this._ddEventHandler));var n=this.get("dragAndDropArea");n!==null&&(n.on("drop",this._ddEventHandler,this),n.on("dragenter",this._ddEventHandler,this),n.on("dragover",this._ddEventHandler,this),n.on("dragleave",this._ddEventHandler,this))},_bindSelectButton:function(){this._buttonBinding=this.get("selectFilesButton").on("click",this.openFileSelectDialog,this)},_ddEventHandler:function(t){t.stopPropagation(),t.preventDefault();switch(t.type){case"dragenter":this.fire("dragenter");break;case"dragover":this.fire("dragover");break;case"dragleave":this.fire("dragleave");break;case"drop":var n=t._event.dataTransfer.files,r=[],i=this.get("fileFilterFunction");i?e.each(n,function(t){var n=new e.FileHTML5(t);i(n)&&r.push(n)}):e.each(n,function(t){r.push(new e.FileHTML5(t))});if(r.length>0){var s=this.get("fileList");this.set("fileList",this.get("appendNewFiles")?s.concat(r):r),this.fire("fileselect",{fileList:r})}this.fire("drop")}},_setButtonClass:function(e,t){t?this.get("selectFilesButton").addClass(this.get("buttonClassNames")[e]):this.get("selectFilesButton").removeClass(this.get("buttonClassNames")[e])},_setMultipleFiles:function(){this.get("multipleFiles")===!0?this._fileInputField.set("multiple","multiple"):this._fileInputField.set("multiple","")},_setFileFilters:function(){this.get("fileFilters").length>0?this._fileInputField.set("accept",this.get("fileFilters").join(",")):this._fileInputField.set("accept","")},_triggerEnabled:function(){this.get("enabled")&&this._buttonBinding===null?(this._bindSelectButton(),this._setButtonClass("disabled",!1),this.get("selectFilesButton").setAttribute("aria-disabled","false")):!this.get("enabled")&&this._buttonBinding&&(this._buttonBinding.detach(),this._buttonBinding=null,this._setButtonClass("disabled",!0),this.get("selectFilesButton").setAttribute("aria-disabled","true"))},_getFileList:function(e){return this._fileList.concat()},_setFileList:function(e){return this._fileList=e.concat(),this._fileList.concat()},_updateFileList:function(t){var n=t.target.getDOMNode().files,r=[],i=this.get("fileFilterFunction");i?e.each(n,function(t){var n=new e.FileHTML5(t);i(n)&&r.push(n)}):e.each(n,function(t){r.push(new e.FileHTML5(t))});if(r.length>0){var s=this.get("fileList");this.set("fileList",this.get("appendNewFiles")?s.concat(r):r),this.fire("fileselect",{fileList:r})}this._rebindFileField()},_uploadEventHandler:function(e){switch(e.type){case"file:uploadstart":this.fire("fileuploadstart",e);break;case"file:uploadprogress":this.fire("uploadprogress",e);break;case"uploaderqueue:totaluploadprogress":this.fire("totaluploadprogress",e);break;case"file:uploadcomplete":this.fire("uploadcomplete",e);break;case"uploaderqueue:alluploadscomplete":this.queue=null,this.fire("alluploadscomplete",e);break;case"file:uploaderror":case"uploaderqueue:uploaderror":this.fire("uploaderror",e);break;case"file:uploadcancel":case"uploaderqueue:uploadcancel":this.fire("uploadcancel",e)}},openFileSelectDialog:function(){var e=this._fileInputField.getDOMNode();e.click&&e.click()},upload:function(t,n,r){var i=n||this.get("uploadURL"),s=r||this.get("postVarsPerFile"),o=t.get("id");s=s.hasOwnProperty(o)?s[o]:s,t instanceof e.FileHTML5&&(t.on("uploadstart",this._uploadEventHandler,this),t.on("uploadprogress",this._uploadEventHandler,this),t.on("uploadcomplete",this._uploadEventHandler,this),t.on("uploaderror",this._uploadEventHandler,this),t.on("uploadcancel",this._uploadEventHandler,this),t.startUpload(i,s,this.get("fileFieldName")))},uploadAll:function(e,t){this.uploadThese(this.get("fileList"),e,t)},uploadThese:function(t,n,i){if(!this.queue){var s=n||this.get("uploadURL"),o=i||this.get("postVarsPerFile");this.queue=new r({simUploads:this.get("simLimit"),errorAction:this.get("errorAction"),fileFieldName:this.get("fileFieldName"),fileList:t,uploadURL:s,perFileParameters:o,retryCount:this.get("retryCount"),uploadHeaders:this.get("uploadHeaders"),withCredentials:this.get("withCredentials")}),this.queue.on("uploadstart",this._uploadEventHandler,this),this.queue.on("uploadprogress",this._uploadEventHandler,this),this.queue.on("totaluploadprogress",this._uploadEventHandler,this),this.queue.on("uploadcomplete",this._uploadEventHandler,this),this.queue.on("alluploadscomplete",this._uploadEventHandler,this),this.queue.on("uploadcancel",this._uploadEventHandler,this),this.queue.on("uploaderror",this._uploadEventHandler,this),this.queue.startUpload(),this.fire("uploadstart")}else this.queue._currentState===r.UPLOADING&&(this.queue.set("perFileParameters",this.get("postVarsPerFile")),e.each(t,function(e){this.queue.addToQueueBottom(e)},this))}},{HTML5FILEFIELD_TEMPLATE:"<input type='file' style='visibility:hidden; width:0px; height: 0px;'>",SELECT_FILES_BUTTON:"<button type='button' class='yui3-button' role='button' aria-label='{selectButtonLabel}' tabindex='{tabIndex}'>{selectButtonLabel}</button>",TYPE:"html5",NAME:"uploader",ATTRS:{appendNewFiles:{value:!0},buttonClassNames:{value:{hover:"yui3-button-hover",active:"yui3-button-active",disabled:"yui3-button-disabled",focus:"yui3-button-selected"}},dragAndDropArea:{value:null,setter:function(t){return e.one(t)}},enabled:{value:!0},errorAction:{value:"continue",validator:function(e,t){return e===r.CONTINUE||e===r.STOP||e===r.RESTART_ASAP||e===r.RESTART_AFTER}},fileFilters:{value:[]},fileFilterFunction:{value:null},fileFieldName:{value:"Filedata"},fileList:{value:[],getter:"_getFileList",setter:"_setFileList"},multipleFiles:{value:!1},postVarsPerFile:{value:{}},selectButtonLabel:{value:"Select Files"},selectFilesButton:{valueFn:function(){return e.Node.create(n(e.UploaderHTML5.SELECT_FILES_BUTTON,{selectButtonLabel:this.get("selectButtonLabel"),tabIndex:this.get("tabIndex")}))}},simLimit:{value:2,validator:function(e,t){return e>=1&&e<=5}},uploadURL:{value:""},uploadHeaders:{value:{}},withCredentials:{value:!0},retryCount:{value:3}}}),e.UploaderHTML5.Queue=r},"3.7.3",{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]});
bundle/uploader-html5/uploader-html5.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -986,4 +986,4 @@ -}, '3.7.2', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});+}, '3.7.3', {"requires": ["widget", "node-event-simulate", "substitute", "file-html5", "uploader-queue"]});
bundle/uploader-queue/assets/uploader-flash-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/uploader-queue/uploader-queue-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/uploader-queue/uploader-queue.js", code: [] };-_yuitest_coverage["build/uploader-queue/uploader-queue.js"].code=["YUI.add('uploader-queue', function (Y, NAME) {","",""," /**"," * The class manages a queue of files that should be uploaded to the server."," * It initializes the required number of uploads, tracks them as they progress,"," * and automatically advances to the next upload when a preceding one has completed."," * @module uploader-queue"," */ ",""," var Lang = Y.Lang,"," Bind = Y.bind,"," Win = Y.config.win,"," queuedFiles,"," numberOfUploads, "," currentUploadedByteValues,"," currentFiles,"," totalBytesUploaded,"," totalBytes;",""," /**"," * This class manages a queue of files to be uploaded to the server."," * @class Uploader.Queue"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object"," */"," var UploaderQueue = function(o) {"," this.queuedFiles = [];"," this.uploadRetries = {};"," this.numberOfUploads = 0;"," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," this.totalBytes = 0; "," "," UploaderQueue.superclass.constructor.apply(this, arguments);"," };","",""," Y.extend(UploaderQueue, Y.Base, {",""," /**"," * Stored value of the current queue state"," * @property _currentState"," * @type {String}"," * @protected"," * @default UploaderQueue.STOPPED"," */"," _currentState: UploaderQueue.STOPPED,",""," /**"," * Construction logic executed during UploaderQueue instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {",""," },",""," /**"," * Handles and retransmits upload start event."," * "," * @method _uploadStartHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadStartHandler : function (event) {"," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;"," "," this.fire(\"uploadstart\", updatedEvent); "," },",""," /**"," * Handles and retransmits upload error event."," * "," * @method _uploadErrorHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadErrorHandler : function (event) {"," var errorAction = this.get(\"errorAction\");"," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," this.numberOfUploads-=1;"," delete this.currentFiles[event.target.get(\"id\")];"," this._detachFileEvents(event.target);",""," event.target.cancelUpload();",""," if (errorAction === UploaderQueue.STOP) {"," this.pauseUpload();"," }",""," else if (errorAction === UploaderQueue.RESTART_ASAP) {"," var fileid = event.target.get(\"id\"),"," retries = this.uploadRetries[fileid] || 0;"," if (retries < this.get(\"retryCount\")) {"," this.uploadRetries[fileid] = retries + 1;"," this.addToQueueTop(event.target);"," }"," this._startNextFile();"," }"," else if (errorAction === UploaderQueue.RESTART_AFTER) {"," var fileid = event.target.get(\"id\"),"," retries = this.uploadRetries[fileid] || 0;"," if (retries < this.get(\"retryCount\")) {"," this.uploadRetries[fileid] = retries + 1;"," this.addToQueueBottom(event.target);"," }"," this._startNextFile();"," }",""," this.fire(\"uploaderror\", updatedEvent); "," },",""," /**"," * Launches the upload of the next file in the queue."," * "," * @method _startNextFile"," * @private"," */"," _startNextFile : function () {"," if (this.queuedFiles.length > 0) {"," var currentFile = this.queuedFiles.shift(),"," fileId = currentFile.get(\"id\"),"," parameters = this.get(\"perFileParameters\"),"," fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;",""," this.currentUploadedByteValues[fileId] = 0;",""," currentFile.on(\"uploadstart\", this._uploadStartHandler, this);"," currentFile.on(\"uploadprogress\", this._uploadProgressHandler, this);"," currentFile.on(\"uploadcomplete\", this._uploadCompleteHandler, this);"," currentFile.on(\"uploaderror\", this._uploadErrorHandler, this);"," currentFile.on(\"uploadcancel\", this._uploadCancelHandler, this);",""," currentFile.set(\"xhrHeaders\", this.get(\"uploadHeaders\"));"," currentFile.set(\"xhrWithCredentials\", this.get(\"withCredentials\"));",""," currentFile.startUpload(this.get(\"uploadURL\"), fileParameters, this.get(\"fileFieldName\"));",""," this._registerUpload(currentFile);"," }"," },",""," /**"," * Register a new upload process."," * "," * @method _registerUpload"," * @private"," */"," _registerUpload : function (file) {"," this.numberOfUploads += 1;"," this.currentFiles[file.get(\"id\")] = file;"," },",""," /**"," * Unregisters a new upload process."," * "," * @method _unregisterUpload"," * @private"," */"," _unregisterUpload : function (file) {"," if (this.numberOfUploads > 0) {"," this.numberOfUploads -=1;"," }"," delete this.currentFiles[file.get(\"id\")];"," delete this.uploadRetries[file.get(\"id\")];",""," this._detachFileEvents(file);"," },",""," _detachFileEvents : function (file) {"," file.detach(\"uploadstart\", this._uploadStartHandler);"," file.detach(\"uploadprogress\", this._uploadProgressHandler);"," file.detach(\"uploadcomplete\", this._uploadCompleteHandler);"," file.detach(\"uploaderror\", this._uploadErrorHandler);"," file.detach(\"uploadcancel\", this._uploadCancelHandler);"," },",""," /**"," * Handles and retransmits upload complete event."," * "," * @method _uploadCompleteHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadCompleteHandler : function (event) {",""," this._unregisterUpload(event.target);",""," this.totalBytesUploaded += event.target.get(\"size\");"," delete this.currentUploadedByteValues[event.target.get(\"id\")];","",""," if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {"," this._startNextFile();"," }"," "," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," var uploadedTotal = this.totalBytesUploaded;",""," Y.each(this.currentUploadedByteValues, function (value) {"," uploadedTotal += value; "," });"," "," var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100); "," "," this.fire(\"totaluploadprogress\", {bytesLoaded: uploadedTotal, "," bytesTotal: this.totalBytes,"," percentLoaded: percentLoaded});",""," this.fire(\"uploadcomplete\", updatedEvent);",""," if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {"," this.fire(\"alluploadscomplete\");"," this._currentState = UploaderQueue.STOPPED;"," }","",""," },",""," /**"," * Handles and retransmits upload cancel event."," * "," * @method _uploadCancelHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadCancelHandler : function (event) {"," "," var updatedEvent = event;"," updatedEvent.originEvent = event;"," updatedEvent.file = event.target;",""," this.fire(\"uploadcacel\", updatedEvent);"," },","","",""," /**"," * Handles and retransmits upload progress event."," * "," * @method _uploadProgressHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadProgressHandler : function (event) {"," "," this.currentUploadedByteValues[event.target.get(\"id\")] = event.bytesLoaded;"," "," var updatedEvent = event;"," updatedEvent.originEvent = event;"," updatedEvent.file = event.target;",""," this.fire(\"uploadprogress\", updatedEvent);"," "," var uploadedTotal = this.totalBytesUploaded;",""," Y.each(this.currentUploadedByteValues, function (value) {"," uploadedTotal += value; "," });"," "," var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);",""," this.fire(\"totaluploadprogress\", {bytesLoaded: uploadedTotal, "," bytesTotal: this.totalBytes,"," percentLoaded: percentLoaded});"," },",""," /**"," * Starts uploading the queued up file list."," * "," * @method startUpload"," */"," startUpload: function() {"," "," this.queuedFiles = this.get(\"fileList\").slice(0);"," this.numberOfUploads = 0;"," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," "," this._currentState = UploaderQueue.UPLOADING;",""," while (this.numberOfUploads < this.get(\"simUploads\") && this.queuedFiles.length > 0) {"," this._startNextFile();"," }"," },",""," /**"," * Pauses the upload process. The ongoing file uploads"," * will complete after this method is called, but no"," * new ones will be launched."," * "," * @method pauseUpload"," */"," pauseUpload: function () {"," this._currentState = UploaderQueue.STOPPED;"," },",""," /**"," * Restarts a paused upload process."," * "," * @method restartUpload"," */"," restartUpload: function () {"," this._currentState = UploaderQueue.UPLOADING;"," while (this.numberOfUploads < this.get(\"simUploads\")) {"," this._startNextFile();"," }"," },",""," /**"," * If a particular file is stuck in an ongoing upload without"," * any progress events, this method allows to force its reupload"," * by cancelling its upload and immediately relaunching it."," * "," * @method forceReupload"," * @param file {Y.File} The file to force reupload on."," */"," forceReupload : function (file) {"," var id = file.get(\"id\");"," if (this.currentFiles.hasOwnProperty(id)) {"," file.cancelUpload();"," this._unregisterUpload(file);"," this.addToQueueTop(file);"," this._startNextFile();"," }"," },",""," /**"," * Add a new file to the top of the queue (the upload will be"," * launched as soon as the current number of uploading files"," * drops below the maximum permissible value)."," * "," * @method addToQueueTop"," * @param file {Y.File} The file to add to the top of the queue."," */"," addToQueueTop: function (file) {"," this.queuedFiles.unshift(file);"," },",""," /**"," * Add a new file to the bottom of the queue (the upload will be"," * launched after all the other queued files are uploaded.)"," * "," * @method addToQueueBottom"," * @param file {Y.File} The file to add to the bottom of the queue."," */"," addToQueueBottom: function (file) {"," this.queuedFiles.push(file);"," },",""," /**"," * Cancels a specific file's upload. If no argument is passed,"," * all ongoing uploads are cancelled and the upload process is"," * stopped."," * "," * @method cancelUpload"," * @param file {Y.File} An optional parameter - the file whose upload"," * should be cancelled."," */"," cancelUpload: function (file) {",""," if (file) {"," var id = file.get(\"id\");"," if (this.currentFiles[id]) {"," this.currentFiles[id].cancelUpload();"," this._unregisterUpload(this.currentFiles[id]);"," if (this._currentState === UploaderQueue.UPLOADING) {"," this._startNextFile();"," }"," }"," else {"," for (var i = 0, len = this.queuedFiles.length; i < len; i++) {"," if (this.queuedFiles[i].get(\"id\") === id) {"," this.queuedFiles.splice(i, 1);"," break;"," }"," }"," }"," }"," else {"," for (var fid in this.currentFiles) {"," this.currentFiles[fid].cancelUpload();"," this._unregisterUpload(this.currentFiles[fid]);"," }",""," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," this.fire(\"alluploadscancelled\");"," this._currentState = UploaderQueue.STOPPED;"," }"," }"," }, ",""," {"," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to continue uploading files in case of "," * an error."," * @property CONTINUE"," * @readOnly"," * @type {String}"," * @static"," */"," CONTINUE: \"continue\",",""," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to stop uploading files in case of "," * an error."," * @property STOP"," * @readOnly"," * @type {String}"," * @static"," */"," STOP: \"stop\",",""," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to restart a file upload immediately in case of "," * an error."," * @property RESTART_ASAP"," * @readOnly"," * @type {String}"," * @static"," */"," RESTART_ASAP: \"restartasap\",",""," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to restart an errored out file upload after "," * other files have finished uploading."," * @property RESTART_AFTER"," * @readOnly"," * @type {String}"," * @static"," */"," RESTART_AFTER: \"restartafter\",",""," /** "," * Static constant for the value of the `_currentState` property:"," * implies that the queue is currently not uploading files."," * @property STOPPED"," * @readOnly"," * @type {String}"," * @static"," */"," STOPPED: \"stopped\",",""," /** "," * Static constant for the value of the `_currentState` property:"," * implies that the queue is currently uploading files."," * @property UPLOADING"," * @readOnly"," * @type {String}"," * @static"," */"," UPLOADING: \"uploading\",",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'uploaderqueue'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'uploaderqueue',",""," /**"," * Static property used to define the default attribute configuration of"," * the class."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," "," /**"," * Maximum number of simultaneous uploads; must be in the"," * range between 1 and 5. The value of `2` is default. It"," * is recommended that this value does not exceed 3."," * @property simUploads"," * @type Number"," * @default 2"," */"," simUploads: {"," value: 2,"," validator: function (val, name) {"," return (val >= 1 && val <= 5);"," }"," },"," "," /**"," * The action to take in case of error. The valid values for this attribute are: "," * `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files, "," * ignoring the error), `Y.Uploader.Queue.STOP` (the upload process "," * should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload "," * should restart immediately on the errored out file and continue as planned), or"," * Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart"," * after all other files have uploaded)"," * @property errorAction"," * @type String"," * @default Y.Uploader.Queue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val, name) {"," return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER);"," }"," },",""," /**"," * The total number of bytes that has been uploaded."," * @property bytesUploaded"," * @type Number"," */ "," bytesUploaded: {"," readOnly: true,"," value: 0"," },"," "," /**"," * The total number of bytes in the queue."," * @property bytesTotal"," * @type Number"," */ "," bytesTotal: {"," readOnly: true,"," value: 0"," },",""," /**"," * The queue file list. This file list should only be modified"," * before the upload has been started; modifying it after starting"," * the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods"," * should be used instead."," * @property fileList"," * @type Number"," */ "," fileList: {"," value: [],"," lazyAdd: false,"," setter: function (val) {"," var newValue = val;"," Y.Array.each(newValue, function (value) {"," this.totalBytes += value.get(\"size\");"," }, this);"," "," return val;"," } "," },",""," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */ "," fileFieldName: {"," value: \"Filedata\""," },",""," /**"," * The URL to POST the file upload requests to."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */ "," uploadURL: {"," value: \"\""," },",""," /**"," * Additional HTTP headers that should be included"," * in the upload request. Due to Flash Player security"," * restrictions, this attribute is only honored in the"," * HTML5 Uploader."," *"," * @attribute uploadHeaders"," * @type {Object}"," * @default {}"," */ "," uploadHeaders: {"," value: {}"," },",""," /**"," * A Boolean that specifies whether the file should be"," * uploaded with the appropriate user credentials for the"," * domain. Due to Flash Player security restrictions, this"," * attribute is only honored in the HTML5 Uploader."," *"," * @attribute withCredentials"," * @type {Boolean}"," * @default true"," */ "," withCredentials: {"," value: true"," },","",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file."," *"," * @attribute perFileParameters"," * @type {Object}"," * @default {}"," */ "," perFileParameters: {"," value: {}"," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */ "," retryCount: {"," value: 3"," }",""," }"," });","",""," Y.namespace('Uploader');"," Y.Uploader.Queue = UploaderQueue;","","}, '3.7.2', {\"requires\": [\"base\"]});"];+_yuitest_coverage["build/uploader-queue/uploader-queue.js"].code=["YUI.add('uploader-queue', function (Y, NAME) {","",""," /**"," * The class manages a queue of files that should be uploaded to the server."," * It initializes the required number of uploads, tracks them as they progress,"," * and automatically advances to the next upload when a preceding one has completed."," * @module uploader-queue"," */ ",""," var Lang = Y.Lang,"," Bind = Y.bind,"," Win = Y.config.win,"," queuedFiles,"," numberOfUploads, "," currentUploadedByteValues,"," currentFiles,"," totalBytesUploaded,"," totalBytes;",""," /**"," * This class manages a queue of files to be uploaded to the server."," * @class Uploader.Queue"," * @extends Base"," * @constructor"," * @param {Object} config Configuration object"," */"," var UploaderQueue = function(o) {"," this.queuedFiles = [];"," this.uploadRetries = {};"," this.numberOfUploads = 0;"," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," this.totalBytes = 0; "," "," UploaderQueue.superclass.constructor.apply(this, arguments);"," };","",""," Y.extend(UploaderQueue, Y.Base, {",""," /**"," * Stored value of the current queue state"," * @property _currentState"," * @type {String}"," * @protected"," * @default UploaderQueue.STOPPED"," */"," _currentState: UploaderQueue.STOPPED,",""," /**"," * Construction logic executed during UploaderQueue instantiation."," *"," * @method initializer"," * @protected"," */"," initializer : function (cfg) {",""," },",""," /**"," * Handles and retransmits upload start event."," * "," * @method _uploadStartHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadStartHandler : function (event) {"," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;"," "," this.fire(\"uploadstart\", updatedEvent); "," },",""," /**"," * Handles and retransmits upload error event."," * "," * @method _uploadErrorHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadErrorHandler : function (event) {"," var errorAction = this.get(\"errorAction\");"," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," this.numberOfUploads-=1;"," delete this.currentFiles[event.target.get(\"id\")];"," this._detachFileEvents(event.target);",""," event.target.cancelUpload();",""," if (errorAction === UploaderQueue.STOP) {"," this.pauseUpload();"," }",""," else if (errorAction === UploaderQueue.RESTART_ASAP) {"," var fileid = event.target.get(\"id\"),"," retries = this.uploadRetries[fileid] || 0;"," if (retries < this.get(\"retryCount\")) {"," this.uploadRetries[fileid] = retries + 1;"," this.addToQueueTop(event.target);"," }"," this._startNextFile();"," }"," else if (errorAction === UploaderQueue.RESTART_AFTER) {"," var fileid = event.target.get(\"id\"),"," retries = this.uploadRetries[fileid] || 0;"," if (retries < this.get(\"retryCount\")) {"," this.uploadRetries[fileid] = retries + 1;"," this.addToQueueBottom(event.target);"," }"," this._startNextFile();"," }",""," this.fire(\"uploaderror\", updatedEvent); "," },",""," /**"," * Launches the upload of the next file in the queue."," * "," * @method _startNextFile"," * @private"," */"," _startNextFile : function () {"," if (this.queuedFiles.length > 0) {"," var currentFile = this.queuedFiles.shift(),"," fileId = currentFile.get(\"id\"),"," parameters = this.get(\"perFileParameters\"),"," fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;",""," this.currentUploadedByteValues[fileId] = 0;",""," currentFile.on(\"uploadstart\", this._uploadStartHandler, this);"," currentFile.on(\"uploadprogress\", this._uploadProgressHandler, this);"," currentFile.on(\"uploadcomplete\", this._uploadCompleteHandler, this);"," currentFile.on(\"uploaderror\", this._uploadErrorHandler, this);"," currentFile.on(\"uploadcancel\", this._uploadCancelHandler, this);",""," currentFile.set(\"xhrHeaders\", this.get(\"uploadHeaders\"));"," currentFile.set(\"xhrWithCredentials\", this.get(\"withCredentials\"));",""," currentFile.startUpload(this.get(\"uploadURL\"), fileParameters, this.get(\"fileFieldName\"));",""," this._registerUpload(currentFile);"," }"," },",""," /**"," * Register a new upload process."," * "," * @method _registerUpload"," * @private"," */"," _registerUpload : function (file) {"," this.numberOfUploads += 1;"," this.currentFiles[file.get(\"id\")] = file;"," },",""," /**"," * Unregisters a new upload process."," * "," * @method _unregisterUpload"," * @private"," */"," _unregisterUpload : function (file) {"," if (this.numberOfUploads > 0) {"," this.numberOfUploads -=1;"," }"," delete this.currentFiles[file.get(\"id\")];"," delete this.uploadRetries[file.get(\"id\")];",""," this._detachFileEvents(file);"," },",""," _detachFileEvents : function (file) {"," file.detach(\"uploadstart\", this._uploadStartHandler);"," file.detach(\"uploadprogress\", this._uploadProgressHandler);"," file.detach(\"uploadcomplete\", this._uploadCompleteHandler);"," file.detach(\"uploaderror\", this._uploadErrorHandler);"," file.detach(\"uploadcancel\", this._uploadCancelHandler);"," },",""," /**"," * Handles and retransmits upload complete event."," * "," * @method _uploadCompleteHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadCompleteHandler : function (event) {",""," this._unregisterUpload(event.target);",""," this.totalBytesUploaded += event.target.get(\"size\");"," delete this.currentUploadedByteValues[event.target.get(\"id\")];","",""," if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {"," this._startNextFile();"," }"," "," var updatedEvent = event;"," updatedEvent.file = event.target;"," updatedEvent.originEvent = event;",""," var uploadedTotal = this.totalBytesUploaded;",""," Y.each(this.currentUploadedByteValues, function (value) {"," uploadedTotal += value; "," });"," "," var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100); "," "," this.fire(\"totaluploadprogress\", {bytesLoaded: uploadedTotal, "," bytesTotal: this.totalBytes,"," percentLoaded: percentLoaded});",""," this.fire(\"uploadcomplete\", updatedEvent);",""," if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {"," this.fire(\"alluploadscomplete\");"," this._currentState = UploaderQueue.STOPPED;"," }","",""," },",""," /**"," * Handles and retransmits upload cancel event."," * "," * @method _uploadCancelHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadCancelHandler : function (event) {"," "," var updatedEvent = event;"," updatedEvent.originEvent = event;"," updatedEvent.file = event.target;",""," this.fire(\"uploadcacel\", updatedEvent);"," },","","",""," /**"," * Handles and retransmits upload progress event."," * "," * @method _uploadProgressHandler"," * @param event The event dispatched during the upload process."," * @private"," */"," _uploadProgressHandler : function (event) {"," "," this.currentUploadedByteValues[event.target.get(\"id\")] = event.bytesLoaded;"," "," var updatedEvent = event;"," updatedEvent.originEvent = event;"," updatedEvent.file = event.target;",""," this.fire(\"uploadprogress\", updatedEvent);"," "," var uploadedTotal = this.totalBytesUploaded;",""," Y.each(this.currentUploadedByteValues, function (value) {"," uploadedTotal += value; "," });"," "," var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);",""," this.fire(\"totaluploadprogress\", {bytesLoaded: uploadedTotal, "," bytesTotal: this.totalBytes,"," percentLoaded: percentLoaded});"," },",""," /**"," * Starts uploading the queued up file list."," * "," * @method startUpload"," */"," startUpload: function() {"," "," this.queuedFiles = this.get(\"fileList\").slice(0);"," this.numberOfUploads = 0;"," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," "," this._currentState = UploaderQueue.UPLOADING;",""," while (this.numberOfUploads < this.get(\"simUploads\") && this.queuedFiles.length > 0) {"," this._startNextFile();"," }"," },",""," /**"," * Pauses the upload process. The ongoing file uploads"," * will complete after this method is called, but no"," * new ones will be launched."," * "," * @method pauseUpload"," */"," pauseUpload: function () {"," this._currentState = UploaderQueue.STOPPED;"," },",""," /**"," * Restarts a paused upload process."," * "," * @method restartUpload"," */"," restartUpload: function () {"," this._currentState = UploaderQueue.UPLOADING;"," while (this.numberOfUploads < this.get(\"simUploads\")) {"," this._startNextFile();"," }"," },",""," /**"," * If a particular file is stuck in an ongoing upload without"," * any progress events, this method allows to force its reupload"," * by cancelling its upload and immediately relaunching it."," * "," * @method forceReupload"," * @param file {Y.File} The file to force reupload on."," */"," forceReupload : function (file) {"," var id = file.get(\"id\");"," if (this.currentFiles.hasOwnProperty(id)) {"," file.cancelUpload();"," this._unregisterUpload(file);"," this.addToQueueTop(file);"," this._startNextFile();"," }"," },",""," /**"," * Add a new file to the top of the queue (the upload will be"," * launched as soon as the current number of uploading files"," * drops below the maximum permissible value)."," * "," * @method addToQueueTop"," * @param file {Y.File} The file to add to the top of the queue."," */"," addToQueueTop: function (file) {"," this.queuedFiles.unshift(file);"," },",""," /**"," * Add a new file to the bottom of the queue (the upload will be"," * launched after all the other queued files are uploaded.)"," * "," * @method addToQueueBottom"," * @param file {Y.File} The file to add to the bottom of the queue."," */"," addToQueueBottom: function (file) {"," this.queuedFiles.push(file);"," },",""," /**"," * Cancels a specific file's upload. If no argument is passed,"," * all ongoing uploads are cancelled and the upload process is"," * stopped."," * "," * @method cancelUpload"," * @param file {Y.File} An optional parameter - the file whose upload"," * should be cancelled."," */"," cancelUpload: function (file) {",""," if (file) {"," var id = file.get(\"id\");"," if (this.currentFiles[id]) {"," this.currentFiles[id].cancelUpload();"," this._unregisterUpload(this.currentFiles[id]);"," if (this._currentState === UploaderQueue.UPLOADING) {"," this._startNextFile();"," }"," }"," else {"," for (var i = 0, len = this.queuedFiles.length; i < len; i++) {"," if (this.queuedFiles[i].get(\"id\") === id) {"," this.queuedFiles.splice(i, 1);"," break;"," }"," }"," }"," }"," else {"," for (var fid in this.currentFiles) {"," this.currentFiles[fid].cancelUpload();"," this._unregisterUpload(this.currentFiles[fid]);"," }",""," this.currentUploadedByteValues = {};"," this.currentFiles = {};"," this.totalBytesUploaded = 0;"," this.fire(\"alluploadscancelled\");"," this._currentState = UploaderQueue.STOPPED;"," }"," }"," }, ",""," {"," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to continue uploading files in case of "," * an error."," * @property CONTINUE"," * @readOnly"," * @type {String}"," * @static"," */"," CONTINUE: \"continue\",",""," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to stop uploading files in case of "," * an error."," * @property STOP"," * @readOnly"," * @type {String}"," * @static"," */"," STOP: \"stop\",",""," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to restart a file upload immediately in case of "," * an error."," * @property RESTART_ASAP"," * @readOnly"," * @type {String}"," * @static"," */"," RESTART_ASAP: \"restartasap\",",""," /** "," * Static constant for the value of the `errorAction` attribute:"," * prescribes the queue to restart an errored out file upload after "," * other files have finished uploading."," * @property RESTART_AFTER"," * @readOnly"," * @type {String}"," * @static"," */"," RESTART_AFTER: \"restartafter\",",""," /** "," * Static constant for the value of the `_currentState` property:"," * implies that the queue is currently not uploading files."," * @property STOPPED"," * @readOnly"," * @type {String}"," * @static"," */"," STOPPED: \"stopped\",",""," /** "," * Static constant for the value of the `_currentState` property:"," * implies that the queue is currently uploading files."," * @property UPLOADING"," * @readOnly"," * @type {String}"," * @static"," */"," UPLOADING: \"uploading\",",""," /**"," * The identity of the class."," *"," * @property NAME"," * @type String"," * @default 'uploaderqueue'"," * @readOnly"," * @protected"," * @static"," */"," NAME: 'uploaderqueue',",""," /**"," * Static property used to define the default attribute configuration of"," * the class."," *"," * @property ATTRS"," * @type {Object}"," * @protected"," * @static"," */"," ATTRS: {"," "," /**"," * Maximum number of simultaneous uploads; must be in the"," * range between 1 and 5. The value of `2` is default. It"," * is recommended that this value does not exceed 3."," * @property simUploads"," * @type Number"," * @default 2"," */"," simUploads: {"," value: 2,"," validator: function (val, name) {"," return (val >= 1 && val <= 5);"," }"," },"," "," /**"," * The action to take in case of error. The valid values for this attribute are: "," * `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files, "," * ignoring the error), `Y.Uploader.Queue.STOP` (the upload process "," * should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload "," * should restart immediately on the errored out file and continue as planned), or"," * Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart"," * after all other files have uploaded)"," * @property errorAction"," * @type String"," * @default Y.Uploader.Queue.CONTINUE"," */"," errorAction: {"," value: \"continue\","," validator: function (val, name) {"," return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER);"," }"," },",""," /**"," * The total number of bytes that has been uploaded."," * @property bytesUploaded"," * @type Number"," */ "," bytesUploaded: {"," readOnly: true,"," value: 0"," },"," "," /**"," * The total number of bytes in the queue."," * @property bytesTotal"," * @type Number"," */ "," bytesTotal: {"," readOnly: true,"," value: 0"," },",""," /**"," * The queue file list. This file list should only be modified"," * before the upload has been started; modifying it after starting"," * the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods"," * should be used instead."," * @property fileList"," * @type Number"," */ "," fileList: {"," value: [],"," lazyAdd: false,"," setter: function (val) {"," var newValue = val;"," Y.Array.each(newValue, function (value) {"," this.totalBytes += value.get(\"size\");"," }, this);"," "," return val;"," } "," },",""," /**"," * A String specifying what should be the POST field name for the file"," * content in the upload request."," *"," * @attribute fileFieldName"," * @type {String}"," * @default Filedata"," */ "," fileFieldName: {"," value: \"Filedata\""," },",""," /**"," * The URL to POST the file upload requests to."," *"," * @attribute uploadURL"," * @type {String}"," * @default \"\""," */ "," uploadURL: {"," value: \"\""," },",""," /**"," * Additional HTTP headers that should be included"," * in the upload request. Due to Flash Player security"," * restrictions, this attribute is only honored in the"," * HTML5 Uploader."," *"," * @attribute uploadHeaders"," * @type {Object}"," * @default {}"," */ "," uploadHeaders: {"," value: {}"," },",""," /**"," * A Boolean that specifies whether the file should be"," * uploaded with the appropriate user credentials for the"," * domain. Due to Flash Player security restrictions, this"," * attribute is only honored in the HTML5 Uploader."," *"," * @attribute withCredentials"," * @type {Boolean}"," * @default true"," */ "," withCredentials: {"," value: true"," },","",""," /**"," * An object, keyed by `fileId`, containing sets of key-value pairs"," * that should be passed as POST variables along with each corresponding"," * file."," *"," * @attribute perFileParameters"," * @type {Object}"," * @default {}"," */ "," perFileParameters: {"," value: {}"," },",""," /**"," * The number of times to try re-uploading a file that failed to upload before"," * cancelling its upload."," *"," * @attribute retryCount"," * @type {Number}"," * @default 3"," */ "," retryCount: {"," value: 3"," }",""," }"," });","",""," Y.namespace('Uploader');"," Y.Uploader.Queue = UploaderQueue;","","}, '3.7.3', {\"requires\": [\"base\"]});"]; _yuitest_coverage["build/uploader-queue/uploader-queue.js"].lines = {"1":0,"11":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"37":0,"41":0,"70":0,"71":0,"72":0,"74":0,"85":0,"86":0,"87":0,"88":0,"90":0,"91":0,"92":0,"94":0,"96":0,"97":0,"100":0,"101":0,"103":0,"104":0,"105":0,"107":0,"109":0,"110":0,"112":0,"113":0,"114":0,"116":0,"119":0,"129":0,"130":0,"135":0,"137":0,"138":0,"139":0,"140":0,"141":0,"143":0,"144":0,"146":0,"148":0,"159":0,"160":0,"170":0,"171":0,"173":0,"174":0,"176":0,"180":0,"181":0,"182":0,"183":0,"184":0,"196":0,"198":0,"199":0,"202":0,"203":0,"206":0,"207":0,"208":0,"210":0,"212":0,"213":0,"216":0,"218":0,"222":0,"224":0,"225":0,"226":0,"241":0,"242":0,"243":0,"245":0,"259":0,"261":0,"262":0,"263":0,"265":0,"267":0,"269":0,"270":0,"273":0,"275":0,"287":0,"288":0,"289":0,"290":0,"291":0,"293":0,"295":0,"296":0,"308":0,"317":0,"318":0,"319":0,"332":0,"333":0,"334":0,"335":0,"336":0,"337":0,"350":0,"361":0,"375":0,"376":0,"377":0,"378":0,"379":0,"380":0,"381":0,"385":0,"386":0,"387":0,"388":0,"394":0,"395":0,"396":0,"399":0,"400":0,"401":0,"402":0,"403":0,"507":0,"526":0,"562":0,"563":0,"564":0,"567":0,"652":0,"653":0}; _yuitest_coverage["build/uploader-queue/uploader-queue.js"].functions = {"UploaderQueue:28":0,"_uploadStartHandler:69":0,"_uploadErrorHandler:84":0,"_startNextFile:128":0,"_registerUpload:158":0,"_unregisterUpload:169":0,"_detachFileEvents:179":0,"(anonymous 2):212":0,"_uploadCompleteHandler:194":0,"_uploadCancelHandler:239":0,"(anonymous 3):269":0,"_uploadProgressHandler:257":0,"startUpload:285":0,"pauseUpload:307":0,"restartUpload:316":0,"forceReupload:331":0,"addToQueueTop:349":0,"addToQueueBottom:360":0,"cancelUpload:373":0,"validator:506":0,"validator:525":0,"(anonymous 4):563":0,"setter:561":0,"(anonymous 1):1":0}; _yuitest_coverage["build/uploader-queue/uploader-queue.js"].coveredLines = 141;@@ -856,4 +856,4 @@ _yuitest_coverline("build/uploader-queue/uploader-queue.js", 653); Y.Uploader.Queue = UploaderQueue; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/uploader-queue/uploader-queue-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -658,4 +658,4 @@ Y.namespace('Uploader'); Y.Uploader.Queue = UploaderQueue; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/uploader-queue/uploader-queue-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("uploader-queue",function(e,t){var n=e.Lang,r=e.bind,i=e.config.win,s,o,u,a,f,l,c=function(e){this.queuedFiles=[],this.uploadRetries={},this.numberOfUploads=0,this.currentUploadedByteValues={},this.currentFiles={},this.totalBytesUploaded=0,this.totalBytes=0,c.superclass.constructor.apply(this,arguments)};e.extend(c,e.Base,{_currentState:c.STOPPED,initializer:function(e){},_uploadStartHandler:function(e){var t=e;t.file=e.target,t.originEvent=e,this.fire("uploadstart",t)},_uploadErrorHandler:function(e){var t=this.get("errorAction"),n=e;n.file=e.target,n.originEvent=e,this.numberOfUploads-=1,delete this.currentFiles[e.target.get("id")],this._detachFileEvents(e.target),e.target.cancelUpload();if(t===c.STOP)this.pauseUpload();else if(t===c.RESTART_ASAP){var r=e.target.get("id"),i=this.uploadRetries[r]||0;i<this.get("retryCount")&&(this.uploadRetries[r]=i+1,this.addToQueueTop(e.target)),this._startNextFile()}else if(t===c.RESTART_AFTER){var r=e.target.get("id"),i=this.uploadRetries[r]||0;i<this.get("retryCount")&&(this.uploadRetries[r]=i+1,this.addToQueueBottom(e.target)),this._startNextFile()}this.fire("uploaderror",n)},_startNextFile:function(){if(this.queuedFiles.length>0){var e=this.queuedFiles.shift(),t=e.get("id"),n=this.get("perFileParameters"),r=n.hasOwnProperty(t)?n[t]:n;this.currentUploadedByteValues[t]=0,e.on("uploadstart",this._uploadStartHandler,this),e.on("uploadprogress",this._uploadProgressHandler,this),e.on("uploadcomplete",this._uploadCompleteHandler,this),e.on("uploaderror",this._uploadErrorHandler,this),e.on("uploadcancel",this._uploadCancelHandler,this),e.set("xhrHeaders",this.get("uploadHeaders")),e.set("xhrWithCredentials",this.get("withCredentials")),e.startUpload(this.get("uploadURL"),r,this.get("fileFieldName")),this._registerUpload(e)}},_registerUpload:function(e){this.numberOfUploads+=1,this.currentFiles[e.get("id")]=e},_unregisterUpload:function(e){this.numberOfUploads>0&&(this.numberOfUploads-=1),delete this.currentFiles[e.get("id")],delete this.uploadRetries[e.get("id")],this._detachFileEvents(e)},_detachFileEvents:function(e){e.detach("uploadstart",this._uploadStartHandler),e.detach("uploadprogress",this._uploadProgressHandler),e.detach("uploadcomplete",this._uploadCompleteHandler),e.detach("uploaderror",this._uploadErrorHandler),e.detach("uploadcancel",this._uploadCancelHandler)},_uploadCompleteHandler:function(t){this._unregisterUpload(t.target),this.totalBytesUploaded+=t.target.get("size"),delete this.currentUploadedByteValues[t.target.get("id")],this.queuedFiles.length>0&&this._currentState===c.UPLOADING&&this._startNextFile();var n=t;n.file=t.target,n.originEvent=t;var r=this.totalBytesUploaded;e.each(this.currentUploadedByteValues,function(e){r+=e});var i=Math.min(100,Math.round(1e4*r/this.totalBytes)/100);this.fire("totaluploadprogress",{bytesLoaded:r,bytesTotal:this.totalBytes,percentLoaded:i}),this.fire("uploadcomplete",n),this.queuedFiles.length===0&&this.numberOfUploads<=0&&(this.fire("alluploadscomplete"),this._currentState=c.STOPPED)},_uploadCancelHandler:function(e){var t=e;t.originEvent=e,t.file=e.target,this.fire("uploadcacel",t)},_uploadProgressHandler:function(t){this.currentUploadedByteValues[t.target.get("id")]=t.bytesLoaded;var n=t;n.originEvent=t,n.file=t.target,this.fire("uploadprogress",n);var r=this.totalBytesUploaded;e.each(this.currentUploadedByteValues,function(e){r+=e});var i=Math.min(100,Math.round(1e4*r/this.totalBytes)/100);this.fire("totaluploadprogress",{bytesLoaded:r,bytesTotal:this.totalBytes,percentLoaded:i})},startUpload:function(){this.queuedFiles=this.get("fileList").slice(0),this.numberOfUploads=0,this.currentUploadedByteValues={},this.currentFiles={},this.totalBytesUploaded=0,this._currentState=c.UPLOADING;while(this.numberOfUploads<this.get("simUploads")&&this.queuedFiles.length>0)this._startNextFile()},pauseUpload:function(){this._currentState=c.STOPPED},restartUpload:function(){this._currentState=c.UPLOADING;while(this.numberOfUploads<this.get("simUploads"))this._startNextFile()},forceReupload:function(e){var t=e.get("id");this.currentFiles.hasOwnProperty(t)&&(e.cancelUpload(),this._unregisterUpload(e),this.addToQueueTop(e),this._startNextFile())},addToQueueTop:function(e){this.queuedFiles.unshift(e)},addToQueueBottom:function(e){this.queuedFiles.push(e)},cancelUpload:function(e){if(e){var t=e.get("id");if(this.currentFiles[t])this.currentFiles[t].cancelUpload(),this._unregisterUpload(this.currentFiles[t]),this._currentState===c.UPLOADING&&this._startNextFile();else for(var n=0,r=this.queuedFiles.length;n<r;n++)if(this.queuedFiles[n].get("id")===t){this.queuedFiles.splice(n,1);break}}else{for(var i in this.currentFiles)this.currentFiles[i].cancelUpload(),this._unregisterUpload(this.currentFiles[i]);this.currentUploadedByteValues={},this.currentFiles={},this.totalBytesUploaded=0,this.fire("alluploadscancelled"),this._currentState=c.STOPPED}}},{CONTINUE:"continue",STOP:"stop",RESTART_ASAP:"restartasap",RESTART_AFTER:"restartafter",STOPPED:"stopped",UPLOADING:"uploading",NAME:"uploaderqueue",ATTRS:{simUploads:{value:2,validator:function(e,t){return e>=1&&e<=5}},errorAction:{value:"continue",validator:function(e,t){return e===c.CONTINUE||e===c.STOP||e===c.RESTART_ASAP||e===c.RESTART_AFTER}},bytesUploaded:{readOnly:!0,value:0},bytesTotal:{readOnly:!0,value:0},fileList:{value:[],lazyAdd:!1,setter:function(t){var n=t;return e.Array.each(n,function(e){this.totalBytes+=e.get("size")},this),t}},fileFieldName:{value:"Filedata"},uploadURL:{value:""},uploadHeaders:{value:{}},withCredentials:{value:!0},perFileParameters:{value:{}},retryCount:{value:3}}}),e.namespace("Uploader"),e.Uploader.Queue=c},"3.7.2",{requires:["base"]});+YUI.add("uploader-queue",function(e,t){var n=e.Lang,r=e.bind,i=e.config.win,s,o,u,a,f,l,c=function(e){this.queuedFiles=[],this.uploadRetries={},this.numberOfUploads=0,this.currentUploadedByteValues={},this.currentFiles={},this.totalBytesUploaded=0,this.totalBytes=0,c.superclass.constructor.apply(this,arguments)};e.extend(c,e.Base,{_currentState:c.STOPPED,initializer:function(e){},_uploadStartHandler:function(e){var t=e;t.file=e.target,t.originEvent=e,this.fire("uploadstart",t)},_uploadErrorHandler:function(e){var t=this.get("errorAction"),n=e;n.file=e.target,n.originEvent=e,this.numberOfUploads-=1,delete this.currentFiles[e.target.get("id")],this._detachFileEvents(e.target),e.target.cancelUpload();if(t===c.STOP)this.pauseUpload();else if(t===c.RESTART_ASAP){var r=e.target.get("id"),i=this.uploadRetries[r]||0;i<this.get("retryCount")&&(this.uploadRetries[r]=i+1,this.addToQueueTop(e.target)),this._startNextFile()}else if(t===c.RESTART_AFTER){var r=e.target.get("id"),i=this.uploadRetries[r]||0;i<this.get("retryCount")&&(this.uploadRetries[r]=i+1,this.addToQueueBottom(e.target)),this._startNextFile()}this.fire("uploaderror",n)},_startNextFile:function(){if(this.queuedFiles.length>0){var e=this.queuedFiles.shift(),t=e.get("id"),n=this.get("perFileParameters"),r=n.hasOwnProperty(t)?n[t]:n;this.currentUploadedByteValues[t]=0,e.on("uploadstart",this._uploadStartHandler,this),e.on("uploadprogress",this._uploadProgressHandler,this),e.on("uploadcomplete",this._uploadCompleteHandler,this),e.on("uploaderror",this._uploadErrorHandler,this),e.on("uploadcancel",this._uploadCancelHandler,this),e.set("xhrHeaders",this.get("uploadHeaders")),e.set("xhrWithCredentials",this.get("withCredentials")),e.startUpload(this.get("uploadURL"),r,this.get("fileFieldName")),this._registerUpload(e)}},_registerUpload:function(e){this.numberOfUploads+=1,this.currentFiles[e.get("id")]=e},_unregisterUpload:function(e){this.numberOfUploads>0&&(this.numberOfUploads-=1),delete this.currentFiles[e.get("id")],delete this.uploadRetries[e.get("id")],this._detachFileEvents(e)},_detachFileEvents:function(e){e.detach("uploadstart",this._uploadStartHandler),e.detach("uploadprogress",this._uploadProgressHandler),e.detach("uploadcomplete",this._uploadCompleteHandler),e.detach("uploaderror",this._uploadErrorHandler),e.detach("uploadcancel",this._uploadCancelHandler)},_uploadCompleteHandler:function(t){this._unregisterUpload(t.target),this.totalBytesUploaded+=t.target.get("size"),delete this.currentUploadedByteValues[t.target.get("id")],this.queuedFiles.length>0&&this._currentState===c.UPLOADING&&this._startNextFile();var n=t;n.file=t.target,n.originEvent=t;var r=this.totalBytesUploaded;e.each(this.currentUploadedByteValues,function(e){r+=e});var i=Math.min(100,Math.round(1e4*r/this.totalBytes)/100);this.fire("totaluploadprogress",{bytesLoaded:r,bytesTotal:this.totalBytes,percentLoaded:i}),this.fire("uploadcomplete",n),this.queuedFiles.length===0&&this.numberOfUploads<=0&&(this.fire("alluploadscomplete"),this._currentState=c.STOPPED)},_uploadCancelHandler:function(e){var t=e;t.originEvent=e,t.file=e.target,this.fire("uploadcacel",t)},_uploadProgressHandler:function(t){this.currentUploadedByteValues[t.target.get("id")]=t.bytesLoaded;var n=t;n.originEvent=t,n.file=t.target,this.fire("uploadprogress",n);var r=this.totalBytesUploaded;e.each(this.currentUploadedByteValues,function(e){r+=e});var i=Math.min(100,Math.round(1e4*r/this.totalBytes)/100);this.fire("totaluploadprogress",{bytesLoaded:r,bytesTotal:this.totalBytes,percentLoaded:i})},startUpload:function(){this.queuedFiles=this.get("fileList").slice(0),this.numberOfUploads=0,this.currentUploadedByteValues={},this.currentFiles={},this.totalBytesUploaded=0,this._currentState=c.UPLOADING;while(this.numberOfUploads<this.get("simUploads")&&this.queuedFiles.length>0)this._startNextFile()},pauseUpload:function(){this._currentState=c.STOPPED},restartUpload:function(){this._currentState=c.UPLOADING;while(this.numberOfUploads<this.get("simUploads"))this._startNextFile()},forceReupload:function(e){var t=e.get("id");this.currentFiles.hasOwnProperty(t)&&(e.cancelUpload(),this._unregisterUpload(e),this.addToQueueTop(e),this._startNextFile())},addToQueueTop:function(e){this.queuedFiles.unshift(e)},addToQueueBottom:function(e){this.queuedFiles.push(e)},cancelUpload:function(e){if(e){var t=e.get("id");if(this.currentFiles[t])this.currentFiles[t].cancelUpload(),this._unregisterUpload(this.currentFiles[t]),this._currentState===c.UPLOADING&&this._startNextFile();else for(var n=0,r=this.queuedFiles.length;n<r;n++)if(this.queuedFiles[n].get("id")===t){this.queuedFiles.splice(n,1);break}}else{for(var i in this.currentFiles)this.currentFiles[i].cancelUpload(),this._unregisterUpload(this.currentFiles[i]);this.currentUploadedByteValues={},this.currentFiles={},this.totalBytesUploaded=0,this.fire("alluploadscancelled"),this._currentState=c.STOPPED}}},{CONTINUE:"continue",STOP:"stop",RESTART_ASAP:"restartasap",RESTART_AFTER:"restartafter",STOPPED:"stopped",UPLOADING:"uploading",NAME:"uploaderqueue",ATTRS:{simUploads:{value:2,validator:function(e,t){return e>=1&&e<=5}},errorAction:{value:"continue",validator:function(e,t){return e===c.CONTINUE||e===c.STOP||e===c.RESTART_ASAP||e===c.RESTART_AFTER}},bytesUploaded:{readOnly:!0,value:0},bytesTotal:{readOnly:!0,value:0},fileList:{value:[],lazyAdd:!1,setter:function(t){var n=t;return e.Array.each(n,function(e){this.totalBytes+=e.get("size")},this),t}},fileFieldName:{value:"Filedata"},uploadURL:{value:""},uploadHeaders:{value:{}},withCredentials:{value:!0},perFileParameters:{value:{}},retryCount:{value:3}}}),e.namespace("Uploader"),e.Uploader.Queue=c},"3.7.3",{requires:["base"]});
bundle/uploader-queue/uploader-queue.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -658,4 +658,4 @@ Y.namespace('Uploader'); Y.Uploader.Queue = UploaderQueue; -}, '3.7.2', {"requires": ["base"]});+}, '3.7.3', {"requires": ["base"]});
bundle/uploader/assets/uploader-flash-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/uploader/uploader-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/uploader/uploader.js", code: [] };-_yuitest_coverage["build/uploader/uploader.js"].code=["YUI.add('uploader', function (Y, NAME) {","","/**"," * Provides UI for selecting multiple files and functionality for "," * uploading multiple files to the server with support for either"," * html5 or Flash transport mechanisms, automatic queue management,"," * upload progress monitoring, and error events."," * @module uploader"," * @main uploader"," * @since 3.5.0"," */","","/**"," * `Y.Uploader` serves as an alias for either <a href=\"UploaderFlash.html\">`Y.UploaderFlash`</a>"," * or <a href=\"UploaderHTML5.html\">`Y.UploaderHTML5`</a>, depending on the feature set available"," * in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE` "," * static property is set to `\"none\"`."," *"," * @class Uploader"," */",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The possible values are:"," * <ul>"," * <li><strong>`\"html5\"`</strong>: Y.Uploader is an alias for <a href=\"UploaderHTML5.html\">Y.UploaderHTML5</a></li>"," * <li><strong>`\"flash\"`</strong>: Y.Uploader is an alias for <a href=\"UploaderFlash.html\">Y.UploaderFlash</a></li>"," * <li><strong>`\"none\"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does"," * not reference an actual implementation.</li>"," * </ul>"," *"," * @property TYPE"," * @type {String}"," * @static"," */",""," var Win = Y.config.win;",""," if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {"," Y.Uploader = Y.UploaderHTML5;"," }",""," else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {"," Y.Uploader = Y.UploaderFlash;"," }",""," else {"," Y.namespace(\"Uploader\");"," Y.Uploader.TYPE = \"none\";"," }","","}, '3.7.2', {\"requires\": [\"uploader-html5\", \"uploader-flash\"]});"];+_yuitest_coverage["build/uploader/uploader.js"].code=["YUI.add('uploader', function (Y, NAME) {","","/**"," * Provides UI for selecting multiple files and functionality for "," * uploading multiple files to the server with support for either"," * html5 or Flash transport mechanisms, automatic queue management,"," * upload progress monitoring, and error events."," * @module uploader"," * @main uploader"," * @since 3.5.0"," */","","/**"," * `Y.Uploader` serves as an alias for either <a href=\"UploaderFlash.html\">`Y.UploaderFlash`</a>"," * or <a href=\"UploaderHTML5.html\">`Y.UploaderHTML5`</a>, depending on the feature set available"," * in a specific browser. If neither HTML5 nor Flash transport layers are available, `Y.Uploader.TYPE` "," * static property is set to `\"none\"`."," *"," * @class Uploader"," */",""," /**"," * The static property reflecting the type of uploader that `Y.Uploader`"," * aliases. The possible values are:"," * <ul>"," * <li><strong>`\"html5\"`</strong>: Y.Uploader is an alias for <a href=\"UploaderHTML5.html\">Y.UploaderHTML5</a></li>"," * <li><strong>`\"flash\"`</strong>: Y.Uploader is an alias for <a href=\"UploaderFlash.html\">Y.UploaderFlash</a></li>"," * <li><strong>`\"none\"`</strong>: Neither Flash not HTML5 are available, and Y.Uploader does"," * not reference an actual implementation.</li>"," * </ul>"," *"," * @property TYPE"," * @type {String}"," * @static"," */",""," var Win = Y.config.win;",""," if (Win && Win.File && Win.FormData && Win.XMLHttpRequest) {"," Y.Uploader = Y.UploaderHTML5;"," }",""," else if (Y.SWFDetect.isFlashVersionAtLeast(10,0,45)) {"," Y.Uploader = Y.UploaderFlash;"," }",""," else {"," Y.namespace(\"Uploader\");"," Y.Uploader.TYPE = \"none\";"," }","","}, '3.7.3', {\"requires\": [\"uploader-html5\", \"uploader-flash\"]});"]; _yuitest_coverage["build/uploader/uploader.js"].lines = {"1":0,"37":0,"39":0,"40":0,"43":0,"44":0,"48":0,"49":0}; _yuitest_coverage["build/uploader/uploader.js"].functions = {"(anonymous 1):1":0}; _yuitest_coverage["build/uploader/uploader.js"].coveredLines = 8;@@ -97,4 +97,4 @@ Y.Uploader.TYPE = "none"; }} -}, '3.7.2', {"requires": ["uploader-html5", "uploader-flash"]});+}, '3.7.3', {"requires": ["uploader-html5", "uploader-flash"]});
bundle/uploader/uploader-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -55,4 +55,4 @@ Y.Uploader.TYPE = "none"; } -}, '3.7.2', {"requires": ["uploader-html5", "uploader-flash"]});+}, '3.7.3', {"requires": ["uploader-html5", "uploader-flash"]});
bundle/uploader/uploader-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("uploader",function(e,t){var n=e.config.win;n&&n.File&&n.FormData&&n.XMLHttpRequest?e.Uploader=e.UploaderHTML5:e.SWFDetect.isFlashVersionAtLeast(10,0,45)?e.Uploader=e.UploaderFlash:(e.namespace("Uploader"),e.Uploader.TYPE="none")},"3.7.2",{requires:["uploader-html5","uploader-flash"]});+YUI.add("uploader",function(e,t){var n=e.config.win;n&&n.File&&n.FormData&&n.XMLHttpRequest?e.Uploader=e.UploaderHTML5:e.SWFDetect.isFlashVersionAtLeast(10,0,45)?e.Uploader=e.UploaderFlash:(e.namespace("Uploader"),e.Uploader.TYPE="none")},"3.7.3",{requires:["uploader-html5","uploader-flash"]});
bundle/uploader/uploader.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -55,4 +55,4 @@ Y.Uploader.TYPE = "none"; } -}, '3.7.2', {"requires": ["uploader-html5", "uploader-flash"]});+}, '3.7.3', {"requires": ["uploader-html5", "uploader-flash"]});
bundle/view-node-map/view-node-map-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/view-node-map/view-node-map.js", code: [] };-_yuitest_coverage["build/view-node-map/view-node-map.js"].code=["YUI.add('view-node-map', function (Y, NAME) {","","/**","View extension that adds a static `getByNode()` method that returns the nearest","View instance associated with the given Node (similar to Widget's `getByNode()`","method).","","@module app","@submodule view-node-map","@since 3.5.0","**/","","var buildCfg = Y.namespace('View._buildCfg'),"," instances = {};","","/**","View extension that adds a static `getByNode()` method that returns the nearest","View instance associated with the given Node (similar to Widget's `getByNode()`","method).","","Note that it's important to call `destroy()` on a View instance using this","extension when you plan to stop using it. This ensures that all internal","references to that View are cleared to prevent memory leaks.","","@class View.NodeMap","@extensionfor View","@since 3.5.0","**/","function NodeMap() {}","","// Tells Base.create() to mix the static getByNode method into built classes.","// We're cheating and modifying Y.View here, because right now there's no better","// way to do it.","buildCfg.aggregates || (buildCfg.aggregates = []);","buildCfg.aggregates.push('getByNode');","","/**","Returns the nearest View instance associated with the given Node. The Node may","be a View container or any child of a View container.","","Note that only instances of Views that have the Y.View.NodeMap extension mixed","in will be returned. The base View class doesn't provide this functionality by","default due to the additional memory management overhead involved in maintaining","a mapping of Nodes to View instances.","","@method getByNode","@param {Node|HTMLElement|String} node Node instance, selector string, or"," HTMLElement.","@return {View} Closest View instance associated with the given Node, or `null`"," if no associated View instance was found.","@static","@since 3.5.0","**/","NodeMap.getByNode = function (node) {"," var view;",""," Y.one(node).ancestor(function (ancestor) {"," return (view = instances[Y.stamp(ancestor, true)]) || false;"," }, true);",""," return view || null;","};","","// To make this testable.","NodeMap._instances = instances;","","NodeMap.prototype = {"," initializer: function () {"," instances[Y.stamp(this.get('container'))] = this;"," },",""," destructor: function () {"," var stamp = Y.stamp(this.get('container'), true);",""," if (stamp in instances) {"," delete instances[stamp];"," }"," }","};","","Y.View.NodeMap = NodeMap;","","","}, '3.7.2', {\"requires\": [\"view\"]});"];+_yuitest_coverage["build/view-node-map/view-node-map.js"].code=["YUI.add('view-node-map', function (Y, NAME) {","","/**","View extension that adds a static `getByNode()` method that returns the nearest","View instance associated with the given Node (similar to Widget's `getByNode()`","method).","","@module app","@submodule view-node-map","@since 3.5.0","**/","","var buildCfg = Y.namespace('View._buildCfg'),"," instances = {};","","/**","View extension that adds a static `getByNode()` method that returns the nearest","View instance associated with the given Node (similar to Widget's `getByNode()`","method).","","Note that it's important to call `destroy()` on a View instance using this","extension when you plan to stop using it. This ensures that all internal","references to that View are cleared to prevent memory leaks.","","@class View.NodeMap","@extensionfor View","@since 3.5.0","**/","function NodeMap() {}","","// Tells Base.create() to mix the static getByNode method into built classes.","// We're cheating and modifying Y.View here, because right now there's no better","// way to do it.","buildCfg.aggregates || (buildCfg.aggregates = []);","buildCfg.aggregates.push('getByNode');","","/**","Returns the nearest View instance associated with the given Node. The Node may","be a View container or any child of a View container.","","Note that only instances of Views that have the Y.View.NodeMap extension mixed","in will be returned. The base View class doesn't provide this functionality by","default due to the additional memory management overhead involved in maintaining","a mapping of Nodes to View instances.","","@method getByNode","@param {Node|HTMLElement|String} node Node instance, selector string, or"," HTMLElement.","@return {View} Closest View instance associated with the given Node, or `null`"," if no associated View instance was found.","@static","@since 3.5.0","**/","NodeMap.getByNode = function (node) {"," var view;",""," Y.one(node).ancestor(function (ancestor) {"," return (view = instances[Y.stamp(ancestor, true)]) || false;"," }, true);",""," return view || null;","};","","// To make this testable.","NodeMap._instances = instances;","","NodeMap.prototype = {"," initializer: function () {"," instances[Y.stamp(this.get('container'))] = this;"," },",""," destructor: function () {"," var stamp = Y.stamp(this.get('container'), true);",""," if (stamp in instances) {"," delete instances[stamp];"," }"," }","};","","Y.View.NodeMap = NodeMap;","","","}, '3.7.3', {\"requires\": [\"view\"]});"]; _yuitest_coverage["build/view-node-map/view-node-map.js"].lines = {"1":0,"13":0,"29":0,"34":0,"35":0,"54":0,"55":0,"57":0,"58":0,"61":0,"65":0,"67":0,"69":0,"73":0,"75":0,"76":0,"81":0}; _yuitest_coverage["build/view-node-map/view-node-map.js"].functions = {"NodeMap:29":0,"(anonymous 2):57":0,"getByNode:54":0,"initializer:68":0,"destructor:72":0,"(anonymous 1):1":0}; _yuitest_coverage["build/view-node-map/view-node-map.js"].coveredLines = 17;@@ -142,4 +142,4 @@ Y.View.NodeMap = NodeMap; -}, '3.7.2', {"requires": ["view"]});+}, '3.7.3', {"requires": ["view"]});
bundle/view-node-map/view-node-map-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -87,4 +87,4 @@ Y.View.NodeMap = NodeMap; -}, '3.7.2', {"requires": ["view"]});+}, '3.7.3', {"requires": ["view"]});
bundle/view-node-map/view-node-map-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("view-node-map",function(e,t){function i(){}var n=e.namespace("View._buildCfg"),r={};n.aggregates||(n.aggregates=[]),n.aggregates.push("getByNode"),i.getByNode=function(t){var n;return e.one(t).ancestor(function(t){return(n=r[e.stamp(t,!0)])||!1},!0),n||null},i._instances=r,i.prototype={initializer:function(){r[e.stamp(this.get("container"))]=this},destructor:function(){var t=e.stamp(this.get("container"),!0);t in r&&delete r[t]}},e.View.NodeMap=i},"3.7.2",{requires:["view"]});+YUI.add("view-node-map",function(e,t){function i(){}var n=e.namespace("View._buildCfg"),r={};n.aggregates||(n.aggregates=[]),n.aggregates.push("getByNode"),i.getByNode=function(t){var n;return e.one(t).ancestor(function(t){return(n=r[e.stamp(t,!0)])||!1},!0),n||null},i._instances=r,i.prototype={initializer:function(){r[e.stamp(this.get("container"))]=this},destructor:function(){var t=e.stamp(this.get("container"),!0);t in r&&delete r[t]}},e.View.NodeMap=i},"3.7.3",{requires:["view"]});
bundle/view-node-map/view-node-map.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -87,4 +87,4 @@ Y.View.NodeMap = NodeMap; -}, '3.7.2', {"requires": ["view"]});+}, '3.7.3', {"requires": ["view"]});
bundle/view/view-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/view/view.js", code: [] };-_yuitest_coverage["build/view/view.js"].code=["YUI.add('view', function (Y, NAME) {","","/**","Represents a logical piece of an application's user interface, and provides a","lightweight, overridable API for rendering content and handling delegated DOM","events on a container element.","","@module app","@submodule view","@since 3.4.0","**/","","/**","Represents a logical piece of an application's user interface, and provides a","lightweight, overridable API for rendering content and handling delegated DOM","events on a container element.","","The View class imposes little structure and provides only minimal functionality","of its own: it's basically just an overridable API interface that helps you","implement custom views.","","As of YUI 3.5.0, View allows ad-hoc attributes to be specified at instantiation","time, so you don't need to subclass `Y.View` to add custom attributes. Just pass","them to the constructor:",""," var view = new Y.View({foo: 'bar'});"," view.get('foo'); // => \"bar\"","","@class View","@constructor","@extends Base","@since 3.4.0","**/","","function View() {"," View.superclass.constructor.apply(this, arguments);","}","","Y.View = Y.extend(View, Y.Base, {"," // -- Public Properties ----------------------------------------------------",""," /**"," Template for this view's container.",""," @property containerTemplate"," @type String"," @default \"<div/>\""," @since 3.5.0"," **/"," containerTemplate: '<div/>',",""," /**"," Hash of CSS selectors mapped to events to delegate to elements matching"," those selectors.",""," CSS selectors are relative to the `container` element. Events are attached"," to the container, and delegation is used so that subscribers are only"," notified of events that occur on elements inside the container that match"," the specified selectors. This allows the container's contents to be re-"," rendered as needed without losing event subscriptions.",""," Event handlers can be specified either as functions or as strings that map"," to function names on this view instance or its prototype.",""," The `this` object in event handlers will refer to this view instance. If"," you'd prefer `this` to be something else, use `Y.bind()` to bind a custom"," `this` object.",""," @example",""," var view = new Y.View({"," events: {"," // Call `this.toggle()` whenever the element with the id"," // \"toggle-button\" is clicked."," '#toggle-button': {click: 'toggle'},",""," // Call `this.hoverOn()` when the mouse moves over any element"," // with the \"hoverable\" class, and `this.hoverOff()` when the"," // mouse moves out of any element with the \"hoverable\" class."," '.hoverable': {"," mouseover: 'hoverOn',"," mouseout : 'hoverOff'"," }"," }"," });",""," @property events"," @type Object"," @default {}"," **/"," events: {},",""," /**"," Template for this view's contents.",""," This is a convenience property that has no default behavior of its own."," It's only provided as a convention to allow you to store whatever you"," consider to be a template, whether that's an HTML string, a `Y.Node`"," instance, a Mustache template, or anything else your little heart"," desires.",""," How this template gets used is entirely up to you and your custom"," `render()` method.",""," @property template"," @type mixed"," @default ''"," **/"," template: '',",""," // -- Protected Properties -------------------------------------------------",""," /**"," This tells `Y.Base` that it should create ad-hoc attributes for config"," properties passed to View's constructor. This makes it possible to"," instantiate a view and set a bunch of attributes without having to subclass"," `Y.View` and declare all those attributes first.",""," @property _allowAdHocAttrs"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _allowAdHocAttrs: true,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," // Set instance properties specified in the config."," config.containerTemplate &&"," (this.containerTemplate = config.containerTemplate);",""," config.template && (this.template = config.template);",""," // Merge events from the config into events in `this.events`."," this.events = config.events ? Y.merge(this.events, config.events) :"," this.events;",""," // When the container node changes (or when it's set for the first"," // time), we'll attach events to it, but not until then. This allows the"," // container to be created lazily the first time it's accessed rather"," // than always on init."," this.after('containerChange', this._afterContainerChange);"," },",""," /**"," Destroys this View, detaching any DOM events and optionally also destroying"," its container node.",""," By default, the container node will not be destroyed. Pass an _options_"," object with a truthy `remove` property to destroy the container as well.",""," @method destroy"," @param {Object} [options] Options."," @param {Boolean} [options.remove=false] If `true`, this View's container"," will be removed from the DOM and destroyed as well."," @chainable"," */"," destroy: function (options) {"," // We also accept `delete` as a synonym for `remove`."," if (options && (options.remove || options['delete'])) {"," // Attaching an event handler here because the `destroy` event is"," // preventable. If we destroyed the container before calling the"," // superclass's `destroy()` method and the event was prevented, the"," // class would end up in a broken state."," this.onceAfter('destroy', function () {"," this._destroyContainer();"," });"," }",""," return View.superclass.destroy.call(this);"," },",""," destructor: function () {"," this.detachEvents();"," delete this._container;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Attaches delegated event handlers to this view's container element. This"," method is called internally to subscribe to events configured in the"," `events` attribute when the view is initialized.",""," You may override this method to customize the event attaching logic.",""," @method attachEvents"," @param {Object} [events] Hash of events to attach. See the docs for the"," `events` attribute for details on the format. If not specified, this"," view's `events` property will be used."," @chainable"," @see detachEvents"," **/"," attachEvents: function (events) {"," var container = this.get('container'),"," owns = Y.Object.owns,"," handler, handlers, name, selector;",""," this.detachEvents();",""," events || (events = this.events);",""," for (selector in events) {"," if (!owns(events, selector)) { continue; }",""," handlers = events[selector];",""," for (name in handlers) {"," if (!owns(handlers, name)) { continue; }",""," handler = handlers[name];",""," // TODO: Make this more robust by using lazy-binding:"," // `handler = Y.bind(handler, this);`"," if (typeof handler === 'string') {"," handler = this[handler];"," }",""," if (!handler) {"," continue;"," }",""," this._attachedViewEvents.push("," container.delegate(name, handler, selector, this));"," }"," }",""," return this;"," },",""," /**"," Creates and returns a container node for this view.",""," By default, the container is created from the HTML template specified in the"," `containerTemplate` property, and is _not_ added to the DOM automatically.",""," You may override this method to customize how the container node is created"," (such as by rendering it from a custom template format). Your method must"," return a `Y.Node` instance.",""," @method create"," @param {HTMLElement|Node|String} [container] Selector string, `Y.Node`"," instance, or DOM element to use at the container node."," @return {Node} Node instance of the created container node."," **/"," create: function (container) {"," return container ? Y.one(container) :"," Y.Node.create(this.containerTemplate);"," },",""," /**"," Detaches DOM events that have previously been attached to the container by"," `attachEvents()`.",""," @method detachEvents"," @chainable"," @see attachEvents"," **/"," detachEvents: function () {"," Y.Array.each(this._attachedViewEvents, function (handle) {"," if (handle) {"," handle.detach();"," }"," });",""," this._attachedViewEvents = [];"," return this;"," },",""," /**"," Removes this view's container element from the DOM (if it's in the DOM),"," but doesn't destroy it or any event listeners attached to it.",""," @method remove"," @chainable"," **/"," remove: function () {"," var container = this.get('container');"," container && container.remove();"," return this;"," },",""," /**"," Renders this view.",""," This method is a noop by default. Override it to provide a custom"," implementation that renders this view's content and appends it to the"," container element. Ideally your `render` method should also return `this` as"," the end to allow chaining, but that's up to you.",""," Since there's no default renderer, you're free to render your view however"," you see fit, whether that means manipulating the DOM directly, dumping"," strings into `innerHTML`, or using a template language of some kind.",""," For basic templating needs, `Y.Node.create()` and `Y.Lang.sub()` may"," suffice, but there are no restrictions on what tools or techniques you can"," use to render your view. All you need to do is append something to the"," container element at some point, and optionally append the container"," to the DOM if it's not there already.",""," @method render"," @chainable"," **/"," render: function () {"," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Removes the `container` from the DOM and purges all its event listeners.",""," @method _destroyContainer"," @protected"," **/"," _destroyContainer: function () {"," var container = this.get('container');"," container && container.remove(true);"," },",""," /**"," Getter for the `container` attribute.",""," @method _getContainer"," @param {Node|null} value Current attribute value."," @return {Node} Container node."," @protected"," @since 3.5.0"," **/"," _getContainer: function (value) {"," // This wackiness is necessary to enable fully lazy creation of the"," // container node both when no container is specified and when one is"," // specified via a valueFn.",""," if (!this._container) {"," if (value) {"," // Attach events to the container when it's specified via a"," // valueFn, which won't fire the containerChange event."," this._container = value;"," this.attachEvents();"," } else {"," // Create a default container and set that as the new attribute"," // value. The `this._container` property prevents infinite"," // recursion."," value = this._container = this.create();"," this._set('container', value);"," }"," }",""," return value;"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `containerChange` events. Detaches event handlers from the old"," container (if any) and attaches them to the new container.",""," Right now the `container` attr is initOnly so this event should only ever"," fire the first time the container is created, but in the future (once Y.App"," can handle it) we may allow runtime container changes.",""," @method _afterContainerChange"," @protected"," @since 3.5.0"," **/"," _afterContainerChange: function () {"," this.attachEvents(this.events);"," }","}, {"," NAME: 'view',",""," ATTRS: {"," /**"," Container node into which this view's content will be rendered.",""," The container node serves as the host for all DOM events attached by the"," view. Delegation is used to handle events on children of the container,"," allowing the container's contents to be re-rendered at any time without"," losing event subscriptions.",""," The default container is a `<div>` Node, but you can override this in"," a subclass, or by passing in a custom `container` config value at"," instantiation time. If you override the default container in a subclass"," using `ATTRS`, you must use the `valueFn` property. The view's constructor"," will ignore any assignments using `value`.",""," When `container` is overridden by a subclass or passed as a config"," option at instantiation time, you can provide it as a selector string, a"," DOM element, a `Y.Node` instance, or (if you are subclassing and modifying"," the attribute), a `valueFn` function that returns a `Y.Node` instance."," The value will be converted into a `Y.Node` instance if it isn't one"," already.",""," The container is not added to the page automatically. This allows you to"," have full control over how and when your view is actually rendered to"," the page.",""," @attribute container"," @type HTMLElement|Node|String"," @default Y.Node.create(this.containerTemplate)"," @writeOnce"," **/"," container: {"," getter : '_getContainer',"," setter : Y.one,"," writeOnce: true"," }"," },",""," /**"," Properties that shouldn't be turned into ad-hoc attributes when passed to"," View's constructor.",""," @property _NON_ATTRS_CFG"," @type Array"," @static"," @protected"," @since 3.5.0"," **/"," _NON_ATTRS_CFG: ["," 'containerTemplate',"," 'events',"," 'template'"," ]","});","","","","}, '3.7.2', {\"requires\": [\"base-build\", \"node-event-delegate\"]});"];+_yuitest_coverage["build/view/view.js"].code=["YUI.add('view', function (Y, NAME) {","","/**","Represents a logical piece of an application's user interface, and provides a","lightweight, overridable API for rendering content and handling delegated DOM","events on a container element.","","@module app","@submodule view","@since 3.4.0","**/","","/**","Represents a logical piece of an application's user interface, and provides a","lightweight, overridable API for rendering content and handling delegated DOM","events on a container element.","","The View class imposes little structure and provides only minimal functionality","of its own: it's basically just an overridable API interface that helps you","implement custom views.","","As of YUI 3.5.0, View allows ad-hoc attributes to be specified at instantiation","time, so you don't need to subclass `Y.View` to add custom attributes. Just pass","them to the constructor:",""," var view = new Y.View({foo: 'bar'});"," view.get('foo'); // => \"bar\"","","@class View","@constructor","@extends Base","@since 3.4.0","**/","","function View() {"," View.superclass.constructor.apply(this, arguments);","}","","Y.View = Y.extend(View, Y.Base, {"," // -- Public Properties ----------------------------------------------------",""," /**"," Template for this view's container.",""," @property containerTemplate"," @type String"," @default \"<div/>\""," @since 3.5.0"," **/"," containerTemplate: '<div/>',",""," /**"," Hash of CSS selectors mapped to events to delegate to elements matching"," those selectors.",""," CSS selectors are relative to the `container` element. Events are attached"," to the container, and delegation is used so that subscribers are only"," notified of events that occur on elements inside the container that match"," the specified selectors. This allows the container's contents to be re-"," rendered as needed without losing event subscriptions.",""," Event handlers can be specified either as functions or as strings that map"," to function names on this view instance or its prototype.",""," The `this` object in event handlers will refer to this view instance. If"," you'd prefer `this` to be something else, use `Y.bind()` to bind a custom"," `this` object.",""," @example",""," var view = new Y.View({"," events: {"," // Call `this.toggle()` whenever the element with the id"," // \"toggle-button\" is clicked."," '#toggle-button': {click: 'toggle'},",""," // Call `this.hoverOn()` when the mouse moves over any element"," // with the \"hoverable\" class, and `this.hoverOff()` when the"," // mouse moves out of any element with the \"hoverable\" class."," '.hoverable': {"," mouseover: 'hoverOn',"," mouseout : 'hoverOff'"," }"," }"," });",""," @property events"," @type Object"," @default {}"," **/"," events: {},",""," /**"," Template for this view's contents.",""," This is a convenience property that has no default behavior of its own."," It's only provided as a convention to allow you to store whatever you"," consider to be a template, whether that's an HTML string, a `Y.Node`"," instance, a Mustache template, or anything else your little heart"," desires.",""," How this template gets used is entirely up to you and your custom"," `render()` method.",""," @property template"," @type mixed"," @default ''"," **/"," template: '',",""," // -- Protected Properties -------------------------------------------------",""," /**"," This tells `Y.Base` that it should create ad-hoc attributes for config"," properties passed to View's constructor. This makes it possible to"," instantiate a view and set a bunch of attributes without having to subclass"," `Y.View` and declare all those attributes first.",""," @property _allowAdHocAttrs"," @type Boolean"," @default true"," @protected"," @since 3.5.0"," **/"," _allowAdHocAttrs: true,",""," // -- Lifecycle Methods ----------------------------------------------------"," initializer: function (config) {"," config || (config = {});",""," // Set instance properties specified in the config."," config.containerTemplate &&"," (this.containerTemplate = config.containerTemplate);",""," config.template && (this.template = config.template);",""," // Merge events from the config into events in `this.events`."," this.events = config.events ? Y.merge(this.events, config.events) :"," this.events;",""," // When the container node changes (or when it's set for the first"," // time), we'll attach events to it, but not until then. This allows the"," // container to be created lazily the first time it's accessed rather"," // than always on init."," this.after('containerChange', this._afterContainerChange);"," },",""," /**"," Destroys this View, detaching any DOM events and optionally also destroying"," its container node.",""," By default, the container node will not be destroyed. Pass an _options_"," object with a truthy `remove` property to destroy the container as well.",""," @method destroy"," @param {Object} [options] Options."," @param {Boolean} [options.remove=false] If `true`, this View's container"," will be removed from the DOM and destroyed as well."," @chainable"," */"," destroy: function (options) {"," // We also accept `delete` as a synonym for `remove`."," if (options && (options.remove || options['delete'])) {"," // Attaching an event handler here because the `destroy` event is"," // preventable. If we destroyed the container before calling the"," // superclass's `destroy()` method and the event was prevented, the"," // class would end up in a broken state."," this.onceAfter('destroy', function () {"," this._destroyContainer();"," });"," }",""," return View.superclass.destroy.call(this);"," },",""," destructor: function () {"," this.detachEvents();"," delete this._container;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Attaches delegated event handlers to this view's container element. This"," method is called internally to subscribe to events configured in the"," `events` attribute when the view is initialized.",""," You may override this method to customize the event attaching logic.",""," @method attachEvents"," @param {Object} [events] Hash of events to attach. See the docs for the"," `events` attribute for details on the format. If not specified, this"," view's `events` property will be used."," @chainable"," @see detachEvents"," **/"," attachEvents: function (events) {"," var container = this.get('container'),"," owns = Y.Object.owns,"," handler, handlers, name, selector;",""," this.detachEvents();",""," events || (events = this.events);",""," for (selector in events) {"," if (!owns(events, selector)) { continue; }",""," handlers = events[selector];",""," for (name in handlers) {"," if (!owns(handlers, name)) { continue; }",""," handler = handlers[name];",""," // TODO: Make this more robust by using lazy-binding:"," // `handler = Y.bind(handler, this);`"," if (typeof handler === 'string') {"," handler = this[handler];"," }",""," if (!handler) {"," continue;"," }",""," this._attachedViewEvents.push("," container.delegate(name, handler, selector, this));"," }"," }",""," return this;"," },",""," /**"," Creates and returns a container node for this view.",""," By default, the container is created from the HTML template specified in the"," `containerTemplate` property, and is _not_ added to the DOM automatically.",""," You may override this method to customize how the container node is created"," (such as by rendering it from a custom template format). Your method must"," return a `Y.Node` instance.",""," @method create"," @param {HTMLElement|Node|String} [container] Selector string, `Y.Node`"," instance, or DOM element to use at the container node."," @return {Node} Node instance of the created container node."," **/"," create: function (container) {"," return container ? Y.one(container) :"," Y.Node.create(this.containerTemplate);"," },",""," /**"," Detaches DOM events that have previously been attached to the container by"," `attachEvents()`.",""," @method detachEvents"," @chainable"," @see attachEvents"," **/"," detachEvents: function () {"," Y.Array.each(this._attachedViewEvents, function (handle) {"," if (handle) {"," handle.detach();"," }"," });",""," this._attachedViewEvents = [];"," return this;"," },",""," /**"," Removes this view's container element from the DOM (if it's in the DOM),"," but doesn't destroy it or any event listeners attached to it.",""," @method remove"," @chainable"," **/"," remove: function () {"," var container = this.get('container');"," container && container.remove();"," return this;"," },",""," /**"," Renders this view.",""," This method is a noop by default. Override it to provide a custom"," implementation that renders this view's content and appends it to the"," container element. Ideally your `render` method should also return `this` as"," the end to allow chaining, but that's up to you.",""," Since there's no default renderer, you're free to render your view however"," you see fit, whether that means manipulating the DOM directly, dumping"," strings into `innerHTML`, or using a template language of some kind.",""," For basic templating needs, `Y.Node.create()` and `Y.Lang.sub()` may"," suffice, but there are no restrictions on what tools or techniques you can"," use to render your view. All you need to do is append something to the"," container element at some point, and optionally append the container"," to the DOM if it's not there already.",""," @method render"," @chainable"," **/"," render: function () {"," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Removes the `container` from the DOM and purges all its event listeners.",""," @method _destroyContainer"," @protected"," **/"," _destroyContainer: function () {"," var container = this.get('container');"," container && container.remove(true);"," },",""," /**"," Getter for the `container` attribute.",""," @method _getContainer"," @param {Node|null} value Current attribute value."," @return {Node} Container node."," @protected"," @since 3.5.0"," **/"," _getContainer: function (value) {"," // This wackiness is necessary to enable fully lazy creation of the"," // container node both when no container is specified and when one is"," // specified via a valueFn.",""," if (!this._container) {"," if (value) {"," // Attach events to the container when it's specified via a"," // valueFn, which won't fire the containerChange event."," this._container = value;"," this.attachEvents();"," } else {"," // Create a default container and set that as the new attribute"," // value. The `this._container` property prevents infinite"," // recursion."," value = this._container = this.create();"," this._set('container', value);"," }"," }",""," return value;"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `containerChange` events. Detaches event handlers from the old"," container (if any) and attaches them to the new container.",""," Right now the `container` attr is initOnly so this event should only ever"," fire the first time the container is created, but in the future (once Y.App"," can handle it) we may allow runtime container changes.",""," @method _afterContainerChange"," @protected"," @since 3.5.0"," **/"," _afterContainerChange: function () {"," this.attachEvents(this.events);"," }","}, {"," NAME: 'view',",""," ATTRS: {"," /**"," Container node into which this view's content will be rendered.",""," The container node serves as the host for all DOM events attached by the"," view. Delegation is used to handle events on children of the container,"," allowing the container's contents to be re-rendered at any time without"," losing event subscriptions.",""," The default container is a `<div>` Node, but you can override this in"," a subclass, or by passing in a custom `container` config value at"," instantiation time. If you override the default container in a subclass"," using `ATTRS`, you must use the `valueFn` property. The view's constructor"," will ignore any assignments using `value`.",""," When `container` is overridden by a subclass or passed as a config"," option at instantiation time, you can provide it as a selector string, a"," DOM element, a `Y.Node` instance, or (if you are subclassing and modifying"," the attribute), a `valueFn` function that returns a `Y.Node` instance."," The value will be converted into a `Y.Node` instance if it isn't one"," already.",""," The container is not added to the page automatically. This allows you to"," have full control over how and when your view is actually rendered to"," the page.",""," @attribute container"," @type HTMLElement|Node|String"," @default Y.Node.create(this.containerTemplate)"," @writeOnce"," **/"," container: {"," getter : '_getContainer',"," setter : Y.one,"," writeOnce: true"," }"," },",""," /**"," Properties that shouldn't be turned into ad-hoc attributes when passed to"," View's constructor.",""," @property _NON_ATTRS_CFG"," @type Array"," @static"," @protected"," @since 3.5.0"," **/"," _NON_ATTRS_CFG: ["," 'containerTemplate',"," 'events',"," 'template'"," ]","});","","","","}, '3.7.3', {\"requires\": [\"base-build\", \"node-event-delegate\"]});"]; _yuitest_coverage["build/view/view.js"].lines = {"1":0,"35":0,"36":0,"39":0,"129":0,"132":0,"135":0,"138":0,"145":0,"163":0,"168":0,"169":0,"173":0,"177":0,"178":0,"198":0,"202":0,"204":0,"206":0,"207":0,"209":0,"211":0,"212":0,"214":0,"218":0,"219":0,"222":0,"223":0,"226":0,"231":0,"250":0,"263":0,"264":0,"265":0,"269":0,"270":0,"281":0,"282":0,"283":0,"308":0,"320":0,"321":0,"338":0,"339":0,"342":0,"343":0,"348":0,"349":0,"353":0,"371":0}; _yuitest_coverage["build/view/view.js"].functions = {"View:35":0,"initializer:128":0,"(anonymous 2):168":0,"destroy:161":0,"destructor:176":0,"attachEvents:197":0,"create:249":0,"(anonymous 3):263":0,"detachEvents:262":0,"remove:280":0,"render:307":0,"_destroyContainer:319":0,"_getContainer:333":0,"_afterContainerChange:370":0,"(anonymous 1):1":0}; _yuitest_coverage["build/view/view.js"].coveredLines = 50;@@ -534,4 +534,4 @@ -}, '3.7.2', {"requires": ["base-build", "node-event-delegate"]});+}, '3.7.3', {"requires": ["base-build", "node-event-delegate"]});
bundle/view/view-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -437,4 +437,4 @@ -}, '3.7.2', {"requires": ["base-build", "node-event-delegate"]});+}, '3.7.3', {"requires": ["base-build", "node-event-delegate"]});
bundle/view/view-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("view",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.View=e.extend(n,e.Base,{containerTemplate:"<div/>",events:{},template:"",_allowAdHocAttrs:!0,initializer:function(t){t||(t={}),t.containerTemplate&&(this.containerTemplate=t.containerTemplate),t.template&&(this.template=t.template),this.events=t.events?e.merge(this.events,t.events):this.events,this.after("containerChange",this._afterContainerChange)},destroy:function(e){return e&&(e.remove||e["delete"])&&this.onceAfter("destroy",function(){this._destroyContainer()}),n.superclass.destroy.call(this)},destructor:function(){this.detachEvents(),delete this._container},attachEvents:function(t){var n=this.get("container"),r=e.Object.owns,i,s,o,u;this.detachEvents(),t||(t=this.events);for(u in t){if(!r(t,u))continue;s=t[u];for(o in s){if(!r(s,o))continue;i=s[o],typeof i=="string"&&(i=this[i]);if(!i)continue;this._attachedViewEvents.push(n.delegate(o,i,u,this))}}return this},create:function(t){return t?e.one(t):e.Node.create(this.containerTemplate)},detachEvents:function(){return e.Array.each(this._attachedViewEvents,function(e){e&&e.detach()}),this._attachedViewEvents=[],this},remove:function(){var e=this.get("container");return e&&e.remove(),this},render:function(){return this},_destroyContainer:function(){var e=this.get("container");e&&e.remove(!0)},_getContainer:function(e){return this._container||(e?(this._container=e,this.attachEvents()):(e=this._container=this.create(),this._set("container",e))),e},_afterContainerChange:function(){this.attachEvents(this.events)}},{NAME:"view",ATTRS:{container:{getter:"_getContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["containerTemplate","events","template"]})},"3.7.2",{requires:["base-build","node-event-delegate"]});+YUI.add("view",function(e,t){function n(){n.superclass.constructor.apply(this,arguments)}e.View=e.extend(n,e.Base,{containerTemplate:"<div/>",events:{},template:"",_allowAdHocAttrs:!0,initializer:function(t){t||(t={}),t.containerTemplate&&(this.containerTemplate=t.containerTemplate),t.template&&(this.template=t.template),this.events=t.events?e.merge(this.events,t.events):this.events,this.after("containerChange",this._afterContainerChange)},destroy:function(e){return e&&(e.remove||e["delete"])&&this.onceAfter("destroy",function(){this._destroyContainer()}),n.superclass.destroy.call(this)},destructor:function(){this.detachEvents(),delete this._container},attachEvents:function(t){var n=this.get("container"),r=e.Object.owns,i,s,o,u;this.detachEvents(),t||(t=this.events);for(u in t){if(!r(t,u))continue;s=t[u];for(o in s){if(!r(s,o))continue;i=s[o],typeof i=="string"&&(i=this[i]);if(!i)continue;this._attachedViewEvents.push(n.delegate(o,i,u,this))}}return this},create:function(t){return t?e.one(t):e.Node.create(this.containerTemplate)},detachEvents:function(){return e.Array.each(this._attachedViewEvents,function(e){e&&e.detach()}),this._attachedViewEvents=[],this},remove:function(){var e=this.get("container");return e&&e.remove(),this},render:function(){return this},_destroyContainer:function(){var e=this.get("container");e&&e.remove(!0)},_getContainer:function(e){return this._container||(e?(this._container=e,this.attachEvents()):(e=this._container=this.create(),this._set("container",e))),e},_afterContainerChange:function(){this.attachEvents(this.events)}},{NAME:"view",ATTRS:{container:{getter:"_getContainer",setter:e.one,writeOnce:!0}},_NON_ATTRS_CFG:["containerTemplate","events","template"]})},"3.7.3",{requires:["base-build","node-event-delegate"]});
bundle/view/view.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -436,4 +436,4 @@ -}, '3.7.2', {"requires": ["base-build", "node-event-delegate"]});+}, '3.7.3', {"requires": ["base-build", "node-event-delegate"]});
bundle/widget-anim/widget-anim-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-anim/widget-anim.js", code: [] };-_yuitest_coverage["build/widget-anim/widget-anim.js"].code=["YUI.add('widget-anim', function (Y, NAME) {","","/**"," * Provides a plugin which can be used to animate widget visibility changes."," *"," * @module widget-anim"," */","var BOUNDING_BOX = \"boundingBox\","," HOST = \"host\","," NODE = \"node\","," OPACITY = \"opacity\","," EMPTY_STR = \"\","," VISIBLE = \"visible\","," DESTROY = \"destroy\","," HIDDEN = \"hidden\",",""," RENDERED = \"rendered\","," "," START = \"start\","," END = \"end\",",""," DURATION = \"duration\","," ANIM_SHOW = \"animShow\","," ANIM_HIDE = \"animHide\",",""," _UI_SET_VISIBLE = \"_uiSetVisible\","," "," ANIM_SHOW_CHANGE = \"animShowChange\","," ANIM_HIDE_CHANGE = \"animHideChange\";","","/**"," * A plugin class which can be used to animate widget visibility changes."," *"," * @class WidgetAnim"," * @extends Plugin.Base"," * @namespace Plugin"," */","function WidgetAnim(config) {"," WidgetAnim.superclass.constructor.apply(this, arguments);","}","","/**"," * The namespace for the plugin. This will be the property on the widget, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"anim\""," */","WidgetAnim.NS = \"anim\";","","/**"," * The NAME of the WidgetAnim class. Used to prefix events generated"," * by the plugin class."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginWidgetAnim\""," */","WidgetAnim.NAME = \"pluginWidgetAnim\";","","/**"," * Pre-Packaged Animation implementations, which can be used for animShow and animHide attribute "," * values."," *"," * @property ANIMATIONS"," * @static"," * @type Object"," * @default \"pluginWidgetAnim\""," */","WidgetAnim.ANIMATIONS = {",""," fadeIn : function() {",""," var widget = this.get(HOST),"," boundingBox = widget.get(BOUNDING_BOX),"," "," anim = new Y.Anim({"," node: boundingBox,"," to: { opacity: 1 },"," duration: this.get(DURATION)"," });",""," // Set initial opacity, to avoid initial flicker"," if (!widget.get(VISIBLE)) {"," boundingBox.setStyle(OPACITY, 0);"," }",""," // Clean up, on destroy. Where supported, remove"," // opacity set using style. Else make 100% opaque"," anim.on(DESTROY, function() {"," this.get(NODE).setStyle(OPACITY, (Y.UA.ie) ? 1 : EMPTY_STR);"," });",""," return anim;"," },",""," fadeOut : function() {"," return new Y.Anim({"," node: this.get(HOST).get(BOUNDING_BOX),"," to: { opacity: 0 },"," duration: this.get(DURATION)"," });"," }","};","","/**"," * Static property used to define the default attribute "," * configuration for the plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */","WidgetAnim.ATTRS = {",""," /**"," * Default duration in seconds. Used as the default duration for the default animation implementations"," *"," * @attribute duration"," * @type Number"," * @default 0.2 (seconds "," */"," duration : {"," value: 0.2"," },",""," /**"," * Default animation instance used for showing the widget (opacity fade-in)"," * "," * @attribute animShow"," * @type Anim"," * @default WidgetAnim.ANIMATIONS.fadeIn"," */"," animShow : {"," valueFn: WidgetAnim.ANIMATIONS.fadeIn"," },",""," /**"," * Default animation instance used for hiding the widget (opacity fade-out)"," *"," * @attribute animHide"," * @type Anim"," * @default WidgetAnim.ANIMATIONS.fadeOut"," */"," animHide : {"," valueFn: WidgetAnim.ANIMATIONS.fadeOut"," }","};","","Y.extend(WidgetAnim, Y.Plugin.Base, {",""," /**"," * The initializer lifecycle implementation. Modifies the host widget's "," * visibililty implementation to add animation."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {"," this._bindAnimShow();"," this._bindAnimHide();",""," this.after(ANIM_SHOW_CHANGE, this._bindAnimShow);"," this.after(ANIM_HIDE_CHANGE, this._bindAnimHide);",""," // Override default _uiSetVisible method, with custom animated method"," this.beforeHostMethod(_UI_SET_VISIBLE, this._uiAnimSetVisible);"," },",""," /**"," * The initializer destructor implementation. Responsible for destroying the configured"," * animation instances."," * "," * @method destructor"," */"," destructor : function() {"," this.get(ANIM_SHOW).destroy();"," this.get(ANIM_HIDE).destroy();"," },",""," /**"," * The injected method used to override the host widget's _uiSetVisible implementation with"," * an animated version of the same."," *"," * <p>This method replaces the default _uiSetVisible handler"," * Widget provides, by injecting itself before _uiSetVisible,"," * and preventing the default behavior. </p>"," *"," * @method _uiAnimSetVisible"," * @protected"," * @param {boolean} val true, if making the widget visible. false, if hiding it."," */"," _uiAnimSetVisible : function(val) {"," if (this.get(HOST).get(RENDERED)) {"," if (val) {"," this.get(ANIM_HIDE).stop();"," this.get(ANIM_SHOW).run();"," } else {"," this.get(ANIM_SHOW).stop();"," this.get(ANIM_HIDE).run();"," }"," return new Y.Do.Prevent();"," }"," },",""," /**"," * The original Widget _uiSetVisible implementation. This currently needs to be replicated,"," * so it can be invoked before or after the animation starts or stops, since the original"," * methods is not available to the AOP implementation."," *"," * @method _uiSetVisible"," * @param {boolean} val true, if making the widget visible. false, if hiding it."," * @private"," */"," _uiSetVisible : function(val) {"," var host = this.get(HOST),"," hiddenClass = host.getClassName(HIDDEN);",""," host.get(BOUNDING_BOX).toggleClass(hiddenClass, !val);"," },",""," /**"," * Binds a listener to invoke the original visibility handling when the animShow animation is started"," *"," * @method _bindAnimShow"," * @private"," */"," _bindAnimShow : function() {"," // Setup original visibility handling (for show) before starting to animate"," this.get(ANIM_SHOW).on(START, "," Y.bind(function() {"," this._uiSetVisible(true);"," }, this));"," },",""," /**"," * Binds a listener to invoke the original visibility handling when the animHide animation is complete"," *"," * @method _bindAnimHide"," * @private"," */"," _bindAnimHide : function() {"," // Setup original visibility handling (for hide) after completing animation"," this.get(ANIM_HIDE).after(END, "," Y.bind(function() {"," this._uiSetVisible(false);"," }, this));"," }","});","","Y.namespace(\"Plugin\").WidgetAnim = WidgetAnim;","","","}, '3.7.2', {\"requires\": [\"anim-base\", \"plugin\", \"widget\"]});"];+_yuitest_coverage["build/widget-anim/widget-anim.js"].code=["YUI.add('widget-anim', function (Y, NAME) {","","/**"," * Provides a plugin which can be used to animate widget visibility changes."," *"," * @module widget-anim"," */","var BOUNDING_BOX = \"boundingBox\","," HOST = \"host\","," NODE = \"node\","," OPACITY = \"opacity\","," EMPTY_STR = \"\","," VISIBLE = \"visible\","," DESTROY = \"destroy\","," HIDDEN = \"hidden\",",""," RENDERED = \"rendered\","," "," START = \"start\","," END = \"end\",",""," DURATION = \"duration\","," ANIM_SHOW = \"animShow\","," ANIM_HIDE = \"animHide\",",""," _UI_SET_VISIBLE = \"_uiSetVisible\","," "," ANIM_SHOW_CHANGE = \"animShowChange\","," ANIM_HIDE_CHANGE = \"animHideChange\";","","/**"," * A plugin class which can be used to animate widget visibility changes."," *"," * @class WidgetAnim"," * @extends Plugin.Base"," * @namespace Plugin"," */","function WidgetAnim(config) {"," WidgetAnim.superclass.constructor.apply(this, arguments);","}","","/**"," * The namespace for the plugin. This will be the property on the widget, which will "," * reference the plugin instance, when it's plugged in."," *"," * @property NS"," * @static"," * @type String"," * @default \"anim\""," */","WidgetAnim.NS = \"anim\";","","/**"," * The NAME of the WidgetAnim class. Used to prefix events generated"," * by the plugin class."," *"," * @property NAME"," * @static"," * @type String"," * @default \"pluginWidgetAnim\""," */","WidgetAnim.NAME = \"pluginWidgetAnim\";","","/**"," * Pre-Packaged Animation implementations, which can be used for animShow and animHide attribute "," * values."," *"," * @property ANIMATIONS"," * @static"," * @type Object"," * @default \"pluginWidgetAnim\""," */","WidgetAnim.ANIMATIONS = {",""," fadeIn : function() {",""," var widget = this.get(HOST),"," boundingBox = widget.get(BOUNDING_BOX),"," "," anim = new Y.Anim({"," node: boundingBox,"," to: { opacity: 1 },"," duration: this.get(DURATION)"," });",""," // Set initial opacity, to avoid initial flicker"," if (!widget.get(VISIBLE)) {"," boundingBox.setStyle(OPACITY, 0);"," }",""," // Clean up, on destroy. Where supported, remove"," // opacity set using style. Else make 100% opaque"," anim.on(DESTROY, function() {"," this.get(NODE).setStyle(OPACITY, (Y.UA.ie) ? 1 : EMPTY_STR);"," });",""," return anim;"," },",""," fadeOut : function() {"," return new Y.Anim({"," node: this.get(HOST).get(BOUNDING_BOX),"," to: { opacity: 0 },"," duration: this.get(DURATION)"," });"," }","};","","/**"," * Static property used to define the default attribute "," * configuration for the plugin."," *"," * @property ATTRS"," * @type Object"," * @static"," */","WidgetAnim.ATTRS = {",""," /**"," * Default duration in seconds. Used as the default duration for the default animation implementations"," *"," * @attribute duration"," * @type Number"," * @default 0.2 (seconds "," */"," duration : {"," value: 0.2"," },",""," /**"," * Default animation instance used for showing the widget (opacity fade-in)"," * "," * @attribute animShow"," * @type Anim"," * @default WidgetAnim.ANIMATIONS.fadeIn"," */"," animShow : {"," valueFn: WidgetAnim.ANIMATIONS.fadeIn"," },",""," /**"," * Default animation instance used for hiding the widget (opacity fade-out)"," *"," * @attribute animHide"," * @type Anim"," * @default WidgetAnim.ANIMATIONS.fadeOut"," */"," animHide : {"," valueFn: WidgetAnim.ANIMATIONS.fadeOut"," }","};","","Y.extend(WidgetAnim, Y.Plugin.Base, {",""," /**"," * The initializer lifecycle implementation. Modifies the host widget's "," * visibililty implementation to add animation."," *"," * @method initializer"," * @param {Object} config The user configuration for the plugin "," */"," initializer : function(config) {"," this._bindAnimShow();"," this._bindAnimHide();",""," this.after(ANIM_SHOW_CHANGE, this._bindAnimShow);"," this.after(ANIM_HIDE_CHANGE, this._bindAnimHide);",""," // Override default _uiSetVisible method, with custom animated method"," this.beforeHostMethod(_UI_SET_VISIBLE, this._uiAnimSetVisible);"," },",""," /**"," * The initializer destructor implementation. Responsible for destroying the configured"," * animation instances."," * "," * @method destructor"," */"," destructor : function() {"," this.get(ANIM_SHOW).destroy();"," this.get(ANIM_HIDE).destroy();"," },",""," /**"," * The injected method used to override the host widget's _uiSetVisible implementation with"," * an animated version of the same."," *"," * <p>This method replaces the default _uiSetVisible handler"," * Widget provides, by injecting itself before _uiSetVisible,"," * and preventing the default behavior. </p>"," *"," * @method _uiAnimSetVisible"," * @protected"," * @param {boolean} val true, if making the widget visible. false, if hiding it."," */"," _uiAnimSetVisible : function(val) {"," if (this.get(HOST).get(RENDERED)) {"," if (val) {"," this.get(ANIM_HIDE).stop();"," this.get(ANIM_SHOW).run();"," } else {"," this.get(ANIM_SHOW).stop();"," this.get(ANIM_HIDE).run();"," }"," return new Y.Do.Prevent();"," }"," },",""," /**"," * The original Widget _uiSetVisible implementation. This currently needs to be replicated,"," * so it can be invoked before or after the animation starts or stops, since the original"," * methods is not available to the AOP implementation."," *"," * @method _uiSetVisible"," * @param {boolean} val true, if making the widget visible. false, if hiding it."," * @private"," */"," _uiSetVisible : function(val) {"," var host = this.get(HOST),"," hiddenClass = host.getClassName(HIDDEN);",""," host.get(BOUNDING_BOX).toggleClass(hiddenClass, !val);"," },",""," /**"," * Binds a listener to invoke the original visibility handling when the animShow animation is started"," *"," * @method _bindAnimShow"," * @private"," */"," _bindAnimShow : function() {"," // Setup original visibility handling (for show) before starting to animate"," this.get(ANIM_SHOW).on(START, "," Y.bind(function() {"," this._uiSetVisible(true);"," }, this));"," },",""," /**"," * Binds a listener to invoke the original visibility handling when the animHide animation is complete"," *"," * @method _bindAnimHide"," * @private"," */"," _bindAnimHide : function() {"," // Setup original visibility handling (for hide) after completing animation"," this.get(ANIM_HIDE).after(END, "," Y.bind(function() {"," this._uiSetVisible(false);"," }, this));"," }","});","","Y.namespace(\"Plugin\").WidgetAnim = WidgetAnim;","","","}, '3.7.3', {\"requires\": [\"anim-base\", \"plugin\", \"widget\"]});"]; _yuitest_coverage["build/widget-anim/widget-anim.js"].lines = {"1":0,"8":0,"38":0,"39":0,"51":0,"62":0,"73":0,"77":0,"87":0,"88":0,"93":0,"94":0,"97":0,"101":0,"117":0,"153":0,"163":0,"164":0,"166":0,"167":0,"170":0,"180":0,"181":0,"197":0,"198":0,"199":0,"200":0,"202":0,"203":0,"205":0,"219":0,"222":0,"233":0,"235":0,"247":0,"249":0,"254":0}; _yuitest_coverage["build/widget-anim/widget-anim.js"].functions = {"WidgetAnim:38":0,"(anonymous 2):93":0,"fadeIn:75":0,"fadeOut:100":0,"initializer:162":0,"destructor:179":0,"_uiAnimSetVisible:196":0,"_uiSetVisible:218":0,"(anonymous 3):234":0,"_bindAnimShow:231":0,"(anonymous 4):248":0,"_bindAnimHide:245":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-anim/widget-anim.js"].coveredLines = 37;@@ -343,4 +343,4 @@ Y.namespace("Plugin").WidgetAnim = WidgetAnim; -}, '3.7.2', {"requires": ["anim-base", "plugin", "widget"]});+}, '3.7.3', {"requires": ["anim-base", "plugin", "widget"]});
bundle/widget-anim/widget-anim-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -260,4 +260,4 @@ Y.namespace("Plugin").WidgetAnim = WidgetAnim; -}, '3.7.2', {"requires": ["anim-base", "plugin", "widget"]});+}, '3.7.3', {"requires": ["anim-base", "plugin", "widget"]});
bundle/widget-anim/widget-anim-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-anim",function(e,t){function b(e){b.superclass.constructor.apply(this,arguments)}var n="boundingBox",r="host",i="node",s="opacity",o="",u="visible",a="destroy",f="hidden",l="rendered",c="start",h="end",p="duration",d="animShow",v="animHide",m="_uiSetVisible",g="animShowChange",y="animHideChange";b.NS="anim",b.NAME="pluginWidgetAnim",b.ANIMATIONS={fadeIn:function(){var t=this.get(r),f=t.get(n),l=new e.Anim({node:f,to:{opacity:1},duration:this.get(p)});return t.get(u)||f.setStyle(s,0),l.on(a,function(){this.get(i).setStyle(s,e.UA.ie?1:o)}),l},fadeOut:function(){return new e.Anim({node:this.get(r).get(n),to:{opacity:0},duration:this.get(p)})}},b.ATTRS={duration:{value:.2},animShow:{valueFn:b.ANIMATIONS.fadeIn},animHide:{valueFn:b.ANIMATIONS.fadeOut}},e.extend(b,e.Plugin.Base,{initializer:function(e){this._bindAnimShow(),this._bindAnimHide(),this.after(g,this._bindAnimShow),this.after(y,this._bindAnimHide),this.beforeHostMethod(m,this._uiAnimSetVisible)},destructor:function(){this.get(d).destroy(),this.get(v).destroy()},_uiAnimSetVisible:function(t){if(this.get(r).get(l))return t?(this.get(v).stop(),this.get(d).run()):(this.get(d).stop(),this.get(v).run()),new e.Do.Prevent},_uiSetVisible:function(e){var t=this.get(r),i=t.getClassName(f);t.get(n).toggleClass(i,!e)},_bindAnimShow:function(){this.get(d).on(c,e.bind(function(){this._uiSetVisible(!0)},this))},_bindAnimHide:function(){this.get(v).after(h,e.bind(function(){this._uiSetVisible(!1)},this))}}),e.namespace("Plugin").WidgetAnim=b},"3.7.2",{requires:["anim-base","plugin","widget"]});+YUI.add("widget-anim",function(e,t){function b(e){b.superclass.constructor.apply(this,arguments)}var n="boundingBox",r="host",i="node",s="opacity",o="",u="visible",a="destroy",f="hidden",l="rendered",c="start",h="end",p="duration",d="animShow",v="animHide",m="_uiSetVisible",g="animShowChange",y="animHideChange";b.NS="anim",b.NAME="pluginWidgetAnim",b.ANIMATIONS={fadeIn:function(){var t=this.get(r),f=t.get(n),l=new e.Anim({node:f,to:{opacity:1},duration:this.get(p)});return t.get(u)||f.setStyle(s,0),l.on(a,function(){this.get(i).setStyle(s,e.UA.ie?1:o)}),l},fadeOut:function(){return new e.Anim({node:this.get(r).get(n),to:{opacity:0},duration:this.get(p)})}},b.ATTRS={duration:{value:.2},animShow:{valueFn:b.ANIMATIONS.fadeIn},animHide:{valueFn:b.ANIMATIONS.fadeOut}},e.extend(b,e.Plugin.Base,{initializer:function(e){this._bindAnimShow(),this._bindAnimHide(),this.after(g,this._bindAnimShow),this.after(y,this._bindAnimHide),this.beforeHostMethod(m,this._uiAnimSetVisible)},destructor:function(){this.get(d).destroy(),this.get(v).destroy()},_uiAnimSetVisible:function(t){if(this.get(r).get(l))return t?(this.get(v).stop(),this.get(d).run()):(this.get(d).stop(),this.get(v).run()),new e.Do.Prevent},_uiSetVisible:function(e){var t=this.get(r),i=t.getClassName(f);t.get(n).toggleClass(i,!e)},_bindAnimShow:function(){this.get(d).on(c,e.bind(function(){this._uiSetVisible(!0)},this))},_bindAnimHide:function(){this.get(v).after(h,e.bind(function(){this._uiSetVisible(!1)},this))}}),e.namespace("Plugin").WidgetAnim=b},"3.7.3",{requires:["anim-base","plugin","widget"]});
bundle/widget-anim/widget-anim.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -260,4 +260,4 @@ Y.namespace("Plugin").WidgetAnim = WidgetAnim; -}, '3.7.2', {"requires": ["anim-base", "plugin", "widget"]});+}, '3.7.3', {"requires": ["anim-base", "plugin", "widget"]});
bundle/widget-autohide/widget-autohide-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-autohide/widget-autohide.js", code: [] };-_yuitest_coverage["build/widget-autohide/widget-autohide.js"].code=["YUI.add('widget-autohide', function (Y, NAME) {","","/**"," * A widget-level extension that provides ability to hide widget when"," * certain events occur."," *"," * @module widget-autohide"," * @author eferraiuolo, tilomitra"," * @since 3.4.0"," */","","","var WIDGET_AUTOHIDE = 'widgetAutohide',"," AUTOHIDE = 'autohide',"," CLICK_OUTSIDE = 'clickoutside',"," FOCUS_OUTSIDE = 'focusoutside',"," DOCUMENT = 'document',"," KEY = 'key',"," PRESS_ESCAPE = 'esc',"," BIND_UI = 'bindUI',"," SYNC_UI = \"syncUI\","," RENDERED = \"rendered\","," BOUNDING_BOX = \"boundingBox\","," VISIBLE = \"visible\","," CHANGE = 'Change',",""," getCN = Y.ClassNameManager.getClassName;","","/**"," * The WidgetAutohide class provides the hideOn attribute which can"," * be used to hide the widget when certain events occur."," *"," * @class WidgetAutohide"," * @param {Object} config User configuration object"," */","function WidgetAutohide(config) {"," Y.after(this._bindUIAutohide, this, BIND_UI);"," Y.after(this._syncUIAutohide, this, SYNC_UI);","",""," if (this.get(RENDERED)) {"," this._bindUIAutohide();"," this._syncUIAutohide();"," }","","}","","/**","* Static property used to define the default attribute","* configuration introduced by WidgetAutohide.","*","* @property ATTRS","* @static","* @type Object","*/","WidgetAutohide.ATTRS = {","",""," /**"," * @attribute hideOn"," * @type array"," *"," * @description An array of objects corresponding to the nodes, events, and keycodes to hide the widget on."," * The implementer can supply an array of objects, with each object having the following properties:"," * <p>eventName: (string, required): The eventName to listen to.</p>"," * <p>node: (Y.Node, optional): The Y.Node that will fire the event (defaults to the boundingBox of the widget)</p>"," * <p>keyCode: (string, optional): If listening for key events, specify the keyCode</p>"," * <p>By default, this attribute consists of one object which will cause the widget to hide if the"," * escape key is pressed.</p>"," */"," hideOn: {"," validator: Y.Lang.isArray,"," valueFn : function() {"," return ["," {"," node: Y.one(DOCUMENT),"," eventName: KEY,"," keyCode: PRESS_ESCAPE"," }"," ];"," }"," }","};","","WidgetAutohide.prototype = {"," // *** Instance Members *** //",""," _uiHandlesAutohide : null,",""," // *** Lifecycle Methods *** //",""," destructor : function () {",""," this._detachUIHandlesAutohide();"," },",""," /**"," * Binds event listeners to the widget."," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIAutohide"," * @protected"," */"," _bindUIAutohide : function () {",""," this.after(VISIBLE+CHANGE, this._afterHostVisibleChangeAutohide);"," this.after(\"hideOnChange\", this._afterHideOnChange);"," },",""," /**"," * Syncs up the widget based on its current state. In particular, removes event listeners if"," * widget is not visible, and attaches them otherwise."," * <p>"," * This method in invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIAutohide"," * @protected"," */"," _syncUIAutohide : function () {",""," this._uiSetHostVisibleAutohide(this.get(VISIBLE));"," },",""," // *** Private Methods *** //",""," /**"," * Removes event listeners if widget is not visible, and attaches them otherwise."," *"," * @method _uiSetHostVisibleAutohide"," * @protected"," */"," _uiSetHostVisibleAutohide : function (visible) {",""," if (visible) {"," //this._attachUIHandlesAutohide();"," Y.later(1, this, '_attachUIHandlesAutohide');"," } else {"," this._detachUIHandlesAutohide();"," }"," },",""," /**"," * Iterates through all objects in the hideOn attribute and creates event listeners."," *"," * @method _attachUIHandlesAutohide"," * @protected"," */"," _attachUIHandlesAutohide : function () {",""," if (this._uiHandlesAutohide) { return; }",""," var bb = this.get(BOUNDING_BOX),"," hide = Y.bind(this.hide,this),"," uiHandles = [],"," self = this,"," hideOn = this.get('hideOn'),"," i = 0,"," o = {node: undefined, ev: undefined, keyCode: undefined};",""," //push all events on which the widget should be hidden"," for (; i < hideOn.length; i++) {",""," o.node = hideOn[i].node;"," o.ev = hideOn[i].eventName;"," o.keyCode = hideOn[i].keyCode;",""," //no keycode or node defined"," if (!o.node && !o.keyCode && o.ev) {"," uiHandles.push(bb.on(o.ev, hide));"," }",""," //node defined, no keycode (not a keypress)"," else if (o.node && !o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, hide));"," }",""," //node defined, keycode defined, event defined (its a key press)"," else if (o.node && o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, hide, o.keyCode));"," }",""," else {"," }",""," }",""," this._uiHandlesAutohide = uiHandles;"," },",""," /**"," * Detaches all event listeners created by this extension"," *"," * @method _detachUIHandlesAutohide"," * @protected"," */"," _detachUIHandlesAutohide : function () {",""," Y.each(this._uiHandlesAutohide, function(h){"," h.detach();"," });"," this._uiHandlesAutohide = null;"," },",""," /**"," * Default function called when the visibility of the widget changes. Determines"," * whether to attach or detach event listeners based on the visibility of the widget."," *"," * @method _afterHostVisibleChangeAutohide"," * @protected"," */"," _afterHostVisibleChangeAutohide : function (e) {",""," this._uiSetHostVisibleAutohide(e.newVal);"," },",""," /**"," * Default function called when hideOn Attribute is changed. Remove existing listeners and create new listeners."," *"," * @method _afterHideOnChange"," */"," _afterHideOnChange : function(e) {"," this._detachUIHandlesAutohide();",""," if (this.get(VISIBLE)) {"," this._attachUIHandlesAutohide();"," }"," }","};","","Y.WidgetAutohide = WidgetAutohide;","","","}, '3.7.2', {\"requires\": [\"base-build\", \"event-key\", \"event-outside\", \"widget\"]});"];+_yuitest_coverage["build/widget-autohide/widget-autohide.js"].code=["YUI.add('widget-autohide', function (Y, NAME) {","","/**"," * A widget-level extension that provides ability to hide widget when"," * certain events occur."," *"," * @module widget-autohide"," * @author eferraiuolo, tilomitra"," * @since 3.4.0"," */","","","var WIDGET_AUTOHIDE = 'widgetAutohide',"," AUTOHIDE = 'autohide',"," CLICK_OUTSIDE = 'clickoutside',"," FOCUS_OUTSIDE = 'focusoutside',"," DOCUMENT = 'document',"," KEY = 'key',"," PRESS_ESCAPE = 'esc',"," BIND_UI = 'bindUI',"," SYNC_UI = \"syncUI\","," RENDERED = \"rendered\","," BOUNDING_BOX = \"boundingBox\","," VISIBLE = \"visible\","," CHANGE = 'Change',",""," getCN = Y.ClassNameManager.getClassName;","","/**"," * The WidgetAutohide class provides the hideOn attribute which can"," * be used to hide the widget when certain events occur."," *"," * @class WidgetAutohide"," * @param {Object} config User configuration object"," */","function WidgetAutohide(config) {"," Y.after(this._bindUIAutohide, this, BIND_UI);"," Y.after(this._syncUIAutohide, this, SYNC_UI);","",""," if (this.get(RENDERED)) {"," this._bindUIAutohide();"," this._syncUIAutohide();"," }","","}","","/**","* Static property used to define the default attribute","* configuration introduced by WidgetAutohide.","*","* @property ATTRS","* @static","* @type Object","*/","WidgetAutohide.ATTRS = {","",""," /**"," * @attribute hideOn"," * @type array"," *"," * @description An array of objects corresponding to the nodes, events, and keycodes to hide the widget on."," * The implementer can supply an array of objects, with each object having the following properties:"," * <p>eventName: (string, required): The eventName to listen to.</p>"," * <p>node: (Y.Node, optional): The Y.Node that will fire the event (defaults to the boundingBox of the widget)</p>"," * <p>keyCode: (string, optional): If listening for key events, specify the keyCode</p>"," * <p>By default, this attribute consists of one object which will cause the widget to hide if the"," * escape key is pressed.</p>"," */"," hideOn: {"," validator: Y.Lang.isArray,"," valueFn : function() {"," return ["," {"," node: Y.one(DOCUMENT),"," eventName: KEY,"," keyCode: PRESS_ESCAPE"," }"," ];"," }"," }","};","","WidgetAutohide.prototype = {"," // *** Instance Members *** //",""," _uiHandlesAutohide : null,",""," // *** Lifecycle Methods *** //",""," destructor : function () {",""," this._detachUIHandlesAutohide();"," },",""," /**"," * Binds event listeners to the widget."," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIAutohide"," * @protected"," */"," _bindUIAutohide : function () {",""," this.after(VISIBLE+CHANGE, this._afterHostVisibleChangeAutohide);"," this.after(\"hideOnChange\", this._afterHideOnChange);"," },",""," /**"," * Syncs up the widget based on its current state. In particular, removes event listeners if"," * widget is not visible, and attaches them otherwise."," * <p>"," * This method in invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIAutohide"," * @protected"," */"," _syncUIAutohide : function () {",""," this._uiSetHostVisibleAutohide(this.get(VISIBLE));"," },",""," // *** Private Methods *** //",""," /**"," * Removes event listeners if widget is not visible, and attaches them otherwise."," *"," * @method _uiSetHostVisibleAutohide"," * @protected"," */"," _uiSetHostVisibleAutohide : function (visible) {",""," if (visible) {"," //this._attachUIHandlesAutohide();"," Y.later(1, this, '_attachUIHandlesAutohide');"," } else {"," this._detachUIHandlesAutohide();"," }"," },",""," /**"," * Iterates through all objects in the hideOn attribute and creates event listeners."," *"," * @method _attachUIHandlesAutohide"," * @protected"," */"," _attachUIHandlesAutohide : function () {",""," if (this._uiHandlesAutohide) { return; }",""," var bb = this.get(BOUNDING_BOX),"," hide = Y.bind(this.hide,this),"," uiHandles = [],"," self = this,"," hideOn = this.get('hideOn'),"," i = 0,"," o = {node: undefined, ev: undefined, keyCode: undefined};",""," //push all events on which the widget should be hidden"," for (; i < hideOn.length; i++) {",""," o.node = hideOn[i].node;"," o.ev = hideOn[i].eventName;"," o.keyCode = hideOn[i].keyCode;",""," //no keycode or node defined"," if (!o.node && !o.keyCode && o.ev) {"," uiHandles.push(bb.on(o.ev, hide));"," }",""," //node defined, no keycode (not a keypress)"," else if (o.node && !o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, hide));"," }",""," //node defined, keycode defined, event defined (its a key press)"," else if (o.node && o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, hide, o.keyCode));"," }",""," else {"," }",""," }",""," this._uiHandlesAutohide = uiHandles;"," },",""," /**"," * Detaches all event listeners created by this extension"," *"," * @method _detachUIHandlesAutohide"," * @protected"," */"," _detachUIHandlesAutohide : function () {",""," Y.each(this._uiHandlesAutohide, function(h){"," h.detach();"," });"," this._uiHandlesAutohide = null;"," },",""," /**"," * Default function called when the visibility of the widget changes. Determines"," * whether to attach or detach event listeners based on the visibility of the widget."," *"," * @method _afterHostVisibleChangeAutohide"," * @protected"," */"," _afterHostVisibleChangeAutohide : function (e) {",""," this._uiSetHostVisibleAutohide(e.newVal);"," },",""," /**"," * Default function called when hideOn Attribute is changed. Remove existing listeners and create new listeners."," *"," * @method _afterHideOnChange"," */"," _afterHideOnChange : function(e) {"," this._detachUIHandlesAutohide();",""," if (this.get(VISIBLE)) {"," this._attachUIHandlesAutohide();"," }"," }","};","","Y.WidgetAutohide = WidgetAutohide;","","","}, '3.7.3', {\"requires\": [\"base-build\", \"event-key\", \"event-outside\", \"widget\"]});"]; _yuitest_coverage["build/widget-autohide/widget-autohide.js"].lines = {"1":0,"13":0,"36":0,"37":0,"38":0,"41":0,"42":0,"43":0,"56":0,"74":0,"85":0,"94":0,"108":0,"109":0,"124":0,"137":0,"139":0,"141":0,"153":0,"155":0,"164":0,"166":0,"167":0,"168":0,"171":0,"172":0,"176":0,"177":0,"181":0,"182":0,"190":0,"201":0,"202":0,"204":0,"216":0,"225":0,"227":0,"228":0,"233":0}; _yuitest_coverage["build/widget-autohide/widget-autohide.js"].functions = {"WidgetAutohide:36":0,"valueFn:73":0,"destructor:92":0,"_bindUIAutohide:106":0,"_syncUIAutohide:122":0,"_uiSetHostVisibleAutohide:135":0,"_attachUIHandlesAutohide:151":0,"(anonymous 2):201":0,"_detachUIHandlesAutohide:199":0,"_afterHostVisibleChangeAutohide:214":0,"_afterHideOnChange:224":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-autohide/widget-autohide.js"].coveredLines = 39;@@ -323,4 +323,4 @@ Y.WidgetAutohide = WidgetAutohide; -}, '3.7.2', {"requires": ["base-build", "event-key", "event-outside", "widget"]});+}, '3.7.3', {"requires": ["base-build", "event-key", "event-outside", "widget"]});
bundle/widget-autohide/widget-autohide-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -240,4 +240,4 @@ Y.WidgetAutohide = WidgetAutohide; -}, '3.7.2', {"requires": ["base-build", "event-key", "event-outside", "widget"]});+}, '3.7.3', {"requires": ["base-build", "event-key", "event-outside", "widget"]});
bundle/widget-autohide/widget-autohide-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-autohide",function(e,t){function m(t){e.after(this._bindUIAutohide,this,f),e.after(this._syncUIAutohide,this,l),this.get(c)&&(this._bindUIAutohide(),this._syncUIAutohide())}var n="widgetAutohide",r="autohide",i="clickoutside",s="focusoutside",o="document",u="key",a="esc",f="bindUI",l="syncUI",c="rendered",h="boundingBox",p="visible",d="Change",v=e.ClassNameManager.getClassName;m.ATTRS={hideOn:{validator:e.Lang.isArray,valueFn:function(){return[{node:e.one(o),eventName:u,keyCode:a}]}}},m.prototype={_uiHandlesAutohide:null,destructor:function(){this._detachUIHandlesAutohide()},_bindUIAutohide:function(){this.after(p+d,this._afterHostVisibleChangeAutohide),this.after("hideOnChange",this._afterHideOnChange)},_syncUIAutohide:function(){this._uiSetHostVisibleAutohide(this.get(p))},_uiSetHostVisibleAutohide:function(t){t?e.later(1,this,"_attachUIHandlesAutohide"):this._detachUIHandlesAutohide()},_attachUIHandlesAutohide:function(){if(this._uiHandlesAutohide)return;var t=this.get(h),n=e.bind(this.hide,this),r=[],i=this,s=this.get("hideOn"),o=0,u={node:undefined,ev:undefined,keyCode:undefined};for(;o<s.length;o++)u.node=s[o].node,u.ev=s[o].eventName,u.keyCode=s[o].keyCode,!u.node&&!u.keyCode&&u.ev?r.push(t.on(u.ev,n)):u.node&&!u.keyCode&&u.ev?r.push(u.node.on(u.ev,n)):u.node&&u.keyCode&&u.ev&&r.push(u.node.on(u.ev,n,u.keyCode));this._uiHandlesAutohide=r},_detachUIHandlesAutohide:function(){e.each(this._uiHandlesAutohide,function(e){e.detach()}),this._uiHandlesAutohide=null},_afterHostVisibleChangeAutohide:function(e){this._uiSetHostVisibleAutohide(e.newVal)},_afterHideOnChange:function(e){this._detachUIHandlesAutohide(),this.get(p)&&this._attachUIHandlesAutohide()}},e.WidgetAutohide=m},"3.7.2",{requires:["base-build","event-key","event-outside","widget"]});+YUI.add("widget-autohide",function(e,t){function m(t){e.after(this._bindUIAutohide,this,f),e.after(this._syncUIAutohide,this,l),this.get(c)&&(this._bindUIAutohide(),this._syncUIAutohide())}var n="widgetAutohide",r="autohide",i="clickoutside",s="focusoutside",o="document",u="key",a="esc",f="bindUI",l="syncUI",c="rendered",h="boundingBox",p="visible",d="Change",v=e.ClassNameManager.getClassName;m.ATTRS={hideOn:{validator:e.Lang.isArray,valueFn:function(){return[{node:e.one(o),eventName:u,keyCode:a}]}}},m.prototype={_uiHandlesAutohide:null,destructor:function(){this._detachUIHandlesAutohide()},_bindUIAutohide:function(){this.after(p+d,this._afterHostVisibleChangeAutohide),this.after("hideOnChange",this._afterHideOnChange)},_syncUIAutohide:function(){this._uiSetHostVisibleAutohide(this.get(p))},_uiSetHostVisibleAutohide:function(t){t?e.later(1,this,"_attachUIHandlesAutohide"):this._detachUIHandlesAutohide()},_attachUIHandlesAutohide:function(){if(this._uiHandlesAutohide)return;var t=this.get(h),n=e.bind(this.hide,this),r=[],i=this,s=this.get("hideOn"),o=0,u={node:undefined,ev:undefined,keyCode:undefined};for(;o<s.length;o++)u.node=s[o].node,u.ev=s[o].eventName,u.keyCode=s[o].keyCode,!u.node&&!u.keyCode&&u.ev?r.push(t.on(u.ev,n)):u.node&&!u.keyCode&&u.ev?r.push(u.node.on(u.ev,n)):u.node&&u.keyCode&&u.ev&&r.push(u.node.on(u.ev,n,u.keyCode));this._uiHandlesAutohide=r},_detachUIHandlesAutohide:function(){e.each(this._uiHandlesAutohide,function(e){e.detach()}),this._uiHandlesAutohide=null},_afterHostVisibleChangeAutohide:function(e){this._uiSetHostVisibleAutohide(e.newVal)},_afterHideOnChange:function(e){this._detachUIHandlesAutohide(),this.get(p)&&this._attachUIHandlesAutohide()}},e.WidgetAutohide=m},"3.7.3",{requires:["base-build","event-key","event-outside","widget"]});
bundle/widget-autohide/widget-autohide.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -239,4 +239,4 @@ Y.WidgetAutohide = WidgetAutohide; -}, '3.7.2', {"requires": ["base-build", "event-key", "event-outside", "widget"]});+}, '3.7.3', {"requires": ["base-build", "event-key", "event-outside", "widget"]});
bundle/widget-base-ie/assets/widget-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-base-ie/widget-base-ie-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-base-ie/widget-base-ie.js", code: [] };-_yuitest_coverage["build/widget-base-ie/widget-base-ie.js"].code=["YUI.add('widget-base-ie', function (Y, NAME) {","","/**"," * IE specific support for the widget-base module."," *"," * @module widget-base-ie"," */","var BOUNDING_BOX = \"boundingBox\","," CONTENT_BOX = \"contentBox\","," HEIGHT = \"height\","," OFFSET_HEIGHT = \"offsetHeight\","," EMPTY_STR = \"\","," IE = Y.UA.ie,"," heightReallyMinHeight = IE < 7,"," bbTempExpanding = Y.Widget.getClassName(\"tmp\", \"forcesize\"),"," contentExpanded = Y.Widget.getClassName(\"content\", \"expanded\");","","// TODO: Ideally we want to re-use the base _uiSizeCB impl","Y.Widget.prototype._uiSizeCB = function(expand) {",""," var bb = this.get(BOUNDING_BOX),"," cb = this.get(CONTENT_BOX),"," borderBoxSupported = this._bbs;",""," if (borderBoxSupported === undefined) {"," this._bbs = borderBoxSupported = !(IE && IE < 8 && bb.get(\"ownerDocument\").get(\"compatMode\") != \"BackCompat\"); "," }",""," if (borderBoxSupported) {"," cb.toggleClass(contentExpanded, expand);"," } else {"," if (expand) {"," if (heightReallyMinHeight) {"," bb.addClass(bbTempExpanding);"," }",""," cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));",""," if (heightReallyMinHeight) {"," bb.removeClass(bbTempExpanding);"," }"," } else {"," cb.setStyle(HEIGHT, EMPTY_STR);"," }"," }","};","","","}, '3.7.2', {\"requires\": [\"widget-base\"]});"];+_yuitest_coverage["build/widget-base-ie/widget-base-ie.js"].code=["YUI.add('widget-base-ie', function (Y, NAME) {","","/**"," * IE specific support for the widget-base module."," *"," * @module widget-base-ie"," */","var BOUNDING_BOX = \"boundingBox\","," CONTENT_BOX = \"contentBox\","," HEIGHT = \"height\","," OFFSET_HEIGHT = \"offsetHeight\","," EMPTY_STR = \"\","," IE = Y.UA.ie,"," heightReallyMinHeight = IE < 7,"," bbTempExpanding = Y.Widget.getClassName(\"tmp\", \"forcesize\"),"," contentExpanded = Y.Widget.getClassName(\"content\", \"expanded\");","","// TODO: Ideally we want to re-use the base _uiSizeCB impl","Y.Widget.prototype._uiSizeCB = function(expand) {",""," var bb = this.get(BOUNDING_BOX),"," cb = this.get(CONTENT_BOX),"," borderBoxSupported = this._bbs;",""," if (borderBoxSupported === undefined) {"," this._bbs = borderBoxSupported = !(IE && IE < 8 && bb.get(\"ownerDocument\").get(\"compatMode\") != \"BackCompat\"); "," }",""," if (borderBoxSupported) {"," cb.toggleClass(contentExpanded, expand);"," } else {"," if (expand) {"," if (heightReallyMinHeight) {"," bb.addClass(bbTempExpanding);"," }",""," cb.set(OFFSET_HEIGHT, bb.get(OFFSET_HEIGHT));",""," if (heightReallyMinHeight) {"," bb.removeClass(bbTempExpanding);"," }"," } else {"," cb.setStyle(HEIGHT, EMPTY_STR);"," }"," }","};","","","}, '3.7.3', {\"requires\": [\"widget-base\"]});"]; _yuitest_coverage["build/widget-base-ie/widget-base-ie.js"].lines = {"1":0,"8":0,"19":0,"21":0,"25":0,"26":0,"29":0,"30":0,"32":0,"33":0,"34":0,"37":0,"39":0,"40":0,"43":0}; _yuitest_coverage["build/widget-base-ie/widget-base-ie.js"].functions = {"_uiSizeCB:19":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-base-ie/widget-base-ie.js"].coveredLines = 15;@@ -102,4 +102,4 @@ }; -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-base-ie/widget-base-ie-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -52,4 +52,4 @@ }; -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-base-ie/widget-base-ie-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-base-ie",function(e,t){var n="boundingBox",r="contentBox",i="height",s="offsetHeight",o="",u=e.UA.ie,a=u<7,f=e.Widget.getClassName("tmp","forcesize"),l=e.Widget.getClassName("content","expanded");e.Widget.prototype._uiSizeCB=function(e){var t=this.get(n),c=this.get(r),h=this._bbs;h===undefined&&(this._bbs=h=!(u&&u<8&&t.get("ownerDocument").get("compatMode")!="BackCompat")),h?c.toggleClass(l,e):e?(a&&t.addClass(f),c.set(s,t.get(s)),a&&t.removeClass(f)):c.setStyle(i,o)}},"3.7.2",{requires:["widget-base"]});+YUI.add("widget-base-ie",function(e,t){var n="boundingBox",r="contentBox",i="height",s="offsetHeight",o="",u=e.UA.ie,a=u<7,f=e.Widget.getClassName("tmp","forcesize"),l=e.Widget.getClassName("content","expanded");e.Widget.prototype._uiSizeCB=function(e){var t=this.get(n),c=this.get(r),h=this._bbs;h===undefined&&(this._bbs=h=!(u&&u<8&&t.get("ownerDocument").get("compatMode")!="BackCompat")),h?c.toggleClass(l,e):e?(a&&t.addClass(f),c.set(s,t.get(s)),a&&t.removeClass(f)):c.setStyle(i,o)}},"3.7.3",{requires:["widget-base"]});
bundle/widget-base-ie/widget-base-ie.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -52,4 +52,4 @@ }; -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-base/assets/skins/night/widget-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-base/assets/skins/night/widget-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-base/assets/skins/sam/widget-base-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-base/assets/skins/sam/widget-base.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-base/assets/widget-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-base/widget-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-base/widget-base.js", code: [] };-_yuitest_coverage["build/widget-base/widget-base.js"].code=["YUI.add('widget-base', function (Y, NAME) {","","/**"," * Provides the base Widget class, with HTML Parser support"," *"," * @module widget"," * @main widget"," */","","/**"," * Provides the base Widget class"," *"," * @module widget"," * @submodule widget-base"," */","var L = Y.Lang,"," Node = Y.Node,",""," ClassNameManager = Y.ClassNameManager,",""," _getClassName = ClassNameManager.getClassName,"," _getWidgetClassName,",""," _toInitialCap = Y.cached(function(str) {"," return str.substring(0, 1).toUpperCase() + str.substring(1);"," }),",""," // K-Weight, IE GC optimizations"," CONTENT = \"content\","," VISIBLE = \"visible\","," HIDDEN = \"hidden\","," DISABLED = \"disabled\","," FOCUSED = \"focused\","," WIDTH = \"width\","," HEIGHT = \"height\","," BOUNDING_BOX = \"boundingBox\","," CONTENT_BOX = \"contentBox\","," PARENT_NODE = \"parentNode\","," OWNER_DOCUMENT = \"ownerDocument\","," AUTO = \"auto\","," SRC_NODE = \"srcNode\","," BODY = \"body\","," TAB_INDEX = \"tabIndex\","," ID = \"id\","," RENDER = \"render\","," RENDERED = \"rendered\","," DESTROYED = \"destroyed\","," STRINGS = \"strings\","," DIV = \"<div></div>\","," CHANGE = \"Change\","," LOADING = \"loading\",",""," _UISET = \"_uiSet\",",""," EMPTY_STR = \"\","," EMPTY_FN = function() {},",""," TRUE = true,"," FALSE = false,",""," UI,"," ATTRS = {},"," UI_ATTRS = [VISIBLE, DISABLED, HEIGHT, WIDTH, FOCUSED, TAB_INDEX],",""," WEBKIT = Y.UA.webkit,",""," // Widget nodeid-to-instance map."," _instances = {};","","/**"," * A base class for widgets, providing:"," * <ul>"," * <li>The render lifecycle method, in addition to the init and destroy "," * lifecycle methods provide by Base</li>"," * <li>Abstract methods to support consistent MVC structure across "," * widgets: renderer, renderUI, bindUI, syncUI</li>"," * <li>Support for common widget attributes, such as boundingBox, contentBox, visible, "," * disabled, focused, strings</li>"," * </ul>"," *"," * @param config {Object} Object literal specifying widget configuration properties."," *"," * @class Widget"," * @constructor"," * @extends Base"," */","function Widget(config) {",""," // kweight"," var widget = this,"," parentNode,"," render, "," constructor = widget.constructor; ",""," widget._strs = {};"," widget._cssPrefix = constructor.CSS_PREFIX || _getClassName(constructor.NAME.toLowerCase());",""," // We need a config for HTML_PARSER to work."," config = config || {};",""," Widget.superclass.constructor.call(widget, config);",""," render = widget.get(RENDER);",""," if (render) {"," // Render could be a node or boolean"," if (render !== TRUE) {"," parentNode = render;"," }"," widget.render(parentNode);"," }","}","","/**"," * Static property provides a string to identify the class."," * <p>"," * Currently used to apply class identifiers to the bounding box "," * and to classify events fired by the widget."," * </p>"," *"," * @property NAME"," * @type String"," * @static"," */","Widget.NAME = \"widget\";","","/**"," * Constant used to identify state changes originating from"," * the DOM (as opposed to the JavaScript model)."," *"," * @property UI_SRC"," * @type String"," * @static"," * @final"," */","UI = Widget.UI_SRC = \"ui\";","","/**"," * Static property used to define the default attribute "," * configuration for the Widget."," * "," * @property ATTRS"," * @type Object"," * @static"," */","Widget.ATTRS = ATTRS;","","// Trying to optimize kweight by setting up attrs this way saves about 0.4K min'd","","/**"," * @attribute id"," * @writeOnce"," * @default Generated using guid()"," * @type String"," */","","ATTRS[ID] = {"," valueFn: \"_guid\","," writeOnce: TRUE","};","","/**"," * Flag indicating whether or not this Widget"," * has been through the render lifecycle phase."," *"," * @attribute rendered"," * @readOnly"," * @default false"," * @type boolean"," */","ATTRS[RENDERED] = {"," value:FALSE,"," readOnly: TRUE","};","","/**"," * @attribute boundingBox"," * @description The outermost DOM node for the Widget, used for sizing and positioning "," * of a Widget as well as a containing element for any decorator elements used "," * for skinning."," * @type String | Node"," * @writeOnce"," */","ATTRS[BOUNDING_BOX] = {"," value:null,"," setter: \"_setBB\","," writeOnce: TRUE","};","","/**"," * @attribute contentBox"," * @description A DOM node that is a direct descendant of a Widget's bounding box that "," * houses its content."," * @type String | Node"," * @writeOnce"," */","ATTRS[CONTENT_BOX] = {"," valueFn:\"_defaultCB\","," setter: \"_setCB\","," writeOnce: TRUE","};","","/**"," * @attribute tabIndex"," * @description Number (between -32767 to 32767) indicating the widget's "," * position in the default tab flow. The value is used to set the "," * \"tabIndex\" attribute on the widget's bounding box. Negative values allow"," * the widget to receive DOM focus programmatically (by calling the focus"," * method), while being removed from the default tab flow. A value of "," * null removes the \"tabIndex\" attribute from the widget's bounding box."," * @type Number"," * @default null"," */","ATTRS[TAB_INDEX] = {"," value: null,"," validator: \"_validTabIndex\"","};","","/**"," * @attribute focused"," * @description Boolean indicating if the Widget, or one of its descendants, "," * has focus."," * @readOnly"," * @default false"," * @type boolean"," */","ATTRS[FOCUSED] = {"," value: FALSE,"," readOnly:TRUE","};","","/**"," * @attribute disabled"," * @description Boolean indicating if the Widget should be disabled. The disabled implementation"," * is left to the specific classes extending widget."," * @default false"," * @type boolean"," */","ATTRS[DISABLED] = {"," value: FALSE","};","","/**"," * @attribute visible"," * @description Boolean indicating whether or not the Widget is visible."," * @default TRUE"," * @type boolean"," */","ATTRS[VISIBLE] = {"," value: TRUE","};","","/**"," * @attribute height"," * @description String with units, or number, representing the height of the Widget. If a number is provided,"," * the default unit, defined by the Widgets DEF_UNIT, property is used."," * @default EMPTY_STR"," * @type {String | Number}"," */","ATTRS[HEIGHT] = {"," value: EMPTY_STR","};","","/**"," * @attribute width"," * @description String with units, or number, representing the width of the Widget. If a number is provided,"," * the default unit, defined by the Widgets DEF_UNIT, property is used."," * @default EMPTY_STR"," * @type {String | Number}"," */","ATTRS[WIDTH] = {"," value: EMPTY_STR","};","","/**"," * @attribute strings"," * @description Collection of strings used to label elements of the Widget's UI."," * @default null"," * @type Object"," */","ATTRS[STRINGS] = {"," value: {},"," setter: \"_strSetter\","," getter: \"_strGetter\"","};","","/**"," * Whether or not to render the widget automatically after init, and optionally, to which parent node."," *"," * @attribute render"," * @type boolean | Node"," * @writeOnce"," */","ATTRS[RENDER] = {"," value:FALSE,"," writeOnce:TRUE","};","","/**"," * The css prefix which the static Widget.getClassName method should use when constructing class names"," *"," * @property CSS_PREFIX"," * @type String"," * @default Widget.NAME.toLowerCase()"," * @private"," * @static"," */","Widget.CSS_PREFIX = _getClassName(Widget.NAME.toLowerCase());","","/**"," * Generate a standard prefixed classname for the Widget, prefixed by the default prefix defined"," * by the <code>Y.config.classNamePrefix</code> attribute used by <code>ClassNameManager</code> and "," * <code>Widget.NAME.toLowerCase()</code> (e.g. \"yui-widget-xxxxx-yyyyy\", based on default values for "," * the prefix and widget class name)."," * <p>"," * The instance based version of this method can be used to generate standard prefixed classnames,"," * based on the instances NAME, as opposed to Widget.NAME. This method should be used when you"," * need to use a constant class name across different types instances."," * </p>"," * @method getClassName"," * @param {String*} args* 0..n strings which should be concatenated, using the default separator defined by ClassNameManager, to create the class name"," */","Widget.getClassName = function() {"," // arguments needs to be array'fied to concat"," return _getClassName.apply(ClassNameManager, [Widget.CSS_PREFIX].concat(Y.Array(arguments), true));","};","","_getWidgetClassName = Widget.getClassName;","","/**"," * Returns the widget instance whose bounding box contains, or is, the given node. "," * <p>"," * In the case of nested widgets, the nearest bounding box ancestor is used to"," * return the widget instance."," * </p>"," * @method getByNode"," * @static"," * @param node {Node | String} The node for which to return a Widget instance. If a selector"," * string is passed in, which selects more than one node, the first node found is used."," * @return {Widget} Widget instance, or null if not found."," */","Widget.getByNode = function(node) {"," var widget,"," widgetMarker = _getWidgetClassName();",""," node = Node.one(node);"," if (node) {"," node = node.ancestor(\".\" + widgetMarker, true);"," if (node) {"," widget = _instances[Y.stamp(node, true)];"," }"," }",""," return widget || null;","};","","Y.extend(Widget, Y.Base, {",""," /**"," * Returns a class name prefixed with the the value of the "," * <code>YUI.config.classNamePrefix</code> attribute + the instances <code>NAME</code> property."," * Uses <code>YUI.config.classNameDelimiter</code> attribute to delimit the provided strings."," * e.g. "," * <code>"," * <pre>"," * // returns \"yui-slider-foo-bar\", for a slider instance"," * var scn = slider.getClassName('foo','bar');"," *"," * // returns \"yui-overlay-foo-bar\", for an overlay instance"," * var ocn = overlay.getClassName('foo','bar');"," * </pre>"," * </code>"," *"," * @method getClassName"," * @param {String}+ One or more classname bits to be joined and prefixed"," */"," getClassName: function () {"," return _getClassName.apply(ClassNameManager, [this._cssPrefix].concat(Y.Array(arguments), true));"," },",""," /**"," * Initializer lifecycle implementation for the Widget class. Registers the "," * widget instance, and runs through the Widget's HTML_PARSER definition. "," *"," * @method initializer"," * @protected"," * @param config {Object} Configuration object literal for the widget"," */"," initializer: function(config) {",""," var bb = this.get(BOUNDING_BOX);",""," if (bb instanceof Node) {"," this._mapInstance(Y.stamp(bb));"," }",""," /**"," * Notification event, which widget implementations can fire, when"," * they change the content of the widget. This event has no default"," * behavior and cannot be prevented, so the \"on\" or \"after\""," * moments are effectively equivalent (with on listeners being invoked before "," * after listeners)."," *"," * @event widget:contentUpdate"," * @preventable false"," * @param {EventFacade} e The Event Facade"," */",""," if (this._applyParser) {"," this._applyParser(config);"," }"," },",""," /**"," * Utility method used to add an entry to the boundingBox id to instance map. "," *"," * This method can be used to populate the instance with lazily created boundingBox Node references. "," *"," * @method _mapInstance"," * @param {String} The boundingBox id"," * @protected"," */"," _mapInstance : function(id) {"," _instances[id] = this;"," },",""," /**"," * Destructor lifecycle implementation for the Widget class. Purges events attached"," * to the bounding box and content box, removes them from the DOM and removes "," * the Widget from the list of registered widgets."," *"," * @method destructor"," * @protected"," */"," destructor: function() {",""," var boundingBox = this.get(BOUNDING_BOX),"," bbGuid;",""," if (boundingBox instanceof Node) {"," bbGuid = Y.stamp(boundingBox,true);",""," if (bbGuid in _instances) {"," delete _instances[bbGuid];"," }",""," this._destroyBox();"," }"," },",""," /**"," * <p>"," * Destroy lifecycle method. Fires the destroy"," * event, prior to invoking destructors for the"," * class hierarchy."," *"," * Overrides Base's implementation, to support arguments to destroy"," * </p>"," * <p>"," * Subscribers to the destroy"," * event can invoke preventDefault on the event object, to prevent destruction"," * from proceeding."," * </p>"," * @method destroy"," * @param destroyAllNodes {Boolean} If true, all nodes contained within the Widget are removed and destroyed. Defaults to false due to potentially high run-time cost. "," * @return {Widget} A reference to this object"," * @chainable"," */"," destroy: function(destroyAllNodes) {"," this._destroyAllNodes = destroyAllNodes;"," return Widget.superclass.destroy.apply(this);"," },",""," /**"," * Removes and destroys the widgets rendered boundingBox, contentBox,"," * and detaches bound UI events."," *"," * @method _destroyBox"," * @protected "," */"," _destroyBox : function() {",""," var boundingBox = this.get(BOUNDING_BOX),"," contentBox = this.get(CONTENT_BOX),"," deep = this._destroyAllNodes,"," same;",""," same = boundingBox && boundingBox.compareTo(contentBox);",""," if (this.UI_EVENTS) {"," this._destroyUIEvents();"," }",""," this._unbindUI(boundingBox);",""," if (deep) {"," // Removes and destroys all child nodes."," boundingBox.empty();"," boundingBox.remove(TRUE);"," } else {"," if (contentBox) {"," contentBox.remove(TRUE);"," }"," if (!same) {"," boundingBox.remove(TRUE);"," }"," }"," },",""," /**"," * Establishes the initial DOM for the widget. Invoking this"," * method will lead to the creating of all DOM elements for"," * the widget (or the manipulation of existing DOM elements "," * for the progressive enhancement use case)."," * <p>"," * This method should only be invoked once for an initialized"," * widget."," * </p>"," * <p>"," * It delegates to the widget specific renderer method to do"," * the actual work."," * </p>"," *"," * @method render"," * @chainable"," * @final "," * @param parentNode {Object | String} Optional. The Node under which the "," * Widget is to be rendered. This can be a Node instance or a CSS selector string. "," * <p>"," * If the selector string returns more than one Node, the first node will be used "," * as the parentNode. NOTE: This argument is required if both the boundingBox and contentBox"," * are not currently in the document. If it's not provided, the Widget will be rendered"," * to the body of the current document in this case."," * </p>"," */"," render: function(parentNode) {",""," if (!this.get(DESTROYED) && !this.get(RENDERED)) {"," /**"," * Lifecycle event for the render phase, fired prior to rendering the UI "," * for the widget (prior to invoking the widget's renderer method)."," * <p>"," * Subscribers to the \"on\" moment of this event, will be notified "," * before the widget is rendered."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after rendering is complete."," * </p>"," *"," * @event widget:render"," * @preventable _defRenderFn"," * @param {EventFacade} e The Event Facade"," */"," this.publish(RENDER, {"," queuable:FALSE,"," fireOnce:TRUE,"," defaultTargetOnly:TRUE,"," defaultFn: this._defRenderFn"," });",""," this.fire(RENDER, {parentNode: (parentNode) ? Node.one(parentNode) : null});"," }"," return this;"," },",""," /**"," * Default render handler"," *"," * @method _defRenderFn"," * @protected"," * @param {EventFacade} e The Event object"," * @param {Node} parentNode The parent node to render to, if passed in to the <code>render</code> method"," */"," _defRenderFn : function(e) {"," this._parentNode = e.parentNode;"," "," this.renderer();"," this._set(RENDERED, TRUE);",""," this._removeLoadingClassNames();"," },",""," /**"," * Creates DOM (or manipulates DOM for progressive enhancement)"," * This method is invoked by render() and is not chained "," * automatically for the class hierarchy (unlike initializer, destructor) "," * so it should be chained manually for subclasses if required."," *"," * @method renderer"," * @protected"," */"," renderer: function() {"," // kweight"," var widget = this;",""," widget._renderUI();"," widget.renderUI();",""," widget._bindUI();"," widget.bindUI();",""," widget._syncUI();"," widget.syncUI();"," },",""," /**"," * Configures/Sets up listeners to bind Widget State to UI/DOM"," * "," * This method is not called by framework and is not chained "," * automatically for the class hierarchy."," * "," * @method bindUI"," * @protected"," */"," bindUI: EMPTY_FN,",""," /**"," * Adds nodes to the DOM "," * "," * This method is not called by framework and is not chained "," * automatically for the class hierarchy."," * "," * @method renderUI"," * @protected"," */"," renderUI: EMPTY_FN,",""," /**"," * Refreshes the rendered UI, based on Widget State"," * "," * This method is not called by framework and is not chained"," * automatically for the class hierarchy."," *"," * @method syncUI"," * @protected"," *"," */"," syncUI: EMPTY_FN,",""," /**"," * @method hide"," * @description Hides the Widget by setting the \"visible\" attribute to \"false\"."," * @chainable"," */"," hide: function() {"," return this.set(VISIBLE, FALSE);"," },",""," /**"," * @method show"," * @description Shows the Widget by setting the \"visible\" attribute to \"true\"."," * @chainable"," */"," show: function() {"," return this.set(VISIBLE, TRUE);"," },",""," /**"," * @method focus"," * @description Causes the Widget to receive the focus by setting the \"focused\" "," * attribute to \"true\"."," * @chainable"," */"," focus: function () {"," return this._set(FOCUSED, TRUE);"," },",""," /**"," * @method blur"," * @description Causes the Widget to lose focus by setting the \"focused\" attribute "," * to \"false\""," * @chainable"," */"," blur: function () {"," return this._set(FOCUSED, FALSE);"," },",""," /**"," * @method enable"," * @description Set the Widget's \"disabled\" attribute to \"false\"."," * @chainable"," */"," enable: function() {"," return this.set(DISABLED, FALSE);"," },",""," /**"," * @method disable"," * @description Set the Widget's \"disabled\" attribute to \"true\"."," * @chainable"," */"," disable: function() {"," return this.set(DISABLED, TRUE);"," },",""," /**"," * @method _uiSizeCB"," * @protected"," * @param {boolean} expand"," */"," _uiSizeCB : function(expand) {"," this.get(CONTENT_BOX).toggleClass(_getWidgetClassName(CONTENT, \"expanded\"), expand); "," },",""," /**"," * Helper method to collect the boundingBox and contentBox and append to the provided parentNode, if not"," * already a child. The owner document of the boundingBox, or the owner document of the contentBox will be used "," * as the document into which the Widget is rendered if a parentNode is node is not provided. If both the boundingBox and"," * the contentBox are not currently in the document, and no parentNode is provided, the widget will be rendered "," * to the current document's body."," *"," * @method _renderBox"," * @private"," * @param {Node} parentNode The parentNode to render the widget to. If not provided, and both the boundingBox and"," * the contentBox are not currently in the document, the widget will be rendered to the current document's body."," */"," _renderBox: function(parentNode) {",""," // TODO: Performance Optimization [ More effective algo to reduce Node refs, compares, replaces? ]",""," var widget = this, // kweight"," contentBox = widget.get(CONTENT_BOX),"," boundingBox = widget.get(BOUNDING_BOX),"," srcNode = widget.get(SRC_NODE),"," defParentNode = widget.DEF_PARENT_NODE,",""," doc = (srcNode && srcNode.get(OWNER_DOCUMENT)) || boundingBox.get(OWNER_DOCUMENT) || contentBox.get(OWNER_DOCUMENT);",""," // If srcNode (assume it's always in doc), have contentBox take its place (widget render responsible for re-use of srcNode contents)"," if (srcNode && !srcNode.compareTo(contentBox) && !contentBox.inDoc(doc)) {"," srcNode.replace(contentBox);"," }",""," if (!boundingBox.compareTo(contentBox.get(PARENT_NODE)) && !boundingBox.compareTo(contentBox)) {"," // If contentBox box is already in the document, have boundingBox box take it's place"," if (contentBox.inDoc(doc)) {"," contentBox.replace(boundingBox);"," }"," boundingBox.appendChild(contentBox);"," }",""," parentNode = parentNode || (defParentNode && Node.one(defParentNode));",""," if (parentNode) {"," parentNode.appendChild(boundingBox);"," } else if (!boundingBox.inDoc(doc)) {"," Node.one(BODY).insert(boundingBox, 0);"," }"," },",""," /**"," * Setter for the boundingBox attribute"," *"," * @method _setBB"," * @private"," * @param Node/String"," * @return Node"," */"," _setBB: function(node) {"," return this._setBox(this.get(ID), node, this.BOUNDING_TEMPLATE, true);"," },",""," /**"," * Setter for the contentBox attribute"," *"," * @method _setCB"," * @private"," * @param {Node|String} node"," * @return Node"," */"," _setCB: function(node) {"," return (this.CONTENT_TEMPLATE === null) ? this.get(BOUNDING_BOX) : this._setBox(null, node, this.CONTENT_TEMPLATE, false);"," },",""," /**"," * Returns the default value for the contentBox attribute. "," *"," * For the Widget class, this will be the srcNode if provided, otherwise null (resulting in"," * a new contentBox node instance being created)"," *"," * @method _defaultCB"," * @protected"," */"," _defaultCB : function(node) {"," return this.get(SRC_NODE) || null;"," },",""," /**"," * Helper method to set the bounding/content box, or create it from"," * the provided template if not found."," *"," * @method _setBox"," * @private"," *"," * @param {String} id The node's id attribute"," * @param {Node|String} node The node reference"," * @param {String} template HTML string template for the node"," * @param {boolean} true if this is the boundingBox, false if it's the contentBox"," * @return {Node} The node"," */"," _setBox : function(id, node, template, isBounding) {",""," node = Node.one(node);",""," if (!node) {"," node = Node.create(template);",""," if (isBounding) {"," this._bbFromTemplate = true;"," } else {"," this._cbFromTemplate = true;"," }"," }",""," if (!node.get(ID)) {"," node.set(ID, id || Y.guid());"," }",""," return node;"," },",""," /**"," * Initializes the UI state for the Widget's bounding/content boxes."," *"," * @method _renderUI"," * @protected"," */"," _renderUI: function() {"," this._renderBoxClassNames();"," this._renderBox(this._parentNode);"," },",""," /**"," * Applies standard class names to the boundingBox and contentBox"," *"," * @method _renderBoxClassNames"," * @protected"," */"," _renderBoxClassNames : function() {"," var classes = this._getClasses(),"," cl,"," boundingBox = this.get(BOUNDING_BOX),"," i;",""," boundingBox.addClass(_getWidgetClassName());",""," // Start from Widget Sub Class"," for (i = classes.length-3; i >= 0; i--) {"," cl = classes[i];"," boundingBox.addClass(cl.CSS_PREFIX || _getClassName(cl.NAME.toLowerCase()));"," }",""," // Use instance based name for content box"," this.get(CONTENT_BOX).addClass(this.getClassName(CONTENT));"," },",""," /**"," * Removes class names representative of the widget's loading state from "," * the boundingBox."," *"," * @method _removeLoadingClassNames"," * @protected"," */"," _removeLoadingClassNames: function () {",""," var boundingBox = this.get(BOUNDING_BOX),"," contentBox = this.get(CONTENT_BOX),"," instClass = this.getClassName(LOADING),"," widgetClass = _getWidgetClassName(LOADING);",""," boundingBox.removeClass(widgetClass)"," .removeClass(instClass);",""," contentBox.removeClass(widgetClass)"," .removeClass(instClass);"," },",""," /**"," * Sets up DOM and CustomEvent listeners for the widget."," *"," * @method _bindUI"," * @protected"," */"," _bindUI: function() {"," this._bindAttrUI(this._UI_ATTRS.BIND);"," this._bindDOM();"," },",""," /**"," * @method _unbindUI"," * @protected"," */"," _unbindUI : function(boundingBox) {"," this._unbindDOM(boundingBox);"," },",""," /**"," * Sets up DOM listeners, on elements rendered by the widget."," * "," * @method _bindDOM"," * @protected"," */"," _bindDOM : function() {"," var oDocument = this.get(BOUNDING_BOX).get(OWNER_DOCUMENT),"," focusHandle = Widget._hDocFocus;",""," // Shared listener across all Widgets."," if (!focusHandle) {"," focusHandle = Widget._hDocFocus = oDocument.on(\"focus\", this._onDocFocus, this);"," focusHandle.listeners = {"," count: 0"," };"," }",""," focusHandle.listeners[Y.stamp(this, true)] = true;"," focusHandle.listeners.count++;",""," // Fix for Webkit:"," // Document doesn't receive focus in Webkit when the user mouses "," // down on it, so the \"focused\" attribute won't get set to the "," // correct value. Keeping this instance based for now, potential better performance."," // Otherwise we'll end up looking up widgets from the DOM on every mousedown."," if (WEBKIT){"," this._hDocMouseDown = oDocument.on(\"mousedown\", this._onDocMouseDown, this);"," }"," },",""," /**"," * @method _unbindDOM"," * @protected"," */ "," _unbindDOM : function(boundingBox) {",""," var focusHandle = Widget._hDocFocus,"," yuid = Y.stamp(this, true),"," focusListeners,"," mouseHandle = this._hDocMouseDown;",""," if (focusHandle) {",""," focusListeners = focusHandle.listeners;",""," if (focusListeners[yuid]) {"," delete focusListeners[yuid];"," focusListeners.count--;"," }",""," if (focusListeners.count === 0) {"," focusHandle.detach();"," Widget._hDocFocus = null;"," }"," }",""," if (WEBKIT && mouseHandle) {"," mouseHandle.detach();"," }"," },",""," /**"," * Updates the widget UI to reflect the attribute state."," *"," * @method _syncUI"," * @protected"," */"," _syncUI: function() {"," this._syncAttrUI(this._UI_ATTRS.SYNC);"," },",""," /**"," * Sets the height on the widget's bounding box element"," *"," * @method _uiSetHeight"," * @protected"," * @param {String | Number} val"," */"," _uiSetHeight: function(val) {"," this._uiSetDim(HEIGHT, val);"," this._uiSizeCB((val !== EMPTY_STR && val !== AUTO));"," },",""," /**"," * Sets the width on the widget's bounding box element"," *"," * @method _uiSetWidth"," * @protected"," * @param {String | Number} val"," */"," _uiSetWidth: function(val) {"," this._uiSetDim(WIDTH, val);"," },",""," /**"," * @method _uiSetDim"," * @private"," * @param {String} dim The dimension - \"width\" or \"height\""," * @param {Number | String} val The value to set"," */"," _uiSetDim: function(dimension, val) {"," this.get(BOUNDING_BOX).setStyle(dimension, L.isNumber(val) ? val + this.DEF_UNIT : val);"," },",""," /**"," * Sets the visible state for the UI"," * "," * @method _uiSetVisible"," * @protected"," * @param {boolean} val"," */"," _uiSetVisible: function(val) {"," this.get(BOUNDING_BOX).toggleClass(this.getClassName(HIDDEN), !val);"," },",""," /**"," * Sets the disabled state for the UI"," *"," * @method _uiSetDisabled"," * @protected"," * @param {boolean} val"," */"," _uiSetDisabled: function(val) {"," this.get(BOUNDING_BOX).toggleClass(this.getClassName(DISABLED), val);"," },",""," /**"," * Sets the focused state for the UI"," *"," * @method _uiSetFocused"," * @protected"," * @param {boolean} val"," * @param {string} src String representing the source that triggered an update to "," * the UI. "," */"," _uiSetFocused: function(val, src) {"," var boundingBox = this.get(BOUNDING_BOX);"," boundingBox.toggleClass(this.getClassName(FOCUSED), val);",""," if (src !== UI) {"," if (val) {"," boundingBox.focus(); "," } else {"," boundingBox.blur();"," }"," }"," },",""," /**"," * Set the tabIndex on the widget's rendered UI"," *"," * @method _uiSetTabIndex"," * @protected"," * @param Number"," */"," _uiSetTabIndex: function(index) {"," var boundingBox = this.get(BOUNDING_BOX);",""," if (L.isNumber(index)) {"," boundingBox.set(TAB_INDEX, index);"," } else {"," boundingBox.removeAttribute(TAB_INDEX);"," }"," },",""," /**"," * @method _onDocMouseDown"," * @description \"mousedown\" event handler for the owner document of the "," * widget's bounding box."," * @protected"," * @param {EventFacade} evt The event facade for the DOM focus event"," */"," _onDocMouseDown: function (evt) {"," if (this._domFocus) {"," this._onDocFocus(evt);"," }"," },",""," /**"," * DOM focus event handler, used to sync the state of the Widget with the DOM"," * "," * @method _onDocFocus"," * @protected"," * @param {EventFacade} evt The event facade for the DOM focus event"," */"," _onDocFocus: function (evt) {"," var widget = Widget.getByNode(evt.target),"," activeWidget = Widget._active;",""," if (activeWidget && (activeWidget !== widget)) {"," activeWidget._domFocus = false;"," activeWidget._set(FOCUSED, false, {src:UI});",""," Widget._active = null;"," }",""," if (widget) {"," widget._domFocus = true;"," widget._set(FOCUSED, true, {src:UI});",""," Widget._active = widget;"," }"," },",""," /**"," * Generic toString implementation for all widgets."," *"," * @method toString"," * @return {String} The default string value for the widget [ displays the NAME of the instance, and the unique id ]"," */"," toString: function() {"," // Using deprecated name prop for kweight squeeze."," return this.name + \"[\" + this.get(ID) + \"]\";"," },",""," /**"," * Default unit to use for dimension values"," * "," * @property DEF_UNIT"," * @type String"," */"," DEF_UNIT : \"px\",",""," /** "," * Default node to render the bounding box to. If not set,"," * will default to the current document body."," * "," * @property DEF_PARENT_NODE"," * @type String | Node"," */ "," DEF_PARENT_NODE : null,",""," /**"," * Property defining the markup template for content box. If your Widget doesn't"," * need the dual boundingBox/contentBox structure, set CONTENT_TEMPLATE to null,"," * and contentBox and boundingBox will both point to the same Node. "," *"," * @property CONTENT_TEMPLATE"," * @type String"," */"," CONTENT_TEMPLATE : DIV,",""," /**"," * Property defining the markup template for bounding box."," *"," * @property BOUNDING_TEMPLATE"," * @type String"," */"," BOUNDING_TEMPLATE : DIV,",""," /**"," * @method _guid"," * @protected"," */"," _guid : function() {"," return Y.guid();"," },",""," /**"," * @method _validTabIndex"," * @protected"," * @param {Number} tabIndex"," */"," _validTabIndex : function (tabIndex) {"," return (L.isNumber(tabIndex) || L.isNull(tabIndex));"," },",""," /**"," * Binds after listeners for the list of attributes provided"," * "," * @method _bindAttrUI"," * @private"," * @param {Array} attrs"," */"," _bindAttrUI : function(attrs) {"," var i, "," l = attrs.length; ",""," for (i = 0; i < l; i++) {"," this.after(attrs[i] + CHANGE, this._setAttrUI);"," }"," },",""," /**"," * Invokes the _uiSet=ATTR NAME> method for the list of attributes provided "," *"," * @method _syncAttrUI"," * @private"," * @param {Array} attrs"," */"," _syncAttrUI : function(attrs) {"," var i, l = attrs.length, attr;"," for (i = 0; i < l; i++) {"," attr = attrs[i];"," this[_UISET + _toInitialCap(attr)](this.get(attr));"," }"," },",""," /**"," * @method _setAttrUI"," * @private"," * @param {EventFacade} e"," */"," _setAttrUI : function(e) {"," if (e.target === this) {"," this[_UISET + _toInitialCap(e.attrName)](e.newVal, e.src);"," }"," },",""," /**"," * The default setter for the strings attribute. Merges partial sets"," * into the full string set, to allow users to partial sets of strings "," *"," * @method _strSetter"," * @protected"," * @param {Object} strings"," * @return {String} The full set of strings to set"," */"," _strSetter : function(strings) {"," return Y.merge(this.get(STRINGS), strings);"," },",""," /**"," * Helper method to get a specific string value"," *"," * @deprecated Used by deprecated WidgetLocale implementations. "," * @method getString"," * @param {String} key"," * @return {String} The string"," */"," getString : function(key) {"," return this.get(STRINGS)[key];"," },",""," /**"," * Helper method to get the complete set of strings for the widget"," *"," * @deprecated Used by deprecated WidgetLocale implementations."," * @method getStrings"," * @param {String} key"," * @return {String} The strings"," */"," getStrings : function() {"," return this.get(STRINGS);"," },",""," /**"," * The lists of UI attributes to bind and sync for widget's _bindUI and _syncUI implementations"," *"," * @property _UI_ATTRS"," * @type Object"," * @private"," */"," _UI_ATTRS : {"," BIND: UI_ATTRS,"," SYNC: UI_ATTRS"," }","});","","Y.Widget = Widget;","","","}, '3.7.2', {\"requires\": [\"attribute\", \"base-base\", \"base-pluginhost\", \"classnamemanager\", \"event-focus\", \"node-base\", \"node-style\"], \"skinnable\": true});"];+_yuitest_coverage["build/widget-base/widget-base.js"].code=["YUI.add('widget-base', function (Y, NAME) {","","/**"," * Provides the base Widget class, with HTML Parser support"," *"," * @module widget"," * @main widget"," */","","/**"," * Provides the base Widget class"," *"," * @module widget"," * @submodule widget-base"," */","var L = Y.Lang,"," Node = Y.Node,",""," ClassNameManager = Y.ClassNameManager,",""," _getClassName = ClassNameManager.getClassName,"," _getWidgetClassName,",""," _toInitialCap = Y.cached(function(str) {"," return str.substring(0, 1).toUpperCase() + str.substring(1);"," }),",""," // K-Weight, IE GC optimizations"," CONTENT = \"content\","," VISIBLE = \"visible\","," HIDDEN = \"hidden\","," DISABLED = \"disabled\","," FOCUSED = \"focused\","," WIDTH = \"width\","," HEIGHT = \"height\","," BOUNDING_BOX = \"boundingBox\","," CONTENT_BOX = \"contentBox\","," PARENT_NODE = \"parentNode\","," OWNER_DOCUMENT = \"ownerDocument\","," AUTO = \"auto\","," SRC_NODE = \"srcNode\","," BODY = \"body\","," TAB_INDEX = \"tabIndex\","," ID = \"id\","," RENDER = \"render\","," RENDERED = \"rendered\","," DESTROYED = \"destroyed\","," STRINGS = \"strings\","," DIV = \"<div></div>\","," CHANGE = \"Change\","," LOADING = \"loading\",",""," _UISET = \"_uiSet\",",""," EMPTY_STR = \"\","," EMPTY_FN = function() {},",""," TRUE = true,"," FALSE = false,",""," UI,"," ATTRS = {},"," UI_ATTRS = [VISIBLE, DISABLED, HEIGHT, WIDTH, FOCUSED, TAB_INDEX],",""," WEBKIT = Y.UA.webkit,",""," // Widget nodeid-to-instance map."," _instances = {};","","/**"," * A base class for widgets, providing:"," * <ul>"," * <li>The render lifecycle method, in addition to the init and destroy "," * lifecycle methods provide by Base</li>"," * <li>Abstract methods to support consistent MVC structure across "," * widgets: renderer, renderUI, bindUI, syncUI</li>"," * <li>Support for common widget attributes, such as boundingBox, contentBox, visible, "," * disabled, focused, strings</li>"," * </ul>"," *"," * @param config {Object} Object literal specifying widget configuration properties."," *"," * @class Widget"," * @constructor"," * @extends Base"," */","function Widget(config) {",""," // kweight"," var widget = this,"," parentNode,"," render, "," constructor = widget.constructor; ",""," widget._strs = {};"," widget._cssPrefix = constructor.CSS_PREFIX || _getClassName(constructor.NAME.toLowerCase());",""," // We need a config for HTML_PARSER to work."," config = config || {};",""," Widget.superclass.constructor.call(widget, config);",""," render = widget.get(RENDER);",""," if (render) {"," // Render could be a node or boolean"," if (render !== TRUE) {"," parentNode = render;"," }"," widget.render(parentNode);"," }","}","","/**"," * Static property provides a string to identify the class."," * <p>"," * Currently used to apply class identifiers to the bounding box "," * and to classify events fired by the widget."," * </p>"," *"," * @property NAME"," * @type String"," * @static"," */","Widget.NAME = \"widget\";","","/**"," * Constant used to identify state changes originating from"," * the DOM (as opposed to the JavaScript model)."," *"," * @property UI_SRC"," * @type String"," * @static"," * @final"," */","UI = Widget.UI_SRC = \"ui\";","","/**"," * Static property used to define the default attribute "," * configuration for the Widget."," * "," * @property ATTRS"," * @type Object"," * @static"," */","Widget.ATTRS = ATTRS;","","// Trying to optimize kweight by setting up attrs this way saves about 0.4K min'd","","/**"," * @attribute id"," * @writeOnce"," * @default Generated using guid()"," * @type String"," */","","ATTRS[ID] = {"," valueFn: \"_guid\","," writeOnce: TRUE","};","","/**"," * Flag indicating whether or not this Widget"," * has been through the render lifecycle phase."," *"," * @attribute rendered"," * @readOnly"," * @default false"," * @type boolean"," */","ATTRS[RENDERED] = {"," value:FALSE,"," readOnly: TRUE","};","","/**"," * @attribute boundingBox"," * @description The outermost DOM node for the Widget, used for sizing and positioning "," * of a Widget as well as a containing element for any decorator elements used "," * for skinning."," * @type String | Node"," * @writeOnce"," */","ATTRS[BOUNDING_BOX] = {"," value:null,"," setter: \"_setBB\","," writeOnce: TRUE","};","","/**"," * @attribute contentBox"," * @description A DOM node that is a direct descendant of a Widget's bounding box that "," * houses its content."," * @type String | Node"," * @writeOnce"," */","ATTRS[CONTENT_BOX] = {"," valueFn:\"_defaultCB\","," setter: \"_setCB\","," writeOnce: TRUE","};","","/**"," * @attribute tabIndex"," * @description Number (between -32767 to 32767) indicating the widget's "," * position in the default tab flow. The value is used to set the "," * \"tabIndex\" attribute on the widget's bounding box. Negative values allow"," * the widget to receive DOM focus programmatically (by calling the focus"," * method), while being removed from the default tab flow. A value of "," * null removes the \"tabIndex\" attribute from the widget's bounding box."," * @type Number"," * @default null"," */","ATTRS[TAB_INDEX] = {"," value: null,"," validator: \"_validTabIndex\"","};","","/**"," * @attribute focused"," * @description Boolean indicating if the Widget, or one of its descendants, "," * has focus."," * @readOnly"," * @default false"," * @type boolean"," */","ATTRS[FOCUSED] = {"," value: FALSE,"," readOnly:TRUE","};","","/**"," * @attribute disabled"," * @description Boolean indicating if the Widget should be disabled. The disabled implementation"," * is left to the specific classes extending widget."," * @default false"," * @type boolean"," */","ATTRS[DISABLED] = {"," value: FALSE","};","","/**"," * @attribute visible"," * @description Boolean indicating whether or not the Widget is visible."," * @default TRUE"," * @type boolean"," */","ATTRS[VISIBLE] = {"," value: TRUE","};","","/**"," * @attribute height"," * @description String with units, or number, representing the height of the Widget. If a number is provided,"," * the default unit, defined by the Widgets DEF_UNIT, property is used."," * @default EMPTY_STR"," * @type {String | Number}"," */","ATTRS[HEIGHT] = {"," value: EMPTY_STR","};","","/**"," * @attribute width"," * @description String with units, or number, representing the width of the Widget. If a number is provided,"," * the default unit, defined by the Widgets DEF_UNIT, property is used."," * @default EMPTY_STR"," * @type {String | Number}"," */","ATTRS[WIDTH] = {"," value: EMPTY_STR","};","","/**"," * @attribute strings"," * @description Collection of strings used to label elements of the Widget's UI."," * @default null"," * @type Object"," */","ATTRS[STRINGS] = {"," value: {},"," setter: \"_strSetter\","," getter: \"_strGetter\"","};","","/**"," * Whether or not to render the widget automatically after init, and optionally, to which parent node."," *"," * @attribute render"," * @type boolean | Node"," * @writeOnce"," */","ATTRS[RENDER] = {"," value:FALSE,"," writeOnce:TRUE","};","","/**"," * The css prefix which the static Widget.getClassName method should use when constructing class names"," *"," * @property CSS_PREFIX"," * @type String"," * @default Widget.NAME.toLowerCase()"," * @private"," * @static"," */","Widget.CSS_PREFIX = _getClassName(Widget.NAME.toLowerCase());","","/**"," * Generate a standard prefixed classname for the Widget, prefixed by the default prefix defined"," * by the <code>Y.config.classNamePrefix</code> attribute used by <code>ClassNameManager</code> and "," * <code>Widget.NAME.toLowerCase()</code> (e.g. \"yui-widget-xxxxx-yyyyy\", based on default values for "," * the prefix and widget class name)."," * <p>"," * The instance based version of this method can be used to generate standard prefixed classnames,"," * based on the instances NAME, as opposed to Widget.NAME. This method should be used when you"," * need to use a constant class name across different types instances."," * </p>"," * @method getClassName"," * @param {String*} args* 0..n strings which should be concatenated, using the default separator defined by ClassNameManager, to create the class name"," */","Widget.getClassName = function() {"," // arguments needs to be array'fied to concat"," return _getClassName.apply(ClassNameManager, [Widget.CSS_PREFIX].concat(Y.Array(arguments), true));","};","","_getWidgetClassName = Widget.getClassName;","","/**"," * Returns the widget instance whose bounding box contains, or is, the given node. "," * <p>"," * In the case of nested widgets, the nearest bounding box ancestor is used to"," * return the widget instance."," * </p>"," * @method getByNode"," * @static"," * @param node {Node | String} The node for which to return a Widget instance. If a selector"," * string is passed in, which selects more than one node, the first node found is used."," * @return {Widget} Widget instance, or null if not found."," */","Widget.getByNode = function(node) {"," var widget,"," widgetMarker = _getWidgetClassName();",""," node = Node.one(node);"," if (node) {"," node = node.ancestor(\".\" + widgetMarker, true);"," if (node) {"," widget = _instances[Y.stamp(node, true)];"," }"," }",""," return widget || null;","};","","Y.extend(Widget, Y.Base, {",""," /**"," * Returns a class name prefixed with the the value of the "," * <code>YUI.config.classNamePrefix</code> attribute + the instances <code>NAME</code> property."," * Uses <code>YUI.config.classNameDelimiter</code> attribute to delimit the provided strings."," * e.g. "," * <code>"," * <pre>"," * // returns \"yui-slider-foo-bar\", for a slider instance"," * var scn = slider.getClassName('foo','bar');"," *"," * // returns \"yui-overlay-foo-bar\", for an overlay instance"," * var ocn = overlay.getClassName('foo','bar');"," * </pre>"," * </code>"," *"," * @method getClassName"," * @param {String}+ One or more classname bits to be joined and prefixed"," */"," getClassName: function () {"," return _getClassName.apply(ClassNameManager, [this._cssPrefix].concat(Y.Array(arguments), true));"," },",""," /**"," * Initializer lifecycle implementation for the Widget class. Registers the "," * widget instance, and runs through the Widget's HTML_PARSER definition. "," *"," * @method initializer"," * @protected"," * @param config {Object} Configuration object literal for the widget"," */"," initializer: function(config) {",""," var bb = this.get(BOUNDING_BOX);",""," if (bb instanceof Node) {"," this._mapInstance(Y.stamp(bb));"," }",""," /**"," * Notification event, which widget implementations can fire, when"," * they change the content of the widget. This event has no default"," * behavior and cannot be prevented, so the \"on\" or \"after\""," * moments are effectively equivalent (with on listeners being invoked before "," * after listeners)."," *"," * @event widget:contentUpdate"," * @preventable false"," * @param {EventFacade} e The Event Facade"," */",""," if (this._applyParser) {"," this._applyParser(config);"," }"," },",""," /**"," * Utility method used to add an entry to the boundingBox id to instance map. "," *"," * This method can be used to populate the instance with lazily created boundingBox Node references. "," *"," * @method _mapInstance"," * @param {String} The boundingBox id"," * @protected"," */"," _mapInstance : function(id) {"," _instances[id] = this;"," },",""," /**"," * Destructor lifecycle implementation for the Widget class. Purges events attached"," * to the bounding box and content box, removes them from the DOM and removes "," * the Widget from the list of registered widgets."," *"," * @method destructor"," * @protected"," */"," destructor: function() {",""," var boundingBox = this.get(BOUNDING_BOX),"," bbGuid;",""," if (boundingBox instanceof Node) {"," bbGuid = Y.stamp(boundingBox,true);",""," if (bbGuid in _instances) {"," delete _instances[bbGuid];"," }",""," this._destroyBox();"," }"," },",""," /**"," * <p>"," * Destroy lifecycle method. Fires the destroy"," * event, prior to invoking destructors for the"," * class hierarchy."," *"," * Overrides Base's implementation, to support arguments to destroy"," * </p>"," * <p>"," * Subscribers to the destroy"," * event can invoke preventDefault on the event object, to prevent destruction"," * from proceeding."," * </p>"," * @method destroy"," * @param destroyAllNodes {Boolean} If true, all nodes contained within the Widget are removed and destroyed. Defaults to false due to potentially high run-time cost. "," * @return {Widget} A reference to this object"," * @chainable"," */"," destroy: function(destroyAllNodes) {"," this._destroyAllNodes = destroyAllNodes;"," return Widget.superclass.destroy.apply(this);"," },",""," /**"," * Removes and destroys the widgets rendered boundingBox, contentBox,"," * and detaches bound UI events."," *"," * @method _destroyBox"," * @protected "," */"," _destroyBox : function() {",""," var boundingBox = this.get(BOUNDING_BOX),"," contentBox = this.get(CONTENT_BOX),"," deep = this._destroyAllNodes,"," same;",""," same = boundingBox && boundingBox.compareTo(contentBox);",""," if (this.UI_EVENTS) {"," this._destroyUIEvents();"," }",""," this._unbindUI(boundingBox);",""," if (deep) {"," // Removes and destroys all child nodes."," boundingBox.empty();"," boundingBox.remove(TRUE);"," } else {"," if (contentBox) {"," contentBox.remove(TRUE);"," }"," if (!same) {"," boundingBox.remove(TRUE);"," }"," }"," },",""," /**"," * Establishes the initial DOM for the widget. Invoking this"," * method will lead to the creating of all DOM elements for"," * the widget (or the manipulation of existing DOM elements "," * for the progressive enhancement use case)."," * <p>"," * This method should only be invoked once for an initialized"," * widget."," * </p>"," * <p>"," * It delegates to the widget specific renderer method to do"," * the actual work."," * </p>"," *"," * @method render"," * @chainable"," * @final "," * @param parentNode {Object | String} Optional. The Node under which the "," * Widget is to be rendered. This can be a Node instance or a CSS selector string. "," * <p>"," * If the selector string returns more than one Node, the first node will be used "," * as the parentNode. NOTE: This argument is required if both the boundingBox and contentBox"," * are not currently in the document. If it's not provided, the Widget will be rendered"," * to the body of the current document in this case."," * </p>"," */"," render: function(parentNode) {",""," if (!this.get(DESTROYED) && !this.get(RENDERED)) {"," /**"," * Lifecycle event for the render phase, fired prior to rendering the UI "," * for the widget (prior to invoking the widget's renderer method)."," * <p>"," * Subscribers to the \"on\" moment of this event, will be notified "," * before the widget is rendered."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after rendering is complete."," * </p>"," *"," * @event widget:render"," * @preventable _defRenderFn"," * @param {EventFacade} e The Event Facade"," */"," this.publish(RENDER, {"," queuable:FALSE,"," fireOnce:TRUE,"," defaultTargetOnly:TRUE,"," defaultFn: this._defRenderFn"," });",""," this.fire(RENDER, {parentNode: (parentNode) ? Node.one(parentNode) : null});"," }"," return this;"," },",""," /**"," * Default render handler"," *"," * @method _defRenderFn"," * @protected"," * @param {EventFacade} e The Event object"," * @param {Node} parentNode The parent node to render to, if passed in to the <code>render</code> method"," */"," _defRenderFn : function(e) {"," this._parentNode = e.parentNode;"," "," this.renderer();"," this._set(RENDERED, TRUE);",""," this._removeLoadingClassNames();"," },",""," /**"," * Creates DOM (or manipulates DOM for progressive enhancement)"," * This method is invoked by render() and is not chained "," * automatically for the class hierarchy (unlike initializer, destructor) "," * so it should be chained manually for subclasses if required."," *"," * @method renderer"," * @protected"," */"," renderer: function() {"," // kweight"," var widget = this;",""," widget._renderUI();"," widget.renderUI();",""," widget._bindUI();"," widget.bindUI();",""," widget._syncUI();"," widget.syncUI();"," },",""," /**"," * Configures/Sets up listeners to bind Widget State to UI/DOM"," * "," * This method is not called by framework and is not chained "," * automatically for the class hierarchy."," * "," * @method bindUI"," * @protected"," */"," bindUI: EMPTY_FN,",""," /**"," * Adds nodes to the DOM "," * "," * This method is not called by framework and is not chained "," * automatically for the class hierarchy."," * "," * @method renderUI"," * @protected"," */"," renderUI: EMPTY_FN,",""," /**"," * Refreshes the rendered UI, based on Widget State"," * "," * This method is not called by framework and is not chained"," * automatically for the class hierarchy."," *"," * @method syncUI"," * @protected"," *"," */"," syncUI: EMPTY_FN,",""," /**"," * @method hide"," * @description Hides the Widget by setting the \"visible\" attribute to \"false\"."," * @chainable"," */"," hide: function() {"," return this.set(VISIBLE, FALSE);"," },",""," /**"," * @method show"," * @description Shows the Widget by setting the \"visible\" attribute to \"true\"."," * @chainable"," */"," show: function() {"," return this.set(VISIBLE, TRUE);"," },",""," /**"," * @method focus"," * @description Causes the Widget to receive the focus by setting the \"focused\" "," * attribute to \"true\"."," * @chainable"," */"," focus: function () {"," return this._set(FOCUSED, TRUE);"," },",""," /**"," * @method blur"," * @description Causes the Widget to lose focus by setting the \"focused\" attribute "," * to \"false\""," * @chainable"," */"," blur: function () {"," return this._set(FOCUSED, FALSE);"," },",""," /**"," * @method enable"," * @description Set the Widget's \"disabled\" attribute to \"false\"."," * @chainable"," */"," enable: function() {"," return this.set(DISABLED, FALSE);"," },",""," /**"," * @method disable"," * @description Set the Widget's \"disabled\" attribute to \"true\"."," * @chainable"," */"," disable: function() {"," return this.set(DISABLED, TRUE);"," },",""," /**"," * @method _uiSizeCB"," * @protected"," * @param {boolean} expand"," */"," _uiSizeCB : function(expand) {"," this.get(CONTENT_BOX).toggleClass(_getWidgetClassName(CONTENT, \"expanded\"), expand); "," },",""," /**"," * Helper method to collect the boundingBox and contentBox and append to the provided parentNode, if not"," * already a child. The owner document of the boundingBox, or the owner document of the contentBox will be used "," * as the document into which the Widget is rendered if a parentNode is node is not provided. If both the boundingBox and"," * the contentBox are not currently in the document, and no parentNode is provided, the widget will be rendered "," * to the current document's body."," *"," * @method _renderBox"," * @private"," * @param {Node} parentNode The parentNode to render the widget to. If not provided, and both the boundingBox and"," * the contentBox are not currently in the document, the widget will be rendered to the current document's body."," */"," _renderBox: function(parentNode) {",""," // TODO: Performance Optimization [ More effective algo to reduce Node refs, compares, replaces? ]",""," var widget = this, // kweight"," contentBox = widget.get(CONTENT_BOX),"," boundingBox = widget.get(BOUNDING_BOX),"," srcNode = widget.get(SRC_NODE),"," defParentNode = widget.DEF_PARENT_NODE,",""," doc = (srcNode && srcNode.get(OWNER_DOCUMENT)) || boundingBox.get(OWNER_DOCUMENT) || contentBox.get(OWNER_DOCUMENT);",""," // If srcNode (assume it's always in doc), have contentBox take its place (widget render responsible for re-use of srcNode contents)"," if (srcNode && !srcNode.compareTo(contentBox) && !contentBox.inDoc(doc)) {"," srcNode.replace(contentBox);"," }",""," if (!boundingBox.compareTo(contentBox.get(PARENT_NODE)) && !boundingBox.compareTo(contentBox)) {"," // If contentBox box is already in the document, have boundingBox box take it's place"," if (contentBox.inDoc(doc)) {"," contentBox.replace(boundingBox);"," }"," boundingBox.appendChild(contentBox);"," }",""," parentNode = parentNode || (defParentNode && Node.one(defParentNode));",""," if (parentNode) {"," parentNode.appendChild(boundingBox);"," } else if (!boundingBox.inDoc(doc)) {"," Node.one(BODY).insert(boundingBox, 0);"," }"," },",""," /**"," * Setter for the boundingBox attribute"," *"," * @method _setBB"," * @private"," * @param Node/String"," * @return Node"," */"," _setBB: function(node) {"," return this._setBox(this.get(ID), node, this.BOUNDING_TEMPLATE, true);"," },",""," /**"," * Setter for the contentBox attribute"," *"," * @method _setCB"," * @private"," * @param {Node|String} node"," * @return Node"," */"," _setCB: function(node) {"," return (this.CONTENT_TEMPLATE === null) ? this.get(BOUNDING_BOX) : this._setBox(null, node, this.CONTENT_TEMPLATE, false);"," },",""," /**"," * Returns the default value for the contentBox attribute. "," *"," * For the Widget class, this will be the srcNode if provided, otherwise null (resulting in"," * a new contentBox node instance being created)"," *"," * @method _defaultCB"," * @protected"," */"," _defaultCB : function(node) {"," return this.get(SRC_NODE) || null;"," },",""," /**"," * Helper method to set the bounding/content box, or create it from"," * the provided template if not found."," *"," * @method _setBox"," * @private"," *"," * @param {String} id The node's id attribute"," * @param {Node|String} node The node reference"," * @param {String} template HTML string template for the node"," * @param {boolean} true if this is the boundingBox, false if it's the contentBox"," * @return {Node} The node"," */"," _setBox : function(id, node, template, isBounding) {",""," node = Node.one(node);",""," if (!node) {"," node = Node.create(template);",""," if (isBounding) {"," this._bbFromTemplate = true;"," } else {"," this._cbFromTemplate = true;"," }"," }",""," if (!node.get(ID)) {"," node.set(ID, id || Y.guid());"," }",""," return node;"," },",""," /**"," * Initializes the UI state for the Widget's bounding/content boxes."," *"," * @method _renderUI"," * @protected"," */"," _renderUI: function() {"," this._renderBoxClassNames();"," this._renderBox(this._parentNode);"," },",""," /**"," * Applies standard class names to the boundingBox and contentBox"," *"," * @method _renderBoxClassNames"," * @protected"," */"," _renderBoxClassNames : function() {"," var classes = this._getClasses(),"," cl,"," boundingBox = this.get(BOUNDING_BOX),"," i;",""," boundingBox.addClass(_getWidgetClassName());",""," // Start from Widget Sub Class"," for (i = classes.length-3; i >= 0; i--) {"," cl = classes[i];"," boundingBox.addClass(cl.CSS_PREFIX || _getClassName(cl.NAME.toLowerCase()));"," }",""," // Use instance based name for content box"," this.get(CONTENT_BOX).addClass(this.getClassName(CONTENT));"," },",""," /**"," * Removes class names representative of the widget's loading state from "," * the boundingBox."," *"," * @method _removeLoadingClassNames"," * @protected"," */"," _removeLoadingClassNames: function () {",""," var boundingBox = this.get(BOUNDING_BOX),"," contentBox = this.get(CONTENT_BOX),"," instClass = this.getClassName(LOADING),"," widgetClass = _getWidgetClassName(LOADING);",""," boundingBox.removeClass(widgetClass)"," .removeClass(instClass);",""," contentBox.removeClass(widgetClass)"," .removeClass(instClass);"," },",""," /**"," * Sets up DOM and CustomEvent listeners for the widget."," *"," * @method _bindUI"," * @protected"," */"," _bindUI: function() {"," this._bindAttrUI(this._UI_ATTRS.BIND);"," this._bindDOM();"," },",""," /**"," * @method _unbindUI"," * @protected"," */"," _unbindUI : function(boundingBox) {"," this._unbindDOM(boundingBox);"," },",""," /**"," * Sets up DOM listeners, on elements rendered by the widget."," * "," * @method _bindDOM"," * @protected"," */"," _bindDOM : function() {"," var oDocument = this.get(BOUNDING_BOX).get(OWNER_DOCUMENT),"," focusHandle = Widget._hDocFocus;",""," // Shared listener across all Widgets."," if (!focusHandle) {"," focusHandle = Widget._hDocFocus = oDocument.on(\"focus\", this._onDocFocus, this);"," focusHandle.listeners = {"," count: 0"," };"," }",""," focusHandle.listeners[Y.stamp(this, true)] = true;"," focusHandle.listeners.count++;",""," // Fix for Webkit:"," // Document doesn't receive focus in Webkit when the user mouses "," // down on it, so the \"focused\" attribute won't get set to the "," // correct value. Keeping this instance based for now, potential better performance."," // Otherwise we'll end up looking up widgets from the DOM on every mousedown."," if (WEBKIT){"," this._hDocMouseDown = oDocument.on(\"mousedown\", this._onDocMouseDown, this);"," }"," },",""," /**"," * @method _unbindDOM"," * @protected"," */ "," _unbindDOM : function(boundingBox) {",""," var focusHandle = Widget._hDocFocus,"," yuid = Y.stamp(this, true),"," focusListeners,"," mouseHandle = this._hDocMouseDown;",""," if (focusHandle) {",""," focusListeners = focusHandle.listeners;",""," if (focusListeners[yuid]) {"," delete focusListeners[yuid];"," focusListeners.count--;"," }",""," if (focusListeners.count === 0) {"," focusHandle.detach();"," Widget._hDocFocus = null;"," }"," }",""," if (WEBKIT && mouseHandle) {"," mouseHandle.detach();"," }"," },",""," /**"," * Updates the widget UI to reflect the attribute state."," *"," * @method _syncUI"," * @protected"," */"," _syncUI: function() {"," this._syncAttrUI(this._UI_ATTRS.SYNC);"," },",""," /**"," * Sets the height on the widget's bounding box element"," *"," * @method _uiSetHeight"," * @protected"," * @param {String | Number} val"," */"," _uiSetHeight: function(val) {"," this._uiSetDim(HEIGHT, val);"," this._uiSizeCB((val !== EMPTY_STR && val !== AUTO));"," },",""," /**"," * Sets the width on the widget's bounding box element"," *"," * @method _uiSetWidth"," * @protected"," * @param {String | Number} val"," */"," _uiSetWidth: function(val) {"," this._uiSetDim(WIDTH, val);"," },",""," /**"," * @method _uiSetDim"," * @private"," * @param {String} dim The dimension - \"width\" or \"height\""," * @param {Number | String} val The value to set"," */"," _uiSetDim: function(dimension, val) {"," this.get(BOUNDING_BOX).setStyle(dimension, L.isNumber(val) ? val + this.DEF_UNIT : val);"," },",""," /**"," * Sets the visible state for the UI"," * "," * @method _uiSetVisible"," * @protected"," * @param {boolean} val"," */"," _uiSetVisible: function(val) {"," this.get(BOUNDING_BOX).toggleClass(this.getClassName(HIDDEN), !val);"," },",""," /**"," * Sets the disabled state for the UI"," *"," * @method _uiSetDisabled"," * @protected"," * @param {boolean} val"," */"," _uiSetDisabled: function(val) {"," this.get(BOUNDING_BOX).toggleClass(this.getClassName(DISABLED), val);"," },",""," /**"," * Sets the focused state for the UI"," *"," * @method _uiSetFocused"," * @protected"," * @param {boolean} val"," * @param {string} src String representing the source that triggered an update to "," * the UI. "," */"," _uiSetFocused: function(val, src) {"," var boundingBox = this.get(BOUNDING_BOX);"," boundingBox.toggleClass(this.getClassName(FOCUSED), val);",""," if (src !== UI) {"," if (val) {"," boundingBox.focus(); "," } else {"," boundingBox.blur();"," }"," }"," },",""," /**"," * Set the tabIndex on the widget's rendered UI"," *"," * @method _uiSetTabIndex"," * @protected"," * @param Number"," */"," _uiSetTabIndex: function(index) {"," var boundingBox = this.get(BOUNDING_BOX);",""," if (L.isNumber(index)) {"," boundingBox.set(TAB_INDEX, index);"," } else {"," boundingBox.removeAttribute(TAB_INDEX);"," }"," },",""," /**"," * @method _onDocMouseDown"," * @description \"mousedown\" event handler for the owner document of the "," * widget's bounding box."," * @protected"," * @param {EventFacade} evt The event facade for the DOM focus event"," */"," _onDocMouseDown: function (evt) {"," if (this._domFocus) {"," this._onDocFocus(evt);"," }"," },",""," /**"," * DOM focus event handler, used to sync the state of the Widget with the DOM"," * "," * @method _onDocFocus"," * @protected"," * @param {EventFacade} evt The event facade for the DOM focus event"," */"," _onDocFocus: function (evt) {"," var widget = Widget.getByNode(evt.target),"," activeWidget = Widget._active;",""," if (activeWidget && (activeWidget !== widget)) {"," activeWidget._domFocus = false;"," activeWidget._set(FOCUSED, false, {src:UI});",""," Widget._active = null;"," }",""," if (widget) {"," widget._domFocus = true;"," widget._set(FOCUSED, true, {src:UI});",""," Widget._active = widget;"," }"," },",""," /**"," * Generic toString implementation for all widgets."," *"," * @method toString"," * @return {String} The default string value for the widget [ displays the NAME of the instance, and the unique id ]"," */"," toString: function() {"," // Using deprecated name prop for kweight squeeze."," return this.name + \"[\" + this.get(ID) + \"]\";"," },",""," /**"," * Default unit to use for dimension values"," * "," * @property DEF_UNIT"," * @type String"," */"," DEF_UNIT : \"px\",",""," /** "," * Default node to render the bounding box to. If not set,"," * will default to the current document body."," * "," * @property DEF_PARENT_NODE"," * @type String | Node"," */ "," DEF_PARENT_NODE : null,",""," /**"," * Property defining the markup template for content box. If your Widget doesn't"," * need the dual boundingBox/contentBox structure, set CONTENT_TEMPLATE to null,"," * and contentBox and boundingBox will both point to the same Node. "," *"," * @property CONTENT_TEMPLATE"," * @type String"," */"," CONTENT_TEMPLATE : DIV,",""," /**"," * Property defining the markup template for bounding box."," *"," * @property BOUNDING_TEMPLATE"," * @type String"," */"," BOUNDING_TEMPLATE : DIV,",""," /**"," * @method _guid"," * @protected"," */"," _guid : function() {"," return Y.guid();"," },",""," /**"," * @method _validTabIndex"," * @protected"," * @param {Number} tabIndex"," */"," _validTabIndex : function (tabIndex) {"," return (L.isNumber(tabIndex) || L.isNull(tabIndex));"," },",""," /**"," * Binds after listeners for the list of attributes provided"," * "," * @method _bindAttrUI"," * @private"," * @param {Array} attrs"," */"," _bindAttrUI : function(attrs) {"," var i, "," l = attrs.length; ",""," for (i = 0; i < l; i++) {"," this.after(attrs[i] + CHANGE, this._setAttrUI);"," }"," },",""," /**"," * Invokes the _uiSet=ATTR NAME> method for the list of attributes provided "," *"," * @method _syncAttrUI"," * @private"," * @param {Array} attrs"," */"," _syncAttrUI : function(attrs) {"," var i, l = attrs.length, attr;"," for (i = 0; i < l; i++) {"," attr = attrs[i];"," this[_UISET + _toInitialCap(attr)](this.get(attr));"," }"," },",""," /**"," * @method _setAttrUI"," * @private"," * @param {EventFacade} e"," */"," _setAttrUI : function(e) {"," if (e.target === this) {"," this[_UISET + _toInitialCap(e.attrName)](e.newVal, e.src);"," }"," },",""," /**"," * The default setter for the strings attribute. Merges partial sets"," * into the full string set, to allow users to partial sets of strings "," *"," * @method _strSetter"," * @protected"," * @param {Object} strings"," * @return {String} The full set of strings to set"," */"," _strSetter : function(strings) {"," return Y.merge(this.get(STRINGS), strings);"," },",""," /**"," * Helper method to get a specific string value"," *"," * @deprecated Used by deprecated WidgetLocale implementations. "," * @method getString"," * @param {String} key"," * @return {String} The string"," */"," getString : function(key) {"," return this.get(STRINGS)[key];"," },",""," /**"," * Helper method to get the complete set of strings for the widget"," *"," * @deprecated Used by deprecated WidgetLocale implementations."," * @method getStrings"," * @param {String} key"," * @return {String} The strings"," */"," getStrings : function() {"," return this.get(STRINGS);"," },",""," /**"," * The lists of UI attributes to bind and sync for widget's _bindUI and _syncUI implementations"," *"," * @property _UI_ATTRS"," * @type Object"," * @private"," */"," _UI_ATTRS : {"," BIND: UI_ATTRS,"," SYNC: UI_ATTRS"," }","});","","Y.Widget = Widget;","","","}, '3.7.3', {\"requires\": [\"attribute\", \"base-base\", \"base-pluginhost\", \"classnamemanager\", \"event-focus\", \"node-base\", \"node-style\"], \"skinnable\": true});"]; _yuitest_coverage["build/widget-base/widget-base.js"].lines = {"1":0,"16":0,"25":0,"87":0,"90":0,"95":0,"96":0,"99":0,"101":0,"103":0,"105":0,"107":0,"108":0,"110":0,"125":0,"136":0,"146":0,"157":0,"171":0,"184":0,"197":0,"214":0,"227":0,"239":0,"249":0,"260":0,"271":0,"281":0,"294":0,"308":0,"323":0,"325":0,"328":0,"342":0,"343":0,"346":0,"347":0,"348":0,"349":0,"350":0,"354":0,"357":0,"378":0,"391":0,"393":0,"394":0,"409":0,"410":0,"424":0,"437":0,"440":0,"441":0,"443":0,"444":0,"447":0,"470":0,"471":0,"483":0,"488":0,"490":0,"491":0,"494":0,"496":0,"498":0,"499":0,"501":0,"502":0,"504":0,"505":0,"538":0,"555":0,"562":0,"564":0,"576":0,"578":0,"579":0,"581":0,"595":0,"597":0,"598":0,"600":0,"601":0,"603":0,"604":0,"647":0,"656":0,"666":0,"676":0,"685":0,"694":0,"703":0,"722":0,"731":0,"732":0,"735":0,"737":0,"738":0,"740":0,"743":0,"745":0,"746":0,"747":0,"748":0,"761":0,"773":0,"786":0,"804":0,"806":0,"807":0,"809":0,"810":0,"812":0,"816":0,"817":0,"820":0,"830":0,"831":0,"841":0,"846":0,"849":0,"850":0,"851":0,"855":0,"867":0,"872":0,"875":0,"886":0,"887":0,"895":0,"905":0,"909":0,"910":0,"911":0,"916":0,"917":0,"924":0,"925":0,"935":0,"940":0,"942":0,"944":0,"945":0,"946":0,"949":0,"950":0,"951":0,"955":0,"956":0,"967":0,"978":0,"979":0,"990":0,"1000":0,"1011":0,"1022":0,"1035":0,"1036":0,"1038":0,"1039":0,"1040":0,"1042":0,"1055":0,"1057":0,"1058":0,"1060":0,"1072":0,"1073":0,"1085":0,"1088":0,"1089":0,"1090":0,"1092":0,"1095":0,"1096":0,"1097":0,"1099":0,"1111":0,"1154":0,"1163":0,"1174":0,"1177":0,"1178":0,"1190":0,"1191":0,"1192":0,"1193":0,"1203":0,"1204":0,"1218":0,"1230":0,"1242":0,"1258":0}; _yuitest_coverage["build/widget-base/widget-base.js"].functions = {"(anonymous 2):24":0,"Widget:87":0,"getClassName:323":0,"getByNode:342":0,"getClassName:377":0,"initializer:389":0,"_mapInstance:423":0,"destructor:435":0,"destroy:469":0,"_destroyBox:481":0,"render:536":0,"_defRenderFn:575":0,"renderer:593":0,"hide:646":0,"show:655":0,"focus:665":0,"blur:675":0,"enable:684":0,"disable:693":0,"_uiSizeCB:702":0,"_renderBox:718":0,"_setBB:760":0,"_setCB:772":0,"_defaultCB:785":0,"_setBox:802":0,"_renderUI:829":0,"_renderBoxClassNames:840":0,"_removeLoadingClassNames:865":0,"_bindUI:885":0,"_unbindUI:894":0,"_bindDOM:904":0,"_unbindDOM:933":0,"_syncUI:966":0,"_uiSetHeight:977":0,"_uiSetWidth:989":0,"_uiSetDim:999":0,"_uiSetVisible:1010":0,"_uiSetDisabled:1021":0,"_uiSetFocused:1034":0,"_uiSetTabIndex:1054":0,"_onDocMouseDown:1071":0,"_onDocFocus:1084":0,"toString:1109":0,"_guid:1153":0,"_validTabIndex:1162":0,"_bindAttrUI:1173":0,"_syncAttrUI:1189":0,"_setAttrUI:1202":0,"_strSetter:1217":0,"getString:1229":0,"getStrings:1241":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-base/widget-base.js"].coveredLines = 192;@@ -1541,4 +1541,4 @@ Y.Widget = Widget; -}, '3.7.2', {"requires": ["attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style"], "skinnable": true});+}, '3.7.3', {"requires": ["attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style"], "skinnable": true});
bundle/widget-base/widget-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1268,4 +1268,4 @@ Y.Widget = Widget; -}, '3.7.2', {"requires": ["attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style"], "skinnable": true});+}, '3.7.3', {"requires": ["attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style"], "skinnable": true});
bundle/widget-base/widget-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-base",function(e,t){function R(e){var t=this,n,r,i=t.constructor;t._strs={},t._cssPrefix=i.CSS_PREFIX||s(i.NAME.toLowerCase()),e=e||{},R.superclass.constructor.call(t,e),r=t.get(T),r&&(r!==P&&(n=r),t.render(n))}var n=e.Lang,r=e.Node,i=e.ClassNameManager,s=i.getClassName,o,u=e.cached(function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}),a="content",f="visible",l="hidden",c="disabled",h="focused",p="width",d="height",v="boundingBox",m="contentBox",g="parentNode",y="ownerDocument",b="auto",w="srcNode",E="body",S="tabIndex",x="id",T="render",N="rendered",C="destroyed",k="strings",L="<div></div>",A="Change",O="loading",M="_uiSet",_="",D=function(){},P=!0,H=!1,B,j={},F=[f,c,d,p,h,S],I=e.UA.webkit,q={};R.NAME="widget",B=R.UI_SRC="ui",R.ATTRS=j,j[x]={valueFn:"_guid",writeOnce:P},j[N]={value:H,readOnly:P},j[v]={value:null,setter:"_setBB",writeOnce:P},j[m]={valueFn:"_defaultCB",setter:"_setCB",writeOnce:P},j[S]={value:null,validator:"_validTabIndex"},j[h]={value:H,readOnly:P},j[c]={value:H},j[f]={value:P},j[d]={value:_},j[p]={value:_},j[k]={value:{},setter:"_strSetter",getter:"_strGetter"},j[T]={value:H,writeOnce:P},R.CSS_PREFIX=s(R.NAME.toLowerCase()),R.getClassName=function(){return s.apply(i,[R.CSS_PREFIX].concat(e.Array(arguments),!0))},o=R.getClassName,R.getByNode=function(t){var n,i=o();return t=r.one(t),t&&(t=t.ancestor("."+i,!0),t&&(n=q[e.stamp(t,!0)])),n||null},e.extend(R,e.Base,{getClassName:function(){return s.apply(i,[this._cssPrefix].concat(e.Array(arguments),!0))},initializer:function(t){var n=this.get(v);n instanceof r&&this._mapInstance(e.stamp(n)),this._applyParser&&this._applyParser(t)},_mapInstance:function(e){q[e]=this},destructor:function(){var t=this.get(v),n;t instanceof r&&(n=e.stamp(t,!0),n in q&&delete q[n],this._destroyBox())},destroy:function(e){return this._destroyAllNodes=e,R.superclass.destroy.apply(this)},_destroyBox:function(){var e=this.get(v),t=this.get(m),n=this._destroyAllNodes,r;r=e&&e.compareTo(t),this.UI_EVENTS&&this._destroyUIEvents(),this._unbindUI(e),n?(e.empty(),e.remove(P)):(t&&t.remove(P),r||e.remove(P))},render:function(e){return!this.get(C)&&!this.get(N)&&(this.publish(T,{queuable:H,fireOnce:P,defaultTargetOnly:P,defaultFn:this._defRenderFn}),this.fire(T,{parentNode:e?r.one(e):null})),this},_defRenderFn:function(e){this._parentNode=e.parentNode,this.renderer(),this._set(N,P),this._removeLoadingClassNames()},renderer:function(){var e=this;e._renderUI(),e.renderUI(),e._bindUI(),e.bindUI(),e._syncUI(),e.syncUI()},bindUI:D,renderUI:D,syncUI:D,hide:function(){return this.set(f,H)},show:function(){return this.set(f,P)},focus:function(){return this._set(h,P)},blur:function(){return this._set(h,H)},enable:function(){return this.set(c,H)},disable:function(){return this.set(c,P)},_uiSizeCB:function(e){this.get(m).toggleClass(o(a,"expanded"),e)},_renderBox:function(e){var t=this,n=t.get(m),i=t.get(v),s=t.get(w),o=t.DEF_PARENT_NODE,u=s&&s.get(y)||i.get(y)||n.get(y);s&&!s.compareTo(n)&&!n.inDoc(u)&&s.replace(n),!i.compareTo(n.get(g))&&!i.compareTo(n)&&(n.inDoc(u)&&n.replace(i),i.appendChild(n)),e=e||o&&r.one(o),e?e.appendChild(i):i.inDoc(u)||r.one(E).insert(i,0)},_setBB:function(e){return this._setBox(this.get(x),e,this.BOUNDING_TEMPLATE,!0)},_setCB:function(e){return this.CONTENT_TEMPLATE===null?this.get(v):this._setBox(null,e,this.CONTENT_TEMPLATE,!1)},_defaultCB:function(e){return this.get(w)||null},_setBox:function(t,n,i,s){return n=r.one(n),n||(n=r.create(i),s?this._bbFromTemplate=!0:this._cbFromTemplate=!0),n.get(x)||n.set(x,t||e.guid()),n},_renderUI:function(){this._renderBoxClassNames(),this._renderBox(this._parentNode)},_renderBoxClassNames:function(){var e=this._getClasses(),t,n=this.get(v),r;n.addClass(o());for(r=e.length-3;r>=0;r--)t=e[r],n.addClass(t.CSS_PREFIX||s(t.NAME.toLowerCase()));this.get(m).addClass(this.getClassName(a))},_removeLoadingClassNames:function(){var e=this.get(v),t=this.get(m),n=this.getClassName(O),r=o(O);e.removeClass(r).removeClass(n),t.removeClass(r).removeClass(n)},_bindUI:function(){this._bindAttrUI(this._UI_ATTRS.BIND),this._bindDOM()},_unbindUI:function(e){this._unbindDOM(e)},_bindDOM:function(){var t=this.get(v).get(y),n=R._hDocFocus;n||(n=R._hDocFocus=t.on("focus",this._onDocFocus,this),n.listeners={count:0}),n.listeners[e.stamp(this,!0)]=!0,n.listeners.count++,I&&(this._hDocMouseDown=t.on("mousedown",this._onDocMouseDown,this))},_unbindDOM:function(t){var n=R._hDocFocus,r=e.stamp(this,!0),i,s=this._hDocMouseDown;n&&(i=n.listeners,i[r]&&(delete i[r],i.count--),i.count===0&&(n.detach(),R._hDocFocus=null)),I&&s&&s.detach()},_syncUI:function(){this._syncAttrUI(this._UI_ATTRS.SYNC)},_uiSetHeight:function(e){this._uiSetDim(d,e),this._uiSizeCB(e!==_&&e!==b)},_uiSetWidth:function(e){this._uiSetDim(p,e)},_uiSetDim:function(e,t){this.get(v).setStyle(e,n.isNumber(t)?t+this.DEF_UNIT:t)},_uiSetVisible:function(e){this.get(v).toggleClass(this.getClassName(l),!e)},_uiSetDisabled:function(e){this.get(v).toggleClass(this.getClassName(c),e)},_uiSetFocused:function(e,t){var n=this.get(v);n.toggleClass(this.getClassName(h),e),t!==B&&(e?n.focus():n.blur())},_uiSetTabIndex:function(e){var t=this.get(v);n.isNumber(e)?t.set(S,e):t.removeAttribute(S)},_onDocMouseDown:function(e){this._domFocus&&this._onDocFocus(e)},_onDocFocus:function(e){var t=R.getByNode(e.target),n=R._active;n&&n!==t&&(n._domFocus=!1,n._set(h,!1,{src:B}),R._active=null),t&&(t._domFocus=!0,t._set(h,!0,{src:B}),R._active=t)},toString:function(){return this.name+"["+this.get(x)+"]"},DEF_UNIT:"px",DEF_PARENT_NODE:null,CONTENT_TEMPLATE:L,BOUNDING_TEMPLATE:L,_guid:function(){return e.guid()},_validTabIndex:function(e){return n.isNumber(e)||n.isNull(e)},_bindAttrUI:function(e){var t,n=e.length;for(t=0;t<n;t++)this.after(e[t]+A,this._setAttrUI)},_syncAttrUI:function(e){var t,n=e.length,r;for(t=0;t<n;t++)r=e[t],this[M+u(r)](this.get(r))},_setAttrUI:function(e){e.target===this&&this[M+u(e.attrName)](e.newVal,e.src)},_strSetter:function(t){return e.merge(this.get(k),t)},getString:function(e){return this.get(k)[e]},getStrings:function(){return this.get(k)},_UI_ATTRS:{BIND:F,SYNC:F}}),e.Widget=R},"3.7.2",{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0});+YUI.add("widget-base",function(e,t){function R(e){var t=this,n,r,i=t.constructor;t._strs={},t._cssPrefix=i.CSS_PREFIX||s(i.NAME.toLowerCase()),e=e||{},R.superclass.constructor.call(t,e),r=t.get(T),r&&(r!==P&&(n=r),t.render(n))}var n=e.Lang,r=e.Node,i=e.ClassNameManager,s=i.getClassName,o,u=e.cached(function(e){return e.substring(0,1).toUpperCase()+e.substring(1)}),a="content",f="visible",l="hidden",c="disabled",h="focused",p="width",d="height",v="boundingBox",m="contentBox",g="parentNode",y="ownerDocument",b="auto",w="srcNode",E="body",S="tabIndex",x="id",T="render",N="rendered",C="destroyed",k="strings",L="<div></div>",A="Change",O="loading",M="_uiSet",_="",D=function(){},P=!0,H=!1,B,j={},F=[f,c,d,p,h,S],I=e.UA.webkit,q={};R.NAME="widget",B=R.UI_SRC="ui",R.ATTRS=j,j[x]={valueFn:"_guid",writeOnce:P},j[N]={value:H,readOnly:P},j[v]={value:null,setter:"_setBB",writeOnce:P},j[m]={valueFn:"_defaultCB",setter:"_setCB",writeOnce:P},j[S]={value:null,validator:"_validTabIndex"},j[h]={value:H,readOnly:P},j[c]={value:H},j[f]={value:P},j[d]={value:_},j[p]={value:_},j[k]={value:{},setter:"_strSetter",getter:"_strGetter"},j[T]={value:H,writeOnce:P},R.CSS_PREFIX=s(R.NAME.toLowerCase()),R.getClassName=function(){return s.apply(i,[R.CSS_PREFIX].concat(e.Array(arguments),!0))},o=R.getClassName,R.getByNode=function(t){var n,i=o();return t=r.one(t),t&&(t=t.ancestor("."+i,!0),t&&(n=q[e.stamp(t,!0)])),n||null},e.extend(R,e.Base,{getClassName:function(){return s.apply(i,[this._cssPrefix].concat(e.Array(arguments),!0))},initializer:function(t){var n=this.get(v);n instanceof r&&this._mapInstance(e.stamp(n)),this._applyParser&&this._applyParser(t)},_mapInstance:function(e){q[e]=this},destructor:function(){var t=this.get(v),n;t instanceof r&&(n=e.stamp(t,!0),n in q&&delete q[n],this._destroyBox())},destroy:function(e){return this._destroyAllNodes=e,R.superclass.destroy.apply(this)},_destroyBox:function(){var e=this.get(v),t=this.get(m),n=this._destroyAllNodes,r;r=e&&e.compareTo(t),this.UI_EVENTS&&this._destroyUIEvents(),this._unbindUI(e),n?(e.empty(),e.remove(P)):(t&&t.remove(P),r||e.remove(P))},render:function(e){return!this.get(C)&&!this.get(N)&&(this.publish(T,{queuable:H,fireOnce:P,defaultTargetOnly:P,defaultFn:this._defRenderFn}),this.fire(T,{parentNode:e?r.one(e):null})),this},_defRenderFn:function(e){this._parentNode=e.parentNode,this.renderer(),this._set(N,P),this._removeLoadingClassNames()},renderer:function(){var e=this;e._renderUI(),e.renderUI(),e._bindUI(),e.bindUI(),e._syncUI(),e.syncUI()},bindUI:D,renderUI:D,syncUI:D,hide:function(){return this.set(f,H)},show:function(){return this.set(f,P)},focus:function(){return this._set(h,P)},blur:function(){return this._set(h,H)},enable:function(){return this.set(c,H)},disable:function(){return this.set(c,P)},_uiSizeCB:function(e){this.get(m).toggleClass(o(a,"expanded"),e)},_renderBox:function(e){var t=this,n=t.get(m),i=t.get(v),s=t.get(w),o=t.DEF_PARENT_NODE,u=s&&s.get(y)||i.get(y)||n.get(y);s&&!s.compareTo(n)&&!n.inDoc(u)&&s.replace(n),!i.compareTo(n.get(g))&&!i.compareTo(n)&&(n.inDoc(u)&&n.replace(i),i.appendChild(n)),e=e||o&&r.one(o),e?e.appendChild(i):i.inDoc(u)||r.one(E).insert(i,0)},_setBB:function(e){return this._setBox(this.get(x),e,this.BOUNDING_TEMPLATE,!0)},_setCB:function(e){return this.CONTENT_TEMPLATE===null?this.get(v):this._setBox(null,e,this.CONTENT_TEMPLATE,!1)},_defaultCB:function(e){return this.get(w)||null},_setBox:function(t,n,i,s){return n=r.one(n),n||(n=r.create(i),s?this._bbFromTemplate=!0:this._cbFromTemplate=!0),n.get(x)||n.set(x,t||e.guid()),n},_renderUI:function(){this._renderBoxClassNames(),this._renderBox(this._parentNode)},_renderBoxClassNames:function(){var e=this._getClasses(),t,n=this.get(v),r;n.addClass(o());for(r=e.length-3;r>=0;r--)t=e[r],n.addClass(t.CSS_PREFIX||s(t.NAME.toLowerCase()));this.get(m).addClass(this.getClassName(a))},_removeLoadingClassNames:function(){var e=this.get(v),t=this.get(m),n=this.getClassName(O),r=o(O);e.removeClass(r).removeClass(n),t.removeClass(r).removeClass(n)},_bindUI:function(){this._bindAttrUI(this._UI_ATTRS.BIND),this._bindDOM()},_unbindUI:function(e){this._unbindDOM(e)},_bindDOM:function(){var t=this.get(v).get(y),n=R._hDocFocus;n||(n=R._hDocFocus=t.on("focus",this._onDocFocus,this),n.listeners={count:0}),n.listeners[e.stamp(this,!0)]=!0,n.listeners.count++,I&&(this._hDocMouseDown=t.on("mousedown",this._onDocMouseDown,this))},_unbindDOM:function(t){var n=R._hDocFocus,r=e.stamp(this,!0),i,s=this._hDocMouseDown;n&&(i=n.listeners,i[r]&&(delete i[r],i.count--),i.count===0&&(n.detach(),R._hDocFocus=null)),I&&s&&s.detach()},_syncUI:function(){this._syncAttrUI(this._UI_ATTRS.SYNC)},_uiSetHeight:function(e){this._uiSetDim(d,e),this._uiSizeCB(e!==_&&e!==b)},_uiSetWidth:function(e){this._uiSetDim(p,e)},_uiSetDim:function(e,t){this.get(v).setStyle(e,n.isNumber(t)?t+this.DEF_UNIT:t)},_uiSetVisible:function(e){this.get(v).toggleClass(this.getClassName(l),!e)},_uiSetDisabled:function(e){this.get(v).toggleClass(this.getClassName(c),e)},_uiSetFocused:function(e,t){var n=this.get(v);n.toggleClass(this.getClassName(h),e),t!==B&&(e?n.focus():n.blur())},_uiSetTabIndex:function(e){var t=this.get(v);n.isNumber(e)?t.set(S,e):t.removeAttribute(S)},_onDocMouseDown:function(e){this._domFocus&&this._onDocFocus(e)},_onDocFocus:function(e){var t=R.getByNode(e.target),n=R._active;n&&n!==t&&(n._domFocus=!1,n._set(h,!1,{src:B}),R._active=null),t&&(t._domFocus=!0,t._set(h,!0,{src:B}),R._active=t)},toString:function(){return this.name+"["+this.get(x)+"]"},DEF_UNIT:"px",DEF_PARENT_NODE:null,CONTENT_TEMPLATE:L,BOUNDING_TEMPLATE:L,_guid:function(){return e.guid()},_validTabIndex:function(e){return n.isNumber(e)||n.isNull(e)},_bindAttrUI:function(e){var t,n=e.length;for(t=0;t<n;t++)this.after(e[t]+A,this._setAttrUI)},_syncAttrUI:function(e){var t,n=e.length,r;for(t=0;t<n;t++)r=e[t],this[M+u(r)](this.get(r))},_setAttrUI:function(e){e.target===this&&this[M+u(e.attrName)](e.newVal,e.src)},_strSetter:function(t){return e.merge(this.get(k),t)},getString:function(e){return this.get(k)[e]},getStrings:function(){return this.get(k)},_UI_ATTRS:{BIND:F,SYNC:F}}),e.Widget=R},"3.7.3",{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0});
bundle/widget-base/widget-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -1264,4 +1264,4 @@ Y.Widget = Widget; -}, '3.7.2', {"requires": ["attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style"], "skinnable": true});+}, '3.7.3', {"requires": ["attribute", "base-base", "base-pluginhost", "classnamemanager", "event-focus", "node-base", "node-style"], "skinnable": true});
bundle/widget-buttons/assets/skins/night/widget-buttons-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-buttons/assets/skins/night/widget-buttons.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-buttons/assets/skins/sam/widget-buttons-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-buttons/assets/skins/sam/widget-buttons.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-buttons/assets/widget-buttons-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-buttons/widget-buttons-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,10 +32,10 @@ path: "build/widget-buttons/widget-buttons.js", code: [] };-_yuitest_coverage["build/widget-buttons/widget-buttons.js"].code=["YUI.add('widget-buttons', function (Y, NAME) {","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","@module widget-buttons","@since 3.4.0","**/","","var YArray = Y.Array,"," YLang = Y.Lang,"," YObject = Y.Object,",""," ButtonPlugin = Y.Plugin.Button,"," Widget = Y.Widget,"," WidgetStdMod = Y.WidgetStdMod,",""," getClassName = Y.ClassNameManager.getClassName,"," isArray = YLang.isArray,"," isNumber = YLang.isNumber,"," isString = YLang.isString,"," isValue = YLang.isValue;","","// Utility to determine if an object is a Y.Node instance, even if it was","// created in a different YUI sandbox.","function isNode(node) {"," return !!node.getDOMNode;","}","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","This Widget extension makes it easy to declaratively configure a widget's","buttons. It adds a `buttons` attribute along with button- accessor and mutator","methods. All button nodes have the `Y.Plugin.Button` plugin applied.","","This extension also includes `HTML_PARSER` support to seed a widget's `buttons`","from those which already exist in its DOM.","","@class WidgetButtons","@extensionfor Widget","@since 3.4.0","**/","function WidgetButtons() {"," // Require `Y.WidgetStdMod`."," if (!this._stdModNode) {"," Y.error('WidgetStdMod must be added to a Widget before WidgetButtons.');"," }",""," // Has to be setup before the `initializer()`."," this._buttonsHandles = {};","}","","WidgetButtons.ATTRS = {"," /**"," Collection containing a widget's buttons.",""," The collection is an Object which contains an Array of `Y.Node`s for every"," `WidgetStdMod` section (header, body, footer) which has one or more buttons."," All button nodes have the `Y.Plugin.Button` plugin applied.",""," This attribute is very flexible in the values it will accept. `buttons` can"," be specified as a single Array, or an Object of Arrays keyed to a particular"," section.",""," All specified values will be normalized to this type of structure:",""," {"," header: [...],"," footer: [...]"," }",""," A button can be specified as a `Y.Node`, config Object, or String name for a"," predefined button on the `BUTTONS` prototype property. When a config Object"," is provided, it will be merged with any defaults provided by a button with"," the same `name` defined on the `BUTTONS` property.",""," See `addButton()` for the detailed list of configuration properties.",""," For convenience, a widget's buttons will always persist and remain rendered"," after header/body/footer content updates. Buttons should be removed by"," updating this attribute or using the `removeButton()` method.",""," @example"," {"," // Uses predefined \"close\" button by string name."," header: ['close'],",""," footer: ["," {"," name : 'cancel',"," label : 'Cancel',"," action: 'hide'"," },",""," {"," name : 'okay',"," label : 'Okay',"," isDefault: true,",""," events: {"," click: function (e) {"," this.hide();"," }"," }"," }"," ]"," }",""," @attribute buttons"," @type Object"," @default {}"," @since 3.4.0"," **/"," buttons: {"," getter: '_getButtons',"," setter: '_setButtons',"," value : {}"," },",""," /**"," The current default button as configured through this widget's `buttons`.",""," A button can be configured as the default button in the following ways:",""," * As a config Object with an `isDefault` property:"," `{label: 'Okay', isDefault: true}`.",""," * As a Node with a `data-default` attribute:"," `<button data-default=\"true\">Okay</button>`.",""," This attribute is **read-only**; anytime there are changes to this widget's"," `buttons`, the `defaultButton` will be updated if needed.",""," **Note:** If two or more buttons are configured to be the default button,"," the last one wins.",""," @attribute defaultButton"," @type Node"," @default null"," @readOnly"," @since 3.5.0"," **/"," defaultButton: {"," readOnly: true,"," value : null"," }","};","","/**","CSS classes used by `WidgetButtons`.","","@property CLASS_NAMES","@type Object","@static","@since 3.5.0","**/","WidgetButtons.CLASS_NAMES = {"," button : getClassName('button'),"," buttons: Widget.getClassName('buttons'),"," primary: getClassName('button', 'primary')","};","","WidgetButtons.HTML_PARSER = {"," buttons: function (srcNode) {"," return this._parseButtons(srcNode);"," }","};","","/**","The list of button configuration properties which are specific to","`WidgetButtons` and should not be passed to `Y.Plugin.Button.createNode()`.","","@property NON_BUTTON_NODE_CFG","@type Array","@static","@since 3.5.0","**/","WidgetButtons.NON_BUTTON_NODE_CFG = ["," 'action', 'classNames', 'context', 'events', 'isDefault', 'section'","];","","WidgetButtons.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Collection of predefined buttons mapped by name -> config.",""," These button configurations will serve as defaults for any button added to a"," widget's buttons which have the same `name`.",""," See `addButton()` for a list of possible configuration values.",""," @property BUTTONS"," @type Object"," @default {}"," @see addButton()"," @since 3.5.0"," **/"," BUTTONS: {},",""," /**"," The HTML template to use when creating the node which wraps all buttons of a"," section. By default it will have the CSS class: \"yui3-widget-buttons\".",""," @property BUTTONS_TEMPLATE"," @type String"," @default \"<span />\""," @since 3.5.0"," **/"," BUTTONS_TEMPLATE: '<span />',",""," /**"," The default section to render buttons in when no section is specified.",""," @property DEFAULT_BUTTONS_SECTION"," @type String"," @default Y.WidgetStdMod.FOOTER"," @since 3.5.0"," **/"," DEFAULT_BUTTONS_SECTION: WidgetStdMod.FOOTER,",""," // -- Protected Properties -------------------------------------------------",""," /**"," A map of button node `_yuid` -> event-handle for all button nodes which were"," created by this widget.",""," @property _buttonsHandles"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," A map of this widget's `buttons`, both name -> button and"," section:name -> button.",""," @property _buttonsMap"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," Internal reference to this widget's default button.",""," @property _defaultButton"," @type Node"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," // Creates button mappings and sets the `defaultButton`."," this._mapButtons(this.get('buttons'));"," this._updateDefaultButton();",""," // Bound with `Y.bind()` to make more extensible."," this.after('buttonsChange', Y.bind('_afterButtonsChange', this));",""," Y.after(this._bindUIButtons, this, 'bindUI');"," Y.after(this._syncUIButtons, this, 'syncUI');"," },",""," destructor: function () {"," // Detach all event subscriptions this widget added to its `buttons`."," YObject.each(this._buttonsHandles, function (handle) {"," handle.detach();"," });",""," delete this._buttonsHandles;"," delete this._buttonsMap;"," delete this._defaultButton;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Adds a button to this widget.",""," The new button node will have the `Y.Plugin.Button` plugin applied, be added"," to this widget's `buttons`, and rendered in the specified `section` at the"," specified `index` (or end of the section when no `index` is provided). If"," the section does not exist, it will be created.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node or config object to add.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button will be added.",""," * `index`: The index at which the button will be in the section.",""," * `src`: \"add\"",""," **Note:** The `index` argument will be passed to the Array `splice()`"," method, therefore a negative value will insert the `button` that many items"," from the end. The `index` property on the `buttonsChange` event facade is"," the index at which the `button` was added.",""," @method addButton"," @param {Node|Object|String} button The button to add. This can be a `Y.Node`"," instance, config Object, or String name for a predefined button on the"," `BUTTONS` prototype property. When a config Object is provided, it will"," be merged with any defaults provided by any `srcNode` and/or a button"," with the same `name` defined on the `BUTTONS` property. The following"," are the possible configuration properties beyond what Node plugins"," accept by default:"," @param {Function|String} [button.action] The default handler that should"," be called when the button is clicked. A String name of a Function that"," exists on the `context` object can also be provided. **Note:**"," Specifying a set of `events` will override this setting."," @param {String|String[]} [button.classNames] Additional CSS classes to add"," to the button node."," @param {Object} [button.context=this] Context which any `events` or"," `action` should be called with. Defaults to `this`, the widget."," **Note:** `e.target` will access the button node in the event handlers."," @param {Boolean} [button.disabled=false] Whether the button should be"," disabled."," @param {String|Object} [button.events=\"click\"] Event name, or set of"," events and handlers to bind to the button node. **See:** `Y.Node.on()`,"," this value is passed as the first argument to `on()`."," @param {Boolean} [button.isDefault=false] Whether the button is the"," default button."," @param {String} [button.label] The visible text/value displayed in the"," button."," @param {String} [button.name] A name which can later be used to reference"," this button. If a button is defined on the `BUTTONS` property with this"," same name, its configuration properties will be merged in as defaults."," @param {String} [button.section] The `WidgetStdMod` section (header, body,"," footer) where the button should be added."," @param {Node} [button.srcNode] An existing Node to use for the button,"," default values will be seeded from this node, but are overriden by any"," values specified in the config object. By default a new <button>"," node will be created."," @param {String} [button.template] A specific template to use when creating"," a new button node (e.g. \"<a />\"). **Note:** Specifying a `srcNode`"," will overide this."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button should be added. This takes"," precedence over the `button.section` configuration property."," @param {Number} [index] The index at which the button should be inserted. If"," not specified, the button will be added to the end of the section. This"," value is passed to the Array `splice()` method, therefore a negative"," value will insert the `button` that many items from the end."," @chainable"," @see Plugin.Button.createNode()"," @since 3.4.0"," **/"," addButton: function (button, section, index) {"," var buttons = this.get('buttons'),"," sectionButtons, atIndex;",""," // Makes sure we have the full config object."," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," section || (section = this.DEFAULT_BUTTONS_SECTION);"," sectionButtons = buttons[section] || (buttons[section] = []);"," isNumber(index) || (index = sectionButtons.length);",""," // Insert new button at the correct position."," sectionButtons.splice(index, 0, button);",""," // Determine the index at which the `button` now exists in the array."," atIndex = YArray.indexOf(sectionButtons, button);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : atIndex,"," src : 'add'"," });",""," return this;"," },",""," /**"," Returns a button node from this widget's `buttons`.",""," @method getButton"," @param {Number|String} name The string name or index of the button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," looking for a button by numerical index, or by name but scoped to a"," particular section."," @return {Node} The button node."," @since 3.5.0"," **/"," getButton: function (name, section) {"," if (!isValue(name)) { return; }",""," var map = this._buttonsMap,"," buttons;",""," section || (section = this.DEFAULT_BUTTONS_SECTION);",""," // Supports `getButton(1, 'header')` signature."," if (isNumber(name)) {"," buttons = this.get('buttons');"," return buttons[section] && buttons[section][name];"," }",""," // Looks up button by name or section:name."," return arguments.length > 1 ? map[section + ':' + name] : map[name];"," },",""," /**"," Removes a button from this widget.",""," The button will be removed from this widget's `buttons` and its DOM. Any"," event subscriptions on the button which were created by this widget will be"," detached. If the content section becomes empty after removing the button"," node, then the section will also be removed.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node to remove.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button should be removed from.",""," * `index`: The index at which the button exists in the section.",""," * `src`: \"remove\"",""," @method removeButton"," @param {Node|Number|String} button The button to remove. This can be a"," `Y.Node` instance, index, or String name of a button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," removing a button by numerical index, or by name but scoped to a"," particular section."," @chainable"," @since 3.5.0"," **/"," removeButton: function (button, section) {"," if (!isValue(button)) { return this; }",""," var buttons = this.get('buttons'),"," index;",""," // Shortcut if `button` is already an index which is needed for slicing."," if (isNumber(button)) {"," section || (section = this.DEFAULT_BUTTONS_SECTION);"," index = button;"," button = buttons[section][index];"," } else {"," // Supports `button` being the string name."," if (isString(button)) {"," // `getButton()` is called this way because its behavior is"," // different based on the number of arguments."," button = this.getButton.apply(this, arguments);"," }",""," // Determines the `section` and `index` at which the button exists."," YObject.some(buttons, function (sectionButtons, currentSection) {"," index = YArray.indexOf(sectionButtons, button);",""," if (index > -1) {"," section = currentSection;"," return true;"," }"," });"," }",""," // Button was found at an appropriate index."," if (button && index > -1) {"," // Remove button from `section` array."," buttons[section].splice(index, 1);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : index,"," src : 'remove'"," });"," }",""," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Binds UI event listeners. This method is inserted via AOP, and will execute"," after `bindUI()`.",""," @method _bindUIButtons"," @protected"," @since 3.4.0"," **/"," _bindUIButtons: function () {"," // Event handlers are bound with `bind()` to make them more extensible.",""," var afterContentChange = Y.bind('_afterContentChangeButtons', this);",""," this.after({"," defaultButtonChange: Y.bind('_afterDefaultButtonChange', this),"," visibleChange : Y.bind('_afterVisibleChangeButtons', this),"," headerContentChange: afterContentChange,"," bodyContentChange : afterContentChange,"," footerContentChange: afterContentChange"," });"," },",""," /**"," Returns a button node based on the specified `button` node or configuration.",""," The button node will either be created via `Y.Plugin.Button.createNode()`,"," or when `button` is specified as a node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _createButton"," @param {Node|Object} button Button node or configuration object."," @return {Node} The button node."," @protected"," @since 3.5.0"," **/"," _createButton: function (button) {"," var config, buttonConfig, nonButtonNodeCfg,"," i, len, action, context, handle;",""," // Makes sure the exiting `Y.Node` instance is from this YUI sandbox and"," // is plugged with `Y.Plugin.Button`."," if (isNode(button)) {"," return Y.one(button.getDOMNode()).plug(ButtonPlugin);"," }",""," // Merge `button` config with defaults and back-compat."," config = Y.merge({"," context: this,"," events : 'click',"," label : button.value"," }, button);",""," buttonConfig = Y.merge(config);"," nonButtonNodeCfg = WidgetButtons.NON_BUTTON_NODE_CFG;",""," // Remove all non-button Node config props."," for (i = 0, len = nonButtonNodeCfg.length; i < len; i += 1) {"," delete buttonConfig[nonButtonNodeCfg[i]];"," }",""," // Create the button node using the button Node-only config."," button = ButtonPlugin.createNode(buttonConfig);",""," context = config.context;"," action = config.action;",""," // Supports `action` as a String name of a Function on the `context`"," // object."," if (isString(action)) {"," action = Y.bind(action, context);"," }",""," // Supports all types of crazy configs for event subscriptions and"," // stores a reference to the returned `EventHandle`."," handle = button.on(config.events, action, context);"," this._buttonsHandles[Y.stamp(button, true)] = handle;",""," // Tags the button with the configured `name` and `isDefault` settings."," button.setData('name', this._getButtonName(config));"," button.setData('default', this._getButtonDefault(config));",""," // Add any CSS classnames to the button node."," YArray.each(YArray(config.classNames), button.addClass, button);",""," return button;"," },",""," /**"," Returns the buttons container for the specified `section`, passing a truthy"," value for `create` will create the node if it does not already exist.",""," **Note:** It is up to the caller to properly insert the returned container"," node into the content section.",""," @method _getButtonContainer"," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Boolean} create Whether the buttons container should be created if"," it does not already exist."," @return {Node} The buttons container node for the specified `section`."," @protected"," @see BUTTONS_TEMPLATE"," @since 3.5.0"," **/"," _getButtonContainer: function (section, create) {"," var sectionClassName = WidgetStdMod.SECTION_CLASS_NAMES[section],"," buttonsClassName = WidgetButtons.CLASS_NAMES.buttons,"," contentBox = this.get('contentBox'),"," containerSelector, container;",""," // Search for an existing buttons container within the section."," containerSelector = '.' + sectionClassName + ' .' + buttonsClassName;"," container = contentBox.one(containerSelector);",""," // Create the `container` if it doesn't already exist."," if (!container && create) {"," container = Y.Node.create(this.BUTTONS_TEMPLATE);"," container.addClass(buttonsClassName);"," }",""," return container;"," },",""," /**"," Returns whether or not the specified `button` is configured to be the"," default button.",""," When a button node is specified, the button's `getData()` method will be"," used to determine if the button is configured to be the default. When a"," button config object is specified, the `isDefault` prop will determine"," whether the button is the default.",""," **Note:** `<button data-default=\"true\"></button>` is supported via the"," `button.getData('default')` API call.",""," @method _getButtonDefault"," @param {Node|Object} button The button node or configuration object."," @return {Boolean} Whether the button is configured to be the default button."," @protected"," @since 3.5.0"," **/"," _getButtonDefault: function (button) {"," var isDefault = isNode(button) ?"," button.getData('default') : button.isDefault;",""," if (isString(isDefault)) {"," return isDefault.toLowerCase() === 'true';"," }",""," return !!isDefault;"," },",""," /**"," Returns the name of the specified `button`.",""," When a button node is specified, the button's `getData('name')` method is"," preferred, but will fallback to `get('name')`, and the result will determine"," the button's name. When a button config object is specified, the `name` prop"," will determine the button's name.",""," **Note:** `<button data-name=\"foo\"></button>` is supported via the"," `button.getData('name')` API call.",""," @method _getButtonName"," @param {Node|Object} button The button node or configuration object."," @return {String} The name of the button."," @protected"," @since 3.5.0"," **/"," _getButtonName: function (button) {"," var name;",""," if (isNode(button)) {"," name = button.getData('name') || button.get('name');"," } else {"," name = button && (button.name || button.type);"," }",""," return name;"," },",""," /**"," Getter for the `buttons` attribute. A copy of the `buttons` object is"," returned so the stored state cannot be modified by the callers of"," `get('buttons')`.",""," This will recreate a copy of the `buttons` object, and each section array"," (the button nodes are *not* copied/cloned.)",""," @method _getButtons"," @param {Object} buttons The widget's current `buttons` state."," @return {Object} A copy of the widget's current `buttons` state."," @protected"," @since 3.5.0"," **/"," _getButtons: function (buttons) {"," var buttonsCopy = {};",""," // Creates a new copy of the `buttons` object."," YObject.each(buttons, function (sectionButtons, section) {"," // Creates of copy of the array of button nodes."," buttonsCopy[section] = sectionButtons.concat();"," });",""," return buttonsCopy;"," },",""," /**"," Adds the specified `button` to the buttons map (both name -> button and"," section:name -> button), and sets the button as the default if it is"," configured as the default button.",""," **Note:** If two or more buttons are configured with the same `name` and/or"," configured to be the default button, the last one wins.",""," @method _mapButton"," @param {Node} button The button node to map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _mapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," isDefault = this._getButtonDefault(button);",""," if (name) {"," // name -> button"," map[name] = button;",""," // section:name -> button"," map[section + ':' + name] = button;"," }",""," isDefault && (this._defaultButton = button);"," },",""," /**"," Adds the specified `buttons` to the buttons map (both name -> button and"," section:name -> button), and set the a button as the default if one is"," configured as the default button.",""," **Note:** This will clear all previous button mappings and null-out any"," previous default button! If two or more buttons are configured with the same"," `name` and/or configured to be the default button, the last one wins.",""," @method _mapButtons"," @param {Node[]} buttons The button nodes to map."," @protected"," @since 3.5.0"," **/"," _mapButtons: function (buttons) {"," this._buttonsMap = {};"," this._defaultButton = null;",""," YObject.each(buttons, function (sectionButtons, section) {"," var i, len;",""," for (i = 0, len = sectionButtons.length; i < len; i += 1) {"," this._mapButton(sectionButtons[i], section);"," }"," }, this);"," },",""," /**"," Returns a copy of the specified `config` object merged with any defaults"," provided by a `srcNode` and/or a predefined configuration for a button"," with the same `name` on the `BUTTONS` property.",""," @method _mergeButtonConfig"," @param {Object|String} config Button configuration object, or string name."," @return {Object} A copy of the button configuration object merged with any"," defaults."," @protected"," @since 3.5.0"," **/"," _mergeButtonConfig: function (config) {"," var buttonConfig, defConfig, name, button, tagName, label;",""," // Makes sure `config` is an Object and a copy of the specified value."," config = isString(config) ? {name: config} : Y.merge(config);",""," // Seeds default values from the button node, if there is one."," if (config.srcNode) {"," button = config.srcNode;"," tagName = button.get('tagName').toLowerCase();"," label = button.get(tagName === 'input' ? 'value' : 'text');",""," // Makes sure the button's current values override any defaults."," buttonConfig = {"," disabled : !!button.get('disabled'),"," isDefault: this._getButtonDefault(button),"," name : this._getButtonName(button)"," };",""," // Label should only be considered when not an empty string."," label && (buttonConfig.label = label);",""," // Merge `config` with `buttonConfig` values."," Y.mix(config, buttonConfig, false, null, 0, true);"," }",""," name = this._getButtonName(config);"," defConfig = this.BUTTONS && this.BUTTONS[name];",""," // Merge `config` with predefined default values."," if (defConfig) {"," Y.mix(config, defConfig, false, null, 0, true);"," }",""," return config;"," },",""," /**"," `HTML_PARSER` implementation for the `buttons` attribute.",""," **Note:** To determine a button node's name its `data-name` and `name`"," attributes are examined. Whether the button should be the default is"," determined by its `data-default` attribute.",""," @method _parseButtons"," @param {Node} srcNode This widget's srcNode to search for buttons."," @return {null|Object} `buttons` Config object parsed from this widget's DOM."," @protected"," @since 3.5.0"," **/"," _parseButtons: function (srcNode) {"," var buttonSelector = '.' + WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'],"," buttonsConfig = null;",""," YArray.each(sections, function (section) {"," var container = this._getButtonContainer(section),"," buttons = container && container.all(buttonSelector),"," sectionButtons;",""," if (!buttons || buttons.isEmpty()) { return; }",""," sectionButtons = [];",""," // Creates a button config object for every button node found and"," // adds it to the section. This way each button configuration can be"," // merged with any defaults provided by predefined `BUTTONS`."," buttons.each(function (button) {"," sectionButtons.push({srcNode: button});"," });",""," buttonsConfig || (buttonsConfig = {});"," buttonsConfig[section] = sectionButtons;"," }, this);",""," return buttonsConfig;"," },",""," /**"," Setter for the `buttons` attribute. This processes the specified `config`"," and returns a new `buttons` object which is stored as the new state; leaving"," the original, specified `config` unmodified.",""," The button nodes will either be created via `Y.Plugin.Button.createNode()`,"," or when a button is already a Node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _setButtons"," @param {Array|Object} config The `buttons` configuration to process."," @return {Object} The processed `buttons` object which represents the new"," state."," @protected"," @since 3.5.0"," **/"," _setButtons: function (config) {"," var defSection = this.DEFAULT_BUTTONS_SECTION,"," buttons = {};",""," function processButtons(buttonConfigs, currentSection) {"," if (!isArray(buttonConfigs)) { return; }",""," var i, len, button, section;",""," for (i = 0, len = buttonConfigs.length; i < len; i += 1) {"," button = buttonConfigs[i];"," section = currentSection;",""," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," // Always passes through `_createButton()` to make sure the node"," // is decorated as a button."," button = this._createButton(button);",""," // Use provided `section` or fallback to the default section."," section || (section = defSection);",""," // Add button to the array of buttons for the specified section."," (buttons[section] || (buttons[section] = [])).push(button);"," }"," }",""," // Handle `config` being either an Array or Object of Arrays."," if (isArray(config)) {"," processButtons.call(this, config);"," } else {"," YObject.each(config, processButtons, this);"," }",""," return buttons;"," },",""," /**"," Syncs this widget's current button-related state to its DOM. This method is"," inserted via AOP, and will execute after `syncUI()`.",""," @method _syncUIButtons"," @protected"," @since 3.4.0"," **/"," _syncUIButtons: function () {"," this._uiSetButtons(this.get('buttons'));"," this._uiSetDefaultButton(this.get('defaultButton'));"," this._uiSetVisibleButtons(this.get('visible'));"," },",""," /**"," Inserts the specified `button` node into this widget's DOM at the specified"," `section` and `index` and updates the section content.",""," The section and button container nodes will be created if they do not"," already exist.",""," @method _uiInsertButton"," @param {Node} button The button node to insert into this widget's DOM."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Number} index Index at which the `button` should be positioned."," @protected"," @since 3.5.0"," **/"," _uiInsertButton: function (button, section, index) {"," var buttonsClassName = WidgetButtons.CLASS_NAMES.button,"," buttonContainer = this._getButtonContainer(section, true),"," sectionButtons = buttonContainer.all('.' + buttonsClassName);",""," // Inserts the button node at the correct index."," buttonContainer.insertBefore(button, sectionButtons.item(index));",""," // Adds the button container to the section content."," this.setStdModContent(section, buttonContainer, 'after');"," },",""," /**"," Removes the button node from this widget's DOM and detaches any event"," subscriptions on the button that were created by this widget. The section"," content will be updated unless `{preserveContent: true}` is passed in the"," `options`.",""," By default the button container node will be removed when this removes the"," last button of the specified `section`; and if no other content remains in"," the section node, it will also be removed.",""," @method _uiRemoveButton"," @param {Node} button The button to remove and destroy."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Object} [options] Additional options."," @param {Boolean} [options.preserveContent=false] Whether the section"," content should be updated."," @protected"," @since 3.5.0"," **/"," _uiRemoveButton: function (button, section, options) {"," var yuid = Y.stamp(button, this),"," handles = this._buttonsHandles,"," handle = handles[yuid],"," buttonContainer, buttonClassName;",""," handle && handle.detach();"," delete handles[yuid];",""," button.remove();",""," options || (options = {});",""," // Remove the button container and section nodes if needed."," if (!options.preserveContent) {"," buttonContainer = this._getButtonContainer(section);"," buttonClassName = WidgetButtons.CLASS_NAMES.button;",""," // Only matters if we have a button container which is empty."," if (buttonContainer &&"," buttonContainer.all('.' + buttonClassName).isEmpty()) {",""," buttonContainer.remove();"," this._updateContentButtons(section);"," }"," }"," },",""," /**"," Sets the current `buttons` state to this widget's DOM by rendering the"," specified collection of `buttons` and updates the contents of each section"," as needed.",""," Button nodes which already exist in the DOM will remain intact, or will be"," moved if they should be in a new position. Old button nodes which are no"," longer represented in the specified `buttons` collection will be removed,"," and any event subscriptions on the button which were created by this widget"," will be detached.",""," If the button nodes in this widget's DOM actually change, then each content"," section will be updated (or removed) appropriately.",""," @method _uiSetButtons"," @param {Object} buttons The current `buttons` state to visually represent."," @protected"," @since 3.5.0"," **/"," _uiSetButtons: function (buttons) {"," var buttonClassName = WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'];",""," YArray.each(sections, function (section) {"," var sectionButtons = buttons[section] || [],"," numButtons = sectionButtons.length,"," buttonContainer = this._getButtonContainer(section, numButtons),"," buttonsUpdated = false,"," oldNodes, i, button, buttonIndex;",""," // When there's no button container, there are no new buttons or old"," // buttons that we have to deal with for this section."," if (!buttonContainer) { return; }",""," oldNodes = buttonContainer.all('.' + buttonClassName);",""," for (i = 0; i < numButtons; i += 1) {"," button = sectionButtons[i];"," buttonIndex = oldNodes ? oldNodes.indexOf(button) : -1;",""," // Buttons already rendered in the Widget should remain there or"," // moved to their new index. New buttons will be added to the"," // current `buttonContainer`."," if (buttonIndex > -1) {"," // Remove button from existing buttons nodeList since its in"," // the DOM already."," oldNodes.splice(buttonIndex, 1);",""," // Check that the button is at the right position, if not,"," // move it to its new position."," if (buttonIndex !== i) {"," // Using `i + 1` because the button should be at index"," // `i`; it's inserted before the node which comes after."," buttonContainer.insertBefore(button, i + 1);"," buttonsUpdated = true;"," }"," } else {"," buttonContainer.appendChild(button);"," buttonsUpdated = true;"," }"," }",""," // Safely removes the old button nodes which are no longer part of"," // this widget's `buttons`."," oldNodes.each(function (button) {"," this._uiRemoveButton(button, section, {preserveContent: true});"," buttonsUpdated = true;"," }, this);",""," // Remove leftover empty button containers and updated the StdMod"," // content area."," if (numButtons === 0) {"," buttonContainer.remove();"," this._updateContentButtons(section);"," return;"," }",""," // Adds the button container to the section content."," if (buttonsUpdated) {"," this.setStdModContent(section, buttonContainer, 'after');"," }"," }, this);"," },",""," /**"," Adds the \"yui3-button-primary\" CSS class to the new `defaultButton` and"," removes it from the old default button.",""," @method _uiSetDefaultButton"," @param {Node} newButton The new `defaultButton`."," @param {Node} oldButton The old `defaultButton`."," @protected"," @since 3.5.0"," **/"," _uiSetDefaultButton: function (newButton, oldButton) {"," var primaryClassName = WidgetButtons.CLASS_NAMES.primary;",""," newButton && newButton.addClass(primaryClassName);"," oldButton && oldButton.removeClass(primaryClassName);"," },",""," /**"," Focuses this widget's `defaultButton` if there is one and this widget is"," visible.",""," @method _uiSetVisibleButtons"," @param {Boolean} visible Whether this widget is visible."," @protected"," @since 3.5.0"," **/"," _uiSetVisibleButtons: function (visible) {"," if (!visible) { return; }",""," var defaultButton = this.get('defaultButton');"," if (defaultButton) {"," defaultButton.focus();"," }"," },",""," /**"," Removes the specified `button` from the buttons map (both name -> button and"," section:name -> button), and nulls-out the `defaultButton` if it is"," currently the default button.",""," @method _unMapButton"," @param {Node} button The button node to remove from the buttons map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _unMapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," sectionName;",""," // Only delete the map entry if the specified `button` is mapped to it."," if (name) {"," // name -> button"," if (map[name] === button) {"," delete map[name];"," }",""," // section:name -> button"," sectionName = section + ':' + name;"," if (map[sectionName] === button) {"," delete map[sectionName];"," }"," }",""," // Clear the default button if its the specified `button`."," if (this._defaultButton === button) {"," this._defaultButton = null;"," }"," },",""," /**"," Updates the `defaultButton` attribute if it needs to be updated by comparing"," its current value with the protected `_defaultButton` property.",""," @method _updateDefaultButton"," @protected"," @since 3.5.0"," **/"," _updateDefaultButton: function () {"," var defaultButton = this._defaultButton;",""," if (this.get('defaultButton') !== defaultButton) {"," this._set('defaultButton', defaultButton);"," }"," },",""," /**"," Updates the content attribute which corresponds to the specified `section`.",""," The method updates the section's content to its current `childNodes`"," (text and/or HTMLElement), or will null-out its contents if the section is"," empty. It also specifies a `src` of `buttons` on the change event facade.",""," @method _updateContentButtons"," @param {String} section The `WidgetStdMod` section (header/body/footer) to"," update."," @protected"," @since 3.5.0"," **/"," _updateContentButtons: function (section) {"," // `childNodes` return text nodes and HTMLElements."," var sectionContent = this.getStdModNode(section).get('childNodes');",""," // Updates the section to its current contents, or null if it is empty."," this.set(section + 'Content', sectionContent.isEmpty() ? null :"," sectionContent, {src: 'buttons'});"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles this widget's `buttonsChange` event which fires anytime the"," `buttons` attribute is modified.",""," **Note:** This method special-cases the `buttons` modifications caused by"," `addButton()` and `removeButton()`, both of which set the `src` property on"," the event facade to \"add\" and \"remove\" respectively.",""," @method _afterButtonsChange"," @param {EventFacade} e"," @protected"," @since 3.4.0"," **/"," _afterButtonsChange: function (e) {"," var buttons = e.newVal,"," section = e.section,"," index = e.index,"," src = e.src,"," button;",""," // Special cases `addButton()` to only set and insert the new button."," if (src === 'add') {"," // Make sure we have the button node."," button = buttons[section][index];",""," this._mapButton(button, section);"," this._updateDefaultButton();"," this._uiInsertButton(button, section, index);",""," return;"," }",""," // Special cases `removeButton()` to only remove the specified button."," if (src === 'remove') {"," // Button node already exists on the event facade."," button = e.button;",""," this._unMapButton(button, section);"," this._updateDefaultButton();"," this._uiRemoveButton(button, section);",""," return;"," }",""," this._mapButtons(buttons);"," this._updateDefaultButton();"," this._uiSetButtons(buttons);"," },",""," /**"," Handles this widget's `headerContentChange`, `bodyContentChange`,"," `footerContentChange` events by making sure the `buttons` remain rendered"," after changes to the content areas.",""," These events are very chatty, so extra caution is taken to avoid doing extra"," work or getting into an infinite loop.",""," @method _afterContentChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterContentChangeButtons: function (e) {"," var src = e.src,"," pos = e.stdModPosition,"," replace = !pos || pos === WidgetStdMod.REPLACE;",""," // Only do work when absolutely necessary."," if (replace && src !== 'buttons' && src !== Widget.UI_SRC) {"," this._uiSetButtons(this.get('buttons'));"," }"," },",""," /**"," Handles this widget's `defaultButtonChange` event by adding the"," \"yui3-button-primary\" CSS class to the new `defaultButton` and removing it"," from the old default button.",""," @method _afterDefaultButtonChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDefaultButtonChange: function (e) {"," this._uiSetDefaultButton(e.newVal, e.prevVal);"," },",""," /**"," Handles this widget's `visibleChange` event by focusing the `defaultButton`"," if there is one.",""," @method _afterVisibleChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterVisibleChangeButtons: function (e) {"," this._uiSetVisibleButtons(e.newVal);"," }","};","","Y.WidgetButtons = WidgetButtons;","","","}, '3.7.2', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget-stdmod\"]});"];-_yuitest_coverage["build/widget-buttons/widget-buttons.js"].lines = {"1":0,"11":0,"27":0,"28":0,"46":0,"48":0,"49":0,"53":0,"56":0,"160":0,"166":0,"168":0,"181":0,"185":0,"260":0,"261":0,"264":0,"266":0,"267":0,"272":0,"273":0,"276":0,"277":0,"278":0,"358":0,"362":0,"363":0,"364":0,"367":0,"368":0,"369":0,"372":0,"375":0,"377":0,"384":0,"400":0,"402":0,"405":0,"408":0,"409":0,"410":0,"414":0,"448":0,"450":0,"454":0,"455":0,"456":0,"457":0,"460":0,"463":0,"467":0,"468":0,"470":0,"471":0,"472":0,"478":0,"480":0,"482":0,"490":0,"506":0,"508":0,"531":0,"536":0,"537":0,"541":0,"547":0,"548":0,"551":0,"552":0,"556":0,"558":0,"559":0,"563":0,"564":0,"569":0,"570":0,"573":0,"574":0,"577":0,"579":0,"599":0,"605":0,"606":0,"609":0,"610":0,"611":0,"614":0,"636":0,"639":0,"640":0,"643":0,"664":0,"666":0,"667":0,"669":0,"672":0,"690":0,"693":0,"695":0,"698":0,"716":0,"720":0,"722":0,"725":0,"728":0,"746":0,"747":0,"749":0,"750":0,"752":0,"753":0,"771":0,"774":0,"777":0,"778":0,"779":0,"780":0,"783":0,"790":0,"793":0,"796":0,"797":0,"800":0,"801":0,"804":0,"821":0,"825":0,"826":0,"830":0,"832":0,"837":0,"838":0,"841":0,"842":0,"845":0,"865":0,"868":0,"869":0,"871":0,"873":0,"874":0,"875":0,"877":0,"878":0,"879":0,"884":0,"887":0,"890":0,"895":0,"896":0,"898":0,"901":0,"913":0,"914":0,"915":0,"933":0,"938":0,"941":0,"964":0,"969":0,"970":0,"972":0,"974":0,"977":0,"978":0,"979":0,"982":0,"985":0,"986":0,"1011":0,"1014":0,"1015":0,"1023":0,"1025":0,"1027":0,"1028":0,"1029":0,"1034":0,"1037":0,"1041":0,"1044":0,"1045":0,"1048":0,"1049":0,"1055":0,"1056":0,"1057":0,"1062":0,"1063":0,"1064":0,"1065":0,"1069":0,"1070":0,"1086":0,"1088":0,"1089":0,"1102":0,"1104":0,"1105":0,"1106":0,"1122":0,"1127":0,"1129":0,"1130":0,"1134":0,"1135":0,"1136":0,"1141":0,"1142":0,"1155":0,"1157":0,"1158":0,"1177":0,"1180":0,"1200":0,"1207":0,"1209":0,"1211":0,"1212":0,"1213":0,"1215":0,"1219":0,"1221":0,"1223":0,"1224":0,"1225":0,"1227":0,"1230":0,"1231":0,"1232":0,"1249":0,"1254":0,"1255":0,"1270":0,"1283":0,"1287":0};-_yuitest_coverage["build/widget-buttons/widget-buttons.js"].functions = {"isNode:27":0,"WidgetButtons:46":0,"buttons:167":0,"initializer:258":0,"(anonymous 2):272":0,"destructor:270":0,"addButton:357":0,"getButton:399":0,"(anonymous 3):467":0,"removeButton:447":0,"_bindUIButtons:503":0,"_createButton:530":0,"_getButtonContainer:598":0,"_getButtonDefault:635":0,"_getButtonName:663":0,"(anonymous 4):693":0,"_getButtons:689":0,"_mapButton:715":0,"(anonymous 5):749":0,"_mapButtons:745":0,"_mergeButtonConfig:770":0,"(anonymous 7):837":0,"(anonymous 6):825":0,"_parseButtons:820":0,"processButtons:868":0,"_setButtons:864":0,"_syncUIButtons:912":0,"_uiInsertButton:932":0,"_uiRemoveButton:963":0,"(anonymous 9):1055":0,"(anonymous 8):1014":0,"_uiSetButtons:1010":0,"_uiSetDefaultButton:1085":0,"_uiSetVisibleButtons:1101":0,"_unMapButton:1121":0,"_updateDefaultButton:1154":0,"_updateContentButtons:1175":0,"_afterButtonsChange:1199":0,"_afterContentChangeButtons:1248":0,"_afterDefaultButtonChange:1269":0,"_afterVisibleChangeButtons:1282":0,"(anonymous 1):1":0};-_yuitest_coverage["build/widget-buttons/widget-buttons.js"].coveredLines = 236;+_yuitest_coverage["build/widget-buttons/widget-buttons.js"].code=["YUI.add('widget-buttons', function (Y, NAME) {","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","@module widget-buttons","@since 3.4.0","**/","","var YArray = Y.Array,"," YLang = Y.Lang,"," YObject = Y.Object,",""," ButtonPlugin = Y.Plugin.Button,"," Widget = Y.Widget,"," WidgetStdMod = Y.WidgetStdMod,",""," getClassName = Y.ClassNameManager.getClassName,"," isArray = YLang.isArray,"," isNumber = YLang.isNumber,"," isString = YLang.isString,"," isValue = YLang.isValue;","","// Utility to determine if an object is a Y.Node instance, even if it was","// created in a different YUI sandbox.","function isNode(node) {"," return !!node.getDOMNode;","}","","/**","Provides header/body/footer button support for Widgets that use the","`WidgetStdMod` extension.","","This Widget extension makes it easy to declaratively configure a widget's","buttons. It adds a `buttons` attribute along with button- accessor and mutator","methods. All button nodes have the `Y.Plugin.Button` plugin applied.","","This extension also includes `HTML_PARSER` support to seed a widget's `buttons`","from those which already exist in its DOM.","","@class WidgetButtons","@extensionfor Widget","@since 3.4.0","**/","function WidgetButtons() {"," // Require `Y.WidgetStdMod`."," if (!this._stdModNode) {"," Y.error('WidgetStdMod must be added to a Widget before WidgetButtons.');"," }",""," // Has to be setup before the `initializer()`."," this._buttonsHandles = {};","}","","WidgetButtons.ATTRS = {"," /**"," Collection containing a widget's buttons.",""," The collection is an Object which contains an Array of `Y.Node`s for every"," `WidgetStdMod` section (header, body, footer) which has one or more buttons."," All button nodes have the `Y.Plugin.Button` plugin applied.",""," This attribute is very flexible in the values it will accept. `buttons` can"," be specified as a single Array, or an Object of Arrays keyed to a particular"," section.",""," All specified values will be normalized to this type of structure:",""," {"," header: [...],"," footer: [...]"," }",""," A button can be specified as a `Y.Node`, config Object, or String name for a"," predefined button on the `BUTTONS` prototype property. When a config Object"," is provided, it will be merged with any defaults provided by a button with"," the same `name` defined on the `BUTTONS` property.",""," See `addButton()` for the detailed list of configuration properties.",""," For convenience, a widget's buttons will always persist and remain rendered"," after header/body/footer content updates. Buttons should be removed by"," updating this attribute or using the `removeButton()` method.",""," @example"," {"," // Uses predefined \"close\" button by string name."," header: ['close'],",""," footer: ["," {"," name : 'cancel',"," label : 'Cancel',"," action: 'hide'"," },",""," {"," name : 'okay',"," label : 'Okay',"," isDefault: true,",""," events: {"," click: function (e) {"," this.hide();"," }"," }"," }"," ]"," }",""," @attribute buttons"," @type Object"," @default {}"," @since 3.4.0"," **/"," buttons: {"," getter: '_getButtons',"," setter: '_setButtons',"," value : {}"," },",""," /**"," The current default button as configured through this widget's `buttons`.",""," A button can be configured as the default button in the following ways:",""," * As a config Object with an `isDefault` property:"," `{label: 'Okay', isDefault: true}`.",""," * As a Node with a `data-default` attribute:"," `<button data-default=\"true\">Okay</button>`.",""," This attribute is **read-only**; anytime there are changes to this widget's"," `buttons`, the `defaultButton` will be updated if needed.",""," **Note:** If two or more buttons are configured to be the default button,"," the last one wins.",""," @attribute defaultButton"," @type Node"," @default null"," @readOnly"," @since 3.5.0"," **/"," defaultButton: {"," readOnly: true,"," value : null"," }","};","","/**","CSS classes used by `WidgetButtons`.","","@property CLASS_NAMES","@type Object","@static","@since 3.5.0","**/","WidgetButtons.CLASS_NAMES = {"," button : getClassName('button'),"," buttons: Widget.getClassName('buttons'),"," primary: getClassName('button', 'primary')","};","","WidgetButtons.HTML_PARSER = {"," buttons: function (srcNode) {"," return this._parseButtons(srcNode);"," }","};","","/**","The list of button configuration properties which are specific to","`WidgetButtons` and should not be passed to `Y.Plugin.Button.createNode()`.","","@property NON_BUTTON_NODE_CFG","@type Array","@static","@since 3.5.0","**/","WidgetButtons.NON_BUTTON_NODE_CFG = ["," 'action', 'classNames', 'context', 'events', 'isDefault', 'section'","];","","WidgetButtons.prototype = {"," // -- Public Properties ----------------------------------------------------",""," /**"," Collection of predefined buttons mapped by name -> config.",""," These button configurations will serve as defaults for any button added to a"," widget's buttons which have the same `name`.",""," See `addButton()` for a list of possible configuration values.",""," @property BUTTONS"," @type Object"," @default {}"," @see addButton()"," @since 3.5.0"," **/"," BUTTONS: {},",""," /**"," The HTML template to use when creating the node which wraps all buttons of a"," section. By default it will have the CSS class: \"yui3-widget-buttons\".",""," @property BUTTONS_TEMPLATE"," @type String"," @default \"<span />\""," @since 3.5.0"," **/"," BUTTONS_TEMPLATE: '<span />',",""," /**"," The default section to render buttons in when no section is specified.",""," @property DEFAULT_BUTTONS_SECTION"," @type String"," @default Y.WidgetStdMod.FOOTER"," @since 3.5.0"," **/"," DEFAULT_BUTTONS_SECTION: WidgetStdMod.FOOTER,",""," // -- Protected Properties -------------------------------------------------",""," /**"," A map of button node `_yuid` -> event-handle for all button nodes which were"," created by this widget.",""," @property _buttonsHandles"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," A map of this widget's `buttons`, both name -> button and"," section:name -> button.",""," @property _buttonsMap"," @type Object"," @protected"," @since 3.5.0"," **/",""," /**"," Internal reference to this widget's default button.",""," @property _defaultButton"," @type Node"," @protected"," @since 3.5.0"," **/",""," // -- Lifecycle Methods ----------------------------------------------------",""," initializer: function () {"," // Creates button mappings and sets the `defaultButton`."," this._mapButtons(this.get('buttons'));"," this._updateDefaultButton();",""," // Bound with `Y.bind()` to make more extensible."," this.after({"," buttonsChange : Y.bind('_afterButtonsChange', this),"," defaultButtonChange: Y.bind('_afterDefaultButtonChange', this)"," });",""," Y.after(this._bindUIButtons, this, 'bindUI');"," Y.after(this._syncUIButtons, this, 'syncUI');"," },",""," destructor: function () {"," // Detach all event subscriptions this widget added to its `buttons`."," YObject.each(this._buttonsHandles, function (handle) {"," handle.detach();"," });",""," delete this._buttonsHandles;"," delete this._buttonsMap;"," delete this._defaultButton;"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Adds a button to this widget.",""," The new button node will have the `Y.Plugin.Button` plugin applied, be added"," to this widget's `buttons`, and rendered in the specified `section` at the"," specified `index` (or end of the section when no `index` is provided). If"," the section does not exist, it will be created.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node or config object to add.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button will be added.",""," * `index`: The index at which the button will be in the section.",""," * `src`: \"add\"",""," **Note:** The `index` argument will be passed to the Array `splice()`"," method, therefore a negative value will insert the `button` that many items"," from the end. The `index` property on the `buttonsChange` event facade is"," the index at which the `button` was added.",""," @method addButton"," @param {Node|Object|String} button The button to add. This can be a `Y.Node`"," instance, config Object, or String name for a predefined button on the"," `BUTTONS` prototype property. When a config Object is provided, it will"," be merged with any defaults provided by any `srcNode` and/or a button"," with the same `name` defined on the `BUTTONS` property. The following"," are the possible configuration properties beyond what Node plugins"," accept by default:"," @param {Function|String} [button.action] The default handler that should"," be called when the button is clicked. A String name of a Function that"," exists on the `context` object can also be provided. **Note:**"," Specifying a set of `events` will override this setting."," @param {String|String[]} [button.classNames] Additional CSS classes to add"," to the button node."," @param {Object} [button.context=this] Context which any `events` or"," `action` should be called with. Defaults to `this`, the widget."," **Note:** `e.target` will access the button node in the event handlers."," @param {Boolean} [button.disabled=false] Whether the button should be"," disabled."," @param {String|Object} [button.events=\"click\"] Event name, or set of"," events and handlers to bind to the button node. **See:** `Y.Node.on()`,"," this value is passed as the first argument to `on()`."," @param {Boolean} [button.isDefault=false] Whether the button is the"," default button."," @param {String} [button.label] The visible text/value displayed in the"," button."," @param {String} [button.name] A name which can later be used to reference"," this button. If a button is defined on the `BUTTONS` property with this"," same name, its configuration properties will be merged in as defaults."," @param {String} [button.section] The `WidgetStdMod` section (header, body,"," footer) where the button should be added."," @param {Node} [button.srcNode] An existing Node to use for the button,"," default values will be seeded from this node, but are overriden by any"," values specified in the config object. By default a new <button>"," node will be created."," @param {String} [button.template] A specific template to use when creating"," a new button node (e.g. \"<a />\"). **Note:** Specifying a `srcNode`"," will overide this."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button should be added. This takes"," precedence over the `button.section` configuration property."," @param {Number} [index] The index at which the button should be inserted. If"," not specified, the button will be added to the end of the section. This"," value is passed to the Array `splice()` method, therefore a negative"," value will insert the `button` that many items from the end."," @chainable"," @see Plugin.Button.createNode()"," @since 3.4.0"," **/"," addButton: function (button, section, index) {"," var buttons = this.get('buttons'),"," sectionButtons, atIndex;",""," // Makes sure we have the full config object."," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," section || (section = this.DEFAULT_BUTTONS_SECTION);"," sectionButtons = buttons[section] || (buttons[section] = []);"," isNumber(index) || (index = sectionButtons.length);",""," // Insert new button at the correct position."," sectionButtons.splice(index, 0, button);",""," // Determine the index at which the `button` now exists in the array."," atIndex = YArray.indexOf(sectionButtons, button);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : atIndex,"," src : 'add'"," });",""," return this;"," },",""," /**"," Returns a button node from this widget's `buttons`.",""," @method getButton"," @param {Number|String} name The string name or index of the button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," looking for a button by numerical index, or by name but scoped to a"," particular section."," @return {Node} The button node."," @since 3.5.0"," **/"," getButton: function (name, section) {"," if (!isValue(name)) { return; }",""," var map = this._buttonsMap,"," buttons;",""," section || (section = this.DEFAULT_BUTTONS_SECTION);",""," // Supports `getButton(1, 'header')` signature."," if (isNumber(name)) {"," buttons = this.get('buttons');"," return buttons[section] && buttons[section][name];"," }",""," // Looks up button by name or section:name."," return arguments.length > 1 ? map[section + ':' + name] : map[name];"," },",""," /**"," Removes a button from this widget.",""," The button will be removed from this widget's `buttons` and its DOM. Any"," event subscriptions on the button which were created by this widget will be"," detached. If the content section becomes empty after removing the button"," node, then the section will also be removed.",""," This fires the `buttonsChange` event and adds the following properties to"," the event facade:",""," * `button`: The button node to remove.",""," * `section`: The `WidgetStdMod` section (header/body/footer) where the"," button should be removed from.",""," * `index`: The index at which the button exists in the section.",""," * `src`: \"remove\"",""," @method removeButton"," @param {Node|Number|String} button The button to remove. This can be a"," `Y.Node` instance, index, or String name of a button."," @param {String} [section=\"footer\"] The `WidgetStdMod` section"," (header/body/footer) where the button exists. Only applicable when"," removing a button by numerical index, or by name but scoped to a"," particular section."," @chainable"," @since 3.5.0"," **/"," removeButton: function (button, section) {"," if (!isValue(button)) { return this; }",""," var buttons = this.get('buttons'),"," index;",""," // Shortcut if `button` is already an index which is needed for slicing."," if (isNumber(button)) {"," section || (section = this.DEFAULT_BUTTONS_SECTION);"," index = button;"," button = buttons[section][index];"," } else {"," // Supports `button` being the string name."," if (isString(button)) {"," // `getButton()` is called this way because its behavior is"," // different based on the number of arguments."," button = this.getButton.apply(this, arguments);"," }",""," // Determines the `section` and `index` at which the button exists."," YObject.some(buttons, function (sectionButtons, currentSection) {"," index = YArray.indexOf(sectionButtons, button);",""," if (index > -1) {"," section = currentSection;"," return true;"," }"," });"," }",""," // Button was found at an appropriate index."," if (button && index > -1) {"," // Remove button from `section` array."," buttons[section].splice(index, 1);",""," this.set('buttons', buttons, {"," button : button,"," section: section,"," index : index,"," src : 'remove'"," });"," }",""," return this;"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Binds UI event listeners. This method is inserted via AOP, and will execute"," after `bindUI()`.",""," @method _bindUIButtons"," @protected"," @since 3.4.0"," **/"," _bindUIButtons: function () {"," // Event handlers are bound with `bind()` to make them more extensible."," var afterContentChange = Y.bind('_afterContentChangeButtons', this);",""," this.after({"," visibleChange : Y.bind('_afterVisibleChangeButtons', this),"," headerContentChange: afterContentChange,"," bodyContentChange : afterContentChange,"," footerContentChange: afterContentChange"," });"," },",""," /**"," Returns a button node based on the specified `button` node or configuration.",""," The button node will either be created via `Y.Plugin.Button.createNode()`,"," or when `button` is specified as a node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _createButton"," @param {Node|Object} button Button node or configuration object."," @return {Node} The button node."," @protected"," @since 3.5.0"," **/"," _createButton: function (button) {"," var config, buttonConfig, nonButtonNodeCfg,"," i, len, action, context, handle;",""," // Makes sure the exiting `Y.Node` instance is from this YUI sandbox and"," // is plugged with `Y.Plugin.Button`."," if (isNode(button)) {"," return Y.one(button.getDOMNode()).plug(ButtonPlugin);"," }",""," // Merge `button` config with defaults and back-compat."," config = Y.merge({"," context: this,"," events : 'click',"," label : button.value"," }, button);",""," buttonConfig = Y.merge(config);"," nonButtonNodeCfg = WidgetButtons.NON_BUTTON_NODE_CFG;",""," // Remove all non-button Node config props."," for (i = 0, len = nonButtonNodeCfg.length; i < len; i += 1) {"," delete buttonConfig[nonButtonNodeCfg[i]];"," }",""," // Create the button node using the button Node-only config."," button = ButtonPlugin.createNode(buttonConfig);",""," context = config.context;"," action = config.action;",""," // Supports `action` as a String name of a Function on the `context`"," // object."," if (isString(action)) {"," action = Y.bind(action, context);"," }",""," // Supports all types of crazy configs for event subscriptions and"," // stores a reference to the returned `EventHandle`."," handle = button.on(config.events, action, context);"," this._buttonsHandles[Y.stamp(button, true)] = handle;",""," // Tags the button with the configured `name` and `isDefault` settings."," button.setData('name', this._getButtonName(config));"," button.setData('default', this._getButtonDefault(config));",""," // Add any CSS classnames to the button node."," YArray.each(YArray(config.classNames), button.addClass, button);",""," return button;"," },",""," /**"," Returns the buttons container for the specified `section`, passing a truthy"," value for `create` will create the node if it does not already exist.",""," **Note:** It is up to the caller to properly insert the returned container"," node into the content section.",""," @method _getButtonContainer"," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Boolean} create Whether the buttons container should be created if"," it does not already exist."," @return {Node} The buttons container node for the specified `section`."," @protected"," @see BUTTONS_TEMPLATE"," @since 3.5.0"," **/"," _getButtonContainer: function (section, create) {"," var sectionClassName = WidgetStdMod.SECTION_CLASS_NAMES[section],"," buttonsClassName = WidgetButtons.CLASS_NAMES.buttons,"," contentBox = this.get('contentBox'),"," containerSelector, container;",""," // Search for an existing buttons container within the section."," containerSelector = '.' + sectionClassName + ' .' + buttonsClassName;"," container = contentBox.one(containerSelector);",""," // Create the `container` if it doesn't already exist."," if (!container && create) {"," container = Y.Node.create(this.BUTTONS_TEMPLATE);"," container.addClass(buttonsClassName);"," }",""," return container;"," },",""," /**"," Returns whether or not the specified `button` is configured to be the"," default button.",""," When a button node is specified, the button's `getData()` method will be"," used to determine if the button is configured to be the default. When a"," button config object is specified, the `isDefault` prop will determine"," whether the button is the default.",""," **Note:** `<button data-default=\"true\"></button>` is supported via the"," `button.getData('default')` API call.",""," @method _getButtonDefault"," @param {Node|Object} button The button node or configuration object."," @return {Boolean} Whether the button is configured to be the default button."," @protected"," @since 3.5.0"," **/"," _getButtonDefault: function (button) {"," var isDefault = isNode(button) ?"," button.getData('default') : button.isDefault;",""," if (isString(isDefault)) {"," return isDefault.toLowerCase() === 'true';"," }",""," return !!isDefault;"," },",""," /**"," Returns the name of the specified `button`.",""," When a button node is specified, the button's `getData('name')` method is"," preferred, but will fallback to `get('name')`, and the result will determine"," the button's name. When a button config object is specified, the `name` prop"," will determine the button's name.",""," **Note:** `<button data-name=\"foo\"></button>` is supported via the"," `button.getData('name')` API call.",""," @method _getButtonName"," @param {Node|Object} button The button node or configuration object."," @return {String} The name of the button."," @protected"," @since 3.5.0"," **/"," _getButtonName: function (button) {"," var name;",""," if (isNode(button)) {"," name = button.getData('name') || button.get('name');"," } else {"," name = button && (button.name || button.type);"," }",""," return name;"," },",""," /**"," Getter for the `buttons` attribute. A copy of the `buttons` object is"," returned so the stored state cannot be modified by the callers of"," `get('buttons')`.",""," This will recreate a copy of the `buttons` object, and each section array"," (the button nodes are *not* copied/cloned.)",""," @method _getButtons"," @param {Object} buttons The widget's current `buttons` state."," @return {Object} A copy of the widget's current `buttons` state."," @protected"," @since 3.5.0"," **/"," _getButtons: function (buttons) {"," var buttonsCopy = {};",""," // Creates a new copy of the `buttons` object."," YObject.each(buttons, function (sectionButtons, section) {"," // Creates of copy of the array of button nodes."," buttonsCopy[section] = sectionButtons.concat();"," });",""," return buttonsCopy;"," },",""," /**"," Adds the specified `button` to the buttons map (both name -> button and"," section:name -> button), and sets the button as the default if it is"," configured as the default button.",""," **Note:** If two or more buttons are configured with the same `name` and/or"," configured to be the default button, the last one wins.",""," @method _mapButton"," @param {Node} button The button node to map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _mapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," isDefault = this._getButtonDefault(button);",""," if (name) {"," // name -> button"," map[name] = button;",""," // section:name -> button"," map[section + ':' + name] = button;"," }",""," isDefault && (this._defaultButton = button);"," },",""," /**"," Adds the specified `buttons` to the buttons map (both name -> button and"," section:name -> button), and set the a button as the default if one is"," configured as the default button.",""," **Note:** This will clear all previous button mappings and null-out any"," previous default button! If two or more buttons are configured with the same"," `name` and/or configured to be the default button, the last one wins.",""," @method _mapButtons"," @param {Node[]} buttons The button nodes to map."," @protected"," @since 3.5.0"," **/"," _mapButtons: function (buttons) {"," this._buttonsMap = {};"," this._defaultButton = null;",""," YObject.each(buttons, function (sectionButtons, section) {"," var i, len;",""," for (i = 0, len = sectionButtons.length; i < len; i += 1) {"," this._mapButton(sectionButtons[i], section);"," }"," }, this);"," },",""," /**"," Returns a copy of the specified `config` object merged with any defaults"," provided by a `srcNode` and/or a predefined configuration for a button"," with the same `name` on the `BUTTONS` property.",""," @method _mergeButtonConfig"," @param {Object|String} config Button configuration object, or string name."," @return {Object} A copy of the button configuration object merged with any"," defaults."," @protected"," @since 3.5.0"," **/"," _mergeButtonConfig: function (config) {"," var buttonConfig, defConfig, name, button, tagName, label;",""," // Makes sure `config` is an Object and a copy of the specified value."," config = isString(config) ? {name: config} : Y.merge(config);",""," // Seeds default values from the button node, if there is one."," if (config.srcNode) {"," button = config.srcNode;"," tagName = button.get('tagName').toLowerCase();"," label = button.get(tagName === 'input' ? 'value' : 'text');",""," // Makes sure the button's current values override any defaults."," buttonConfig = {"," disabled : !!button.get('disabled'),"," isDefault: this._getButtonDefault(button),"," name : this._getButtonName(button)"," };",""," // Label should only be considered when not an empty string."," label && (buttonConfig.label = label);",""," // Merge `config` with `buttonConfig` values."," Y.mix(config, buttonConfig, false, null, 0, true);"," }",""," name = this._getButtonName(config);"," defConfig = this.BUTTONS && this.BUTTONS[name];",""," // Merge `config` with predefined default values."," if (defConfig) {"," Y.mix(config, defConfig, false, null, 0, true);"," }",""," return config;"," },",""," /**"," `HTML_PARSER` implementation for the `buttons` attribute.",""," **Note:** To determine a button node's name its `data-name` and `name`"," attributes are examined. Whether the button should be the default is"," determined by its `data-default` attribute.",""," @method _parseButtons"," @param {Node} srcNode This widget's srcNode to search for buttons."," @return {null|Object} `buttons` Config object parsed from this widget's DOM."," @protected"," @since 3.5.0"," **/"," _parseButtons: function (srcNode) {"," var buttonSelector = '.' + WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'],"," buttonsConfig = null;",""," YArray.each(sections, function (section) {"," var container = this._getButtonContainer(section),"," buttons = container && container.all(buttonSelector),"," sectionButtons;",""," if (!buttons || buttons.isEmpty()) { return; }",""," sectionButtons = [];",""," // Creates a button config object for every button node found and"," // adds it to the section. This way each button configuration can be"," // merged with any defaults provided by predefined `BUTTONS`."," buttons.each(function (button) {"," sectionButtons.push({srcNode: button});"," });",""," buttonsConfig || (buttonsConfig = {});"," buttonsConfig[section] = sectionButtons;"," }, this);",""," return buttonsConfig;"," },",""," /**"," Setter for the `buttons` attribute. This processes the specified `config`"," and returns a new `buttons` object which is stored as the new state; leaving"," the original, specified `config` unmodified.",""," The button nodes will either be created via `Y.Plugin.Button.createNode()`,"," or when a button is already a Node already, it will by `plug()`ed with"," `Y.Plugin.Button`.",""," @method _setButtons"," @param {Array|Object} config The `buttons` configuration to process."," @return {Object} The processed `buttons` object which represents the new"," state."," @protected"," @since 3.5.0"," **/"," _setButtons: function (config) {"," var defSection = this.DEFAULT_BUTTONS_SECTION,"," buttons = {};",""," function processButtons(buttonConfigs, currentSection) {"," if (!isArray(buttonConfigs)) { return; }",""," var i, len, button, section;",""," for (i = 0, len = buttonConfigs.length; i < len; i += 1) {"," button = buttonConfigs[i];"," section = currentSection;",""," if (!isNode(button)) {"," button = this._mergeButtonConfig(button);"," section || (section = button.section);"," }",""," // Always passes through `_createButton()` to make sure the node"," // is decorated as a button."," button = this._createButton(button);",""," // Use provided `section` or fallback to the default section."," section || (section = defSection);",""," // Add button to the array of buttons for the specified section."," (buttons[section] || (buttons[section] = [])).push(button);"," }"," }",""," // Handle `config` being either an Array or Object of Arrays."," if (isArray(config)) {"," processButtons.call(this, config);"," } else {"," YObject.each(config, processButtons, this);"," }",""," return buttons;"," },",""," /**"," Syncs this widget's current button-related state to its DOM. This method is"," inserted via AOP, and will execute after `syncUI()`.",""," @method _syncUIButtons"," @protected"," @since 3.4.0"," **/"," _syncUIButtons: function () {"," this._uiSetButtons(this.get('buttons'));"," this._uiSetDefaultButton(this.get('defaultButton'));"," this._uiSetVisibleButtons(this.get('visible'));"," },",""," /**"," Inserts the specified `button` node into this widget's DOM at the specified"," `section` and `index` and updates the section content.",""," The section and button container nodes will be created if they do not"," already exist.",""," @method _uiInsertButton"," @param {Node} button The button node to insert into this widget's DOM."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Number} index Index at which the `button` should be positioned."," @protected"," @since 3.5.0"," **/"," _uiInsertButton: function (button, section, index) {"," var buttonsClassName = WidgetButtons.CLASS_NAMES.button,"," buttonContainer = this._getButtonContainer(section, true),"," sectionButtons = buttonContainer.all('.' + buttonsClassName);",""," // Inserts the button node at the correct index."," buttonContainer.insertBefore(button, sectionButtons.item(index));",""," // Adds the button container to the section content."," this.setStdModContent(section, buttonContainer, 'after');"," },",""," /**"," Removes the button node from this widget's DOM and detaches any event"," subscriptions on the button that were created by this widget. The section"," content will be updated unless `{preserveContent: true}` is passed in the"," `options`.",""," By default the button container node will be removed when this removes the"," last button of the specified `section`; and if no other content remains in"," the section node, it will also be removed.",""," @method _uiRemoveButton"," @param {Node} button The button to remove and destroy."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @param {Object} [options] Additional options."," @param {Boolean} [options.preserveContent=false] Whether the section"," content should be updated."," @protected"," @since 3.5.0"," **/"," _uiRemoveButton: function (button, section, options) {"," var yuid = Y.stamp(button, this),"," handles = this._buttonsHandles,"," handle = handles[yuid],"," buttonContainer, buttonClassName;",""," if (handle) {"," handle.detach();"," }",""," delete handles[yuid];",""," button.remove();",""," options || (options = {});",""," // Remove the button container and section nodes if needed."," if (!options.preserveContent) {"," buttonContainer = this._getButtonContainer(section);"," buttonClassName = WidgetButtons.CLASS_NAMES.button;",""," // Only matters if we have a button container which is empty."," if (buttonContainer &&"," buttonContainer.all('.' + buttonClassName).isEmpty()) {",""," buttonContainer.remove();"," this._updateContentButtons(section);"," }"," }"," },",""," /**"," Sets the current `buttons` state to this widget's DOM by rendering the"," specified collection of `buttons` and updates the contents of each section"," as needed.",""," Button nodes which already exist in the DOM will remain intact, or will be"," moved if they should be in a new position. Old button nodes which are no"," longer represented in the specified `buttons` collection will be removed,"," and any event subscriptions on the button which were created by this widget"," will be detached.",""," If the button nodes in this widget's DOM actually change, then each content"," section will be updated (or removed) appropriately.",""," @method _uiSetButtons"," @param {Object} buttons The current `buttons` state to visually represent."," @protected"," @since 3.5.0"," **/"," _uiSetButtons: function (buttons) {"," var buttonClassName = WidgetButtons.CLASS_NAMES.button,"," sections = ['header', 'body', 'footer'];",""," YArray.each(sections, function (section) {"," var sectionButtons = buttons[section] || [],"," numButtons = sectionButtons.length,"," buttonContainer = this._getButtonContainer(section, numButtons),"," buttonsUpdated = false,"," oldNodes, i, button, buttonIndex;",""," // When there's no button container, there are no new buttons or old"," // buttons that we have to deal with for this section."," if (!buttonContainer) { return; }",""," oldNodes = buttonContainer.all('.' + buttonClassName);",""," for (i = 0; i < numButtons; i += 1) {"," button = sectionButtons[i];"," buttonIndex = oldNodes.indexOf(button);",""," // Buttons already rendered in the Widget should remain there or"," // moved to their new index. New buttons will be added to the"," // current `buttonContainer`."," if (buttonIndex > -1) {"," // Remove button from existing buttons nodeList since its in"," // the DOM already."," oldNodes.splice(buttonIndex, 1);",""," // Check that the button is at the right position, if not,"," // move it to its new position."," if (buttonIndex !== i) {"," // Using `i + 1` because the button should be at index"," // `i`; it's inserted before the node which comes after."," buttonContainer.insertBefore(button, i + 1);"," buttonsUpdated = true;"," }"," } else {"," buttonContainer.appendChild(button);"," buttonsUpdated = true;"," }"," }",""," // Safely removes the old button nodes which are no longer part of"," // this widget's `buttons`."," oldNodes.each(function (button) {"," this._uiRemoveButton(button, section, {preserveContent: true});"," buttonsUpdated = true;"," }, this);",""," // Remove leftover empty button containers and updated the StdMod"," // content area."," if (numButtons === 0) {"," buttonContainer.remove();"," this._updateContentButtons(section);"," return;"," }",""," // Adds the button container to the section content."," if (buttonsUpdated) {"," this.setStdModContent(section, buttonContainer, 'after');"," }"," }, this);"," },",""," /**"," Adds the \"yui3-button-primary\" CSS class to the new `defaultButton` and"," removes it from the old default button.",""," @method _uiSetDefaultButton"," @param {Node} newButton The new `defaultButton`."," @param {Node} oldButton The old `defaultButton`."," @protected"," @since 3.5.0"," **/"," _uiSetDefaultButton: function (newButton, oldButton) {"," var primaryClassName = WidgetButtons.CLASS_NAMES.primary;",""," if (newButton) { newButton.addClass(primaryClassName); }"," if (oldButton) { oldButton.removeClass(primaryClassName); }"," },",""," /**"," Focuses this widget's `defaultButton` if there is one and this widget is"," visible.",""," @method _uiSetVisibleButtons"," @param {Boolean} visible Whether this widget is visible."," @protected"," @since 3.5.0"," **/"," _uiSetVisibleButtons: function (visible) {"," if (!visible) { return; }",""," var defaultButton = this.get('defaultButton');"," if (defaultButton) {"," defaultButton.focus();"," }"," },",""," /**"," Removes the specified `button` from the buttons map (both name -> button and"," section:name -> button), and nulls-out the `defaultButton` if it is"," currently the default button.",""," @method _unMapButton"," @param {Node} button The button node to remove from the buttons map."," @param {String} section The `WidgetStdMod` section (header/body/footer)."," @protected"," @since 3.5.0"," **/"," _unMapButton: function (button, section) {"," var map = this._buttonsMap,"," name = this._getButtonName(button),"," sectionName;",""," // Only delete the map entry if the specified `button` is mapped to it."," if (name) {"," // name -> button"," if (map[name] === button) {"," delete map[name];"," }",""," // section:name -> button"," sectionName = section + ':' + name;"," if (map[sectionName] === button) {"," delete map[sectionName];"," }"," }",""," // Clear the default button if its the specified `button`."," if (this._defaultButton === button) {"," this._defaultButton = null;"," }"," },",""," /**"," Updates the `defaultButton` attribute if it needs to be updated by comparing"," its current value with the protected `_defaultButton` property.",""," @method _updateDefaultButton"," @protected"," @since 3.5.0"," **/"," _updateDefaultButton: function () {"," var defaultButton = this._defaultButton;",""," if (this.get('defaultButton') !== defaultButton) {"," this._set('defaultButton', defaultButton);"," }"," },",""," /**"," Updates the content attribute which corresponds to the specified `section`.",""," The method updates the section's content to its current `childNodes`"," (text and/or HTMLElement), or will null-out its contents if the section is"," empty. It also specifies a `src` of `buttons` on the change event facade.",""," @method _updateContentButtons"," @param {String} section The `WidgetStdMod` section (header/body/footer) to"," update."," @protected"," @since 3.5.0"," **/"," _updateContentButtons: function (section) {"," // `childNodes` return text nodes and HTMLElements."," var sectionContent = this.getStdModNode(section).get('childNodes');",""," // Updates the section to its current contents, or null if it is empty."," this.set(section + 'Content', sectionContent.isEmpty() ? null :"," sectionContent, {src: 'buttons'});"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles this widget's `buttonsChange` event which fires anytime the"," `buttons` attribute is modified.",""," **Note:** This method special-cases the `buttons` modifications caused by"," `addButton()` and `removeButton()`, both of which set the `src` property on"," the event facade to \"add\" and \"remove\" respectively.",""," @method _afterButtonsChange"," @param {EventFacade} e"," @protected"," @since 3.4.0"," **/"," _afterButtonsChange: function (e) {"," var buttons = e.newVal,"," section = e.section,"," index = e.index,"," src = e.src,"," button;",""," // Special cases `addButton()` to only set and insert the new button."," if (src === 'add') {"," // Make sure we have the button node."," button = buttons[section][index];",""," this._mapButton(button, section);"," this._updateDefaultButton();"," this._uiInsertButton(button, section, index);",""," return;"," }",""," // Special cases `removeButton()` to only remove the specified button."," if (src === 'remove') {"," // Button node already exists on the event facade."," button = e.button;",""," this._unMapButton(button, section);"," this._updateDefaultButton();"," this._uiRemoveButton(button, section);",""," return;"," }",""," this._mapButtons(buttons);"," this._updateDefaultButton();"," this._uiSetButtons(buttons);"," },",""," /**"," Handles this widget's `headerContentChange`, `bodyContentChange`,"," `footerContentChange` events by making sure the `buttons` remain rendered"," after changes to the content areas.",""," These events are very chatty, so extra caution is taken to avoid doing extra"," work or getting into an infinite loop.",""," @method _afterContentChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterContentChangeButtons: function (e) {"," var src = e.src,"," pos = e.stdModPosition,"," replace = !pos || pos === WidgetStdMod.REPLACE;",""," // Only do work when absolutely necessary."," if (replace && src !== 'buttons' && src !== Widget.UI_SRC) {"," this._uiSetButtons(this.get('buttons'));"," }"," },",""," /**"," Handles this widget's `defaultButtonChange` event by adding the"," \"yui3-button-primary\" CSS class to the new `defaultButton` and removing it"," from the old default button.",""," @method _afterDefaultButtonChange"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterDefaultButtonChange: function (e) {"," this._uiSetDefaultButton(e.newVal, e.prevVal);"," },",""," /**"," Handles this widget's `visibleChange` event by focusing the `defaultButton`"," if there is one.",""," @method _afterVisibleChangeButtons"," @param {EventFacade} e"," @protected"," @since 3.5.0"," **/"," _afterVisibleChangeButtons: function (e) {"," this._uiSetVisibleButtons(e.newVal);"," }","};","","Y.WidgetButtons = WidgetButtons;","","","}, '3.7.3', {\"requires\": [\"button-plugin\", \"cssbutton\", \"widget-stdmod\"]});"];+_yuitest_coverage["build/widget-buttons/widget-buttons.js"].lines = {"1":0,"11":0,"27":0,"28":0,"46":0,"48":0,"49":0,"53":0,"56":0,"160":0,"166":0,"168":0,"181":0,"185":0,"260":0,"261":0,"264":0,"269":0,"270":0,"275":0,"276":0,"279":0,"280":0,"281":0,"361":0,"365":0,"366":0,"367":0,"370":0,"371":0,"372":0,"375":0,"378":0,"380":0,"387":0,"403":0,"405":0,"408":0,"411":0,"412":0,"413":0,"417":0,"451":0,"453":0,"457":0,"458":0,"459":0,"460":0,"463":0,"466":0,"470":0,"471":0,"473":0,"474":0,"475":0,"481":0,"483":0,"485":0,"493":0,"508":0,"510":0,"532":0,"537":0,"538":0,"542":0,"548":0,"549":0,"552":0,"553":0,"557":0,"559":0,"560":0,"564":0,"565":0,"570":0,"571":0,"574":0,"575":0,"578":0,"580":0,"600":0,"606":0,"607":0,"610":0,"611":0,"612":0,"615":0,"637":0,"640":0,"641":0,"644":0,"665":0,"667":0,"668":0,"670":0,"673":0,"691":0,"694":0,"696":0,"699":0,"717":0,"721":0,"723":0,"726":0,"729":0,"747":0,"748":0,"750":0,"751":0,"753":0,"754":0,"772":0,"775":0,"778":0,"779":0,"780":0,"781":0,"784":0,"791":0,"794":0,"797":0,"798":0,"801":0,"802":0,"805":0,"822":0,"826":0,"827":0,"831":0,"833":0,"838":0,"839":0,"842":0,"843":0,"846":0,"866":0,"869":0,"870":0,"872":0,"874":0,"875":0,"876":0,"878":0,"879":0,"880":0,"885":0,"888":0,"891":0,"896":0,"897":0,"899":0,"902":0,"914":0,"915":0,"916":0,"934":0,"939":0,"942":0,"965":0,"970":0,"971":0,"974":0,"976":0,"978":0,"981":0,"982":0,"983":0,"986":0,"989":0,"990":0,"1015":0,"1018":0,"1019":0,"1027":0,"1029":0,"1031":0,"1032":0,"1033":0,"1038":0,"1041":0,"1045":0,"1048":0,"1049":0,"1052":0,"1053":0,"1059":0,"1060":0,"1061":0,"1066":0,"1067":0,"1068":0,"1069":0,"1073":0,"1074":0,"1090":0,"1092":0,"1093":0,"1106":0,"1108":0,"1109":0,"1110":0,"1126":0,"1131":0,"1133":0,"1134":0,"1138":0,"1139":0,"1140":0,"1145":0,"1146":0,"1159":0,"1161":0,"1162":0,"1181":0,"1184":0,"1204":0,"1211":0,"1213":0,"1215":0,"1216":0,"1217":0,"1219":0,"1223":0,"1225":0,"1227":0,"1228":0,"1229":0,"1231":0,"1234":0,"1235":0,"1236":0,"1253":0,"1258":0,"1259":0,"1274":0,"1287":0,"1291":0};+_yuitest_coverage["build/widget-buttons/widget-buttons.js"].functions = {"isNode:27":0,"WidgetButtons:46":0,"buttons:167":0,"initializer:258":0,"(anonymous 2):275":0,"destructor:273":0,"addButton:360":0,"getButton:402":0,"(anonymous 3):470":0,"removeButton:450":0,"_bindUIButtons:506":0,"_createButton:531":0,"_getButtonContainer:599":0,"_getButtonDefault:636":0,"_getButtonName:664":0,"(anonymous 4):694":0,"_getButtons:690":0,"_mapButton:716":0,"(anonymous 5):750":0,"_mapButtons:746":0,"_mergeButtonConfig:771":0,"(anonymous 7):838":0,"(anonymous 6):826":0,"_parseButtons:821":0,"processButtons:869":0,"_setButtons:865":0,"_syncUIButtons:913":0,"_uiInsertButton:933":0,"_uiRemoveButton:964":0,"(anonymous 9):1059":0,"(anonymous 8):1018":0,"_uiSetButtons:1014":0,"_uiSetDefaultButton:1089":0,"_uiSetVisibleButtons:1105":0,"_unMapButton:1125":0,"_updateDefaultButton:1158":0,"_updateContentButtons:1179":0,"_afterButtonsChange:1203":0,"_afterContentChangeButtons:1252":0,"_afterDefaultButtonChange:1273":0,"_afterVisibleChangeButtons:1286":0,"(anonymous 1):1":0};+_yuitest_coverage["build/widget-buttons/widget-buttons.js"].coveredLines = 237; _yuitest_coverage["build/widget-buttons/widget-buttons.js"].coveredFunctions = 42; _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1); YUI.add('widget-buttons', function (Y, NAME) {@@ -322,29 +322,32 @@ // Bound with `Y.bind()` to make more extensible. _yuitest_coverline("build/widget-buttons/widget-buttons.js", 264);-this.after('buttonsChange', Y.bind('_afterButtonsChange', this));+this.after({+ buttonsChange : Y.bind('_afterButtonsChange', this),+ defaultButtonChange: Y.bind('_afterDefaultButtonChange', this)+ }); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 266);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 269); Y.after(this._bindUIButtons, this, 'bindUI');- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 267);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 270); Y.after(this._syncUIButtons, this, 'syncUI'); }, destructor: function () { // Detach all event subscriptions this widget added to its `buttons`.- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "destructor", 270);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 272);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "destructor", 273);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 275); YObject.each(this._buttonsHandles, function (handle) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 2)", 272);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 273);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 2)", 275);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 276); handle.detach(); }); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 276);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 279); delete this._buttonsHandles;- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 277);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 280); delete this._buttonsMap;- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 278);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 281); delete this._defaultButton; }, @@ -425,36 +428,36 @@ @since 3.4.0 **/ addButton: function (button, section, index) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "addButton", 357);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 358);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "addButton", 360);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 361); var buttons = this.get('buttons'), sectionButtons, atIndex; // Makes sure we have the full config object.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 362);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 365); if (!isNode(button)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 363);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 366); button = this._mergeButtonConfig(button);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 364);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 367); section || (section = button.section); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 367);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 370); section || (section = this.DEFAULT_BUTTONS_SECTION);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 368);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 371); sectionButtons = buttons[section] || (buttons[section] = []);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 369);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 372); isNumber(index) || (index = sectionButtons.length); // Insert new button at the correct position.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 372);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 375); sectionButtons.splice(index, 0, button); // Determine the index at which the `button` now exists in the array.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 375);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 378); atIndex = YArray.indexOf(sectionButtons, button); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 377);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 380); this.set('buttons', buttons, { button : button, section: section,@@ -462,7 +465,7 @@ src : 'add' }); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 384);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 387); return this; }, @@ -479,28 +482,28 @@ @since 3.5.0 **/ getButton: function (name, section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "getButton", 399);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 400);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "getButton", 402);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 403); if (!isValue(name)) { return; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 402);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 405); var map = this._buttonsMap, buttons; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 405);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 408); section || (section = this.DEFAULT_BUTTONS_SECTION); // Supports `getButton(1, 'header')` signature.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 408);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 411); if (isNumber(name)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 409);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 412); buttons = this.get('buttons');- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 410);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 413); return buttons[section] && buttons[section][name]; } // Looks up button by name or section:name.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 414);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 417); return arguments.length > 1 ? map[section + ':' + name] : map[name]; }, @@ -535,58 +538,58 @@ @since 3.5.0 **/ removeButton: function (button, section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "removeButton", 447);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 448);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "removeButton", 450);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 451); if (!isValue(button)) { return this; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 450);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 453); var buttons = this.get('buttons'), index; // Shortcut if `button` is already an index which is needed for slicing.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 454);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 457); if (isNumber(button)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 455);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 458); section || (section = this.DEFAULT_BUTTONS_SECTION);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 456);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 459); index = button;- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 457);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 460); button = buttons[section][index]; } else { // Supports `button` being the string name.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 460);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 463); if (isString(button)) { // `getButton()` is called this way because its behavior is // different based on the number of arguments.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 463);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 466); button = this.getButton.apply(this, arguments); } // Determines the `section` and `index` at which the button exists.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 467);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 470); YObject.some(buttons, function (sectionButtons, currentSection) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 3)", 467);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 468);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 3)", 470);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 471); index = YArray.indexOf(sectionButtons, button); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 470);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 473); if (index > -1) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 471);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 474); section = currentSection;- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 472);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 475); return true; } }); } // Button was found at an appropriate index.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 478);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 481); if (button && index > -1) { // Remove button from `section` array.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 480);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 483); buttons[section].splice(index, 1); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 482);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 485); this.set('buttons', buttons, { button : button, section: section,@@ -595,7 +598,7 @@ }); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 490);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 493); return this; }, @@ -611,14 +614,12 @@ **/ _bindUIButtons: function () { // Event handlers are bound with `bind()` to make them more extensible.-- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_bindUIButtons", 503);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 506);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_bindUIButtons", 506);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 508); var afterContentChange = Y.bind('_afterContentChangeButtons', this); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 508);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 510); this.after({- defaultButtonChange: Y.bind('_afterDefaultButtonChange', this), visibleChange : Y.bind('_afterVisibleChangeButtons', this), headerContentChange: afterContentChange, bodyContentChange : afterContentChange,@@ -640,74 +641,74 @@ @since 3.5.0 **/ _createButton: function (button) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_createButton", 530);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 531);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_createButton", 531);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 532); var config, buttonConfig, nonButtonNodeCfg, i, len, action, context, handle; // Makes sure the exiting `Y.Node` instance is from this YUI sandbox and // is plugged with `Y.Plugin.Button`.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 536);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 537); if (isNode(button)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 537);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 538); return Y.one(button.getDOMNode()).plug(ButtonPlugin); } // Merge `button` config with defaults and back-compat.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 541);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 542); config = Y.merge({ context: this, events : 'click', label : button.value }, button); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 547);-buttonConfig = Y.merge(config); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 548);+buttonConfig = Y.merge(config);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 549); nonButtonNodeCfg = WidgetButtons.NON_BUTTON_NODE_CFG; // Remove all non-button Node config props.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 551);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 552); for (i = 0, len = nonButtonNodeCfg.length; i < len; i += 1) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 552);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 553); delete buttonConfig[nonButtonNodeCfg[i]]; } // Create the button node using the button Node-only config.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 556);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 557); button = ButtonPlugin.createNode(buttonConfig); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 558);-context = config.context; _yuitest_coverline("build/widget-buttons/widget-buttons.js", 559);+context = config.context;+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 560); action = config.action; // Supports `action` as a String name of a Function on the `context` // object.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 563);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 564); if (isString(action)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 564);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 565); action = Y.bind(action, context); } // Supports all types of crazy configs for event subscriptions and // stores a reference to the returned `EventHandle`.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 569);-handle = button.on(config.events, action, context); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 570);+handle = button.on(config.events, action, context);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 571); this._buttonsHandles[Y.stamp(button, true)] = handle; // Tags the button with the configured `name` and `isDefault` settings.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 573);-button.setData('name', this._getButtonName(config)); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 574);+button.setData('name', this._getButtonName(config));+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 575); button.setData('default', this._getButtonDefault(config)); // Add any CSS classnames to the button node.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 577);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 578); YArray.each(YArray(config.classNames), button.addClass, button); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 579);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 580); return button; }, @@ -728,29 +729,29 @@ @since 3.5.0 **/ _getButtonContainer: function (section, create) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtonContainer", 598);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 599);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtonContainer", 599);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 600); var sectionClassName = WidgetStdMod.SECTION_CLASS_NAMES[section], buttonsClassName = WidgetButtons.CLASS_NAMES.buttons, contentBox = this.get('contentBox'), containerSelector, container; // Search for an existing buttons container within the section.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 605);-containerSelector = '.' + sectionClassName + ' .' + buttonsClassName; _yuitest_coverline("build/widget-buttons/widget-buttons.js", 606);+containerSelector = '.' + sectionClassName + ' .' + buttonsClassName;+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 607); container = contentBox.one(containerSelector); // Create the `container` if it doesn't already exist.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 609);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 610); if (!container && create) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 610);-container = Y.Node.create(this.BUTTONS_TEMPLATE); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 611);+container = Y.Node.create(this.BUTTONS_TEMPLATE);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 612); container.addClass(buttonsClassName); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 614);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 615); return container; }, @@ -773,18 +774,18 @@ @since 3.5.0 **/ _getButtonDefault: function (button) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtonDefault", 635);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 636);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtonDefault", 636);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 637); var isDefault = isNode(button) ? button.getData('default') : button.isDefault; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 639);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 640); if (isString(isDefault)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 640);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 641); return isDefault.toLowerCase() === 'true'; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 643);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 644); return !!isDefault; }, @@ -806,20 +807,20 @@ @since 3.5.0 **/ _getButtonName: function (button) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtonName", 663);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 664);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtonName", 664);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 665); var name; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 666);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 667); if (isNode(button)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 667);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 668); name = button.getData('name') || button.get('name'); } else {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 669);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 670); name = button && (button.name || button.type); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 672);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 673); return name; }, @@ -838,20 +839,20 @@ @since 3.5.0 **/ _getButtons: function (buttons) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtons", 689);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 690);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_getButtons", 690);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 691); var buttonsCopy = {}; // Creates a new copy of the `buttons` object.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 693);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 694); YObject.each(buttons, function (sectionButtons, section) { // Creates of copy of the array of button nodes.- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 4)", 693);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 695);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 4)", 694);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 696); buttonsCopy[section] = sectionButtons.concat(); }); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 698);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 699); return buttonsCopy; }, @@ -870,24 +871,24 @@ @since 3.5.0 **/ _mapButton: function (button, section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_mapButton", 715);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 716);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_mapButton", 716);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 717); var map = this._buttonsMap, name = this._getButtonName(button), isDefault = this._getButtonDefault(button); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 720);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 721); if (name) { // name -> button- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 722);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 723); map[name] = button; // section:name -> button- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 725);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 726); map[section + ':' + name] = button; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 728);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 729); isDefault && (this._defaultButton = button); }, @@ -906,21 +907,21 @@ @since 3.5.0 **/ _mapButtons: function (buttons) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_mapButtons", 745);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 746);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_mapButtons", 746);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 747); this._buttonsMap = {};- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 747);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 748); this._defaultButton = null; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 749);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 750); YObject.each(buttons, function (sectionButtons, section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 5)", 749);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 750);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 5)", 750);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 751); var i, len; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 752);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 753); for (i = 0, len = sectionButtons.length; i < len; i += 1) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 753);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 754); this._mapButton(sectionButtons[i], section); } }, this);@@ -939,26 +940,26 @@ @since 3.5.0 **/ _mergeButtonConfig: function (config) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_mergeButtonConfig", 770);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 771);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_mergeButtonConfig", 771);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 772); var buttonConfig, defConfig, name, button, tagName, label; // Makes sure `config` is an Object and a copy of the specified value.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 774);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 775); config = isString(config) ? {name: config} : Y.merge(config); // Seeds default values from the button node, if there is one.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 777);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 778); if (config.srcNode) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 778);-button = config.srcNode; _yuitest_coverline("build/widget-buttons/widget-buttons.js", 779);-tagName = button.get('tagName').toLowerCase();+button = config.srcNode; _yuitest_coverline("build/widget-buttons/widget-buttons.js", 780);+tagName = button.get('tagName').toLowerCase();+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 781); label = button.get(tagName === 'input' ? 'value' : 'text'); // Makes sure the button's current values override any defaults.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 783);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 784); buttonConfig = { disabled : !!button.get('disabled'), isDefault: this._getButtonDefault(button),@@ -966,27 +967,27 @@ }; // Label should only be considered when not an empty string.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 790);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 791); label && (buttonConfig.label = label); // Merge `config` with `buttonConfig` values.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 793);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 794); Y.mix(config, buttonConfig, false, null, 0, true); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 796);-name = this._getButtonName(config); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 797);+name = this._getButtonName(config);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 798); defConfig = this.BUTTONS && this.BUTTONS[name]; // Merge `config` with predefined default values.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 800);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 801); if (defConfig) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 801);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 802); Y.mix(config, defConfig, false, null, 0, true); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 804);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 805); return config; }, @@ -1004,43 +1005,43 @@ @since 3.5.0 **/ _parseButtons: function (srcNode) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_parseButtons", 820);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 821);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_parseButtons", 821);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 822); var buttonSelector = '.' + WidgetButtons.CLASS_NAMES.button, sections = ['header', 'body', 'footer'], buttonsConfig = null; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 825);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 826); YArray.each(sections, function (section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 6)", 825);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 826);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 6)", 826);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 827); var container = this._getButtonContainer(section), buttons = container && container.all(buttonSelector), sectionButtons; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 830);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 831); if (!buttons || buttons.isEmpty()) { return; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 832);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 833); sectionButtons = []; // Creates a button config object for every button node found and // adds it to the section. This way each button configuration can be // merged with any defaults provided by predefined `BUTTONS`.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 837);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 838); buttons.each(function (button) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 7)", 837);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 838);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 7)", 838);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 839); sectionButtons.push({srcNode: button}); }); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 841);-buttonsConfig || (buttonsConfig = {}); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 842);+buttonsConfig || (buttonsConfig = {});+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 843); buttonsConfig[section] = sectionButtons; }, this); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 845);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 846); return buttonsConfig; }, @@ -1061,61 +1062,61 @@ @since 3.5.0 **/ _setButtons: function (config) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_setButtons", 864);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 865);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_setButtons", 865);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 866); var defSection = this.DEFAULT_BUTTONS_SECTION, buttons = {}; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 868);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 869); function processButtons(buttonConfigs, currentSection) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "processButtons", 868);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 869);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "processButtons", 869);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 870); if (!isArray(buttonConfigs)) { return; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 871);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 872); var i, len, button, section; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 873);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 874); for (i = 0, len = buttonConfigs.length; i < len; i += 1) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 874);-button = buttonConfigs[i]; _yuitest_coverline("build/widget-buttons/widget-buttons.js", 875);+button = buttonConfigs[i];+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 876); section = currentSection; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 877);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 878); if (!isNode(button)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 878);-button = this._mergeButtonConfig(button); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 879);+button = this._mergeButtonConfig(button);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 880); section || (section = button.section); } // Always passes through `_createButton()` to make sure the node // is decorated as a button.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 884);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 885); button = this._createButton(button); // Use provided `section` or fallback to the default section.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 887);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 888); section || (section = defSection); // Add button to the array of buttons for the specified section.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 890);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 891); (buttons[section] || (buttons[section] = [])).push(button); } } // Handle `config` being either an Array or Object of Arrays.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 895);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 896); if (isArray(config)) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 896);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 897); processButtons.call(this, config); } else {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 898);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 899); YObject.each(config, processButtons, this); } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 901);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 902); return buttons; }, @@ -1128,12 +1129,12 @@ @since 3.4.0 **/ _syncUIButtons: function () {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_syncUIButtons", 912);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 913);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_syncUIButtons", 913);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 914); this._uiSetButtons(this.get('buttons'));- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 914);-this._uiSetDefaultButton(this.get('defaultButton')); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 915);+this._uiSetDefaultButton(this.get('defaultButton'));+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 916); this._uiSetVisibleButtons(this.get('visible')); }, @@ -1152,18 +1153,18 @@ @since 3.5.0 **/ _uiInsertButton: function (button, section, index) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiInsertButton", 932);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 933);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiInsertButton", 933);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 934); var buttonsClassName = WidgetButtons.CLASS_NAMES.button, buttonContainer = this._getButtonContainer(section, true), sectionButtons = buttonContainer.all('.' + buttonsClassName); // Inserts the button node at the correct index.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 938);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 939); buttonContainer.insertBefore(button, sectionButtons.item(index)); // Adds the button container to the section content.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 941);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 942); this.setStdModContent(section, buttonContainer, 'after'); }, @@ -1187,40 +1188,44 @@ @since 3.5.0 **/ _uiRemoveButton: function (button, section, options) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiRemoveButton", 963);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 964);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiRemoveButton", 964);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 965); var yuid = Y.stamp(button, this), handles = this._buttonsHandles, handle = handles[yuid], buttonContainer, buttonClassName; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 969);-handle && handle.detach(); _yuitest_coverline("build/widget-buttons/widget-buttons.js", 970);+if (handle) {+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 971);+handle.detach();+ }++ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 974); delete handles[yuid]; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 972);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 976); button.remove(); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 974);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 978); options || (options = {}); // Remove the button container and section nodes if needed.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 977);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 981); if (!options.preserveContent) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 978);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 982); buttonContainer = this._getButtonContainer(section);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 979);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 983); buttonClassName = WidgetButtons.CLASS_NAMES.button; // Only matters if we have a button container which is empty.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 982);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 986); if (buttonContainer && buttonContainer.all('.' + buttonClassName).isEmpty()) { - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 985);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 989); buttonContainer.remove();- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 986);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 990); this._updateContentButtons(section); } }@@ -1246,15 +1251,15 @@ @since 3.5.0 **/ _uiSetButtons: function (buttons) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiSetButtons", 1010);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1011);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiSetButtons", 1014);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1015); var buttonClassName = WidgetButtons.CLASS_NAMES.button, sections = ['header', 'body', 'footer']; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1014);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1018); YArray.each(sections, function (section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 8)", 1014);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1015);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 8)", 1018);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1019); var sectionButtons = buttons[section] || [], numButtons = sectionButtons.length, buttonContainer = this._getButtonContainer(section, numButtons),@@ -1263,75 +1268,75 @@ // When there's no button container, there are no new buttons or old // buttons that we have to deal with for this section.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1023);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1027); if (!buttonContainer) { return; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1025);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1029); oldNodes = buttonContainer.all('.' + buttonClassName); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1027);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1031); for (i = 0; i < numButtons; i += 1) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1028);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1032); button = sectionButtons[i];- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1029);-buttonIndex = oldNodes ? oldNodes.indexOf(button) : -1;+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1033);+buttonIndex = oldNodes.indexOf(button); // Buttons already rendered in the Widget should remain there or // moved to their new index. New buttons will be added to the // current `buttonContainer`.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1034);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1038); if (buttonIndex > -1) { // Remove button from existing buttons nodeList since its in // the DOM already.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1037);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1041); oldNodes.splice(buttonIndex, 1); // Check that the button is at the right position, if not, // move it to its new position.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1041);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1045); if (buttonIndex !== i) { // Using `i + 1` because the button should be at index // `i`; it's inserted before the node which comes after.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1044);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1048); buttonContainer.insertBefore(button, i + 1);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1045);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1049); buttonsUpdated = true; } } else {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1048);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1052); buttonContainer.appendChild(button);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1049);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1053); buttonsUpdated = true; } } // Safely removes the old button nodes which are no longer part of // this widget's `buttons`.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1055);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1059); oldNodes.each(function (button) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 9)", 1055);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1056);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "(anonymous 9)", 1059);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1060); this._uiRemoveButton(button, section, {preserveContent: true});- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1057);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1061); buttonsUpdated = true; }, this); // Remove leftover empty button containers and updated the StdMod // content area.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1062);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1066); if (numButtons === 0) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1063);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1067); buttonContainer.remove();- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1064);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1068); this._updateContentButtons(section);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1065);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1069); return; } // Adds the button container to the section content.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1069);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1073); if (buttonsUpdated) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1070);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1074); this.setStdModContent(section, buttonContainer, 'after'); } }, this);@@ -1348,14 +1353,14 @@ @since 3.5.0 **/ _uiSetDefaultButton: function (newButton, oldButton) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiSetDefaultButton", 1085);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1086);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiSetDefaultButton", 1089);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1090); var primaryClassName = WidgetButtons.CLASS_NAMES.primary; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1088);-newButton && newButton.addClass(primaryClassName);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1089);-oldButton && oldButton.removeClass(primaryClassName);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1092);+if (newButton) { newButton.addClass(primaryClassName); }+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1093);+if (oldButton) { oldButton.removeClass(primaryClassName); } }, /**@@ -1368,15 +1373,15 @@ @since 3.5.0 **/ _uiSetVisibleButtons: function (visible) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiSetVisibleButtons", 1101);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1102);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_uiSetVisibleButtons", 1105);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1106); if (!visible) { return; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1104);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1108); var defaultButton = this.get('defaultButton');- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1105);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1109); if (defaultButton) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1106);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1110); defaultButton.focus(); } },@@ -1393,36 +1398,36 @@ @since 3.5.0 **/ _unMapButton: function (button, section) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_unMapButton", 1121);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1122);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_unMapButton", 1125);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1126); var map = this._buttonsMap, name = this._getButtonName(button), sectionName; // Only delete the map entry if the specified `button` is mapped to it.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1127);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1131); if (name) { // name -> button- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1129);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1133); if (map[name] === button) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1130);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1134); delete map[name]; } // section:name -> button- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1134);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1138); sectionName = section + ':' + name;- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1135);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1139); if (map[sectionName] === button) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1136);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1140); delete map[sectionName]; } } // Clear the default button if its the specified `button`.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1141);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1145); if (this._defaultButton === button) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1142);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1146); this._defaultButton = null; } },@@ -1436,13 +1441,13 @@ @since 3.5.0 **/ _updateDefaultButton: function () {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_updateDefaultButton", 1154);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1155);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_updateDefaultButton", 1158);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1159); var defaultButton = this._defaultButton; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1157);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1161); if (this.get('defaultButton') !== defaultButton) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1158);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1162); this._set('defaultButton', defaultButton); } },@@ -1462,12 +1467,12 @@ **/ _updateContentButtons: function (section) { // `childNodes` return text nodes and HTMLElements.- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_updateContentButtons", 1175);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1177);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_updateContentButtons", 1179);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1181); var sectionContent = this.getStdModNode(section).get('childNodes'); // Updates the section to its current contents, or null if it is empty.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1180);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1184); this.set(section + 'Content', sectionContent.isEmpty() ? null : sectionContent, {src: 'buttons'}); },@@ -1488,8 +1493,8 @@ @since 3.4.0 **/ _afterButtonsChange: function (e) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterButtonsChange", 1199);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1200);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterButtonsChange", 1203);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1204); var buttons = e.newVal, section = e.section, index = e.index,@@ -1497,46 +1502,46 @@ button; // Special cases `addButton()` to only set and insert the new button.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1207);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1211); if (src === 'add') { // Make sure we have the button node.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1209);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1213); button = buttons[section][index]; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1211);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1215); this._mapButton(button, section);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1212);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1216); this._updateDefaultButton();- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1213);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1217); this._uiInsertButton(button, section, index); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1215);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1219); return; } // Special cases `removeButton()` to only remove the specified button.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1219);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1223); if (src === 'remove') { // Button node already exists on the event facade.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1221);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1225); button = e.button; - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1223);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1227); this._unMapButton(button, section);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1224);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1228); this._updateDefaultButton();- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1225);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1229); this._uiRemoveButton(button, section); - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1227);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1231); return; } - _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1230);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1234); this._mapButtons(buttons);- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1231);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1235); this._updateDefaultButton();- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1232);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1236); this._uiSetButtons(buttons); }, @@ -1554,16 +1559,16 @@ @since 3.5.0 **/ _afterContentChangeButtons: function (e) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterContentChangeButtons", 1248);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1249);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterContentChangeButtons", 1252);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1253); var src = e.src, pos = e.stdModPosition, replace = !pos || pos === WidgetStdMod.REPLACE; // Only do work when absolutely necessary.- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1254);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1258); if (replace && src !== 'buttons' && src !== Widget.UI_SRC) {- _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1255);+ _yuitest_coverline("build/widget-buttons/widget-buttons.js", 1259); this._uiSetButtons(this.get('buttons')); } },@@ -1579,8 +1584,8 @@ @since 3.5.0 **/ _afterDefaultButtonChange: function (e) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterDefaultButtonChange", 1269);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1270);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterDefaultButtonChange", 1273);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1274); this._uiSetDefaultButton(e.newVal, e.prevVal); }, @@ -1594,14 +1599,14 @@ @since 3.5.0 **/ _afterVisibleChangeButtons: function (e) {- _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterVisibleChangeButtons", 1282);-_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1283);+ _yuitest_coverfunc("build/widget-buttons/widget-buttons.js", "_afterVisibleChangeButtons", 1286);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1287); this._uiSetVisibleButtons(e.newVal); } }; -_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1287);+_yuitest_coverline("build/widget-buttons/widget-buttons.js", 1291); Y.WidgetButtons = WidgetButtons; -}, '3.7.2', {"requires": ["button-plugin", "cssbutton", "widget-stdmod"]});+}, '3.7.3', {"requires": ["button-plugin", "cssbutton", "widget-stdmod"]});
bundle/widget-buttons/widget-buttons-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -267,7 +267,10 @@ this._updateDefaultButton(); // Bound with `Y.bind()` to make more extensible.- this.after('buttonsChange', Y.bind('_afterButtonsChange', this));+ this.after({+ buttonsChange : Y.bind('_afterButtonsChange', this),+ defaultButtonChange: Y.bind('_afterDefaultButtonChange', this)+ }); Y.after(this._bindUIButtons, this, 'bindUI'); Y.after(this._syncUIButtons, this, 'syncUI');@@ -508,11 +511,9 @@ **/ _bindUIButtons: function () { // Event handlers are bound with `bind()` to make them more extensible.- var afterContentChange = Y.bind('_afterContentChangeButtons', this); this.after({- defaultButtonChange: Y.bind('_afterDefaultButtonChange', this), visibleChange : Y.bind('_afterVisibleChangeButtons', this), headerContentChange: afterContentChange, bodyContentChange : afterContentChange,@@ -972,7 +973,10 @@ handle = handles[yuid], buttonContainer, buttonClassName; - handle && handle.detach();+ if (handle) {+ handle.detach();+ }+ delete handles[yuid]; button.remove();@@ -1032,7 +1036,7 @@ for (i = 0; i < numButtons; i += 1) { button = sectionButtons[i];- buttonIndex = oldNodes ? oldNodes.indexOf(button) : -1;+ buttonIndex = oldNodes.indexOf(button); // Buttons already rendered in the Widget should remain there or // moved to their new index. New buttons will be added to the@@ -1091,8 +1095,8 @@ _uiSetDefaultButton: function (newButton, oldButton) { var primaryClassName = WidgetButtons.CLASS_NAMES.primary; - newButton && newButton.addClass(primaryClassName);- oldButton && oldButton.removeClass(primaryClassName);+ if (newButton) { newButton.addClass(primaryClassName); }+ if (oldButton) { oldButton.removeClass(primaryClassName); } }, /**@@ -1293,4 +1297,4 @@ Y.WidgetButtons = WidgetButtons; -}, '3.7.2', {"requires": ["button-plugin", "cssbutton", "widget-stdmod"]});+}, '3.7.3', {"requires": ["button-plugin", "cssbutton", "widget-stdmod"]});
bundle/widget-buttons/widget-buttons-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-buttons",function(e,t){function p(e){return!!e.getDOMNode}function d(){this._stdModNode||e.error("WidgetStdMod must be added to a Widget before WidgetButtons."),this._buttonsHandles={}}var n=e.Array,r=e.Lang,i=e.Object,s=e.Plugin.Button,o=e.Widget,u=e.WidgetStdMod,a=e.ClassNameManager.getClassName,f=r.isArray,l=r.isNumber,c=r.isString,h=r.isValue;d.ATTRS={buttons:{getter:"_getButtons",setter:"_setButtons",value:{}},defaultButton:{readOnly:!0,value:null}},d.CLASS_NAMES={button:a("button"),buttons:o.getClassName("buttons"),primary:a("button","primary")},d.HTML_PARSER={buttons:function(e){return this._parseButtons(e)}},d.NON_BUTTON_NODE_CFG=["action","classNames","context","events","isDefault","section"],d.prototype={BUTTONS:{},BUTTONS_TEMPLATE:"<span />",DEFAULT_BUTTONS_SECTION:u.FOOTER,initializer:function(){this._mapButtons(this.get("buttons")),this._updateDefaultButton(),this.after("buttonsChange",e.bind("_afterButtonsChange",this)),e.after(this._bindUIButtons,this,"bindUI"),e.after(this._syncUIButtons,this,"syncUI")},destructor:function(){i.each(this._buttonsHandles,function(e){e.detach()}),delete this._buttonsHandles,delete this._buttonsMap,delete this._defaultButton},addButton:function(e,t,r){var i=this.get("buttons"),s,o;return p(e)||(e=this._mergeButtonConfig(e),t||(t=e.section)),t||(t=this.DEFAULT_BUTTONS_SECTION),s=i[t]||(i[t]=[]),l(r)||(r=s.length),s.splice(r,0,e),o=n.indexOf(s,e),this.set("buttons",i,{button:e,section:t,index:o,src:"add"}),this},getButton:function(e,t){if(!h(e))return;var n=this._buttonsMap,r;return t||(t=this.DEFAULT_BUTTONS_SECTION),l(e)?(r=this.get("buttons"),r[t]&&r[t][e]):arguments.length>1?n[t+":"+e]:n[e]},removeButton:function(e,t){if(!h(e))return this;var r=this.get("buttons"),s;return l(e)?(t||(t=this.DEFAULT_BUTTONS_SECTION),s=e,e=r[t][s]):(c(e)&&(e=this.getButton.apply(this,arguments)),i.some(r,function(r,i){s=n.indexOf(r,e);if(s>-1)return t=i,!0})),e&&s>-1&&(r[t].splice(s,1),this.set("buttons",r,{button:e,section:t,index:s,src:"remove"})),this},_bindUIButtons:function(){var t=e.bind("_afterContentChangeButtons",this);this.after({defaultButtonChange:e.bind("_afterDefaultButtonChange",this),visibleChange:e.bind("_afterVisibleChangeButtons",this),headerContentChange:t,bodyContentChange:t,footerContentChange:t})},_createButton:function(t){var r,i,o,u,a,f,l,h;if(p(t))return e.one(t.getDOMNode()).plug(s);r=e.merge({context:this,events:"click",label:t.value},t),i=e.merge(r),o=d.NON_BUTTON_NODE_CFG;for(u=0,a=o.length;u<a;u+=1)delete i[o[u]];return t=s.createNode(i),l=r.context,f=r.action,c(f)&&(f=e.bind(f,l)),h=t.on(r.events,f,l),this._buttonsHandles[e.stamp(t,!0)]=h,t.setData("name",this._getButtonName(r)),t.setData("default",this._getButtonDefault(r)),n.each(n(r.classNames),t.addClass,t),t},_getButtonContainer:function(t,n){var r=u.SECTION_CLASS_NAMES[t],i=d.CLASS_NAMES.buttons,s=this.get("contentBox"),o,a;return o="."+r+" ."+i,a=s.one(o),!a&&n&&(a=e.Node.create(this.BUTTONS_TEMPLATE),a.addClass(i)),a},_getButtonDefault:function(e){var t=p(e)?e.getData("default"):e.isDefault;return c(t)?t.toLowerCase()==="true":!!t},_getButtonName:function(e){var t;return p(e)?t=e.getData("name")||e.get("name"):t=e&&(e.name||e.type),t},_getButtons:function(e){var t={};return i.each(e,function(e,n){t[n]=e.concat()}),t},_mapButton:function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i=this._getButtonDefault(e);r&&(n[r]=e,n[t+":"+r]=e),i&&(this._defaultButton=e)},_mapButtons:function(e){this._buttonsMap={},this._defaultButton=null,i.each(e,function(e,t){var n,r;for(n=0,r=e.length;n<r;n+=1)this._mapButton(e[n],t)},this)},_mergeButtonConfig:function(t){var n,r,i,s,o,u;return t=c(t)?{name:t}:e.merge(t),t.srcNode&&(s=t.srcNode,o=s.get("tagName").toLowerCase(),u=s.get(o==="input"?"value":"text"),n={disabled:!!s.get("disabled"),isDefault:this._getButtonDefault(s),name:this._getButtonName(s)},u&&(n.label=u),e.mix(t,n,!1,null,0,!0)),i=this._getButtonName(t),r=this.BUTTONS&&this.BUTTONS[i],r&&e.mix(t,r,!1,null,0,!0),t},_parseButtons:function(e){var t="."+d.CLASS_NAMES.button,r=["header","body","footer"],i=null;return n.each(r,function(e){var n=this._getButtonContainer(e),r=n&&n.all(t),s;if(!r||r.isEmpty())return;s=[],r.each(function(e){s.push({srcNode:e})}),i||(i={}),i[e]=s},this),i},_setButtons:function(e){function r(e,r){if(!f(e))return;var i,s,o,u;for(i=0,s=e.length;i<s;i+=1)o=e[i],u=r,p(o)||(o=this._mergeButtonConfig(o),u||(u=o.section)),o=this._createButton(o),u||(u=t),(n[u]||(n[u]=[])).push(o)}var t=this.DEFAULT_BUTTONS_SECTION,n={};return f(e)?r.call(this,e):i.each(e,r,this),n},_syncUIButtons:function(){this._uiSetButtons(this.get("buttons")),this._uiSetDefaultButton(this.get("defaultButton")),this._uiSetVisibleButtons(this.get("visible"))},_uiInsertButton:function(e,t,n){var r=d.CLASS_NAMES.button,i=this._getButtonContainer(t,!0),s=i.all("."+r);i.insertBefore(e,s.item(n)),this.setStdModContent(t,i,"after")},_uiRemoveButton:function(t,n,r){var i=e.stamp(t,this),s=this._buttonsHandles,o=s[i],u,a;o&&o.detach(),delete s[i],t.remove(),r||(r={}),r.preserveContent||(u=this._getButtonContainer(n),a=d.CLASS_NAMES.button,u&&u.all("."+a).isEmpty()&&(u.remove(),this._updateContentButtons(n)))},_uiSetButtons:function(e){var t=d.CLASS_NAMES.button,r=["header","body","footer"];n.each(r,function(n){var r=e[n]||[],i=r.length,s=this._getButtonContainer(n,i),o=!1,u,a,f,l;if(!s)return;u=s.all("."+t);for(a=0;a<i;a+=1)f=r[a],l=u?u.indexOf(f):-1,l>-1?(u.splice(l,1),l!==a&&(s.insertBefore(f,a+1),o=!0)):(s.appendChild(f),o=!0);u.each(function(e){this._uiRemoveButton(e,n,{preserveContent:!0}),o=!0},this);if(i===0){s.remove(),this._updateContentButtons(n);return}o&&this.setStdModContent(n,s,"after")},this)},_uiSetDefaultButton:function(e,t){var n=d.CLASS_NAMES.primary;e&&e.addClass(n),t&&t.removeClass(n)},_uiSetVisibleButtons:function(e){if(!e)return;var t=this.get("defaultButton");t&&t.focus()},_unMapButton:function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i;r&&(n[r]===e&&delete n[r],i=t+":"+r,n[i]===e&&delete n[i]),this._defaultButton===e&&(this._defaultButton=null)},_updateDefaultButton:function(){var e=this._defaultButton;this.get("defaultButton")!==e&&this._set("defaultButton",e)},_updateContentButtons:function(e){var t=this.getStdModNode(e).get("childNodes");this.set(e+"Content",t.isEmpty()?null:t,{src:"buttons"})},_afterButtonsChange:function(e){var t=e.newVal,n=e.section,r=e.index,i=e.src,s;if(i==="add"){s=t[n][r],this._mapButton(s,n),this._updateDefaultButton(),this._uiInsertButton(s,n,r);return}if(i==="remove"){s=e.button,this._unMapButton(s,n),this._updateDefaultButton(),this._uiRemoveButton(s,n);return}this._mapButtons(t),this._updateDefaultButton(),this._uiSetButtons(t)},_afterContentChangeButtons:function(e){var t=e.src,n=e.stdModPosition,r=!n||n===u.REPLACE;r&&t!=="buttons"&&t!==o.UI_SRC&&this._uiSetButtons(this.get("buttons"))},_afterDefaultButtonChange:function(e){this._uiSetDefaultButton(e.newVal,e.prevVal)},_afterVisibleChangeButtons:function(e){this._uiSetVisibleButtons(e.newVal)}},e.WidgetButtons=d},"3.7.2",{requires:["button-plugin","cssbutton","widget-stdmod"]});+YUI.add("widget-buttons",function(e,t){function p(e){return!!e.getDOMNode}function d(){this._stdModNode||e.error("WidgetStdMod must be added to a Widget before WidgetButtons."),this._buttonsHandles={}}var n=e.Array,r=e.Lang,i=e.Object,s=e.Plugin.Button,o=e.Widget,u=e.WidgetStdMod,a=e.ClassNameManager.getClassName,f=r.isArray,l=r.isNumber,c=r.isString,h=r.isValue;d.ATTRS={buttons:{getter:"_getButtons",setter:"_setButtons",value:{}},defaultButton:{readOnly:!0,value:null}},d.CLASS_NAMES={button:a("button"),buttons:o.getClassName("buttons"),primary:a("button","primary")},d.HTML_PARSER={buttons:function(e){return this._parseButtons(e)}},d.NON_BUTTON_NODE_CFG=["action","classNames","context","events","isDefault","section"],d.prototype={BUTTONS:{},BUTTONS_TEMPLATE:"<span />",DEFAULT_BUTTONS_SECTION:u.FOOTER,initializer:function(){this._mapButtons(this.get("buttons")),this._updateDefaultButton(),this.after({buttonsChange:e.bind("_afterButtonsChange",this),defaultButtonChange:e.bind("_afterDefaultButtonChange",this)}),e.after(this._bindUIButtons,this,"bindUI"),e.after(this._syncUIButtons,this,"syncUI")},destructor:function(){i.each(this._buttonsHandles,function(e){e.detach()}),delete this._buttonsHandles,delete this._buttonsMap,delete this._defaultButton},addButton:function(e,t,r){var i=this.get("buttons"),s,o;return p(e)||(e=this._mergeButtonConfig(e),t||(t=e.section)),t||(t=this.DEFAULT_BUTTONS_SECTION),s=i[t]||(i[t]=[]),l(r)||(r=s.length),s.splice(r,0,e),o=n.indexOf(s,e),this.set("buttons",i,{button:e,section:t,index:o,src:"add"}),this},getButton:function(e,t){if(!h(e))return;var n=this._buttonsMap,r;return t||(t=this.DEFAULT_BUTTONS_SECTION),l(e)?(r=this.get("buttons"),r[t]&&r[t][e]):arguments.length>1?n[t+":"+e]:n[e]},removeButton:function(e,t){if(!h(e))return this;var r=this.get("buttons"),s;return l(e)?(t||(t=this.DEFAULT_BUTTONS_SECTION),s=e,e=r[t][s]):(c(e)&&(e=this.getButton.apply(this,arguments)),i.some(r,function(r,i){s=n.indexOf(r,e);if(s>-1)return t=i,!0})),e&&s>-1&&(r[t].splice(s,1),this.set("buttons",r,{button:e,section:t,index:s,src:"remove"})),this},_bindUIButtons:function(){var t=e.bind("_afterContentChangeButtons",this);this.after({visibleChange:e.bind("_afterVisibleChangeButtons",this),headerContentChange:t,bodyContentChange:t,footerContentChange:t})},_createButton:function(t){var r,i,o,u,a,f,l,h;if(p(t))return e.one(t.getDOMNode()).plug(s);r=e.merge({context:this,events:"click",label:t.value},t),i=e.merge(r),o=d.NON_BUTTON_NODE_CFG;for(u=0,a=o.length;u<a;u+=1)delete i[o[u]];return t=s.createNode(i),l=r.context,f=r.action,c(f)&&(f=e.bind(f,l)),h=t.on(r.events,f,l),this._buttonsHandles[e.stamp(t,!0)]=h,t.setData("name",this._getButtonName(r)),t.setData("default",this._getButtonDefault(r)),n.each(n(r.classNames),t.addClass,t),t},_getButtonContainer:function(t,n){var r=u.SECTION_CLASS_NAMES[t],i=d.CLASS_NAMES.buttons,s=this.get("contentBox"),o,a;return o="."+r+" ."+i,a=s.one(o),!a&&n&&(a=e.Node.create(this.BUTTONS_TEMPLATE),a.addClass(i)),a},_getButtonDefault:function(e){var t=p(e)?e.getData("default"):e.isDefault;return c(t)?t.toLowerCase()==="true":!!t},_getButtonName:function(e){var t;return p(e)?t=e.getData("name")||e.get("name"):t=e&&(e.name||e.type),t},_getButtons:function(e){var t={};return i.each(e,function(e,n){t[n]=e.concat()}),t},_mapButton:function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i=this._getButtonDefault(e);r&&(n[r]=e,n[t+":"+r]=e),i&&(this._defaultButton=e)},_mapButtons:function(e){this._buttonsMap={},this._defaultButton=null,i.each(e,function(e,t){var n,r;for(n=0,r=e.length;n<r;n+=1)this._mapButton(e[n],t)},this)},_mergeButtonConfig:function(t){var n,r,i,s,o,u;return t=c(t)?{name:t}:e.merge(t),t.srcNode&&(s=t.srcNode,o=s.get("tagName").toLowerCase(),u=s.get(o==="input"?"value":"text"),n={disabled:!!s.get("disabled"),isDefault:this._getButtonDefault(s),name:this._getButtonName(s)},u&&(n.label=u),e.mix(t,n,!1,null,0,!0)),i=this._getButtonName(t),r=this.BUTTONS&&this.BUTTONS[i],r&&e.mix(t,r,!1,null,0,!0),t},_parseButtons:function(e){var t="."+d.CLASS_NAMES.button,r=["header","body","footer"],i=null;return n.each(r,function(e){var n=this._getButtonContainer(e),r=n&&n.all(t),s;if(!r||r.isEmpty())return;s=[],r.each(function(e){s.push({srcNode:e})}),i||(i={}),i[e]=s},this),i},_setButtons:function(e){function r(e,r){if(!f(e))return;var i,s,o,u;for(i=0,s=e.length;i<s;i+=1)o=e[i],u=r,p(o)||(o=this._mergeButtonConfig(o),u||(u=o.section)),o=this._createButton(o),u||(u=t),(n[u]||(n[u]=[])).push(o)}var t=this.DEFAULT_BUTTONS_SECTION,n={};return f(e)?r.call(this,e):i.each(e,r,this),n},_syncUIButtons:function(){this._uiSetButtons(this.get("buttons")),this._uiSetDefaultButton(this.get("defaultButton")),this._uiSetVisibleButtons(this.get("visible"))},_uiInsertButton:function(e,t,n){var r=d.CLASS_NAMES.button,i=this._getButtonContainer(t,!0),s=i.all("."+r);i.insertBefore(e,s.item(n)),this.setStdModContent(t,i,"after")},_uiRemoveButton:function(t,n,r){var i=e.stamp(t,this),s=this._buttonsHandles,o=s[i],u,a;o&&o.detach(),delete s[i],t.remove(),r||(r={}),r.preserveContent||(u=this._getButtonContainer(n),a=d.CLASS_NAMES.button,u&&u.all("."+a).isEmpty()&&(u.remove(),this._updateContentButtons(n)))},_uiSetButtons:function(e){var t=d.CLASS_NAMES.button,r=["header","body","footer"];n.each(r,function(n){var r=e[n]||[],i=r.length,s=this._getButtonContainer(n,i),o=!1,u,a,f,l;if(!s)return;u=s.all("."+t);for(a=0;a<i;a+=1)f=r[a],l=u.indexOf(f),l>-1?(u.splice(l,1),l!==a&&(s.insertBefore(f,a+1),o=!0)):(s.appendChild(f),o=!0);u.each(function(e){this._uiRemoveButton(e,n,{preserveContent:!0}),o=!0},this);if(i===0){s.remove(),this._updateContentButtons(n);return}o&&this.setStdModContent(n,s,"after")},this)},_uiSetDefaultButton:function(e,t){var n=d.CLASS_NAMES.primary;e&&e.addClass(n),t&&t.removeClass(n)},_uiSetVisibleButtons:function(e){if(!e)return;var t=this.get("defaultButton");t&&t.focus()},_unMapButton:function(e,t){var n=this._buttonsMap,r=this._getButtonName(e),i;r&&(n[r]===e&&delete n[r],i=t+":"+r,n[i]===e&&delete n[i]),this._defaultButton===e&&(this._defaultButton=null)},_updateDefaultButton:function(){var e=this._defaultButton;this.get("defaultButton")!==e&&this._set("defaultButton",e)},_updateContentButtons:function(e){var t=this.getStdModNode(e).get("childNodes");this.set(e+"Content",t.isEmpty()?null:t,{src:"buttons"})},_afterButtonsChange:function(e){var t=e.newVal,n=e.section,r=e.index,i=e.src,s;if(i==="add"){s=t[n][r],this._mapButton(s,n),this._updateDefaultButton(),this._uiInsertButton(s,n,r);return}if(i==="remove"){s=e.button,this._unMapButton(s,n),this._updateDefaultButton(),this._uiRemoveButton(s,n);return}this._mapButtons(t),this._updateDefaultButton(),this._uiSetButtons(t)},_afterContentChangeButtons:function(e){var t=e.src,n=e.stdModPosition,r=!n||n===u.REPLACE;r&&t!=="buttons"&&t!==o.UI_SRC&&this._uiSetButtons(this.get("buttons"))},_afterDefaultButtonChange:function(e){this._uiSetDefaultButton(e.newVal,e.prevVal)},_afterVisibleChangeButtons:function(e){this._uiSetVisibleButtons(e.newVal)}},e.WidgetButtons=d},"3.7.3",{requires:["button-plugin","cssbutton","widget-stdmod"]});
bundle/widget-buttons/widget-buttons.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -267,7 +267,10 @@ this._updateDefaultButton(); // Bound with `Y.bind()` to make more extensible.- this.after('buttonsChange', Y.bind('_afterButtonsChange', this));+ this.after({+ buttonsChange : Y.bind('_afterButtonsChange', this),+ defaultButtonChange: Y.bind('_afterDefaultButtonChange', this)+ }); Y.after(this._bindUIButtons, this, 'bindUI'); Y.after(this._syncUIButtons, this, 'syncUI');@@ -508,11 +511,9 @@ **/ _bindUIButtons: function () { // Event handlers are bound with `bind()` to make them more extensible.- var afterContentChange = Y.bind('_afterContentChangeButtons', this); this.after({- defaultButtonChange: Y.bind('_afterDefaultButtonChange', this), visibleChange : Y.bind('_afterVisibleChangeButtons', this), headerContentChange: afterContentChange, bodyContentChange : afterContentChange,@@ -972,7 +973,10 @@ handle = handles[yuid], buttonContainer, buttonClassName; - handle && handle.detach();+ if (handle) {+ handle.detach();+ }+ delete handles[yuid]; button.remove();@@ -1032,7 +1036,7 @@ for (i = 0; i < numButtons; i += 1) { button = sectionButtons[i];- buttonIndex = oldNodes ? oldNodes.indexOf(button) : -1;+ buttonIndex = oldNodes.indexOf(button); // Buttons already rendered in the Widget should remain there or // moved to their new index. New buttons will be added to the@@ -1091,8 +1095,8 @@ _uiSetDefaultButton: function (newButton, oldButton) { var primaryClassName = WidgetButtons.CLASS_NAMES.primary; - newButton && newButton.addClass(primaryClassName);- oldButton && oldButton.removeClass(primaryClassName);+ if (newButton) { newButton.addClass(primaryClassName); }+ if (oldButton) { oldButton.removeClass(primaryClassName); } }, /**@@ -1293,4 +1297,4 @@ Y.WidgetButtons = WidgetButtons; -}, '3.7.2', {"requires": ["button-plugin", "cssbutton", "widget-stdmod"]});+}, '3.7.3', {"requires": ["button-plugin", "cssbutton", "widget-stdmod"]});
bundle/widget-child/widget-child-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-child/widget-child.js", code: [] };-_yuitest_coverage["build/widget-child/widget-child.js"].code=["YUI.add('widget-child', function (Y, NAME) {","","/**"," * Extension enabling a Widget to be a child of another Widget."," *"," * @module widget-child"," */","","var Lang = Y.Lang;","","/**"," * Widget extension providing functionality enabling a Widget to be a "," * child of another Widget."," *"," * @class WidgetChild"," * @param {Object} config User configuration object.","*/","function Child() {",""," // Widget method overlap"," Y.after(this._syncUIChild, this, \"syncUI\");"," Y.after(this._bindUIChild, this, \"bindUI\");","","}","","Child.ATTRS = {",""," /**"," * @attribute selected"," * @type Number"," * @default 0"," *"," * @description Number indicating if the Widget is selected. Possible "," * values are:"," * <dl>"," * <dt>0</dt> <dd>(Default) Not selected</dd>"," * <dt>1</dt> <dd>Fully selected</dd>"," * <dt>2</dt> <dd>Partially selected</dd>"," * </dl>"," */"," selected: { "," value: 0,"," validator: Lang.isNumber"," },","",""," /**"," * @attribute index"," * @type Number"," * @readOnly"," *"," * @description Number representing the Widget's ordinal position in its "," * parent Widget."," */"," index: {"," readOnly: true,"," getter: function () {"," "," var parent = this.get(\"parent\"),"," index = -1;"," "," if (parent) {"," index = parent.indexOf(this);"," }"," "," return index;"," "," }"," },","",""," /**"," * @attribute parent"," * @type Widget"," * @readOnly"," *"," * @description Retrieves the parent of the Widget in the object hierarchy."," */"," parent: {"," readOnly: true"," },","",""," /**"," * @attribute depth"," * @type Number"," * @default -1 "," * @readOnly "," *"," * @description Number representing the depth of this Widget relative to "," * the root Widget in the object heirarchy."," */"," depth: {"," readOnly: true,"," getter: function () {"," "," var parent = this.get(\"parent\"),"," root = this.get(\"root\"),"," depth = -1;"," "," while (parent) {",""," depth = (depth + 1);",""," if (parent == root) {"," break;"," }",""," parent = parent.get(\"parent\");",""," }"," "," return depth;"," "," }"," },",""," /**"," * @attribute root"," * @type Widget "," * @readOnly "," *"," * @description Returns the root Widget in the object hierarchy. If the"," * ROOT_TYPE property is set, the search for the root Widget will be "," * constrained to parent Widgets of the specified type."," */"," root: {"," readOnly: true,"," getter: function () {",""," var getParent = function (child) {",""," var parent = child.get(\"parent\"),"," FnRootType = child.ROOT_TYPE,"," criteria = parent;",""," if (FnRootType) {"," criteria = (parent && Y.instanceOf(parent, FnRootType));"," }",""," return (criteria ? getParent(parent) : child);"," "," };",""," return getParent(this);"," "," }"," }","","};","","Child.prototype = {",""," /**"," * Constructor reference used to determine the root of a Widget-based "," * object tree."," * <p>"," * Currently used to control the behavior of the <code>root</code> "," * attribute so that recursing up the object heirarchy can be constrained "," * to a specific type of Widget. Widget authors should set this property"," * to the constructor function for a given Widget implementation."," * </p>"," *"," * @property ROOT_TYPE"," * @type Object"," */"," ROOT_TYPE: null,",""," /**"," * Returns the node on which to bind delegate listeners."," * "," * Override of Widget's implementation of _getUIEventNode() to ensure that "," * all event listeners are bound to the Widget's topmost DOM element."," * This ensures that the firing of each type of Widget UI event (click,"," * mousedown, etc.) is facilitated by a single, top-level, delegated DOM"," * event listener."," *"," * @method _getUIEventNode"," * @for Widget"," * @protected"," */"," _getUIEventNode: function () {"," var root = this.get(\"root\"),"," returnVal;"," "," if (root) {"," returnVal = root.get(\"boundingBox\");"," }"," "," return returnVal;"," },",""," /**"," * @method next"," * @description Returns the Widget's next sibling."," * @param {Boolean} circular Boolean indicating if the parent's first child "," * should be returned if the child has no next sibling. "," * @return {Widget} Widget instance. "," */"," next: function (circular) {",""," var parent = this.get(\"parent\"),"," sibling;",""," if (parent) {"," sibling = parent.item((this.get(\"index\")+1));"," }",""," if (!sibling && circular) {"," sibling = parent.item(0);"," }",""," return sibling;",""," },","",""," /**"," * @method previous"," * @description Returns the Widget's previous sibling."," * @param {Boolean} circular Boolean indicating if the parent's last child "," * should be returned if the child has no previous sibling."," * @return {Widget} Widget instance. "," */"," previous: function (circular) {",""," var parent = this.get(\"parent\"),"," index = this.get(\"index\"),"," sibling;"," "," if (parent && index > 0) {"," sibling = parent.item([(index-1)]);"," }",""," if (!sibling && circular) {"," sibling = parent.item((parent.size() - 1));"," }",""," return sibling; "," "," },","",""," // Override of Y.WidgetParent.remove()"," // Sugar implementation allowing a child to remove itself from its parent."," remove: function (index) {",""," var parent,"," removed;",""," if (Lang.isNumber(index)) {"," removed = Y.WidgetParent.prototype.remove.apply(this, arguments);"," }"," else {",""," parent = this.get(\"parent\");",""," if (parent) {"," removed = parent.remove(this.get(\"index\"));"," }"," "," }"," "," return removed;"," "," },","",""," /**"," * @method isRoot"," * @description Determines if the Widget is the root Widget in the "," * object hierarchy."," * @return {Boolean} Boolean indicating if Widget is the root Widget in the "," * object hierarchy."," */"," isRoot: function () {"," return (this == this.get(\"root\"));"," },","",""," /**"," * @method ancestor"," * @description Returns the Widget instance at the specified depth."," * @param {number} depth Number representing the depth of the ancestor."," * @return {Widget} Widget instance."," */"," ancestor: function (depth) {",""," var root = this.get(\"root\"),"," parent;",""," if (this.get(\"depth\") > depth) {",""," parent = this.get(\"parent\");",""," while (parent != root && parent.get(\"depth\") > depth) {"," parent = parent.get(\"parent\");"," }",""," }",""," return parent;",""," },","",""," /**"," * Updates the UI to reflect the <code>selected</code> attribute value."," *"," * @method _uiSetChildSelected"," * @protected"," * @param {number} selected The selected value to be reflected in the UI."," */ "," _uiSetChildSelected: function (selected) {",""," var box = this.get(\"boundingBox\"),"," sClassName = this.getClassName(\"selected\");",""," if (selected === 0) {"," box.removeClass(sClassName);"," }"," else {"," box.addClass(sClassName);"," }"," "," },","",""," /**"," * Default attribute change listener for the <code>selected</code> "," * attribute, responsible for updating the UI, in response to "," * attribute changes."," *"," * @method _afterChildSelectedChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */ "," _afterChildSelectedChange: function (event) {"," this._uiSetChildSelected(event.newVal);"," },"," ",""," /**"," * Synchronizes the UI to match the WidgetChild state."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p> "," *"," * @method _syncUIChild"," * @protected"," */ "," _syncUIChild: function () {"," this._uiSetChildSelected(this.get(\"selected\"));"," },","",""," /**"," * Binds event listeners responsible for updating the UI state in response "," * to WidgetChild related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIChild"," * @protected"," */ "," _bindUIChild: function () { "," this.after(\"selectedChange\", this._afterChildSelectedChange);"," }"," ","};","","Y.WidgetChild = Child;","","}, '3.7.2', {\"requires\": [\"base-build\", \"widget\"]});"];+_yuitest_coverage["build/widget-child/widget-child.js"].code=["YUI.add('widget-child', function (Y, NAME) {","","/**"," * Extension enabling a Widget to be a child of another Widget."," *"," * @module widget-child"," */","","var Lang = Y.Lang;","","/**"," * Widget extension providing functionality enabling a Widget to be a "," * child of another Widget."," *"," * @class WidgetChild"," * @param {Object} config User configuration object.","*/","function Child() {",""," // Widget method overlap"," Y.after(this._syncUIChild, this, \"syncUI\");"," Y.after(this._bindUIChild, this, \"bindUI\");","","}","","Child.ATTRS = {",""," /**"," * @attribute selected"," * @type Number"," * @default 0"," *"," * @description Number indicating if the Widget is selected. Possible "," * values are:"," * <dl>"," * <dt>0</dt> <dd>(Default) Not selected</dd>"," * <dt>1</dt> <dd>Fully selected</dd>"," * <dt>2</dt> <dd>Partially selected</dd>"," * </dl>"," */"," selected: { "," value: 0,"," validator: Lang.isNumber"," },","",""," /**"," * @attribute index"," * @type Number"," * @readOnly"," *"," * @description Number representing the Widget's ordinal position in its "," * parent Widget."," */"," index: {"," readOnly: true,"," getter: function () {"," "," var parent = this.get(\"parent\"),"," index = -1;"," "," if (parent) {"," index = parent.indexOf(this);"," }"," "," return index;"," "," }"," },","",""," /**"," * @attribute parent"," * @type Widget"," * @readOnly"," *"," * @description Retrieves the parent of the Widget in the object hierarchy."," */"," parent: {"," readOnly: true"," },","",""," /**"," * @attribute depth"," * @type Number"," * @default -1 "," * @readOnly "," *"," * @description Number representing the depth of this Widget relative to "," * the root Widget in the object heirarchy."," */"," depth: {"," readOnly: true,"," getter: function () {"," "," var parent = this.get(\"parent\"),"," root = this.get(\"root\"),"," depth = -1;"," "," while (parent) {",""," depth = (depth + 1);",""," if (parent == root) {"," break;"," }",""," parent = parent.get(\"parent\");",""," }"," "," return depth;"," "," }"," },",""," /**"," * @attribute root"," * @type Widget "," * @readOnly "," *"," * @description Returns the root Widget in the object hierarchy. If the"," * ROOT_TYPE property is set, the search for the root Widget will be "," * constrained to parent Widgets of the specified type."," */"," root: {"," readOnly: true,"," getter: function () {",""," var getParent = function (child) {",""," var parent = child.get(\"parent\"),"," FnRootType = child.ROOT_TYPE,"," criteria = parent;",""," if (FnRootType) {"," criteria = (parent && Y.instanceOf(parent, FnRootType));"," }",""," return (criteria ? getParent(parent) : child);"," "," };",""," return getParent(this);"," "," }"," }","","};","","Child.prototype = {",""," /**"," * Constructor reference used to determine the root of a Widget-based "," * object tree."," * <p>"," * Currently used to control the behavior of the <code>root</code> "," * attribute so that recursing up the object heirarchy can be constrained "," * to a specific type of Widget. Widget authors should set this property"," * to the constructor function for a given Widget implementation."," * </p>"," *"," * @property ROOT_TYPE"," * @type Object"," */"," ROOT_TYPE: null,",""," /**"," * Returns the node on which to bind delegate listeners."," * "," * Override of Widget's implementation of _getUIEventNode() to ensure that "," * all event listeners are bound to the Widget's topmost DOM element."," * This ensures that the firing of each type of Widget UI event (click,"," * mousedown, etc.) is facilitated by a single, top-level, delegated DOM"," * event listener."," *"," * @method _getUIEventNode"," * @for Widget"," * @protected"," */"," _getUIEventNode: function () {"," var root = this.get(\"root\"),"," returnVal;"," "," if (root) {"," returnVal = root.get(\"boundingBox\");"," }"," "," return returnVal;"," },",""," /**"," * @method next"," * @description Returns the Widget's next sibling."," * @param {Boolean} circular Boolean indicating if the parent's first child "," * should be returned if the child has no next sibling. "," * @return {Widget} Widget instance. "," */"," next: function (circular) {",""," var parent = this.get(\"parent\"),"," sibling;",""," if (parent) {"," sibling = parent.item((this.get(\"index\")+1));"," }",""," if (!sibling && circular) {"," sibling = parent.item(0);"," }",""," return sibling;",""," },","",""," /**"," * @method previous"," * @description Returns the Widget's previous sibling."," * @param {Boolean} circular Boolean indicating if the parent's last child "," * should be returned if the child has no previous sibling."," * @return {Widget} Widget instance. "," */"," previous: function (circular) {",""," var parent = this.get(\"parent\"),"," index = this.get(\"index\"),"," sibling;"," "," if (parent && index > 0) {"," sibling = parent.item([(index-1)]);"," }",""," if (!sibling && circular) {"," sibling = parent.item((parent.size() - 1));"," }",""," return sibling; "," "," },","",""," // Override of Y.WidgetParent.remove()"," // Sugar implementation allowing a child to remove itself from its parent."," remove: function (index) {",""," var parent,"," removed;",""," if (Lang.isNumber(index)) {"," removed = Y.WidgetParent.prototype.remove.apply(this, arguments);"," }"," else {",""," parent = this.get(\"parent\");",""," if (parent) {"," removed = parent.remove(this.get(\"index\"));"," }"," "," }"," "," return removed;"," "," },","",""," /**"," * @method isRoot"," * @description Determines if the Widget is the root Widget in the "," * object hierarchy."," * @return {Boolean} Boolean indicating if Widget is the root Widget in the "," * object hierarchy."," */"," isRoot: function () {"," return (this == this.get(\"root\"));"," },","",""," /**"," * @method ancestor"," * @description Returns the Widget instance at the specified depth."," * @param {number} depth Number representing the depth of the ancestor."," * @return {Widget} Widget instance."," */"," ancestor: function (depth) {",""," var root = this.get(\"root\"),"," parent;",""," if (this.get(\"depth\") > depth) {",""," parent = this.get(\"parent\");",""," while (parent != root && parent.get(\"depth\") > depth) {"," parent = parent.get(\"parent\");"," }",""," }",""," return parent;",""," },","",""," /**"," * Updates the UI to reflect the <code>selected</code> attribute value."," *"," * @method _uiSetChildSelected"," * @protected"," * @param {number} selected The selected value to be reflected in the UI."," */ "," _uiSetChildSelected: function (selected) {",""," var box = this.get(\"boundingBox\"),"," sClassName = this.getClassName(\"selected\");",""," if (selected === 0) {"," box.removeClass(sClassName);"," }"," else {"," box.addClass(sClassName);"," }"," "," },","",""," /**"," * Default attribute change listener for the <code>selected</code> "," * attribute, responsible for updating the UI, in response to "," * attribute changes."," *"," * @method _afterChildSelectedChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */ "," _afterChildSelectedChange: function (event) {"," this._uiSetChildSelected(event.newVal);"," },"," ",""," /**"," * Synchronizes the UI to match the WidgetChild state."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p> "," *"," * @method _syncUIChild"," * @protected"," */ "," _syncUIChild: function () {"," this._uiSetChildSelected(this.get(\"selected\"));"," },","",""," /**"," * Binds event listeners responsible for updating the UI state in response "," * to WidgetChild related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIChild"," * @protected"," */ "," _bindUIChild: function () { "," this.after(\"selectedChange\", this._afterChildSelectedChange);"," }"," ","};","","Y.WidgetChild = Child;","","}, '3.7.3', {\"requires\": [\"base-build\", \"widget\"]});"]; _yuitest_coverage["build/widget-child/widget-child.js"].lines = {"1":0,"9":0,"18":0,"21":0,"22":0,"26":0,"59":0,"62":0,"63":0,"66":0,"97":0,"101":0,"103":0,"105":0,"106":0,"109":0,"113":0,"131":0,"133":0,"137":0,"138":0,"141":0,"145":0,"152":0,"183":0,"186":0,"187":0,"190":0,"202":0,"205":0,"206":0,"209":0,"210":0,"213":0,"227":0,"231":0,"232":0,"235":0,"236":0,"239":0,"248":0,"251":0,"252":0,"256":0,"258":0,"259":0,"264":0,"277":0,"289":0,"292":0,"294":0,"296":0,"297":0,"302":0,"316":0,"319":0,"320":0,"323":0,"339":0,"354":0,"369":0,"374":0}; _yuitest_coverage["build/widget-child/widget-child.js"].functions = {"Child:18":0,"getter:57":0,"getter:95":0,"getParent:131":0,"getter:129":0,"_getUIEventNode:182":0,"next:200":0,"previous:225":0,"remove:246":0,"isRoot:276":0,"ancestor:287":0,"_uiSetChildSelected:314":0,"_afterChildSelectedChange:338":0,"_syncUIChild:353":0,"_bindUIChild:368":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-child/widget-child.js"].coveredLines = 62;@@ -490,4 +490,4 @@ _yuitest_coverline("build/widget-child/widget-child.js", 374); Y.WidgetChild = Child; -}, '3.7.2', {"requires": ["base-build", "widget"]});+}, '3.7.3', {"requires": ["base-build", "widget"]});
bundle/widget-child/widget-child-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -379,4 +379,4 @@ Y.WidgetChild = Child; -}, '3.7.2', {"requires": ["base-build", "widget"]});+}, '3.7.3', {"requires": ["base-build", "widget"]});
bundle/widget-child/widget-child-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-child",function(e,t){function r(){e.after(this._syncUIChild,this,"syncUI"),e.after(this._bindUIChild,this,"bindUI")}var n=e.Lang;r.ATTRS={selected:{value:0,validator:n.isNumber},index:{readOnly:!0,getter:function(){var e=this.get("parent"),t=-1;return e&&(t=e.indexOf(this)),t}},parent:{readOnly:!0},depth:{readOnly:!0,getter:function(){var e=this.get("parent"),t=this.get("root"),n=-1;while(e){n+=1;if(e==t)break;e=e.get("parent")}return n}},root:{readOnly:!0,getter:function(){var t=function(n){var r=n.get("parent"),i=n.ROOT_TYPE,s=r;return i&&(s=r&&e.instanceOf(r,i)),s?t(r):n};return t(this)}}},r.prototype={ROOT_TYPE:null,_getUIEventNode:function(){var e=this.get("root"),t;return e&&(t=e.get("boundingBox")),t},next:function(e){var t=this.get("parent"),n;return t&&(n=t.item(this.get("index")+1)),!n&&e&&(n=t.item(0)),n},previous:function(e){var t=this.get("parent"),n=this.get("index"),r;return t&&n>0&&(r=t.item([n-1])),!r&&e&&(r=t.item(t.size()-1)),r},remove:function(t){var r,i;return n.isNumber(t)?i=e.WidgetParent.prototype.remove.apply(this,arguments):(r=this.get("parent"),r&&(i=r.remove(this.get("index")))),i},isRoot:function(){return this==this.get("root")},ancestor:function(e){var t=this.get("root"),n;if(this.get("depth")>e){n=this.get("parent");while(n!=t&&n.get("depth")>e)n=n.get("parent")}return n},_uiSetChildSelected:function(e){var t=this.get("boundingBox"),n=this.getClassName("selected");e===0?t.removeClass(n):t.addClass(n)},_afterChildSelectedChange:function(e){this._uiSetChildSelected(e.newVal)},_syncUIChild:function(){this._uiSetChildSelected(this.get("selected"))},_bindUIChild:function(){this.after("selectedChange",this._afterChildSelectedChange)}},e.WidgetChild=r},"3.7.2",{requires:["base-build","widget"]});+YUI.add("widget-child",function(e,t){function r(){e.after(this._syncUIChild,this,"syncUI"),e.after(this._bindUIChild,this,"bindUI")}var n=e.Lang;r.ATTRS={selected:{value:0,validator:n.isNumber},index:{readOnly:!0,getter:function(){var e=this.get("parent"),t=-1;return e&&(t=e.indexOf(this)),t}},parent:{readOnly:!0},depth:{readOnly:!0,getter:function(){var e=this.get("parent"),t=this.get("root"),n=-1;while(e){n+=1;if(e==t)break;e=e.get("parent")}return n}},root:{readOnly:!0,getter:function(){var t=function(n){var r=n.get("parent"),i=n.ROOT_TYPE,s=r;return i&&(s=r&&e.instanceOf(r,i)),s?t(r):n};return t(this)}}},r.prototype={ROOT_TYPE:null,_getUIEventNode:function(){var e=this.get("root"),t;return e&&(t=e.get("boundingBox")),t},next:function(e){var t=this.get("parent"),n;return t&&(n=t.item(this.get("index")+1)),!n&&e&&(n=t.item(0)),n},previous:function(e){var t=this.get("parent"),n=this.get("index"),r;return t&&n>0&&(r=t.item([n-1])),!r&&e&&(r=t.item(t.size()-1)),r},remove:function(t){var r,i;return n.isNumber(t)?i=e.WidgetParent.prototype.remove.apply(this,arguments):(r=this.get("parent"),r&&(i=r.remove(this.get("index")))),i},isRoot:function(){return this==this.get("root")},ancestor:function(e){var t=this.get("root"),n;if(this.get("depth")>e){n=this.get("parent");while(n!=t&&n.get("depth")>e)n=n.get("parent")}return n},_uiSetChildSelected:function(e){var t=this.get("boundingBox"),n=this.getClassName("selected");e===0?t.removeClass(n):t.addClass(n)},_afterChildSelectedChange:function(e){this._uiSetChildSelected(e.newVal)},_syncUIChild:function(){this._uiSetChildSelected(this.get("selected"))},_bindUIChild:function(){this.after("selectedChange",this._afterChildSelectedChange)}},e.WidgetChild=r},"3.7.3",{requires:["base-build","widget"]});
bundle/widget-child/widget-child.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -379,4 +379,4 @@ Y.WidgetChild = Child; -}, '3.7.2', {"requires": ["base-build", "widget"]});+}, '3.7.3', {"requires": ["base-build", "widget"]});
bundle/widget-htmlparser/assets/widget-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-htmlparser/widget-htmlparser-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-htmlparser/widget-htmlparser.js", code: [] };-_yuitest_coverage["build/widget-htmlparser/widget-htmlparser.js"].code=["YUI.add('widget-htmlparser', function (Y, NAME) {","","/**"," * Adds HTML Parser support to the base Widget class"," *"," * @module widget"," * @submodule widget-htmlparser"," * @for Widget"," */","","var Widget = Y.Widget,"," Node = Y.Node,"," Lang = Y.Lang,",""," SRC_NODE = \"srcNode\","," CONTENT_BOX = \"contentBox\";","","/**"," * Object hash, defining how attribute values are to be parsed from"," * markup contained in the widget's content box. e.g.:"," * <pre>"," * {"," * // Set single Node references using selector syntax "," * // (selector is run through node.one)"," * titleNode: \"span.yui-title\","," * // Set NodeList references using selector syntax "," * // (array indicates selector is to be run through node.all)"," * listNodes: [\"li.yui-item\"],"," * // Set other attribute types, using a parse function. "," * // Context is set to the widget instance."," * label: function(contentBox) {"," * return contentBox.one(\"span.title\").get(\"innerHTML\");"," * }"," * }"," * </pre>"," * "," * @property HTML_PARSER"," * @type Object"," * @static"," */","Widget.HTML_PARSER = {};","","/**"," * The build configuration for the Widget class."," * <p>"," * Defines the static fields which need to be aggregated,"," * when this class is used as the main class passed to "," * the <a href=\"Base.html#method_build\">Base.build</a> method."," * </p>"," * @property _buildCfg"," * @type Object"," * @static"," * @final"," * @private"," */","Widget._buildCfg = {"," aggregates : [\"HTML_PARSER\"]","};","","/**"," * The DOM node to parse for configuration values, passed to the Widget's HTML_PARSER definition"," *"," * @attribute srcNode"," * @type String | Node"," * @writeOnce"," */","Widget.ATTRS[SRC_NODE] = {"," value: null,"," setter: Node.one,"," getter: \"_getSrcNode\","," writeOnce: true","};","","Y.mix(Widget.prototype, {",""," /**"," * @method _getSrcNode"," * @protected"," * @return {Node} The Node to apply HTML_PARSER to"," */"," _getSrcNode : function(val) {"," return val || this.get(CONTENT_BOX);"," },",""," /**"," * @method _applyParsedConfig"," * @protected"," * @return {Object} The merged configuration literal"," */"," _applyParsedConfig : function(node, cfg, parsedCfg) {"," return (parsedCfg) ? Y.mix(cfg, parsedCfg, false) : cfg;"," },",""," /**"," * Utility method used to apply the <code>HTML_PARSER</code> configuration for the "," * instance, to retrieve config data values."," *"," * @method _applyParser"," * @protected"," * @param config {Object} User configuration object (will be populated with values from Node) "," */"," _applyParser : function(config) {",""," var widget = this,"," srcNode = this._getNodeToParse(),"," schema = widget._getHtmlParser(),"," parsedConfig,"," val;",""," if (schema && srcNode) {"," Y.Object.each(schema, function(v, k, o) {"," val = null;",""," if (Lang.isFunction(v)) {"," val = v.call(widget, srcNode);"," } else {"," if (Lang.isArray(v)) {"," val = srcNode.all(v[0]);"," if (val.isEmpty()) {"," val = null;"," }"," } else {"," val = srcNode.one(v);"," }"," }",""," if (val !== null && val !== undefined) {"," parsedConfig = parsedConfig || {};"," parsedConfig[k] = val;"," }"," });"," }"," config = widget._applyParsedConfig(srcNode, config, parsedConfig);"," },",""," /**"," * Determines whether we have a node reference which we should try and parse."," * "," * The current implementation does not parse nodes generated from CONTENT_TEMPLATE,"," * only explicitly set srcNode, or contentBox attributes."," * "," * @method _getNodeToParse"," * @return {Node} The node reference to apply HTML_PARSER to."," * @private"," */"," _getNodeToParse : function() {"," var srcNode = this.get(\"srcNode\");"," return (!this._cbFromTemplate) ? srcNode : null;"," },",""," /**"," * Gets the HTML_PARSER definition for this instance, by merging HTML_PARSER"," * definitions across the class hierarchy."," *"," * @private"," * @method _getHtmlParser"," * @return {Object} HTML_PARSER definition for this instance"," */"," _getHtmlParser : function() {"," // Removed caching for kweight. This is a private method"," // and only called once so don't need to cache HTML_PARSER"," var classes = this._getClasses(),"," parser = {},"," i, p;",""," for (i = classes.length - 1; i >= 0; i--) {"," p = classes[i].HTML_PARSER;"," if (p) {"," Y.mix(parser, p, true);"," }"," }"," return parser;"," }","});","","","}, '3.7.2', {\"requires\": [\"widget-base\"]});"];+_yuitest_coverage["build/widget-htmlparser/widget-htmlparser.js"].code=["YUI.add('widget-htmlparser', function (Y, NAME) {","","/**"," * Adds HTML Parser support to the base Widget class"," *"," * @module widget"," * @submodule widget-htmlparser"," * @for Widget"," */","","var Widget = Y.Widget,"," Node = Y.Node,"," Lang = Y.Lang,",""," SRC_NODE = \"srcNode\","," CONTENT_BOX = \"contentBox\";","","/**"," * Object hash, defining how attribute values are to be parsed from"," * markup contained in the widget's content box. e.g.:"," * <pre>"," * {"," * // Set single Node references using selector syntax "," * // (selector is run through node.one)"," * titleNode: \"span.yui-title\","," * // Set NodeList references using selector syntax "," * // (array indicates selector is to be run through node.all)"," * listNodes: [\"li.yui-item\"],"," * // Set other attribute types, using a parse function. "," * // Context is set to the widget instance."," * label: function(contentBox) {"," * return contentBox.one(\"span.title\").get(\"innerHTML\");"," * }"," * }"," * </pre>"," * "," * @property HTML_PARSER"," * @type Object"," * @static"," */","Widget.HTML_PARSER = {};","","/**"," * The build configuration for the Widget class."," * <p>"," * Defines the static fields which need to be aggregated,"," * when this class is used as the main class passed to "," * the <a href=\"Base.html#method_build\">Base.build</a> method."," * </p>"," * @property _buildCfg"," * @type Object"," * @static"," * @final"," * @private"," */","Widget._buildCfg = {"," aggregates : [\"HTML_PARSER\"]","};","","/**"," * The DOM node to parse for configuration values, passed to the Widget's HTML_PARSER definition"," *"," * @attribute srcNode"," * @type String | Node"," * @writeOnce"," */","Widget.ATTRS[SRC_NODE] = {"," value: null,"," setter: Node.one,"," getter: \"_getSrcNode\","," writeOnce: true","};","","Y.mix(Widget.prototype, {",""," /**"," * @method _getSrcNode"," * @protected"," * @return {Node} The Node to apply HTML_PARSER to"," */"," _getSrcNode : function(val) {"," return val || this.get(CONTENT_BOX);"," },",""," /**"," * @method _applyParsedConfig"," * @protected"," * @return {Object} The merged configuration literal"," */"," _applyParsedConfig : function(node, cfg, parsedCfg) {"," return (parsedCfg) ? Y.mix(cfg, parsedCfg, false) : cfg;"," },",""," /**"," * Utility method used to apply the <code>HTML_PARSER</code> configuration for the "," * instance, to retrieve config data values."," *"," * @method _applyParser"," * @protected"," * @param config {Object} User configuration object (will be populated with values from Node) "," */"," _applyParser : function(config) {",""," var widget = this,"," srcNode = this._getNodeToParse(),"," schema = widget._getHtmlParser(),"," parsedConfig,"," val;",""," if (schema && srcNode) {"," Y.Object.each(schema, function(v, k, o) {"," val = null;",""," if (Lang.isFunction(v)) {"," val = v.call(widget, srcNode);"," } else {"," if (Lang.isArray(v)) {"," val = srcNode.all(v[0]);"," if (val.isEmpty()) {"," val = null;"," }"," } else {"," val = srcNode.one(v);"," }"," }",""," if (val !== null && val !== undefined) {"," parsedConfig = parsedConfig || {};"," parsedConfig[k] = val;"," }"," });"," }"," config = widget._applyParsedConfig(srcNode, config, parsedConfig);"," },",""," /**"," * Determines whether we have a node reference which we should try and parse."," * "," * The current implementation does not parse nodes generated from CONTENT_TEMPLATE,"," * only explicitly set srcNode, or contentBox attributes."," * "," * @method _getNodeToParse"," * @return {Node} The node reference to apply HTML_PARSER to."," * @private"," */"," _getNodeToParse : function() {"," var srcNode = this.get(\"srcNode\");"," return (!this._cbFromTemplate) ? srcNode : null;"," },",""," /**"," * Gets the HTML_PARSER definition for this instance, by merging HTML_PARSER"," * definitions across the class hierarchy."," *"," * @private"," * @method _getHtmlParser"," * @return {Object} HTML_PARSER definition for this instance"," */"," _getHtmlParser : function() {"," // Removed caching for kweight. This is a private method"," // and only called once so don't need to cache HTML_PARSER"," var classes = this._getClasses(),"," parser = {},"," i, p;",""," for (i = classes.length - 1; i >= 0; i--) {"," p = classes[i].HTML_PARSER;"," if (p) {"," Y.mix(parser, p, true);"," }"," }"," return parser;"," }","});","","","}, '3.7.3', {\"requires\": [\"widget-base\"]});"]; _yuitest_coverage["build/widget-htmlparser/widget-htmlparser.js"].lines = {"1":0,"11":0,"41":0,"56":0,"67":0,"74":0,"82":0,"91":0,"104":0,"110":0,"111":0,"112":0,"114":0,"115":0,"117":0,"118":0,"119":0,"120":0,"123":0,"127":0,"128":0,"129":0,"133":0,"147":0,"148":0,"162":0,"166":0,"167":0,"168":0,"169":0,"172":0}; _yuitest_coverage["build/widget-htmlparser/widget-htmlparser.js"].functions = {"_getSrcNode:81":0,"_applyParsedConfig:90":0,"(anonymous 2):111":0,"_applyParser:102":0,"_getNodeToParse:146":0,"_getHtmlParser:159":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-htmlparser/widget-htmlparser.js"].coveredLines = 31;@@ -251,4 +251,4 @@ }); -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-htmlparser/widget-htmlparser-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -180,4 +180,4 @@ }); -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-htmlparser/widget-htmlparser-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-htmlparser",function(e,t){var n=e.Widget,r=e.Node,i=e.Lang,s="srcNode",o="contentBox";n.HTML_PARSER={},n._buildCfg={aggregates:["HTML_PARSER"]},n.ATTRS[s]={value:null,setter:r.one,getter:"_getSrcNode",writeOnce:!0},e.mix(n.prototype,{_getSrcNode:function(e){return e||this.get(o)},_applyParsedConfig:function(t,n,r){return r?e.mix(n,r,!1):n},_applyParser:function(t){var n=this,r=this._getNodeToParse(),s=n._getHtmlParser(),o,u;s&&r&&e.Object.each(s,function(e,t,s){u=null,i.isFunction(e)?u=e.call(n,r):i.isArray(e)?(u=r.all(e[0]),u.isEmpty()&&(u=null)):u=r.one(e),u!==null&&u!==undefined&&(o=o||{},o[t]=u)}),t=n._applyParsedConfig(r,t,o)},_getNodeToParse:function(){var e=this.get("srcNode");return this._cbFromTemplate?null:e},_getHtmlParser:function(){var t=this._getClasses(),n={},r,i;for(r=t.length-1;r>=0;r--)i=t[r].HTML_PARSER,i&&e.mix(n,i,!0);return n}})},"3.7.2",{requires:["widget-base"]});+YUI.add("widget-htmlparser",function(e,t){var n=e.Widget,r=e.Node,i=e.Lang,s="srcNode",o="contentBox";n.HTML_PARSER={},n._buildCfg={aggregates:["HTML_PARSER"]},n.ATTRS[s]={value:null,setter:r.one,getter:"_getSrcNode",writeOnce:!0},e.mix(n.prototype,{_getSrcNode:function(e){return e||this.get(o)},_applyParsedConfig:function(t,n,r){return r?e.mix(n,r,!1):n},_applyParser:function(t){var n=this,r=this._getNodeToParse(),s=n._getHtmlParser(),o,u;s&&r&&e.Object.each(s,function(e,t,s){u=null,i.isFunction(e)?u=e.call(n,r):i.isArray(e)?(u=r.all(e[0]),u.isEmpty()&&(u=null)):u=r.one(e),u!==null&&u!==undefined&&(o=o||{},o[t]=u)}),t=n._applyParsedConfig(r,t,o)},_getNodeToParse:function(){var e=this.get("srcNode");return this._cbFromTemplate?null:e},_getHtmlParser:function(){var t=this._getClasses(),n={},r,i;for(r=t.length-1;r>=0;r--)i=t[r].HTML_PARSER,i&&e.mix(n,i,!0);return n}})},"3.7.3",{requires:["widget-base"]});
bundle/widget-htmlparser/widget-htmlparser.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -180,4 +180,4 @@ }); -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-locale/assets/widget-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-locale/widget-locale-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-locale/widget-locale.js", code: [] };-_yuitest_coverage["build/widget-locale/widget-locale.js"].code=["YUI.add('widget-locale', function (Y, NAME) {","","/**"," * Provides string support for widget with BCP 47 language tag lookup. This module has been deprecated. It's replaced by the \"intl\" module which provides generic internationalization and BCP 47 language tag support with externalization."," *"," * @module widget-locale"," * @deprecated This module has been deprecated. It's replaced by the \"intl\" module which provides generic internationalization and BCP 47 language tag support with externalization."," */","var TRUE = true,"," LOCALE = \"locale\","," INIT_VALUE = \"initValue\","," HYPHEN = \"-\","," EMPTY_STR = \"\","," Widget = Y.Widget;","","/**"," * @attribute locale"," * @deprecated Use Y.config.lang and Y.Intl externalization support"," * @description"," * The default locale for the widget. NOTE: Using get/set on the \"strings\" attribute will"," * return/set strings for this locale."," * @default \"en\""," * @type String"," */","Widget.ATTRS[LOCALE] = {"," value: \"en\"","};","","// Since strings support with locale needs the private _strs setup","Widget.ATTRS.strings.lazyAdd = false;","","Y.mix(Widget.prototype, {",""," /**"," * Sets strings for a particular locale, merging with any existing"," * strings which may already be defined for the locale."," *"," * @method _setStrings"," * @protected"," * @param {Object} strings The hash of string key/values to set"," * @param {Object} locale The locale for the string values being set"," */"," _setStrings : function(strings, locale) {"," var strs = this._strs;"," locale = locale.toLowerCase();",""," if (!strs[locale]) {"," strs[locale] = {};"," }",""," Y.aggregate(strs[locale], strings, TRUE);"," return strs[locale];"," },",""," /**"," * Returns the strings key/value hash for a paricular locale, without locale lookup applied."," *"," * @method _getStrings"," * @protected"," * @param {Object} locale"," */"," _getStrings : function(locale) {"," return this._strs[locale.toLowerCase()];"," },",""," /**"," * Gets the entire strings hash for a particular locale, performing locale lookup."," * <p>"," * If no values of the key are defined for a particular locale the value for the "," * default locale (in initial locale set for the class) is returned."," * </p>"," * @method getStrings"," * @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided."," */"," // TODO: Optimize/Cache. Clear cache on _setStrings call."," getStrings : function(locale) {"," "," locale = (locale || this.get(LOCALE)).toLowerCase();"," "," "," var defLocale = this.getDefaultLocale().toLowerCase(),"," defStrs = this._getStrings(defLocale),"," strs = (defStrs) ? Y.merge(defStrs) : {},"," localeSegments = locale.split(HYPHEN),"," localeStrs,"," i, l,"," lookup;"," "," // If locale is different than the default, or needs lookup support"," if (locale !== defLocale || localeSegments.length > 1) {"," lookup = EMPTY_STR;"," for (i = 0, l = localeSegments.length; i < l; ++i) {"," lookup += localeSegments[i];"," "," "," localeStrs = this._getStrings(lookup);"," if (localeStrs) {"," Y.aggregate(strs, localeStrs, TRUE);"," }"," lookup += HYPHEN;"," }"," }"," "," return strs;"," },"," "," /**"," * Gets the string for a particular key, for a particular locale, performing locale lookup."," * <p>"," * If no values if defined for the key, for the given locale, the value for the "," * default locale (in initial locale set for the class) is returned."," * </p>"," * @method getString"," * @param {String} key The key."," * @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided."," */"," getString : function(key, locale) {",""," locale = (locale || this.get(LOCALE)).toLowerCase();"," "," "," var defLocale = (this.getDefaultLocale()).toLowerCase(),"," strs = this._getStrings(defLocale) || {},"," str = strs[key],"," idx = locale.lastIndexOf(HYPHEN);"," "," // If locale is different than the default, or needs lookup support"," if (locale !== defLocale || idx != -1) {"," do {"," "," strs = this._getStrings(locale);"," if (strs && key in strs) {"," str = strs[key];"," break;"," }"," idx = locale.lastIndexOf(HYPHEN);"," // Chop of last locale segment"," if (idx != -1) {"," locale = locale.substring(0, idx);"," }"," "," } while (idx != -1);"," }"," "," return str;"," },",""," /**"," * Returns the default locale for the widget (the locale value defined by the"," * widget class, or provided by the user during construction)."," *"," * @method getDefaultLocale"," * @return {String} The default locale for the widget"," */"," getDefaultLocale : function() {"," return this._state.get(LOCALE, INIT_VALUE);"," },"," "," _strSetter : function(val) {"," return this._setStrings(val, this.get(LOCALE));"," },",""," _strGetter : function(val) {"," return this._getStrings(this.get(LOCALE));"," }","}, true);","","","}, '3.7.2', {\"requires\": [\"widget-base\"]});"];+_yuitest_coverage["build/widget-locale/widget-locale.js"].code=["YUI.add('widget-locale', function (Y, NAME) {","","/**"," * Provides string support for widget with BCP 47 language tag lookup. This module has been deprecated. It's replaced by the \"intl\" module which provides generic internationalization and BCP 47 language tag support with externalization."," *"," * @module widget-locale"," * @deprecated This module has been deprecated. It's replaced by the \"intl\" module which provides generic internationalization and BCP 47 language tag support with externalization."," */","var TRUE = true,"," LOCALE = \"locale\","," INIT_VALUE = \"initValue\","," HYPHEN = \"-\","," EMPTY_STR = \"\","," Widget = Y.Widget;","","/**"," * @attribute locale"," * @deprecated Use Y.config.lang and Y.Intl externalization support"," * @description"," * The default locale for the widget. NOTE: Using get/set on the \"strings\" attribute will"," * return/set strings for this locale."," * @default \"en\""," * @type String"," */","Widget.ATTRS[LOCALE] = {"," value: \"en\"","};","","// Since strings support with locale needs the private _strs setup","Widget.ATTRS.strings.lazyAdd = false;","","Y.mix(Widget.prototype, {",""," /**"," * Sets strings for a particular locale, merging with any existing"," * strings which may already be defined for the locale."," *"," * @method _setStrings"," * @protected"," * @param {Object} strings The hash of string key/values to set"," * @param {Object} locale The locale for the string values being set"," */"," _setStrings : function(strings, locale) {"," var strs = this._strs;"," locale = locale.toLowerCase();",""," if (!strs[locale]) {"," strs[locale] = {};"," }",""," Y.aggregate(strs[locale], strings, TRUE);"," return strs[locale];"," },",""," /**"," * Returns the strings key/value hash for a paricular locale, without locale lookup applied."," *"," * @method _getStrings"," * @protected"," * @param {Object} locale"," */"," _getStrings : function(locale) {"," return this._strs[locale.toLowerCase()];"," },",""," /**"," * Gets the entire strings hash for a particular locale, performing locale lookup."," * <p>"," * If no values of the key are defined for a particular locale the value for the "," * default locale (in initial locale set for the class) is returned."," * </p>"," * @method getStrings"," * @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided."," */"," // TODO: Optimize/Cache. Clear cache on _setStrings call."," getStrings : function(locale) {"," "," locale = (locale || this.get(LOCALE)).toLowerCase();"," "," "," var defLocale = this.getDefaultLocale().toLowerCase(),"," defStrs = this._getStrings(defLocale),"," strs = (defStrs) ? Y.merge(defStrs) : {},"," localeSegments = locale.split(HYPHEN),"," localeStrs,"," i, l,"," lookup;"," "," // If locale is different than the default, or needs lookup support"," if (locale !== defLocale || localeSegments.length > 1) {"," lookup = EMPTY_STR;"," for (i = 0, l = localeSegments.length; i < l; ++i) {"," lookup += localeSegments[i];"," "," "," localeStrs = this._getStrings(lookup);"," if (localeStrs) {"," Y.aggregate(strs, localeStrs, TRUE);"," }"," lookup += HYPHEN;"," }"," }"," "," return strs;"," },"," "," /**"," * Gets the string for a particular key, for a particular locale, performing locale lookup."," * <p>"," * If no values if defined for the key, for the given locale, the value for the "," * default locale (in initial locale set for the class) is returned."," * </p>"," * @method getString"," * @param {String} key The key."," * @param {String} locale (optional) The locale for which the string value is required. Defaults to the current locale, if not provided."," */"," getString : function(key, locale) {",""," locale = (locale || this.get(LOCALE)).toLowerCase();"," "," "," var defLocale = (this.getDefaultLocale()).toLowerCase(),"," strs = this._getStrings(defLocale) || {},"," str = strs[key],"," idx = locale.lastIndexOf(HYPHEN);"," "," // If locale is different than the default, or needs lookup support"," if (locale !== defLocale || idx != -1) {"," do {"," "," strs = this._getStrings(locale);"," if (strs && key in strs) {"," str = strs[key];"," break;"," }"," idx = locale.lastIndexOf(HYPHEN);"," // Chop of last locale segment"," if (idx != -1) {"," locale = locale.substring(0, idx);"," }"," "," } while (idx != -1);"," }"," "," return str;"," },",""," /**"," * Returns the default locale for the widget (the locale value defined by the"," * widget class, or provided by the user during construction)."," *"," * @method getDefaultLocale"," * @return {String} The default locale for the widget"," */"," getDefaultLocale : function() {"," return this._state.get(LOCALE, INIT_VALUE);"," },"," "," _strSetter : function(val) {"," return this._setStrings(val, this.get(LOCALE));"," },",""," _strGetter : function(val) {"," return this._getStrings(this.get(LOCALE));"," }","}, true);","","","}, '3.7.3', {\"requires\": [\"widget-base\"]});"]; _yuitest_coverage["build/widget-locale/widget-locale.js"].lines = {"1":0,"9":0,"25":0,"30":0,"32":0,"44":0,"45":0,"47":0,"48":0,"51":0,"52":0,"63":0,"78":0,"81":0,"90":0,"91":0,"92":0,"93":0,"96":0,"97":0,"98":0,"100":0,"104":0,"119":0,"122":0,"128":0,"129":0,"131":0,"132":0,"133":0,"134":0,"136":0,"138":0,"139":0,"145":0,"156":0,"160":0,"164":0}; _yuitest_coverage["build/widget-locale/widget-locale.js"].functions = {"_setStrings:43":0,"_getStrings:62":0,"getStrings:76":0,"getString:117":0,"getDefaultLocale:155":0,"_strSetter:159":0,"_strGetter:163":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-locale/widget-locale.js"].coveredLines = 38;@@ -251,4 +251,4 @@ }, true); -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-locale/widget-locale-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -176,4 +176,4 @@ }, true); -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-locale/widget-locale-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-locale",function(e,t){var n=!0,r="locale",i="initValue",s="-",o="",u=e.Widget;u.ATTRS[r]={value:"en"},u.ATTRS.strings.lazyAdd=!1,e.mix(u.prototype,{_setStrings:function(t,r){var i=this._strs;return r=r.toLowerCase(),i[r]||(i[r]={}),e.aggregate(i[r],t,n),i[r]},_getStrings:function(e){return this._strs[e.toLowerCase()]},getStrings:function(t){t=(t||this.get(r)).toLowerCase();var i=this.getDefaultLocale().toLowerCase(),u=this._getStrings(i),a=u?e.merge(u):{},f=t.split(s),l,c,h,p;if(t!==i||f.length>1){p=o;for(c=0,h=f.length;c<h;++c)p+=f[c],l=this._getStrings(p),l&&e.aggregate(a,l,n),p+=s}return a},getString:function(e,t){t=(t||this.get(r)).toLowerCase();var n=this.getDefaultLocale().toLowerCase(),i=this._getStrings(n)||{},o=i[e],u=t.lastIndexOf(s);if(t!==n||u!=-1)do{i=this._getStrings(t);if(i&&e in i){o=i[e];break}u=t.lastIndexOf(s),u!=-1&&(t=t.substring(0,u))}while(u!=-1);return o},getDefaultLocale:function(){return this._state.get(r,i)},_strSetter:function(e){return this._setStrings(e,this.get(r))},_strGetter:function(e){return this._getStrings(this.get(r))}},!0)},"3.7.2",{requires:["widget-base"]});+YUI.add("widget-locale",function(e,t){var n=!0,r="locale",i="initValue",s="-",o="",u=e.Widget;u.ATTRS[r]={value:"en"},u.ATTRS.strings.lazyAdd=!1,e.mix(u.prototype,{_setStrings:function(t,r){var i=this._strs;return r=r.toLowerCase(),i[r]||(i[r]={}),e.aggregate(i[r],t,n),i[r]},_getStrings:function(e){return this._strs[e.toLowerCase()]},getStrings:function(t){t=(t||this.get(r)).toLowerCase();var i=this.getDefaultLocale().toLowerCase(),u=this._getStrings(i),a=u?e.merge(u):{},f=t.split(s),l,c,h,p;if(t!==i||f.length>1){p=o;for(c=0,h=f.length;c<h;++c)p+=f[c],l=this._getStrings(p),l&&e.aggregate(a,l,n),p+=s}return a},getString:function(e,t){t=(t||this.get(r)).toLowerCase();var n=this.getDefaultLocale().toLowerCase(),i=this._getStrings(n)||{},o=i[e],u=t.lastIndexOf(s);if(t!==n||u!=-1)do{i=this._getStrings(t);if(i&&e in i){o=i[e];break}u=t.lastIndexOf(s),u!=-1&&(t=t.substring(0,u))}while(u!=-1);return o},getDefaultLocale:function(){return this._state.get(r,i)},_strSetter:function(e){return this._setStrings(e,this.get(r))},_strGetter:function(e){return this._getStrings(this.get(r))}},!0)},"3.7.3",{requires:["widget-base"]});
bundle/widget-locale/widget-locale.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -172,4 +172,4 @@ }, true); -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-modality/assets/skins/night/widget-modality-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-modality/assets/skins/night/widget-modality.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-modality/assets/skins/sam/widget-modality-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-modality/assets/skins/sam/widget-modality.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-modality/assets/widget-modality-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-modality/widget-modality-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-modality/widget-modality.js", code: [] };-_yuitest_coverage["build/widget-modality/widget-modality.js"].code=["YUI.add('widget-modality', function (Y, NAME) {","","/**"," * Provides modality support for Widgets, though an extension"," *"," * @module widget-modality"," */","","var WIDGET = 'widget',"," RENDER_UI = 'renderUI',"," BIND_UI = 'bindUI',"," SYNC_UI = 'syncUI',"," BOUNDING_BOX = 'boundingBox',"," CONTENT_BOX = 'contentBox',"," VISIBLE = 'visible',"," Z_INDEX = 'zIndex',"," CHANGE = 'Change',"," isBoolean = Y.Lang.isBoolean,"," getCN = Y.ClassNameManager.getClassName,"," MaskShow = \"maskShow\","," MaskHide = \"maskHide\","," ClickOutside = \"clickoutside\","," FocusOutside = \"focusoutside\",",""," supportsPosFixed = (function(){",""," /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */",""," var doc = Y.config.doc,"," isSupported = null,"," el, root;",""," if (doc.createElement) {"," el = doc.createElement('div');"," if (el && el.style) {"," el.style.position = 'fixed';"," el.style.top = '10px';"," root = doc.body;"," if (root && root.appendChild && root.removeChild) {"," root.appendChild(el);"," isSupported = (el.offsetTop === 10);"," root.removeChild(el);"," }"," }"," }",""," return isSupported;"," }());",""," /**"," * Widget extension, which can be used to add modality support to the base Widget class,"," * through the Base.create method."," *"," * @class WidgetModality"," * @param {Object} config User configuration object"," */"," function WidgetModal(config) {}",""," var MODAL = 'modal',"," MASK = 'mask',"," MODAL_CLASSES = {"," modal : getCN(WIDGET, MODAL),"," mask : getCN(WIDGET, MASK)"," };",""," /**"," * Static property used to define the default attribute"," * configuration introduced by WidgetModality."," *"," * @property ATTRS"," * @static"," * @type Object"," */"," WidgetModal.ATTRS = {"," /**"," * @attribute maskNode"," * @type Y.Node"," *"," * @description Returns a Y.Node instance of the node being used as the mask."," */"," maskNode : {"," getter : '_getMaskNode',"," readOnly : true"," },","",""," /**"," * @attribute modal"," * @type boolean"," *"," * @description Whether the widget should be modal or not."," */"," modal: {"," value:false,"," validator: isBoolean"," },",""," /**"," * @attribute focusOn"," * @type array"," *"," * @description An array of objects corresponding to the nodes and events that will trigger a re-focus back on the widget."," * The implementer can supply an array of objects, with each object having the following properties:"," * <p>eventName: (string, required): The eventName to listen to.</p>"," * <p>node: (Y.Node, optional): The Y.Node that will fire the event (defaults to the boundingBox of the widget)</p>"," * <p>By default, this attribute consists of two objects which will cause the widget to re-focus if anything"," * outside the widget is clicked on or focussed upon.</p>"," */"," focusOn: {"," valueFn: function() {"," return ["," {"," // node: this.get(BOUNDING_BOX),"," eventName: ClickOutside"," },"," {"," //node: this.get(BOUNDING_BOX),"," eventName: FocusOutside"," }"," ];"," },",""," validator: Y.Lang.isArray"," }",""," };","",""," WidgetModal.CLASSES = MODAL_CLASSES;","",""," /**"," * Returns the mask if it exists on the page - otherwise creates a mask. There's only"," * one mask on a page at a given time."," * <p>"," * This method in invoked internally by the getter of the maskNode ATTR."," * </p>"," * @method _GET_MASK"," * @static"," */"," WidgetModal._GET_MASK = function() {",""," var mask = Y.one('.' + MODAL_CLASSES.mask),"," win = Y.one('win');",""," if (mask) {"," return mask;"," }",""," mask = Y.Node.create('<div></div>').addClass(MODAL_CLASSES.mask);",""," if (supportsPosFixed) {"," mask.setStyles({"," position: 'fixed',"," width : '100%',"," height : '100%',"," top : '0',"," left : '0',"," display : 'block'"," });"," } else {"," mask.setStyles({"," position: 'absolute',"," width : win.get('winWidth') +'px',"," height : win.get('winHeight') + 'px',"," top : '0',"," left : '0',"," display : 'block'"," });"," }",""," return mask;"," };",""," /**"," * A stack of Y.Widget objects representing the current hierarchy of modal widgets presently displayed on the screen"," * @property STACK"," */"," WidgetModal.STACK = [];","",""," WidgetModal.prototype = {",""," initializer: function () {"," Y.after(this._renderUIModal, this, RENDER_UI);"," Y.after(this._syncUIModal, this, SYNC_UI);"," Y.after(this._bindUIModal, this, BIND_UI);"," },",""," destructor: function () {"," // Hack to remove this thing from the STACK."," this._uiSetHostVisibleModal(false);"," },",""," // *** Instance Members *** //",""," _uiHandlesModal: null,","",""," /**"," * Adds modal class to the bounding box of the widget"," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIModal"," * @protected"," */"," _renderUIModal : function () {",""," var bb = this.get(BOUNDING_BOX);"," //cb = this.get(CONTENT_BOX);",""," //this makes the content box content appear over the mask"," // cb.setStyles({"," // position: \"\""," // });",""," this._repositionMask(this);"," bb.addClass(MODAL_CLASSES.modal);",""," },","",""," /**"," * Hooks up methods to be executed when the widget's visibility or z-index changes"," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIModal"," * @protected"," */"," _bindUIModal : function () {",""," this.after(VISIBLE+CHANGE, this._afterHostVisibleChangeModal);"," this.after(Z_INDEX+CHANGE, this._afterHostZIndexChangeModal);"," this.after(\"focusOnChange\", this._afterFocusOnChange);",""," // Re-align the mask in the viewport if `position: fixed;` is not"," // supported. iOS < 5 and Android < 3 don't actually support it even"," // though they both pass the feature test; the UA sniff is here to"," // account for that. Ideally this should be replaced with a better"," // feature test."," if (!supportsPosFixed ||"," (Y.UA.ios && Y.UA.ios < 5) ||"," (Y.UA.android && Y.UA.android < 3)) {",""," Y.one('win').on('scroll', this._resyncMask, this);"," }"," },",""," /**"," * Syncs the mask with the widget's current state, namely the visibility and z-index of the widget"," * <p>"," * This method in invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIModal"," * @protected"," */"," _syncUIModal : function () {",""," //var host = this.get(HOST);",""," this._uiSetHostVisibleModal(this.get(VISIBLE));"," this._uiSetHostZIndexModal(this.get(Z_INDEX));",""," },",""," /**"," * Provides mouse and tab focus to the widget's bounding box."," *"," * @method _focus"," */"," _focus : function (e) {",""," var bb = this.get(BOUNDING_BOX),"," oldTI = bb.get('tabIndex');",""," bb.set('tabIndex', oldTI >= 0 ? oldTI : 0);"," this.focus();"," },"," /**"," * Blurs the widget."," *"," * @method _blur"," */"," _blur : function () {",""," this.blur();"," },",""," /**"," * Returns the Y.Node instance of the maskNode"," *"," * @method _getMaskNode"," * @return {Node} The Y.Node instance of the mask, as returned from WidgetModal._GET_MASK"," */"," _getMaskNode : function () {",""," return WidgetModal._GET_MASK();"," },",""," /**"," * Performs events attaching/detaching, stack shifting and mask repositioning based on the visibility of the widget"," *"," * @method _uiSetHostVisibleModal"," * @param {boolean} Whether the widget is visible or not"," */"," _uiSetHostVisibleModal : function (visible) {"," var stack = WidgetModal.STACK,"," maskNode = this.get('maskNode'),"," isModal = this.get('modal'),"," topModal, index;",""," if (visible) {",""," Y.Array.each(stack, function(modal){"," modal._detachUIHandlesModal();"," modal._blur();"," });",""," // push on top of stack"," stack.unshift(this);",""," this._repositionMask(this);"," this._uiSetHostZIndexModal(this.get(Z_INDEX));",""," if (isModal) {"," maskNode.show();"," Y.later(1, this, '_attachUIHandlesModal');"," this._focus();"," }","",""," } else {",""," index = Y.Array.indexOf(stack, this);"," if (index >= 0) {"," // Remove modal widget from global stack."," stack.splice(index, 1);"," }",""," this._detachUIHandlesModal();"," this._blur();",""," if (stack.length) {"," topModal = stack[0];"," this._repositionMask(topModal);"," //topModal._attachUIHandlesModal();"," topModal._uiSetHostZIndexModal(topModal.get(Z_INDEX));",""," if (topModal.get('modal')) {"," //topModal._attachUIHandlesModal();"," Y.later(1, topModal, '_attachUIHandlesModal');"," topModal._focus();"," }",""," } else {",""," if (maskNode.getStyle('display') === 'block') {"," maskNode.hide();"," }",""," }",""," }"," },",""," /**"," * Sets the z-index of the mask node."," *"," * @method _uiSetHostZIndexModal"," * @param {Number} Z-Index of the widget"," */"," _uiSetHostZIndexModal : function (zIndex) {",""," if (this.get('modal')) {"," this.get('maskNode').setStyle(Z_INDEX, zIndex || 0);"," }",""," },",""," /**"," * Attaches UI Listeners for \"clickoutside\" and \"focusoutside\" on the"," * widget. When these events occur, and the widget is modal, focus is"," * shifted back onto the widget."," *"," * @method _attachUIHandlesModal"," */"," _attachUIHandlesModal : function () {",""," if (this._uiHandlesModal || WidgetModal.STACK[0] !== this) {"," // Quit early if we have ui handles, or if we not at the top"," // of the global stack."," return;"," }",""," var bb = this.get(BOUNDING_BOX),"," maskNode = this.get('maskNode'),"," focusOn = this.get('focusOn'),"," focus = Y.bind(this._focus, this),"," uiHandles = [],"," i, len, o;",""," for (i = 0, len = focusOn.length; i < len; i++) {",""," o = {};"," o.node = focusOn[i].node;"," o.ev = focusOn[i].eventName;"," o.keyCode = focusOn[i].keyCode;",""," //no keycode or node defined"," if (!o.node && !o.keyCode && o.ev) {"," uiHandles.push(bb.on(o.ev, focus));"," }",""," //node defined, no keycode (not a keypress)"," else if (o.node && !o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, focus));"," }",""," //node defined, keycode defined, event defined (its a key press)"," else if (o.node && o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, focus, o.keyCode));"," }",""," else {"," Y.Log('focusOn ATTR Error: The event with name \"'+o.ev+'\" could not be attached.');"," }",""," }",""," if ( ! supportsPosFixed) {"," uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){"," maskNode.setStyle('top', maskNode.get('docScrollY'));"," }, this)));"," }",""," this._uiHandlesModal = uiHandles;"," },",""," /**"," * Detaches all UI Listeners that were set in _attachUIHandlesModal from the widget."," *"," * @method _detachUIHandlesModal"," */"," _detachUIHandlesModal : function () {"," Y.each(this._uiHandlesModal, function(h){"," h.detach();"," });"," this._uiHandlesModal = null;"," },",""," /**"," * Default function that is called when visibility is changed on the widget."," *"," * @method _afterHostVisibleChangeModal"," * @param {EventFacade} e The event facade of the change"," */"," _afterHostVisibleChangeModal : function (e) {",""," this._uiSetHostVisibleModal(e.newVal);"," },",""," /**"," * Default function that is called when z-index is changed on the widget."," *"," * @method _afterHostZIndexChangeModal"," * @param {EventFacade} e The event facade of the change"," */"," _afterHostZIndexChangeModal : function (e) {",""," this._uiSetHostZIndexModal(e.newVal);"," },",""," /**"," * Returns a boolean representing whether the current widget is in a \"nested modality\" state."," * This is done by checking the number of widgets currently on the stack."," *"," * @method isNested"," * @public"," */"," isNested: function() {"," var length = WidgetModal.STACK.length,"," retval = (length > 1) ? true : false;"," return retval;"," },",""," /**"," * Repositions the mask in the DOM for nested modality cases."," *"," * @method _repositionMask"," * @param {Widget} nextElem The Y.Widget instance that will be visible in the stack once the current widget is closed."," */"," _repositionMask: function(nextElem) {",""," var currentModal = this.get('modal'),"," nextModal = nextElem.get('modal'),"," maskNode = this.get('maskNode'),"," bb, bbParent;",""," //if this is modal and host is not modal"," if (currentModal && !nextModal) {"," //leave the mask where it is, since the host is not modal."," maskNode.remove();"," this.fire(MaskHide);"," }",""," //if the main widget is not modal but the host is modal, or both of them are modal"," else if ((!currentModal && nextModal) || (currentModal && nextModal)) {",""," //then remove the mask off DOM, reposition it, and reinsert it into the DOM"," maskNode.remove();"," this.fire(MaskHide);"," bb = nextElem.get(BOUNDING_BOX);"," bbParent = bb.get('parentNode') || Y.one('body');"," bbParent.insert(maskNode, bbParent.get('firstChild'));"," this.fire(MaskShow);"," }",""," },",""," /**"," * Resyncs the mask in the viewport for browsers that don't support fixed positioning"," *"," * @method _resyncMask"," * @param {Y.Widget} nextElem The Y.Widget instance that will be visible in the stack once the current widget is closed."," * @private"," */"," _resyncMask: function (e) {"," var o = e.currentTarget,"," offsetX = o.get('docScrollX'),"," offsetY = o.get('docScrollY'),"," w = o.get('innerWidth') || o.get('winWidth'),"," h = o.get('innerHeight') || o.get('winHeight'),"," mask = this.get('maskNode');",""," mask.setStyles({"," \"top\": offsetY + \"px\","," \"left\": offsetX + \"px\","," \"width\": w + 'px',"," \"height\": h + 'px'"," });"," },",""," /**"," * Default function called when focusOn Attribute is changed. Remove existing listeners and create new listeners."," *"," * @method _afterFocusOnChange"," */"," _afterFocusOnChange : function(e) {"," this._detachUIHandlesModal();",""," if (this.get(VISIBLE)) {"," this._attachUIHandlesModal();"," }"," }"," };",""," Y.WidgetModality = WidgetModal;","","","","}, '3.7.2', {\"requires\": [\"base-build\", \"event-outside\", \"widget\"], \"skinnable\": true});"];+_yuitest_coverage["build/widget-modality/widget-modality.js"].code=["YUI.add('widget-modality', function (Y, NAME) {","","/**"," * Provides modality support for Widgets, though an extension"," *"," * @module widget-modality"," */","","var WIDGET = 'widget',"," RENDER_UI = 'renderUI',"," BIND_UI = 'bindUI',"," SYNC_UI = 'syncUI',"," BOUNDING_BOX = 'boundingBox',"," CONTENT_BOX = 'contentBox',"," VISIBLE = 'visible',"," Z_INDEX = 'zIndex',"," CHANGE = 'Change',"," isBoolean = Y.Lang.isBoolean,"," getCN = Y.ClassNameManager.getClassName,"," MaskShow = \"maskShow\","," MaskHide = \"maskHide\","," ClickOutside = \"clickoutside\","," FocusOutside = \"focusoutside\",",""," supportsPosFixed = (function(){",""," /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */",""," var doc = Y.config.doc,"," isSupported = null,"," el, root;",""," if (doc.createElement) {"," el = doc.createElement('div');"," if (el && el.style) {"," el.style.position = 'fixed';"," el.style.top = '10px';"," root = doc.body;"," if (root && root.appendChild && root.removeChild) {"," root.appendChild(el);"," isSupported = (el.offsetTop === 10);"," root.removeChild(el);"," }"," }"," }",""," return isSupported;"," }());",""," /**"," * Widget extension, which can be used to add modality support to the base Widget class,"," * through the Base.create method."," *"," * @class WidgetModality"," * @param {Object} config User configuration object"," */"," function WidgetModal(config) {}",""," var MODAL = 'modal',"," MASK = 'mask',"," MODAL_CLASSES = {"," modal : getCN(WIDGET, MODAL),"," mask : getCN(WIDGET, MASK)"," };",""," /**"," * Static property used to define the default attribute"," * configuration introduced by WidgetModality."," *"," * @property ATTRS"," * @static"," * @type Object"," */"," WidgetModal.ATTRS = {"," /**"," * @attribute maskNode"," * @type Y.Node"," *"," * @description Returns a Y.Node instance of the node being used as the mask."," */"," maskNode : {"," getter : '_getMaskNode',"," readOnly : true"," },","",""," /**"," * @attribute modal"," * @type boolean"," *"," * @description Whether the widget should be modal or not."," */"," modal: {"," value:false,"," validator: isBoolean"," },",""," /**"," * @attribute focusOn"," * @type array"," *"," * @description An array of objects corresponding to the nodes and events that will trigger a re-focus back on the widget."," * The implementer can supply an array of objects, with each object having the following properties:"," * <p>eventName: (string, required): The eventName to listen to.</p>"," * <p>node: (Y.Node, optional): The Y.Node that will fire the event (defaults to the boundingBox of the widget)</p>"," * <p>By default, this attribute consists of two objects which will cause the widget to re-focus if anything"," * outside the widget is clicked on or focussed upon.</p>"," */"," focusOn: {"," valueFn: function() {"," return ["," {"," // node: this.get(BOUNDING_BOX),"," eventName: ClickOutside"," },"," {"," //node: this.get(BOUNDING_BOX),"," eventName: FocusOutside"," }"," ];"," },",""," validator: Y.Lang.isArray"," }",""," };","",""," WidgetModal.CLASSES = MODAL_CLASSES;","",""," /**"," * Returns the mask if it exists on the page - otherwise creates a mask. There's only"," * one mask on a page at a given time."," * <p>"," * This method in invoked internally by the getter of the maskNode ATTR."," * </p>"," * @method _GET_MASK"," * @static"," */"," WidgetModal._GET_MASK = function() {",""," var mask = Y.one('.' + MODAL_CLASSES.mask),"," win = Y.one('win');",""," if (mask) {"," return mask;"," }",""," mask = Y.Node.create('<div></div>').addClass(MODAL_CLASSES.mask);",""," if (supportsPosFixed) {"," mask.setStyles({"," position: 'fixed',"," width : '100%',"," height : '100%',"," top : '0',"," left : '0',"," display : 'block'"," });"," } else {"," mask.setStyles({"," position: 'absolute',"," width : win.get('winWidth') +'px',"," height : win.get('winHeight') + 'px',"," top : '0',"," left : '0',"," display : 'block'"," });"," }",""," return mask;"," };",""," /**"," * A stack of Y.Widget objects representing the current hierarchy of modal widgets presently displayed on the screen"," * @property STACK"," */"," WidgetModal.STACK = [];","",""," WidgetModal.prototype = {",""," initializer: function () {"," Y.after(this._renderUIModal, this, RENDER_UI);"," Y.after(this._syncUIModal, this, SYNC_UI);"," Y.after(this._bindUIModal, this, BIND_UI);"," },",""," destructor: function () {"," // Hack to remove this thing from the STACK."," this._uiSetHostVisibleModal(false);"," },",""," // *** Instance Members *** //",""," _uiHandlesModal: null,","",""," /**"," * Adds modal class to the bounding box of the widget"," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIModal"," * @protected"," */"," _renderUIModal : function () {",""," var bb = this.get(BOUNDING_BOX);"," //cb = this.get(CONTENT_BOX);",""," //this makes the content box content appear over the mask"," // cb.setStyles({"," // position: \"\""," // });",""," this._repositionMask(this);"," bb.addClass(MODAL_CLASSES.modal);",""," },","",""," /**"," * Hooks up methods to be executed when the widget's visibility or z-index changes"," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIModal"," * @protected"," */"," _bindUIModal : function () {",""," this.after(VISIBLE+CHANGE, this._afterHostVisibleChangeModal);"," this.after(Z_INDEX+CHANGE, this._afterHostZIndexChangeModal);"," this.after(\"focusOnChange\", this._afterFocusOnChange);",""," // Re-align the mask in the viewport if `position: fixed;` is not"," // supported. iOS < 5 and Android < 3 don't actually support it even"," // though they both pass the feature test; the UA sniff is here to"," // account for that. Ideally this should be replaced with a better"," // feature test."," if (!supportsPosFixed ||"," (Y.UA.ios && Y.UA.ios < 5) ||"," (Y.UA.android && Y.UA.android < 3)) {",""," Y.one('win').on('scroll', this._resyncMask, this);"," }"," },",""," /**"," * Syncs the mask with the widget's current state, namely the visibility and z-index of the widget"," * <p>"," * This method in invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIModal"," * @protected"," */"," _syncUIModal : function () {",""," //var host = this.get(HOST);",""," this._uiSetHostVisibleModal(this.get(VISIBLE));"," this._uiSetHostZIndexModal(this.get(Z_INDEX));",""," },",""," /**"," * Provides mouse and tab focus to the widget's bounding box."," *"," * @method _focus"," */"," _focus : function (e) {",""," var bb = this.get(BOUNDING_BOX),"," oldTI = bb.get('tabIndex');",""," bb.set('tabIndex', oldTI >= 0 ? oldTI : 0);"," this.focus();"," },"," /**"," * Blurs the widget."," *"," * @method _blur"," */"," _blur : function () {",""," this.blur();"," },",""," /**"," * Returns the Y.Node instance of the maskNode"," *"," * @method _getMaskNode"," * @return {Node} The Y.Node instance of the mask, as returned from WidgetModal._GET_MASK"," */"," _getMaskNode : function () {",""," return WidgetModal._GET_MASK();"," },",""," /**"," * Performs events attaching/detaching, stack shifting and mask repositioning based on the visibility of the widget"," *"," * @method _uiSetHostVisibleModal"," * @param {boolean} Whether the widget is visible or not"," */"," _uiSetHostVisibleModal : function (visible) {"," var stack = WidgetModal.STACK,"," maskNode = this.get('maskNode'),"," isModal = this.get('modal'),"," topModal, index;",""," if (visible) {",""," Y.Array.each(stack, function(modal){"," modal._detachUIHandlesModal();"," modal._blur();"," });",""," // push on top of stack"," stack.unshift(this);",""," this._repositionMask(this);"," this._uiSetHostZIndexModal(this.get(Z_INDEX));",""," if (isModal) {"," maskNode.show();"," Y.later(1, this, '_attachUIHandlesModal');"," this._focus();"," }","",""," } else {",""," index = Y.Array.indexOf(stack, this);"," if (index >= 0) {"," // Remove modal widget from global stack."," stack.splice(index, 1);"," }",""," this._detachUIHandlesModal();"," this._blur();",""," if (stack.length) {"," topModal = stack[0];"," this._repositionMask(topModal);"," //topModal._attachUIHandlesModal();"," topModal._uiSetHostZIndexModal(topModal.get(Z_INDEX));",""," if (topModal.get('modal')) {"," //topModal._attachUIHandlesModal();"," Y.later(1, topModal, '_attachUIHandlesModal');"," topModal._focus();"," }",""," } else {",""," if (maskNode.getStyle('display') === 'block') {"," maskNode.hide();"," }",""," }",""," }"," },",""," /**"," * Sets the z-index of the mask node."," *"," * @method _uiSetHostZIndexModal"," * @param {Number} Z-Index of the widget"," */"," _uiSetHostZIndexModal : function (zIndex) {",""," if (this.get('modal')) {"," this.get('maskNode').setStyle(Z_INDEX, zIndex || 0);"," }",""," },",""," /**"," * Attaches UI Listeners for \"clickoutside\" and \"focusoutside\" on the"," * widget. When these events occur, and the widget is modal, focus is"," * shifted back onto the widget."," *"," * @method _attachUIHandlesModal"," */"," _attachUIHandlesModal : function () {",""," if (this._uiHandlesModal || WidgetModal.STACK[0] !== this) {"," // Quit early if we have ui handles, or if we not at the top"," // of the global stack."," return;"," }",""," var bb = this.get(BOUNDING_BOX),"," maskNode = this.get('maskNode'),"," focusOn = this.get('focusOn'),"," focus = Y.bind(this._focus, this),"," uiHandles = [],"," i, len, o;",""," for (i = 0, len = focusOn.length; i < len; i++) {",""," o = {};"," o.node = focusOn[i].node;"," o.ev = focusOn[i].eventName;"," o.keyCode = focusOn[i].keyCode;",""," //no keycode or node defined"," if (!o.node && !o.keyCode && o.ev) {"," uiHandles.push(bb.on(o.ev, focus));"," }",""," //node defined, no keycode (not a keypress)"," else if (o.node && !o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, focus));"," }",""," //node defined, keycode defined, event defined (its a key press)"," else if (o.node && o.keyCode && o.ev) {"," uiHandles.push(o.node.on(o.ev, focus, o.keyCode));"," }",""," else {"," Y.Log('focusOn ATTR Error: The event with name \"'+o.ev+'\" could not be attached.');"," }",""," }",""," if ( ! supportsPosFixed) {"," uiHandles.push(Y.one('win').on('scroll', Y.bind(function(e){"," maskNode.setStyle('top', maskNode.get('docScrollY'));"," }, this)));"," }",""," this._uiHandlesModal = uiHandles;"," },",""," /**"," * Detaches all UI Listeners that were set in _attachUIHandlesModal from the widget."," *"," * @method _detachUIHandlesModal"," */"," _detachUIHandlesModal : function () {"," Y.each(this._uiHandlesModal, function(h){"," h.detach();"," });"," this._uiHandlesModal = null;"," },",""," /**"," * Default function that is called when visibility is changed on the widget."," *"," * @method _afterHostVisibleChangeModal"," * @param {EventFacade} e The event facade of the change"," */"," _afterHostVisibleChangeModal : function (e) {",""," this._uiSetHostVisibleModal(e.newVal);"," },",""," /**"," * Default function that is called when z-index is changed on the widget."," *"," * @method _afterHostZIndexChangeModal"," * @param {EventFacade} e The event facade of the change"," */"," _afterHostZIndexChangeModal : function (e) {",""," this._uiSetHostZIndexModal(e.newVal);"," },",""," /**"," * Returns a boolean representing whether the current widget is in a \"nested modality\" state."," * This is done by checking the number of widgets currently on the stack."," *"," * @method isNested"," * @public"," */"," isNested: function() {"," var length = WidgetModal.STACK.length,"," retval = (length > 1) ? true : false;"," return retval;"," },",""," /**"," * Repositions the mask in the DOM for nested modality cases."," *"," * @method _repositionMask"," * @param {Widget} nextElem The Y.Widget instance that will be visible in the stack once the current widget is closed."," */"," _repositionMask: function(nextElem) {",""," var currentModal = this.get('modal'),"," nextModal = nextElem.get('modal'),"," maskNode = this.get('maskNode'),"," bb, bbParent;",""," //if this is modal and host is not modal"," if (currentModal && !nextModal) {"," //leave the mask where it is, since the host is not modal."," maskNode.remove();"," this.fire(MaskHide);"," }",""," //if the main widget is not modal but the host is modal, or both of them are modal"," else if ((!currentModal && nextModal) || (currentModal && nextModal)) {",""," //then remove the mask off DOM, reposition it, and reinsert it into the DOM"," maskNode.remove();"," this.fire(MaskHide);"," bb = nextElem.get(BOUNDING_BOX);"," bbParent = bb.get('parentNode') || Y.one('body');"," bbParent.insert(maskNode, bbParent.get('firstChild'));"," this.fire(MaskShow);"," }",""," },",""," /**"," * Resyncs the mask in the viewport for browsers that don't support fixed positioning"," *"," * @method _resyncMask"," * @param {Y.Widget} nextElem The Y.Widget instance that will be visible in the stack once the current widget is closed."," * @private"," */"," _resyncMask: function (e) {"," var o = e.currentTarget,"," offsetX = o.get('docScrollX'),"," offsetY = o.get('docScrollY'),"," w = o.get('innerWidth') || o.get('winWidth'),"," h = o.get('innerHeight') || o.get('winHeight'),"," mask = this.get('maskNode');",""," mask.setStyles({"," \"top\": offsetY + \"px\","," \"left\": offsetX + \"px\","," \"width\": w + 'px',"," \"height\": h + 'px'"," });"," },",""," /**"," * Default function called when focusOn Attribute is changed. Remove existing listeners and create new listeners."," *"," * @method _afterFocusOnChange"," */"," _afterFocusOnChange : function(e) {"," this._detachUIHandlesModal();",""," if (this.get(VISIBLE)) {"," this._attachUIHandlesModal();"," }"," }"," };",""," Y.WidgetModality = WidgetModal;","","","","}, '3.7.3', {\"requires\": [\"base-build\", \"event-outside\", \"widget\"], \"skinnable\": true});"]; _yuitest_coverage["build/widget-modality/widget-modality.js"].lines = {"1":0,"9":0,"29":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"47":0,"57":0,"59":0,"74":0,"111":0,"129":0,"141":0,"143":0,"146":0,"147":0,"150":0,"152":0,"153":0,"162":0,"172":0,"179":0,"182":0,"185":0,"186":0,"187":0,"192":0,"211":0,"219":0,"220":0,"236":0,"237":0,"238":0,"245":0,"249":0,"266":0,"267":0,"278":0,"281":0,"282":0,"291":0,"302":0,"312":0,"317":0,"319":0,"320":0,"321":0,"325":0,"327":0,"328":0,"330":0,"331":0,"332":0,"333":0,"339":0,"340":0,"342":0,"345":0,"346":0,"348":0,"349":0,"350":0,"352":0,"354":0,"356":0,"357":0,"362":0,"363":0,"379":0,"380":0,"394":0,"397":0,"400":0,"407":0,"409":0,"410":0,"411":0,"412":0,"415":0,"416":0,"420":0,"421":0,"425":0,"426":0,"430":0,"435":0,"436":0,"437":0,"441":0,"450":0,"451":0,"453":0,"464":0,"475":0,"486":0,"488":0,"499":0,"505":0,"507":0,"508":0,"512":0,"515":0,"516":0,"517":0,"518":0,"519":0,"520":0,"533":0,"540":0,"554":0,"556":0,"557":0,"562":0}; _yuitest_coverage["build/widget-modality/widget-modality.js"].functions = {"(anonymous 2):25":0,"WidgetModal:57":0,"valueFn:110":0,"_GET_MASK:141":0,"initializer:184":0,"destructor:190":0,"_renderUIModal:209":0,"_bindUIModal:234":0,"_syncUIModal:262":0,"_focus:276":0,"_blur:289":0,"_getMaskNode:300":0,"(anonymous 3):319":0,"_uiSetHostVisibleModal:311":0,"_uiSetHostZIndexModal:377":0,"(anonymous 4):436":0,"_attachUIHandlesModal:392":0,"(anonymous 5):450":0,"_detachUIHandlesModal:449":0,"_afterHostVisibleChangeModal:462":0,"_afterHostZIndexChangeModal:473":0,"isNested:485":0,"_repositionMask:497":0,"_resyncMask:532":0,"_afterFocusOnChange:553":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-modality/widget-modality.js"].coveredLines = 120;@@ -747,4 +747,4 @@ -}, '3.7.2', {"requires": ["base-build", "event-outside", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["base-build", "event-outside", "widget"], "skinnable": true});
bundle/widget-modality/widget-modality-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -569,4 +569,4 @@ -}, '3.7.2', {"requires": ["base-build", "event-outside", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["base-build", "event-outside", "widget"], "skinnable": true});
bundle/widget-modality/widget-modality-min.js view
@@ -1,9 +1,9 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("widget-modality",function(e,t){function y(e){}var n="widget",r="renderUI",i="bindUI",s="syncUI",o="boundingBox",u="contentBox",a="visible",f="zIndex",l="Change",c=e.Lang.isBoolean,h=e.ClassNameManager.getClassName,p="maskShow",d="maskHide",v="clickoutside",m="focusoutside",g=function(){ /*! IS_POSITION_FIXED_SUPPORTED - Juriy Zaytsev (kangax) - http://yura.thinkweb2.com/cft/ */-;var t=e.config.doc,n=null,r,i;return t.createElement&&(r=t.createElement("div"),r&&r.style&&(r.style.position="fixed",r.style.top="10px",i=t.body,i&&i.appendChild&&i.removeChild&&(i.appendChild(r),n=r.offsetTop===10,i.removeChild(r)))),n}(),b="modal",w="mask",E={modal:h(n,b),mask:h(n,w)};y.ATTRS={maskNode:{getter:"_getMaskNode",readOnly:!0},modal:{value:!1,validator:c},focusOn:{valueFn:function(){return[{eventName:v},{eventName:m}]},validator:e.Lang.isArray}},y.CLASSES=E,y._GET_MASK=function(){var t=e.one("."+E.mask),n=e.one("win");return t?t:(t=e.Node.create("<div></div>").addClass(E.mask),g?t.setStyles({position:"fixed",width:"100%",height:"100%",top:"0",left:"0",display:"block"}):t.setStyles({position:"absolute",width:n.get("winWidth")+"px",height:n.get("winHeight")+"px",top:"0",left:"0",display:"block"}),t)},y.STACK=[],y.prototype={initializer:function(){e.after(this._renderUIModal,this,r),e.after(this._syncUIModal,this,s),e.after(this._bindUIModal,this,i)},destructor:function(){this._uiSetHostVisibleModal(!1)},_uiHandlesModal:null,_renderUIModal:function(){var e=this.get(o);this._repositionMask(this),e.addClass(E.modal)},_bindUIModal:function(){this.after(a+l,this._afterHostVisibleChangeModal),this.after(f+l,this._afterHostZIndexChangeModal),this.after("focusOnChange",this._afterFocusOnChange),(!g||e.UA.ios&&e.UA.ios<5||e.UA.android&&e.UA.android<3)&&e.one("win").on("scroll",this._resyncMask,this)},_syncUIModal:function(){this._uiSetHostVisibleModal(this.get(a)),this._uiSetHostZIndexModal(this.get(f))},_focus:function(e){var t=this.get(o),n=t.get("tabIndex");t.set("tabIndex",n>=0?n:0),this.focus()},_blur:function(){this.blur()},_getMaskNode:function(){return y._GET_MASK()},_uiSetHostVisibleModal:function(t){var n=y.STACK,r=this.get("maskNode"),i=this.get("modal"),s,o;t?(e.Array.each(n,function(e){e._detachUIHandlesModal(),e._blur()}),n.unshift(this),this._repositionMask(this),this._uiSetHostZIndexModal(this.get(f)),i&&(r.show(),e.later(1,this,"_attachUIHandlesModal"),this._focus())):(o=e.Array.indexOf(n,this),o>=0&&n.splice(o,1),this._detachUIHandlesModal(),this._blur(),n.length?(s=n[0],this._repositionMask(s),s._uiSetHostZIndexModal(s.get(f)),s.get("modal")&&(e.later(1,s,"_attachUIHandlesModal"),s._focus())):r.getStyle("display")==="block"&&r.hide())},_uiSetHostZIndexModal:function(e){this.get("modal")&&this.get("maskNode").setStyle(f,e||0)},_attachUIHandlesModal:function(){if(this._uiHandlesModal||y.STACK[0]!==this)return;var t=this.get(o),n=this.get("maskNode"),r=this.get("focusOn"),i=e.bind(this._focus,this),s=[],u,a,f;for(u=0,a=r.length;u<a;u++)f={},f.node=r[u].node,f.ev=r[u].eventName,f.keyCode=r[u].keyCode,!f.node&&!f.keyCode&&f.ev?s.push(t.on(f.ev,i)):f.node&&!f.keyCode&&f.ev?s.push(f.node.on(f.ev,i)):f.node&&f.keyCode&&f.ev?s.push(f.node.on(f.ev,i,f.keyCode)):e.Log('focusOn ATTR Error: The event with name "'+f.ev+'" could not be attached.');g||s.push(e.one("win").on("scroll",e.bind(function(e){n.setStyle("top",n.get("docScrollY"))},this))),this._uiHandlesModal=s},_detachUIHandlesModal:function(){e.each(this._uiHandlesModal,function(e){e.detach()}),this._uiHandlesModal=null},_afterHostVisibleChangeModal:function(e){this._uiSetHostVisibleModal(e.newVal)},_afterHostZIndexChangeModal:function(e){this._uiSetHostZIndexModal(e.newVal)},isNested:function(){var e=y.STACK.length,t=e>1?!0:!1;return t},_repositionMask:function(t){var n=this.get("modal"),r=t.get("modal"),i=this.get("maskNode"),s,u;if(n&&!r)i.remove(),this.fire(d);else if(!n&&r||n&&r)i.remove(),this.fire(d),s=t.get(o),u=s.get("parentNode")||e.one("body"),u.insert(i,u.get("firstChild")),this.fire(p)},_resyncMask:function(e){var t=e.currentTarget,n=t.get("docScrollX"),r=t.get("docScrollY"),i=t.get("innerWidth")||t.get("winWidth"),s=t.get("innerHeight")||t.get("winHeight"),o=this.get("maskNode");o.setStyles({top:r+"px",left:n+"px",width:i+"px",height:s+"px"})},_afterFocusOnChange:function(e){this._detachUIHandlesModal(),this.get(a)&&this._attachUIHandlesModal()}},e.WidgetModality=y},"3.7.2",{requires:["base-build","event-outside","widget"],skinnable:!0});+;var t=e.config.doc,n=null,r,i;return t.createElement&&(r=t.createElement("div"),r&&r.style&&(r.style.position="fixed",r.style.top="10px",i=t.body,i&&i.appendChild&&i.removeChild&&(i.appendChild(r),n=r.offsetTop===10,i.removeChild(r)))),n}(),b="modal",w="mask",E={modal:h(n,b),mask:h(n,w)};y.ATTRS={maskNode:{getter:"_getMaskNode",readOnly:!0},modal:{value:!1,validator:c},focusOn:{valueFn:function(){return[{eventName:v},{eventName:m}]},validator:e.Lang.isArray}},y.CLASSES=E,y._GET_MASK=function(){var t=e.one("."+E.mask),n=e.one("win");return t?t:(t=e.Node.create("<div></div>").addClass(E.mask),g?t.setStyles({position:"fixed",width:"100%",height:"100%",top:"0",left:"0",display:"block"}):t.setStyles({position:"absolute",width:n.get("winWidth")+"px",height:n.get("winHeight")+"px",top:"0",left:"0",display:"block"}),t)},y.STACK=[],y.prototype={initializer:function(){e.after(this._renderUIModal,this,r),e.after(this._syncUIModal,this,s),e.after(this._bindUIModal,this,i)},destructor:function(){this._uiSetHostVisibleModal(!1)},_uiHandlesModal:null,_renderUIModal:function(){var e=this.get(o);this._repositionMask(this),e.addClass(E.modal)},_bindUIModal:function(){this.after(a+l,this._afterHostVisibleChangeModal),this.after(f+l,this._afterHostZIndexChangeModal),this.after("focusOnChange",this._afterFocusOnChange),(!g||e.UA.ios&&e.UA.ios<5||e.UA.android&&e.UA.android<3)&&e.one("win").on("scroll",this._resyncMask,this)},_syncUIModal:function(){this._uiSetHostVisibleModal(this.get(a)),this._uiSetHostZIndexModal(this.get(f))},_focus:function(e){var t=this.get(o),n=t.get("tabIndex");t.set("tabIndex",n>=0?n:0),this.focus()},_blur:function(){this.blur()},_getMaskNode:function(){return y._GET_MASK()},_uiSetHostVisibleModal:function(t){var n=y.STACK,r=this.get("maskNode"),i=this.get("modal"),s,o;t?(e.Array.each(n,function(e){e._detachUIHandlesModal(),e._blur()}),n.unshift(this),this._repositionMask(this),this._uiSetHostZIndexModal(this.get(f)),i&&(r.show(),e.later(1,this,"_attachUIHandlesModal"),this._focus())):(o=e.Array.indexOf(n,this),o>=0&&n.splice(o,1),this._detachUIHandlesModal(),this._blur(),n.length?(s=n[0],this._repositionMask(s),s._uiSetHostZIndexModal(s.get(f)),s.get("modal")&&(e.later(1,s,"_attachUIHandlesModal"),s._focus())):r.getStyle("display")==="block"&&r.hide())},_uiSetHostZIndexModal:function(e){this.get("modal")&&this.get("maskNode").setStyle(f,e||0)},_attachUIHandlesModal:function(){if(this._uiHandlesModal||y.STACK[0]!==this)return;var t=this.get(o),n=this.get("maskNode"),r=this.get("focusOn"),i=e.bind(this._focus,this),s=[],u,a,f;for(u=0,a=r.length;u<a;u++)f={},f.node=r[u].node,f.ev=r[u].eventName,f.keyCode=r[u].keyCode,!f.node&&!f.keyCode&&f.ev?s.push(t.on(f.ev,i)):f.node&&!f.keyCode&&f.ev?s.push(f.node.on(f.ev,i)):f.node&&f.keyCode&&f.ev?s.push(f.node.on(f.ev,i,f.keyCode)):e.Log('focusOn ATTR Error: The event with name "'+f.ev+'" could not be attached.');g||s.push(e.one("win").on("scroll",e.bind(function(e){n.setStyle("top",n.get("docScrollY"))},this))),this._uiHandlesModal=s},_detachUIHandlesModal:function(){e.each(this._uiHandlesModal,function(e){e.detach()}),this._uiHandlesModal=null},_afterHostVisibleChangeModal:function(e){this._uiSetHostVisibleModal(e.newVal)},_afterHostZIndexChangeModal:function(e){this._uiSetHostZIndexModal(e.newVal)},isNested:function(){var e=y.STACK.length,t=e>1?!0:!1;return t},_repositionMask:function(t){var n=this.get("modal"),r=t.get("modal"),i=this.get("maskNode"),s,u;if(n&&!r)i.remove(),this.fire(d);else if(!n&&r||n&&r)i.remove(),this.fire(d),s=t.get(o),u=s.get("parentNode")||e.one("body"),u.insert(i,u.get("firstChild")),this.fire(p)},_resyncMask:function(e){var t=e.currentTarget,n=t.get("docScrollX"),r=t.get("docScrollY"),i=t.get("innerWidth")||t.get("winWidth"),s=t.get("innerHeight")||t.get("winHeight"),o=this.get("maskNode");o.setStyles({top:r+"px",left:n+"px",width:i+"px",height:s+"px"})},_afterFocusOnChange:function(e){this._detachUIHandlesModal(),this.get(a)&&this._attachUIHandlesModal()}},e.WidgetModality=y},"3.7.3",{requires:["base-build","event-outside","widget"],skinnable:!0});
bundle/widget-modality/widget-modality.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -569,4 +569,4 @@ -}, '3.7.2', {"requires": ["base-build", "event-outside", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["base-build", "event-outside", "widget"], "skinnable": true});
bundle/widget-parent/widget-parent-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-parent/widget-parent.js", code: [] };-_yuitest_coverage["build/widget-parent/widget-parent.js"].code=["YUI.add('widget-parent', function (Y, NAME) {","","/**"," * Extension enabling a Widget to be a parent of another Widget."," *"," * @module widget-parent"," */","","var Lang = Y.Lang,"," RENDERED = \"rendered\","," BOUNDING_BOX = \"boundingBox\";","","/**"," * Widget extension providing functionality enabling a Widget to be a "," * parent of another Widget."," *"," * <p>In addition to the set of attributes supported by WidgetParent, the constructor"," * configuration object can also contain a <code>children</code> which can be used"," * to add child widgets to the parent during construction. The <code>children</code>"," * property is an array of either child widget instances or child widget configuration "," * objects, and is sugar for the <a href=\"#method_add\">add</a> method. See the "," * <a href=\"#method_add\">add</a> for details on the structure of the child widget "," * configuration object."," * @class WidgetParent"," * @constructor"," * @uses ArrayList"," * @param {Object} config User configuration object."," */","function Parent(config) {",""," /**"," * Fires when a Widget is add as a child. The event object will have a "," * 'child' property that returns a reference to the child Widget, as well "," * as an 'index' property that returns a reference to the index specified "," * when the add() method was called."," * <p>"," * Subscribers to the \"on\" moment of this event, will be notified "," * before a child is added."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after a child is added."," * </p>"," *"," * @event addChild"," * @preventable _defAddChildFn"," * @param {EventFacade} e The Event Facade"," */"," this.publish(\"addChild\", { "," defaultTargetOnly: true,"," defaultFn: this._defAddChildFn "," });","",""," /**"," * Fires when a child Widget is removed. The event object will have a "," * 'child' property that returns a reference to the child Widget, as well "," * as an 'index' property that returns a reference child's ordinal position."," * <p>"," * Subscribers to the \"on\" moment of this event, will be notified "," * before a child is removed."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after a child is removed."," * </p>"," *"," * @event removeChild"," * @preventable _defRemoveChildFn"," * @param {EventFacade} e The Event Facade"," */"," this.publish(\"removeChild\", { "," defaultTargetOnly: true,"," defaultFn: this._defRemoveChildFn "," });",""," this._items = [];",""," var children,"," handle;",""," if (config && config.children) {",""," children = config.children;"," "," handle = this.after(\"initializedChange\", function (e) {"," this._add(children);"," handle.detach();"," });",""," }",""," // Widget method overlap"," Y.after(this._renderChildren, this, \"renderUI\");"," Y.after(this._bindUIParent, this, \"bindUI\");",""," this.after(\"selectionChange\", this._afterSelectionChange);"," this.after(\"selectedChange\", this._afterParentSelectedChange);"," this.after(\"activeDescendantChange\", this._afterActiveDescendantChange);",""," this._hDestroyChild = this.after(\"*:destroy\", this._afterDestroyChild);"," this.after(\"*:focusedChange\", this._updateActiveDescendant);","","}","","Parent.ATTRS = {",""," /**"," * @attribute defaultChildType"," * @type {String|Object}"," *"," * @description String representing the default type of the children "," * managed by this Widget. Can also supply default type as a constructor"," * reference."," */"," defaultChildType: {"," setter: function (val) {"," "," var returnVal = Y.Attribute.INVALID_VALUE,"," FnConstructor = Lang.isString(val) ? Y[val] : val;"," "," if (Lang.isFunction(FnConstructor)) {"," returnVal = FnConstructor;"," }"," "," return returnVal;"," }"," },",""," /**"," * @attribute activeDescendant"," * @type Widget"," * @readOnly"," *"," * @description Returns the Widget's currently focused descendant Widget."," */"," activeDescendant: { "," readOnly: true"," },",""," /**"," * @attribute multiple"," * @type Boolean"," * @default false"," * @writeOnce "," *"," * @description Boolean indicating if multiple children can be selected at "," * once. Whether or not multiple selection is enabled is always delegated"," * to the value of the <code>multiple</code> attribute of the root widget"," * in the object hierarchy."," */"," multiple: {"," value: false,"," validator: Lang.isBoolean,"," writeOnce: true,"," getter: function (value) {"," var root = this.get(\"root\");"," return (root && root != this) ? root.get(\"multiple\") : value;"," }"," },","",""," /**"," * @attribute selection"," * @type {ArrayList|Widget}"," * @readOnly "," *"," * @description Returns the currently selected child Widget. If the "," * <code>mulitple</code> attribte is set to <code>true</code> will "," * return an Y.ArrayList instance containing the currently selected "," * children. If no children are selected, will return null."," */"," selection: {"," readOnly: true,"," setter: \"_setSelection\","," getter: function (value) {"," var selection = Lang.isArray(value) ? "," (new Y.ArrayList(value)) : value;"," return selection;"," }"," },",""," selected: {"," setter: function (value) {",""," // Enforces selection behavior on for parent Widgets. Parent's "," // selected attribute can be set to the following:"," // 0 - Not selected"," // 1 - Fully selected (all children are selected). In order for "," // all children to be selected, multiple selection must be "," // enabled. Therefore, you cannot set the \"selected\" attribute "," // on a parent Widget to 1 unless multiple selection is enabled."," // 2 - Partially selected, meaning one ore more (but not all) "," // children are selected.",""," var returnVal = value;",""," if (value === 1 && !this.get(\"multiple\")) {"," returnVal = Y.Attribute.INVALID_VALUE;"," }"," "," return returnVal;"," }"," }","","};","","Parent.prototype = {",""," /**"," * The destructor implementation for Parent widgets. Destroys all children."," * @method destructor"," */"," destructor: function() {"," this._destroyChildren();"," },",""," /**"," * Destroy event listener for each child Widget, responsible for removing "," * the destroyed child Widget from the parent's internal array of children"," * (_items property)."," *"," * @method _afterDestroyChild"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterDestroyChild: function (event) {"," var child = event.target;",""," if (child.get(\"parent\") == this) {"," child.remove();"," } "," },",""," /**"," * Attribute change listener for the <code>selection</code> "," * attribute, responsible for setting the value of the "," * parent's <code>selected</code> attribute."," *"," * @method _afterSelectionChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterSelectionChange: function (event) {",""," if (event.target == this && event.src != this) {",""," var selection = event.newVal,"," selectedVal = 0; // Not selected","",""," if (selection) {",""," selectedVal = 2; // Assume partially selected, confirm otherwise","",""," if (Y.instanceOf(selection, Y.ArrayList) && "," (selection.size() === this.size())) {",""," selectedVal = 1; // Fully selected",""," }"," "," }",""," this.set(\"selected\", selectedVal, { src: this });"," "," }"," },","",""," /**"," * Attribute change listener for the <code>activeDescendant</code> "," * attribute, responsible for setting the value of the "," * parent's <code>activeDescendant</code> attribute."," *"," * @method _afterActiveDescendantChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterActiveDescendantChange: function (event) {"," var parent = this.get(\"parent\");",""," if (parent) {"," parent._set(\"activeDescendant\", event.newVal);"," }"," },",""," /**"," * Attribute change listener for the <code>selected</code> "," * attribute, responsible for syncing the selected state of all children to "," * match that of their parent Widget."," * "," *"," * @method _afterParentSelectedChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterParentSelectedChange: function (event) {",""," var value = event.newVal;",""," if (this == event.target && event.src != this && "," (value === 0 || value === 1)) {",""," this.each(function (child) {",""," // Specify the source of this change as the parent so that "," // value of the parent's \"selection\" attribute isn't "," // recalculated",""," child.set(\"selected\", value, { src: this });",""," }, this);"," "," }"," "," },","",""," /**"," * Default setter for <code>selection</code> attribute changes."," *"," * @method _setSelection"," * @protected"," * @param child {Widget|Array} Widget or Array of Widget instances. "," * @return {Widget|Array} Widget or Array of Widget instances."," */"," _setSelection: function (child) {",""," var selection = null,"," selected;",""," if (this.get(\"multiple\") && !this.isEmpty()) {",""," selected = [];"," "," this.each(function (v) {",""," if (v.get(\"selected\") > 0) {"," selected.push(v);"," }",""," });",""," if (selected.length > 0) {"," selection = selected;"," }",""," }"," else {",""," if (child.get(\"selected\") > 0) {"," selection = child;"," }",""," }"," "," return selection;"," "," },","",""," /**"," * Attribute change listener for the <code>selected</code> "," * attribute of child Widgets, responsible for setting the value of the "," * parent's <code>selection</code> attribute."," *"," * @method _updateSelection"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _updateSelection: function (event) {",""," var child = event.target,"," selection;",""," if (child.get(\"parent\") == this) {",""," if (event.src != \"_updateSelection\") {",""," selection = this.get(\"selection\");",""," if (!this.get(\"multiple\") && selection && event.newVal > 0) {",""," // Deselect the previously selected child."," // Set src equal to the current context to prevent"," // unnecessary re-calculation of the selection.",""," selection.set(\"selected\", 0, { src: \"_updateSelection\" });",""," }",""," this._set(\"selection\", child);",""," }",""," if (event.src == this) {"," this._set(\"selection\", child, { src: this });"," }"," "," }",""," },",""," /**"," * Attribute change listener for the <code>focused</code> "," * attribute of child Widgets, responsible for setting the value of the "," * parent's <code>activeDescendant</code> attribute."," *"," * @method _updateActiveDescendant"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _updateActiveDescendant: function (event) {"," var activeDescendant = (event.newVal === true) ? event.target : null;"," this._set(\"activeDescendant\", activeDescendant);"," },",""," /**"," * Creates an instance of a child Widget using the specified configuration."," * By default Widget instances will be created of the type specified "," * by the <code>defaultChildType</code> attribute. Types can be explicitly"," * defined via the <code>childType</code> property of the configuration object"," * literal. The use of the <code>type</code> property has been deprecated, but "," * will still be used as a fallback, if <code>childType</code> is not defined,"," * for backwards compatibility. "," *"," * @method _createChild"," * @protected"," * @param config {Object} Object literal representing the configuration "," * used to create an instance of a Widget."," */"," _createChild: function (config) {",""," var defaultType = this.get(\"defaultChildType\"),"," altType = config.childType || config.type,"," child,"," Fn,"," FnConstructor;",""," if (altType) {"," Fn = Lang.isString(altType) ? Y[altType] : altType;"," }",""," if (Lang.isFunction(Fn)) {"," FnConstructor = Fn;"," } else if (defaultType) {"," // defaultType is normalized to a function in it's setter "," FnConstructor = defaultType;"," }",""," if (FnConstructor) {"," child = new FnConstructor(config);"," } else {"," Y.error(\"Could not create a child instance because its constructor is either undefined or invalid.\");"," }",""," return child;"," "," },",""," /**"," * Default addChild handler"," *"," * @method _defAddChildFn"," * @protected"," * @param event {EventFacade} The Event object"," * @param child {Widget} The Widget instance, or configuration "," * object for the Widget to be added as a child."," * @param index {Number} Number representing the position at "," * which the child will be inserted."," */"," _defAddChildFn: function (event) {",""," var child = event.child,"," index = event.index,"," children = this._items;",""," if (child.get(\"parent\")) {"," child.remove();"," }",""," if (Lang.isNumber(index)) {"," children.splice(index, 0, child);"," }"," else {"," children.push(child);"," }",""," child._set(\"parent\", this);"," child.addTarget(this);",""," // Update index in case it got normalized after addition"," // (e.g. user passed in 10, and there are only 3 items, the actual index would be 3. We don't want to pass 10 around in the event facade)."," event.index = child.get(\"index\");",""," // TO DO: Remove in favor of using event bubbling"," child.after(\"selectedChange\", Y.bind(this._updateSelection, this));"," },","",""," /**"," * Default removeChild handler"," *"," * @method _defRemoveChildFn"," * @protected"," * @param event {EventFacade} The Event object"," * @param child {Widget} The Widget instance to be removed."," * @param index {Number} Number representing the index of the Widget to "," * be removed."," */ "," _defRemoveChildFn: function (event) {",""," var child = event.child,"," index = event.index,"," children = this._items;",""," if (child.get(\"focused\")) {"," child.blur(); // focused is readOnly, so use the public i/f to unset it"," }",""," if (child.get(\"selected\")) {"," child.set(\"selected\", 0);"," }",""," children.splice(index, 1);",""," child.removeTarget(this);"," child._oldParent = child.get(\"parent\");"," child._set(\"parent\", null);"," },",""," /**"," * @method _add"," * @protected"," * @param child {Widget|Object} The Widget instance, or configuration "," * object for the Widget to be added as a child."," * @param child {Array} Array of Widget instances, or configuration "," * objects for the Widgets to be added as a children."," * @param index {Number} (Optional.) Number representing the position at "," * which the child should be inserted."," * @description Adds a Widget as a child. If the specified Widget already"," * has a parent it will be removed from its current parent before"," * being added as a child."," * @return {Widget|Array} Successfully added Widget or Array containing the "," * successfully added Widget instance(s). If no children where added, will "," * will return undefined."," */"," _add: function (child, index) { ",""," var children,"," oChild,"," returnVal;","",""," if (Lang.isArray(child)) {",""," children = [];",""," Y.each(child, function (v, k) {",""," oChild = this._add(v, (index + k));",""," if (oChild) {"," children.push(oChild);"," }"," "," }, this);"," ",""," if (children.length > 0) {"," returnVal = children;"," }",""," }"," else {",""," if (Y.instanceOf(child, Y.Widget)) {"," oChild = child;"," }"," else {"," oChild = this._createChild(child);"," }",""," if (oChild && this.fire(\"addChild\", { child: oChild, index: index })) {"," returnVal = oChild;"," }",""," }",""," return returnVal;",""," },","",""," /**"," * @method add"," * @param child {Widget|Object} The Widget instance, or configuration "," * object for the Widget to be added as a child. The configuration object"," * for the child can include a <code>childType</code> property, which is either"," * a constructor function or a string which names a constructor function on the "," * Y instance (e.g. \"Tab\" would refer to Y.Tab) (<code>childType</code> used to be "," * named <code>type</code>, support for which has been deprecated, but is still"," * maintained for backward compatibility. <code>childType</code> takes precedence"," * over <code>type</code> if both are defined."," * @param child {Array} Array of Widget instances, or configuration "," * objects for the Widgets to be added as a children."," * @param index {Number} (Optional.) Number representing the position at "," * which the child should be inserted."," * @description Adds a Widget as a child. If the specified Widget already"," * has a parent it will be removed from its current parent before"," * being added as a child."," * @return {ArrayList} Y.ArrayList containing the successfully added "," * Widget instance(s). If no children where added, will return an empty "," * Y.ArrayList instance."," */"," add: function () {",""," var added = this._add.apply(this, arguments),"," children = added ? (Lang.isArray(added) ? added : [added]) : [];",""," return (new Y.ArrayList(children));",""," },","",""," /**"," * @method remove"," * @param index {Number} (Optional.) Number representing the index of the "," * child to be removed."," * @description Removes the Widget from its parent. Optionally, can remove"," * a child by specifying its index."," * @return {Widget} Widget instance that was successfully removed, otherwise"," * undefined."," */"," remove: function (index) {",""," var child = this._items[index],"," returnVal;",""," if (child && this.fire(\"removeChild\", { child: child, index: index })) {"," returnVal = child;"," }"," "," return returnVal;",""," },","",""," /**"," * @method removeAll"," * @description Removes all of the children from the Widget."," * @return {ArrayList} Y.ArrayList instance containing Widgets that were "," * successfully removed. If no children where removed, will return an empty "," * Y.ArrayList instance."," */"," removeAll: function () {",""," var removed = [],"," child;",""," Y.each(this._items.concat(), function () {",""," child = this.remove(0);",""," if (child) {"," removed.push(child);"," }",""," }, this);",""," return (new Y.ArrayList(removed));",""," },"," "," /**"," * Selects the child at the given index (zero-based)."," *"," * @method selectChild"," * @param {Number} i the index of the child to be selected"," */"," selectChild: function(i) {"," this.item(i).set('selected', 1);"," },",""," /**"," * Selects all children."," *"," * @method selectAll"," */"," selectAll: function () {"," this.set(\"selected\", 1);"," },",""," /**"," * Deselects all children."," *"," * @method deselectAll"," */"," deselectAll: function () {"," this.set(\"selected\", 0);"," },",""," /**"," * Updates the UI in response to a child being added."," *"," * @method _uiAddChild"," * @protected"," * @param child {Widget} The child Widget instance to render."," * @param parentNode {Object} The Node under which the "," * child Widget is to be rendered."," */ "," _uiAddChild: function (child, parentNode) {",""," child.render(parentNode);",""," // TODO: Ideally this should be in Child's render UI. ",""," var childBB = child.get(\"boundingBox\"),"," siblingBB,"," nextSibling = child.next(false),"," prevSibling;",""," // Insert or Append to last child.",""," // Avoiding index, and using the current sibling "," // state (which should be accurate), means we don't have "," // to worry about decorator elements which may be added "," // to the _childContainer node."," "," if (nextSibling && nextSibling.get(RENDERED)) {",""," siblingBB = nextSibling.get(BOUNDING_BOX);"," siblingBB.insert(childBB, \"before\");",""," } else {",""," prevSibling = child.previous(false);",""," if (prevSibling && prevSibling.get(RENDERED)) {",""," siblingBB = prevSibling.get(BOUNDING_BOX);"," siblingBB.insert(childBB, \"after\");",""," } else if (!parentNode.contains(childBB)) {",""," // Based on pull request from andreas-karlsson"," // https://github.com/yui/yui3/pull/25#issuecomment-2103536",""," // Account for case where a child was rendered independently of the "," // parent-child framework, to a node outside of the parentNode,"," // and there are no siblings.",""," parentNode.appendChild(childBB);"," }"," }",""," },",""," /**"," * Updates the UI in response to a child being removed."," *"," * @method _uiRemoveChild"," * @protected"," * @param child {Widget} The child Widget instance to render."," */ "," _uiRemoveChild: function (child) {"," child.get(\"boundingBox\").remove();"," },",""," _afterAddChild: function (event) {"," var child = event.child;",""," if (child.get(\"parent\") == this) {"," this._uiAddChild(child, this._childrenContainer);"," }"," },",""," _afterRemoveChild: function (event) {"," var child = event.child;",""," if (child._oldParent == this) {"," this._uiRemoveChild(child);"," }"," },",""," /**"," * Sets up DOM and CustomEvent listeners for the parent widget."," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," *"," * @method _bindUIParent"," * @protected"," */"," _bindUIParent: function () {"," this.after(\"addChild\", this._afterAddChild);"," this.after(\"removeChild\", this._afterRemoveChild);"," },",""," /**"," * Renders all child Widgets for the parent."," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderChildren"," * @protected"," */"," _renderChildren: function () {",""," /**"," * <p>By default WidgetParent will render it's children to the parent's content box.</p>"," *"," * <p>If the children need to be rendered somewhere else, the _childrenContainer property"," * can be set to the Node which the children should be rendered to. This property should be"," * set before the _renderChildren method is invoked, ideally in your renderUI method, "," * as soon as you create the element to be rendered to.</p>"," *"," * @protected"," * @property _childrenContainer"," * @value The content box"," * @type Node"," */"," var renderTo = this._childrenContainer || this.get(\"contentBox\");",""," this._childrenContainer = renderTo;",""," this.each(function (child) {"," child.render(renderTo);"," });"," },",""," /**"," * Destroys all child Widgets for the parent."," * <p>"," * This method is invoked before the destructor is invoked for the Widget "," * class using YUI's aop infrastructure."," * </p>"," * @method _destroyChildren"," * @protected"," */"," _destroyChildren: function () {",""," // Detach the handler responsible for removing children in "," // response to destroying them since:"," // 1) It is unnecessary/inefficient at this point since we are doing "," // a batch destroy of all children."," // 2) Removing each child will affect our ability to iterate the "," // children since the size of _items will be changing as we "," // iterate."," this._hDestroyChild.detach();",""," // Need to clone the _items array since "," this.each(function (child) {"," child.destroy();"," });"," }"," ","};","","Y.augment(Parent, Y.ArrayList);","","Y.WidgetParent = Parent;","","","}, '3.7.2', {\"requires\": [\"arraylist\", \"base-build\", \"widget\"]});"];+_yuitest_coverage["build/widget-parent/widget-parent.js"].code=["YUI.add('widget-parent', function (Y, NAME) {","","/**"," * Extension enabling a Widget to be a parent of another Widget."," *"," * @module widget-parent"," */","","var Lang = Y.Lang,"," RENDERED = \"rendered\","," BOUNDING_BOX = \"boundingBox\";","","/**"," * Widget extension providing functionality enabling a Widget to be a "," * parent of another Widget."," *"," * <p>In addition to the set of attributes supported by WidgetParent, the constructor"," * configuration object can also contain a <code>children</code> which can be used"," * to add child widgets to the parent during construction. The <code>children</code>"," * property is an array of either child widget instances or child widget configuration "," * objects, and is sugar for the <a href=\"#method_add\">add</a> method. See the "," * <a href=\"#method_add\">add</a> for details on the structure of the child widget "," * configuration object."," * @class WidgetParent"," * @constructor"," * @uses ArrayList"," * @param {Object} config User configuration object."," */","function Parent(config) {",""," /**"," * Fires when a Widget is add as a child. The event object will have a "," * 'child' property that returns a reference to the child Widget, as well "," * as an 'index' property that returns a reference to the index specified "," * when the add() method was called."," * <p>"," * Subscribers to the \"on\" moment of this event, will be notified "," * before a child is added."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after a child is added."," * </p>"," *"," * @event addChild"," * @preventable _defAddChildFn"," * @param {EventFacade} e The Event Facade"," */"," this.publish(\"addChild\", { "," defaultTargetOnly: true,"," defaultFn: this._defAddChildFn "," });","",""," /**"," * Fires when a child Widget is removed. The event object will have a "," * 'child' property that returns a reference to the child Widget, as well "," * as an 'index' property that returns a reference child's ordinal position."," * <p>"," * Subscribers to the \"on\" moment of this event, will be notified "," * before a child is removed."," * </p>"," * <p>"," * Subscribers to the \"after\" moment of this event, will be notified"," * after a child is removed."," * </p>"," *"," * @event removeChild"," * @preventable _defRemoveChildFn"," * @param {EventFacade} e The Event Facade"," */"," this.publish(\"removeChild\", { "," defaultTargetOnly: true,"," defaultFn: this._defRemoveChildFn "," });",""," this._items = [];",""," var children,"," handle;",""," if (config && config.children) {",""," children = config.children;"," "," handle = this.after(\"initializedChange\", function (e) {"," this._add(children);"," handle.detach();"," });",""," }",""," // Widget method overlap"," Y.after(this._renderChildren, this, \"renderUI\");"," Y.after(this._bindUIParent, this, \"bindUI\");",""," this.after(\"selectionChange\", this._afterSelectionChange);"," this.after(\"selectedChange\", this._afterParentSelectedChange);"," this.after(\"activeDescendantChange\", this._afterActiveDescendantChange);",""," this._hDestroyChild = this.after(\"*:destroy\", this._afterDestroyChild);"," this.after(\"*:focusedChange\", this._updateActiveDescendant);","","}","","Parent.ATTRS = {",""," /**"," * @attribute defaultChildType"," * @type {String|Object}"," *"," * @description String representing the default type of the children "," * managed by this Widget. Can also supply default type as a constructor"," * reference."," */"," defaultChildType: {"," setter: function (val) {"," "," var returnVal = Y.Attribute.INVALID_VALUE,"," FnConstructor = Lang.isString(val) ? Y[val] : val;"," "," if (Lang.isFunction(FnConstructor)) {"," returnVal = FnConstructor;"," }"," "," return returnVal;"," }"," },",""," /**"," * @attribute activeDescendant"," * @type Widget"," * @readOnly"," *"," * @description Returns the Widget's currently focused descendant Widget."," */"," activeDescendant: { "," readOnly: true"," },",""," /**"," * @attribute multiple"," * @type Boolean"," * @default false"," * @writeOnce "," *"," * @description Boolean indicating if multiple children can be selected at "," * once. Whether or not multiple selection is enabled is always delegated"," * to the value of the <code>multiple</code> attribute of the root widget"," * in the object hierarchy."," */"," multiple: {"," value: false,"," validator: Lang.isBoolean,"," writeOnce: true,"," getter: function (value) {"," var root = this.get(\"root\");"," return (root && root != this) ? root.get(\"multiple\") : value;"," }"," },","",""," /**"," * @attribute selection"," * @type {ArrayList|Widget}"," * @readOnly "," *"," * @description Returns the currently selected child Widget. If the "," * <code>mulitple</code> attribte is set to <code>true</code> will "," * return an Y.ArrayList instance containing the currently selected "," * children. If no children are selected, will return null."," */"," selection: {"," readOnly: true,"," setter: \"_setSelection\","," getter: function (value) {"," var selection = Lang.isArray(value) ? "," (new Y.ArrayList(value)) : value;"," return selection;"," }"," },",""," selected: {"," setter: function (value) {",""," // Enforces selection behavior on for parent Widgets. Parent's "," // selected attribute can be set to the following:"," // 0 - Not selected"," // 1 - Fully selected (all children are selected). In order for "," // all children to be selected, multiple selection must be "," // enabled. Therefore, you cannot set the \"selected\" attribute "," // on a parent Widget to 1 unless multiple selection is enabled."," // 2 - Partially selected, meaning one ore more (but not all) "," // children are selected.",""," var returnVal = value;",""," if (value === 1 && !this.get(\"multiple\")) {"," returnVal = Y.Attribute.INVALID_VALUE;"," }"," "," return returnVal;"," }"," }","","};","","Parent.prototype = {",""," /**"," * The destructor implementation for Parent widgets. Destroys all children."," * @method destructor"," */"," destructor: function() {"," this._destroyChildren();"," },",""," /**"," * Destroy event listener for each child Widget, responsible for removing "," * the destroyed child Widget from the parent's internal array of children"," * (_items property)."," *"," * @method _afterDestroyChild"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterDestroyChild: function (event) {"," var child = event.target;",""," if (child.get(\"parent\") == this) {"," child.remove();"," } "," },",""," /**"," * Attribute change listener for the <code>selection</code> "," * attribute, responsible for setting the value of the "," * parent's <code>selected</code> attribute."," *"," * @method _afterSelectionChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterSelectionChange: function (event) {",""," if (event.target == this && event.src != this) {",""," var selection = event.newVal,"," selectedVal = 0; // Not selected","",""," if (selection) {",""," selectedVal = 2; // Assume partially selected, confirm otherwise","",""," if (Y.instanceOf(selection, Y.ArrayList) && "," (selection.size() === this.size())) {",""," selectedVal = 1; // Fully selected",""," }"," "," }",""," this.set(\"selected\", selectedVal, { src: this });"," "," }"," },","",""," /**"," * Attribute change listener for the <code>activeDescendant</code> "," * attribute, responsible for setting the value of the "," * parent's <code>activeDescendant</code> attribute."," *"," * @method _afterActiveDescendantChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterActiveDescendantChange: function (event) {"," var parent = this.get(\"parent\");",""," if (parent) {"," parent._set(\"activeDescendant\", event.newVal);"," }"," },",""," /**"," * Attribute change listener for the <code>selected</code> "," * attribute, responsible for syncing the selected state of all children to "," * match that of their parent Widget."," * "," *"," * @method _afterParentSelectedChange"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _afterParentSelectedChange: function (event) {",""," var value = event.newVal;",""," if (this == event.target && event.src != this && "," (value === 0 || value === 1)) {",""," this.each(function (child) {",""," // Specify the source of this change as the parent so that "," // value of the parent's \"selection\" attribute isn't "," // recalculated",""," child.set(\"selected\", value, { src: this });",""," }, this);"," "," }"," "," },","",""," /**"," * Default setter for <code>selection</code> attribute changes."," *"," * @method _setSelection"," * @protected"," * @param child {Widget|Array} Widget or Array of Widget instances. "," * @return {Widget|Array} Widget or Array of Widget instances."," */"," _setSelection: function (child) {",""," var selection = null,"," selected;",""," if (this.get(\"multiple\") && !this.isEmpty()) {",""," selected = [];"," "," this.each(function (v) {",""," if (v.get(\"selected\") > 0) {"," selected.push(v);"," }",""," });",""," if (selected.length > 0) {"," selection = selected;"," }",""," }"," else {",""," if (child.get(\"selected\") > 0) {"," selection = child;"," }",""," }"," "," return selection;"," "," },","",""," /**"," * Attribute change listener for the <code>selected</code> "," * attribute of child Widgets, responsible for setting the value of the "," * parent's <code>selection</code> attribute."," *"," * @method _updateSelection"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _updateSelection: function (event) {",""," var child = event.target,"," selection;",""," if (child.get(\"parent\") == this) {",""," if (event.src != \"_updateSelection\") {",""," selection = this.get(\"selection\");",""," if (!this.get(\"multiple\") && selection && event.newVal > 0) {",""," // Deselect the previously selected child."," // Set src equal to the current context to prevent"," // unnecessary re-calculation of the selection.",""," selection.set(\"selected\", 0, { src: \"_updateSelection\" });",""," }",""," this._set(\"selection\", child);",""," }",""," if (event.src == this) {"," this._set(\"selection\", child, { src: this });"," }"," "," }",""," },",""," /**"," * Attribute change listener for the <code>focused</code> "," * attribute of child Widgets, responsible for setting the value of the "," * parent's <code>activeDescendant</code> attribute."," *"," * @method _updateActiveDescendant"," * @protected"," * @param {EventFacade} event The event facade for the attribute change."," */"," _updateActiveDescendant: function (event) {"," var activeDescendant = (event.newVal === true) ? event.target : null;"," this._set(\"activeDescendant\", activeDescendant);"," },",""," /**"," * Creates an instance of a child Widget using the specified configuration."," * By default Widget instances will be created of the type specified "," * by the <code>defaultChildType</code> attribute. Types can be explicitly"," * defined via the <code>childType</code> property of the configuration object"," * literal. The use of the <code>type</code> property has been deprecated, but "," * will still be used as a fallback, if <code>childType</code> is not defined,"," * for backwards compatibility. "," *"," * @method _createChild"," * @protected"," * @param config {Object} Object literal representing the configuration "," * used to create an instance of a Widget."," */"," _createChild: function (config) {",""," var defaultType = this.get(\"defaultChildType\"),"," altType = config.childType || config.type,"," child,"," Fn,"," FnConstructor;",""," if (altType) {"," Fn = Lang.isString(altType) ? Y[altType] : altType;"," }",""," if (Lang.isFunction(Fn)) {"," FnConstructor = Fn;"," } else if (defaultType) {"," // defaultType is normalized to a function in it's setter "," FnConstructor = defaultType;"," }",""," if (FnConstructor) {"," child = new FnConstructor(config);"," } else {"," Y.error(\"Could not create a child instance because its constructor is either undefined or invalid.\");"," }",""," return child;"," "," },",""," /**"," * Default addChild handler"," *"," * @method _defAddChildFn"," * @protected"," * @param event {EventFacade} The Event object"," * @param child {Widget} The Widget instance, or configuration "," * object for the Widget to be added as a child."," * @param index {Number} Number representing the position at "," * which the child will be inserted."," */"," _defAddChildFn: function (event) {",""," var child = event.child,"," index = event.index,"," children = this._items;",""," if (child.get(\"parent\")) {"," child.remove();"," }",""," if (Lang.isNumber(index)) {"," children.splice(index, 0, child);"," }"," else {"," children.push(child);"," }",""," child._set(\"parent\", this);"," child.addTarget(this);",""," // Update index in case it got normalized after addition"," // (e.g. user passed in 10, and there are only 3 items, the actual index would be 3. We don't want to pass 10 around in the event facade)."," event.index = child.get(\"index\");",""," // TO DO: Remove in favor of using event bubbling"," child.after(\"selectedChange\", Y.bind(this._updateSelection, this));"," },","",""," /**"," * Default removeChild handler"," *"," * @method _defRemoveChildFn"," * @protected"," * @param event {EventFacade} The Event object"," * @param child {Widget} The Widget instance to be removed."," * @param index {Number} Number representing the index of the Widget to "," * be removed."," */ "," _defRemoveChildFn: function (event) {",""," var child = event.child,"," index = event.index,"," children = this._items;",""," if (child.get(\"focused\")) {"," child.blur(); // focused is readOnly, so use the public i/f to unset it"," }",""," if (child.get(\"selected\")) {"," child.set(\"selected\", 0);"," }",""," children.splice(index, 1);",""," child.removeTarget(this);"," child._oldParent = child.get(\"parent\");"," child._set(\"parent\", null);"," },",""," /**"," * @method _add"," * @protected"," * @param child {Widget|Object} The Widget instance, or configuration "," * object for the Widget to be added as a child."," * @param child {Array} Array of Widget instances, or configuration "," * objects for the Widgets to be added as a children."," * @param index {Number} (Optional.) Number representing the position at "," * which the child should be inserted."," * @description Adds a Widget as a child. If the specified Widget already"," * has a parent it will be removed from its current parent before"," * being added as a child."," * @return {Widget|Array} Successfully added Widget or Array containing the "," * successfully added Widget instance(s). If no children where added, will "," * will return undefined."," */"," _add: function (child, index) { ",""," var children,"," oChild,"," returnVal;","",""," if (Lang.isArray(child)) {",""," children = [];",""," Y.each(child, function (v, k) {",""," oChild = this._add(v, (index + k));",""," if (oChild) {"," children.push(oChild);"," }"," "," }, this);"," ",""," if (children.length > 0) {"," returnVal = children;"," }",""," }"," else {",""," if (Y.instanceOf(child, Y.Widget)) {"," oChild = child;"," }"," else {"," oChild = this._createChild(child);"," }",""," if (oChild && this.fire(\"addChild\", { child: oChild, index: index })) {"," returnVal = oChild;"," }",""," }",""," return returnVal;",""," },","",""," /**"," * @method add"," * @param child {Widget|Object} The Widget instance, or configuration "," * object for the Widget to be added as a child. The configuration object"," * for the child can include a <code>childType</code> property, which is either"," * a constructor function or a string which names a constructor function on the "," * Y instance (e.g. \"Tab\" would refer to Y.Tab) (<code>childType</code> used to be "," * named <code>type</code>, support for which has been deprecated, but is still"," * maintained for backward compatibility. <code>childType</code> takes precedence"," * over <code>type</code> if both are defined."," * @param child {Array} Array of Widget instances, or configuration "," * objects for the Widgets to be added as a children."," * @param index {Number} (Optional.) Number representing the position at "," * which the child should be inserted."," * @description Adds a Widget as a child. If the specified Widget already"," * has a parent it will be removed from its current parent before"," * being added as a child."," * @return {ArrayList} Y.ArrayList containing the successfully added "," * Widget instance(s). If no children where added, will return an empty "," * Y.ArrayList instance."," */"," add: function () {",""," var added = this._add.apply(this, arguments),"," children = added ? (Lang.isArray(added) ? added : [added]) : [];",""," return (new Y.ArrayList(children));",""," },","",""," /**"," * @method remove"," * @param index {Number} (Optional.) Number representing the index of the "," * child to be removed."," * @description Removes the Widget from its parent. Optionally, can remove"," * a child by specifying its index."," * @return {Widget} Widget instance that was successfully removed, otherwise"," * undefined."," */"," remove: function (index) {",""," var child = this._items[index],"," returnVal;",""," if (child && this.fire(\"removeChild\", { child: child, index: index })) {"," returnVal = child;"," }"," "," return returnVal;",""," },","",""," /**"," * @method removeAll"," * @description Removes all of the children from the Widget."," * @return {ArrayList} Y.ArrayList instance containing Widgets that were "," * successfully removed. If no children where removed, will return an empty "," * Y.ArrayList instance."," */"," removeAll: function () {",""," var removed = [],"," child;",""," Y.each(this._items.concat(), function () {",""," child = this.remove(0);",""," if (child) {"," removed.push(child);"," }",""," }, this);",""," return (new Y.ArrayList(removed));",""," },"," "," /**"," * Selects the child at the given index (zero-based)."," *"," * @method selectChild"," * @param {Number} i the index of the child to be selected"," */"," selectChild: function(i) {"," this.item(i).set('selected', 1);"," },",""," /**"," * Selects all children."," *"," * @method selectAll"," */"," selectAll: function () {"," this.set(\"selected\", 1);"," },",""," /**"," * Deselects all children."," *"," * @method deselectAll"," */"," deselectAll: function () {"," this.set(\"selected\", 0);"," },",""," /**"," * Updates the UI in response to a child being added."," *"," * @method _uiAddChild"," * @protected"," * @param child {Widget} The child Widget instance to render."," * @param parentNode {Object} The Node under which the "," * child Widget is to be rendered."," */ "," _uiAddChild: function (child, parentNode) {",""," child.render(parentNode);",""," // TODO: Ideally this should be in Child's render UI. ",""," var childBB = child.get(\"boundingBox\"),"," siblingBB,"," nextSibling = child.next(false),"," prevSibling;",""," // Insert or Append to last child.",""," // Avoiding index, and using the current sibling "," // state (which should be accurate), means we don't have "," // to worry about decorator elements which may be added "," // to the _childContainer node."," "," if (nextSibling && nextSibling.get(RENDERED)) {",""," siblingBB = nextSibling.get(BOUNDING_BOX);"," siblingBB.insert(childBB, \"before\");",""," } else {",""," prevSibling = child.previous(false);",""," if (prevSibling && prevSibling.get(RENDERED)) {",""," siblingBB = prevSibling.get(BOUNDING_BOX);"," siblingBB.insert(childBB, \"after\");",""," } else if (!parentNode.contains(childBB)) {",""," // Based on pull request from andreas-karlsson"," // https://github.com/yui/yui3/pull/25#issuecomment-2103536",""," // Account for case where a child was rendered independently of the "," // parent-child framework, to a node outside of the parentNode,"," // and there are no siblings.",""," parentNode.appendChild(childBB);"," }"," }",""," },",""," /**"," * Updates the UI in response to a child being removed."," *"," * @method _uiRemoveChild"," * @protected"," * @param child {Widget} The child Widget instance to render."," */ "," _uiRemoveChild: function (child) {"," child.get(\"boundingBox\").remove();"," },",""," _afterAddChild: function (event) {"," var child = event.child;",""," if (child.get(\"parent\") == this) {"," this._uiAddChild(child, this._childrenContainer);"," }"," },",""," _afterRemoveChild: function (event) {"," var child = event.child;",""," if (child._oldParent == this) {"," this._uiRemoveChild(child);"," }"," },",""," /**"," * Sets up DOM and CustomEvent listeners for the parent widget."," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," *"," * @method _bindUIParent"," * @protected"," */"," _bindUIParent: function () {"," this.after(\"addChild\", this._afterAddChild);"," this.after(\"removeChild\", this._afterRemoveChild);"," },",""," /**"," * Renders all child Widgets for the parent."," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderChildren"," * @protected"," */"," _renderChildren: function () {",""," /**"," * <p>By default WidgetParent will render it's children to the parent's content box.</p>"," *"," * <p>If the children need to be rendered somewhere else, the _childrenContainer property"," * can be set to the Node which the children should be rendered to. This property should be"," * set before the _renderChildren method is invoked, ideally in your renderUI method, "," * as soon as you create the element to be rendered to.</p>"," *"," * @protected"," * @property _childrenContainer"," * @value The content box"," * @type Node"," */"," var renderTo = this._childrenContainer || this.get(\"contentBox\");",""," this._childrenContainer = renderTo;",""," this.each(function (child) {"," child.render(renderTo);"," });"," },",""," /**"," * Destroys all child Widgets for the parent."," * <p>"," * This method is invoked before the destructor is invoked for the Widget "," * class using YUI's aop infrastructure."," * </p>"," * @method _destroyChildren"," * @protected"," */"," _destroyChildren: function () {",""," // Detach the handler responsible for removing children in "," // response to destroying them since:"," // 1) It is unnecessary/inefficient at this point since we are doing "," // a batch destroy of all children."," // 2) Removing each child will affect our ability to iterate the "," // children since the size of _items will be changing as we "," // iterate."," this._hDestroyChild.detach();",""," // Need to clone the _items array since "," this.each(function (child) {"," child.destroy();"," });"," }"," ","};","","Y.augment(Parent, Y.ArrayList);","","Y.WidgetParent = Parent;","","","}, '3.7.3', {\"requires\": [\"arraylist\", \"base-build\", \"widget\"]});"]; _yuitest_coverage["build/widget-parent/widget-parent.js"].lines = {"1":0,"9":0,"29":0,"49":0,"72":0,"77":0,"79":0,"82":0,"84":0,"86":0,"87":0,"88":0,"94":0,"95":0,"97":0,"98":0,"99":0,"101":0,"102":0,"106":0,"119":0,"122":0,"123":0,"126":0,"157":0,"158":0,"177":0,"179":0,"196":0,"198":0,"199":0,"202":0,"208":0,"215":0,"228":0,"230":0,"231":0,"246":0,"248":0,"252":0,"254":0,"257":0,"260":0,"266":0,"282":0,"284":0,"285":0,"301":0,"303":0,"306":0,"312":0,"331":0,"334":0,"336":0,"338":0,"340":0,"341":0,"346":0,"347":0,"353":0,"354":0,"359":0,"375":0,"378":0,"380":0,"382":0,"384":0,"390":0,"394":0,"398":0,"399":0,"416":0,"417":0,"436":0,"442":0,"443":0,"446":0,"447":0,"448":0,"450":0,"453":0,"454":0,"456":0,"459":0,"476":0,"480":0,"481":0,"484":0,"485":0,"488":0,"491":0,"492":0,"496":0,"499":0,"515":0,"519":0,"520":0,"523":0,"524":0,"527":0,"529":0,"530":0,"531":0,"552":0,"557":0,"559":0,"561":0,"563":0,"565":0,"566":0,"572":0,"573":0,"579":0,"580":0,"583":0,"586":0,"587":0,"592":0,"620":0,"623":0,"639":0,"642":0,"643":0,"646":0,"660":0,"663":0,"665":0,"667":0,"668":0,"673":0,"684":0,"693":0,"702":0,"716":0,"720":0,"732":0,"734":0,"735":0,"739":0,"741":0,"743":0,"744":0,"746":0,"755":0,"769":0,"773":0,"775":0,"776":0,"781":0,"783":0,"784":0,"799":0,"800":0,"827":0,"829":0,"831":0,"832":0,"854":0,"857":0,"858":0,"864":0,"866":0}; _yuitest_coverage["build/widget-parent/widget-parent.js"].functions = {"(anonymous 2):86":0,"Parent:29":0,"setter:117":0,"getter:156":0,"getter:176":0,"setter:184":0,"destructor:214":0,"_afterDestroyChild:227":0,"_afterSelectionChange:244":0,"_afterActiveDescendantChange:281":0,"(anonymous 3):306":0,"_afterParentSelectedChange:299":0,"(anonymous 4):338":0,"_setSelection:329":0,"_updateSelection:373":0,"_updateActiveDescendant:415":0,"_createChild:434":0,"_defAddChildFn:474":0,"_defRemoveChildFn:513":0,"(anonymous 5):561":0,"_add:550":0,"add:618":0,"remove:637":0,"(anonymous 6):663":0,"removeAll:658":0,"selectChild:683":0,"selectAll:692":0,"deselectAll:701":0,"_uiAddChild:714":0,"_uiRemoveChild:768":0,"_afterAddChild:772":0,"_afterRemoveChild:780":0,"_bindUIParent:798":0,"(anonymous 7):831":0,"_renderChildren:812":0,"(anonymous 8):857":0,"_destroyChildren:845":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-parent/widget-parent.js"].coveredLines = 162;@@ -1105,4 +1105,4 @@ Y.WidgetParent = Parent; -}, '3.7.2', {"requires": ["arraylist", "base-build", "widget"]});+}, '3.7.3', {"requires": ["arraylist", "base-build", "widget"]});
bundle/widget-parent/widget-parent-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -873,4 +873,4 @@ Y.WidgetParent = Parent; -}, '3.7.2', {"requires": ["arraylist", "base-build", "widget"]});+}, '3.7.3', {"requires": ["arraylist", "base-build", "widget"]});
bundle/widget-parent/widget-parent-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-parent",function(e,t){function s(t){this.publish("addChild",{defaultTargetOnly:!0,defaultFn:this._defAddChildFn}),this.publish("removeChild",{defaultTargetOnly:!0,defaultFn:this._defRemoveChildFn}),this._items=[];var n,r;t&&t.children&&(n=t.children,r=this.after("initializedChange",function(e){this._add(n),r.detach()})),e.after(this._renderChildren,this,"renderUI"),e.after(this._bindUIParent,this,"bindUI"),this.after("selectionChange",this._afterSelectionChange),this.after("selectedChange",this._afterParentSelectedChange),this.after("activeDescendantChange",this._afterActiveDescendantChange),this._hDestroyChild=this.after("*:destroy",this._afterDestroyChild),this.after("*:focusedChange",this._updateActiveDescendant)}var n=e.Lang,r="rendered",i="boundingBox";s.ATTRS={defaultChildType:{setter:function(t){var r=e.Attribute.INVALID_VALUE,i=n.isString(t)?e[t]:t;return n.isFunction(i)&&(r=i),r}},activeDescendant:{readOnly:!0},multiple:{value:!1,validator:n.isBoolean,writeOnce:!0,getter:function(e){var t=this.get("root");return t&&t!=this?t.get("multiple"):e}},selection:{readOnly:!0,setter:"_setSelection",getter:function(t){var r=n.isArray(t)?new e.ArrayList(t):t;return r}},selected:{setter:function(t){var n=t;return t===1&&!this.get("multiple")&&(n=e.Attribute.INVALID_VALUE),n}}},s.prototype={destructor:function(){this._destroyChildren()},_afterDestroyChild:function(e){var t=e.target;t.get("parent")==this&&t.remove()},_afterSelectionChange:function(t){if(t.target==this&&t.src!=this){var n=t.newVal,r=0;n&&(r=2,e.instanceOf(n,e.ArrayList)&&n.size()===this.size()&&(r=1)),this.set("selected",r,{src:this})}},_afterActiveDescendantChange:function(e){var t=this.get("parent");t&&t._set("activeDescendant",e.newVal)},_afterParentSelectedChange:function(e){var t=e.newVal;this==e.target&&e.src!=this&&(t===0||t===1)&&this.each(function(e){e.set("selected",t,{src:this})},this)},_setSelection:function(e){var t=null,n;return this.get("multiple")&&!this.isEmpty()?(n=[],this.each(function(e){e.get("selected")>0&&n.push(e)}),n.length>0&&(t=n)):e.get("selected")>0&&(t=e),t},_updateSelection:function(e){var t=e.target,n;t.get("parent")==this&&(e.src!="_updateSelection"&&(n=this.get("selection"),!this.get("multiple")&&n&&e.newVal>0&&n.set("selected",0,{src:"_updateSelection"}),this._set("selection",t)),e.src==this&&this._set("selection",t,{src:this}))},_updateActiveDescendant:function(e){var t=e.newVal===!0?e.target:null;this._set("activeDescendant",t)},_createChild:function(t){var r=this.get("defaultChildType"),i=t.childType||t.type,s,o,u;return i&&(o=n.isString(i)?e[i]:i),n.isFunction(o)?u=o:r&&(u=r),u?s=new u(t):e.error("Could not create a child instance because its constructor is either undefined or invalid."),s},_defAddChildFn:function(t){var r=t.child,i=t.index,s=this._items;r.get("parent")&&r.remove(),n.isNumber(i)?s.splice(i,0,r):s.push(r),r._set("parent",this),r.addTarget(this),t.index=r.get("index"),r.after("selectedChange",e.bind(this._updateSelection,this))},_defRemoveChildFn:function(e){var t=e.child,n=e.index,r=this._items;t.get("focused")&&t.blur(),t.get("selected")&&t.set("selected",0),r.splice(n,1),t.removeTarget(this),t._oldParent=t.get("parent"),t._set("parent",null)},_add:function(t,r){var i,s,o;return n.isArray(t)?(i=[],e.each(t,function(e,t){s=this._add(e,r+t),s&&i.push(s)},this),i.length>0&&(o=i)):(e.instanceOf(t,e.Widget)?s=t:s=this._createChild(t),s&&this.fire("addChild",{child:s,index:r})&&(o=s)),o},add:function(){var t=this._add.apply(this,arguments),r=t?n.isArray(t)?t:[t]:[];return new e.ArrayList(r)},remove:function(e){var t=this._items[e],n;return t&&this.fire("removeChild",{child:t,index:e})&&(n=t),n},removeAll:function(){var t=[],n;return e.each(this._items.concat(),function(){n=this.remove(0),n&&t.push(n)},this),new e.ArrayList(t)},selectChild:function(e){this.item(e).set("selected",1)},selectAll:function(){this.set("selected",1)},deselectAll:function(){this.set("selected",0)},_uiAddChild:function(e,t){e.render(t);var n=e.get("boundingBox"),s,o=e.next(!1),u;o&&o.get(r)?(s=o.get(i),s.insert(n,"before")):(u=e.previous(!1),u&&u.get(r)?(s=u.get(i),s.insert(n,"after")):t.contains(n)||t.appendChild(n))},_uiRemoveChild:function(e){e.get("boundingBox").remove()},_afterAddChild:function(e){var t=e.child;t.get("parent")==this&&this._uiAddChild(t,this._childrenContainer)},_afterRemoveChild:function(e){var t=e.child;t._oldParent==this&&this._uiRemoveChild(t)},_bindUIParent:function(){this.after("addChild",this._afterAddChild),this.after("removeChild",this._afterRemoveChild)},_renderChildren:function(){var e=this._childrenContainer||this.get("contentBox");this._childrenContainer=e,this.each(function(t){t.render(e)})},_destroyChildren:function(){this._hDestroyChild.detach(),this.each(function(e){e.destroy()})}},e.augment(s,e.ArrayList),e.WidgetParent=s},"3.7.2",{requires:["arraylist","base-build","widget"]});+YUI.add("widget-parent",function(e,t){function s(t){this.publish("addChild",{defaultTargetOnly:!0,defaultFn:this._defAddChildFn}),this.publish("removeChild",{defaultTargetOnly:!0,defaultFn:this._defRemoveChildFn}),this._items=[];var n,r;t&&t.children&&(n=t.children,r=this.after("initializedChange",function(e){this._add(n),r.detach()})),e.after(this._renderChildren,this,"renderUI"),e.after(this._bindUIParent,this,"bindUI"),this.after("selectionChange",this._afterSelectionChange),this.after("selectedChange",this._afterParentSelectedChange),this.after("activeDescendantChange",this._afterActiveDescendantChange),this._hDestroyChild=this.after("*:destroy",this._afterDestroyChild),this.after("*:focusedChange",this._updateActiveDescendant)}var n=e.Lang,r="rendered",i="boundingBox";s.ATTRS={defaultChildType:{setter:function(t){var r=e.Attribute.INVALID_VALUE,i=n.isString(t)?e[t]:t;return n.isFunction(i)&&(r=i),r}},activeDescendant:{readOnly:!0},multiple:{value:!1,validator:n.isBoolean,writeOnce:!0,getter:function(e){var t=this.get("root");return t&&t!=this?t.get("multiple"):e}},selection:{readOnly:!0,setter:"_setSelection",getter:function(t){var r=n.isArray(t)?new e.ArrayList(t):t;return r}},selected:{setter:function(t){var n=t;return t===1&&!this.get("multiple")&&(n=e.Attribute.INVALID_VALUE),n}}},s.prototype={destructor:function(){this._destroyChildren()},_afterDestroyChild:function(e){var t=e.target;t.get("parent")==this&&t.remove()},_afterSelectionChange:function(t){if(t.target==this&&t.src!=this){var n=t.newVal,r=0;n&&(r=2,e.instanceOf(n,e.ArrayList)&&n.size()===this.size()&&(r=1)),this.set("selected",r,{src:this})}},_afterActiveDescendantChange:function(e){var t=this.get("parent");t&&t._set("activeDescendant",e.newVal)},_afterParentSelectedChange:function(e){var t=e.newVal;this==e.target&&e.src!=this&&(t===0||t===1)&&this.each(function(e){e.set("selected",t,{src:this})},this)},_setSelection:function(e){var t=null,n;return this.get("multiple")&&!this.isEmpty()?(n=[],this.each(function(e){e.get("selected")>0&&n.push(e)}),n.length>0&&(t=n)):e.get("selected")>0&&(t=e),t},_updateSelection:function(e){var t=e.target,n;t.get("parent")==this&&(e.src!="_updateSelection"&&(n=this.get("selection"),!this.get("multiple")&&n&&e.newVal>0&&n.set("selected",0,{src:"_updateSelection"}),this._set("selection",t)),e.src==this&&this._set("selection",t,{src:this}))},_updateActiveDescendant:function(e){var t=e.newVal===!0?e.target:null;this._set("activeDescendant",t)},_createChild:function(t){var r=this.get("defaultChildType"),i=t.childType||t.type,s,o,u;return i&&(o=n.isString(i)?e[i]:i),n.isFunction(o)?u=o:r&&(u=r),u?s=new u(t):e.error("Could not create a child instance because its constructor is either undefined or invalid."),s},_defAddChildFn:function(t){var r=t.child,i=t.index,s=this._items;r.get("parent")&&r.remove(),n.isNumber(i)?s.splice(i,0,r):s.push(r),r._set("parent",this),r.addTarget(this),t.index=r.get("index"),r.after("selectedChange",e.bind(this._updateSelection,this))},_defRemoveChildFn:function(e){var t=e.child,n=e.index,r=this._items;t.get("focused")&&t.blur(),t.get("selected")&&t.set("selected",0),r.splice(n,1),t.removeTarget(this),t._oldParent=t.get("parent"),t._set("parent",null)},_add:function(t,r){var i,s,o;return n.isArray(t)?(i=[],e.each(t,function(e,t){s=this._add(e,r+t),s&&i.push(s)},this),i.length>0&&(o=i)):(e.instanceOf(t,e.Widget)?s=t:s=this._createChild(t),s&&this.fire("addChild",{child:s,index:r})&&(o=s)),o},add:function(){var t=this._add.apply(this,arguments),r=t?n.isArray(t)?t:[t]:[];return new e.ArrayList(r)},remove:function(e){var t=this._items[e],n;return t&&this.fire("removeChild",{child:t,index:e})&&(n=t),n},removeAll:function(){var t=[],n;return e.each(this._items.concat(),function(){n=this.remove(0),n&&t.push(n)},this),new e.ArrayList(t)},selectChild:function(e){this.item(e).set("selected",1)},selectAll:function(){this.set("selected",1)},deselectAll:function(){this.set("selected",0)},_uiAddChild:function(e,t){e.render(t);var n=e.get("boundingBox"),s,o=e.next(!1),u;o&&o.get(r)?(s=o.get(i),s.insert(n,"before")):(u=e.previous(!1),u&&u.get(r)?(s=u.get(i),s.insert(n,"after")):t.contains(n)||t.appendChild(n))},_uiRemoveChild:function(e){e.get("boundingBox").remove()},_afterAddChild:function(e){var t=e.child;t.get("parent")==this&&this._uiAddChild(t,this._childrenContainer)},_afterRemoveChild:function(e){var t=e.child;t._oldParent==this&&this._uiRemoveChild(t)},_bindUIParent:function(){this.after("addChild",this._afterAddChild),this.after("removeChild",this._afterRemoveChild)},_renderChildren:function(){var e=this._childrenContainer||this.get("contentBox");this._childrenContainer=e,this.each(function(t){t.render(e)})},_destroyChildren:function(){this._hDestroyChild.detach(),this.each(function(e){e.destroy()})}},e.augment(s,e.ArrayList),e.WidgetParent=s},"3.7.3",{requires:["arraylist","base-build","widget"]});
bundle/widget-parent/widget-parent.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -872,4 +872,4 @@ Y.WidgetParent = Parent; -}, '3.7.2', {"requires": ["arraylist", "base-build", "widget"]});+}, '3.7.3', {"requires": ["arraylist", "base-build", "widget"]});
bundle/widget-position-align/widget-position-align-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-position-align/widget-position-align.js", code: [] };-_yuitest_coverage["build/widget-position-align/widget-position-align.js"].code=["YUI.add('widget-position-align', function (Y, NAME) {","","/**","Provides extended/advanced XY positioning support for Widgets, through an","extension.","","It builds on top of the `widget-position` module, to provide alignment and","centering support. Future releases aim to add constrained and fixed positioning","support.","","@module widget-position-align","**/","var Lang = Y.Lang,",""," ALIGN = 'align',"," ALIGN_ON = 'alignOn',",""," VISIBLE = 'visible',"," BOUNDING_BOX = 'boundingBox',",""," OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight',"," REGION = 'region',"," VIEWPORT_REGION = 'viewportRegion';","","/**","Widget extension, which can be used to add extended XY positioning support to","the base Widget class, through the `Base.create` method.","","**Note:** This extension requires that the `WidgetPosition` extension be added","to the Widget (before `WidgetPositionAlign`, if part of the same extension list","passed to `Base.build`).","","@class WidgetPositionAlign","@param {Object} config User configuration object.","@constructor","**/","function PositionAlign (config) {"," if ( ! this._posNode) {"," Y.error('WidgetPosition needs to be added to the Widget, ' + "," 'before WidgetPositionAlign is added'); "," }",""," Y.after(this._bindUIPosAlign, this, 'bindUI');"," Y.after(this._syncUIPosAlign, this, 'syncUI');","}","","PositionAlign.ATTRS = {",""," /**"," The alignment configuration for this widget.",""," The `align` attribute is used to align a reference point on the widget, with"," the reference point on another `Node`, or the viewport. The object which"," `align` expects has the following properties:",""," * __`node`__: The `Node` to which the widget is to be aligned. If set to"," `null`, or not provided, the widget is aligned to the viewport."," "," * __`points`__: A two element Array, defining the two points on the widget"," and `Node`/viewport which are to be aligned. The first element is the"," point on the widget, and the second element is the point on the"," `Node`/viewport. Supported alignment points are defined as static"," properties on `WidgetPositionAlign`."," "," @example Aligns the top-right corner of the widget with the top-left corner "," of the viewport:",""," myWidget.set('align', {"," points: [Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.TL]"," });"," "," @attribute align"," @type Object"," @default null"," **/"," align: {"," value: null"," },",""," /**"," A convenience Attribute, which can be used as a shortcut for the `align` "," Attribute."," "," If set to `true`, the widget is centered in the viewport. If set to a `Node` "," reference or valid selector String, the widget will be centered within the "," `Node`. If set to `false`, no center positioning is applied.",""," @attribute centered"," @type Boolean|Node"," @default false"," **/"," centered: {"," setter : '_setAlignCenter',"," lazyAdd:false,"," value :false"," },",""," /**"," An Array of Objects corresponding to the `Node`s and events that will cause"," the alignment of this widget to be synced to the DOM.",""," The `alignOn` Attribute is expected to be an Array of Objects with the "," following properties:",""," * __`eventName`__: The String event name to listen for.",""," * __`node`__: The optional `Node` that will fire the event, it can be a "," `Node` reference or a selector String. This will default to the widget's "," `boundingBox`.",""," @example Sync this widget's alignment on window resize:",""," myWidget.set('alignOn', ["," {"," node : Y.one('win'),"," eventName: 'resize'"," }"," ]);",""," @attribute alignOn"," @type Array"," @default []"," **/"," alignOn: {"," value : [],"," validator: Y.Lang.isArray"," }","};","","/**","Constant used to specify the top-left corner for alignment","","@property TL","@type String","@value 'tl'","@static","**/","PositionAlign.TL = 'tl';","","/**","Constant used to specify the top-right corner for alignment"," ","@property TR","@type String","@value 'tr'","@static","**/","PositionAlign.TR = 'tr';","","/**","Constant used to specify the bottom-left corner for alignment"," ","@property BL","@type String","@value 'bl'","@static","**/","PositionAlign.BL = 'bl';","","/**","Constant used to specify the bottom-right corner for alignment","","@property BR","@type String","@value 'br'","@static","**/","PositionAlign.BR = 'br';","","/**","Constant used to specify the top edge-center point for alignment","","@property TC","@type String","@value 'tc'","@static","**/","PositionAlign.TC = 'tc';","","/**","Constant used to specify the right edge, center point for alignment"," ","@property RC","@type String","@value 'rc'","@static","**/","PositionAlign.RC = 'rc';","","/**","Constant used to specify the bottom edge, center point for alignment"," ","@property BC","@type String","@value 'bc'","@static","**/","PositionAlign.BC = 'bc';","","/**","Constant used to specify the left edge, center point for alignment"," ","@property LC","@type String","@value 'lc'","@static","**/","PositionAlign.LC = 'lc';","","/**","Constant used to specify the center of widget/node/viewport for alignment","","@property CC","@type String","@value 'cc'","@static","*/","PositionAlign.CC = 'cc';","","PositionAlign.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Holds the alignment-syncing event handles.",""," @property _posAlignUIHandles"," @type Array"," @default null"," @protected"," **/"," _posAlignUIHandles: null,",""," // -- Lifecycle Methods ----------------------------------------------------",""," destructor: function () {"," this._detachPosAlignUIHandles();"," },",""," /**"," Bind event listeners responsible for updating the UI state in response to"," the widget's position-align related state changes.",""," This method is invoked after `bindUI` has been invoked for the `Widget`"," class using the AOP infrastructure.",""," @method _bindUIPosAlign"," @protected"," **/"," _bindUIPosAlign: function () {"," this.after('alignChange', this._afterAlignChange);"," this.after('alignOnChange', this._afterAlignOnChange);"," this.after('visibleChange', this._syncUIPosAlign);"," },",""," /**"," Synchronizes the current `align` Attribute value to the DOM.",""," This method is invoked after `syncUI` has been invoked for the `Widget`"," class using the AOP infrastructure.",""," @method _syncUIPosAlign"," @protected"," **/"," _syncUIPosAlign: function () {"," var align = this.get(ALIGN);",""," this._uiSetVisiblePosAlign(this.get(VISIBLE));",""," if (align) {"," this._uiSetAlign(align.node, align.points);"," }"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Aligns this widget to the provided `Node` (or viewport) using the provided"," points. This method can be invoked with no arguments which will cause the "," widget's current `align` Attribute value to be synced to the DOM.",""," @example Aligning to the top-left corner of the `<body>`:",""," myWidget.align('body',"," [Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]);",""," @method align"," @param {Node|String|null} [node] A reference (or selector String) for the"," `Node` which with the widget is to be aligned. If null is passed in, the"," widget will be aligned with the viewport."," @param {Array[2]} [points] A two item array specifying the points on the "," widget and `Node`/viewport which will to be aligned. The first entry is "," the point on the widget, and the second entry is the point on the "," `Node`/viewport. Valid point references are defined as static constants on "," the `WidgetPositionAlign` extension."," @chainable"," **/"," align: function (node, points) {"," if (arguments.length) {"," // Set the `align` Attribute."," this.set(ALIGN, {"," node : node,"," points: points"," });"," } else {"," // Sync the current `align` Attribute value to the DOM."," this._syncUIPosAlign();"," }",""," return this;"," },",""," /**"," Centers the widget in the viewport, or if a `Node` is passed in, it will "," be centered to that `Node`.",""," @method centered"," @param {Node|String} [node] A `Node` reference or selector String defining "," the `Node` which the widget should be centered. If a `Node` is not passed"," in, then the widget will be centered to the viewport."," @chainable"," **/"," centered: function (node) {"," return this.align(node, [PositionAlign.CC, PositionAlign.CC]);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Default setter for `center` Attribute changes. Sets up the appropriate"," value, and passes it through the to the align attribute.",""," @method _setAlignCenter"," @param {Boolean|Node} val The Attribute value being set."," @return {Boolean|Node} the value passed in."," @protected"," **/"," _setAlignCenter: function (val) {"," if (val) {"," this.set(ALIGN, {"," node : val === true ? null : val,"," points: [PositionAlign.CC, PositionAlign.CC]"," });"," }",""," return val;"," },",""," /**"," Updates the UI to reflect the `align` value passed in.",""," **Note:** See the `align` Attribute documentation, for the Object structure"," expected.",""," @method _uiSetAlign"," @param {Node|String|null} [node] The node to align to, or null to indicate"," the viewport."," @param {Array} points The alignment points."," @protected"," **/"," _uiSetAlign: function (node, points) {"," if ( ! Lang.isArray(points) || points.length !== 2) {"," Y.error('align: Invalid Points Arguments');"," return;"," }",""," var nodeRegion = this._getRegion(node), "," widgetPoint, nodePoint, xy;",""," if ( ! nodeRegion) {"," // No-op, nothing to align to."," return;"," }",""," widgetPoint = points[0];"," nodePoint = points[1];",""," // TODO: Optimize KWeight - Would lookup table help?"," switch (nodePoint) {"," case PositionAlign.TL:"," xy = [nodeRegion.left, nodeRegion.top];"," break;",""," case PositionAlign.TR:"," xy = [nodeRegion.right, nodeRegion.top];"," break;",""," case PositionAlign.BL:"," xy = [nodeRegion.left, nodeRegion.bottom];"," break;",""," case PositionAlign.BR:"," xy = [nodeRegion.right, nodeRegion.bottom];"," break;",""," case PositionAlign.TC:"," xy = ["," nodeRegion.left + Math.floor(nodeRegion.width / 2),"," nodeRegion.top"," ];"," break;",""," case PositionAlign.BC:"," xy = ["," nodeRegion.left + Math.floor(nodeRegion.width / 2),"," nodeRegion.bottom"," ];"," break;",""," case PositionAlign.LC:"," xy = ["," nodeRegion.left,"," nodeRegion.top + Math.floor(nodeRegion.height / 2)"," ];"," break;",""," case PositionAlign.RC:"," xy = ["," nodeRegion.right,"," nodeRegion.top + Math.floor(nodeRegion.height / 2)"," ];"," break;",""," case PositionAlign.CC:"," xy = ["," nodeRegion.left + Math.floor(nodeRegion.width / 2),"," nodeRegion.top + Math.floor(nodeRegion.height / 2)"," ];"," break;",""," default:"," break;",""," }",""," if (xy) {"," this._doAlign(widgetPoint, xy[0], xy[1]);"," }"," },",""," /**"," Attaches or detaches alignment-syncing event handlers based on the widget's"," `visible` Attribute state.",""," @method _uiSetVisiblePosAlign"," @param {Boolean} visible The current value of the widget's `visible`"," Attribute."," @protected"," **/"," _uiSetVisiblePosAlign: function (visible) {"," if (visible) {"," this._attachPosAlignUIHandles();"," } else {"," this._detachPosAlignUIHandles();"," }"," },",""," /**"," Attaches the alignment-syncing event handlers.",""," @method _attachPosAlignUIHandles"," @protected"," **/"," _attachPosAlignUIHandles: function () {"," if (this._posAlignUIHandles) {"," // No-op if we have already setup the event handlers."," return;"," }",""," var bb = this.get(BOUNDING_BOX),"," syncAlign = Y.bind(this._syncUIPosAlign, this),"," handles = [];",""," Y.Array.each(this.get(ALIGN_ON), function (o) {"," var event = o.eventName,"," node = Y.one(o.node) || bb;"," "," if (event) {"," handles.push(node.on(event, syncAlign));"," }"," });",""," this._posAlignUIHandles = handles;"," },",""," /**"," Detaches the alignment-syncing event handlers.",""," @method _detachPosAlignUIHandles"," @protected"," **/"," _detachPosAlignUIHandles: function () {"," var handles = this._posAlignUIHandles;"," if (handles) {"," new Y.EventHandle(handles).detach();"," this._posAlignUIHandles = null;"," }"," },",""," // -- Private Methods ------------------------------------------------------",""," /**"," Helper method, used to align the given point on the widget, with the XY page"," coordinates provided.",""," @method _doAlign"," @param {String} widgetPoint Supported point constant"," (e.g. WidgetPositionAlign.TL)"," @param {Number} x X page coordinate to align to."," @param {Number} y Y page coordinate to align to."," @private"," **/"," _doAlign: function (widgetPoint, x, y) {"," var widgetNode = this._posNode,"," xy;",""," switch (widgetPoint) {"," case PositionAlign.TL:"," xy = [x, y];"," break;",""," case PositionAlign.TR:"," xy = ["," x - widgetNode.get(OFFSET_WIDTH),"," y"," ];"," break;",""," case PositionAlign.BL:"," xy = ["," x,"," y - widgetNode.get(OFFSET_HEIGHT)"," ];"," break;",""," case PositionAlign.BR:"," xy = ["," x - widgetNode.get(OFFSET_WIDTH),"," y - widgetNode.get(OFFSET_HEIGHT)"," ];"," break;",""," case PositionAlign.TC:"," xy = ["," x - (widgetNode.get(OFFSET_WIDTH) / 2),"," y"," ];"," break;",""," case PositionAlign.BC:"," xy = ["," x - (widgetNode.get(OFFSET_WIDTH) / 2),"," y - widgetNode.get(OFFSET_HEIGHT)"," ];"," break;",""," case PositionAlign.LC:"," xy = ["," x,"," y - (widgetNode.get(OFFSET_HEIGHT) / 2)"," ];"," break;",""," case PositionAlign.RC:"," xy = ["," x - widgetNode.get(OFFSET_WIDTH),"," y - (widgetNode.get(OFFSET_HEIGHT) / 2)"," ];"," break;",""," case PositionAlign.CC:"," xy = ["," x - (widgetNode.get(OFFSET_WIDTH) / 2),"," y - (widgetNode.get(OFFSET_HEIGHT) / 2)"," ];"," break;",""," default:"," break;",""," }",""," if (xy) {"," this.move(xy);"," }"," },",""," /**"," Returns the region of the passed-in `Node`, or the viewport region if"," calling with passing in a `Node`.",""," @method _getRegion"," @param {Node} [node] The node to get the region of."," @return {Object} The node's region."," @private"," **/"," _getRegion: function (node) {"," var nodeRegion;",""," if ( ! node) {"," nodeRegion = this._posNode.get(VIEWPORT_REGION);"," } else {"," node = Y.Node.one(node);"," if (node) {"," nodeRegion = node.get(REGION);"," }"," }",""," return nodeRegion;"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `alignChange` events by updating the UI in response to `align`"," Attribute changes.",""," @method _afterAlignChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlignChange: function (e) {"," var align = e.newVal;"," if (align) {"," this._uiSetAlign(align.node, align.points); "," }"," },",""," /**"," Handles `alignOnChange` events by updating the alignment-syncing event"," handlers.",""," @method _afterAlignOnChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlignOnChange: function(e) {"," this._detachPosAlignUIHandles();",""," if (this.get(VISIBLE)) {"," this._attachPosAlignUIHandles();"," }"," }","};","","Y.WidgetPositionAlign = PositionAlign;","","","}, '3.7.2', {\"requires\": [\"widget-position\"]});"];+_yuitest_coverage["build/widget-position-align/widget-position-align.js"].code=["YUI.add('widget-position-align', function (Y, NAME) {","","/**","Provides extended/advanced XY positioning support for Widgets, through an","extension.","","It builds on top of the `widget-position` module, to provide alignment and","centering support. Future releases aim to add constrained and fixed positioning","support.","","@module widget-position-align","**/","var Lang = Y.Lang,",""," ALIGN = 'align',"," ALIGN_ON = 'alignOn',",""," VISIBLE = 'visible',"," BOUNDING_BOX = 'boundingBox',",""," OFFSET_WIDTH = 'offsetWidth',"," OFFSET_HEIGHT = 'offsetHeight',"," REGION = 'region',"," VIEWPORT_REGION = 'viewportRegion';","","/**","Widget extension, which can be used to add extended XY positioning support to","the base Widget class, through the `Base.create` method.","","**Note:** This extension requires that the `WidgetPosition` extension be added","to the Widget (before `WidgetPositionAlign`, if part of the same extension list","passed to `Base.build`).","","@class WidgetPositionAlign","@param {Object} config User configuration object.","@constructor","**/","function PositionAlign (config) {"," if ( ! this._posNode) {"," Y.error('WidgetPosition needs to be added to the Widget, ' + "," 'before WidgetPositionAlign is added'); "," }",""," Y.after(this._bindUIPosAlign, this, 'bindUI');"," Y.after(this._syncUIPosAlign, this, 'syncUI');","}","","PositionAlign.ATTRS = {",""," /**"," The alignment configuration for this widget.",""," The `align` attribute is used to align a reference point on the widget, with"," the reference point on another `Node`, or the viewport. The object which"," `align` expects has the following properties:",""," * __`node`__: The `Node` to which the widget is to be aligned. If set to"," `null`, or not provided, the widget is aligned to the viewport."," "," * __`points`__: A two element Array, defining the two points on the widget"," and `Node`/viewport which are to be aligned. The first element is the"," point on the widget, and the second element is the point on the"," `Node`/viewport. Supported alignment points are defined as static"," properties on `WidgetPositionAlign`."," "," @example Aligns the top-right corner of the widget with the top-left corner "," of the viewport:",""," myWidget.set('align', {"," points: [Y.WidgetPositionAlign.TR, Y.WidgetPositionAlign.TL]"," });"," "," @attribute align"," @type Object"," @default null"," **/"," align: {"," value: null"," },",""," /**"," A convenience Attribute, which can be used as a shortcut for the `align` "," Attribute."," "," If set to `true`, the widget is centered in the viewport. If set to a `Node` "," reference or valid selector String, the widget will be centered within the "," `Node`. If set to `false`, no center positioning is applied.",""," @attribute centered"," @type Boolean|Node"," @default false"," **/"," centered: {"," setter : '_setAlignCenter',"," lazyAdd:false,"," value :false"," },",""," /**"," An Array of Objects corresponding to the `Node`s and events that will cause"," the alignment of this widget to be synced to the DOM.",""," The `alignOn` Attribute is expected to be an Array of Objects with the "," following properties:",""," * __`eventName`__: The String event name to listen for.",""," * __`node`__: The optional `Node` that will fire the event, it can be a "," `Node` reference or a selector String. This will default to the widget's "," `boundingBox`.",""," @example Sync this widget's alignment on window resize:",""," myWidget.set('alignOn', ["," {"," node : Y.one('win'),"," eventName: 'resize'"," }"," ]);",""," @attribute alignOn"," @type Array"," @default []"," **/"," alignOn: {"," value : [],"," validator: Y.Lang.isArray"," }","};","","/**","Constant used to specify the top-left corner for alignment","","@property TL","@type String","@value 'tl'","@static","**/","PositionAlign.TL = 'tl';","","/**","Constant used to specify the top-right corner for alignment"," ","@property TR","@type String","@value 'tr'","@static","**/","PositionAlign.TR = 'tr';","","/**","Constant used to specify the bottom-left corner for alignment"," ","@property BL","@type String","@value 'bl'","@static","**/","PositionAlign.BL = 'bl';","","/**","Constant used to specify the bottom-right corner for alignment","","@property BR","@type String","@value 'br'","@static","**/","PositionAlign.BR = 'br';","","/**","Constant used to specify the top edge-center point for alignment","","@property TC","@type String","@value 'tc'","@static","**/","PositionAlign.TC = 'tc';","","/**","Constant used to specify the right edge, center point for alignment"," ","@property RC","@type String","@value 'rc'","@static","**/","PositionAlign.RC = 'rc';","","/**","Constant used to specify the bottom edge, center point for alignment"," ","@property BC","@type String","@value 'bc'","@static","**/","PositionAlign.BC = 'bc';","","/**","Constant used to specify the left edge, center point for alignment"," ","@property LC","@type String","@value 'lc'","@static","**/","PositionAlign.LC = 'lc';","","/**","Constant used to specify the center of widget/node/viewport for alignment","","@property CC","@type String","@value 'cc'","@static","*/","PositionAlign.CC = 'cc';","","PositionAlign.prototype = {"," // -- Protected Properties -------------------------------------------------",""," /**"," Holds the alignment-syncing event handles.",""," @property _posAlignUIHandles"," @type Array"," @default null"," @protected"," **/"," _posAlignUIHandles: null,",""," // -- Lifecycle Methods ----------------------------------------------------",""," destructor: function () {"," this._detachPosAlignUIHandles();"," },",""," /**"," Bind event listeners responsible for updating the UI state in response to"," the widget's position-align related state changes.",""," This method is invoked after `bindUI` has been invoked for the `Widget`"," class using the AOP infrastructure.",""," @method _bindUIPosAlign"," @protected"," **/"," _bindUIPosAlign: function () {"," this.after('alignChange', this._afterAlignChange);"," this.after('alignOnChange', this._afterAlignOnChange);"," this.after('visibleChange', this._syncUIPosAlign);"," },",""," /**"," Synchronizes the current `align` Attribute value to the DOM.",""," This method is invoked after `syncUI` has been invoked for the `Widget`"," class using the AOP infrastructure.",""," @method _syncUIPosAlign"," @protected"," **/"," _syncUIPosAlign: function () {"," var align = this.get(ALIGN);",""," this._uiSetVisiblePosAlign(this.get(VISIBLE));",""," if (align) {"," this._uiSetAlign(align.node, align.points);"," }"," },",""," // -- Public Methods -------------------------------------------------------",""," /**"," Aligns this widget to the provided `Node` (or viewport) using the provided"," points. This method can be invoked with no arguments which will cause the "," widget's current `align` Attribute value to be synced to the DOM.",""," @example Aligning to the top-left corner of the `<body>`:",""," myWidget.align('body',"," [Y.WidgetPositionAlign.TL, Y.WidgetPositionAlign.TR]);",""," @method align"," @param {Node|String|null} [node] A reference (or selector String) for the"," `Node` which with the widget is to be aligned. If null is passed in, the"," widget will be aligned with the viewport."," @param {Array[2]} [points] A two item array specifying the points on the "," widget and `Node`/viewport which will to be aligned. The first entry is "," the point on the widget, and the second entry is the point on the "," `Node`/viewport. Valid point references are defined as static constants on "," the `WidgetPositionAlign` extension."," @chainable"," **/"," align: function (node, points) {"," if (arguments.length) {"," // Set the `align` Attribute."," this.set(ALIGN, {"," node : node,"," points: points"," });"," } else {"," // Sync the current `align` Attribute value to the DOM."," this._syncUIPosAlign();"," }",""," return this;"," },",""," /**"," Centers the widget in the viewport, or if a `Node` is passed in, it will "," be centered to that `Node`.",""," @method centered"," @param {Node|String} [node] A `Node` reference or selector String defining "," the `Node` which the widget should be centered. If a `Node` is not passed"," in, then the widget will be centered to the viewport."," @chainable"," **/"," centered: function (node) {"," return this.align(node, [PositionAlign.CC, PositionAlign.CC]);"," },",""," // -- Protected Methods ----------------------------------------------------",""," /**"," Default setter for `center` Attribute changes. Sets up the appropriate"," value, and passes it through the to the align attribute.",""," @method _setAlignCenter"," @param {Boolean|Node} val The Attribute value being set."," @return {Boolean|Node} the value passed in."," @protected"," **/"," _setAlignCenter: function (val) {"," if (val) {"," this.set(ALIGN, {"," node : val === true ? null : val,"," points: [PositionAlign.CC, PositionAlign.CC]"," });"," }",""," return val;"," },",""," /**"," Updates the UI to reflect the `align` value passed in.",""," **Note:** See the `align` Attribute documentation, for the Object structure"," expected.",""," @method _uiSetAlign"," @param {Node|String|null} [node] The node to align to, or null to indicate"," the viewport."," @param {Array} points The alignment points."," @protected"," **/"," _uiSetAlign: function (node, points) {"," if ( ! Lang.isArray(points) || points.length !== 2) {"," Y.error('align: Invalid Points Arguments');"," return;"," }",""," var nodeRegion = this._getRegion(node), "," widgetPoint, nodePoint, xy;",""," if ( ! nodeRegion) {"," // No-op, nothing to align to."," return;"," }",""," widgetPoint = points[0];"," nodePoint = points[1];",""," // TODO: Optimize KWeight - Would lookup table help?"," switch (nodePoint) {"," case PositionAlign.TL:"," xy = [nodeRegion.left, nodeRegion.top];"," break;",""," case PositionAlign.TR:"," xy = [nodeRegion.right, nodeRegion.top];"," break;",""," case PositionAlign.BL:"," xy = [nodeRegion.left, nodeRegion.bottom];"," break;",""," case PositionAlign.BR:"," xy = [nodeRegion.right, nodeRegion.bottom];"," break;",""," case PositionAlign.TC:"," xy = ["," nodeRegion.left + Math.floor(nodeRegion.width / 2),"," nodeRegion.top"," ];"," break;",""," case PositionAlign.BC:"," xy = ["," nodeRegion.left + Math.floor(nodeRegion.width / 2),"," nodeRegion.bottom"," ];"," break;",""," case PositionAlign.LC:"," xy = ["," nodeRegion.left,"," nodeRegion.top + Math.floor(nodeRegion.height / 2)"," ];"," break;",""," case PositionAlign.RC:"," xy = ["," nodeRegion.right,"," nodeRegion.top + Math.floor(nodeRegion.height / 2)"," ];"," break;",""," case PositionAlign.CC:"," xy = ["," nodeRegion.left + Math.floor(nodeRegion.width / 2),"," nodeRegion.top + Math.floor(nodeRegion.height / 2)"," ];"," break;",""," default:"," break;",""," }",""," if (xy) {"," this._doAlign(widgetPoint, xy[0], xy[1]);"," }"," },",""," /**"," Attaches or detaches alignment-syncing event handlers based on the widget's"," `visible` Attribute state.",""," @method _uiSetVisiblePosAlign"," @param {Boolean} visible The current value of the widget's `visible`"," Attribute."," @protected"," **/"," _uiSetVisiblePosAlign: function (visible) {"," if (visible) {"," this._attachPosAlignUIHandles();"," } else {"," this._detachPosAlignUIHandles();"," }"," },",""," /**"," Attaches the alignment-syncing event handlers.",""," @method _attachPosAlignUIHandles"," @protected"," **/"," _attachPosAlignUIHandles: function () {"," if (this._posAlignUIHandles) {"," // No-op if we have already setup the event handlers."," return;"," }",""," var bb = this.get(BOUNDING_BOX),"," syncAlign = Y.bind(this._syncUIPosAlign, this),"," handles = [];",""," Y.Array.each(this.get(ALIGN_ON), function (o) {"," var event = o.eventName,"," node = Y.one(o.node) || bb;"," "," if (event) {"," handles.push(node.on(event, syncAlign));"," }"," });",""," this._posAlignUIHandles = handles;"," },",""," /**"," Detaches the alignment-syncing event handlers.",""," @method _detachPosAlignUIHandles"," @protected"," **/"," _detachPosAlignUIHandles: function () {"," var handles = this._posAlignUIHandles;"," if (handles) {"," new Y.EventHandle(handles).detach();"," this._posAlignUIHandles = null;"," }"," },",""," // -- Private Methods ------------------------------------------------------",""," /**"," Helper method, used to align the given point on the widget, with the XY page"," coordinates provided.",""," @method _doAlign"," @param {String} widgetPoint Supported point constant"," (e.g. WidgetPositionAlign.TL)"," @param {Number} x X page coordinate to align to."," @param {Number} y Y page coordinate to align to."," @private"," **/"," _doAlign: function (widgetPoint, x, y) {"," var widgetNode = this._posNode,"," xy;",""," switch (widgetPoint) {"," case PositionAlign.TL:"," xy = [x, y];"," break;",""," case PositionAlign.TR:"," xy = ["," x - widgetNode.get(OFFSET_WIDTH),"," y"," ];"," break;",""," case PositionAlign.BL:"," xy = ["," x,"," y - widgetNode.get(OFFSET_HEIGHT)"," ];"," break;",""," case PositionAlign.BR:"," xy = ["," x - widgetNode.get(OFFSET_WIDTH),"," y - widgetNode.get(OFFSET_HEIGHT)"," ];"," break;",""," case PositionAlign.TC:"," xy = ["," x - (widgetNode.get(OFFSET_WIDTH) / 2),"," y"," ];"," break;",""," case PositionAlign.BC:"," xy = ["," x - (widgetNode.get(OFFSET_WIDTH) / 2),"," y - widgetNode.get(OFFSET_HEIGHT)"," ];"," break;",""," case PositionAlign.LC:"," xy = ["," x,"," y - (widgetNode.get(OFFSET_HEIGHT) / 2)"," ];"," break;",""," case PositionAlign.RC:"," xy = ["," x - widgetNode.get(OFFSET_WIDTH),"," y - (widgetNode.get(OFFSET_HEIGHT) / 2)"," ];"," break;",""," case PositionAlign.CC:"," xy = ["," x - (widgetNode.get(OFFSET_WIDTH) / 2),"," y - (widgetNode.get(OFFSET_HEIGHT) / 2)"," ];"," break;",""," default:"," break;",""," }",""," if (xy) {"," this.move(xy);"," }"," },",""," /**"," Returns the region of the passed-in `Node`, or the viewport region if"," calling with passing in a `Node`.",""," @method _getRegion"," @param {Node} [node] The node to get the region of."," @return {Object} The node's region."," @private"," **/"," _getRegion: function (node) {"," var nodeRegion;",""," if ( ! node) {"," nodeRegion = this._posNode.get(VIEWPORT_REGION);"," } else {"," node = Y.Node.one(node);"," if (node) {"," nodeRegion = node.get(REGION);"," }"," }",""," return nodeRegion;"," },",""," // -- Protected Event Handlers ---------------------------------------------",""," /**"," Handles `alignChange` events by updating the UI in response to `align`"," Attribute changes.",""," @method _afterAlignChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlignChange: function (e) {"," var align = e.newVal;"," if (align) {"," this._uiSetAlign(align.node, align.points); "," }"," },",""," /**"," Handles `alignOnChange` events by updating the alignment-syncing event"," handlers.",""," @method _afterAlignOnChange"," @param {EventFacade} e"," @protected"," **/"," _afterAlignOnChange: function(e) {"," this._detachPosAlignUIHandles();",""," if (this.get(VISIBLE)) {"," this._attachPosAlignUIHandles();"," }"," }","};","","Y.WidgetPositionAlign = PositionAlign;","","","}, '3.7.3', {\"requires\": [\"widget-position\"]});"]; _yuitest_coverage["build/widget-position-align/widget-position-align.js"].lines = {"1":0,"13":0,"38":0,"39":0,"40":0,"44":0,"45":0,"48":0,"139":0,"149":0,"159":0,"169":0,"179":0,"189":0,"199":0,"209":0,"219":0,"221":0,"237":0,"251":0,"252":0,"253":0,"266":0,"268":0,"270":0,"271":0,"299":0,"301":0,"307":0,"310":0,"324":0,"339":0,"340":0,"346":0,"362":0,"363":0,"364":0,"367":0,"370":0,"372":0,"375":0,"376":0,"379":0,"381":0,"382":0,"385":0,"386":0,"389":0,"390":0,"393":0,"394":0,"397":0,"401":0,"404":0,"408":0,"411":0,"415":0,"418":0,"422":0,"425":0,"429":0,"432":0,"436":0,"437":0,"451":0,"452":0,"454":0,"465":0,"467":0,"470":0,"474":0,"475":0,"478":0,"479":0,"483":0,"493":0,"494":0,"495":0,"496":0,"514":0,"517":0,"519":0,"520":0,"523":0,"527":0,"530":0,"534":0,"537":0,"541":0,"544":0,"548":0,"551":0,"555":0,"558":0,"562":0,"565":0,"569":0,"572":0,"576":0,"579":0,"583":0,"584":0,"598":0,"600":0,"601":0,"603":0,"604":0,"605":0,"609":0,"623":0,"624":0,"625":0,"638":0,"640":0,"641":0,"646":0}; _yuitest_coverage["build/widget-position-align/widget-position-align.js"].functions = {"PositionAlign:38":0,"destructor:236":0,"_bindUIPosAlign:250":0,"_syncUIPosAlign:265":0,"align:298":0,"centered:323":0,"_setAlignCenter:338":0,"_uiSetAlign:361":0,"_uiSetVisiblePosAlign:450":0,"(anonymous 2):474":0,"_attachPosAlignUIHandles:464":0,"_detachPosAlignUIHandles:492":0,"_doAlign:513":0,"_getRegion:597":0,"_afterAlignChange:622":0,"_afterAlignOnChange:637":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-position-align/widget-position-align.js"].coveredLines = 116;@@ -818,4 +818,4 @@ Y.WidgetPositionAlign = PositionAlign; -}, '3.7.2', {"requires": ["widget-position"]});+}, '3.7.3', {"requires": ["widget-position"]});
bundle/widget-position-align/widget-position-align-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -656,4 +656,4 @@ Y.WidgetPositionAlign = PositionAlign; -}, '3.7.2', {"requires": ["widget-position"]});+}, '3.7.3', {"requires": ["widget-position"]});
bundle/widget-position-align/widget-position-align-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-position-align",function(e,t){function c(t){this._posNode||e.error("WidgetPosition needs to be added to the Widget, before WidgetPositionAlign is added"),e.after(this._bindUIPosAlign,this,"bindUI"),e.after(this._syncUIPosAlign,this,"syncUI")}var n=e.Lang,r="align",i="alignOn",s="visible",o="boundingBox",u="offsetWidth",a="offsetHeight",f="region",l="viewportRegion";c.ATTRS={align:{value:null},centered:{setter:"_setAlignCenter",lazyAdd:!1,value:!1},alignOn:{value:[],validator:e.Lang.isArray}},c.TL="tl",c.TR="tr",c.BL="bl",c.BR="br",c.TC="tc",c.RC="rc",c.BC="bc",c.LC="lc",c.CC="cc",c.prototype={_posAlignUIHandles:null,destructor:function(){this._detachPosAlignUIHandles()},_bindUIPosAlign:function(){this.after("alignChange",this._afterAlignChange),this.after("alignOnChange",this._afterAlignOnChange),this.after("visibleChange",this._syncUIPosAlign)},_syncUIPosAlign:function(){var e=this.get(r);this._uiSetVisiblePosAlign(this.get(s)),e&&this._uiSetAlign(e.node,e.points)},align:function(e,t){return arguments.length?this.set(r,{node:e,points:t}):this._syncUIPosAlign(),this},centered:function(e){return this.align(e,[c.CC,c.CC])},_setAlignCenter:function(e){return e&&this.set(r,{node:e===!0?null:e,points:[c.CC,c.CC]}),e},_uiSetAlign:function(t,r){if(!n.isArray(r)||r.length!==2){e.error("align: Invalid Points Arguments");return}var i=this._getRegion(t),s,o,u;if(!i)return;s=r[0],o=r[1];switch(o){case c.TL:u=[i.left,i.top];break;case c.TR:u=[i.right,i.top];break;case c.BL:u=[i.left,i.bottom];break;case c.BR:u=[i.right,i.bottom];break;case c.TC:u=[i.left+Math.floor(i.width/2),i.top];break;case c.BC:u=[i.left+Math.floor(i.width/2),i.bottom];break;case c.LC:u=[i.left,i.top+Math.floor(i.height/2)];break;case c.RC:u=[i.right,i.top+Math.floor(i.height/2)];break;case c.CC:u=[i.left+Math.floor(i.width/2),i.top+Math.floor(i.height/2)];break;default:}u&&this._doAlign(s,u[0],u[1])},_uiSetVisiblePosAlign:function(e){e?this._attachPosAlignUIHandles():this._detachPosAlignUIHandles()},_attachPosAlignUIHandles:function(){if(this._posAlignUIHandles)return;var t=this.get(o),n=e.bind(this._syncUIPosAlign,this),r=[];e.Array.each(this.get(i),function(i){var s=i.eventName,o=e.one(i.node)||t;s&&r.push(o.on(s,n))}),this._posAlignUIHandles=r},_detachPosAlignUIHandles:function(){var t=this._posAlignUIHandles;t&&((new e.EventHandle(t)).detach(),this._posAlignUIHandles=null)},_doAlign:function(e,t,n){var r=this._posNode,i;switch(e){case c.TL:i=[t,n];break;case c.TR:i=[t-r.get(u),n];break;case c.BL:i=[t,n-r.get(a)];break;case c.BR:i=[t-r.get(u),n-r.get(a)];break;case c.TC:i=[t-r.get(u)/2,n];break;case c.BC:i=[t-r.get(u)/2,n-r.get(a)];break;case c.LC:i=[t,n-r.get(a)/2];break;case c.RC:i=[t-r.get(u),n-r.get(a)/2];break;case c.CC:i=[t-r.get(u)/2,n-r.get(a)/2];break;default:}i&&this.move(i)},_getRegion:function(t){var n;return t?(t=e.Node.one(t),t&&(n=t.get(f))):n=this._posNode.get(l),n},_afterAlignChange:function(e){var t=e.newVal;t&&this._uiSetAlign(t.node,t.points)},_afterAlignOnChange:function(e){this._detachPosAlignUIHandles(),this.get(s)&&this._attachPosAlignUIHandles()}},e.WidgetPositionAlign=c},"3.7.2",{requires:["widget-position"]});+YUI.add("widget-position-align",function(e,t){function c(t){this._posNode||e.error("WidgetPosition needs to be added to the Widget, before WidgetPositionAlign is added"),e.after(this._bindUIPosAlign,this,"bindUI"),e.after(this._syncUIPosAlign,this,"syncUI")}var n=e.Lang,r="align",i="alignOn",s="visible",o="boundingBox",u="offsetWidth",a="offsetHeight",f="region",l="viewportRegion";c.ATTRS={align:{value:null},centered:{setter:"_setAlignCenter",lazyAdd:!1,value:!1},alignOn:{value:[],validator:e.Lang.isArray}},c.TL="tl",c.TR="tr",c.BL="bl",c.BR="br",c.TC="tc",c.RC="rc",c.BC="bc",c.LC="lc",c.CC="cc",c.prototype={_posAlignUIHandles:null,destructor:function(){this._detachPosAlignUIHandles()},_bindUIPosAlign:function(){this.after("alignChange",this._afterAlignChange),this.after("alignOnChange",this._afterAlignOnChange),this.after("visibleChange",this._syncUIPosAlign)},_syncUIPosAlign:function(){var e=this.get(r);this._uiSetVisiblePosAlign(this.get(s)),e&&this._uiSetAlign(e.node,e.points)},align:function(e,t){return arguments.length?this.set(r,{node:e,points:t}):this._syncUIPosAlign(),this},centered:function(e){return this.align(e,[c.CC,c.CC])},_setAlignCenter:function(e){return e&&this.set(r,{node:e===!0?null:e,points:[c.CC,c.CC]}),e},_uiSetAlign:function(t,r){if(!n.isArray(r)||r.length!==2){e.error("align: Invalid Points Arguments");return}var i=this._getRegion(t),s,o,u;if(!i)return;s=r[0],o=r[1];switch(o){case c.TL:u=[i.left,i.top];break;case c.TR:u=[i.right,i.top];break;case c.BL:u=[i.left,i.bottom];break;case c.BR:u=[i.right,i.bottom];break;case c.TC:u=[i.left+Math.floor(i.width/2),i.top];break;case c.BC:u=[i.left+Math.floor(i.width/2),i.bottom];break;case c.LC:u=[i.left,i.top+Math.floor(i.height/2)];break;case c.RC:u=[i.right,i.top+Math.floor(i.height/2)];break;case c.CC:u=[i.left+Math.floor(i.width/2),i.top+Math.floor(i.height/2)];break;default:}u&&this._doAlign(s,u[0],u[1])},_uiSetVisiblePosAlign:function(e){e?this._attachPosAlignUIHandles():this._detachPosAlignUIHandles()},_attachPosAlignUIHandles:function(){if(this._posAlignUIHandles)return;var t=this.get(o),n=e.bind(this._syncUIPosAlign,this),r=[];e.Array.each(this.get(i),function(i){var s=i.eventName,o=e.one(i.node)||t;s&&r.push(o.on(s,n))}),this._posAlignUIHandles=r},_detachPosAlignUIHandles:function(){var t=this._posAlignUIHandles;t&&((new e.EventHandle(t)).detach(),this._posAlignUIHandles=null)},_doAlign:function(e,t,n){var r=this._posNode,i;switch(e){case c.TL:i=[t,n];break;case c.TR:i=[t-r.get(u),n];break;case c.BL:i=[t,n-r.get(a)];break;case c.BR:i=[t-r.get(u),n-r.get(a)];break;case c.TC:i=[t-r.get(u)/2,n];break;case c.BC:i=[t-r.get(u)/2,n-r.get(a)];break;case c.LC:i=[t,n-r.get(a)/2];break;case c.RC:i=[t-r.get(u),n-r.get(a)/2];break;case c.CC:i=[t-r.get(u)/2,n-r.get(a)/2];break;default:}i&&this.move(i)},_getRegion:function(t){var n;return t?(t=e.Node.one(t),t&&(n=t.get(f))):n=this._posNode.get(l),n},_afterAlignChange:function(e){var t=e.newVal;t&&this._uiSetAlign(t.node,t.points)},_afterAlignOnChange:function(e){this._detachPosAlignUIHandles(),this.get(s)&&this._attachPosAlignUIHandles()}},e.WidgetPositionAlign=c},"3.7.3",{requires:["widget-position"]});
bundle/widget-position-align/widget-position-align.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -652,4 +652,4 @@ Y.WidgetPositionAlign = PositionAlign; -}, '3.7.2', {"requires": ["widget-position"]});+}, '3.7.3', {"requires": ["widget-position"]});
bundle/widget-position-constrain/widget-position-constrain-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-position-constrain/widget-position-constrain.js", code: [] };-_yuitest_coverage["build/widget-position-constrain/widget-position-constrain.js"].code=["YUI.add('widget-position-constrain', function (Y, NAME) {","","/**"," * Provides constrained xy positioning support for Widgets, through an extension."," *"," * It builds on top of the widget-position module, to provide constrained positioning support."," *"," * @module widget-position-constrain"," */","var CONSTRAIN = \"constrain\","," CONSTRAIN_XYCHANGE = \"constrain|xyChange\","," CONSTRAIN_CHANGE = \"constrainChange\",",""," PREVENT_OVERLAP = \"preventOverlap\","," ALIGN = \"align\","," "," EMPTY_STR = \"\",",""," BINDUI = \"bindUI\",",""," XY = \"xy\","," X_COORD = \"x\","," Y_COORD = \"y\",",""," Node = Y.Node,",""," VIEWPORT_REGION = \"viewportRegion\","," REGION = \"region\",",""," PREVENT_OVERLAP_MAP;","","/**"," * A widget extension, which can be used to add constrained xy positioning support to the base Widget class,"," * through the <a href=\"Base.html#method_build\">Base.build</a> method. This extension requires that "," * the WidgetPosition extension be added to the Widget (before WidgetPositionConstrain, if part of the same "," * extension list passed to Base.build)."," *"," * @class WidgetPositionConstrain"," * @param {Object} User configuration object"," */","function PositionConstrain(config) {"," if (!this._posNode) {"," Y.error(\"WidgetPosition needs to be added to the Widget, before WidgetPositionConstrain is added\"); "," }"," Y.after(this._bindUIPosConstrained, this, BINDUI);","}","","/**"," * Static property used to define the default attribute "," * configuration introduced by WidgetPositionConstrain."," *"," * @property ATTRS"," * @type Object"," * @static"," */","PositionConstrain.ATTRS = {",""," /**"," * @attribute constrain"," * @type boolean | Node"," * @default null"," * @description The node to constrain the widget's bounding box to, when setting xy. Can also be"," * set to true, to constrain to the viewport."," */"," constrain : {"," value: null,"," setter: \"_setConstrain\""," },",""," /**"," * @attribute preventOverlap"," * @type boolean"," * @description If set to true, and WidgetPositionAlign is also added to the Widget, "," * constrained positioning will attempt to prevent the widget's bounding box from overlapping "," * the element to which it has been aligned, by flipping the orientation of the alignment"," * for corner based alignments "," */"," preventOverlap : {"," value:false"," }","};","","/**"," * @property _PREVENT_OVERLAP"," * @static"," * @protected"," * @type Object"," * @description The set of positions for which to prevent"," * overlap."," */","PREVENT_OVERLAP_MAP = PositionConstrain._PREVENT_OVERLAP = {"," x: {"," \"tltr\": 1,"," \"blbr\": 1,"," \"brbl\": 1,"," \"trtl\": 1"," },"," y : {"," \"trbr\": 1,"," \"tlbl\": 1,"," \"bltl\": 1,"," \"brtr\": 1"," }","};","","PositionConstrain.prototype = {",""," /**"," * Calculates the constrained positions for the XY positions provided, using"," * the provided node argument is passed in. If no node value is passed in, the value of "," * the \"constrain\" attribute is used."," * "," * @method getConstrainedXY"," * @param {Array} xy The xy values to constrain"," * @param {Node | boolean} node Optional. The node to constrain to, or true for the viewport"," * @return {Array} The constrained xy values"," */"," getConstrainedXY : function(xy, node) {"," node = node || this.get(CONSTRAIN);",""," var constrainingRegion = this._getRegion((node === true) ? null : node),"," nodeRegion = this._posNode.get(REGION);",""," return ["," this._constrain(xy[0], X_COORD, nodeRegion, constrainingRegion),"," this._constrain(xy[1], Y_COORD, nodeRegion, constrainingRegion)"," ];"," },",""," /**"," * Constrains the widget's bounding box to a node (or the viewport). If xy or node are not "," * passed in, the current position and the value of \"constrain\" will be used respectively."," * "," * The widget's position will be changed to the constrained position."," *"," * @method constrain "," * @param {Array} xy Optional. The xy values to constrain"," * @param {Node | boolean} node Optional. The node to constrain to, or true for the viewport"," */"," constrain : function(xy, node) {"," var currentXY, "," constrainedXY,"," constraint = node || this.get(CONSTRAIN);",""," if (constraint) {"," currentXY = xy || this.get(XY);"," constrainedXY = this.getConstrainedXY(currentXY, constraint);",""," if (constrainedXY[0] !== currentXY[0] || constrainedXY[1] !== currentXY[1]) {"," this.set(XY, constrainedXY, { constrained:true });"," }"," }"," },",""," /**"," * The setter implementation for the \"constrain\" attribute."," *"," * @method _setConstrain"," * @protected"," * @param {Node | boolean} val The attribute value "," */"," _setConstrain : function(val) {"," return (val === true) ? val : Node.one(val);"," },",""," /**"," * The method which performs the actual constrain calculations for a given axis (\"x\" or \"y\") based"," * on the regions provided."," * "," * @method _constrain"," * @protected"," * "," * @param {Number} val The value to constrain"," * @param {String} axis The axis to use for constrainment"," * @param {Region} nodeRegion The region of the node to constrain"," * @param {Region} constrainingRegion The region of the node (or viewport) to constrain to"," * "," * @return {Number} The constrained value"," */"," _constrain: function(val, axis, nodeRegion, constrainingRegion) {"," if (constrainingRegion) {",""," if (this.get(PREVENT_OVERLAP)) {"," val = this._preventOverlap(val, axis, nodeRegion, constrainingRegion);"," }",""," var x = (axis == X_COORD),",""," regionSize = (x) ? constrainingRegion.width : constrainingRegion.height,"," nodeSize = (x) ? nodeRegion.width : nodeRegion.height,"," minConstraint = (x) ? constrainingRegion.left : constrainingRegion.top,"," maxConstraint = (x) ? constrainingRegion.right - nodeSize : constrainingRegion.bottom - nodeSize;",""," if (val < minConstraint || val > maxConstraint) {"," if (nodeSize < regionSize) {"," if (val < minConstraint) {"," val = minConstraint;"," } else if (val > maxConstraint) {"," val = maxConstraint;"," }"," } else {"," val = minConstraint;"," }"," }"," }",""," return val;"," },",""," /**"," * The method which performs the preventOverlap calculations for a given axis (\"x\" or \"y\") based"," * on the value and regions provided."," * "," * @method _preventOverlap"," * @protected"," *"," * @param {Number} val The value being constrain"," * @param {String} axis The axis to being constrained"," * @param {Region} nodeRegion The region of the node being constrained"," * @param {Region} constrainingRegion The region of the node (or viewport) we need to constrain to"," * "," * @return {Number} The constrained value"," */"," _preventOverlap : function(val, axis, nodeRegion, constrainingRegion) {",""," var align = this.get(ALIGN),"," x = (axis === X_COORD),"," nodeSize,"," alignRegion,"," nearEdge,"," farEdge,"," spaceOnNearSide, "," spaceOnFarSide;",""," if (align && align.points && PREVENT_OVERLAP_MAP[axis][align.points.join(EMPTY_STR)]) {",""," alignRegion = this._getRegion(align.node);",""," if (alignRegion) {"," nodeSize = (x) ? nodeRegion.width : nodeRegion.height;"," nearEdge = (x) ? alignRegion.left : alignRegion.top;"," farEdge = (x) ? alignRegion.right : alignRegion.bottom;"," spaceOnNearSide = (x) ? alignRegion.left - constrainingRegion.left : alignRegion.top - constrainingRegion.top;"," spaceOnFarSide = (x) ? constrainingRegion.right - alignRegion.right : constrainingRegion.bottom - alignRegion.bottom;"," }"," "," if (val > nearEdge) {"," if (spaceOnFarSide < nodeSize && spaceOnNearSide > nodeSize) {"," val = nearEdge - nodeSize;"," }"," } else {"," if (spaceOnNearSide < nodeSize && spaceOnFarSide > nodeSize) {"," val = farEdge;"," }"," }"," }",""," return val;"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to "," * Widget constrained positioning related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," *"," * @method _bindUIPosConstrained"," * @protected"," */"," _bindUIPosConstrained : function() {"," this.after(CONSTRAIN_CHANGE, this._afterConstrainChange);"," this._enableConstraints(this.get(CONSTRAIN));"," },",""," /**"," * After change listener for the \"constrain\" attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterConstrainChange"," * @protected"," * @param {EventFacade} e The event facade"," */"," _afterConstrainChange : function(e) {"," this._enableConstraints(e.newVal);"," },",""," /**"," * Updates the UI if enabling constraints, and sets up the xyChange event listeners"," * to constrain whenever the widget is moved. Disabling constraints removes the listeners."," * "," * @method enable or disable constraints listeners"," * @private"," * @param {boolean} enable Enable or disable constraints "," */"," _enableConstraints : function(enable) {"," if (enable) {"," this.constrain();"," this._cxyHandle = this._cxyHandle || this.on(CONSTRAIN_XYCHANGE, this._constrainOnXYChange);"," } else if (this._cxyHandle) {"," this._cxyHandle.detach();"," this._cxyHandle = null; "," }"," },",""," /**"," * The on change listener for the \"xy\" attribute. Modifies the event facade's"," * newVal property with the constrained XY value."," *"," * @method _constrainOnXYChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _constrainOnXYChange : function(e) {"," if (!e.constrained) {"," e.newVal = this.getConstrainedXY(e.newVal);"," }"," },",""," /**"," * Utility method to normalize region retrieval from a node instance, "," * or the viewport, if no node is provided. "," * "," * @method _getRegion"," * @private"," * @param {Node} node Optional."," */"," _getRegion : function(node) {"," var region;"," if (!node) {"," region = this._posNode.get(VIEWPORT_REGION);"," } else {"," node = Node.one(node);"," if (node) {"," region = node.get(REGION);"," }"," }"," return region;"," }","};","","Y.WidgetPositionConstrain = PositionConstrain;","","","}, '3.7.2', {\"requires\": [\"widget-position\"]});"];+_yuitest_coverage["build/widget-position-constrain/widget-position-constrain.js"].code=["YUI.add('widget-position-constrain', function (Y, NAME) {","","/**"," * Provides constrained xy positioning support for Widgets, through an extension."," *"," * It builds on top of the widget-position module, to provide constrained positioning support."," *"," * @module widget-position-constrain"," */","var CONSTRAIN = \"constrain\","," CONSTRAIN_XYCHANGE = \"constrain|xyChange\","," CONSTRAIN_CHANGE = \"constrainChange\",",""," PREVENT_OVERLAP = \"preventOverlap\","," ALIGN = \"align\","," "," EMPTY_STR = \"\",",""," BINDUI = \"bindUI\",",""," XY = \"xy\","," X_COORD = \"x\","," Y_COORD = \"y\",",""," Node = Y.Node,",""," VIEWPORT_REGION = \"viewportRegion\","," REGION = \"region\",",""," PREVENT_OVERLAP_MAP;","","/**"," * A widget extension, which can be used to add constrained xy positioning support to the base Widget class,"," * through the <a href=\"Base.html#method_build\">Base.build</a> method. This extension requires that "," * the WidgetPosition extension be added to the Widget (before WidgetPositionConstrain, if part of the same "," * extension list passed to Base.build)."," *"," * @class WidgetPositionConstrain"," * @param {Object} User configuration object"," */","function PositionConstrain(config) {"," if (!this._posNode) {"," Y.error(\"WidgetPosition needs to be added to the Widget, before WidgetPositionConstrain is added\"); "," }"," Y.after(this._bindUIPosConstrained, this, BINDUI);","}","","/**"," * Static property used to define the default attribute "," * configuration introduced by WidgetPositionConstrain."," *"," * @property ATTRS"," * @type Object"," * @static"," */","PositionConstrain.ATTRS = {",""," /**"," * @attribute constrain"," * @type boolean | Node"," * @default null"," * @description The node to constrain the widget's bounding box to, when setting xy. Can also be"," * set to true, to constrain to the viewport."," */"," constrain : {"," value: null,"," setter: \"_setConstrain\""," },",""," /**"," * @attribute preventOverlap"," * @type boolean"," * @description If set to true, and WidgetPositionAlign is also added to the Widget, "," * constrained positioning will attempt to prevent the widget's bounding box from overlapping "," * the element to which it has been aligned, by flipping the orientation of the alignment"," * for corner based alignments "," */"," preventOverlap : {"," value:false"," }","};","","/**"," * @property _PREVENT_OVERLAP"," * @static"," * @protected"," * @type Object"," * @description The set of positions for which to prevent"," * overlap."," */","PREVENT_OVERLAP_MAP = PositionConstrain._PREVENT_OVERLAP = {"," x: {"," \"tltr\": 1,"," \"blbr\": 1,"," \"brbl\": 1,"," \"trtl\": 1"," },"," y : {"," \"trbr\": 1,"," \"tlbl\": 1,"," \"bltl\": 1,"," \"brtr\": 1"," }","};","","PositionConstrain.prototype = {",""," /**"," * Calculates the constrained positions for the XY positions provided, using"," * the provided node argument is passed in. If no node value is passed in, the value of "," * the \"constrain\" attribute is used."," * "," * @method getConstrainedXY"," * @param {Array} xy The xy values to constrain"," * @param {Node | boolean} node Optional. The node to constrain to, or true for the viewport"," * @return {Array} The constrained xy values"," */"," getConstrainedXY : function(xy, node) {"," node = node || this.get(CONSTRAIN);",""," var constrainingRegion = this._getRegion((node === true) ? null : node),"," nodeRegion = this._posNode.get(REGION);",""," return ["," this._constrain(xy[0], X_COORD, nodeRegion, constrainingRegion),"," this._constrain(xy[1], Y_COORD, nodeRegion, constrainingRegion)"," ];"," },",""," /**"," * Constrains the widget's bounding box to a node (or the viewport). If xy or node are not "," * passed in, the current position and the value of \"constrain\" will be used respectively."," * "," * The widget's position will be changed to the constrained position."," *"," * @method constrain "," * @param {Array} xy Optional. The xy values to constrain"," * @param {Node | boolean} node Optional. The node to constrain to, or true for the viewport"," */"," constrain : function(xy, node) {"," var currentXY, "," constrainedXY,"," constraint = node || this.get(CONSTRAIN);",""," if (constraint) {"," currentXY = xy || this.get(XY);"," constrainedXY = this.getConstrainedXY(currentXY, constraint);",""," if (constrainedXY[0] !== currentXY[0] || constrainedXY[1] !== currentXY[1]) {"," this.set(XY, constrainedXY, { constrained:true });"," }"," }"," },",""," /**"," * The setter implementation for the \"constrain\" attribute."," *"," * @method _setConstrain"," * @protected"," * @param {Node | boolean} val The attribute value "," */"," _setConstrain : function(val) {"," return (val === true) ? val : Node.one(val);"," },",""," /**"," * The method which performs the actual constrain calculations for a given axis (\"x\" or \"y\") based"," * on the regions provided."," * "," * @method _constrain"," * @protected"," * "," * @param {Number} val The value to constrain"," * @param {String} axis The axis to use for constrainment"," * @param {Region} nodeRegion The region of the node to constrain"," * @param {Region} constrainingRegion The region of the node (or viewport) to constrain to"," * "," * @return {Number} The constrained value"," */"," _constrain: function(val, axis, nodeRegion, constrainingRegion) {"," if (constrainingRegion) {",""," if (this.get(PREVENT_OVERLAP)) {"," val = this._preventOverlap(val, axis, nodeRegion, constrainingRegion);"," }",""," var x = (axis == X_COORD),",""," regionSize = (x) ? constrainingRegion.width : constrainingRegion.height,"," nodeSize = (x) ? nodeRegion.width : nodeRegion.height,"," minConstraint = (x) ? constrainingRegion.left : constrainingRegion.top,"," maxConstraint = (x) ? constrainingRegion.right - nodeSize : constrainingRegion.bottom - nodeSize;",""," if (val < minConstraint || val > maxConstraint) {"," if (nodeSize < regionSize) {"," if (val < minConstraint) {"," val = minConstraint;"," } else if (val > maxConstraint) {"," val = maxConstraint;"," }"," } else {"," val = minConstraint;"," }"," }"," }",""," return val;"," },",""," /**"," * The method which performs the preventOverlap calculations for a given axis (\"x\" or \"y\") based"," * on the value and regions provided."," * "," * @method _preventOverlap"," * @protected"," *"," * @param {Number} val The value being constrain"," * @param {String} axis The axis to being constrained"," * @param {Region} nodeRegion The region of the node being constrained"," * @param {Region} constrainingRegion The region of the node (or viewport) we need to constrain to"," * "," * @return {Number} The constrained value"," */"," _preventOverlap : function(val, axis, nodeRegion, constrainingRegion) {",""," var align = this.get(ALIGN),"," x = (axis === X_COORD),"," nodeSize,"," alignRegion,"," nearEdge,"," farEdge,"," spaceOnNearSide, "," spaceOnFarSide;",""," if (align && align.points && PREVENT_OVERLAP_MAP[axis][align.points.join(EMPTY_STR)]) {",""," alignRegion = this._getRegion(align.node);",""," if (alignRegion) {"," nodeSize = (x) ? nodeRegion.width : nodeRegion.height;"," nearEdge = (x) ? alignRegion.left : alignRegion.top;"," farEdge = (x) ? alignRegion.right : alignRegion.bottom;"," spaceOnNearSide = (x) ? alignRegion.left - constrainingRegion.left : alignRegion.top - constrainingRegion.top;"," spaceOnFarSide = (x) ? constrainingRegion.right - alignRegion.right : constrainingRegion.bottom - alignRegion.bottom;"," }"," "," if (val > nearEdge) {"," if (spaceOnFarSide < nodeSize && spaceOnNearSide > nodeSize) {"," val = nearEdge - nodeSize;"," }"," } else {"," if (spaceOnNearSide < nodeSize && spaceOnFarSide > nodeSize) {"," val = farEdge;"," }"," }"," }",""," return val;"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to "," * Widget constrained positioning related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," *"," * @method _bindUIPosConstrained"," * @protected"," */"," _bindUIPosConstrained : function() {"," this.after(CONSTRAIN_CHANGE, this._afterConstrainChange);"," this._enableConstraints(this.get(CONSTRAIN));"," },",""," /**"," * After change listener for the \"constrain\" attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterConstrainChange"," * @protected"," * @param {EventFacade} e The event facade"," */"," _afterConstrainChange : function(e) {"," this._enableConstraints(e.newVal);"," },",""," /**"," * Updates the UI if enabling constraints, and sets up the xyChange event listeners"," * to constrain whenever the widget is moved. Disabling constraints removes the listeners."," * "," * @method enable or disable constraints listeners"," * @private"," * @param {boolean} enable Enable or disable constraints "," */"," _enableConstraints : function(enable) {"," if (enable) {"," this.constrain();"," this._cxyHandle = this._cxyHandle || this.on(CONSTRAIN_XYCHANGE, this._constrainOnXYChange);"," } else if (this._cxyHandle) {"," this._cxyHandle.detach();"," this._cxyHandle = null; "," }"," },",""," /**"," * The on change listener for the \"xy\" attribute. Modifies the event facade's"," * newVal property with the constrained XY value."," *"," * @method _constrainOnXYChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _constrainOnXYChange : function(e) {"," if (!e.constrained) {"," e.newVal = this.getConstrainedXY(e.newVal);"," }"," },",""," /**"," * Utility method to normalize region retrieval from a node instance, "," * or the viewport, if no node is provided. "," * "," * @method _getRegion"," * @private"," * @param {Node} node Optional."," */"," _getRegion : function(node) {"," var region;"," if (!node) {"," region = this._posNode.get(VIEWPORT_REGION);"," } else {"," node = Node.one(node);"," if (node) {"," region = node.get(REGION);"," }"," }"," return region;"," }","};","","Y.WidgetPositionConstrain = PositionConstrain;","","","}, '3.7.3', {\"requires\": [\"widget-position\"]});"]; _yuitest_coverage["build/widget-position-constrain/widget-position-constrain.js"].lines = {"1":0,"10":0,"41":0,"42":0,"43":0,"45":0,"56":0,"91":0,"106":0,"119":0,"121":0,"124":0,"141":0,"145":0,"146":0,"147":0,"149":0,"150":0,"163":0,"181":0,"183":0,"184":0,"187":0,"194":0,"195":0,"196":0,"197":0,"198":0,"199":0,"202":0,"207":0,"226":0,"235":0,"237":0,"239":0,"240":0,"241":0,"242":0,"243":0,"244":0,"247":0,"248":0,"249":0,"252":0,"253":0,"258":0,"273":0,"274":0,"286":0,"298":0,"299":0,"300":0,"301":0,"302":0,"303":0,"316":0,"317":0,"330":0,"331":0,"332":0,"334":0,"335":0,"336":0,"339":0,"343":0}; _yuitest_coverage["build/widget-position-constrain/widget-position-constrain.js"].functions = {"PositionConstrain:41":0,"getConstrainedXY:118":0,"constrain:140":0,"_setConstrain:162":0,"_constrain:180":0,"_preventOverlap:224":0,"_bindUIPosConstrained:272":0,"_afterConstrainChange:285":0,"_enableConstraints:297":0,"_constrainOnXYChange:315":0,"_getRegion:329":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-position-constrain/widget-position-constrain.js"].coveredLines = 65;@@ -459,4 +459,4 @@ Y.WidgetPositionConstrain = PositionConstrain; -}, '3.7.2', {"requires": ["widget-position"]});+}, '3.7.3', {"requires": ["widget-position"]});
bundle/widget-position-constrain/widget-position-constrain-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -349,4 +349,4 @@ Y.WidgetPositionConstrain = PositionConstrain; -}, '3.7.2', {"requires": ["widget-position"]});+}, '3.7.3', {"requires": ["widget-position"]});
bundle/widget-position-constrain/widget-position-constrain-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-position-constrain",function(e,t){function m(t){this._posNode||e.error("WidgetPosition needs to be added to the Widget, before WidgetPositionConstrain is added"),e.after(this._bindUIPosConstrained,this,a)}var n="constrain",r="constrain|xyChange",i="constrainChange",s="preventOverlap",o="align",u="",a="bindUI",f="xy",l="x",c="y",h=e.Node,p="viewportRegion",d="region",v;m.ATTRS={constrain:{value:null,setter:"_setConstrain"},preventOverlap:{value:!1}},v=m._PREVENT_OVERLAP={x:{tltr:1,blbr:1,brbl:1,trtl:1},y:{trbr:1,tlbl:1,bltl:1,brtr:1}},m.prototype={getConstrainedXY:function(e,t){t=t||this.get(n);var r=this._getRegion(t===!0?null:t),i=this._posNode.get(d);return[this._constrain(e[0],l,i,r),this._constrain(e[1],c,i,r)]},constrain:function(e,t){var r,i,s=t||this.get(n);s&&(r=e||this.get(f),i=this.getConstrainedXY(r,s),(i[0]!==r[0]||i[1]!==r[1])&&this.set(f,i,{constrained:!0}))},_setConstrain:function(e){return e===!0?e:h.one(e)},_constrain:function(e,t,n,r){if(r){this.get(s)&&(e=this._preventOverlap(e,t,n,r));var i=t==l,o=i?r.width:r.height,u=i?n.width:n.height,a=i?r.left:r.top,f=i?r.right-u:r.bottom-u;if(e<a||e>f)u<o?e<a?e=a:e>f&&(e=f):e=a}return e},_preventOverlap:function(e,t,n,r){var i=this.get(o),s=t===l,a,f,c,h,p,d;return i&&i.points&&v[t][i.points.join(u)]&&(f=this._getRegion(i.node),f&&(a=s?n.width:n.height,c=s?f.left:f.top,h=s?f.right:f.bottom,p=s?f.left-r.left:f.top-r.top,d=s?r.right-f.right:r.bottom-f.bottom),e>c?d<a&&p>a&&(e=c-a):p<a&&d>a&&(e=h)),e},_bindUIPosConstrained:function(){this.after(i,this._afterConstrainChange),this._enableConstraints(this.get(n))},_afterConstrainChange:function(e){this._enableConstraints(e.newVal)},_enableConstraints:function(e){e?(this.constrain(),this._cxyHandle=this._cxyHandle||this.on(r,this._constrainOnXYChange)):this._cxyHandle&&(this._cxyHandle.detach(),this._cxyHandle=null)},_constrainOnXYChange:function(e){e.constrained||(e.newVal=this.getConstrainedXY(e.newVal))},_getRegion:function(e){var t;return e?(e=h.one(e),e&&(t=e.get(d))):t=this._posNode.get(p),t}},e.WidgetPositionConstrain=m},"3.7.2",{requires:["widget-position"]});+YUI.add("widget-position-constrain",function(e,t){function m(t){this._posNode||e.error("WidgetPosition needs to be added to the Widget, before WidgetPositionConstrain is added"),e.after(this._bindUIPosConstrained,this,a)}var n="constrain",r="constrain|xyChange",i="constrainChange",s="preventOverlap",o="align",u="",a="bindUI",f="xy",l="x",c="y",h=e.Node,p="viewportRegion",d="region",v;m.ATTRS={constrain:{value:null,setter:"_setConstrain"},preventOverlap:{value:!1}},v=m._PREVENT_OVERLAP={x:{tltr:1,blbr:1,brbl:1,trtl:1},y:{trbr:1,tlbl:1,bltl:1,brtr:1}},m.prototype={getConstrainedXY:function(e,t){t=t||this.get(n);var r=this._getRegion(t===!0?null:t),i=this._posNode.get(d);return[this._constrain(e[0],l,i,r),this._constrain(e[1],c,i,r)]},constrain:function(e,t){var r,i,s=t||this.get(n);s&&(r=e||this.get(f),i=this.getConstrainedXY(r,s),(i[0]!==r[0]||i[1]!==r[1])&&this.set(f,i,{constrained:!0}))},_setConstrain:function(e){return e===!0?e:h.one(e)},_constrain:function(e,t,n,r){if(r){this.get(s)&&(e=this._preventOverlap(e,t,n,r));var i=t==l,o=i?r.width:r.height,u=i?n.width:n.height,a=i?r.left:r.top,f=i?r.right-u:r.bottom-u;if(e<a||e>f)u<o?e<a?e=a:e>f&&(e=f):e=a}return e},_preventOverlap:function(e,t,n,r){var i=this.get(o),s=t===l,a,f,c,h,p,d;return i&&i.points&&v[t][i.points.join(u)]&&(f=this._getRegion(i.node),f&&(a=s?n.width:n.height,c=s?f.left:f.top,h=s?f.right:f.bottom,p=s?f.left-r.left:f.top-r.top,d=s?r.right-f.right:r.bottom-f.bottom),e>c?d<a&&p>a&&(e=c-a):p<a&&d>a&&(e=h)),e},_bindUIPosConstrained:function(){this.after(i,this._afterConstrainChange),this._enableConstraints(this.get(n))},_afterConstrainChange:function(e){this._enableConstraints(e.newVal)},_enableConstraints:function(e){e?(this.constrain(),this._cxyHandle=this._cxyHandle||this.on(r,this._constrainOnXYChange)):this._cxyHandle&&(this._cxyHandle.detach(),this._cxyHandle=null)},_constrainOnXYChange:function(e){e.constrained||(e.newVal=this.getConstrainedXY(e.newVal))},_getRegion:function(e){var t;return e?(e=h.one(e),e&&(t=e.get(d))):t=this._posNode.get(p),t}},e.WidgetPositionConstrain=m},"3.7.3",{requires:["widget-position"]});
bundle/widget-position-constrain/widget-position-constrain.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -349,4 +349,4 @@ Y.WidgetPositionConstrain = PositionConstrain; -}, '3.7.2', {"requires": ["widget-position"]});+}, '3.7.3', {"requires": ["widget-position"]});
bundle/widget-position/widget-position-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-position/widget-position.js", code: [] };-_yuitest_coverage["build/widget-position/widget-position.js"].code=["YUI.add('widget-position', function (Y, NAME) {","","/**"," * Provides basic XY positioning support for Widgets, though an extension"," *"," * @module widget-position"," */"," var Lang = Y.Lang,"," Widget = Y.Widget,",""," XY_COORD = \"xy\",",""," POSITION = \"position\","," POSITIONED = \"positioned\","," BOUNDING_BOX = \"boundingBox\","," RELATIVE = \"relative\",",""," RENDERUI = \"renderUI\","," BINDUI = \"bindUI\","," SYNCUI = \"syncUI\",",""," UI = Widget.UI_SRC,",""," XYChange = \"xyChange\";",""," /**"," * Widget extension, which can be used to add positioning support to the base Widget class, "," * through the <a href=\"Base.html#method_build\">Base.build</a> method."," *"," * @class WidgetPosition"," * @param {Object} config User configuration object"," */"," function Position(config) {"," this._posNode = this.get(BOUNDING_BOX);",""," // WIDGET METHOD OVERLAP"," Y.after(this._renderUIPosition, this, RENDERUI);"," Y.after(this._syncUIPosition, this, SYNCUI);"," Y.after(this._bindUIPosition, this, BINDUI);"," }",""," /**"," * Static property used to define the default attribute "," * configuration introduced by WidgetPosition."," *"," * @property ATTRS"," * @static"," * @type Object"," */"," Position.ATTRS = {",""," /**"," * @attribute x"," * @type number"," * @default 0"," *"," * @description Page X co-ordinate for the widget. This attribute acts as a facade for the "," * xy attribute. Changes in position can be monitored by listening for xyChange events."," */"," x: {"," setter: function(val) {"," this._setX(val);"," },"," getter: function() {"," return this._getX();"," },"," lazyAdd:false"," },",""," /**"," * @attribute y"," * @type number"," * @default 0"," *"," * @description Page Y co-ordinate for the widget. This attribute acts as a facade for the "," * xy attribute. Changes in position can be monitored by listening for xyChange events."," */"," y: {"," setter: function(val) {"," this._setY(val);"," },"," getter: function() {"," return this._getY();"," },"," lazyAdd: false"," },",""," /**"," * @attribute xy"," * @type Array"," * @default [0,0]"," *"," * @description Page XY co-ordinate pair for the widget."," */"," xy: {"," value:[0,0],"," validator: function(val) {"," return this._validateXY(val);"," }"," }"," };",""," /**"," * Default class used to mark the boundingBox of a positioned widget."," *"," * @property POSITIONED_CLASS_NAME"," * @type String"," * @default \"yui-widget-positioned\""," * @static"," */"," Position.POSITIONED_CLASS_NAME = Widget.getClassName(POSITIONED);",""," Position.prototype = {",""," /**"," * Creates/Initializes the DOM to support xy page positioning."," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIPosition"," * @protected"," */"," _renderUIPosition : function() {"," this._posNode.addClass(Position.POSITIONED_CLASS_NAME);"," },",""," /**"," * Synchronizes the UI to match the Widgets xy page position state."," * <p>"," * This method in invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIPosition"," * @protected"," */"," _syncUIPosition : function() {"," var posNode = this._posNode;"," if (posNode.getStyle(POSITION) === RELATIVE) {"," this.syncXY();"," }"," this._uiSetXY(this.get(XY_COORD));"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to "," * Widget position related state changes."," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIPosition"," * @protected"," */"," _bindUIPosition :function() {"," this.after(XYChange, this._afterXYChange);"," },",""," /**"," * Moves the Widget to the specified page xy co-ordinate position."," *"," * @method move"," *"," * @param {Number} x The new x position"," * @param {Number} y The new y position"," * <p>Or</p>"," * @param {Array} x, y values passed as an array ([x, y]), to support"," * simple pass through of Node.getXY results"," */"," move: function () {"," var args = arguments,"," coord = (Lang.isArray(args[0])) ? args[0] : [args[0], args[1]];"," this.set(XY_COORD, coord);"," },",""," /**"," * Synchronizes the Panel's \"xy\", \"x\", and \"y\" properties with the "," * Widget's position in the DOM."," *"," * @method syncXY"," */"," syncXY : function () {"," this.set(XY_COORD, this._posNode.getXY(), {src: UI});"," },",""," /**"," * Default validator for the XY attribute"," *"," * @method _validateXY"," * @protected"," * @param {Array} val The XY page co-ordinate value which is being set."," * @return {boolean} true if valid, false if not."," */"," _validateXY : function(val) {"," return (Lang.isArray(val) && Lang.isNumber(val[0]) && Lang.isNumber(val[1]));"," },",""," /**"," * Default setter for the X attribute. The setter passes the X value through"," * to the XY attribute, which is the sole store for the XY state."," *"," * @method _setX"," * @protected"," * @param {Number} val The X page co-ordinate value"," */"," _setX : function(val) {"," this.set(XY_COORD, [val, this.get(XY_COORD)[1]]);"," },",""," /**"," * Default setter for the Y attribute. The setter passes the Y value through"," * to the XY attribute, which is the sole store for the XY state."," *"," * @method _setY"," * @protected"," * @param {Number} val The Y page co-ordinate value"," */"," _setY : function(val) {"," this.set(XY_COORD, [this.get(XY_COORD)[0], val]);"," },",""," /**"," * Default getter for the X attribute. The value is retrieved from "," * the XY attribute, which is the sole store for the XY state."," *"," * @method _getX"," * @protected "," * @return {Number} The X page co-ordinate value"," */"," _getX : function() {"," return this.get(XY_COORD)[0];"," },",""," /**"," * Default getter for the Y attribute. The value is retrieved from "," * the XY attribute, which is the sole store for the XY state."," *"," * @method _getY"," * @protected "," * @return {Number} The Y page co-ordinate value"," */"," _getY : function() {"," return this.get(XY_COORD)[1];"," },",""," /**"," * Default attribute change listener for the xy attribute, responsible"," * for updating the UI, in response to attribute changes."," * "," * @method _afterXYChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterXYChange : function(e) {"," if (e.src != UI) {"," this._uiSetXY(e.newVal);"," }"," },",""," /**"," * Updates the UI to reflect the XY page co-ordinates passed in."," * "," * @method _uiSetXY"," * @protected"," * @param {String} val The XY page co-ordinates value to be reflected in the UI"," */"," _uiSetXY : function(val) {"," this._posNode.setXY(val);"," }"," };",""," Y.WidgetPosition = Position;","","","}, '3.7.2', {\"requires\": [\"base-build\", \"node-screen\", \"widget\"]});"];+_yuitest_coverage["build/widget-position/widget-position.js"].code=["YUI.add('widget-position', function (Y, NAME) {","","/**"," * Provides basic XY positioning support for Widgets, though an extension"," *"," * @module widget-position"," */"," var Lang = Y.Lang,"," Widget = Y.Widget,",""," XY_COORD = \"xy\",",""," POSITION = \"position\","," POSITIONED = \"positioned\","," BOUNDING_BOX = \"boundingBox\","," RELATIVE = \"relative\",",""," RENDERUI = \"renderUI\","," BINDUI = \"bindUI\","," SYNCUI = \"syncUI\",",""," UI = Widget.UI_SRC,",""," XYChange = \"xyChange\";",""," /**"," * Widget extension, which can be used to add positioning support to the base Widget class, "," * through the <a href=\"Base.html#method_build\">Base.build</a> method."," *"," * @class WidgetPosition"," * @param {Object} config User configuration object"," */"," function Position(config) {"," this._posNode = this.get(BOUNDING_BOX);",""," // WIDGET METHOD OVERLAP"," Y.after(this._renderUIPosition, this, RENDERUI);"," Y.after(this._syncUIPosition, this, SYNCUI);"," Y.after(this._bindUIPosition, this, BINDUI);"," }",""," /**"," * Static property used to define the default attribute "," * configuration introduced by WidgetPosition."," *"," * @property ATTRS"," * @static"," * @type Object"," */"," Position.ATTRS = {",""," /**"," * @attribute x"," * @type number"," * @default 0"," *"," * @description Page X co-ordinate for the widget. This attribute acts as a facade for the "," * xy attribute. Changes in position can be monitored by listening for xyChange events."," */"," x: {"," setter: function(val) {"," this._setX(val);"," },"," getter: function() {"," return this._getX();"," },"," lazyAdd:false"," },",""," /**"," * @attribute y"," * @type number"," * @default 0"," *"," * @description Page Y co-ordinate for the widget. This attribute acts as a facade for the "," * xy attribute. Changes in position can be monitored by listening for xyChange events."," */"," y: {"," setter: function(val) {"," this._setY(val);"," },"," getter: function() {"," return this._getY();"," },"," lazyAdd: false"," },",""," /**"," * @attribute xy"," * @type Array"," * @default [0,0]"," *"," * @description Page XY co-ordinate pair for the widget."," */"," xy: {"," value:[0,0],"," validator: function(val) {"," return this._validateXY(val);"," }"," }"," };",""," /**"," * Default class used to mark the boundingBox of a positioned widget."," *"," * @property POSITIONED_CLASS_NAME"," * @type String"," * @default \"yui-widget-positioned\""," * @static"," */"," Position.POSITIONED_CLASS_NAME = Widget.getClassName(POSITIONED);",""," Position.prototype = {",""," /**"," * Creates/Initializes the DOM to support xy page positioning."," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIPosition"," * @protected"," */"," _renderUIPosition : function() {"," this._posNode.addClass(Position.POSITIONED_CLASS_NAME);"," },",""," /**"," * Synchronizes the UI to match the Widgets xy page position state."," * <p>"," * This method in invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIPosition"," * @protected"," */"," _syncUIPosition : function() {"," var posNode = this._posNode;"," if (posNode.getStyle(POSITION) === RELATIVE) {"," this.syncXY();"," }"," this._uiSetXY(this.get(XY_COORD));"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to "," * Widget position related state changes."," * <p>"," * This method in invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIPosition"," * @protected"," */"," _bindUIPosition :function() {"," this.after(XYChange, this._afterXYChange);"," },",""," /**"," * Moves the Widget to the specified page xy co-ordinate position."," *"," * @method move"," *"," * @param {Number} x The new x position"," * @param {Number} y The new y position"," * <p>Or</p>"," * @param {Array} x, y values passed as an array ([x, y]), to support"," * simple pass through of Node.getXY results"," */"," move: function () {"," var args = arguments,"," coord = (Lang.isArray(args[0])) ? args[0] : [args[0], args[1]];"," this.set(XY_COORD, coord);"," },",""," /**"," * Synchronizes the Panel's \"xy\", \"x\", and \"y\" properties with the "," * Widget's position in the DOM."," *"," * @method syncXY"," */"," syncXY : function () {"," this.set(XY_COORD, this._posNode.getXY(), {src: UI});"," },",""," /**"," * Default validator for the XY attribute"," *"," * @method _validateXY"," * @protected"," * @param {Array} val The XY page co-ordinate value which is being set."," * @return {boolean} true if valid, false if not."," */"," _validateXY : function(val) {"," return (Lang.isArray(val) && Lang.isNumber(val[0]) && Lang.isNumber(val[1]));"," },",""," /**"," * Default setter for the X attribute. The setter passes the X value through"," * to the XY attribute, which is the sole store for the XY state."," *"," * @method _setX"," * @protected"," * @param {Number} val The X page co-ordinate value"," */"," _setX : function(val) {"," this.set(XY_COORD, [val, this.get(XY_COORD)[1]]);"," },",""," /**"," * Default setter for the Y attribute. The setter passes the Y value through"," * to the XY attribute, which is the sole store for the XY state."," *"," * @method _setY"," * @protected"," * @param {Number} val The Y page co-ordinate value"," */"," _setY : function(val) {"," this.set(XY_COORD, [this.get(XY_COORD)[0], val]);"," },",""," /**"," * Default getter for the X attribute. The value is retrieved from "," * the XY attribute, which is the sole store for the XY state."," *"," * @method _getX"," * @protected "," * @return {Number} The X page co-ordinate value"," */"," _getX : function() {"," return this.get(XY_COORD)[0];"," },",""," /**"," * Default getter for the Y attribute. The value is retrieved from "," * the XY attribute, which is the sole store for the XY state."," *"," * @method _getY"," * @protected "," * @return {Number} The Y page co-ordinate value"," */"," _getY : function() {"," return this.get(XY_COORD)[1];"," },",""," /**"," * Default attribute change listener for the xy attribute, responsible"," * for updating the UI, in response to attribute changes."," * "," * @method _afterXYChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterXYChange : function(e) {"," if (e.src != UI) {"," this._uiSetXY(e.newVal);"," }"," },",""," /**"," * Updates the UI to reflect the XY page co-ordinates passed in."," * "," * @method _uiSetXY"," * @protected"," * @param {String} val The XY page co-ordinates value to be reflected in the UI"," */"," _uiSetXY : function(val) {"," this._posNode.setXY(val);"," }"," };",""," Y.WidgetPosition = Position;","","","}, '3.7.3', {\"requires\": [\"base-build\", \"node-screen\", \"widget\"]});"]; _yuitest_coverage["build/widget-position/widget-position.js"].lines = {"1":0,"8":0,"33":0,"34":0,"37":0,"38":0,"39":0,"50":0,"62":0,"65":0,"80":0,"83":0,"98":0,"111":0,"113":0,"125":0,"138":0,"139":0,"140":0,"142":0,"156":0,"171":0,"173":0,"183":0,"195":0,"207":0,"219":0,"231":0,"243":0,"255":0,"256":0,"268":0,"272":0}; _yuitest_coverage["build/widget-position/widget-position.js"].functions = {"Position:33":0,"setter:61":0,"getter:64":0,"setter:79":0,"getter:82":0,"validator:97":0,"_renderUIPosition:124":0,"_syncUIPosition:137":0,"_bindUIPosition:155":0,"move:170":0,"syncXY:182":0,"_validateXY:194":0,"_setX:206":0,"_setY:218":0,"_getX:230":0,"_getY:242":0,"_afterXYChange:254":0,"_uiSetXY:267":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-position/widget-position.js"].coveredLines = 33;@@ -363,4 +363,4 @@ Y.WidgetPosition = Position; -}, '3.7.2', {"requires": ["base-build", "node-screen", "widget"]});+}, '3.7.3', {"requires": ["base-build", "node-screen", "widget"]});
bundle/widget-position/widget-position-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -278,4 +278,4 @@ Y.WidgetPosition = Position; -}, '3.7.2', {"requires": ["base-build", "node-screen", "widget"]});+}, '3.7.3', {"requires": ["base-build", "node-screen", "widget"]});
bundle/widget-position/widget-position-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-position",function(e,t){function d(t){this._posNode=this.get(u),e.after(this._renderUIPosition,this,f),e.after(this._syncUIPosition,this,c),e.after(this._bindUIPosition,this,l)}var n=e.Lang,r=e.Widget,i="xy",s="position",o="positioned",u="boundingBox",a="relative",f="renderUI",l="bindUI",c="syncUI",h=r.UI_SRC,p="xyChange";d.ATTRS={x:{setter:function(e){this._setX(e)},getter:function(){return this._getX()},lazyAdd:!1},y:{setter:function(e){this._setY(e)},getter:function(){return this._getY()},lazyAdd:!1},xy:{value:[0,0],validator:function(e){return this._validateXY(e)}}},d.POSITIONED_CLASS_NAME=r.getClassName(o),d.prototype={_renderUIPosition:function(){this._posNode.addClass(d.POSITIONED_CLASS_NAME)},_syncUIPosition:function(){var e=this._posNode;e.getStyle(s)===a&&this.syncXY(),this._uiSetXY(this.get(i))},_bindUIPosition:function(){this.after(p,this._afterXYChange)},move:function(){var e=arguments,t=n.isArray(e[0])?e[0]:[e[0],e[1]];this.set(i,t)},syncXY:function(){this.set(i,this._posNode.getXY(),{src:h})},_validateXY:function(e){return n.isArray(e)&&n.isNumber(e[0])&&n.isNumber(e[1])},_setX:function(e){this.set(i,[e,this.get(i)[1]])},_setY:function(e){this.set(i,[this.get(i)[0],e])},_getX:function(){return this.get(i)[0]},_getY:function(){return this.get(i)[1]},_afterXYChange:function(e){e.src!=h&&this._uiSetXY(e.newVal)},_uiSetXY:function(e){this._posNode.setXY(e)}},e.WidgetPosition=d},"3.7.2",{requires:["base-build","node-screen","widget"]});+YUI.add("widget-position",function(e,t){function d(t){this._posNode=this.get(u),e.after(this._renderUIPosition,this,f),e.after(this._syncUIPosition,this,c),e.after(this._bindUIPosition,this,l)}var n=e.Lang,r=e.Widget,i="xy",s="position",o="positioned",u="boundingBox",a="relative",f="renderUI",l="bindUI",c="syncUI",h=r.UI_SRC,p="xyChange";d.ATTRS={x:{setter:function(e){this._setX(e)},getter:function(){return this._getX()},lazyAdd:!1},y:{setter:function(e){this._setY(e)},getter:function(){return this._getY()},lazyAdd:!1},xy:{value:[0,0],validator:function(e){return this._validateXY(e)}}},d.POSITIONED_CLASS_NAME=r.getClassName(o),d.prototype={_renderUIPosition:function(){this._posNode.addClass(d.POSITIONED_CLASS_NAME)},_syncUIPosition:function(){var e=this._posNode;e.getStyle(s)===a&&this.syncXY(),this._uiSetXY(this.get(i))},_bindUIPosition:function(){this.after(p,this._afterXYChange)},move:function(){var e=arguments,t=n.isArray(e[0])?e[0]:[e[0],e[1]];this.set(i,t)},syncXY:function(){this.set(i,this._posNode.getXY(),{src:h})},_validateXY:function(e){return n.isArray(e)&&n.isNumber(e[0])&&n.isNumber(e[1])},_setX:function(e){this.set(i,[e,this.get(i)[1]])},_setY:function(e){this.set(i,[this.get(i)[0],e])},_getX:function(){return this.get(i)[0]},_getY:function(){return this.get(i)[1]},_afterXYChange:function(e){e.src!=h&&this._uiSetXY(e.newVal)},_uiSetXY:function(e){this._posNode.setXY(e)}},e.WidgetPosition=d},"3.7.3",{requires:["base-build","node-screen","widget"]});
bundle/widget-position/widget-position.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -278,4 +278,4 @@ Y.WidgetPosition = Position; -}, '3.7.2', {"requires": ["base-build", "node-screen", "widget"]});+}, '3.7.3', {"requires": ["base-build", "node-screen", "widget"]});
bundle/widget-skin/assets/widget-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-skin/widget-skin-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-skin/widget-skin.js", code: [] };-_yuitest_coverage["build/widget-skin/widget-skin.js"].code=["YUI.add('widget-skin', function (Y, NAME) {","","/**"," * Provides skin related utlility methods."," *"," * @module widget"," * @submodule widget-skin"," */","","var BOUNDING_BOX = \"boundingBox\","," CONTENT_BOX = \"contentBox\","," SKIN = \"skin\","," _getClassName = Y.ClassNameManager.getClassName;","","/**"," * Returns the name of the skin that's currently applied to the widget."," * This is only really useful after the widget's DOM structure is in the"," * document, either by render or by progressive enhancement. Searches up"," * the Widget's ancestor axis for a class yui3-skin-(name), and returns the"," * (name) portion. Otherwise, returns null."," *"," * @method getSkinName"," * @for Widget"," * @return {String} the name of the skin, or null (yui3-skin-sam => sam)"," */","","Y.Widget.prototype.getSkinName = function () {"," var root = this.get( CONTENT_BOX ) || this.get( BOUNDING_BOX ),"," search = new RegExp( '\\\\b' + _getClassName( SKIN ) + '-(\\\\S+)' ),"," match;",""," if ( root ) {"," root.ancestor( function ( node ) {"," match = node.get( 'className' ).match( search );"," return match;"," } );"," }",""," return ( match ) ? match[1] : null;","};","","","}, '3.7.2', {\"requires\": [\"widget-base\"]});"];+_yuitest_coverage["build/widget-skin/widget-skin.js"].code=["YUI.add('widget-skin', function (Y, NAME) {","","/**"," * Provides skin related utlility methods."," *"," * @module widget"," * @submodule widget-skin"," */","","var BOUNDING_BOX = \"boundingBox\","," CONTENT_BOX = \"contentBox\","," SKIN = \"skin\","," _getClassName = Y.ClassNameManager.getClassName;","","/**"," * Returns the name of the skin that's currently applied to the widget."," * This is only really useful after the widget's DOM structure is in the"," * document, either by render or by progressive enhancement. Searches up"," * the Widget's ancestor axis for a class yui3-skin-(name), and returns the"," * (name) portion. Otherwise, returns null."," *"," * @method getSkinName"," * @for Widget"," * @return {String} the name of the skin, or null (yui3-skin-sam => sam)"," */","","Y.Widget.prototype.getSkinName = function () {"," var root = this.get( CONTENT_BOX ) || this.get( BOUNDING_BOX ),"," search = new RegExp( '\\\\b' + _getClassName( SKIN ) + '-(\\\\S+)' ),"," match;",""," if ( root ) {"," root.ancestor( function ( node ) {"," match = node.get( 'className' ).match( search );"," return match;"," } );"," }",""," return ( match ) ? match[1] : null;","};","","","}, '3.7.3', {\"requires\": [\"widget-base\"]});"]; _yuitest_coverage["build/widget-skin/widget-skin.js"].lines = {"1":0,"10":0,"27":0,"28":0,"32":0,"33":0,"34":0,"35":0,"39":0}; _yuitest_coverage["build/widget-skin/widget-skin.js"].functions = {"(anonymous 2):33":0,"getSkinName:27":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-skin/widget-skin.js"].coveredLines = 9;@@ -91,4 +91,4 @@ }; -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-skin/widget-skin-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -46,4 +46,4 @@ }; -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-skin/widget-skin-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-skin",function(e,t){var n="boundingBox",r="contentBox",i="skin",s=e.ClassNameManager.getClassName;e.Widget.prototype.getSkinName=function(){var e=this.get(r)||this.get(n),t=new RegExp("\\b"+s(i)+"-(\\S+)"),o;return e&&e.ancestor(function(e){return o=e.get("className").match(t),o}),o?o[1]:null}},"3.7.2",{requires:["widget-base"]});+YUI.add("widget-skin",function(e,t){var n="boundingBox",r="contentBox",i="skin",s=e.ClassNameManager.getClassName;e.Widget.prototype.getSkinName=function(){var e=this.get(r)||this.get(n),t=new RegExp("\\b"+s(i)+"-(\\S+)"),o;return e&&e.ancestor(function(e){return o=e.get("className").match(t),o}),o?o[1]:null}},"3.7.3",{requires:["widget-base"]});
bundle/widget-skin/widget-skin.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -46,4 +46,4 @@ }; -}, '3.7.2', {"requires": ["widget-base"]});+}, '3.7.3', {"requires": ["widget-base"]});
bundle/widget-stack/assets/skins/night/widget-stack-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-stack/assets/skins/night/widget-stack.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-stack/assets/skins/sam/widget-stack-skin.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-stack/assets/skins/sam/widget-stack.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-stack/assets/widget-stack-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-stack/widget-stack-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-stack/widget-stack.js", code: [] };-_yuitest_coverage["build/widget-stack/widget-stack.js"].code=["YUI.add('widget-stack', function (Y, NAME) {","","/**"," * Provides stackable (z-index) support for Widgets through an extension."," *"," * @module widget-stack"," */"," var L = Y.Lang,"," UA = Y.UA,"," Node = Y.Node,"," Widget = Y.Widget,",""," ZINDEX = \"zIndex\","," SHIM = \"shim\","," VISIBLE = \"visible\",",""," BOUNDING_BOX = \"boundingBox\",",""," RENDER_UI = \"renderUI\","," BIND_UI = \"bindUI\","," SYNC_UI = \"syncUI\",",""," OFFSET_WIDTH = \"offsetWidth\","," OFFSET_HEIGHT = \"offsetHeight\","," PARENT_NODE = \"parentNode\","," FIRST_CHILD = \"firstChild\","," OWNER_DOCUMENT = \"ownerDocument\",",""," WIDTH = \"width\","," HEIGHT = \"height\","," PX = \"px\",",""," // HANDLE KEYS"," SHIM_DEFERRED = \"shimdeferred\","," SHIM_RESIZE = \"shimresize\",",""," // Events"," VisibleChange = \"visibleChange\","," WidthChange = \"widthChange\","," HeightChange = \"heightChange\","," ShimChange = \"shimChange\","," ZIndexChange = \"zIndexChange\","," ContentUpdate = \"contentUpdate\",",""," // CSS"," STACKED = \"stacked\";",""," /**"," * Widget extension, which can be used to add stackable (z-index) support to the"," * base Widget class along with a shimming solution, through the"," * <a href=\"Base.html#method_build\">Base.build</a> method."," *"," * @class WidgetStack"," * @param {Object} User configuration object"," */"," function Stack(config) {"," this._stackNode = this.get(BOUNDING_BOX);"," this._stackHandles = {};",""," // WIDGET METHOD OVERLAP"," Y.after(this._renderUIStack, this, RENDER_UI);"," Y.after(this._syncUIStack, this, SYNC_UI);"," Y.after(this._bindUIStack, this, BIND_UI);"," }",""," // Static Properties"," /**"," * Static property used to define the default attribute"," * configuration introduced by WidgetStack."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," Stack.ATTRS = {"," /**"," * @attribute shim"," * @type boolean"," * @default false, for all browsers other than IE6, for which a shim is enabled by default."," *"," * @description Boolean flag to indicate whether or not a shim should be added to the Widgets"," * boundingBox, to protect it from select box bleedthrough."," */"," shim: {"," value: (UA.ie == 6)"," },",""," /**"," * @attribute zIndex"," * @type number"," * @default 0"," * @description The z-index to apply to the Widgets boundingBox. Non-numerical values for"," * zIndex will be converted to 0"," */"," zIndex: {"," value : 0,"," setter: '_setZIndex'"," }"," };",""," /**"," * The HTML parsing rules for the WidgetStack class."," *"," * @property HTML_PARSER"," * @static"," * @type Object"," */"," Stack.HTML_PARSER = {"," zIndex: function (srcNode) {"," return this._parseZIndex(srcNode);"," }"," };",""," /**"," * Default class used to mark the shim element"," *"," * @property SHIM_CLASS_NAME"," * @type String"," * @static"," * @default \"yui3-widget-shim\""," */"," Stack.SHIM_CLASS_NAME = Widget.getClassName(SHIM);",""," /**"," * Default class used to mark the boundingBox of a stacked widget."," *"," * @property STACKED_CLASS_NAME"," * @type String"," * @static"," * @default \"yui3-widget-stacked\""," */"," Stack.STACKED_CLASS_NAME = Widget.getClassName(STACKED);",""," /**"," * Default markup template used to generate the shim element."," *"," * @property SHIM_TEMPLATE"," * @type String"," * @static"," */"," Stack.SHIM_TEMPLATE = '<iframe class=\"' + Stack.SHIM_CLASS_NAME + '\" frameborder=\"0\" title=\"Widget Stacking Shim\" src=\"javascript:false\" tabindex=\"-1\" role=\"presentation\"></iframe>';",""," Stack.prototype = {",""," /**"," * Synchronizes the UI to match the Widgets stack state. This method in"," * invoked after syncUI is invoked for the Widget class using YUI's aop infrastructure."," *"," * @method _syncUIStack"," * @protected"," */"," _syncUIStack: function() {"," this._uiSetShim(this.get(SHIM));"," this._uiSetZIndex(this.get(ZINDEX));"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to"," * Widget stack related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIStack"," * @protected"," */"," _bindUIStack: function() {"," this.after(ShimChange, this._afterShimChange);"," this.after(ZIndexChange, this._afterZIndexChange);"," },",""," /**"," * Creates/Initializes the DOM to support stackability."," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIStack"," * @protected"," */"," _renderUIStack: function() {"," this._stackNode.addClass(Stack.STACKED_CLASS_NAME);"," },",""," /**"," Parses a `zIndex` attribute value from this widget's `srcNode`.",""," @method _parseZIndex"," @param {Node} srcNode The node to parse a `zIndex` value from."," @return {Mixed} The parsed `zIndex` value."," @protected"," **/"," _parseZIndex: function (srcNode) {"," var zIndex;",""," // Prefers how WebKit handles `z-index` which better matches the"," // spec:"," //"," // * http://www.w3.org/TR/CSS2/visuren.html#z-index"," // * https://bugs.webkit.org/show_bug.cgi?id=15562"," //"," // When a node isn't rendered in the document, and/or when a"," // node is not positioned, then it doesn't have a context to derive"," // a valid `z-index` value from."," if (!srcNode.inDoc() || srcNode.getStyle('position') === 'static') {"," zIndex = 'auto';"," } else {"," // Uses `getComputedStyle()` because it has greater accuracy in"," // more browsers than `getStyle()` does for `z-index`."," zIndex = srcNode.getComputedStyle('zIndex');"," }",""," // This extension adds a stacking context to widgets, therefore a"," // `srcNode` witout a stacking context (i.e. \"auto\") will return"," // `null` from this DOM parser. This way the widget's default or"," // user provided value for `zIndex` will be used."," return zIndex === 'auto' ? null : zIndex;"," },",""," /**"," * Default setter for zIndex attribute changes. Normalizes zIndex values to"," * numbers, converting non-numerical values to 0."," *"," * @method _setZIndex"," * @protected"," * @param {String | Number} zIndex"," * @return {Number} Normalized zIndex"," */"," _setZIndex: function(zIndex) {"," if (L.isString(zIndex)) {"," zIndex = parseInt(zIndex, 10);"," }"," if (!L.isNumber(zIndex)) {"," zIndex = 0;"," }"," return zIndex;"," },",""," /**"," * Default attribute change listener for the shim attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterShimChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterShimChange : function(e) {"," this._uiSetShim(e.newVal);"," },",""," /**"," * Default attribute change listener for the zIndex attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterZIndexChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterZIndexChange : function(e) {"," this._uiSetZIndex(e.newVal);"," },",""," /**"," * Updates the UI to reflect the zIndex value passed in."," *"," * @method _uiSetZIndex"," * @protected"," * @param {number} zIndex The zindex to be reflected in the UI"," */"," _uiSetZIndex: function (zIndex) {"," this._stackNode.setStyle(ZINDEX, zIndex);"," },",""," /**"," * Updates the UI to enable/disable the shim. If the widget is not currently visible,"," * creation of the shim is deferred until it is made visible, for performance reasons."," *"," * @method _uiSetShim"," * @protected"," * @param {boolean} enable If true, creates/renders the shim, if false, removes it."," */"," _uiSetShim: function (enable) {"," if (enable) {"," // Lazy creation"," if (this.get(VISIBLE)) {"," this._renderShim();"," } else {"," this._renderShimDeferred();"," }",""," // Eagerly attach resize handlers"," //"," // Required because of Event stack behavior, commit ref: cd8dddc"," // Should be revisted after Ticket #2531067 is resolved."," if (UA.ie == 6) {"," this._addShimResizeHandlers();"," }"," } else {"," this._destroyShim();"," }"," },",""," /**"," * Sets up change handlers for the visible attribute, to defer shim creation/rendering"," * until the Widget is made visible."," *"," * @method _renderShimDeferred"," * @private"," */"," _renderShimDeferred : function() {",""," this._stackHandles[SHIM_DEFERRED] = this._stackHandles[SHIM_DEFERRED] || [];",""," var handles = this._stackHandles[SHIM_DEFERRED],"," createBeforeVisible = function(e) {"," if (e.newVal) {"," this._renderShim();"," }"," };",""," handles.push(this.on(VisibleChange, createBeforeVisible));"," // Depending how how Ticket #2531067 is resolved, a reversal of"," // commit ref: cd8dddc could lead to a more elagent solution, with"," // the addition of this line here:"," //"," // handles.push(this.after(VisibleChange, this.sizeShim));"," },",""," /**"," * Sets up event listeners to resize the shim when the size of the Widget changes."," * <p>"," * NOTE: This method is only used for IE6 currently, since IE6 doesn't support a way to"," * resize the shim purely through CSS, when the Widget does not have an explicit width/height"," * set."," * </p>"," * @method _addShimResizeHandlers"," * @private"," */"," _addShimResizeHandlers : function() {",""," this._stackHandles[SHIM_RESIZE] = this._stackHandles[SHIM_RESIZE] || [];",""," var sizeShim = this.sizeShim,"," handles = this._stackHandles[SHIM_RESIZE];",""," handles.push(this.after(VisibleChange, sizeShim));"," handles.push(this.after(WidthChange, sizeShim));"," handles.push(this.after(HeightChange, sizeShim));"," handles.push(this.after(ContentUpdate, sizeShim));"," },",""," /**"," * Detaches any handles stored for the provided key"," *"," * @method _detachStackHandles"," * @param String handleKey The key defining the group of handles which should be detached"," * @private"," */"," _detachStackHandles : function(handleKey) {"," var handles = this._stackHandles[handleKey],"," handle;",""," if (handles && handles.length > 0) {"," while((handle = handles.pop())) {"," handle.detach();"," }"," }"," },",""," /**"," * Creates the shim element and adds it to the DOM"," *"," * @method _renderShim"," * @private"," */"," _renderShim : function() {"," var shimEl = this._shimNode,"," stackEl = this._stackNode;",""," if (!shimEl) {"," shimEl = this._shimNode = this._getShimTemplate();"," stackEl.insertBefore(shimEl, stackEl.get(FIRST_CHILD));",""," this._detachStackHandles(SHIM_DEFERRED);"," this.sizeShim();"," }"," },",""," /**"," * Removes the shim from the DOM, and detaches any related event"," * listeners."," *"," * @method _destroyShim"," * @private"," */"," _destroyShim : function() {"," if (this._shimNode) {"," this._shimNode.get(PARENT_NODE).removeChild(this._shimNode);"," this._shimNode = null;",""," this._detachStackHandles(SHIM_DEFERRED);"," this._detachStackHandles(SHIM_RESIZE);"," }"," },",""," /**"," * For IE6, synchronizes the size and position of iframe shim to that of"," * Widget bounding box which it is protecting. For all other browsers,"," * this method does not do anything."," *"," * @method sizeShim"," */"," sizeShim: function () {"," var shim = this._shimNode,"," node = this._stackNode;",""," if (shim && UA.ie === 6 && this.get(VISIBLE)) {"," shim.setStyle(WIDTH, node.get(OFFSET_WIDTH) + PX);"," shim.setStyle(HEIGHT, node.get(OFFSET_HEIGHT) + PX);"," }"," },",""," /**"," * Creates a cloned shim node, using the SHIM_TEMPLATE html template, for use on a new instance."," *"," * @method _getShimTemplate"," * @private"," * @return {Node} node A new shim Node instance."," */"," _getShimTemplate : function() {"," return Node.create(Stack.SHIM_TEMPLATE, this._stackNode.get(OWNER_DOCUMENT));"," }"," };",""," Y.WidgetStack = Stack;","","","}, '3.7.2', {\"requires\": [\"base-build\", \"widget\"], \"skinnable\": true});"];+_yuitest_coverage["build/widget-stack/widget-stack.js"].code=["YUI.add('widget-stack', function (Y, NAME) {","","/**"," * Provides stackable (z-index) support for Widgets through an extension."," *"," * @module widget-stack"," */"," var L = Y.Lang,"," UA = Y.UA,"," Node = Y.Node,"," Widget = Y.Widget,",""," ZINDEX = \"zIndex\","," SHIM = \"shim\","," VISIBLE = \"visible\",",""," BOUNDING_BOX = \"boundingBox\",",""," RENDER_UI = \"renderUI\","," BIND_UI = \"bindUI\","," SYNC_UI = \"syncUI\",",""," OFFSET_WIDTH = \"offsetWidth\","," OFFSET_HEIGHT = \"offsetHeight\","," PARENT_NODE = \"parentNode\","," FIRST_CHILD = \"firstChild\","," OWNER_DOCUMENT = \"ownerDocument\",",""," WIDTH = \"width\","," HEIGHT = \"height\","," PX = \"px\",",""," // HANDLE KEYS"," SHIM_DEFERRED = \"shimdeferred\","," SHIM_RESIZE = \"shimresize\",",""," // Events"," VisibleChange = \"visibleChange\","," WidthChange = \"widthChange\","," HeightChange = \"heightChange\","," ShimChange = \"shimChange\","," ZIndexChange = \"zIndexChange\","," ContentUpdate = \"contentUpdate\",",""," // CSS"," STACKED = \"stacked\";",""," /**"," * Widget extension, which can be used to add stackable (z-index) support to the"," * base Widget class along with a shimming solution, through the"," * <a href=\"Base.html#method_build\">Base.build</a> method."," *"," * @class WidgetStack"," * @param {Object} User configuration object"," */"," function Stack(config) {"," this._stackNode = this.get(BOUNDING_BOX);"," this._stackHandles = {};",""," // WIDGET METHOD OVERLAP"," Y.after(this._renderUIStack, this, RENDER_UI);"," Y.after(this._syncUIStack, this, SYNC_UI);"," Y.after(this._bindUIStack, this, BIND_UI);"," }",""," // Static Properties"," /**"," * Static property used to define the default attribute"," * configuration introduced by WidgetStack."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," Stack.ATTRS = {"," /**"," * @attribute shim"," * @type boolean"," * @default false, for all browsers other than IE6, for which a shim is enabled by default."," *"," * @description Boolean flag to indicate whether or not a shim should be added to the Widgets"," * boundingBox, to protect it from select box bleedthrough."," */"," shim: {"," value: (UA.ie == 6)"," },",""," /**"," * @attribute zIndex"," * @type number"," * @default 0"," * @description The z-index to apply to the Widgets boundingBox. Non-numerical values for"," * zIndex will be converted to 0"," */"," zIndex: {"," value : 0,"," setter: '_setZIndex'"," }"," };",""," /**"," * The HTML parsing rules for the WidgetStack class."," *"," * @property HTML_PARSER"," * @static"," * @type Object"," */"," Stack.HTML_PARSER = {"," zIndex: function (srcNode) {"," return this._parseZIndex(srcNode);"," }"," };",""," /**"," * Default class used to mark the shim element"," *"," * @property SHIM_CLASS_NAME"," * @type String"," * @static"," * @default \"yui3-widget-shim\""," */"," Stack.SHIM_CLASS_NAME = Widget.getClassName(SHIM);",""," /**"," * Default class used to mark the boundingBox of a stacked widget."," *"," * @property STACKED_CLASS_NAME"," * @type String"," * @static"," * @default \"yui3-widget-stacked\""," */"," Stack.STACKED_CLASS_NAME = Widget.getClassName(STACKED);",""," /**"," * Default markup template used to generate the shim element."," *"," * @property SHIM_TEMPLATE"," * @type String"," * @static"," */"," Stack.SHIM_TEMPLATE = '<iframe class=\"' + Stack.SHIM_CLASS_NAME + '\" frameborder=\"0\" title=\"Widget Stacking Shim\" src=\"javascript:false\" tabindex=\"-1\" role=\"presentation\"></iframe>';",""," Stack.prototype = {",""," /**"," * Synchronizes the UI to match the Widgets stack state. This method in"," * invoked after syncUI is invoked for the Widget class using YUI's aop infrastructure."," *"," * @method _syncUIStack"," * @protected"," */"," _syncUIStack: function() {"," this._uiSetShim(this.get(SHIM));"," this._uiSetZIndex(this.get(ZINDEX));"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to"," * Widget stack related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIStack"," * @protected"," */"," _bindUIStack: function() {"," this.after(ShimChange, this._afterShimChange);"," this.after(ZIndexChange, this._afterZIndexChange);"," },",""," /**"," * Creates/Initializes the DOM to support stackability."," * <p>"," * This method in invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIStack"," * @protected"," */"," _renderUIStack: function() {"," this._stackNode.addClass(Stack.STACKED_CLASS_NAME);"," },",""," /**"," Parses a `zIndex` attribute value from this widget's `srcNode`.",""," @method _parseZIndex"," @param {Node} srcNode The node to parse a `zIndex` value from."," @return {Mixed} The parsed `zIndex` value."," @protected"," **/"," _parseZIndex: function (srcNode) {"," var zIndex;",""," // Prefers how WebKit handles `z-index` which better matches the"," // spec:"," //"," // * http://www.w3.org/TR/CSS2/visuren.html#z-index"," // * https://bugs.webkit.org/show_bug.cgi?id=15562"," //"," // When a node isn't rendered in the document, and/or when a"," // node is not positioned, then it doesn't have a context to derive"," // a valid `z-index` value from."," if (!srcNode.inDoc() || srcNode.getStyle('position') === 'static') {"," zIndex = 'auto';"," } else {"," // Uses `getComputedStyle()` because it has greater accuracy in"," // more browsers than `getStyle()` does for `z-index`."," zIndex = srcNode.getComputedStyle('zIndex');"," }",""," // This extension adds a stacking context to widgets, therefore a"," // `srcNode` witout a stacking context (i.e. \"auto\") will return"," // `null` from this DOM parser. This way the widget's default or"," // user provided value for `zIndex` will be used."," return zIndex === 'auto' ? null : zIndex;"," },",""," /**"," * Default setter for zIndex attribute changes. Normalizes zIndex values to"," * numbers, converting non-numerical values to 0."," *"," * @method _setZIndex"," * @protected"," * @param {String | Number} zIndex"," * @return {Number} Normalized zIndex"," */"," _setZIndex: function(zIndex) {"," if (L.isString(zIndex)) {"," zIndex = parseInt(zIndex, 10);"," }"," if (!L.isNumber(zIndex)) {"," zIndex = 0;"," }"," return zIndex;"," },",""," /**"," * Default attribute change listener for the shim attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterShimChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterShimChange : function(e) {"," this._uiSetShim(e.newVal);"," },",""," /**"," * Default attribute change listener for the zIndex attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterZIndexChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterZIndexChange : function(e) {"," this._uiSetZIndex(e.newVal);"," },",""," /**"," * Updates the UI to reflect the zIndex value passed in."," *"," * @method _uiSetZIndex"," * @protected"," * @param {number} zIndex The zindex to be reflected in the UI"," */"," _uiSetZIndex: function (zIndex) {"," this._stackNode.setStyle(ZINDEX, zIndex);"," },",""," /**"," * Updates the UI to enable/disable the shim. If the widget is not currently visible,"," * creation of the shim is deferred until it is made visible, for performance reasons."," *"," * @method _uiSetShim"," * @protected"," * @param {boolean} enable If true, creates/renders the shim, if false, removes it."," */"," _uiSetShim: function (enable) {"," if (enable) {"," // Lazy creation"," if (this.get(VISIBLE)) {"," this._renderShim();"," } else {"," this._renderShimDeferred();"," }",""," // Eagerly attach resize handlers"," //"," // Required because of Event stack behavior, commit ref: cd8dddc"," // Should be revisted after Ticket #2531067 is resolved."," if (UA.ie == 6) {"," this._addShimResizeHandlers();"," }"," } else {"," this._destroyShim();"," }"," },",""," /**"," * Sets up change handlers for the visible attribute, to defer shim creation/rendering"," * until the Widget is made visible."," *"," * @method _renderShimDeferred"," * @private"," */"," _renderShimDeferred : function() {",""," this._stackHandles[SHIM_DEFERRED] = this._stackHandles[SHIM_DEFERRED] || [];",""," var handles = this._stackHandles[SHIM_DEFERRED],"," createBeforeVisible = function(e) {"," if (e.newVal) {"," this._renderShim();"," }"," };",""," handles.push(this.on(VisibleChange, createBeforeVisible));"," // Depending how how Ticket #2531067 is resolved, a reversal of"," // commit ref: cd8dddc could lead to a more elagent solution, with"," // the addition of this line here:"," //"," // handles.push(this.after(VisibleChange, this.sizeShim));"," },",""," /**"," * Sets up event listeners to resize the shim when the size of the Widget changes."," * <p>"," * NOTE: This method is only used for IE6 currently, since IE6 doesn't support a way to"," * resize the shim purely through CSS, when the Widget does not have an explicit width/height"," * set."," * </p>"," * @method _addShimResizeHandlers"," * @private"," */"," _addShimResizeHandlers : function() {",""," this._stackHandles[SHIM_RESIZE] = this._stackHandles[SHIM_RESIZE] || [];",""," var sizeShim = this.sizeShim,"," handles = this._stackHandles[SHIM_RESIZE];",""," handles.push(this.after(VisibleChange, sizeShim));"," handles.push(this.after(WidthChange, sizeShim));"," handles.push(this.after(HeightChange, sizeShim));"," handles.push(this.after(ContentUpdate, sizeShim));"," },",""," /**"," * Detaches any handles stored for the provided key"," *"," * @method _detachStackHandles"," * @param String handleKey The key defining the group of handles which should be detached"," * @private"," */"," _detachStackHandles : function(handleKey) {"," var handles = this._stackHandles[handleKey],"," handle;",""," if (handles && handles.length > 0) {"," while((handle = handles.pop())) {"," handle.detach();"," }"," }"," },",""," /**"," * Creates the shim element and adds it to the DOM"," *"," * @method _renderShim"," * @private"," */"," _renderShim : function() {"," var shimEl = this._shimNode,"," stackEl = this._stackNode;",""," if (!shimEl) {"," shimEl = this._shimNode = this._getShimTemplate();"," stackEl.insertBefore(shimEl, stackEl.get(FIRST_CHILD));",""," this._detachStackHandles(SHIM_DEFERRED);"," this.sizeShim();"," }"," },",""," /**"," * Removes the shim from the DOM, and detaches any related event"," * listeners."," *"," * @method _destroyShim"," * @private"," */"," _destroyShim : function() {"," if (this._shimNode) {"," this._shimNode.get(PARENT_NODE).removeChild(this._shimNode);"," this._shimNode = null;",""," this._detachStackHandles(SHIM_DEFERRED);"," this._detachStackHandles(SHIM_RESIZE);"," }"," },",""," /**"," * For IE6, synchronizes the size and position of iframe shim to that of"," * Widget bounding box which it is protecting. For all other browsers,"," * this method does not do anything."," *"," * @method sizeShim"," */"," sizeShim: function () {"," var shim = this._shimNode,"," node = this._stackNode;",""," if (shim && UA.ie === 6 && this.get(VISIBLE)) {"," shim.setStyle(WIDTH, node.get(OFFSET_WIDTH) + PX);"," shim.setStyle(HEIGHT, node.get(OFFSET_HEIGHT) + PX);"," }"," },",""," /**"," * Creates a cloned shim node, using the SHIM_TEMPLATE html template, for use on a new instance."," *"," * @method _getShimTemplate"," * @private"," * @return {Node} node A new shim Node instance."," */"," _getShimTemplate : function() {"," return Node.create(Stack.SHIM_TEMPLATE, this._stackNode.get(OWNER_DOCUMENT));"," }"," };",""," Y.WidgetStack = Stack;","","","}, '3.7.3', {\"requires\": [\"base-build\", \"widget\"], \"skinnable\": true});"]; _yuitest_coverage["build/widget-stack/widget-stack.js"].lines = {"1":0,"8":0,"56":0,"57":0,"58":0,"61":0,"62":0,"63":0,"75":0,"108":0,"110":0,"122":0,"132":0,"141":0,"143":0,"153":0,"154":0,"168":0,"169":0,"182":0,"194":0,"205":0,"206":0,"210":0,"217":0,"230":0,"231":0,"233":0,"234":0,"236":0,"248":0,"260":0,"271":0,"283":0,"285":0,"286":0,"288":0,"295":0,"296":0,"299":0,"312":0,"314":0,"316":0,"317":0,"321":0,"341":0,"343":0,"346":0,"347":0,"348":0,"349":0,"360":0,"363":0,"364":0,"365":0,"377":0,"380":0,"381":0,"382":0,"384":0,"385":0,"397":0,"398":0,"399":0,"401":0,"402":0,"414":0,"417":0,"418":0,"419":0,"431":0,"435":0}; _yuitest_coverage["build/widget-stack/widget-stack.js"].functions = {"Stack:56":0,"zIndex:109":0,"_syncUIStack:152":0,"_bindUIStack:167":0,"_renderUIStack:181":0,"_parseZIndex:193":0,"_setZIndex:229":0,"_afterShimChange:247":0,"_afterZIndexChange:259":0,"_uiSetZIndex:270":0,"_uiSetShim:282":0,"createBeforeVisible:315":0,"_renderShimDeferred:310":0,"_addShimResizeHandlers:339":0,"_detachStackHandles:359":0,"_renderShim:376":0,"_destroyShim:396":0,"sizeShim:413":0,"_getShimTemplate:430":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-stack/widget-stack.js"].coveredLines = 72;@@ -566,4 +566,4 @@ Y.WidgetStack = Stack; -}, '3.7.2', {"requires": ["base-build", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["base-build", "widget"], "skinnable": true});
bundle/widget-stack/widget-stack-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -441,4 +441,4 @@ Y.WidgetStack = Stack; -}, '3.7.2', {"requires": ["base-build", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["base-build", "widget"], "skinnable": true});
bundle/widget-stack/widget-stack-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-stack",function(e,t){function O(t){this._stackNode=this.get(f),this._stackHandles={},e.after(this._renderUIStack,this,l),e.after(this._syncUIStack,this,h),e.after(this._bindUIStack,this,c)}var n=e.Lang,r=e.UA,i=e.Node,s=e.Widget,o="zIndex",u="shim",a="visible",f="boundingBox",l="renderUI",c="bindUI",h="syncUI",p="offsetWidth",d="offsetHeight",v="parentNode",m="firstChild",g="ownerDocument",y="width",b="height",w="px",E="shimdeferred",S="shimresize",x="visibleChange",T="widthChange",N="heightChange",C="shimChange",k="zIndexChange",L="contentUpdate",A="stacked";O.ATTRS={shim:{value:r.ie==6},zIndex:{value:0,setter:"_setZIndex"}},O.HTML_PARSER={zIndex:function(e){return this._parseZIndex(e)}},O.SHIM_CLASS_NAME=s.getClassName(u),O.STACKED_CLASS_NAME=s.getClassName(A),O.SHIM_TEMPLATE='<iframe class="'+O.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>',O.prototype={_syncUIStack:function(){this._uiSetShim(this.get(u)),this._uiSetZIndex(this.get(o))},_bindUIStack:function(){this.after(C,this._afterShimChange),this.after(k,this._afterZIndexChange)},_renderUIStack:function(){this._stackNode.addClass(O.STACKED_CLASS_NAME)},_parseZIndex:function(e){var t;return!e.inDoc()||e.getStyle("position")==="static"?t="auto":t=e.getComputedStyle("zIndex"),t==="auto"?null:t},_setZIndex:function(e){return n.isString(e)&&(e=parseInt(e,10)),n.isNumber(e)||(e=0),e},_afterShimChange:function(e){this._uiSetShim(e.newVal)},_afterZIndexChange:function(e){this._uiSetZIndex(e.newVal)},_uiSetZIndex:function(e){this._stackNode.setStyle(o,e)},_uiSetShim:function(e){e?(this.get(a)?this._renderShim():this._renderShimDeferred(),r.ie==6&&this._addShimResizeHandlers()):this._destroyShim()},_renderShimDeferred:function(){this._stackHandles[E]=this._stackHandles[E]||[];var e=this._stackHandles[E],t=function(e){e.newVal&&this._renderShim()};e.push(this.on(x,t))},_addShimResizeHandlers:function(){this._stackHandles[S]=this._stackHandles[S]||[];var e=this.sizeShim,t=this._stackHandles[S];t.push(this.after(x,e)),t.push(this.after(T,e)),t.push(this.after(N,e)),t.push(this.after(L,e))},_detachStackHandles:function(e){var t=this._stackHandles[e],n;if(t&&t.length>0)while(n=t.pop())n.detach()},_renderShim:function(){var e=this._shimNode,t=this._stackNode;e||(e=this._shimNode=this._getShimTemplate(),t.insertBefore(e,t.get(m)),this._detachStackHandles(E),this.sizeShim())},_destroyShim:function(){this._shimNode&&(this._shimNode.get(v).removeChild(this._shimNode),this._shimNode=null,this._detachStackHandles(E),this._detachStackHandles(S))},sizeShim:function(){var e=this._shimNode,t=this._stackNode;e&&r.ie===6&&this.get(a)&&(e.setStyle(y,t.get(p)+w),e.setStyle(b,t.get(d)+w))},_getShimTemplate:function(){return i.create(O.SHIM_TEMPLATE,this._stackNode.get(g))}},e.WidgetStack=O},"3.7.2",{requires:["base-build","widget"],skinnable:!0});+YUI.add("widget-stack",function(e,t){function O(t){this._stackNode=this.get(f),this._stackHandles={},e.after(this._renderUIStack,this,l),e.after(this._syncUIStack,this,h),e.after(this._bindUIStack,this,c)}var n=e.Lang,r=e.UA,i=e.Node,s=e.Widget,o="zIndex",u="shim",a="visible",f="boundingBox",l="renderUI",c="bindUI",h="syncUI",p="offsetWidth",d="offsetHeight",v="parentNode",m="firstChild",g="ownerDocument",y="width",b="height",w="px",E="shimdeferred",S="shimresize",x="visibleChange",T="widthChange",N="heightChange",C="shimChange",k="zIndexChange",L="contentUpdate",A="stacked";O.ATTRS={shim:{value:r.ie==6},zIndex:{value:0,setter:"_setZIndex"}},O.HTML_PARSER={zIndex:function(e){return this._parseZIndex(e)}},O.SHIM_CLASS_NAME=s.getClassName(u),O.STACKED_CLASS_NAME=s.getClassName(A),O.SHIM_TEMPLATE='<iframe class="'+O.SHIM_CLASS_NAME+'" frameborder="0" title="Widget Stacking Shim" src="javascript:false" tabindex="-1" role="presentation"></iframe>',O.prototype={_syncUIStack:function(){this._uiSetShim(this.get(u)),this._uiSetZIndex(this.get(o))},_bindUIStack:function(){this.after(C,this._afterShimChange),this.after(k,this._afterZIndexChange)},_renderUIStack:function(){this._stackNode.addClass(O.STACKED_CLASS_NAME)},_parseZIndex:function(e){var t;return!e.inDoc()||e.getStyle("position")==="static"?t="auto":t=e.getComputedStyle("zIndex"),t==="auto"?null:t},_setZIndex:function(e){return n.isString(e)&&(e=parseInt(e,10)),n.isNumber(e)||(e=0),e},_afterShimChange:function(e){this._uiSetShim(e.newVal)},_afterZIndexChange:function(e){this._uiSetZIndex(e.newVal)},_uiSetZIndex:function(e){this._stackNode.setStyle(o,e)},_uiSetShim:function(e){e?(this.get(a)?this._renderShim():this._renderShimDeferred(),r.ie==6&&this._addShimResizeHandlers()):this._destroyShim()},_renderShimDeferred:function(){this._stackHandles[E]=this._stackHandles[E]||[];var e=this._stackHandles[E],t=function(e){e.newVal&&this._renderShim()};e.push(this.on(x,t))},_addShimResizeHandlers:function(){this._stackHandles[S]=this._stackHandles[S]||[];var e=this.sizeShim,t=this._stackHandles[S];t.push(this.after(x,e)),t.push(this.after(T,e)),t.push(this.after(N,e)),t.push(this.after(L,e))},_detachStackHandles:function(e){var t=this._stackHandles[e],n;if(t&&t.length>0)while(n=t.pop())n.detach()},_renderShim:function(){var e=this._shimNode,t=this._stackNode;e||(e=this._shimNode=this._getShimTemplate(),t.insertBefore(e,t.get(m)),this._detachStackHandles(E),this.sizeShim())},_destroyShim:function(){this._shimNode&&(this._shimNode.get(v).removeChild(this._shimNode),this._shimNode=null,this._detachStackHandles(E),this._detachStackHandles(S))},sizeShim:function(){var e=this._shimNode,t=this._stackNode;e&&r.ie===6&&this.get(a)&&(e.setStyle(y,t.get(p)+w),e.setStyle(b,t.get(d)+w))},_getShimTemplate:function(){return i.create(O.SHIM_TEMPLATE,this._stackNode.get(g))}},e.WidgetStack=O},"3.7.3",{requires:["base-build","widget"],skinnable:!0});
bundle/widget-stack/widget-stack.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -441,4 +441,4 @@ Y.WidgetStack = Stack; -}, '3.7.2', {"requires": ["base-build", "widget"], "skinnable": true});+}, '3.7.3', {"requires": ["base-build", "widget"], "skinnable": true});
bundle/widget-stdmod/widget-stdmod-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-stdmod/widget-stdmod.js", code: [] };-_yuitest_coverage["build/widget-stdmod/widget-stdmod.js"].code=["YUI.add('widget-stdmod', function (Y, NAME) {","","/**"," * Provides standard module support for Widgets through an extension."," *"," * @module widget-stdmod"," */"," var L = Y.Lang,"," Node = Y.Node,"," UA = Y.UA,"," Widget = Y.Widget,",""," EMPTY = \"\","," HD = \"hd\","," BD = \"bd\","," FT = \"ft\","," HEADER = \"header\","," BODY = \"body\","," FOOTER = \"footer\","," FILL_HEIGHT = \"fillHeight\","," STDMOD = \"stdmod\",",""," NODE_SUFFIX = \"Node\","," CONTENT_SUFFIX = \"Content\",",""," FIRST_CHILD = \"firstChild\","," CHILD_NODES = \"childNodes\","," OWNER_DOCUMENT = \"ownerDocument\",",""," CONTENT_BOX = \"contentBox\",",""," HEIGHT = \"height\","," OFFSET_HEIGHT = \"offsetHeight\","," AUTO = \"auto\",",""," HeaderChange = \"headerContentChange\","," BodyChange = \"bodyContentChange\","," FooterChange = \"footerContentChange\","," FillHeightChange = \"fillHeightChange\","," HeightChange = \"heightChange\","," ContentUpdate = \"contentUpdate\",",""," RENDERUI = \"renderUI\","," BINDUI = \"bindUI\","," SYNCUI = \"syncUI\",",""," APPLY_PARSED_CONFIG = \"_applyParsedConfig\",",""," UI = Y.Widget.UI_SRC;",""," /**"," * Widget extension, which can be used to add Standard Module support to the"," * base Widget class, through the <a href=\"Base.html#method_build\">Base.build</a>"," * method."," * <p>"," * The extension adds header, body and footer sections to the Widget's content box and"," * provides the corresponding methods and attributes to modify the contents of these sections."," * </p>"," * @class WidgetStdMod"," * @param {Object} The user configuration object"," */"," function StdMod(config) {",""," this._stdModNode = this.get(CONTENT_BOX);",""," Y.before(this._renderUIStdMod, this, RENDERUI);"," Y.before(this._bindUIStdMod, this, BINDUI);"," Y.before(this._syncUIStdMod, this, SYNCUI);"," }",""," /**"," * Constant used to refer the the standard module header, in methods which expect a section specifier"," *"," * @property HEADER"," * @static"," * @type String"," */"," StdMod.HEADER = HEADER;",""," /**"," * Constant used to refer the the standard module body, in methods which expect a section specifier"," *"," * @property BODY"," * @static"," * @type String"," */"," StdMod.BODY = BODY;",""," /**"," * Constant used to refer the the standard module footer, in methods which expect a section specifier"," *"," * @property FOOTER"," * @static"," * @type String"," */"," StdMod.FOOTER = FOOTER;",""," /**"," * Constant used to specify insertion position, when adding content to sections of the standard module in"," * methods which expect a \"where\" argument."," * <p>"," * Inserts new content <em>before</em> the sections existing content."," * </p>"," * @property AFTER"," * @static"," * @type String"," */"," StdMod.AFTER = \"after\";",""," /**"," * Constant used to specify insertion position, when adding content to sections of the standard module in"," * methods which expect a \"where\" argument."," * <p>"," * Inserts new content <em>before</em> the sections existing content."," * </p>"," * @property BEFORE"," * @static"," * @type String"," */"," StdMod.BEFORE = \"before\";"," /**"," * Constant used to specify insertion position, when adding content to sections of the standard module in"," * methods which expect a \"where\" argument."," * <p>"," * <em>Replaces</em> the sections existing content, with new content."," * </p>"," * @property REPLACE"," * @static"," * @type String"," */"," StdMod.REPLACE = \"replace\";",""," var STD_HEADER = StdMod.HEADER,"," STD_BODY = StdMod.BODY,"," STD_FOOTER = StdMod.FOOTER,",""," HEADER_CONTENT = STD_HEADER + CONTENT_SUFFIX,"," FOOTER_CONTENT = STD_FOOTER + CONTENT_SUFFIX,"," BODY_CONTENT = STD_BODY + CONTENT_SUFFIX;",""," /**"," * Static property used to define the default attribute"," * configuration introduced by WidgetStdMod."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," StdMod.ATTRS = {",""," /**"," * @attribute headerContent"," * @type HTML"," * @default undefined"," * @description The content to be added to the header section. This will replace any existing content"," * in the header. If you want to append, or insert new content, use the <a href=\"#method_setStdModContent\">setStdModContent</a> method."," */"," headerContent: {"," value:null"," },",""," /**"," * @attribute footerContent"," * @type HTML"," * @default undefined"," * @description The content to be added to the footer section. This will replace any existing content"," * in the footer. If you want to append, or insert new content, use the <a href=\"#method_setStdModContent\">setStdModContent</a> method."," */"," footerContent: {"," value:null"," },",""," /**"," * @attribute bodyContent"," * @type HTML"," * @default undefined"," * @description The content to be added to the body section. This will replace any existing content"," * in the body. If you want to append, or insert new content, use the <a href=\"#method_setStdModContent\">setStdModContent</a> method."," */"," bodyContent: {"," value:null"," },",""," /**"," * @attribute fillHeight"," * @type {String}"," * @default WidgetStdMod.BODY"," * @description The section (WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER) which should be resized to fill the height of the standard module, when a"," * height is set on the Widget. If a height is not set on the widget, then all sections are sized based on"," * their content."," */"," fillHeight: {"," value: StdMod.BODY,"," validator: function(val) {"," return this._validateFillHeight(val);"," }"," }"," };",""," /**"," * The HTML parsing rules for the WidgetStdMod class."," *"," * @property HTML_PARSER"," * @static"," * @type Object"," */"," StdMod.HTML_PARSER = {"," headerContent: function(contentBox) {"," return this._parseStdModHTML(STD_HEADER);"," },",""," bodyContent: function(contentBox) {"," return this._parseStdModHTML(STD_BODY);"," },",""," footerContent : function(contentBox) {"," return this._parseStdModHTML(STD_FOOTER);"," }"," };",""," /**"," * Static hash of default class names used for the header,"," * body and footer sections of the standard module, keyed by"," * the section identifier (WidgetStdMod.STD_HEADER, WidgetStdMod.STD_BODY, WidgetStdMod.STD_FOOTER)"," *"," * @property SECTION_CLASS_NAMES"," * @static"," * @type Object"," */"," StdMod.SECTION_CLASS_NAMES = {"," header: Widget.getClassName(HD),"," body: Widget.getClassName(BD),"," footer: Widget.getClassName(FT)"," };",""," /**"," * The template HTML strings for each of the standard module sections. Section entries are keyed by the section constants,"," * WidgetStdMod.HEADER, WidgetStdMod.BODY, WidgetStdMod.FOOTER, and contain the HTML to be added for each section."," * e.g."," * <pre>"," * {"," * header : '<div class=\"yui-widget-hd\"></div>',"," * body : '<div class=\"yui-widget-bd\"></div>',"," * footer : '<div class=\"yui-widget-ft\"></div>'"," * }"," * </pre>"," * @property TEMPLATES"," * @type Object"," * @static"," */"," StdMod.TEMPLATES = {"," header : '<div class=\"' + StdMod.SECTION_CLASS_NAMES[STD_HEADER] + '\"></div>',"," body : '<div class=\"' + StdMod.SECTION_CLASS_NAMES[STD_BODY] + '\"></div>',"," footer : '<div class=\"' + StdMod.SECTION_CLASS_NAMES[STD_FOOTER] + '\"></div>'"," };",""," StdMod.prototype = {",""," /**"," * Synchronizes the UI to match the Widgets standard module state."," * <p>"," * This method is invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIStdMod"," * @protected"," */"," _syncUIStdMod : function() {"," var stdModParsed = this._stdModParsed;",""," if (!stdModParsed || !stdModParsed[HEADER_CONTENT]) {"," this._uiSetStdMod(STD_HEADER, this.get(HEADER_CONTENT));"," }",""," if (!stdModParsed || !stdModParsed[BODY_CONTENT]) {"," this._uiSetStdMod(STD_BODY, this.get(BODY_CONTENT));"," }",""," if (!stdModParsed || !stdModParsed[FOOTER_CONTENT]) {"," this._uiSetStdMod(STD_FOOTER, this.get(FOOTER_CONTENT));"," }",""," this._uiSetFillHeight(this.get(FILL_HEIGHT));"," },",""," /**"," * Creates/Initializes the DOM for standard module support."," * <p>"," * This method is invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIStdMod"," * @protected"," */"," _renderUIStdMod : function() {"," this._stdModNode.addClass(Widget.getClassName(STDMOD));"," this._renderStdModSections();",""," //This normally goes in bindUI but in order to allow setStdModContent() to work before renderUI"," //stage, these listeners should be set up at the earliest possible time."," this.after(HeaderChange, this._afterHeaderChange);"," this.after(BodyChange, this._afterBodyChange);"," this.after(FooterChange, this._afterFooterChange);"," },",""," _renderStdModSections : function() {"," if (L.isValue(this.get(HEADER_CONTENT))) { this._renderStdMod(STD_HEADER); }"," if (L.isValue(this.get(BODY_CONTENT))) { this._renderStdMod(STD_BODY); }"," if (L.isValue(this.get(FOOTER_CONTENT))) { this._renderStdMod(STD_FOOTER); }"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to"," * Widget standard module related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIStdMod"," * @protected"," */"," _bindUIStdMod : function() {"," // this.after(HeaderChange, this._afterHeaderChange);"," // this.after(BodyChange, this._afterBodyChange);"," // this.after(FooterChange, this._afterFooterChange);",""," this.after(FillHeightChange, this._afterFillHeightChange);"," this.after(HeightChange, this._fillHeight);"," this.after(ContentUpdate, this._fillHeight);"," },",""," /**"," * Default attribute change listener for the headerContent attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterHeaderChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterHeaderChange : function(e) {"," if (e.src !== UI) {"," this._uiSetStdMod(STD_HEADER, e.newVal, e.stdModPosition);"," }"," },",""," /**"," * Default attribute change listener for the bodyContent attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterBodyChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterBodyChange : function(e) {"," if (e.src !== UI) {"," this._uiSetStdMod(STD_BODY, e.newVal, e.stdModPosition);"," }"," },",""," /**"," * Default attribute change listener for the footerContent attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterFooterChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterFooterChange : function(e) {"," if (e.src !== UI) {"," this._uiSetStdMod(STD_FOOTER, e.newVal, e.stdModPosition);"," }"," },",""," /**"," * Default attribute change listener for the fillHeight attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterFillHeightChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterFillHeightChange: function (e) {"," this._uiSetFillHeight(e.newVal);"," },",""," /**"," * Default validator for the fillHeight attribute. Verifies that the"," * value set is a valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER,"," * or a falsey value if fillHeight is to be disabled."," *"," * @method _validateFillHeight"," * @protected"," * @param {String} val The section which should be setup to fill height, or false/null to disable fillHeight"," * @return true if valid, false if not"," */"," _validateFillHeight : function(val) {"," return !val || val == StdMod.BODY || val == StdMod.HEADER || val == StdMod.FOOTER;"," },",""," /**"," * Updates the rendered UI, to resize the provided section so that the standard module fills out"," * the specified widget height. Note: This method does not check whether or not a height is set"," * on the Widget."," *"," * @method _uiSetFillHeight"," * @protected"," * @param {String} fillSection A valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER"," */"," _uiSetFillHeight : function(fillSection) {"," var fillNode = this.getStdModNode(fillSection);"," var currNode = this._currFillNode;",""," if (currNode && fillNode !== currNode){"," currNode.setStyle(HEIGHT, EMPTY);"," }",""," if (fillNode) {"," this._currFillNode = fillNode;"," }",""," this._fillHeight();"," },",""," /**"," * Updates the rendered UI, to resize the current section specified by the fillHeight attribute, so"," * that the standard module fills out the Widget height. If a height has not been set on Widget,"," * the section is not resized (height is set to \"auto\")."," *"," * @method _fillHeight"," * @private"," */"," _fillHeight : function() {"," if (this.get(FILL_HEIGHT)) {"," var height = this.get(HEIGHT);"," if (height != EMPTY && height != AUTO) {"," this.fillHeight(this._currFillNode);"," }"," }"," },",""," /**"," * Updates the rendered UI, adding the provided content (either an HTML string, or node reference),"," * to the specified section. The content is either added before, after or replaces existing content"," * in the section, based on the value of the <code>where</code> argument."," *"," * @method _uiSetStdMod"," * @protected"," *"," * @param {String} section The section to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @param {String | Node} content The new content (either as an HTML string, or Node reference) to add to the section"," * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE."," * If not provided, the content will replace existing content in the section."," */"," _uiSetStdMod : function(section, content, where) {"," // Using isValue, so that \"\" is valid content"," if (L.isValue(content)) {"," var node = this.getStdModNode(section, true);",""," this._addStdModContent(node, content, where);",""," this.set(section + CONTENT_SUFFIX, this._getStdModContent(section), {src:UI});"," } else {"," this._eraseStdMod(section);"," }"," this.fire(ContentUpdate);"," },",""," /**"," * Creates the DOM node for the given section, and inserts it into the correct location in the contentBox."," *"," * @method _renderStdMod"," * @protected"," * @param {String} section The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} A reference to the added section node"," */"," _renderStdMod : function(section) {",""," var contentBox = this.get(CONTENT_BOX),"," sectionNode = this._findStdModSection(section);",""," if (!sectionNode) {"," sectionNode = this._getStdModTemplate(section);"," }",""," this._insertStdModSection(contentBox, section, sectionNode);",""," this[section + NODE_SUFFIX] = sectionNode;"," return this[section + NODE_SUFFIX];"," },",""," /**"," * Removes the DOM node for the given section."," *"," * @method _eraseStdMod"," * @protected"," * @param {String} section The section to remove. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," */"," _eraseStdMod : function(section) {"," var sectionNode = this.getStdModNode(section);"," if (sectionNode) {"," sectionNode.remove(true);"," delete this[section + NODE_SUFFIX];"," }"," },",""," /**"," * Helper method to insert the Node for the given section into the correct location in the contentBox."," *"," * @method _insertStdModSection"," * @private"," * @param {Node} contentBox A reference to the Widgets content box."," * @param {String} section The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @param {Node} sectionNode The Node for the section."," */"," _insertStdModSection : function(contentBox, section, sectionNode) {"," var fc = contentBox.get(FIRST_CHILD);",""," if (section === STD_FOOTER || !fc) {"," contentBox.appendChild(sectionNode);"," } else {"," if (section === STD_HEADER) {"," contentBox.insertBefore(sectionNode, fc);"," } else {"," var footer = this[STD_FOOTER + NODE_SUFFIX];"," if (footer) {"," contentBox.insertBefore(sectionNode, footer);"," } else {"," contentBox.appendChild(sectionNode);"," }"," }"," }"," },",""," /**"," * Gets a new Node reference for the given standard module section, by cloning"," * the stored template node."," *"," * @method _getStdModTemplate"," * @protected"," * @param {String} section The section to create a new node for. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} The new Node instance for the section"," */"," _getStdModTemplate : function(section) {"," return Node.create(StdMod.TEMPLATES[section], this._stdModNode.get(OWNER_DOCUMENT));"," },",""," /**"," * Helper method to add content to a StdMod section node."," * The content is added either before, after or replaces the existing node content"," * based on the value of the <code>where</code> argument."," *"," * @method _addStdModContent"," * @private"," *"," * @param {Node} node The section Node to be updated."," * @param {Node|NodeList|String} children The new content Node, NodeList or String to be added to section Node provided."," * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE."," * If not provided, the content will replace existing content in the Node."," */"," _addStdModContent : function(node, children, where) {",""," // StdMod where to Node where"," switch (where) {"," case StdMod.BEFORE: // 0 is before fistChild"," where = 0;"," break;"," case StdMod.AFTER: // undefined is appendChild"," where = undefined;"," break;"," default: // replace is replace, not specified is replace"," where = StdMod.REPLACE;"," }",""," node.insert(children, where);"," },",""," /**"," * Helper method to obtain the precise height of the node provided, including padding and border."," * The height could be a sub-pixel value for certain browsers, such as Firefox 3."," *"," * @method _getPreciseHeight"," * @private"," * @param {Node} node The node for which the precise height is required."," * @return {Number} The height of the Node including borders and padding, possibly a float."," */"," _getPreciseHeight : function(node) {"," var height = (node) ? node.get(OFFSET_HEIGHT) : 0,"," getBCR = \"getBoundingClientRect\";",""," if (node && node.hasMethod(getBCR)) {"," var preciseRegion = node.invoke(getBCR);"," if (preciseRegion) {"," height = preciseRegion.bottom - preciseRegion.top;"," }"," }",""," return height;"," },",""," /**"," * Helper method to to find the rendered node for the given section,"," * if it exists."," *"," * @method _findStdModSection"," * @private"," * @param {String} section The section for which the render Node is to be found. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} The rendered node for the given section, or null if not found."," */"," _findStdModSection: function(section) {"," return this.get(CONTENT_BOX).one(\"> .\" + StdMod.SECTION_CLASS_NAMES[section]);"," },",""," /**"," * Utility method, used by WidgetStdMods HTML_PARSER implementation"," * to extract data for each section from markup."," *"," * @method _parseStdModHTML"," * @private"," * @param {String} section"," * @return {String} Inner HTML string with the contents of the section"," */"," _parseStdModHTML : function(section) {",""," var node = this._findStdModSection(section);",""," if (node) {"," if (!this._stdModParsed) {"," this._stdModParsed = {};"," Y.before(this._applyStdModParsedConfig, this, APPLY_PARSED_CONFIG);"," }"," this._stdModParsed[section + CONTENT_SUFFIX] = 1;",""," return node.get(\"innerHTML\");"," }",""," return null;"," },",""," /**"," * This method is injected before the _applyParsedConfig step in"," * the application of HTML_PARSER, and sets up the state to"," * identify whether or not we should remove the current DOM content"," * or not, based on whether or not the current content attribute value"," * was extracted from the DOM, or provided by the user configuration"," *"," * @method _applyStdModParsedConfig"," * @private"," */"," _applyStdModParsedConfig : function(node, cfg, parsedCfg) {"," var parsed = this._stdModParsed;"," if (parsed) {"," parsed[HEADER_CONTENT] = !(HEADER_CONTENT in cfg) && (HEADER_CONTENT in parsed);"," parsed[BODY_CONTENT] = !(BODY_CONTENT in cfg) && (BODY_CONTENT in parsed);"," parsed[FOOTER_CONTENT] = !(FOOTER_CONTENT in cfg) && (FOOTER_CONTENT in parsed);"," }"," },",""," /**"," * Retrieves the child nodes (content) of a standard module section"," *"," * @method _getStdModContent"," * @private"," * @param {String} section The standard module section whose child nodes are to be retrieved. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} The child node collection of the standard module section."," */"," _getStdModContent : function(section) {"," return (this[section + NODE_SUFFIX]) ? this[section + NODE_SUFFIX].get(CHILD_NODES) : null;"," },",""," /**"," * Updates the body section of the standard module with the content provided (either an HTML string, or node reference)."," * <p>"," * This method can be used instead of the corresponding section content attribute if you'd like to retain the current content of the section,"," * and insert content before or after it, by specifying the <code>where</code> argument."," * </p>"," * @method setStdModContent"," * @param {String} section The standard module section whose content is to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @param {String | Node} content The content to be added, either an HTML string or a Node reference."," * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE."," * If not provided, the content will replace existing content in the section."," */"," setStdModContent : function(section, content, where) {"," //var node = this.getStdModNode(section) || this._renderStdMod(section);"," this.set(section + CONTENT_SUFFIX, content, {stdModPosition:where});"," //this._addStdModContent(node, content, where);"," },",""," /**"," Returns the node reference for the specified `section`.",""," **Note:** The DOM is not queried for the node reference. The reference"," stored by the widget instance is returned if it was set. Passing a"," truthy for `forceCreate` will create the section node if it does not"," already exist.",""," @method getStdModNode"," @param {String} section The section whose node reference is required."," Either `WidgetStdMod.HEADER`, `WidgetStdMod.BODY`, or"," `WidgetStdMod.FOOTER`."," @param {Boolean} forceCreate Whether the section node should be created"," if it does not already exist."," @return {Node} The node reference for the `section`, or null if not set."," **/"," getStdModNode : function(section, forceCreate) {"," var node = this[section + NODE_SUFFIX] || null;",""," if (!node && forceCreate) {"," node = this._renderStdMod(section);"," }",""," return node;"," },",""," /**"," * Sets the height on the provided header, body or footer element to"," * fill out the height of the Widget. It determines the height of the"," * widgets bounding box, based on it's configured height value, and"," * sets the height of the provided section to fill out any"," * space remaining after the other standard module section heights"," * have been accounted for."," *"," * <p><strong>NOTE:</strong> This method is not designed to work if an explicit"," * height has not been set on the Widget, since for an \"auto\" height Widget,"," * the heights of the header/body/footer will drive the height of the Widget.</p>"," *"," * @method fillHeight"," * @param {Node} node The node which should be resized to fill out the height"," * of the Widget bounding box. Should be a standard module section node which belongs"," * to the widget."," */"," fillHeight : function(node) {"," if (node) {"," var contentBox = this.get(CONTENT_BOX),"," stdModNodes = [this.headerNode, this.bodyNode, this.footerNode],"," stdModNode,"," cbContentHeight,"," filled = 0,"," remaining = 0,",""," validNode = false;",""," for (var i = 0, l = stdModNodes.length; i < l; i++) {"," stdModNode = stdModNodes[i];"," if (stdModNode) {"," if (stdModNode !== node) {"," filled += this._getPreciseHeight(stdModNode);"," } else {"," validNode = true;"," }"," }"," }",""," if (validNode) {"," if (UA.ie || UA.opera) {"," // Need to set height to 0, to allow height to be reduced"," node.set(OFFSET_HEIGHT, 0);"," }",""," cbContentHeight = contentBox.get(OFFSET_HEIGHT) -"," parseInt(contentBox.getComputedStyle(\"paddingTop\"), 10) -"," parseInt(contentBox.getComputedStyle(\"paddingBottom\"), 10) -"," parseInt(contentBox.getComputedStyle(\"borderBottomWidth\"), 10) -"," parseInt(contentBox.getComputedStyle(\"borderTopWidth\"), 10);",""," if (L.isNumber(cbContentHeight)) {"," remaining = cbContentHeight - filled;"," if (remaining >= 0) {"," node.set(OFFSET_HEIGHT, remaining);"," }"," }"," }"," }"," }"," };",""," Y.WidgetStdMod = StdMod;","","","}, '3.7.2', {\"requires\": [\"base-build\", \"widget\"]});"];+_yuitest_coverage["build/widget-stdmod/widget-stdmod.js"].code=["YUI.add('widget-stdmod', function (Y, NAME) {","","/**"," * Provides standard module support for Widgets through an extension."," *"," * @module widget-stdmod"," */"," var L = Y.Lang,"," Node = Y.Node,"," UA = Y.UA,"," Widget = Y.Widget,",""," EMPTY = \"\","," HD = \"hd\","," BD = \"bd\","," FT = \"ft\","," HEADER = \"header\","," BODY = \"body\","," FOOTER = \"footer\","," FILL_HEIGHT = \"fillHeight\","," STDMOD = \"stdmod\",",""," NODE_SUFFIX = \"Node\","," CONTENT_SUFFIX = \"Content\",",""," FIRST_CHILD = \"firstChild\","," CHILD_NODES = \"childNodes\","," OWNER_DOCUMENT = \"ownerDocument\",",""," CONTENT_BOX = \"contentBox\",",""," HEIGHT = \"height\","," OFFSET_HEIGHT = \"offsetHeight\","," AUTO = \"auto\",",""," HeaderChange = \"headerContentChange\","," BodyChange = \"bodyContentChange\","," FooterChange = \"footerContentChange\","," FillHeightChange = \"fillHeightChange\","," HeightChange = \"heightChange\","," ContentUpdate = \"contentUpdate\",",""," RENDERUI = \"renderUI\","," BINDUI = \"bindUI\","," SYNCUI = \"syncUI\",",""," APPLY_PARSED_CONFIG = \"_applyParsedConfig\",",""," UI = Y.Widget.UI_SRC;",""," /**"," * Widget extension, which can be used to add Standard Module support to the"," * base Widget class, through the <a href=\"Base.html#method_build\">Base.build</a>"," * method."," * <p>"," * The extension adds header, body and footer sections to the Widget's content box and"," * provides the corresponding methods and attributes to modify the contents of these sections."," * </p>"," * @class WidgetStdMod"," * @param {Object} The user configuration object"," */"," function StdMod(config) {",""," this._stdModNode = this.get(CONTENT_BOX);",""," Y.before(this._renderUIStdMod, this, RENDERUI);"," Y.before(this._bindUIStdMod, this, BINDUI);"," Y.before(this._syncUIStdMod, this, SYNCUI);"," }",""," /**"," * Constant used to refer the the standard module header, in methods which expect a section specifier"," *"," * @property HEADER"," * @static"," * @type String"," */"," StdMod.HEADER = HEADER;",""," /**"," * Constant used to refer the the standard module body, in methods which expect a section specifier"," *"," * @property BODY"," * @static"," * @type String"," */"," StdMod.BODY = BODY;",""," /**"," * Constant used to refer the the standard module footer, in methods which expect a section specifier"," *"," * @property FOOTER"," * @static"," * @type String"," */"," StdMod.FOOTER = FOOTER;",""," /**"," * Constant used to specify insertion position, when adding content to sections of the standard module in"," * methods which expect a \"where\" argument."," * <p>"," * Inserts new content <em>before</em> the sections existing content."," * </p>"," * @property AFTER"," * @static"," * @type String"," */"," StdMod.AFTER = \"after\";",""," /**"," * Constant used to specify insertion position, when adding content to sections of the standard module in"," * methods which expect a \"where\" argument."," * <p>"," * Inserts new content <em>before</em> the sections existing content."," * </p>"," * @property BEFORE"," * @static"," * @type String"," */"," StdMod.BEFORE = \"before\";"," /**"," * Constant used to specify insertion position, when adding content to sections of the standard module in"," * methods which expect a \"where\" argument."," * <p>"," * <em>Replaces</em> the sections existing content, with new content."," * </p>"," * @property REPLACE"," * @static"," * @type String"," */"," StdMod.REPLACE = \"replace\";",""," var STD_HEADER = StdMod.HEADER,"," STD_BODY = StdMod.BODY,"," STD_FOOTER = StdMod.FOOTER,",""," HEADER_CONTENT = STD_HEADER + CONTENT_SUFFIX,"," FOOTER_CONTENT = STD_FOOTER + CONTENT_SUFFIX,"," BODY_CONTENT = STD_BODY + CONTENT_SUFFIX;",""," /**"," * Static property used to define the default attribute"," * configuration introduced by WidgetStdMod."," *"," * @property ATTRS"," * @type Object"," * @static"," */"," StdMod.ATTRS = {",""," /**"," * @attribute headerContent"," * @type HTML"," * @default undefined"," * @description The content to be added to the header section. This will replace any existing content"," * in the header. If you want to append, or insert new content, use the <a href=\"#method_setStdModContent\">setStdModContent</a> method."," */"," headerContent: {"," value:null"," },",""," /**"," * @attribute footerContent"," * @type HTML"," * @default undefined"," * @description The content to be added to the footer section. This will replace any existing content"," * in the footer. If you want to append, or insert new content, use the <a href=\"#method_setStdModContent\">setStdModContent</a> method."," */"," footerContent: {"," value:null"," },",""," /**"," * @attribute bodyContent"," * @type HTML"," * @default undefined"," * @description The content to be added to the body section. This will replace any existing content"," * in the body. If you want to append, or insert new content, use the <a href=\"#method_setStdModContent\">setStdModContent</a> method."," */"," bodyContent: {"," value:null"," },",""," /**"," * @attribute fillHeight"," * @type {String}"," * @default WidgetStdMod.BODY"," * @description The section (WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER) which should be resized to fill the height of the standard module, when a"," * height is set on the Widget. If a height is not set on the widget, then all sections are sized based on"," * their content."," */"," fillHeight: {"," value: StdMod.BODY,"," validator: function(val) {"," return this._validateFillHeight(val);"," }"," }"," };",""," /**"," * The HTML parsing rules for the WidgetStdMod class."," *"," * @property HTML_PARSER"," * @static"," * @type Object"," */"," StdMod.HTML_PARSER = {"," headerContent: function(contentBox) {"," return this._parseStdModHTML(STD_HEADER);"," },",""," bodyContent: function(contentBox) {"," return this._parseStdModHTML(STD_BODY);"," },",""," footerContent : function(contentBox) {"," return this._parseStdModHTML(STD_FOOTER);"," }"," };",""," /**"," * Static hash of default class names used for the header,"," * body and footer sections of the standard module, keyed by"," * the section identifier (WidgetStdMod.STD_HEADER, WidgetStdMod.STD_BODY, WidgetStdMod.STD_FOOTER)"," *"," * @property SECTION_CLASS_NAMES"," * @static"," * @type Object"," */"," StdMod.SECTION_CLASS_NAMES = {"," header: Widget.getClassName(HD),"," body: Widget.getClassName(BD),"," footer: Widget.getClassName(FT)"," };",""," /**"," * The template HTML strings for each of the standard module sections. Section entries are keyed by the section constants,"," * WidgetStdMod.HEADER, WidgetStdMod.BODY, WidgetStdMod.FOOTER, and contain the HTML to be added for each section."," * e.g."," * <pre>"," * {"," * header : '<div class=\"yui-widget-hd\"></div>',"," * body : '<div class=\"yui-widget-bd\"></div>',"," * footer : '<div class=\"yui-widget-ft\"></div>'"," * }"," * </pre>"," * @property TEMPLATES"," * @type Object"," * @static"," */"," StdMod.TEMPLATES = {"," header : '<div class=\"' + StdMod.SECTION_CLASS_NAMES[STD_HEADER] + '\"></div>',"," body : '<div class=\"' + StdMod.SECTION_CLASS_NAMES[STD_BODY] + '\"></div>',"," footer : '<div class=\"' + StdMod.SECTION_CLASS_NAMES[STD_FOOTER] + '\"></div>'"," };",""," StdMod.prototype = {",""," /**"," * Synchronizes the UI to match the Widgets standard module state."," * <p>"," * This method is invoked after syncUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _syncUIStdMod"," * @protected"," */"," _syncUIStdMod : function() {"," var stdModParsed = this._stdModParsed;",""," if (!stdModParsed || !stdModParsed[HEADER_CONTENT]) {"," this._uiSetStdMod(STD_HEADER, this.get(HEADER_CONTENT));"," }",""," if (!stdModParsed || !stdModParsed[BODY_CONTENT]) {"," this._uiSetStdMod(STD_BODY, this.get(BODY_CONTENT));"," }",""," if (!stdModParsed || !stdModParsed[FOOTER_CONTENT]) {"," this._uiSetStdMod(STD_FOOTER, this.get(FOOTER_CONTENT));"," }",""," this._uiSetFillHeight(this.get(FILL_HEIGHT));"," },",""," /**"," * Creates/Initializes the DOM for standard module support."," * <p>"," * This method is invoked after renderUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _renderUIStdMod"," * @protected"," */"," _renderUIStdMod : function() {"," this._stdModNode.addClass(Widget.getClassName(STDMOD));"," this._renderStdModSections();",""," //This normally goes in bindUI but in order to allow setStdModContent() to work before renderUI"," //stage, these listeners should be set up at the earliest possible time."," this.after(HeaderChange, this._afterHeaderChange);"," this.after(BodyChange, this._afterBodyChange);"," this.after(FooterChange, this._afterFooterChange);"," },",""," _renderStdModSections : function() {"," if (L.isValue(this.get(HEADER_CONTENT))) { this._renderStdMod(STD_HEADER); }"," if (L.isValue(this.get(BODY_CONTENT))) { this._renderStdMod(STD_BODY); }"," if (L.isValue(this.get(FOOTER_CONTENT))) { this._renderStdMod(STD_FOOTER); }"," },",""," /**"," * Binds event listeners responsible for updating the UI state in response to"," * Widget standard module related state changes."," * <p>"," * This method is invoked after bindUI is invoked for the Widget class"," * using YUI's aop infrastructure."," * </p>"," * @method _bindUIStdMod"," * @protected"," */"," _bindUIStdMod : function() {"," // this.after(HeaderChange, this._afterHeaderChange);"," // this.after(BodyChange, this._afterBodyChange);"," // this.after(FooterChange, this._afterFooterChange);",""," this.after(FillHeightChange, this._afterFillHeightChange);"," this.after(HeightChange, this._fillHeight);"," this.after(ContentUpdate, this._fillHeight);"," },",""," /**"," * Default attribute change listener for the headerContent attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterHeaderChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterHeaderChange : function(e) {"," if (e.src !== UI) {"," this._uiSetStdMod(STD_HEADER, e.newVal, e.stdModPosition);"," }"," },",""," /**"," * Default attribute change listener for the bodyContent attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterBodyChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterBodyChange : function(e) {"," if (e.src !== UI) {"," this._uiSetStdMod(STD_BODY, e.newVal, e.stdModPosition);"," }"," },",""," /**"," * Default attribute change listener for the footerContent attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterFooterChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterFooterChange : function(e) {"," if (e.src !== UI) {"," this._uiSetStdMod(STD_FOOTER, e.newVal, e.stdModPosition);"," }"," },",""," /**"," * Default attribute change listener for the fillHeight attribute, responsible"," * for updating the UI, in response to attribute changes."," *"," * @method _afterFillHeightChange"," * @protected"," * @param {EventFacade} e The event facade for the attribute change"," */"," _afterFillHeightChange: function (e) {"," this._uiSetFillHeight(e.newVal);"," },",""," /**"," * Default validator for the fillHeight attribute. Verifies that the"," * value set is a valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER,"," * or a falsey value if fillHeight is to be disabled."," *"," * @method _validateFillHeight"," * @protected"," * @param {String} val The section which should be setup to fill height, or false/null to disable fillHeight"," * @return true if valid, false if not"," */"," _validateFillHeight : function(val) {"," return !val || val == StdMod.BODY || val == StdMod.HEADER || val == StdMod.FOOTER;"," },",""," /**"," * Updates the rendered UI, to resize the provided section so that the standard module fills out"," * the specified widget height. Note: This method does not check whether or not a height is set"," * on the Widget."," *"," * @method _uiSetFillHeight"," * @protected"," * @param {String} fillSection A valid section specifier - one of WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER"," */"," _uiSetFillHeight : function(fillSection) {"," var fillNode = this.getStdModNode(fillSection);"," var currNode = this._currFillNode;",""," if (currNode && fillNode !== currNode){"," currNode.setStyle(HEIGHT, EMPTY);"," }",""," if (fillNode) {"," this._currFillNode = fillNode;"," }",""," this._fillHeight();"," },",""," /**"," * Updates the rendered UI, to resize the current section specified by the fillHeight attribute, so"," * that the standard module fills out the Widget height. If a height has not been set on Widget,"," * the section is not resized (height is set to \"auto\")."," *"," * @method _fillHeight"," * @private"," */"," _fillHeight : function() {"," if (this.get(FILL_HEIGHT)) {"," var height = this.get(HEIGHT);"," if (height != EMPTY && height != AUTO) {"," this.fillHeight(this._currFillNode);"," }"," }"," },",""," /**"," * Updates the rendered UI, adding the provided content (either an HTML string, or node reference),"," * to the specified section. The content is either added before, after or replaces existing content"," * in the section, based on the value of the <code>where</code> argument."," *"," * @method _uiSetStdMod"," * @protected"," *"," * @param {String} section The section to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @param {String | Node} content The new content (either as an HTML string, or Node reference) to add to the section"," * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE."," * If not provided, the content will replace existing content in the section."," */"," _uiSetStdMod : function(section, content, where) {"," // Using isValue, so that \"\" is valid content"," if (L.isValue(content)) {"," var node = this.getStdModNode(section, true);",""," this._addStdModContent(node, content, where);",""," this.set(section + CONTENT_SUFFIX, this._getStdModContent(section), {src:UI});"," } else {"," this._eraseStdMod(section);"," }"," this.fire(ContentUpdate);"," },",""," /**"," * Creates the DOM node for the given section, and inserts it into the correct location in the contentBox."," *"," * @method _renderStdMod"," * @protected"," * @param {String} section The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} A reference to the added section node"," */"," _renderStdMod : function(section) {",""," var contentBox = this.get(CONTENT_BOX),"," sectionNode = this._findStdModSection(section);",""," if (!sectionNode) {"," sectionNode = this._getStdModTemplate(section);"," }",""," this._insertStdModSection(contentBox, section, sectionNode);",""," this[section + NODE_SUFFIX] = sectionNode;"," return this[section + NODE_SUFFIX];"," },",""," /**"," * Removes the DOM node for the given section."," *"," * @method _eraseStdMod"," * @protected"," * @param {String} section The section to remove. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," */"," _eraseStdMod : function(section) {"," var sectionNode = this.getStdModNode(section);"," if (sectionNode) {"," sectionNode.remove(true);"," delete this[section + NODE_SUFFIX];"," }"," },",""," /**"," * Helper method to insert the Node for the given section into the correct location in the contentBox."," *"," * @method _insertStdModSection"," * @private"," * @param {Node} contentBox A reference to the Widgets content box."," * @param {String} section The section to create/render. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @param {Node} sectionNode The Node for the section."," */"," _insertStdModSection : function(contentBox, section, sectionNode) {"," var fc = contentBox.get(FIRST_CHILD);",""," if (section === STD_FOOTER || !fc) {"," contentBox.appendChild(sectionNode);"," } else {"," if (section === STD_HEADER) {"," contentBox.insertBefore(sectionNode, fc);"," } else {"," var footer = this[STD_FOOTER + NODE_SUFFIX];"," if (footer) {"," contentBox.insertBefore(sectionNode, footer);"," } else {"," contentBox.appendChild(sectionNode);"," }"," }"," }"," },",""," /**"," * Gets a new Node reference for the given standard module section, by cloning"," * the stored template node."," *"," * @method _getStdModTemplate"," * @protected"," * @param {String} section The section to create a new node for. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} The new Node instance for the section"," */"," _getStdModTemplate : function(section) {"," return Node.create(StdMod.TEMPLATES[section], this._stdModNode.get(OWNER_DOCUMENT));"," },",""," /**"," * Helper method to add content to a StdMod section node."," * The content is added either before, after or replaces the existing node content"," * based on the value of the <code>where</code> argument."," *"," * @method _addStdModContent"," * @private"," *"," * @param {Node} node The section Node to be updated."," * @param {Node|NodeList|String} children The new content Node, NodeList or String to be added to section Node provided."," * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE."," * If not provided, the content will replace existing content in the Node."," */"," _addStdModContent : function(node, children, where) {",""," // StdMod where to Node where"," switch (where) {"," case StdMod.BEFORE: // 0 is before fistChild"," where = 0;"," break;"," case StdMod.AFTER: // undefined is appendChild"," where = undefined;"," break;"," default: // replace is replace, not specified is replace"," where = StdMod.REPLACE;"," }",""," node.insert(children, where);"," },",""," /**"," * Helper method to obtain the precise height of the node provided, including padding and border."," * The height could be a sub-pixel value for certain browsers, such as Firefox 3."," *"," * @method _getPreciseHeight"," * @private"," * @param {Node} node The node for which the precise height is required."," * @return {Number} The height of the Node including borders and padding, possibly a float."," */"," _getPreciseHeight : function(node) {"," var height = (node) ? node.get(OFFSET_HEIGHT) : 0,"," getBCR = \"getBoundingClientRect\";",""," if (node && node.hasMethod(getBCR)) {"," var preciseRegion = node.invoke(getBCR);"," if (preciseRegion) {"," height = preciseRegion.bottom - preciseRegion.top;"," }"," }",""," return height;"," },",""," /**"," * Helper method to to find the rendered node for the given section,"," * if it exists."," *"," * @method _findStdModSection"," * @private"," * @param {String} section The section for which the render Node is to be found. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} The rendered node for the given section, or null if not found."," */"," _findStdModSection: function(section) {"," return this.get(CONTENT_BOX).one(\"> .\" + StdMod.SECTION_CLASS_NAMES[section]);"," },",""," /**"," * Utility method, used by WidgetStdMods HTML_PARSER implementation"," * to extract data for each section from markup."," *"," * @method _parseStdModHTML"," * @private"," * @param {String} section"," * @return {String} Inner HTML string with the contents of the section"," */"," _parseStdModHTML : function(section) {",""," var node = this._findStdModSection(section);",""," if (node) {"," if (!this._stdModParsed) {"," this._stdModParsed = {};"," Y.before(this._applyStdModParsedConfig, this, APPLY_PARSED_CONFIG);"," }"," this._stdModParsed[section + CONTENT_SUFFIX] = 1;",""," return node.get(\"innerHTML\");"," }",""," return null;"," },",""," /**"," * This method is injected before the _applyParsedConfig step in"," * the application of HTML_PARSER, and sets up the state to"," * identify whether or not we should remove the current DOM content"," * or not, based on whether or not the current content attribute value"," * was extracted from the DOM, or provided by the user configuration"," *"," * @method _applyStdModParsedConfig"," * @private"," */"," _applyStdModParsedConfig : function(node, cfg, parsedCfg) {"," var parsed = this._stdModParsed;"," if (parsed) {"," parsed[HEADER_CONTENT] = !(HEADER_CONTENT in cfg) && (HEADER_CONTENT in parsed);"," parsed[BODY_CONTENT] = !(BODY_CONTENT in cfg) && (BODY_CONTENT in parsed);"," parsed[FOOTER_CONTENT] = !(FOOTER_CONTENT in cfg) && (FOOTER_CONTENT in parsed);"," }"," },",""," /**"," * Retrieves the child nodes (content) of a standard module section"," *"," * @method _getStdModContent"," * @private"," * @param {String} section The standard module section whose child nodes are to be retrieved. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @return {Node} The child node collection of the standard module section."," */"," _getStdModContent : function(section) {"," return (this[section + NODE_SUFFIX]) ? this[section + NODE_SUFFIX].get(CHILD_NODES) : null;"," },",""," /**"," * Updates the body section of the standard module with the content provided (either an HTML string, or node reference)."," * <p>"," * This method can be used instead of the corresponding section content attribute if you'd like to retain the current content of the section,"," * and insert content before or after it, by specifying the <code>where</code> argument."," * </p>"," * @method setStdModContent"," * @param {String} section The standard module section whose content is to be updated. Either WidgetStdMod.HEADER, WidgetStdMod.BODY or WidgetStdMod.FOOTER."," * @param {String | Node} content The content to be added, either an HTML string or a Node reference."," * @param {String} where Optional. Either WidgetStdMod.AFTER, WidgetStdMod.BEFORE or WidgetStdMod.REPLACE."," * If not provided, the content will replace existing content in the section."," */"," setStdModContent : function(section, content, where) {"," //var node = this.getStdModNode(section) || this._renderStdMod(section);"," this.set(section + CONTENT_SUFFIX, content, {stdModPosition:where});"," //this._addStdModContent(node, content, where);"," },",""," /**"," Returns the node reference for the specified `section`.",""," **Note:** The DOM is not queried for the node reference. The reference"," stored by the widget instance is returned if it was set. Passing a"," truthy for `forceCreate` will create the section node if it does not"," already exist.",""," @method getStdModNode"," @param {String} section The section whose node reference is required."," Either `WidgetStdMod.HEADER`, `WidgetStdMod.BODY`, or"," `WidgetStdMod.FOOTER`."," @param {Boolean} forceCreate Whether the section node should be created"," if it does not already exist."," @return {Node} The node reference for the `section`, or null if not set."," **/"," getStdModNode : function(section, forceCreate) {"," var node = this[section + NODE_SUFFIX] || null;",""," if (!node && forceCreate) {"," node = this._renderStdMod(section);"," }",""," return node;"," },",""," /**"," * Sets the height on the provided header, body or footer element to"," * fill out the height of the Widget. It determines the height of the"," * widgets bounding box, based on it's configured height value, and"," * sets the height of the provided section to fill out any"," * space remaining after the other standard module section heights"," * have been accounted for."," *"," * <p><strong>NOTE:</strong> This method is not designed to work if an explicit"," * height has not been set on the Widget, since for an \"auto\" height Widget,"," * the heights of the header/body/footer will drive the height of the Widget.</p>"," *"," * @method fillHeight"," * @param {Node} node The node which should be resized to fill out the height"," * of the Widget bounding box. Should be a standard module section node which belongs"," * to the widget."," */"," fillHeight : function(node) {"," if (node) {"," var contentBox = this.get(CONTENT_BOX),"," stdModNodes = [this.headerNode, this.bodyNode, this.footerNode],"," stdModNode,"," cbContentHeight,"," filled = 0,"," remaining = 0,",""," validNode = false;",""," for (var i = 0, l = stdModNodes.length; i < l; i++) {"," stdModNode = stdModNodes[i];"," if (stdModNode) {"," if (stdModNode !== node) {"," filled += this._getPreciseHeight(stdModNode);"," } else {"," validNode = true;"," }"," }"," }",""," if (validNode) {"," if (UA.ie || UA.opera) {"," // Need to set height to 0, to allow height to be reduced"," node.set(OFFSET_HEIGHT, 0);"," }",""," cbContentHeight = contentBox.get(OFFSET_HEIGHT) -"," parseInt(contentBox.getComputedStyle(\"paddingTop\"), 10) -"," parseInt(contentBox.getComputedStyle(\"paddingBottom\"), 10) -"," parseInt(contentBox.getComputedStyle(\"borderBottomWidth\"), 10) -"," parseInt(contentBox.getComputedStyle(\"borderTopWidth\"), 10);",""," if (L.isNumber(cbContentHeight)) {"," remaining = cbContentHeight - filled;"," if (remaining >= 0) {"," node.set(OFFSET_HEIGHT, remaining);"," }"," }"," }"," }"," }"," };",""," Y.WidgetStdMod = StdMod;","","","}, '3.7.3', {\"requires\": [\"base-build\", \"widget\"]});"]; _yuitest_coverage["build/widget-stdmod/widget-stdmod.js"].lines = {"1":0,"8":0,"62":0,"64":0,"66":0,"67":0,"68":0,"78":0,"87":0,"96":0,"108":0,"120":0,"131":0,"133":0,"149":0,"195":0,"207":0,"209":0,"213":0,"217":0,"230":0,"251":0,"257":0,"269":0,"271":0,"272":0,"275":0,"276":0,"279":0,"280":0,"283":0,"296":0,"297":0,"301":0,"302":0,"303":0,"307":0,"308":0,"309":0,"327":0,"328":0,"329":0,"341":0,"342":0,"355":0,"356":0,"369":0,"370":0,"383":0,"397":0,"410":0,"411":0,"413":0,"414":0,"417":0,"418":0,"421":0,"433":0,"434":0,"435":0,"436":0,"456":0,"457":0,"459":0,"461":0,"463":0,"465":0,"478":0,"481":0,"482":0,"485":0,"487":0,"488":0,"499":0,"500":0,"501":0,"502":0,"516":0,"518":0,"519":0,"521":0,"522":0,"524":0,"525":0,"526":0,"528":0,"544":0,"563":0,"565":0,"566":0,"568":0,"569":0,"571":0,"574":0,"587":0,"590":0,"591":0,"592":0,"593":0,"597":0,"610":0,"624":0,"626":0,"627":0,"628":0,"629":0,"631":0,"633":0,"636":0,"650":0,"651":0,"652":0,"653":0,"654":0,"667":0,"684":0,"705":0,"707":0,"708":0,"711":0,"732":0,"733":0,"742":0,"743":0,"744":0,"745":0,"746":0,"748":0,"753":0,"754":0,"756":0,"759":0,"765":0,"766":0,"767":0,"768":0,"776":0}; _yuitest_coverage["build/widget-stdmod/widget-stdmod.js"].functions = {"StdMod:62":0,"validator:194":0,"headerContent:208":0,"bodyContent:212":0,"footerContent:216":0,"_syncUIStdMod:268":0,"_renderUIStdMod:295":0,"_renderStdModSections:306":0,"_bindUIStdMod:322":0,"_afterHeaderChange:340":0,"_afterBodyChange:354":0,"_afterFooterChange:368":0,"_afterFillHeightChange:382":0,"_validateFillHeight:396":0,"_uiSetFillHeight:409":0,"_fillHeight:432":0,"_uiSetStdMod:454":0,"_renderStdMod:476":0,"_eraseStdMod:498":0,"_insertStdModSection:515":0,"_getStdModTemplate:543":0,"_addStdModContent:560":0,"_getPreciseHeight:586":0,"_findStdModSection:609":0,"_parseStdModHTML:622":0,"_applyStdModParsedConfig:649":0,"_getStdModContent:666":0,"setStdModContent:682":0,"getStdModNode:704":0,"fillHeight:731":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-stdmod/widget-stdmod.js"].coveredLines = 137;@@ -983,4 +983,4 @@ Y.WidgetStdMod = StdMod; -}, '3.7.2', {"requires": ["base-build", "widget"]});+}, '3.7.3', {"requires": ["base-build", "widget"]});
bundle/widget-stdmod/widget-stdmod-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -782,4 +782,4 @@ Y.WidgetStdMod = StdMod; -}, '3.7.2', {"requires": ["base-build", "widget"]});+}, '3.7.3', {"requires": ["base-build", "widget"]});
bundle/widget-stdmod/widget-stdmod-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-stdmod",function(e,t){function H(t){this._stdModNode=this.get(w),e.before(this._renderUIStdMod,this,O),e.before(this._bindUIStdMod,this,M),e.before(this._syncUIStdMod,this,_)}var n=e.Lang,r=e.Node,i=e.UA,s=e.Widget,o="",u="hd",a="bd",f="ft",l="header",c="body",h="footer",p="fillHeight",d="stdmod",v="Node",m="Content",g="firstChild",y="childNodes",b="ownerDocument",w="contentBox",E="height",S="offsetHeight",x="auto",T="headerContentChange",N="bodyContentChange",C="footerContentChange",k="fillHeightChange",L="heightChange",A="contentUpdate",O="renderUI",M="bindUI",_="syncUI",D="_applyParsedConfig",P=e.Widget.UI_SRC;H.HEADER=l,H.BODY=c,H.FOOTER=h,H.AFTER="after",H.BEFORE="before",H.REPLACE="replace";var B=H.HEADER,j=H.BODY,F=H.FOOTER,I=B+m,q=F+m,R=j+m;H.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:H.BODY,validator:function(e){return this._validateFillHeight(e)}}},H.HTML_PARSER={headerContent:function(e){return this._parseStdModHTML(B)},bodyContent:function(e){return this._parseStdModHTML(j)},footerContent:function(e){return this._parseStdModHTML(F)}},H.SECTION_CLASS_NAMES={header:s.getClassName(u),body:s.getClassName(a),footer:s.getClassName(f)},H.TEMPLATES={header:'<div class="'+H.SECTION_CLASS_NAMES[B]+'"></div>',body:'<div class="'+H.SECTION_CLASS_NAMES[j]+'"></div>',footer:'<div class="'+H.SECTION_CLASS_NAMES[F]+'"></div>'},H.prototype={_syncUIStdMod:function(){var e=this._stdModParsed;(!e||!e[I])&&this._uiSetStdMod(B,this.get(I)),(!e||!e[R])&&this._uiSetStdMod(j,this.get(R)),(!e||!e[q])&&this._uiSetStdMod(F,this.get(q)),this._uiSetFillHeight(this.get(p))},_renderUIStdMod:function(){this._stdModNode.addClass(s.getClassName(d)),this._renderStdModSections(),this.after(T,this._afterHeaderChange),this.after(N,this._afterBodyChange),this.after(C,this._afterFooterChange)},_renderStdModSections:function(){n.isValue(this.get(I))&&this._renderStdMod(B),n.isValue(this.get(R))&&this._renderStdMod(j),n.isValue(this.get(q))&&this._renderStdMod(F)},_bindUIStdMod:function(){this.after(k,this._afterFillHeightChange),this.after(L,this._fillHeight),this.after(A,this._fillHeight)},_afterHeaderChange:function(e){e.src!==P&&this._uiSetStdMod(B,e.newVal,e.stdModPosition)},_afterBodyChange:function(e){e.src!==P&&this._uiSetStdMod(j,e.newVal,e.stdModPosition)},_afterFooterChange:function(e){e.src!==P&&this._uiSetStdMod(F,e.newVal,e.stdModPosition)},_afterFillHeightChange:function(e){this._uiSetFillHeight(e.newVal)},_validateFillHeight:function(e){return!e||e==H.BODY||e==H.HEADER||e==H.FOOTER},_uiSetFillHeight:function(e){var t=this.getStdModNode(e),n=this._currFillNode;n&&t!==n&&n.setStyle(E,o),t&&(this._currFillNode=t),this._fillHeight()},_fillHeight:function(){if(this.get(p)){var e=this.get(E);e!=o&&e!=x&&this.fillHeight(this._currFillNode)}},_uiSetStdMod:function(e,t,r){if(n.isValue(t)){var i=this.getStdModNode(e,!0);this._addStdModContent(i,t,r),this.set(e+m,this._getStdModContent(e),{src:P})}else this._eraseStdMod(e);this.fire(A)},_renderStdMod:function(e){var t=this.get(w),n=this._findStdModSection(e);return n||(n=this._getStdModTemplate(e)),this._insertStdModSection(t,e,n),this[e+v]=n,this[e+v]},_eraseStdMod:function(e){var t=this.getStdModNode(e);t&&(t.remove(!0),delete this[e+v])},_insertStdModSection:function(e,t,n){var r=e.get(g);if(t===F||!r)e.appendChild(n);else if(t===B)e.insertBefore(n,r);else{var i=this[F+v];i?e.insertBefore(n,i):e.appendChild(n)}},_getStdModTemplate:function(e){return r.create(H.TEMPLATES[e],this._stdModNode.get(b))},_addStdModContent:function(e,t,n){switch(n){case H.BEFORE:n=0;break;case H.AFTER:n=undefined;break;default:n=H.REPLACE}e.insert(t,n)},_getPreciseHeight:function(e){var t=e?e.get(S):0,n="getBoundingClientRect";if(e&&e.hasMethod(n)){var r=e.invoke(n);r&&(t=r.bottom-r.top)}return t},_findStdModSection:function(e){return this.get(w).one("> ."+H.SECTION_CLASS_NAMES[e])},_parseStdModHTML:function(t){var n=this._findStdModSection(t);return n?(this._stdModParsed||(this._stdModParsed={},e.before(this._applyStdModParsedConfig,this,D)),this._stdModParsed[t+m]=1,n.get("innerHTML")):null},_applyStdModParsedConfig:function(e,t,n){var r=this._stdModParsed;r&&(r[I]=!(I in t)&&I in r,r[R]=!(R in t)&&R in r,r[q]=!(q in t)&&q in r)},_getStdModContent:function(e){return this[e+v]?this[e+v].get(y):null},setStdModContent:function(e,t,n){this.set(e+m,t,{stdModPosition:n})},getStdModNode:function(e,t){var n=this[e+v]||null;return!n&&t&&(n=this._renderStdMod(e)),n},fillHeight:function(e){if(e){var t=this.get(w),r=[this.headerNode,this.bodyNode,this.footerNode],s,o,u=0,a=0,f=!1;for(var l=0,c=r.length;l<c;l++)s=r[l],s&&(s!==e?u+=this._getPreciseHeight(s):f=!0);f&&((i.ie||i.opera)&&e.set(S,0),o=t.get(S)-parseInt(t.getComputedStyle("paddingTop"),10)-parseInt(t.getComputedStyle("paddingBottom"),10)-parseInt(t.getComputedStyle("borderBottomWidth"),10)-parseInt(t.getComputedStyle("borderTopWidth"),10),n.isNumber(o)&&(a=o-u,a>=0&&e.set(S,a)))}}},e.WidgetStdMod=H},"3.7.2",{requires:["base-build","widget"]});+YUI.add("widget-stdmod",function(e,t){function H(t){this._stdModNode=this.get(w),e.before(this._renderUIStdMod,this,O),e.before(this._bindUIStdMod,this,M),e.before(this._syncUIStdMod,this,_)}var n=e.Lang,r=e.Node,i=e.UA,s=e.Widget,o="",u="hd",a="bd",f="ft",l="header",c="body",h="footer",p="fillHeight",d="stdmod",v="Node",m="Content",g="firstChild",y="childNodes",b="ownerDocument",w="contentBox",E="height",S="offsetHeight",x="auto",T="headerContentChange",N="bodyContentChange",C="footerContentChange",k="fillHeightChange",L="heightChange",A="contentUpdate",O="renderUI",M="bindUI",_="syncUI",D="_applyParsedConfig",P=e.Widget.UI_SRC;H.HEADER=l,H.BODY=c,H.FOOTER=h,H.AFTER="after",H.BEFORE="before",H.REPLACE="replace";var B=H.HEADER,j=H.BODY,F=H.FOOTER,I=B+m,q=F+m,R=j+m;H.ATTRS={headerContent:{value:null},footerContent:{value:null},bodyContent:{value:null},fillHeight:{value:H.BODY,validator:function(e){return this._validateFillHeight(e)}}},H.HTML_PARSER={headerContent:function(e){return this._parseStdModHTML(B)},bodyContent:function(e){return this._parseStdModHTML(j)},footerContent:function(e){return this._parseStdModHTML(F)}},H.SECTION_CLASS_NAMES={header:s.getClassName(u),body:s.getClassName(a),footer:s.getClassName(f)},H.TEMPLATES={header:'<div class="'+H.SECTION_CLASS_NAMES[B]+'"></div>',body:'<div class="'+H.SECTION_CLASS_NAMES[j]+'"></div>',footer:'<div class="'+H.SECTION_CLASS_NAMES[F]+'"></div>'},H.prototype={_syncUIStdMod:function(){var e=this._stdModParsed;(!e||!e[I])&&this._uiSetStdMod(B,this.get(I)),(!e||!e[R])&&this._uiSetStdMod(j,this.get(R)),(!e||!e[q])&&this._uiSetStdMod(F,this.get(q)),this._uiSetFillHeight(this.get(p))},_renderUIStdMod:function(){this._stdModNode.addClass(s.getClassName(d)),this._renderStdModSections(),this.after(T,this._afterHeaderChange),this.after(N,this._afterBodyChange),this.after(C,this._afterFooterChange)},_renderStdModSections:function(){n.isValue(this.get(I))&&this._renderStdMod(B),n.isValue(this.get(R))&&this._renderStdMod(j),n.isValue(this.get(q))&&this._renderStdMod(F)},_bindUIStdMod:function(){this.after(k,this._afterFillHeightChange),this.after(L,this._fillHeight),this.after(A,this._fillHeight)},_afterHeaderChange:function(e){e.src!==P&&this._uiSetStdMod(B,e.newVal,e.stdModPosition)},_afterBodyChange:function(e){e.src!==P&&this._uiSetStdMod(j,e.newVal,e.stdModPosition)},_afterFooterChange:function(e){e.src!==P&&this._uiSetStdMod(F,e.newVal,e.stdModPosition)},_afterFillHeightChange:function(e){this._uiSetFillHeight(e.newVal)},_validateFillHeight:function(e){return!e||e==H.BODY||e==H.HEADER||e==H.FOOTER},_uiSetFillHeight:function(e){var t=this.getStdModNode(e),n=this._currFillNode;n&&t!==n&&n.setStyle(E,o),t&&(this._currFillNode=t),this._fillHeight()},_fillHeight:function(){if(this.get(p)){var e=this.get(E);e!=o&&e!=x&&this.fillHeight(this._currFillNode)}},_uiSetStdMod:function(e,t,r){if(n.isValue(t)){var i=this.getStdModNode(e,!0);this._addStdModContent(i,t,r),this.set(e+m,this._getStdModContent(e),{src:P})}else this._eraseStdMod(e);this.fire(A)},_renderStdMod:function(e){var t=this.get(w),n=this._findStdModSection(e);return n||(n=this._getStdModTemplate(e)),this._insertStdModSection(t,e,n),this[e+v]=n,this[e+v]},_eraseStdMod:function(e){var t=this.getStdModNode(e);t&&(t.remove(!0),delete this[e+v])},_insertStdModSection:function(e,t,n){var r=e.get(g);if(t===F||!r)e.appendChild(n);else if(t===B)e.insertBefore(n,r);else{var i=this[F+v];i?e.insertBefore(n,i):e.appendChild(n)}},_getStdModTemplate:function(e){return r.create(H.TEMPLATES[e],this._stdModNode.get(b))},_addStdModContent:function(e,t,n){switch(n){case H.BEFORE:n=0;break;case H.AFTER:n=undefined;break;default:n=H.REPLACE}e.insert(t,n)},_getPreciseHeight:function(e){var t=e?e.get(S):0,n="getBoundingClientRect";if(e&&e.hasMethod(n)){var r=e.invoke(n);r&&(t=r.bottom-r.top)}return t},_findStdModSection:function(e){return this.get(w).one("> ."+H.SECTION_CLASS_NAMES[e])},_parseStdModHTML:function(t){var n=this._findStdModSection(t);return n?(this._stdModParsed||(this._stdModParsed={},e.before(this._applyStdModParsedConfig,this,D)),this._stdModParsed[t+m]=1,n.get("innerHTML")):null},_applyStdModParsedConfig:function(e,t,n){var r=this._stdModParsed;r&&(r[I]=!(I in t)&&I in r,r[R]=!(R in t)&&R in r,r[q]=!(q in t)&&q in r)},_getStdModContent:function(e){return this[e+v]?this[e+v].get(y):null},setStdModContent:function(e,t,n){this.set(e+m,t,{stdModPosition:n})},getStdModNode:function(e,t){var n=this[e+v]||null;return!n&&t&&(n=this._renderStdMod(e)),n},fillHeight:function(e){if(e){var t=this.get(w),r=[this.headerNode,this.bodyNode,this.footerNode],s,o,u=0,a=0,f=!1;for(var l=0,c=r.length;l<c;l++)s=r[l],s&&(s!==e?u+=this._getPreciseHeight(s):f=!0);f&&((i.ie||i.opera)&&e.set(S,0),o=t.get(S)-parseInt(t.getComputedStyle("paddingTop"),10)-parseInt(t.getComputedStyle("paddingBottom"),10)-parseInt(t.getComputedStyle("borderBottomWidth"),10)-parseInt(t.getComputedStyle("borderTopWidth"),10),n.isNumber(o)&&(a=o-u,a>=0&&e.set(S,a)))}}},e.WidgetStdMod=H},"3.7.3",{requires:["base-build","widget"]});
bundle/widget-stdmod/widget-stdmod.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -782,4 +782,4 @@ Y.WidgetStdMod = StdMod; -}, '3.7.2', {"requires": ["base-build", "widget"]});+}, '3.7.3', {"requires": ["base-build", "widget"]});
bundle/widget-uievents/assets/widget-base-core.css view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/
bundle/widget-uievents/widget-uievents-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/widget-uievents/widget-uievents.js", code: [] };-_yuitest_coverage["build/widget-uievents/widget-uievents.js"].code=["YUI.add('widget-uievents', function (Y, NAME) {","","/**"," * Support for Widget UI Events (Custom Events fired by the widget, which wrap the underlying DOM events - e.g. widget:click, widget:mousedown)"," *"," * @module widget"," * @submodule widget-uievents"," */","","var BOUNDING_BOX = \"boundingBox\","," Widget = Y.Widget,"," RENDER = \"render\","," L = Y.Lang,"," EVENT_PREFIX_DELIMITER = \":\",",""," // Map of Node instances serving as a delegation containers for a specific"," // event type to Widget instances using that delegation container."," _uievts = Y.Widget._uievts = Y.Widget._uievts || {};","","Y.mix(Widget.prototype, {",""," /**"," * Destructor logic for UI event infrastructure,"," * invoked during Widget destruction."," *"," * @method _destroyUIEvents"," * @for Widget"," * @private"," */"," _destroyUIEvents: function() {",""," var widgetGuid = Y.stamp(this, true);",""," Y.each(_uievts, function (info, key) {"," if (info.instances[widgetGuid]) {"," // Unregister this Widget instance as needing this delegated"," // event listener."," delete info.instances[widgetGuid];",""," // There are no more Widget instances using this delegated "," // event listener, so detach it.",""," if (Y.Object.isEmpty(info.instances)) {"," info.handle.detach();",""," if (_uievts[key]) {"," delete _uievts[key];"," }"," }"," }"," });"," },",""," /**"," * Map of DOM events that should be fired as Custom Events by the "," * Widget instance."," *"," * @property UI_EVENTS"," * @for Widget"," * @type Object"," */"," UI_EVENTS: Y.Node.DOM_EVENTS,",""," /**"," * Returns the node on which to bind delegate listeners."," *"," * @method _getUIEventNode"," * @for Widget"," * @protected"," */"," _getUIEventNode: function () {"," return this.get(BOUNDING_BOX);"," },",""," /**"," * Binds a delegated DOM event listener of the specified type to the "," * Widget's outtermost DOM element to facilitate the firing of a Custom"," * Event of the same type for the Widget instance. "," *"," * @method _createUIEvent"," * @for Widget "," * @param type {String} String representing the name of the event"," * @private"," */"," _createUIEvent: function (type) {",""," var uiEvtNode = this._getUIEventNode(),"," key = (Y.stamp(uiEvtNode) + type),"," info = _uievts[key],"," handle;",""," // For each Node instance: Ensure that there is only one delegated"," // event listener used to fire Widget UI events.",""," if (!info) {",""," handle = uiEvtNode.delegate(type, function (evt) {",""," var widget = Widget.getByNode(this);",""," // Widget could be null if node instance belongs to"," // another Y instance.",""," if (widget) {"," if (widget._filterUIEvent(evt)) {"," widget.fire(evt.type, { domEvent: evt });"," }"," }",""," }, \".\" + Y.Widget.getClassName());",""," _uievts[key] = info = { instances: {}, handle: handle };"," }",""," // Register this Widget as using this Node as a delegation container."," info.instances[Y.stamp(this)] = 1;"," },",""," /**"," * This method is used to determine if we should fire"," * the UI Event or not. The default implementation makes sure"," * that for nested delegates (nested unrelated widgets), we don't "," * fire the UI event listener more than once at each level."," *"," * <p>For example, without the additional filter, if you have nested "," * widgets, each widget will have a delegate listener. If you "," * click on the inner widget, the inner delegate listener's "," * filter will match once, but the outer will match twice "," * (based on delegate's design) - once for the inner widget, "," * and once for the outer.</p>"," *"," * @method _filterUIEvent"," * @for Widget "," * @param {DOMEventFacade} evt"," * @return {boolean} true if it's OK to fire the custom UI event, false if not."," * @private"," * "," */"," _filterUIEvent: function(evt) {"," // Either it's hitting this widget's delegate container (and not some other widget's), "," // or the container it's hitting is handling this widget's ui events."," return (evt.currentTarget.compareTo(evt.container) || evt.container.compareTo(this._getUIEventNode())); "," },",""," /**"," * Determines if the specified event is a UI event."," *"," * @private"," * @method _isUIEvent"," * @for Widget "," * @param type {String} String representing the name of the event"," * @return {String} Event Returns the name of the UI Event, otherwise "," * undefined."," */"," _getUIEvent: function (type) {",""," if (L.isString(type)) {"," var sType = this.parseType(type)[1],"," iDelim,"," returnVal;",""," if (sType) {"," // TODO: Get delimiter from ET, or have ET support this."," iDelim = sType.indexOf(EVENT_PREFIX_DELIMITER);"," if (iDelim > -1) {"," sType = sType.substring(iDelim + EVENT_PREFIX_DELIMITER.length);"," }",""," if (this.UI_EVENTS[sType]) {"," returnVal = sType;"," }"," }",""," return returnVal;"," }"," },",""," /**"," * Sets up infrastructure required to fire a UI event."," * "," * @private"," * @method _initUIEvent"," * @for Widget"," * @param type {String} String representing the name of the event"," * @return {String} "," */"," _initUIEvent: function (type) {"," var sType = this._getUIEvent(type),"," queue = this._uiEvtsInitQueue || {};",""," if (sType && !queue[sType]) {",""," this._uiEvtsInitQueue = queue[sType] = 1;",""," this.after(RENDER, function() { "," this._createUIEvent(sType);"," delete this._uiEvtsInitQueue[sType];"," });"," }"," },",""," // Override of \"on\" from Base to facilitate the firing of Widget events"," // based on DOM events of the same name/type (e.g. \"click\", \"mouseover\")."," // Temporary solution until we have the ability to listen to when "," // someone adds an event listener (bug 2528230)"," on: function (type) {"," this._initUIEvent(type);"," return Widget.superclass.on.apply(this, arguments);"," },",""," // Override of \"publish\" from Base to facilitate the firing of Widget events"," // based on DOM events of the same name/type (e.g. \"click\", \"mouseover\"). "," // Temporary solution until we have the ability to listen to when "," // someone publishes an event (bug 2528230) "," publish: function (type, config) {"," var sType = this._getUIEvent(type);"," if (sType && config && config.defaultFn) {"," this._initUIEvent(sType);"," } "," return Widget.superclass.publish.apply(this, arguments);"," }","","}, true); // overwrite existing EventTarget methods","","","}, '3.7.2', {\"requires\": [\"node-event-delegate\", \"widget-base\"]});"];+_yuitest_coverage["build/widget-uievents/widget-uievents.js"].code=["YUI.add('widget-uievents', function (Y, NAME) {","","/**"," * Support for Widget UI Events (Custom Events fired by the widget, which wrap the underlying DOM events - e.g. widget:click, widget:mousedown)"," *"," * @module widget"," * @submodule widget-uievents"," */","","var BOUNDING_BOX = \"boundingBox\","," Widget = Y.Widget,"," RENDER = \"render\","," L = Y.Lang,"," EVENT_PREFIX_DELIMITER = \":\",",""," // Map of Node instances serving as a delegation containers for a specific"," // event type to Widget instances using that delegation container."," _uievts = Y.Widget._uievts = Y.Widget._uievts || {};","","Y.mix(Widget.prototype, {",""," /**"," * Destructor logic for UI event infrastructure,"," * invoked during Widget destruction."," *"," * @method _destroyUIEvents"," * @for Widget"," * @private"," */"," _destroyUIEvents: function() {",""," var widgetGuid = Y.stamp(this, true);",""," Y.each(_uievts, function (info, key) {"," if (info.instances[widgetGuid]) {"," // Unregister this Widget instance as needing this delegated"," // event listener."," delete info.instances[widgetGuid];",""," // There are no more Widget instances using this delegated "," // event listener, so detach it.",""," if (Y.Object.isEmpty(info.instances)) {"," info.handle.detach();",""," if (_uievts[key]) {"," delete _uievts[key];"," }"," }"," }"," });"," },",""," /**"," * Map of DOM events that should be fired as Custom Events by the "," * Widget instance."," *"," * @property UI_EVENTS"," * @for Widget"," * @type Object"," */"," UI_EVENTS: Y.Node.DOM_EVENTS,",""," /**"," * Returns the node on which to bind delegate listeners."," *"," * @method _getUIEventNode"," * @for Widget"," * @protected"," */"," _getUIEventNode: function () {"," return this.get(BOUNDING_BOX);"," },",""," /**"," * Binds a delegated DOM event listener of the specified type to the "," * Widget's outtermost DOM element to facilitate the firing of a Custom"," * Event of the same type for the Widget instance. "," *"," * @method _createUIEvent"," * @for Widget "," * @param type {String} String representing the name of the event"," * @private"," */"," _createUIEvent: function (type) {",""," var uiEvtNode = this._getUIEventNode(),"," key = (Y.stamp(uiEvtNode) + type),"," info = _uievts[key],"," handle;",""," // For each Node instance: Ensure that there is only one delegated"," // event listener used to fire Widget UI events.",""," if (!info) {",""," handle = uiEvtNode.delegate(type, function (evt) {",""," var widget = Widget.getByNode(this);",""," // Widget could be null if node instance belongs to"," // another Y instance.",""," if (widget) {"," if (widget._filterUIEvent(evt)) {"," widget.fire(evt.type, { domEvent: evt });"," }"," }",""," }, \".\" + Y.Widget.getClassName());",""," _uievts[key] = info = { instances: {}, handle: handle };"," }",""," // Register this Widget as using this Node as a delegation container."," info.instances[Y.stamp(this)] = 1;"," },",""," /**"," * This method is used to determine if we should fire"," * the UI Event or not. The default implementation makes sure"," * that for nested delegates (nested unrelated widgets), we don't "," * fire the UI event listener more than once at each level."," *"," * <p>For example, without the additional filter, if you have nested "," * widgets, each widget will have a delegate listener. If you "," * click on the inner widget, the inner delegate listener's "," * filter will match once, but the outer will match twice "," * (based on delegate's design) - once for the inner widget, "," * and once for the outer.</p>"," *"," * @method _filterUIEvent"," * @for Widget "," * @param {DOMEventFacade} evt"," * @return {boolean} true if it's OK to fire the custom UI event, false if not."," * @private"," * "," */"," _filterUIEvent: function(evt) {"," // Either it's hitting this widget's delegate container (and not some other widget's), "," // or the container it's hitting is handling this widget's ui events."," return (evt.currentTarget.compareTo(evt.container) || evt.container.compareTo(this._getUIEventNode())); "," },",""," /**"," * Determines if the specified event is a UI event."," *"," * @private"," * @method _isUIEvent"," * @for Widget "," * @param type {String} String representing the name of the event"," * @return {String} Event Returns the name of the UI Event, otherwise "," * undefined."," */"," _getUIEvent: function (type) {",""," if (L.isString(type)) {"," var sType = this.parseType(type)[1],"," iDelim,"," returnVal;",""," if (sType) {"," // TODO: Get delimiter from ET, or have ET support this."," iDelim = sType.indexOf(EVENT_PREFIX_DELIMITER);"," if (iDelim > -1) {"," sType = sType.substring(iDelim + EVENT_PREFIX_DELIMITER.length);"," }",""," if (this.UI_EVENTS[sType]) {"," returnVal = sType;"," }"," }",""," return returnVal;"," }"," },",""," /**"," * Sets up infrastructure required to fire a UI event."," * "," * @private"," * @method _initUIEvent"," * @for Widget"," * @param type {String} String representing the name of the event"," * @return {String} "," */"," _initUIEvent: function (type) {"," var sType = this._getUIEvent(type),"," queue = this._uiEvtsInitQueue || {};",""," if (sType && !queue[sType]) {",""," this._uiEvtsInitQueue = queue[sType] = 1;",""," this.after(RENDER, function() { "," this._createUIEvent(sType);"," delete this._uiEvtsInitQueue[sType];"," });"," }"," },",""," // Override of \"on\" from Base to facilitate the firing of Widget events"," // based on DOM events of the same name/type (e.g. \"click\", \"mouseover\")."," // Temporary solution until we have the ability to listen to when "," // someone adds an event listener (bug 2528230)"," on: function (type) {"," this._initUIEvent(type);"," return Widget.superclass.on.apply(this, arguments);"," },",""," // Override of \"publish\" from Base to facilitate the firing of Widget events"," // based on DOM events of the same name/type (e.g. \"click\", \"mouseover\"). "," // Temporary solution until we have the ability to listen to when "," // someone publishes an event (bug 2528230) "," publish: function (type, config) {"," var sType = this._getUIEvent(type);"," if (sType && config && config.defaultFn) {"," this._initUIEvent(sType);"," } "," return Widget.superclass.publish.apply(this, arguments);"," }","","}, true); // overwrite existing EventTarget methods","","","}, '3.7.3', {\"requires\": [\"node-event-delegate\", \"widget-base\"]});"]; _yuitest_coverage["build/widget-uievents/widget-uievents.js"].lines = {"1":0,"10":0,"20":0,"32":0,"34":0,"35":0,"38":0,"43":0,"44":0,"46":0,"47":0,"72":0,"87":0,"95":0,"97":0,"99":0,"104":0,"105":0,"106":0,"112":0,"116":0,"142":0,"157":0,"158":0,"162":0,"164":0,"165":0,"166":0,"169":0,"170":0,"174":0,"188":0,"191":0,"193":0,"195":0,"196":0,"197":0,"207":0,"208":0,"216":0,"217":0,"218":0,"220":0}; _yuitest_coverage["build/widget-uievents/widget-uievents.js"].functions = {"(anonymous 2):34":0,"_destroyUIEvents:30":0,"_getUIEventNode:71":0,"(anonymous 3):97":0,"_createUIEvent:85":0,"_filterUIEvent:139":0,"_getUIEvent:155":0,"(anonymous 4):195":0,"_initUIEvent:187":0,"on:206":0,"publish:215":0,"(anonymous 1):1":0}; _yuitest_coverage["build/widget-uievents/widget-uievents.js"].coveredLines = 43;@@ -317,4 +317,4 @@ }, true); // overwrite existing EventTarget methods -}, '3.7.2', {"requires": ["node-event-delegate", "widget-base"]});+}, '3.7.3', {"requires": ["node-event-delegate", "widget-base"]});
bundle/widget-uievents/widget-uievents-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -230,4 +230,4 @@ }, true); // overwrite existing EventTarget methods -}, '3.7.2', {"requires": ["node-event-delegate", "widget-base"]});+}, '3.7.3', {"requires": ["node-event-delegate", "widget-base"]});
bundle/widget-uievents/widget-uievents-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("widget-uievents",function(e,t){var n="boundingBox",r=e.Widget,i="render",s=e.Lang,o=":",u=e.Widget._uievts=e.Widget._uievts||{};e.mix(r.prototype,{_destroyUIEvents:function(){var t=e.stamp(this,!0);e.each(u,function(n,r){n.instances[t]&&(delete n.instances[t],e.Object.isEmpty(n.instances)&&(n.handle.detach(),u[r]&&delete u[r]))})},UI_EVENTS:e.Node.DOM_EVENTS,_getUIEventNode:function(){return this.get(n)},_createUIEvent:function(t){var n=this._getUIEventNode(),i=e.stamp(n)+t,s=u[i],o;s||(o=n.delegate(t,function(e){var t=r.getByNode(this);t&&t._filterUIEvent(e)&&t.fire(e.type,{domEvent:e})},"."+e.Widget.getClassName()),u[i]=s={instances:{},handle:o}),s.instances[e.stamp(this)]=1},_filterUIEvent:function(e){return e.currentTarget.compareTo(e.container)||e.container.compareTo(this._getUIEventNode())},_getUIEvent:function(e){if(s.isString(e)){var t=this.parseType(e)[1],n,r;return t&&(n=t.indexOf(o),n>-1&&(t=t.substring(n+o.length)),this.UI_EVENTS[t]&&(r=t)),r}},_initUIEvent:function(e){var t=this._getUIEvent(e),n=this._uiEvtsInitQueue||{};t&&!n[t]&&(this._uiEvtsInitQueue=n[t]=1,this.after(i,function(){this._createUIEvent(t),delete this._uiEvtsInitQueue[t]}))},on:function(e){return this._initUIEvent(e),r.superclass.on.apply(this,arguments)},publish:function(e,t){var n=this._getUIEvent(e);return n&&t&&t.defaultFn&&this._initUIEvent(n),r.superclass.publish.apply(this,arguments)}},!0)},"3.7.2",{requires:["node-event-delegate","widget-base"]});+YUI.add("widget-uievents",function(e,t){var n="boundingBox",r=e.Widget,i="render",s=e.Lang,o=":",u=e.Widget._uievts=e.Widget._uievts||{};e.mix(r.prototype,{_destroyUIEvents:function(){var t=e.stamp(this,!0);e.each(u,function(n,r){n.instances[t]&&(delete n.instances[t],e.Object.isEmpty(n.instances)&&(n.handle.detach(),u[r]&&delete u[r]))})},UI_EVENTS:e.Node.DOM_EVENTS,_getUIEventNode:function(){return this.get(n)},_createUIEvent:function(t){var n=this._getUIEventNode(),i=e.stamp(n)+t,s=u[i],o;s||(o=n.delegate(t,function(e){var t=r.getByNode(this);t&&t._filterUIEvent(e)&&t.fire(e.type,{domEvent:e})},"."+e.Widget.getClassName()),u[i]=s={instances:{},handle:o}),s.instances[e.stamp(this)]=1},_filterUIEvent:function(e){return e.currentTarget.compareTo(e.container)||e.container.compareTo(this._getUIEventNode())},_getUIEvent:function(e){if(s.isString(e)){var t=this.parseType(e)[1],n,r;return t&&(n=t.indexOf(o),n>-1&&(t=t.substring(n+o.length)),this.UI_EVENTS[t]&&(r=t)),r}},_initUIEvent:function(e){var t=this._getUIEvent(e),n=this._uiEvtsInitQueue||{};t&&!n[t]&&(this._uiEvtsInitQueue=n[t]=1,this.after(i,function(){this._createUIEvent(t),delete this._uiEvtsInitQueue[t]}))},on:function(e){return this._initUIEvent(e),r.superclass.on.apply(this,arguments)},publish:function(e,t){var n=this._getUIEvent(e);return n&&t&&t.defaultFn&&this._initUIEvent(n),r.superclass.publish.apply(this,arguments)}},!0)},"3.7.3",{requires:["node-event-delegate","widget-base"]});
bundle/widget-uievents/widget-uievents.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -229,4 +229,4 @@ }, true); // overwrite existing EventTarget methods -}, '3.7.2', {"requires": ["node-event-delegate", "widget-base"]});+}, '3.7.3', {"requires": ["node-event-delegate", "widget-base"]});
+ bundle/yql-nodejs/yql-nodejs-coverage.js view
@@ -0,0 +1,79 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/yql-nodejs/yql-nodejs.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/yql-nodejs/yql-nodejs.js",+ code: []+};+_yuitest_coverage["build/yql-nodejs/yql-nodejs.js"].code=["YUI.add('yql-nodejs', function (Y, NAME) {","","/**","* NodeJS plugin for YQL to use native request to make requests instead of JSONP.","* Not required by the user, it's conditionally loaded and should \"just work\".","* @module yql","* @submodule yql-nodejs","*/","","var request = require('request');","","//Over writes Y.YQLRequest._send to use request instead of JSONP","Y.YQLRequest.prototype._send = function (url, o) {"," request(url, {"," method: 'GET',"," timeout: o.timeout || (30 * 1000)"," }, function(err, res) {"," if (err) {"," //The signature that YQL requires"," o.on.success({"," error: err"," });"," } else {"," o.on.success(JSON.parse(res.body));"," }"," });","};","","","}, '3.7.3');"];+_yuitest_coverage["build/yql-nodejs/yql-nodejs.js"].lines = {"1":0,"10":0,"13":0,"14":0,"18":0,"20":0,"24":0};+_yuitest_coverage["build/yql-nodejs/yql-nodejs.js"].functions = {"(anonymous 2):17":0,"_send:13":0,"(anonymous 1):1":0};+_yuitest_coverage["build/yql-nodejs/yql-nodejs.js"].coveredLines = 7;+_yuitest_coverage["build/yql-nodejs/yql-nodejs.js"].coveredFunctions = 3;+_yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 1);+YUI.add('yql-nodejs', function (Y, NAME) {++/**+* NodeJS plugin for YQL to use native request to make requests instead of JSONP.+* Not required by the user, it's conditionally loaded and should "just work".+* @module yql+* @submodule yql-nodejs+*/++_yuitest_coverfunc("build/yql-nodejs/yql-nodejs.js", "(anonymous 1)", 1);+_yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 10);+var request = require('request');++//Over writes Y.YQLRequest._send to use request instead of JSONP+_yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 13);+Y.YQLRequest.prototype._send = function (url, o) {+ _yuitest_coverfunc("build/yql-nodejs/yql-nodejs.js", "_send", 13);+_yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 14);+request(url, {+ method: 'GET',+ timeout: o.timeout || (30 * 1000)+ }, function(err, res) {+ _yuitest_coverfunc("build/yql-nodejs/yql-nodejs.js", "(anonymous 2)", 17);+_yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 18);+if (err) {+ //The signature that YQL requires+ _yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 20);+o.on.success({+ error: err+ });+ } else {+ _yuitest_coverline("build/yql-nodejs/yql-nodejs.js", 24);+o.on.success(JSON.parse(res.body));+ }+ });+};+++}, '3.7.3');
+ bundle/yql-nodejs/yql-nodejs-debug.js view
@@ -0,0 +1,36 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('yql-nodejs', function (Y, NAME) {++/**+* NodeJS plugin for YQL to use native request to make requests instead of JSONP.+* Not required by the user, it's conditionally loaded and should "just work".+* @module yql+* @submodule yql-nodejs+*/++var request = require('request');++//Over writes Y.YQLRequest._send to use request instead of JSONP+Y.YQLRequest.prototype._send = function (url, o) {+ request(url, {+ method: 'GET',+ timeout: o.timeout || (30 * 1000)+ }, function(err, res) {+ if (err) {+ //The signature that YQL requires+ o.on.success({+ error: err+ });+ } else {+ o.on.success(JSON.parse(res.body));+ }+ });+};+++}, '3.7.3');
+ bundle/yql-nodejs/yql-nodejs-min.js view
@@ -0,0 +1,7 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add("yql-nodejs",function(e,t){var n=require("request");e.YQLRequest.prototype._send=function(e,t){n(e,{method:"GET",timeout:t.timeout||3e4},function(e,n){e?t.on.success({error:e}):t.on.success(JSON.parse(n.body))})}},"3.7.3");
+ bundle/yql-nodejs/yql-nodejs.js view
@@ -0,0 +1,36 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('yql-nodejs', function (Y, NAME) {++/**+* NodeJS plugin for YQL to use native request to make requests instead of JSONP.+* Not required by the user, it's conditionally loaded and should "just work".+* @module yql+* @submodule yql-nodejs+*/++var request = require('request');++//Over writes Y.YQLRequest._send to use request instead of JSONP+Y.YQLRequest.prototype._send = function (url, o) {+ request(url, {+ method: 'GET',+ timeout: o.timeout || (30 * 1000)+ }, function(err, res) {+ if (err) {+ //The signature that YQL requires+ o.on.success({+ error: err+ });+ } else {+ o.on.success(JSON.parse(res.body));+ }+ });+};+++}, '3.7.3');
+ bundle/yql-winjs/yql-winjs-coverage.js view
@@ -0,0 +1,89 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+if (typeof _yuitest_coverage == "undefined"){+ _yuitest_coverage = {};+ _yuitest_coverline = function(src, line){+ var coverage = _yuitest_coverage[src];+ if (!coverage.lines[line]){+ coverage.calledLines++;+ }+ coverage.lines[line]++;+ };+ _yuitest_coverfunc = function(src, name, line){+ var coverage = _yuitest_coverage[src],+ funcId = name + ":" + line;+ if (!coverage.functions[funcId]){+ coverage.calledFunctions++;+ }+ coverage.functions[funcId]++;+ };+}+_yuitest_coverage["build/yql-winjs/yql-winjs.js"] = {+ lines: {},+ functions: {},+ coveredLines: 0,+ calledLines: 0,+ coveredFunctions: 0,+ calledFunctions: 0,+ path: "build/yql-winjs/yql-winjs.js",+ code: []+};+_yuitest_coverage["build/yql-winjs/yql-winjs.js"].code=["YUI.add('yql-winjs', function (Y, NAME) {","","/**","* WinJS plugin for YQL to use native XHR to make requests instead of JSONP.","* Not required by the user, it's conditionally loaded and should \"just work\".","* @module yql","* @submodule yql-winjs","*/","","//Over writes Y.YQLRequest._send to use IO instead of JSONP","Y.YQLRequest.prototype._send = function (url, o) {"," var req = new XMLHttpRequest(),"," timer;",""," req.open('GET', url, true);"," req.onreadystatechange = function () {"," if (req.readyState === 4) { //Complete"," //No status code check here, since the YQL service will return JSON"," clearTimeout(timer);"," //No need to \"call\" this, YQL handles the context"," o.on.success(JSON.parse(req.responseText));"," }"," };"," req.send();",""," //Simple timer to catch no connections"," timer = setTimeout(function() {"," req.abort();"," o.on.timeout('script timeout');"," }, o.timeout || 30000);","};","","","}, '3.7.3');"];+_yuitest_coverage["build/yql-winjs/yql-winjs.js"].lines = {"1":0,"11":0,"12":0,"15":0,"16":0,"17":0,"19":0,"21":0,"24":0,"27":0,"28":0,"29":0};+_yuitest_coverage["build/yql-winjs/yql-winjs.js"].functions = {"onreadystatechange:16":0,"(anonymous 2):27":0,"_send:11":0,"(anonymous 1):1":0};+_yuitest_coverage["build/yql-winjs/yql-winjs.js"].coveredLines = 12;+_yuitest_coverage["build/yql-winjs/yql-winjs.js"].coveredFunctions = 4;+_yuitest_coverline("build/yql-winjs/yql-winjs.js", 1);+YUI.add('yql-winjs', function (Y, NAME) {++/**+* WinJS plugin for YQL to use native XHR to make requests instead of JSONP.+* Not required by the user, it's conditionally loaded and should "just work".+* @module yql+* @submodule yql-winjs+*/++//Over writes Y.YQLRequest._send to use IO instead of JSONP+_yuitest_coverfunc("build/yql-winjs/yql-winjs.js", "(anonymous 1)", 1);+_yuitest_coverline("build/yql-winjs/yql-winjs.js", 11);+Y.YQLRequest.prototype._send = function (url, o) {+ _yuitest_coverfunc("build/yql-winjs/yql-winjs.js", "_send", 11);+_yuitest_coverline("build/yql-winjs/yql-winjs.js", 12);+var req = new XMLHttpRequest(),+ timer;++ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 15);+req.open('GET', url, true);+ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 16);+req.onreadystatechange = function () {+ _yuitest_coverfunc("build/yql-winjs/yql-winjs.js", "onreadystatechange", 16);+_yuitest_coverline("build/yql-winjs/yql-winjs.js", 17);+if (req.readyState === 4) { //Complete+ //No status code check here, since the YQL service will return JSON+ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 19);+clearTimeout(timer);+ //No need to "call" this, YQL handles the context+ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 21);+o.on.success(JSON.parse(req.responseText));+ }+ };+ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 24);+req.send();++ //Simple timer to catch no connections+ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 27);+timer = setTimeout(function() {+ _yuitest_coverfunc("build/yql-winjs/yql-winjs.js", "(anonymous 2)", 27);+_yuitest_coverline("build/yql-winjs/yql-winjs.js", 28);+req.abort();+ _yuitest_coverline("build/yql-winjs/yql-winjs.js", 29);+o.on.timeout('script timeout');+ }, o.timeout || 30000);+};+++}, '3.7.3');
+ bundle/yql-winjs/yql-winjs-debug.js view
@@ -0,0 +1,40 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('yql-winjs', function (Y, NAME) {++/**+* WinJS plugin for YQL to use native XHR to make requests instead of JSONP.+* Not required by the user, it's conditionally loaded and should "just work".+* @module yql+* @submodule yql-winjs+*/++//Over writes Y.YQLRequest._send to use IO instead of JSONP+Y.YQLRequest.prototype._send = function (url, o) {+ var req = new XMLHttpRequest(),+ timer;++ req.open('GET', url, true);+ req.onreadystatechange = function () {+ if (req.readyState === 4) { //Complete+ //No status code check here, since the YQL service will return JSON+ clearTimeout(timer);+ //No need to "call" this, YQL handles the context+ o.on.success(JSON.parse(req.responseText));+ }+ };+ req.send();++ //Simple timer to catch no connections+ timer = setTimeout(function() {+ req.abort();+ o.on.timeout('script timeout');+ }, o.timeout || 30000);+};+++}, '3.7.3');
+ bundle/yql-winjs/yql-winjs-min.js view
@@ -0,0 +1,7 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add("yql-winjs",function(e,t){e.YQLRequest.prototype._send=function(e,t){var n=new XMLHttpRequest,r;n.open("GET",e,!0),n.onreadystatechange=function(){n.readyState===4&&(clearTimeout(r),t.on.success(JSON.parse(n.responseText)))},n.send(),r=setTimeout(function(){n.abort(),t.on.timeout("script timeout")},t.timeout||3e4)}},"3.7.3");
+ bundle/yql-winjs/yql-winjs.js view
@@ -0,0 +1,40 @@+/*+YUI 3.7.3 (build 5687)+Copyright 2012 Yahoo! Inc. All rights reserved.+Licensed under the BSD License.+http://yuilibrary.com/license/+*/+YUI.add('yql-winjs', function (Y, NAME) {++/**+* WinJS plugin for YQL to use native XHR to make requests instead of JSONP.+* Not required by the user, it's conditionally loaded and should "just work".+* @module yql+* @submodule yql-winjs+*/++//Over writes Y.YQLRequest._send to use IO instead of JSONP+Y.YQLRequest.prototype._send = function (url, o) {+ var req = new XMLHttpRequest(),+ timer;++ req.open('GET', url, true);+ req.onreadystatechange = function () {+ if (req.readyState === 4) { //Complete+ //No status code check here, since the YQL service will return JSON+ clearTimeout(timer);+ //No need to "call" this, YQL handles the context+ o.on.success(JSON.parse(req.responseText));+ }+ };+ req.send();++ //Simple timer to catch no connections+ timer = setTimeout(function() {+ req.abort();+ o.on.timeout('script timeout');+ }, o.timeout || 30000);+};+++}, '3.7.3');
bundle/yql/yql-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,11 +32,11 @@ path: "build/yql/yql.js", code: [] };-_yuitest_coverage["build/yql/yql.js"].code=["YUI.add('yql', function (Y, NAME) {","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @module yql"," */","/**"," * Utility Class used under the hood my the YQL class"," * @class YQLRequest"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function/Object} callback The callback to execute after the query (Falls through to JSONP)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","var YQLRequest = function (sql, callback, params, opts) {",""," if (!params) {"," params = {};"," }"," params.q = sql;"," //Allow format override.. JSON-P-X"," if (!params.format) {"," params.format = Y.YQLRequest.FORMAT;"," }"," if (!params.env) {"," params.env = Y.YQLRequest.ENV;"," }",""," this._context = this;",""," if (opts && opts.context) {"," this._context = opts.context;"," delete opts.context;"," }",""," if (params && params.context) {"," this._context = params.context;"," delete params.context;"," }",""," this._params = params;"," this._opts = opts;"," this._callback = callback;","","};","","YQLRequest.prototype = {"," /**"," * @private"," * @property _jsonp"," * @description Reference to the JSONP instance used to make the queries"," */"," _jsonp: null,"," /**"," * @private"," * @property _opts"," * @description Holder for the opts argument"," */"," _opts: null,"," /**"," * @private"," * @property _callback"," * @description Holder for the callback argument"," */"," _callback: null,"," /**"," * @private"," * @property _params"," * @description Holder for the params argument"," */"," _params: null,"," /**"," * @private"," * @property _context"," * @description The context to execute the callback in"," */"," _context: null,"," /**"," * @private"," * @method _internal"," * @description Internal Callback Handler"," */"," _internal: function () {"," this._callback.apply(this._context, arguments);"," },"," /**"," * @method send"," * @description The method that executes the YQL Request."," * @chainable"," * @return {YQLRequest}"," */"," send: function () {"," var qs = [], url = ((this._opts && this._opts.proto) ? this._opts.proto : Y.YQLRequest.PROTO), o;",""," Y.each(this._params, function (v, k) {"," qs.push(k + '=' + encodeURIComponent(v));"," });",""," qs = qs.join('&');",""," url += ((this._opts && this._opts.base) ? this._opts.base : Y.YQLRequest.BASE_URL) + qs;",""," o = (!Y.Lang.isFunction(this._callback)) ? this._callback : { on: { success: this._callback } };",""," o.on = o.on || {};"," this._callback = o.on.success;",""," o.on.success = Y.bind(this._internal, this);",""," if (o.allowCache !== false) {"," o.allowCache = true;"," }",""," if (!this._jsonp) {"," this._jsonp = Y.jsonp(url, o);"," } else {"," this._jsonp.url = url;"," if (o.on && o.on.success) {"," this._jsonp._config.on.success = o.on.success;"," }"," this._jsonp.send();"," }"," return this;"," }","};","","/**","* @static","* @property FORMAT","* @description Default format to use: json","*/","YQLRequest.FORMAT = 'json';","/**","* @static","* @property PROTO","* @description Default protocol to use: http","*/","YQLRequest.PROTO = 'http';","/**","* @static","* @property BASE_URL","* @description The base URL to query: query.yahooapis.com/v1/public/yql?","*/","YQLRequest.BASE_URL = ':/' + '/query.yahooapis.com/v1/public/yql?';","/**","* @static","* @property ENV","* @description The environment file to load: http://datatables.org/alltables.env","*/","YQLRequest.ENV = 'http:/' + '/datatables.org/alltables.env';","","Y.YQLRequest = YQLRequest;","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @class YQL"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function} callback The callback to execute after the query (optional)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","Y.YQL = function (sql, callback, params, opts) {"," return new Y.YQLRequest(sql, callback, params, opts).send();","};","","","}, '3.7.2', {\"requires\": [\"jsonp\", \"jsonp-url\"]});"];-_yuitest_coverage["build/yql/yql.js"].lines = {"1":0,"16":0,"18":0,"19":0,"21":0,"23":0,"24":0,"26":0,"27":0,"30":0,"32":0,"33":0,"34":0,"37":0,"38":0,"39":0,"42":0,"43":0,"44":0,"48":0,"85":0,"94":0,"96":0,"97":0,"100":0,"102":0,"104":0,"106":0,"107":0,"109":0,"111":0,"112":0,"115":0,"116":0,"118":0,"119":0,"120":0,"122":0,"124":0,"133":0,"139":0,"145":0,"151":0,"153":0,"164":0,"165":0};-_yuitest_coverage["build/yql/yql.js"].functions = {"YQLRequest:16":0,"_internal:84":0,"(anonymous 2):96":0,"send:93":0,"YQL:164":0,"(anonymous 1):1":0};-_yuitest_coverage["build/yql/yql.js"].coveredLines = 46;-_yuitest_coverage["build/yql/yql.js"].coveredFunctions = 6;+_yuitest_coverage["build/yql/yql.js"].code=["YUI.add('yql', function (Y, NAME) {","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @module yql"," */","/**"," * Utility Class used under the hood my the YQL class"," * @class YQLRequest"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function/Object} callback The callback to execute after the query (Falls through to JSONP)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","var YQLRequest = function (sql, callback, params, opts) {",""," if (!params) {"," params = {};"," }"," params.q = sql;"," //Allow format override.. JSON-P-X"," if (!params.format) {"," params.format = Y.YQLRequest.FORMAT;"," }"," if (!params.env) {"," params.env = Y.YQLRequest.ENV;"," }",""," this._context = this;",""," if (opts && opts.context) {"," this._context = opts.context;"," delete opts.context;"," }",""," if (params && params.context) {"," this._context = params.context;"," delete params.context;"," }",""," this._params = params;"," this._opts = opts;"," this._callback = callback;","","};","","YQLRequest.prototype = {"," /**"," * @private"," * @property _jsonp"," * @description Reference to the JSONP instance used to make the queries"," */"," _jsonp: null,"," /**"," * @private"," * @property _opts"," * @description Holder for the opts argument"," */"," _opts: null,"," /**"," * @private"," * @property _callback"," * @description Holder for the callback argument"," */"," _callback: null,"," /**"," * @private"," * @property _params"," * @description Holder for the params argument"," */"," _params: null,"," /**"," * @private"," * @property _context"," * @description The context to execute the callback in"," */"," _context: null,"," /**"," * @private"," * @method _internal"," * @description Internal Callback Handler"," */"," _internal: function () {"," this._callback.apply(this._context, arguments);"," },"," /**"," * @method send"," * @description The method that executes the YQL Request."," * @chainable"," * @return {YQLRequest}"," */"," send: function () {"," var qs = [], url = ((this._opts && this._opts.proto) ? this._opts.proto : Y.YQLRequest.PROTO), o;",""," Y.each(this._params, function (v, k) {"," qs.push(k + '=' + encodeURIComponent(v));"," });",""," qs = qs.join('&');",""," url += ((this._opts && this._opts.base) ? this._opts.base : Y.YQLRequest.BASE_URL) + qs;",""," o = (!Y.Lang.isFunction(this._callback)) ? this._callback : { on: { success: this._callback } };",""," o.on = o.on || {};"," this._callback = o.on.success;",""," o.on.success = Y.bind(this._internal, this);",""," this._send(url, o);"," return this;"," },"," /**"," * Private method to send the request, overwritten in plugins"," * @method _send"," * @private"," * @param {String} url The URL to request"," * @param {Object} o The config object"," */"," _send: function(url, o) {"," if (o.allowCache !== false) {"," o.allowCache = true;"," }"," if (!this._jsonp) {"," this._jsonp = Y.jsonp(url, o);"," } else {"," this._jsonp.url = url;"," if (o.on && o.on.success) {"," this._jsonp._config.on.success = o.on.success;"," }"," this._jsonp.send();"," }"," }","};","","/**","* @static","* @property FORMAT","* @description Default format to use: json","*/","YQLRequest.FORMAT = 'json';","/**","* @static","* @property PROTO","* @description Default protocol to use: http","*/","YQLRequest.PROTO = 'http';","/**","* @static","* @property BASE_URL","* @description The base URL to query: query.yahooapis.com/v1/public/yql?","*/","YQLRequest.BASE_URL = ':/' + '/query.yahooapis.com/v1/public/yql?';","/**","* @static","* @property ENV","* @description The environment file to load: http://datatables.org/alltables.env","*/","YQLRequest.ENV = 'http:/' + '/datatables.org/alltables.env';","","Y.YQLRequest = YQLRequest;","","/**"," * This class adds a sugar class to allow access to YQL (http://developer.yahoo.com/yql/)."," * @class YQL"," * @constructor"," * @param {String} sql The SQL statement to execute"," * @param {Function} callback The callback to execute after the query (optional)."," * @param {Object} params An object literal of extra parameters to pass along (optional)."," * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url)"," */","Y.YQL = function (sql, callback, params, opts) {"," return new Y.YQLRequest(sql, callback, params, opts).send();","};","","","}, '3.7.3', {\"requires\": [\"jsonp\", \"jsonp-url\"]});"];+_yuitest_coverage["build/yql/yql.js"].lines = {"1":0,"16":0,"18":0,"19":0,"21":0,"23":0,"24":0,"26":0,"27":0,"30":0,"32":0,"33":0,"34":0,"37":0,"38":0,"39":0,"42":0,"43":0,"44":0,"48":0,"85":0,"94":0,"96":0,"97":0,"100":0,"102":0,"104":0,"106":0,"107":0,"109":0,"111":0,"112":0,"122":0,"123":0,"125":0,"126":0,"128":0,"129":0,"130":0,"132":0,"142":0,"148":0,"154":0,"160":0,"162":0,"173":0,"174":0};+_yuitest_coverage["build/yql/yql.js"].functions = {"YQLRequest:16":0,"_internal:84":0,"(anonymous 2):96":0,"send:93":0,"_send:121":0,"YQL:173":0,"(anonymous 1):1":0};+_yuitest_coverage["build/yql/yql.js"].coveredLines = 47;+_yuitest_coverage["build/yql/yql.js"].coveredFunctions = 7; _yuitest_coverline("build/yql/yql.js", 1); YUI.add('yql', function (Y, NAME) { @@ -183,28 +183,39 @@ o.on.success = Y.bind(this._internal, this); _yuitest_coverline("build/yql/yql.js", 111);+this._send(url, o);+ _yuitest_coverline("build/yql/yql.js", 112);+return this;+ },+ /**+ * Private method to send the request, overwritten in plugins+ * @method _send+ * @private+ * @param {String} url The URL to request+ * @param {Object} o The config object+ */+ _send: function(url, o) {+ _yuitest_coverfunc("build/yql/yql.js", "_send", 121);+_yuitest_coverline("build/yql/yql.js", 122); if (o.allowCache !== false) {- _yuitest_coverline("build/yql/yql.js", 112);+ _yuitest_coverline("build/yql/yql.js", 123); o.allowCache = true; }-- _yuitest_coverline("build/yql/yql.js", 115);+ _yuitest_coverline("build/yql/yql.js", 125); if (!this._jsonp) {- _yuitest_coverline("build/yql/yql.js", 116);+ _yuitest_coverline("build/yql/yql.js", 126); this._jsonp = Y.jsonp(url, o); } else {- _yuitest_coverline("build/yql/yql.js", 118);+ _yuitest_coverline("build/yql/yql.js", 128); this._jsonp.url = url;- _yuitest_coverline("build/yql/yql.js", 119);+ _yuitest_coverline("build/yql/yql.js", 129); if (o.on && o.on.success) {- _yuitest_coverline("build/yql/yql.js", 120);+ _yuitest_coverline("build/yql/yql.js", 130); this._jsonp._config.on.success = o.on.success; }- _yuitest_coverline("build/yql/yql.js", 122);+ _yuitest_coverline("build/yql/yql.js", 132); this._jsonp.send(); }- _yuitest_coverline("build/yql/yql.js", 124);-return this; } }; @@ -213,31 +224,31 @@ * @property FORMAT * @description Default format to use: json */-_yuitest_coverline("build/yql/yql.js", 133);+_yuitest_coverline("build/yql/yql.js", 142); YQLRequest.FORMAT = 'json'; /** * @static * @property PROTO * @description Default protocol to use: http */-_yuitest_coverline("build/yql/yql.js", 139);+_yuitest_coverline("build/yql/yql.js", 148); YQLRequest.PROTO = 'http'; /** * @static * @property BASE_URL * @description The base URL to query: query.yahooapis.com/v1/public/yql? */-_yuitest_coverline("build/yql/yql.js", 145);+_yuitest_coverline("build/yql/yql.js", 154); YQLRequest.BASE_URL = ':/' + '/query.yahooapis.com/v1/public/yql?'; /** * @static * @property ENV * @description The environment file to load: http://datatables.org/alltables.env */-_yuitest_coverline("build/yql/yql.js", 151);+_yuitest_coverline("build/yql/yql.js", 160); YQLRequest.ENV = 'http:/' + '/datatables.org/alltables.env'; -_yuitest_coverline("build/yql/yql.js", 153);+_yuitest_coverline("build/yql/yql.js", 162); Y.YQLRequest = YQLRequest; /**@@ -249,12 +260,12 @@ * @param {Object} params An object literal of extra parameters to pass along (optional). * @param {Object} opts An object literal of configuration options (optional): proto (http|https), base (url) */-_yuitest_coverline("build/yql/yql.js", 164);+_yuitest_coverline("build/yql/yql.js", 173); Y.YQL = function (sql, callback, params, opts) {- _yuitest_coverfunc("build/yql/yql.js", "YQL", 164);-_yuitest_coverline("build/yql/yql.js", 165);+ _yuitest_coverfunc("build/yql/yql.js", "YQL", 173);+_yuitest_coverline("build/yql/yql.js", 174); return new Y.YQLRequest(sql, callback, params, opts).send(); }; -}, '3.7.2', {"requires": ["jsonp", "jsonp-url"]});+}, '3.7.3', {"requires": ["jsonp", "jsonp-url"]});
bundle/yql/yql-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -114,11 +114,21 @@ o.on.success = Y.bind(this._internal, this); + Y.log('URL: ' + url, 'info', 'yql');+ this._send(url, o);+ return this;+ },+ /**+ * Private method to send the request, overwritten in plugins+ * @method _send+ * @private+ * @param {String} url The URL to request+ * @param {Object} o The config object+ */+ _send: function(url, o) { if (o.allowCache !== false) { o.allowCache = true; }- Y.log('URL: ' + url, 'info', 'yql');- if (!this._jsonp) { this._jsonp = Y.jsonp(url, o); } else {@@ -128,7 +138,6 @@ } this._jsonp.send(); }- return this; } }; @@ -173,4 +182,4 @@ }; -}, '3.7.2', {"requires": ["jsonp", "jsonp-url"]});+}, '3.7.3', {"requires": ["jsonp", "jsonp-url"]});
bundle/yql/yql-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("yql",function(e,t){var n=function(t,n,r,i){r||(r={}),r.q=t,r.format||(r.format=e.YQLRequest.FORMAT),r.env||(r.env=e.YQLRequest.ENV),this._context=this,i&&i.context&&(this._context=i.context,delete i.context),r&&r.context&&(this._context=r.context,delete r.context),this._params=r,this._opts=i,this._callback=n};n.prototype={_jsonp:null,_opts:null,_callback:null,_params:null,_context:null,_internal:function(){this._callback.apply(this._context,arguments)},send:function(){var t=[],n=this._opts&&this._opts.proto?this._opts.proto:e.YQLRequest.PROTO,r;return e.each(this._params,function(e,n){t.push(n+"="+encodeURIComponent(e))}),t=t.join("&"),n+=(this._opts&&this._opts.base?this._opts.base:e.YQLRequest.BASE_URL)+t,r=e.Lang.isFunction(this._callback)?{on:{success:this._callback}}:this._callback,r.on=r.on||{},this._callback=r.on.success,r.on.success=e.bind(this._internal,this),r.allowCache!==!1&&(r.allowCache=!0),this._jsonp?(this._jsonp.url=n,r.on&&r.on.success&&(this._jsonp._config.on.success=r.on.success),this._jsonp.send()):this._jsonp=e.jsonp(n,r),this}},n.FORMAT="json",n.PROTO="http",n.BASE_URL="://query.yahooapis.com/v1/public/yql?",n.ENV="http://datatables.org/alltables.env",e.YQLRequest=n,e.YQL=function(t,n,r,i){return(new e.YQLRequest(t,n,r,i)).send()}},"3.7.2",{requires:["jsonp","jsonp-url"]});+YUI.add("yql",function(e,t){var n=function(t,n,r,i){r||(r={}),r.q=t,r.format||(r.format=e.YQLRequest.FORMAT),r.env||(r.env=e.YQLRequest.ENV),this._context=this,i&&i.context&&(this._context=i.context,delete i.context),r&&r.context&&(this._context=r.context,delete r.context),this._params=r,this._opts=i,this._callback=n};n.prototype={_jsonp:null,_opts:null,_callback:null,_params:null,_context:null,_internal:function(){this._callback.apply(this._context,arguments)},send:function(){var t=[],n=this._opts&&this._opts.proto?this._opts.proto:e.YQLRequest.PROTO,r;return e.each(this._params,function(e,n){t.push(n+"="+encodeURIComponent(e))}),t=t.join("&"),n+=(this._opts&&this._opts.base?this._opts.base:e.YQLRequest.BASE_URL)+t,r=e.Lang.isFunction(this._callback)?{on:{success:this._callback}}:this._callback,r.on=r.on||{},this._callback=r.on.success,r.on.success=e.bind(this._internal,this),this._send(n,r),this},_send:function(t,n){n.allowCache!==!1&&(n.allowCache=!0),this._jsonp?(this._jsonp.url=t,n.on&&n.on.success&&(this._jsonp._config.on.success=n.on.success),this._jsonp.send()):this._jsonp=e.jsonp(t,n)}},n.FORMAT="json",n.PROTO="http",n.BASE_URL="://query.yahooapis.com/v1/public/yql?",n.ENV="http://datatables.org/alltables.env",e.YQLRequest=n,e.YQL=function(t,n,r,i){return(new e.YQLRequest(t,n,r,i)).send()}},"3.7.3",{requires:["jsonp","jsonp-url"]});
bundle/yql/yql.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -114,10 +114,20 @@ o.on.success = Y.bind(this._internal, this); + this._send(url, o);+ return this;+ },+ /**+ * Private method to send the request, overwritten in plugins+ * @method _send+ * @private+ * @param {String} url The URL to request+ * @param {Object} o The config object+ */+ _send: function(url, o) { if (o.allowCache !== false) { o.allowCache = true; }- if (!this._jsonp) { this._jsonp = Y.jsonp(url, o); } else {@@ -127,7 +137,6 @@ } this._jsonp.send(); }- return this; } }; @@ -172,4 +181,4 @@ }; -}, '3.7.2', {"requires": ["jsonp", "jsonp-url"]});+}, '3.7.3', {"requires": ["jsonp", "jsonp-url"]});
bundle/yui-base/yui-base-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-base/yui-base.js", code: [] };-_yuitest_coverage["build/yui-base/yui-base.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.2',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or alert (window),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ == 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;"," "," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process == 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-number\",\"datatype-date\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.2', {\"use\": [\"get\", \"features\", \"intl-base\", \"yui-log\", \"yui-later\"]});"];+_yuitest_coverage["build/yui-base/yui-base.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.3',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ === 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0,"," /*"," * Window8/IE10 Application host environment"," * @property winjs"," * @type Boolean"," * @static"," */"," winjs: !!((typeof Windows !== \"undefined\") && Windows.System),"," /**"," * Are touch/msPointer events available on this device"," * @property touchEnabled"," * @type Boolean"," * @static"," */"," touchEnabled: false"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;",""," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //Check for known properties to tell if touch events are enabled on this device or if"," //the number of MSPointer touchpoints on this device is greater than 0."," if (win && nav && !(o.chrome && o.chrome < 6)) {"," o.touchEnabled = ((\"ontouchstart\" in win) || ((\"msMaxTouchPoints\" in nav) && (nav.msMaxTouchPoints > 0)));"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process === 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"anim-shape-transform\": [\"anim-shape\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-date\",\"datatype-number\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\",\"datatype-date-math\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\",\"event-tap\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.3', {\"use\": [\"get\", \"features\", \"intl-base\", \"yui-log\", \"yui-later\"]});"]; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and@@ -42,9 +42,9 @@ * @submodule yui-base */ -_yuitest_coverage["build/yui-base/yui-base.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3556":0,"3559":0,"3561":0,"3563":0,"3564":0,"3565":0,"3566":0,"3567":0,"3568":0,"3569":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3578":0,"3579":0,"3581":0,"3582":0,"3584":0,"3585":0,"3588":0,"3589":0,"3590":0,"3591":0,"3593":0,"3594":0,"3595":0,"3596":0,"3601":0,"3602":0,"3604":0,"3605":0,"3606":0,"3608":0,"3609":0,"3610":0,"3612":0,"3613":0,"3614":0,"3617":0,"3618":0,"3620":0,"3622":0,"3623":0,"3624":0,"3625":0,"3626":0,"3629":0,"3630":0,"3631":0,"3633":0,"3634":0,"3635":0,"3639":0,"3640":0,"3641":0,"3642":0,"3644":0,"3645":0,"3646":0,"3648":0,"3649":0,"3654":0,"3655":0,"3656":0,"3657":0,"3658":0,"3659":0,"3662":0,"3663":0,"3664":0,"3669":0,"3671":0,"3672":0,"3673":0,"3674":0,"3676":0,"3677":0,"3678":0,"3681":0,"3682":0,"3683":0,"3684":0,"3685":0,"3688":0,"3690":0,"3691":0,"3694":0,"3695":0,"3696":0,"3698":0,"3699":0,"3700":0,"3701":0,"3702":0,"3703":0,"3712":0,"3714":0,"3716":0,"3718":0,"3719":0,"3723":0,"3727":0,"3731":0,"3753":0,"3754":0,"3756":0,"3757":0,"3760":0,"3761":0,"3763":0,"3764":0,"3765":0,"3767":0,"3768":0,"3770":0,"3771":0,"3774":0,"3775":0,"3779":0,"3781":0};-_yuitest_coverage["build/yui-base/yui-base.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3753":0,"(anonymous 8):1950":0};-_yuitest_coverage["build/yui-base/yui-base.js"].coveredLines = 822;+_yuitest_coverage["build/yui-base/yui-base.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3563":0,"3566":0,"3568":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3575":0,"3576":0,"3577":0,"3578":0,"3579":0,"3580":0,"3581":0,"3585":0,"3586":0,"3588":0,"3589":0,"3591":0,"3592":0,"3595":0,"3596":0,"3597":0,"3598":0,"3600":0,"3601":0,"3602":0,"3603":0,"3608":0,"3609":0,"3611":0,"3612":0,"3613":0,"3615":0,"3616":0,"3617":0,"3619":0,"3620":0,"3621":0,"3624":0,"3625":0,"3627":0,"3629":0,"3630":0,"3631":0,"3632":0,"3633":0,"3636":0,"3637":0,"3638":0,"3640":0,"3641":0,"3642":0,"3646":0,"3647":0,"3648":0,"3649":0,"3651":0,"3652":0,"3653":0,"3655":0,"3656":0,"3661":0,"3662":0,"3663":0,"3664":0,"3665":0,"3666":0,"3669":0,"3670":0,"3671":0,"3676":0,"3678":0,"3679":0,"3680":0,"3681":0,"3683":0,"3684":0,"3685":0,"3688":0,"3689":0,"3690":0,"3691":0,"3692":0,"3695":0,"3697":0,"3698":0,"3701":0,"3702":0,"3703":0,"3705":0,"3706":0,"3707":0,"3708":0,"3709":0,"3710":0,"3720":0,"3721":0,"3725":0,"3727":0,"3729":0,"3731":0,"3732":0,"3736":0,"3740":0,"3744":0,"3766":0,"3767":0,"3769":0,"3770":0,"3773":0,"3774":0,"3776":0,"3777":0,"3778":0,"3780":0,"3781":0,"3783":0,"3784":0,"3787":0,"3788":0,"3792":0,"3794":0};+_yuitest_coverage["build/yui-base/yui-base.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3766":0,"(anonymous 8):1950":0};+_yuitest_coverage["build/yui-base/yui-base.js"].coveredLines = 824; _yuitest_coverage["build/yui-base/yui-base.js"].coveredFunctions = 98; _yuitest_coverline("build/yui-base/yui-base.js", 10); if (typeof YUI != 'undefined') {@@ -217,7 +217,7 @@ _yuitest_coverfunc("build/yui-base/yui-base.js", "(anonymous 1)", 153); _yuitest_coverline("build/yui-base/yui-base.js", 155); var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -3221,11 +3221,11 @@ if (Lang.isObject(obj)) { _yuitest_coverline("build/yui-base/yui-base.js", 2556); try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug). _yuitest_coverline("build/yui-base/yui-base.js", 2560);-if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { _yuitest_coverline("build/yui-base/yui-base.js", 2561); result = 2; }@@ -4161,7 +4161,7 @@ return parseFloat(s.replace(/\./g, function() { _yuitest_coverfunc("build/yui-base/yui-base.js", "(anonymous 22)", 3328); _yuitest_coverline("build/yui-base/yui-base.js", 3329);-return (c++ == 1) ? '' : '.';+return (c++ === 1) ? '' : '.'; })); }, @@ -4276,13 +4276,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -4371,7 +4364,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -4388,250 +4395,250 @@ * @type String * @static */- _yuitest_coverline("build/yui-base/yui-base.js", 3556);+ _yuitest_coverline("build/yui-base/yui-base.js", 3563); o.userAgent = ua; - _yuitest_coverline("build/yui-base/yui-base.js", 3559);+ _yuitest_coverline("build/yui-base/yui-base.js", 3566); o.secure = href && (href.toLowerCase().indexOf('https') === 0); - _yuitest_coverline("build/yui-base/yui-base.js", 3561);+ _yuitest_coverline("build/yui-base/yui-base.js", 3568); if (ua) { - _yuitest_coverline("build/yui-base/yui-base.js", 3563);+ _yuitest_coverline("build/yui-base/yui-base.js", 3570); if ((/windows|win32/i).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3564);+ _yuitest_coverline("build/yui-base/yui-base.js", 3571); o.os = 'windows';- } else {_yuitest_coverline("build/yui-base/yui-base.js", 3565);+ } else {_yuitest_coverline("build/yui-base/yui-base.js", 3572); if ((/macintosh|mac_powerpc/i).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3566);+ _yuitest_coverline("build/yui-base/yui-base.js", 3573); o.os = 'macintosh';- } else {_yuitest_coverline("build/yui-base/yui-base.js", 3567);+ } else {_yuitest_coverline("build/yui-base/yui-base.js", 3574); if ((/android/i).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3568);+ _yuitest_coverline("build/yui-base/yui-base.js", 3575); o.os = 'android';- } else {_yuitest_coverline("build/yui-base/yui-base.js", 3569);+ } else {_yuitest_coverline("build/yui-base/yui-base.js", 3576); if ((/symbos/i).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3570);+ _yuitest_coverline("build/yui-base/yui-base.js", 3577); o.os = 'symbos';- } else {_yuitest_coverline("build/yui-base/yui-base.js", 3571);+ } else {_yuitest_coverline("build/yui-base/yui-base.js", 3578); if ((/linux/i).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3572);+ _yuitest_coverline("build/yui-base/yui-base.js", 3579); o.os = 'linux';- } else {_yuitest_coverline("build/yui-base/yui-base.js", 3573);+ } else {_yuitest_coverline("build/yui-base/yui-base.js", 3580); if ((/rhino/i).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3574);+ _yuitest_coverline("build/yui-base/yui-base.js", 3581); o.os = 'rhino'; }}}}}} // Modern KHTML browsers should qualify as Safari X-Grade- _yuitest_coverline("build/yui-base/yui-base.js", 3578);+ _yuitest_coverline("build/yui-base/yui-base.js", 3585); if ((/KHTML/).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3579);+ _yuitest_coverline("build/yui-base/yui-base.js", 3586); o.webkit = 1; }- _yuitest_coverline("build/yui-base/yui-base.js", 3581);+ _yuitest_coverline("build/yui-base/yui-base.js", 3588); if ((/IEMobile|XBLWP7/).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3582);+ _yuitest_coverline("build/yui-base/yui-base.js", 3589); o.mobile = 'windows'; }- _yuitest_coverline("build/yui-base/yui-base.js", 3584);+ _yuitest_coverline("build/yui-base/yui-base.js", 3591); if ((/Fennec/).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3585);+ _yuitest_coverline("build/yui-base/yui-base.js", 3592); o.mobile = 'gecko'; } // Modern WebKit browsers are at least X-Grade- _yuitest_coverline("build/yui-base/yui-base.js", 3588);+ _yuitest_coverline("build/yui-base/yui-base.js", 3595); m = ua.match(/AppleWebKit\/([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3589);+ _yuitest_coverline("build/yui-base/yui-base.js", 3596); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3590);+ _yuitest_coverline("build/yui-base/yui-base.js", 3597); o.webkit = numberify(m[1]);- _yuitest_coverline("build/yui-base/yui-base.js", 3591);+ _yuitest_coverline("build/yui-base/yui-base.js", 3598); o.safari = o.webkit;- - _yuitest_coverline("build/yui-base/yui-base.js", 3593);++ _yuitest_coverline("build/yui-base/yui-base.js", 3600); if (/PhantomJS/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3594);+ _yuitest_coverline("build/yui-base/yui-base.js", 3601); m = ua.match(/PhantomJS\/([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3595);+ _yuitest_coverline("build/yui-base/yui-base.js", 3602); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3596);+ _yuitest_coverline("build/yui-base/yui-base.js", 3603); o.phantomjs = numberify(m[1]); } } // Mobile browser check- _yuitest_coverline("build/yui-base/yui-base.js", 3601);+ _yuitest_coverline("build/yui-base/yui-base.js", 3608); if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3602);+ _yuitest_coverline("build/yui-base/yui-base.js", 3609); o.mobile = 'Apple'; // iPhone or iPod Touch - _yuitest_coverline("build/yui-base/yui-base.js", 3604);+ _yuitest_coverline("build/yui-base/yui-base.js", 3611); m = ua.match(/OS ([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3605);+ _yuitest_coverline("build/yui-base/yui-base.js", 3612); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3606);+ _yuitest_coverline("build/yui-base/yui-base.js", 3613); m = numberify(m[1].replace('_', '.')); }- _yuitest_coverline("build/yui-base/yui-base.js", 3608);+ _yuitest_coverline("build/yui-base/yui-base.js", 3615); o.ios = m;- _yuitest_coverline("build/yui-base/yui-base.js", 3609);+ _yuitest_coverline("build/yui-base/yui-base.js", 3616); o.os = 'ios';- _yuitest_coverline("build/yui-base/yui-base.js", 3610);+ _yuitest_coverline("build/yui-base/yui-base.js", 3617); o.ipad = o.ipod = o.iphone = 0; - _yuitest_coverline("build/yui-base/yui-base.js", 3612);+ _yuitest_coverline("build/yui-base/yui-base.js", 3619); m = ua.match(/iPad|iPod|iPhone/);- _yuitest_coverline("build/yui-base/yui-base.js", 3613);+ _yuitest_coverline("build/yui-base/yui-base.js", 3620); if (m && m[0]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3614);+ _yuitest_coverline("build/yui-base/yui-base.js", 3621); o[m[0].toLowerCase()] = o.ios; } } else {- _yuitest_coverline("build/yui-base/yui-base.js", 3617);+ _yuitest_coverline("build/yui-base/yui-base.js", 3624); m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);- _yuitest_coverline("build/yui-base/yui-base.js", 3618);+ _yuitest_coverline("build/yui-base/yui-base.js", 3625); if (m) { // Nokia N-series, webOS, ex: NokiaN95- _yuitest_coverline("build/yui-base/yui-base.js", 3620);+ _yuitest_coverline("build/yui-base/yui-base.js", 3627); o.mobile = m[0]; }- _yuitest_coverline("build/yui-base/yui-base.js", 3622);+ _yuitest_coverline("build/yui-base/yui-base.js", 3629); if (/webOS/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3623);+ _yuitest_coverline("build/yui-base/yui-base.js", 3630); o.mobile = 'WebOS';- _yuitest_coverline("build/yui-base/yui-base.js", 3624);+ _yuitest_coverline("build/yui-base/yui-base.js", 3631); m = ua.match(/webOS\/([^\s]*);/);- _yuitest_coverline("build/yui-base/yui-base.js", 3625);+ _yuitest_coverline("build/yui-base/yui-base.js", 3632); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3626);+ _yuitest_coverline("build/yui-base/yui-base.js", 3633); o.webos = numberify(m[1]); } }- _yuitest_coverline("build/yui-base/yui-base.js", 3629);+ _yuitest_coverline("build/yui-base/yui-base.js", 3636); if (/ Android/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3630);+ _yuitest_coverline("build/yui-base/yui-base.js", 3637); if (/Mobile/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3631);+ _yuitest_coverline("build/yui-base/yui-base.js", 3638); o.mobile = 'Android'; }- _yuitest_coverline("build/yui-base/yui-base.js", 3633);+ _yuitest_coverline("build/yui-base/yui-base.js", 3640); m = ua.match(/Android ([^\s]*);/);- _yuitest_coverline("build/yui-base/yui-base.js", 3634);+ _yuitest_coverline("build/yui-base/yui-base.js", 3641); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3635);+ _yuitest_coverline("build/yui-base/yui-base.js", 3642); o.android = numberify(m[1]); } }- _yuitest_coverline("build/yui-base/yui-base.js", 3639);+ _yuitest_coverline("build/yui-base/yui-base.js", 3646); if (/Silk/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3640);+ _yuitest_coverline("build/yui-base/yui-base.js", 3647); m = ua.match(/Silk\/([^\s]*)\)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3641);+ _yuitest_coverline("build/yui-base/yui-base.js", 3648); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3642);+ _yuitest_coverline("build/yui-base/yui-base.js", 3649); o.silk = numberify(m[1]); }- _yuitest_coverline("build/yui-base/yui-base.js", 3644);+ _yuitest_coverline("build/yui-base/yui-base.js", 3651); if (!o.android) {- _yuitest_coverline("build/yui-base/yui-base.js", 3645);+ _yuitest_coverline("build/yui-base/yui-base.js", 3652); o.android = 2.34; //Hack for desktop mode in Kindle- _yuitest_coverline("build/yui-base/yui-base.js", 3646);+ _yuitest_coverline("build/yui-base/yui-base.js", 3653); o.os = 'Android'; }- _yuitest_coverline("build/yui-base/yui-base.js", 3648);+ _yuitest_coverline("build/yui-base/yui-base.js", 3655); if (/Accelerated=true/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3649);+ _yuitest_coverline("build/yui-base/yui-base.js", 3656); o.accel = true; } } } - _yuitest_coverline("build/yui-base/yui-base.js", 3654);+ _yuitest_coverline("build/yui-base/yui-base.js", 3661); m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3655);+ _yuitest_coverline("build/yui-base/yui-base.js", 3662); if (m && m[1] && m[2]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3656);+ _yuitest_coverline("build/yui-base/yui-base.js", 3663); o.chrome = numberify(m[2]); // Chrome- _yuitest_coverline("build/yui-base/yui-base.js", 3657);+ _yuitest_coverline("build/yui-base/yui-base.js", 3664); o.safari = 0; //Reset safari back to 0- _yuitest_coverline("build/yui-base/yui-base.js", 3658);+ _yuitest_coverline("build/yui-base/yui-base.js", 3665); if (m[1] === 'CrMo') {- _yuitest_coverline("build/yui-base/yui-base.js", 3659);+ _yuitest_coverline("build/yui-base/yui-base.js", 3666); o.mobile = 'chrome'; } } else {- _yuitest_coverline("build/yui-base/yui-base.js", 3662);+ _yuitest_coverline("build/yui-base/yui-base.js", 3669); m = ua.match(/AdobeAIR\/([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3663);+ _yuitest_coverline("build/yui-base/yui-base.js", 3670); if (m) {- _yuitest_coverline("build/yui-base/yui-base.js", 3664);+ _yuitest_coverline("build/yui-base/yui-base.js", 3671); o.air = m[0]; // Adobe AIR 1.0 or better } } } - _yuitest_coverline("build/yui-base/yui-base.js", 3669);+ _yuitest_coverline("build/yui-base/yui-base.js", 3676); if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)- _yuitest_coverline("build/yui-base/yui-base.js", 3671);+ _yuitest_coverline("build/yui-base/yui-base.js", 3678); if (/Opera/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3672);+ _yuitest_coverline("build/yui-base/yui-base.js", 3679); m = ua.match(/Opera[\s\/]([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3673);+ _yuitest_coverline("build/yui-base/yui-base.js", 3680); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3674);+ _yuitest_coverline("build/yui-base/yui-base.js", 3681); o.opera = numberify(m[1]); }- _yuitest_coverline("build/yui-base/yui-base.js", 3676);+ _yuitest_coverline("build/yui-base/yui-base.js", 3683); m = ua.match(/Version\/([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3677);+ _yuitest_coverline("build/yui-base/yui-base.js", 3684); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3678);+ _yuitest_coverline("build/yui-base/yui-base.js", 3685); o.opera = numberify(m[1]); // opera 10+ } - _yuitest_coverline("build/yui-base/yui-base.js", 3681);+ _yuitest_coverline("build/yui-base/yui-base.js", 3688); if (/Opera Mobi/.test(ua)) {- _yuitest_coverline("build/yui-base/yui-base.js", 3682);+ _yuitest_coverline("build/yui-base/yui-base.js", 3689); o.mobile = 'opera';- _yuitest_coverline("build/yui-base/yui-base.js", 3683);+ _yuitest_coverline("build/yui-base/yui-base.js", 3690); m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3684);+ _yuitest_coverline("build/yui-base/yui-base.js", 3691); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3685);+ _yuitest_coverline("build/yui-base/yui-base.js", 3692); o.opera = numberify(m[1]); } }- _yuitest_coverline("build/yui-base/yui-base.js", 3688);+ _yuitest_coverline("build/yui-base/yui-base.js", 3695); m = ua.match(/Opera Mini[^;]*/); - _yuitest_coverline("build/yui-base/yui-base.js", 3690);+ _yuitest_coverline("build/yui-base/yui-base.js", 3697); if (m) {- _yuitest_coverline("build/yui-base/yui-base.js", 3691);+ _yuitest_coverline("build/yui-base/yui-base.js", 3698); o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit- _yuitest_coverline("build/yui-base/yui-base.js", 3694);+ _yuitest_coverline("build/yui-base/yui-base.js", 3701); m = ua.match(/MSIE\s([^;]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3695);+ _yuitest_coverline("build/yui-base/yui-base.js", 3702); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3696);+ _yuitest_coverline("build/yui-base/yui-base.js", 3703); o.ie = numberify(m[1]); } else { // not opera, webkit, or ie- _yuitest_coverline("build/yui-base/yui-base.js", 3698);+ _yuitest_coverline("build/yui-base/yui-base.js", 3705); m = ua.match(/Gecko\/([^\s]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3699);+ _yuitest_coverline("build/yui-base/yui-base.js", 3706); if (m) {- _yuitest_coverline("build/yui-base/yui-base.js", 3700);+ _yuitest_coverline("build/yui-base/yui-base.js", 3707); o.gecko = 1; // Gecko detected, look for revision- _yuitest_coverline("build/yui-base/yui-base.js", 3701);+ _yuitest_coverline("build/yui-base/yui-base.js", 3708); m = ua.match(/rv:([^\s\)]*)/);- _yuitest_coverline("build/yui-base/yui-base.js", 3702);+ _yuitest_coverline("build/yui-base/yui-base.js", 3709); if (m && m[1]) {- _yuitest_coverline("build/yui-base/yui-base.js", 3703);+ _yuitest_coverline("build/yui-base/yui-base.js", 3710); o.gecko = numberify(m[1]); } }@@ -4640,34 +4647,42 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ _yuitest_coverline("build/yui-base/yui-base.js", 3720);+if (win && nav && !(o.chrome && o.chrome < 6)) {+ _yuitest_coverline("build/yui-base/yui-base.js", 3721);+o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value.- _yuitest_coverline("build/yui-base/yui-base.js", 3712);+ _yuitest_coverline("build/yui-base/yui-base.js", 3725); if (!subUA) { - _yuitest_coverline("build/yui-base/yui-base.js", 3714);-if (typeof process == 'object') {+ _yuitest_coverline("build/yui-base/yui-base.js", 3727);+if (typeof process === 'object') { - _yuitest_coverline("build/yui-base/yui-base.js", 3716);+ _yuitest_coverline("build/yui-base/yui-base.js", 3729); if (process.versions && process.versions.node) { //NodeJS- _yuitest_coverline("build/yui-base/yui-base.js", 3718);+ _yuitest_coverline("build/yui-base/yui-base.js", 3731); o.os = process.platform;- _yuitest_coverline("build/yui-base/yui-base.js", 3719);+ _yuitest_coverline("build/yui-base/yui-base.js", 3732); o.nodejs = numberify(process.versions.node); } } - _yuitest_coverline("build/yui-base/yui-base.js", 3723);+ _yuitest_coverline("build/yui-base/yui-base.js", 3736); YUI.Env.UA = o; } - _yuitest_coverline("build/yui-base/yui-base.js", 3727);+ _yuitest_coverline("build/yui-base/yui-base.js", 3740); return o; }; -_yuitest_coverline("build/yui-base/yui-base.js", 3731);+_yuitest_coverline("build/yui-base/yui-base.js", 3744); Y.UA = YUI.Env.UA || YUI.Env.parseUA(); /**@@ -4690,54 +4705,55 @@ @return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is higher than _b_. **/-_yuitest_coverline("build/yui-base/yui-base.js", 3753);+_yuitest_coverline("build/yui-base/yui-base.js", 3766); Y.UA.compareVersions = function (a, b) {- _yuitest_coverfunc("build/yui-base/yui-base.js", "compareVersions", 3753);-_yuitest_coverline("build/yui-base/yui-base.js", 3754);+ _yuitest_coverfunc("build/yui-base/yui-base.js", "compareVersions", 3766);+_yuitest_coverline("build/yui-base/yui-base.js", 3767); var aPart, aParts, bPart, bParts, i, len; - _yuitest_coverline("build/yui-base/yui-base.js", 3756);+ _yuitest_coverline("build/yui-base/yui-base.js", 3769); if (a === b) {- _yuitest_coverline("build/yui-base/yui-base.js", 3757);+ _yuitest_coverline("build/yui-base/yui-base.js", 3770); return 0; } - _yuitest_coverline("build/yui-base/yui-base.js", 3760);+ _yuitest_coverline("build/yui-base/yui-base.js", 3773); aParts = (a + '').split('.');- _yuitest_coverline("build/yui-base/yui-base.js", 3761);+ _yuitest_coverline("build/yui-base/yui-base.js", 3774); bParts = (b + '').split('.'); - _yuitest_coverline("build/yui-base/yui-base.js", 3763);+ _yuitest_coverline("build/yui-base/yui-base.js", 3776); for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {- _yuitest_coverline("build/yui-base/yui-base.js", 3764);+ _yuitest_coverline("build/yui-base/yui-base.js", 3777); aPart = parseInt(aParts[i], 10);- _yuitest_coverline("build/yui-base/yui-base.js", 3765);+ _yuitest_coverline("build/yui-base/yui-base.js", 3778); bPart = parseInt(bParts[i], 10); - _yuitest_coverline("build/yui-base/yui-base.js", 3767);+ _yuitest_coverline("build/yui-base/yui-base.js", 3780); isNaN(aPart) && (aPart = 0);- _yuitest_coverline("build/yui-base/yui-base.js", 3768);+ _yuitest_coverline("build/yui-base/yui-base.js", 3781); isNaN(bPart) && (bPart = 0); - _yuitest_coverline("build/yui-base/yui-base.js", 3770);+ _yuitest_coverline("build/yui-base/yui-base.js", 3783); if (aPart < bPart) {- _yuitest_coverline("build/yui-base/yui-base.js", 3771);+ _yuitest_coverline("build/yui-base/yui-base.js", 3784); return -1; } - _yuitest_coverline("build/yui-base/yui-base.js", 3774);+ _yuitest_coverline("build/yui-base/yui-base.js", 3787); if (aPart > bPart) {- _yuitest_coverline("build/yui-base/yui-base.js", 3775);+ _yuitest_coverline("build/yui-base/yui-base.js", 3788); return 1; } } - _yuitest_coverline("build/yui-base/yui-base.js", 3779);+ _yuitest_coverline("build/yui-base/yui-base.js", 3792); return 0; };-_yuitest_coverline("build/yui-base/yui-base.js", 3781);+_yuitest_coverline("build/yui-base/yui-base.js", 3794); YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -4749,14 +4765,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -4776,4 +4792,4 @@ }; -}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
bundle/yui-base/yui-base-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2579,10 +2579,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3351,7 +3351,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3466,13 +3466,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3561,7 +3554,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3614,7 +3621,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3733,10 +3740,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3805,6 +3818,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3816,14 +3830,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3843,7 +3857,7 @@ }; -}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */@@ -4369,14 +4383,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -4393,7 +4411,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -4487,6 +4505,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -4503,6 +4523,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -4514,13 +4539,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -4586,7 +4605,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -4684,7 +4703,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -4734,8 +4753,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -4822,6 +4843,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -4912,7 +4937,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -4970,9 +4994,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -4980,8 +5017,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -4997,7 +5032,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -5105,13 +5140,14 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -5237,7 +5273,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -5266,10 +5302,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -5431,8 +5465,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5444,8 +5478,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -5533,7 +5581,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -5643,7 +5691,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /**@@ -5720,5 +5768,5 @@ -}, '3.7.2', {"requires": ["yui-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"requires": ["yui-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
bundle/yui-base/yui-base-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.2",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&!e.alert&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++==1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.2",{use:["get","features","intl-base","yui-log","yui-later"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!n.gecko||!!n.opera}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var i;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,this._env||this._getEnv(),i=this._getTransaction(t,n),this._queue.push({callback:r,transaction:i}),this._next(),i},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(function(){e.callback&&e.callback.apply(this,arguments),i._pending=null,i._next()}))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._waiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._waiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout));for(i=0,s=n.length;i<s;++i)u=t.requests[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r)},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(o.onerror=c,o.onload=h,!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this._waiting+=1,this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._waiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._waiting-=1,this._next()}}},"3.7.2",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"})},"3.7.2",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.2",{requires:["yui-base"]}),YUI.add("yui",function(e,t){},"3.7.2",{use:["get","features","intl-base","yui-log","yui-later"]});+typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.3",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&(!e.scrollTo||!e.document)&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++===1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0,winjs:typeof Windows!="undefined"&&!!Windows.System,touchEnabled:!1},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),r&&i&&!(s.chrome&&s.chrome<6)&&(s.touchEnabled="ontouchstart"in r||"msMaxTouchPoints"in i&&i.msMaxTouchPoints>0),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.3",{use:["get","features","intl-base","yui-log","yui-later"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.7.3",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","18",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","19",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.7.3",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.3",{requires:["yui-base"]}),YUI.add("yui",function(e,t){},"3.7.3",{use:["get","features","intl-base","yui-log","yui-later"]});
bundle/yui-base/yui-base.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2560,10 +2560,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3332,7 +3332,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3447,13 +3447,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3542,7 +3535,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3595,7 +3602,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3714,10 +3721,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3786,6 +3799,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3797,14 +3811,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3824,7 +3838,7 @@ }; -}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */@@ -4338,14 +4352,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -4362,7 +4380,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -4452,6 +4470,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -4468,6 +4488,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -4479,13 +4504,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -4551,7 +4570,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -4649,7 +4668,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -4699,8 +4718,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -4787,6 +4808,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -4877,7 +4902,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -4935,9 +4959,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -4945,8 +4982,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -4962,7 +4997,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -5069,13 +5104,14 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -5200,7 +5236,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -5229,10 +5265,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -5394,8 +5428,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5407,8 +5441,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -5496,7 +5544,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -5606,7 +5654,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /**@@ -5683,5 +5731,5 @@ -}, '3.7.2', {"requires": ["yui-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});+}, '3.7.3', {"requires": ["yui-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-later"]});
bundle/yui-core/yui-core-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-core/yui-core.js", code: [] };-_yuitest_coverage["build/yui-core/yui-core.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.2',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['intl-base'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or alert (window),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ == 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;"," "," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process == 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-number\",\"datatype-date\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.2');"];+_yuitest_coverage["build/yui-core/yui-core.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.3',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['intl-base'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ === 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0,"," /*"," * Window8/IE10 Application host environment"," * @property winjs"," * @type Boolean"," * @static"," */"," winjs: !!((typeof Windows !== \"undefined\") && Windows.System),"," /**"," * Are touch/msPointer events available on this device"," * @property touchEnabled"," * @type Boolean"," * @static"," */"," touchEnabled: false"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;",""," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //Check for known properties to tell if touch events are enabled on this device or if"," //the number of MSPointer touchpoints on this device is greater than 0."," if (win && nav && !(o.chrome && o.chrome < 6)) {"," o.touchEnabled = ((\"ontouchstart\" in win) || ((\"msMaxTouchPoints\" in nav) && (nav.msMaxTouchPoints > 0)));"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process === 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"anim-shape-transform\": [\"anim-shape\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-date\",\"datatype-number\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\",\"datatype-date-math\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\",\"event-tap\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.3');"]; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and@@ -42,9 +42,9 @@ * @submodule yui-base */ -_yuitest_coverage["build/yui-core/yui-core.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3556":0,"3559":0,"3561":0,"3563":0,"3564":0,"3565":0,"3566":0,"3567":0,"3568":0,"3569":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3578":0,"3579":0,"3581":0,"3582":0,"3584":0,"3585":0,"3588":0,"3589":0,"3590":0,"3591":0,"3593":0,"3594":0,"3595":0,"3596":0,"3601":0,"3602":0,"3604":0,"3605":0,"3606":0,"3608":0,"3609":0,"3610":0,"3612":0,"3613":0,"3614":0,"3617":0,"3618":0,"3620":0,"3622":0,"3623":0,"3624":0,"3625":0,"3626":0,"3629":0,"3630":0,"3631":0,"3633":0,"3634":0,"3635":0,"3639":0,"3640":0,"3641":0,"3642":0,"3644":0,"3645":0,"3646":0,"3648":0,"3649":0,"3654":0,"3655":0,"3656":0,"3657":0,"3658":0,"3659":0,"3662":0,"3663":0,"3664":0,"3669":0,"3671":0,"3672":0,"3673":0,"3674":0,"3676":0,"3677":0,"3678":0,"3681":0,"3682":0,"3683":0,"3684":0,"3685":0,"3688":0,"3690":0,"3691":0,"3694":0,"3695":0,"3696":0,"3698":0,"3699":0,"3700":0,"3701":0,"3702":0,"3703":0,"3712":0,"3714":0,"3716":0,"3718":0,"3719":0,"3723":0,"3727":0,"3731":0,"3753":0,"3754":0,"3756":0,"3757":0,"3760":0,"3761":0,"3763":0,"3764":0,"3765":0,"3767":0,"3768":0,"3770":0,"3771":0,"3774":0,"3775":0,"3779":0,"3781":0};-_yuitest_coverage["build/yui-core/yui-core.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3753":0,"(anonymous 8):1950":0};-_yuitest_coverage["build/yui-core/yui-core.js"].coveredLines = 822;+_yuitest_coverage["build/yui-core/yui-core.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3563":0,"3566":0,"3568":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3575":0,"3576":0,"3577":0,"3578":0,"3579":0,"3580":0,"3581":0,"3585":0,"3586":0,"3588":0,"3589":0,"3591":0,"3592":0,"3595":0,"3596":0,"3597":0,"3598":0,"3600":0,"3601":0,"3602":0,"3603":0,"3608":0,"3609":0,"3611":0,"3612":0,"3613":0,"3615":0,"3616":0,"3617":0,"3619":0,"3620":0,"3621":0,"3624":0,"3625":0,"3627":0,"3629":0,"3630":0,"3631":0,"3632":0,"3633":0,"3636":0,"3637":0,"3638":0,"3640":0,"3641":0,"3642":0,"3646":0,"3647":0,"3648":0,"3649":0,"3651":0,"3652":0,"3653":0,"3655":0,"3656":0,"3661":0,"3662":0,"3663":0,"3664":0,"3665":0,"3666":0,"3669":0,"3670":0,"3671":0,"3676":0,"3678":0,"3679":0,"3680":0,"3681":0,"3683":0,"3684":0,"3685":0,"3688":0,"3689":0,"3690":0,"3691":0,"3692":0,"3695":0,"3697":0,"3698":0,"3701":0,"3702":0,"3703":0,"3705":0,"3706":0,"3707":0,"3708":0,"3709":0,"3710":0,"3720":0,"3721":0,"3725":0,"3727":0,"3729":0,"3731":0,"3732":0,"3736":0,"3740":0,"3744":0,"3766":0,"3767":0,"3769":0,"3770":0,"3773":0,"3774":0,"3776":0,"3777":0,"3778":0,"3780":0,"3781":0,"3783":0,"3784":0,"3787":0,"3788":0,"3792":0,"3794":0};+_yuitest_coverage["build/yui-core/yui-core.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3766":0,"(anonymous 8):1950":0};+_yuitest_coverage["build/yui-core/yui-core.js"].coveredLines = 824; _yuitest_coverage["build/yui-core/yui-core.js"].coveredFunctions = 98; _yuitest_coverline("build/yui-core/yui-core.js", 10); if (typeof YUI != 'undefined') {@@ -217,7 +217,7 @@ _yuitest_coverfunc("build/yui-core/yui-core.js", "(anonymous 1)", 153); _yuitest_coverline("build/yui-core/yui-core.js", 155); var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -3221,11 +3221,11 @@ if (Lang.isObject(obj)) { _yuitest_coverline("build/yui-core/yui-core.js", 2556); try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug). _yuitest_coverline("build/yui-core/yui-core.js", 2560);-if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { _yuitest_coverline("build/yui-core/yui-core.js", 2561); result = 2; }@@ -4161,7 +4161,7 @@ return parseFloat(s.replace(/\./g, function() { _yuitest_coverfunc("build/yui-core/yui-core.js", "(anonymous 22)", 3328); _yuitest_coverline("build/yui-core/yui-core.js", 3329);-return (c++ == 1) ? '' : '.';+return (c++ === 1) ? '' : '.'; })); }, @@ -4276,13 +4276,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -4371,7 +4364,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -4388,250 +4395,250 @@ * @type String * @static */- _yuitest_coverline("build/yui-core/yui-core.js", 3556);+ _yuitest_coverline("build/yui-core/yui-core.js", 3563); o.userAgent = ua; - _yuitest_coverline("build/yui-core/yui-core.js", 3559);+ _yuitest_coverline("build/yui-core/yui-core.js", 3566); o.secure = href && (href.toLowerCase().indexOf('https') === 0); - _yuitest_coverline("build/yui-core/yui-core.js", 3561);+ _yuitest_coverline("build/yui-core/yui-core.js", 3568); if (ua) { - _yuitest_coverline("build/yui-core/yui-core.js", 3563);+ _yuitest_coverline("build/yui-core/yui-core.js", 3570); if ((/windows|win32/i).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3564);+ _yuitest_coverline("build/yui-core/yui-core.js", 3571); o.os = 'windows';- } else {_yuitest_coverline("build/yui-core/yui-core.js", 3565);+ } else {_yuitest_coverline("build/yui-core/yui-core.js", 3572); if ((/macintosh|mac_powerpc/i).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3566);+ _yuitest_coverline("build/yui-core/yui-core.js", 3573); o.os = 'macintosh';- } else {_yuitest_coverline("build/yui-core/yui-core.js", 3567);+ } else {_yuitest_coverline("build/yui-core/yui-core.js", 3574); if ((/android/i).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3568);+ _yuitest_coverline("build/yui-core/yui-core.js", 3575); o.os = 'android';- } else {_yuitest_coverline("build/yui-core/yui-core.js", 3569);+ } else {_yuitest_coverline("build/yui-core/yui-core.js", 3576); if ((/symbos/i).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3570);+ _yuitest_coverline("build/yui-core/yui-core.js", 3577); o.os = 'symbos';- } else {_yuitest_coverline("build/yui-core/yui-core.js", 3571);+ } else {_yuitest_coverline("build/yui-core/yui-core.js", 3578); if ((/linux/i).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3572);+ _yuitest_coverline("build/yui-core/yui-core.js", 3579); o.os = 'linux';- } else {_yuitest_coverline("build/yui-core/yui-core.js", 3573);+ } else {_yuitest_coverline("build/yui-core/yui-core.js", 3580); if ((/rhino/i).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3574);+ _yuitest_coverline("build/yui-core/yui-core.js", 3581); o.os = 'rhino'; }}}}}} // Modern KHTML browsers should qualify as Safari X-Grade- _yuitest_coverline("build/yui-core/yui-core.js", 3578);+ _yuitest_coverline("build/yui-core/yui-core.js", 3585); if ((/KHTML/).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3579);+ _yuitest_coverline("build/yui-core/yui-core.js", 3586); o.webkit = 1; }- _yuitest_coverline("build/yui-core/yui-core.js", 3581);+ _yuitest_coverline("build/yui-core/yui-core.js", 3588); if ((/IEMobile|XBLWP7/).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3582);+ _yuitest_coverline("build/yui-core/yui-core.js", 3589); o.mobile = 'windows'; }- _yuitest_coverline("build/yui-core/yui-core.js", 3584);+ _yuitest_coverline("build/yui-core/yui-core.js", 3591); if ((/Fennec/).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3585);+ _yuitest_coverline("build/yui-core/yui-core.js", 3592); o.mobile = 'gecko'; } // Modern WebKit browsers are at least X-Grade- _yuitest_coverline("build/yui-core/yui-core.js", 3588);+ _yuitest_coverline("build/yui-core/yui-core.js", 3595); m = ua.match(/AppleWebKit\/([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3589);+ _yuitest_coverline("build/yui-core/yui-core.js", 3596); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3590);+ _yuitest_coverline("build/yui-core/yui-core.js", 3597); o.webkit = numberify(m[1]);- _yuitest_coverline("build/yui-core/yui-core.js", 3591);+ _yuitest_coverline("build/yui-core/yui-core.js", 3598); o.safari = o.webkit;- - _yuitest_coverline("build/yui-core/yui-core.js", 3593);++ _yuitest_coverline("build/yui-core/yui-core.js", 3600); if (/PhantomJS/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3594);+ _yuitest_coverline("build/yui-core/yui-core.js", 3601); m = ua.match(/PhantomJS\/([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3595);+ _yuitest_coverline("build/yui-core/yui-core.js", 3602); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3596);+ _yuitest_coverline("build/yui-core/yui-core.js", 3603); o.phantomjs = numberify(m[1]); } } // Mobile browser check- _yuitest_coverline("build/yui-core/yui-core.js", 3601);+ _yuitest_coverline("build/yui-core/yui-core.js", 3608); if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3602);+ _yuitest_coverline("build/yui-core/yui-core.js", 3609); o.mobile = 'Apple'; // iPhone or iPod Touch - _yuitest_coverline("build/yui-core/yui-core.js", 3604);+ _yuitest_coverline("build/yui-core/yui-core.js", 3611); m = ua.match(/OS ([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3605);+ _yuitest_coverline("build/yui-core/yui-core.js", 3612); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3606);+ _yuitest_coverline("build/yui-core/yui-core.js", 3613); m = numberify(m[1].replace('_', '.')); }- _yuitest_coverline("build/yui-core/yui-core.js", 3608);+ _yuitest_coverline("build/yui-core/yui-core.js", 3615); o.ios = m;- _yuitest_coverline("build/yui-core/yui-core.js", 3609);+ _yuitest_coverline("build/yui-core/yui-core.js", 3616); o.os = 'ios';- _yuitest_coverline("build/yui-core/yui-core.js", 3610);+ _yuitest_coverline("build/yui-core/yui-core.js", 3617); o.ipad = o.ipod = o.iphone = 0; - _yuitest_coverline("build/yui-core/yui-core.js", 3612);+ _yuitest_coverline("build/yui-core/yui-core.js", 3619); m = ua.match(/iPad|iPod|iPhone/);- _yuitest_coverline("build/yui-core/yui-core.js", 3613);+ _yuitest_coverline("build/yui-core/yui-core.js", 3620); if (m && m[0]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3614);+ _yuitest_coverline("build/yui-core/yui-core.js", 3621); o[m[0].toLowerCase()] = o.ios; } } else {- _yuitest_coverline("build/yui-core/yui-core.js", 3617);+ _yuitest_coverline("build/yui-core/yui-core.js", 3624); m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);- _yuitest_coverline("build/yui-core/yui-core.js", 3618);+ _yuitest_coverline("build/yui-core/yui-core.js", 3625); if (m) { // Nokia N-series, webOS, ex: NokiaN95- _yuitest_coverline("build/yui-core/yui-core.js", 3620);+ _yuitest_coverline("build/yui-core/yui-core.js", 3627); o.mobile = m[0]; }- _yuitest_coverline("build/yui-core/yui-core.js", 3622);+ _yuitest_coverline("build/yui-core/yui-core.js", 3629); if (/webOS/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3623);+ _yuitest_coverline("build/yui-core/yui-core.js", 3630); o.mobile = 'WebOS';- _yuitest_coverline("build/yui-core/yui-core.js", 3624);+ _yuitest_coverline("build/yui-core/yui-core.js", 3631); m = ua.match(/webOS\/([^\s]*);/);- _yuitest_coverline("build/yui-core/yui-core.js", 3625);+ _yuitest_coverline("build/yui-core/yui-core.js", 3632); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3626);+ _yuitest_coverline("build/yui-core/yui-core.js", 3633); o.webos = numberify(m[1]); } }- _yuitest_coverline("build/yui-core/yui-core.js", 3629);+ _yuitest_coverline("build/yui-core/yui-core.js", 3636); if (/ Android/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3630);+ _yuitest_coverline("build/yui-core/yui-core.js", 3637); if (/Mobile/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3631);+ _yuitest_coverline("build/yui-core/yui-core.js", 3638); o.mobile = 'Android'; }- _yuitest_coverline("build/yui-core/yui-core.js", 3633);+ _yuitest_coverline("build/yui-core/yui-core.js", 3640); m = ua.match(/Android ([^\s]*);/);- _yuitest_coverline("build/yui-core/yui-core.js", 3634);+ _yuitest_coverline("build/yui-core/yui-core.js", 3641); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3635);+ _yuitest_coverline("build/yui-core/yui-core.js", 3642); o.android = numberify(m[1]); } }- _yuitest_coverline("build/yui-core/yui-core.js", 3639);+ _yuitest_coverline("build/yui-core/yui-core.js", 3646); if (/Silk/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3640);+ _yuitest_coverline("build/yui-core/yui-core.js", 3647); m = ua.match(/Silk\/([^\s]*)\)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3641);+ _yuitest_coverline("build/yui-core/yui-core.js", 3648); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3642);+ _yuitest_coverline("build/yui-core/yui-core.js", 3649); o.silk = numberify(m[1]); }- _yuitest_coverline("build/yui-core/yui-core.js", 3644);+ _yuitest_coverline("build/yui-core/yui-core.js", 3651); if (!o.android) {- _yuitest_coverline("build/yui-core/yui-core.js", 3645);+ _yuitest_coverline("build/yui-core/yui-core.js", 3652); o.android = 2.34; //Hack for desktop mode in Kindle- _yuitest_coverline("build/yui-core/yui-core.js", 3646);+ _yuitest_coverline("build/yui-core/yui-core.js", 3653); o.os = 'Android'; }- _yuitest_coverline("build/yui-core/yui-core.js", 3648);+ _yuitest_coverline("build/yui-core/yui-core.js", 3655); if (/Accelerated=true/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3649);+ _yuitest_coverline("build/yui-core/yui-core.js", 3656); o.accel = true; } } } - _yuitest_coverline("build/yui-core/yui-core.js", 3654);+ _yuitest_coverline("build/yui-core/yui-core.js", 3661); m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3655);+ _yuitest_coverline("build/yui-core/yui-core.js", 3662); if (m && m[1] && m[2]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3656);+ _yuitest_coverline("build/yui-core/yui-core.js", 3663); o.chrome = numberify(m[2]); // Chrome- _yuitest_coverline("build/yui-core/yui-core.js", 3657);+ _yuitest_coverline("build/yui-core/yui-core.js", 3664); o.safari = 0; //Reset safari back to 0- _yuitest_coverline("build/yui-core/yui-core.js", 3658);+ _yuitest_coverline("build/yui-core/yui-core.js", 3665); if (m[1] === 'CrMo') {- _yuitest_coverline("build/yui-core/yui-core.js", 3659);+ _yuitest_coverline("build/yui-core/yui-core.js", 3666); o.mobile = 'chrome'; } } else {- _yuitest_coverline("build/yui-core/yui-core.js", 3662);+ _yuitest_coverline("build/yui-core/yui-core.js", 3669); m = ua.match(/AdobeAIR\/([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3663);+ _yuitest_coverline("build/yui-core/yui-core.js", 3670); if (m) {- _yuitest_coverline("build/yui-core/yui-core.js", 3664);+ _yuitest_coverline("build/yui-core/yui-core.js", 3671); o.air = m[0]; // Adobe AIR 1.0 or better } } } - _yuitest_coverline("build/yui-core/yui-core.js", 3669);+ _yuitest_coverline("build/yui-core/yui-core.js", 3676); if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)- _yuitest_coverline("build/yui-core/yui-core.js", 3671);+ _yuitest_coverline("build/yui-core/yui-core.js", 3678); if (/Opera/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3672);+ _yuitest_coverline("build/yui-core/yui-core.js", 3679); m = ua.match(/Opera[\s\/]([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3673);+ _yuitest_coverline("build/yui-core/yui-core.js", 3680); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3674);+ _yuitest_coverline("build/yui-core/yui-core.js", 3681); o.opera = numberify(m[1]); }- _yuitest_coverline("build/yui-core/yui-core.js", 3676);+ _yuitest_coverline("build/yui-core/yui-core.js", 3683); m = ua.match(/Version\/([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3677);+ _yuitest_coverline("build/yui-core/yui-core.js", 3684); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3678);+ _yuitest_coverline("build/yui-core/yui-core.js", 3685); o.opera = numberify(m[1]); // opera 10+ } - _yuitest_coverline("build/yui-core/yui-core.js", 3681);+ _yuitest_coverline("build/yui-core/yui-core.js", 3688); if (/Opera Mobi/.test(ua)) {- _yuitest_coverline("build/yui-core/yui-core.js", 3682);+ _yuitest_coverline("build/yui-core/yui-core.js", 3689); o.mobile = 'opera';- _yuitest_coverline("build/yui-core/yui-core.js", 3683);+ _yuitest_coverline("build/yui-core/yui-core.js", 3690); m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3684);+ _yuitest_coverline("build/yui-core/yui-core.js", 3691); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3685);+ _yuitest_coverline("build/yui-core/yui-core.js", 3692); o.opera = numberify(m[1]); } }- _yuitest_coverline("build/yui-core/yui-core.js", 3688);+ _yuitest_coverline("build/yui-core/yui-core.js", 3695); m = ua.match(/Opera Mini[^;]*/); - _yuitest_coverline("build/yui-core/yui-core.js", 3690);+ _yuitest_coverline("build/yui-core/yui-core.js", 3697); if (m) {- _yuitest_coverline("build/yui-core/yui-core.js", 3691);+ _yuitest_coverline("build/yui-core/yui-core.js", 3698); o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit- _yuitest_coverline("build/yui-core/yui-core.js", 3694);+ _yuitest_coverline("build/yui-core/yui-core.js", 3701); m = ua.match(/MSIE\s([^;]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3695);+ _yuitest_coverline("build/yui-core/yui-core.js", 3702); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3696);+ _yuitest_coverline("build/yui-core/yui-core.js", 3703); o.ie = numberify(m[1]); } else { // not opera, webkit, or ie- _yuitest_coverline("build/yui-core/yui-core.js", 3698);+ _yuitest_coverline("build/yui-core/yui-core.js", 3705); m = ua.match(/Gecko\/([^\s]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3699);+ _yuitest_coverline("build/yui-core/yui-core.js", 3706); if (m) {- _yuitest_coverline("build/yui-core/yui-core.js", 3700);+ _yuitest_coverline("build/yui-core/yui-core.js", 3707); o.gecko = 1; // Gecko detected, look for revision- _yuitest_coverline("build/yui-core/yui-core.js", 3701);+ _yuitest_coverline("build/yui-core/yui-core.js", 3708); m = ua.match(/rv:([^\s\)]*)/);- _yuitest_coverline("build/yui-core/yui-core.js", 3702);+ _yuitest_coverline("build/yui-core/yui-core.js", 3709); if (m && m[1]) {- _yuitest_coverline("build/yui-core/yui-core.js", 3703);+ _yuitest_coverline("build/yui-core/yui-core.js", 3710); o.gecko = numberify(m[1]); } }@@ -4640,34 +4647,42 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ _yuitest_coverline("build/yui-core/yui-core.js", 3720);+if (win && nav && !(o.chrome && o.chrome < 6)) {+ _yuitest_coverline("build/yui-core/yui-core.js", 3721);+o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value.- _yuitest_coverline("build/yui-core/yui-core.js", 3712);+ _yuitest_coverline("build/yui-core/yui-core.js", 3725); if (!subUA) { - _yuitest_coverline("build/yui-core/yui-core.js", 3714);-if (typeof process == 'object') {+ _yuitest_coverline("build/yui-core/yui-core.js", 3727);+if (typeof process === 'object') { - _yuitest_coverline("build/yui-core/yui-core.js", 3716);+ _yuitest_coverline("build/yui-core/yui-core.js", 3729); if (process.versions && process.versions.node) { //NodeJS- _yuitest_coverline("build/yui-core/yui-core.js", 3718);+ _yuitest_coverline("build/yui-core/yui-core.js", 3731); o.os = process.platform;- _yuitest_coverline("build/yui-core/yui-core.js", 3719);+ _yuitest_coverline("build/yui-core/yui-core.js", 3732); o.nodejs = numberify(process.versions.node); } } - _yuitest_coverline("build/yui-core/yui-core.js", 3723);+ _yuitest_coverline("build/yui-core/yui-core.js", 3736); YUI.Env.UA = o; } - _yuitest_coverline("build/yui-core/yui-core.js", 3727);+ _yuitest_coverline("build/yui-core/yui-core.js", 3740); return o; }; -_yuitest_coverline("build/yui-core/yui-core.js", 3731);+_yuitest_coverline("build/yui-core/yui-core.js", 3744); Y.UA = YUI.Env.UA || YUI.Env.parseUA(); /**@@ -4690,54 +4705,55 @@ @return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is higher than _b_. **/-_yuitest_coverline("build/yui-core/yui-core.js", 3753);+_yuitest_coverline("build/yui-core/yui-core.js", 3766); Y.UA.compareVersions = function (a, b) {- _yuitest_coverfunc("build/yui-core/yui-core.js", "compareVersions", 3753);-_yuitest_coverline("build/yui-core/yui-core.js", 3754);+ _yuitest_coverfunc("build/yui-core/yui-core.js", "compareVersions", 3766);+_yuitest_coverline("build/yui-core/yui-core.js", 3767); var aPart, aParts, bPart, bParts, i, len; - _yuitest_coverline("build/yui-core/yui-core.js", 3756);+ _yuitest_coverline("build/yui-core/yui-core.js", 3769); if (a === b) {- _yuitest_coverline("build/yui-core/yui-core.js", 3757);+ _yuitest_coverline("build/yui-core/yui-core.js", 3770); return 0; } - _yuitest_coverline("build/yui-core/yui-core.js", 3760);+ _yuitest_coverline("build/yui-core/yui-core.js", 3773); aParts = (a + '').split('.');- _yuitest_coverline("build/yui-core/yui-core.js", 3761);+ _yuitest_coverline("build/yui-core/yui-core.js", 3774); bParts = (b + '').split('.'); - _yuitest_coverline("build/yui-core/yui-core.js", 3763);+ _yuitest_coverline("build/yui-core/yui-core.js", 3776); for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {- _yuitest_coverline("build/yui-core/yui-core.js", 3764);+ _yuitest_coverline("build/yui-core/yui-core.js", 3777); aPart = parseInt(aParts[i], 10);- _yuitest_coverline("build/yui-core/yui-core.js", 3765);+ _yuitest_coverline("build/yui-core/yui-core.js", 3778); bPart = parseInt(bParts[i], 10); - _yuitest_coverline("build/yui-core/yui-core.js", 3767);+ _yuitest_coverline("build/yui-core/yui-core.js", 3780); isNaN(aPart) && (aPart = 0);- _yuitest_coverline("build/yui-core/yui-core.js", 3768);+ _yuitest_coverline("build/yui-core/yui-core.js", 3781); isNaN(bPart) && (bPart = 0); - _yuitest_coverline("build/yui-core/yui-core.js", 3770);+ _yuitest_coverline("build/yui-core/yui-core.js", 3783); if (aPart < bPart) {- _yuitest_coverline("build/yui-core/yui-core.js", 3771);+ _yuitest_coverline("build/yui-core/yui-core.js", 3784); return -1; } - _yuitest_coverline("build/yui-core/yui-core.js", 3774);+ _yuitest_coverline("build/yui-core/yui-core.js", 3787); if (aPart > bPart) {- _yuitest_coverline("build/yui-core/yui-core.js", 3775);+ _yuitest_coverline("build/yui-core/yui-core.js", 3788); return 1; } } - _yuitest_coverline("build/yui-core/yui-core.js", 3779);+ _yuitest_coverline("build/yui-core/yui-core.js", 3792); return 0; };-_yuitest_coverline("build/yui-core/yui-core.js", 3781);+_yuitest_coverline("build/yui-core/yui-core.js", 3794); YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -4749,14 +4765,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -4776,4 +4792,4 @@ }; -}, '3.7.2');+}, '3.7.3');
bundle/yui-core/yui-core-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2579,10 +2579,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3351,7 +3351,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3466,13 +3466,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3561,7 +3554,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3614,7 +3621,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3733,10 +3740,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3805,6 +3818,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3816,14 +3830,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3843,4 +3857,4 @@ }; -}, '3.7.2');+}, '3.7.3');
bundle/yui-core/yui-core-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.2",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["intl-base"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&!e.alert&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++==1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.2");+typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.3",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["intl-base"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&(!e.scrollTo||!e.document)&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++===1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0,winjs:typeof Windows!="undefined"&&!!Windows.System,touchEnabled:!1},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),r&&i&&!(s.chrome&&s.chrome<6)&&(s.touchEnabled="ontouchstart"in r||"msMaxTouchPoints"in i&&i.msMaxTouchPoints>0),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.3");
bundle/yui-core/yui-core.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2560,10 +2560,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3332,7 +3332,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3447,13 +3447,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3542,7 +3535,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3595,7 +3602,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3714,10 +3721,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3786,6 +3799,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3797,14 +3811,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3824,4 +3838,4 @@ }; -}, '3.7.2');+}, '3.7.3');
bundle/yui-later/yui-later-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-later/yui-later.js", code: [] };-_yuitest_coverage["build/yui-later/yui-later.js"].code=["YUI.add('yui-later', function (Y, NAME) {","","/**"," * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href=\"../classes/YUI.html#method_later\">it's documentation is located under the YUI class</a>."," *"," * @module yui"," * @submodule yui-later"," */","","var NO_ARGS = [];","","/**"," * Executes the supplied function in the context of the supplied"," * object 'when' milliseconds later. Executes the function a"," * single time unless periodic is set to true."," * @for YUI"," * @method later"," * @param when {int} the number of milliseconds to wait until the fn"," * is executed."," * @param o the context object."," * @param fn {Function|String} the function to execute or the name of"," * the method in the 'o' object to execute."," * @param data [Array] data that is provided to the function. This"," * accepts either a single item or an array. If an array is provided,"," * the function is executed with one parameter for each array item."," * If you need to pass a single array parameter, it needs to be wrapped"," * in an array [myarray]."," *"," * Note: native methods in IE may not have the call and apply methods."," * In this case, it will work, but you are limited to four arguments."," *"," * @param periodic {boolean} if true, executes continuously at supplied"," * interval until canceled."," * @return {object} a timer object. Call the cancel() method on this"," * object to stop the timer."," */","Y.later = function(when, o, fn, data, periodic) {"," when = when || 0;"," data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;"," o = o || Y.config.win || Y;",""," var cancelled = false,"," method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,"," wrapper = function() {"," // IE 8- may execute a setInterval callback one last time"," // after clearInterval was called, so in order to preserve"," // the cancel() === no more runny-run, we have to jump through"," // an extra hoop."," if (!cancelled) {"," if (!method.apply) {"," method(data[0], data[1], data[2], data[3]);"," } else {"," method.apply(o, data || NO_ARGS);"," }"," }"," },"," id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);",""," return {"," id: id,"," interval: periodic,"," cancel: function() {"," cancelled = true;"," if (this.interval) {"," clearInterval(id);"," } else {"," clearTimeout(id);"," }"," }"," };","};","","Y.Lang.later = Y.later;","","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/yui-later/yui-later.js"].code=["YUI.add('yui-later', function (Y, NAME) {","","/**"," * Provides a setTimeout/setInterval wrapper. This module is a `core` YUI module, <a href=\"../classes/YUI.html#method_later\">it's documentation is located under the YUI class</a>."," *"," * @module yui"," * @submodule yui-later"," */","","var NO_ARGS = [];","","/**"," * Executes the supplied function in the context of the supplied"," * object 'when' milliseconds later. Executes the function a"," * single time unless periodic is set to true."," * @for YUI"," * @method later"," * @param when {int} the number of milliseconds to wait until the fn"," * is executed."," * @param o the context object."," * @param fn {Function|String} the function to execute or the name of"," * the method in the 'o' object to execute."," * @param data [Array] data that is provided to the function. This"," * accepts either a single item or an array. If an array is provided,"," * the function is executed with one parameter for each array item."," * If you need to pass a single array parameter, it needs to be wrapped"," * in an array [myarray]."," *"," * Note: native methods in IE may not have the call and apply methods."," * In this case, it will work, but you are limited to four arguments."," *"," * @param periodic {boolean} if true, executes continuously at supplied"," * interval until canceled."," * @return {object} a timer object. Call the cancel() method on this"," * object to stop the timer."," */","Y.later = function(when, o, fn, data, periodic) {"," when = when || 0;"," data = (!Y.Lang.isUndefined(data)) ? Y.Array(data) : NO_ARGS;"," o = o || Y.config.win || Y;",""," var cancelled = false,"," method = (o && Y.Lang.isString(fn)) ? o[fn] : fn,"," wrapper = function() {"," // IE 8- may execute a setInterval callback one last time"," // after clearInterval was called, so in order to preserve"," // the cancel() === no more runny-run, we have to jump through"," // an extra hoop."," if (!cancelled) {"," if (!method.apply) {"," method(data[0], data[1], data[2], data[3]);"," } else {"," method.apply(o, data || NO_ARGS);"," }"," }"," },"," id = (periodic) ? setInterval(wrapper, when) : setTimeout(wrapper, when);",""," return {"," id: id,"," interval: periodic,"," cancel: function() {"," cancelled = true;"," if (this.interval) {"," clearInterval(id);"," } else {"," clearTimeout(id);"," }"," }"," };","};","","Y.Lang.later = Y.later;","","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/yui-later/yui-later.js"].lines = {"1":0,"10":0,"37":0,"38":0,"39":0,"40":0,"42":0,"49":0,"50":0,"51":0,"53":0,"59":0,"63":0,"64":0,"65":0,"67":0,"73":0}; _yuitest_coverage["build/yui-later/yui-later.js"].functions = {"wrapper:44":0,"cancel:62":0,"later:37":0,"(anonymous 1):1":0}; _yuitest_coverage["build/yui-later/yui-later.js"].coveredLines = 17;@@ -134,4 +134,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-later/yui-later-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -80,4 +80,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-later/yui-later-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.2",{requires:["yui-base"]});+YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.3",{requires:["yui-base"]});
bundle/yui-later/yui-later.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -80,4 +80,4 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-log-nodejs/yui-log-nodejs-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-log-nodejs/yui-log-nodejs.js", code: [] };-_yuitest_coverage["build/yui-log-nodejs/yui-log-nodejs.js"].code=["YUI.add('yui-log-nodejs', function (Y, NAME) {","","var sys = require(process.binding('natives').util ? 'util' : 'sys'),"," hasColor = false;","","try {"," var stdio = require(\"stdio\");"," hasColor = stdio.isStderrATTY();","} catch (ex) {"," hasColor = true;","}","","Y.config.useColor = hasColor;","","Y.consoleColor = function(str, num) {"," if (!this.config.useColor) {"," return str;"," }"," if (!num) {"," num = '32';"," }"," return \"\\u001b[\" + num +\"m\" + str + \"\\u001b[0m\";","};","","","var logFn = function(str, t, m) {"," var id = '';"," if (this.id) {"," id = '[' + this.id + ']:';"," }"," t = t || 'info';"," m = (m) ? this.consoleColor(' (' + m.toLowerCase() + '):', 35) : '';"," "," if (str === null) {"," str = 'null';"," }",""," if ((typeof str === 'object') || str instanceof Array) {"," try {"," //Should we use this?"," if (str.tagName || str._yuid || str._query) {"," str = str.toString();"," } else {"," str = sys.inspect(str);"," }"," } catch (e) {"," //Fail catcher"," }"," }",""," var lvl = '37;40', mLvl = ((str) ? '' : 31);"," t = t+''; //Force to a string.."," switch (t.toLowerCase()) {"," case 'error':"," lvl = mLvl = 31;"," break;"," case 'warn':"," lvl = 33;"," break;"," case 'debug':"," lvl = 34;"," break;"," }"," if (typeof str === 'string') {"," if (str && str.indexOf(\"\\n\") !== -1) {"," str = \"\\n\" + str;"," }"," }",""," // output log messages to stderr"," sys.error(this.consoleColor(t.toLowerCase() + ':', lvl) + m + ' ' + this.consoleColor(str, mLvl));","};","","if (!Y.config.logFn) {"," Y.config.logFn = logFn;","}","","","","}, '3.7.2');"];+_yuitest_coverage["build/yui-log-nodejs/yui-log-nodejs.js"].code=["YUI.add('yui-log-nodejs', function (Y, NAME) {","","var sys = require(process.binding('natives').util ? 'util' : 'sys'),"," hasColor = false;","","try {"," var stdio = require(\"stdio\");"," hasColor = stdio.isStderrATTY();","} catch (ex) {"," hasColor = true;","}","","Y.config.useColor = hasColor;","","Y.consoleColor = function(str, num) {"," if (!this.config.useColor) {"," return str;"," }"," if (!num) {"," num = '32';"," }"," return \"\\u001b[\" + num +\"m\" + str + \"\\u001b[0m\";","};","","","var logFn = function(str, t, m) {"," var id = '';"," if (this.id) {"," id = '[' + this.id + ']:';"," }"," t = t || 'info';"," m = (m) ? this.consoleColor(' (' + m.toLowerCase() + '):', 35) : '';"," "," if (str === null) {"," str = 'null';"," }",""," if ((typeof str === 'object') || str instanceof Array) {"," try {"," //Should we use this?"," if (str.tagName || str._yuid || str._query) {"," str = str.toString();"," } else {"," str = sys.inspect(str);"," }"," } catch (e) {"," //Fail catcher"," }"," }",""," var lvl = '37;40', mLvl = ((str) ? '' : 31);"," t = t+''; //Force to a string.."," switch (t.toLowerCase()) {"," case 'error':"," lvl = mLvl = 31;"," break;"," case 'warn':"," lvl = 33;"," break;"," case 'debug':"," lvl = 34;"," break;"," }"," if (typeof str === 'string') {"," if (str && str.indexOf(\"\\n\") !== -1) {"," str = \"\\n\" + str;"," }"," }",""," // output log messages to stderr"," sys.error(this.consoleColor(t.toLowerCase() + ':', lvl) + m + ' ' + this.consoleColor(str, mLvl));","};","","if (!Y.config.logFn) {"," Y.config.logFn = logFn;","}","","","","}, '3.7.3');"]; _yuitest_coverage["build/yui-log-nodejs/yui-log-nodejs.js"].lines = {"1":0,"3":0,"6":0,"7":0,"8":0,"10":0,"13":0,"15":0,"16":0,"17":0,"19":0,"20":0,"22":0,"26":0,"27":0,"28":0,"29":0,"31":0,"32":0,"34":0,"35":0,"38":0,"39":0,"41":0,"42":0,"44":0,"51":0,"52":0,"53":0,"55":0,"56":0,"58":0,"59":0,"61":0,"62":0,"64":0,"65":0,"66":0,"71":0,"74":0,"75":0}; _yuitest_coverage["build/yui-log-nodejs/yui-log-nodejs.js"].functions = {"consoleColor:15":0,"logFn:26":0,"(anonymous 1):1":0}; _yuitest_coverage["build/yui-log-nodejs/yui-log-nodejs.js"].coveredLines = 41;@@ -160,4 +160,4 @@ -}, '3.7.2');+}, '3.7.3');
bundle/yui-log-nodejs/yui-log-nodejs-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -83,4 +83,4 @@ -}, '3.7.2');+}, '3.7.3');
bundle/yui-log-nodejs/yui-log-nodejs-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("yui-log-nodejs",function(e,t){var n=require(process.binding("natives").util?"util":"sys"),r=!1;try{var i=require("stdio");r=i.isStderrATTY()}catch(s){r=!0}e.config.useColor=r,e.consoleColor=function(e,t){return this.config.useColor?(t||(t="32"),"["+t+"m"+e+"[0m"):e};var o=function(e,t,r){var i="";this.id&&(i="["+this.id+"]:"),t=t||"info",r=r?this.consoleColor(" ("+r.toLowerCase()+"):",35):"",e===null&&(e="null");if(typeof e=="object"||e instanceof Array)try{e.tagName||e._yuid||e._query?e=e.toString():e=n.inspect(e)}catch(s){}var o="37;40",u=e?"":31;t+="";switch(t.toLowerCase()){case"error":o=u=31;break;case"warn":o=33;break;case"debug":o=34}typeof e=="string"&&e&&e.indexOf("\n")!==-1&&(e="\n"+e),n.error(this.consoleColor(t.toLowerCase()+":",o)+r+" "+this.consoleColor(e,u))};e.config.logFn||(e.config.logFn=o)},"3.7.2");+YUI.add("yui-log-nodejs",function(e,t){var n=require(process.binding("natives").util?"util":"sys"),r=!1;try{var i=require("stdio");r=i.isStderrATTY()}catch(s){r=!0}e.config.useColor=r,e.consoleColor=function(e,t){return this.config.useColor?(t||(t="32"),"["+t+"m"+e+"[0m"):e};var o=function(e,t,r){var i="";this.id&&(i="["+this.id+"]:"),t=t||"info",r=r?this.consoleColor(" ("+r.toLowerCase()+"):",35):"",e===null&&(e="null");if(typeof e=="object"||e instanceof Array)try{e.tagName||e._yuid||e._query?e=e.toString():e=n.inspect(e)}catch(s){}var o="37;40",u=e?"":31;t+="";switch(t.toLowerCase()){case"error":o=u=31;break;case"warn":o=33;break;case"debug":o=34}typeof e=="string"&&e&&e.indexOf("\n")!==-1&&(e="\n"+e),n.error(this.consoleColor(t.toLowerCase()+":",o)+r+" "+this.consoleColor(e,u))};e.config.logFn||(e.config.logFn=o)},"3.7.3");
bundle/yui-log-nodejs/yui-log-nodejs.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -83,4 +83,4 @@ -}, '3.7.2');+}, '3.7.3');
bundle/yui-log/yui-log-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-log/yui-log.js", code: [] };-_yuitest_coverage["build/yui-log/yui-log.js"].code=["YUI.add('yui-log', function (Y, NAME) {","","/**"," * Provides console log capability and exposes a custom event for"," * console implementations. This module is a `core` YUI module, <a href=\"../classes/YUI.html#method_log\">it's documentation is located under the YUI class</a>."," *"," * @module yui"," * @submodule yui-log"," */","","var INSTANCE = Y,"," LOGEVENT = 'yui:log',"," UNDEFINED = 'undefined',"," LEVELS = { debug: 1,"," info: 1,"," warn: 1,"," error: 1 };","","/**"," * If the 'debug' config is true, a 'yui:log' event will be"," * dispatched, which the Console widget and anything else"," * can consume. If the 'useBrowserConsole' config is true, it will"," * write to the browser console if available. YUI-specific log"," * messages will only be present in the -debug versions of the"," * JS files. The build system is supposed to remove log statements"," * from the raw and minified versions of the files."," *"," * @method log"," * @for YUI"," * @param {String} msg The message to log."," * @param {String} cat The log category for the message. Default"," * categories are \"info\", \"warn\", \"error\", time\"."," * Custom categories can be used as well. (opt)."," * @param {String} src The source of the the message (opt)."," * @param {boolean} silent If true, the log event won't fire."," * @return {YUI} YUI instance."," */","INSTANCE.log = function(msg, cat, src, silent) {"," var bail, excl, incl, m, f,"," Y = INSTANCE,"," c = Y.config,"," publisher = (Y.fire) ? Y : YUI.Env.globalEvents;"," // suppress log message if the config is off or the event stack"," // or the event call stack contains a consumer of the yui:log event"," if (c.debug) {"," // apply source filters"," src = src || \"\";"," if (typeof src !== \"undefined\") {"," excl = c.logExclude;"," incl = c.logInclude;"," if (incl && !(src in incl)) {"," bail = 1;"," } else if (incl && (src in incl)) {"," bail = !incl[src];"," } else if (excl && (src in excl)) {"," bail = excl[src];"," }"," }"," if (!bail) {"," if (c.useBrowserConsole) {"," m = (src) ? src + ': ' + msg : msg;"," if (Y.Lang.isFunction(c.logFn)) {"," c.logFn.call(Y, msg, cat, src);"," } else if (typeof console != UNDEFINED && console.log) {"," f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';"," console[f](m);"," } else if (typeof opera != UNDEFINED) {"," opera.postError(m);"," }"," }",""," if (publisher && !silent) {",""," if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {"," publisher.publish(LOGEVENT, {"," broadcast: 2"," });"," }",""," publisher.fire(LOGEVENT, {"," msg: msg,"," cat: cat,"," src: src"," });"," }"," }"," }",""," return Y;","};","","/**"," * Write a system message. This message will be preserved in the"," * minified and raw versions of the YUI files, unlike log statements."," * @method message"," * @for YUI"," * @param {String} msg The message to log."," * @param {String} cat The log category for the message. Default"," * categories are \"info\", \"warn\", \"error\", time\"."," * Custom categories can be used as well. (opt)."," * @param {String} src The source of the the message (opt)."," * @param {boolean} silent If true, the log event won't fire."," * @return {YUI} YUI instance."," */","INSTANCE.message = function() {"," return INSTANCE.log.apply(INSTANCE, arguments);","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/yui-log/yui-log.js"].code=["YUI.add('yui-log', function (Y, NAME) {","","/**"," * Provides console log capability and exposes a custom event for"," * console implementations. This module is a `core` YUI module, <a href=\"../classes/YUI.html#method_log\">it's documentation is located under the YUI class</a>."," *"," * @module yui"," * @submodule yui-log"," */","","var INSTANCE = Y,"," LOGEVENT = 'yui:log',"," UNDEFINED = 'undefined',"," LEVELS = { debug: 1,"," info: 1,"," warn: 1,"," error: 1 };","","/**"," * If the 'debug' config is true, a 'yui:log' event will be"," * dispatched, which the Console widget and anything else"," * can consume. If the 'useBrowserConsole' config is true, it will"," * write to the browser console if available. YUI-specific log"," * messages will only be present in the -debug versions of the"," * JS files. The build system is supposed to remove log statements"," * from the raw and minified versions of the files."," *"," * @method log"," * @for YUI"," * @param {String} msg The message to log."," * @param {String} cat The log category for the message. Default"," * categories are \"info\", \"warn\", \"error\", time\"."," * Custom categories can be used as well. (opt)."," * @param {String} src The source of the the message (opt)."," * @param {boolean} silent If true, the log event won't fire."," * @return {YUI} YUI instance."," */","INSTANCE.log = function(msg, cat, src, silent) {"," var bail, excl, incl, m, f,"," Y = INSTANCE,"," c = Y.config,"," publisher = (Y.fire) ? Y : YUI.Env.globalEvents;"," // suppress log message if the config is off or the event stack"," // or the event call stack contains a consumer of the yui:log event"," if (c.debug) {"," // apply source filters"," src = src || \"\";"," if (typeof src !== \"undefined\") {"," excl = c.logExclude;"," incl = c.logInclude;"," if (incl && !(src in incl)) {"," bail = 1;"," } else if (incl && (src in incl)) {"," bail = !incl[src];"," } else if (excl && (src in excl)) {"," bail = excl[src];"," }"," }"," if (!bail) {"," if (c.useBrowserConsole) {"," m = (src) ? src + ': ' + msg : msg;"," if (Y.Lang.isFunction(c.logFn)) {"," c.logFn.call(Y, msg, cat, src);"," } else if (typeof console != UNDEFINED && console.log) {"," f = (cat && console[cat] && (cat in LEVELS)) ? cat : 'log';"," console[f](m);"," } else if (typeof opera != UNDEFINED) {"," opera.postError(m);"," }"," }",""," if (publisher && !silent) {",""," if (publisher == Y && (!publisher.getEvent(LOGEVENT))) {"," publisher.publish(LOGEVENT, {"," broadcast: 2"," });"," }",""," publisher.fire(LOGEVENT, {"," msg: msg,"," cat: cat,"," src: src"," });"," }"," }"," }",""," return Y;","};","","/**"," * Write a system message. This message will be preserved in the"," * minified and raw versions of the YUI files, unlike log statements."," * @method message"," * @for YUI"," * @param {String} msg The message to log."," * @param {String} cat The log category for the message. Default"," * categories are \"info\", \"warn\", \"error\", time\"."," * Custom categories can be used as well. (opt)."," * @param {String} src The source of the the message (opt)."," * @param {boolean} silent If true, the log event won't fire."," * @return {YUI} YUI instance."," */","INSTANCE.message = function() {"," return INSTANCE.log.apply(INSTANCE, arguments);","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/yui-log/yui-log.js"].lines = {"1":0,"11":0,"38":0,"39":0,"45":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"72":0,"74":0,"75":0,"80":0,"89":0,"105":0,"106":0}; _yuitest_coverage["build/yui-log/yui-log.js"].functions = {"log:38":0,"message:105":0,"(anonymous 1):1":0}; _yuitest_coverage["build/yui-log/yui-log.js"].coveredLines = 32;@@ -181,4 +181,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-log/yui-log-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -113,4 +113,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-log/yui-log-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.2",{requires:["yui-base"]});+YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.3",{requires:["yui-base"]});
bundle/yui-log/yui-log.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -113,4 +113,4 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-nodejs/yui-nodejs-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-nodejs/yui-nodejs.js", code: [] };-_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.2',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-log-nodejs', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or alert (window),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ == 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;"," "," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process == 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-number\",\"datatype-date\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.2', {\"use\": [\"yui-base\", \"get\", \"features\", \"intl-base\", \"yui-log\", \"yui-log-nodejs\", \"yui-later\", \"loader-base\", \"loader-rollup\", \"loader-yui3\"]});"];+_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.3',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-log-nodejs', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ === 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0,"," /*"," * Window8/IE10 Application host environment"," * @property winjs"," * @type Boolean"," * @static"," */"," winjs: !!((typeof Windows !== \"undefined\") && Windows.System),"," /**"," * Are touch/msPointer events available on this device"," * @property touchEnabled"," * @type Boolean"," * @static"," */"," touchEnabled: false"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;",""," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //Check for known properties to tell if touch events are enabled on this device or if"," //the number of MSPointer touchpoints on this device is greater than 0."," if (win && nav && !(o.chrome && o.chrome < 6)) {"," o.touchEnabled = ((\"ontouchstart\" in win) || ((\"msMaxTouchPoints\" in nav) && (nav.msMaxTouchPoints > 0)));"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process === 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"anim-shape-transform\": [\"anim-shape\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-date\",\"datatype-number\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\",\"datatype-date-math\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\",\"event-tap\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.3', {\"use\": [\"yui-base\", \"get\", \"features\", \"intl-base\", \"yui-log\", \"yui-log-nodejs\", \"yui-later\", \"loader-base\", \"loader-rollup\", \"loader-yui3\"]});"]; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and@@ -42,9 +42,9 @@ * @submodule yui-base */ -_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3556":0,"3559":0,"3561":0,"3563":0,"3564":0,"3565":0,"3566":0,"3567":0,"3568":0,"3569":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3578":0,"3579":0,"3581":0,"3582":0,"3584":0,"3585":0,"3588":0,"3589":0,"3590":0,"3591":0,"3593":0,"3594":0,"3595":0,"3596":0,"3601":0,"3602":0,"3604":0,"3605":0,"3606":0,"3608":0,"3609":0,"3610":0,"3612":0,"3613":0,"3614":0,"3617":0,"3618":0,"3620":0,"3622":0,"3623":0,"3624":0,"3625":0,"3626":0,"3629":0,"3630":0,"3631":0,"3633":0,"3634":0,"3635":0,"3639":0,"3640":0,"3641":0,"3642":0,"3644":0,"3645":0,"3646":0,"3648":0,"3649":0,"3654":0,"3655":0,"3656":0,"3657":0,"3658":0,"3659":0,"3662":0,"3663":0,"3664":0,"3669":0,"3671":0,"3672":0,"3673":0,"3674":0,"3676":0,"3677":0,"3678":0,"3681":0,"3682":0,"3683":0,"3684":0,"3685":0,"3688":0,"3690":0,"3691":0,"3694":0,"3695":0,"3696":0,"3698":0,"3699":0,"3700":0,"3701":0,"3702":0,"3703":0,"3712":0,"3714":0,"3716":0,"3718":0,"3719":0,"3723":0,"3727":0,"3731":0,"3753":0,"3754":0,"3756":0,"3757":0,"3760":0,"3761":0,"3763":0,"3764":0,"3765":0,"3767":0,"3768":0,"3770":0,"3771":0,"3774":0,"3775":0,"3779":0,"3781":0};-_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3753":0,"(anonymous 8):1950":0};-_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].coveredLines = 822;+_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3563":0,"3566":0,"3568":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3575":0,"3576":0,"3577":0,"3578":0,"3579":0,"3580":0,"3581":0,"3585":0,"3586":0,"3588":0,"3589":0,"3591":0,"3592":0,"3595":0,"3596":0,"3597":0,"3598":0,"3600":0,"3601":0,"3602":0,"3603":0,"3608":0,"3609":0,"3611":0,"3612":0,"3613":0,"3615":0,"3616":0,"3617":0,"3619":0,"3620":0,"3621":0,"3624":0,"3625":0,"3627":0,"3629":0,"3630":0,"3631":0,"3632":0,"3633":0,"3636":0,"3637":0,"3638":0,"3640":0,"3641":0,"3642":0,"3646":0,"3647":0,"3648":0,"3649":0,"3651":0,"3652":0,"3653":0,"3655":0,"3656":0,"3661":0,"3662":0,"3663":0,"3664":0,"3665":0,"3666":0,"3669":0,"3670":0,"3671":0,"3676":0,"3678":0,"3679":0,"3680":0,"3681":0,"3683":0,"3684":0,"3685":0,"3688":0,"3689":0,"3690":0,"3691":0,"3692":0,"3695":0,"3697":0,"3698":0,"3701":0,"3702":0,"3703":0,"3705":0,"3706":0,"3707":0,"3708":0,"3709":0,"3710":0,"3720":0,"3721":0,"3725":0,"3727":0,"3729":0,"3731":0,"3732":0,"3736":0,"3740":0,"3744":0,"3766":0,"3767":0,"3769":0,"3770":0,"3773":0,"3774":0,"3776":0,"3777":0,"3778":0,"3780":0,"3781":0,"3783":0,"3784":0,"3787":0,"3788":0,"3792":0,"3794":0};+_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3766":0,"(anonymous 8):1950":0};+_yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].coveredLines = 824; _yuitest_coverage["build/yui-nodejs/yui-nodejs.js"].coveredFunctions = 98; _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 10); if (typeof YUI != 'undefined') {@@ -217,7 +217,7 @@ _yuitest_coverfunc("build/yui-nodejs/yui-nodejs.js", "(anonymous 1)", 153); _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 155); var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -3221,11 +3221,11 @@ if (Lang.isObject(obj)) { _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 2556); try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug). _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 2560);-if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 2561); result = 2; }@@ -4161,7 +4161,7 @@ return parseFloat(s.replace(/\./g, function() { _yuitest_coverfunc("build/yui-nodejs/yui-nodejs.js", "(anonymous 22)", 3328); _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3329);-return (c++ == 1) ? '' : '.';+return (c++ === 1) ? '' : '.'; })); }, @@ -4276,13 +4276,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -4371,7 +4364,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -4388,250 +4395,250 @@ * @type String * @static */- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3556);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3563); o.userAgent = ua; - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3559);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3566); o.secure = href && (href.toLowerCase().indexOf('https') === 0); - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3561);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3568); if (ua) { - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3563);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3570); if ((/windows|win32/i).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3564);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3571); o.os = 'windows';- } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3565);+ } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3572); if ((/macintosh|mac_powerpc/i).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3566);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3573); o.os = 'macintosh';- } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3567);+ } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3574); if ((/android/i).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3568);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3575); o.os = 'android';- } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3569);+ } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3576); if ((/symbos/i).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3570);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3577); o.os = 'symbos';- } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3571);+ } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3578); if ((/linux/i).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3572);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3579); o.os = 'linux';- } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3573);+ } else {_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3580); if ((/rhino/i).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3574);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3581); o.os = 'rhino'; }}}}}} // Modern KHTML browsers should qualify as Safari X-Grade- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3578);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3585); if ((/KHTML/).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3579);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3586); o.webkit = 1; }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3581);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3588); if ((/IEMobile|XBLWP7/).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3582);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3589); o.mobile = 'windows'; }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3584);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3591); if ((/Fennec/).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3585);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3592); o.mobile = 'gecko'; } // Modern WebKit browsers are at least X-Grade- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3588);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3595); m = ua.match(/AppleWebKit\/([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3589);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3596); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3590);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3597); o.webkit = numberify(m[1]);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3591);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3598); o.safari = o.webkit;- - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3593);++ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3600); if (/PhantomJS/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3594);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3601); m = ua.match(/PhantomJS\/([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3595);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3602); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3596);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3603); o.phantomjs = numberify(m[1]); } } // Mobile browser check- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3601);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3608); if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3602);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3609); o.mobile = 'Apple'; // iPhone or iPod Touch - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3604);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3611); m = ua.match(/OS ([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3605);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3612); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3606);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3613); m = numberify(m[1].replace('_', '.')); }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3608);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3615); o.ios = m;- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3609);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3616); o.os = 'ios';- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3610);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3617); o.ipad = o.ipod = o.iphone = 0; - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3612);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3619); m = ua.match(/iPad|iPod|iPhone/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3613);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3620); if (m && m[0]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3614);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3621); o[m[0].toLowerCase()] = o.ios; } } else {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3617);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3624); m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3618);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3625); if (m) { // Nokia N-series, webOS, ex: NokiaN95- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3620);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3627); o.mobile = m[0]; }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3622);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3629); if (/webOS/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3623);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3630); o.mobile = 'WebOS';- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3624);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3631); m = ua.match(/webOS\/([^\s]*);/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3625);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3632); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3626);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3633); o.webos = numberify(m[1]); } }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3629);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3636); if (/ Android/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3630);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3637); if (/Mobile/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3631);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3638); o.mobile = 'Android'; }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3633);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3640); m = ua.match(/Android ([^\s]*);/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3634);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3641); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3635);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3642); o.android = numberify(m[1]); } }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3639);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3646); if (/Silk/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3640);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3647); m = ua.match(/Silk\/([^\s]*)\)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3641);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3648); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3642);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3649); o.silk = numberify(m[1]); }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3644);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3651); if (!o.android) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3645);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3652); o.android = 2.34; //Hack for desktop mode in Kindle- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3646);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3653); o.os = 'Android'; }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3648);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3655); if (/Accelerated=true/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3649);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3656); o.accel = true; } } } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3654);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3661); m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3655);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3662); if (m && m[1] && m[2]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3656);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3663); o.chrome = numberify(m[2]); // Chrome- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3657);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3664); o.safari = 0; //Reset safari back to 0- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3658);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3665); if (m[1] === 'CrMo') {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3659);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3666); o.mobile = 'chrome'; } } else {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3662);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3669); m = ua.match(/AdobeAIR\/([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3663);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3670); if (m) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3664);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3671); o.air = m[0]; // Adobe AIR 1.0 or better } } } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3669);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3676); if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3671);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3678); if (/Opera/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3672);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3679); m = ua.match(/Opera[\s\/]([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3673);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3680); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3674);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3681); o.opera = numberify(m[1]); }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3676);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3683); m = ua.match(/Version\/([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3677);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3684); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3678);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3685); o.opera = numberify(m[1]); // opera 10+ } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3681);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3688); if (/Opera Mobi/.test(ua)) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3682);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3689); o.mobile = 'opera';- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3683);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3690); m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3684);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3691); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3685);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3692); o.opera = numberify(m[1]); } }- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3688);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3695); m = ua.match(/Opera Mini[^;]*/); - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3690);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3697); if (m) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3691);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3698); o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3694);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3701); m = ua.match(/MSIE\s([^;]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3695);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3702); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3696);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3703); o.ie = numberify(m[1]); } else { // not opera, webkit, or ie- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3698);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3705); m = ua.match(/Gecko\/([^\s]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3699);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3706); if (m) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3700);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3707); o.gecko = 1; // Gecko detected, look for revision- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3701);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3708); m = ua.match(/rv:([^\s\)]*)/);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3702);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3709); if (m && m[1]) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3703);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3710); o.gecko = numberify(m[1]); } }@@ -4640,34 +4647,42 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3720);+if (win && nav && !(o.chrome && o.chrome < 6)) {+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3721);+o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value.- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3712);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3725); if (!subUA) { - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3714);-if (typeof process == 'object') {+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3727);+if (typeof process === 'object') { - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3716);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3729); if (process.versions && process.versions.node) { //NodeJS- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3718);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3731); o.os = process.platform;- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3719);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3732); o.nodejs = numberify(process.versions.node); } } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3723);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3736); YUI.Env.UA = o; } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3727);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3740); return o; }; -_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3731);+_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3744); Y.UA = YUI.Env.UA || YUI.Env.parseUA(); /**@@ -4690,54 +4705,55 @@ @return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is higher than _b_. **/-_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3753);+_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3766); Y.UA.compareVersions = function (a, b) {- _yuitest_coverfunc("build/yui-nodejs/yui-nodejs.js", "compareVersions", 3753);-_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3754);+ _yuitest_coverfunc("build/yui-nodejs/yui-nodejs.js", "compareVersions", 3766);+_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3767); var aPart, aParts, bPart, bParts, i, len; - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3756);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3769); if (a === b) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3757);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3770); return 0; } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3760);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3773); aParts = (a + '').split('.');- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3761);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3774); bParts = (b + '').split('.'); - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3763);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3776); for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3764);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3777); aPart = parseInt(aParts[i], 10);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3765);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3778); bPart = parseInt(bParts[i], 10); - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3767);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3780); isNaN(aPart) && (aPart = 0);- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3768);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3781); isNaN(bPart) && (bPart = 0); - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3770);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3783); if (aPart < bPart) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3771);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3784); return -1; } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3774);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3787); if (aPart > bPart) {- _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3775);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3788); return 1; } } - _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3779);+ _yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3792); return 0; };-_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3781);+_yuitest_coverline("build/yui-nodejs/yui-nodejs.js", 3794); YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -4749,14 +4765,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -4776,4 +4792,4 @@ }; -}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});
bundle/yui-nodejs/yui-nodejs-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2579,10 +2579,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3351,7 +3351,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3466,13 +3466,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3561,7 +3554,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3614,7 +3621,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3733,10 +3740,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3805,6 +3818,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3816,14 +3830,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3843,7 +3857,7 @@ }; -}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]}); YUI.add('get', function (Y, NAME) { /**@@ -4047,7 +4061,7 @@ -}, '3.7.2');+}, '3.7.3'); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -4173,7 +4187,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -4202,10 +4216,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -4367,8 +4379,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -4380,8 +4392,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -4469,7 +4495,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -4579,7 +4605,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log-nodejs', function (Y, NAME) { var sys = require(process.binding('natives').util ? 'util' : 'sys'),@@ -4659,7 +4685,7 @@ -}, '3.7.2');+}, '3.7.3'); YUI.add('yui-later', function (Y, NAME) { /**@@ -4736,7 +4762,7 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('loader-base', function (Y, NAME) { /**@@ -4752,7 +4778,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -4774,7 +4800,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -4837,7 +4863,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -4865,14 +4891,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -4915,7 +4940,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -4946,7 +4971,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -5072,7 +5097,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -5224,7 +5249,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -5262,7 +5287,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -5276,14 +5301,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -5395,15 +5420,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -5440,7 +5467,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -5491,7 +5518,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -5557,13 +5584,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -5576,15 +5603,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -5594,7 +5623,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { // Y.log('group: ' + j);@@ -5611,7 +5640,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -5624,9 +5653,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -5642,16 +5671,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -5666,14 +5694,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -5850,7 +5871,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -5873,7 +5900,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { Y.log('Auto determined module type as CSS', 'warn', 'loader'); o.type = CSS;@@ -5888,16 +5915,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -5930,13 +5953,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -5987,7 +6010,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -5998,7 +6021,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -6006,7 +6029,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -6038,8 +6061,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -6079,15 +6102,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -6101,7 +6124,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -6133,15 +6156,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -6234,7 +6257,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -6254,7 +6277,7 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); @@ -6262,8 +6285,8 @@ //Y.log('Already expanded ' + name + ', ' + mod.expanded); return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -6353,7 +6376,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -6433,7 +6456,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -6456,7 +6479,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { //Y.log('isCSSLoaded was cached for ' + name, 'warn', 'loader'); return mod;@@ -6501,7 +6524,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -6609,8 +6632,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -6636,7 +6659,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -6680,30 +6703,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -6745,7 +6768,7 @@ if (patterns.hasOwnProperty(pname)) { // Y.log('testing pattern ' + i); p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -6803,7 +6826,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -6811,7 +6834,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -6863,7 +6886,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -6871,11 +6894,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -6924,7 +6947,7 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); }@@ -6932,7 +6955,7 @@ msg = msg.join(','); Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');- + if (f) { f.call(this.context, { msg: msg,@@ -6940,7 +6963,7 @@ success: false }); }- + this._finish(msg, false); },@@ -7055,13 +7078,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -7081,7 +7101,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -7096,7 +7116,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -7163,8 +7183,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.log('Loading CSS modules', 'info', 'loader'); Y.Get.css(modules.css, {@@ -7266,7 +7286,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { Y.log('loadNext was called..', 'error', 'loader'); return; },@@ -7335,15 +7355,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -7352,11 +7372,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -7364,7 +7384,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -7379,7 +7399,7 @@ } else { Y.log('Undefined Module', 'warn', 'loader'); }- + }; len = s.length;@@ -7400,7 +7420,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -7417,7 +7436,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -7433,7 +7451,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -7453,7 +7471,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -7480,7 +7497,7 @@ Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader'); maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');@@ -7543,7 +7560,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -7556,7 +7573,7 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /**@@ -7626,7 +7643,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; // Y.log("adding to thresh: " + c + ", " + s[j]); roll = (c >= m.rollup);@@ -7658,7 +7675,7 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by src/loader/scripts/meta_join.js */@@ -7781,7 +7798,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -8345,6 +8362,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -8669,10 +8687,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -9892,7 +9908,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -9938,8 +9955,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -10131,6 +10148,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -10149,8 +10182,8 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"requires": ["loader-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});
bundle/yui-nodejs/yui-nodejs-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.2",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-log-nodejs","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&!e.alert&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++==1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.2",{use:["yui-base","get","features","intl-base","yui-log","yui-log-nodejs","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(e,t){var n=require("path"),r=require("vm"),i=require("fs"),s=require("request"),o=i.existsSync||n.existsSync;e.Get=function(){},e.config.base=n.join(__dirname,"../"),YUI.require=require,YUI.process=process;var u=function(e){return e.replace(/\\/g,"\\\\")};e.Get._exec=function(e,t,i){var s=u(n.dirname(t)),o=u(t);s.match(/^https?:\/\//)&&(s=".",o="remoteResource");var a="(function(YUI) { var __dirname = '"+s+"'; "+"var __filename = '"+o+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+e+" ;return YUI; })",f=r.createScript(a,t),l=f.runInThisContext(a);YUI=l(YUI),i(null,t)},e.Get._include=function(t,n){var r=this;if(t.match(/^https?:\/\//)){var u={url:t,timeout:r.timeout};s(u,function(r,i,s){r?n(r,t):e.Get._exec(s,t,n)})}else if(e.config.useSync)if(o(t)){var a=i.readFileSync(t,"utf8");e.Get._exec(a,t,n)}else n("Path does not exist: "+t,t);else i.readFile(t,"utf8",function(r,i){r?n(r,t):e.Get._exec(i,t,n)})};var a=function(t,n,r){e.Lang.isFunction(t.onEnd)&&t.onEnd.call(e,n,r)},f=function(t){e.Lang.isFunction(t.onSuccess)&&t.onSuccess.call(e,t),a(t,"success","success")},l=function(t,n){n.errors=[n],e.Lang.isFunction(t.onFailure)&&t.onFailure.call(e,n,t),a(t,n,"fail")};e.Get.js=function(t,n){var r=e.Array,i=this,s=r(t),o,u,a=s.length,c=0,h=function(){c===a&&f(n)};for(u=0;u<a;u++)o=s[u],e.Lang.isObject(o)&&(o=o.url),o=o.replace(/'/g,"%27"),e.Get._include(o,function(t,r){e.config||(e.config={debug:!0}),n.onProgress&&n.onProgress.call(n.context||e,r),t?l(n,t):(c++,h())})},e.Get.script=e.Get.js,e.Get.css=function(e,t){f(t)}},"3.7.2"),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"})},"3.7.2",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-log-nodejs",function(e,t){var n=require(process.binding("natives").util?"util":"sys"),r=!1;try{var i=require("stdio");r=i.isStderrATTY()}catch(s){r=!0}e.config.useColor=r,e.consoleColor=function(e,t){return this.config.useColor?(t||(t="32"),"["+t+"m"+e+"[0m"):e};var o=function(e,t,r){var i="";this.id&&(i="["+this.id+"]:"),t=t||"info",r=r?this.consoleColor(" ("+r.toLowerCase()+"):",35):"",e===null&&(e="null");if(typeof e=="object"||e instanceof Array)try{e.tagName||e._yuid||e._query?e=e.toString():e=n.inspect(e)}catch(s){}var o="37;40",u=e?"":31;t+="";switch(t.toLowerCase()){case"error":o=u=31;break;case"warn":o=33;break;case"debug":o=34}typeof e=="string"&&e&&e.indexOf("\n")!==-1&&(e="\n"+e),n.error(this.consoleColor(t.toLowerCase()+":",o)+r+" "+this.consoleColor(e,u))};e.config.logFn||(e.config.logFn=o)},"3.7.2"),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.2",{requires:["yui-base"]}),YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.09.19-20-07",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S,x=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){var r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null;s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!=r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type==u&&!f.ext&&f.type==u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n=="require")f.require(i);else if(n=="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n=="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n=="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n=="gallery"?this.groups.gallery.update(i,t):n=="yui2"||n=="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o=="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName=="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){var l=[];for(n=0;n<f.coverage.length;n++){var c=f.coverage[n];f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c)}f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}f.lang},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t}),this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;if(!t.type){t.type=a;var r=t.path||t.fullpath;r&&this.REGEX_CSS.test(r)&&(t.type=u)}!t.path&&!t.fullpath&&(t.path=x(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0;var i=t.submodules,o,f,l,c,p,d,m,g,y,b,w,E,S,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(o=0;o<this.requires.length;o++)t.requires.push(this.requires[o]);if(t.group&&this.groups&&this.groups[t.group]){O=this.groups[t.group];if(O.requires)for(o=0;o<O.requires.length;o++)t.requires.push(O.requires[o])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(L=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(L)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){b=v(t.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w))}if(i){c=t.supersedes||[],f=0;for(o in i)if(i.hasOwnProperty(o)){p=i[o],p.path=p.path||x(n,o,t.type),p.pkg=n,p.group=t.group,p.supersedes&&(c=c.concat(p.supersedes)),d=this.addModule(p,o),c.push(o);if(d.skinnable){t.skinnable=!0,k=this.skin.overrides;if(k&&k[o])for(y=0;y<k[o].length;y++)L=this._addSkin(k[o][y],o,n),c.push(L);L=this._addSkin(this.skin.defaultSkin,o,n),c.push(L)}if(p.lang&&p.lang.length){b=v(p.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),E=this.getLangPackName(N,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),S=S||v.hash(d.supersedes),E in S||d.supersedes.push(E),t.lang=t.lang||[],T=T||v.hash(t.lang),N in T||t.lang.push(N),w=this.getLangPackName(h,n),E=this.getLangPackName(h,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),E in S||d.supersedes.push(E)}f++}t.supersedes=v.dedupe(c),this.allowRollup&&(t.rollup=f<4?f:Math.min(f-1,4))}m=t.plugins;if(m)for(o in m)m.hasOwnProperty(o)&&(g=m[o],g.pkg=n,g.path=g.path||x(n,o,t.type),g.requires=g.requires||[],g.group=t.group,this.addModule(g,o),t.skinnable&&this._addSkin(this.skin.defaultSkin,o,n));if(t.condition){l=t.condition.trigger,YUI.Env.aliases[l]&&(l=YUI.Env.aliases[l]),e.Lang.isArray(l)||(l=[l]);for(o=0;o<l.length;o++)_=l[o],A=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,A&&A!="after"?A=="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(C=t.configFn(t),C===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A,O,M=t.lang||t.intl,_=this.moduleInfo,D=e.Features&&e.Features.tests.load,P,H;t.temp&&g&&(N=t,t=this.addModule(g,c),t.group=N.group,t.pkg=N.pkg,delete t.expanded),H=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!H)return t.expanded;y=[],P={},T=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),T.unshift("intl"),M=!0),C=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<T.length;n++)if(!P[T[n]]){y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}T=this.filterRequires(t.supersedes);if(T)for(n=0;n<T.length;n++)if(!P[T[n]]){t.submodules&&y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(C&&this.loadOptional)for(n=0;n<C.length;n++)if(!P[C[n]]){y.push(C[n]),P[C[n]]=!0,i=_[C[n]];if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&D)d(l,function(e,t){var n=D[t].name;!P[n]&&D[t].trigger==c&&e&&D[t]&&(P[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!P[n]){x=m[n],S=x&&(!x.ua&&!x.test||x.ua&&e.UA[x.ua]||x.test&&x.test(e,T));if(S){P[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){L=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(A=n);if(L&&(L[c]||A&&L[A])){O=c,L[A]&&(O=A);for(n=0;n<L[O].length;n++)k=this._addSkin(L[O][n],c),this.isCSSLoaded(k,this._boot)||y.push(k)}else k=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(k,this._boot)||y.push(k)}return t._parsed=!1,M&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=x(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)if(t.hasOwnProperty(o)&&!i[o]){i[o]=!0,n=s.getModule(o);if(n){var u=n.expound;u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r))}}},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!=s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!=a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t),!i;var s=this.resolve(!i),o=this,f=0,l=0,c={},h;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++;var p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}};this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(e){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S,x,T,N=[],C,k,A={},O=this,M,_,D=[],P=O.ignoreRegistered?{}:O.inserted,H={js:[],jsMods:[],css:[],cssMods:[]},B=O.loadType||"js";(O.skin.overrides||O.skin.defaultSkin!==l||O.ignoreRegistered)&&O._resetModules(),e&&O.calculate(),t=t||O.sorted;var j=function(e){if(e){d=e.group&&O.groups[e.group]||n,d.async===!1&&(e.async=d.async),f=e.fullpath?O._filter(e.fullpath,t[s]):O._url(e.path,t[s],d.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);H[e.type].push(f),H[e.type+"Mods"].push(e)}};r=t.length,S=O.comboBase,f=S,w={};for(s=0;s<r;s++){y=S,o=O.getModule(t[s]),v=o&&o.group,d=O.groups[v];if(v&&d){if(!d.combine||o.fullpath){j(o);continue}o.combine=!0,d.comboBase&&(y=d.comboBase),"root"in d&&b.isValue(d.root)&&(o.root=d.root),o.comboSep=d.comboSep||O.comboSep,o.maxURLLength=d.maxURLLength||O.maxURLLength}else if(!O.combine){j(o);continue}w[y]=w[y]||[],w[y].push(o)}for(m in w)if(w.hasOwnProperty(m)){A[m]=A[m]||{js:[],jsMods:[],css:[],cssMods:[]},f=m,E=w[m],r=E.length;if(r)for(s=0;s<r;s++){if(P[E[s]])continue;o=E[s],o&&(o.combine||!o.ext)?(A[m].comboSep=o.comboSep,A[m].group=o.group,A[m].maxURLLength=o.maxURLLength,g=(b.isValue(o.root)?o.root:O.root)+(o.path||o.fullpath),g=O._filter(g,o.name),A[m][o.type].push(g),A[m][o.type+"Mods"].push(o)):E[s]&&j(E[s])}}for(m in A){x=m,M=A[x].comboSep||O.comboSep,_=A[x].maxURLLength||O.maxURLLength;for(B in A[x])if(B===a||B===u){T=A[x][B],E=A[x][B+"Mods"],r=T.length,C=x+T.join(M),k=C.length,_<=x.length&&(_=i);if(r)if(k>_){N=[];for(t=0;t<r;t++)N.push(T[t]),C=x+N.join(M),C.length>_&&(o=N.pop(),C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)),N=[],o&&N.push(o));N.length&&(C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)))}else H[B].push(O._filter(C,null,A[x].group));H[B+"Mods"]=H[B+"Mods"].concat(E)}}return A=null,H},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.2",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type==f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.2",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="5fe7d71505fef8108b090c35db73bcde"},"3.7.2",{requires:["loader-base"]}),YUI.add("yui",function(e,t){},"3.7.2",{use:["get","features","intl-base","yui-log","yui-log-nodejs","yui-later","loader-base","loader-rollup","loader-yui3"]});+typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.3",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-log-nodejs","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&(!e.scrollTo||!e.document)&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++===1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0,winjs:typeof Windows!="undefined"&&!!Windows.System,touchEnabled:!1},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),r&&i&&!(s.chrome&&s.chrome<6)&&(s.touchEnabled="ontouchstart"in r||"msMaxTouchPoints"in i&&i.msMaxTouchPoints>0),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.3",{use:["yui-base","get","features","intl-base","yui-log","yui-log-nodejs","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(e,t){var n=require("path"),r=require("vm"),i=require("fs"),s=require("request"),o=i.existsSync||n.existsSync;e.Get=function(){},e.config.base=n.join(__dirname,"../"),YUI.require=require,YUI.process=process;var u=function(e){return e.replace(/\\/g,"\\\\")};e.Get._exec=function(e,t,i){var s=u(n.dirname(t)),o=u(t);s.match(/^https?:\/\//)&&(s=".",o="remoteResource");var a="(function(YUI) { var __dirname = '"+s+"'; "+"var __filename = '"+o+"'; "+"var process = YUI.process;"+"var require = function(file) {"+" if (file.indexOf('./') === 0) {"+" file = __dirname + file.replace('./', '/'); }"+" return YUI.require(file); }; "+e+" ;return YUI; })",f=r.createScript(a,t),l=f.runInThisContext(a);YUI=l(YUI),i(null,t)},e.Get._include=function(t,n){var r=this;if(t.match(/^https?:\/\//)){var u={url:t,timeout:r.timeout};s(u,function(r,i,s){r?n(r,t):e.Get._exec(s,t,n)})}else if(e.config.useSync)if(o(t)){var a=i.readFileSync(t,"utf8");e.Get._exec(a,t,n)}else n("Path does not exist: "+t,t);else i.readFile(t,"utf8",function(r,i){r?n(r,t):e.Get._exec(i,t,n)})};var a=function(t,n,r){e.Lang.isFunction(t.onEnd)&&t.onEnd.call(e,n,r)},f=function(t){e.Lang.isFunction(t.onSuccess)&&t.onSuccess.call(e,t),a(t,"success","success")},l=function(t,n){n.errors=[n],e.Lang.isFunction(t.onFailure)&&t.onFailure.call(e,n,t),a(t,n,"fail")};e.Get.js=function(t,n){var r=e.Array,i=this,s=r(t),o,u,a=s.length,c=0,h=function(){c===a&&f(n)};for(u=0;u<a;u++)o=s[u],e.Lang.isObject(o)&&(o=o.url),o=o.replace(/'/g,"%27"),e.Get._include(o,function(t,r){e.config||(e.config={debug:!0}),n.onProgress&&n.onProgress.call(n.context||e,r),t?l(n,t):(c++,h())})},e.Get.script=e.Get.js,e.Get.css=function(e,t){f(t)}},"3.7.3"),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","18",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","19",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.7.3",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-log-nodejs",function(e,t){var n=require(process.binding("natives").util?"util":"sys"),r=!1;try{var i=require("stdio");r=i.isStderrATTY()}catch(s){r=!0}e.config.useColor=r,e.consoleColor=function(e,t){return this.config.useColor?(t||(t="32"),"["+t+"m"+e+"[0m"):e};var o=function(e,t,r){var i="";this.id&&(i="["+this.id+"]:"),t=t||"info",r=r?this.consoleColor(" ("+r.toLowerCase()+"):",35):"",e===null&&(e="null");if(typeof e=="object"||e instanceof Array)try{e.tagName||e._yuid||e._query?e=e.toString():e=n.inspect(e)}catch(s){}var o="37;40",u=e?"":31;t+="";switch(t.toLowerCase()){case"error":o=u=31;break;case"warn":o=33;break;case"debug":o=34}typeof e=="string"&&e&&e.indexOf("\n")!==-1&&(e="\n"+e),n.error(this.consoleColor(t.toLowerCase()+":",o)+r+" "+this.consoleColor(e,u))};e.config.logFn||(e.config.logFn=o)},"3.7.3"),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.3",{requires:["yui-base"]}),YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.10.10-19-59",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n,r,i,s;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null,s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!==r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type===u&&!f.ext&&f.type===u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this,l=[],c;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n==="require")f.require(i);else if(n==="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n==="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n==="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n==="gallery"?this.groups.gallery.update(i,t):n==="yui2"||n==="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o==="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName==="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){for(n=0;n<f.coverage.length;n++)c=f.coverage[n],f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c);f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t});var r,i,o,f,l,c,p,d,m,g,y,b,w,E,x,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;t.type||(t.type=a,O=t.path||t.fullpath,O&&this.REGEX_CSS.test(O)&&(t.type=u)),!t.path&&!t.fullpath&&(t.path=S(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0,r=t.submodules,this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(i=0;i<this.requires.length;i++)t.requires.push(this.requires[i]);if(t.group&&this.groups&&this.groups[t.group]){A=this.groups[t.group];if(A.requires)for(i=0;i<A.requires.length;i++)t.requires.push(A.requires[i])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(k=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(k)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){y=v(t.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b))}if(r){l=t.supersedes||[],o=0;for(i in r)if(r.hasOwnProperty(i)){c=r[i],c.path=c.path||S(n,i,t.type),c.pkg=n,c.group=t.group,c.supersedes&&(l=l.concat(c.supersedes)),p=this.addModule(c,i),l.push(i);if(p.skinnable){t.skinnable=!0,C=this.skin.overrides;if(C&&C[i])for(g=0;g<C[i].length;g++)k=this._addSkin(C[i][g],i,n),l.push(k);k=this._addSkin(this.skin.defaultSkin,i,n),l.push(k)}if(c.lang&&c.lang.length){y=v(c.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),w=this.getLangPackName(T,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),E=E||v.hash(p.supersedes),w in E||p.supersedes.push(w),t.lang=t.lang||[],x=x||v.hash(t.lang),T in x||t.lang.push(T),b=this.getLangPackName(h,n),w=this.getLangPackName(h,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),w in E||p.supersedes.push(w)}o++}t.supersedes=v.dedupe(l),this.allowRollup&&(t.rollup=o<4?o:Math.min(o-1,4))}d=t.plugins;if(d)for(i in d)d.hasOwnProperty(i)&&(m=d[i],m.pkg=n,m.path=m.path||S(n,i,t.type),m.requires=m.requires||[],m.group=t.group,this.addModule(m,i),t.skinnable&&this._addSkin(this.skin.defaultSkin,i,n));if(t.condition){f=t.condition.trigger,YUI.Env.aliases[f]&&(f=YUI.Env.aliases[f]),e.Lang.isArray(f)||(f=[f]);for(i=0;i<f.length;i++)_=f[i],L=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,L&&L!=="after"?L==="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(N=t.configFn(t),N===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A=t.lang||t.intl,O=this.moduleInfo,M=e.Features&&e.Features.tests.load,_,D;t.temp&&g&&(x=t,t=this.addModule(g,c),t.group=x.group,t.pkg=x.pkg,delete t.expanded),D=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!D)return t.expanded;y=[],_={},S=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),S.unshift("intl"),A=!0),T=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<S.length;n++)if(!_[S[n]]){y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}S=this.filterRequires(t.supersedes);if(S)for(n=0;n<S.length;n++)if(!_[S[n]]){t.submodules&&y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(T&&this.loadOptional)for(n=0;n<T.length;n++)if(!_[T[n]]){y.push(T[n]),_[T[n]]=!0,i=O[T[n]];if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&M)d(l,function(e,t){var n=M[t].name;!_[n]&&M[t].trigger===c&&e&&M[t]&&(_[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!_[n]){E=m[n],b=E&&(!E.ua&&!E.test||E.ua&&e.UA[E.ua]||E.test&&E.test(e,S));if(b){_[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){C=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(k=n);if(C&&(C[c]||k&&C[k])){L=c,C[k]&&(L=k);for(n=0;n<C[L].length;n++)N=this._addSkin(C[L][n],c),this.isCSSLoaded(N,this._boot)||y.push(N)}else N=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(N,this._boot)||y.push(N)}return t._parsed=!1,A&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=S(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o,u;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)t.hasOwnProperty(o)&&(i[o]||(i[o]=!0,n=s.getModule(o),n&&(u=n.expound,u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r)))))},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!==s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!==a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t);var s=this.resolve(!i),o=this,f=0,l=0,c={},h,p;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++,p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}},this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S=[],x,T,N={},C=this,k,A,O=C.ignoreRegistered?{}:C.inserted,M={js:[],jsMods:[],css:[],cssMods:[]},_=C.loadType||"js",D;(C.skin.overrides||C.skin.defaultSkin!==l||C.ignoreRegistered)&&C._resetModules(),e&&C.calculate(),t=t||C.sorted,D=function(e){if(e){c=e.group&&C.groups[e.group]||n,c.async===!1&&(e.async=c.async),f=e.fullpath?C._filter(e.fullpath,t[s]):C._url(e.path,t[s],c.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);M[e.type].push(f),M[e.type+"Mods"].push(e)}},r=t.length,y=C.comboBase,f=y,m={};for(s=0;s<r;s++){v=y,o=C.getModule(t[s]),h=o&&o.group,c=C.groups[h];if(h&&c){if(!c.combine||o.fullpath){D(o);continue}o.combine=!0,c.comboBase&&(v=c.comboBase),"root"in c&&b.isValue(c.root)&&(o.root=c.root),o.comboSep=c.comboSep||C.comboSep,o.maxURLLength=c.maxURLLength||C.maxURLLength}else if(!C.combine){D(o);continue}m[v]=m[v]||[],m[v].push(o)}for(p in m)if(m.hasOwnProperty(p)){N[p]=N[p]||{js:[],jsMods:[],css:[],cssMods:[]},f=p,g=m[p],r=g.length;if(r)for(s=0;s<r;s++){if(O[g[s]])continue;o=g[s],o&&(o.combine||!o.ext)?(N[p].comboSep=o.comboSep,N[p].group=o.group,N[p].maxURLLength=o.maxURLLength,d=(b.isValue(o.root)?o.root:C.root)+(o.path||o.fullpath),d=C._filter(d,o.name),N[p][o.type].push(d),N[p][o.type+"Mods"].push(o)):g[s]&&D(g[s])}}for(p in N){w=p,k=N[w].comboSep||C.comboSep,A=N[w].maxURLLength||C.maxURLLength;for(_ in N[w])if(_===a||_===u){E=N[w][_],g=N[w][_+"Mods"],r=E.length,x=w+E.join(k),T=x.length,A<=w.length&&(A=i);if(r)if(T>A){S=[];for(t=0;t<r;t++)S.push(E[t]),x=w+S.join(k),x.length>A&&(o=S.pop(),x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)),S=[],o&&S.push(o));S.length&&(x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)))}else M[_].push(C._filter(x,null,N[w].group));M[_+"Mods"]=M[_+"Mods"].concat(g)}}return N=null,M},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.3",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type===f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.3",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"}},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="a28e022ad022130f7a4fb4ac77a2f1df"},"3.7.3",{requires:["loader-base"]}),YUI.add("yui",function(e,t){},"3.7.3",{use:["get","features","intl-base","yui-log","yui-log-nodejs","yui-later","loader-base","loader-rollup","loader-yui3"]});
bundle/yui-nodejs/yui-nodejs.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2560,10 +2560,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3332,7 +3332,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3447,13 +3447,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3542,7 +3535,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3595,7 +3602,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3714,10 +3721,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3786,6 +3799,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3797,14 +3811,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3824,7 +3838,7 @@ }; -}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]}); YUI.add('get', function (Y, NAME) { /**@@ -4018,7 +4032,7 @@ -}, '3.7.2');+}, '3.7.3'); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -4143,7 +4157,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -4172,10 +4186,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -4337,8 +4349,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -4350,8 +4362,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -4439,7 +4465,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -4549,7 +4575,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log-nodejs', function (Y, NAME) { var sys = require(process.binding('natives').util ? 'util' : 'sys'),@@ -4629,7 +4655,7 @@ -}, '3.7.2');+}, '3.7.3'); YUI.add('yui-later', function (Y, NAME) { /**@@ -4706,7 +4732,7 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('loader-base', function (Y, NAME) { /**@@ -4722,7 +4748,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -4744,7 +4770,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -4807,7 +4833,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -4835,14 +4861,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -4885,7 +4910,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -4916,7 +4941,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -5042,7 +5067,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -5194,7 +5219,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -5232,7 +5257,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -5246,14 +5271,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -5365,15 +5390,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -5410,7 +5437,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -5460,7 +5487,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -5526,13 +5553,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -5545,15 +5572,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -5563,7 +5592,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { groupName = j;@@ -5579,7 +5608,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -5592,9 +5621,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -5610,16 +5639,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -5634,14 +5662,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -5817,7 +5838,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -5840,7 +5867,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { o.type = CSS; }@@ -5854,16 +5881,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -5896,13 +5919,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -5953,7 +5976,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -5964,7 +5987,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -5972,7 +5995,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -6002,8 +6025,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -6043,15 +6066,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -6065,7 +6088,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -6096,15 +6119,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -6197,7 +6220,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -6217,15 +6240,15 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); if (mod.expanded && !reparse) { return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -6312,7 +6335,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -6391,7 +6414,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -6413,7 +6436,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { return mod; }@@ -6456,7 +6479,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -6564,8 +6587,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -6591,7 +6614,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -6635,30 +6658,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -6697,7 +6720,7 @@ for (pname in patterns) { if (patterns.hasOwnProperty(pname)) { p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -6752,7 +6775,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -6760,7 +6783,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -6810,7 +6833,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -6818,11 +6841,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -6871,14 +6894,14 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); } msg = msg.join(','); - + if (f) { f.call(this.context, { msg: msg,@@ -6886,7 +6909,7 @@ success: false }); }- + this._finish(msg, false); },@@ -6999,13 +7022,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -7025,7 +7045,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -7040,7 +7060,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -7102,8 +7122,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.Get.css(modules.css, { data: modules.cssMods,@@ -7201,7 +7221,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { return; }, @@ -7269,15 +7289,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -7286,11 +7306,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -7298,7 +7318,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -7312,7 +7332,7 @@ resolved[m.type + 'Mods'].push(m); } else { }- + }; len = s.length;@@ -7333,7 +7353,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -7350,7 +7369,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -7366,7 +7384,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -7386,7 +7404,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -7411,7 +7428,7 @@ if (maxURLLength <= base.length) { maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { u = [];@@ -7472,7 +7489,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -7485,7 +7502,7 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /**@@ -7555,7 +7572,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; roll = (c >= m.rollup); if (roll) {@@ -7584,7 +7601,7 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by src/loader/scripts/meta_join.js */@@ -7707,7 +7724,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -8271,6 +8288,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -8595,10 +8613,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -9818,7 +9834,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -9864,8 +9881,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -10057,6 +10074,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -10075,8 +10108,8 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"requires": ["loader-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["get", "features", "intl-base", "yui-log", "yui-log-nodejs", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});
bundle/yui-throttle/yui-throttle-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui-throttle/yui-throttle.js", code: [] };-_yuitest_coverage["build/yui-throttle/yui-throttle.js"].code=["YUI.add('yui-throttle', function (Y, NAME) {","","/**","Throttles a call to a method based on the time between calls. This method is attached","to the `Y` object and is <a href=\"../classes/YUI.html#method_throttle\">documented there</a>.",""," var fn = Y.throttle(function() {"," counter++;"," });",""," for (i; i< 35000; i++) {"," out++;"," fn();"," }","","","@module yui","@submodule yui-throttle","*/","","/*! Based on work by Simon Willison: http://gist.github.com/292562 */","/**"," * Throttles a call to a method based on the time between calls."," * @method throttle"," * @for YUI"," * @param fn {function} The function call to throttle."," * @param ms {int} The number of milliseconds to throttle the method call."," * Can set globally with Y.config.throttleTime or by call. Passing a -1 will"," * disable the throttle. Defaults to 150."," * @return {function} Returns a wrapped function that calls fn throttled."," * @since 3.1.0"," */","Y.throttle = function(fn, ms) {"," ms = (ms) ? ms : (Y.config.throttleTime || 150);",""," if (ms === -1) {"," return (function() {"," fn.apply(null, arguments);"," });"," }",""," var last = Y.Lang.now();",""," return (function() {"," var now = Y.Lang.now();"," if (now - last > ms) {"," last = now;"," fn.apply(null, arguments);"," }"," });","};","","","}, '3.7.2', {\"requires\": [\"yui-base\"]});"];+_yuitest_coverage["build/yui-throttle/yui-throttle.js"].code=["YUI.add('yui-throttle', function (Y, NAME) {","","/**","Throttles a call to a method based on the time between calls. This method is attached","to the `Y` object and is <a href=\"../classes/YUI.html#method_throttle\">documented there</a>.",""," var fn = Y.throttle(function() {"," counter++;"," });",""," for (i; i< 35000; i++) {"," out++;"," fn();"," }","","","@module yui","@submodule yui-throttle","*/","","/*! Based on work by Simon Willison: http://gist.github.com/292562 */","/**"," * Throttles a call to a method based on the time between calls."," * @method throttle"," * @for YUI"," * @param fn {function} The function call to throttle."," * @param ms {int} The number of milliseconds to throttle the method call."," * Can set globally with Y.config.throttleTime or by call. Passing a -1 will"," * disable the throttle. Defaults to 150."," * @return {function} Returns a wrapped function that calls fn throttled."," * @since 3.1.0"," */","Y.throttle = function(fn, ms) {"," ms = (ms) ? ms : (Y.config.throttleTime || 150);",""," if (ms === -1) {"," return function() {"," fn.apply(null, arguments);"," };"," }",""," var last = Y.Lang.now();",""," return function() {"," var now = Y.Lang.now();"," if (now - last > ms) {"," last = now;"," fn.apply(null, arguments);"," }"," };","};","","","}, '3.7.3', {\"requires\": [\"yui-base\"]});"]; _yuitest_coverage["build/yui-throttle/yui-throttle.js"].lines = {"1":0,"33":0,"34":0,"36":0,"37":0,"38":0,"42":0,"44":0,"45":0,"46":0,"47":0,"48":0}; _yuitest_coverage["build/yui-throttle/yui-throttle.js"].functions = {"(anonymous 2):37":0,"(anonymous 3):44":0,"throttle:33":0,"(anonymous 1):1":0}; _yuitest_coverage["build/yui-throttle/yui-throttle.js"].coveredLines = 12;@@ -80,18 +80,18 @@ _yuitest_coverline("build/yui-throttle/yui-throttle.js", 36); if (ms === -1) { _yuitest_coverline("build/yui-throttle/yui-throttle.js", 37);-return (function() {+return function() { _yuitest_coverfunc("build/yui-throttle/yui-throttle.js", "(anonymous 2)", 37); _yuitest_coverline("build/yui-throttle/yui-throttle.js", 38); fn.apply(null, arguments);- });+ }; } _yuitest_coverline("build/yui-throttle/yui-throttle.js", 42); var last = Y.Lang.now(); _yuitest_coverline("build/yui-throttle/yui-throttle.js", 44);-return (function() {+return function() { _yuitest_coverfunc("build/yui-throttle/yui-throttle.js", "(anonymous 3)", 44); _yuitest_coverline("build/yui-throttle/yui-throttle.js", 45); var now = Y.Lang.now();@@ -102,8 +102,8 @@ _yuitest_coverline("build/yui-throttle/yui-throttle.js", 48); fn.apply(null, arguments); }- });+ }; }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-throttle/yui-throttle-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -40,21 +40,21 @@ ms = (ms) ? ms : (Y.config.throttleTime || 150); if (ms === -1) {- return (function() {+ return function() { fn.apply(null, arguments);- });+ }; } var last = Y.Lang.now(); - return (function() {+ return function() { var now = Y.Lang.now(); if (now - last > ms) { last = now; fn.apply(null, arguments); }- });+ }; }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui-throttle/yui-throttle-min.js view
@@ -1,9 +1,9 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */ YUI.add("yui-throttle",function(e,t){ /*! Based on work by Simon Willison: http://gist.github.com/292562 */-;e.throttle=function(t,n){n=n?n:e.config.throttleTime||150;if(n===-1)return function(){t.apply(null,arguments)};var r=e.Lang.now();return function(){var i=e.Lang.now();i-r>n&&(r=i,t.apply(null,arguments))}}},"3.7.2",{requires:["yui-base"]});+;e.throttle=function(t,n){n=n?n:e.config.throttleTime||150;if(n===-1)return function(){t.apply(null,arguments)};var r=e.Lang.now();return function(){var i=e.Lang.now();i-r>n&&(r=i,t.apply(null,arguments))}}},"3.7.3",{requires:["yui-base"]});
bundle/yui-throttle/yui-throttle.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -40,21 +40,21 @@ ms = (ms) ? ms : (Y.config.throttleTime || 150); if (ms === -1) {- return (function() {+ return function() { fn.apply(null, arguments);- });+ }; } var last = Y.Lang.now(); - return (function() {+ return function() { var now = Y.Lang.now(); if (now - last > ms) { last = now; fn.apply(null, arguments); }- });+ }; }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]});
bundle/yui/yui-coverage.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -32,7 +32,7 @@ path: "build/yui/yui.js", code: [] };-_yuitest_coverage["build/yui/yui.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.2',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or alert (window),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ == 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;"," "," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process == 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-number\",\"datatype-date\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.2', {\"use\": [\"yui-base\", \"get\", \"features\", \"intl-base\", \"yui-log\", \"yui-later\", \"loader-base\", \"loader-rollup\", \"loader-yui3\"]});"];+_yuitest_coverage["build/yui/yui.js"].code=["/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and"," * the core utilities for the library."," * @module yui"," * @main yui"," * @submodule yui-base"," */","","if (typeof YUI != 'undefined') {"," YUI._YUI = YUI;","}","","/**","The YUI global namespace object. If YUI is already defined, the","existing YUI object will not be overwritten so that defined","namespaces are preserved. It is the constructor for the object","the end user interacts with. As indicated below, each instance","has full custom event support, but only if the event system","is available. This is a self-instantiable factory function. You","can invoke it directly like this:",""," YUI().use('*', function(Y) {"," // ready"," });","","But it also works like this:",""," var Y = YUI();","","Configuring the YUI object:",""," YUI({"," debug: true,"," combine: false"," }).use('node', function(Y) {"," //Node is ready to use"," });","","See the API docs for the <a href=\"config.html\">Config</a> class","for the complete list of supported configuration properties accepted","by the YUI constuctor.","","@class YUI","@constructor","@global","@uses EventTarget","@param [o]* {Object} 0..n optional configuration objects. these values","are store in Y.config. See <a href=\"config.html\">Config</a> for the list of supported","properties.","*/"," /*global YUI*/"," /*global YUI_config*/"," var YUI = function() {"," var i = 0,"," Y = this,"," args = arguments,"," l = args.length,"," instanceOf = function(o, type) {"," return (o && o.hasOwnProperty && (o instanceof type));"," },"," gconf = (typeof YUI_config !== 'undefined') && YUI_config;",""," if (!(instanceOf(Y, YUI))) {"," Y = new YUI();"," } else {"," // set up the core environment"," Y._init();",""," /**"," YUI.GlobalConfig is a master configuration that might span"," multiple contexts in a non-browser environment. It is applied"," first to all instances in all contexts."," @property GlobalConfig"," @type {Object}"," @global"," @static"," @example","",""," YUI.GlobalConfig = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });",""," */"," if (YUI.GlobalConfig) {"," Y.applyConfig(YUI.GlobalConfig);"," }",""," /**"," YUI_config is a page-level config. It is applied to all"," instances created on the page. This is applied after"," YUI.GlobalConfig, and before the instance level configuration"," objects."," @global"," @property YUI_config"," @type {Object}"," @example","",""," //Single global var to include before YUI seed file"," YUI_config = {"," filter: 'debug'"," };",""," YUI().use('node', function(Y) {"," //debug files used here"," });",""," YUI({"," filter: 'min'"," }).use('node', function(Y) {"," //min files used here"," });"," */"," if (gconf) {"," Y.applyConfig(gconf);"," }",""," // bind the specified additional modules for this instance"," if (!l) {"," Y._setup();"," }"," }",""," if (l) {"," // Each instance can accept one or more configuration objects."," // These are applied after YUI.GlobalConfig and YUI_Config,"," // overriding values set in those config files if there is a '"," // matching property."," for (; i < l; i++) {"," Y.applyConfig(args[i]);"," }",""," Y._setup();"," }",""," Y.instanceOf = instanceOf;",""," return Y;"," };","","(function() {",""," var proto, prop,"," VERSION = '3.7.3',"," PERIOD = '.',"," BASE = 'http://yui.yahooapis.com/',"," /*"," These CSS class names can't be generated by"," getClassName since it is not available at the"," time they are being used."," */"," DOC_LABEL = 'yui3-js-enabled',"," CSS_STAMP_EL = 'yui3-css-stamp',"," NOOP = function() {},"," SLICE = Array.prototype.slice,"," APPLY_TO_AUTH = { 'io.xdrReady': 1, // the functions applyTo"," 'io.xdrResponse': 1, // can call. this should"," 'SWF.eventHandler': 1 }, // be done at build time"," hasWin = (typeof window != 'undefined'),"," win = (hasWin) ? window : null,"," doc = (hasWin) ? win.document : null,"," docEl = doc && doc.documentElement,"," docClass = docEl && docEl.className,"," instances = {},"," time = new Date().getTime(),"," add = function(el, type, fn, capture) {"," if (el && el.addEventListener) {"," el.addEventListener(type, fn, capture);"," } else if (el && el.attachEvent) {"," el.attachEvent('on' + type, fn);"," }"," },"," remove = function(el, type, fn, capture) {"," if (el && el.removeEventListener) {"," // this can throw an uncaught exception in FF"," try {"," el.removeEventListener(type, fn, capture);"," } catch (ex) {}"," } else if (el && el.detachEvent) {"," el.detachEvent('on' + type, fn);"," }"," },"," handleLoad = function() {"," YUI.Env.windowLoaded = true;"," YUI.Env.DOMReady = true;"," if (hasWin) {"," remove(window, 'load', handleLoad);"," }"," },"," getLoader = function(Y, o) {"," var loader = Y.Env._loader,"," lCore = [ 'loader-base' ],"," G_ENV = YUI.Env,"," mods = G_ENV.mods;",""," if (loader) {"," //loader._config(Y.config);"," loader.ignoreRegistered = false;"," loader.onEnd = null;"," loader.data = null;"," loader.required = [];"," loader.loadType = null;"," } else {"," loader = new Y.Loader(Y.config);"," Y.Env._loader = loader;"," }"," if (mods && mods.loader) {"," lCore = [].concat(lCore, YUI.Env.loaderExtras);"," }"," YUI.Env.core = Y.Array.dedupe([].concat(YUI.Env.core, lCore));",""," return loader;"," },",""," clobber = function(r, s) {"," for (var i in s) {"," if (s.hasOwnProperty(i)) {"," r[i] = s[i];"," }"," }"," },",""," ALREADY_DONE = { success: true };","","// Stamp the documentElement (HTML) with a class of \"yui-loaded\" to","// enable styles that need to key off of JS being enabled.","if (docEl && docClass.indexOf(DOC_LABEL) == -1) {"," if (docClass) {"," docClass += ' ';"," }"," docClass += DOC_LABEL;"," docEl.className = docClass;","}","","if (VERSION.indexOf('@') > -1) {"," VERSION = '3.5.0'; // dev time hack for cdn test","}","","proto = {"," /**"," * Applies a new configuration object to the YUI instance config."," * This will merge new group/module definitions, and will also"," * update the loader cache if necessary. Updating Y.config directly"," * will not update the cache."," * @method applyConfig"," * @param {Object} o the configuration object."," * @since 3.2.0"," */"," applyConfig: function(o) {",""," o = o || NOOP;",""," var attr,"," name,"," // detail,"," config = this.config,"," mods = config.modules,"," groups = config.groups,"," aliases = config.aliases,"," loader = this.Env._loader;",""," for (name in o) {"," if (o.hasOwnProperty(name)) {"," attr = o[name];"," if (mods && name == 'modules') {"," clobber(mods, attr);"," } else if (aliases && name == 'aliases') {"," clobber(aliases, attr);"," } else if (groups && name == 'groups') {"," clobber(groups, attr);"," } else if (name == 'win') {"," config[name] = (attr && attr.contentWindow) || attr;"," config.doc = config[name] ? config[name].document : null;"," } else if (name == '_yuid') {"," // preserve the guid"," } else {"," config[name] = attr;"," }"," }"," }",""," if (loader) {"," loader._config(o);"," }",""," },"," /**"," * Old way to apply a config to the instance (calls `applyConfig` under the hood)"," * @private"," * @method _config"," * @param {Object} o The config to apply"," */"," _config: function(o) {"," this.applyConfig(o);"," },",""," /**"," * Initialize this YUI instance"," * @private"," * @method _init"," */"," _init: function() {"," var filter, el,"," Y = this,"," G_ENV = YUI.Env,"," Env = Y.Env,"," prop;",""," /**"," * The version number of the YUI instance."," * @property version"," * @type string"," */"," Y.version = VERSION;",""," if (!Env) {"," Y.Env = {"," core: ['get', 'features', 'intl-base', 'yui-log', 'yui-later', 'loader-base', 'loader-rollup', 'loader-yui3'],"," loaderExtras: ['loader-rollup', 'loader-yui3'],"," mods: {}, // flat module map"," versions: {}, // version module map"," base: BASE,"," cdn: BASE + VERSION + '/build/',"," // bootstrapped: false,"," _idx: 0,"," _used: {},"," _attached: {},"," _missed: [],"," _yidx: 0,"," _uidx: 0,"," _guidp: 'y',"," _loaded: {},"," // serviced: {},"," // Regex in English:"," // I'll start at the \\b(simpleyui)."," // 1. Look in the test string for \"simpleyui\" or \"yui\" or"," // \"yui-base\" or \"yui-davglass\" or \"yui-foobar\" that comes after a word break. That is, it"," // can't match \"foyui\" or \"i_heart_simpleyui\". This can be anywhere in the string."," // 2. After #1 must come a forward slash followed by the string matched in #1, so"," // \"yui-base/yui-base\" or \"simpleyui/simpleyui\" or \"yui-pants/yui-pants\"."," // 3. The second occurence of the #1 token can optionally be followed by \"-debug\" or \"-min\","," // so \"yui/yui-min\", \"yui/yui-debug\", \"yui-base/yui-base-debug\". NOT \"yui/yui-tshirt\"."," // 4. This is followed by \".js\", so \"yui/yui.js\", \"simpleyui/simpleyui-min.js\""," // 0. Going back to the beginning, now. If all that stuff in 1-4 comes after a \"?\" in the string,"," // then capture the junk between the LAST \"&\" and the string in 1-4. So"," // \"blah?foo/yui/yui.js\" will capture \"foo/\" and \"blah?some/thing.js&3.3.0/build/yui-davglass/yui-davglass.js\""," // will capture \"3.3.0/build/\""," //"," // Regex Exploded:"," // (?:\\? Find a ?"," // (?:[^&]*&) followed by 0..n characters followed by an &"," // * in fact, find as many sets of characters followed by a & as you can"," // ([^&]*) capture the stuff after the last & in \\1"," // )? but it's ok if all this ?junk&more_junk stuff isn't even there"," // \\b(simpleyui| after a word break find either the string \"simpleyui\" or"," // yui(?:-\\w+)? the string \"yui\" optionally followed by a -, then more characters"," // ) and store the simpleyui or yui-* string in \\2"," // \\/\\2 then comes a / followed by the simpleyui or yui-* string in \\2"," // (?:-(min|debug))? optionally followed by \"-min\" or \"-debug\""," // .js and ending in \".js\""," _BASE_RE: /(?:\\?(?:[^&]*&)*([^&]*))?\\b(simpleyui|yui(?:-\\w+)?)\\/\\2(?:-(min|debug))?\\.js/,"," parseBasePath: function(src, pattern) {"," var match = src.match(pattern),"," path, filter;",""," if (match) {"," path = RegExp.leftContext || src.slice(0, src.indexOf(match[0]));",""," // this is to set up the path to the loader. The file"," // filter for loader should match the yui include."," filter = match[3];",""," // extract correct path for mixed combo urls"," // http://yuilibrary.com/projects/yui3/ticket/2528423"," if (match[1]) {"," path += '?' + match[1];"," }"," path = {"," filter: filter,"," path: path"," };"," }"," return path;"," },"," getBase: G_ENV && G_ENV.getBase ||"," function(pattern) {"," var nodes = (doc && doc.getElementsByTagName('script')) || [],"," path = Env.cdn, parsed,"," i, len, src;",""," for (i = 0, len = nodes.length; i < len; ++i) {"," src = nodes[i].src;"," if (src) {"," parsed = Y.Env.parseBasePath(src, pattern);"," if (parsed) {"," filter = parsed.filter;"," path = parsed.path;"," break;"," }"," }"," }",""," // use CDN default"," return path;"," }",""," };",""," Env = Y.Env;",""," Env._loaded[VERSION] = {};",""," if (G_ENV && Y !== YUI) {"," Env._yidx = ++G_ENV._yidx;"," Env._guidp = ('yui_' + VERSION + '_' +"," Env._yidx + '_' + time).replace(/\\./g, '_').replace(/-/g, '_');"," } else if (YUI._YUI) {",""," G_ENV = YUI._YUI.Env;"," Env._yidx += G_ENV._yidx;"," Env._uidx += G_ENV._uidx;",""," for (prop in G_ENV) {"," if (!(prop in Env)) {"," Env[prop] = G_ENV[prop];"," }"," }",""," delete YUI._YUI;"," }",""," Y.id = Y.stamp(Y);"," instances[Y.id] = Y;",""," }",""," Y.constructor = YUI;",""," // configuration defaults"," Y.config = Y.config || {"," bootstrap: true,"," cacheUse: true,"," debug: true,"," doc: doc,"," fetchCSS: true,"," throwFail: true,"," useBrowserConsole: true,"," useNativeES5: true,"," win: win"," };",""," //Register the CSS stamp element"," if (doc && !doc.getElementById(CSS_STAMP_EL)) {"," el = doc.createElement('div');"," el.innerHTML = '<div id=\"' + CSS_STAMP_EL + '\" style=\"position: absolute !important; visibility: hidden !important\"></div>';"," YUI.Env.cssStampEl = el.firstChild;"," if (doc.body) {"," doc.body.appendChild(YUI.Env.cssStampEl);"," } else {"," docEl.insertBefore(YUI.Env.cssStampEl, docEl.firstChild);"," }"," }",""," Y.config.lang = Y.config.lang || 'en-US';",""," Y.config.base = YUI.config.base || Y.Env.getBase(Y.Env._BASE_RE);",""," if (!filter || (!('mindebug').indexOf(filter))) {"," filter = 'min';"," }"," filter = (filter) ? '-' + filter : filter;"," Y.config.loaderPath = YUI.config.loaderPath || 'loader/loader' + filter + '.js';",""," },",""," /**"," * Finishes the instance setup. Attaches whatever modules were defined"," * when the yui modules was registered."," * @method _setup"," * @private"," */"," _setup: function(o) {"," var i, Y = this,"," core = [],"," mods = YUI.Env.mods,"," extras = Y.config.core || [].concat(YUI.Env.core); //Clone it..",""," for (i = 0; i < extras.length; i++) {"," if (mods[extras[i]]) {"," core.push(extras[i]);"," }"," }",""," Y._attach(['yui-base']);"," Y._attach(core);",""," if (Y.Loader) {"," getLoader(Y);"," }",""," },",""," /**"," * Executes a method on a YUI instance with"," * the specified id if the specified method is whitelisted."," * @method applyTo"," * @param id {String} the YUI instance id."," * @param method {String} the name of the method to exectute."," * Ex: 'Object.keys'."," * @param args {Array} the arguments to apply to the method."," * @return {Object} the return value from the applied method or null."," */"," applyTo: function(id, method, args) {"," if (!(method in APPLY_TO_AUTH)) {"," this.log(method + ': applyTo not allowed', 'warn', 'yui');"," return null;"," }",""," var instance = instances[id], nest, m, i;"," if (instance) {"," nest = method.split('.');"," m = instance;"," for (i = 0; i < nest.length; i = i + 1) {"," m = m[nest[i]];"," if (!m) {"," this.log('applyTo not found: ' + method, 'warn', 'yui');"," }"," }"," return m && m.apply(instance, args);"," }",""," return null;"," },","","/**","Registers a module with the YUI global. The easiest way to create a","first-class YUI module is to use the YUI component ","build tool <a href=\"http://yui.github.com/shifter/\">Shifter</a>.","","The build system will produce the `YUI.add` wrapper for your module, along","with any configuration info required for the module.","","@method add","@param name {String} module name.","@param fn {Function} entry point into the module that is used to bind module to the YUI instance.","@param {YUI} fn.Y The YUI instance this module is executed in.","@param {String} fn.name The name of the module","@param version {String} version string.","@param details {Object} optional config data:","@param details.requires {Array} features that must be present before this module can be attached.","@param details.optional {Array} optional features that should be present if loadOptional"," is defined. Note: modules are not often loaded this way in YUI 3,"," but this field is still useful to inform the user that certain"," features in the component will require additional dependencies.","@param details.use {Array} features that are included within this module which need to"," be attached automatically when this module is attached. This"," supports the YUI 3 rollup system -- a module with submodules"," defined will need to have the submodules listed in the 'use'"," config. The YUI component build tool does this for you.","@return {YUI} the YUI instance.","@example",""," YUI.add('davglass', function(Y, name) {"," Y.davglass = function() {"," alert('Dav was here!');"," };"," }, '3.4.0', { requires: ['yui-base', 'harley-davidson', 'mt-dew'] });","","*/"," add: function(name, fn, version, details) {"," details = details || {};"," var env = YUI.Env,"," mod = {"," name: name,"," fn: fn,"," version: version,"," details: details"," },"," //Instance hash so we don't apply it to the same instance twice"," applied = {},"," loader, inst,"," i, versions = env.versions;",""," env.mods[name] = mod;"," versions[version] = versions[version] || {};"," versions[version][name] = mod;",""," for (i in instances) {"," if (instances.hasOwnProperty(i)) {"," inst = instances[i];"," if (!applied[inst.id]) {"," applied[inst.id] = true;"," loader = inst.Env._loader;"," if (loader) {"," if (!loader.moduleInfo[name] || loader.moduleInfo[name].temp) {"," loader.addModule(details, name);"," }"," }"," }"," }"," }",""," return this;"," },",""," /**"," * Executes the function associated with each required"," * module, binding the module to the YUI instance."," * @param {Array} r The array of modules to attach"," * @param {Boolean} [moot=false] Don't throw a warning if the module is not attached"," * @method _attach"," * @private"," */"," _attach: function(r, moot) {"," var i, name, mod, details, req, use, after,"," mods = YUI.Env.mods,"," aliases = YUI.Env.aliases,"," Y = this, j,"," cache = YUI.Env._renderedMods,"," loader = Y.Env._loader,"," done = Y.Env._attached,"," len = r.length, loader, def, go,"," c = [];",""," //Check for conditional modules (in a second+ instance) and add their requirements"," //TODO I hate this entire method, it needs to be fixed ASAP (3.5.0) ^davglass"," for (i = 0; i < len; i++) {"," name = r[i];"," mod = mods[name];"," c.push(name);"," if (loader && loader.conditions[name]) {"," for (j in loader.conditions[name]) {"," if (loader.conditions[name].hasOwnProperty(j)) {"," def = loader.conditions[name][j];"," go = def && ((def.ua && Y.UA[def.ua]) || (def.test && def.test(Y)));"," if (go) {"," c.push(def.name);"," }"," }"," }"," }"," }"," r = c;"," len = r.length;",""," for (i = 0; i < len; i++) {"," if (!done[r[i]]) {"," name = r[i];"," mod = mods[name];",""," if (aliases && aliases[name] && !mod) {"," Y._attach(aliases[name]);"," continue;"," }"," if (!mod) {"," if (loader && loader.moduleInfo[name]) {"," mod = loader.moduleInfo[name];"," moot = true;"," }","",""," //if (!loader || !loader.moduleInfo[name]) {"," //if ((!loader || !loader.moduleInfo[name]) && !moot) {"," if (!moot && name) {"," if ((name.indexOf('skin-') === -1) && (name.indexOf('css') === -1)) {"," Y.Env._missed.push(name);"," Y.Env._missed = Y.Array.dedupe(Y.Env._missed);"," Y.message('NOT loaded: ' + name, 'warn', 'yui');"," }"," }"," } else {"," done[name] = true;"," //Don't like this, but in case a mod was asked for once, then we fetch it"," //We need to remove it from the missed list ^davglass"," for (j = 0; j < Y.Env._missed.length; j++) {"," if (Y.Env._missed[j] === name) {"," Y.message('Found: ' + name + ' (was reported as missing earlier)', 'warn', 'yui');"," Y.Env._missed.splice(j, 1);"," }"," }"," /*"," If it's a temp module, we need to redo it's requirements if it's already loaded"," since it may have been loaded by another instance and it's dependencies might"," have been redefined inside the fetched file."," */"," if (loader && cache && cache[name] && cache[name].temp) {"," loader.getRequires(cache[name]);"," req = [];"," for (j in loader.moduleInfo[name].expanded_map) {"," if (loader.moduleInfo[name].expanded_map.hasOwnProperty(j)) {"," req.push(j);"," }"," }"," Y._attach(req);"," }"," "," details = mod.details;"," req = details.requires;"," use = details.use;"," after = details.after;"," //Force Intl load if there is a language (Loader logic) @todo fix this shit"," if (details.lang) {"," req = req || [];"," req.unshift('intl');"," }",""," if (req) {"," for (j = 0; j < req.length; j++) {"," if (!done[req[j]]) {"," if (!Y._attach(req)) {"," return false;"," }"," break;"," }"," }"," }",""," if (after) {"," for (j = 0; j < after.length; j++) {"," if (!done[after[j]]) {"," if (!Y._attach(after, true)) {"," return false;"," }"," break;"," }"," }"," }",""," if (mod.fn) {"," if (Y.config.throwFail) {"," mod.fn(Y, name);"," } else {"," try {"," mod.fn(Y, name);"," } catch (e) {"," Y.error('Attach error: ' + name, e, name);"," return false;"," }"," }"," }",""," if (use) {"," for (j = 0; j < use.length; j++) {"," if (!done[use[j]]) {"," if (!Y._attach(use)) {"," return false;"," }"," break;"," }"," }"," }","","",""," }"," }"," }",""," return true;"," },"," /**"," * Delays the `use` callback until another event has taken place. Like: window.onload, domready, contentready, available."," * @private"," * @method _delayCallback"," * @param {Callback} cb The original `use` callback"," * @param {String|Object} until Either an event (load, domready) or an Object containing event/args keys for contentready/available"," */"," _delayCallback: function(cb, until) {",""," var Y = this,"," mod = ['event-base'];",""," until = (Y.Lang.isObject(until) ? until : { event: until });",""," if (until.event === 'load') {"," mod.push('event-synthetic');"," }",""," return function() {"," var args = arguments;"," Y._use(mod, function() {"," Y.on(until.event, function() {"," args[1].delayUntil = until.event;"," cb.apply(Y, args);"," }, until.args);"," });"," };"," },",""," /**"," * Attaches one or more modules to the YUI instance. When this"," * is executed, the requirements are analyzed, and one of"," * several things can happen:"," *"," * * All requirements are available on the page -- The modules"," * are attached to the instance. If supplied, the use callback"," * is executed synchronously."," *"," * * Modules are missing, the Get utility is not available OR"," * the 'bootstrap' config is false -- A warning is issued about"," * the missing modules and all available modules are attached."," *"," * * Modules are missing, the Loader is not available but the Get"," * utility is and boostrap is not false -- The loader is bootstrapped"," * before doing the following...."," *"," * * Modules are missing and the Loader is available -- The loader"," * expands the dependency tree and fetches missing modules. When"," * the loader is finshed the callback supplied to use is executed"," * asynchronously."," *"," * @method use"," * @param modules* {String|Array} 1-n modules to bind (uses arguments array)."," * @param [callback] {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," * @param callback.Y {YUI} The `YUI` instance created for this sandbox"," * @param callback.status {Object} Object containing `success`, `msg` and `data` properties"," *"," * @example"," * // loads and attaches dd and its dependencies"," * YUI().use('dd', function(Y) {});"," *"," * // loads and attaches dd and node as well as all of their dependencies (since 3.4.0)"," * YUI().use(['dd', 'node'], function(Y) {});"," *"," * // attaches all modules that are available on the page"," * YUI().use('*', function(Y) {});"," *"," * // intrinsic YUI gallery support (since 3.1.0)"," * YUI().use('gallery-yql', function(Y) {});"," *"," * // intrinsic YUI 2in3 support (since 3.1.0)"," * YUI().use('yui2-datatable', function(Y) {});"," *"," * @return {YUI} the YUI instance."," */"," use: function() {"," var args = SLICE.call(arguments, 0),"," callback = args[args.length - 1],"," Y = this,"," i = 0,"," a = [],"," name,"," Env = Y.Env,"," provisioned = true;",""," // The last argument supplied to use can be a load complete callback"," if (Y.Lang.isFunction(callback)) {"," args.pop();"," if (Y.config.delayUntil) {"," callback = Y._delayCallback(callback, Y.config.delayUntil);"," }"," } else {"," callback = null;"," }"," if (Y.Lang.isArray(args[0])) {"," args = args[0];"," }",""," if (Y.config.cacheUse) {"," while ((name = args[i++])) {"," if (!Env._attached[name]) {"," provisioned = false;"," break;"," }"," }",""," if (provisioned) {"," if (args.length) {"," }"," Y._notify(callback, ALREADY_DONE, args);"," return Y;"," }"," }",""," if (Y._loading) {"," Y._useQueue = Y._useQueue || new Y.Queue();"," Y._useQueue.add([args, callback]);"," } else {"," Y._use(args, function(Y, response) {"," Y._notify(callback, response, args);"," });"," }",""," return Y;"," },"," /**"," * Notify handler from Loader for attachment/load errors"," * @method _notify"," * @param callback {Function} The callback to pass to the `Y.config.loadErrorFn`"," * @param response {Object} The response returned from Loader"," * @param args {Array} The aruments passed from Loader"," * @private"," */"," _notify: function(callback, response, args) {"," if (!response.success && this.config.loadErrorFn) {"," this.config.loadErrorFn.call(this, this, callback, response, args);"," } else if (callback) {"," if (this.Env._missed && this.Env._missed.length) {"," response.msg = 'Missing modules: ' + this.Env._missed.join();"," response.success = false;"," }"," if (this.config.throwFail) {"," callback(this, response);"," } else {"," try {"," callback(this, response);"," } catch (e) {"," this.error('use callback error', e, args);"," }"," }"," }"," },",""," /**"," * This private method is called from the `use` method queue. To ensure that only one set of loading"," * logic is performed at a time."," * @method _use"," * @private"," * @param args* {String} 1-n modules to bind (uses arguments array)."," * @param *callback {Function} callback function executed when"," * the instance has the required functionality. If included, it"," * must be the last parameter."," */"," _use: function(args, callback) {",""," if (!this.Array) {"," this._attach(['yui-base']);"," }",""," var len, loader, handleBoot, handleRLS,"," Y = this,"," G_ENV = YUI.Env,"," mods = G_ENV.mods,"," Env = Y.Env,"," used = Env._used,"," aliases = G_ENV.aliases,"," queue = G_ENV._loaderQueue,"," firstArg = args[0],"," YArray = Y.Array,"," config = Y.config,"," boot = config.bootstrap,"," missing = [],"," i,"," r = [],"," ret = true,"," fetchCSS = config.fetchCSS,"," process = function(names, skip) {",""," var i = 0, a = [], name, len, m, req, use;",""," if (!names.length) {"," return;"," }",""," if (aliases) {"," len = names.length;"," for (i = 0; i < len; i++) {"," if (aliases[names[i]] && !mods[names[i]]) {"," a = [].concat(a, aliases[names[i]]);"," } else {"," a.push(names[i]);"," }"," }"," names = a;"," }"," "," len = names.length;"," "," for (i = 0; i < len; i++) {"," name = names[i];"," if (!skip) {"," r.push(name);"," }",""," // only attach a module once"," if (used[name]) {"," continue;"," }"," "," m = mods[name];"," req = null;"," use = null;",""," if (m) {"," used[name] = true;"," req = m.details.requires;"," use = m.details.use;"," } else {"," // CSS files don't register themselves, see if it has"," // been loaded"," if (!G_ENV._loaded[VERSION][name]) {"," missing.push(name);"," } else {"," used[name] = true; // probably css"," }"," }",""," // make sure requirements are attached"," if (req && req.length) {"," process(req);"," }",""," // make sure we grab the submodule dependencies too"," if (use && use.length) {"," process(use, 1);"," }"," }",""," },",""," handleLoader = function(fromLoader) {"," var response = fromLoader || {"," success: true,"," msg: 'not dynamic'"," },"," redo, origMissing,"," ret = true,"," data = response.data;",""," Y._loading = false;",""," if (data) {"," origMissing = missing;"," missing = [];"," r = [];"," process(data);"," redo = missing.length;"," if (redo) {"," if ([].concat(missing).sort().join() =="," origMissing.sort().join()) {"," redo = false;"," }"," }"," }",""," if (redo && data) {"," Y._loading = true;"," Y._use(missing, function() {"," if (Y._attach(data)) {"," Y._notify(callback, response, data);"," }"," });"," } else {"," if (data) {"," ret = Y._attach(data);"," }"," if (ret) {"," Y._notify(callback, response, args);"," }"," }",""," if (Y._useQueue && Y._useQueue.size() && !Y._loading) {"," Y._use.apply(Y, Y._useQueue.next());"," }",""," };","",""," // YUI().use('*'); // bind everything available"," if (firstArg === '*') {"," args = [];"," for (i in mods) {"," if (mods.hasOwnProperty(i)) {"," args.push(i);"," }"," }"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," return Y;"," }",""," if ((mods.loader || mods['loader-base']) && !Y.Loader) {"," Y._attach(['loader' + ((!mods.loader) ? '-base' : '')]);"," }","",""," // use loader to expand dependencies and sort the"," // requirements if it is available."," if (boot && Y.Loader && args.length) {"," loader = getLoader(Y);"," loader.require(args);"," loader.ignoreRegistered = true;"," loader._boot = true;"," loader.calculate(null, (fetchCSS) ? null : 'js');"," args = loader.sorted;"," loader._boot = false;"," }"," "," process(args);",""," len = missing.length;","",""," if (len) {"," missing = YArray.dedupe(missing);"," len = missing.length;"," }","",""," // dynamic load"," if (boot && len && Y.Loader) {"," Y._loading = true;"," loader = getLoader(Y);"," loader.onEnd = handleLoader;"," loader.context = Y;"," loader.data = args;"," loader.ignoreRegistered = false;"," loader.require(args);"," loader.insert(null, (fetchCSS) ? null : 'js');",""," } else if (boot && len && Y.Get && !Env.bootstrapped) {",""," Y._loading = true;",""," handleBoot = function() {"," Y._loading = false;"," queue.running = false;"," Env.bootstrapped = true;"," G_ENV._bootstrapping = false;"," if (Y._attach(['loader'])) {"," Y._use(args, callback);"," }"," };",""," if (G_ENV._bootstrapping) {"," queue.add(handleBoot);"," } else {"," G_ENV._bootstrapping = true;"," Y.Get.script(config.base + config.loaderPath, {"," onEnd: handleBoot"," });"," }",""," } else {"," ret = Y._attach(args);"," if (ret) {"," handleLoader();"," }"," }",""," return Y;"," },","",""," /**"," Adds a namespace object onto the YUI global if called statically.",""," // creates YUI.your.namespace.here as nested objects"," YUI.namespace(\"your.namespace.here\");",""," If called as a method on a YUI <em>instance</em>, it creates the"," namespace on the instance.",""," // creates Y.property.package"," Y.namespace(\"property.package\");",""," Dots in the input string cause `namespace` to create nested objects for"," each token. If any part of the requested namespace already exists, the"," current object will be left in place. This allows multiple calls to"," `namespace` to preserve existing namespaced properties.",""," If the first token in the namespace string is \"YAHOO\", the token is"," discarded.",""," Be careful with namespace tokens. Reserved words may work in some browsers"," and not others. For instance, the following will fail in some browsers"," because the supported version of JavaScript reserves the word \"long\":",""," Y.namespace(\"really.long.nested.namespace\");",""," <em>Note: If you pass multiple arguments to create multiple namespaces, only"," the last one created is returned from this function.</em>",""," @method namespace"," @param {String} namespace* namespaces to create."," @return {Object} A reference to the last namespace object created."," **/"," namespace: function() {"," var a = arguments, o, i = 0, j, d, arg;",""," for (; i < a.length; i++) {"," o = this; //Reset base object per argument or it will get reused from the last"," arg = a[i];"," if (arg.indexOf(PERIOD) > -1) { //Skip this if no \".\" is present"," d = arg.split(PERIOD);"," for (j = (d[0] == 'YAHOO') ? 1 : 0; j < d.length; j++) {"," o[d[j]] = o[d[j]] || {};"," o = o[d[j]];"," }"," } else {"," o[arg] = o[arg] || {};"," o = o[arg]; //Reset base object to the new object so it's returned"," }"," }"," return o;"," },",""," // this is replaced if the log module is included"," log: NOOP,"," message: NOOP,"," // this is replaced if the dump module is included"," dump: function (o) { return ''+o; },",""," /**"," * Report an error. The reporting mechanism is controlled by"," * the `throwFail` configuration attribute. If throwFail is"," * not specified, the message is written to the Logger, otherwise"," * a JS error is thrown. If an `errorFn` is specified in the config"," * it must return `true` to keep the error from being thrown."," * @method error"," * @param msg {String} the error message."," * @param e {Error|String} Optional JS error that was caught, or an error string."," * @param src Optional additional info (passed to `Y.config.errorFn` and `Y.message`)"," * and `throwFail` is specified, this error will be re-thrown."," * @return {YUI} this YUI instance."," */"," error: function(msg, e, src) {"," //TODO Add check for window.onerror here",""," var Y = this, ret;",""," if (Y.config.errorFn) {"," ret = Y.config.errorFn.apply(Y, arguments);"," }",""," if (!ret) {"," throw (e || new Error(msg));"," } else {"," Y.message(msg, 'error', ''+src); // don't scrub this one"," }",""," return Y;"," },",""," /**"," * Generate an id that is unique among all YUI instances"," * @method guid"," * @param pre {String} optional guid prefix."," * @return {String} the guid."," */"," guid: function(pre) {"," var id = this.Env._guidp + '_' + (++this.Env._uidx);"," return (pre) ? (pre + id) : id;"," },",""," /**"," * Returns a `guid` associated with an object. If the object"," * does not have one, a new one is created unless `readOnly`"," * is specified."," * @method stamp"," * @param o {Object} The object to stamp."," * @param readOnly {Boolean} if `true`, a valid guid will only"," * be returned if the object has one assigned to it."," * @return {String} The object's guid or null."," */"," stamp: function(o, readOnly) {"," var uid;"," if (!o) {"," return o;"," }",""," // IE generates its own unique ID for dom nodes"," // The uniqueID property of a document node returns a new ID"," if (o.uniqueID && o.nodeType && o.nodeType !== 9) {"," uid = o.uniqueID;"," } else {"," uid = (typeof o === 'string') ? o : o._yuid;"," }",""," if (!uid) {"," uid = this.guid();"," if (!readOnly) {"," try {"," o._yuid = uid;"," } catch (e) {"," uid = null;"," }"," }"," }"," return uid;"," },",""," /**"," * Destroys the YUI instance"," * @method destroy"," * @since 3.3.0"," */"," destroy: function() {"," var Y = this;"," if (Y.Event) {"," Y.Event._unload();"," }"," delete instances[Y.id];"," delete Y.Env;"," delete Y.config;"," }",""," /**"," * instanceof check for objects that works around"," * memory leak in IE when the item tested is"," * window/document"," * @method instanceOf"," * @param o {Object} The object to check."," * @param type {Object} The class to check against."," * @since 3.3.0"," */","};",""," YUI.prototype = proto;",""," // inheritance utilities are not available yet"," for (prop in proto) {"," if (proto.hasOwnProperty(prop)) {"," YUI[prop] = proto[prop];"," }"," }",""," /**","Static method on the Global YUI object to apply a config to all YUI instances.","It's main use case is \"mashups\" where several third party scripts are trying to write to","a global YUI config at the same time. This way they can all call `YUI.applyConfig({})` instead of","overwriting other scripts configs.","@static","@since 3.5.0","@method applyConfig","@param {Object} o the configuration object.","@example",""," YUI.applyConfig({"," modules: {"," davglass: {"," fullpath: './davglass.js'"," }"," }"," });",""," YUI.applyConfig({"," modules: {"," foo: {"," fullpath: './foo.js'"," }"," }"," });",""," YUI().use('davglass', function(Y) {"," //Module davglass will be available here.."," });",""," */"," YUI.applyConfig = function(o) {"," if (!o) {"," return;"," }"," //If there is a GlobalConfig, apply it first to set the defaults"," if (YUI.GlobalConfig) {"," this.prototype.applyConfig.call(this, YUI.GlobalConfig);"," }"," //Apply this config to it"," this.prototype.applyConfig.call(this, o);"," //Reset GlobalConfig to the combined config"," YUI.GlobalConfig = this.config;"," };",""," // set up the environment"," YUI._init();",""," if (hasWin) {"," // add a window load event at load time so we can capture"," // the case where it fires before dynamic loading is"," // complete."," add(window, 'load', handleLoad);"," } else {"," handleLoad();"," }",""," YUI.Env.add = add;"," YUI.Env.remove = remove;",""," /*global exports*/"," // Support the CommonJS method for exporting our single global"," if (typeof exports == 'object') {"," exports.YUI = YUI;"," }","","}());","","","/**"," * The config object contains all of the configuration options for"," * the `YUI` instance. This object is supplied by the implementer"," * when instantiating a `YUI` instance. Some properties have default"," * values if they are not supplied by the implementer. This should"," * not be updated directly because some values are cached. Use"," * `applyConfig()` to update the config object on a YUI instance that"," * has already been configured."," *"," * @class config"," * @static"," */","","/**"," * Allows the YUI seed file to fetch the loader component and library"," * metadata to dynamically load additional dependencies."," *"," * @property bootstrap"," * @type boolean"," * @default true"," */","","/**"," * Turns on writing Ylog messages to the browser console."," *"," * @property debug"," * @type boolean"," * @default true"," */","","/**"," * Log to the browser console if debug is on and the browser has a"," * supported console."," *"," * @property useBrowserConsole"," * @type boolean"," * @default true"," */","","/**"," * A hash of log sources that should be logged. If specified, only"," * log messages from these sources will be logged."," *"," * @property logInclude"," * @type object"," */","","/**"," * A hash of log sources that should be not be logged. If specified,"," * all sources are logged if not on this list."," *"," * @property logExclude"," * @type object"," */","","/**"," * Set to true if the yui seed file was dynamically loaded in"," * order to bootstrap components relying on the window load event"," * and the `domready` custom event."," *"," * @property injected"," * @type boolean"," * @default false"," */","","/**"," * If `throwFail` is set, `Y.error` will generate or re-throw a JS Error."," * Otherwise the failure is logged."," *"," * @property throwFail"," * @type boolean"," * @default true"," */","","/**"," * The window/frame that this instance should operate in."," *"," * @property win"," * @type Window"," * @default the window hosting YUI"," */","","/**"," * The document associated with the 'win' configuration."," *"," * @property doc"," * @type Document"," * @default the document hosting YUI"," */","","/**"," * A list of modules that defines the YUI core (overrides the default list)."," *"," * @property core"," * @type Array"," * @default [ get,features,intl-base,yui-log,yui-later,loader-base, loader-rollup, loader-yui3 ]"," */","","/**"," * A list of languages in order of preference. This list is matched against"," * the list of available languages in modules that the YUI instance uses to"," * determine the best possible localization of language sensitive modules."," * Languages are represented using BCP 47 language tags, such as \"en-GB\" for"," * English as used in the United Kingdom, or \"zh-Hans-CN\" for simplified"," * Chinese as used in China. The list can be provided as a comma-separated"," * list or as an array."," *"," * @property lang"," * @type string|string[]"," */","","/**"," * The default date format"," * @property dateFormat"," * @type string"," * @deprecated use configuration in `DataType.Date.format()` instead."," */","","/**"," * The default locale"," * @property locale"," * @type string"," * @deprecated use `config.lang` instead."," */","","/**"," * The default interval when polling in milliseconds."," * @property pollInterval"," * @type int"," * @default 20"," */","","/**"," * The number of dynamic nodes to insert by default before"," * automatically removing them. This applies to script nodes"," * because removing the node will not make the evaluated script"," * unavailable. Dynamic CSS is not auto purged, because removing"," * a linked style sheet will also remove the style definitions."," * @property purgethreshold"," * @type int"," * @default 20"," */","","/**"," * The default interval when polling in milliseconds."," * @property windowResizeDelay"," * @type int"," * @default 40"," */","","/**"," * Base directory for dynamic loading"," * @property base"," * @type string"," */","","/*"," * The secure base dir (not implemented)"," * For dynamic loading."," * @property secureBase"," * @type string"," */","","/**"," * The YUI combo service base dir. Ex: `http://yui.yahooapis.com/combo?`"," * For dynamic loading."," * @property comboBase"," * @type string"," */","","/**"," * The root path to prepend to module path for the combo service."," * Ex: 3.0.0b1/build/"," * For dynamic loading."," * @property root"," * @type string"," */","","/**"," * A filter to apply to result urls. This filter will modify the default"," * path for all modules. The default path for the YUI library is the"," * minified version of the files (e.g., event-min.js). The filter property"," * can be a predefined filter or a custom filter. The valid predefined"," * filters are:"," * <dl>"," * <dt>DEBUG</dt>"," * <dd>Selects the debug versions of the library (e.g., event-debug.js)."," * This option will automatically include the Logger widget</dd>"," * <dt>RAW</dt>"," * <dd>Selects the non-minified version of the library (e.g., event.js).</dd>"," * </dl>"," * You can also define a custom filter, which must be an object literal"," * containing a search expression and a replace string:"," *"," * myFilter: {"," * 'searchExp': \"-min\\\\.js\","," * 'replaceStr': \"-debug.js\""," * }"," *"," * For dynamic loading."," *"," * @property filter"," * @type string|object"," */","","/**"," * The `skin` config let's you configure application level skin"," * customizations. It contains the following attributes which"," * can be specified to override the defaults:"," *"," * // The default skin, which is automatically applied if not"," * // overriden by a component-specific skin definition."," * // Change this in to apply a different skin globally"," * defaultSkin: 'sam',"," *"," * // This is combined with the loader base property to get"," * // the default root directory for a skin."," * base: 'assets/skins/',"," *"," * // Any component-specific overrides can be specified here,"," * // making it possible to load different skins for different"," * // components. It is possible to load more than one skin"," * // for a given component as well."," * overrides: {"," * slider: ['capsule', 'round']"," * }"," *"," * For dynamic loading."," *"," * @property skin"," */","","/**"," * Hash of per-component filter specification. If specified for a given"," * component, this overrides the filter config."," *"," * For dynamic loading."," *"," * @property filters"," */","","/**"," * Use the YUI combo service to reduce the number of http connections"," * required to load your dependencies. Turning this off will"," * disable combo handling for YUI and all module groups configured"," * with a combo service."," *"," * For dynamic loading."," *"," * @property combine"," * @type boolean"," * @default true if 'base' is not supplied, false if it is."," */","","/**"," * A list of modules that should never be dynamically loaded"," *"," * @property ignore"," * @type string[]"," */","","/**"," * A list of modules that should always be loaded when required, even if already"," * present on the page."," *"," * @property force"," * @type string[]"," */","","/**"," * Node or id for a node that should be used as the insertion point for new"," * nodes. For dynamic loading."," *"," * @property insertBefore"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded script"," * nodes."," * @property jsAttributes"," * @type string"," */","","/**"," * Object literal containing attributes to add to dynamically loaded link"," * nodes."," * @property cssAttributes"," * @type string"," */","","/**"," * Number of milliseconds before a timeout occurs when dynamically"," * loading nodes. If not set, there is no timeout."," * @property timeout"," * @type int"," */","","/**"," * Callback for the 'CSSComplete' event. When dynamically loading YUI"," * components with CSS, this property fires when the CSS is finished"," * loading but script loading is still ongoing. This provides an"," * opportunity to enhance the presentation of a loading page a little"," * bit before the entire loading process is done."," *"," * @property onCSS"," * @type function"," */","","/**"," * A hash of module definitions to add to the list of YUI components."," * These components can then be dynamically loaded side by side with"," * YUI via the `use()` method. This is a hash, the key is the module"," * name, and the value is an object literal specifying the metdata"," * for the module. See `Loader.addModule` for the supported module"," * metadata fields. Also see groups, which provides a way to"," * configure the base and combo spec for a set of modules."," *"," * modules: {"," * mymod1: {"," * requires: ['node'],"," * fullpath: '/mymod1/mymod1.js'"," * },"," * mymod2: {"," * requires: ['mymod1'],"," * fullpath: '/mymod2/mymod2.js'"," * },"," * mymod3: '/js/mymod3.js',"," * mycssmod: '/css/mycssmod.css'"," * }"," *"," *"," * @property modules"," * @type object"," */","","/**"," * Aliases are dynamic groups of modules that can be used as"," * shortcuts."," *"," * YUI({"," * aliases: {"," * davglass: [ 'node', 'yql', 'dd' ],"," * mine: [ 'davglass', 'autocomplete']"," * }"," * }).use('mine', function(Y) {"," * //Node, YQL, DD & AutoComplete available here.."," * });"," *"," * @property aliases"," * @type object"," */","","/**"," * A hash of module group definitions. It for each group you"," * can specify a list of modules and the base path and"," * combo spec to use when dynamically loading the modules."," *"," * groups: {"," * yui2: {"," * // specify whether or not this group has a combo service"," * combine: true,"," *"," * // The comboSeperator to use with this group's combo handler"," * comboSep: ';',"," *"," * // The maxURLLength for this server"," * maxURLLength: 500,"," *"," * // the base path for non-combo paths"," * base: 'http://yui.yahooapis.com/2.8.0r4/build/',"," *"," * // the path to the combo service"," * comboBase: 'http://yui.yahooapis.com/combo?',"," *"," * // a fragment to prepend to the path attribute when"," * // when building combo urls"," * root: '2.8.0r4/build/',"," *"," * // the module definitions"," * modules: {"," * yui2_yde: {"," * path: \"yahoo-dom-event/yahoo-dom-event.js\""," * },"," * yui2_anim: {"," * path: \"animation/animation.js\","," * requires: ['yui2_yde']"," * }"," * }"," * }"," * }"," *"," * @property groups"," * @type object"," */","","/**"," * The loader 'path' attribute to the loader itself. This is combined"," * with the 'base' attribute to dynamically load the loader component"," * when boostrapping with the get utility alone."," *"," * @property loaderPath"," * @type string"," * @default loader/loader-min.js"," */","","/**"," * Specifies whether or not YUI().use(...) will attempt to load CSS"," * resources at all. Any truthy value will cause CSS dependencies"," * to load when fetching script. The special value 'force' will"," * cause CSS dependencies to be loaded even if no script is needed."," *"," * @property fetchCSS"," * @type boolean|string"," * @default true"," */","","/**"," * The default gallery version to build gallery module urls"," * @property gallery"," * @type string"," * @since 3.1.0"," */","","/**"," * The default YUI 2 version to build yui2 module urls. This is for"," * intrinsic YUI 2 support via the 2in3 project. Also see the '2in3'"," * config for pulling different revisions of the wrapped YUI 2"," * modules."," * @since 3.1.0"," * @property yui2"," * @type string"," * @default 2.9.0"," */","","/**"," * The 2in3 project is a deployment of the various versions of YUI 2"," * deployed as first-class YUI 3 modules. Eventually, the wrapper"," * for the modules will change (but the underlying YUI 2 code will"," * be the same), and you can select a particular version of"," * the wrapper modules via this config."," * @since 3.1.0"," * @property 2in3"," * @type string"," * @default 4"," */","","/**"," * Alternative console log function for use in environments without"," * a supported native console. The function is executed in the"," * YUI instance context."," * @since 3.1.0"," * @property logFn"," * @type Function"," */","","/**"," * A callback to execute when Y.error is called. It receives the"," * error message and an javascript error object if Y.error was"," * executed because a javascript error was caught. The function"," * is executed in the YUI instance context. Returning `true` from this"," * function will stop the Error from being thrown."," *"," * @since 3.2.0"," * @property errorFn"," * @type Function"," */","","/**"," * A callback to execute when the loader fails to load one or"," * more resource. This could be because of a script load"," * failure. It can also fail if a javascript module fails"," * to register itself, but only when the 'requireRegistration'"," * is true. If this function is defined, the use() callback will"," * only be called when the loader succeeds, otherwise it always"," * executes unless there was a javascript error when attaching"," * a module."," *"," * @since 3.3.0"," * @property loadErrorFn"," * @type Function"," */","","/**"," * When set to true, the YUI loader will expect that all modules"," * it is responsible for loading will be first-class YUI modules"," * that register themselves with the YUI global. If this is"," * set to true, loader will fail if the module registration fails"," * to happen after the script is loaded."," *"," * @since 3.3.0"," * @property requireRegistration"," * @type boolean"," * @default false"," */","","/**"," * Cache serviced use() requests."," * @since 3.3.0"," * @property cacheUse"," * @type boolean"," * @default true"," * @deprecated no longer used"," */","","/**"," * Whether or not YUI should use native ES5 functionality when available for"," * features like `Y.Array.each()`, `Y.Object()`, etc. When `false`, YUI will"," * always use its own fallback implementations instead of relying on ES5"," * functionality, even when it's available."," *"," * @property useNativeES5"," * @type Boolean"," * @default true"," * @since 3.5.0"," */","","/**","Delay the `use` callback until a specific event has passed (`load`, `domready`, `contentready` or `available`)","@property delayUntil","@type String|Object","@since 3.6.0","@example","","You can use `load` or `domready` strings by default:",""," YUI({"," delayUntil: 'domready'"," }, function(Y) {"," //This will not fire until 'domeready'"," });","","Or you can delay until a node is available (with `available` or `contentready`):",""," YUI({"," delayUntil: {"," event: 'available',"," args: '#foo'"," }"," }, function(Y) {"," //This will not fire until '#foo' is "," // available in the DOM"," });"," ","","*/","YUI.add('yui-base', function (Y, NAME) {","","/*"," * YUI stub"," * @module yui"," * @submodule yui-base"," */","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Provides core language utilites and extensions used throughout YUI."," *"," * @class Lang"," * @static"," */","","var L = Y.Lang || (Y.Lang = {}),","","STRING_PROTO = String.prototype,","TOSTRING = Object.prototype.toString,","","TYPES = {"," 'undefined' : 'undefined',"," 'number' : 'number',"," 'boolean' : 'boolean',"," 'string' : 'string',"," '[object Function]': 'function',"," '[object RegExp]' : 'regexp',"," '[object Array]' : 'array',"," '[object Date]' : 'date',"," '[object Error]' : 'error'","},","","SUBREGEX = /\\{\\s*([^|}]+?)\\s*(?:\\|([^}]*))?\\s*\\}/g,","TRIMREGEX = /^\\s+|\\s+$/g,","NATIVE_FN_REGEX = /\\{\\s*\\[(?:native code|function)\\]\\s*\\}/i;","","// -- Protected Methods --------------------------------------------------------","","/**","Returns `true` if the given function appears to be implemented in native code,","`false` otherwise. Will always return `false` -- even in ES5-capable browsers --","if the `useNativeES5` YUI config option is set to `false`.","","This isn't guaranteed to be 100% accurate and won't work for anything other than","functions, but it can be useful for determining whether a function like","`Array.prototype.forEach` is native or a JS shim provided by another library.","","There's a great article by @kangax discussing certain flaws with this technique:","<http://perfectionkills.com/detecting-built-in-host-methods/>","","While his points are valid, it's still possible to benefit from this function","as long as it's used carefully and sparingly, and in such a way that false","negatives have minimal consequences. It's used internally to avoid using","potentially broken non-native ES5 shims that have been added to the page by","other libraries.","","@method _isNative","@param {Function} fn Function to test.","@return {Boolean} `true` if _fn_ appears to be native, `false` otherwise.","@static","@protected","@since 3.5.0","**/","L._isNative = function (fn) {"," return !!(Y.config.useNativeES5 && fn && NATIVE_FN_REGEX.test(fn));","};","","// -- Public Methods -----------------------------------------------------------","","/**"," * Determines whether or not the provided item is an array."," *"," * Returns `false` for array-like collections such as the function `arguments`"," * collection or `HTMLElement` collections. Use `Y.Array.test()` if you want to"," * test for an array-like collection."," *"," * @method isArray"," * @param o The object to test."," * @return {boolean} true if o is an array."," * @static"," */","L.isArray = L._isNative(Array.isArray) ? Array.isArray : function (o) {"," return L.type(o) === 'array';","};","","/**"," * Determines whether or not the provided item is a boolean."," * @method isBoolean"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a boolean."," */","L.isBoolean = function(o) {"," return typeof o === 'boolean';","};","","/**"," * Determines whether or not the supplied item is a date instance."," * @method isDate"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a date."," */","L.isDate = function(o) {"," return L.type(o) === 'date' && o.toString() !== 'Invalid Date' && !isNaN(o);","};","","/**"," * <p>"," * Determines whether or not the provided item is a function."," * Note: Internet Explorer thinks certain functions are objects:"," * </p>"," *"," * <pre>"," * var obj = document.createElement(\"object\");"," * Y.Lang.isFunction(obj.getAttribute) // reports false in IE"," * "," * var input = document.createElement(\"input\"); // append to body"," * Y.Lang.isFunction(input.focus) // reports false in IE"," * </pre>"," *"," * <p>"," * You will have to implement additional tests if these functions"," * matter to you."," * </p>"," *"," * @method isFunction"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a function."," */","L.isFunction = function(o) {"," return L.type(o) === 'function';","};","","/**"," * Determines whether or not the provided item is null."," * @method isNull"," * @static"," * @param o The object to test."," * @return {boolean} true if o is null."," */","L.isNull = function(o) {"," return o === null;","};","","/**"," * Determines whether or not the provided item is a legal number."," * @method isNumber"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a number."," */","L.isNumber = function(o) {"," return typeof o === 'number' && isFinite(o);","};","","/**"," * Determines whether or not the provided item is of type object"," * or function. Note that arrays are also objects, so"," * <code>Y.Lang.isObject([]) === true</code>."," * @method isObject"," * @static"," * @param o The object to test."," * @param failfn {boolean} fail if the input is a function."," * @return {boolean} true if o is an object."," * @see isPlainObject"," */","L.isObject = function(o, failfn) {"," var t = typeof o;"," return (o && (t === 'object' ||"," (!failfn && (t === 'function' || L.isFunction(o))))) || false;","};","","/**"," * Determines whether or not the provided item is a string."," * @method isString"," * @static"," * @param o The object to test."," * @return {boolean} true if o is a string."," */","L.isString = function(o) {"," return typeof o === 'string';","};","","/**"," * Determines whether or not the provided item is undefined."," * @method isUndefined"," * @static"," * @param o The object to test."," * @return {boolean} true if o is undefined."," */","L.isUndefined = function(o) {"," return typeof o === 'undefined';","};","","/**"," * A convenience method for detecting a legitimate non-null value."," * Returns false for null/undefined/NaN, true for other values,"," * including 0/false/''"," * @method isValue"," * @static"," * @param o The item to test."," * @return {boolean} true if it is not null/undefined/NaN || false."," */","L.isValue = function(o) {"," var t = L.type(o);",""," switch (t) {"," case 'number':"," return isFinite(o);",""," case 'null': // fallthru"," case 'undefined':"," return false;",""," default:"," return !!t;"," }","};","","/**"," * Returns the current time in milliseconds."," *"," * @method now"," * @return {Number} Current time in milliseconds."," * @static"," * @since 3.3.0"," */","L.now = Date.now || function () {"," return new Date().getTime();","};","","/**"," * Lightweight version of <code>Y.substitute</code>. Uses the same template"," * structure as <code>Y.substitute</code>, but doesn't support recursion,"," * auto-object coersion, or formats."," * @method sub"," * @param {string} s String to be modified."," * @param {object} o Object containing replacement values."," * @return {string} the substitute result."," * @static"," * @since 3.2.0"," */","L.sub = function(s, o) {"," return s.replace ? s.replace(SUBREGEX, function (match, key) {"," return L.isUndefined(o[key]) ? match : o[key];"," }) : s;","};","","/**"," * Returns a string without any leading or trailing whitespace. If"," * the input is not a string, the input will be returned untouched."," * @method trim"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trim = STRING_PROTO.trim ? function(s) {"," return s && s.trim ? s.trim() : s;","} : function (s) {"," try {"," return s.replace(TRIMREGEX, '');"," } catch (e) {"," return s;"," }","};","","/**"," * Returns a string without any leading whitespace."," * @method trimLeft"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimLeft = STRING_PROTO.trimLeft ? function (s) {"," return s.trimLeft();","} : function (s) {"," return s.replace(/^\\s+/, '');","};","","/**"," * Returns a string without any trailing whitespace."," * @method trimRight"," * @static"," * @param s {string} the string to trim."," * @return {string} the trimmed string."," */","L.trimRight = STRING_PROTO.trimRight ? function (s) {"," return s.trimRight();","} : function (s) {"," return s.replace(/\\s+$/, '');","};","","/**","Returns one of the following strings, representing the type of the item passed","in:",""," * \"array\""," * \"boolean\""," * \"date\""," * \"error\""," * \"function\""," * \"null\""," * \"number\""," * \"object\""," * \"regexp\""," * \"string\""," * \"undefined\"","","Known issues:",""," * `typeof HTMLElementCollection` returns function in Safari, but"," `Y.Lang.type()` reports \"object\", which could be a good thing --"," but it actually caused the logic in <code>Y.Lang.isObject</code> to fail.","","@method type","@param o the item to test.","@return {string} the detected type.","@static","**/","L.type = function(o) {"," return TYPES[typeof o] || TYPES[TOSTRING.call(o)] || (o ? 'object' : 'null');","};","/**","@module yui","@submodule yui-base","*/","","var Lang = Y.Lang,"," Native = Array.prototype,",""," hasOwn = Object.prototype.hasOwnProperty;","","/**","Provides utility methods for working with arrays. Additional array helpers can","be found in the `collection` and `array-extras` modules.","","`Y.Array(thing)` returns a native array created from _thing_. Depending on","_thing_'s type, one of the following will happen:",""," * Arrays are returned unmodified unless a non-zero _startIndex_ is"," specified."," * Array-like collections (see `Array.test()`) are converted to arrays."," * For everything else, a new array is created with _thing_ as the sole"," item.","","Note: elements that are also collections, such as `<form>` and `<select>`","elements, are not automatically converted to arrays. To force a conversion,","pass `true` as the value of the _force_ parameter.","","@class Array","@constructor","@param {Any} thing The thing to arrayify.","@param {Number} [startIndex=0] If non-zero and _thing_ is an array or array-like"," collection, a subset of items starting at the specified index will be"," returned.","@param {Boolean} [force=false] If `true`, _thing_ will be treated as an"," array-like collection no matter what.","@return {Array} A native array created from _thing_, according to the rules"," described above.","**/","function YArray(thing, startIndex, force) {"," var len, result;",""," startIndex || (startIndex = 0);",""," if (force || YArray.test(thing)) {"," // IE throws when trying to slice HTMLElement collections."," try {"," return Native.slice.call(thing, startIndex);"," } catch (ex) {"," result = [];",""," for (len = thing.length; startIndex < len; ++startIndex) {"," result.push(thing[startIndex]);"," }",""," return result;"," }"," }",""," return [thing];","}","","Y.Array = YArray;","","/**","Dedupes an array of strings, returning an array that's guaranteed to contain","only one copy of a given string.","","This method differs from `Array.unique()` in that it's optimized for use only","with strings, whereas `unique` may be used with other types (but is slower).","Using `dedupe()` with non-string values may result in unexpected behavior.","","@method dedupe","@param {String[]} array Array of strings to dedupe.","@return {Array} Deduped copy of _array_.","@static","@since 3.4.0","**/","YArray.dedupe = function (array) {"," var hash = {},"," results = [],"," i, item, len;",""," for (i = 0, len = array.length; i < len; ++i) {"," item = array[i];",""," if (!hasOwn.call(hash, item)) {"," hash[item] = 1;"," results.push(item);"," }"," }",""," return results;","};","","/**","Executes the supplied function on each item in the array. This method wraps","the native ES5 `Array.forEach()` method if available.","","@method each","@param {Array} array Array to iterate.","@param {Function} fn Function to execute on each item in the array. The function"," will receive the following arguments:"," @param {Any} fn.item Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {YUI} The YUI instance.","@static","**/","YArray.each = YArray.forEach = Lang._isNative(Native.forEach) ? function (array, fn, thisObj) {"," Native.forEach.call(array || [], fn, thisObj || Y);"," return Y;","} : function (array, fn, thisObj) {"," for (var i = 0, len = (array && array.length) || 0; i < len; ++i) {"," if (i in array) {"," fn.call(thisObj || Y, array[i], i, array);"," }"," }",""," return Y;","};","","/**","Alias for `each()`.","","@method forEach","@static","**/","","/**","Returns an object using the first array as keys and the second as values. If","the second array is not provided, or if it doesn't contain the same number of","values as the first array, then `true` will be used in place of the missing","values.","","@example",""," Y.Array.hash(['a', 'b', 'c'], ['foo', 'bar']);"," // => {a: 'foo', b: 'bar', c: true}","","@method hash","@param {String[]} keys Array of strings to use as keys.","@param {Array} [values] Array to use as values.","@return {Object} Hash using the first array as keys and the second as values.","@static","**/","YArray.hash = function (keys, values) {"," var hash = {},"," vlen = (values && values.length) || 0,"," i, len;",""," for (i = 0, len = keys.length; i < len; ++i) {"," if (i in keys) {"," hash[keys[i]] = vlen > i && i in values ? values[i] : true;"," }"," }",""," return hash;","};","","/**","Returns the index of the first item in the array that's equal (using a strict","equality check) to the specified _value_, or `-1` if the value isn't found.","","This method wraps the native ES5 `Array.indexOf()` method if available.","","@method indexOf","@param {Array} array Array to search.","@param {Any} value Value to search for.","@param {Number} [from=0] The index at which to begin the search.","@return {Number} Index of the item strictly equal to _value_, or `-1` if not"," found.","@static","**/","YArray.indexOf = Lang._isNative(Native.indexOf) ? function (array, value, from) {"," return Native.indexOf.call(array, value, from);","} : function (array, value, from) {"," // http://es5.github.com/#x15.4.4.14"," var len = array.length;",""," from = +from || 0;"," from = (from > 0 || -1) * Math.floor(Math.abs(from));",""," if (from < 0) {"," from += len;",""," if (from < 0) {"," from = 0;"," }"," }",""," for (; from < len; ++from) {"," if (from in array && array[from] === value) {"," return from;"," }"," }",""," return -1;","};","","/**","Numeric sort convenience function.","","The native `Array.prototype.sort()` function converts values to strings and","sorts them in lexicographic order, which is unsuitable for sorting numeric","values. Provide `Array.numericSort` as a custom sort function when you want","to sort values in numeric order.","","@example",""," [42, 23, 8, 16, 4, 15].sort(Y.Array.numericSort);"," // => [4, 8, 15, 16, 23, 42]","","@method numericSort","@param {Number} a First value to compare.","@param {Number} b Second value to compare.","@return {Number} Difference between _a_ and _b_.","@static","**/","YArray.numericSort = function (a, b) {"," return a - b;","};","","/**","Executes the supplied function on each item in the array. Returning a truthy","value from the function will stop the processing of remaining items.","","@method some","@param {Array} array Array to iterate over.","@param {Function} fn Function to execute on each item. The function will receive"," the following arguments:"," @param {Any} fn.value Current array item."," @param {Number} fn.index Current array index."," @param {Array} fn.array Array being iterated over.","@param {Object} [thisObj] `this` object to use when calling _fn_.","@return {Boolean} `true` if the function returns a truthy value on any of the"," items in the array; `false` otherwise.","@static","**/","YArray.some = Lang._isNative(Native.some) ? function (array, fn, thisObj) {"," return Native.some.call(array, fn, thisObj);","} : function (array, fn, thisObj) {"," for (var i = 0, len = array.length; i < len; ++i) {"," if (i in array && fn.call(thisObj, array[i], i, array)) {"," return true;"," }"," }",""," return false;","};","","/**","Evaluates _obj_ to determine if it's an array, an array-like collection, or","something else. This is useful when working with the function `arguments`","collection and `HTMLElement` collections.","","Note: This implementation doesn't consider elements that are also","collections, such as `<form>` and `<select>`, to be array-like.","","@method test","@param {Object} obj Object to test.","@return {Number} A number indicating the results of the test:",""," * 0: Neither an array nor an array-like collection."," * 1: Real array."," * 2: Array-like collection.","","@static","**/","YArray.test = function (obj) {"," var result = 0;",""," if (Lang.isArray(obj)) {"," result = 1;"," } else if (Lang.isObject(obj)) {"," try {"," // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here),"," // or functions without apply/call (Safari"," // HTMLElementCollection bug)."," if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) {"," result = 2;"," }"," } catch (ex) {}"," }",""," return result;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * A simple FIFO queue. Items are added to the Queue with add(1..n items) and"," * removed using next()."," *"," * @class Queue"," * @constructor"," * @param {MIXED} item* 0..n items to seed the queue."," */","function Queue() {"," this._init();"," this.add.apply(this, arguments);","}","","Queue.prototype = {"," /**"," * Initialize the queue"," *"," * @method _init"," * @protected"," */"," _init: function() {"," /**"," * The collection of enqueued items"," *"," * @property _q"," * @type Array"," * @protected"," */"," this._q = [];"," },",""," /**"," * Get the next item in the queue. FIFO support"," *"," * @method next"," * @return {MIXED} the next item in the queue."," */"," next: function() {"," return this._q.shift();"," },",""," /**"," * Get the last in the queue. LIFO support."," *"," * @method last"," * @return {MIXED} the last item in the queue."," */"," last: function() {"," return this._q.pop();"," },",""," /**"," * Add 0..n items to the end of the queue."," *"," * @method add"," * @param {MIXED} item* 0..n items."," * @return {object} this queue."," */"," add: function() {"," this._q.push.apply(this._q, arguments);",""," return this;"," },",""," /**"," * Returns the current number of queued items."," *"," * @method size"," * @return {Number} The size."," */"," size: function() {"," return this._q.length;"," }","};","","Y.Queue = Queue;","","YUI.Env._loaderQueue = YUI.Env._loaderQueue || new Queue();","","/**","The YUI module contains the components required for building the YUI seed file.","This includes the script loading mechanism, a simple queue, and the core","utilities for the library.","","@module yui","@submodule yui-base","**/","","var CACHED_DELIMITER = '__',",""," hasOwn = Object.prototype.hasOwnProperty,"," isObject = Y.Lang.isObject;","","/**","Returns a wrapper for a function which caches the return value of that function,","keyed off of the combined string representation of the argument values provided","when the wrapper is called.","","Calling this function again with the same arguments will return the cached value","rather than executing the wrapped function.","","Note that since the cache is keyed off of the string representation of arguments","passed to the wrapper function, arguments that aren't strings and don't provide","a meaningful `toString()` method may result in unexpected caching behavior. For","example, the objects `{}` and `{foo: 'bar'}` would both be converted to the","string `[object Object]` when used as a cache key.","","@method cached","@param {Function} source The function to memoize.","@param {Object} [cache={}] Object in which to store cached values. You may seed"," this object with pre-existing cached values if desired.","@param {any} [refetch] If supplied, this value is compared with the cached value"," using a `==` comparison. If the values are equal, the wrapped function is"," executed again even though a cached value exists.","@return {Function} Wrapped function.","@for YUI","**/","Y.cached = function (source, cache, refetch) {"," cache || (cache = {});",""," return function (arg) {"," var key = arguments.length > 1 ?"," Array.prototype.join.call(arguments, CACHED_DELIMITER) :"," String(arg);",""," if (!(key in cache) || (refetch && cache[key] == refetch)) {"," cache[key] = source.apply(source, arguments);"," }",""," return cache[key];"," };","};","","/**","Returns the `location` object from the window/frame in which this YUI instance","operates, or `undefined` when executing in a non-browser environment","(e.g. Node.js).","","It is _not_ recommended to hold references to the `window.location` object","outside of the scope of a function in which its properties are being accessed or","its methods are being called. This is because of a nasty bug/issue that exists","in both Safari and MobileSafari browsers:","[WebKit Bug 34679](https://bugs.webkit.org/show_bug.cgi?id=34679).","","@method getLocation","@return {location} The `location` object from the window/frame in which this YUI"," instance operates.","@since 3.5.0","**/","Y.getLocation = function () {"," // It is safer to look this up every time because yui-base is attached to a"," // YUI instance before a user's config is applied; i.e. `Y.config.win` does"," // not point the correct window object when this file is loaded."," var win = Y.config.win;",""," // It is not safe to hold a reference to the `location` object outside the"," // scope in which it is being used. The WebKit engine used in Safari and"," // MobileSafari will \"disconnect\" the `location` object from the `window`"," // when a page is restored from back/forward history cache."," return win && win.location;","};","","/**","Returns a new object containing all of the properties of all the supplied","objects. The properties from later objects will overwrite those in earlier","objects.","","Passing in a single object will create a shallow copy of it. For a deep copy,","use `clone()`.","","@method merge","@param {Object} objects* One or more objects to merge.","@return {Object} A new merged object.","**/","Y.merge = function () {"," var i = 0,"," len = arguments.length,"," result = {},"," key,"," obj;",""," for (; i < len; ++i) {"," obj = arguments[i];",""," for (key in obj) {"," if (hasOwn.call(obj, key)) {"," result[key] = obj[key];"," }"," }"," }",""," return result;","};","","/**","Mixes _supplier_'s properties into _receiver_.","","Properties on _receiver_ or _receiver_'s prototype will not be overwritten or","shadowed unless the _overwrite_ parameter is `true`, and will not be merged","unless the _merge_ parameter is `true`.","","In the default mode (0), only properties the supplier owns are copied (prototype","properties are not copied). The following copying modes are available:",""," * `0`: _Default_. Object to object."," * `1`: Prototype to prototype."," * `2`: Prototype to prototype and object to object."," * `3`: Prototype to object."," * `4`: Object to prototype.","","@method mix","@param {Function|Object} receiver The object or function to receive the mixed"," properties.","@param {Function|Object} supplier The object or function supplying the"," properties to be mixed.","@param {Boolean} [overwrite=false] If `true`, properties that already exist"," on the receiver will be overwritten with properties from the supplier.","@param {String[]} [whitelist] An array of property names to copy. If"," specified, only the whitelisted properties will be copied, and all others"," will be ignored.","@param {Number} [mode=0] Mix mode to use. See above for available modes.","@param {Boolean} [merge=false] If `true`, objects and arrays that already"," exist on the receiver will have the corresponding object/array from the"," supplier merged into them, rather than being skipped or overwritten. When"," both _overwrite_ and _merge_ are `true`, _merge_ takes precedence.","@return {Function|Object|YUI} The receiver, or the YUI instance if the"," specified receiver is falsy.","**/","Y.mix = function(receiver, supplier, overwrite, whitelist, mode, merge) {"," var alwaysOverwrite, exists, from, i, key, len, to;",""," // If no supplier is given, we return the receiver. If no receiver is given,"," // we return Y. Returning Y doesn't make much sense to me, but it's"," // grandfathered in for backcompat reasons."," if (!receiver || !supplier) {"," return receiver || Y;"," }",""," if (mode) {"," // In mode 2 (prototype to prototype and object to object), we recurse"," // once to do the proto to proto mix. The object to object mix will be"," // handled later on."," if (mode === 2) {"," Y.mix(receiver.prototype, supplier.prototype, overwrite,"," whitelist, 0, merge);"," }",""," // Depending on which mode is specified, we may be copying from or to"," // the prototypes of the supplier and receiver."," from = mode === 1 || mode === 3 ? supplier.prototype : supplier;"," to = mode === 1 || mode === 4 ? receiver.prototype : receiver;",""," // If either the supplier or receiver doesn't actually have a"," // prototype property, then we could end up with an undefined `from`"," // or `to`. If that happens, we abort and return the receiver."," if (!from || !to) {"," return receiver;"," }"," } else {"," from = supplier;"," to = receiver;"," }",""," // If `overwrite` is truthy and `merge` is falsy, then we can skip a"," // property existence check on each iteration and save some time."," alwaysOverwrite = overwrite && !merge;",""," if (whitelist) {"," for (i = 0, len = whitelist.length; i < len; ++i) {"," key = whitelist[i];",""," // We call `Object.prototype.hasOwnProperty` instead of calling"," // `hasOwnProperty` on the object itself, since the object's"," // `hasOwnProperty` method may have been overridden or removed."," // Also, some native objects don't implement a `hasOwnProperty`"," // method."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," // If we're in merge mode, and the key is present on both"," // objects, and the value on both objects is either an object or"," // an array (but not a function), then we recurse to merge the"," // `from` value into the `to` value instead of overwriting it."," //"," // Note: It's intentional that the whitelist isn't passed to the"," // recursive call here. This is legacy behavior that lots of"," // code still depends on."," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," // We're not in merge mode, so we'll only copy the `from` value"," // to the `to` value if we're in overwrite mode or if the"," // current key doesn't exist on the `to` object."," to[key] = from[key];"," }"," }"," } else {"," for (key in from) {"," // The code duplication here is for runtime performance reasons."," // Combining whitelist and non-whitelist operations into a single"," // loop or breaking the shared logic out into a function both result"," // in worse performance, and Y.mix is critical enough that the byte"," // tradeoff is worth it."," if (!hasOwn.call(from, key)) {"," continue;"," }",""," // The `key in to` check here is (sadly) intentional for backwards"," // compatibility reasons. It prevents undesired shadowing of"," // prototype members on `to`."," exists = alwaysOverwrite ? false : key in to;",""," if (merge && exists && isObject(to[key], true)"," && isObject(from[key], true)) {"," Y.mix(to[key], from[key], overwrite, null, 0, merge);"," } else if (overwrite || !exists) {"," to[key] = from[key];"," }"," }",""," // If this is an IE browser with the JScript enumeration bug, force"," // enumeration of the buggy properties by making a recursive call with"," // the buggy properties as the whitelist."," if (Y.Object._hasEnumBug) {"," Y.mix(to, from, overwrite, Y.Object._forceEnum, mode, merge);"," }"," }",""," return receiver;","};","/**"," * The YUI module contains the components required for building the YUI"," * seed file. This includes the script loading mechanism, a simple queue,"," * and the core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * Adds utilities to the YUI instance for working with objects."," *"," * @class Object"," */","","var Lang = Y.Lang,"," hasOwn = Object.prototype.hasOwnProperty,",""," UNDEFINED, // <-- Note the comma. We're still declaring vars.","","/**"," * Returns a new object that uses _obj_ as its prototype. This method wraps the"," * native ES5 `Object.create()` method if available, but doesn't currently"," * pass through `Object.create()`'s second argument (properties) in order to"," * ensure compatibility with older browsers."," *"," * @method ()"," * @param {Object} obj Prototype object."," * @return {Object} New object using _obj_ as its prototype."," * @static"," */","O = Y.Object = Lang._isNative(Object.create) ? function (obj) {"," // We currently wrap the native Object.create instead of simply aliasing it"," // to ensure consistency with our fallback shim, which currently doesn't"," // support Object.create()'s second argument (properties). Once we have a"," // safe fallback for the properties arg, we can stop wrapping"," // Object.create()."," return Object.create(obj);","} : (function () {"," // Reusable constructor function for the Object.create() shim."," function F() {}",""," // The actual shim."," return function (obj) {"," F.prototype = obj;"," return new F();"," };","}()),","","/**"," * Property names that IE doesn't enumerate in for..in loops, even when they"," * should be enumerable. When `_hasEnumBug` is `true`, it's necessary to"," * manually enumerate these properties."," *"," * @property _forceEnum"," * @type String[]"," * @protected"," * @static"," */","forceEnum = O._forceEnum = ["," 'hasOwnProperty',"," 'isPrototypeOf',"," 'propertyIsEnumerable',"," 'toString',"," 'toLocaleString',"," 'valueOf'","],","","/**"," * `true` if this browser has the JScript enumeration bug that prevents"," * enumeration of the properties named in the `_forceEnum` array, `false`"," * otherwise."," *"," * See:"," * - <https://developer.mozilla.org/en/ECMAScript_DontEnum_attribute#JScript_DontEnum_Bug>"," * - <http://whattheheadsaid.com/2010/10/a-safer-object-keys-compatibility-implementation>"," *"," * @property _hasEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasEnumBug = O._hasEnumBug = !{valueOf: 0}.propertyIsEnumerable('valueOf'),","","/**"," * `true` if this browser incorrectly considers the `prototype` property of"," * functions to be enumerable. Currently known to affect Opera 11.50."," *"," * @property _hasProtoEnumBug"," * @type Boolean"," * @protected"," * @static"," */","hasProtoEnumBug = O._hasProtoEnumBug = (function () {}).propertyIsEnumerable('prototype'),","","/**"," * Returns `true` if _key_ exists on _obj_, `false` if _key_ doesn't exist or"," * exists only on _obj_'s prototype. This is essentially a safer version of"," * `obj.hasOwnProperty()`."," *"," * @method owns"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","owns = O.owns = function (obj, key) {"," return !!obj && hasOwn.call(obj, key);","}; // <-- End of var declarations.","","/**"," * Alias for `owns()`."," *"," * @method hasKey"," * @param {Object} obj Object to test."," * @param {String} key Property name to look for."," * @return {Boolean} `true` if _key_ exists on _obj_, `false` otherwise."," * @static"," */","O.hasKey = owns;","","/**"," * Returns an array containing the object's enumerable keys. Does not include"," * prototype keys or non-enumerable keys."," *"," * Note that keys are returned in enumeration order (that is, in the same order"," * that they would be enumerated by a `for-in` loop), which may not be the same"," * as the order in which they were defined."," *"," * This method is an alias for the native ES5 `Object.keys()` method if"," * available."," *"," * @example"," *"," * Y.Object.keys({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['a', 'b', 'c']"," *"," * @method keys"," * @param {Object} obj An object."," * @return {String[]} Array of keys."," * @static"," */","O.keys = Lang._isNative(Object.keys) ? Object.keys : function (obj) {"," if (!Lang.isObject(obj)) {"," throw new TypeError('Object.keys called on a non-object');"," }",""," var keys = [],"," i, key, len;",""," if (hasProtoEnumBug && typeof obj === 'function') {"," for (key in obj) {"," if (owns(obj, key) && key !== 'prototype') {"," keys.push(key);"," }"," }"," } else {"," for (key in obj) {"," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," if (hasEnumBug) {"," for (i = 0, len = forceEnum.length; i < len; ++i) {"," key = forceEnum[i];",""," if (owns(obj, key)) {"," keys.push(key);"," }"," }"," }",""," return keys;","};","","/**"," * Returns an array containing the values of the object's enumerable keys."," *"," * Note that values are returned in enumeration order (that is, in the same"," * order that they would be enumerated by a `for-in` loop), which may not be the"," * same as the order in which they were defined."," *"," * @example"," *"," * Y.Object.values({a: 'foo', b: 'bar', c: 'baz'});"," * // => ['foo', 'bar', 'baz']"," *"," * @method values"," * @param {Object} obj An object."," * @return {Array} Array of values."," * @static"," */","O.values = function (obj) {"," var keys = O.keys(obj),"," i = 0,"," len = keys.length,"," values = [];",""," for (; i < len; ++i) {"," values.push(obj[keys[i]]);"," }",""," return values;","};","","/**"," * Returns the number of enumerable keys owned by an object."," *"," * @method size"," * @param {Object} obj An object."," * @return {Number} The object's size."," * @static"," */","O.size = function (obj) {"," try {"," return O.keys(obj).length;"," } catch (ex) {"," return 0; // Legacy behavior for non-objects."," }","};","","/**"," * Returns `true` if the object owns an enumerable property with the specified"," * value."," *"," * @method hasValue"," * @param {Object} obj An object."," * @param {any} value The value to search for."," * @return {Boolean} `true` if _obj_ contains _value_, `false` otherwise."," * @static"," */","O.hasValue = function (obj, value) {"," return Y.Array.indexOf(O.values(obj), value) > -1;","};","","/**"," * Executes a function on each enumerable property in _obj_. The function"," * receives the value, the key, and the object itself as parameters (in that"," * order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method each"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {YUI} the YUI instance."," * @chainable"," * @static"," */","O.each = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," fn.call(thisObj || Y, obj[key], key, obj);"," }"," }",""," return Y;","};","","/**"," * Executes a function on each enumerable property in _obj_, but halts if the"," * function returns a truthy value. The function receives the value, the key,"," * and the object itself as paramters (in that order)."," *"," * By default, only properties owned by _obj_ are enumerated. To include"," * prototype properties, set the _proto_ parameter to `true`."," *"," * @method some"," * @param {Object} obj Object to enumerate."," * @param {Function} fn Function to execute on each enumerable property."," * @param {mixed} fn.value Value of the current property."," * @param {String} fn.key Key of the current property."," * @param {Object} fn.obj Object being enumerated."," * @param {Object} [thisObj] `this` object to use when calling _fn_."," * @param {Boolean} [proto=false] Include prototype properties."," * @return {Boolean} `true` if any execution of _fn_ returns a truthy value,"," * `false` otherwise."," * @static"," */","O.some = function (obj, fn, thisObj, proto) {"," var key;",""," for (key in obj) {"," if (proto || owns(obj, key)) {"," if (fn.call(thisObj || Y, obj[key], key, obj)) {"," return true;"," }"," }"," }",""," return false;","};","","/**"," * Retrieves the sub value at the provided path,"," * from the value object provided."," *"," * @method getValue"," * @static"," * @param o The object from which to extract the property value."," * @param path {Array} A path array, specifying the object traversal path"," * from which to obtain the sub value."," * @return {Any} The value stored in the path, undefined if not found,"," * undefined if the source is not an object. Returns the source object"," * if an empty path is provided."," */","O.getValue = function(o, path) {"," if (!Lang.isObject(o)) {"," return UNDEFINED;"," }",""," var i,"," p = Y.Array(path),"," l = p.length;",""," for (i = 0; o !== UNDEFINED && i < l; i++) {"," o = o[p[i]];"," }",""," return o;","};","","/**"," * Sets the sub-attribute value at the provided path on the"," * value object. Returns the modified value object, or"," * undefined if the path is invalid."," *"," * @method setValue"," * @static"," * @param o The object on which to set the sub value."," * @param path {Array} A path array, specifying the object traversal path"," * at which to set the sub value."," * @param val {Any} The new value for the sub-attribute."," * @return {Object} The modified object, with the new sub value set, or"," * undefined, if the path was invalid."," */","O.setValue = function(o, path, val) {"," var i,"," p = Y.Array(path),"," leafIdx = p.length - 1,"," ref = o;",""," if (leafIdx >= 0) {"," for (i = 0; ref !== UNDEFINED && i < leafIdx; i++) {"," ref = ref[p[i]];"," }",""," if (ref !== UNDEFINED) {"," ref[p[i]] = val;"," } else {"," return UNDEFINED;"," }"," }",""," return o;","};","","/**"," * Returns `true` if the object has no enumerable properties of its own."," *"," * @method isEmpty"," * @param {Object} obj An object."," * @return {Boolean} `true` if the object is empty."," * @static"," * @since 3.2.0"," */","O.isEmpty = function (obj) {"," return !O.keys(Object(obj)).length;","};","/**"," * The YUI module contains the components required for building the YUI seed"," * file. This includes the script loading mechanism, a simple queue, and the"," * core utilities for the library."," * @module yui"," * @submodule yui-base"," */","","/**"," * YUI user agent detection."," * Do not fork for a browser if it can be avoided. Use feature detection when"," * you can. Use the user agent as a last resort. For all fields listed"," * as @type float, UA stores a version number for the browser engine,"," * 0 otherwise. This value may or may not map to the version number of"," * the browser using the engine. The value is presented as a float so"," * that it can easily be used for boolean evaluation as well as for"," * looking for a particular range of versions. Because of this,"," * some of the granularity of the version info may be lost. The fields that"," * are @type string default to null. The API docs list the values that"," * these fields can have."," * @class UA"," * @static"," */","","/**","* Static method on `YUI.Env` for parsing a UA string. Called at instantiation","* to populate `Y.UA`.","*","* @static","* @method parseUA","* @param {String} [subUA=navigator.userAgent] UA string to parse","* @return {Object} The Y.UA object","*/","YUI.Env.parseUA = function(subUA) {",""," var numberify = function(s) {"," var c = 0;"," return parseFloat(s.replace(/\\./g, function() {"," return (c++ === 1) ? '' : '.';"," }));"," },",""," win = Y.config.win,",""," nav = win && win.navigator,",""," o = {",""," /**"," * Internet Explorer version number or 0. Example: 6"," * @property ie"," * @type float"," * @static"," */"," ie: 0,",""," /**"," * Opera version number or 0. Example: 9.2"," * @property opera"," * @type float"," * @static"," */"," opera: 0,",""," /**"," * Gecko engine revision number. Will evaluate to 1 if Gecko"," * is detected but the revision could not be found. Other browsers"," * will be 0. Example: 1.8"," * <pre>"," * Firefox 1.0.0.4: 1.7.8 <-- Reports 1.7"," * Firefox 1.5.0.9: 1.8.0.9 <-- 1.8"," * Firefox 2.0.0.3: 1.8.1.3 <-- 1.81"," * Firefox 3.0 <-- 1.9"," * Firefox 3.5 <-- 1.91"," * </pre>"," * @property gecko"," * @type float"," * @static"," */"," gecko: 0,",""," /**"," * AppleWebKit version. KHTML browsers that are not WebKit browsers"," * will evaluate to 1, other browsers 0. Example: 418.9"," * <pre>"," * Safari 1.3.2 (312.6): 312.8.1 <-- Reports 312.8 -- currently the"," * latest available for Mac OSX 10.3."," * Safari 2.0.2: 416 <-- hasOwnProperty introduced"," * Safari 2.0.4: 418 <-- preventDefault fixed"," * Safari 2.0.4 (419.3): 418.9.1 <-- One version of Safari may run"," * different versions of webkit"," * Safari 2.0.4 (419.3): 419 <-- Tiger installations that have been"," * updated, but not updated"," * to the latest patch."," * Webkit 212 nightly: 522+ <-- Safari 3.0 precursor (with native"," * SVG and many major issues fixed)."," * Safari 3.0.4 (523.12) 523.12 <-- First Tiger release - automatic"," * update from 2.x via the 10.4.11 OS patch."," * Webkit nightly 1/2008:525+ <-- Supports DOMContentLoaded event."," * yahoo.com user agent hack removed."," * </pre>"," * http://en.wikipedia.org/wiki/Safari_version_history"," * @property webkit"," * @type float"," * @static"," */"," webkit: 0,",""," /**"," * Safari will be detected as webkit, but this property will also"," * be populated with the Safari version number"," * @property safari"," * @type float"," * @static"," */"," safari: 0,",""," /**"," * Chrome will be detected as webkit, but this property will also"," * be populated with the Chrome version number"," * @property chrome"," * @type float"," * @static"," */"," chrome: 0,",""," /**"," * The mobile property will be set to a string containing any relevant"," * user agent information when a modern mobile browser is detected."," * Currently limited to Safari on the iPhone/iPod Touch, Nokia N-series"," * devices with the WebKit-based browser, and Opera Mini."," * @property mobile"," * @type string"," * @default null"," * @static"," */"," mobile: null,",""," /**"," * Adobe AIR version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property air"," * @type float"," */"," air: 0,"," /**"," * PhantomJS version number or 0. Only populated if webkit is detected."," * Example: 1.0"," * @property phantomjs"," * @type float"," */"," phantomjs: 0,"," /**"," * Detects Apple iPad's OS version"," * @property ipad"," * @type float"," * @static"," */"," ipad: 0,"," /**"," * Detects Apple iPhone's OS version"," * @property iphone"," * @type float"," * @static"," */"," iphone: 0,"," /**"," * Detects Apples iPod's OS version"," * @property ipod"," * @type float"," * @static"," */"," ipod: 0,"," /**"," * General truthy check for iPad, iPhone or iPod"," * @property ios"," * @type Boolean"," * @default null"," * @static"," */"," ios: null,"," /**"," * Detects Googles Android OS version"," * @property android"," * @type float"," * @static"," */"," android: 0,"," /**"," * Detects Kindle Silk"," * @property silk"," * @type float"," * @static"," */"," silk: 0,"," /**"," * Detects Kindle Silk Acceleration"," * @property accel"," * @type Boolean"," * @static"," */"," accel: false,"," /**"," * Detects Palms WebOS version"," * @property webos"," * @type float"," * @static"," */"," webos: 0,",""," /**"," * Google Caja version number or 0."," * @property caja"," * @type float"," */"," caja: nav && nav.cajaVersion,",""," /**"," * Set to true if the page appears to be in SSL"," * @property secure"," * @type boolean"," * @static"," */"," secure: false,",""," /**"," * The operating system. Currently only detecting windows or macintosh"," * @property os"," * @type string"," * @default null"," * @static"," */"," os: null,",""," /**"," * The Nodejs Version"," * @property nodejs"," * @type float"," * @default 0"," * @static"," */"," nodejs: 0,"," /*"," * Window8/IE10 Application host environment"," * @property winjs"," * @type Boolean"," * @static"," */"," winjs: !!((typeof Windows !== \"undefined\") && Windows.System),"," /**"," * Are touch/msPointer events available on this device"," * @property touchEnabled"," * @type Boolean"," * @static"," */"," touchEnabled: false"," },",""," ua = subUA || nav && nav.userAgent,",""," loc = win && win.location,",""," href = loc && loc.href,",""," m;",""," /**"," * The User Agent string that was parsed"," * @property userAgent"," * @type String"," * @static"," */"," o.userAgent = ua;","",""," o.secure = href && (href.toLowerCase().indexOf('https') === 0);",""," if (ua) {",""," if ((/windows|win32/i).test(ua)) {"," o.os = 'windows';"," } else if ((/macintosh|mac_powerpc/i).test(ua)) {"," o.os = 'macintosh';"," } else if ((/android/i).test(ua)) {"," o.os = 'android';"," } else if ((/symbos/i).test(ua)) {"," o.os = 'symbos';"," } else if ((/linux/i).test(ua)) {"," o.os = 'linux';"," } else if ((/rhino/i).test(ua)) {"," o.os = 'rhino';"," }",""," // Modern KHTML browsers should qualify as Safari X-Grade"," if ((/KHTML/).test(ua)) {"," o.webkit = 1;"," }"," if ((/IEMobile|XBLWP7/).test(ua)) {"," o.mobile = 'windows';"," }"," if ((/Fennec/).test(ua)) {"," o.mobile = 'gecko';"," }"," // Modern WebKit browsers are at least X-Grade"," m = ua.match(/AppleWebKit\\/([^\\s]*)/);"," if (m && m[1]) {"," o.webkit = numberify(m[1]);"," o.safari = o.webkit;",""," if (/PhantomJS/.test(ua)) {"," m = ua.match(/PhantomJS\\/([^\\s]*)/);"," if (m && m[1]) {"," o.phantomjs = numberify(m[1]);"," }"," }",""," // Mobile browser check"," if (/ Mobile\\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {"," o.mobile = 'Apple'; // iPhone or iPod Touch",""," m = ua.match(/OS ([^\\s]*)/);"," if (m && m[1]) {"," m = numberify(m[1].replace('_', '.'));"," }"," o.ios = m;"," o.os = 'ios';"," o.ipad = o.ipod = o.iphone = 0;",""," m = ua.match(/iPad|iPod|iPhone/);"," if (m && m[0]) {"," o[m[0].toLowerCase()] = o.ios;"," }"," } else {"," m = ua.match(/NokiaN[^\\/]*|webOS\\/\\d\\.\\d/);"," if (m) {"," // Nokia N-series, webOS, ex: NokiaN95"," o.mobile = m[0];"," }"," if (/webOS/.test(ua)) {"," o.mobile = 'WebOS';"," m = ua.match(/webOS\\/([^\\s]*);/);"," if (m && m[1]) {"," o.webos = numberify(m[1]);"," }"," }"," if (/ Android/.test(ua)) {"," if (/Mobile/.test(ua)) {"," o.mobile = 'Android';"," }"," m = ua.match(/Android ([^\\s]*);/);"," if (m && m[1]) {"," o.android = numberify(m[1]);"," }",""," }"," if (/Silk/.test(ua)) {"," m = ua.match(/Silk\\/([^\\s]*)\\)/);"," if (m && m[1]) {"," o.silk = numberify(m[1]);"," }"," if (!o.android) {"," o.android = 2.34; //Hack for desktop mode in Kindle"," o.os = 'Android';"," }"," if (/Accelerated=true/.test(ua)) {"," o.accel = true;"," }"," }"," }",""," m = ua.match(/(Chrome|CrMo|CriOS)\\/([^\\s]*)/);"," if (m && m[1] && m[2]) {"," o.chrome = numberify(m[2]); // Chrome"," o.safari = 0; //Reset safari back to 0"," if (m[1] === 'CrMo') {"," o.mobile = 'chrome';"," }"," } else {"," m = ua.match(/AdobeAIR\\/([^\\s]*)/);"," if (m) {"," o.air = m[0]; // Adobe AIR 1.0 or better"," }"," }"," }",""," if (!o.webkit) { // not webkit","// @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)"," if (/Opera/.test(ua)) {"," m = ua.match(/Opera[\\s\\/]([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," m = ua.match(/Version\\/([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]); // opera 10+"," }",""," if (/Opera Mobi/.test(ua)) {"," o.mobile = 'opera';"," m = ua.replace('Opera Mobi', '').match(/Opera ([^\\s]*)/);"," if (m && m[1]) {"," o.opera = numberify(m[1]);"," }"," }"," m = ua.match(/Opera Mini[^;]*/);",""," if (m) {"," o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316"," }"," } else { // not opera or webkit"," m = ua.match(/MSIE\\s([^;]*)/);"," if (m && m[1]) {"," o.ie = numberify(m[1]);"," } else { // not opera, webkit, or ie"," m = ua.match(/Gecko\\/([^\\s]*)/);"," if (m) {"," o.gecko = 1; // Gecko detected, look for revision"," m = ua.match(/rv:([^\\s\\)]*)/);"," if (m && m[1]) {"," o.gecko = numberify(m[1]);"," }"," }"," }"," }"," }"," }",""," //Check for known properties to tell if touch events are enabled on this device or if"," //the number of MSPointer touchpoints on this device is greater than 0."," if (win && nav && !(o.chrome && o.chrome < 6)) {"," o.touchEnabled = ((\"ontouchstart\" in win) || ((\"msMaxTouchPoints\" in nav) && (nav.msMaxTouchPoints > 0)));"," }",""," //It was a parsed UA, do not assign the global value."," if (!subUA) {",""," if (typeof process === 'object') {",""," if (process.versions && process.versions.node) {"," //NodeJS"," o.os = process.platform;"," o.nodejs = numberify(process.versions.node);"," }"," }",""," YUI.Env.UA = o;",""," }",""," return o;","};","","","Y.UA = YUI.Env.UA || YUI.Env.parseUA();","","/**","Performs a simple comparison between two version numbers, accounting for","standard versioning logic such as the fact that \"535.8\" is a lower version than","\"535.24\", even though a simple numerical comparison would indicate that it's","greater. Also accounts for cases such as \"1.1\" vs. \"1.1.0\", which are","considered equivalent.","","Returns -1 if version _a_ is lower than version _b_, 0 if they're equivalent,","1 if _a_ is higher than _b_.","","Versions may be numbers or strings containing numbers and dots. For example,","both `535` and `\"535.8.10\"` are acceptable. A version string containing","non-numeric characters, like `\"535.8.beta\"`, may produce unexpected results.","","@method compareVersions","@param {Number|String} a First version number to compare.","@param {Number|String} b Second version number to compare.","@return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is"," higher than _b_.","**/","Y.UA.compareVersions = function (a, b) {"," var aPart, aParts, bPart, bParts, i, len;",""," if (a === b) {"," return 0;"," }",""," aParts = (a + '').split('.');"," bParts = (b + '').split('.');",""," for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {"," aPart = parseInt(aParts[i], 10);"," bPart = parseInt(bParts[i], 10);",""," isNaN(aPart) && (aPart = 0);"," isNaN(bPart) && (bPart = 0);",""," if (aPart < bPart) {"," return -1;"," }",""," if (aPart > bPart) {"," return 1;"," }"," }",""," return 0;","};","YUI.Env.aliases = {"," \"anim\": [\"anim-base\",\"anim-color\",\"anim-curve\",\"anim-easing\",\"anim-node-plugin\",\"anim-scroll\",\"anim-xy\"],"," \"anim-shape-transform\": [\"anim-shape\"],"," \"app\": [\"app-base\",\"app-content\",\"app-transitions\",\"lazy-model-list\",\"model\",\"model-list\",\"model-sync-rest\",\"router\",\"view\",\"view-node-map\"],"," \"attribute\": [\"attribute-base\",\"attribute-complex\"],"," \"autocomplete\": [\"autocomplete-base\",\"autocomplete-sources\",\"autocomplete-list\",\"autocomplete-plugin\"],"," \"base\": [\"base-base\",\"base-pluginhost\",\"base-build\"],"," \"cache\": [\"cache-base\",\"cache-offline\",\"cache-plugin\"],"," \"collection\": [\"array-extras\",\"arraylist\",\"arraylist-add\",\"arraylist-filter\",\"array-invoke\"],"," \"controller\": [\"router\"],"," \"dataschema\": [\"dataschema-base\",\"dataschema-json\",\"dataschema-xml\",\"dataschema-array\",\"dataschema-text\"],"," \"datasource\": [\"datasource-local\",\"datasource-io\",\"datasource-get\",\"datasource-function\",\"datasource-cache\",\"datasource-jsonschema\",\"datasource-xmlschema\",\"datasource-arrayschema\",\"datasource-textschema\",\"datasource-polling\"],"," \"datatable\": [\"datatable-core\",\"datatable-table\",\"datatable-head\",\"datatable-body\",\"datatable-base\",\"datatable-column-widths\",\"datatable-message\",\"datatable-mutable\",\"datatable-sort\",\"datatable-datasource\"],"," \"datatable-deprecated\": [\"datatable-base-deprecated\",\"datatable-datasource-deprecated\",\"datatable-sort-deprecated\",\"datatable-scroll-deprecated\"],"," \"datatype\": [\"datatype-date\",\"datatype-number\",\"datatype-xml\"],"," \"datatype-date\": [\"datatype-date-parse\",\"datatype-date-format\",\"datatype-date-math\"],"," \"datatype-number\": [\"datatype-number-parse\",\"datatype-number-format\"],"," \"datatype-xml\": [\"datatype-xml-parse\",\"datatype-xml-format\"],"," \"dd\": [\"dd-ddm-base\",\"dd-ddm\",\"dd-ddm-drop\",\"dd-drag\",\"dd-proxy\",\"dd-constrain\",\"dd-drop\",\"dd-scroll\",\"dd-delegate\"],"," \"dom\": [\"dom-base\",\"dom-screen\",\"dom-style\",\"selector-native\",\"selector\"],"," \"editor\": [\"frame\",\"editor-selection\",\"exec-command\",\"editor-base\",\"editor-para\",\"editor-br\",\"editor-bidi\",\"editor-tab\",\"createlink-base\"],"," \"event\": [\"event-base\",\"event-delegate\",\"event-synthetic\",\"event-mousewheel\",\"event-mouseenter\",\"event-key\",\"event-focus\",\"event-resize\",\"event-hover\",\"event-outside\",\"event-touch\",\"event-move\",\"event-flick\",\"event-valuechange\",\"event-tap\"],"," \"event-custom\": [\"event-custom-base\",\"event-custom-complex\"],"," \"event-gestures\": [\"event-flick\",\"event-move\"],"," \"handlebars\": [\"handlebars-compiler\"],"," \"highlight\": [\"highlight-base\",\"highlight-accentfold\"],"," \"history\": [\"history-base\",\"history-hash\",\"history-hash-ie\",\"history-html5\"],"," \"io\": [\"io-base\",\"io-xdr\",\"io-form\",\"io-upload-iframe\",\"io-queue\"],"," \"json\": [\"json-parse\",\"json-stringify\"],"," \"loader\": [\"loader-base\",\"loader-rollup\",\"loader-yui3\"],"," \"node\": [\"node-base\",\"node-event-delegate\",\"node-pluginhost\",\"node-screen\",\"node-style\"],"," \"pluginhost\": [\"pluginhost-base\",\"pluginhost-config\"],"," \"querystring\": [\"querystring-parse\",\"querystring-stringify\"],"," \"recordset\": [\"recordset-base\",\"recordset-sort\",\"recordset-filter\",\"recordset-indexer\"],"," \"resize\": [\"resize-base\",\"resize-proxy\",\"resize-constrain\"],"," \"slider\": [\"slider-base\",\"slider-value-range\",\"clickable-rail\",\"range-slider\"],"," \"text\": [\"text-accentfold\",\"text-wordbreak\"],"," \"widget\": [\"widget-base\",\"widget-htmlparser\",\"widget-skin\",\"widget-uievents\"]","};","","","}, '3.7.3', {\"use\": [\"yui-base\", \"get\", \"features\", \"intl-base\", \"yui-log\", \"yui-later\", \"loader-base\", \"loader-rollup\", \"loader-yui3\"]});"]; /** * The YUI module contains the components required for building the YUI seed * file. This includes the script loading mechanism, a simple queue, and@@ -42,9 +42,9 @@ * @submodule yui-base */ -_yuitest_coverage["build/yui/yui.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3556":0,"3559":0,"3561":0,"3563":0,"3564":0,"3565":0,"3566":0,"3567":0,"3568":0,"3569":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3578":0,"3579":0,"3581":0,"3582":0,"3584":0,"3585":0,"3588":0,"3589":0,"3590":0,"3591":0,"3593":0,"3594":0,"3595":0,"3596":0,"3601":0,"3602":0,"3604":0,"3605":0,"3606":0,"3608":0,"3609":0,"3610":0,"3612":0,"3613":0,"3614":0,"3617":0,"3618":0,"3620":0,"3622":0,"3623":0,"3624":0,"3625":0,"3626":0,"3629":0,"3630":0,"3631":0,"3633":0,"3634":0,"3635":0,"3639":0,"3640":0,"3641":0,"3642":0,"3644":0,"3645":0,"3646":0,"3648":0,"3649":0,"3654":0,"3655":0,"3656":0,"3657":0,"3658":0,"3659":0,"3662":0,"3663":0,"3664":0,"3669":0,"3671":0,"3672":0,"3673":0,"3674":0,"3676":0,"3677":0,"3678":0,"3681":0,"3682":0,"3683":0,"3684":0,"3685":0,"3688":0,"3690":0,"3691":0,"3694":0,"3695":0,"3696":0,"3698":0,"3699":0,"3700":0,"3701":0,"3702":0,"3703":0,"3712":0,"3714":0,"3716":0,"3718":0,"3719":0,"3723":0,"3727":0,"3731":0,"3753":0,"3754":0,"3756":0,"3757":0,"3760":0,"3761":0,"3763":0,"3764":0,"3765":0,"3767":0,"3768":0,"3770":0,"3771":0,"3774":0,"3775":0,"3779":0,"3781":0};-_yuitest_coverage["build/yui/yui.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3753":0,"(anonymous 8):1950":0};-_yuitest_coverage["build/yui/yui.js"].coveredLines = 822;+_yuitest_coverage["build/yui/yui.js"].lines = {"10":0,"11":0,"54":0,"55":0,"60":0,"64":0,"65":0,"68":0,"96":0,"97":0,"126":0,"127":0,"131":0,"132":0,"136":0,"141":0,"142":0,"145":0,"148":0,"150":0,"153":0,"155":0,"179":0,"180":0,"181":0,"182":0,"186":0,"188":0,"189":0,"191":0,"192":0,"196":0,"197":0,"198":0,"199":0,"203":0,"208":0,"210":0,"211":0,"212":0,"213":0,"214":0,"216":0,"217":0,"219":0,"220":0,"222":0,"224":0,"228":0,"229":0,"230":0,"239":0,"240":0,"241":0,"243":0,"244":0,"247":0,"248":0,"251":0,"263":0,"265":0,"274":0,"275":0,"276":0,"277":0,"278":0,"279":0,"280":0,"281":0,"282":0,"283":0,"284":0,"285":0,"286":0,"289":0,"294":0,"295":0,"306":0,"315":0,"326":0,"328":0,"329":0,"375":0,"378":0,"379":0,"383":0,"387":0,"388":0,"390":0,"395":0,"399":0,"403":0,"404":0,"405":0,"406":0,"407":0,"408":0,"409":0,"410":0,"416":0,"421":0,"423":0,"425":0,"426":0,"427":0,"429":0,"431":0,"432":0,"433":0,"435":0,"436":0,"437":0,"441":0,"444":0,"445":0,"449":0,"452":0,"465":0,"466":0,"467":0,"468":0,"469":0,"470":0,"472":0,"476":0,"478":0,"480":0,"481":0,"483":0,"484":0,"495":0,"500":0,"501":0,"502":0,"506":0,"507":0,"509":0,"510":0,"526":0,"527":0,"528":0,"531":0,"532":0,"533":0,"534":0,"535":0,"536":0,"537":0,"538":0,"541":0,"544":0,"583":0,"584":0,"596":0,"597":0,"598":0,"600":0,"601":0,"602":0,"603":0,"604":0,"605":0,"606":0,"607":0,"608":0,"615":0,"627":0,"639":0,"640":0,"641":0,"642":0,"643":0,"644":0,"645":0,"646":0,"647":0,"648":0,"649":0,"655":0,"656":0,"658":0,"659":0,"660":0,"661":0,"663":0,"664":0,"665":0,"667":0,"668":0,"669":0,"670":0,"676":0,"677":0,"678":0,"679":0,"680":0,"684":0,"687":0,"688":0,"689":0,"690":0,"698":0,"699":0,"700":0,"701":0,"702":0,"703":0,"706":0,"709":0,"710":0,"711":0,"712":0,"714":0,"715":0,"716":0,"719":0,"720":0,"721":0,"722":0,"723":0,"725":0,"730":0,"731":0,"732":0,"733":0,"734":0,"736":0,"741":0,"742":0,"743":0,"745":0,"746":0,"748":0,"749":0,"754":0,"755":0,"756":0,"757":0,"758":0,"760":0,"771":0,"782":0,"785":0,"787":0,"788":0,"791":0,"792":0,"793":0,"794":0,"795":0,"796":0,"851":0,"861":0,"862":0,"863":0,"864":0,"867":0,"869":0,"870":0,"873":0,"874":0,"875":0,"876":0,"877":0,"881":0,"882":0,"884":0,"885":0,"889":0,"890":0,"891":0,"893":0,"894":0,"898":0,"909":0,"910":0,"911":0,"912":0,"913":0,"914":0,"916":0,"917":0,"919":0,"920":0,"922":0,"940":0,"941":0,"944":0,"963":0,"965":0,"966":0,"969":0,"970":0,"971":0,"972":0,"973":0,"975":0,"978":0,"981":0,"983":0,"984":0,"985":0,"986":0,"990":0,"991":0,"994":0,"995":0,"996":0,"998":0,"999":0,"1000":0,"1001":0,"1005":0,"1006":0,"1008":0,"1013":0,"1014":0,"1018":0,"1019":0,"1026":0,"1034":0,"1036":0,"1037":0,"1038":0,"1039":0,"1040":0,"1041":0,"1042":0,"1043":0,"1045":0,"1050":0,"1051":0,"1052":0,"1053":0,"1054":0,"1058":0,"1059":0,"1061":0,"1062":0,"1066":0,"1067":0,"1074":0,"1075":0,"1076":0,"1077":0,"1078":0,"1081":0,"1082":0,"1083":0,"1085":0,"1088":0,"1089":0,"1095":0,"1096":0,"1097":0,"1098":0,"1099":0,"1100":0,"1101":0,"1102":0,"1105":0,"1107":0,"1110":0,"1111":0,"1112":0,"1117":0,"1118":0,"1119":0,"1120":0,"1121":0,"1122":0,"1123":0,"1124":0,"1125":0,"1127":0,"1129":0,"1131":0,"1132":0,"1133":0,"1134":0,"1135":0,"1136":0,"1137":0,"1141":0,"1142":0,"1144":0,"1145":0,"1151":0,"1152":0,"1153":0,"1157":0,"1195":0,"1197":0,"1198":0,"1199":0,"1200":0,"1201":0,"1202":0,"1203":0,"1204":0,"1207":0,"1208":0,"1211":0,"1218":0,"1236":0,"1238":0,"1239":0,"1242":0,"1243":0,"1245":0,"1248":0,"1258":0,"1259":0,"1273":0,"1274":0,"1275":0,"1280":0,"1281":0,"1283":0,"1286":0,"1287":0,"1288":0,"1289":0,"1290":0,"1292":0,"1296":0,"1305":0,"1306":0,"1307":0,"1309":0,"1310":0,"1311":0,"1325":0,"1328":0,"1329":0,"1330":0,"1366":0,"1367":0,"1368":0,"1371":0,"1372":0,"1375":0,"1377":0,"1381":0,"1383":0,"1387":0,"1389":0,"1392":0,"1393":0,"1397":0,"1398":0,"1950":0,"1972":0,"2020":0,"2021":0,"2038":0,"2039":0,"2049":0,"2050":0,"2060":0,"2061":0,"2088":0,"2089":0,"2099":0,"2100":0,"2110":0,"2111":0,"2125":0,"2126":0,"2127":0,"2138":0,"2139":0,"2149":0,"2150":0,"2162":0,"2163":0,"2165":0,"2167":0,"2171":0,"2174":0,"2186":0,"2187":0,"2201":0,"2202":0,"2203":0,"2215":0,"2216":0,"2218":0,"2219":0,"2221":0,"2232":0,"2233":0,"2235":0,"2245":0,"2246":0,"2248":0,"2278":0,"2279":0,"2286":0,"2319":0,"2320":0,"2322":0,"2324":0,"2326":0,"2327":0,"2329":0,"2331":0,"2332":0,"2335":0,"2339":0,"2342":0,"2358":0,"2359":0,"2363":0,"2364":0,"2366":0,"2367":0,"2368":0,"2372":0,"2390":0,"2391":0,"2392":0,"2394":0,"2395":0,"2396":0,"2400":0,"2427":0,"2428":0,"2432":0,"2433":0,"2434":0,"2438":0,"2455":0,"2456":0,"2459":0,"2461":0,"2462":0,"2464":0,"2465":0,"2467":0,"2468":0,"2472":0,"2473":0,"2474":0,"2478":0,"2500":0,"2501":0,"2520":0,"2521":0,"2523":0,"2524":0,"2525":0,"2529":0,"2550":0,"2551":0,"2553":0,"2554":0,"2555":0,"2556":0,"2560":0,"2561":0,"2566":0,"2584":0,"2585":0,"2586":0,"2589":0,"2604":0,"2614":0,"2624":0,"2635":0,"2637":0,"2647":0,"2651":0,"2653":0,"2664":0,"2693":0,"2694":0,"2696":0,"2697":0,"2701":0,"2702":0,"2705":0,"2725":0,"2729":0,"2735":0,"2750":0,"2751":0,"2757":0,"2758":0,"2760":0,"2761":0,"2762":0,"2767":0,"2804":0,"2805":0,"2810":0,"2811":0,"2814":0,"2818":0,"2819":0,"2825":0,"2826":0,"2831":0,"2832":0,"2835":0,"2836":0,"2841":0,"2843":0,"2844":0,"2845":0,"2852":0,"2853":0,"2859":0,"2861":0,"2871":0,"2872":0,"2876":0,"2880":0,"2886":0,"2887":0,"2893":0,"2895":0,"2897":0,"2898":0,"2899":0,"2906":0,"2907":0,"2911":0,"2927":0,"2949":0,"2952":0,"2955":0,"2956":0,"2957":0,"3019":0,"3031":0,"3054":0,"3055":0,"3056":0,"3059":0,"3062":0,"3063":0,"3064":0,"3065":0,"3069":0,"3070":0,"3071":0,"3076":0,"3077":0,"3078":0,"3080":0,"3081":0,"3086":0,"3106":0,"3107":0,"3112":0,"3113":0,"3116":0,"3127":0,"3128":0,"3129":0,"3131":0,"3145":0,"3146":0,"3169":0,"3170":0,"3172":0,"3173":0,"3174":0,"3178":0,"3201":0,"3202":0,"3204":0,"3205":0,"3206":0,"3207":0,"3212":0,"3228":0,"3229":0,"3230":0,"3233":0,"3237":0,"3238":0,"3241":0,"3258":0,"3259":0,"3264":0,"3265":0,"3266":0,"3269":0,"3270":0,"3272":0,"3276":0,"3288":0,"3289":0,"3324":0,"3326":0,"3327":0,"3328":0,"3329":0,"3563":0,"3566":0,"3568":0,"3570":0,"3571":0,"3572":0,"3573":0,"3574":0,"3575":0,"3576":0,"3577":0,"3578":0,"3579":0,"3580":0,"3581":0,"3585":0,"3586":0,"3588":0,"3589":0,"3591":0,"3592":0,"3595":0,"3596":0,"3597":0,"3598":0,"3600":0,"3601":0,"3602":0,"3603":0,"3608":0,"3609":0,"3611":0,"3612":0,"3613":0,"3615":0,"3616":0,"3617":0,"3619":0,"3620":0,"3621":0,"3624":0,"3625":0,"3627":0,"3629":0,"3630":0,"3631":0,"3632":0,"3633":0,"3636":0,"3637":0,"3638":0,"3640":0,"3641":0,"3642":0,"3646":0,"3647":0,"3648":0,"3649":0,"3651":0,"3652":0,"3653":0,"3655":0,"3656":0,"3661":0,"3662":0,"3663":0,"3664":0,"3665":0,"3666":0,"3669":0,"3670":0,"3671":0,"3676":0,"3678":0,"3679":0,"3680":0,"3681":0,"3683":0,"3684":0,"3685":0,"3688":0,"3689":0,"3690":0,"3691":0,"3692":0,"3695":0,"3697":0,"3698":0,"3701":0,"3702":0,"3703":0,"3705":0,"3706":0,"3707":0,"3708":0,"3709":0,"3710":0,"3720":0,"3721":0,"3725":0,"3727":0,"3729":0,"3731":0,"3732":0,"3736":0,"3740":0,"3744":0,"3766":0,"3767":0,"3769":0,"3770":0,"3773":0,"3774":0,"3776":0,"3777":0,"3778":0,"3780":0,"3781":0,"3783":0,"3784":0,"3787":0,"3788":0,"3792":0,"3794":0};+_yuitest_coverage["build/yui/yui.js"].functions = {"instanceOf:59":0,"YUI:54":0,"add:178":0,"remove:185":0,"handleLoad:195":0,"getLoader:202":0,"clobber:227":0,"applyConfig:261":0,"_config:305":0,"parseBasePath:374":0,"(anonymous 2):398":0,"_init:314":0,"_setup:494":0,"applyTo:525":0,"add:582":0,"_attach:626":0,"(anonymous 5):794":0,"(anonymous 4):793":0,"(anonymous 3):791":0,"_delayCallback:780":0,"(anonymous 6):893":0,"use:850":0,"_notify:908":0,"process:961":0,"(anonymous 7):1052":0,"handleLoader:1025":0,"handleBoot:1131":0,"_use:938":0,"namespace:1194":0,"dump:1218":0,"error:1233":0,"guid:1257":0,"stamp:1272":0,"destroy:1304":0,"applyConfig:1366":0,"(anonymous 1):153":0,"_isNative:2020":0,"isArray:2038":0,"isBoolean:2049":0,"isDate:2060":0,"isFunction:2088":0,"isNull:2099":0,"isNumber:2110":0,"isObject:2125":0,"isString:2138":0,"isUndefined:2149":0,"isValue:2162":0,"(anonymous 9):2186":0,"(anonymous 10):2202":0,"sub:2201":0,"(anonymous 11):2215":0,"}:2217":0,"(anonymous 12):2232":0,"}:2234":0,"(anonymous 13):2245":0,"}:2247":0,"type:2278":0,"YArray:2319":0,"dedupe:2358":0,"(anonymous 14):2390":0,"}:2393":0,"hash:2427":0,"(anonymous 15):2455":0,"}:2457":0,"numericSort:2500":0,"(anonymous 16):2520":0,"}:2522":0,"test:2550":0,"Queue:2584":0,"_init:2596":0,"next:2613":0,"last:2623":0,"add:2634":0,"size:2646":0,"(anonymous 17):2696":0,"cached:2693":0,"getLocation:2725":0,"merge:2750":0,"mix:2804":0,"(anonymous 18):2943":0,"F:2952":0,"(anonymous 20):2955":0,"(anonymous 19):2950":0,"owns:3018":0,"keys:3054":0,"values:3106":0,"size:3127":0,"hasValue:3145":0,"each:3169":0,"some:3201":0,"getValue:3228":0,"setValue:3258":0,"isEmpty:3288":0,"(anonymous 22):3328":0,"numberify:3326":0,"parseUA:3324":0,"compareVersions:3766":0,"(anonymous 8):1950":0};+_yuitest_coverage["build/yui/yui.js"].coveredLines = 824; _yuitest_coverage["build/yui/yui.js"].coveredFunctions = 98; _yuitest_coverline("build/yui/yui.js", 10); if (typeof YUI != 'undefined') {@@ -217,7 +217,7 @@ _yuitest_coverfunc("build/yui/yui.js", "(anonymous 1)", 153); _yuitest_coverline("build/yui/yui.js", 155); var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -3221,11 +3221,11 @@ if (Lang.isObject(obj)) { _yuitest_coverline("build/yui/yui.js", 2556); try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug). _yuitest_coverline("build/yui/yui.js", 2560);-if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { _yuitest_coverline("build/yui/yui.js", 2561); result = 2; }@@ -4161,7 +4161,7 @@ return parseFloat(s.replace(/\./g, function() { _yuitest_coverfunc("build/yui/yui.js", "(anonymous 22)", 3328); _yuitest_coverline("build/yui/yui.js", 3329);-return (c++ == 1) ? '' : '.';+return (c++ === 1) ? '' : '.'; })); }, @@ -4276,13 +4276,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -4371,7 +4364,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -4388,250 +4395,250 @@ * @type String * @static */- _yuitest_coverline("build/yui/yui.js", 3556);+ _yuitest_coverline("build/yui/yui.js", 3563); o.userAgent = ua; - _yuitest_coverline("build/yui/yui.js", 3559);+ _yuitest_coverline("build/yui/yui.js", 3566); o.secure = href && (href.toLowerCase().indexOf('https') === 0); - _yuitest_coverline("build/yui/yui.js", 3561);+ _yuitest_coverline("build/yui/yui.js", 3568); if (ua) { - _yuitest_coverline("build/yui/yui.js", 3563);+ _yuitest_coverline("build/yui/yui.js", 3570); if ((/windows|win32/i).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3564);+ _yuitest_coverline("build/yui/yui.js", 3571); o.os = 'windows';- } else {_yuitest_coverline("build/yui/yui.js", 3565);+ } else {_yuitest_coverline("build/yui/yui.js", 3572); if ((/macintosh|mac_powerpc/i).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3566);+ _yuitest_coverline("build/yui/yui.js", 3573); o.os = 'macintosh';- } else {_yuitest_coverline("build/yui/yui.js", 3567);+ } else {_yuitest_coverline("build/yui/yui.js", 3574); if ((/android/i).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3568);+ _yuitest_coverline("build/yui/yui.js", 3575); o.os = 'android';- } else {_yuitest_coverline("build/yui/yui.js", 3569);+ } else {_yuitest_coverline("build/yui/yui.js", 3576); if ((/symbos/i).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3570);+ _yuitest_coverline("build/yui/yui.js", 3577); o.os = 'symbos';- } else {_yuitest_coverline("build/yui/yui.js", 3571);+ } else {_yuitest_coverline("build/yui/yui.js", 3578); if ((/linux/i).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3572);+ _yuitest_coverline("build/yui/yui.js", 3579); o.os = 'linux';- } else {_yuitest_coverline("build/yui/yui.js", 3573);+ } else {_yuitest_coverline("build/yui/yui.js", 3580); if ((/rhino/i).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3574);+ _yuitest_coverline("build/yui/yui.js", 3581); o.os = 'rhino'; }}}}}} // Modern KHTML browsers should qualify as Safari X-Grade- _yuitest_coverline("build/yui/yui.js", 3578);+ _yuitest_coverline("build/yui/yui.js", 3585); if ((/KHTML/).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3579);+ _yuitest_coverline("build/yui/yui.js", 3586); o.webkit = 1; }- _yuitest_coverline("build/yui/yui.js", 3581);+ _yuitest_coverline("build/yui/yui.js", 3588); if ((/IEMobile|XBLWP7/).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3582);+ _yuitest_coverline("build/yui/yui.js", 3589); o.mobile = 'windows'; }- _yuitest_coverline("build/yui/yui.js", 3584);+ _yuitest_coverline("build/yui/yui.js", 3591); if ((/Fennec/).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3585);+ _yuitest_coverline("build/yui/yui.js", 3592); o.mobile = 'gecko'; } // Modern WebKit browsers are at least X-Grade- _yuitest_coverline("build/yui/yui.js", 3588);+ _yuitest_coverline("build/yui/yui.js", 3595); m = ua.match(/AppleWebKit\/([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3589);+ _yuitest_coverline("build/yui/yui.js", 3596); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3590);+ _yuitest_coverline("build/yui/yui.js", 3597); o.webkit = numberify(m[1]);- _yuitest_coverline("build/yui/yui.js", 3591);+ _yuitest_coverline("build/yui/yui.js", 3598); o.safari = o.webkit;- - _yuitest_coverline("build/yui/yui.js", 3593);++ _yuitest_coverline("build/yui/yui.js", 3600); if (/PhantomJS/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3594);+ _yuitest_coverline("build/yui/yui.js", 3601); m = ua.match(/PhantomJS\/([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3595);+ _yuitest_coverline("build/yui/yui.js", 3602); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3596);+ _yuitest_coverline("build/yui/yui.js", 3603); o.phantomjs = numberify(m[1]); } } // Mobile browser check- _yuitest_coverline("build/yui/yui.js", 3601);+ _yuitest_coverline("build/yui/yui.js", 3608); if (/ Mobile\//.test(ua) || (/iPad|iPod|iPhone/).test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3602);+ _yuitest_coverline("build/yui/yui.js", 3609); o.mobile = 'Apple'; // iPhone or iPod Touch - _yuitest_coverline("build/yui/yui.js", 3604);+ _yuitest_coverline("build/yui/yui.js", 3611); m = ua.match(/OS ([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3605);+ _yuitest_coverline("build/yui/yui.js", 3612); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3606);+ _yuitest_coverline("build/yui/yui.js", 3613); m = numberify(m[1].replace('_', '.')); }- _yuitest_coverline("build/yui/yui.js", 3608);+ _yuitest_coverline("build/yui/yui.js", 3615); o.ios = m;- _yuitest_coverline("build/yui/yui.js", 3609);+ _yuitest_coverline("build/yui/yui.js", 3616); o.os = 'ios';- _yuitest_coverline("build/yui/yui.js", 3610);+ _yuitest_coverline("build/yui/yui.js", 3617); o.ipad = o.ipod = o.iphone = 0; - _yuitest_coverline("build/yui/yui.js", 3612);+ _yuitest_coverline("build/yui/yui.js", 3619); m = ua.match(/iPad|iPod|iPhone/);- _yuitest_coverline("build/yui/yui.js", 3613);+ _yuitest_coverline("build/yui/yui.js", 3620); if (m && m[0]) {- _yuitest_coverline("build/yui/yui.js", 3614);+ _yuitest_coverline("build/yui/yui.js", 3621); o[m[0].toLowerCase()] = o.ios; } } else {- _yuitest_coverline("build/yui/yui.js", 3617);+ _yuitest_coverline("build/yui/yui.js", 3624); m = ua.match(/NokiaN[^\/]*|webOS\/\d\.\d/);- _yuitest_coverline("build/yui/yui.js", 3618);+ _yuitest_coverline("build/yui/yui.js", 3625); if (m) { // Nokia N-series, webOS, ex: NokiaN95- _yuitest_coverline("build/yui/yui.js", 3620);+ _yuitest_coverline("build/yui/yui.js", 3627); o.mobile = m[0]; }- _yuitest_coverline("build/yui/yui.js", 3622);+ _yuitest_coverline("build/yui/yui.js", 3629); if (/webOS/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3623);+ _yuitest_coverline("build/yui/yui.js", 3630); o.mobile = 'WebOS';- _yuitest_coverline("build/yui/yui.js", 3624);+ _yuitest_coverline("build/yui/yui.js", 3631); m = ua.match(/webOS\/([^\s]*);/);- _yuitest_coverline("build/yui/yui.js", 3625);+ _yuitest_coverline("build/yui/yui.js", 3632); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3626);+ _yuitest_coverline("build/yui/yui.js", 3633); o.webos = numberify(m[1]); } }- _yuitest_coverline("build/yui/yui.js", 3629);+ _yuitest_coverline("build/yui/yui.js", 3636); if (/ Android/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3630);+ _yuitest_coverline("build/yui/yui.js", 3637); if (/Mobile/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3631);+ _yuitest_coverline("build/yui/yui.js", 3638); o.mobile = 'Android'; }- _yuitest_coverline("build/yui/yui.js", 3633);+ _yuitest_coverline("build/yui/yui.js", 3640); m = ua.match(/Android ([^\s]*);/);- _yuitest_coverline("build/yui/yui.js", 3634);+ _yuitest_coverline("build/yui/yui.js", 3641); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3635);+ _yuitest_coverline("build/yui/yui.js", 3642); o.android = numberify(m[1]); } }- _yuitest_coverline("build/yui/yui.js", 3639);+ _yuitest_coverline("build/yui/yui.js", 3646); if (/Silk/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3640);+ _yuitest_coverline("build/yui/yui.js", 3647); m = ua.match(/Silk\/([^\s]*)\)/);- _yuitest_coverline("build/yui/yui.js", 3641);+ _yuitest_coverline("build/yui/yui.js", 3648); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3642);+ _yuitest_coverline("build/yui/yui.js", 3649); o.silk = numberify(m[1]); }- _yuitest_coverline("build/yui/yui.js", 3644);+ _yuitest_coverline("build/yui/yui.js", 3651); if (!o.android) {- _yuitest_coverline("build/yui/yui.js", 3645);+ _yuitest_coverline("build/yui/yui.js", 3652); o.android = 2.34; //Hack for desktop mode in Kindle- _yuitest_coverline("build/yui/yui.js", 3646);+ _yuitest_coverline("build/yui/yui.js", 3653); o.os = 'Android'; }- _yuitest_coverline("build/yui/yui.js", 3648);+ _yuitest_coverline("build/yui/yui.js", 3655); if (/Accelerated=true/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3649);+ _yuitest_coverline("build/yui/yui.js", 3656); o.accel = true; } } } - _yuitest_coverline("build/yui/yui.js", 3654);+ _yuitest_coverline("build/yui/yui.js", 3661); m = ua.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3655);+ _yuitest_coverline("build/yui/yui.js", 3662); if (m && m[1] && m[2]) {- _yuitest_coverline("build/yui/yui.js", 3656);+ _yuitest_coverline("build/yui/yui.js", 3663); o.chrome = numberify(m[2]); // Chrome- _yuitest_coverline("build/yui/yui.js", 3657);+ _yuitest_coverline("build/yui/yui.js", 3664); o.safari = 0; //Reset safari back to 0- _yuitest_coverline("build/yui/yui.js", 3658);+ _yuitest_coverline("build/yui/yui.js", 3665); if (m[1] === 'CrMo') {- _yuitest_coverline("build/yui/yui.js", 3659);+ _yuitest_coverline("build/yui/yui.js", 3666); o.mobile = 'chrome'; } } else {- _yuitest_coverline("build/yui/yui.js", 3662);+ _yuitest_coverline("build/yui/yui.js", 3669); m = ua.match(/AdobeAIR\/([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3663);+ _yuitest_coverline("build/yui/yui.js", 3670); if (m) {- _yuitest_coverline("build/yui/yui.js", 3664);+ _yuitest_coverline("build/yui/yui.js", 3671); o.air = m[0]; // Adobe AIR 1.0 or better } } } - _yuitest_coverline("build/yui/yui.js", 3669);+ _yuitest_coverline("build/yui/yui.js", 3676); if (!o.webkit) { // not webkit // @todo check Opera/8.01 (J2ME/MIDP; Opera Mini/2.0.4509/1316; fi; U; ssr)- _yuitest_coverline("build/yui/yui.js", 3671);+ _yuitest_coverline("build/yui/yui.js", 3678); if (/Opera/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3672);+ _yuitest_coverline("build/yui/yui.js", 3679); m = ua.match(/Opera[\s\/]([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3673);+ _yuitest_coverline("build/yui/yui.js", 3680); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3674);+ _yuitest_coverline("build/yui/yui.js", 3681); o.opera = numberify(m[1]); }- _yuitest_coverline("build/yui/yui.js", 3676);+ _yuitest_coverline("build/yui/yui.js", 3683); m = ua.match(/Version\/([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3677);+ _yuitest_coverline("build/yui/yui.js", 3684); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3678);+ _yuitest_coverline("build/yui/yui.js", 3685); o.opera = numberify(m[1]); // opera 10+ } - _yuitest_coverline("build/yui/yui.js", 3681);+ _yuitest_coverline("build/yui/yui.js", 3688); if (/Opera Mobi/.test(ua)) {- _yuitest_coverline("build/yui/yui.js", 3682);+ _yuitest_coverline("build/yui/yui.js", 3689); o.mobile = 'opera';- _yuitest_coverline("build/yui/yui.js", 3683);+ _yuitest_coverline("build/yui/yui.js", 3690); m = ua.replace('Opera Mobi', '').match(/Opera ([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3684);+ _yuitest_coverline("build/yui/yui.js", 3691); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3685);+ _yuitest_coverline("build/yui/yui.js", 3692); o.opera = numberify(m[1]); } }- _yuitest_coverline("build/yui/yui.js", 3688);+ _yuitest_coverline("build/yui/yui.js", 3695); m = ua.match(/Opera Mini[^;]*/); - _yuitest_coverline("build/yui/yui.js", 3690);+ _yuitest_coverline("build/yui/yui.js", 3697); if (m) {- _yuitest_coverline("build/yui/yui.js", 3691);+ _yuitest_coverline("build/yui/yui.js", 3698); o.mobile = m[0]; // ex: Opera Mini/2.0.4509/1316 } } else { // not opera or webkit- _yuitest_coverline("build/yui/yui.js", 3694);+ _yuitest_coverline("build/yui/yui.js", 3701); m = ua.match(/MSIE\s([^;]*)/);- _yuitest_coverline("build/yui/yui.js", 3695);+ _yuitest_coverline("build/yui/yui.js", 3702); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3696);+ _yuitest_coverline("build/yui/yui.js", 3703); o.ie = numberify(m[1]); } else { // not opera, webkit, or ie- _yuitest_coverline("build/yui/yui.js", 3698);+ _yuitest_coverline("build/yui/yui.js", 3705); m = ua.match(/Gecko\/([^\s]*)/);- _yuitest_coverline("build/yui/yui.js", 3699);+ _yuitest_coverline("build/yui/yui.js", 3706); if (m) {- _yuitest_coverline("build/yui/yui.js", 3700);+ _yuitest_coverline("build/yui/yui.js", 3707); o.gecko = 1; // Gecko detected, look for revision- _yuitest_coverline("build/yui/yui.js", 3701);+ _yuitest_coverline("build/yui/yui.js", 3708); m = ua.match(/rv:([^\s\)]*)/);- _yuitest_coverline("build/yui/yui.js", 3702);+ _yuitest_coverline("build/yui/yui.js", 3709); if (m && m[1]) {- _yuitest_coverline("build/yui/yui.js", 3703);+ _yuitest_coverline("build/yui/yui.js", 3710); o.gecko = numberify(m[1]); } }@@ -4640,34 +4647,42 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ _yuitest_coverline("build/yui/yui.js", 3720);+if (win && nav && !(o.chrome && o.chrome < 6)) {+ _yuitest_coverline("build/yui/yui.js", 3721);+o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value.- _yuitest_coverline("build/yui/yui.js", 3712);+ _yuitest_coverline("build/yui/yui.js", 3725); if (!subUA) { - _yuitest_coverline("build/yui/yui.js", 3714);-if (typeof process == 'object') {+ _yuitest_coverline("build/yui/yui.js", 3727);+if (typeof process === 'object') { - _yuitest_coverline("build/yui/yui.js", 3716);+ _yuitest_coverline("build/yui/yui.js", 3729); if (process.versions && process.versions.node) { //NodeJS- _yuitest_coverline("build/yui/yui.js", 3718);+ _yuitest_coverline("build/yui/yui.js", 3731); o.os = process.platform;- _yuitest_coverline("build/yui/yui.js", 3719);+ _yuitest_coverline("build/yui/yui.js", 3732); o.nodejs = numberify(process.versions.node); } } - _yuitest_coverline("build/yui/yui.js", 3723);+ _yuitest_coverline("build/yui/yui.js", 3736); YUI.Env.UA = o; } - _yuitest_coverline("build/yui/yui.js", 3727);+ _yuitest_coverline("build/yui/yui.js", 3740); return o; }; -_yuitest_coverline("build/yui/yui.js", 3731);+_yuitest_coverline("build/yui/yui.js", 3744); Y.UA = YUI.Env.UA || YUI.Env.parseUA(); /**@@ -4690,54 +4705,55 @@ @return -1 if _a_ is lower than _b_, 0 if they're equivalent, 1 if _a_ is higher than _b_. **/-_yuitest_coverline("build/yui/yui.js", 3753);+_yuitest_coverline("build/yui/yui.js", 3766); Y.UA.compareVersions = function (a, b) {- _yuitest_coverfunc("build/yui/yui.js", "compareVersions", 3753);-_yuitest_coverline("build/yui/yui.js", 3754);+ _yuitest_coverfunc("build/yui/yui.js", "compareVersions", 3766);+_yuitest_coverline("build/yui/yui.js", 3767); var aPart, aParts, bPart, bParts, i, len; - _yuitest_coverline("build/yui/yui.js", 3756);+ _yuitest_coverline("build/yui/yui.js", 3769); if (a === b) {- _yuitest_coverline("build/yui/yui.js", 3757);+ _yuitest_coverline("build/yui/yui.js", 3770); return 0; } - _yuitest_coverline("build/yui/yui.js", 3760);+ _yuitest_coverline("build/yui/yui.js", 3773); aParts = (a + '').split('.');- _yuitest_coverline("build/yui/yui.js", 3761);+ _yuitest_coverline("build/yui/yui.js", 3774); bParts = (b + '').split('.'); - _yuitest_coverline("build/yui/yui.js", 3763);+ _yuitest_coverline("build/yui/yui.js", 3776); for (i = 0, len = Math.max(aParts.length, bParts.length); i < len; ++i) {- _yuitest_coverline("build/yui/yui.js", 3764);+ _yuitest_coverline("build/yui/yui.js", 3777); aPart = parseInt(aParts[i], 10);- _yuitest_coverline("build/yui/yui.js", 3765);+ _yuitest_coverline("build/yui/yui.js", 3778); bPart = parseInt(bParts[i], 10); - _yuitest_coverline("build/yui/yui.js", 3767);+ _yuitest_coverline("build/yui/yui.js", 3780); isNaN(aPart) && (aPart = 0);- _yuitest_coverline("build/yui/yui.js", 3768);+ _yuitest_coverline("build/yui/yui.js", 3781); isNaN(bPart) && (bPart = 0); - _yuitest_coverline("build/yui/yui.js", 3770);+ _yuitest_coverline("build/yui/yui.js", 3783); if (aPart < bPart) {- _yuitest_coverline("build/yui/yui.js", 3771);+ _yuitest_coverline("build/yui/yui.js", 3784); return -1; } - _yuitest_coverline("build/yui/yui.js", 3774);+ _yuitest_coverline("build/yui/yui.js", 3787); if (aPart > bPart) {- _yuitest_coverline("build/yui/yui.js", 3775);+ _yuitest_coverline("build/yui/yui.js", 3788); return 1; } } - _yuitest_coverline("build/yui/yui.js", 3779);+ _yuitest_coverline("build/yui/yui.js", 3792); return 0; };-_yuitest_coverline("build/yui/yui.js", 3781);+_yuitest_coverline("build/yui/yui.js", 3794); YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -4749,14 +4765,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -4776,4 +4792,4 @@ }; -}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});
bundle/yui/yui-debug.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2579,10 +2579,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3351,7 +3351,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3466,13 +3466,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3561,7 +3554,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3614,7 +3621,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3733,10 +3740,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3805,6 +3818,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3816,14 +3830,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3843,7 +3857,7 @@ }; -}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */@@ -4369,14 +4383,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -4393,7 +4411,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -4487,6 +4505,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -4503,6 +4523,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -4514,13 +4539,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -4586,7 +4605,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -4684,7 +4703,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -4734,8 +4753,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -4822,6 +4843,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -4912,7 +4937,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -4970,9 +4994,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -4980,8 +5017,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -4997,7 +5032,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -5105,13 +5140,14 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -5237,7 +5273,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -5266,10 +5302,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -5431,8 +5465,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5444,8 +5478,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -5533,7 +5581,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -5643,7 +5691,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /**@@ -5720,7 +5768,7 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('loader-base', function (Y, NAME) { /**@@ -5736,7 +5784,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -5758,7 +5806,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -5821,7 +5869,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -5849,14 +5897,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -5899,7 +5946,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -5930,7 +5977,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -6056,7 +6103,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -6208,7 +6255,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -6246,7 +6293,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -6260,14 +6307,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -6379,15 +6426,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -6424,7 +6473,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -6475,7 +6524,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -6541,13 +6590,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -6560,15 +6609,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -6578,7 +6629,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { // Y.log('group: ' + j);@@ -6595,7 +6646,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -6608,9 +6659,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -6626,16 +6677,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -6650,14 +6700,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -6834,7 +6877,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -6857,7 +6906,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { Y.log('Auto determined module type as CSS', 'warn', 'loader'); o.type = CSS;@@ -6872,16 +6921,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -6914,13 +6959,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -6971,7 +7016,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -6982,7 +7027,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -6990,7 +7035,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -7022,8 +7067,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -7063,15 +7108,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -7085,7 +7130,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -7117,15 +7162,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -7218,7 +7263,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -7238,7 +7283,7 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); @@ -7246,8 +7291,8 @@ //Y.log('Already expanded ' + name + ', ' + mod.expanded); return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -7337,7 +7382,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -7417,7 +7462,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -7440,7 +7485,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { //Y.log('isCSSLoaded was cached for ' + name, 'warn', 'loader'); return mod;@@ -7485,7 +7530,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -7593,8 +7638,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -7620,7 +7665,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -7664,30 +7709,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -7729,7 +7774,7 @@ if (patterns.hasOwnProperty(pname)) { // Y.log('testing pattern ' + i); p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -7787,7 +7832,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -7795,7 +7840,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -7847,7 +7892,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -7855,11 +7900,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -7908,7 +7953,7 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); }@@ -7916,7 +7961,7 @@ msg = msg.join(','); Y.log('load error: ' + msg + ', ' + Y.id, 'error', 'loader');- + if (f) { f.call(this.context, { msg: msg,@@ -7924,7 +7969,7 @@ success: false }); }- + this._finish(msg, false); },@@ -8039,13 +8084,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -8065,7 +8107,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -8080,7 +8122,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -8147,8 +8189,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.log('Loading CSS modules', 'info', 'loader'); Y.Get.css(modules.css, {@@ -8250,7 +8292,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { Y.log('loadNext was called..', 'error', 'loader'); return; },@@ -8319,15 +8361,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -8336,11 +8378,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -8348,7 +8390,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -8363,7 +8405,7 @@ } else { Y.log('Undefined Module', 'warn', 'loader'); }- + }; len = s.length;@@ -8384,7 +8426,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -8401,7 +8442,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -8417,7 +8457,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -8437,7 +8477,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -8464,7 +8503,7 @@ Y.log('maxURLLength (' + maxURLLength + ') is lower than the comboBase length (' + base.length + '), resetting to default (' + MAX_URL_LENGTH + ')', 'error', 'loader'); maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { Y.log('Exceeded maxURLLength (' + maxURLLength + ') for ' + type + ', splitting', 'info', 'loader');@@ -8527,7 +8566,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -8540,7 +8579,7 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /**@@ -8610,7 +8649,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; // Y.log("adding to thresh: " + c + ", " + s[j]); roll = (c >= m.rollup);@@ -8642,7 +8681,7 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by src/loader/scripts/meta_join.js */@@ -8765,7 +8804,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -9329,6 +9368,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -9653,10 +9693,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -10876,7 +10914,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -10922,8 +10961,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -11115,6 +11154,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -11133,8 +11188,8 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"requires": ["loader-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});
bundle/yui/yui-min.js view
@@ -1,7 +1,7 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/ */-typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.2",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&!e.alert&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++==1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,air:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-number","datatype-date","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.2",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!n.gecko||!!n.opera}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var i;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,this._env||this._getEnv(),i=this._getTransaction(t,n),this._queue.push({callback:r,transaction:i}),this._next(),i},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(function(){e.callback&&e.callback.apply(this,arguments),i._pending=null,i._next()}))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._waiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._waiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout));for(i=0,s=n.length;i<s;++i)u=t.requests[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r)},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(o.onerror=c,o.onload=h,!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this._waiting+=1,this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._waiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._waiting-=1,this._next()}}},"3.7.2",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"})},"3.7.2",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.2",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.2",{requires:["yui-base"]}),YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.09.19-20-07",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S,x=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){var r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null;s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!=r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type==u&&!f.ext&&f.type==u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n=="require")f.require(i);else if(n=="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n=="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n=="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n=="gallery"?this.groups.gallery.update(i,t):n=="yui2"||n=="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o=="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName=="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){var l=[];for(n=0;n<f.coverage.length;n++){var c=f.coverage[n];f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c)}f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}f.lang},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t}),this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;if(!t.type){t.type=a;var r=t.path||t.fullpath;r&&this.REGEX_CSS.test(r)&&(t.type=u)}!t.path&&!t.fullpath&&(t.path=x(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0;var i=t.submodules,o,f,l,c,p,d,m,g,y,b,w,E,S,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(o=0;o<this.requires.length;o++)t.requires.push(this.requires[o]);if(t.group&&this.groups&&this.groups[t.group]){O=this.groups[t.group];if(O.requires)for(o=0;o<O.requires.length;o++)t.requires.push(O.requires[o])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(L=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(L)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){b=v(t.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w))}if(i){c=t.supersedes||[],f=0;for(o in i)if(i.hasOwnProperty(o)){p=i[o],p.path=p.path||x(n,o,t.type),p.pkg=n,p.group=t.group,p.supersedes&&(c=c.concat(p.supersedes)),d=this.addModule(p,o),c.push(o);if(d.skinnable){t.skinnable=!0,k=this.skin.overrides;if(k&&k[o])for(y=0;y<k[o].length;y++)L=this._addSkin(k[o][y],o,n),c.push(L);L=this._addSkin(this.skin.defaultSkin,o,n),c.push(L)}if(p.lang&&p.lang.length){b=v(p.lang);for(y=0;y<b.length;y++)N=b[y],w=this.getLangPackName(N,n),E=this.getLangPackName(N,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),S=S||v.hash(d.supersedes),E in S||d.supersedes.push(E),t.lang=t.lang||[],T=T||v.hash(t.lang),N in T||t.lang.push(N),w=this.getLangPackName(h,n),E=this.getLangPackName(h,o),d=this.moduleInfo[w],d||(d=this._addLangPack(N,t,w)),E in S||d.supersedes.push(E)}f++}t.supersedes=v.dedupe(c),this.allowRollup&&(t.rollup=f<4?f:Math.min(f-1,4))}m=t.plugins;if(m)for(o in m)m.hasOwnProperty(o)&&(g=m[o],g.pkg=n,g.path=g.path||x(n,o,t.type),g.requires=g.requires||[],g.group=t.group,this.addModule(g,o),t.skinnable&&this._addSkin(this.skin.defaultSkin,o,n));if(t.condition){l=t.condition.trigger,YUI.Env.aliases[l]&&(l=YUI.Env.aliases[l]),e.Lang.isArray(l)||(l=[l]);for(o=0;o<l.length;o++)_=l[o],A=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,A&&A!="after"?A=="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(C=t.configFn(t),C===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A,O,M=t.lang||t.intl,_=this.moduleInfo,D=e.Features&&e.Features.tests.load,P,H;t.temp&&g&&(N=t,t=this.addModule(g,c),t.group=N.group,t.pkg=N.pkg,delete t.expanded),H=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!H)return t.expanded;y=[],P={},T=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),T.unshift("intl"),M=!0),C=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<T.length;n++)if(!P[T[n]]){y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}T=this.filterRequires(t.supersedes);if(T)for(n=0;n<T.length;n++)if(!P[T[n]]){t.submodules&&y.push(T[n]),P[T[n]]=!0,i=this.getModule(T[n]);if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(C&&this.loadOptional)for(n=0;n<C.length;n++)if(!P[C[n]]){y.push(C[n]),P[C[n]]=!0,i=_[C[n]];if(i){o=this.getRequires(i),M=M||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&D)d(l,function(e,t){var n=D[t].name;!P[n]&&D[t].trigger==c&&e&&D[t]&&(P[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!P[n]){x=m[n],S=x&&(!x.ua&&!x.test||x.ua&&e.UA[x.ua]||x.test&&x.test(e,T));if(S){P[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){L=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(A=n);if(L&&(L[c]||A&&L[A])){O=c,L[A]&&(O=A);for(n=0;n<L[O].length;n++)k=this._addSkin(L[O][n],c),this.isCSSLoaded(k,this._boot)||y.push(k)}else k=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(k,this._boot)||y.push(k)}return t._parsed=!1,M&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=x(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)if(t.hasOwnProperty(o)&&!i[o]){i[o]=!0,n=s.getModule(o);if(n){var u=n.expound;u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r))}}},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!=s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!=a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t),!i;var s=this.resolve(!i),o=this,f=0,l=0,c={},h;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++;var p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}};this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(e){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S,x,T,N=[],C,k,A={},O=this,M,_,D=[],P=O.ignoreRegistered?{}:O.inserted,H={js:[],jsMods:[],css:[],cssMods:[]},B=O.loadType||"js";(O.skin.overrides||O.skin.defaultSkin!==l||O.ignoreRegistered)&&O._resetModules(),e&&O.calculate(),t=t||O.sorted;var j=function(e){if(e){d=e.group&&O.groups[e.group]||n,d.async===!1&&(e.async=d.async),f=e.fullpath?O._filter(e.fullpath,t[s]):O._url(e.path,t[s],d.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);H[e.type].push(f),H[e.type+"Mods"].push(e)}};r=t.length,S=O.comboBase,f=S,w={};for(s=0;s<r;s++){y=S,o=O.getModule(t[s]),v=o&&o.group,d=O.groups[v];if(v&&d){if(!d.combine||o.fullpath){j(o);continue}o.combine=!0,d.comboBase&&(y=d.comboBase),"root"in d&&b.isValue(d.root)&&(o.root=d.root),o.comboSep=d.comboSep||O.comboSep,o.maxURLLength=d.maxURLLength||O.maxURLLength}else if(!O.combine){j(o);continue}w[y]=w[y]||[],w[y].push(o)}for(m in w)if(w.hasOwnProperty(m)){A[m]=A[m]||{js:[],jsMods:[],css:[],cssMods:[]},f=m,E=w[m],r=E.length;if(r)for(s=0;s<r;s++){if(P[E[s]])continue;o=E[s],o&&(o.combine||!o.ext)?(A[m].comboSep=o.comboSep,A[m].group=o.group,A[m].maxURLLength=o.maxURLLength,g=(b.isValue(o.root)?o.root:O.root)+(o.path||o.fullpath),g=O._filter(g,o.name),A[m][o.type].push(g),A[m][o.type+"Mods"].push(o)):E[s]&&j(E[s])}}for(m in A){x=m,M=A[x].comboSep||O.comboSep,_=A[x].maxURLLength||O.maxURLLength;for(B in A[x])if(B===a||B===u){T=A[x][B],E=A[x][B+"Mods"],r=T.length,C=x+T.join(M),k=C.length,_<=x.length&&(_=i);if(r)if(k>_){N=[];for(t=0;t<r;t++)N.push(T[t]),C=x+N.join(M),C.length>_&&(o=N.pop(),C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)),N=[],o&&N.push(o));N.length&&(C=x+N.join(M),H[B].push(O._filter(C,null,A[x].group)))}else H[B].push(O._filter(C,null,A[x].group));H[B+"Mods"]=H[B+"Mods"].concat(E)}}return A=null,H},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.2",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type==f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.2",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",test:function(e){return e.config.win&&"ontouchstart"in e.config.win&&!(e.UA.chrome&&e.UA.chrome<6)},trigger:"dd-drag"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="5fe7d71505fef8108b090c35db73bcde"},"3.7.2",{requires:["loader-base"]}),YUI.add("yui",function(e,t){},"3.7.2",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]});+typeof YUI!="undefined"&&(YUI._YUI=YUI);var YUI=function(){var e=0,t=this,n=arguments,r=n.length,i=function(e,t){return e&&e.hasOwnProperty&&e instanceof t},s=typeof YUI_config!="undefined"&&YUI_config;i(t,YUI)?(t._init(),YUI.GlobalConfig&&t.applyConfig(YUI.GlobalConfig),s&&t.applyConfig(s),r||t._setup()):t=new YUI;if(r){for(;e<r;e++)t.applyConfig(n[e]);t._setup()}return t.instanceOf=i,t};(function(){var e,t,n="3.7.3",r=".",i="http://yui.yahooapis.com/",s="yui3-js-enabled",o="yui3-css-stamp",u=function(){},a=Array.prototype.slice,f={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},l=typeof window!="undefined",c=l?window:null,h=l?c.document:null,p=h&&h.documentElement,d=p&&p.className,v={},m=(new Date).getTime(),g=function(e,t,n,r){e&&e.addEventListener?e.addEventListener(t,n,r):e&&e.attachEvent&&e.attachEvent("on"+t,n)},y=function(e,t,n,r){if(e&&e.removeEventListener)try{e.removeEventListener(t,n,r)}catch(i){}else e&&e.detachEvent&&e.detachEvent("on"+t,n)},b=function(){YUI.Env.windowLoaded=!0,YUI.Env.DOMReady=!0,l&&y(window,"load",b)},w=function(e,t){var n=e.Env._loader,r=["loader-base"],i=YUI.Env,s=i.mods;return n?(n.ignoreRegistered=!1,n.onEnd=null,n.data=null,n.required=[],n.loadType=null):(n=new e.Loader(e.config),e.Env._loader=n),s&&s.loader&&(r=[].concat(r,YUI.Env.loaderExtras)),YUI.Env.core=e.Array.dedupe([].concat(YUI.Env.core,r)),n},E=function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},S={success:!0};p&&d.indexOf(s)==-1&&(d&&(d+=" "),d+=s,p.className=d),n.indexOf("@")>-1&&(n="3.5.0"),e={applyConfig:function(e){e=e||u;var t,n,r=this.config,i=r.modules,s=r.groups,o=r.aliases,a=this.Env._loader;for(n in e)e.hasOwnProperty(n)&&(t=e[n],i&&n=="modules"?E(i,t):o&&n=="aliases"?E(o,t):s&&n=="groups"?E(s,t):n=="win"?(r[n]=t&&t.contentWindow||t,r.doc=r[n]?r[n].document:null):n!="_yuid"&&(r[n]=t));a&&a._config(e)},_config:function(e){this.applyConfig(e)},_init:function(){var e,t,r=this,s=YUI.Env,u=r.Env,a;r.version=n;if(!u){r.Env={core:["get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"],loaderExtras:["loader-rollup","loader-yui3"],mods:{},versions:{},base:i,cdn:i+n+"/build/",_idx:0,_used:{},_attached:{},_missed:[],_yidx:0,_uidx:0,_guidp:"y",_loaded:{},_BASE_RE:/(?:\?(?:[^&]*&)*([^&]*))?\b(simpleyui|yui(?:-\w+)?)\/\2(?:-(min|debug))?\.js/,parseBasePath:function(e,t){var n=e.match(t),r,i;return n&&(r=RegExp.leftContext||e.slice(0,e.indexOf(n[0])),i=n[3],n[1]&&(r+="?"+n[1]),r={filter:i,path:r}),r},getBase:s&&s.getBase||function(t){var n=h&&h.getElementsByTagName("script")||[],i=u.cdn,s,o,a,f;for(o=0,a=n.length;o<a;++o){f=n[o].src;if(f){s=r.Env.parseBasePath(f,t);if(s){e=s.filter,i=s.path;break}}}return i}},u=r.Env,u._loaded[n]={};if(s&&r!==YUI)u._yidx=++s._yidx,u._guidp=("yui_"+n+"_"+u._yidx+"_"+m).replace(/\./g,"_").replace(/-/g,"_");else if(YUI._YUI){s=YUI._YUI.Env,u._yidx+=s._yidx,u._uidx+=s._uidx;for(a in s)a in u||(u[a]=s[a]);delete YUI._YUI}r.id=r.stamp(r),v[r.id]=r}r.constructor=YUI,r.config=r.config||{bootstrap:!0,cacheUse:!0,debug:!0,doc:h,fetchCSS:!0,throwFail:!0,useBrowserConsole:!0,useNativeES5:!0,win:c},h&&!h.getElementById(o)&&(t=h.createElement("div"),t.innerHTML='<div id="'+o+'" style="position: absolute !important; visibility: hidden !important"></div>',YUI.Env.cssStampEl=t.firstChild,h.body?h.body.appendChild(YUI.Env.cssStampEl):p.insertBefore(YUI.Env.cssStampEl,p.firstChild)),r.config.lang=r.config.lang||"en-US",r.config.base=YUI.config.base||r.Env.getBase(r.Env._BASE_RE);if(!e||!"mindebug".indexOf(e))e="min";e=e?"-"+e:e,r.config.loaderPath=YUI.config.loaderPath||"loader/loader"+e+".js"},_setup:function(e){var t,n=this,r=[],i=YUI.Env.mods,s=n.config.core||[].concat(YUI.Env.core);for(t=0;t<s.length;t++)i[s[t]]&&r.push(s[t]);n._attach(["yui-base"]),n._attach(r),n.Loader&&w(n)},applyTo:function(e,t,n){if(t in f){var r=v[e],i,s,o;if(r){i=t.split("."),s=r;for(o=0;o<i.length;o+=1)s=s[i[o]],s||this.log("applyTo not found: "+t,"warn","yui");return s&&s.apply(r,n)}return null}return this.log(t+": applyTo not allowed","warn","yui"),null},add:function(e,t,n,r){r=r||{};var i=YUI.Env,s={name:e,fn:t,version:n,details:r},o={},u,a,f,l=i.versions;i.mods[e]=s,l[n]=l[n]||{},l[n][e]=s;for(f in v)v.hasOwnProperty(f)&&(a=v[f],o[a.id]||(o[a.id]=!0,u=a.Env._loader,u&&(!u.moduleInfo[e]||u.moduleInfo[e].temp)&&u.addModule(r,e)));return this},_attach:function(e,t){var n,r,i,s,o,u,a,f=YUI.Env.mods,l=YUI.Env.aliases,c=this,h,p=YUI.Env._renderedMods,d=c.Env._loader,v=c.Env._attached,m=e.length,d,g,y,b=[];for(n=0;n<m;n++){r=e[n],i=f[r],b.push(r);if(d&&d.conditions[r])for(h in d.conditions[r])d.conditions[r].hasOwnProperty(h)&&(g=d.conditions[r][h],y=g&&(g.ua&&c.UA[g.ua]||g.test&&g.test(c)),y&&b.push(g.name))}e=b,m=e.length;for(n=0;n<m;n++)if(!v[e[n]]){r=e[n],i=f[r];if(l&&l[r]&&!i){c._attach(l[r]);continue}if(!i)d&&d.moduleInfo[r]&&(i=d.moduleInfo[r],t=!0),!t&&r&&r.indexOf("skin-")===-1&&r.indexOf("css")===-1&&(c.Env._missed.push(r),c.Env._missed=c.Array.dedupe(c.Env._missed),c.message("NOT loaded: "+r,"warn","yui"));else{v[r]=!0;for(h=0;h<c.Env._missed.length;h++)c.Env._missed[h]===r&&(c.message("Found: "+r+" (was reported as missing earlier)","warn","yui"),c.Env._missed.splice(h,1));if(d&&p&&p[r]&&p[r].temp){d.getRequires(p[r]),o=[];for(h in d.moduleInfo[r].expanded_map)d.moduleInfo[r].expanded_map.hasOwnProperty(h)&&o.push(h);c._attach(o)}s=i.details,o=s.requires,u=s.use,a=s.after,s.lang&&(o=o||[],o.unshift("intl"));if(o)for(h=0;h<o.length;h++)if(!v[o[h]]){if(!c._attach(o))return!1;break}if(a)for(h=0;h<a.length;h++)if(!v[a[h]]){if(!c._attach(a,!0))return!1;break}if(i.fn)if(c.config.throwFail)i.fn(c,r);else try{i.fn(c,r)}catch(w){return c.error("Attach error: "+r,w,r),!1}if(u)for(h=0;h<u.length;h++)if(!v[u[h]]){if(!c._attach(u))return!1;break}}}return!0},_delayCallback:function(e,t){var n=this,r=["event-base"];return t=n.Lang.isObject(t)?t:{event:t},t.event==="load"&&r.push("event-synthetic"),function(){var i=arguments;n._use(r,function(){n.on(t.event,function(){i[1].delayUntil=t.event,e.apply(n,i)},t.args)})}},use:function(){var e=a.call(arguments,0),t=e[e.length-1],n=this,r=0,i=[],s,o=n.Env,u=!0;n.Lang.isFunction(t)?(e.pop(),n.config.delayUntil&&(t=n._delayCallback(t,n.config.delayUntil))):t=null,n.Lang.isArray(e[0])&&(e=e[0]);if(n.config.cacheUse){while(s=e[r++])if(!o._attached[s]){u=!1;break}if(u)return e.length,n._notify(t,S,e),n}return n._loading?(n._useQueue=n._useQueue||new n.Queue,n._useQueue.add([e,t])):n._use(e,function(n,r){n._notify(t,r,e)}),n},_notify:function(e,t,n){if(!t.success&&this.config.loadErrorFn)this.config.loadErrorFn.call(this,this,e,t,n);else if(e){this.Env._missed&&this.Env._missed.length&&(t.msg="Missing modules: "+this.Env._missed.join(),t.success=!1);if(this.config.throwFail)e(this,t);else try{e(this,t)}catch(r){this.error("use callback error",r,n)}}},_use:function(e,t){this.Array||this._attach(["yui-base"]);var r,i,s,o,u=this,a=YUI.Env,f=a.mods,l=u.Env,c=l._used,h=a.aliases,p=a._loaderQueue,d=e[0],v=u.Array,m=u.config,g=m.bootstrap,y=[],b,E=[],S=!0,x=m.fetchCSS,T=function(e,t){var r=0,i=[],s,o,u,l,p;if(!e.length)return;if(h){o=e.length;for(r=0;r<o;r++)h[e[r]]&&!f[e[r]]?i=[].concat(i,h[e[r]]):i.push(e[r]);e=i}o=e.length;for(r=0;r<o;r++){s=e[r],t||E.push(s);if(c[s])continue;u=f[s],l=null,p=null,u?(c[s]=!0,l=u.details.requires,p=u.details.use):a._loaded[n][s]?c[s]=!0:y.push(s),l&&l.length&&T(l),p&&p.length&&T(p,1)}},N=function(n){var r=n||{success:!0,msg:"not dynamic"},i,s,o=!0,a=r.data;u._loading=!1,a&&(s=y,y=[],E=[],T(a),i=y.length,i&&[].concat(y).sort().join()==s.sort().join()&&(i=!1)),i&&a?(u._loading=!0,u._use(y,function(){u._attach(a)&&u._notify(t,r,a)})):(a&&(o=u._attach(a)),o&&u._notify(t,r,e)),u._useQueue&&u._useQueue.size()&&!u._loading&&u._use.apply(u,u._useQueue.next())};if(d==="*"){e=[];for(b in f)f.hasOwnProperty(b)&&e.push(b);return S=u._attach(e),S&&N(),u}return(f.loader||f["loader-base"])&&!u.Loader&&u._attach(["loader"+(f.loader?"":"-base")]),g&&u.Loader&&e.length&&(i=w(u),i.require(e),i.ignoreRegistered=!0,i._boot=!0,i.calculate(null,x?null:"js"),e=i.sorted,i._boot=!1),T(e),r=y.length,r&&(y=v.dedupe(y),r=y.length),g&&r&&u.Loader?(u._loading=!0,i=w(u),i.onEnd=N,i.context=u,i.data=e,i.ignoreRegistered=!1,i.require(e),i.insert(null,x?null:"js")):g&&r&&u.Get&&!l.bootstrapped?(u._loading=!0,s=function(){u._loading=!1,p.running=!1,l.bootstrapped=!0,a._bootstrapping=!1,u._attach(["loader"])&&u._use(e,t)},a._bootstrapping?p.add(s):(a._bootstrapping=!0,u.Get.script(m.base+m.loaderPath,{onEnd:s}))):(S=u._attach(e),S&&N()),u},namespace:function(){var e=arguments,t,n=0,i,s,o;for(;n<e.length;n++){t=this,o=e[n];if(o.indexOf(r)>-1){s=o.split(r);for(i=s[0]=="YAHOO"?1:0;i<s.length;i++)t[s[i]]=t[s[i]]||{},t=t[s[i]]}else t[o]=t[o]||{},t=t[o]}return t},log:u,message:u,dump:function(e){return""+e},error:function(e,t,n){var r=this,i;r.config.errorFn&&(i=r.config.errorFn.apply(r,arguments));if(!i)throw t||new Error(e);return r.message(e,"error",""+n),r},guid:function(e){var t=this.Env._guidp+"_"+ ++this.Env._uidx;return e?e+t:t},stamp:function(e,t){var n;if(!e)return e;e.uniqueID&&e.nodeType&&e.nodeType!==9?n=e.uniqueID:n=typeof e=="string"?e:e._yuid;if(!n){n=this.guid();if(!t)try{e._yuid=n}catch(r){n=null}}return n},destroy:function(){var e=this;e.Event&&e.Event._unload(),delete v[e.id],delete e.Env,delete e.config}},YUI.prototype=e;for(t in e)e.hasOwnProperty(t)&&(YUI[t]=e[t]);YUI.applyConfig=function(e){if(!e)return;YUI.GlobalConfig&&this.prototype.applyConfig.call(this,YUI.GlobalConfig),this.prototype.applyConfig.call(this,e),YUI.GlobalConfig=this.config},YUI._init(),l?g(window,"load",b):b(),YUI.Env.add=g,YUI.Env.remove=y,typeof exports=="object"&&(exports.YUI=YUI)})(),YUI.add("yui-base",function(e,t){function h(e,t,n){var r,i;t||(t=0);if(n||h.test(e))try{return l.slice.call(e,t)}catch(s){i=[];for(r=e.length;t<r;++t)i.push(e[t]);return i}return[e]}function p(){this._init(),this.add.apply(this,arguments)}var n=e.Lang||(e.Lang={}),r=String.prototype,i=Object.prototype.toString,s={"undefined":"undefined",number:"number","boolean":"boolean",string:"string","[object Function]":"function","[object RegExp]":"regexp","[object Array]":"array","[object Date]":"date","[object Error]":"error"},o=/\{\s*([^|}]+?)\s*(?:\|([^}]*))?\s*\}/g,u=/^\s+|\s+$/g,a=/\{\s*\[(?:native code|function)\]\s*\}/i;n._isNative=function(t){return!!(e.config.useNativeES5&&t&&a.test(t))},n.isArray=n._isNative(Array.isArray)?Array.isArray:function(e){return n.type(e)==="array"},n.isBoolean=function(e){return typeof e=="boolean"},n.isDate=function(e){return n.type(e)==="date"&&e.toString()!=="Invalid Date"&&!isNaN(e)},n.isFunction=function(e){return n.type(e)==="function"},n.isNull=function(e){return e===null},n.isNumber=function(e){return typeof e=="number"&&isFinite(e)},n.isObject=function(e,t){var r=typeof e;return e&&(r==="object"||!t&&(r==="function"||n.isFunction(e)))||!1},n.isString=function(e){return typeof e=="string"},n.isUndefined=function(e){return typeof e=="undefined"},n.isValue=function(e){var t=n.type(e);switch(t){case"number":return isFinite(e);case"null":case"undefined":return!1;default:return!!t}},n.now=Date.now||function(){return(new Date).getTime()},n.sub=function(e,t){return e.replace?e.replace(o,function(e,r){return n.isUndefined(t[r])?e:t[r]}):e},n.trim=r.trim?function(e){return e&&e.trim?e.trim():e}:function(e){try{return e.replace(u,"")}catch(t){return e}},n.trimLeft=r.trimLeft?function(e){return e.trimLeft()}:function(e){return e.replace(/^\s+/,"")},n.trimRight=r.trimRight?function(e){return e.trimRight()}:function(e){return e.replace(/\s+$/,"")},n.type=function(e){return s[typeof e]||s[i.call(e)]||(e?"object":"null")};var f=e.Lang,l=Array.prototype,c=Object.prototype.hasOwnProperty;e.Array=h,h.dedupe=function(e){var t={},n=[],r,i,s;for(r=0,s=e.length;r<s;++r)i=e[r],c.call(t,i)||(t[i]=1,n.push(i));return n},h.each=h.forEach=f._isNative(l.forEach)?function(t,n,r){return l.forEach.call(t||[],n,r||e),e}:function(t,n,r){for(var i=0,s=t&&t.length||0;i<s;++i)i in t&&n.call(r||e,t[i],i,t);return e},h.hash=function(e,t){var n={},r=t&&t.length||0,i,s;for(i=0,s=e.length;i<s;++i)i in e&&(n[e[i]]=r>i&&i in t?t[i]:!0);return n},h.indexOf=f._isNative(l.indexOf)?function(e,t,n){return l.indexOf.call(e,t,n)}:function(e,t,n){var r=e.length;n=+n||0,n=(n>0||-1)*Math.floor(Math.abs(n)),n<0&&(n+=r,n<0&&(n=0));for(;n<r;++n)if(n in e&&e[n]===t)return n;return-1},h.numericSort=function(e,t){return e-t},h.some=f._isNative(l.some)?function(e,t,n){return l.some.call(e,t,n)}:function(e,t,n){for(var r=0,i=e.length;r<i;++r)if(r in e&&t.call(n,e[r],r,e))return!0;return!1},h.test=function(e){var t=0;if(f.isArray(e))t=1;else if(f.isObject(e))try{"length"in e&&!e.tagName&&(!e.scrollTo||!e.document)&&!e.apply&&(t=2)}catch(n){}return t},p.prototype={_init:function(){this._q=[]},next:function(){return this._q.shift()},last:function(){return this._q.pop()},add:function(){return this._q.push.apply(this._q,arguments),this},size:function(){return this._q.length}},e.Queue=p,YUI.Env._loaderQueue=YUI.Env._loaderQueue||new p;var d="__",c=Object.prototype.hasOwnProperty,v=e.Lang.isObject;e.cached=function(e,t,n){return t||(t={}),function(r){var i=arguments.length>1?Array.prototype.join.call(arguments,d):String(r);if(!(i in t)||n&&t[i]==n)t[i]=e.apply(e,arguments);return t[i]}},e.getLocation=function(){var t=e.config.win;return t&&t.location},e.merge=function(){var e=0,t=arguments.length,n={},r,i;for(;e<t;++e){i=arguments[e];for(r in i)c.call(i,r)&&(n[r]=i[r])}return n},e.mix=function(t,n,r,i,s,o){var u,a,f,l,h,p,d;if(!t||!n)return t||e;if(s){s===2&&e.mix(t.prototype,n.prototype,r,i,0,o),f=s===1||s===3?n.prototype:n,d=s===1||s===4?t.prototype:t;if(!f||!d)return t}else f=n,d=t;u=r&&!o;if(i)for(l=0,p=i.length;l<p;++l){h=i[l];if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}else{for(h in f){if(!c.call(f,h))continue;a=u?!1:h in d;if(o&&a&&v(d[h],!0)&&v(f[h],!0))e.mix(d[h],f[h],r,null,0,o);else if(r||!a)d[h]=f[h]}e.Object._hasEnumBug&&e.mix(d,f,r,e.Object._forceEnum,s,o)}return t};var f=e.Lang,c=Object.prototype.hasOwnProperty,m,g=e.Object=f._isNative(Object.create)?function(e){return Object.create(e)}:function(){function e(){}return function(t){return e.prototype=t,new e}}(),y=g._forceEnum=["hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","toLocaleString","valueOf"],b=g._hasEnumBug=!{valueOf:0}.propertyIsEnumerable("valueOf"),w=g._hasProtoEnumBug=function(){}.propertyIsEnumerable("prototype"),E=g.owns=function(e,t){return!!e&&c.call(e,t)};g.hasKey=E,g.keys=f._isNative(Object.keys)?Object.keys:function(e){if(!f.isObject(e))throw new TypeError("Object.keys called on a non-object");var t=[],n,r,i;if(w&&typeof e=="function")for(r in e)E(e,r)&&r!=="prototype"&&t.push(r);else for(r in e)E(e,r)&&t.push(r);if(b)for(n=0,i=y.length;n<i;++n)r=y[n],E(e,r)&&t.push(r);return t},g.values=function(e){var t=g.keys(e),n=0,r=t.length,i=[];for(;n<r;++n)i.push(e[t[n]]);return i},g.size=function(e){try{return g.keys(e).length}catch(t){return 0}},g.hasValue=function(t,n){return e.Array.indexOf(g.values(t),n)>-1},g.each=function(t,n,r,i){var s;for(s in t)(i||E(t,s))&&n.call(r||e,t[s],s,t);return e},g.some=function(t,n,r,i){var s;for(s in t)if(i||E(t,s))if(n.call(r||e,t[s],s,t))return!0;return!1},g.getValue=function(t,n){if(!f.isObject(t))return m;var r,i=e.Array(n),s=i.length;for(r=0;t!==m&&r<s;r++)t=t[i[r]];return t},g.setValue=function(t,n,r){var i,s=e.Array(n),o=s.length-1,u=t;if(o>=0){for(i=0;u!==m&&i<o;i++)u=u[s[i]];if(u===m)return m;u[s[i]]=r}return t},g.isEmpty=function(e){return!g.keys(Object(e)).length},YUI.Env.parseUA=function(t){var n=function(e){var t=0;return parseFloat(e.replace(/\./g,function(){return t++===1?"":"."}))},r=e.config.win,i=r&&r.navigator,s={ie:0,opera:0,gecko:0,webkit:0,safari:0,chrome:0,mobile:null,air:0,phantomjs:0,ipad:0,iphone:0,ipod:0,ios:null,android:0,silk:0,accel:!1,webos:0,caja:i&&i.cajaVersion,secure:!1,os:null,nodejs:0,winjs:typeof Windows!="undefined"&&!!Windows.System,touchEnabled:!1},o=t||i&&i.userAgent,u=r&&r.location,a=u&&u.href,f;return s.userAgent=o,s.secure=a&&a.toLowerCase().indexOf("https")===0,o&&(/windows|win32/i.test(o)?s.os="windows":/macintosh|mac_powerpc/i.test(o)?s.os="macintosh":/android/i.test(o)?s.os="android":/symbos/i.test(o)?s.os="symbos":/linux/i.test(o)?s.os="linux":/rhino/i.test(o)&&(s.os="rhino"),/KHTML/.test(o)&&(s.webkit=1),/IEMobile|XBLWP7/.test(o)&&(s.mobile="windows"),/Fennec/.test(o)&&(s.mobile="gecko"),f=o.match(/AppleWebKit\/([^\s]*)/),f&&f[1]&&(s.webkit=n(f[1]),s.safari=s.webkit,/PhantomJS/.test(o)&&(f=o.match(/PhantomJS\/([^\s]*)/),f&&f[1]&&(s.phantomjs=n(f[1]))),/ Mobile\//.test(o)||/iPad|iPod|iPhone/.test(o)?(s.mobile="Apple",f=o.match(/OS ([^\s]*)/),f&&f[1]&&(f=n(f[1].replace("_","."))),s.ios=f,s.os="ios",s.ipad=s.ipod=s.iphone=0,f=o.match(/iPad|iPod|iPhone/),f&&f[0]&&(s[f[0].toLowerCase()]=s.ios)):(f=o.match(/NokiaN[^\/]*|webOS\/\d\.\d/),f&&(s.mobile=f[0]),/webOS/.test(o)&&(s.mobile="WebOS",f=o.match(/webOS\/([^\s]*);/),f&&f[1]&&(s.webos=n(f[1]))),/ Android/.test(o)&&(/Mobile/.test(o)&&(s.mobile="Android"),f=o.match(/Android ([^\s]*);/),f&&f[1]&&(s.android=n(f[1]))),/Silk/.test(o)&&(f=o.match(/Silk\/([^\s]*)\)/),f&&f[1]&&(s.silk=n(f[1])),s.android||(s.android=2.34,s.os="Android"),/Accelerated=true/.test(o)&&(s.accel=!0))),f=o.match(/(Chrome|CrMo|CriOS)\/([^\s]*)/),f&&f[1]&&f[2]?(s.chrome=n(f[2]),s.safari=0,f[1]==="CrMo"&&(s.mobile="chrome")):(f=o.match(/AdobeAIR\/([^\s]*)/),f&&(s.air=f[0]))),s.webkit||(/Opera/.test(o)?(f=o.match(/Opera[\s\/]([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),f=o.match(/Version\/([^\s]*)/),f&&f[1]&&(s.opera=n(f[1])),/Opera Mobi/.test(o)&&(s.mobile="opera",f=o.replace("Opera Mobi","").match(/Opera ([^\s]*)/),f&&f[1]&&(s.opera=n(f[1]))),f=o.match(/Opera Mini[^;]*/),f&&(s.mobile=f[0])):(f=o.match(/MSIE\s([^;]*)/),f&&f[1]?s.ie=n(f[1]):(f=o.match(/Gecko\/([^\s]*)/),f&&(s.gecko=1,f=o.match(/rv:([^\s\)]*)/),f&&f[1]&&(s.gecko=n(f[1]))))))),r&&i&&!(s.chrome&&s.chrome<6)&&(s.touchEnabled="ontouchstart"in r||"msMaxTouchPoints"in i&&i.msMaxTouchPoints>0),t||(typeof process=="object"&&process.versions&&process.versions.node&&(s.os=process.platform,s.nodejs=n(process.versions.node)),YUI.Env.UA=s),s},e.UA=YUI.Env.UA||YUI.Env.parseUA(),e.UA.compareVersions=function(e,t){var n,r,i,s,o,u;if(e===t)return 0;r=(e+"").split("."),s=(t+"").split(".");for(o=0,u=Math.max(r.length,s.length);o<u;++o){n=parseInt(r[o],10),i=parseInt(s[o],10),isNaN(n)&&(n=0),isNaN(i)&&(i=0);if(n<i)return-1;if(n>i)return 1}return 0},YUI.Env.aliases={anim:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],"anim-shape-transform":["anim-shape"],app:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"],attribute:["attribute-base","attribute-complex"],autocomplete:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],base:["base-base","base-pluginhost","base-build"],cache:["cache-base","cache-offline","cache-plugin"],collection:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"],controller:["router"],dataschema:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"],datasource:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"],datatable:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"],"datatable-deprecated":["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],datatype:["datatype-date","datatype-number","datatype-xml"],"datatype-date":["datatype-date-parse","datatype-date-format","datatype-date-math"],"datatype-number":["datatype-number-parse","datatype-number-format"],"datatype-xml":["datatype-xml-parse","datatype-xml-format"],dd:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"],dom:["dom-base","dom-screen","dom-style","selector-native","selector"],editor:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],event:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"],"event-custom":["event-custom-base","event-custom-complex"],"event-gestures":["event-flick","event-move"],handlebars:["handlebars-compiler"],highlight:["highlight-base","highlight-accentfold"],history:["history-base","history-hash","history-hash-ie","history-html5"],io:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"],json:["json-parse","json-stringify"],loader:["loader-base","loader-rollup","loader-yui3"],node:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"],pluginhost:["pluginhost-base","pluginhost-config"],querystring:["querystring-parse","querystring-stringify"],recordset:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"],resize:["resize-base","resize-proxy","resize-constrain"],slider:["slider-base","slider-value-range","clickable-rail","range-slider"],text:["text-accentfold","text-wordbreak"],widget:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]}},"3.7.3",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]}),YUI.add("get",function(e,t){var n=e.Lang,r,i,s;e.Get=i={cssOptions:{attributes:{rel:"stylesheet"},doc:e.config.linkDoc||e.config.doc,pollInterval:50},jsOptions:{autopurge:!0,doc:e.config.scriptDoc||e.config.doc},options:{attributes:{charset:"utf-8"},purgethreshold:20},REGEX_CSS:/\.css(?:[?;].*)?$/i,REGEX_JS:/\.js(?:[?;].*)?$/i,_insertCache:{},_pending:null,_purgeNodes:[],_queue:[],abort:function(e){var t,n,r,i,s;if(!e.abort){n=e,s=this._pending,e=null;if(s&&s.transaction.id===n)e=s.transaction,this._pending=null;else for(t=0,i=this._queue.length;t<i;++t){r=this._queue[t].transaction;if(r.id===n){e=r,this._queue.splice(t,1);break}}}e&&e.abort()},css:function(e,t,n){return this._load("css",e,t,n)},js:function(e,t,n){return this._load("js",e,t,n)},load:function(e,t,n){return this._load(null,e,t,n)},_autoPurge:function(e){e&&this._purgeNodes.length>=e&&this._purge(this._purgeNodes)},_getEnv:function(){var t=e.config.doc,n=e.UA;return this._env={async:t&&t.createElement("script").async===!0||n.ie>=10,cssFail:n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0,cssLoad:(!n.gecko&&!n.webkit||n.gecko>=9||n.compareVersions(n.webkit,535.24)>=0)&&!(n.chrome&&n.chrome<=18),preservesScriptOrder:!!(n.gecko||n.opera||n.ie&&n.ie>=10)}},_getTransaction:function(t,r){var i=[],o,u,a,f;n.isArray(t)||(t=[t]),r=e.merge(this.options,r),r.attributes=e.merge(this.options.attributes,r.attributes);for(o=0,u=t.length;o<u;++o){f=t[o],a={attributes:{}};if(typeof f=="string")a.url=f;else{if(!f.url)continue;e.mix(a,f,!1,null,0,!0),f=f.url}e.mix(a,r,!1,null,0,!0),a.type||(this.REGEX_CSS.test(f)?a.type="css":(!this.REGEX_JS.test(f),a.type="js")),e.mix(a,a.type==="js"?this.jsOptions:this.cssOptions,!1,null,0,!0),a.attributes.id||(a.attributes.id=e.guid()),a.win?a.doc=a.win.document:a.win=a.doc.defaultView||a.doc.parentWindow,a.charset&&(a.attributes.charset=a.charset),i.push(a)}return new s(i,r)},_load:function(e,t,n,r){var s;return typeof n=="function"&&(r=n,n={}),n||(n={}),n.type=e,n._onFinish=i._onTransactionFinish,this._env||this._getEnv(),s=this._getTransaction(t,n),this._queue.push({callback:r,transaction:s}),this._next(),s},_onTransactionFinish:function(){i._pending=null,i._next()},_next:function(){var e;if(this._pending)return;e=this._queue.shift(),e&&(this._pending=e,e.transaction.execute(e.callback))},_purge:function(t){var n=this._purgeNodes,r=t!==n,i,s;while(s=t.pop()){if(!s._yuiget_finished)continue;s.parentNode&&s.parentNode.removeChild(s),r&&(i=e.Array.indexOf(n,s),i>-1&&n.splice(i,1))}}},i.script=i.js,i.Transaction=s=function(t,n){var r=this;r.id=s._lastId+=1,r.data=n.data,r.errors=[],r.nodes=[],r.options=n,r.requests=t,r._callbacks=[],r._queue=[],r._reqsWaiting=0,r.tId=r.id,r.win=n.win||e.config.win},s._lastId=0,s.prototype={_state:"new",abort:function(e){this._pending=null,this._pendingCSS=null,this._pollTimer=clearTimeout(this._pollTimer),this._queue=[],this._reqsWaiting=0,this.errors.push({error:e||"Aborted"}),this._finish()},execute:function(e){var t=this,n=t.requests,r=t._state,i,s,o,u;if(r==="done"){e&&e(t.errors.length?t.errors:null,t);return}e&&t._callbacks.push(e);if(r==="executing")return;t._state="executing",t._queue=o=[],t.options.timeout&&(t._timeout=setTimeout(function(){t.abort("Timeout")},t.options.timeout)),t._reqsWaiting=n.length;for(i=0,s=n.length;i<s;++i)u=n[i],u.async||u.type==="css"?t._insert(u):o.push(u);t._next()},purge:function(){i._purge(this.nodes)},_createNode:function(e,t,n){var i=n.createElement(e),s,o;r||(o=n.createElement("div"),o.setAttribute("class","a"),r=o.className==="a"?{}:{"for":"htmlFor","class":"className"});for(s in t)t.hasOwnProperty(s)&&i.setAttribute(r[s]||s,t[s]);return i},_finish:function(){var e=this.errors.length?this.errors:null,t=this.options,n=t.context||this,r,i,s;if(this._state==="done")return;this._state="done";for(i=0,s=this._callbacks.length;i<s;++i)this._callbacks[i].call(n,e,this);r=this._getEventData(),e?(t.onTimeout&&e[e.length-1].error==="Timeout"&&t.onTimeout.call(n,r),t.onFailure&&t.onFailure.call(n,r)):t.onSuccess&&t.onSuccess.call(n,r),t.onEnd&&t.onEnd.call(n,r),t._onFinish&&t._onFinish()},_getEventData:function(t){return t?e.merge(this,{abort:this.abort,purge:this.purge,request:t,url:t.url,win:t.win}):this},_getInsertBefore:function(t){var n=t.doc,r=t.insertBefore,s,o,u;return r?typeof r=="string"?n.getElementById(r):r:(s=i._insertCache,u=e.stamp(n),(r=s[u])?r:(r=n.getElementsByTagName("base")[0])?s[u]=r:(r=n.head||n.getElementsByTagName("head")[0],r?(r.appendChild(n.createTextNode("")),s[u]=r.lastChild):s[u]=n.getElementsByTagName("script")[0]))},_insert:function(t){function c(){u._progress("Failed to load "+t.url,t)}function h(){f&&clearTimeout(f),u._progress(null,t)}var n=i._env,r=this._getInsertBefore(t),s=t.type==="js",o=t.node,u=this,a=e.UA,f,l;o||(s?l="script":!n.cssLoad&&a.gecko?l="style":l="link",o=t.node=this._createNode(l,t.attributes,t.doc)),s?(o.setAttribute("src",t.url),t.async?o.async=!0:(n.async&&(o.async=!1),n.preservesScriptOrder||(this._pending=t))):!n.cssLoad&&a.gecko?o.innerHTML=(t.attributes.charset?'@charset "'+t.attributes.charset+'";':"")+'@import "'+t.url+'";':o.setAttribute("href",t.url),s&&a.ie&&(a.ie<9||document.documentMode&&document.documentMode<9)?o.onreadystatechange=function(){/loaded|complete/.test(o.readyState)&&(o.onreadystatechange=null,h())}:!s&&!n.cssLoad?this._poll(t):(a.ie>=10?(o.onerror=function(){setTimeout(c,0)},o.onload=function(){setTimeout(h,0)}):(o.onerror=c,o.onload=h),!n.cssFail&&!s&&(f=setTimeout(c,t.timeout||3e3))),this.nodes.push(o),r.parentNode.insertBefore(o,r)},_next:function(){if(this._pending)return;this._queue.length?this._insert(this._queue.shift()):this._reqsWaiting||this._finish()},_poll:function(t){var n=this,r=n._pendingCSS,i=e.UA.webkit,s,o,u,a,f,l;if(t){r||(r=n._pendingCSS=[]),r.push(t);if(n._pollTimer)return}n._pollTimer=null;for(s=0;s<r.length;++s){f=r[s];if(i){l=f.doc.styleSheets,u=l.length,a=f.node.href;while(--u>=0)if(l[u].href===a){r.splice(s,1),s-=1,n._progress(null,f);break}}else try{o=!!f.node.sheet.cssRules,r.splice(s,1),s-=1,n._progress(null,f)}catch(c){}}r.length&&(n._pollTimer=setTimeout(function(){n._poll.call(n)},n.options.pollInterval))},_progress:function(e,t){var n=this.options;e&&(t.error=e,this.errors.push({error:e,request:t})),t.node._yuiget_finished=t.finished=!0,n.onProgress&&n.onProgress.call(n.context||this,this._getEventData(t)),t.autopurge&&(i._autoPurge(this.options.purgethreshold),i._purgeNodes.push(t.node)),this._pending===t&&(this._pending=null),this._reqsWaiting-=1,this._next()}}},"3.7.3",{requires:["yui-base"]}),YUI.add("features",function(e,t){var n={};e.mix(e.namespace("Features"),{tests:n,add:function(e,t,r){n[e]=n[e]||{},n[e][t]=r},all:function(t,r){var i=n[t],s=[];return i&&e.Object.each(i,function(n,i){s.push(i+":"+(e.Features.test(t,i,r)?1:0))}),s.length?s.join(";"):""},test:function(t,r,i){i=i||[];var s,o,u,a=n[t],f=a&&a[r];return!f||(s=f.result,e.Lang.isUndefined(s)&&(o=f.ua,o&&(s=e.UA[o]),u=f.test,u&&(!o||s)&&(s=u.apply(e,i)),f.result=s)),s}});var r=e.Features.add;r("load","0",{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"}),r("load","1",{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"}),r("load","2",{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"}),r("load","3",{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"}),r("load","4",{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"}),r("load","5",{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"}),r("load","6",{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","7",{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}),r("load","8",{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","9",{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}),r("load","10",{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","11",{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}),r("load","12",{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"}),r("load","13",{name:"io-nodejs",trigger:"io-base",ua:"nodejs"}),r("load","14",{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"}),r("load","15",{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"}),r("load","16",{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"}),r("load","17",{name:"widget-base-ie",trigger:"widget-base",ua:"ie"}),r("load","18",{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}),r("load","19",{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"})},"3.7.3",{requires:["yui-base"]}),YUI.add("intl-base",function(e,t){var n=/[, ]/;e.mix(e.namespace("Intl"),{lookupBestLang:function(t,r){function a(e){var t;for(t=0;t<r.length;t+=1)if(e.toLowerCase()===r[t].toLowerCase())return r[t]}var i,s,o,u;e.Lang.isString(t)&&(t=t.split(n));for(i=0;i<t.length;i+=1){s=t[i];if(!s||s==="*")continue;while(s.length>0){o=a(s);if(o)return o;u=s.lastIndexOf("-");if(!(u>=0))break;s=s.substring(0,u),u>=2&&s.charAt(u-2)==="-"&&(s=s.substring(0,u-2))}}return""}})},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-log",function(e,t){var n=e,r="yui:log",i="undefined",s={debug:1,info:1,warn:1,error:1};n.log=function(e,t,o,u){var a,f,l,c,h,p=n,d=p.config,v=p.fire?p:YUI.Env.globalEvents;return d.debug&&(o=o||"",typeof o!="undefined"&&(f=d.logExclude,l=d.logInclude,!l||o in l?l&&o in l?a=!l[o]:f&&o in f&&(a=f[o]):a=1),a||(d.useBrowserConsole&&(c=o?o+": "+e:e,p.Lang.isFunction(d.logFn)?d.logFn.call(p,e,t,o):typeof console!=i&&console.log?(h=t&&console[t]&&t in s?t:"log",console[h](c)):typeof opera!=i&&opera.postError(c)),v&&!u&&(v==p&&!v.getEvent(r)&&v.publish(r,{broadcast:2}),v.fire(r,{msg:e,cat:t,src:o})))),p},n.message=function(){return n.log.apply(n,arguments)}},"3.7.3",{requires:["yui-base"]}),YUI.add("yui-later",function(e,t){var n=[];e.later=function(t,r,i,s,o){t=t||0,s=e.Lang.isUndefined(s)?n:e.Array(s),r=r||e.config.win||e;var u=!1,a=r&&e.Lang.isString(i)?r[i]:i,f=function(){u||(a.apply?a.apply(r,s||n):a(s[0],s[1],s[2],s[3]))},l=o?setInterval(f,t):setTimeout(f,t);return{id:l,interval:o,cancel:function(){u=!0,this.interval?clearInterval(l):clearTimeout(l)}}},e.Lang.later=e.later},"3.7.3",{requires:["yui-base"]}),YUI.add("loader-base",function(e,t){YUI.Env[e.version]||function(){var t=e.version,n="/build/",r=t+n,i=e.Env.base,s="gallery-2012.10.10-19-59",o="2in3",u="4",a="2.9.0",f=i+"combo?",l={version:t,root:r,base:e.Env.base,comboBase:f,skin:{defaultSkin:"sam",base:"assets/skins/",path:"skin.css",after:["cssreset","cssfonts","cssgrids","cssbase","cssreset-context","cssfonts-context"]},groups:{},patterns:{}},c=l.groups,h=function(e,t,r){var s=o+"."+(e||u)+"/"+(t||a)+n,l=r&&r.base?r.base:i,h=r&&r.comboBase?r.comboBase:f;c.yui2.base=l+s,c.yui2.root=s,c.yui2.comboBase=h},p=function(e,t){var r=(e||s)+n,o=t&&t.base?t.base:i,u=t&&t.comboBase?t.comboBase:f;c.gallery.base=o+r,c.gallery.root=r,c.gallery.comboBase=u};c[t]={},c.gallery={ext:!1,combine:!0,comboBase:f,update:p,patterns:{"gallery-":{},"lang/gallery-":{},"gallerycss-":{type:"css"}}},c.yui2={combine:!0,ext:!1,comboBase:f,update:h,patterns:{"yui2-":{configFn:function(e){/-skin|reset|fonts|grids|base/.test(e.name)&&(e.type="css",e.path=e.path.replace(/\.js/,".css"),e.path=e.path.replace(/\/yui2-skin/,"/assets/skins/sam/yui2-skin"))}}}},p(),h(),YUI.Env[t]=l}();var n={},r=[],i=1024,s=YUI.Env,o=s._loaded,u="css",a="js",f="intl",l="sam",c=e.version,h="",p=e.Object,d=p.each,v=e.Array,m=s._loaderQueue,g=s[c],y="skin-",b=e.Lang,w=s.mods,E,S=function(e,t,n,r){var i=e+"/"+t;return r||(i+="-min"),i+="."+(n||u),i};YUI.Env._cssLoaded||(YUI.Env._cssLoaded={}),e.Env.meta=g,e.Loader=function(t){var n=this;t=t||{},E=g.md5,n.context=e,n.base=e.Env.meta.base+e.Env.meta.root,n.comboBase=e.Env.meta.comboBase,n.combine=t.base&&t.base.indexOf(n.comboBase.substr(0,20))>-1,n.comboSep="&",n.maxURLLength=i,n.ignoreRegistered=t.ignoreRegistered,n.root=e.Env.meta.root,n.timeout=0,n.forceMap={},n.allowRollup=!1,n.filters={},n.required={},n.patterns={},n.moduleInfo={},n.groups=e.merge(e.Env.meta.groups),n.skin=e.merge(e.Env.meta.skin),n.conditions={},n.config=t,n._internal=!0,n._populateCache(),n.loaded=o[c],n.async=!0,n._inspectPage(),n._internal=!1,n._config(t),n.forceMap=n.force?e.Array.hash(n.force):{},n.testresults=null,e.config.tests&&(n.testresults=e.config.tests),n.sorted=[],n.dirty=!0,n.inserted={},n.skipped={},n.tested={},n.ignoreRegistered&&n._resetModules()},e.Loader.prototype={_populateCache:function(){var t=this,n=g.modules,r=s._renderedMods,i;if(r&&!t.ignoreRegistered){for(i in r)r.hasOwnProperty(i)&&(t.moduleInfo[i]=e.merge(r[i]));r=s._conditions;for(i in r)r.hasOwnProperty(i)&&(t.conditions[i]=e.merge(r[i]))}else for(i in n)n.hasOwnProperty(i)&&t.addModule(n[i],i)},_resetModules:function(){var e=this,t,n,r,i,s;for(t in e.moduleInfo)if(e.moduleInfo.hasOwnProperty(t)){r=e.moduleInfo[t],i=r.name,s=YUI.Env.mods[i]?YUI.Env.mods[i].details:null,s&&(e.moduleInfo[i]._reset=!0,e.moduleInfo[i].requires=s.requires||[],e.moduleInfo[i].optional=s.optional||[],e.moduleInfo[i].supersedes=s.supercedes||[]);if(r.defaults)for(n in r.defaults)r.defaults.hasOwnProperty(n)&&r[n]&&(r[n]=r.defaults[n]);delete r.langCache,delete r.skinCache,r.skinnable&&e._addSkin(e.skin.defaultSkin,r.name)}},REGEX_CSS:/\.css(?:[?;].*)?$/i,FILTER_DEFS:{RAW:{searchExp:"-min\\.js",replaceStr:".js"},DEBUG:{searchExp:"-min\\.js",replaceStr:"-debug.js"},COVERAGE:{searchExp:"-min\\.js",replaceStr:"-coverage.js"}},_inspectPage:function(){var e=this,t,n,r,i,s;for(s in e.moduleInfo)e.moduleInfo.hasOwnProperty(s)&&(t=e.moduleInfo[s],t.type&&t.type===u&&e.isCSSLoaded(t.name)&&(e.loaded[s]=!0));for(s in w)w.hasOwnProperty(s)&&(t=w[s],t.details&&(n=e.moduleInfo[t.name],r=t.details.requires,i=n&&n.requires,n?!n._inspected&&r&&i.length!==r.length&&delete n.expanded:n=e.addModule(t.details,s),n._inspected=!0))},_requires:function(e,t){var n,r,i,s,o=this.moduleInfo,a=o[e],f=o[t];if(!a||!f)return!1;r=a.expanded_map,i=a.after_map;if(i&&t in i)return!0;i=f.after_map;if(i&&e in i)return!1;s=o[t]&&o[t].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(e,s[n]))return!0;s=o[e]&&o[e].supersedes;if(s)for(n=0;n<s.length;n++)if(this._requires(t,s[n]))return!1;return r&&t in r?!0:a.ext&&a.type===u&&!f.ext&&f.type===u?!0:!1},_config:function(t){var n,r,i,s,o,u,a,f=this,l=[],c;if(t)for(n in t)if(t.hasOwnProperty(n)){i=t[n];if(n==="require")f.require(i);else if(n==="skin")typeof i=="string"&&(f.skin.defaultSkin=t.skin,i={defaultSkin:i}),e.mix(f.skin,i,!0);else if(n==="groups"){for(r in i)if(i.hasOwnProperty(r)){a=r,u=i[r],f.addGroup(u,a);if(u.aliases)for(s in u.aliases)u.aliases.hasOwnProperty(s)&&f.addAlias(u.aliases[s],s)}}else if(n==="modules")for(r in i)i.hasOwnProperty(r)&&f.addModule(i[r],r);else if(n==="aliases")for(r in i)i.hasOwnProperty(r)&&f.addAlias(i[r],r);else n==="gallery"?this.groups.gallery.update(i,t):n==="yui2"||n==="2in3"?this.groups.yui2.update(t["2in3"],t.yui2,t):f[n]=i}o=f.filter,b.isString(o)&&(o=o.toUpperCase(),f.filterName=o,f.filter=f.FILTER_DEFS[o],o==="DEBUG"&&f.require("yui-log","dump"));if(f.filterName&&f.coverage&&f.filterName==="COVERAGE"&&b.isArray(f.coverage)&&f.coverage.length){for(n=0;n<f.coverage.length;n++)c=f.coverage[n],f.moduleInfo[c]&&f.moduleInfo[c].use?l=[].concat(l,f.moduleInfo[c].use):l.push(c);f.filters=f.filters||{},e.Array.each(l,function(e){f.filters[e]=f.FILTER_DEFS.COVERAGE}),f.filterName="RAW",f.filter=f.FILTER_DEFS[f.filterName]}},formatSkin:function(e,t){var n=y+e;return t&&(n=n+"-"+t),n},_addSkin:function(e,t,n){var r,i,s,o,u=this.moduleInfo,a=this.skin,f=u[t]&&u[t].ext;return t&&(s=this.formatSkin(e,t),u[s]||(r=u[t],i=r.pkg||t,o={skin:!0,name:s,group:r.group,type:"css",after:a.after,path:(n||i)+"/"+a.base+e+"/"+t+".css",ext:f},r.base&&(o.base=r.base),r.configFn&&(o.configFn=r.configFn),this.addModule(o,s))),s},addAlias:function(e,t){YUI.Env.aliases[t]=e,this.addModule({name:t,use:e})},addGroup:function(e,t){var n=e.modules,r=this,i,s;t=t||e.name,e.name=t,r.groups[t]=e;if(e.patterns)for(i in e.patterns)e.patterns.hasOwnProperty(i)&&(e.patterns[i].group=t,r.patterns[i]=e.patterns[i]);if(n)for(i in n)n.hasOwnProperty(i)&&(s=n[i],typeof s=="string"&&(s={name:i,fullpath:s}),s.group=t,r.addModule(s,i))},addModule:function(t,n){n=n||t.name,typeof t=="string"&&(t={name:n,fullpath:t});var r,i,o,f,l,c,p,d,m,g,y,b,w,E,x,T,N,C,k,L,A,O,M=this.conditions,_;this.moduleInfo[n]&&this.moduleInfo[n].temp&&(t=e.merge(this.moduleInfo[n],t)),t.name=n;if(!t||!t.name)return null;t.type||(t.type=a,O=t.path||t.fullpath,O&&this.REGEX_CSS.test(O)&&(t.type=u)),!t.path&&!t.fullpath&&(t.path=S(n,n,t.type)),t.supersedes=t.supersedes||t.use,t.ext="ext"in t?t.ext:this._internal?!1:!0,r=t.submodules,this.moduleInfo[n]=t,t.requires=t.requires||[];if(this.requires)for(i=0;i<this.requires.length;i++)t.requires.push(this.requires[i]);if(t.group&&this.groups&&this.groups[t.group]){A=this.groups[t.group];if(A.requires)for(i=0;i<A.requires.length;i++)t.requires.push(A.requires[i])}t.defaults||(t.defaults={requires:t.requires?[].concat(t.requires):null,supersedes:t.supersedes?[].concat(t.supersedes):null,optional:t.optional?[].concat(t.optional):null}),t.skinnable&&t.ext&&t.temp&&(k=this._addSkin(this.skin.defaultSkin,n),t.requires.unshift(k)),t.requires.length&&(t.requires=this.filterRequires(t.requires)||[]);if(!t.langPack&&t.lang){y=v(t.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b))}if(r){l=t.supersedes||[],o=0;for(i in r)if(r.hasOwnProperty(i)){c=r[i],c.path=c.path||S(n,i,t.type),c.pkg=n,c.group=t.group,c.supersedes&&(l=l.concat(c.supersedes)),p=this.addModule(c,i),l.push(i);if(p.skinnable){t.skinnable=!0,C=this.skin.overrides;if(C&&C[i])for(g=0;g<C[i].length;g++)k=this._addSkin(C[i][g],i,n),l.push(k);k=this._addSkin(this.skin.defaultSkin,i,n),l.push(k)}if(c.lang&&c.lang.length){y=v(c.lang);for(g=0;g<y.length;g++)T=y[g],b=this.getLangPackName(T,n),w=this.getLangPackName(T,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),E=E||v.hash(p.supersedes),w in E||p.supersedes.push(w),t.lang=t.lang||[],x=x||v.hash(t.lang),T in x||t.lang.push(T),b=this.getLangPackName(h,n),w=this.getLangPackName(h,i),p=this.moduleInfo[b],p||(p=this._addLangPack(T,t,b)),w in E||p.supersedes.push(w)}o++}t.supersedes=v.dedupe(l),this.allowRollup&&(t.rollup=o<4?o:Math.min(o-1,4))}d=t.plugins;if(d)for(i in d)d.hasOwnProperty(i)&&(m=d[i],m.pkg=n,m.path=m.path||S(n,i,t.type),m.requires=m.requires||[],m.group=t.group,this.addModule(m,i),t.skinnable&&this._addSkin(this.skin.defaultSkin,i,n));if(t.condition){f=t.condition.trigger,YUI.Env.aliases[f]&&(f=YUI.Env.aliases[f]),e.Lang.isArray(f)||(f=[f]);for(i=0;i<f.length;i++)_=f[i],L=t.condition.when,M[_]=M[_]||{},M[_][n]=t.condition,L&&L!=="after"?L==="instead"&&(t.supersedes=t.supersedes||[],t.supersedes.push(_)):(t.after=t.after||[],t.after.push(_))}return t.supersedes&&(t.supersedes=this.filterRequires(t.supersedes)),t.after&&(t.after=this.filterRequires(t.after),t.after_map=v.hash(t.after)),t.configFn&&(N=t.configFn(t),N===!1&&(delete this.moduleInfo[n],delete s._renderedMods[n],t=null)),t&&(s._renderedMods||(s._renderedMods={}),s._renderedMods[n]=e.mix(s._renderedMods[n]||{},t),s._conditions=M),t},require:function(t){var n=typeof t=="string"?v(arguments):t;this.dirty=!0,this.required=e.merge(this.required,v.hash(this.filterRequires(n))),this._explodeRollups()},_explodeRollups:function(){var e=this,t,n,r,i,s,o,u,a=e.required;if(!e.allowRollup){for(r in a)if(a.hasOwnProperty(r)){t=e.getModule(r);if(t&&t.use){o=t.use.length;for(i=0;i<o;i++){n=e.getModule(t.use[i]);if(n&&n.use){u=n.use.length;for(s=0;s<u;s++)a[n.use[s]]=!0}else a[t.use[i]]=!0}}}e.required=a}},filterRequires:function(t){if(t){e.Lang.isArray(t)||(t=[t]),t=e.Array(t);var n=[],r,i,s,o;for(r=0;r<t.length;r++){i=this.getModule(t[r]);if(i&&i.use)for(s=0;s<i.use.length;s++)o=this.getModule(i.use[s]),o&&o.use&&o.name!==i.name?n=e.Array.dedupe([].concat(n,this.filterRequires(o.use))):n.push(i.use[s]);else n.push(t[r])}t=n}return t},getRequires:function(t){if(!t)return r;if(t._parsed)return t.expanded||r;var n,i,s,o,u,a,l=this.testresults,c=t.name,m,g=w[c]&&w[c].details,y,b,E,S,x,T,N,C,k,L,A=t.lang||t.intl,O=this.moduleInfo,M=e.Features&&e.Features.tests.load,_,D;t.temp&&g&&(x=t,t=this.addModule(g,c),t.group=x.group,t.pkg=x.pkg,delete t.expanded),D=!!this.lang&&t.langCache!==this.lang||t.skinCache!==this.skin.defaultSkin;if(t.expanded&&!D)return t.expanded;y=[],_={},S=this.filterRequires(t.requires),t.lang&&(y.unshift("intl"),S.unshift("intl"),A=!0),T=this.filterRequires(t.optional),t._parsed=!0,t.langCache=this.lang,t.skinCache=this.skin.defaultSkin;for(n=0;n<S.length;n++)if(!_[S[n]]){y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}S=this.filterRequires(t.supersedes);if(S)for(n=0;n<S.length;n++)if(!_[S[n]]){t.submodules&&y.push(S[n]),_[S[n]]=!0,i=this.getModule(S[n]);if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}if(T&&this.loadOptional)for(n=0;n<T.length;n++)if(!_[T[n]]){y.push(T[n]),_[T[n]]=!0,i=O[T[n]];if(i){o=this.getRequires(i),A=A||i.expanded_map&&f in i.expanded_map;for(s=0;s<o.length;s++)y.push(o[s])}}m=this.conditions[c];if(m){t._parsed=!1;if(l&&M)d(l,function(e,t){var n=M[t].name;!_[n]&&M[t].trigger===c&&e&&M[t]&&(_[n]=!0,y.push(n))});else for(n in m)if(m.hasOwnProperty(n)&&!_[n]){E=m[n],b=E&&(!E.ua&&!E.test||E.ua&&e.UA[E.ua]||E.test&&E.test(e,S));if(b){_[n]=!0,y.push(n),i=this.getModule(n);if(i){o=this.getRequires(i);for(s=0;s<o.length;s++)y.push(o[s])}}}}if(t.skinnable){C=this.skin.overrides;for(n in YUI.Env.aliases)YUI.Env.aliases.hasOwnProperty(n)&&e.Array.indexOf(YUI.Env.aliases[n],c)>-1&&(k=n);if(C&&(C[c]||k&&C[k])){L=c,C[k]&&(L=k);for(n=0;n<C[L].length;n++)N=this._addSkin(C[L][n],c),this.isCSSLoaded(N,this._boot)||y.push(N)}else N=this._addSkin(this.skin.defaultSkin,c),this.isCSSLoaded(N,this._boot)||y.push(N)}return t._parsed=!1,A&&(t.lang&&!t.langPack&&e.Intl&&(a=e.Intl.lookupBestLang(this.lang||h,t.lang),u=this.getLangPackName(a,c),u&&y.unshift(u)),y.unshift(f)),t.expanded_map=v.hash(y),t.expanded=p.keys(t.expanded_map),t.expanded},isCSSLoaded:function(t,n){if(!t||!YUI.Env.cssStampEl||!n&&this.ignoreRegistered)return!1;var r=YUI.Env.cssStampEl,i=!1,s=YUI.Env._cssLoaded[t],o=r.currentStyle;return s!==undefined?s:(r.className=t,o||(o=e.config.doc.defaultView.getComputedStyle(r,null)),o&&o.display==="none"&&(i=!0),r.className="",YUI.Env._cssLoaded[t]=i,i)},getProvides:function(t){var r=this.getModule(t),i,s;return r?(r&&!r.provides&&(i={},s=r.supersedes,s&&v.each(s,function(t){e.mix(i,this.getProvides(t))},this),i[t]=!0,r.provides=i),r.provides):n},calculate:function(e,t){if(e||t||this.dirty)e&&this._config(e),this._init||this._setup(),this._explode(),this.allowRollup?this._rollup():this._explodeRollups(),this._reduce(),this._sort()},_addLangPack:function(t,n,r){var i=n.name,s,o,u=this.moduleInfo[r];return u||(s=S(n.pkg||i,r,a,!0),o={path:s,intl:!0,langPack:!0,ext:n.ext,group:n.group,supersedes:[]},n.root&&(o.root=n.root),n.base&&(o.base=n.base),n.configFn&&(o.configFn=n.configFn),this.addModule(o,r),t&&(e.Env.lang=e.Env.lang||{},e.Env.lang[t]=e.Env.lang[t]||{},e.Env.lang[t][i]=!0)),this.moduleInfo[r]},_setup:function(){var t=this.moduleInfo,n,r,i,o,u,a;for(n in t)t.hasOwnProperty(n)&&(o=t[n],o&&(o.requires=v.dedupe(o.requires),o.lang&&(a=this.getLangPackName(h,n),this._addLangPack(null,o,a))));u={},this.ignoreRegistered||e.mix(u,s.mods),this.ignore&&e.mix(u,v.hash(this.ignore));for(i in u)u.hasOwnProperty(i)&&e.mix(u,this.getProvides(i));if(this.force)for(r=0;r<this.force.length;r++)this.force[r]in u&&delete u[this.force[r]];e.mix(this.loaded,u),this._init=!0},getLangPackName:function(e,t){return"lang/"+t+(e?"_"+e:"")},_explode:function(){var t=this.required,n,r,i={},s=this,o,u;s.dirty=!1,s._explodeRollups(),t=s.required;for(o in t)t.hasOwnProperty(o)&&(i[o]||(i[o]=!0,n=s.getModule(o),n&&(u=n.expound,u&&(t[u]=s.getModule(u),r=s.getRequires(t[u]),e.mix(t,v.hash(r))),r=s.getRequires(n),e.mix(t,v.hash(r)))))},_patternTest:function(e,t){return e.indexOf(t)>-1},getModule:function(t){if(!t)return null;var n,r,i,s=this.moduleInfo[t],o=this.patterns;if(!s||s&&s.ext)for(i in o)if(o.hasOwnProperty(i)){n=o[i],n.test||(n.test=this._patternTest);if(n.test(t,i)){r=n;break}}return s?r&&s&&r.configFn&&!s.configFn&&(s.configFn=r.configFn,s.configFn(s)):r&&(n.action?n.action.call(this,t,i):(s=this.addModule(e.merge(r),t),r.configFn&&(s.configFn=r.configFn),s.temp=!0)),s},_rollup:function(){},_reduce:function(e){e=e||this.required;var t,n,r,i,s=this.loadType,o=this.ignore?v.hash(this.ignore):!1;for(t in e)if(e.hasOwnProperty(t)){i=this.getModule(t),((this.loaded[t]||w[t])&&!this.forceMap[t]&&!this.ignoreRegistered||s&&i&&i.type!==s)&&delete e[t],o&&o[t]&&delete e[t],r=i&&i.supersedes;if(r)for(n=0;n<r.length;n++)r[n]in e&&delete e[r[n]]}return e},_finish:function(e,t){m.running=!1;var n=this.onEnd;n&&n.call(this.context,{msg:e,data:this.data,success:t}),this._continue()},_onSuccess:function(){var t=this,n=e.merge(t.skipped),r,i=[],s=t.requireRegistration,o,u,f,l;for(f in n)n.hasOwnProperty(f)&&delete t.inserted[f];t.skipped={};for(f in t.inserted)t.inserted.hasOwnProperty(f)&&(l=t.getModule(f),!l||!s||l.type!==a||f in YUI.Env.mods?e.mix(t.loaded,t.getProvides(f)):i.push(f));r=t.onSuccess,u=i.length?"notregistered":"success",o=!i.length,r&&r.call(t.context,{msg:u,data:t.data,success:o,failed:i,skipped:n}),t._finish(u,o)},_onProgress:function(e){var t=this,n;if(e.data&&e.data.length)for(n=0;n<e.data.length;n++)e.data[n]=t.getModule(e.data[n].name);t.onProgress&&t.onProgress.call(t.context,{name:e.url,data:e.data})},_onFailure:function(e){var t=this.onFailure,n=[],r=0,i=e.errors.length;for(r;r<i;r++)n.push(e.errors[r].error);n=n.join(","),t&&t.call(this.context,{msg:n,data:this.data,success:!1}),this._finish(n,!1)},_onTimeout:function(){var e=this.onTimeout;e&&e.call(this.context,{msg:"timeout",data:this.data,success:!1})},_sort:function(){var e=p.keys(this.required),t={},n=0,r,i,s,o,u,a,f;for(;;){r=e.length,a=!1;for(o=n;o<r;o++){i=e[o];for(u=o+1;u<r;u++){f=i+e[u];if(!t[f]&&this._requires(i,e[u])){s=e.splice(u,1),e.splice(o,0,s[0]),t[f]=!0,a=!0;break}}if(a)break;n++}if(!a)break}this.sorted=e},_insert:function(t,n,r,i){t&&this._config(t);var s=this.resolve(!i),o=this,f=0,l=0,c={},h,p;o._refetch=[],r&&(s[r===a?u:a]=[]),o.fetchCSS||(s.css=[]),s.js.length&&f++,s.css.length&&f++,p=function(t){l++;var n={},r=0,i=0,s="",u,a,p;if(t&&t.errors)for(r=0;r<t.errors.length;r++)t.errors[r].request?s=t.errors[r].request.url:s=t.errors[r],n[s]=s;if(t&&t.data&&t.data.length&&t.type==="success")for(r=0;r<t.data.length;r++){o.inserted[t.data[r].name]=!0;if(t.data[r].lang||t.data[r].skinnable)delete o.inserted[t.data[r].name],o._refetch.push(t.data[r].name)}if(l===f){o._loading=null;if(o._refetch.length){for(r=0;r<o._refetch.length;r++){h=o.getRequires(o.getModule(o._refetch[r]));for(i=0;i<h.length;i++)o.inserted[h[i]]||(c[h[i]]=h[i])}c=e.Object.keys(c);if(c.length){o.require(c),p=o.resolve(!0);if(p.cssMods.length){for(r=0;r<p.cssMods.length;r++)a=p.cssMods[r].name,delete YUI.Env._cssLoaded[a],o.isCSSLoaded(a)&&(o.inserted[a]=!0,delete o.required[a]);o.sorted=[],o._sort()}t=null,o._insert()}}t&&t.fn&&(u=t.fn,delete t.fn,u.call(o,t))}},this._loading=!0;if(!s.js.length&&!s.css.length){l=-1,p({fn:o._onSuccess});return}s.css.length&&e.Get.css(s.css,{data:s.cssMods,attributes:o.cssAttributes,insertBefore:o.insertBefore,charset:o.charset,timeout:o.timeout,context:o,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}}),s.js.length&&e.Get.js(s.js,{data:s.jsMods,insertBefore:o.insertBefore,attributes:o.jsAttributes,charset:o.charset,timeout:o.timeout,autopurge:!1,context:o,async:o.async,onProgress:function(e){o._onProgress.call(o,e)},onTimeout:function(e){o._onTimeout.call(o,e)},onSuccess:function(e){e.type="success",e.fn=o._onSuccess,p.call(o,e)},onFailure:function(e){e.type="failure",e.fn=o._onFailure,p.call(o,e)}})},_continue:function(){!m.running&&m.size()>0&&(m.running=!0,m.next()())},insert:function(t,n,r){var i=this,s=e.merge(this);delete s.require,delete s.dirty,m.add(function(){i._insert(s,t,n,r)}),this._continue()},loadNext:function(){return},_filter:function(e,t,n){var r=this.filter,i=t&&t in this.filters,s=i&&this.filters[t],o=n||(this.moduleInfo[t]?this.moduleInfo[t].group:null);return o&&this.groups[o]&&this.groups[o].filter&&(s=this.groups[o].filter,i=!0),e&&(i&&(r=b.isString(s)?this.FILTER_DEFS[s.toUpperCase()]||null:s),r&&(e=e.replace(new RegExp(r.searchExp,"g"),r.replaceStr))),e},_url:function(e,t,n){return this._filter((n||this.base||"")+e,t)},resolve:function(e,t){var r,s,o,f,c,h,p,d,v,m,g,y,w,E,S=[],x,T,N={},C=this,k,A,O=C.ignoreRegistered?{}:C.inserted,M={js:[],jsMods:[],css:[],cssMods:[]},_=C.loadType||"js",D;(C.skin.overrides||C.skin.defaultSkin!==l||C.ignoreRegistered)&&C._resetModules(),e&&C.calculate(),t=t||C.sorted,D=function(e){if(e){c=e.group&&C.groups[e.group]||n,c.async===!1&&(e.async=c.async),f=e.fullpath?C._filter(e.fullpath,t[s]):C._url(e.path,t[s],c.base||e.base);if(e.attributes||e.async===!1)f={url:f,async:e.async},e.attributes&&(f.attributes=e.attributes);M[e.type].push(f),M[e.type+"Mods"].push(e)}},r=t.length,y=C.comboBase,f=y,m={};for(s=0;s<r;s++){v=y,o=C.getModule(t[s]),h=o&&o.group,c=C.groups[h];if(h&&c){if(!c.combine||o.fullpath){D(o);continue}o.combine=!0,c.comboBase&&(v=c.comboBase),"root"in c&&b.isValue(c.root)&&(o.root=c.root),o.comboSep=c.comboSep||C.comboSep,o.maxURLLength=c.maxURLLength||C.maxURLLength}else if(!C.combine){D(o);continue}m[v]=m[v]||[],m[v].push(o)}for(p in m)if(m.hasOwnProperty(p)){N[p]=N[p]||{js:[],jsMods:[],css:[],cssMods:[]},f=p,g=m[p],r=g.length;if(r)for(s=0;s<r;s++){if(O[g[s]])continue;o=g[s],o&&(o.combine||!o.ext)?(N[p].comboSep=o.comboSep,N[p].group=o.group,N[p].maxURLLength=o.maxURLLength,d=(b.isValue(o.root)?o.root:C.root)+(o.path||o.fullpath),d=C._filter(d,o.name),N[p][o.type].push(d),N[p][o.type+"Mods"].push(o)):g[s]&&D(g[s])}}for(p in N){w=p,k=N[w].comboSep||C.comboSep,A=N[w].maxURLLength||C.maxURLLength;for(_ in N[w])if(_===a||_===u){E=N[w][_],g=N[w][_+"Mods"],r=E.length,x=w+E.join(k),T=x.length,A<=w.length&&(A=i);if(r)if(T>A){S=[];for(t=0;t<r;t++)S.push(E[t]),x=w+S.join(k),x.length>A&&(o=S.pop(),x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)),S=[],o&&S.push(o));S.length&&(x=w+S.join(k),M[_].push(C._filter(x,null,N[w].group)))}else M[_].push(C._filter(x,null,N[w].group));M[_+"Mods"]=M[_+"Mods"].concat(g)}}return N=null,M},load:function(e){if(!e)return;var t=this,n=t.resolve(!0);t.data=n,t.onEnd=function(){e.apply(t.context||t,arguments)},t.insert()}}},"3.7.3",{requires:["get","features"]}),YUI.add("loader-rollup",function(e,t){e.Loader.prototype._rollup=function(){var e,t,n,r,i=this.required,s,o=this.moduleInfo,u,a,f;if(this.dirty||!this.rollups){this.rollups={};for(e in o)o.hasOwnProperty(e)&&(n=this.getModule(e),n&&n.rollup&&(this.rollups[e]=n))}for(;;){u=!1;for(e in this.rollups)if(this.rollups.hasOwnProperty(e)&&!i[e]&&(!this.loaded[e]||this.forceMap[e])){n=this.getModule(e),r=n.supersedes||[],s=!1;if(!n.rollup)continue;a=0;for(t=0;t<r.length;t++){f=o[r[t]];if(this.loaded[r[t]]&&!this.forceMap[r[t]]){s=!1;break}if(i[r[t]]&&n.type===f.type){a++,s=a>=n.rollup;if(s)break}}s&&(i[e]=!0,u=!0,this.getRequires(n))}if(!u)break}}},"3.7.3",{requires:["loader-base"]}),YUI.add("loader-yui3",function(e,t){YUI.Env[e.version].modules=YUI.Env[e.version].modules||{"align-plugin":{requires:["node-screen","node-pluginhost"]},anim:{use:["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"]},"anim-base":{requires:["base-base","node-style"]},"anim-color":{requires:["anim-base"]},"anim-curve":{requires:["anim-xy"]},"anim-easing":{requires:["anim-base"]},"anim-node-plugin":{requires:["node-pluginhost","anim-base"]},"anim-scroll":{requires:["anim-base"]},"anim-shape":{requires:["anim-base","anim-easing","anim-color","matrix"]},"anim-shape-transform":{use:["anim-shape"]},"anim-xy":{requires:["anim-base","node-screen"]},app:{use:["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"]},"app-base":{requires:["classnamemanager","pjax-base","router","view"]},"app-content":{requires:["app-base","pjax-content"]},"app-transitions":{requires:["app-base"]},"app-transitions-css":{type:"css"},"app-transitions-native":{condition:{name:"app-transitions-native",test:function(e){var t=e.config.doc,n=t?t.documentElement:null;return n&&n.style?"MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style:!1},trigger:"app-transitions"},requires:["app-transitions","app-transitions-css","parallel","transition"]},"array-extras":{requires:["yui-base"]},"array-invoke":{requires:["yui-base"]},arraylist:{requires:["yui-base"]},"arraylist-add":{requires:["arraylist"]},"arraylist-filter":{requires:["arraylist"]},arraysort:{requires:["yui-base"]},"async-queue":{requires:["event-custom"]},attribute:{use:["attribute-base","attribute-complex"]},"attribute-base":{requires:["attribute-core","attribute-events","attribute-extras"]},"attribute-complex":{requires:["attribute-base"]},"attribute-core":{requires:["oop"]},"attribute-events":{requires:["event-custom"]},"attribute-extras":{requires:["oop"]},autocomplete:{use:["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"]},"autocomplete-base":{optional:["autocomplete-sources"],requires:["array-extras","base-build","escape","event-valuechange","node-base"]},"autocomplete-filters":{requires:["array-extras","text-wordbreak"]},"autocomplete-filters-accentfold":{requires:["array-extras","text-accentfold","text-wordbreak"]},"autocomplete-highlighters":{requires:["array-extras","highlight-base"]},"autocomplete-highlighters-accentfold":{requires:["array-extras","highlight-accentfold"]},"autocomplete-list":{after:["autocomplete-sources"],lang:["en"],requires:["autocomplete-base","event-resize","node-screen","selector-css3","shim-plugin","widget","widget-position","widget-position-align"],skinnable:!0},"autocomplete-list-keys":{condition:{name:"autocomplete-list-keys",test:function(e){return!e.UA.ios&&!e.UA.android},trigger:"autocomplete-list"},requires:["autocomplete-list","base-build"]},"autocomplete-plugin":{requires:["autocomplete-list","node-pluginhost"]},"autocomplete-sources":{optional:["io-base","json-parse","jsonp","yql"],requires:["autocomplete-base"]},base:{use:["base-base","base-pluginhost","base-build"]},"base-base":{after:["attribute-complex"],requires:["base-core","attribute-base"]},"base-build":{requires:["base-base"]},"base-core":{requires:["attribute-core"]},"base-pluginhost":{requires:["base-base","pluginhost"]},button:{requires:["button-core","cssbutton","widget"]},"button-core":{requires:["attribute-core","classnamemanager","node-base"]},"button-group":{requires:["button-plugin","cssbutton","widget"]},"button-plugin":{requires:["button-core","cssbutton","node-pluginhost"]},cache:{use:["cache-base","cache-offline","cache-plugin"]},"cache-base":{requires:["base"]},"cache-offline":{requires:["cache-base","json"]},"cache-plugin":{requires:["plugin","cache-base"]},calendar:{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["calendar-base","calendarnavigator"],skinnable:!0},"calendar-base":{lang:["de","en","fr","ja","nb-NO","pt-BR","ru","zh-HANT-TW"],requires:["widget","substitute","datatype-date","datatype-date-math","cssgrids"],skinnable:!0},calendarnavigator:{requires:["plugin","classnamemanager","datatype-date","node","substitute"],skinnable:!0},charts:{requires:["charts-base"]},"charts-base":{requires:["dom","datatype-number","datatype-date","event-custom","event-mouseenter","event-touch","widget","widget-position","widget-stack","graphics"]},"charts-legend":{requires:["charts-base"]},classnamemanager:{requires:["yui-base"]},"clickable-rail":{requires:["slider-base"]},collection:{use:["array-extras","arraylist","arraylist-add","arraylist-filter","array-invoke"]},console:{lang:["en","es","ja"],requires:["yui-log","widget"],skinnable:!0},"console-filters":{requires:["plugin","console"],skinnable:!0},controller:{use:["router"]},cookie:{requires:["yui-base"]},"createlink-base":{requires:["editor-base"]},cssbase:{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},"cssbase-context":{after:["cssreset","cssfonts","cssgrids","cssreset-context","cssfonts-context","cssgrids-context"],type:"css"},cssbutton:{type:"css"},cssfonts:{type:"css"},"cssfonts-context":{type:"css"},cssgrids:{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-base":{optional:["cssreset","cssfonts"],type:"css"},"cssgrids-units":{optional:["cssreset","cssfonts"],requires:["cssgrids-base"],type:"css"},cssreset:{type:"css"},"cssreset-context":{type:"css"},dataschema:{use:["dataschema-base","dataschema-json","dataschema-xml","dataschema-array","dataschema-text"]},"dataschema-array":{requires:["dataschema-base"]},"dataschema-base":{requires:["base"]},"dataschema-json":{requires:["dataschema-base","json"]},"dataschema-text":{requires:["dataschema-base"]},"dataschema-xml":{requires:["dataschema-base"]},datasource:{use:["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"]},"datasource-arrayschema":{requires:["datasource-local","plugin","dataschema-array"]},"datasource-cache":{requires:["datasource-local","plugin","cache-base"]},"datasource-function":{requires:["datasource-local"]},"datasource-get":{requires:["datasource-local","get"]},"datasource-io":{requires:["datasource-local","io-base"]},"datasource-jsonschema":{requires:["datasource-local","plugin","dataschema-json"]},"datasource-local":{requires:["base"]},"datasource-polling":{requires:["datasource-local"]},"datasource-textschema":{requires:["datasource-local","plugin","dataschema-text"]},"datasource-xmlschema":{requires:["datasource-local","plugin","datatype-xml","dataschema-xml"]},datatable:{use:["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"]},"datatable-base":{requires:["datatable-core","datatable-table","datatable-head","datatable-body","base-build","widget"],skinnable:!0},"datatable-base-deprecated":{requires:["recordset-base","widget","substitute","event-mouseenter"],skinnable:!0},"datatable-body":{requires:["datatable-core","view","classnamemanager"]},"datatable-column-widths":{requires:["datatable-base"]},"datatable-core":{requires:["escape","model-list","node-event-delegate"]},"datatable-datasource":{requires:["datatable-base","plugin","datasource-local"]},"datatable-datasource-deprecated":{requires:["datatable-base-deprecated","plugin","datasource-local"]},"datatable-deprecated":{use:["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"]},"datatable-head":{requires:["datatable-core","view","classnamemanager"]},"datatable-message":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-mutable":{requires:["datatable-base"]},"datatable-scroll":{requires:["datatable-base","datatable-column-widths","dom-screen"],skinnable:!0},"datatable-scroll-deprecated":{requires:["datatable-base-deprecated","plugin"]},"datatable-sort":{lang:["en"],requires:["datatable-base"],skinnable:!0},"datatable-sort-deprecated":{lang:["en"],requires:["datatable-base-deprecated","plugin","recordset-sort"]},"datatable-table":{requires:["datatable-core","datatable-head","datatable-body","view","classnamemanager"]},datatype:{use:["datatype-date","datatype-number","datatype-xml"]},"datatype-date":{use:["datatype-date-parse","datatype-date-format","datatype-date-math"]},"datatype-date-format":{lang:["ar","ar-JO","ca","ca-ES","da","da-DK","de","de-AT","de-DE","el","el-GR","en","en-AU","en-CA","en-GB","en-IE","en-IN","en-JO","en-MY","en-NZ","en-PH","en-SG","en-US","es","es-AR","es-BO","es-CL","es-CO","es-EC","es-ES","es-MX","es-PE","es-PY","es-US","es-UY","es-VE","fi","fi-FI","fr","fr-BE","fr-CA","fr-FR","hi","hi-IN","id","id-ID","it","it-IT","ja","ja-JP","ko","ko-KR","ms","ms-MY","nb","nb-NO","nl","nl-BE","nl-NL","pl","pl-PL","pt","pt-BR","ro","ro-RO","ru","ru-RU","sv","sv-SE","th","th-TH","tr","tr-TR","vi","vi-VN","zh-Hans","zh-Hans-CN","zh-Hant","zh-Hant-HK","zh-Hant-TW"]},"datatype-date-math":{requires:["yui-base"]},"datatype-date-parse":{},"datatype-number":{use:["datatype-number-parse","datatype-number-format"]},"datatype-number-format":{},"datatype-number-parse":{},"datatype-xml":{use:["datatype-xml-parse","datatype-xml-format"]},"datatype-xml-format":{},"datatype-xml-parse":{},dd:{use:["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"]},"dd-constrain":{requires:["dd-drag"]},"dd-ddm":{requires:["dd-ddm-base","event-resize"]},"dd-ddm-base":{requires:["node","base","yui-throttle","classnamemanager"]},"dd-ddm-drop":{requires:["dd-ddm"]},"dd-delegate":{requires:["dd-drag","dd-drop-plugin","event-mouseenter"]},"dd-drag":{requires:["dd-ddm-base"]},"dd-drop":{requires:["dd-drag","dd-ddm-drop"]},"dd-drop-plugin":{requires:["dd-drop"]},"dd-gestures":{condition:{name:"dd-gestures",trigger:"dd-drag",ua:"touchEnabled"},requires:["dd-drag","event-synthetic","event-gestures"]},"dd-plugin":{optional:["dd-constrain","dd-proxy"],requires:["dd-drag"]},"dd-proxy":{requires:["dd-drag"]},"dd-scroll":{requires:["dd-drag"]},dial:{lang:["en","es"],requires:["widget","dd-drag","event-mouseenter","event-move","event-key","transition","intl"],skinnable:!0},dom:{use:["dom-base","dom-screen","dom-style","selector-native","selector"]},"dom-base":{requires:["dom-core"]},"dom-core":{requires:["oop","features"]},"dom-deprecated":{requires:["dom-base"]},"dom-screen":{requires:["dom-base","dom-style"]},"dom-style":{requires:["dom-base"]},"dom-style-ie":{condition:{name:"dom-style-ie",test:function(e){var t=e.Features.test,n=e.Features.add,r=e.config.win,i=e.config.doc,s="documentElement",o=!1;return n("style","computedStyle",{test:function(){return r&&"getComputedStyle"in r}}),n("style","opacity",{test:function(){return i&&"opacity"in i[s].style}}),o=!t("style","opacity")&&!t("style","computedStyle"),o},trigger:"dom-style"},requires:["dom-style"]},dump:{requires:["yui-base"]},editor:{use:["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"]},"editor-base":{requires:["base","frame","node","exec-command","editor-selection"]},"editor-bidi":{requires:["editor-base"]},"editor-br":{requires:["editor-base"]},"editor-lists":{requires:["editor-base"]},"editor-para":{requires:["editor-para-base"]},"editor-para-base":{requires:["editor-base"]},"editor-para-ie":{condition:{name:"editor-para-ie",trigger:"editor-para",ua:"ie",when:"instead"},requires:["editor-para-base"]},"editor-selection":{requires:["node"]},"editor-tab":{requires:["editor-base"]},escape:{requires:["yui-base"]},event:{after:["node-base"],use:["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"]},"event-base":{after:["node-base"],requires:["event-custom-base"]},"event-base-ie":{after:["event-base"],condition:{name:"event-base-ie",test:function(e){var t=e.config.doc&&e.config.doc.implementation;return t&&!t.hasFeature("Events","2.0")},trigger:"node-base"},requires:["node-base"]},"event-contextmenu":{requires:["event-synthetic","dom-screen"]},"event-custom":{use:["event-custom-base","event-custom-complex"]},"event-custom-base":{requires:["oop"]},"event-custom-complex":{requires:["event-custom-base"]},"event-delegate":{requires:["node-base"]},"event-flick":{requires:["node-base","event-touch","event-synthetic"]},"event-focus":{requires:["event-synthetic"]},"event-gestures":{use:["event-flick","event-move"]},"event-hover":{requires:["event-mouseenter"]},"event-key":{requires:["event-synthetic"]},"event-mouseenter":{requires:["event-synthetic"]},"event-mousewheel":{requires:["node-base"]},"event-move":{requires:["node-base","event-touch","event-synthetic"]},"event-outside":{requires:["event-synthetic"]},"event-resize":{requires:["node-base","event-synthetic"]},"event-simulate":{requires:["event-base"]},"event-synthetic":{requires:["node-base","event-custom-complex"]},"event-tap":{requires:["node-base","event-base","event-touch","event-synthetic"]},"event-touch":{requires:["node-base"]},"event-valuechange":{requires:["event-focus","event-synthetic"]},"exec-command":{requires:["frame"]},features:{requires:["yui-base"]},file:{requires:["file-flash","file-html5"]},"file-flash":{requires:["base"]},"file-html5":{requires:["base"]},frame:{requires:["base","node","selector-css3","yui-throttle"]},"gesture-simulate":{requires:["async-queue","event-simulate","node-screen"]},get:{requires:["yui-base"]},graphics:{requires:["node","event-custom","pluginhost","matrix","classnamemanager"]},"graphics-canvas":{condition:{name:"graphics-canvas",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"},requires:["graphics"]},"graphics-canvas-default":{condition:{name:"graphics-canvas-default",test:function(e){var t=e.config.doc,n=e.config.defaultGraphicEngine&&e.config.defaultGraphicEngine=="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return(!i||n)&&r&&r.getContext&&r.getContext("2d")},trigger:"graphics"}},"graphics-svg":{condition:{name:"graphics-svg",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"},requires:["graphics"]},"graphics-svg-default":{condition:{name:"graphics-svg-default",test:function(e){var t=e.config.doc,n=!e.config.defaultGraphicEngine||e.config.defaultGraphicEngine!="canvas",r=t&&t.createElement("canvas"),i=t&&t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1");return i&&(n||!r)},trigger:"graphics"}},"graphics-vml":{condition:{name:"graphics-vml",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"},requires:["graphics"]},"graphics-vml-default":{condition:{name:"graphics-vml-default",test:function(e){var t=e.config.doc,n=t&&t.createElement("canvas");return t&&!t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")&&(!n||!n.getContext||!n.getContext("2d"))},trigger:"graphics"}},handlebars:{use:["handlebars-compiler"]},"handlebars-base":{requires:["escape"]},"handlebars-compiler":{requires:["handlebars-base"]},highlight:{use:["highlight-base","highlight-accentfold"]},"highlight-accentfold":{requires:["highlight-base","text-accentfold"]},"highlight-base":{requires:["array-extras","classnamemanager","escape","text-wordbreak"]},history:{use:["history-base","history-hash","history-hash-ie","history-html5"]},"history-base":{requires:["event-custom-complex"]},"history-hash":{after:["history-html5"],requires:["event-synthetic","history-base","yui-later"]},"history-hash-ie":{condition:{name:"history-hash-ie",test:function(e){var t=e.config.doc&&e.config.doc.documentMode;return e.UA.ie&&(!("onhashchange"in e.config.win)||!t||t<8)},trigger:"history-hash"},requires:["history-hash","node-base"]},"history-html5":{optional:["json"],requires:["event-base","history-base","node-base"]},imageloader:{requires:["base-base","node-style","node-screen"]},intl:{requires:["intl-base","event-custom"]},"intl-base":{requires:["yui-base"]},io:{use:["io-base","io-xdr","io-form","io-upload-iframe","io-queue"]},"io-base":{requires:["event-custom-base","querystring-stringify-simple"]},"io-form":{requires:["io-base","node-base"]},"io-nodejs":{condition:{name:"io-nodejs",trigger:"io-base",ua:"nodejs"},requires:["io-base"]},"io-queue":{requires:["io-base","queue-promote"]},"io-upload-iframe":{requires:["io-base","node-base"]},"io-xdr":{requires:["io-base","datatype-xml-parse"]},json:{use:["json-parse","json-stringify"]},"json-parse":{requires:["yui-base"]},"json-stringify":{requires:["yui-base"]},jsonp:{requires:["get","oop"]},"jsonp-url":{requires:["jsonp"]},"lazy-model-list":{requires:["model-list"]},loader:{use:["loader-base","loader-rollup","loader-yui3"]},"loader-base":{requires:["get","features"]},"loader-rollup":{requires:["loader-base"]},"loader-yui3":{requires:["loader-base"]},matrix:{requires:["yui-base"]},model:{requires:["base-build","escape","json-parse"]},"model-list":{requires:["array-extras","array-invoke","arraylist","base-build","escape","json-parse","model"]},"model-sync-rest":{requires:["model","io-base","json-stringify"]},node:{use:["node-base","node-event-delegate","node-pluginhost","node-screen","node-style"]},"node-base":{requires:["event-base","node-core","dom-base"]},"node-core":{requires:["dom-core","selector"]},"node-deprecated":{requires:["node-base"]},"node-event-delegate":{requires:["node-base","event-delegate"]},"node-event-html5":{requires:["node-base"]},"node-event-simulate":{requires:["node-base","event-simulate","gesture-simulate"]},"node-flick":{requires:["classnamemanager","transition","event-flick","plugin"],skinnable:!0},"node-focusmanager":{requires:["attribute","node","plugin","node-event-simulate","event-key","event-focus"]},"node-load":{requires:["node-base","io-base"]},"node-menunav":{requires:["node","classnamemanager","plugin","node-focusmanager"],skinnable:!0},"node-pluginhost":{requires:["node-base","pluginhost"]},"node-screen":{requires:["dom-screen","node-base"]},"node-scroll-info":{requires:["base-build","dom-screen","event-resize","node-pluginhost","plugin"]},"node-style":{requires:["dom-style","node-base"]},oop:{requires:["yui-base"]},overlay:{requires:["widget","widget-stdmod","widget-position","widget-position-align","widget-stack","widget-position-constrain"],skinnable:!0},panel:{requires:["widget","widget-autohide","widget-buttons","widget-modality","widget-position","widget-position-align","widget-position-constrain","widget-stack","widget-stdmod"],skinnable:!0},parallel:{requires:["yui-base"]},pjax:{requires:["pjax-base","pjax-content"]},"pjax-base":{requires:["classnamemanager","node-event-delegate","router"]},"pjax-content":{requires:["io-base","node-base","router"]},"pjax-plugin":{requires:["node-pluginhost","pjax","plugin"]},plugin:{requires:["base-base"]},pluginhost:{use:["pluginhost-base","pluginhost-config"]},"pluginhost-base":{requires:["yui-base"]},"pluginhost-config":{requires:["pluginhost-base"]},profiler:{requires:["yui-base"]},querystring:{use:["querystring-parse","querystring-stringify"]},"querystring-parse":{requires:["yui-base","array-extras"]},"querystring-parse-simple":{requires:["yui-base"]},"querystring-stringify":{requires:["yui-base"]},"querystring-stringify-simple":{requires:["yui-base"]},"queue-promote":{requires:["yui-base"]},"range-slider":{requires:["slider-base","slider-value-range","clickable-rail"]},recordset:{use:["recordset-base","recordset-sort","recordset-filter","recordset-indexer"]},"recordset-base":{requires:["base","arraylist"]},"recordset-filter":{requires:["recordset-base","array-extras","plugin"]},"recordset-indexer":{requires:["recordset-base","plugin"]},"recordset-sort":{requires:["arraysort","recordset-base","plugin"]},resize:{use:["resize-base","resize-proxy","resize-constrain"]},"resize-base":{requires:["base","widget","event","oop","dd-drag","dd-delegate","dd-drop"],skinnable:!0},"resize-constrain":{requires:["plugin","resize-base"]},"resize-plugin":{optional:["resize-constrain"],requires:["resize-base","plugin"]},"resize-proxy":{requires:["plugin","resize-base"]},router:{optional:["querystring-parse"],requires:["array-extras","base-build","history"]},scrollview:{requires:["scrollview-base","scrollview-scrollbars"]},"scrollview-base":{requires:["widget","event-gestures","event-mousewheel","transition"],skinnable:!0},"scrollview-base-ie":{condition:{name:"scrollview-base-ie",trigger:"scrollview-base",ua:"ie"},requires:["scrollview-base"]},"scrollview-list":{requires:["plugin","classnamemanager"],skinnable:!0},"scrollview-paginator":{requires:["plugin","classnamemanager"]},"scrollview-scrollbars":{requires:["classnamemanager","transition","plugin"],skinnable:!0},selector:{requires:["selector-native"]},"selector-css2":{condition:{name:"selector-css2",test:function(e){var t=e.config.doc,n=t&&!("querySelectorAll"in t);return n},trigger:"selector"},requires:["selector-native"]},"selector-css3":{requires:["selector-native","selector-css2"]},"selector-native":{requires:["dom-base"]},"shim-plugin":{requires:["node-style","node-pluginhost"]},slider:{use:["slider-base","slider-value-range","clickable-rail","range-slider"]},"slider-base":{requires:["widget","dd-constrain","event-key"],skinnable:!0},"slider-value-range":{requires:["slider-base"]},sortable:{requires:["dd-delegate","dd-drop-plugin","dd-proxy"]},"sortable-scroll":{requires:["dd-scroll","sortable"]},stylesheet:{requires:["yui-base"]},substitute:{optional:["dump"],requires:["yui-base"]},swf:{requires:["event-custom","node","swfdetect","escape"]},swfdetect:{requires:["yui-base"]},tabview:{requires:["widget","widget-parent","widget-child","tabview-base","node-pluginhost","node-focusmanager"],skinnable:!0},"tabview-base":{requires:["node-event-delegate","classnamemanager","skin-sam-tabview"]},"tabview-plugin":{requires:["tabview-base"]},test:{requires:["event-simulate","event-custom","json-stringify"]},"test-console":{requires:["console-filters","test","array-extras"],skinnable:!0},text:{use:["text-accentfold","text-wordbreak"]},"text-accentfold":{requires:["array-extras","text-data-accentfold"]},"text-data-accentfold":{requires:["yui-base"]},"text-data-wordbreak":{requires:["yui-base"]},"text-wordbreak":{requires:["array-extras","text-data-wordbreak"]},transition:{requires:["node-style"]},"transition-timer":{condition:{name:"transition-timer",test:function(e){var t=e.config.doc,n=t?t.documentElement:null,r=!0;return n&&n.style&&(r=!("MozTransition"in n.style||"WebkitTransition"in n.style||"transition"in n.style)),r},trigger:"transition"},requires:["transition"]},uploader:{requires:["uploader-html5","uploader-flash"]},"uploader-deprecated":{requires:["event-custom","node","base","swf"]},"uploader-flash":{requires:["swf","widget","substitute","base","cssbutton","node","event-custom","file-flash","uploader-queue"]},"uploader-html5":{requires:["widget","node-event-simulate","substitute","file-html5","uploader-queue"]},"uploader-queue":{requires:["base"]},view:{requires:["base-build","node-event-delegate"]},"view-node-map":{requires:["view"]},widget:{use:["widget-base","widget-htmlparser","widget-skin","widget-uievents"]},"widget-anim":{requires:["anim-base","plugin","widget"]},"widget-autohide":{requires:["base-build","event-key","event-outside","widget"]},"widget-base":{requires:["attribute","base-base","base-pluginhost","classnamemanager","event-focus","node-base","node-style"],skinnable:!0},"widget-base-ie":{condition:{name:"widget-base-ie",trigger:"widget-base",ua:"ie"},requires:["widget-base"]},"widget-buttons":{requires:["button-plugin","cssbutton","widget-stdmod"]},"widget-child":{requires:["base-build","widget"]},"widget-htmlparser":{requires:["widget-base"]},"widget-locale":{requires:["widget-base"]},"widget-modality":{requires:["base-build","event-outside","widget"],skinnable:!0},"widget-parent":{requires:["arraylist","base-build","widget"]},"widget-position":{requires:["base-build","node-screen","widget"]},"widget-position-align":{requires:["widget-position"]},"widget-position-constrain":{requires:["widget-position"]},"widget-skin":{requires:["widget-base"]},"widget-stack":{requires:["base-build","widget"],skinnable:!0},"widget-stdmod":{requires:["base-build","widget"]},"widget-uievents":{requires:["node-event-delegate","widget-base"]},yql:{requires:["jsonp","jsonp-url"]},"yql-nodejs":{condition:{name:"yql-nodejs",trigger:"yql",ua:"nodejs",when:"after"}},"yql-winjs":{condition:{name:"yql-winjs",trigger:"yql",ua:"winjs",when:"after"}},yui:{},"yui-base":{},"yui-later":{requires:["yui-base"]},"yui-log":{requires:["yui-base"]},"yui-throttle":{requires:["yui-base"]}},YUI.Env[e.version].md5="a28e022ad022130f7a4fb4ac77a2f1df"},"3.7.3",{requires:["loader-base"]}),YUI.add("yui",function(e,t){},"3.7.3",{use:["yui-base","get","features","intl-base","yui-log","yui-later","loader-base","loader-rollup","loader-yui3"]});
bundle/yui/yui.js view
@@ -1,5 +1,5 @@ /*-YUI 3.7.2 (build 5639)+YUI 3.7.3 (build 5687) Copyright 2012 Yahoo! Inc. All rights reserved. Licensed under the BSD License. http://yuilibrary.com/license/@@ -159,7 +159,7 @@ (function() { var proto, prop,- VERSION = '3.7.2',+ VERSION = '3.7.3', PERIOD = '.', BASE = 'http://yui.yahooapis.com/', /*@@ -2560,10 +2560,10 @@ result = 1; } else if (Lang.isObject(obj)) { try {- // indexed, but no tagName (element) or alert (window),+ // indexed, but no tagName (element) or scrollTo/document (window. From DOM.isWindow test which we can't use here), // or functions without apply/call (Safari // HTMLElementCollection bug).- if ('length' in obj && !obj.tagName && !obj.alert && !obj.apply) {+ if ('length' in obj && !obj.tagName && !(obj.scrollTo && obj.document) && !obj.apply) { result = 2; } } catch (ex) {}@@ -3332,7 +3332,7 @@ var numberify = function(s) { var c = 0; return parseFloat(s.replace(/\./g, function() {- return (c++ == 1) ? '' : '.';+ return (c++ === 1) ? '' : '.'; })); }, @@ -3447,13 +3447,6 @@ */ phantomjs: 0, /**- * Adobe AIR version number or 0. Only populated if webkit is detected.- * Example: 1.0- * @property air- * @type float- */- air: 0,- /** * Detects Apple iPad's OS version * @property ipad * @type float@@ -3542,7 +3535,21 @@ * @default 0 * @static */- nodejs: 0+ nodejs: 0,+ /*+ * Window8/IE10 Application host environment+ * @property winjs+ * @type Boolean+ * @static+ */+ winjs: !!((typeof Windows !== "undefined") && Windows.System),+ /**+ * Are touch/msPointer events available on this device+ * @property touchEnabled+ * @type Boolean+ * @static+ */+ touchEnabled: false }, ua = subUA || nav && nav.userAgent,@@ -3595,7 +3602,7 @@ if (m && m[1]) { o.webkit = numberify(m[1]); o.safari = o.webkit;- + if (/PhantomJS/.test(ua)) { m = ua.match(/PhantomJS\/([^\s]*)/); if (m && m[1]) {@@ -3714,10 +3721,16 @@ } } + //Check for known properties to tell if touch events are enabled on this device or if+ //the number of MSPointer touchpoints on this device is greater than 0.+ if (win && nav && !(o.chrome && o.chrome < 6)) {+ o.touchEnabled = (("ontouchstart" in win) || (("msMaxTouchPoints" in nav) && (nav.msMaxTouchPoints > 0)));+ }+ //It was a parsed UA, do not assign the global value. if (!subUA) { - if (typeof process == 'object') {+ if (typeof process === 'object') { if (process.versions && process.versions.node) { //NodeJS@@ -3786,6 +3799,7 @@ }; YUI.Env.aliases = { "anim": ["anim-base","anim-color","anim-curve","anim-easing","anim-node-plugin","anim-scroll","anim-xy"],+ "anim-shape-transform": ["anim-shape"], "app": ["app-base","app-content","app-transitions","lazy-model-list","model","model-list","model-sync-rest","router","view","view-node-map"], "attribute": ["attribute-base","attribute-complex"], "autocomplete": ["autocomplete-base","autocomplete-sources","autocomplete-list","autocomplete-plugin"],@@ -3797,14 +3811,14 @@ "datasource": ["datasource-local","datasource-io","datasource-get","datasource-function","datasource-cache","datasource-jsonschema","datasource-xmlschema","datasource-arrayschema","datasource-textschema","datasource-polling"], "datatable": ["datatable-core","datatable-table","datatable-head","datatable-body","datatable-base","datatable-column-widths","datatable-message","datatable-mutable","datatable-sort","datatable-datasource"], "datatable-deprecated": ["datatable-base-deprecated","datatable-datasource-deprecated","datatable-sort-deprecated","datatable-scroll-deprecated"],- "datatype": ["datatype-number","datatype-date","datatype-xml"],- "datatype-date": ["datatype-date-parse","datatype-date-format"],+ "datatype": ["datatype-date","datatype-number","datatype-xml"],+ "datatype-date": ["datatype-date-parse","datatype-date-format","datatype-date-math"], "datatype-number": ["datatype-number-parse","datatype-number-format"], "datatype-xml": ["datatype-xml-parse","datatype-xml-format"], "dd": ["dd-ddm-base","dd-ddm","dd-ddm-drop","dd-drag","dd-proxy","dd-constrain","dd-drop","dd-scroll","dd-delegate"], "dom": ["dom-base","dom-screen","dom-style","selector-native","selector"], "editor": ["frame","editor-selection","exec-command","editor-base","editor-para","editor-br","editor-bidi","editor-tab","createlink-base"],- "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange"],+ "event": ["event-base","event-delegate","event-synthetic","event-mousewheel","event-mouseenter","event-key","event-focus","event-resize","event-hover","event-outside","event-touch","event-move","event-flick","event-valuechange","event-tap"], "event-custom": ["event-custom-base","event-custom-complex"], "event-gestures": ["event-flick","event-move"], "handlebars": ["handlebars-compiler"],@@ -3824,7 +3838,7 @@ }; -}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]}); YUI.add('get', function (Y, NAME) { /*jslint boss:true, expr:true, laxbreak: true */@@ -4338,14 +4352,18 @@ // feasible to load test files on every pageview just to perform a // feature test. I'm sorry if this makes you sad. return (this._env = {+ // True if this is a browser that supports disabling async mode on // dynamically created script nodes. See // https://developer.mozilla.org/En/HTML/Element/Script#Attributes- async: doc && doc.createElement('script').async === true, + // IE10 doesn't return true for the MDN feature test, so setting it explicitly,+ // because it is async by default, and allows you to disable async by setting it to false+ async: (doc && doc.createElement('script').async === true) || (ua.ie >= 10),+ // True if this browser fires an event when a dynamically injected // link node fails to load. This is currently true for Firefox 9+- // and WebKit 535.24+.+ // and WebKit 535.24+ cssFail: ua.gecko >= 9 || ua.compareVersions(ua.webkit, 535.24) >= 0, // True if this browser fires an event when a dynamically injected@@ -4362,7 +4380,7 @@ // True if this browser preserves script execution order while // loading scripts in parallel as long as the script node's `async` // attribute is set to false to explicitly disable async execution.- preservesScriptOrder: !!(ua.gecko || ua.opera)+ preservesScriptOrder: !!(ua.gecko || ua.opera || (ua.ie && ua.ie >= 10)) }); }, @@ -4452,6 +4470,8 @@ options || (options = {}); options.type = type; + options._onFinish = Get._onTransactionFinish;+ if (!this._env) { this._getEnv(); }@@ -4468,6 +4488,11 @@ return transaction; }, + _onTransactionFinish : function() {+ Get._pending = null;+ Get._next();+ },+ _next: function () { var item; @@ -4479,13 +4504,7 @@ if (item) { this._pending = item;-- item.transaction.execute(function () {- item.callback && item.callback.apply(this, arguments);-- Get._pending = null;- Get._next();- });+ item.transaction.execute(item.callback); } }, @@ -4551,7 +4570,7 @@ self._callbacks = []; // callbacks to call after execution finishes self._queue = [];- self._waiting = 0;+ self._reqsWaiting = 0; // Deprecated pre-3.5.0 properties. self.tId = self.id; // Use `id` instead.@@ -4649,7 +4668,7 @@ this._pendingCSS = null; this._pollTimer = clearTimeout(this._pollTimer); this._queue = [];- this._waiting = 0;+ this._reqsWaiting = 0; this.errors.push({error: msg || 'Aborted'}); this._finish();@@ -4699,8 +4718,10 @@ }, self.options.timeout); } + self._reqsWaiting = requests.length;+ for (i = 0, len = requests.length; i < len; ++i) {- req = self.requests[i];+ req = requests[i]; if (req.async || req.type === 'css') { // No need to queue CSS or fully async JS.@@ -4787,6 +4808,10 @@ if (options.onEnd) { options.onEnd.call(thisObj, data); }++ if (options._onFinish) {+ options._onFinish();+ } }, _getEventData: function (req) {@@ -4877,7 +4902,6 @@ self._progress(null, req); } - // Deal with script asynchronicity. if (isScript) { node.setAttribute('src', req.url);@@ -4935,9 +4959,22 @@ } else { // Script or CSS on everything else. Using DOM 0 events because that // evens the playing field with older IEs.- node.onerror = onError;- node.onload = onLoad; + if (ua.ie >= 10) {++ // We currently need to introduce a timeout for IE10, since it + // calls onerror/onload synchronously for 304s - messing up existing+ // program flow. ++ // Remove this block if the following bug gets fixed by GA+ // https://connect.microsoft.com/IE/feedback/details/763871/dynamically-loaded-scripts-with-304s-responses-interrupt-the-currently-executing-js-thread-onload+ node.onerror = function() { setTimeout(onError, 0); };+ node.onload = function() { setTimeout(onLoad, 0); };+ } else {+ node.onerror = onError;+ node.onload = onLoad;+ }+ // If this browser doesn't fire an event when CSS fails to load, // fail after a timeout to avoid blocking the transaction queue. if (!env.cssFail && !isScript) {@@ -4945,8 +4982,6 @@ } } - this._waiting += 1;- this.nodes.push(node); insertBefore.parentNode.insertBefore(node, insertBefore); },@@ -4962,7 +4997,7 @@ // for anything to load, then we're done! if (this._queue.length) { this._insert(this._queue.shift());- } else if (!this._waiting) {+ } else if (!this._reqsWaiting) { this._finish(); } },@@ -5069,13 +5104,14 @@ this._pending = null; } - this._waiting -= 1;+ this._reqsWaiting -= 1;+ this._next(); } }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('features', function (Y, NAME) { var feature_tests = {};@@ -5200,7 +5236,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -5229,10 +5265,8 @@ // dd-gestures add('load', '2', { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }); // dom-style-ie add('load', '3', {@@ -5394,8 +5428,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -5407,8 +5441,22 @@ "trigger": "widget-base", "ua": "ie" });+// yql-nodejs+add('load', '18', {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+});+// yql-winjs+add('load', '19', {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+}); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('intl-base', function (Y, NAME) { /**@@ -5496,7 +5544,7 @@ }); -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-log', function (Y, NAME) { /**@@ -5606,7 +5654,7 @@ }; -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('yui-later', function (Y, NAME) { /**@@ -5683,7 +5731,7 @@ -}, '3.7.2', {"requires": ["yui-base"]});+}, '3.7.3', {"requires": ["yui-base"]}); YUI.add('loader-base', function (Y, NAME) { /**@@ -5699,7 +5747,7 @@ BUILD = '/build/', ROOT = VERSION + BUILD, CDN_BASE = Y.Env.base,- GALLERY_VERSION = 'gallery-2012.09.19-20-07',+ GALLERY_VERSION = 'gallery-2012.10.10-19-59', TNT = '2in3', TNT_VERSION = '4', YUI2_VERSION = '2.9.0',@@ -5721,7 +5769,7 @@ patterns: {} }, groups = META.groups, yui2Update = function(tnt, yui2, config) {- + var root = TNT + '.' + (tnt || TNT_VERSION) + '/' + (yui2 || YUI2_VERSION) + BUILD,@@ -5784,7 +5832,7 @@ } -/*jslint forin: true */+/*jslint forin: true, maxlen: 350 */ /** * Loader dynamically loads script and css files. It includes the dependency@@ -5812,14 +5860,13 @@ ROOT_LANG = '', YObject = Y.Object, oeach = YObject.each,- YArray = Y.Array,+ yArray = Y.Array, _queue = GLOBAL_ENV._loaderQueue, META = GLOBAL_ENV[VERSION], SKIN_PREFIX = 'skin-', L = Y.Lang, ON_PAGE = GLOBAL_ENV.mods, modulekey,- cache, _path = function(dir, file, type, nomin) { var path = dir + '/' + file; if (!nomin) {@@ -5862,7 +5909,7 @@ require: ['node', 'dd', 'console'] }); var out = loader.resolve(true);- + * @constructor * @class Loader * @param {Object} config an optional set of configuration options.@@ -5893,7 +5940,7 @@ Y.Loader = function(o) { var self = this;- + //Catch no config passed. o = o || {}; @@ -6019,7 +6066,7 @@ */ self.combine = o.base && (o.base.indexOf(self.comboBase.substr(0, 20)) > -1);- + /** * The default seperator to use between files in a combo URL * @property comboSep@@ -6171,7 +6218,7 @@ * // the default root directory for a skin. ex: * // http://yui.yahooapis.com/2.3.0/build/assets/skins/sam/ * base: 'assets/skins/',- * + * * // Any component-specific overrides can be specified here, * // making it possible to load different skins for different * // components. It is possible to load more than one skin@@ -6209,7 +6256,7 @@ */ self.loaded = GLOBAL_LOADED[VERSION]; - + /** * Should Loader fetch scripts in `async`, defaults to `true` * @property async@@ -6223,14 +6270,14 @@ self._config(o); - self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; + self.forceMap = (self.force) ? Y.Array.hash(self.force) : {}; self.testresults = null; if (Y.config.tests) { self.testresults = Y.config.tests; }- + /** * List of rollup files found in the library metadata * @property rollups@@ -6342,15 +6389,17 @@ /** * Reset modules in the module cache to a pre-processed state so additional * computations with a different skin or language will work as expected.- * @private _resetModules+ * @method _resetModules+ * @private */ _resetModules: function() {- var self = this, i, o;+ var self = this, i, o,+ mod, name, details; for (i in self.moduleInfo) { if (self.moduleInfo.hasOwnProperty(i)) {- var mod = self.moduleInfo[i],- name = mod.name,- details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null);+ mod = self.moduleInfo[i];+ name = mod.name;+ details = (YUI.Env.mods[name] ? YUI.Env.mods[name].details : null); if (details) { self.moduleInfo[name]._reset = true;@@ -6387,7 +6436,7 @@ @since 3.5.0 **/ REGEX_CSS: /\.css(?:[?;].*)?$/i,- + /** * Default filters for raw and debug * @property FILTER_DEFS@@ -6437,7 +6486,7 @@ mr = m && m.requires; if (m) {- if (!m._inspected && req && mr.length != req.length) {+ if (!m._inspected && req && mr.length !== req.length) { // console.log('deleting ' + m.name); delete m.expanded; }@@ -6503,13 +6552,13 @@ } // check if this module requires the other directly- // if (r && YArray.indexOf(r, mod2) > -1) {+ // if (r && yArray.indexOf(r, mod2) > -1) { if (rm && (mod2 in rm)) { return true; } // external css files should be sorted below yui css- if (m.ext && m.type == CSS && !other.ext && other.type == CSS) {+ if (m.ext && m.type === CSS && !other.ext && other.type === CSS) { return true; } @@ -6522,15 +6571,17 @@ * @param {Object} o The new configuration */ _config: function(o) {- var i, j, val, a, f, group, groupName, self = this;+ var i, j, val, a, f, group, groupName, self = this,+ mods = [], mod; // apply config values if (o) { for (i in o) { if (o.hasOwnProperty(i)) { val = o[i];- if (i == 'require') {+ //TODO This should be a case+ if (i === 'require') { self.require(val);- } else if (i == 'skin') {+ } else if (i === 'skin') { //If the config.skin is a string, format to the expected object if (typeof val === 'string') { self.skin.defaultSkin = o.skin;@@ -6540,7 +6591,7 @@ } Y.mix(self.skin, val, true);- } else if (i == 'groups') {+ } else if (i === 'groups') { for (j in val) { if (val.hasOwnProperty(j)) { groupName = j;@@ -6556,7 +6607,7 @@ } } - } else if (i == 'modules') {+ } else if (i === 'modules') { // add a hash of module definitions for (j in val) { if (val.hasOwnProperty(j)) {@@ -6569,9 +6620,9 @@ self.addAlias(val[j], j); } }- } else if (i == 'gallery') {+ } else if (i === 'gallery') { this.groups.gallery.update(val, o);- } else if (i == 'yui2' || i == '2in3') {+ } else if (i === 'yui2' || i === '2in3') { this.groups.yui2.update(o['2in3'], o.yui2, o); } else { self[i] = val;@@ -6587,16 +6638,15 @@ f = f.toUpperCase(); self.filterName = f; self.filter = self.FILTER_DEFS[f];- if (f == 'DEBUG') {+ if (f === 'DEBUG') { self.require('yui-log', 'dump'); } } if (self.filterName && self.coverage) {- if (self.filterName == 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) {- var mods = [];+ if (self.filterName === 'COVERAGE' && L.isArray(self.coverage) && self.coverage.length) { for (i = 0; i < self.coverage.length; i++) {- var mod = self.coverage[i];+ mod = self.coverage[i]; if (self.moduleInfo[mod] && self.moduleInfo[mod].use) { mods = [].concat(mods, self.moduleInfo[mod].use); } else {@@ -6611,14 +6661,7 @@ self.filter = self.FILTER_DEFS[self.filterName]; } }- - if (self.lang) {- //Removed this so that when Loader is invoked- //it doesn't request what it doesn't need.- //self.require('intl-base', 'intl');- }- }, /**@@ -6794,7 +6837,13 @@ if (typeof o === 'string') { o = { name: name, fullpath: o }; }- +++ var subs, i, l, t, sup, s, smod, plugins, plug,+ j, langs, packName, supName, flatSup, flatLang, lang, ret,+ overrides, skinname, when, g, p,+ conditions = this.conditions, trigger;+ //Only merge this data if the temp flag is set //from an earlier pass from a pattern or else //an override module (YUI_config) can not be used to@@ -6817,7 +6866,7 @@ if (!o.type) { //Always assume it's javascript unless the CSS pattern is matched. o.type = JS;- var p = o.path || o.fullpath;+ p = o.path || o.fullpath; if (p && this.REGEX_CSS.test(p)) { o.type = CSS; }@@ -6831,16 +6880,12 @@ o.ext = ('ext' in o) ? o.ext : (this._internal) ? false : true; // Handle submodule logic- var subs = o.submodules, i, l, t, sup, s, smod, plugins, plug,- j, langs, packName, supName, flatSup, flatLang, lang, ret,- overrides, skinname, when, g,- conditions = this.conditions, trigger;- // , existing = this.moduleInfo[name], newr;- + subs = o.submodules;+ this.moduleInfo[name] = o; o.requires = o.requires || [];- + /* Only allowing the cascade of requires information, since optional and supersedes are far more fine grained than@@ -6873,13 +6918,13 @@ skinname = this._addSkin(this.skin.defaultSkin, name); o.requires.unshift(skinname); }- + if (o.requires.length) { o.requires = this.filterRequires(o.requires) || []; } if (!o.langPack && o.lang) {- langs = YArray(o.lang);+ langs = yArray(o.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -6930,7 +6975,7 @@ // specified in the child modules. if (s.lang && s.lang.length) { - langs = YArray(s.lang);+ langs = yArray(s.lang); for (j = 0; j < langs.length; j++) { lang = langs[j]; packName = this.getLangPackName(lang, name);@@ -6941,7 +6986,7 @@ smod = this._addLangPack(lang, o, packName); } - flatSup = flatSup || YArray.hash(smod.supersedes);+ flatSup = flatSup || yArray.hash(smod.supersedes); if (!(supName in flatSup)) { smod.supersedes.push(supName);@@ -6949,7 +6994,7 @@ o.lang = o.lang || []; - flatLang = flatLang || YArray.hash(o.lang);+ flatLang = flatLang || yArray.hash(o.lang); if (!(lang in flatLang)) { o.lang.push(lang);@@ -6979,8 +7024,8 @@ l++; } }- //o.supersedes = YObject.keys(YArray.hash(sup));- o.supersedes = YArray.dedupe(sup);+ //o.supersedes = YObject.keys(yArray.hash(sup));+ o.supersedes = yArray.dedupe(sup); if (this.allowRollup) { o.rollup = (l < 4) ? l : Math.min(l - 1, 4); }@@ -7020,15 +7065,15 @@ conditions[trigger][name] = o.condition; // the 'when' attribute can be 'before', 'after', or 'instead' // the default is after.- if (when && when != 'after') {- if (when == 'instead') { // replace the trigger+ if (when && when !== 'after') {+ if (when === 'instead') { // replace the trigger o.supersedes = o.supersedes || []; o.supersedes.push(trigger);- } else { // before the trigger+ }+ // before the trigger // the trigger requires the conditional mod, // so it should appear before the conditional // mod if we do not intersede.- } } else { // after the trigger o.after = o.after || []; o.after.push(trigger);@@ -7042,7 +7087,7 @@ if (o.after) { o.after = this.filterRequires(o.after);- o.after_map = YArray.hash(o.after);+ o.after_map = yArray.hash(o.after); } // this.dirty = true;@@ -7073,15 +7118,15 @@ * @param {string[] | string*} what the modules to load. */ require: function(what) {- var a = (typeof what === 'string') ? YArray(arguments) : what;+ var a = (typeof what === 'string') ? yArray(arguments) : what; this.dirty = true;- this.required = Y.merge(this.required, YArray.hash(this.filterRequires(a)));+ this.required = Y.merge(this.required, yArray.hash(this.filterRequires(a))); this._explodeRollups(); }, /** * Grab all the items that were asked for, check to see if the Loader- * meta-data contains a "use" array. If it doesm remove the asked item and replace it with + * meta-data contains a "use" array. If it doesm remove the asked item and replace it with * the content of the "use". * This will make asking for: "dd" * Actually ask for: "dd-ddm-base,dd-ddm,dd-ddm-drop,dd-drag,dd-proxy,dd-constrain,dd-drop,dd-scroll,dd-drop-plugin"@@ -7174,7 +7219,7 @@ var i, m, j, add, packName, lang, testresults = this.testresults, name = mod.name, cond, adddef = ON_PAGE[name] && ON_PAGE[name].details,- d, k, m1, go, def,+ d, go, def, r, old_mod, o, skinmod, skindef, skinpar, skinname, intl = mod.lang || mod.intl,@@ -7194,15 +7239,15 @@ } // console.log('cache: ' + mod.langCache + ' == ' + this.lang);- + //If a skin or a lang is different, reparse.. reparse = !((!this.lang || mod.langCache === this.lang) && (mod.skinCache === this.skin.defaultSkin)); if (mod.expanded && !reparse) { return mod.expanded; }- + d = []; hash = {}; r = this.filterRequires(mod.requires);@@ -7289,7 +7334,7 @@ if (testresults && ftests) { oeach(testresults, function(result, id) { var condmod = ftests[id].name;- if (!hash[condmod] && ftests[id].trigger == name) {+ if (!hash[condmod] && ftests[id].trigger === name) { if (result && ftests[id]) { hash[condmod] = true; d.push(condmod);@@ -7368,7 +7413,7 @@ d.unshift(INTL); } - mod.expanded_map = YArray.hash(d);+ mod.expanded_map = yArray.hash(d); mod.expanded = YObject.keys(mod.expanded_map); @@ -7390,7 +7435,7 @@ mod = YUI.Env._cssLoaded[name], style = el.currentStyle; //IE - + if (mod !== undefined) { return mod; }@@ -7433,7 +7478,7 @@ s = m.supersedes; if (s) {- YArray.each(s, function(v) {+ yArray.each(s, function(v) { Y.mix(o, this.getProvides(v)); }, this); }@@ -7541,8 +7586,8 @@ if (m) { // remove dups- //m.requires = YObject.keys(YArray.hash(m.requires));- m.requires = YArray.dedupe(m.requires);+ //m.requires = YObject.keys(yArray.hash(m.requires));+ m.requires = yArray.dedupe(m.requires); // Create lang pack modules //if (m.lang && m.lang.length) {@@ -7568,7 +7613,7 @@ // add the ignore list to the list of loaded packages if (this.ignore) {- Y.mix(l, YArray.hash(this.ignore));+ Y.mix(l, yArray.hash(this.ignore)); } // expand the list to include superseded modules@@ -7612,30 +7657,30 @@ _explode: function() { //TODO Move done out of scope var r = this.required, m, reqs, done = {},- self = this, name;+ self = this, name, expound; // the setup phase is over, all modules have been created self.dirty = false; self._explodeRollups(); r = self.required;- + for (name in r) { if (r.hasOwnProperty(name)) { if (!done[name]) { done[name] = true; m = self.getModule(name); if (m) {- var expound = m.expound;+ expound = m.expound; if (expound) { r[expound] = self.getModule(expound); reqs = self.getRequires(r[expound]);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } reqs = self.getRequires(m);- Y.mix(r, YArray.hash(reqs));+ Y.mix(r, yArray.hash(reqs)); } } }@@ -7674,7 +7719,7 @@ for (pname in patterns) { if (patterns.hasOwnProperty(pname)) { p = patterns[pname];- + //There is no test method, create a default one that tests // the pattern against the mod name if (!p.test) {@@ -7729,7 +7774,7 @@ r = r || this.required; var i, j, s, m, type = this.loadType,- ignore = this.ignore ? YArray.hash(this.ignore) : false;+ ignore = this.ignore ? yArray.hash(this.ignore) : false; for (i in r) { if (r.hasOwnProperty(i)) {@@ -7737,7 +7782,7 @@ // remove if already loaded if (((this.loaded[i] || ON_PAGE[i]) && !this.forceMap[i] && !this.ignoreRegistered) ||- (type && m && m.type != type)) {+ (type && m && m.type !== type)) { delete r[i]; } if (ignore && ignore[i]) {@@ -7787,7 +7832,7 @@ var self = this, skipped = Y.merge(self.skipped), fn, failed = [], rreg = self.requireRegistration, success, msg, i, mod;- + for (i in skipped) { if (skipped.hasOwnProperty(i)) { delete self.inserted[i];@@ -7795,11 +7840,11 @@ } self.skipped = {};- + for (i in self.inserted) { if (self.inserted.hasOwnProperty(i)) { mod = self.getModule(i);- if (mod && rreg && mod.type == JS && !(i in YUI.Env.mods)) {+ if (mod && rreg && mod.type === JS && !(i in YUI.Env.mods)) { failed.push(i); } else { Y.mix(self.loaded, self.getProvides(i));@@ -7848,14 +7893,14 @@ */ _onFailure: function(o) { var f = this.onFailure, msg = [], i = 0, len = o.errors.length;- + for (i; i < len; i++) { msg.push(o.errors[i].error); } msg = msg.join(','); - + if (f) { f.call(this.context, { msg: msg,@@ -7863,7 +7908,7 @@ success: false }); }- + this._finish(msg, false); },@@ -7976,13 +8021,10 @@ // build the dependency list // don't include type so we can process CSS and script in // one pass when the type is not specified.- if (!skipcalc) {- //this.calculate(o);- } var modules = this.resolve(!skipcalc), self = this, comp = 0, actions = 0,- mods = {}, deps;+ mods = {}, deps, complete; self._refetch = []; @@ -8002,7 +8044,7 @@ //console.log('Resolved Modules: ', modules); - var complete = function(d) {+ complete = function(d) { actions++; var errs = {}, i = 0, o = 0, u = '', fn, modName, resMods;@@ -8017,7 +8059,7 @@ errs[u] = u; } }- + if (d && d.data && d.data.length && (d.type === 'success')) { for (i = 0; i < d.data.length; i++) { self.inserted[d.data[i].name] = true;@@ -8079,8 +8121,8 @@ }); return; }- + if (modules.css.length) { //Load CSS first Y.Get.css(modules.css, { data: modules.cssMods,@@ -8178,7 +8220,7 @@ * been loaded (which is usually why it is time to load the next * one). */- loadNext: function(mname) {+ loadNext: function() { return; }, @@ -8246,15 +8288,15 @@ */ resolve: function(calc, s) { - var len, i, m, url, fn, msg, attr, group, groupName, j, frag,+ var len, i, m, url, group, groupName, j, frag, comboSource, comboSources, mods, comboBase, base, urls, u = [], tmpBase, baseLen, resCombos = {},- self = this, comboSep, maxURLLength, singles = [],+ self = this, comboSep, maxURLLength, inserted = (self.ignoreRegistered) ? {} : self.inserted, resolved = { js: [], jsMods: [], css: [], cssMods: [] },- type = self.loadType || 'js';+ type = self.loadType || 'js', addSingle; - if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { + if (self.skin.overrides || self.skin.defaultSkin !== DEFAULT_SKIN || self.ignoreRegistered) { self._resetModules(); } @@ -8263,11 +8305,11 @@ } s = s || self.sorted; - var addSingle = function(m) {- + addSingle = function(m) {+ if (m) { group = (m.group && self.groups[m.group]) || NOT_FOUND;- + //Always assume it's async if (group.async === false) { m.async = group.async;@@ -8275,7 +8317,7 @@ url = (m.fullpath) ? self._filter(m.fullpath, s[i]) : self._url(m.path, s[i], group.base || m.base);- + if (m.attributes || m.async === false) { url = { url: url,@@ -8289,7 +8331,7 @@ resolved[m.type + 'Mods'].push(m); } else { }- + }; len = s.length;@@ -8310,7 +8352,6 @@ if (!group.combine || m.fullpath) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -8327,7 +8368,6 @@ } else { if (!self.combine) { //This is not a combo module, skip it and load it singly later.- //singles.push(s[i]); addSingle(m); continue; }@@ -8343,7 +8383,7 @@ url = j; mods = comboSources[j]; len = mods.length;- + if (len) { for (i = 0; i < len; i++) { if (inserted[mods[i]]) {@@ -8363,7 +8403,6 @@ } else { //Add them to the next process.. if (mods[i]) {- //singles.push(mods[i].name); addSingle(mods[i]); } }@@ -8388,7 +8427,7 @@ if (maxURLLength <= base.length) { maxURLLength = MAX_URL_LENGTH; }- + if (len) { if (baseLen > maxURLLength) { u = [];@@ -8449,7 +8488,7 @@ } var self = this, out = self.resolve(true);- + self.data = out; self.onEnd = function() {@@ -8462,7 +8501,7 @@ -}, '3.7.2', {"requires": ["get", "features"]});+}, '3.7.3', {"requires": ["get", "features"]}); YUI.add('loader-rollup', function (Y, NAME) { /**@@ -8532,7 +8571,7 @@ // increment the counter if this module is required. // if we are beyond the rollup threshold, we will // use the rollup module- } else if (r[s[j]] && m.type == smod.type) {+ } else if (r[s[j]] && m.type === smod.type) { c++; roll = (c >= m.rollup); if (roll) {@@ -8561,7 +8600,7 @@ }; -}, '3.7.2', {"requires": ["loader-base"]});+}, '3.7.3', {"requires": ["loader-base"]}); YUI.add('loader-yui3', function (Y, NAME) { /* This file is auto-generated by src/loader/scripts/meta_join.js */@@ -8684,7 +8723,7 @@ node = doc ? doc.documentElement : null; if (node && node.style) {- return ('MozTransition' in node.style || 'WebkitTransition' in node.style);+ return ('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style); } return false;@@ -9248,6 +9287,7 @@ "requires": [ "datasource-local", "plugin",+ "datatype-xml", "dataschema-xml" ] },@@ -9572,10 +9612,8 @@ "dd-gestures": { "condition": { "name": "dd-gestures",- "test": function(Y) {- return ((Y.config.win && ("ontouchstart" in Y.config.win)) && !(Y.UA.chrome && Y.UA.chrome < 6));-},- "trigger": "dd-drag"+ "trigger": "dd-drag",+ "ua": "touchEnabled" }, "requires": [ "dd-drag",@@ -10795,7 +10833,8 @@ "test-console": { "requires": [ "console-filters",- "test"+ "test",+ "array-extras" ], "skinnable": true },@@ -10841,8 +10880,8 @@ ret = true; if (node && node.style) {- ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style);- } + ret = !('MozTransition' in node.style || 'WebkitTransition' in node.style || 'transition' in node.style);+ } return ret; },@@ -11034,6 +11073,22 @@ "jsonp-url" ] },+ "yql-nodejs": {+ "condition": {+ "name": "yql-nodejs",+ "trigger": "yql",+ "ua": "nodejs",+ "when": "after"+ }+ },+ "yql-winjs": {+ "condition": {+ "name": "yql-winjs",+ "trigger": "yql",+ "ua": "winjs",+ "when": "after"+ }+ }, "yui": {}, "yui-base": {}, "yui-later": {@@ -11052,8 +11107,8 @@ ] } };-YUI.Env[Y.version].md5 = '5fe7d71505fef8108b090c35db73bcde';+YUI.Env[Y.version].md5 = 'a28e022ad022130f7a4fb4ac77a2f1df'; -}, '3.7.2', {"requires": ["loader-base"]});-YUI.add('yui', function (Y, NAME) {}, '3.7.2', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});+}, '3.7.3', {"requires": ["loader-base"]});+YUI.add('yui', function (Y, NAME) {}, '3.7.3', {"use": ["yui-base", "get", "features", "intl-base", "yui-log", "yui-later", "loader-base", "loader-rollup", "loader-yui3"]});
happstack-yui.cabal view
@@ -1,8 +1,8 @@ Name : happstack-yui-Version : 7372.5.1+Version : 7373.5.2 Category : Web, Happstack Synopsis : Utilities for using YUI3 with Happstack.-Homepage : https://github.com/dag/happstack-yui+Homepage : http://hub.darcs.net/dag/yui/browse/happstack-yui License : BSD3 License-File : LICENSE Maintainer : dag.odenhall@gmail.com@@ -10,7 +10,7 @@ Build-Type : Simple Description :- Bundles YUI 3.7.2 and includes a \"combo handler\" for use in+ Bundles YUI 3.7.3 and includes a \"combo handler\" for use in Happstack which concatenates YUI modules server-side to send in a single HTTP request. The YUI bundle can be embedded in compiled code with Template Haskell (install with @-fembed@) which means the files are@@ -356,6 +356,10 @@ bundle/history-base/history-base.js bundle/history-base/history-base-min.js bundle/history-base/history-base-coverage.js+bundle/yql-nodejs/yql-nodejs-debug.js+bundle/yql-nodejs/yql-nodejs-coverage.js+bundle/yql-nodejs/yql-nodejs-min.js+bundle/yql-nodejs/yql-nodejs.js bundle/recordset-filter/recordset-filter.js bundle/recordset-filter/recordset-filter-min.js bundle/recordset-filter/recordset-filter-coverage.js@@ -375,6 +379,10 @@ bundle/dataschema-array/dataschema-array.js bundle/dataschema-array/dataschema-array-coverage.js bundle/dataschema-array/dataschema-array-min.js+bundle/yql-winjs/yql-winjs-coverage.js+bundle/yql-winjs/yql-winjs.js+bundle/yql-winjs/yql-winjs-min.js+bundle/yql-winjs/yql-winjs-debug.js bundle/swf/swf-min.js bundle/swf/swf.js bundle/swf/swf-debug.js@@ -1707,9 +1715,6 @@ bundle/graphics-vml/graphics-vml.js bundle/graphics-vml/graphics-vml-min.js bundle/graphics-vml/graphics-vml-coverage.js-bundle/transition-native/transition-native-min.js-bundle/transition-native/transition-native.js-bundle/transition-native/transition-native-debug.js bundle/widget-stack/widget-stack-debug.js bundle/widget-stack/assets/skins/sam/widget-stack-skin.css bundle/widget-stack/assets/skins/sam/widget-stack.css@@ -1746,8 +1751,8 @@ Default : False Source-Repository head- Type : git- Location : git://github.com/dag/happstack-yui.git+ Type : darcs+ Location : http://hub.darcs.net/dag/yui Library HS-Source-Dirs : src@@ -1778,16 +1783,16 @@ if !flag(embed) CPP-Options :- -DYUI_VERSION=3.7.2- -DYUI_VERSION_STR="3.7.2"+ -DYUI_VERSION=3.7.3+ -DYUI_VERSION_STR="3.7.3" Other-Modules : Paths_happstack_yui Build-Depends : directory == 1.1.* else CPP-Options :- -DYUI_VERSION=3.7.2- -DYUI_VERSION_STR="3.7.2"+ -DYUI_VERSION=3.7.3+ -DYUI_VERSION_STR="3.7.3" -DEMBED Build-Depends : file-embed == 0.0.*